aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcvs2svn <cvs2svn@FreeBSD.org>2002-02-01 18:16:03 +0000
committercvs2svn <cvs2svn@FreeBSD.org>2002-02-01 18:16:03 +0000
commit5f1ec71305f192ecc7b4e5fed40c9c0ea1a52d58 (patch)
treebd76aa6d942a9db989291ec338a558b2a044a585
parent1952e2e1c1be6f107fa3ce8b10025cfd1cd7943b (diff)
This commit was manufactured by cvs2svn to create tagvendor/gcc/cvs-20020201-0820
'gcc-vendor-gcc_cvs_20020201_0820'.
Notes
Notes: svn path=/vendor/gcc/dist/; revision=90075 svn path=/vendor/gcc/cvs-20020201-0820/; revision=90077; tag=vendor/gcc/cvs-20020201-0820
-rw-r--r--contrib/gcc/BUGS27
-rw-r--r--contrib/gcc/NEWS1539
-rw-r--r--contrib/gcc/PROBLEMS117
-rw-r--r--contrib/gcc/PROJECTS449
-rw-r--r--contrib/gcc/README26
-rw-r--r--contrib/gcc/README-bugs144
-rw-r--r--contrib/gcc/README.DWARF574
-rw-r--r--contrib/gcc/README.TRAD55
-rw-r--r--contrib/gcc/TESTS.FLUNK39
-rw-r--r--contrib/gcc/ansidecl.h163
-rw-r--r--contrib/gcc/assert.h54
-rw-r--r--contrib/gcc/build-make35
-rw-r--r--contrib/gcc/c-iterate.c604
-rw-r--r--contrib/gcc/c-parse.gperf88
-rw-r--r--contrib/gcc/cccp.1674
-rw-r--r--contrib/gcc/cccp.c11136
-rw-r--r--contrib/gcc/cexp.y1222
-rw-r--r--contrib/gcc/choose-temp.c203
-rw-r--r--contrib/gcc/config/alpha/crtbegin.asm192
-rw-r--r--contrib/gcc/config/alpha/crtend.asm108
-rw-r--r--contrib/gcc/config/alpha/gdb-osf12.h26
-rw-r--r--contrib/gcc/config/alpha/gdb-osf2.h26
-rw-r--r--contrib/gcc/config/alpha/gdb.h26
-rw-r--r--contrib/gcc/config/alpha/netbsd-elf.h32
-rw-r--r--contrib/gcc/config/alpha/osf2.h32
-rw-r--r--contrib/gcc/config/alpha/t-crtbe9
-rw-r--r--contrib/gcc/config/alpha/vms-tramp.asm22
-rw-r--r--contrib/gcc/config/alpha/x-alpha2
-rw-r--r--contrib/gcc/config/alpha/xm-alpha.h76
-rw-r--r--contrib/gcc/config/alpha/xm-openbsd.h23
-rw-r--r--contrib/gcc/config/i386/config-nt.sed38
-rw-r--r--contrib/gcc/config/i386/dgux.c192
-rw-r--r--contrib/gcc/config/i386/freebsd-elf.h257
-rw-r--r--contrib/gcc/config/i386/freebsd.h.fixed257
-rw-r--r--contrib/gcc/config/i386/os2.h76
-rw-r--r--contrib/gcc/config/i386/perform.h98
-rw-r--r--contrib/gcc/config/i386/sco.h117
-rw-r--r--contrib/gcc/config/i386/sco4.h86
-rw-r--r--contrib/gcc/config/i386/sco4dbx.h81
-rw-r--r--contrib/gcc/config/i386/sco5gas.h24
-rw-r--r--contrib/gcc/config/i386/t-i386bare3
-rw-r--r--contrib/gcc/config/i386/t-vsta2
-rw-r--r--contrib/gcc/config/i386/t-winnt6
-rw-r--r--contrib/gcc/config/i386/win-nt.h150
-rw-r--r--contrib/gcc/config/i386/x-aix12
-rw-r--r--contrib/gcc/config/i386/x-cygwin4
-rw-r--r--contrib/gcc/config/i386/x-dgux11
-rw-r--r--contrib/gcc/config/i386/x-djgpp24
-rw-r--r--contrib/gcc/config/i386/x-freebsd3
-rw-r--r--contrib/gcc/config/i386/x-isc3
-rw-r--r--contrib/gcc/config/i386/x-isc34
-rw-r--r--contrib/gcc/config/i386/x-ncr300034
-rw-r--r--contrib/gcc/config/i386/x-next3
-rw-r--r--contrib/gcc/config/i386/x-osf1elf8
-rw-r--r--contrib/gcc/config/i386/x-osfrose27
-rw-r--r--contrib/gcc/config/i386/x-sco7
-rw-r--r--contrib/gcc/config/i386/x-sco410
-rw-r--r--contrib/gcc/config/i386/x-sco510
-rw-r--r--contrib/gcc/config/i386/x-sysv31
-rw-r--r--contrib/gcc/config/i386/x-vsta1
-rw-r--r--contrib/gcc/config/i386/xm-aix.h2
-rw-r--r--contrib/gcc/config/i386/xm-bsd386.h3
-rw-r--r--contrib/gcc/config/i386/xm-dos.h38
-rw-r--r--contrib/gcc/config/i386/xm-freebsd.h4
-rw-r--r--contrib/gcc/config/i386/xm-gnu.h5
-rw-r--r--contrib/gcc/config/i386/xm-i386.h43
-rw-r--r--contrib/gcc/config/i386/xm-isc.h4
-rw-r--r--contrib/gcc/config/i386/xm-linux.h24
-rw-r--r--contrib/gcc/config/i386/xm-lynx.h33
-rw-r--r--contrib/gcc/config/i386/xm-next.h5
-rw-r--r--contrib/gcc/config/i386/xm-openbsd.h23
-rw-r--r--contrib/gcc/config/i386/xm-os2.h75
-rw-r--r--contrib/gcc/config/i386/xm-osf.h2
-rw-r--r--contrib/gcc/config/i386/xm-osf1elf.h6
-rw-r--r--contrib/gcc/config/i386/xm-sco.h13
-rw-r--r--contrib/gcc/config/i386/xm-sco5.h7
-rw-r--r--contrib/gcc/config/i386/xm-sysv4.h5
-rw-r--r--contrib/gcc/config/i386/xm-uwin.h39
-rw-r--r--contrib/gcc/config/i386/xm-winnt.h24
-rw-r--r--contrib/gcc/config/sparc/t-sp642
-rw-r--r--contrib/gcc/config/sparc/t-sunos407
-rw-r--r--contrib/gcc/config/sparc/x-sysv42
-rw-r--r--contrib/gcc/config/sparc/xm-linux.h26
-rw-r--r--contrib/gcc/config/sparc/xm-lynx.h39
-rw-r--r--contrib/gcc/config/sparc/xm-openbsd.h23
-rw-r--r--contrib/gcc/config/sparc/xm-pbd.h10
-rw-r--r--contrib/gcc/config/sparc/xm-sol2.h4
-rw-r--r--contrib/gcc/config/sparc/xm-sp64.h27
-rw-r--r--contrib/gcc/config/sparc/xm-sparc.h49
-rw-r--r--contrib/gcc/config/sparc/xm-sysv4-64.h27
-rw-r--r--contrib/gcc/config/sparc/xm-sysv4.h48
-rw-r--r--contrib/gcc/config/x-linux5
-rw-r--r--contrib/gcc/config/x-linux-aout14
-rw-r--r--contrib/gcc/config/x-lynx6
-rw-r--r--contrib/gcc/config/x-svr49
-rw-r--r--contrib/gcc/config/xm-alloca.h4
-rw-r--r--contrib/gcc/config/xm-freebsd.h24
-rw-r--r--contrib/gcc/config/xm-gnu.h32
-rw-r--r--contrib/gcc/config/xm-interix.h77
-rw-r--r--contrib/gcc/config/xm-linux.h33
-rw-r--r--contrib/gcc/config/xm-lynx.h51
-rw-r--r--contrib/gcc/config/xm-openbsd.h35
-rw-r--r--contrib/gcc/config/xm-siglist.h6
-rw-r--r--contrib/gcc/config/xm-std32.h34
-rw-r--r--contrib/gcc/config/xm-svr3.h25
-rw-r--r--contrib/gcc/config/xm-svr4.h29
-rw-r--r--contrib/gcc/configure.lang233
-rw-r--r--contrib/gcc/cp/Makefile.in324
-rw-r--r--contrib/gcc/cp/errfn.c352
-rw-r--r--contrib/gcc/cp/exception.cc343
-rw-r--r--contrib/gcc/cp/g++.c582
-rw-r--r--contrib/gcc/cp/gxx.gperf111
-rw-r--r--contrib/gcc/cp/gxxint.texi2075
-rw-r--r--contrib/gcc/cp/inc/exception39
-rw-r--r--contrib/gcc/cp/inc/new42
-rw-r--r--contrib/gcc/cp/inc/new.h11
-rw-r--r--contrib/gcc/cp/inc/typeinfo58
-rw-r--r--contrib/gcc/cp/input.c207
-rw-r--r--contrib/gcc/cp/new.cc42
-rw-r--r--contrib/gcc/cp/new1.cc89
-rw-r--r--contrib/gcc/cp/new2.cc80
-rw-r--r--contrib/gcc/cp/reno.texi752
-rw-r--r--contrib/gcc/cp/sig.c1067
-rw-r--r--contrib/gcc/cp/tinfo.cc134
-rw-r--r--contrib/gcc/cp/tinfo.h55
-rw-r--r--contrib/gcc/cp/tinfo2.cc300
-rw-r--r--contrib/gcc/cplus-dem.c4615
-rw-r--r--contrib/gcc/cpp.11
-rw-r--r--contrib/gcc/cpp.texi2967
-rw-r--r--contrib/gcc/cppalloc.c81
-rw-r--r--contrib/gcc/cppulp.c26
-rw-r--r--contrib/gcc/cross-make14
-rw-r--r--contrib/gcc/demangle.h95
-rw-r--r--contrib/gcc/doprint.c295
-rwxr-xr-xcontrib/gcc/dostage22
-rwxr-xr-xcontrib/gcc/dostage33
-rw-r--r--contrib/gcc/dwarfout.h42
-rw-r--r--contrib/gcc/dyn-string.c97
-rw-r--r--contrib/gcc/dyn-string.h32
-rw-r--r--contrib/gcc/eh-common.h142
-rwxr-xr-xcontrib/gcc/exgettext118
-rw-r--r--contrib/gcc/extend.texi3782
-rw-r--r--contrib/gcc/f/BUGS159
-rw-r--r--contrib/gcc/f/INSTALL352
-rw-r--r--contrib/gcc/f/Makefile.in529
-rw-r--r--contrib/gcc/f/NEWS412
-rw-r--r--contrib/gcc/f/assert.j27
-rw-r--r--contrib/gcc/f/config.j27
-rw-r--r--contrib/gcc/f/convert.j28
-rw-r--r--contrib/gcc/f/flags.j27
-rw-r--r--contrib/gcc/f/g77.1365
-rw-r--r--contrib/gcc/f/g77install.texi2251
-rw-r--r--contrib/gcc/f/glimits.j28
-rw-r--r--contrib/gcc/f/hconfig.j27
-rw-r--r--contrib/gcc/f/input.j27
-rw-r--r--contrib/gcc/f/output.j27
-rw-r--r--contrib/gcc/f/proj.c68
-rw-r--r--contrib/gcc/f/rtl.j28
-rw-r--r--contrib/gcc/f/system.j27
-rw-r--r--contrib/gcc/f/tconfig.j27
-rw-r--r--contrib/gcc/f/tm.j27
-rw-r--r--contrib/gcc/f/toplev.j27
-rw-r--r--contrib/gcc/f/tree.j28
-rwxr-xr-xcontrib/gcc/fixcpp109
-rw-r--r--contrib/gcc/fixinc-nt.sed5
-rwxr-xr-xcontrib/gcc/fixincludes3265
-rw-r--r--contrib/gcc/frame.c872
-rw-r--r--contrib/gcc/frame.h85
-rw-r--r--contrib/gcc/gansidecl.h85
-rw-r--r--contrib/gcc/gcc.14191
-rw-r--r--contrib/gcc/gcc.texi4776
-rw-r--r--contrib/gcc/gcov.texi344
-rw-r--r--contrib/gcc/getopt.c1056
-rw-r--r--contrib/gcc/getopt.h133
-rw-r--r--contrib/gcc/getopt1.c190
-rw-r--r--contrib/gcc/getpwd.c90
-rw-r--r--contrib/gcc/ginclude/math-3300.h461
-rw-r--r--contrib/gcc/ginclude/math-68881.h529
-rw-r--r--contrib/gcc/ginclude/ppc-asm.h170
-rw-r--r--contrib/gcc/ginclude/proto.h4
-rw-r--r--contrib/gcc/ginclude/va-alpha.h128
-rw-r--r--contrib/gcc/ginclude/va-arc.h111
-rw-r--r--contrib/gcc/ginclude/va-c4x.h34
-rw-r--r--contrib/gcc/ginclude/va-clipper.h60
-rw-r--r--contrib/gcc/ginclude/va-h8300.h56
-rw-r--r--contrib/gcc/ginclude/va-i860.h214
-rw-r--r--contrib/gcc/ginclude/va-i960.h79
-rw-r--r--contrib/gcc/ginclude/va-m32r.h86
-rw-r--r--contrib/gcc/ginclude/va-m88k.h87
-rw-r--r--contrib/gcc/ginclude/va-mips.h277
-rw-r--r--contrib/gcc/ginclude/va-mn10200.h37
-rw-r--r--contrib/gcc/ginclude/va-mn10300.h35
-rw-r--r--contrib/gcc/ginclude/va-pa.h52
-rw-r--r--contrib/gcc/ginclude/va-ppc.h255
-rw-r--r--contrib/gcc/ginclude/va-pyr.h130
-rw-r--r--contrib/gcc/ginclude/va-sh.h229
-rw-r--r--contrib/gcc/ginclude/va-sparc.h165
-rw-r--r--contrib/gcc/ginclude/va-spur.h64
-rw-r--r--contrib/gcc/ginclude/va-v850.h34
-rw-r--r--contrib/gcc/install.texi2381
-rw-r--r--contrib/gcc/invoke.texi6785
-rwxr-xr-xcontrib/gcc/just-fixinc39
-rw-r--r--contrib/gcc/libgcc1-test.c106
-rw-r--r--contrib/gcc/libgcc1.c596
-rw-r--r--contrib/gcc/libiberty.h180
-rwxr-xr-xcontrib/gcc/listing227
-rw-r--r--contrib/gcc/makefile.vms413
-rw-r--r--contrib/gcc/md.texi4258
-rw-r--r--contrib/gcc/objc/Makefile.in73
-rw-r--r--contrib/gcc/objc/objc.gperf64
-rw-r--r--contrib/gcc/objc/sendmsg.c651
-rw-r--r--contrib/gcc/obstack.c593
-rw-r--r--contrib/gcc/obstack.h593
-rwxr-xr-xcontrib/gcc/patch-apollo-includes69
-rw-r--r--contrib/gcc/pcp.h101
-rw-r--r--contrib/gcc/pexecute.c734
-rw-r--r--contrib/gcc/pself.c1
-rw-r--r--contrib/gcc/pself1.c1
-rw-r--r--contrib/gcc/pself2.c1
-rw-r--r--contrib/gcc/pself3.c1
-rw-r--r--contrib/gcc/pself4.c2
-rw-r--r--contrib/gcc/pself5.c5
-rw-r--r--contrib/gcc/rtl.texi2998
-rw-r--r--contrib/gcc/sched.c4470
-rw-r--r--contrib/gcc/splay-tree.c368
-rw-r--r--contrib/gcc/splay-tree.h116
-rw-r--r--contrib/gcc/stupid.c770
-rw-r--r--contrib/gcc/tm.texi7691
-rw-r--r--contrib/libf2c/ChangeLog1842
-rw-r--r--contrib/libf2c/ChangeLog.egcs200
-rw-r--r--contrib/libf2c/Makefile.in262
-rw-r--r--contrib/libf2c/README109
-rw-r--r--contrib/libf2c/TODO14
-rw-r--r--contrib/libf2c/changes.netlib3026
-rwxr-xr-xcontrib/libf2c/configure1563
-rw-r--r--contrib/libf2c/configure.in164
-rw-r--r--contrib/libf2c/disclaimer.netlib15
-rw-r--r--contrib/libf2c/f2c.h64
-rw-r--r--contrib/libf2c/f2cext.c581
-rw-r--r--contrib/libf2c/g2c.hin236
-rw-r--r--contrib/libf2c/libF77/F77_aloc.c38
-rw-r--r--contrib/libf2c/libF77/Makefile.in247
-rw-r--r--contrib/libf2c/libF77/Notice23
-rw-r--r--contrib/libf2c/libF77/README.netlib112
-rw-r--r--contrib/libf2c/libF77/Version.c92
-rw-r--r--contrib/libf2c/libF77/abort_.c16
-rw-r--r--contrib/libf2c/libF77/c_abs.c14
-rw-r--r--contrib/libf2c/libF77/c_cos.c17
-rw-r--r--contrib/libf2c/libF77/c_div.c47
-rw-r--r--contrib/libf2c/libF77/c_exp.c19
-rw-r--r--contrib/libf2c/libF77/c_log.c17
-rw-r--r--contrib/libf2c/libF77/c_sin.c17
-rw-r--r--contrib/libf2c/libF77/c_sqrt.c35
-rw-r--r--contrib/libf2c/libF77/cabs.c27
-rwxr-xr-xcontrib/libf2c/libF77/configure1530
-rw-r--r--contrib/libf2c/libF77/configure.in114
-rw-r--r--contrib/libf2c/libF77/d_abs.c12
-rw-r--r--contrib/libf2c/libF77/d_acos.c13
-rw-r--r--contrib/libf2c/libF77/d_asin.c13
-rw-r--r--contrib/libf2c/libF77/d_atan.c13
-rw-r--r--contrib/libf2c/libF77/d_atn2.c13
-rw-r--r--contrib/libf2c/libF77/d_cnjg.c13
-rw-r--r--contrib/libf2c/libF77/d_cos.c13
-rw-r--r--contrib/libf2c/libF77/d_cosh.c13
-rw-r--r--contrib/libf2c/libF77/d_dim.c10
-rw-r--r--contrib/libf2c/libF77/d_exp.c13
-rw-r--r--contrib/libf2c/libF77/d_imag.c10
-rw-r--r--contrib/libf2c/libF77/d_int.c13
-rw-r--r--contrib/libf2c/libF77/d_lg10.c15
-rw-r--r--contrib/libf2c/libF77/d_log.c13
-rw-r--r--contrib/libf2c/libF77/d_mod.c40
-rw-r--r--contrib/libf2c/libF77/d_nint.c14
-rw-r--r--contrib/libf2c/libF77/d_prod.c10
-rw-r--r--contrib/libf2c/libF77/d_sign.c12
-rw-r--r--contrib/libf2c/libF77/d_sin.c13
-rw-r--r--contrib/libf2c/libF77/d_sinh.c13
-rw-r--r--contrib/libf2c/libF77/d_sqrt.c13
-rw-r--r--contrib/libf2c/libF77/d_tan.c13
-rw-r--r--contrib/libf2c/libF77/d_tanh.c13
-rw-r--r--contrib/libf2c/libF77/derf_.c12
-rw-r--r--contrib/libf2c/libF77/derfc_.c14
-rw-r--r--contrib/libf2c/libF77/dtime_.c53
-rw-r--r--contrib/libf2c/libF77/ef1asc_.c19
-rw-r--r--contrib/libf2c/libF77/ef1cmc_.c14
-rw-r--r--contrib/libf2c/libF77/erf_.c12
-rw-r--r--contrib/libf2c/libF77/erfc_.c12
-rw-r--r--contrib/libf2c/libF77/etime_.c47
-rw-r--r--contrib/libf2c/libF77/exit_.c37
-rw-r--r--contrib/libf2c/libF77/f2ch.add162
-rw-r--r--contrib/libf2c/libF77/getarg_.c28
-rw-r--r--contrib/libf2c/libF77/getenv_.c56
-rw-r--r--contrib/libf2c/libF77/h_abs.c12
-rw-r--r--contrib/libf2c/libF77/h_dim.c10
-rw-r--r--contrib/libf2c/libF77/h_dnnt.c13
-rw-r--r--contrib/libf2c/libF77/h_indx.c26
-rw-r--r--contrib/libf2c/libF77/h_len.c10
-rw-r--r--contrib/libf2c/libF77/h_mod.c10
-rw-r--r--contrib/libf2c/libF77/h_nint.c13
-rw-r--r--contrib/libf2c/libF77/h_sign.c12
-rw-r--r--contrib/libf2c/libF77/hl_ge.c12
-rw-r--r--contrib/libf2c/libF77/hl_gt.c12
-rw-r--r--contrib/libf2c/libF77/hl_le.c12
-rw-r--r--contrib/libf2c/libF77/hl_lt.c12
-rw-r--r--contrib/libf2c/libF77/i_abs.c12
-rw-r--r--contrib/libf2c/libF77/i_dim.c10
-rw-r--r--contrib/libf2c/libF77/i_dnnt.c13
-rw-r--r--contrib/libf2c/libF77/i_indx.c26
-rw-r--r--contrib/libf2c/libF77/i_len.c10
-rw-r--r--contrib/libf2c/libF77/i_mod.c10
-rw-r--r--contrib/libf2c/libF77/i_nint.c13
-rw-r--r--contrib/libf2c/libF77/i_sign.c12
-rw-r--r--contrib/libf2c/libF77/iargc_.c11
-rw-r--r--contrib/libf2c/libF77/l_ge.c12
-rw-r--r--contrib/libf2c/libF77/l_gt.c12
-rw-r--r--contrib/libf2c/libF77/l_le.c12
-rw-r--r--contrib/libf2c/libF77/l_lt.c12
-rw-r--r--contrib/libf2c/libF77/lbitbits.c62
-rw-r--r--contrib/libf2c/libF77/lbitshft.c11
-rw-r--r--contrib/libf2c/libF77/main.c68
-rw-r--r--contrib/libf2c/libF77/makefile.netlib103
-rw-r--r--contrib/libf2c/libF77/pow_ci.c20
-rw-r--r--contrib/libf2c/libF77/pow_dd.c13
-rw-r--r--contrib/libf2c/libF77/pow_di.c35
-rw-r--r--contrib/libf2c/libF77/pow_hh.c33
-rw-r--r--contrib/libf2c/libF77/pow_ii.c33
-rw-r--r--contrib/libf2c/libF77/pow_qq.c33
-rw-r--r--contrib/libf2c/libF77/pow_ri.c35
-rw-r--r--contrib/libf2c/libF77/pow_zi.c54
-rw-r--r--contrib/libf2c/libF77/pow_zz.c23
-rw-r--r--contrib/libf2c/libF77/qbitbits.c66
-rw-r--r--contrib/libf2c/libF77/qbitshft.c11
-rw-r--r--contrib/libf2c/libF77/r_abs.c12
-rw-r--r--contrib/libf2c/libF77/r_acos.c13
-rw-r--r--contrib/libf2c/libF77/r_asin.c13
-rw-r--r--contrib/libf2c/libF77/r_atan.c13
-rw-r--r--contrib/libf2c/libF77/r_atn2.c13
-rw-r--r--contrib/libf2c/libF77/r_cnjg.c12
-rw-r--r--contrib/libf2c/libF77/r_cos.c13
-rw-r--r--contrib/libf2c/libF77/r_cosh.c13
-rw-r--r--contrib/libf2c/libF77/r_dim.c10
-rw-r--r--contrib/libf2c/libF77/r_exp.c13
-rw-r--r--contrib/libf2c/libF77/r_imag.c10
-rw-r--r--contrib/libf2c/libF77/r_int.c13
-rw-r--r--contrib/libf2c/libF77/r_lg10.c15
-rw-r--r--contrib/libf2c/libF77/r_log.c13
-rw-r--r--contrib/libf2c/libF77/r_mod.c40
-rw-r--r--contrib/libf2c/libF77/r_nint.c14
-rw-r--r--contrib/libf2c/libF77/r_sign.c12
-rw-r--r--contrib/libf2c/libF77/r_sin.c13
-rw-r--r--contrib/libf2c/libF77/r_sinh.c13
-rw-r--r--contrib/libf2c/libF77/r_sqrt.c13
-rw-r--r--contrib/libf2c/libF77/r_tan.c13
-rw-r--r--contrib/libf2c/libF77/r_tanh.c13
-rw-r--r--contrib/libf2c/libF77/s_cat.c75
-rw-r--r--contrib/libf2c/libF77/s_cmp.c44
-rw-r--r--contrib/libf2c/libF77/s_copy.c51
-rw-r--r--contrib/libf2c/libF77/s_paus.c88
-rw-r--r--contrib/libf2c/libF77/s_rnge.c26
-rw-r--r--contrib/libf2c/libF77/s_stop.c42
-rw-r--r--contrib/libf2c/libF77/setarg.c29
-rw-r--r--contrib/libf2c/libF77/setsig.c101
-rw-r--r--contrib/libf2c/libF77/sig_die.c45
-rw-r--r--contrib/libf2c/libF77/signal1.h5
-rw-r--r--contrib/libf2c/libF77/signal1.h035
-rw-r--r--contrib/libf2c/libF77/signal_.c16
-rw-r--r--contrib/libf2c/libF77/system_.c36
-rw-r--r--contrib/libf2c/libF77/z_abs.c12
-rw-r--r--contrib/libf2c/libF77/z_cos.c15
-rw-r--r--contrib/libf2c/libF77/z_div.c44
-rw-r--r--contrib/libf2c/libF77/z_exp.c17
-rw-r--r--contrib/libf2c/libF77/z_log.c63
-rw-r--r--contrib/libf2c/libF77/z_sin.c15
-rw-r--r--contrib/libf2c/libF77/z_sqrt.c29
-rw-r--r--contrib/libf2c/libI77/Makefile.in172
-rw-r--r--contrib/libf2c/libI77/Notice23
-rw-r--r--contrib/libf2c/libI77/README.netlib225
-rw-r--r--contrib/libf2c/libI77/Version.c340
-rw-r--r--contrib/libf2c/libI77/backspace.c74
-rw-r--r--contrib/libf2c/libI77/close.c106
-rw-r--r--contrib/libf2c/libI77/config.h.in47
-rwxr-xr-xcontrib/libf2c/libI77/configure1950
-rw-r--r--contrib/libf2c/libI77/configure.in213
-rw-r--r--contrib/libf2c/libI77/dfe.c147
-rw-r--r--contrib/libf2c/libI77/dolio.c21
-rw-r--r--contrib/libf2c/libI77/due.c76
-rw-r--r--contrib/libf2c/libI77/endfile.c139
-rw-r--r--contrib/libf2c/libI77/err.c290
-rw-r--r--contrib/libf2c/libI77/f2ch.add162
-rw-r--r--contrib/libf2c/libI77/fio.h110
-rw-r--r--contrib/libf2c/libI77/fmt.c544
-rw-r--r--contrib/libf2c/libI77/fmt.h101
-rw-r--r--contrib/libf2c/libI77/fmtlib.c46
-rw-r--r--contrib/libf2c/libI77/fp.h28
-rw-r--r--contrib/libf2c/libI77/ftell_.c47
-rw-r--r--contrib/libf2c/libI77/iio.c154
-rw-r--r--contrib/libf2c/libI77/ilnw.c83
-rw-r--r--contrib/libf2c/libI77/inquire.c109
-rw-r--r--contrib/libf2c/libI77/lio.h74
-rw-r--r--contrib/libf2c/libI77/lread.c798
-rw-r--r--contrib/libf2c/libI77/lwrite.c302
-rw-r--r--contrib/libf2c/libI77/makefile.netlib104
-rw-r--r--contrib/libf2c/libI77/open.c315
-rw-r--r--contrib/libf2c/libI77/rawio.h45
-rw-r--r--contrib/libf2c/libI77/rdfmt.c546
-rw-r--r--contrib/libf2c/libI77/rewind.c26
-rw-r--r--contrib/libf2c/libI77/rsfe.c81
-rw-r--r--contrib/libf2c/libI77/rsli.c105
-rw-r--r--contrib/libf2c/libI77/rsne.c608
-rw-r--r--contrib/libf2c/libI77/sfe.c38
-rw-r--r--contrib/libf2c/libI77/stamp-h.in1
-rw-r--r--contrib/libf2c/libI77/sue.c88
-rw-r--r--contrib/libf2c/libI77/typesize.c13
-rw-r--r--contrib/libf2c/libI77/uio.c69
-rw-r--r--contrib/libf2c/libI77/util.c54
-rw-r--r--contrib/libf2c/libI77/wref.c276
-rw-r--r--contrib/libf2c/libI77/wrtfmt.c366
-rw-r--r--contrib/libf2c/libI77/wsfe.c75
-rw-r--r--contrib/libf2c/libI77/wsle.c39
-rw-r--r--contrib/libf2c/libI77/wsne.c26
-rw-r--r--contrib/libf2c/libI77/xwsne.c72
-rw-r--r--contrib/libf2c/libU77/COPYING.LIB504
-rw-r--r--contrib/libf2c/libU77/Makefile.in194
-rw-r--r--contrib/libf2c/libU77/PROJECTS10
-rw-r--r--contrib/libf2c/libU77/README40
-rw-r--r--contrib/libf2c/libU77/Version.c12
-rw-r--r--contrib/libf2c/libU77/access_.c80
-rw-r--r--contrib/libf2c/libU77/acconfig.h11
-rw-r--r--contrib/libf2c/libU77/aclocal.m469
-rw-r--r--contrib/libf2c/libU77/alarm_.c70
-rw-r--r--contrib/libf2c/libU77/bes.c46
-rw-r--r--contrib/libf2c/libU77/chdir_.c57
-rw-r--r--contrib/libf2c/libU77/chmod_.c82
-rw-r--r--contrib/libf2c/libU77/config.hin112
-rwxr-xr-xcontrib/libf2c/libU77/configure2010
-rw-r--r--contrib/libf2c/libU77/configure.in110
-rw-r--r--contrib/libf2c/libU77/ctime_.c58
-rw-r--r--contrib/libf2c/libU77/date_.c40
-rw-r--r--contrib/libf2c/libU77/datetime_.c99
-rw-r--r--contrib/libf2c/libU77/dbes.c46
-rw-r--r--contrib/libf2c/libU77/dtime_.c172
-rw-r--r--contrib/libf2c/libU77/etime_.c163
-rw-r--r--contrib/libf2c/libU77/fdate_.c54
-rw-r--r--contrib/libf2c/libU77/fgetc_.c70
-rw-r--r--contrib/libf2c/libU77/flush1_.c46
-rw-r--r--contrib/libf2c/libU77/fnum_.c38
-rw-r--r--contrib/libf2c/libU77/fputc_.c65
-rw-r--r--contrib/libf2c/libU77/fstat_.c71
-rw-r--r--contrib/libf2c/libU77/gerror_.c49
-rw-r--r--contrib/libf2c/libU77/getcwd_.c99
-rw-r--r--contrib/libf2c/libU77/getgid_.c41
-rw-r--r--contrib/libf2c/libU77/getlog_.c71
-rw-r--r--contrib/libf2c/libU77/getpid_.c35
-rw-r--r--contrib/libf2c/libU77/getuid_.c41
-rw-r--r--contrib/libf2c/libU77/gmtime_.c56
-rw-r--r--contrib/libf2c/libU77/hostnm_.c49
-rw-r--r--contrib/libf2c/libU77/idate_.c58
-rw-r--r--contrib/libf2c/libU77/ierrno_.c32
-rw-r--r--contrib/libf2c/libU77/irand_.c57
-rw-r--r--contrib/libf2c/libU77/isatty_.c44
-rw-r--r--contrib/libf2c/libU77/itime_.c52
-rw-r--r--contrib/libf2c/libU77/kill_.c42
-rw-r--r--contrib/libf2c/libU77/link_.c66
-rw-r--r--contrib/libf2c/libU77/lnblnk_.c35
-rw-r--r--contrib/libf2c/libU77/lstat_.c86
-rw-r--r--contrib/libf2c/libU77/ltime_.c56
-rw-r--r--contrib/libf2c/libU77/mclock_.c47
-rw-r--r--contrib/libf2c/libU77/perror_.c48
-rw-r--r--contrib/libf2c/libU77/rand_.c54
-rw-r--r--contrib/libf2c/libU77/rename_.c56
-rw-r--r--contrib/libf2c/libU77/secnds_.c51
-rw-r--r--contrib/libf2c/libU77/second_.c26
-rw-r--r--contrib/libf2c/libU77/sleep_.c37
-rw-r--r--contrib/libf2c/libU77/srand_.c37
-rw-r--r--contrib/libf2c/libU77/stamp-h.in1
-rw-r--r--contrib/libf2c/libU77/stat_.c79
-rw-r--r--contrib/libf2c/libU77/symlnk_.c64
-rw-r--r--contrib/libf2c/libU77/sys_clock_.c81
-rw-r--r--contrib/libf2c/libU77/time_.c46
-rw-r--r--contrib/libf2c/libU77/ttynam_.c64
-rw-r--r--contrib/libf2c/libU77/u77-test.f415
-rw-r--r--contrib/libf2c/libU77/umask_.c34
-rw-r--r--contrib/libf2c/libU77/unlink_.c57
-rw-r--r--contrib/libf2c/libU77/vxtidate_.c56
-rw-r--r--contrib/libf2c/libU77/vxttime_.c55
-rw-r--r--contrib/libf2c/permission.netlib23
-rw-r--r--contrib/libf2c/readme.netlib791
-rw-r--r--contrib/libg++/COPYING339
-rw-r--r--contrib/libg++/COPYING.LIB481
-rw-r--r--contrib/libg++/include/ChangeLog990
-rw-r--r--contrib/libg++/include/ansidecl.h141
-rw-r--r--contrib/libg++/include/demangle.h89
-rw-r--r--contrib/libg++/include/floatformat.h88
-rw-r--r--contrib/libg++/include/getopt.h129
-rw-r--r--contrib/libg++/include/libiberty.h137
-rw-r--r--contrib/libg++/include/obstack.h518
-rw-r--r--contrib/libg++/libg++/ChangeLog2271
-rw-r--r--contrib/libg++/libg++/Makefile.in263
-rw-r--r--contrib/libg++/libg++/NEWS573
-rw-r--r--contrib/libg++/libg++/README247
-rw-r--r--contrib/libg++/libg++/README.SHLIB38
-rw-r--r--contrib/libg++/libg++/TODO13
-rw-r--r--contrib/libg++/libg++/g++FAQ.texi1986
-rw-r--r--contrib/libg++/libg++/genclass/ChangeLog27
-rw-r--r--contrib/libg++/libg++/genclass/Makefile.in23
-rw-r--r--contrib/libg++/libg++/genclass/configure.in26
-rw-r--r--contrib/libg++/libg++/genclass/expected.out1027
-rwxr-xr-xcontrib/libg++/libg++/genclass/genclass.sh452
-rwxr-xr-xcontrib/libg++/libg++/genclass/gentest.sh174
-rw-r--r--contrib/libg++/libg++/libg++.texi4803
-rw-r--r--contrib/libg++/libg++/src/ACG.cc292
-rw-r--r--contrib/libg++/libg++/src/ACG.h68
-rw-r--r--contrib/libg++/libg++/src/AllocRing.cc110
-rw-r--r--contrib/libg++/libg++/src/AllocRing.h62
-rw-r--r--contrib/libg++/libg++/src/Binomial.cc34
-rw-r--r--contrib/libg++/libg++/src/Binomial.h55
-rw-r--r--contrib/libg++/libg++/src/BitSet.cc1104
-rw-r--r--contrib/libg++/libg++/src/BitSet.h360
-rw-r--r--contrib/libg++/libg++/src/BitString.cc1608
-rw-r--r--contrib/libg++/libg++/src/BitString.h763
-rw-r--r--contrib/libg++/libg++/src/ChangeLog1213
-rw-r--r--contrib/libg++/libg++/src/Complex.h10
-rw-r--r--contrib/libg++/libg++/src/CursesW.cc257
-rw-r--r--contrib/libg++/libg++/src/CursesW.h603
-rw-r--r--contrib/libg++/libg++/src/DLList.cc327
-rw-r--r--contrib/libg++/libg++/src/DLList.h139
-rw-r--r--contrib/libg++/libg++/src/DiscUnif.cc29
-rw-r--r--contrib/libg++/libg++/src/DiscUnif.h72
-rw-r--r--contrib/libg++/libg++/src/Erlang.cc32
-rw-r--r--contrib/libg++/libg++/src/Erlang.h68
-rw-r--r--contrib/libg++/libg++/src/Fix.cc670
-rw-r--r--contrib/libg++/libg++/src/Fix.h523
-rw-r--r--contrib/libg++/libg++/src/Fix16.cc238
-rw-r--r--contrib/libg++/libg++/src/Fix16.h648
-rw-r--r--contrib/libg++/libg++/src/Fix24.cc329
-rw-r--r--contrib/libg++/libg++/src/Fix24.h597
-rw-r--r--contrib/libg++/libg++/src/Geom.cc30
-rw-r--r--contrib/libg++/libg++/src/Geom.h52
-rw-r--r--contrib/libg++/libg++/src/GetOpt.cc253
-rw-r--r--contrib/libg++/libg++/src/GetOpt.h129
-rw-r--r--contrib/libg++/libg++/src/HypGeom.cc30
-rw-r--r--contrib/libg++/libg++/src/HypGeom.h70
-rw-r--r--contrib/libg++/libg++/src/Incremental.h12
-rw-r--r--contrib/libg++/libg++/src/Intdouble.cc142
-rw-r--r--contrib/libg++/libg++/src/Integer.cc2282
-rw-r--r--contrib/libg++/libg++/src/Integer.h1134
-rw-r--r--contrib/libg++/libg++/src/Integer.hP30
-rw-r--r--contrib/libg++/libg++/src/LogNorm.cc36
-rw-r--r--contrib/libg++/libg++/src/LogNorm.h78
-rw-r--r--contrib/libg++/libg++/src/MLCG.cc103
-rw-r--r--contrib/libg++/libg++/src/MLCG.h87
-rw-r--r--contrib/libg++/libg++/src/Makefile.in75
-rw-r--r--contrib/libg++/libg++/src/NegExp.cc28
-rw-r--r--contrib/libg++/libg++/src/NegExp.h55
-rw-r--r--contrib/libg++/libg++/src/Normal.cc60
-rw-r--r--contrib/libg++/libg++/src/Normal.h66
-rw-r--r--contrib/libg++/libg++/src/Obstack.cc127
-rw-r--r--contrib/libg++/libg++/src/Obstack.h218
-rw-r--r--contrib/libg++/libg++/src/Pix.h5
-rw-r--r--contrib/libg++/libg++/src/Poisson.cc36
-rw-r--r--contrib/libg++/libg++/src/Poisson.h51
-rw-r--r--contrib/libg++/libg++/src/RNG.cc131
-rw-r--r--contrib/libg++/libg++/src/RNG.h58
-rw-r--r--contrib/libg++/libg++/src/Random.cc4
-rw-r--r--contrib/libg++/libg++/src/Random.h54
-rw-r--r--contrib/libg++/libg++/src/Rational.cc416
-rw-r--r--contrib/libg++/libg++/src/Rational.h290
-rw-r--r--contrib/libg++/libg++/src/Regex.cc149
-rw-r--r--contrib/libg++/libg++/src/Regex.h78
-rw-r--r--contrib/libg++/libg++/src/RndInt.cc4
-rw-r--r--contrib/libg++/libg++/src/RndInt.h176
-rw-r--r--contrib/libg++/libg++/src/SLList.cc247
-rw-r--r--contrib/libg++/libg++/src/SLList.h129
-rw-r--r--contrib/libg++/libg++/src/Sample.cc241
-rw-r--r--contrib/libg++/libg++/src/SmplHist.cc112
-rw-r--r--contrib/libg++/libg++/src/SmplHist.h72
-rw-r--r--contrib/libg++/libg++/src/SmplStat.cc160
-rw-r--r--contrib/libg++/libg++/src/SmplStat.h69
-rw-r--r--contrib/libg++/libg++/src/String.cc1307
-rw-r--r--contrib/libg++/libg++/src/String.h1284
-rw-r--r--contrib/libg++/libg++/src/Uniform.cc27
-rw-r--r--contrib/libg++/libg++/src/Uniform.h71
-rw-r--r--contrib/libg++/libg++/src/Weibull.cc33
-rw-r--r--contrib/libg++/libg++/src/Weibull.h74
-rw-r--r--contrib/libg++/libg++/src/bitand.c41
-rw-r--r--contrib/libg++/libg++/src/bitany.c38
-rw-r--r--contrib/libg++/libg++/src/bitblt.c97
-rw-r--r--contrib/libg++/libg++/src/bitclear.c37
-rw-r--r--contrib/libg++/libg++/src/bitcopy.c41
-rw-r--r--contrib/libg++/libg++/src/bitcount.c64
-rw-r--r--contrib/libg++/libg++/src/bitdo1.h32
-rw-r--r--contrib/libg++/libg++/src/bitdo2.h184
-rw-r--r--contrib/libg++/libg++/src/bitinvert.c37
-rw-r--r--contrib/libg++/libg++/src/bitlcomp.c81
-rw-r--r--contrib/libg++/libg++/src/bitprims.h125
-rw-r--r--contrib/libg++/libg++/src/bitset1.c37
-rw-r--r--contrib/libg++/libg++/src/bitxor.c41
-rw-r--r--contrib/libg++/libg++/src/bool.h24
-rw-r--r--contrib/libg++/libg++/src/builtin.cc4
-rw-r--r--contrib/libg++/libg++/src/builtin.h125
-rw-r--r--contrib/libg++/libg++/src/compare.cc4
-rw-r--r--contrib/libg++/libg++/src/compare.h91
-rw-r--r--contrib/libg++/libg++/src/configure.in45
-rw-r--r--contrib/libg++/libg++/src/depend849
-rw-r--r--contrib/libg++/libg++/src/dtoa.cc335
-rw-r--r--contrib/libg++/libg++/src/error.cc49
-rw-r--r--contrib/libg++/libg++/src/fmtq.cc29
-rw-r--r--contrib/libg++/libg++/src/gcd.cc52
-rw-r--r--contrib/libg++/libg++/src/gen/AVLMap.ccP614
-rw-r--r--contrib/libg++/libg++/src/gen/AVLMap.hP141
-rw-r--r--contrib/libg++/libg++/src/gen/AVLSet.ccP892
-rw-r--r--contrib/libg++/libg++/src/gen/AVLSet.hP152
-rw-r--r--contrib/libg++/libg++/src/gen/AVec.ccP397
-rw-r--r--contrib/libg++/libg++/src/gen/AVec.hP118
-rw-r--r--contrib/libg++/libg++/src/gen/BSTSet.ccP377
-rw-r--r--contrib/libg++/libg++/src/gen/BSTSet.hP152
-rw-r--r--contrib/libg++/libg++/src/gen/Bag.ccP74
-rw-r--r--contrib/libg++/libg++/src/gen/Bag.hP79
-rw-r--r--contrib/libg++/libg++/src/gen/CHBag.ccP210
-rw-r--r--contrib/libg++/libg++/src/gen/CHBag.hP76
-rw-r--r--contrib/libg++/libg++/src/gen/CHMap.ccP168
-rw-r--r--contrib/libg++/libg++/src/gen/CHMap.hP104
-rw-r--r--contrib/libg++/libg++/src/gen/CHNode.ccP21
-rw-r--r--contrib/libg++/libg++/src/gen/CHNode.hP43
-rw-r--r--contrib/libg++/libg++/src/gen/CHSet.ccP273
-rw-r--r--contrib/libg++/libg++/src/gen/CHSet.hP84
-rw-r--r--contrib/libg++/libg++/src/gen/DLDeque.ccP4
-rw-r--r--contrib/libg++/libg++/src/gen/DLDeque.hP130
-rw-r--r--contrib/libg++/libg++/src/gen/DLList.ccP339
-rw-r--r--contrib/libg++/libg++/src/gen/DLList.hP157
-rw-r--r--contrib/libg++/libg++/src/gen/Deque.ccP11
-rw-r--r--contrib/libg++/libg++/src/gen/Deque.hP57
-rw-r--r--contrib/libg++/libg++/src/gen/FPQueue.ccP4
-rw-r--r--contrib/libg++/libg++/src/gen/FPQueue.hP112
-rw-r--r--contrib/libg++/libg++/src/gen/FPStack.ccP4
-rw-r--r--contrib/libg++/libg++/src/gen/FPStack.hP114
-rw-r--r--contrib/libg++/libg++/src/gen/FPlex.ccP167
-rw-r--r--contrib/libg++/libg++/src/gen/FPlex.hP253
-rw-r--r--contrib/libg++/libg++/src/gen/List.ccP972
-rw-r--r--contrib/libg++/libg++/src/gen/List.hP279
-rw-r--r--contrib/libg++/libg++/src/gen/MPlex.ccP848
-rw-r--r--contrib/libg++/libg++/src/gen/MPlex.hP414
-rw-r--r--contrib/libg++/libg++/src/gen/Map.ccP59
-rw-r--r--contrib/libg++/libg++/src/gen/Map.hP87
-rw-r--r--contrib/libg++/libg++/src/gen/OSLBag.ccP196
-rw-r--r--contrib/libg++/libg++/src/gen/OSLBag.hP91
-rw-r--r--contrib/libg++/libg++/src/gen/OSLSet.ccP321
-rw-r--r--contrib/libg++/libg++/src/gen/OSLSet.hP101
-rw-r--r--contrib/libg++/libg++/src/gen/OXPBag.ccP221
-rw-r--r--contrib/libg++/libg++/src/gen/OXPBag.hP73
-rw-r--r--contrib/libg++/libg++/src/gen/OXPSet.ccP280
-rw-r--r--contrib/libg++/libg++/src/gen/OXPSet.hP102
-rw-r--r--contrib/libg++/libg++/src/gen/PHPQ.ccP339
-rw-r--r--contrib/libg++/libg++/src/gen/PHPQ.hP108
-rw-r--r--contrib/libg++/libg++/src/gen/PQ.ccP63
-rw-r--r--contrib/libg++/libg++/src/gen/PQ.hP78
-rw-r--r--contrib/libg++/libg++/src/gen/PSList.hP32
-rw-r--r--contrib/libg++/libg++/src/gen/PVec.hP79
-rw-r--r--contrib/libg++/libg++/src/gen/Plex.ccP222
-rw-r--r--contrib/libg++/libg++/src/gen/Plex.hP494
-rw-r--r--contrib/libg++/libg++/src/gen/Queue.ccP14
-rw-r--r--contrib/libg++/libg++/src/gen/Queue.hP51
-rw-r--r--contrib/libg++/libg++/src/gen/RAVLMap.ccP690
-rw-r--r--contrib/libg++/libg++/src/gen/RAVLMap.hP147
-rw-r--r--contrib/libg++/libg++/src/gen/RPlex.ccP477
-rw-r--r--contrib/libg++/libg++/src/gen/RPlex.hP257
-rw-r--r--contrib/libg++/libg++/src/gen/SLBag.ccP105
-rw-r--r--contrib/libg++/libg++/src/gen/SLBag.hP96
-rw-r--r--contrib/libg++/libg++/src/gen/SLList.ccP292
-rw-r--r--contrib/libg++/libg++/src/gen/SLList.hP137
-rw-r--r--contrib/libg++/libg++/src/gen/SLQueue.ccP4
-rw-r--r--contrib/libg++/libg++/src/gen/SLQueue.hP108
-rw-r--r--contrib/libg++/libg++/src/gen/SLSet.ccP77
-rw-r--r--contrib/libg++/libg++/src/gen/SLSet.hP87
-rw-r--r--contrib/libg++/libg++/src/gen/SLStack.ccP4
-rw-r--r--contrib/libg++/libg++/src/gen/SLStack.hP109
-rw-r--r--contrib/libg++/libg++/src/gen/Set.ccP117
-rw-r--r--contrib/libg++/libg++/src/gen/Set.hP78
-rw-r--r--contrib/libg++/libg++/src/gen/SkipBag.ccP322
-rw-r--r--contrib/libg++/libg++/src/gen/SkipBag.hP171
-rw-r--r--contrib/libg++/libg++/src/gen/SkipMap.ccP307
-rw-r--r--contrib/libg++/libg++/src/gen/SkipMap.hP176
-rw-r--r--contrib/libg++/libg++/src/gen/SkipSet.ccP395
-rw-r--r--contrib/libg++/libg++/src/gen/SkipSet.hP187
-rw-r--r--contrib/libg++/libg++/src/gen/SplayBag.ccP445
-rw-r--r--contrib/libg++/libg++/src/gen/SplayBag.hP126
-rw-r--r--contrib/libg++/libg++/src/gen/SplayMap.ccP401
-rw-r--r--contrib/libg++/libg++/src/gen/SplayMap.hP154
-rw-r--r--contrib/libg++/libg++/src/gen/SplayNode.ccP21
-rw-r--r--contrib/libg++/libg++/src/gen/SplayNode.hP44
-rw-r--r--contrib/libg++/libg++/src/gen/SplayPQ.ccP523
-rw-r--r--contrib/libg++/libg++/src/gen/SplayPQ.hP123
-rw-r--r--contrib/libg++/libg++/src/gen/SplaySet.ccP499
-rw-r--r--contrib/libg++/libg++/src/gen/SplaySet.hP145
-rw-r--r--contrib/libg++/libg++/src/gen/Stack.ccP11
-rw-r--r--contrib/libg++/libg++/src/gen/Stack.hP51
-rw-r--r--contrib/libg++/libg++/src/gen/VHBag.ccP264
-rw-r--r--contrib/libg++/libg++/src/gen/VHBag.hP84
-rw-r--r--contrib/libg++/libg++/src/gen/VHMap.ccP210
-rw-r--r--contrib/libg++/libg++/src/gen/VHMap.hP84
-rw-r--r--contrib/libg++/libg++/src/gen/VHSet.ccP263
-rw-r--r--contrib/libg++/libg++/src/gen/VHSet.hP96
-rw-r--r--contrib/libg++/libg++/src/gen/VOHSet.ccP305
-rw-r--r--contrib/libg++/libg++/src/gen/VOHSet.hP88
-rw-r--r--contrib/libg++/libg++/src/gen/VQueue.ccP83
-rw-r--r--contrib/libg++/libg++/src/gen/VQueue.hP130
-rw-r--r--contrib/libg++/libg++/src/gen/VStack.ccP66
-rw-r--r--contrib/libg++/libg++/src/gen/VStack.hP120
-rw-r--r--contrib/libg++/libg++/src/gen/Vec.ccP478
-rw-r--r--contrib/libg++/libg++/src/gen/Vec.hP135
-rw-r--r--contrib/libg++/libg++/src/gen/XPBag.ccP72
-rw-r--r--contrib/libg++/libg++/src/gen/XPBag.hP98
-rw-r--r--contrib/libg++/libg++/src/gen/XPDeque.ccP4
-rw-r--r--contrib/libg++/libg++/src/gen/XPDeque.hP133
-rw-r--r--contrib/libg++/libg++/src/gen/XPPQ.ccP143
-rw-r--r--contrib/libg++/libg++/src/gen/XPPQ.hP105
-rw-r--r--contrib/libg++/libg++/src/gen/XPQueue.ccP4
-rw-r--r--contrib/libg++/libg++/src/gen/XPQueue.hP114
-rw-r--r--contrib/libg++/libg++/src/gen/XPSet.ccP63
-rw-r--r--contrib/libg++/libg++/src/gen/XPSet.hP89
-rw-r--r--contrib/libg++/libg++/src/gen/XPStack.ccP4
-rw-r--r--contrib/libg++/libg++/src/gen/XPStack.hP115
-rw-r--r--contrib/libg++/libg++/src/gen/XPlex.ccP397
-rw-r--r--contrib/libg++/libg++/src/gen/XPlex.hP238
-rw-r--r--contrib/libg++/libg++/src/gen/defs.hP57
-rw-r--r--contrib/libg++/libg++/src/gen/intSList.hP33
-rw-r--r--contrib/libg++/libg++/src/gen/intVec.hP80
-rw-r--r--contrib/libg++/libg++/src/generic.h54
-rw-r--r--contrib/libg++/libg++/src/getpagesize.h27
-rw-r--r--contrib/libg++/libg++/src/hash.cc56
-rw-r--r--contrib/libg++/libg++/src/ioob.cc32
-rw-r--r--contrib/libg++/libg++/src/lg.cc32
-rw-r--r--contrib/libg++/libg++/src/libc.h1
-rw-r--r--contrib/libg++/libg++/src/malloc.c2690
-rw-r--r--contrib/libg++/libg++/src/minmax.cc5
-rw-r--r--contrib/libg++/libg++/src/minmax.h65
-rw-r--r--contrib/libg++/libg++/src/osfcn.h17
-rw-r--r--contrib/libg++/libg++/src/pow.cc70
-rw-r--r--contrib/libg++/libg++/src/sqrt.cc43
-rw-r--r--contrib/libg++/libg++/src/std.h35
-rw-r--r--contrib/libg++/libg++/src/strclass.h5
-rw-r--r--contrib/libg++/libg++/src/swap.h3
-rw-r--r--contrib/libg++/libg++/src/sysent.h2
-rw-r--r--contrib/libg++/libg++/src/timer.c165
-rw-r--r--contrib/libg++/libg++/src/typemacros.h8
-rw-r--r--contrib/libg++/libg++/test-install/ChangeLog74
-rw-r--r--contrib/libg++/libg++/test-install/Foo.cc89
-rw-r--r--contrib/libg++/libg++/test-install/Foo.h24
-rw-r--r--contrib/libg++/libg++/test-install/Makefile.in170
-rw-r--r--contrib/libg++/libg++/test-install/a.cc10
-rw-r--r--contrib/libg++/libg++/test-install/bf.cc18
-rw-r--r--contrib/libg++/libg++/test-install/bm.cc14
-rw-r--r--contrib/libg++/libg++/test-install/configure.in25
-rw-r--r--contrib/libg++/libg++/test-install/ex_bar.cc123
-rw-r--r--contrib/libg++/libg++/test-install/expected.out15
-rw-r--r--contrib/libg++/libg++/test-install/foo_func.cc17
-rw-r--r--contrib/libg++/libg++/test-install/foo_main.cc40
-rw-r--r--contrib/libg++/libg++/tests/ChangeLog346
-rw-r--r--contrib/libg++/libg++/tests/Makefile.in22
-rwxr-xr-xcontrib/libg++/libg++/tests/Makefile.sh174
-rw-r--r--contrib/libg++/libg++/tests/configure.in27
-rw-r--r--contrib/libg++/libg++/tests/depend161
-rw-r--r--contrib/libg++/libg++/tests/tBag.cc540
-rw-r--r--contrib/libg++/libg++/tests/tBag.exp35
-rw-r--r--contrib/libg++/libg++/tests/tBag.inp0
-rw-r--r--contrib/libg++/libg++/tests/tBitSet.cc220
-rw-r--r--contrib/libg++/libg++/tests/tBitSet.exp49
-rw-r--r--contrib/libg++/libg++/tests/tBitSet.inp0
-rw-r--r--contrib/libg++/libg++/tests/tBitString.cc327
-rw-r--r--contrib/libg++/libg++/tests/tBitString.exp79
-rw-r--r--contrib/libg++/libg++/tests/tBitString.inp0
-rw-r--r--contrib/libg++/libg++/tests/tCurses.cc80
-rw-r--r--contrib/libg++/libg++/tests/tCurses.inp2
-rw-r--r--contrib/libg++/libg++/tests/tDeque.cc168
-rw-r--r--contrib/libg++/libg++/tests/tDeque.exp6
-rw-r--r--contrib/libg++/libg++/tests/tDeque.inp0
-rw-r--r--contrib/libg++/libg++/tests/tFile.cc371
-rw-r--r--contrib/libg++/libg++/tests/tFile.exp49
-rw-r--r--contrib/libg++/libg++/tests/tFile.inp4
-rw-r--r--contrib/libg++/libg++/tests/tFix.cc101
-rw-r--r--contrib/libg++/libg++/tests/tFix.exp70
-rw-r--r--contrib/libg++/libg++/tests/tFix.inp0
-rw-r--r--contrib/libg++/libg++/tests/tFix16.cc110
-rw-r--r--contrib/libg++/libg++/tests/tFix16.exp64
-rw-r--r--contrib/libg++/libg++/tests/tFix16.inp0
-rw-r--r--contrib/libg++/libg++/tests/tFix24.cc113
-rw-r--r--contrib/libg++/libg++/tests/tFix24.exp61
-rw-r--r--contrib/libg++/libg++/tests/tFix24.inp0
-rw-r--r--contrib/libg++/libg++/tests/tGetOpt.cc65
-rw-r--r--contrib/libg++/libg++/tests/tGetOpt.exp11
-rw-r--r--contrib/libg++/libg++/tests/tGetOpt.inp0
-rw-r--r--contrib/libg++/libg++/tests/tInteger.cc437
-rw-r--r--contrib/libg++/libg++/tests/tInteger.exp48
-rw-r--r--contrib/libg++/libg++/tests/tInteger.inp3
-rw-r--r--contrib/libg++/libg++/tests/tLList.cc236
-rw-r--r--contrib/libg++/libg++/tests/tLList.exp49
-rw-r--r--contrib/libg++/libg++/tests/tLList.inp0
-rw-r--r--contrib/libg++/libg++/tests/tList.cc129
-rw-r--r--contrib/libg++/libg++/tests/tList.exp39
-rw-r--r--contrib/libg++/libg++/tests/tList.inp0
-rw-r--r--contrib/libg++/libg++/tests/tMap.cc339
-rw-r--r--contrib/libg++/libg++/tests/tMap.exp25
-rw-r--r--contrib/libg++/libg++/tests/tMap.inp0
-rw-r--r--contrib/libg++/libg++/tests/tObstack.cc80
-rw-r--r--contrib/libg++/libg++/tests/tObstack.exp32
-rw-r--r--contrib/libg++/libg++/tests/tObstack.inp5
-rw-r--r--contrib/libg++/libg++/tests/tPQ.cc275
-rw-r--r--contrib/libg++/libg++/tests/tPQ.exp15
-rw-r--r--contrib/libg++/libg++/tests/tPQ.inp0
-rw-r--r--contrib/libg++/libg++/tests/tPlex.cc719
-rw-r--r--contrib/libg++/libg++/tests/tPlex.exp10
-rw-r--r--contrib/libg++/libg++/tests/tPlex.inp0
-rw-r--r--contrib/libg++/libg++/tests/tQueue.cc209
-rw-r--r--contrib/libg++/libg++/tests/tQueue.exp15
-rw-r--r--contrib/libg++/libg++/tests/tQueue.inp0
-rw-r--r--contrib/libg++/libg++/tests/tRandom.cc103
-rw-r--r--contrib/libg++/libg++/tests/tRandom.exp85
-rw-r--r--contrib/libg++/libg++/tests/tRandom.inp0
-rw-r--r--contrib/libg++/libg++/tests/tRational.cc194
-rw-r--r--contrib/libg++/libg++/tests/tRational.exp41
-rw-r--r--contrib/libg++/libg++/tests/tRational.inp1
-rw-r--r--contrib/libg++/libg++/tests/tSet.cc744
-rw-r--r--contrib/libg++/libg++/tests/tSet.exp50
-rw-r--r--contrib/libg++/libg++/tests/tSet.inp0
-rw-r--r--contrib/libg++/libg++/tests/tStack.cc188
-rw-r--r--contrib/libg++/libg++/tests/tStack.exp8
-rw-r--r--contrib/libg++/libg++/tests/tStack.inp0
-rw-r--r--contrib/libg++/libg++/tests/tString.cc416
-rw-r--r--contrib/libg++/libg++/tests/tString.exp50
-rw-r--r--contrib/libg++/libg++/tests/tString.inp1
-rw-r--r--contrib/libg++/libg++/tests/tVec.cc96
-rw-r--r--contrib/libg++/libg++/tests/tVec.exp33
-rw-r--r--contrib/libg++/libg++/tests/tVec.inp0
-rw-r--r--contrib/libg++/libg++/tests/test_h.cc102
-rw-r--r--contrib/libg++/libg++/tests/tiLList.cc271
-rw-r--r--contrib/libg++/libg++/tests/tiLList.exp54
-rw-r--r--contrib/libg++/libiberty/ChangeLog1872
-rw-r--r--contrib/libg++/libiberty/insque.c50
-rw-r--r--contrib/libg++/libiberty/strerror.c829
-rw-r--r--contrib/libg++/libio/ChangeLog1799
-rw-r--r--contrib/libg++/libio/Makefile.in124
-rw-r--r--contrib/libg++/libio/NEWS51
-rw-r--r--contrib/libg++/libio/PlotFile.cc157
-rw-r--r--contrib/libg++/libio/PlotFile.h89
-rw-r--r--contrib/libg++/libio/README30
-rw-r--r--contrib/libg++/libio/SFile.cc82
-rw-r--r--contrib/libg++/libio/SFile.h55
-rw-r--r--contrib/libg++/libio/builtinbuf.cc78
-rw-r--r--contrib/libg++/libio/builtinbuf.h68
-rw-r--r--contrib/libg++/libio/cleanup.c17
-rw-r--r--contrib/libg++/libio/depend327
-rw-r--r--contrib/libg++/libio/editbuf.cc717
-rw-r--r--contrib/libg++/libio/editbuf.h185
-rw-r--r--contrib/libg++/libio/filebuf.cc206
-rw-r--r--contrib/libg++/libio/filedoalloc.c102
-rw-r--r--contrib/libg++/libio/fileops.c755
-rw-r--r--contrib/libg++/libio/floatconv.c2350
-rw-r--r--contrib/libg++/libio/floatio.h51
-rw-r--r--contrib/libg++/libio/fstream.cc110
-rw-r--r--contrib/libg++/libio/fstream.h92
-rwxr-xr-xcontrib/libg++/libio/gen-params692
-rw-r--r--contrib/libg++/libio/genops.c852
-rw-r--r--contrib/libg++/libio/indstream.cc121
-rw-r--r--contrib/libg++/libio/indstream.h77
-rw-r--r--contrib/libg++/libio/ioassign.cc49
-rw-r--r--contrib/libg++/libio/ioextend.cc132
-rw-r--r--contrib/libg++/libio/iofclose.c47
-rw-r--r--contrib/libg++/libio/iofdopen.c121
-rw-r--r--contrib/libg++/libio/iofflush.c38
-rw-r--r--contrib/libg++/libio/iofgetpos.c46
-rw-r--r--contrib/libg++/libio/iofgets.c40
-rw-r--r--contrib/libg++/libio/iofopen.c49
-rw-r--r--contrib/libg++/libio/iofprintf.c48
-rw-r--r--contrib/libg++/libio/iofputs.c37
-rw-r--r--contrib/libg++/libio/iofread.c38
-rw-r--r--contrib/libg++/libio/iofscanf.c48
-rw-r--r--contrib/libg++/libio/iofsetpos.c43
-rw-r--r--contrib/libg++/libio/ioftell.c45
-rw-r--r--contrib/libg++/libio/iofwrite.c44
-rw-r--r--contrib/libg++/libio/iogetdelim.c99
-rw-r--r--contrib/libg++/libio/iogetline.c74
-rw-r--r--contrib/libg++/libio/iogets.c47
-rw-r--r--contrib/libg++/libio/ioignore.c46
-rw-r--r--contrib/libg++/libio/iolibio.h53
-rw-r--r--contrib/libg++/libio/iomanip.cc90
-rw-r--r--contrib/libg++/libio/iomanip.h165
-rw-r--r--contrib/libg++/libio/iopadn.c65
-rw-r--r--contrib/libg++/libio/ioperror.c22
-rw-r--r--contrib/libg++/libio/iopopen.c222
-rw-r--r--contrib/libg++/libio/ioprims.c72
-rw-r--r--contrib/libg++/libio/ioprintf.c47
-rw-r--r--contrib/libg++/libio/ioputs.c38
-rw-r--r--contrib/libg++/libio/ioscanf.c47
-rw-r--r--contrib/libg++/libio/ioseekoff.c43
-rw-r--r--contrib/libg++/libio/ioseekpos.c39
-rw-r--r--contrib/libg++/libio/iosetbuffer.c36
-rw-r--r--contrib/libg++/libio/iosetvbuf.c78
-rw-r--r--contrib/libg++/libio/iosprintf.c47
-rw-r--r--contrib/libg++/libio/iosscanf.c47
-rw-r--r--contrib/libg++/libio/iostdio.h114
-rw-r--r--contrib/libg++/libio/iostream.cc821
-rw-r--r--contrib/libg++/libio/iostream.h254
-rw-r--r--contrib/libg++/libio/iostream.texi1971
-rw-r--r--contrib/libg++/libio/iostreamP.h26
-rw-r--r--contrib/libg++/libio/iostrerror.c12
-rw-r--r--contrib/libg++/libio/ioungetc.c35
-rw-r--r--contrib/libg++/libio/iovfprintf.c881
-rw-r--r--contrib/libg++/libio/iovfscanf.c787
-rw-r--r--contrib/libg++/libio/iovsprintf.c40
-rw-r--r--contrib/libg++/libio/iovsscanf.c37
-rw-r--r--contrib/libg++/libio/isgetline.cc139
-rw-r--r--contrib/libg++/libio/isgetsb.cc59
-rw-r--r--contrib/libg++/libio/isscan.cc45
-rw-r--r--contrib/libg++/libio/istream.h25
-rw-r--r--contrib/libg++/libio/libio.h255
-rw-r--r--contrib/libg++/libio/libioP.h494
-rw-r--r--contrib/libg++/libio/osform.cc54
-rw-r--r--contrib/libg++/libio/ostream.h25
-rw-r--r--contrib/libg++/libio/outfloat.c204
-rw-r--r--contrib/libg++/libio/parsestream.cc317
-rw-r--r--contrib/libg++/libio/parsestream.h156
-rw-r--r--contrib/libg++/libio/pfstream.cc92
-rw-r--r--contrib/libg++/libio/pfstream.h59
-rw-r--r--contrib/libg++/libio/procbuf.cc55
-rw-r--r--contrib/libg++/libio/procbuf.h50
-rw-r--r--contrib/libg++/libio/sbform.cc40
-rw-r--r--contrib/libg++/libio/sbgetline.cc31
-rw-r--r--contrib/libg++/libio/sbscan.cc45
-rw-r--r--contrib/libg++/libio/stdfiles.c44
-rw-r--r--contrib/libg++/libio/stdiostream.cc159
-rw-r--r--contrib/libg++/libio/stdiostream.h79
-rw-r--r--contrib/libg++/libio/stdstrbufs.cc115
-rw-r--r--contrib/libg++/libio/stdstreams.cc153
-rw-r--r--contrib/libg++/libio/stream.cc170
-rw-r--r--contrib/libg++/libio/stream.h59
-rw-r--r--contrib/libg++/libio/streambuf.cc343
-rw-r--r--contrib/libg++/libio/streambuf.h475
-rw-r--r--contrib/libg++/libio/strfile.h52
-rw-r--r--contrib/libg++/libio/strops.c290
-rw-r--r--contrib/libg++/libio/strstream.cc116
-rw-r--r--contrib/libg++/libio/strstream.h113
-rw-r--r--contrib/libg++/libio/tests/ChangeLog111
-rw-r--r--contrib/libg++/libio/tests/Makefile.in195
-rw-r--r--contrib/libg++/libio/tests/configure.in21
-rw-r--r--contrib/libg++/libio/tests/hounddog.cc85
-rw-r--r--contrib/libg++/libio/tests/hounddog.exp7
-rw-r--r--contrib/libg++/libio/tests/hounddog.inp7
-rw-r--r--contrib/libg++/libio/tests/putbackdog.cc97
-rw-r--r--contrib/libg++/libio/tests/tFile.cc550
-rw-r--r--contrib/libg++/libio/tests/tFile.exp75
-rw-r--r--contrib/libg++/libio/tests/tFile.inp5
-rw-r--r--contrib/libg++/libio/tests/tfformat.c4145
-rw-r--r--contrib/libg++/libio/tests/tiformat.c5093
-rw-r--r--contrib/libg++/libio/tests/tiomanip.cc35
-rw-r--r--contrib/libg++/libio/tests/tiomanip.exp4
-rw-r--r--contrib/libg++/libio/tests/tiomisc.cc236
-rw-r--r--contrib/libg++/libio/tests/tiomisc.exp11
-rw-r--r--contrib/libg++/libio/tests/tstdiomisc.c43
-rw-r--r--contrib/libg++/libio/tests/tstdiomisc.exp8
-rw-r--r--contrib/libg++/librx/ChangeLog302
-rw-r--r--contrib/libg++/librx/DOC179
-rw-r--r--contrib/libg++/librx/rx.c7193
-rw-r--r--contrib/libg++/librx/rx.h3732
-rw-r--r--contrib/libg++/libstdc++/ChangeLog620
-rw-r--r--contrib/libg++/libstdc++/Makefile.in310
-rw-r--r--contrib/libg++/libstdc++/algorithm7
-rw-r--r--contrib/libg++/libstdc++/cassert6
-rw-r--r--contrib/libg++/libstdc++/cctype6
-rw-r--r--contrib/libg++/libstdc++/cerrno6
-rw-r--r--contrib/libg++/libstdc++/cfloat6
-rw-r--r--contrib/libg++/libstdc++/cinst.cc151
-rw-r--r--contrib/libg++/libstdc++/ciso6466
-rw-r--r--contrib/libg++/libstdc++/climits6
-rw-r--r--contrib/libg++/libstdc++/clocale6
-rw-r--r--contrib/libg++/libstdc++/cmath6
-rw-r--r--contrib/libg++/libstdc++/cmathi.cc7
-rw-r--r--contrib/libg++/libstdc++/complex6
-rw-r--r--contrib/libg++/libstdc++/complex.h6
-rw-r--r--contrib/libg++/libstdc++/csetjmp6
-rw-r--r--contrib/libg++/libstdc++/csignal6
-rw-r--r--contrib/libg++/libstdc++/cstdarg6
-rw-r--r--contrib/libg++/libstdc++/cstddef6
-rw-r--r--contrib/libg++/libstdc++/cstdio6
-rw-r--r--contrib/libg++/libstdc++/cstdlib6
-rw-r--r--contrib/libg++/libstdc++/cstdlibi.cc7
-rw-r--r--contrib/libg++/libstdc++/cstring6
-rw-r--r--contrib/libg++/libstdc++/cstringi.cc7
-rw-r--r--contrib/libg++/libstdc++/ctime6
-rw-r--r--contrib/libg++/libstdc++/cwchar6
-rw-r--r--contrib/libg++/libstdc++/cwctype6
-rw-r--r--contrib/libg++/libstdc++/deque7
-rw-r--r--contrib/libg++/libstdc++/exception6
-rw-r--r--contrib/libg++/libstdc++/exceptioni.cc78
-rw-r--r--contrib/libg++/libstdc++/functional7
-rw-r--r--contrib/libg++/libstdc++/iterator7
-rw-r--r--contrib/libg++/libstdc++/list7
-rw-r--r--contrib/libg++/libstdc++/map7
-rw-r--r--contrib/libg++/libstdc++/memory7
-rw-r--r--contrib/libg++/libstdc++/new6
-rw-r--r--contrib/libg++/libstdc++/new.h7
-rw-r--r--contrib/libg++/libstdc++/newi.cc7
-rw-r--r--contrib/libg++/libstdc++/numeric7
-rw-r--r--contrib/libg++/libstdc++/queue7
-rw-r--r--contrib/libg++/libstdc++/set7
-rw-r--r--contrib/libg++/libstdc++/sinst.cc147
-rw-r--r--contrib/libg++/libstdc++/stack7
-rw-r--r--contrib/libg++/libstdc++/std/bastring.cc489
-rw-r--r--contrib/libg++/libstdc++/std/bastring.h574
-rw-r--r--contrib/libg++/libstdc++/std/cassert.h7
-rw-r--r--contrib/libg++/libstdc++/std/cctype.h7
-rw-r--r--contrib/libg++/libstdc++/std/cerrno.h7
-rw-r--r--contrib/libg++/libstdc++/std/cfloat.h7
-rw-r--r--contrib/libg++/libstdc++/std/cinst.h112
-rw-r--r--contrib/libg++/libstdc++/std/ciso646.h7
-rw-r--r--contrib/libg++/libstdc++/std/climits.h7
-rw-r--r--contrib/libg++/libstdc++/std/clocale.h7
-rw-r--r--contrib/libg++/libstdc++/std/cmath.h76
-rw-r--r--contrib/libg++/libstdc++/std/complex.h18
-rw-r--r--contrib/libg++/libstdc++/std/complext.cc273
-rw-r--r--contrib/libg++/libstdc++/std/complext.h317
-rw-r--r--contrib/libg++/libstdc++/std/csetjmp.h8
-rw-r--r--contrib/libg++/libstdc++/std/csignal.h7
-rw-r--r--contrib/libg++/libstdc++/std/cstdarg.h7
-rw-r--r--contrib/libg++/libstdc++/std/cstddef.h7
-rw-r--r--contrib/libg++/libstdc++/std/cstdio.h7
-rw-r--r--contrib/libg++/libstdc++/std/cstdlib.h23
-rw-r--r--contrib/libg++/libstdc++/std/cstring.h71
-rw-r--r--contrib/libg++/libstdc++/std/ctime.h7
-rw-r--r--contrib/libg++/libstdc++/std/cwchar.h7
-rw-r--r--contrib/libg++/libstdc++/std/cwctype.h7
-rw-r--r--contrib/libg++/libstdc++/std/dcomplex.h89
-rw-r--r--contrib/libg++/libstdc++/std/exception.h39
-rw-r--r--contrib/libg++/libstdc++/std/fcomplex.h85
-rw-r--r--contrib/libg++/libstdc++/std/ldcomplex.h93
-rw-r--r--contrib/libg++/libstdc++/std/new.h34
-rw-r--r--contrib/libg++/libstdc++/std/sinst.h73
-rw-r--r--contrib/libg++/libstdc++/std/stddef.h25
-rw-r--r--contrib/libg++/libstdc++/std/stdexcept.h126
-rw-r--r--contrib/libg++/libstdc++/std/straits.h161
-rw-r--r--contrib/libg++/libstdc++/std/string.h13
-rw-r--r--contrib/libg++/libstdc++/std/typeinfo.h245
-rw-r--r--contrib/libg++/libstdc++/stddef6
-rw-r--r--contrib/libg++/libstdc++/stddefi.cc7
-rw-r--r--contrib/libg++/libstdc++/stdexcept6
-rw-r--r--contrib/libg++/libstdc++/stdexcepti.cc8
-rw-r--r--contrib/libg++/libstdc++/stl.h15
-rw-r--r--contrib/libg++/libstdc++/stl/ChangeLog86
-rw-r--r--contrib/libg++/libstdc++/stl/Makefile.in12
-rw-r--r--contrib/libg++/libstdc++/stl/README86
-rw-r--r--contrib/libg++/libstdc++/stl/algo.h2386
-rw-r--r--contrib/libg++/libstdc++/stl/algobase.h232
-rw-r--r--contrib/libg++/libstdc++/stl/bool.h20
-rw-r--r--contrib/libg++/libstdc++/stl/bvector.h421
-rw-r--r--contrib/libg++/libstdc++/stl/configure.in37
-rw-r--r--contrib/libg++/libstdc++/stl/defalloc.h176
-rw-r--r--contrib/libg++/libstdc++/stl/deque.h684
-rw-r--r--contrib/libg++/libstdc++/stl/faralloc.h120
-rw-r--r--contrib/libg++/libstdc++/stl/fdeque.h39
-rw-r--r--contrib/libg++/libstdc++/stl/flist.h39
-rw-r--r--contrib/libg++/libstdc++/stl/fmap.h44
-rw-r--r--contrib/libg++/libstdc++/stl/fmultmap.h44
-rw-r--r--contrib/libg++/libstdc++/stl/fmultset.h44
-rw-r--r--contrib/libg++/libstdc++/stl/fset.h44
-rw-r--r--contrib/libg++/libstdc++/stl/function.h282
-rw-r--r--contrib/libg++/libstdc++/stl/hdeque.h39
-rw-r--r--contrib/libg++/libstdc++/stl/heap.h193
-rw-r--r--contrib/libg++/libstdc++/stl/hlist.h39
-rw-r--r--contrib/libg++/libstdc++/stl/hmap.h44
-rw-r--r--contrib/libg++/libstdc++/stl/hmultmap.h44
-rw-r--r--contrib/libg++/libstdc++/stl/hmultset.h44
-rw-r--r--contrib/libg++/libstdc++/stl/hset.h44
-rw-r--r--contrib/libg++/libstdc++/stl/hugalloc.h38
-rw-r--r--contrib/libg++/libstdc++/stl/hvector.h39
-rw-r--r--contrib/libg++/libstdc++/stl/iterator.h395
-rw-r--r--contrib/libg++/libstdc++/stl/lbvector.h39
-rw-r--r--contrib/libg++/libstdc++/stl/ldeque.h39
-rw-r--r--contrib/libg++/libstdc++/stl/list.h531
-rw-r--r--contrib/libg++/libstdc++/stl/llist.h39
-rw-r--r--contrib/libg++/libstdc++/stl/lmap.h44
-rw-r--r--contrib/libg++/libstdc++/stl/lmultmap.h44
-rw-r--r--contrib/libg++/libstdc++/stl/lmultset.h44
-rw-r--r--contrib/libg++/libstdc++/stl/lngalloc.h54
-rw-r--r--contrib/libg++/libstdc++/stl/lset.h44
-rw-r--r--contrib/libg++/libstdc++/stl/map.h150
-rw-r--r--contrib/libg++/libstdc++/stl/multimap.h142
-rw-r--r--contrib/libg++/libstdc++/stl/multiset.h129
-rw-r--r--contrib/libg++/libstdc++/stl/neralloc.h38
-rw-r--r--contrib/libg++/libstdc++/stl/nmap.h44
-rw-r--r--contrib/libg++/libstdc++/stl/nmultmap.h44
-rw-r--r--contrib/libg++/libstdc++/stl/nmultset.h44
-rw-r--r--contrib/libg++/libstdc++/stl/nset.h44
-rw-r--r--contrib/libg++/libstdc++/stl/pair.h46
-rw-r--r--contrib/libg++/libstdc++/stl/projectn.h33
-rw-r--r--contrib/libg++/libstdc++/stl/random.cc60
-rw-r--r--contrib/libg++/libstdc++/stl/set.h132
-rw-r--r--contrib/libg++/libstdc++/stl/stack.h120
-rw-r--r--contrib/libg++/libstdc++/stl/tempbuf.cc18
-rw-r--r--contrib/libg++/libstdc++/stl/tempbuf.h55
-rw-r--r--contrib/libg++/libstdc++/stl/tree.cc3
-rw-r--r--contrib/libg++/libstdc++/stl/tree.h1246
-rw-r--r--contrib/libg++/libstdc++/stl/vector.h355
-rw-r--r--contrib/libg++/libstdc++/string6
-rw-r--r--contrib/libg++/libstdc++/tests/ChangeLog52
-rw-r--r--contrib/libg++/libstdc++/tests/Makefile.in35
-rw-r--r--contrib/libg++/libstdc++/tests/configure.in49
-rw-r--r--contrib/libg++/libstdc++/tests/tcomplex.cc143
-rw-r--r--contrib/libg++/libstdc++/tests/tcomplex.exp37
-rw-r--r--contrib/libg++/libstdc++/tests/tcomplex.inp1
-rw-r--r--contrib/libg++/libstdc++/tests/tlist.cc162
-rw-r--r--contrib/libg++/libstdc++/tests/tlist.exp44
-rw-r--r--contrib/libg++/libstdc++/tests/tmap.cc66
-rw-r--r--contrib/libg++/libstdc++/tests/tmap.exp7
-rw-r--r--contrib/libg++/libstdc++/tests/tstring.cc189
-rw-r--r--contrib/libg++/libstdc++/tests/tstring.exp20
-rw-r--r--contrib/libg++/libstdc++/tests/tstring.inp1
-rw-r--r--contrib/libg++/libstdc++/tests/tvector.cc20
-rw-r--r--contrib/libg++/libstdc++/tests/tvector.exp4
-rw-r--r--contrib/libg++/libstdc++/typeinfo6
-rw-r--r--contrib/libg++/libstdc++/typeinfoi.cc131
-rw-r--r--contrib/libg++/libstdc++/utility8
-rw-r--r--contrib/libg++/libstdc++/vector7
-rw-r--r--contrib/libio/ChangeLog2807
-rw-r--r--contrib/libio/Makefile.in137
-rw-r--r--contrib/libio/NEWS57
-rw-r--r--contrib/libio/PlotFile.cc157
-rw-r--r--contrib/libio/PlotFile.h89
-rw-r--r--contrib/libio/README30
-rw-r--r--contrib/libio/SFile.cc82
-rw-r--r--contrib/libio/SFile.h55
-rw-r--r--contrib/libio/builtinbuf.cc78
-rw-r--r--contrib/libio/builtinbuf.h68
-rw-r--r--contrib/libio/cleanup.c17
-rw-r--r--contrib/libio/config.shared499
-rw-r--r--contrib/libio/config/hpux.mt3
-rw-r--r--contrib/libio/config/isc.mt4
-rw-r--r--contrib/libio/config/linux.mt25
-rw-r--r--contrib/libio/config/linuxaxp1-libc-lock.h112
-rw-r--r--contrib/libio/config/linuxaxp1-stdio-lock.h36
-rw-r--r--contrib/libio/config/linuxaxp1.mt10
-rw-r--r--contrib/libio/config/linuxlibc1.mt26
-rw-r--r--contrib/libio/config/mn10200.mt3
-rw-r--r--contrib/libio/config/mtsafe.mt2
-rw-r--r--contrib/libio/config/netware.mt16
-rw-r--r--contrib/libio/configure.in199
-rw-r--r--contrib/libio/dbz/Makefile.in218
-rw-r--r--contrib/libio/dbz/README25
-rw-r--r--contrib/libio/dbz/altbytes7
-rw-r--r--contrib/libio/dbz/byteflip.c38
-rw-r--r--contrib/libio/dbz/case.c129
-rw-r--r--contrib/libio/dbz/case.h12
-rw-r--r--contrib/libio/dbz/configure.in17
-rw-r--r--contrib/libio/dbz/dbz.1221
-rw-r--r--contrib/libio/dbz/dbz.3z547
-rw-r--r--contrib/libio/dbz/dbz.c1768
-rw-r--r--contrib/libio/dbz/dbz.h32
-rw-r--r--contrib/libio/dbz/dbzmain.c519
-rw-r--r--contrib/libio/dbz/fake.c144
-rw-r--r--contrib/libio/dbz/firstlast2550
-rwxr-xr-xcontrib/libio/dbz/getmap6
-rw-r--r--contrib/libio/dbz/random.c31
-rw-r--r--contrib/libio/dbz/revbytes7
-rw-r--r--contrib/libio/dbz/stdio.h1
-rw-r--r--contrib/libio/depend379
-rw-r--r--contrib/libio/editbuf.cc717
-rw-r--r--contrib/libio/editbuf.h185
-rw-r--r--contrib/libio/filebuf.cc223
-rw-r--r--contrib/libio/filedoalloc.c107
-rw-r--r--contrib/libio/fileops.c811
-rw-r--r--contrib/libio/floatconv.c2375
-rw-r--r--contrib/libio/floatio.h51
-rw-r--r--contrib/libio/fstream.cc110
-rw-r--r--contrib/libio/fstream.h92
-rwxr-xr-xcontrib/libio/gen-params739
-rw-r--r--contrib/libio/genops.c946
-rw-r--r--contrib/libio/include/empty.h37
-rw-r--r--contrib/libio/indstream.cc121
-rw-r--r--contrib/libio/indstream.h77
-rw-r--r--contrib/libio/ioassign.cc49
-rw-r--r--contrib/libio/ioextend.cc132
-rw-r--r--contrib/libio/iofclose.c60
-rw-r--r--contrib/libio/iofdopen.c134
-rw-r--r--contrib/libio/iofeof.c45
-rw-r--r--contrib/libio/ioferror.c45
-rw-r--r--contrib/libio/iofflush.c49
-rw-r--r--contrib/libio/iofflush_u.c40
-rw-r--r--contrib/libio/iofgetpos.c55
-rw-r--r--contrib/libio/iofgets.c56
-rw-r--r--contrib/libio/iofopen.c64
-rw-r--r--contrib/libio/iofprintf.c51
-rw-r--r--contrib/libio/iofputs.c49
-rw-r--r--contrib/libio/iofread.c49
-rw-r--r--contrib/libio/iofscanf.c48
-rw-r--r--contrib/libio/iofsetpos.c56
-rw-r--r--contrib/libio/ioftell.c53
-rw-r--r--contrib/libio/iofwrite.c54
-rw-r--r--contrib/libio/iogetc.c50
-rw-r--r--contrib/libio/iogetdelim.c125
-rw-r--r--contrib/libio/iogetline.c112
-rw-r--r--contrib/libio/iogets.c71
-rw-r--r--contrib/libio/ioignore.c47
-rw-r--r--contrib/libio/iolibio.h67
-rw-r--r--contrib/libio/iomanip.cc90
-rw-r--r--contrib/libio/iomanip.h180
-rw-r--r--contrib/libio/iopadn.c70
-rw-r--r--contrib/libio/ioperror.c22
-rw-r--r--contrib/libio/iopopen.c248
-rw-r--r--contrib/libio/ioprims.c80
-rw-r--r--contrib/libio/ioprintf.c47
-rw-r--r--contrib/libio/ioputc.c44
-rw-r--r--contrib/libio/ioputs.c49
-rw-r--r--contrib/libio/ioscanf.c47
-rw-r--r--contrib/libio/ioseekoff.c54
-rw-r--r--contrib/libio/ioseekpos.c48
-rw-r--r--contrib/libio/iosetbuffer.c46
-rw-r--r--contrib/libio/iosetvbuf.c100
-rw-r--r--contrib/libio/iosprintf.c50
-rw-r--r--contrib/libio/iosscanf.c47
-rw-r--r--contrib/libio/iostdio.h114
-rw-r--r--contrib/libio/iostream.cc1049
-rw-r--r--contrib/libio/iostream.h273
-rw-r--r--contrib/libio/iostream.texi1971
-rw-r--r--contrib/libio/iostreamP.h26
-rw-r--r--contrib/libio/iostrerror.c12
-rw-r--r--contrib/libio/ioungetc.c46
-rw-r--r--contrib/libio/iovfprintf.c890
-rw-r--r--contrib/libio/iovfscanf.c790
-rw-r--r--contrib/libio/iovsprintf.c60
-rw-r--r--contrib/libio/iovsscanf.c59
-rw-r--r--contrib/libio/isgetline.cc153
-rw-r--r--contrib/libio/isgetsb.cc63
-rw-r--r--contrib/libio/isscan.cc55
-rw-r--r--contrib/libio/istream.h25
-rw-r--r--contrib/libio/libio.h365
-rw-r--r--contrib/libio/libioP.h648
-rw-r--r--contrib/libio/osform.cc66
-rw-r--r--contrib/libio/ostream.h25
-rw-r--r--contrib/libio/outfloat.c211
-rw-r--r--contrib/libio/parsestream.cc317
-rw-r--r--contrib/libio/parsestream.h156
-rw-r--r--contrib/libio/peekc.c42
-rw-r--r--contrib/libio/pfstream.cc92
-rw-r--r--contrib/libio/pfstream.h59
-rw-r--r--contrib/libio/procbuf.cc54
-rw-r--r--contrib/libio/procbuf.h50
-rw-r--r--contrib/libio/sbform.cc40
-rw-r--r--contrib/libio/sbgetline.cc31
-rw-r--r--contrib/libio/sbscan.cc45
-rw-r--r--contrib/libio/stdfiles.c51
-rw-r--r--contrib/libio/stdio/ChangeLog153
-rw-r--r--contrib/libio/stdio/Makefile.in35
-rw-r--r--contrib/libio/stdio/clearerr.c30
-rw-r--r--contrib/libio/stdio/clearerr_u.c28
-rw-r--r--contrib/libio/stdio/configure.in49
-rw-r--r--contrib/libio/stdio/fdopen.c9
-rw-r--r--contrib/libio/stdio/feof.c43
-rw-r--r--contrib/libio/stdio/feof_u.c37
-rw-r--r--contrib/libio/stdio/ferror.c43
-rw-r--r--contrib/libio/stdio/ferror_u.c37
-rw-r--r--contrib/libio/stdio/fgetc.c40
-rw-r--r--contrib/libio/stdio/fileno.c49
-rw-r--r--contrib/libio/stdio/fputc.c41
-rw-r--r--contrib/libio/stdio/fputc_u.c38
-rw-r--r--contrib/libio/stdio/freopen.c44
-rw-r--r--contrib/libio/stdio/fseek.c42
-rw-r--r--contrib/libio/stdio/getc.c48
-rw-r--r--contrib/libio/stdio/getc_u.c37
-rw-r--r--contrib/libio/stdio/getchar.c40
-rw-r--r--contrib/libio/stdio/getchar_u.c35
-rw-r--r--contrib/libio/stdio/getline.c13
-rw-r--r--contrib/libio/stdio/getw.c13
-rw-r--r--contrib/libio/stdio/obprintf.c168
-rw-r--r--contrib/libio/stdio/popen.c23
-rw-r--r--contrib/libio/stdio/putc.c42
-rw-r--r--contrib/libio/stdio/putc_u.c31
-rw-r--r--contrib/libio/stdio/putchar.c35
-rw-r--r--contrib/libio/stdio/putchar_u.c30
-rw-r--r--contrib/libio/stdio/putw.c15
-rw-r--r--contrib/libio/stdio/rewind.c38
-rw-r--r--contrib/libio/stdio/setbuf.c35
-rw-r--r--contrib/libio/stdio/setfileno.c17
-rw-r--r--contrib/libio/stdio/setlinebuf.c36
-rw-r--r--contrib/libio/stdio/snprintf.c51
-rw-r--r--contrib/libio/stdio/stdio.h219
-rw-r--r--contrib/libio/stdio/vasprintf.c72
-rw-r--r--contrib/libio/stdio/vfprintf.c35
-rw-r--r--contrib/libio/stdio/vfscanf.c36
-rw-r--r--contrib/libio/stdio/vprintf.c33
-rw-r--r--contrib/libio/stdio/vscanf.c41
-rw-r--r--contrib/libio/stdio/vsnprintf.c136
-rw-r--r--contrib/libio/stdiostream.cc159
-rw-r--r--contrib/libio/stdiostream.h79
-rw-r--r--contrib/libio/stdstrbufs.cc126
-rw-r--r--contrib/libio/stdstreams.cc153
-rw-r--r--contrib/libio/stream.cc170
-rw-r--r--contrib/libio/stream.h59
-rw-r--r--contrib/libio/streambuf.cc364
-rw-r--r--contrib/libio/streambuf.h490
-rw-r--r--contrib/libio/strfile.h71
-rw-r--r--contrib/libio/strops.c303
-rw-r--r--contrib/libio/strstream.cc116
-rw-r--r--contrib/libio/strstream.h113
-rw-r--r--contrib/libio/tests/ChangeLog166
-rw-r--r--contrib/libio/tests/Makefile.in196
-rw-r--r--contrib/libio/tests/configure.in36
-rw-r--r--contrib/libio/tests/hounddog.cc85
-rw-r--r--contrib/libio/tests/hounddog.exp7
-rw-r--r--contrib/libio/tests/hounddog.inp7
-rw-r--r--contrib/libio/tests/putbackdog.cc97
-rw-r--r--contrib/libio/tests/tFile.cc558
-rw-r--r--contrib/libio/tests/tFile.exp75
-rw-r--r--contrib/libio/tests/tFile.inp5
-rw-r--r--contrib/libio/tests/tfformat.c4181
-rw-r--r--contrib/libio/tests/tiformat.c5112
-rw-r--r--contrib/libio/tests/tiomanip.cc35
-rw-r--r--contrib/libio/tests/tiomanip.exp4
-rw-r--r--contrib/libio/tests/tiomisc.cc236
-rw-r--r--contrib/libio/tests/tiomisc.exp11
-rw-r--r--contrib/libio/tests/tstdiomisc.c43
-rw-r--r--contrib/libio/tests/tstdiomisc.exp8
-rw-r--r--contrib/libio/testsuite/ChangeLog99
-rw-r--r--contrib/libio/testsuite/Makefile.in90
-rw-r--r--contrib/libio/testsuite/config/default.exp1
-rw-r--r--contrib/libio/testsuite/configure.in22
-rw-r--r--contrib/libio/testsuite/lib/libio.exp167
-rw-r--r--contrib/libio/testsuite/libio.tests/hounddog.exp3
-rw-r--r--contrib/libio/testsuite/libio.tests/putbackdog.exp3
-rw-r--r--contrib/libio/testsuite/libio.tests/tFile.exp3
-rw-r--r--contrib/libio/testsuite/libio.tests/tfformat.exp1
-rw-r--r--contrib/libio/testsuite/libio.tests/tiformat.exp1
-rw-r--r--contrib/libio/testsuite/libio.tests/tiomanip.exp1
-rw-r--r--contrib/libio/testsuite/libio.tests/tiomisc.exp1
-rw-r--r--contrib/libio/testsuite/libio.tests/tstdiomisc.exp1
-rw-r--r--contrib/libobjc/ChangeLog174
-rw-r--r--contrib/libobjc/Makefile.in322
-rw-r--r--contrib/libobjc/NXConstStr.m42
-rw-r--r--contrib/libobjc/Object.m387
-rw-r--r--contrib/libobjc/Protocol.m128
-rw-r--r--contrib/libobjc/README97
-rw-r--r--contrib/libobjc/README.threads50
-rw-r--r--contrib/libobjc/THREADS374
-rw-r--r--contrib/libobjc/THREADS.MACH23
-rw-r--r--contrib/libobjc/archive.c1651
-rw-r--r--contrib/libobjc/class.c358
-rwxr-xr-xcontrib/libobjc/configure1459
-rw-r--r--contrib/libobjc/configure.in142
-rw-r--r--contrib/libobjc/encoding.c918
-rw-r--r--contrib/libobjc/gc.c458
-rw-r--r--contrib/libobjc/hash.c283
-rw-r--r--contrib/libobjc/init.c834
-rw-r--r--contrib/libobjc/libobjc.def161
-rw-r--r--contrib/libobjc/libobjc_entry.c55
-rw-r--r--contrib/libobjc/linking.m40
-rw-r--r--contrib/libobjc/makefile.dos56
-rw-r--r--contrib/libobjc/misc.c180
-rw-r--r--contrib/libobjc/nil_method.c40
-rw-r--r--contrib/libobjc/objc-features.texi392
-rw-r--r--contrib/libobjc/objc/NXConstStr.h44
-rw-r--r--contrib/libobjc/objc/Object.h124
-rw-r--r--contrib/libobjc/objc/Protocol.h58
-rw-r--r--contrib/libobjc/objc/encoding.h99
-rw-r--r--contrib/libobjc/objc/hash.h206
-rw-r--r--contrib/libobjc/objc/objc-api.h597
-rw-r--r--contrib/libobjc/objc/objc-list.h147
-rw-r--r--contrib/libobjc/objc/objc.h158
-rw-r--r--contrib/libobjc/objc/runtime.h88
-rw-r--r--contrib/libobjc/objc/sarray.h237
-rw-r--r--contrib/libobjc/objc/thr.h143
-rw-r--r--contrib/libobjc/objc/typedstream.h132
-rw-r--r--contrib/libobjc/objects.c105
-rw-r--r--contrib/libobjc/sarray.c522
-rw-r--r--contrib/libobjc/selector.c458
-rw-r--r--contrib/libobjc/sendmsg.c646
-rw-r--r--contrib/libobjc/thr-dce.c281
-rw-r--r--contrib/libobjc/thr-decosf1.c281
-rw-r--r--contrib/libobjc/thr-irix.c235
-rw-r--r--contrib/libobjc/thr-mach.c312
-rw-r--r--contrib/libobjc/thr-os2.c267
-rw-r--r--contrib/libobjc/thr-posix.c229
-rw-r--r--contrib/libobjc/thr-pthreads.c218
-rw-r--r--contrib/libobjc/thr-single.c192
-rw-r--r--contrib/libobjc/thr-solaris.c259
-rw-r--r--contrib/libobjc/thr-vxworks.c192
-rw-r--r--contrib/libobjc/thr-win32.c272
-rw-r--r--contrib/libobjc/thr.c534
-rw-r--r--contrib/libstdc++/ChangeLog1421
-rw-r--r--contrib/libstdc++/Makefile.in385
-rw-r--r--contrib/libstdc++/NEWS9
-rw-r--r--contrib/libstdc++/cassert7
-rw-r--r--contrib/libstdc++/cctype7
-rw-r--r--contrib/libstdc++/cerrno7
-rw-r--r--contrib/libstdc++/cfloat7
-rw-r--r--contrib/libstdc++/cinst.cc154
-rw-r--r--contrib/libstdc++/ciso6467
-rw-r--r--contrib/libstdc++/climits7
-rw-r--r--contrib/libstdc++/clocale7
-rw-r--r--contrib/libstdc++/cmath76
-rw-r--r--contrib/libstdc++/cmathi.cc7
-rw-r--r--contrib/libstdc++/complex18
-rw-r--r--contrib/libstdc++/complex.h6
-rw-r--r--contrib/libstdc++/config/aix.ml9
-rw-r--r--contrib/libstdc++/config/dec-osf.ml6
-rw-r--r--contrib/libstdc++/config/delta.mt2
-rw-r--r--contrib/libstdc++/config/elf.ml8
-rw-r--r--contrib/libstdc++/config/elfshlibm.ml6
-rw-r--r--contrib/libstdc++/config/freebsd.ml6
-rw-r--r--contrib/libstdc++/config/gnu.ml6
-rw-r--r--contrib/libstdc++/config/hpux.ml6
-rw-r--r--contrib/libstdc++/config/irix5.ml6
-rw-r--r--contrib/libstdc++/config/linux.ml11
-rw-r--r--contrib/libstdc++/config/linux.mt2
-rw-r--r--contrib/libstdc++/config/openbsd.ml7
-rw-r--r--contrib/libstdc++/config/openbsd.mt3
-rw-r--r--contrib/libstdc++/config/posix.mt1
-rw-r--r--contrib/libstdc++/config/sol2pth.mt1
-rw-r--r--contrib/libstdc++/config/sol2shm.ml6
-rw-r--r--contrib/libstdc++/config/sol2solth.mt1
-rw-r--r--contrib/libstdc++/config/sunos4.ml9
-rw-r--r--contrib/libstdc++/config/x86-interix.ml9
-rw-r--r--contrib/libstdc++/configure.in203
-rw-r--r--contrib/libstdc++/csetjmp8
-rw-r--r--contrib/libstdc++/csignal7
-rw-r--r--contrib/libstdc++/cstdarg7
-rw-r--r--contrib/libstdc++/cstddef7
-rw-r--r--contrib/libstdc++/cstdio7
-rw-r--r--contrib/libstdc++/cstdlib23
-rw-r--r--contrib/libstdc++/cstdlibi.cc7
-rw-r--r--contrib/libstdc++/cstring96
-rw-r--r--contrib/libstdc++/cstringi.cc7
-rw-r--r--contrib/libstdc++/ctime7
-rw-r--r--contrib/libstdc++/cwchar7
-rw-r--r--contrib/libstdc++/cwctype7
-rw-r--r--contrib/libstdc++/fstream7
-rw-r--r--contrib/libstdc++/iomanip7
-rw-r--r--contrib/libstdc++/iosfwd15
-rw-r--r--contrib/libstdc++/iostream7
-rw-r--r--contrib/libstdc++/sinst.cc135
-rw-r--r--contrib/libstdc++/sstream343
-rw-r--r--contrib/libstdc++/std/bastring.cc524
-rw-r--r--contrib/libstdc++/std/bastring.h657
-rw-r--r--contrib/libstdc++/std/complext.cc273
-rw-r--r--contrib/libstdc++/std/complext.h400
-rw-r--r--contrib/libstdc++/std/dcomplex.h91
-rw-r--r--contrib/libstdc++/std/fcomplex.h87
-rw-r--r--contrib/libstdc++/std/gslice.h111
-rw-r--r--contrib/libstdc++/std/gslice_array.h170
-rw-r--r--contrib/libstdc++/std/indirect_array.h157
-rw-r--r--contrib/libstdc++/std/ldcomplex.h95
-rw-r--r--contrib/libstdc++/std/mask_array.h154
-rw-r--r--contrib/libstdc++/std/slice.h76
-rw-r--r--contrib/libstdc++/std/slice_array.h156
-rw-r--r--contrib/libstdc++/std/std_valarray.h728
-rw-r--r--contrib/libstdc++/std/straits.h161
-rw-r--r--contrib/libstdc++/std/valarray_array.h346
-rw-r--r--contrib/libstdc++/std/valarray_array.tcc130
-rw-r--r--contrib/libstdc++/std/valarray_meta.h1046
-rw-r--r--contrib/libstdc++/stdexcept97
-rw-r--r--contrib/libstdc++/stdexcepti.cc21
-rw-r--r--contrib/libstdc++/stl.h15
-rw-r--r--contrib/libstdc++/stl/ChangeLog381
-rw-r--r--contrib/libstdc++/stl/README13
-rw-r--r--contrib/libstdc++/stl/algo.h114
-rw-r--r--contrib/libstdc++/stl/algobase.h71
-rw-r--r--contrib/libstdc++/stl/algorithm40
-rw-r--r--contrib/libstdc++/stl/alloc.h46
-rw-r--r--contrib/libstdc++/stl/bitset1066
-rw-r--r--contrib/libstdc++/stl/bvector.h51
-rw-r--r--contrib/libstdc++/stl/defalloc.h87
-rw-r--r--contrib/libstdc++/stl/deque40
-rw-r--r--contrib/libstdc++/stl/deque.h42
-rw-r--r--contrib/libstdc++/stl/function.h118
-rw-r--r--contrib/libstdc++/stl/functional26
-rw-r--r--contrib/libstdc++/stl/hash_map40
-rw-r--r--contrib/libstdc++/stl/hash_map.h49
-rw-r--r--contrib/libstdc++/stl/hash_set40
-rw-r--r--contrib/libstdc++/stl/hash_set.h44
-rw-r--r--contrib/libstdc++/stl/hashtable.h48
-rw-r--r--contrib/libstdc++/stl/heap.h46
-rw-r--r--contrib/libstdc++/stl/iterator44
-rw-r--r--contrib/libstdc++/stl/iterator.h104
-rw-r--r--contrib/libstdc++/stl/list40
-rw-r--r--contrib/libstdc++/stl/list.h42
-rw-r--r--contrib/libstdc++/stl/map40
-rw-r--r--contrib/libstdc++/stl/map.h41
-rw-r--r--contrib/libstdc++/stl/memory108
-rw-r--r--contrib/libstdc++/stl/multimap.h41
-rw-r--r--contrib/libstdc++/stl/multiset.h41
-rw-r--r--contrib/libstdc++/stl/numeric42
-rw-r--r--contrib/libstdc++/stl/pair.h51
-rw-r--r--contrib/libstdc++/stl/pthread_alloc479
-rw-r--r--contrib/libstdc++/stl/pthread_alloc.h31
-rw-r--r--contrib/libstdc++/stl/queue45
-rw-r--r--contrib/libstdc++/stl/rope32
-rw-r--r--contrib/libstdc++/stl/rope.h34
-rw-r--r--contrib/libstdc++/stl/ropeimpl.h1550
-rw-r--r--contrib/libstdc++/stl/set40
-rw-r--r--contrib/libstdc++/stl/set.h41
-rw-r--r--contrib/libstdc++/stl/slist28
-rw-r--r--contrib/libstdc++/stl/slist.h30
-rw-r--r--contrib/libstdc++/stl/stack41
-rw-r--r--contrib/libstdc++/stl/stack.h46
-rw-r--r--contrib/libstdc++/stl/stl_algo.h2894
-rw-r--r--contrib/libstdc++/stl/stl_algobase.h526
-rw-r--r--contrib/libstdc++/stl/stl_alloc.h1057
-rw-r--r--contrib/libstdc++/stl/stl_bvector.h838
-rw-r--r--contrib/libstdc++/stl/stl_config.h356
-rw-r--r--contrib/libstdc++/stl/stl_construct.h90
-rw-r--r--contrib/libstdc++/stl/stl_deque.h1698
-rw-r--r--contrib/libstdc++/stl/stl_function.h700
-rw-r--r--contrib/libstdc++/stl/stl_hash_fun.h93
-rw-r--r--contrib/libstdc++/stl/stl_hash_map.h416
-rw-r--r--contrib/libstdc++/stl/stl_hash_set.h401
-rw-r--r--contrib/libstdc++/stl/stl_hashtable.h1039
-rw-r--r--contrib/libstdc++/stl/stl_heap.h281
-rw-r--r--contrib/libstdc++/stl/stl_iterator.h915
-rw-r--r--contrib/libstdc++/stl/stl_list.h840
-rw-r--r--contrib/libstdc++/stl/stl_map.h242
-rw-r--r--contrib/libstdc++/stl/stl_multimap.h232
-rw-r--r--contrib/libstdc++/stl/stl_multiset.h224
-rw-r--r--contrib/libstdc++/stl/stl_numeric.h239
-rw-r--r--contrib/libstdc++/stl/stl_pair.h77
-rw-r--r--contrib/libstdc++/stl/stl_queue.h202
-rw-r--r--contrib/libstdc++/stl/stl_raw_storage_iter.h81
-rw-r--r--contrib/libstdc++/stl/stl_relops.h62
-rw-r--r--contrib/libstdc++/stl/stl_rope.h2541
-rw-r--r--contrib/libstdc++/stl/stl_set.h216
-rw-r--r--contrib/libstdc++/stl/stl_slist.h945
-rw-r--r--contrib/libstdc++/stl/stl_stack.h111
-rw-r--r--contrib/libstdc++/stl/stl_tempbuf.h156
-rw-r--r--contrib/libstdc++/stl/stl_tree.h1333
-rw-r--r--contrib/libstdc++/stl/stl_uninitialized.h279
-rw-r--r--contrib/libstdc++/stl/stl_vector.h823
-rw-r--r--contrib/libstdc++/stl/tempbuf.h61
-rw-r--r--contrib/libstdc++/stl/tree.h46
-rw-r--r--contrib/libstdc++/stl/type_traits.h373
-rw-r--r--contrib/libstdc++/stl/utility38
-rw-r--r--contrib/libstdc++/stl/vector41
-rw-r--r--contrib/libstdc++/stl/vector.h42
-rw-r--r--contrib/libstdc++/stlinst.cc10
-rw-r--r--contrib/libstdc++/string13
-rw-r--r--contrib/libstdc++/strstream7
-rw-r--r--contrib/libstdc++/tests/ChangeLog132
-rw-r--r--contrib/libstdc++/tests/Makefile.in35
-rw-r--r--contrib/libstdc++/tests/configure.in65
-rw-r--r--contrib/libstdc++/tests/tcomplex.cc151
-rw-r--r--contrib/libstdc++/tests/tcomplex.exp37
-rw-r--r--contrib/libstdc++/tests/tcomplex.inp1
-rw-r--r--contrib/libstdc++/tests/tlist.cc151
-rw-r--r--contrib/libstdc++/tests/tlist.exp44
-rw-r--r--contrib/libstdc++/tests/tmap.cc59
-rw-r--r--contrib/libstdc++/tests/tmap.exp7
-rw-r--r--contrib/libstdc++/tests/tstring.cc249
-rw-r--r--contrib/libstdc++/tests/tstring.exp22
-rw-r--r--contrib/libstdc++/tests/tstring.inp1
-rw-r--r--contrib/libstdc++/tests/tvector.cc20
-rw-r--r--contrib/libstdc++/tests/tvector.exp4
-rw-r--r--contrib/libstdc++/testsuite/ChangeLog94
-rw-r--r--contrib/libstdc++/testsuite/Makefile.in67
-rw-r--r--contrib/libstdc++/testsuite/config/default.exp1
-rw-r--r--contrib/libstdc++/testsuite/configure.in24
-rw-r--r--contrib/libstdc++/testsuite/lib/libstdc++.exp179
-rw-r--r--contrib/libstdc++/testsuite/libstdc++.tests/test.exp34
-rw-r--r--contrib/libstdc++/valarray8
-rw-r--r--contrib/libstdc++/valarray.cc50
1562 files changed, 0 insertions, 352265 deletions
diff --git a/contrib/gcc/BUGS b/contrib/gcc/BUGS
deleted file mode 100644
index 2d875a092efb..000000000000
--- a/contrib/gcc/BUGS
+++ /dev/null
@@ -1,27 +0,0 @@
-If you think you may have found a bug in GCC, please
-read the Bugs section of the GCC manual for advice on
-
-(1) how to tell when to report a bug,
-(2) where to send your bug report, and
-(3) how to write a useful bug report and what information
-it needs to have.
-
-There are three ways to read the Bugs section.
-
-(1) In a printed copy of the GCC manual. You can order one from the
-Free Software Foundation; see the file ORDERS. But if you don't have
-a copy on hand and you think you have found a bug, you shouldn't wait
-to get a printed manual; you should read the section right away as
-described below.
-
-(2) With Info. Start Emacs, do C-h i to enter Info,
-then m gcc RET to get to the GCC manual, then m Bugs RET
-to get to the section on bugs. Or use standalone Info in
-a like manner. (Standalone Info is part of the Texinfo distribution.)
-
-(3) By hand. Search for the chapter "Reporting Bugs" in gcc.texi, or
- cat /usr/local/info/gcc* | more "+/^File: gcc.info, Node: Bugs,"
-
-You may also want to take a look at the GCC FAQ, in which there are
-additional instructions for submitting bug reports:
- http://www.gnu.org/software/gcc/faq.html#bugreport
diff --git a/contrib/gcc/NEWS b/contrib/gcc/NEWS
deleted file mode 100644
index 5023a93b5214..000000000000
--- a/contrib/gcc/NEWS
+++ /dev/null
@@ -1,1539 +0,0 @@
-This file contains information about GCC releases which has been
-generated automatically from the online release notes. This file
-covers releases of GCC (and the former EGCS project) since EGCS 1.0,
-on the line of development that led to GCC 3; for information on GCC
-2.8.1 and older releases of GCC 2, see ONEWS.
-
-======================================================================
-http://gcc.gnu.org/gcc-2.95/gcc-2.95.3.html
-
- GCC 2.95.3
-
- March 16, 2001
-
- The GNU project and the GCC developers are pleased to announce the
- release of GCC version 2.95.3. GCC used to stand for the GNU C
- Compiler, but since the compiler supports several other languages
- aside from C, it now stands for the GNU Compiler Collection.
-
- This is a minor release to address several bugs in the [1]GCC version
- 2.95.2 release.
-
- * Generic bugfixes and improvements
- + Fix numerous problems that caused incorrect optimization in
- the register reloading code.
- + Fix numerous problems that caused incorrect optimization in
- the loop optimizer.
- + Fix aborts in the functions build_insn_chain and scan_loops
- under some circumstances.
- + Fix an alias analysis bug.
- + Fix an infinite compilation bug in the combiner.
- + A few problems with complex number support have been fixed.
- + It is no longer possible for gcc to act as a fork bomb when
- installed incorrectly.
- + The -fpack-struct option should be recognized now.
- + Fixed a bug that caused incorrect code to be generated due to
- a lost stack adjustment.
- * Platform specific bugfixes and improvements
- + Support building ARM toolchains hosted on Windows.
- + Fix attribute calculations in ARM toolchains.
- + arm-linux support has been improved.
- + Fix a PIC failure on sparc targets.
- + On ix86 targets, the regparm attribute should now work
- reliably.
- + Several updates for the h8300 port.
-
- The whole suite has been extensively [2]regression tested and
- [3]package tested. It should be reliable and suitable for widespread
- use.
-
- The GCC 2.95 release has several new optimizations, new targets, new
- languages and other new features as compared to EGCS 1.1 or GCC 2.8.
- See the [4]new features page for a more complete list of new features
- found in the GCC 2.95 releases.
-
- The sources include installation instructions in both HTML and
- plaintext forms in the install directory in the distribution. However,
- the most up to date [5]installation instructions and [6]build/test
- status are on the web pages. We will update those pages as new
- information becomes available.
-
- The GCC developers would like to thank the numerous people that have
- contributed new features, test results, bugfixes, etc to GCC. This
- [7]amazing group of volunteers is what makes GCC successful.
-
- And finally, we can't in good conscience fail to mention some
- [8]caveats to using GCC 2.95.3.
-
- Download GCC 2.95.3 from the [9]GNU FTP server (ftp://ftp.gnu.org)
- Download GCC 2.95.3 from the [10]GCC FTP server (ftp://gcc.gnu.org)
- [11]Find a GNU mirror site
- [12]Find a GCC mirror site
-
- For additional information about GCC please see the [13]GCC project
- web server or contact the [14]GCC development mailing list.
- _________________________________________________________________
-
-
- [15]The GCC team
- Last modified 2001-03-16
-
-References
-
- 1. http://gcc.gnu.org/gcc-2.95/gcc-2.95.2.html
- 2. http://gcc.gnu.org/gcc-2.95/regress.html
- 3. http://gcc.gnu.org/gcc-2.95/othertest.html
- 4. http://gcc.gnu.org/gcc-2.95/features.html
- 5. http://gcc.gnu.org/install/index.html
- 6. http://gcc.gnu.org/gcc-2.95/buildstat.html
- 7. http://gcc.gnu.org/thanks.html
- 8. http://gcc.gnu.org/gcc-2.95/caveats.html
- 9. ftp://ftp.gnu.org/pub/gnu/gcc/
- 10. ftp://gcc.gnu.org/pub/gcc/releases/index.html
- 11. http://www.gnu.org/order/ftp.html
- 12. http://gcc.gnu.org/mirrors.html
- 13. http://gcc.gnu.org/index.html
- 14. mailto:gcc@gcc.gnu.org
- 15. http://gcc.gnu.org/about.html
-======================================================================
-http://gcc.gnu.org/gcc-2.95/gcc-2.95.2.html
-
- GCC 2.95.2
-
- October 27, 1999
-
- The GNU project and the GCC developers are pleased to announce the
- release of GCC version 2.95.2. GCC used to stand for the GNU C
- Compiler, but since the compiler supports several other languages
- aside from C, it now stands for the GNU Compiler Collection.
-
- This is a minor release to address several bugs in the GCC version
- 2.95.1 release.
-
- The -fstrict-aliasing is not enabled by default for GCC 2.95.2. While
- the optimizations performed by -fstrict-aliasing are valid according
- to the C and C++ standards, the optimization have caused some
- problems, particularly with old non-conforming code.
-
- The GCC developers are experimenting with ways to warn users about
- code which violates the C/C++ standards, but those warnings are not
- ready for widespread use at this time. Rather than wait for those
- warnings the GCC developers have chosen to disable -fstrict-aliasing
- by default for the GCC 2.95.2 release.
-
- We strongly encourage developers to find and fix code which violates
- the C/C++ standards as -fstrict-aliasing may be enabled by default in
- future releases. Use the option -fstrict-aliasing to re-enable these
- optimizations.
-
- * Generic bugfixes and improvements
- + Fix incorrectly optimized memory reference in global common
- subexpression elimination (GCSE) optimization pass.
- + Fix code generation bug in regmove.c in which it could
- incorrectly change a "const" value.
- + Fix bug in optimization of conditionals involving volatile
- memory references.
- + Avoid over-allocation of stack space for some procedures.
- + Fixed bug in the compiler which caused incorrect optimization
- of an obscure series of bit manipulations, shifts and
- arithmetic.
- + Fixed register allocator bug which caused teTeX to be
- mis-compiled on Sparc targets.
- + Avoid incorrect optimization of degenerate case statements
- for certain targets such as the ARM.
- + Fix out of range memory reference in the jump optimizer.
- + Avoid dereferencing null pointer in fix-header.
- + Fix test for GCC specific features so that it is possible to
- bootstrap with gcc-2.6.2 and older versions of GCC.
- + Fix typo in scheduler which could potentially cause out of
- range memory accesses.
- + Avoid incorrect loop reversal which caused incorrect code for
- certain loops on PowerPC targets.
- + Avoid incorrect optimization of switch statements on certain
- targets (for example the ARM).
- * Platform specific bugfixes and improvements
- + Work around bug in Sun V5.0 compilers which caused bootstrap
- comparison failures on Sparc targets.
- + Fix Sparc backend bug which caused aborts in final.c.
- + Fix sparc-hal-solaris2* configuration fragments.
- + Fix bug in sparc block profiling.
- + Fix obscure code generation bug for the PARISC targets.
- + Define __STDC_EXT__ for HPUX configurations.
- + Various POWERPC64 code generation bugfixes.
- + Fix abort for PPC targets using ELF (ex GNU/Linux).
- + Fix collect2 problems for AIX targets.
- + Correct handling of .file directive for PPC targets.
- + Fix bug in fix_trunc x86 patterns.
- + Fix x86 port to correctly pop the FP stack for functions that
- return structures in memory.
- + Fix minor bug in strlen x86 pattern.
- + Use stabs debugging instead of dwarf1 for x86-solaris
- targets.
- + Fix template repository code to handle leading underscore in
- mangled names.
- + Fix weak/weak alias support for OpenBSD.
- + GNU/Linux for the ARM has C++ compatible include files.
- * Language & Runtime specific fixes.
- + Fix handling of constructor attribute in the C front-end
- which caused problems building the Chill runtime library on
- some targets.
- + Fix minor problem merging type qualifiers in the C front-end.
- + Fix aliasing bug for pointers and references (C/C++).
- + Fix incorrect "non-constant initializer bug" when
- -traditional or -fwritable-strings is enabled.
- + Fix build error for Chill front-end on SunOS.
- + Do not complain about duplicate instantiations when using
- -frepo (C++)
- + Fix array bounds handling in C++ front-end which caused
- problems with dwarf debugging information in some
- circumstances.
- + Fix minor namespace problem.
- + Fix problem linking java programs.
-
- The whole suite has been extensively [1]regression tested and
- [2]package tested. It should be reliable and suitable for widespread
- use.
-
- The GCC 2.95 release has several new optimizations, new targets, new
- languages and other new features as compared to EGCS 1.1 or GCC 2.8.
- See the [3]new features page for a more complete list of new features
- found in the GCC 2.95 releases.
-
- The sources include installation instructions in both HTML and
- plaintext forms in the install directory in the distribution. However,
- the most up to date [4]installation instructions and [5]build/test
- status are on the web pages. We will update those pages as new
- information becomes available.
-
- The GCC developers would like to thank the numerous people that have
- contributed new features, test results, bugfixes, etc to GCC. This
- [6]amazing group of volunteers is what makes GCC successful.
-
- And finally, we can't in good conscience fail to mention some
- [7]caveats to using GCC 2.95.2.
-
- Download GCC 2.95.2 from the [8]GNU FTP server (ftp://ftp.gnu.org)
- Download GCC 2.95.2 from the [9]GCC/EGCS FTP server
- (ftp://gcc.gnu.org)
- [10]Find a GNU mirror site
- [11]Find a GCC/EGCS mirror site
-
- For additional information about GCC please see the [12]GCC project
- web server or contact the [13]GCC development mailing list.
- _________________________________________________________________
-
-
- [14]The GCC team
- Last modified 2001-02-12
-
-References
-
- 1. http://gcc.gnu.org/gcc-2.95/regress.html
- 2. http://gcc.gnu.org/gcc-2.95/othertest.html
- 3. http://gcc.gnu.org/gcc-2.95/features.html
- 4. http://gcc.gnu.org/install/index.html
- 5. http://gcc.gnu.org/gcc-2.95/buildstat.html
- 6. http://gcc.gnu.org/thanks.html
- 7. http://gcc.gnu.org/gcc-2.95/caveats.html
- 8. ftp://ftp.gnu.org/pub/gnu/gcc/
- 9. ftp://gcc.gnu.org/pub/gcc/releases/index.html
- 10. http://www.gnu.org/order/ftp.html
- 11. http://gcc.gnu.org/mirrors.html
- 12. http://gcc.gnu.org/index.html
- 13. mailto:gcc@gcc.gnu.org
- 14. http://gcc.gnu.org/about.html
-======================================================================
-http://gcc.gnu.org/gcc-2.95/gcc-2.95.1.html
-
- GCC 2.95.1
-
- August 19, 1999
-
- The GNU project and the GCC/EGCS developers are pleased to announce
- the release of GCC version 2.95.1. GCC used to stand for the GNU C
- Compiler, but since the compiler supports several other languages
- aside from C, it now stands for the GNU Compiler Collection.
-
- This is a minor release to address several bugs in the GCC version
- 2.95 release.
-
- * Generic bugfixes and improvements
- + Various documentation fixes related to the GCC/EGCS merger.
- + Fix memory management bug which could lead to spurious
- aborts, core dumps or random parsing errors in the compiler.
- + Fix a couple bugs in the dwarf1 and dwarf2 debug record
- support.
- + Fix infinite loop in the CSE optimizer.
- + Avoid undefined behavior in compiler FP emulation code
- + Fix install problem when prefix is overridden on the make
- install command.
- + Fix problem with unwanted installation of assert.h on some
- systems.
- + Fix problem with finding the wrong assembler in a single tree
- build.
- + Avoid increasing the known alignment of a register that is
- already known to be a pointer.
- * Platform specific bugfixes and improvements
- + Codegen bugfix for prologue/epilogue for cpu32 target.
- + Fix long long code generation bug for the Coldfire target.
- + Fix various aborts in the SH compiler.
- + Fix bugs in libgcc support library for the SH.
- + Fix alpha ev6 code generation bug.
- + Fix problems with EXIT_SUCCESS/EXIT_FAILURE redefinitions on
- AIX platforms.
- + Fix -fpic code generation bug for rs6000/ppc svr4 targets.
- + Fix varargs/stdarg code generation bug for rs6000/ppc svr4
- targets.
- + Fix weak symbol handling for rs6000/ppc svr4 targets.
- + Fix various problems with 64bit code generation for the
- rs6000/ppc port.
- + Fix codegen bug which caused tetex to be mis-compiled on the
- x86
- + Fix compiler abort in new cfg code exposed by x86 port.
- + Fix out of range array reference in code convert flat
- registers to the x87 stacked FP register file.
- + Fix minor vxworks configuration bug
- + Fix return type of bsearch for SunOS 4.x.
- * Language & Runtime specific fixes.
- + The G++ signature extension has been deprecated. It will be
- removed in the next major release of G++. Use of signatures
- will result in a warning from the compiler.
- + Several bugs relating to templates and namespaces were fixed.
- + A bug that caused crashes when combining templates with -g on
- DWARF1 platforms was fixed.
- + Pointers-to-members, virtual functions, and multiple
- inheritance should now work together correctly.
- + Some code-generation bugs relating to function try blocks
- were fixed.
- + G++ is a little bit more lenient with certain archaic
- constructs than in GCC 2.95.
- + Fix to prevent shared library version #s from bring truncated
- to 1 digit
- + Fix missing std:: in the libstdc++ library.
- + Fix stream locking problems in libio.
- + Fix problem in java compiler driver.
-
- The whole suite has been extensively [1]regression tested and
- [2]package tested. It should be reliable and suitable for widespread
- use.
-
- The compiler has several new optimizations, new targets, new languages
- and other new features. See the [3]new features page for a more
- complete list of new features found in the GCC 2.95 releases.
-
- The sources include installation instructions in both HTML and
- plaintext forms in the install directory in the distribution. However,
- the most up to date [4]installation instructions and [5]build/test
- status are on the web pages. We will update those pages as new
- information becomes available.
-
- The GCC developers would like to thank the numerous people that have
- contributed new features, test results, bugfixes, etc to GCC. This
- [6]amazing group of volunteers is what makes GCC successful.
-
- And finally, we can't in good conscience fail to mention some
- [7]caveats to using GCC 2.95.1.
-
- Download GCC 2.95.1 from the [8]GNU FTP server (ftp://ftp.gnu.org)
- Download GCC 2.95.1 from the [9]GCC/EGCS FTP server
- (ftp://go.cygnus.com)
- [10]Find a GNU mirror site
- [11]Find a GCC/EGCS mirror site
-
- For additional information about GCC please see the [12]GCC project
- web server or contact the [13]GCC development mailing list.
- _________________________________________________________________
-
-
- [14]The GCC team
- Last modified 2001-02-12
-
-References
-
- 1. http://gcc.gnu.org/gcc-2.95/regress.html
- 2. http://gcc.gnu.org/gcc-2.95/othertest.html
- 3. http://gcc.gnu.org/gcc-2.95/features.html
- 4. http://gcc.gnu.org/install/index.html
- 5. http://gcc.gnu.org/gcc-2.95/buildstat.html
- 6. http://gcc.gnu.org/thanks.html
- 7. http://gcc.gnu.org/gcc-2.95/caveats.html
- 8. ftp://ftp.gnu.org/pub/gnu/gcc/
- 9. ftp://go.cygnus.com/pub/sourceware.cygnus.com/pub/egcs/releases/index.html
- 10. http://www.gnu.org/order/ftp.html
- 11. http://gcc.gnu.org/mirrors.html
- 12. http://gcc.gnu.org/index.html
- 13. mailto:gcc@gcc.gnu.org
- 14. http://gcc.gnu.org/about.html
-======================================================================
-http://gcc.gnu.org/gcc-2.95/gcc-2.95.html
-
- GCC 2.95
-
- July 31, 1999
-
- The GNU project and the GCC/EGCS developers are pleased to announce
- the release of GCC version 2.95. GCC used to stand for the GNU C
- Compiler, but since the compiler supports several other languages
- aside from C, it now stands for the GNU Compiler Collection.
-
- This is the first release of GCC since the April 1999 GCC/EGCS
- reunification and includes nearly a year's worth of new development
- and bugfixes.
-
- The whole suite has been extensively [1]regression tested and
- [2]package tested. It should be reliable and suitable for widespread
- use.
-
- The compiler has several new optimizations, new targets, new languages
- and other new features. See the [3]new features page for a more
- complete list of new features found in the GCC 2.95 releases.
-
- The sources include installation instructions in both HTML and
- plaintext forms in the install directory in the distribution. However,
- the most up to date [4]installation instructions and [5]build/test
- status are on the web pages. We will update those pages as new
- information becomes available.
-
- The GCC developers would like to thank the numerous people that have
- contributed new features, test results, bugfixes, etc to GCC. This
- [6]amazing group of volunteers is what makes GCC successful.
-
- And finally, we can't in good conscience fail to mention some
- [7]caveats to using GCC 2.95.
-
- Download GCC 2.95 from the [8]GNU FTP server (ftp://ftp.gnu.org)
- Download GCC 2.95 from the [9]GCC/EGCS FTP server
- (ftp://go.cygnus.com)
- [10]Find a GNU mirror site
- [11]Find a GCC/EGCS mirror site
-
- For additional information about GCC please see the [12]GCC project
- web server or contact the [13]GCC development mailing list.
- _________________________________________________________________
-
-
- [14]The GCC team
- Last modified 2001-02-12
-
-References
-
- 1. http://gcc.gnu.org/gcc-2.95/regress.html
- 2. http://gcc.gnu.org/gcc-2.95/othertest.html
- 3. http://gcc.gnu.org/gcc-2.95/features.html
- 4. http://gcc.gnu.org/install/index.html
- 5. http://gcc.gnu.org/gcc-2.95/buildstat.html
- 6. http://gcc.gnu.org/thanks.html
- 7. http://gcc.gnu.org/gcc-2.95/caveats.html
- 8. ftp://ftp.gnu.org/pub/gnu/gcc/
- 9. ftp://go.cygnus.com/pub/sourceware.cygnus.com/pub/egcs/releases/index.html
- 10. http://www.gnu.org/order/ftp.html
- 11. http://gcc.gnu.org/mirrors.html
- 12. http://gcc.gnu.org/index.html
- 13. mailto:gcc@gcc.gnu.org
- 14. http://gcc.gnu.org/about.html
-======================================================================
-http://gcc.gnu.org/gcc-2.95/features.html
-
- GCC 2.95 New Features
-
- * General Optimizer Improvements:
- + [1]Localized register spilling to improve speed and code
- density especially on small register class machines.
- + [2]Global CSE using lazy code motion algorithms.
- + [3]Improved global constant/copy propagation.
- + [4]Improved control flow graph analysis and manipulation.
- + [5]Local dead store elimination.
- + [6]Memory Load hoisting/store sinking in loops.
- + [7]Type based alias analysis is enabled by default. Note this
- feature will expose bugs in the Linux kernel. Please refer to
- the [8]FAQ for additional information on this issue.
- + Major revamp of GIV detection, combination and simplification
- to improve loop performance.
- + Major improvements to register allocation and reloading.
- * New Languages and Language specific improvements
- + [9]Many C++ improvements.
- + [10]Many Fortran improvements.
- + [11]Java front-end has been integrated. A [12]runtime library
- is available separately.
- + [13]ISO C99 support
- + [14]Chill front-end and runtime has been integrated.
- + Boehm garbage collector support in libobjc.
- + More support for various pragmas which appear in vendor
- include files
- * New Targets and Target Specific Improvements
- + [15]Sparc backend rewrite.
- + -mschedule=8000 will optimize code for PA8000 class
- processors; -mpa-risc-2-0 will generate code for PA2.0
- processors
- + Various micro-optimizations for the ia32 port. K6
- optimizations
- + Compiler will attempt to align doubles in the stack on the
- ia32 port
- + Alpha EV6 support
- + PowerPC 750
- + RS6000/PowerPC: -mcpu=401 was added as an alias for
- -mcpu=403. -mcpu=e603e was added to do -mcpu=603e and
- -msoft-float.
- + c3x, c4x
- + HyperSparc
- + SparcLite86x
- + sh4
- + Support for new systems (OpenBSD, FreeBSD, UWIN, Interix,
- arm-linux)
- + vxWorks targets include support for vxWorks threads
- + StrongARM 110 and ARM9 support added. ARM Scheduling
- parameters rewritten.
- + Various changes to the MIPS port to avoid assembler macros,
- which
- + Various performance improvements to the i960 port.
- + Major rewrite of ns32k port in turn improves performance
- * Other significant improvements
- + [16]Ability to dump cfg information and display it using vcg.
- + The new faster scheme for fixing vendor header files is
- enabled by default.
- + Experimental internationalization support.
- + multibyte character support
- + Some compile-time speedups for pathological problems
- + Better support for complex types
- * Plus the usual mountain of bugfixes
- * Core compiler is based on the gcc2 development tree from Sept 30,
- 1998, so we have all of the [17]features found in GCC 2.8.
- _________________________________________________________________
-
-
- [18]The GCC team
- Last modified 2001-02-12
-
-References
-
- 1. http://gcc.gnu.org/news/spill.html
- 2. http://gcc.gnu.org/news/lcm.html
- 3. http://gcc.gnu.org/news/cprop.html
- 4. http://gcc.gnu.org/news/cfg.html
- 5. http://gcc.gnu.org/news/dse.html
- 6. http://gcc.gnu.org/news/hoist.html
- 7. http://gcc.gnu.org/news/alias.html
- 8. http://gcc.gnu.org/fom_serv/cache/24.html
- 9. http://gcc.gnu.org/gcc-2.95/c++features.html
- 10. http://gcc.gnu.org/onlinedocs/g77_news.html
- 11. http://sources.redhat.com/java/gcj-announce.txt
- 12. http://gcc.gnu.org/javaannounce.html
- 13. http://gcc.gnu.org/c99status.html
- 14. http://gcc.gnu.org/news/chill.html
- 15. http://gcc.gnu.org/news/sparc.html
- 16. http://gcc.gnu.org/news/egcs-vcg.html
- 17. http://gcc.gnu.org/egcs-1.0/features-2.8.html
- 18. http://gcc.gnu.org/about.html
-======================================================================
-http://gcc.gnu.org/gcc-2.95/caveats.html
-
- GCC 2.95 Caveats
-
- * GCC 2.95 will issue an error for invalid asm statements that had
- been silently accepted by earlier versions of the compiler. This
- is particularly noticeable when compiling older versions of the
- Linux kernel (2.0.xx). Please refer to the [1]FAQ for more
- information on this issue.
- * GCC 2.95 implements type based alias analysis to disambiguate
- memory references. Some programs, particularly the Linux kernel
- violate ANSI/ISO aliasing rules and therefore may not operate
- correctly when compiled with GCC 2.95. Please refer to the [2]FAQ
- for more information on this issue.
- * GCC 2.95 has a known bug in its handling of complex variables for
- 64bit targets. Instead of silently generating incorrect code, GCC
- 2.95 will issue a fatal error for situations it can not handle.
- This primarily affects the Fortran community as Fortran makes more
- use of complex variables than C or C++.
- * GCC 2.95 has an integrated libstdc++, but does not have an
- integrated libg++. Furthermore old libg++ releases will not work
- with GCC 2.95. You can retrieve a recent copy of libg++ from the
- [3]GCC ftp server.
- Note most C++ programs only need libstdc++.
- * Exception handling may not work with shared libraries,
- particularly on alphas, hppas, rs6000/powerpc and mips based
- platforms. Exception handling is known to work on x86 GNU/Linux
- platforms with shared libraries.
- * In general, GCC 2.95 is more rigorous about rejecting invalid C++
- code or deprecated C++ constructs than G++ 2.7, G++ 2.8, EGCS 1.0,
- or EGCS 1.1. As a result it may be necessary to fix C++ code
- before it will compile with GCC 2.95.
- * G++ is also converting toward the ISO C++ standard; as a result
- code which was previously valid (and thus accepted by other
- compilers and older versions of g++) may no longer be accepted.
- The flag -fpermissive may allow some non-conforming code to
- compile with GCC 2.95.
- * GCC 2.95 compiled C++ code is not binary compatible with EGCS
- 1.1.x, EGCS 1.0.x or GCC 2.8.x.
- * GCC 2.95 does not have changes from the GCC 2.8 tree that were
- made between Sept 30, 1998 and April 30, 1999 (the official end of
- the GCC 2.8 project). Future GCC releases will include all the
- changes from the defunct GCC 2.8 sources.
- _________________________________________________________________
-
-
- [4]The GCC team
- Last modified 2001-02-12
-
-References
-
- 1. http://gcc.gnu.org/faq.html#asmclobber
- 2. http://gcc.gnu.org/fom_serv/cache/24.html
- 3. ftp://gcc.gnu.org/pub/gcc/infrastructure/libg++-2.8.1.3.tar.gz
- 4. http://gcc.gnu.org/about.html
-======================================================================
-http://gcc.gnu.org/egcs-1.1/egcs-1.1.2.html
-
- EGCS 1.1.2
-
- March 15, 1999
-
- We are pleased to announce the release of EGCS 1.1.2.
-
- EGCS is a collaborative effort involving several groups of hackers
- using an open development model to accelerate development and testing
- of GNU compilers and runtime libraries.
-
- EGCS 1.1.2 is a minor update to the EGCS 1.1.1 compiler to fix several
- serious problems in EGCS 1.1.1.
- * General improvements and fixes
- + Fix bug in loop optimizer which caused the SPARC (and
- potentially other) ports to segfault.
- + Fix infinite recursion in alias analysis and combiner code.
- + Fix bug in regclass preferencing.
- + Fix incorrect loop reversal which caused incorrect code to be
- generated for several targets.
- + Fix return value for builtin memcpy.
- + Reduce compile time for certain loops which exposed quadratic
- behavior in the loop optimizer.
- + Fix bug which caused volatile memory to be written multiple
- times when only one write was needed/desired.
- + Fix compiler abort in caller-save.c
- + Fix combiner bug which caused incorrect code generation for
- certain division by constant operations.
- + Fix incorrect code generation due to a bug in range check
- optimizations.
- + Fix incorrect code generation due to mis-handling of
- clobbered values in CSE.
- + Fix compiler abort/segfault due to incorrect register
- splitting when unrolling loops.
- + Fix code generation involving autoincremented addresses with
- ternary operators.
- + Work around bug in the scheduler which caused qt to be
- mis-compiled on some platforms.
- + Fix code generation problems with -fshort-enums.
- + Tighten security for temporary files.
- + Improve compile time for codes which make heavy use of
- overloaded functions.
- + Fix multiply defined constructor/destructor symbol problems.
- + Avoid setting bogus RPATH environemnt variable during
- bootstrap.
- + Avoid GNU-make dependencies in the texinfo subdir.
- + Install CPP wrapper script in $(prefix)/bin if --enable-cpp.
- --enable-cpp= can be used to specify an additional install
- directory for the cpp wrapper script.
- + Fix CSE bug which caused incorrect label-label refs to appear
- on some platforms.
- + Avoid linking in EH routines from libgcc if they are not
- needed.
- + Avoid obscure bug in aliasing code.
- + Fix bug in weak symbol handling.
- * Platform-specific improvements and fixes
- + Fix detection of PPro/PII on Unixware 7.
- + Fix compiler segfault when building spec99 and other programs
- for SPARC targets.
- + Fix code-generation bugs for integer and floating point
- conditional move instructions on the PPro/PII.
- + Use fixincludes to fix byteorder problems on i?86-*-sysv.
- + Fix build failure for the arc port.
- + Fix floating point format configuration for i?86-gnu port
- + Fix problems with hppa1.0-hp-hpux10.20 configuration when
- threads are enabled
- + Fix coldfire code generation bugs.
- + Fix "unrecognized insn" problems for Alpha and PPC ports.
- + Fix h8/300 code generation problem with floating point values
- in memory.
- + Fix unrecognized insn problems for the m68k port.
- + Fix namespace-pollution problem for the x86 port.
- + Fix problems with old assembler on x86 NeXT systems.
- + Fix PIC code-generation problems for the SPARC port.
- + Fix minor bug with LONG_CALLS in PowerPC SVR4 support.
- + Fix minor ISO namespace violation in Alpha varargs/stdarg
- support.
- + Fix incorrect "braf" instruction usage for the SH port.
- + Fix minor bug in va-sh which prevented its use with -ansi.
- + Fix problems recognizing and supporting FreeBSD.
- + Handle OpenBSD systems correctly.
- + Minor fixincludes fix for Digital UNIX 4.0B.
- + Fix problems with ctors/dtors in SCO shared libraries.
- + Abort instead of generating incorrect code for PPro/PII
- floating point conditional moves.
- + Avoid multiply defined symbols on Linux/GNU systems using
- libc-5.4.xx.
- + Fix abort in alpha compiler.
-
- Fortran-specific fixes
- * Fix the IDate intrinsic (VXT) (in libg2c) so the returned year is
- in the documented, non-Y2K-compliant range of 0-99, instead of
- being returned as 100 in the year 2000.
- * Fix the `Date_and_Time' intrinsic (in libg2c) to return the
- milliseconds value properly in Values(8).
- * Fix the `LStat' intrinsic (in libg2c) to return device-ID
- information properly in SArray(7).
-
- An important goal of EGCS is to allow wide scale testing of new
- features and optimizations which are still under development. However,
- EGCS has been carefully tested and should be comparable in quality to
- most gcc releases.
-
- EGCS 1.1.2 is based on the June 6, 1998 snapshot of the GCC 2.8
- development sources; it contains all of the new features found in GCC
- 2.8.1 as well as all new development from gcc2 up to June 6, 1998.
-
- See the [1]new features page for a more complete list of new features
- found in EGCS 1.1 releases.
-
- The EGCS 1.1.2 release includes installation instructions in both HTML
- and plaintext forms (see the INSTALL directory in the toplevel
- directory of the EGCS 1.1.2 distribution). However, we also keep the
- most up to date [2]installation instructions and [3]build/test status
- on our web page. We will update those pages as new information becomes
- available.
-
- The EGCS project would like to thank the numerous people that have
- contributed new features, test results, bugfixes, etc. This [4]amazing
- group of volunteers is what makes EGCS successful.
-
- And finally, we can't in good conscience fail to mention some
- [5]caveats to using EGCS 1.1.2. [6]Download EGCS 1.1.2 from
- egcs.cygnus.com (USA California) -->
-
- [7]Download EGCS 1.1.2 from go.cygnus.com (USA California - High speed
- link provided by Stanford)
-
- The EGCS 1.1.2 release is also available on many [8]mirror sites.
- _________________________________________________________________
-
- Last modified on July 28, 1999.
-
-References
-
- 1. http://gcc.gnu.org/egcs-1.1/features.html
- 2. http://gcc.gnu.org/install/index.html
- 3. http://gcc.gnu.org/egcs-1.1/buildstat.html
- 4. http://gcc.gnu.org/thanks.html
- 5. http://gcc.gnu.org/egcs-1.1/caveats.html
- 6. ftp://egcs.cygnus.com/pub/egcs/releases/index.html
- 7. ftp://go.cygnus.com/pub/sourceware.cygnus.com/pub/egcs/releases/index.html
- 8. http://gcc.gnu.org/mirrors.html
-======================================================================
-http://gcc.gnu.org/egcs-1.1/egcs-1.1.1.html
-
- EGCS 1.1.1
-
- December 1, 1998
-
- We are pleased to announce the release of EGCS 1.1.1.
-
- EGCS is a collaborative effort involving several groups of hackers
- using an open development model to accelerate development and testing
- of GNU compilers and runtime libraries.
-
- EGCS 1.1.1 is a minor update to the EGCS 1.1 compiler to fix several
- serious problems in EGCS 1.1.
- * General improvements and fixes
- + Avoid some stack overflows when compiling large functions.
- + Avoid incorrect loop invariant code motions.
- + Fix some core dumps on Linux kernel code.
- + Bring back the imake -Di386 and friends fix from EGCS 1.0.2.
- + Fix code generation problem in gcse.
- + Various documentation related fixes.
- * g++/libstdc++ improvements and fixes
- + MT safe EH fix for setjmp/longjmp based exception handling.
- + Fix a few bad interactions between optimization and exception
- handling.
- + Fixes for demangling of template names starting with "__".
- + Fix a bug that would fail to run destructors in some cases
- with -O2.
- + Fix 'new' of classes with virtual bases.
- + Fix crash building Qt on the Alpha.
- + Fix failure compiling WIFEXITED macro on GNU/Linux.
- + Fix some -frepo failures.
- * g77 and libf2c improvements and fixes
- + Various documentation fixes.
- + Avoid compiler crash on RAND intrinsic.
- + Fix minor bugs in makefiles exposed by BSD make programs.
- + Define _XOPEN_SOURCE for libI77 build to avoid potential
- problems on some 64-bit systems.
- + Fix problem with implicit endfile on rewind.
- + Fix spurious recursive I/O errors.
- * platform specific improvements and fixes
- + Match all versions of UnixWare7.
- + Do not assume x86 SVR4 or UnixWare targets can handle stabs
- + Fix PPC/RS6000 LEGITIMIZE_ADDRESS macro and bug in conversion
- from unsigned ints to double precision floats.
- + Fix ARM ABI issue with NetBSD.
- + Fix a few arm code generation bugs.
- + Fixincludes will fix additional broken SCO OpenServer header
- files.
- + Fix a m68k backend bug which caused invalid offsets in reg+d
- addresses.
- + Fix problems with 64bit AIX 4.3 support.
- + Fix handling of long longs for varargs/stdarg functions on
- the ppc.
- + Minor fixes to CPP predefines for Windows.
- + Fix code generation problems with gpr<->fpr copies for 64bit
- ppc
- + Fix a few coldfire code generation bugs.
- + Fix some more header file problems on SunOS 4.x
- + Fix assert.h handling for RTEMS.
- + Fix Windows handling of TREE_SYMBOL_REFERENCED.
- + Fix x86 compiler abort in reg-stack pass.
- + Fix cygwin/windows problem with section attributes.
- + Fix Alpha code generation problem exposed by SMP Linux
- kernels.
- + Fix typo in m68k 32->64bit integer conversion.
- + Make sure target libraries build with -fPIC for PPC & Alpha
- targets.
-
- An important goal of EGCS is to allow wide scale testing of new
- features and optimizations which are still under development. However,
- EGCS has been carefully tested and should be comparable in quality to
- most gcc releases.
-
- EGCS 1.1.1 is based on the June 6, 1998 snapshot of the GCC 2.8
- development sources; it contains all of the new features found in GCC
- 2.8.1 as well as all new development from gcc2 up to June 6, 1998.
-
- See the [1]new features page for a more complete list of new features
- found in EGCS 1.1 releases.
-
- The EGCS 1.1.1 release includes installation instructions in both HTML
- and plaintext forms (see the INSTALL directory in the toplevel
- directory of the EGCS 1.1.1 distribution). However, we also keep the
- most up to date [2]installation instructions and [3]build/test status
- on our web page. We will update those pages as new information becomes
- available.
-
- The EGCS project would like to thank the numerous people that have
- contributed new features, test results, bugfixes, etc. This [4]amazing
- group of volunteers is what makes EGCS successful.
-
- And finally, we can't in good conscience fail to mention some
- [5]caveats to using EGCS 1.1.1.
-
- [6]Download EGCS 1.1.1 from egcs.cygnus.com (USA California)
-
- The EGCS 1.1.1 release is also available on many mirror sites.
- [7]Goto mirror list to find a closer site
- _________________________________________________________________
-
- Last modified on July 28, 1999.
-
-References
-
- 1. http://gcc.gnu.org/egcs-1.1/features.html
- 2. http://gcc.gnu.org/install/index.html
- 3. http://gcc.gnu.org/egcs-1.1/buildstat.html
- 4. http://gcc.gnu.org/thanks.html
- 5. http://gcc.gnu.org/egcs-1.1/caveats.html
- 6. ftp://egcs.cygnus.com/pub/egcs/releases/index.html
- 7. http://gcc.gnu.org/mirrors.html
-======================================================================
-http://gcc.gnu.org/egcs-1.1/egcs-1.1.html
-
- EGCS 1.1
-
- September 3, 1998
-
- We are pleased to announce the release of EGCS 1.1.
-
- EGCS is a free software project to further the development of the GNU
- compilers using an open development environment.
-
- EGCS 1.1 is a major new release of the EGCS compiler system. It has
- been [1]extensively tested and is believed to be stable and suitable
- for widespread use.
-
- EGCS 1.1 is based on an June 6, 1998 snapshot of the GCC 2.8
- development sources; it contains all of the new features found in GCC
- 2.8.1 as well as all new development from GCC up to June 6, 1998.
-
- EGCS also contains many improvements and features not found in GCC or
- in older versions of EGCS.
- * Global common subexpression elimination and global constant/copy
- propagation (aka [2]gcse)
- * Ongoing improvements to the [3]alias analysis support to allow for
- better optimizations throughout the compiler.
- * Vastly improved [4]C++ compiler and integrated C++ runtime
- libraries.
- * Fixes for the /tmp symlink race security problems.
- * New targets including mips16, arm-thumb and 64 bit PowerPC.
- * Improvements to GNU Fortran (g77) compiler and runtime library
- made since [5]g77 version 0.5.23.
-
- See the [6]new features page for a more complete list of new features
- found in EGCS 1.1 releases.
-
- The EGCS 1.1 release includes installation instructions in both HTML
- and plaintext forms (see the INSTALL directory in the toplevel
- directory of the EGCS 1.1 distribution). However, we also keep the
- most up to date [7]installation instructions and [8]build/test status
- on our web page. We will update those pages as new information becomes
- available.
-
- The EGCS project would like to thank the numerous people that have
- contributed new features, test results, bugfixes, etc. This [9]amazing
- group of volunteers is what makes EGCS successful.
-
- And finally, we can't in good conscience fail to mention some
- [10]caveats to using EGCS 1.1.
-
- [11]Download EGCS 1.1 from egcs.cygnus.com (USA California)
-
- [12]Download EGCS 1.1 from go.cygnus.com (USA California -- High speed
- link provided by Stanford)
-
- The EGCS 1.1 release is also available on many mirror sites.
- [13]Goto mirror list to find a closer site
- _________________________________________________________________
-
- Last modified on September 4, 1999.
-
-References
-
- 1. http://gcc.gnu.org/egcs-1.1/egcs-1.1-test.html
- 2. http://gcc.gnu.org/news/gcse.html
- 3. http://gcc.gnu.org/news/alias.html
- 4. http://gcc.gnu.org/egcs-1.1/c++features.html
- 5. http://gcc.gnu.org/onlinedocs/g77_news.html
- 6. http://gcc.gnu.org/egcs-1.1/features.html
- 7. http://gcc.gnu.org/install/index.html
- 8. http://gcc.gnu.org/egcs-1.1/buildstat.html
- 9. http://gcc.gnu.org/thanks.html
- 10. http://gcc.gnu.org/egcs-1.1/caveats.html
- 11. ftp://egcs.cygnus.com/pub/egcs/releases/index.html
- 12. ftp://go.cygnus.com/pub/sourceware.cygnus.com/pub/egcs/releases/index.html
- 13. http://gcc.gnu.org/mirrors.html
-======================================================================
-http://gcc.gnu.org/egcs-1.1/features.html
-
- EGCS 1.1 new features
-
- * Integrated GNU Fortran (g77) compiler and runtime library with
- improvements, based on [1]g77 version 0.5.23.
- * Vast improvements in the C++ compiler; so many they have [2]page
- of their own!
- * Compiler implements [3]global common subexpression elimination and
- global copy/constant propagation.
- * More major improvements in the [4]alias analysis code.
- * More major improvements in the exception handling code to improve
- performance, lower static overhead and provide the infrastructure
- for future improvements.
- * The infamous /tmp symlink race security problems have been fixed.
- * The regmove optimization pass has been nearly completely rewritten
- to improve performance of generated code.
- * The compiler now recomputes register usage information before
- local register allocation. By providing more accurate information
- to the priority based allocator, we get better register
- allocation.
- * The register reloading phase of the compiler optimizes spill code
- much better than in previous releases.
- * Some bad interactions between the register allocator and
- instruction scheduler have been fixed, resulting in much better
- code for certain programs. Additionally, we have tuned the
- scheduler in various ways to improve performance of generated code
- for some architectures.
- * The compiler's branch shortening algorithms have been
- significantly improved to work better on targets which align jump
- targets.
- * The compiler now supports -Os to prefer optimizing for code space
- over optimizing for code speed.
- * The compiler will now totally eliminate library calls which
- compute constant values. This primarily helps targets with no
- integer div/mul support and targets without floating point
- support.
- * The compiler now supports an extensive "--help" option.
- * cpplib has been greatly improved and may be suitable for limited
- use.
- * Memory footprint for the compiler has been significantly reduced
- for some pathological cases.
- * The time to build EGCS has been improved for certain targets
- (particularly the alpha and mips platforms).
- * Many infrastructure improvements throughout the compiler, plus the
- usual mountain of bugfixes and minor improvements.
- * Target dependent improvements:
- + SPARC port now includes V8 plus and V9 support as well as
- performance tuning for Ultra class machines. The SPARC port
- now uses the Haifa scheduler.
- + Alpha port has been tuned for the EV6 processor and has an
- optimized expansion of memcpy/bzero. The Alpha port now uses
- the Haifa scheduler.
- + RS6000/PowerPC: EGCS 1.1 includes support for the Power64
- architecture and aix4.3 support. The RS6000/PowerPC port now
- uses the Haifa scheduler.
- + x86: Alignment of static store data and jump targets is per
- Intel recommendations now. Various improvements throughout
- the x86 port to improve performance on Pentium processors.
- Conditional move support has been fixed and enabled for PPro
- processors. The x86 port also better supports 64bit
- operations now.
- + MIPS has improved multiply/multiply-add support and now
- includes mips16 ISA support.
- + M68k has many micro-optimizations and Coldfire fixes.
- * Core compiler is based on the GCC development tree from June 9,
- 1998, so we have all of the [5]features found in GCC 2.8.
-
- [6]Return to the EGCS home page
-
- Last modified: September 4, 1999
-
-References
-
- 1. http://gcc.gnu.org/onlinedocs/g77_news.html
- 2. http://gcc.gnu.org/egcs-1.1/c++features.html
- 3. http://gcc.gnu.org/news/gcse.html
- 4. http://gcc.gnu.org/news/alias.html
- 5. http://gcc.gnu.org/egcs-1.0/features-2.8.html
- 6. http://gcc.gnu.org/index.html
-======================================================================
-http://gcc.gnu.org/egcs-1.1/caveats.html
-
- EGCS 1.1 Caveats
-
- * EGCS has an integrated libstdc++, but does not have an integrated
- libg++. Furthermore old libg++ releases will not work with EGCS;
- HJ Lu has made a [1]libg++ snapshot available which may work with
- EGCS.
- Note most C++ programs only need libstdc++.
- * Exception handling may not work with shared libraries,
- particularly on alphas, hppas, rs6000/powerpc and mips based
- platforms. Exception handling is known to work on x86-linux
- platforms with shared libraries.
- * Some versions of the Linux kernel have bugs which prevent them
- from being compiled or from running when compiled by EGCS. See
- [2]the FAQ for additional information.
- * In general, EGCS is more rigorous about rejecting invalid C++ code
- or deprecated C++ constructs than g++-2.7, g++-2.8 or EGCS 1.0. As
- a result it may be necessary to fix C++ code before it will
- compile with EGCS.
- * G++ is also converting toward the ISO C++ standard; as a result
- code which was previously valid (and thus accepted by other
- compilers and older versions of g++) may no longer be accepted.
- * EGCS 1.1 compiled C++ code is not binary compatible with EGCS
- 1.0.x or GCC 2.8.x due to changes necessary to support thread safe
- exception handling.
-
- [3]Return to the GCC home page
-
- Last modified: July 28, 1999
-
-References
-
- 1. ftp://ftp.yggdrasil.com/private/hjl/libg++-2.8.1.2.tar.gz
- 2. http://gcc.gnu.org/fom_serv/cache/24.html
- 3. http://gcc.gnu.org/index.html
-======================================================================
-http://gcc.gnu.org/egcs-1.0/egcs-1.0.3.html
-
- EGCS 1.0.3
-
- May 15, 1998
-
- We are pleased to announce the release of EGCS 1.0.3.
-
- EGCS is a collaborative effort involving several groups of hackers
- using an open development model to accelerate development and testing
- of GNU compilers and runtime libraries.
-
- EGCS 1.0.3 is a minor update to the EGCS 1.0.2 compiler to fix a few
- problems reported by Red Hat for builds of Red Hat 5.1.
- * Generic bugfixes:
- + Fix a typo in the libio library which resulted in incorrect
- behavior of istream::get.
- + Fix the Fortran negative array index problem.
- + Fix a major problem with the ObjC runtime thread support
- exposed by glibc2.
- + Reduce memory consumption of the Haifa scheduler.
- * Target specific bugfixes:
- + Fix one x86 floating point code generation bug exposed by
- glibc2 builds.
- + Fix one x86 internal compiler error exposed by glibc2 builds.
- + Fix profiling bugs on the Alpha.
- + Fix ImageMagick & emacs 20.2 build problems on the Alpha.
- + Fix rs6000/ppc bug when converting values from integer types
- to floating point types.
-
- An important goal of EGCS is to allow wide scale testing of new
- features and optimizations which are still under development. However,
- EGCS has been carefully tested and should be comparable in quality to
- most GCC releases.
-
- EGCS 1.0.3 is based on an August 2, 1997 snapshot of the GCC 2.8
- development sources; it contains nearly all of the new features found
- in GCC 2.8.
-
- EGCS also contains many improvements and features not found in GCC 2.7
- or GCC 2.8.
- * Integrated C++ runtime libraries, including support for most major
- GNU/Linux systems!
- * The integrated libstdc++ library includes a verbatim copy of
- [1]SGI's STL release instead of a modified copy.
- * Integrated GNU Fortran compiler
- * New instruction scheduler
- * New alias analysis code
-
- See the [2]new features page for a more complete list of new features
- found in EGCS 1.0.x releases.
-
- The EGCS 1.0.3 release includes installation instructions in both HTML
- and plaintext forms (see the INSTALL directory in the toplevel
- directory of the EGCS 1.0.3 distribution). However, we also keep the
- most up to date [3]installation instructions and [4]build/test status
- on our web page. We will update those pages as new information becomes
- available.
-
- And, we can't in good conscience fail to mention some [5]caveats to
- using EGCS.
-
- Update: Big thanks to Stanford for providing a high speed link for
- downloading EGCS (go.cygnus.com)!
-
- [6]Download EGCS 1.0.3 from ftp.cygnus.com (USA California)
-
- [7]Download EGCS 1.0.3 from go.cygnus.com (USA California -- High
- speed link provided by Stanford)
-
- The EGCS 1.0.3 release is also available on many mirror sites.
- [8]Goto mirror list to find a closer site
-
- We'd like to thank the numerous people that have contributed new
- features, test results, bugfixes, etc. Unfortunately, they're far too
- numerous to mention by name.
- _________________________________________________________________
-
- Last modified on February 22, 1999.
-
-References
-
- 1. http://www.sgi.com/Technology/STL
- 2. http://gcc.gnu.org/egcs-1.0/features.html
- 3. http://gcc.gnu.org/install/index.html
- 4. http://gcc.gnu.org/egcs-1.0/buildstat.html
- 5. http://gcc.gnu.org/egcs-1.0/caveats.html
- 6. ftp://egcs.cygnus.com/pub/egcs/releases/index.html
- 7. ftp://go.cygnus.com/pub/sourceware.cygnus.com/pub/egcs/releases/index.html
- 8. http://gcc.gnu.org/mirrors.html
-======================================================================
-http://gcc.gnu.org/egcs-1.0/egcs-1.0.2.html
-
- EGCS 1.0.2
-
- March 16, 1998
-
- We are pleased to announce the release of EGCS 1.0.2.
-
- EGCS is a collaborative effort involving several groups of hackers
- using an open development model to accelerate development and testing
- of GNU compilers and runtime libraries.
-
- EGCS 1.0.2 is a minor update to the EGCS 1.0.1 compiler to fix several
- serious problems in EGCS 1.0.1.
- * General improvements and fixes
- + Memory consumption significantly reduced, especially for
- templates and inline functions.
- + Fix various problems with glibc2.1.
- + Fix loop optimization bug exposed by rs6000/ppc port.
- + Fix to avoid potential code generation problems in jump.c.
- + Fix some undefined symbol problems in dwarf1 debug support.
- * g++/libstdc++ improvements and fixes
- + libstdc++ in the EGCS release has been updated and should be
- link compatible with libstdc++-2.8.
- + Various fixes in libio/libstdc++ to work better on Linux
- systems.
- + Fix problems with duplicate symbols on systems that do not
- support weak symbols.
- + Memory corruption bug and undefined symbols in bastring have
- been fixed.
- + Various exception handling fixes.
- + Fix compiler abort for very long thunk names.
- * g77 improvements and fixes
- + Fix compiler crash for omitted bound in Fortran CASE
- statement.
- + Add missing entries to g77 lang-options.
- + Fix problem with -fpedantic in the g77 compiler.
- + Fix "backspace" problem with g77 on alphas.
- + Fix x86 backend problem with Fortran literals and -fpic.
- + Fix some of the problems with negative subscripts for g77 on
- alphas.
- + Fixes for Fortran builds on cygwin32/mingw32.
- * platform specific improvements and fixes
- + Fix long double problems on x86 (exposed by glibc)
- + x86 ports define i386 again to keep imake happy.
- + Fix exception handling support on NetBSD ports.
- + Several changes to collect2 to fix many problems with AIX.
- + Define __ELF__ for rs6000/linux.
- + Fix -mcall-linux problem on rs6000/linux.
- + Fix stdarg/vararg problem for rs6000/linux.
- + Allow autoconf to select a proper install problem on AIX 3.1.
- + m68k port support includes -mcpu32 option as well as cpu32
- multilibs.
- + Fix stdarg bug for irix6.
- + Allow EGCS to build on irix5 without the gnu assembler.
- + Fix problem with static linking on sco5.
- + Fix bootstrap on sco5 with native compiler.
- + Fix for abort building newlib on H8 target.
- + Fix fixincludes handling of math.h on SunOS.
- + Minor fix for motorola 3300 m68k systems.
-
- An important goal of EGCS is to allow wide scale testing of new
- features and optimizations which are still under development. However,
- EGCS has been carefully tested and should be comparable in quality to
- most GCC releases.
-
- EGCS 1.0.2 is based on an August 2, 1997 snapshot of the GCC 2.8
- development sources; it contains nearly all of the new features found
- in GCC 2.8.
-
- EGCS also contains many improvements and features not found in GCC 2.7
- or GCC 2.8.
- * Integrated C++ runtime libraries, including support for most major
- linux systems!
- * The integrated libstdc++ library includes a verbatim copy of
- [1]SGI's STL release.
- * Integrated GNU Fortran compiler
- * New instruction scheduler
- * New alias analysis code
-
- See the [2]new features page for a more complete list of new features
- found in EGCS 1.0.x releases.
-
- The EGCS 1.0.2 release includes installation instructions in both HTML
- and plaintext forms (see the INSTALL directory in the toplevel
- directory of the EGCS 1.0.2 distribution). However, we also keep the
- most up to date [3]installation instructions and [4]build/test status
- on our web page. We will update those pages as new information becomes
- available.
-
- And, we can't in good conscience fail to mention some [5]caveats to
- using EGCS.
-
- Update: Big thanks to Stanford for providing a high speed link for
- downloading EGCS (go.cygnus.com)!
-
- [6]Download EGCS 1.0.2 from ftp.cygnus.com (USA California)
-
- [7]Download EGCS 1.0.2 from go.cygnus.com (USA California -- High
- speed link provided by Stanford)
-
- The EGCS 1.0.2 release is also available on many mirror sites.
- [8]Goto mirror list to find a closer site
-
- We'd like to thank the numerous people that have contributed new
- features, test results, bugfixes, etc. Unfortunately, they're far too
- numerous to mention by name.
- _________________________________________________________________
-
- Last modified on July 28, 1999.
-
-References
-
- 1. http://www.sgi.com/Technology/STL/
- 2. http://gcc.gnu.org/egcs-1.0/features.html
- 3. http://gcc.gnu.org/install/index.html
- 4. http://gcc.gnu.org/egcs-1.0/buildstat.html
- 5. http://gcc.gnu.org/egcs-1.0/caveats.html
- 6. ftp://egcs.cygnus.com/pub/egcs/releases/index.html
- 7. ftp://go.cygnus.com/pub/sourceware.cygnus.com/pub/egcs/releases/index.html
- 8. http://gcc.gnu.org/mirrors.html
-======================================================================
-http://gcc.gnu.org/egcs-1.0/egcs-1.0.1.html
-
- EGCS 1.0.1
-
- January 6, 1998
-
- We are pleased to announce the release of EGCS 1.0.1.
-
- EGCS is a collaborative effort involving several groups of hackers
- using an open development model to accelerate development and testing
- of GNU compilers and runtime libraries.
-
- EGCS 1.0.1 is a minor update to the EGCS 1.0 compiler to fix a few
- critical bugs and add support for Red Hat 5.0 Linux. Changes since the
- EGCS 1.0 release:
- * Add support for Red Hat 5.0 Linux and better support for Linux
- systems using glibc2.
- Many programs failed to link when compiled with EGCS 1.0 on Red
- Hat 5.0 or on systems with newer versions of glibc2. EGCS 1.0.1
- should fix these problems.
- * Compatability with both EGCS 1.0 and GCC 2.8 libgcc exception
- handling interfaces.
- To avoid future compatibility problems, we strongly urge anyone
- who is planning on distributing shared libraries that contain C++
- code to upgrade to EGCS 1.0.1 first.
- Soon after EGCS 1.0 was released, the GCC developers made some
- incompatible changes in libgcc's exception handling interfaces.
- These changes were needed to solve problems on some platforms.
- This means that GCC 2.8.0, when released, will not be seamlessly
- compatible with shared libraries built by EGCS 1.0. The reason is
- that the libgcc.a in GCC 2.8.0 will not contain a function needed
- by the old interface.
- The result of this is that there may be compatibility problems
- with shared libraries built by EGCS 1.0 when used with GCC 2.8.0.
- With EGCS 1.0.1, generated code uses the new (GCC 2.8.0)
- interface, and libgcc.a has the support routines for both the old
- and the new interfaces (so EGCS 1.0.1 and EGCS 1.0 code can be
- freely mixed, and EGCS 1.0.1 and GCC 2.8.0 code can be freely
- mixed).
- The maintainers of GCC 2.x have decided against including seamless
- support for the old interface in 2.8.0, since it was never
- "official", so to avoid future compatibility problems we recommend
- against distributing any shared libraries built by EGCS 1.0 that
- contain C++ code (upgrade to 1.0.1 and use that).
- * Various bugfixes in the x86, hppa, mips, and rs6000/ppc backends.
- The x86 changes fix code generation errors exposed when building
- glibc2 and the Linux dynamic linker (ld.so).
- The hppa change fixes a compiler abort when configured for use
- with RTEMS.
- The MIPS changes fix problems with the definition of LONG_MAX on
- newer systems, allow for command line selection of the target ABI,
- and fix one code generation problem.
- The rs6000/ppc change fixes some problems with passing structures
- to varargs/stdarg functions.
- * A few machine independent bugfixes, mostly to fix code generation
- errors when building Linux kernels or glibc.
- * Fix a few critical exception handling and template bugs in the C++
- compiler.
- * Fix Fortran namelist bug on alphas.
- * Fix build problems on x86-solaris systems.
-
- An important goal of EGCS is to allow wide scale testing of new
- features and optimizations which are still under development. However,
- EGCS has been carefully tested and should be comparable in quality to
- most GCC releases.
-
- EGCS 1.0.1 is based on an August 2, 1997 snapshot of the GCC 2.8
- development sources; it contains nearly all of the new features found
- in GCC 2.8.
-
- EGCS also contains many improvements and features not found in GCC 2.7
- and even the soon to be released GCC 2.8 compilers.
- * Integrated C++ runtime libraries, including support for most major
- linux systems!
- * The integrated libstdc++ library includes a verbatim copy of
- [1]SGI's STL release.
- * Integrated GNU Fortran compiler
- * New instruction scheduler
- * New alias analysis code
-
- See the [2]new features page for a more complete list of new features
- found in EGCS 1.0.x releases.
-
- The EGCS 1.0.1 release includes installation instructions in both HTML
- and plaintext forms (see the INSTALL directory in the toplevel
- directory of the EGCS 1.0.1 distribution). However, we also keep the
- most up to date [3]installation instructions and [4]build/test status
- on our web page. We will update those pages as new information becomes
- available.
-
- And, we can't in good conscience fail to mention some [5]caveats to
- using EGCS.
-
- Update: Big thanks to Stanford for providing a high speed link for
- downloading EGCS (go.cygnus.com)!
-
- [6]Download EGCS 1.0.1 from ftp.cygnus.com (USA California)
-
- [7]Download EGCS 1.0.1 from go.cygnus.com (USA California -- High
- speed link provided by Stanford)
-
- The EGCS 1.0.1 release is also available on many mirror sites.
- [8]Goto mirror list to find a closer site
-
- We'd like to thank the numerous people that have contributed new
- features, test results, bugfixes, etc. Unfortunately, they're far too
- numerous to mention by name.
- _________________________________________________________________
-
- Last modified on July 28, 1999.
-
-References
-
- 1. http://www.sgi.com/Technology/STL/
- 2. http://gcc.gnu.org/egcs-1.0/features.html
- 3. http://gcc.gnu.org/install/index.html
- 4. http://gcc.gnu.org/egcs-1.0/buildstat.html
- 5. http://gcc.gnu.org/egcs-1.0/caveats.html
- 6. ftp://egcs.cygnus.com/pub/egcs/releases/index.html
- 7. ftp://go.cygnus.com/pub/sourceware.cygnus.com/pub/egcs/releases/index.html
- 8. http://gcc.gnu.org/mirrors.html
-======================================================================
-http://gcc.gnu.org/egcs-1.0/egcs-1.0.html
-
- EGCS 1.0
-
- December 3, 1997
-
- We are pleased to announce the release of EGCS 1.0.
-
- EGCS is a collaborative effort involving several groups of hackers
- using an open development model to accelerate development and testing
- of GNU compilers and runtime libraries.
-
- An important goal of EGCS is to allow wide scale testing of
- experimental features and optimizations; therefore, EGCS contains some
- features and optimizations which are still under development. However,
- EGCS has been carefully tested and should be comparable in quality to
- most GCC releases.
-
- EGCS 1.0 is based on an August 2, 1997 snapshot of the GCC 2.8
- development sources; it contains nearly all of the new features found
- in GCC 2.8.
-
- EGCS 1.0 also contains many improvements and features not found in GCC
- 2.7 and even the soon to be released GCC 2.8 compilers.
- * Integrated C++ runtime libraries, including support for most major
- linux systems!
- * The integrated libstdc++ library includes a verbatim copy of
- [1]SGI's STL release.
- * Integrated GNU Fortran compiler
- * New instruction scheduler
- * New alias analysis code
-
- See the [2]new features page for a more complete list of new features.
-
- The EGCS 1.0 release includes installation instructions in both HTML
- and plaintext forms (see the INSTALL directory in the toplevel
- directory of the EGCS 1.0 distribution). However, we also keep the
- most up to date [3]installation instructions and [4]build/test status
- on our web page. We will update those pages as new information becomes
- available.
-
- And, we can't in good conscience fail to mention some [5]caveats to
- using EGCS.
-
- Update: The T1 into our main California offices has been 100%
- saturated since shortly after the release. We've added an EGCS 1.0
- mirror at our Massachusetts office to help share the load. We also
- encourage folks to use the many mirrors available throughout the
- world.
-
- Update: Big thanks to Stanford for providing a high speed link for
- downloading EGCS! (go.cygnus.com)
-
- [6]Download EGCS 1.0 from ftp.cygnus.com (USA California)
-
- [7]Download EGCS 1.0 from go.cygnus.com (USA California -- High speed
- link provided by Stanford)
-
- The EGCS 1.0 release should be available on most mirror sites by now.
- [8]Goto mirror list to find a closer site
-
- We'd like to thank the numerous people that have contributed new
- features, test results, bugfixes, etc. Unfortunately, they're far too
- numerous to mention by name.
- _________________________________________________________________
-
- Last modified on July 28, 1999.
-
-References
-
- 1. http://www.sgi.com/Technology/STL
- 2. http://gcc.gnu.org/egcs-1.0/features.html
- 3. http://gcc.gnu.org/install/index.html
- 4. http://gcc.gnu.org/egcs-1.0/buildstat.html
- 5. http://gcc.gnu.org/egcs-1.0/caveats.html
- 6. ftp://egcs.cygnus.com/pub/egcs/releases/index.html
- 7. ftp://go.cygnus.com/pub/sourceware.cygnus.com/pub/egcs/releases/index.html
- 8. http://gcc.gnu.org/mirrors.html
-======================================================================
-http://gcc.gnu.org/egcs-1.0/features.html
-
- EGCS 1.0 features
-
- * Core compiler is based on the gcc2 development tree from Aug 2,
- 1997, so we have most of the [1]features found in GCC 2.8.
- * Integrated GNU Fortran compiler based on g77-0.5.22-19970929.
- * Vast improvements in the C++ compiler; so many they have [2]page
- of their own!
- * Integrated C++ runtime libraries, including support for most major
- linux systems!
- * New instruction scheduler from IBM Haifa which includes support
- for function wide instruction scheduling as well as superscalar
- scheduling.
- * Significantly improved alias analysis code.
- * Improved register allocation for two address machines.
- * Significant code generation improvements for Fortran code on
- Alphas
- * Various optimizations from the g77 project as well as improved
- loop optimizations.
- * Dwarf2 debug format support for some targets.
- * egcs libstdc++ includes the SGI STL implementation without
- changes.
- * As a result of these and other changes, egcs libstc++ is not
- binary compatible with previous releases of libstdc++.
- * Various new ports -- UltraSPARC, Irix6.2 & Irix6.3 support, The
- SCO Openserver 5 family (5.0.{0,2,4} and Internet FastStart 1.0
- and 1.1), Support for RTEMS on several embedded targets, Support
- for arm-linux, Mitsubishi M32R, Hitachi H8/S, Matsushita MN102 and
- MN103, NEC V850, Sparclet, Solaris & Linux on PowerPCs, etc.
- * Integrated testsuites for gcc, g++, g77, libstdc++ and libio.
- * RS6000/PowerPC ports generate code which can run on all
- RS6000/PowerPC variants by default.
- * -mcpu= and -march= switches for the x86 port to allow better
- control over how the x86 port generates code.
- * Includes the template repository patch (aka repo patch); note the
- new template code makes repo obsolete for ELF systems using gnu-ld
- such as Linux.
- * Plus the usual assortment of bugfixes and improvements.
-
- [3]Return to the egcs home page
-
- Last modified: July 28, 1999
-
-References
-
- 1. http://gcc.gnu.org/egcs-1.0/features-2.8.html
- 2. http://gcc.gnu.org/egcs-1.0/c++features.html
- 3. http://gcc.gnu.org/index.html
-======================================================================
-http://gcc.gnu.org/egcs-1.0/caveats.html
-
- EGCS 1.0 Caveats
-
- * EGCS has an integrated libstdc++, but does not have an integrated
- libg++. Furthermore old libg++ releases will not work with egc; HJ
- Lu has made a [1]libg++ snapshot available which may work with
- EGCS.
- Note most C++ programs only need libstdc++.
- * Note that using -pedantic or -Wreturn-type can cause an explosion
- in the amount of memory needed for template-heavy C++ code, such
- as code that uses STL. Also note that -Wall includes
- -Wreturn-type, so if you use -Wall you will need to specify
- -Wno-return-type to turn it off.
- * Exception handling may not work with shared libraries,
- particularly on alphas, hppas, and mips based platforms. Exception
- handling is known to work on x86-linux platforms with shared
- libraries.
- * Some versions of the Linux kernel have bugs which prevent them
- from being compiled or from running when compiled by EGCS. See
- [2]the FAQ for additional information.
- * In general, EGCS is more rigorous about rejecting invalid C++ code
- or deprecated C++ constructs than G++ 2.7. As a result it may be
- necessary to fix C++ code before it will compile with EGCS.
- * G++ is also aggressively tracking the C++ standard; as a result
- code which was previously valid (and thus accepted by other
- compilers and older versions of G++) may no longer be accepted.
- * EGCS 1.0 may not work with Red Hat Linux 5.0 on all targets. EGCS
- 1.0.x and later releases should work with Red Hat Linux 5.0.
-
- [3]Return to the GCC home page
-
- Last modified: August 27, 1998
-
-References
-
- 1. ftp://ftp.yggdrasil.com/private/hjl/libg++-2.8.1.2.tar.gz
- 2. http://gcc.gnu.org/fom_serv/cache/24.html
- 3. http://gcc.gnu.org/index.html
-======================================================================
diff --git a/contrib/gcc/PROBLEMS b/contrib/gcc/PROBLEMS
deleted file mode 100644
index bc532e641a8d..000000000000
--- a/contrib/gcc/PROBLEMS
+++ /dev/null
@@ -1,117 +0,0 @@
-3. When find_reloads is used to count number of spills needed
-it does not take into account the fact that a reload may
-turn out to be a dummy.
-
-I'm not sure this really happens any more. Doesn't it find
-all the dummies on both passes?
-
-10. movl a3@,a0
- movl a3@(16),a1
- clrb a0@(a1:l)
-is generated and may be worse than
- movl a3@,a0
- addl a3@(16),a0
- clrb a0@
-If ordering of operands is improved, many more
-such cases will be generated from typical array accesses.
-
-38. Hack expand_mult so that if there is no same-modes multiply
-it will use a widening multiply and then truncate rather than
-calling the library.
-
-39. Hack expanding of division to notice cases for
-long -> short division.
-
-40. Represent divide insns as (DIV:SI ...) followed by
-a separate lowpart extract. Represent remainder insns as DIV:SI
-followed by a separate highpart extract. Then cse can work on
-the DIV:SI part. Problem is, this may not be desirable on machines
-where computing the quotient alone does not necessarily give
-a remainder--such as the 68020 for long operands.
-
-52. Reloading can look at how reload_contents got set up.
-If it was copied from a register, just reload from that register.
-Otherwise, perhaps can change the previous insn to move the
-data via the reload reg, thus avoiding one memory ref.
-
-63. Potential problem in cc_status.value2, if it ever activates itself
-after a two-address subtraction (which currently cannot happen).
-It is supposed to compare the current value of the destination
-but eliminating it would use the results of the subtraction, equivalent
-to comparing the previous value of the destination.
-
-65. Should loops that neither start nor end with a break
-be rearranged to end with the last break?
-
-69. Define the floating point converting arithmetic instructions
-for the 68881.
-
-74. Combine loop opt with cse opt in one pass. Do cse on each loop,
-then loop opt on that loop, and go from innermost loops outward.
-Make loop invariants available for cse at end of loop.
-
-85. pea can force a value to be reloaded into an areg
-which can make it worse than separate adding and pushing.
-This can only happen for adding something within addql range
-and it only loses if the qty becomes dead at that point
-so it can be added to with no copying.
-
-93. If a pseudo doesn't get a hard reg everywhere,
-can it get one during a loop?
-
-96. Can do SImode bitfield insns without reloading, but must
-alter the operands in special ways.
-
-99. final could check loop-entry branches to see if they
-screw up deletion of a test instruction. If they do,
-can put another test instruction before the branch and
-make it conditional and redirect it.
-
-106. Aliasing may be impossible if data types of refs differ
-and data type of containing objects also differ.
-(But check this wrt unions.)
-
-108. Can speed up flow analysis by making a table saying which
-register is set and which registers are used by each instruction that
-only sets one register and only uses two. This way avoid the tree
-walk for such instructions (most instructions).
-
-109. It is desirable to avoid converting INDEX to SImode if a
-narrower mode suffices, as HImode does on the 68000.
-How can this be done?
-
-110. Possible special combination pattern:
-If the two operands to a comparison die there and both come from insns
-that are identical except for replacing one operand with the other,
-throw away those insns. Ok if insns being discarded are known 1 to 1.
-An andl #1 after a seq is 1 to 1, but how should compiler know that?
-
-112. Can convert float to unsigned int by subtracting a constant,
-converting to signed int, and changing the sign bit.
-
-117. Any number of slow zero-extensions in one loop, that have
-their clr insns moved out of the loop, can share one register
-if their original life spans are disjoint.
-But it may be hard to be sure of this since
-the life span data that regscan produces may be hard to interpret
-validly or may be incorrect after cse.
-
-118. In cse, when a bfext insn refers to a register, if the field
-corresponds to a halfword or a byte and the register is equivalent
-to a memory location, it would be possible to detect this and
-replace it with a simple memory reference.
-
-121. Insns that store two values cannot be moved out of loops.
-The code in scan_loop doesn't even try to deal with them.
-
-122. When insn-output.c turns a bit-test into a sign-test,
-it should see whether the cc is already set up with that sign.
-
-123. When a conditional expression is used as a function arg, it would
-be faster (and in some cases shorter) to push each alternative rather
-than compute in a register and push that. This would require
-being able to specify "push this" as a target for expand_expr.
-
-124. On the 386, bad code results from foo (bar ()) when bar
-returns a double, because the pseudo used fails to get preferenced
-into an fp reg because of the distinction between regs 8 and 9.
diff --git a/contrib/gcc/PROJECTS b/contrib/gcc/PROJECTS
deleted file mode 100644
index 2c2111a2a6e3..000000000000
--- a/contrib/gcc/PROJECTS
+++ /dev/null
@@ -1,449 +0,0 @@
-C++ template friend functions (mmitchell@usa.net)
-
-Haifa scheduler (haifa-sched.c, loop.[ch], unroll.[ch], genattrtab.c):
-(contact law@cygnus.com before starting any serious haifa work)
-
- * Fix all the formatting problems. Simple, mindless work.
-
- * Fix/add comments throughout the code. Many of the comments are from
- the old scheduler and are out of date and misleading. Many new hunks
- of code don't have sufficient comments and documentation. Those which
- do have comments need to be rewritten to use complete sentences and
- proper formatting.
-
- * Someone needs make one (or more) passes over the scheduler as a whole to
- just clean it up. Try to move the machine dependent bits into the target
- files where they belong, avoid re-creating functions where or near
- equivalents already exist (ie is_conditional_branch and friends), etc., etc.
-
- * Document the new scheduling options. Remove those options which are
- not really useful (like reverse scheduling for example). In general
- the haifa scheduler adds _way_ too many options. I'm definitely of the
- opinion that gcc already has too many -foptions, and haifa doesn't help
- that situation.
-
- * Testing and benchmarking. We've converted a few ports to using the
- Haifa scheduler (hppa, sparc, ppc, alpha). We need to continue testing
- and benchmarking the new scheduler on additional targets.
-
- We need to have some kind of docs for how to best describe a machine to
- the haifa scheduler to get good performance. Some existing ports have
- been tuned to deal with the old scheduler -- they may need to be tuned
- to generate good schedules with haifa.
-
-
-
-Improvements to global cse and partial redundancy elimination:
-
-The current implementation of global cse uses partial redundancy elimination
-as described in Chow's thesis.
-
-Long term we want to use lazy code motion as the basis for partial redundancy
-elimination. lcm will find as many (or more) redunancies *and* it will
-place the remaining computations at computationally optimal placement points
-within the function. This reduces the number of redundant operations performed
-as well as reducing register lifetimes. My experiments have shown that the
-cases were the current PRE code hurts performance are greatly helped by using
-lazy code motion.
-
-lcm also provides the underlying framework for several additional optimizations
-such as shrink wrapping, spill code motion, dead store elimination, and generic
-load/store motion (all the other examples are subcases of load/store motion).
-
-It can probably also be used to improve the reg-stack pass of the compiler.
-
-Contact law@cygnus.com if you're interested in working on lazy code motion.
-
--------------
-
-The old PROJECTS file. Stuff I know has been done has been deleted.
-Stuff in progress has a contact name associated with it.
-has been
-
-1. Better optimization.
-
-* Constants in unused inline functions
-
-It would be nice to delay output of string constants so that string
-constants mentioned in unused inline functions are never generated.
-Perhaps this would also take care of string constants in dead code.
-
-The difficulty is in finding a clean way for the RTL which refers
-to the constant (currently, only by an assembler symbol name)
-to point to the constant and cause it to be output.
-
-* Optimize a sequence of if statements whose conditions are exclusive.
-
-It is possible to optimize
-
- if (x == 1) ...;
- if (x == 2) ...;
- if (x == 3) ...;
-
-into
-
- if (x == 1) ...;
- else if (x == 2) ...;
- else if (x == 3) ...;
-
-provided that x is not altered by the contents of the if statements.
-
-It's not certain whether this is worth doing. Perhaps programmers
-nearly always write the else's themselves, leaving few opportunities
-to improve anything.
-
-* Un-cse.
-
-Perhaps we should have an un-cse step right after cse, which tries to
-replace a reg with its value if the value can be substituted for the
-reg everywhere, if that looks like an improvement. Which is if the
-reg is used only a few times. Use rtx_cost to determine if the
-change is really an improvement.
-
-* Clean up how cse works.
-
-The scheme is that each value has just one hash entry. The
-first_same_value and next_same_value chains are no longer needed.
-
-For arithmetic, each hash table elt has the following slots:
-
-* Operation. This is an rtx code.
-* Mode.
-* Operands 0, 1 and 2. These point to other hash table elements.
-
-So, if we want to enter (PLUS:SI (REG:SI 30) (CONST_INT 104)), we
-first enter (CONST_INT 104) and find the entry that (REG:SI 30) now
-points to. Then we put these elts into operands 0 and 1 of a new elt.
-We put PLUS and SI into the new elt.
-
-Registers and mem refs would never be entered into the table as such.
-However, the values they contain would be entered. There would be a
-table indexed by regno which points at the hash entry for the value in
-that reg.
-
-The hash entry index now plays the role of a qty number.
-We still need qty_first_reg, reg_next_eqv, etc. to record which regs
-share a particular qty.
-
-When a reg is used whose contents are unknown, we need to create a
-hash table entry whose contents say "unknown", as a place holder for
-whatever the reg contains. If that reg is added to something, then
-the hash entry for the sum will refer to the "unknown" entry. Use
-UNKNOWN for the rtx code in this entry. This replaces make_new_qty.
-
-For a constant, a unique hash entry would be made based on the
-value of the constant.
-
-What about MEM? Each time a memory address is referenced, we need a
-qty (a hash table elt) to represent what is in it. (Just as for a
-register.) If this isn't known, create one, just as for a reg whose
-contents are unknown.
-
-We need a way to find all mem refs that still contain a certain value.
-Do this with a chain of hash elts (for memory addresses) that point to
-locations that hold the value. The hash elt for the value itself should
-point to the start of the chain. It would be good for the hash elt
-for an address to point to the hash elt for the contents of that address
-(but this ptr can be null if the contents have never been entered).
-
-With this data structure, nothing need ever be invalidated except
-the lists of which regs or mems hold a particular value. It is easy
-to see if there is a reg or mem that is equiv to a particular value.
-If the value is constant, it is always explicitly constant.
-
-* Support more general tail-recursion among different functions.
-
-This might be possible under certain circumstances, such as when
-the argument lists of the functions have the same lengths.
-Perhaps it could be done with a special declaration.
-
-You would need to verify in the calling function that it does not
-use the addresses of any local variables and does not use setjmp.
-
-* Put short statics vars at low addresses and use short addressing mode?
-
-Useful on the 68000/68020 and perhaps on the 32000 series,
-provided one has a linker that works with the feature.
-This is said to make a 15% speedup on the 68000.
-
-* Keep global variables in registers.
-
-Here is a scheme for doing this. A global variable, or a local variable
-whose address is taken, can be kept in a register for an entire function
-if it does not use non-constant memory addresses and (for globals only)
-does not call other functions. If the entire function does not meet
-this criterion, a loop may.
-
-The VAR_DECL for such a variable would have to have two RTL expressions:
-the true home in memory, and the pseudo-register used temporarily.
-It is necessary to emit insns to copy the memory location into the
-pseudo-register at the beginning of the function or loop, and perhaps
-back out at the end. These insns should have REG_EQUIV notes so that,
-if the pseudo-register does not get a hard register, it is spilled into
-the memory location which exists in any case.
-
-The easiest way to set up these insns is to modify the routine
-put_var_into_stack so that it does not apply to the entire function
-(sparing any loops which contain nothing dangerous) and to call it at
-the end of the function regardless of where in the function the
-address of a local variable is taken. It would be called
-unconditionally at the end of the function for all relevant global
-variables.
-
-For debugger output, the thing to do is to invent a new binding level
-around the appropriate loop and define the variable name as a register
-variable with that scope.
-
-* Live-range splitting.
-
-Currently a variable is allocated a hard register either for the full
-extent of its use or not at all. Sometimes it would be good to
-allocate a variable a hard register for just part of a function; for
-example, through a particular loop where the variable is mostly used,
-or outside of a particular loop where the variable is not used. (The
-latter is nice because it might let the variable be in a register most
-of the time even though the loop needs all the registers.)
-
-Contact meissner@cygnus.com before starting any work on live range
-splitting.
-
-* Detect dead stores into memory?
-
-A store into memory is dead if it is followed by another store into
-the same location; and, in between, there is no reference to anything
-that might be that location (including no reference to a variable
-address).
-
-This can be modeled as a partial redundancy elimination/lazy code motion
-problem. Contact law@cygnus.com before working on dead store elimination
-optimizations.
-
-* Loop optimization.
-
-Strength reduction and iteration variable elimination could be
-smarter. They should know how to decide which iteration variables are
-not worth making explicit because they can be computed as part of an
-address calculation. Based on this information, they should decide
-when it is desirable to eliminate one iteration variable and create
-another in its place.
-
-It should be possible to compute what the value of an iteration
-variable will be at the end of the loop, and eliminate the variable
-within the loop by computing that value at the loop end.
-
-When a loop has a simple increment that adds 1,
-instead of jumping in after the increment,
-decrement the loop count and jump to the increment.
-This allows aob insns to be used.
-
-* Using constraints on values.
-
-Many operations could be simplified based on knowledge of the
-minimum and maximum possible values of a register at any particular time.
-These limits could come from the data types in the tree, via rtl generation,
-or they can be deduced from operations that are performed. For example,
-the result of an `and' operation one of whose operands is 7 must be in
-the range 0 to 7. Compare instructions also tell something about the
-possible values of the operand, in the code beyond the test.
-
-Value constraints can be used to determine the results of a further
-comparison. They can also indicate that certain `and' operations are
-redundant. Constraints might permit a decrement and branch
-instruction that checks zeroness to be used when the user has
-specified to exit if negative.
-
-* Smarter reload pass.
-
-The reload pass as currently written can reload values only into registers
-that are reserved for reloading. This means that in order to use a
-register for reloading it must spill everything out of that register.
-
-It would be straightforward, though complicated, for reload1.c to keep
-track, during its scan, of which hard registers were available at each
-point in the function, and use for reloading even registers that were
-free only at the point they were needed. This would avoid much spilling
-and make better code.
-
-* Change the type of a variable.
-
-Sometimes a variable is declared as `int', it is assigned only once
-from a value of type `char', and then it is used only by comparison
-against constants. On many machines, better code would result if
-the variable had type `char'. If the compiler could detect this
-case, it could change the declaration of the variable and change
-all the places that use it.
-
-* Better handling for very sparse switches.
-
-There may be cases where it would be better to compile a switch
-statement to use a fixed hash table rather than the current
-combination of jump tables and binary search.
-
-* Order of subexpressions.
-
-It might be possible to make better code by paying attention
-to the order in which to generate code for subexpressions of an expression.
-
-* More code motion.
-
-Consider hoisting common code up past conditional branches or tablejumps.
-
-Contact law@cygnus.com before working on code hoisting.
-
-* Trace scheduling.
-
-This technique is said to be able to figure out which way a jump
-will usually go, and rearrange the code to make that path the
-faster one.
-
-* Distributive law.
-
-The C expression *(X + 4 * (Y + C)) compiles better on certain
-machines if rewritten as *(X + 4*C + 4*Y) because of known addressing
-modes. It may be tricky to determine when, and for which machines, to
-use each alternative.
-
-Some work has been done on this, in combine.c.
-
-* Can optimize by changing if (x) y; else z; into z; if (x) y;
-if z and x do not interfere and z has no effects not undone by y.
-This is desirable if z is faster than jumping.
-
-* For a two-insn loop on the 68020, such as
- foo: movb a2@+,a3@+
- jne foo
-it is better to insert dbeq d0,foo before the jne.
-d0 can be a junk register. The challenge is to fit this into
-a portable framework: when can you detect this situation and
-still be able to allocate a junk register?
-
-2. Simpler porting.
-
-Right now, describing the target machine's instructions is done
-cleanly, but describing its addressing mode is done with several
-ad-hoc macro definitions. Porting would be much easier if there were
-an RTL description for addressing modes like that for instructions.
-Tools analogous to genflags and genrecog would generate macros from
-this description.
-
-There would be one pattern in the address-description file for each
-kind of addressing, and this pattern would have:
-
- * the RTL expression for the address
- * C code to verify its validity (since that may depend on
- the exact data).
- * C code to print the address in assembler language.
- * C code to convert the address into a valid one, if it is not valid.
- (This would replace LEGITIMIZE_ADDRESS).
- * Register constraints for all indeterminates that appear
- in the RTL expression.
-
-3. Other languages.
-
-Front ends for Pascal, Fortran, Algol, Cobol, Modula-2 and Ada are
-desirable.
-
-Pascal, Modula-2 and Ada require the implementation of functions
-within functions. Some of the mechanisms for this already exist.
-
-4. More extensions.
-
-* Generated unique labels. Have some way of generating distinct labels
-for use in extended asm statements. I don't know what a good syntax would
-be.
-
-* A way of defining a structure containing a union, in which the choice of
-union alternative is controlled by a previous structure component.
-
-Here is a possible syntax for this.
-
-struct foo {
- enum { INT, DOUBLE } code;
- auto union { case INT: int i; case DOUBLE: double d;} value : code;
-};
-
-* Allow constructor expressions as lvalues, like this:
-
- (struct foo) {a, b, c} = foo();
-
-This would call foo, which returns a structure, and then store the
-several components of the structure into the variables a, b, and c.
-
-5. Generalize the machine model.
-
-* Some new compiler features may be needed to do a good job on machines
-where static data needs to be addressed using base registers.
-
-* Some machines have two stacks in different areas of memory, one used
-for scalars and another for large objects. The compiler does not
-now have a way to understand this.
-
-6. Useful warnings.
-
-* Warn about statements that are undefined because the order of
-evaluation of increment operators makes a big difference. Here is an
-example:
-
- *foo++ = hack (*foo);
-
-7. Better documentation of how GCC works and how to port it.
-
-Here is an outline proposed by Allan Adler.
-
-I. Overview of this document
-II. The machines on which GCC is implemented
- A. Prose description of those characteristics of target machines and
- their operating systems which are pertinent to the implementation
- of GCC.
- i. target machine characteristics
- ii. comparison of this system of machine characteristics with
- other systems of machine specification currently in use
- B. Tables of the characteristics of the target machines on which
- GCC is implemented.
- C. A priori restrictions on the values of characteristics of target
- machines, with special reference to those parts of the source code
- which entail those restrictions
- i. restrictions on individual characteristics
- ii. restrictions involving relations between various characteristics
- D. The use of GCC as a cross-compiler
- i. cross-compilation to existing machines
- ii. cross-compilation to non-existent machines
- E. Assumptions which are made regarding the target machine
- i. assumptions regarding the architecture of the target machine
- ii. assumptions regarding the operating system of the target machine
- iii. assumptions regarding software resident on the target machine
- iv. where in the source code these assumptions are in effect made
-III. A systematic approach to writing the files tm.h and xm.h
- A. Macros which require special care or skill
- B. Examples, with special reference to the underlying reasoning
-IV. A systematic approach to writing the machine description file md
- A. Minimal viable sets of insn descriptions
- B. Examples, with special reference to the underlying reasoning
-V. Uses of the file aux-output.c
-VI. Specification of what constitutes correct performance of an
- implementation of GCC
- A. The components of GCC
- B. The itinerary of a C program through GCC
- C. A system of benchmark programs
- D. What your RTL and assembler should look like with these benchmarks
- E. Fine tuning for speed and size of compiled code
-VII. A systematic procedure for debugging an implementation of GCC
- A. Use of GDB
- i. the macros in the file .gdbinit for GCC
- ii. obstacles to the use of GDB
- a. functions implemented as macros can't be called in GDB
- B. Debugging without GDB
- i. How to turn off the normal operation of GCC and access specific
- parts of GCC
- C. Debugging tools
- D. Debugging the parser
- i. how machine macros and insn definitions affect the parser
- E. Debugging the recognizer
- i. how machine macros and insn definitions affect the recognizer
-
-ditto for other components
-
-VIII. Data types used by GCC, with special reference to restrictions not
- specified in the formal definition of the data type
-IX. References to the literature for the algorithms used in GCC
-
diff --git a/contrib/gcc/README b/contrib/gcc/README
deleted file mode 100644
index a12bf7594630..000000000000
--- a/contrib/gcc/README
+++ /dev/null
@@ -1,26 +0,0 @@
-This directory contains the GNU Compiler Collection (GCC) version 2.95.
-It includes all of the support for compiling C, C++, Objective C, Fortran,
-Java, and Chill.
-
-The GNU Compiler Collection is free software. See the file COPYING for copying
-permission.
-
-See the file gcc.texi (together with other files that it includes) for
-installation and porting information. The file INSTALL contains a
-copy of the installation information, as plain ASCII.
-
-Installing this package will create various files in subdirectories of
-/usr/local/lib, which are passes used by the compiler and a library
-named libgcc.a. It will also create /usr/local/bin/gcc, which is
-the user-level command to do a compilation.
-
-See the Bugs chapter of the GCC Manual for how to report bugs
-usefully. An online readable version of the manual is in the files
-gcc.info*.
-
-The files pself.c and pself1.c are not part of GCC.
-They are programs that print themselves on standard output.
-They were written by Dario Dariol and Giovanni Cozzi, and are
-included for your hacking pleasure. Likewise pself2.c
-(Who is the author of that?) and pself3.c (by Vlad Taeerov and Rashit
-Fakhreyev).
diff --git a/contrib/gcc/README-bugs b/contrib/gcc/README-bugs
deleted file mode 100644
index 06e15bb8af70..000000000000
--- a/contrib/gcc/README-bugs
+++ /dev/null
@@ -1,144 +0,0 @@
-The purpose of GCC pretesting is to verify that the new GCC
-distribution, about to be released, works properly on your system *with
-no change whatever*, when installed following the precise
-recommendations that come with the distribution.
-
-Here are some guidelines on how to do pretesting so as to make it
-helpful. All of them follow from common sense together with the
-nature of the purpose and the situation.
-
-* It is absolutely vital that you mention even the smallest change or
-departure from the standard sources and installation procedure.
-
-Otherwise, you are not testing the same program that I wrote. Testing
-a different program is usually of no use whatever. It can even cause
-trouble if you fail to tell me that you tested some other program
-instead of what I know as GCC. I might think that GCC works, when in
-fact it has not been properly tried, and might have a glaring fault.
-
-* Even changing the compilation options counts as a change in the
-program. The GCC sources specify which compilation options to use.
-Some of them are specified in makefiles, and some in machine-specific
-configuration files.
-
-You have ways to override this--but if you do, then you are not
-testing what ordinary users will do. Therefore, when pretesting, it
-is vital to test with the default compilation options.
-
-(It is okay to test with nonstandard options as well as testing with
-the standard ones.)
-
-* The machine and system configuration files of GCC are parts of
-GCC. So when you test GCC, you need to do it with the
-configuration files that come with GCC.
-
-If GCC does not come with configuration files for a certain machine,
-and you test it with configuration files that don't come with GCC,
-this is effectively changing GCC. Because the crucial fact about
-the planned release is that, without changes, it doesn't work on that
-machine.
-
-To make GCC work on that machine, I would need to install new
-configuration files. That is not out of the question, since it is
-safe--it certainly won't break any other machines that already work.
-But you will have to rush me the legal papers to give the FSF
-permission to use a large piece of text.
-
-* Look for recommendations for your system.
-
-You can find these recommendations in the Installation node of the
-manual, and in the file INSTALL. (These two files have the same text.)
-
-These files say which configuration name to use for your machine, so
-use the ones that are recommended. If you guess, you might guess
-wrong and encounter spurious difficulties. What's more, if you don't
-follow the recommendations then you aren't helping to test that its
-recommendations are valid.
-
-These files may describe other things that you need to do to make GCC
-work on your machine. If so, you should follow these recommendations
-also, for the same reason.
-
-Also look at the Trouble chapter of the manual for items that
-pertain to your machine.
-
-* Don't delay sending information.
-
-When you find a problem, please double check it if you can do so
-quickly. But don't spend a long time double-checking. A good rule is
-always to tell me about every problem on the same day you encounter
-it, even if that means you can't find a solution before you report the
-problem.
-
-I'd much rather hear about a problem today and a solution tomorrow
-than get both of them tomorrow at the same time.
-
-* Make each bug report self-contained.
-
-If you refer back to another message, whether from you or from someone
-else, then it will be necessary for anyone who wants to investigate
-the bug to find the other message. This may be difficult, it is
-probably time-consuming.
-
-To help me save time, simply copy the relevant parts of any previous
-messages into your own bug report.
-
-In particular, if I ask you for more information because a bug report
-was incomplete, it is best to send me the *entire* collection of
-relevant information, all together. If you send just the additional
-information, that makes me do extra work. There is even a risk that
-I won't remember what question you are sending me the answer to.
-
-* Always be precise when talking about changes you have made. Show
-things rather than describing them. Use exact filenames (relative to
-the main directory of the distribution), not partial ones. For
-example, say "I changed Makefile" rather than "I changed the
-makefile". Instead of saying "I defined the MUMBLE macro", send a
-diff that shows your change.
-
-* Always use `diff -c' to make diffs. If you don't include context,
-it may be hard for me to figure out where you propose to make the
-changes. I might have to ignore your patch because I can't tell what
-it means.
-
-* When you write a fix, keep in mind that I can't install a change
-that would break other systems.
-
-People often suggest fixing a problem by changing machine-independent
-files such as toplev.c to do something special that a particular
-system needs. Sometimes it is totally obvious that such changes would
-break GCC for almost all users. I can't possibly make a change like
-that. All I can do is send it back to you and ask you to find a fix
-that is safe to install.
-
-Sometimes people send fixes that *might* be an improvement in
-general--but it is hard to be sure of this. I can install such
-changes some of the time, but not during pretest, when I am trying to
-get a new version to work reliably as quickly as possible.
-
-The safest changes for me to install are changes to the configuration
-files for a particular machine. At least I know those can't create
-bugs on other machines.
-
-* Don't try changing GCC unless it fails to work if you don't change it.
-
-* Don't even suggest changes that would only make GCC cleaner.
-Every change I install could introduce a bug, so I won't install
-a change unless I see it is necessary.
-
-* If you would like to suggest changes for purposes other than fixing
-serious bugs, don't wait till pretest time. Instead, send them just
-after I make a release. That's the best time for me to install them.
-
-* In some cases, if you don't follow these guidelines, your
-information might still be useful, but I might have to do more work to
-make use of it. Unfortunately, I am so far behind in my work that I
-just can't get the job done unless you help me to do it efficiently.
-
-
- Thank you
- rms
-
-Local Variables:
-mode: text
-End:
diff --git a/contrib/gcc/README.DWARF b/contrib/gcc/README.DWARF
deleted file mode 100644
index 97459508b3c4..000000000000
--- a/contrib/gcc/README.DWARF
+++ /dev/null
@@ -1,574 +0,0 @@
-Notes on the GNU Implementation of DWARF Debugging Information
---------------------------------------------------------------
-Last Updated: Sun Jul 17 08:17:42 PDT 1994 by rfg@segfault.us.com
-------------------------------------------------------------
-
-This file describes special and unique aspects of the GNU implementation
-of the DWARF debugging information language, as provided in the GNU version
-2.x compiler(s).
-
-For general information about the DWARF debugging information language,
-you should obtain the DWARF version 1 specification document (and perhaps
-also the DWARF version 2 draft specification document) developed by the
-UNIX International Programming Languages Special Interest Group. A copy
-of the DWARF version 1 specification (in PostScript form) may be
-obtained either from me <rfg@netcom.com> or from the main Data General
-FTP server. (See below.) The file you are looking at now only describes
-known deviations from the DWARF version 1 specification, together with
-those things which are allowed by the DWARF version 1 specification but
-which are known to cause interoperability problems (e.g. with SVR4 SDB).
-
-To obtain a copy of the DWARF Version 1 and/or DWARF Version 2 specification
-from Data General's FTP server, use the following procedure:
-
----------------------------------------------------------------------------
- ftp to machine: "dg-rtp.dg.com" (128.222.1.2).
-
- Log in as "ftp".
- cd to "plsig"
- get any of the following file you are interested in:
-
- dwarf.1.0.3.ps
- dwarf.2.0.0.index.ps
- dwarf.2.0.0.ps
----------------------------------------------------------------------------
-
-The generation of DWARF debugging information by the GNU version 2.x C
-compiler has now been tested rather extensively for m88k, i386, i860, and
-Sparc targets. The DWARF output of the GNU C compiler appears to inter-
-operate well with the standard SVR4 SDB debugger on these kinds of target
-systems (but of course, there are no guarantees).
-
-DWARF generation for the GNU g++ compiler is still not operable. This is
-due primarily to the many remaining cases where the g++ front end does not
-conform to the conventions used in the GNU C front end for representing
-various kinds of declarations in the TREE data structure. It is not clear
-at this time how these problems will be addressed.
-
-Future plans for the dwarfout.c module of the GNU compiler(s) includes the
-addition of full support for GNU FORTRAN. (This should, in theory, be a
-lot simpler to add than adding support for g++... but we'll see.)
-
-Many features of the DWARF version 2 specification have been adapted to
-(and used in) the GNU implementation of DWARF (version 1). In most of
-these cases, a DWARF version 2 approach is used in place of (or in addition
-to) DWARF version 1 stuff simply because it is apparent that DWARF version
-1 is not sufficiently expressive to provide the kinds of information which
-may be necessary to support really robust debugging. In all of these cases
-however, the use of DWARF version 2 features should not interfere in any
-way with the interoperability (of GNU compilers) with generally available
-"classic" (pre version 1) DWARF consumer tools (e.g. SVR4 SDB).
-
-The DWARF generation enhancement for the GNU compiler(s) was initially
-donated to the Free Software Foundation by Network Computing Devices.
-(Thanks NCD!) Additional development and maintenance of dwarfout.c has
-been largely supported (i.e. funded) by Intel Corporation. (Thanks Intel!)
-
-If you have questions or comments about the DWARF generation feature, please
-send mail to me <rfg@netcom.com>. I will be happy to investigate any bugs
-reported and I may even provide fixes (but of course, I can make no promises).
-
-The DWARF debugging information produced by GCC may deviate in a few minor
-(but perhaps significant) respects from the DWARF debugging information
-currently produced by other C compilers. A serious attempt has been made
-however to conform to the published specifications, to existing practice,
-and to generally accepted norms in the GNU implementation of DWARF.
-
- ** IMPORTANT NOTE ** ** IMPORTANT NOTE ** ** IMPORTANT NOTE **
-
-Under normal circumstances, the DWARF information generated by the GNU
-compilers (in an assembly language file) is essentially impossible for
-a human being to read. This fact can make it very difficult to debug
-certain DWARF-related problems. In order to overcome this difficulty,
-a feature has been added to dwarfout.c (enabled by the -fverbose-asm
-option) which causes additional comments to be placed into the assembly
-language output file, out to the right-hand side of most bits of DWARF
-material. The comments indicate (far more clearly that the obscure
-DWARF hex codes do) what is actually being encoded in DWARF. Thus, the
--fverbose-asm option can be highly useful for those who must study the
-DWARF output from the GNU compilers in detail.
-
----------
-
-(Footnote: Within this file, the term `Debugging Information Entry' will
-be abbreviated as `DIE'.)
-
-
-Release Notes (aka known bugs)
--------------------------------
-
-In one very obscure case involving dynamically sized arrays, the DWARF
-"location information" for such an array may make it appear that the
-array has been totally optimized out of existence, when in fact it
-*must* actually exist. (This only happens when you are using *both* -g
-*and* -O.) This is due to aggressive dead store elimination in the
-compiler, and to the fact that the DECL_RTL expressions associated with
-variables are not always updated to correctly reflect the effects of
-GCC's aggressive dead store elimination.
-
--------------------------------
-
-When attempting to set a breakpoint at the "start" of a function compiled
-with -g1, the debugger currently has no way of knowing exactly where the
-end of the prologue code for the function is. Thus, for most targets,
-all the debugger can do is to set the breakpoint at the AT_low_pc address
-for the function. But if you stop there and then try to look at one or
-more of the formal parameter values, they may not have been "homed" yet,
-so you may get inaccurate answers (or perhaps even addressing errors).
-
-Some people may consider this simply a non-feature, but I consider it a
-bug, and I hope to provide some GNU-specific attributes (on function
-DIEs) which will specify the address of the end of the prologue and the
-address of the beginning of the epilogue in a future release.
-
--------------------------------
-
-It is believed at this time that old bugs relating to the AT_bit_offset
-values for bit-fields have been fixed.
-
-There may still be some very obscure bugs relating to the DWARF description
-of type `long long' bit-fields for target machines (e.g. 80x86 machines)
-where the alignment of type `long long' data objects is different from
-(and less than) the size of a type `long long' data object.
-
-Please report any problems with the DWARF description of bit-fields as you
-would any other GCC bug. (Procedures for bug reporting are given in the
-GNU C compiler manual.)
-
---------------------------------
-
-At this time, GCC does not know how to handle the GNU C "nested functions"
-extension. (See the GCC manual for more info on this extension to ANSI C.)
-
---------------------------------
-
-The GNU compilers now represent inline functions (and inlined instances
-thereof) in exactly the manner described by the current DWARF version 2
-(draft) specification. The version 1 specification for handling inline
-functions (and inlined instances) was known to be brain-damaged (by the
-PLSIG) when the version 1 spec was finalized, but it was simply too late
-in the cycle to get it removed before the version 1 spec was formally
-released to the public (by UI).
-
---------------------------------
-
-At this time, GCC does not generate the kind of really precise information
-about the exact declared types of entities with signed integral types which
-is required by the current DWARF draft specification.
-
-Specifically, the current DWARF draft specification seems to require that
-the type of an non-unsigned integral bit-field member of a struct or union
-type be represented as either a "signed" type or as a "plain" type,
-depending upon the exact set of keywords that were used in the
-type specification for the given bit-field member. It was felt (by the
-UI/PLSIG) that this distinction between "plain" and "signed" integral types
-could have some significance (in the case of bit-fields) because ANSI C
-does not constrain the signedness of a plain bit-field, whereas it does
-constrain the signedness of an explicitly "signed" bit-field. For this
-reason, the current DWARF specification calls for compilers to produce
-type information (for *all* integral typed entities... not just bit-fields)
-which explicitly indicates the signedness of the relevant type to be
-"signed" or "plain" or "unsigned".
-
-Unfortunately, the GNU DWARF implementation is currently incapable of making
-such distinctions.
-
---------------------------------
-
-
-Known Interoperability Problems
--------------------------------
-
-Although the GNU implementation of DWARF conforms (for the most part) with
-the current UI/PLSIG DWARF version 1 specification (with many compatible
-version 2 features added in as "vendor specific extensions" just for good
-measure) there are a few known cases where GCC's DWARF output can cause
-some confusion for "classic" (pre version 1) DWARF consumers such as the
-System V Release 4 SDB debugger. These cases are described in this section.
-
---------------------------------
-
-The DWARF version 1 specification includes the fundamental type codes
-FT_ext_prec_float, FT_complex, FT_dbl_prec_complex, and FT_ext_prec_complex.
-Since GNU C is only a C compiler (and since C doesn't provide any "complex"
-data types) the only one of these fundamental type codes which GCC ever
-generates is FT_ext_prec_float. This fundamental type code is generated
-by GCC for the `long double' data type. Unfortunately, due to an apparent
-bug in the SVR4 SDB debugger, SDB can become very confused wherever any
-attempt is made to print a variable, parameter, or field whose type was
-given in terms of FT_ext_prec_float.
-
-(Actually, SVR4 SDB fails to understand *any* of the four fundamental type
-codes mentioned here. This will fact will cause additional problems when
-there is a GNU FORTRAN front-end.)
-
---------------------------------
-
-In general, it appears that SVR4 SDB is not able to effectively ignore
-fundamental type codes in the "implementation defined" range. This can
-cause problems when a program being debugged uses the `long long' data
-type (or the signed or unsigned varieties thereof) because these types
-are not defined by ANSI C, and thus, GCC must use its own private fundamental
-type codes (from the implementation-defined range) to represent these types.
-
---------------------------------
-
-
-General GNU DWARF extensions
-----------------------------
-
-In the current DWARF version 1 specification, no mechanism is specified by
-which accurate information about executable code from include files can be
-properly (and fully) described. (The DWARF version 2 specification *does*
-specify such a mechanism, but it is about 10 times more complicated than
-it needs to be so I'm not terribly anxious to try to implement it right
-away.)
-
-In the GNU implementation of DWARF version 1, a fully downward-compatible
-extension has been implemented which permits the GNU compilers to specify
-which executable lines come from which files. This extension places
-additional information (about source file names) in GNU-specific sections
-(which should be totally ignored by all non-GNU DWARF consumers) so that
-this extended information can be provided (to GNU DWARF consumers) in a way
-which is totally transparent (and invisible) to non-GNU DWARF consumers
-(e.g. the SVR4 SDB debugger). The additional information is placed *only*
-in specialized GNU-specific sections, where it should never even be seen
-by non-GNU DWARF consumers.
-
-To understand this GNU DWARF extension, imagine that the sequence of entries
-in the .lines section is broken up into several subsections. Each contiguous
-sequence of .line entries which relates to a sequence of lines (or statements)
-from one particular file (either a `base' file or an `include' file) could
-be called a `line entries chunk' (LEC).
-
-For each LEC there is one entry in the .debug_srcinfo section.
-
-Each normal entry in the .debug_srcinfo section consists of two 4-byte
-words of data as follows:
-
- (1) The starting address (relative to the entire .line section)
- of the first .line entry in the relevant LEC.
-
- (2) The starting address (relative to the entire .debug_sfnames
- section) of a NUL terminated string representing the
- relevant filename. (This filename name be either a
- relative or an absolute filename, depending upon how the
- given source file was located during compilation.)
-
-Obviously, each .debug_srcinfo entry allows you to find the relevant filename,
-and it also points you to the first .line entry that was generated as a result
-of having compiled a given source line from the given source file.
-
-Each subsequent .line entry should also be assumed to have been produced
-as a result of compiling yet more lines from the same file. The end of
-any given LEC is easily found by looking at the first 4-byte pointer in
-the *next* .debug_srcinfo entry. That next .debug_srcinfo entry points
-to a new and different LEC, so the preceding LEC (implicitly) must have
-ended with the last .line section entry which occurs at the 2 1/2 words
-just before the address given in the first pointer of the new .debug_srcinfo
-entry.
-
-The following picture may help to clarify this feature. Let's assume that
-`LE' stands for `.line entry'. Also, assume that `* 'stands for a pointer.
-
-
- .line section .debug_srcinfo section .debug_sfnames section
- ----------------------------------------------------------------
-
- LE <---------------------- *
- LE * -----------------> "foobar.c" <---
- LE |
- LE |
- LE <---------------------- * |
- LE * -----------------> "foobar.h" <| |
- LE | |
- LE | |
- LE <---------------------- * | |
- LE * -----------------> "inner.h" | |
- LE | |
- LE <---------------------- * | |
- LE * ------------------------------- |
- LE |
- LE |
- LE |
- LE |
- LE <---------------------- * |
- LE * -----------------------------------
- LE
- LE
- LE
-
-In effect, each entry in the .debug_srcinfo section points to *both* a
-filename (in the .debug_sfnames section) and to the start of a block of
-consecutive LEs (in the .line section).
-
-Note that just like in the .line section, there are specialized first and
-last entries in the .debug_srcinfo section for each object file. These
-special first and last entries for the .debug_srcinfo section are very
-different from the normal .debug_srcinfo section entries. They provide
-additional information which may be helpful to a debugger when it is
-interpreting the data in the .debug_srcinfo, .debug_sfnames, and .line
-sections.
-
-The first entry in the .debug_srcinfo section for each compilation unit
-consists of five 4-byte words of data. The contents of these five words
-should be interpreted (by debuggers) as follows:
-
- (1) The starting address (relative to the entire .line section)
- of the .line section for this compilation unit.
-
- (2) The starting address (relative to the entire .debug_sfnames
- section) of the .debug_sfnames section for this compilation
- unit.
-
- (3) The starting address (in the execution virtual address space)
- of the .text section for this compilation unit.
-
- (4) The ending address plus one (in the execution virtual address
- space) of the .text section for this compilation unit.
-
- (5) The date/time (in seconds since midnight 1/1/70) at which the
- compilation of this compilation unit occurred. This value
- should be interpreted as an unsigned quantity because gcc
- might be configured to generate a default value of 0xffffffff
- in this field (in cases where it is desired to have object
- files created at different times from identical source files
- be byte-for-byte identical). By default, these timestamps
- are *not* generated by dwarfout.c (so that object files
- compiled at different times will be byte-for-byte identical).
- If you wish to enable this "timestamp" feature however, you
- can simply place a #define for the symbol `DWARF_TIMESTAMPS'
- in your target configuration file and then rebuild the GNU
- compiler(s).
-
-Note that the first string placed into the .debug_sfnames section for each
-compilation unit is the name of the directory in which compilation occurred.
-This string ends with a `/' (to help indicate that it is the pathname of a
-directory). Thus, the second word of each specialized initial .debug_srcinfo
-entry for each compilation unit may be used as a pointer to the (string)
-name of the compilation directory, and that string may in turn be used to
-"absolutize" any relative pathnames which may appear later on in the
-.debug_sfnames section entries for the same compilation unit.
-
-The fifth and last word of each specialized starting entry for a compilation
-unit in the .debug_srcinfo section may (depending upon your configuration)
-indicate the date/time of compilation, and this may be used (by a debugger)
-to determine if any of the source files which contributed code to this
-compilation unit are newer than the object code for the compilation unit
-itself. If so, the debugger may wish to print an "out-of-date" warning
-about the compilation unit.
-
-The .debug_srcinfo section associated with each compilation will also have
-a specialized terminating entry. This terminating .debug_srcinfo section
-entry will consist of the following two 4-byte words of data:
-
- (1) The offset, measured from the start of the .line section to
- the beginning of the terminating entry for the .line section.
-
- (2) A word containing the value 0xffffffff.
-
---------------------------------
-
-In the current DWARF version 1 specification, no mechanism is specified by
-which information about macro definitions and un-definitions may be provided
-to the DWARF consumer.
-
-The DWARF version 2 (draft) specification does specify such a mechanism.
-That specification was based on the GNU ("vendor specific extension")
-which provided some support for macro definitions and un-definitions,
-but the "official" DWARF version 2 (draft) specification mechanism for
-handling macros and the GNU implementation have diverged somewhat. I
-plan to update the GNU implementation to conform to the "official"
-DWARF version 2 (draft) specification as soon as I get time to do that.
-
-Note that in the GNU implementation, additional information about macro
-definitions and un-definitions is *only* provided when the -g3 level of
-debug-info production is selected. (The default level is -g2 and the
-plain old -g option is considered to be identical to -g2.)
-
-GCC records information about macro definitions and undefinitions primarily
-in a section called the .debug_macinfo section. Normal entries in the
-.debug_macinfo section consist of the following three parts:
-
- (1) A special "type" byte.
-
- (2) A 3-byte line-number/filename-offset field.
-
- (3) A NUL terminated string.
-
-The interpretation of the second and third parts is dependent upon the
-value of the leading (type) byte.
-
-The type byte may have one of four values depending upon the type of the
-.debug_macinfo entry which follows. The 1-byte MACINFO type codes presently
-used, and their meanings are as follows:
-
- MACINFO_start A base file or an include file starts here.
- MACINFO_resume The current base or include file ends here.
- MACINFO_define A #define directive occurs here.
- MACINFO_undef A #undef directive occur here.
-
-(Note that the MACINFO_... codes mentioned here are simply symbolic names
-for constants which are defined in the GNU dwarf.h file.)
-
-For MACINFO_define and MACINFO_undef entries, the second (3-byte) field
-contains the number of the source line (relative to the start of the current
-base source file or the current include files) when the #define or #undef
-directive appears. For a MACINFO_define entry, the following string field
-contains the name of the macro which is defined, followed by its definition.
-Note that the definition is always separated from the name of the macro
-by at least one whitespace character. For a MACINFO_undef entry, the
-string which follows the 3-byte line number field contains just the name
-of the macro which is being undef'ed.
-
-For a MACINFO_start entry, the 3-byte field following the type byte contains
-the offset, relative to the start of the .debug_sfnames section for the
-current compilation unit, of a string which names the new source file which
-is beginning its inclusion at this point. Following that 3-byte field,
-each MACINFO_start entry always contains a zero length NUL terminated
-string.
-
-For a MACINFO_resume entry, the 3-byte field following the type byte contains
-the line number WITHIN THE INCLUDING FILE at which the inclusion of the
-current file (whose inclusion ends here) was initiated. Following that
-3-byte field, each MACINFO_resume entry always contains a zero length NUL
-terminated string.
-
-Each set of .debug_macinfo entries for each compilation unit is terminated
-by a special .debug_macinfo entry consisting of a 4-byte zero value followed
-by a single NUL byte.
-
---------------------------------
-
-In the current DWARF draft specification, no provision is made for providing
-a separate level of (limited) debugging information necessary to support
-tracebacks (only) through fully-debugged code (e.g. code in system libraries).
-
-A proposal to define such a level was submitted (by me) to the UI/PLSIG.
-This proposal was rejected by the UI/PLSIG for inclusion into the DWARF
-version 1 specification for two reasons. First, it was felt (by the PLSIG)
-that the issues involved in supporting a "traceback only" subset of DWARF
-were not well understood. Second, and perhaps more importantly, the PLSIG
-is already having enough trouble agreeing on what it means to be "conforming"
-to the DWARF specification, and it was felt that trying to specify multiple
-different *levels* of conformance would only complicate our discussions of
-this already divisive issue. Nonetheless, the GNU implementation of DWARF
-provides an abbreviated "traceback only" level of debug-info production for
-use with fully-debugged "system library" code. This level should only be
-used for fully debugged system library code, and even then, it should only
-be used where there is a very strong need to conserve disk space. This
-abbreviated level of debug-info production can be used by specifying the
--g1 option on the compilation command line.
-
---------------------------------
-
-As mentioned above, the GNU implementation of DWARF currently uses the DWARF
-version 2 (draft) approach for inline functions (and inlined instances
-thereof). This is used in preference to the version 1 approach because
-(quite simply) the version 1 approach is highly brain-damaged and probably
-unworkable.
-
---------------------------------
-
-
-GNU DWARF Representation of GNU C Extensions to ANSI C
-------------------------------------------------------
-
-The file dwarfout.c has been designed and implemented so as to provide
-some reasonable DWARF representation for each and every declarative
-construct which is accepted by the GNU C compiler. Since the GNU C
-compiler accepts a superset of ANSI C, this means that there are some
-cases in which the DWARF information produced by GCC must take some
-liberties in improvising DWARF representations for declarations which
-are only valid in (extended) GNU C.
-
-In particular, GNU C provides at least three significant extensions to
-ANSI C when it comes to declarations. These are (1) inline functions,
-and (2) dynamic arrays, and (3) incomplete enum types. (See the GCC
-manual for more information on these GNU extensions to ANSI C.) When
-used, these GNU C extensions are represented (in the generated DWARF
-output of GCC) in the most natural and intuitively obvious ways.
-
-In the case of inline functions, the DWARF representation is exactly as
-called for in the DWARF version 2 (draft) specification for an identical
-function written in C++; i.e. we "reuse" the representation of inline
-functions which has been defined for C++ to support this GNU C extension.
-
-In the case of dynamic arrays, we use the most obvious representational
-mechanism available; i.e. an array type in which the upper bound of
-some dimension (usually the first and only dimension) is a variable
-rather than a constant. (See the DWARF version 1 specification for more
-details.)
-
-In the case of incomplete enum types, such types are represented simply
-as TAG_enumeration_type DIEs which DO NOT contain either AT_byte_size
-attributes or AT_element_list attributes.
-
---------------------------------
-
-
-Future Directions
------------------
-
-The codes, formats, and other paraphernalia necessary to provide proper
-support for symbolic debugging for the C++ language are still being worked
-on by the UI/PLSIG. The vast majority of the additions to DWARF which will
-be needed to completely support C++ have already been hashed out and agreed
-upon, but a few small issues (e.g. anonymous unions, access declarations)
-are still being discussed. Also, we in the PLSIG are still discussing
-whether or not we need to do anything special for C++ templates. (At this
-time it is not yet clear whether we even need to do anything special for
-these.)
-
-Unfortunately, as mentioned above, there are quite a few problems in the
-g++ front end itself, and these are currently responsible for severely
-restricting the progress which can be made on adding DWARF support
-specifically for the g++ front-end. Furthermore, Richard Stallman has
-expressed the view that C++ friendships might not be important enough to
-describe (in DWARF). This view directly conflicts with both the DWARF
-version 1 and version 2 (draft) specifications, so until this small
-misunderstanding is cleared up, DWARF support for g++ is unlikely.
-
-With regard to FORTRAN, the UI/PLSIG has defined what is believed to be a
-complete and sufficient set of codes and rules for adequately representing
-all of FORTRAN 77, and most of Fortran 90 in DWARF. While some support for
-this has been implemented in dwarfout.c, further implementation and testing
-will have to await the arrival of the GNU Fortran front-end (which is
-currently in early alpha test as of this writing).
-
-GNU DWARF support for other languages (i.e. Pascal and Modula) is a moot
-issue until there are GNU front-ends for these other languages.
-
-GNU DWARF support for DWARF version 2 will probably not be attempted until
-such time as the version 2 specification is finalized. (More work needs
-to be done on the version 2 specification to make the new "abbreviations"
-feature of version 2 more easily implementable. Until then, it will be
-a royal pain the ass to implement version 2 "abbreviations".) For the
-time being, version 2 features will be added (in a version 1 compatible
-manner) when and where these features seem necessary or extremely desirable.
-
-As currently defined, DWARF only describes a (binary) language which can
-be used to communicate symbolic debugging information from a compiler
-through an assembler and a linker, to a debugger. There is no clear
-specification of what processing should be (or must be) done by the
-assembler and/or the linker. Fortunately, the role of the assembler
-is easily inferred (by anyone knowledgeable about assemblers) just by
-looking at examples of assembly-level DWARF code. Sadly though, the
-allowable (or required) processing steps performed by a linker are
-harder to infer and (perhaps) even harder to agree upon. There are
-several forms of very useful `post-processing' steps which intelligent
-linkers *could* (in theory) perform on object files containing DWARF,
-but any and all such link-time transformations are currently both disallowed
-and unspecified.
-
-In particular, possible link-time transformations of DWARF code which could
-provide significant benefits include (but are not limited to):
-
- Commonization of duplicate DIEs obtained from multiple input
- (object) files.
-
- Cross-compilation type checking based upon DWARF type information
- for objects and functions.
-
- Other possible `compacting' transformations designed to save disk
- space and to reduce linker & debugger I/O activity.
diff --git a/contrib/gcc/README.TRAD b/contrib/gcc/README.TRAD
deleted file mode 100644
index 07ccd16437b1..000000000000
--- a/contrib/gcc/README.TRAD
+++ /dev/null
@@ -1,55 +0,0 @@
-This is a partial list of how `gcc -traditional' disagrees with
-traditional C compilers (perhaps only some of them). Most of these
-differences are not bugs.
-
----------------------------------------------------------------------------
-K&R-1 (2.4.3) says:
-
- "If the character following a backslash is not one of those
- specified {in the table above}, the backslash is ignored."
-
-Up until recently, `gcc -traditional' complained about \x \a and \v
-appearing in a character or string literal. I believe however that
-this non-feature has been eliminated (recently).
-
----------------------------------------------------------------------------
-When in -traditional mode, gcc allows the following erroneous pair of
-declarations to appear together in a given scope:
-
- typedef int foo;
- typedef foo foo;
-
----------------------------------------------------------------------------
-K&R-1 (8.5) says:
-
- "No field may be wider than a word."
-
-Gcc however allows:
-
- struct S { int i:33; };
-
----------------------------------------------------------------------------
-In K&R-1 there is no restriction against comments crossing include file
-boundaries. Gcc however doesn't allow this, even when in -traditional mode.
-
----------------------------------------------------------------------------
-Regarding the length of identifiers, K&R-1 (2.2) says:
-
- "No more than the first eight characters are significant,
- although more may be used."
-
-Gcc treats all characters of identifiers as significant, even when in
--traditional mode.
-
----------------------------------------------------------------------------
-K&R-1 (2.2) says:
-
- "An identifier is a sequence of letters and digits; the first
- character must be a letter. The underscore _ counts as a letter."
-
-Gcc also allows dollar signs in identifiers. (This may also be an issue
-for the -pedantic option.)
-
----------------------------------------------------------------------------
-
-
diff --git a/contrib/gcc/TESTS.FLUNK b/contrib/gcc/TESTS.FLUNK
deleted file mode 100644
index 04641e3c8fb8..000000000000
--- a/contrib/gcc/TESTS.FLUNK
+++ /dev/null
@@ -1,39 +0,0 @@
-This is a collection of things that test suites have
-said were "wrong" with GCC--but that I don't agree with.
-
-First, test suites sometimes test for compatibility with
-traditional C. GCC with -traditional is not completely
-compatible with traditional C, and in some ways I think it
-should not be.
-
-* K&R C allowed \x to appear in a string literal (or character
-literal?) even in cases where it is *not* followed by a sequence of
-hex digits. I'm not convinced this is desirable.
-
-* K&R compilers allow comments to cross over an inclusion boundary (i.e.
-started in an include file and ended in the including file).
-I think this would be quite ugly and can't imagine it could
-be needed.
-
-Sometimes tests disagree with GCC's interpretation of the ANSI standard.
-
-* One test claims that this function should return 1.
-
- enum {A, B} foo;
-
- func (enum {B, A} arg)
- {
- return B;
- }
-
-I think it should return 0, because the definition of B that
-applies is the one in func.
-
-* Some tests report failure when the compiler does not produce
-an error message for a certain program.
-
-ANSI C requires a "diagnostic" message for certain kinds of invalid
-programs, but a warning counts as a diagnostic. If GCC produces
-a warning but not an error, that is correct ANSI support.
-When test suites call this "failure", the tests are broken.
-
diff --git a/contrib/gcc/ansidecl.h b/contrib/gcc/ansidecl.h
deleted file mode 100644
index cdb9fb71961e..000000000000
--- a/contrib/gcc/ansidecl.h
+++ /dev/null
@@ -1,163 +0,0 @@
-/* ANSI and traditional C compatability macros
- Copyright 1991, 1992, 1996 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
-This program 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 of the License, or
-(at your option) any later version.
-
-This program 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 program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-/* ANSI and traditional C compatibility macros
-
- ANSI C is assumed if __STDC__ is #defined.
-
- Macro ANSI C definition Traditional C definition
- ----- ---- - ---------- ----------- - ----------
- PTR `void *' `char *'
- LONG_DOUBLE `long double' `double'
- VOLATILE `volatile' `'
- SIGNED `signed' `'
- PTRCONST `void *const' `char *'
- ANSI_PROTOTYPES 1 not defined
-
- CONST is also defined, but is obsolete. Just use const.
-
- obsolete -- DEFUN (name, arglist, args)
-
- Defines function NAME.
-
- ARGLIST lists the arguments, separated by commas and enclosed in
- parentheses. ARGLIST becomes the argument list in traditional C.
-
- ARGS list the arguments with their types. It becomes a prototype in
- ANSI C, and the type declarations in traditional C. Arguments should
- be separated with `AND'. For functions with a variable number of
- arguments, the last thing listed should be `DOTS'.
-
- obsolete -- DEFUN_VOID (name)
-
- Defines a function NAME, which takes no arguments.
-
- obsolete -- EXFUN (name, (prototype)) -- obsolete.
-
- Replaced by PARAMS. Do not use; will disappear someday soon.
- Was used in external function declarations.
- In ANSI C it is `NAME PROTOTYPE' (so PROTOTYPE should be enclosed in
- parentheses). In traditional C it is `NAME()'.
- For a function that takes no arguments, PROTOTYPE should be `(void)'.
-
- obsolete -- PROTO (type, name, (prototype) -- obsolete.
-
- This one has also been replaced by PARAMS. Do not use.
-
- PARAMS ((args))
-
- We could use the EXFUN macro to handle prototype declarations, but
- the name is misleading and the result is ugly. So we just define a
- simple macro to handle the parameter lists, as in:
-
- static int foo PARAMS ((int, char));
-
- This produces: `static int foo();' or `static int foo (int, char);'
-
- EXFUN would have done it like this:
-
- static int EXFUN (foo, (int, char));
-
- but the function is not external...and it's hard to visually parse
- the function name out of the mess. EXFUN should be considered
- obsolete; new code should be written to use PARAMS.
-
- DOTS is also obsolete.
-
- Examples:
-
- extern int printf PARAMS ((const char *format, ...));
-*/
-
-#ifndef _ANSIDECL_H
-
-#define _ANSIDECL_H 1
-
-
-/* Every source file includes this file,
- so they will all get the switch for lint. */
-/* LINTLIBRARY */
-
-
-#if defined (__STDC__) || defined (_AIX) || (defined (__mips) && defined (_SYSTYPE_SVR4)) || defined(_WIN32)
-/* 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 PTR void *
-#define PTRCONST void *CONST
-#define LONG_DOUBLE long double
-
-#ifndef IN_GCC
-#define AND ,
-#define NOARGS void
-#define VOLATILE volatile
-#define SIGNED signed
-#endif /* ! IN_GCC */
-
-#define PARAMS(paramlist) paramlist
-#define ANSI_PROTOTYPES 1
-
-#define VPARAMS(ARGS) ARGS
-#define VA_START(va_list,var) va_start(va_list,var)
-
-/* These are obsolete. Do not use. */
-#ifndef IN_GCC
-#define CONST const
-#define DOTS , ...
-#define PROTO(type, name, arglist) type name arglist
-#define EXFUN(name, proto) name proto
-#define DEFUN(name, arglist, args) name(args)
-#define DEFUN_VOID(name) name(void)
-#endif /* ! IN_GCC */
-
-#else /* Not ANSI C. */
-
-#define PTR char *
-#define PTRCONST PTR
-#define LONG_DOUBLE double
-
-#ifndef IN_GCC
-#define AND ;
-#define NOARGS
-#define VOLATILE
-#define SIGNED
-#endif /* !IN_GCC */
-
-#ifndef const /* some systems define it in header files for non-ansi mode */
-#define const
-#endif
-
-#define PARAMS(paramlist) ()
-
-#define VPARAMS(ARGS) (va_alist) va_dcl
-#define VA_START(va_list,var) va_start(va_list)
-
-/* These are obsolete. Do not use. */
-#ifndef IN_GCC
-#define CONST
-#define DOTS
-#define PROTO(type, name, arglist) type name ()
-#define EXFUN(name, proto) name()
-#define DEFUN(name, arglist, args) name arglist args;
-#define DEFUN_VOID(name) name()
-#endif /* ! IN_GCC */
-
-#endif /* ANSI C. */
-
-#endif /* ansidecl.h */
diff --git a/contrib/gcc/assert.h b/contrib/gcc/assert.h
deleted file mode 100644
index ecc02ee99912..000000000000
--- a/contrib/gcc/assert.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/* Allow this file to be included multiple times
- with different settings of NDEBUG. */
-#undef assert
-#undef __assert
-
-#ifdef NDEBUG
-#define assert(ignore) ((void) 0)
-#else
-
-#ifndef __GNUC__
-
-#define assert(expression) \
- ((void) ((expression) ? 0 : __assert (expression, __FILE__, __LINE__)))
-
-#define __assert(expression, file, lineno) \
- (printf ("%s:%u: failed assertion\n", file, lineno), \
- abort (), 0)
-
-#else
-
-#if defined(__STDC__) || defined (__cplusplus)
-
-/* Defined in libgcc.a */
-#ifdef __cplusplus
-extern "C" {
-extern void __eprintf (const char *, const char *, unsigned, const char *)
- __attribute__ ((noreturn));
-}
-#else
-extern void __eprintf (const char *, const char *, unsigned, const char *)
- __attribute__ ((noreturn));
-#endif
-
-#define assert(expression) \
- ((void) ((expression) ? 0 : __assert (#expression, __FILE__, __LINE__)))
-
-#define __assert(expression, file, line) \
- (__eprintf ("%s:%u: failed assertion `%s'\n", \
- file, line, expression), 0)
-
-#else /* no __STDC__ and not C++; i.e. -traditional. */
-
-extern void __eprintf () __attribute__ ((noreturn)); /* Defined in libgcc.a */
-
-#define assert(expression) \
- ((void) ((expression) ? 0 : __assert (expression, __FILE__, __LINE__)))
-
-#define __assert(expression, file, lineno) \
- (__eprintf ("%s:%u: failed assertion `%s'\n", \
- file, lineno, "expression"), 0)
-
-#endif /* no __STDC__ and not C++; i.e. -traditional. */
-#endif /* no __GNU__; i.e., /bin/cc. */
-#endif
diff --git a/contrib/gcc/build-make b/contrib/gcc/build-make
deleted file mode 100644
index f9049ae0db96..000000000000
--- a/contrib/gcc/build-make
+++ /dev/null
@@ -1,35 +0,0 @@
-# We have to use the cross-compiler we just built to compile it.
-CC = gcc -b $(host)
-
-# Need those to compile binaries running on host machine.
-# It is configured by
-#
-# configure --host=target_cpu-target_os \
-# --target=host=target_cpu-target_os --build=host_cpu-host_os
-#
-# That HOST stuff has to be taken care of very carefully.
-HOST_PREFIX=l-
-HOST_PREFIX_1=$(HOST_PREFIX)
-HOST_CC=$(CC) -b $(build)
-HOST_CFLAGS=$(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS) $(XCFLAGS)
-HOST_CLIB=
-HOST_LDFLAGS=$(LDFLAGS)
-HOST_CPPFLAGS=$(ALL_CPPFLAGS)
-HOST_ALLOCA=$(ALLOCA)
-HOST_MALLOC=$(MALLOC)
-HOST_OBSTACK=$(OBSTACK)
-
-# To build the native compiler with the cross compiler, the headers
-# for the target are already fixed. And /usr/include is for host, not
-# target.
-FIXINCLUDES=Makefile.in
-
-# Don't run fixproto either
-STMP_FIXPROTO =
-
-# Cause installation using install-build. We do nothing here.
-#INSTALL_TARGET = install-build
-
-# Don't try to compile the things we can't compile or we have made
-# while making gcc with the cross-compiler.
-#ALL = all.build
diff --git a/contrib/gcc/c-iterate.c b/contrib/gcc/c-iterate.c
deleted file mode 100644
index dc0cc8a84af4..000000000000
--- a/contrib/gcc/c-iterate.c
+++ /dev/null
@@ -1,604 +0,0 @@
-/* Build expressions with type checking for C compiler.
- Copyright (C) 1987, 88, 89, 92, 93, 96, 1997, 1998 Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-
-/* This file is part of the C front end.
- It is responsible for implementing iterators,
- both their declarations and the expansion of statements using them. */
-
-#include "config.h"
-#include "system.h"
-#include "tree.h"
-#include "c-tree.h"
-#include "flags.h"
-#include "obstack.h"
-#include "rtl.h"
-#include "toplev.h"
-#include "expr.h"
-
-/*
- KEEPING TRACK OF EXPANSIONS
-
- In order to clean out expansions corresponding to statements inside
- "{(...)}" constructs we have to keep track of all expansions. The
- cleanup is needed when an automatic, or implicit, expansion on
- iterator, say X, happens to a statement which contains a {(...)}
- form with a statement already expanded on X. In this case we have
- to go back and cleanup the inner expansion. This can be further
- complicated by the fact that {(...)} can be nested.
-
- To make this cleanup possible, we keep lists of all expansions, and
- to make it work for nested constructs, we keep a stack. The list at
- the top of the stack (ITER_STACK.CURRENT_LEVEL) corresponds to the
- currently parsed level. All expansions of the levels below the
- current one are kept in one list whose head is pointed to by
- ITER_STACK.SUBLEVEL_FIRST (SUBLEVEL_LAST is there for making merges
- easy). The process works as follows:
-
- -- On "({" a new node is added to the stack by PUSH_ITERATOR_STACK.
- The sublevel list is not changed at this point.
-
- -- On "})" the list for the current level is appended to the sublevel
- list.
-
- -- On ";" sublevel lists are appended to the current level lists.
- The reason is this: if they have not been superseded by the
- expansion at the current level, they still might be
- superseded later by the expansion on the higher level.
- The levels do not have to distinguish levels below, so we
- can merge the lists together. */
-
-struct ixpansion
-{
- tree ixdecl; /* Iterator decl */
- rtx ixprologue_start; /* First insn of epilogue. NULL means */
- /* explicit (FOR) expansion*/
- rtx ixprologue_end;
- rtx ixepilogue_start;
- rtx ixepilogue_end;
- struct ixpansion *next; /* Next in the list */
-};
-
-struct iter_stack_node
-{
- struct ixpansion *first; /* Head of list of ixpansions */
- struct ixpansion *last; /* Last node in list of ixpansions */
- struct iter_stack_node *next; /* Next level iterator stack node */
-};
-
-struct iter_stack_node *iter_stack;
-struct iter_stack_node sublevel_ixpansions;
-
-/* A special obstack, and a pointer to the start of
- all the data in it (so we can free everything easily). */
-static struct obstack ixp_obstack;
-static char *ixp_firstobj;
-
-/* During collect_iterators, a list of SAVE_EXPRs already scanned. */
-static tree save_exprs;
-
-static void expand_stmt_with_iterators_1 PROTO((tree, tree));
-static tree collect_iterators PROTO((tree, tree));
-static void iterator_loop_prologue PROTO((tree, rtx *, rtx *));
-static void iterator_loop_epilogue PROTO((tree, rtx *, rtx *));
-static int top_level_ixpansion_p PROTO((void));
-static void isn_append PROTO((struct iter_stack_node *,
- struct iter_stack_node *));
-static void istack_sublevel_to_current PROTO((void));
-static void add_ixpansion PROTO((tree, rtx, rtx, rtx, rtx));
-static void delete_ixpansion PROTO((tree));
-
-/* Initialize our obstack once per compilation. */
-
-void
-init_iterators ()
-{
- gcc_obstack_init (&ixp_obstack);
- ixp_firstobj = (char *) obstack_alloc (&ixp_obstack, 0);
-}
-
-/* Handle the start of an explicit `for' loop for iterator IDECL. */
-
-void
-iterator_for_loop_start (idecl)
- tree idecl;
-{
- ITERATOR_BOUND_P (idecl) = 1;
- add_ixpansion (idecl, 0, 0, 0, 0);
- iterator_loop_prologue (idecl, 0, 0);
-}
-
-/* Handle the end of an explicit `for' loop for iterator IDECL. */
-
-void
-iterator_for_loop_end (idecl)
- tree idecl;
-{
- iterator_loop_epilogue (idecl, 0, 0);
- ITERATOR_BOUND_P (idecl) = 0;
-}
-
-/*
- ITERATOR RTL EXPANSIONS
-
- Expanding simple statements with iterators is straightforward:
- collect the list of all free iterators in the statement, and
- generate a loop for each of them.
-
- An iterator is "free" if it has not been "bound" by a FOR
- operator. The DECL_RTL of the iterator is the loop counter. */
-
-/* Expand a statement STMT, possibly containing iterator usage, into RTL. */
-
-void
-iterator_expand (stmt)
- tree stmt;
-{
- tree iter_list;
- save_exprs = NULL_TREE;
- iter_list = collect_iterators (stmt, NULL_TREE);
- expand_stmt_with_iterators_1 (stmt, iter_list);
- istack_sublevel_to_current ();
-}
-
-
-static void
-expand_stmt_with_iterators_1 (stmt, iter_list)
- tree stmt, iter_list;
-{
- if (iter_list == 0)
- expand_expr_stmt (stmt);
- else
- {
- tree current_iterator = TREE_VALUE (iter_list);
- tree iter_list_tail = TREE_CHAIN (iter_list);
- rtx p_start, p_end, e_start, e_end;
-
- iterator_loop_prologue (current_iterator, &p_start, &p_end);
- expand_stmt_with_iterators_1 (stmt, iter_list_tail);
- iterator_loop_epilogue (current_iterator, &e_start, &e_end);
-
- /** Delete all inner expansions based on current_iterator **/
- /** before adding the outer one. **/
-
- delete_ixpansion (current_iterator);
- add_ixpansion (current_iterator, p_start, p_end, e_start, e_end);
- }
-}
-
-
-/* Return a list containing all the free (i.e. not bound by a
- containing `for' statement) iterators mentioned in EXP, plus those
- in LIST. Do not add duplicate entries to the list. */
-
-static tree
-collect_iterators (exp, list)
- tree exp, list;
-{
- if (exp == 0) return list;
-
- switch (TREE_CODE (exp))
- {
- case VAR_DECL:
- if (! ITERATOR_P (exp) || ITERATOR_BOUND_P (exp))
- return list;
- if (value_member (exp, list))
- return list;
- return tree_cons (NULL_TREE, exp, list);
-
- case TREE_LIST:
- {
- tree tail;
- for (tail = exp; tail; tail = TREE_CHAIN (tail))
- list = collect_iterators (TREE_VALUE (tail), list);
- return list;
- }
-
- case SAVE_EXPR:
- /* In each scan, scan a given save_expr only once. */
- if (value_member (exp, save_exprs))
- return list;
-
- save_exprs = tree_cons (NULL_TREE, exp, save_exprs);
- return collect_iterators (TREE_OPERAND (exp, 0), list);
-
- /* we do not automatically iterate blocks -- one must */
- /* use the FOR construct to do that */
-
- case BLOCK:
- return list;
-
- default:
- switch (TREE_CODE_CLASS (TREE_CODE (exp)))
- {
- case '1':
- return collect_iterators (TREE_OPERAND (exp, 0), list);
-
- case '2':
- case '<':
- return collect_iterators (TREE_OPERAND (exp, 0),
- collect_iterators (TREE_OPERAND (exp, 1),
- list));
-
- case 'e':
- case 'r':
- {
- int num_args = tree_code_length[(int) TREE_CODE (exp)];
- int i;
-
- /* Some tree codes have RTL, not trees, as operands. */
- switch (TREE_CODE (exp))
- {
- case CALL_EXPR:
- num_args = 2;
- break;
- case METHOD_CALL_EXPR:
- num_args = 3;
- break;
- case WITH_CLEANUP_EXPR:
- num_args = 1;
- break;
- case RTL_EXPR:
- return list;
- default:
- break;
- }
-
- for (i = 0; i < num_args; i++)
- list = collect_iterators (TREE_OPERAND (exp, i), list);
- return list;
- }
- default:
- return list;
- }
- }
-}
-
-/* Emit rtl for the start of a loop for iterator IDECL.
-
- If necessary, create loop counter rtx and store it as DECL_RTL of IDECL.
-
- The prologue normally starts and ends with notes, which are returned
- by this function in *START_NOTE and *END_NODE.
- If START_NOTE and END_NODE are 0, we don't make those notes. */
-
-static void
-iterator_loop_prologue (idecl, start_note, end_note)
- tree idecl;
- rtx *start_note, *end_note;
-{
- tree expr;
-
- /* Force the save_expr in DECL_INITIAL to be calculated
- if it hasn't been calculated yet. */
- expand_expr (DECL_INITIAL (idecl), const0_rtx, VOIDmode,
- EXPAND_NORMAL);
-
- if (DECL_RTL (idecl) == 0)
- expand_decl (idecl);
-
- if (start_note)
- *start_note = emit_note (0, NOTE_INSN_DELETED);
-
- /* Initialize counter. */
- expr = build (MODIFY_EXPR, TREE_TYPE (idecl), idecl, integer_zero_node);
- TREE_SIDE_EFFECTS (expr) = 1;
- expand_expr (expr, const0_rtx, VOIDmode, EXPAND_NORMAL);
-
- expand_start_loop_continue_elsewhere (1);
-
- ITERATOR_BOUND_P (idecl) = 1;
-
- if (end_note)
- *end_note = emit_note (0, NOTE_INSN_DELETED);
-}
-
-/* Similar to the previous function, but for the end of the loop.
-
- DECL_RTL is zeroed unless we are inside "({...})". The reason for that is
- described below.
-
- When we create two (or more) loops based on the same IDECL, and
- both inside the same "({...})" construct, we must be prepared to
- delete both of the loops and create a single one on the level
- above, i.e. enclosing the "({...})". The new loop has to use the
- same counter rtl because the references to the iterator decl
- (IDECL) have already been expanded as references to the counter
- rtl.
-
- It is incorrect to use the same counter reg in different functions,
- and it is desirable to use different counters in disjoint loops
- when we know there's no need to combine them (because then they can
- get allocated separately). */
-
-static void
-iterator_loop_epilogue (idecl, start_note, end_note)
- tree idecl;
- rtx *start_note, *end_note;
-{
- tree test, incr;
-
- if (start_note)
- *start_note = emit_note (0, NOTE_INSN_DELETED);
- expand_loop_continue_here ();
- incr = build_binary_op (PLUS_EXPR, idecl, integer_one_node, 0);
- incr = build (MODIFY_EXPR, TREE_TYPE (idecl), idecl, incr);
- TREE_SIDE_EFFECTS (incr) = 1;
- expand_expr (incr, const0_rtx, VOIDmode, EXPAND_NORMAL);
- test = build_binary_op (LT_EXPR, idecl, DECL_INITIAL (idecl), 0);
- expand_exit_loop_if_false (0, test);
- expand_end_loop ();
-
- ITERATOR_BOUND_P (idecl) = 0;
- /* we can reset rtl since there is not chance that this expansion */
- /* would be superseded by a higher level one */
- /* but don't do this if the decl is static, since we need to share */
- /* the same decl in that case. */
- if (top_level_ixpansion_p () && ! TREE_STATIC (idecl))
- DECL_RTL (idecl) = 0;
- if (end_note)
- *end_note = emit_note (0, NOTE_INSN_DELETED);
-}
-
-/* Return true if we are not currently inside a "({...})" construct. */
-
-static int
-top_level_ixpansion_p ()
-{
- return iter_stack == 0;
-}
-
-/* Given two chains of iter_stack_nodes,
- append the nodes in X into Y. */
-
-static void
-isn_append (x, y)
- struct iter_stack_node *x, *y;
-{
- if (x->first == 0)
- return;
-
- if (y->first == 0)
- {
- y->first = x->first;
- y->last = x->last;
- }
- else
- {
- y->last->next = x->first;
- y->last = x->last;
- }
-}
-
-/** Make X empty **/
-
-#define ISN_ZERO(X) (X).first=(X).last=0
-
-/* Move the ixpansions in sublevel_ixpansions into the current
- node on the iter_stack, or discard them if the iter_stack is empty.
- We do this at the end of a statement. */
-
-static void
-istack_sublevel_to_current ()
-{
- /* At the top level we can throw away sublevel's expansions **/
- /* because there is nobody above us to ask for a cleanup **/
- if (iter_stack != 0)
- /** Merging with empty sublevel list is a no-op **/
- if (sublevel_ixpansions.last)
- isn_append (&sublevel_ixpansions, iter_stack);
-
- if (iter_stack == 0)
- obstack_free (&ixp_obstack, ixp_firstobj);
-
- ISN_ZERO (sublevel_ixpansions);
-}
-
-/* Push a new node on the iter_stack, when we enter a ({...}). */
-
-void
-push_iterator_stack ()
-{
- struct iter_stack_node *new_top
- = (struct iter_stack_node *)
- obstack_alloc (&ixp_obstack, sizeof (struct iter_stack_node));
-
- new_top->first = 0;
- new_top->last = 0;
- new_top->next = iter_stack;
- iter_stack = new_top;
-}
-
-/* Pop iter_stack, moving the ixpansions in the node being popped
- into sublevel_ixpansions. */
-
-void
-pop_iterator_stack ()
-{
- if (iter_stack == 0)
- abort ();
-
- isn_append (iter_stack, &sublevel_ixpansions);
- /** Pop current level node: */
- iter_stack = iter_stack->next;
-}
-
-
-/* Record an iterator expansion ("ixpansion") for IDECL.
- The remaining parameters are the notes in the loop entry
- and exit rtl. */
-
-static void
-add_ixpansion (idecl, pro_start, pro_end, epi_start, epi_end)
- tree idecl;
- rtx pro_start, pro_end, epi_start, epi_end;
-{
- struct ixpansion *newix;
-
- /* Do nothing if we are not inside "({...})",
- as in that case this expansion can't need subsequent RTL modification. */
- if (iter_stack == 0)
- return;
-
- newix = (struct ixpansion *) obstack_alloc (&ixp_obstack,
- sizeof (struct ixpansion));
- newix->ixdecl = idecl;
- newix->ixprologue_start = pro_start;
- newix->ixprologue_end = pro_end;
- newix->ixepilogue_start = epi_start;
- newix->ixepilogue_end = epi_end;
-
- newix->next = iter_stack->first;
- iter_stack->first = newix;
- if (iter_stack->last == 0)
- iter_stack->last = newix;
-}
-
-/* Delete the RTL for all ixpansions for iterator IDECL
- in our sublevels. We do this when we make a larger
- containing expansion for IDECL. */
-
-static void
-delete_ixpansion (idecl)
- tree idecl;
-{
- struct ixpansion *previx = 0, *ix;
-
- for (ix = sublevel_ixpansions.first; ix; ix = ix->next)
- if (ix->ixdecl == idecl)
- {
- /** zero means that this is a mark for FOR -- **/
- /** we do not delete anything, just issue an error. **/
-
- if (ix->ixprologue_start == 0)
- error_with_decl (idecl,
- "`for (%s)' appears within implicit iteration");
- else
- {
- rtx insn;
- /* We delete all insns, including notes because leaving loop */
- /* notes and barriers produced by iterator expansion would */
- /* be misleading to other phases */
-
- for (insn = NEXT_INSN (ix->ixprologue_start);
- insn != ix->ixprologue_end;
- insn = NEXT_INSN (insn))
- delete_insn (insn);
- for (insn = NEXT_INSN (ix->ixepilogue_start);
- insn != ix->ixepilogue_end;
- insn = NEXT_INSN (insn))
- delete_insn (insn);
- }
-
- /* Delete this ixpansion from sublevel_ixpansions. */
- if (previx)
- previx->next = ix->next;
- else
- sublevel_ixpansions.first = ix->next;
- if (sublevel_ixpansions.last == ix)
- sublevel_ixpansions.last = previx;
- }
- else
- previx = ix;
-}
-
-#ifdef DEBUG_ITERATORS
-
-/* The functions below are for use from source level debugger.
- They print short forms of iterator lists and the iterator stack. */
-
-/* Print the name of the iterator D. */
-
-void
-prdecl (d)
- tree d;
-{
- if (d)
- {
- if (TREE_CODE (d) == VAR_DECL)
- {
- tree tname = DECL_NAME (d);
- char *dname = IDENTIFIER_POINTER (tname);
- fprintf (stderr, dname);
- }
- else
- fprintf (stderr, "<<?>>");
- }
- else
- fprintf (stderr, "<<0>>");
-}
-
-/* Print Iterator List -- names only */
-
-tree
-pil (head)
- tree head;
-{
- tree current, next;
- for (current = head; current; current = next)
- {
- tree node = TREE_VALUE (current);
- prdecl (node);
- next = TREE_CHAIN (current);
- if (next) fprintf (stderr, ",");
- }
- fprintf (stderr, "\n");
-}
-
-/* Print IXpansion List */
-
-struct ixpansion *
-pixl (head)
- struct ixpansion *head;
-{
- struct ixpansion *current, *next;
- fprintf (stderr, "> ");
- if (head == 0)
- fprintf (stderr, "(empty)");
-
- for (current=head; current; current = next)
- {
- tree node = current->ixdecl;
- prdecl (node);
- next = current->next;
- if (next)
- fprintf (stderr, ",");
- }
- fprintf (stderr, "\n");
- return head;
-}
-
-/* Print Iterator Stack. */
-
-void
-pis ()
-{
- struct iter_stack_node *stack_node;
-
- fprintf (stderr, "--SubLevel: ");
- pixl (sublevel_ixpansions.first);
- fprintf (stderr, "--Stack:--\n");
- for (stack_node = iter_stack;
- stack_node;
- stack_node = stack_node->next)
- pixl (stack_node->first);
-}
-
-#endif /* DEBUG_ITERATORS */
diff --git a/contrib/gcc/c-parse.gperf b/contrib/gcc/c-parse.gperf
deleted file mode 100644
index 888eee9ebe1f..000000000000
--- a/contrib/gcc/c-parse.gperf
+++ /dev/null
@@ -1,88 +0,0 @@
-%{
-/* Command-line: gperf -L KR-C -F ', 0, 0' -p -j1 -i 1 -g -o -t -N is_reserved_word -k1,3,$ c-parse.gperf */
-%}
-struct resword { const char *name; short token; enum rid rid; };
-%%
-@class, CLASS, NORID
-@compatibility_alias, ALIAS, NORID
-@defs, DEFS, NORID
-@encode, ENCODE, NORID
-@end, END, NORID
-@implementation, IMPLEMENTATION, NORID
-@interface, INTERFACE, NORID
-@private, PRIVATE, NORID
-@protected, PROTECTED, NORID
-@protocol, PROTOCOL, NORID
-@public, PUBLIC, NORID
-@selector, SELECTOR, NORID
-__alignof, ALIGNOF, NORID
-__alignof__, ALIGNOF, NORID
-__asm, ASM_KEYWORD, NORID
-__asm__, ASM_KEYWORD, NORID
-__attribute, ATTRIBUTE, NORID
-__attribute__, ATTRIBUTE, NORID
-__complex, TYPESPEC, RID_COMPLEX
-__complex__, TYPESPEC, RID_COMPLEX
-__const, TYPE_QUAL, RID_CONST
-__const__, TYPE_QUAL, RID_CONST
-__extension__, EXTENSION, NORID
-__imag, IMAGPART, NORID
-__imag__, IMAGPART, NORID
-__inline, SCSPEC, RID_INLINE
-__inline__, SCSPEC, RID_INLINE
-__iterator, SCSPEC, RID_ITERATOR
-__iterator__, SCSPEC, RID_ITERATOR
-__label__, LABEL, NORID
-__real, REALPART, NORID
-__real__, REALPART, NORID
-__restrict, TYPE_QUAL, RID_RESTRICT
-__restrict__, TYPE_QUAL, RID_RESTRICT
-__signed, TYPESPEC, RID_SIGNED
-__signed__, TYPESPEC, RID_SIGNED
-__typeof, TYPEOF, NORID
-__typeof__, TYPEOF, NORID
-__volatile, TYPE_QUAL, RID_VOLATILE
-__volatile__, TYPE_QUAL, RID_VOLATILE
-asm, ASM_KEYWORD, NORID
-auto, SCSPEC, RID_AUTO
-break, BREAK, NORID
-bycopy, TYPE_QUAL, RID_BYCOPY
-byref, TYPE_QUAL, RID_BYREF
-case, CASE, NORID
-char, TYPESPEC, RID_CHAR
-const, TYPE_QUAL, RID_CONST
-continue, CONTINUE, NORID
-default, DEFAULT, NORID
-do, DO, NORID
-double, TYPESPEC, RID_DOUBLE
-else, ELSE, NORID
-enum, ENUM, NORID
-extern, SCSPEC, RID_EXTERN
-float, TYPESPEC, RID_FLOAT
-for, FOR, NORID
-goto, GOTO, NORID
-id, OBJECTNAME, RID_ID
-if, IF, NORID
-in, TYPE_QUAL, RID_IN
-inout, TYPE_QUAL, RID_INOUT
-inline, SCSPEC, RID_INLINE
-int, TYPESPEC, RID_INT
-long, TYPESPEC, RID_LONG
-oneway, TYPE_QUAL, RID_ONEWAY
-out, TYPE_QUAL, RID_OUT
-register, SCSPEC, RID_REGISTER
-restrict, TYPE_QUAL, RID_RESTRICT
-return, RETURN, NORID
-short, TYPESPEC, RID_SHORT
-signed, TYPESPEC, RID_SIGNED
-sizeof, SIZEOF, NORID
-static, SCSPEC, RID_STATIC
-struct, STRUCT, NORID
-switch, SWITCH, NORID
-typedef, SCSPEC, RID_TYPEDEF
-typeof, TYPEOF, NORID
-union, UNION, NORID
-unsigned, TYPESPEC, RID_UNSIGNED
-void, TYPESPEC, RID_VOID
-volatile, TYPE_QUAL, RID_VOLATILE
-while, WHILE, NORID
diff --git a/contrib/gcc/cccp.1 b/contrib/gcc/cccp.1
deleted file mode 100644
index 84eb19ede54e..000000000000
--- a/contrib/gcc/cccp.1
+++ /dev/null
@@ -1,674 +0,0 @@
-.\" Copyright (c) 1991, 1992, 1993 Free Software Foundation \-*-Text-*-
-.\" See section COPYING for conditions for redistribution
-.TH cpp 1 "30apr1993" "GNU Tools" "GNU Tools"
-.SH NAME
-cccp, cpp \- The GNU C-Compatible Compiler Preprocessor.
-.SH SYNOPSIS
-.hy 0
-.na
-.TP
-.B cccp
-.RB "[\|" \-$ "\|]"
-.RB "[\|" \-A \c
-.I predicate\c
-.RB [ (\c
-.I value\c
-.BR ) ]\|]
-.RB "[\|" \-C "\|]"
-.RB "[\|" \-D \c
-.I name\c
-.RB [ =\c
-.I definition\c
-\&]\|]
-.RB "[\|" \-dD "\|]"
-.RB "[\|" \-dM "\|]"
-.RB "[\|" "\-I\ "\c
-.I directory\c
-\&\|]
-.RB "[\|" \-H "\|]"
-.RB "[\|" \-I\- "\|]"
-.RB "[\|" "\-imacros\ "\c
-.I file\c
-\&\|]
-.RB "[\|" "\-include\ "\c
-.I file\c
-\&\|]
-.RB "[\|" "\-idirafter\ "\c
-.I dir\c
-\&\|]
-.RB "[\|" "\-iprefix\ "\c
-.I prefix\c
-\&\|]
-.RB "[\|" "\-iwithprefix\ "\c
-.I dir\c
-\&\|]
-.RB "[\|" \-lang\-c "\|]"
-.RB "[\|" \-lang\-c++ "\|]"
-.RB "[\|" \-lang\-objc "\|]"
-.RB "[\|" \-lang\-objc++ "\|]"
-.RB "[\|" \-lint "\|]"
-.RB "[\|" \-M\ [ \-MG "\|]]"
-.RB "[\|" \-MM\ [ \-MG "\|]]"
-.RB "[\|" \-MD\ \c
-.I file\ \c
-\&\|]
-.RB "[\|" \-MMD\ \c
-.I file\ \c
-\&\|]
-.RB "[\|" \-nostdinc "\|]"
-.RB "[\|" \-nostdinc++ "\|]"
-.RB "[\|" \-P "\|]"
-.RB "[\|" \-pedantic "\|]"
-.RB "[\|" \-pedantic\-errors "\|]"
-.RB "[\|" \-traditional "\|]"
-.RB "[\|" \-trigraphs "\|]"
-.RB "[\|" \-U \c
-.I name\c
-\&\|]
-.RB "[\|" \-undef "\|]"
-.RB "[\|" \-Wtrigraphs "\|]"
-.RB "[\|" \-Wcomment "\|]"
-.RB "[\|" \-Wall "\|]"
-.RB "[\|" \-Wtraditional "\|]"
-.br
-.RB "[\|" \c
-.I infile\c
-.RB | \- "\|]"
-.RB "[\|" \c
-.I outfile\c
-.RB | \- "\|]"
-.ad b
-.hy 1
-.SH DESCRIPTION
-The C preprocessor is a \c
-.I macro processor\c
-\& that is used automatically by
-the C compiler to transform your program before actual compilation. It is
-called a macro processor because it allows you to define \c
-.I macros\c
-\&,
-which are brief abbreviations for longer constructs.
-
-The C preprocessor provides four separate facilities that you can use as
-you see fit:
-.TP
-\(bu
-Inclusion of header files. These are files of declarations that can be
-substituted into your program.
-.TP
-\(bu
-Macro expansion. You can define \c
-.I macros\c
-\&, which are abbreviations
-for arbitrary fragments of C code, and then the C preprocessor will
-replace the macros with their definitions throughout the program.
-.TP
-\(bu
-Conditional compilation. Using special preprocessing directives, you
-can include or exclude parts of the program according to various
-conditions.
-.TP
-\(bu
-Line control. If you use a program to combine or rearrange source files into
-an intermediate file which is then compiled, you can use line control
-to inform the compiler of where each source line originally came from.
-.PP
-C preprocessors vary in some details. For a full explanation of the
-GNU C preprocessor, see the
-.B info
-file `\|\c
-.B cpp.info\c
-\&\|', or the manual
-.I The C Preprocessor\c
-\&. Both of these are built from the same documentation source file, `\|\c
-.B cpp.texinfo\c
-\&\|'. The GNU C
-preprocessor provides a superset of the features of ANSI Standard C.
-
-ANSI Standard C requires the rejection of many harmless constructs commonly
-used by today's C programs. Such incompatibility would be inconvenient for
-users, so the GNU C preprocessor is configured to accept these constructs
-by default. Strictly speaking, to get ANSI Standard C, you must use the
-options `\|\c
-.B \-trigraphs\c
-\&\|', `\|\c
-.B \-undef\c
-\&\|' and `\|\c
-.B \-pedantic\c
-\&\|', but in
-practice the consequences of having strict ANSI Standard C make it
-undesirable to do this.
-
-Most often when you use the C preprocessor you will not have to invoke it
-explicitly: the C compiler will do so automatically. However, the
-preprocessor is sometimes useful individually.
-
-When you call the preprocessor individually, either name
-(\c
-.B cpp\c
-\& or \c
-.B cccp\c
-\&) will do\(em\&they are completely synonymous.
-
-The C preprocessor expects two file names as arguments, \c
-.I infile\c
-\& and
-\c
-.I outfile\c
-\&. The preprocessor reads \c
-.I infile\c
-\& together with any other
-files it specifies with `\|\c
-.B #include\c
-\&\|'. All the output generated by the
-combined input files is written in \c
-.I outfile\c
-\&.
-
-Either \c
-.I infile\c
-\& or \c
-.I outfile\c
-\& may be `\|\c
-.B \-\c
-\&\|', which as \c
-.I infile\c
-\&
-means to read from standard input and as \c
-.I outfile\c
-\& means to write to
-standard output. Also, if \c
-.I outfile\c
-\& or both file names are omitted,
-the standard output and standard input are used for the omitted file names.
-.SH OPTIONS
-Here is a table of command options accepted by the C preprocessor.
-These options can also be given when compiling a C program; they are
-passed along automatically to the preprocessor when it is invoked by
-the compiler.
-.TP
-.B \-P
-Inhibit generation of `\|\c
-.B #\c
-\&\|'-lines with line-number information in
-the output from the preprocessor. This might be
-useful when running the preprocessor on something that is not C code
-and will be sent to a program which might be confused by the
-`\|\c
-.B #\c
-\&\|'-lines.
-.TP
-.B \-C
-Do not discard comments: pass them through to the output file.
-Comments appearing in arguments of a macro call will be copied to the
-output before the expansion of the macro call.
-.TP
-.B \-traditional
-Try to imitate the behavior of old-fashioned C, as opposed to ANSI C.
-.TP
-.B \-trigraphs
-Process ANSI standard trigraph sequences. These are three-character
-sequences, all starting with `\|\c
-.B ??\c
-\&\|', that are defined by ANSI C to
-stand for single characters. For example, `\|\c
-.B ??/\c
-\&\|' stands for
-`\|\c
-.BR "\e" "\|',"
-so `\|\c
-.B '??/n'\c
-\&\|' is a character constant for a newline.
-Strictly speaking, the GNU C preprocessor does not support all
-programs in ANSI Standard C unless `\|\c
-.B \-trigraphs\c
-\&\|' is used, but if
-you ever notice the difference it will be with relief.
-
-You don't want to know any more about trigraphs.
-.TP
-.B \-pedantic
-Issue warnings required by the ANSI C standard in certain cases such
-as when text other than a comment follows `\|\c
-.B #else\c
-\&\|' or `\|\c
-.B #endif\c
-\&\|'.
-.TP
-.B \-pedantic\-errors
-Like `\|\c
-.B \-pedantic\c
-\&\|', except that errors are produced rather than
-warnings.
-.TP
-.B \-Wtrigraphs
-Warn if any trigraphs are encountered (assuming they are enabled).
-.TP
-.B \-Wcomment
-.TP
-.B \-Wcomments
-Warn whenever a comment-start sequence `\|\c
-.B /*\c
-\&\|' appears in a comment.
-(Both forms have the same effect).
-.TP
-.B \-Wall
-Requests both `\|\c
-.B \-Wtrigraphs\c
-\&\|' and `\|\c
-.B \-Wcomment\c
-\&\|' (but not
-`\|\c
-.B \-Wtraditional\c
-\&\|').
-.TP
-.B \-Wtraditional
-Warn about certain constructs that behave differently in traditional and
-ANSI C.
-.TP
-.BI "\-I " directory\c
-\&
-Add the directory \c
-.I directory\c
-\& to the end of the list of
-directories to be searched for header files.
-This can be used to override a system header file, substituting your
-own version, since these directories are searched before the system
-header file directories. If you use more than one `\|\c
-.B \-I\c
-\&\|' option,
-the directories are scanned in left-to-right order; the standard
-system directories come after.
-.TP
-.B \-I\-
-Any directories specified with `\|\c
-.B \-I\c
-\&\|' options before the `\|\c
-.B \-I\-\c
-\&\|'
-option are searched only for the case of `\|\c
-.B #include "\c
-.I file\c
-\&"\c
-\&\|';
-they are not searched for `\|\c
-.B #include <\c
-.I file\c
-\&>\c
-\&\|'.
-
-If additional directories are specified with `\|\c
-.B \-I\c
-\&\|' options after
-the `\|\c
-.B \-I\-\c
-\&\|', these directories are searched for all `\|\c
-.B #include\c
-\&\|'
-directives.
-
-In addition, the `\|\c
-.B \-I\-\c
-\&\|' option inhibits the use of the current
-directory as the first search directory for `\|\c
-.B #include "\c
-.I file\c
-\&"\c
-\&\|'.
-Therefore, the current directory is searched only if it is requested
-explicitly with `\|\c
-.B \-I.\c
-\&\|'. Specifying both `\|\c
-.B \-I\-\c
-\&\|' and `\|\c
-.B \-I.\c
-\&\|'
-allows you to control precisely which directories are searched before
-the current one and which are searched after.
-.TP
-.B \-nostdinc
-Do not search the standard system directories for header files.
-Only the directories you have specified with `\|\c
-.B \-I\c
-\&\|' options
-(and the current directory, if appropriate) are searched.
-.TP
-.B \-nostdinc++
-Do not search for header files in the C++ specific standard
-directories, but do still search the other standard directories.
-(This option is used when building libg++.)
-.TP
-.BI "\-D " "name"\c
-\&
-Predefine \c
-.I name\c
-\& as a macro, with definition `\|\c
-.B 1\c
-\&\|'.
-.TP
-.BI "\-D " "name" = definition
-\&
-Predefine \c
-.I name\c
-\& as a macro, with definition \c
-.I definition\c
-\&.
-There are no restrictions on the contents of \c
-.I definition\c
-\&, but if
-you are invoking the preprocessor from a shell or shell-like program
-you may need to use the shell's quoting syntax to protect characters
-such as spaces that have a meaning in the shell syntax. If you use more than
-one `\|\c
-.B \-D\c
-\&\|' for the same
-.I name\c
-\&, the rightmost definition takes effect.
-.TP
-.BI "\-U " "name"\c
-\&
-Do not predefine \c
-.I name\c
-\&. If both `\|\c
-.B \-U\c
-\&\|' and `\|\c
-.B \-D\c
-\&\|' are
-specified for one name, the `\|\c
-.B \-U\c
-\&\|' beats the `\|\c
-.B \-D\c
-\&\|' and the name
-is not predefined.
-.TP
-.B \-undef
-Do not predefine any nonstandard macros.
-.TP
-.BI "\-A " "name(" value )
-Assert (in the same way as the \c
-.B #assert\c
-\& directive)
-the predicate \c
-.I name\c
-\& with tokenlist \c
-.I value\c
-\&. Remember to escape or quote the parentheses on
-shell command lines.
-
-You can use `\|\c
-.B \-A-\c
-\&\|' to disable all predefined assertions; it also
-undefines all predefined macros.
-.TP
-.B \-dM
-Instead of outputting the result of preprocessing, output a list of
-`\|\c
-.B #define\c
-\&\|' directives for all the macros defined during the
-execution of the preprocessor, including predefined macros. This gives
-you a way of finding out what is predefined in your version of the
-preprocessor; assuming you have no file `\|\c
-.B foo.h\c
-\&\|', the command
-.sp
-.br
-touch\ foo.h;\ cpp\ \-dM\ foo.h
-.br
-.sp
-will show the values of any predefined macros.
-.TP
-.B \-dD
-Like `\|\c
-.B \-dM\c
-\&\|' except in two respects: it does \c
-.I not\c
-\& include the
-predefined macros, and it outputs \c
-.I both\c
-\& the `\|\c
-.B #define\c
-\&\|'
-directives and the result of preprocessing. Both kinds of output go to
-the standard output file.
-.PP
-.TP
-.BR \-M\ [ \-MG ]
-Instead of outputting the result of preprocessing, output a rule
-suitable for \c
-.B make\c
-\& describing the dependencies of the main
-source file. The preprocessor outputs one \c
-.B make\c
-\& rule containing
-the object file name for that source file, a colon, and the names of
-all the included files. If there are many included files then the
-rule is split into several lines using `\|\c
-.B \\\\\c
-\&\|'-newline.
-
-`\|\c
-.B \-MG\c
-\&\|' says to treat missing header files as generated files and assume \c
-they live in the same directory as the source file. It must be specified \c
-in addition to `\|\c
-.B \-M\c
-\&\|'.
-
-This feature is used in automatic updating of makefiles.
-.TP
-.BR \-MM\ [ \-MG ]
-Like `\|\c
-.B \-M\c
-\&\|' but mention only the files included with `\|\c
-.B #include
-"\c
-.I file\c
-\&"\c
-\&\|'. System header files included with `\|\c
-.B #include
-<\c
-.I file\c
-\&>\c
-\&\|' are omitted.
-.TP
-.BI \-MD\ file
-Like `\|\c
-.B \-M\c
-\&\|' but the dependency information is written to `\|\c
-.I file\c
-\&\|'. This is in addition to compiling the file as
-specified\(em\&`\|\c
-.B \-MD\c
-\&\|' does not inhibit ordinary compilation the way
-`\|\c
-.B \-M\c
-\&\|' does.
-
-When invoking gcc, do not specify the `\|\c
-.I file\c
-\&\|' argument. Gcc will create file names made by replacing `\|\c
-.B .c\c
-\&\|' with `\|\c
-.B .d\c
-\&\|' at the end of the input file names.
-
-In Mach, you can use the utility \c
-.B md\c
-\& to merge multiple files
-into a single dependency file suitable for using with the `\|\c
-.B make\c
-\&\|'
-command.
-.TP
-.BI \-MMD\ file
-Like `\|\c
-.B \-MD\c
-\&\|' except mention only user header files, not system
-header files.
-.TP
-.B \-H
-Print the name of each header file used, in addition to other normal
-activities.
-.TP
-.BI "\-imacros " "file"\c
-\&
-Process \c
-.I file\c
-\& as input, discarding the resulting output, before
-processing the regular input file. Because the output generated from
-\c
-.I file\c
-\& is discarded, the only effect of `\|\c
-.B \-imacros \c
-.I file\c
-\&\c
-\&\|' is to
-make the macros defined in \c
-.I file\c
-\& available for use in the main
-input. The preprocessor evaluates any `\|\c
-.B \-D\c
-\&\|' and `\|\c
-.B \-U\c
-\&\|' options
-on the command line before processing `\|\c
-.B \-imacros \c
-.I file\c
-\&\|' \c
-\&.
-.TP
-.BI "\-include " "file"
-Process
-.I file
-as input, and include all the resulting output,
-before processing the regular input file.
-.TP
-.BI "-idirafter " "dir"\c
-\&
-Add the directory \c
-.I dir\c
-\& to the second include path. The directories
-on the second include path are searched when a header file is not found
-in any of the directories in the main include path (the one that
-`\|\c
-.B \-I\c
-\&\|' adds to).
-.TP
-.BI "-iprefix " "prefix"\c
-\&
-Specify \c
-.I prefix\c
-\& as the prefix for subsequent `\|\c
-.B \-iwithprefix\c
-\&\|'
-options.
-.TP
-.BI "-iwithprefix " "dir"\c
-\&
-Add a directory to the second include path. The directory's name is
-made by concatenating \c
-.I prefix\c
-\& and \c
-.I dir\c
-\&, where \c
-.I prefix\c
-\&
-was specified previously with `\|\c
-.B \-iprefix\c
-\&\|'.
-.TP
-.B \-lang-c
-.TP
-.B \-lang-c++
-.TP
-.B \-lang-objc
-.TP
-.B \-lang-objc++
-Specify the source language. `\|\c
-.B \-lang-c++\c
-\&\|' makes the preprocessor
-handle C++ comment syntax, and includes extra default include
-directories for C++, and `\|\c
-.B \-lang-objc\c
-\&\|' enables the Objective C
-`\|\c
-.B #import\c
-\&\|' directive. `\|\c
-.B \-lang-c\c
-\&\|' explicitly turns off both of
-these extensions, and `\|\c
-.B \-lang-objc++\c
-\&\|' enables both.
-
-These options are generated by the compiler driver \c
-.B gcc\c
-\&, but not
-passed from the `\|\c
-.B gcc\c
-\&\|' command line.
-.TP
-.B \-lint
-Look for commands to the program checker \c
-.B lint\c
-\& embedded in
-comments, and emit them preceded by `\|\c
-.B #pragma lint\c
-\&\|'. For example,
-the comment `\|\c
-.B /* NOTREACHED */\c
-\&\|' becomes `\|\c
-.B #pragma lint
-NOTREACHED\c
-\&\|'.
-
-This option is available only when you call \c
-.B cpp\c
-\& directly;
-\c
-.B gcc\c
-\& will not pass it from its command line.
-.TP
-.B \-$
-Forbid the use of `\|\c
-.B $\c
-\&\|' in identifiers. This was formerly required for strict conformance
-to the C Standard before the standard was corrected. \c
-
-This option is available only when you call \c
-.B cpp\c
-\& directly;
-.B gcc\c
-\& will not pass it from its command line.
-.SH "SEE ALSO"
-.RB "`\|" Cpp "\|'"
-entry in
-.B info\c
-\&;
-.I The C Preprocessor\c
-, Richard M. Stallman.
-.br
-.BR gcc "(" 1 ");"
-.RB "`\|" Gcc "\|'"
-entry in
-.B info\c
-\&;
-.I
-Using and Porting GNU CC (for version 2.0)\c
-, Richard M. Stallman.
-.SH COPYING
-Copyright (c) 1991, 1992, 1993 Free Software Foundation, Inc.
-.PP
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-.PP
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided that the
-entire resulting derived work is distributed under the terms of a
-permission notice identical to this one.
-.PP
-Permission is granted to copy and distribute translations of this
-manual into another language, under the above conditions for modified
-versions, except that this permission notice may be included in
-translations approved by the Free Software Foundation instead of in
-the original English.
diff --git a/contrib/gcc/cccp.c b/contrib/gcc/cccp.c
deleted file mode 100644
index 023502fbde41..000000000000
--- a/contrib/gcc/cccp.c
+++ /dev/null
@@ -1,11136 +0,0 @@
-/* C Compatible Compiler Preprocessor (CCCP)
- Copyright (C) 1986, 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000 Free Software Foundation, Inc.
- Written by Paul Rubin, June 1986
- Adapted to ANSI C, Richard Stallman, Jan 1987
-
-This program 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 program 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 program; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#include "config.h"
-
-#include "system.h"
-#include <signal.h>
-
-#ifdef HAVE_SYS_RESOURCE_H
-# include <sys/resource.h>
-#endif
-
-typedef unsigned char U_CHAR;
-
-#include "pcp.h"
-#include "intl.h"
-#include "prefix.h"
-
-#ifdef MULTIBYTE_CHARS
-#include "mbchar.h"
-#include <locale.h>
-#endif /* MULTIBYTE_CHARS */
-
-#ifndef GET_ENV_PATH_LIST
-#define GET_ENV_PATH_LIST(VAR,NAME) do { (VAR) = getenv (NAME); } while (0)
-#endif
-
-#ifndef STANDARD_INCLUDE_DIR
-# define STANDARD_INCLUDE_DIR "/usr/include"
-#endif
-
-/* By default, colon separates directories in a path. */
-#ifndef PATH_SEPARATOR
-# define PATH_SEPARATOR ':'
-#endif
-
-/* By default, a slash separates directory names. */
-#ifndef DIR_SEPARATOR
-# define DIR_SEPARATOR '/'
-#endif
-
-/* By default, the suffix for object files is ".o". */
-#ifdef OBJECT_SUFFIX
-# define HAVE_OBJECT_SUFFIX
-#else
-# define OBJECT_SUFFIX ".o"
-#endif
-
-/* VMS-specific definitions */
-#ifdef VMS
-#include <descrip.h>
-#include <ssdef.h>
-#include <syidef.h>
-#define open(fname,mode,prot) VMS_open (fname,mode,prot)
-#define fopen(fname,mode) VMS_fopen (fname,mode)
-#define freopen(fname,mode,ofile) VMS_freopen (fname,mode,ofile)
-#define fstat(fd,stbuf) VMS_fstat (fd,stbuf)
-static int VMS_fstat (), VMS_stat ();
-static int VMS_open ();
-static FILE *VMS_fopen ();
-static FILE *VMS_freopen ();
-static int hack_vms_include_specification ();
-#define INO_T_EQ(a, b) (!bcmp((char *) &(a), (char *) &(b), sizeof (a)))
-#define INO_T_HASH(a) 0
-#define INCLUDE_LEN_FUDGE 12 /* leave room for VMS syntax conversion */
-#endif /* VMS */
-
-/* Windows does not natively support inodes, and neither does MSDOS. */
-#if (defined (_WIN32) && ! defined (__CYGWIN__) && ! defined (_UWIN)) \
- || defined (__MSDOS__)
-#define INO_T_EQ(a, b) 0
-#endif
-
-#ifndef INO_T_EQ
-#define INO_T_EQ(a, b) ((a) == (b))
-#endif
-
-#ifndef INO_T_HASH
-#define INO_T_HASH(a) (a)
-#endif
-
-#ifndef INCLUDE_LEN_FUDGE
-#define INCLUDE_LEN_FUDGE 0
-#endif
-
-/* External declarations. */
-
-extern char *version_string;
-HOST_WIDEST_INT parse_escape PROTO((char **, HOST_WIDEST_INT));
-HOST_WIDEST_INT parse_c_expression PROTO((char *, int));
-
-/* Name under which this program was invoked. */
-
-static char *progname;
-
-/* Nonzero means use extra default include directories for C++. */
-
-static int cplusplus;
-
-/* Nonzero means handle cplusplus style comments */
-
-static int cplusplus_comments;
-
-/* Nonzero means handle #import, for objective C. */
-
-static int objc;
-
-/* Nonzero means this is an assembly file, and allow
- unknown directives, which could be comments. */
-
-static int lang_asm;
-
-/* Current maximum length of directory names in the search path
- for include files. (Altered as we get more of them.) */
-
-static int max_include_len;
-
-/* Nonzero means turn NOTREACHED into #pragma NOTREACHED etc */
-
-static int for_lint = 0;
-
-/* Nonzero means copy comments into the output file. */
-
-static int put_out_comments = 0;
-
-/* Nonzero means don't process the ANSI trigraph sequences. */
-
-static int no_trigraphs = 0;
-
-/* Nonzero means print the names of included files rather than
- the preprocessed output. 1 means just the #include "...",
- 2 means #include <...> as well. */
-
-static int print_deps = 0;
-
-/* Nonzero if missing .h files in -M output are assumed to be generated
- files and not errors. */
-
-static int print_deps_missing_files = 0;
-
-/* Nonzero means print names of header files (-H). */
-
-static int print_include_names = 0;
-
-/* Nonzero means don't output line number information. */
-
-static int no_line_directives;
-
-/* Nonzero means output the text in failing conditionals,
- inside #failed ... #endfailed. */
-
-static int output_conditionals;
-
-/* dump_only means inhibit output of the preprocessed text
- and instead output the definitions of all user-defined
- macros in a form suitable for use as input to cccp.
- dump_names means pass #define and the macro name through to output.
- dump_definitions means pass the whole definition (plus #define) through
-*/
-
-static enum {dump_none, dump_only, dump_names, dump_definitions}
- dump_macros = dump_none;
-
-/* Nonzero means pass all #define and #undef directives which we actually
- process through to the output stream. This feature is used primarily
- to allow cc1 to record the #defines and #undefs for the sake of
- debuggers which understand about preprocessor macros, but it may
- also be useful with -E to figure out how symbols are defined, and
- where they are defined. */
-static int debug_output = 0;
-
-/* Nonzero means pass #include lines through to the output,
- even if they are ifdefed out. */
-static int dump_includes;
-
-/* Nonzero indicates special processing used by the pcp program. The
- special effects of this mode are:
-
- Inhibit all macro expansion, except those inside #if directives.
-
- Process #define directives normally, and output their contents
- to the output file.
-
- Output preconditions to pcp_outfile indicating all the relevant
- preconditions for use of this file in a later cpp run.
-*/
-static FILE *pcp_outfile;
-
-/* Nonzero means we are inside an IF during a -pcp run. In this mode
- macro expansion is done, and preconditions are output for all macro
- uses requiring them. */
-static int pcp_inside_if;
-
-/* Nonzero means never to include precompiled files.
- This is 1 since there's no way now to make precompiled files,
- so it's not worth testing for them. */
-static int no_precomp = 1;
-
-/* Nonzero means give all the error messages the ANSI standard requires. */
-
-int pedantic;
-
-/* Nonzero means try to make failure to fit ANSI C an error. */
-
-static int pedantic_errors;
-
-/* Nonzero means don't print warning messages. -w. */
-
-static int inhibit_warnings = 0;
-
-/* Nonzero means warn if slash-star appears in a slash-star comment,
- or if newline-backslash appears in a slash-slash comment. */
-
-static int warn_comments;
-
-/* Nonzero means warn if a macro argument is (or would be)
- stringified with -traditional. */
-
-static int warn_stringify;
-
-/* Nonzero means warn if there are any trigraphs. */
-
-static int warn_trigraphs;
-
-/* Nonzero means warn if undefined identifiers are evaluated in an #if. */
-
-static int warn_undef;
-
-/* Nonzero means warn if #import is used. */
-
-static int warn_import = 1;
-
-/* Nonzero means turn warnings into errors. */
-
-static int warnings_are_errors;
-
-/* Nonzero means try to imitate old fashioned non-ANSI preprocessor. */
-
-int traditional;
-
-/* Nonzero for the 1989 C Standard, including corrigenda and amendments. */
-
-int c89;
-
-/* Nonzero for the 199x C Standard. */
-
-int c9x;
-
-/* Nonzero causes output not to be done,
- but directives such as #define that have side effects
- are still obeyed. */
-
-static int no_output;
-
-/* Nonzero means we should look for header.gcc files that remap file names. */
-static int remap;
-
-/* Nonzero means this file was included with a -imacros or -include
- command line and should not be recorded as an include file. */
-
-static int no_record_file;
-
-/* Nonzero means that we have finished processing the command line options.
- This flag is used to decide whether or not to issue certain errors
- and/or warnings. */
-
-static int done_initializing = 0;
-
-/* Line where a newline was first seen in a string constant. */
-
-static int multiline_string_line = 0;
-
-/* I/O buffer structure.
- The `fname' field is nonzero for source files and #include files
- and for the dummy text used for -D and -U.
- It is zero for rescanning results of macro expansion
- and for expanding macro arguments. */
-#define INPUT_STACK_MAX 400
-static struct file_buf {
- char *fname;
- /* Filename specified with #line directive. */
- char *nominal_fname;
- /* The length of nominal_fname, which may contain embedded NULs. */
- size_t nominal_fname_len;
- /* Include file description. */
- struct include_file *inc;
- /* Record where in the search path this file was found.
- For #include_next. */
- struct file_name_list *dir;
- int lineno;
- int length;
- U_CHAR *buf;
- U_CHAR *bufp;
- /* Macro that this level is the expansion of.
- Included so that we can reenable the macro
- at the end of this level. */
- struct hashnode *macro;
- /* Value of if_stack at start of this file.
- Used to prohibit unmatched #endif (etc) in an include file. */
- struct if_stack *if_stack;
- /* Object to be freed at end of input at this level. */
- U_CHAR *free_ptr;
- /* True if this is a system header file; see is_system_include. */
- char system_header_p;
-} instack[INPUT_STACK_MAX];
-
-static int last_error_tick; /* Incremented each time we print it. */
-static int input_file_stack_tick; /* Incremented when the status changes. */
-
-/* Current nesting level of input sources.
- `instack[indepth]' is the level currently being read. */
-static int indepth = -1;
-#define CHECK_DEPTH(code) \
- if (indepth >= (INPUT_STACK_MAX - 1)) \
- { \
- error_with_line (line_for_error (instack[indepth].lineno), \
- "macro or `#include' recursion too deep"); \
- code; \
- }
-
-/* Current depth in #include directives that use <...>. */
-static int system_include_depth = 0;
-
-typedef struct file_buf FILE_BUF;
-
-/* The output buffer. Its LENGTH field is the amount of room allocated
- for the buffer, not the number of chars actually present. To get
- that, subtract outbuf.buf from outbuf.bufp. */
-
-#define OUTBUF_SIZE 10 /* initial size of output buffer */
-static FILE_BUF outbuf;
-
-/* Grow output buffer OBUF points at
- so it can hold at least NEEDED more chars. */
-
-#define check_expand(OBUF, NEEDED) \
- (((OBUF)->length - ((OBUF)->bufp - (OBUF)->buf) <= (NEEDED)) \
- ? grow_outbuf ((OBUF), (NEEDED)) : 0)
-
-struct file_name_list
- {
- struct file_name_list *next;
- /* If the following is 1, it is a C-language system include
- directory. */
- int c_system_include_path;
- /* Mapping of file names for this directory. */
- struct file_name_map *name_map;
- /* Non-zero if name_map is valid. */
- int got_name_map;
- /* The include directory status. */
- struct stat st;
- /* The include prefix: "" denotes the working directory,
- otherwise fname must end in '/'.
- The actual size is dynamically allocated. */
- char fname[1];
- };
-
-/* #include "file" looks in source file dir, then stack. */
-/* #include <file> just looks in the stack. */
-/* -I directories are added to the end, then the defaults are added. */
-/* The */
-static struct default_include {
- char *fname; /* The name of the directory. */
- char *component; /* The component containing the directory */
- int cplusplus; /* Only look here if we're compiling C++. */
- int cxx_aware; /* Includes in this directory don't need to
- be wrapped in extern "C" when compiling
- C++. */
- int included; /* Set if the directory is acceptable. */
-} include_defaults_array[]
-#ifdef INCLUDE_DEFAULTS
- = INCLUDE_DEFAULTS;
-#else
- = {
- /* Pick up GNU C++ specific include files. */
- { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, 0 },
-#ifdef CROSS_COMPILE
- /* This is the dir for fixincludes. Put it just before
- the files that we fix. */
- { GCC_INCLUDE_DIR, "GCC", 0, 0, 0 },
- /* For cross-compilation, this dir name is generated
- automatically in Makefile.in. */
- { CROSS_INCLUDE_DIR, "GCC", 0, 0, 0 },
-#ifdef TOOL_INCLUDE_DIR
- /* This is another place that the target system's headers might be. */
- { TOOL_INCLUDE_DIR, "BINUTILS", 0, 0, 0 },
-#endif
-#else /* not CROSS_COMPILE */
-#ifdef LOCAL_INCLUDE_DIR
- /* This should be /usr/local/include and should come before
- the fixincludes-fixed header files. */
- { LOCAL_INCLUDE_DIR, 0, 0, 1, 0 },
-#endif
-#ifdef TOOL_INCLUDE_DIR
- /* This is here ahead of GCC_INCLUDE_DIR because assert.h goes here.
- Likewise, behind LOCAL_INCLUDE_DIR, where glibc puts its assert.h. */
- { TOOL_INCLUDE_DIR, "BINUTILS", 0, 0, 0 },
-#endif
- /* This is the dir for fixincludes. Put it just before
- the files that we fix. */
- { GCC_INCLUDE_DIR, "GCC", 0, 0, 0 },
- /* Some systems have an extra dir of include files. */
-#ifdef SYSTEM_INCLUDE_DIR
- { SYSTEM_INCLUDE_DIR, 0, 0, 0, 0 },
-#endif
-#ifndef STANDARD_INCLUDE_COMPONENT
-#define STANDARD_INCLUDE_COMPONENT 0
-#endif
- { STANDARD_INCLUDE_DIR, STANDARD_INCLUDE_COMPONENT, 0, 0, 0 },
-#endif /* not CROSS_COMPILE */
- { 0, 0, 0, 0, 0 }
- };
-#endif /* no INCLUDE_DEFAULTS */
-
-/* The code looks at the defaults through this pointer, rather than through
- the constant structure above. This pointer gets changed if an environment
- variable specifies other defaults. */
-static struct default_include *include_defaults = include_defaults_array;
-
-static struct file_name_list *include = 0; /* First dir to search */
- /* First dir to search for <file> */
-/* This is the first element to use for #include <...>.
- If it is 0, use the entire chain for such includes. */
-static struct file_name_list *first_bracket_include = 0;
-/* This is the first element in the chain that corresponds to
- a directory of system header files. */
-static struct file_name_list *first_system_include = 0;
-static struct file_name_list *last_include = 0; /* Last in chain */
-
-/* Chain of include directories to put at the end of the other chain. */
-static struct file_name_list *after_include = 0;
-static struct file_name_list *last_after_include = 0; /* Last in chain */
-
-/* Chain to put at the start of the system include files. */
-static struct file_name_list *before_system = 0;
-static struct file_name_list *last_before_system = 0; /* Last in chain */
-
-/* Directory prefix that should replace `/usr' in the standard
- include file directories. */
-static char *include_prefix;
-
-/* Maintain and search list of included files. */
-
-struct include_file {
- struct include_file *next; /* for include_hashtab */
- struct include_file *next_ino; /* for include_ino_hashtab */
- char *fname;
- /* If the following is the empty string, it means #pragma once
- was seen in this include file, or #import was applied to the file.
- Otherwise, if it is nonzero, it is a macro name.
- Don't include the file again if that macro is defined. */
- U_CHAR *control_macro;
- /* Nonzero if the dependency on this include file has been output. */
- int deps_output;
- struct stat st;
-};
-
-/* Hash tables of files already included with #include or #import.
- include_hashtab is by full name; include_ino_hashtab is by inode number. */
-
-#define INCLUDE_HASHSIZE 61
-static struct include_file *include_hashtab[INCLUDE_HASHSIZE];
-static struct include_file *include_ino_hashtab[INCLUDE_HASHSIZE];
-
-/* Global list of strings read in from precompiled files. This list
- is kept in the order the strings are read in, with new strings being
- added at the end through stringlist_tailp. We use this list to output
- the strings at the end of the run.
-*/
-static STRINGDEF *stringlist;
-static STRINGDEF **stringlist_tailp = &stringlist;
-
-
-/* Structure returned by create_definition */
-typedef struct macrodef MACRODEF;
-struct macrodef
-{
- struct definition *defn;
- U_CHAR *symnam;
- int symlen;
-};
-
-enum sharp_token_type {
- NO_SHARP_TOKEN = 0, /* token not present */
-
- SHARP_TOKEN = '#', /* token spelled with # only */
- WHITE_SHARP_TOKEN, /* token spelled with # and white space */
-
- PERCENT_COLON_TOKEN = '%', /* token spelled with %: only */
- WHITE_PERCENT_COLON_TOKEN /* token spelled with %: and white space */
-};
-
-/* Structure allocated for every #define. For a simple replacement
- such as
- #define foo bar ,
- nargs = -1, the `pattern' list is null, and the expansion is just
- the replacement text. Nargs = 0 means a functionlike macro with no args,
- e.g.,
- #define getchar() getc (stdin) .
- When there are args, the expansion is the replacement text with the
- args squashed out, and the reflist is a list describing how to
- build the output from the input: e.g., "3 chars, then the 1st arg,
- then 9 chars, then the 3rd arg, then 0 chars, then the 2nd arg".
- The chars here come from the expansion. Whatever is left of the
- expansion after the last arg-occurrence is copied after that arg.
- Note that the reflist can be arbitrarily long---
- its length depends on the number of times the arguments appear in
- the replacement text, not how many args there are. Example:
- #define f(x) x+x+x+x+x+x+x would have replacement text "++++++" and
- pattern list
- { (0, 1), (1, 1), (1, 1), ..., (1, 1), NULL }
- where (x, y) means (nchars, argno). */
-
-typedef struct definition DEFINITION;
-struct definition {
- int nargs;
- int length; /* length of expansion string */
- int predefined; /* True if the macro was builtin or */
- /* came from the command line */
- U_CHAR *expansion;
- int line; /* Line number of definition */
- char *file; /* File of definition */
- size_t file_len; /* Length of file (which can contain NULs) */
- char rest_args; /* Nonzero if last arg. absorbs the rest */
- struct reflist {
- struct reflist *next;
-
- enum sharp_token_type stringify; /* set if a # operator before arg */
- enum sharp_token_type raw_before; /* set if a ## operator before arg */
- enum sharp_token_type raw_after; /* set if a ## operator after arg */
-
- char rest_args; /* Nonzero if this arg. absorbs the rest */
- int nchars; /* Number of literal chars to copy before
- this arg occurrence. */
- int argno; /* Number of arg to substitute (origin-0) */
- } *pattern;
- union {
- /* Names of macro args, concatenated in reverse order
- with comma-space between them.
- The only use of this is that we warn on redefinition
- if this differs between the old and new definitions. */
- U_CHAR *argnames;
- } args;
-};
-
-/* different kinds of things that can appear in the value field
- of a hash node. Actually, this may be useless now. */
-union hashval {
- char *cpval;
- DEFINITION *defn;
- KEYDEF *keydef;
-};
-
-/*
- * special extension string that can be added to the last macro argument to
- * allow it to absorb the "rest" of the arguments when expanded. Ex:
- * #define wow(a, b...) process (b, a, b)
- * { wow (1, 2, 3); } -> { process (2, 3, 1, 2, 3); }
- * { wow (one, two); } -> { process (two, one, two); }
- * if this "rest_arg" is used with the concat token '##' and if it is not
- * supplied then the token attached to with ## will not be outputted. Ex:
- * #define wow (a, b...) process (b ## , a, ## b)
- * { wow (1, 2); } -> { process (2, 1, 2); }
- * { wow (one); } -> { process (one); {
- */
-static char rest_extension[] = "...";
-#define REST_EXTENSION_LENGTH (sizeof (rest_extension) - 1)
-
-/* This is the implicit parameter name when using variable number of
- parameters for macros using the ISO C 9x extension. */
-static char va_args_name[] = "__VA_ARGS__";
-#define VA_ARGS_NAME_LENGTH (sizeof (va_args_name) - 1)
-
-/* The structure of a node in the hash table. The hash table
- has entries for all tokens defined by #define directives (type T_MACRO),
- plus some special tokens like __LINE__ (these each have their own
- type, and the appropriate code is run when that type of node is seen.
- It does not contain control words like "#define", which are recognized
- by a separate piece of code. */
-
-/* different flavors of hash nodes --- also used in keyword table */
-enum node_type {
- T_DEFINE = 1, /* the `#define' keyword */
- T_INCLUDE, /* the `#include' keyword */
- T_INCLUDE_NEXT, /* the `#include_next' keyword */
- T_IMPORT, /* the `#import' keyword */
- T_IFDEF, /* the `#ifdef' keyword */
- T_IFNDEF, /* the `#ifndef' keyword */
- T_IF, /* the `#if' keyword */
- T_ELSE, /* `#else' */
- T_PRAGMA, /* `#pragma' */
- T_ELIF, /* `#elif' */
- T_UNDEF, /* `#undef' */
- T_LINE, /* `#line' */
- T_ERROR, /* `#error' */
- T_WARNING, /* `#warning' */
- T_ENDIF, /* `#endif' */
- T_SCCS, /* `#sccs', used on system V. */
- T_IDENT, /* `#ident', used on system V. */
- T_ASSERT, /* `#assert', taken from system V. */
- T_UNASSERT, /* `#unassert', taken from system V. */
- T_SPECLINE, /* special symbol `__LINE__' */
- T_DATE, /* `__DATE__' */
- T_FILE, /* `__FILE__' */
- T_BASE_FILE, /* `__BASE_FILE__' */
- T_INCLUDE_LEVEL, /* `__INCLUDE_LEVEL__' */
- T_VERSION, /* `__VERSION__' */
- T_SIZE_TYPE, /* `__SIZE_TYPE__' */
- T_PTRDIFF_TYPE, /* `__PTRDIFF_TYPE__' */
- T_WCHAR_TYPE, /* `__WCHAR_TYPE__' */
- T_USER_LABEL_PREFIX_TYPE, /* `__USER_LABEL_PREFIX__' */
- T_REGISTER_PREFIX_TYPE, /* `__REGISTER_PREFIX__' */
- T_IMMEDIATE_PREFIX_TYPE, /* `__IMMEDIATE_PREFIX__' */
- T_TIME, /* `__TIME__' */
- T_CONST, /* Constant value, used by `__STDC__' */
- T_MACRO, /* macro defined by `#define' */
- T_DISABLED, /* macro temporarily turned off for rescan */
- T_SPEC_DEFINED, /* special `defined' macro for use in #if statements */
- T_PCSTRING, /* precompiled string (hashval is KEYDEF *) */
- T_UNUSED /* Used for something not defined. */
- };
-
-struct hashnode {
- struct hashnode *next; /* double links for easy deletion */
- struct hashnode *prev;
- struct hashnode **bucket_hdr; /* also, a back pointer to this node's hash
- chain is kept, in case the node is the head
- of the chain and gets deleted. */
- enum node_type type; /* type of special token */
- int length; /* length of token, for quick comparison */
- U_CHAR *name; /* the actual name */
- union hashval value; /* pointer to expansion, or whatever */
-};
-
-typedef struct hashnode HASHNODE;
-
-/* Some definitions for the hash table. The hash function MUST be
- computed as shown in hashf () below. That is because the rescan
- loop computes the hash value `on the fly' for most tokens,
- in order to avoid the overhead of a lot of procedure calls to
- the hashf () function. Hashf () only exists for the sake of
- politeness, for use when speed isn't so important. */
-
-#define HASHSIZE 1403
-static HASHNODE *hashtab[HASHSIZE];
-#define HASHSTEP(old, c) ((old << 2) + c)
-#define MAKE_POS(v) (v & 0x7fffffff) /* make number positive */
-
-
-/* We let tm.h override the types used here, to handle trivial differences
- such as the choice of unsigned int or long unsigned int for size_t.
- When machines start needing nontrivial differences in the size type,
- it would be best to do something here to figure out automatically
- from other information what type to use. */
-
-/* The string value for __SIZE_TYPE__. */
-
-#ifndef SIZE_TYPE
-#define SIZE_TYPE "long unsigned int"
-#endif
-
-/* The string value for __PTRDIFF_TYPE__. */
-
-#ifndef PTRDIFF_TYPE
-#define PTRDIFF_TYPE "long int"
-#endif
-
-/* The string value for __WCHAR_TYPE__. */
-
-#ifndef WCHAR_TYPE
-#define WCHAR_TYPE "int"
-#endif
-char * wchar_type = WCHAR_TYPE;
-#undef WCHAR_TYPE
-
-/* The string value for __USER_LABEL_PREFIX__ */
-
-#ifndef USER_LABEL_PREFIX
-#define USER_LABEL_PREFIX ""
-#endif
-char * user_label_prefix = USER_LABEL_PREFIX;
-#undef USER_LABEL_PREFIX
-
-/* The string value for __REGISTER_PREFIX__ */
-
-#ifndef REGISTER_PREFIX
-#define REGISTER_PREFIX ""
-#endif
-
-/* The string value for __IMMEDIATE_PREFIX__ */
-
-#ifndef IMMEDIATE_PREFIX
-#define IMMEDIATE_PREFIX ""
-#endif
-
-/* In the definition of a #assert name, this structure forms
- a list of the individual values asserted.
- Each value is itself a list of "tokens".
- These are strings that are compared by name. */
-
-struct tokenlist_list {
- struct tokenlist_list *next;
- struct arglist *tokens;
-};
-
-struct assertion_hashnode {
- struct assertion_hashnode *next; /* double links for easy deletion */
- struct assertion_hashnode *prev;
- /* also, a back pointer to this node's hash
- chain is kept, in case the node is the head
- of the chain and gets deleted. */
- struct assertion_hashnode **bucket_hdr;
- int length; /* length of token, for quick comparison */
- U_CHAR *name; /* the actual name */
- /* List of token-sequences. */
- struct tokenlist_list *value;
-};
-
-typedef struct assertion_hashnode ASSERTION_HASHNODE;
-
-/* Some definitions for the hash table. The hash function MUST be
- computed as shown in hashf below. That is because the rescan
- loop computes the hash value `on the fly' for most tokens,
- in order to avoid the overhead of a lot of procedure calls to
- the hashf function. hashf only exists for the sake of
- politeness, for use when speed isn't so important. */
-
-#define ASSERTION_HASHSIZE 37
-static ASSERTION_HASHNODE *assertion_hashtab[ASSERTION_HASHSIZE];
-
-/* Nonzero means inhibit macroexpansion of what seem to be
- assertion tests, in rescan. For #if. */
-static int assertions_flag;
-
-/* `struct directive' defines one #-directive, including how to handle it. */
-
-#define DO_PROTO PROTO((U_CHAR *, U_CHAR *, FILE_BUF *, struct directive *))
-
-struct directive {
- int length; /* Length of name */
- int (*func) DO_PROTO; /* Function to handle directive */
- char *name; /* Name of directive */
- enum node_type type; /* Code which describes which directive. */
-};
-
-#define IS_INCLUDE_DIRECTIVE_TYPE(t) \
-((int) T_INCLUDE <= (int) (t) && (int) (t) <= (int) T_IMPORT)
-
-/* These functions are declared to return int instead of void since they
- are going to be placed in the table and some old compilers have trouble with
- pointers to functions returning void. */
-
-static int do_assert DO_PROTO;
-static int do_define DO_PROTO;
-static int do_elif DO_PROTO;
-static int do_else DO_PROTO;
-static int do_endif DO_PROTO;
-static int do_error DO_PROTO;
-static int do_ident DO_PROTO;
-static int do_if DO_PROTO;
-static int do_include DO_PROTO;
-static int do_line DO_PROTO;
-static int do_pragma DO_PROTO;
-#ifdef SCCS_DIRECTIVE
-static int do_sccs DO_PROTO;
-#endif
-static int do_unassert DO_PROTO;
-static int do_undef DO_PROTO;
-static int do_warning DO_PROTO;
-static int do_xifdef DO_PROTO;
-
-/* Here is the actual list of #-directives, most-often-used first. */
-
-static struct directive directive_table[] = {
- { 6, do_define, "define", T_DEFINE},
- { 2, do_if, "if", T_IF},
- { 5, do_xifdef, "ifdef", T_IFDEF},
- { 6, do_xifdef, "ifndef", T_IFNDEF},
- { 5, do_endif, "endif", T_ENDIF},
- { 4, do_else, "else", T_ELSE},
- { 4, do_elif, "elif", T_ELIF},
- { 4, do_line, "line", T_LINE},
- { 7, do_include, "include", T_INCLUDE},
- { 12, do_include, "include_next", T_INCLUDE_NEXT},
- { 6, do_include, "import", T_IMPORT},
- { 5, do_undef, "undef", T_UNDEF},
- { 5, do_error, "error", T_ERROR},
- { 7, do_warning, "warning", T_WARNING},
-#ifdef SCCS_DIRECTIVE
- { 4, do_sccs, "sccs", T_SCCS},
-#endif
- { 6, do_pragma, "pragma", T_PRAGMA},
- { 5, do_ident, "ident", T_IDENT},
- { 6, do_assert, "assert", T_ASSERT},
- { 8, do_unassert, "unassert", T_UNASSERT},
- { -1, 0, "", T_UNUSED},
-};
-
-/* When a directive handler is called,
- this points to the # (or the : of the %:) that started the directive. */
-U_CHAR *directive_start;
-
-/* table to tell if char can be part of a C identifier. */
-U_CHAR is_idchar[256];
-/* table to tell if char can be first char of a c identifier. */
-U_CHAR is_idstart[256];
-/* table to tell if c is horizontal space. */
-static U_CHAR is_hor_space[256];
-/* table to tell if c is horizontal or vertical space. */
-U_CHAR is_space[256];
-
-#define SKIP_WHITE_SPACE(p) do { while (is_hor_space[*p]) p++; } while (0)
-#define SKIP_ALL_WHITE_SPACE(p) do { while (is_space[*p]) p++; } while (0)
-
-static int errors = 0; /* Error counter for exit code */
-
-/* Name of output file, for error messages. */
-static char *out_fname;
-
-/* Nonzero to ignore \ in string constants. Use to treat #line 1 "A:\file.h
- as a non-form feed. If you want it to be a form feed, you must use
- # 1 "\f". */
-static int ignore_escape_flag = 1;
-
-/* Stack of conditionals currently in progress
- (including both successful and failing conditionals). */
-
-struct if_stack {
- struct if_stack *next; /* for chaining to the next stack frame */
- char *fname; /* copied from input when frame is made */
- size_t fname_len; /* similarly */
- int lineno; /* similarly */
- int if_succeeded; /* true if a leg of this if-group
- has been passed through rescan */
- U_CHAR *control_macro; /* For #ifndef at start of file,
- this is the macro name tested. */
- enum node_type type; /* type of last directive seen in this group */
-};
-typedef struct if_stack IF_STACK_FRAME;
-static IF_STACK_FRAME *if_stack = NULL;
-
-/* Buffer of -M output. */
-static char *deps_buffer;
-
-/* Number of bytes allocated in above. */
-static int deps_allocated_size;
-
-/* Number of bytes used. */
-static int deps_size;
-
-/* Number of bytes since the last newline. */
-static int deps_column;
-
-/* Nonzero means -I- has been seen,
- so don't look for #include "foo" the source-file directory. */
-static int ignore_srcdir;
-
-static int safe_read PROTO((int, char *, int));
-static void safe_write PROTO((int, char *, int));
-static void eprint_string PROTO((const char *, size_t));
-
-int main PROTO((int, char **));
-
-static void path_include PROTO((char *));
-
-static U_CHAR *index0 PROTO((U_CHAR *, int, size_t));
-
-static void trigraph_pcp PROTO((FILE_BUF *));
-
-static void newline_fix PROTO((U_CHAR *));
-static void name_newline_fix PROTO((U_CHAR *));
-
-static char *get_lintcmd PROTO((U_CHAR *, U_CHAR *, U_CHAR **, int *, int *));
-
-static void rescan PROTO((FILE_BUF *, int));
-
-static FILE_BUF expand_to_temp_buffer PROTO((U_CHAR *, U_CHAR *, int, int));
-
-static int handle_directive PROTO((FILE_BUF *, FILE_BUF *));
-
-static struct tm *timestamp PROTO((void));
-static void special_symbol PROTO((HASHNODE *, FILE_BUF *));
-
-static int is_system_include PROTO((char *));
-static char *base_name PROTO((char *));
-static int absolute_filename PROTO((char *));
-static size_t simplify_filename PROTO((char *));
-
-static char *read_filename_string PROTO((int, FILE *));
-static struct file_name_map *read_name_map PROTO((char *));
-static int open_include_file PROTO((char *, struct file_name_list *, U_CHAR *, struct include_file **));
-static char *remap_include_file PROTO((char *, struct file_name_list *));
-static int lookup_ino_include PROTO((struct include_file *));
-
-static void finclude PROTO((int, struct include_file *, FILE_BUF *, int, struct file_name_list *));
-static void record_control_macro PROTO((struct include_file *, U_CHAR *));
-
-static char *check_precompiled PROTO((int, struct stat *, char *, char **));
-static int check_preconditions PROTO((char *));
-static void pcfinclude PROTO((U_CHAR *, U_CHAR *, FILE_BUF *));
-static void pcstring_used PROTO((HASHNODE *));
-static void write_output PROTO((void));
-static void pass_thru_directive PROTO((U_CHAR *, U_CHAR *, FILE_BUF *, struct directive *));
-
-static MACRODEF create_definition PROTO((U_CHAR *, U_CHAR *, FILE_BUF *));
-
-static int check_macro_name PROTO((U_CHAR *, int));
-static int compare_defs PROTO((DEFINITION *, DEFINITION *));
-static int comp_def_part PROTO((int, U_CHAR *, int, U_CHAR *, int, int));
-
-static DEFINITION *collect_expansion PROTO((U_CHAR *, U_CHAR *, int, struct arglist *));
-
-int check_assertion PROTO((U_CHAR *, int, int, struct arglist *));
-static int compare_token_lists PROTO((struct arglist *, struct arglist *));
-
-static struct arglist *read_token_list PROTO((U_CHAR **, U_CHAR *, int *));
-static void free_token_list PROTO((struct arglist *));
-
-static ASSERTION_HASHNODE *assertion_install PROTO((U_CHAR *, int, int));
-static ASSERTION_HASHNODE *assertion_lookup PROTO((U_CHAR *, int, int));
-static void delete_assertion PROTO((ASSERTION_HASHNODE *));
-
-static void do_once PROTO((void));
-
-static HOST_WIDEST_INT eval_if_expression PROTO((U_CHAR *, int));
-static void conditional_skip PROTO((FILE_BUF *, int, enum node_type, U_CHAR *, FILE_BUF *));
-static void skip_if_group PROTO((FILE_BUF *, int, FILE_BUF *));
-static void validate_else PROTO((U_CHAR *, U_CHAR *));
-
-static U_CHAR *skip_to_end_of_comment PROTO((FILE_BUF *, int *, int));
-static U_CHAR *skip_quoted_string PROTO((U_CHAR *, U_CHAR *, int, int *, int *, int *));
-static char *quote_string PROTO((char *, char *, size_t));
-static U_CHAR *skip_paren_group PROTO((FILE_BUF *));
-
-/* Last arg to output_line_directive. */
-enum file_change_code {same_file, enter_file, leave_file};
-static void output_line_directive PROTO((FILE_BUF *, FILE_BUF *, int, enum file_change_code));
-
-static void macroexpand PROTO((HASHNODE *, FILE_BUF *));
-
-struct argdata;
-static int macarg PROTO((struct argdata *, int));
-
-static U_CHAR *macarg1 PROTO((U_CHAR *, U_CHAR *, struct hashnode *, int *, int *, int *, int));
-
-static int discard_comments PROTO((U_CHAR *, int, int));
-
-static int change_newlines PROTO((U_CHAR *, int));
-
-static char *my_strerror PROTO((int));
-static void notice PVPROTO((const char *, ...)) ATTRIBUTE_PRINTF_1;
-static void vnotice PROTO((const char *, va_list));
-void error PVPROTO((const char *, ...)) ATTRIBUTE_PRINTF_1;
-void verror PROTO((const char *, va_list));
-static void error_from_errno PROTO((char *));
-void warning PVPROTO((const char *, ...)) ATTRIBUTE_PRINTF_1;
-static void vwarning PROTO((const char *, va_list));
-static void error_with_line PVPROTO((int, const char *, ...)) ATTRIBUTE_PRINTF_2;
-static void verror_with_line PROTO((int, const char *, va_list));
-static void vwarning_with_line PROTO((int, const char *, va_list));
-static void warning_with_line PVPROTO((int, const char *, ...)) ATTRIBUTE_PRINTF_2;
-void pedwarn PVPROTO((const char *, ...)) ATTRIBUTE_PRINTF_1;
-void pedwarn_with_line PVPROTO((int, const char *, ...)) ATTRIBUTE_PRINTF_2;
-static void pedwarn_with_file_and_line PVPROTO((const char *, size_t, int, const char *, ...)) ATTRIBUTE_PRINTF_4;
-static void pedwarn_strange_white_space PROTO((int));
-
-static void print_containing_files PROTO((void));
-
-static int line_for_error PROTO((int));
-static int grow_outbuf PROTO((FILE_BUF *, int));
-
-static HASHNODE *install PROTO((U_CHAR *, int, enum node_type, char *, int));
-HASHNODE *lookup PROTO((U_CHAR *, int, int));
-static void delete_macro PROTO((HASHNODE *));
-static int hashf PROTO((U_CHAR *, int, int));
-
-static void dump_single_macro PROTO((HASHNODE *, FILE *));
-static void dump_all_macros PROTO((void));
-static void dump_defn_1 PROTO((U_CHAR *, int, int, FILE *));
-static void dump_arg_n PROTO((DEFINITION *, int, FILE *));
-
-static void initialize_char_syntax PROTO((void));
-static void initialize_builtins PROTO((FILE_BUF *, FILE_BUF *));
-
-static void make_definition PROTO((char *));
-static void make_undef PROTO((char *, FILE_BUF *));
-
-static void make_assertion PROTO((const char *, const char *));
-
-static struct file_name_list *new_include_prefix PROTO((struct file_name_list *, const char *, const char *, const char *));
-static void append_include_chain PROTO((struct file_name_list *, struct file_name_list *));
-
-static int quote_string_for_make PROTO((char *, const char *));
-static void deps_output PROTO((const char *, int));
-
-void fatal PVPROTO((const char *, ...)) ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN;
-void fancy_abort PROTO((void)) ATTRIBUTE_NORETURN;
-static void perror_with_name PROTO((char *));
-static void pfatal_with_name PROTO((char *)) ATTRIBUTE_NORETURN;
-static void pipe_closed PROTO((int)) ATTRIBUTE_NORETURN;
-
-static void memory_full PROTO((void)) ATTRIBUTE_NORETURN;
-static void print_help PROTO((void));
-
-/* Read LEN bytes at PTR from descriptor DESC, for file FILENAME,
- retrying if necessary. If MAX_READ_LEN is defined, read at most
- that bytes at a time. Return a negative value if an error occurs,
- otherwise return the actual number of bytes read,
- which must be LEN unless end-of-file was reached. */
-
-static int
-safe_read (desc, ptr, len)
- int desc;
- char *ptr;
- int len;
-{
- int left, rcount, nchars;
-
- left = len;
- while (left > 0) {
- rcount = left;
-#ifdef MAX_READ_LEN
- if (rcount > MAX_READ_LEN)
- rcount = MAX_READ_LEN;
-#endif
- nchars = read (desc, ptr, rcount);
- if (nchars < 0)
- {
-#ifdef EINTR
- if (errno == EINTR)
- continue;
-#endif
- return nchars;
- }
- if (nchars == 0)
- break;
- ptr += nchars;
- left -= nchars;
- }
- return len - left;
-}
-
-/* Write LEN bytes at PTR to descriptor DESC,
- retrying if necessary, and treating any real error as fatal.
- If MAX_WRITE_LEN is defined, write at most that many bytes at a time. */
-
-static void
-safe_write (desc, ptr, len)
- int desc;
- char *ptr;
- int len;
-{
- int wcount, written;
-
- while (len > 0) {
- wcount = len;
-#ifdef MAX_WRITE_LEN
- if (wcount > MAX_WRITE_LEN)
- wcount = MAX_WRITE_LEN;
-#endif
- written = write (desc, ptr, wcount);
- if (written < 0)
- {
-#ifdef EINTR
- if (errno == EINTR)
- continue;
-#endif
- pfatal_with_name (out_fname);
- }
- ptr += written;
- len -= written;
- }
-}
-
-/* Print a string to stderr, with extra handling in case it contains
- embedded NUL characters. Any present are written as is.
-
- Using fwrite for this purpose produces undesireable results on VMS
- when stderr happens to be a record oriented file, such as a batch log
- file, rather than a stream oriented one. */
-
-static void
-eprint_string (string, length)
- const char *string;
- size_t length;
-{
- size_t segment_length;
-
- do {
- fprintf(stderr, "%s", string);
- length -= (segment_length = strlen(string));
- if (length > 0)
- {
- fputc('\0', stderr);
- length -= 1;
- /* Advance past the portion which has already been printed. */
- string += segment_length + 1;
- }
- } while (length > 0);
-}
-
-
-static void
-print_help ()
-{
- printf ("Usage: %s [switches] input output\n", progname);
- printf ("Switches:\n");
- printf (" -include <file> Include the contents of <file> before other files\n");
- printf (" -imacros <file> Accept definition of marcos in <file>\n");
- printf (" -iprefix <path> Specify <path> as a prefix for next two options\n");
- printf (" -iwithprefix <dir> Add <dir> to the end of the system include paths\n");
- printf (" -iwithprefixbefore <dir> Add <dir> to the end of the main include paths\n");
- printf (" -isystem <dir> Add <dir> to the start of the system include paths\n");
- printf (" -idirafter <dir> Add <dir> to the end of the system include paths\n");
- printf (" -I <dir> Add <dir> to the end of the main include paths\n");
- printf (" -nostdinc Do not search the system include directories\n");
- printf (" -nostdinc++ Do not search the system include directories for C++\n");
- printf (" -o <file> Put output into <file>\n");
- printf (" -pedantic Issue all warnings demanded by strict ANSI C\n");
- printf (" -traditional Follow K&R pre-processor behaviour\n");
- printf (" -trigraphs Support ANSI C trigraphs\n");
- printf (" -lang-c Assume that the input sources are in C\n");
- printf (" -lang-c89 Assume that the input is C89; depricated\n");
- printf (" -lang-c++ Assume that the input sources are in C++\n");
- printf (" -lang-objc Assume that the input sources are in ObjectiveC\n");
- printf (" -lang-objc++ Assume that the input sources are in ObjectiveC++\n");
- printf (" -lang-asm Assume that the input sources are in assembler\n");
- printf (" -lang-chill Assume that the input sources are in Chill\n");
- printf (" -std=<std name> Specify the conformance standard; one of:\n");
- printf (" gnu89, gnu9x, c89, c9x, iso9899:1990,\n");
- printf (" iso9899:199409, iso9899:199x\n");
- printf (" -+ Allow parsing of C++ style features\n");
- printf (" -w Inhibit warning messages\n");
- printf (" -Wtrigraphs Warn if trigraphs are encountered\n");
- printf (" -Wno-trigraphs Do not warn about trigraphs\n");
- printf (" -Wcomment{s} Warn if one comment starts inside another\n");
- printf (" -Wno-comment{s} Do not warn about comments\n");
- printf (" -Wtraditional Warn if a macro argument is/would be turned into\n");
- printf (" a string if -traditional is specified\n");
- printf (" -Wno-traditional Do not warn about stringification\n");
- printf (" -Wundef Warn if an undefined macro is used by #if\n");
- printf (" -Wno-undef Do not warn about testing undefined macros\n");
- printf (" -Wimport Warn about the use of the #import directive\n");
- printf (" -Wno-import Do not warn about the use of #import\n");
- printf (" -Werror Treat all warnings as errors\n");
- printf (" -Wno-error Do not treat warnings as errors\n");
- printf (" -Wall Enable all preprocessor warnings\n");
- printf (" -M Generate make dependencies\n");
- printf (" -MM As -M, but ignore system header files\n");
- printf (" -MD As -M, but put output in a .d file\n");
- printf (" -MMD As -MD, but ignore system header files\n");
- printf (" -MG Treat missing header file as generated files\n");
- printf (" -g Include #define and #undef directives in the output\n");
- printf (" -D<macro> Define a <macro> with string '1' as its value\n");
- printf (" -D<macro>=<val> Define a <macro> with <val> as its value\n");
- printf (" -A<question> (<answer>) Assert the <answer> to <question>\n");
- printf (" -U<macro> Undefine <macro> \n");
- printf (" -u or -undef Do not predefine any macros\n");
- printf (" -v Display the version number\n");
- printf (" -H Print the name of header files as they are used\n");
- printf (" -C Do not discard comments\n");
- printf (" -dM Display a list of macro definitions active at end\n");
- printf (" -dD Preserve macro definitions in output\n");
- printf (" -dN As -dD except that only the names are preserved\n");
- printf (" -dI Include #include directives in the output\n");
- printf (" -ifoutput Describe skipped code blocks in output \n");
- printf (" -P Do not generate #line directives\n");
- printf (" -$ Do not include '$' in identifiers\n");
- printf (" -remap Remap file names when including files.\n");
- printf (" -h or --help Display this information\n");
-}
-
-int
-main (argc, argv)
- int argc;
- char **argv;
-{
- struct stat st;
- char *in_fname;
- char *cp;
- int f, i;
- FILE_BUF *fp;
-
- char **pend_files;
- char **pend_defs;
- char **pend_undefs;
- char **pend_assertions;
- char **pend_includes;
-
- /* Record the option used with each element of pend_assertions.
- This is preparation for supporting more than one option for making
- an assertion. */
- char **pend_assertion_options;
- int no_standard_includes = 0;
- int no_standard_cplusplus_includes = 0;
- int missing_newline = 0;
-
- /* Non-0 means don't output the preprocessed program. */
- int inhibit_output = 0;
- /* Non-0 means -v, so print the full set of include dirs. */
- int verbose = 0;
-
- /* File name which deps are being written to.
- This is 0 if deps are being written to stdout. */
- char *deps_file = 0;
- /* Fopen file mode to open deps_file with. */
- char *deps_mode = "a";
- /* Stream on which to print the dependency information. */
- FILE *deps_stream = 0;
- /* Target-name to write with the dependency information. */
- char *deps_target = 0;
-
-#if defined (RLIMIT_STACK) && defined (HAVE_GETRLIMIT) && defined (HAVE_SETRLIMIT)
- /* Get rid of any avoidable limit on stack size. */
- {
- struct rlimit rlim;
-
- /* Set the stack limit huge so that alloca (particularly stringtab
- in dbxread.c) does not fail. */
- getrlimit (RLIMIT_STACK, &rlim);
- rlim.rlim_cur = rlim.rlim_max;
- setrlimit (RLIMIT_STACK, &rlim);
- }
-#endif
-
-#ifdef SIGPIPE
- signal (SIGPIPE, pipe_closed);
-#endif
-
-#ifdef HAVE_LC_MESSAGES
- setlocale (LC_MESSAGES, "");
-#endif
- (void) bindtextdomain (PACKAGE, localedir);
- (void) textdomain (PACKAGE);
-
- progname = base_name (argv[0]);
-
-#ifdef VMS
- {
- /* Remove extension from PROGNAME. */
- char *p;
- char *s = progname = xstrdup (progname);
-
- if ((p = rindex (s, ';')) != 0) *p = '\0'; /* strip version number */
- if ((p = rindex (s, '.')) != 0 /* strip type iff ".exe" */
- && (p[1] == 'e' || p[1] == 'E')
- && (p[2] == 'x' || p[2] == 'X')
- && (p[3] == 'e' || p[3] == 'E')
- && !p[4])
- *p = '\0';
- }
-#endif
-
- /* Do not invoke xmalloc before this point, since locale and
- progname need to be set first, in case a diagnostic is issued. */
-
- pend_files = (char **) xmalloc (argc * sizeof (char *));
- pend_defs = (char **) xmalloc (argc * sizeof (char *));
- pend_undefs = (char **) xmalloc (argc * sizeof (char *));
- pend_assertions = (char **) xmalloc (argc * sizeof (char *));
- pend_includes = (char **) xmalloc (argc * sizeof (char *));
- pend_assertion_options = (char **) xmalloc (argc * sizeof (char *));
-
- in_fname = NULL;
- out_fname = NULL;
-
- /* Initialize is_idchar. */
- initialize_char_syntax ();
-
- no_line_directives = 0;
- no_trigraphs = 1;
- dump_macros = dump_none;
- no_output = 0;
- cplusplus = 0;
- cplusplus_comments = 1;
-
- bzero ((char *) pend_files, argc * sizeof (char *));
- bzero ((char *) pend_defs, argc * sizeof (char *));
- bzero ((char *) pend_undefs, argc * sizeof (char *));
- bzero ((char *) pend_assertions, argc * sizeof (char *));
- bzero ((char *) pend_includes, argc * sizeof (char *));
-
-#ifdef MULTIBYTE_CHARS
- /* Change to the native locale for multibyte conversions. */
- setlocale (LC_CTYPE, "");
- literal_codeset = getenv ("LANG");
-#endif
-
- /* Process switches and find input file name. */
-
- for (i = 1; i < argc; i++) {
- if (argv[i][0] != '-') {
- if (out_fname != NULL)
- {
- print_help ();
- fatal ("Too many arguments");
- }
- else if (in_fname != NULL)
- out_fname = argv[i];
- else
- in_fname = argv[i];
- } else {
- switch (argv[i][1]) {
-
- case 'i':
- if (!strcmp (argv[i], "-include")) {
- int temp = i;
-
- if (i + 1 == argc)
- fatal ("Filename missing after `-include' option");
- else
- simplify_filename (pend_includes[temp] = argv[++i]);
- }
- if (!strcmp (argv[i], "-imacros")) {
- int temp = i;
-
- if (i + 1 == argc)
- fatal ("Filename missing after `-imacros' option");
- else
- simplify_filename (pend_files[temp] = argv[++i]);
- }
- if (!strcmp (argv[i], "-iprefix")) {
- if (i + 1 == argc)
- fatal ("Filename missing after `-iprefix' option");
- else
- include_prefix = argv[++i];
- }
- if (!strcmp (argv[i], "-ifoutput")) {
- output_conditionals = 1;
- }
- if (!strcmp (argv[i], "-isystem")) {
- struct file_name_list *dirtmp;
-
- if (! (dirtmp = new_include_prefix (NULL_PTR, NULL_PTR,
- "", argv[++i])))
- break;
- dirtmp->c_system_include_path = 1;
-
- if (before_system == 0)
- before_system = dirtmp;
- else
- last_before_system->next = dirtmp;
- last_before_system = dirtmp; /* Tail follows the last one */
- }
- /* Add directory to end of path for includes,
- with the default prefix at the front of its name. */
- if (!strcmp (argv[i], "-iwithprefix")) {
- struct file_name_list *dirtmp;
- char *prefix;
-
- if (include_prefix != 0)
- prefix = include_prefix;
- else {
- prefix = xstrdup (GCC_INCLUDE_DIR);
- /* Remove the `include' from /usr/local/lib/gcc.../include. */
- if (!strcmp (prefix + strlen (prefix) - 8, "/include"))
- prefix[strlen (prefix) - 7] = 0;
- }
-
- if (! (dirtmp = new_include_prefix (NULL_PTR, NULL_PTR,
- prefix, argv[++i])))
- break;
-
- if (after_include == 0)
- after_include = dirtmp;
- else
- last_after_include->next = dirtmp;
- last_after_include = dirtmp; /* Tail follows the last one */
- }
- /* Add directory to main path for includes,
- with the default prefix at the front of its name. */
- if (!strcmp (argv[i], "-iwithprefixbefore")) {
- struct file_name_list *dirtmp;
- char *prefix;
-
- if (include_prefix != 0)
- prefix = include_prefix;
- else {
- prefix = xstrdup (GCC_INCLUDE_DIR);
- /* Remove the `include' from /usr/local/lib/gcc.../include. */
- if (!strcmp (prefix + strlen (prefix) - 8, "/include"))
- prefix[strlen (prefix) - 7] = 0;
- }
-
- dirtmp = new_include_prefix (NULL_PTR, NULL_PTR, prefix, argv[++i]);
- append_include_chain (dirtmp, dirtmp);
- }
- /* Add directory to end of path for includes. */
- if (!strcmp (argv[i], "-idirafter")) {
- struct file_name_list *dirtmp;
-
- if (! (dirtmp = new_include_prefix (NULL_PTR, NULL_PTR,
- "", argv[++i])))
- break;
-
- if (after_include == 0)
- after_include = dirtmp;
- else
- last_after_include->next = dirtmp;
- last_after_include = dirtmp; /* Tail follows the last one */
- }
- break;
-
- case 'o':
- if (out_fname != NULL)
- fatal ("Output filename specified twice");
- if (i + 1 == argc)
- fatal ("Filename missing after -o option");
- out_fname = argv[++i];
- if (!strcmp (out_fname, "-"))
- out_fname = "";
- break;
-
- case 'p':
- if (!strcmp (argv[i], "-pedantic"))
- pedantic = 1;
- else if (!strcmp (argv[i], "-pedantic-errors")) {
- pedantic = 1;
- pedantic_errors = 1;
- } else if (!strcmp (argv[i], "-pcp")) {
- char *pcp_fname;
- if (i + 1 == argc)
- fatal ("Filename missing after -pcp option");
- pcp_fname = argv[++i];
- pcp_outfile
- = ((pcp_fname[0] != '-' || pcp_fname[1] != '\0')
- ? fopen (pcp_fname, "w")
- : stdout);
- if (pcp_outfile == 0)
- pfatal_with_name (pcp_fname);
- no_precomp = 1;
- }
- break;
-
- case 't':
- if (!strcmp (argv[i], "-traditional")) {
- traditional = 1;
- cplusplus_comments = 0;
- } else if (!strcmp (argv[i], "-trigraphs")) {
- no_trigraphs = 0;
- }
- break;
-
- case 'l':
- if (! strcmp (argv[i], "-lang-c"))
- cplusplus = 0, cplusplus_comments = 1, c89 = 0, c9x = 1, objc = 0;
- else if (! strcmp (argv[i], "-lang-c89"))
- cplusplus = 0, cplusplus_comments = 0, c89 = 1, c9x = 0, objc = 0;
- else if (! strcmp (argv[i], "-lang-c++"))
- cplusplus = 1, cplusplus_comments = 1, c89 = 0, c9x = 0, objc = 0;
- else if (! strcmp (argv[i], "-lang-objc"))
- cplusplus = 0, cplusplus_comments = 1, c89 = 0, c9x = 0, objc = 1;
- else if (! strcmp (argv[i], "-lang-objc++"))
- cplusplus = 1, cplusplus_comments = 1, c89 = 0, c9x = 0, objc = 1;
- else if (! strcmp (argv[i], "-lang-asm"))
- lang_asm = 1;
- else if (! strcmp (argv[i], "-lint"))
- for_lint = 1;
- break;
-
- case '+':
- cplusplus = 1, cplusplus_comments = 1;
- break;
-
- case 's':
- if (!strcmp (argv[i], "-std=iso9899:1990")
- || !strcmp (argv[i], "-std=iso9899:199409")
- || !strcmp (argv[i], "-std=c89")
- || !strcmp (argv[i], "-std=gnu89"))
- cplusplus = 0, cplusplus_comments = 0, c89 = 1, c9x = 0, objc = 0;
- else if (!strcmp (argv[i], "-std=iso9899:199x")
- || !strcmp (argv[i], "-std=c9x")
- || !strcmp (argv[i], "-std=gnu9x"))
- cplusplus = 0, cplusplus_comments = 1, c89 = 0, c9x = 1, objc = 0;
- break;
-
- case 'w':
- inhibit_warnings = 1;
- break;
-
- case 'W':
- if (!strcmp (argv[i], "-Wtrigraphs"))
- warn_trigraphs = 1;
- else if (!strcmp (argv[i], "-Wno-trigraphs"))
- warn_trigraphs = 0;
- else if (!strcmp (argv[i], "-Wcomment"))
- warn_comments = 1;
- else if (!strcmp (argv[i], "-Wno-comment"))
- warn_comments = 0;
- else if (!strcmp (argv[i], "-Wcomments"))
- warn_comments = 1;
- else if (!strcmp (argv[i], "-Wno-comments"))
- warn_comments = 0;
- else if (!strcmp (argv[i], "-Wtraditional"))
- warn_stringify = 1;
- else if (!strcmp (argv[i], "-Wno-traditional"))
- warn_stringify = 0;
- else if (!strcmp (argv[i], "-Wundef"))
- warn_undef = 1;
- else if (!strcmp (argv[i], "-Wno-undef"))
- warn_undef = 0;
- else if (!strcmp (argv[i], "-Wimport"))
- warn_import = 1;
- else if (!strcmp (argv[i], "-Wno-import"))
- warn_import = 0;
- else if (!strcmp (argv[i], "-Werror"))
- warnings_are_errors = 1;
- else if (!strcmp (argv[i], "-Wno-error"))
- warnings_are_errors = 0;
- else if (!strcmp (argv[i], "-Wall"))
- {
- warn_trigraphs = 1;
- warn_comments = 1;
- }
- break;
-
- case 'f':
- if (!strcmp (argv[i], "-fleading-underscore"))
- user_label_prefix = "_";
- else if (!strcmp (argv[i], "-fno-leading-underscore"))
- user_label_prefix = "";
- break;
-
- case 'M':
- /* The style of the choices here is a bit mixed.
- The chosen scheme is a hybrid of keeping all options in one string
- and specifying each option in a separate argument:
- -M|-MM|-MD file|-MMD file [-MG]. An alternative is:
- -M|-MM|-MD file|-MMD file|-MG|-MMG; or more concisely:
- -M[M][G][D file]. This is awkward to handle in specs, and is not
- as extensible. */
- /* ??? -MG must be specified in addition to one of -M or -MM.
- This can be relaxed in the future without breaking anything.
- The converse isn't true. */
-
- /* -MG isn't valid with -MD or -MMD. This is checked for later. */
- if (!strcmp (argv[i], "-MG"))
- {
- print_deps_missing_files = 1;
- break;
- }
- if (!strcmp (argv[i], "-M"))
- print_deps = 2;
- else if (!strcmp (argv[i], "-MM"))
- print_deps = 1;
- else if (!strcmp (argv[i], "-MD"))
- print_deps = 2;
- else if (!strcmp (argv[i], "-MMD"))
- print_deps = 1;
- /* For -MD and -MMD options, write deps on file named by next arg. */
- if (!strcmp (argv[i], "-MD")
- || !strcmp (argv[i], "-MMD")) {
- if (i + 1 == argc)
- fatal ("Filename missing after %s option", argv[i]);
- i++;
- deps_file = argv[i];
- deps_mode = "w";
- } else {
- /* For -M and -MM, write deps on standard output
- and suppress the usual output. */
- deps_stream = stdout;
- inhibit_output = 1;
- }
- break;
-
- case 'd':
- {
- char *p = argv[i] + 2;
- char c;
- while ((c = *p++)) {
- /* Arg to -d specifies what parts of macros to dump */
- switch (c) {
- case 'M':
- dump_macros = dump_only;
- no_output = 1;
- break;
- case 'N':
- dump_macros = dump_names;
- break;
- case 'D':
- dump_macros = dump_definitions;
- break;
- case 'I':
- dump_includes = 1;
- break;
- }
- }
- }
- break;
-
- case 'g':
- if (argv[i][2] == '3')
- debug_output = 1;
- break;
-
- case '-':
- if (strcmp (argv[i], "--help") != 0)
- return i;
- print_help ();
- exit (0);
- break;
-
- case 'v':
- notice ("GNU CPP version %s", version_string);
-#ifdef TARGET_VERSION
- TARGET_VERSION;
-#endif
- fprintf (stderr, "\n");
- verbose = 1;
- break;
-
- case 'H':
- print_include_names = 1;
- break;
-
- case 'D':
- if (argv[i][2] != 0)
- pend_defs[i] = argv[i] + 2;
- else if (i + 1 == argc)
- fatal ("Macro name missing after -D option");
- else
- i++, pend_defs[i] = argv[i];
- break;
-
- case 'A':
- {
- char *p;
-
- if (argv[i][2] != 0)
- p = argv[i] + 2;
- else if (i + 1 == argc)
- fatal ("Assertion missing after -A option");
- else
- p = argv[++i];
-
- if (!strcmp (p, "-")) {
- /* -A- eliminates all predefined macros and assertions.
- Let's include also any that were specified earlier
- on the command line. That way we can get rid of any
- that were passed automatically in from GCC. */
- int j;
- for (j = 0; j < i; j++)
- pend_defs[j] = pend_assertions[j] = 0;
- } else {
- pend_assertions[i] = p;
- pend_assertion_options[i] = "-A";
- }
- }
- break;
-
- case 'U': /* JF #undef something */
- if (argv[i][2] != 0)
- pend_undefs[i] = argv[i] + 2;
- else if (i + 1 == argc)
- fatal ("Macro name missing after -U option");
- else
- pend_undefs[i] = argv[i+1], i++;
- break;
-
- case 'C':
- put_out_comments = 1;
- break;
-
- case 'E': /* -E comes from cc -E; ignore it. */
- break;
-
- case 'P':
- no_line_directives = 1;
- break;
-
- case '$': /* Don't include $ in identifiers. */
- is_idchar['$'] = is_idstart['$'] = 0;
- break;
-
- case 'I': /* Add directory to path for includes. */
- {
- struct file_name_list *dirtmp;
-
- if (! ignore_srcdir && !strcmp (argv[i] + 2, "-")) {
- ignore_srcdir = 1;
- /* Don't use any preceding -I directories for #include <...>. */
- first_bracket_include = 0;
- }
- else {
- dirtmp = new_include_prefix (last_include, NULL_PTR, "",
- argv[i][2] ? argv[i] + 2 : argv[++i]);
- append_include_chain (dirtmp, dirtmp);
- }
- }
- break;
-
- case 'n':
- if (!strcmp (argv[i], "-nostdinc"))
- /* -nostdinc causes no default include directories.
- You must specify all include-file directories with -I. */
- no_standard_includes = 1;
- else if (!strcmp (argv[i], "-nostdinc++"))
- /* -nostdinc++ causes no default C++-specific include directories. */
- no_standard_cplusplus_includes = 1;
- else if (!strcmp (argv[i], "-noprecomp"))
- no_precomp = 1;
- break;
-
- case 'r':
- if (!strcmp (argv[i], "-remap"))
- remap = 1;
- break;
-
- case '\0': /* JF handle '-' as file name meaning stdin or stdout */
- if (in_fname == NULL) {
- in_fname = "";
- break;
- } else if (out_fname == NULL) {
- out_fname = "";
- break;
- } /* else fall through into error */
-
- default:
- fatal ("Invalid option `%s'", argv[i]);
- }
- }
- }
-
- /* Add dirs from CPATH after dirs from -I. */
- /* There seems to be confusion about what CPATH should do,
- so for the moment it is not documented. */
- /* Some people say that CPATH should replace the standard include dirs,
- but that seems pointless: it comes before them, so it overrides them
- anyway. */
- GET_ENV_PATH_LIST (cp, "CPATH");
- if (cp && ! no_standard_includes)
- path_include (cp);
-
- /* Initialize output buffer */
-
- outbuf.buf = (U_CHAR *) xmalloc (OUTBUF_SIZE);
- outbuf.bufp = outbuf.buf;
- outbuf.length = OUTBUF_SIZE;
-
- /* Do partial setup of input buffer for the sake of generating
- early #line directives (when -g is in effect). */
-
- fp = &instack[++indepth];
- if (in_fname == NULL)
- in_fname = "";
- fp->nominal_fname = fp->fname = in_fname;
- fp->nominal_fname_len = strlen (in_fname);
- fp->lineno = 0;
-
- /* In C++, wchar_t is a distinct basic type, and we can expect
- __wchar_t to be defined by cc1plus. */
- if (cplusplus)
- wchar_type = "__wchar_t";
-
- /* Install __LINE__, etc. Must follow initialize_char_syntax
- and option processing. */
- initialize_builtins (fp, &outbuf);
-
- /* Now handle the command line options. */
-
- /* Do -U's, -D's and -A's in the order they were seen. */
- for (i = 1; i < argc; i++) {
- if (pend_undefs[i]) {
- if (debug_output)
- output_line_directive (fp, &outbuf, 0, same_file);
- make_undef (pend_undefs[i], &outbuf);
- }
- if (pend_defs[i]) {
- if (debug_output)
- output_line_directive (fp, &outbuf, 0, same_file);
- make_definition (pend_defs[i]);
- }
- if (pend_assertions[i])
- make_assertion (pend_assertion_options[i], pend_assertions[i]);
- }
-
- done_initializing = 1;
-
- { /* Read the appropriate environment variable and if it exists
- replace include_defaults with the listed path. */
- char *epath = 0;
- switch ((objc << 1) + cplusplus)
- {
- case 0:
- GET_ENV_PATH_LIST (epath, "C_INCLUDE_PATH");
- break;
- case 1:
- GET_ENV_PATH_LIST (epath, "CPLUS_INCLUDE_PATH");
- break;
- case 2:
- GET_ENV_PATH_LIST (epath, "OBJC_INCLUDE_PATH");
- break;
- case 3:
- GET_ENV_PATH_LIST (epath, "OBJCPLUS_INCLUDE_PATH");
- break;
- }
- /* If the environment var for this language is set,
- add to the default list of include directories. */
- if (epath) {
- int num_dirs;
- char *startp, *endp;
-
- for (num_dirs = 1, startp = epath; *startp; startp++)
- if (*startp == PATH_SEPARATOR)
- num_dirs++;
- include_defaults
- = (struct default_include *) xmalloc ((num_dirs
- * sizeof (struct default_include))
- + sizeof (include_defaults_array));
- startp = endp = epath;
- num_dirs = 0;
- while (1) {
- char c = *endp++;
- if (c == PATH_SEPARATOR || !c) {
- endp[-1] = 0;
- include_defaults[num_dirs].fname
- = startp == endp ? "." : xstrdup (startp);
- endp[-1] = c;
- include_defaults[num_dirs].component = 0;
- include_defaults[num_dirs].cplusplus = cplusplus;
- include_defaults[num_dirs].cxx_aware = 1;
- num_dirs++;
- if (!c)
- break;
- startp = endp;
- }
- }
- /* Put the usual defaults back in at the end. */
- bcopy ((char *) include_defaults_array,
- (char *) &include_defaults[num_dirs],
- sizeof (include_defaults_array));
- }
- }
-
- append_include_chain (before_system, last_before_system);
- first_system_include = before_system;
-
- /* Unless -fnostdinc,
- tack on the standard include file dirs to the specified list */
- if (!no_standard_includes) {
- struct default_include *p = include_defaults;
- char *specd_prefix = include_prefix;
- char *default_prefix = xstrdup (GCC_INCLUDE_DIR);
- int default_len = 0;
- /* Remove the `include' from /usr/local/lib/gcc.../include. */
- if (!strcmp (default_prefix + strlen (default_prefix) - 8, "/include")) {
- default_len = strlen (default_prefix) - 7;
- default_prefix[default_len] = 0;
- }
- /* Search "translated" versions of GNU directories.
- These have /usr/local/lib/gcc... replaced by specd_prefix. */
- if (specd_prefix != 0 && default_len != 0)
- for (p = include_defaults; p->fname; p++) {
- /* Some standard dirs are only for C++. */
- if (!p->cplusplus || (cplusplus && !no_standard_cplusplus_includes)) {
- /* Does this dir start with the prefix? */
- if (!strncmp (p->fname, default_prefix, default_len)) {
- /* Yes; change prefix and add to search list. */
- struct file_name_list *new
- = new_include_prefix (NULL_PTR, NULL_PTR, specd_prefix,
- p->fname + default_len);
- if (new) {
- new->c_system_include_path = !p->cxx_aware;
- append_include_chain (new, new);
- if (first_system_include == 0)
- first_system_include = new;
- p->included = 1;
- }
- }
- }
- }
- /* Search ordinary names for GNU include directories. */
- for (p = include_defaults; p->fname; p++) {
- /* Some standard dirs are only for C++. */
- if (!p->cplusplus || (cplusplus && !no_standard_cplusplus_includes)) {
- struct file_name_list *new
- = new_include_prefix (NULL_PTR, p->component, "", p->fname);
- if (new) {
- new->c_system_include_path = !p->cxx_aware;
- append_include_chain (new, new);
- if (first_system_include == 0)
- first_system_include = new;
- p->included = 1;
- }
- }
- }
- }
-
- /* Tack the after_include chain at the end of the include chain. */
- append_include_chain (after_include, last_after_include);
- if (first_system_include == 0)
- first_system_include = after_include;
-
- /* With -v, print the list of dirs to search. */
- if (verbose) {
- struct file_name_list *p;
- notice ("#include \"...\" search starts here:\n");
- for (p = include; p; p = p->next) {
- if (p == first_bracket_include)
- notice ("#include <...> search starts here:\n");
- if (!p->fname[0])
- fprintf (stderr, " .\n");
- else if (!strcmp (p->fname, "/") || !strcmp (p->fname, "//"))
- fprintf (stderr, " %s\n", p->fname);
- else
- /* Omit trailing '/'. */
- fprintf (stderr, " %.*s\n", (int) strlen (p->fname) - 1, p->fname);
- }
- notice ("End of search list.\n");
- {
- struct default_include * d;
- notice ("The following default directories have been omitted from the search path:\n");
- for (d = include_defaults; d->fname; d++)
- if (! d->included)
- fprintf (stderr, " %s\n", d->fname);
- notice ("End of omitted list.\n");
- }
- }
-
- /* -MG doesn't select the form of output and must be specified with one of
- -M or -MM. -MG doesn't make sense with -MD or -MMD since they don't
- inhibit compilation. */
- if (print_deps_missing_files && (print_deps == 0 || !inhibit_output))
- fatal ("-MG must be specified with one of -M or -MM");
-
- /* Either of two environment variables can specify output of deps.
- Its value is either "OUTPUT_FILE" or "OUTPUT_FILE DEPS_TARGET",
- where OUTPUT_FILE is the file to write deps info to
- and DEPS_TARGET is the target to mention in the deps. */
-
- if (print_deps == 0
- && (getenv ("SUNPRO_DEPENDENCIES") != 0
- || getenv ("DEPENDENCIES_OUTPUT") != 0)) {
- char *spec = getenv ("DEPENDENCIES_OUTPUT");
- char *s;
- char *output_file;
-
- if (spec == 0) {
- spec = getenv ("SUNPRO_DEPENDENCIES");
- print_deps = 2;
- }
- else
- print_deps = 1;
-
- s = spec;
- /* Find the space before the DEPS_TARGET, if there is one. */
- /* This should use index. (mrs) */
- while (*s != 0 && *s != ' ') s++;
- if (*s != 0) {
- deps_target = s + 1;
- output_file = xmalloc (s - spec + 1);
- bcopy (spec, output_file, s - spec);
- output_file[s - spec] = 0;
- }
- else {
- deps_target = 0;
- output_file = spec;
- }
-
- deps_file = output_file;
- deps_mode = "a";
- }
-
- /* For -M, print the expected object file name
- as the target of this Make-rule. */
- if (print_deps) {
- deps_allocated_size = 200;
- deps_buffer = xmalloc (deps_allocated_size);
- deps_buffer[0] = 0;
- deps_size = 0;
- deps_column = 0;
-
- if (deps_target) {
- deps_output (deps_target, ':');
- } else if (*in_fname == 0) {
- deps_output ("-", ':');
- } else {
- char *p, *q;
- int len;
-
- q = base_name (in_fname);
-
- /* Copy remainder to mungable area. */
- p = (char *) alloca (strlen(q) + 8);
- strcpy (p, q);
-
- /* Output P, but remove known suffixes. */
- len = strlen (p);
- q = p + len;
- if (len >= 2
- && p[len - 2] == '.'
- && index("cCsSm", p[len - 1]))
- q = p + (len - 2);
- else if (len >= 3
- && p[len - 3] == '.'
- && p[len - 2] == 'c'
- && p[len - 1] == 'c')
- q = p + (len - 3);
- else if (len >= 4
- && p[len - 4] == '.'
- && p[len - 3] == 'c'
- && p[len - 2] == 'x'
- && p[len - 1] == 'x')
- q = p + (len - 4);
- else if (len >= 4
- && p[len - 4] == '.'
- && p[len - 3] == 'c'
- && p[len - 2] == 'p'
- && p[len - 1] == 'p')
- q = p + (len - 4);
-
- /* Supply our own suffix. */
- strcpy (q, OBJECT_SUFFIX);
-
- deps_output (p, ':');
- deps_output (in_fname, ' ');
- }
- }
-
- /* Scan the -imacros files before the main input.
- Much like #including them, but with no_output set
- so that only their macro definitions matter. */
-
- no_output++; no_record_file++;
- for (i = 1; i < argc; i++)
- if (pend_files[i]) {
- struct include_file *inc;
- int fd = open_include_file (pend_files[i], NULL_PTR, NULL_PTR, &inc);
- if (fd < 0) {
- perror_with_name (pend_files[i]);
- return FATAL_EXIT_CODE;
- }
- finclude (fd, inc, &outbuf, 0, NULL_PTR);
- }
- no_output--; no_record_file--;
-
- /* Copy the entire contents of the main input file into
- the stacked input buffer previously allocated for it. */
-
- /* JF check for stdin */
- if (in_fname == NULL || *in_fname == 0) {
- in_fname = "";
- f = 0;
- } else if ((f = open (in_fname, O_RDONLY, 0666)) < 0)
- goto perror;
-
- if (fstat (f, &st) != 0)
- pfatal_with_name (in_fname);
- fp->nominal_fname = fp->fname = in_fname;
- fp->nominal_fname_len = strlen (in_fname);
- fp->lineno = 1;
- fp->system_header_p = 0;
- /* JF all this is mine about reading pipes and ttys */
- if (! S_ISREG (st.st_mode)) {
- /* Read input from a file that is not a normal disk file.
- We cannot preallocate a buffer with the correct size,
- so we must read in the file a piece at the time and make it bigger. */
- int size;
- int bsize;
- int cnt;
-
- if (S_ISDIR (st.st_mode))
- fatal ("Input file `%s' is a directory", in_fname);
-
- bsize = 2000;
- size = 0;
- fp->buf = (U_CHAR *) xmalloc (bsize + 2);
- for (;;) {
- cnt = safe_read (f, (char *) fp->buf + size, bsize - size);
- if (cnt < 0) goto perror; /* error! */
- size += cnt;
- if (size != bsize) break; /* End of file */
- bsize *= 2;
- fp->buf = (U_CHAR *) xrealloc (fp->buf, bsize + 2);
- }
- fp->length = size;
- } else {
- /* Read a file whose size we can determine in advance.
- For the sake of VMS, st.st_size is just an upper bound. */
- size_t s = (size_t) st.st_size;
- if (s != st.st_size || s + 2 < s)
- memory_full ();
- fp->buf = (U_CHAR *) xmalloc (s + 2);
- fp->length = safe_read (f, (char *) fp->buf, s);
- if (fp->length < 0) goto perror;
- }
- fp->bufp = fp->buf;
- fp->if_stack = if_stack;
-
- /* Make sure data ends with a newline. And put a null after it. */
-
- if ((fp->length > 0 && fp->buf[fp->length - 1] != '\n')
- /* Backslash-newline at end is not good enough. */
- || (fp->length > 1 && fp->buf[fp->length - 2] == '\\')) {
- fp->buf[fp->length++] = '\n';
- missing_newline = 1;
- }
- fp->buf[fp->length] = '\0';
-
- /* Unless inhibited, convert trigraphs in the input. */
-
- if (!no_trigraphs)
- trigraph_pcp (fp);
-
- /* Now that we know the input file is valid, open the output. */
-
- if (!out_fname || !strcmp (out_fname, ""))
- out_fname = "stdout";
- else if (! freopen (out_fname, "w", stdout))
- pfatal_with_name (out_fname);
-
- output_line_directive (fp, &outbuf, 0, same_file);
-
- /* Scan the -include files before the main input. */
-
- no_record_file++;
- for (i = 1; i < argc; i++)
- if (pend_includes[i]) {
- struct include_file *inc;
- int fd = open_include_file (pend_includes[i], NULL_PTR, NULL_PTR, &inc);
- if (fd < 0) {
- perror_with_name (pend_includes[i]);
- return FATAL_EXIT_CODE;
- }
- finclude (fd, inc, &outbuf, 0, NULL_PTR);
- }
- no_record_file--;
-
- /* Scan the input, processing macros and directives. */
-
- rescan (&outbuf, 0);
-
- if (missing_newline)
- fp->lineno--;
-
- if (pedantic && missing_newline)
- pedwarn ("file does not end in newline");
-
- /* Now we have processed the entire input
- Write whichever kind of output has been requested. */
-
- if (dump_macros == dump_only)
- dump_all_macros ();
- else if (! inhibit_output) {
- write_output ();
- }
-
- if (print_deps) {
- /* Don't actually write the deps file if compilation has failed. */
- if (errors == 0) {
- if (deps_file && ! (deps_stream = fopen (deps_file, deps_mode)))
- pfatal_with_name (deps_file);
- fputs (deps_buffer, deps_stream);
- putc ('\n', deps_stream);
- if (deps_file) {
- if (ferror (deps_stream) || fclose (deps_stream) != 0)
- fatal ("I/O error on output");
- }
- }
- }
-
- if (pcp_outfile && pcp_outfile != stdout
- && (ferror (pcp_outfile) || fclose (pcp_outfile) != 0))
- fatal ("I/O error on `-pcp' output");
-
- if (ferror (stdout) || fclose (stdout) != 0)
- fatal ("I/O error on output");
-
- if (errors)
- exit (FATAL_EXIT_CODE);
- exit (SUCCESS_EXIT_CODE);
-
- perror:
- pfatal_with_name (in_fname);
- return 0;
-}
-
-/* Given a colon-separated list of file names PATH,
- add all the names to the search path for include files. */
-
-static void
-path_include (path)
- char *path;
-{
- char *p;
-
- p = path;
-
- if (*p)
- while (1) {
- char *q = p;
- char c;
- struct file_name_list *dirtmp;
-
- /* Find the end of this name. */
- while ((c = *q++) != PATH_SEPARATOR && c)
- continue;
-
- q[-1] = 0;
- dirtmp = new_include_prefix (last_include, NULL_PTR,
- "", p == q ? "." : p);
- q[-1] = c;
- append_include_chain (dirtmp, dirtmp);
-
- /* Advance past this name. */
- p = q;
- if (! c)
- break;
- }
-}
-
-/* Return the address of the first character in S that equals C.
- S is an array of length N, possibly containing '\0's, and followed by '\0'.
- Return 0 if there is no such character. Assume that C itself is not '\0'.
- If we knew we could use memchr, we could just invoke memchr (S, C, N),
- but unfortunately memchr isn't autoconfigured yet. */
-
-static U_CHAR *
-index0 (s, c, n)
- U_CHAR *s;
- int c;
- size_t n;
-{
- char *p = (char *) s;
- for (;;) {
- char *q = index (p, c);
- if (q)
- return (U_CHAR *) q;
- else {
- size_t l = strlen (p);
- if (l == n)
- return 0;
- l++;
- p += l;
- n -= l;
- }
- }
-}
-
-/* Pre-C-Preprocessor to translate ANSI trigraph idiocy in BUF
- before main CCCP processing. Name `pcp' is also in honor of the
- drugs the trigraph designers must have been on.
-
- Using an extra pass through the buffer takes a little extra time,
- but is infinitely less hairy than trying to handle trigraphs inside
- strings, etc. everywhere, and also makes sure that trigraphs are
- only translated in the top level of processing. */
-
-static void
-trigraph_pcp (buf)
- FILE_BUF *buf;
-{
- register U_CHAR c, *fptr, *bptr, *sptr, *lptr;
- int len;
-
- fptr = bptr = sptr = buf->buf;
- lptr = fptr + buf->length;
- while ((sptr = index0 (sptr, '?', (size_t) (lptr - sptr))) != NULL) {
- if (*++sptr != '?')
- continue;
- switch (*++sptr) {
- case '=':
- c = '#';
- break;
- case '(':
- c = '[';
- break;
- case '/':
- c = '\\';
- break;
- case ')':
- c = ']';
- break;
- case '\'':
- c = '^';
- break;
- case '<':
- c = '{';
- break;
- case '!':
- c = '|';
- break;
- case '>':
- c = '}';
- break;
- case '-':
- c = '~';
- break;
- case '?':
- sptr--;
- continue;
- default:
- continue;
- }
- len = sptr - fptr - 2;
-
- /* BSD doc says bcopy () works right for overlapping strings. In ANSI
- C, this will be memmove (). */
- if (bptr != fptr && len > 0)
- bcopy ((char *) fptr, (char *) bptr, len);
-
- bptr += len;
- *bptr++ = c;
- fptr = ++sptr;
- }
- len = buf->length - (fptr - buf->buf);
- if (bptr != fptr && len > 0)
- bcopy ((char *) fptr, (char *) bptr, len);
- buf->length -= fptr - bptr;
- buf->buf[buf->length] = '\0';
- if (warn_trigraphs && fptr != bptr)
- warning_with_line (0, "%lu trigraph(s) encountered",
- (unsigned long) (fptr - bptr) / 2);
-}
-
-/* Move all backslash-newline pairs out of embarrassing places.
- Exchange all such pairs following BP
- with any potentially-embarrassing characters that follow them.
- Potentially-embarrassing characters are / and *
- (because a backslash-newline inside a comment delimiter
- would cause it not to be recognized). */
-
-static void
-newline_fix (bp)
- U_CHAR *bp;
-{
- register U_CHAR *p = bp;
-
- /* First count the backslash-newline pairs here. */
-
- while (p[0] == '\\' && p[1] == '\n')
- p += 2;
-
- /* What follows the backslash-newlines is not embarrassing. */
-
- if (*p != '/' && *p != '*')
- return;
-
- /* Copy all potentially embarrassing characters
- that follow the backslash-newline pairs
- down to where the pairs originally started. */
-
- while (*p == '*' || *p == '/')
- *bp++ = *p++;
-
- /* Now write the same number of pairs after the embarrassing chars. */
- while (bp < p) {
- *bp++ = '\\';
- *bp++ = '\n';
- }
-}
-
-/* Like newline_fix but for use within a directive-name.
- Move any backslash-newlines up past any following symbol constituents. */
-
-static void
-name_newline_fix (bp)
- U_CHAR *bp;
-{
- register U_CHAR *p = bp;
-
- /* First count the backslash-newline pairs here. */
- while (p[0] == '\\' && p[1] == '\n')
- p += 2;
-
- /* What follows the backslash-newlines is not embarrassing. */
-
- if (!is_idchar[*p])
- return;
-
- /* Copy all potentially embarrassing characters
- that follow the backslash-newline pairs
- down to where the pairs originally started. */
-
- while (is_idchar[*p])
- *bp++ = *p++;
-
- /* Now write the same number of pairs after the embarrassing chars. */
- while (bp < p) {
- *bp++ = '\\';
- *bp++ = '\n';
- }
-}
-
-/* Look for lint commands in comments.
-
- When we come in here, ibp points into a comment. Limit is as one expects.
- scan within the comment -- it should start, after lwsp, with a lint command.
- If so that command is returned as a (constant) string.
-
- Upon return, any arg will be pointed to with argstart and will be
- arglen long. Note that we don't parse that arg since it will just
- be printed out again. */
-
-static char *
-get_lintcmd (ibp, limit, argstart, arglen, cmdlen)
- register U_CHAR *ibp;
- register U_CHAR *limit;
- U_CHAR **argstart; /* point to command arg */
- int *arglen, *cmdlen; /* how long they are */
-{
- HOST_WIDEST_INT linsize;
- register U_CHAR *numptr; /* temp for arg parsing */
-
- *arglen = 0;
-
- SKIP_WHITE_SPACE (ibp);
-
- if (ibp >= limit) return NULL;
-
- linsize = limit - ibp;
-
- /* Oh, I wish C had lexical functions... hell, I'll just open-code the set */
- if ((linsize >= 10) && !bcmp (ibp, "NOTREACHED", 10)) {
- *cmdlen = 10;
- return "NOTREACHED";
- }
- if ((linsize >= 8) && !bcmp (ibp, "ARGSUSED", 8)) {
- *cmdlen = 8;
- return "ARGSUSED";
- }
- if ((linsize >= 11) && !bcmp (ibp, "LINTLIBRARY", 11)) {
- *cmdlen = 11;
- return "LINTLIBRARY";
- }
- if ((linsize >= 7) && !bcmp (ibp, "VARARGS", 7)) {
- *cmdlen = 7;
- ibp += 7; linsize -= 7;
- if ((linsize == 0) || ! ISDIGIT (*ibp)) return "VARARGS";
-
- /* OK, read a number */
- for (numptr = *argstart = ibp; (numptr < limit) && ISDIGIT (*numptr);
- numptr++);
- *arglen = numptr - *argstart;
- return "VARARGS";
- }
- return NULL;
-}
-
-/*
- * The main loop of the program.
- *
- * Read characters from the input stack, transferring them to the
- * output buffer OP.
- *
- * Macros are expanded and push levels on the input stack.
- * At the end of such a level it is popped off and we keep reading.
- * At the end of any other kind of level, we return.
- * #-directives are handled, except within macros.
- *
- * If OUTPUT_MARKS is nonzero, keep Newline markers found in the input
- * and insert them when appropriate. This is set while scanning macro
- * arguments before substitution. It is zero when scanning for final output.
- * There are three types of Newline markers:
- * * Newline - follows a macro name that was not expanded
- * because it appeared inside an expansion of the same macro.
- * This marker prevents future expansion of that identifier.
- * When the input is rescanned into the final output, these are deleted.
- * These are also deleted by ## concatenation.
- * * Newline Space (or Newline and any other whitespace character)
- * stands for a place that tokens must be separated or whitespace
- * is otherwise desirable, but where the ANSI standard specifies there
- * is no whitespace. This marker turns into a Space (or whichever other
- * whitespace char appears in the marker) in the final output,
- * but it turns into nothing in an argument that is stringified with #.
- * Such stringified arguments are the only place where the ANSI standard
- * specifies with precision that whitespace may not appear.
- *
- * During this function, IP->bufp is kept cached in IBP for speed of access.
- * Likewise, OP->bufp is kept in OBP. Before calling a subroutine
- * IBP, IP and OBP must be copied back to memory. IP and IBP are
- * copied back with the RECACHE macro. OBP must be copied back from OP->bufp
- * explicitly, and before RECACHE, since RECACHE uses OBP.
- */
-
-static void
-rescan (op, output_marks)
- FILE_BUF *op;
- int output_marks;
-{
- /* Character being scanned in main loop. */
- register U_CHAR c;
-
- /* Length of pending accumulated identifier. */
- register int ident_length = 0;
-
- /* Hash code of pending accumulated identifier. */
- register int hash = 0;
-
- /* Current input level (&instack[indepth]). */
- FILE_BUF *ip;
-
- /* Pointer for scanning input. */
- register U_CHAR *ibp;
-
- /* Pointer to end of input. End of scan is controlled by LIMIT. */
- register U_CHAR *limit;
-
- /* Pointer for storing output. */
- register U_CHAR *obp;
-
- /* REDO_CHAR is nonzero if we are processing an identifier
- after backing up over the terminating character.
- Sometimes we process an identifier without backing up over
- the terminating character, if the terminating character
- is not special. Backing up is done so that the terminating character
- will be dispatched on again once the identifier is dealt with. */
- int redo_char = 0;
-
- /* 1 if within an identifier inside of which a concatenation
- marker (Newline -) has been seen. */
- int concatenated = 0;
-
- /* While scanning a comment or a string constant,
- this records the line it started on, for error messages. */
- int start_line;
-
- /* Record position of last `real' newline. */
- U_CHAR *beg_of_line;
-
-/* Pop the innermost input stack level, assuming it is a macro expansion. */
-
-#define POPMACRO \
-do { ip->macro->type = T_MACRO; \
- if (ip->free_ptr) free (ip->free_ptr); \
- --indepth; } while (0)
-
-/* Reload `rescan's local variables that describe the current
- level of the input stack. */
-
-#define RECACHE \
-do { ip = &instack[indepth]; \
- ibp = ip->bufp; \
- limit = ip->buf + ip->length; \
- op->bufp = obp; \
- check_expand (op, limit - ibp); \
- beg_of_line = 0; \
- obp = op->bufp; } while (0)
-
- if (no_output && instack[indepth].fname != 0)
- skip_if_group (&instack[indepth], 1, NULL);
-
- obp = op->bufp;
- RECACHE;
-
- beg_of_line = ibp;
-
- /* Our caller must always put a null after the end of
- the input at each input stack level. */
- if (*limit != 0)
- abort ();
-
- while (1) {
- c = *ibp++;
- *obp++ = c;
-
- switch (c) {
- case '\\':
- if (*ibp == '\n' && !ip->macro) {
- /* At the top level, always merge lines ending with backslash-newline,
- even in middle of identifier. But do not merge lines in a macro,
- since backslash might be followed by a newline-space marker. */
- ++ibp;
- ++ip->lineno;
- --obp; /* remove backslash from obuf */
- break;
- }
- /* If ANSI, backslash is just another character outside a string. */
- if (!traditional)
- goto randomchar;
- /* Otherwise, backslash suppresses specialness of following char,
- so copy it here to prevent the switch from seeing it.
- But first get any pending identifier processed. */
- if (ident_length > 0)
- goto specialchar;
- if (ibp < limit)
- *obp++ = *ibp++;
- break;
-
- case '%':
- if (ident_length || ip->macro || traditional)
- goto randomchar;
- while (*ibp == '\\' && ibp[1] == '\n') {
- ibp += 2;
- ++ip->lineno;
- }
- if (*ibp != ':')
- break;
- /* Treat this %: digraph as if it were #. */
- /* Fall through. */
-
- case '#':
- if (assertions_flag) {
- if (ident_length)
- goto specialchar;
- /* Copy #foo (bar lose) without macro expansion. */
- obp[-1] = '#'; /* In case it was '%'. */
- SKIP_WHITE_SPACE (ibp);
- while (is_idchar[*ibp])
- *obp++ = *ibp++;
- SKIP_WHITE_SPACE (ibp);
- if (*ibp == '(') {
- ip->bufp = ibp;
- skip_paren_group (ip);
- bcopy ((char *) ibp, (char *) obp, ip->bufp - ibp);
- obp += ip->bufp - ibp;
- ibp = ip->bufp;
- }
- break;
- }
-
- /* If this is expanding a macro definition, don't recognize
- preprocessing directives. */
- if (ip->macro != 0)
- goto randomchar;
- /* If this is expand_into_temp_buffer,
- don't recognize them either. Warn about them
- only after an actual newline at this level,
- not at the beginning of the input level. */
- if (! ip->fname) {
- if (ip->buf != beg_of_line)
- warning ("preprocessing directive not recognized within macro arg");
- goto randomchar;
- }
- if (ident_length)
- goto specialchar;
-
-
- /* # keyword: a # must be first nonblank char on the line */
- if (beg_of_line == 0)
- goto randomchar;
- {
- U_CHAR *bp;
-
- /* Scan from start of line, skipping whitespace, comments
- and backslash-newlines, and see if we reach this #.
- If not, this # is not special. */
- bp = beg_of_line;
- /* If -traditional, require # to be at beginning of line. */
- if (!traditional) {
- while (1) {
- if (is_hor_space[*bp])
- bp++;
- else if (*bp == '\\' && bp[1] == '\n')
- bp += 2;
- else if (*bp == '/' && bp[1] == '*') {
- bp += 2;
- while (1)
- {
- if (*bp == '*')
- {
- if (bp[1] == '/')
- {
- bp += 2;
- break;
- }
- }
- else
- {
-#ifdef MULTIBYTE_CHARS
- int length;
- length = local_mblen (bp, limit - bp);
- if (length > 1)
- bp += (length - 1);
-#endif
- }
- bp++;
- }
- }
- /* There is no point in trying to deal with C++ // comments here,
- because if there is one, then this # must be part of the
- comment and we would never reach here. */
- else break;
- }
- if (c == '%') {
- if (bp[0] != '%')
- break;
- while (bp[1] == '\\' && bp[2] == '\n')
- bp += 2;
- if (bp + 1 != ibp)
- break;
- /* %: appears at start of line; skip past the ':' too. */
- bp++;
- ibp++;
- }
- }
- if (bp + 1 != ibp)
- goto randomchar;
- }
-
- /* This # can start a directive. */
-
- --obp; /* Don't copy the '#' */
-
- ip->bufp = ibp;
- op->bufp = obp;
- if (! handle_directive (ip, op)) {
-#ifdef USE_C_ALLOCA
- alloca (0);
-#endif
- /* Not a known directive: treat it as ordinary text.
- IP, OP, IBP, etc. have not been changed. */
- if (no_output && instack[indepth].fname) {
- /* If not generating expanded output,
- what we do with ordinary text is skip it.
- Discard everything until next # directive. */
- skip_if_group (&instack[indepth], 1, 0);
- RECACHE;
- beg_of_line = ibp;
- break;
- }
- *obp++ = '#'; /* Copy # (even if it was originally %:). */
- /* Don't expand an identifier that could be a macro directive.
- (Section 3.8.3 of the ANSI C standard) */
- SKIP_WHITE_SPACE (ibp);
- if (is_idstart[*ibp])
- {
- *obp++ = *ibp++;
- while (is_idchar[*ibp])
- *obp++ = *ibp++;
- }
- goto randomchar;
- }
-#ifdef USE_C_ALLOCA
- alloca (0);
-#endif
- /* A # directive has been successfully processed. */
- /* If not generating expanded output, ignore everything until
- next # directive. */
- if (no_output && instack[indepth].fname)
- skip_if_group (&instack[indepth], 1, 0);
- obp = op->bufp;
- RECACHE;
- beg_of_line = ibp;
- break;
-
- case '\"': /* skip quoted string */
- case '\'':
- /* A single quoted string is treated like a double -- some
- programs (e.g., troff) are perverse this way */
-
- /* Handle any pending identifier;
- but the L in L'...' or L"..." is not an identifier. */
- if (ident_length) {
- if (! (ident_length == 1 && hash == HASHSTEP (0, 'L')))
- goto specialchar;
- ident_length = hash = 0;
- }
-
- start_line = ip->lineno;
-
- /* Skip ahead to a matching quote. */
-
- while (1) {
- if (ibp >= limit) {
- if (ip->macro != 0) {
- /* try harder: this string crosses a macro expansion boundary.
- This can happen naturally if -traditional.
- Otherwise, only -D can make a macro with an unmatched quote. */
- POPMACRO;
- RECACHE;
- continue;
- }
- if (!traditional) {
- error_with_line (line_for_error (start_line),
- "unterminated string or character constant");
- if (multiline_string_line) {
- error_with_line (multiline_string_line,
- "possible real start of unterminated constant");
- multiline_string_line = 0;
- }
- }
- break;
- }
- *obp++ = *ibp;
- switch (*ibp++) {
- case '\n':
- ++ip->lineno;
- ++op->lineno;
- /* Traditionally, end of line ends a string constant with no error.
- So exit the loop and record the new line. */
- if (traditional) {
- beg_of_line = ibp;
- goto while2end;
- }
- if (c == '\'') {
- error_with_line (line_for_error (start_line),
- "unterminated character constant");
- goto while2end;
- }
- if (multiline_string_line == 0) {
- if (pedantic)
- pedwarn_with_line (line_for_error (start_line),
- "string constant runs past end of line");
- multiline_string_line = ip->lineno - 1;
- }
- break;
-
- case '\\':
- if (*ibp == '\n') {
- /* Backslash newline is replaced by nothing at all, but
- keep the line counts correct. But if we are reading
- from a macro, keep the backslash newline, since backslash
- newlines have already been processed. */
- if (ip->macro)
- *obp++ = '\n';
- else
- --obp;
- ++ibp;
- ++ip->lineno;
- } else {
- /* ANSI stupidly requires that in \\ the second \
- is *not* prevented from combining with a newline. */
- if (!ip->macro) {
- while (*ibp == '\\' && ibp[1] == '\n') {
- ibp += 2;
- ++ip->lineno;
- }
- }
- *obp++ = *ibp++;
- }
- break;
-
- case '\"':
- case '\'':
- if (ibp[-1] == c)
- goto while2end;
- break;
-#ifdef MULTIBYTE_CHARS
- default:
- {
- int length;
- --ibp;
- length = local_mblen (ibp, limit - ibp);
- if (length > 0)
- {
- --obp;
- bcopy (ibp, obp, length);
- obp += length;
- ibp += length;
- }
- else
- ++ibp;
- }
- break;
-#endif
- }
- }
- while2end:
- break;
-
- case '/':
- if (ip->macro != 0)
- goto randomchar;
- if (*ibp == '\\' && ibp[1] == '\n')
- newline_fix (ibp);
- if (*ibp != '*'
- && !(cplusplus_comments && *ibp == '/'))
- goto randomchar;
- if (ident_length)
- goto specialchar;
-
- if (*ibp == '/') {
- /* C++ style comment... */
- start_line = ip->lineno;
-
- /* Comments are equivalent to spaces. */
- if (! put_out_comments)
- obp[-1] = ' ';
-
- {
- U_CHAR *before_bp = ibp;
-
- while (++ibp < limit) {
- if (*ibp == '\n')
- {
- if (put_out_comments) {
- bcopy ((char *) before_bp, (char *) obp, ibp - before_bp);
- obp += ibp - before_bp;
- }
- break;
- }
- if (*ibp == '\\')
- {
- if (ibp + 1 < limit && ibp[1] == '\n')
- {
- if (warn_comments)
- warning ("multiline `//' comment");
- ++ip->lineno;
- /* Copy the newline into the output buffer, in order to
- avoid the pain of a #line every time a multiline comment
- is seen. */
- if (!put_out_comments)
- *obp++ = '\n';
- ++op->lineno;
- ++ibp;
- }
- }
- else
- {
-#ifdef MULTIBYTE_CHARS
- int length;
- length = local_mblen (ibp, limit - ibp);
- if (length > 1)
- ibp += (length - 1);
-#endif
- }
- }
- break;
- }
- }
-
- /* Ordinary C comment. Skip it, optionally copying it to output. */
-
- start_line = ip->lineno;
-
- ++ibp; /* Skip the star. */
-
- /* If this cpp is for lint, we peek inside the comments: */
- if (for_lint) {
- U_CHAR *argbp;
- int cmdlen, arglen;
- char *lintcmd = get_lintcmd (ibp, limit, &argbp, &arglen, &cmdlen);
-
- if (lintcmd != NULL) {
- op->bufp = obp;
- check_expand (op, cmdlen + arglen + 14);
- obp = op->bufp;
- /* I believe it is always safe to emit this newline: */
- obp[-1] = '\n';
- bcopy ("#pragma lint ", (char *) obp, 13);
- obp += 13;
- bcopy (lintcmd, (char *) obp, cmdlen);
- obp += cmdlen;
-
- if (arglen != 0) {
- *(obp++) = ' ';
- bcopy (argbp, (char *) obp, arglen);
- obp += arglen;
- }
-
- /* OK, now bring us back to the state we were in before we entered
- this branch. We need #line because the #pragma's newline always
- messes up the line count. */
- op->bufp = obp;
- output_line_directive (ip, op, 0, same_file);
- check_expand (op, limit - ibp + 2);
- obp = op->bufp;
- *(obp++) = '/';
- }
- }
-
- /* Comments are equivalent to spaces.
- Note that we already output the slash; we might not want it.
- For -traditional, a comment is equivalent to nothing. */
- if (! put_out_comments) {
- if (traditional)
- obp--;
- else
- obp[-1] = ' ';
- }
- else
- *obp++ = '*';
-
- {
- U_CHAR *before_bp = ibp;
-
- for (;;) {
- switch (*ibp++) {
- case '*':
- if (ibp[-2] == '/' && warn_comments)
- warning ("`/*' within comment");
- if (*ibp == '\\' && ibp[1] == '\n')
- newline_fix (ibp);
- if (*ibp == '/')
- goto comment_end;
- break;
-
- case '\n':
- ++ip->lineno;
- /* Copy the newline into the output buffer, in order to
- avoid the pain of a #line every time a multiline comment
- is seen. */
- if (!put_out_comments)
- *obp++ = '\n';
- ++op->lineno;
- break;
-
- case 0:
- if (limit < ibp) {
- error_with_line (line_for_error (start_line),
- "unterminated comment");
- goto limit_reached;
- }
- break;
-#ifdef MULTIBYTE_CHARS
- default:
- {
- int length;
- length = local_mblen (ibp, limit - ibp);
- if (length > 1)
- ibp += (length - 1);
- }
- break;
-#endif
- }
- }
- comment_end:
-
- ibp++;
- if (put_out_comments) {
- bcopy ((char *) before_bp, (char *) obp, ibp - before_bp);
- obp += ibp - before_bp;
- }
- }
- break;
-
- case '$':
- if (! is_idchar['$'])
- goto randomchar;
- if (pedantic)
- pedwarn ("`$' in identifier");
- goto letter;
-
- case '0': case '1': case '2': case '3': case '4':
- case '5': case '6': case '7': case '8': case '9':
- /* If digit is not part of identifier, it starts a number,
- which means that following letters are not an identifier.
- "0x5" does not refer to an identifier "x5".
- So copy all alphanumerics that follow without accumulating
- as an identifier. Periods also, for sake of "3.e7". */
-
- if (ident_length == 0) {
- for (;;) {
- if (!ip->macro) {
- while (ibp[0] == '\\' && ibp[1] == '\n') {
- ++ip->lineno;
- ibp += 2;
- }
- }
- c = *ibp++;
- if (!is_idchar[c] && c != '.') {
- --ibp;
- break;
- }
- *obp++ = c;
- /* A sign can be part of a preprocessing number
- if it follows an `e' or `p'. */
- if (c == 'e' || c == 'E' || c == 'p' || c == 'P') {
- if (!ip->macro) {
- while (ibp[0] == '\\' && ibp[1] == '\n') {
- ++ip->lineno;
- ibp += 2;
- }
- }
- if (*ibp == '+' || *ibp == '-') {
- *obp++ = *ibp++;
- /* But traditional C does not let the token go past the sign,
- and C89 does not allow `p'. */
- if (traditional || (c89 && (c == 'p' || c == 'P')))
- break;
- }
- }
- }
- break;
- }
- /* fall through */
-
- case '_':
- case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
- case 'g': case 'h': case 'i': case 'j': case 'k': case 'l':
- case 'm': case 'n': case 'o': case 'p': case 'q': case 'r':
- case 's': case 't': case 'u': case 'v': case 'w': case 'x':
- case 'y': case 'z':
- case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
- case 'G': case 'H': case 'I': case 'J': case 'K': case 'L':
- case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R':
- case 'S': case 'T': case 'U': case 'V': case 'W': case 'X':
- case 'Y': case 'Z':
- letter:
- ident_length++;
- /* Compute step of hash function, to avoid a proc call on every token */
- hash = HASHSTEP (hash, c);
- break;
-
- case '\n':
- if (ip->fname == 0 && *ibp == '-') {
- /* Newline - inhibits expansion of preceding token.
- If expanding a macro arg, we keep the newline -.
- In final output, it is deleted.
- We recognize Newline - in macro bodies and macro args. */
- if (! concatenated) {
- ident_length = 0;
- hash = 0;
- }
- ibp++;
- if (!output_marks) {
- obp--;
- } else {
- /* If expanding a macro arg, keep the newline -. */
- *obp++ = '-';
- }
- break;
- }
-
- /* If reprocessing a macro expansion, newline is a special marker. */
- else if (ip->macro != 0) {
- /* Newline White is a "funny space" to separate tokens that are
- supposed to be separate but without space between.
- Here White means any whitespace character.
- Newline - marks a recursive macro use that is not
- supposed to be expandable. */
-
- if (is_space[*ibp]) {
- /* Newline Space does not prevent expansion of preceding token
- so expand the preceding token and then come back. */
- if (ident_length > 0)
- goto specialchar;
-
- /* If generating final output, newline space makes a space. */
- if (!output_marks) {
- obp[-1] = *ibp++;
- /* And Newline Newline makes a newline, so count it. */
- if (obp[-1] == '\n')
- op->lineno++;
- } else {
- /* If expanding a macro arg, keep the newline space.
- If the arg gets stringified, newline space makes nothing. */
- *obp++ = *ibp++;
- }
- } else abort (); /* Newline followed by something random? */
- break;
- }
-
- /* If there is a pending identifier, handle it and come back here. */
- if (ident_length > 0)
- goto specialchar;
-
- beg_of_line = ibp;
-
- /* Update the line counts and output a #line if necessary. */
- ++ip->lineno;
- ++op->lineno;
- if (ip->lineno != op->lineno) {
- op->bufp = obp;
- output_line_directive (ip, op, 1, same_file);
- check_expand (op, limit - ibp);
- obp = op->bufp;
- }
- break;
-
- /* Come here either after (1) a null character that is part of the input
- or (2) at the end of the input, because there is a null there. */
- case 0:
- if (ibp <= limit)
- /* Our input really contains a null character. */
- goto randomchar;
-
- limit_reached:
- /* At end of a macro-expansion level, pop it and read next level. */
- if (ip->macro != 0) {
- obp--;
- ibp--;
- /* If traditional, and we have an identifier that ends here,
- process it now, so we get the right error for recursion. */
- if (traditional && ident_length
- && ! is_idchar[*instack[indepth - 1].bufp]) {
- redo_char = 1;
- goto randomchar;
- }
- POPMACRO;
- RECACHE;
- break;
- }
-
- /* If we don't have a pending identifier,
- return at end of input. */
- if (ident_length == 0) {
- obp--;
- ibp--;
- op->bufp = obp;
- ip->bufp = ibp;
- goto ending;
- }
-
- /* If we do have a pending identifier, just consider this null
- a special character and arrange to dispatch on it again.
- The second time, IDENT_LENGTH will be zero so we will return. */
-
- /* Fall through */
-
-specialchar:
-
- /* Handle the case of a character such as /, ', " or null
- seen following an identifier. Back over it so that
- after the identifier is processed the special char
- will be dispatched on again. */
-
- ibp--;
- obp--;
- redo_char = 1;
-
- default:
-
-randomchar:
-
- if (ident_length > 0) {
- register HASHNODE *hp;
-
- /* We have just seen an identifier end. If it's a macro, expand it.
-
- IDENT_LENGTH is the length of the identifier
- and HASH is its hash code.
-
- The identifier has already been copied to the output,
- so if it is a macro we must remove it.
-
- If REDO_CHAR is 0, the char that terminated the identifier
- has been skipped in the output and the input.
- OBP-IDENT_LENGTH-1 points to the identifier.
- If the identifier is a macro, we must back over the terminator.
-
- If REDO_CHAR is 1, the terminating char has already been
- backed over. OBP-IDENT_LENGTH points to the identifier. */
-
- if (!pcp_outfile || pcp_inside_if) {
- for (hp = hashtab[MAKE_POS (hash) % HASHSIZE]; hp != NULL;
- hp = hp->next) {
-
- if (hp->length == ident_length) {
- int obufp_before_macroname;
- int op_lineno_before_macroname;
- register int i = ident_length;
- register U_CHAR *p = hp->name;
- register U_CHAR *q = obp - i;
- int disabled;
-
- if (! redo_char)
- q--;
-
- do { /* All this to avoid a strncmp () */
- if (*p++ != *q++)
- goto hashcollision;
- } while (--i);
-
- /* We found a use of a macro name.
- see if the context shows it is a macro call. */
-
- /* Back up over terminating character if not already done. */
- if (! redo_char) {
- ibp--;
- obp--;
- }
-
- /* Save this as a displacement from the beginning of the output
- buffer. We can not save this as a position in the output
- buffer, because it may get realloc'ed by RECACHE. */
- obufp_before_macroname = (obp - op->buf) - ident_length;
- op_lineno_before_macroname = op->lineno;
-
- if (hp->type == T_PCSTRING) {
- pcstring_used (hp); /* Mark the definition of this key
- as needed, ensuring that it
- will be output. */
- break; /* Exit loop, since the key cannot have a
- definition any longer. */
- }
-
- /* Record whether the macro is disabled. */
- disabled = hp->type == T_DISABLED;
-
- /* This looks like a macro ref, but if the macro was disabled,
- just copy its name and put in a marker if requested. */
-
- if (disabled) {
-#if 0
- /* This error check caught useful cases such as
- #define foo(x,y) bar (x (y,0), y)
- foo (foo, baz) */
- if (traditional)
- error ("recursive use of macro `%s'", hp->name);
-#endif
-
- if (output_marks) {
- op->bufp = obp;
- check_expand (op, limit - ibp + 2);
- obp = op->bufp;
- *obp++ = '\n';
- *obp++ = '-';
- }
- break;
- }
-
- /* If macro wants an arglist, verify that a '(' follows.
- first skip all whitespace, copying it to the output
- after the macro name. Then, if there is no '(',
- decide this is not a macro call and leave things that way. */
- if ((hp->type == T_MACRO || hp->type == T_DISABLED)
- && hp->value.defn->nargs >= 0)
- {
- U_CHAR *old_ibp = ibp;
- U_CHAR *old_obp = obp;
- int old_iln = ip->lineno;
- int old_oln = op->lineno;
-
- while (1) {
- /* Scan forward over whitespace, copying it to the output. */
- if (ibp == limit && ip->macro != 0) {
- POPMACRO;
- RECACHE;
- old_ibp = ibp;
- old_obp = obp;
- old_iln = ip->lineno;
- old_oln = op->lineno;
- }
- else if (is_space[*ibp]) {
- *obp++ = *ibp++;
- if (ibp[-1] == '\n') {
- if (ip->macro == 0) {
- /* Newline in a file. Count it. */
- ++ip->lineno;
- ++op->lineno;
- } else if (!output_marks) {
- /* A newline mark, and we don't want marks
- in the output. If it is newline-hyphen,
- discard it entirely. Otherwise, it is
- newline-whitechar, so keep the whitechar. */
- obp--;
- if (*ibp == '-')
- ibp++;
- else {
- if (*ibp == '\n')
- ++op->lineno;
- *obp++ = *ibp++;
- }
- } else {
- /* A newline mark; copy both chars to the output. */
- *obp++ = *ibp++;
- }
- }
- }
- else if (ip->macro)
- break;
- else if (*ibp == '/') {
- /* If a comment, copy it unchanged or discard it. */
- if (ibp[1] == '\\' && ibp[2] == '\n')
- newline_fix (ibp + 1);
- if (ibp[1] == '*') {
- if (put_out_comments) {
- *obp++ = '/';
- *obp++ = '*';
- } else if (! traditional) {
- *obp++ = ' ';
- }
- for (ibp += 2; ibp < limit; ibp++) {
- /* We need not worry about newline-marks,
- since they are never found in comments. */
- if (ibp[0] == '*') {
- if (ibp[1] == '\\' && ibp[2] == '\n')
- newline_fix (ibp + 1);
- if (ibp[1] == '/') {
- ibp += 2;
- if (put_out_comments) {
- *obp++ = '*';
- *obp++ = '/';
- }
- break;
- }
- }
- else if (*ibp == '\n') {
- /* Newline in a file. Count it. */
- ++ip->lineno;
- ++op->lineno;
- }
- else
- {
-#ifdef MULTIBYTE_CHARS
- int length;
- length = local_mblen (ibp, limit - ibp);
- if (length > 1)
- {
- if (put_out_comments)
- {
- bcopy (ibp, obp, length - 1);
- obp += length - 1;
- }
- ibp += (length - 1);
- }
-#endif
- }
- if (put_out_comments)
- *obp++ = *ibp;
- }
- } else if (ibp[1] == '/' && cplusplus_comments) {
- if (put_out_comments) {
- *obp++ = '/';
- *obp++ = '/';
- } else if (! traditional) {
- *obp++ = ' ';
- }
- for (ibp += 2; ; ibp++)
- {
- if (*ibp == '\n')
- break;
- if (*ibp == '\\' && ibp[1] == '\n')
- {
- if (put_out_comments)
- *obp++ = *ibp++;
- }
- else
- {
-#ifdef MULTIBYTE_CHARS
- int length;
- length = local_mblen (ibp, limit - ibp);
- if (length > 1)
- {
- if (put_out_comments)
- {
- bcopy (ibp, obp, length - 1);
- obp += length - 1;
- }
- ibp += (length - 1);
- }
-#endif
- }
- if (put_out_comments)
- *obp++ = *ibp;
- }
- } else
- break;
- }
- else if (ibp[0] == '\\' && ibp[1] == '\n') {
- ibp += 2;
- ++ip->lineno;
- }
- else break;
- }
- if (*ibp != '(') {
- /* It isn't a macro call.
- Put back the space that we just skipped. */
- ibp = old_ibp;
- obp = old_obp;
- ip->lineno = old_iln;
- op->lineno = old_oln;
- /* Exit the for loop. */
- break;
- }
- }
-
- /* This is now known to be a macro call.
- Discard the macro name from the output,
- along with any following whitespace just copied,
- but preserve newlines if not outputting marks since this
- is more likely to do the right thing with line numbers. */
- obp = op->buf + obufp_before_macroname;
- if (output_marks)
- op->lineno = op_lineno_before_macroname;
- else {
- int newlines = op->lineno - op_lineno_before_macroname;
- while (0 < newlines--)
- *obp++ = '\n';
- }
-
- /* Prevent accidental token-pasting with a character
- before the macro call. */
- if (!traditional && obp != op->buf) {
- switch (obp[-1]) {
- case '!': case '%': case '&': case '*':
- case '+': case '-': case '.': case '/':
- case ':': case '<': case '=': case '>':
- case '^': case '|':
- /* If we are expanding a macro arg, make a newline marker
- to separate the tokens. If we are making real output,
- a plain space will do. */
- if (output_marks)
- *obp++ = '\n';
- *obp++ = ' ';
- }
- }
-
- /* Expand the macro, reading arguments as needed,
- and push the expansion on the input stack. */
- ip->bufp = ibp;
- op->bufp = obp;
- macroexpand (hp, op);
-
- /* Reexamine input stack, since macroexpand has pushed
- a new level on it. */
- obp = op->bufp;
- RECACHE;
- break;
- }
-hashcollision:
- ;
- } /* End hash-table-search loop */
- }
- ident_length = hash = 0; /* Stop collecting identifier */
- redo_char = 0;
- concatenated = 0;
- } /* End if (ident_length > 0) */
- } /* End switch */
- } /* End per-char loop */
-
- /* Come here to return -- but first give an error message
- if there was an unterminated successful conditional. */
- ending:
- if (if_stack != ip->if_stack)
- {
- char *str;
-
- switch (if_stack->type)
- {
- case T_IF:
- str = "if";
- break;
- case T_IFDEF:
- str = "ifdef";
- break;
- case T_IFNDEF:
- str = "ifndef";
- break;
- case T_ELSE:
- str = "else";
- break;
- case T_ELIF:
- str = "elif";
- break;
- default:
- abort ();
- }
-
- error_with_line (line_for_error (if_stack->lineno),
- "unterminated `#%s' conditional", str);
- }
- if_stack = ip->if_stack;
-}
-
-/*
- * Rescan a string into a temporary buffer and return the result
- * as a FILE_BUF. Note this function returns a struct, not a pointer.
- *
- * OUTPUT_MARKS nonzero means keep Newline markers found in the input
- * and insert such markers when appropriate. See `rescan' for details.
- * OUTPUT_MARKS is 1 for macroexpanding a macro argument separately
- * before substitution; it is 0 for other uses.
- */
-static FILE_BUF
-expand_to_temp_buffer (buf, limit, output_marks, assertions)
- U_CHAR *buf, *limit;
- int output_marks, assertions;
-{
- register FILE_BUF *ip;
- FILE_BUF obuf;
- int length = limit - buf;
- U_CHAR *buf1;
- int odepth = indepth;
- int save_assertions_flag = assertions_flag;
-
- assertions_flag = assertions;
-
- if (length < 0)
- abort ();
-
- /* Set up the input on the input stack. */
-
- buf1 = (U_CHAR *) alloca (length + 1);
- {
- register U_CHAR *p1 = buf;
- register U_CHAR *p2 = buf1;
-
- while (p1 != limit)
- *p2++ = *p1++;
- }
- buf1[length] = 0;
-
- /* Set up to receive the output. */
-
- obuf.length = length * 2 + 100; /* Usually enough. Why be stingy? */
- obuf.bufp = obuf.buf = (U_CHAR *) xmalloc (obuf.length);
- obuf.nominal_fname = 0;
- obuf.inc = 0;
- obuf.dir = 0;
- obuf.fname = 0;
- obuf.macro = 0;
- obuf.if_stack = 0;
- obuf.free_ptr = 0;
- obuf.system_header_p = 0;
-
- CHECK_DEPTH ({return obuf;});
-
- ++indepth;
-
- ip = &instack[indepth];
- ip->fname = 0;
- ip->nominal_fname = 0;
- ip->nominal_fname_len = 0;
- ip->inc = 0;
- ip->system_header_p = 0;
- ip->macro = 0;
- ip->free_ptr = 0;
- ip->length = length;
- ip->buf = ip->bufp = buf1;
- ip->if_stack = if_stack;
-
- ip->lineno = obuf.lineno = 1;
-
- /* Scan the input, create the output. */
- rescan (&obuf, output_marks);
-
- /* Pop input stack to original state. */
- --indepth;
-
- if (indepth != odepth)
- abort ();
-
- /* Record the output. */
- obuf.length = obuf.bufp - obuf.buf;
-
- assertions_flag = save_assertions_flag;
- return obuf;
-}
-
-/*
- * Process a # directive. Expects IP->bufp to point after the '#', as in
- * `#define foo bar'. Passes to the directive handler
- * (do_define, do_include, etc.): the addresses of the 1st and
- * last chars of the directive (starting immediately after the #
- * keyword), plus op and the keyword table pointer. If the directive
- * contains comments it is copied into a temporary buffer sans comments
- * and the temporary buffer is passed to the directive handler instead.
- * Likewise for backslash-newlines.
- *
- * Returns nonzero if this was a known # directive.
- * Otherwise, returns zero, without advancing the input pointer.
- */
-
-static int
-handle_directive (ip, op)
- FILE_BUF *ip, *op;
-{
- register U_CHAR *bp, *cp;
- register struct directive *kt;
- register int ident_length;
- U_CHAR *resume_p;
-
- /* Nonzero means we must copy the entire directive
- to get rid of comments or backslash-newlines. */
- int copy_directive = 0;
-
- U_CHAR *ident, *after_ident;
-
- bp = ip->bufp;
-
- /* Record where the directive started. do_xifdef needs this. */
- directive_start = bp - 1;
-
- ignore_escape_flag = 1;
-
- /* Skip whitespace and \-newline. */
- while (1) {
- if (is_hor_space[*bp]) {
- if (*bp != ' ' && *bp != '\t' && pedantic)
- pedwarn_strange_white_space (*bp);
- bp++;
- } else if (*bp == '/') {
- if (bp[1] == '\\' && bp[2] == '\n')
- newline_fix (bp + 1);
- if (! (bp[1] == '*' || (cplusplus_comments && bp[1] == '/')))
- break;
- ip->bufp = bp + 2;
- skip_to_end_of_comment (ip, &ip->lineno, 0);
- bp = ip->bufp;
- } else if (*bp == '\\' && bp[1] == '\n') {
- bp += 2; ip->lineno++;
- } else break;
- }
-
- /* Now find end of directive name.
- If we encounter a backslash-newline, exchange it with any following
- symbol-constituents so that we end up with a contiguous name. */
-
- cp = bp;
- while (1) {
- if (is_idchar[*cp])
- cp++;
- else {
- if (*cp == '\\' && cp[1] == '\n')
- name_newline_fix (cp);
- if (is_idchar[*cp])
- cp++;
- else break;
- }
- }
- ident_length = cp - bp;
- ident = bp;
- after_ident = cp;
-
- /* A line of just `#' becomes blank. */
-
- if (ident_length == 0 && *after_ident == '\n') {
- ip->bufp = after_ident;
- return 1;
- }
-
- if (ident_length == 0 || !is_idstart[*ident]) {
- U_CHAR *p = ident;
- while (is_idchar[*p]) {
- if (*p < '0' || *p > '9')
- break;
- p++;
- }
- /* Handle # followed by a line number. */
- if (p != ident && !is_idchar[*p]) {
- static struct directive line_directive_table[] = {
- { 4, do_line, "line", T_LINE},
- };
- if (pedantic)
- pedwarn ("`#' followed by integer");
- after_ident = ident;
- kt = line_directive_table;
- ignore_escape_flag = 0;
- goto old_linenum;
- }
-
- /* Avoid error for `###' and similar cases unless -pedantic. */
- if (p == ident) {
- while (*p == '#' || is_hor_space[*p]) p++;
- if (*p == '\n') {
- if (pedantic && !lang_asm)
- warning ("invalid preprocessing directive");
- return 0;
- }
- }
-
- if (!lang_asm)
- error ("invalid preprocessing directive name");
-
- return 0;
- }
-
- /*
- * Decode the keyword and call the appropriate expansion
- * routine, after moving the input pointer up to the next line.
- */
- for (kt = directive_table; kt->length > 0; kt++) {
- if (kt->length == ident_length && !bcmp (kt->name, ident, ident_length)) {
- register U_CHAR *buf;
- register U_CHAR *limit;
- int unterminated;
- int junk;
- int *already_output;
-
- /* Nonzero means do not delete comments within the directive.
- #define needs this when -traditional. */
- int keep_comments;
-
- old_linenum:
-
- limit = ip->buf + ip->length;
- unterminated = 0;
- already_output = 0;
- keep_comments = traditional && kt->type == T_DEFINE;
- /* #import is defined only in Objective C, or when on the NeXT. */
- if (kt->type == T_IMPORT
- && !(objc || lookup ((U_CHAR *) "__NeXT__", -1, -1)))
- break;
-
- /* Find the end of this directive (first newline not backslashed
- and not in a string or comment).
- Set COPY_DIRECTIVE if the directive must be copied
- (it contains a backslash-newline or a comment). */
-
- buf = bp = after_ident;
- while (bp < limit) {
- register U_CHAR c = *bp++;
- switch (c) {
- case '\\':
- if (bp < limit) {
- if (*bp == '\n') {
- ip->lineno++;
- copy_directive = 1;
- bp++;
- } else if (traditional)
- bp++;
- }
- break;
-
- case '"':
- /* "..." is special for #include. */
- if (IS_INCLUDE_DIRECTIVE_TYPE (kt->type)) {
- while (bp < limit && *bp != '\n') {
- if (*bp == '"') {
- bp++;
- break;
- }
- if (*bp == '\\' && bp[1] == '\n') {
- ip->lineno++;
- copy_directive = 1;
- bp++;
- }
- bp++;
- }
- break;
- }
- /* Fall through. */
- case '\'':
- bp = skip_quoted_string (bp - 1, limit, ip->lineno, &ip->lineno, &copy_directive, &unterminated);
- /* Don't bother calling the directive if we already got an error
- message due to unterminated string. Skip everything and pretend
- we called the directive. */
- if (unterminated) {
- if (traditional) {
- /* Traditional preprocessing permits unterminated strings. */
- ip->bufp = bp;
- goto endloop1;
- }
- ip->bufp = bp;
- return 1;
- }
- break;
-
- /* <...> is special for #include. */
- case '<':
- if (! IS_INCLUDE_DIRECTIVE_TYPE (kt->type))
- break;
- while (bp < limit && *bp != '>' && *bp != '\n') {
- if (*bp == '\\' && bp[1] == '\n') {
- ip->lineno++;
- copy_directive = 1;
- bp++;
- }
- bp++;
- }
- break;
-
- case '/':
- if (*bp == '\\' && bp[1] == '\n')
- newline_fix (bp);
- if (*bp == '*'
- || (cplusplus_comments && *bp == '/')) {
- U_CHAR *obp = bp - 1;
- ip->bufp = bp + 1;
- skip_to_end_of_comment (ip, &ip->lineno, 0);
- bp = ip->bufp;
- /* No need to copy the directive because of a comment at the end;
- just don't include the comment in the directive. */
- if (!put_out_comments) {
- U_CHAR *p;
- for (p = bp; *p == ' ' || *p == '\t'; p++)
- continue;
- if (*p == '\n') {
- bp = obp;
- goto endloop1;
- }
- }
- /* Don't remove the comments if -traditional. */
- if (! keep_comments)
- copy_directive++;
- }
- break;
-
- case '\f':
- case '\r':
- case '\v':
- if (pedantic)
- pedwarn_strange_white_space (c);
- break;
-
- case '\n':
- --bp; /* Point to the newline */
- ip->bufp = bp;
- goto endloop1;
- }
- }
- ip->bufp = bp;
-
- endloop1:
- resume_p = ip->bufp;
- /* BP is the end of the directive.
- RESUME_P is the next interesting data after the directive.
- A comment may come between. */
-
- /* If a directive should be copied through, and -C was given,
- pass it through before removing comments. */
- if (!no_output && put_out_comments
- && ((kt->type == T_DEFINE || kt->type == T_UNDEF)
- ? dump_macros == dump_definitions
- : IS_INCLUDE_DIRECTIVE_TYPE (kt->type) ? dump_includes
- : kt->type == T_PRAGMA)) {
- int len;
-
- /* Output directive name. */
- check_expand (op, kt->length + 2);
- /* Make sure # is at the start of a line */
- if (op->bufp > op->buf && op->bufp[-1] != '\n') {
- op->lineno++;
- *op->bufp++ = '\n';
- }
- *op->bufp++ = '#';
- bcopy (kt->name, op->bufp, kt->length);
- op->bufp += kt->length;
-
- /* Output arguments. */
- len = (bp - buf);
- check_expand (op, len);
- bcopy (buf, (char *) op->bufp, len);
- op->bufp += len;
- /* Take account of any (escaped) newlines just output. */
- while (--len >= 0)
- if (buf[len] == '\n')
- op->lineno++;
-
- already_output = &junk;
- } /* Don't we need a newline or #line? */
-
- if (copy_directive) {
- register U_CHAR *xp = buf;
- /* Need to copy entire directive into temp buffer before dispatching */
-
- cp = (U_CHAR *) alloca (bp - buf + 5); /* room for directive plus
- some slop */
- buf = cp;
-
- /* Copy to the new buffer, deleting comments
- and backslash-newlines (and whitespace surrounding the latter). */
-
- while (xp < bp) {
- register U_CHAR c = *xp++;
- *cp++ = c;
-
- switch (c) {
- case '\n':
- abort (); /* A bare newline should never part of the line. */
- break;
-
- /* <...> is special for #include. */
- case '<':
- if (! IS_INCLUDE_DIRECTIVE_TYPE (kt->type))
- break;
- while (xp < bp && c != '>') {
- c = *xp++;
- if (c == '\\' && xp < bp && *xp == '\n')
- xp++;
- else
- *cp++ = c;
- }
- break;
-
- case '\\':
- if (*xp == '\n') {
- xp++;
- cp--;
- if (cp != buf && is_hor_space[cp[-1]]) {
- while (cp - 1 != buf && is_hor_space[cp[-2]])
- cp--;
- SKIP_WHITE_SPACE (xp);
- } else if (is_hor_space[*xp]) {
- *cp++ = *xp++;
- SKIP_WHITE_SPACE (xp);
- }
- } else if (traditional && xp < bp) {
- *cp++ = *xp++;
- }
- break;
-
- case '\'':
- case '\"':
- {
- int backslash_newlines_p = 0;
-
- register U_CHAR *bp1
- = skip_quoted_string (xp - 1, bp, ip->lineno,
- NULL_PTR, &backslash_newlines_p,
- NULL_PTR);
- if (backslash_newlines_p)
- while (xp != bp1)
- {
- /* With something like:
-
- #define X "a\
- b"
-
- we should still remove the backslash-newline
- pair as part of phase two. */
- if (xp[0] == '\\' && xp[1] == '\n')
- xp += 2;
- else
- *cp++ = *xp++;
- }
- else
- /* This is the same as the loop above, but taking
- advantage of the fact that we know there are no
- backslash-newline pairs. */
- while (xp != bp1)
- *cp++ = *xp++;
- }
- break;
-
- case '/':
- if (*xp == '*'
- || (cplusplus_comments && *xp == '/')) {
- ip->bufp = xp + 1;
- /* If we already copied the directive through,
- already_output != 0 prevents outputting comment now. */
- skip_to_end_of_comment (ip, already_output, 0);
- if (keep_comments)
- while (xp != ip->bufp)
- *cp++ = *xp++;
- /* Delete or replace the slash. */
- else if (traditional)
- cp--;
- else
- cp[-1] = ' ';
- xp = ip->bufp;
- }
- }
- }
-
- /* Null-terminate the copy. */
-
- *cp = 0;
- } else
- cp = bp;
-
- ip->bufp = resume_p;
-
- /* Some directives should be written out for cc1 to process,
- just as if they were not defined. And sometimes we're copying
- directives through. */
-
- if (!no_output && already_output == 0
- && (kt->type == T_DEFINE ? (int) dump_names <= (int) dump_macros
- : IS_INCLUDE_DIRECTIVE_TYPE (kt->type) ? dump_includes
- : kt->type == T_PRAGMA)) {
- int len;
-
- /* Output directive name. */
- check_expand (op, kt->length + 1);
- *op->bufp++ = '#';
- bcopy (kt->name, (char *) op->bufp, kt->length);
- op->bufp += kt->length;
-
- if (kt->type == T_DEFINE && dump_macros == dump_names) {
- /* Output `#define name' only. */
- U_CHAR *xp = buf;
- U_CHAR *yp;
- SKIP_WHITE_SPACE (xp);
- yp = xp;
- while (is_idchar[*xp]) xp++;
- len = (xp - yp);
- check_expand (op, len + 1);
- *op->bufp++ = ' ';
- bcopy (yp, (char *) op->bufp, len);
- } else {
- /* Output entire directive. */
- len = (cp - buf);
- check_expand (op, len);
- bcopy (buf, (char *) op->bufp, len);
- }
- op->bufp += len;
- } /* Don't we need a newline or #line? */
-
- /* Call the appropriate directive handler. buf now points to
- either the appropriate place in the input buffer, or to
- the temp buffer if it was necessary to make one. cp
- points to the first char after the contents of the (possibly
- copied) directive, in either case. */
- (*kt->func) (buf, cp, op, kt);
- check_expand (op, ip->length - (ip->bufp - ip->buf));
-
- return 1;
- }
- }
-
- /* It is deliberate that we don't warn about undefined directives.
- That is the responsibility of cc1. */
- return 0;
-}
-
-static struct tm *
-timestamp ()
-{
- static struct tm *timebuf;
- if (!timebuf) {
- time_t t = time ((time_t *) 0);
- timebuf = localtime (&t);
- }
- return timebuf;
-}
-
-static char *monthnames[] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun",
- "Jul", "Aug", "Sep", "Oct", "Nov", "Dec",
- };
-
-/*
- * expand things like __FILE__. Place the expansion into the output
- * buffer *without* rescanning.
- */
-
-static void
-special_symbol (hp, op)
- HASHNODE *hp;
- FILE_BUF *op;
-{
- char *buf;
- int i, len;
- int true_indepth;
- FILE_BUF *ip = NULL;
- struct tm *timebuf;
-
- int paren = 0; /* For special `defined' keyword */
-
- if (pcp_outfile && pcp_inside_if
- && hp->type != T_SPEC_DEFINED && hp->type != T_CONST)
- error ("Predefined macro `%s' used inside `#if' during precompilation",
- hp->name);
-
- for (i = indepth; i >= 0; i--)
- if (instack[i].fname != NULL) {
- ip = &instack[i];
- break;
- }
- if (ip == NULL) {
- error ("cccp error: not in any file?!");
- return; /* the show must go on */
- }
-
- switch (hp->type) {
- case T_FILE:
- case T_BASE_FILE:
- {
- FILE_BUF *p = hp->type == T_FILE ? ip : &instack[0];
- char *string = p->nominal_fname;
-
- if (string)
- {
- size_t string_len = p->nominal_fname_len;
- buf = (char *) alloca (3 + 4 * string_len);
- quote_string (buf, string, string_len);
- }
- else
- buf = "\"\"";
-
- break;
- }
-
- case T_INCLUDE_LEVEL:
- true_indepth = 0;
- for (i = indepth; i >= 0; i--)
- if (instack[i].fname != NULL)
- true_indepth++;
-
- buf = (char *) alloca (8); /* Eight bytes ought to be more than enough */
- sprintf (buf, "%d", true_indepth - 1);
- break;
-
- case T_VERSION:
- buf = (char *) alloca (3 + strlen (version_string));
- sprintf (buf, "\"%s\"", version_string);
- break;
-
-#ifndef NO_BUILTIN_SIZE_TYPE
- case T_SIZE_TYPE:
- buf = SIZE_TYPE;
- break;
-#endif
-
-#ifndef NO_BUILTIN_PTRDIFF_TYPE
- case T_PTRDIFF_TYPE:
- buf = PTRDIFF_TYPE;
- break;
-#endif
-
- case T_WCHAR_TYPE:
- buf = wchar_type;
- break;
-
- case T_USER_LABEL_PREFIX_TYPE:
- buf = user_label_prefix;
- break;
-
- case T_REGISTER_PREFIX_TYPE:
- buf = REGISTER_PREFIX;
- break;
-
- case T_IMMEDIATE_PREFIX_TYPE:
- buf = IMMEDIATE_PREFIX;
- break;
-
- case T_CONST:
- buf = hp->value.cpval;
-#ifdef STDC_0_IN_SYSTEM_HEADERS
- if (ip->system_header_p
- && hp->length == 8 && bcmp (hp->name, "__STDC__", 8) == 0
- && !lookup ((U_CHAR *) "__STRICT_ANSI__", -1, -1))
- buf = "0";
-#endif
- if (pcp_inside_if && pcp_outfile)
- /* Output a precondition for this macro use */
- fprintf (pcp_outfile, "#define %s %s\n", hp->name, buf);
- break;
-
- case T_SPECLINE:
- buf = (char *) alloca (10);
- sprintf (buf, "%d", ip->lineno);
- break;
-
- case T_DATE:
- case T_TIME:
- buf = (char *) alloca (20);
- timebuf = timestamp ();
- if (hp->type == T_DATE)
- sprintf (buf, "\"%s %2d %4d\"", monthnames[timebuf->tm_mon],
- timebuf->tm_mday, timebuf->tm_year + 1900);
- else
- sprintf (buf, "\"%02d:%02d:%02d\"", timebuf->tm_hour, timebuf->tm_min,
- timebuf->tm_sec);
- break;
-
- case T_SPEC_DEFINED:
- buf = " 0 "; /* Assume symbol is not defined */
- ip = &instack[indepth];
- SKIP_WHITE_SPACE (ip->bufp);
- if (*ip->bufp == '(') {
- paren++;
- ip->bufp++; /* Skip over the paren */
- SKIP_WHITE_SPACE (ip->bufp);
- }
-
- if (!is_idstart[*ip->bufp])
- goto oops;
- if (ip->bufp[0] == 'L' && (ip->bufp[1] == '\'' || ip->bufp[1] == '"'))
- goto oops;
- if ((hp = lookup (ip->bufp, -1, -1))) {
- if (pcp_outfile && pcp_inside_if
- && (hp->type == T_CONST
- || (hp->type == T_MACRO && hp->value.defn->predefined)))
- /* Output a precondition for this macro use. */
- fprintf (pcp_outfile, "#define %s\n", hp->name);
- buf = " 1 ";
- }
- else
- if (pcp_outfile && pcp_inside_if) {
- /* Output a precondition for this macro use */
- U_CHAR *cp = ip->bufp;
- fprintf (pcp_outfile, "#undef ");
- while (is_idchar[*cp]) /* Ick! */
- fputc (*cp++, pcp_outfile);
- putc ('\n', pcp_outfile);
- }
- while (is_idchar[*ip->bufp])
- ++ip->bufp;
- SKIP_WHITE_SPACE (ip->bufp);
- if (paren) {
- if (*ip->bufp != ')')
- goto oops;
- ++ip->bufp;
- }
- break;
-
-oops:
-
- error ("`defined' without an identifier");
- break;
-
- default:
- error ("cccp error: invalid special hash type"); /* time for gdb */
- abort ();
- }
- len = strlen (buf);
- check_expand (op, len);
- bcopy (buf, (char *) op->bufp, len);
- op->bufp += len;
-
- return;
-}
-
-
-/* Routines to handle #directives */
-
-/* Handle #include and #import.
- This function expects to see "fname" or <fname> on the input. */
-
-static int
-do_include (buf, limit, op, keyword)
- U_CHAR *buf, *limit;
- FILE_BUF *op;
- struct directive *keyword;
-{
- U_CHAR *importing = keyword->type == T_IMPORT ? (U_CHAR *) "" : (U_CHAR *) 0;
- int skip_dirs = (keyword->type == T_INCLUDE_NEXT);
- static int import_warning = 0;
- char *fname; /* Dynamically allocated fname buffer */
- char *pcftry;
- char *pcfname;
- char *fbeg, *fend; /* Beginning and end of fname */
- U_CHAR *fin;
-
- struct file_name_list *search_start = include; /* Chain of dirs to search */
- struct file_name_list *dsp; /* First in chain, if #include "..." */
- struct file_name_list *searchptr = 0;
- size_t flen;
-
- int f = -3; /* file number */
- struct include_file *inc = 0;
-
- int retried = 0; /* Have already tried macro
- expanding the include line*/
- int angle_brackets = 0; /* 0 for "...", 1 for <...> */
-#ifdef VMS
- int vaxc_include = 0; /* 1 for token without punctuation */
-#endif
- int pcf = -1;
- char *pcfbuf;
- char *pcfbuflimit;
- int pcfnum;
-
- if (pedantic && !instack[indepth].system_header_p)
- {
- if (importing)
- pedwarn ("ANSI C does not allow `#import'");
- if (skip_dirs)
- pedwarn ("ANSI C does not allow `#include_next'");
- }
-
- if (importing && warn_import && !inhibit_warnings
- && !instack[indepth].system_header_p && !import_warning) {
- import_warning = 1;
- warning ("using `#import' is not recommended");
- notice ("The fact that a certain header file need not be processed more than once\n\
-should be indicated in the header file, not where it is used.\n\
-The best way to do this is with a conditional of this form:\n\
-\n\
- #ifndef _FOO_H_INCLUDED\n\
- #define _FOO_H_INCLUDED\n\
- ... <real contents of file> ...\n\
- #endif /* Not _FOO_H_INCLUDED */\n\
-\n\
-Then users can use `#include' any number of times.\n\
-GNU C automatically avoids processing the file more than once\n\
-when it is equipped with such a conditional.\n");
- }
-
-get_filename:
-
- fin = buf;
- SKIP_WHITE_SPACE (fin);
- /* Discard trailing whitespace so we can easily see
- if we have parsed all the significant chars we were given. */
- while (limit != fin && is_hor_space[limit[-1]]) limit--;
- fbeg = fend = (char *) alloca (limit - fin);
-
- switch (*fin++) {
- case '\"':
- {
- FILE_BUF *fp;
- /* Copy the operand text, concatenating the strings. */
- {
- for (;;) {
- for (;;) {
- if (fin == limit)
- goto invalid_include_file_name;
- *fend = *fin++;
- if (*fend == '"')
- break;
- fend++;
- }
- if (fin == limit)
- break;
- /* If not at the end, there had better be another string. */
- /* Skip just horiz space, and don't go past limit. */
- while (fin != limit && is_hor_space[*fin]) fin++;
- if (fin != limit && *fin == '\"')
- fin++;
- else
- goto fail;
- }
- }
-
- /* We have "filename". Figure out directory this source
- file is coming from and put it on the front of the list. */
-
- /* If -I- was specified, don't search current dir, only spec'd ones. */
- if (ignore_srcdir) break;
-
- for (fp = &instack[indepth]; fp >= instack; fp--)
- {
- int n;
- char *nam;
-
- if ((nam = fp->nominal_fname) != NULL) {
- /* Found a named file. Figure out dir of the file,
- and put it in front of the search list. */
- dsp = ((struct file_name_list *)
- alloca (sizeof (struct file_name_list)
- + fp->nominal_fname_len));
- strcpy (dsp->fname, nam);
- simplify_filename (dsp->fname);
- nam = base_name (dsp->fname);
- *nam = 0;
-#ifdef VMS
- /* for hack_vms_include_specification(), a local
- dir specification must start with "./" on VMS. */
- if (nam == dsp->fname)
- {
- *nam++ = '.';
- *nam++ = '/';
- *nam = 0;
- }
-#endif
- /* But for efficiency's sake, do not insert the dir
- if it matches the search list's first dir. */
- dsp->next = search_start;
- if (!search_start || strcmp (dsp->fname, search_start->fname)) {
- search_start = dsp;
- n = nam - dsp->fname;
- if (n + INCLUDE_LEN_FUDGE > max_include_len)
- max_include_len = n + INCLUDE_LEN_FUDGE;
- }
- dsp[0].got_name_map = 0;
- break;
- }
- }
- break;
- }
-
- case '<':
- while (fin != limit && *fin != '>')
- *fend++ = *fin++;
- if (*fin == '>' && fin + 1 == limit) {
- angle_brackets = 1;
- /* If -I-, start with the first -I dir after the -I-. */
- search_start = first_bracket_include;
- break;
- }
- goto fail;
-
- default:
-#ifdef VMS
- /*
- * Support '#include xyz' like VAX-C to allow for easy use of all the
- * decwindow include files. It defaults to '#include <xyz.h>' (so the
- * code from case '<' is repeated here) and generates a warning.
- * (Note: macro expansion of `xyz' takes precedence.)
- */
- /* Note: The argument of ISALPHA() can be evaluated twice, so do
- the pre-decrement outside of the macro. */
- if (retried && (--fin, ISALPHA(*(U_CHAR *) (fin)))) {
- while (fin != limit && (!ISSPACE(*fin)))
- *fend++ = *fin++;
- warning ("VAX-C-style include specification found, use '#include <filename.h>' !");
- vaxc_include = 1;
- if (fin == limit) {
- angle_brackets = 1;
- /* If -I-, start with the first -I dir after the -I-. */
- search_start = first_bracket_include;
- break;
- }
- }
-#endif
-
- fail:
- if (! retried) {
- /* Expand buffer and then remove any newline markers.
- We can't just tell expand_to_temp_buffer to omit the markers,
- since it would put extra spaces in include file names. */
- FILE_BUF trybuf;
- U_CHAR *src;
- int errors_before_expansion = errors;
- trybuf = expand_to_temp_buffer (buf, limit, 1, 0);
- if (errors != errors_before_expansion) {
- free (trybuf.buf);
- goto invalid_include_file_name;
- }
- src = trybuf.buf;
- buf = (U_CHAR *) alloca (trybuf.bufp - trybuf.buf + 1);
- limit = buf;
- while (src != trybuf.bufp) {
- switch ((*limit++ = *src++)) {
- case '\n':
- limit--;
- src++;
- break;
-
- case '\'':
- case '\"':
- {
- U_CHAR *src1 = skip_quoted_string (src - 1, trybuf.bufp, 0,
- NULL_PTR, NULL_PTR, NULL_PTR);
- while (src != src1)
- *limit++ = *src++;
- }
- break;
- }
- }
- *limit = 0;
- free (trybuf.buf);
- retried = 1;
- goto get_filename;
- }
-
- invalid_include_file_name:
- error ("`#%s' expects \"FILENAME\" or <FILENAME>", keyword->name);
- return 0;
- }
-
- /* For #include_next, skip in the search path
- past the dir in which the containing file was found. */
- if (skip_dirs) {
- FILE_BUF *fp;
- for (fp = &instack[indepth]; fp >= instack; fp--)
- if (fp->fname != NULL) {
- /* fp->dir is null if the containing file was specified
- with an absolute file name. In that case, don't skip anything. */
- if (fp->dir)
- search_start = fp->dir->next;
- break;
- }
- }
-
- *fend = 0;
- flen = simplify_filename (fbeg);
-
- if (flen == 0)
- {
- error ("empty file name in `#%s'", keyword->name);
- return 0;
- }
-
- /* Allocate this permanently, because it gets stored in the definitions
- of macros. */
- fname = xmalloc (max_include_len + flen + 1);
- /* + 1 above for terminating null. */
-
- system_include_depth += angle_brackets;
-
- /* If specified file name is absolute, just open it. */
-
- if (absolute_filename (fbeg)) {
- strcpy (fname, fbeg);
- f = open_include_file (fname, NULL_PTR, importing, &inc);
- } else {
-
- struct bypass_dir {
- struct bypass_dir *next;
- char *fname;
- struct file_name_list *searchptr;
- } **bypass_slot = 0;
-
- /* Search directory path, trying to open the file.
- Copy each filename tried into FNAME. */
-
- for (searchptr = search_start; searchptr; searchptr = searchptr->next) {
-
- if (searchptr == first_bracket_include) {
- /* Go to bypass directory if we know we've seen this file before. */
- static struct bypass_dir *bypass_hashtab[INCLUDE_HASHSIZE];
- struct bypass_dir *p;
- bypass_slot = &bypass_hashtab[hashf ((U_CHAR *) fbeg, flen,
- INCLUDE_HASHSIZE)];
- for (p = *bypass_slot; p; p = p->next)
- if (!strcmp (fbeg, p->fname)) {
- searchptr = p->searchptr;
- bypass_slot = 0;
- break;
- }
- }
-
-#ifdef VMS
- /* Change this 1/2 Unix 1/2 VMS file specification into a
- full VMS file specification */
- if (searchptr->fname[0])
- {
- strcpy (fname, searchptr->fname);
- if (fname[strlen (fname) - 1] == ':')
- {
- char *slashp;
- slashp = strchr (fbeg, '/');
-
- /* start at root-dir of logical device if no path given. */
- if (slashp == 0)
- strcat (fname, "[000000]");
- }
- strcat (fname, fbeg);
-
- /* Fix up the filename */
- hack_vms_include_specification (fname, vaxc_include);
- }
- else
- {
- /* This is a normal VMS filespec, so use it unchanged. */
- strcpy (fname, fbeg);
- /* if it's '#include filename', add the missing .h */
- if (vaxc_include && index(fname,'.')==NULL)
- strcat (fname, ".h");
- }
-#else
- strcpy (fname, searchptr->fname);
- strcat (fname, fbeg);
-#endif /* VMS */
- f = open_include_file (fname, searchptr, importing, &inc);
- if (f != -1) {
- if (bypass_slot && searchptr != first_bracket_include) {
- /* This is the first time we found this include file,
- and we found it after first_bracket_include.
- Record its location so that we can bypass to here next time. */
- struct bypass_dir *p
- = (struct bypass_dir *) xmalloc (sizeof (struct bypass_dir));
- p->next = *bypass_slot;
- p->fname = fname + strlen (searchptr->fname);
- p->searchptr = searchptr;
- *bypass_slot = p;
- }
- break;
- }
-#ifdef VMS
- /* Our VMS hacks can produce invalid filespecs, so don't worry
- about errors other than EACCES. */
- if (errno == EACCES)
- break;
-#else
- if (errno != ENOENT && errno != ENOTDIR)
- break;
-#endif
- }
- }
-
-
- if (f < 0) {
-
- if (f == -2) {
- /* The file was already included. */
-
- /* If generating dependencies and -MG was specified, we assume missing
- files are leaf files, living in the same directory as the source file
- or other similar place; these missing files may be generated from
- other files and may not exist yet (eg: y.tab.h). */
- } else if (print_deps_missing_files
- && (system_include_depth != 0) < print_deps)
- {
- /* If it was requested as a system header file,
- then assume it belongs in the first place to look for such. */
- if (angle_brackets)
- {
- if (search_start) {
- char *p = (char *) alloca (strlen (search_start->fname)
- + strlen (fbeg) + 1);
- strcpy (p, search_start->fname);
- strcat (p, fbeg);
- deps_output (p, ' ');
- }
- }
- else
- {
- /* Otherwise, omit the directory, as if the file existed
- in the directory with the source. */
- deps_output (fbeg, ' ');
- }
- }
- /* If -M was specified, and this header file won't be added to the
- dependency list, then don't count this as an error, because we can
- still produce correct output. Otherwise, we can't produce correct
- output, because there may be dependencies we need inside the missing
- file, and we don't know what directory this missing file exists in. */
- else if (0 < print_deps && print_deps <= (system_include_depth != 0))
- warning ("No include path in which to find %s", fbeg);
- else if (f != -3)
- error_from_errno (fbeg);
- else
- error ("No include path in which to find %s", fbeg);
-
- } else {
-
- /* Actually process the file. */
-
- pcftry = (char *) alloca (strlen (fname) + 30);
- pcfbuf = 0;
- pcfnum = 0;
-
- if (!no_precomp)
- {
- do {
- sprintf (pcftry, "%s%d", fname, pcfnum++);
-
- pcf = open (pcftry, O_RDONLY, 0666);
- if (pcf != -1)
- {
- struct stat s;
-
- if (fstat (pcf, &s) != 0)
- pfatal_with_name (pcftry);
- if (! INO_T_EQ (inc->st.st_ino, s.st_ino)
- || inc->st.st_dev != s.st_dev)
- {
- pcfbuf = check_precompiled (pcf, &s, fname, &pcfbuflimit);
- /* Don't need it any more. */
- close (pcf);
- }
- else
- {
- /* Don't need it at all. */
- close (pcf);
- break;
- }
- }
- } while (pcf != -1 && !pcfbuf);
- }
-
- /* Actually process the file */
- if (pcfbuf) {
- pcfname = xmalloc (strlen (pcftry) + 1);
- strcpy (pcfname, pcftry);
- pcfinclude ((U_CHAR *) pcfbuf, (U_CHAR *) fname, op);
- }
- else
- finclude (f, inc, op, is_system_include (fname), searchptr);
- }
-
- system_include_depth -= angle_brackets;
-
- return 0;
-}
-
-/* Return nonzero if the given FILENAME is an absolute pathname which
- designates a file within one of the known "system" include file
- directories. We assume here that if the given FILENAME looks like
- it is the name of a file which resides either directly in a "system"
- include file directory, or within any subdirectory thereof, then the
- given file must be a "system" include file. This function tells us
- if we should suppress pedantic errors/warnings for the given FILENAME.
-
- The value is 2 if the file is a C-language system header file
- for which C++ should (on most systems) assume `extern "C"'. */
-
-static int
-is_system_include (filename)
- register char *filename;
-{
- struct file_name_list *searchptr;
-
- for (searchptr = first_system_include; searchptr;
- searchptr = searchptr->next)
- if (! strncmp (searchptr->fname, filename, strlen (searchptr->fname)))
- return searchptr->c_system_include_path + 1;
- return 0;
-}
-
-/* Yield the non-directory suffix of a file name. */
-
-static char *
-base_name (fname)
- char *fname;
-{
- char *s = fname;
- char *p;
-#if defined (__MSDOS__) || defined (_WIN32)
- if (ISALPHA (s[0]) && s[1] == ':') s += 2;
-#endif
-#ifdef VMS
- if ((p = rindex (s, ':'))) s = p + 1; /* Skip device. */
- if ((p = rindex (s, ']'))) s = p + 1; /* Skip directory. */
- if ((p = rindex (s, '>'))) s = p + 1; /* Skip alternate (int'n'l) dir. */
- if (s != fname)
- return s;
-#endif
- if ((p = rindex (s, '/'))) s = p + 1;
-#ifdef DIR_SEPARATOR
- if ((p = rindex (s, DIR_SEPARATOR))) s = p + 1;
-#endif
- return s;
-}
-
-/* Yield nonzero if FILENAME is absolute (i.e. not relative). */
-
-static int
-absolute_filename (filename)
- char *filename;
-{
-#if defined (__MSDOS__) \
- || (defined (_WIN32) && !defined (__CYGWIN__) && !defined (_UWIN))
- if (ISALPHA (filename[0]) && filename[1] == ':') filename += 2;
-#endif
-#if defined (__CYGWIN__)
- /* At present, any path that begins with a drive spec is absolute. */
- if (ISALPHA (filename[0]) && filename[1] == ':') return 1;
-#endif
-#ifdef VMS
- if (index (filename, ':') != 0) return 1;
-#endif
- if (filename[0] == '/') return 1;
-#ifdef DIR_SEPARATOR
- if (filename[0] == DIR_SEPARATOR) return 1;
-#endif
- return 0;
-}
-
-/* Returns whether or not a given character is a directory separator.
- Used by simplify_filename. */
-static inline
-int
-is_dir_separator(ch)
- char ch;
-{
- return (ch == DIR_SEPARATOR)
-#if defined (DIR_SEPARATOR_2)
- || (ch == DIR_SEPARATOR_2)
-#endif
- ;
-}
-
-/* Remove unnecessary characters from FILENAME in place,
- to avoid unnecessary filename aliasing.
- Return the length of the resulting string.
-
- Do only the simplifications allowed by Posix.
- It is OK to miss simplifications on non-Posix hosts,
- since this merely leads to suboptimal results. */
-
-static size_t
-simplify_filename (filename)
- char *filename;
-{
- register char *from = filename;
- register char *to = filename;
- char *to0;
-
- /* Remove redundant initial /s. */
- if (is_dir_separator (*from))
- {
- *to++ = DIR_SEPARATOR;
- if (is_dir_separator (*++from))
- {
- if (is_dir_separator (*++from))
- {
- /* 3 or more initial /s are equivalent to 1 /. */
- while (is_dir_separator (*++from))
- continue;
- }
- else
- {
- /* On some hosts // differs from /; Posix allows this. */
- *to++ = DIR_SEPARATOR;
- }
- }
- }
-
- to0 = to;
-
- for (;;)
- {
-#ifndef VMS
- if (from[0] == '.' && from[1] == '/')
- from += 2;
- else
-#endif
- {
- /* Copy this component and trailing DIR_SEPARATOR, if any. */
- while (!is_dir_separator (*to++ = *from++))
- {
- if (!to[-1])
- {
- /* Trim . component at end of nonempty name. */
- to -= filename <= to - 3 && to[-3] == DIR_SEPARATOR && to[-2] == '.';
-
- /* Trim unnecessary trailing /s. */
- while (to0 < --to && to[-1] == DIR_SEPARATOR)
- continue;
-
- *to = 0;
- return to - filename;
- }
- }
-#if defined(DIR_SEPARATOR_2)
- /* Simplify to one directory separator. */
- to[-1] = DIR_SEPARATOR;
-#endif
- }
-
- /* Skip /s after a /. */
- while (is_dir_separator (*from))
- from++;
- }
-}
-
-/* The file_name_map structure holds a mapping of file names for a
- particular directory. This mapping is read from the file named
- FILE_NAME_MAP_FILE in that directory. Such a file can be used to
- map filenames on a file system with severe filename restrictions,
- such as DOS. The format of the file name map file is just a series
- of lines with two tokens on each line. The first token is the name
- to map, and the second token is the actual name to use. */
-
-struct file_name_map
-{
- struct file_name_map *map_next;
- char *map_from;
- char *map_to;
-};
-
-#define FILE_NAME_MAP_FILE "header.gcc"
-
-/* Read a space delimited string of unlimited length from a stdio
- file. */
-
-static char *
-read_filename_string (ch, f)
- int ch;
- FILE *f;
-{
- char *alloc, *set;
- int len;
-
- len = 20;
- set = alloc = xmalloc (len + 1);
- if (! is_space[ch])
- {
- *set++ = ch;
- while ((ch = getc (f)) != EOF && ! is_space[ch])
- {
- if (set - alloc == len)
- {
- len *= 2;
- alloc = xrealloc (alloc, len + 1);
- set = alloc + len / 2;
- }
- *set++ = ch;
- }
- }
- *set = '\0';
- ungetc (ch, f);
- return alloc;
-}
-
-/* Read the file name map file for DIRNAME.
- If DIRNAME is empty, read the map file for the working directory;
- otherwise DIRNAME must end in '/'. */
-
-static struct file_name_map *
-read_name_map (dirname)
- char *dirname;
-{
- /* This structure holds a linked list of file name maps, one per
- directory. */
- struct file_name_map_list
- {
- struct file_name_map_list *map_list_next;
- char *map_list_name;
- struct file_name_map *map_list_map;
- };
- static struct file_name_map_list *map_list;
- register struct file_name_map_list *map_list_ptr;
- char *name;
- FILE *f;
- size_t dirlen;
-
- for (map_list_ptr = map_list; map_list_ptr;
- map_list_ptr = map_list_ptr->map_list_next)
- if (! strcmp (map_list_ptr->map_list_name, dirname))
- return map_list_ptr->map_list_map;
-
- map_list_ptr = ((struct file_name_map_list *)
- xmalloc (sizeof (struct file_name_map_list)));
- map_list_ptr->map_list_name = xstrdup (dirname);
- map_list_ptr->map_list_map = NULL;
-
- dirlen = strlen (dirname);
- name = (char *) alloca (dirlen + strlen (FILE_NAME_MAP_FILE) + 1);
- strcpy (name, dirname);
- strcat (name, FILE_NAME_MAP_FILE);
- f = fopen (name, "r");
- if (!f)
- map_list_ptr->map_list_map = NULL;
- else
- {
- int ch;
-
- while ((ch = getc (f)) != EOF)
- {
- char *from, *to;
- struct file_name_map *ptr;
- size_t tolen;
-
- if (is_space[ch])
- continue;
- from = read_filename_string (ch, f);
- while ((ch = getc (f)) != EOF && is_hor_space[ch])
- ;
- to = read_filename_string (ch, f);
-
- simplify_filename (from);
- tolen = simplify_filename (to);
-
- ptr = ((struct file_name_map *)
- xmalloc (sizeof (struct file_name_map)));
- ptr->map_from = from;
-
- /* Make the real filename absolute. */
- if (absolute_filename (to))
- ptr->map_to = to;
- else
- {
- ptr->map_to = xmalloc (dirlen + tolen + 1);
- strcpy (ptr->map_to, dirname);
- strcat (ptr->map_to, to);
- free (to);
- }
-
- ptr->map_next = map_list_ptr->map_list_map;
- map_list_ptr->map_list_map = ptr;
-
- while ((ch = getc (f)) != '\n')
- if (ch == EOF)
- break;
- }
- fclose (f);
- }
-
- map_list_ptr->map_list_next = map_list;
- map_list = map_list_ptr;
-
- return map_list_ptr->map_list_map;
-}
-
-/* Try to open include file FILENAME. SEARCHPTR is the directory
- being tried from the include file search path.
- IMPORTING is "" if we are importing, null otherwise.
- Return -2 if found, either a matching name or a matching inode.
- Otherwise, open the file and return a file descriptor if successful
- or -1 if unsuccessful.
- Unless unsuccessful, put a descriptor of the included file into *PINC.
- This function maps filenames on file systems based on information read by
- read_name_map. */
-
-static int
-open_include_file (filename, searchptr, importing, pinc)
- char *filename;
- struct file_name_list *searchptr;
- U_CHAR *importing;
- struct include_file **pinc;
-{
- char *fname = remap ? remap_include_file (filename, searchptr) : filename;
- int fd = -2;
-
- /* Look up FNAME in include_hashtab. */
- struct include_file **phead = &include_hashtab[hashf ((U_CHAR *) fname,
- strlen (fname),
- INCLUDE_HASHSIZE)];
- struct include_file *inc, *head = *phead;
- for (inc = head; inc; inc = inc->next)
- if (!strcmp (fname, inc->fname))
- break;
-
- if (!inc
- || ! inc->control_macro
- || (inc->control_macro[0] && ! lookup (inc->control_macro, -1, -1))) {
-
- fd = open (fname, O_RDONLY, 0);
-
- if (fd < 0)
- {
-#ifdef VMS
- /* if #include <dir/file> fails, try again with hacked spec. */
- if (!hack_vms_include_specification (fname, 0))
- return fd;
- fd = open (fname, O_RDONLY, 0);
- if (fd < 0)
-#endif
- return fd;
- }
-
- if (!inc) {
- /* FNAME was not in include_hashtab; insert a new entry. */
- inc = (struct include_file *) xmalloc (sizeof (struct include_file));
- inc->next = head;
- inc->fname = fname;
- inc->control_macro = 0;
- inc->deps_output = 0;
- if (fstat (fd, &inc->st) != 0)
- pfatal_with_name (fname);
- *phead = inc;
-
- /* Look for another file with the same inode and device. */
- if (lookup_ino_include (inc)
- && inc->control_macro
- && (!inc->control_macro[0] || lookup (inc->control_macro, -1, -1))) {
- close (fd);
- fd = -2;
- }
- }
-
- /* For -M, add this file to the dependencies. */
- if (! inc->deps_output && (system_include_depth != 0) < print_deps) {
- inc->deps_output = 1;
- deps_output (fname, ' ');
- }
-
- /* Handle -H option. */
- if (print_include_names)
- fprintf (stderr, "%*s%s\n", indepth, "", fname);
- }
-
- if (importing)
- inc->control_macro = importing;
-
- *pinc = inc;
- return fd;
-}
-
-/* Return the remapped name of the include file FILENAME.
- SEARCHPTR is the directory being tried from the include file path. */
-
-static char *
-remap_include_file (filename, searchptr)
- char *filename;
- struct file_name_list *searchptr;
-{
- register struct file_name_map *map;
- register char *from;
-
- if (searchptr)
- {
- if (! searchptr->got_name_map)
- {
- searchptr->name_map = read_name_map (searchptr->fname);
- searchptr->got_name_map = 1;
- }
-
- /* Check the mapping for the directory we are using. */
- from = filename + strlen (searchptr->fname);
- for (map = searchptr->name_map; map; map = map->map_next)
- if (! strcmp (map->map_from, from))
- return map->map_to;
- }
-
- from = base_name (filename);
-
- if (from != filename || !searchptr)
- {
- /* Try to find a mapping file for the particular directory we are
- looking in. Thus #include <sys/types.h> will look up sys/types.h
- in /usr/include/header.gcc and look up types.h in
- /usr/include/sys/header.gcc. */
-
- char *dir = (char *) alloca (from - filename + 1);
- bcopy (filename, dir, from - filename);
- dir[from - filename] = '\0';
-
- for (map = read_name_map (dir); map; map = map->map_next)
- if (! strcmp (map->map_from, from))
- return map->map_to;
- }
-
- return filename;
-}
-
-/* Insert INC into the include file table, hashed by device and inode number.
- If a file with different name but same dev+ino was already in the table,
- return 1 and set INC's control macro to the already-known macro. */
-
-static int
-lookup_ino_include (inc)
- struct include_file *inc;
-{
- int hash = ((unsigned) (inc->st.st_dev + INO_T_HASH (inc->st.st_ino))
- % INCLUDE_HASHSIZE);
- struct include_file *i = include_ino_hashtab[hash];
- inc->next_ino = i;
- include_ino_hashtab[hash] = inc;
-
- for (; i; i = i->next_ino)
- if (INO_T_EQ (inc->st.st_ino, i->st.st_ino)
- && inc->st.st_dev == i->st.st_dev) {
- inc->control_macro = i->control_macro;
- return 1;
- }
-
- return 0;
-}
-
-/* Process file descriptor F, which corresponds to include file INC,
- with output to OP.
- SYSTEM_HEADER_P is 1 if this file resides in any one of the known
- "system" include directories (as decided by the `is_system_include'
- function above).
- DIRPTR is the link in the dir path through which this file was found,
- or 0 if the file name was absolute. */
-
-static void
-finclude (f, inc, op, system_header_p, dirptr)
- int f;
- struct include_file *inc;
- FILE_BUF *op;
- int system_header_p;
- struct file_name_list *dirptr;
-{
- char *fname = inc->fname;
- int i;
- FILE_BUF *fp; /* For input stack frame */
- int missing_newline = 0;
-
- CHECK_DEPTH (return;);
-
- fp = &instack[indepth + 1];
- bzero ((char *) fp, sizeof (FILE_BUF));
- fp->nominal_fname = fp->fname = fname;
- fp->nominal_fname_len = strlen (fname);
- fp->inc = inc;
- fp->length = 0;
- fp->lineno = 1;
- fp->if_stack = if_stack;
- fp->system_header_p = system_header_p;
- fp->dir = dirptr;
-
- if (S_ISREG (inc->st.st_mode)) {
- size_t s = (size_t) inc->st.st_size;
- if (s != inc->st.st_size || s + 2 < s)
- memory_full ();
- fp->buf = (U_CHAR *) xmalloc (s + 2);
- fp->bufp = fp->buf;
-
- /* Read the file contents, knowing that s is an upper bound
- on the number of bytes we can read. */
- fp->length = safe_read (f, (char *) fp->buf, s);
- if (fp->length < 0) goto nope;
- }
- else if (S_ISDIR (inc->st.st_mode)) {
- error ("directory `%s' specified in #include", fname);
- close (f);
- return;
- } else {
- /* Cannot count its file size before reading.
- First read the entire file into heap and
- copy them into buffer on stack. */
-
- int bsize = 2000;
- int st_size = 0;
-
- fp->buf = (U_CHAR *) xmalloc (bsize + 2);
-
- for (;;) {
- i = safe_read (f, (char *) fp->buf + st_size, bsize - st_size);
- if (i < 0)
- goto nope; /* error! */
- st_size += i;
- if (st_size != bsize)
- break; /* End of file */
- bsize *= 2;
- fp->buf = (U_CHAR *) xrealloc (fp->buf, bsize + 2);
- }
- fp->bufp = fp->buf;
- fp->length = st_size;
- }
-
- if ((fp->length > 0 && fp->buf[fp->length - 1] != '\n')
- /* Backslash-newline at end is not good enough. */
- || (fp->length > 1 && fp->buf[fp->length - 2] == '\\')) {
- fp->buf[fp->length++] = '\n';
- missing_newline = 1;
- }
- fp->buf[fp->length] = '\0';
-
- /* Close descriptor now, so nesting does not use lots of descriptors. */
- close (f);
-
- /* Must do this before calling trigraph_pcp, so that the correct file name
- will be printed in warning messages. */
-
- indepth++;
- input_file_stack_tick++;
-
- if (!no_trigraphs)
- trigraph_pcp (fp);
-
- output_line_directive (fp, op, 0, enter_file);
- rescan (op, 0);
-
- if (missing_newline)
- fp->lineno--;
-
- if (pedantic && missing_newline)
- pedwarn ("file does not end in newline");
-
- indepth--;
- input_file_stack_tick++;
- output_line_directive (&instack[indepth], op, 0, leave_file);
- free (fp->buf);
- return;
-
- nope:
-
- perror_with_name (fname);
- close (f);
- free (fp->buf);
-}
-
-/* Record that inclusion of the include file INC
- should be controlled by the macro named MACRO_NAME.
- This means that trying to include the file again
- will do something if that macro is defined. */
-
-static void
-record_control_macro (inc, macro_name)
- struct include_file *inc;
- U_CHAR *macro_name;
-{
- if (!inc->control_macro || inc->control_macro[0])
- inc->control_macro = macro_name;
-}
-
-/* Load the specified precompiled header into core, and verify its
- preconditions. PCF indicates the file descriptor to read, which must
- be a regular file. *ST is its file status.
- FNAME indicates the file name of the original header.
- *LIMIT will be set to an address one past the end of the file.
- If the preconditions of the file are not satisfied, the buffer is
- freed and we return 0. If the preconditions are satisfied, return
- the address of the buffer following the preconditions. The buffer, in
- this case, should never be freed because various pieces of it will
- be referred to until all precompiled strings are output at the end of
- the run. */
-
-static char *
-check_precompiled (pcf, st, fname, limit)
- int pcf;
- struct stat *st;
- char *fname ATTRIBUTE_UNUSED;
- char **limit;
-{
- int length = 0;
- char *buf;
- char *cp;
-
- if (pcp_outfile)
- return 0;
-
- if (S_ISREG (st->st_mode))
- {
- size_t s = (size_t) st->st_size;
- if (s != st->st_size || s + 2 < s)
- memory_full ();
- buf = xmalloc (s + 2);
- length = safe_read (pcf, buf, s);
- if (length < 0)
- goto nope;
- }
- else
- abort ();
-
- if (length > 0 && buf[length-1] != '\n')
- buf[length++] = '\n';
- buf[length] = '\0';
-
- *limit = buf + length;
-
- /* File is in core. Check the preconditions. */
- if (!check_preconditions (buf))
- goto nope;
- for (cp = buf; *cp; cp++)
- ;
-#ifdef DEBUG_PCP
- fprintf (stderr, "Using preinclude %s\n", fname);
-#endif
- return cp + 1;
-
- nope:
-#ifdef DEBUG_PCP
- fprintf (stderr, "Cannot use preinclude %s\n", fname);
-#endif
- free (buf);
- return 0;
-}
-
-/* PREC (null terminated) points to the preconditions of a
- precompiled header. These are a series of #define and #undef
- lines which must match the current contents of the hash
- table. */
-
-static int
-check_preconditions (prec)
- char *prec;
-{
- MACRODEF mdef;
- char *lineend;
-
- while (*prec) {
- lineend = index (prec, '\n');
-
- if (*prec++ != '#') {
- error ("Bad format encountered while reading precompiled file");
- return 0;
- }
- if (!strncmp (prec, "define", 6)) {
- HASHNODE *hp;
-
- prec += 6;
- mdef = create_definition ((U_CHAR *) prec, (U_CHAR *) lineend, NULL_PTR);
-
- if (mdef.defn == 0)
- abort ();
-
- if ((hp = lookup (mdef.symnam, mdef.symlen, -1)) == NULL
- || (hp->type != T_MACRO && hp->type != T_CONST)
- || (hp->type == T_MACRO
- && !compare_defs (mdef.defn, hp->value.defn)
- && (mdef.defn->length != 2
- || mdef.defn->expansion[0] != '\n'
- || mdef.defn->expansion[1] != ' ')))
- return 0;
- } else if (!strncmp (prec, "undef", 5)) {
- char *name;
- int len;
-
- prec += 5;
- while (is_hor_space[(U_CHAR) *prec])
- prec++;
- name = prec;
- while (is_idchar[(U_CHAR) *prec])
- prec++;
- len = prec - name;
-
- if (lookup ((U_CHAR *) name, len, -1))
- return 0;
- } else {
- error ("Bad format encountered while reading precompiled file");
- return 0;
- }
- prec = lineend + 1;
- }
- /* They all passed successfully */
- return 1;
-}
-
-/* Process the main body of a precompiled file. BUF points to the
- string section of the file, following the preconditions. LIMIT is one
- character past the end. NAME is the name of the file being read
- in. OP is the main output buffer. */
-
-static void
-pcfinclude (buf, name, op)
- U_CHAR *buf, *name;
- FILE_BUF *op;
-{
- FILE_BUF tmpbuf;
- int nstrings;
- U_CHAR *cp = buf;
-
- /* First in the file comes 4 bytes indicating the number of strings, */
- /* in network byte order. (MSB first). */
- nstrings = *cp++;
- nstrings = (nstrings << 8) | *cp++;
- nstrings = (nstrings << 8) | *cp++;
- nstrings = (nstrings << 8) | *cp++;
-
- /* Looping over each string... */
- while (nstrings--) {
- U_CHAR *string_start;
- U_CHAR *endofthiskey;
- STRINGDEF *str;
- int nkeys;
-
- /* Each string starts with a STRINGDEF structure (str), followed */
- /* by the text of the string (string_start) */
-
- /* First skip to a longword boundary */
- /* ??? Why a 4-byte boundary? On all machines? */
- /* NOTE: This works correctly even if size_t
- is narrower than a pointer.
- Do not try risky measures here to get another type to use!
- Do not include stddef.h--it will fail! */
- if ((size_t) cp & 3)
- cp += 4 - ((size_t) cp & 3);
-
- /* Now get the string. */
- str = (STRINGDEF *) (GENERIC_PTR) cp;
- string_start = cp += sizeof (STRINGDEF);
-
- for (; *cp; cp++) /* skip the string */
- ;
-
- /* We need to macro expand the string here to ensure that the
- proper definition environment is in place. If it were only
- expanded when we find out it is needed, macros necessary for
- its proper expansion might have had their definitions changed. */
- tmpbuf = expand_to_temp_buffer (string_start, cp++, 0, 0);
- /* Lineno is already set in the precompiled file */
- str->contents = tmpbuf.buf;
- str->len = tmpbuf.length;
- str->writeflag = 0;
- str->filename = name;
- str->output_mark = outbuf.bufp - outbuf.buf;
-
- str->chain = 0;
- *stringlist_tailp = str;
- stringlist_tailp = &str->chain;
-
- /* Next comes a fourbyte number indicating the number of keys
- for this string. */
- nkeys = *cp++;
- nkeys = (nkeys << 8) | *cp++;
- nkeys = (nkeys << 8) | *cp++;
- nkeys = (nkeys << 8) | *cp++;
-
- /* If this number is -1, then the string is mandatory. */
- if (nkeys == -1)
- str->writeflag = 1;
- else
- /* Otherwise, for each key, */
- for (; nkeys--; free (tmpbuf.buf), cp = endofthiskey + 1) {
- KEYDEF *kp = (KEYDEF *) (GENERIC_PTR) cp;
- HASHNODE *hp;
-
- /* It starts with a KEYDEF structure */
- cp += sizeof (KEYDEF);
-
- /* Find the end of the key. At the end of this for loop we
- advance CP to the start of the next key using this variable. */
- endofthiskey = cp + strlen ((char *) cp);
- kp->str = str;
-
- /* Expand the key, and enter it into the hash table. */
- tmpbuf = expand_to_temp_buffer (cp, endofthiskey, 0, 0);
- tmpbuf.bufp = tmpbuf.buf;
-
- while (is_hor_space[*tmpbuf.bufp])
- tmpbuf.bufp++;
- if (!is_idstart[*tmpbuf.bufp]
- || tmpbuf.bufp == tmpbuf.buf + tmpbuf.length) {
- str->writeflag = 1;
- continue;
- }
-
- hp = lookup (tmpbuf.bufp, -1, -1);
- if (hp == NULL) {
- kp->chain = 0;
- install (tmpbuf.bufp, -1, T_PCSTRING, (char *) kp, -1);
- }
- else if (hp->type == T_PCSTRING) {
- kp->chain = hp->value.keydef;
- hp->value.keydef = kp;
- }
- else
- str->writeflag = 1;
- }
- }
- /* This output_line_directive serves to switch us back to the current
- input file in case some of these strings get output (which will
- result in line directives for the header file being output). */
- output_line_directive (&instack[indepth], op, 0, enter_file);
-}
-
-/* Called from rescan when it hits a key for strings. Mark them all
- used and clean up. */
-
-static void
-pcstring_used (hp)
- HASHNODE *hp;
-{
- KEYDEF *kp;
-
- for (kp = hp->value.keydef; kp; kp = kp->chain)
- kp->str->writeflag = 1;
- delete_macro (hp);
-}
-
-/* Write the output, interspersing precompiled strings in their
- appropriate places. */
-
-static void
-write_output ()
-{
- STRINGDEF *next_string;
- U_CHAR *cur_buf_loc;
- int line_directive_len = 80;
- char *line_directive = xmalloc (line_directive_len);
- int len;
-
- /* In each run through the loop, either cur_buf_loc ==
- next_string_loc, in which case we print a series of strings, or
- it is less than next_string_loc, in which case we write some of
- the buffer. */
- cur_buf_loc = outbuf.buf;
- next_string = stringlist;
-
- while (cur_buf_loc < outbuf.bufp || next_string) {
- if (next_string
- && cur_buf_loc - outbuf.buf == next_string->output_mark) {
- if (next_string->writeflag) {
- len = 4 * strlen ((char *) next_string->filename) + 32;
- while (len > line_directive_len)
- line_directive = xrealloc (line_directive,
- line_directive_len *= 2);
- sprintf (line_directive, "\n# %d ", next_string->lineno);
- strcpy (quote_string (line_directive + strlen (line_directive),
- (char *) next_string->filename,
- strlen ((char *) next_string->filename)),
- "\n");
- safe_write (fileno (stdout), line_directive, strlen (line_directive));
- safe_write (fileno (stdout),
- (char *) next_string->contents, next_string->len);
- }
- next_string = next_string->chain;
- }
- else {
- len = (next_string
- ? (next_string->output_mark
- - (cur_buf_loc - outbuf.buf))
- : outbuf.bufp - cur_buf_loc);
-
- safe_write (fileno (stdout), (char *) cur_buf_loc, len);
- cur_buf_loc += len;
- }
- }
- free (line_directive);
-}
-
-/* Pass a directive through to the output file.
- BUF points to the contents of the directive, as a contiguous string.
- LIMIT points to the first character past the end of the directive.
- KEYWORD is the keyword-table entry for the directive. */
-
-static void
-pass_thru_directive (buf, limit, op, keyword)
- U_CHAR *buf, *limit;
- FILE_BUF *op;
- struct directive *keyword;
-{
- register int keyword_length = keyword->length;
-
- check_expand (op, 1 + keyword_length + (limit - buf));
- *op->bufp++ = '#';
- bcopy (keyword->name, (char *) op->bufp, keyword_length);
- op->bufp += keyword_length;
- if (limit != buf && buf[0] != ' ')
- *op->bufp++ = ' ';
- bcopy ((char *) buf, (char *) op->bufp, limit - buf);
- op->bufp += (limit - buf);
-#if 0
- *op->bufp++ = '\n';
- /* Count the line we have just made in the output,
- to get in sync properly. */
- op->lineno++;
-#endif
-}
-
-/* The arglist structure is built by do_define to tell
- collect_definition where the argument names begin. That
- is, for a define like "#define f(x,y,z) foo+x-bar*y", the arglist
- would contain pointers to the strings x, y, and z.
- Collect_definition would then build a DEFINITION node,
- with reflist nodes pointing to the places x, y, and z had
- appeared. So the arglist is just convenience data passed
- between these two routines. It is not kept around after
- the current #define has been processed and entered into the
- hash table. */
-
-struct arglist {
- struct arglist *next;
- U_CHAR *name;
- int length;
- int argno;
- char rest_args;
-};
-
-/* Create a DEFINITION node from a #define directive. Arguments are
- as for do_define. */
-
-static MACRODEF
-create_definition (buf, limit, op)
- U_CHAR *buf, *limit;
- FILE_BUF *op;
-{
- U_CHAR *bp; /* temp ptr into input buffer */
- U_CHAR *symname; /* remember where symbol name starts */
- int sym_length; /* and how long it is */
- int line = instack[indepth].lineno;
- char *file = instack[indepth].nominal_fname;
- size_t file_len = instack[indepth].nominal_fname_len;
- int rest_args = 0;
-
- DEFINITION *defn;
- int arglengths = 0; /* Accumulate lengths of arg names
- plus number of args. */
- MACRODEF mdef;
-
- bp = buf;
-
- while (is_hor_space[*bp])
- bp++;
-
- symname = bp; /* remember where it starts */
- sym_length = check_macro_name (bp, 0);
- bp += sym_length;
-
- /* Lossage will occur if identifiers or control keywords are broken
- across lines using backslash. This is not the right place to take
- care of that. */
-
- if (*bp == '(') {
- struct arglist *arg_ptrs = NULL;
- int argno = 0;
-
- bp++; /* skip '(' */
- SKIP_WHITE_SPACE (bp);
-
- /* Loop over macro argument names. */
- while (*bp != ')') {
- struct arglist *temp;
-
- temp = (struct arglist *) alloca (sizeof (struct arglist));
- temp->name = bp;
- temp->next = arg_ptrs;
- temp->argno = argno++;
- temp->rest_args = 0;
- arg_ptrs = temp;
-
- if (rest_args)
- pedwarn ("another parameter follows `%s'",
- rest_extension);
-
- if (!is_idstart[*bp])
- {
- if (c9x && limit - bp > (long) REST_EXTENSION_LENGTH
- && bcmp (rest_extension, bp, REST_EXTENSION_LENGTH) == 0)
- {
- /* This is the ISO C 9x way to write macros with variable
- number of arguments. */
- rest_args = 1;
- temp->rest_args = 1;
- }
- else
- pedwarn ("invalid character in macro parameter name");
- }
-
- /* Find the end of the arg name. */
- while (is_idchar[*bp]) {
- bp++;
- /* do we have a "special" rest-args extension here? */
- if (limit - bp > (long) REST_EXTENSION_LENGTH
- && bcmp (rest_extension, bp, REST_EXTENSION_LENGTH) == 0) {
- if (pedantic && !instack[indepth].system_header_p)
- pedwarn ("ANSI C does not allow macro with variable arguments");
- rest_args = 1;
- temp->rest_args = 1;
- break;
- }
- }
- if (bp == temp->name && rest_args == 1)
- {
- /* This is the ISO C 9x style. */
- temp->name = (U_CHAR *) va_args_name;
- temp->length = VA_ARGS_NAME_LENGTH;
- }
- else
- temp->length = bp - temp->name;
- if (rest_args == 1)
- bp += REST_EXTENSION_LENGTH;
- arglengths += temp->length + 2;
- SKIP_WHITE_SPACE (bp);
- if (temp->length == 0 || (*bp != ',' && *bp != ')')) {
- error ("badly punctuated parameter list in `#define'");
- goto nope;
- }
- if (*bp == ',') {
- bp++;
- SKIP_WHITE_SPACE (bp);
- /* A comma at this point can only be followed by an identifier. */
- if (!is_idstart[*bp]
- && !(c9x && limit - bp > (long) REST_EXTENSION_LENGTH
- && bcmp (rest_extension, bp, REST_EXTENSION_LENGTH) == 0)) {
- error ("badly punctuated parameter list in `#define'");
- goto nope;
- }
- }
- if (bp >= limit) {
- error ("unterminated parameter list in `#define'");
- goto nope;
- }
- {
- struct arglist *otemp;
-
- for (otemp = temp->next; otemp != NULL; otemp = otemp->next)
- if (temp->length == otemp->length
- && bcmp (temp->name, otemp->name, temp->length) == 0)
- {
- error ("duplicate argument name `%.*s' in `#define'",
- temp->length, temp->name);
- goto nope;
- }
- if (rest_args == 0 && temp->length == VA_ARGS_NAME_LENGTH
- && bcmp (temp->name, va_args_name, VA_ARGS_NAME_LENGTH) == 0)
- {
- error ("\
-reserved name `%s' used as argument name in `#define'", va_args_name);
- goto nope;
- }
- }
- }
-
- ++bp; /* skip paren */
- SKIP_WHITE_SPACE (bp);
- /* now everything from bp before limit is the definition. */
- defn = collect_expansion (bp, limit, argno, arg_ptrs);
- defn->rest_args = rest_args;
-
- /* Now set defn->args.argnames to the result of concatenating
- the argument names in reverse order
- with comma-space between them. */
- defn->args.argnames = (U_CHAR *) xmalloc (arglengths + 1);
- {
- struct arglist *temp;
- int i = 0;
- for (temp = arg_ptrs; temp; temp = temp->next) {
- bcopy (temp->name, &defn->args.argnames[i], temp->length);
- i += temp->length;
- if (temp->next != 0) {
- defn->args.argnames[i++] = ',';
- defn->args.argnames[i++] = ' ';
- }
- }
- defn->args.argnames[i] = 0;
- }
- } else {
- /* Simple expansion or empty definition. */
-
- if (bp < limit)
- {
- if (is_hor_space[*bp]) {
- bp++;
- SKIP_WHITE_SPACE (bp);
- } else if (sym_length) {
- switch (*bp) {
- case '!': case '"': case '#': case '%': case '&': case '\'':
- case ')': case '*': case '+': case ',': case '-': case '.':
- case '/': case ':': case ';': case '<': case '=': case '>':
- case '?': case '[': case '\\': case ']': case '^': case '{':
- case '|': case '}': case '~':
- warning ("missing white space after `#define %.*s'",
- sym_length, symname);
- break;
-
- default:
- pedwarn ("missing white space after `#define %.*s'",
- sym_length, symname);
- break;
- }
- }
- }
- /* Now everything from bp before limit is the definition. */
- defn = collect_expansion (bp, limit, -1, NULL_PTR);
- defn->args.argnames = (U_CHAR *) "";
- }
-
- defn->line = line;
- defn->file = file;
- defn->file_len = file_len;
-
- /* OP is null if this is a predefinition */
- defn->predefined = !op;
- mdef.defn = defn;
- mdef.symnam = symname;
- mdef.symlen = sym_length;
-
- return mdef;
-
- nope:
- mdef.defn = 0;
- return mdef;
-}
-
-/* Process a #define directive.
-BUF points to the contents of the #define directive, as a contiguous string.
-LIMIT points to the first character past the end of the definition.
-KEYWORD is the keyword-table entry for #define. */
-
-static int
-do_define (buf, limit, op, keyword)
- U_CHAR *buf, *limit;
- FILE_BUF *op;
- struct directive *keyword;
-{
- int hashcode;
- MACRODEF mdef;
-
- /* If this is a precompiler run (with -pcp) pass thru #define directives. */
- if (pcp_outfile && op)
- pass_thru_directive (buf, limit, op, keyword);
-
- mdef = create_definition (buf, limit, op);
- if (mdef.defn == 0)
- goto nope;
-
- hashcode = hashf (mdef.symnam, mdef.symlen, HASHSIZE);
-
- {
- HASHNODE *hp;
- if ((hp = lookup (mdef.symnam, mdef.symlen, hashcode)) != NULL) {
- int ok = 0;
- /* Redefining a precompiled key is ok. */
- if (hp->type == T_PCSTRING)
- ok = 1;
- /* Redefining a macro is ok if the definitions are the same. */
- else if (hp->type == T_MACRO)
- ok = ! compare_defs (mdef.defn, hp->value.defn);
- /* Redefining a constant is ok with -D. */
- else if (hp->type == T_CONST)
- ok = ! done_initializing;
- /* Print the warning if it's not ok. */
- if (!ok) {
- /* If we are passing through #define and #undef directives, do
- that for this re-definition now. */
- if (debug_output && op)
- pass_thru_directive (buf, limit, op, keyword);
-
- pedwarn ("`%.*s' redefined", mdef.symlen, mdef.symnam);
- if (hp->type == T_MACRO)
- pedwarn_with_file_and_line (hp->value.defn->file,
- hp->value.defn->file_len,
- hp->value.defn->line,
- "this is the location of the previous definition");
- }
- /* Replace the old definition. */
- hp->type = T_MACRO;
- hp->value.defn = mdef.defn;
- } else {
- /* If we are passing through #define and #undef directives, do
- that for this new definition now. */
- if (debug_output && op)
- pass_thru_directive (buf, limit, op, keyword);
- install (mdef.symnam, mdef.symlen, T_MACRO,
- (char *) mdef.defn, hashcode);
- }
- }
-
- return 0;
-
-nope:
-
- return 1;
-}
-
-/* Check a purported macro name SYMNAME, and yield its length.
- ASSERTION is nonzero if this is really for an assertion name. */
-
-static int
-check_macro_name (symname, assertion)
- U_CHAR *symname;
- int assertion;
-{
- U_CHAR *p;
- int sym_length;
-
- for (p = symname; is_idchar[*p]; p++)
- ;
- sym_length = p - symname;
- if (sym_length == 0
- || (sym_length == 1 && *symname == 'L' && (*p == '\'' || *p == '"')))
- error (assertion ? "invalid assertion name" : "invalid macro name");
- else if (!is_idstart[*symname]
- || (sym_length == 7 && ! bcmp (symname, "defined", 7)))
- error ((assertion
- ? "invalid assertion name `%.*s'"
- : "invalid macro name `%.*s'"),
- sym_length, symname);
- return sym_length;
-}
-
-/* Return zero if two DEFINITIONs are isomorphic. */
-
-static int
-compare_defs (d1, d2)
- DEFINITION *d1, *d2;
-{
- register struct reflist *a1, *a2;
- register U_CHAR *p1 = d1->expansion;
- register U_CHAR *p2 = d2->expansion;
- int first = 1;
-
- if (d1->nargs != d2->nargs)
- return 1;
- if (pedantic
- && strcmp ((char *)d1->args.argnames, (char *)d2->args.argnames))
- return 1;
- for (a1 = d1->pattern, a2 = d2->pattern; a1 && a2;
- a1 = a1->next, a2 = a2->next) {
- if (!((a1->nchars == a2->nchars && ! bcmp (p1, p2, a1->nchars))
- || ! comp_def_part (first, p1, a1->nchars, p2, a2->nchars, 0))
- || a1->argno != a2->argno
- || a1->stringify != a2->stringify
- || a1->raw_before != a2->raw_before
- || a1->raw_after != a2->raw_after)
- return 1;
- first = 0;
- p1 += a1->nchars;
- p2 += a2->nchars;
- }
- if (a1 != a2)
- return 1;
- if (comp_def_part (first, p1, d1->length - (p1 - d1->expansion),
- p2, d2->length - (p2 - d2->expansion), 1))
- return 1;
- return 0;
-}
-
-/* Return 1 if two parts of two macro definitions are effectively different.
- One of the parts starts at BEG1 and has LEN1 chars;
- the other has LEN2 chars at BEG2.
- Any sequence of whitespace matches any other sequence of whitespace.
- FIRST means these parts are the first of a macro definition;
- so ignore leading whitespace entirely.
- LAST means these parts are the last of a macro definition;
- so ignore trailing whitespace entirely. */
-
-static int
-comp_def_part (first, beg1, len1, beg2, len2, last)
- int first;
- U_CHAR *beg1, *beg2;
- int len1, len2;
- int last;
-{
- register U_CHAR *end1 = beg1 + len1;
- register U_CHAR *end2 = beg2 + len2;
- if (first) {
- while (beg1 != end1 && is_space[*beg1]) beg1++;
- while (beg2 != end2 && is_space[*beg2]) beg2++;
- }
- if (last) {
- while (beg1 != end1 && is_space[end1[-1]]) end1--;
- while (beg2 != end2 && is_space[end2[-1]]) end2--;
- }
- while (beg1 != end1 && beg2 != end2) {
- if (is_space[*beg1] && is_space[*beg2]) {
- while (beg1 != end1 && is_space[*beg1]) beg1++;
- while (beg2 != end2 && is_space[*beg2]) beg2++;
- } else if (*beg1 == *beg2) {
- beg1++; beg2++;
- } else break;
- }
- return (beg1 != end1) || (beg2 != end2);
-}
-
-/* Read a replacement list for a macro with parameters.
- Build the DEFINITION structure.
- Reads characters of text starting at BUF until END.
- ARGLIST specifies the formal parameters to look for
- in the text of the definition; NARGS is the number of args
- in that list, or -1 for a macro name that wants no argument list.
- MACRONAME is the macro name itself (so we can avoid recursive expansion)
- and NAMELEN is its length in characters.
-
-Note that comments, backslash-newlines, and leading white space
-have already been deleted from the argument. */
-
-/* If there is no trailing whitespace, a Newline Space is added at the end
- to prevent concatenation that would be contrary to the standard. */
-
-static DEFINITION *
-collect_expansion (buf, end, nargs, arglist)
- U_CHAR *buf, *end;
- int nargs;
- struct arglist *arglist;
-{
- DEFINITION *defn;
- register U_CHAR *p, *limit, *lastp, *exp_p;
- struct reflist *endpat = NULL;
- /* Pointer to first nonspace after last ## seen. */
- U_CHAR *concat = 0;
- /* Pointer to first nonspace after last single-# seen. */
- U_CHAR *stringify = 0;
- /* How those tokens were spelled. */
- enum sharp_token_type concat_sharp_token_type = NO_SHARP_TOKEN;
- enum sharp_token_type stringify_sharp_token_type = NO_SHARP_TOKEN;
- int maxsize;
- int expected_delimiter = '\0';
-
- /* Scan thru the replacement list, ignoring comments and quoted
- strings, picking up on the macro calls. It does a linear search
- thru the arg list on every potential symbol. Profiling might say
- that something smarter should happen. */
-
- if (end < buf)
- abort ();
-
- /* Find the beginning of the trailing whitespace. */
- limit = end;
- p = buf;
- while (p < limit && is_space[limit[-1]]) limit--;
-
- /* Allocate space for the text in the macro definition.
- Each input char may or may not need 1 byte,
- so this is an upper bound.
- The extra 3 are for invented trailing newline-marker and final null. */
- maxsize = (sizeof (DEFINITION)
- + (limit - p) + 3);
- defn = (DEFINITION *) xcalloc (1, maxsize);
-
- defn->nargs = nargs;
- exp_p = defn->expansion = (U_CHAR *) defn + sizeof (DEFINITION);
- lastp = exp_p;
-
- if (p[0] == '#'
- ? p[1] == '#'
- : p[0] == '%' && p[1] == ':' && p[2] == '%' && p[3] == ':') {
- error ("`##' at start of macro definition");
- p += p[0] == '#' ? 2 : 4;
- }
-
- /* Process the main body of the definition. */
- while (p < limit) {
- int skipped_arg = 0;
- register U_CHAR c = *p++;
-
- *exp_p++ = c;
-
- if (!traditional) {
- switch (c) {
- case '\'':
- case '\"':
- if (expected_delimiter != '\0') {
- if (c == expected_delimiter)
- expected_delimiter = '\0';
- } else
- expected_delimiter = c;
- break;
-
- case '\\':
- if (p < limit && expected_delimiter) {
- /* In a string, backslash goes through
- and makes next char ordinary. */
- *exp_p++ = *p++;
- }
- break;
-
- case '%':
- if (!expected_delimiter && *p == ':') {
- /* %: is not a digraph if preceded by an odd number of '<'s. */
- U_CHAR *p0 = p - 1;
- while (buf < p0 && p0[-1] == '<')
- p0--;
- if ((p - p0) & 1) {
- /* Treat %:%: as ## and %: as #. */
- if (p[1] == '%' && p[2] == ':') {
- p += 2;
- goto sharp_sharp_token;
- }
- if (nargs >= 0) {
- p++;
- goto sharp_token;
- }
- }
- }
- break;
-
- case '#':
- /* # is ordinary inside a string. */
- if (expected_delimiter)
- break;
- if (*p == '#') {
- sharp_sharp_token:
- /* ##: concatenate preceding and following tokens. */
- /* Take out the first #, discard preceding whitespace. */
- exp_p--;
- while (exp_p > lastp && is_hor_space[exp_p[-1]])
- --exp_p;
- /* Skip the second #. */
- p++;
- concat_sharp_token_type = c;
- if (is_hor_space[*p]) {
- concat_sharp_token_type = c + 1;
- p++;
- SKIP_WHITE_SPACE (p);
- }
- concat = p;
- if (p == limit)
- error ("`##' at end of macro definition");
- } else if (nargs >= 0) {
- /* Single #: stringify following argument ref.
- Don't leave the # in the expansion. */
- sharp_token:
- exp_p--;
- stringify_sharp_token_type = c;
- if (is_hor_space[*p]) {
- stringify_sharp_token_type = c + 1;
- p++;
- SKIP_WHITE_SPACE (p);
- }
- if (! is_idstart[*p] || nargs == 0
- || (*p == 'L' && (p[1] == '\'' || p[1] == '"')))
- error ("`#' operator is not followed by a macro argument name");
- else
- stringify = p;
- }
- break;
- }
- } else {
- /* In -traditional mode, recognize arguments inside strings and
- character constants, and ignore special properties of #.
- Arguments inside strings are considered "stringified", but no
- extra quote marks are supplied. */
- switch (c) {
- case '\'':
- case '\"':
- if (expected_delimiter != '\0') {
- if (c == expected_delimiter)
- expected_delimiter = '\0';
- } else
- expected_delimiter = c;
- break;
-
- case '\\':
- /* Backslash quotes delimiters and itself, but not macro args. */
- if (expected_delimiter != 0 && p < limit
- && (*p == expected_delimiter || *p == '\\')) {
- *exp_p++ = *p++;
- continue;
- }
- break;
-
- case '/':
- if (expected_delimiter != '\0') /* No comments inside strings. */
- break;
- if (*p == '*') {
- /* If we find a comment that wasn't removed by handle_directive,
- this must be -traditional. So replace the comment with
- nothing at all. */
- exp_p--;
- while (++p < limit) {
- if (p[0] == '*' && p[1] == '/') {
- p += 2;
- break;
- }
- }
-#if 0
- /* Mark this as a concatenation-point, as if it had been ##. */
- concat = p;
-#endif
- }
- break;
- }
- }
-
-#ifdef MULTIBYTE_CHARS
- /* Handle multibyte characters inside string and character literals. */
- if (expected_delimiter != '\0')
- {
- int length;
- --p;
- length = local_mblen (p, limit - p);
- if (length > 1)
- {
- --exp_p;
- bcopy (p, exp_p, length);
- p += length;
- exp_p += length;
- continue;
- }
- ++p;
- }
-#endif
-
- /* Handle the start of a symbol. */
- if (is_idchar[c] && nargs > 0) {
- U_CHAR *id_beg = p - 1;
- int id_len;
-
- --exp_p;
- while (p != limit && is_idchar[*p]) p++;
- id_len = p - id_beg;
-
- if (is_idstart[c]
- && ! (id_len == 1 && c == 'L' && (*p == '\'' || *p == '"'))) {
- register struct arglist *arg;
-
- for (arg = arglist; arg != NULL; arg = arg->next) {
- struct reflist *tpat;
-
- if (arg->name[0] == c
- && arg->length == id_len
- && bcmp (arg->name, id_beg, id_len) == 0) {
- enum sharp_token_type tpat_stringify;
- if (expected_delimiter) {
- if (warn_stringify) {
- if (traditional) {
- warning ("macro argument `%.*s' is stringified.",
- id_len, arg->name);
- } else {
- warning ("macro arg `%.*s' would be stringified with -traditional.",
- id_len, arg->name);
- }
- }
- /* If ANSI, don't actually substitute inside a string. */
- if (!traditional)
- break;
- tpat_stringify = SHARP_TOKEN;
- } else {
- tpat_stringify
- = (stringify == id_beg
- ? stringify_sharp_token_type : NO_SHARP_TOKEN);
- }
- /* make a pat node for this arg and append it to the end of
- the pat list */
- tpat = (struct reflist *) xmalloc (sizeof (struct reflist));
- tpat->next = NULL;
- tpat->raw_before
- = concat == id_beg ? concat_sharp_token_type : NO_SHARP_TOKEN;
- tpat->raw_after = NO_SHARP_TOKEN;
- tpat->rest_args = arg->rest_args;
- tpat->stringify = tpat_stringify;
-
- if (endpat == NULL)
- defn->pattern = tpat;
- else
- endpat->next = tpat;
- endpat = tpat;
-
- tpat->argno = arg->argno;
- tpat->nchars = exp_p - lastp;
- {
- register U_CHAR *p1 = p;
- SKIP_WHITE_SPACE (p1);
- if (p1[0]=='#'
- ? p1[1]=='#'
- : p1[0]=='%' && p1[1]==':' && p1[2]=='%' && p1[3]==':')
- tpat->raw_after = p1[0] + (p != p1);
- }
- lastp = exp_p; /* place to start copying from next time */
- skipped_arg = 1;
- break;
- }
- }
- }
-
- /* If this was not a macro arg, copy it into the expansion. */
- if (! skipped_arg) {
- register U_CHAR *lim1 = p;
- p = id_beg;
- while (p != lim1)
- *exp_p++ = *p++;
- if (stringify == id_beg)
- error ("`#' operator should be followed by a macro argument name");
- }
- }
- }
-
- if (!traditional && expected_delimiter == 0) {
- /* If ANSI, put in a newline-space marker to prevent token pasting.
- But not if "inside a string" (which in ANSI mode happens only for
- -D option). */
- *exp_p++ = '\n';
- *exp_p++ = ' ';
- }
-
- *exp_p = '\0';
-
- defn->length = exp_p - defn->expansion;
-
- /* Crash now if we overrun the allocated size. */
- if (defn->length + 1 > maxsize)
- abort ();
-
-#if 0
-/* This isn't worth the time it takes. */
- /* give back excess storage */
- defn->expansion = (U_CHAR *) xrealloc (defn->expansion, defn->length + 1);
-#endif
-
- return defn;
-}
-
-static int
-do_assert (buf, limit, op, keyword)
- U_CHAR *buf, *limit;
- FILE_BUF *op ATTRIBUTE_UNUSED;
- struct directive *keyword ATTRIBUTE_UNUSED;
-{
- U_CHAR *bp; /* temp ptr into input buffer */
- U_CHAR *symname; /* remember where symbol name starts */
- int sym_length; /* and how long it is */
- struct arglist *tokens = NULL;
-
- if (pedantic && done_initializing && !instack[indepth].system_header_p)
- pedwarn ("ANSI C does not allow `#assert'");
-
- bp = buf;
-
- while (is_hor_space[*bp])
- bp++;
-
- symname = bp; /* remember where it starts */
- sym_length = check_macro_name (bp, 1);
- bp += sym_length;
- /* #define doesn't do this, but we should. */
- SKIP_WHITE_SPACE (bp);
-
- /* Lossage will occur if identifiers or control tokens are broken
- across lines using backslash. This is not the right place to take
- care of that. */
-
- if (*bp != '(') {
- error ("missing token-sequence in `#assert'");
- return 1;
- }
-
- {
- int error_flag = 0;
-
- bp++; /* skip '(' */
- SKIP_WHITE_SPACE (bp);
-
- tokens = read_token_list (&bp, limit, &error_flag);
- if (error_flag)
- return 1;
- if (tokens == 0) {
- error ("empty token-sequence in `#assert'");
- return 1;
- }
-
- ++bp; /* skip paren */
- SKIP_WHITE_SPACE (bp);
- }
-
- /* If this name isn't already an assertion name, make it one.
- Error if it was already in use in some other way. */
-
- {
- ASSERTION_HASHNODE *hp;
- int hashcode = hashf (symname, sym_length, ASSERTION_HASHSIZE);
- struct tokenlist_list *value
- = (struct tokenlist_list *) xmalloc (sizeof (struct tokenlist_list));
-
- hp = assertion_lookup (symname, sym_length, hashcode);
- if (hp == NULL) {
- if (sym_length == 7 && ! bcmp (symname, "defined", 7))
- error ("`defined' redefined as assertion");
- hp = assertion_install (symname, sym_length, hashcode);
- }
-
- /* Add the spec'd token-sequence to the list of such. */
- value->tokens = tokens;
- value->next = hp->value;
- hp->value = value;
- }
-
- return 0;
-}
-
-static int
-do_unassert (buf, limit, op, keyword)
- U_CHAR *buf, *limit;
- FILE_BUF *op ATTRIBUTE_UNUSED;
- struct directive *keyword ATTRIBUTE_UNUSED;
-{
- U_CHAR *bp; /* temp ptr into input buffer */
- U_CHAR *symname; /* remember where symbol name starts */
- int sym_length; /* and how long it is */
-
- struct arglist *tokens = NULL;
- int tokens_specified = 0;
-
- if (pedantic && done_initializing && !instack[indepth].system_header_p)
- pedwarn ("ANSI C does not allow `#unassert'");
-
- bp = buf;
-
- while (is_hor_space[*bp])
- bp++;
-
- symname = bp; /* remember where it starts */
- sym_length = check_macro_name (bp, 1);
- bp += sym_length;
- /* #define doesn't do this, but we should. */
- SKIP_WHITE_SPACE (bp);
-
- /* Lossage will occur if identifiers or control tokens are broken
- across lines using backslash. This is not the right place to take
- care of that. */
-
- if (*bp == '(') {
- int error_flag = 0;
-
- bp++; /* skip '(' */
- SKIP_WHITE_SPACE (bp);
-
- tokens = read_token_list (&bp, limit, &error_flag);
- if (error_flag)
- return 1;
- if (tokens == 0) {
- error ("empty token list in `#unassert'");
- return 1;
- }
-
- tokens_specified = 1;
-
- ++bp; /* skip paren */
- SKIP_WHITE_SPACE (bp);
- }
-
- {
- ASSERTION_HASHNODE *hp;
- int hashcode = hashf (symname, sym_length, ASSERTION_HASHSIZE);
- struct tokenlist_list *tail, *prev;
-
- hp = assertion_lookup (symname, sym_length, hashcode);
- if (hp == NULL)
- return 1;
-
- /* If no token list was specified, then eliminate this assertion
- entirely. */
- if (! tokens_specified) {
- struct tokenlist_list *next;
- for (tail = hp->value; tail; tail = next) {
- next = tail->next;
- free_token_list (tail->tokens);
- free (tail);
- }
- delete_assertion (hp);
- } else {
- /* If a list of tokens was given, then delete any matching list. */
-
- tail = hp->value;
- prev = 0;
- while (tail) {
- struct tokenlist_list *next = tail->next;
- if (compare_token_lists (tail->tokens, tokens)) {
- if (prev)
- prev->next = next;
- else
- hp->value = tail->next;
- free_token_list (tail->tokens);
- free (tail);
- } else {
- prev = tail;
- }
- tail = next;
- }
- }
- }
-
- return 0;
-}
-
-/* Test whether there is an assertion named NAME
- and optionally whether it has an asserted token list TOKENS.
- NAME is not null terminated; its length is SYM_LENGTH.
- If TOKENS_SPECIFIED is 0, then don't check for any token list. */
-
-int
-check_assertion (name, sym_length, tokens_specified, tokens)
- U_CHAR *name;
- int sym_length;
- int tokens_specified;
- struct arglist *tokens;
-{
- ASSERTION_HASHNODE *hp;
- int hashcode = hashf (name, sym_length, ASSERTION_HASHSIZE);
-
- if (pedantic && !instack[indepth].system_header_p)
- pedwarn ("ANSI C does not allow testing assertions");
-
- hp = assertion_lookup (name, sym_length, hashcode);
- if (hp == NULL)
- /* It is not an assertion; just return false. */
- return 0;
-
- /* If no token list was specified, then value is 1. */
- if (! tokens_specified)
- return 1;
-
- {
- struct tokenlist_list *tail;
-
- tail = hp->value;
-
- /* If a list of tokens was given,
- then succeed if the assertion records a matching list. */
-
- while (tail) {
- if (compare_token_lists (tail->tokens, tokens))
- return 1;
- tail = tail->next;
- }
-
- /* Fail if the assertion has no matching list. */
- return 0;
- }
-}
-
-/* Compare two lists of tokens for equality including order of tokens. */
-
-static int
-compare_token_lists (l1, l2)
- struct arglist *l1, *l2;
-{
- while (l1 && l2) {
- if (l1->length != l2->length)
- return 0;
- if (bcmp (l1->name, l2->name, l1->length))
- return 0;
- l1 = l1->next;
- l2 = l2->next;
- }
-
- /* Succeed if both lists end at the same time. */
- return l1 == l2;
-}
-
-/* Read a space-separated list of tokens ending in a close parenthesis.
- Return a list of strings, in the order they were written.
- (In case of error, return 0 and store -1 in *ERROR_FLAG.)
- Parse the text starting at *BPP, and update *BPP.
- Don't parse beyond LIMIT. */
-
-static struct arglist *
-read_token_list (bpp, limit, error_flag)
- U_CHAR **bpp;
- U_CHAR *limit;
- int *error_flag;
-{
- struct arglist *token_ptrs = 0;
- U_CHAR *bp = *bpp;
- int depth = 1;
-
- *error_flag = 0;
-
- /* Loop over the assertion value tokens. */
- while (depth > 0) {
- struct arglist *temp;
- int eofp = 0;
- U_CHAR *beg = bp;
-
- /* Find the end of the token. */
- if (*bp == '(') {
- bp++;
- depth++;
- } else if (*bp == ')') {
- depth--;
- if (depth == 0)
- break;
- bp++;
- } else if (*bp == '"' || *bp == '\'')
- bp = skip_quoted_string (bp, limit, 0, NULL_PTR, NULL_PTR, &eofp);
- else
- while (! is_hor_space[*bp] && *bp != '(' && *bp != ')'
- && *bp != '"' && *bp != '\'' && bp != limit)
- bp++;
-
- temp = (struct arglist *) xmalloc (sizeof (struct arglist));
- temp->name = (U_CHAR *) xmalloc (bp - beg + 1);
- bcopy ((char *) beg, (char *) temp->name, bp - beg);
- temp->name[bp - beg] = 0;
- temp->next = token_ptrs;
- token_ptrs = temp;
- temp->length = bp - beg;
-
- SKIP_WHITE_SPACE (bp);
-
- if (bp >= limit) {
- error ("unterminated token sequence in `#assert' or `#unassert'");
- *error_flag = -1;
- return 0;
- }
- }
- *bpp = bp;
-
- /* We accumulated the names in reverse order.
- Now reverse them to get the proper order. */
- {
- register struct arglist *prev = 0, *this, *next;
- for (this = token_ptrs; this; this = next) {
- next = this->next;
- this->next = prev;
- prev = this;
- }
- return prev;
- }
-}
-
-static void
-free_token_list (tokens)
- struct arglist *tokens;
-{
- while (tokens) {
- struct arglist *next = tokens->next;
- free (tokens->name);
- free (tokens);
- tokens = next;
- }
-}
-
-/* Install a name in the assertion hash table.
-
- If LEN is >= 0, it is the length of the name.
- Otherwise, compute the length by scanning the entire name.
-
- If HASH is >= 0, it is the precomputed hash code.
- Otherwise, compute the hash code. */
-
-static ASSERTION_HASHNODE *
-assertion_install (name, len, hash)
- U_CHAR *name;
- int len;
- int hash;
-{
- register ASSERTION_HASHNODE *hp;
- register int i, bucket;
- register U_CHAR *p, *q;
-
- i = sizeof (ASSERTION_HASHNODE) + len + 1;
- hp = (ASSERTION_HASHNODE *) xmalloc (i);
- bucket = hash;
- hp->bucket_hdr = &assertion_hashtab[bucket];
- hp->next = assertion_hashtab[bucket];
- assertion_hashtab[bucket] = hp;
- hp->prev = NULL;
- if (hp->next != NULL)
- hp->next->prev = hp;
- hp->length = len;
- hp->value = 0;
- hp->name = ((U_CHAR *) hp) + sizeof (ASSERTION_HASHNODE);
- p = hp->name;
- q = name;
- for (i = 0; i < len; i++)
- *p++ = *q++;
- hp->name[len] = 0;
- return hp;
-}
-
-/* Find the most recent hash node for name "name" (ending with first
- non-identifier char) installed by install
-
- If LEN is >= 0, it is the length of the name.
- Otherwise, compute the length by scanning the entire name.
-
- If HASH is >= 0, it is the precomputed hash code.
- Otherwise, compute the hash code. */
-
-static ASSERTION_HASHNODE *
-assertion_lookup (name, len, hash)
- U_CHAR *name;
- int len;
- int hash;
-{
- register ASSERTION_HASHNODE *bucket;
-
- bucket = assertion_hashtab[hash];
- while (bucket) {
- if (bucket->length == len && bcmp (bucket->name, name, len) == 0)
- return bucket;
- bucket = bucket->next;
- }
- return NULL;
-}
-
-static void
-delete_assertion (hp)
- ASSERTION_HASHNODE *hp;
-{
-
- if (hp->prev != NULL)
- hp->prev->next = hp->next;
- if (hp->next != NULL)
- hp->next->prev = hp->prev;
-
- /* Make sure that the bucket chain header that the deleted guy was
- on points to the right thing afterwards. */
- if (hp == *hp->bucket_hdr)
- *hp->bucket_hdr = hp->next;
-
- free (hp);
-}
-
-/*
- * interpret #line directive. Remembers previously seen fnames
- * in its very own hash table.
- */
-#define FNAME_HASHSIZE 37
-
-static int
-do_line (buf, limit, op, keyword)
- U_CHAR *buf, *limit;
- FILE_BUF *op;
- struct directive *keyword ATTRIBUTE_UNUSED;
-{
- register U_CHAR *bp;
- FILE_BUF *ip = &instack[indepth];
- FILE_BUF tem;
- int new_lineno;
- enum file_change_code file_change = same_file;
-
- /* Expand any macros. */
- tem = expand_to_temp_buffer (buf, limit, 0, 0);
-
- /* Point to macroexpanded line, which is null-terminated now. */
- bp = tem.buf;
- SKIP_WHITE_SPACE (bp);
-
- if (!ISDIGIT (*bp)) {
- error ("invalid format `#line' directive");
- return 0;
- }
-
- /* The Newline at the end of this line remains to be processed.
- To put the next line at the specified line number,
- we must store a line number now that is one less. */
- new_lineno = atoi ((char *) bp) - 1;
-
- /* NEW_LINENO is one less than the actual line number here. */
- if (pedantic && new_lineno < 0)
- pedwarn ("line number out of range in `#line' directive");
-
- /* skip over the line number. */
- while (ISDIGIT (*bp))
- bp++;
-
-#if 0 /* #line 10"foo.c" is supposed to be allowed. */
- if (*bp && !is_space[*bp]) {
- error ("invalid format `#line' directive");
- return;
- }
-#endif
-
- SKIP_WHITE_SPACE (bp);
-
- if (*bp == '\"') {
- static HASHNODE *fname_table[FNAME_HASHSIZE];
- HASHNODE *hp, **hash_bucket;
- U_CHAR *fname, *p;
- int fname_length;
-
- fname = ++bp;
-
- /* Turn the file name, which is a character string literal,
- into a null-terminated string. Do this in place. */
- p = bp;
- for (;;)
- switch ((*p++ = *bp++)) {
- case '\0':
- error ("invalid format `#line' directive");
- return 0;
-
- case '\\':
- if (! ignore_escape_flag)
- {
- char *bpc = (char *) bp;
- HOST_WIDEST_INT c = parse_escape (&bpc, (HOST_WIDEST_INT) (U_CHAR) (-1));
- bp = (U_CHAR *) bpc;
- if (c < 0)
- p--;
- else
- p[-1] = c;
- }
- break;
-
- case '\"':
- *--p = 0;
- goto fname_done;
- }
- fname_done:
- fname_length = p - fname;
-
- SKIP_WHITE_SPACE (bp);
- if (*bp) {
- if (pedantic)
- pedwarn ("garbage at end of `#line' directive");
- if (*bp == '1')
- file_change = enter_file;
- else if (*bp == '2')
- file_change = leave_file;
- else if (*bp == '3')
- ip->system_header_p = 1;
- else if (*bp == '4')
- ip->system_header_p = 2;
- else {
- error ("invalid format `#line' directive");
- return 0;
- }
-
- bp++;
- SKIP_WHITE_SPACE (bp);
- if (*bp == '3') {
- ip->system_header_p = 1;
- bp++;
- SKIP_WHITE_SPACE (bp);
- }
- if (*bp == '4') {
- ip->system_header_p = 2;
- bp++;
- SKIP_WHITE_SPACE (bp);
- }
- if (*bp) {
- error ("invalid format `#line' directive");
- return 0;
- }
- }
-
- hash_bucket = &fname_table[hashf (fname, fname_length, FNAME_HASHSIZE)];
- for (hp = *hash_bucket; hp != NULL; hp = hp->next)
- if (hp->length == fname_length &&
- bcmp (hp->value.cpval, fname, fname_length) == 0) {
- ip->nominal_fname = hp->value.cpval;
- ip->nominal_fname_len = fname_length;
- break;
- }
- if (hp == 0) {
- /* Didn't find it; cons up a new one. */
- hp = (HASHNODE *) xcalloc (1, sizeof (HASHNODE) + fname_length + 1);
- hp->next = *hash_bucket;
- *hash_bucket = hp;
-
- ip->nominal_fname = hp->value.cpval = ((char *) hp) + sizeof (HASHNODE);
- ip->nominal_fname_len = hp->length = fname_length;
- bcopy (fname, hp->value.cpval, fname_length + 1);
- }
- } else if (*bp) {
- error ("invalid format `#line' directive");
- return 0;
- }
-
- ip->lineno = new_lineno;
- output_line_directive (ip, op, 0, file_change);
- check_expand (op, ip->length - (ip->bufp - ip->buf));
- return 0;
-}
-
-/* Remove the definition of a symbol from the symbol table.
- according to un*x /lib/cpp, it is not an error to undef
- something that has no definitions, so it isn't one here either. */
-
-static int
-do_undef (buf, limit, op, keyword)
- U_CHAR *buf, *limit;
- FILE_BUF *op;
- struct directive *keyword;
-{
- int sym_length;
- HASHNODE *hp;
- U_CHAR *orig_buf = buf;
-
- /* If this is a precompiler run (with -pcp) pass thru #undef directives. */
- if (pcp_outfile && op)
- pass_thru_directive (buf, limit, op, keyword);
-
- SKIP_WHITE_SPACE (buf);
- sym_length = check_macro_name (buf, 0);
-
- while ((hp = lookup (buf, sym_length, -1)) != NULL) {
- /* If we are generating additional info for debugging (with -g) we
- need to pass through all effective #undef directives. */
- if (debug_output && op)
- pass_thru_directive (orig_buf, limit, op, keyword);
- if (hp->type != T_MACRO)
- warning ("undefining `%s'", hp->name);
- delete_macro (hp);
- }
-
- if (pedantic) {
- buf += sym_length;
- SKIP_WHITE_SPACE (buf);
- if (buf != limit)
- pedwarn ("garbage after `#undef' directive");
- }
- return 0;
-}
-
-/* Report an error detected by the program we are processing.
- Use the text of the line in the error message.
- (We use error because it prints the filename & line#.) */
-
-static int
-do_error (buf, limit, op, keyword)
- U_CHAR *buf, *limit;
- FILE_BUF *op ATTRIBUTE_UNUSED;
- struct directive *keyword ATTRIBUTE_UNUSED;
-{
- int length = limit - buf;
- U_CHAR *copy = (U_CHAR *) alloca (length + 1);
- bcopy ((char *) buf, (char *) copy, length);
- copy[length] = 0;
- SKIP_WHITE_SPACE (copy);
- error ("#error %s", copy);
- return 0;
-}
-
-/* Report a warning detected by the program we are processing.
- Use the text of the line in the warning message, then continue.
- (We use error because it prints the filename & line#.) */
-
-static int
-do_warning (buf, limit, op, keyword)
- U_CHAR *buf, *limit;
- FILE_BUF *op ATTRIBUTE_UNUSED;
- struct directive *keyword ATTRIBUTE_UNUSED;
-{
- int length = limit - buf;
- U_CHAR *copy = (U_CHAR *) alloca (length + 1);
- bcopy ((char *) buf, (char *) copy, length);
- copy[length] = 0;
- SKIP_WHITE_SPACE (copy);
-
- if (pedantic && !instack[indepth].system_header_p)
- pedwarn ("ANSI C does not allow `#warning'");
-
- /* Use `pedwarn' not `warning', because #warning isn't in the C Standard;
- if -pedantic-errors is given, #warning should cause an error. */
- pedwarn ("#warning %s", copy);
- return 0;
-}
-
-/* Remember the name of the current file being read from so that we can
- avoid ever including it again. */
-
-static void
-do_once ()
-{
- int i;
-
- for (i = indepth; i >= 0; i--)
- if (instack[i].inc) {
- record_control_macro (instack[i].inc, (U_CHAR *) "");
- break;
- }
-}
-
-/* Report program identification. */
-
-static int
-do_ident (buf, limit, op, keyword)
- U_CHAR *buf, *limit;
- FILE_BUF *op;
- struct directive *keyword ATTRIBUTE_UNUSED;
-{
- FILE_BUF trybuf;
- int len;
-
- /* Allow #ident in system headers, since that's not user's fault. */
- if (pedantic && !instack[indepth].system_header_p)
- pedwarn ("ANSI C does not allow `#ident'");
-
- trybuf = expand_to_temp_buffer (buf, limit, 0, 0);
- buf = trybuf.buf;
- len = trybuf.bufp - buf;
-
- /* Output expanded directive. */
- check_expand (op, 7 + len);
- bcopy ("#ident ", (char *) op->bufp, 7);
- op->bufp += 7;
- bcopy ((char *) buf, (char *) op->bufp, len);
- op->bufp += len;
-
- free (buf);
- return 0;
-}
-
-/* #pragma and its argument line have already been copied to the output file.
- Just check for some recognized pragmas that need validation here. */
-
-static int
-do_pragma (buf, limit, op, keyword)
- U_CHAR *buf, *limit ATTRIBUTE_UNUSED;
- FILE_BUF *op ATTRIBUTE_UNUSED;
- struct directive *keyword ATTRIBUTE_UNUSED;
-{
- SKIP_WHITE_SPACE (buf);
- if (!strncmp ((char *) buf, "once", 4)) {
- /* Allow #pragma once in system headers, since that's not the user's
- fault. */
- if (!instack[indepth].system_header_p)
- warning ("`#pragma once' is obsolete");
- do_once ();
- }
-
- if (!strncmp ((char *) buf, "implementation", 14)) {
- /* Be quiet about `#pragma implementation' for a file only if it hasn't
- been included yet. */
-
- int h;
- U_CHAR *p = buf + 14, *fname;
- SKIP_WHITE_SPACE (p);
- if (*p != '\"')
- return 0;
-
- fname = p + 1;
- if ((p = (U_CHAR *) index ((char *) fname, '\"')))
- *p = '\0';
-
- for (h = 0; h < INCLUDE_HASHSIZE; h++) {
- struct include_file *inc;
- for (inc = include_hashtab[h]; inc; inc = inc->next) {
- if (!strcmp (base_name (inc->fname), (char *) fname)) {
- warning ("`#pragma implementation' for \"%s\" appears after its #include",fname);
- return 0;
- }
- }
- }
- }
- return 0;
-}
-
-#if 0
-/* This was a fun hack, but #pragma seems to start to be useful.
- By failing to recognize it, we pass it through unchanged to cc1. */
-
-/* The behavior of the #pragma directive is implementation defined.
- this implementation defines it as follows. */
-
-static int
-do_pragma ()
-{
- close (0);
- if (open ("/dev/tty", O_RDONLY, 0666) != 0)
- goto nope;
- close (1);
- if (open ("/dev/tty", O_WRONLY, 0666) != 1)
- goto nope;
- execl ("/usr/games/hack", "#pragma", 0);
- execl ("/usr/games/rogue", "#pragma", 0);
- execl ("/usr/new/emacs", "-f", "hanoi", "9", "-kill", 0);
- execl ("/usr/local/emacs", "-f", "hanoi", "9", "-kill", 0);
-nope:
- fatal ("You are in a maze of twisty compiler features, all different");
-}
-#endif
-
-#ifdef SCCS_DIRECTIVE
-
-/* Just ignore #sccs, on systems where we define it at all. */
-
-static int
-do_sccs (buf, limit, op, keyword)
- U_CHAR *buf ATTRIBUTE_UNUSED, *limit ATTRIBUTE_UNUSED;
- FILE_BUF *op ATTRIBUTE_UNUSED;
- struct directive *keyword ATTRIBUTE_UNUSED;
-{
- if (pedantic)
- pedwarn ("ANSI C does not allow `#sccs'");
- return 0;
-}
-
-#endif /* defined (SCCS_DIRECTIVE) */
-
-/* Handle #if directive by
- 1) inserting special `defined' keyword into the hash table
- that gets turned into 0 or 1 by special_symbol (thus,
- if the luser has a symbol called `defined' already, it won't
- work inside the #if directive)
- 2) rescan the input into a temporary output buffer
- 3) pass the output buffer to the yacc parser and collect a value
- 4) clean up the mess left from steps 1 and 2.
- 5) call conditional_skip to skip til the next #endif (etc.),
- or not, depending on the value from step 3. */
-
-static int
-do_if (buf, limit, op, keyword)
- U_CHAR *buf, *limit;
- FILE_BUF *op;
- struct directive *keyword ATTRIBUTE_UNUSED;
-{
- HOST_WIDEST_INT value;
- FILE_BUF *ip = &instack[indepth];
-
- value = eval_if_expression (buf, limit - buf);
- conditional_skip (ip, value == 0, T_IF, NULL_PTR, op);
- return 0;
-}
-
-/* Handle a #elif directive by not changing if_stack either.
- see the comment above do_else. */
-
-static int
-do_elif (buf, limit, op, keyword)
- U_CHAR *buf, *limit;
- FILE_BUF *op;
- struct directive *keyword ATTRIBUTE_UNUSED;
-{
- HOST_WIDEST_INT value;
- FILE_BUF *ip = &instack[indepth];
-
- if (if_stack == instack[indepth].if_stack) {
- error ("`#elif' not within a conditional");
- return 0;
- } else {
- if (if_stack->type != T_IF && if_stack->type != T_ELIF) {
- error ("`#elif' after `#else'");
- fprintf (stderr, " (matches line %d", if_stack->lineno);
- if (! (if_stack->fname_len == ip->nominal_fname_len
- && !bcmp (if_stack->fname, ip->nominal_fname,
- if_stack->fname_len))) {
- fprintf (stderr, ", file ");
- eprint_string (if_stack->fname, if_stack->fname_len);
- }
- fprintf (stderr, ")\n");
- }
- if_stack->type = T_ELIF;
- }
-
- if (if_stack->if_succeeded)
- skip_if_group (ip, 0, op);
- else {
- value = eval_if_expression (buf, limit - buf);
- if (value == 0)
- skip_if_group (ip, 0, op);
- else {
- ++if_stack->if_succeeded; /* continue processing input */
- output_line_directive (ip, op, 1, same_file);
- }
- }
- return 0;
-}
-
-/* Evaluate a #if expression in BUF, of length LENGTH, then parse the
- result as a C expression and return the value as an int. */
-
-static HOST_WIDEST_INT
-eval_if_expression (buf, length)
- U_CHAR *buf;
- int length;
-{
- FILE_BUF temp_obuf;
- HASHNODE *save_defined;
- HOST_WIDEST_INT value;
-
- save_defined = install ((U_CHAR *) "defined", -1, T_SPEC_DEFINED,
- NULL_PTR, -1);
- pcp_inside_if = 1;
- temp_obuf = expand_to_temp_buffer (buf, buf + length, 0, 1);
- pcp_inside_if = 0;
- delete_macro (save_defined); /* clean up special symbol */
-
- temp_obuf.buf[temp_obuf.length] = '\n';
- value = parse_c_expression ((char *) temp_obuf.buf,
- warn_undef && !instack[indepth].system_header_p);
-
- free (temp_obuf.buf);
-
- return value;
-}
-
-/* routine to handle ifdef/ifndef. Try to look up the symbol, then do
- or don't skip to the #endif/#else/#elif depending on what directive
- is actually being processed. */
-
-static int
-do_xifdef (buf, limit, op, keyword)
- U_CHAR *buf, *limit;
- FILE_BUF *op;
- struct directive *keyword;
-{
- int skip;
- FILE_BUF *ip = &instack[indepth];
- U_CHAR *end;
- int start_of_file = 0;
- U_CHAR *control_macro = 0;
-
- /* Detect a #ifndef at start of file (not counting comments). */
- if (ip->fname != 0 && keyword->type == T_IFNDEF) {
- U_CHAR *p = ip->buf;
- while (p != directive_start) {
- U_CHAR c = *p++;
- if (is_space[c])
- ;
- /* Make no special provision for backslash-newline here; this is
- slower if backslash-newlines are present, but it's correct,
- and it's not worth it to tune for the rare backslash-newline. */
- else if (c == '/'
- && (*p == '*' || (cplusplus_comments && *p == '/'))) {
- /* Skip this comment. */
- int junk = 0;
- U_CHAR *save_bufp = ip->bufp;
- ip->bufp = p + 1;
- p = skip_to_end_of_comment (ip, &junk, 1);
- ip->bufp = save_bufp;
- } else {
- goto fail;
- }
- }
- /* If we get here, this conditional is the beginning of the file. */
- start_of_file = 1;
- fail: ;
- }
-
- /* Discard leading and trailing whitespace. */
- SKIP_WHITE_SPACE (buf);
- while (limit != buf && is_hor_space[limit[-1]]) limit--;
-
- /* Find the end of the identifier at the beginning. */
- for (end = buf; is_idchar[*end]; end++);
-
- if (end == buf) {
- skip = (keyword->type == T_IFDEF);
- if (! traditional)
- pedwarn (end == limit ? "`#%s' with no argument"
- : "`#%s' argument starts with punctuation",
- keyword->name);
- } else {
- HASHNODE *hp;
-
- if (! traditional) {
- if (ISDIGIT (buf[0]))
- pedwarn ("`#%s' argument starts with a digit", keyword->name);
- else if (end != limit)
- pedwarn ("garbage at end of `#%s' argument", keyword->name);
- }
-
- hp = lookup (buf, end-buf, -1);
-
- if (pcp_outfile) {
- /* Output a precondition for this macro. */
- if (hp
- && (hp->type == T_CONST
- || (hp->type == T_MACRO && hp->value.defn->predefined)))
- fprintf (pcp_outfile, "#define %s\n", hp->name);
- else {
- U_CHAR *cp = buf;
- fprintf (pcp_outfile, "#undef ");
- while (is_idchar[*cp]) /* Ick! */
- fputc (*cp++, pcp_outfile);
- putc ('\n', pcp_outfile);
- }
- }
-
- skip = (hp == NULL) ^ (keyword->type == T_IFNDEF);
- if (start_of_file && !skip) {
- control_macro = (U_CHAR *) xmalloc (end - buf + 1);
- bcopy ((char *) buf, (char *) control_macro, end - buf);
- control_macro[end - buf] = 0;
- }
- }
-
- conditional_skip (ip, skip, T_IF, control_macro, op);
- return 0;
-}
-
-/* Push TYPE on stack; then, if SKIP is nonzero, skip ahead.
- If this is a #ifndef starting at the beginning of a file,
- CONTROL_MACRO is the macro name tested by the #ifndef.
- Otherwise, CONTROL_MACRO is 0. */
-
-static void
-conditional_skip (ip, skip, type, control_macro, op)
- FILE_BUF *ip;
- int skip;
- enum node_type type;
- U_CHAR *control_macro;
- FILE_BUF *op;
-{
- IF_STACK_FRAME *temp;
-
- temp = (IF_STACK_FRAME *) xcalloc (1, sizeof (IF_STACK_FRAME));
- temp->fname = ip->nominal_fname;
- temp->fname_len = ip->nominal_fname_len;
- temp->lineno = ip->lineno;
- temp->next = if_stack;
- temp->control_macro = control_macro;
- if_stack = temp;
-
- if_stack->type = type;
-
- if (skip != 0) {
- skip_if_group (ip, 0, op);
- return;
- } else {
- ++if_stack->if_succeeded;
- output_line_directive (ip, &outbuf, 1, same_file);
- }
-}
-
-/* Skip to #endif, #else, or #elif. adjust line numbers, etc.
- Leaves input ptr at the sharp sign found.
- If ANY is nonzero, return at next directive of any sort. */
-
-static void
-skip_if_group (ip, any, op)
- FILE_BUF *ip;
- int any;
- FILE_BUF *op;
-{
- register U_CHAR *bp = ip->bufp, *cp;
- register U_CHAR *endb = ip->buf + ip->length;
- struct directive *kt;
- IF_STACK_FRAME *save_if_stack = if_stack; /* don't pop past here */
- U_CHAR *beg_of_line = bp;
- register int ident_length;
- U_CHAR *ident, *after_ident;
- /* Save info about where the group starts. */
- U_CHAR *beg_of_group = bp;
- int beg_lineno = ip->lineno;
- int skipping_include_directive = 0;
-
- if (output_conditionals && op != 0) {
- char *ptr = "#failed\n";
- int len = strlen (ptr);
-
- if (op->bufp > op->buf && op->bufp[-1] != '\n')
- {
- *op->bufp++ = '\n';
- op->lineno++;
- }
- check_expand (op, len);
- bcopy (ptr, (char *) op->bufp, len);
- op->bufp += len;
- op->lineno++;
- output_line_directive (ip, op, 1, 0);
- }
-
- while (bp < endb) {
- switch (*bp++) {
- case '/': /* possible comment */
- if (*bp == '\\' && bp[1] == '\n')
- newline_fix (bp);
- if (*bp == '*'
- || (cplusplus_comments && *bp == '/')) {
- ip->bufp = ++bp;
- bp = skip_to_end_of_comment (ip, &ip->lineno, 0);
- }
- break;
- case '<':
- if (skipping_include_directive) {
- while (bp < endb && *bp != '>' && *bp != '\n') {
- if (*bp == '\\' && bp[1] == '\n') {
- ip->lineno++;
- bp++;
- }
- bp++;
- }
- }
- break;
- case '\"':
- if (skipping_include_directive) {
- while (bp < endb && *bp != '\n') {
- if (*bp == '"') {
- bp++;
- break;
- }
- if (*bp == '\\' && bp[1] == '\n') {
- ip->lineno++;
- bp++;
- }
- bp++;
- }
- break;
- }
- /* Fall through. */
- case '\'':
- bp = skip_quoted_string (bp - 1, endb, ip->lineno, &ip->lineno,
- NULL_PTR, NULL_PTR);
- break;
- case '\\':
- /* Char after backslash loses its special meaning in some cases. */
- if (*bp == '\n') {
- ++ip->lineno;
- bp++;
- } else if (traditional && bp < endb)
- bp++;
- break;
- case '\n':
- ++ip->lineno;
- beg_of_line = bp;
- skipping_include_directive = 0;
- break;
- case '%':
- if (beg_of_line == 0 || traditional)
- break;
- ip->bufp = bp - 1;
- while (bp[0] == '\\' && bp[1] == '\n')
- bp += 2;
- if (*bp == ':')
- goto sharp_token;
- break;
- case '#':
- /* # keyword: a # must be first nonblank char on the line */
- if (beg_of_line == 0)
- break;
- ip->bufp = bp - 1;
- sharp_token:
- /* Scan from start of line, skipping whitespace, comments
- and backslash-newlines, and see if we reach this #.
- If not, this # is not special. */
- bp = beg_of_line;
- /* If -traditional, require # to be at beginning of line. */
- if (!traditional) {
- while (1) {
- if (is_hor_space[*bp])
- bp++;
- else if (*bp == '\\' && bp[1] == '\n')
- bp += 2;
- else if (*bp == '/' && bp[1] == '*') {
- bp += 2;
- while (1)
- {
- if (*bp == '*')
- {
- if (bp[1] == '/')
- {
- bp += 2;
- break;
- }
- }
- else
- {
-#ifdef MULTIBYTE_CHARS
- int length;
- length = local_mblen (bp, endb - bp);
- if (length > 1)
- bp += (length - 1);
-#endif
- }
- bp++;
- }
- }
- /* There is no point in trying to deal with C++ // comments here,
- because if there is one, then this # must be part of the
- comment and we would never reach here. */
- else break;
- }
- }
- if (bp != ip->bufp) {
- bp = ip->bufp + 1; /* Reset bp to after the #. */
- break;
- }
-
- bp = ip->bufp + 1; /* Point after the '#' */
- if (ip->bufp[0] == '%') {
- /* Skip past the ':' again. */
- while (*bp == '\\') {
- ip->lineno++;
- bp += 2;
- }
- bp++;
- }
-
- /* Skip whitespace and \-newline. */
- while (1) {
- if (is_hor_space[*bp])
- bp++;
- else if (*bp == '\\' && bp[1] == '\n')
- bp += 2;
- else if (*bp == '/') {
- if (bp[1] == '\\' && bp[2] == '\n')
- newline_fix (bp + 1);
- if (bp[1] == '*') {
- for (bp += 2; ; bp++) {
- if (*bp == '\n')
- ip->lineno++;
- else if (*bp == '*') {
- if (bp[-1] == '/' && warn_comments)
- warning ("`/*' within comment");
- if (bp[1] == '\\' && bp[2] == '\n')
- newline_fix (bp + 1);
- if (bp[1] == '/')
- break;
- }
- else
- {
-#ifdef MULTIBYTE_CHARS
- int length;
- length = local_mblen (bp, endb - bp);
- if (length > 1)
- bp += (length - 1);
-#endif
- }
- }
- bp += 2;
- } else if (bp[1] == '/' && cplusplus_comments) {
- for (bp += 2; ; bp++) {
- if (*bp == '\n')
- break;
- if (*bp == '\\' && bp[1] == '\n')
- {
- if (warn_comments)
- warning ("multiline `//' comment");
- ip->lineno++;
- bp++;
- }
- else
- {
-#ifdef MULTIBYTE_CHARS
- int length;
- length = local_mblen (bp, endb - bp);
- if (length > 1)
- bp += (length - 1);
-#endif
- }
- }
- } else
- break;
- } else
- break;
- }
-
- cp = bp;
-
- /* Now find end of directive name.
- If we encounter a backslash-newline, exchange it with any following
- symbol-constituents so that we end up with a contiguous name. */
-
- while (1) {
- if (is_idchar[*bp])
- bp++;
- else {
- if (*bp == '\\' && bp[1] == '\n')
- name_newline_fix (bp);
- if (is_idchar[*bp])
- bp++;
- else break;
- }
- }
- ident_length = bp - cp;
- ident = cp;
- after_ident = bp;
-
- /* A line of just `#' becomes blank. */
-
- if (ident_length == 0 && *after_ident == '\n') {
- continue;
- }
-
- if (ident_length == 0 || !is_idstart[*ident]) {
- U_CHAR *p = ident;
- while (is_idchar[*p]) {
- if (*p < '0' || *p > '9')
- break;
- p++;
- }
- /* Handle # followed by a line number. */
- if (p != ident && !is_idchar[*p]) {
- if (pedantic)
- pedwarn ("`#' followed by integer");
- continue;
- }
-
- /* Avoid error for `###' and similar cases unless -pedantic. */
- if (p == ident) {
- while (*p == '#' || is_hor_space[*p]) p++;
- if (*p == '\n') {
- if (pedantic && !lang_asm)
- pedwarn ("invalid preprocessing directive");
- continue;
- }
- }
-
- if (!lang_asm && pedantic)
- pedwarn ("invalid preprocessing directive name");
- continue;
- }
-
- for (kt = directive_table; kt->length >= 0; kt++) {
- IF_STACK_FRAME *temp;
- if (ident_length == kt->length
- && bcmp (cp, kt->name, kt->length) == 0) {
- /* If we are asked to return on next directive, do so now. */
- if (any)
- goto done;
-
- switch (kt->type) {
- case T_IF:
- case T_IFDEF:
- case T_IFNDEF:
- temp = (IF_STACK_FRAME *) xcalloc (1, sizeof (IF_STACK_FRAME));
- temp->next = if_stack;
- if_stack = temp;
- temp->lineno = ip->lineno;
- temp->fname = ip->nominal_fname;
- temp->fname_len = ip->nominal_fname_len;
- temp->type = kt->type;
- break;
- case T_ELSE:
- case T_ENDIF:
- if (pedantic && if_stack != save_if_stack)
- validate_else (bp, endb);
- case T_ELIF:
- if (if_stack == instack[indepth].if_stack) {
- error ("`#%s' not within a conditional", kt->name);
- break;
- }
- else if (if_stack == save_if_stack)
- goto done; /* found what we came for */
-
- if (kt->type != T_ENDIF) {
- if (if_stack->type == T_ELSE)
- error ("`#else' or `#elif' after `#else'");
- if_stack->type = kt->type;
- break;
- }
-
- temp = if_stack;
- if_stack = if_stack->next;
- free (temp);
- break;
-
- case T_INCLUDE:
- case T_INCLUDE_NEXT:
- case T_IMPORT:
- skipping_include_directive = 1;
- break;
-
- default:
- break;
- }
- break;
- }
- }
- /* Don't let erroneous code go by. */
- if (kt->length < 0 && !lang_asm && pedantic)
- pedwarn ("invalid preprocessing directive name");
- }
- }
-
- ip->bufp = bp;
- /* after this returns, rescan will exit because ip->bufp
- now points to the end of the buffer.
- rescan is responsible for the error message also. */
-
- done:
- if (output_conditionals && op != 0) {
- char *ptr = "#endfailed\n";
- int len = strlen (ptr);
-
- if (op->bufp > op->buf && op->bufp[-1] != '\n')
- {
- *op->bufp++ = '\n';
- op->lineno++;
- }
- check_expand (op, beg_of_line - beg_of_group);
- bcopy ((char *) beg_of_group, (char *) op->bufp,
- beg_of_line - beg_of_group);
- op->bufp += beg_of_line - beg_of_group;
- op->lineno += ip->lineno - beg_lineno;
- check_expand (op, len);
- bcopy (ptr, (char *) op->bufp, len);
- op->bufp += len;
- op->lineno++;
- }
-}
-
-/* Handle a #else directive. Do this by just continuing processing
- without changing if_stack ; this is so that the error message
- for missing #endif's etc. will point to the original #if. It
- is possible that something different would be better. */
-
-static int
-do_else (buf, limit, op, keyword)
- U_CHAR *buf, *limit;
- FILE_BUF *op;
- struct directive *keyword ATTRIBUTE_UNUSED;
-{
- FILE_BUF *ip = &instack[indepth];
-
- if (pedantic) {
- SKIP_WHITE_SPACE (buf);
- if (buf != limit)
- pedwarn ("text following `#else' violates ANSI standard");
- }
-
- if (if_stack == instack[indepth].if_stack) {
- error ("`#else' not within a conditional");
- return 0;
- } else {
- /* #ifndef can't have its special treatment for containing the whole file
- if it has a #else clause. */
- if_stack->control_macro = 0;
-
- if (if_stack->type != T_IF && if_stack->type != T_ELIF) {
- error ("`#else' after `#else'");
- fprintf (stderr, " (matches line %d", if_stack->lineno);
- if (! (if_stack->fname_len == ip->nominal_fname_len
- && !bcmp (if_stack->fname, ip->nominal_fname,
- if_stack->fname_len))) {
- fprintf (stderr, ", file ");
- eprint_string (if_stack->fname, if_stack->fname_len);
- }
- fprintf (stderr, ")\n");
- }
- if_stack->type = T_ELSE;
- }
-
- if (if_stack->if_succeeded)
- skip_if_group (ip, 0, op);
- else {
- ++if_stack->if_succeeded; /* continue processing input */
- output_line_directive (ip, op, 1, same_file);
- }
- return 0;
-}
-
-/* Unstack after #endif directive. */
-
-static int
-do_endif (buf, limit, op, keyword)
- U_CHAR *buf, *limit;
- FILE_BUF *op;
- struct directive *keyword ATTRIBUTE_UNUSED;
-{
- if (pedantic) {
- SKIP_WHITE_SPACE (buf);
- if (buf != limit)
- pedwarn ("text following `#endif' violates ANSI standard");
- }
-
- if (if_stack == instack[indepth].if_stack)
- error ("unbalanced `#endif'");
- else {
- IF_STACK_FRAME *temp = if_stack;
- if_stack = if_stack->next;
- if (temp->control_macro != 0) {
- /* This #endif matched a #ifndef at the start of the file.
- See if it is at the end of the file. */
- FILE_BUF *ip = &instack[indepth];
- U_CHAR *p = ip->bufp;
- U_CHAR *ep = ip->buf + ip->length;
-
- while (p != ep) {
- U_CHAR c = *p++;
- if (!is_space[c]) {
- if (c == '/'
- && (*p == '*' || (cplusplus_comments && *p == '/'))) {
- /* Skip this comment. */
- int junk = 0;
- U_CHAR *save_bufp = ip->bufp;
- ip->bufp = p + 1;
- p = skip_to_end_of_comment (ip, &junk, 1);
- ip->bufp = save_bufp;
- } else
- goto fail;
- }
- }
- /* If we get here, this #endif ends a #ifndef
- that contains all of the file (aside from whitespace).
- Arrange not to include the file again
- if the macro that was tested is defined.
-
- Do not do this for the top-level file in a -include or any
- file in a -imacros. */
- if (indepth != 0
- && ! (indepth == 1 && no_record_file)
- && ! (no_record_file && no_output))
- record_control_macro (ip->inc, temp->control_macro);
- fail: ;
- }
- free (temp);
- output_line_directive (&instack[indepth], op, 1, same_file);
- }
- return 0;
-}
-
-/* When an #else or #endif is found while skipping failed conditional,
- if -pedantic was specified, this is called to warn about text after
- the directive name. P points to the first char after the directive
- name. */
-
-static void
-validate_else (p, limit)
- register U_CHAR *p;
- register U_CHAR *limit;
-{
- /* Advance P over whitespace and comments. */
- while (1) {
- while (*p == '\\' && p[1] == '\n')
- p += 2;
- if (is_hor_space[*p])
- p++;
- else if (*p == '/') {
- while (p[1] == '\\' && p[2] == '\n')
- p += 2;
- if (p[1] == '*') {
- /* Don't bother warning about unterminated comments
- since that will happen later. Just be sure to exit. */
- for (p += 2; ; p++) {
- if (p == limit)
- return;
- if (*p == '*') {
- while (p[1] == '\\' && p[2] == '\n')
- p += 2;
- if (p[1] == '/') {
- p += 2;
- break;
- }
- }
- else
- {
-#ifdef MULTIBYTE_CHARS
- int length;
- length = local_mblen (p, limit - p);
- if (length > 1)
- p += (length - 1);
-#endif
- }
- }
- }
- else if (cplusplus_comments && p[1] == '/')
- return;
- else break;
- } else break;
- }
- if (*p != '\n')
- pedwarn ("text following `#else' or `#endif' violates ANSI standard");
-}
-
-/* Skip a comment, assuming the input ptr immediately follows the
- initial slash-star. Bump *LINE_COUNTER for each newline.
- (The canonical line counter is &ip->lineno.)
- Don't use this routine (or the next one) if bumping the line
- counter is not sufficient to deal with newlines in the string.
-
- If NOWARN is nonzero, don't warn about slash-star inside a comment.
- This feature is useful when processing a comment that is going to
- be processed or was processed at another point in the preprocessor,
- to avoid a duplicate warning. Likewise for unterminated comment
- errors. */
-
-static U_CHAR *
-skip_to_end_of_comment (ip, line_counter, nowarn)
- register FILE_BUF *ip;
- int *line_counter; /* place to remember newlines, or NULL */
- int nowarn;
-{
- register U_CHAR *limit = ip->buf + ip->length;
- register U_CHAR *bp = ip->bufp;
- FILE_BUF *op = put_out_comments && !line_counter ? &outbuf : (FILE_BUF *) 0;
- int start_line = line_counter ? *line_counter : 0;
-
- /* JF this line_counter stuff is a crock to make sure the
- comment is only put out once, no matter how many times
- the comment is skipped. It almost works */
- if (op) {
- *op->bufp++ = '/';
- *op->bufp++ = bp[-1];
- }
- if (cplusplus_comments && bp[-1] == '/') {
- for (; bp < limit; bp++) {
- if (*bp == '\n')
- break;
- if (*bp == '\\' && bp + 1 < limit && bp[1] == '\n')
- {
- if (!nowarn && warn_comments)
- warning ("multiline `//' comment");
- if (line_counter)
- ++*line_counter;
- if (op)
- {
- ++op->lineno;
- *op->bufp++ = *bp;
- }
- ++bp;
- }
- else
- {
-#ifdef MULTIBYTE_CHARS
- int length;
- length = local_mblen (bp, limit - bp);
- if (length > 1)
- {
- if (op)
- {
- bcopy (bp, op->bufp, length - 1);
- op->bufp += (length - 1);
- }
- bp += (length - 1);
- }
-#endif
- }
- if (op)
- *op->bufp++ = *bp;
- }
- ip->bufp = bp;
- return bp;
- }
- while (bp < limit) {
- if (op)
- *op->bufp++ = *bp;
- switch (*bp++) {
- case '\n':
- /* If this is the end of the file, we have an unterminated comment.
- Don't swallow the newline. We are guaranteed that there will be a
- trailing newline and various pieces assume it's there. */
- if (bp == limit)
- {
- --bp;
- --limit;
- break;
- }
- if (line_counter != NULL)
- ++*line_counter;
- if (op)
- ++op->lineno;
- break;
- case '*':
- if (bp[-2] == '/' && !nowarn && warn_comments)
- warning ("`/*' within comment");
- if (*bp == '\\' && bp[1] == '\n')
- newline_fix (bp);
- if (*bp == '/') {
- if (op)
- *op->bufp++ = '/';
- ip->bufp = ++bp;
- return bp;
- }
- break;
-#ifdef MULTIBYTE_CHARS
- default:
- {
- int length;
- bp--;
- length = local_mblen (bp, limit - bp);
- if (length <= 0)
- length = 1;
- if (op)
- {
- op->bufp--;
- bcopy (bp, op->bufp, length);
- op->bufp += length;
- }
- bp += length;
- }
-#endif
- }
- }
-
- if (!nowarn)
- error_with_line (line_for_error (start_line), "unterminated comment");
- ip->bufp = bp;
- return bp;
-}
-
-/* Skip over a quoted string. BP points to the opening quote.
- Returns a pointer after the closing quote. Don't go past LIMIT.
- START_LINE is the line number of the starting point (but it need
- not be valid if the starting point is inside a macro expansion).
-
- The input stack state is not changed.
-
- If COUNT_NEWLINES is nonzero, it points to an int to increment
- for each newline passed.
-
- If BACKSLASH_NEWLINES_P is nonzero, store 1 thru it
- if we pass a backslash-newline.
-
- If EOFP is nonzero, set *EOFP to 1 if the string is unterminated. */
-
-static U_CHAR *
-skip_quoted_string (bp, limit, start_line, count_newlines, backslash_newlines_p, eofp)
- register U_CHAR *bp;
- register U_CHAR *limit;
- int start_line;
- int *count_newlines;
- int *backslash_newlines_p;
- int *eofp;
-{
- register U_CHAR c, match;
-
- match = *bp++;
- while (1) {
- if (bp >= limit) {
- error_with_line (line_for_error (start_line),
- "unterminated string or character constant");
- error_with_line (multiline_string_line,
- "possible real start of unterminated constant");
- multiline_string_line = 0;
- if (eofp)
- *eofp = 1;
- break;
- }
- c = *bp++;
- if (c == '\\') {
- while (*bp == '\\' && bp[1] == '\n') {
- if (backslash_newlines_p)
- *backslash_newlines_p = 1;
- if (count_newlines)
- ++*count_newlines;
- bp += 2;
- }
- if (*bp == '\n') {
- if (backslash_newlines_p)
- *backslash_newlines_p = 1;
- if (count_newlines)
- ++*count_newlines;
- }
- bp++;
- } else if (c == '\n') {
- if (traditional) {
- /* Unterminated strings and character constants are 'valid'. */
- bp--; /* Don't consume the newline. */
- if (eofp)
- *eofp = 1;
- break;
- }
- if (match == '\'') {
- error_with_line (line_for_error (start_line),
- "unterminated string or character constant");
- bp--;
- if (eofp)
- *eofp = 1;
- break;
- }
- /* If not traditional, then allow newlines inside strings. */
- if (count_newlines)
- ++*count_newlines;
- if (multiline_string_line == 0) {
- if (pedantic)
- pedwarn_with_line (line_for_error (start_line),
- "string constant runs past end of line");
- multiline_string_line = start_line;
- }
- } else if (c == match)
- break;
-#ifdef MULTIBYTE_CHARS
- {
- int length;
- --bp;
- length = local_mblen (bp, limit - bp);
- if (length <= 0)
- length = 1;
- bp += length;
- }
-#endif
- }
- return bp;
-}
-
-/* Place into DST a quoted string representing the string SRC.
- SRCLEN is the length of SRC; SRC may contain null bytes.
- Return the address of DST's terminating null. */
-
-static char *
-quote_string (dst, src, srclen)
- char *dst, *src;
- size_t srclen;
-{
- U_CHAR c;
- char *srclim = src + srclen;
-
- *dst++ = '\"';
- while (src != srclim)
- switch ((c = *src++))
- {
- default:
- if (ISPRINT (c))
- *dst++ = c;
- else
- {
- sprintf (dst, "\\%03o", c);
- dst += 4;
- }
- break;
-
- case '\"':
- case '\\':
- *dst++ = '\\';
- *dst++ = c;
- break;
- }
-
- *dst++ = '\"';
- *dst = '\0';
- return dst;
-}
-
-/* Skip across a group of balanced parens, starting from IP->bufp.
- IP->bufp is updated. Use this with IP->bufp pointing at an open-paren.
-
- This does not handle newlines, because it's used for the arg of #if,
- where there aren't any newlines. Also, backslash-newline can't appear. */
-
-static U_CHAR *
-skip_paren_group (ip)
- register FILE_BUF *ip;
-{
- U_CHAR *limit = ip->buf + ip->length;
- U_CHAR *p = ip->bufp;
- int depth = 0;
- int lines_dummy = 0;
-
- while (p != limit) {
- int c = *p++;
- switch (c) {
- case '(':
- depth++;
- break;
-
- case ')':
- depth--;
- if (depth == 0)
- return ip->bufp = p;
- break;
-
- case '/':
- if (*p == '*') {
- ip->bufp = p;
- p = skip_to_end_of_comment (ip, &lines_dummy, 0);
- p = ip->bufp;
- }
-
- case '"':
- case '\'':
- {
- int eofp = 0;
- p = skip_quoted_string (p - 1, limit, 0, NULL_PTR, NULL_PTR, &eofp);
- if (eofp)
- return ip->bufp = p;
- }
- break;
- }
- }
-
- ip->bufp = p;
- return p;
-}
-
-/* Write out a #line directive, for instance, after an #include file.
- If CONDITIONAL is nonzero, we can omit the #line if it would
- appear to be a no-op, and we can output a few newlines instead
- if we want to increase the line number by a small amount.
- FILE_CHANGE says whether we are entering a file, leaving, or neither. */
-
-static void
-output_line_directive (ip, op, conditional, file_change)
- FILE_BUF *ip, *op;
- int conditional;
- enum file_change_code file_change;
-{
- int len;
- char *line_directive_buf, *line_end;
-
- if (no_line_directives
- || ip->fname == NULL
- || no_output) {
- op->lineno = ip->lineno;
- return;
- }
-
- if (conditional) {
- if (ip->lineno == op->lineno)
- return;
-
- /* If the inherited line number is a little too small,
- output some newlines instead of a #line directive. */
- if (ip->lineno > op->lineno && ip->lineno < op->lineno + 8) {
- check_expand (op, 10);
- while (ip->lineno > op->lineno) {
- *op->bufp++ = '\n';
- op->lineno++;
- }
- return;
- }
- }
-
- /* Output a positive line number if possible. */
- while (ip->lineno <= 0 && ip->bufp - ip->buf < ip->length
- && *ip->bufp == '\n') {
- ip->lineno++;
- ip->bufp++;
- }
-
- line_directive_buf = (char *) alloca (4 * ip->nominal_fname_len + 100);
- sprintf (line_directive_buf, "# %d ", ip->lineno);
- line_end = quote_string (line_directive_buf + strlen (line_directive_buf),
- ip->nominal_fname, ip->nominal_fname_len);
- if (file_change != same_file) {
- *line_end++ = ' ';
- *line_end++ = file_change == enter_file ? '1' : '2';
- }
- /* Tell cc1 if following text comes from a system header file. */
- if (ip->system_header_p) {
- *line_end++ = ' ';
- *line_end++ = '3';
- }
-#ifndef NO_IMPLICIT_EXTERN_C
- /* Tell cc1plus if following text should be treated as C. */
- if (ip->system_header_p == 2 && cplusplus) {
- *line_end++ = ' ';
- *line_end++ = '4';
- }
-#endif
- *line_end++ = '\n';
- len = line_end - line_directive_buf;
- check_expand (op, len + 1);
- if (op->bufp > op->buf && op->bufp[-1] != '\n')
- *op->bufp++ = '\n';
- bcopy ((char *) line_directive_buf, (char *) op->bufp, len);
- op->bufp += len;
- op->lineno = ip->lineno;
-}
-
-/* This structure represents one parsed argument in a macro call.
- `raw' points to the argument text as written (`raw_length' is its length).
- `expanded' points to the argument's macro-expansion
- (its length is `expand_length').
- `stringified_length' is the length the argument would have
- if stringified.
- `use_count' is the number of times this macro arg is substituted
- into the macro. If the actual use count exceeds 10,
- the value stored is 10.
- `free1' and `free2', if nonzero, point to blocks to be freed
- when the macro argument data is no longer needed. */
-
-struct argdata {
- U_CHAR *raw, *expanded;
- int raw_length, expand_length;
- int stringified_length;
- U_CHAR *free1, *free2;
- char newlines;
- char use_count;
-};
-
-/* Expand a macro call.
- HP points to the symbol that is the macro being called.
- Put the result of expansion onto the input stack
- so that subsequent input by our caller will use it.
-
- If macro wants arguments, caller has already verified that
- an argument list follows; arguments come from the input stack. */
-
-static void
-macroexpand (hp, op)
- HASHNODE *hp;
- FILE_BUF *op;
-{
- int nargs;
- DEFINITION *defn = hp->value.defn;
- register U_CHAR *xbuf;
- int xbuf_len;
- int start_line = instack[indepth].lineno;
- int rest_args, rest_zero;
-
- CHECK_DEPTH (return;);
-
- /* it might not actually be a macro. */
- if (hp->type != T_MACRO) {
- special_symbol (hp, op);
- return;
- }
-
- /* This macro is being used inside a #if, which means it must be */
- /* recorded as a precondition. */
- if (pcp_inside_if && pcp_outfile && defn->predefined)
- dump_single_macro (hp, pcp_outfile);
-
- nargs = defn->nargs;
-
- if (nargs >= 0) {
- register int i;
- struct argdata *args;
- int parse_error = 0;
-
- args = (struct argdata *) alloca ((nargs + 1) * sizeof (struct argdata));
-
- for (i = 0; i < nargs; i++) {
- args[i].raw = (U_CHAR *) "";
- args[i].expanded = 0;
- args[i].raw_length = args[i].expand_length
- = args[i].stringified_length = 0;
- args[i].free1 = args[i].free2 = 0;
- args[i].use_count = 0;
- }
-
- /* Parse all the macro args that are supplied. I counts them.
- The first NARGS args are stored in ARGS.
- The rest are discarded.
- If rest_args is set then we assume macarg absorbed the rest of the args.
- */
- i = 0;
- rest_args = 0;
- do {
- /* Discard the open-parenthesis or comma before the next arg. */
- ++instack[indepth].bufp;
- if (rest_args)
- continue;
- if (i < nargs || (nargs == 0 && i == 0)) {
- /* If we are working on last arg which absorbs rest of args... */
- if (i == nargs - 1 && defn->rest_args)
- rest_args = 1;
- parse_error = macarg (&args[i], rest_args);
- }
- else
- parse_error = macarg (NULL_PTR, 0);
- if (parse_error) {
- error_with_line (line_for_error (start_line),
- "unterminated macro call");
- break;
- }
- i++;
- } while (*instack[indepth].bufp != ')');
-
- /* If we got one arg but it was just whitespace, call that 0 args. */
- if (i == 1) {
- register U_CHAR *bp = args[0].raw;
- register U_CHAR *lim = bp + args[0].raw_length;
- /* cpp.texi says for foo ( ) we provide one argument.
- However, if foo wants just 0 arguments, treat this as 0. */
- if (nargs == 0)
- while (bp != lim && is_space[*bp]) bp++;
- if (bp == lim)
- i = 0;
- }
-
- /* Don't output an error message if we have already output one for
- a parse error above. */
- rest_zero = 0;
- if (nargs == 0 && i > 0) {
- if (! parse_error)
- error ("arguments given to macro `%s'", hp->name);
- } else if (i < nargs) {
- /* traditional C allows foo() if foo wants one argument. */
- if (nargs == 1 && i == 0 && traditional)
- ;
- /* the rest args token is allowed to absorb 0 tokens */
- else if (i == nargs - 1 && defn->rest_args)
- rest_zero = 1;
- else if (parse_error)
- ;
- else if (i == 0)
- error ("macro `%s' used without args", hp->name);
- else if (i == 1)
- error ("macro `%s' used with just one arg", hp->name);
- else
- error ("macro `%s' used with only %d args", hp->name, i);
- } else if (i > nargs) {
- if (! parse_error)
- error ("macro `%s' used with too many (%d) args", hp->name, i);
- }
-
- /* Swallow the closeparen. */
- ++instack[indepth].bufp;
-
- /* If macro wants zero args, we parsed the arglist for checking only.
- Read directly from the macro definition. */
- if (nargs == 0) {
- xbuf = defn->expansion;
- xbuf_len = defn->length;
- } else {
- register U_CHAR *exp = defn->expansion;
- register int offset; /* offset in expansion,
- copied a piece at a time */
- register int totlen; /* total amount of exp buffer filled so far */
-
- register struct reflist *ap, *last_ap;
-
- /* Macro really takes args. Compute the expansion of this call. */
-
- /* Compute length in characters of the macro's expansion.
- Also count number of times each arg is used. */
- xbuf_len = defn->length;
- for (ap = defn->pattern; ap != NULL; ap = ap->next) {
- if (ap->stringify)
- xbuf_len += args[ap->argno].stringified_length;
- else if (ap->raw_before != 0 || ap->raw_after != 0 || traditional)
- /* Add 4 for two newline-space markers to prevent
- token concatenation. */
- xbuf_len += args[ap->argno].raw_length + 4;
- else {
- /* We have an ordinary (expanded) occurrence of the arg.
- So compute its expansion, if we have not already. */
- if (args[ap->argno].expanded == 0) {
- FILE_BUF obuf;
- obuf = expand_to_temp_buffer (args[ap->argno].raw,
- args[ap->argno].raw + args[ap->argno].raw_length,
- 1, 0);
-
- args[ap->argno].expanded = obuf.buf;
- args[ap->argno].expand_length = obuf.length;
- args[ap->argno].free2 = obuf.buf;
- }
-
- /* Add 4 for two newline-space markers to prevent
- token concatenation. */
- xbuf_len += args[ap->argno].expand_length + 4;
- }
- if (args[ap->argno].use_count < 10)
- args[ap->argno].use_count++;
- }
-
- xbuf = (U_CHAR *) xmalloc (xbuf_len + 1);
-
- /* Generate in XBUF the complete expansion
- with arguments substituted in.
- TOTLEN is the total size generated so far.
- OFFSET is the index in the definition
- of where we are copying from. */
- offset = totlen = 0;
- for (last_ap = NULL, ap = defn->pattern; ap != NULL;
- last_ap = ap, ap = ap->next) {
- register struct argdata *arg = &args[ap->argno];
- int count_before = totlen;
-
- /* Add chars to XBUF. */
- for (i = 0; i < ap->nchars; i++, offset++)
- xbuf[totlen++] = exp[offset];
-
- /* If followed by an empty rest arg with concatenation,
- delete the last run of nonwhite chars. */
- if (rest_zero && totlen > count_before
- && ((ap->rest_args && ap->raw_before != 0)
- || (last_ap != NULL && last_ap->rest_args
- && last_ap->raw_after != 0))) {
- /* Delete final whitespace. */
- while (totlen > count_before && is_space[xbuf[totlen - 1]]) {
- totlen--;
- }
-
- /* Delete the nonwhites before them. */
- while (totlen > count_before && ! is_space[xbuf[totlen - 1]]) {
- totlen--;
- }
- }
-
- if (ap->stringify != 0) {
- int arglen = arg->raw_length;
- int escaped = 0;
- int in_string = 0;
- int c;
- i = 0;
- while (i < arglen
- && (c = arg->raw[i], is_space[c]))
- i++;
- while (i < arglen
- && (c = arg->raw[arglen - 1], is_space[c]))
- arglen--;
- if (!traditional)
- xbuf[totlen++] = '\"'; /* insert beginning quote */
- for (; i < arglen; i++) {
- c = arg->raw[i];
-
- if (! in_string) {
- /* Special markers Newline Space
- generate nothing for a stringified argument. */
- if (c == '\n' && arg->raw[i+1] != '\n') {
- i++;
- continue;
- }
-
- /* Internal sequences of whitespace are replaced by one space
- except within an string or char token. */
- if (c == '\n' ? arg->raw[i+1] == '\n' : is_space[c]) {
- while (1) {
- /* Note that Newline Space does occur within whitespace
- sequences; consider it part of the sequence. */
- if (c == '\n' && is_space[arg->raw[i+1]])
- i += 2;
- else if (c != '\n' && is_space[c])
- i++;
- else break;
- c = arg->raw[i];
- }
- i--;
- c = ' ';
- }
- }
-
- if (escaped)
- escaped = 0;
- else {
- if (c == '\\')
- escaped = 1;
- else if (in_string) {
- if (c == in_string)
- in_string = 0;
- else
- {
-#ifdef MULTIBYTE_CHARS
- int length;
- length = local_mblen (arg->raw + i, arglen - i);
- if (length > 1)
- {
- bcopy (arg->raw + i, xbuf + totlen, length);
- i += length - 1;
- totlen += length;
- continue;
- }
-#endif
- }
- } else if (c == '\"' || c == '\'')
- in_string = c;
- }
-
- /* Escape these chars */
- if (c == '\"' || (in_string && c == '\\'))
- xbuf[totlen++] = '\\';
- /* We used to output e.g. \008 for control characters here,
- but this doesn't conform to the C Standard.
- Just output the characters as-is. */
- xbuf[totlen++] = c;
- }
- if (!traditional)
- xbuf[totlen++] = '\"'; /* insert ending quote */
- } else if (ap->raw_before != 0 || ap->raw_after != 0 || traditional) {
- U_CHAR *p1 = arg->raw;
- U_CHAR *l1 = p1 + arg->raw_length;
- if (ap->raw_before != 0) {
- while (p1 != l1 && is_space[*p1]) p1++;
- while (p1 != l1 && is_idchar[*p1])
- xbuf[totlen++] = *p1++;
- /* Delete any no-reexpansion marker that follows
- an identifier at the beginning of the argument
- if the argument is concatenated with what precedes it. */
- if (p1[0] == '\n' && p1[1] == '-')
- p1 += 2;
- } else if (!traditional) {
- /* Ordinary expanded use of the argument.
- Put in newline-space markers to prevent token pasting. */
- xbuf[totlen++] = '\n';
- xbuf[totlen++] = ' ';
- }
- if (ap->raw_after != 0) {
- /* Arg is concatenated after: delete trailing whitespace,
- whitespace markers, and no-reexpansion markers. */
- while (p1 != l1) {
- if (is_space[l1[-1]]) l1--;
- else if (l1[-1] == '-') {
- U_CHAR *p2 = l1 - 1;
- /* If a `-' is preceded by an odd number of newlines then it
- and the last newline are a no-reexpansion marker. */
- while (p2 != p1 && p2[-1] == '\n') p2--;
- if ((l1 - 1 - p2) & 1) {
- l1 -= 2;
- }
- else break;
- }
- else break;
- }
- }
-
- bcopy ((char *) p1, (char *) (xbuf + totlen), l1 - p1);
- totlen += l1 - p1;
- if (!traditional && ap->raw_after == 0) {
- /* Ordinary expanded use of the argument.
- Put in newline-space markers to prevent token pasting. */
- xbuf[totlen++] = '\n';
- xbuf[totlen++] = ' ';
- }
- } else {
- /* Ordinary expanded use of the argument.
- Put in newline-space markers to prevent token pasting. */
- if (!traditional) {
- xbuf[totlen++] = '\n';
- xbuf[totlen++] = ' ';
- }
- bcopy ((char *) arg->expanded, (char *) (xbuf + totlen),
- arg->expand_length);
- totlen += arg->expand_length;
- if (!traditional) {
- xbuf[totlen++] = '\n';
- xbuf[totlen++] = ' ';
- }
- /* If a macro argument with newlines is used multiple times,
- then only expand the newlines once. This avoids creating output
- lines which don't correspond to any input line, which confuses
- gdb and gcov. */
- if (arg->use_count > 1 && arg->newlines > 0) {
- /* Don't bother doing change_newlines for subsequent
- uses of arg. */
- arg->use_count = 1;
- arg->expand_length
- = change_newlines (arg->expanded, arg->expand_length);
- }
- }
-
- if (totlen > xbuf_len)
- abort ();
- }
-
- /* If there is anything left of the definition after handling
- the arg list, copy that in too. */
-
- for (i = offset; i < defn->length; i++) {
- /* if we've reached the end of the macro */
- if (exp[i] == ')')
- rest_zero = 0;
- if (! (rest_zero && last_ap != NULL && last_ap->rest_args
- && last_ap->raw_after != 0))
- xbuf[totlen++] = exp[i];
- }
-
- xbuf[totlen] = 0;
- xbuf_len = totlen;
-
- for (i = 0; i < nargs; i++) {
- if (args[i].free1 != 0)
- free (args[i].free1);
- if (args[i].free2 != 0)
- free (args[i].free2);
- }
- }
- } else {
- xbuf = defn->expansion;
- xbuf_len = defn->length;
- }
-
- /* Now put the expansion on the input stack
- so our caller will commence reading from it. */
- {
- register FILE_BUF *ip2;
-
- ip2 = &instack[++indepth];
-
- ip2->fname = 0;
- ip2->nominal_fname = 0;
- ip2->nominal_fname_len = 0;
- ip2->inc = 0;
- /* This may not be exactly correct, but will give much better error
- messages for nested macro calls than using a line number of zero. */
- ip2->lineno = start_line;
- ip2->buf = xbuf;
- ip2->length = xbuf_len;
- ip2->bufp = xbuf;
- ip2->free_ptr = (nargs > 0) ? xbuf : 0;
- ip2->macro = hp;
- ip2->if_stack = if_stack;
- ip2->system_header_p = 0;
-
- /* Recursive macro use sometimes works traditionally.
- #define foo(x,y) bar (x (y,0), y)
- foo (foo, baz) */
-
- if (!traditional)
- hp->type = T_DISABLED;
- }
-}
-
-/* Parse a macro argument and store the info on it into *ARGPTR.
- REST_ARGS is passed to macarg1 to make it absorb the rest of the args.
- Return nonzero to indicate a syntax error. */
-
-static int
-macarg (argptr, rest_args)
- register struct argdata *argptr;
- int rest_args;
-{
- FILE_BUF *ip = &instack[indepth];
- int paren = 0;
- int newlines = 0;
- int comments = 0;
- int result = 0;
-
- /* Try to parse as much of the argument as exists at this
- input stack level. */
- U_CHAR *bp = macarg1 (ip->bufp, ip->buf + ip->length, ip->macro,
- &paren, &newlines, &comments, rest_args);
-
- /* If we find the end of the argument at this level,
- set up *ARGPTR to point at it in the input stack. */
- if (!(ip->fname != 0 && (newlines != 0 || comments != 0))
- && bp != ip->buf + ip->length) {
- if (argptr != 0) {
- argptr->raw = ip->bufp;
- argptr->raw_length = bp - ip->bufp;
- argptr->newlines = newlines;
- }
- ip->bufp = bp;
- } else {
- /* This input stack level ends before the macro argument does.
- We must pop levels and keep parsing.
- Therefore, we must allocate a temporary buffer and copy
- the macro argument into it. */
- int bufsize = bp - ip->bufp;
- int extra = newlines;
- U_CHAR *buffer = (U_CHAR *) xmalloc (bufsize + extra + 1);
- int final_start = 0;
-
- bcopy ((char *) ip->bufp, (char *) buffer, bufsize);
- ip->bufp = bp;
- ip->lineno += newlines;
-
- while (bp == ip->buf + ip->length) {
- if (instack[indepth].macro == 0) {
- result = 1;
- break;
- }
- ip->macro->type = T_MACRO;
- if (ip->free_ptr)
- free (ip->free_ptr);
- ip = &instack[--indepth];
- newlines = 0;
- comments = 0;
- bp = macarg1 (ip->bufp, ip->buf + ip->length, ip->macro, &paren,
- &newlines, &comments, rest_args);
- final_start = bufsize;
- bufsize += bp - ip->bufp;
- extra += newlines;
- buffer = (U_CHAR *) xrealloc (buffer, bufsize + extra + 1);
- bcopy ((char *) ip->bufp, (char *) (buffer + bufsize - (bp - ip->bufp)),
- bp - ip->bufp);
- ip->bufp = bp;
- ip->lineno += newlines;
- }
-
- /* Now, if arg is actually wanted, record its raw form,
- discarding comments and duplicating newlines in whatever
- part of it did not come from a macro expansion.
- EXTRA space has been preallocated for duplicating the newlines.
- FINAL_START is the index of the start of that part. */
- if (argptr != 0) {
- argptr->raw = buffer;
- argptr->raw_length = bufsize;
- argptr->free1 = buffer;
- argptr->newlines = newlines;
- if ((newlines || comments) && ip->fname != 0)
- argptr->raw_length
- = final_start +
- discard_comments (argptr->raw + final_start,
- argptr->raw_length - final_start,
- newlines);
- argptr->raw[argptr->raw_length] = 0;
- if (argptr->raw_length > bufsize + extra)
- abort ();
- }
- }
-
- /* If we are not discarding this argument,
- macroexpand it and compute its length as stringified.
- All this info goes into *ARGPTR. */
-
- if (argptr != 0) {
- register U_CHAR *buf, *lim;
- register int totlen;
-
- buf = argptr->raw;
- lim = buf + argptr->raw_length;
-
- while (buf != lim && is_space[*buf])
- buf++;
- while (buf != lim && is_space[lim[-1]])
- lim--;
- totlen = traditional ? 0 : 2; /* Count opening and closing quote. */
- while (buf != lim) {
- register U_CHAR c = *buf++;
- totlen++;
- /* Internal sequences of whitespace are replaced by one space
- in most cases, but not always. So count all the whitespace
- in case we need to keep it all. */
-#if 0
- if (is_space[c])
- SKIP_ALL_WHITE_SPACE (buf);
- else
-#endif
- if (c == '\"' || c == '\\') /* escape these chars */
- totlen++;
- }
- argptr->stringified_length = totlen;
- }
- return result;
-}
-
-/* Scan text from START (inclusive) up to LIMIT (exclusive),
- taken from the expansion of MACRO,
- counting parens in *DEPTHPTR,
- and return if reach LIMIT
- or before a `)' that would make *DEPTHPTR negative
- or before a comma when *DEPTHPTR is zero.
- Single and double quotes are matched and termination
- is inhibited within them. Comments also inhibit it.
- Value returned is pointer to stopping place.
-
- Increment *NEWLINES each time a newline is passed.
- REST_ARGS notifies macarg1 that it should absorb the rest of the args.
- Set *COMMENTS to 1 if a comment is seen. */
-
-static U_CHAR *
-macarg1 (start, limit, macro, depthptr, newlines, comments, rest_args)
- U_CHAR *start;
- register U_CHAR *limit;
- struct hashnode *macro;
- int *depthptr, *newlines, *comments;
- int rest_args;
-{
- register U_CHAR *bp = start;
-
- while (bp < limit) {
- switch (*bp) {
- case '(':
- (*depthptr)++;
- break;
- case ')':
- if (--(*depthptr) < 0)
- return bp;
- break;
- case '\\':
- /* Traditionally, backslash makes following char not special. */
- if (traditional && bp + 1 < limit && bp[1] != '\n')
- bp++;
- break;
- case '\n':
- ++*newlines;
- break;
- case '/':
- if (macro)
- break;
- if (bp[1] == '\\' && bp[2] == '\n')
- newline_fix (bp + 1);
- if (bp[1] == '*') {
- *comments = 1;
- for (bp += 2; bp < limit; bp++) {
- if (*bp == '\n')
- ++*newlines;
- else if (*bp == '*') {
- if (bp[-1] == '/' && warn_comments)
- warning ("`/*' within comment");
- if (bp[1] == '\\' && bp[2] == '\n')
- newline_fix (bp + 1);
- if (bp[1] == '/') {
- bp++;
- break;
- }
- }
- else
- {
-#ifdef MULTIBYTE_CHARS
- int length;
- length = local_mblen (bp, limit - bp);
- if (length > 1)
- bp += (length - 1);
-#endif
- }
- }
- } else if (bp[1] == '/' && cplusplus_comments) {
- *comments = 1;
- for (bp += 2; bp < limit; bp++) {
- if (*bp == '\n') {
- ++*newlines;
- break;
- }
- if (*bp == '\\' && bp + 1 < limit && bp[1] == '\n')
- {
- ++*newlines;
- if (warn_comments)
- warning ("multiline `//' comment");
- ++bp;
- }
- else
- {
-#ifdef MULTIBYTE_CHARS
- int length;
- length = local_mblen (bp, limit - bp);
- if (length > 1)
- bp += (length - 1);
-#endif
- }
- }
- }
- break;
- case '\'':
- case '\"':
- {
- int quotec;
- for (quotec = *bp++; bp + 1 < limit && *bp != quotec; bp++) {
- if (*bp == '\\') {
- bp++;
- if (*bp == '\n')
- ++*newlines;
- if (!macro) {
- while (*bp == '\\' && bp[1] == '\n') {
- bp += 2;
- ++*newlines;
- }
- }
- } else if (*bp == '\n') {
- ++*newlines;
- if (quotec == '\'')
- break;
- }
- else
- {
-#ifdef MULTIBYTE_CHARS
- int length;
- length = local_mblen (bp, limit - bp);
- if (length > 1)
- bp += (length - 1);
-#endif
- }
- }
- }
- break;
- case ',':
- /* if we've returned to lowest level and we aren't absorbing all args */
- if ((*depthptr) == 0 && rest_args == 0)
- return bp;
- break;
- }
- bp++;
- }
-
- return bp;
-}
-
-/* Discard comments and duplicate newlines
- in the string of length LENGTH at START,
- except inside of string constants.
- The string is copied into itself with its beginning staying fixed.
-
- NEWLINES is the number of newlines that must be duplicated.
- We assume that that much extra space is available past the end
- of the string. */
-
-static int
-discard_comments (start, length, newlines)
- U_CHAR *start;
- int length;
- int newlines;
-{
- register U_CHAR *ibp;
- register U_CHAR *obp;
- register U_CHAR *limit;
- register int c;
-
- /* If we have newlines to duplicate, copy everything
- that many characters up. Then, in the second part,
- we will have room to insert the newlines
- while copying down.
- NEWLINES may actually be too large, because it counts
- newlines in string constants, and we don't duplicate those.
- But that does no harm. */
- if (newlines > 0) {
- ibp = start + length;
- obp = ibp + newlines;
- limit = start;
- while (limit != ibp)
- *--obp = *--ibp;
- }
-
- ibp = start + newlines;
- limit = start + length + newlines;
- obp = start;
-
- while (ibp < limit) {
- *obp++ = c = *ibp++;
- switch (c) {
- case '\n':
- /* Duplicate the newline. */
- *obp++ = '\n';
- break;
-
- case '\\':
- if (*ibp == '\n') {
- obp--;
- ibp++;
- }
- break;
-
- case '/':
- if (*ibp == '\\' && ibp[1] == '\n')
- newline_fix (ibp);
- /* Delete any comment. */
- if (cplusplus_comments && ibp[0] == '/') {
- /* Comments are equivalent to spaces. */
- obp[-1] = ' ';
- ibp++;
- while (ibp < limit)
- {
- if (*ibp == '\n')
- break;
- if (*ibp == '\\' && ibp + 1 < limit && ibp[1] == '\n')
- ibp++;
- else
- {
-#ifdef MULTIBYTE_CHARS
- int length = local_mblen (ibp, limit - ibp);
- if (length > 1)
- ibp += (length - 1);
-#endif
- }
- ibp++;
- }
- break;
- }
- if (ibp[0] != '*' || ibp + 1 >= limit)
- break;
- /* Comments are equivalent to spaces.
- For -traditional, a comment is equivalent to nothing. */
- if (traditional)
- obp--;
- else
- obp[-1] = ' ';
- while (++ibp < limit) {
- if (ibp[0] == '*') {
- if (ibp[1] == '\\' && ibp[2] == '\n')
- newline_fix (ibp + 1);
- if (ibp[1] == '/') {
- ibp += 2;
- break;
- }
- }
- else
- {
-#ifdef MULTIBYTE_CHARS
- int length = local_mblen (ibp, limit - ibp);
- if (length > 1)
- ibp += (length - 1);
-#endif
- }
- }
- break;
-
- case '\'':
- case '\"':
- /* Notice and skip strings, so that we don't
- think that comments start inside them,
- and so we don't duplicate newlines in them. */
- {
- int quotec = c;
- while (ibp < limit) {
- *obp++ = c = *ibp++;
- if (c == quotec)
- break;
- if (c == '\n')
- {
- if (quotec == '\'')
- break;
- }
- else if (c == '\\') {
- if (ibp < limit && *ibp == '\n') {
- ibp++;
- obp--;
- } else {
- while (*ibp == '\\' && ibp[1] == '\n')
- ibp += 2;
- if (ibp < limit)
- *obp++ = *ibp++;
- }
- }
- else
- {
-#ifdef MULTIBYTE_CHARS
- int length;
- ibp--;
- length = local_mblen (ibp, limit - ibp);
- if (length > 1)
- {
- obp--;
- bcopy (ibp, obp, length);
- ibp += length;
- obp += length;
- }
- else
- ibp++;
-#endif
- }
- }
- }
- break;
- }
- }
-
- return obp - start;
-}
-
-/* Turn newlines to spaces in the string of length LENGTH at START,
- except inside of string constants.
- The string is copied into itself with its beginning staying fixed. */
-
-static int
-change_newlines (start, length)
- U_CHAR *start;
- int length;
-{
- register U_CHAR *ibp;
- register U_CHAR *obp;
- register U_CHAR *limit;
- register int c;
-
- ibp = start;
- limit = start + length;
- obp = start;
-
- while (ibp < limit) {
- *obp++ = c = *ibp++;
- switch (c) {
- case '\n':
- /* If this is a NEWLINE NEWLINE, then this is a real newline in the
- string. Skip past the newline and its duplicate.
- Put a space in the output. */
- if (*ibp == '\n')
- {
- ibp++;
- obp--;
- *obp++ = ' ';
- }
- break;
-
- case '\'':
- case '\"':
- /* Notice and skip strings, so that we don't delete newlines in them. */
- {
- int quotec = c;
- while (ibp < limit) {
- *obp++ = c = *ibp++;
- if (c == quotec)
- break;
- else if (c == '\\' && ibp < limit && *ibp == '\n')
- *obp++ = *ibp++;
- else if (c == '\n')
- {
- if (quotec == '\'')
- break;
- }
- else
- {
-#ifdef MULTIBYTE_CHARS
- int length;
- ibp--;
- length = local_mblen (ibp, limit - ibp);
- if (length > 1)
- {
- obp--;
- bcopy (ibp, obp, length);
- ibp += length;
- obp += length;
- }
- else
- ibp++;
-#endif
- }
- }
- }
- break;
- }
- }
-
- return obp - start;
-}
-
-/* my_strerror - return the descriptive text associated with an
- `errno' code. */
-
-static char *
-my_strerror (errnum)
- int errnum;
-{
- char *result;
-
-#ifndef VMS
-#ifndef HAVE_STRERROR
- result = (char *) ((errnum < sys_nerr) ? sys_errlist[errnum] : 0);
-#else
- result = strerror (errnum);
-#endif
-#else /* VMS */
- /* VAXCRTL's strerror() takes an optional second argument, which only
- matters when the first argument is EVMSERR. However, it's simplest
- just to pass it unconditionally. `vaxc$errno' is declared in
- <errno.h>, and maintained by the library in parallel with `errno'.
- We assume that caller's `errnum' either matches the last setting of
- `errno' by the library or else does not have the value `EVMSERR'. */
-
- result = strerror (errnum, vaxc$errno);
-#endif
-
- if (!result)
- result = "errno = ?";
-
- return result;
-}
-
-/* notice - output message to stderr */
-
-static void
-notice VPROTO ((const char * msgid, ...))
-{
-#ifndef ANSI_PROTOTYPES
- const char * msgid;
-#endif
- va_list args;
-
- VA_START (args, msgid);
-
-#ifndef ANSI_PROTOTYPES
- msgid = va_arg (args, const char *);
-#endif
-
- vnotice (msgid, args);
- va_end (args);
-}
-
-static void
-vnotice (msgid, args)
- const char *msgid;
- va_list args;
-{
- vfprintf (stderr, _(msgid), args);
-}
-
-/* error - print error message and increment count of errors. */
-
-void
-error VPROTO ((const char * msgid, ...))
-{
-#ifndef ANSI_PROTOTYPES
- const char * msgid;
-#endif
- va_list args;
-
- VA_START (args, msgid);
-
-#ifndef ANSI_PROTOTYPES
- msgid = va_arg (args, const char *);
-#endif
-
- verror (msgid, args);
- va_end (args);
-}
-
-void
-verror (msgid, args)
- const char *msgid;
- va_list args;
-{
- int i;
- FILE_BUF *ip = NULL;
-
- print_containing_files ();
-
- for (i = indepth; i >= 0; i--)
- if (instack[i].fname != NULL) {
- ip = &instack[i];
- break;
- }
-
- if (ip != NULL) {
- eprint_string (ip->nominal_fname, ip->nominal_fname_len);
- fprintf (stderr, ":%d: ", ip->lineno);
- }
- vnotice (msgid, args);
- fprintf (stderr, "\n");
- errors++;
-}
-
-/* Error including a message from `errno'. */
-
-static void
-error_from_errno (name)
- char *name;
-{
- int e = errno;
- int i;
- FILE_BUF *ip = NULL;
-
- print_containing_files ();
-
- for (i = indepth; i >= 0; i--)
- if (instack[i].fname != NULL) {
- ip = &instack[i];
- break;
- }
-
- if (ip != NULL) {
- eprint_string (ip->nominal_fname, ip->nominal_fname_len);
- fprintf (stderr, ":%d: ", ip->lineno);
- }
-
- fprintf (stderr, "%s: %s\n", name, my_strerror (e));
-
- errors++;
-}
-
-/* Print error message but don't count it. */
-
-void
-warning VPROTO ((const char * msgid, ...))
-{
-#ifndef ANSI_PROTOTYPES
- const char * msgid;
-#endif
- va_list args;
-
- VA_START (args, msgid);
-
-#ifndef ANSI_PROTOTYPES
- msgid = va_arg (args, const char *);
-#endif
-
- vwarning (msgid, args);
- va_end (args);
-}
-
-static void
-vwarning (msgid, args)
- const char *msgid;
- va_list args;
-{
- int i;
- FILE_BUF *ip = NULL;
-
- if (inhibit_warnings)
- return;
-
- if (warnings_are_errors)
- errors++;
-
- print_containing_files ();
-
- for (i = indepth; i >= 0; i--)
- if (instack[i].fname != NULL) {
- ip = &instack[i];
- break;
- }
-
- if (ip != NULL) {
- eprint_string (ip->nominal_fname, ip->nominal_fname_len);
- fprintf (stderr, ":%d: ", ip->lineno);
- }
- notice ("warning: ");
- vnotice (msgid, args);
- fprintf (stderr, "\n");
-}
-
-static void
-error_with_line VPROTO ((int line, const char * msgid, ...))
-{
-#ifndef ANSI_PROTOTYPES
- int line;
- const char * msgid;
-#endif
- va_list args;
-
- VA_START (args, msgid);
-
-#ifndef ANSI_PROTOTYPES
- line = va_arg (args, int);
- msgid = va_arg (args, const char *);
-#endif
-
- verror_with_line (line, msgid, args);
- va_end (args);
-}
-
-
-static void
-verror_with_line (line, msgid, args)
- int line;
- const char *msgid;
- va_list args;
-{
- int i;
- FILE_BUF *ip = NULL;
-
- print_containing_files ();
-
- for (i = indepth; i >= 0; i--)
- if (instack[i].fname != NULL) {
- ip = &instack[i];
- break;
- }
-
- if (ip != NULL) {
- eprint_string (ip->nominal_fname, ip->nominal_fname_len);
- fprintf (stderr, ":%d: ", line);
- }
- vnotice (msgid, args);
- fprintf (stderr, "\n");
- errors++;
-}
-
-static void
-warning_with_line VPROTO ((int line, const char * msgid, ...))
-{
-#ifndef ANSI_PROTOTYPES
- int line;
- const char * msgid;
-#endif
- va_list args;
-
- VA_START (args, msgid);
-
-#ifndef ANSI_PROTOTYPES
- line = va_arg (args, int);
- msgid = va_arg (args, const char *);
-#endif
-
- vwarning_with_line (line, msgid, args);
- va_end (args);
-}
-
-static void
-vwarning_with_line (line, msgid, args)
- int line;
- const char *msgid;
- va_list args;
-{
- int i;
- FILE_BUF *ip = NULL;
-
- if (inhibit_warnings)
- return;
-
- if (warnings_are_errors)
- errors++;
-
- print_containing_files ();
-
- for (i = indepth; i >= 0; i--)
- if (instack[i].fname != NULL) {
- ip = &instack[i];
- break;
- }
-
- if (ip != NULL) {
- eprint_string (ip->nominal_fname, ip->nominal_fname_len);
- fprintf (stderr, line ? ":%d: " : ": ", line);
- }
- notice ("warning: ");
- vnotice (msgid, args);
- fprintf (stderr, "\n");
-}
-
-/* Print an error message and maybe count it. */
-
-void
-pedwarn VPROTO ((const char * msgid, ...))
-{
-#ifndef ANSI_PROTOTYPES
- const char * msgid;
-#endif
- va_list args;
-
- VA_START (args, msgid);
-
-#ifndef ANSI_PROTOTYPES
- msgid = va_arg (args, const char *);
-#endif
-
- if (pedantic_errors)
- verror (msgid, args);
- else
- vwarning (msgid, args);
- va_end (args);
-}
-
-void
-pedwarn_with_line VPROTO ((int line, const char * msgid, ...))
-{
-#ifndef ANSI_PROTOTYPES
- int line;
- const char * msgid;
-#endif
- va_list args;
-
- VA_START (args, msgid);
-
-#ifndef ANSI_PROTOTYPES
- line = va_arg (args, int);
- msgid = va_arg (args, const char *);
-#endif
-
- if (pedantic_errors)
- verror_with_line (line, msgid, args);
- else
- vwarning_with_line (line, msgid, args);
- va_end (args);
-}
-
-/* Report a warning (or an error if pedantic_errors)
- giving specified file name and line number, not current. */
-
-static void
-pedwarn_with_file_and_line VPROTO ((const char *file, size_t file_len, int line,
- const char * msgid, ...))
-{
-#ifndef ANSI_PROTOTYPES
- const char *file;
- size_t file_len;
- int line;
- const char * msgid;
-#endif
- va_list args;
-
- if (!pedantic_errors && inhibit_warnings)
- return;
-
- VA_START (args, msgid);
-
-#ifndef ANSI_PROTOTYPES
- file = va_arg (args, const char *);
- file_len = va_arg (args, size_t);
- line = va_arg (args, int);
- msgid = va_arg (args, const char *);
-#endif
-
- if (file) {
- eprint_string (file, file_len);
- fprintf (stderr, ":%d: ", line);
- }
- if (pedantic_errors)
- errors++;
- if (!pedantic_errors)
- notice ("warning: ");
- vnotice (msgid, args);
- va_end (args);
- fprintf (stderr, "\n");
-}
-
-static void
-pedwarn_strange_white_space (ch)
- int ch;
-{
- switch (ch)
- {
- case '\f': pedwarn ("formfeed in preprocessing directive"); break;
- case '\r': pedwarn ("carriage return in preprocessing directive"); break;
- case '\v': pedwarn ("vertical tab in preprocessing directive"); break;
- default: abort ();
- }
-}
-
-/* Print the file names and line numbers of the #include
- directives which led to the current file. */
-
-static void
-print_containing_files ()
-{
- FILE_BUF *ip = NULL;
- int i;
- int first = 1;
-
- /* If stack of files hasn't changed since we last printed
- this info, don't repeat it. */
- if (last_error_tick == input_file_stack_tick)
- return;
-
- for (i = indepth; i >= 0; i--)
- if (instack[i].fname != NULL) {
- ip = &instack[i];
- break;
- }
-
- /* Give up if we don't find a source file. */
- if (ip == NULL)
- return;
-
- /* Find the other, outer source files. */
- for (i--; i >= 0; i--)
- if (instack[i].fname != NULL) {
- ip = &instack[i];
- if (first) {
- first = 0;
- notice ( "In file included from ");
- } else {
- notice (",\n from ");
- }
-
- eprint_string (ip->nominal_fname, ip->nominal_fname_len);
- fprintf (stderr, ":%d", ip->lineno);
- }
- if (! first)
- fprintf (stderr, ":\n");
-
- /* Record we have printed the status as of this time. */
- last_error_tick = input_file_stack_tick;
-}
-
-/* Return the line at which an error occurred.
- The error is not necessarily associated with the current spot
- in the input stack, so LINE says where. LINE will have been
- copied from ip->lineno for the current input level.
- If the current level is for a file, we return LINE.
- But if the current level is not for a file, LINE is meaningless.
- In that case, we return the lineno of the innermost file. */
-
-static int
-line_for_error (line)
- int line;
-{
- int i;
- int line1 = line;
-
- for (i = indepth; i >= 0; ) {
- if (instack[i].fname != 0)
- return line1;
- i--;
- if (i < 0)
- return 0;
- line1 = instack[i].lineno;
- }
- abort ();
- /*NOTREACHED*/
- return 0;
-}
-
-/*
- * If OBUF doesn't have NEEDED bytes after OPTR, make it bigger.
- *
- * As things stand, nothing is ever placed in the output buffer to be
- * removed again except when it's KNOWN to be part of an identifier,
- * so flushing and moving down everything left, instead of expanding,
- * should work ok.
- */
-
-/* You might think void was cleaner for the return type,
- but that would get type mismatch in check_expand in strict ANSI. */
-
-static int
-grow_outbuf (obuf, needed)
- register FILE_BUF *obuf;
- register int needed;
-{
- register U_CHAR *p;
- int minsize;
-
- if (obuf->length - (obuf->bufp - obuf->buf) > needed)
- return 0;
-
- /* Make it at least twice as big as it is now. */
- obuf->length *= 2;
- /* Make it have at least 150% of the free space we will need. */
- minsize = (3 * needed) / 2 + (obuf->bufp - obuf->buf);
- if (minsize > obuf->length)
- obuf->length = minsize;
-
- if ((p = (U_CHAR *) xrealloc (obuf->buf, obuf->length)) == NULL)
- memory_full ();
-
- obuf->bufp = p + (obuf->bufp - obuf->buf);
- obuf->buf = p;
-
- return 0;
-}
-
-/* Symbol table for macro names and special symbols */
-
-/*
- * install a name in the main hash table, even if it is already there.
- * name stops with first non alphanumeric, except leading '#'.
- * caller must check against redefinition if that is desired.
- * delete_macro () removes things installed by install () in fifo order.
- * this is important because of the `defined' special symbol used
- * in #if, and also if pushdef/popdef directives are ever implemented.
- *
- * If LEN is >= 0, it is the length of the name.
- * Otherwise, compute the length by scanning the entire name.
- *
- * If HASH is >= 0, it is the precomputed hash code.
- * Otherwise, compute the hash code.
- */
-
-static HASHNODE *
-install (name, len, type, value, hash)
- U_CHAR *name;
- int len;
- enum node_type type;
- char *value;
- int hash;
-{
- register HASHNODE *hp;
- register int i, bucket;
- register U_CHAR *p, *q;
-
- if (len < 0) {
- p = name;
- while (is_idchar[*p])
- p++;
- len = p - name;
- }
-
- if (hash < 0)
- hash = hashf (name, len, HASHSIZE);
-
- i = sizeof (HASHNODE) + len + 1;
- hp = (HASHNODE *) xmalloc (i);
- bucket = hash;
- hp->bucket_hdr = &hashtab[bucket];
- hp->next = hashtab[bucket];
- hashtab[bucket] = hp;
- hp->prev = NULL;
- if (hp->next != NULL)
- hp->next->prev = hp;
- hp->type = type;
- hp->length = len;
- hp->value.cpval = value;
- hp->name = ((U_CHAR *) hp) + sizeof (HASHNODE);
- p = hp->name;
- q = name;
- for (i = 0; i < len; i++)
- *p++ = *q++;
- hp->name[len] = 0;
- return hp;
-}
-
-/*
- * find the most recent hash node for name "name" (ending with first
- * non-identifier char) installed by install
- *
- * If LEN is >= 0, it is the length of the name.
- * Otherwise, compute the length by scanning the entire name.
- *
- * If HASH is >= 0, it is the precomputed hash code.
- * Otherwise, compute the hash code.
- */
-
-HASHNODE *
-lookup (name, len, hash)
- U_CHAR *name;
- int len;
- int hash;
-{
- register U_CHAR *bp;
- register HASHNODE *bucket;
-
- if (len < 0) {
- for (bp = name; is_idchar[*bp]; bp++) ;
- len = bp - name;
- }
-
- if (hash < 0)
- hash = hashf (name, len, HASHSIZE);
-
- bucket = hashtab[hash];
- while (bucket) {
- if (bucket->length == len && bcmp (bucket->name, name, len) == 0)
- return bucket;
- bucket = bucket->next;
- }
- return NULL;
-}
-
-/*
- * Delete a hash node. Some weirdness to free junk from macros.
- * More such weirdness will have to be added if you define more hash
- * types that need it.
- */
-
-/* Note that the DEFINITION of a macro is removed from the hash table
- but its storage is not freed. This would be a storage leak
- except that it is not reasonable to keep undefining and redefining
- large numbers of macros many times.
- In any case, this is necessary, because a macro can be #undef'd
- in the middle of reading the arguments to a call to it.
- If #undef freed the DEFINITION, that would crash. */
-
-static void
-delete_macro (hp)
- HASHNODE *hp;
-{
-
- if (hp->prev != NULL)
- hp->prev->next = hp->next;
- if (hp->next != NULL)
- hp->next->prev = hp->prev;
-
- /* Make sure that the bucket chain header that the deleted guy was
- on points to the right thing afterwards. */
- if (hp == *hp->bucket_hdr)
- *hp->bucket_hdr = hp->next;
-
-#if 0
- if (hp->type == T_MACRO) {
- DEFINITION *d = hp->value.defn;
- struct reflist *ap, *nextap;
-
- for (ap = d->pattern; ap != NULL; ap = nextap) {
- nextap = ap->next;
- free (ap);
- }
- free (d);
- }
-#endif
- free (hp);
-}
-
-/*
- * return hash function on name. must be compatible with the one
- * computed a step at a time, elsewhere
- */
-
-static int
-hashf (name, len, hashsize)
- register U_CHAR *name;
- register int len;
- int hashsize;
-{
- register int r = 0;
-
- while (len--)
- r = HASHSTEP (r, *name++);
-
- return MAKE_POS (r) % hashsize;
-}
-
-
-/* Dump the definition of a single macro HP to OF. */
-
-static void
-dump_single_macro (hp, of)
- register HASHNODE *hp;
- FILE *of;
-{
- register DEFINITION *defn = hp->value.defn;
- struct reflist *ap;
- int offset;
- int concat;
-
-
- /* Print the definition of the macro HP. */
-
- fprintf (of, "#define %s", hp->name);
-
- if (defn->nargs >= 0) {
- int i;
-
- fprintf (of, "(");
- for (i = 0; i < defn->nargs; i++) {
- dump_arg_n (defn, i, of);
- if (i + 1 < defn->nargs)
- fprintf (of, ", ");
- }
- fprintf (of, ")");
- }
-
- fprintf (of, " ");
-
- offset = 0;
- concat = 0;
- for (ap = defn->pattern; ap != NULL; ap = ap->next) {
- dump_defn_1 (defn->expansion, offset, ap->nchars, of);
- offset += ap->nchars;
- if (!traditional) {
- if (ap->nchars != 0)
- concat = 0;
- if (ap->stringify) {
- switch (ap->stringify) {
- case SHARP_TOKEN: fprintf (of, "#"); break;
- case WHITE_SHARP_TOKEN: fprintf (of, "# "); break;
- case PERCENT_COLON_TOKEN: fprintf (of, "%%:"); break;
- case WHITE_PERCENT_COLON_TOKEN: fprintf (of, "%%: "); break;
- default: abort ();
- }
- }
- if (ap->raw_before != 0) {
- if (concat) {
- switch (ap->raw_before) {
- case WHITE_SHARP_TOKEN:
- case WHITE_PERCENT_COLON_TOKEN:
- fprintf (of, " ");
- break;
- default:
- break;
- }
- } else {
- switch (ap->raw_before) {
- case SHARP_TOKEN: fprintf (of, "##"); break;
- case WHITE_SHARP_TOKEN: fprintf (of, "## "); break;
- case PERCENT_COLON_TOKEN: fprintf (of, "%%:%%:"); break;
- case WHITE_PERCENT_COLON_TOKEN: fprintf (of, "%%:%%: "); break;
- default: abort ();
- }
- }
- }
- concat = 0;
- }
- dump_arg_n (defn, ap->argno, of);
- if (!traditional && ap->raw_after != 0) {
- switch (ap->raw_after) {
- case SHARP_TOKEN: fprintf (of, "##"); break;
- case WHITE_SHARP_TOKEN: fprintf (of, " ##"); break;
- case PERCENT_COLON_TOKEN: fprintf (of, "%%:%%:"); break;
- case WHITE_PERCENT_COLON_TOKEN: fprintf (of, " %%:%%:"); break;
- default: abort ();
- }
- concat = 1;
- }
- }
- dump_defn_1 (defn->expansion, offset, defn->length - offset, of);
- fprintf (of, "\n");
-}
-
-/* Dump all macro definitions as #defines to stdout. */
-
-static void
-dump_all_macros ()
-{
- int bucket;
-
- for (bucket = 0; bucket < HASHSIZE; bucket++) {
- register HASHNODE *hp;
-
- for (hp = hashtab[bucket]; hp; hp= hp->next) {
- if (hp->type == T_MACRO)
- dump_single_macro (hp, stdout);
- }
- }
-}
-
-/* Output to OF a substring of a macro definition.
- BASE is the beginning of the definition.
- Output characters START thru LENGTH.
- Unless traditional, discard newlines outside of strings, thus
- converting funny-space markers to ordinary spaces. */
-
-static void
-dump_defn_1 (base, start, length, of)
- U_CHAR *base;
- int start;
- int length;
- FILE *of;
-{
- U_CHAR *p = base + start;
- U_CHAR *limit = base + start + length;
-
- if (traditional)
- fwrite (p, sizeof (*p), length, of);
- else {
- while (p < limit) {
- if (*p == '\"' || *p =='\'') {
- U_CHAR *p1 = skip_quoted_string (p, limit, 0, NULL_PTR,
- NULL_PTR, NULL_PTR);
- fwrite (p, sizeof (*p), p1 - p, of);
- p = p1;
- } else {
- if (*p != '\n')
- putc (*p, of);
- p++;
- }
- }
- }
-}
-
-/* Print the name of argument number ARGNUM of macro definition DEFN
- to OF.
- Recall that DEFN->args.argnames contains all the arg names
- concatenated in reverse order with comma-space in between. */
-
-static void
-dump_arg_n (defn, argnum, of)
- DEFINITION *defn;
- int argnum;
- FILE *of;
-{
- register U_CHAR *p = defn->args.argnames;
- while (argnum + 1 < defn->nargs) {
- p = (U_CHAR *) index ((char *) p, ' ') + 1;
- argnum++;
- }
-
- while (*p && *p != ',') {
- putc (*p, of);
- p++;
- }
-}
-
-/* Initialize syntactic classifications of characters. */
-
-static void
-initialize_char_syntax ()
-{
- register int i;
-
- /*
- * Set up is_idchar and is_idstart tables. These should be
- * faster than saying (is_alpha (c) || c == '_'), etc.
- * Set up these things before calling any routines tthat
- * refer to them.
- */
- for (i = 'a'; i <= 'z'; i++) {
- is_idchar[i - 'a' + 'A'] = 1;
- is_idchar[i] = 1;
- is_idstart[i - 'a' + 'A'] = 1;
- is_idstart[i] = 1;
- }
- for (i = '0'; i <= '9'; i++)
- is_idchar[i] = 1;
- is_idchar['_'] = 1;
- is_idstart['_'] = 1;
- is_idchar['$'] = 1;
- is_idstart['$'] = 1;
-
- /* horizontal space table */
- is_hor_space[' '] = 1;
- is_hor_space['\t'] = 1;
- is_hor_space['\v'] = 1;
- is_hor_space['\f'] = 1;
- is_hor_space['\r'] = 1;
-
- is_space[' '] = 1;
- is_space['\t'] = 1;
- is_space['\v'] = 1;
- is_space['\f'] = 1;
- is_space['\n'] = 1;
- is_space['\r'] = 1;
-}
-
-/* Initialize the built-in macros. */
-
-static void
-initialize_builtins (inp, outp)
- FILE_BUF *inp;
- FILE_BUF *outp;
-{
- install ((U_CHAR *) "__LINE__", -1, T_SPECLINE, NULL_PTR, -1);
- install ((U_CHAR *) "__DATE__", -1, T_DATE, NULL_PTR, -1);
- install ((U_CHAR *) "__FILE__", -1, T_FILE, NULL_PTR, -1);
- install ((U_CHAR *) "__BASE_FILE__", -1, T_BASE_FILE, NULL_PTR, -1);
- install ((U_CHAR *) "__INCLUDE_LEVEL__", -1, T_INCLUDE_LEVEL, NULL_PTR, -1);
- install ((U_CHAR *) "__VERSION__", -1, T_VERSION, NULL_PTR, -1);
-#ifndef NO_BUILTIN_SIZE_TYPE
- install ((U_CHAR *) "__SIZE_TYPE__", -1, T_SIZE_TYPE, NULL_PTR, -1);
-#endif
-#ifndef NO_BUILTIN_PTRDIFF_TYPE
- install ((U_CHAR *) "__PTRDIFF_TYPE__ ", -1, T_PTRDIFF_TYPE, NULL_PTR, -1);
-#endif
- install ((U_CHAR *) "__WCHAR_TYPE__", -1, T_WCHAR_TYPE, NULL_PTR, -1);
- install ((U_CHAR *) "__USER_LABEL_PREFIX__", -1, T_USER_LABEL_PREFIX_TYPE,
- NULL_PTR, -1);
- install ((U_CHAR *) "__REGISTER_PREFIX__", -1, T_REGISTER_PREFIX_TYPE,
- NULL_PTR, -1);
- install ((U_CHAR *) "__IMMEDIATE_PREFIX__", -1, T_IMMEDIATE_PREFIX_TYPE,
- NULL_PTR, -1);
- install ((U_CHAR *) "__TIME__", -1, T_TIME, NULL_PTR, -1);
- if (!traditional) {
- install ((U_CHAR *) "__STDC__", -1, T_CONST, "1", -1);
- install ((U_CHAR *) "__STDC_VERSION__", -1, T_CONST, "199409L", -1);
- }
-/* This is supplied using a -D by the compiler driver
- so that it is present only when truly compiling with GNU C. */
-/* install ((U_CHAR *) "__GNUC__", -1, T_CONST, "2", -1); */
- install ((U_CHAR *) "__HAVE_BUILTIN_SETJMP__", -1, T_CONST, "1", -1);
-
- if (debug_output)
- {
- char directive[2048];
- U_CHAR *udirective = (U_CHAR *) directive;
- register struct directive *dp = &directive_table[0];
- struct tm *timebuf = timestamp ();
-
- sprintf (directive, " __BASE_FILE__ \"%s\"\n",
- instack[0].nominal_fname);
- output_line_directive (inp, outp, 0, same_file);
- pass_thru_directive (udirective, &udirective[strlen (directive)],
- outp, dp);
-
- sprintf (directive, " __VERSION__ \"%s\"\n", version_string);
- output_line_directive (inp, outp, 0, same_file);
- pass_thru_directive (udirective, &udirective[strlen (directive)],
- outp, dp);
-
-#ifndef NO_BUILTIN_SIZE_TYPE
- sprintf (directive, " __SIZE_TYPE__ %s\n", SIZE_TYPE);
- output_line_directive (inp, outp, 0, same_file);
- pass_thru_directive (udirective, &udirective[strlen (directive)],
- outp, dp);
-#endif
-
-#ifndef NO_BUILTIN_PTRDIFF_TYPE
- sprintf (directive, " __PTRDIFF_TYPE__ %s\n", PTRDIFF_TYPE);
- output_line_directive (inp, outp, 0, same_file);
- pass_thru_directive (udirective, &udirective[strlen (directive)],
- outp, dp);
-#endif
-
- sprintf (directive, " __WCHAR_TYPE__ %s\n", wchar_type);
- output_line_directive (inp, outp, 0, same_file);
- pass_thru_directive (udirective, &udirective[strlen (directive)],
- outp, dp);
-
- sprintf (directive, " __DATE__ \"%s %2d %4d\"\n",
- monthnames[timebuf->tm_mon],
- timebuf->tm_mday, timebuf->tm_year + 1900);
- output_line_directive (inp, outp, 0, same_file);
- pass_thru_directive (udirective, &udirective[strlen (directive)],
- outp, dp);
-
- sprintf (directive, " __TIME__ \"%02d:%02d:%02d\"\n",
- timebuf->tm_hour, timebuf->tm_min, timebuf->tm_sec);
- output_line_directive (inp, outp, 0, same_file);
- pass_thru_directive (udirective, &udirective[strlen (directive)],
- outp, dp);
-
- if (!traditional)
- {
- sprintf (directive, " __STDC__ 1");
- output_line_directive (inp, outp, 0, same_file);
- pass_thru_directive (udirective, &udirective[strlen (directive)],
- outp, dp);
- }
- if (objc)
- {
- sprintf (directive, " __OBJC__ 1");
- output_line_directive (inp, outp, 0, same_file);
- pass_thru_directive (udirective, &udirective[strlen (directive)],
- outp, dp);
- }
- }
-}
-
-/*
- * process a given definition string, for initialization
- * If STR is just an identifier, define it with value 1.
- * If STR has anything after the identifier, then it should
- * be identifier=definition.
- */
-
-static void
-make_definition (str)
- char *str;
-{
- FILE_BUF *ip;
- struct directive *kt;
- U_CHAR *buf, *p;
-
- p = buf = (U_CHAR *) str;
- if (!is_idstart[*p]) {
- error ("malformed option `-D %s'", str);
- return;
- }
- while (is_idchar[*++p])
- ;
- if (*p == '(') {
- while (is_idchar[*++p] || *p == ',' || is_hor_space[*p])
- ;
- if (*p++ != ')')
- p = (U_CHAR *) str; /* Error */
- }
- if (*p == 0) {
- buf = (U_CHAR *) alloca (p - buf + 4);
- strcpy ((char *)buf, str);
- strcat ((char *)buf, " 1");
- } else if (*p != '=') {
- error ("malformed option `-D %s'", str);
- return;
- } else {
- U_CHAR *q;
- /* Copy the entire option so we can modify it. */
- buf = (U_CHAR *) alloca (2 * strlen (str) + 1);
- strncpy ((char *) buf, str, p - (U_CHAR *) str);
- /* Change the = to a space. */
- buf[p - (U_CHAR *) str] = ' ';
- /* Scan for any backslash-newline and remove it. */
- p++;
- q = &buf[p - (U_CHAR *) str];
- while (*p) {
- if (*p == '\"' || *p == '\'') {
- int unterminated = 0;
- U_CHAR *p1 = skip_quoted_string (p, p + strlen ((char *) p), 0,
- NULL_PTR, NULL_PTR, &unterminated);
- if (unterminated)
- return;
- while (p != p1)
- *q++ = *p++;
- } else if (*p == '\\' && p[1] == '\n')
- p += 2;
- /* Change newline chars into newline-markers. */
- else if (*p == '\n')
- {
- *q++ = '\n';
- *q++ = '\n';
- p++;
- }
- else
- *q++ = *p++;
- }
- *q = 0;
- }
-
- ip = &instack[++indepth];
- ip->nominal_fname = ip->fname = "*Initialization*";
- ip->nominal_fname_len = strlen (ip->nominal_fname);
-
- ip->buf = ip->bufp = buf;
- ip->length = strlen ((char *) buf);
- ip->lineno = 1;
- ip->macro = 0;
- ip->free_ptr = 0;
- ip->if_stack = if_stack;
- ip->system_header_p = 0;
-
- for (kt = directive_table; kt->type != T_DEFINE; kt++)
- ;
-
- /* Pass NULL instead of OP, since this is a "predefined" macro. */
- do_define (buf, buf + strlen ((char *) buf), NULL_PTR, kt);
- --indepth;
-}
-
-/* JF, this does the work for the -U option */
-
-static void
-make_undef (str, op)
- char *str;
- FILE_BUF *op;
-{
- FILE_BUF *ip;
- struct directive *kt;
-
- ip = &instack[++indepth];
- ip->nominal_fname = ip->fname = "*undef*";
- ip->nominal_fname_len = strlen (ip->nominal_fname);
-
- ip->buf = ip->bufp = (U_CHAR *) str;
- ip->length = strlen (str);
- ip->lineno = 1;
- ip->macro = 0;
- ip->free_ptr = 0;
- ip->if_stack = if_stack;
- ip->system_header_p = 0;
-
- for (kt = directive_table; kt->type != T_UNDEF; kt++)
- ;
-
- do_undef ((U_CHAR *) str, (U_CHAR *) str + strlen (str), op, kt);
- --indepth;
-}
-
-/* Process the string STR as if it appeared as the body of a #assert.
- OPTION is the option name for which STR was the argument. */
-
-static void
-make_assertion (option, str)
- const char *option;
- const char *str;
-{
- FILE_BUF *ip;
- struct directive *kt;
- U_CHAR *buf, *p, *q;
-
- /* Copy the entire option so we can modify it. */
- buf = (U_CHAR *) alloca (strlen (str) + 1);
- strcpy ((char *) buf, str);
- /* Scan for any backslash-newline and remove it. */
- p = q = buf;
- while (*p) {
- if (*p == '\\' && p[1] == '\n')
- p += 2;
- else
- *q++ = *p++;
- }
- *q = 0;
-
- p = buf;
- if (!is_idstart[*p]) {
- error ("malformed option `%s %s'", option, str);
- return;
- }
- while (is_idchar[*++p])
- ;
- SKIP_WHITE_SPACE (p);
- if (! (*p == 0 || *p == '(')) {
- error ("malformed option `%s %s'", option, str);
- return;
- }
-
- ip = &instack[++indepth];
- ip->nominal_fname = ip->fname = "*Initialization*";
- ip->nominal_fname_len = strlen (ip->nominal_fname);
-
- ip->buf = ip->bufp = buf;
- ip->length = strlen ((char *) buf);
- ip->lineno = 1;
- ip->macro = 0;
- ip->free_ptr = 0;
- ip->if_stack = if_stack;
- ip->system_header_p = 0;
-
- for (kt = directive_table; kt->type != T_ASSERT; kt++)
- ;
-
- /* Pass NULL as output ptr to do_define since we KNOW it never does
- any output.... */
- do_assert (buf, buf + strlen ((char *) buf) , NULL_PTR, kt);
- --indepth;
-}
-
-/* The previous include prefix, if any, is PREV_FILE_NAME.
- Translate any pathnames with COMPONENT.
- Allocate a new include prefix whose name is the
- simplified concatenation of PREFIX and NAME,
- with a trailing / added if needed.
- But return 0 if the include prefix should be ignored,
- e.g. because it is a duplicate of PREV_FILE_NAME. */
-
-static struct file_name_list *
-new_include_prefix (prev_file_name, component, prefix, name)
- struct file_name_list *prev_file_name;
- const char *component;
- const char *prefix;
- const char *name;
-{
- if (name == 0)
- fatal ("Directory name missing after command line option");
-
- if (*name == 0)
- /* Ignore the empty string. */
- return 0;
-
- prefix = update_path (prefix, component);
- name = update_path (name, component);
-
- {
- struct file_name_list *dir
- = ((struct file_name_list *)
- xmalloc (sizeof (struct file_name_list)
- + strlen (prefix) + strlen (name) + 2));
- size_t len;
- strcpy (dir->fname, prefix);
- strcat (dir->fname, name);
- len = simplify_filename (dir->fname);
-
- /* Convert directory name to a prefix. */
- if (len && dir->fname[len - 1] != DIR_SEPARATOR) {
- if (len == 1 && dir->fname[len - 1] == '.')
- len = 0;
- else
-#ifdef VMS
- /* must be '/', hack_vms_include_specification triggers on it. */
- dir->fname[len++] = '/';
-#else
- dir->fname[len++] = DIR_SEPARATOR;
-#endif
- dir->fname[len] = 0;
- }
-
- /* Ignore a directory whose name matches the previous one. */
- if (prev_file_name && !strcmp (prev_file_name->fname, dir->fname)) {
- /* But treat `-Idir -I- -Idir' as `-I- -Idir'. */
- if (!first_bracket_include)
- first_bracket_include = prev_file_name;
- free (dir);
- return 0;
- }
-
-#ifndef VMS
- /* VMS can't stat dir prefixes, so skip these optimizations in VMS. */
-
- /* Add a trailing "." if there is a filename. This increases the number
- of systems that can stat directories. We remove it below. */
- if (len != 0)
- {
- dir->fname[len] = '.';
- dir->fname[len + 1] = 0;
- }
-
- /* Ignore a nonexistent directory. */
- if (stat (len ? dir->fname : ".", &dir->st) != 0) {
- if (errno != ENOENT && errno != ENOTDIR)
- error_from_errno (dir->fname);
- free (dir);
- return 0;
- }
-
- if (len != 0)
- dir->fname[len] = 0;
-
- /* Ignore a directory whose identity matches the previous one. */
- if (prev_file_name
- && INO_T_EQ (prev_file_name->st.st_ino, dir->st.st_ino)
- && prev_file_name->st.st_dev == dir->st.st_dev) {
- /* But treat `-Idir -I- -Idir' as `-I- -Idir'. */
- if (!first_bracket_include)
- first_bracket_include = prev_file_name;
- free (dir);
- return 0;
- }
-#endif /* ! VMS */
-
- dir->next = 0;
- dir->c_system_include_path = 0;
- dir->got_name_map = 0;
-
- return dir;
- }
-}
-
-/* Append a chain of `struct file_name_list's
- to the end of the main include chain.
- FIRST is the beginning of the chain to append, and LAST is the end. */
-
-static void
-append_include_chain (first, last)
- struct file_name_list *first, *last;
-{
- struct file_name_list *dir;
-
- if (!first || !last)
- return;
-
- if (include == 0)
- include = first;
- else
- last_include->next = first;
-
- if (first_bracket_include == 0)
- first_bracket_include = first;
-
- for (dir = first; ; dir = dir->next) {
- int len = strlen (dir->fname) + INCLUDE_LEN_FUDGE;
- if (len > max_include_len)
- max_include_len = len;
- if (dir == last)
- break;
- }
-
- last->next = NULL;
- last_include = last;
-}
-
-/* Place into DST a representation of the file named SRC that is suitable
- for `make'. Do not null-terminate DST. Return its length. */
-static int
-quote_string_for_make (dst, src)
- char *dst;
- const char *src;
-{
- const char *p = src;
- int i = 0;
- for (;;)
- {
- char c = *p++;
- switch (c)
- {
- case '\0':
- case ' ':
- case '\t':
- {
- /* GNU make uses a weird quoting scheme for white space.
- A space or tab preceded by 2N+1 backslashes represents
- N backslashes followed by space; a space or tab
- preceded by 2N backslashes represents N backslashes at
- the end of a file name; and backslashes in other
- contexts should not be doubled. */
- const char *q;
- for (q = p - 1; src < q && q[-1] == '\\'; q--)
- {
- if (dst)
- dst[i] = '\\';
- i++;
- }
- }
- if (!c)
- return i;
- if (dst)
- dst[i] = '\\';
- i++;
- goto ordinary_char;
-
- case '$':
- if (dst)
- dst[i] = c;
- i++;
- /* Fall through. This can mishandle things like "$(" but
- there's no easy fix. */
- default:
- ordinary_char:
- /* This can mishandle characters in the string "\0\n%*?[\\~";
- exactly which chars are mishandled depends on the `make' version.
- We know of no portable solution for this;
- even GNU make 3.76.1 doesn't solve the problem entirely.
- (Also, '\0' is mishandled due to our calling conventions.) */
- if (dst)
- dst[i] = c;
- i++;
- break;
- }
- }
-}
-
-
-/* Add output to `deps_buffer' for the -M switch.
- STRING points to the text to be output.
- SPACER is ':' for targets, ' ' for dependencies. */
-
-static void
-deps_output (string, spacer)
- const char *string;
- int spacer;
-{
- int size = quote_string_for_make ((char *) 0, string);
-
- if (size == 0)
- return;
-
-#ifndef MAX_OUTPUT_COLUMNS
-#define MAX_OUTPUT_COLUMNS 72
-#endif
- if (MAX_OUTPUT_COLUMNS - 1 /*spacer*/ - 2 /*` \'*/ < deps_column + size
- && 1 < deps_column) {
- bcopy (" \\\n ", &deps_buffer[deps_size], 4);
- deps_size += 4;
- deps_column = 1;
- if (spacer == ' ')
- spacer = 0;
- }
-
- if (deps_size + 2 * size + 8 > deps_allocated_size) {
- deps_allocated_size = (deps_size + 2 * size + 50) * 2;
- deps_buffer = xrealloc (deps_buffer, deps_allocated_size);
- }
- if (spacer == ' ') {
- deps_buffer[deps_size++] = ' ';
- deps_column++;
- }
- quote_string_for_make (&deps_buffer[deps_size], string);
- deps_size += size;
- deps_column += size;
- if (spacer == ':') {
- deps_buffer[deps_size++] = ':';
- deps_column++;
- }
- deps_buffer[deps_size] = 0;
-}
-
-void
-fatal VPROTO ((const char * msgid, ...))
-{
-#ifndef ANSI_PROTOTYPES
- const char * msgid;
-#endif
- va_list args;
-
- fprintf (stderr, "%s: ", progname);
- VA_START (args, msgid);
-
-#ifndef ANSI_PROTOTYPES
- msgid = va_arg (args, const char *);
-#endif
- vnotice (msgid, args);
- va_end (args);
- fprintf (stderr, "\n");
- exit (FATAL_EXIT_CODE);
-}
-
-/* More 'friendly' abort that prints the line and file.
- config.h can #define abort fancy_abort if you like that sort of thing. */
-
-void
-fancy_abort ()
-{
- fatal ("Internal gcc abort.");
-}
-
-static void
-perror_with_name (name)
- char *name;
-{
- fprintf (stderr, "%s: %s: %s\n", progname, name, my_strerror (errno));
- errors++;
-}
-
-static void
-pfatal_with_name (name)
- char *name;
-{
- perror_with_name (name);
-#ifdef VMS
- exit (vaxc$errno);
-#else
- exit (FATAL_EXIT_CODE);
-#endif
-}
-
-/* Handler for SIGPIPE. */
-
-static void
-pipe_closed (signo)
- /* If this is missing, some compilers complain. */
- int signo ATTRIBUTE_UNUSED;
-{
- fatal ("output pipe has been closed");
-}
-
-static void
-memory_full ()
-{
- fatal ("Memory exhausted.");
-}
-
-PTR
-xmalloc (size)
- size_t size;
-{
- register PTR ptr = (PTR) malloc (size);
- if (!ptr)
- memory_full ();
- return ptr;
-}
-
-PTR
-xrealloc (old, size)
- PTR old;
- size_t size;
-{
- register PTR ptr;
- if (old)
- ptr = (PTR) realloc (old, size);
- else
- ptr = (PTR) malloc (size);
- if (!ptr)
- memory_full ();
- return ptr;
-}
-
-PTR
-xcalloc (number, size)
- size_t number, size;
-{
- register size_t total = number * size;
- register PTR ptr = (PTR) malloc (total);
- if (!ptr)
- memory_full ();
- bzero (ptr, total);
- return ptr;
-}
-
-char *
-xstrdup (input)
- const char *input;
-{
- register size_t len = strlen (input) + 1;
- register char *output = xmalloc (len);
- memcpy (output, input, len);
- return output;
-}
-
-#ifdef VMS
-
-/* Under VMS we need to fix up the "include" specification filename.
-
- Rules for possible conversions
-
- fullname tried paths
-
- name name
- ./dir/name [.dir]name
- /dir/name dir:name
- /name [000000]name, name
- dir/name dir:[000000]name, dir:name, dir/name
- dir1/dir2/name dir1:[dir2]name, dir1:[000000.dir2]name
- path:/name path:[000000]name, path:name
- path:/dir/name path:[000000.dir]name, path:[dir]name
- path:dir/name path:[dir]name
- [path]:[dir]name [path.dir]name
- path/[dir]name [path.dir]name
-
- The path:/name input is constructed when expanding <> includes.
-
- return 1 if name was changed, 0 else. */
-
-static int
-hack_vms_include_specification (fullname, vaxc_include)
- char *fullname;
- int vaxc_include;
-{
- register char *basename, *unixname, *local_ptr, *first_slash;
- int f, check_filename_before_returning, must_revert;
- char Local[512];
-
- check_filename_before_returning = 0;
- must_revert = 0;
- /* See if we can find a 1st slash. If not, there's no path information. */
- first_slash = index (fullname, '/');
- if (first_slash == 0)
- return 0; /* Nothing to do!!! */
-
- /* construct device spec if none given. */
-
- if (index (fullname, ':') == 0)
- {
-
- /* If fullname has a slash, take it as device spec. */
-
- if (first_slash == fullname)
- {
- first_slash = index (fullname+1, '/'); /* 2nd slash ? */
- if (first_slash)
- *first_slash = ':'; /* make device spec */
- for (basename = fullname; *basename != 0; basename++)
- *basename = *(basename+1); /* remove leading slash */
- }
- else if ((first_slash[-1] != '.') /* keep ':/', './' */
- && (first_slash[-1] != ':')
- && (first_slash[-1] != ']')) /* or a vms path */
- {
- *first_slash = ':';
- }
- else if ((first_slash[1] == '[') /* skip './' in './[dir' */
- && (first_slash[-1] == '.'))
- fullname += 2;
- }
-
- /* Get part after first ':' (basename[-1] == ':')
- or last '/' (basename[-1] == '/'). */
-
- basename = base_name (fullname);
-
- /*
- * Check if we have a vax-c style '#include filename'
- * and add the missing .h
- */
-
- if (vaxc_include && !index (basename,'.'))
- strcat (basename, ".h");
-
- local_ptr = Local; /* initialize */
-
- /* We are trying to do a number of things here. First of all, we are
- trying to hammer the filenames into a standard format, such that later
- processing can handle them.
-
- If the file name contains something like [dir.], then it recognizes this
- as a root, and strips the ".]". Later processing will add whatever is
- needed to get things working properly.
-
- If no device is specified, then the first directory name is taken to be
- a device name (or a rooted logical). */
-
- /* Point to the UNIX filename part (which needs to be fixed!)
- but skip vms path information.
- [basename != fullname since first_slash != 0]. */
-
- if ((basename[-1] == ':') /* vms path spec. */
- || (basename[-1] == ']')
- || (basename[-1] == '>'))
- unixname = basename;
- else
- unixname = fullname;
-
- if (*unixname == '/')
- unixname++;
-
- /* If the directory spec is not rooted, we can just copy
- the UNIX filename part and we are done. */
-
- if (((basename - fullname) > 1)
- && ( (basename[-1] == ']')
- || (basename[-1] == '>')))
- {
- if (basename[-2] != '.')
- {
-
- /* The VMS part ends in a `]', and the preceding character is not a `.'.
- -> PATH]:/name (basename = '/name', unixname = 'name')
- We strip the `]', and then splice the two parts of the name in the
- usual way. Given the default locations for include files in cccp.c,
- we will only use this code if the user specifies alternate locations
- with the /include (-I) switch on the command line. */
-
- basename -= 1; /* Strip "]" */
- unixname--; /* backspace */
- }
- else
- {
-
- /* The VMS part has a ".]" at the end, and this will not do. Later
- processing will add a second directory spec, and this would be a syntax
- error. Thus we strip the ".]", and thus merge the directory specs.
- We also backspace unixname, so that it points to a '/'. This inhibits the
- generation of the 000000 root directory spec (which does not belong here
- in this case). */
-
- basename -= 2; /* Strip ".]" */
- unixname--; /* backspace */
- }
- }
-
- else
-
- {
-
- /* We drop in here if there is no VMS style directory specification yet.
- If there is no device specification either, we make the first dir a
- device and try that. If we do not do this, then we will be essentially
- searching the users default directory (as if they did a #include "asdf.h").
-
- Then all we need to do is to push a '[' into the output string. Later
- processing will fill this in, and close the bracket. */
-
- if ((unixname != fullname) /* vms path spec found. */
- && (basename[-1] != ':'))
- *local_ptr++ = ':'; /* dev not in spec. take first dir */
-
- *local_ptr++ = '['; /* Open the directory specification */
- }
-
- if (unixname == fullname) /* no vms dir spec. */
- {
- must_revert = 1;
- if ((first_slash != 0) /* unix dir spec. */
- && (*unixname != '/') /* not beginning with '/' */
- && (*unixname != '.')) /* or './' or '../' */
- *local_ptr++ = '.'; /* dir is local ! */
- }
-
- /* at this point we assume that we have the device spec, and (at least
- the opening "[" for a directory specification. We may have directories
- specified already.
-
- If there are no other slashes then the filename will be
- in the "root" directory. Otherwise, we need to add
- directory specifications. */
-
- if (index (unixname, '/') == 0)
- {
- /* if no directories specified yet and none are following. */
- if (local_ptr[-1] == '[')
- {
- /* Just add "000000]" as the directory string */
- strcpy (local_ptr, "000000]");
- local_ptr += strlen (local_ptr);
- check_filename_before_returning = 1; /* we might need to fool with this later */
- }
- }
- else
- {
-
- /* As long as there are still subdirectories to add, do them. */
- while (index (unixname, '/') != 0)
- {
- /* If this token is "." we can ignore it
- if it's not at the beginning of a path. */
- if ((unixname[0] == '.') && (unixname[1] == '/'))
- {
- /* remove it at beginning of path. */
- if ( ((unixname == fullname) /* no device spec */
- && (fullname+2 != basename)) /* starts with ./ */
- /* or */
- || ((basename[-1] == ':') /* device spec */
- && (unixname-1 == basename))) /* and ./ afterwards */
- *local_ptr++ = '.'; /* make '[.' start of path. */
- unixname += 2;
- continue;
- }
-
- /* Add a subdirectory spec. Do not duplicate "." */
- if ( local_ptr[-1] != '.'
- && local_ptr[-1] != '['
- && local_ptr[-1] != '<')
- *local_ptr++ = '.';
-
- /* If this is ".." then the spec becomes "-" */
- if ( (unixname[0] == '.')
- && (unixname[1] == '.')
- && (unixname[2] == '/'))
- {
- /* Add "-" and skip the ".." */
- if ((local_ptr[-1] == '.')
- && (local_ptr[-2] == '['))
- local_ptr--; /* prevent [.- */
- *local_ptr++ = '-';
- unixname += 3;
- continue;
- }
-
- /* Copy the subdirectory */
- while (*unixname != '/')
- *local_ptr++= *unixname++;
-
- unixname++; /* Skip the "/" */
- }
-
- /* Close the directory specification */
- if (local_ptr[-1] == '.') /* no trailing periods */
- local_ptr--;
-
- if (local_ptr[-1] == '[') /* no dir needed */
- local_ptr--;
- else
- *local_ptr++ = ']';
- }
-
- /* Now add the filename. */
-
- while (*unixname)
- *local_ptr++ = *unixname++;
- *local_ptr = 0;
-
- /* Now append it to the original VMS spec. */
-
- strcpy ((must_revert==1)?fullname:basename, Local);
-
- /* If we put a [000000] in the filename, try to open it first. If this fails,
- remove the [000000], and return that name. This provides flexibility
- to the user in that they can use both rooted and non-rooted logical names
- to point to the location of the file. */
-
- if (check_filename_before_returning)
- {
- f = open (fullname, O_RDONLY, 0666);
- if (f >= 0)
- {
- /* The file name is OK as it is, so return it as is. */
- close (f);
- return 1;
- }
-
- /* The filename did not work. Try to remove the [000000] from the name,
- and return it. */
-
- basename = index (fullname, '[');
- local_ptr = index (fullname, ']') + 1;
- strcpy (basename, local_ptr); /* this gets rid of it */
-
- }
-
- return 1;
-}
-#endif /* VMS */
-
-#ifdef VMS
-
-/* The following wrapper functions supply additional arguments to the VMS
- I/O routines to optimize performance with file handling. The arguments
- are:
- "mbc=16" - Set multi-block count to 16 (use a 8192 byte buffer).
- "deq=64" - When extending the file, extend it in chunks of 32Kbytes.
- "fop=tef"- Truncate unused portions of file when closing file.
- "shr=nil"- Disallow file sharing while file is open. */
-
-static FILE *
-VMS_freopen (fname, type, oldfile)
- char *fname;
- char *type;
- FILE *oldfile;
-{
-#undef freopen /* Get back the real freopen routine. */
- if (strcmp (type, "w") == 0)
- return freopen (fname, type, oldfile,
- "mbc=16", "deq=64", "fop=tef", "shr=nil");
- return freopen (fname, type, oldfile, "mbc=16");
-}
-
-static FILE *
-VMS_fopen (fname, type)
- char *fname;
- char *type;
-{
-#undef fopen /* Get back the real fopen routine. */
- /* The gcc-vms-1.42 distribution's header files prototype fopen with two
- fixed arguments, which matches ANSI's specification but not VAXCRTL's
- pre-ANSI implementation. This hack circumvents the mismatch problem. */
- FILE *(*vmslib_fopen)() = (FILE *(*)()) fopen;
-
- if (*type == 'w')
- return (*vmslib_fopen) (fname, type, "mbc=32",
- "deq=64", "fop=tef", "shr=nil");
- else
- return (*vmslib_fopen) (fname, type, "mbc=32");
-}
-
-static int
-VMS_open (fname, flags, prot)
- char *fname;
- int flags;
- int prot;
-{
-#undef open /* Get back the real open routine. */
- return open (fname, flags, prot, "mbc=16", "deq=64", "fop=tef");
-}
-
-/* more VMS hackery */
-#include <fab.h>
-#include <nam.h>
-
-extern unsigned long SYS$PARSE(), SYS$SEARCH();
-
-/* Work around another library bug. If a file is located via a searchlist,
- and if the device it's on is not the same device as the one specified
- in the first element of that searchlist, then both stat() and fstat()
- will fail to return info about it. `errno' will be set to EVMSERR, and
- `vaxc$errno' will be set to SS$_NORMAL due yet another bug in stat()!
- We can get around this by fully parsing the filename and then passing
- that absolute name to stat().
-
- Without this fix, we can end up failing to find header files, which is
- bad enough, but then compounding the problem by reporting the reason for
- failure as "normal successful completion." */
-
-#undef fstat /* Get back to the library version. */
-
-static int
-VMS_fstat (fd, statbuf)
- int fd;
- struct stat *statbuf;
-{
- int result = fstat (fd, statbuf);
-
- if (result < 0)
- {
- FILE *fp;
- char nambuf[NAM$C_MAXRSS+1];
-
- if ((fp = fdopen (fd, "r")) != 0 && fgetname (fp, nambuf) != 0)
- result = VMS_stat (nambuf, statbuf);
- /* No fclose(fp) here; that would close(fd) as well. */
- }
-
- return result;
-}
-
-static int
-VMS_stat (name, statbuf)
- const char *name;
- struct stat *statbuf;
-{
- int result = stat (name, statbuf);
-
- if (result < 0)
- {
- struct FAB fab;
- struct NAM nam;
- char exp_nam[NAM$C_MAXRSS+1], /* expanded name buffer for SYS$PARSE */
- res_nam[NAM$C_MAXRSS+1]; /* resultant name buffer for SYS$SEARCH */
-
- fab = cc$rms_fab;
- fab.fab$l_fna = (char *) name;
- fab.fab$b_fns = (unsigned char) strlen (name);
- fab.fab$l_nam = (void *) &nam;
- nam = cc$rms_nam;
- nam.nam$l_esa = exp_nam, nam.nam$b_ess = sizeof exp_nam - 1;
- nam.nam$l_rsa = res_nam, nam.nam$b_rss = sizeof res_nam - 1;
- nam.nam$b_nop = NAM$M_PWD | NAM$M_NOCONCEAL;
- if (SYS$PARSE (&fab) & 1)
- {
- if (SYS$SEARCH (&fab) & 1)
- {
- res_nam[nam.nam$b_rsl] = '\0';
- result = stat (res_nam, statbuf);
- }
- /* Clean up searchlist context cached by the system. */
- nam.nam$b_nop = NAM$M_SYNCHK;
- fab.fab$l_fna = 0, fab.fab$b_fns = 0;
- (void) SYS$PARSE (&fab);
- }
- }
-
- return result;
-}
-#endif /* VMS */
diff --git a/contrib/gcc/cexp.y b/contrib/gcc/cexp.y
deleted file mode 100644
index 9364ac3a8a03..000000000000
--- a/contrib/gcc/cexp.y
+++ /dev/null
@@ -1,1222 +0,0 @@
-/* Parse C expressions for CCCP.
- Copyright (C) 1987, 92, 94-98, 1999 Free Software Foundation.
-
-This program 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 program 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 program; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.
-
- In other words, you are welcome to use, share and improve this program.
- You are forbidden to forbid anyone else to use, share and improve
- what you give them. Help stamp out software-hoarding!
-
- Adapted from expread.y of GDB by Paul Rubin, July 1986. */
-
-/* Parse a C expression from text in a string */
-
-%{
-#include "config.h"
-
-#include "system.h"
-#include "intl.h"
-#include <setjmp.h>
-/* #define YYDEBUG 1 */
-
-#ifdef MULTIBYTE_CHARS
-#include "mbchar.h"
-#include <locale.h>
-#endif /* MULTIBYTE_CHARS */
-
-typedef unsigned char U_CHAR;
-
-/* This is used for communicating lists of keywords with cccp.c. */
-struct arglist {
- struct arglist *next;
- U_CHAR *name;
- int length;
- int argno;
-};
-
-HOST_WIDEST_INT parse_c_expression PROTO((char *, int));
-
-static int yylex PROTO((void));
-static void yyerror PVPROTO((const char *, ...))
- ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN;
-static HOST_WIDEST_INT expression_value;
-#ifdef TEST_EXP_READER
-static int expression_signedp;
-#endif
-
-static jmp_buf parse_return_error;
-
-/* Nonzero means count most punctuation as part of a name. */
-static int keyword_parsing = 0;
-
-/* Nonzero means do not evaluate this expression.
- This is a count, since unevaluated expressions can nest. */
-static int skip_evaluation;
-
-/* Nonzero means warn if undefined identifiers are evaluated. */
-static int warn_undef;
-
-/* some external tables of character types */
-extern unsigned char is_idstart[], is_idchar[], is_space[];
-
-/* Flag for -pedantic. */
-extern int pedantic;
-
-/* Flag for -traditional. */
-extern int traditional;
-
-/* Flag for -lang-c89. */
-extern int c89;
-
-#ifndef CHAR_TYPE_SIZE
-#define CHAR_TYPE_SIZE BITS_PER_UNIT
-#endif
-
-#ifndef INT_TYPE_SIZE
-#define INT_TYPE_SIZE BITS_PER_WORD
-#endif
-
-#ifndef LONG_TYPE_SIZE
-#define LONG_TYPE_SIZE BITS_PER_WORD
-#endif
-
-#ifndef WCHAR_TYPE_SIZE
-#define WCHAR_TYPE_SIZE INT_TYPE_SIZE
-#endif
-
-#ifndef MAX_CHAR_TYPE_SIZE
-#define MAX_CHAR_TYPE_SIZE CHAR_TYPE_SIZE
-#endif
-
-#ifndef MAX_INT_TYPE_SIZE
-#define MAX_INT_TYPE_SIZE INT_TYPE_SIZE
-#endif
-
-#ifndef MAX_LONG_TYPE_SIZE
-#define MAX_LONG_TYPE_SIZE LONG_TYPE_SIZE
-#endif
-
-#ifndef MAX_WCHAR_TYPE_SIZE
-#define MAX_WCHAR_TYPE_SIZE WCHAR_TYPE_SIZE
-#endif
-
-#define MAX_CHAR_TYPE_MASK (MAX_CHAR_TYPE_SIZE < HOST_BITS_PER_WIDEST_INT \
- ? (~ (~ (HOST_WIDEST_INT) 0 << MAX_CHAR_TYPE_SIZE)) \
- : ~ (HOST_WIDEST_INT) 0)
-
-#define MAX_WCHAR_TYPE_MASK (MAX_WCHAR_TYPE_SIZE < HOST_BITS_PER_WIDEST_INT \
- ? ~ (~ (HOST_WIDEST_INT) 0 << MAX_WCHAR_TYPE_SIZE) \
- : ~ (HOST_WIDEST_INT) 0)
-
-/* Suppose A1 + B1 = SUM1, using 2's complement arithmetic ignoring overflow.
- Suppose A, B and SUM have the same respective signs as A1, B1, and SUM1.
- Suppose SIGNEDP is negative if the result is signed, zero if unsigned.
- Then this yields nonzero if overflow occurred during the addition.
- Overflow occurs if A and B have the same sign, but A and SUM differ in sign,
- and SIGNEDP is negative.
- Use `^' to test whether signs differ, and `< 0' to isolate the sign. */
-#define overflow_sum_sign(a, b, sum, signedp) \
- ((~((a) ^ (b)) & ((a) ^ (sum)) & (signedp)) < 0)
-
-struct constant;
-
-HOST_WIDEST_INT parse_escape PROTO((char **, HOST_WIDEST_INT));
-int check_assertion PROTO((U_CHAR *, int, int, struct arglist *));
-struct hashnode *lookup PROTO((U_CHAR *, int, int));
-void error PVPROTO((const char *, ...)) ATTRIBUTE_PRINTF_1;
-void verror PROTO((const char *, va_list));
-void pedwarn PVPROTO((const char *, ...)) ATTRIBUTE_PRINTF_1;
-void warning PVPROTO((const char *, ...)) ATTRIBUTE_PRINTF_1;
-
-static int parse_number PROTO((int));
-static HOST_WIDEST_INT left_shift PROTO((struct constant *, unsigned HOST_WIDEST_INT));
-static HOST_WIDEST_INT right_shift PROTO((struct constant *, unsigned HOST_WIDEST_INT));
-static void integer_overflow PROTO((void));
-
-/* `signedp' values */
-#define SIGNED (~0)
-#define UNSIGNED 0
-%}
-
-%union {
- struct constant {HOST_WIDEST_INT value; int signedp;} integer;
- struct name {U_CHAR *address; int length;} name;
- struct arglist *keywords;
-}
-
-%type <integer> exp exp1 start
-%type <keywords> keywords
-%token <integer> INT CHAR
-%token <name> NAME
-%token <integer> ERROR
-
-%right '?' ':'
-%left ','
-%left OR
-%left AND
-%left '|'
-%left '^'
-%left '&'
-%left EQUAL NOTEQUAL
-%left '<' '>' LEQ GEQ
-%left LSH RSH
-%left '+' '-'
-%left '*' '/' '%'
-%right UNARY
-
-/* %expect 40 */
-
-%%
-
-start : exp1
- {
- expression_value = $1.value;
-#ifdef TEST_EXP_READER
- expression_signedp = $1.signedp;
-#endif
- }
- ;
-
-/* Expressions, including the comma operator. */
-exp1 : exp
- | exp1 ',' exp
- { if (pedantic)
- pedwarn ("comma operator in operand of `#if'");
- $$ = $3; }
- ;
-
-/* Expressions, not including the comma operator. */
-exp : '-' exp %prec UNARY
- { $$.value = - $2.value;
- $$.signedp = $2.signedp;
- if (($$.value & $2.value & $$.signedp) < 0)
- integer_overflow (); }
- | '!' exp %prec UNARY
- { $$.value = ! $2.value;
- $$.signedp = SIGNED; }
- | '+' exp %prec UNARY
- { $$ = $2; }
- | '~' exp %prec UNARY
- { $$.value = ~ $2.value;
- $$.signedp = $2.signedp; }
- | '#' NAME
- { $$.value = check_assertion ($2.address, $2.length,
- 0, NULL_PTR);
- $$.signedp = SIGNED; }
- | '#' NAME
- { keyword_parsing = 1; }
- '(' keywords ')'
- { $$.value = check_assertion ($2.address, $2.length,
- 1, $5);
- keyword_parsing = 0;
- $$.signedp = SIGNED; }
- | '(' exp1 ')'
- { $$ = $2; }
- ;
-
-/* Binary operators in order of decreasing precedence. */
-exp : exp '*' exp
- { $$.signedp = $1.signedp & $3.signedp;
- if ($$.signedp)
- {
- $$.value = $1.value * $3.value;
- if ($1.value
- && ($$.value / $1.value != $3.value
- || ($$.value & $1.value & $3.value) < 0))
- integer_overflow ();
- }
- else
- $$.value = ((unsigned HOST_WIDEST_INT) $1.value
- * $3.value); }
- | exp '/' exp
- { if ($3.value == 0)
- {
- if (!skip_evaluation)
- error ("division by zero in #if");
- $3.value = 1;
- }
- $$.signedp = $1.signedp & $3.signedp;
- if ($$.signedp)
- {
- $$.value = $1.value / $3.value;
- if (($$.value & $1.value & $3.value) < 0)
- integer_overflow ();
- }
- else
- $$.value = ((unsigned HOST_WIDEST_INT) $1.value
- / $3.value); }
- | exp '%' exp
- { if ($3.value == 0)
- {
- if (!skip_evaluation)
- error ("division by zero in #if");
- $3.value = 1;
- }
- $$.signedp = $1.signedp & $3.signedp;
- if ($$.signedp)
- $$.value = $1.value % $3.value;
- else
- $$.value = ((unsigned HOST_WIDEST_INT) $1.value
- % $3.value); }
- | exp '+' exp
- { $$.value = $1.value + $3.value;
- $$.signedp = $1.signedp & $3.signedp;
- if (overflow_sum_sign ($1.value, $3.value,
- $$.value, $$.signedp))
- integer_overflow (); }
- | exp '-' exp
- { $$.value = $1.value - $3.value;
- $$.signedp = $1.signedp & $3.signedp;
- if (overflow_sum_sign ($$.value, $3.value,
- $1.value, $$.signedp))
- integer_overflow (); }
- | exp LSH exp
- { $$.signedp = $1.signedp;
- if (($3.value & $3.signedp) < 0)
- $$.value = right_shift (&$1, -$3.value);
- else
- $$.value = left_shift (&$1, $3.value); }
- | exp RSH exp
- { $$.signedp = $1.signedp;
- if (($3.value & $3.signedp) < 0)
- $$.value = left_shift (&$1, -$3.value);
- else
- $$.value = right_shift (&$1, $3.value); }
- | exp EQUAL exp
- { $$.value = ($1.value == $3.value);
- $$.signedp = SIGNED; }
- | exp NOTEQUAL exp
- { $$.value = ($1.value != $3.value);
- $$.signedp = SIGNED; }
- | exp LEQ exp
- { $$.signedp = SIGNED;
- if ($1.signedp & $3.signedp)
- $$.value = $1.value <= $3.value;
- else
- $$.value = ((unsigned HOST_WIDEST_INT) $1.value
- <= $3.value); }
- | exp GEQ exp
- { $$.signedp = SIGNED;
- if ($1.signedp & $3.signedp)
- $$.value = $1.value >= $3.value;
- else
- $$.value = ((unsigned HOST_WIDEST_INT) $1.value
- >= $3.value); }
- | exp '<' exp
- { $$.signedp = SIGNED;
- if ($1.signedp & $3.signedp)
- $$.value = $1.value < $3.value;
- else
- $$.value = ((unsigned HOST_WIDEST_INT) $1.value
- < $3.value); }
- | exp '>' exp
- { $$.signedp = SIGNED;
- if ($1.signedp & $3.signedp)
- $$.value = $1.value > $3.value;
- else
- $$.value = ((unsigned HOST_WIDEST_INT) $1.value
- > $3.value); }
- | exp '&' exp
- { $$.value = $1.value & $3.value;
- $$.signedp = $1.signedp & $3.signedp; }
- | exp '^' exp
- { $$.value = $1.value ^ $3.value;
- $$.signedp = $1.signedp & $3.signedp; }
- | exp '|' exp
- { $$.value = $1.value | $3.value;
- $$.signedp = $1.signedp & $3.signedp; }
- | exp AND
- { skip_evaluation += !$1.value; }
- exp
- { skip_evaluation -= !$1.value;
- $$.value = ($1.value && $4.value);
- $$.signedp = SIGNED; }
- | exp OR
- { skip_evaluation += !!$1.value; }
- exp
- { skip_evaluation -= !!$1.value;
- $$.value = ($1.value || $4.value);
- $$.signedp = SIGNED; }
- | exp '?'
- { skip_evaluation += !$1.value; }
- exp ':'
- { skip_evaluation += !!$1.value - !$1.value; }
- exp
- { skip_evaluation -= !!$1.value;
- $$.value = $1.value ? $4.value : $7.value;
- $$.signedp = $4.signedp & $7.signedp; }
- | INT
- { $$ = yylval.integer; }
- | CHAR
- { $$ = yylval.integer; }
- | NAME
- { if (warn_undef && !skip_evaluation)
- warning ("`%.*s' is not defined",
- $1.length, $1.address);
- $$.value = 0;
- $$.signedp = SIGNED; }
- ;
-
-keywords :
- { $$ = 0; }
- | '(' keywords ')' keywords
- { struct arglist *temp;
- $$ = (struct arglist *) xmalloc (sizeof (struct arglist));
- $$->next = $2;
- $$->name = (U_CHAR *) "(";
- $$->length = 1;
- temp = $$;
- while (temp != 0 && temp->next != 0)
- temp = temp->next;
- temp->next = (struct arglist *) xmalloc (sizeof (struct arglist));
- temp->next->next = $4;
- temp->next->name = (U_CHAR *) ")";
- temp->next->length = 1; }
- | NAME keywords
- { $$ = (struct arglist *) xmalloc (sizeof (struct arglist));
- $$->name = $1.address;
- $$->length = $1.length;
- $$->next = $2; }
- ;
-%%
-
-/* During parsing of a C expression, the pointer to the next character
- is in this variable. */
-
-static char *lexptr;
-
-/* Take care of parsing a number (anything that starts with a digit).
- Set yylval and return the token type; update lexptr.
- LEN is the number of characters in it. */
-
-/* maybe needs to actually deal with floating point numbers */
-
-static int
-parse_number (olen)
- int olen;
-{
- register char *p = lexptr;
- register int c;
- register unsigned HOST_WIDEST_INT n = 0, nd, max_over_base;
- register int base = 10;
- register int len = olen;
- register int overflow = 0;
- register int digit, largest_digit = 0;
- int spec_long = 0;
-
- yylval.integer.signedp = SIGNED;
-
- if (*p == '0') {
- base = 8;
- if (len >= 3 && (p[1] == 'x' || p[1] == 'X')) {
- p += 2;
- base = 16;
- len -= 2;
- }
- }
-
- max_over_base = (unsigned HOST_WIDEST_INT) -1 / base;
-
- for (; len > 0; len--) {
- c = *p++;
-
- if (c >= '0' && c <= '9')
- digit = c - '0';
- else if (base == 16 && c >= 'a' && c <= 'f')
- digit = c - 'a' + 10;
- else if (base == 16 && c >= 'A' && c <= 'F')
- digit = c - 'A' + 10;
- else {
- /* `l' means long, and `u' means unsigned. */
- while (1) {
- if (c == 'l' || c == 'L')
- {
- if (!pedantic < spec_long)
- yyerror ("too many `l's in integer constant");
- spec_long++;
- }
- else if (c == 'u' || c == 'U')
- {
- if (! yylval.integer.signedp)
- yyerror ("two `u's in integer constant");
- yylval.integer.signedp = UNSIGNED;
- }
- else {
- if (c == '.' || c == 'e' || c == 'E' || c == 'p' || c == 'P')
- yyerror ("Floating point numbers not allowed in #if expressions");
- else
- yyerror ("missing white space after number `%.*s'",
- (int) (p - lexptr - 1), lexptr);
- }
-
- if (--len == 0)
- break;
- c = *p++;
- }
- /* Don't look for any more digits after the suffixes. */
- break;
- }
- if (largest_digit < digit)
- largest_digit = digit;
- nd = n * base + digit;
- overflow |= (max_over_base < n) | (nd < n);
- n = nd;
- }
-
- if (base <= largest_digit)
- pedwarn ("integer constant contains digits beyond the radix");
-
- if (overflow)
- pedwarn ("integer constant out of range");
-
- /* If too big to be signed, consider it unsigned. */
- if (((HOST_WIDEST_INT) n & yylval.integer.signedp) < 0)
- {
- if (base == 10)
- warning ("integer constant is so large that it is unsigned");
- yylval.integer.signedp = UNSIGNED;
- }
-
- lexptr = p;
- yylval.integer.value = n;
- return INT;
-}
-
-struct token {
- const char *operator;
- int token;
-};
-
-static struct token tokentab2[] = {
- {"&&", AND},
- {"||", OR},
- {"<<", LSH},
- {">>", RSH},
- {"==", EQUAL},
- {"!=", NOTEQUAL},
- {"<=", LEQ},
- {">=", GEQ},
- {"++", ERROR},
- {"--", ERROR},
- {NULL, ERROR}
-};
-
-/* Read one token, getting characters through lexptr. */
-
-static int
-yylex ()
-{
- register int c;
- register int namelen;
- register unsigned char *tokstart;
- register struct token *toktab;
- int wide_flag;
- HOST_WIDEST_INT mask;
-
- retry:
-
- tokstart = (unsigned char *) lexptr;
- c = *tokstart;
- /* See if it is a special token of length 2. */
- if (! keyword_parsing)
- for (toktab = tokentab2; toktab->operator != NULL; toktab++)
- if (c == *toktab->operator && tokstart[1] == toktab->operator[1]) {
- lexptr += 2;
- if (toktab->token == ERROR)
- yyerror ("`%s' not allowed in operand of `#if'", toktab->operator);
- return toktab->token;
- }
-
- switch (c) {
- case '\n':
- return 0;
-
- case ' ':
- case '\t':
- case '\r':
- lexptr++;
- goto retry;
-
- case 'L':
- /* Capital L may start a wide-string or wide-character constant. */
- if (lexptr[1] == '\'')
- {
- lexptr++;
- wide_flag = 1;
- mask = MAX_WCHAR_TYPE_MASK;
- goto char_constant;
- }
- if (lexptr[1] == '"')
- {
- lexptr++;
- wide_flag = 1;
- mask = MAX_WCHAR_TYPE_MASK;
- goto string_constant;
- }
- break;
-
- case '\'':
- wide_flag = 0;
- mask = MAX_CHAR_TYPE_MASK;
- char_constant:
- lexptr++;
- if (keyword_parsing) {
- char *start_ptr = lexptr - 1;
- while (1) {
- c = *lexptr++;
- if (c == '\\')
- c = parse_escape (&lexptr, mask);
- else if (c == '\'')
- break;
- }
- yylval.name.address = tokstart;
- yylval.name.length = lexptr - start_ptr;
- return NAME;
- }
-
- /* This code for reading a character constant
- handles multicharacter constants and wide characters.
- It is mostly copied from c-lex.c. */
- {
- register HOST_WIDEST_INT result = 0;
- register int num_chars = 0;
- int chars_seen = 0;
- unsigned width = MAX_CHAR_TYPE_SIZE;
- int max_chars;
-#ifdef MULTIBYTE_CHARS
- int longest_char = local_mb_cur_max ();
- char *token_buffer = (char *) alloca (longest_char);
- (void) local_mbtowc (NULL_PTR, NULL_PTR, 0);
-#endif
-
- max_chars = MAX_LONG_TYPE_SIZE / width;
- if (wide_flag)
- width = MAX_WCHAR_TYPE_SIZE;
-
- while (1)
- {
- c = *lexptr++;
-
- if (c == '\'' || c == EOF)
- break;
-
- ++chars_seen;
- if (c == '\\')
- {
- c = parse_escape (&lexptr, mask);
- }
- else
- {
-#ifdef MULTIBYTE_CHARS
- wchar_t wc;
- int i;
- int char_len = -1;
- for (i = 1; i <= longest_char; ++i)
- {
- token_buffer[i - 1] = c;
- char_len = local_mbtowc (& wc, token_buffer, i);
- if (char_len != -1)
- break;
- c = *lexptr++;
- }
- if (char_len > 1)
- {
- /* mbtowc sometimes needs an extra char before accepting */
- if (char_len < i)
- lexptr--;
- if (! wide_flag)
- {
- /* Merge character into result; ignore excess chars. */
- for (i = 1; i <= char_len; ++i)
- {
- if (i > max_chars)
- break;
- if (width < HOST_BITS_PER_INT)
- result = (result << width)
- | (token_buffer[i - 1]
- & ((1 << width) - 1));
- else
- result = token_buffer[i - 1];
- }
- num_chars += char_len;
- continue;
- }
- }
- else
- {
- if (char_len == -1)
- warning ("Ignoring invalid multibyte character");
- }
- if (wide_flag)
- c = wc;
-#endif /* ! MULTIBYTE_CHARS */
- }
-
- if (wide_flag)
- {
- if (chars_seen == 1) /* only keep the first one */
- result = c;
- continue;
- }
-
- /* Merge character into result; ignore excess chars. */
- num_chars++;
- if (num_chars <= max_chars)
- {
- if (width < HOST_BITS_PER_INT)
- result = (result << width) | (c & ((1 << width) - 1));
- else
- result = c;
- }
- }
-
- if (c != '\'')
- error ("malformatted character constant");
- else if (chars_seen == 0)
- error ("empty character constant");
- else if (num_chars > max_chars)
- {
- num_chars = max_chars;
- error ("character constant too long");
- }
- else if (chars_seen != 1 && ! traditional)
- warning ("multi-character character constant");
-
- /* If char type is signed, sign-extend the constant. */
- if (! wide_flag)
- {
- int num_bits = num_chars * width;
- if (num_bits == 0)
- /* We already got an error; avoid invalid shift. */
- yylval.integer.value = 0;
- else if (lookup ((U_CHAR *) "__CHAR_UNSIGNED__",
- sizeof ("__CHAR_UNSIGNED__") - 1, -1)
- || ((result >> (num_bits - 1)) & 1) == 0)
- yylval.integer.value
- = result & (~ (unsigned HOST_WIDEST_INT) 0
- >> (HOST_BITS_PER_WIDEST_INT - num_bits));
- else
- yylval.integer.value
- = result | ~(~ (unsigned HOST_WIDEST_INT) 0
- >> (HOST_BITS_PER_WIDEST_INT - num_bits));
- }
- else
- {
- yylval.integer.value = result;
- }
- }
-
- /* This is always a signed type. */
- yylval.integer.signedp = SIGNED;
-
- return CHAR;
-
- /* some of these chars are invalid in constant expressions;
- maybe do something about them later */
- case '/':
- case '+':
- case '-':
- case '*':
- case '%':
- case '|':
- case '&':
- case '^':
- case '~':
- case '!':
- case '@':
- case '<':
- case '>':
- case '[':
- case ']':
- case '.':
- case '?':
- case ':':
- case '=':
- case '{':
- case '}':
- case ',':
- case '#':
- if (keyword_parsing)
- break;
- case '(':
- case ')':
- lexptr++;
- return c;
-
- case '"':
- mask = MAX_CHAR_TYPE_MASK;
- string_constant:
- if (keyword_parsing) {
- char *start_ptr = lexptr;
- lexptr++;
- while (1) {
- c = *lexptr++;
- if (c == '\\')
- c = parse_escape (&lexptr, mask);
- else if (c == '"')
- break;
- }
- yylval.name.address = tokstart;
- yylval.name.length = lexptr - start_ptr;
- return NAME;
- }
- yyerror ("string constants not allowed in #if expressions");
- return ERROR;
- }
-
- if (c >= '0' && c <= '9' && !keyword_parsing) {
- /* It's a number */
- for (namelen = 1; ; namelen++) {
- int d = tokstart[namelen];
- if (! ((is_idchar[d] || d == '.')
- || ((d == '-' || d == '+')
- && (c == 'e' || c == 'E'
- || ((c == 'p' || c == 'P') && ! c89))
- && ! traditional)))
- break;
- c = d;
- }
- return parse_number (namelen);
- }
-
- /* It is a name. See how long it is. */
-
- if (keyword_parsing) {
- for (namelen = 0;; namelen++) {
- if (is_space[tokstart[namelen]])
- break;
- if (tokstart[namelen] == '(' || tokstart[namelen] == ')')
- break;
- if (tokstart[namelen] == '"' || tokstart[namelen] == '\'')
- break;
- }
- } else {
- if (!is_idstart[c]) {
- yyerror ("Invalid token in expression");
- return ERROR;
- }
-
- for (namelen = 0; is_idchar[tokstart[namelen]]; namelen++)
- ;
- }
-
- lexptr += namelen;
- yylval.name.address = tokstart;
- yylval.name.length = namelen;
- return NAME;
-}
-
-
-/* Parse a C escape sequence. STRING_PTR points to a variable
- containing a pointer to the string to parse. That pointer
- is updated past the characters we use. The value of the
- escape sequence is returned.
-
- RESULT_MASK is used to mask out the result;
- an error is reported if bits are lost thereby.
-
- A negative value means the sequence \ newline was seen,
- which is supposed to be equivalent to nothing at all.
-
- If \ is followed by a null character, we return a negative
- value and leave the string pointer pointing at the null character.
-
- If \ is followed by 000, we return 0 and leave the string pointer
- after the zeros. A value of 0 does not mean end of string. */
-
-HOST_WIDEST_INT
-parse_escape (string_ptr, result_mask)
- char **string_ptr;
- HOST_WIDEST_INT result_mask;
-{
- register int c = *(*string_ptr)++;
- switch (c)
- {
- case 'a':
- return TARGET_BELL;
- case 'b':
- return TARGET_BS;
- case 'e':
- case 'E':
- if (pedantic)
- pedwarn ("non-ANSI-standard escape sequence, `\\%c'", c);
- return 033;
- case 'f':
- return TARGET_FF;
- case 'n':
- return TARGET_NEWLINE;
- case 'r':
- return TARGET_CR;
- case 't':
- return TARGET_TAB;
- case 'v':
- return TARGET_VT;
- case '\n':
- return -2;
- case 0:
- (*string_ptr)--;
- return 0;
-
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- {
- register HOST_WIDEST_INT i = c - '0';
- register int count = 0;
- while (++count < 3)
- {
- c = *(*string_ptr)++;
- if (c >= '0' && c <= '7')
- i = (i << 3) + c - '0';
- else
- {
- (*string_ptr)--;
- break;
- }
- }
- if (i != (i & result_mask))
- {
- i &= result_mask;
- pedwarn ("octal escape sequence out of range");
- }
- return i;
- }
- case 'x':
- {
- register unsigned HOST_WIDEST_INT i = 0, overflow = 0;
- register int digits_found = 0, digit;
- for (;;)
- {
- c = *(*string_ptr)++;
- if (c >= '0' && c <= '9')
- digit = c - '0';
- else if (c >= 'a' && c <= 'f')
- digit = c - 'a' + 10;
- else if (c >= 'A' && c <= 'F')
- digit = c - 'A' + 10;
- else
- {
- (*string_ptr)--;
- break;
- }
- overflow |= i ^ (i << 4 >> 4);
- i = (i << 4) + digit;
- digits_found = 1;
- }
- if (!digits_found)
- yyerror ("\\x used with no following hex digits");
- if (overflow | (i != (i & result_mask)))
- {
- i &= result_mask;
- pedwarn ("hex escape sequence out of range");
- }
- return i;
- }
- default:
- return c;
- }
-}
-
-static void
-integer_overflow ()
-{
- if (!skip_evaluation && pedantic)
- pedwarn ("integer overflow in preprocessor expression");
-}
-
-static HOST_WIDEST_INT
-left_shift (a, b)
- struct constant *a;
- unsigned HOST_WIDEST_INT b;
-{
- /* It's unclear from the C standard whether shifts can overflow.
- The following code ignores overflow; perhaps a C standard
- interpretation ruling is needed. */
- if (b >= HOST_BITS_PER_WIDEST_INT)
- return 0;
- else
- return (unsigned HOST_WIDEST_INT) a->value << b;
-}
-
-static HOST_WIDEST_INT
-right_shift (a, b)
- struct constant *a;
- unsigned HOST_WIDEST_INT b;
-{
- if (b >= HOST_BITS_PER_WIDEST_INT)
- return a->signedp ? a->value >> (HOST_BITS_PER_WIDEST_INT - 1) : 0;
- else if (a->signedp)
- return a->value >> b;
- else
- return (unsigned HOST_WIDEST_INT) a->value >> b;
-}
-
-/* This page contains the entry point to this file. */
-
-/* Parse STRING as an expression, and complain if this fails
- to use up all of the contents of STRING.
- STRING may contain '\0' bytes; it is terminated by the first '\n'
- outside a string constant, so that we can diagnose '\0' properly.
- If WARN_UNDEFINED is nonzero, warn if undefined identifiers are evaluated.
- We do not support C comments. They should be removed before
- this function is called. */
-
-HOST_WIDEST_INT
-parse_c_expression (string, warn_undefined)
- char *string;
- int warn_undefined;
-{
- lexptr = string;
- warn_undef = warn_undefined;
-
- /* if there is some sort of scanning error, just return 0 and assume
- the parsing routine has printed an error message somewhere.
- there is surely a better thing to do than this. */
- if (setjmp (parse_return_error))
- return 0;
-
- if (yyparse () != 0)
- abort ();
-
- if (*lexptr != '\n')
- error ("Junk after end of expression.");
-
- return expression_value; /* set by yyparse () */
-}
-
-static void
-yyerror VPROTO ((const char * msgid, ...))
-{
-#ifndef ANSI_PROTOTYPES
- const char * msgid;
-#endif
- va_list args;
-
- VA_START (args, msgid);
-
-#ifndef ANSI_PROTOTYPES
- msgid = va_arg (args, const char *);
-#endif
-
- verror (msgid, args);
- va_end (args);
- skip_evaluation = 0;
- longjmp (parse_return_error, 1);
-}
-
-
-#ifdef TEST_EXP_READER
-
-#if YYDEBUG
-extern int yydebug;
-#endif
-
-int pedantic;
-int traditional;
-int c89;
-
-int main PROTO((int, char **));
-static void initialize_random_junk PROTO((void));
-static void print_unsigned_host_widest_int PROTO((unsigned HOST_WIDEST_INT));
-
-/* Main program for testing purposes. */
-int
-main (argc, argv)
- int argc;
- char **argv;
-{
- int n, c;
- char buf[1024];
- unsigned HOST_WIDEST_INT u;
-
- pedantic = 1 < argc;
- traditional = 2 < argc;
- c89 = 3 < argc;
-#if YYDEBUG
- yydebug = 4 < argc;
-#endif
- initialize_random_junk ();
-
- for (;;) {
- printf ("enter expression: ");
- n = 0;
- while ((buf[n] = c = getchar ()) != '\n' && c != EOF)
- n++;
- if (c == EOF)
- break;
- parse_c_expression (buf, 1);
- printf ("parser returned ");
- u = (unsigned HOST_WIDEST_INT) expression_value;
- if (expression_value < 0 && expression_signedp) {
- u = -u;
- printf ("-");
- }
- if (u == 0)
- printf ("0");
- else
- print_unsigned_host_widest_int (u);
- if (! expression_signedp)
- printf("u");
- printf ("\n");
- }
-
- return 0;
-}
-
-static void
-print_unsigned_host_widest_int (u)
- unsigned HOST_WIDEST_INT u;
-{
- if (u) {
- print_unsigned_host_widest_int (u / 10);
- putchar ('0' + (int) (u % 10));
- }
-}
-
-/* table to tell if char can be part of a C identifier. */
-unsigned char is_idchar[256];
-/* table to tell if char can be first char of a c identifier. */
-unsigned char is_idstart[256];
-/* table to tell if c is horizontal or vertical space. */
-unsigned char is_space[256];
-
-/*
- * initialize random junk in the hash table and maybe other places
- */
-static void
-initialize_random_junk ()
-{
- register int i;
-
- /*
- * Set up is_idchar and is_idstart tables. These should be
- * faster than saying (is_alpha (c) || c == '_'), etc.
- * Must do set up these things before calling any routines tthat
- * refer to them.
- */
- for (i = 'a'; i <= 'z'; i++) {
- ++is_idchar[i - 'a' + 'A'];
- ++is_idchar[i];
- ++is_idstart[i - 'a' + 'A'];
- ++is_idstart[i];
- }
- for (i = '0'; i <= '9'; i++)
- ++is_idchar[i];
- ++is_idchar['_'];
- ++is_idstart['_'];
- ++is_idchar['$'];
- ++is_idstart['$'];
-
- ++is_space[' '];
- ++is_space['\t'];
- ++is_space['\v'];
- ++is_space['\f'];
- ++is_space['\n'];
- ++is_space['\r'];
-}
-
-void
-error VPROTO ((char * msgid, ...))
-{
-#ifndef ANSI_PROTOTYPES
- char * msgid;
-#endif
- va_list args;
-
- VA_START (args, msgid);
-
-#ifndef ANSI_PROTOTYPES
- msgid = va_arg (args, char *);
-#endif
-
- fprintf (stderr, "error: ");
- vfprintf (stderr, _(msgid), args);
- fprintf (stderr, "\n");
- va_end (args);
-}
-
-void
-pedwarn VPROTO ((char * msgid, ...))
-{
-#ifndef ANSI_PROTOTYPES
- char * msgid;
-#endif
- va_list args;
-
- VA_START (args, msgid);
-
-#ifndef ANSI_PROTOTYPES
- msgid = va_arg (args, char *);
-#endif
-
- fprintf (stderr, "pedwarn: ");
- vfprintf (stderr, _(msgid), args);
- fprintf (stderr, "\n");
- va_end (args);
-}
-
-void
-warning VPROTO ((char * msgid, ...))
-{
-#ifndef ANSI_PROTOTYPES
- char * msgid;
-#endif
- va_list args;
-
- VA_START (args, msgid);
-
-#ifndef ANSI_PROTOTYPES
- msgid = va_arg (args, char *);
-#endif
-
- fprintf (stderr, "warning: ");
- vfprintf (stderr, _(msgid), args);
- fprintf (stderr, "\n");
- va_end (args);
-}
-
-
-int
-check_assertion (name, sym_length, tokens_specified, tokens)
- U_CHAR *name;
- int sym_length;
- int tokens_specified;
- struct arglist *tokens;
-{
- return 0;
-}
-
-struct hashnode *
-lookup (name, len, hash)
- U_CHAR *name;
- int len;
- int hash;
-{
- return (DEFAULT_SIGNED_CHAR) ? 0 : ((struct hashnode *) -1);
-}
-
-PTR
-xmalloc (size)
- size_t size;
-{
- return (PTR) malloc (size);
-}
-#endif
diff --git a/contrib/gcc/choose-temp.c b/contrib/gcc/choose-temp.c
deleted file mode 100644
index b1007bb546bd..000000000000
--- a/contrib/gcc/choose-temp.c
+++ /dev/null
@@ -1,203 +0,0 @@
-/* Utility to pick a temporary filename prefix.
- Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
-
-This file is part of the libiberty library.
-Libiberty 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.
-
-Libiberty 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 libiberty; see the file COPYING.LIB. If not,
-write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* This file exports two functions: choose_temp_base and make_temp_file. */
-
-/* This file lives in at least two places: libiberty and gcc.
- Don't change one without the other. */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <stdio.h> /* May get P_tmpdir. */
-#include <sys/types.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#ifdef HAVE_SYS_FILE_H
-#include <sys/file.h> /* May get R_OK, etc. on some systems. */
-#endif
-
-#ifndef R_OK
-#define R_OK 4
-#define W_OK 2
-#define X_OK 1
-#endif
-
-#include "libiberty.h"
-extern int mkstemps ();
-
-#ifndef IN_GCC
-#if defined (__MSDOS__) || (defined (_WIN32) && ! defined (__CYGWIN__) && ! defined (_UWIN))
-#define DIR_SEPARATOR '\\'
-#endif
-#endif
-
-#ifndef DIR_SEPARATOR
-#define DIR_SEPARATOR '/'
-#endif
-
-/* On MSDOS, write temp files in current dir
- because there's no place else we can expect to use. */
-/* ??? Although the current directory is tried as a last resort,
- this is left in so that on MSDOS it is preferred to /tmp on the
- off chance that someone requires this, since that was the previous
- behaviour. */
-#ifdef __MSDOS__
-#ifndef P_tmpdir
-#define P_tmpdir "."
-#endif
-#endif
-
-/* Name of temporary file.
- mktemp requires 6 trailing X's. */
-#define TEMP_FILE "ccXXXXXX"
-
-/* Subroutine of choose_temp_base.
- If BASE is non-NULL, return it.
- Otherwise it checks if DIR is a usable directory.
- If success, DIR is returned.
- Otherwise NULL is returned. */
-
-static char *
-try (dir, base)
- char *dir, *base;
-{
- if (base != 0)
- return base;
- if (dir != 0
- && access (dir, R_OK | W_OK | X_OK) == 0)
- return dir;
- return 0;
-}
-
-/* Return a prefix for temporary file names or NULL if unable to find one.
- The current directory is chosen if all else fails so the program is
- exited if a temporary directory can't be found (mktemp fails).
- The buffer for the result is obtained with xmalloc.
-
- This function is provided for backwards compatability only. It use
- is not recommended. */
-
-char *
-choose_temp_base ()
-{
- char *base = 0;
- char *temp_filename;
- int len;
- static char tmp[] = { DIR_SEPARATOR, 't', 'm', 'p', 0 };
- static char usrtmp[] = { DIR_SEPARATOR, 'u', 's', 'r', DIR_SEPARATOR, 't', 'm', 'p', 0 };
-
- base = try (getenv ("TMPDIR"), base);
- base = try (getenv ("TMP"), base);
- base = try (getenv ("TEMP"), base);
-
-#ifdef P_tmpdir
- base = try (P_tmpdir, base);
-#endif
-
- /* Try /usr/tmp, then /tmp. */
- base = try (usrtmp, base);
- base = try (tmp, base);
-
- /* If all else fails, use the current directory! */
- if (base == 0)
- base = ".";
-
- len = strlen (base);
- temp_filename = xmalloc (len + 1 /*DIR_SEPARATOR*/
- + strlen (TEMP_FILE) + 1);
- strcpy (temp_filename, base);
-
- if (len != 0
- && temp_filename[len-1] != '/'
- && temp_filename[len-1] != DIR_SEPARATOR)
- temp_filename[len++] = DIR_SEPARATOR;
- strcpy (temp_filename + len, TEMP_FILE);
-
- mktemp (temp_filename);
- if (strlen (temp_filename) == 0)
- abort ();
- return temp_filename;
-}
-/* Return a temporary file name (as a string) or NULL if unable to create
- one. */
-
-char *
-make_temp_file (suffix)
- char *suffix;
-{
- char *base = 0;
- char *temp_filename;
- int base_len, suffix_len;
- int fd;
- static char tmp[] = { DIR_SEPARATOR, 't', 'm', 'p', 0 };
- static char usrtmp[] = { DIR_SEPARATOR, 'u', 's', 'r', DIR_SEPARATOR, 't', 'm', 'p', 0 };
-
- base = try (getenv ("TMPDIR"), base);
- base = try (getenv ("TMP"), base);
- base = try (getenv ("TEMP"), base);
-
-#ifdef P_tmpdir
- base = try (P_tmpdir, base);
-#endif
-
- /* Try /usr/tmp, then /tmp. */
- base = try (usrtmp, base);
- base = try (tmp, base);
-
- /* If all else fails, use the current directory! */
- if (base == 0)
- base = ".";
-
- base_len = strlen (base);
-
- if (suffix)
- suffix_len = strlen (suffix);
- else
- suffix_len = 0;
-
- temp_filename = xmalloc (base_len + 1 /*DIR_SEPARATOR*/
- + strlen (TEMP_FILE)
- + suffix_len + 1);
- strcpy (temp_filename, base);
-
- if (base_len != 0
- && temp_filename[base_len-1] != '/'
- && temp_filename[base_len-1] != DIR_SEPARATOR)
- temp_filename[base_len++] = DIR_SEPARATOR;
- strcpy (temp_filename + base_len, TEMP_FILE);
-
- if (suffix)
- strcat (temp_filename, suffix);
-
- fd = mkstemps (temp_filename, suffix_len);
- /* If mkstemps failed, then something bad is happening. Maybe we should
- issue a message about a possible security attack in progress? */
- if (fd == -1)
- abort ();
- /* Similarly if we can not close the file. */
- if (close (fd))
- abort ();
- return temp_filename;
-}
diff --git a/contrib/gcc/config/alpha/crtbegin.asm b/contrib/gcc/config/alpha/crtbegin.asm
deleted file mode 100644
index f954f1ab0d3e..000000000000
--- a/contrib/gcc/config/alpha/crtbegin.asm
+++ /dev/null
@@ -1,192 +0,0 @@
- # Copyright (C) 1996, 1998 Free Software Foundation, Inc.
- # Contributed by Richard Henderson (rth@tamu.edu)
- #
- # This file 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.
- #
- # In addition to the permissions in the GNU General Public License, the
- # Free Software Foundation gives you unlimited permission to link the
- # compiled version of this file with other programs, and to distribute
- # those programs without any restriction coming from the use of this
- # file. (The General Public License restrictions do apply in other
- # respects; for example, they cover modification of the file, and
- # distribution when not linked into another program.)
- #
- # This file 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 program; 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 GCC 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.
-
- #
- # Heads of the constructor/destructor lists.
- #
-
- # The __*TOR_LIST__ symbols are not global because when this file is used
- # in a shared library, we do not want the symbol to fall over to the
- # application's lists.
-
-.section .ctors,"aw"
-
- .align 3
-__CTOR_LIST__:
- .quad -1
-
-.section .dtors,"aw"
-
- .align 3
-__DTOR_LIST__:
- .quad -1
-
-.section .eh_frame,"aw"
-__EH_FRAME_BEGIN__:
-
- #
- # Fragment of the ELF _fini routine that invokes our dtor cleanup.
- #
-
-.section .fini,"ax"
-
- # Since the bits of the _fini function are spread across many
- # object files, each potentially with its own GP, we must
- # assume we need to load ours. Further, our .fini section
- # can easily be more than 4MB away from our .text bits so we
- # can't use bsr.
-
- br $29,1f
-1: ldgp $29,0($29)
- jsr $26,__do_global_dtors_aux
-
- # Ideally this call would go in crtend.o, except that we can't
- # get hold of __EH_FRAME_BEGIN__ there.
-
- jsr $26,__do_frame_takedown
-
- # Must match the alignment we got from crti.o else we get
- # zero-filled holes in our _fini function and then SIGILL.
- .align 3
-
- #
- # Fragment of the ELF _init routine that sets up the frame info.
- #
-
-.section .init,"ax"
- br $29,1f
-1: ldgp $29,0($29)
- jsr $26,__do_frame_setup
- .align 3
-
- #
- # Invoke our destructors in order.
- #
-
-.data
-
- # Support recursive calls to exit.
-$ptr: .quad __DTOR_LIST__
-
-.text
-
- .align 3
- .ent __do_global_dtors_aux
-
-__do_global_dtors_aux:
- lda $30,-16($30)
- .frame $30,16,$26,0
- stq $9,8($30)
- stq $26,0($30)
- .mask 0x4000200,-16
- .prologue 0
-
- lda $9,$ptr
- br 1f
-0: stq $1,0($9)
- jsr $26,($27)
-1: ldq $1,0($9)
- ldq $27,8($1)
- addq $1,8,$1
- bne $27,0b
-
- ldq $26,0($30)
- ldq $9,8($30)
- lda $30,16($30)
- ret
-
- .end __do_global_dtors_aux
-
- #
- # Install our frame info.
- #
-
- # ??? How can we rationally keep this size correct?
-
-.section .bss
- .type $object,@object
- .align 3
-$object:
- .zero 48
- .size $object, 48
-
-.text
-
- .align 3
- .ent __do_frame_setup
-
-__do_frame_setup:
- ldgp $29,0($27)
- lda $30,-16($30)
- .frame $30,16,$26,0
- stq $26,0($30)
- .mask 0x4000000,-16
- .prologue 1
-
- lda $1,__register_frame_info
- beq $1,0f
- lda $16,__EH_FRAME_BEGIN__
- lda $17,$object
- jsr $26,__register_frame_info
- ldq $26,0($30)
-0: lda $30,16($30)
- ret
-
- .end __do_frame_setup
-
- #
- # Remove our frame info.
- #
-
- .align 3
- .ent __do_frame_takedown
-
-__do_frame_takedown:
- ldgp $29,0($27)
- lda $30,-16($30)
- .frame $30,16,$26,0
- stq $26,0($30)
- .mask 0x4000000,-16
- .prologue 1
-
- lda $1,__deregister_frame_info
- beq $1,0f
- lda $16,__EH_FRAME_BEGIN__
- jsr $26,__deregister_frame_info
- ldq $26,0($30)
-0: lda $30,16($30)
- ret
-
- .end __do_frame_takedown
-
-.weak __register_frame_info
-.weak __deregister_frame_info
diff --git a/contrib/gcc/config/alpha/crtend.asm b/contrib/gcc/config/alpha/crtend.asm
deleted file mode 100644
index 4a0cc5e9f612..000000000000
--- a/contrib/gcc/config/alpha/crtend.asm
+++ /dev/null
@@ -1,108 +0,0 @@
- # Copyright (C) 1996 Free Software Foundation, Inc.
- # Contributed by Richard Henderson (rth@tamu.edu)
- #
- # This file 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.
- #
- # In addition to the permissions in the GNU General Public License, the
- # Free Software Foundation gives you unlimited permission to link the
- # compiled version of this file with other programs, and to distribute
- # those programs without any restriction coming from the use of this
- # file. (The General Public License restrictions do apply in other
- # respects; for example, they cover modification of the file, and
- # distribution when not linked into another program.)
- #
- # This file 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 program; 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 GCC 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.
-
- #
- # Tails of the constructor/destructor lists.
- #
-
- # The __*TOR_END__ symbols are not global because when this file is used
- # in a shared library, we do not want the symbol to fall over to the
- # application's lists.
-
-.section .ctors,"aw"
-
- .align 3
-__CTOR_END__:
- .quad 0
-
-.section .dtors,"aw"
-
- .align 3
-__DTOR_END__:
- .quad 0
-
-.section .eh_frame,"aw"
-__FRAME_END__:
- .quad 0
-
- #
- # Fragment of the ELF _init routine that invokes our ctor startup
- #
-
-.section .init,"ax"
-
- # Since the bits of the _init function are spread across many
- # object files, each potentially with its own GP, we must
- # assume we need to load ours. Further, our .init section
- # can easily be more than 4MB away from our .text bits so we
- # can't use bsr.
-
- br $29,1f
-1: ldgp $29,0($29)
- jsr $26,__do_global_ctors_aux
-
- # Must match the alignment we got from crti.o else we get
- # zero-filled holes in our _init function and thense SIGILL.
- .align 3
-
- #
- # Invoke our destructors in order.
- #
-
-.text
-
- .align 3
- .ent __do_global_ctors_aux
-
-__do_global_ctors_aux:
- ldgp $29,0($27)
- lda $30,-16($30)
- .frame $30,16,$26,0
- stq $9,8($30)
- stq $26,0($30)
- .mask 0x4000200,-16
- .prologue 1
-
- lda $9,__CTOR_END__
- br 1f
-0: jsr $26,($27)
-1: ldq $27,-8($9)
- subq $9,8,$9
- not $27,$0
- bne $0,0b
-
- ldq $26,0($30)
- ldq $9,8($30)
- lda $30,16($30)
- ret
-
- .end __do_global_ctors_aux
diff --git a/contrib/gcc/config/alpha/gdb-osf12.h b/contrib/gcc/config/alpha/gdb-osf12.h
deleted file mode 100644
index 98c289714017..000000000000
--- a/contrib/gcc/config/alpha/gdb-osf12.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Definitions of target machine for GNU compiler, for DEC Alpha, using
- encapsulated stabs and OSF V1.2.
- Copyright (C) 1994 Free Software Foundation, Inc.
- Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#include "alpha/osf12.h"
-
-#undef PREFERRED_DEBUGGING_TYPE
-#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
diff --git a/contrib/gcc/config/alpha/gdb-osf2.h b/contrib/gcc/config/alpha/gdb-osf2.h
deleted file mode 100644
index 5ddb7981b34d..000000000000
--- a/contrib/gcc/config/alpha/gdb-osf2.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Definitions of target machine for GNU compiler, for DEC Alpha, using
- encapsulated stabs.
- Copyright (C) 1992, 1993 Free Software Foundation, Inc.
- Contributed by Peter Schauer (pes@regent.e-technik.tu-muenchen.de).
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#include "alpha/osf2.h"
-
-#undef PREFERRED_DEBUGGING_TYPE
-#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
diff --git a/contrib/gcc/config/alpha/gdb.h b/contrib/gcc/config/alpha/gdb.h
deleted file mode 100644
index ecdbe40a9a45..000000000000
--- a/contrib/gcc/config/alpha/gdb.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Definitions of target machine for GNU compiler, for DEC Alpha, using
- encapsulated stabs.
- Copyright (C) 1992, 1993 Free Software Foundation, Inc.
- Contributed by Peter Schauer (pes@regent.e-technik.tu-muenchen.de).
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#include "alpha/alpha.h"
-
-#undef PREFERRED_DEBUGGING_TYPE
-#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
diff --git a/contrib/gcc/config/alpha/netbsd-elf.h b/contrib/gcc/config/alpha/netbsd-elf.h
deleted file mode 100644
index 6e4f4daf62b2..000000000000
--- a/contrib/gcc/config/alpha/netbsd-elf.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Definitions of target machine for GNU compiler
- for Alpha NetBSD systems using ELF.
- Copyright (C) 1998 Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#undef TARGET_VERSION
-#define TARGET_VERSION fprintf (stderr, " (Alpha NetBSD/ELF)");
-
-#undef SUB_CPP_PREDEFINES
-#define SUB_CPP_PREDEFINES "-D__ELF__"
-
-#undef SUBTARGET_EXTRA_SPECS
-#define SUBTARGET_EXTRA_SPECS \
-{ "elf_dynamic_linker", ELF_DYNAMIC_LINKER },
-
-#define ELF_DYNAMIC_LINKER "/usr/libexec/ld.elf_so"
diff --git a/contrib/gcc/config/alpha/osf2.h b/contrib/gcc/config/alpha/osf2.h
deleted file mode 100644
index 169af5a01c97..000000000000
--- a/contrib/gcc/config/alpha/osf2.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Definitions of target machine for GNU compiler, for DEC Alpha.
- Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
- Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-
-#include "alpha/alpha.h"
-
-/* In OSF 2.0, the size of wchar_t was changed from short unsigned
- to unsigned int. */
-
-#undef WCHAR_TYPE
-#define WCHAR_TYPE "unsigned int"
-
-#undef WCHAR_TYPE_SIZE
-#define WCHAR_TYPE_SIZE 32
diff --git a/contrib/gcc/config/alpha/t-crtbe b/contrib/gcc/config/alpha/t-crtbe
deleted file mode 100644
index 5e82b923c720..000000000000
--- a/contrib/gcc/config/alpha/t-crtbe
+++ /dev/null
@@ -1,9 +0,0 @@
-# Effectively disable the crtbegin/end rules using crtstuff.c
-T = disable
-
-# Assemble startup files.
-crtbegin.o: $(srcdir)/config/alpha/crtbegin.asm $(GCC_PASSES)
- $(GCC_FOR_TARGET) -c -o crtbegin.o -x assembler $(srcdir)/config/alpha/crtbegin.asm
-
-crtend.o: $(srcdir)/config/alpha/crtend.asm $(GCC_PASSES)
- $(GCC_FOR_TARGET) -c -o crtend.o -x assembler $(srcdir)/config/alpha/crtend.asm
diff --git a/contrib/gcc/config/alpha/vms-tramp.asm b/contrib/gcc/config/alpha/vms-tramp.asm
deleted file mode 100644
index fce9ec539cad..000000000000
--- a/contrib/gcc/config/alpha/vms-tramp.asm
+++ /dev/null
@@ -1,22 +0,0 @@
-;# New Alpha OpenVMS trampoline
-;#
- .set noreorder
- .set volatile
- .set noat
- .file 1 "tramp.s"
-.text
- .align 3
- .globl __tramp
- .ent __tramp
-__tramp..en:
-
-.link
- .align 3
-__tramp:
- .pdesc __tramp..en,null
-.text
- ldq $1,24($27)
- ldq $27,16($27)
- ldq $28,8($27)
- jmp $31,($28),0
- .end __tramp
diff --git a/contrib/gcc/config/alpha/x-alpha b/contrib/gcc/config/alpha/x-alpha
deleted file mode 100644
index 9686ab96472a..000000000000
--- a/contrib/gcc/config/alpha/x-alpha
+++ /dev/null
@@ -1,2 +0,0 @@
-CLIB=-lmld
-EXTRA_HEADERS = $(srcdir)/config/alpha/va_list.h
diff --git a/contrib/gcc/config/alpha/xm-alpha.h b/contrib/gcc/config/alpha/xm-alpha.h
deleted file mode 100644
index c04844fdacde..000000000000
--- a/contrib/gcc/config/alpha/xm-alpha.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/* Configuration for GNU C-compiler for DEC Alpha.
- Copyright (C) 1990, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
- Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu).
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-
-/* #defines that need visibility everywhere. */
-#define FALSE 0
-#define TRUE 1
-
-/* This describes the machine the compiler is hosted on. */
-#define HOST_BITS_PER_CHAR 8
-#define HOST_BITS_PER_SHORT 16
-#define HOST_BITS_PER_INT 32
-#define HOST_BITS_PER_LONG 64
-#define HOST_BITS_PER_LONGLONG 64
-
-/* #define HOST_WORDS_BIG_ENDIAN */
-
-/* target machine dependencies.
- tm.h is a symbolic link to the actual target specific file. */
-#include "tm.h"
-
-/* Arguments to use with `exit'. */
-#define SUCCESS_EXIT_CODE 0
-#define FATAL_EXIT_CODE 33
-
-/* If compiled with GNU C, use the builtin alloca. */
-#ifndef alloca
-#if defined(__GNUC__) && !defined(USE_C_ALLOCA)
-#define alloca __builtin_alloca
-#else
-#if !defined(_WIN32) && !defined(USE_C_ALLOCA) && !defined(OPEN_VMS) && !defined(__INTERIX)
-#include <alloca.h>
-#else
-extern void *alloca ();
-#endif
-#endif
-#endif
-
-/* The host compiler has problems with enum bitfields since it makes
- them signed so we can't fit all our codes in. */
-
-#ifndef __GNUC__
-#define ONLY_INT_FIELDS
-#endif
-
-/* Declare some functions needed for this machine. We don't want to
- include these in the sources since other machines might define them
- differently. */
-
-extern void *malloc (), *realloc (), *calloc ();
-
-#ifndef inhibit_libc
-#include "string.h"
-#endif
-
-/* OSF/1 is POSIX.1 compliant. */
-
-#define POSIX
diff --git a/contrib/gcc/config/alpha/xm-openbsd.h b/contrib/gcc/config/alpha/xm-openbsd.h
deleted file mode 100644
index 50f436695a71..000000000000
--- a/contrib/gcc/config/alpha/xm-openbsd.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/* Configuration file for an host running alpha OpenBSD.
- Copyright (C) 1999 Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#include <xm-openbsd.h>
-#include <alpha/xm-alpha.h>
-
diff --git a/contrib/gcc/config/i386/config-nt.sed b/contrib/gcc/config/i386/config-nt.sed
deleted file mode 100644
index 6c86b27e99ce..000000000000
--- a/contrib/gcc/config/i386/config-nt.sed
+++ /dev/null
@@ -1,38 +0,0 @@
-/^Makefile/,/^ rm -f config.run/d
-s/rm -f/del/
-s/|| cp/|| copy/
-/^config.status/,/ fi/d
-s/config.status//g
-s/\/dev\/null/NUL/g
-s/$(srcdir)\/c-parse/c-parse/g
-s/$(srcdir)\/c-gperf/c-gperf/g
-/^multilib.h/ s/multilib/not-multilib/
-/^target=/ c\
-target=winnt3.5
-/^xmake_file=/ d
-/^tmake_file=/ d
-/^out_file/ c\
-out_file=config/i386/i386.c
-/^out_object_file/ c\
-out_object_file=i386.obj
-/^md_file/ c\
-md_file=config/i386/i386.md
-/^tm_file/ c\
-tm_file=config/i386/win-nt.h
-/^build_xm_file/ c\
-build_xm_file=config/i386/xm-winnt.h
-/^host_xm_file/ c\
-host_xm_file=config/i386/xm-winnt.h
-/^####target/ i\
-CC = cl \
-CLIB = libc.lib kernel32.lib \
-CFLAGS = -Di386 -DWIN32 -D_WIN32 -D_M_IX86=300 -D_X86_=1 \\\
- -DALMOST_STDC -D_MSC_VER=800 \
-LDFLAGS = -align:0x1000 -subsystem:console -entry:mainCRTStartup \\\
- -stack:1000000,1000 \
-\
-EXTRA_OBJS=winnt.obj \
-winnt.obj: $(srcdir)/config/i386/winnt.c \
-\ $(CC) $(CFLAGS) \\\
-\ -I. -I$(srcdir) -I$(srcdir)/config -c $(srcdir)/config/i386/winnt.c \
-
diff --git a/contrib/gcc/config/i386/dgux.c b/contrib/gcc/config/i386/dgux.c
deleted file mode 100644
index 638d1e0f60e6..000000000000
--- a/contrib/gcc/config/i386/dgux.c
+++ /dev/null
@@ -1,192 +0,0 @@
-/* Subroutines for GNU compiler for Intel 80x86 running DG/ux
- Copyright (C) 1993, 1995, 1997 Free Software Foundation, Inc.
- Currently maintained by (gcc@dg-rtp.dg.com)
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#include <time.h>
-#include "i386/i386.c"
-
-
-extern char *version_string;
-
-struct option
-{
- char *string;
- int *variable;
- int on_value;
- char *description;
-};
-
-static int
-output_option (file, sep, type, name, indent, pos, max)
- FILE *file;
- char *sep;
- char *type;
- char *name;
- char *indent;
- int pos;
- int max;
-{
- if (strlen (sep) + strlen (type) + strlen (name) + pos > max)
- {
- fprintf (file, indent);
- return fprintf (file, "%s%s", type, name);
- }
- return pos + fprintf (file, "%s%s%s", sep, type, name);
-}
-
-static struct { char *name; int value; } m_options[] = TARGET_SWITCHES;
-
-static void
-output_options (file, f_options, f_len, W_options, W_len,
- pos, max, sep, indent, term)
- FILE *file;
- struct option *f_options;
- struct option *W_options;
- int f_len, W_len;
- int pos;
- int max;
- char *indent;
- char *term;
-{
- register int j;
-
- if (optimize)
- pos = output_option (file, sep, "-O", "", indent, pos, max);
- if (write_symbols != NO_DEBUG)
- pos = output_option (file, sep, "-g", "", indent, pos, max);
-/* if (flag_traditional)
- pos = output_option (file, sep, "-traditional", "", indent, pos, max);*/
- if (profile_flag)
- pos = output_option (file, sep, "-p", "", indent, pos, max);
- if (profile_block_flag)
- pos = output_option (file, sep, "-a", "", indent, pos, max);
-
- for (j = 0; j < f_len; j++)
- if (*f_options[j].variable == f_options[j].on_value)
- pos = output_option (file, sep, "-f", f_options[j].string,
- indent, pos, max);
-
- for (j = 0; j < W_len; j++)
- if (*W_options[j].variable == W_options[j].on_value)
- pos = output_option (file, sep, "-W", W_options[j].string,
- indent, pos, max);
-
- for (j = 0; j < sizeof m_options / sizeof m_options[0]; j++)
- if (m_options[j].name[0] != '\0'
- && m_options[j].value > 0
- && ((m_options[j].value & target_flags)
- == m_options[j].value))
- pos = output_option (file, sep, "-m", m_options[j].name,
- indent, pos, max);
-
- pos = output_option (file, sep, "-mcpu=", ix86_cpu_string, indent, pos, max);
- pos = output_option (file, sep, "-march=", ix86_arch_string, indent, pos, max);
- fprintf (file, term);
-}
-
-/* Output to FILE the start of the assembler file. */
-
-void
-output_file_start (file, f_options, f_len, W_options, W_len)
- FILE *file;
- struct option *f_options;
- struct option *W_options;
- int f_len, W_len;
-{
- register int pos;
-
- output_file_directive (file, main_input_filename);
- fprintf (file, "\t.version\t\"01.01\"\n"); \
- /* Switch to the data section so that the coffsem symbol and the
- gcc2_compiled. symbol aren't in the text section. */
- data_section ();
-
- pos = fprintf (file, "\n// cc1 (%s) arguments:", VERSION_STRING);
- output_options (file, f_options, f_len, W_options, W_len,
- pos, 75, " ", "\n// ", "\n\n");
-
-#ifdef TARGET_IDENTIFY_REVISION
- if (TARGET_IDENTIFY_REVISION)
- {
- char indent[256];
-
- time_t now = time ((time_t *)0);
- sprintf (indent, "]\"\n\t%s\t \"@(#)%s [", IDENT_ASM_OP, main_input_filename);
- fprintf (file, indent+3);
- pos = fprintf (file, "gcc %s, %.24s,", VERSION_STRING, ctime (&now));
- output_options (file, f_options, f_len, W_options, W_len,
- pos, 150 - strlen (indent), " ", indent, "]\"\n\n");
- }
-#endif /* TARGET_IDENTIFY_REVISION */
-}
-
-#ifndef CROSS_COMPILE
-#if defined (_abort_aux)
-/* Debugging aid to be registered via `atexit'. See the definition
- of abort in dgux.h. */
-void
-abort_aux ()
-{
- extern int insn_;
- extern char * file_;
- extern int line_;
- static int done;
- rtx line_note;
-
- if (done++)
- return;
- if (file_ || line_)
- {
- if (write_symbols != NO_DEBUG)
- {
- for (line_note = (rtx) insn_ ; line_note != 0 ; line_note = PREV_INSN (line_note))
- if (GET_CODE (line_note) == NOTE && NOTE_LINE_NUMBER (line_note) > 0)
- break;
- if (line_note != 0)
- {
- error_with_file_and_line (NOTE_SOURCE_FILE (line_note),
- NOTE_LINE_NUMBER (line_note),
- "Internal gcc abort from %s:%d",
- file_ ? file_ : "<nofile>", line_);
- if (insn_ && file_ && strcmp (file_, "toplev.c"))
- {
- error_with_file_and_line (NOTE_SOURCE_FILE (line_note),
- NOTE_LINE_NUMBER (line_note),
- "The local variable `insn' has the value:", 0);
- debug_rtx ((rtx) insn_);
- }
- }
- }
- if (write_symbols == NO_DEBUG || line_note == 0)
- {
- error ("Internal gcc abort from %s:%d",
- file_ ? file_ : "<nofile>", line_);
- if (insn_ && file_ && strcmp (file_, "toplev.c"))
- {
- error ("The local variable `insn' has the value:", 0);
- debug_rtx ((rtx) insn_);
- }
- }
- }
-}
-#endif
-#endif
-
-
diff --git a/contrib/gcc/config/i386/freebsd-elf.h b/contrib/gcc/config/i386/freebsd-elf.h
deleted file mode 100644
index e97d4ca07bb2..000000000000
--- a/contrib/gcc/config/i386/freebsd-elf.h
+++ /dev/null
@@ -1,257 +0,0 @@
-/* Definitions for Intel 386 running FreeBSD with ELF format
- Copyright (C) 1996 Free Software Foundation, Inc.
- Contributed by Eric Youngdale.
- Modified for stabs-in-ELF by H.J. Lu.
- Adapted from GNU/Linux version by John Polstra.
- Continued development by David O'Brien <obrien@freebsd.org>
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#undef TARGET_VERSION
-#define TARGET_VERSION fprintf (stderr, " (i386 FreeBSD/ELF)");
-
-/* The svr4 ABI for the i386 says that records and unions are returned
- in memory. */
-/* On FreeBSD, we do not. */
-#undef DEFAULT_PCC_STRUCT_RETURN
-#define DEFAULT_PCC_STRUCT_RETURN 0
-
-/* This gets defined in tm.h->linux.h->svr4.h, and keeps us from using
- libraries compiled with the native cc, so undef it. */
-#undef NO_DOLLAR_IN_LABEL
-
-/* Use more efficient ``thunks'' to implement C++ vtables. */
-#undef DEFAULT_VTABLE_THUNKS
-#define DEFAULT_VTABLE_THUNKS 1
-
-/* Override the default comment-starter of "/". */
-#undef ASM_COMMENT_START
-#define ASM_COMMENT_START "#"
-
-#undef ASM_APP_ON
-#define ASM_APP_ON "#APP\n"
-
-#undef ASM_APP_OFF
-#define ASM_APP_OFF "#NO_APP\n"
-
-#undef SET_ASM_OP
-#define SET_ASM_OP ".set"
-
-/* This is how to output an element of a case-vector that is relative.
- This is only used for PIC code. See comments by the `casesi' insn in
- i386.md for an explanation of the expression this outputs. */
-#undef ASM_OUTPUT_ADDR_DIFF_ELT
-#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
- fprintf (FILE, "\t.long _GLOBAL_OFFSET_TABLE_+[.-%s%d]\n", LPREFIX, VALUE)
-
-/* Indicate that jump tables go in the text section. This is
- necessary when compiling PIC code. */
-#define JUMP_TABLES_IN_TEXT_SECTION (flag_pic)
-
-/* Use stabs instead of DWARF debug format. */
-#undef PREFERRED_DEBUGGING_TYPE
-#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
-
-/* Copy this from the svr4 specifications... */
-/* Define the register numbers to be used in Dwarf debugging information.
- The SVR4 reference port C compiler uses the following register numbers
- in its Dwarf output code:
- 0 for %eax (gnu regno = 0)
- 1 for %ecx (gnu regno = 2)
- 2 for %edx (gnu regno = 1)
- 3 for %ebx (gnu regno = 3)
- 4 for %esp (gnu regno = 7)
- 5 for %ebp (gnu regno = 6)
- 6 for %esi (gnu regno = 4)
- 7 for %edi (gnu regno = 5)
- The following three DWARF register numbers are never generated by
- the SVR4 C compiler or by the GNU compilers, but SDB on x86/svr4
- believes these numbers have these meanings.
- 8 for %eip (no gnu equivalent)
- 9 for %eflags (no gnu equivalent)
- 10 for %trapno (no gnu equivalent)
- It is not at all clear how we should number the FP stack registers
- for the x86 architecture. If the version of SDB on x86/svr4 were
- a bit less brain dead with respect to floating-point then we would
- have a precedent to follow with respect to DWARF register numbers
- for x86 FP registers, but the SDB on x86/svr4 is so completely
- broken with respect to FP registers that it is hardly worth thinking
- of it as something to strive for compatibility with.
- The version of x86/svr4 SDB I have at the moment does (partially)
- seem to believe that DWARF register number 11 is associated with
- the x86 register %st(0), but that's about all. Higher DWARF
- register numbers don't seem to be associated with anything in
- particular, and even for DWARF regno 11, SDB only seems to under-
- stand that it should say that a variable lives in %st(0) (when
- asked via an `=' command) if we said it was in DWARF regno 11,
- but SDB still prints garbage when asked for the value of the
- variable in question (via a `/' command).
- (Also note that the labels SDB prints for various FP stack regs
- when doing an `x' command are all wrong.)
- Note that these problems generally don't affect the native SVR4
- C compiler because it doesn't allow the use of -O with -g and
- because when it is *not* optimizing, it allocates a memory
- location for each floating-point variable, and the memory
- location is what gets described in the DWARF AT_location
- attribute for the variable in question.
- Regardless of the severe mental illness of the x86/svr4 SDB, we
- do something sensible here and we use the following DWARF
- register numbers. Note that these are all stack-top-relative
- numbers.
- 11 for %st(0) (gnu regno = 8)
- 12 for %st(1) (gnu regno = 9)
- 13 for %st(2) (gnu regno = 10)
- 14 for %st(3) (gnu regno = 11)
- 15 for %st(4) (gnu regno = 12)
- 16 for %st(5) (gnu regno = 13)
- 17 for %st(6) (gnu regno = 14)
- 18 for %st(7) (gnu regno = 15)
-*/
-#undef DBX_REGISTER_NUMBER
-#define DBX_REGISTER_NUMBER(n) \
-((n) == 0 ? 0 \
- : (n) == 1 ? 2 \
- : (n) == 2 ? 1 \
- : (n) == 3 ? 3 \
- : (n) == 4 ? 6 \
- : (n) == 5 ? 7 \
- : (n) == 6 ? 5 \
- : (n) == 7 ? 4 \
- : ((n) >= FIRST_STACK_REG && (n) <= LAST_STACK_REG) ? (n)+3 \
- : (-1))
-
-/* Tell final.c that we don't need a label passed to mcount. */
-
-#undef FUNCTION_PROFILER
-#define FUNCTION_PROFILER(FILE, LABELNO) \
-{ \
- if (flag_pic) \
- fprintf (FILE, "\tcall *.mcount@GOT(%%ebx)\n"); \
- else \
- fprintf (FILE, "\tcall .mcount\n"); \
-}
-
-#undef SIZE_TYPE
-#define SIZE_TYPE "unsigned int"
-
-#undef PTRDIFF_TYPE
-#define PTRDIFF_TYPE "int"
-
-#undef WCHAR_TYPE
-#define WCHAR_TYPE "int"
-
-#undef WCHAR_UNSIGNED
-#define WCHAR_UNSIGNED 0
-
-#undef WCHAR_TYPE_SIZE
-#define WCHAR_TYPE_SIZE BITS_PER_WORD
-
-#undef CPP_PREDEFINES
-#define CPP_PREDEFINES "-Di386 -Dunix -D__ELF__ -D__FreeBSD__ -Asystem(unix) -Asystem(FreeBSD) -Acpu(i386) -Amachine(i386)"
-
-#undef CPP_SPEC
-#define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
-
-/* This defines which switch letters take arguments. On FreeBSD, most of
- the normal cases (defined in gcc.c) apply, and we also have -h* and
- -z* options (for the linker) (comming from svr4).
- We also have -R (alias --rpath), no -z, --soname (-h), --assert etc. */
-
-#undef SWITCH_TAKES_ARG
-#define SWITCH_TAKES_ARG(CHAR) \
- (DEFAULT_SWITCH_TAKES_ARG (CHAR) \
- || (CHAR) == 'h' \
- || (CHAR) == 'z' \
- || (CHAR) == 'R')
-
-/* Provide a STARTFILE_SPEC appropriate for FreeBSD. Here we add
- the magical crtbegin.o file (see crtstuff.c) which provides part
- of the support for getting C++ file-scope static object constructed
- before entering `main'. */
-
-#undef STARTFILE_SPEC
-#define STARTFILE_SPEC \
- "%{!shared: \
- %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
- %{!p:%{profile:gcrt1.o%s} \
- %{!profile:crt1.o%s}}}} \
- crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
-
-/* Provide a ENDFILE_SPEC appropriate for FreeBSD. Here we tack on
- the magical crtend.o file (see crtstuff.c) which provides part of
- the support for getting C++ file-scope static object constructed
- before entering `main', followed by a normal "finalizer" file,
- `crtn.o'. */
-
-#undef ENDFILE_SPEC
-#define ENDFILE_SPEC \
- "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
-
-/* Provide a LIB_SPEC appropriate for FreeBSD. Just select the appropriate
- libc, depending on whether we're doing profiling or need threads support.
- (simular to the default, except no -lg, and no -p. */
-
-#undef LIB_SPEC
-#define LIB_SPEC "%{!shared: \
- %{!pg:%{!pthread:%{!kthread:-lc} \
- %{kthread:-lpthread -lc}} \
- %{pthread:-lc_r}} \
- %{pg:%{!pthread:%{!kthread:-lc_p} \
- %{kthread:-lpthread_p -lc_p}} \
- %{pthread:-lc_r_p}}}"
-
-/* Provide a LINK_SPEC appropriate for FreeBSD. Here we provide support
- for the special GCC options -static and -shared, which allow us to
- link things in one of these three modes by applying the appropriate
- combinations of options at link-time. We like to support here for
- as many of the other GNU linker options as possible. But I don't
- have the time to search for those flags. I am sure how to add
- support for -soname shared_object_name. H.J.
-
- I took out %{v:%{!V:-V}}. It is too much :-(. They can use
- -Wl,-V.
-
- When the -shared link option is used a final link is not being
- done. */
-
-#undef LINK_SPEC
-#define LINK_SPEC "-m elf_i386 \
- %{Wl,*:%*} \
- %{v:-V} \
- %{assert*} %{R*} %{rpath*} %{defsym*} \
- %{shared:-Bshareable %{h*} %{soname*}} \
- %{!shared: \
- %{!static: \
- %{rdynamic:-export-dynamic} \
- %{!dynamic-linker:-dynamic-linker /usr/libexec/ld-elf.so.1}} \
- %{static:-Bstatic}} \
- %{symbolic:-Bsymbolic}"
-
-/* A C statement to output to the stdio stream FILE an assembler
- command to advance the location counter to a multiple of 1<<LOG
- bytes if it is within MAX_SKIP bytes.
-
- This is used to align code labels according to Intel recommendations. */
-
-#ifdef HAVE_GAS_MAX_SKIP_P2ALIGN
-#define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE,LOG,MAX_SKIP) \
- if ((LOG) != 0) {\
- if ((MAX_SKIP) == 0) fprintf ((FILE), "\t.p2align %d\n", (LOG)); \
- else fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP)); \
- }
-#endif
diff --git a/contrib/gcc/config/i386/freebsd.h.fixed b/contrib/gcc/config/i386/freebsd.h.fixed
deleted file mode 100644
index e97d4ca07bb2..000000000000
--- a/contrib/gcc/config/i386/freebsd.h.fixed
+++ /dev/null
@@ -1,257 +0,0 @@
-/* Definitions for Intel 386 running FreeBSD with ELF format
- Copyright (C) 1996 Free Software Foundation, Inc.
- Contributed by Eric Youngdale.
- Modified for stabs-in-ELF by H.J. Lu.
- Adapted from GNU/Linux version by John Polstra.
- Continued development by David O'Brien <obrien@freebsd.org>
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#undef TARGET_VERSION
-#define TARGET_VERSION fprintf (stderr, " (i386 FreeBSD/ELF)");
-
-/* The svr4 ABI for the i386 says that records and unions are returned
- in memory. */
-/* On FreeBSD, we do not. */
-#undef DEFAULT_PCC_STRUCT_RETURN
-#define DEFAULT_PCC_STRUCT_RETURN 0
-
-/* This gets defined in tm.h->linux.h->svr4.h, and keeps us from using
- libraries compiled with the native cc, so undef it. */
-#undef NO_DOLLAR_IN_LABEL
-
-/* Use more efficient ``thunks'' to implement C++ vtables. */
-#undef DEFAULT_VTABLE_THUNKS
-#define DEFAULT_VTABLE_THUNKS 1
-
-/* Override the default comment-starter of "/". */
-#undef ASM_COMMENT_START
-#define ASM_COMMENT_START "#"
-
-#undef ASM_APP_ON
-#define ASM_APP_ON "#APP\n"
-
-#undef ASM_APP_OFF
-#define ASM_APP_OFF "#NO_APP\n"
-
-#undef SET_ASM_OP
-#define SET_ASM_OP ".set"
-
-/* This is how to output an element of a case-vector that is relative.
- This is only used for PIC code. See comments by the `casesi' insn in
- i386.md for an explanation of the expression this outputs. */
-#undef ASM_OUTPUT_ADDR_DIFF_ELT
-#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
- fprintf (FILE, "\t.long _GLOBAL_OFFSET_TABLE_+[.-%s%d]\n", LPREFIX, VALUE)
-
-/* Indicate that jump tables go in the text section. This is
- necessary when compiling PIC code. */
-#define JUMP_TABLES_IN_TEXT_SECTION (flag_pic)
-
-/* Use stabs instead of DWARF debug format. */
-#undef PREFERRED_DEBUGGING_TYPE
-#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
-
-/* Copy this from the svr4 specifications... */
-/* Define the register numbers to be used in Dwarf debugging information.
- The SVR4 reference port C compiler uses the following register numbers
- in its Dwarf output code:
- 0 for %eax (gnu regno = 0)
- 1 for %ecx (gnu regno = 2)
- 2 for %edx (gnu regno = 1)
- 3 for %ebx (gnu regno = 3)
- 4 for %esp (gnu regno = 7)
- 5 for %ebp (gnu regno = 6)
- 6 for %esi (gnu regno = 4)
- 7 for %edi (gnu regno = 5)
- The following three DWARF register numbers are never generated by
- the SVR4 C compiler or by the GNU compilers, but SDB on x86/svr4
- believes these numbers have these meanings.
- 8 for %eip (no gnu equivalent)
- 9 for %eflags (no gnu equivalent)
- 10 for %trapno (no gnu equivalent)
- It is not at all clear how we should number the FP stack registers
- for the x86 architecture. If the version of SDB on x86/svr4 were
- a bit less brain dead with respect to floating-point then we would
- have a precedent to follow with respect to DWARF register numbers
- for x86 FP registers, but the SDB on x86/svr4 is so completely
- broken with respect to FP registers that it is hardly worth thinking
- of it as something to strive for compatibility with.
- The version of x86/svr4 SDB I have at the moment does (partially)
- seem to believe that DWARF register number 11 is associated with
- the x86 register %st(0), but that's about all. Higher DWARF
- register numbers don't seem to be associated with anything in
- particular, and even for DWARF regno 11, SDB only seems to under-
- stand that it should say that a variable lives in %st(0) (when
- asked via an `=' command) if we said it was in DWARF regno 11,
- but SDB still prints garbage when asked for the value of the
- variable in question (via a `/' command).
- (Also note that the labels SDB prints for various FP stack regs
- when doing an `x' command are all wrong.)
- Note that these problems generally don't affect the native SVR4
- C compiler because it doesn't allow the use of -O with -g and
- because when it is *not* optimizing, it allocates a memory
- location for each floating-point variable, and the memory
- location is what gets described in the DWARF AT_location
- attribute for the variable in question.
- Regardless of the severe mental illness of the x86/svr4 SDB, we
- do something sensible here and we use the following DWARF
- register numbers. Note that these are all stack-top-relative
- numbers.
- 11 for %st(0) (gnu regno = 8)
- 12 for %st(1) (gnu regno = 9)
- 13 for %st(2) (gnu regno = 10)
- 14 for %st(3) (gnu regno = 11)
- 15 for %st(4) (gnu regno = 12)
- 16 for %st(5) (gnu regno = 13)
- 17 for %st(6) (gnu regno = 14)
- 18 for %st(7) (gnu regno = 15)
-*/
-#undef DBX_REGISTER_NUMBER
-#define DBX_REGISTER_NUMBER(n) \
-((n) == 0 ? 0 \
- : (n) == 1 ? 2 \
- : (n) == 2 ? 1 \
- : (n) == 3 ? 3 \
- : (n) == 4 ? 6 \
- : (n) == 5 ? 7 \
- : (n) == 6 ? 5 \
- : (n) == 7 ? 4 \
- : ((n) >= FIRST_STACK_REG && (n) <= LAST_STACK_REG) ? (n)+3 \
- : (-1))
-
-/* Tell final.c that we don't need a label passed to mcount. */
-
-#undef FUNCTION_PROFILER
-#define FUNCTION_PROFILER(FILE, LABELNO) \
-{ \
- if (flag_pic) \
- fprintf (FILE, "\tcall *.mcount@GOT(%%ebx)\n"); \
- else \
- fprintf (FILE, "\tcall .mcount\n"); \
-}
-
-#undef SIZE_TYPE
-#define SIZE_TYPE "unsigned int"
-
-#undef PTRDIFF_TYPE
-#define PTRDIFF_TYPE "int"
-
-#undef WCHAR_TYPE
-#define WCHAR_TYPE "int"
-
-#undef WCHAR_UNSIGNED
-#define WCHAR_UNSIGNED 0
-
-#undef WCHAR_TYPE_SIZE
-#define WCHAR_TYPE_SIZE BITS_PER_WORD
-
-#undef CPP_PREDEFINES
-#define CPP_PREDEFINES "-Di386 -Dunix -D__ELF__ -D__FreeBSD__ -Asystem(unix) -Asystem(FreeBSD) -Acpu(i386) -Amachine(i386)"
-
-#undef CPP_SPEC
-#define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
-
-/* This defines which switch letters take arguments. On FreeBSD, most of
- the normal cases (defined in gcc.c) apply, and we also have -h* and
- -z* options (for the linker) (comming from svr4).
- We also have -R (alias --rpath), no -z, --soname (-h), --assert etc. */
-
-#undef SWITCH_TAKES_ARG
-#define SWITCH_TAKES_ARG(CHAR) \
- (DEFAULT_SWITCH_TAKES_ARG (CHAR) \
- || (CHAR) == 'h' \
- || (CHAR) == 'z' \
- || (CHAR) == 'R')
-
-/* Provide a STARTFILE_SPEC appropriate for FreeBSD. Here we add
- the magical crtbegin.o file (see crtstuff.c) which provides part
- of the support for getting C++ file-scope static object constructed
- before entering `main'. */
-
-#undef STARTFILE_SPEC
-#define STARTFILE_SPEC \
- "%{!shared: \
- %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
- %{!p:%{profile:gcrt1.o%s} \
- %{!profile:crt1.o%s}}}} \
- crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
-
-/* Provide a ENDFILE_SPEC appropriate for FreeBSD. Here we tack on
- the magical crtend.o file (see crtstuff.c) which provides part of
- the support for getting C++ file-scope static object constructed
- before entering `main', followed by a normal "finalizer" file,
- `crtn.o'. */
-
-#undef ENDFILE_SPEC
-#define ENDFILE_SPEC \
- "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
-
-/* Provide a LIB_SPEC appropriate for FreeBSD. Just select the appropriate
- libc, depending on whether we're doing profiling or need threads support.
- (simular to the default, except no -lg, and no -p. */
-
-#undef LIB_SPEC
-#define LIB_SPEC "%{!shared: \
- %{!pg:%{!pthread:%{!kthread:-lc} \
- %{kthread:-lpthread -lc}} \
- %{pthread:-lc_r}} \
- %{pg:%{!pthread:%{!kthread:-lc_p} \
- %{kthread:-lpthread_p -lc_p}} \
- %{pthread:-lc_r_p}}}"
-
-/* Provide a LINK_SPEC appropriate for FreeBSD. Here we provide support
- for the special GCC options -static and -shared, which allow us to
- link things in one of these three modes by applying the appropriate
- combinations of options at link-time. We like to support here for
- as many of the other GNU linker options as possible. But I don't
- have the time to search for those flags. I am sure how to add
- support for -soname shared_object_name. H.J.
-
- I took out %{v:%{!V:-V}}. It is too much :-(. They can use
- -Wl,-V.
-
- When the -shared link option is used a final link is not being
- done. */
-
-#undef LINK_SPEC
-#define LINK_SPEC "-m elf_i386 \
- %{Wl,*:%*} \
- %{v:-V} \
- %{assert*} %{R*} %{rpath*} %{defsym*} \
- %{shared:-Bshareable %{h*} %{soname*}} \
- %{!shared: \
- %{!static: \
- %{rdynamic:-export-dynamic} \
- %{!dynamic-linker:-dynamic-linker /usr/libexec/ld-elf.so.1}} \
- %{static:-Bstatic}} \
- %{symbolic:-Bsymbolic}"
-
-/* A C statement to output to the stdio stream FILE an assembler
- command to advance the location counter to a multiple of 1<<LOG
- bytes if it is within MAX_SKIP bytes.
-
- This is used to align code labels according to Intel recommendations. */
-
-#ifdef HAVE_GAS_MAX_SKIP_P2ALIGN
-#define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE,LOG,MAX_SKIP) \
- if ((LOG) != 0) {\
- if ((MAX_SKIP) == 0) fprintf ((FILE), "\t.p2align %d\n", (LOG)); \
- else fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP)); \
- }
-#endif
diff --git a/contrib/gcc/config/i386/os2.h b/contrib/gcc/config/i386/os2.h
deleted file mode 100644
index 8bbab361f98f..000000000000
--- a/contrib/gcc/config/i386/os2.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/* Definitions of target machine for GNU compiler
- for an Intel i386 or later processor running OS/2 2.x.
- Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc.
- Contributed by Samuel Figueroa (figueroa@cs.nyu.edu)
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#ifndef DEFAULT_TARGET_MACHINE
-#define DEFAULT_TARGET_MACHINE "i386-os2"
-#endif
-#ifndef LINK_SPEC
-#define LINK_SPEC "/st:1048576/pm:vio/noi/a:16/e/bas:65536/nol"
-#endif
-#ifndef LIB_SPEC
-#define LIB_SPEC "libgcc libc"
-#endif
-#ifndef STARTFILE_SPEC
-#define STARTFILE_SPEC "libcrt.lib"
-#endif
-#ifndef MD_EXEC_PREFIX
-#define MD_EXEC_PREFIX "\\gcc\\bin\\"
-#endif
-#ifndef STANDARD_STARTFILE_PREFIX
-#define STANDARD_STARTFILE_PREFIX "\\gcc\\lib\\"
-#endif
-#ifndef LOCAL_INCLUDE_DIR
-#define LOCAL_INCLUDE_DIR "\\gcc\\include"
-#endif
-
-#define YES_UNDERSCORES
-#include "i386/gstabs.h"
-
-#define USE_COLLECT
-
-#define BIGGEST_FIELD_ALIGNMENT \
- (maximum_field_alignment ? maximum_field_alignment : 32)
-
-extern int maximum_field_alignment;
-
-#undef PCC_BITFIELD_TYPE_MATTERS
-#define PCC_BITFIELD_TYPE_MATTERS (maximum_field_alignment == 0)
-
-/* Define this macro if it is advisable to hold scalars in registers
- in a wider mode than that declared by the program. In such cases,
- the value is constrained to be within the bounds of the declared
- type, but kept valid in the wider mode. The signedness of the
- extension may differ from that of the type. */
-
-#define PROMOTE_MODE(MODE,UNSIGNEDP,TYPE) \
- if (GET_MODE_CLASS (MODE) == MODE_INT \
- && GET_MODE_SIZE (MODE) < UNITS_PER_WORD) \
- (MODE) = SImode;
-
-/* Define this if function arguments should also be promoted using the above
- procedure. */
-
-#define PROMOTE_FUNCTION_ARGS
-
-/* Likewise, if the function return value is promoted. */
-
-#define PROMOTE_FUNCTION_RETURN
diff --git a/contrib/gcc/config/i386/perform.h b/contrib/gcc/config/i386/perform.h
deleted file mode 100644
index 8d6d0b71dfeb..000000000000
--- a/contrib/gcc/config/i386/perform.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/* Definitions for AT&T assembler syntax for the Intel 80386.
- Copyright (C) 1993 Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* Defines to be able to build libgcc.a with GCC. */
-
-/* It might seem that these are not important, since gcc 2 will never
- call libgcc for these functions. But programs might be linked with
- code compiled by gcc 1, and then these will be used. */
-
-/* The arg names used to be a and b, but `a' appears inside strings
- and that confuses non-ANSI cpp. */
-
-#define perform_udivsi3(arg0,arg1) \
-{ \
- register int dx asm("dx"); \
- register int ax asm("ax"); \
- \
- dx = 0; \
- ax = arg0; \
- asm ("divl %3" : "=a" (ax), "=d" (dx) : "a" (ax), "g" (arg1), "d" (dx)); \
- return ax; \
-}
-
-#define perform_divsi3(arg0,arg1) \
-{ \
- register int dx asm("dx"); \
- register int ax asm("ax"); \
- register int cx asm("cx"); \
- \
- ax = arg0; \
- cx = arg1; \
- asm ("cltd\n\tidivl %3" : "=a" (ax), "=&d" (dx) : "a" (ax), "c" (cx)); \
- return ax; \
-}
-
-#define perform_umodsi3(arg0,arg1) \
-{ \
- register int dx asm("dx"); \
- register int ax asm("ax"); \
- \
- dx = 0; \
- ax = arg0; \
- asm ("divl %3" : "=a" (ax), "=d" (dx) : "a" (ax), "g" (arg1), "d" (dx)); \
- return dx; \
-}
-
-#define perform_modsi3(arg0,arg1) \
-{ \
- register int dx asm("dx"); \
- register int ax asm("ax"); \
- register int cx asm("cx"); \
- \
- ax = arg0; \
- cx = arg1; \
- asm ("cltd\n\tidivl %3" : "=a" (ax), "=&d" (dx) : "a" (ax), "c" (cx)); \
- return dx; \
-}
-
-#define perform_fixdfsi(arg0) \
-{ \
- auto unsigned short ostatus; \
- auto unsigned short nstatus; \
- auto int ret; \
- auto double tmp; \
- \
- &ostatus; /* guarantee these land in memory */ \
- &nstatus; \
- &ret; \
- &tmp; \
- \
- asm volatile ("fnstcw %0" : "=m" (ostatus)); \
- nstatus = ostatus | 0x0c00; \
- asm volatile ("fldcw %0" : /* no outputs */ : "m" (nstatus)); \
- tmp = arg0; \
- asm volatile ("fldl %0" : /* no outputs */ : "m" (tmp)); \
- asm volatile ("fistpl %0" : "=m" (ret)); \
- asm volatile ("fldcw %0" : /* no outputs */ : "m" (ostatus)); \
- \
- return ret; \
-}
-
diff --git a/contrib/gcc/config/i386/sco.h b/contrib/gcc/config/i386/sco.h
deleted file mode 100644
index 55af64128a10..000000000000
--- a/contrib/gcc/config/i386/sco.h
+++ /dev/null
@@ -1,117 +0,0 @@
-/* Definitions for Intel 386 running SCO Unix System V.
- Copyright (C) 1988, 92, 94, 95, 96, 1999 Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* Mostly it's like AT&T Unix System V. */
-
-#include "i386/sysv3.h"
-
-/* By default, target has a 80387, uses IEEE compatible arithmetic,
- and returns float values in the 387, ie,
- (TARGET_80387 | TARGET_FLOAT_RETURNS_IN_80387)
-
- SCO's software emulation of a 387 fails to handle the `fucomp'
- opcode. fucomp is only used when generating IEEE compliant code.
- So don't make TARGET_IEEE_FP default for SCO. */
-
-#undef TARGET_DEFAULT
-#define TARGET_DEFAULT (MASK_80387 | MASK_FLOAT_RETURNS)
-
-/* Let's guess that the SCO software FPU emulator can't handle
- 80-bit XFmode insns, so don't generate them. */
-#undef LONG_DOUBLE_TYPE_SIZE
-#define LONG_DOUBLE_TYPE_SIZE 64
-
-/* Use crt1.o as a startup file and crtn.o as a closing file. */
-
-#undef STARTFILE_SPEC
-#define STARTFILE_SPEC \
- "%{pg:gcrt1.o%s}%{!pg:%{p:mcrt1.o%s}%{!p:crt1.o%s}} crtbegin.o%s"
-
-#define ENDFILE_SPEC "crtend.o%s crtn.o%s"
-
-/* Library spec, including SCO international language support. */
-
-#undef LIB_SPEC
-#define LIB_SPEC \
- "%{p:-L/usr/lib/libp}%{pg:-L/usr/lib/libp} %{scointl:libintl.a%s} -lc"
-
-/* Specify predefined symbols in preprocessor. */
-
-#undef CPP_PREDEFINES
-#define CPP_PREDEFINES "-Dunix -DM_UNIX -DM_I386 -DM_COFF -DM_WORDSWAP -Asystem(svr3)"
-
-#undef CPP_SPEC
-#define CPP_SPEC "%(cpp_cpu) %{scointl:-DM_INTERNAT}"
-
-/* This spec is used for telling cpp whether char is signed or not. */
-
-#undef SIGNED_CHAR_SPEC
-#if DEFAULT_SIGNED_CHAR
-#define SIGNED_CHAR_SPEC \
- "%{funsigned-char:-D__CHAR_UNSIGNED__ -D_CHAR_UNSIGNED}"
-#else
-#define SIGNED_CHAR_SPEC \
- "%{!fsigned-char:-D__CHAR_UNSIGNED__ -D_CHAR_UNSIGNED}"
-#endif
-
-/* Use atexit for static destructors, instead of defining
- our own exit function. */
-#define HAVE_ATEXIT
-
-/* Specify the size_t type. */
-#define SIZE_TYPE "unsigned int"
-
-#if 0 /* Not yet certain whether this is needed. */
-/* If no 387, use the general regs to return floating values,
- since this system does not emulate the 80387. */
-
-#undef VALUE_REGNO
-#define VALUE_REGNO(MODE) \
- ((TARGET_80387
- && ((MODE) == SFmode || (MODE) == DFmode || (MODE) == XFmode)
- ? FIRST_FLOAT_REG : 0)
-
-#undef HARD_REGNO_MODE_OK
-#define HARD_REGNO_MODE_OK(REGNO, MODE) \
- ((REGNO) < 2 ? 1 \
- : (REGNO) < 4 ? 1 \
- : FP_REGNO_P (REGNO) ? ((GET_MODE_CLASS (MODE) == MODE_FLOAT \
- || GET_MODE_CLASS (MODE) == MODE_COMPLEX_FLOAT) \
- && TARGET_80387 \
- && GET_MODE_UNIT_SIZE (MODE) <= 8) \
- : (MODE) != QImode)
-#endif
-
-/* caller has to pop the extra argument passed to functions that return
- structures. */
-
-#undef RETURN_POPS_ARGS
-#define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) \
- ((FUNDECL) && TREE_CODE (FUNDECL) == IDENTIFIER_NODE ? 0 \
- : (TARGET_RTD \
- && (TYPE_ARG_TYPES (FUNTYPE) == 0 \
- || (TREE_VALUE (tree_last (TYPE_ARG_TYPES (FUNTYPE))) \
- == void_type_node))) ? (SIZE) \
- : 0)
-/* On other 386 systems, the last line looks like this:
- : (aggregate_value_p (TREE_TYPE (FUNTYPE))) ? GET_MODE_SIZE (Pmode) : 0) */
-
-/* Handle #pragma pack. */
-#define HANDLE_SYSV_PRAGMA
diff --git a/contrib/gcc/config/i386/sco4.h b/contrib/gcc/config/i386/sco4.h
deleted file mode 100644
index 5d1ea471dbf8..000000000000
--- a/contrib/gcc/config/i386/sco4.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/* Definitions for Intel 386 running SCO Unix System V 3.2 Version 4.
- Written by Chip Salzenberg.
- Copyright (C) 1992, 1994 Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-
-/* Mostly it's like earlier SCO UNIX. */
-
-#include "i386/sco.h"
-
-/* Use crt1.o as a startup file and crtn.o as a closing file. */
-
-#undef STARTFILE_SPEC
-#define STARTFILE_SPEC \
- "%{scoxpg3:%{p:mcrt1X.o%s}%{!p:crt1X.o%s}} \
- %{!scoxpg3:\
- %{posix:%{p:mcrt1P.o%s}%{!p:crt1P.o%s}} \
- %{!posix:\
- %{ansi:%{p:mcrt1A.o%s}%{!p:crt1A.o%s}} \
- %{!ansi:%{pg:gcrt1.o%s}%{!pg:%{p:mcrt1.o%s}%{!p:crt1.o%s}}}}} \
- crtbegin.o%s"
-
-#undef ENDFILE_SPEC
-#define ENDFILE_SPEC \
- "crtend.o%s \
- %{scoxpg3:crtnX.o%s} \
- %{!scoxpg3:\
- %{posix:crtnP.o%s} \
- %{!posix:\
- %{ansi:crtnA.o%s} \
- %{!ansi:crtn.o%s}}}"
-
-/* Library spec. */
-
-#undef LIB_SPEC
-#define LIB_SPEC \
- "%{p:-L/usr/lib/libp}%{pg:-L/usr/lib/libp} \
- %{scoxpg3:-lcX -lcP -lcA} \
- %{!scoxpg3:\
- %{posix:-lcP -lcA} \
- %{!posix:\
- %{ansi:-lcA} \
- %{!ansi:%{scointl:-lintl} -lc}}}"
-
-/* Macros, macros everywhere:
- Specify predefined symbols in preprocessor. */
-
-#undef CPP_PREDEFINES
-#define CPP_PREDEFINES \
- "-Asystem(svr3)"
-
-#undef CPP_SPEC
-#define CPP_SPEC "%(cpp_cpu) \
- -D_i386 -D_M_I386 -D_M_I86 -D_M_I86SM -D_M_SDATA -D_M_STEXT \
- -D_unix -D_M_UNIX -D_M_XENIX \
- -D_M_SYS5 -D_M_SYSV -D_M_SYS3 -D_M_SYSIII \
- -D_M_COFF -D_M_BITFIELDS -D_M_WORDSWAP \
- %{scoxpg3:-D_XOPEN_SOURCE -D_STRICT_NAMES} \
- %{!scoxpg3:%{posix:-D_POSIX_SOURCE -D_STRICT_NAMES}} \
- %{!scoxpg3:%{!posix:\
- %{ansi:-D_STRICT_NAMES}%{!ansi:\
- -Di386 -DM_I386 -DM_I86 -DM_I86SM -DM_SDATA -DM_STEXT \
- -Dunix -DM_UNIX -DM_XENIX \
- -DM_SYS5 -DM_SYSV -DM_SYS3 -DM_SYSIII \
- -DM_COFF -DM_BITFIELDS -DM_WORDSWAP \
- %{scointl:-D_M_INTERNAT -DM_INTERNAT} \
- %{traditional:-D_KR -D_SVID -D_NO_PROTOTYPE}}}}"
-
-/* The system headers are C++-aware. */
-#define NO_IMPLICIT_EXTERN_C
diff --git a/contrib/gcc/config/i386/sco4dbx.h b/contrib/gcc/config/i386/sco4dbx.h
deleted file mode 100644
index 3d075b6a2e26..000000000000
--- a/contrib/gcc/config/i386/sco4dbx.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/* Definitions for Intel 386 running SCO Unix System V 3.2 Version 4.s,
- using dbx-in-coff encapsulation.
- Copyright (C) 1992 Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-
-/* Mostly it's like earlier SCO UNIX. */
-
-#include "i386/scodbx.h"
-
-/* Use crt1.o as a startup file and crtn.o as a closing file. */
-
-#undef STARTFILE_SPEC
-#define STARTFILE_SPEC \
- "%{!r:%{!z:gcc.ifile%s}%{z:gccz.ifile%s}}\
- %{scoxpg3:%{p:mcrt1X.o%s}%{!p:crt1X.o%s}} \
- %{!scoxpg3:\
- %{posix:%{p:mcrt1P.o%s}%{!p:crt1P.o%s}} \
- %{!posix:\
- %{ansi:%{p:mcrt1A.o%s}%{!p:crt1A.o%s}} \
- %{!ansi:%{pg:gcrt1.o%s}%{!pg:%{p:mcrt1.o%s}%{!p:crt1.o%s}}}}}"
-
-#undef ENDFILE_SPEC
-#define ENDFILE_SPEC \
- "%{scoxpg3:crtnX.o%s} \
- %{!scoxpg3:\
- %{posix:crtnP.o%s} \
- %{!posix:\
- %{ansi:crtnA.o%s} \
- %{!ansi:crtn.o%s}}}"
-
-/* Library spec. */
-
-#undef LIB_SPEC
-#define LIB_SPEC \
- "%{p:-L/usr/lib/libp}%{pg:-L/usr/lib/libp} \
- %{scoxpg3:-lcX -lcP -lcA} \
- %{!scoxpg3:\
- %{posix:-lcP -lcA} \
- %{!posix:\
- %{ansi:-lcA} \
- %{!ansi:%{scointl:-lintl} -lc}}}"
-
-/* Macros, macros everywhere:
- Specify predefined symbols in preprocessor. */
-
-#undef CPP_PREDEFINES
-#define CPP_PREDEFINES "-Dunix -Asystem(svr3)"
-
-#undef CPP_SPEC
-#define CPP_SPEC "%(cpp_cpu) \
- -D_M_I386 -D_M_I86 -D_M_I86SM -D_M_SDATA -D_M_STEXT \
- -D_M_UNIX -D_M_XENIX \
- -D_M_SYS5 -D_M_SYSV -D_M_SYS3 -D_M_SYSIII \
- -D_M_COFF -D_M_BITFIELDS -D_M_WORDSWAP \
- %{scoxpg3:-D_XOPEN_SOURCE -D_STRICT_NAMES} \
- %{!scoxpg3:%{posix:-D_POSIX_SOURCE -D_STRICT_NAMES}} \
- %{!scoxpg3:%{!posix:\
- %{ansi:-D_STRICT_NAMES}%{!ansi:\
- -DM_I386 -DM_I86 -DM_I86SM -DM_SDATA -DM_STEXT \
- -DM_UNIX -DM_XENIX \
- -DM_SYS5 -DM_SYSV -DM_SYS3 -DM_SYSIII \
- -DM_COFF -DM_BITFIELDS -DM_WORDSWAP \
- %{scointl:-D_M_INTERNAT -DM_INTERNAT} \
- %{traditional:-D_KR -D_SVID -D_NO_PROTOTYPE}}}}"
diff --git a/contrib/gcc/config/i386/sco5gas.h b/contrib/gcc/config/i386/sco5gas.h
deleted file mode 100644
index de3e5d5570f1..000000000000
--- a/contrib/gcc/config/i386/sco5gas.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/* Definitions for Intel x86 running SCO OpenServer, running GNU assembler
- Copyright (C) 1998 Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-
-/* Just set a single flag we can test for inside of sco5.h and include it. */
-
-#define USE_GAS 1
diff --git a/contrib/gcc/config/i386/t-i386bare b/contrib/gcc/config/i386/t-i386bare
deleted file mode 100644
index 2970fa714155..000000000000
--- a/contrib/gcc/config/i386/t-i386bare
+++ /dev/null
@@ -1,3 +0,0 @@
-# The i386 md has all of these taken care of, according to sef.
-LIBGCC1 =
-CROSS_LIBGCC1 =
diff --git a/contrib/gcc/config/i386/t-vsta b/contrib/gcc/config/i386/t-vsta
deleted file mode 100644
index 6160b7ec945d..000000000000
--- a/contrib/gcc/config/i386/t-vsta
+++ /dev/null
@@ -1,2 +0,0 @@
-LIBGCC1 = libgcc1.null
-CROSS_LIBGCC1 = libgcc1.null
diff --git a/contrib/gcc/config/i386/t-winnt b/contrib/gcc/config/i386/t-winnt
deleted file mode 100644
index 1e3557c1822a..000000000000
--- a/contrib/gcc/config/i386/t-winnt
+++ /dev/null
@@ -1,6 +0,0 @@
-winnt.o: $(srcdir)/config/i386/winnt.c
- $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/config/i386/winnt.c
-oldnames.o: $(srcdir)/config/winnt/oldnames.c
- $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/config/winnt/oldnames.c
-spawnv.o: $(srcdir)/config/winnt/spawnv.c
- $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/config/winnt/spawnv.c
diff --git a/contrib/gcc/config/i386/win-nt.h b/contrib/gcc/config/i386/win-nt.h
deleted file mode 100644
index 97f10c39d002..000000000000
--- a/contrib/gcc/config/i386/win-nt.h
+++ /dev/null
@@ -1,150 +0,0 @@
-/* Operating system specific defines to be used when targeting GCC for
- Windows NT 3.x on an i386.
- Copyright (C) 1994, 1995 Free Software Foundation, Inc.
- Contributed by Douglas B. Rupp (drupp@cs.washington.edu).
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#define YES_UNDERSCORES
-
-#include "i386/gas.h"
-
-#ifdef CPP_PREDEFINES
-#undef CPP_PREDEFINES
-#endif
-#define CPP_PREDEFINES "-Dunix -Di386 -DWIN32 -D_WIN32 \
- -DWINNT -D_M_IX86=300 -D_X86_=1 -D__STDC__=0 -DALMOST_STDC -D_MSC_VER=800 \
- -D__stdcall=__attribute__((__stdcall__)) \
- -D__cdecl=__attribute__((__cdecl__)) \
- -D_cdecl=__attribute__((__cdecl__)) \
- -Asystem(unix) -Asystem(winnt) -Acpu(i386) -Amachine(i386)"
-
-#define SIZE_TYPE "unsigned int"
-#define PTRDIFF_TYPE "int"
-#define WCHAR_UNSIGNED 1
-#define WCHAR_TYPE_SIZE 16
-#define WCHAR_TYPE "short unsigned int"
-#undef LONG_DOUBLE_TYPE_SIZE
-#define LONG_DOUBLE_TYPE_SIZE 64
-#define HAVE_ATEXIT 1
-
-#undef EXTRA_SECTIONS
-#define EXTRA_SECTIONS in_ctor, in_dtor
-
-#undef EXTRA_SECTION_FUNCTIONS
-#define EXTRA_SECTION_FUNCTIONS \
- CTOR_SECTION_FUNCTION \
- DTOR_SECTION_FUNCTION
-
-#define CTOR_SECTION_FUNCTION \
-void \
-ctor_section () \
-{ \
- if (in_section != in_ctor) \
- { \
- fprintf (asm_out_file, "\t.section .ctor\n"); \
- in_section = in_ctor; \
- } \
-}
-
-#define DTOR_SECTION_FUNCTION \
-void \
-dtor_section () \
-{ \
- if (in_section != in_dtor) \
- { \
- fprintf (asm_out_file, "\t.section .dtor\n"); \
- in_section = in_dtor; \
- } \
-}
-
-#define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \
- do { \
- ctor_section (); \
- fprintf (FILE, "%s\t", ASM_LONG); \
- assemble_name (FILE, NAME); \
- fprintf (FILE, "\n"); \
- } while (0)
-
-#define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \
- do { \
- dtor_section (); \
- fprintf (FILE, "%s\t", ASM_LONG); \
- assemble_name (FILE, NAME); \
- fprintf (FILE, "\n"); \
- } while (0)
-
-/* Define this macro if references to a symbol must be treated
- differently depending on something about the variable or
- function named by the symbol (such as what section it is in).
-
- On i386, if using PIC, mark a SYMBOL_REF for a non-global symbol
- so that we may access it directly in the GOT.
-
- On i386 running Windows NT, modify the assembler name with a suffix
- consisting of an atsign (@) followed by string of digits that represents
- the number of bytes of arguments passed to the function, if it has the
- attribute STDCALL. */
-
-#ifdef ENCODE_SECTION_INFO
-#undef ENCODE_SECTION_INFO
-#define ENCODE_SECTION_INFO(DECL) \
-do \
- { \
- if (flag_pic) \
- { \
- rtx rtl = (TREE_CODE_CLASS (TREE_CODE (DECL)) != 'd' \
- ? TREE_CST_RTL (DECL) : DECL_RTL (DECL)); \
- SYMBOL_REF_FLAG (XEXP (rtl, 0)) \
- = (TREE_CODE_CLASS (TREE_CODE (DECL)) != 'd' \
- || ! TREE_PUBLIC (DECL)); \
- } \
- if (TREE_CODE (DECL) == FUNCTION_DECL) \
- if (lookup_attribute ("stdcall", \
- TYPE_ATTRIBUTES (TREE_TYPE (DECL)))) \
- XEXP (DECL_RTL (DECL), 0) = \
- gen_rtx (SYMBOL_REF, Pmode, gen_stdcall_suffix (DECL)); \
- } \
-while (0)
-#endif
-
-/* The global __fltused is necessary to cause the printf/scanf routines
- for outputting/inputting floating point numbers to be loaded. Since this
- is kind of hard to detect, we just do it all the time. */
-
-#ifdef ASM_FILE_START
-#undef ASM_FILE_START
-#endif
-#define ASM_FILE_START(FILE) \
- do { output_file_directive (FILE, main_input_filename); \
- fprintf (FILE, ".global\t__fltused\n"); \
- } while (0)
-
-/* if the switch "-mwindows" is passed to ld, then specify to the Microsoft
- linker the proper switches and libraries to build a graphical program */
-
-#undef LIB_SPEC
-#define LIB_SPEC "%{mwindows:-subsystem windows -e _WinMainCRTStartup \
- USER32.LIB%s GDI32.LIB%s COMDLG32.LIB%s WINSPOOL.LIB%s} \
- %{!mwindows:-subsystem console -e _mainCRTStartup} \
- %{mcrtmt:LIBCMT.LIB%s KERNEL32.LIB%s ADVAPI32.LIB%s} \
- %{!mcrtmt:LIBC.LIB%s KERNEL32.LIB%s ADVAPI32.LIB%s} \
- %{v}"
-
-#include "winnt/win-nt.h"
-
diff --git a/contrib/gcc/config/i386/x-aix b/contrib/gcc/config/i386/x-aix
deleted file mode 100644
index b191e48fd0f0..000000000000
--- a/contrib/gcc/config/i386/x-aix
+++ /dev/null
@@ -1,12 +0,0 @@
-# There is an alloca in -lbsd, but it is limited to 32K
-ALLOCA = alloca.o
-
-# If you are running out of memory while compiling gcc, with the standard
-# /bin/cc uncomment MALLOCLIB line. That version of malloc is slower but
-# has less overhead than the one in libc.
-#MALLOCLIB = -lmalloc
-
-# Uncomment out the next line if you want to link with the shareable libc_s.
-#CLIB_S = -lc_s
-
-CLIB = -lld $(MALLOCLIB) $(CLIB_S)
diff --git a/contrib/gcc/config/i386/x-cygwin b/contrib/gcc/config/i386/x-cygwin
deleted file mode 100644
index f251835bd332..000000000000
--- a/contrib/gcc/config/i386/x-cygwin
+++ /dev/null
@@ -1,4 +0,0 @@
-# Don't run fixproto
-STMP_FIXPROTO =
-# prefix.c wants to poke around the Registry
-CLIB = -ladvapi32
diff --git a/contrib/gcc/config/i386/x-dgux b/contrib/gcc/config/i386/x-dgux
deleted file mode 100644
index 322bfe3ae911..000000000000
--- a/contrib/gcc/config/i386/x-dgux
+++ /dev/null
@@ -1,11 +0,0 @@
-#
-# host is ix86 running dgux
-#
-CC = /bin/gcc
-X_CFLAGS = -O -mstandard -mlegend
-BOOT_CFLAGS = -O2 -g -mstandard -mlegend $(CFLAGS)
-CLIB = -lw32
-RANLIB = true
-USER_H = $(EXTRA_HEADERS) $(LANG_EXTRA_HEADERS)
-STMP_FIXPROTO =
-
diff --git a/contrib/gcc/config/i386/x-djgpp b/contrib/gcc/config/i386/x-djgpp
deleted file mode 100644
index 89f31ff50082..000000000000
--- a/contrib/gcc/config/i386/x-djgpp
+++ /dev/null
@@ -1,24 +0,0 @@
-# translate the version string, so it can be used on DJGPP, where only
-# one dot in filename is allowed
-
-# to avoid recursion when redefining $(version)
-_version:=$(version)
-__version=$(subst ., ,$(_version))
-version=$(word 1,$(__version))$(word 2,$(__version)).$(word 3,$(__version))
-
-SYSTEM_HEADER_DIR=$(DJDIR)/include
-X_CPPFLAGS=-DSTANDARD_INCLUDE_DIR=\"\$$DJDIR/include\" \
- -DSTANDARD_INCLUDE_COMPONENT=\"\"
-
-# when building a native compiler for DJGPP, make the target_alias
-# a shorter name, since otherwise it will produce some problems, when
-# using the same gcc once with long filenames and once with short (8+3)
-# filenames
-ifeq ($(findstring -pc-msdosdjgpp,$(target_alias)),-pc-msdosdjgpp)
-target_alias=djgpp
-endif
-
-# on DJGPP the 'ln -s' does not work correctly
-LN = cp -p
-LN_S = cp -p
-
diff --git a/contrib/gcc/config/i386/x-freebsd b/contrib/gcc/config/i386/x-freebsd
deleted file mode 100644
index a9b13ba5c819..000000000000
--- a/contrib/gcc/config/i386/x-freebsd
+++ /dev/null
@@ -1,3 +0,0 @@
-# Don't run fixproto
-STMP_FIXPROTO =
-CLIB=-lgnumalloc
diff --git a/contrib/gcc/config/i386/x-isc b/contrib/gcc/config/i386/x-isc
deleted file mode 100644
index ea65ec888a32..000000000000
--- a/contrib/gcc/config/i386/x-isc
+++ /dev/null
@@ -1,3 +0,0 @@
-CLIB = -lPW -lcposix
-X_CFLAGS = -D_POSIX_SOURCE
-ENQUIRE_LDFLAGS = -posix $(LDFLAGS)
diff --git a/contrib/gcc/config/i386/x-isc3 b/contrib/gcc/config/i386/x-isc3
deleted file mode 100644
index 527cca8132b6..000000000000
--- a/contrib/gcc/config/i386/x-isc3
+++ /dev/null
@@ -1,4 +0,0 @@
-CLIB = -lPW
-# One person said it needs -DPOSIX_JC, but daa@CERF.NET says no.
-X_CFLAGS = -D_SYSV3 -Xp
-ENQUIRE_LDFLAGS = $(LDFLAGS)
diff --git a/contrib/gcc/config/i386/x-ncr3000 b/contrib/gcc/config/i386/x-ncr3000
deleted file mode 100644
index 4ae168b1fe51..000000000000
--- a/contrib/gcc/config/i386/x-ncr3000
+++ /dev/null
@@ -1,34 +0,0 @@
-# Makefile additions for the NCR3000 as host system.
-
-# Using -O with the AT&T compiler fails, with a message about a missing
-# /usr/ccs/lib/optim pass. So override the default in Makefile.in
-
-CCLIBFLAGS=
-
-## Supposedly not needed now that xm-sysv4.h includes alloc.h for Metaware.
-### NCR3000 ships with a MetaWare compiler installed as CC, which chokes and
-### dies all over the place on GCC source. However, the AT&T compiler,
-### crusty as it is, can be used to bootstrap GCC. It can be found in
-### /usr/ccs/ATT/cc. It is also used to compile the things that should
-### not be compiled with GCC.
-##
-##CC = /usr/ccs/ATT/cc
-##OLDCC = /usr/ccs/ATT/cc
-
-# The rest is just x-i386v4.
-
-# Some versions of SVR4 have an alloca in /usr/ucblib/libucb.a, and if we are
-# careful to link that in after libc we can use it, but since newer versions of
-# SVR4 are dropping libucb, it is better to just use the portable C version for
-# bootstrapping. Do this by defining ALLOCA.
-
-ALLOCA = alloca.o
-
-# We used to build all stages *without* shared libraries because that may make
-# debugging the compiler easier (until there is a GDB which supports
-# both Dwarf *and* svr4 shared libraries).
-
-# But james@bigtex.cactus.org says that redefining GCC_CFLAGS causes trouble,
-# and that it is easy enough to debug using shared libraries.
-# CCLIBFLAGS=-Bstatic -dn -g
-# GCC_CFLAGS=-static -g -O2 -B./
diff --git a/contrib/gcc/config/i386/x-next b/contrib/gcc/config/i386/x-next
deleted file mode 100644
index a16b918e2d37..000000000000
--- a/contrib/gcc/config/i386/x-next
+++ /dev/null
@@ -1,3 +0,0 @@
-# Make assignments for compiling on NeXT with their compiler version.
-CC=cc -traditional-cpp
-OLDCC=cc -traditional-cpp
diff --git a/contrib/gcc/config/i386/x-osf1elf b/contrib/gcc/config/i386/x-osf1elf
deleted file mode 100644
index 146738107f6e..000000000000
--- a/contrib/gcc/config/i386/x-osf1elf
+++ /dev/null
@@ -1,8 +0,0 @@
-# Defaults for OSF/1 1.3+
-CC = $(OLDCC)
-CLIB = -lld
-INSTALL = installbsd -c
-OLDCC = /usr/ccs/gcc/gcc
-X_CFLAGS = -static
-
-# FIXPROTO_DEFINES = -D_XOPEN_SOURCE
diff --git a/contrib/gcc/config/i386/x-osfrose b/contrib/gcc/config/i386/x-osfrose
deleted file mode 100644
index 2c5e3ba13c76..000000000000
--- a/contrib/gcc/config/i386/x-osfrose
+++ /dev/null
@@ -1,27 +0,0 @@
-# Define CC and OLDCC as the same, so that the tests:
-# if [ x"$(OLDCC)" = x"$(CC)" ] ...
-#
-# will succeed (if OLDCC != CC, it is assumed that GCC is
-# being used in secondary stage builds).
-
-BUILD =
-CC = $(OLDCC)
-CLIB = -lld
-X_CFLAGS = $(DEB_OPT) $(MSTATS) $(X_DEFINES)
-X_CFLAGS_NODEBUG = $(NO_DEBUG) $(MSTATS) $(OPT) $(PROFILE) $(X_DEFINES) $(XCFLAGS)
-XCFLAGS = $(SHLIB)
-CPP_ABORT = # -Dabort=fancy_abort
-CPPFLAGS = $(CPP_ABORT) $(SYSTEM_INCLUDES)
-DEB_OPT = $(OPT) $(DEBUG) $(PROFILE)
-DEBUG =
-DEBUG_COLLECT = # -DDEBUG
-CCLIBFLAGS = -O -DNO_HALF_PIC
-GCC_CFLAGS = $(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS) -B./ -DPOSIX -DNO_HALF_PIC
-LDFLAGS =
-MSTATS = # -mstats
-OLDCC = /usr/ccs/gcc/gcc
-OPT = -O
-PROFILE =
-SHLIB = -pic-none
-SYSTEM_INCLUDES = # -I${BUILD}/usr/include
-X_DEFINES = -Dvfork=fork
diff --git a/contrib/gcc/config/i386/x-sco b/contrib/gcc/config/i386/x-sco
deleted file mode 100644
index f7f14e9f7c09..000000000000
--- a/contrib/gcc/config/i386/x-sco
+++ /dev/null
@@ -1,7 +0,0 @@
-RANLIB = :
-RANLIB_TEST = false
-CC = rcc $(RCCFLAGS)
-OLDCC = rcc $(RCCFLAGS)
-RCCFLAGS = -Dunix -Di386 -DM_UNIX -DM_I386 -DNULL=0
-CCLIBFLAGS =
-CLIB = -lmalloc -lPW
diff --git a/contrib/gcc/config/i386/x-sco4 b/contrib/gcc/config/i386/x-sco4
deleted file mode 100644
index be6080f8893d..000000000000
--- a/contrib/gcc/config/i386/x-sco4
+++ /dev/null
@@ -1,10 +0,0 @@
-RANLIB = :
-RANLIB_TEST = false
-CC = rcc $(RCCFLAGS)
-OLDCC = rcc $(RCCFLAGS)
-RCCFLAGS = -Dunix -Di386 -DM_UNIX -DM_I386 -DNULL=0
-CCLIBFLAGS =
-CLIB = -lmalloc -lPW
-
-# See all the declarations.
-FIXPROTO_DEFINES = -D_XOPEN_SOURCE
diff --git a/contrib/gcc/config/i386/x-sco5 b/contrib/gcc/config/i386/x-sco5
deleted file mode 100644
index e13ed7425404..000000000000
--- a/contrib/gcc/config/i386/x-sco5
+++ /dev/null
@@ -1,10 +0,0 @@
-RANLIB = :
-RANLIB_TEST = false
-CC = cc
-OLDCC = cc
-CCLIBFLAGS =
-# We avoid the ALLOCA in -lPW becuase it gives us an evil index()
-ALLOCA = alloca.o
-
-# See all the declarations.
-FIXPROTO_DEFINES = -D_XOPEN_SOURCE -D_POSIX_C_SOURCE=2
diff --git a/contrib/gcc/config/i386/x-sysv3 b/contrib/gcc/config/i386/x-sysv3
deleted file mode 100644
index a1391df851c9..000000000000
--- a/contrib/gcc/config/i386/x-sysv3
+++ /dev/null
@@ -1 +0,0 @@
-CLIB=-lPW
diff --git a/contrib/gcc/config/i386/x-vsta b/contrib/gcc/config/i386/x-vsta
deleted file mode 100644
index e2279a4b59a7..000000000000
--- a/contrib/gcc/config/i386/x-vsta
+++ /dev/null
@@ -1 +0,0 @@
-CLIB=-lm
diff --git a/contrib/gcc/config/i386/xm-aix.h b/contrib/gcc/config/i386/xm-aix.h
deleted file mode 100644
index 4cbd36ef518f..000000000000
--- a/contrib/gcc/config/i386/xm-aix.h
+++ /dev/null
@@ -1,2 +0,0 @@
-#undef TRUE
-#undef FALSE
diff --git a/contrib/gcc/config/i386/xm-bsd386.h b/contrib/gcc/config/i386/xm-bsd386.h
deleted file mode 100644
index 6b8eee7db039..000000000000
--- a/contrib/gcc/config/i386/xm-bsd386.h
+++ /dev/null
@@ -1,3 +0,0 @@
-/* Configuration for GCC for Intel i386 running BSDI's BSD/386 as host. */
-
-#include "i386/xm-i386.h"
diff --git a/contrib/gcc/config/i386/xm-dos.h b/contrib/gcc/config/i386/xm-dos.h
deleted file mode 100644
index 4e1cb42c8c11..000000000000
--- a/contrib/gcc/config/i386/xm-dos.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Configuration for GNU C-compiler for Intel 80386 running DOS.
- Copyright (C) 1998, 1999 Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#include "i386/xm-i386.h"
-
-/* Use semicolons to separate elements of a path. */
-#define PATH_SEPARATOR ';'
-
-/* Use backslashs to separate levels of directory. */
-#define DIR_SEPARATOR '\\'
-#define DIR_SEPARATOR_2 '/'
-
-/* Allow checks for drive names. */
-#define HAVE_DOS_BASED_FILE_SYSTEM
-
-/* Suffix for executable file names. */
-#define EXECUTABLE_SUFFIX ".exe"
-
-#define MKTEMP_EACH_FILE 1
-
-#define NO_PRECOMPILES 1
diff --git a/contrib/gcc/config/i386/xm-freebsd.h b/contrib/gcc/config/i386/xm-freebsd.h
deleted file mode 100644
index 007a609f263f..000000000000
--- a/contrib/gcc/config/i386/xm-freebsd.h
+++ /dev/null
@@ -1,4 +0,0 @@
-/* Configuration for GCC for Intel i386 running FreeBSD as host. */
-
-#include <i386/xm-i386.h>
-#include <xm-freebsd.h>
diff --git a/contrib/gcc/config/i386/xm-gnu.h b/contrib/gcc/config/i386/xm-gnu.h
deleted file mode 100644
index 0b5985f9065c..000000000000
--- a/contrib/gcc/config/i386/xm-gnu.h
+++ /dev/null
@@ -1,5 +0,0 @@
-/* Configuration for GCC for Intel i386 running GNU as host. */
-
-#include <i386/xm-i386.h>
-#include <xm-gnu.h>
-
diff --git a/contrib/gcc/config/i386/xm-i386.h b/contrib/gcc/config/i386/xm-i386.h
deleted file mode 100644
index acc165767093..000000000000
--- a/contrib/gcc/config/i386/xm-i386.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* Configuration for GNU C-compiler for Intel 80386.
- Copyright (C) 1988, 1993 Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#ifndef i386
-#define i386
-#endif
-
-/* #defines that need visibility everywhere. */
-#define FALSE 0
-#define TRUE 1
-
-/* This describes the machine the compiler is hosted on. */
-#define HOST_BITS_PER_CHAR 8
-#define HOST_BITS_PER_SHORT 16
-#define HOST_BITS_PER_INT 32
-#define HOST_BITS_PER_LONG 32
-#define HOST_BITS_PER_LONGLONG 64
-
-/* Arguments to use with `exit'. */
-#define SUCCESS_EXIT_CODE 0
-#define FATAL_EXIT_CODE 33
-
-/* target machine dependencies.
- tm.h is a symbolic link to the actual target specific file. */
-
-#include "tm.h"
diff --git a/contrib/gcc/config/i386/xm-isc.h b/contrib/gcc/config/i386/xm-isc.h
deleted file mode 100644
index e686c5ec9d4d..000000000000
--- a/contrib/gcc/config/i386/xm-isc.h
+++ /dev/null
@@ -1,4 +0,0 @@
-#ifndef REAL_ARITHMETIC
-#define REAL_VALUE_ATOF(x, mode) strtod ((x), (char **)0)
-extern double strtod ();
-#endif
diff --git a/contrib/gcc/config/i386/xm-linux.h b/contrib/gcc/config/i386/xm-linux.h
deleted file mode 100644
index 713bf3b2817a..000000000000
--- a/contrib/gcc/config/i386/xm-linux.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/* Configuration for GCC for Intel i386 running Linux-based GNU systems.
- Copyright (C) 1993, 1994, 1995, 1997 Free Software Foundation, Inc.
- Contributed by H.J. Lu (hjl@nynexst.com)
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#include <i386/xm-i386.h>
-#include <xm-linux.h>
-
diff --git a/contrib/gcc/config/i386/xm-lynx.h b/contrib/gcc/config/i386/xm-lynx.h
deleted file mode 100644
index 359e41bbe242..000000000000
--- a/contrib/gcc/config/i386/xm-lynx.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Configuration for GNU C-compiler for i386 platforms running LynxOS.
- Copyright (C) 1995 Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#include <xm-lynx.h>
-
-/* This describes the machine the compiler is hosted on. */
-#define HOST_BITS_PER_CHAR 8
-#define HOST_BITS_PER_SHORT 16
-#define HOST_BITS_PER_INT 32
-#define HOST_BITS_PER_LONG 32
-#define HOST_BITS_PER_LONGLONG 64
-
-/* target machine dependencies.
- tm.h is a symbolic link to the actual target specific file. */
-
-#include "tm.h"
diff --git a/contrib/gcc/config/i386/xm-next.h b/contrib/gcc/config/i386/xm-next.h
deleted file mode 100644
index bf903281a0dc..000000000000
--- a/contrib/gcc/config/i386/xm-next.h
+++ /dev/null
@@ -1,5 +0,0 @@
-#include "i386/xm-i386.h"
-
-/* malloc does better with chunks the size of a page. */
-
-#define OBSTACK_CHUNK_SIZE (getpagesize ())
diff --git a/contrib/gcc/config/i386/xm-openbsd.h b/contrib/gcc/config/i386/xm-openbsd.h
deleted file mode 100644
index 1a79e83bc4a4..000000000000
--- a/contrib/gcc/config/i386/xm-openbsd.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/* Configuration file for i386 hosts running OpenBSD.
- Copyright (C) 1999 Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#include <xm-openbsd.h>
-#include <i386/xm-i386.h>
-
diff --git a/contrib/gcc/config/i386/xm-os2.h b/contrib/gcc/config/i386/xm-os2.h
deleted file mode 100644
index b8a5ad057a3a..000000000000
--- a/contrib/gcc/config/i386/xm-os2.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/* Configuration for GNU compiler
- for an Intel i386 or later processor running OS/2 2.x.
- Copyright (C) 1993, 1994, 1995, 1997, 1998, 1999 Free Software Foundation, Inc.
- Contributed by Samuel Figueroa (figueroa@apple.com)
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#ifndef OS2
-#define OS2
-#endif
-
-#ifdef __IBMC__
-#include <stdlib.h> /* this defines alloca */
-#define USG
-#define ONLY_INT_FIELDS
-#define USE_PROTOTYPES 1
-#define strcasecmp stricmp
-#define kill(a,b) raise(b)
-#define mktemp tmpnam
-#else
-#ifdef __EMX__
-#define EMX
-#define USG
-#define BSTRING
-#define HAVE_PUTENV
-#define HAVE_VPRINTF
-#define HAVE_STRERROR
-#define strcasecmp stricmp
-#else
-#define ____386BSD____
-int spawnv (int modeflag, char *path, char *argv[]);
-int spawnvp (int modeflag, char *path, char *argv[]);
-#endif /* __EMX__ */
-#endif /* __IBMC__ */
-
-#ifndef PATH_SEPARATOR
-#define PATH_SEPARATOR ';'
-#endif
-#ifndef DIR_SEPARATOR
-#define DIR_SEPARATOR '\\'
-#endif
-#ifndef DIR_SEPARATOR_2
-#define DIR_SEPARATOR_2 '/'
-#endif
-
-/* Allow handling of drive names. */
-#define HAVE_DOS_BASED_FILE_SYSTEM
-
-#define EXECUTABLE_SUFFIX ".exe"
-
-/* The EMX compiler uses regular .o files */
-#ifndef __EMX__
-#define OBJECT_SUFFIX ".obj"
-#endif
-
-/* This is required to make temporary file names unique on file
- systems which severely restrict the length of file names. */
-#define MKTEMP_EACH_FILE
-
-#include "i386/xm-i386.h"
diff --git a/contrib/gcc/config/i386/xm-osf.h b/contrib/gcc/config/i386/xm-osf.h
deleted file mode 100644
index 4cbd36ef518f..000000000000
--- a/contrib/gcc/config/i386/xm-osf.h
+++ /dev/null
@@ -1,2 +0,0 @@
-#undef TRUE
-#undef FALSE
diff --git a/contrib/gcc/config/i386/xm-osf1elf.h b/contrib/gcc/config/i386/xm-osf1elf.h
deleted file mode 100644
index 69ca9c14c007..000000000000
--- a/contrib/gcc/config/i386/xm-osf1elf.h
+++ /dev/null
@@ -1,6 +0,0 @@
-/* Configuration for GCC for Intel i386 running OSF/1 1.3. */
-
-#ifndef HZ
-#include <machine/machtime.h>
-#define HZ DEFAULT_CLK_TCK
-#endif
diff --git a/contrib/gcc/config/i386/xm-sco.h b/contrib/gcc/config/i386/xm-sco.h
deleted file mode 100644
index ad634499d30b..000000000000
--- a/contrib/gcc/config/i386/xm-sco.h
+++ /dev/null
@@ -1,13 +0,0 @@
-/* Configuration for GCC for Intel i386 running SCO. */
-
-/* Big buffers improve performance. */
-
-#define IO_BUFFER_SIZE (0x8000 - 1024)
-
-#ifndef __GNUC__
-/* The SCO compiler gets it wrong, and treats enumerated bitfields
- as signed quantities, making it impossible to use an 8-bit enum
- for compiling GNU C++. */
-#define ONLY_INT_FIELDS 1
-#define CODE_FIELD_BUG 1
-#endif
diff --git a/contrib/gcc/config/i386/xm-sco5.h b/contrib/gcc/config/i386/xm-sco5.h
deleted file mode 100644
index 6b22b1d549fd..000000000000
--- a/contrib/gcc/config/i386/xm-sco5.h
+++ /dev/null
@@ -1,7 +0,0 @@
-/* Configuration for GCC for Intel i386 running SCO. */
-
-/* Big buffers improve performance. */
-
-#define IO_BUFFER_SIZE (0x8000 - 1024)
-
-
diff --git a/contrib/gcc/config/i386/xm-sysv4.h b/contrib/gcc/config/i386/xm-sysv4.h
deleted file mode 100644
index 1365064a5a64..000000000000
--- a/contrib/gcc/config/i386/xm-sysv4.h
+++ /dev/null
@@ -1,5 +0,0 @@
-/* Configuration for GCC for Intel i386 running System V Release 4. */
-
-#ifdef __HIGHC__
-#include <alloca.h> /* for MetaWare High-C on NCR System 3000 */
-#endif
diff --git a/contrib/gcc/config/i386/xm-uwin.h b/contrib/gcc/config/i386/xm-uwin.h
deleted file mode 100644
index 2e1ecde0fa72..000000000000
--- a/contrib/gcc/config/i386/xm-uwin.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Configuration for GNU C-compiler for hosting on Windows32.
- using GNU tools and the Windows32 API Library.
- Copyright (C) 1999 Free Software Foundation, Inc.
- Contributed by Mumit Khan <khan@xraylith.wisc.edu>.
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#ifndef ONLY_INT_FIELD
-#define ONLY_INT_FIELDS 1
-#endif
-
-#ifndef USE_PROTOTYPES
-#define USE_PROTOTYPES 1
-#endif
-
-/* U/WIN system calls only support '/' */
-#undef DIR_SEPARATOR
-#define DIR_SEPARATOR '/'
-#undef EXECUTABLE_SUFFIX
-#define EXECUTABLE_SUFFIX ".exe"
-
-#undef PATH_SEPARATOR
-#define PATH_SEPARATOR ':'
-
diff --git a/contrib/gcc/config/i386/xm-winnt.h b/contrib/gcc/config/i386/xm-winnt.h
deleted file mode 100644
index d36d2cdb11ed..000000000000
--- a/contrib/gcc/config/i386/xm-winnt.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/* Configuration for GNU compiler
- for an Intel i386 or later processor running Windows NT 3.x.
- Copyright (C) 1994 Free Software Foundation, Inc.
- Contributed by Douglas B. Rupp (drupp@cs.washington.edu)
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#include "winnt/xm-winnt.h"
-#include "i386/xm-i386.h"
diff --git a/contrib/gcc/config/sparc/t-sp64 b/contrib/gcc/config/sparc/t-sp64
deleted file mode 100644
index 99acd5d54235..000000000000
--- a/contrib/gcc/config/sparc/t-sp64
+++ /dev/null
@@ -1,2 +0,0 @@
-LIBGCC1 =
-CROSS_LIBGCC1 =
diff --git a/contrib/gcc/config/sparc/t-sunos40 b/contrib/gcc/config/sparc/t-sunos40
deleted file mode 100644
index 3e10575eaea5..000000000000
--- a/contrib/gcc/config/sparc/t-sunos40
+++ /dev/null
@@ -1,7 +0,0 @@
-# SunOS 4.0.*
-# /bin/as doesn't recognize the v8 instructions, so we can't do a v8
-# multilib build.
-
-LIBGCC1 =
-CROSS_LIBGCC1 =
-LIBGCC1_TEST =
diff --git a/contrib/gcc/config/sparc/x-sysv4 b/contrib/gcc/config/sparc/x-sysv4
deleted file mode 100644
index 2a661e359993..000000000000
--- a/contrib/gcc/config/sparc/x-sysv4
+++ /dev/null
@@ -1,2 +0,0 @@
-X_CFLAGS=-DSVR4
-ALLOCA=alloca.o
diff --git a/contrib/gcc/config/sparc/xm-linux.h b/contrib/gcc/config/sparc/xm-linux.h
deleted file mode 100644
index 691c7d167847..000000000000
--- a/contrib/gcc/config/sparc/xm-linux.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Configuration for GCC for SPARC running Linux-based GNU systems.
- Copyright (C) 1996, 1997 Free Software Foundation, Inc.
- Contributed by Eddie C. Dost (ecd@skynet.be)
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#ifndef inhibit_libc
-#include <alloca.h>
-#include <stdlib.h>
-#include <string.h>
-#endif
diff --git a/contrib/gcc/config/sparc/xm-lynx.h b/contrib/gcc/config/sparc/xm-lynx.h
deleted file mode 100644
index 90fef8543b91..000000000000
--- a/contrib/gcc/config/sparc/xm-lynx.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Configuration for GNU C-compiler for sparc platforms running LynxOS.
- Copyright (C) 1995 Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#include <xm-lynx.h>
-
-/* This describes the machine the compiler is hosted on. */
-#define HOST_BITS_PER_CHAR 8
-#define HOST_BITS_PER_SHORT 16
-#define HOST_BITS_PER_INT 32
-#define HOST_BITS_PER_LONG 32
-#define HOST_BITS_PER_LONGLONG 64
-
-#define HOST_WORDS_BIG_ENDIAN 1
-
-/* Include <sys/wait.h> to define the exit status access macros. */
-#include <sys/types.h>
-#include <sys/wait.h>
-
-/* target machine dependencies.
- tm.h is a symbolic link to the actual target specific file. */
-
-#include "tm.h"
diff --git a/contrib/gcc/config/sparc/xm-openbsd.h b/contrib/gcc/config/sparc/xm-openbsd.h
deleted file mode 100644
index 2df7fb3e3639..000000000000
--- a/contrib/gcc/config/sparc/xm-openbsd.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/* Configuration file for an host running sparc OpenBSD.
- Copyright (C) 1999 Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#include <xm-openbsd.h>
-#include <sparc/xm-sparc.h>
-
diff --git a/contrib/gcc/config/sparc/xm-pbd.h b/contrib/gcc/config/sparc/xm-pbd.h
deleted file mode 100644
index 1c3f47590c79..000000000000
--- a/contrib/gcc/config/sparc/xm-pbd.h
+++ /dev/null
@@ -1,10 +0,0 @@
-/* Host environment for the tti "Unicom" PBB 68020 boards */
-
-#include "sparc/xm-sparc.h"
-
-#define USG
-
-#ifndef __GNUC__
-#define USE_C_ALLOCA
-#endif
-
diff --git a/contrib/gcc/config/sparc/xm-sol2.h b/contrib/gcc/config/sparc/xm-sol2.h
deleted file mode 100644
index 5613b086b572..000000000000
--- a/contrib/gcc/config/sparc/xm-sol2.h
+++ /dev/null
@@ -1,4 +0,0 @@
-/* If not compiled with GNU C, include the system's <alloca.h> header. */
-#ifndef __GNUC__
-#include <alloca.h>
-#endif
diff --git a/contrib/gcc/config/sparc/xm-sp64.h b/contrib/gcc/config/sparc/xm-sp64.h
deleted file mode 100644
index b673161282f4..000000000000
--- a/contrib/gcc/config/sparc/xm-sp64.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Configuration for GCC for Sparc v9 running 64-bit native.
- Copyright (C) 1997 Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#include <sparc/xm-sparc.h>
-
-/* This describes the machine the compiler is hosted on. */
-#if defined(__arch64__) || defined(__sparc_v9__) || defined(__sparcv9)
-#undef HOST_BITS_PER_LONG
-#define HOST_BITS_PER_LONG 64
-#endif
diff --git a/contrib/gcc/config/sparc/xm-sparc.h b/contrib/gcc/config/sparc/xm-sparc.h
deleted file mode 100644
index e553a0df0b25..000000000000
--- a/contrib/gcc/config/sparc/xm-sparc.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/* Configuration for GNU C-compiler for Sun Sparc.
- Copyright (C) 1988, 1993, 1995, 1997 Free Software Foundation, Inc.
- Contributed by Michael Tiemann (tiemann@cygnus.com).
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-
-/* #defines that need visibility everywhere. */
-#define FALSE 0
-#define TRUE 1
-
-/* This describes the machine the compiler is hosted on. */
-#define HOST_BITS_PER_CHAR 8
-#define HOST_BITS_PER_SHORT 16
-#define HOST_BITS_PER_INT 32
-#define HOST_BITS_PER_LONG 32
-#define HOST_BITS_PER_LONGLONG 64
-
-/* Doubles are stored in memory with the high order word first. This
- matters when cross-compiling. */
-#define HOST_WORDS_BIG_ENDIAN 1
-
-/* target machine dependencies.
- tm.h is a symbolic link to the actual target specific file. */
-#include "tm.h"
-
-/* Arguments to use with `exit'. */
-#define SUCCESS_EXIT_CODE 0
-#define FATAL_EXIT_CODE 33
-
-/* If compiled with Sun CC, the use of alloca requires this #include. */
-#ifndef __GNUC__
-#include "alloca.h"
-#endif
diff --git a/contrib/gcc/config/sparc/xm-sysv4-64.h b/contrib/gcc/config/sparc/xm-sysv4-64.h
deleted file mode 100644
index c506d22dd360..000000000000
--- a/contrib/gcc/config/sparc/xm-sysv4-64.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Configuration for GCC for Sparc v9 running 64-bit native.
- Copyright (C) 1998 Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#include <sparc/xm-sysv4.h>
-
-/* This describes the machine the compiler is hosted on. */
-#if defined(__arch64__) || defined(__sparc_v9__) || defined(__sparcv9)
-#undef HOST_BITS_PER_LONG
-#define HOST_BITS_PER_LONG 64
-#endif
diff --git a/contrib/gcc/config/sparc/xm-sysv4.h b/contrib/gcc/config/sparc/xm-sysv4.h
deleted file mode 100644
index 6e663d12cfa1..000000000000
--- a/contrib/gcc/config/sparc/xm-sysv4.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/* Configuration for GNU C-compiler for Sun Sparc running System V.4.
- Copyright (C) 1992, 1993, 1998 Free Software Foundation, Inc.
- Contributed by Ron Guilmette (rfg@netcom.com).
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-
-/* #defines that need visibility everywhere. */
-#define FALSE 0
-#define TRUE 1
-
-/* This describes the machine the compiler is hosted on. */
-#define HOST_BITS_PER_CHAR 8
-#define HOST_BITS_PER_SHORT 16
-#define HOST_BITS_PER_INT 32
-#define HOST_BITS_PER_LONG 32
-#define HOST_BITS_PER_LONGLONG 64
-
-/* Doubles are stored in memory with the high order word first. This
- matters when cross-compiling. */
-#define HOST_WORDS_BIG_ENDIAN 1
-
-/* target machine dependencies.
- tm.h is a symbolic link to the actual target specific file. */
-#include "tm.h"
-
-/* Arguments to use with `exit'. */
-#define SUCCESS_EXIT_CODE 0
-#define FATAL_EXIT_CODE 33
-
-#ifndef __GNUC__
-#define ONLY_INT_FIELDS
-#endif
diff --git a/contrib/gcc/config/x-linux b/contrib/gcc/config/x-linux
deleted file mode 100644
index a7c091799e89..000000000000
--- a/contrib/gcc/config/x-linux
+++ /dev/null
@@ -1,5 +0,0 @@
-# Don't run fixproto
-STMP_FIXPROTO =
-
-# Don't install "assert.h" in gcc. We use the one in glibc.
-INSTALL_ASSERT_H =
diff --git a/contrib/gcc/config/x-linux-aout b/contrib/gcc/config/x-linux-aout
deleted file mode 100644
index 36ae68acec54..000000000000
--- a/contrib/gcc/config/x-linux-aout
+++ /dev/null
@@ -1,14 +0,0 @@
-# It is defined in config/xm-linux.h.
-# X_CFLAGS = -DPOSIX
-
-# The following is needed when compiling stages 2 and 3 because gcc's
-# limits.h must be picked up before /usr/include/limits.h. This is because
-# each does an #include_next of the other if the other hasn't been included.
-# /usr/include/limits.h loses if it gets found first because /usr/include is
-# at the end of the search order. When a new version of gcc is released,
-# gcc's limits.h hasn't been installed yet and hence isn't found.
-
-# BOOT_CFLAGS = -O $(CFLAGS) -Iinclude
-
-# Don't run fixproto
-# STMP_FIXPROTO =
diff --git a/contrib/gcc/config/x-lynx b/contrib/gcc/config/x-lynx
deleted file mode 100644
index 0be03e453e12..000000000000
--- a/contrib/gcc/config/x-lynx
+++ /dev/null
@@ -1,6 +0,0 @@
-# /bin/cc is hopelessly broken, so we must use /bin/gcc instead.
-CC = $(OLDCC)
-OLDCC = /bin/gcc
-
-# /bin/sh is too buggy, so use /bin/bash instead.
-SHELL = /bin/bash
diff --git a/contrib/gcc/config/x-svr4 b/contrib/gcc/config/x-svr4
deleted file mode 100644
index 9c705434cc99..000000000000
--- a/contrib/gcc/config/x-svr4
+++ /dev/null
@@ -1,9 +0,0 @@
-# Some versions of SVR4 have an alloca in /usr/ucblib/libucb.a, and if we are
-# careful to link that in after libc we can use it, but since newer versions of
-# SVR4 are dropping libucb, it is better to just use the portable C version for
-# bootstrapping. Do this by defining ALLOCA.
-
-ALLOCA = alloca.o
-
-# See all the declarations.
-FIXPROTO_DEFINES = -D_XOPEN_SOURCE
diff --git a/contrib/gcc/config/xm-alloca.h b/contrib/gcc/config/xm-alloca.h
deleted file mode 100644
index 3dbdc37a1f0a..000000000000
--- a/contrib/gcc/config/xm-alloca.h
+++ /dev/null
@@ -1,4 +0,0 @@
-/* If not compiled with GNU C, use the portable alloca. */
-#ifndef __GNUC__
-#define USE_C_ALLOCA
-#endif
diff --git a/contrib/gcc/config/xm-freebsd.h b/contrib/gcc/config/xm-freebsd.h
deleted file mode 100644
index b71ff56ca107..000000000000
--- a/contrib/gcc/config/xm-freebsd.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/* Configuration for GNU C-compiler for hosts running FreeBSD.
- Copyright (C) 1994, 1995 Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* This file defines machine-independent things specific to a host
- running FreeBSD. This file should not be specified as $xm_file itself;
- instead $xm_file should be CPU/xm-freebsd.h, which should include both
- CPU/xm-CPU.h and this file xm-freebsd.h. */
diff --git a/contrib/gcc/config/xm-gnu.h b/contrib/gcc/config/xm-gnu.h
deleted file mode 100644
index 64e8e2fa8171..000000000000
--- a/contrib/gcc/config/xm-gnu.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Configuration for GNU C-compiler for hosts running GNU.
- Copyright (C) 1994, 1995, 1997 Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* This file defines machine-independent things specific to a host
- running GNU. This file should not be specified as $xm_file itself;
- instead $xm_file should be CPU/xm-gnu.h, which should include both
- CPU/xm-CPU.h and this file xm-gnu.h. */
-
-#define POSIX /* GNU complies to POSIX.1. */
-
-#ifndef inhibit_libc
-/* Get a definition of O_RDONLY; some of the GCC files don't include this
- properly and will define it themselves to be zero. */
-#include <fcntl.h>
-#endif
diff --git a/contrib/gcc/config/xm-interix.h b/contrib/gcc/config/xm-interix.h
deleted file mode 100644
index 756fb5d465f2..000000000000
--- a/contrib/gcc/config/xm-interix.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/* Configuration for GNU compiler for processor running Interix
- Copyright (C) 1993, 1995, 1999 Free Software Foundation, Inc.
- Donn Terry, Softway Systems, Inc,
- from code
- Contributed by Douglas B. Rupp (drupp@cs.washington.edu)
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#ifndef USG
-#define USG 1
-#endif
-
-#ifndef ONLY_INT_FIELDS
-#ifndef __GNUC__
-#define ONLY_INT_FIELDS 1
-#endif
-#endif
-
-#ifndef USE_PROTOTYPES
-#define USE_PROTOTYPES 1
-#endif
-
-/* If not compiled with GNU C, use the portable alloca. */
-#ifndef __GNUC__
-#define USE_C_ALLOCA 1
-#endif
-
-#define NO_SYS_SIGLIST 1
-
-/* Our strategy for finding global constructors is a bit different, although
- not a lot. */
-#define DO_GLOBAL_CTORS_BODY \
-do { \
- int i; \
- unsigned long nptrs; \
- func_ptr *p; \
- asm( \
- " .section .ctor_head, \"rw\"\n" \
- "1:\n" \
- " .text \n" \
- ASM_LOAD_ADDR(1b,%0) \
- : "=r" (p) : : "cc"); \
- for (nptrs = 0; p[nptrs] != 0; nptrs++); \
- for (i = nptrs-1; i >= 0; i--) \
- p[i] (); \
-} while (0)
-
-#define DO_GLOBAL_DTORS_BODY \
-do { \
- func_ptr *p; \
- asm( \
- " .section .dtor_head, \"rw\"\n" \
- "1:\n" \
- " .text \n" \
- ASM_LOAD_ADDR(1b,%0) \
- : "=r" (p) : : "cc"); \
- while (*p) \
- { \
- p++; \
- (*(p-1)) (); \
- } \
-} while (0)
diff --git a/contrib/gcc/config/xm-linux.h b/contrib/gcc/config/xm-linux.h
deleted file mode 100644
index 2cffdb7fab61..000000000000
--- a/contrib/gcc/config/xm-linux.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Configuration for GCC for Intel i386 running Linux-based GNU systems.
- Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
- Contributed by H.J. Lu (hjl@nynexst.com)
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#undef HAVE_ATEXIT
-#define HAVE_ATEXIT
-
-#undef POSIX
-#define POSIX
-
-/* We do have one, but I'd like to use the one come with gcc since
- we have been doing that for a long time with USG defined. H.J. */
-#undef HAVE_STAB_H
-
-#undef BSTRING
-#define BSTRING
diff --git a/contrib/gcc/config/xm-lynx.h b/contrib/gcc/config/xm-lynx.h
deleted file mode 100644
index 009f8445eab7..000000000000
--- a/contrib/gcc/config/xm-lynx.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/* Configuration for GNU C-compiler for Lynx.
- Copyright (C) 1993, 1995 Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* This file defines machine-independent things specific to a host
- running Lynx. This file should not be specified as $xm_file itself;
- instead $xm_file should be CPU/xm-lynx.h, which should include this one. */
-
-/* #defines that need visibility everywhere. */
-#define FALSE 0
-#define TRUE 1
-
-/* Arguments to use with `exit'. */
-#define SUCCESS_EXIT_CODE 0
-#define FATAL_EXIT_CODE 33
-
-/* Lynx has no vfork system call. */
-#define vfork fork
-
-/* Lynx has a non-standard mktemp function. */
-/* ??? This is simpler than creating YATM: Yet Another Target Macro. */
-#define mktemp lynx_mktemp
-
-#define lynx_mktemp(template) \
-do { \
- int pid = getpid (); \
- char *t = template; \
- char *p; \
- p = t + strlen (t); \
- while (*--p == 'X') \
- { \
- *p = (pid % 10) + '0'; \
- pid /= 10; \
- } \
-} while (0)
diff --git a/contrib/gcc/config/xm-openbsd.h b/contrib/gcc/config/xm-openbsd.h
deleted file mode 100644
index 74a842184c37..000000000000
--- a/contrib/gcc/config/xm-openbsd.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Configuration fragment for hosts running a version of OpenBSD.
- Copyright (C) 1999 Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-/* This file gets included by all architectures. It holds stuff
- that ought to be defined when hosting a compiler on an OpenBSD
- machine, independently of the architecture. It's included by
- ${cpu_type}/xm-openbsd.h, not included directly. */
-
-/* OpenBSD is trying to be POSIX-compliant, to the point of fixing
- problems that may occur with gcc's interpretation. */
-#undef POSIX
-#define POSIX
-
-/* Ensure we get gnu C's defaults. */
-#ifdef __GNUC__
-#define alloca __builtin_alloca
-#endif
-
-
diff --git a/contrib/gcc/config/xm-siglist.h b/contrib/gcc/config/xm-siglist.h
deleted file mode 100644
index d6133d6a194a..000000000000
--- a/contrib/gcc/config/xm-siglist.h
+++ /dev/null
@@ -1,6 +0,0 @@
-/* Some systems provide no sys_siglist, but do offer the same data under
- another name. */
-
-#define sys_siglist _sys_siglist
-#undef SYS_SIGLIST_DECLARED
-#define SYS_SIGLIST_DECLARED
diff --git a/contrib/gcc/config/xm-std32.h b/contrib/gcc/config/xm-std32.h
deleted file mode 100644
index c52782e9741c..000000000000
--- a/contrib/gcc/config/xm-std32.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Configuration for GNU C-compiler for standard 32-bit host machine.
- Copyright (C) 1997 Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* #defines that need visibility everywhere. */
-#define FALSE 0
-#define TRUE 1
-
-/* This describes the machine the compiler is hosted on. */
-#define HOST_BITS_PER_CHAR 8
-#define HOST_BITS_PER_SHORT 16
-#define HOST_BITS_PER_INT 32
-#define HOST_BITS_PER_LONG 32
-#define HOST_BITS_PER_LONGLONG 64
-
-/* Arguments to use with `exit'. */
-#define SUCCESS_EXIT_CODE 0
-#define FATAL_EXIT_CODE 33
diff --git a/contrib/gcc/config/xm-svr3.h b/contrib/gcc/config/xm-svr3.h
deleted file mode 100644
index 6f252505252d..000000000000
--- a/contrib/gcc/config/xm-svr3.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Configuration for GNU C-compiler for hosts running System V Release 3
- Copyright (C) 1991, 1993, 1996 Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#define USG
-
-#ifndef SVR3
-#define SVR3
-#endif
diff --git a/contrib/gcc/config/xm-svr4.h b/contrib/gcc/config/xm-svr4.h
deleted file mode 100644
index 8534aaa75a12..000000000000
--- a/contrib/gcc/config/xm-svr4.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Configuration for GNU C-compiler for hosts running System V Release 4
- Copyright (C) 1988, 1997 Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#define USG
-
-#define POSIX
-
-/* SVR4 provides no sys_siglist,
- but does offer the same data under another name. */
-#define sys_siglist _sys_siglist
-#undef SYS_SIGLIST_DECLARED
-#define SYS_SIGLIST_DECLARED
diff --git a/contrib/gcc/configure.lang b/contrib/gcc/configure.lang
deleted file mode 100644
index d96b6d8d5314..000000000000
--- a/contrib/gcc/configure.lang
+++ /dev/null
@@ -1,233 +0,0 @@
-# configure.lang for GNU CC
-# This script is run by configure for configuration of language
-# subdirectories which conform to the old GCC configure mechanism
-# for such subdirectories.
-
-# Copyright (C) 1997, 1998 Free Software Foundation, Inc.
-
-#This file is part of GNU CC.
-
-#GNU CC 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.
-
-#GNU CC is distributed in the hope that it will be useful,
-#but WITHOUT ANY WARRANTY; without even the implied warranty of
-#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-#GNU General Public License for more details.
-
-#You should have received a copy of the GNU General Public License
-#along with GNU CC; see the file COPYING. If not, write to
-#the Free Software Foundation, 59 Temple Place - Suite 330,
-#Boston, MA 02111-1307, USA.
-
-savesrcdir=$srcdir
-
-for subdir in . $oldstyle_subdirs
-do
- # We only want to do this in language subdirs, but we have to handle
- # the case of $oldstyle_subdirs = "".
- if [ $subdir = . ]
- then
- continue
- fi
-
- oldsrcdir=$savesrcdir
-
- # Re-adjust the path
- case $oldsrcdir in
- /*)
- srcdir=$oldsrcdir/$subdir
- ;;
- *)
- oldsrcdir=../${oldsrcdir}
- srcdir=$oldsrcdir/$subdir
- ;;
- esac
- mainsrcdir=$oldsrcdir
- STARTDIR=`pwd`
- test -d $subdir || mkdir $subdir
- cd $subdir
-
- # Create Makefile.tem from Makefile.in.
- # Make it set VPATH if necessary so that the sources are found.
- # Also change its value of srcdir.
- # Also create a .gdbinit file which runs the one in srcdir
- # and tells GDB to look there for source files.
- case $srcdir in
- . | ./$subdir | .././$subdir)
- rm -f Makefile.tem
- cp Makefile.in Makefile.tem
- chmod +w Makefile.tem
- ;;
- *)
- rm -f Makefile.tem
- echo "VPATH = ${srcdir}" \
- | cat - ${srcdir}/Makefile.in \
- | sed "s@^srcdir = \.@srcdir = ${srcdir}@" > Makefile.tem
- rm -f .gdbinit
- echo "dir ." > .gdbinit
- echo "dir ${srcdir}" >> .gdbinit
- echo "dir ${mainsrcdir}" >> .gdbinit
- if [ x$gdb_needs_out_file_path = xyes ]
- then
- echo "dir ${mainsrcdir}/config/"`dirname ${out_file}` >> .gdbinit
- fi
- echo "source ${mainsrcdir}/.gdbinit" >> .gdbinit
- ;;
- esac
-
- # Conditionalize the makefile for this host machine.
- rm -f Makefile.xx Makefile.ll
- merged_frags=
- for f in .. ${host_xmake_file}
- do
- if [ -f ${mainsrcdir}/config/$f ]
- then
- cat ${mainsrcdir}/config/$f >> Makefile.ll
- if [ x"${merged_frags}" != x ]
- then
- merged_frags="${merged_frags} and "
- fi
- merged_frags="${merged_frags}${f}"
- fi
- done
- if [ x"${merged_frags}" != x ]
- then
- sed -e "/####host/ r Makefile.ll" Makefile.tem > Makefile.xx
- echo "Merged ${merged_frags}."
- rm -f Makefile.tem
- mv Makefile.xx Makefile.tem
- rm -f Makefile.ll
- fi
-
- # Add a definition for MAKE if system wants one.
- case "$SET_MAKE" in
- ?*)
- rm -f Makefile.xx
- (echo "$SET_MAKE"; cat Makefile.tem) >Makefile.xx
- rm -f Makefile.tem
- mv Makefile.xx Makefile.tem
- esac
-
- # Add a definition for INSTALL if system wants one.
- # This substitutes for lots of x-* files.
- if [ x$build_broken_install = x ]
- then true
- else
- rm -f Makefile.xx
- abssrcdir=`cd ${srcdir}; pwd`
- sed "s|^INSTALL = .*|${INSTALL}|" Makefile.tem > Makefile.xx
- rm -f Makefile.tem
- mv Makefile.xx Makefile.tem
- fi
-
- # If using -program-transform-name, override the installation names.
- if [ "x${program_transform_set}" = "xyes" ] ; then
- sed -e "s/^program_transform_name[ ]*=.*$/program_transform_name =
-$program_transform_name/" \
- -e "s/^program_transform_cross_name[
-]*=.*$/program_transform_cross_name = $program_transform_name/" \
- Makefile.tem > Makefile.xx
- rm -f Makefile.tem
- mv Makefile.xx Makefile.tem
- fi
-
- # Conditionalize the makefile for this target machine.
- rm -f Makefile.xx Makefile.ll
- merged_frags=
- for f in .. ${tmake_file}
- do
- if [ -f ${mainsrcdir}/config/$f ]
- then
- cat ${mainsrcdir}/config/$f >> Makefile.ll
- if [ x"${merged_frags}" != x ]
- then
- merged_frags="${merged_frags} and "
- fi
- merged_frags="${merged_frags}$f"
- fi
- done
- if [ x"${merged_frags}" != x ]
- then
- sed -e "/####target/ r Makefile.ll" Makefile.tem > Makefile.xx
- echo "Merged ${merged_frags}."
- rm -f Makefile.tem
- mv Makefile.xx Makefile.tem
- rm -f Makefile.ll
- fi
-
- # If the host supports
- # symlinks, point stage[123] at ../stage[123] so bootstrapping and the
- # installation procedure can still use CC="stage1/xgcc -Bstage1/".
- # If the host doesn't support symlinks, FLAGS_TO_PASS has been
- # modified to solve the problem there.
- for t in stage1 stage2 stage3 stage4 include
- do
- rm -f $t
- $symbolic_link ../$t $t 2>/dev/null
- done
-
- # Remove all formfeeds, since some Makes get confused by them.
- # Also arrange to give the variables `target', `target_alias',
- # `host_xmake_file', `tmake_file', `prefix', `local_prefix',
- # `exec_prefix', `INSTALL_HEADERS_DIR', `exeext'
- # values in the Makefile from the values they have in this script.
- rm -f Makefile.xx
- # Create an empty Makefile.sed first, to work around a Nextstep 3.3 bug.
- echo 's| ||' > Makefile.sed
- rm Makefile.sed
- echo 's| ||' > Makefile.sed
- echo "s|^target=.*$|target=${target}|" >> Makefile.sed
- echo "s|^target_alias=.*$|target_alias=${target_alias}|" >> Makefile.sed
- echo "s|^xmake_file=.*$|xmake_file=${dep_host_xmake_file}|" >> Makefile.sed
- echo "s|^tmake_file=.*$|tmake_file=${dep_tmake_file}|" >> Makefile.sed
- echo "s|^version=.*$|version=${version}|" >> Makefile.sed
- echo "s|^GCC_THREAD_FILE=.*$|GCC_THREAD_FILE=${thread_file}|" >> Makefile.sed
- echo "s|^prefix[ ]*=.*|prefix = $prefix|" >> Makefile.sed
- echo "s|^local_prefix[ ]*=.*|local_prefix = $local_prefix|" >> Makefile.sed
- echo "s|^exec_prefix[ ]*=.*|exec_prefix = $exec_prefix|" >> Makefile.sed
- echo "s|^INSTALL_HEADERS_DIR[ ]*=.*$|INSTALL_HEADERS_DIR = ${build_install_headers_dir}|" >> Makefile.sed
- echo "s|^exeext[ ]*=.*$|exeext = ${build_exeext}|" >> Makefile.sed
- sed -f Makefile.sed Makefile.tem > Makefile.xx
- rm -f Makefile.tem Makefile.sed
- mv Makefile.xx Makefile.tem
-
- # Install Makefile for real, after making final changes.
- # Define macro CROSS_COMPILE in compilation
- # if this is a cross-compiler.
- # Also use all.cross instead of all.internal
- # and add cross-make to Makefile.
- if [ x$host != x$target ]
- then
- rm -f Makefile.xx
- echo "CROSS=-DCROSS_COMPILE" > Makefile.xx
- sed -e "/####cross/ r ${mainsrcdir}/cross-make" Makefile.tem >> Makefile.xx
- rm -f Makefile.tem
- mv Makefile.xx Makefile.tem
- fi
-
- # When building gcc with a cross-compiler, we need to fix a few things.
- # This must come after cross-make as we want all.build to override
- # all.cross.
- if [ x$build != x$host ]
- then
- rm -f Makefile.xx
- echo "build= $build" > Makefile.xx
- echo "host= $host" >> Makefile.xx
- sed -e "s|objc-runtime$||" \
- -e "/####build/ r ${mainsrcdir}/build-make" Makefile.tem >> Makefile.xx
- rm -f Makefile.tem
- mv Makefile.xx Makefile.tem
- fi
-
- rm -f Makefile
- mv Makefile.tem Makefile
- echo "Created \`$subdir/Makefile'."
-
- cd $STARTDIR
-done # end of current-dir SUBDIRS loop
-
-# Restore this, remember we're invoked with `.'.
-srcdir=$savesrcdir
diff --git a/contrib/gcc/cp/Makefile.in b/contrib/gcc/cp/Makefile.in
deleted file mode 100644
index 1a5b32c40c8c..000000000000
--- a/contrib/gcc/cp/Makefile.in
+++ /dev/null
@@ -1,324 +0,0 @@
-# Makefile for GNU C++ compiler.
-# Copyright (C) 1987, 88, 90-5, 1998, 1999 Free Software Foundation, Inc.
-
-#This file is part of GNU CC.
-
-#GNU CC 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.
-
-#GNU CC is distributed in the hope that it will be useful,
-#but WITHOUT ANY WARRANTY; without even the implied warranty of
-#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-#GNU General Public License for more details.
-
-#You should have received a copy of the GNU General Public License
-#along with GNU CC; see the file COPYING. If not, write to
-#the Free Software Foundation, 59 Temple Place - Suite 330,
-#Boston, MA 02111-1307, USA.
-
-# The makefile built from this file lives in the language subdirectory.
-# Its purpose is to provide support for:
-#
-# 1) recursion where necessary, and only then (building .o's), and
-# 2) building and debugging cc1 from the language subdirectory, and
-# 3) nothing else.
-#
-# The parent makefile handles all other chores, with help from the
-# language makefile fragment, of course.
-#
-# The targets for external use are:
-# all, TAGS, ???mostlyclean, ???clean.
-
-# Suppress smart makes who think they know how to automake Yacc files
-.y.c:
-
-# It defines the c++ interface name. It should be changed when the
-# c++ interface is changed.
-INTERFACE = 2
-
-# Variables that exist for you to override.
-# See below for how to change them for certain systems.
-
-ALLOCA =
-
-# Various ways of specifying flags for compilations:
-# CFLAGS is for the user to override to, e.g., do a bootstrap with -O2.
-# BOOT_CFLAGS is the value of CFLAGS to pass
-# to the stage2 and stage3 compilations
-# XCFLAGS is used for most compilations but not when using the GCC just built.
-XCFLAGS =
-CFLAGS = -g
-BOOT_CFLAGS = -O $(CFLAGS)
-# These exists to be overridden by the x-* and t-* files, respectively.
-X_CFLAGS =
-T_CFLAGS =
-
-X_CPPFLAGS =
-T_CPPFLAGS =
-
-CC = @CC@
-BISON = `if [ -f ../../bison/bison ] ; then echo ../../bison/bison -L $(srcdir)/../../bison/ ; else echo bison ; fi`
-BISONFLAGS =
-LEX = `if [ -f ../../flex/flex ] ; then echo ../../flex/flex ; else echo flex ; fi`
-LEXFLAGS =
-AR = ar
-AR_FLAGS = rc
-SHELL = /bin/sh
-MAKEINFO = makeinfo
-TEXI2DVI = texi2dvi
-
-# Define this as & to perform parallel make on a Sequent.
-# Note that this has some bugs, and it seems currently necessary
-# to compile all the gen* files first by hand to avoid erroneous results.
-P =
-
-# This is used in the definition of SUBDIR_USE_ALLOCA.
-# ??? Perhaps it would be better if it just looked for *gcc*.
-OLDCC = cc
-
-# This is used instead of ALL_CFLAGS when compiling with GCC_FOR_TARGET.
-# It omits XCFLAGS, and specifies -B./.
-# It also specifies -B$(tooldir)/ to find as and ld for a cross compiler.
-GCC_CFLAGS=$(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS)
-
-# Tools to use when building a cross-compiler.
-# These are used because `configure' appends `cross-make'
-# to the makefile when making a cross-compiler.
-
-# We don't use cross-make. Instead we use the tools
-# from the build tree, if they are available.
-# program_transform_name and objdir are set by configure.in.
-program_transform_name =
-objdir = .
-
-target=@target@
-xmake_file=@dep_host_xmake_file@
-tmake_file=@dep_tmake_file@
-#version=`sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/' < $(srcdir)/version.c`
-#mainversion=`sed -e 's/.*\"\([0-9]*\.[0-9]*\).*/\1/' < $(srcdir)/version.c`
-
-# Directory where sources are, from where we are.
-srcdir = @srcdir@
-VPATH = @srcdir@
-
-# Additional system libraries to link with.
-CLIB=
-
-# Top build directory, relative to here.
-top_builddir = ..
-
-# Internationalization library.
-INTLLIBS = @INTLLIBS@
-
-# Change this to a null string if obstacks are installed in the
-# system library.
-OBSTACK=obstack.o
-
-# Choose the real default target.
-ALL=all
-
-# End of variables for you to override.
-
-# Definition of `all' is here so that new rules inserted by sed
-# do not specify the default target.
-all: all.indirect
-
-# This tells GNU Make version 3 not to put all variables in the environment.
-.NOEXPORT:
-
-# sed inserts variable overrides after the following line.
-####target overrides
-@target_overrides@
-####host overrides
-@host_overrides@
-####cross overrides
-@cross_defines@
-@cross_overrides@
-####build overrides
-@build_overrides@
-#
-# Now figure out from those variables how to compile and link.
-
-all.indirect: Makefile ../cc1plus$(exeext)
-
-# IN_GCC tells obstack.h that we are using gcc's <stddef.h> file.
-INTERNAL_CFLAGS = $(CROSS) -DIN_GCC @extra_c_flags@
-
-# This is the variable actually used when we compile.
-ALL_CFLAGS = $(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS) $(XCFLAGS)
-
-# Likewise.
-ALL_CPPFLAGS = $(CPPFLAGS) $(X_CPPFLAGS) $(T_CPPFLAGS)
-
-# Even if ALLOCA is set, don't use it if compiling with GCC.
-
-SUBDIR_OBSTACK = `if [ x$(OBSTACK) != x ]; then echo ../$(OBSTACK); else true; fi`
-SUBDIR_USE_ALLOCA = `case "${CC}" in "${OLDCC}") if [ x$(ALLOCA) != x ]; then echo ../$(ALLOCA); else true; fi ;; esac`
-SUBDIR_MALLOC = `if [ x$(MALLOC) != x ]; then echo ../$(MALLOC); else true; fi`
-
-# How to link with both our special library facilities
-# and the system's installed libraries.
-LIBS = $(SUBDIR_OBSTACK) $(SUBDIR_USE_ALLOCA) $(SUBDIR_MALLOC) \
- $(INTLLIBS) $(CLIB)
-
-# Specify the directories to be searched for header files.
-# Both . and srcdir are used, in that order,
-# so that tm.h and config.h will be found in the compilation
-# subdirectory rather than in the source directory.
-INCLUDES = -I. -I.. -I$(srcdir) -I$(srcdir)/.. -I$(srcdir)/../config -I$(srcdir)/../../include
-
-# Always use -I$(srcdir)/config when compiling.
-.c.o:
- $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
-
-# The only suffixes we want for implicit rules are .c and .o.
-.SUFFIXES:
-.SUFFIXES: .c .o
-
-# This tells GNU make version 3 not to export all the variables
-# defined in this file into the environment.
-.NOEXPORT:
-#
-# Lists of files for various purposes.
-
-# Language-specific object files for g++
-
-CXX_OBJS = call.o decl.o errfn.o expr.o pt.o sig.o typeck2.o \
- class.o decl2.o error.o lex.o parse.o ptree.o rtti.o spew.o typeck.o cvt.o \
- except.o friend.o init.o method.o search.o semantics.o tree.o xref.o \
- repo.o @extra_cxx_objs@
-
-# Language-independent object files.
-OBJS = `cat ../stamp-objlist` ../c-common.o ../c-pragma.o
-OBJDEPS = ../stamp-objlist ../c-common.o ../c-pragma.o
-
-compiler: ../cc1plus$(exeext)
-../cc1plus$(exeext): $(P) $(OBJDEPS) $(CXX_OBJS) $(LIBDEPS)
- $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(CXX_OBJS) $(LIBS)
-
-Makefile: $(srcdir)/Makefile.in $(srcdir)/../configure
- cd ..; $(SHELL) config.status
-
-native: config.status ../cc1plus$(exeext)
-#
-# Compiling object files from source files.
-
-# Note that dependencies on obstack.h are not written
-# because that file is not part of GCC.
-
-# C++ language specific files.
-
-RTL_H = $(srcdir)/../rtl.h $(srcdir)/../rtl.def \
- $(srcdir)/../machmode.h $(srcdir)/../machmode.def
-TREE_H = $(srcdir)/../tree.h $(srcdir)/../real.h $(srcdir)/../tree.def \
- $(srcdir)/../machmode.h $(srcdir)/../machmode.def
-CXX_TREE_H = $(TREE_H) cp-tree.h cp-tree.def
-PARSE_H = $(srcdir)/parse.h
-PARSE_C = $(srcdir)/parse.c
-EXPR_H = $(srcdir)/../expr.h ../insn-codes.h
-
-parse.o : $(PARSE_C) $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h lex.h \
- $(srcdir)/../except.h $(srcdir)/../output.h $(srcdir)/../system.h \
- $(srcdir)/../toplev.h
- $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(BIG_SWITCHFLAG) \
- `echo $(PARSE_C) | sed 's,^\./,,'`
-
-CONFLICTS = expect 30 shift/reduce conflicts and 42 reduce/reduce conflicts.
-$(PARSE_H) : $(PARSE_C)
-$(PARSE_C) : $(srcdir)/parse.y
- @echo $(CONFLICTS)
- cd $(srcdir); $(BISON) $(BISONFLAGS) -d -o parse.c parse.y
- cd $(srcdir); grep '^#define[ ]*YYEMPTY' parse.c >>parse.h
-#$(PARSE_C) $(PARSE_H) : stamp-parse ; @true
-#stamp-parse: $(srcdir)/parse.y
-# @echo $(CONFLICTS)
-# $(BISON) $(BISONFLAGS) -d $(srcdir)/parse.y
-# grep '^#define[ ]*YYEMPTY' y.tab.c >>y.tab.h
-# $(srcdir)/../move-if-change y.tab.c $(PARSE_C)
-# $(srcdir)/../move-if-change y.tab.h $(PARSE_H)
-# cp $(PARSE_C) y.tab.c
-# touch stamp-parse
-
-# We used to try to protect people from having to rerun gperf. But,
-# the C front-end already requires this if c-parse.gperf is changed,
-# so we should be consistent.
-$(srcdir)/hash.h: $(srcdir)/gxx.gperf
- gperf -L C -F ', 0, 0' -p -j1 -g -o -t -N is_reserved_word \
- '-k1,4,7,$$' $(srcdir)/gxx.gperf >$(srcdir)/hash.h
-
-spew.o : spew.c $(CONFIG_H) $(CXX_TREE_H) $(PARSE_H) $(srcdir)/../flags.h \
- lex.h $(srcdir)/../system.h $(srcdir)/../toplev.h
-lex.o : lex.c $(CONFIG_H) $(CXX_TREE_H) \
- $(PARSE_H) input.c $(srcdir)/../flags.h hash.h lex.h \
- $(srcdir)/../c-pragma.h $(srcdir)/../system.h $(srcdir)/../toplev.h \
- $(srcdir)/../output.h $(srcdir)/../mbchar.h
-decl.o : decl.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h \
- lex.h decl.h $(srcdir)/../stack.h $(srcdir)/../output.h \
- $(srcdir)/../except.h $(srcdir)/../system.h $(srcdir)/../toplev.h \
- $(srcdir)/../hash.h
-decl2.o : decl2.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h \
- lex.h decl.h $(EXPR_H) $(srcdir)/../except.h \
- $(srcdir)/../output.h $(srcdir)/../except.h $(srcdir)/../system.h \
- $(srcdir)/../toplev.h $(srcdir)/../dwarf2out.h $(srcdir)/../dwarfout.h \
- $(srcdir)/../../include/splay-tree.h $(srcdir)/../varray.h
-typeck2.o : typeck2.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h \
- $(srcdir)/../system.h $(srcdir)/../toplev.h
-typeck.o : typeck.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h $(RTL_H) \
- $(EXPR_H) $(srcdir)/../system.h $(srcdir)/../toplev.h
-class.o : class.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h \
- $(srcdir)/../system.h $(srcdir)/../toplev.h \
- $(srcdir)/../../include/splay-tree.h
-call.o : call.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h \
- $(srcdir)/../system.h $(srcdir)/../toplev.h
-friend.o : friend.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h $(RTL_H) \
- $(srcdir)/../system.h $(srcdir)/../toplev.h
-init.o : init.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h $(RTL_H) \
- $(EXPR_H) $(srcdir)/../system.h $(srcdir)/../toplev.h
-method.o : method.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../system.h \
- $(srcdir)/../toplev.h
-cvt.o : cvt.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../system.h decl.h \
- $(srcdir)/../flags.h $(srcdir)/../toplev.h $(srcdir)/../convert.h
-search.o : search.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../stack.h \
- $(srcdir)/../flags.h $(srcdir)/../system.h $(srcdir)/../toplev.h \
- $(srcdir)/../varray.h
-tree.o : tree.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h \
- $(srcdir)/../system.h $(srcdir)/../toplev.h
-ptree.o : ptree.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../system.h
-rtti.o : rtti.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h \
- $(srcdir)/../system.h $(srcdir)/../toplev.h
-except.o : except.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h $(RTL_H) \
- $(srcdir)/../except.h $(srcdir)/../system.h $(srcdir)/../toplev.h
-expr.o : expr.c $(CONFIG_H) $(CXX_TREE_H) $(RTL_H) $(srcdir)/../flags.h \
- $(EXPR_H) $(srcdir)/../system.h $(srcdir)/../toplev.h
-xref.o : xref.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../input.h \
- $(srcdir)/../system.h $(srcdir)/../toplev.h
-pt.o : pt.c $(CONFIG_H) $(CXX_TREE_H) decl.h $(PARSE_H) lex.h \
- $(srcdir)/../system.h $(srcdir)/../toplev.h
-error.o : error.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../system.h \
- $(srcdir)/../toplev.h
-errfn.o : errfn.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../system.h \
- $(srcdir)/../toplev.h
-sig.o : sig.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h \
- $(srcdir)/../system.h $(srcdir)/../toplev.h
-repo.o : repo.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../system.h \
- $(srcdir)/../toplev.h
-semantics.o: semantics.c $(CONFIG_H) $(CXX_TREE_H) lex.h \
- $(srcdir)/../except.h $(srcdir)/../system.h $(srcdir)/../toplev.h
-
-
-#
-# These exist for maintenance purposes.
-
-# Update the tags table.
-TAGS: force
- cd $(srcdir) ; \
- etags *.c *.h ; \
- echo 'l' | tr 'l' '\f' >> TAGS ; \
- echo 'parse.y,0' >> TAGS ; \
- etags -a ../*.h ../*.c;
-
-.PHONY: TAGS
-
-force:
diff --git a/contrib/gcc/cp/errfn.c b/contrib/gcc/cp/errfn.c
deleted file mode 100644
index b5d3eeccd5a9..000000000000
--- a/contrib/gcc/cp/errfn.c
+++ /dev/null
@@ -1,352 +0,0 @@
-/* Provide a call-back mechanism for handling error output.
- Copyright (C) 1993, 94-98, 1999 Free Software Foundation, Inc.
- Contributed by Jason Merrill (jason@cygnus.com)
-
- This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#include "config.h"
-#include "system.h"
-#include "tree.h"
-#include "cp-tree.h"
-#include "toplev.h"
-
-/* cp_printer is the type of a function which converts an argument into
- a string for digestion by printf. The cp_printer function should deal
- with all memory management; the functions in this file will not free
- the char*s returned. See error.c for an example use of this code. */
-
-typedef char* cp_printer PROTO((tree, int));
-extern cp_printer * cp_printers[256];
-
-/* Whether or not we should try to be quiet for errors and warnings; this is
- used to avoid being too talkative about problems with tentative choices
- when we're computing the conversion costs for a method call. */
-int cp_silent = 0;
-
-typedef void errorfn (); /* deliberately vague */
-
-static void cp_thing PROTO ((errorfn *, int, const char *, va_list));
-
-#define STRDUP(f) (ap = (char *) alloca (strlen (f) +1), strcpy (ap, (f)), ap)
-
-/* This function supports only `%s', `%d', `%%', and the C++ print
- codes. */
-
-static void
-cp_thing (errfn, atarg1, format, ap)
- errorfn *errfn;
- int atarg1;
- const char *format;
- va_list ap;
-{
- static char *buf;
- static long buflen;
- int nargs = 0;
- long len;
- long offset;
- const char *f;
- tree atarg = 0;
-
- len = strlen (format) + 1;
- if (len > buflen)
- {
- buflen = len;
- buf = xrealloc (buf, buflen);
- }
- offset = 0;
-
- for (f = format; *f; ++f)
- {
- cp_printer * function;
- int alternate;
- int maybe_here;
-
- /* ignore text */
- if (*f != '%')
- {
- buf[offset++] = *f;
- continue;
- }
-
- ++f;
-
- alternate = 0;
- maybe_here = 0;
-
- /* Check for '+' and '#' (in that order). */
- if (*f == '+')
- {
- maybe_here = 1;
- ++f;
- }
- if (*f == '#')
- {
- alternate = 1;
- ++f;
- }
-
- /* no field width or precision */
-
- function = cp_printers[(int)*f];
-
- if (function || *f == 's')
- {
- char *p;
- int plen;
-
- if (*f == 's')
- {
- p = va_arg (ap, char *);
- nargs++;
- }
- else
- {
- tree t = va_arg (ap, tree);
- nargs++;
-
- /* This indicates that ATARG comes from a different
- location than normal. */
- if (maybe_here && atarg1)
- atarg = t;
-
- /* If atarg1 is set and this is the first argument, then
- set ATARG appropriately. */
- if (atarg1 && nargs == 1)
- atarg = t;
-
- p = (*function) (t, alternate);
- }
-
- plen = strlen (p);
- len += plen;
- if (len > buflen)
- {
- buflen = len;
- buf = xrealloc (buf, len);
- }
- strcpy (buf + offset, p);
- offset += plen;
- }
- else if (*f == '%')
- {
- /* A `%%' has occurred in the input string. Replace it with
- a `%' in the formatted message buf. */
-
- if (++len > buflen)
- {
- buflen = len;
- buf = xrealloc (buf, len);
- }
- buf[offset++] = '%';
- }
- else
- {
- if (*f != 'd')
- abort ();
- len += HOST_BITS_PER_INT / 2;
- if (len > buflen)
- {
- buflen = len;
- buf = xrealloc (buf, len);
- }
- sprintf (buf + offset, "%d", va_arg (ap, int));
- nargs++;
- offset += strlen (buf + offset);
- /* With an ANSI C library one could write
- out += sprintf (...); */
- }
- }
- buf[offset] = '\0';
-
- /* If ATARG1 is set, but we haven't extracted any arguments, then
- extract one tree argument for ATARG. */
- if (nargs == 0 && atarg1)
- atarg = va_arg (ap, tree);
-
- if (atarg)
- {
- char *file = cp_file_of (atarg);
- int line = cp_line_of (atarg);
- (*errfn) (file, line, "%s", buf);
- }
- else
- (*errfn) ("%s", buf);
-
-}
-
-void
-cp_error VPROTO((const char *format, ...))
-{
-#ifndef ANSI_PROTOTYPES
- char *format;
-#endif
- va_list ap;
-
- VA_START (ap, format);
-
-#ifndef ANSI_PROTOTYPES
- format = va_arg (ap, char *);
-#endif
-
- if (! cp_silent)
- cp_thing ((errorfn *) error, 0, format, ap);
- va_end (ap);
-}
-
-void
-cp_warning VPROTO((const char *format, ...))
-{
-#ifndef ANSI_PROTOTYPES
- char *format;
-#endif
- va_list ap;
-
- VA_START (ap, format);
-
-#ifndef ANSI_PROTOTYPES
- format = va_arg (ap, char *);
-#endif
-
- if (! cp_silent)
- cp_thing ((errorfn *) warning, 0, format, ap);
- va_end (ap);
-}
-
-void
-cp_pedwarn VPROTO((const char *format, ...))
-{
-#ifndef ANSI_PROTOTYPES
- char *format;
-#endif
- va_list ap;
-
- VA_START (ap, format);
-
-#ifndef ANSI_PROTOTYPES
- format = va_arg (ap, char *);
-#endif
-
- if (! cp_silent)
- cp_thing ((errorfn *) pedwarn, 0, format, ap);
- va_end (ap);
-}
-
-void
-cp_compiler_error VPROTO((const char *format, ...))
-{
-#ifndef ANSI_PROTOTYPES
- char *format;
-#endif
- va_list ap;
-
- VA_START (ap, format);
-
-#ifndef ANSI_PROTOTYPES
- format = va_arg (ap, char *);
-#endif
-
- if (! cp_silent)
- cp_thing ((errorfn *) compiler_error, 0, format, ap);
- va_end (ap);
-}
-
-void
-cp_deprecated (msg)
- const char *msg;
-{
- extern int warn_deprecated;
- if (!warn_deprecated)
- return;
- cp_warning ("%s is deprecated.", msg);
- cp_warning ("Please see the documentation for details.");
-}
-
-void
-cp_sprintf VPROTO((const char *format, ...))
-{
-#ifndef ANSI_PROTOTYPES
- char *format;
-#endif
- va_list ap;
-
- VA_START (ap, format);
-
-#ifndef ANSI_PROTOTYPES
- format = va_arg (ap, char *);
-#endif
-
- cp_thing ((errorfn *) sprintf, 0, format, ap);
- va_end (ap);
-}
-
-void
-cp_error_at VPROTO((const char *format, ...))
-{
-#ifndef ANSI_PROTOTYPES
- char *format;
-#endif
- va_list ap;
-
- VA_START (ap, format);
-
-#ifndef ANSI_PROTOTYPES
- format = va_arg (ap, char *);
-#endif
-
- if (! cp_silent)
- cp_thing ((errorfn *) error_with_file_and_line, 1, format, ap);
- va_end (ap);
-}
-
-void
-cp_warning_at VPROTO((const char *format, ...))
-{
-#ifndef ANSI_PROTOTYPES
- char *format;
-#endif
- va_list ap;
-
- VA_START (ap, format);
-
-#ifndef ANSI_PROTOTYPES
- format = va_arg (ap, char *);
-#endif
-
- if (! cp_silent)
- cp_thing ((errorfn *) warning_with_file_and_line, 1, format, ap);
- va_end (ap);
-}
-
-void
-cp_pedwarn_at VPROTO((const char *format, ...))
-{
-#ifndef ANSI_PROTOTYPES
- char *format;
-#endif
- va_list ap;
-
- VA_START (ap, format);
-
-#ifndef ANSI_PROTOTYPES
- format = va_arg (ap, char *);
-#endif
-
- if (! cp_silent)
- cp_thing ((errorfn *) pedwarn_with_file_and_line, 1, format, ap);
- va_end (ap);
-}
diff --git a/contrib/gcc/cp/exception.cc b/contrib/gcc/cp/exception.cc
deleted file mode 100644
index 59342c6423ee..000000000000
--- a/contrib/gcc/cp/exception.cc
+++ /dev/null
@@ -1,343 +0,0 @@
-// Functions for Exception Support for -*- C++ -*-
-// Copyright (C) 1994, 95-97, 1998 Free Software Foundation
-
-// This file is part of GNU CC.
-
-// GNU CC 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.
-
-// GNU CC is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with GNU CC; see the file COPYING. If not, write to
-// the Free Software Foundation, 59 Temple Place - Suite 330,
-// Boston, MA 02111-1307, USA.
-
-// As a special exception, if you link this library with other files,
-// some of which are compiled with GCC, to produce an executable,
-// this library does not by itself 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.
-
-#pragma implementation "exception"
-
-#include "typeinfo"
-#include "exception"
-#include <stddef.h>
-#include "gansidecl.h" /* Needed to support macros used in eh-common.h. */
-#include "eh-common.h"
-
-/* Define terminate, unexpected, set_terminate, set_unexpected as
- well as the default terminate func and default unexpected func. */
-
-extern std::terminate_handler __terminate_func __attribute__((__noreturn__));
-using std::terminate;
-
-void
-std::terminate ()
-{
- __terminate_func ();
-}
-
-void
-__default_unexpected ()
-{
- terminate ();
-}
-
-static std::unexpected_handler __unexpected_func __attribute__((__noreturn__))
- = __default_unexpected;
-
-std::terminate_handler
-std::set_terminate (std::terminate_handler func)
-{
- std::terminate_handler old = __terminate_func;
-
- __terminate_func = func;
- return old;
-}
-
-std::unexpected_handler
-std::set_unexpected (std::unexpected_handler func)
-{
- std::unexpected_handler old = __unexpected_func;
-
- __unexpected_func = func;
- return old;
-}
-
-void
-std::unexpected ()
-{
- __unexpected_func ();
-}
-
-/* C++-specific state about the current exception.
- This must match init_exception_processing().
-
- Note that handlers and caught are not redundant; when rethrown, an
- exception can have multiple active handlers and still be considered
- uncaught. */
-
-struct cp_eh_info
-{
- __eh_info eh_info;
- void *value;
- void *type;
- void (*cleanup)(void *, int);
- bool caught;
- cp_eh_info *next;
- long handlers;
- void *original_value;
-};
-
-/* Language-specific EH info pointer, defined in libgcc2. */
-
-extern "C" cp_eh_info **__get_eh_info (); // actually void **
-
-/* Is P the type_info node for a pointer of some kind? */
-
-extern bool __is_pointer (void *);
-
-
-/* OLD Compiler hook to return a pointer to the info for the current exception.
- Used by get_eh_info (). This fudges the actualy returned value to
- point to the beginning of what USE to be the cp_eh_info structure.
- THis is so that old code that dereferences this pointer will find
- things where it expects it to be.*/
-extern "C" void *
-__cp_exception_info (void)
-{
- return &((*__get_eh_info ())->value);
-}
-
-#define CP_EH_INFO ((cp_eh_info *) *__get_eh_info ())
-
-/* Old Compiler hook to return a pointer to the info for the current exception.
- Used by get_eh_info (). */
-
-extern "C" cp_eh_info *
-__cp_eh_info (void)
-{
- cp_eh_info *p = CP_EH_INFO;
- return p;
-}
-
-/* Compiler hook to return a pointer to the info for the current exception,
- Set the caught bit, and increment the number of handlers that are
- looking at this exception. This makes handlers smaller. */
-
-extern "C" cp_eh_info *
-__start_cp_handler (void)
-{
- cp_eh_info *p = CP_EH_INFO;
- p->caught = 1;
- p->handlers++;
- return p;
-}
-
-/* Allocate a buffer for a cp_eh_info and an exception object of size SIZE,
- and return a pointer to the beginning of the object's space. */
-
-extern "C" void * malloc (size_t);
-extern "C" void *
-__eh_alloc (size_t size)
-{
- void *p = malloc (size);
- if (p == 0)
- terminate ();
- return p;
-}
-
-/* Free the memory for an cp_eh_info and associated exception, given
- a pointer to the cp_eh_info. */
-
-extern "C" void free (void *);
-extern "C" void
-__eh_free (void *p)
-{
- free (p);
-}
-
-
-typedef void * (* rtimetype) (void);
-
-extern "C" void *
-__cplus_type_matcher (cp_eh_info *info, rtimetype match_info,
- exception_descriptor *exception_table)
-{
- void *ret;
-
- /* No exception table implies the old style mechanism, so don't check. */
- if (exception_table != NULL
- && exception_table->lang.language != EH_LANG_C_plus_plus)
- return NULL;
-
- if (match_info == CATCH_ALL_TYPE)
- return info->value;
-
- /* we don't worry about version info yet, there is only one version! */
-
- void *match_type = match_info ();
- ret = __throw_type_match_rtti (match_type, info->type, info->original_value);
- /* change value of exception */
- if (ret)
- info->value = ret;
- return ret;
-}
-
-
-/* Compiler hook to push a new exception onto the stack.
- Used by expand_throw(). */
-
-extern "C" void
-__cp_push_exception (void *value, void *type, void (*cleanup)(void *, int))
-{
- cp_eh_info *p = (cp_eh_info *) __eh_alloc (sizeof (cp_eh_info));
-
- p->value = value;
- p->type = type;
- p->cleanup = cleanup;
- p->handlers = 0;
- p->caught = false;
- p->original_value = value;
-
- p->eh_info.match_function = __cplus_type_matcher;
- p->eh_info.language = EH_LANG_C_plus_plus;
- p->eh_info.version = 1;
-
- cp_eh_info **q = __get_eh_info ();
-
- p->next = *q;
- *q = p;
-}
-
-/* Compiler hook to pop an exception that has been finalized. Used by
- push_eh_cleanup(). P is the info for the exception caught by the
- current catch block. */
-
-extern "C" void
-__cp_pop_exception (cp_eh_info *p)
-{
- cp_eh_info **q = __get_eh_info ();
-
- --p->handlers;
-
- /* Don't really pop if there are still active handlers for our exception,
- or if our exception is being rethrown (i.e. if the active exception is
- our exception and it is uncaught). */
- if (p->handlers != 0
- || (p == *q && !p->caught))
- return;
-
- for (; *q; q = &((*q)->next))
- if (*q == p)
- break;
-
- if (! *q)
- terminate ();
-
- *q = p->next;
-
- if (p->cleanup)
- /* 2 is a magic value for destructors; see build_delete(). */
- p->cleanup (p->original_value, 2); // value may have been adjusted.
-
- if (! __is_pointer (p->type))
- __eh_free (p->original_value); // value may have been adjusted.
-
- __eh_free (p);
-}
-
-extern "C" void
-__uncatch_exception (void)
-{
- cp_eh_info *p = CP_EH_INFO;
- if (p == 0)
- terminate ();
- p->caught = false;
-}
-
-/* As per [except.unexpected]:
- If an exception is thrown, we check it against the spec. If it doesn't
- match, we call unexpected (). If unexpected () throws, we check that
- exception against the spec. If it doesn't match, if the spec allows
- bad_exception we throw that; otherwise we call terminate ().
-
- The compiler treats an exception spec as a try block with a generic
- handler that just calls this function with a list of the allowed
- exception types, so we have an active exception that can be rethrown.
-
- This function does not return. */
-
-extern "C" void
-__check_eh_spec (int n, const void **spec)
-{
- cp_eh_info *p = CP_EH_INFO;
-
- for (int i = 0; i < n; ++i)
- {
- if (__throw_type_match_rtti (spec[i], p->type, p->value))
- throw;
- }
-
- try
- {
- std::unexpected ();
- }
- catch (...)
- {
- // __exception_info is an artificial var pushed into each catch block.
- if (p != __exception_info)
- {
- p = __exception_info;
- for (int i = 0; i < n; ++i)
- {
- if (__throw_type_match_rtti (spec[i], p->type, p->value))
- throw;
- }
- }
-
- const std::type_info &bad_exc = typeid (std::bad_exception);
- for (int i = 0; i < n; ++i)
- {
- if (__throw_type_match_rtti (spec[i], &bad_exc, p->value))
- throw std::bad_exception ();
- }
-
- terminate ();
- }
-}
-
-extern "C" void
-__throw_bad_cast (void)
-{
- throw std::bad_cast ();
-}
-
-extern "C" void
-__throw_bad_typeid (void)
-{
- throw std::bad_typeid ();
-}
-
-/* Has the current exception been caught? */
-
-bool
-std::uncaught_exception ()
-{
- cp_eh_info *p = CP_EH_INFO;
- return p && ! p->caught;
-}
-
-const char * std::exception::
-what () const
-{
- return typeid (*this).name ();
-}
diff --git a/contrib/gcc/cp/g++.c b/contrib/gcc/cp/g++.c
deleted file mode 100644
index f694898fa966..000000000000
--- a/contrib/gcc/cp/g++.c
+++ /dev/null
@@ -1,582 +0,0 @@
-/* G++ preliminary semantic processing for the compiler driver.
- Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc.
- Contributed by Brendan Kehoe (brendan@cygnus.com).
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* This program is a wrapper to the main `gcc' driver. For GNU C++,
- we need to do two special things: a) append `-lg++' in situations
- where it's appropriate, to link in libg++, and b) add `-xc++'..`-xnone'
- around file arguments named `foo.c' or `foo.i'. So, we do all of
- this semantic processing then just exec gcc with the new argument
- list.
-
- We used to do all of this in a small shell script, but many users
- found the performance of this as a shell script to be unacceptable.
- In situations where your PATH has a lot of NFS-mounted directories,
- using a script that runs sed and other things would be a nasty
- performance hit. With this program, we never search the PATH at all. */
-
-#include "config.h"
-#ifdef __STDC__
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
-#include <stdio.h>
-#include <sys/types.h>
-#if !defined(_WIN32)
-#include <sys/file.h> /* May get R_OK, etc. on some systems. */
-#else
-#include <process.h>
-#endif
-#include <errno.h>
-
-/* Defined to the name of the compiler; if using a cross compiler, the
- Makefile should compile this file with the proper name
- (e.g., "i386-aout-gcc"). */
-#ifndef GCC_NAME
-#define GCC_NAME "gcc"
-#endif
-
-/* This bit is set if we saw a `-xfoo' language specification. */
-#define LANGSPEC (1<<1)
-/* This bit is set if they did `-lm' or `-lmath'. */
-#define MATHLIB (1<<2)
-
-#ifndef MATH_LIBRARY
-#define MATH_LIBRARY "-lm"
-#endif
-
-/* On MSDOS, write temp files in current dir
- because there's no place else we can expect to use. */
-#ifdef __MSDOS__
-#ifndef P_tmpdir
-#define P_tmpdir "."
-#endif
-#ifndef R_OK
-#define R_OK 4
-#define W_OK 2
-#define X_OK 1
-#endif
-#endif
-
-#ifndef VPROTO
-#ifdef __STDC__
-#define PVPROTO(ARGS) ARGS
-#define VPROTO(ARGS) ARGS
-#define VA_START(va_list,var) va_start(va_list,var)
-#else
-#define PVPROTO(ARGS) ()
-#define VPROTO(ARGS) (va_alist) va_dcl
-#define VA_START(va_list,var) va_start(va_list)
-#endif
-#endif
-
-#ifndef errno
-extern int errno;
-#endif
-
-extern int sys_nerr;
-#ifndef HAVE_STRERROR
-#if defined(bsd4_4)
-extern const char *const sys_errlist[];
-#else
-extern char *sys_errlist[];
-#endif
-#else
-extern char *strerror();
-#endif
-
-/* Name with which this program was invoked. */
-static char *programname;
-
-char *
-my_strerror(e)
- int e;
-{
-
-#ifdef HAVE_STRERROR
- return strerror(e);
-
-#else
-
- static char buffer[30];
- if (!e)
- return "";
-
- if (e > 0 && e < sys_nerr)
- return sys_errlist[e];
-
- sprintf (buffer, "Unknown error %d", e);
- return buffer;
-#endif
-}
-
-#ifdef HAVE_VPRINTF
-/* Output an error message and exit */
-
-static void
-fatal VPROTO((char *format, ...))
-{
-#ifndef __STDC__
- char *format;
-#endif
- va_list ap;
-
- VA_START (ap, format);
-
-#ifndef __STDC__
- format = va_arg (ap, char*);
-#endif
-
- fprintf (stderr, "%s: ", programname);
- vfprintf (stderr, format, ap);
- va_end (ap);
- fprintf (stderr, "\n");
-#if 0
- /* XXX Not needed for g++ driver. */
- delete_temp_files ();
-#endif
- exit (1);
-}
-
-static void
-error VPROTO((char *format, ...))
-{
-#ifndef __STDC__
- char *format;
-#endif
- va_list ap;
-
- VA_START (ap, format);
-
-#ifndef __STDC__
- format = va_arg (ap, char*);
-#endif
-
- fprintf (stderr, "%s: ", programname);
- vfprintf (stderr, format, ap);
- va_end (ap);
-
- fprintf (stderr, "\n");
-}
-
-#else /* not HAVE_VPRINTF */
-
-static void
-error (msg, arg1, arg2)
- char *msg, *arg1, *arg2;
-{
- fprintf (stderr, "%s: ", programname);
- fprintf (stderr, msg, arg1, arg2);
- fprintf (stderr, "\n");
-}
-
-static void
-fatal (msg, arg1, arg2)
- char *msg, *arg1, *arg2;
-{
- error (msg, arg1, arg2);
-#if 0
- /* XXX Not needed for g++ driver. */
- delete_temp_files ();
-#endif
- exit (1);
-}
-
-#endif /* not HAVE_VPRINTF */
-
-/* More 'friendly' abort that prints the line and file.
- config.h can #define abort fancy_abort if you like that sort of thing. */
-
-void
-fancy_abort ()
-{
- fatal ("Internal g++ abort.");
-}
-
-char *
-xmalloc (size)
- unsigned size;
-{
- register char *value = (char *) malloc (size);
- if (value == 0)
- fatal ("virtual memory exhausted");
- return value;
-}
-
-/* Return a newly-allocated string whose contents concatenate those
- of s1, s2, s3. */
-static char *
-concat (s1, s2, s3)
- char *s1, *s2, *s3;
-{
- int len1 = strlen (s1), len2 = strlen (s2), len3 = strlen (s3);
- char *result = xmalloc (len1 + len2 + len3 + 1);
-
- strcpy (result, s1);
- strcpy (result + len1, s2);
- strcpy (result + len1 + len2, s3);
- *(result + len1 + len2 + len3) = 0;
-
- return result;
-}
-
-static void
-pfatal_with_name (name)
- char *name;
-{
- fatal (concat ("%s: ", my_strerror (errno), ""), name);
-}
-
-#ifdef __MSDOS__
-/* This is the common prefix we use to make temp file names. */
-char *temp_filename;
-
-/* Length of the prefix. */
-int temp_filename_length;
-
-/* Compute a string to use as the base of all temporary file names. */
-static char *
-choose_temp_base_try (try, base)
-char *try;
-char *base;
-{
- char *rv;
- if (base)
- rv = base;
- else if (try == (char *)0)
- rv = 0;
- else if (access (try, R_OK | W_OK) != 0)
- rv = 0;
- else
- rv = try;
- return rv;
-}
-
-static void
-choose_temp_base ()
-{
- char *base = 0;
- int len;
-
- base = choose_temp_base_try (getenv ("TMPDIR"), base);
- base = choose_temp_base_try (getenv ("TMP"), base);
- base = choose_temp_base_try (getenv ("TEMP"), base);
-
-#ifdef P_tmpdir
- base = choose_temp_base_try (P_tmpdir, base);
-#endif
-
- base = choose_temp_base_try ("/usr/tmp", base);
- base = choose_temp_base_try ("/tmp", base);
-
- /* If all else fails, use the current directory! */
- if (base == (char *)0)
- base = "./";
-
- len = strlen (base);
- temp_filename = xmalloc (len + sizeof("/ccXXXXXX"));
- strcpy (temp_filename, base);
- if (len > 0 && temp_filename[len-1] != '/')
- temp_filename[len++] = '/';
- strcpy (temp_filename + len, "ccXXXXXX");
-
- mktemp (temp_filename);
- temp_filename_length = strlen (temp_filename);
- if (temp_filename_length == 0)
- abort ();
-}
-
-static void
-perror_exec (name)
- char *name;
-{
- char *s;
-
- if (errno < sys_nerr)
- s = concat ("installation problem, cannot exec %s: ",
- my_strerror( errno ), "");
- else
- s = "installation problem, cannot exec %s";
- error (s, name);
-}
-
-/* This is almost exactly what's in gcc.c:pexecute for MSDOS. */
-void
-run_dos (program, argv)
- char *program;
- char *argv[];
-{
- char *scmd, *rf;
- FILE *argfile;
- int i;
-
- choose_temp_base (); /* not in gcc.c */
-
- scmd = (char *) malloc (strlen (program) + strlen (temp_filename) + 10);
- rf = scmd + strlen (program) + 6;
- sprintf (scmd, "%s.exe @%s.gp", program, temp_filename);
-
- argfile = fopen (rf, "w");
- if (argfile == 0)
- pfatal_with_name (rf);
-
- for (i=1; argv[i]; i++)
- {
- char *cp;
- for (cp = argv[i]; *cp; cp++)
- {
- if (*cp == '"' || *cp == '\'' || *cp == '\\' || isspace (*cp))
- fputc ('\\', argfile);
- fputc (*cp, argfile);
- }
- fputc ('\n', argfile);
- }
- fclose (argfile);
-
- i = system (scmd);
-
- remove (rf);
-
- if (i == -1)
- perror_exec (program);
-}
-#endif /* __MSDOS__ */
-
-int
-main (argc, argv)
- int argc;
- char **argv;
-{
- register int i, j = 0;
- register char *p;
- int verbose = 0;
-
- /* This will be 0 if we encounter a situation where we should not
- link in libstdc++, or 2 if we should link in libg++ as well. */
- int library = 1;
-
- /* Used to track options that take arguments, so we don't go wrapping
- those with -xc++/-xnone. */
- char *quote = NULL;
-
- /* The new argument list will be contained in this. */
- char **arglist;
-
- /* The name of the compiler we will want to run---by default, it
- will be the definition of `GCC_NAME', e.g., `gcc'. */
- char *gcc = GCC_NAME;
-
- /* Non-zero if we saw a `-xfoo' language specification on the
- command line. Used to avoid adding our own -xc++ if the user
- already gave a language for the file. */
- int saw_speclang = 0;
-
- /* Non-zero if we saw `-lm' or `-lmath' on the command line. */
- char *saw_math = 0;
-
- /* The number of arguments being added to what's in argv, other than
- libraries. We use this to track the number of times we've inserted
- -xc++/-xnone. */
- int added = 0;
-
- /* An array used to flag each argument that needs a bit set for
- LANGSPEC or MATHLIB. */
- int *args;
-
- p = argv[0] + strlen (argv[0]);
-
- /* If we're called as g++ (or i386-aout-g++), link in libg++ as well. */
-
- if (strcmp (p - 3, "g++") == 0)
- {
- library = 2;
- }
-
- while (p != argv[0] && p[-1] != '/')
- --p;
- programname = p;
-
- if (argc == 1)
- fatal ("No input files specified.\n");
-
-#ifndef __MSDOS__
- /* We do a little magic to find out where the main gcc executable
- is. If they ran us as /usr/local/bin/g++, then we will look
- for /usr/local/bin/gcc; similarly, if they just ran us as `g++',
- we'll just look for `gcc'. */
- if (p != argv[0])
- {
- *--p = '\0';
- gcc = (char *) malloc ((strlen (argv[0]) + 1 + strlen (GCC_NAME) + 1)
- * sizeof (char));
- sprintf (gcc, "%s/%s", argv[0], GCC_NAME);
- }
-#endif
-
- args = (int *) malloc (argc * sizeof (int));
- bzero ((char *) args, argc * sizeof (int));
-
- for (i = 1; i < argc; i++)
- {
- /* If the previous option took an argument, we swallow it here. */
- if (quote)
- {
- quote = NULL;
- continue;
- }
-
- if (argv[i][0] == '\0' || argv[i][1] == '\0')
- continue;
-
- if (argv[i][0] == '-')
- {
- if (library != 0 && strcmp (argv[i], "-nostdlib") == 0)
- {
- library = 0;
- }
- else if (strcmp (argv[i], "-lm") == 0
- || strcmp (argv[i], "-lmath") == 0)
- args[i] |= MATHLIB;
- else if (strcmp (argv[i], "-v") == 0)
- {
- verbose = 1;
- if (argc == 2)
- {
- /* If they only gave us `-v', don't try to link
- in libg++. */
- library = 0;
- }
- }
- else if (strncmp (argv[i], "-x", 2) == 0)
- saw_speclang = 1;
- else if (((argv[i][2] == '\0'
- && (char *)strchr ("bBVDUoeTuIYmLiA", argv[i][1]) != NULL)
- || strcmp (argv[i], "-Tdata") == 0))
- quote = argv[i];
- else if (library != 0 && ((argv[i][2] == '\0'
- && (char *) strchr ("cSEM", argv[i][1]) != NULL)
- || strcmp (argv[i], "-MM") == 0))
- {
- /* Don't specify libraries if we won't link, since that would
- cause a warning. */
- library = 0;
- }
- else
- /* Pass other options through. */
- continue;
- }
- else
- {
- int len;
-
- if (saw_speclang)
- {
- saw_speclang = 0;
- continue;
- }
-
- /* If the filename ends in .c or .i, put options around it.
- But not if a specified -x option is currently active. */
- len = strlen (argv[i]);
- if (len > 2
- && (argv[i][len - 1] == 'c' || argv[i][len - 1] == 'i')
- && argv[i][len - 2] == '.')
- {
- args[i] |= LANGSPEC;
- added += 2;
- }
- }
- }
-
- if (quote)
- fatal ("argument to `%s' missing\n", quote);
-
- if (added || library)
- {
- arglist = (char **) malloc ((argc + added + 4) * sizeof (char *));
-
- for (i = 1, j = 1; i < argc; i++, j++)
- {
- arglist[j] = argv[i];
-
- /* Make sure -lg++ is before the math library, since libg++
- itself uses those math routines. */
- if (!saw_math && (args[i] & MATHLIB) && library)
- {
- --j;
- saw_math = argv[i];
- }
-
- /* Wrap foo.c and foo.i files in a language specification to
- force the gcc compiler driver to run cc1plus on them. */
- if (args[i] & LANGSPEC)
- {
- int len = strlen (argv[i]);
- if (argv[i][len - 1] == 'i')
- arglist[j++] = "-xc++-cpp-output";
- else
- arglist[j++] = "-xc++";
- arglist[j++] = argv[i];
- arglist[j] = "-xnone";
- }
- }
-
- /* Add `-lg++' if we haven't already done so. */
- if (library == 2)
- arglist[j++] = "-lg++";
- if (library)
- arglist[j++] = "-lstdc++";
- if (saw_math)
- arglist[j++] = saw_math;
- else if (library)
- arglist[j++] = MATH_LIBRARY;
-
- arglist[j] = NULL;
- }
- else
- /* No need to copy 'em all. */
- arglist = argv;
-
- arglist[0] = gcc;
-
- if (verbose)
- {
- if (j == 0)
- j = argc;
-
- for (i = 0; i < j; i++)
- fprintf (stderr, " %s", arglist[i]);
- fprintf (stderr, "\n");
- }
-#if !defined(OS2) && !defined (_WIN32)
-#ifdef __MSDOS__
- run_dos (gcc, arglist);
-#else /* !__MSDOS__ */
- if (execvp (gcc, arglist) < 0)
- pfatal_with_name (gcc);
-#endif /* __MSDOS__ */
-#else /* OS2 or _WIN32 */
- if (spawnvp (1, gcc, arglist) < 0)
- pfatal_with_name (gcc);
-#endif
-
- return 0;
-}
diff --git a/contrib/gcc/cp/gxx.gperf b/contrib/gcc/cp/gxx.gperf
deleted file mode 100644
index 1e621c4a22d6..000000000000
--- a/contrib/gcc/cp/gxx.gperf
+++ /dev/null
@@ -1,111 +0,0 @@
-%{
-/* Command-line: gperf -L KR-C -F ', 0, 0' -p -j1 -g -o -t -N is_reserved_word -k1,4,$,7 gplus.gperf */
-%}
-struct resword { const char *name; short token; enum rid rid;};
-%%
-__alignof, ALIGNOF, NORID
-__alignof__, ALIGNOF, NORID
-__asm, ASM_KEYWORD, NORID
-__asm__, ASM_KEYWORD, NORID
-__attribute, ATTRIBUTE, NORID
-__attribute__, ATTRIBUTE, NORID
-__complex, TYPESPEC, RID_COMPLEX
-__complex__, TYPESPEC, RID_COMPLEX
-__const, CV_QUALIFIER, RID_CONST
-__const__, CV_QUALIFIER, RID_CONST
-__extension__, EXTENSION, NORID
-__imag, IMAGPART, NORID
-__imag__, IMAGPART, NORID
-__inline, SCSPEC, RID_INLINE
-__inline__, SCSPEC, RID_INLINE
-__label__, LABEL, NORID
-__null, CONSTANT, RID_NULL
-__real, REALPART, NORID
-__real__, REALPART, NORID
-__restrict, CV_QUALIFIER, RID_RESTRICT
-__restrict__, CV_QUALIFIER, RID_RESTRICT
-__signature__, AGGR, RID_SIGNATURE /* Extension */,
-__signed, TYPESPEC, RID_SIGNED
-__signed__, TYPESPEC, RID_SIGNED
-__sigof__, SIGOF, NORID /* Extension */,
-__typeof, TYPEOF, NORID
-__typeof__, TYPEOF, NORID
-__volatile, CV_QUALIFIER, RID_VOLATILE
-__volatile__, CV_QUALIFIER, RID_VOLATILE
-__wchar_t, TYPESPEC, RID_WCHAR /* Unique to ANSI C++ */,
-asm, ASM_KEYWORD, NORID,
-and, ANDAND, NORID,
-and_eq, ASSIGN, NORID,
-auto, SCSPEC, RID_AUTO,
-bitand, '&', NORID,
-bitor, '|', NORID,
-bool, TYPESPEC, RID_BOOL,
-break, BREAK, NORID,
-case, CASE, NORID,
-catch, CATCH, NORID,
-char, TYPESPEC, RID_CHAR,
-class, AGGR, RID_CLASS,
-compl, '~', NORID,
-const, CV_QUALIFIER, RID_CONST,
-const_cast, CONST_CAST, NORID,
-continue, CONTINUE, NORID,
-default, DEFAULT, NORID,
-delete, DELETE, NORID,
-do, DO, NORID,
-double, TYPESPEC, RID_DOUBLE,
-dynamic_cast, DYNAMIC_CAST, NORID,
-else, ELSE, NORID,
-enum, ENUM, NORID,
-explicit, SCSPEC, RID_EXPLICIT,
-export, SCSPEC, RID_EXPORT,
-extern, SCSPEC, RID_EXTERN,
-false, CXX_FALSE, NORID,
-float, TYPESPEC, RID_FLOAT,
-for, FOR, NORID,
-friend, SCSPEC, RID_FRIEND,
-goto, GOTO, NORID,
-if, IF, NORID,
-inline, SCSPEC, RID_INLINE,
-int, TYPESPEC, RID_INT,
-long, TYPESPEC, RID_LONG,
-mutable, SCSPEC, RID_MUTABLE,
-namespace, NAMESPACE, NORID,
-new, NEW, NORID,
-not, '!', NORID,
-not_eq, EQCOMPARE, NORID,
-operator, OPERATOR, NORID,
-or, OROR, NORID,
-or_eq, ASSIGN, NORID,
-private, VISSPEC, RID_PRIVATE,
-protected, VISSPEC, RID_PROTECTED,
-public, VISSPEC, RID_PUBLIC,
-register, SCSPEC, RID_REGISTER,
-reinterpret_cast, REINTERPRET_CAST, NORID,
-return, RETURN_KEYWORD, NORID,
-short, TYPESPEC, RID_SHORT,
-signature, AGGR, RID_SIGNATURE /* Extension */,
-signed, TYPESPEC, RID_SIGNED,
-sigof, SIGOF, NORID /* Extension */,
-sizeof, SIZEOF, NORID,
-static, SCSPEC, RID_STATIC,
-static_cast, STATIC_CAST, NORID,
-struct, AGGR, RID_RECORD,
-switch, SWITCH, NORID,
-template, TEMPLATE, RID_TEMPLATE,
-this, THIS, NORID,
-throw, THROW, NORID,
-true, CXX_TRUE, NORID,
-try, TRY, NORID,
-typedef, SCSPEC, RID_TYPEDEF,
-typename, TYPENAME_KEYWORD, NORID,
-typeid, TYPEID, NORID,
-typeof, TYPEOF, NORID,
-union, AGGR, RID_UNION,
-unsigned, TYPESPEC, RID_UNSIGNED,
-using, USING, NORID,
-virtual, SCSPEC, RID_VIRTUAL,
-void, TYPESPEC, RID_VOID,
-volatile, CV_QUALIFIER, RID_VOLATILE,
-while, WHILE, NORID,
-xor, '^', NORID,
-xor_eq, ASSIGN, NORID,
diff --git a/contrib/gcc/cp/gxxint.texi b/contrib/gcc/cp/gxxint.texi
deleted file mode 100644
index 81bcab864250..000000000000
--- a/contrib/gcc/cp/gxxint.texi
+++ /dev/null
@@ -1,2075 +0,0 @@
-\input texinfo @c -*-texinfo-*-
-@c %**start of header
-@setfilename g++int.info
-@settitle G++ internals
-@setchapternewpage odd
-@c %**end of header
-
-@node Top, Limitations of g++, (dir), (dir)
-@chapter Internal Architecture of the Compiler
-
-This is meant to describe the C++ front-end for gcc in detail.
-Questions and comments to Benjamin Kosnik @code{<bkoz@@cygnus.com>}.
-
-@menu
-* Limitations of g++::
-* Routines::
-* Implementation Specifics::
-* Glossary::
-* Macros::
-* Typical Behavior::
-* Coding Conventions::
-* Templates::
-* Access Control::
-* Error Reporting::
-* Parser::
-* Exception Handling::
-* Free Store::
-* Mangling:: Function name mangling for C++ and Java
-* Vtables:: Two ways to do virtual functions
-* Concept Index::
-@end menu
-
-@node Limitations of g++, Routines, Top, Top
-@section Limitations of g++
-
-@itemize @bullet
-@item
-Limitations on input source code: 240 nesting levels with the parser
-stacksize (YYSTACKSIZE) set to 500 (the default), and requires around
-16.4k swap space per nesting level. The parser needs about 2.09 *
-number of nesting levels worth of stackspace.
-
-@cindex pushdecl_class_level
-@item
-I suspect there are other uses of pushdecl_class_level that do not call
-set_identifier_type_value in tandem with the call to
-pushdecl_class_level. It would seem to be an omission.
-
-@cindex access checking
-@item
-Access checking is unimplemented for nested types.
-
-@cindex @code{volatile}
-@item
-@code{volatile} is not implemented in general.
-
-@end itemize
-
-@node Routines, Implementation Specifics, Limitations of g++, Top
-@section Routines
-
-This section describes some of the routines used in the C++ front-end.
-
-@code{build_vtable} and @code{prepare_fresh_vtable} is used only within
-the @file{cp-class.c} file, and only in @code{finish_struct} and
-@code{modify_vtable_entries}.
-
-@code{build_vtable}, @code{prepare_fresh_vtable}, and
-@code{finish_struct} are the only routines that set @code{DECL_VPARENT}.
-
-@code{finish_struct} can steal the virtual function table from parents,
-this prohibits related_vslot from working. When finish_struct steals,
-we know that
-
-@example
-get_binfo (DECL_FIELD_CONTEXT (CLASSTYPE_VFIELD (t)), t, 0)
-@end example
-
-@noindent
-will get the related binfo.
-
-@code{layout_basetypes} does something with the VIRTUALS.
-
-Supposedly (according to Tiemann) most of the breadth first searching
-done, like in @code{get_base_distance} and in @code{get_binfo} was not
-because of any design decision. I have since found out the at least one
-part of the compiler needs the notion of depth first binfo searching, I
-am going to try and convert the whole thing, it should just work. The
-term left-most refers to the depth first left-most node. It uses
-@code{MAIN_VARIANT == type} as the condition to get left-most, because
-the things that have @code{BINFO_OFFSET}s of zero are shared and will
-have themselves as their own @code{MAIN_VARIANT}s. The non-shared right
-ones, are copies of the left-most one, hence if it is its own
-@code{MAIN_VARIANT}, we know it IS a left-most one, if it is not, it is
-a non-left-most one.
-
-@code{get_base_distance}'s path and distance matters in its use in:
-
-@itemize @bullet
-@item
-@code{prepare_fresh_vtable} (the code is probably wrong)
-@item
-@code{init_vfields} Depends upon distance probably in a safe way,
-build_offset_ref might use partial paths to do further lookups,
-hack_identifier is probably not properly checking access.
-
-@item
-@code{get_first_matching_virtual} probably should check for
-@code{get_base_distance} returning -2.
-
-@item
-@code{resolve_offset_ref} should be called in a more deterministic
-manner. Right now, it is called in some random contexts, like for
-arguments at @code{build_method_call} time, @code{default_conversion}
-time, @code{convert_arguments} time, @code{build_unary_op} time,
-@code{build_c_cast} time, @code{build_modify_expr} time,
-@code{convert_for_assignment} time, and
-@code{convert_for_initialization} time.
-
-But, there are still more contexts it needs to be called in, one was the
-ever simple:
-
-@example
-if (obj.*pmi != 7)
- @dots{}
-@end example
-
-Seems that the problems were due to the fact that @code{TREE_TYPE} of
-the @code{OFFSET_REF} was not a @code{OFFSET_TYPE}, but rather the type
-of the referent (like @code{INTEGER_TYPE}). This problem was fixed by
-changing @code{default_conversion} to check @code{TREE_CODE (x)},
-instead of only checking @code{TREE_CODE (TREE_TYPE (x))} to see if it
-was @code{OFFSET_TYPE}.
-
-@end itemize
-
-@node Implementation Specifics, Glossary, Routines, Top
-@section Implementation Specifics
-
-@itemize @bullet
-@item Explicit Initialization
-
-The global list @code{current_member_init_list} contains the list of
-mem-initializers specified in a constructor declaration. For example:
-
-@example
-foo::foo() : a(1), b(2) @{@}
-@end example
-
-@noindent
-will initialize @samp{a} with 1 and @samp{b} with 2.
-@code{expand_member_init} places each initialization (a with 1) on the
-global list. Then, when the fndecl is being processed,
-@code{emit_base_init} runs down the list, initializing them. It used to
-be the case that g++ first ran down @code{current_member_init_list},
-then ran down the list of members initializing the ones that weren't
-explicitly initialized. Things were rewritten to perform the
-initializations in order of declaration in the class. So, for the above
-example, @samp{a} and @samp{b} will be initialized in the order that
-they were declared:
-
-@example
-class foo @{ public: int b; int a; foo (); @};
-@end example
-
-@noindent
-Thus, @samp{b} will be initialized with 2 first, then @samp{a} will be
-initialized with 1, regardless of how they're listed in the mem-initializer.
-
-@item The Explicit Keyword
-
-The use of @code{explicit} on a constructor is used by @code{grokdeclarator}
-to set the field @code{DECL_NONCONVERTING_P}. That value is used by
-@code{build_method_call} and @code{build_user_type_conversion_1} to decide
-if a particular constructor should be used as a candidate for conversions.
-
-@end itemize
-
-@node Glossary, Macros, Implementation Specifics, Top
-@section Glossary
-
-@table @r
-@item binfo
-The main data structure in the compiler used to represent the
-inheritance relationships between classes. The data in the binfo can be
-accessed by the BINFO_ accessor macros.
-
-@item vtable
-@itemx virtual function table
-
-The virtual function table holds information used in virtual function
-dispatching. In the compiler, they are usually referred to as vtables,
-or vtbls. The first index is not used in the normal way, I believe it
-is probably used for the virtual destructor. There are two forms of
-virtual tables, one that has offsets in addition to pointers, and one
-using thunks. @xref{Vtables}.
-
-@item vfield
-
-vfields can be thought of as the base information needed to build
-vtables. For every vtable that exists for a class, there is a vfield.
-See also vtable and virtual function table pointer. When a type is used
-as a base class to another type, the virtual function table for the
-derived class can be based upon the vtable for the base class, just
-extended to include the additional virtual methods declared in the
-derived class. The virtual function table from a virtual base class is
-never reused in a derived class. @code{is_normal} depends upon this.
-
-@item virtual function table pointer
-
-These are @code{FIELD_DECL}s that are pointer types that point to
-vtables. See also vtable and vfield.
-@end table
-
-@node Macros, Typical Behavior, Glossary, Top
-@section Macros
-
-This section describes some of the macros used on trees. The list
-should be alphabetical. Eventually all macros should be documented
-here.
-
-@table @code
-@item BINFO_BASETYPES
-A vector of additional binfos for the types inherited by this basetype.
-The binfos are fully unshared (except for virtual bases, in which
-case the binfo structure is shared).
-
- If this basetype describes type D as inherited in C,
- and if the basetypes of D are E anf F,
- then this vector contains binfos for inheritance of E and F by C.
-
-Has values of:
-
- TREE_VECs
-
-
-@item BINFO_INHERITANCE_CHAIN
-Temporarily used to represent specific inheritances. It usually points
-to the binfo associated with the lesser derived type, but it can be
-reversed by reverse_path. For example:
-
-@example
- Z ZbY least derived
- |
- Y YbX
- |
- X Xb most derived
-
-TYPE_BINFO (X) == Xb
-BINFO_INHERITANCE_CHAIN (Xb) == YbX
-BINFO_INHERITANCE_CHAIN (Yb) == ZbY
-BINFO_INHERITANCE_CHAIN (Zb) == 0
-@end example
-
-Not sure is the above is really true, get_base_distance has is point
-towards the most derived type, opposite from above.
-
-Set by build_vbase_path, recursive_bounded_basetype_p,
-get_base_distance, lookup_field, lookup_fnfields, and reverse_path.
-
-What things can this be used on:
-
- TREE_VECs that are binfos
-
-
-@item BINFO_OFFSET
-The offset where this basetype appears in its containing type.
-BINFO_OFFSET slot holds the offset (in bytes) from the base of the
-complete object to the base of the part of the object that is allocated
-on behalf of this `type'. This is always 0 except when there is
-multiple inheritance.
-
-Used on TREE_VEC_ELTs of the binfos BINFO_BASETYPES (...) for example.
-
-
-@item BINFO_VIRTUALS
-A unique list of functions for the virtual function table. See also
-TYPE_BINFO_VIRTUALS.
-
-What things can this be used on:
-
- TREE_VECs that are binfos
-
-
-@item BINFO_VTABLE
-Used to find the VAR_DECL that is the virtual function table associated
-with this binfo. See also TYPE_BINFO_VTABLE. To get the virtual
-function table pointer, see CLASSTYPE_VFIELD.
-
-What things can this be used on:
-
- TREE_VECs that are binfos
-
-Has values of:
-
- VAR_DECLs that are virtual function tables
-
-
-@item BLOCK_SUPERCONTEXT
-In the outermost scope of each function, it points to the FUNCTION_DECL
-node. It aids in better DWARF support of inline functions.
-
-
-@item CLASSTYPE_TAGS
-CLASSTYPE_TAGS is a linked (via TREE_CHAIN) list of member classes of a
-class. TREE_PURPOSE is the name, TREE_VALUE is the type (pushclass scans
-these and calls pushtag on them.)
-
-finish_struct scans these to produce TYPE_DECLs to add to the
-TYPE_FIELDS of the type.
-
-It is expected that name found in the TREE_PURPOSE slot is unique,
-resolve_scope_to_name is one such place that depends upon this
-uniqueness.
-
-
-@item CLASSTYPE_METHOD_VEC
-The following is true after finish_struct has been called (on the
-class?) but not before. Before finish_struct is called, things are
-different to some extent. Contains a TREE_VEC of methods of the class.
-The TREE_VEC_LENGTH is the number of differently named methods plus one
-for the 0th entry. The 0th entry is always allocated, and reserved for
-ctors and dtors. If there are none, TREE_VEC_ELT(N,0) == NULL_TREE.
-Each entry of the TREE_VEC is a FUNCTION_DECL. For each FUNCTION_DECL,
-there is a DECL_CHAIN slot. If the FUNCTION_DECL is the last one with a
-given name, the DECL_CHAIN slot is NULL_TREE. Otherwise it is the next
-method that has the same name (but a different signature). It would
-seem that it is not true that because the DECL_CHAIN slot is used in
-this way, we cannot call pushdecl to put the method in the global scope
-(cause that would overwrite the TREE_CHAIN slot), because they use
-different _CHAINs. finish_struct_methods setups up one version of the
-TREE_CHAIN slots on the FUNCTION_DECLs.
-
-friends are kept in TREE_LISTs, so that there's no need to use their
-TREE_CHAIN slot for anything.
-
-Has values of:
-
- TREE_VECs
-
-
-@item CLASSTYPE_VFIELD
-Seems to be in the process of being renamed TYPE_VFIELD. Use on types
-to get the main virtual function table pointer. To get the virtual
-function table use BINFO_VTABLE (TYPE_BINFO ()).
-
-Has values of:
-
- FIELD_DECLs that are virtual function table pointers
-
-What things can this be used on:
-
- RECORD_TYPEs
-
-
-@item DECL_CLASS_CONTEXT
-Identifies the context that the _DECL was found in. For virtual function
-tables, it points to the type associated with the virtual function
-table. See also DECL_CONTEXT, DECL_FIELD_CONTEXT and DECL_FCONTEXT.
-
-The difference between this and DECL_CONTEXT, is that for virtuals
-functions like:
-
-@example
-struct A
-@{
- virtual int f ();
-@};
-
-struct B : A
-@{
- int f ();
-@};
-
-DECL_CONTEXT (A::f) == A
-DECL_CLASS_CONTEXT (A::f) == A
-
-DECL_CONTEXT (B::f) == A
-DECL_CLASS_CONTEXT (B::f) == B
-@end example
-
-Has values of:
-
- RECORD_TYPEs, or UNION_TYPEs
-
-What things can this be used on:
-
- TYPE_DECLs, _DECLs
-
-
-@item DECL_CONTEXT
-Identifies the context that the _DECL was found in. Can be used on
-virtual function tables to find the type associated with the virtual
-function table, but since they are FIELD_DECLs, DECL_FIELD_CONTEXT is a
-better access method. Internally the same as DECL_FIELD_CONTEXT, so
-don't us both. See also DECL_FIELD_CONTEXT, DECL_FCONTEXT and
-DECL_CLASS_CONTEXT.
-
-Has values of:
-
- RECORD_TYPEs
-
-
-What things can this be used on:
-
-@display
-VAR_DECLs that are virtual function tables
-_DECLs
-@end display
-
-
-@item DECL_FIELD_CONTEXT
-Identifies the context that the FIELD_DECL was found in. Internally the
-same as DECL_CONTEXT, so don't us both. See also DECL_CONTEXT,
-DECL_FCONTEXT and DECL_CLASS_CONTEXT.
-
-Has values of:
-
- RECORD_TYPEs
-
-What things can this be used on:
-
-@display
-FIELD_DECLs that are virtual function pointers
-FIELD_DECLs
-@end display
-
-
-@item DECL_NAME
-
-Has values of:
-
-@display
-0 for things that don't have names
-IDENTIFIER_NODEs for TYPE_DECLs
-@end display
-
-@item DECL_IGNORED_P
-A bit that can be set to inform the debug information output routines in
-the back-end that a certain _DECL node should be totally ignored.
-
-Used in cases where it is known that the debugging information will be
-output in another file, or where a sub-type is known not to be needed
-because the enclosing type is not needed.
-
-A compiler constructed virtual destructor in derived classes that do not
-define an explicit destructor that was defined explicit in a base class
-has this bit set as well. Also used on __FUNCTION__ and
-__PRETTY_FUNCTION__ to mark they are ``compiler generated.'' c-decl and
-c-lex.c both want DECL_IGNORED_P set for ``internally generated vars,''
-and ``user-invisible variable.''
-
-Functions built by the C++ front-end such as default destructors,
-virtual destructors and default constructors want to be marked that
-they are compiler generated, but unsure why.
-
-Currently, it is used in an absolute way in the C++ front-end, as an
-optimization, to tell the debug information output routines to not
-generate debugging information that will be output by another separately
-compiled file.
-
-
-@item DECL_VIRTUAL_P
-A flag used on FIELD_DECLs and VAR_DECLs. (Documentation in tree.h is
-wrong.) Used in VAR_DECLs to indicate that the variable is a vtable.
-It is also used in FIELD_DECLs for vtable pointers.
-
-What things can this be used on:
-
- FIELD_DECLs and VAR_DECLs
-
-
-@item DECL_VPARENT
-Used to point to the parent type of the vtable if there is one, else it
-is just the type associated with the vtable. Because of the sharing of
-virtual function tables that goes on, this slot is not very useful, and
-is in fact, not used in the compiler at all. It can be removed.
-
-What things can this be used on:
-
- VAR_DECLs that are virtual function tables
-
-Has values of:
-
- RECORD_TYPEs maybe UNION_TYPEs
-
-
-@item DECL_FCONTEXT
-Used to find the first baseclass in which this FIELD_DECL is defined.
-See also DECL_CONTEXT, DECL_FIELD_CONTEXT and DECL_CLASS_CONTEXT.
-
-How it is used:
-
- Used when writing out debugging information about vfield and
- vbase decls.
-
-What things can this be used on:
-
- FIELD_DECLs that are virtual function pointers
- FIELD_DECLs
-
-
-@item DECL_REFERENCE_SLOT
-Used to hold the initialize for the reference.
-
-What things can this be used on:
-
- PARM_DECLs and VAR_DECLs that have a reference type
-
-
-@item DECL_VINDEX
-Used for FUNCTION_DECLs in two different ways. Before the structure
-containing the FUNCTION_DECL is laid out, DECL_VINDEX may point to a
-FUNCTION_DECL in a base class which is the FUNCTION_DECL which this
-FUNCTION_DECL will replace as a virtual function. When the class is
-laid out, this pointer is changed to an INTEGER_CST node which is
-suitable to find an index into the virtual function table. See
-get_vtable_entry as to how one can find the right index into the virtual
-function table. The first index 0, of a virtual function table it not
-used in the normal way, so the first real index is 1.
-
-DECL_VINDEX may be a TREE_LIST, that would seem to be a list of
-overridden FUNCTION_DECLs. add_virtual_function has code to deal with
-this when it uses the variable base_fndecl_list, but it would seem that
-somehow, it is possible for the TREE_LIST to pursist until method_call,
-and it should not.
-
-
-What things can this be used on:
-
- FUNCTION_DECLs
-
-
-@item DECL_SOURCE_FILE
-Identifies what source file a particular declaration was found in.
-
-Has values of:
-
- "<built-in>" on TYPE_DECLs to mean the typedef is built in
-
-
-@item DECL_SOURCE_LINE
-Identifies what source line number in the source file the declaration
-was found at.
-
-Has values of:
-
-@display
-0 for an undefined label
-
-0 for TYPE_DECLs that are internally generated
-
-0 for FUNCTION_DECLs for functions generated by the compiler
- (not yet, but should be)
-
-0 for ``magic'' arguments to functions, that the user has no
- control over
-@end display
-
-
-@item TREE_USED
-
-Has values of:
-
- 0 for unused labels
-
-
-@item TREE_ADDRESSABLE
-A flag that is set for any type that has a constructor.
-
-
-@item TREE_COMPLEXITY
-They seem a kludge way to track recursion, poping, and pushing. They only
-appear in cp-decl.c and cp-decl2.c, so the are a good candidate for
-proper fixing, and removal.
-
-
-@item TREE_HAS_CONSTRUCTOR
-A flag to indicate when a CALL_EXPR represents a call to a constructor.
-If set, we know that the type of the object, is the complete type of the
-object, and that the value returned is nonnull. When used in this
-fashion, it is an optimization. Can also be used on SAVE_EXPRs to
-indicate when they are of fixed type and nonnull. Can also be used on
-INDIRECT_EXPRs on CALL_EXPRs that represent a call to a constructor.
-
-
-@item TREE_PRIVATE
-Set for FIELD_DECLs by finish_struct. But not uniformly set.
-
-The following routines do something with PRIVATE access:
-build_method_call, alter_access, finish_struct_methods,
-finish_struct, convert_to_aggr, CWriteLanguageDecl, CWriteLanguageType,
-CWriteUseObject, compute_access, lookup_field, dfs_pushdecl,
-GNU_xref_member, dbxout_type_fields, dbxout_type_method_1
-
-
-@item TREE_PROTECTED
-The following routines do something with PROTECTED access:
-build_method_call, alter_access, finish_struct, convert_to_aggr,
-CWriteLanguageDecl, CWriteLanguageType, CWriteUseObject,
-compute_access, lookup_field, GNU_xref_member, dbxout_type_fields,
-dbxout_type_method_1
-
-
-@item TYPE_BINFO
-Used to get the binfo for the type.
-
-Has values of:
-
- TREE_VECs that are binfos
-
-What things can this be used on:
-
- RECORD_TYPEs
-
-
-@item TYPE_BINFO_BASETYPES
-See also BINFO_BASETYPES.
-
-@item TYPE_BINFO_VIRTUALS
-A unique list of functions for the virtual function table. See also
-BINFO_VIRTUALS.
-
-What things can this be used on:
-
- RECORD_TYPEs
-
-
-@item TYPE_BINFO_VTABLE
-Points to the virtual function table associated with the given type.
-See also BINFO_VTABLE.
-
-What things can this be used on:
-
- RECORD_TYPEs
-
-Has values of:
-
- VAR_DECLs that are virtual function tables
-
-
-@item TYPE_NAME
-Names the type.
-
-Has values of:
-
-@display
-0 for things that don't have names.
-should be IDENTIFIER_NODE for RECORD_TYPEs UNION_TYPEs and
- ENUM_TYPEs.
-TYPE_DECL for RECORD_TYPEs, UNION_TYPEs and ENUM_TYPEs, but
- shouldn't be.
-TYPE_DECL for typedefs, unsure why.
-@end display
-
-What things can one use this on:
-
-@display
-TYPE_DECLs
-RECORD_TYPEs
-UNION_TYPEs
-ENUM_TYPEs
-@end display
-
-History:
-
- It currently points to the TYPE_DECL for RECORD_TYPEs,
- UNION_TYPEs and ENUM_TYPEs, but it should be history soon.
-
-
-@item TYPE_METHODS
-Synonym for @code{CLASSTYPE_METHOD_VEC}. Chained together with
-@code{TREE_CHAIN}. @file{dbxout.c} uses this to get at the methods of a
-class.
-
-
-@item TYPE_DECL
-Used to represent typedefs, and used to represent bindings layers.
-
-Components:
-
- DECL_NAME is the name of the typedef. For example, foo would
- be found in the DECL_NAME slot when @code{typedef int foo;} is
- seen.
-
- DECL_SOURCE_LINE identifies what source line number in the
- source file the declaration was found at. A value of 0
- indicates that this TYPE_DECL is just an internal binding layer
- marker, and does not correspond to a user supplied typedef.
-
- DECL_SOURCE_FILE
-
-@item TYPE_FIELDS
-A linked list (via @code{TREE_CHAIN}) of member types of a class. The
-list can contain @code{TYPE_DECL}s, but there can also be other things
-in the list apparently. See also @code{CLASSTYPE_TAGS}.
-
-
-@item TYPE_VIRTUAL_P
-A flag used on a @code{FIELD_DECL} or a @code{VAR_DECL}, indicates it is
-a virtual function table or a pointer to one. When used on a
-@code{FUNCTION_DECL}, indicates that it is a virtual function. When
-used on an @code{IDENTIFIER_NODE}, indicates that a function with this
-same name exists and has been declared virtual.
-
-When used on types, it indicates that the type has virtual functions, or
-is derived from one that does.
-
-Not sure if the above about virtual function tables is still true. See
-also info on @code{DECL_VIRTUAL_P}.
-
-What things can this be used on:
-
- FIELD_DECLs, VAR_DECLs, FUNCTION_DECLs, IDENTIFIER_NODEs
-
-
-@item VF_BASETYPE_VALUE
-Get the associated type from the binfo that caused the given vfield to
-exist. This is the least derived class (the most parent class) that
-needed a virtual function table. It is probably the case that all uses
-of this field are misguided, but they need to be examined on a
-case-by-case basis. See history for more information on why the
-previous statement was made.
-
-Set at @code{finish_base_struct} time.
-
-What things can this be used on:
-
- TREE_LISTs that are vfields
-
-History:
-
- This field was used to determine if a virtual function table's
- slot should be filled in with a certain virtual function, by
- checking to see if the type returned by VF_BASETYPE_VALUE was a
- parent of the context in which the old virtual function existed.
- This incorrectly assumes that a given type _could_ not appear as
- a parent twice in a given inheritance lattice. For single
- inheritance, this would in fact work, because a type could not
- possibly appear more than once in an inheritance lattice, but
- with multiple inheritance, a type can appear more than once.
-
-
-@item VF_BINFO_VALUE
-Identifies the binfo that caused this vfield to exist. If this vfield
-is from the first direct base class that has a virtual function table,
-then VF_BINFO_VALUE is NULL_TREE, otherwise it will be the binfo of the
-direct base where the vfield came from. Can use @code{TREE_VIA_VIRTUAL}
-on result to find out if it is a virtual base class. Related to the
-binfo found by
-
-@example
-get_binfo (VF_BASETYPE_VALUE (vfield), t, 0)
-@end example
-
-@noindent
-where @samp{t} is the type that has the given vfield.
-
-@example
-get_binfo (VF_BASETYPE_VALUE (vfield), t, 0)
-@end example
-
-@noindent
-will return the binfo for the given vfield.
-
-May or may not be set at @code{modify_vtable_entries} time. Set at
-@code{finish_base_struct} time.
-
-What things can this be used on:
-
- TREE_LISTs that are vfields
-
-
-@item VF_DERIVED_VALUE
-Identifies the type of the most derived class of the vfield, excluding
-the class this vfield is for.
-
-Set at @code{finish_base_struct} time.
-
-What things can this be used on:
-
- TREE_LISTs that are vfields
-
-
-@item VF_NORMAL_VALUE
-Identifies the type of the most derived class of the vfield, including
-the class this vfield is for.
-
-Set at @code{finish_base_struct} time.
-
-What things can this be used on:
-
- TREE_LISTs that are vfields
-
-
-@item WRITABLE_VTABLES
-This is a option that can be defined when building the compiler, that
-will cause the compiler to output vtables into the data segment so that
-the vtables maybe written. This is undefined by default, because
-normally the vtables should be unwritable. People that implement object
-I/O facilities may, or people that want to change the dynamic type of
-objects may want to have the vtables writable. Another way of achieving
-this would be to make a copy of the vtable into writable memory, but the
-drawback there is that that method only changes the type for one object.
-
-@end table
-
-@node Typical Behavior, Coding Conventions, Macros, Top
-@section Typical Behavior
-
-@cindex parse errors
-
-Whenever seemingly normal code fails with errors like
-@code{syntax error at `\@{'}, it's highly likely that grokdeclarator is
-returning a NULL_TREE for whatever reason.
-
-@node Coding Conventions, Templates, Typical Behavior, Top
-@section Coding Conventions
-
-It should never be that case that trees are modified in-place by the
-back-end, @emph{unless} it is guaranteed that the semantics are the same
-no matter how shared the tree structure is. @file{fold-const.c} still
-has some cases where this is not true, but rms hypothesizes that this
-will never be a problem.
-
-@node Templates, Access Control, Coding Conventions, Top
-@section Templates
-
-A template is represented by a @code{TEMPLATE_DECL}. The specific
-fields used are:
-
-@table @code
-@item DECL_TEMPLATE_RESULT
-The generic decl on which instantiations are based. This looks just
-like any other decl.
-
-@item DECL_TEMPLATE_PARMS
-The parameters to this template.
-@end table
-
-The generic decl is parsed as much like any other decl as possible,
-given the parameterization. The template decl is not built up until the
-generic decl has been completed. For template classes, a template decl
-is generated for each member function and static data member, as well.
-
-Template members of template classes are represented by a TEMPLATE_DECL
-for the class' parameters around another TEMPLATE_DECL for the member's
-parameters.
-
-All declarations that are instantiations or specializations of templates
-refer to their template and parameters through DECL_TEMPLATE_INFO.
-
-How should I handle parsing member functions with the proper param
-decls? Set them up again or try to use the same ones? Currently we do
-the former. We can probably do this without any extra machinery in
-store_pending_inline, by deducing the parameters from the decl in
-do_pending_inlines. PRE_PARSED_TEMPLATE_DECL?
-
-If a base is a parm, we can't check anything about it. If a base is not
-a parm, we need to check it for name binding. Do finish_base_struct if
-no bases are parameterized (only if none, including indirect, are
-parms). Nah, don't bother trying to do any of this until instantiation
--- we only need to do name binding in advance.
-
-Always set up method vec and fields, inc. synthesized methods. Really?
-We can't know the types of the copy folks, or whether we need a
-destructor, or can have a default ctor, until we know our bases and
-fields. Otherwise, we can assume and fix ourselves later. Hopefully.
-
-@node Access Control, Error Reporting, Templates, Top
-@section Access Control
-The function compute_access returns one of three values:
-
-@table @code
-@item access_public
-means that the field can be accessed by the current lexical scope.
-
-@item access_protected
-means that the field cannot be accessed by the current lexical scope
-because it is protected.
-
-@item access_private
-means that the field cannot be accessed by the current lexical scope
-because it is private.
-@end table
-
-DECL_ACCESS is used for access declarations; alter_access creates a list
-of types and accesses for a given decl.
-
-Formerly, DECL_@{PUBLIC,PROTECTED,PRIVATE@} corresponded to the return
-codes of compute_access and were used as a cache for compute_access.
-Now they are not used at all.
-
-TREE_PROTECTED and TREE_PRIVATE are used to record the access levels
-granted by the containing class. BEWARE: TREE_PUBLIC means something
-completely unrelated to access control!
-
-@node Error Reporting, Parser, Access Control, Top
-@section Error Reporting
-
-The C++ front-end uses a call-back mechanism to allow functions to print
-out reasonable strings for types and functions without putting extra
-logic in the functions where errors are found. The interface is through
-the @code{cp_error} function (or @code{cp_warning}, etc.). The
-syntax is exactly like that of @code{error}, except that a few more
-conversions are supported:
-
-@itemize @bullet
-@item
-%C indicates a value of `enum tree_code'.
-@item
-%D indicates a *_DECL node.
-@item
-%E indicates a *_EXPR node.
-@item
-%L indicates a value of `enum languages'.
-@item
-%P indicates the name of a parameter (i.e. "this", "1", "2", ...)
-@item
-%T indicates a *_TYPE node.
-@item
-%O indicates the name of an operator (MODIFY_EXPR -> "operator =").
-
-@end itemize
-
-There is some overlap between these; for instance, any of the node
-options can be used for printing an identifier (though only @code{%D}
-tries to decipher function names).
-
-For a more verbose message (@code{class foo} as opposed to just @code{foo},
-including the return type for functions), use @code{%#c}.
-To have the line number on the error message indicate the line of the
-DECL, use @code{cp_error_at} and its ilk; to indicate which argument you want,
-use @code{%+D}, or it will default to the first.
-
-@node Parser, Exception Handling, Error Reporting, Top
-@section Parser
-
-Some comments on the parser:
-
-The @code{after_type_declarator} / @code{notype_declarator} hack is
-necessary in order to allow redeclarations of @code{TYPENAME}s, for
-instance
-
-@example
-typedef int foo;
-class A @{
- char *foo;
-@};
-@end example
-
-In the above, the first @code{foo} is parsed as a @code{notype_declarator},
-and the second as a @code{after_type_declarator}.
-
-Ambiguities:
-
-There are currently four reduce/reduce ambiguities in the parser. They are:
-
-1) Between @code{template_parm} and
-@code{named_class_head_sans_basetype}, for the tokens @code{aggr
-identifier}. This situation occurs in code looking like
-
-@example
-template <class T> class A @{ @};
-@end example
-
-It is ambiguous whether @code{class T} should be parsed as the
-declaration of a template type parameter named @code{T} or an unnamed
-constant parameter of type @code{class T}. Section 14.6, paragraph 3 of
-the January '94 working paper states that the first interpretation is
-the correct one. This ambiguity results in two reduce/reduce conflicts.
-
-2) Between @code{primary} and @code{type_id} for code like @samp{int()}
-in places where both can be accepted, such as the argument to
-@code{sizeof}. Section 8.1 of the pre-San Diego working paper specifies
-that these ambiguous constructs will be interpreted as @code{typename}s.
-This ambiguity results in six reduce/reduce conflicts between
-@samp{absdcl} and @samp{functional_cast}.
-
-3) Between @code{functional_cast} and
-@code{complex_direct_notype_declarator}, for various token strings.
-This situation occurs in code looking like
-
-@example
-int (*a);
-@end example
-
-This code is ambiguous; it could be a declaration of the variable
-@samp{a} as a pointer to @samp{int}, or it could be a functional cast of
-@samp{*a} to @samp{int}. Section 6.8 specifies that the former
-interpretation is correct. This ambiguity results in 7 reduce/reduce
-conflicts. Another aspect of this ambiguity is code like 'int (x[2]);',
-which is resolved at the '[' and accounts for 6 reduce/reduce conflicts
-between @samp{direct_notype_declarator} and
-@samp{primary}/@samp{overqualified_id}. Finally, there are 4 r/r
-conflicts between @samp{expr_or_declarator} and @samp{primary} over code
-like 'int (a);', which could probably be resolved but would also
-probably be more trouble than it's worth. In all, this situation
-accounts for 17 conflicts. Ack!
-
-The second case above is responsible for the failure to parse 'LinppFile
-ppfile (String (argv[1]), &outs, argc, argv);' (from Rogue Wave
-Math.h++) as an object declaration, and must be fixed so that it does
-not resolve until later.
-
-4) Indirectly between @code{after_type_declarator} and @code{parm}, for
-type names. This occurs in (as one example) code like
-
-@example
-typedef int foo, bar;
-class A @{
- foo (bar);
-@};
-@end example
-
-What is @code{bar} inside the class definition? We currently interpret
-it as a @code{parm}, as does Cfront, but IBM xlC interprets it as an
-@code{after_type_declarator}. I believe that xlC is correct, in light
-of 7.1p2, which says "The longest sequence of @i{decl-specifiers} that
-could possibly be a type name is taken as the @i{decl-specifier-seq} of
-a @i{declaration}." However, it seems clear that this rule must be
-violated in the case of constructors. This ambiguity accounts for 8
-conflicts.
-
-Unlike the others, this ambiguity is not recognized by the Working Paper.
-
-@node Exception Handling, Free Store, Parser, Top
-@section Exception Handling
-
-Note, exception handling in g++ is still under development.
-
-This section describes the mapping of C++ exceptions in the C++
-front-end, into the back-end exception handling framework.
-
-The basic mechanism of exception handling in the back-end is
-unwind-protect a la elisp. This is a general, robust, and language
-independent representation for exceptions.
-
-The C++ front-end exceptions are mapping into the unwind-protect
-semantics by the C++ front-end. The mapping is describe below.
-
-When -frtti is used, rtti is used to do exception object type checking,
-when it isn't used, the encoded name for the type of the object being
-thrown is used instead. All code that originates exceptions, even code
-that throws exceptions as a side effect, like dynamic casting, and all
-code that catches exceptions must be compiled with either -frtti, or
--fno-rtti. It is not possible to mix rtti base exception handling
-objects with code that doesn't use rtti. The exceptions to this, are
-code that doesn't catch or throw exceptions, catch (...), and code that
-just rethrows an exception.
-
-Currently we use the normal mangling used in building functions names
-(int's are "i", const char * is PCc) to build the non-rtti base type
-descriptors for exception handling. These descriptors are just plain
-NULL terminated strings, and internally they are passed around as char
-*.
-
-In C++, all cleanups should be protected by exception regions. The
-region starts just after the reason why the cleanup is created has
-ended. For example, with an automatic variable, that has a constructor,
-it would be right after the constructor is run. The region ends just
-before the finalization is expanded. Since the backend may expand the
-cleanup multiple times along different paths, once for normal end of the
-region, once for non-local gotos, once for returns, etc, the backend
-must take special care to protect the finalization expansion, if the
-expansion is for any other reason than normal region end, and it is
-`inline' (it is inside the exception region). The backend can either
-choose to move them out of line, or it can created an exception region
-over the finalization to protect it, and in the handler associated with
-it, it would not run the finalization as it otherwise would have, but
-rather just rethrow to the outer handler, careful to skip the normal
-handler for the original region.
-
-In Ada, they will use the more runtime intensive approach of having
-fewer regions, but at the cost of additional work at run time, to keep a
-list of things that need cleanups. When a variable has finished
-construction, they add the cleanup to the list, when the come to the end
-of the lifetime of the variable, the run the list down. If the take a
-hit before the section finishes normally, they examine the list for
-actions to perform. I hope they add this logic into the back-end, as it
-would be nice to get that alternative approach in C++.
-
-On an rs6000, xlC stores exception objects on that stack, under the try
-block. When is unwinds down into a handler, the frame pointer is
-adjusted back to the normal value for the frame in which the handler
-resides, and the stack pointer is left unchanged from the time at which
-the object was thrown. This is so that there is always someplace for
-the exception object, and nothing can overwrite it, once we start
-throwing. The only bad part, is that the stack remains large.
-
-The below points out some things that work in g++'s exception handling.
-
-All completely constructed temps and local variables are cleaned up in
-all unwinded scopes. Completely constructed parts of partially
-constructed objects are cleaned up. This includes partially built
-arrays. Exception specifications are now handled. Thrown objects are
-now cleaned up all the time. We can now tell if we have an active
-exception being thrown or not (__eh_type != 0). We use this to call
-terminate if someone does a throw; without there being an active
-exception object. uncaught_exception () works. Exception handling
-should work right if you optimize. Exception handling should work with
--fpic or -fPIC.
-
-The below points out some flaws in g++'s exception handling, as it now
-stands.
-
-Only exact type matching or reference matching of throw types works when
--fno-rtti is used. Only works on a SPARC (like Suns) (both -mflat and
--mno-flat models work), SPARClite, Hitachi SH, i386, arm, rs6000,
-PowerPC, Alpha, mips, VAX, m68k and z8k machines. SPARC v9 may not
-work. HPPA is mostly done, but throwing between a shared library and
-user code doesn't yet work. Some targets have support for data-driven
-unwinding. Partial support is in for all other machines, but a stack
-unwinder called __unwind_function has to be written, and added to
-libgcc2 for them. The new EH code doesn't rely upon the
-__unwind_function for C++ code, instead it creates per function
-unwinders right inside the function, unfortunately, on many platforms
-the definition of RETURN_ADDR_RTX in the tm.h file for the machine port
-is wrong. See below for details on __unwind_function. RTL_EXPRs for EH
-cond variables for && and || exprs should probably be wrapped in
-UNSAVE_EXPRs, and RTL_EXPRs tweaked so that they can be unsaved.
-
-We only do pointer conversions on exception matching a la 15.3 p2 case
-3: `A handler with type T, const T, T&, or const T& is a match for a
-throw-expression with an object of type E if [3]T is a pointer type and
-E is a pointer type that can be converted to T by a standard pointer
-conversion (_conv.ptr_) not involving conversions to pointers to private
-or protected base classes.' when -frtti is given.
-
-We don't call delete on new expressions that die because the ctor threw
-an exception. See except/18 for a test case.
-
-15.2 para 13: The exception being handled should be rethrown if control
-reaches the end of a handler of the function-try-block of a constructor
-or destructor, right now, it is not.
-
-15.2 para 12: If a return statement appears in a handler of
-function-try-block of a constructor, the program is ill-formed, but this
-isn't diagnosed.
-
-15.2 para 11: If the handlers of a function-try-block contain a jump
-into the body of a constructor or destructor, the program is ill-formed,
-but this isn't diagnosed.
-
-15.2 para 9: Check that the fully constructed base classes and members
-of an object are destroyed before entering the handler of a
-function-try-block of a constructor or destructor for that object.
-
-build_exception_variant should sort the incoming list, so that it
-implements set compares, not exact list equality. Type smashing should
-smash exception specifications using set union.
-
-Thrown objects are usually allocated on the heap, in the usual way. If
-one runs out of heap space, throwing an object will probably never work.
-This could be relaxed some by passing an __in_chrg parameter to track
-who has control over the exception object. Thrown objects are not
-allocated on the heap when they are pointer to object types. We should
-extend it so that all small (<4*sizeof(void*)) objects are stored
-directly, instead of allocated on the heap.
-
-When the backend returns a value, it can create new exception regions
-that need protecting. The new region should rethrow the object in
-context of the last associated cleanup that ran to completion.
-
-The structure of the code that is generated for C++ exception handling
-code is shown below:
-
-@example
-Ln: throw value;
- copy value onto heap
- jump throw (Ln, id, address of copy of value on heap)
-
- try @{
-+Lstart: the start of the main EH region
-|... ...
-+Lend: the end of the main EH region
- @} catch (T o) @{
- ...1
- @}
-Lresume:
- nop used to make sure there is something before
- the next region ends, if there is one
-... ...
-
- jump Ldone
-[
-Lmainhandler: handler for the region Lstart-Lend
- cleanup
-] zero or more, depending upon automatic vars with dtors
-+Lpartial:
-| jump Lover
-+Lhere:
- rethrow (Lhere, same id, same obj);
-Lterm: handler for the region Lpartial-Lhere
- call terminate
-Lover:
-[
- [
- call throw_type_match
- if (eq) @{
- ] these lines disappear when there is no catch condition
-+Lsregion2:
-| ...1
-| jump Lresume
-|Lhandler: handler for the region Lsregion2-Leregion2
-| rethrow (Lresume, same id, same obj);
-+Leregion2
- @}
-] there are zero or more of these sections, depending upon how many
- catch clauses there are
------------------------------ expand_end_all_catch --------------------------
- here we have fallen off the end of all catch
- clauses, so we rethrow to outer
- rethrow (Lresume, same id, same obj);
------------------------------ expand_end_all_catch --------------------------
-[
-L1: maybe throw routine
-] depending upon if we have expanded it or not
-Ldone:
- ret
-
-start_all_catch emits labels: Lresume,
-
-@end example
-
-The __unwind_function takes a pointer to the throw handler, and is
-expected to pop the stack frame that was built to call it, as well as
-the frame underneath and then jump to the throw handler. It must
-restore all registers to their proper values as well as all other
-machine state as determined by the context in which we are unwinding
-into. The way I normally start is to compile:
-
- void *g;
- foo(void* a) @{ g = a; @}
-
-with -S, and change the thing that alters the PC (return, or ret
-usually) to not alter the PC, making sure to leave all other semantics
-(like adjusting the stack pointer, or frame pointers) in. After that,
-replicate the prologue once more at the end, again, changing the PC
-altering instructions, and finally, at the very end, jump to `g'.
-
-It takes about a week to write this routine, if someone wants to
-volunteer to write this routine for any architecture, exception support
-for that architecture will be added to g++. Please send in those code
-donations. One other thing that needs to be done, is to double check
-that __builtin_return_address (0) works.
-
-@subsection Specific Targets
-
-For the alpha, the __unwind_function will be something resembling:
-
-@example
-void
-__unwind_function(void *ptr)
-@{
- /* First frame */
- asm ("ldq $15, 8($30)"); /* get the saved frame ptr; 15 is fp, 30 is sp */
- asm ("bis $15, $15, $30"); /* reload sp with the fp we found */
-
- /* Second frame */
- asm ("ldq $15, 8($30)"); /* fp */
- asm ("bis $15, $15, $30"); /* reload sp with the fp we found */
-
- /* Return */
- asm ("ret $31, ($16), 1"); /* return to PTR, stored in a0 */
-@}
-@end example
-
-@noindent
-However, there are a few problems preventing it from working. First of
-all, the gcc-internal function @code{__builtin_return_address} needs to
-work given an argument of 0 for the alpha. As it stands as of August
-30th, 1995, the code for @code{BUILT_IN_RETURN_ADDRESS} in @file{expr.c}
-will definitely not work on the alpha. Instead, we need to define
-the macros @code{DYNAMIC_CHAIN_ADDRESS} (maybe),
-@code{RETURN_ADDR_IN_PREVIOUS_FRAME}, and definitely need a new
-definition for @code{RETURN_ADDR_RTX}.
-
-In addition (and more importantly), we need a way to reliably find the
-frame pointer on the alpha. The use of the value 8 above to restore the
-frame pointer (register 15) is incorrect. On many systems, the frame
-pointer is consistently offset to a specific point on the stack. On the
-alpha, however, the frame pointer is pushed last. First the return
-address is stored, then any other registers are saved (e.g., @code{s0}),
-and finally the frame pointer is put in place. So @code{fp} could have
-an offset of 8, but if the calling function saved any registers at all,
-they add to the offset.
-
-The only places the frame size is noted are with the @samp{.frame}
-directive, for use by the debugger and the OSF exception handling model
-(useless to us), and in the initial computation of the new value for
-@code{sp}, the stack pointer. For example, the function may start with:
-
-@example
-lda $30,-32($30)
-.frame $15,32,$26,0
-@end example
-
-@noindent
-The 32 above is exactly the value we need. With this, we can be sure
-that the frame pointer is stored 8 bytes less---in this case, at 24(sp)).
-The drawback is that there is no way that I (Brendan) have found to let
-us discover the size of a previous frame @emph{inside} the definition
-of @code{__unwind_function}.
-
-So to accomplish exception handling support on the alpha, we need two
-things: first, a way to figure out where the frame pointer was stored,
-and second, a functional @code{__builtin_return_address} implementation
-for except.c to be able to use it.
-
-Or just support DWARF 2 unwind info.
-
-@subsection New Backend Exception Support
-
-This subsection discusses various aspects of the design of the
-data-driven model being implemented for the exception handling backend.
-
-The goal is to generate enough data during the compilation of user code,
-such that we can dynamically unwind through functions at run time with a
-single routine (@code{__throw}) that lives in libgcc.a, built by the
-compiler, and dispatch into associated exception handlers.
-
-This information is generated by the DWARF 2 debugging backend, and
-includes all of the information __throw needs to unwind an arbitrary
-frame. It specifies where all of the saved registers and the return
-address can be found at any point in the function.
-
-Major disadvantages when enabling exceptions are:
-
-@itemize @bullet
-@item
-Code that uses caller saved registers, can't, when flow can be
-transferred into that code from an exception handler. In high performance
-code this should not usually be true, so the effects should be minimal.
-
-@end itemize
-
-@subsection Backend Exception Support
-
-The backend must be extended to fully support exceptions. Right now
-there are a few hooks into the alpha exception handling backend that
-resides in the C++ frontend from that backend that allows exception
-handling to work in g++. An exception region is a segment of generated
-code that has a handler associated with it. The exception regions are
-denoted in the generated code as address ranges denoted by a starting PC
-value and an ending PC value of the region. Some of the limitations
-with this scheme are:
-
-@itemize @bullet
-@item
-The backend replicates insns for such things as loop unrolling and
-function inlining. Right now, there are no hooks into the frontend's
-exception handling backend to handle the replication of insns. When
-replication happens, a new exception region descriptor needs to be
-generated for the new region.
-
-@item
-The backend expects to be able to rearrange code, for things like jump
-optimization. Any rearranging of the code needs have exception region
-descriptors updated appropriately.
-
-@item
-The backend can eliminate dead code. Any associated exception region
-descriptor that refers to fully contained code that has been eliminated
-should also be removed, although not doing this is harmless in terms of
-semantics.
-
-@end itemize
-
-The above is not meant to be exhaustive, but does include all things I
-have thought of so far. I am sure other limitations exist.
-
-Below are some notes on the migration of the exception handling code
-backend from the C++ frontend to the backend.
-
-NOTEs are to be used to denote the start of an exception region, and the
-end of the region. I presume that the interface used to generate these
-notes in the backend would be two functions, start_exception_region and
-end_exception_region (or something like that). The frontends are
-required to call them in pairs. When marking the end of a region, an
-argument can be passed to indicate the handler for the marked region.
-This can be passed in many ways, currently a tree is used. Another
-possibility would be insns for the handler, or a label that denotes a
-handler. I have a feeling insns might be the best way to pass it.
-Semantics are, if an exception is thrown inside the region, control is
-transferred unconditionally to the handler. If control passes through
-the handler, then the backend is to rethrow the exception, in the
-context of the end of the original region. The handler is protected by
-the conventional mechanisms; it is the frontend's responsibility to
-protect the handler, if special semantics are required.
-
-This is a very low level view, and it would be nice is the backend
-supported a somewhat higher level view in addition to this view. This
-higher level could include source line number, name of the source file,
-name of the language that threw the exception and possibly the name of
-the exception. Kenner may want to rope you into doing more than just
-the basics required by C++. You will have to resolve this. He may want
-you to do support for non-local gotos, first scan for exception handler,
-if none is found, allow the debugger to be entered, without any cleanups
-being done. To do this, the backend would have to know the difference
-between a cleanup-rethrower, and a real handler, if would also have to
-have a way to know if a handler `matches' a thrown exception, and this
-is frontend specific.
-
-The stack unwinder is one of the hardest parts to do. It is highly
-machine dependent. The form that kenner seems to like was a couple of
-macros, that would do the machine dependent grunt work. One preexisting
-function that might be of some use is __builtin_return_address (). One
-macro he seemed to want was __builtin_return_address, and the other
-would do the hard work of fixing up the registers, adjusting the stack
-pointer, frame pointer, arg pointer and so on.
-
-
-@node Free Store, Mangling, Exception Handling, Top
-@section Free Store
-
-@code{operator new []} adds a magic cookie to the beginning of arrays
-for which the number of elements will be needed by @code{operator delete
-[]}. These are arrays of objects with destructors and arrays of objects
-that define @code{operator delete []} with the optional size_t argument.
-This cookie can be examined from a program as follows:
-
-@example
-typedef unsigned long size_t;
-extern "C" int printf (const char *, ...);
-
-size_t nelts (void *p)
-@{
- struct cookie @{
- size_t nelts __attribute__ ((aligned (sizeof (double))));
- @};
-
- cookie *cp = (cookie *)p;
- --cp;
-
- return cp->nelts;
-@}
-
-struct A @{
- ~A() @{ @}
-@};
-
-main()
-@{
- A *ap = new A[3];
- printf ("%ld\n", nelts (ap));
-@}
-@end example
-
-@section Linkage
-The linkage code in g++ is horribly twisted in order to meet two design goals:
-
-1) Avoid unnecessary emission of inlines and vtables.
-
-2) Support pedantic assemblers like the one in AIX.
-
-To meet the first goal, we defer emission of inlines and vtables until
-the end of the translation unit, where we can decide whether or not they
-are needed, and how to emit them if they are.
-
-@node Mangling, Vtables, Free Store, Top
-@section Function name mangling for C++ and Java
-
-Both C++ and Jave provide overloaded function and methods,
-which are methods with the same types but different parameter lists.
-Selecting the correct version is done at compile time.
-Though the overloaded functions have the same name in the source code,
-they need to be translated into different assembler-level names,
-since typical assemblers and linkers cannot handle overloading.
-This process of encoding the parameter types with the method name
-into a unique name is called @dfn{name mangling}. The inverse
-process is called @dfn{demangling}.
-
-It is convenient that C++ and Java use compatible mangling schemes,
-since the makes life easier for tools such as gdb, and it eases
-integration between C++ and Java.
-
-Note there is also a standard "Jave Native Interface" (JNI) which
-implements a different calling convention, and uses a different
-mangling scheme. The JNI is a rather abstract ABI so Java can call methods
-written in C or C++;
-we are concerned here about a lower-level interface primarily
-intended for methods written in Java, but that can also be used for C++
-(and less easily C).
-
-Note that on systems that follow BSD tradition, a C identifier @code{var}
-would get "mangled" into the assembler name @samp{_var}. On such
-systems, all other mangled names are also prefixed by a @samp{_}
-which is not shown in the following examples.
-
-@subsection Method name mangling
-
-C++ mangles a method by emitting the function name, followed by @code{__},
-followed by encodings of any method qualifiers (such as @code{const}),
-followed by the mangling of the method's class,
-followed by the mangling of the parameters, in order.
-
-For example @code{Foo::bar(int, long) const} is mangled
-as @samp{bar__C3Fooil}.
-
-For a constructor, the method name is left out.
-That is @code{Foo::Foo(int, long) const} is mangled
-as @samp{__C3Fooil}.
-
-GNU Java does the same.
-
-@subsection Primitive types
-
-The C++ types @code{int}, @code{long}, @code{short}, @code{char},
-and @code{long long} are mangled as @samp{i}, @samp{l},
-@samp{s}, @samp{c}, and @samp{x}, respectively.
-The corresponding unsigned types have @samp{U} prefixed
-to the mangling. The type @code{signed char} is mangled @samp{Sc}.
-
-The C++ and Java floating-point types @code{float} and @code{double}
-are mangled as @samp{f} and @samp{d} respectively.
-
-The C++ @code{bool} type and the Java @code{boolean} type are
-mangled as @samp{b}.
-
-The C++ @code{wchar_t} and the Java @code{char} types are
-mangled as @samp{w}.
-
-The Java integral types @code{byte}, @code{short}, @code{int}
-and @code{long} are mangled as @samp{c}, @samp{s}, @samp{i},
-and @samp{x}, respectively.
-
-C++ code that has included @code{javatypes.h} will mangle
-the typedefs @code{jbyte}, @code{jshort}, @code{jint}
-and @code{jlong} as respectively @samp{c}, @samp{s}, @samp{i},
-and @samp{x}. (This has not been implemented yet.)
-
-@subsection Mangling of simple names
-
-A simple class, package, template, or namespace name is
-encoded as the number of characters in the name, followed by
-the actual characters. Thus the class @code{Foo}
-is encoded as @samp{3Foo}.
-
-If any of the characters in the name are not alphanumeric
-(i.e not one of the standard ASCII letters, digits, or '_'),
-or the initial character is a digit, then the name is
-mangled as a sequence of encoded Unicode letters.
-A Unicode encoding starts with a @samp{U} to indicate
-that Unicode escapes are used, followed by the number of
-bytes used by the Unicode encoding, followed by the bytes
-representing the encoding. ASSCI letters and
-non-initial digits are encoded without change. However, all
-other characters (including underscore and initial digits) are
-translated into a sequence starting with an underscore,
-followed by the big-endian 4-hex-digit lower-case encoding of the character.
-
-If a method name contains Unicode-escaped characters, the
-entire mangled method name is followed by a @samp{U}.
-
-For example, the method @code{X\u0319::M\u002B(int)} is encoded as
-@samp{M_002b__U6X_0319iU}.
-
-
-@subsection Pointer and reference types
-
-A C++ pointer type is mangled as @samp{P} followed by the
-mangling of the type pointed to.
-
-A C++ reference type as mangled as @samp{R} followed by the
-mangling of the type referenced.
-
-A Java object reference type is equivalent
-to a C++ pointer parameter, so we mangle such an parameter type
-as @samp{P} followed by the mangling of the class name.
-
-@subsection Squangled type compression
-
-Squangling (enabled with the @samp{-fsquangle} option), utilizes the
-@samp{B} code to indicate reuse of a previously seen type within an
-indentifier. Types are recognized in a left to right manner and given
-increasing values, which are appended to the code in the standard
-manner. Ie, multiple digit numbers are delimited by @samp{_}
-characters. A type is considered to be any non primitive type,
-regardless of whether its a parameter, template parameter, or entire
-template. Certain codes are considered modifiers of a type, and are not
-included as part of the type. These are the @samp{C}, @samp{V},
-@samp{P}, @samp{A}, @samp{R}, @samp{U} and @samp{u} codes, denoting
-constant, volatile, pointer, array, reference, unsigned, and restrict.
-These codes may precede a @samp{B} type in order to make the required
-modifications to the type.
-
-For example:
-@example
-template <class T> class class1 @{ @};
-
-template <class T> class class2 @{ @};
-
-class class3 @{ @};
-
-int f(class2<class1<class3> > a ,int b, const class1<class3>&c, class3 *d) @{ @}
-
- B0 -> class2<class1<class3>
- B1 -> class1<class3>
- B2 -> class3
-@end example
-Produces the mangled name @samp{f__FGt6class21Zt6class11Z6class3iRCB1PB2}.
-The int parameter is a basic type, and does not receive a B encoding...
-
-@subsection Qualified names
-
-Both C++ and Java allow a class to be lexically nested inside another
-class. C++ also supports namespaces (not yet implemented by G++).
-Java also supports packages.
-
-These are all mangled the same way: First the letter @samp{Q}
-indicates that we are emitting a qualified name.
-That is followed by the number of parts in the qualified name.
-If that number is 9 or less, it is emitted with no delimiters.
-Otherwise, an underscore is written before and after the count.
-Then follows each part of the qualified name, as described above.
-
-For example @code{Foo::\u0319::Bar} is encoded as
-@samp{Q33FooU5_03193Bar}.
-
-Squangling utilizes the the letter @samp{K} to indicate a
-remembered portion of a qualified name. As qualified names are processed
-for an identifier, the names are numbered and remembered in a
-manner similar to the @samp{B} type compression code.
-Names are recognized left to right, and given increasing values, which are
-appended to the code in the standard manner. ie, multiple digit numbers
-are delimited by @samp{_} characters.
-
-For example
-@example
-class Andrew
-@{
- class WasHere
- @{
- class AndHereToo
- @{
- @};
- @};
-@};
-
-f(Andrew&r1, Andrew::WasHere& r2, Andrew::WasHere::AndHereToo& r3) @{ @}
-
- K0 -> Andrew
- K1 -> Andrew::WasHere
- K2 -> Andrew::WasHere::AndHereToo
-@end example
-Function @samp{f()} would be mangled as :
-@samp{f__FR6AndrewRQ2K07WasHereRQ2K110AndHereToo}
-
-There are some occasions when either a @samp{B} or @samp{K} code could
-be chosen, preference is always given to the @samp{B} code. Ie, the example
-in the section on @samp{B} mangling could have used a @samp{K} code
-instead of @samp{B2}.
-
-@subsection Templates
-
-A class template instantiation is encoded as the letter @samp{t},
-followed by the encoding of the template name, followed
-the number of template parameters, followed by encoding of the template
-parameters. If a template parameter is a type, it is written
-as a @samp{Z} followed by the encoding of the type.
-
-A function template specialization (either an instantiation or an
-explicit specialization) is encoded by an @samp{H} followed by the
-encoding of the template parameters, as described above, followed by an
-@samp{_}, the encoding of the argument types to the template function
-(not the specialization), another @samp{_}, and the return type. (Like
-the argument types, the return type is the return type of the function
-template, not the specialization.) Template parameters in the argument
-and return types are encoded by an @samp{X} for type parameters, or a
-@samp{Y} for constant parameters, an index indicating their position
-in the template parameter list declaration, and their template depth.
-
-@subsection Arrays
-
-C++ array types are mangled by emitting @samp{A}, followed by
-the length of the array, followed by an @samp{_}, followed by
-the mangling of the element type. Of course, normally
-array parameter types decay into a pointer types, so you
-don't see this.
-
-Java arrays are objects. A Java type @code{T[]} is mangled
-as if it were the C++ type @code{JArray<T>}.
-For example @code{java.lang.String[]} is encoded as
-@samp{Pt6JArray1ZPQ34java4lang6String}.
-
-@subsection Static fields
-
-Both C++ and Java classes can have static fields.
-These are allocated statically, and are shared among all instances.
-
-The mangling starts with a prefix (@samp{_} in most systems), which is
-followed by the mangling
-of the class name, followed by the "joiner" and finally the field name.
-The joiner (see @code{JOINER} in @code{cp-tree.h}) is a special
-separator character. For historical reasons (and idiosyncracies
-of assembler syntax) it can @samp{$} or @samp{.} (or even
-@samp{_} on a few systems). If the joiner is @samp{_} then the prefix
-is @samp{__static_} instead of just @samp{_}.
-
-For example @code{Foo::Bar::var} (or @code{Foo.Bar.var} in Java syntax)
-would be encoded as @samp{_Q23Foo3Bar$var} or @samp{_Q23Foo3Bar.var}
-(or rarely @samp{__static_Q23Foo3Bar_var}).
-
-If the name of a static variable needs Unicode escapes,
-the Unicode indicator @samp{U} comes before the "joiner".
-This @code{\u1234Foo::var\u3445} becomes @code{_U8_1234FooU.var_3445}.
-
-@subsection Table of demangling code characters
-
-The following special characters are used in mangling:
-
-@table @samp
-@item A
-Indicates a C++ array type.
-
-@item b
-Encodes the C++ @code{bool} type,
-and the Java @code{boolean} type.
-
-@item B
-Used for squangling. Similar in concept to the 'T' non-squangled code.
-
-@item c
-Encodes the C++ @code{char} type, and the Java @code{byte} type.
-
-@item C
-A modifier to indicate a @code{const} type.
-Also used to indicate a @code{const} member function
-(in which cases it precedes the encoding of the method's class).
-
-@item d
-Encodes the C++ and Java @code{double} types.
-
-@item e
-Indicates extra unknown arguments @code{...}.
-
-@item E
-Indicates the opening parenthesis of an expression.
-
-@item f
-Encodes the C++ and Java @code{float} types.
-
-@item F
-Used to indicate a function type.
-
-@item H
-Used to indicate a template function.
-
-@item i
-Encodes the C++ and Java @code{int} types.
-
-@item I
-Encodes typedef names of the form @code{int@var{n}_t}, where @var{n} is a
-positive decimal number. The @samp{I} is followed by either two
-hexidecimal digits, which encode the value of @var{n}, or by an
-arbitrary number of hexidecimal digits between underscores. For
-example, @samp{I40} encodes the type @code{int64_t}, and @samp{I_200_}
-encodes the type @code{int512_t}.
-
-@item J
-Indicates a complex type.
-
-@item K
-Used by squangling to compress qualified names.
-
-@item l
-Encodes the C++ @code{long} type.
-
-@item n
-Immediate repeated type. Followed by the repeat count.
-
-@item N
-Repeated type. Followed by the repeat count of the repeated type,
-followed by the type index of the repeated type. Due to a bug in
-g++ 2.7.2, this is only generated if index is 0. Superceded by
-@samp{n} when squangling.
-
-@item P
-Indicates a pointer type. Followed by the type pointed to.
-
-@item Q
-Used to mangle qualified names, which arise from nested classes.
-Also used for namespaces.
-In Java used to mangle package-qualified names, and inner classes.
-
-@item r
-Encodes the GNU C++ @code{long double} type.
-
-@item R
-Indicates a reference type. Followed by the referenced type.
-
-@item s
-Encodes the C++ and java @code{short} types.
-
-@item S
-A modifier that indicates that the following integer type is signed.
-Only used with @code{char}.
-
-Also used as a modifier to indicate a static member function.
-
-@item t
-Indicates a template instantiation.
-
-@item T
-A back reference to a previously seen type.
-
-@item U
-A modifier that indicates that the following integer type is unsigned.
-Also used to indicate that the following class or namespace name
-is encoded using Unicode-mangling.
-
-@item u
-The @code{restrict} type qualifier.
-
-@item v
-Encodes the C++ and Java @code{void} types.
-
-@item V
-A modifier for a @code{volatile} type or method.
-
-@item w
-Encodes the C++ @code{wchar_t} type, and the Java @code{char} types.
-
-@item W
-Indicates the closing parenthesis of an expression.
-
-@item x
-Encodes the GNU C++ @code{long long} type, and the Java @code{long} type.
-
-@item X
-Encodes a template type parameter, when part of a function type.
-
-@item Y
-Encodes a template constant parameter, when part of a function type.
-
-@item Z
-Used for template type parameters.
-
-@end table
-
-The letters @samp{G}, @samp{M}, @samp{O}, and @samp{p}
-also seem to be used for obscure purposes ...
-
-@node Vtables, Concept Index, Mangling, Top
-@section Virtual Tables
-
-In order to invoke virtual functions, GNU C++ uses virtual tables. Each
-virtual function gets an index, and the table entry points to the
-overridden function to call. Sometimes, and adjustment to the this
-pointer has to be made before calling a virtual function:
-
-@example
-struct A@{
- int i;
- virtual void foo();
-@};
-
-struct B@{
- int j;
- virtual void bar();
-@};
-
-struct C:A,B@{
- virtual void bar();
-@};
-
-void C::bar()
-@{
- i++;
-@}
-
-int main()
-@{
- C *c = new C;
- B *b = c;
- c->bar();
-@}
-@end example
-
-Here, casting from @samp{c} to @samp{b} adds an offset. When @samp{bar}
-is called, this offset needs to be subtracted, so that @samp{C::bar} can
-properly access @samp{i}. One approach of achieving this is to use
-@emph{thunks}, which are small half-functions put into the virtual
-table. The modify the first argument (the @samp{this} pointer), and then
-jump into the real function.
-
-The other (traditional) approach is to have an additional integer in the
-virtual table which is added to this. This is an additional overhead
-both at the function call, and in the size of virtual tables: In the
-case of single inheritance (or for the first base class), these integers
-will always be zero.
-
-@subsection Virtual Base Classes with Virtual Tables
-
-In case of virtual bases, the code is even more
-complicated. Constructors and destructors need to know whether they are
-"in charge" of the virtual bases, and an implicit integer
-@samp{__in_chrg} for that purpose.
-
-@example
-struct A@{
- int i;
- virtual void bar();
- void call_bar()@{bar();@}
-@};
-
-struct B:virtual A@{
- B();
- int j;
- virtual void bar();
-@};
-
-B::B()@{
- call_bar();
-@}
-
-struct C@{
- int k;
-@};
-
-struct D:C,B@{
- int l;
- virtual void bar();
-@};
-
-@end example
-
-When constructing an instance of B, it will have the following layout:
-@samp{vbase pointer to A}, @samp{j}, @samp{A virtual table}, @samp{i}.
-On a 32-bit machine, downcasting from @samp{A*} to @samp{B*} would need
-to subtract 8, which would be the thunk executed when calling
-@samp{B::bar} inside @samp{call_bar}.
-
-When constructing an instance of D, it will have a different layout:
-@samp{k}, @samp{vbase pointer to A}, @samp{j}, @samp{l}, @samp{A virtual
-table}, @samp{i}. So, when downcasting from @samp{A*} to @samp{B*} in a
-@samp{D} object, the offset would be @samp{12}.
-
-This means that during construction of the @samp{B} base of a @samp{D}
-object, a virtual table is needed which has a @samp{-12} thunk to
-@samp{B::bar}. This is @emph{only} needed during construction and
-destruction, as the full object will use a @samp{-16} thunk to
-@samp{D::bar}.
-
-In order to implement this, the compiler generates an implicit argument
-(in addition to @code{__in_chrg}): the virtual list argument
-@code{__vlist}. This is a list of virtual tables needed during
-construction and destruction. The virtual pointers are ordered in the
-way they are used during construction; the destructors will process the
-array in reverse order. The ordering is as follows:
-@itemize @bullet
-@item
-If the class is in charge, the vlist starts with virtual table pointers
-for the virtual bases that have virtual bases themselves. Here, only
-@emph{polymorphic} virtual bases (pvbases) are interesting: if a vbase
-has no virtual functions, it doesn't have a virtual table.
-
-@item
-Next, the vlist has virtual tables for the initialization of the
-non-virtual bases. These bases are not in charge, so the layout is
-recursive, but ignores virtual bases during recursion.
-
-@item
-Next, there is a number of virtual tables for each virtual base. These
-are sorted in the order in which virtual bases are constructed. Each
-virtual base may have more than one @code{vfield}, and therefore require
-more than one @code{vtable}. The order of vtables is the same as used
-when initializing vfields of non-virtual bases in a constructor.
-@end itemize
-
-The compiler emits a virtual table list in a variable mangled as
-@code{__vl.classname}.
-
-Class with virtual bases, but without pvbases, only have the
-@code{__in_chrg} argument to their ctors and dtors: they don't have any
-vfields in the vbases to initialize.
-
-A further problem arises with virtual destructors: A destructor
-typically has only the @code{__in_chrg} argument, which also indicates
-whether the destructor should call @code{operator delete}. A dtor of a
-class with pvbases has an additional argument. Unfortunately, a caller
-of a virtual dtor might not know whether to pass that argument or not.
-Therefore, the dtor processes the @code{__vlist} argument in an
-automatic variable, which is initialized from the class' vlist if the
-__in_chrg flag has a zero value in bit 2 (bit mask 4), or from the
-argument @code{__vlist1} if bit 2 of the __in_chrg parameter is set to
-one.
-
-@subsection Specification of non-thunked vtables
-
-In the traditional implementation of vtables, each slot contains three
-fields: The offset to be added to the this pointer before invoking a
-virtual function, an unused field that is always zero, and the pointer
-to the virtual function. The first two fields are typically 16 bits
-wide. The unused field is called `index'; it may be non-zero in
-pointer-to-member-functions, which use the same layout.
-
-The virtual table then is an array of vtable slots. The first slot is
-always the virtual type info function, the other slots are in the order
-in which the virtual functions appear in the class declaration.
-
-If a class has base classes, it may inherit other bases' vfields. Each
-class may have a primary vfield; the primary vfield of the derived class
-is the primary vfield of the left-most non-virtual base class. If a
-class inherits a primary vfield, any new virtual functions in the
-derived class are appended to the virtual table of the primary
-vfield. If there are new virtual functions in the derived class, and no
-primary vfield is inherited, a new vfield is introduced which becomes
-primary. The redefined virtual functions fill the vtable slots inherited
-from the base; new virtual functions are put into the primary vtable in
-the order of declaration. If no new virtual functions are introduced, no
-primary vfield is allocated.
-
-In a base class that has pvbases, virtual tables are needed which are
-used only in the constructor (see example above). At run-time, the
-virtual tables of the base class are adjusted, to reflect the new offset
-of the pvbase. The compiler knows statically what offset the pvbase has
-for a complete object. At run-time, the offset of the pvbase can be
-extracted from the vbase pointer, which is set in the constructor of the
-complete object. These two offsets result in a delta, which is used to
-adjust the deltas in the vtable (the adjustment might be different for
-different vtable slots). To adjust the vtables, the compiler emits code
-that creates a vtable on the stack. This vtable is initialized with the
-vtable for the complete base type, and then adjusted.
-
-In order to call a virtual function, the compiler gets the offset field
-from the vtable entry, and adds it to the this pointer. It then
-indirectly calls the virtual function pointer, passing the adjusted this
-pointer, and any arguments the virtual function may have.
-
-To implement dynamic casting, the dynamic_cast function needs typeinfos
-for the complete type, and the pointer to the complete type. The
-typeinfo pointer is obtained by calling the virtual typeinfo function
-(which doesn't take a this parameter). The pointer to the complete
-object is obtained by adding the offset of the virtual typeinfo vtable
-slot, since this virtual function is always implemented in the complete
-object.
-
-@subsection Specification of thunked vtables
-
-For vtable thunks, each slot only consists of a pointer to the virtual
-function, which might be a thunk function. The first slot in the vtable
-is an offset of the this pointer to the complete object, which is needed
-as a parameter to __dynamic_cast. The second slot is the virtual
-typeinfo function. All other slots are allocated with the same procedure
-as in the non-thunked case. Allocation of vfields also uses the same
-procedure as described above.
-
-If the virtual function needs an adjusted this pointer, a thunk function
-is emitted. If supported by the target architecture, this is only a
-half-function. Such a thunk has no stack frame; it merely adjusts the
-first argument of the function, and then directly branches into the
-implementation of the virtual function. If the architecture does not
-support half-functions (i.e. if ASM_OUTPUT_MI_THUNK is not defined), the
-compiler emits a wrapper function, which copies all arguments, adjust
-the this pointer, and then calls the original function. Since objects of
-non-aggregate type are passed by invisible reference, this copies only
-POD arguments. The approach fails for virtual functions with a variable
-number of arguments.
-
-In order to support the vtables needed in base constructors with
-pvbases, the compiler passes an implicit __vlist argument as described
-above, if the version 2 thunks are used. For version 1 thunks, the base
-class constructor will fill in the vtables for the complete base class,
-which will incorrectly adjust the this pointer, leading to a dynamic
-error.
-
-@node Concept Index, , Vtables, Top
-
-@section Concept Index
-
-@printindex cp
-
-@bye
diff --git a/contrib/gcc/cp/inc/exception b/contrib/gcc/cp/inc/exception
deleted file mode 100644
index 32efb9f82cae..000000000000
--- a/contrib/gcc/cp/inc/exception
+++ /dev/null
@@ -1,39 +0,0 @@
-// Exception Handling support header for -*- C++ -*-
-// Copyright (C) 1995, 96-97, 1998 Free Software Foundation
-
-#ifndef __EXCEPTION__
-#define __EXCEPTION__
-
-#pragma interface "exception"
-
-extern "C++" {
-
-namespace std {
-
-class exception {
-public:
- exception () { }
- virtual ~exception () { }
- virtual const char* what () const;
-};
-
-class bad_exception : public exception {
-public:
- bad_exception () { }
- virtual ~bad_exception () { }
-};
-
-typedef void (*terminate_handler) ();
-typedef void (*unexpected_handler) ();
-
-terminate_handler set_terminate (terminate_handler);
-void terminate () __attribute__ ((__noreturn__));
-unexpected_handler set_unexpected (unexpected_handler);
-void unexpected () __attribute__ ((__noreturn__));
-bool uncaught_exception ();
-
-} // namespace std
-
-} // extern "C++"
-
-#endif
diff --git a/contrib/gcc/cp/inc/new b/contrib/gcc/cp/inc/new
deleted file mode 100644
index b66673dc3a6b..000000000000
--- a/contrib/gcc/cp/inc/new
+++ /dev/null
@@ -1,42 +0,0 @@
-// The -*- C++ -*- dynamic memory management header.
-// Copyright (C) 1994, 96-97, 1998 Free Software Foundation
-
-#ifndef __NEW__
-#define __NEW__
-
-#pragma interface "new"
-#include <stddef.h>
-#include <exception>
-
-extern "C++" {
-
-namespace std {
-
- class bad_alloc : public exception {
- public:
- virtual const char* what() const throw() { return "bad_alloc"; }
- };
-
- struct nothrow_t {};
- extern const nothrow_t nothrow;
- typedef void (*new_handler)();
- new_handler set_new_handler (new_handler);
-
-} // namespace std
-
-// replaceable signatures
-void *operator new (size_t) throw (std::bad_alloc);
-void *operator new[] (size_t) throw (std::bad_alloc);
-void operator delete (void *) throw();
-void operator delete[] (void *) throw();
-void *operator new (size_t, const std::nothrow_t&) throw();
-void *operator new[] (size_t, const std::nothrow_t&) throw();
-void operator delete (void *, const std::nothrow_t&) throw();
-void operator delete[] (void *, const std::nothrow_t&) throw();
-
-// default placement versions of operator new
-inline void *operator new(size_t, void *place) throw() { return place; }
-inline void *operator new[](size_t, void *place) throw() { return place; }
-} // extern "C++"
-
-#endif
diff --git a/contrib/gcc/cp/inc/new.h b/contrib/gcc/cp/inc/new.h
deleted file mode 100644
index 006be7efb07f..000000000000
--- a/contrib/gcc/cp/inc/new.h
+++ /dev/null
@@ -1,11 +0,0 @@
-// -*- C++ -*- forwarding header.
-
-#ifndef __NEW_H__
-#define __NEW_H__
-
-#include <new>
-
-using std::new_handler;
-using std::set_new_handler;
-
-#endif // __NEW_H__
diff --git a/contrib/gcc/cp/inc/typeinfo b/contrib/gcc/cp/inc/typeinfo
deleted file mode 100644
index 934784968c54..000000000000
--- a/contrib/gcc/cp/inc/typeinfo
+++ /dev/null
@@ -1,58 +0,0 @@
-// RTTI support for -*- C++ -*-
-// Copyright (C) 1994, 95-97, 1998 Free Software Foundation
-
-#ifndef __TYPEINFO__
-#define __TYPEINFO__
-
-#pragma interface "typeinfo"
-
-#include <exception>
-
-extern "C++" {
-
-namespace std {
-
-class type_info {
-private:
- // assigning type_info is not supported. made private.
- type_info& operator= (const type_info&);
- type_info (const type_info&);
-
-protected:
- explicit type_info (const char *n): _name (n) { }
-
- const char *_name;
-
-public:
- // destructor
- virtual ~type_info ();
-
- bool before (const type_info& arg) const;
- const char* name () const
- { return _name; }
- bool operator== (const type_info& arg) const;
- bool operator!= (const type_info& arg) const;
-};
-
-inline bool type_info::
-operator!= (const type_info& arg) const
-{
- return !operator== (arg);
-}
-
-class bad_cast : public exception {
-public:
- bad_cast() { }
- virtual ~bad_cast() { }
-};
-
-class bad_typeid : public exception {
- public:
- bad_typeid () { }
- virtual ~bad_typeid () { }
-};
-
-} // namespace std
-
-} // extern "C++"
-#endif
diff --git a/contrib/gcc/cp/input.c b/contrib/gcc/cp/input.c
deleted file mode 100644
index 9148c8656233..000000000000
--- a/contrib/gcc/cp/input.c
+++ /dev/null
@@ -1,207 +0,0 @@
-/* Input handling for G++.
- Copyright (C) 1992, 93-98, 1999 Free Software Foundation, Inc.
- Written by Ken Raeburn (raeburn@cygnus.com) while at Watchmaker Computing.
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* G++ needs to do enough saving and re-parsing of text that it is
- necessary to abandon the simple FILE* model and use a mechanism where
- we can pre-empt one input stream with another derived from saved text;
- we may need to do this arbitrarily often, and cannot depend on having
- the GNU library available, so FILE objects just don't cut it.
-
- This file is written as a separate module, but can be included by
- lex.c for very minor efficiency gains (primarily in function
- inlining). */
-
-#include "system.h"
-
-extern FILE *finput;
-
-struct input_source {
- /* saved string */
- char *str;
- int length;
- /* current position, when reading as input */
- int offset;
- /* linked list maintenance */
- struct input_source *next;
- /* values to restore after reading all of current string */
- char *filename;
- int lineno;
- struct pending_input *input;
- int putback_char;
-};
-
-static struct input_source *input, *free_inputs;
-
-extern char *input_filename;
-extern int lineno;
-
-#if USE_CPPLIB
-extern unsigned char *yy_cur, *yy_lim;
-extern int yy_get_token ();
-#define GETC() (yy_cur < yy_lim ? *yy_cur++ : yy_get_token ())
-#else
-#define GETC() getc (finput)
-#endif
-
-extern void feed_input PROTO((char *, int));
-extern void put_input PROTO((int));
-extern void put_back PROTO((int));
-extern int getch PROTO((void));
-extern int input_redirected PROTO((void));
-
-static inline struct input_source * allocate_input PROTO((void));
-static inline void free_input PROTO((struct input_source *));
-static inline void end_input PROTO((void));
-static inline int sub_getch PROTO((void));
-
-static inline struct input_source *
-allocate_input ()
-{
- struct input_source *inp;
- if (free_inputs)
- {
- inp = free_inputs;
- free_inputs = inp->next;
- inp->next = 0;
- return inp;
- }
- inp = (struct input_source *) xmalloc (sizeof (struct input_source));
- inp->next = 0;
- return inp;
-}
-
-static inline void
-free_input (inp)
- struct input_source *inp;
-{
- inp->str = 0;
- inp->length = 0;
- inp->next = free_inputs;
- free_inputs = inp;
-}
-
-static int putback_char = -1;
-
-/* Some of these external functions are declared inline in case this file
- is included in lex.c. */
-
-inline
-void
-feed_input (str, len)
- char *str;
- int len;
-{
- struct input_source *inp = allocate_input ();
-
- /* This shouldn't be necessary. */
- while (len && !str[len-1])
- len--;
-
- inp->str = str;
- inp->length = len;
- inp->offset = 0;
- inp->next = input;
- inp->filename = input_filename;
- inp->lineno = lineno;
- inp->input = save_pending_input ();
- inp->putback_char = putback_char;
- putback_char = -1;
- input = inp;
-}
-
-struct pending_input *to_be_restored; /* XXX */
-extern int end_of_file;
-
-static inline void
-end_input ()
-{
- struct input_source *inp = input;
-
- end_of_file = 0;
- input = inp->next;
- input_filename = inp->filename;
- lineno = inp->lineno;
- /* Get interface/implementation back in sync. */
- extract_interface_info ();
- putback_char = inp->putback_char;
- restore_pending_input (inp->input);
- free_input (inp);
-}
-
-static inline int
-sub_getch ()
-{
- if (putback_char != -1)
- {
- int ch = putback_char;
- putback_char = -1;
- return ch;
- }
- if (input)
- {
- if (input->offset >= input->length)
- {
- my_friendly_assert (putback_char == -1, 223);
- ++(input->offset);
- if (input->offset - input->length < 64)
- return EOF;
-
- /* We must be stuck in an error-handling rule; give up. */
- end_input ();
- return getch ();
- }
- return (unsigned char)input->str[input->offset++];
- }
- return GETC ();
-}
-
-inline
-void
-put_back (ch)
- int ch;
-{
- if (ch != EOF)
- {
- my_friendly_assert (putback_char == -1, 224);
- putback_char = ch;
- }
-}
-
-extern int linemode;
-
-int
-getch ()
-{
- int ch = sub_getch ();
- if (linemode && ch == '\n')
- {
- put_back (ch);
- ch = EOF;
- }
- return ch;
-}
-
-inline
-int
-input_redirected ()
-{
- return input != 0;
-}
diff --git a/contrib/gcc/cp/new.cc b/contrib/gcc/cp/new.cc
deleted file mode 100644
index 3197012150d8..000000000000
--- a/contrib/gcc/cp/new.cc
+++ /dev/null
@@ -1,42 +0,0 @@
-// Implementation file for the -*- C++ -*- dynamic memory management header.
-// Copyright (C) 1996, 1997, 1998 Free Software Foundation
-
-// This file is part of GNU CC.
-
-// GNU CC 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.
-
-// GNU CC is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with GNU CC; see the file COPYING. If not, write to
-// the Free Software Foundation, 59 Temple Place - Suite 330,
-// Boston, MA 02111-1307, USA.
-
-// As a special exception, if you link this library with other files,
-// some of which are compiled with GCC, to produce an executable,
-// this library does not by itself 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.
-
-#pragma implementation "new"
-#include "new"
-
-const std::nothrow_t std::nothrow = { };
-
-using std::new_handler;
-new_handler __new_handler;
-
-new_handler
-set_new_handler (new_handler handler)
-{
- new_handler prev_handler = __new_handler;
- __new_handler = handler;
- return prev_handler;
-}
diff --git a/contrib/gcc/cp/new1.cc b/contrib/gcc/cp/new1.cc
deleted file mode 100644
index 73fbcd2b1fd4..000000000000
--- a/contrib/gcc/cp/new1.cc
+++ /dev/null
@@ -1,89 +0,0 @@
-// Support routines for the -*- C++ -*- dynamic memory management.
-// Copyright (C) 1997, 1998 Free Software Foundation
-
-// This file is part of GNU CC.
-
-// GNU CC 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.
-
-// GNU CC is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with GNU CC; see the file COPYING. If not, write to
-// the Free Software Foundation, 59 Temple Place - Suite 330,
-// Boston, MA 02111-1307, USA.
-
-// As a special exception, if you link this library with other files,
-// some of which are compiled with GCC, to produce an executable,
-// this library does not by itself 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 "new"
-using std::new_handler;
-using std::bad_alloc;
-
-extern "C" void *malloc (size_t);
-extern new_handler __new_handler;
-
-#define WEAK(x) \
- x __attribute__ ((weak)); \
- x
-
-#ifdef L_op_newnt
-WEAK (void * operator new (size_t sz, const std::nothrow_t&) throw())
-{
- void *p;
-
- /* malloc (0) is unpredictable; avoid it. */
- if (sz == 0)
- sz = 1;
- p = (void *) malloc (sz);
- while (p == 0)
- {
- new_handler handler = __new_handler;
- if (! handler)
- return 0;
- try
- {
- handler ();
- }
- catch (bad_alloc &)
- {
- return 0;
- }
-
- p = (void *) malloc (sz);
- }
-
- return p;
-}
-#endif
-
-#ifdef L_op_new
-WEAK (void * operator new (size_t sz) throw (std::bad_alloc))
-{
- void *p;
-
- /* malloc (0) is unpredictable; avoid it. */
- if (sz == 0)
- sz = 1;
- p = (void *) malloc (sz);
- while (p == 0)
- {
- new_handler handler = __new_handler;
- if (! handler)
- throw bad_alloc ();
- handler ();
- p = (void *) malloc (sz);
- }
-
- return p;
-}
-#endif
diff --git a/contrib/gcc/cp/new2.cc b/contrib/gcc/cp/new2.cc
deleted file mode 100644
index 2833ea23414d..000000000000
--- a/contrib/gcc/cp/new2.cc
+++ /dev/null
@@ -1,80 +0,0 @@
-// Boilerplate support routines for -*- C++ -*- dynamic memory management.
-// Copyright (C) 1997, 1998 Free Software Foundation
-
-// This file is part of GNU CC.
-
-// GNU CC 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.
-
-// GNU CC is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with GNU CC; see the file COPYING. If not, write to
-// the Free Software Foundation, 59 Temple Place - Suite 330,
-// Boston, MA 02111-1307, USA.
-
-// As a special exception, if you link this library with other files,
-// some of which are compiled with GCC, to produce an executable,
-// this library does not by itself 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 "new"
-
-extern "C" void free (void *);
-
-#define WEAK(x) \
- x __attribute__ ((weak)); \
- x
-
-#ifdef L_op_vnew
-WEAK(void * operator new[] (size_t sz) throw (std::bad_alloc))
-{
- return ::operator new(sz);
-}
-#endif
-
-#ifdef L_op_vnewnt
-WEAK(void *operator new[] (size_t sz, const std::nothrow_t& nothrow) throw())
-{
- return ::operator new(sz, nothrow);
-}
-#endif
-
-#ifdef L_op_delete
-WEAK (void operator delete (void *ptr) throw ())
-{
- if (ptr)
- free (ptr);
-}
-#endif
-
-#ifdef L_op_vdel
-WEAK (void operator delete[] (void *ptr) throw ())
-{
- if (ptr)
- free (ptr);
-}
-#endif
-
-#ifdef L_op_delnt
-WEAK (void operator delete (void *ptr, const std::nothrow_t&) throw ())
-{
- if (ptr)
- free (ptr);
-}
-#endif
-
-#ifdef L_op_vdelnt
-WEAK (void operator delete[] (void *ptr, const std::nothrow_t&) throw ())
-{
- if (ptr)
- free (ptr);
-}
-#endif
diff --git a/contrib/gcc/cp/reno.texi b/contrib/gcc/cp/reno.texi
deleted file mode 100644
index 59c3448a0399..000000000000
--- a/contrib/gcc/cp/reno.texi
+++ /dev/null
@@ -1,752 +0,0 @@
-\input texinfo @c -*- Texinfo -*-
-@setfilename reno-1.info
-
-@ifinfo
-@format
-START-INFO-DIR-ENTRY
-* Reno 1: (reno-1). The GNU C++ Renovation Project, Phase 1.
-END-INFO-DIR-ENTRY
-@end format
-@end ifinfo
-
-@ifinfo
-Copyright @copyright{} 1992, 1993, 1994 Free Software Foundation, Inc.
-
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-
-@ignore
-Permission is granted to process this file through TeX and print the
-results, provided the printed document carries a copying permission
-notice identical to this one except for the removal of this paragraph
-(this paragraph not being relevant to the printed manual).
-
-@end ignore
-
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided also that
-the entire resulting derived work is distributed under the terms of a
-permission notice identical to this one.
-
-Permission is granted to copy and distribute translations of this manual
-into another language, under the above conditions for modified versions.
-@end ifinfo
-
-@setchapternewpage odd
-@settitle GNU C++ Renovation Project
-@c @smallbook
-
-@titlepage
-@finalout
-@title GNU C++ Renovation Project
-@subtitle Phase 1.3
-@author Brendan Kehoe, Jason Merrill,
-@author Mike Stump, Michael Tiemann
-@page
-
-Edited March, 1994 by Roland Pesch (@code{pesch@@cygnus.com})
-@vskip 0pt plus 1filll
-Copyright @copyright{} 1992, 1993, 1994 Free Software Foundation, Inc.
-
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-
-@ignore
-Permission is granted to process this file through Tex and print the
-results, provided the printed document carries copying permission
-notice identical to this one except for the removal of this paragraph
-(this paragraph not being relevant to the printed manual).
-@end ignore
-
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided also that
-the entire resulting derived work is distributed under the terms of a
-permission notice identical to this one.
-
-Permission is granted to copy and distribute translations of this manual
-into another language, under the above conditions for modified versions.
-@end titlepage
-
-@ifinfo
-@node Top
-@top @sc{gnu} C++ Renovation Project
-
-This file describes the goals of the @sc{gnu} C++ Renovation Project,
-and its accomplishments to date (as of Phase 1.3).
-
-It also discusses the remaining divergences from @sc{gnu} C++, and how the
-name encoding in @sc{gnu} C++ differs from the sample encoding in
-@cite{The Annotated C++ Reference Manual}.
-@c This is not a good place to introduce the acronym ARM because it's
-@c info-only.
-
-@menu
-* Introduction:: What is the GNU C++ Renovation Project?
-* Changes:: Summary of changes since previous GNU C++ releases.
-* Plans:: Plans for Reno-2.
-* Templates:: The template implementation.
-* ANSI:: GNU C++ conformance to ANSI C++.
-* Encoding:: Name encoding in GNU C++.
-@end menu
-
-@end ifinfo
-
-@node Introduction
-@chapter Introduction
-
-As you may remember, @sc{gnu} C++ was the first native-code C++
-compiler available under Unix (December 1987). In November 1988, it was
-judged superior to the AT&T compiler in a Unix World review. In 1990 it
-won a Sun Observer ``Best-Of'' award. But now, with new requirements
-coming out of the @sc{ansi} C++ committee and a growing backlog of bugs, it's
-clear that @sc{gnu} C++ needs an overhaul.
-
-The C++ language has been under development since 1982. It has
-evolved significantly since its original incarnation (C with Classes),
-addressing many commercial needs and incorporating many lessons
-learned as more and more people started using ``object-oriented''
-programming techniques. In 1989, the first X3J16 committee meeting
-was held in Washington DC; in the interest of users, C++ was going to
-be standardized.
-
-As C++ has become more popular, more demands have been placed on its
-compilers. Some compilers are up to the demands, others are not.
-@sc{gnu} C++ was used to prototype several features which have since
-been incorporated into the standard, most notably exception handling.
-While @sc{gnu} C++ has been an excellent experimental vehicle, it did
-not have the resources that AT&T, Borland, or Microsoft have at their
-disposal.
-
-We believe that @sc{gnu} C++ is an important compiler, providing users with
-many of the features that have made @sc{gnu} C so popular: fast compilation,
-good error messages, innovative features, and full sources that may be
-freely redistributed. The purpose of this overhaul, dubbed the @var{@sc{gnu}
-C++ Renovation Project}, is to take advantage of the functionality that
-@sc{gnu} C++ offers today, to strengthen its base technology, and put it in a
-position to remain---as other @sc{gnu} software currently is---the technical
-leader in the field.
-
-This release represents the latest phase of work in strengthening the
-compiler on a variety of points. It includes many months of
-work concentrated on fixing many of the more egregious bugs that
-presented themselves in the compiler recently.
-@ignore
-@c FIXME-- update?
-Nearly 85% of all bugs reported in the period of February to September
-of 1992 were fixed as part of the work in the first phase.
-@end ignore
-In the coming months, we hope to continue expanding and enhancing the
-quality and dependability of the industry's only freely redistributable
-C++ compiler.
-
-@node Changes
-@chapter Changes in Behavior in @sc{gnu} C++
-
-The @sc{gnu} C++ compiler continues to improve and change. A major goal
-of our work has been to continue to bring the compiler into compliance
-with the draft @sc{ansi} C++ standard, and with @cite{The Annotated C++
-Reference Manual} (the @sc{arm}). This section outlines most of the
-user-noticeable changes that might be encountered during the normal
-course of use.
-
-@menu
-* Summary of Phase 1.3::
-* Major changes::
-* New features::
-* Enhancements and bug fixes::
-* Problems with debugging::
-@end menu
-
-@node Summary of Phase 1.3
-@section Summary of Changes in Phase 1.3
-
-The bulk of this note discusses the cumulative effects of the @sc{gnu} C++
-Renovation Project to date. The work during its most recent phase (1.3)
-had these major effects:
-
-@itemize @bullet
-@item The standard compiler driver @code{g++} is now the faster compiled
-version, rather than a shell script.
-
-@item Nested types work much better; notably, nesting is no longer
-restricted to nine levels.
-
-@item Better @sc{arm} conformance on member access control.
-
-@item The compiler now always generates default assignment operators
-(@samp{operator =}), copy constructors (@samp{X::X(X&)}), and default
-constructors (@samp{X::X()}) whenever they are required.
-
-@item The new draft @sc{ansi} standard keyword @code{mutable} is supported.
-
-@item @samp{-fansi-overloading} is the default, to comply better with
-the @sc{arm} (at some cost in compatibility to earlier versions of @sc{gnu} C++).
-
-@item More informative error messages.
-
-@item System include files are automatically treated as if they were
-wrapped in @samp{extern "C" @{ @}}.
-
-@item The new option @samp{-falt-external-templates} provides alternate
-template instantiation semantics.
-
-@item Operator declarations are now checked more strictly.
-
-@item You can now use template type arguments in the template parameter list.
-
-@item You can call the destructor for any type.
-
-@item The compiler source code is better organized.
-
-@item You can specify where to instantiate template definitions explicitly.
-@end itemize
-
-Much of the work in Phase 1.3 went to elimination of known bugs, as well
-as the major items above.
-
-During the span of Phase 1.3, there were also two changes associated
-with the compiler that, while not specifically part of the C++
-Renovation project, may be of interest:
-
-@itemize @bullet
-@item @code{gcov}, a code coverage tool for @sc{gnu cc}, is now available
-from Cygnus Support. (@code{gcov} is free software, but the @sc{fsf} has not
-yet accepted it.) @xref{Gcov,, @code{gcov}: a Test Coverage Program,
-gcc.info, Using GNU CC}, for more information (in Cygnus releases of
-that manual).
-
-@item @sc{gnu} C++ now supports @dfn{signatures}, a language extension to
-provide more flexibility in abstract type definitions. @xref{C++
-Signatures,, Type Abstraction using Signatures, gcc.info, Using GNU CC}.
-@end itemize
-
-@node Major changes
-@section Major Changes
-
-This release includes four wholesale rewrites of certain areas of
-compiler functionality:
-
-@enumerate 1
-@item Argument matching. @sc{gnu} C++ is more compliant with the rules
-described in Chapter 13, ``Overloading'', of the @sc{arm}. This behavior is
-the default, though you can specify it explicitly with
-@samp{-fansi-overloading}. For compatibility with earlier releases of
-@sc{gnu} C++, specify @samp{-fno-ansi-overloading}; this makes the compiler
-behave as it used to with respect to argument matching and name overloading.
-
-@item Default constructors/destructors. Section 12.8 of the @sc{arm}, ``Copying
-Class Objects'', and Section 12.1, ``Constructors'', state that a
-compiler must declare such default functions if the user does not
-specify them. @sc{gnu} C++ now declares, and generates when necessary,
-the defaults for constructors and destructors you might omit. In
-particular, assignment operators (@samp{operator =}) behave the same way
-whether you define them, or whether the compiler generates them by
-default; taking the address of the default @samp{operator =} is now
-guaranteed to work. Default copy constructors (@samp{X::X(X&)}) now
-function correctly, rather than calling the copy assignment operator for
-the base class. Finally, constructors (@samp{X::X()}), as well as
-assignment operators and copy constructors, are now available whenever
-they are required.
-
-@c XXX This may be taken out eventually...
-@item Binary incompatibility. There are no new binary incompatibilities
-in Phase 1.3, but Phase 1.2 introduced two binary incompatibilities with
-earlier releases. First, the functionality of @samp{operator
-new} and @samp{operator delete} changed. Name encoding
-(``mangling'') of virtual table names changed as well. Libraries
-built with versions of the compiler earlier than Phase 1.2 must be
-compiled with the new compiler. (This includes the Cygnus Q2
-progressive release and the FSF 2.4.5 release.)
-
-@item New @code{g++} driver.
-A new binary @code{g++} compiler driver replaces the shell script.
-The new driver executes faster.
-@end enumerate
-
-@node New features
-@section New features
-
-@itemize @bullet
-@item
-The compiler warns when a class contains only private constructors
-or destructors, and has no friends. At the request of some of our
-customers, we have added a new option, @samp{-Wctor-dtor-privacy} (on by
-default), and its negation, @samp{-Wno-ctor-dtor-privacy}, to control
-the emission of this warning. If, for example, you are working towards
-making your code compile warning-free, you can use @w{@samp{-Wall
--Wno-ctor-dtor-privacy}} to find the most common warnings.
-
-@item
-There is now a mechanism which controls exactly when templates are
-expanded, so that you can reduce memory usage and program size and also
-instantiate them exactly once. You can control this mechanism with the
-option @samp{-fexternal-templates} and its corresponding negation
-@samp{-fno-external-templates}. Without this feature, space consumed by
-template instantiations can grow unacceptably in large-scale projects
-with many different source files. The default is
-@samp{-fno-external-templates}.
-
-You do not need to use the @samp{-fexternal-templates} option when
-compiling a file that does not define and instantiate templates used in
-other files, even if those files @emph{are} compiled with
-@samp{-fexternal-templates}. The only side effect is an increase in
-object size for each file that was compiled without
-@samp{-fexternal-templates}.
-
-When your code is compiled with @samp{-fexternal-templates}, all
-template instantiations are external; this requires that the templates
-be under the control of @samp{#pragma interface} and @samp{#pragma
-implementation}. All instantiations that will be needed should be in
-the implementation file; you can do this with a @code{typedef} that
-references the instantiation needed. Conversely, when you compile using
-the option @samp{-fno-external-templates}, all template instantiations are
-explicitly internal.
-
-@samp{-fexternal-templates} also allows you to finally separate class
-template function definitions from their declarations, thus speeding up
-compilation times for every file that includes the template declaration.
-Now you can have tens or even hundreds of lines in template
-declarations, and thousands or tens of thousands of lines in template
-definitions, with the definitions only going through the compiler once
-instead of once for each source file. It is important to note that you
-must remember to externally instantiate @emph{all} templates that are
-used from template declarations in interface files. If you forget to do
-this, unresolved externals will occur.
-
-In the example below, the object file generated (@file{example.o}) will
-contain the global instantiation for @samp{Stack<int>}. If other types
-of @samp{Stack} are needed, they can be added to @file{example.cc} or
-placed in a new file, in the same spirit as @file{example.cc}.
-
-@code{foo.h}:
-@smallexample
-@group
-#pragma interface "foo.h"
-template<class T>
-class Stack @{
- static int statc;
- static T statc2;
- Stack() @{ @}
- virtual ~Stack() @{ @}
- int bar();
-@};
-@end group
-@end smallexample
-
-@code{example.cc}:
-@smallexample
-@group
-#pragma implementation "foo.h"
-#include "foo.h"
-
-typedef Stack<int> t;
-int Stack<int>::statc;
-int Stack<int>::statc2;
-int Stack<int>::bar() @{ @}
-@end group
-@end smallexample
-
-Note that using @samp{-fexternal-templates} does not reduce memory usage
-from completely different instantiations (@samp{Stack<Name>} vs.
-@samp{Stack<Net_Connection>}), but only collapses different occurrences
-of @samp{Stack<Name>} so that only one @samp{Stack<Name>} is generated.
-
-@samp{-falt-external-templates} selects a slight variation in the
-semantics described above (incidentally, you need not specify both
-options; @samp{-falt-external-templates} implies
-@samp{-fexternal-templates}).
-
-With @samp{-fexternal-templates}, the compiler emits a definition in the
-implementation file that includes the header definition, @emph{even if}
-instantiation is triggered from a @emph{different} implementation file
-(e.g. with a template that uses another template).
-
-With @samp{-falt-external-templates}, the definition always goes in the
-implementation file that triggers instantiation.
-
-For instance, with these two header files---
-
-@example
-@exdent @file{a.h}:
-#pragma interface
-template <class T> class A @{ @dots{} @};
-
-@exdent @file{b.h}:
-#pragma interface
-class B @{ @dots{} @};
-void f (A<B>);
-@end example
-
-Under @samp{-fexternal-templates}, the definition of @samp{A<B>} ends up
-in the implementation file that includes @file{a.h}. Under
-@samp{-falt-external-templates}, the same definition ends up in the
-implementation file that includes @file{b.h}.
-
-@item
-You can control explicitly where a template is instantiated, without
-having to @emph{use} the template to get an instantiation.
-
-To instantiate a class template explicitly, write @samp{template
-class @var{name}<paramvals>}, where @var{paramvals} is a list of values
-for the template parameters. For example, you might write
-
-@example
-template class A<int>
-@end example
-
-Similarly, to instantiate a function template explicitly, write
-@samp{template @var{fnsign}} where @var{fnsign} is the particular
-function signature you need. For example, you might write
-
-@example
-template void foo (int, int)
-@end example
-
-This syntax for explicit template instantiation agrees with recent
-extensions to the draft @sc{ansi} standard.
-
-@item
-The compiler's actions on @sc{ansi}-related warnings and errors have
-been further enhanced. The @samp{-pedantic-errors} option produces
-error messages in a number of new situations: using @code{return} in a
-non-@code{void} function (one returning a value); declaring a local
-variable that shadows a parameter (e.g., the function takes an argument
-@samp{a}, and has a local variable @samp{a}); and use of the @samp{asm}
-keyword. Finally, the compiler by default now issues a warning when
-converting from an @code{int} to an enumerated type. This is likely to
-cause many new warnings in code that hadn't triggered them before. For
-example, when you compile this code,
-
-@smallexample
-@group
-enum boolean @{ false, true @};
-void
-f ()
-@{
- boolean x;
-
- x = 1; //@i{assigning an @code{int} to an @code{enum} now triggers a warning}
-@}
-@end group
-@end smallexample
-
-@noindent
-you should see the warning ``@code{anachronistic conversion from integer
-type to enumeral type `boolean'}''. Instead of assigning the value 1,
-assign the original enumerated value @samp{true}.
-@end itemize
-
-@node Enhancements and bug fixes
-@section Enhancements and bug fixes
-
-@itemize @bullet
-@cindex nested types in template parameters
-@item
-You can now use nested types in a template parameter list, even if the nested
-type is defined within the same class that attempts to use the template.
-For example, given a template @code{list}, the following now works:
-
-@smallexample
-struct glyph @{
- @dots{}
- struct stroke @{ @dots{} @};
- list<stroke> l;
- @dots{}
-@}
-@end smallexample
-
-@cindex function pointers vs template parameters
-@item
-Function pointers now work in template parameter lists. For
-example, you might want to instantiate a parameterized @code{list} class
-in terms of a pointer to a function like this:
-
-@smallexample
-list<int (*)(int, void *)> fnlist;
-@end smallexample
-
-@item
-@c FIXME! Really no limit? Jason said "deeper than 9" now OK...
-Nested types are now handled correctly. In particular, there is no
-longer a limit to how deeply you can nest type definitions.
-
-@item
-@sc{gnu} C++ now conforms to the specifications in Chapter 11 of the
-@sc{arm}, ``Member Access Control''.
-
-@item
-The @sc{ansi} C++ committee has introduced a new keyword @code{mutable}.
-@sc{gnu} C++ supports it. Use @code{mutable} to specify that some
-particular members of a @code{const} class are @emph{not} constant. For
-example, you can use this to include a cache in a data structure that
-otherwise represents a read-only database.
-
-@item
-Error messages now explicitly specify the declaration, type, or
-expression that contains an error.
-
-@item
-To avoid copying and editing all system include files during @sc{gnu}
-C++ installation, the compiler now automatically recognizes system
-include files as C language definitions, as if they were wrapped in
-@samp{extern "C" @{ @dots{} @}}.
-
-@item
-The compiler checks operator declarations more strictly. For example,
-you may no longer declare an @samp{operator +} with three arguments.
-
-@item
-You can now use template type arguments in the same template
-parameter list where the type argument is specified (as well as in the
-template body). For example, you may write
-
-@example
-template <class T, T t> class A @{ @dots{} @};
-@end example
-
-@item
-Destructors are now available for all types, even built-in ones; for
-example, you can call @samp{int::~int}. (Destructors for types like
-@code{int} do not actually do anything, but their existence provides a
-level of generality that permits smooth template expansion in more
-cases.)
-
-@item
-Enumerated types declared inside a class are now handled correctly.
-
-@item
-An argument list for a function may not use an initializer list for its default
-value. For example, @w{@samp{void foo ( T x = @{ 1, 2 @} )}} is not permitted.
-
-@item
-A significant amount of work went into improving the ability of the
-compiler to act accurately on multiple inheritance and virtual
-functions. Virtual function dispatch has been enhanced as well.
-
-@item
-The warning concerning a virtual inheritance environment with a
-non-virtual destructor has been disabled, since it is not clear that
-such a warning is warranted.
-
-@item
-Until exception handling is fully implemented in the Reno-2 release, use
-of the identifiers @samp{catch}, @samp{throw}, or @samp{try} results
-in the warning:
-
-@smallexample
-t.C:1: warning: `catch', `throw', and `try'
- are all C++ reserved words
-@end smallexample
-
-@item
-When giving a warning or error concerning initialization of a member in a
-class, the compiler gives the name of the member if it has one.
-
-@item
-Detecting friendship between classes is more accurately checked.
-
-@item
-The syntaxes of @w{@samp{#pragma implementation "file.h"}} and
-@samp{#pragma interface} are now more strictly controlled. The compiler
-notices (and warns) when any text follows @file{file.h} in the
-implementation pragma, or follows the word @samp{interface}. Any such
-text is otherwise ignored.
-
-@item
-Trying to declare a template on a variable or type is now considered an
-error, not an unimplemented feature.
-
-@item
-When an error occurs involving a template, the compiler attempts to
-tell you at which point of instantiation the error occurred, in
-addition to noting the line in the template declaration which had the
-actual error.
-
-@item
-The symbol names for function templates in the resulting assembly file
-are now encoded according to the arguments, rather than just being
-emitted as, for example, two definitions of a function @samp{foo}.
-
-@item
-Template member functions that are declared @code{static} no longer
-receive a @code{this} pointer.
-
-@item
-Case labels are no longer allowed to have commas to make up their
-expressions.
-
-@item
-Warnings concerning the shift count of a left or right shift now tell
-you if it was a @samp{left} or @samp{right} shift.
-
-@item
-The compiler now warns when a decimal constant is so large that it
-becomes @code{unsigned}.
-
-@item
-Union initializers which are raw constructors are now handled properly.
-
-@item
-The compiler no longer gives incorrect errors when initializing a
-union with an empty initializer list.
-
-@item
-Anonymous unions are now correctly used when nested inside a class.
-
-@item
-Anonymous unions declared as static class members are now handled
-properly.
-
-@item
-The compiler now notices when a field in a class is declared both as
-a type and a non-type.
-
-@item
-The compiler now warns when a user-defined function shadows a
-built-in function, rather than emitting an error.
-
-@item
-A conflict between two function declarations now produces an error
-regardless of their language context.
-
-@item
-Duplicate definitions of variables with @samp{extern "C"} linkage are no
-longer considered in error. (Note in C++ linkage---the default---you may
-not have more than one definition of a variable.)
-
-@item
-Referencing a label that is not defined in any function is now an error.
-
-@item
-The syntax for pointers to methods has been improved; there are still
-some minor bugs, but a number of cases should now be accepted by the
-compiler.
-
-@item
-In error messages, arguments are now numbered starting at 1, instead of
-0. Therefore, in the function @samp{void foo (int a, int b)}, the
-argument @samp{a} is argument 1, and @samp{b} is argument 2. There is
-no longer an argument 0.
-
-@item
-The tag for an enumerator, rather than its value, used as a default
-argument is now shown in all error messages. For example, @w{@samp{void
-foo (enum x (= true))}} is shown instead of @w{@samp{void foo (enum x (=
-1))}}.
-
-@item
-The @samp{__asm__} keyword is now accepted by the C++ front-end.
-
-@item
-Expressions of the form @samp{foo->~Class()} are now handled properly.
-
-@item
-The compiler now gives better warnings for situations which result in
-integer overflows (e.g., in storage sizes, enumerators, unary
-expressions, etc).
-
-@item
-@code{unsigned} bitfields are now promoted to @code{signed int} if the
-field isn't as wide as an @code{int}.
-
-@item
-Declaration and usage of prefix and postfix @samp{operator ++} and
-@samp{operator --} are now handled correctly. For example,
-
-@smallexample
-@group
-class foo
-@{
-public:
- operator ++ ();
- operator ++ (int);
- operator -- ();
- operator -- (int);
-@};
-
-void
-f (foo *f)
-@{
- f++; // @i{call @code{f->operator++(int)}}
- ++f; // @i{call @code{f->operator++()}}
- f--; // @i{call @code{f->operator++(int)}}
- --f; // @i{call @code{f->operator++()}}
-@}
-@end group
-@end smallexample
-
-@item
-In accordance with @sc{arm} section 10.1.1, ambiguities and dominance are now
-handled properly. The rules described in section 10.1.1 are now fully
-implemented.
-
-@end itemize
-
-@node Problems with debugging
-@section Problems with debugging
-
-Two problems remain with regard to debugging:
-
-@itemize @bullet
-@item
-Debugging of anonymous structures on the IBM RS/6000 host is incorrect.
-
-@item
-Symbol table size is overly large due to redundant symbol information;
-this can make @code{gdb} coredump under certain circumstances. This
-problem is not host-specific.
-@end itemize
-
-@node Plans
-@chapter Plans for Reno-2
-
-The overall goal for the second phase of the @sc{gnu} C++ Renovation
-Project is to bring @sc{gnu} C++ to a new level of reliability, quality,
-and competitiveness. As particular elements of this strategy, we intend
-to:
-
-@enumerate 0
-@item
-Fully implement @sc{ansi} exception handling.
-
-@item
-With the exception handling, add Runtime Type Identification
-(@sc{rtti}), if the @sc{ansi} committee adopts it into the standard.
-
-@item
-Bring the compiler into closer compliance with the @sc{arm} and the draft
-@sc{ansi} standard, and document what points in the @sc{arm} we do not yet comply,
-or agree, with.
-
-@item
-Add further support for the @sc{dwarf} debugging format.
-
-@item
-Finish the work to make the compiler compliant with @sc{arm} Section 12.6.2,
-initializing base classes in declaration order, rather than in the order
-that you specify them in a @var{mem-initializer} list.
-
-@item
-Perform a full coverage analysis on the compiler, and weed out unused
-code, for a gain in performance and a reduction in the size of the compiler.
-
-@item
-Further improve the multiple inheritance implementation in the
-compiler to make it cleaner and more complete.
-@end enumerate
-
-@noindent
-As always, we encourage you to make suggestions and ask questions about
-@sc{gnu} C++ as a whole, so we can be sure that the end of this project
-will bring a compiler that everyone will find essential for C++ and will
-meet the needs of the world's C++ community.
-
-@include templates.texi
-
-@include gpcompare.texi
-
-@contents
-
-@bye
diff --git a/contrib/gcc/cp/sig.c b/contrib/gcc/cp/sig.c
deleted file mode 100644
index f170df52a606..000000000000
--- a/contrib/gcc/cp/sig.c
+++ /dev/null
@@ -1,1067 +0,0 @@
-/* Functions dealing with signatures and signature pointers/references.
- Copyright (C) 1992, 93-97, 1998 Free Software Foundation, Inc.
- Contributed by Gerald Baumgartner (gb@cs.purdue.edu)
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-
-#include "config.h"
-#include "system.h"
-#include "obstack.h"
-#include "tree.h"
-#include "cp-tree.h"
-#include "flags.h"
-#include "assert.h"
-#include "toplev.h"
-
-extern struct obstack *current_obstack;
-extern struct obstack permanent_obstack;
-extern struct obstack *saveable_obstack;
-
-static tree save_this PROTO((tree));
-static tree build_sptr_ref PROTO((tree));
-static tree build_member_function_pointer PROTO((tree));
-static void undo_casts PROTO((tree));
-static tree build_signature_pointer_or_reference_name
- PROTO((tree, int, int));
-static void build_signature_pointer_or_reference_decl
- PROTO((tree, tree));
-static tree build_signature_pointer_or_reference_type
- PROTO((tree, int, int));
-static tree get_sigtable_name PROTO((tree, tree));
-static tree build_signature_table_constructor PROTO((tree, tree));
-static int match_method_types PROTO((tree, tree));
-static tree build_sigtable PROTO((tree, tree, tree));
-
-/* Used to help generate globally unique names for signature tables. */
-
-static int global_sigtable_name_counter;
-
-/* Build an identifier for a signature pointer or reference, so we
- can use it's name in function name mangling. */
-
-static tree
-build_signature_pointer_or_reference_name (to_type, type_quals, refp)
- tree to_type;
- int type_quals;
- int refp;
-{
- const char * sig_name = TYPE_NAME_STRING (to_type);
- int name_len = TYPE_NAME_LENGTH (to_type) + 3 /* Enough room for
- C,V,R. */;
- char * name;
-
- const char *const_rep = (type_quals & TYPE_QUAL_CONST) ? "C" : "";
- const char *restrict_rep = (type_quals & TYPE_QUAL_RESTRICT) ? "R" : "";
- const char *volatile_rep = (type_quals & TYPE_QUAL_VOLATILE) ? "C" : "";
-
- if (refp)
- {
- name = (char *) alloca (name_len + sizeof (SIGNATURE_REFERENCE_NAME) +2);
- sprintf (name, SIGNATURE_REFERENCE_NAME_FORMAT,
- const_rep, volatile_rep, restrict_rep, sig_name);
- }
- else
- {
- name = (char *) alloca (name_len + sizeof (SIGNATURE_POINTER_NAME) + 2);
- sprintf (name, SIGNATURE_POINTER_NAME_FORMAT,
- const_rep, volatile_rep, restrict_rep, sig_name);
- }
- return get_identifier (name);
-}
-
-/* Build a DECL node for a signature pointer or reference, so we can
- tell the debugger the structure of signature pointers/references.
- This function is called at most eight times for a given signature,
- once for each [const] [volatile] signature pointer/reference. */
-
-static void
-build_signature_pointer_or_reference_decl (type, name)
- tree type, name;
-{
- tree decl;
-
- /* We don't enter this declaration in any sort of symbol table. */
- decl = build_decl (TYPE_DECL, name, type);
- TYPE_NAME (type) = decl;
- TREE_CHAIN (type) = decl;
-}
-
-/* Construct, lay out and return the type of pointers or references to
- signature TO_TYPE. If such a type has already been constructed,
- reuse it. If TYPE_QUALS are specified, qualify the `optr'. If we
- are constructing a const/volatile type variant and the main type
- variant doesn't exist yet, it is built as well. If REFP is 1, we
- construct a signature reference, otherwise a signature pointer is
- constructed.
-
- This function is a subroutine of `build_signature_pointer_type' and
- `build_signature_reference_type'. */
-
-static tree
-build_signature_pointer_or_reference_type (to_type, type_quals, refp)
- tree to_type;
- int type_quals;
- int refp;
-{
- register tree t, m;
- register struct obstack *ambient_obstack = current_obstack;
- register struct obstack *ambient_saveable_obstack = saveable_obstack;
-
- m = refp ? SIGNATURE_REFERENCE_TO (to_type) : SIGNATURE_POINTER_TO (to_type);
-
- /* If we don't have the main variant yet, construct it. */
- if (m == NULL_TREE && type_quals != TYPE_UNQUALIFIED)
- m = build_signature_pointer_or_reference_type (to_type,
- TYPE_UNQUALIFIED, refp);
-
- /* Treat any nonzero argument as 1. */
- refp = !!refp;
-
- /* If not generating auxiliary info, search the chain of variants to see
- if there is already one there just like the one we need to have. If so,
- use that existing one.
-
- We don't do this in the case where we are generating aux info because
- in that case we want each typedef names to get it's own distinct type
- node, even if the type of this new typedef is the same as some other
- (existing) type. */
-
- if (m && !flag_gen_aux_info)
- for (t = m; t; t = TYPE_NEXT_VARIANT (t))
- if (type_quals == CP_TYPE_QUALS (TREE_TYPE (TREE_TYPE
- (TYPE_FIELDS (t)))))
- return t;
-
- /* We need a new one. If TO_TYPE is permanent, make this permanent too. */
- if (TREE_PERMANENT (to_type))
- {
- current_obstack = &permanent_obstack;
- saveable_obstack = &permanent_obstack;
- }
-
- /* A signature pointer or reference to a signature `s' looks like this:
-
- struct {
- void * optr;
- const s * sptr;
- };
-
- A `const' signature pointer/reference is a
-
- struct {
- const void * optr;
- const s * sptr;
- };
-
- Similarly, for `volatile' and `const volatile'. */
-
- t = make_lang_type (RECORD_TYPE);
- {
- tree obj_type = build_qualified_type (void_type_node, type_quals);
- tree optr_type = build_pointer_type (obj_type);
- tree optr, sptr;
-
- optr = build_lang_field_decl (FIELD_DECL,
- get_identifier (SIGNATURE_OPTR_NAME),
- optr_type);
- DECL_FIELD_CONTEXT (optr) = t;
- DECL_CLASS_CONTEXT (optr) = t;
-
- if (m)
- /* We can share the `sptr' field among type variants. */
- sptr = TREE_CHAIN (TYPE_FIELDS (m));
- else
- {
- tree sig_tbl_type =
- cp_build_qualified_type (to_type, TYPE_QUAL_CONST);
-
- sptr = build_lang_field_decl (FIELD_DECL,
- get_identifier (SIGNATURE_SPTR_NAME),
- build_pointer_type (sig_tbl_type));
- DECL_FIELD_CONTEXT (sptr) = t;
- DECL_CLASS_CONTEXT (sptr) = t;
- TREE_CHAIN (sptr) = NULL_TREE;
- }
-
- TREE_CHAIN (optr) = sptr;
- TYPE_FIELDS (t) = optr;
- /* Allow signature pointers/references to be grabbed 2 words at a time.
- For this to work on a Sparc, we need 8-byte alignment. */
- TYPE_ALIGN (t) = MAX (TYPE_ALIGN (double_type_node),
- TYPE_ALIGN (optr_type));
-
- /* A signature pointer/reference type isn't a `real' class type. */
- SET_IS_AGGR_TYPE (t, 0);
- }
-
- {
- tree name = build_signature_pointer_or_reference_name (to_type,
- type_quals,
- refp);
-
- /* Build a DECL node for this type, so the debugger has access to it. */
- build_signature_pointer_or_reference_decl (t, name);
- }
-
- CLASSTYPE_GOT_SEMICOLON (t) = 1;
- IS_SIGNATURE_POINTER (t) = ! refp;
- IS_SIGNATURE_REFERENCE (t) = refp;
- SIGNATURE_TYPE (t) = to_type;
-
- if (m)
- {
- /* Add this type to the chain of variants of TYPE.
- Every type has to be its own TYPE_MAIN_VARIANT. */
- TYPE_NEXT_VARIANT (t) = TYPE_NEXT_VARIANT (m);
- TYPE_NEXT_VARIANT (m) = t;
- }
- else if (refp)
- /* Record this type as the reference to TO_TYPE. */
- SIGNATURE_REFERENCE_TO (to_type) = t;
- else
- /* Record this type as the pointer to TO_TYPE. */
- SIGNATURE_POINTER_TO (to_type) = t;
-
- /* Lay out the type. This function has many callers that are concerned
- with expression-construction, and this simplifies them all.
- Also, it guarantees the TYPE_SIZE is permanent if the type is. */
- layout_type (t);
-
- current_obstack = ambient_obstack;
- saveable_obstack = ambient_saveable_obstack;
-
- /* Output debug information for this type. */
- rest_of_type_compilation (t, 1);
-
- return t;
-}
-
-/* Construct, lay out and return the type of pointers to signature TO_TYPE. */
-
-tree
-build_signature_pointer_type (to_type)
- tree to_type;
-{
- return
- build_signature_pointer_or_reference_type (TYPE_MAIN_VARIANT (to_type),
- CP_TYPE_QUALS (to_type), 0);
-}
-
-/* Construct, lay out and return the type of pointers to signature TO_TYPE. */
-
-tree
-build_signature_reference_type (to_type)
- tree to_type;
-{
- return
- build_signature_pointer_or_reference_type (TYPE_MAIN_VARIANT (to_type),
- CP_TYPE_QUALS (to_type), 1);
-}
-
-/* Return the name of the signature table (as an IDENTIFIER_NODE)
- for the given signature type SIG_TYPE and rhs type RHS_TYPE. */
-
-static tree
-get_sigtable_name (sig_type, rhs_type)
- tree sig_type, rhs_type;
-{
- tree sig_type_id = build_typename_overload (sig_type);
- tree rhs_type_id = build_typename_overload (rhs_type);
- char *buf = (char *) alloca (sizeof (SIGTABLE_NAME_FORMAT_LONG)
- + IDENTIFIER_LENGTH (sig_type_id)
- + IDENTIFIER_LENGTH (rhs_type_id) + 20);
- const char *sig_ptr = IDENTIFIER_POINTER (sig_type_id);
- const char *rhs_ptr = IDENTIFIER_POINTER (rhs_type_id);
- int i, j;
-
- for (i = 0; sig_ptr[i] == OPERATOR_TYPENAME_FORMAT[i]; i++)
- /* do nothing */;
- while (sig_ptr[i] >= '0' && sig_ptr[i] <= '9')
- i += 1;
-
- for (j = 0; rhs_ptr[j] == OPERATOR_TYPENAME_FORMAT[j]; j++)
- /* do nothing */;
- while (rhs_ptr[j] >= '0' && rhs_ptr[j] <= '9')
- j += 1;
-
- if (IS_SIGNATURE (rhs_type))
- sprintf (buf, SIGTABLE_NAME_FORMAT_LONG, sig_ptr+i, rhs_ptr+j,
- global_sigtable_name_counter++);
- else
- sprintf (buf, SIGTABLE_NAME_FORMAT, sig_ptr+i, rhs_ptr+j);
- return get_identifier (buf);
-}
-
-/* Build a field decl that points to a signature member function. */
-
-static tree
-build_member_function_pointer (member)
- tree member;
-{
- const char *namstr = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (member));
- int namlen = IDENTIFIER_LENGTH (DECL_ASSEMBLER_NAME (member));
- char *name;
- tree entry;
-
- name = (char *) alloca (namlen + sizeof (SIGNATURE_FIELD_NAME) + 2);
- sprintf (name, SIGNATURE_FIELD_NAME_FORMAT, namstr);
-
- /* @@ Do we really want to xref signature table fields? */
- GNU_xref_ref (current_function_decl, name);
-
- entry = build_lang_field_decl (FIELD_DECL, get_identifier (name),
- sigtable_entry_type);
- TREE_CONSTANT (entry) = 1;
- TREE_READONLY (entry) = 1;
-
- /* @@ Do we really want to xref signature table fields? */
- GNU_xref_decl (current_function_decl, entry);
-
- return entry;
-}
-
-/* For each FUNCTION_DECL in a signature we construct a member function
- pointer of the appropriate type. We also need two flags to test
- whether the member function pointer points to a virtual function or
- to a default implementation. Those flags will be the two lower order
- bits of the member function pointer (or the two higher order bits,
- based on the configuration).
-
- The new FIELD_DECLs are appended at the end of the last (and only)
- sublist of `list_of_fieldlists.'
-
- T is the signature type.
-
- As a side effect, each member function in the signature gets the
- `decl.ignored' bit turned on, so we don't output debug info for it. */
-
-void
-append_signature_fields (t)
- tree t;
-{
- tree x;
- tree mfptr;
- tree last_mfptr = NULL_TREE;
- tree mfptr_list = NULL_TREE;
-
- for (x = TYPE_METHODS (t); x; x = TREE_CHAIN (x))
- {
- if (TREE_CODE (x) == FUNCTION_DECL)
- {
- mfptr = build_member_function_pointer (x);
- DECL_MEMFUNC_POINTER_TO (x) = mfptr;
- DECL_MEMFUNC_POINTING_TO (mfptr) = x;
- DECL_IGNORED_P (x) = 1;
- DECL_IN_AGGR_P (mfptr) = 1;
- if (! mfptr_list)
- mfptr_list = last_mfptr = mfptr;
- else
- {
- TREE_CHAIN (last_mfptr) = mfptr;
- last_mfptr = mfptr;
- }
- }
- }
-
- /* The member function pointers must come after the TYPE_DECLs, in
- this case, because build_signature_table_constructor depends on
- finding opaque TYPE_DECLS before the functions that make use of
- them. */
- if (last_mfptr)
- TYPE_FIELDS (t) = chainon (TYPE_FIELDS (t), mfptr_list);
-}
-
-/* Compare the types of a signature member function and a class member
- function. Returns 1 if the types are in the C++ `<=' relationship.
-
- If we have a signature pointer/reference as argument or return type
- we don't want to do a recursive conformance check. The conformance
- check only succeeds if both LHS and RHS refer to the same signature
- pointer. Otherwise we need to keep information about parameter types
- around at run time to initialize the signature table correctly. */
-
-static int
-match_method_types (sig_mtype, class_mtype)
- tree sig_mtype, class_mtype;
-{
- tree sig_return_type = TREE_TYPE (sig_mtype);
- tree sig_arg_types = TYPE_ARG_TYPES (sig_mtype);
- tree class_return_type = TREE_TYPE (class_mtype);
- tree class_arg_types = TYPE_ARG_TYPES (class_mtype);
-
- /* The return types have to be the same. */
- if (!same_type_p (sig_return_type, class_return_type))
- return 0;
-
- /* Compare the first argument `this.' */
- {
- /* Get the type of what the `optr' is pointing to. */
- tree sig_this
- = TREE_TYPE (TREE_TYPE (TYPE_FIELDS (TREE_VALUE (sig_arg_types))));
- tree class_this = TREE_VALUE (class_arg_types);
-
- if (TREE_CODE (class_this) == RECORD_TYPE) /* Is `this' a sig ptr? */
- class_this = TREE_TYPE (TREE_TYPE (TYPE_FIELDS (class_this)));
- else
- class_this = TREE_TYPE (class_this);
-
- /* If a signature method's `this' is const or volatile, so has to be
- the corresponding class method's `this.' */
- if (!at_least_as_qualified_p (class_this, sig_this))
- return 0;
- }
-
- sig_arg_types = TREE_CHAIN (sig_arg_types);
- class_arg_types = TREE_CHAIN (class_arg_types);
-
- /* The number of arguments and the argument types have to be the same. */
- return compparms (sig_arg_types, class_arg_types);
-}
-
-/* Undo casts of opaque type variables to the RHS types. */
-
-static void
-undo_casts (sig_ty)
- tree sig_ty;
-{
- tree field = TYPE_FIELDS (sig_ty);
-
- /* Since all the FIELD_DECLs for the signature table entries are at the end
- of the chain (see `append_signature_fields'), we can do it this way. */
- for (; field && TREE_CODE (field) != FIELD_DECL; field = TREE_CHAIN (field))
- if (TYPE_MAIN_VARIANT (TREE_TYPE (field)) == opaque_type_node)
- TREE_TYPE (TREE_TYPE (field)) = TREE_TYPE (ptr_type_node);
-}
-
-/* Do the type checking necessary to see whether the `rhs' conforms to
- the lhs's `sig_ty'. Depending on the type of `rhs' return a NULL_TREE,
- an integer_zero_node, a constructor, or an expression offsetting the
- `rhs' signature table. */
-
-static tree
-build_signature_table_constructor (sig_ty, rhs)
- tree sig_ty, rhs;
-{
- tree rhstype = TREE_TYPE (rhs);
- tree sig_field = TYPE_FIELDS (sig_ty);
- tree result = NULL_TREE;
- tree first_rhs_field = NULL_TREE;
- tree last_rhs_field = NULL_TREE;
- int sig_ptr_p = IS_SIGNATURE (rhstype);
- int offset_p = sig_ptr_p;
-
- rhstype = sig_ptr_p ? rhstype : TREE_TYPE (rhstype);
-
- if (CLASSTYPE_TAGS (sig_ty))
- {
- sorry ("conformance check with signature containing class declarations");
- return error_mark_node;
- }
-
- for (; sig_field; sig_field = TREE_CHAIN (sig_field))
- {
- tree basetype_path, baselink, basetypes;
- tree sig_method, sig_mname, sig_mtype;
- tree rhs_method, tbl_entry;
-
- if (TREE_CODE (sig_field) == TYPE_DECL)
- {
- tree sig_field_type = TREE_TYPE (sig_field);
-
- if (TYPE_MAIN_VARIANT (sig_field_type) == opaque_type_node)
- {
- /* We've got an opaque type here. */
- tree oty_name = DECL_NAME (sig_field);
- tree oty_type = lookup_field (rhstype, oty_name, 1, 1);
-
- if (oty_type == NULL_TREE || oty_type == error_mark_node)
- {
- cp_error ("class `%T' does not contain type `%T'",
- rhstype, oty_type);
- undo_casts (sig_ty);
- return error_mark_node;
- }
- oty_type = TREE_TYPE (oty_type);
-
- /* Cast `sig_field' to be of type `oty_type'. This will be
- undone in `undo_casts' by walking over all the TYPE_DECLs. */
- TREE_TYPE (sig_field_type) = TREE_TYPE (oty_type);
- }
- /* If we don't have an opaque type, we can ignore the `typedef'. */
- continue;
- }
-
- /* Find the signature method corresponding to `sig_field'. */
- sig_method = DECL_MEMFUNC_POINTING_TO (sig_field);
- sig_mname = DECL_NAME (sig_method);
- sig_mtype = TREE_TYPE (sig_method);
-
- basetype_path = TYPE_BINFO (rhstype);
- baselink = lookup_fnfields (basetype_path, sig_mname, 0);
- if (baselink == NULL_TREE || baselink == error_mark_node)
- {
- if (! IS_DEFAULT_IMPLEMENTATION (sig_method))
- {
- cp_error ("class `%T' does not contain method `%D'",
- rhstype, sig_mname);
- undo_casts (sig_ty);
- return error_mark_node;
- }
- else
- {
- /* We use the signature's default implementation. */
- rhs_method = sig_method;
- }
- }
- else
- {
- /* Find the class method of the correct type. */
- tree rhs_methods;
- basetypes = TREE_PURPOSE (baselink);
- if (TREE_CODE (basetypes) == TREE_LIST)
- basetypes = TREE_VALUE (basetypes);
-
- rhs_methods = TREE_VALUE (baselink);
- for (; rhs_methods; rhs_methods = OVL_NEXT (rhs_methods))
- if ((rhs_method = OVL_CURRENT (rhs_methods))
- && sig_mname == DECL_NAME (rhs_method)
- && ! DECL_STATIC_FUNCTION_P (rhs_method)
- && match_method_types (sig_mtype, TREE_TYPE (rhs_method)))
- break;
-
- if (rhs_methods == NULL_TREE
- || !accessible_p (basetypes, rhs_method))
- {
- cp_error ("`%T' does not contain a method conforming to `%#D'",
- rhstype, sig_method);
- undo_casts (sig_ty);
- return error_mark_node;
- }
- }
-
- if (sig_ptr_p && rhs_method != sig_method)
- {
- tree rhs_field = DECL_MEMFUNC_POINTER_TO (rhs_method);
-
- if (first_rhs_field == NULL_TREE)
- {
- first_rhs_field = rhs_field;
- last_rhs_field = rhs_field;
- }
- else if (TREE_CHAIN (last_rhs_field) == rhs_field)
- last_rhs_field = rhs_field;
- else
- offset_p = 0;
-
- tbl_entry = build_component_ref (rhs, DECL_NAME (rhs_field),
- NULL_TREE, 1);
- }
- else
- {
- tree tag, vb_off, delta, idx, pfn = NULL_TREE, vt_off = NULL_TREE;
- tree tag_decl, vb_off_decl, delta_decl, index_decl;
- tree pfn_decl, vt_off_decl;
-
- if (rhs_method == sig_method)
- {
- /* default implementation */
- tag = build_unary_op (NEGATE_EXPR, integer_one_node, 0);
- vb_off = build_unary_op (NEGATE_EXPR, integer_one_node, 0);
- delta = integer_zero_node;
- idx = integer_zero_node;
- pfn = build_addr_func (rhs_method);
- TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (rhs_method)) = 1;
- TREE_TYPE (pfn) = ptr_type_node;
- TREE_ADDRESSABLE (rhs_method) = 1;
- offset_p = 0; /* we can't offset the rhs sig table */
- }
- else if (DECL_VINDEX (rhs_method))
- {
- /* virtual member function */
- tag = integer_one_node;
- vb_off = build_unary_op (NEGATE_EXPR, integer_one_node, 0);
- if (flag_vtable_thunks)
- delta = BINFO_OFFSET
- (get_binfo (DECL_CONTEXT (rhs_method), rhstype, 1));
- else
- delta = BINFO_OFFSET
- (get_binfo (DECL_CLASS_CONTEXT (rhs_method), rhstype, 1));
- idx = DECL_VINDEX (rhs_method);
- vt_off = get_vfield_offset (get_binfo (DECL_CONTEXT (rhs_method),
- rhstype, 0));
- }
- else
- {
- /* non-virtual member function */
- tag = integer_zero_node;
- vb_off = build_unary_op (NEGATE_EXPR, integer_one_node, 0);
- delta = BINFO_OFFSET (get_binfo (DECL_CLASS_CONTEXT (rhs_method),
- rhstype, 1));
- idx = integer_zero_node;
- pfn = build_addr_func (rhs_method);
- TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (rhs_method)) = 1;
- TREE_TYPE (pfn) = ptr_type_node;
- TREE_ADDRESSABLE (rhs_method) = 1;
- }
-
- /* Since digest_init doesn't handle initializing selected fields
- of a struct (i.e., anonymous union), we build the constructor
- by hand, without calling digest_init. */
- tag_decl = TYPE_FIELDS (sigtable_entry_type);
- vb_off_decl = TREE_CHAIN (tag_decl);
- delta_decl = TREE_CHAIN (vb_off_decl);
- index_decl = TREE_CHAIN (delta_decl);
- pfn_decl = TREE_CHAIN (index_decl);
- vt_off_decl = TREE_CHAIN (pfn_decl);
-
- tag = cp_convert (TREE_TYPE (tag_decl), tag);
- vb_off = cp_convert (TREE_TYPE (vb_off_decl), vb_off);
- delta = cp_convert (TREE_TYPE (delta_decl), delta);
- idx = cp_convert (TREE_TYPE (index_decl), idx);
-
- if (DECL_VINDEX (rhs_method))
- {
- vt_off = cp_convert (TREE_TYPE (vt_off_decl), vt_off);
-
- tbl_entry = build_tree_list (vt_off_decl, vt_off);
- }
- else
- {
- pfn = cp_convert (TREE_TYPE (pfn_decl), pfn);
-
- tbl_entry = build_tree_list (pfn_decl, pfn);
- }
- tbl_entry = tree_cons (delta_decl, delta,
- tree_cons (index_decl, idx, tbl_entry));
- tbl_entry = tree_cons (tag_decl, tag,
- tree_cons (vb_off_decl, vb_off, tbl_entry));
- tbl_entry = build (CONSTRUCTOR, sigtable_entry_type,
- NULL_TREE, tbl_entry);
-
- TREE_CONSTANT (tbl_entry) = 1;
- }
-
- /* Chain those function address expressions together. */
- if (result)
- result = tree_cons (NULL_TREE, tbl_entry, result);
- else
- result = build_tree_list (NULL_TREE, tbl_entry);
- }
-
- if (result == NULL_TREE)
- {
- /* The signature was empty, we don't need a signature table. */
- undo_casts (sig_ty);
- return NULL_TREE;
- }
-
- if (offset_p)
- {
- if (first_rhs_field == TYPE_FIELDS (rhstype))
- {
- /* The sptr field on the lhs can be copied from the rhs. */
- undo_casts (sig_ty);
- return integer_zero_node;
- }
- else
- {
- /* The sptr field on the lhs will point into the rhs sigtable. */
- undo_casts (sig_ty);
- return build_component_ref (rhs, DECL_NAME (first_rhs_field),
- NULL_TREE, 0);
- }
- }
-
- /* We need to construct a new signature table. */
- result = build_nt (CONSTRUCTOR, NULL_TREE, nreverse (result));
- TREE_HAS_CONSTRUCTOR (result) = 1;
- TREE_CONSTANT (result) = !sig_ptr_p;
-
- undo_casts (sig_ty);
- return result;
-}
-
-/* Build a signature table declaration and initialize it or return an
- existing one if we built one already. If we don't get a constructor
- as initialization expression, we don't need a new signature table
- variable and just hand back the init expression.
-
- The declaration processing is done by hand instead of using `cp_finish_decl'
- so that we can make signature pointers global variables instead of
- static ones. */
-
-static tree
-build_sigtable (sig_type, rhs_type, init_from)
- tree sig_type, rhs_type, init_from;
-{
- tree name = NULL_TREE;
- tree decl = NULL_TREE;
- tree init_expr;
-
- push_obstacks_nochange ();
- end_temporary_allocation ();
-
- if (! IS_SIGNATURE (rhs_type))
- {
- name = get_sigtable_name (sig_type, rhs_type);
- decl = IDENTIFIER_GLOBAL_VALUE (name);
- }
- if (decl == NULL_TREE)
- {
- tree init = NULL_TREE;
-
- /* We allow only one signature table to be generated for signatures
- with opaque types. Otherwise we create a loophole in the type
- system since we could cast data from one classes implementation
- of the opaque type to that of another class. */
- if (SIGNATURE_HAS_OPAQUE_TYPEDECLS (sig_type)
- && SIGTABLE_HAS_BEEN_GENERATED (sig_type))
- {
- error ("signature with opaque type implemented by multiple classes");
- return error_mark_node;
- }
- SIGTABLE_HAS_BEEN_GENERATED (sig_type) = 1;
-
- init_expr = build_signature_table_constructor (sig_type, init_from);
- if (init_expr == NULL_TREE || TREE_CODE (init_expr) != CONSTRUCTOR)
- return init_expr;
-
- if (name == NULL_TREE)
- name = get_sigtable_name (sig_type, rhs_type);
- {
- tree context = current_function_decl;
-
- /* Make the signature table global, not just static in whichever
- function a signature pointer/ref is used for the first time. */
- current_function_decl = NULL_TREE;
- decl = pushdecl_top_level (build_decl (VAR_DECL, name, sig_type));
- current_function_decl = context;
- }
- SET_IDENTIFIER_GLOBAL_VALUE (name, decl);
- store_init_value (decl, init_expr);
- if (IS_SIGNATURE (rhs_type))
- {
- init = DECL_INITIAL (decl);
- DECL_INITIAL (decl) = error_mark_node;
- }
-
- DECL_ALIGN (decl) = MAX (TYPE_ALIGN (double_type_node),
- DECL_ALIGN (decl));
-#if 0
- /* GDB-4.7 doesn't find the initialization value of a signature table
- when it is constant. */
- TREE_READONLY (decl) = 1;
-#endif
- TREE_STATIC (decl) = 1;
- TREE_USED (decl) = 1;
-
- make_decl_rtl (decl, NULL, 1);
- if (IS_SIGNATURE (rhs_type))
- expand_static_init (decl, init);
- }
-
- pop_obstacks ();
-
- return decl;
-}
-
-/* Create a constructor or modify expression if the LHS of an assignment
- is a signature pointer or a signature reference. If LHS is a record
- type node, we build a constructor, otherwise a compound expression. */
-
-tree
-build_signature_pointer_constructor (lhs, rhs)
- tree lhs, rhs;
-{
- register struct obstack *ambient_obstack = current_obstack;
- register struct obstack *ambient_saveable_obstack = saveable_obstack;
- int initp = (TREE_CODE (lhs) == RECORD_TYPE);
- tree lhstype = initp ? lhs : TREE_TYPE (lhs);
- tree rhstype = TREE_TYPE (rhs);
- tree sig_ty = SIGNATURE_TYPE (lhstype);
- tree sig_tbl, sptr_expr, optr_expr;
- tree result;
-
- if (! ((TREE_CODE (rhstype) == POINTER_TYPE
- && TREE_CODE (TREE_TYPE (rhstype)) == RECORD_TYPE)
- || (TYPE_LANG_SPECIFIC (rhstype)
- && (IS_SIGNATURE_POINTER (rhstype)
- || IS_SIGNATURE_REFERENCE (rhstype)))))
- {
- error ("invalid assignment to signature pointer or reference");
- return error_mark_node;
- }
-
- if (TYPE_SIZE (sig_ty) == NULL_TREE)
- {
- cp_error ("undefined signature `%T' used in signature %s declaration",
- sig_ty,
- IS_SIGNATURE_POINTER (lhstype) ? "pointer" : "reference");
- return error_mark_node;
- }
-
- /* If SIG_TY is permanent, make the signature table constructor and
- the signature pointer/reference constructor permanent too. */
- if (TREE_PERMANENT (sig_ty))
- {
- current_obstack = &permanent_obstack;
- saveable_obstack = &permanent_obstack;
- }
-
- if (TYPE_LANG_SPECIFIC (rhstype)
- && (IS_SIGNATURE_POINTER (rhstype) || IS_SIGNATURE_REFERENCE (rhstype)))
- {
- if (SIGNATURE_TYPE (rhstype) == sig_ty)
- {
- /* LHS and RHS are signature pointers/refs of the same signature. */
- optr_expr = build_optr_ref (rhs);
- sptr_expr = build_sptr_ref (rhs);
- }
- else
- {
- /* We need to create a new signature table and copy
- elements from the rhs signature table. */
- tree rhs_sptr_ref = build_sptr_ref (rhs);
- tree rhs_tbl = build1 (INDIRECT_REF, SIGNATURE_TYPE (rhstype),
- rhs_sptr_ref);
-
- sig_tbl = build_sigtable (sig_ty, SIGNATURE_TYPE (rhstype), rhs_tbl);
- if (sig_tbl == error_mark_node)
- return error_mark_node;
-
- optr_expr = build_optr_ref (rhs);
- if (sig_tbl == NULL_TREE)
- /* The signature was empty. The signature pointer is
- pretty useless, but the user has been warned. */
- sptr_expr = copy_node (null_pointer_node);
- else if (sig_tbl == integer_zero_node)
- sptr_expr = rhs_sptr_ref;
- else
- sptr_expr = build_unary_op (ADDR_EXPR, sig_tbl, 0);
- TREE_TYPE (sptr_expr) = build_pointer_type (sig_ty);
- }
- }
- else
- {
- sig_tbl = build_sigtable (sig_ty, TREE_TYPE (rhstype), rhs);
- if (sig_tbl == error_mark_node)
- return error_mark_node;
-
- optr_expr = rhs;
- if (sig_tbl == NULL_TREE)
- /* The signature was empty. The signature pointer is
- pretty useless, but the user has been warned. */
- {
- sptr_expr = copy_node (null_pointer_node);
- TREE_TYPE (sptr_expr) = build_pointer_type (sig_ty);
- }
- else
- sptr_expr = build_unary_op (ADDR_EXPR, sig_tbl, 0);
- }
-
- if (initp)
- {
- result = tree_cons (NULL_TREE, optr_expr,
- build_tree_list (NULL_TREE, sptr_expr));
- result = build_nt (CONSTRUCTOR, NULL_TREE, result);
- result = digest_init (lhstype, result, 0);
- }
- else
- {
- if (TREE_READONLY (lhs) || CP_TYPE_CONST_P (lhstype))
- readonly_error (lhs, "assignment", 0);
-
- optr_expr = build_modify_expr (build_optr_ref (lhs), NOP_EXPR,
- optr_expr);
- sptr_expr = build_modify_expr (build_sptr_ref (lhs), NOP_EXPR,
- sptr_expr);
-
- result = tree_cons (NULL_TREE, optr_expr,
- tree_cons (NULL_TREE, sptr_expr,
- build_tree_list (NULL_TREE, lhs)));
- result = build_compound_expr (result);
- }
-
- current_obstack = ambient_obstack;
- saveable_obstack = ambient_saveable_obstack;
- return result;
-}
-
-/* Build a temporary variable declaration for the instance of a signature
- member function call if it isn't a declaration node already. Simply
- using a SAVE_EXPR doesn't work since we need `this' in both branches
- of a conditional expression. */
-
-static tree
-save_this (instance)
- tree instance;
-{
- tree decl;
-
- if (TREE_CODE_CLASS (TREE_CODE (instance)) == 'd')
- decl = instance;
- else
- {
- decl = build_decl (VAR_DECL, NULL_TREE, TREE_TYPE (instance));
- DECL_REGISTER (decl) = 1;
- layout_decl (decl, 0);
- expand_decl (decl);
- }
-
- return decl;
-}
-
-/* Build a signature member function call. Looks up the signature table
- entry corresponding to FUNCTION. Depending on the value of the CODE
- field, either call the function in PFN directly, or use OFFSET to
- index the object's virtual function table. */
-
-tree
-build_signature_method_call (function, parms)
- tree function, parms;
-{
- tree instance = TREE_VALUE (parms);
- tree saved_instance = save_this (instance); /* Create temp for `this'. */
- tree object_ptr = build_optr_ref (saved_instance);
- tree new_object_ptr, new_parms;
- tree signature_tbl_ptr = build_sptr_ref (saved_instance);
- tree sig_field_name = DECL_NAME (DECL_MEMFUNC_POINTER_TO (function));
- tree basetype = DECL_CONTEXT (function);
- tree basetype_path = TYPE_BINFO (basetype);
- tree tbl_entry = build_component_ref (build1 (INDIRECT_REF, basetype,
- signature_tbl_ptr),
- sig_field_name, basetype_path, 1);
- tree tag, delta, pfn, vt_off, idx, vfn;
- tree deflt_call = NULL_TREE, direct_call, virtual_call, result;
-
- tbl_entry = save_expr (tbl_entry);
- tag = build_component_ref (tbl_entry, tag_identifier, NULL_TREE, 1);
- delta = build_component_ref (tbl_entry, delta_identifier, NULL_TREE, 1);
- pfn = build_component_ref (tbl_entry, pfn_identifier, NULL_TREE, 1);
- vt_off = build_component_ref (tbl_entry, vt_off_identifier, NULL_TREE, 1);
- idx = build_component_ref (tbl_entry, index_identifier, NULL_TREE, 1);
- TREE_TYPE (pfn) = build_pointer_type (TREE_TYPE (function));
-
- if (IS_DEFAULT_IMPLEMENTATION (function))
- {
- pfn = save_expr (pfn);
- deflt_call = build_function_call (pfn, parms);
- }
-
- new_object_ptr = build (PLUS_EXPR, build_pointer_type (basetype),
- cp_convert (ptrdiff_type_node, object_ptr),
- cp_convert (ptrdiff_type_node, delta));
-
- parms = tree_cons (NULL_TREE,
- cp_convert (build_pointer_type (basetype), object_ptr),
- TREE_CHAIN (parms));
- new_parms = tree_cons (NULL_TREE, new_object_ptr, TREE_CHAIN (parms));
-
- {
- /* Cast the signature method to have `this' of a normal pointer type. */
- tree old_this = TREE_VALUE (TYPE_ARG_TYPES (TREE_TYPE (TREE_TYPE (pfn))));
-
- TREE_VALUE (TYPE_ARG_TYPES (TREE_TYPE (TREE_TYPE (pfn))))
- = build_qualified_type (build_pointer_type (basetype),
- TYPE_QUALS (old_this));
-
- direct_call = build_function_call (pfn, new_parms);
-
- {
- tree vfld, vtbl, aref;
-
- vfld = build (PLUS_EXPR,
- build_pointer_type (build_pointer_type (vtbl_type_node)),
- cp_convert (ptrdiff_type_node, object_ptr),
- cp_convert (ptrdiff_type_node, vt_off));
- vtbl = build_indirect_ref (build_indirect_ref (vfld, NULL_PTR),
- NULL_PTR);
- aref = build_array_ref (vtbl, idx);
-
- if (flag_vtable_thunks)
- vfn = aref;
- else
- vfn = build_component_ref (aref, pfn_identifier, NULL_TREE, 0);
-
- TREE_TYPE (vfn) = build_pointer_type (TREE_TYPE (function));
-
- virtual_call = build_function_call (vfn, new_parms);
- }
-
- /* Undo the cast, make `this' a signature pointer again. */
- TREE_VALUE (TYPE_ARG_TYPES (TREE_TYPE (TREE_TYPE (pfn)))) = old_this;
- }
-
- /* Once the function was found, there should be no reason why we
- couldn't build the member function pointer call. */
- if (!direct_call || direct_call == error_mark_node
- || !virtual_call || virtual_call == error_mark_node
- || (IS_DEFAULT_IMPLEMENTATION (function)
- && (!deflt_call || deflt_call == error_mark_node)))
- {
- compiler_error ("cannot build call of signature member function `%s'",
- fndecl_as_string (function, 1));
- return error_mark_node;
- }
-
- if (IS_DEFAULT_IMPLEMENTATION (function))
- {
- tree test = build_binary_op_nodefault (LT_EXPR, tag, integer_zero_node,
- LT_EXPR);
- result = build_conditional_expr (tag,
- build_conditional_expr (test,
- deflt_call,
- virtual_call),
- direct_call);
- }
- else
- result = build_conditional_expr (tag, virtual_call, direct_call);
-
- /* If we created a temporary variable for `this', initialize it first. */
- if (instance != saved_instance)
- result = build (COMPOUND_EXPR, TREE_TYPE (result),
- build_modify_expr (saved_instance, NOP_EXPR, instance),
- result);
-
- return result;
-}
-
-/* Create a COMPONENT_REF expression for referencing the OPTR field
- of a signature pointer or reference. */
-
-tree
-build_optr_ref (instance)
- tree instance;
-{
- tree field = get_identifier (SIGNATURE_OPTR_NAME);
-
- return build_component_ref (instance, field, NULL_TREE, 1);
-}
-
-/* Create a COMPONENT_REF expression for referencing the SPTR field
- of a signature pointer or reference. */
-
-static tree
-build_sptr_ref (instance)
- tree instance;
-{
- tree field = get_identifier (SIGNATURE_SPTR_NAME);
-
- return build_component_ref (instance, field, NULL_TREE, 1);
-}
diff --git a/contrib/gcc/cp/tinfo.cc b/contrib/gcc/cp/tinfo.cc
deleted file mode 100644
index 5269cb5940e4..000000000000
--- a/contrib/gcc/cp/tinfo.cc
+++ /dev/null
@@ -1,134 +0,0 @@
-// Methods for type_info for -*- C++ -*- Run Time Type Identification.
-// Copyright (C) 1994, 1996, 1998 Free Software Foundation
-
-// This file is part of GNU CC.
-
-// GNU CC 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.
-
-// GNU CC is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with GNU CC; see the file COPYING. If not, write to
-// the Free Software Foundation, 59 Temple Place - Suite 330,
-// Boston, MA 02111-1307, USA.
-
-// As a special exception, if you link this library with other files,
-// some of which are compiled with GCC, to produce an executable,
-// this library does not by itself 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.
-
-#pragma implementation "typeinfo"
-
-#include <stddef.h>
-#include "tinfo.h"
-#include "new" // for placement new
-
-// This file contains the minimal working set necessary to link with code
-// that uses virtual functions and -frtti but does not actually use RTTI
-// functionality.
-
-std::type_info::
-~type_info ()
-{ }
-
-// We can't rely on common symbols being shared between shared objects.
-bool std::type_info::
-operator== (const std::type_info& arg) const
-{
- return (&arg == this) || (strcmp (name (), arg.name ()) == 0);
-}
-
-extern "C" void
-__rtti_class (void *addr, const char *name,
- const __class_type_info::base_info *bl, size_t bn)
-{ new (addr) __class_type_info (name, bl, bn); }
-
-extern "C" void
-__rtti_si (void *addr, const char *n, const std::type_info *ti)
-{
- new (addr) __si_type_info
- (n, static_cast <const __user_type_info &> (*ti));
-}
-
-extern "C" void
-__rtti_user (void *addr, const char *name)
-{ new (addr) __user_type_info (name); }
-
-// dynamic_cast helper methods.
-// Returns a pointer to the desired sub-object or 0.
-
-void * __user_type_info::
-dcast (const type_info& to, int, void *addr, const type_info *, void *) const
-{ return (*this == to) ? addr : 0; }
-
-void * __si_type_info::
-dcast (const type_info& to, int require_public, void *addr,
- const type_info *sub, void *subptr) const
-{
- if (*this == to)
- return addr;
- return base.dcast (to, require_public, addr, sub, subptr);
-}
-
-void* __class_type_info::
-dcast (const type_info& desired, int is_public, void *objptr,
- const type_info *sub, void *subptr) const
-{
- if (*this == desired)
- return objptr;
-
- void *match_found = 0;
- for (size_t i = 0; i < n_bases; i++)
- {
- if (is_public && base_list[i].access != PUBLIC)
- continue;
-
- void *p = (char *)objptr + base_list[i].offset;
- if (base_list[i].is_virtual)
- p = *(void **)p;
- p = base_list[i].base->dcast (desired, is_public, p, sub, subptr);
- if (p)
- {
- if (match_found == 0)
- match_found = p;
- else if (match_found != p)
- {
- if (sub)
- {
- // Perhaps we're downcasting from *sub to desired; see if
- // subptr is a subobject of exactly one of {match_found,p}.
-
- const __user_type_info &d =
- static_cast <const __user_type_info &> (desired);
-
- void *os = d.dcast (*sub, 1, match_found);
- void *ns = d.dcast (*sub, 1, p);
-
- if (os == ns)
- /* ambiguous -- subptr is a virtual base */;
- else if (os == subptr)
- continue;
- else if (ns == subptr)
- {
- match_found = p;
- continue;
- }
- }
-
- // base found at two different pointers,
- // conversion is not unique
- return 0;
- }
- }
- }
-
- return match_found;
-}
diff --git a/contrib/gcc/cp/tinfo.h b/contrib/gcc/cp/tinfo.h
deleted file mode 100644
index e0b9eec78970..000000000000
--- a/contrib/gcc/cp/tinfo.h
+++ /dev/null
@@ -1,55 +0,0 @@
-// RTTI support internals for -*- C++ -*-
-// Copyright (C) 1994, 1995, 1996, 1998 Free Software Foundation
-
-#include "typeinfo"
-
-// Class declarations shared between the typeinfo implementation files.
-
-// type_info for a class with no base classes (or an enum).
-
-struct __user_type_info : public std::type_info {
- __user_type_info (const char *n) : type_info (n) {}
-
- // If our type can be converted to the desired type,
- // return the pointer, adjusted accordingly; else return 0.
- virtual void* dcast (const type_info &, int, void *,
- const type_info * = 0, void * = 0) const;
-};
-
-// type_info for a class with one public, nonvirtual base class.
-
-class __si_type_info : public __user_type_info {
- const __user_type_info &base;
-
-public:
- __si_type_info (const char *n, const __user_type_info &b)
- : __user_type_info (n), base (b) { }
-
- virtual void *dcast (const type_info &, int, void *,
- const type_info * = 0, void * = 0) const;
-};
-
-// type_info for a general class.
-
-typedef unsigned int USItype __attribute__ ((mode (SI)));
-
-struct __class_type_info : public __user_type_info {
- enum access { PUBLIC = 1, PROTECTED = 2, PRIVATE = 3 };
-
- struct base_info {
- const __user_type_info *base;
- USItype offset: 29;
- bool is_virtual: 1;
- enum access access: 2;
- };
-
- const base_info *base_list;
- size_t n_bases;
-
- __class_type_info (const char *name, const base_info *bl, size_t bn)
- : __user_type_info (name), base_list (bl), n_bases (bn) {}
-
- // This is a little complex.
- virtual void* dcast (const type_info &, int, void *,
- const type_info * = 0, void * = 0) const;
-};
diff --git a/contrib/gcc/cp/tinfo2.cc b/contrib/gcc/cp/tinfo2.cc
deleted file mode 100644
index b101db3c0548..000000000000
--- a/contrib/gcc/cp/tinfo2.cc
+++ /dev/null
@@ -1,300 +0,0 @@
-// Methods for type_info for -*- C++ -*- Run Time Type Identification.
-// Copyright (C) 1994, 96-97, 1998 Free Software Foundation
-
-// This file is part of GNU CC.
-
-// GNU CC 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.
-
-// GNU CC is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with GNU CC; see the file COPYING. If not, write to
-// the Free Software Foundation, 59 Temple Place - Suite 330,
-// Boston, MA 02111-1307, USA.
-
-// As a special exception, if you link this library with other files,
-// some of which are compiled with GCC, to produce an executable,
-// this library does not by itself 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 <stddef.h>
-#include "tinfo.h"
-#include "new" // for placement new
-
-using std::type_info;
-
-bool
-type_info::before (const type_info &arg) const
-{
- return strcmp (name (), arg.name ()) < 0;
-}
-
-// type info for pointer type.
-
-struct __pointer_type_info : public type_info {
- const type_info& type;
-
- __pointer_type_info (const char *n, const type_info& ti)
- : type_info (n), type (ti) {}
-};
-
-// type info for attributes
-
-struct __attr_type_info : public type_info {
- enum cv { NONE = 0, CONST = 1, VOLATILE = 2, CONSTVOL = 1 | 2 };
-
- const type_info& type;
- cv attr;
-
- __attr_type_info (const char *n, cv a, const type_info& t)
- : type_info (n), type (t), attr (a) {}
-};
-
-// type_info for builtin type
-
-struct __builtin_type_info : public type_info {
- __builtin_type_info (const char *n): type_info (n) {}
-};
-
-// type info for function.
-
-struct __func_type_info : public type_info {
- __func_type_info (const char *n) : type_info (n) {}
-};
-
-// type info for pointer to member function.
-
-struct __ptmf_type_info : public type_info {
- __ptmf_type_info (const char *n) : type_info (n) {}
-};
-
-// type info for pointer to data member.
-
-struct __ptmd_type_info : public type_info {
- __ptmd_type_info (const char *n): type_info (n) {}
-};
-
-// type info for array.
-
-struct __array_type_info : public type_info {
- __array_type_info (const char *n): type_info (n) {}
-};
-
-// Entry points for the compiler.
-
-/* Low level match routine used by compiler to match types of catch
- variables and thrown objects. */
-
-extern "C" void*
-__throw_type_match_rtti (const void *catch_type_r, const void *throw_type_r,
- void *objptr)
-{
- const type_info &catch_type = *(const type_info *)catch_type_r;
- const type_info &throw_type = *(const type_info *)throw_type_r;
-
- if (catch_type == throw_type)
- return objptr;
-
-#if 0
- printf ("We want to match a %s against a %s!\n",
- throw_type.name (), catch_type.name ());
-#endif
-
- void *new_objptr = 0;
-
- if (const __user_type_info *p
- = dynamic_cast <const __user_type_info *> (&throw_type))
- {
- /* The 1 skips conversions to private bases. */
- new_objptr = p->dcast (catch_type, 1, objptr);
- }
- else if (const __pointer_type_info *fr =
- dynamic_cast <const __pointer_type_info *> (&throw_type))
- {
- const __pointer_type_info *to =
- dynamic_cast <const __pointer_type_info *> (&catch_type);
-
- if (! to)
- goto fail;
-
- const type_info *subfr = &fr->type, *subto = &to->type;
- __attr_type_info::cv cvfrom, cvto;
-
- if (const __attr_type_info *at
- = dynamic_cast <const __attr_type_info *> (subfr))
- {
- cvfrom = at->attr;
- subfr = &at->type;
- }
- else
- cvfrom = __attr_type_info::NONE;
-
- if (const __attr_type_info *at
- = dynamic_cast <const __attr_type_info *> (subto))
- {
- cvto = at->attr;
- subto = &at->type;
- }
- else
- cvto = __attr_type_info::NONE;
-
- if (((cvfrom & __attr_type_info::CONST)
- > (cvto & __attr_type_info::CONST))
- || ((cvfrom & __attr_type_info::VOLATILE)
- > (cvto & __attr_type_info::VOLATILE)))
- goto fail;
-
- if (*subto == *subfr)
- new_objptr = objptr;
- else if (*subto == typeid (void)
- && dynamic_cast <const __func_type_info *> (subfr) == 0)
- new_objptr = objptr;
- else if (const __user_type_info *p
- = dynamic_cast <const __user_type_info *> (subfr))
- {
- /* The 1 skips conversions to private bases. */
- new_objptr = p->dcast (*subto, 1, objptr);
- }
- else if (const __pointer_type_info *pfr
- = dynamic_cast <const __pointer_type_info *> (subfr))
- {
- // Multi-level pointer conversion.
-
- const __pointer_type_info *pto
- = dynamic_cast <const __pointer_type_info *> (subto);
-
- if (! pto)
- goto fail;
-
- bool constp = (cvto & __attr_type_info::CONST);
- for (subto = &pto->type, subfr = &pfr->type; ;
- subto = &pto->type, subfr = &pfr->type)
- {
- if (const __attr_type_info *at
- = dynamic_cast <const __attr_type_info *> (subfr))
- {
- cvfrom = at->attr;
- subfr = &at->type;
- }
- else
- cvfrom = __attr_type_info::NONE;
-
- if (const __attr_type_info *at
- = dynamic_cast <const __attr_type_info *> (subto))
- {
- cvto = at->attr;
- subto = &at->type;
- }
- else
- cvto = __attr_type_info::NONE;
-
- if (((cvfrom & __attr_type_info::CONST)
- > (cvto & __attr_type_info::CONST))
- || ((cvfrom & __attr_type_info::VOLATILE)
- > (cvto & __attr_type_info::VOLATILE)))
- goto fail;
-
- if (! constp
- && (((cvfrom & __attr_type_info::CONST)
- < (cvto & __attr_type_info::CONST))
- || ((cvfrom & __attr_type_info::VOLATILE)
- < (cvto & __attr_type_info::VOLATILE))))
- goto fail;
-
- if (*subto == *subfr)
- {
- new_objptr = objptr;
- break;
- }
-
- pto = dynamic_cast <const __pointer_type_info *> (subto);
- pfr = dynamic_cast <const __pointer_type_info *> (subfr);
- if (! pto || ! pfr)
- goto fail;
-
- if (! (cvto & __attr_type_info::CONST))
- constp = false;
- }
- }
- }
- fail:
-
-#if 0
- if (new_objptr)
- printf ("It converts, delta is %d\n", new_objptr-objptr);
-#endif
- return new_objptr;
-}
-
-/* Called from __cp_pop_exception. Is P the type_info node for a pointer
- of some kind? */
-
-bool
-__is_pointer (void *p)
-{
- const type_info *t = reinterpret_cast <const type_info *>(p);
- const __pointer_type_info *pt =
- dynamic_cast <const __pointer_type_info *> (t);
- return pt != 0;
-}
-
-extern "C" void
-__rtti_ptr (void *addr, const char *n, const type_info *ti)
-{ new (addr) __pointer_type_info (n, *ti); }
-
-extern "C" void
-__rtti_attr (void *addr, const char *n, int attrval, const type_info *ti)
-{
- new (addr) __attr_type_info
- (n, static_cast <__attr_type_info::cv> (attrval), *ti);
-}
-
-extern "C" void
-__rtti_func (void *addr, const char *name)
-{ new (addr) __func_type_info (name); }
-
-extern "C" void
-__rtti_ptmf (void *addr, const char *name)
-{ new (addr) __ptmf_type_info (name); }
-
-extern "C" void
-__rtti_ptmd (void *addr, const char *name)
-{ new (addr) __ptmd_type_info (name); }
-
-extern "C" void
-__rtti_array (void *addr, const char *name)
-{ new (addr) __array_type_info (name); }
-
-extern "C" void *
-__dynamic_cast (const type_info& (*from)(void), const type_info& (*to)(void),
- int require_public, void *address,
- const type_info & (*sub)(void), void *subptr)
-{
- return static_cast <const __user_type_info &> (from ()).dcast
- (to (), require_public, address, &(sub ()), subptr);
-}
-
-// type_info nodes and functions for the builtin types. The mangling here
-// must match the mangling in gcc/cp/rtti.c.
-
-#define BUILTIN(mangled) \
-unsigned char __ti##mangled [sizeof (__builtin_type_info)] \
- __attribute__ ((aligned (__alignof__ (void *)))); \
-extern "C" const type_info &__tf##mangled (void) { \
- if ((*(void **) __ti##mangled) == 0) \
- new (__ti##mangled) __builtin_type_info (#mangled); \
- return *(type_info *)__ti##mangled; \
-}
-
-BUILTIN (v); BUILTIN (x); BUILTIN (l); BUILTIN (i); BUILTIN (s); BUILTIN (b);
-BUILTIN (c); BUILTIN (w); BUILTIN (r); BUILTIN (d); BUILTIN (f);
-BUILTIN (Ui); BUILTIN (Ul); BUILTIN (Ux); BUILTIN (Us); BUILTIN (Uc);
-BUILTIN (Sc);
diff --git a/contrib/gcc/cplus-dem.c b/contrib/gcc/cplus-dem.c
deleted file mode 100644
index 6d51710685c6..000000000000
--- a/contrib/gcc/cplus-dem.c
+++ /dev/null
@@ -1,4615 +0,0 @@
-/* Demangler for GNU C++
- Copyright 1989, 91, 94, 95, 96, 97, 98, 1999 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.uucp)
- Rewritten by Fred Fish (fnf@cygnus.com) for ARM and Lucid demangling
- Modified by Satish Pai (pai@apollo.hp.com) for HP demangling
-
-This file is part of the libiberty library.
-Libiberty 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.
-
-Libiberty 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 libiberty; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* This file exports two functions; cplus_mangle_opname and cplus_demangle.
-
- This file imports xmalloc and xrealloc, which are like malloc and
- realloc except that they generate a fatal error if there is no
- available memory. */
-
-/* This file lives in both GCC and libiberty. When making changes, please
- try not to break either. */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <ctype.h>
-#include <sys/types.h>
-#include <string.h>
-#include <stdio.h>
-
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#else
-char * malloc ();
-char * realloc ();
-#endif
-
-#include <demangle.h>
-#undef CURRENT_DEMANGLING_STYLE
-#define CURRENT_DEMANGLING_STYLE work->options
-
-#include "libiberty.h"
-
-#define min(X,Y) (((X) < (Y)) ? (X) : (Y))
-
-static const char *mystrstr PARAMS ((const char *, const char *));
-
-static const char *
-mystrstr (s1, s2)
- const char *s1, *s2;
-{
- register const char *p = s1;
- register int len = strlen (s2);
-
- for (; (p = strchr (p, *s2)) != 0; p++)
- {
- if (strncmp (p, s2, len) == 0)
- {
- return (p);
- }
- }
- return (0);
-}
-
-/* In order to allow a single demangler executable to demangle strings
- using various common values of CPLUS_MARKER, as well as any specific
- one set at compile time, we maintain a string containing all the
- commonly used ones, and check to see if the marker we are looking for
- is in that string. CPLUS_MARKER is usually '$' on systems where the
- assembler can deal with that. Where the assembler can't, it's usually
- '.' (but on many systems '.' is used for other things). We put the
- current defined CPLUS_MARKER first (which defaults to '$'), followed
- by the next most common value, followed by an explicit '$' in case
- the value of CPLUS_MARKER is not '$'.
-
- We could avoid this if we could just get g++ to tell us what the actual
- cplus marker character is as part of the debug information, perhaps by
- ensuring that it is the character that terminates the gcc<n>_compiled
- marker symbol (FIXME). */
-
-#if !defined (CPLUS_MARKER)
-#define CPLUS_MARKER '$'
-#endif
-
-enum demangling_styles current_demangling_style = gnu_demangling;
-
-static char cplus_markers[] = { CPLUS_MARKER, '.', '$', '\0' };
-
-static char char_str[2] = { '\000', '\000' };
-
-void
-set_cplus_marker_for_demangling (ch)
- int ch;
-{
- cplus_markers[0] = ch;
-}
-
-typedef struct string /* Beware: these aren't required to be */
-{ /* '\0' terminated. */
- char *b; /* pointer to start of string */
- char *p; /* pointer after last character */
- char *e; /* pointer after end of allocated space */
-} string;
-
-/* Stuff that is shared between sub-routines.
- Using a shared structure allows cplus_demangle to be reentrant. */
-
-struct work_stuff
-{
- int options;
- char **typevec;
- char **ktypevec;
- char **btypevec;
- int numk;
- int numb;
- int ksize;
- int bsize;
- int ntypes;
- int typevec_size;
- int constructor;
- int destructor;
- int static_type; /* A static member function */
- int temp_start; /* index in demangled to start of template args */
- int type_quals; /* The type qualifiers. */
- int dllimported; /* Symbol imported from a PE DLL */
- char **tmpl_argvec; /* Template function arguments. */
- int ntmpl_args; /* The number of template function arguments. */
- int forgetting_types; /* Nonzero if we are not remembering the types
- we see. */
- string* previous_argument; /* The last function argument demangled. */
- int nrepeats; /* The number of times to repeat the previous
- argument. */
-};
-
-#define PRINT_ANSI_QUALIFIERS (work -> options & DMGL_ANSI)
-#define PRINT_ARG_TYPES (work -> options & DMGL_PARAMS)
-
-static const struct optable
-{
- const char *in;
- const char *out;
- int flags;
-} optable[] = {
- {"nw", " new", DMGL_ANSI}, /* new (1.92, ansi) */
- {"dl", " delete", DMGL_ANSI}, /* new (1.92, ansi) */
- {"new", " new", 0}, /* old (1.91, and 1.x) */
- {"delete", " delete", 0}, /* old (1.91, and 1.x) */
- {"vn", " new []", DMGL_ANSI}, /* GNU, pending ansi */
- {"vd", " delete []", DMGL_ANSI}, /* GNU, pending ansi */
- {"as", "=", DMGL_ANSI}, /* ansi */
- {"ne", "!=", DMGL_ANSI}, /* old, ansi */
- {"eq", "==", DMGL_ANSI}, /* old, ansi */
- {"ge", ">=", DMGL_ANSI}, /* old, ansi */
- {"gt", ">", DMGL_ANSI}, /* old, ansi */
- {"le", "<=", DMGL_ANSI}, /* old, ansi */
- {"lt", "<", DMGL_ANSI}, /* old, ansi */
- {"plus", "+", 0}, /* old */
- {"pl", "+", DMGL_ANSI}, /* ansi */
- {"apl", "+=", DMGL_ANSI}, /* ansi */
- {"minus", "-", 0}, /* old */
- {"mi", "-", DMGL_ANSI}, /* ansi */
- {"ami", "-=", DMGL_ANSI}, /* ansi */
- {"mult", "*", 0}, /* old */
- {"ml", "*", DMGL_ANSI}, /* ansi */
- {"amu", "*=", DMGL_ANSI}, /* ansi (ARM/Lucid) */
- {"aml", "*=", DMGL_ANSI}, /* ansi (GNU/g++) */
- {"convert", "+", 0}, /* old (unary +) */
- {"negate", "-", 0}, /* old (unary -) */
- {"trunc_mod", "%", 0}, /* old */
- {"md", "%", DMGL_ANSI}, /* ansi */
- {"amd", "%=", DMGL_ANSI}, /* ansi */
- {"trunc_div", "/", 0}, /* old */
- {"dv", "/", DMGL_ANSI}, /* ansi */
- {"adv", "/=", DMGL_ANSI}, /* ansi */
- {"truth_andif", "&&", 0}, /* old */
- {"aa", "&&", DMGL_ANSI}, /* ansi */
- {"truth_orif", "||", 0}, /* old */
- {"oo", "||", DMGL_ANSI}, /* ansi */
- {"truth_not", "!", 0}, /* old */
- {"nt", "!", DMGL_ANSI}, /* ansi */
- {"postincrement","++", 0}, /* old */
- {"pp", "++", DMGL_ANSI}, /* ansi */
- {"postdecrement","--", 0}, /* old */
- {"mm", "--", DMGL_ANSI}, /* ansi */
- {"bit_ior", "|", 0}, /* old */
- {"or", "|", DMGL_ANSI}, /* ansi */
- {"aor", "|=", DMGL_ANSI}, /* ansi */
- {"bit_xor", "^", 0}, /* old */
- {"er", "^", DMGL_ANSI}, /* ansi */
- {"aer", "^=", DMGL_ANSI}, /* ansi */
- {"bit_and", "&", 0}, /* old */
- {"ad", "&", DMGL_ANSI}, /* ansi */
- {"aad", "&=", DMGL_ANSI}, /* ansi */
- {"bit_not", "~", 0}, /* old */
- {"co", "~", DMGL_ANSI}, /* ansi */
- {"call", "()", 0}, /* old */
- {"cl", "()", DMGL_ANSI}, /* ansi */
- {"alshift", "<<", 0}, /* old */
- {"ls", "<<", DMGL_ANSI}, /* ansi */
- {"als", "<<=", DMGL_ANSI}, /* ansi */
- {"arshift", ">>", 0}, /* old */
- {"rs", ">>", DMGL_ANSI}, /* ansi */
- {"ars", ">>=", DMGL_ANSI}, /* ansi */
- {"component", "->", 0}, /* old */
- {"pt", "->", DMGL_ANSI}, /* ansi; Lucid C++ form */
- {"rf", "->", DMGL_ANSI}, /* ansi; ARM/GNU form */
- {"indirect", "*", 0}, /* old */
- {"method_call", "->()", 0}, /* old */
- {"addr", "&", 0}, /* old (unary &) */
- {"array", "[]", 0}, /* old */
- {"vc", "[]", DMGL_ANSI}, /* ansi */
- {"compound", ", ", 0}, /* old */
- {"cm", ", ", DMGL_ANSI}, /* ansi */
- {"cond", "?:", 0}, /* old */
- {"cn", "?:", DMGL_ANSI}, /* pseudo-ansi */
- {"max", ">?", 0}, /* old */
- {"mx", ">?", DMGL_ANSI}, /* pseudo-ansi */
- {"min", "<?", 0}, /* old */
- {"mn", "<?", DMGL_ANSI}, /* pseudo-ansi */
- {"nop", "", 0}, /* old (for operator=) */
- {"rm", "->*", DMGL_ANSI}, /* ansi */
- {"sz", "sizeof ", DMGL_ANSI} /* pseudo-ansi */
-};
-
-/* These values are used to indicate the various type varieties.
- They are all non-zero so that they can be used as `success'
- values. */
-typedef enum type_kind_t
-{
- tk_none,
- tk_pointer,
- tk_reference,
- tk_integral,
- tk_bool,
- tk_char,
- tk_real
-} type_kind_t;
-
-#define STRING_EMPTY(str) ((str) -> b == (str) -> p)
-#define PREPEND_BLANK(str) {if (!STRING_EMPTY(str)) \
- string_prepend(str, " ");}
-#define APPEND_BLANK(str) {if (!STRING_EMPTY(str)) \
- string_append(str, " ");}
-#define LEN_STRING(str) ( (STRING_EMPTY(str))?0:((str)->p - (str)->b))
-
-/* The scope separator appropriate for the language being demangled. */
-
-#define SCOPE_STRING(work) ((work->options & DMGL_JAVA) ? "." : "::")
-
-#define ARM_VTABLE_STRING "__vtbl__" /* Lucid/ARM virtual table prefix */
-#define ARM_VTABLE_STRLEN 8 /* strlen (ARM_VTABLE_STRING) */
-
-/* Prototypes for local functions */
-
-static char *
-mop_up PARAMS ((struct work_stuff *, string *, int));
-
-static void
-squangle_mop_up PARAMS ((struct work_stuff *));
-
-#if 0
-static int
-demangle_method_args PARAMS ((struct work_stuff *, const char **, string *));
-#endif
-
-static char *
-internal_cplus_demangle PARAMS ((struct work_stuff *, const char *));
-
-static int
-demangle_template_template_parm PARAMS ((struct work_stuff *work,
- const char **, string *));
-
-static int
-demangle_template PARAMS ((struct work_stuff *work, const char **, string *,
- string *, int, int));
-
-static int
-arm_pt PARAMS ((struct work_stuff *, const char *, int, const char **,
- const char **));
-
-static int
-demangle_class_name PARAMS ((struct work_stuff *, const char **, string *));
-
-static int
-demangle_qualified PARAMS ((struct work_stuff *, const char **, string *,
- int, int));
-
-static int
-demangle_class PARAMS ((struct work_stuff *, const char **, string *));
-
-static int
-demangle_fund_type PARAMS ((struct work_stuff *, const char **, string *));
-
-static int
-demangle_signature PARAMS ((struct work_stuff *, const char **, string *));
-
-static int
-demangle_prefix PARAMS ((struct work_stuff *, const char **, string *));
-
-static int
-gnu_special PARAMS ((struct work_stuff *, const char **, string *));
-
-static int
-arm_special PARAMS ((const char **, string *));
-
-static void
-string_need PARAMS ((string *, int));
-
-static void
-string_delete PARAMS ((string *));
-
-static void
-string_init PARAMS ((string *));
-
-static void
-string_clear PARAMS ((string *));
-
-#if 0
-static int
-string_empty PARAMS ((string *));
-#endif
-
-static void
-string_append PARAMS ((string *, const char *));
-
-static void
-string_appends PARAMS ((string *, string *));
-
-static void
-string_appendn PARAMS ((string *, const char *, int));
-
-static void
-string_prepend PARAMS ((string *, const char *));
-
-static void
-string_prependn PARAMS ((string *, const char *, int));
-
-static int
-get_count PARAMS ((const char **, int *));
-
-static int
-consume_count PARAMS ((const char **));
-
-static int
-consume_count_with_underscores PARAMS ((const char**));
-
-static int
-demangle_args PARAMS ((struct work_stuff *, const char **, string *));
-
-static int
-demangle_nested_args PARAMS ((struct work_stuff*, const char**, string*));
-
-static int
-do_type PARAMS ((struct work_stuff *, const char **, string *));
-
-static int
-do_arg PARAMS ((struct work_stuff *, const char **, string *));
-
-static void
-demangle_function_name PARAMS ((struct work_stuff *, const char **, string *,
- const char *));
-
-static void
-remember_type PARAMS ((struct work_stuff *, const char *, int));
-
-static void
-remember_Btype PARAMS ((struct work_stuff *, const char *, int, int));
-
-static int
-register_Btype PARAMS ((struct work_stuff *));
-
-static void
-remember_Ktype PARAMS ((struct work_stuff *, const char *, int));
-
-static void
-forget_types PARAMS ((struct work_stuff *));
-
-static void
-forget_B_and_K_types PARAMS ((struct work_stuff *));
-
-static void
-string_prepends PARAMS ((string *, string *));
-
-static int
-demangle_template_value_parm PARAMS ((struct work_stuff*, const char**,
- string*, type_kind_t));
-
-static int
-do_hpacc_template_const_value PARAMS ((struct work_stuff *, const char **, string *));
-
-static int
-do_hpacc_template_literal PARAMS ((struct work_stuff *, const char **, string *));
-
-static int
-snarf_numeric_literal PARAMS ((const char **, string *));
-
-/* There is a TYPE_QUAL value for each type qualifier. They can be
- combined by bitwise-or to form the complete set of qualifiers for a
- type. */
-
-#define TYPE_UNQUALIFIED 0x0
-#define TYPE_QUAL_CONST 0x1
-#define TYPE_QUAL_VOLATILE 0x2
-#define TYPE_QUAL_RESTRICT 0x4
-
-static int
-code_for_qualifier PARAMS ((int));
-
-static const char*
-qualifier_string PARAMS ((int));
-
-static const char*
-demangle_qualifier PARAMS ((int));
-
-/* Translate count to integer, consuming tokens in the process.
- Conversion terminates on the first non-digit character.
-
- Trying to consume something that isn't a count results in no
- consumption of input and a return of -1.
-
- Overflow consumes the rest of the digits, and returns -1. */
-
-static int
-consume_count (type)
- const char **type;
-{
- int count = 0;
-
- if (! isdigit ((unsigned char)**type))
- return -1;
-
- while (isdigit ((unsigned char)**type))
- {
- count *= 10;
-
- /* Check for overflow.
- We assume that count is represented using two's-complement;
- no power of two is divisible by ten, so if an overflow occurs
- when multiplying by ten, the result will not be a multiple of
- ten. */
- if ((count % 10) != 0)
- {
- while (isdigit ((unsigned char) **type))
- (*type)++;
- return -1;
- }
-
- count += **type - '0';
- (*type)++;
- }
-
- return (count);
-}
-
-
-/* Like consume_count, but for counts that are preceded and followed
- by '_' if they are greater than 10. Also, -1 is returned for
- failure, since 0 can be a valid value. */
-
-static int
-consume_count_with_underscores (mangled)
- const char **mangled;
-{
- int idx;
-
- if (**mangled == '_')
- {
- (*mangled)++;
- if (!isdigit ((unsigned char)**mangled))
- return -1;
-
- idx = consume_count (mangled);
- if (**mangled != '_')
- /* The trailing underscore was missing. */
- return -1;
-
- (*mangled)++;
- }
- else
- {
- if (**mangled < '0' || **mangled > '9')
- return -1;
-
- idx = **mangled - '0';
- (*mangled)++;
- }
-
- return idx;
-}
-
-/* C is the code for a type-qualifier. Return the TYPE_QUAL
- corresponding to this qualifier. */
-
-static int
-code_for_qualifier (c)
- int c;
-{
- switch (c)
- {
- case 'C':
- return TYPE_QUAL_CONST;
-
- case 'V':
- return TYPE_QUAL_VOLATILE;
-
- case 'u':
- return TYPE_QUAL_RESTRICT;
-
- default:
- break;
- }
-
- /* C was an invalid qualifier. */
- abort ();
-}
-
-/* Return the string corresponding to the qualifiers given by
- TYPE_QUALS. */
-
-static const char*
-qualifier_string (type_quals)
- int type_quals;
-{
- switch (type_quals)
- {
- case TYPE_UNQUALIFIED:
- return "";
-
- case TYPE_QUAL_CONST:
- return "const";
-
- case TYPE_QUAL_VOLATILE:
- return "volatile";
-
- case TYPE_QUAL_RESTRICT:
- return "__restrict";
-
- case TYPE_QUAL_CONST | TYPE_QUAL_VOLATILE:
- return "const volatile";
-
- case TYPE_QUAL_CONST | TYPE_QUAL_RESTRICT:
- return "const __restrict";
-
- case TYPE_QUAL_VOLATILE | TYPE_QUAL_RESTRICT:
- return "volatile __restrict";
-
- case TYPE_QUAL_CONST | TYPE_QUAL_VOLATILE | TYPE_QUAL_RESTRICT:
- return "const volatile __restrict";
-
- default:
- break;
- }
-
- /* TYPE_QUALS was an invalid qualifier set. */
- abort ();
-}
-
-/* C is the code for a type-qualifier. Return the string
- corresponding to this qualifier. This function should only be
- called with a valid qualifier code. */
-
-static const char*
-demangle_qualifier (c)
- int c;
-{
- return qualifier_string (code_for_qualifier (c));
-}
-
-int
-cplus_demangle_opname (opname, result, options)
- const char *opname;
- char *result;
- int options;
-{
- int len, len1, ret;
- string type;
- struct work_stuff work[1];
- const char *tem;
-
- len = strlen(opname);
- result[0] = '\0';
- ret = 0;
- memset ((char *) work, 0, sizeof (work));
- work->options = options;
-
- if (opname[0] == '_' && opname[1] == '_'
- && opname[2] == 'o' && opname[3] == 'p')
- {
- /* ANSI. */
- /* type conversion operator. */
- tem = opname + 4;
- if (do_type (work, &tem, &type))
- {
- strcat (result, "operator ");
- strncat (result, type.b, type.p - type.b);
- string_delete (&type);
- ret = 1;
- }
- }
- else if (opname[0] == '_' && opname[1] == '_'
- && opname[2] >= 'a' && opname[2] <= 'z'
- && opname[3] >= 'a' && opname[3] <= 'z')
- {
- if (opname[4] == '\0')
- {
- /* Operator. */
- size_t i;
- for (i = 0; i < sizeof (optable) / sizeof (optable[0]); i++)
- {
- if (strlen (optable[i].in) == 2
- && memcmp (optable[i].in, opname + 2, 2) == 0)
- {
- strcat (result, "operator");
- strcat (result, optable[i].out);
- ret = 1;
- break;
- }
- }
- }
- else
- {
- if (opname[2] == 'a' && opname[5] == '\0')
- {
- /* Assignment. */
- size_t i;
- for (i = 0; i < sizeof (optable) / sizeof (optable[0]); i++)
- {
- if (strlen (optable[i].in) == 3
- && memcmp (optable[i].in, opname + 2, 3) == 0)
- {
- strcat (result, "operator");
- strcat (result, optable[i].out);
- ret = 1;
- break;
- }
- }
- }
- }
- }
- else if (len >= 3
- && opname[0] == 'o'
- && opname[1] == 'p'
- && strchr (cplus_markers, opname[2]) != NULL)
- {
- /* see if it's an assignment expression */
- if (len >= 10 /* op$assign_ */
- && memcmp (opname + 3, "assign_", 7) == 0)
- {
- size_t i;
- for (i = 0; i < sizeof (optable) / sizeof (optable[0]); i++)
- {
- len1 = len - 10;
- if ((int) strlen (optable[i].in) == len1
- && memcmp (optable[i].in, opname + 10, len1) == 0)
- {
- strcat (result, "operator");
- strcat (result, optable[i].out);
- strcat (result, "=");
- ret = 1;
- break;
- }
- }
- }
- else
- {
- size_t i;
- for (i = 0; i < sizeof (optable) / sizeof (optable[0]); i++)
- {
- len1 = len - 3;
- if ((int) strlen (optable[i].in) == len1
- && memcmp (optable[i].in, opname + 3, len1) == 0)
- {
- strcat (result, "operator");
- strcat (result, optable[i].out);
- ret = 1;
- break;
- }
- }
- }
- }
- else if (len >= 5 && memcmp (opname, "type", 4) == 0
- && strchr (cplus_markers, opname[4]) != NULL)
- {
- /* type conversion operator */
- tem = opname + 5;
- if (do_type (work, &tem, &type))
- {
- strcat (result, "operator ");
- strncat (result, type.b, type.p - type.b);
- string_delete (&type);
- ret = 1;
- }
- }
- squangle_mop_up (work);
- return ret;
-
-}
-/* Takes operator name as e.g. "++" and returns mangled
- operator name (e.g. "postincrement_expr"), or NULL if not found.
-
- If OPTIONS & DMGL_ANSI == 1, return the ANSI name;
- if OPTIONS & DMGL_ANSI == 0, return the old GNU name. */
-
-const char *
-cplus_mangle_opname (opname, options)
- const char *opname;
- int options;
-{
- size_t i;
- int len;
-
- len = strlen (opname);
- for (i = 0; i < sizeof (optable) / sizeof (optable[0]); i++)
- {
- if ((int) strlen (optable[i].out) == len
- && (options & DMGL_ANSI) == (optable[i].flags & DMGL_ANSI)
- && memcmp (optable[i].out, opname, len) == 0)
- return optable[i].in;
- }
- return (0);
-}
-
-/* char *cplus_demangle (const char *mangled, int options)
-
- If MANGLED is a mangled function name produced by GNU C++, then
- a pointer to a malloced string giving a C++ representation
- of the name will be returned; otherwise NULL will be returned.
- It is the caller's responsibility to free the string which
- is returned.
-
- The OPTIONS arg may contain one or more of the following bits:
-
- DMGL_ANSI ANSI qualifiers such as `const' and `void' are
- included.
- DMGL_PARAMS Function parameters are included.
-
- For example,
-
- cplus_demangle ("foo__1Ai", DMGL_PARAMS) => "A::foo(int)"
- cplus_demangle ("foo__1Ai", DMGL_PARAMS | DMGL_ANSI) => "A::foo(int)"
- cplus_demangle ("foo__1Ai", 0) => "A::foo"
-
- cplus_demangle ("foo__1Afe", DMGL_PARAMS) => "A::foo(float,...)"
- cplus_demangle ("foo__1Afe", DMGL_PARAMS | DMGL_ANSI)=> "A::foo(float,...)"
- cplus_demangle ("foo__1Afe", 0) => "A::foo"
-
- Note that any leading underscores, or other such characters prepended by
- the compilation system, are presumed to have already been stripped from
- MANGLED. */
-
-char *
-cplus_demangle (mangled, options)
- const char *mangled;
- int options;
-{
- char *ret;
- struct work_stuff work[1];
- memset ((char *) work, 0, sizeof (work));
- work -> options = options;
- if ((work -> options & DMGL_STYLE_MASK) == 0)
- work -> options |= (int) current_demangling_style & DMGL_STYLE_MASK;
-
- ret = internal_cplus_demangle (work, mangled);
- squangle_mop_up (work);
- return (ret);
-}
-
-
-/* This function performs most of what cplus_demangle use to do, but
- to be able to demangle a name with a B, K or n code, we need to
- have a longer term memory of what types have been seen. The original
- now intializes and cleans up the squangle code info, while internal
- calls go directly to this routine to avoid resetting that info. */
-
-static char *
-internal_cplus_demangle (work, mangled)
- struct work_stuff *work;
- const char *mangled;
-{
-
- string decl;
- int success = 0;
- char *demangled = NULL;
- int s1,s2,s3,s4;
- s1 = work->constructor;
- s2 = work->destructor;
- s3 = work->static_type;
- s4 = work->type_quals;
- work->constructor = work->destructor = 0;
- work->type_quals = TYPE_UNQUALIFIED;
- work->dllimported = 0;
-
- if ((mangled != NULL) && (*mangled != '\0'))
- {
- string_init (&decl);
-
- /* First check to see if gnu style demangling is active and if the
- string to be demangled contains a CPLUS_MARKER. If so, attempt to
- recognize one of the gnu special forms rather than looking for a
- standard prefix. In particular, don't worry about whether there
- is a "__" string in the mangled string. Consider "_$_5__foo" for
- example. */
-
- if ((AUTO_DEMANGLING || GNU_DEMANGLING))
- {
- success = gnu_special (work, &mangled, &decl);
- }
- if (!success)
- {
- success = demangle_prefix (work, &mangled, &decl);
- }
- if (success && (*mangled != '\0'))
- {
- success = demangle_signature (work, &mangled, &decl);
- }
- if (work->constructor == 2)
- {
- string_prepend (&decl, "global constructors keyed to ");
- work->constructor = 0;
- }
- else if (work->destructor == 2)
- {
- string_prepend (&decl, "global destructors keyed to ");
- work->destructor = 0;
- }
- else if (work->dllimported == 1)
- {
- string_prepend (&decl, "import stub for ");
- work->dllimported = 0;
- }
- demangled = mop_up (work, &decl, success);
- }
- work->constructor = s1;
- work->destructor = s2;
- work->static_type = s3;
- work->type_quals = s4;
- return (demangled);
-}
-
-
-/* Clear out and squangling related storage */
-static void
-squangle_mop_up (work)
- struct work_stuff *work;
-{
- /* clean up the B and K type mangling types. */
- forget_B_and_K_types (work);
- if (work -> btypevec != NULL)
- {
- free ((char *) work -> btypevec);
- }
- if (work -> ktypevec != NULL)
- {
- free ((char *) work -> ktypevec);
- }
-}
-
-/* Clear out any mangled storage */
-
-static char *
-mop_up (work, declp, success)
- struct work_stuff *work;
- string *declp;
- int success;
-{
- char *demangled = NULL;
-
- /* Discard the remembered types, if any. */
-
- forget_types (work);
- if (work -> typevec != NULL)
- {
- free ((char *) work -> typevec);
- work -> typevec = NULL;
- work -> typevec_size = 0;
- }
- if (work->tmpl_argvec)
- {
- int i;
-
- for (i = 0; i < work->ntmpl_args; i++)
- if (work->tmpl_argvec[i])
- free ((char*) work->tmpl_argvec[i]);
-
- free ((char*) work->tmpl_argvec);
- work->tmpl_argvec = NULL;
- }
- if (work->previous_argument)
- {
- string_delete (work->previous_argument);
- free ((char*) work->previous_argument);
- work->previous_argument = NULL;
- }
-
- /* If demangling was successful, ensure that the demangled string is null
- terminated and return it. Otherwise, free the demangling decl. */
-
- if (!success)
- {
- string_delete (declp);
- }
- else
- {
- string_appendn (declp, "", 1);
- demangled = declp -> b;
- }
- return (demangled);
-}
-
-/*
-
-LOCAL FUNCTION
-
- demangle_signature -- demangle the signature part of a mangled name
-
-SYNOPSIS
-
- static int
- demangle_signature (struct work_stuff *work, const char **mangled,
- string *declp);
-
-DESCRIPTION
-
- Consume and demangle the signature portion of the mangled name.
-
- DECLP is the string where demangled output is being built. At
- entry it contains the demangled root name from the mangled name
- prefix. I.E. either a demangled operator name or the root function
- name. In some special cases, it may contain nothing.
-
- *MANGLED points to the current unconsumed location in the mangled
- name. As tokens are consumed and demangling is performed, the
- pointer is updated to continuously point at the next token to
- be consumed.
-
- Demangling GNU style mangled names is nasty because there is no
- explicit token that marks the start of the outermost function
- argument list. */
-
-static int
-demangle_signature (work, mangled, declp)
- struct work_stuff *work;
- const char **mangled;
- string *declp;
-{
- int success = 1;
- int func_done = 0;
- int expect_func = 0;
- int expect_return_type = 0;
- const char *oldmangled = NULL;
- string trawname;
- string tname;
-
- while (success && (**mangled != '\0'))
- {
- switch (**mangled)
- {
- case 'Q':
- oldmangled = *mangled;
- success = demangle_qualified (work, mangled, declp, 1, 0);
- if (success)
- remember_type (work, oldmangled, *mangled - oldmangled);
- if (AUTO_DEMANGLING || GNU_DEMANGLING)
- expect_func = 1;
- oldmangled = NULL;
- break;
-
- case 'K':
- oldmangled = *mangled;
- success = demangle_qualified (work, mangled, declp, 1, 0);
- if (AUTO_DEMANGLING || GNU_DEMANGLING)
- {
- expect_func = 1;
- }
- oldmangled = NULL;
- break;
-
- case 'S':
- /* Static member function */
- if (oldmangled == NULL)
- {
- oldmangled = *mangled;
- }
- (*mangled)++;
- work -> static_type = 1;
- break;
-
- case 'C':
- case 'V':
- case 'u':
- work->type_quals |= code_for_qualifier (**mangled);
-
- /* a qualified member function */
- if (oldmangled == NULL)
- oldmangled = *mangled;
- (*mangled)++;
- break;
-
- case 'L':
- /* Local class name follows after "Lnnn_" */
- if (HP_DEMANGLING)
- {
- while (**mangled && (**mangled != '_'))
- (*mangled)++;
- if (!**mangled)
- success = 0;
- else
- (*mangled)++;
- }
- else
- success = 0;
- break;
-
- case '0': case '1': case '2': case '3': case '4':
- case '5': case '6': case '7': case '8': case '9':
- if (oldmangled == NULL)
- {
- oldmangled = *mangled;
- }
- work->temp_start = -1; /* uppermost call to demangle_class */
- success = demangle_class (work, mangled, declp);
- if (success)
- {
- remember_type (work, oldmangled, *mangled - oldmangled);
- }
- if (AUTO_DEMANGLING || GNU_DEMANGLING || EDG_DEMANGLING)
- {
- /* EDG and others will have the "F", so we let the loop cycle
- if we are looking at one. */
- if (**mangled != 'F')
- expect_func = 1;
- }
- oldmangled = NULL;
- break;
-
- case 'B':
- {
- string s;
- success = do_type (work, mangled, &s);
- if (success)
- {
- string_append (&s, SCOPE_STRING (work));
- string_prepends (declp, &s);
- }
- oldmangled = NULL;
- expect_func = 1;
- }
- break;
-
- case 'F':
- /* Function */
- /* ARM/HP style demangling includes a specific 'F' character after
- the class name. For GNU style, it is just implied. So we can
- safely just consume any 'F' at this point and be compatible
- with either style. */
-
- oldmangled = NULL;
- func_done = 1;
- (*mangled)++;
-
- /* For lucid/ARM/HP style we have to forget any types we might
- have remembered up to this point, since they were not argument
- types. GNU style considers all types seen as available for
- back references. See comment in demangle_args() */
-
- if (LUCID_DEMANGLING || ARM_DEMANGLING || HP_DEMANGLING || EDG_DEMANGLING)
- {
- forget_types (work);
- }
- success = demangle_args (work, mangled, declp);
- /* After picking off the function args, we expect to either
- find the function return type (preceded by an '_') or the
- end of the string. */
- if (success && (AUTO_DEMANGLING || EDG_DEMANGLING) && **mangled == '_')
- {
- ++(*mangled);
- /* At this level, we do not care about the return type. */
- success = do_type (work, mangled, &tname);
- string_delete (&tname);
- }
-
- break;
-
- case 't':
- /* G++ Template */
- string_init(&trawname);
- string_init(&tname);
- if (oldmangled == NULL)
- {
- oldmangled = *mangled;
- }
- success = demangle_template (work, mangled, &tname,
- &trawname, 1, 1);
- if (success)
- {
- remember_type (work, oldmangled, *mangled - oldmangled);
- }
- string_append (&tname, SCOPE_STRING (work));
-
- string_prepends(declp, &tname);
- if (work -> destructor & 1)
- {
- string_prepend (&trawname, "~");
- string_appends (declp, &trawname);
- work->destructor -= 1;
- }
- if ((work->constructor & 1) || (work->destructor & 1))
- {
- string_appends (declp, &trawname);
- work->constructor -= 1;
- }
- string_delete(&trawname);
- string_delete(&tname);
- oldmangled = NULL;
- expect_func = 1;
- break;
-
- case '_':
- if (GNU_DEMANGLING && expect_return_type)
- {
- /* Read the return type. */
- string return_type;
- string_init (&return_type);
-
- (*mangled)++;
- success = do_type (work, mangled, &return_type);
- APPEND_BLANK (&return_type);
-
- string_prepends (declp, &return_type);
- string_delete (&return_type);
- break;
- }
- else
- /* At the outermost level, we cannot have a return type specified,
- so if we run into another '_' at this point we are dealing with
- a mangled name that is either bogus, or has been mangled by
- some algorithm we don't know how to deal with. So just
- reject the entire demangling. */
- /* However, "_nnn" is an expected suffix for alternate entry point
- numbered nnn for a function, with HP aCC, so skip over that
- without reporting failure. pai/1997-09-04 */
- if (HP_DEMANGLING)
- {
- (*mangled)++;
- while (**mangled && isdigit ((unsigned char)**mangled))
- (*mangled)++;
- }
- else
- success = 0;
- break;
-
- case 'H':
- if (GNU_DEMANGLING)
- {
- /* A G++ template function. Read the template arguments. */
- success = demangle_template (work, mangled, declp, 0, 0,
- 0);
- if (!(work->constructor & 1))
- expect_return_type = 1;
- (*mangled)++;
- break;
- }
- else
- /* fall through */
- {;}
-
- default:
- if (AUTO_DEMANGLING || GNU_DEMANGLING)
- {
- /* Assume we have stumbled onto the first outermost function
- argument token, and start processing args. */
- func_done = 1;
- success = demangle_args (work, mangled, declp);
- }
- else
- {
- /* Non-GNU demanglers use a specific token to mark the start
- of the outermost function argument tokens. Typically 'F',
- for ARM/HP-demangling, for example. So if we find something
- we are not prepared for, it must be an error. */
- success = 0;
- }
- break;
- }
- /*
- if (AUTO_DEMANGLING || GNU_DEMANGLING)
- */
- {
- if (success && expect_func)
- {
- func_done = 1;
- if (LUCID_DEMANGLING || ARM_DEMANGLING || EDG_DEMANGLING)
- {
- forget_types (work);
- }
- success = demangle_args (work, mangled, declp);
- /* Since template include the mangling of their return types,
- we must set expect_func to 0 so that we don't try do
- demangle more arguments the next time we get here. */
- expect_func = 0;
- }
- }
- }
- if (success && !func_done)
- {
- if (AUTO_DEMANGLING || GNU_DEMANGLING)
- {
- /* With GNU style demangling, bar__3foo is 'foo::bar(void)', and
- bar__3fooi is 'foo::bar(int)'. We get here when we find the
- first case, and need to ensure that the '(void)' gets added to
- the current declp. Note that with ARM/HP, the first case
- represents the name of a static data member 'foo::bar',
- which is in the current declp, so we leave it alone. */
- success = demangle_args (work, mangled, declp);
- }
- }
- if (success && PRINT_ARG_TYPES)
- {
- if (work->static_type)
- string_append (declp, " static");
- if (work->type_quals != TYPE_UNQUALIFIED)
- {
- APPEND_BLANK (declp);
- string_append (declp, qualifier_string (work->type_quals));
- }
- }
-
- return (success);
-}
-
-#if 0
-
-static int
-demangle_method_args (work, mangled, declp)
- struct work_stuff *work;
- const char **mangled;
- string *declp;
-{
- int success = 0;
-
- if (work -> static_type)
- {
- string_append (declp, *mangled + 1);
- *mangled += strlen (*mangled);
- success = 1;
- }
- else
- {
- success = demangle_args (work, mangled, declp);
- }
- return (success);
-}
-
-#endif
-
-static int
-demangle_template_template_parm (work, mangled, tname)
- struct work_stuff *work;
- const char **mangled;
- string *tname;
-{
- int i;
- int r;
- int need_comma = 0;
- int success = 1;
- string temp;
-
- string_append (tname, "template <");
- /* get size of template parameter list */
- if (get_count (mangled, &r))
- {
- for (i = 0; i < r; i++)
- {
- if (need_comma)
- {
- string_append (tname, ", ");
- }
-
- /* Z for type parameters */
- if (**mangled == 'Z')
- {
- (*mangled)++;
- string_append (tname, "class");
- }
- /* z for template parameters */
- else if (**mangled == 'z')
- {
- (*mangled)++;
- success =
- demangle_template_template_parm (work, mangled, tname);
- if (!success)
- {
- break;
- }
- }
- else
- {
- /* temp is initialized in do_type */
- success = do_type (work, mangled, &temp);
- if (success)
- {
- string_appends (tname, &temp);
- }
- string_delete(&temp);
- if (!success)
- {
- break;
- }
- }
- need_comma = 1;
- }
-
- }
- if (tname->p[-1] == '>')
- string_append (tname, " ");
- string_append (tname, "> class");
- return (success);
-}
-
-static int
-demangle_integral_value (work, mangled, s)
- struct work_stuff *work;
- const char** mangled;
- string* s;
-{
- int success;
-
- if (**mangled == 'E')
- {
- int need_operator = 0;
-
- success = 1;
- string_appendn (s, "(", 1);
- (*mangled)++;
- while (success && **mangled != 'W' && **mangled != '\0')
- {
- if (need_operator)
- {
- size_t i;
- size_t len;
-
- success = 0;
-
- len = strlen (*mangled);
-
- for (i = 0;
- i < sizeof (optable) / sizeof (optable [0]);
- ++i)
- {
- size_t l = strlen (optable[i].in);
-
- if (l <= len
- && memcmp (optable[i].in, *mangled, l) == 0)
- {
- string_appendn (s, " ", 1);
- string_append (s, optable[i].out);
- string_appendn (s, " ", 1);
- success = 1;
- (*mangled) += l;
- break;
- }
- }
-
- if (!success)
- break;
- }
- else
- need_operator = 1;
-
- success = demangle_template_value_parm (work, mangled, s,
- tk_integral);
- }
-
- if (**mangled != 'W')
- success = 0;
- else
- {
- string_appendn (s, ")", 1);
- (*mangled)++;
- }
- }
- else if (**mangled == 'Q' || **mangled == 'K')
- success = demangle_qualified (work, mangled, s, 0, 1);
- else
- {
- success = 0;
-
- if (**mangled == 'm')
- {
- string_appendn (s, "-", 1);
- (*mangled)++;
- }
- while (isdigit ((unsigned char)**mangled))
- {
- string_appendn (s, *mangled, 1);
- (*mangled)++;
- success = 1;
- }
- }
-
- return success;
-}
-
-static int
-demangle_template_value_parm (work, mangled, s, tk)
- struct work_stuff *work;
- const char **mangled;
- string* s;
- type_kind_t tk;
-{
- int success = 1;
-
- if (**mangled == 'Y')
- {
- /* The next argument is a template parameter. */
- int idx;
-
- (*mangled)++;
- idx = consume_count_with_underscores (mangled);
- if (idx == -1
- || (work->tmpl_argvec && idx >= work->ntmpl_args)
- || consume_count_with_underscores (mangled) == -1)
- return -1;
- if (work->tmpl_argvec)
- string_append (s, work->tmpl_argvec[idx]);
- else
- {
- char buf[10];
- sprintf(buf, "T%d", idx);
- string_append (s, buf);
- }
- }
- else if (tk == tk_integral)
- success = demangle_integral_value (work, mangled, s);
- else if (tk == tk_char)
- {
- char tmp[2];
- int val;
- if (**mangled == 'm')
- {
- string_appendn (s, "-", 1);
- (*mangled)++;
- }
- string_appendn (s, "'", 1);
- val = consume_count(mangled);
- if (val <= 0)
- success = 0;
- else
- {
- tmp[0] = (char)val;
- tmp[1] = '\0';
- string_appendn (s, &tmp[0], 1);
- string_appendn (s, "'", 1);
- }
- }
- else if (tk == tk_bool)
- {
- int val = consume_count (mangled);
- if (val == 0)
- string_appendn (s, "false", 5);
- else if (val == 1)
- string_appendn (s, "true", 4);
- else
- success = 0;
- }
- else if (tk == tk_real)
- {
- if (**mangled == 'm')
- {
- string_appendn (s, "-", 1);
- (*mangled)++;
- }
- while (isdigit ((unsigned char)**mangled))
- {
- string_appendn (s, *mangled, 1);
- (*mangled)++;
- }
- if (**mangled == '.') /* fraction */
- {
- string_appendn (s, ".", 1);
- (*mangled)++;
- while (isdigit ((unsigned char)**mangled))
- {
- string_appendn (s, *mangled, 1);
- (*mangled)++;
- }
- }
- if (**mangled == 'e') /* exponent */
- {
- string_appendn (s, "e", 1);
- (*mangled)++;
- while (isdigit ((unsigned char)**mangled))
- {
- string_appendn (s, *mangled, 1);
- (*mangled)++;
- }
- }
- }
- else if (tk == tk_pointer || tk == tk_reference)
- {
- if (**mangled == 'Q')
- success = demangle_qualified (work, mangled, s,
- /*isfuncname=*/0,
- /*append=*/1);
- else
- {
- int symbol_len = consume_count (mangled);
- if (symbol_len == -1)
- return -1;
- if (symbol_len == 0)
- string_appendn (s, "0", 1);
- else
- {
- char *p = xmalloc (symbol_len + 1), *q;
- strncpy (p, *mangled, symbol_len);
- p [symbol_len] = '\0';
- /* We use cplus_demangle here, rather than
- internal_cplus_demangle, because the name of the entity
- mangled here does not make use of any of the squangling
- or type-code information we have built up thus far; it is
- mangled independently. */
- q = cplus_demangle (p, work->options);
- if (tk == tk_pointer)
- string_appendn (s, "&", 1);
- /* FIXME: Pointer-to-member constants should get a
- qualifying class name here. */
- if (q)
- {
- string_append (s, q);
- free (q);
- }
- else
- string_append (s, p);
- free (p);
- }
- *mangled += symbol_len;
- }
- }
-
- return success;
-}
-
-/* Demangle the template name in MANGLED. The full name of the
- template (e.g., S<int>) is placed in TNAME. The name without the
- template parameters (e.g. S) is placed in TRAWNAME if TRAWNAME is
- non-NULL. If IS_TYPE is nonzero, this template is a type template,
- not a function template. If both IS_TYPE and REMEMBER are nonzero,
- the tmeplate is remembered in the list of back-referenceable
- types. */
-
-static int
-demangle_template (work, mangled, tname, trawname, is_type, remember)
- struct work_stuff *work;
- const char **mangled;
- string *tname;
- string *trawname;
- int is_type;
- int remember;
-{
- int i;
- int r;
- int need_comma = 0;
- int success = 0;
- const char *start;
- int is_java_array = 0;
- string temp;
- int bindex = 0;
-
- (*mangled)++;
- if (is_type)
- {
- if (remember)
- bindex = register_Btype (work);
- start = *mangled;
- /* get template name */
- if (**mangled == 'z')
- {
- int idx;
- (*mangled)++;
- (*mangled)++;
-
- idx = consume_count_with_underscores (mangled);
- if (idx == -1
- || (work->tmpl_argvec && idx >= work->ntmpl_args)
- || consume_count_with_underscores (mangled) == -1)
- return (0);
-
- if (work->tmpl_argvec)
- {
- string_append (tname, work->tmpl_argvec[idx]);
- if (trawname)
- string_append (trawname, work->tmpl_argvec[idx]);
- }
- else
- {
- char buf[10];
- sprintf(buf, "T%d", idx);
- string_append (tname, buf);
- if (trawname)
- string_append (trawname, buf);
- }
- }
- else
- {
- if ((r = consume_count (mangled)) <= 0
- || (int) strlen (*mangled) < r)
- {
- return (0);
- }
- is_java_array = (work -> options & DMGL_JAVA)
- && strncmp (*mangled, "JArray1Z", 8) == 0;
- if (! is_java_array)
- {
- string_appendn (tname, *mangled, r);
- }
- if (trawname)
- string_appendn (trawname, *mangled, r);
- *mangled += r;
- }
- }
- if (!is_java_array)
- string_append (tname, "<");
- /* get size of template parameter list */
- if (!get_count (mangled, &r))
- {
- return (0);
- }
- if (!is_type)
- {
- /* Create an array for saving the template argument values. */
- work->tmpl_argvec = (char**) xmalloc (r * sizeof (char *));
- work->ntmpl_args = r;
- for (i = 0; i < r; i++)
- work->tmpl_argvec[i] = 0;
- }
- for (i = 0; i < r; i++)
- {
- if (need_comma)
- {
- string_append (tname, ", ");
- }
- /* Z for type parameters */
- if (**mangled == 'Z')
- {
- (*mangled)++;
- /* temp is initialized in do_type */
- success = do_type (work, mangled, &temp);
- if (success)
- {
- string_appends (tname, &temp);
-
- if (!is_type)
- {
- /* Save the template argument. */
- int len = temp.p - temp.b;
- work->tmpl_argvec[i] = xmalloc (len + 1);
- memcpy (work->tmpl_argvec[i], temp.b, len);
- work->tmpl_argvec[i][len] = '\0';
- }
- }
- string_delete(&temp);
- if (!success)
- {
- break;
- }
- }
- /* z for template parameters */
- else if (**mangled == 'z')
- {
- int r2;
- (*mangled)++;
- success = demangle_template_template_parm (work, mangled, tname);
-
- if (success
- && (r2 = consume_count (mangled)) > 0
- && (int) strlen (*mangled) >= r2)
- {
- string_append (tname, " ");
- string_appendn (tname, *mangled, r2);
- if (!is_type)
- {
- /* Save the template argument. */
- int len = r2;
- work->tmpl_argvec[i] = xmalloc (len + 1);
- memcpy (work->tmpl_argvec[i], *mangled, len);
- work->tmpl_argvec[i][len] = '\0';
- }
- *mangled += r2;
- }
- if (!success)
- {
- break;
- }
- }
- else
- {
- string param;
- string* s;
-
- /* otherwise, value parameter */
-
- /* temp is initialized in do_type */
- success = do_type (work, mangled, &temp);
- string_delete(&temp);
- if (!success)
- break;
-
- if (!is_type)
- {
- s = &param;
- string_init (s);
- }
- else
- s = tname;
-
- success = demangle_template_value_parm (work, mangled, s,
- (type_kind_t) success);
-
- if (!success)
- {
- if (!is_type)
- string_delete (s);
- success = 0;
- break;
- }
-
- if (!is_type)
- {
- int len = s->p - s->b;
- work->tmpl_argvec[i] = xmalloc (len + 1);
- memcpy (work->tmpl_argvec[i], s->b, len);
- work->tmpl_argvec[i][len] = '\0';
-
- string_appends (tname, s);
- string_delete (s);
- }
- }
- need_comma = 1;
- }
- if (is_java_array)
- {
- string_append (tname, "[]");
- }
- else
- {
- if (tname->p[-1] == '>')
- string_append (tname, " ");
- string_append (tname, ">");
- }
-
- if (is_type && remember)
- remember_Btype (work, tname->b, LEN_STRING (tname), bindex);
-
- /*
- if (work -> static_type)
- {
- string_append (declp, *mangled + 1);
- *mangled += strlen (*mangled);
- success = 1;
- }
- else
- {
- success = demangle_args (work, mangled, declp);
- }
- }
- */
- return (success);
-}
-
-static int
-arm_pt (work, mangled, n, anchor, args)
- struct work_stuff *work;
- const char *mangled;
- int n;
- const char **anchor, **args;
-{
- /* Check if ARM template with "__pt__" in it ("parameterized type") */
- /* Allow HP also here, because HP's cfront compiler follows ARM to some extent */
- if ((ARM_DEMANGLING || HP_DEMANGLING) && (*anchor = mystrstr (mangled, "__pt__")))
- {
- int len;
- *args = *anchor + 6;
- len = consume_count (args);
- if (len == -1)
- return 0;
- if (*args + len == mangled + n && **args == '_')
- {
- ++*args;
- return 1;
- }
- }
- if (AUTO_DEMANGLING || EDG_DEMANGLING)
- {
- if ((*anchor = mystrstr (mangled, "__tm__"))
- || (*anchor = mystrstr (mangled, "__ps__"))
- || (*anchor = mystrstr (mangled, "__pt__")))
- {
- int len;
- *args = *anchor + 6;
- len = consume_count (args);
- if (len == -1)
- return 0;
- if (*args + len == mangled + n && **args == '_')
- {
- ++*args;
- return 1;
- }
- }
- else if ((*anchor = mystrstr (mangled, "__S")))
- {
- int len;
- *args = *anchor + 3;
- len = consume_count (args);
- if (len == -1)
- return 0;
- if (*args + len == mangled + n && **args == '_')
- {
- ++*args;
- return 1;
- }
- }
- }
-
- return 0;
-}
-
-static void
-demangle_arm_hp_template (work, mangled, n, declp)
- struct work_stuff *work;
- const char **mangled;
- int n;
- string *declp;
-{
- const char *p;
- const char *args;
- const char *e = *mangled + n;
- string arg;
-
- /* Check for HP aCC template spec: classXt1t2 where t1, t2 are
- template args */
- if (HP_DEMANGLING && ((*mangled)[n] == 'X'))
- {
- char *start_spec_args = NULL;
-
- /* First check for and omit template specialization pseudo-arguments,
- such as in "Spec<#1,#1.*>" */
- start_spec_args = strchr (*mangled, '<');
- if (start_spec_args && (start_spec_args - *mangled < n))
- string_appendn (declp, *mangled, start_spec_args - *mangled);
- else
- string_appendn (declp, *mangled, n);
- (*mangled) += n + 1;
- string_init (&arg);
- if (work->temp_start == -1) /* non-recursive call */
- work->temp_start = declp->p - declp->b;
- string_append (declp, "<");
- while (1)
- {
- string_clear (&arg);
- switch (**mangled)
- {
- case 'T':
- /* 'T' signals a type parameter */
- (*mangled)++;
- if (!do_type (work, mangled, &arg))
- goto hpacc_template_args_done;
- break;
-
- case 'U':
- case 'S':
- /* 'U' or 'S' signals an integral value */
- if (!do_hpacc_template_const_value (work, mangled, &arg))
- goto hpacc_template_args_done;
- break;
-
- case 'A':
- /* 'A' signals a named constant expression (literal) */
- if (!do_hpacc_template_literal (work, mangled, &arg))
- goto hpacc_template_args_done;
- break;
-
- default:
- /* Today, 1997-09-03, we have only the above types
- of template parameters */
- /* FIXME: maybe this should fail and return null */
- goto hpacc_template_args_done;
- }
- string_appends (declp, &arg);
- /* Check if we're at the end of template args.
- 0 if at end of static member of template class,
- _ if done with template args for a function */
- if ((**mangled == '\000') || (**mangled == '_'))
- break;
- else
- string_append (declp, ",");
- }
- hpacc_template_args_done:
- string_append (declp, ">");
- string_delete (&arg);
- if (**mangled == '_')
- (*mangled)++;
- return;
- }
- /* ARM template? (Also handles HP cfront extensions) */
- else if (arm_pt (work, *mangled, n, &p, &args))
- {
- string type_str;
-
- string_init (&arg);
- string_appendn (declp, *mangled, p - *mangled);
- if (work->temp_start == -1) /* non-recursive call */
- work->temp_start = declp->p - declp->b;
- string_append (declp, "<");
- /* should do error checking here */
- while (args < e) {
- string_clear (&arg);
-
- /* Check for type or literal here */
- switch (*args)
- {
- /* HP cfront extensions to ARM for template args */
- /* spec: Xt1Lv1 where t1 is a type, v1 is a literal value */
- /* FIXME: We handle only numeric literals for HP cfront */
- case 'X':
- /* A typed constant value follows */
- args++;
- if (!do_type (work, &args, &type_str))
- goto cfront_template_args_done;
- string_append (&arg, "(");
- string_appends (&arg, &type_str);
- string_append (&arg, ")");
- if (*args != 'L')
- goto cfront_template_args_done;
- args++;
- /* Now snarf a literal value following 'L' */
- if (!snarf_numeric_literal (&args, &arg))
- goto cfront_template_args_done;
- break;
-
- case 'L':
- /* Snarf a literal following 'L' */
- args++;
- if (!snarf_numeric_literal (&args, &arg))
- goto cfront_template_args_done;
- break;
- default:
- /* Not handling other HP cfront stuff */
- if (!do_type (work, &args, &arg))
- goto cfront_template_args_done;
- }
- string_appends (declp, &arg);
- string_append (declp, ",");
- }
- cfront_template_args_done:
- string_delete (&arg);
- if (args >= e)
- --declp->p; /* remove extra comma */
- string_append (declp, ">");
- }
- else if (n>10 && strncmp (*mangled, "_GLOBAL_", 8) == 0
- && (*mangled)[9] == 'N'
- && (*mangled)[8] == (*mangled)[10]
- && strchr (cplus_markers, (*mangled)[8]))
- {
- /* A member of the anonymous namespace. */
- string_append (declp, "{anonymous}");
- }
- else
- {
- if (work->temp_start == -1) /* non-recursive call only */
- work->temp_start = 0; /* disable in recursive calls */
- string_appendn (declp, *mangled, n);
- }
- *mangled += n;
-}
-
-/* Extract a class name, possibly a template with arguments, from the
- mangled string; qualifiers, local class indicators, etc. have
- already been dealt with */
-
-static int
-demangle_class_name (work, mangled, declp)
- struct work_stuff *work;
- const char **mangled;
- string *declp;
-{
- int n;
- int success = 0;
-
- n = consume_count (mangled);
- if (n == -1)
- return 0;
- if ((int) strlen (*mangled) >= n)
- {
- demangle_arm_hp_template (work, mangled, n, declp);
- success = 1;
- }
-
- return (success);
-}
-
-/*
-
-LOCAL FUNCTION
-
- demangle_class -- demangle a mangled class sequence
-
-SYNOPSIS
-
- static int
- demangle_class (struct work_stuff *work, const char **mangled,
- strint *declp)
-
-DESCRIPTION
-
- DECLP points to the buffer into which demangling is being done.
-
- *MANGLED points to the current token to be demangled. On input,
- it points to a mangled class (I.E. "3foo", "13verylongclass", etc.)
- On exit, it points to the next token after the mangled class on
- success, or the first unconsumed token on failure.
-
- If the CONSTRUCTOR or DESTRUCTOR flags are set in WORK, then
- we are demangling a constructor or destructor. In this case
- we prepend "class::class" or "class::~class" to DECLP.
-
- Otherwise, we prepend "class::" to the current DECLP.
-
- Reset the constructor/destructor flags once they have been
- "consumed". This allows demangle_class to be called later during
- the same demangling, to do normal class demangling.
-
- Returns 1 if demangling is successful, 0 otherwise.
-
-*/
-
-static int
-demangle_class (work, mangled, declp)
- struct work_stuff *work;
- const char **mangled;
- string *declp;
-{
- int success = 0;
- int btype;
- string class_name;
- char *save_class_name_end = 0;
-
- string_init (&class_name);
- btype = register_Btype (work);
- if (demangle_class_name (work, mangled, &class_name))
- {
- save_class_name_end = class_name.p;
- if ((work->constructor & 1) || (work->destructor & 1))
- {
- /* adjust so we don't include template args */
- if (work->temp_start && (work->temp_start != -1))
- {
- class_name.p = class_name.b + work->temp_start;
- }
- string_prepends (declp, &class_name);
- if (work -> destructor & 1)
- {
- string_prepend (declp, "~");
- work -> destructor -= 1;
- }
- else
- {
- work -> constructor -= 1;
- }
- }
- class_name.p = save_class_name_end;
- remember_Ktype (work, class_name.b, LEN_STRING(&class_name));
- remember_Btype (work, class_name.b, LEN_STRING(&class_name), btype);
- string_prepend (declp, SCOPE_STRING (work));
- string_prepends (declp, &class_name);
- success = 1;
- }
- string_delete (&class_name);
- return (success);
-}
-
-/*
-
-LOCAL FUNCTION
-
- demangle_prefix -- consume the mangled name prefix and find signature
-
-SYNOPSIS
-
- static int
- demangle_prefix (struct work_stuff *work, const char **mangled,
- string *declp);
-
-DESCRIPTION
-
- Consume and demangle the prefix of the mangled name.
-
- DECLP points to the string buffer into which demangled output is
- placed. On entry, the buffer is empty. On exit it contains
- the root function name, the demangled operator name, or in some
- special cases either nothing or the completely demangled result.
-
- MANGLED points to the current pointer into the mangled name. As each
- token of the mangled name is consumed, it is updated. Upon entry
- the current mangled name pointer points to the first character of
- the mangled name. Upon exit, it should point to the first character
- of the signature if demangling was successful, or to the first
- unconsumed character if demangling of the prefix was unsuccessful.
-
- Returns 1 on success, 0 otherwise.
- */
-
-static int
-demangle_prefix (work, mangled, declp)
- struct work_stuff *work;
- const char **mangled;
- string *declp;
-{
- int success = 1;
- const char *scan;
- int i;
-
- if (strlen(*mangled) > 6
- && (strncmp(*mangled, "_imp__", 6) == 0
- || strncmp(*mangled, "__imp_", 6) == 0))
- {
- /* it's a symbol imported from a PE dynamic library. Check for both
- new style prefix _imp__ and legacy __imp_ used by older versions
- of dlltool. */
- (*mangled) += 6;
- work->dllimported = 1;
- }
- else if (strlen(*mangled) >= 11 && strncmp(*mangled, "_GLOBAL_", 8) == 0)
- {
- char *marker = strchr (cplus_markers, (*mangled)[8]);
- if (marker != NULL && *marker == (*mangled)[10])
- {
- if ((*mangled)[9] == 'D')
- {
- /* it's a GNU global destructor to be executed at program exit */
- (*mangled) += 11;
- work->destructor = 2;
- if (gnu_special (work, mangled, declp))
- return success;
- }
- else if ((*mangled)[9] == 'I')
- {
- /* it's a GNU global constructor to be executed at program init */
- (*mangled) += 11;
- work->constructor = 2;
- if (gnu_special (work, mangled, declp))
- return success;
- }
- }
- }
- else if ((ARM_DEMANGLING || HP_DEMANGLING || EDG_DEMANGLING) && strncmp(*mangled, "__std__", 7) == 0)
- {
- /* it's a ARM global destructor to be executed at program exit */
- (*mangled) += 7;
- work->destructor = 2;
- }
- else if ((ARM_DEMANGLING || HP_DEMANGLING || EDG_DEMANGLING) && strncmp(*mangled, "__sti__", 7) == 0)
- {
- /* it's a ARM global constructor to be executed at program initial */
- (*mangled) += 7;
- work->constructor = 2;
- }
-
- /* This block of code is a reduction in strength time optimization
- of:
- scan = mystrstr (*mangled, "__"); */
-
- {
- scan = *mangled;
-
- do {
- scan = strchr (scan, '_');
- } while (scan != NULL && *++scan != '_');
-
- if (scan != NULL) --scan;
- }
-
- if (scan != NULL)
- {
- /* We found a sequence of two or more '_', ensure that we start at
- the last pair in the sequence. */
- i = strspn (scan, "_");
- if (i > 2)
- {
- scan += (i - 2);
- }
- }
-
- if (scan == NULL)
- {
- success = 0;
- }
- else if (work -> static_type)
- {
- if (!isdigit ((unsigned char)scan[0]) && (scan[0] != 't'))
- {
- success = 0;
- }
- }
- else if ((scan == *mangled)
- && (isdigit ((unsigned char)scan[2]) || (scan[2] == 'Q')
- || (scan[2] == 't') || (scan[2] == 'K') || (scan[2] == 'H')))
- {
- /* The ARM says nothing about the mangling of local variables.
- But cfront mangles local variables by prepending __<nesting_level>
- to them. As an extension to ARM demangling we handle this case. */
- if ((LUCID_DEMANGLING || ARM_DEMANGLING || HP_DEMANGLING)
- && isdigit ((unsigned char)scan[2]))
- {
- *mangled = scan + 2;
- consume_count (mangled);
- string_append (declp, *mangled);
- *mangled += strlen (*mangled);
- success = 1;
- }
- else
- {
- /* A GNU style constructor starts with __[0-9Qt]. But cfront uses
- names like __Q2_3foo3bar for nested type names. So don't accept
- this style of constructor for cfront demangling. A GNU
- style member-template constructor starts with 'H'. */
- if (!(LUCID_DEMANGLING || ARM_DEMANGLING || HP_DEMANGLING || EDG_DEMANGLING))
- work -> constructor += 1;
- *mangled = scan + 2;
- }
- }
- else if (ARM_DEMANGLING && scan[2] == 'p' && scan[3] == 't')
- {
- /* Cfront-style parameterized type. Handled later as a signature. */
- success = 1;
-
- /* ARM template? */
- demangle_arm_hp_template (work, mangled, strlen (*mangled), declp);
- }
- else if (EDG_DEMANGLING && ((scan[2] == 't' && scan[3] == 'm')
- || (scan[2] == 'p' && scan[3] == 's')
- || (scan[2] == 'p' && scan[3] == 't')))
- {
- /* EDG-style parameterized type. Handled later as a signature. */
- success = 1;
-
- /* EDG template? */
- demangle_arm_hp_template (work, mangled, strlen (*mangled), declp);
- }
- else if ((scan == *mangled) && !isdigit ((unsigned char)scan[2])
- && (scan[2] != 't'))
- {
- /* Mangled name starts with "__". Skip over any leading '_' characters,
- then find the next "__" that separates the prefix from the signature.
- */
- if (!(ARM_DEMANGLING || LUCID_DEMANGLING || HP_DEMANGLING || EDG_DEMANGLING)
- || (arm_special (mangled, declp) == 0))
- {
- while (*scan == '_')
- {
- scan++;
- }
- if ((scan = mystrstr (scan, "__")) == NULL || (*(scan + 2) == '\0'))
- {
- /* No separator (I.E. "__not_mangled"), or empty signature
- (I.E. "__not_mangled_either__") */
- success = 0;
- }
- else
- {
- const char *tmp;
-
- /* Look for the LAST occurrence of __, allowing names to
- have the '__' sequence embedded in them. */
- if (!(ARM_DEMANGLING || HP_DEMANGLING))
- {
- while ((tmp = mystrstr (scan + 2, "__")) != NULL)
- scan = tmp;
- }
- if (*(scan + 2) == '\0')
- success = 0;
- else
- demangle_function_name (work, mangled, declp, scan);
- }
- }
- }
- else if (*(scan + 2) != '\0')
- {
- /* Mangled name does not start with "__" but does have one somewhere
- in there with non empty stuff after it. Looks like a global
- function name. */
- demangle_function_name (work, mangled, declp, scan);
- }
- else
- {
- /* Doesn't look like a mangled name */
- success = 0;
- }
-
- if (!success && (work->constructor == 2 || work->destructor == 2))
- {
- string_append (declp, *mangled);
- *mangled += strlen (*mangled);
- success = 1;
- }
- return (success);
-}
-
-/*
-
-LOCAL FUNCTION
-
- gnu_special -- special handling of gnu mangled strings
-
-SYNOPSIS
-
- static int
- gnu_special (struct work_stuff *work, const char **mangled,
- string *declp);
-
-
-DESCRIPTION
-
- Process some special GNU style mangling forms that don't fit
- the normal pattern. For example:
-
- _$_3foo (destructor for class foo)
- _vt$foo (foo virtual table)
- _vt$foo$bar (foo::bar virtual table)
- __vt_foo (foo virtual table, new style with thunks)
- _3foo$varname (static data member)
- _Q22rs2tu$vw (static data member)
- __t6vector1Zii (constructor with template)
- __thunk_4__$_7ostream (virtual function thunk)
- */
-
-static int
-gnu_special (work, mangled, declp)
- struct work_stuff *work;
- const char **mangled;
- string *declp;
-{
- int n;
- int success = 1;
- const char *p;
-
- if ((*mangled)[0] == '_'
- && strchr (cplus_markers, (*mangled)[1]) != NULL
- && (*mangled)[2] == '_')
- {
- /* Found a GNU style destructor, get past "_<CPLUS_MARKER>_" */
- (*mangled) += 3;
- work -> destructor += 1;
- }
- else if ((*mangled)[0] == '_'
- && (((*mangled)[1] == '_'
- && (*mangled)[2] == 'v'
- && (*mangled)[3] == 't'
- && (*mangled)[4] == '_')
- || ((*mangled)[1] == 'v'
- && (*mangled)[2] == 't'
- && strchr (cplus_markers, (*mangled)[3]) != NULL)))
- {
- /* Found a GNU style virtual table, get past "_vt<CPLUS_MARKER>"
- and create the decl. Note that we consume the entire mangled
- input string, which means that demangle_signature has no work
- to do. */
- if ((*mangled)[2] == 'v')
- (*mangled) += 5; /* New style, with thunks: "__vt_" */
- else
- (*mangled) += 4; /* Old style, no thunks: "_vt<CPLUS_MARKER>" */
- while (**mangled != '\0')
- {
- switch (**mangled)
- {
- case 'Q':
- case 'K':
- success = demangle_qualified (work, mangled, declp, 0, 1);
- break;
- case 't':
- success = demangle_template (work, mangled, declp, 0, 1,
- 1);
- break;
- default:
- if (isdigit((unsigned char)*mangled[0]))
- {
- n = consume_count(mangled);
- /* We may be seeing a too-large size, or else a
- ".<digits>" indicating a static local symbol. In
- any case, declare victory and move on; *don't* try
- to use n to allocate. */
- if (n > (int) strlen (*mangled))
- {
- success = 1;
- break;
- }
- }
- else
- {
- n = strcspn (*mangled, cplus_markers);
- }
- string_appendn (declp, *mangled, n);
- (*mangled) += n;
- }
-
- p = strpbrk (*mangled, cplus_markers);
- if (success && ((p == NULL) || (p == *mangled)))
- {
- if (p != NULL)
- {
- string_append (declp, SCOPE_STRING (work));
- (*mangled)++;
- }
- }
- else
- {
- success = 0;
- break;
- }
- }
- if (success)
- string_append (declp, " virtual table");
- }
- else if ((*mangled)[0] == '_'
- && (strchr("0123456789Qt", (*mangled)[1]) != NULL)
- && (p = strpbrk (*mangled, cplus_markers)) != NULL)
- {
- /* static data member, "_3foo$varname" for example */
- (*mangled)++;
- switch (**mangled)
- {
- case 'Q':
- case 'K':
- success = demangle_qualified (work, mangled, declp, 0, 1);
- break;
- case 't':
- success = demangle_template (work, mangled, declp, 0, 1, 1);
- break;
- default:
- n = consume_count (mangled);
- if (n < 0 || n > strlen (*mangled))
- {
- success = 0;
- break;
- }
- string_appendn (declp, *mangled, n);
- (*mangled) += n;
- }
- if (success && (p == *mangled))
- {
- /* Consumed everything up to the cplus_marker, append the
- variable name. */
- (*mangled)++;
- string_append (declp, SCOPE_STRING (work));
- n = strlen (*mangled);
- string_appendn (declp, *mangled, n);
- (*mangled) += n;
- }
- else
- {
- success = 0;
- }
- }
- else if (strncmp (*mangled, "__thunk_", 8) == 0)
- {
- int delta;
-
- (*mangled) += 8;
- delta = consume_count (mangled);
- if (delta == -1)
- success = 0;
- else
- {
- char *method = internal_cplus_demangle (work, ++*mangled);
-
- if (method)
- {
- char buf[50];
- sprintf (buf, "virtual function thunk (delta:%d) for ", -delta);
- string_append (declp, buf);
- string_append (declp, method);
- free (method);
- n = strlen (*mangled);
- (*mangled) += n;
- }
- else
- {
- success = 0;
- }
- }
- }
- else if (strncmp (*mangled, "__t", 3) == 0
- && ((*mangled)[3] == 'i' || (*mangled)[3] == 'f'))
- {
- p = (*mangled)[3] == 'i' ? " type_info node" : " type_info function";
- (*mangled) += 4;
- switch (**mangled)
- {
- case 'Q':
- case 'K':
- success = demangle_qualified (work, mangled, declp, 0, 1);
- break;
- case 't':
- success = demangle_template (work, mangled, declp, 0, 1, 1);
- break;
- default:
- success = demangle_fund_type (work, mangled, declp);
- break;
- }
- if (success && **mangled != '\0')
- success = 0;
- if (success)
- string_append (declp, p);
- }
- else
- {
- success = 0;
- }
- return (success);
-}
-
-static void
-recursively_demangle(work, mangled, result, namelength)
- struct work_stuff *work;
- const char **mangled;
- string *result;
- int namelength;
-{
- char * recurse = (char *)NULL;
- char * recurse_dem = (char *)NULL;
-
- recurse = (char *) xmalloc (namelength + 1);
- memcpy (recurse, *mangled, namelength);
- recurse[namelength] = '\000';
-
- recurse_dem = cplus_demangle (recurse, work->options);
-
- if (recurse_dem)
- {
- string_append (result, recurse_dem);
- free (recurse_dem);
- }
- else
- {
- string_appendn (result, *mangled, namelength);
- }
- free (recurse);
- *mangled += namelength;
-}
-
-/*
-
-LOCAL FUNCTION
-
- arm_special -- special handling of ARM/lucid mangled strings
-
-SYNOPSIS
-
- static int
- arm_special (const char **mangled,
- string *declp);
-
-
-DESCRIPTION
-
- Process some special ARM style mangling forms that don't fit
- the normal pattern. For example:
-
- __vtbl__3foo (foo virtual table)
- __vtbl__3foo__3bar (bar::foo virtual table)
-
- */
-
-static int
-arm_special (mangled, declp)
- const char **mangled;
- string *declp;
-{
- int n;
- int success = 1;
- const char *scan;
-
- if (strncmp (*mangled, ARM_VTABLE_STRING, ARM_VTABLE_STRLEN) == 0)
- {
- /* Found a ARM style virtual table, get past ARM_VTABLE_STRING
- and create the decl. Note that we consume the entire mangled
- input string, which means that demangle_signature has no work
- to do. */
- scan = *mangled + ARM_VTABLE_STRLEN;
- while (*scan != '\0') /* first check it can be demangled */
- {
- n = consume_count (&scan);
- if (n == -1)
- {
- return (0); /* no good */
- }
- scan += n;
- if (scan[0] == '_' && scan[1] == '_')
- {
- scan += 2;
- }
- }
- (*mangled) += ARM_VTABLE_STRLEN;
- while (**mangled != '\0')
- {
- n = consume_count (mangled);
- if (n == -1
- || n > strlen (*mangled))
- return 0;
- string_prependn (declp, *mangled, n);
- (*mangled) += n;
- if ((*mangled)[0] == '_' && (*mangled)[1] == '_')
- {
- string_prepend (declp, "::");
- (*mangled) += 2;
- }
- }
- string_append (declp, " virtual table");
- }
- else
- {
- success = 0;
- }
- return (success);
-}
-
-/*
-
-LOCAL FUNCTION
-
- demangle_qualified -- demangle 'Q' qualified name strings
-
-SYNOPSIS
-
- static int
- demangle_qualified (struct work_stuff *, const char *mangled,
- string *result, int isfuncname, int append);
-
-DESCRIPTION
-
- Demangle a qualified name, such as "Q25Outer5Inner" which is
- the mangled form of "Outer::Inner". The demangled output is
- prepended or appended to the result string according to the
- state of the append flag.
-
- If isfuncname is nonzero, then the qualified name we are building
- is going to be used as a member function name, so if it is a
- constructor or destructor function, append an appropriate
- constructor or destructor name. I.E. for the above example,
- the result for use as a constructor is "Outer::Inner::Inner"
- and the result for use as a destructor is "Outer::Inner::~Inner".
-
-BUGS
-
- Numeric conversion is ASCII dependent (FIXME).
-
- */
-
-static int
-demangle_qualified (work, mangled, result, isfuncname, append)
- struct work_stuff *work;
- const char **mangled;
- string *result;
- int isfuncname;
- int append;
-{
- int qualifiers = 0;
- int success = 1;
- const char *p;
- char num[2];
- string temp;
- string last_name;
- int bindex = register_Btype (work);
-
- /* We only make use of ISFUNCNAME if the entity is a constructor or
- destructor. */
- isfuncname = (isfuncname
- && ((work->constructor & 1) || (work->destructor & 1)));
-
- string_init (&temp);
- string_init (&last_name);
-
- if ((*mangled)[0] == 'K')
- {
- /* Squangling qualified name reuse */
- int idx;
- (*mangled)++;
- idx = consume_count_with_underscores (mangled);
- if (idx == -1 || idx >= work -> numk)
- success = 0;
- else
- string_append (&temp, work -> ktypevec[idx]);
- }
- else
- switch ((*mangled)[1])
- {
- case '_':
- /* GNU mangled name with more than 9 classes. The count is preceded
- by an underscore (to distinguish it from the <= 9 case) and followed
- by an underscore. */
- p = *mangled + 2;
- qualifiers = atoi (p);
- if (!isdigit ((unsigned char)*p) || *p == '0')
- success = 0;
-
- /* Skip the digits. */
- while (isdigit ((unsigned char)*p))
- ++p;
-
- if (*p != '_')
- success = 0;
-
- *mangled = p + 1;
- break;
-
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- /* The count is in a single digit. */
- num[0] = (*mangled)[1];
- num[1] = '\0';
- qualifiers = atoi (num);
-
- /* If there is an underscore after the digit, skip it. This is
- said to be for ARM-qualified names, but the ARM makes no
- mention of such an underscore. Perhaps cfront uses one. */
- if ((*mangled)[2] == '_')
- {
- (*mangled)++;
- }
- (*mangled) += 2;
- break;
-
- case '0':
- default:
- success = 0;
- }
-
- if (!success)
- return success;
-
- /* Pick off the names and collect them in the temp buffer in the order
- in which they are found, separated by '::'. */
-
- while (qualifiers-- > 0)
- {
- int remember_K = 1;
- string_clear (&last_name);
-
- if (*mangled[0] == '_')
- (*mangled)++;
-
- if (*mangled[0] == 't')
- {
- /* Here we always append to TEMP since we will want to use
- the template name without the template parameters as a
- constructor or destructor name. The appropriate
- (parameter-less) value is returned by demangle_template
- in LAST_NAME. We do not remember the template type here,
- in order to match the G++ mangling algorithm. */
- success = demangle_template(work, mangled, &temp,
- &last_name, 1, 0);
- if (!success)
- break;
- }
- else if (*mangled[0] == 'K')
- {
- int idx;
- (*mangled)++;
- idx = consume_count_with_underscores (mangled);
- if (idx == -1 || idx >= work->numk)
- success = 0;
- else
- string_append (&temp, work->ktypevec[idx]);
- remember_K = 0;
-
- if (!success) break;
- }
- else
- {
- if (EDG_DEMANGLING)
- {
- int namelength;
- /* Now recursively demangle the qualifier
- * This is necessary to deal with templates in
- * mangling styles like EDG */
- namelength = consume_count (mangled);
- if (namelength == -1)
- {
- success = 0;
- break;
- }
- recursively_demangle(work, mangled, &temp, namelength);
- }
- else
- {
- success = do_type (work, mangled, &last_name);
- if (!success)
- break;
- string_appends (&temp, &last_name);
- }
- }
-
- if (remember_K)
- remember_Ktype (work, temp.b, LEN_STRING (&temp));
-
- if (qualifiers > 0)
- string_append (&temp, SCOPE_STRING (work));
- }
-
- remember_Btype (work, temp.b, LEN_STRING (&temp), bindex);
-
- /* If we are using the result as a function name, we need to append
- the appropriate '::' separated constructor or destructor name.
- We do this here because this is the most convenient place, where
- we already have a pointer to the name and the length of the name. */
-
- if (isfuncname)
- {
- string_append (&temp, SCOPE_STRING (work));
- if (work -> destructor & 1)
- string_append (&temp, "~");
- string_appends (&temp, &last_name);
- }
-
- /* Now either prepend the temp buffer to the result, or append it,
- depending upon the state of the append flag. */
-
- if (append)
- string_appends (result, &temp);
- else
- {
- if (!STRING_EMPTY (result))
- string_append (&temp, SCOPE_STRING (work));
- string_prepends (result, &temp);
- }
-
- string_delete (&last_name);
- string_delete (&temp);
- return (success);
-}
-
-/*
-
-LOCAL FUNCTION
-
- get_count -- convert an ascii count to integer, consuming tokens
-
-SYNOPSIS
-
- static int
- get_count (const char **type, int *count)
-
-DESCRIPTION
-
- Assume that *type points at a count in a mangled name; set
- *count to its value, and set *type to the next character after
- the count. There are some weird rules in effect here.
-
- If *type does not point at a string of digits, return zero.
-
- If *type points at a string of digits followed by an
- underscore, set *count to their value as an integer, advance
- *type to point *after the underscore, and return 1.
-
- If *type points at a string of digits not followed by an
- underscore, consume only the first digit. Set *count to its
- value as an integer, leave *type pointing after that digit,
- and return 1.
-
- The excuse for this odd behavior: in the ARM and HP demangling
- styles, a type can be followed by a repeat count of the form
- `Nxy', where:
-
- `x' is a single digit specifying how many additional copies
- of the type to append to the argument list, and
-
- `y' is one or more digits, specifying the zero-based index of
- the first repeated argument in the list. Yes, as you're
- unmangling the name you can figure this out yourself, but
- it's there anyway.
-
- So, for example, in `bar__3fooFPiN51', the first argument is a
- pointer to an integer (`Pi'), and then the next five arguments
- are the same (`N5'), and the first repeat is the function's
- second argument (`1').
-*/
-
-static int
-get_count (type, count)
- const char **type;
- int *count;
-{
- const char *p;
- int n;
-
- if (!isdigit ((unsigned char)**type))
- {
- return (0);
- }
- else
- {
- *count = **type - '0';
- (*type)++;
- if (isdigit ((unsigned char)**type))
- {
- p = *type;
- n = *count;
- do
- {
- n *= 10;
- n += *p - '0';
- p++;
- }
- while (isdigit ((unsigned char)*p));
- if (*p == '_')
- {
- *type = p + 1;
- *count = n;
- }
- }
- }
- return (1);
-}
-
-/* RESULT will be initialised here; it will be freed on failure. The
- value returned is really a type_kind_t. */
-
-static int
-do_type (work, mangled, result)
- struct work_stuff *work;
- const char **mangled;
- string *result;
-{
- int n;
- int done;
- int success;
- string decl;
- const char *remembered_type;
- int type_quals;
- string btype;
- type_kind_t tk = tk_none;
-
- string_init (&btype);
- string_init (&decl);
- string_init (result);
-
- done = 0;
- success = 1;
- while (success && !done)
- {
- int member;
- switch (**mangled)
- {
-
- /* A pointer type */
- case 'P':
- case 'p':
- (*mangled)++;
- if (! (work -> options & DMGL_JAVA))
- string_prepend (&decl, "*");
- if (tk == tk_none)
- tk = tk_pointer;
- break;
-
- /* A reference type */
- case 'R':
- (*mangled)++;
- string_prepend (&decl, "&");
- if (tk == tk_none)
- tk = tk_reference;
- break;
-
- /* An array */
- case 'A':
- {
- ++(*mangled);
- if (!STRING_EMPTY (&decl)
- && (decl.b[0] == '*' || decl.b[0] == '&'))
- {
- string_prepend (&decl, "(");
- string_append (&decl, ")");
- }
- string_append (&decl, "[");
- if (**mangled != '_')
- success = demangle_template_value_parm (work, mangled, &decl,
- tk_integral);
- if (**mangled == '_')
- ++(*mangled);
- string_append (&decl, "]");
- break;
- }
-
- /* A back reference to a previously seen type */
- case 'T':
- (*mangled)++;
- if (!get_count (mangled, &n) || n >= work -> ntypes)
- {
- success = 0;
- }
- else
- {
- remembered_type = work -> typevec[n];
- mangled = &remembered_type;
- }
- break;
-
- /* A function */
- case 'F':
- (*mangled)++;
- if (!STRING_EMPTY (&decl)
- && (decl.b[0] == '*' || decl.b[0] == '&'))
- {
- string_prepend (&decl, "(");
- string_append (&decl, ")");
- }
- /* After picking off the function args, we expect to either find the
- function return type (preceded by an '_') or the end of the
- string. */
- if (!demangle_nested_args (work, mangled, &decl)
- || (**mangled != '_' && **mangled != '\0'))
- {
- success = 0;
- break;
- }
- if (success && (**mangled == '_'))
- (*mangled)++;
- break;
-
- case 'M':
- case 'O':
- {
- type_quals = TYPE_UNQUALIFIED;
-
- member = **mangled == 'M';
- (*mangled)++;
-
- string_append (&decl, ")");
- string_prepend (&decl, SCOPE_STRING (work));
- if (isdigit ((unsigned char)**mangled))
- {
- n = consume_count (mangled);
- if (n == -1
- || (int) strlen (*mangled) < n)
- {
- success = 0;
- break;
- }
- string_prependn (&decl, *mangled, n);
- *mangled += n;
- }
- else if (**mangled == 'X' || **mangled == 'Y')
- {
- string temp;
- do_type (work, mangled, &temp);
- string_prepends (&decl, &temp);
- }
- else if (**mangled == 't')
- {
- string temp;
- string_init (&temp);
- success = demangle_template (work, mangled, &temp,
- NULL, 1, 1);
- if (success)
- {
- string_prependn (&decl, temp.b, temp.p - temp.b);
- string_clear (&temp);
- }
- else
- break;
- }
- else
- {
- success = 0;
- break;
- }
-
- string_prepend (&decl, "(");
- if (member)
- {
- switch (**mangled)
- {
- case 'C':
- case 'V':
- case 'u':
- type_quals |= code_for_qualifier (**mangled);
- (*mangled)++;
- break;
-
- default:
- break;
- }
-
- if (*(*mangled)++ != 'F')
- {
- success = 0;
- break;
- }
- }
- if ((member && !demangle_nested_args (work, mangled, &decl))
- || **mangled != '_')
- {
- success = 0;
- break;
- }
- (*mangled)++;
- if (! PRINT_ANSI_QUALIFIERS)
- {
- break;
- }
- if (type_quals != TYPE_UNQUALIFIED)
- {
- APPEND_BLANK (&decl);
- string_append (&decl, qualifier_string (type_quals));
- }
- break;
- }
- case 'G':
- (*mangled)++;
- break;
-
- case 'C':
- case 'V':
- case 'u':
- if (PRINT_ANSI_QUALIFIERS)
- {
- if (!STRING_EMPTY (&decl))
- string_prepend (&decl, " ");
-
- string_prepend (&decl, demangle_qualifier (**mangled));
- }
- (*mangled)++;
- break;
- /*
- }
- */
-
- /* fall through */
- default:
- done = 1;
- break;
- }
- }
-
- if (success) switch (**mangled)
- {
- /* A qualified name, such as "Outer::Inner". */
- case 'Q':
- case 'K':
- {
- success = demangle_qualified (work, mangled, result, 0, 1);
- break;
- }
-
- /* A back reference to a previously seen squangled type */
- case 'B':
- (*mangled)++;
- if (!get_count (mangled, &n) || n >= work -> numb)
- success = 0;
- else
- string_append (result, work->btypevec[n]);
- break;
-
- case 'X':
- case 'Y':
- /* A template parm. We substitute the corresponding argument. */
- {
- int idx;
-
- (*mangled)++;
- idx = consume_count_with_underscores (mangled);
-
- if (idx == -1
- || (work->tmpl_argvec && idx >= work->ntmpl_args)
- || consume_count_with_underscores (mangled) == -1)
- {
- success = 0;
- break;
- }
-
- if (work->tmpl_argvec)
- string_append (result, work->tmpl_argvec[idx]);
- else
- {
- char buf[10];
- sprintf(buf, "T%d", idx);
- string_append (result, buf);
- }
-
- success = 1;
- }
- break;
-
- default:
- success = demangle_fund_type (work, mangled, result);
- if (tk == tk_none)
- tk = (type_kind_t) success;
- break;
- }
-
- if (success)
- {
- if (!STRING_EMPTY (&decl))
- {
- string_append (result, " ");
- string_appends (result, &decl);
- }
- }
- else
- string_delete (result);
- string_delete (&decl);
-
- if (success)
- /* Assume an integral type, if we're not sure. */
- return (int) ((tk == tk_none) ? tk_integral : tk);
- else
- return 0;
-}
-
-/* Given a pointer to a type string that represents a fundamental type
- argument (int, long, unsigned int, etc) in TYPE, a pointer to the
- string in which the demangled output is being built in RESULT, and
- the WORK structure, decode the types and add them to the result.
-
- For example:
-
- "Ci" => "const int"
- "Sl" => "signed long"
- "CUs" => "const unsigned short"
-
- The value returned is really a type_kind_t. */
-
-static int
-demangle_fund_type (work, mangled, result)
- struct work_stuff *work;
- const char **mangled;
- string *result;
-{
- int done = 0;
- int success = 1;
- char buf[10];
- int dec = 0;
- string btype;
- type_kind_t tk = tk_integral;
-
- string_init (&btype);
-
- /* First pick off any type qualifiers. There can be more than one. */
-
- while (!done)
- {
- switch (**mangled)
- {
- case 'C':
- case 'V':
- case 'u':
- if (PRINT_ANSI_QUALIFIERS)
- {
- if (!STRING_EMPTY (result))
- string_prepend (result, " ");
- string_prepend (result, demangle_qualifier (**mangled));
- }
- (*mangled)++;
- break;
- case 'U':
- (*mangled)++;
- APPEND_BLANK (result);
- string_append (result, "unsigned");
- break;
- case 'S': /* signed char only */
- (*mangled)++;
- APPEND_BLANK (result);
- string_append (result, "signed");
- break;
- case 'J':
- (*mangled)++;
- APPEND_BLANK (result);
- string_append (result, "__complex");
- break;
- default:
- done = 1;
- break;
- }
- }
-
- /* Now pick off the fundamental type. There can be only one. */
-
- switch (**mangled)
- {
- case '\0':
- case '_':
- break;
- case 'v':
- (*mangled)++;
- APPEND_BLANK (result);
- string_append (result, "void");
- break;
- case 'x':
- (*mangled)++;
- APPEND_BLANK (result);
- string_append (result, "long long");
- break;
- case 'l':
- (*mangled)++;
- APPEND_BLANK (result);
- string_append (result, "long");
- break;
- case 'i':
- (*mangled)++;
- APPEND_BLANK (result);
- string_append (result, "int");
- break;
- case 's':
- (*mangled)++;
- APPEND_BLANK (result);
- string_append (result, "short");
- break;
- case 'b':
- (*mangled)++;
- APPEND_BLANK (result);
- string_append (result, "bool");
- tk = tk_bool;
- break;
- case 'c':
- (*mangled)++;
- APPEND_BLANK (result);
- string_append (result, "char");
- tk = tk_char;
- break;
- case 'w':
- (*mangled)++;
- APPEND_BLANK (result);
- string_append (result, "wchar_t");
- tk = tk_char;
- break;
- case 'r':
- (*mangled)++;
- APPEND_BLANK (result);
- string_append (result, "long double");
- tk = tk_real;
- break;
- case 'd':
- (*mangled)++;
- APPEND_BLANK (result);
- string_append (result, "double");
- tk = tk_real;
- break;
- case 'f':
- (*mangled)++;
- APPEND_BLANK (result);
- string_append (result, "float");
- tk = tk_real;
- break;
- case 'G':
- (*mangled)++;
- if (!isdigit ((unsigned char)**mangled))
- {
- success = 0;
- break;
- }
- case 'I':
- (*mangled)++;
- if (**mangled == '_')
- {
- int i;
- (*mangled)++;
- for (i = 0;
- i < sizeof (buf) - 1 && **mangled && **mangled != '_';
- (*mangled)++, i++)
- buf[i] = **mangled;
- if (**mangled != '_')
- {
- success = 0;
- break;
- }
- buf[i] = '\0';
- (*mangled)++;
- }
- else
- {
- strncpy (buf, *mangled, 2);
- buf[2] = '\0';
- *mangled += min (strlen (*mangled), 2);
- }
- sscanf (buf, "%x", &dec);
- sprintf (buf, "int%i_t", dec);
- APPEND_BLANK (result);
- string_append (result, buf);
- break;
-
- /* fall through */
- /* An explicit type, such as "6mytype" or "7integer" */
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- {
- int bindex = register_Btype (work);
- string btype;
- string_init (&btype);
- if (demangle_class_name (work, mangled, &btype)) {
- remember_Btype (work, btype.b, LEN_STRING (&btype), bindex);
- APPEND_BLANK (result);
- string_appends (result, &btype);
- }
- else
- success = 0;
- string_delete (&btype);
- break;
- }
- case 't':
- {
- success = demangle_template (work, mangled, &btype, 0, 1, 1);
- string_appends (result, &btype);
- break;
- }
- default:
- success = 0;
- break;
- }
-
- return success ? ((int) tk) : 0;
-}
-
-
-/* Handle a template's value parameter for HP aCC (extension from ARM)
- **mangled points to 'S' or 'U' */
-
-static int
-do_hpacc_template_const_value (work, mangled, result)
- struct work_stuff *work;
- const char **mangled;
- string *result;
-{
- int unsigned_const;
-
- if (**mangled != 'U' && **mangled != 'S')
- return 0;
-
- unsigned_const = (**mangled == 'U');
-
- (*mangled)++;
-
- switch (**mangled)
- {
- case 'N':
- string_append (result, "-");
- /* fall through */
- case 'P':
- (*mangled)++;
- break;
- case 'M':
- /* special case for -2^31 */
- string_append (result, "-2147483648");
- (*mangled)++;
- return 1;
- default:
- return 0;
- }
-
- /* We have to be looking at an integer now */
- if (!(isdigit ((unsigned char)**mangled)))
- return 0;
-
- /* We only deal with integral values for template
- parameters -- so it's OK to look only for digits */
- while (isdigit ((unsigned char)**mangled))
- {
- char_str[0] = **mangled;
- string_append (result, char_str);
- (*mangled)++;
- }
-
- if (unsigned_const)
- string_append (result, "U");
-
- /* FIXME? Some day we may have 64-bit (or larger :-) ) constants
- with L or LL suffixes. pai/1997-09-03 */
-
- return 1; /* success */
-}
-
-/* Handle a template's literal parameter for HP aCC (extension from ARM)
- **mangled is pointing to the 'A' */
-
-static int
-do_hpacc_template_literal (work, mangled, result)
- struct work_stuff *work;
- const char **mangled;
- string *result;
-{
- int literal_len = 0;
- char * recurse;
- char * recurse_dem;
-
- if (**mangled != 'A')
- return 0;
-
- (*mangled)++;
-
- literal_len = consume_count (mangled);
-
- if (literal_len <= 0)
- return 0;
-
- /* Literal parameters are names of arrays, functions, etc. and the
- canonical representation uses the address operator */
- string_append (result, "&");
-
- /* Now recursively demangle the literal name */
- recurse = (char *) xmalloc (literal_len + 1);
- memcpy (recurse, *mangled, literal_len);
- recurse[literal_len] = '\000';
-
- recurse_dem = cplus_demangle (recurse, work->options);
-
- if (recurse_dem)
- {
- string_append (result, recurse_dem);
- free (recurse_dem);
- }
- else
- {
- string_appendn (result, *mangled, literal_len);
- }
- (*mangled) += literal_len;
- free (recurse);
-
- return 1;
-}
-
-static int
-snarf_numeric_literal (args, arg)
- const char ** args;
- string * arg;
-{
- if (**args == '-')
- {
- char_str[0] = '-';
- string_append (arg, char_str);
- (*args)++;
- }
- else if (**args == '+')
- (*args)++;
-
- if (!isdigit ((unsigned char)**args))
- return 0;
-
- while (isdigit ((unsigned char)**args))
- {
- char_str[0] = **args;
- string_append (arg, char_str);
- (*args)++;
- }
-
- return 1;
-}
-
-/* Demangle the next argument, given by MANGLED into RESULT, which
- *should be an uninitialized* string. It will be initialized here,
- and free'd should anything go wrong. */
-
-static int
-do_arg (work, mangled, result)
- struct work_stuff *work;
- const char **mangled;
- string *result;
-{
- /* Remember where we started so that we can record the type, for
- non-squangling type remembering. */
- const char *start = *mangled;
-
- string_init (result);
-
- if (work->nrepeats > 0)
- {
- --work->nrepeats;
-
- if (work->previous_argument == 0)
- return 0;
-
- /* We want to reissue the previous type in this argument list. */
- string_appends (result, work->previous_argument);
- return 1;
- }
-
- if (**mangled == 'n')
- {
- /* A squangling-style repeat. */
- (*mangled)++;
- work->nrepeats = consume_count(mangled);
-
- if (work->nrepeats <= 0)
- /* This was not a repeat count after all. */
- return 0;
-
- if (work->nrepeats > 9)
- {
- if (**mangled != '_')
- /* The repeat count should be followed by an '_' in this
- case. */
- return 0;
- else
- (*mangled)++;
- }
-
- /* Now, the repeat is all set up. */
- return do_arg (work, mangled, result);
- }
-
- /* Save the result in WORK->previous_argument so that we can find it
- if it's repeated. Note that saving START is not good enough: we
- do not want to add additional types to the back-referenceable
- type vector when processing a repeated type. */
- if (work->previous_argument)
- string_clear (work->previous_argument);
- else
- {
- work->previous_argument = (string*) xmalloc (sizeof (string));
- string_init (work->previous_argument);
- }
-
- if (!do_type (work, mangled, work->previous_argument))
- return 0;
-
- string_appends (result, work->previous_argument);
-
- remember_type (work, start, *mangled - start);
- return 1;
-}
-
-static void
-remember_type (work, start, len)
- struct work_stuff *work;
- const char *start;
- int len;
-{
- char *tem;
-
- if (work->forgetting_types)
- return;
-
- if (work -> ntypes >= work -> typevec_size)
- {
- if (work -> typevec_size == 0)
- {
- work -> typevec_size = 3;
- work -> typevec
- = (char **) xmalloc (sizeof (char *) * work -> typevec_size);
- }
- else
- {
- work -> typevec_size *= 2;
- work -> typevec
- = (char **) xrealloc ((char *)work -> typevec,
- sizeof (char *) * work -> typevec_size);
- }
- }
- tem = xmalloc (len + 1);
- memcpy (tem, start, len);
- tem[len] = '\0';
- work -> typevec[work -> ntypes++] = tem;
-}
-
-
-/* Remember a K type class qualifier. */
-static void
-remember_Ktype (work, start, len)
- struct work_stuff *work;
- const char *start;
- int len;
-{
- char *tem;
-
- if (work -> numk >= work -> ksize)
- {
- if (work -> ksize == 0)
- {
- work -> ksize = 5;
- work -> ktypevec
- = (char **) xmalloc (sizeof (char *) * work -> ksize);
- }
- else
- {
- work -> ksize *= 2;
- work -> ktypevec
- = (char **) xrealloc ((char *)work -> ktypevec,
- sizeof (char *) * work -> ksize);
- }
- }
- tem = xmalloc (len + 1);
- memcpy (tem, start, len);
- tem[len] = '\0';
- work -> ktypevec[work -> numk++] = tem;
-}
-
-/* Register a B code, and get an index for it. B codes are registered
- as they are seen, rather than as they are completed, so map<temp<char> >
- registers map<temp<char> > as B0, and temp<char> as B1 */
-
-static int
-register_Btype (work)
- struct work_stuff *work;
-{
- int ret;
-
- if (work -> numb >= work -> bsize)
- {
- if (work -> bsize == 0)
- {
- work -> bsize = 5;
- work -> btypevec
- = (char **) xmalloc (sizeof (char *) * work -> bsize);
- }
- else
- {
- work -> bsize *= 2;
- work -> btypevec
- = (char **) xrealloc ((char *)work -> btypevec,
- sizeof (char *) * work -> bsize);
- }
- }
- ret = work -> numb++;
- work -> btypevec[ret] = NULL;
- return(ret);
-}
-
-/* Store a value into a previously registered B code type. */
-
-static void
-remember_Btype (work, start, len, index)
- struct work_stuff *work;
- const char *start;
- int len, index;
-{
- char *tem;
-
- tem = xmalloc (len + 1);
- memcpy (tem, start, len);
- tem[len] = '\0';
- work -> btypevec[index] = tem;
-}
-
-/* Lose all the info related to B and K type codes. */
-static void
-forget_B_and_K_types (work)
- struct work_stuff *work;
-{
- int i;
-
- while (work -> numk > 0)
- {
- i = --(work -> numk);
- if (work -> ktypevec[i] != NULL)
- {
- free (work -> ktypevec[i]);
- work -> ktypevec[i] = NULL;
- }
- }
-
- while (work -> numb > 0)
- {
- i = --(work -> numb);
- if (work -> btypevec[i] != NULL)
- {
- free (work -> btypevec[i]);
- work -> btypevec[i] = NULL;
- }
- }
-}
-/* Forget the remembered types, but not the type vector itself. */
-
-static void
-forget_types (work)
- struct work_stuff *work;
-{
- int i;
-
- while (work -> ntypes > 0)
- {
- i = --(work -> ntypes);
- if (work -> typevec[i] != NULL)
- {
- free (work -> typevec[i]);
- work -> typevec[i] = NULL;
- }
- }
-}
-
-/* Process the argument list part of the signature, after any class spec
- has been consumed, as well as the first 'F' character (if any). For
- example:
-
- "__als__3fooRT0" => process "RT0"
- "complexfunc5__FPFPc_PFl_i" => process "PFPc_PFl_i"
-
- DECLP must be already initialised, usually non-empty. It won't be freed
- on failure.
-
- Note that g++ differs significantly from ARM and lucid style mangling
- with regards to references to previously seen types. For example, given
- the source fragment:
-
- class foo {
- public:
- foo::foo (int, foo &ia, int, foo &ib, int, foo &ic);
- };
-
- foo::foo (int, foo &ia, int, foo &ib, int, foo &ic) { ia = ib = ic; }
- void foo (int, foo &ia, int, foo &ib, int, foo &ic) { ia = ib = ic; }
-
- g++ produces the names:
-
- __3fooiRT0iT2iT2
- foo__FiR3fooiT1iT1
-
- while lcc (and presumably other ARM style compilers as well) produces:
-
- foo__FiR3fooT1T2T1T2
- __ct__3fooFiR3fooT1T2T1T2
-
- Note that g++ bases its type numbers starting at zero and counts all
- previously seen types, while lucid/ARM bases its type numbers starting
- at one and only considers types after it has seen the 'F' character
- indicating the start of the function args. For lucid/ARM style, we
- account for this difference by discarding any previously seen types when
- we see the 'F' character, and subtracting one from the type number
- reference.
-
- */
-
-static int
-demangle_args (work, mangled, declp)
- struct work_stuff *work;
- const char **mangled;
- string *declp;
-{
- string arg;
- int need_comma = 0;
- int r;
- int t;
- const char *tem;
- char temptype;
-
- if (PRINT_ARG_TYPES)
- {
- string_append (declp, "(");
- if (**mangled == '\0')
- {
- string_append (declp, "void");
- }
- }
-
- while ((**mangled != '_' && **mangled != '\0' && **mangled != 'e')
- || work->nrepeats > 0)
- {
- if ((**mangled == 'N') || (**mangled == 'T'))
- {
- temptype = *(*mangled)++;
-
- if (temptype == 'N')
- {
- if (!get_count (mangled, &r))
- {
- return (0);
- }
- }
- else
- {
- r = 1;
- }
- if ((HP_DEMANGLING || ARM_DEMANGLING || EDG_DEMANGLING) && work -> ntypes >= 10)
- {
- /* If we have 10 or more types we might have more than a 1 digit
- index so we'll have to consume the whole count here. This
- will lose if the next thing is a type name preceded by a
- count but it's impossible to demangle that case properly
- anyway. Eg if we already have 12 types is T12Pc "(..., type1,
- Pc, ...)" or "(..., type12, char *, ...)" */
- if ((t = consume_count(mangled)) <= 0)
- {
- return (0);
- }
- }
- else
- {
- if (!get_count (mangled, &t))
- {
- return (0);
- }
- }
- if (LUCID_DEMANGLING || ARM_DEMANGLING || HP_DEMANGLING || EDG_DEMANGLING)
- {
- t--;
- }
- /* Validate the type index. Protect against illegal indices from
- malformed type strings. */
- if ((t < 0) || (t >= work -> ntypes))
- {
- return (0);
- }
- while (work->nrepeats > 0 || --r >= 0)
- {
- tem = work -> typevec[t];
- if (need_comma && PRINT_ARG_TYPES)
- {
- string_append (declp, ", ");
- }
- if (!do_arg (work, &tem, &arg))
- {
- return (0);
- }
- if (PRINT_ARG_TYPES)
- {
- string_appends (declp, &arg);
- }
- string_delete (&arg);
- need_comma = 1;
- }
- }
- else
- {
- if (need_comma && PRINT_ARG_TYPES)
- string_append (declp, ", ");
- if (!do_arg (work, mangled, &arg))
- return (0);
- if (PRINT_ARG_TYPES)
- string_appends (declp, &arg);
- string_delete (&arg);
- need_comma = 1;
- }
- }
-
- if (**mangled == 'e')
- {
- (*mangled)++;
- if (PRINT_ARG_TYPES)
- {
- if (need_comma)
- {
- string_append (declp, ",");
- }
- string_append (declp, "...");
- }
- }
-
- if (PRINT_ARG_TYPES)
- {
- string_append (declp, ")");
- }
- return (1);
-}
-
-/* Like demangle_args, but for demangling the argument lists of function
- and method pointers or references, not top-level declarations. */
-
-static int
-demangle_nested_args (work, mangled, declp)
- struct work_stuff *work;
- const char **mangled;
- string *declp;
-{
- string* saved_previous_argument;
- int result;
- int saved_nrepeats;
-
- /* The G++ name-mangling algorithm does not remember types on nested
- argument lists, unless -fsquangling is used, and in that case the
- type vector updated by remember_type is not used. So, we turn
- off remembering of types here. */
- ++work->forgetting_types;
-
- /* For the repeat codes used with -fsquangling, we must keep track of
- the last argument. */
- saved_previous_argument = work->previous_argument;
- saved_nrepeats = work->nrepeats;
- work->previous_argument = 0;
- work->nrepeats = 0;
-
- /* Actually demangle the arguments. */
- result = demangle_args (work, mangled, declp);
-
- /* Restore the previous_argument field. */
- if (work->previous_argument)
- string_delete (work->previous_argument);
- work->previous_argument = saved_previous_argument;
- --work->forgetting_types;
- work->nrepeats = saved_nrepeats;
-
- return result;
-}
-
-static void
-demangle_function_name (work, mangled, declp, scan)
- struct work_stuff *work;
- const char **mangled;
- string *declp;
- const char *scan;
-{
- size_t i;
- string type;
- const char *tem;
-
- string_appendn (declp, (*mangled), scan - (*mangled));
- string_need (declp, 1);
- *(declp -> p) = '\0';
-
- /* Consume the function name, including the "__" separating the name
- from the signature. We are guaranteed that SCAN points to the
- separator. */
-
- (*mangled) = scan + 2;
- /* We may be looking at an instantiation of a template function:
- foo__Xt1t2_Ft3t4, where t1, t2, ... are template arguments and a
- following _F marks the start of the function arguments. Handle
- the template arguments first. */
-
- if (HP_DEMANGLING && (**mangled == 'X'))
- {
- demangle_arm_hp_template (work, mangled, 0, declp);
- /* This leaves MANGLED pointing to the 'F' marking func args */
- }
-
- if (LUCID_DEMANGLING || ARM_DEMANGLING || HP_DEMANGLING || EDG_DEMANGLING)
- {
-
- /* See if we have an ARM style constructor or destructor operator.
- If so, then just record it, clear the decl, and return.
- We can't build the actual constructor/destructor decl until later,
- when we recover the class name from the signature. */
-
- if (strcmp (declp -> b, "__ct") == 0)
- {
- work -> constructor += 1;
- string_clear (declp);
- return;
- }
- else if (strcmp (declp -> b, "__dt") == 0)
- {
- work -> destructor += 1;
- string_clear (declp);
- return;
- }
- }
-
- if (declp->p - declp->b >= 3
- && declp->b[0] == 'o'
- && declp->b[1] == 'p'
- && strchr (cplus_markers, declp->b[2]) != NULL)
- {
- /* see if it's an assignment expression */
- if (declp->p - declp->b >= 10 /* op$assign_ */
- && memcmp (declp->b + 3, "assign_", 7) == 0)
- {
- for (i = 0; i < sizeof (optable) / sizeof (optable[0]); i++)
- {
- int len = declp->p - declp->b - 10;
- if ((int) strlen (optable[i].in) == len
- && memcmp (optable[i].in, declp->b + 10, len) == 0)
- {
- string_clear (declp);
- string_append (declp, "operator");
- string_append (declp, optable[i].out);
- string_append (declp, "=");
- break;
- }
- }
- }
- else
- {
- for (i = 0; i < sizeof (optable) / sizeof (optable[0]); i++)
- {
- int len = declp->p - declp->b - 3;
- if ((int) strlen (optable[i].in) == len
- && memcmp (optable[i].in, declp->b + 3, len) == 0)
- {
- string_clear (declp);
- string_append (declp, "operator");
- string_append (declp, optable[i].out);
- break;
- }
- }
- }
- }
- else if (declp->p - declp->b >= 5 && memcmp (declp->b, "type", 4) == 0
- && strchr (cplus_markers, declp->b[4]) != NULL)
- {
- /* type conversion operator */
- tem = declp->b + 5;
- if (do_type (work, &tem, &type))
- {
- string_clear (declp);
- string_append (declp, "operator ");
- string_appends (declp, &type);
- string_delete (&type);
- }
- }
- else if (declp->b[0] == '_' && declp->b[1] == '_'
- && declp->b[2] == 'o' && declp->b[3] == 'p')
- {
- /* ANSI. */
- /* type conversion operator. */
- tem = declp->b + 4;
- if (do_type (work, &tem, &type))
- {
- string_clear (declp);
- string_append (declp, "operator ");
- string_appends (declp, &type);
- string_delete (&type);
- }
- }
- else if (declp->b[0] == '_' && declp->b[1] == '_'
- && declp->b[2] >= 'a' && declp->b[2] <= 'z'
- && declp->b[3] >= 'a' && declp->b[3] <= 'z')
- {
- if (declp->b[4] == '\0')
- {
- /* Operator. */
- for (i = 0; i < sizeof (optable) / sizeof (optable[0]); i++)
- {
- if (strlen (optable[i].in) == 2
- && memcmp (optable[i].in, declp->b + 2, 2) == 0)
- {
- string_clear (declp);
- string_append (declp, "operator");
- string_append (declp, optable[i].out);
- break;
- }
- }
- }
- else
- {
- if (declp->b[2] == 'a' && declp->b[5] == '\0')
- {
- /* Assignment. */
- for (i = 0; i < sizeof (optable) / sizeof (optable[0]); i++)
- {
- if (strlen (optable[i].in) == 3
- && memcmp (optable[i].in, declp->b + 2, 3) == 0)
- {
- string_clear (declp);
- string_append (declp, "operator");
- string_append (declp, optable[i].out);
- break;
- }
- }
- }
- }
- }
-}
-
-/* a mini string-handling package */
-
-static void
-string_need (s, n)
- string *s;
- int n;
-{
- int tem;
-
- if (s->b == NULL)
- {
- if (n < 32)
- {
- n = 32;
- }
- s->p = s->b = xmalloc (n);
- s->e = s->b + n;
- }
- else if (s->e - s->p < n)
- {
- tem = s->p - s->b;
- n += tem;
- n *= 2;
- s->b = xrealloc (s->b, n);
- s->p = s->b + tem;
- s->e = s->b + n;
- }
-}
-
-static void
-string_delete (s)
- string *s;
-{
- if (s->b != NULL)
- {
- free (s->b);
- s->b = s->e = s->p = NULL;
- }
-}
-
-static void
-string_init (s)
- string *s;
-{
- s->b = s->p = s->e = NULL;
-}
-
-static void
-string_clear (s)
- string *s;
-{
- s->p = s->b;
-}
-
-#if 0
-
-static int
-string_empty (s)
- string *s;
-{
- return (s->b == s->p);
-}
-
-#endif
-
-static void
-string_append (p, s)
- string *p;
- const char *s;
-{
- int n;
- if (s == NULL || *s == '\0')
- return;
- n = strlen (s);
- string_need (p, n);
- memcpy (p->p, s, n);
- p->p += n;
-}
-
-static void
-string_appends (p, s)
- string *p, *s;
-{
- int n;
-
- if (s->b != s->p)
- {
- n = s->p - s->b;
- string_need (p, n);
- memcpy (p->p, s->b, n);
- p->p += n;
- }
-}
-
-static void
-string_appendn (p, s, n)
- string *p;
- const char *s;
- int n;
-{
- if (n != 0)
- {
- string_need (p, n);
- memcpy (p->p, s, n);
- p->p += n;
- }
-}
-
-static void
-string_prepend (p, s)
- string *p;
- const char *s;
-{
- if (s != NULL && *s != '\0')
- {
- string_prependn (p, s, strlen (s));
- }
-}
-
-static void
-string_prepends (p, s)
- string *p, *s;
-{
- if (s->b != s->p)
- {
- string_prependn (p, s->b, s->p - s->b);
- }
-}
-
-static void
-string_prependn (p, s, n)
- string *p;
- const char *s;
- int n;
-{
- char *q;
-
- if (n != 0)
- {
- string_need (p, n);
- for (q = p->p - 1; q >= p->b; q--)
- {
- q[n] = q[0];
- }
- memcpy (p->b, s, n);
- p->p += n;
- }
-}
-
-/* To generate a standalone demangler program for testing purposes,
- just compile and link this file with -DMAIN and libiberty.a. When
- run, it demangles each command line arg, or each stdin string, and
- prints the result on stdout. */
-
-#ifdef MAIN
-
-#include "getopt.h"
-
-static char *program_name;
-static char *program_version = VERSION;
-static int flags = DMGL_PARAMS | DMGL_ANSI;
-
-static void demangle_it PARAMS ((char *));
-static void usage PARAMS ((FILE *, int));
-static void fatal PARAMS ((char *));
-
-static void
-demangle_it (mangled_name)
- char *mangled_name;
-{
- char *result;
-
- result = cplus_demangle (mangled_name, flags);
- if (result == NULL)
- {
- printf ("%s\n", mangled_name);
- }
- else
- {
- printf ("%s\n", result);
- free (result);
- }
-}
-
-static void
-usage (stream, status)
- FILE *stream;
- int status;
-{
- fprintf (stream, "\
-Usage: %s [-_] [-n] [-s {gnu,lucid,arm,hp,edg}] [--strip-underscores]\n\
- [--no-strip-underscores] [--format={gnu,lucid,arm,hp,edg}]\n\
- [--help] [--version] [arg...]\n",
- program_name);
- exit (status);
-}
-
-#define MBUF_SIZE 32767
-char mbuffer[MBUF_SIZE];
-
-/* Defined in the automatically-generated underscore.c. */
-extern int prepends_underscore;
-
-int strip_underscore = 0;
-
-static struct option long_options[] = {
- {"strip-underscores", no_argument, 0, '_'},
- {"format", required_argument, 0, 's'},
- {"help", no_argument, 0, 'h'},
- {"java", no_argument, 0, 'j'},
- {"no-strip-underscores", no_argument, 0, 'n'},
- {"version", no_argument, 0, 'v'},
- {0, no_argument, 0, 0}
-};
-
-/* More 'friendly' abort that prints the line and file.
- config.h can #define abort fancy_abort if you like that sort of thing. */
-
-void
-fancy_abort ()
-{
- fatal ("Internal gcc abort.");
-}
-
-
-/* Return the string of non-alnum characters that may occur
- as a valid symbol component, in the standard assembler symbol
- syntax. */
-
-static const char *
-standard_symbol_characters ()
-{
- return "_$.";
-}
-
-
-/* Return the string of non-alnum characters that may occur
- as a valid symbol name component in an HP object file.
-
- Note that, since HP's compiler generates object code straight from
- C++ source, without going through an assembler, its mangled
- identifiers can use all sorts of characters that no assembler would
- tolerate, so the alphabet this function creates is a little odd.
- Here are some sample mangled identifiers offered by HP:
-
- typeid*__XT24AddressIndExpClassMember_
- [Vftptr]key:__dt__32OrdinaryCompareIndExpClassMemberFv
- __ct__Q2_9Elf64_Dyn18{unnamed.union.#1}Fv
-
- This still seems really weird to me, since nowhere else in this
- file is there anything to recognize curly brackets, parens, etc.
- I've talked with Srikanth <srikanth@cup.hp.com>, and he assures me
- this is right, but I still strongly suspect that there's a
- misunderstanding here.
-
- If we decide it's better for c++filt to use HP's assembler syntax
- to scrape identifiers out of its input, here's the definition of
- the symbol name syntax from the HP assembler manual:
-
- Symbols are composed of uppercase and lowercase letters, decimal
- digits, dollar symbol, period (.), ampersand (&), pound sign(#) and
- underscore (_). A symbol can begin with a letter, digit underscore or
- dollar sign. If a symbol begins with a digit, it must contain a
- non-digit character.
-
- So have fun. */
-static const char *
-hp_symbol_characters ()
-{
- return "_$.<>#,*&[]:(){}";
-}
-
-
-int
-main (argc, argv)
- int argc;
- char **argv;
-{
- char *result;
- int c;
- char *valid_symbols;
-
- program_name = argv[0];
-
- strip_underscore = prepends_underscore;
-
- while ((c = getopt_long (argc, argv, "_ns:j", long_options, (int *) 0)) != EOF)
- {
- switch (c)
- {
- case '?':
- usage (stderr, 1);
- break;
- case 'h':
- usage (stdout, 0);
- case 'n':
- strip_underscore = 0;
- break;
- case 'v':
- printf ("GNU %s (C++ demangler), version %s\n", program_name, program_version);
- exit (0);
- case '_':
- strip_underscore = 1;
- break;
- case 'j':
- flags |= DMGL_JAVA;
- break;
- case 's':
- if (strcmp (optarg, "gnu") == 0)
- {
- current_demangling_style = gnu_demangling;
- }
- else if (strcmp (optarg, "lucid") == 0)
- {
- current_demangling_style = lucid_demangling;
- }
- else if (strcmp (optarg, "arm") == 0)
- {
- current_demangling_style = arm_demangling;
- }
- else if (strcmp (optarg, "hp") == 0)
- {
- current_demangling_style = hp_demangling;
- }
- else if (strcmp (optarg, "edg") == 0)
- {
- current_demangling_style = edg_demangling;
- }
- else
- {
- fprintf (stderr, "%s: unknown demangling style `%s'\n",
- program_name, optarg);
- exit (1);
- }
- break;
- }
- }
-
- if (optind < argc)
- {
- for ( ; optind < argc; optind++)
- {
- demangle_it (argv[optind]);
- }
- }
- else
- {
- switch (current_demangling_style)
- {
- case gnu_demangling:
- case lucid_demangling:
- case arm_demangling:
- case edg_demangling:
- valid_symbols = standard_symbol_characters ();
- break;
- case hp_demangling:
- valid_symbols = hp_symbol_characters ();
- break;
- default:
- /* Folks should explicitly indicate the appropriate alphabet for
- each demangling. Providing a default would allow the
- question to go unconsidered. */
- abort ();
- }
-
- for (;;)
- {
- int i = 0;
- c = getchar ();
- /* Try to read a label. */
- while (c != EOF && (isalnum (c) || strchr (valid_symbols, c)))
- {
- if (i >= MBUF_SIZE-1)
- break;
- mbuffer[i++] = c;
- c = getchar ();
- }
- if (i > 0)
- {
- int skip_first = 0;
-
- if (mbuffer[0] == '.')
- ++skip_first;
- if (strip_underscore && mbuffer[skip_first] == '_')
- ++skip_first;
-
- if (skip_first > i)
- skip_first = i;
-
- mbuffer[i] = 0;
-
- result = cplus_demangle (mbuffer + skip_first, flags);
- if (result)
- {
- if (mbuffer[0] == '.')
- putc ('.', stdout);
- fputs (result, stdout);
- free (result);
- }
- else
- fputs (mbuffer, stdout);
-
- fflush (stdout);
- }
- if (c == EOF)
- break;
- putchar (c);
- }
- }
-
- exit (0);
-}
-
-static void
-fatal (str)
- char *str;
-{
- fprintf (stderr, "%s: %s\n", program_name, str);
- exit (1);
-}
-
-PTR
-xmalloc (size)
- size_t size;
-{
- register PTR value = (PTR) malloc (size);
- if (value == 0)
- fatal ("virtual memory exhausted");
- return value;
-}
-
-PTR
-xrealloc (ptr, size)
- PTR ptr;
- size_t size;
-{
- register PTR value = (PTR) realloc (ptr, size);
- if (value == 0)
- fatal ("virtual memory exhausted");
- return value;
-}
-#endif /* main */
diff --git a/contrib/gcc/cpp.1 b/contrib/gcc/cpp.1
deleted file mode 100644
index 54c4dfb19832..000000000000
--- a/contrib/gcc/cpp.1
+++ /dev/null
@@ -1 +0,0 @@
-.so man1/cccp.1
diff --git a/contrib/gcc/cpp.texi b/contrib/gcc/cpp.texi
deleted file mode 100644
index ca5013795775..000000000000
--- a/contrib/gcc/cpp.texi
+++ /dev/null
@@ -1,2967 +0,0 @@
-\input texinfo
-@setfilename cpp.info
-@settitle The C Preprocessor
-
-@ifinfo
-@dircategory Programming
-@direntry
-* Cpp: (cpp). The GNU C preprocessor.
-@end direntry
-@end ifinfo
-
-@c @smallbook
-@c @cropmarks
-@c @finalout
-@setchapternewpage odd
-@ifinfo
-This file documents the GNU C Preprocessor.
-
-Copyright 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1997, 1998 Free Software
-Foundation, Inc.
-
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-
-@ignore
-Permission is granted to process this file through Tex and print the
-results, provided the printed document carries copying permission
-notice identical to this one except for the removal of this paragraph
-(this paragraph not being relevant to the printed manual).
-
-@end ignore
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided also that
-the entire resulting derived work is distributed under the terms of a
-permission notice identical to this one.
-
-Permission is granted to copy and distribute translations of this manual
-into another language, under the above conditions for modified versions.
-@end ifinfo
-
-@titlepage
-@c @finalout
-@title The C Preprocessor
-@subtitle Last revised September 1998
-@subtitle for GCC version 2
-@author Richard M. Stallman
-@page
-@vskip 2pc
-This booklet is eventually intended to form the first chapter of a GNU
-C Language manual.
-
-@vskip 0pt plus 1filll
-Copyright @copyright{} 1987, 1989, 1991-1998
-Free Software Foundation, Inc.
-
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided also that
-the entire resulting derived work is distributed under the terms of a
-permission notice identical to this one.
-
-Permission is granted to copy and distribute translations of this manual
-into another language, under the above conditions for modified versions.
-@end titlepage
-@page
-
-@node Top, Global Actions,, (DIR)
-@chapter The C Preprocessor
-
-The C preprocessor is a @dfn{macro processor} that is used automatically by
-the C compiler to transform your program before actual compilation. It is
-called a macro processor because it allows you to define @dfn{macros},
-which are brief abbreviations for longer constructs.
-
-The C preprocessor provides four separate facilities that you can use as
-you see fit:
-
-@itemize @bullet
-@item
-Inclusion of header files. These are files of declarations that can be
-substituted into your program.
-
-@item
-Macro expansion. You can define @dfn{macros}, which are abbreviations
-for arbitrary fragments of C code, and then the C preprocessor will
-replace the macros with their definitions throughout the program.
-
-@item
-Conditional compilation. Using special preprocessing directives, you
-can include or exclude parts of the program according to various
-conditions.
-
-@item
-Line control. If you use a program to combine or rearrange source files into
-an intermediate file which is then compiled, you can use line control
-to inform the compiler of where each source line originally came from.
-@end itemize
-
-C preprocessors vary in some details. This manual discusses the GNU C
-preprocessor, the C Compatible Compiler Preprocessor. The GNU C
-preprocessor provides a superset of the features of ANSI Standard C@.
-
-ANSI Standard C requires the rejection of many harmless constructs commonly
-used by today's C programs. Such incompatibility would be inconvenient for
-users, so the GNU C preprocessor is configured to accept these constructs
-by default. Strictly speaking, to get ANSI Standard C, you must use the
-options @samp{-trigraphs}, @samp{-undef} and @samp{-pedantic}, but in
-practice the consequences of having strict ANSI Standard C make it
-undesirable to do this. @xref{Invocation}.
-
-The C preprocessor is designed for C-like languages; you may run into
-problems if you apply it to other kinds of languages, because it assumes
-that it is dealing with C@. For example, the C preprocessor sometimes
-outputs extra white space to avoid inadvertent C token concatenation,
-and this may cause problems with other languages.
-
-@menu
-* Global Actions:: Actions made uniformly on all input files.
-* Directives:: General syntax of preprocessing directives.
-* Header Files:: How and why to use header files.
-* Macros:: How and why to use macros.
-* Conditionals:: How and why to use conditionals.
-* Combining Sources:: Use of line control when you combine source files.
-* Other Directives:: Miscellaneous preprocessing directives.
-* Output:: Format of output from the C preprocessor.
-* Invocation:: How to invoke the preprocessor; command options.
-* Concept Index:: Index of concepts and terms.
-* Index:: Index of directives, predefined macros and options.
-@end menu
-
-@node Global Actions, Directives, Top, Top
-@section Transformations Made Globally
-
-Most C preprocessor features are inactive unless you give specific directives
-to request their use. (Preprocessing directives are lines starting with
-@samp{#}; @pxref{Directives}). But there are three transformations that the
-preprocessor always makes on all the input it receives, even in the absence
-of directives.
-
-@itemize @bullet
-@item
-All C comments are replaced with single spaces.
-
-@item
-Backslash-Newline sequences are deleted, no matter where. This
-feature allows you to break long lines for cosmetic purposes without
-changing their meaning.
-
-@item
-Predefined macro names are replaced with their expansions
-(@pxref{Predefined}).
-@end itemize
-
-The first two transformations are done @emph{before} nearly all other parsing
-and before preprocessing directives are recognized. Thus, for example, you
-can split a line cosmetically with Backslash-Newline anywhere (except
-when trigraphs are in use; see below).
-
-@example
-/*
-*/ # /*
-*/ defi\
-ne FO\
-O 10\
-20
-@end example
-
-@noindent
-is equivalent into @samp{#define FOO 1020}. You can split even an escape
-sequence with Backslash-Newline. For example, you can split @code{"foo\bar"}
-between the @samp{\} and the @samp{b} to get
-
-@example
-"foo\\
-bar"
-@end example
-
-@noindent
-This behavior is unclean: in all other contexts, a Backslash can be
-inserted in a string constant as an ordinary character by writing a double
-Backslash, and this creates an exception. But the ANSI C standard requires
-it. (Strict ANSI C does not allow Newlines in string constants, so they
-do not consider this a problem.)
-
-But there are a few exceptions to all three transformations.
-
-@itemize @bullet
-@item
-C comments and predefined macro names are not recognized inside a
-@samp{#include} directive in which the file name is delimited with
-@samp{<} and @samp{>}.
-
-@item
-C comments and predefined macro names are never recognized within a
-character or string constant. (Strictly speaking, this is the rule,
-not an exception, but it is worth noting here anyway.)
-
-@item
-Backslash-Newline may not safely be used within an ANSI ``trigraph''.
-Trigraphs are converted before Backslash-Newline is deleted. If you
-write what looks like a trigraph with a Backslash-Newline inside, the
-Backslash-Newline is deleted as usual, but it is then too late to
-recognize the trigraph.
-
-This exception is relevant only if you use the @samp{-trigraphs}
-option to enable trigraph processing. @xref{Invocation}.
-@end itemize
-
-@node Directives, Header Files, Global Actions, Top
-@section Preprocessing Directives
-
-@cindex preprocessing directives
-@cindex directives
-Most preprocessor features are active only if you use preprocessing directives
-to request their use.
-
-Preprocessing directives are lines in your program that start with @samp{#}.
-The @samp{#} is followed by an identifier that is the @dfn{directive name}.
-For example, @samp{#define} is the directive that defines a macro.
-Whitespace is also allowed before and after the @samp{#}.
-
-The set of valid directive names is fixed. Programs cannot define new
-preprocessing directives.
-
-Some directive names require arguments; these make up the rest of the directive
-line and must be separated from the directive name by whitespace. For example,
-@samp{#define} must be followed by a macro name and the intended expansion
-of the macro. @xref{Simple Macros}.
-
-A preprocessing directive cannot be more than one line in normal circumstances.
-It may be split cosmetically with Backslash-Newline, but that has no effect
-on its meaning. Comments containing Newlines can also divide the
-directive into multiple lines, but the comments are changed to Spaces
-before the directive is interpreted. The only way a significant Newline
-can occur in a preprocessing directive is within a string constant or
-character constant. Note that
-most C compilers that might be applied to the output from the preprocessor
-do not accept string or character constants containing Newlines.
-
-The @samp{#} and the directive name cannot come from a macro expansion. For
-example, if @samp{foo} is defined as a macro expanding to @samp{define},
-that does not make @samp{#foo} a valid preprocessing directive.
-
-@node Header Files, Macros, Directives, Top
-@section Header Files
-
-@cindex header file
-A header file is a file containing C declarations and macro definitions
-(@pxref{Macros}) to be shared between several source files. You request
-the use of a header file in your program with the C preprocessing directive
-@samp{#include}.
-
-@menu
-* Header Uses:: What header files are used for.
-* Include Syntax:: How to write @samp{#include} directives.
-* Include Operation:: What @samp{#include} does.
-* Once-Only:: Preventing multiple inclusion of one header file.
-* Inheritance:: Including one header file in another header file.
-@end menu
-
-@node Header Uses, Include Syntax, Header Files, Header Files
-@subsection Uses of Header Files
-
-Header files serve two kinds of purposes.
-
-@itemize @bullet
-@item
-@findex system header files
-System header files declare the interfaces to parts of the operating
-system. You include them in your program to supply the definitions and
-declarations you need to invoke system calls and libraries.
-
-@item
-Your own header files contain declarations for interfaces between the
-source files of your program. Each time you have a group of related
-declarations and macro definitions all or most of which are needed in
-several different source files, it is a good idea to create a header
-file for them.
-@end itemize
-
-Including a header file produces the same results in C compilation as
-copying the header file into each source file that needs it. But such
-copying would be time-consuming and error-prone. With a header file, the
-related declarations appear in only one place. If they need to be changed,
-they can be changed in one place, and programs that include the header file
-will automatically use the new version when next recompiled. The header
-file eliminates the labor of finding and changing all the copies as well as
-the risk that a failure to find one copy will result in inconsistencies
-within a program.
-
-The usual convention is to give header files names that end with
-@file{.h}. Avoid unusual characters in header file names, as they
-reduce portability.
-
-@node Include Syntax, Include Operation, Header Uses, Header Files
-@subsection The @samp{#include} Directive
-
-@findex #include
-Both user and system header files are included using the preprocessing
-directive @samp{#include}. It has three variants:
-
-@table @code
-@item #include <@var{file}>
-This variant is used for system header files. It searches for a file
-named @var{file} in a list of directories specified by you, then in a
-standard list of system directories. You specify directories to
-search for header files with the command option @samp{-I}
-(@pxref{Invocation}). The option @samp{-nostdinc} inhibits searching
-the standard system directories; in this case only the directories
-you specify are searched.
-
-The parsing of this form of @samp{#include} is slightly special
-because comments are not recognized within the @samp{<@dots{}>}.
-Thus, in @samp{#include <x/*y>} the @samp{/*} does not start a comment
-and the directive specifies inclusion of a system header file named
-@file{x/*y}. Of course, a header file with such a name is unlikely to
-exist on Unix, where shell wildcard features would make it hard to
-manipulate.@refill
-
-The argument @var{file} may not contain a @samp{>} character. It may,
-however, contain a @samp{<} character.
-
-@item #include "@var{file}"
-This variant is used for header files of your own program. It
-searches for a file named @var{file} first in the current directory,
-then in the same directories used for system header files. The
-current directory is the directory of the current input file. It is
-tried first because it is presumed to be the location of the files
-that the current input file refers to. (If the @samp{-I-} option is
-used, the special treatment of the current directory is inhibited.)
-
-The argument @var{file} may not contain @samp{"} characters. If
-backslashes occur within @var{file}, they are considered ordinary text
-characters, not escape characters. None of the character escape
-sequences appropriate to string constants in C are processed. Thus,
-@samp{#include "x\n\\y"} specifies a filename containing three
-backslashes. It is not clear why this behavior is ever useful, but
-the ANSI standard specifies it.
-
-@item #include @var{anything else}
-@cindex computed @samp{#include}
-This variant is called a @dfn{computed #include}. Any @samp{#include}
-directive whose argument does not fit the above two forms is a computed
-include. The text @var{anything else} is checked for macro calls,
-which are expanded (@pxref{Macros}). When this is done, the result
-must fit one of the above two variants---in particular, the expanded
-text must in the end be surrounded by either quotes or angle braces.
-
-This feature allows you to define a macro which controls the file name
-to be used at a later point in the program. One application of this is
-to allow a site-specific configuration file for your program to specify
-the names of the system include files to be used. This can help in
-porting the program to various operating systems in which the necessary
-system header files are found in different places.
-@end table
-
-@node Include Operation, Once-Only, Include Syntax, Header Files
-@subsection How @samp{#include} Works
-
-The @samp{#include} directive works by directing the C preprocessor to scan
-the specified file as input before continuing with the rest of the current
-file. The output from the preprocessor contains the output already
-generated, followed by the output resulting from the included file,
-followed by the output that comes from the text after the @samp{#include}
-directive. For example, given a header file @file{header.h} as follows,
-
-@example
-char *test ();
-@end example
-
-@noindent
-and a main program called @file{program.c} that uses the header file,
-like this,
-
-@example
-int x;
-#include "header.h"
-
-main ()
-@{
- printf (test ());
-@}
-@end example
-
-@noindent
-the output generated by the C preprocessor for @file{program.c} as input
-would be
-
-@example
-int x;
-char *test ();
-
-main ()
-@{
- printf (test ());
-@}
-@end example
-
-Included files are not limited to declarations and macro definitions; those
-are merely the typical uses. Any fragment of a C program can be included
-from another file. The include file could even contain the beginning of a
-statement that is concluded in the containing file, or the end of a
-statement that was started in the including file. However, a comment or a
-string or character constant may not start in the included file and finish
-in the including file. An unterminated comment, string constant or
-character constant in an included file is considered to end (with an error
-message) at the end of the file.
-
-It is possible for a header file to begin or end a syntactic unit such
-as a function definition, but that would be very confusing, so don't do
-it.
-
-The line following the @samp{#include} directive is always treated as a
-separate line by the C preprocessor even if the included file lacks a final
-newline.
-
-@node Once-Only, Inheritance, Include Operation, Header Files
-@subsection Once-Only Include Files
-@cindex repeated inclusion
-@cindex including just once
-
-Very often, one header file includes another. It can easily result that a
-certain header file is included more than once. This may lead to errors,
-if the header file defines structure types or typedefs, and is certainly
-wasteful. Therefore, we often wish to prevent multiple inclusion of a
-header file.
-
-The standard way to do this is to enclose the entire real contents of the
-file in a conditional, like this:
-
-@example
-#ifndef FILE_FOO_SEEN
-#define FILE_FOO_SEEN
-
-@var{the entire file}
-
-#endif /* FILE_FOO_SEEN */
-@end example
-
-The macro @code{FILE_FOO_SEEN} indicates that the file has been included
-once already. In a user header file, the macro name should not begin
-with @samp{_}. In a system header file, this name should begin with
-@samp{__} to avoid conflicts with user programs. In any kind of header
-file, the macro name should contain the name of the file and some
-additional text, to avoid conflicts with other header files.
-
-The GNU C preprocessor is programmed to notice when a header file uses
-this particular construct and handle it efficiently. If a header file
-is contained entirely in a @samp{#ifndef} conditional, then it records
-that fact. If a subsequent @samp{#include} specifies the same file,
-and the macro in the @samp{#ifndef} is already defined, then the file
-is entirely skipped, without even reading it.
-
-@findex #pragma once
-There is also an explicit directive to tell the preprocessor that it need
-not include a file more than once. This is called @samp{#pragma once},
-and was used @emph{in addition to} the @samp{#ifndef} conditional around
-the contents of the header file. @samp{#pragma once} is now obsolete
-and should not be used at all.
-
-@findex #import
-In the Objective C language, there is a variant of @samp{#include}
-called @samp{#import} which includes a file, but does so at most once.
-If you use @samp{#import} @emph{instead of} @samp{#include}, then you
-don't need the conditionals inside the header file to prevent multiple
-execution of the contents.
-
-@samp{#import} is obsolete because it is not a well designed feature.
-It requires the users of a header file---the applications
-programmers---to know that a certain header file should only be included
-once. It is much better for the header file's implementor to write the
-file so that users don't need to know this. Using @samp{#ifndef}
-accomplishes this goal.
-
-@node Inheritance,, Once-Only, Header Files
-@subsection Inheritance and Header Files
-@cindex inheritance
-@cindex overriding a header file
-
-@dfn{Inheritance} is what happens when one object or file derives some
-of its contents by virtual copying from another object or file. In
-the case of C header files, inheritance means that one header file
-includes another header file and then replaces or adds something.
-
-If the inheriting header file and the base header file have different
-names, then inheritance is straightforward: simply write @samp{#include
-"@var{base}"} in the inheriting file.
-
-Sometimes it is necessary to give the inheriting file the same name as
-the base file. This is less straightforward.
-
-For example, suppose an application program uses the system header
-@file{sys/signal.h}, but the version of @file{/usr/include/sys/signal.h}
-on a particular system doesn't do what the application program expects.
-It might be convenient to define a ``local'' version, perhaps under the
-name @file{/usr/local/include/sys/signal.h}, to override or add to the
-one supplied by the system.
-
-You can do this by compiling with the option @samp{-I.}, and
-writing a file @file{sys/signal.h} that does what the application
-program expects. But making this file include the standard
-@file{sys/signal.h} is not so easy---writing @samp{#include
-<sys/signal.h>} in that file doesn't work, because it includes your own
-version of the file, not the standard system version. Used in that file
-itself, this leads to an infinite recursion and a fatal error in
-compilation.
-
-@samp{#include </usr/include/sys/signal.h>} would find the proper file,
-but that is not clean, since it makes an assumption about where the
-system header file is found. This is bad for maintenance, since it
-means that any change in where the system's header files are kept
-requires a change somewhere else.
-
-@findex #include_next
-The clean way to solve this problem is to use
-@samp{#include_next}, which means, ``Include the @emph{next} file with
-this name.'' This directive works like @samp{#include} except in
-searching for the specified file: it starts searching the list of header
-file directories @emph{after} the directory in which the current file
-was found.
-
-Suppose you specify @samp{-I /usr/local/include}, and the list of
-directories to search also includes @file{/usr/include}; and suppose
-both directories contain @file{sys/signal.h}. Ordinary
-@samp{#include <sys/signal.h>} finds the file under
-@file{/usr/local/include}. If that file contains @samp{#include_next
-<sys/signal.h>}, it starts searching after that directory, and finds the
-file in @file{/usr/include}.
-
-@node Macros, Conditionals, Header Files, Top
-@section Macros
-
-A macro is a sort of abbreviation which you can define once and then
-use later. There are many complicated features associated with macros
-in the C preprocessor.
-
-@menu
-* Simple Macros:: Macros that always expand the same way.
-* Argument Macros:: Macros that accept arguments that are substituted
- into the macro expansion.
-* Predefined:: Predefined macros that are always available.
-* Stringification:: Macro arguments converted into string constants.
-* Concatenation:: Building tokens from parts taken from macro arguments.
-* Undefining:: Cancelling a macro's definition.
-* Redefining:: Changing a macro's definition.
-* Macro Pitfalls:: Macros can confuse the unwary. Here we explain
- several common problems and strange features.
-@end menu
-
-@node Simple Macros, Argument Macros, Macros, Macros
-@subsection Simple Macros
-@cindex simple macro
-@cindex manifest constant
-
-A @dfn{simple macro} is a kind of abbreviation. It is a name which
-stands for a fragment of code. Some people refer to these as
-@dfn{manifest constants}.
-
-Before you can use a macro, you must @dfn{define} it explicitly with the
-@samp{#define} directive. @samp{#define} is followed by the name of the
-macro and then the code it should be an abbreviation for. For example,
-
-@example
-#define BUFFER_SIZE 1020
-@end example
-
-@noindent
-defines a macro named @samp{BUFFER_SIZE} as an abbreviation for the text
-@samp{1020}. If somewhere after this @samp{#define} directive there comes
-a C statement of the form
-
-@example
-foo = (char *) xmalloc (BUFFER_SIZE);
-@end example
-
-@noindent
-then the C preprocessor will recognize and @dfn{expand} the macro
-@samp{BUFFER_SIZE}, resulting in
-
-@example
-foo = (char *) xmalloc (1020);
-@end example
-
-The use of all upper case for macro names is a standard convention.
-Programs are easier to read when it is possible to tell at a glance which
-names are macros.
-
-Normally, a macro definition must be a single line, like all C
-preprocessing directives. (You can split a long macro definition
-cosmetically with Backslash-Newline.) There is one exception: Newlines
-can be included in the macro definition if within a string or character
-constant. This is because it is not possible for a macro definition to
-contain an unbalanced quote character; the definition automatically
-extends to include the matching quote character that ends the string or
-character constant. Comments within a macro definition may contain
-Newlines, which make no difference since the comments are entirely
-replaced with Spaces regardless of their contents.
-
-Aside from the above, there is no restriction on what can go in a macro
-body. Parentheses need not balance. The body need not resemble valid C
-code. (But if it does not, you may get error messages from the C
-compiler when you use the macro.)
-
-The C preprocessor scans your program sequentially, so macro definitions
-take effect at the place you write them. Therefore, the following input to
-the C preprocessor
-
-@example
-foo = X;
-#define X 4
-bar = X;
-@end example
-
-@noindent
-produces as output
-
-@example
-foo = X;
-
-bar = 4;
-@end example
-
-After the preprocessor expands a macro name, the macro's definition body is
-appended to the front of the remaining input, and the check for macro calls
-continues. Therefore, the macro body can contain calls to other macros.
-For example, after
-
-@example
-#define BUFSIZE 1020
-#define TABLESIZE BUFSIZE
-@end example
-
-@noindent
-the name @samp{TABLESIZE} when used in the program would go through two
-stages of expansion, resulting ultimately in @samp{1020}.
-
-This is not at all the same as defining @samp{TABLESIZE} to be @samp{1020}.
-The @samp{#define} for @samp{TABLESIZE} uses exactly the body you
-specify---in this case, @samp{BUFSIZE}---and does not check to see whether
-it too is the name of a macro. It's only when you @emph{use} @samp{TABLESIZE}
-that the result of its expansion is checked for more macro names.
-@xref{Cascaded Macros}.
-
-@node Argument Macros, Predefined, Simple Macros, Macros
-@subsection Macros with Arguments
-@cindex macros with argument
-@cindex arguments in macro definitions
-@cindex function-like macro
-
-A simple macro always stands for exactly the same text, each time it is
-used. Macros can be more flexible when they accept @dfn{arguments}.
-Arguments are fragments of code that you supply each time the macro is
-used. These fragments are included in the expansion of the macro
-according to the directions in the macro definition. A macro that
-accepts arguments is called a @dfn{function-like macro} because the
-syntax for using it looks like a function call.
-
-@findex #define
-To define a macro that uses arguments, you write a @samp{#define} directive
-with a list of @dfn{argument names} in parentheses after the name of the
-macro. The argument names may be any valid C identifiers, separated by
-commas and optionally whitespace. The open-parenthesis must follow the
-macro name immediately, with no space in between.
-
-For example, here is a macro that computes the minimum of two numeric
-values, as it is defined in many C programs:
-
-@example
-#define min(X, Y) ((X) < (Y) ? (X) : (Y))
-@end example
-
-@noindent
-(This is not the best way to define a ``minimum'' macro in GNU C@.
-@xref{Side Effects}, for more information.)
-
-To use a macro that expects arguments, you write the name of the macro
-followed by a list of @dfn{actual arguments} in parentheses, separated by
-commas. The number of actual arguments you give must match the number of
-arguments the macro expects. Examples of use of the macro @samp{min}
-include @samp{min (1, 2)} and @samp{min (x + 28, *p)}.
-
-The expansion text of the macro depends on the arguments you use.
-Each of the argument names of the macro is replaced, throughout the
-macro definition, with the corresponding actual argument. Using the
-same macro @samp{min} defined above, @samp{min (1, 2)} expands into
-
-@example
-((1) < (2) ? (1) : (2))
-@end example
-
-@noindent
-where @samp{1} has been substituted for @samp{X} and @samp{2} for @samp{Y}.
-
-Likewise, @samp{min (x + 28, *p)} expands into
-
-@example
-((x + 28) < (*p) ? (x + 28) : (*p))
-@end example
-
-Parentheses in the actual arguments must balance; a comma within
-parentheses does not end an argument. However, there is no requirement
-for brackets or braces to balance, and they do not prevent a comma from
-separating arguments. Thus,
-
-@example
-macro (array[x = y, x + 1])
-@end example
-
-@noindent
-passes two arguments to @code{macro}: @samp{array[x = y} and @samp{x +
-1]}. If you want to supply @samp{array[x = y, x + 1]} as an argument,
-you must write it as @samp{array[(x = y, x + 1)]}, which is equivalent C
-code.
-
-After the actual arguments are substituted into the macro body, the entire
-result is appended to the front of the remaining input, and the check for
-macro calls continues. Therefore, the actual arguments can contain calls
-to other macros, either with or without arguments, or even to the same
-macro. The macro body can also contain calls to other macros. For
-example, @samp{min (min (a, b), c)} expands into this text:
-
-@example
-((((a) < (b) ? (a) : (b))) < (c)
- ? (((a) < (b) ? (a) : (b)))
- : (c))
-@end example
-
-@noindent
-(Line breaks shown here for clarity would not actually be generated.)
-
-@cindex blank macro arguments
-@cindex space as macro argument
-If a macro @code{foo} takes one argument, and you want to supply an
-empty argument, you must write at least some whitespace between the
-parentheses, like this: @samp{foo ( )}. Just @samp{foo ()} is providing
-no arguments, which is an error if @code{foo} expects an argument. But
-@samp{foo0 ()} is the correct way to call a macro defined to take zero
-arguments, like this:
-
-@example
-#define foo0() @dots{}
-@end example
-
-If you use the macro name followed by something other than an
-open-parenthesis (after ignoring any spaces, tabs and comments that
-follow), it is not a call to the macro, and the preprocessor does not
-change what you have written. Therefore, it is possible for the same name
-to be a variable or function in your program as well as a macro, and you
-can choose in each instance whether to refer to the macro (if an actual
-argument list follows) or the variable or function (if an argument list
-does not follow).
-
-Such dual use of one name could be confusing and should be avoided
-except when the two meanings are effectively synonymous: that is, when the
-name is both a macro and a function and the two have similar effects. You
-can think of the name simply as a function; use of the name for purposes
-other than calling it (such as, to take the address) will refer to the
-function, while calls will expand the macro and generate better but
-equivalent code. For example, you can use a function named @samp{min} in
-the same source file that defines the macro. If you write @samp{&min} with
-no argument list, you refer to the function. If you write @samp{min (x,
-bb)}, with an argument list, the macro is expanded. If you write
-@samp{(min) (a, bb)}, where the name @samp{min} is not followed by an
-open-parenthesis, the macro is not expanded, so you wind up with a call to
-the function @samp{min}.
-
-You may not define the same name as both a simple macro and a macro with
-arguments.
-
-In the definition of a macro with arguments, the list of argument names
-must follow the macro name immediately with no space in between. If there
-is a space after the macro name, the macro is defined as taking no
-arguments, and all the rest of the line is taken to be the expansion. The
-reason for this is that it is often useful to define a macro that takes no
-arguments and whose definition begins with an identifier in parentheses.
-This rule about spaces makes it possible for you to do either this:
-
-@example
-#define FOO(x) - 1 / (x)
-@end example
-
-@noindent
-(which defines @samp{FOO} to take an argument and expand into minus the
-reciprocal of that argument) or this:
-
-@example
-#define BAR (x) - 1 / (x)
-@end example
-
-@noindent
-(which defines @samp{BAR} to take no argument and always expand into
-@samp{(x) - 1 / (x)}).
-
-Note that the @emph{uses} of a macro with arguments can have spaces before
-the left parenthesis; it's the @emph{definition} where it matters whether
-there is a space.
-
-@node Predefined, Stringification, Argument Macros, Macros
-@subsection Predefined Macros
-
-@cindex predefined macros
-Several simple macros are predefined. You can use them without giving
-definitions for them. They fall into two classes: standard macros and
-system-specific macros.
-
-@menu
-* Standard Predefined:: Standard predefined macros.
-* Nonstandard Predefined:: Nonstandard predefined macros.
-@end menu
-
-@node Standard Predefined, Nonstandard Predefined, Predefined, Predefined
-@subsubsection Standard Predefined Macros
-@cindex standard predefined macros
-
-The standard predefined macros are available with the same meanings
-regardless of the machine or operating system on which you are using GNU C@.
-Their names all start and end with double underscores. Those preceding
-@code{__GNUC__} in this table are standardized by ANSI C; the rest are
-GNU C extensions.
-
-@table @code
-@item __FILE__
-@findex __FILE__
-This macro expands to the name of the current input file, in the form of
-a C string constant. The precise name returned is the one that was
-specified in @samp{#include} or as the input file name argument.
-
-@item __LINE__
-@findex __LINE__
-This macro expands to the current input line number, in the form of a
-decimal integer constant. While we call it a predefined macro, it's
-a pretty strange macro, since its ``definition'' changes with each
-new line of source code.
-
-This and @samp{__FILE__} are useful in generating an error message to
-report an inconsistency detected by the program; the message can state
-the source line at which the inconsistency was detected. For example,
-
-@smallexample
-fprintf (stderr, "Internal error: "
- "negative string length "
- "%d at %s, line %d.",
- length, __FILE__, __LINE__);
-@end smallexample
-
-A @samp{#include} directive changes the expansions of @samp{__FILE__}
-and @samp{__LINE__} to correspond to the included file. At the end of
-that file, when processing resumes on the input file that contained
-the @samp{#include} directive, the expansions of @samp{__FILE__} and
-@samp{__LINE__} revert to the values they had before the
-@samp{#include} (but @samp{__LINE__} is then incremented by one as
-processing moves to the line after the @samp{#include}).
-
-The expansions of both @samp{__FILE__} and @samp{__LINE__} are altered
-if a @samp{#line} directive is used. @xref{Combining Sources}.
-
-@item __DATE__
-@findex __DATE__
-This macro expands to a string constant that describes the date on
-which the preprocessor is being run. The string constant contains
-eleven characters and looks like @w{@samp{"Feb 1 1996"}}.
-@c After reformatting the above, check that the date remains `Feb 1 1996',
-@c all on one line, with two spaces between the `Feb' and the `1'.
-
-@item __TIME__
-@findex __TIME__
-This macro expands to a string constant that describes the time at
-which the preprocessor is being run. The string constant contains
-eight characters and looks like @samp{"23:59:01"}.
-
-@item __STDC__
-@findex __STDC__
-This macro expands to the constant 1, to signify that this is ANSI
-Standard C@. (Whether that is actually true depends on what C compiler
-will operate on the output from the preprocessor.)
-
-On some hosts, system include files use a different convention, where
-@samp{__STDC__} is normally 0, but is 1 if the user specifies strict
-conformance to the C Standard. The preprocessor follows the host convention
-when processing system include files, but when processing user files it follows
-the usual GNU C convention.
-
-This macro is not defined if the @samp{-traditional} option is used.
-
-@item __STDC_VERSION__
-@findex __STDC_VERSION__
-This macro expands to the C Standard's version number,
-a long integer constant of the form @samp{@var{yyyy}@var{mm}L}
-where @var{yyyy} and @var{mm} are the year and month of the Standard version.
-This signifies which version of the C Standard the preprocessor conforms to.
-Like @samp{__STDC__}, whether this version number is accurate
-for the entire implementation depends on what C compiler
-will operate on the output from the preprocessor.
-
-This macro is not defined if the @samp{-traditional} option is used.
-
-@item __GNUC__
-@findex __GNUC__
-This macro is defined if and only if this is GNU C@. This macro is
-defined only when the entire GNU C compiler is in use; if you invoke the
-preprocessor directly, @samp{__GNUC__} is undefined. The value
-identifies the major version number of GNU CC (@samp{1} for GNU CC
-version 1, which is now obsolete, and @samp{2} for version 2).
-
-@item __GNUC_MINOR__
-@findex __GNUC_MINOR__
-The macro contains the minor version number of the compiler. This can
-be used to work around differences between different releases of the
-compiler (for example, if gcc 2.6.3 is known to support a feature, you
-can test for @code{__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 6)}).
-The last number, @samp{3} in the
-example above, denotes the bugfix level of the compiler; no macro
-contains this value.
-
-@item __GNUG__
-@findex __GNUG__
-The GNU C compiler defines this when the compilation language is
-C++; use @samp{__GNUG__} to distinguish between GNU C and GNU
-C++.
-
-@item __cplusplus
-@findex __cplusplus
-The draft ANSI standard for C++ used to require predefining this
-variable. Though it is no longer required, GNU C++ continues to define
-it, as do other popular C++ compilers. You can use @samp{__cplusplus}
-to test whether a header is compiled by a C compiler or a C++ compiler.
-
-@item __STRICT_ANSI__
-@findex __STRICT_ANSI__
-GNU C defines this macro if and only if the @samp{-ansi} switch was
-specified when GNU C was invoked. Its definition is the null string.
-This macro exists primarily to direct certain GNU header files not to
-define certain traditional Unix constructs which are incompatible with
-ANSI C@.
-
-@item __BASE_FILE__
-@findex __BASE_FILE__
-This macro expands to the name of the main input file, in the form
-of a C string constant. This is the source file that was specified
-as an argument when the C compiler was invoked.
-
-@item __INCLUDE_LEVEL__
-@findex __INCLUDE_LEVEL_
-This macro expands to a decimal integer constant that represents the
-depth of nesting in include files. The value of this macro is
-incremented on every @samp{#include} directive and decremented at every
-end of file. For input files specified by command line arguments,
-the nesting level is zero.
-
-@item __VERSION__
-@findex __VERSION__
-This macro expands to a string constant which describes the version number of
-GNU C@. The string is normally a sequence of decimal numbers separated
-by periods, such as @samp{"2.6.0"}.
-
-@item __OPTIMIZE__
-@findex __OPTIMIZE__
-GNU CC defines this macro in optimizing compilations. It causes certain
-GNU header files to define alternative macro definitions for some system
-library functions. You should not refer to or test the definition of
-this macro unless you make very sure that programs will execute with the
-same effect regardless.
-
-@item __CHAR_UNSIGNED__
-@findex __CHAR_UNSIGNED__
-GNU C defines this macro if and only if the data type @code{char} is
-unsigned on the target machine. It exists to cause the standard header
-file @file{limits.h} to work correctly. You should not refer to this
-macro yourself; instead, refer to the standard macros defined in
-@file{limits.h}. The preprocessor uses this macro to determine whether
-or not to sign-extend large character constants written in octal; see
-@ref{#if Directive,,The @samp{#if} Directive}.
-
-@item __REGISTER_PREFIX__
-@findex __REGISTER_PREFIX__
-This macro expands to a string (not a string constant) describing the
-prefix applied to CPU registers in assembler code. You can use it to
-write assembler code that is usable in multiple environments. For
-example, in the @samp{m68k-aout} environment it expands to the null
-string, but in the @samp{m68k-coff} environment it expands to the string
-@samp{%}.
-
-@item __USER_LABEL_PREFIX__
-@findex __USER_LABEL_PREFIX__
-Similar to @code{__REGISTER_PREFIX__}, but describes the prefix applied
-to user generated labels in assembler code. For example, in the
-@samp{m68k-aout} environment it expands to the string @samp{_}, but in
-the @samp{m68k-coff} environment it expands to the null string. This
-does not work with the @samp{-mno-underscores} option that the i386
-OSF/rose and m88k targets provide nor with the @samp{-mcall*} options of
-the rs6000 System V Release 4 target.
-@end table
-
-@node Nonstandard Predefined,, Standard Predefined, Predefined
-@subsubsection Nonstandard Predefined Macros
-
-The C preprocessor normally has several predefined macros that vary between
-machines because their purpose is to indicate what type of system and
-machine is in use. This manual, being for all systems and machines, cannot
-tell you exactly what their names are; instead, we offer a list of some
-typical ones. You can use @samp{cpp -dM} to see the values of
-predefined macros; see @ref{Invocation}.
-
-Some nonstandard predefined macros describe the operating system in use,
-with more or less specificity. For example,
-
-@table @code
-@item unix
-@findex unix
-@samp{unix} is normally predefined on all Unix systems.
-
-@item BSD
-@findex BSD
-@samp{BSD} is predefined on recent versions of Berkeley Unix
-(perhaps only in version 4.3).
-@end table
-
-Other nonstandard predefined macros describe the kind of CPU, with more or
-less specificity. For example,
-
-@table @code
-@item vax
-@findex vax
-@samp{vax} is predefined on Vax computers.
-
-@item mc68000
-@findex mc68000
-@samp{mc68000} is predefined on most computers whose CPU is a Motorola
-68000, 68010 or 68020.
-
-@item m68k
-@findex m68k
-@samp{m68k} is also predefined on most computers whose CPU is a 68000,
-68010 or 68020; however, some makers use @samp{mc68000} and some use
-@samp{m68k}. Some predefine both names. What happens in GNU C
-depends on the system you are using it on.
-
-@item M68020
-@findex M68020
-@samp{M68020} has been observed to be predefined on some systems that
-use 68020 CPUs---in addition to @samp{mc68000} and @samp{m68k}, which
-are less specific.
-
-@item _AM29K
-@findex _AM29K
-@itemx _AM29000
-@findex _AM29000
-Both @samp{_AM29K} and @samp{_AM29000} are predefined for the AMD 29000
-CPU family.
-
-@item ns32000
-@findex ns32000
-@samp{ns32000} is predefined on computers which use the National
-Semiconductor 32000 series CPU.
-@end table
-
-Yet other nonstandard predefined macros describe the manufacturer of
-the system. For example,
-
-@table @code
-@item sun
-@findex sun
-@samp{sun} is predefined on all models of Sun computers.
-
-@item pyr
-@findex pyr
-@samp{pyr} is predefined on all models of Pyramid computers.
-
-@item sequent
-@findex sequent
-@samp{sequent} is predefined on all models of Sequent computers.
-@end table
-
-These predefined symbols are not only nonstandard, they are contrary to the
-ANSI standard because their names do not start with underscores.
-Therefore, the option @samp{-ansi} inhibits the definition of these
-symbols.
-
-This tends to make @samp{-ansi} useless, since many programs depend on the
-customary nonstandard predefined symbols. Even system header files check
-them and will generate incorrect declarations if they do not find the names
-that are expected. You might think that the header files supplied for the
-Uglix computer would not need to test what machine they are running on,
-because they can simply assume it is the Uglix; but often they do, and they
-do so using the customary names. As a result, very few C programs will
-compile with @samp{-ansi}. We intend to avoid such problems on the GNU
-system.
-
-What, then, should you do in an ANSI C program to test the type of machine
-it will run on?
-
-GNU C offers a parallel series of symbols for this purpose, whose names
-are made from the customary ones by adding @samp{__} at the beginning
-and end. Thus, the symbol @code{__vax__} would be available on a Vax,
-and so on.
-
-The set of nonstandard predefined names in the GNU C preprocessor is
-controlled (when @code{cpp} is itself compiled) by the macro
-@samp{CPP_PREDEFINES}, which should be a string containing @samp{-D}
-options, separated by spaces. For example, on the Sun 3, we use the
-following definition:
-
-@example
-#define CPP_PREDEFINES "-Dmc68000 -Dsun -Dunix -Dm68k"
-@end example
-
-@noindent
-This macro is usually specified in @file{tm.h}.
-
-@node Stringification, Concatenation, Predefined, Macros
-@subsection Stringification
-
-@cindex stringification
-@dfn{Stringification} means turning a code fragment into a string constant
-whose contents are the text for the code fragment. For example,
-stringifying @samp{foo (z)} results in @samp{"foo (z)"}.
-
-In the C preprocessor, stringification is an option available when macro
-arguments are substituted into the macro definition. In the body of the
-definition, when an argument name appears, the character @samp{#} before
-the name specifies stringification of the corresponding actual argument
-when it is substituted at that point in the definition. The same argument
-may be substituted in other places in the definition without
-stringification if the argument name appears in those places with no
-@samp{#}.
-
-Here is an example of a macro definition that uses stringification:
-
-@smallexample
-@group
-#define WARN_IF(EXP) \
-do @{ if (EXP) \
- fprintf (stderr, "Warning: " #EXP "\n"); @} \
-while (0)
-@end group
-@end smallexample
-
-@noindent
-Here the actual argument for @samp{EXP} is substituted once as given,
-into the @samp{if} statement, and once as stringified, into the
-argument to @samp{fprintf}. The @samp{do} and @samp{while (0)} are
-a kludge to make it possible to write @samp{WARN_IF (@var{arg});},
-which the resemblance of @samp{WARN_IF} to a function would make
-C programmers want to do; see @ref{Swallow Semicolon}.
-
-The stringification feature is limited to transforming one macro argument
-into one string constant: there is no way to combine the argument with
-other text and then stringify it all together. But the example above shows
-how an equivalent result can be obtained in ANSI Standard C using the
-feature that adjacent string constants are concatenated as one string
-constant. The preprocessor stringifies the actual value of @samp{EXP}
-into a separate string constant, resulting in text like
-
-@smallexample
-@group
-do @{ if (x == 0) \
- fprintf (stderr, "Warning: " "x == 0" "\n"); @} \
-while (0)
-@end group
-@end smallexample
-
-@noindent
-but the C compiler then sees three consecutive string constants and
-concatenates them into one, producing effectively
-
-@smallexample
-do @{ if (x == 0) \
- fprintf (stderr, "Warning: x == 0\n"); @} \
-while (0)
-@end smallexample
-
-Stringification in C involves more than putting doublequote characters
-around the fragment; it is necessary to put backslashes in front of all
-doublequote characters, and all backslashes in string and character
-constants, in order to get a valid C string constant with the proper
-contents. Thus, stringifying @samp{p = "foo\n";} results in @samp{"p =
-\"foo\\n\";"}. However, backslashes that are not inside of string or
-character constants are not duplicated: @samp{\n} by itself stringifies to
-@samp{"\n"}.
-
-Whitespace (including comments) in the text being stringified is handled
-according to precise rules. All leading and trailing whitespace is ignored.
-Any sequence of whitespace in the middle of the text is converted to
-a single space in the stringified result.
-
-@node Concatenation, Undefining, Stringification, Macros
-@subsection Concatenation
-@cindex concatenation
-@cindex @samp{##}
-@dfn{Concatenation} means joining two strings into one. In the context
-of macro expansion, concatenation refers to joining two lexical units
-into one longer one. Specifically, an actual argument to the macro can be
-concatenated with another actual argument or with fixed text to produce
-a longer name. The longer name might be the name of a function,
-variable or type, or a C keyword; it might even be the name of another
-macro, in which case it will be expanded.
-
-When you define a macro, you request concatenation with the special
-operator @samp{##} in the macro body. When the macro is called,
-after actual arguments are substituted, all @samp{##} operators are
-deleted, and so is any whitespace next to them (including whitespace
-that was part of an actual argument). The result is to concatenate
-the syntactic tokens on either side of the @samp{##}.
-
-Consider a C program that interprets named commands. There probably needs
-to be a table of commands, perhaps an array of structures declared as
-follows:
-
-@example
-struct command
-@{
- char *name;
- void (*function) ();
-@};
-
-struct command commands[] =
-@{
- @{ "quit", quit_command@},
- @{ "help", help_command@},
- @dots{}
-@};
-@end example
-
-It would be cleaner not to have to give each command name twice, once in
-the string constant and once in the function name. A macro which takes the
-name of a command as an argument can make this unnecessary. The string
-constant can be created with stringification, and the function name by
-concatenating the argument with @samp{_command}. Here is how it is done:
-
-@example
-#define COMMAND(NAME) @{ #NAME, NAME ## _command @}
-
-struct command commands[] =
-@{
- COMMAND (quit),
- COMMAND (help),
- @dots{}
-@};
-@end example
-
-The usual case of concatenation is concatenating two names (or a name and a
-number) into a longer name. But this isn't the only valid case. It is
-also possible to concatenate two numbers (or a number and a name, such as
-@samp{1.5} and @samp{e3}) into a number. Also, multi-character operators
-such as @samp{+=} can be formed by concatenation. In some cases it is even
-possible to piece together a string constant. However, two pieces of text
-that don't together form a valid lexical unit cannot be concatenated. For
-example, concatenation with @samp{x} on one side and @samp{+} on the other
-is not meaningful because those two characters can't fit together in any
-lexical unit of C@. The ANSI standard says that such attempts at
-concatenation are undefined, but in the GNU C preprocessor it is well
-defined: it puts the @samp{x} and @samp{+} side by side with no particular
-special results.
-
-Keep in mind that the C preprocessor converts comments to whitespace before
-macros are even considered. Therefore, you cannot create a comment by
-concatenating @samp{/} and @samp{*}: the @samp{/*} sequence that starts a
-comment is not a lexical unit, but rather the beginning of a ``long'' space
-character. Also, you can freely use comments next to a @samp{##} in a
-macro definition, or in actual arguments that will be concatenated, because
-the comments will be converted to spaces at first sight, and concatenation
-will later discard the spaces.
-
-@node Undefining, Redefining, Concatenation, Macros
-@subsection Undefining Macros
-
-@cindex undefining macros
-To @dfn{undefine} a macro means to cancel its definition. This is done
-with the @samp{#undef} directive. @samp{#undef} is followed by the macro
-name to be undefined.
-
-Like definition, undefinition occurs at a specific point in the source
-file, and it applies starting from that point. The name ceases to be a
-macro name, and from that point on it is treated by the preprocessor as if
-it had never been a macro name.
-
-For example,
-
-@example
-#define FOO 4
-x = FOO;
-#undef FOO
-x = FOO;
-@end example
-
-@noindent
-expands into
-
-@example
-x = 4;
-
-x = FOO;
-@end example
-
-@noindent
-In this example, @samp{FOO} had better be a variable or function as well
-as (temporarily) a macro, in order for the result of the expansion to be
-valid C code.
-
-The same form of @samp{#undef} directive will cancel definitions with
-arguments or definitions that don't expect arguments. The @samp{#undef}
-directive has no effect when used on a name not currently defined as a macro.
-
-@node Redefining, Macro Pitfalls, Undefining, Macros
-@subsection Redefining Macros
-
-@cindex redefining macros
-@dfn{Redefining} a macro means defining (with @samp{#define}) a name that
-is already defined as a macro.
-
-A redefinition is trivial if the new definition is transparently identical
-to the old one. You probably wouldn't deliberately write a trivial
-redefinition, but they can happen automatically when a header file is
-included more than once (@pxref{Header Files}), so they are accepted
-silently and without effect.
-
-Nontrivial redefinition is considered likely to be an error, so
-it provokes a warning message from the preprocessor. However, sometimes it
-is useful to change the definition of a macro in mid-compilation. You can
-inhibit the warning by undefining the macro with @samp{#undef} before the
-second definition.
-
-In order for a redefinition to be trivial, the new definition must
-exactly match the one already in effect, with two possible exceptions:
-
-@itemize @bullet
-@item
-Whitespace may be added or deleted at the beginning or the end.
-
-@item
-Whitespace may be changed in the middle (but not inside strings).
-However, it may not be eliminated entirely, and it may not be added
-where there was no whitespace at all.
-@end itemize
-
-Recall that a comment counts as whitespace.
-
-@node Macro Pitfalls,, Redefining, Macros
-@subsection Pitfalls and Subtleties of Macros
-@cindex problems with macros
-@cindex pitfalls of macros
-
-In this section we describe some special rules that apply to macros and
-macro expansion, and point out certain cases in which the rules have
-counterintuitive consequences that you must watch out for.
-
-@menu
-* Misnesting:: Macros can contain unmatched parentheses.
-* Macro Parentheses:: Why apparently superfluous parentheses
- may be necessary to avoid incorrect grouping.
-* Swallow Semicolon:: Macros that look like functions
- but expand into compound statements.
-* Side Effects:: Unsafe macros that cause trouble when
- arguments contain side effects.
-* Self-Reference:: Macros whose definitions use the macros' own names.
-* Argument Prescan:: Actual arguments are checked for macro calls
- before they are substituted.
-* Cascaded Macros:: Macros whose definitions use other macros.
-* Newlines in Args:: Sometimes line numbers get confused.
-@end menu
-
-@node Misnesting, Macro Parentheses, Macro Pitfalls, Macro Pitfalls
-@subsubsection Improperly Nested Constructs
-
-Recall that when a macro is called with arguments, the arguments are
-substituted into the macro body and the result is checked, together with
-the rest of the input file, for more macro calls.
-
-It is possible to piece together a macro call coming partially from the
-macro body and partially from the actual arguments. For example,
-
-@example
-#define double(x) (2*(x))
-#define call_with_1(x) x(1)
-@end example
-
-@noindent
-would expand @samp{call_with_1 (double)} into @samp{(2*(1))}.
-
-Macro definitions do not have to have balanced parentheses. By writing an
-unbalanced open parenthesis in a macro body, it is possible to create a
-macro call that begins inside the macro body but ends outside of it. For
-example,
-
-@example
-#define strange(file) fprintf (file, "%s %d",
-@dots{}
-strange(stderr) p, 35)
-@end example
-
-@noindent
-This bizarre example expands to @samp{fprintf (stderr, "%s %d", p, 35)}!
-
-@node Macro Parentheses, Swallow Semicolon, Misnesting, Macro Pitfalls
-@subsubsection Unintended Grouping of Arithmetic
-@cindex parentheses in macro bodies
-
-You may have noticed that in most of the macro definition examples shown
-above, each occurrence of a macro argument name had parentheses around it.
-In addition, another pair of parentheses usually surround the entire macro
-definition. Here is why it is best to write macros that way.
-
-Suppose you define a macro as follows,
-
-@example
-#define ceil_div(x, y) (x + y - 1) / y
-@end example
-
-@noindent
-whose purpose is to divide, rounding up. (One use for this operation is
-to compute how many @samp{int} objects are needed to hold a certain
-number of @samp{char} objects.) Then suppose it is used as follows:
-
-@example
-a = ceil_div (b & c, sizeof (int));
-@end example
-
-@noindent
-This expands into
-
-@example
-a = (b & c + sizeof (int) - 1) / sizeof (int);
-@end example
-
-@noindent
-which does not do what is intended. The operator-precedence rules of
-C make it equivalent to this:
-
-@example
-a = (b & (c + sizeof (int) - 1)) / sizeof (int);
-@end example
-
-@noindent
-But what we want is this:
-
-@example
-a = ((b & c) + sizeof (int) - 1)) / sizeof (int);
-@end example
-
-@noindent
-Defining the macro as
-
-@example
-#define ceil_div(x, y) ((x) + (y) - 1) / (y)
-@end example
-
-@noindent
-provides the desired result.
-
-Unintended grouping can result in another way. Consider
-@samp{sizeof ceil_div(1, 2)}. That has the appearance of a C expression
-that would compute the size of the type of @samp{ceil_div (1, 2)}, but in
-fact it means something very different. Here is what it expands to:
-
-@example
-sizeof ((1) + (2) - 1) / (2)
-@end example
-
-@noindent
-This would take the size of an integer and divide it by two. The precedence
-rules have put the division outside the @samp{sizeof} when it was intended
-to be inside.
-
-Parentheses around the entire macro definition can prevent such problems.
-Here, then, is the recommended way to define @samp{ceil_div}:
-
-@example
-#define ceil_div(x, y) (((x) + (y) - 1) / (y))
-@end example
-
-@node Swallow Semicolon, Side Effects, Macro Parentheses, Macro Pitfalls
-@subsubsection Swallowing the Semicolon
-
-@cindex semicolons (after macro calls)
-Often it is desirable to define a macro that expands into a compound
-statement. Consider, for example, the following macro, that advances a
-pointer (the argument @samp{p} says where to find it) across whitespace
-characters:
-
-@example
-#define SKIP_SPACES(p, limit) \
-@{ register char *lim = (limit); \
- while (p != lim) @{ \
- if (*p++ != ' ') @{ \
- p--; break; @}@}@}
-@end example
-
-@noindent
-Here Backslash-Newline is used to split the macro definition, which must
-be a single line, so that it resembles the way such C code would be
-laid out if not part of a macro definition.
-
-A call to this macro might be @samp{SKIP_SPACES (p, lim)}. Strictly
-speaking, the call expands to a compound statement, which is a complete
-statement with no need for a semicolon to end it. But it looks like a
-function call. So it minimizes confusion if you can use it like a function
-call, writing a semicolon afterward, as in @samp{SKIP_SPACES (p, lim);}
-
-But this can cause trouble before @samp{else} statements, because the
-semicolon is actually a null statement. Suppose you write
-
-@example
-if (*p != 0)
- SKIP_SPACES (p, lim);
-else @dots{}
-@end example
-
-@noindent
-The presence of two statements---the compound statement and a null
-statement---in between the @samp{if} condition and the @samp{else}
-makes invalid C code.
-
-The definition of the macro @samp{SKIP_SPACES} can be altered to solve
-this problem, using a @samp{do @dots{} while} statement. Here is how:
-
-@example
-#define SKIP_SPACES(p, limit) \
-do @{ register char *lim = (limit); \
- while (p != lim) @{ \
- if (*p++ != ' ') @{ \
- p--; break; @}@}@} \
-while (0)
-@end example
-
-Now @samp{SKIP_SPACES (p, lim);} expands into
-
-@example
-do @{@dots{}@} while (0);
-@end example
-
-@noindent
-which is one statement.
-
-@node Side Effects, Self-Reference, Swallow Semicolon, Macro Pitfalls
-@subsubsection Duplication of Side Effects
-
-@cindex side effects (in macro arguments)
-@cindex unsafe macros
-Many C programs define a macro @samp{min}, for ``minimum'', like this:
-
-@example
-#define min(X, Y) ((X) < (Y) ? (X) : (Y))
-@end example
-
-When you use this macro with an argument containing a side effect,
-as shown here,
-
-@example
-next = min (x + y, foo (z));
-@end example
-
-@noindent
-it expands as follows:
-
-@example
-next = ((x + y) < (foo (z)) ? (x + y) : (foo (z)));
-@end example
-
-@noindent
-where @samp{x + y} has been substituted for @samp{X} and @samp{foo (z)}
-for @samp{Y}.
-
-The function @samp{foo} is used only once in the statement as it appears
-in the program, but the expression @samp{foo (z)} has been substituted
-twice into the macro expansion. As a result, @samp{foo} might be called
-two times when the statement is executed. If it has side effects or
-if it takes a long time to compute, the results might not be what you
-intended. We say that @samp{min} is an @dfn{unsafe} macro.
-
-The best solution to this problem is to define @samp{min} in a way that
-computes the value of @samp{foo (z)} only once. The C language offers no
-standard way to do this, but it can be done with GNU C extensions as
-follows:
-
-@example
-#define min(X, Y) \
-(@{ typeof (X) __x = (X), __y = (Y); \
- (__x < __y) ? __x : __y; @})
-@end example
-
-If you do not wish to use GNU C extensions, the only solution is to be
-careful when @emph{using} the macro @samp{min}. For example, you can
-calculate the value of @samp{foo (z)}, save it in a variable, and use that
-variable in @samp{min}:
-
-@example
-#define min(X, Y) ((X) < (Y) ? (X) : (Y))
-@dots{}
-@{
- int tem = foo (z);
- next = min (x + y, tem);
-@}
-@end example
-
-@noindent
-(where we assume that @samp{foo} returns type @samp{int}).
-
-@node Self-Reference, Argument Prescan, Side Effects, Macro Pitfalls
-@subsubsection Self-Referential Macros
-
-@cindex self-reference
-A @dfn{self-referential} macro is one whose name appears in its definition.
-A special feature of ANSI Standard C is that the self-reference is not
-considered a macro call. It is passed into the preprocessor output
-unchanged.
-
-Let's consider an example:
-
-@example
-#define foo (4 + foo)
-@end example
-
-@noindent
-where @samp{foo} is also a variable in your program.
-
-Following the ordinary rules, each reference to @samp{foo} will expand into
-@samp{(4 + foo)}; then this will be rescanned and will expand into @samp{(4
-+ (4 + foo))}; and so on until it causes a fatal error (memory full) in the
-preprocessor.
-
-However, the special rule about self-reference cuts this process short
-after one step, at @samp{(4 + foo)}. Therefore, this macro definition
-has the possibly useful effect of causing the program to add 4 to
-the value of @samp{foo} wherever @samp{foo} is referred to.
-
-In most cases, it is a bad idea to take advantage of this feature. A
-person reading the program who sees that @samp{foo} is a variable will
-not expect that it is a macro as well. The reader will come across the
-identifier @samp{foo} in the program and think its value should be that
-of the variable @samp{foo}, whereas in fact the value is four greater.
-
-The special rule for self-reference applies also to @dfn{indirect}
-self-reference. This is the case where a macro @var{x} expands to use a
-macro @samp{y}, and the expansion of @samp{y} refers to the macro
-@samp{x}. The resulting reference to @samp{x} comes indirectly from the
-expansion of @samp{x}, so it is a self-reference and is not further
-expanded. Thus, after
-
-@example
-#define x (4 + y)
-#define y (2 * x)
-@end example
-
-@noindent
-@samp{x} would expand into @samp{(4 + (2 * x))}. Clear?
-
-But suppose @samp{y} is used elsewhere, not from the definition of @samp{x}.
-Then the use of @samp{x} in the expansion of @samp{y} is not a self-reference
-because @samp{x} is not ``in progress''. So it does expand. However,
-the expansion of @samp{x} contains a reference to @samp{y}, and that
-is an indirect self-reference now because @samp{y} is ``in progress''.
-The result is that @samp{y} expands to @samp{(2 * (4 + y))}.
-
-It is not clear that this behavior would ever be useful, but it is specified
-by the ANSI C standard, so you may need to understand it.
-
-@node Argument Prescan, Cascaded Macros, Self-Reference, Macro Pitfalls
-@subsubsection Separate Expansion of Macro Arguments
-@cindex expansion of arguments
-@cindex macro argument expansion
-@cindex prescan of macro arguments
-
-We have explained that the expansion of a macro, including the substituted
-actual arguments, is scanned over again for macro calls to be expanded.
-
-What really happens is more subtle: first each actual argument text is scanned
-separately for macro calls. Then the results of this are substituted into
-the macro body to produce the macro expansion, and the macro expansion
-is scanned again for macros to expand.
-
-The result is that the actual arguments are scanned @emph{twice} to expand
-macro calls in them.
-
-Most of the time, this has no effect. If the actual argument contained
-any macro calls, they are expanded during the first scan. The result
-therefore contains no macro calls, so the second scan does not change it.
-If the actual argument were substituted as given, with no prescan,
-the single remaining scan would find the same macro calls and produce
-the same results.
-
-You might expect the double scan to change the results when a
-self-referential macro is used in an actual argument of another macro
-(@pxref{Self-Reference}): the self-referential macro would be expanded once
-in the first scan, and a second time in the second scan. But this is not
-what happens. The self-references that do not expand in the first scan are
-marked so that they will not expand in the second scan either.
-
-The prescan is not done when an argument is stringified or concatenated.
-Thus,
-
-@example
-#define str(s) #s
-#define foo 4
-str (foo)
-@end example
-
-@noindent
-expands to @samp{"foo"}. Once more, prescan has been prevented from
-having any noticeable effect.
-
-More precisely, stringification and concatenation use the argument as
-written, in un-prescanned form. The same actual argument would be used in
-prescanned form if it is substituted elsewhere without stringification or
-concatenation.
-
-@example
-#define str(s) #s lose(s)
-#define foo 4
-str (foo)
-@end example
-
-expands to @samp{"foo" lose(4)}.
-
-You might now ask, ``Why mention the prescan, if it makes no difference?
-And why not skip it and make the preprocessor faster?'' The answer is
-that the prescan does make a difference in three special cases:
-
-@itemize @bullet
-@item
-Nested calls to a macro.
-
-@item
-Macros that call other macros that stringify or concatenate.
-
-@item
-Macros whose expansions contain unshielded commas.
-@end itemize
-
-We say that @dfn{nested} calls to a macro occur when a macro's actual
-argument contains a call to that very macro. For example, if @samp{f}
-is a macro that expects one argument, @samp{f (f (1))} is a nested
-pair of calls to @samp{f}. The desired expansion is made by
-expanding @samp{f (1)} and substituting that into the definition of
-@samp{f}. The prescan causes the expected result to happen.
-Without the prescan, @samp{f (1)} itself would be substituted as
-an actual argument, and the inner use of @samp{f} would appear
-during the main scan as an indirect self-reference and would not
-be expanded. Here, the prescan cancels an undesirable side effect
-(in the medical, not computational, sense of the term) of the special
-rule for self-referential macros.
-
-But prescan causes trouble in certain other cases of nested macro calls.
-Here is an example:
-
-@example
-#define foo a,b
-#define bar(x) lose(x)
-#define lose(x) (1 + (x))
-
-bar(foo)
-@end example
-
-@noindent
-We would like @samp{bar(foo)} to turn into @samp{(1 + (foo))}, which
-would then turn into @samp{(1 + (a,b))}. But instead, @samp{bar(foo)}
-expands into @samp{lose(a,b)}, and you get an error because @code{lose}
-requires a single argument. In this case, the problem is easily solved
-by the same parentheses that ought to be used to prevent misnesting of
-arithmetic operations:
-
-@example
-#define foo (a,b)
-#define bar(x) lose((x))
-@end example
-
-The problem is more serious when the operands of the macro are not
-expressions; for example, when they are statements. Then parentheses
-are unacceptable because they would make for invalid C code:
-
-@example
-#define foo @{ int a, b; @dots{} @}
-@end example
-
-@noindent
-In GNU C you can shield the commas using the @samp{(@{@dots{}@})}
-construct which turns a compound statement into an expression:
-
-@example
-#define foo (@{ int a, b; @dots{} @})
-@end example
-
-Or you can rewrite the macro definition to avoid such commas:
-
-@example
-#define foo @{ int a; int b; @dots{} @}
-@end example
-
-There is also one case where prescan is useful. It is possible
-to use prescan to expand an argument and then stringify it---if you use
-two levels of macros. Let's add a new macro @samp{xstr} to the
-example shown above:
-
-@example
-#define xstr(s) str(s)
-#define str(s) #s
-#define foo 4
-xstr (foo)
-@end example
-
-This expands into @samp{"4"}, not @samp{"foo"}. The reason for the
-difference is that the argument of @samp{xstr} is expanded at prescan
-(because @samp{xstr} does not specify stringification or concatenation of
-the argument). The result of prescan then forms the actual argument for
-@samp{str}. @samp{str} uses its argument without prescan because it
-performs stringification; but it cannot prevent or undo the prescanning
-already done by @samp{xstr}.
-
-@node Cascaded Macros, Newlines in Args, Argument Prescan, Macro Pitfalls
-@subsubsection Cascaded Use of Macros
-
-@cindex cascaded macros
-@cindex macro body uses macro
-A @dfn{cascade} of macros is when one macro's body contains a reference
-to another macro. This is very common practice. For example,
-
-@example
-#define BUFSIZE 1020
-#define TABLESIZE BUFSIZE
-@end example
-
-This is not at all the same as defining @samp{TABLESIZE} to be @samp{1020}.
-The @samp{#define} for @samp{TABLESIZE} uses exactly the body you
-specify---in this case, @samp{BUFSIZE}---and does not check to see whether
-it too is the name of a macro.
-
-It's only when you @emph{use} @samp{TABLESIZE} that the result of its expansion
-is checked for more macro names.
-
-This makes a difference if you change the definition of @samp{BUFSIZE}
-at some point in the source file. @samp{TABLESIZE}, defined as shown,
-will always expand using the definition of @samp{BUFSIZE} that is
-currently in effect:
-
-@example
-#define BUFSIZE 1020
-#define TABLESIZE BUFSIZE
-#undef BUFSIZE
-#define BUFSIZE 37
-@end example
-
-@noindent
-Now @samp{TABLESIZE} expands (in two stages) to @samp{37}. (The
-@samp{#undef} is to prevent any warning about the nontrivial
-redefinition of @code{BUFSIZE}.)
-
-@node Newlines in Args,, Cascaded Macros, Macro Pitfalls
-@subsection Newlines in Macro Arguments
-@cindex newlines in macro arguments
-
-Traditional macro processing carries forward all newlines in macro
-arguments into the expansion of the macro. This means that, if some of
-the arguments are substituted more than once, or not at all, or out of
-order, newlines can be duplicated, lost, or moved around within the
-expansion. If the expansion consists of multiple statements, then the
-effect is to distort the line numbers of some of these statements. The
-result can be incorrect line numbers, in error messages or displayed in
-a debugger.
-
-The GNU C preprocessor operating in ANSI C mode adjusts appropriately
-for multiple use of an argument---the first use expands all the
-newlines, and subsequent uses of the same argument produce no newlines.
-But even in this mode, it can produce incorrect line numbering if
-arguments are used out of order, or not used at all.
-
-Here is an example illustrating this problem:
-
-@example
-#define ignore_second_arg(a,b,c) a; c
-
-ignore_second_arg (foo (),
- ignored (),
- syntax error);
-@end example
-
-@noindent
-The syntax error triggered by the tokens @samp{syntax error} results
-in an error message citing line four, even though the statement text
-comes from line five.
-
-@node Conditionals, Combining Sources, Macros, Top
-@section Conditionals
-
-@cindex conditionals
-In a macro processor, a @dfn{conditional} is a directive that allows a part
-of the program to be ignored during compilation, on some conditions.
-In the C preprocessor, a conditional can test either an arithmetic expression
-or whether a name is defined as a macro.
-
-A conditional in the C preprocessor resembles in some ways an @samp{if}
-statement in C, but it is important to understand the difference between
-them. The condition in an @samp{if} statement is tested during the execution
-of your program. Its purpose is to allow your program to behave differently
-from run to run, depending on the data it is operating on. The condition
-in a preprocessing conditional directive is tested when your program is compiled.
-Its purpose is to allow different code to be included in the program depending
-on the situation at the time of compilation.
-
-@menu
-* Uses: Conditional Uses. What conditionals are for.
-* Syntax: Conditional Syntax. How conditionals are written.
-* Deletion: Deleted Code. Making code into a comment.
-* Macros: Conditionals-Macros. Why conditionals are used with macros.
-* Assertions:: How and why to use assertions.
-* Errors: #error Directive. Detecting inconsistent compilation parameters.
-@end menu
-
-@node Conditional Uses
-@subsection Why Conditionals are Used
-
-Generally there are three kinds of reason to use a conditional.
-
-@itemize @bullet
-@item
-A program may need to use different code depending on the machine or
-operating system it is to run on. In some cases the code for one
-operating system may be erroneous on another operating system; for
-example, it might refer to library routines that do not exist on the
-other system. When this happens, it is not enough to avoid executing
-the invalid code: merely having it in the program makes it impossible
-to link the program and run it. With a preprocessing conditional, the
-offending code can be effectively excised from the program when it is
-not valid.
-
-@item
-You may want to be able to compile the same source file into two
-different programs. Sometimes the difference between the programs is
-that one makes frequent time-consuming consistency checks on its
-intermediate data, or prints the values of those data for debugging,
-while the other does not.
-
-@item
-A conditional whose condition is always false is a good way to exclude
-code from the program but keep it as a sort of comment for future
-reference.
-@end itemize
-
-Most simple programs that are intended to run on only one machine will
-not need to use preprocessing conditionals.
-
-@node Conditional Syntax
-@subsection Syntax of Conditionals
-
-@findex #if
-A conditional in the C preprocessor begins with a @dfn{conditional
-directive}: @samp{#if}, @samp{#ifdef} or @samp{#ifndef}.
-@xref{Conditionals-Macros}, for information on @samp{#ifdef} and
-@samp{#ifndef}; only @samp{#if} is explained here.
-
-@menu
-* If: #if Directive. Basic conditionals using @samp{#if} and @samp{#endif}.
-* Else: #else Directive. Including some text if the condition fails.
-* Elif: #elif Directive. Testing several alternative possibilities.
-@end menu
-
-@node #if Directive
-@subsubsection The @samp{#if} Directive
-
-The @samp{#if} directive in its simplest form consists of
-
-@example
-#if @var{expression}
-@var{controlled text}
-#endif /* @var{expression} */
-@end example
-
-The comment following the @samp{#endif} is not required, but it is a good
-practice because it helps people match the @samp{#endif} to the
-corresponding @samp{#if}. Such comments should always be used, except in
-short conditionals that are not nested. In fact, you can put anything at
-all after the @samp{#endif} and it will be ignored by the GNU C preprocessor,
-but only comments are acceptable in ANSI Standard C@.
-
-@var{expression} is a C expression of integer type, subject to stringent
-restrictions. It may contain
-
-@itemize @bullet
-@item
-Integer constants, which are all regarded as @code{long} or
-@code{unsigned long}.
-
-@item
-Character constants, which are interpreted according to the character
-set and conventions of the machine and operating system on which the
-preprocessor is running. The GNU C preprocessor uses the C data type
-@samp{char} for these character constants; therefore, whether some
-character codes are negative is determined by the C compiler used to
-compile the preprocessor. If it treats @samp{char} as signed, then
-character codes large enough to set the sign bit will be considered
-negative; otherwise, no character code is considered negative.
-
-@item
-Arithmetic operators for addition, subtraction, multiplication,
-division, bitwise operations, shifts, comparisons, and logical
-operations (@samp{&&} and @samp{||}).
-
-@item
-Identifiers that are not macros, which are all treated as zero(!).
-
-@item
-Macro calls. All macro calls in the expression are expanded before
-actual computation of the expression's value begins.
-@end itemize
-
-Note that @samp{sizeof} operators and @code{enum}-type values are not allowed.
-@code{enum}-type values, like all other identifiers that are not taken
-as macro calls and expanded, are treated as zero.
-
-The @var{controlled text} inside of a conditional can include
-preprocessing directives. Then the directives inside the conditional are
-obeyed only if that branch of the conditional succeeds. The text can
-also contain other conditional groups. However, the @samp{#if} and
-@samp{#endif} directives must balance.
-
-@node #else Directive
-@subsubsection The @samp{#else} Directive
-
-@findex #else
-The @samp{#else} directive can be added to a conditional to provide
-alternative text to be used if the condition is false. This is what
-it looks like:
-
-@example
-#if @var{expression}
-@var{text-if-true}
-#else /* Not @var{expression} */
-@var{text-if-false}
-#endif /* Not @var{expression} */
-@end example
-
-If @var{expression} is nonzero, and thus the @var{text-if-true} is
-active, then @samp{#else} acts like a failing conditional and the
-@var{text-if-false} is ignored. Contrariwise, if the @samp{#if}
-conditional fails, the @var{text-if-false} is considered included.
-
-@node #elif Directive
-@subsubsection The @samp{#elif} Directive
-
-@findex #elif
-One common case of nested conditionals is used to check for more than two
-possible alternatives. For example, you might have
-
-@example
-#if X == 1
-@dots{}
-#else /* X != 1 */
-#if X == 2
-@dots{}
-#else /* X != 2 */
-@dots{}
-#endif /* X != 2 */
-#endif /* X != 1 */
-@end example
-
-Another conditional directive, @samp{#elif}, allows this to be abbreviated
-as follows:
-
-@example
-#if X == 1
-@dots{}
-#elif X == 2
-@dots{}
-#else /* X != 2 and X != 1*/
-@dots{}
-#endif /* X != 2 and X != 1*/
-@end example
-
-@samp{#elif} stands for ``else if''. Like @samp{#else}, it goes in the
-middle of a @samp{#if}-@samp{#endif} pair and subdivides it; it does not
-require a matching @samp{#endif} of its own. Like @samp{#if}, the
-@samp{#elif} directive includes an expression to be tested.
-
-The text following the @samp{#elif} is processed only if the original
-@samp{#if}-condition failed and the @samp{#elif} condition succeeds.
-More than one @samp{#elif} can go in the same @samp{#if}-@samp{#endif}
-group. Then the text after each @samp{#elif} is processed only if the
-@samp{#elif} condition succeeds after the original @samp{#if} and any
-previous @samp{#elif} directives within it have failed. @samp{#else} is
-equivalent to @samp{#elif 1}, and @samp{#else} is allowed after any
-number of @samp{#elif} directives, but @samp{#elif} may not follow
-@samp{#else}.
-
-@node Deleted Code
-@subsection Keeping Deleted Code for Future Reference
-@cindex commenting out code
-
-If you replace or delete a part of the program but want to keep the old
-code around as a comment for future reference, the easy way to do this
-is to put @samp{#if 0} before it and @samp{#endif} after it. This is
-better than using comment delimiters @samp{/*} and @samp{*/} since those
-won't work if the code already contains comments (C comments do not
-nest).
-
-This works even if the code being turned off contains conditionals, but
-they must be entire conditionals (balanced @samp{#if} and @samp{#endif}).
-
-Conversely, do not use @samp{#if 0} for comments which are not C code.
-Use the comment delimiters @samp{/*} and @samp{*/} instead. The
-interior of @samp{#if 0} must consist of complete tokens; in particular,
-singlequote characters must balance. But comments often contain
-unbalanced singlequote characters (known in English as apostrophes).
-These confuse @samp{#if 0}. They do not confuse @samp{/*}.
-
-@node Conditionals-Macros
-@subsection Conditionals and Macros
-
-Conditionals are useful in connection with macros or assertions, because
-those are the only ways that an expression's value can vary from one
-compilation to another. A @samp{#if} directive whose expression uses no
-macros or assertions is equivalent to @samp{#if 1} or @samp{#if 0}; you
-might as well determine which one, by computing the value of the
-expression yourself, and then simplify the program.
-
-For example, here is a conditional that tests the expression
-@samp{BUFSIZE == 1020}, where @samp{BUFSIZE} must be a macro.
-
-@example
-#if BUFSIZE == 1020
- printf ("Large buffers!\n");
-#endif /* BUFSIZE is large */
-@end example
-
-(Programmers often wish they could test the size of a variable or data
-type in @samp{#if}, but this does not work. The preprocessor does not
-understand @code{sizeof}, or typedef names, or even the type keywords
-such as @code{int}.)
-
-@findex defined
-The special operator @samp{defined} is used in @samp{#if} expressions to
-test whether a certain name is defined as a macro. Either @samp{defined
-@var{name}} or @samp{defined (@var{name})} is an expression whose value
-is 1 if @var{name} is defined as macro at the current point in the
-program, and 0 otherwise. For the @samp{defined} operator it makes no
-difference what the definition of the macro is; all that matters is
-whether there is a definition. Thus, for example,@refill
-
-@example
-#if defined (vax) || defined (ns16000)
-@end example
-
-@noindent
-would succeed if either of the names @samp{vax} and @samp{ns16000} is
-defined as a macro. You can test the same condition using assertions
-(@pxref{Assertions}), like this:
-
-@example
-#if #cpu (vax) || #cpu (ns16000)
-@end example
-
-If a macro is defined and later undefined with @samp{#undef},
-subsequent use of the @samp{defined} operator returns 0, because
-the name is no longer defined. If the macro is defined again with
-another @samp{#define}, @samp{defined} will recommence returning 1.
-
-@findex #ifdef
-@findex #ifndef
-Conditionals that test whether just one name is defined are very common,
-so there are two special short conditional directives for this case.
-
-@table @code
-@item #ifdef @var{name}
-is equivalent to @samp{#if defined (@var{name})}.
-
-@item #ifndef @var{name}
-is equivalent to @samp{#if ! defined (@var{name})}.
-@end table
-
-Macro definitions can vary between compilations for several reasons.
-
-@itemize @bullet
-@item
-Some macros are predefined on each kind of machine. For example, on a
-Vax, the name @samp{vax} is a predefined macro. On other machines, it
-would not be defined.
-
-@item
-Many more macros are defined by system header files. Different
-systems and machines define different macros, or give them different
-values. It is useful to test these macros with conditionals to avoid
-using a system feature on a machine where it is not implemented.
-
-@item
-Macros are a common way of allowing users to customize a program for
-different machines or applications. For example, the macro
-@samp{BUFSIZE} might be defined in a configuration file for your
-program that is included as a header file in each source file. You
-would use @samp{BUFSIZE} in a preprocessing conditional in order to
-generate different code depending on the chosen configuration.
-
-@item
-Macros can be defined or undefined with @samp{-D} and @samp{-U}
-command options when you compile the program. You can arrange to
-compile the same source file into two different programs by choosing
-a macro name to specify which program you want, writing conditionals
-to test whether or how this macro is defined, and then controlling
-the state of the macro with compiler command options.
-@xref{Invocation}.
-@end itemize
-
-@ifinfo
-Assertions are usually predefined, but can be defined with preprocessor
-directives or command-line options.
-@end ifinfo
-
-@node Assertions
-@subsection Assertions
-
-@cindex assertions
-@dfn{Assertions} are a more systematic alternative to macros in writing
-conditionals to test what sort of computer or system the compiled
-program will run on. Assertions are usually predefined, but you can
-define them with preprocessing directives or command-line options.
-
-@cindex predicates
-The macros traditionally used to describe the type of target are not
-classified in any way according to which question they answer; they may
-indicate a hardware architecture, a particular hardware model, an
-operating system, a particular version of an operating system, or
-specific configuration options. These are jumbled together in a single
-namespace. In contrast, each assertion consists of a named question and
-an answer. The question is usually called the @dfn{predicate}.
-An assertion looks like this:
-
-@example
-#@var{predicate} (@var{answer})
-@end example
-
-@noindent
-You must use a properly formed identifier for @var{predicate}. The
-value of @var{answer} can be any sequence of words; all characters are
-significant except for leading and trailing whitespace, and differences
-in internal whitespace sequences are ignored. Thus, @samp{x + y} is
-different from @samp{x+y} but equivalent to @samp{x + y}. @samp{)} is
-not allowed in an answer.
-
-@cindex testing predicates
-Here is a conditional to test whether the answer @var{answer} is asserted
-for the predicate @var{predicate}:
-
-@example
-#if #@var{predicate} (@var{answer})
-@end example
-
-@noindent
-There may be more than one answer asserted for a given predicate. If
-you omit the answer, you can test whether @emph{any} answer is asserted
-for @var{predicate}:
-
-@example
-#if #@var{predicate}
-@end example
-
-@findex #system
-@findex #machine
-@findex #cpu
-Most of the time, the assertions you test will be predefined assertions.
-GNU C provides three predefined predicates: @code{system}, @code{cpu},
-and @code{machine}. @code{system} is for assertions about the type of
-software, @code{cpu} describes the type of computer architecture, and
-@code{machine} gives more information about the computer. For example,
-on a GNU system, the following assertions would be true:
-
-@example
-#system (gnu)
-#system (mach)
-#system (mach 3)
-#system (mach 3.@var{subversion})
-#system (hurd)
-#system (hurd @var{version})
-@end example
-
-@noindent
-and perhaps others. The alternatives with
-more or less version information let you ask more or less detailed
-questions about the type of system software.
-
-On a Unix system, you would find @code{#system (unix)} and perhaps one of:
-@code{#system (aix)}, @code{#system (bsd)}, @code{#system (hpux)},
-@code{#system (lynx)}, @code{#system (mach)}, @code{#system (posix)},
-@code{#system (svr3)}, @code{#system (svr4)}, or @code{#system (xpg4)}
-with possible version numbers following.
-
-Other values for @code{system} are @code{#system (mvs)}
-and @code{#system (vms)}.
-
-@strong{Portability note:} Many Unix C compilers provide only one answer
-for the @code{system} assertion: @code{#system (unix)}, if they support
-assertions at all. This is less than useful.
-
-An assertion with a multi-word answer is completely different from several
-assertions with individual single-word answers. For example, the presence
-of @code{system (mach 3.0)} does not mean that @code{system (3.0)} is true.
-It also does not directly imply @code{system (mach)}, but in GNU C, that
-last will normally be asserted as well.
-
-The current list of possible assertion values for @code{cpu} is:
-@code{#cpu (a29k)}, @code{#cpu (alpha)}, @code{#cpu (arm)}, @code{#cpu
-(clipper)}, @code{#cpu (convex)}, @code{#cpu (elxsi)}, @code{#cpu
-(tron)}, @code{#cpu (h8300)}, @code{#cpu (i370)}, @code{#cpu (i386)},
-@code{#cpu (i860)}, @code{#cpu (i960)}, @code{#cpu (m68k)}, @code{#cpu
-(m88k)}, @code{#cpu (mips)}, @code{#cpu (ns32k)}, @code{#cpu (hppa)},
-@code{#cpu (pyr)}, @code{#cpu (ibm032)}, @code{#cpu (rs6000)},
-@code{#cpu (sh)}, @code{#cpu (sparc)}, @code{#cpu (spur)}, @code{#cpu
-(tahoe)}, @code{#cpu (vax)}, @code{#cpu (we32000)}.
-
-@findex #assert
-You can create assertions within a C program using @samp{#assert}, like
-this:
-
-@example
-#assert @var{predicate} (@var{answer})
-@end example
-
-@noindent
-(Note the absence of a @samp{#} before @var{predicate}.)
-
-@cindex unassert
-@cindex assertions, undoing
-@cindex retracting assertions
-@findex #unassert
-Each time you do this, you assert a new true answer for @var{predicate}.
-Asserting one answer does not invalidate previously asserted answers;
-they all remain true. The only way to remove an assertion is with
-@samp{#unassert}. @samp{#unassert} has the same syntax as
-@samp{#assert}. You can also remove all assertions about
-@var{predicate} like this:
-
-@example
-#unassert @var{predicate}
-@end example
-
-You can also add or cancel assertions using command options
-when you run @code{gcc} or @code{cpp}. @xref{Invocation}.
-
-@node #error Directive
-@subsection The @samp{#error} and @samp{#warning} Directives
-
-@findex #error
-The directive @samp{#error} causes the preprocessor to report a fatal
-error. The rest of the line that follows @samp{#error} is used as the
-error message. The line must consist of complete tokens.
-
-You would use @samp{#error} inside of a conditional that detects a
-combination of parameters which you know the program does not properly
-support. For example, if you know that the program will not run
-properly on a Vax, you might write
-
-@smallexample
-@group
-#ifdef __vax__
-#error "Won't work on Vaxen. See comments at get_last_object."
-#endif
-@end group
-@end smallexample
-
-@noindent
-@xref{Nonstandard Predefined}, for why this works.
-
-If you have several configuration parameters that must be set up by
-the installation in a consistent way, you can use conditionals to detect
-an inconsistency and report it with @samp{#error}. For example,
-
-@smallexample
-#if HASH_TABLE_SIZE % 2 == 0 || HASH_TABLE_SIZE % 3 == 0 \
- || HASH_TABLE_SIZE % 5 == 0
-#error HASH_TABLE_SIZE should not be divisible by a small prime
-#endif
-@end smallexample
-
-@findex #warning
-The directive @samp{#warning} is like the directive @samp{#error}, but causes
-the preprocessor to issue a warning and continue preprocessing. The rest of
-the line that follows @samp{#warning} is used as the warning message.
-
-You might use @samp{#warning} in obsolete header files, with a message
-directing the user to the header file which should be used instead.
-
-@node Combining Sources, Other Directives, Conditionals, Top
-@section Combining Source Files
-
-@cindex line control
-One of the jobs of the C preprocessor is to inform the C compiler of where
-each line of C code came from: which source file and which line number.
-
-C code can come from multiple source files if you use @samp{#include};
-both @samp{#include} and the use of conditionals and macros can cause
-the line number of a line in the preprocessor output to be different
-from the line's number in the original source file. You will appreciate
-the value of making both the C compiler (in error messages) and symbolic
-debuggers such as GDB use the line numbers in your source file.
-
-The C preprocessor builds on this feature by offering a directive by which
-you can control the feature explicitly. This is useful when a file for
-input to the C preprocessor is the output from another program such as the
-@code{bison} parser generator, which operates on another file that is the
-true source file. Parts of the output from @code{bison} are generated from
-scratch, other parts come from a standard parser file. The rest are copied
-nearly verbatim from the source file, but their line numbers in the
-@code{bison} output are not the same as their original line numbers.
-Naturally you would like compiler error messages and symbolic debuggers to
-know the original source file and line number of each line in the
-@code{bison} input.
-
-@findex #line
-@code{bison} arranges this by writing @samp{#line} directives into the output
-file. @samp{#line} is a directive that specifies the original line number
-and source file name for subsequent input in the current preprocessor input
-file. @samp{#line} has three variants:
-
-@table @code
-@item #line @var{linenum}
-Here @var{linenum} is a decimal integer constant. This specifies that
-the line number of the following line of input, in its original source file,
-was @var{linenum}.
-
-@item #line @var{linenum} @var{filename}
-Here @var{linenum} is a decimal integer constant and @var{filename}
-is a string constant. This specifies that the following line of input
-came originally from source file @var{filename} and its line number there
-was @var{linenum}. Keep in mind that @var{filename} is not just a
-file name; it is surrounded by doublequote characters so that it looks
-like a string constant.
-
-@item #line @var{anything else}
-@var{anything else} is checked for macro calls, which are expanded.
-The result should be a decimal integer constant followed optionally
-by a string constant, as described above.
-@end table
-
-@samp{#line} directives alter the results of the @samp{__FILE__} and
-@samp{__LINE__} predefined macros from that point on. @xref{Standard
-Predefined}.
-
-The output of the preprocessor (which is the input for the rest of the
-compiler) contains directives that look much like @samp{#line} directives.
-They start with just @samp{#} instead of @samp{#line}, but this is
-followed by a line number and file name as in @samp{#line}. @xref{Output}.
-
-@node Other Directives, Output, Combining Sources, Top
-@section Miscellaneous Preprocessing Directives
-
-@cindex null directive
-This section describes three additional preprocessing directives. They are
-not very useful, but are mentioned for completeness.
-
-The @dfn{null directive} consists of a @samp{#} followed by a Newline, with
-only whitespace (including comments) in between. A null directive is
-understood as a preprocessing directive but has no effect on the preprocessor
-output. The primary significance of the existence of the null directive is
-that an input line consisting of just a @samp{#} will produce no output,
-rather than a line of output containing just a @samp{#}. Supposedly
-some old C programs contain such lines.
-
-@findex #pragma
-The ANSI standard specifies that the effect of the @samp{#pragma}
-directive is implementation-defined. In the GNU C preprocessor,
-@samp{#pragma} directives are not used, except for @samp{#pragma once}
-(@pxref{Once-Only}). However, they are left in the preprocessor output,
-so they are available to the compilation pass.
-
-@findex #ident
-The @samp{#ident} directive is supported for compatibility with certain
-other systems. It is followed by a line of text. On some systems, the
-text is copied into a special place in the object file; on most systems,
-the text is ignored and this directive has no effect. Typically
-@samp{#ident} is only used in header files supplied with those systems
-where it is meaningful.
-
-@node Output, Invocation, Other Directives, Top
-@section C Preprocessor Output
-
-@cindex output format
-The output from the C preprocessor looks much like the input, except
-that all preprocessing directive lines have been replaced with blank lines
-and all comments with spaces. Whitespace within a line is not altered;
-however, unless @samp{-traditional} is used, spaces may be inserted into
-the expansions of macro calls to prevent tokens from being concatenated.
-
-Source file name and line number information is conveyed by lines of
-the form
-
-@example
-# @var{linenum} @var{filename} @var{flags}
-@end example
-
-@noindent
-which are inserted as needed into the middle of the input (but never
-within a string or character constant). Such a line means that the
-following line originated in file @var{filename} at line @var{linenum}.
-
-After the file name comes zero or more flags, which are @samp{1},
-@samp{2}, @samp{3}, or @samp{4}. If there are multiple flags, spaces separate
-them. Here is what the flags mean:
-
-@table @samp
-@item 1
-This indicates the start of a new file.
-@item 2
-This indicates returning to a file (after having included another file).
-@item 3
-This indicates that the following text comes from a system header file,
-so certain warnings should be suppressed.
-@item 4
-This indicates that the following text should be treated as C@.
-@c maybe cross reference NO_IMPLICIT_EXTERN_C
-@end table
-
-@node Invocation, Concept Index, Output, Top
-@section Invoking the C Preprocessor
-@cindex invocation of the preprocessor
-
-Most often when you use the C preprocessor you will not have to invoke it
-explicitly: the C compiler will do so automatically. However, the
-preprocessor is sometimes useful on its own.
-
-The C preprocessor expects two file names as arguments, @var{infile} and
-@var{outfile}. The preprocessor reads @var{infile} together with any other
-files it specifies with @samp{#include}. All the output generated by the
-combined input files is written in @var{outfile}.
-
-Either @var{infile} or @var{outfile} may be @samp{-}, which as @var{infile}
-means to read from standard input and as @var{outfile} means to write to
-standard output. Also, if @var{outfile} or both file names are omitted,
-the standard output and standard input are used for the omitted file names.
-
-@cindex options
-Here is a table of command options accepted by the C preprocessor.
-These options can also be given when compiling a C program; they are
-passed along automatically to the preprocessor when it is invoked by the
-compiler.
-
-@table @samp
-@item -P
-@findex -P
-Inhibit generation of @samp{#}-lines with line-number information in
-the output from the preprocessor (@pxref{Output}). This might be
-useful when running the preprocessor on something that is not C code
-and will be sent to a program which might be confused by the
-@samp{#}-lines.
-
-@item -C
-@findex -C
-Do not discard comments: pass them through to the output file.
-Comments appearing in arguments of a macro call will be copied to the
-output before the expansion of the macro call.
-
-@item -traditional
-@findex -traditional
-Try to imitate the behavior of old-fashioned C, as opposed to ANSI C@.
-
-@itemize @bullet
-@item
-Traditional macro expansion pays no attention to singlequote or
-doublequote characters; macro argument symbols are replaced by the
-argument values even when they appear within apparent string or
-character constants.
-
-@item
-Traditionally, it is permissible for a macro expansion to end in the
-middle of a string or character constant. The constant continues into
-the text surrounding the macro call.
-
-@item
-However, traditionally the end of the line terminates a string or
-character constant, with no error.
-
-@item
-In traditional C, a comment is equivalent to no text at all. (In ANSI
-C, a comment counts as whitespace.)
-
-@item
-Traditional C does not have the concept of a ``preprocessing number''.
-It considers @samp{1.0e+4} to be three tokens: @samp{1.0e}, @samp{+},
-and @samp{4}.
-
-@item
-A macro is not suppressed within its own definition, in traditional C@.
-Thus, any macro that is used recursively inevitably causes an error.
-
-@item
-The character @samp{#} has no special meaning within a macro definition
-in traditional C@.
-
-@item
-In traditional C, the text at the end of a macro expansion can run
-together with the text after the macro call, to produce a single token.
-(This is impossible in ANSI C@.)
-
-@item
-Traditionally, @samp{\} inside a macro argument suppresses the syntactic
-significance of the following character.
-@end itemize
-
-@cindex Fortran
-@cindex unterminated
-Use the @samp{-traditional} option when preprocessing Fortran code,
-so that singlequotes and doublequotes
-within Fortran comment lines
-(which are generally not recognized as such by the preprocessor)
-do not cause diagnostics
-about unterminated character or string constants.
-
-However, this option does not prevent diagnostics
-about unterminated comments
-when a C-style comment appears to start, but not end,
-within Fortran-style commentary.
-
-So, the following Fortran comment lines are accepted with
-@samp{-traditional}:
-
-@smallexample
-C This isn't an unterminated character constant
-C Neither is "20000000000, an octal constant
-C in some dialects of Fortran
-@end smallexample
-
-However, this type of comment line will likely produce a diagnostic,
-or at least unexpected output from the preprocessor,
-due to the unterminated comment:
-
-@smallexample
-C Some Fortran compilers accept /* as starting
-C an inline comment.
-@end smallexample
-
-@cindex g77
-Note that @code{g77} automatically supplies
-the @samp{-traditional} option
-when it invokes the preprocessor.
-However, a future version of @code{g77}
-might use a different, more-Fortran-aware preprocessor
-in place of @code{cpp}.
-
-@item -trigraphs
-@findex -trigraphs
-Process ANSI standard trigraph sequences. These are three-character
-sequences, all starting with @samp{??}, that are defined by ANSI C to
-stand for single characters. For example, @samp{??/} stands for
-@samp{\}, so @samp{'??/n'} is a character constant for a newline.
-Strictly speaking, the GNU C preprocessor does not support all
-programs in ANSI Standard C unless @samp{-trigraphs} is used, but if
-you ever notice the difference it will be with relief.
-
-You don't want to know any more about trigraphs.
-
-@item -pedantic
-@findex -pedantic
-Issue warnings required by the ANSI C standard in certain cases such
-as when text other than a comment follows @samp{#else} or @samp{#endif}.
-
-@item -pedantic-errors
-@findex -pedantic-errors
-Like @samp{-pedantic}, except that errors are produced rather than
-warnings.
-
-@item -Wtrigraphs
-@findex -Wtrigraphs
-Warn if any trigraphs are encountered. Currently this only works if you
-have turned trigraphs on with @samp{-trigraphs} or @samp{-ansi}; in the
-future this restriction will be removed.
-
-@item -Wcomment
-@findex -Wcomment
-@ignore
-@c "Not worth documenting" both singular and plural forms of this
-@c option, per RMS. But also unclear which is better; hence may need to
-@c switch this at some future date. pesch@cygnus.com, 2jan92.
-@itemx -Wcomments
-(Both forms have the same effect).
-@end ignore
-Warn whenever a comment-start sequence @samp{/*} appears in a @samp{/*}
-comment, or whenever a Backslash-Newline appears in a @samp{//} comment.
-
-@item -Wall
-@findex -Wall
-Requests both @samp{-Wtrigraphs} and @samp{-Wcomment} (but not
-@samp{-Wtraditional} or @samp{-Wundef}).
-
-@item -Wtraditional
-@findex -Wtraditional
-Warn about certain constructs that behave differently in traditional and
-ANSI C@.
-
-@item -Wundef
-@findex -Wundef
-Warn if an undefined identifier is evaluated in an @samp{#if} directive.
-
-@item -I @var{directory}
-@findex -I
-Add the directory @var{directory} to the head of the list of
-directories to be searched for header files (@pxref{Include Syntax}).
-This can be used to override a system header file, substituting your
-own version, since these directories are searched before the system
-header file directories. If you use more than one @samp{-I} option,
-the directories are scanned in left-to-right order; the standard
-system directories come after.
-
-@item -I-
-Any directories specified with @samp{-I} options before the @samp{-I-}
-option are searched only for the case of @samp{#include "@var{file}"};
-they are not searched for @samp{#include <@var{file}>}.
-
-If additional directories are specified with @samp{-I} options after
-the @samp{-I-}, these directories are searched for all @samp{#include}
-directives.
-
-In addition, the @samp{-I-} option inhibits the use of the current
-directory as the first search directory for @samp{#include "@var{file}"}.
-Therefore, the current directory is searched only if it is requested
-explicitly with @samp{-I.}. Specifying both @samp{-I-} and @samp{-I.}
-allows you to control precisely which directories are searched before
-the current one and which are searched after.
-
-@item -nostdinc
-@findex -nostdinc
-Do not search the standard system directories for header files.
-Only the directories you have specified with @samp{-I} options
-(and the current directory, if appropriate) are searched.
-
-@item -nostdinc++
-@findex -nostdinc++
-Do not search for header files in the C++-specific standard directories,
-but do still search the other standard directories.
-(This option is used when building the C++ library.)
-
-@item -remap
-@findex -remap
-When searching for a header file in a directory, remap file names if a
-file named @file{header.gcc} exists in that directory. This can be used
-to work around limitations of file systems with file name restrictions.
-The @file{header.gcc} file should contain a series of lines with two
-tokens on each line: the first token is the name to map, and the second
-token is the actual name to use.
-
-@item -D @var{name}
-@findex -D
-Predefine @var{name} as a macro, with definition @samp{1}.
-
-@item -D @var{name}=@var{definition}
-Predefine @var{name} as a macro, with definition @var{definition}.
-There are no restrictions on the contents of @var{definition}, but if
-you are invoking the preprocessor from a shell or shell-like program you
-may need to use the shell's quoting syntax to protect characters such as
-spaces that have a meaning in the shell syntax. If you use more than
-one @samp{-D} for the same @var{name}, the rightmost definition takes
-effect.
-
-@item -U @var{name}
-@findex -U
-Do not predefine @var{name}. If both @samp{-U} and @samp{-D} are
-specified for one name, the @samp{-U} beats the @samp{-D} and the name
-is not predefined.
-
-@item -undef
-@findex -undef
-Do not predefine any nonstandard macros.
-
-@item -gcc
-@findex -gcc
-Define the macros @var{__GNUC__} and @var{__GNUC_MINOR__}. These are
-defined automatically when you use @samp{gcc -E}; you can turn them off
-in that case with @samp{-no-gcc}.
-
-@item -A @var{predicate}(@var{answer})
-@findex -A
-Make an assertion with the predicate @var{predicate} and answer
-@var{answer}. @xref{Assertions}.
-
-@noindent
-You can use @samp{-A-} to disable all predefined assertions; it also
-undefines all predefined macros and all macros that preceded it on the
-command line.
-
-@item -dM
-@findex -dM
-Instead of outputting the result of preprocessing, output a list of
-@samp{#define} directives for all the macros defined during the
-execution of the preprocessor, including predefined macros. This gives
-you a way of finding out what is predefined in your version of the
-preprocessor; assuming you have no file @samp{foo.h}, the command
-
-@example
-touch foo.h; cpp -dM foo.h
-@end example
-
-@noindent
-will show the values of any predefined macros.
-
-@item -dD
-@findex -dD
-Like @samp{-dM} except in two respects: it does @emph{not} include the
-predefined macros, and it outputs @emph{both} the @samp{#define}
-directives and the result of preprocessing. Both kinds of output go to
-the standard output file.
-
-@item -dI
-@findex -dI
-Output @samp{#include} directives in addition to the result of preprocessing.
-
-@item -M [-MG]
-@findex -M
-Instead of outputting the result of preprocessing, output a rule
-suitable for @code{make} describing the dependencies of the main
-source file. The preprocessor outputs one @code{make} rule containing
-the object file name for that source file, a colon, and the names of
-all the included files. If there are many included files then the
-rule is split into several lines using @samp{\}-newline.
-
-@samp{-MG} says to treat missing header files as generated files and assume
-they live in the same directory as the source file. It must be specified
-in addition to @samp{-M}.
-
-This feature is used in automatic updating of makefiles.
-
-@item -MM [-MG]
-@findex -MM
-Like @samp{-M} but mention only the files included with @samp{#include
-"@var{file}"}. System header files included with @samp{#include
-<@var{file}>} are omitted.
-
-@item -MD @var{file}
-@findex -MD
-Like @samp{-M} but the dependency information is written to @var{file}.
-This is in addition to compiling the file as specified---@samp{-MD} does
-not inhibit ordinary compilation the way @samp{-M} does.
-
-When invoking @code{gcc}, do not specify the @var{file} argument.
-@code{gcc} will create file names made by replacing ".c" with ".d" at
-the end of the input file names.
-
-In Mach, you can use the utility @code{md} to merge multiple dependency
-files into a single dependency file suitable for using with the @samp{make}
-command.
-
-@item -MMD @var{file}
-@findex -MMD
-Like @samp{-MD} except mention only user header files, not system
-header files.
-
-@item -H
-@findex -H
-Print the name of each header file used, in addition to other normal
-activities.
-
-@item -imacros @var{file}
-@findex -imacros
-Process @var{file} as input, discarding the resulting output, before
-processing the regular input file. Because the output generated from
-@var{file} is discarded, the only effect of @samp{-imacros @var{file}}
-is to make the macros defined in @var{file} available for use in the
-main input.
-
-@item -include @var{file}
-@findex -include
-Process @var{file} as input, and include all the resulting output,
-before processing the regular input file.
-
-@item -idirafter @var{dir}
-@findex -idirafter
-@cindex second include path
-Add the directory @var{dir} to the second include path. The directories
-on the second include path are searched when a header file is not found
-in any of the directories in the main include path (the one that
-@samp{-I} adds to).
-
-@item -iprefix @var{prefix}
-@findex -iprefix
-Specify @var{prefix} as the prefix for subsequent @samp{-iwithprefix}
-options.
-
-@item -iwithprefix @var{dir}
-@findex -iwithprefix
-Add a directory to the second include path. The directory's name is
-made by concatenating @var{prefix} and @var{dir}, where @var{prefix}
-was specified previously with @samp{-iprefix}.
-
-@item -isystem @var{dir}
-@findex -isystem
-Add a directory to the beginning of the second include path, marking it
-as a system directory, so that it gets the same special treatment as
-is applied to the standard system directories.
-
-@item -x c
-@itemx -x c++
-@itemx -x objective-c
-@itemx -x assembler-with-cpp
-@findex -x c
-@findex -x objective-c
-@findex -x assembler-with-cpp
-Specify the source language: C, C++, Objective-C, or assembly. This has
-nothing to do with standards conformance or extensions; it merely
-selects which base syntax to expect. If you give none of these options,
-cpp will deduce the language from the extension of the source file:
-@samp{.c}, @samp{.cc}, @samp{.m}, or @samp{.S}. Some other common
-extensions for C++ and assembly are also recognized. If cpp does not
-recognize the extension, it will treat the file as C; this is the most
-generic mode.
-
-@strong{Note:} Previous versions of cpp accepted a @samp{-lang} option
-which selected both the language and the standards conformance level.
-This option has been removed, because it conflicts with the @samp{-l}
-option.
-
-@item -std=@var{standard}
-@itemx -ansi
-@findex -std
-@findex -ansi
-Specify the standard to which the code should conform. Currently cpp
-only knows about the standards for C; other language standards will be
-added in the future.
-
-@var{standard}
-may be one of:
-@table @code
-@item iso9899:1990
-The ISO C standard from 1990.
-
-@item iso9899:199409
-@itemx c89
-The 1990 C standard, as amended in 1994. @samp{c89} is the customary
-shorthand for this version of the standard.
-
-The @samp{-ansi} option is equivalent to @samp{-std=c89}.
-
-@item iso9899:199x
-@itemx c9x
-The revised ISO C standard, which is expected to be promulgated some
-time in 1999. It has not been approved yet, hence the @samp{x}.
-
-@item gnu89
-The 1990 C standard plus GNU extensions. This is the default.
-
-@item gnu9x
-The 199x C standard plus GNU extensions.
-@end table
-
-@item -Wp,-lint
-@findex -lint
-Look for commands to the program checker @code{lint} embedded in
-comments, and emit them preceded by @samp{#pragma lint}. For example,
-the comment @samp{/* NOTREACHED */} becomes @samp{#pragma lint
-NOTREACHED}.
-
-Because of the clash with @samp{-l}, you must use the awkward syntax
-above. In a future release, this option will be replaced by
-@samp{-flint} or @samp{-Wlint}; we are not sure which yet.
-
-@item -$
-@findex -$
-Forbid the use of @samp{$} in identifiers. The C standard does not
-permit this, but it is a common extension.
-
-@end table
-
-@node Concept Index, Index, Invocation, Top
-@unnumbered Concept Index
-@printindex cp
-
-@node Index,, Concept Index, Top
-@unnumbered Index of Directives, Macros and Options
-@printindex fn
-
-@contents
-@bye
diff --git a/contrib/gcc/cppalloc.c b/contrib/gcc/cppalloc.c
deleted file mode 100644
index 5c96aff7cb81..000000000000
--- a/contrib/gcc/cppalloc.c
+++ /dev/null
@@ -1,81 +0,0 @@
-/* Part of CPP library. (memory allocation - xmalloc etc)
- Copyright (C) 1986, 87, 89, 92, 93, 94, 1995, 1998 Free Software Foundation, Inc.
- Written by Per Bothner, 1994.
- Based on CCCP program by Paul Rubin, June 1986
- Adapted to ANSI C, Richard Stallman, Jan 1987
-
-This program 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 program 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 program; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
- In other words, you are welcome to use, share and improve this program.
- You are forbidden to forbid anyone else to use, share and improve
- what you give them. Help stamp out software-hoarding! */
-
-#include "config.h"
-#include "system.h"
-#include "cpplib.h"
-
-static void memory_full PROTO ((void)) ATTRIBUTE_NORETURN;
-
-static void
-memory_full ()
-{
- cpp_notice ("%s: Memory exhausted.\n", progname);
- exit (FATAL_EXIT_CODE);
-}
-
-PTR
-xmalloc (size)
- size_t size;
-{
- register PTR ptr = (PTR) malloc (size);
- if (ptr == 0)
- memory_full ();
- return ptr;
-}
-
-PTR
-xcalloc (number, size)
- size_t number, size;
-{
- register PTR ptr = (PTR) calloc (number, size);
- if (ptr == 0)
- memory_full ();
- return ptr;
-}
-
-PTR
-xrealloc (old, size)
- PTR old;
- size_t size;
-{
- register PTR ptr;
- if (old)
- ptr = (PTR) realloc (old, size);
- else
- ptr = (PTR) malloc (size);
- if (ptr == 0)
- memory_full ();
- return ptr;
-}
-
-char *
-xstrdup (input)
- const char *input;
-{
- unsigned size = strlen (input);
- char *output = xmalloc (size + 1);
- strcpy (output, input);
- return output;
-}
diff --git a/contrib/gcc/cppulp.c b/contrib/gcc/cppulp.c
deleted file mode 100644
index 7e7457c68c08..000000000000
--- a/contrib/gcc/cppulp.c
+++ /dev/null
@@ -1,26 +0,0 @@
-/* CPP Library.
- Copyright (C) 1986, 87, 89, 92-98, 1999 Free Software Foundation, Inc.
- Contributed by Per Bothner, 1994-95.
- Based on CCCP program by Paul Rubin, June 1986
- Adapted to ANSI C, Richard Stallman, Jan 1987
-
-This program 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 program 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 program; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#include "config.h"
-#include "system.h"
-
-#include "output.h"
-
-const char *user_label_prefix = 0;
diff --git a/contrib/gcc/cross-make b/contrib/gcc/cross-make
deleted file mode 100644
index 84be67fd605b..000000000000
--- a/contrib/gcc/cross-make
+++ /dev/null
@@ -1,14 +0,0 @@
-# Build libgcc1.a for a cross-compiler.
-# By default this expects the user to provide libgcc1.a,
-# and gives up immediately if the user has not done so.
-LIBGCC1 = $(CROSS_LIBGCC1)
-
-# Dir to search for system headers. Normally /usr/include.
-# Use CROSS_INCLUDE_DIR not TOOL_INCLUDE_DIR for other vendor's headers.
-SYSTEM_HEADER_DIR = $(tooldir)/sys-include
-
-# Don't try to compile the things we can't compile.
-ALL = all.cross
-
-# Don't install assert.h in /usr/local/include.
-assertdir = $(tooldir)/include
diff --git a/contrib/gcc/demangle.h b/contrib/gcc/demangle.h
deleted file mode 100644
index 63fe5e2adf4f..000000000000
--- a/contrib/gcc/demangle.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/* Defs for interface to demanglers.
- Copyright 1992, 1995, 1996 Free Software Foundation, Inc.
-
- This program 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 program 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 program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-
-#if !defined (DEMANGLE_H)
-#define DEMANGLE_H
-
-#include <ansidecl.h>
-
-/* Options passed to cplus_demangle (in 2nd parameter). */
-
-#define DMGL_NO_OPTS 0 /* For readability... */
-#define DMGL_PARAMS (1 << 0) /* Include function args */
-#define DMGL_ANSI (1 << 1) /* Include const, volatile, etc */
-#define DMGL_JAVA (1 << 2) /* Demangle as Java rather than C++. */
-
-#define DMGL_AUTO (1 << 8)
-#define DMGL_GNU (1 << 9)
-#define DMGL_LUCID (1 << 10)
-#define DMGL_ARM (1 << 11)
-#define DMGL_HP (1 << 12) /* For the HP aCC compiler; same as ARM
- except for template arguments, etc. */
-#define DMGL_EDG (1 << 13)
-
-/* If none of these are set, use 'current_demangling_style' as the default. */
-#define DMGL_STYLE_MASK (DMGL_AUTO|DMGL_GNU|DMGL_LUCID|DMGL_ARM|DMGL_HP|DMGL_EDG)
-
-/* Enumeration of possible demangling styles.
-
- Lucid and ARM styles are still kept logically distinct, even though
- they now both behave identically. The resulting style is actual the
- union of both. I.E. either style recognizes both "__pt__" and "__rf__"
- for operator "->", even though the first is lucid style and the second
- is ARM style. (FIXME?) */
-
-extern enum demangling_styles
-{
- unknown_demangling = 0,
- auto_demangling = DMGL_AUTO,
- gnu_demangling = DMGL_GNU,
- lucid_demangling = DMGL_LUCID,
- arm_demangling = DMGL_ARM,
- hp_demangling = DMGL_HP,
- edg_demangling = DMGL_EDG
-} current_demangling_style;
-
-/* Define string names for the various demangling styles. */
-
-#define AUTO_DEMANGLING_STYLE_STRING "auto"
-#define GNU_DEMANGLING_STYLE_STRING "gnu"
-#define LUCID_DEMANGLING_STYLE_STRING "lucid"
-#define ARM_DEMANGLING_STYLE_STRING "arm"
-#define HP_DEMANGLING_STYLE_STRING "hp"
-#define EDG_DEMANGLING_STYLE_STRING "edg"
-
-/* Some macros to test what demangling style is active. */
-
-#define CURRENT_DEMANGLING_STYLE current_demangling_style
-#define AUTO_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_AUTO)
-#define GNU_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_GNU)
-#define LUCID_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_LUCID)
-#define ARM_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_ARM)
-#define HP_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_HP)
-#define EDG_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_EDG)
-
-extern char *
-cplus_demangle PARAMS ((const char *mangled, int options));
-
-extern int
-cplus_demangle_opname PARAMS ((const char *opname, char *result, int options));
-
-extern const char *
-cplus_mangle_opname PARAMS ((const char *opname, int options));
-
-/* Note: This sets global state. FIXME if you care about multi-threading. */
-
-extern void
-set_cplus_marker_for_demangling PARAMS ((int ch));
-
-#endif /* DEMANGLE_H */
diff --git a/contrib/gcc/doprint.c b/contrib/gcc/doprint.c
deleted file mode 100644
index 2dc4ddef9761..000000000000
--- a/contrib/gcc/doprint.c
+++ /dev/null
@@ -1,295 +0,0 @@
-/* Provide a version _doprnt in terms of fprintf.
- Copyright (C) 1998 Free Software Foundation, Inc.
- Contributed by Kaveh Ghazi (ghazi@caip.rutgers.edu) 3/29/98
-
-This program 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 program 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 program; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
- */
-
-#include "config.h"
-#include "system.h"
-#undef _doprnt
-
-#ifdef TEST /* Make sure to use the internal one. */
-#define _doprnt my_doprnt
-#endif
-
-#define COPY_VA_INT \
- do { \
- const int value = abs (va_arg (ap, int)); \
- char buf[32]; \
- ptr++; /* Go past the asterisk. */ \
- *sptr = '\0'; /* NULL terminate sptr. */ \
- sprintf(buf, "%d", value); \
- strcat(sptr, buf); \
- while (*sptr) sptr++; \
- } while (0)
-
-#define PRINT_CHAR(CHAR) \
- do { \
- putc(CHAR, stream); \
- ptr++; \
- total_printed++; \
- continue; \
- } while (0)
-
-#define PRINT_TYPE(TYPE) \
- do { \
- int result; \
- TYPE value = va_arg (ap, TYPE); \
- *sptr++ = *ptr++; /* Copy the type specifier. */ \
- *sptr = '\0'; /* NULL terminate sptr. */ \
- result = fprintf(stream, specifier, value); \
- if (result == -1) \
- return -1; \
- else \
- { \
- total_printed += result; \
- continue; \
- } \
- } while (0)
-
-int
-_doprnt (format, ap, stream)
- const char * format;
- va_list ap;
- FILE * stream;
-{
- const char * ptr = format;
- char specifier[128];
- int total_printed = 0;
-
- while (*ptr != '\0')
- {
- if (*ptr != '%') /* While we have regular characters, print them. */
- PRINT_CHAR(*ptr);
- else /* We got a format specifier! */
- {
- char * sptr = specifier;
- int wide_width = 0, short_width = 0;
-
- *sptr++ = *ptr++; /* Copy the % and move forward. */
-
- while (strchr ("-+ #0", *ptr)) /* Move past flags. */
- *sptr++ = *ptr++;
-
- if (*ptr == '*')
- COPY_VA_INT;
- else
- while (isdigit(*ptr)) /* Handle explicit numeric value. */
- *sptr++ = *ptr++;
-
- if (*ptr == '.')
- {
- *sptr++ = *ptr++; /* Copy and go past the period. */
- if (*ptr == '*')
- COPY_VA_INT;
- else
- while (isdigit(*ptr)) /* Handle explicit numeric value. */
- *sptr++ = *ptr++;
- }
- while (strchr ("hlL", *ptr))
- {
- switch (*ptr)
- {
- case 'h':
- short_width = 1;
- break;
- case 'l':
- wide_width++;
- break;
- case 'L':
- wide_width = 2;
- break;
- default:
- abort();
- }
- *sptr++ = *ptr++;
- }
-
- switch (*ptr)
- {
- case 'd':
- case 'i':
- case 'o':
- case 'u':
- case 'x':
- case 'X':
- case 'c':
- {
- /* Short values are promoted to int, so just copy it
- as an int and trust the C library printf to cast it
- to the right width. */
- if (short_width)
- PRINT_TYPE(int);
- else
- {
- switch (wide_width)
- {
- case 0:
- PRINT_TYPE(int);
- break;
- case 1:
- PRINT_TYPE(long);
- break;
- case 2:
- default:
-#if defined(__GNUC__) || defined(HAVE_LONG_LONG)
- PRINT_TYPE(long long);
-#else
- PRINT_TYPE(long); /* Fake it and hope for the best. */
-#endif
- break;
- } /* End of switch (wide_width) */
- } /* End of else statement */
- } /* End of integer case */
- break;
- case 'f':
- case 'e':
- case 'E':
- case 'g':
- case 'G':
- {
- if (wide_width == 0)
- PRINT_TYPE(double);
- else
- {
-#if defined(__GNUC__) || defined(HAVE_LONG_DOUBLE)
- PRINT_TYPE(long double);
-#else
- PRINT_TYPE(double); /* Fake it and hope for the best. */
-#endif
- }
- }
- break;
- case 's':
- PRINT_TYPE(char *);
- break;
- case 'p':
- PRINT_TYPE(void *);
- break;
- case '%':
- PRINT_CHAR('%');
- break;
- default:
- abort();
- } /* End of switch (*ptr) */
- } /* End of else statement */
- }
-
- return total_printed;
-}
-
-#ifdef TEST
-
-#include <math.h>
-#ifndef M_PI
-#define M_PI (3.1415926535897932385)
-#endif
-
-#define RESULT(x) do \
-{ \
- int i = (x); \
- printf ("printed %d characters\n", i); \
- fflush(stdin); \
-} while (0)
-
-static int checkit PVPROTO ((const char * format, ...)) ATTRIBUTE_PRINTF_1;
-
-static int
-checkit VPROTO ((const char* format, ...))
-{
- va_list args;
- int result;
-
-#ifndef ANSI_PROTOTYPES
- char *format;
-#endif
-
- VA_START (args, format);
-
-#ifndef ANSI_PROTOTYPES
- format = va_arg (args, char *);
-#endif
-
- result = _doprnt (format, args, stdout);
- va_end(args);
-
- return result;
-}
-
-int
-main ()
-{
- RESULT(checkit ("<%d>\n", 0x12345678));
- RESULT(printf ("<%d>\n", 0x12345678));
-
- RESULT(checkit ("<%200d>\n", 5));
- RESULT(printf ("<%200d>\n", 5));
-
- RESULT(checkit ("<%.300d>\n", 6));
- RESULT(printf ("<%.300d>\n", 6));
-
- RESULT(checkit ("<%100.150d>\n", 7));
- RESULT(printf ("<%100.150d>\n", 7));
-
- RESULT(checkit ("<%s>\n",
- "jjjjjjjjjiiiiiiiiiiiiiiioooooooooooooooooppppppppppppaa\n\
-777777777777777777333333333333366666666666622222222222777777777777733333"));
- RESULT(printf ("<%s>\n",
- "jjjjjjjjjiiiiiiiiiiiiiiioooooooooooooooooppppppppppppaa\n\
-777777777777777777333333333333366666666666622222222222777777777777733333"));
-
- RESULT(checkit ("<%f><%0+#f>%s%d%s>\n",
- 1.0, 1.0, "foo", 77, "asdjffffffffffffffiiiiiiiiiiixxxxx"));
- RESULT(printf ("<%f><%0+#f>%s%d%s>\n",
- 1.0, 1.0, "foo", 77, "asdjffffffffffffffiiiiiiiiiiixxxxx"));
-
- RESULT(checkit ("<%4f><%.4f><%%><%4.4f>\n", M_PI, M_PI, M_PI));
- RESULT(printf ("<%4f><%.4f><%%><%4.4f>\n", M_PI, M_PI, M_PI));
-
- RESULT(checkit ("<%*f><%.*f><%%><%*.*f>\n", 3, M_PI, 3, M_PI, 3, 3, M_PI));
- RESULT(printf ("<%*f><%.*f><%%><%*.*f>\n", 3, M_PI, 3, M_PI, 3, 3, M_PI));
-
- RESULT(checkit ("<%d><%i><%o><%u><%x><%X><%c>\n",
- 75, 75, 75, 75, 75, 75, 75));
- RESULT(printf ("<%d><%i><%o><%u><%x><%X><%c>\n",
- 75, 75, 75, 75, 75, 75, 75));
-
- RESULT(checkit ("<%d><%i><%o><%u><%x><%X><%c>\n",
- 75, 75, 75, 75, 75, 75, 75));
- RESULT(printf ("<%d><%i><%o><%u><%x><%X><%c>\n",
- 75, 75, 75, 75, 75, 75, 75));
-
- RESULT(checkit ("Testing (hd) short: <%d><%ld><%hd><%hd><%d>\n", 123, (long)234, 345, 123456789, 456));
- RESULT(printf ("Testing (hd) short: <%d><%ld><%hd><%hd><%d>\n", 123, (long)234, 345, 123456789, 456));
-
-#if defined(__GNUC__) || defined (HAVE_LONG_LONG)
- RESULT(checkit ("Testing (lld) long long: <%d><%lld><%d>\n", 123, 234234234234234234LL, 345));
- RESULT(printf ("Testing (lld) long long: <%d><%lld><%d>\n", 123, 234234234234234234LL, 345));
- RESULT(checkit ("Testing (Ld) long long: <%d><%Ld><%d>\n", 123, 234234234234234234LL, 345));
- RESULT(printf ("Testing (Ld) long long: <%d><%Ld><%d>\n", 123, 234234234234234234LL, 345));
-#endif
-
-#if defined(__GNUC__) || defined (HAVE_LONG_DOUBLE)
- RESULT(checkit ("Testing (Lf) long double: <%.20f><%.20Lf><%0+#.20f>\n",
- 1.23456, 1.234567890123456789L, 1.23456));
- RESULT(printf ("Testing (Lf) long double: <%.20f><%.20Lf><%0+#.20f>\n",
- 1.23456, 1.234567890123456789L, 1.23456));
-#endif
-
- return 0;
-}
-#endif /* TEST */
diff --git a/contrib/gcc/dostage2 b/contrib/gcc/dostage2
deleted file mode 100755
index bb33f7dc27ed..000000000000
--- a/contrib/gcc/dostage2
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-make -k LANGUAGES=c $1 CC=stage1/xgcc XCFLAGS=-Bstage1/ CFLAGS="-g $2" >log2 2>&1
diff --git a/contrib/gcc/dostage3 b/contrib/gcc/dostage3
deleted file mode 100755
index 21f17fc11c7b..000000000000
--- a/contrib/gcc/dostage3
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-make -k LANGUAGES=c $1 CC=stage2/xgcc XCFLAGS=-Bstage2/ CFLAGS="-g $2" >log3 2>&1
-
diff --git a/contrib/gcc/dwarfout.h b/contrib/gcc/dwarfout.h
deleted file mode 100644
index 29c8dd39d5f0..000000000000
--- a/contrib/gcc/dwarfout.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/* dwarfout.h - Various declarations for functions found in dwarfout.c
- Copyright (C) 1998 Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-extern void dwarfout_init PROTO ((FILE *asm_out_file,
- char *main_input_filename));
-extern void dwarfout_finish PROTO ((void));
-
-extern void dwarfout_define PROTO ((unsigned, char *));
-extern void dwarfout_undef PROTO ((unsigned, char *));
-extern void dwarfout_file_scope_decl PROTO ((tree , int));
-extern void dwarfout_start_new_source_file PROTO ((char *));
-extern void dwarfout_resume_previous_source_file PROTO((unsigned));
-
-extern void dwarfout_begin_function PROTO ((void));
-extern void dwarfout_end_function PROTO ((void));
-extern void dwarfout_begin_epilogue PROTO ((void));
-extern void dwarfout_end_epilogue PROTO ((void));
-extern void dwarfout_begin_block PROTO ((unsigned));
-extern void dwarfout_end_block PROTO ((unsigned));
-
-#ifdef RTX_CODE
-extern void dwarfout_label PROTO ((rtx));
-#endif
-extern void dwarfout_line PROTO ((char *, unsigned));
-
diff --git a/contrib/gcc/dyn-string.c b/contrib/gcc/dyn-string.c
deleted file mode 100644
index c9edfcb076eb..000000000000
--- a/contrib/gcc/dyn-string.c
+++ /dev/null
@@ -1,97 +0,0 @@
-/* An abstract string datatype.
- Copyright (C) 1998, 1999 Free Software Foundation, Inc.
- Contributed by Mark Mitchell (mark@markmitchell.com).
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#include "config.h"
-#include "system.h"
-#include "dyn-string.h"
-
-/* Create a new dynamic string capable of holding at least SPACE
- characters, including the terminating NUL. If SPACE is 0, it
- will be silently increased to 1. */
-
-dyn_string_t
-dyn_string_new (space)
- int space;
-{
- dyn_string_t result = (dyn_string_t) xmalloc (sizeof (struct dyn_string));
-
- if (space == 0)
- /* We need at least one byte in which to store the terminating
- NUL. */
- space = 1;
-
- result->allocated = space;
- result->s = (char*) xmalloc (space);
- result->length = 0;
- result->s[0] = '\0';
-
- return result;
-}
-
-/* Free the memory used by DS. */
-
-void
-dyn_string_delete (ds)
- dyn_string_t ds;
-{
- free (ds->s);
- free (ds);
-}
-
-/* Append the NUL-terminated string S to DS, resizing DS if
- necessary. */
-
-dyn_string_t
-dyn_string_append (ds, s)
- dyn_string_t ds;
- const char *s;
-{
- int len = strlen (s);
- dyn_string_resize (ds, ds->length + len + 1 /* '\0' */);
- strcpy (ds->s + ds->length, s);
- ds->length += len;
-
- return ds;
-}
-
-/* Increase the capacity of DS so that it can hold at least SPACE
- characters, including the terminating NUL. This function will not
- (at present) reduce the capacity of DS. */
-
-dyn_string_t
-dyn_string_resize (ds, space)
- dyn_string_t ds;
- int space;
-{
- int new_allocated = ds->allocated;
-
- while (space > new_allocated)
- new_allocated *= 2;
-
- if (new_allocated != ds->allocated)
- {
- /* We actually need more space. */
- ds->allocated = new_allocated;
- ds->s = (char*) xrealloc (ds->s, ds->allocated);
- }
-
- return ds;
-}
diff --git a/contrib/gcc/dyn-string.h b/contrib/gcc/dyn-string.h
deleted file mode 100644
index 9f9330886ca3..000000000000
--- a/contrib/gcc/dyn-string.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/* An abstract string datatype.
- Copyright (C) 1998, 1999 Free Software Foundation, Inc.
- Contributed by Mark Mitchell (mark@markmitchell.com).
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-typedef struct dyn_string
-{
- int allocated; /* The amount of space allocated for the string. */
- int length; /* The actual length of the string. */
- char *s; /* The string itself, NUL-terminated. */
-}* dyn_string_t;
-
-extern dyn_string_t dyn_string_new PROTO((int));
-extern void dyn_string_delete PROTO((dyn_string_t));
-extern dyn_string_t dyn_string_append PROTO((dyn_string_t, const char*));
-extern dyn_string_t dyn_string_resize PROTO((dyn_string_t, int));
diff --git a/contrib/gcc/eh-common.h b/contrib/gcc/eh-common.h
deleted file mode 100644
index c0ff7e73b1a4..000000000000
--- a/contrib/gcc/eh-common.h
+++ /dev/null
@@ -1,142 +0,0 @@
-/* EH stuff
- Copyright (C) 1997, 1998 Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-This program 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 program 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 program; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-
-/* This file contains the structures required for the language
- independant exception handling model. Both the static compiler and
- the runtime library share this file. */
-
-/* The runtime flag flag_new_exceptions is used to determine whether the
- compiler supports the new runtime typechecking mechanism or not. Under
- the new model, runtime info is contained in the exception table, and
- the __throw() library routine determines which handler to call based
- on the results of a call to a matching function provided by the expcetion
- thrower. Otherwise the old scheme of calling any handler which matches
- an exception range is used, and the handler is responsible for all
- checking of runtime conditions. If the handler wasn't suppose to
- get the exception, it performs a re-throw. */
-
-
-/* The handler_label field MUST be the first field in this structure. The
- __throw() library routine expects uses __eh_stub() from except.c, which
- simply dereferences the context pointer to get the handler.
- The routine get_dynamic_handler_chain() also has a dependancy on
- the location of 'dynamic_handler_chain'. If its location is changed,
- that routine must be modified as well. */
-
-struct eh_context
-{
- void *handler_label;
- void **dynamic_handler_chain;
- /* This is language dependent part of the eh context. */
- void *info;
- /* This is used to remember where we threw for re-throws */
- void *table_index; /* address of exception table entry to rethrow from */
-};
-
-#ifndef EH_TABLE_LOOKUP
-
-typedef struct old_exception_table
-{
- void *start_region;
- void *end_region;
- void *exception_handler;
-} old_exception_table;
-
-typedef struct exception_table
-{
- void *start_region;
- void *end_region;
- void *exception_handler;
- void *match_info; /* runtime type info */
-} exception_table;
-
-
-/* The language identifying portion of an exception table */
-
-typedef struct exception_lang_info
-{
- short language;
- short version;
-} exception_lang_info;
-
-/* This value in the first field of the exception descriptor
- identifies the descriptor as the new model format. This value would never
- be present in this location under the old model */
-
-#define NEW_EH_RUNTIME ((void *) -2)
-
-/* Each function has an exception_descriptor which contains the
- language info, and a table of exception ranges and handlers */
-
-typedef struct exception_descriptor
-{
- void *runtime_id_field;
- exception_lang_info lang;
- exception_table table[1];
-} exception_descriptor;
-
-
-/* A pointer to a matching function is initialized at runtime by the
- specific language if run-time exceptions are supported.
- The function takes 3 parameters
- 1 - runtime exception that has been thrown info. (__eh_info *)
- 2 - Match info pointer from the region being considered (void *)
- 3 - exception table region is in (exception descriptor *)
-*/
-
-typedef void * (*__eh_matcher) PROTO ((void *, void *, void *));
-
-/* This value is to be checked as a 'match all' case in the runtime field. */
-
-#define CATCH_ALL_TYPE ((void *) -1)
-
-/* This is the runtime exception information. This forms the minimum required
- information for an exception info pointer in an eh_context structure. */
-
-
-typedef struct __eh_info
-{
- __eh_matcher match_function;
- short language;
- short version;
-} __eh_info;
-
-/* Convienient language codes for ID the originating language. Similar
- to the codes in dwarf2.h. */
-
-enum exception_source_language
- {
- EH_LANG_C89 = 0x0001,
- EH_LANG_C = 0x0002,
- EH_LANG_Ada83 = 0x0003,
- EH_LANG_C_plus_plus = 0x0004,
- EH_LANG_Cobol74 = 0x0005,
- EH_LANG_Cobol85 = 0x0006,
- EH_LANG_Fortran77 = 0x0007,
- EH_LANG_Fortran90 = 0x0008,
- EH_LANG_Pascal83 = 0x0009,
- EH_LANG_Modula2 = 0x000a,
- EH_LANG_Java = 0x000b,
- EH_LANG_Mips_Assembler = 0x8001
- };
-
-#endif /* EH_TABLE_LOOKUP */
-
-
diff --git a/contrib/gcc/exgettext b/contrib/gcc/exgettext
deleted file mode 100755
index 93d553cba764..000000000000
--- a/contrib/gcc/exgettext
+++ /dev/null
@@ -1,118 +0,0 @@
-#! /bin/sh
-# Wrapper around gettext for GCC sources.
-# Copyright 1998 Free Software Foundation, Inc.
-
-# Written by Paul Eggert <eggert@twinsun.com>.
-
-# This file is part of GNU CC.
-
-# GNU CC 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.
-
-# GNU CC is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with GNU CC; see the file COPYING. If not, write to
-# the Free Software Foundation, 59 Temple Place - Suite 330,
-# Boston, MA 02111-1307, USA.
-
-# Set environment to default value, if not already set.
-: ${AWK=awk}
-
-# The argument to this wrapper is the xgettext command to be executed.
-# Extract the xgettext program name from the rest of the command.
-xgettext=${1?}
-shift
-
-# Save work if we're just wrapping a no-op.
-case $xgettext in
-:) exit;;
-esac
-
-# Find the files to be scanned, and the directory to scan them from.
-directory=.
-files=
-for i
-do
- case $i in
- --directory=*)
- directory=`expr " $i" : ' --directory=\(.*\)'`;;
- --files-from=*)
- files_from=`expr " $i" : ' --files-from=\(.*\)'`
- files=`$AWK '/^[^#]/ { print }' $files_from`;;
- esac
-done
-
-# Generate keyword options for xgettext,
-# by scanning for declarations of functions
-# whose parameter names end in "msgid".
-generate_keyword_options='
- /^[A-Z_a-z].*\(.*msgid[,)]/ {
-
- paren_index = index($0, "(")
-
- name = substr($0, 1, paren_index - 1)
- sub(/[^0-9A-Z_a-z]*$/, "", name)
- sub(/[ ]+PARAMS/, "", name)
- sub(/[ ]+VPROTO/, "", name)
- sub(/.*[^0-9A-Z_a-z]/, "", name)
-
- args = substr($0, paren_index)
- sub(/msgid[,)].*/, "", args)
- for (n = 1; sub(/^[^,]*,/, "", args); n++) {
- continue;
- }
-
- if (n == 1) {
- keyword = name
- } else {
- keyword = name ":" n
- }
-
- if (! keyword_seen[keyword]++) {
- print "--keyword=" keyword
- }
- }
-'
-keyword_options=`(
- cd $directory &&
- $AWK "$generate_keyword_options" $files < /dev/null
-)` || exit
-
-# Generate temporary file reflecting the %e strings in the scanned files.
-tmp=tmp-emsgids.c
-
-generate_emsgids='
- /%e.*}/ {
- line = $0
- while ((percent_index = index(line, "%e")) != 0) {
- line = substr(line, percent_index + 2)
- bracket_index = index(line, "}")
- if (bracket_index == 0) {
- continue
- }
- msgid = substr(line, 1, bracket_index - 1)
- if (index(msgid, "%") != 0) {
- continue
- }
- printf "#line %d \"%s\"\n", FNR, FILENAME
- printf "_(\"%s\")\n", msgid
- line = substr(line, bracket_index + 1)
- }
- }
-'
-(cd $directory &&
- $AWK "$generate_emsgids" $files < /dev/null
-) > $directory/$tmp || exit
-
-# Run the xgettext command, with temporary added as a file to scan.
-"$xgettext" $keyword_options ${1+"$@"} $tmp || exit
-
-# Clean up.
-# If we don't get here, `make clean' will remove this file later.
-rm -f $directory/$tmp
diff --git a/contrib/gcc/extend.texi b/contrib/gcc/extend.texi
deleted file mode 100644
index f969f65b1892..000000000000
--- a/contrib/gcc/extend.texi
+++ /dev/null
@@ -1,3782 +0,0 @@
-@c Copyright (C) 1988,89,92,93,94,96,99 Free Software Foundation, Inc.
-@c This is part of the GCC manual.
-@c For copying conditions, see the file gcc.texi.
-
-@node C Extensions
-@chapter Extensions to the C Language Family
-@cindex extensions, C language
-@cindex C language extensions
-
-GNU C provides several language features not found in ANSI standard C.
-(The @samp{-pedantic} option directs GNU CC to print a warning message if
-any of these features is used.) To test for the availability of these
-features in conditional compilation, check for a predefined macro
-@code{__GNUC__}, which is always defined under GNU CC.
-
-These extensions are available in C and Objective C. Most of them are
-also available in C++. @xref{C++ Extensions,,Extensions to the
-C++ Language}, for extensions that apply @emph{only} to C++.
-
-@c The only difference between the two versions of this menu is that the
-@c version for clear INTERNALS has an extra node, "Constraints" (which
-@c appears in a separate chapter in the other version of the manual).
-@ifset INTERNALS
-@menu
-* Statement Exprs:: Putting statements and declarations inside expressions.
-* Local Labels:: Labels local to a statement-expression.
-* Labels as Values:: Getting pointers to labels, and computed gotos.
-* Nested Functions:: As in Algol and Pascal, lexical scoping of functions.
-* Constructing Calls:: Dispatching a call to another function.
-* Naming Types:: Giving a name to the type of some expression.
-* Typeof:: @code{typeof}: referring to the type of an expression.
-* Lvalues:: Using @samp{?:}, @samp{,} and casts in lvalues.
-* Conditionals:: Omitting the middle operand of a @samp{?:} expression.
-* Long Long:: Double-word integers---@code{long long int}.
-* Complex:: Data types for complex numbers.
-* Hex Floats:: Hexadecimal floating-point constants.
-* Zero Length:: Zero-length arrays.
-* Variable Length:: Arrays whose length is computed at run time.
-* Macro Varargs:: Macros with variable number of arguments.
-* Subscripting:: Any array can be subscripted, even if not an lvalue.
-* Pointer Arith:: Arithmetic on @code{void}-pointers and function pointers.
-* Initializers:: Non-constant initializers.
-* Constructors:: Constructor expressions give structures, unions
- or arrays as values.
-* Labeled Elements:: Labeling elements of initializers.
-* Cast to Union:: Casting to union type from any member of the union.
-* Case Ranges:: `case 1 ... 9' and such.
-* Function Attributes:: Declaring that functions have no side effects,
- or that they can never return.
-* Function Prototypes:: Prototype declarations and old-style definitions.
-* C++ Comments:: C++ comments are recognized.
-* Dollar Signs:: Dollar sign is allowed in identifiers.
-* Character Escapes:: @samp{\e} stands for the character @key{ESC}.
-* Variable Attributes:: Specifying attributes of variables.
-* Type Attributes:: Specifying attributes of types.
-* Alignment:: Inquiring about the alignment of a type or variable.
-* Inline:: Defining inline functions (as fast as macros).
-* Extended Asm:: Assembler instructions with C expressions as operands.
- (With them you can define ``built-in'' functions.)
-* Asm Labels:: Specifying the assembler name to use for a C symbol.
-* Explicit Reg Vars:: Defining variables residing in specified registers.
-* Alternate Keywords:: @code{__const__}, @code{__asm__}, etc., for header files.
-* Incomplete Enums:: @code{enum foo;}, with details to follow.
-* Function Names:: Printable strings which are the name of the current
- function.
-* Return Address:: Getting the return or frame address of a function.
-* Other Builtins:: Other built-in functions.
-* Deprecated Features:: Things might disappear from g++.
-@end menu
-@end ifset
-@ifclear INTERNALS
-@menu
-* Statement Exprs:: Putting statements and declarations inside expressions.
-* Local Labels:: Labels local to a statement-expression.
-* Labels as Values:: Getting pointers to labels, and computed gotos.
-* Nested Functions:: As in Algol and Pascal, lexical scoping of functions.
-* Constructing Calls:: Dispatching a call to another function.
-* Naming Types:: Giving a name to the type of some expression.
-* Typeof:: @code{typeof}: referring to the type of an expression.
-* Lvalues:: Using @samp{?:}, @samp{,} and casts in lvalues.
-* Conditionals:: Omitting the middle operand of a @samp{?:} expression.
-* Long Long:: Double-word integers---@code{long long int}.
-* Complex:: Data types for complex numbers.
-* Hex Floats:: Hexadecimal floating-point constants.
-* Zero Length:: Zero-length arrays.
-* Variable Length:: Arrays whose length is computed at run time.
-* Macro Varargs:: Macros with variable number of arguments.
-* Subscripting:: Any array can be subscripted, even if not an lvalue.
-* Pointer Arith:: Arithmetic on @code{void}-pointers and function pointers.
-* Initializers:: Non-constant initializers.
-* Constructors:: Constructor expressions give structures, unions
- or arrays as values.
-* Labeled Elements:: Labeling elements of initializers.
-* Cast to Union:: Casting to union type from any member of the union.
-* Case Ranges:: `case 1 ... 9' and such.
-* Function Attributes:: Declaring that functions have no side effects,
- or that they can never return.
-* Function Prototypes:: Prototype declarations and old-style definitions.
-* C++ Comments:: C++ comments are recognized.
-* Dollar Signs:: Dollar sign is allowed in identifiers.
-* Character Escapes:: @samp{\e} stands for the character @key{ESC}.
-* Variable Attributes:: Specifying attributes of variables.
-* Type Attributes:: Specifying attributes of types.
-* Alignment:: Inquiring about the alignment of a type or variable.
-* Inline:: Defining inline functions (as fast as macros).
-* Extended Asm:: Assembler instructions with C expressions as operands.
- (With them you can define ``built-in'' functions.)
-* Constraints:: Constraints for asm operands
-* Asm Labels:: Specifying the assembler name to use for a C symbol.
-* Explicit Reg Vars:: Defining variables residing in specified registers.
-* Alternate Keywords:: @code{__const__}, @code{__asm__}, etc., for header files.
-* Incomplete Enums:: @code{enum foo;}, with details to follow.
-* Function Names:: Printable strings which are the name of the current
- function.
-* Return Address:: Getting the return or frame address of a function.
-* Deprecated Features:: Things might disappear from g++.
-@end menu
-@end ifclear
-
-@node Statement Exprs
-@section Statements and Declarations in Expressions
-@cindex statements inside expressions
-@cindex declarations inside expressions
-@cindex expressions containing statements
-@cindex macros, statements in expressions
-
-@c the above section title wrapped and causes an underfull hbox.. i
-@c changed it from "within" to "in". --mew 4feb93
-
-A compound statement enclosed in parentheses may appear as an expression
-in GNU C. This allows you to use loops, switches, and local variables
-within an expression.
-
-Recall that a compound statement is a sequence of statements surrounded
-by braces; in this construct, parentheses go around the braces. For
-example:
-
-@example
-(@{ int y = foo (); int z;
- if (y > 0) z = y;
- else z = - y;
- z; @})
-@end example
-
-@noindent
-is a valid (though slightly more complex than necessary) expression
-for the absolute value of @code{foo ()}.
-
-The last thing in the compound statement should be an expression
-followed by a semicolon; the value of this subexpression serves as the
-value of the entire construct. (If you use some other kind of statement
-last within the braces, the construct has type @code{void}, and thus
-effectively no value.)
-
-This feature is especially useful in making macro definitions ``safe'' (so
-that they evaluate each operand exactly once). For example, the
-``maximum'' function is commonly defined as a macro in standard C as
-follows:
-
-@example
-#define max(a,b) ((a) > (b) ? (a) : (b))
-@end example
-
-@noindent
-@cindex side effects, macro argument
-But this definition computes either @var{a} or @var{b} twice, with bad
-results if the operand has side effects. In GNU C, if you know the
-type of the operands (here let's assume @code{int}), you can define
-the macro safely as follows:
-
-@example
-#define maxint(a,b) \
- (@{int _a = (a), _b = (b); _a > _b ? _a : _b; @})
-@end example
-
-Embedded statements are not allowed in constant expressions, such as
-the value of an enumeration constant, the width of a bit field, or
-the initial value of a static variable.
-
-If you don't know the type of the operand, you can still do this, but you
-must use @code{typeof} (@pxref{Typeof}) or type naming (@pxref{Naming
-Types}).
-
-@node Local Labels
-@section Locally Declared Labels
-@cindex local labels
-@cindex macros, local labels
-
-Each statement expression is a scope in which @dfn{local labels} can be
-declared. A local label is simply an identifier; you can jump to it
-with an ordinary @code{goto} statement, but only from within the
-statement expression it belongs to.
-
-A local label declaration looks like this:
-
-@example
-__label__ @var{label};
-@end example
-
-@noindent
-or
-
-@example
-__label__ @var{label1}, @var{label2}, @dots{};
-@end example
-
-Local label declarations must come at the beginning of the statement
-expression, right after the @samp{(@{}, before any ordinary
-declarations.
-
-The label declaration defines the label @emph{name}, but does not define
-the label itself. You must do this in the usual way, with
-@code{@var{label}:}, within the statements of the statement expression.
-
-The local label feature is useful because statement expressions are
-often used in macros. If the macro contains nested loops, a @code{goto}
-can be useful for breaking out of them. However, an ordinary label
-whose scope is the whole function cannot be used: if the macro can be
-expanded several times in one function, the label will be multiply
-defined in that function. A local label avoids this problem. For
-example:
-
-@example
-#define SEARCH(array, target) \
-(@{ \
- __label__ found; \
- typeof (target) _SEARCH_target = (target); \
- typeof (*(array)) *_SEARCH_array = (array); \
- int i, j; \
- int value; \
- for (i = 0; i < max; i++) \
- for (j = 0; j < max; j++) \
- if (_SEARCH_array[i][j] == _SEARCH_target) \
- @{ value = i; goto found; @} \
- value = -1; \
- found: \
- value; \
-@})
-@end example
-
-@node Labels as Values
-@section Labels as Values
-@cindex labels as values
-@cindex computed gotos
-@cindex goto with computed label
-@cindex address of a label
-
-You can get the address of a label defined in the current function
-(or a containing function) with the unary operator @samp{&&}. The
-value has type @code{void *}. This value is a constant and can be used
-wherever a constant of that type is valid. For example:
-
-@example
-void *ptr;
-@dots{}
-ptr = &&foo;
-@end example
-
-To use these values, you need to be able to jump to one. This is done
-with the computed goto statement@footnote{The analogous feature in
-Fortran is called an assigned goto, but that name seems inappropriate in
-C, where one can do more than simply store label addresses in label
-variables.}, @code{goto *@var{exp};}. For example,
-
-@example
-goto *ptr;
-@end example
-
-@noindent
-Any expression of type @code{void *} is allowed.
-
-One way of using these constants is in initializing a static array that
-will serve as a jump table:
-
-@example
-static void *array[] = @{ &&foo, &&bar, &&hack @};
-@end example
-
-Then you can select a label with indexing, like this:
-
-@example
-goto *array[i];
-@end example
-
-@noindent
-Note that this does not check whether the subscript is in bounds---array
-indexing in C never does that.
-
-Such an array of label values serves a purpose much like that of the
-@code{switch} statement. The @code{switch} statement is cleaner, so
-use that rather than an array unless the problem does not fit a
-@code{switch} statement very well.
-
-Another use of label values is in an interpreter for threaded code.
-The labels within the interpreter function can be stored in the
-threaded code for super-fast dispatching.
-
-You can use this mechanism to jump to code in a different function. If
-you do that, totally unpredictable things will happen. The best way to
-avoid this is to store the label address only in automatic variables and
-never pass it as an argument.
-
-@node Nested Functions
-@section Nested Functions
-@cindex nested functions
-@cindex downward funargs
-@cindex thunks
-
-A @dfn{nested function} is a function defined inside another function.
-(Nested functions are not supported for GNU C++.) The nested function's
-name is local to the block where it is defined. For example, here we
-define a nested function named @code{square}, and call it twice:
-
-@example
-@group
-foo (double a, double b)
-@{
- double square (double z) @{ return z * z; @}
-
- return square (a) + square (b);
-@}
-@end group
-@end example
-
-The nested function can access all the variables of the containing
-function that are visible at the point of its definition. This is
-called @dfn{lexical scoping}. For example, here we show a nested
-function which uses an inherited variable named @code{offset}:
-
-@example
-bar (int *array, int offset, int size)
-@{
- int access (int *array, int index)
- @{ return array[index + offset]; @}
- int i;
- @dots{}
- for (i = 0; i < size; i++)
- @dots{} access (array, i) @dots{}
-@}
-@end example
-
-Nested function definitions are permitted within functions in the places
-where variable definitions are allowed; that is, in any block, before
-the first statement in the block.
-
-It is possible to call the nested function from outside the scope of its
-name by storing its address or passing the address to another function:
-
-@example
-hack (int *array, int size)
-@{
- void store (int index, int value)
- @{ array[index] = value; @}
-
- intermediate (store, size);
-@}
-@end example
-
-Here, the function @code{intermediate} receives the address of
-@code{store} as an argument. If @code{intermediate} calls @code{store},
-the arguments given to @code{store} are used to store into @code{array}.
-But this technique works only so long as the containing function
-(@code{hack}, in this example) does not exit.
-
-If you try to call the nested function through its address after the
-containing function has exited, all hell will break loose. If you try
-to call it after a containing scope level has exited, and if it refers
-to some of the variables that are no longer in scope, you may be lucky,
-but it's not wise to take the risk. If, however, the nested function
-does not refer to anything that has gone out of scope, you should be
-safe.
-
-GNU CC implements taking the address of a nested function using a
-technique called @dfn{trampolines}. A paper describing them is
-available as @samp{http://master.debian.org/~karlheg/Usenix88-lexic.pdf}.
-
-A nested function can jump to a label inherited from a containing
-function, provided the label was explicitly declared in the containing
-function (@pxref{Local Labels}). Such a jump returns instantly to the
-containing function, exiting the nested function which did the
-@code{goto} and any intermediate functions as well. Here is an example:
-
-@example
-@group
-bar (int *array, int offset, int size)
-@{
- __label__ failure;
- int access (int *array, int index)
- @{
- if (index > size)
- goto failure;
- return array[index + offset];
- @}
- int i;
- @dots{}
- for (i = 0; i < size; i++)
- @dots{} access (array, i) @dots{}
- @dots{}
- return 0;
-
- /* @r{Control comes here from @code{access}
- if it detects an error.} */
- failure:
- return -1;
-@}
-@end group
-@end example
-
-A nested function always has internal linkage. Declaring one with
-@code{extern} is erroneous. If you need to declare the nested function
-before its definition, use @code{auto} (which is otherwise meaningless
-for function declarations).
-
-@example
-bar (int *array, int offset, int size)
-@{
- __label__ failure;
- auto int access (int *, int);
- @dots{}
- int access (int *array, int index)
- @{
- if (index > size)
- goto failure;
- return array[index + offset];
- @}
- @dots{}
-@}
-@end example
-
-@node Constructing Calls
-@section Constructing Function Calls
-@cindex constructing calls
-@cindex forwarding calls
-
-Using the built-in functions described below, you can record
-the arguments a function received, and call another function
-with the same arguments, without knowing the number or types
-of the arguments.
-
-You can also record the return value of that function call,
-and later return that value, without knowing what data type
-the function tried to return (as long as your caller expects
-that data type).
-
-@table @code
-@findex __builtin_apply_args
-@item __builtin_apply_args ()
-This built-in function returns a pointer of type @code{void *} to data
-describing how to perform a call with the same arguments as were passed
-to the current function.
-
-The function saves the arg pointer register, structure value address,
-and all registers that might be used to pass arguments to a function
-into a block of memory allocated on the stack. Then it returns the
-address of that block.
-
-@findex __builtin_apply
-@item __builtin_apply (@var{function}, @var{arguments}, @var{size})
-This built-in function invokes @var{function} (type @code{void (*)()})
-with a copy of the parameters described by @var{arguments} (type
-@code{void *}) and @var{size} (type @code{int}).
-
-The value of @var{arguments} should be the value returned by
-@code{__builtin_apply_args}. The argument @var{size} specifies the size
-of the stack argument data, in bytes.
-
-This function returns a pointer of type @code{void *} to data describing
-how to return whatever value was returned by @var{function}. The data
-is saved in a block of memory allocated on the stack.
-
-It is not always simple to compute the proper value for @var{size}. The
-value is used by @code{__builtin_apply} to compute the amount of data
-that should be pushed on the stack and copied from the incoming argument
-area.
-
-@findex __builtin_return
-@item __builtin_return (@var{result})
-This built-in function returns the value described by @var{result} from
-the containing function. You should specify, for @var{result}, a value
-returned by @code{__builtin_apply}.
-@end table
-
-@node Naming Types
-@section Naming an Expression's Type
-@cindex naming types
-
-You can give a name to the type of an expression using a @code{typedef}
-declaration with an initializer. Here is how to define @var{name} as a
-type name for the type of @var{exp}:
-
-@example
-typedef @var{name} = @var{exp};
-@end example
-
-This is useful in conjunction with the statements-within-expressions
-feature. Here is how the two together can be used to define a safe
-``maximum'' macro that operates on any arithmetic type:
-
-@example
-#define max(a,b) \
- (@{typedef _ta = (a), _tb = (b); \
- _ta _a = (a); _tb _b = (b); \
- _a > _b ? _a : _b; @})
-@end example
-
-@cindex underscores in variables in macros
-@cindex @samp{_} in variables in macros
-@cindex local variables in macros
-@cindex variables, local, in macros
-@cindex macros, local variables in
-
-The reason for using names that start with underscores for the local
-variables is to avoid conflicts with variable names that occur within the
-expressions that are substituted for @code{a} and @code{b}. Eventually we
-hope to design a new form of declaration syntax that allows you to declare
-variables whose scopes start only after their initializers; this will be a
-more reliable way to prevent such conflicts.
-
-@node Typeof
-@section Referring to a Type with @code{typeof}
-@findex typeof
-@findex sizeof
-@cindex macros, types of arguments
-
-Another way to refer to the type of an expression is with @code{typeof}.
-The syntax of using of this keyword looks like @code{sizeof}, but the
-construct acts semantically like a type name defined with @code{typedef}.
-
-There are two ways of writing the argument to @code{typeof}: with an
-expression or with a type. Here is an example with an expression:
-
-@example
-typeof (x[0](1))
-@end example
-
-@noindent
-This assumes that @code{x} is an array of functions; the type described
-is that of the values of the functions.
-
-Here is an example with a typename as the argument:
-
-@example
-typeof (int *)
-@end example
-
-@noindent
-Here the type described is that of pointers to @code{int}.
-
-If you are writing a header file that must work when included in ANSI C
-programs, write @code{__typeof__} instead of @code{typeof}.
-@xref{Alternate Keywords}.
-
-A @code{typeof}-construct can be used anywhere a typedef name could be
-used. For example, you can use it in a declaration, in a cast, or inside
-of @code{sizeof} or @code{typeof}.
-
-@itemize @bullet
-@item
-This declares @code{y} with the type of what @code{x} points to.
-
-@example
-typeof (*x) y;
-@end example
-
-@item
-This declares @code{y} as an array of such values.
-
-@example
-typeof (*x) y[4];
-@end example
-
-@item
-This declares @code{y} as an array of pointers to characters:
-
-@example
-typeof (typeof (char *)[4]) y;
-@end example
-
-@noindent
-It is equivalent to the following traditional C declaration:
-
-@example
-char *y[4];
-@end example
-
-To see the meaning of the declaration using @code{typeof}, and why it
-might be a useful way to write, let's rewrite it with these macros:
-
-@example
-#define pointer(T) typeof(T *)
-#define array(T, N) typeof(T [N])
-@end example
-
-@noindent
-Now the declaration can be rewritten this way:
-
-@example
-array (pointer (char), 4) y;
-@end example
-
-@noindent
-Thus, @code{array (pointer (char), 4)} is the type of arrays of 4
-pointers to @code{char}.
-@end itemize
-
-@node Lvalues
-@section Generalized Lvalues
-@cindex compound expressions as lvalues
-@cindex expressions, compound, as lvalues
-@cindex conditional expressions as lvalues
-@cindex expressions, conditional, as lvalues
-@cindex casts as lvalues
-@cindex generalized lvalues
-@cindex lvalues, generalized
-@cindex extensions, @code{?:}
-@cindex @code{?:} extensions
-Compound expressions, conditional expressions and casts are allowed as
-lvalues provided their operands are lvalues. This means that you can take
-their addresses or store values into them.
-
-Standard C++ allows compound expressions and conditional expressions as
-lvalues, and permits casts to reference type, so use of this extension
-is deprecated for C++ code.
-
-For example, a compound expression can be assigned, provided the last
-expression in the sequence is an lvalue. These two expressions are
-equivalent:
-
-@example
-(a, b) += 5
-a, (b += 5)
-@end example
-
-Similarly, the address of the compound expression can be taken. These two
-expressions are equivalent:
-
-@example
-&(a, b)
-a, &b
-@end example
-
-A conditional expression is a valid lvalue if its type is not void and the
-true and false branches are both valid lvalues. For example, these two
-expressions are equivalent:
-
-@example
-(a ? b : c) = 5
-(a ? b = 5 : (c = 5))
-@end example
-
-A cast is a valid lvalue if its operand is an lvalue. A simple
-assignment whose left-hand side is a cast works by converting the
-right-hand side first to the specified type, then to the type of the
-inner left-hand side expression. After this is stored, the value is
-converted back to the specified type to become the value of the
-assignment. Thus, if @code{a} has type @code{char *}, the following two
-expressions are equivalent:
-
-@example
-(int)a = 5
-(int)(a = (char *)(int)5)
-@end example
-
-An assignment-with-arithmetic operation such as @samp{+=} applied to a cast
-performs the arithmetic using the type resulting from the cast, and then
-continues as in the previous case. Therefore, these two expressions are
-equivalent:
-
-@example
-(int)a += 5
-(int)(a = (char *)(int) ((int)a + 5))
-@end example
-
-You cannot take the address of an lvalue cast, because the use of its
-address would not work out coherently. Suppose that @code{&(int)f} were
-permitted, where @code{f} has type @code{float}. Then the following
-statement would try to store an integer bit-pattern where a floating
-point number belongs:
-
-@example
-*&(int)f = 1;
-@end example
-
-This is quite different from what @code{(int)f = 1} would do---that
-would convert 1 to floating point and store it. Rather than cause this
-inconsistency, we think it is better to prohibit use of @samp{&} on a cast.
-
-If you really do want an @code{int *} pointer with the address of
-@code{f}, you can simply write @code{(int *)&f}.
-
-@node Conditionals
-@section Conditionals with Omitted Operands
-@cindex conditional expressions, extensions
-@cindex omitted middle-operands
-@cindex middle-operands, omitted
-@cindex extensions, @code{?:}
-@cindex @code{?:} extensions
-
-The middle operand in a conditional expression may be omitted. Then
-if the first operand is nonzero, its value is the value of the conditional
-expression.
-
-Therefore, the expression
-
-@example
-x ? : y
-@end example
-
-@noindent
-has the value of @code{x} if that is nonzero; otherwise, the value of
-@code{y}.
-
-This example is perfectly equivalent to
-
-@example
-x ? x : y
-@end example
-
-@cindex side effect in ?:
-@cindex ?: side effect
-@noindent
-In this simple case, the ability to omit the middle operand is not
-especially useful. When it becomes useful is when the first operand does,
-or may (if it is a macro argument), contain a side effect. Then repeating
-the operand in the middle would perform the side effect twice. Omitting
-the middle operand uses the value already computed without the undesirable
-effects of recomputing it.
-
-@node Long Long
-@section Double-Word Integers
-@cindex @code{long long} data types
-@cindex double-word arithmetic
-@cindex multiprecision arithmetic
-
-GNU C supports data types for integers that are twice as long as
-@code{int}. Simply write @code{long long int} for a signed integer, or
-@code{unsigned long long int} for an unsigned integer. To make an
-integer constant of type @code{long long int}, add the suffix @code{LL}
-to the integer. To make an integer constant of type @code{unsigned long
-long int}, add the suffix @code{ULL} to the integer.
-
-You can use these types in arithmetic like any other integer types.
-Addition, subtraction, and bitwise boolean operations on these types
-are open-coded on all types of machines. Multiplication is open-coded
-if the machine supports fullword-to-doubleword a widening multiply
-instruction. Division and shifts are open-coded only on machines that
-provide special support. The operations that are not open-coded use
-special library routines that come with GNU CC.
-
-There may be pitfalls when you use @code{long long} types for function
-arguments, unless you declare function prototypes. If a function
-expects type @code{int} for its argument, and you pass a value of type
-@code{long long int}, confusion will result because the caller and the
-subroutine will disagree about the number of bytes for the argument.
-Likewise, if the function expects @code{long long int} and you pass
-@code{int}. The best way to avoid such problems is to use prototypes.
-
-@node Complex
-@section Complex Numbers
-@cindex complex numbers
-
-GNU C supports complex data types. You can declare both complex integer
-types and complex floating types, using the keyword @code{__complex__}.
-
-For example, @samp{__complex__ double x;} declares @code{x} as a
-variable whose real part and imaginary part are both of type
-@code{double}. @samp{__complex__ short int y;} declares @code{y} to
-have real and imaginary parts of type @code{short int}; this is not
-likely to be useful, but it shows that the set of complex types is
-complete.
-
-To write a constant with a complex data type, use the suffix @samp{i} or
-@samp{j} (either one; they are equivalent). For example, @code{2.5fi}
-has type @code{__complex__ float} and @code{3i} has type
-@code{__complex__ int}. Such a constant always has a pure imaginary
-value, but you can form any complex value you like by adding one to a
-real constant.
-
-To extract the real part of a complex-valued expression @var{exp}, write
-@code{__real__ @var{exp}}. Likewise, use @code{__imag__} to
-extract the imaginary part.
-
-The operator @samp{~} performs complex conjugation when used on a value
-with a complex type.
-
-GNU CC can allocate complex automatic variables in a noncontiguous
-fashion; it's even possible for the real part to be in a register while
-the imaginary part is on the stack (or vice-versa). None of the
-supported debugging info formats has a way to represent noncontiguous
-allocation like this, so GNU CC describes a noncontiguous complex
-variable as if it were two separate variables of noncomplex type.
-If the variable's actual name is @code{foo}, the two fictitious
-variables are named @code{foo$real} and @code{foo$imag}. You can
-examine and set these two fictitious variables with your debugger.
-
-A future version of GDB will know how to recognize such pairs and treat
-them as a single variable with a complex type.
-
-@node Hex Floats
-@section Hex Floats
-@cindex hex floats
-GNU CC recognizes floating-point numbers written not only in the usual
-decimal notation, such as @code{1.55e1}, but also numbers such as
-@code{0x1.fp3} written in hexadecimal format. In that format the
-@code{0x} hex introducer and the @code{p} or @code{P} exponent field are
-mandatory. The exponent is a decimal number that indicates the power of
-2 by which the significand part will be multiplied. Thus @code{0x1.f} is
-1 15/16, @code{p3} multiplies it by 8, and the value of @code{0x1.fp3}
-is the same as @code{1.55e1}.
-
-Unlike for floating-point numbers in the decimal notation the exponent
-is always required in the hexadecimal notation. Otherwise the compiler
-would not be able to resolve the ambiguity of, e.g., @code{0x1.f}. This
-could mean @code{1.0f} or @code{1.9375} since @code{f} is also the
-extension for floating-point constants of type @code{float}.
-
-@node Zero Length
-@section Arrays of Length Zero
-@cindex arrays of length zero
-@cindex zero-length arrays
-@cindex length-zero arrays
-
-Zero-length arrays are allowed in GNU C. They are very useful as the last
-element of a structure which is really a header for a variable-length
-object:
-
-@example
-struct line @{
- int length;
- char contents[0];
-@};
-
-@{
- struct line *thisline = (struct line *)
- malloc (sizeof (struct line) + this_length);
- thisline->length = this_length;
-@}
-@end example
-
-In standard C, you would have to give @code{contents} a length of 1, which
-means either you waste space or complicate the argument to @code{malloc}.
-
-@node Variable Length
-@section Arrays of Variable Length
-@cindex variable-length arrays
-@cindex arrays of variable length
-
-Variable-length automatic arrays are allowed in GNU C. These arrays are
-declared like any other automatic arrays, but with a length that is not
-a constant expression. The storage is allocated at the point of
-declaration and deallocated when the brace-level is exited. For
-example:
-
-@example
-FILE *
-concat_fopen (char *s1, char *s2, char *mode)
-@{
- char str[strlen (s1) + strlen (s2) + 1];
- strcpy (str, s1);
- strcat (str, s2);
- return fopen (str, mode);
-@}
-@end example
-
-@cindex scope of a variable length array
-@cindex variable-length array scope
-@cindex deallocating variable length arrays
-Jumping or breaking out of the scope of the array name deallocates the
-storage. Jumping into the scope is not allowed; you get an error
-message for it.
-
-@cindex @code{alloca} vs variable-length arrays
-You can use the function @code{alloca} to get an effect much like
-variable-length arrays. The function @code{alloca} is available in
-many other C implementations (but not in all). On the other hand,
-variable-length arrays are more elegant.
-
-There are other differences between these two methods. Space allocated
-with @code{alloca} exists until the containing @emph{function} returns.
-The space for a variable-length array is deallocated as soon as the array
-name's scope ends. (If you use both variable-length arrays and
-@code{alloca} in the same function, deallocation of a variable-length array
-will also deallocate anything more recently allocated with @code{alloca}.)
-
-You can also use variable-length arrays as arguments to functions:
-
-@example
-struct entry
-tester (int len, char data[len][len])
-@{
- @dots{}
-@}
-@end example
-
-The length of an array is computed once when the storage is allocated
-and is remembered for the scope of the array in case you access it with
-@code{sizeof}.
-
-If you want to pass the array first and the length afterward, you can
-use a forward declaration in the parameter list---another GNU extension.
-
-@example
-struct entry
-tester (int len; char data[len][len], int len)
-@{
- @dots{}
-@}
-@end example
-
-@cindex parameter forward declaration
-The @samp{int len} before the semicolon is a @dfn{parameter forward
-declaration}, and it serves the purpose of making the name @code{len}
-known when the declaration of @code{data} is parsed.
-
-You can write any number of such parameter forward declarations in the
-parameter list. They can be separated by commas or semicolons, but the
-last one must end with a semicolon, which is followed by the ``real''
-parameter declarations. Each forward declaration must match a ``real''
-declaration in parameter name and data type.
-
-@node Macro Varargs
-@section Macros with Variable Numbers of Arguments
-@cindex variable number of arguments
-@cindex macro with variable arguments
-@cindex rest argument (in macro)
-
-In GNU C, a macro can accept a variable number of arguments, much as a
-function can. The syntax for defining the macro looks much like that
-used for a function. Here is an example:
-
-@example
-#define eprintf(format, args...) \
- fprintf (stderr, format , ## args)
-@end example
-
-Here @code{args} is a @dfn{rest argument}: it takes in zero or more
-arguments, as many as the call contains. All of them plus the commas
-between them form the value of @code{args}, which is substituted into
-the macro body where @code{args} is used. Thus, we have this expansion:
-
-@example
-eprintf ("%s:%d: ", input_file_name, line_number)
-@expansion{}
-fprintf (stderr, "%s:%d: " , input_file_name, line_number)
-@end example
-
-@noindent
-Note that the comma after the string constant comes from the definition
-of @code{eprintf}, whereas the last comma comes from the value of
-@code{args}.
-
-The reason for using @samp{##} is to handle the case when @code{args}
-matches no arguments at all. In this case, @code{args} has an empty
-value. In this case, the second comma in the definition becomes an
-embarrassment: if it got through to the expansion of the macro, we would
-get something like this:
-
-@example
-fprintf (stderr, "success!\n" , )
-@end example
-
-@noindent
-which is invalid C syntax. @samp{##} gets rid of the comma, so we get
-the following instead:
-
-@example
-fprintf (stderr, "success!\n")
-@end example
-
-This is a special feature of the GNU C preprocessor: @samp{##} before a
-rest argument that is empty discards the preceding sequence of
-non-whitespace characters from the macro definition. (If another macro
-argument precedes, none of it is discarded.)
-
-It might be better to discard the last preprocessor token instead of the
-last preceding sequence of non-whitespace characters; in fact, we may
-someday change this feature to do so. We advise you to write the macro
-definition so that the preceding sequence of non-whitespace characters
-is just a single token, so that the meaning will not change if we change
-the definition of this feature.
-
-@node Subscripting
-@section Non-Lvalue Arrays May Have Subscripts
-@cindex subscripting
-@cindex arrays, non-lvalue
-
-@cindex subscripting and function values
-Subscripting is allowed on arrays that are not lvalues, even though the
-unary @samp{&} operator is not. For example, this is valid in GNU C though
-not valid in other C dialects:
-
-@example
-@group
-struct foo @{int a[4];@};
-
-struct foo f();
-
-bar (int index)
-@{
- return f().a[index];
-@}
-@end group
-@end example
-
-@node Pointer Arith
-@section Arithmetic on @code{void}- and Function-Pointers
-@cindex void pointers, arithmetic
-@cindex void, size of pointer to
-@cindex function pointers, arithmetic
-@cindex function, size of pointer to
-
-In GNU C, addition and subtraction operations are supported on pointers to
-@code{void} and on pointers to functions. This is done by treating the
-size of a @code{void} or of a function as 1.
-
-A consequence of this is that @code{sizeof} is also allowed on @code{void}
-and on function types, and returns 1.
-
-The option @samp{-Wpointer-arith} requests a warning if these extensions
-are used.
-
-@node Initializers
-@section Non-Constant Initializers
-@cindex initializers, non-constant
-@cindex non-constant initializers
-
-As in standard C++, the elements of an aggregate initializer for an
-automatic variable are not required to be constant expressions in GNU C.
-Here is an example of an initializer with run-time varying elements:
-
-@example
-foo (float f, float g)
-@{
- float beat_freqs[2] = @{ f-g, f+g @};
- @dots{}
-@}
-@end example
-
-@node Constructors
-@section Constructor Expressions
-@cindex constructor expressions
-@cindex initializations in expressions
-@cindex structures, constructor expression
-@cindex expressions, constructor
-
-GNU C supports constructor expressions. A constructor looks like
-a cast containing an initializer. Its value is an object of the
-type specified in the cast, containing the elements specified in
-the initializer.
-
-Usually, the specified type is a structure. Assume that
-@code{struct foo} and @code{structure} are declared as shown:
-
-@example
-struct foo @{int a; char b[2];@} structure;
-@end example
-
-@noindent
-Here is an example of constructing a @code{struct foo} with a constructor:
-
-@example
-structure = ((struct foo) @{x + y, 'a', 0@});
-@end example
-
-@noindent
-This is equivalent to writing the following:
-
-@example
-@{
- struct foo temp = @{x + y, 'a', 0@};
- structure = temp;
-@}
-@end example
-
-You can also construct an array. If all the elements of the constructor
-are (made up of) simple constant expressions, suitable for use in
-initializers, then the constructor is an lvalue and can be coerced to a
-pointer to its first element, as shown here:
-
-@example
-char **foo = (char *[]) @{ "x", "y", "z" @};
-@end example
-
-Array constructors whose elements are not simple constants are
-not very useful, because the constructor is not an lvalue. There
-are only two valid ways to use it: to subscript it, or initialize
-an array variable with it. The former is probably slower than a
-@code{switch} statement, while the latter does the same thing an
-ordinary C initializer would do. Here is an example of
-subscripting an array constructor:
-
-@example
-output = ((int[]) @{ 2, x, 28 @}) [input];
-@end example
-
-Constructor expressions for scalar types and union types are is
-also allowed, but then the constructor expression is equivalent
-to a cast.
-
-@node Labeled Elements
-@section Labeled Elements in Initializers
-@cindex initializers with labeled elements
-@cindex labeled elements in initializers
-@cindex case labels in initializers
-
-Standard C requires the elements of an initializer to appear in a fixed
-order, the same as the order of the elements in the array or structure
-being initialized.
-
-In GNU C you can give the elements in any order, specifying the array
-indices or structure field names they apply to. This extension is not
-implemented in GNU C++.
-
-To specify an array index, write @samp{[@var{index}]} or
-@samp{[@var{index}] =} before the element value. For example,
-
-@example
-int a[6] = @{ [4] 29, [2] = 15 @};
-@end example
-
-@noindent
-is equivalent to
-
-@example
-int a[6] = @{ 0, 0, 15, 0, 29, 0 @};
-@end example
-
-@noindent
-The index values must be constant expressions, even if the array being
-initialized is automatic.
-
-To initialize a range of elements to the same value, write
-@samp{[@var{first} ... @var{last}] = @var{value}}. For example,
-
-@example
-int widths[] = @{ [0 ... 9] = 1, [10 ... 99] = 2, [100] = 3 @};
-@end example
-
-@noindent
-Note that the length of the array is the highest value specified
-plus one.
-
-In a structure initializer, specify the name of a field to initialize
-with @samp{@var{fieldname}:} before the element value. For example,
-given the following structure,
-
-@example
-struct point @{ int x, y; @};
-@end example
-
-@noindent
-the following initialization
-
-@example
-struct point p = @{ y: yvalue, x: xvalue @};
-@end example
-
-@noindent
-is equivalent to
-
-@example
-struct point p = @{ xvalue, yvalue @};
-@end example
-
-Another syntax which has the same meaning is @samp{.@var{fieldname} =}.,
-as shown here:
-
-@example
-struct point p = @{ .y = yvalue, .x = xvalue @};
-@end example
-
-You can also use an element label (with either the colon syntax or the
-period-equal syntax) when initializing a union, to specify which element
-of the union should be used. For example,
-
-@example
-union foo @{ int i; double d; @};
-
-union foo f = @{ d: 4 @};
-@end example
-
-@noindent
-will convert 4 to a @code{double} to store it in the union using
-the second element. By contrast, casting 4 to type @code{union foo}
-would store it into the union as the integer @code{i}, since it is
-an integer. (@xref{Cast to Union}.)
-
-You can combine this technique of naming elements with ordinary C
-initialization of successive elements. Each initializer element that
-does not have a label applies to the next consecutive element of the
-array or structure. For example,
-
-@example
-int a[6] = @{ [1] = v1, v2, [4] = v4 @};
-@end example
-
-@noindent
-is equivalent to
-
-@example
-int a[6] = @{ 0, v1, v2, 0, v4, 0 @};
-@end example
-
-Labeling the elements of an array initializer is especially useful
-when the indices are characters or belong to an @code{enum} type.
-For example:
-
-@example
-int whitespace[256]
- = @{ [' '] = 1, ['\t'] = 1, ['\h'] = 1,
- ['\f'] = 1, ['\n'] = 1, ['\r'] = 1 @};
-@end example
-
-@node Case Ranges
-@section Case Ranges
-@cindex case ranges
-@cindex ranges in case statements
-
-You can specify a range of consecutive values in a single @code{case} label,
-like this:
-
-@example
-case @var{low} ... @var{high}:
-@end example
-
-@noindent
-This has the same effect as the proper number of individual @code{case}
-labels, one for each integer value from @var{low} to @var{high}, inclusive.
-
-This feature is especially useful for ranges of ASCII character codes:
-
-@example
-case 'A' ... 'Z':
-@end example
-
-@strong{Be careful:} Write spaces around the @code{...}, for otherwise
-it may be parsed wrong when you use it with integer values. For example,
-write this:
-
-@example
-case 1 ... 5:
-@end example
-
-@noindent
-rather than this:
-
-@example
-case 1...5:
-@end example
-
-@node Cast to Union
-@section Cast to a Union Type
-@cindex cast to a union
-@cindex union, casting to a
-
-A cast to union type is similar to other casts, except that the type
-specified is a union type. You can specify the type either with
-@code{union @var{tag}} or with a typedef name. A cast to union is actually
-a constructor though, not a cast, and hence does not yield an lvalue like
-normal casts. (@xref{Constructors}.)
-
-The types that may be cast to the union type are those of the members
-of the union. Thus, given the following union and variables:
-
-@example
-union foo @{ int i; double d; @};
-int x;
-double y;
-@end example
-
-@noindent
-both @code{x} and @code{y} can be cast to type @code{union} foo.
-
-Using the cast as the right-hand side of an assignment to a variable of
-union type is equivalent to storing in a member of the union:
-
-@example
-union foo u;
-@dots{}
-u = (union foo) x @equiv{} u.i = x
-u = (union foo) y @equiv{} u.d = y
-@end example
-
-You can also use the union cast as a function argument:
-
-@example
-void hack (union foo);
-@dots{}
-hack ((union foo) x);
-@end example
-
-@node Function Attributes
-@section Declaring Attributes of Functions
-@cindex function attributes
-@cindex declaring attributes of functions
-@cindex functions that never return
-@cindex functions that have no side effects
-@cindex functions in arbitrary sections
-@cindex @code{volatile} applied to function
-@cindex @code{const} applied to function
-@cindex functions with @code{printf}, @code{scanf} or @code{strftime} style arguments
-@cindex functions that are passed arguments in registers on the 386
-@cindex functions that pop the argument stack on the 386
-@cindex functions that do not pop the argument stack on the 386
-
-In GNU C, you declare certain things about functions called in your program
-which help the compiler optimize function calls and check your code more
-carefully.
-
-The keyword @code{__attribute__} allows you to specify special
-attributes when making a declaration. This keyword is followed by an
-attribute specification inside double parentheses. Nine attributes,
-@code{noreturn}, @code{const}, @code{format},
-@code{no_instrument_function}, @code{section},
-@code{constructor}, @code{destructor}, @code{unused} and @code{weak} are
-currently defined for functions. Other attributes, including
-@code{section} are supported for variables declarations (@pxref{Variable
-Attributes}) and for types (@pxref{Type Attributes}).
-
-You may also specify attributes with @samp{__} preceding and following
-each keyword. This allows you to use them in header files without
-being concerned about a possible macro of the same name. For example,
-you may use @code{__noreturn__} instead of @code{noreturn}.
-
-@table @code
-@cindex @code{noreturn} function attribute
-@item noreturn
-A few standard library functions, such as @code{abort} and @code{exit},
-cannot return. GNU CC knows this automatically. Some programs define
-their own functions that never return. You can declare them
-@code{noreturn} to tell the compiler this fact. For example,
-
-@smallexample
-void fatal () __attribute__ ((noreturn));
-
-void
-fatal (@dots{})
-@{
- @dots{} /* @r{Print error message.} */ @dots{}
- exit (1);
-@}
-@end smallexample
-
-The @code{noreturn} keyword tells the compiler to assume that
-@code{fatal} cannot return. It can then optimize without regard to what
-would happen if @code{fatal} ever did return. This makes slightly
-better code. More importantly, it helps avoid spurious warnings of
-uninitialized variables.
-
-Do not assume that registers saved by the calling function are
-restored before calling the @code{noreturn} function.
-
-It does not make sense for a @code{noreturn} function to have a return
-type other than @code{void}.
-
-The attribute @code{noreturn} is not implemented in GNU C versions
-earlier than 2.5. An alternative way to declare that a function does
-not return, which works in the current version and in some older
-versions, is as follows:
-
-@smallexample
-typedef void voidfn ();
-
-volatile voidfn fatal;
-@end smallexample
-
-@cindex @code{const} function attribute
-@item const
-Many functions do not examine any values except their arguments, and
-have no effects except the return value. Such a function can be subject
-to common subexpression elimination and loop optimization just as an
-arithmetic operator would be. These functions should be declared
-with the attribute @code{const}. For example,
-
-@smallexample
-int square (int) __attribute__ ((const));
-@end smallexample
-
-@noindent
-says that the hypothetical function @code{square} is safe to call
-fewer times than the program says.
-
-The attribute @code{const} is not implemented in GNU C versions earlier
-than 2.5. An alternative way to declare that a function has no side
-effects, which works in the current version and in some older versions,
-is as follows:
-
-@smallexample
-typedef int intfn ();
-
-extern const intfn square;
-@end smallexample
-
-This approach does not work in GNU C++ from 2.6.0 on, since the language
-specifies that the @samp{const} must be attached to the return value.
-
-@cindex pointer arguments
-Note that a function that has pointer arguments and examines the data
-pointed to must @emph{not} be declared @code{const}. Likewise, a
-function that calls a non-@code{const} function usually must not be
-@code{const}. It does not make sense for a @code{const} function to
-return @code{void}.
-
-@item format (@var{archetype}, @var{string-index}, @var{first-to-check})
-@cindex @code{format} function attribute
-The @code{format} attribute specifies that a function takes @code{printf},
-@code{scanf}, or @code{strftime} style arguments which should be type-checked
-against a format string. For example, the declaration:
-
-@smallexample
-extern int
-my_printf (void *my_object, const char *my_format, ...)
- __attribute__ ((format (printf, 2, 3)));
-@end smallexample
-
-@noindent
-causes the compiler to check the arguments in calls to @code{my_printf}
-for consistency with the @code{printf} style format string argument
-@code{my_format}.
-
-The parameter @var{archetype} determines how the format string is
-interpreted, and should be either @code{printf}, @code{scanf}, or
-@code{strftime}. The
-parameter @var{string-index} specifies which argument is the format
-string argument (starting from 1), while @var{first-to-check} is the
-number of the first argument to check against the format string. For
-functions where the arguments are not available to be checked (such as
-@code{vprintf}), specify the third parameter as zero. In this case the
-compiler only checks the format string for consistency.
-
-In the example above, the format string (@code{my_format}) is the second
-argument of the function @code{my_print}, and the arguments to check
-start with the third argument, so the correct parameters for the format
-attribute are 2 and 3.
-
-The @code{format} attribute allows you to identify your own functions
-which take format strings as arguments, so that GNU CC can check the
-calls to these functions for errors. The compiler always checks formats
-for the ANSI library functions @code{printf}, @code{fprintf},
-@code{sprintf}, @code{scanf}, @code{fscanf}, @code{sscanf}, @code{strftime},
-@code{vprintf}, @code{vfprintf} and @code{vsprintf} whenever such
-warnings are requested (using @samp{-Wformat}), so there is no need to
-modify the header file @file{stdio.h}.
-
-@item format_arg (@var{string-index})
-@cindex @code{format_arg} function attribute
-The @code{format_arg} attribute specifies that a function takes
-@code{printf} or @code{scanf} style arguments, modifies it (for example,
-to translate it into another language), and passes it to a @code{printf}
-or @code{scanf} style function. For example, the declaration:
-
-@smallexample
-extern char *
-my_dgettext (char *my_domain, const char *my_format)
- __attribute__ ((format_arg (2)));
-@end smallexample
-
-@noindent
-causes the compiler to check the arguments in calls to
-@code{my_dgettext} whose result is passed to a @code{printf},
-@code{scanf}, or @code{strftime} type function for consistency with the
-@code{printf} style format string argument @code{my_format}.
-
-The parameter @var{string-index} specifies which argument is the format
-string argument (starting from 1).
-
-The @code{format-arg} attribute allows you to identify your own
-functions which modify format strings, so that GNU CC can check the
-calls to @code{printf}, @code{scanf}, or @code{strftime} function whose
-operands are a call to one of your own function. The compiler always
-treats @code{gettext}, @code{dgettext}, and @code{dcgettext} in this
-manner.
-
-@item no_instrument_function
-@cindex @code{no_instrument_function} function attribute
-If @samp{-finstrument-functions} is given, profiling function calls will
-be generated at entry and exit of most user-compiled functions.
-Functions with this attribute will not be so instrumented.
-
-@item section ("section-name")
-@cindex @code{section} function attribute
-Normally, the compiler places the code it generates in the @code{text} section.
-Sometimes, however, you need additional sections, or you need certain
-particular functions to appear in special sections. The @code{section}
-attribute specifies that a function lives in a particular section.
-For example, the declaration:
-
-@smallexample
-extern void foobar (void) __attribute__ ((section ("bar")));
-@end smallexample
-
-@noindent
-puts the function @code{foobar} in the @code{bar} section.
-
-Some file formats do not support arbitrary sections so the @code{section}
-attribute is not available on all platforms.
-If you need to map the entire contents of a module to a particular
-section, consider using the facilities of the linker instead.
-
-@item constructor
-@itemx destructor
-@cindex @code{constructor} function attribute
-@cindex @code{destructor} function attribute
-The @code{constructor} attribute causes the function to be called
-automatically before execution enters @code{main ()}. Similarly, the
-@code{destructor} attribute causes the function to be called
-automatically after @code{main ()} has completed or @code{exit ()} has
-been called. Functions with these attributes are useful for
-initializing data that will be used implicitly during the execution of
-the program.
-
-These attributes are not currently implemented for Objective C.
-
-@item unused
-This attribute, attached to a function, means that the function is meant
-to be possibly unused. GNU CC will not produce a warning for this
-function. GNU C++ does not currently support this attribute as
-definitions without parameters are valid in C++.
-
-@item weak
-@cindex @code{weak} attribute
-The @code{weak} attribute causes the declaration to be emitted as a weak
-symbol rather than a global. This is primarily useful in defining
-library functions which can be overridden in user code, though it can
-also be used with non-function declarations. Weak symbols are supported
-for ELF targets, and also for a.out targets when using the GNU assembler
-and linker.
-
-@item alias ("target")
-@cindex @code{alias} attribute
-The @code{alias} attribute causes the declaration to be emitted as an
-alias for another symbol, which must be specified. For instance,
-
-@smallexample
-void __f () @{ /* do something */; @}
-void f () __attribute__ ((weak, alias ("__f")));
-@end smallexample
-
-declares @samp{f} to be a weak alias for @samp{__f}. In C++, the
-mangled name for the target must be used.
-
-Not all target machines support this attribute.
-
-@item no_check_memory_usage
-@cindex @code{no_check_memory_usage} function attribute
-If @samp{-fcheck-memory-usage} is given, calls to support routines will
-be generated before most memory accesses, to permit support code to
-record usage and detect uses of uninitialized or unallocated storage.
-Since the compiler cannot handle them properly, @code{asm} statements
-are not allowed. Declaring a function with this attribute disables the
-memory checking code for that function, permitting the use of @code{asm}
-statements without requiring separate compilation with different
-options, and allowing you to write support routines of your own if you
-wish, without getting infinite recursion if they get compiled with this
-option.
-
-@item regparm (@var{number})
-@cindex functions that are passed arguments in registers on the 386
-On the Intel 386, the @code{regparm} attribute causes the compiler to
-pass up to @var{number} integer arguments in registers @var{EAX},
-@var{EDX}, and @var{ECX} instead of on the stack. Functions that take a
-variable number of arguments will continue to be passed all of their
-arguments on the stack.
-
-@item stdcall
-@cindex functions that pop the argument stack on the 386
-On the Intel 386, the @code{stdcall} attribute causes the compiler to
-assume that the called function will pop off the stack space used to
-pass arguments, unless it takes a variable number of arguments.
-
-The PowerPC compiler for Windows NT currently ignores the @code{stdcall}
-attribute.
-
-@item cdecl
-@cindex functions that do pop the argument stack on the 386
-On the Intel 386, the @code{cdecl} attribute causes the compiler to
-assume that the calling function will pop off the stack space used to
-pass arguments. This is
-useful to override the effects of the @samp{-mrtd} switch.
-
-The PowerPC compiler for Windows NT currently ignores the @code{cdecl}
-attribute.
-
-@item longcall
-@cindex functions called via pointer on the RS/6000 and PowerPC
-On the RS/6000 and PowerPC, the @code{longcall} attribute causes the
-compiler to always call the function via a pointer, so that functions
-which reside further than 64 megabytes (67,108,864 bytes) from the
-current location can be called.
-
-@item dllimport
-@cindex functions which are imported from a dll on PowerPC Windows NT
-On the PowerPC running Windows NT, the @code{dllimport} attribute causes
-the compiler to call the function via a global pointer to the function
-pointer that is set up by the Windows NT dll library. The pointer name
-is formed by combining @code{__imp_} and the function name.
-
-@item dllexport
-@cindex functions which are exported from a dll on PowerPC Windows NT
-On the PowerPC running Windows NT, the @code{dllexport} attribute causes
-the compiler to provide a global pointer to the function pointer, so
-that it can be called with the @code{dllimport} attribute. The pointer
-name is formed by combining @code{__imp_} and the function name.
-
-@item exception (@var{except-func} [, @var{except-arg}])
-@cindex functions which specify exception handling on PowerPC Windows NT
-On the PowerPC running Windows NT, the @code{exception} attribute causes
-the compiler to modify the structured exception table entry it emits for
-the declared function. The string or identifier @var{except-func} is
-placed in the third entry of the structured exception table. It
-represents a function, which is called by the exception handling
-mechanism if an exception occurs. If it was specified, the string or
-identifier @var{except-arg} is placed in the fourth entry of the
-structured exception table.
-
-@item function_vector
-@cindex calling functions through the function vector on the H8/300 processors
-Use this option on the H8/300 and H8/300H to indicate that the specified
-function should be called through the function vector. Calling a
-function through the function vector will reduce code size, however;
-the function vector has a limited size (maximum 128 entries on the H8/300
-and 64 entries on the H8/300H) and shares space with the interrupt vector.
-
-You must use GAS and GLD from GNU binutils version 2.7 or later for
-this option to work correctly.
-
-@item interrupt_handler
-@cindex interrupt handler functions on the H8/300 processors
-Use this option on the H8/300 and H8/300H to indicate that the specified
-function is an interrupt handler. The compiler will generate function
-entry and exit sequences suitable for use in an interrupt handler when this
-attribute is present.
-
-@item eightbit_data
-@cindex eight bit data on the H8/300 and H8/300H
-Use this option on the H8/300 and H8/300H to indicate that the specified
-variable should be placed into the eight bit data section.
-The compiler will generate more efficient code for certain operations
-on data in the eight bit data area. Note the eight bit data area is limited to
-256 bytes of data.
-
-You must use GAS and GLD from GNU binutils version 2.7 or later for
-this option to work correctly.
-
-@item tiny_data
-@cindex tiny data section on the H8/300H
-Use this option on the H8/300H to indicate that the specified
-variable should be placed into the tiny data section.
-The compiler will generate more efficient code for loads and stores
-on data in the tiny data section. Note the tiny data area is limited to
-slightly under 32kbytes of data.
-
-@item interrupt
-@cindex interrupt handlers on the M32R/D
-Use this option on the M32R/D to indicate that the specified
-function is an interrupt handler. The compiler will generate function
-entry and exit sequences suitable for use in an interrupt handler when this
-attribute is present.
-
-@item model (@var{model-name})
-@cindex function addressability on the M32R/D
-Use this attribute on the M32R/D to set the addressability of an object,
-and the code generated for a function.
-The identifier @var{model-name} is one of @code{small}, @code{medium},
-or @code{large}, representing each of the code models.
-
-Small model objects live in the lower 16MB of memory (so that their
-addresses can be loaded with the @code{ld24} instruction), and are
-callable with the @code{bl} instruction.
-
-Medium model objects may live anywhere in the 32 bit address space (the
-compiler will generate @code{seth/add3} instructions to load their addresses),
-and are callable with the @code{bl} instruction.
-
-Large model objects may live anywhere in the 32 bit address space (the
-compiler will generate @code{seth/add3} instructions to load their addresses),
-and may not be reachable with the @code{bl} instruction (the compiler will
-generate the much slower @code{seth/add3/jl} instruction sequence).
-
-@end table
-
-You can specify multiple attributes in a declaration by separating them
-by commas within the double parentheses or by immediately following an
-attribute declaration with another attribute declaration.
-
-@cindex @code{#pragma}, reason for not using
-@cindex pragma, reason for not using
-Some people object to the @code{__attribute__} feature, suggesting that ANSI C's
-@code{#pragma} should be used instead. There are two reasons for not
-doing this.
-
-@enumerate
-@item
-It is impossible to generate @code{#pragma} commands from a macro.
-
-@item
-There is no telling what the same @code{#pragma} might mean in another
-compiler.
-@end enumerate
-
-These two reasons apply to almost any application that might be proposed
-for @code{#pragma}. It is basically a mistake to use @code{#pragma} for
-@emph{anything}.
-
-@node Function Prototypes
-@section Prototypes and Old-Style Function Definitions
-@cindex function prototype declarations
-@cindex old-style function definitions
-@cindex promotion of formal parameters
-
-GNU C extends ANSI C to allow a function prototype to override a later
-old-style non-prototype definition. Consider the following example:
-
-@example
-/* @r{Use prototypes unless the compiler is old-fashioned.} */
-#ifdef __STDC__
-#define P(x) x
-#else
-#define P(x) ()
-#endif
-
-/* @r{Prototype function declaration.} */
-int isroot P((uid_t));
-
-/* @r{Old-style function definition.} */
-int
-isroot (x) /* ??? lossage here ??? */
- uid_t x;
-@{
- return x == 0;
-@}
-@end example
-
-Suppose the type @code{uid_t} happens to be @code{short}. ANSI C does
-not allow this example, because subword arguments in old-style
-non-prototype definitions are promoted. Therefore in this example the
-function definition's argument is really an @code{int}, which does not
-match the prototype argument type of @code{short}.
-
-This restriction of ANSI C makes it hard to write code that is portable
-to traditional C compilers, because the programmer does not know
-whether the @code{uid_t} type is @code{short}, @code{int}, or
-@code{long}. Therefore, in cases like these GNU C allows a prototype
-to override a later old-style definition. More precisely, in GNU C, a
-function prototype argument type overrides the argument type specified
-by a later old-style definition if the former type is the same as the
-latter type before promotion. Thus in GNU C the above example is
-equivalent to the following:
-
-@example
-int isroot (uid_t);
-
-int
-isroot (uid_t x)
-@{
- return x == 0;
-@}
-@end example
-
-GNU C++ does not support old-style function definitions, so this
-extension is irrelevant.
-
-@node C++ Comments
-@section C++ Style Comments
-@cindex //
-@cindex C++ comments
-@cindex comments, C++ style
-
-In GNU C, you may use C++ style comments, which start with @samp{//} and
-continue until the end of the line. Many other C implementations allow
-such comments, and they are likely to be in a future C standard.
-However, C++ style comments are not recognized if you specify
-@w{@samp{-ansi}} or @w{@samp{-traditional}}, since they are incompatible
-with traditional constructs like @code{dividend//*comment*/divisor}.
-
-@node Dollar Signs
-@section Dollar Signs in Identifier Names
-@cindex $
-@cindex dollar signs in identifier names
-@cindex identifier names, dollar signs in
-
-In GNU C, you may normally use dollar signs in identifier names.
-This is because many traditional C implementations allow such identifiers.
-However, dollar signs in identifiers are not supported on a few target
-machines, typically because the target assembler does not allow them.
-
-@node Character Escapes
-@section The Character @key{ESC} in Constants
-
-You can use the sequence @samp{\e} in a string or character constant to
-stand for the ASCII character @key{ESC}.
-
-@node Alignment
-@section Inquiring on Alignment of Types or Variables
-@cindex alignment
-@cindex type alignment
-@cindex variable alignment
-
-The keyword @code{__alignof__} allows you to inquire about how an object
-is aligned, or the minimum alignment usually required by a type. Its
-syntax is just like @code{sizeof}.
-
-For example, if the target machine requires a @code{double} value to be
-aligned on an 8-byte boundary, then @code{__alignof__ (double)} is 8.
-This is true on many RISC machines. On more traditional machine
-designs, @code{__alignof__ (double)} is 4 or even 2.
-
-Some machines never actually require alignment; they allow reference to any
-data type even at an odd addresses. For these machines, @code{__alignof__}
-reports the @emph{recommended} alignment of a type.
-
-When the operand of @code{__alignof__} is an lvalue rather than a type, the
-value is the largest alignment that the lvalue is known to have. It may
-have this alignment as a result of its data type, or because it is part of
-a structure and inherits alignment from that structure. For example, after
-this declaration:
-
-@example
-struct foo @{ int x; char y; @} foo1;
-@end example
-
-@noindent
-the value of @code{__alignof__ (foo1.y)} is probably 2 or 4, the same as
-@code{__alignof__ (int)}, even though the data type of @code{foo1.y}
-does not itself demand any alignment.@refill
-
-A related feature which lets you specify the alignment of an object is
-@code{__attribute__ ((aligned (@var{alignment})))}; see the following
-section.
-
-@node Variable Attributes
-@section Specifying Attributes of Variables
-@cindex attribute of variables
-@cindex variable attributes
-
-The keyword @code{__attribute__} allows you to specify special
-attributes of variables or structure fields. This keyword is followed
-by an attribute specification inside double parentheses. Eight
-attributes are currently defined for variables: @code{aligned},
-@code{mode}, @code{nocommon}, @code{packed}, @code{section},
-@code{transparent_union}, @code{unused}, and @code{weak}. Other
-attributes are available for functions (@pxref{Function Attributes}) and
-for types (@pxref{Type Attributes}).
-
-You may also specify attributes with @samp{__} preceding and following
-each keyword. This allows you to use them in header files without
-being concerned about a possible macro of the same name. For example,
-you may use @code{__aligned__} instead of @code{aligned}.
-
-@table @code
-@cindex @code{aligned} attribute
-@item aligned (@var{alignment})
-This attribute specifies a minimum alignment for the variable or
-structure field, measured in bytes. For example, the declaration:
-
-@smallexample
-int x __attribute__ ((aligned (16))) = 0;
-@end smallexample
-
-@noindent
-causes the compiler to allocate the global variable @code{x} on a
-16-byte boundary. On a 68040, this could be used in conjunction with
-an @code{asm} expression to access the @code{move16} instruction which
-requires 16-byte aligned operands.
-
-You can also specify the alignment of structure fields. For example, to
-create a double-word aligned @code{int} pair, you could write:
-
-@smallexample
-struct foo @{ int x[2] __attribute__ ((aligned (8))); @};
-@end smallexample
-
-@noindent
-This is an alternative to creating a union with a @code{double} member
-that forces the union to be double-word aligned.
-
-It is not possible to specify the alignment of functions; the alignment
-of functions is determined by the machine's requirements and cannot be
-changed. You cannot specify alignment for a typedef name because such a
-name is just an alias, not a distinct type.
-
-As in the preceding examples, you can explicitly specify the alignment
-(in bytes) that you wish the compiler to use for a given variable or
-structure field. Alternatively, you can leave out the alignment factor
-and just ask the compiler to align a variable or field to the maximum
-useful alignment for the target machine you are compiling for. For
-example, you could write:
-
-@smallexample
-short array[3] __attribute__ ((aligned));
-@end smallexample
-
-Whenever you leave out the alignment factor in an @code{aligned} attribute
-specification, the compiler automatically sets the alignment for the declared
-variable or field to the largest alignment which is ever used for any data
-type on the target machine you are compiling for. Doing this can often make
-copy operations more efficient, because the compiler can use whatever
-instructions copy the biggest chunks of memory when performing copies to
-or from the variables or fields that you have aligned this way.
-
-The @code{aligned} attribute can only increase the alignment; but you
-can decrease it by specifying @code{packed} as well. See below.
-
-Note that the effectiveness of @code{aligned} attributes may be limited
-by inherent limitations in your linker. On many systems, the linker is
-only able to arrange for variables to be aligned up to a certain maximum
-alignment. (For some linkers, the maximum supported alignment may
-be very very small.) If your linker is only able to align variables
-up to a maximum of 8 byte alignment, then specifying @code{aligned(16)}
-in an @code{__attribute__} will still only provide you with 8 byte
-alignment. See your linker documentation for further information.
-
-@item mode (@var{mode})
-@cindex @code{mode} attribute
-This attribute specifies the data type for the declaration---whichever
-type corresponds to the mode @var{mode}. This in effect lets you
-request an integer or floating point type according to its width.
-
-You may also specify a mode of @samp{byte} or @samp{__byte__} to
-indicate the mode corresponding to a one-byte integer, @samp{word} or
-@samp{__word__} for the mode of a one-word integer, and @samp{pointer}
-or @samp{__pointer__} for the mode used to represent pointers.
-
-@item nocommon
-@cindex @code{nocommon} attribute
-This attribute specifies requests GNU CC not to place a variable
-``common'' but instead to allocate space for it directly. If you
-specify the @samp{-fno-common} flag, GNU CC will do this for all
-variables.
-
-Specifying the @code{nocommon} attribute for a variable provides an
-initialization of zeros. A variable may only be initialized in one
-source file.
-
-@item packed
-@cindex @code{packed} attribute
-The @code{packed} attribute specifies that a variable or structure field
-should have the smallest possible alignment---one byte for a variable,
-and one bit for a field, unless you specify a larger value with the
-@code{aligned} attribute.
-
-Here is a structure in which the field @code{x} is packed, so that it
-immediately follows @code{a}:
-
-@example
-struct foo
-@{
- char a;
- int x[2] __attribute__ ((packed));
-@};
-@end example
-
-@item section ("section-name")
-@cindex @code{section} variable attribute
-Normally, the compiler places the objects it generates in sections like
-@code{data} and @code{bss}. Sometimes, however, you need additional sections,
-or you need certain particular variables to appear in special sections,
-for example to map to special hardware. The @code{section}
-attribute specifies that a variable (or function) lives in a particular
-section. For example, this small program uses several specific section names:
-
-@smallexample
-struct duart a __attribute__ ((section ("DUART_A"))) = @{ 0 @};
-struct duart b __attribute__ ((section ("DUART_B"))) = @{ 0 @};
-char stack[10000] __attribute__ ((section ("STACK"))) = @{ 0 @};
-int init_data __attribute__ ((section ("INITDATA"))) = 0;
-
-main()
-@{
- /* Initialize stack pointer */
- init_sp (stack + sizeof (stack));
-
- /* Initialize initialized data */
- memcpy (&init_data, &data, &edata - &data);
-
- /* Turn on the serial ports */
- init_duart (&a);
- init_duart (&b);
-@}
-@end smallexample
-
-@noindent
-Use the @code{section} attribute with an @emph{initialized} definition
-of a @emph{global} variable, as shown in the example. GNU CC issues
-a warning and otherwise ignores the @code{section} attribute in
-uninitialized variable declarations.
-
-You may only use the @code{section} attribute with a fully initialized
-global definition because of the way linkers work. The linker requires
-each object be defined once, with the exception that uninitialized
-variables tentatively go in the @code{common} (or @code{bss}) section
-and can be multiply "defined". You can force a variable to be
-initialized with the @samp{-fno-common} flag or the @code{nocommon}
-attribute.
-
-Some file formats do not support arbitrary sections so the @code{section}
-attribute is not available on all platforms.
-If you need to map the entire contents of a module to a particular
-section, consider using the facilities of the linker instead.
-
-@item transparent_union
-This attribute, attached to a function parameter which is a union, means
-that the corresponding argument may have the type of any union member,
-but the argument is passed as if its type were that of the first union
-member. For more details see @xref{Type Attributes}. You can also use
-this attribute on a @code{typedef} for a union data type; then it
-applies to all function parameters with that type.
-
-@item unused
-This attribute, attached to a variable, means that the variable is meant
-to be possibly unused. GNU CC will not produce a warning for this
-variable.
-
-@item weak
-The @code{weak} attribute is described in @xref{Function Attributes}.
-
-@item model (@var{model-name})
-@cindex variable addressability on the M32R/D
-Use this attribute on the M32R/D to set the addressability of an object.
-The identifier @var{model-name} is one of @code{small}, @code{medium},
-or @code{large}, representing each of the code models.
-
-Small model objects live in the lower 16MB of memory (so that their
-addresses can be loaded with the @code{ld24} instruction).
-
-Medium and large model objects may live anywhere in the 32 bit address space
-(the compiler will generate @code{seth/add3} instructions to load their
-addresses).
-
-@end table
-
-To specify multiple attributes, separate them by commas within the
-double parentheses: for example, @samp{__attribute__ ((aligned (16),
-packed))}.
-
-@node Type Attributes
-@section Specifying Attributes of Types
-@cindex attribute of types
-@cindex type attributes
-
-The keyword @code{__attribute__} allows you to specify special
-attributes of @code{struct} and @code{union} types when you define such
-types. This keyword is followed by an attribute specification inside
-double parentheses. Three attributes are currently defined for types:
-@code{aligned}, @code{packed}, and @code{transparent_union}. Other
-attributes are defined for functions (@pxref{Function Attributes}) and
-for variables (@pxref{Variable Attributes}).
-
-You may also specify any one of these attributes with @samp{__}
-preceding and following its keyword. This allows you to use these
-attributes in header files without being concerned about a possible
-macro of the same name. For example, you may use @code{__aligned__}
-instead of @code{aligned}.
-
-You may specify the @code{aligned} and @code{transparent_union}
-attributes either in a @code{typedef} declaration or just past the
-closing curly brace of a complete enum, struct or union type
-@emph{definition} and the @code{packed} attribute only past the closing
-brace of a definition.
-
-You may also specify attributes between the enum, struct or union
-tag and the name of the type rather than after the closing brace.
-
-@table @code
-@cindex @code{aligned} attribute
-@item aligned (@var{alignment})
-This attribute specifies a minimum alignment (in bytes) for variables
-of the specified type. For example, the declarations:
-
-@smallexample
-struct S @{ short f[3]; @} __attribute__ ((aligned (8)));
-typedef int more_aligned_int __attribute__ ((aligned (8)));
-@end smallexample
-
-@noindent
-force the compiler to insure (as far as it can) that each variable whose
-type is @code{struct S} or @code{more_aligned_int} will be allocated and
-aligned @emph{at least} on a 8-byte boundary. On a Sparc, having all
-variables of type @code{struct S} aligned to 8-byte boundaries allows
-the compiler to use the @code{ldd} and @code{std} (doubleword load and
-store) instructions when copying one variable of type @code{struct S} to
-another, thus improving run-time efficiency.
-
-Note that the alignment of any given @code{struct} or @code{union} type
-is required by the ANSI C standard to be at least a perfect multiple of
-the lowest common multiple of the alignments of all of the members of
-the @code{struct} or @code{union} in question. This means that you @emph{can}
-effectively adjust the alignment of a @code{struct} or @code{union}
-type by attaching an @code{aligned} attribute to any one of the members
-of such a type, but the notation illustrated in the example above is a
-more obvious, intuitive, and readable way to request the compiler to
-adjust the alignment of an entire @code{struct} or @code{union} type.
-
-As in the preceding example, you can explicitly specify the alignment
-(in bytes) that you wish the compiler to use for a given @code{struct}
-or @code{union} type. Alternatively, you can leave out the alignment factor
-and just ask the compiler to align a type to the maximum
-useful alignment for the target machine you are compiling for. For
-example, you could write:
-
-@smallexample
-struct S @{ short f[3]; @} __attribute__ ((aligned));
-@end smallexample
-
-Whenever you leave out the alignment factor in an @code{aligned}
-attribute specification, the compiler automatically sets the alignment
-for the type to the largest alignment which is ever used for any data
-type on the target machine you are compiling for. Doing this can often
-make copy operations more efficient, because the compiler can use
-whatever instructions copy the biggest chunks of memory when performing
-copies to or from the variables which have types that you have aligned
-this way.
-
-In the example above, if the size of each @code{short} is 2 bytes, then
-the size of the entire @code{struct S} type is 6 bytes. The smallest
-power of two which is greater than or equal to that is 8, so the
-compiler sets the alignment for the entire @code{struct S} type to 8
-bytes.
-
-Note that although you can ask the compiler to select a time-efficient
-alignment for a given type and then declare only individual stand-alone
-objects of that type, the compiler's ability to select a time-efficient
-alignment is primarily useful only when you plan to create arrays of
-variables having the relevant (efficiently aligned) type. If you
-declare or use arrays of variables of an efficiently-aligned type, then
-it is likely that your program will also be doing pointer arithmetic (or
-subscripting, which amounts to the same thing) on pointers to the
-relevant type, and the code that the compiler generates for these
-pointer arithmetic operations will often be more efficient for
-efficiently-aligned types than for other types.
-
-The @code{aligned} attribute can only increase the alignment; but you
-can decrease it by specifying @code{packed} as well. See below.
-
-Note that the effectiveness of @code{aligned} attributes may be limited
-by inherent limitations in your linker. On many systems, the linker is
-only able to arrange for variables to be aligned up to a certain maximum
-alignment. (For some linkers, the maximum supported alignment may
-be very very small.) If your linker is only able to align variables
-up to a maximum of 8 byte alignment, then specifying @code{aligned(16)}
-in an @code{__attribute__} will still only provide you with 8 byte
-alignment. See your linker documentation for further information.
-
-@item packed
-This attribute, attached to an @code{enum}, @code{struct}, or
-@code{union} type definition, specified that the minimum required memory
-be used to represent the type.
-
-Specifying this attribute for @code{struct} and @code{union} types is
-equivalent to specifying the @code{packed} attribute on each of the
-structure or union members. Specifying the @samp{-fshort-enums}
-flag on the line is equivalent to specifying the @code{packed}
-attribute on all @code{enum} definitions.
-
-You may only specify this attribute after a closing curly brace on an
-@code{enum} definition, not in a @code{typedef} declaration, unless that
-declaration also contains the definition of the @code{enum}.
-
-@item transparent_union
-This attribute, attached to a @code{union} type definition, indicates
-that any function parameter having that union type causes calls to that
-function to be treated in a special way.
-
-First, the argument corresponding to a transparent union type can be of
-any type in the union; no cast is required. Also, if the union contains
-a pointer type, the corresponding argument can be a null pointer
-constant or a void pointer expression; and if the union contains a void
-pointer type, the corresponding argument can be any pointer expression.
-If the union member type is a pointer, qualifiers like @code{const} on
-the referenced type must be respected, just as with normal pointer
-conversions.
-
-Second, the argument is passed to the function using the calling
-conventions of first member of the transparent union, not the calling
-conventions of the union itself. All members of the union must have the
-same machine representation; this is necessary for this argument passing
-to work properly.
-
-Transparent unions are designed for library functions that have multiple
-interfaces for compatibility reasons. For example, suppose the
-@code{wait} function must accept either a value of type @code{int *} to
-comply with Posix, or a value of type @code{union wait *} to comply with
-the 4.1BSD interface. If @code{wait}'s parameter were @code{void *},
-@code{wait} would accept both kinds of arguments, but it would also
-accept any other pointer type and this would make argument type checking
-less useful. Instead, @code{<sys/wait.h>} might define the interface
-as follows:
-
-@smallexample
-typedef union
- @{
- int *__ip;
- union wait *__up;
- @} wait_status_ptr_t __attribute__ ((__transparent_union__));
-
-pid_t wait (wait_status_ptr_t);
-@end smallexample
-
-This interface allows either @code{int *} or @code{union wait *}
-arguments to be passed, using the @code{int *} calling convention.
-The program can call @code{wait} with arguments of either type:
-
-@example
-int w1 () @{ int w; return wait (&w); @}
-int w2 () @{ union wait w; return wait (&w); @}
-@end example
-
-With this interface, @code{wait}'s implementation might look like this:
-
-@example
-pid_t wait (wait_status_ptr_t p)
-@{
- return waitpid (-1, p.__ip, 0);
-@}
-@end example
-
-@item unused
-When attached to a type (including a @code{union} or a @code{struct}),
-this attribute means that variables of that type are meant to appear
-possibly unused. GNU CC will not produce a warning for any variables of
-that type, even if the variable appears to do nothing. This is often
-the case with lock or thread classes, which are usually defined and then
-not referenced, but contain constructors and destructors that have
-nontrivial bookkeeping functions.
-
-@end table
-
-To specify multiple attributes, separate them by commas within the
-double parentheses: for example, @samp{__attribute__ ((aligned (16),
-packed))}.
-
-@node Inline
-@section An Inline Function is As Fast As a Macro
-@cindex inline functions
-@cindex integrating function code
-@cindex open coding
-@cindex macros, inline alternative
-
-By declaring a function @code{inline}, you can direct GNU CC to
-integrate that function's code into the code for its callers. This
-makes execution faster by eliminating the function-call overhead; in
-addition, if any of the actual argument values are constant, their known
-values may permit simplifications at compile time so that not all of the
-inline function's code needs to be included. The effect on code size is
-less predictable; object code may be larger or smaller with function
-inlining, depending on the particular case. Inlining of functions is an
-optimization and it really ``works'' only in optimizing compilation. If
-you don't use @samp{-O}, no function is really inline.
-
-To declare a function inline, use the @code{inline} keyword in its
-declaration, like this:
-
-@example
-inline int
-inc (int *a)
-@{
- (*a)++;
-@}
-@end example
-
-(If you are writing a header file to be included in ANSI C programs, write
-@code{__inline__} instead of @code{inline}. @xref{Alternate Keywords}.)
-You can also make all ``simple enough'' functions inline with the option
-@samp{-finline-functions}.
-
-Note that certain usages in a function definition can make it unsuitable
-for inline substitution. Among these usages are: use of varargs, use of
-alloca, use of variable sized data types (@pxref{Variable Length}),
-use of computed goto (@pxref{Labels as Values}), use of nonlocal goto,
-and nested functions (@pxref{Nested Functions}). Using @samp{-Winline}
-will warn when a function marked @code{inline} could not be substituted,
-and will give the reason for the failure.
-
-Note that in C and Objective C, unlike C++, the @code{inline} keyword
-does not affect the linkage of the function.
-
-@cindex automatic @code{inline} for C++ member fns
-@cindex @code{inline} automatic for C++ member fns
-@cindex member fns, automatically @code{inline}
-@cindex C++ member fns, automatically @code{inline}
-GNU CC automatically inlines member functions defined within the class
-body of C++ programs even if they are not explicitly declared
-@code{inline}. (You can override this with @samp{-fno-default-inline};
-@pxref{C++ Dialect Options,,Options Controlling C++ Dialect}.)
-
-@cindex inline functions, omission of
-When a function is both inline and @code{static}, if all calls to the
-function are integrated into the caller, and the function's address is
-never used, then the function's own assembler code is never referenced.
-In this case, GNU CC does not actually output assembler code for the
-function, unless you specify the option @samp{-fkeep-inline-functions}.
-Some calls cannot be integrated for various reasons (in particular,
-calls that precede the function's definition cannot be integrated, and
-neither can recursive calls within the definition). If there is a
-nonintegrated call, then the function is compiled to assembler code as
-usual. The function must also be compiled as usual if the program
-refers to its address, because that can't be inlined.
-
-@cindex non-static inline function
-When an inline function is not @code{static}, then the compiler must assume
-that there may be calls from other source files; since a global symbol can
-be defined only once in any program, the function must not be defined in
-the other source files, so the calls therein cannot be integrated.
-Therefore, a non-@code{static} inline function is always compiled on its
-own in the usual fashion.
-
-If you specify both @code{inline} and @code{extern} in the function
-definition, then the definition is used only for inlining. In no case
-is the function compiled on its own, not even if you refer to its
-address explicitly. Such an address becomes an external reference, as
-if you had only declared the function, and had not defined it.
-
-This combination of @code{inline} and @code{extern} has almost the
-effect of a macro. The way to use it is to put a function definition in
-a header file with these keywords, and put another copy of the
-definition (lacking @code{inline} and @code{extern}) in a library file.
-The definition in the header file will cause most calls to the function
-to be inlined. If any uses of the function remain, they will refer to
-the single copy in the library.
-
-GNU C does not inline any functions when not optimizing. It is not
-clear whether it is better to inline or not, in this case, but we found
-that a correct implementation when not optimizing was difficult. So we
-did the easy thing, and turned it off.
-
-@node Extended Asm
-@section Assembler Instructions with C Expression Operands
-@cindex extended @code{asm}
-@cindex @code{asm} expressions
-@cindex assembler instructions
-@cindex registers
-
-In an assembler instruction using @code{asm}, you can specify the
-operands of the instruction using C expressions. This means you need not
-guess which registers or memory locations will contain the data you want
-to use.
-
-You must specify an assembler instruction template much like what
-appears in a machine description, plus an operand constraint string for
-each operand.
-
-For example, here is how to use the 68881's @code{fsinx} instruction:
-
-@example
-asm ("fsinx %1,%0" : "=f" (result) : "f" (angle));
-@end example
-
-@noindent
-Here @code{angle} is the C expression for the input operand while
-@code{result} is that of the output operand. Each has @samp{"f"} as its
-operand constraint, saying that a floating point register is required.
-The @samp{=} in @samp{=f} indicates that the operand is an output; all
-output operands' constraints must use @samp{=}. The constraints use the
-same language used in the machine description (@pxref{Constraints}).
-
-Each operand is described by an operand-constraint string followed by
-the C expression in parentheses. A colon separates the assembler
-template from the first output operand and another separates the last
-output operand from the first input, if any. Commas separate the
-operands within each group. The total number of operands is limited to
-ten or to the maximum number of operands in any instruction pattern in
-the machine description, whichever is greater.
-
-If there are no output operands but there are input operands, you must
-place two consecutive colons surrounding the place where the output
-operands would go.
-
-Output operand expressions must be lvalues; the compiler can check this.
-The input operands need not be lvalues. The compiler cannot check
-whether the operands have data types that are reasonable for the
-instruction being executed. It does not parse the assembler instruction
-template and does not know what it means or even whether it is valid
-assembler input. The extended @code{asm} feature is most often used for
-machine instructions the compiler itself does not know exist. If
-the output expression cannot be directly addressed (for example, it is a
-bit field), your constraint must allow a register. In that case, GNU CC
-will use the register as the output of the @code{asm}, and then store
-that register into the output.
-
-The ordinary output operands must be write-only; GNU CC will assume that
-the values in these operands before the instruction are dead and need
-not be generated. Extended asm supports input-output or read-write
-operands. Use the constraint character @samp{+} to indicate such an
-operand and list it with the output operands.
-
-When the constraints for the read-write operand (or the operand in which
-only some of the bits are to be changed) allows a register, you may, as
-an alternative, logically split its function into two separate operands,
-one input operand and one write-only output operand. The connection
-between them is expressed by constraints which say they need to be in
-the same location when the instruction executes. You can use the same C
-expression for both operands, or different expressions. For example,
-here we write the (fictitious) @samp{combine} instruction with
-@code{bar} as its read-only source operand and @code{foo} as its
-read-write destination:
-
-@example
-asm ("combine %2,%0" : "=r" (foo) : "0" (foo), "g" (bar));
-@end example
-
-@noindent
-The constraint @samp{"0"} for operand 1 says that it must occupy the
-same location as operand 0. A digit in constraint is allowed only in an
-input operand and it must refer to an output operand.
-
-Only a digit in the constraint can guarantee that one operand will be in
-the same place as another. The mere fact that @code{foo} is the value
-of both operands is not enough to guarantee that they will be in the
-same place in the generated assembler code. The following would not
-work reliably:
-
-@example
-asm ("combine %2,%0" : "=r" (foo) : "r" (foo), "g" (bar));
-@end example
-
-Various optimizations or reloading could cause operands 0 and 1 to be in
-different registers; GNU CC knows no reason not to do so. For example, the
-compiler might find a copy of the value of @code{foo} in one register and
-use it for operand 1, but generate the output operand 0 in a different
-register (copying it afterward to @code{foo}'s own address). Of course,
-since the register for operand 1 is not even mentioned in the assembler
-code, the result will not work, but GNU CC can't tell that.
-
-Some instructions clobber specific hard registers. To describe this,
-write a third colon after the input operands, followed by the names of
-the clobbered hard registers (given as strings). Here is a realistic
-example for the VAX:
-
-@example
-asm volatile ("movc3 %0,%1,%2"
- : /* no outputs */
- : "g" (from), "g" (to), "g" (count)
- : "r0", "r1", "r2", "r3", "r4", "r5");
-@end example
-
-It is an error for a clobber description to overlap an input or output
-operand (for example, an operand describing a register class with one
-member, mentioned in the clobber list). Most notably, it is invalid to
-describe that an input operand is modified, but unused as output. It has
-to be specified as an input and output operand anyway. Note that if there
-are only unused output operands, you will then also need to specify
-@code{volatile} for the @code{asm} construct, as described below.
-
-If you refer to a particular hardware register from the assembler code,
-you will probably have to list the register after the third colon to
-tell the compiler the register's value is modified. In some assemblers,
-the register names begin with @samp{%}; to produce one @samp{%} in the
-assembler code, you must write @samp{%%} in the input.
-
-If your assembler instruction can alter the condition code register, add
-@samp{cc} to the list of clobbered registers. GNU CC on some machines
-represents the condition codes as a specific hardware register;
-@samp{cc} serves to name this register. On other machines, the
-condition code is handled differently, and specifying @samp{cc} has no
-effect. But it is valid no matter what the machine.
-
-If your assembler instruction modifies memory in an unpredictable
-fashion, add @samp{memory} to the list of clobbered registers. This
-will cause GNU CC to not keep memory values cached in registers across
-the assembler instruction.
-
-You can put multiple assembler instructions together in a single
-@code{asm} template, separated either with newlines (written as
-@samp{\n}) or with semicolons if the assembler allows such semicolons.
-The GNU assembler allows semicolons and most Unix assemblers seem to do
-so. The input operands are guaranteed not to use any of the clobbered
-registers, and neither will the output operands' addresses, so you can
-read and write the clobbered registers as many times as you like. Here
-is an example of multiple instructions in a template; it assumes the
-subroutine @code{_foo} accepts arguments in registers 9 and 10:
-
-@example
-asm ("movl %0,r9;movl %1,r10;call _foo"
- : /* no outputs */
- : "g" (from), "g" (to)
- : "r9", "r10");
-@end example
-
-Unless an output operand has the @samp{&} constraint modifier, GNU CC
-may allocate it in the same register as an unrelated input operand, on
-the assumption the inputs are consumed before the outputs are produced.
-This assumption may be false if the assembler code actually consists of
-more than one instruction. In such a case, use @samp{&} for each output
-operand that may not overlap an input. @xref{Modifiers}.
-
-If you want to test the condition code produced by an assembler
-instruction, you must include a branch and a label in the @code{asm}
-construct, as follows:
-
-@example
-asm ("clr %0;frob %1;beq 0f;mov #1,%0;0:"
- : "g" (result)
- : "g" (input));
-@end example
-
-@noindent
-This assumes your assembler supports local labels, as the GNU assembler
-and most Unix assemblers do.
-
-Speaking of labels, jumps from one @code{asm} to another are not
-supported. The compiler's optimizers do not know about these jumps, and
-therefore they cannot take account of them when deciding how to
-optimize.
-
-@cindex macros containing @code{asm}
-Usually the most convenient way to use these @code{asm} instructions is to
-encapsulate them in macros that look like functions. For example,
-
-@example
-#define sin(x) \
-(@{ double __value, __arg = (x); \
- asm ("fsinx %1,%0": "=f" (__value): "f" (__arg)); \
- __value; @})
-@end example
-
-@noindent
-Here the variable @code{__arg} is used to make sure that the instruction
-operates on a proper @code{double} value, and to accept only those
-arguments @code{x} which can convert automatically to a @code{double}.
-
-Another way to make sure the instruction operates on the correct data
-type is to use a cast in the @code{asm}. This is different from using a
-variable @code{__arg} in that it converts more different types. For
-example, if the desired type were @code{int}, casting the argument to
-@code{int} would accept a pointer with no complaint, while assigning the
-argument to an @code{int} variable named @code{__arg} would warn about
-using a pointer unless the caller explicitly casts it.
-
-If an @code{asm} has output operands, GNU CC assumes for optimization
-purposes the instruction has no side effects except to change the output
-operands. This does not mean instructions with a side effect cannot be
-used, but you must be careful, because the compiler may eliminate them
-if the output operands aren't used, or move them out of loops, or
-replace two with one if they constitute a common subexpression. Also,
-if your instruction does have a side effect on a variable that otherwise
-appears not to change, the old value of the variable may be reused later
-if it happens to be found in a register.
-
-You can prevent an @code{asm} instruction from being deleted, moved
-significantly, or combined, by writing the keyword @code{volatile} after
-the @code{asm}. For example:
-
-@example
-#define get_and_set_priority(new) \
-(@{ int __old; \
- asm volatile ("get_and_set_priority %0, %1": "=g" (__old) : "g" (new)); \
- __old; @})
-@end example
-
-@noindent
-If you write an @code{asm} instruction with no outputs, GNU CC will know
-the instruction has side-effects and will not delete the instruction or
-move it outside of loops. If the side-effects of your instruction are
-not purely external, but will affect variables in your program in ways
-other than reading the inputs and clobbering the specified registers or
-memory, you should write the @code{volatile} keyword to prevent future
-versions of GNU CC from moving the instruction around within a core
-region.
-
-An @code{asm} instruction without any operands or clobbers (and ``old
-style'' @code{asm}) will not be deleted or moved significantly,
-regardless, unless it is unreachable, the same wasy as if you had
-written a @code{volatile} keyword.
-
-Note that even a volatile @code{asm} instruction can be moved in ways
-that appear insignificant to the compiler, such as across jump
-instructions. You can't expect a sequence of volatile @code{asm}
-instructions to remain perfectly consecutive. If you want consecutive
-output, use a single @code{asm}.
-
-It is a natural idea to look for a way to give access to the condition
-code left by the assembler instruction. However, when we attempted to
-implement this, we found no way to make it work reliably. The problem
-is that output operands might need reloading, which would result in
-additional following ``store'' instructions. On most machines, these
-instructions would alter the condition code before there was time to
-test it. This problem doesn't arise for ordinary ``test'' and
-``compare'' instructions because they don't have any output operands.
-
-If you are writing a header file that should be includable in ANSI C
-programs, write @code{__asm__} instead of @code{asm}. @xref{Alternate
-Keywords}.
-
-@subsection i386 floating point asm operands
-
-There are several rules on the usage of stack-like regs in
-asm_operands insns. These rules apply only to the operands that are
-stack-like regs:
-
-@enumerate
-@item
-Given a set of input regs that die in an asm_operands, it is
-necessary to know which are implicitly popped by the asm, and
-which must be explicitly popped by gcc.
-
-An input reg that is implicitly popped by the asm must be
-explicitly clobbered, unless it is constrained to match an
-output operand.
-
-@item
-For any input reg that is implicitly popped by an asm, it is
-necessary to know how to adjust the stack to compensate for the pop.
-If any non-popped input is closer to the top of the reg-stack than
-the implicitly popped reg, it would not be possible to know what the
-stack looked like --- it's not clear how the rest of the stack ``slides
-up''.
-
-All implicitly popped input regs must be closer to the top of
-the reg-stack than any input that is not implicitly popped.
-
-It is possible that if an input dies in an insn, reload might
-use the input reg for an output reload. Consider this example:
-
-@example
-asm ("foo" : "=t" (a) : "f" (b));
-@end example
-
-This asm says that input B is not popped by the asm, and that
-the asm pushes a result onto the reg-stack, ie, the stack is one
-deeper after the asm than it was before. But, it is possible that
-reload will think that it can use the same reg for both the input and
-the output, if input B dies in this insn.
-
-If any input operand uses the @code{f} constraint, all output reg
-constraints must use the @code{&} earlyclobber.
-
-The asm above would be written as
-
-@example
-asm ("foo" : "=&t" (a) : "f" (b));
-@end example
-
-@item
-Some operands need to be in particular places on the stack. All
-output operands fall in this category --- there is no other way to
-know which regs the outputs appear in unless the user indicates
-this in the constraints.
-
-Output operands must specifically indicate which reg an output
-appears in after an asm. @code{=f} is not allowed: the operand
-constraints must select a class with a single reg.
-
-@item
-Output operands may not be ``inserted'' between existing stack regs.
-Since no 387 opcode uses a read/write operand, all output operands
-are dead before the asm_operands, and are pushed by the asm_operands.
-It makes no sense to push anywhere but the top of the reg-stack.
-
-Output operands must start at the top of the reg-stack: output
-operands may not ``skip'' a reg.
-
-@item
-Some asm statements may need extra stack space for internal
-calculations. This can be guaranteed by clobbering stack registers
-unrelated to the inputs and outputs.
-
-@end enumerate
-
-Here are a couple of reasonable asms to want to write. This asm
-takes one input, which is internally popped, and produces two outputs.
-
-@example
-asm ("fsincos" : "=t" (cos), "=u" (sin) : "0" (inp));
-@end example
-
-This asm takes two inputs, which are popped by the @code{fyl2xp1} opcode,
-and replaces them with one output. The user must code the @code{st(1)}
-clobber for reg-stack.c to know that @code{fyl2xp1} pops both inputs.
-
-@example
-asm ("fyl2xp1" : "=t" (result) : "0" (x), "u" (y) : "st(1)");
-@end example
-
-@ifclear INTERNALS
-@c Show the details on constraints if they do not appear elsewhere in
-@c the manual
-@include md.texi
-@end ifclear
-
-@node Asm Labels
-@section Controlling Names Used in Assembler Code
-@cindex assembler names for identifiers
-@cindex names used in assembler code
-@cindex identifiers, names in assembler code
-
-You can specify the name to be used in the assembler code for a C
-function or variable by writing the @code{asm} (or @code{__asm__})
-keyword after the declarator as follows:
-
-@example
-int foo asm ("myfoo") = 2;
-@end example
-
-@noindent
-This specifies that the name to be used for the variable @code{foo} in
-the assembler code should be @samp{myfoo} rather than the usual
-@samp{_foo}.
-
-On systems where an underscore is normally prepended to the name of a C
-function or variable, this feature allows you to define names for the
-linker that do not start with an underscore.
-
-You cannot use @code{asm} in this way in a function @emph{definition}; but
-you can get the same effect by writing a declaration for the function
-before its definition and putting @code{asm} there, like this:
-
-@example
-extern func () asm ("FUNC");
-
-func (x, y)
- int x, y;
-@dots{}
-@end example
-
-It is up to you to make sure that the assembler names you choose do not
-conflict with any other assembler symbols. Also, you must not use a
-register name; that would produce completely invalid assembler code. GNU
-CC does not as yet have the ability to store static variables in registers.
-Perhaps that will be added.
-
-@node Explicit Reg Vars
-@section Variables in Specified Registers
-@cindex explicit register variables
-@cindex variables in specified registers
-@cindex specified registers
-@cindex registers, global allocation
-
-GNU C allows you to put a few global variables into specified hardware
-registers. You can also specify the register in which an ordinary
-register variable should be allocated.
-
-@itemize @bullet
-@item
-Global register variables reserve registers throughout the program.
-This may be useful in programs such as programming language
-interpreters which have a couple of global variables that are accessed
-very often.
-
-@item
-Local register variables in specific registers do not reserve the
-registers. The compiler's data flow analysis is capable of determining
-where the specified registers contain live values, and where they are
-available for other uses. Stores into local register variables may be deleted
-when they appear to be dead according to dataflow analysis. References
-to local register variables may be deleted or moved or simplified.
-
-These local variables are sometimes convenient for use with the extended
-@code{asm} feature (@pxref{Extended Asm}), if you want to write one
-output of the assembler instruction directly into a particular register.
-(This will work provided the register you specify fits the constraints
-specified for that operand in the @code{asm}.)
-@end itemize
-
-@menu
-* Global Reg Vars::
-* Local Reg Vars::
-@end menu
-
-@node Global Reg Vars
-@subsection Defining Global Register Variables
-@cindex global register variables
-@cindex registers, global variables in
-
-You can define a global register variable in GNU C like this:
-
-@example
-register int *foo asm ("a5");
-@end example
-
-@noindent
-Here @code{a5} is the name of the register which should be used. Choose a
-register which is normally saved and restored by function calls on your
-machine, so that library routines will not clobber it.
-
-Naturally the register name is cpu-dependent, so you would need to
-conditionalize your program according to cpu type. The register
-@code{a5} would be a good choice on a 68000 for a variable of pointer
-type. On machines with register windows, be sure to choose a ``global''
-register that is not affected magically by the function call mechanism.
-
-In addition, operating systems on one type of cpu may differ in how they
-name the registers; then you would need additional conditionals. For
-example, some 68000 operating systems call this register @code{%a5}.
-
-Eventually there may be a way of asking the compiler to choose a register
-automatically, but first we need to figure out how it should choose and
-how to enable you to guide the choice. No solution is evident.
-
-Defining a global register variable in a certain register reserves that
-register entirely for this use, at least within the current compilation.
-The register will not be allocated for any other purpose in the functions
-in the current compilation. The register will not be saved and restored by
-these functions. Stores into this register are never deleted even if they
-would appear to be dead, but references may be deleted or moved or
-simplified.
-
-It is not safe to access the global register variables from signal
-handlers, or from more than one thread of control, because the system
-library routines may temporarily use the register for other things (unless
-you recompile them specially for the task at hand).
-
-@cindex @code{qsort}, and global register variables
-It is not safe for one function that uses a global register variable to
-call another such function @code{foo} by way of a third function
-@code{lose} that was compiled without knowledge of this variable (i.e. in a
-different source file in which the variable wasn't declared). This is
-because @code{lose} might save the register and put some other value there.
-For example, you can't expect a global register variable to be available in
-the comparison-function that you pass to @code{qsort}, since @code{qsort}
-might have put something else in that register. (If you are prepared to
-recompile @code{qsort} with the same global register variable, you can
-solve this problem.)
-
-If you want to recompile @code{qsort} or other source files which do not
-actually use your global register variable, so that they will not use that
-register for any other purpose, then it suffices to specify the compiler
-option @samp{-ffixed-@var{reg}}. You need not actually add a global
-register declaration to their source code.
-
-A function which can alter the value of a global register variable cannot
-safely be called from a function compiled without this variable, because it
-could clobber the value the caller expects to find there on return.
-Therefore, the function which is the entry point into the part of the
-program that uses the global register variable must explicitly save and
-restore the value which belongs to its caller.
-
-@cindex register variable after @code{longjmp}
-@cindex global register after @code{longjmp}
-@cindex value after @code{longjmp}
-@findex longjmp
-@findex setjmp
-On most machines, @code{longjmp} will restore to each global register
-variable the value it had at the time of the @code{setjmp}. On some
-machines, however, @code{longjmp} will not change the value of global
-register variables. To be portable, the function that called @code{setjmp}
-should make other arrangements to save the values of the global register
-variables, and to restore them in a @code{longjmp}. This way, the same
-thing will happen regardless of what @code{longjmp} does.
-
-All global register variable declarations must precede all function
-definitions. If such a declaration could appear after function
-definitions, the declaration would be too late to prevent the register from
-being used for other purposes in the preceding functions.
-
-Global register variables may not have initial values, because an
-executable file has no means to supply initial contents for a register.
-
-On the Sparc, there are reports that g3 @dots{} g7 are suitable
-registers, but certain library functions, such as @code{getwd}, as well
-as the subroutines for division and remainder, modify g3 and g4. g1 and
-g2 are local temporaries.
-
-On the 68000, a2 @dots{} a5 should be suitable, as should d2 @dots{} d7.
-Of course, it will not do to use more than a few of those.
-
-@node Local Reg Vars
-@subsection Specifying Registers for Local Variables
-@cindex local variables, specifying registers
-@cindex specifying registers for local variables
-@cindex registers for local variables
-
-You can define a local register variable with a specified register
-like this:
-
-@example
-register int *foo asm ("a5");
-@end example
-
-@noindent
-Here @code{a5} is the name of the register which should be used. Note
-that this is the same syntax used for defining global register
-variables, but for a local variable it would appear within a function.
-
-Naturally the register name is cpu-dependent, but this is not a
-problem, since specific registers are most often useful with explicit
-assembler instructions (@pxref{Extended Asm}). Both of these things
-generally require that you conditionalize your program according to
-cpu type.
-
-In addition, operating systems on one type of cpu may differ in how they
-name the registers; then you would need additional conditionals. For
-example, some 68000 operating systems call this register @code{%a5}.
-
-Defining such a register variable does not reserve the register; it
-remains available for other uses in places where flow control determines
-the variable's value is not live. However, these registers are made
-unavailable for use in the reload pass; excessive use of this feature
-leaves the compiler too few available registers to compile certain
-functions.
-
-This option does not guarantee that GNU CC will generate code that has
-this variable in the register you specify at all times. You may not
-code an explicit reference to this register in an @code{asm} statement
-and assume it will always refer to this variable.
-
-Stores into local register variables may be deleted when they appear to be dead
-according to dataflow analysis. References to local register variables may
-be deleted or moved or simplified.
-
-@node Alternate Keywords
-@section Alternate Keywords
-@cindex alternate keywords
-@cindex keywords, alternate
-
-The option @samp{-traditional} disables certain keywords; @samp{-ansi}
-disables certain others. This causes trouble when you want to use GNU C
-extensions, or ANSI C features, in a general-purpose header file that
-should be usable by all programs, including ANSI C programs and traditional
-ones. The keywords @code{asm}, @code{typeof} and @code{inline} cannot be
-used since they won't work in a program compiled with @samp{-ansi}, while
-the keywords @code{const}, @code{volatile}, @code{signed}, @code{typeof}
-and @code{inline} won't work in a program compiled with
-@samp{-traditional}.@refill
-
-The way to solve these problems is to put @samp{__} at the beginning and
-end of each problematical keyword. For example, use @code{__asm__}
-instead of @code{asm}, @code{__const__} instead of @code{const}, and
-@code{__inline__} instead of @code{inline}.
-
-Other C compilers won't accept these alternative keywords; if you want to
-compile with another compiler, you can define the alternate keywords as
-macros to replace them with the customary keywords. It looks like this:
-
-@example
-#ifndef __GNUC__
-#define __asm__ asm
-#endif
-@end example
-
-@findex __extension__
-@samp{-pedantic} causes warnings for many GNU C extensions. You can
-prevent such warnings within one expression by writing
-@code{__extension__} before the expression. @code{__extension__} has no
-effect aside from this.
-
-@node Incomplete Enums
-@section Incomplete @code{enum} Types
-
-You can define an @code{enum} tag without specifying its possible values.
-This results in an incomplete type, much like what you get if you write
-@code{struct foo} without describing the elements. A later declaration
-which does specify the possible values completes the type.
-
-You can't allocate variables or storage using the type while it is
-incomplete. However, you can work with pointers to that type.
-
-This extension may not be very useful, but it makes the handling of
-@code{enum} more consistent with the way @code{struct} and @code{union}
-are handled.
-
-This extension is not supported by GNU C++.
-
-@node Function Names
-@section Function Names as Strings
-
-GNU CC predefines two string variables to be the name of the current function.
-The variable @code{__FUNCTION__} is the name of the function as it appears
-in the source. The variable @code{__PRETTY_FUNCTION__} is the name of
-the function pretty printed in a language specific fashion.
-
-These names are always the same in a C function, but in a C++ function
-they may be different. For example, this program:
-
-@smallexample
-extern "C" @{
-extern int printf (char *, ...);
-@}
-
-class a @{
- public:
- sub (int i)
- @{
- printf ("__FUNCTION__ = %s\n", __FUNCTION__);
- printf ("__PRETTY_FUNCTION__ = %s\n", __PRETTY_FUNCTION__);
- @}
-@};
-
-int
-main (void)
-@{
- a ax;
- ax.sub (0);
- return 0;
-@}
-@end smallexample
-
-@noindent
-gives this output:
-
-@smallexample
-__FUNCTION__ = sub
-__PRETTY_FUNCTION__ = int a::sub (int)
-@end smallexample
-
-These names are not macros: they are predefined string variables.
-For example, @samp{#ifdef __FUNCTION__} does not have any special
-meaning inside a function, since the preprocessor does not do anything
-special with the identifier @code{__FUNCTION__}.
-
-@node Return Address
-@section Getting the Return or Frame Address of a Function
-
-These functions may be used to get information about the callers of a
-function.
-
-@table @code
-@findex __builtin_return_address
-@item __builtin_return_address (@var{level})
-This function returns the return address of the current function, or of
-one of its callers. The @var{level} argument is number of frames to
-scan up the call stack. A value of @code{0} yields the return address
-of the current function, a value of @code{1} yields the return address
-of the caller of the current function, and so forth.
-
-The @var{level} argument must be a constant integer.
-
-On some machines it may be impossible to determine the return address of
-any function other than the current one; in such cases, or when the top
-of the stack has been reached, this function will return @code{0}.
-
-This function should only be used with a non-zero argument for debugging
-purposes.
-
-@findex __builtin_frame_address
-@item __builtin_frame_address (@var{level})
-This function is similar to @code{__builtin_return_address}, but it
-returns the address of the function frame rather than the return address
-of the function. Calling @code{__builtin_frame_address} with a value of
-@code{0} yields the frame address of the current function, a value of
-@code{1} yields the frame address of the caller of the current function,
-and so forth.
-
-The frame is the area on the stack which holds local variables and saved
-registers. The frame address is normally the address of the first word
-pushed on to the stack by the function. However, the exact definition
-depends upon the processor and the calling convention. If the processor
-has a dedicated frame pointer register, and the function has a frame,
-then @code{__builtin_frame_address} will return the value of the frame
-pointer register.
-
-The caveats that apply to @code{__builtin_return_address} apply to this
-function as well.
-@end table
-
-@node Other Builtins
-@section Other built-in functions provided by GNU CC
-
-GNU CC provides a large number of built-in functions other than the ones
-mentioned above. Some of these are for internal use in the processing
-of exceptions or variable-length argument lists and will not be
-documented here because they may change from time to time; we do not
-recommend general use of these functions.
-
-The remaining functions are provided for optimization purposes.
-
-GNU CC includes builtin versions of many of the functions in the
-standard C library. These will always be treated as having the same
-meaning as the C library function even if you specify the
-@samp{-fno-builtin} (@pxref{C Dialect Options}) option. These functions
-correspond to the C library functions @code{alloca}, @code{ffs},
-@code{abs}, @code{fabsf}, @code{fabs}, @code{fabsl}, @code{labs},
-@code{memcpy}, @code{memcmp}, @code{strcmp}, @code{strcpy},
-@code{strlen}, @code{sqrtf}, @code{sqrt}, @code{sqrtl}, @code{sinf},
-@code{sin}, @code{sinl}, @code{cosf}, @code{cos}, and @code{cosl}.
-
-@findex __builtin_constant_p
-You can use the builtin function @code{__builtin_constant_p} to
-determine if a value is known to be constant at compile-time and hence
-that GNU CC can perform constant-folding on expressions involving that
-value. The argument of the function is the value to test. The function
-returns the integer 1 if the argument is known to be a compile-time
-constant and 0 if it is not known to be a compile-time constant. A
-return of 0 does not indicate that the value is @emph{not} a constant,
-but merely that GNU CC cannot prove it is a constant with the specified
-value of the @samp{-O} option.
-
-You would typically use this function in an embedded application where
-memory was a critical resource. If you have some complex calculation,
-you may want it to be folded if it involves constants, but need to call
-a function if it does not. For example:
-
-@smallexample
-#define Scale_Value(X) \
- (__builtin_constant_p (X) ? ((X) * SCALE + OFFSET) : Scale (X))
-@end smallexample
-
-You may use this builtin function in either a macro or an inline
-function. However, if you use it in an inlined function and pass an
-argument of the function as the argument to the builtin, GNU CC will
-never return 1 when you call the inline function with a string constant
-or constructor expression (@pxref{Constructors}) and will not return 1
-when you pass a constant numeric value to the inline function unless you
-specify the @samp{-O} option.
-
-@node Deprecated Features
-@section Deprecated Features
-
-In the past, the GNU C++ compiler was extended to experiment with new
-features, at a time when the C++ language was still evolving. Now that
-the C++ standard is complete, some of those features are superceded by
-superior alternatives. Using the old features might cause a warning in
-some cases that the feature will be dropped in the future. In other
-cases, the feature might be gone already.
-
-While the list below is not exhaustive, it documents some of the options
-that are now deprecated:
-
-@table @code
-@item -fthis-is-variable
-In early versions of C++, assignment to this could be used to implement
-application-defined memory allocation. Now, allocation functions
-(@samp{operator new}) are the standard-conforming way to achieve the
-same effect.
-
-@item -fexternal-templates
-@itemx -falt-external-templates
-These are two of the many ways for g++ to implement template
-instantiation. @xref{Template Instantiation}. The C++ standard clearly
-defines how template definitions have to be organized across
-implementation units. g++ has an implicit instantiation mechanism that
-should work just fine for standard-conforming code.
-
-@end table
-
-@node C++ Extensions
-@chapter Extensions to the C++ Language
-@cindex extensions, C++ language
-@cindex C++ language extensions
-
-The GNU compiler provides these extensions to the C++ language (and you
-can also use most of the C language extensions in your C++ programs). If you
-want to write code that checks whether these features are available, you can
-test for the GNU compiler the same way as for C programs: check for a
-predefined macro @code{__GNUC__}. You can also use @code{__GNUG__} to
-test specifically for GNU C++ (@pxref{Standard Predefined,,Standard
-Predefined Macros,cpp.info,The C Preprocessor}).
-
-@menu
-* Naming Results:: Giving a name to C++ function return values.
-* Min and Max:: C++ Minimum and maximum operators.
-* Destructors and Goto:: Goto is safe to use in C++ even when destructors
- are needed.
-* C++ Interface:: You can use a single C++ header file for both
- declarations and definitions.
-* Template Instantiation:: Methods for ensuring that exactly one copy of
- each needed template instantiation is emitted.
-* Bound member functions:: You can extract a function pointer to the
- method denoted by a @samp{->*} or @samp{.*} expression.
-* C++ Signatures:: You can specify abstract types to get subtype
- polymorphism independent from inheritance.
-
-@end menu
-
-@node Naming Results
-@section Named Return Values in C++
-
-@cindex @code{return}, in C++ function header
-@cindex return value, named, in C++
-@cindex named return value in C++
-@cindex C++ named return value
-GNU C++ extends the function-definition syntax to allow you to specify a
-name for the result of a function outside the body of the definition, in
-C++ programs:
-
-@example
-@group
-@var{type}
-@var{functionname} (@var{args}) return @var{resultname};
-@{
- @dots{}
- @var{body}
- @dots{}
-@}
-@end group
-@end example
-
-You can use this feature to avoid an extra constructor call when
-a function result has a class type. For example, consider a function
-@code{m}, declared as @w{@samp{X v = m ();}}, whose result is of class
-@code{X}:
-
-@example
-X
-m ()
-@{
- X b;
- b.a = 23;
- return b;
-@}
-@end example
-
-@cindex implicit argument: return value
-Although @code{m} appears to have no arguments, in fact it has one implicit
-argument: the address of the return value. At invocation, the address
-of enough space to hold @code{v} is sent in as the implicit argument.
-Then @code{b} is constructed and its @code{a} field is set to the value
-23. Finally, a copy constructor (a constructor of the form @samp{X(X&)})
-is applied to @code{b}, with the (implicit) return value location as the
-target, so that @code{v} is now bound to the return value.
-
-But this is wasteful. The local @code{b} is declared just to hold
-something that will be copied right out. While a compiler that
-combined an ``elision'' algorithm with interprocedural data flow
-analysis could conceivably eliminate all of this, it is much more
-practical to allow you to assist the compiler in generating
-efficient code by manipulating the return value explicitly,
-thus avoiding the local variable and copy constructor altogether.
-
-Using the extended GNU C++ function-definition syntax, you can avoid the
-temporary allocation and copying by naming @code{r} as your return value
-at the outset, and assigning to its @code{a} field directly:
-
-@example
-X
-m () return r;
-@{
- r.a = 23;
-@}
-@end example
-
-@noindent
-The declaration of @code{r} is a standard, proper declaration, whose effects
-are executed @strong{before} any of the body of @code{m}.
-
-Functions of this type impose no additional restrictions; in particular,
-you can execute @code{return} statements, or return implicitly by
-reaching the end of the function body (``falling off the edge'').
-Cases like
-
-@example
-X
-m () return r (23);
-@{
- return;
-@}
-@end example
-
-@noindent
-(or even @w{@samp{X m () return r (23); @{ @}}}) are unambiguous, since
-the return value @code{r} has been initialized in either case. The
-following code may be hard to read, but also works predictably:
-
-@example
-X
-m () return r;
-@{
- X b;
- return b;
-@}
-@end example
-
-The return value slot denoted by @code{r} is initialized at the outset,
-but the statement @samp{return b;} overrides this value. The compiler
-deals with this by destroying @code{r} (calling the destructor if there
-is one, or doing nothing if there is not), and then reinitializing
-@code{r} with @code{b}.
-
-This extension is provided primarily to help people who use overloaded
-operators, where there is a great need to control not just the
-arguments, but the return values of functions. For classes where the
-copy constructor incurs a heavy performance penalty (especially in the
-common case where there is a quick default constructor), this is a major
-savings. The disadvantage of this extension is that you do not control
-when the default constructor for the return value is called: it is
-always called at the beginning.
-
-@node Min and Max
-@section Minimum and Maximum Operators in C++
-
-It is very convenient to have operators which return the ``minimum'' or the
-``maximum'' of two arguments. In GNU C++ (but not in GNU C),
-
-@table @code
-@item @var{a} <? @var{b}
-@findex <?
-@cindex minimum operator
-is the @dfn{minimum}, returning the smaller of the numeric values
-@var{a} and @var{b};
-
-@item @var{a} >? @var{b}
-@findex >?
-@cindex maximum operator
-is the @dfn{maximum}, returning the larger of the numeric values @var{a}
-and @var{b}.
-@end table
-
-These operations are not primitive in ordinary C++, since you can
-use a macro to return the minimum of two things in C++, as in the
-following example.
-
-@example
-#define MIN(X,Y) ((X) < (Y) ? : (X) : (Y))
-@end example
-
-@noindent
-You might then use @w{@samp{int min = MIN (i, j);}} to set @var{min} to
-the minimum value of variables @var{i} and @var{j}.
-
-However, side effects in @code{X} or @code{Y} may cause unintended
-behavior. For example, @code{MIN (i++, j++)} will fail, incrementing
-the smaller counter twice. A GNU C extension allows you to write safe
-macros that avoid this kind of problem (@pxref{Naming Types,,Naming an
-Expression's Type}). However, writing @code{MIN} and @code{MAX} as
-macros also forces you to use function-call notation for a
-fundamental arithmetic operation. Using GNU C++ extensions, you can
-write @w{@samp{int min = i <? j;}} instead.
-
-Since @code{<?} and @code{>?} are built into the compiler, they properly
-handle expressions with side-effects; @w{@samp{int min = i++ <? j++;}}
-works correctly.
-
-@node Destructors and Goto
-@section @code{goto} and Destructors in GNU C++
-
-@cindex @code{goto} in C++
-@cindex destructors vs @code{goto}
-In C++ programs, you can safely use the @code{goto} statement. When you
-use it to exit a block which contains aggregates requiring destructors,
-the destructors will run before the @code{goto} transfers control.
-
-@cindex constructors vs @code{goto}
-The compiler still forbids using @code{goto} to @emph{enter} a scope
-that requires constructors.
-
-@node C++ Interface
-@section Declarations and Definitions in One Header
-
-@cindex interface and implementation headers, C++
-@cindex C++ interface and implementation headers
-C++ object definitions can be quite complex. In principle, your source
-code will need two kinds of things for each object that you use across
-more than one source file. First, you need an @dfn{interface}
-specification, describing its structure with type declarations and
-function prototypes. Second, you need the @dfn{implementation} itself.
-It can be tedious to maintain a separate interface description in a
-header file, in parallel to the actual implementation. It is also
-dangerous, since separate interface and implementation definitions may
-not remain parallel.
-
-@cindex pragmas, interface and implementation
-With GNU C++, you can use a single header file for both purposes.
-
-@quotation
-@emph{Warning:} The mechanism to specify this is in transition. For the
-nonce, you must use one of two @code{#pragma} commands; in a future
-release of GNU C++, an alternative mechanism will make these
-@code{#pragma} commands unnecessary.
-@end quotation
-
-The header file contains the full definitions, but is marked with
-@samp{#pragma interface} in the source code. This allows the compiler
-to use the header file only as an interface specification when ordinary
-source files incorporate it with @code{#include}. In the single source
-file where the full implementation belongs, you can use either a naming
-convention or @samp{#pragma implementation} to indicate this alternate
-use of the header file.
-
-@table @code
-@item #pragma interface
-@itemx #pragma interface "@var{subdir}/@var{objects}.h"
-@kindex #pragma interface
-Use this directive in @emph{header files} that define object classes, to save
-space in most of the object files that use those classes. Normally,
-local copies of certain information (backup copies of inline member
-functions, debugging information, and the internal tables that implement
-virtual functions) must be kept in each object file that includes class
-definitions. You can use this pragma to avoid such duplication. When a
-header file containing @samp{#pragma interface} is included in a
-compilation, this auxiliary information will not be generated (unless
-the main input source file itself uses @samp{#pragma implementation}).
-Instead, the object files will contain references to be resolved at link
-time.
-
-The second form of this directive is useful for the case where you have
-multiple headers with the same name in different directories. If you
-use this form, you must specify the same string to @samp{#pragma
-implementation}.
-
-@item #pragma implementation
-@itemx #pragma implementation "@var{objects}.h"
-@kindex #pragma implementation
-Use this pragma in a @emph{main input file}, when you want full output from
-included header files to be generated (and made globally visible). The
-included header file, in turn, should use @samp{#pragma interface}.
-Backup copies of inline member functions, debugging information, and the
-internal tables used to implement virtual functions are all generated in
-implementation files.
-
-@cindex implied @code{#pragma implementation}
-@cindex @code{#pragma implementation}, implied
-@cindex naming convention, implementation headers
-If you use @samp{#pragma implementation} with no argument, it applies to
-an include file with the same basename@footnote{A file's @dfn{basename}
-was the name stripped of all leading path information and of trailing
-suffixes, such as @samp{.h} or @samp{.C} or @samp{.cc}.} as your source
-file. For example, in @file{allclass.cc}, giving just
-@samp{#pragma implementation}
-by itself is equivalent to @samp{#pragma implementation "allclass.h"}.
-
-In versions of GNU C++ prior to 2.6.0 @file{allclass.h} was treated as
-an implementation file whenever you would include it from
-@file{allclass.cc} even if you never specified @samp{#pragma
-implementation}. This was deemed to be more trouble than it was worth,
-however, and disabled.
-
-If you use an explicit @samp{#pragma implementation}, it must appear in
-your source file @emph{before} you include the affected header files.
-
-Use the string argument if you want a single implementation file to
-include code from multiple header files. (You must also use
-@samp{#include} to include the header file; @samp{#pragma
-implementation} only specifies how to use the file---it doesn't actually
-include it.)
-
-There is no way to split up the contents of a single header file into
-multiple implementation files.
-@end table
-
-@cindex inlining and C++ pragmas
-@cindex C++ pragmas, effect on inlining
-@cindex pragmas in C++, effect on inlining
-@samp{#pragma implementation} and @samp{#pragma interface} also have an
-effect on function inlining.
-
-If you define a class in a header file marked with @samp{#pragma
-interface}, the effect on a function defined in that class is similar to
-an explicit @code{extern} declaration---the compiler emits no code at
-all to define an independent version of the function. Its definition
-is used only for inlining with its callers.
-
-Conversely, when you include the same header file in a main source file
-that declares it as @samp{#pragma implementation}, the compiler emits
-code for the function itself; this defines a version of the function
-that can be found via pointers (or by callers compiled without
-inlining). If all calls to the function can be inlined, you can avoid
-emitting the function by compiling with @samp{-fno-implement-inlines}.
-If any calls were not inlined, you will get linker errors.
-
-@node Template Instantiation
-@section Where's the Template?
-
-@cindex template instantiation
-
-C++ templates are the first language feature to require more
-intelligence from the environment than one usually finds on a UNIX
-system. Somehow the compiler and linker have to make sure that each
-template instance occurs exactly once in the executable if it is needed,
-and not at all otherwise. There are two basic approaches to this
-problem, which I will refer to as the Borland model and the Cfront model.
-
-@table @asis
-@item Borland model
-Borland C++ solved the template instantiation problem by adding the code
-equivalent of common blocks to their linker; the compiler emits template
-instances in each translation unit that uses them, and the linker
-collapses them together. The advantage of this model is that the linker
-only has to consider the object files themselves; there is no external
-complexity to worry about. This disadvantage is that compilation time
-is increased because the template code is being compiled repeatedly.
-Code written for this model tends to include definitions of all
-templates in the header file, since they must be seen to be
-instantiated.
-
-@item Cfront model
-The AT&T C++ translator, Cfront, solved the template instantiation
-problem by creating the notion of a template repository, an
-automatically maintained place where template instances are stored. A
-more modern version of the repository works as follows: As individual
-object files are built, the compiler places any template definitions and
-instantiations encountered in the repository. At link time, the link
-wrapper adds in the objects in the repository and compiles any needed
-instances that were not previously emitted. The advantages of this
-model are more optimal compilation speed and the ability to use the
-system linker; to implement the Borland model a compiler vendor also
-needs to replace the linker. The disadvantages are vastly increased
-complexity, and thus potential for error; for some code this can be
-just as transparent, but in practice it can been very difficult to build
-multiple programs in one directory and one program in multiple
-directories. Code written for this model tends to separate definitions
-of non-inline member templates into a separate file, which should be
-compiled separately.
-@end table
-
-When used with GNU ld version 2.8 or later on an ELF system such as
-Linux/GNU or Solaris 2, or on Microsoft Windows, g++ supports the
-Borland model. On other systems, g++ implements neither automatic
-model.
-
-A future version of g++ will support a hybrid model whereby the compiler
-will emit any instantiations for which the template definition is
-included in the compile, and store template definitions and
-instantiation context information into the object file for the rest.
-The link wrapper will extract that information as necessary and invoke
-the compiler to produce the remaining instantiations. The linker will
-then combine duplicate instantiations.
-
-In the mean time, you have the following options for dealing with
-template instantiations:
-
-@enumerate
-@item
-Compile your template-using code with @samp{-frepo}. The compiler will
-generate files with the extension @samp{.rpo} listing all of the
-template instantiations used in the corresponding object files which
-could be instantiated there; the link wrapper, @samp{collect2}, will
-then update the @samp{.rpo} files to tell the compiler where to place
-those instantiations and rebuild any affected object files. The
-link-time overhead is negligible after the first pass, as the compiler
-will continue to place the instantiations in the same files.
-
-This is your best option for application code written for the Borland
-model, as it will just work. Code written for the Cfront model will
-need to be modified so that the template definitions are available at
-one or more points of instantiation; usually this is as simple as adding
-@code{#include <tmethods.cc>} to the end of each template header.
-
-For library code, if you want the library to provide all of the template
-instantiations it needs, just try to link all of its object files
-together; the link will fail, but cause the instantiations to be
-generated as a side effect. Be warned, however, that this may cause
-conflicts if multiple libraries try to provide the same instantiations.
-For greater control, use explicit instantiation as described in the next
-option.
-
-@item
-Compile your code with @samp{-fno-implicit-templates} to disable the
-implicit generation of template instances, and explicitly instantiate
-all the ones you use. This approach requires more knowledge of exactly
-which instances you need than do the others, but it's less
-mysterious and allows greater control. You can scatter the explicit
-instantiations throughout your program, perhaps putting them in the
-translation units where the instances are used or the translation units
-that define the templates themselves; you can put all of the explicit
-instantiations you need into one big file; or you can create small files
-like
-
-@example
-#include "Foo.h"
-#include "Foo.cc"
-
-template class Foo<int>;
-template ostream& operator <<
- (ostream&, const Foo<int>&);
-@end example
-
-for each of the instances you need, and create a template instantiation
-library from those.
-
-If you are using Cfront-model code, you can probably get away with not
-using @samp{-fno-implicit-templates} when compiling files that don't
-@samp{#include} the member template definitions.
-
-If you use one big file to do the instantiations, you may want to
-compile it without @samp{-fno-implicit-templates} so you get all of the
-instances required by your explicit instantiations (but not by any
-other files) without having to specify them as well.
-
-g++ has extended the template instantiation syntax outlined in the
-Working Paper to allow forward declaration of explicit instantiations
-and instantiation of the compiler support data for a template class
-(i.e. the vtable) without instantiating any of its members:
-
-@example
-extern template int max (int, int);
-inline template class Foo<int>;
-@end example
-
-@item
-Do nothing. Pretend g++ does implement automatic instantiation
-management. Code written for the Borland model will work fine, but
-each translation unit will contain instances of each of the templates it
-uses. In a large program, this can lead to an unacceptable amount of code
-duplication.
-
-@item
-Add @samp{#pragma interface} to all files containing template
-definitions. For each of these files, add @samp{#pragma implementation
-"@var{filename}"} to the top of some @samp{.C} file which
-@samp{#include}s it. Then compile everything with
-@samp{-fexternal-templates}. The templates will then only be expanded
-in the translation unit which implements them (i.e. has a @samp{#pragma
-implementation} line for the file where they live); all other files will
-use external references. If you're lucky, everything should work
-properly. If you get undefined symbol errors, you need to make sure
-that each template instance which is used in the program is used in the
-file which implements that template. If you don't have any use for a
-particular instance in that file, you can just instantiate it
-explicitly, using the syntax from the latest C++ working paper:
-
-@example
-template class A<int>;
-template ostream& operator << (ostream&, const A<int>&);
-@end example
-
-This strategy will work with code written for either model. If you are
-using code written for the Cfront model, the file containing a class
-template and the file containing its member templates should be
-implemented in the same translation unit.
-
-A slight variation on this approach is to instead use the flag
-@samp{-falt-external-templates}; this flag causes template
-instances to be emitted in the translation unit that implements the
-header where they are first instantiated, rather than the one which
-implements the file where the templates are defined. This header must
-be the same in all translation units, or things are likely to break.
-
-@xref{C++ Interface,,Declarations and Definitions in One Header}, for
-more discussion of these pragmas.
-@end enumerate
-
-@node Bound member functions
-@section Extracting the function pointer from a bound pointer to member function
-
-@cindex pmf
-@cindex pointer to member function
-@cindex bound pointer to member function
-
-In C++, pointer to member functions (PMFs) are implemented using a wide
-pointer of sorts to handle all the possible call mechanisms; the PMF
-needs to store information about how to adjust the @samp{this} pointer,
-and if the function pointed to is virtual, where to find the vtable, and
-where in the vtable to look for the member function. If you are using
-PMFs in an inner loop, you should really reconsider that decision. If
-that is not an option, you can extract the pointer to the function that
-would be called for a given object/PMF pair and call it directly inside
-the inner loop, to save a bit of time.
-
-Note that you will still be paying the penalty for the call through a
-function pointer; on most modern architectures, such a call defeats the
-branch prediction features of the CPU. This is also true of normal
-virtual function calls.
-
-The syntax for this extension is
-
-@example
-extern A a;
-extern int (A::*fp)();
-typedef int (*fptr)(A *);
-
-fptr p = (fptr)(a.*fp);
-@end example
-
-You must specify @samp{-Wno-pmf-conversions} to use this extension.
-
-@node C++ Signatures
-@section Type Abstraction using Signatures
-
-@findex signature
-@cindex type abstraction, C++
-@cindex C++ type abstraction
-@cindex subtype polymorphism, C++
-@cindex C++ subtype polymorphism
-@cindex signatures, C++
-@cindex C++ signatures
-
-In GNU C++, you can use the keyword @code{signature} to define a
-completely abstract class interface as a datatype. You can connect this
-abstraction with actual classes using signature pointers. If you want
-to use signatures, run the GNU compiler with the
-@samp{-fhandle-signatures} command-line option. (With this option, the
-compiler reserves a second keyword @code{sigof} as well, for a future
-extension.)
-
-Roughly, signatures are type abstractions or interfaces of classes.
-Some other languages have similar facilities. C++ signatures are
-related to ML's signatures, Haskell's type classes, definition modules
-in Modula-2, interface modules in Modula-3, abstract types in Emerald,
-type modules in Trellis/Owl, categories in Scratchpad II, and types in
-POOL-I. For a more detailed discussion of signatures, see
-@cite{Signatures: A Language Extension for Improving Type Abstraction and
-Subtype Polymorphism in C++}
-by @w{Gerald} Baumgartner and Vincent F. Russo (Tech report
-CSD--TR--95--051, Dept. of Computer Sciences, Purdue University,
-August 1995, a slightly improved version appeared in
-@emph{Software---Practice & Experience}, @b{25}(8), pp. 863--889,
-August 1995). You can get the tech report by anonymous FTP from
-@code{ftp.cs.purdue.edu} in @file{pub/gb/Signature-design.ps.gz}.
-
-Syntactically, a signature declaration is a collection of
-member function declarations and nested type declarations.
-For example, this signature declaration defines a new abstract type
-@code{S} with member functions @samp{int foo ()} and @samp{int bar (int)}:
-
-@example
-signature S
-@{
- int foo ();
- int bar (int);
-@};
-@end example
-
-Since signature types do not include implementation definitions, you
-cannot write an instance of a signature directly. Instead, you can
-define a pointer to any class that contains the required interfaces as a
-@dfn{signature pointer}. Such a class @dfn{implements} the signature
-type.
-@c Eventually signature references should work too.
-
-To use a class as an implementation of @code{S}, you must ensure that
-the class has public member functions @samp{int foo ()} and @samp{int
-bar (int)}. The class can have other member functions as well, public
-or not; as long as it offers what's declared in the signature, it is
-suitable as an implementation of that signature type.
-
-For example, suppose that @code{C} is a class that meets the
-requirements of signature @code{S} (@code{C} @dfn{conforms to}
-@code{S}). Then
-
-@example
-C obj;
-S * p = &obj;
-@end example
-
-@noindent
-defines a signature pointer @code{p} and initializes it to point to an
-object of type @code{C}.
-The member function call @w{@samp{int i = p->foo ();}}
-executes @samp{obj.foo ()}.
-
-@cindex @code{signature} in C++, advantages
-Abstract virtual classes provide somewhat similar facilities in standard
-C++. There are two main advantages to using signatures instead:
-
-@enumerate
-@item
-Subtyping becomes independent from inheritance. A class or signature
-type @code{T} is a subtype of a signature type @code{S} independent of
-any inheritance hierarchy as long as all the member functions declared
-in @code{S} are also found in @code{T}. So you can define a subtype
-hierarchy that is completely independent from any inheritance
-(implementation) hierarchy, instead of being forced to use types that
-mirror the class inheritance hierarchy.
-
-@item
-Signatures allow you to work with existing class hierarchies as
-implementations of a signature type. If those class hierarchies are
-only available in compiled form, you're out of luck with abstract virtual
-classes, since an abstract virtual class cannot be retrofitted on top of
-existing class hierarchies. So you would be required to write interface
-classes as subtypes of the abstract virtual class.
-@end enumerate
-
-@cindex default implementation, signature member function
-@cindex signature member function default implementation
-There is one more detail about signatures. A signature declaration can
-contain member function @emph{definitions} as well as member function
-declarations. A signature member function with a full definition is
-called a @emph{default implementation}; classes need not contain that
-particular interface in order to conform. For example, a
-class @code{C} can conform to the signature
-
-@example
-signature T
-@{
- int f (int);
- int f0 () @{ return f (0); @};
-@};
-@end example
-
-@noindent
-whether or not @code{C} implements the member function @samp{int f0 ()}.
-If you define @code{C::f0}, that definition takes precedence;
-otherwise, the default implementation @code{S::f0} applies.
-
-@ignore
-There will be more support for signatures in the future.
-Add to this doc as the implementation grows.
-In particular, the following features are planned but not yet
-implemented:
-@itemize @bullet
-@item signature references,
-@item signature inheritance,
-@item the @code{sigof} construct for extracting the signature information
- of a class,
-@item views for renaming member functions when matching a class type
- with a signature type,
-@item specifying exceptions with signature member functions, and
-@item signature templates.
-@end itemize
-This list is roughly in the order in which we intend to implement
-them. Watch this space for updates.
-@end ignore
diff --git a/contrib/gcc/f/BUGS b/contrib/gcc/f/BUGS
deleted file mode 100644
index 6f04b2b08f79..000000000000
--- a/contrib/gcc/f/BUGS
+++ /dev/null
@@ -1,159 +0,0 @@
-*Note:* This file is automatically generated from the files
-`bugs0.texi' and `bugs.texi'. `BUGS' is *not* a source file, although
-it is normally included within source distributions.
-
- This file lists known bugs in the GCC-2.95 version of the GNU
-Fortran compiler. Copyright (C) 1995-1999 Free Software Foundation,
-Inc. You may copy, distribute, and modify it freely as long as you
-preserve this copyright notice and permission notice.
-
-Known Bugs In GNU Fortran
-*************************
-
- This section identifies bugs that `g77' *users* might run into in
-the GCC-2.95 version of `g77'. This includes bugs that are actually in
-the `gcc' back end (GBE) or in `libf2c', because those sets of code are
-at least somewhat under the control of (and necessarily intertwined
-with) `g77', so it isn't worth separating them out.
-
- For information on bugs in *other* versions of `g77', see
-`egcs/gcc/f/NEWS'. There, lists of bugs fixed in various versions of
-`g77' can help determine what bugs existed in prior versions.
-
- *Warning:* The information below is still under development, and
-might not accurately reflect the `g77' code base of which it is a part.
-Efforts are made to keep it somewhat up-to-date, but they are
-particularly concentrated on any version of this information that is
-distributed as part of a *released* `g77'.
-
- In particular, while this information is intended to apply to the
-GCC-2.95 version of `g77', only an official *release* of that version
-is expected to contain documentation that is most consistent with the
-`g77' product in that version.
-
- An online, "live" version of this document (derived directly from
-the mainline, development version of `g77' within `egcs') is available
-via `http://www.gnu.org/software/gcc/onlinedocs/g77_bugs.html'. Follow the
-"Known Bugs" link.
-
- For information on bugs that might afflict people who configure,
-port, build, and install `g77', see "Problems Installing" in
-`egcs/gcc/f/INSTALL'.
-
- The following information was last updated on 1999-06-29:
-
- * `g77' fails to warn about use of a "live" iterative-DO variable as
- an implied-DO variable in a `WRITE' or `PRINT' statement (although
- it does warn about this in a `READ' statement).
-
- * Something about `g77''s straightforward handling of label
- references and definitions sometimes prevents the GBE from
- unrolling loops. Until this is solved, try inserting or removing
- `CONTINUE' statements as the terminal statement, using the `END DO'
- form instead, and so on.
-
- * Some confusion in diagnostics concerning failing `INCLUDE'
- statements from within `INCLUDE''d or `#include''d files.
-
- * `g77' assumes that `INTEGER(KIND=1)' constants range from `-2**31'
- to `2**31-1' (the range for two's-complement 32-bit values),
- instead of determining their range from the actual range of the
- type for the configuration (and, someday, for the constant).
-
- Further, it generally doesn't implement the handling of constants
- very well in that it makes assumptions about the configuration
- that it no longer makes regarding variables (types).
-
- Included with this item is the fact that `g77' doesn't recognize
- that, on IEEE-754/854-compliant systems, `0./0.' should produce a
- NaN and no warning instead of the value `0.' and a warning. This
- is to be fixed in version 0.6, when `g77' will use the `gcc' back
- end's constant-handling mechanisms to replace its own.
-
- * `g77' uses way too much memory and CPU time to process large
- aggregate areas having any initialized elements.
-
- For example, `REAL A(1000000)' followed by `DATA A(1)/1/' takes up
- way too much time and space, including the size of the generated
- assembler file. This is to be mitigated somewhat in version 0.6.
-
- Version 0.5.18 improves cases like this--specifically, cases of
- *sparse* initialization that leave large, contiguous areas
- uninitialized--significantly. However, even with the
- improvements, these cases still require too much memory and CPU
- time.
-
- (Version 0.5.18 also improves cases where the initial values are
- zero to a much greater degree, so if the above example ends with
- `DATA A(1)/0/', the compile-time performance will be about as good
- as it will ever get, aside from unrelated improvements to the
- compiler.)
-
- Note that `g77' does display a warning message to notify the user
- before the compiler appears to hang.
-
- * `g77' doesn't emit variable and array members of common blocks for
- use with a debugger (the `-g' command-line option). The code is
- present to do this, but doesn't work with at least one debug
- format--perhaps it works with others. And it turns out there's a
- similar bug for local equivalence areas, so that has been disabled
- as well.
-
- As of Version 0.5.19, a temporary kludge solution is provided
- whereby some rudimentary information on a member is written as a
- string that is the member's value as a character string.
-
- * When debugging, after starting up the debugger but before being
- able to see the source code for the main program unit, the user
- must currently set a breakpoint at `MAIN__' (or `MAIN___' or
- `MAIN_' if `MAIN__' doesn't exist) and run the program until it
- hits the breakpoint. At that point, the main program unit is
- activated and about to execute its first executable statement, but
- that's the state in which the debugger should start up, as is the
- case for languages like C.
-
- * Debugging `g77'-compiled code using debuggers other than `gdb' is
- likely not to work.
-
- Getting `g77' and `gdb' to work together is a known
- problem--getting `g77' to work properly with other debuggers, for
- which source code often is unavailable to `g77' developers, seems
- like a much larger, unknown problem, and is a lower priority than
- making `g77' and `gdb' work together properly.
-
- On the other hand, information about problems other debuggers have
- with `g77' output might make it easier to properly fix `g77', and
- perhaps even improve `gdb', so it is definitely welcome. Such
- information might even lead to all relevant products working
- together properly sooner.
-
- * `g77' doesn't work perfectly on 64-bit configurations such as the
- Digital Semiconductor ("DEC") Alpha.
-
- This problem is largely resolved as of version 0.5.23. Version
- 0.6 should solve most or all remaining problems (such as
- cross-compiling involving 64-bit machines).
-
- * `g77' currently inserts needless padding for things like `COMMON
- A,IPAD' where `A' is `CHARACTER*1' and `IPAD' is `INTEGER(KIND=1)'
- on machines like x86, because the back end insists that `IPAD' be
- aligned to a 4-byte boundary, but the processor has no such
- requirement (though it is usually good for performance).
-
- The `gcc' back end needs to provide a wider array of
- specifications of alignment requirements and preferences for
- targets, and front ends like `g77' should take advantage of this
- when it becomes available.
-
- * The `libf2c' routines that perform some run-time arithmetic on
- `COMPLEX' operands were modified circa version 0.5.20 of `g77' to
- work properly even in the presence of aliased operands.
-
- While the `g77' and `netlib' versions of `libf2c' differ on how
- this is accomplished, the main differences are that we believe the
- `g77' version works properly even in the presence of *partially*
- aliased operands.
-
- However, these modifications have reduced performance on targets
- such as x86, due to the extra copies of operands involved.
-
diff --git a/contrib/gcc/f/INSTALL b/contrib/gcc/f/INSTALL
deleted file mode 100644
index 91858800958d..000000000000
--- a/contrib/gcc/f/INSTALL
+++ /dev/null
@@ -1,352 +0,0 @@
-*Note:* This file is automatically generated from the files
-`install0.texi' and `g77install.texi'. `INSTALL' is *not* a source
-file, although it is normally included within source distributions.
-
- This file contains installation information for the GNU Fortran
-compiler. Copyright (C) {No Value For "copyrights-install"} Free
-Software Foundation, Inc. You may copy, distribute, and modify it
-freely as long as you preserve this copyright notice and permission
-notice.
-
-Installing GNU Fortran
-**********************
-
- The following information describes how to install `g77'.
-
- Note that, for users of the GCC-2.95 version of `g77', much of the
-information is obsolete, and is superceded by the GCC installation
-procedures. Such information is accordingly omitted and flagged as
-such.
-
- *Warning:* The information below is still under development, and
-might not accurately reflect the `g77' code base of which it is a part.
-Efforts are made to keep it somewhat up-to-date, but they are
-particularly concentrated on any version of this information that is
-distributed as part of a *released* `g77'.
-
- In particular, while this information is intended to apply to the
-GCC-2.95 version of `g77', only an official *release* of that version
-is expected to contain documentation that is most consistent with the
-`g77' product in that version.
-
- The following information was last updated on 1999-07-17:
-
-Prerequisites
-=============
-
- For users of the GCC-2.95 version of `g77', this information is
-superceded by the GCC installation instructions.
-
-Problems Installing
-===================
-
- This is a list of problems (and some apparent problems which don't
-really mean anything is wrong) that show up when configuring, building,
-installing, or porting GNU Fortran.
-
- *Note Installation Problems: (gcc)Installation Problems, for more
-information on installation problems that can afflict either `gcc' or
-`g77'.
-
-General Problems
-----------------
-
- These problems can occur on most or all systems.
-
-GNU C Required
-..............
-
- Compiling `g77' requires GNU C, not just ANSI C. Fixing this
-wouldn't be very hard (just tedious), but the code using GNU extensions
-to the C language is expected to be rewritten for 0.6 anyway, so there
-are no plans for an interim fix.
-
- This requirement does not mean you must already have `gcc' installed
-to build `g77'. As long as you have a working C compiler, you can use a
-"bootstrap" build to automate the process of first building `gcc' using
-the working C compiler you have, then building `g77' and rebuilding
-`gcc' using that just-built `gcc', and so on.
-
-Patching GNU CC
-...............
-
- `g77' no longer requires application of a patch file to the `gcc'
-compiler tree. In fact, no such patch file is distributed with `g77'.
-This is as of version 0.5.23 and `egcs' version 1.0.
-
-Building GNU CC Necessary
-.........................
-
- It should be possible to build the runtime without building `cc1'
-and other non-Fortran items, but, for now, an easy way to do that is
-not yet established.
-
-Missing strtoul or bsearch
-..........................
-
- This information does not apply to the GCC-2.95 version of `g77',
-
-Cleanup Kills Stage Directories
-...............................
-
- It'd be helpful if `g77''s `Makefile.in' or `Make-lang.in' would
-create the various `stageN' directories and their subdirectories, so
-developers and expert installers wouldn't have to reconfigure after
-cleaning up.
-
- That help has arrived as of version 0.5.23 of `g77' and version 1.1
-of `egcs'. Configuration itself no longer creates any particular
-directories that are unique to `g77'. The build procedures in
-`Make-lang.in' take care of that, on demand.
-
-LANGUAGES Macro Ignored
-.......................
-
- Prior to version 0.5.23 of `g77' and version 1.1 of `egcs', `g77'
-would sometimes ignore the absence of `f77' and `F77' in the
-`LANGUAGES' macro definition used for the `make' command being
-processed.
-
- As of `g77' version 0.5.23 and `egcs' version 1.1, `g77' now obeys
-this macro in all relevant situations.
-
- However, in versions of `gcc' through 2.8.1, non-`g77' portions of
-`gcc', such as `g++', are known to go ahead and perform various
-language-specific activities when their respective language strings do
-not appear in the `LANGUAGES' macro in effect during that invocation of
-`make'.
-
- It is expected that these remaining problems will be fixed in a
-future version of `gcc'.
-
-System-specific Problems
-------------------------
-
- A linker bug on some versions of AIX 4.1 might prevent building when
-`g77' is built within `gcc'. It might also occur when building within
-`egcs'.
-
-Cross-compiler Problems
------------------------
-
- `g77' has been in alpha testing since September of 1992, and in
-public beta testing since February of 1995. Alpha testing was done by
-a small number of people worldwide on a fairly wide variety of
-machines, involving self-compilation in most or all cases. Beta
-testing has been done primarily via self-compilation, but in more and
-more cases, cross-compilation (and "criss-cross compilation", where a
-version of a compiler is built on one machine to run on a second and
-generate code that runs on a third) has been tried and has succeeded,
-to varying extents.
-
- Generally, `g77' can be ported to any configuration to which `gcc',
-`f2c', and `libf2c' can be ported and made to work together, aside from
-the known problems described in this manual. If you want to port `g77'
-to a particular configuration, you should first make sure `gcc' and
-`libf2c' can be ported to that configuration before focusing on `g77',
-because `g77' is so dependent on them.
-
- Even for cases where `gcc' and `libf2c' work, you might run into
-problems with cross-compilation on certain machines, for several
-reasons.
-
- * There is one known bug (a design bug to be fixed in 0.6) that
- prevents configuration of `g77' as a cross-compiler in some cases,
- though there are assumptions made during configuration that
- probably make doing non-self-hosting builds a hassle, requiring
- manual intervention.
-
- * `gcc' might still have some trouble being configured for certain
- combinations of machines. For example, it might not know how to
- handle floating-point constants.
-
- * Improvements to the way `libg2c' is built could make building
- `g77' as a cross-compiler easier--for example, passing and using
- `$(LD)' and `$(AR)' in the appropriate ways. (This is improved in
- the `egcs' version of `g77', especially as of version 1.1.)
-
- * There are still some challenges putting together the right
- run-time libraries (needed by `libg2c') for a target system,
- depending on the systems involved in the configuration. (This is
- a general problem with cross-compilation, and with `gcc' in
- particular.)
-
-Changing Settings Before Building
-=================================
-
- Here are some internal `g77' settings that can be changed by editing
-source files in `egcs/gcc/f/' before building.
-
- This information, and perhaps even these settings, represent
-stop-gap solutions to problems people doing various ports of `g77' have
-encountered. As such, none of the following information is expected to
-be pertinent in future versions of `g77'.
-
-Larger File Unit Numbers
-------------------------
-
- As distributed, whether as part of `f2c' or `g77', `libf2c' accepts
-file unit numbers only in the range 0 through 99. For example, a
-statement such as `WRITE (UNIT=100)' causes a run-time crash in
-`libf2c', because the unit number, 100, is out of range.
-
- If you know that Fortran programs at your installation require the
-use of unit numbers higher than 99, you can change the value of the
-`MXUNIT' macro, which represents the maximum unit number, to an
-appropriately higher value.
-
- To do this, edit the file `egcs/libf2c/libI77/fio.h' in your `g77'
-source tree, changing the following line:
-
- #define MXUNIT 100
-
- Change the line so that the value of `MXUNIT' is defined to be at
-least one *greater* than the maximum unit number used by the Fortran
-programs on your system.
-
- (For example, a program that does `WRITE (UNIT=255)' would require
-`MXUNIT' set to at least 256 to avoid crashing.)
-
- Then build or rebuild `g77' as appropriate.
-
- *Note:* Changing this macro has *no* effect on other limits your
-system might place on the number of files open at the same time. That
-is, the macro might allow a program to do `WRITE (UNIT=100)', but the
-library and operating system underlying `libf2c' might disallow it if
-many other files have already been opened (via `OPEN' or implicitly via
-`READ', `WRITE', and so on). Information on how to increase these
-other limits should be found in your system's documentation.
-
-Always Flush Output
--------------------
-
- Some Fortran programs require output (writes) to be flushed to the
-operating system (under UNIX, via the `fflush()' library call) so that
-errors, such as disk full, are immediately flagged via the relevant
-`ERR=' and `IOSTAT=' mechanism, instead of such errors being flagged
-later as subsequent writes occur, forcing the previously written data
-to disk, or when the file is closed.
-
- Essentially, the difference can be viewed as synchronous error
-reporting (immediate flagging of errors during writes) versus
-asynchronous, or, more precisely, buffered error reporting (detection
-of errors might be delayed).
-
- `libg2c' supports flagging write errors immediately when it is built
-with the `ALWAYS_FLUSH' macro defined. This results in a `libg2c' that
-runs slower, sometimes quite a bit slower, under certain
-circumstances--for example, accessing files via the networked file
-system NFS--but the effect can be more reliable, robust file I/O.
-
- If you know that Fortran programs requiring this level of precision
-of error reporting are to be compiled using the version of `g77' you
-are building, you might wish to modify the `g77' source tree so that
-the version of `libg2c' is built with the `ALWAYS_FLUSH' macro defined,
-enabling this behavior.
-
- To do this, find this line in `egcs/libf2c/f2c.h' in your `g77'
-source tree:
-
- /* #define ALWAYS_FLUSH */
-
- Remove the leading `/* ', so the line begins with `#define', and the
-trailing ` */'.
-
- Then build or rebuild `g77' as appropriate.
-
-Maximum Stackable Size
-----------------------
-
- `g77', on most machines, puts many variables and arrays on the stack
-where possible, and can be configured (by changing
-`FFECOM_sizeMAXSTACKITEM' in `egcs/gcc/f/com.c') to force smaller-sized
-entities into static storage (saving on stack space) or permit
-larger-sized entities to be put on the stack (which can improve
-run-time performance, as it presents more opportunities for the GBE to
-optimize the generated code).
-
- *Note:* Putting more variables and arrays on the stack might cause
-problems due to system-dependent limits on stack size. Also, the value
-of `FFECOM_sizeMAXSTACKITEM' has no effect on automatic variables and
-arrays. *Note But-bugs::, for more information.
-
-Floating-point Bit Patterns
----------------------------
-
- The `g77' build will crash if an attempt is made to build it as a
-cross-compiler for a target when `g77' cannot reliably determine the
-bit pattern of floating-point constants for the target. Planned
-improvements for version 0.6 of `g77' will give it the capabilities it
-needs to not have to crash the build but rather generate correct code
-for the target. (Currently, `g77' would generate bad code under such
-circumstances if it didn't crash during the build, e.g. when compiling
-a source file that does something like `EQUIVALENCE (I,R)' and `DATA
-R/9.43578/'.)
-
-Initialization of Large Aggregate Areas
----------------------------------------
-
- A warning message is issued when `g77' sees code that provides
-initial values (e.g. via `DATA') to an aggregate area (`COMMON' or
-`EQUIVALENCE', or even a large enough array or `CHARACTER' variable)
-that is large enough to increase `g77''s compile time by roughly a
-factor of 10.
-
- This size currently is quite small, since `g77' currently has a
-known bug requiring too much memory and time to handle such cases. In
-`egcs/gcc/f/data.c', the macro `FFEDATA_sizeTOO_BIG_INIT_' is defined
-to the minimum size for the warning to appear. The size is specified
-in storage units, which can be bytes, words, or whatever, on a
-case-by-case basis.
-
- After changing this macro definition, you must (of course) rebuild
-and reinstall `g77' for the change to take effect.
-
- Note that, as of version 0.5.18, improvements have reduced the scope
-of the problem for *sparse* initialization of large arrays, especially
-those with large, contiguous uninitialized areas. However, the warning
-is issued at a point prior to when `g77' knows whether the
-initialization is sparse, and delaying the warning could mean it is
-produced too late to be helpful.
-
- Therefore, the macro definition should not be adjusted to reflect
-sparse cases. Instead, adjust it to generate the warning when densely
-initialized arrays begin to cause responses noticeably slower than
-linear performance would suggest.
-
-Alpha Problems Fixed
---------------------
-
- `g77' used to warn when it was used to compile Fortran code for a
-target configuration that is not basically a 32-bit machine (such as an
-Alpha, which is a 64-bit machine, especially if it has a 64-bit
-operating system running on it). That was because `g77' was known to
-not work properly on such configurations.
-
- As of version 0.5.20, `g77' is believed to work well enough on such
-systems. So, the warning is no longer needed or provided.
-
- However, support for 64-bit systems, especially in areas such as
-cross-compilation and handling of intrinsics, is still incomplete. The
-symptoms are believed to be compile-time diagnostics rather than the
-generation of bad code. It is hoped that version 0.6 will completely
-support 64-bit systems.
-
-Quick Start
-===========
-
- For users of the GCC-2.95 version of `g77', this information is
-superceded by the GCC installation instructions.
-
-Complete Installation
-=====================
-
- For users of the GCC-2.95 version of `g77', this information is
-superceded by the GCC installation instructions.
-
-Distributing Binaries
-=====================
-
- For users of the GCC-2.95 version of `g77', this information is
-superceded by the GCC installation instructions.
-
diff --git a/contrib/gcc/f/Makefile.in b/contrib/gcc/f/Makefile.in
deleted file mode 100644
index 96975a5d7cdb..000000000000
--- a/contrib/gcc/f/Makefile.in
+++ /dev/null
@@ -1,529 +0,0 @@
-# Makefile for GNU F77 compiler.
-# Copyright (C) 1995-1998 Free Software Foundation, Inc.
-
-#This file is part of GNU Fortran.
-
-#GNU Fortran 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.
-
-#GNU Fortran is distributed in the hope that it will be useful,
-#but WITHOUT ANY WARRANTY; without even the implied warranty of
-#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-#GNU General Public License for more details.
-
-#You should have received a copy of the GNU General Public License
-#along with GNU Fortran; see the file COPYING. If not, write to
-#the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-#02111-1307, USA.
-
-# The makefile built from this file lives in the language subdirectory.
-# Its purpose is to provide support for:
-#
-# 1) recursion where necessary, and only then (building .o's), and
-# 2) building and debugging f771 from the language subdirectory, and
-# 3) nothing else.
-#
-# The parent makefile handles all other chores, with help from the
-# language makefile fragment, of course.
-#
-# The targets for external use are:
-# all, TAGS, ???mostlyclean, ???clean.
-
-# Suppress smart makes who think they know how to automake Yacc files
-.y.c:
-
-# Variables that exist for you to override.
-# See below for how to change them for certain systems.
-
-ALLOCA =
-
-# Various ways of specifying flags for compilations:
-# CFLAGS is for the user to override to, e.g., do a bootstrap with -O2.
-# BOOT_CFLAGS is the value of CFLAGS to pass
-# to the stage2 and stage3 compilations
-# XCFLAGS is used for most compilations but not when using the GCC just built.
-XCFLAGS =
-CFLAGS = -g
-BOOT_CFLAGS = -O $(CFLAGS)
-# These exists to be overridden by the x-* and t-* files, respectively.
-X_CFLAGS =
-T_CFLAGS =
-
-X_CPPFLAGS =
-T_CPPFLAGS =
-
-CC = @CC@
-BISON = bison
-BISONFLAGS =
-LEX = flex
-LEXFLAGS =
-AR = ar
-AR_FLAGS = rc
-SHELL = /bin/sh
-MAKEINFO = makeinfo
-TEXI2DVI = texi2dvi
-
-# Define this as & to perform parallel make on a Sequent.
-# Note that this has some bugs, and it seems currently necessary
-# to compile all the gen* files first by hand to avoid erroneous results.
-P =
-
-# This is used in the definition of SUBDIR_USE_ALLOCA.
-# ??? Perhaps it would be better if it just looked for *gcc*.
-OLDCC = cc
-
-# This is used instead of ALL_CFLAGS when compiling with GCC_FOR_TARGET.
-# It omits XCFLAGS, and specifies -B./.
-# It also specifies -B$(tooldir)/ to find as and ld for a cross compiler.
-GCC_CFLAGS=$(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS)
-
-# Tools to use when building a cross-compiler.
-# These are used because `configure' appends `cross-make'
-# to the makefile when making a cross-compiler.
-
-target=@target@
-xmake_file=@dep_host_xmake_file@
-tmake_file=@dep_tmake_file@
-
-# Directory where sources are, from where we are.
-srcdir = @srcdir@
-VPATH = @srcdir@
-
-# Additional system libraries to link with.
-CLIB=
-
-# Change this to a null string if obstacks are installed in the
-# system library.
-OBSTACK=obstack.o
-
-# Choose the real default target.
-ALL=all
-
-# End of variables for you to override.
-
-# Definition of `all' is here so that new rules inserted by sed
-# do not specify the default target.
-all: all.indirect
-
-# This tells GNU Make version 3 not to put all variables in the environment.
-.NOEXPORT:
-
-# sed inserts variable overrides after the following line.
-####target overrides
-@target_overrides@
-####host overrides
-@host_overrides@
-####cross overrides
-@cross_defines@
-@cross_overrides@
-####build overrides
-@build_overrides@
-#
-# Now figure out from those variables how to compile and link.
-
-all.indirect: Makefile ../f771$(exeext)
-
-# IN_GCC tells obstack.h that we are using gcc's <stddef.h> file.
-INTERNAL_CFLAGS = $(CROSS) -DIN_GCC @extra_c_flags@
-
-# This is the variable actually used when we compile.
-ALL_CFLAGS = $(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS) $(XCFLAGS) -W -Wall
-
-# Likewise.
-ALL_CPPFLAGS = $(CPPFLAGS) $(X_CPPFLAGS) $(T_CPPFLAGS)
-
-# We should be compiling with the built compiler, for which
-# BOOT_LDFLAGS is appropriate. (Formerly we had a separate
-# F771_LDFLAGS, but the ld flags can be taken care of by the target
-# configuration files in egcs.)
-LDFLAGS=$(BOOT_LDFLAGS)
-
-# Even if ALLOCA is set, don't use it if compiling with GCC.
-
-SUBDIR_OBSTACK = `if [ x$(OBSTACK) != x ]; then echo ../$(OBSTACK); else true; fi`
-SUBDIR_USE_ALLOCA = `case "${CC}" in "${OLDCC}") if [ x$(ALLOCA) != x ]; then echo ../$(ALLOCA); else true; fi ;; esac`
-SUBDIR_MALLOC = `if [ x$(MALLOC) != x ]; then echo ../$(MALLOC); else true; fi`
-
-# How to link with both our special library facilities
-# and the system's installed libraries.
-LIBS = $(SUBDIR_OBSTACK) $(SUBDIR_USE_ALLOCA) $(SUBDIR_MALLOC) $(CLIB)
-
-# Specify the directories to be searched for header files.
-# Both . and srcdir are used, in that order,
-# so that tm.h and config.h will be found in the compilation
-# subdirectory rather than in the source directory.
-INCLUDES = -I. -I.. -I$(srcdir) -I$(srcdir)/.. -I$(srcdir)/../config -I$(srcdir)/../../include
-
-# Always use -I$(srcdir)/config when compiling.
-.c.o:
- $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
-
-#
-# Lists of files for various purposes.
-
-# Language-specific object files for g77
-
-F77_OBJS = \
- bad.o \
- bit.o \
- bld.o \
- com.o \
- data.o \
- equiv.o \
- expr.o \
- global.o \
- implic.o \
- info.o \
- intrin.o \
- lab.o \
- lex.o \
- malloc.o \
- name.o \
- parse.o \
- proj.o \
- src.o \
- st.o \
- sta.o \
- stb.o \
- stc.o \
- std.o \
- ste.o \
- storag.o \
- stp.o \
- str.o \
- sts.o \
- stt.o \
- stu.o \
- stv.o \
- stw.o \
- symbol.o \
- target.o \
- top.o \
- type.o \
- version.o \
- where.o
-
-# Language-independent object files.
-OBJS = `cat ../stamp-objlist`
-OBJDEPS = ../stamp-objlist
-
-compiler: ../f771$(exeext)
-../f771$(exeext): $(P) $(F77_OBJS) $(OBJDEPS) $(LIBDEPS)
- rm -f f771$(exeext)
- $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(F77_OBJS) $(OBJS) $(LIBS)
-
-Makefile: $(srcdir)/Makefile.in $(srcdir)/../configure
- cd ..; $(SHELL) config.status
-
-native: config.status ../f771$(exeext)
-#
-# Compiling object files from source files.
-
-# Note that dependencies on obstack.h are not written
-# because that file is not part of GCC.
-
-# F77 language-specific files.
-
-# These macros expand to the corresponding g77-source .j files plus
-# the gcc-source files involved (each file itself, plus whatever
-# files on which it depends, but without including stuff resulting
-# from configuration, since we can't guess at that). The files
-# that live in a distclean'd gcc source directory have "$(srcdir)/"
-# prefixes, while the others don't because they'll be created
-# only in the build directory.
-ASSERT_H = $(srcdir)/assert.j $(srcdir)/../assert.h
-CONFIG_H = $(srcdir)/config.j ../config.h
-CONVERT_H = $(srcdir)/convert.j $(srcdir)/../convert.h
-FLAGS_H = $(srcdir)/flags.j $(srcdir)/../flags.h
-GLIMITS_H = $(srcdir)/glimits.j $(srcdir)/../glimits.h
-HCONFIG_H = $(srcdir)/hconfig.j ../hconfig.h
-INPUT_H = $(srcdir)/input.j $(srcdir)/../input.h
-OUTPUT_H = $(srcdir)/output.j $(srcdir)/../output.h
-RTL_H = $(srcdir)/rtl.j $(srcdir)/../rtl.h $(srcdir)/../rtl.def \
- $(srcdir)/../machmode.h $(srcdir)/../machmode.def
-SYSTEM_H = $(srcdir)/system.j $(srcdir)/../system.h
-TCONFIG_H = $(srcdir)/tconfig.j ../tconfig.h
-TM_H = $(srcdir)/tm.j ../tm.h
-TOPLEV_H = $(srcdir)/toplev.j $(srcdir)/../toplev.h
-TREE_H = $(srcdir)/tree.j $(srcdir)/../tree.h $(srcdir)/../real.h \
- $(srcdir)/../tree.def $(srcdir)/../machmode.h $(srcdir)/../machmode.def
-
-#Build the first part of this list with the command line:
-# cd gcc/; make deps-kinda -f f/Makefile.in
-#Note that this command uses the host C compiler;
-# use HOST_CC="./xgcc -B./" to use GCC in the build directory, for example.
-#Also note that this particular build file seems to want to use
-# substitions: $(CONFIG_H) for config.h; $(TREE_H) for tree.h;
-# $(RTL_H) for rtl.h; etc.. deps-kinda uses a sed script to do those
-# substitutions, plus others for elegance.
-
-ansify.o: ansify.c $(HCONFIG_H) $(SYSTEM_H) $(ASSERT_H)
-bad.o: bad.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) bad.h bad.def where.h \
- $(GLIMITS_H) top.h malloc.h $(FLAGS_H) com.h com-rt.def $(TREE_H) bld.h \
- bld-op.def bit.h info.h info-b.def info-k.def info-w.def target.h \
- lex.h type.h intrin.h intrin.def lab.h symbol.h symbol.def equiv.h \
- storag.h global.h name.h $(TOPLEV_H)
-bit.o: bit.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) $(GLIMITS_H) bit.h \
- malloc.h
-bld.o: bld.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) bld.h bld-op.def bit.h \
- malloc.h com.h com-rt.def $(TREE_H) info.h info-b.def info-k.def \
- info-w.def target.h bad.h bad.def where.h $(GLIMITS_H) top.h lex.h \
- type.h lab.h storag.h symbol.h symbol.def equiv.h global.h name.h \
- intrin.h intrin.def
-com.o: com.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) $(FLAGS_H) $(RTL_H) $(TOPLEV_H) \
- $(TREE_H) $(OUTPUT_H) $(CONVERT_H) com.h com-rt.def bld.h bld-op.def bit.h \
- malloc.h info.h info-b.def info-k.def info-w.def target.h bad.h \
- bad.def where.h $(GLIMITS_H) top.h lex.h type.h intrin.h intrin.def \
- lab.h symbol.h symbol.def equiv.h storag.h global.h name.h expr.h \
- implic.h src.h st.h
-data.o: data.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) data.h bld.h \
- bld-op.def bit.h malloc.h com.h com-rt.def $(TREE_H) info.h info-b.def \
- info-k.def info-w.def target.h bad.h bad.def where.h $(GLIMITS_H) top.h \
- lex.h type.h lab.h storag.h symbol.h symbol.def equiv.h global.h \
- name.h intrin.h intrin.def expr.h st.h
-equiv.o: equiv.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) equiv.h bld.h \
- bld-op.def bit.h malloc.h com.h com-rt.def $(TREE_H) info.h info-b.def \
- info-k.def info-w.def target.h bad.h bad.def where.h $(GLIMITS_H) top.h \
- lex.h type.h lab.h storag.h symbol.h symbol.def global.h name.h \
- intrin.h intrin.def data.h
-expr.o: expr.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) expr.h bld.h \
- bld-op.def bit.h malloc.h com.h com-rt.def $(TREE_H) info.h info-b.def \
- info-k.def info-w.def target.h bad.h bad.def where.h $(GLIMITS_H) top.h \
- lex.h type.h lab.h storag.h symbol.h symbol.def equiv.h global.h \
- name.h intrin.h intrin.def implic.h src.h st.h stamp-str
-fini.o: fini.c proj.h $(HCONFIG_H) $(SYSTEM_H) $(ASSERT_H) malloc.h
-global.o: global.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) global.h info.h \
- info-b.def info-k.def info-w.def target.h $(TREE_H) bad.h bad.def \
- where.h $(GLIMITS_H) top.h malloc.h lex.h type.h name.h symbol.h \
- symbol.def bld.h bld-op.def bit.h com.h com-rt.def lab.h storag.h \
- intrin.h intrin.def equiv.h
-implic.o: implic.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) implic.h info.h \
- info-b.def info-k.def info-w.def target.h $(TREE_H) bad.h bad.def \
- where.h $(GLIMITS_H) top.h malloc.h lex.h type.h symbol.h symbol.def \
- bld.h bld-op.def bit.h com.h com-rt.def lab.h storag.h intrin.h \
- intrin.def equiv.h global.h name.h src.h
-info.o: info.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) info.h info-b.def \
- info-k.def info-w.def target.h $(TREE_H) bad.h bad.def where.h $(GLIMITS_H) \
- top.h malloc.h lex.h type.h
-intdoc.o: intdoc.c $(HCONFIG_H) $(SYSTEM_H) $(ASSERT_H) intrin.h intrin.def \
- intdoc.h0 intdoc.h0
-intrin.o: intrin.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) intrin.h \
- intrin.def bld.h bld-op.def bit.h malloc.h com.h com-rt.def $(TREE_H) \
- info.h info-b.def info-k.def info-w.def target.h bad.h bad.def \
- where.h $(GLIMITS_H) top.h lex.h type.h lab.h storag.h symbol.h \
- symbol.def equiv.h global.h name.h expr.h src.h
-lab.o: lab.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) lab.h com.h com-rt.def \
- $(TREE_H) bld.h bld-op.def bit.h malloc.h info.h info-b.def info-k.def \
- info-w.def target.h bad.h bad.def where.h $(GLIMITS_H) top.h lex.h \
- type.h intrin.h intrin.def symbol.h symbol.def equiv.h storag.h \
- global.h name.h
-lex.o: lex.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) top.h malloc.h where.h \
- $(GLIMITS_H) bad.h bad.def com.h com-rt.def $(TREE_H) bld.h bld-op.def \
- bit.h info.h info-b.def info-k.def info-w.def target.h lex.h type.h \
- intrin.h intrin.def lab.h symbol.h symbol.def equiv.h storag.h \
- global.h name.h src.h $(FLAGS_H) $(INPUT_H) $(TOPLEV_H) $(OUTPUT_H)
-malloc.o: malloc.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) malloc.h
-name.o: name.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) bad.h bad.def where.h \
- $(GLIMITS_H) top.h malloc.h name.h global.h info.h info-b.def info-k.def \
- info-w.def target.h $(TREE_H) lex.h type.h symbol.h symbol.def bld.h \
- bld-op.def bit.h com.h com-rt.def lab.h storag.h intrin.h intrin.def \
- equiv.h src.h
-parse.o: parse.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) top.h malloc.h \
- where.h $(GLIMITS_H) com.h com-rt.def $(TREE_H) bld.h bld-op.def bit.h \
- info.h info-b.def info-k.def info-w.def target.h bad.h bad.def lex.h \
- type.h intrin.h intrin.def lab.h symbol.h symbol.def equiv.h storag.h \
- global.h name.h version.h $(FLAGS_H)
-proj.o: proj.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) $(GLIMITS_H)
-src.o: src.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) src.h bad.h bad.def \
- where.h $(GLIMITS_H) top.h malloc.h
-st.o: st.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) st.h bad.h bad.def \
- where.h $(GLIMITS_H) top.h malloc.h lex.h symbol.h symbol.def bld.h \
- bld-op.def bit.h com.h com-rt.def $(TREE_H) info.h info-b.def info-k.def \
- info-w.def target.h type.h lab.h storag.h intrin.h intrin.def equiv.h \
- global.h name.h sta.h stamp-str stb.h expr.h stp.h stt.h stc.h std.h \
- stv.h stw.h ste.h sts.h stu.h
-sta.o: sta.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) sta.h bad.h bad.def \
- where.h $(GLIMITS_H) top.h malloc.h lex.h stamp-str symbol.h symbol.def \
- bld.h bld-op.def bit.h com.h com-rt.def $(TREE_H) info.h info-b.def \
- info-k.def info-w.def target.h type.h lab.h storag.h intrin.h \
- intrin.def equiv.h global.h name.h implic.h stb.h expr.h stp.h stt.h \
- stc.h std.h stv.h stw.h
-stb.o: stb.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) stb.h bad.h bad.def \
- where.h $(GLIMITS_H) top.h malloc.h expr.h bld.h bld-op.def bit.h com.h \
- com-rt.def $(TREE_H) info.h info-b.def info-k.def info-w.def target.h \
- lex.h type.h lab.h storag.h symbol.h symbol.def equiv.h global.h \
- name.h intrin.h intrin.def stp.h stt.h stamp-str src.h sta.h stc.h
-stc.o: stc.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) stc.h bad.h bad.def \
- where.h $(GLIMITS_H) top.h malloc.h bld.h bld-op.def bit.h com.h \
- com-rt.def $(TREE_H) info.h info-b.def info-k.def info-w.def target.h \
- lex.h type.h lab.h storag.h symbol.h symbol.def equiv.h global.h \
- name.h intrin.h intrin.def expr.h stp.h stt.h stamp-str data.h implic.h \
- src.h sta.h std.h stv.h stw.h
-std.o: std.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) std.h bld.h bld-op.def \
- bit.h malloc.h com.h com-rt.def $(TREE_H) info.h info-b.def info-k.def \
- info-w.def target.h bad.h bad.def where.h $(GLIMITS_H) top.h lex.h \
- type.h lab.h storag.h symbol.h symbol.def equiv.h global.h name.h \
- intrin.h intrin.def stp.h stt.h stamp-str stv.h stw.h sta.h ste.h sts.h
-ste.o: ste.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) $(RTL_H) $(TOPLEV_H) ste.h \
- bld.h bld-op.def bit.h malloc.h com.h com-rt.def $(TREE_H) info.h \
- info-b.def info-k.def info-w.def target.h bad.h bad.def where.h \
- $(GLIMITS_H) top.h lex.h type.h lab.h storag.h symbol.h symbol.def \
- equiv.h global.h name.h intrin.h intrin.def stp.h stt.h stamp-str sts.h \
- stv.h stw.h expr.h sta.h
-storag.o: storag.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) storag.h bld.h \
- bld-op.def bit.h malloc.h com.h com-rt.def $(TREE_H) info.h info-b.def \
- info-k.def info-w.def target.h bad.h bad.def where.h $(GLIMITS_H) top.h \
- lex.h type.h lab.h symbol.h symbol.def equiv.h global.h name.h \
- intrin.h intrin.def data.h
-stp.o: stp.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) stp.h bld.h bld-op.def \
- bit.h malloc.h com.h com-rt.def $(TREE_H) info.h info-b.def info-k.def \
- info-w.def target.h bad.h bad.def where.h $(GLIMITS_H) top.h lex.h \
- type.h lab.h storag.h symbol.h symbol.def equiv.h global.h name.h \
- intrin.h intrin.def stt.h
-str.o: str.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) src.h bad.h bad.def \
- where.h $(GLIMITS_H) top.h malloc.h stamp-str lex.h
-sts.o: sts.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) sts.h malloc.h com.h \
- com-rt.def $(TREE_H) bld.h bld-op.def bit.h info.h info-b.def info-k.def \
- info-w.def target.h bad.h bad.def where.h $(GLIMITS_H) top.h lex.h \
- type.h intrin.h intrin.def lab.h symbol.h symbol.def equiv.h storag.h \
- global.h name.h
-stt.o: stt.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) stt.h top.h malloc.h \
- where.h $(GLIMITS_H) bld.h bld-op.def bit.h com.h com-rt.def $(TREE_H) \
- info.h info-b.def info-k.def info-w.def target.h bad.h bad.def lex.h \
- type.h lab.h storag.h symbol.h symbol.def equiv.h global.h name.h \
- intrin.h intrin.def stp.h expr.h sta.h stamp-str
-stu.o: stu.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) bld.h bld-op.def bit.h \
- malloc.h com.h com-rt.def $(TREE_H) info.h info-b.def info-k.def \
- info-w.def target.h bad.h bad.def where.h $(GLIMITS_H) top.h lex.h \
- type.h lab.h storag.h symbol.h symbol.def equiv.h global.h name.h \
- intrin.h intrin.def implic.h stu.h sta.h stamp-str
-stv.o: stv.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) stv.h lab.h com.h \
- com-rt.def $(TREE_H) bld.h bld-op.def bit.h malloc.h info.h info-b.def \
- info-k.def info-w.def target.h bad.h bad.def where.h $(GLIMITS_H) top.h \
- lex.h type.h intrin.h intrin.def symbol.h symbol.def equiv.h storag.h \
- global.h name.h
-stw.o: stw.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) stw.h bld.h bld-op.def \
- bit.h malloc.h com.h com-rt.def $(TREE_H) info.h info-b.def info-k.def \
- info-w.def target.h bad.h bad.def where.h $(GLIMITS_H) top.h lex.h \
- type.h lab.h storag.h symbol.h symbol.def equiv.h global.h name.h \
- intrin.h intrin.def stv.h sta.h stamp-str
-symbol.o: symbol.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) symbol.h \
- symbol.def bld.h bld-op.def bit.h malloc.h com.h com-rt.def $(TREE_H) \
- info.h info-b.def info-k.def info-w.def target.h bad.h bad.def \
- where.h $(GLIMITS_H) top.h lex.h type.h lab.h storag.h intrin.h \
- intrin.def equiv.h global.h name.h src.h st.h
-target.o: target.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) $(GLIMITS_H) \
- target.h $(TREE_H) bad.h bad.def where.h top.h malloc.h info.h \
- info-b.def info-k.def info-w.def type.h lex.h
-top.o: top.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) top.h malloc.h where.h \
- $(GLIMITS_H) bad.h bad.def bit.h bld.h bld-op.def com.h com-rt.def \
- $(TREE_H) info.h info-b.def info-k.def info-w.def target.h lex.h type.h \
- lab.h storag.h symbol.h symbol.def equiv.h global.h name.h intrin.h \
- intrin.def data.h expr.h implic.h src.h st.h $(FLAGS_H) $(TOPLEV_H)
-type.o: type.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) type.h malloc.h
-version.o: version.c
-where.o: where.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) where.h $(GLIMITS_H) \
- top.h malloc.h lex.h
-
-# The rest of this list (Fortran 77 language-specific files) is hand-generated.
-
-stamp-str: str-1t.h str-1t.j str-2t.h str-2t.j \
- str-fo.h str-fo.j str-io.h str-io.j str-nq.h str-nq.j \
- str-op.h str-op.j str-ot.h str-ot.j
- touch stamp-str
-
-str-1t.h str-1t.j: fini str-1t.fin
- ./fini `echo $(srcdir)/str-1t.fin | sed 's,^\./,,'` str-1t.j str-1t.h
-
-str-2t.h str-2t.j: fini str-2t.fin
- ./fini `echo $(srcdir)/str-2t.fin | sed 's,^\./,,'` str-2t.j str-2t.h
-
-str-fo.h str-fo.j: fini str-fo.fin
- ./fini `echo $(srcdir)/str-fo.fin | sed 's,^\./,,'` str-fo.j str-fo.h
-
-str-io.h str-io.j: fini str-io.fin
- ./fini `echo $(srcdir)/str-io.fin | sed 's,^\./,,'` str-io.j str-io.h
-
-str-nq.h str-nq.j: fini str-nq.fin
- ./fini `echo $(srcdir)/str-nq.fin | sed 's,^\./,,'` str-nq.j str-nq.h
-
-str-op.h str-op.j: fini str-op.fin
- ./fini `echo $(srcdir)/str-op.fin | sed 's,^\./,,'` str-op.j str-op.h
-
-str-ot.h str-ot.j: fini str-ot.fin
- ./fini `echo $(srcdir)/str-ot.fin | sed 's,^\./,,'` str-ot.j str-ot.h
-
-fini: fini.o proj-h.o
- $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o fini fini.o proj-h.o
-
-fini.o:
- $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) \
- `echo $(srcdir)/fini.c | sed 's,^\./,,'` -o $@
-
-# Like proj.o, but depends on hconfig.h instead of config.h.
-proj-h.o: proj.c proj.h $(HCONFIG_H) $(SYSTEM_H) $(ASSERT_H) $(GLIMITS_H)
- $(HOST_CC) -c -DUSE_HCONFIG $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) \
- `echo $(srcdir)/proj.c | sed 's,^\./,,'` -o $@
-
-# Other than str-*.j, the *.j files are dummy #include files
-# that normally just #include the corresponding back-end *.h
-# files, but not if MAKING_DEPENDENCIES is #defined. The str-*.j
-# files also are not actually included if MAKING_DEPENDENCIES
-# is #defined. The point of all this is to come up with a clean
-# dependencies list whether working in a clean directory, such
-# that str-*.j and such do not exist, or in a directory full
-# of already-built files. Any dependency on a str-*.j file
-# implies a dependency on str.h, so we key on that to replace
-# it with stamp-str, and dependencies on the other *.j files
-# are generally left alone (modulo special macros like RTL_H)
-# because we might not want to recompile all of g77 just
-# because a back-end file changes. MG is usually "-MG" but
-# should be defined with "make MG= deps-kinda..." if using
-# a compiler that doesn't support -MG (gcc does as of 2.6) --
-# it prevents diagnostics when an #include file is missing,
-# as will be the case with proj.h in a clean directory.
-MG=-MG
-deps-kinda:
- $(HOST_CC) -DMAKING_DEPENDENCIES -MM $(MG) *.c 2>&1 | \
- sed -e 's: \([.]/\)*assert[.]j: $$(ASSERT_H):g' \
- -e 's: \([.]/\)*config[.]j: $$(CONFIG_H):g' \
- -e 's: \([.]/\)*convert[.]j: $$(CONVERT_H):g' \
- -e 's: \([.]/\)*flags[.]j: $$(FLAGS_H):g' \
- -e 's: \([.]/\)*glimits[.]j: $$(GLIMITS_H):g' \
- -e 's: \([.]/\)*hconfig[.]j: $$(HCONFIG_H):g' \
- -e 's: \([.]/\)*input[.]j: $$(INPUT_H):g' \
- -e 's: \([.]/\)*output[.]j: $$(OUTPUT_H):g' \
- -e 's: \([.]/\)*rtl[.]j: $$(RTL_H):g' \
- -e 's: \([.]/\)*system[.]j: $$(SYSTEM_H):g' \
- -e 's: \([.]/\)*tconfig[.]j: $$(TCONFIG_H):g' \
- -e 's: \([.]/\)*tm[.]j: $$(TM_H):g' \
- -e 's: \([.]/\)*toplev[.]j: $$(TOPLEV_H):g' \
- -e 's: \([.]/\)*tree[.]j: $$(TREE_H):g' \
- -e 's: \([.]/\)*str[.]h: stamp-str:g' \
- -e 's:.*g77spec.*::g' \
- -e 's%^\(.*\)[ ]*: %\1: %g'
-
-# This rule is just a handy way to build the g77 derived files without
-# having the gcc source tree around.
-g77-only: force
- if [ -f g77.texi ] ; then \
- (cd ..; $(MAKE) srcdir=. HOST_CC=cc HOST_CFLAGS=-g -f f/Make-lang.in f77.rebuilt); \
- else \
- $(MAKE) srcdir=. HOST_CC=cc HOST_CFLAGS=-g -f f/Make-lang.in f77.rebuilt; \
- fi
-
-#
-# These exist for maintenance purposes.
-
-# Update the tags table.
-TAGS: force
- cd $(srcdir)/f ; \
- etags *.c *.h ; \
- echo 'l' | tr 'l' '\f' >> TAGS ; \
- etags -a ../*.h ../*.c;
-
-.PHONY: none all all.indirect f77.rebuilt compiler native deps-kinda g77-only TAGS force
-
-force:
diff --git a/contrib/gcc/f/NEWS b/contrib/gcc/f/NEWS
deleted file mode 100644
index b8b524309ca5..000000000000
--- a/contrib/gcc/f/NEWS
+++ /dev/null
@@ -1,412 +0,0 @@
-*Note:* This file is automatically generated from the files
-`news0.texi' and `news.texi'. `NEWS' is *not* a source file, although
-it is normally included within source distributions.
-
- This file lists news about the GCC-2.95 version (and some other
-versions) of the GNU Fortran compiler. Copyright (C) 1995-1999 Free
-Software Foundation, Inc. You may copy, distribute, and modify it
-freely as long as you preserve this copyright notice and permission
-notice.
-
-News About GNU Fortran
-**********************
-
- Changes made to recent versions of GNU Fortran are listed below,
-with the most recent version first.
-
- The changes are generally listed in order:
-
- 1. Code-generation and run-time-library bug-fixes
-
- 2. Compiler and run-time-library crashes involving valid code that
- have been fixed
-
- 3. New features
-
- 4. Fixes and enhancements to existing features
-
- 5. New diagnostics
-
- 6. Internal improvements
-
- 7. Miscellany
-
- This order is not strict--for example, some items involve a
-combination of these elements.
-
- Note that two variants of `g77' are tracked below. The `egcs'
-variant is described vis-a-vis previous versions of `egcs' and/or an
-official FSF version, as appropriate.
-
- Therefore, `egcs' versions sometimes have multiple listings to help
-clarify how they differ from other versions, though this can make
-getting a complete picture of what a particular `egcs' version contains
-somewhat more difficult.
-
- *Warning:* The information below is still under development, and
-might not accurately reflect the `g77' code base of which it is a part.
-Efforts are made to keep it somewhat up-to-date, but they are
-particularly concentrated on any version of this information that is
-distributed as part of a *released* `g77'.
-
- In particular, while this information is intended to apply to the
-GCC-2.95 version of `g77', only an official *release* of that version
-is expected to contain documentation that is most consistent with the
-`g77' product in that version.
-
- Nevertheless, information on *previous* releases of `g77', below, is
-likely to be more up-to-date and accurate than the equivalent
-information that accompanied those releases, assuming the last-updated
-date of the information below is later than the dates of those releases.
-
- That's due to attempts to keep this development version of news
-about previous `g77' versions up-to-date.
-
- An online, "live" version of this document (derived directly from
-the mainline, development version of `g77' within `egcs') is available
-at `http://www.gnu.org/software/gcc/onlinedocs/g77_news.html'.
-
- The following information was last updated on 1999-07-08:
-
-In 0.5.25, `GCC' 2.95 (`EGCS' 1.2) versus `EGCS' 1.1.2:
-=======================================================
-
- 1. `g77' no longer generates bad code for assignments, or other
- conversions, of `REAL' or `COMPLEX' constant expressions to type
- `INTEGER(KIND=2)' (often referred to as `INTEGER*8').
-
- For example, `INTEGER*8 J; J = 4E10' now works as documented.
-
- 2. `g77' no longer truncates `INTEGER(KIND=2)' (usually `INTEGER*8')
- subscript expressions when evaluating array references on systems
- with pointers widers than `INTEGER(KIND=1)' (such as Alphas).
-
- 3. `g77' no longer generates bad code for an assignment to a
- `COMPLEX' variable or array that partially overlaps one or more of
- the sources of the same assignment (a very rare construction). It
- now assigns through a temporary, in cases where such partial
- overlap is deemed possible.
-
- 4. `libg2c' (`libf2c') no longer loses track of the file being worked
- on during a `BACKSPACE' operation.
-
- 5. `libg2c' (`libf2c') fixes a bug whereby input to a `NAMELIST' read
- involving a repeat count, such as `K(5)=10*3', was not properly
- handled by `libf2c'. The first item was written to `K(5)', but
- the remaining nine were written elsewhere (still within the array),
- not necessarily starting at `K(6)'.
-
- 6. Automatic arrays now seem to be working on HP-UX systems.
-
- 7. The `Date' intrinsic now returns the correct result on big-endian
- systems.
-
- 8. Fix `g77' so it no longer crashes when compiling I/O statements
- using keywords that define `INTEGER' values, such as `IOSTAT=J',
- where J is other than default `INTEGER' (such as `INTEGER*2').
- Instead, it issues a diagnostic.
-
- 9. Fix `g77' so it properly handles `DATA A/RPT*VAL/', where RPT is
- not default `INTEGER', such as `INTEGER*2', instead of producing a
- spurious diagnostic. Also fix `DATA (A(I),I=1,N)', where `N' is
- not default `INTEGER' to work instead of crashing `g77'.
-
- 10. The `-ax' option is now obeyed when compiling Fortran programs.
- (It is passed to the `f771' driver.)
-
- * The new `-fbounds-check' option causes `g77' to compile run-time
- bounds checks of array subscripts, as well as of substring start
- and end points.
-
- * `libg2c' now supports building as multilibbed library, which
- provides better support for systems that require options such as
- `-mieee' to work properly.
-
- * Source file names with the suffixes `.FOR' and `.FPP' now are
- recognized by `g77' as if they ended in `.for' and `.fpp',
- respectively.
-
- * The order of arguments to the *subroutine* forms of the `CTime',
- `DTime', `ETime', and `TtyNam' intrinsics has been swapped. The
- argument serving as the returned value for the corresponding
- function forms now is the *second* argument, making these
- consistent with the other subroutine forms of `libU77' intrinsics.
-
- * `g77' now warns about a reference to an intrinsic that has an
- interface that is not Year 2000 (Y2K) compliant. Also, `libg2c'
- has been changed to increase the likelihood of catching references
- to the implementations of these intrinsics using the `EXTERNAL'
- mechanism (which would avoid the new warnings).
-
- 11. `g77' now warns about a reference to a function when the
- corresponding *subsequent* function program unit disagrees with
- the reference concerning the type of the function.
-
- * `-fno-emulate-complex' is now the default option. This should
- result in improved performance of code that uses the `COMPLEX'
- data type.
-
- * The `-malign-double' option now reliably aligns *all*
- double-precision variables and arrays on Intel x86 targets.
-
- 12. Even without the `-malign-double' option, `g77' reliably aligns
- local double-precision variables that are not in `EQUIVALENCE'
- areas and not `SAVE''d.
-
- 13. `g77' now open-codes ("inlines") division of `COMPLEX' operands
- instead of generating a run-time call to the `libf2c' routines
- `c_div' or `z_div', unless the `-Os' option is specified.
-
- * `g77' no longer generates code to maintain `errno', a C-language
- concept, when performing operations such as the `SqRt' intrinsic.
-
- 14. `g77' developers can temporarily use the `-fflatten-arrays' option
- to compare how the compiler handles code generation using C-like
- constructs as compared to the Fortran-like method constructs
- normally used.
-
- 15. A substantial portion of the `g77' front end's code-generation
- component was rewritten. It now generates code using facilities
- more robustly supported by the `gcc' back end. One effect of this
- rewrite is that some codes no longer produce a spurious "label LAB
- used before containing binding contour" message.
-
- * Support for the `-fugly' option has been removed.
-
- 16. Improve documentation and indexing, including information on Year
- 2000 (Y2K) compliance, and providing more information on internals
- of the front end.
-
- 17. Upgrade to `libf2c' as of 1999-05-10.
-
-In 0.5.24 versus 0.5.23:
-========================
-
- There is no `g77' version 0.5.24 at this time, or planned. 0.5.24
-is the version number designated for bug fixes and, perhaps, some new
-features added, to 0.5.23. Version 0.5.23 requires `gcc' 2.8.1, as
-0.5.24 was planned to require.
-
- Due to `EGCS' becoming `GCC' (which is now an acronym for "GNU
-Compiler Collection"), and `EGCS' 1.2 becoming officially designated
-`GCC' 2.95, there seems to be no need for an actual 0.5.24 release.
-
- To reduce the confusion already resulting from use of 0.5.24 to
-designate `g77' versions within `EGCS' versions 1.0 and 1.1, as well as
-in versions of `g77' documentation and notices during that period,
-"mainline" `g77' version numbering resumes at 0.5.25 with `GCC' 2.95
-(`EGCS' 1.2), skipping over 0.5.24 as a placeholder version number.
-
- To repeat, there is no `g77' 0.5.24, but there is now a 0.5.25.
-Please remain calm and return to your keypunch units.
-
-In `EGCS' 1.1.2 versus `EGCS' 1.1.1:
-====================================
-
- * Fix the `IDate' intrinsic (VXT) (in `libg2c') so the returned year
- is in the documented, non-Y2K-compliant range of 0-99, instead of
- being returned as 100 in the year 2000.
-
- * Fix the `Date_and_Time' intrinsic (in `libg2c') to return the
- milliseconds value properly in VALUES(8).
-
- * Fix the `LStat' intrinsic (in `libg2c') to return device-ID
- information properly in SARRAY(7).
-
- * Improve documentation.
-
-In `EGCS' 1.1.1 versus `EGCS' 1.1:
-==================================
-
- * Fix `libg2c' so it performs an implicit `ENDFILE' operation (as
- appropriate) whenever a `REWIND' is done.
-
- (This bug was introduced in 0.5.23 and `egcs' 1.1 in `g77''s
- version of `libf2c'.)
-
- * Fix `libg2c' so it no longer crashes with a spurious diagnostic
- upon doing any I/O following a direct formatted write.
-
- (This bug was introduced in 0.5.23 and `egcs' 1.1 in `g77''s
- version of `libf2c'.)
-
- * Fix `g77' so it no longer crashes compiling references to the
- `Rand' intrinsic on some systems.
-
- * Fix `g77' portion of installation process so it works better on
- some systems (those with shells requiring `else true' clauses on
- `if' constructs for the completion code to be set properly).
-
-In `EGCS' 1.1 versus `EGCS' 1.0.3:
-==================================
-
- 18. Fix bugs in the `libU77' intrinsic `HostNm' that wrote one byte
- beyond the end of its `CHARACTER' argument, and in the `libU77'
- intrinsics `GMTime' and `LTime' that overwrote their arguments.
-
- 19. Assumed arrays with negative bounds (such as `REAL A(-1:*)') no
- longer elicit spurious diagnostics from `g77', even on systems
- with pointers having different sizes than integers.
-
- This bug is not known to have existed in any recent version of
- `gcc'. It was introduced in an early release of `egcs'.
-
- 20. Valid combinations of `EXTERNAL', passing that external as a dummy
- argument without explicitly giving it a type, and, in a subsequent
- program unit, referencing that external as an external function
- with a different type no longer crash `g77'.
-
- 21. `CASE DEFAULT' no longer crashes `g77'.
-
- 22. The `-Wunused' option no longer issues a spurious warning about
- the "master" procedure generated by `g77' for procedures
- containing `ENTRY' statements.
-
- * Support `FORMAT(I<EXPR>)' when EXPR is a compile-time constant
- `INTEGER' expression.
-
- * Fix `g77' `-g' option so procedures that use `ENTRY' can be
- stepped through, line by line, in `gdb'.
-
- * Allow any `REAL' argument to intrinsics `Second' and `CPU_Time'.
-
- * Use `tempnam', if available, to open scratch files (as in
- `OPEN(STATUS='SCRATCH')') so that the `TMPDIR' environment
- variable, if present, is used.
-
- * `g77''s version of `libf2c' separates out the setting of global
- state (such as command-line arguments and signal handling) from
- `main.o' into distinct, new library archive members.
-
- This should make it easier to write portable applications that
- have their own (non-Fortran) `main()' routine properly set up the
- `libf2c' environment, even when `libf2c' (now `libg2c') is a
- shared library.
-
- 23. `g77' no longer installs the `f77' command and `f77.1' man page in
- the `/usr' or `/usr/local' heirarchy, even if the `f77-install-ok'
- file exists in the source or build directory. See the
- installation documentation for more information.
-
- 24. `g77' no longer installs the `libf2c.a' library and `f2c.h'
- include file in the `/usr' or `/usr/local' heirarchy, even if the
- `f2c-install-ok' or `f2c-exists-ok' files exist in the source or
- build directory. See the installation documentation for more
- information.
-
- 25. The `libf2c.a' library produced by `g77' has been renamed to
- `libg2c.a'. It is installed only in the `gcc' "private" directory
- heirarchy, `gcc-lib'. This allows system administrators and users
- to choose which version of the `libf2c' library from `netlib' they
- wish to use on a case-by-case basis. See the installation
- documentation for more information.
-
- 26. The `f2c.h' include (header) file produced by `g77' has been
- renamed to `g2c.h'. It is installed only in the `gcc' "private"
- directory heirarchy, `gcc-lib'. This allows system administrators
- and users to choose which version of the include file from
- `netlib' they wish to use on a case-by-case basis. See the
- installation documentation for more information.
-
- * The `g77' command now expects the run-time library to be named
- `libg2c.a' instead of `libf2c.a', to ensure that a version other
- than the one built and installed as part of the same `g77' version
- is picked up.
-
- 27. During the configuration and build process, `g77' creates
- subdirectories it needs only as it needs them. Other cleaning up
- of the configuration and build process has been performed as well.
-
- 28. `install-info' now used to update the directory of Info
- documentation to contain an entry for `g77' (during installation).
-
- * Some diagnostics have been changed from warnings to errors, to
- prevent inadvertent use of the resulting, probably buggy, programs.
- These mostly include diagnostics about use of unsupported features
- in the `OPEN', `INQUIRE', `READ', and `WRITE' statements, and
- about truncations of various sorts of constants.
-
- 29. Improve compilation of `FORMAT' expressions so that a null byte is
- appended to the last operand if it is a constant. This provides a
- cleaner run-time diagnostic as provided by `libf2c' for statements
- like `PRINT '(I1', 42'.
-
- 30. Improve documentation and indexing.
-
- 31. The upgrade to `libf2c' as of 1998-06-18 should fix a variety of
- problems, including those involving some uses of the `T' format
- specifier, and perhaps some build (porting) problems as well.
-
-In `EGCS' 1.1 versus `g77' 0.5.23:
-==================================
-
- 32. Fix a code-generation bug that afflicted Intel x86 targets when
- `-O2' was specified compiling, for example, an old version of the
- `DNRM2' routine.
-
- The x87 coprocessor stack was being mismanaged in cases involving
- assigned `GOTO' and `ASSIGN'.
-
- 33. `g77' no longer produces incorrect code and initial values for
- `EQUIVALENCE' and `COMMON' aggregates that, due to "unnatural"
- ordering of members vis-a-vis their types, require initial padding.
-
- 34. Fix `g77' crash compiling code containing the construct
- `CMPLX(0.)' or similar.
-
- 35. `g77' no longer crashes when compiling code containing
- specification statements such as `INTEGER(KIND=7) PTR'.
-
- 36. `g77' no longer crashes when compiling code such as `J = SIGNAL(1,
- 2)'.
-
- * `g77' now treats `%LOC(EXPR)' and `LOC(EXPR)' as "ordinary"
- expressions when they are used as arguments in procedure calls.
- This change applies only to global (filewide) analysis, making it
- consistent with how `g77' actually generates code for these cases.
-
- Previously, `g77' treated these expressions as denoting special
- "pointer" arguments for the purposes of filewide analysis.
-
- 37. Fix `g77' crash (or apparently infinite run-time) when compiling
- certain complicated expressions involving `COMPLEX' arithmetic
- (especially multiplication).
-
- * Align static double-precision variables and arrays on Intel x86
- targets regardless of whether `-malign-double' is specified.
-
- Generally, this affects only local variables and arrays having the
- `SAVE' attribute or given initial values via `DATA'.
-
- * The `g77' driver now ensures that `-lg2c' is specified in the link
- phase prior to any occurrence of `-lm'. This prevents
- accidentally linking to a routine in the SunOS4 `-lm' library when
- the generated code wants to link to the one in `libf2c' (`libg2c').
-
- * `g77' emits more debugging information when `-g' is used.
-
- This new information allows, for example, `which __g77_length_a'
- to be used in `gdb' to determine the type of the phantom length
- argument supplied with `CHARACTER' variables.
-
- This information pertains to internally-generated type, variable,
- and other information, not to the longstanding deficiencies
- vis-a-vis `COMMON' and `EQUIVALENCE'.
-
- * The F90 `Date_and_Time' intrinsic now is supported.
-
- * The F90 `System_Clock' intrinsic allows the optional arguments
- (except for the `Count' argument) to be omitted.
-
- 38. Upgrade to `libf2c' as of 1998-06-18.
-
- 39. Improve documentation and indexing.
-
-In previous versions:
-=====================
-
- Information on previous versions is not provided in this
-`egcs/gcc/f/NEWS' file, to keep it short. See `egcs/gcc/f/news.texi',
-or any of its other derivations (Info, HTML, dvi forms) for such
-information.
-
diff --git a/contrib/gcc/f/assert.j b/contrib/gcc/f/assert.j
deleted file mode 100644
index d9b9daafdd21..000000000000
--- a/contrib/gcc/f/assert.j
+++ /dev/null
@@ -1,27 +0,0 @@
-/* assert.j -- Wrapper for GCC's assert.h
- Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley.
-
-This file is part of GNU Fortran.
-
-GNU Fortran 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.
-
-GNU Fortran is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA. */
-
-#ifndef MAKING_DEPENDENCIES
-#ifndef _J_f_assert
-#define _J_f_assert
-#include "assert.h"
-#endif
-#endif
diff --git a/contrib/gcc/f/config.j b/contrib/gcc/f/config.j
deleted file mode 100644
index fda03eb1e29a..000000000000
--- a/contrib/gcc/f/config.j
+++ /dev/null
@@ -1,27 +0,0 @@
-/* config.j -- Wrapper for GCC's config.h
- Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley.
-
-This file is part of GNU Fortran.
-
-GNU Fortran 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.
-
-GNU Fortran is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA. */
-
-#ifndef MAKING_DEPENDENCIES
-#ifndef _J_f_config
-#define _J_f_config
-#include "config.h"
-#endif
-#endif
diff --git a/contrib/gcc/f/convert.j b/contrib/gcc/f/convert.j
deleted file mode 100644
index 76b8e024b9a9..000000000000
--- a/contrib/gcc/f/convert.j
+++ /dev/null
@@ -1,28 +0,0 @@
-/* convert.j -- Wrapper for GCC's convert.h
- Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley.
-
-This file is part of GNU Fortran.
-
-GNU Fortran 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.
-
-GNU Fortran is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA. */
-
-#ifndef MAKING_DEPENDENCIES
-#ifndef _J_f_convert
-#define _J_f_convert
-#include "tree.j"
-#include "convert.h"
-#endif
-#endif
diff --git a/contrib/gcc/f/flags.j b/contrib/gcc/f/flags.j
deleted file mode 100644
index 44587a495229..000000000000
--- a/contrib/gcc/f/flags.j
+++ /dev/null
@@ -1,27 +0,0 @@
-/* flags.j -- Wrapper for GCC's flags.h
- Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley.
-
-This file is part of GNU Fortran.
-
-GNU Fortran 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.
-
-GNU Fortran is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA. */
-
-#ifndef MAKING_DEPENDENCIES
-#ifndef _J_f_flags
-#define _J_f_flags
-#include "flags.h"
-#endif
-#endif
diff --git a/contrib/gcc/f/g77.1 b/contrib/gcc/f/g77.1
deleted file mode 100644
index 3f20af9fffd4..000000000000
--- a/contrib/gcc/f/g77.1
+++ /dev/null
@@ -1,365 +0,0 @@
-.\" Copyright (c) 1995-1997 Free Software Foundation -*-Text-*-
-.\" See section COPYING for conditions for redistribution
-.\" FIXME: no info here on predefines. Should there be? extra for F77...
-.TH G77 1 "1999-02-14" "GNU Tools" "GNU Tools"
-.de BP
-.sp
-.ti \-.2i
-\(**
-..
-.SH NAME
-g77 \- GNU project Fortran Compiler (v0.5.24)
-.SH SYNOPSIS
-.RB g77 " [" \c
-.IR option " | " "filename " ].\|.\|.
-.SH WARNING
-The information in this man page is an extract from the full
-documentation of the GNU Fortran compiler (version 0.5.24),
-and is limited to the meaning of some of the options.
-.PP
-This man page is not up to date, since no volunteers want to
-maintain it. If you find a discrepancy between the man page and the
-software, please check the Info file, which is the authoritative
-documentation.
-.\" .PP
-.\" The version of GNU Fortran documented by the Info file is 0.5.24,
-.\" which includes substantial improvements and changes since 0.5.24,
-.\" the version documented in this man page.
-.PP
-If we find that the things in this man page that are out of date cause
-significant confusion or complaints, we will stop distributing the man
-page. The alternative, updating the man page when we update the Info
-file, is impractical because the rest of the work of maintaining GNU Fortran
-leaves us no time for that. The GNU project regards man pages as
-obsolete and should not let them take time away from other things.
-.PP
-For complete and current documentation, refer to the Info file `\|\c
-.B g77\c
-\&\|' or the manual
-.I
-Using and Porting GNU Fortran (for version 0.5.24)\c
-\&. Both are made from the Texinfo source file
-.BR g77.texi .
-.PP
-If your system has the `\|\c
-.B info\c
-\&\|' command installed, the command `\|\c
-.B info g77\c
-\&\|' should work, unless
-.B g77
-has not been properly installed.
-If your system lacks `\|\c
-.B info\c
-\&\|', or you wish to avoid using it for now,
-the command `\|\c
-.B more /usr/info/g77.info*\c
-\&\|' should work, unless
-.B g77
-has not been properly installed.
-.PP
-If
-.B g77
-has not been properly installed, so that you
-cannot easily access the Info file for it,
-ask your system administrator, or the installer
-of
-.B g77
-(if you know who that is) to fix the problem.
-.SH DESCRIPTION
-The C and F77 compilers are integrated;
-.B g77
-is a program to call
-.B gcc
-with options to recognize programs written in Fortran (ANSI FORTRAN 77,
-also called F77).
-.B gcc
-processes input files
-through one or more of four stages: preprocessing, compilation,
-assembly, and linking. This man page contains full descriptions for
-.I only
-F77-specific aspects of the compiler, though it also contains
-summaries of some general-purpose options. For a fuller explanation
-of the compiler, see
-.BR gcc ( 1 ).
-
-For complete documentation on GNU Fortran, type `\|\c
-.B info g77\c
-\&\|'.
-
-F77 source files use the suffix `\|\c
-.B .f\c
-\&\|', `\|\c
-.B .for\c
-\&\|', or `\|\c
-.B .FOR\c
-\&\|'; F77 files to be preprocessed by
-.BR cpp ( 1 )
-use the suffix `\|\c
-.B .F\c
-\&\|', `\|\c
-.B .fpp\c
-\&\|', or `\|\c
-.B .FPP\c
-\&\|'; Ratfor source files use the suffix `\|\c
-.B .r\c
-\&\|' (though
-.B ratfor
-itself is not supplied as part of
-.B g77\c
-\&).
-.SH OPTIONS
-There are many command-line options, including options to control
-details of optimization, warnings, and code generation, which are
-common to both
-.B gcc
-and
-.B g77\c
-\&. For full information on all options, see
-.BR gcc ( 1 ).
-
-Options must be separate: `\|\c
-.B \-dr\c
-\&\|' is quite different from `\|\c
-.B \-d \-r
-\&\|'.
-
-Most `\|\c
-.B \-f\c
-\&\|' and `\|\c
-.B \-W\c
-\&\|' options have two contrary forms:
-.BI \-f name
-and
-.BI \-fno\- name\c
-\& (or
-.BI \-W name
-and
-.BI \-Wno\- name\c
-\&). Only the non-default forms are shown here.
-
-.TP
-.B \-c
-Compile or assemble the source files, but do not link. The compiler
-output is an object file corresponding to each source file.
-.TP
-.BI \-D macro
-Define macro \c
-.I macro\c
-\& with the string `\|\c
-.B 1\c
-\&\|' as its definition.
-.TP
-.BI \-D macro = defn
-Define macro \c
-.I macro\c
-\& as \c
-.I defn\c
-\&.
-.TP
-.B \-E
-Stop after the preprocessing stage; do not run the compiler proper. The
-output is preprocessed source code, which is sent to the
-standard output.
-.TP
-.B \-g
-Produce debugging information in the operating system's native format
-(for DBX or SDB or DWARF). GDB also can work with this debugging
-information. On most systems that use DBX format, `\|\c
-.B \-g\c
-\&\|' enables use
-of extra debugging information that only GDB can use.
-
-Unlike most other Fortran compilers, GNU Fortran allows you to use `\|\c
-.B \-g\c
-\&\|' with
-`\|\c
-.B \-O\c
-\&\|'. The shortcuts taken by optimized code may occasionally
-produce surprising results: some variables you declared may not exist
-at all; flow of control may briefly move where you did not expect it;
-some statements may not be executed because they compute constant
-results or their values were already at hand; some statements may
-execute in different places because they were moved out of loops.
-
-Nevertheless it proves possible to debug optimized output. This makes
-it reasonable to use the optimizer for programs that might have bugs.
-.TP
-.BI "\-I" "dir"\c
-\&
-Append directory \c
-.I dir\c
-\& to the list of directories searched for include files.
-.TP
-.BI "\-L" "dir"\c
-\&
-Add directory \c
-.I dir\c
-\& to the list of directories to be searched
-for `\|\c
-.B \-l\c
-\&\|'.
-.TP
-.BI \-l library\c
-\&
-Use the library named \c
-.I library\c
-\& when linking.
-.TP
-.B \-nostdinc
-Do not search the standard system directories for header files. Only
-the directories you have specified with
-.B \-I
-options (and the current directory, if appropriate) are searched.
-.TP
-.B \-O
-Optimize. Optimizing compilation takes somewhat more time, and a lot
-more memory for a large function. See the GCC documentation for
-further optimisation options. Loop unrolling, in particular, may be
-worth investigating for typical numerical Fortran programs.
-.TP
-.BI "\-o " file\c
-\&
-Place output in file \c
-.I file\c
-\&.
-.TP
-.B \-S
-Stop after the stage of compilation proper; do not assemble. The output
-is an assembler code file for each non-assembler input
-file specified.
-.TP
-.BI \-U macro
-Undefine macro \c
-.I macro\c
-\&.
-.TP
-.B \-v
-Print (on standard error output) the commands executed to run the
-stages of compilation. Also print the version number of the compiler
-driver program and of the preprocessor and the compiler proper. The
-version numbers of g77 itself and the GCC distribution on which it is
-based are distinct.
-.TP
-.B \-Wall
-Issue warnings for conditions which pertain to usage that we recommend
-avoiding and that we believe is easy to avoid, even in conjunction
-with macros.
-.PP
-
-.SH FILES
-.ta \w'LIBDIR/g77\-include 'u
-file.h C header (preprocessor) file
-.br
-file.f Fortran source file
-.br
-file.for Fortran source file
-.br
-file.FOR Fortran source file
-.br
-file.F preprocessed Fortran source file
-.br
-file.fpp preprocessed Fortran source file
-.br
-file.FPP preprocessed Fortran source file
-.br
-file.r Ratfor source file (ratfor not included)
-.br
-file.s assembly language file
-.br
-file.o object file
-.br
-a.out link edited output
-.br
-\fITMPDIR\fR/cc\(** temporary files
-.br
-\fILIBDIR\fR/cpp preprocessor
-.br
-\fILIBDIR\fR/f771 compiler
-.br
-\fILIBDIR\fR/libg2c.a Fortran run-time library
-.br
-\fILIBDIR\fR/libgcc.a GCC subroutine library
-.br
-/lib/crt[01n].o start-up routine
-.br
-/lib/libc.a standard C library, see
-.IR intro (3)
-.br
-/usr/include standard directory for
-.B #include
-files
-.br
-\fILIBDIR\fR/include standard gcc directory for
-.B #include
-.br
- files.
-.sp
-.I LIBDIR
-is usually
-.B /usr/local/lib/\c
-.IR machine / version .
-.sp
-.I TMPDIR
-comes from the environment variable
-.B TMPDIR
-(default
-.B /usr/tmp
-if available, else
-.B /tmp\c
-\&).
-.SH "SEE ALSO"
-gcc(1), cpp(1), as(1), ld(1), gdb(1), adb(1), dbx(1), sdb(1).
-.br
-.RB "`\|" g77 "\|', `\|" gcc "\|', `\|" cpp "\|',"
-.RB "`\|" as "\|', `\|" ld "\|',"
-and
-.RB "`\|" gdb "\|'"
-entries in
-.B info\c
-\&.
-.br
-.I
-Using and Porting GNU Fortran (for version 0.5.24)\c
-, James Craig Burley;
-.I
-Using and Porting GNU CC (for version 2.0)\c
-, Richard M. Stallman;
-.I
-The C Preprocessor\c
-, Richard M. Stallman;
-.I
-Debugging with GDB: the GNU Source-Level Debugger\c
-, Richard M. Stallman and Roland H. Pesch;
-.I
-Using as: the GNU Assembler\c
-, Dean Elsner, Jay Fenlason & friends;
-.I
-gld: the GNU linker\c
-, Steve Chamberlain and Roland Pesch.
-
-.SH BUGS
-For instructions on how to report bugs, type `\|\c
-.B info g77 -n Bugs\c
-\&\|'.
-
-.SH COPYING
-Copyright (c) 1991-1998 Free Software Foundation, Inc.
-.PP
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-.PP
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided that the
-entire resulting derived work is distributed under the terms of a
-permission notice identical to this one.
-.PP
-Permission is granted to copy and distribute translations of this
-manual into another language, under the above conditions for modified
-versions, except that this permission notice may be included in
-translations approved by the Free Software Foundation instead of in
-the original English.
-.SH AUTHORS
-See the GNU CC Manual for the contributors to GNU CC.
-See the GNU Fortran Manual for the contributors to
-GNU Fortran.
diff --git a/contrib/gcc/f/g77install.texi b/contrib/gcc/f/g77install.texi
deleted file mode 100644
index abc639635549..000000000000
--- a/contrib/gcc/f/g77install.texi
+++ /dev/null
@@ -1,2251 +0,0 @@
-@c Copyright (C) 1995-1999 Free Software Foundation, Inc.
-@c This is part of the G77 manual.
-@c For copying conditions, see the file g77.texi.
-
-@c The text of this file appears in the file INSTALL
-@c in the G77 distribution, as well as in the G77 manual.
-
-@c Keep this the same as the dates above, since it's used
-@c in the standalone derivations of this file (e.g. INSTALL).
-@set copyrights 1995-1999
-
-@set last-update-install 1999-07-17
-
-@include root.texi
-
-@ifset DOC-INSTALL
-@c The immediately following lines apply to the INSTALL file
-@c which is generated using this file.
-@emph{Note:} This file is automatically generated from the files
-@file{install0.texi} and @file{g77install.texi}.
-@file{INSTALL} is @emph{not} a source file,
-although it is normally included within source distributions.
-
-This file contains installation information for the GNU Fortran compiler.
-Copyright (C) @value{copyrights-install} Free Software Foundation, Inc.
-You may copy, distribute, and modify it freely as long as you preserve
-this copyright notice and permission notice.
-
-@node Top,,, (dir)
-@chapter Installing GNU Fortran
-@end ifset
-
-@set version-autoconf 2.12
-@set version-bison 1.25
-@set version-gperf 2.5
-@set version-gzip 1.2.4
-@set version-make 3.76.1
-@set version-makeinfo 1.68
-@set version-patch 2.5
-@set version-sed 2.05
-@set version-tar 1.12
-@set version-texinfo 3.12
-
-@ifset DOC-G77
-@node Installation
-@chapter Installing GNU Fortran
-@cindex installing, GNU Fortran
-@end ifset
-
-The following information describes how to install @code{g77}.
-
-@clear OMIT-FSF-G77
-
-@ifset EGCS-G77
-@set OMIT-FSF-G77
-@end ifset
-
-@ifset GCC-G77
-@set OMIT-FSF-G77
-@end ifset
-
-@ifset OMIT-FSF-G77
-Note that, for users of the @value{which-g77} version of @code{g77},
-much of the information is obsolete,
-and is superceded by the
-@value{which-gcc} installation procedures.
-Such information is accordingly omitted and flagged as such.
-@end ifset
-
-@ifclear OMIT-FSF-G77
-The information in this file generally pertains to dealing
-with @emph{source} distributions of @code{g77} and @code{gcc}.
-It is possible that some of this information will be applicable
-to some @emph{binary} distributions of these products---however,
-since these distributions are not made by the maintainers of
-@code{g77}, responsibility for binary distributions rests with
-whoever built and first distributed them.
-
-Nevertheless, efforts to make @code{g77} easier to both build
-and install from source and package up as a binary distribution
-are ongoing.
-@end ifclear
-
-@ifset DEVELOPMENT
-@emph{Warning:} The information below is still under development,
-and might not accurately reflect the @code{g77} code base
-of which it is a part.
-Efforts are made to keep it somewhat up-to-date,
-but they are particularly concentrated
-on any version of this information
-that is distributed as part of a @emph{released} @code{g77}.
-
-In particular, while this information is intended to apply to
-the @value{which-g77} version of @code{g77},
-only an official @emph{release} of that version
-is expected to contain documentation that is
-most consistent with the @code{g77} product in that version.
-@end ifset
-
-The following information was last updated on @value{last-update-install}:
-
-@menu
-* Prerequisites:: Make sure your system is ready for @code{g77}.
-* Problems Installing:: Known trouble areas.
-* Settings:: Changing @code{g77} internals before building.
-* Quick Start:: The easier procedure for non-experts.
-* Complete Installation:: For experts, or those who want to be: the details.
-* Distributing Binaries:: If you plan on distributing your @code{g77}.
-@end menu
-
-@node Prerequisites
-@section Prerequisites
-@cindex prerequisites
-
-@ifset OMIT-FSF-G77
-For users of the @value{which-g77} version of @code{g77},
-this information is superceded by the
-@value{which-gcc} installation instructions.
-@end ifset
-
-@ifclear OMIT-FSF-G77
-The procedures described to unpack, configure, build, and
-install @code{g77} assume your system has certain programs
-already installed.
-
-The following prerequisites should be met by your
-system before you follow the @code{g77} installation instructions:
-
-@table @asis
-@item @code{gzip} and @code{tar}
-To unpack the @code{gcc} and @code{g77} distributions,
-you'll need the @code{gunzip} utility in the @code{gzip}
-distribution.
-Most UNIX systems already have @code{gzip} installed.
-If yours doesn't, you can get it from the FSF.
-
-Note that you'll need @code{tar} and other utilities
-as well, but all UNIX systems have these.
-There are GNU versions of all these available---in fact,
-a complete GNU UNIX system can be put together on
-most systems, if desired.
-
-The version of GNU @code{gzip} used to package this release
-is @value{version-gzip}.
-(The version of GNU @code{tar} used to package this release
-is @value{version-tar}.)
-
-@item @file{gcc-@value{version-gcc}.tar.gz}
-You need to have this, or some other applicable, version
-of @code{gcc} on your system.
-The version should be an exact copy of a distribution
-from the FSF.
-Its size is approximately 8.4MB.
-
-If you've already unpacked @file{gcc-@value{version-gcc}.tar.gz} into a
-directory (named @file{gcc-@value{version-gcc}}) called the @dfn{source tree}
-for @code{gcc}, you can delete the distribution
-itself, but you'll need to remember to skip any instructions to unpack
-this distribution.
-
-Without an applicable @code{gcc} source tree, you cannot
-build @code{g77}.
-You can obtain an FSF distribution of @code{gcc} from the FSF.
-
-@item @file{g77-@value{version-g77}.tar.gz}
-You probably have already unpacked this package,
-or you are reading an advance copy of these installation instructions,
-which are contained in this distribution.
-The size of this package is approximately 1.4MB.
-
-You can obtain an FSF distribution of @code{g77} from the FSF,
-the same way you obtained @code{gcc}.
-
-@item Enough disk space
-The amount of disk space needed to unpack, build, install,
-and use @code{g77} depends on the type of system you're
-using, how you build @code{g77}, and how much of it you
-install (primarily, which languages you install).
-
-The sizes shown below assume all languages distributed in
-@c As of `Version 2.249', texinfo.tex loses on a construction like
-@c @code{...@value{...-...}...} since the hyphen is expanded as
-@c -@discretionary{}{}{}, even though @value resets its catcode.
-@c Fortunately this is currently the only instance. Kluge, kluge.
-@iftex
-@begingroup @let@codedash=@realdash
-@end iftex
-@code{gcc-@value{version-gcc}},
-@iftex
-@endgroup
-@end iftex
-plus @code{g77}, will be built and installed.
-These sizes are indicative of GNU/Linux systems on
-Intel x86 running COFF and on Digital Alpha (AXP) systems
-running ELF.
-These should be fairly representative of 32-bit and 64-bit
-systems, respectively.
-
-Note that all sizes are approximate and subject to change without
-notice!
-They are based on preliminary releases of g77 made shortly
-before the public beta release.
-
-@itemize ---
-@item
-@code{gcc} and @code{g77} distributions occupy 10MB
-packed, 40MB unpacked.
-These consist of the source code and documentation,
-plus some derived files (mostly documentation), for
-@code{gcc} and @code{g77}.
-Any deviations from these numbers for different
-kinds of systems are likely to be very minor.
-
-@item
-A ``bootstrap'' build requires an additional 91MB
-for a total of 132MB on an ix86, and an additional
-136MB for a total of 177MB on an Alpha.
-
-@item
-Removing @file{gcc/stage1} after the build recovers
-13MB for a total of 119MB on an ix86, and recovers
-21MB for a total of 155MB on an Alpha.
-
-After doing this, the integrity of the build can
-still be verified via @samp{make compare}, and the
-@code{gcc} compiler modified and used to build itself for
-testing fairly quickly, using the copy of the compiler
-kept in @code{gcc/stage2}.
-
-@item
-Removing @file{gcc/stage2} after the build further
-recovers 39MB for a total of 80MB, and recovers
-57MB for a total of 98MB on an Alpha.
-
-After doing this, the compiler can still be installed,
-especially if GNU @code{make} is used to avoid
-gratuitous rebuilds (or, the installation can be done
-by hand).
-
-@item
-Installing @code{gcc} and @code{g77} copies
-23MB onto the @samp{--prefix} disk for a total of 103MB
-on an ix86, and copies 31MB onto the @samp{--prefix}
-disk for a total of 130MB on an Alpha.
-@end itemize
-
-After installation, if no further modifications and
-builds of @code{gcc} or @code{g77} are planned, the
-source and build directory may be removed, leaving
-the total impact on a system's disk storage as
-that of the amount copied during installation.
-
-Systems with the appropriate version of @code{gcc}
-installed don't require the complete
-bootstrap build.
-Doing a ``straight build'' requires about as much
-space as does a bootstrap build followed by removing
-both the @file{gcc/stage1} and @file{gcc/stage2}
-directories.
-
-Installing @code{gcc} and @code{g77} over existing
-versions might require less @emph{new} disk space,
-but note that, unlike many products, @code{gcc}
-installs itself in a way that avoids overwriting other
-installed versions of itself, so that other versions may
-easily be invoked (via @samp{gcc -V @var{version}}).
-
-So, the amount of space saved as a result of having
-an existing version of @code{gcc} and @code{g77}
-already installed is not much---typically only the
-command drivers (@code{gcc}, @code{g77}, @code{g++},
-and so on, which are small) and the documentation
-is overwritten by the new installation.
-The rest of the new installation is done without
-replacing existing installed versions (assuming
-they have different version numbers).
-
-@item @code{make}
-Your system must have @code{make}, and you will probably save
-yourself a lot of trouble if it is GNU @code{make} (sometimes
-referred to as @code{gmake}).
-In particular, you probably need GNU @code{make}
-to build outside the source directory
-(with @code{configure}'s @samp{--srcdir} option.)
-
-The version of GNU @code{make} used to develop this release
-is @value{version-make}.
-
-@item @code{cc}
-Your system must have a working C compiler.
-If it doesn't, you might be able to obtain
-a prebuilt binary of some version of @code{gcc}
-from the network or on CD-ROM,
-perhaps from the FSF@.
-The best source of information about binaries
-is probably a system-specific Usenet news group,
-initially via its FAQ.
-
-@xref{Installation,,Installing GNU CC,gcc,Using and Porting GNU CC},
-for more information on prerequisites for installing @code{gcc}.
-
-@item @code{sed}
-All UNIX systems have @code{sed}, but some have a broken
-version that cannot handle configuring, building, or
-installing @code{gcc} or @code{g77}.
-
-The version of GNU @code{sed} used to develop this release
-is @value{version-sed}.
-(Note that GNU @code{sed} version 3.0 was withdrawn by the
-FSF---if you happen to have this version installed, replace
-it with version @value{version-sed} immediately.
-See a GNU distribution site for further explanation.)
-
-@item @code{root} access or equivalent
-To perform the complete installation procedures on a system,
-you need to have @code{root} access to that system, or
-equivalent access to the @samp{--prefix} directory tree
-specified on the @code{configure} command line.
-
-Portions of the procedure (such as configuring and building
-@code{g77}) can be performed by any user with enough disk
-space and virtual memory.
-
-However, these instructions are oriented towards less-experienced
-users who want to install @code{g77} on their own personal
-systems.
-
-System administrators with more experience will want to
-determine for themselves how they want to modify the
-procedures described below to suit the needs of their
-installation.
-
-@item @code{autoconf}
-The version of GNU @code{autoconf} used to develop this release
-is @value{version-autoconf}.
-
-@code{autoconf} is not needed in the typical case of
-installing @code{gcc} and @code{g77}.
-@xref{Missing tools?}, for information on when it
-might be needed and how to work around not having it.
-
-@item @code{bison}
-The version of GNU @code{bison} used to develop this release
-is @value{version-bison}.
-
-@code{bison} is not needed in the typical case of
-installing @code{gcc} and @code{g77}.
-@xref{Missing tools?}, for information on when it
-might be needed and how to work around not having it.
-
-@item @code{gperf}
-The version of GNU @code{gperf} used to develop this release
-is @value{version-gperf}.
-
-@code{gperf} is not needed in the typical case of
-installing @code{gcc} and @code{g77}.
-@xref{Missing tools?}, for information on when it
-might be needed and how to work around not having it.
-
-@item @code{makeinfo}
-The version of GNU @code{makeinfo} used to develop this release
-is @value{version-makeinfo}.
-
-@code{makeinfo} is part of the GNU @code{texinfo} package;
-@code{makeinfo} version @value{version-makeinfo}
-is distributed as part of
-GNU @code{texinfo} version @value{version-texinfo}.
-
-@code{makeinfo} is not needed in the typical case of
-installing @code{gcc} and @code{g77}.
-@xref{Missing tools?}, for information on when it
-might be needed and how to work around not having it.
-
-An up-to-date version of GNU @code{makeinfo} is still convenient
-when obtaining a new version of a GNU distribution such as
-@code{gcc} or @code{g77},
-as it allows you to obtain the @file{.diff.gz} file
-instead of the entire @file{.tar.gz} distribution
-(assuming you have installed @code{patch}).
-
-@item @code{patch}
-The version of GNU @code{patch} used to develop this release
-is @value{version-patch}.
-
-Beginning with @code{g77} version 0.5.23, it is no longer
-necessary to patch the @code{gcc} back end to build @code{g77}.
-
-An up-to-date version of GNU @code{patch} is still convenient
-when obtaining a new version of a GNU distribution such as
-@code{gcc} or @code{g77},
-as it allows you to obtain the @file{.diff.gz} file
-instead of the entire @file{.tar.gz} distribution
-(assuming you have installed the tools needed
-to rebuild derived files, such as @code{makeinfo}).
-@end table
-
-@end ifclear
-
-@node Problems Installing
-@section Problems Installing
-@cindex problems installing
-@cindex installation problems
-
-This is a list of problems (and some apparent problems which don't
-really mean anything is wrong) that show up when configuring,
-building, installing, or porting GNU Fortran.
-
-@xref{Installation Problems,,,gcc,Using and Porting GNU CC},
-for more information on installation problems that can afflict
-either @code{gcc} or @code{g77}.
-
-@menu
-* General Problems:: Problems afflicting most or all systems.
-* System-specific Problems:: Problems afflicting particular systems.
-* Cross-compiler Problems:: Problems afflicting cross-compilation setups.
-@end menu
-
-@node General Problems
-@subsection General Problems
-
-These problems can occur on most or all systems.
-
-@menu
-* GNU C Required:: Why even ANSI C is not enough.
-* Patching GNU CC:: Why @code{gcc} needn't be patched.
-* Building GNU CC Necessary:: Why you can't build @emph{just} Fortran.
-* Missing strtoul or bsearch:: When linking @code{f771} fails.
-* Cleanup Kills Stage Directories:: For @code{g77} developers.
-* LANGUAGES Macro Ignored:: Sometimes @code{LANGUAGES} is ignored.
-@end menu
-
-@node GNU C Required
-@subsubsection GNU C Required
-@cindex GNU C required
-@cindex requirements, GNU C
-
-Compiling @code{g77} requires GNU C, not just ANSI C.
-Fixing this wouldn't
-be very hard (just tedious), but the code using GNU extensions to
-the C language is expected to be rewritten for 0.6 anyway,
-so there are no plans for an interim fix.
-
-This requirement does not mean you must already have @code{gcc}
-installed to build @code{g77}.
-As long as you have a working C compiler, you can use a
-``bootstrap'' build to automate the process of first building
-@code{gcc} using the working C compiler you have, then building
-@code{g77} and rebuilding @code{gcc} using that just-built @code{gcc},
-and so on.
-
-@node Patching GNU CC
-@subsubsection Patching GNU CC
-@cindex patch files
-@cindex GBE
-
-@code{g77} no longer requires application of a patch file
-to the @code{gcc} compiler tree.
-In fact, no such patch file is distributed with @code{g77}.
-This is as of version 0.5.23
-and @code{egcs} version 1.0.
-
-@node Building GNU CC Necessary
-@subsubsection Building GNU CC Necessary
-@cindex @code{gcc}, building
-@cindex building gcc
-
-It should be possible to build the runtime without building @code{cc1}
-and other non-Fortran items, but, for now, an easy way to do that
-is not yet established.
-
-@node Missing strtoul or bsearch
-@subsubsection Missing strtoul or bsearch
-@cindex bsearch
-@cindex _bsearch
-@cindex strtoul
-@cindex _strtoul
-@cindex undefined reference (_bsearch)
-@cindex undefined reference (_strtoul)
-@cindex f771, linking error for
-@cindex linking error for f771
-@cindex @code{ld}, error linking f771
-@cindex @code{ld}, can't find _bsearch
-@cindex @code{ld}, can't find _strtoul
-@cindex SunOS4
-
-@ifset OMIT-FSF-G77
-This information does not apply to
-the @value{which-g77} version of @code{g77},
-@end ifset
-
-@ifclear OMIT-FSF-G77
-On SunOS4 systems, linking the @code{f771} program used to
-produce an error message concerning an undefined symbol named
-@samp{_strtoul}, because the @code{strtoul} library function
-is not provided on that system.
-
-Other systems have, in the past, been reported to not provide
-their own @code{strtoul} or @code{bsearch} function.
-
-Some versions @code{g77} tried to default to providing bare-bones
-versions of @code{bsearch} and @code{strtoul} automatically,
-but every attempt at this has failed for at least one kind of system.
-
-To limit the failures to those few systems actually missing the
-required routines, the bare-bones versions are still provided,
-in @file{@value{path-g77}/proj.c},
-if the appropriate macros are defined.
-These are @code{NEED_BSEARCH} for @code{bsearch} and
-@code{NEED_STRTOUL} for @code{NEED_STRTOUL}.
-
-Therefore, if you are sure your system is missing
-@code{bsearch} or @code{strtoul} in its library,
-define the relevant macro(s) before building @code{g77}.
-This can be done by editing @file{@value{path-g77}/proj.c} and inserting
-either or both of the following @samp{#define} statements
-before the comment shown:
-
-@smallexample
-/* Insert #define statements here. */
-
-#define NEED_BSEARCH
-#define NEED_STRTOUL
-@end smallexample
-
-Then, continue configuring and building @code{g77} as usual.
-
-Or, you can define these on the @code{make} command line.
-To build with the bundled @code{cc} on SunOS4, for example, try:
-@smallexample
-make bootstrap BOOT_CFLAGS='-O2 -g -DNEED_STRTOUL'
-@end smallexample
-
-If you then encounter problems compiling @file{@value{path-g77}/proj.c},
-it might be due to a discrepancy between how @code{bsearch}
-or @code{strtoul} are defined by that file and how they're
-declared by your system's header files.
-
-In that case, you'll have to use some basic knowledge of C
-to work around the problem, perhaps by editing @file{@value{path-g77}/proj.c}
-somewhat.
-
-@end ifclear
-
-@node Cleanup Kills Stage Directories
-@subsubsection Cleanup Kills Stage Directories
-@cindex stage directories
-@cindex make clean
-
-It'd be helpful if @code{g77}'s @file{Makefile.in} or @file{Make-lang.in}
-would create the various @file{stage@var{n}} directories and their
-subdirectories, so developers and expert installers wouldn't have to
-reconfigure after cleaning up.
-
-That help has arrived as of version 0.5.23 of @code{g77}
-and version 1.1 of @code{egcs}.
-Configuration itself no longer creates any particular directories
-that are unique to @code{g77}.
-The build procedures in @file{Make-lang.in} take care of
-that, on demand.
-
-@node LANGUAGES Macro Ignored
-@subsubsection LANGUAGES Macro Ignored
-@cindex @code{LANGUAGES} macro ignored
-@cindex ignoring @code{LANGUAGES} macro
-
-Prior to version 0.5.23 of @code{g77}
-and version 1.1 of @code{egcs},
-@code{g77} would sometimes ignore
-the absence of @code{f77} and @code{F77} in the
-@code{LANGUAGES} macro definition used for the
-@code{make} command being processed.
-
-As of @code{g77} version 0.5.23
-and @code{egcs} version 1.1,
-@code{g77} now obeys this macro
-in all relevant situations.
-
-However, in versions of @code{gcc} through 2.8.1,
-non-@code{g77} portions of @code{gcc},
-such as @code{g++},
-are known to go ahead and perform various
-language-specific activities when their
-respective language strings do not appear
-in the @code{LANGUAGES} macro in effect
-during that invocation of @code{make}.
-
-It is expected that these remaining problems will
-be fixed in a future version of @code{gcc}.
-
-@node System-specific Problems
-@subsection System-specific Problems
-
-@cindex AIX
-A linker bug on some versions of AIX 4.1 might prevent building
-when @code{g77} is built within @code{gcc}.
-It might also occur when building within @code{egcs}.
-@ifset DOC-G77
-@xref{LINKFAIL}.
-@end ifset
-
-@node Cross-compiler Problems
-@subsection Cross-compiler Problems
-@cindex cross-compiler, problems
-
-@code{g77} has been in alpha testing since September of
-1992, and in public beta testing since February of 1995.
-Alpha testing was done by a small number of people worldwide on a fairly
-wide variety of machines, involving self-compilation in most or
-all cases.
-Beta testing has been done primarily via self-compilation,
-but in more and more cases, cross-compilation (and ``criss-cross
-compilation'', where a version of a compiler is built on one machine
-to run on a second and generate code that runs on a third) has
-been tried and has succeeded, to varying extents.
-
-Generally, @code{g77} can be ported to any configuration to which
-@code{gcc}, @code{f2c}, and @code{libf2c} can be ported and made
-to work together, aside from the known problems described in this
-manual.
-If you want to port @code{g77} to a particular configuration,
-you should first make sure @code{gcc} and @code{libf2c} can be
-ported to that configuration before focusing on @code{g77}, because
-@code{g77} is so dependent on them.
-
-Even for cases where @code{gcc} and @code{libf2c} work,
-you might run into problems with cross-compilation on certain machines,
-for several reasons.
-
-@itemize @bullet
-@item
-There is one known bug
-(a design bug to be fixed in 0.6) that prevents configuration of
-@code{g77} as a cross-compiler in some cases,
-though there are assumptions made during
-configuration that probably make doing non-self-hosting builds
-a hassle, requiring manual intervention.
-
-@item
-@code{gcc} might still have some trouble being configured
-for certain combinations of machines.
-For example, it might not know how to handle floating-point
-constants.
-
-@item
-Improvements to the way @code{libg2c} is built could make
-building @code{g77} as a cross-compiler easier---for example,
-passing and using @samp{$(LD)} and @samp{$(AR)} in the appropriate
-ways.
-(This is improved in the @code{egcs} version of @code{g77},
-especially as of version 1.1.)
-
-@item
-There are still some challenges putting together the right
-run-time libraries (needed by @code{libg2c}) for a target
-system, depending on the systems involved in the configuration.
-(This is a general problem with cross-compilation, and with
-@code{gcc} in particular.)
-@end itemize
-
-@node Settings
-@section Changing Settings Before Building
-
-Here are some internal @code{g77} settings that can be changed
-by editing source files in @file{@value{path-g77}/} before building.
-
-This information, and perhaps even these settings, represent
-stop-gap solutions to problems people doing various ports
-of @code{g77} have encountered.
-As such, none of the following information is expected to
-be pertinent in future versions of @code{g77}.
-
-@menu
-* Larger File Unit Numbers:: Raising @code{MXUNIT}.
-* Always Flush Output:: Synchronizing write errors.
-* Maximum Stackable Size:: Large arrays forced off the stack.
-* Floating-point Bit Patterns:: Possible programs building @code{g77}
- as a cross-compiler.
-* Large Initialization:: Large arrays with @code{DATA}
- initialization.
-* Alpha Problems Fixed:: Problems with 64-bit systems like
- Alphas now fixed?
-@end menu
-
-@node Larger File Unit Numbers
-@subsection Larger File Unit Numbers
-@cindex MXUNIT
-@cindex unit numbers
-@cindex maximum unit number
-@cindex illegal unit number
-@cindex increasing maximum unit number
-
-As distributed, whether as part of @code{f2c} or @code{g77},
-@code{libf2c} accepts file unit numbers only in the range
-0 through 99.
-For example, a statement such as @samp{WRITE (UNIT=100)} causes
-a run-time crash in @code{libf2c}, because the unit number,
-100, is out of range.
-
-If you know that Fortran programs at your installation require
-the use of unit numbers higher than 99, you can change the
-value of the @code{MXUNIT} macro, which represents the maximum unit
-number, to an appropriately higher value.
-
-To do this, edit the file @file{@value{path-libf2c}/libI77/fio.h} in your
-@code{g77} source tree, changing the following line:
-
-@example
-#define MXUNIT 100
-@end example
-
-Change the line so that the value of @code{MXUNIT} is defined to be
-at least one @emph{greater} than the maximum unit number used by
-the Fortran programs on your system.
-
-(For example, a program that does @samp{WRITE (UNIT=255)} would require
-@code{MXUNIT} set to at least 256 to avoid crashing.)
-
-Then build or rebuild @code{g77} as appropriate.
-
-@emph{Note:} Changing this macro has @emph{no} effect on other limits
-your system might place on the number of files open at the same time.
-That is, the macro might allow a program to do @samp{WRITE (UNIT=100)},
-but the library and operating system underlying @code{libf2c} might
-disallow it if many other files have already been opened (via @code{OPEN} or
-implicitly via @code{READ}, @code{WRITE}, and so on).
-Information on how to increase these other limits should be found
-in your system's documentation.
-
-@node Always Flush Output
-@subsection Always Flush Output
-@cindex ALWAYS_FLUSH
-@cindex synchronous write errors
-@cindex disk full
-@cindex flushing output
-@cindex fflush()
-@cindex I/O, flushing
-@cindex output, flushing
-@cindex writes, flushing
-@cindex NFS
-@cindex network file system
-
-Some Fortran programs require output
-(writes) to be flushed to the operating system (under UNIX,
-via the @code{fflush()} library call) so that errors,
-such as disk full, are immediately flagged via the relevant
-@code{ERR=} and @code{IOSTAT=} mechanism, instead of such
-errors being flagged later as subsequent writes occur, forcing
-the previously written data to disk, or when the file is
-closed.
-
-Essentially, the difference can be viewed as synchronous error
-reporting (immediate flagging of errors during writes) versus
-asynchronous, or, more precisely, buffered error reporting
-(detection of errors might be delayed).
-
-@code{libg2c} supports flagging write errors immediately when
-it is built with the @code{ALWAYS_FLUSH} macro defined.
-This results in a @code{libg2c} that runs slower, sometimes
-quite a bit slower, under certain circumstances---for example,
-accessing files via the networked file system NFS---but the
-effect can be more reliable, robust file I/O.
-
-If you know that Fortran programs requiring this level of precision
-of error reporting are to be compiled using the
-version of @code{g77} you are building, you might wish to
-modify the @code{g77} source tree so that the version of
-@code{libg2c} is built with the @code{ALWAYS_FLUSH} macro
-defined, enabling this behavior.
-
-To do this, find this line in @file{@value{path-libf2c}/f2c.h} in
-your @code{g77} source tree:
-
-@example
-/* #define ALWAYS_FLUSH */
-@end example
-
-Remove the leading @samp{/*@w{ }},
-so the line begins with @samp{#define},
-and the trailing @samp{@w{ }*/}.
-
-Then build or rebuild @code{g77} as appropriate.
-
-@node Maximum Stackable Size
-@subsection Maximum Stackable Size
-@vindex FFECOM_sizeMAXSTACKITEM
-@cindex code, stack variables
-@cindex maximum stackable size
-@cindex stack, allocation
-@cindex segmentation violation
-@code{g77}, on most machines, puts many variables and arrays on the stack
-where possible, and can be configured (by changing
-@code{FFECOM_sizeMAXSTACKITEM} in @file{@value{path-g77}/com.c}) to force
-smaller-sized entities into static storage (saving
-on stack space) or permit larger-sized entities to be put on the
-stack (which can improve run-time performance, as it presents
-more opportunities for the GBE to optimize the generated code).
-
-@emph{Note:} Putting more variables and arrays on the stack
-might cause problems due to system-dependent limits on stack size.
-Also, the value of @code{FFECOM_sizeMAXSTACKITEM} has no
-effect on automatic variables and arrays.
-@xref{But-bugs}, for more information.
-
-@node Floating-point Bit Patterns
-@subsection Floating-point Bit Patterns
-
-@cindex cross-compiler, building
-@cindex floating-point bit patterns
-@cindex bit patterns
-The @code{g77} build will crash if an attempt is made to build
-it as a cross-compiler
-for a target when @code{g77} cannot reliably determine the bit pattern of
-floating-point constants for the target.
-Planned improvements for version 0.6 of @code{g77}
-will give it the capabilities it needs to not have to crash the build
-but rather generate correct code for the target.
-(Currently, @code{g77}
-would generate bad code under such circumstances if it didn't crash
-during the build, e.g. when compiling a source file that does
-something like @samp{EQUIVALENCE (I,R)} and @samp{DATA R/9.43578/}.)
-
-@node Large Initialization
-@subsection Initialization of Large Aggregate Areas
-
-@cindex speed, of compiler
-@cindex slow compiler
-@cindex memory utilization
-@cindex large initialization
-@cindex aggregate initialization
-A warning message is issued when @code{g77} sees code that provides
-initial values (e.g. via @code{DATA}) to an aggregate area (@code{COMMON}
-or @code{EQUIVALENCE}, or even a large enough array or @code{CHARACTER}
-variable)
-that is large enough to increase @code{g77}'s compile time by roughly
-a factor of 10.
-
-This size currently is quite small, since @code{g77}
-currently has a known bug requiring too much memory
-and time to handle such cases.
-In @file{@value{path-g77}/data.c}, the macro
-@code{FFEDATA_sizeTOO_BIG_INIT_} is defined
-to the minimum size for the warning to appear.
-The size is specified in storage units,
-which can be bytes, words, or whatever, on a case-by-case basis.
-
-After changing this macro definition, you must
-(of course) rebuild and reinstall @code{g77} for
-the change to take effect.
-
-Note that, as of version 0.5.18, improvements have
-reduced the scope of the problem for @emph{sparse}
-initialization of large arrays, especially those
-with large, contiguous uninitialized areas.
-However, the warning is issued at a point prior to
-when @code{g77} knows whether the initialization is sparse,
-and delaying the warning could mean it is produced
-too late to be helpful.
-
-Therefore, the macro definition should not be adjusted to
-reflect sparse cases.
-Instead, adjust it to generate the warning when densely
-initialized arrays begin to cause responses noticeably slower
-than linear performance would suggest.
-
-@node Alpha Problems Fixed
-@subsection Alpha Problems Fixed
-
-@cindex Alpha, support
-@cindex 64-bit systems
-@code{g77} used to warn when it was used to compile Fortran code
-for a target configuration that is not basically a 32-bit
-machine (such as an Alpha, which is a 64-bit machine, especially
-if it has a 64-bit operating system running on it).
-That was because @code{g77} was known to not work
-properly on such configurations.
-
-As of version 0.5.20, @code{g77} is believed to work well
-enough on such systems.
-So, the warning is no longer needed or provided.
-
-However, support for 64-bit systems, especially in
-areas such as cross-compilation and handling of
-intrinsics, is still incomplete.
-The symptoms
-are believed to be compile-time diagnostics rather
-than the generation of bad code.
-It is hoped that version 0.6 will completely support 64-bit
-systems.
-
-@node Quick Start
-@section Quick Start
-@cindex quick start
-
-@ifset OMIT-FSF-G77
-For users of the @value{which-g77} version of @code{g77},
-this information is superceded by the
-@value{which-gcc} installation instructions.
-@end ifset
-
-@ifclear OMIT-FSF-G77
-This procedure configures, builds, and installs @code{g77}
-``out of the box'' and works on most UNIX systems.
-Each command is identified by a unique number,
-used in the explanatory text that follows.
-For the most part, the output of each command is not shown,
-though indications of the types of responses are given in a
-few cases.
-
-To perform this procedure, the installer must be logged
-in as user @code{root}.
-Much of it can be done while not logged in as @code{root},
-and users experienced with UNIX administration should be
-able to modify the procedure properly to do so.
-
-Following traditional UNIX conventions, it is assumed that
-the source trees for @code{g77} and @code{gcc} will be
-placed in @file{/usr/src}.
-It also is assumed that the source distributions themselves
-already reside in @file{/usr/FSF}, a naming convention
-used by the author of @code{g77} on his own system:
-
-@example
-/usr/FSF/gcc-@value{version-gcc}.tar.gz
-/usr/FSF/g77-@value{version-g77}.tar.gz
-@end example
-
-@c (You can use @file{gcc-2.7.2.1.tar.gz} instead, or
-@c the equivalent of it obtained by applying the
-@c patch distributed as @file{gcc-2.7.2-2.7.2.1.diff.gz}
-@c to version 2.7.2 of @code{gcc},
-@c if you remember to make the appropriate adjustments in the
-@c instructions below.)
-
-@c @cindex SunOS4
-@c Users of the following systems should not blindly follow
-@c these quick-start instructions, because of problems their
-@c systems have coping with straightforward installation of
-@c @code{g77}:
-@c
-@c @itemize @bullet
-@c @item
-@c SunOS4
-@c @end itemize
-@c
-@c Instead, see @ref{Complete Installation}, for detailed information
-@c on how to configure, build, and install @code{g77} for your
-@c particular system.
-@c Also, see @ref{Trouble,,Known Causes of Trouble with GNU Fortran},
-@c for information on bugs and other problems known to afflict the
-@c installation process, and how to report newly discovered ones.
-@c
-@c If your system is @emph{not} on the above list, and @emph{is}
-@c a UNIX system or one of its variants, you should be able to
-@c follow the instructions below.
-
-If you vary @emph{any} of the steps below, you might run into
-trouble, including possibly breaking existing programs for
-other users of your system.
-Before doing so, it is wise to review the explanations of some
-of the steps.
-These explanations follow this list of steps.
-
-@example
-sh[ 1]# @kbd{cd /usr/src}
-@set source-dir 1
-sh[ 2]# @kbd{gunzip -c < /usr/FSF/gcc-@value{version-gcc}.tar.gz | tar xf -}
-[Might say "Broken pipe"...that is normal on some systems.]
-@set unpack-gcc 2
-sh[ 3]# @kbd{gunzip -c < /usr/FSF/g77-@value{version-g77}.tar.gz | tar xf -}
-["Broken pipe" again possible.]
-@set unpack-g77 3
-sh[ 4]# @kbd{ln -s gcc-@value{version-gcc} gcc}
-@set link-gcc 4
-sh[ 5]# @kbd{ln -s g77-@value{version-g77} g77}
-@set link-g77 5
-sh[ 6]# @kbd{mv -i g77/* gcc}
-[No questions should be asked by mv here; or, you made a mistake.]
-@set merge-g77 6
-sh[ 7]# @kbd{cd gcc}
-sh[ 8]# @kbd{./configure --prefix=/usr}
-[Do not do the above if gcc is not installed in /usr/bin.
-You might need a different @kbd{--prefix=@dots{}}, as
-described below.]
-@set configure-gcc 8
-sh[ 9]# @kbd{make bootstrap}
-[This takes a long time, and is where most problems occur.]
-@set build-gcc 9
-sh[10]# @kbd{make compare}
-[This verifies that the compiler is `sane'.
-If any files are printed, you have likely found a g77 bug.]
-@set compare-gcc 10
-sh[11]# @kbd{rm -fr stage1}
-@set rm-stage1 11
-sh[12]# @kbd{make -k install}
-[The actual installation.]
-@set install-g77 12
-sh[13]# @kbd{g77 -v}
-[Verify that g77 is installed, obtain version info.]
-@set show-version 13
-sh[14]#
-@set end-procedure 14
-@end example
-
-@xref{Updating Documentation,,Updating Your Info Directory}, for
-information on how to update your system's top-level @code{info}
-directory to contain a reference to this manual, so that
-users of @code{g77} can easily find documentation instead
-of having to ask you for it.
-
-Elaborations of many of the above steps follows:
-
-@table @asis
-@item Step @value{source-dir}: @kbd{cd /usr/src}
-You can build @code{g77} pretty much anyplace.
-By convention, this manual assumes @file{/usr/src}.
-It might be helpful if other users on your system
-knew where to look for the source code for the
-installed version of @code{g77} and @code{gcc} in any case.
-
-@c @item Step @value{unpack-gcc}: @kbd{gunzip -d @dots{}}
-@c Here, you might wish to use @file{gcc-2.7.2.1.tar.gz}
-@c instead, or apply @file{gcc-2.7.2-2.7.2.1.diff.gz} to achieve
-@c similar results.
-
-@item Step @value{unpack-g77}: @kbd{gunzip -d < /usr/FSF/g77-@value{version-g77}.tar.gz | tar xf -}
-It is not always necessary to obtain the latest version of
-@code{g77} as a complete @file{.tar.gz} file if you have
-a complete, earlier distribution of @code{g77}.
-If appropriate, you can unpack that earlier
-version of @code{g77}, and then apply the appropriate patches
-to achieve the same result---a source tree containing version
-@value{version-g77} of @code{g77}.
-
-@item Step @value{link-gcc}: @kbd{ln -s gcc-@value{version-gcc} gcc}
-@item Step @value{link-g77}: @kbd{ln -s g77-@value{version-g77} g77}
-These commands mainly help reduce typing,
-and help reduce visual clutter in examples
-in this manual showing what to type to install @code{g77}.
-
-@c Of course, if appropriate, @kbd{ln -s gcc-2.7.2.1 gcc} or
-@c similar.
-
-@xref{Unpacking}, for information on
-using distributions of @code{g77} made by organizations
-other than the FSF.
-
-@item Step @value{merge-g77}: @kbd{mv -i g77/* gcc}
-After doing this, you can, if you like, type
-@samp{rm g77} and @samp{rmdir g77-@value{version-g77}} to remove
-the empty directory and the symbol link to it.
-But, it might be helpful to leave them around as
-quick reminders of which version(s) of @code{g77} are
-installed on your system.
-
-@xref{Unpacking}, for information
-on the contents of the @file{g77} directory (as merged
-into the @file{gcc} directory).
-
-@item Step @value{configure-gcc}: @kbd{./configure --prefix=/usr}
-This is where you specify that
-the @file{g77} and @file{gcc} executables are to be
-installed in @file{/usr/bin/},
-the @code{g77} and @code{gcc} documentation is
-to be installed in @file{/usr/info/} and @file{/usr/man/},
-and so on.
-
-You should ensure that any existing installation of the @file{gcc}
-executable is in @file{/usr/bin/}.
-
-However, if that existing version of @code{gcc} is not @value{version-gcc},
-or if you simply wish to avoid risking overwriting it with a
-newly built copy of the same version,
-you can specify @samp{--prefix=/usr/local}
-(which is the default)
-or some other path,
-and invoke the newly installed version
-directly from that path's @file{bin} directory.
-
-@xref{Where to Install,,Where in the World Does Fortran (and GNU CC) Go?},
-for more information on determining where to install @code{g77}.
-@xref{Configuring gcc}, for more information on the
-configuration process triggered by invoking the @file{./configure}
-script.
-
-@item Step @value{build-gcc}: @kbd{make bootstrap}
-@xref{Installation,,Installing GNU CC,
-gcc,Using and Porting GNU CC}, for information
-on the kinds of diagnostics you should expect during
-this procedure.
-
-@xref{Building gcc}, for complete @code{g77}-specific
-information on this step.
-
-@item Step @value{compare-gcc}: @kbd{make compare}
-@xref{Bug Lists,,Where to Port Bugs}, for information
-on where to report that you observed files
-having different contents during this
-phase.
-
-@xref{Bug Reporting,,How to Report Bugs}, for
-information on @emph{how} to report bugs like this.
-
-@item Step @value{rm-stage1}: @kbd{rm -fr stage1}
-You don't need to do this, but it frees up disk space.
-
-@item Step @value{install-g77}: @kbd{make -k install}
-If this doesn't seem to work, try:
-
-@example
-make -k install install-libf77
-@end example
-
-Or, make sure you're using GNU @code{make}.
-
-@xref{Installation of Binaries}, for more information.
-
-@xref{Updating Documentation,,Updating Your Info Directory},
-for information on entering this manual into your
-system's list of texinfo manuals.
-
-@item Step @value{show-version}: @kbd{g77 -v}
-If this command prints approximately 25 lines of output,
-including the GNU Fortran Front End version number (which
-should be the same as the version number for the version
-of @code{g77} you just built and installed) and the
-version numbers for the three parts of the @code{libf2c}
-library (@code{libF77}, @code{libI77}, @code{libU77}), and
-those version numbers are all in agreement, then there is
-a high likelihood that the installation has been successfully
-completed.
-
-You might consider doing further testing.
-For example, log in as a non-privileged user, then create
-a small Fortran program, such as:
-
-@example
- PROGRAM SMTEST
- DO 10 I=1, 10
- PRINT *, 'Hello World #', I
-10 CONTINUE
- END
-@end example
-
-Compile, link, and run the above program, and, assuming you named
-the source file @file{smtest.f}, the session should look like this:
-
-@example
-sh# @kbd{g77 -o smtest smtest.f}
-sh# @kbd{./smtest}
- Hello World # 1
- Hello World # 2
- Hello World # 3
- Hello World # 4
- Hello World # 5
- Hello World # 6
- Hello World # 7
- Hello World # 8
- Hello World # 9
- Hello World # 10
-sh#
-@end example
-
-If invoking @code{g77} doesn't seem to work,
-the problem might be that you've installed it in
-a location that is not in your shell's search path.
-For example, if you specified @samp{--prefix=/gnu},
-and @file{/gnu/bin} is not in your @code{PATH}
-environment variable,
-you must explicitly specify the location of the compiler
-via @kbd{/gnu/bin/g77 -o smtest smtest.f}.
-
-After proper installation, you don't
-need to keep your gcc and g77 source and build directories
-around anymore.
-Removing them can free up a lot of disk space.
-@end table
-
-@end ifclear
-
-@node Complete Installation
-@section Complete Installation
-
-@ifset OMIT-FSF-G77
-For users of the @value{which-g77} version of @code{g77},
-this information is superceded by the
-@value{which-gcc} installation instructions.
-@end ifset
-
-@ifclear OMIT-FSF-G77
-Here is the complete @code{g77}-specific information on how
-to configure, build, and install @code{g77}.
-
-@menu
-* Unpacking::
-* Merging Distributions::
-* Where to Install::
-* Configuring gcc::
-* Building gcc::
-* Pre-installation Checks::
-* Installation of Binaries::
-* Updating Documentation::
-* Missing tools?::
-@end menu
-
-@node Unpacking
-@subsection Unpacking
-@cindex unpacking distributions
-@cindex distributions, unpacking
-@cindex code, source
-@cindex source code
-@cindex source tree
-@cindex packages
-
-The @code{gcc} source distribution is a stand-alone distribution.
-It is designed to be unpacked (producing the @code{gcc}
-source tree) and built as is, assuming certain
-prerequisites are met (including the availability of compatible
-UNIX programs such as @code{make}, @code{cc}, and so on).
-
-However, before building @code{gcc}, you will want to unpack
-and merge the @code{g77} distribution in with it, so that you
-build a Fortran-capable version of @code{gcc}, which includes
-the @code{g77} command, the necessary run-time libraries,
-and this manual.
-
-Unlike @code{gcc}, the @code{g77} source distribution
-is @emph{not} a stand-alone distribution.
-It is designed to be unpacked and, afterwards, immediately merged
-into an applicable @code{gcc} source tree.
-That is, the @code{g77} distribution @emph{augments} a
-@code{gcc} distribution---without @code{gcc}, generally
-only the documentation is immediately usable.
-
-A sequence of commands typically used to unpack @code{gcc}
-and @code{g77} is:
-
-@example
-sh# @kbd{cd /usr/src}
-sh# @kbd{gunzip -c /usr/FSF/gcc-@value{version-gcc}.tar.gz | tar xf -}
-sh# @kbd{gunzip -c /usr/FSF/g77-@value{version-g77}.tar.gz | tar xf -}
-sh# @kbd{ln -s gcc-@value{version-gcc} gcc}
-sh# @kbd{ln -s g77-@value{version-g77} g77}
-sh# @kbd{mv -i g77/* gcc}
-@end example
-
-@emph{Notes:} The commands beginning with @samp{gunzip@dots{}} might
-print @samp{Broken pipe@dots{}} as they complete.
-That is nothing to worry about, unless you actually
-@emph{hear} a pipe breaking.
-The @code{ln} commands are helpful in reducing typing
-and clutter in installation examples in this manual.
-Hereafter, the top level of @code{gcc} source tree is referred to
-as @file{gcc}, and the top level of just the @code{g77}
-source tree (prior to issuing the @code{mv} command, above)
-is referred to as @file{g77}.
-
-There are three top-level names in a @code{g77} distribution:
-
-@example
-g77/COPYING.g77
-g77/README.g77
-g77/f
-@end example
-
-All three entries should be moved (or copied) into a @code{gcc}
-source tree (typically named after its version number and
-as it appears in the FSF distributions---e.g. @file{gcc-@value{version-gcc}}).
-
-@file{g77/f} is the subdirectory containing all of the
-code, documentation, and other information that is specific
-to @code{g77}.
-The other two files exist to provide information on @code{g77}
-to someone encountering a @code{gcc} source tree with @code{g77}
-already present, who has not yet read these installation
-instructions and thus needs help understanding that the
-source tree they are looking at does not come from a single
-FSF distribution.
-They also help people encountering an unmerged @code{g77} source
-tree for the first time.
-
-@cindex modifying @code{g77}
-@cindex code, modifying
-@cindex Pentium optimizations
-@cindex optimization, for Pentium
-@emph{Note:} Please use @strong{only} @code{gcc} and @code{g77}
-source trees as distributed by the FSF.
-Use of modified versions is likely to result in problems that appear to be
-in the @code{g77} code but, in fact, are not.
-Do not use such modified versions
-unless you understand all the differences between them and the versions
-the FSF distributes---in which case you should be able to modify the
-@code{g77} (or @code{gcc}) source trees appropriately so @code{g77}
-and @code{gcc} can coexist as they do in the stock FSF distributions.
-
-@node Merging Distributions
-@subsection Merging Distributions
-@cindex merging distributions
-@cindex @code{gcc}, versions supported by @code{g77}
-@cindex versions, of @code{gcc}
-@cindex support, @code{gcc} versions
-
-After merging the @code{g77} source tree into the @code{gcc} source tree,
-you have put together a complete @code{g77} source tree.
-
-@cindex @code{gcc}, version number
-@cindex version number
-@cindex @code{g77}, version number
-@cindex GNU version numbering
-As of version 0.5.23, @code{g77} no longer modifies
-the version number of @code{gcc},
-nor does it patch @code{gcc} itself.
-
-@code{g77} still depends on being merged with an
-appropriate version of @code{gcc}.
-For version @value{version-g77} of @code{g77},
-the specific version of @code{gcc} supported is @value{version-gcc}.
-
-However, other versions of @code{gcc} might be suitable
-``hosts'' for this version of @code{g77}.
-
-GNU version numbers make it easy to figure out whether a
-particular version of a distribution is newer or older than
-some other version of that distribution.
-The format is,
-generally, @var{major}.@var{minor}.@var{patch}, with
-each field being a decimal number.
-(You can safely ignore
-leading zeros; for example, 1.5.3 is the same as 1.5.03.)
-The @var{major} field only increases with time.
-The other two fields are reset to 0 when the field to
-their left is incremented; otherwise, they, too, only
-increase with time.
-So, version 2.6.2 is newer than version 2.5.8, and
-version 3.0 is newer than both.
-(Trailing @samp{.0} fields often are omitted in
-announcements and in names for distributions and
-the directories they create.)
-
-If your version of @code{gcc} is older than the oldest version
-supported by @code{g77}
-(as casually determined by listing the contents of @file{@value{path-g77}/INSTALL/},
-which contains these installation instructions in plain-text format),
-you should obtain a newer, supported version of @code{gcc}.
-(You could instead obtain an older version of @code{g77},
-or try and get your @code{g77} to work with the old
-@code{gcc}, but neither approach is recommended, and
-you shouldn't bother reporting any bugs you find if you
-take either approach, because they're probably already
-fixed in the newer versions you're not using.)
-
-If your version of @code{gcc} is newer than the newest version
-supported by @code{g77}, it is possible that your @code{g77}
-will work with it anyway.
-If the version number for @code{gcc} differs only in the
-@var{patch} field, you might as well try that version of @code{gcc}.
-Since it has the same @var{major} and @var{minor} fields,
-the resulting combination is likely to work.
-
-So, for example, if a particular version of @code{g77} has support for
-@code{gcc} versions 2.8.0 and 2.8.1,
-it is likely that @file{gcc-2.8.2} would work well with @code{g77}.
-
-However, @file{gcc-2.9.0} would almost certainly
-not work with that version of @code{g77}
-without appropriate modifications,
-so a new version of @code{g77} would be needed.
-
-@cindex distributions, why separate
-@cindex separate distributions
-@cindex why separate distributions
-This complexity is the result of @code{gcc} and @code{g77} being
-separate distributions.
-By keeping them separate, each product is able to be independently
-improved and distributed to its user base more frequently.
-
-However, the GBE interface defined by @code{gcc} typically
-undergoes some incompatible changes at least every time the
-@var{minor} field of the version number is incremented,
-and such changes require corresponding changes to
-the @code{g77} front end (FFE).
-
-@c @pindex config-lang.in
-@c @emph{Note:} @code{g77}'s configuration file @file{@value{path-g77}/config-lang.in}
-@c sometimes ensures that the source code for the version of @code{gcc}
-@c being configured has at least one indication of being an appropriate
-@c version as required specifically by @code{g77}.
-@c This configuration-time
-@c checking should catch failures to use the proper version of @code{gcc} and,
-@c if so caught, should abort the configuration with an explanation.
-@c @emph{Please} do not try to disable this check,
-@c otherwise @code{g77} might well appear to build
-@c and install correctly, and even appear to compile correctly,
-@c but could easily produce broken code.
-
-@node Where to Install
-@subsection Where in the World Does Fortran (and GNU CC) Go?
-@cindex language f77 not recognized
-@cindex @code{gcc}, will not compile Fortran programs
-
-Before configuring, you should make sure you know
-where you want the @code{g77} and @code{gcc}
-binaries to be installed after they're built,
-because this information is given to the configuration
-tool and used during the build itself.
-
-A @code{g77} installation normally includes installation of
-a Fortran-aware version of @code{gcc}, so that the @code{gcc}
-command recognizes Fortran source files and knows how to compile
-them.
-
-For this to work, the version of @code{gcc} that you will be building
-as part of @code{g77} @strong{must} be installed as the ``active''
-version of @code{gcc} on the system.
-
-Sometimes people make the mistake of installing @code{gcc} as
-@file{/usr/local/bin/gcc},
-leaving an older, non-Fortran-aware version in @file{/usr/bin/gcc}.
-(Or, the opposite happens.)
-This can result in @code{gcc} being unable to compile Fortran
-source files,
-because when the older version of @code{gcc} is invoked,
-it complains that it does not
-recognize the language, or the file name suffix.
-
-So, determine whether @code{gcc} already is installed on your system,
-and, if so, @emph{where} it is installed, and prepare to configure the
-new version of @code{gcc} you'll be building so that it installs
-over the existing version of @code{gcc}.
-
-You might want to back up your existing copy of @file{/usr/bin/gcc}, and
-the entire @file{/usr/lib} directory, before
-you perform the actual installation (as described in this manual).
-
-Existing @code{gcc} installations typically are
-found in @file{/usr} or @file{/usr/local}.
-(This means the commands are installed in @file{/usr/bin} or
-@file{/usr/local/bin},
-the libraries in @file{/usr/lib} or @file{/usr/local/lib},
-and so on.)
-
-If you aren't certain where the currently
-installed version of @code{gcc} and its
-related programs reside, look at the output
-of this command:
-
-@example
-gcc -v -o /tmp/delete-me -xc /dev/null -xnone
-@end example
-
-All sorts of interesting information on the locations of various
-@code{gcc}-related programs and data files should be visible
-in the output of the above command.
-(The output also is likely to include a diagnostic from
-the linker, since there's no @samp{main_()} function.)
-However, you do have to sift through it yourself; @code{gcc}
-currently provides no easy way to ask it where it is installed
-and where it looks for the various programs and data files it
-calls on to do its work.
-
-Just @emph{building} @code{g77} should not overwrite any installed
-programs---but, usually, after you build @code{g77}, you will want
-to install it, so backing up anything it might overwrite is
-a good idea.
-(This is true for any package, not just @code{g77},
-though in this case it is intentional that @code{g77} overwrites
-@code{gcc} if it is already installed---it is unusual that
-the installation process for one distribution intentionally
-overwrites a program or file installed by another distribution,
-although, in this case, @code{g77} is an augmentation of the
-@code{gcc} distribution.)
-
-Another reason to back up the existing version first,
-or make sure you can restore it easily, is that it might be
-an older version on which other users have come to depend
-for certain behaviors.
-However, even the new version of @code{gcc} you install
-will offer users the ability to specify an older version of
-the actual compilation programs if desired, and these
-older versions need not include any @code{g77} components.
-@xref{Target Options,,Specifying Target Machine and Compiler Version,
-gcc,Using and Porting GNU CC}, for information on the @samp{-V}
-option of @code{gcc}.
-
-@node Configuring gcc
-@subsection Configuring GNU CC
-
-@code{g77} is configured automatically when you configure
-@code{gcc}.
-There are two parts of @code{g77} that are configured in two
-different ways---@code{g77}, which ``camps on'' to the
-@code{gcc} configuration mechanism, and @code{libg2c}, which
-uses a variation of the GNU @code{autoconf} configuration
-system.
-
-Generally, you shouldn't have to be concerned with
-either @code{g77} or @code{libg2c} configuration, unless
-you're configuring @code{g77} as a cross-compiler.
-In this case, the @code{libg2c} configuration, and possibly the
-@code{g77} and @code{gcc} configurations as well,
-might need special attention.
-(This also might be the case if you're porting @code{gcc} to
-a whole new system---even if it is just a new operating system
-on an existing, supported CPU.)
-
-To configure the system, see
-@ref{Installation,,Installing GNU CC,gcc,Using and Porting GNU CC},
-following the instructions for running @file{./configure}.
-Pay special attention to the @samp{--prefix=} option, which
-you almost certainly will need to specify.
-
-(Note that @code{gcc} installation information is provided
-as a plain-text file in @file{gcc/INSTALL}.)
-
-The information printed by the invocation of @file{./configure}
-should show that the @file{f} directory (the Fortran language)
-has been configured.
-If it does not, there is a problem.
-
-@emph{Note:} Configuring with the @samp{--srcdir} argument,
-or by starting in an empty directory
-and typing a command such as @kbd{../gcc/configure} to
-build with separate build and source directories,
-is known to work with GNU @code{make},
-but it is known to not work with other variants of @code{make}.
-Irix5.2 and SunOS4.1 versions of @code{make} definitely
-won't work outside the source directory at present.
-
-@code{g77}'s portion of the @file{configure} script
-used to issue a warning message about this
-when configuring for building binaries outside the source directory,
-but no longer does this as of version 0.5.23.
-
-Instead, @code{g77} simply rejects most common attempts
-to build it using a non-GNU @code{make} when the
-build directory is not the same as the source directory,
-issuing an explanatory diagnostic.
-
-@node Building gcc
-@subsection Building GNU CC
-@cindex building @code{gcc}
-@cindex building @code{g77}
-
-@cindex @code{LANGUAGES} macro
-Building @code{g77} requires building enough of @code{gcc} that
-these instructions assume you're going to build all of
-@code{gcc}, including @code{g++}, @code{protoize}, and so on.
-You can save a little time and disk space by changes the
-@code{LANGUAGES} macro definition in @code{gcc/Makefile.in}
-or @code{gcc/Makefile}, but if you do that, you're on your own.
-One change is almost @emph{certainly} going to cause failures:
-removing @code{c} or @code{f77} from the definition of the
-@code{LANGUAGES} macro.
-
-After configuring @code{gcc}, which configures @code{g77} and
-@code{libg2c} automatically, you're ready to start the actual
-build by invoking @code{make}.
-
-@pindex configure
-@emph{Note:} You @strong{must} have run the @file{configure}
-script in @code{gcc} before you run @code{make},
-even if you're using an already existing @code{gcc} development directory,
-because @file{./configure} does the work to recognize that you've added
-@code{g77} to the configuration.
-
-There are two general approaches to building GNU CC from
-scratch:
-
-@table @dfn
-@item bootstrap
-This method uses minimal native system facilities to
-build a barebones, unoptimized @code{gcc}, that is then
-used to compile (``bootstrap'') the entire system.
-
-@item straight
-This method assumes a more complete native system
-exists, and uses that just once to build the entire
-system.
-@end table
-
-On all systems without a recent version of @code{gcc}
-already installed, the @i{bootstrap} method must be
-used.
-In particular, @code{g77} uses extensions to the C
-language offered, apparently, only by @code{gcc}.
-
-On most systems with a recent version of @code{gcc}
-already installed, the @i{straight} method can be
-used.
-This is an advantage, because it takes less CPU time
-and disk space for the build.
-However, it does require that the system have fairly
-recent versions of many GNU programs and other
-programs, which are not enumerated here.
-
-@menu
-* Bootstrap Build:: For all systems.
-* Straight Build:: For systems with a recent version of @code{gcc}.
-@end menu
-
-@node Bootstrap Build
-@subsubsection Bootstrap Build
-@cindex bootstrap build
-@cindex build, bootstrap
-
-A complete bootstrap build is done by issuing a command
-beginning with @samp{make bootstrap @dots{}}, as
-described in @ref{Installation,,Installing GNU CC,
-gcc,Using and Porting GNU CC}.
-This is the most reliable form of build, but it does require
-the most disk space and CPU time, since the complete system
-is built twice (in Stages 2 and 3), after an initial build
-(during Stage 1) of a minimal @code{gcc} compiler using
-the native compiler and libraries.
-
-You might have to, or want to, control the way a bootstrap
-build is done by entering the @code{make} commands to build
-each stage one at a time, as described in the @code{gcc}
-manual.
-For example, to save time or disk space, you might want
-to not bother doing the Stage 3 build, in which case you
-are assuming that the @code{gcc} compiler you have built
-is basically sound (because you are giving up the opportunity
-to compare a large number of object files to ensure they're
-identical).
-
-To save some disk space during installation, after Stage 2
-is built, you can type @samp{rm -fr stage1} to remove the
-binaries built during Stage 1.
-
-Also, see @ref{Installation,,Installing GNU CC,gcc,Using and Porting GNU CC},
-for important information on building @code{gcc} that is
-not described in this @code{g77} manual.
-For example, explanations of diagnostic messages
-and whether they're expected, or indicate trouble,
-are found there.
-
-@node Straight Build
-@subsubsection Straight Build
-@cindex straight build
-@cindex build, straight
-
-If you have a recent version of @code{gcc}
-already installed on your system, and if you're
-reasonably certain it produces code that is
-object-compatible with the version of @code{gcc}
-you want to build as part of building @code{g77},
-you can save time and disk space by doing a straight
-build.
-
-To build just the compilers along with the
-necessary run-time libraries, issue the following
-command:
-
-@example
-make -k CC=gcc
-@end example
-
-If you run into problems using this method, you have
-two options:
-
-@itemize @bullet
-@item
-Abandon this approach and do a bootstrap build.
-
-@item
-Try to make this approach work by diagnosing the
-problems you're running into and retrying.
-@end itemize
-
-Especially if you do the latter, you might consider
-submitting any solutions as bug/fix reports.
-@xref{Trouble,,Known Causes of Trouble with GNU Fortran}.
-
-However, understand that many problems preventing a
-straight build from working are not @code{g77} problems,
-and, in such cases, are not likely to be addressed in
-future versions of @code{g77}.
-Consider treating them as @code{gcc} bugs instead.
-
-@node Pre-installation Checks
-@subsection Pre-installation Checks
-@cindex pre-installation checks
-@cindex installing, checking before
-
-Before installing the system, which includes installing
-@code{gcc}, you might want to do some minimum checking
-to ensure that some basic things work.
-
-Here are some commands you can try, and output typically
-printed by them when they work:
-
-@example
-sh# @kbd{cd /usr/src/gcc}
-sh# @kbd{./g77 -B./ -v}
-g77 version @value{version-g77}
-Driving: ./g77 -B./ -v -c -xf77-version /dev/null -xnone
-Reading specs from ./specs
-gcc version @value{version-gcc}
- cpp -lang-c -v -isystem ./include -undef -D__GNUC__=2 @dots{}
-GNU CPP version @value{version-gcc} (Alpha GNU/Linux with ELF)
-#include "..." search starts here:
-#include <...> search starts here:
- include
- /usr/alpha-linux/include
- /usr/lib/gcc-lib/alpha-linux/@value{version-gcc}/include
- /usr/include
-End of search list.
- ./f771 -fnull-version -quiet -dumpbase g77-version.f -version @dots{}
-GNU F77 version @value{version-gcc} (alpha-linux) compiled @dots{}
-GNU Fortran Front End version @value{version-g77}
- as -nocpp -o /tmp/cca14485.o /tmp/cca14485.s
- ld -m elf64alpha -G 8 -O1 -dynamic-linker /lib/ld-linux.so.2 @dots{}
- /tmp/cca14485
-__G77_LIBF77_VERSION__: @value{version-g77}
-@@(#)LIBF77 VERSION 19970919
-__G77_LIBI77_VERSION__: @value{version-g77}
-@@(#) LIBI77 VERSION pjw,dmg-mods 19980405
-__G77_LIBU77_VERSION__: @value{version-g77}
-@@(#) LIBU77 VERSION 19970919
-sh# @kbd{./xgcc -B./ -v -o /tmp/delete-me -xc /dev/null -xnone}
-Reading specs from ./specs
-gcc version @value{version-gcc}
- ./cpp -lang-c -v -isystem ./include -undef @dots{}
-GNU CPP version @value{version-gcc} (Alpha GNU/Linux with ELF)
-#include "..." search starts here:
-#include <...> search starts here:
- include
- /usr/alpha-linux/include
- /usr/lib/gcc-lib/alpha-linux/@value{version-gcc}/include
- /usr/include
-End of search list.
- ./cc1 /tmp/cca18063.i -quiet -dumpbase null.c -version @dots{}
-GNU C version @value{version-gcc} (alpha-linux) compiled @dots{}
- as -nocpp -o /tmp/cca180631.o /tmp/cca18063.s
- ld -m elf64alpha -G 8 -O1 -dynamic-linker /lib/ld-linux.so.2 @dots{}
-/usr/lib/crt1.o: In function `_start':
-../sysdeps/alpha/elf/start.S:77: undefined reference to `main'
-../sysdeps/alpha/elf/start.S:77: undefined reference to `main'
-sh#
-@end example
-
-(Note that long lines have been truncated, and @samp{@dots{}}
-used to indicate such truncations.)
-
-The above two commands test whether @code{g77} and @code{gcc},
-respectively, are able to compile empty (null) source files,
-whether invocation of the C preprocessor works, whether libraries
-can be linked, and so on.
-
-If the output you get from either of the above two commands
-is noticeably different, especially if it is shorter or longer
-in ways that do not look consistent with the above sample
-output, you probably should not install @code{gcc} and @code{g77}
-until you have investigated further.
-
-For example, you could try compiling actual applications and
-seeing how that works.
-(You might want to do that anyway, even if the above tests
-work.)
-
-To compile using the not-yet-installed versions of @code{gcc}
-and @code{g77}, use the following commands to invoke them.
-
-To invoke @code{g77}, type:
-
-@example
-/usr/src/gcc/g77 -B/usr/src/gcc/ @dots{}
-@end example
-
-To invoke @code{gcc}, type:
-
-@example
-/usr/src/gcc/xgcc -B/usr/src/gcc/ @dots{}
-@end example
-
-@node Installation of Binaries
-@subsection Installation of Binaries
-@cindex installation of binaries
-@cindex @code{g77}, installation of
-@cindex @code{gcc}, installation of
-
-After configuring, building, and testing @code{g77} and @code{gcc},
-when you are ready to install them on your system, type:
-
-@example
-make -k CC=gcc install
-@end example
-
-As described in @ref{Installation,,Installing GNU CC,
-gcc,Using and Porting GNU CC}, the values for
-the @code{CC} and @code{LANGUAGES} macros should
-be the same as those you supplied for the build
-itself.
-
-So, the details of the above command might vary
-if you used a bootstrap build (where you might be
-able to omit both definitions, or might have to
-supply the same definitions you used when building
-the final stage) or if you deviated from the
-instructions for a straight build.
-
-If the above command does not install @file{libg2c.a}
-as expected, try this:
-
-@example
-make -k @dots{} install install-libf77
-@end example
-
-We don't know why some non-GNU versions of @code{make} sometimes
-require this alternate command, but they do.
-(Remember to supply the appropriate definition for @code{CC}
-where you see @samp{@dots{}} in the above command.)
-
-Note that using the @samp{-k} option tells @code{make} to
-continue after some installation problems, like not having
-@code{makeinfo} installed on your system.
-It might not be necessary for your system.
-
-@emph{Note:} @code{g77} no longer installs
-files not directly part of @code{g77},
-such as @file{/usr/bin/f77}, @file{/usr/lib/libf2c.a},
-and @file{/usr/include/f2c.h}, or their
-@file{/usr/local} equivalents.
-
-@xref{Distributing Binaries}, for information on
-how to accommodate systems with no existing non-@code{g77}
-@code{f77} compiler and systems with @code{f2c} installed.
-
-@node Updating Documentation
-@subsection Updating Your Info Directory
-@cindex updating info directory
-@cindex info, updating directory
-@cindex directory, updating info
-@pindex /usr/info/dir
-@pindex g77.info
-@cindex texinfo
-@cindex documentation
-
-As part of installing @code{g77}, you should make sure users
-of @code{info} can easily access this manual on-line.
-
-@code{g77} does this automatically by
-invoking the @code{install-info} command
-when you use @samp{make install} to install @code{g77}.
-
-If that fails, or if the @code{info} directory
-it updates is not the one normally accessed by users,
-consider invoking it yourself.
-For example:
-
-@smallexample
-install-info --info-dir=/usr/info /usr/info/g77.info
-@end smallexample
-
-The above example assumes the @code{g77} documentation
-already is installed in @file{/usr/info}
-and that @file{/usr/info/dir} is the file
-you wish to update.
-Adjust the command accordingly,
-if those assumptions are wrong.
-
-@node Missing tools?
-@subsection Missing tools?
-@cindex command missing
-@cindex command not found
-@cindex file not found
-@cindex not found
-
-A build of @code{gcc} might fail due to one or more tools
-being called upon by @code{make}
-(during the build or install process),
-when those tools are not installed on your system.
-
-This situation can result from any of the following actions
-(performed by you or someone else):
-
-@itemize @bullet
-@item
-Changing the source code or documentation yourself
-(as a developer or technical writer).
-
-@item
-Applying a patch that changes the source code or documentation
-(including, sometimes, the official patches distributed by
-the FSF).
-
-@item
-Deleting the files that are created by the (missing) tools.
-
-The @samp{make maintainer-clean} command is supposed
-to delete these files, so invoking this command without
-having all the appropriate tools installed is not recommended.
-
-@item
-Creating the source directory using a method that
-does not preserve the date-time-modified information
-in the original distribution.
-
-For example, the UNIX @samp{cp -r} command copies a
-directory tree without preserving the date-time-modified
-information.
-Use @samp{cp -pr} instead.
-@end itemize
-
-The reason these activities cause @code{make} to try and
-invoke tools that it probably wouldn't when building
-from a perfectly ``clean'' source directory containing
-@code{gcc} and @code{g77} is that some files in the
-source directory (and the corresponding distribution)
-aren't really source files, but @emph{derived} files
-that are produced by running tools with the corresponding
-source files as input.
-These derived files @dfn{depend}, in @code{make} terminology,
-on the corresponding source files.
-
-@code{make} determines that a file that depends on another
-needs to be updated if the date-time-modified information for
-the source file shows that it is newer than the corresponding
-information for the derived file.
-
-If it makes that determination, @code{make} runs the appropriate
-commands (specified in the ``Makefile'') to update the
-derived file, and this process typically calls upon one or
-more installed tools to do the work.
-
-The ``safest'' approach to dealing with this situation
-is to recreate the @code{gcc} and @code{g77} source
-directories from complete @code{gcc} and @code{g77} distributions
-known to be provided by the FSF.
-
-Another fairly ``safe'' approach is to simply install
-the tools you need to complete the build process.
-This is especially appropriate if you've changed the
-source code or applied a patch to do so.
-
-However, if you're certain that the problem is limited
-entirely to incorrect date-time-modified information,
-that there are no discrepancies between the contents of
-source files and files derived from them in the source
-directory, you can often update the date-time-modified
-information for the derived files to work around the
-problem of not having the appropriate tools installed.
-
-On UNIX systems, the simplest way to update the date-time-modified
-information of a file is to use the use the @code{touch}
-command.
-
-How to use @code{touch} to update the derived files
-updated by each of the tools is described below.
-@emph{Note:} New versions of @code{g77} might change the set of
-files it generates by invoking each of these tools.
-If you cannot figure
-out for yourself how to handle such a situation, try an
-older version of @code{g77} until you find someone who can
-(or until you obtain and install the relevant tools).
-
-@menu
-* autoconf: Missing autoconf?.
-* bison: Missing bison?.
-* gperf: Missing gperf?.
-* makeinfo: Missing makeinfo?.
-@end menu
-
-@node Missing autoconf?
-@subsubsection Missing @code{autoconf}?
-@cindex @code{autoconf}
-@cindex missing @code{autoconf}
-
-If you cannot install @code{autoconf}, make sure you have started
-with a @emph{fresh} distribution of @code{gcc} and @code{g77},
-do @emph{not} do @samp{make maintainer-clean}, and, to ensure that
-@code{autoconf} is not invoked by @code{make} during the build,
-type these commands:
-
-@example
-sh# @kbd{cd @value{path-libf2c}}
-sh# @kbd{touch configure libU77/configure}
-sh# @kbd{cd ../../..}
-sh#
-@end example
-
-@node Missing bison?
-@subsubsection Missing @code{bison}?
-@cindex @code{bison}
-@cindex missing @code{bison}
-
-If you cannot install @code{bison}, make sure you have started
-with a @emph{fresh} distribution of @code{gcc}, do @emph{not}
-do @samp{make maintainer-clean}, and, to ensure that
-@code{bison} is not invoked by @code{make} during the build,
-type these commands:
-
-@example
-sh# @kbd{cd gcc}
-sh# @kbd{touch bi-parser.c bi-parser.h c-parse.c c-parse.h cexp.c}
-sh# @kbd{touch cp/parse.c cp/parse.h objc-parse.c}
-sh# @kbd{cd ..}
-sh#
-@end example
-
-@node Missing gperf?
-@subsubsection Missing @code{gperf}?
-@cindex @code{gperf}
-@cindex missing @code{gperf}
-
-If you cannot install @code{gperf}, make sure you have started
-with a @emph{fresh} distribution of @code{gcc}, do @emph{not}
-do @samp{make maintainer-clean}, and, to ensure that
-@code{gperf} is not invoked by @code{make} during the build,
-type these commands:
-
-@example
-sh# @kbd{cd gcc}
-sh# @kbd{touch c-gperf.h}
-sh# @kbd{cd ..}
-sh#
-@end example
-
-@node Missing makeinfo?
-@subsubsection Missing @code{makeinfo}?
-@cindex @code{makeinfo}
-@cindex missing @code{makeinfo}
-@cindex @code{libg2c.a} not found
-@cindex missing @code{libg2c.a}
-
-If @code{makeinfo} is needed but unavailable
-when installing (via @code{make install}),
-some files, like @file{libg2c.a},
-might not be installed,
-because once @code{make} determines that it cannot
-invoke @code{makeinfo}, it cancels any further processing.
-
-If you cannot install @code{makeinfo}, an easy work-around is to
-specify @samp{MAKEINFO=true} on the @code{make} command line,
-or to specify the @samp{-k} option (@kbd{make -k install}).
-
-Another approach is to force the relevant files to be up-to-date
-by typing these commands and then re-trying the installation step:
-
-@example
-sh# @kbd{cd gcc}
-sh# @kbd{touch f/g77.info f/BUGS f/INSTALL f/NEWS}
-sh# @kbd{cd ..}
-sh#
-@end example
-
-@end ifclear
-
-@node Distributing Binaries
-@section Distributing Binaries
-@cindex binaries, distributing
-@cindex code, distributing
-
-@ifset OMIT-FSF-G77
-For users of the @value{which-g77} version of @code{g77},
-this information is superceded by the
-@value{which-gcc} installation instructions.
-@end ifset
-
-@ifclear OMIT-FSF-G77
-If you are building @code{g77} for distribution to others in binary form,
-first make sure you are aware of your legal responsibilities (read
-the file @file{gcc/COPYING} thoroughly).
-
-Then, consider your target audience and decide where @code{g77} should
-be installed.
-
-For systems like GNU/Linux that have no native Fortran compiler (or
-where @code{g77} could be considered the native compiler for Fortran and
-@code{gcc} for C, etc.), you should definitely configure
-@code{g77} for installation
-in @file{/usr/bin} instead of @file{/usr/local/bin}.
-Specify the
-@samp{--prefix=/usr} option when running @file{./configure}.
-
-You might also want to set up the distribution
-so the @file{f77} command is a link to @file{g77},
-although a script that accepts ``classic'' UNIX @code{f77}
-options and translates the command-line to the
-appropriate @code{g77} command line would be more appropriate.
-If you do this, @emph{please} also provide a ``man page'' in
-@file{man/man1/f77.1} describing the command.
-(A link to @file{man/man1/g77.1} is appropriate
-if @file{bin/f77} is a link to @file{bin/g77}.)
-
-For a system that might already have @code{f2c} installed,
-consider whether inter-operation with @code{g77} will be
-important to users of @code{f2c} on that system.
-If you want to improve the likelihood
-that users will be able to use both @code{f2c} and @code{g77}
-to compile code for a single program
-without encountering link-time or run-time incompatibilities,
-make sure that,
-whenever they intend to combine @code{f2c}-produced code
-with @code{g77}-produced code in an executable, they:
-
-@itemize @bullet
-@item
-Use the @file{lib/gcc-lib/@dots{}/include/g2c.h} file
-generated by the @code{g77} build
-in place of the @file{f2c.h} file
-that normally comes with @code{f2c}
-(or versions of @code{g77} prior to 0.5.23)
-when compiling @emph{all} of the @code{f2c}-produced C code
-
-@item
-Link to the @code{lib/gcc-lib/@dots{}/libg2c.a} library
-built by the @code{g77} build
-instead of the @file{libf2c.a} library
-that normally comes with @code{f2c}
-(or versions of @code{g77} prior to 0.5.23)
-@end itemize
-
-How you choose to effect the above depends on whether
-the existing installation of @code{f2c} must be
-maintained.
-
-In any case, it is important to try and ensure that
-the installation keeps working properly even after
-subsequent re-installation of @code{f2c},
-which probably involves overwriting
-@file{/usr/local/lib/libf2c.a} and
-@file{/usr/local/include/f2c.h},
-or similar.
-
-At least, copying @file{libg2c.a} and @file{g2c.h} into
-the appropriate ``public'' directories
-allows users to more easily select the version of
-@code{libf2c} they wish to use for a particular
-build.
-The names are changed by @code{g77} to make this
-coexistence easier to maintain;
-even if @code{f2c} is installed later,
-the @code{g77} files normally installed
-by its installation process aren't disturbed.
-Use of symbolic links from one set of files to
-another might result in problems after a subsequent
-reinstallation of either @code{f2c} or @code{g77},
-so be sure to alert users of your distribution
-accordingly.
-
-(Make sure you clearly document, in the description of
-your distribution, how installation of your distribution will
-affect existing installations of @code{gcc}, @code{f2c},
-@code{f77}, @file{libf2c.a}, and so on.
-Similarly, you should clearly document any requirements
-you assume will be met by users of your distribution.)
-
-For other systems with native @code{f77} (and @code{cc}) compilers,
-configure @code{g77} as you (or most of your audience) would
-configure @code{gcc} for their installations.
-Typically this is for installation in @file{/usr/local},
-and would not include a new version of @file{/usr/bin/f77}
-or @file{/usr/local/bin/f77},
-so users could still use the native @code{f77}.
-
-In any case, for @code{g77} to work properly, you @strong{must} ensure
-that the binaries you distribute include:
-
-@table @file
-@item bin/g77
-This is the command most users use to compile Fortran.
-
-@item bin/gcc
-This is the command some users use to compile Fortran,
-typically when compiling programs written in other languages
-at the same time.
-The @file{bin/gcc} executable file must have been built
-from a @code{gcc} source tree into which a @code{g77} source
-tree was merged and configured, or it will not know how
-to compile Fortran programs.
-
-@item info/g77.info*
-This is the documentation for @code{g77}.
-If it is not included, users will have trouble understanding
-diagnostics messages and other such things, and will send
-you a lot of email asking questions.
-
-Please edit this documentation (by editing @file{@value{path-g77}/*.texi}
-and doing @samp{make doc} from the @file{/usr/src/gcc} directory)
-to reflect any changes you've made to @code{g77}, or at
-least to encourage users of your binary distribution to
-report bugs to you first.
-
-Also, whether you distribute binaries or install @code{g77}
-on your own system, it might be helpful for everyone to
-add a line listing this manual by name and topic to the
-top-level @code{info} node in @file{/usr/info/dir}.
-That way, users can find @code{g77} documentation more
-easily.
-@xref{Updating Documentation,,Updating Your Info Directory}.
-
-@item man/man1/g77.1
-This is the short man page for @code{g77}.
-It is not always kept up-to-date,
-but you might as well include it
-for people who really like ``man'' pages.
-
-@cindex gcc-lib directory
-@cindex directories, gcc-lib
-@item lib/gcc-lib
-This is the directory containing the ``private'' files
-installed by and for @code{gcc}, @code{g77}, @code{g++},
-and other GNU compilers.
-
-@item lib/gcc-lib/@dots{}/f771
-This is the actual Fortran compiler.
-
-@item lib/gcc-lib/@dots{}/libg2c.a
-This is the run-time library for @code{g77}-compiled programs.
-@end table
-
-Whether you want to include the slightly updated (and possibly
-improved) versions of @file{cc1}, @file{cc1plus}, and whatever other
-binaries get rebuilt with the changes the GNU Fortran distribution
-makes to the GNU back end, is up to you.
-These changes are highly unlikely to break any compilers,
-because they involve doing things like adding to the
-list of acceptable compiler options
-(so, for example, @file{cc1plus} accepts, and ignores,
-options that only @file{f771} actually processes).
-
-Please assure users that unless
-they have a specific need for their existing,
-older versions of @file{gcc} command,
-they are unlikely to experience any problems by overwriting
-it with your version---though they could certainly protect
-themselves by making backup copies first!
-
-Otherwise, users might try and install your binaries
-in a ``safe'' place, find they cannot compile Fortran
-programs with your distribution (because, perhaps, they're
-invoking their old version of the @file{gcc} command,
-which does not recognize Fortran programs), and assume
-that your binaries (or, more generally, GNU Fortran
-distributions in general) are broken, at least for their
-system.
-
-Finally, @strong{please} ask for bug reports to go to you first, at least
-until you're sure your distribution is widely used and has been
-well tested.
-This especially goes for those of you making any
-changes to the @code{g77} sources to port @code{g77}, e.g. to OS/2.
-@email{fortran@@gnu.org} has received a fair number of bug
-reports that turned out to be problems with other peoples' ports
-and distributions, about which nothing could be done for the
-user.
-Once you are quite certain a bug report does not involve
-your efforts, you can forward it to us.
-
-@end ifclear
diff --git a/contrib/gcc/f/glimits.j b/contrib/gcc/f/glimits.j
deleted file mode 100644
index 0262258423ac..000000000000
--- a/contrib/gcc/f/glimits.j
+++ /dev/null
@@ -1,28 +0,0 @@
-/* glimits.j -- Wrapper for GCC's glimits.h
- Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley.
-
-This file is part of GNU Fortran.
-
-GNU Fortran 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.
-
-GNU Fortran is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA. */
-
-#ifndef MAKING_DEPENDENCIES
-#if !USE_HOST_LIMITS
-#include "glimits.h"
-#else
-#include <limits.h>
-#endif
-#endif
diff --git a/contrib/gcc/f/hconfig.j b/contrib/gcc/f/hconfig.j
deleted file mode 100644
index c73930cf9e83..000000000000
--- a/contrib/gcc/f/hconfig.j
+++ /dev/null
@@ -1,27 +0,0 @@
-/* hconfig.j -- Wrapper for GCC's hconfig.h
- Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley.
-
-This file is part of GNU Fortran.
-
-GNU Fortran 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.
-
-GNU Fortran is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA. */
-
-#ifndef MAKING_DEPENDENCIES
-#ifndef _J_f_hconfig
-#define _J_f_hconfig
-#include "hconfig.h"
-#endif
-#endif
diff --git a/contrib/gcc/f/input.j b/contrib/gcc/f/input.j
deleted file mode 100644
index cc9ff24b0730..000000000000
--- a/contrib/gcc/f/input.j
+++ /dev/null
@@ -1,27 +0,0 @@
-/* input.j -- Wrapper for GCC's input.h
- Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley.
-
-This file is part of GNU Fortran.
-
-GNU Fortran 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.
-
-GNU Fortran is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA. */
-
-#ifndef MAKING_DEPENDENCIES
-#ifndef _J_f_input
-#define _J_f_input
-#include "input.h"
-#endif
-#endif
diff --git a/contrib/gcc/f/output.j b/contrib/gcc/f/output.j
deleted file mode 100644
index 8816b75e6667..000000000000
--- a/contrib/gcc/f/output.j
+++ /dev/null
@@ -1,27 +0,0 @@
-/* output.j -- Wrapper for GCC's output.h
- Copyright (C) 1998 Free Software Foundation, Inc.
- Contributed by James Craig Burley.
-
-This file is part of GNU Fortran.
-
-GNU Fortran 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.
-
-GNU Fortran is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA. */
-
-#ifndef MAKING_DEPENDENCIES
-#ifndef _J_f_output
-#define _J_f_output
-#include "output.h"
-#endif
-#endif
diff --git a/contrib/gcc/f/proj.c b/contrib/gcc/f/proj.c
deleted file mode 100644
index 237ebe0ddf41..000000000000
--- a/contrib/gcc/f/proj.c
+++ /dev/null
@@ -1,68 +0,0 @@
-/* proj.c file for GNU Fortran
- Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley.
-
-This file is part of GNU Fortran.
-
-GNU Fortran 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.
-
-GNU Fortran is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA. */
-
-#include "proj.h"
-#include "glimits.j"
-
-#ifndef HAVE_STRTOUL
-unsigned long int
-strtoul (const char *nptr, char **endptr, int base)
-{
- unsigned long int number = 0;
- unsigned long int old_number = 0;
-
- assert (base == 10);
- assert (endptr == NULL);
-
- while (ISDIGIT (*nptr))
- {
- number = old_number * 10 + (*(nptr++) - '0');
- if ((number <= old_number) && (old_number != 0))
- return ULONG_MAX;
- old_number = number;
- }
-
- return number;
-}
-#endif
-
-#ifndef HAVE_BSEARCH
-void *
-bsearch (const void *key, const void *base, size_t nmemb, size_t size,
- int (*compar) (const void *, const void *))
-{
- size_t i;
- int cmp;
-
- /* We do a dumb incremental search, not a binary search, for now. */
-
- for (i = 0; i < nmemb; ++i)
- {
- if ((cmp = (*compar) (key, base)) == 0)
- return base;
- if (cmp < 0)
- break;
- base += size;
- }
-
- return NULL;
-}
-#endif
diff --git a/contrib/gcc/f/rtl.j b/contrib/gcc/f/rtl.j
deleted file mode 100644
index ab78e3a7736d..000000000000
--- a/contrib/gcc/f/rtl.j
+++ /dev/null
@@ -1,28 +0,0 @@
-/* rtl.j -- Wrapper for GCC's rtl.h
- Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley.
-
-This file is part of GNU Fortran.
-
-GNU Fortran 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.
-
-GNU Fortran is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA. */
-
-#ifndef MAKING_DEPENDENCIES
-#ifndef _J_f_rtl
-#define _J_f_rtl
-#include "config.j"
-#include "rtl.h"
-#endif
-#endif
diff --git a/contrib/gcc/f/system.j b/contrib/gcc/f/system.j
deleted file mode 100644
index 38547c830086..000000000000
--- a/contrib/gcc/f/system.j
+++ /dev/null
@@ -1,27 +0,0 @@
-/* system.j -- Wrapper for GCC's system.h
- Copyright (C) 1998 Free Software Foundation, Inc.
- Contributed by James Craig Burley.
-
-This file is part of GNU Fortran.
-
-GNU Fortran 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.
-
-GNU Fortran is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA. */
-
-#ifndef MAKING_DEPENDENCIES
-#ifndef _J_f_system
-#define _J_f_system
-#include "system.h"
-#endif
-#endif
diff --git a/contrib/gcc/f/tconfig.j b/contrib/gcc/f/tconfig.j
deleted file mode 100644
index 9c4c3ecf360c..000000000000
--- a/contrib/gcc/f/tconfig.j
+++ /dev/null
@@ -1,27 +0,0 @@
-/* tconfig.j -- Wrapper for GCC's tconfig.h
- Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley.
-
-This file is part of GNU Fortran.
-
-GNU Fortran 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.
-
-GNU Fortran is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA. */
-
-#ifndef MAKING_DEPENDENCIES
-#ifndef _J_f_tconfig
-#define _J_f_tconfig
-#include "tconfig.h"
-#endif
-#endif
diff --git a/contrib/gcc/f/tm.j b/contrib/gcc/f/tm.j
deleted file mode 100644
index e0d759426396..000000000000
--- a/contrib/gcc/f/tm.j
+++ /dev/null
@@ -1,27 +0,0 @@
-/* tm.j -- Wrapper for GCC's tm.h
- Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley.
-
-This file is part of GNU Fortran.
-
-GNU Fortran 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.
-
-GNU Fortran is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA. */
-
-#ifndef MAKING_DEPENDENCIES
-#ifndef _J_f_tm
-#define _J_f_tm
-#include "tm.h"
-#endif
-#endif
diff --git a/contrib/gcc/f/toplev.j b/contrib/gcc/f/toplev.j
deleted file mode 100644
index 4b8b7970cd05..000000000000
--- a/contrib/gcc/f/toplev.j
+++ /dev/null
@@ -1,27 +0,0 @@
-/* toplev.j -- Wrapper for GCC's toplev.h
- Copyright (C) 1998 Free Software Foundation, Inc.
- Contributed by James Craig Burley.
-
-This file is part of GNU Fortran.
-
-GNU Fortran 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.
-
-GNU Fortran is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA. */
-
-#ifndef MAKING_DEPENDENCIES
-#ifndef _J_f_toplev
-#define _J_f_toplev
-#include "toplev.h"
-#endif
-#endif
diff --git a/contrib/gcc/f/tree.j b/contrib/gcc/f/tree.j
deleted file mode 100644
index b0bf98a73fdd..000000000000
--- a/contrib/gcc/f/tree.j
+++ /dev/null
@@ -1,28 +0,0 @@
-/* tree.j -- Wrapper for GCC's tree.h
- Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley.
-
-This file is part of GNU Fortran.
-
-GNU Fortran 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.
-
-GNU Fortran is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA. */
-
-#ifndef MAKING_DEPENDENCIES
-#ifndef _J_f_tree
-#define _J_f_tree
-#include "config.j"
-#include "tree.h"
-#endif
-#endif
diff --git a/contrib/gcc/fixcpp b/contrib/gcc/fixcpp
deleted file mode 100755
index 044353f3a43f..000000000000
--- a/contrib/gcc/fixcpp
+++ /dev/null
@@ -1,109 +0,0 @@
-#!/bin/sh
-#
-# NAME:
-# fixcpp - fix CPP errors
-#
-# SYNOPSIS:
-# fixcpp [-c][-p patch_file][-b bak_dir][-n new_dir] files(s)
-#
-# DESCRIPTION:
-# For each named file, use sed(1) to fixup any descriptive
-# text after #else or #endif or that is not properly
-# commented as this causes ANSI compilers to generate
-# unnecessary warnings.
-#
-# Naturally this script is not guaranteed to be bullet
-# proof, use of -n or -b is advisable!
-#
-# -c causes fixcpp to make sure that only files that
-# needed changing are affected by returning the original
-# file to its original location if no changes were needed.
-#
-# -p causes fixcpp to append to a patch file the context
-# diffs of the changes wrought.
-#
-# SEE ALSO:
-# sed(1)
-#
-# AMENDED:
-# 90/08/08 22:46:32 (sjg)
-#
-# RELEASED:
-# 90/08/08 22:46:34 v1.4
-#
-# SCCSID:
-# @(#)fixcpp.sh 1.4 90/08/08 22:46:32 (sjg)
-#
-# @(#)Copyright (c) 1990 Simon J. Gerraty
-#
-# This is free software. It comes with NO WARRANTY.
-# Everyone is granted permission to copy, modify and
-# redistribute this source code provided that all
-# recipients are given similar rights, and that the above
-# copyright notice and this notice are preserved in all
-# copies.
-
-TMPF=/tmp/fixcpp.$$
-NEWDIR=
-BAKDIR=
-PATCHF=
-CHECK=
-
-set -- `getopt "cp:b:n:" $*`
-if [ $? != 0 ]; then
- echo "$0 [-c][-p patch_file][-b bakup_dir][-n new_dir] file [file ...]" >&2
- exit 1
-fi
-for i in $*
-do
- case $i in
- -c) CHECK=yes; shift;;
- -p) PATCHF=$2; shift 2;;
- -b) BAKDIR=$2; shift 2;;
- -n) NEWDIR=$2; shift 2;;
- --) shift; break;;
- esac
-done
-NEWDIR=${NEWDIR:-.}
-if [ $BAKDIR ]; then
- if [ ! -d $BAKDIR ]; then
- echo "$0: no such directory -- $BAKDIR" >&2
- exit 1
- fi
-fi
-
-
-
-for i in $*
-do
- if [ $BAKDIR ]; then
- mv $i $BAKDIR
- infile=$BAKDIR/$i
- else
- if [ "$NEWDIR" = "." ]; then
- mv $i ${TMPF}
- infile=${TMPF}
- else
- infile=$i
- fi
- fi
- sed -e 's;^#\([ ]*e[nl][^ ]*[ ][ ]*\)\([^/ ][^\*].*\);#\1/* \2 */;' -e 's;^#\([ ]*e[nl][^ ]*[ ][ ]*\)\([^/ ]\)$;#\1/* \2 */;' $infile >${NEWDIR}/$i
- if [ "${CHECK}" = "yes" -o ${PATCHF} ]; then
- if cmp -s $infile ${NEWDIR}/$i ; then
- if [ "${CHECK}" = "yes" ]; then
- if [ $BAKDIR ]; then
- mv $infile ${NEWDIR}/$i
- else
- rm ${NEWDIR}/$i
- fi
- fi
- else
- if [ $PATCHF ]; then
- diff -c $infile ${NEWDIR}/$i >> ${PATCHF}
- fi
- fi
- fi
-
-done
-
-rm -f ${TMPF}
diff --git a/contrib/gcc/fixinc-nt.sed b/contrib/gcc/fixinc-nt.sed
deleted file mode 100644
index a8119b93030d..000000000000
--- a/contrib/gcc/fixinc-nt.sed
+++ /dev/null
@@ -1,5 +0,0 @@
-s/!__STDC__/!defined (__STRICT_ANSI__)/g
-s/getcwd(char \*, int)/getcwd(char *, size_t)/
-s/Format\[\]/Format\[1\]/
-s/^#if !defined (__cplusplus)/#if 0/
-s/^#define DECLSPEC_IMPORT __declspec(dllimport)/#define DECLSPEC_IMPORT/
diff --git a/contrib/gcc/fixincludes b/contrib/gcc/fixincludes
deleted file mode 100755
index e5cc1c373b69..000000000000
--- a/contrib/gcc/fixincludes
+++ /dev/null
@@ -1,3265 +0,0 @@
-#! /bin/sh
-# Install modified versions of certain ANSI-incompatible system header files
-# which are fixed to work correctly with ANSI C
-# and placed in a directory that GNU C will search.
-
-# See README-fixinc for more information.
-
-# Directory containing the original header files.
-# (This was named INCLUDES, but that conflicts with a name in Makefile.in.)
-if [ "x$1" = "x" ]
-then echo fixincludes: no output directory specified
-exit 1
-fi
-
-LIB=${1}
-shift
-
-# Make sure it exists.
-if [ ! -d $LIB ]; then
- mkdir $LIB || {
- echo fixincludes: output dir '`'$LIB"' cannot be created"
- exit 1
- }
-else
- ( \cd $LIB && touch DONE && rm DONE ) || {
- echo fixincludes: output dir '`'$LIB"' is an invalid directory"
- exit 1
- }
-fi
-
-# Define what target system we're fixing.
-#
-if test -r ./Makefile; then
- target_canonical="`sed -n -e 's,^target[ ]*=[ ]*\(.*\)$,\1,p' < Makefile`"
-fi
-
-# If not from the Makefile, then try config.guess
-#
-if test -z "${target_canonical}" ; then
- if test -x ./config.guess ; then
- target_canonical="`config.guess`" ; fi
- test -z "${target_canonical}" && target_canonical=unknown
-fi
-export target_canonical
-
-# # # # # # # # # # # # # # # # # # # # #
-#
-# Define PWDCMD as a command to use to get the working dir
-# in the form that we want.
-PWDCMD=pwd
-
-case "`$PWDCMD`" in
-//*)
- # On an Apollo, discard everything before `/usr'.
- PWDCMD="eval pwd | sed -e 's,.*/usr/,/usr/,'"
- ;;
-esac
-
-# Original directory.
-ORIGDIR=`${PWDCMD}`
-
-# Make LIB absolute only if needed to avoid problems with the amd.
-case $LIB in
-/*)
- ;;
-*)
- cd $LIB; LIB=`${PWDCMD}`
- ;;
-esac
-
-echo Fixing headers into ${LIB} for ${target_canonical} target
-
-# Determine whether this system has symbolic links.
-if ln -s X $LIB/ShouldNotExist 2>/dev/null; then
- rm -f $LIB/ShouldNotExist
- LINKS=true
-elif ln -s X /tmp/ShouldNotExist 2>/dev/null; then
- rm -f /tmp/ShouldNotExist
- LINKS=true
-else
- LINKS=false
-fi
-
-# # # # # # # # # # # # # # # # # # # # #
-#
-# Search each input directory for broken header files.
-# This loop ends near the end of the file.
-#
-if test $# -eq 0
-then
- INPUTLIST="/usr/include"
-else
- INPUTLIST="$@"
-fi
-
-for INPUT in ${INPUTLIST} ; do
-
-cd ${ORIGDIR}
-
-cd ${INPUT} || continue
-INPUT=`${PWDCMD}`
-
-#
-# # # # # # # # # # # # # # # # # # # # #
-#
-echo Finding directories and links to directories
-
-# Find all directories and all symlinks that point to directories.
-# Put the list in $files.
-# Each time we find a symlink, add it to newdirs
-# so that we do another find within the dir the link points to.
-# Note that $files may have duplicates in it;
-# later parts of this file are supposed to ignore them.
-dirs="."
-levels=2
-while [ -n "$dirs" ] && [ $levels -gt 0 ]
-do
- levels=`expr $levels - 1`
- newdirs=
- for d in $dirs
- do
- echo " Searching $INPUT/$d"
-
- # Find all directories under $d, relative to $d, excluding $d itself.
- # (The /. is needed after $d in case $d is a symlink.)
- files="$files `find $d/. -type d -print | \
- sed -e '/\/\.$/d' -e 's@/./@/@g'`"
- # Find all links to directories.
- # Using `-exec test -d' in find fails on some systems,
- # and trying to run test via sh fails on others,
- # so this is the simplest alternative left.
- # First find all the links, then test each one.
- theselinks=
- $LINKS && \
- theselinks=`find $d/. -type l -print | sed -e 's@/./@/@g'`
- for d1 in $theselinks --dummy--
- do
- # If the link points to a directory,
- # add that dir to $newdirs
- if [ -d $d1 ]
- then
- files="$files $d1"
- if [ "`ls -ld $d1 | sed -n 's/.*-> //p'`" != "." ]
- then
- newdirs="$newdirs $d1"
- fi
- fi
- done
- done
-
- dirs="$newdirs"
-done
-
-dirs=
-echo "All directories (including links to directories):"
-echo $files
-
-for file in $files; do
- rm -rf $LIB/$file
- if [ ! -d $LIB/$file ]
- then mkdir $LIB/$file
- fi
-done
-mkdir $LIB/root
-
-# treetops gets an alternating list
-# of old directories to copy
-# and the new directories to copy to.
-treetops="${INPUT} ${LIB}"
-
-if $LINKS; then
- echo 'Making symbolic directory links'
- for file in $files; do
- dest=`ls -ld $file | sed -n 's/.*-> //p'`
- if [ "$dest" ]; then
- cwd=`${PWDCMD}`
- # In case $dest is relative, get to $file's dir first.
- cd ${INPUT}
- cd `echo ./$file | sed -n 's&[^/]*$&&p'`
- # Check that the target directory exists.
- # Redirections changed to avoid bug in sh on Ultrix.
- (cd $dest) > /dev/null 2>&1
- if [ $? = 0 ]; then
- cd $dest
- # X gets the dir that the link actually leads to.
- x=`${PWDCMD}`
- # Canonicalize ${INPUT} now to minimize the time an
- # automounter has to change the result of ${PWDCMD}.
- cinput=`cd ${INPUT}; ${PWDCMD}`
- # If a link points to ., make a similar link to .
- if [ $x = ${cinput} ]; then
- echo $file '->' . ': Making link'
- rm -fr ${LIB}/$file > /dev/null 2>&1
- ln -s . ${LIB}/$file > /dev/null 2>&1
- # If link leads back into ${INPUT},
- # make a similar link here.
- elif expr $x : "${cinput}/.*" > /dev/null; then
- # Y gets the actual target dir name, relative to ${INPUT}.
- y=`echo $x | sed -n "s&${cinput}/&&p"`
- # DOTS is the relative path from ${LIB}/$file's dir back to ${LIB}.
- dots=`echo "$file" |
- sed -e 's@^./@@' -e 's@/./@/@g' -e 's@[^/][^/]*@..@g' -e 's@..$@@'`
- echo $file '->' $dots$y ': Making link'
- rm -fr ${LIB}/$file > /dev/null 2>&1
- ln -s $dots$y ${LIB}/$file > /dev/null 2>&1
- else
- # If the link is to a dir $target outside ${INPUT},
- # repoint the link at ${INPUT}/root$target
- # and process $target into ${INPUT}/root$target
- # treat this directory as if it actually contained the files.
- echo $file '->' root$x ': Making link'
- if [ -d $LIB/root$x ]
- then true
- else
- dirname=root$x/
- dirmade=.
- cd $LIB
- while [ x$dirname != x ]; do
- component=`echo $dirname | sed -e 's|/.*$||'`
- mkdir $component >/dev/null 2>&1
- cd $component
- dirmade=$dirmade/$component
- dirname=`echo $dirname | sed -e 's|[^/]*/||'`
- done
- fi
- # Duplicate directory structure created in ${LIB}/$file in new
- # root area.
- for file2 in $files; do
- case $file2 in
- $file/*)
- dupdir=${LIB}/root$x/`echo $file2 | sed -n "s|^${file}/||p"`
- echo "Duplicating ${file}'s ${dupdir}"
- if [ -d ${dupdir} ]
- then true
- else
- mkdir ${dupdir}
- fi
- ;;
- *)
- ;;
- esac
- done
- # Get the path from ${LIB} to $file, accounting for symlinks.
- parent=`echo "$file" | sed -e 's@/[^/]*$@@'`
- libabs=`cd ${LIB}; ${PWDCMD}`
- file2=`cd ${LIB}; cd $parent; ${PWDCMD} | sed -e "s@^${libabs}@@"`
- # DOTS is the relative path from ${LIB}/$file's dir back to ${LIB}.
- dots=`echo "$file2" | sed -e 's@/[^/]*@../@g'`
- rm -fr ${LIB}/$file > /dev/null 2>&1
- ln -s ${dots}root$x ${LIB}/$file > /dev/null 2>&1
- treetops="$treetops $x ${LIB}/root$x"
- fi
- fi
- cd $cwd
- fi
- done
-fi
-
-required=
-set x $treetops
-shift
-while [ $# != 0 ]; do
- # $1 is an old directory to copy, and $2 is the new directory to copy to.
- cd ${INPUT}
- cd $1
-# The same dir can appear more than once in treetops.
-# There's no need to scan it more than once.
- if [ -f $2/DONE ]
- then
- files=
- else
- touch $2/DONE
- echo Fixing directory $1 into $2
-# Check .h files which are symlinks as well as those which are files.
-# A link to a header file will not be processed by anything but this.
- if $LINKS; then
- files=`find . -name '*.h' \( -type f -o -type l \) -print`
- else
- files=`find . -name '*.h' -type f -print`
- fi
- echo Checking header files
- fi
-# Note that BSD43_* are used on recent MIPS systems.
- for file in $files; do
-# This call to egrep is essential, since checking a file with egrep
-# is much faster than actually trying to fix it.
-# It is also essential that most files *not* match!
-# Thus, matching every #endif is unacceptable.
-# But the argument to egrep must be kept small, or many versions of egrep
-# won't be able to handle it.
-#
-# We use the pattern [!-.0-z{|}~] instead of [^/ ] to match a noncomment
-# following #else or #endif because some buggy egreps think [^/] matches
-# newline, and they thus think `#else ' matches `#e[ndiflse]*[ ]+[^/ ]'.
-# [!-.0-~] does not work properly on AIX 4.1.
-#
-# We use the pattern [^a-zA-Z0-9_][_a-ce-km-z][a-z0-9] to match an identifier
-# following #if or #elif that is not surrounded by __. The `a-ce-km-z'
-# in this pattern lacks `d' and `l'; this means we don't worry about
-# identifiers starting with `d' or `l'. This is OK, since none of the
-# identifiers below start with `d' or `l'. It also greatly improves
-# performance, since many files contain lines of the form `#if ... defined ...'
-# or `#if lint'.
- if egrep '//|[ _]_IO|CTRL|^#define.NULL|^#e[nl][ds][ief]*[ ]+[!-.0-z\{\|\}\~]|^#[el]*if.*[^a-zA-Z0-9_][_a-ce-km-zA-Z][a-zA-Z0-9]' $file >/dev/null; then
- if [ -r $file ]; then
- cp $file $2/$file >/dev/null 2>&1 \
- || echo "Can't copy $file"
- chmod +w $2/$file
- chmod a+r $2/$file
- # The fixinc_eol stuff is to work around a bug in the sed
- # program on HP/UX 10.20.
- # Here is how the sed commands in braces work.
- # (It doesn't work to put the comments inside the sed commands.)
- # Surround each word with spaces, to simplify matching below.
- # ANSIfy each pre-ANSI machine-dependent symbol
- # by surrounding it with __ __.
- # Remove the spaces that we inserted around each word.
- sed -e '
- :loop
- /\\$/ N
- s/\\$/\\*fixinc_eol*/
- /\\$/ b loop
- s/\\\*fixinc_eol\*/\\/g
- s%^\([ ]*#[ ]*else\)[ ]*/[^*].*%\1%
- s%^\([ ]*#[ ]*else\)[ ]*[^/ ].*%\1%
- s%^\([ ]*#[ ]*endif\)[ ]*/[^*].*%\1%
- s%^\([ ]*#[ ]*endif\)[ ]*\*[^/].*%\1%
- s%^\([ ]*#[ ]*endif\)[ ]*[^/* ].*%\1%
- /\/\/[^*]/ s|//\(.*\)$|/*\1*/|
- /^[ ]*\/\/[ ]*/s///
- /[ ]_IO[A-Z]*[ ]*(/ s/\(_IO[A-Z]*[ ]*(\)\(.\),/\1'\''\2'\'',/
- /[ ]BSD43__IO[A-Z]*[ ]*(/ s/(\(.\),/('\''\1'\'',/
- /#[ ]*define[ ]*[ ]_IO/ s/'\''\([cgxtf]\)'\''/\1/g
- /#[ ]*define[ ]*[ ]BSD43__IO/ s/'\''\([cgx]\)'\''/\1/g
- /#[ ]*define[ ]*[ ]DESIOC/ s/'\''\([cdgx]\)'\''/\1/g
- /[^A-Z0-9_]CTRL[ ]*(/ s/\([^'\'']\))/'\''\1'\'')/
- /[^A-Z0-9]_CTRL[ ]*(/ s/\([^'\'']\))/'\''\1'\'')/
- /#[ ]*define[ ]*[ ]CTRL/ s/'\''\([cgx]\)'\''/\1/g
- /#[ ]*define[ ]*[ ]_CTRL/ s/'\''\([cgx]\)'\''/\1/g
- /#[ ]*define.BSD43_CTRL/ s/'\''\([cgx]\)'\''/\1/g
- /#[ ]*define[ ]*[ ][_]*ISCTRL/ s/'\''\([cgx]\)'\''/\1/g
- /#[ ]*[el]*if/{
- s/[a-zA-Z0-9_][a-zA-Z0-9_]*/ & /g
-
- s/ bsd4\([0-9]\) / __bsd4\1__ /g
- s/ _*host_mips / __host_mips__ /g
- s/ _*i386 / __i386__ /g
- s/ M32 / __M32__ /g
- s/ is68k / __is68k__ /g
- s/ m68k / __m68k__ /g
- s/ mc680\([0-9]\)0 / __mc680\10__ /g
- s/ m88k / __m88k__ /g
- s/ _*mips / __mips__ /g
- s/ news\([0-9]*\) / __news\1__ /g
- s/ ns32000 / __ns32000__ /g
- s/ pdp11 / __pdp11__ /g
- s/ pyr / __pyr__ /g
- s/ sel / __sel__ /g
- s/ sony_news / __sony_news__ /g
- s/ sparc / __sparc__ /g
- s/ sun\([a-z0-9]*\) / __sun\1__ /g
- s/ tahoe / __tahoe__ /g
- s/ tower\([_0-9]*\) / __tower\1__ /g
- s/ u370 / __u370__ /g
- s/ u3b\([0-9]*\) / __u3b\1__ /g
- s/ unix / __unix__ /g
- s/ vax / __vax__ /g
- s/ _*MIPSE\([LB]\) / __MIPSE\1__ /g
- s/ _*\([Rr][34]\)000 / __\1000__ /g
- s/ _*SYSTYPE_\([A-Z0-9]*\) / __SYSTYPE_\1__ /g
-
- s/ \([a-zA-Z0-9_][a-zA-Z0-9_]*\) /\1/g
- }
- /^#define.NULL[ ]/ i\
- #undef NULL
- ' $2/$file > $2/$file.
- mv $2/$file. $2/$file
- if cmp $file $2/$file >/dev/null 2>&1 \
- || egrep 'This file is part of the GNU C Library' $2/$file >/dev/null 2>&1; then
- rm $2/$file
- else
- echo Fixed $file
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' $2/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required $1 $dir/$include $2/$dir/$include"
- done
- fi
- fi
- fi
- done
- shift; shift
-done
-
-cd ${INPUT}
-
-# Install the proper definition of the three standard types in header files
-# that they come from.
-for file in sys/types.h stdlib.h sys/stdtypes.h stddef.h memory.h unistd.h; do
- if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
- fi
-
- if [ -r ${LIB}/$file ]; then
- echo Fixing size_t, ptrdiff_t and wchar_t in $file
- sed \
- -e '/^[ ]*\*[ ]*typedef unsigned int size_t;/N' \
- -e 's/^\([ ]*\*[ ]*typedef unsigned int size_t;\n[ ]*\*\/\)/\1\
-#ifndef __SIZE_TYPE__\
-#define __SIZE_TYPE__ long unsigned int\
-#endif\
-typedef __SIZE_TYPE__ size_t;\
-/' \
- -e '/typedef[ ][ ]*[a-z_][ a-z_]*[ ]size_t/i\
-#ifndef __SIZE_TYPE__\
-#define __SIZE_TYPE__ long unsigned int\
-#endif
-' \
- -e 's/typedef[ ][ ]*[a-z_][ a-z_]*[ ]size_t/typedef __SIZE_TYPE__ size_t/' \
- -e '/typedef[ ][ ]*[a-z_][ a-z_]*[ ]ptrdiff_t/i\
-#ifndef __PTRDIFF_TYPE__\
-#define __PTRDIFF_TYPE__ long int\
-#endif
-' \
- -e 's/typedef[ ][ ]*[a-z_][ a-z_]*[ ]ptrdiff_t/typedef __PTRDIFF_TYPE__ ptrdiff_t/' \
- -e '/typedef[ ][ ]*[a-z_][ a-z_]*[ ]wchar_t/i\
-#ifndef __WCHAR_TYPE__\
-#define __WCHAR_TYPE__ int\
-#endif\
-#ifndef __cplusplus
-' \
- -e '/typedef[ ][ ]*[a-z_][ a-z_]*[ ]wchar_t/a\
-#endif
-' \
- -e 's/typedef[ ][ ]*[a-z_][ a-z_]*[ ]wchar_t/typedef __WCHAR_TYPE__ wchar_t/' \
- ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
- fi
-done
-
-# Fix #defines under Alpha OSF/1:
-# The following files contain '#pragma extern_prefix "_FOO"' followed by
-# a '#define something(x,y,z) _FOOsomething(x,y,z)'. The intent of these
-# statements is to reduce namespace pollution. While these macros work
-# properly in most cases, they don't allow you to take a pointer to the
-# "something" being modified. To get around this limitation, change these
-# statements to be of the form '#define something _FOOsomething'.
-for file in libgen.h dirent.h ftw.h grp.h ndbm.h pthread.h pwd.h signal.h standards.h stdlib.h string.h stropts.h time.h unistd.h
-do
- if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
- fi
-
- if [ -r ${LIB}/$file ]; then
- echo Fixing $file extern_prefix
- sed -e 's/^[ ]*#[ ]*define[ ]*\([^(]*\)\(([^)]*)\)[ ]*\(_.\)\1\2[ ]*$/#define \1 \3\1/' ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
- fi
-done
-
-# Fix one other error in this file: a mismatched quote not inside a C comment.
-file=sundev/vuid_event.h
-if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- mkdir ${LIB}/sundev 2>/dev/null
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
-fi
-
-if [ -r ${LIB}/$file ]; then
- echo Fixing $file comment
- sed -e "s/doesn't/does not/" ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
-fi
-
-# Fix these Sun OS files to avoid an invalid identifier in an #ifdef.
-file=sunwindow/win_cursor.h
-if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
-# mkdir ${LIB}/sunwindow 2>/dev/null
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
-fi
-if [ -r ${LIB}/$file ]; then
- echo Fixing $file
- sed -e "s/ecd.cursor/ecd_cursor/" ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
-fi
-file=sunwindow/win_lock.h
-if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
-# mkdir ${LIB}/sunwindow 2>/dev/null
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
-fi
-if [ -r ${LIB}/$file ]; then
- echo Fixing $file
- sed -e "s/ecd.cursor/ecd_cursor/" ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
-fi
-
-# Fix this Sun file to avoid interfering with stddef.h.
-file=sys/stdtypes.h
-if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
-fi
-
-if [ -r ${LIB}/$file ]; then
- echo Fixing $file
-sed -e '/[ ]size_t.*;/i\
-#ifndef _GCC_SIZE_T\
-#define _GCC_SIZE_T
-' \
- -e '/[ ]size_t.*;/a\
-#endif
-' \
- -e '/[ ]ptrdiff_t.*;/i\
-#ifndef _GCC_PTRDIFF_T\
-#define _GCC_PTRDIFF_T
-' \
- -e '/[ ]ptrdiff_t.*;/a\
-#endif
-' \
- -e '/[ ]wchar_t.*;/i\
-#ifndef _GCC_WCHAR_T\
-#define _GCC_WCHAR_T
-' \
- -e '/[ ]wchar_t.*;/a\
-#endif
-' ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
-fi
-
-# Fix this ARM/RISCiX file to avoid interfering with the use of __wchar_t
-# in cc1plus.
-file=stdlib.h
-if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
-fi
-
-if [ -r ${LIB}/$file ]; then
- echo Fixing $file
- sed -e "s/\(#[ ]*ifndef[ ]*\)__wchar_t/\1_GCC_WCHAR_T/" \
- -e "s/\(#[ ]*define[ ]*\)__wchar_t/\1_GCC_WCHAR_T/" \
- ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
-fi
-
-# Fix this ARM/RISCiX file where ___type is a Compiler hint that is specific to
-# the Norcroft compiler.
-file=X11/Intrinsic.h
-if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
-fi
-
-if [ -r ${LIB}/$file ]; then
- echo Fixing $file
- sed -e "s/___type p_type/p_type/" \
- ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
-fi
-
-# Fix this file to avoid interfering with stddef.h, but don't mistakenly
-# match ssize_t present in AIX for the ps/2, or typedefs which use (but do not
-# set) size_t.
-file=sys/types.h
-if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
-fi
-
-if [ -r ${LIB}/$file ]; then
- echo Fixing $file
-sed -e '/typedef[ ][ ]*[A-Za-z_][ A-Za-z_]*[ ]size_t/i\
-#ifndef _GCC_SIZE_T\
-#define _GCC_SIZE_T
-' \
- -e '/typedef[ ][ ]*[A-Za-z_][ A-Za-z_]*[ ]size_t/a\
-#endif
-' ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
-fi
-
-# Fix HP's use of ../machine/inline.h to refer to
-# /usr/include/machine/inline.h
-file=sys/spinlock.h
-if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- cp $file ${LIB}/$file
-fi
-if [ -r ${LIB}/$file ] ; then
- echo Fixing $file
- sed -e 's,"../machine/inline.h",<machine/inline.h>,' \
- -e 's,"../machine/psl.h",<machine/psl.h>,' \
- ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
-fi
-
-# Fix an error in this file: the #if says _cplusplus, not the double
-# underscore __cplusplus that it should be
-file=tinfo.h
-if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- mkdir ${LIB}/rpcsvc 2>/dev/null
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
-fi
-
-if [ -r ${LIB}/$file ]; then
- echo Fixing $file, __cplusplus macro
- sed -e 's/[ ]_cplusplus/ __cplusplus/' ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
-fi
-
-# Fix an error in this file: a missing semi-colon at the end of the statsswtch
-# structure definition.
-file=rpcsvc/rstat.h
-if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- mkdir ${LIB}/rpcsvc 2>/dev/null
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
-fi
-
-if [ -r ${LIB}/$file ]; then
- echo Fixing $file, definition of statsswtch
- sed -e 's/boottime$/boottime;/' ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
-fi
-
-# Fix an error in this file: a missing semi-colon at the end of the nodeent
-# structure definition.
-file=netdnet/dnetdb.h
-if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- mkdir ${LIB}/netdnet 2>/dev/null
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
-fi
-
-if [ -r ${LIB}/$file ]; then
- echo Fixing $file, definition of nodeent
- sed -e 's/char.*na_addr *$/char *na_addr;/' ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
-fi
-
-# Check for bad #ifdef line (in Ultrix 4.1)
-file=sys/file.h
-if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
-fi
-
-if [ -r ${LIB}/$file ]; then
- echo Fixing $file, bad \#ifdef line
- sed -e 's/#ifdef KERNEL/#if defined(KERNEL)/' ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
-fi
-
-# Check for (...) in C++ code in HP/UX sys/file.h.
-file=sys/file.h
-if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
-fi
-
-if [ -r ${LIB}/$file ]; then
- if egrep HPUX_SOURCE ${LIB}/$file > /dev/null; then
- echo Fixing $file, use of '(...)'
- sed -e 's/(\.\.\.)/(struct file * ...)/' ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
- fi
-fi
-
-# Check for superfluous `static' (in Ultrix 4.2)
-# On Ultrix 4.3, includes of other files (r3_cpu.h,r4_cpu.h) is broken.
-file=machine/cpu.h
-if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- mkdir ${LIB}/machine 2>/dev/null
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
-fi
-
-if [ -r ${LIB}/$file ]; then
- echo Fixing $file, superfluous static and broken includes of other files.
- sed -e 's/^static struct tlb_pid_state/struct tlb_pid_state/' \
- -e 's/^#include "r3_cpu\.h"$/#include <machine\/r3_cpu\.h>/' \
- -e 's/^#include "r4_cpu\.h"$/#include <machine\/r4_cpu\.h>/' \
- ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
-# This file has an alternative name, mips/cpu.h. Fix that name, too.
- if cmp machine/cpu.h mips/cpu.h > /dev/null 2>&1; then
- mkdir ${LIB}/mips 2>&-
-# Don't remove the file first, they may be the same file!
- ln ${LIB}/$file ${LIB}/mips/cpu.h > /dev/null 2>&1
- fi
- fi
-fi
-
-# Incorrect sprintf declaration in X11/Xmu.h
-file=X11/Xmu.h
-if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- mkdir ${LIB}/X11 2>/dev/null
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
-fi
-
-if [ -r ${LIB}/$file ]; then
- echo Fixing $file sprintf declaration
- sed -e 's,^extern char \* sprintf();$,#ifndef __STDC__\
-extern char * sprintf();\
-#endif /* !defined __STDC__ */,' ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
-fi
-
-# Incorrect sprintf declaration in X11/Xmu/Xmu.h
-# (It's not clear whether the right file name is this or X11/Xmu.h.)
-file=X11/Xmu/Xmu.h
-if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- mkdir ${LIB}/X11/Xmu 2>/dev/null
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
-fi
-
-if [ -r ${LIB}/$file ]; then
- echo Fixing $file sprintf declaration
- sed -e 's,^extern char \* sprintf();$,#ifndef __STDC__\
-extern char * sprintf();\
-#endif /* !defined __STDC__ */,' ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
-fi
-
-# Check for missing ';' in struct
-file=netinet/ip.h
-if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- mkdir ${LIB}/netinet 2>/dev/null
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
-fi
-
-if [ -r ${LIB}/$file ]; then
- echo Fixing $file
- sed -e '/^struct/,/^};/s/}$/};/' ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm -f ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
-fi
-
-# Fix the CAT macro in SunOS memvar.h.
-file=pixrect/memvar.h
-if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- mkdir ${LIB}/pixrect 2>/dev/null
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
-fi
-
-if [ -r ${LIB}/$file ]; then
- echo Fixing $file
- sed -e '/^#define.CAT(a,b)/ i\
-#ifdef __STDC__ \
-#define CAT(a,b) a##b\
-#else
-/^#define.CAT(a,b)/ a\
-#endif
-' ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm -f ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
-fi
-
-# Check for yet more missing ';' in struct (in SunOS 4.0.x)
-file=rpcsvc/rusers.h
-if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- mkdir ${LIB}/rpcsvc 2>/dev/null
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
-fi
-
-if [ -r ${LIB}/$file ]; then
- echo Fixing $file
- sed -e '/^struct/,/^};/s/_cnt$/_cnt;/' ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm -f ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
-fi
-
-# Fix return type of exit and abort in <stdlib.h> on SunOS 4.1.
-# Also wrap protection around size_t for m88k-sysv3 systems.
-file=stdlib.h
-if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
-fi
-
-if [ -r ${LIB}/$file ]; then
- echo Fixing $file
- if grep _GCC_SIZE_T ${LIB}/$file >/dev/null
- then size_t_pattern='<<< do not double-wrap the size_t typedef >>>'
- else size_t_pattern='typedef[ a-zA-Z_]*[ ]size_t[ ]*;'
- fi
- sed -e 's/int abort/void abort/g' \
- -e 's/int free/void free/g' \
- -e 's/char[ ]*\*[ ]*calloc/void \* calloc/g' \
- -e 's/char[ ]*\*[ ]*malloc/void \* malloc/g' \
- -e 's/char[ ]*\*[ ]*realloc/void \* realloc/g' \
- -e 's/char[ ]*\*[ ]*bsearch/void \* bsearch/g' \
- -e 's/int[ ][ ]*exit/void exit/g' \
- -e "/$size_t_pattern/"'i\
-#ifndef _GCC_SIZE_T\
-#define _GCC_SIZE_T
-' \
- -e "/$size_t_pattern/"'a\
-#endif
-' \
- ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm -f ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
-fi
-
-# Fix return type of free and {c,m,re}alloc in <malloc.h> on SunOS 4.1.
-# Also fix return type of {m,re}alloc in <malloc.h> on sysV68
-file=malloc.h
-if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
-fi
-
-if [ -r ${LIB}/$file ]; then
- echo Fixing $file
- sed -e 's/typedef[ ]char \* malloc_t/typedef void \* malloc_t/g' \
- -e 's/int[ ][ ]*free/void free/g' \
- -e 's/char\([ ]*\*[ ]*malloc\)/void\1/g' \
- -e 's/char\([ ]*\*[ ]*realloc\)/void\1/g' \
- ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm -f ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
-fi
-
-# Fix bogus #ifdef in <hsfs/hsfs_spec.h> on SunOS 4.1.
-file=hsfs/hsfs_spec.h
-if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- mkdir ${LIB}/hsfs 2>/dev/null
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
-fi
-
-if [ -r ${LIB}/$file ]; then
- echo Fixing $file
- sed -e 's/\#ifdef __i386__ || __vax__/\#if __i386__ || __vax__/g' \
- ${LIB}/$file > ${LIB}/${file}.
- rm -f ${LIB}/$file; mv ${LIB}/${file}. ${LIB}/$file
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm -f ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
-fi
-
-# Fix bogus #ifdef in <hsfs/hsnode.h> on SunOS 4.1.
-file=hsfs/hsnode.h
-if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- mkdir ${LIB}/hsfs 2>/dev/null
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
-fi
-
-if [ -r ${LIB}/$file ]; then
- echo Fixing $file
- sed -e 's/\#ifdef __i386__ || __sun4c__/\#if __i386__ || __sun4c__/g' \
- ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm -f ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
-fi
-
-# Fix bogus #ifdef in <hsfs/iso_spec.h> on SunOS 4.1.
-file=hsfs/iso_spec.h
-if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- mkdir ${LIB}/hsfs 2>/dev/null
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
-fi
-
-if [ -r ${LIB}/$file ]; then
- echo Fixing $file
- sed -e 's/\#ifdef __i386__ || __vax__/\#if __i386__ || __vax__/g' \
- ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm -f ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
-fi
-
-# Incorrect #include in Sony News-OS 3.2.
-file=machine/machparam.h
-if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- mkdir ${LIB}/machine 2>/dev/null
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
-fi
-
-if [ -r ${LIB}/$file ]; then
- echo Fixing $file, incorrect \#include
- sed -e 's@"../machine/endian.h"@<machine/endian.h>@' \
- ${LIB}/$file > ${LIB}/${file}.
- rm -f ${LIB}/$file; mv ${LIB}/${file}. ${LIB}/$file
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm -f ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
-fi
-
-# Multiline comment after typedef on IRIX 4.0.1.
-file=sys/types.h
-if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- mkdir ${LIB}/sys 2>/dev/null
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
-fi
-
-if [ -r ${LIB}/$file ]; then
- echo Fixing $file, comment in the middle of \#ifdef
- sed -e 's@type of the result@type of the result */@' \
- -e 's@of the sizeof@/* of the sizeof@' \
- ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm -f ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
-fi
-
-# Turning // comments into /* */ comments trashes this IRIX 4.0.1
-# header file, which embeds // comments inside multi-line /* */
-# comments. If this looks like the IRIX header file, we refix it by
-# just throwing away the // comments.
-file=fam.h
-if [ -r ${LIB}/$file ]; then
- if egrep indigo.esd ${LIB}/$file > /dev/null; then
- echo Fixing $file, overeager sed script
- rm ${LIB}/$file
- sed -e 's|//.*$||g' $file > ${LIB}/$file
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
- fi
-fi
-
-# There is a similar problem with the VxWorks drv/netif/if_med.h file.
-file=drv/netif/if_med.h
-if [ -r ${LIB}/$file ]; then
- if egrep 'Wind River' ${LIB}/$file > /dev/null; then
- echo Fixing $file, overeager sed script
- rm ${LIB}/$file
- sed -e 's|//.*$||g' $file > ${LIB}/$file
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
- fi
-fi
-
-# And also with the HP-UX 10 and HP-UX 11 sys/pci.h file
-file=sys/pci.h
-if [ -r ${LIB}/$file ]; then
- if egrep 'System Private Structures' ${LIB}/$file > /dev/null; then
- echo Fixing $file, overeager sed script
- rm ${LIB}/$file
- sed -e 's|//.*$||g' $file > ${LIB}/$file
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
- fi
-fi
-
-# And also with a few more HP-UX 11 headers which are only broken
-# after they are "fixed".
-file=sys/ki_iface.h
-if [ -r ${LIB}/$file ]; then
- if egrep 'These definitions are for HP Internal developers' ${LIB}/$file > /dev/null; then
- echo Fixing $file, overeager sed script
- rm ${LIB}/$file
- fi
-fi
-
-file=sys/ki.h
-if [ -r ${LIB}/$file ]; then
- if egrep '11.00 HP-UX LP64' ${LIB}/$file > /dev/null; then
- echo Fixing $file, overeager sed script
- rm ${LIB}/$file
- fi
-fi
-
-file=sys/ki_calls.h
-if [ -r ${LIB}/$file ]; then
- if egrep 'KI_MAX_PROCS is an arbitrary number' ${LIB}/$file > /dev/null; then
- echo Fixing $file, overeager sed script
- rm ${LIB}/$file
- fi
-fi
-
-file=sys/ki_defs.h
-if [ -r ${LIB}/$file ] ; then
- if egrep 'Kernel Instrumentation Definitions' ${LIB}/$file > /dev/null; then
- echo Fixing $file, overeager sed script
- rm ${LIB}/$file
- fi
-fi
-
-file=sys/time.h
-if [ -r ${LIB}/$file ] ; then
- if egrep 'For CASPEC, look in' ${LIB}/$file > /dev/null; then
- echo Fixing $file, overeager sed script
- rm ${LIB}/$file
- fi
-fi
-
-# Some IRIX header files contains the string "//"
-for file in elf_abi.h elf.h; do
- if [ -r ${LIB}/$file ]; then
- echo Fixing $file, overeager sed script
- sed -e 's|"/\*"\*/|"//"|' ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm -f ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
- fi
-done
-
-# IRIX 4.0.5 <rpc/auth.h> uses struct sockaddr in prototype without
-# previous definition.
-file=rpc/auth.h
-if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- mkdir ${LIB}/rpc 2>/dev/null
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
-fi
-
-if [ -r ${LIB}/$file ]; then
- echo Fixing $file, undefined type
- sed -e '/authdes_create.*struct sockaddr/i\
-struct sockaddr;
-' \
- ${LIB}/$file > ${LIB}/$file.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm -f ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
-fi
-
-# IRIX 4.0.5 <rpc/xdr.h> uses struct __file_s in prototype without previous
-# definition.
-file=rpc/xdr.h
-if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- mkdir ${LIB}/rpc 2>/dev/null
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
-fi
-
-if [ -r ${LIB}/$file ]; then
- echo Fixing $file, undefined type
- sed -e '/xdrstdio_create.*struct __file_s/i\
-struct __file_s;
-' \
- ${LIB}/$file > ${LIB}/$file.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm -f ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
-fi
-
-# Same problem with a file from SunOS 4.1.3 : a header file containing
-# the string "//" embedded in "/**/"
-file=sbusdev/audiovar.h
-if [ -r ${LIB}/$file ]; then
- echo Fixing $file, overeager sed script
- rm ${LIB}/$file
- sed -e 's|//.*$||g' $file > ${LIB}/$file
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
-fi
-
-# Fix non-ANSI memcpy declaration that conflicts with gcc's builtin
-# declaration on Sun OS 4.x. We must only fix this on Sun OS 4.x, because
-# many other systems have similar text but correct versions of the file.
-# To ensure only Sun's is fixed, we grep for a likely unique string.
-# Fix also on sysV68 R3V7.1 (head/memory.h\t50.1\t )
-file=memory.h
-if [ -r $file ] && egrep '/\* @\(#\)(head/memory.h 50.1 |memory\.h 1\.[2-4] 8./../.. SMI; from S5R2 1\.2 )\*/' $file > /dev/null; then
- if [ ! -r ${LIB}/$file ]; then
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
- fi
- if [ -r ${LIB}/$file ]; then
- echo Replacing $file
- cat > ${LIB}/$file << EOF
-/* This file was generated by fixincludes */
-#ifndef __memory_h__
-#define __memory_h__
-
-#ifdef __STDC__
-extern void *memccpy();
-extern void *memchr();
-extern void *memcpy();
-extern void *memset();
-#else
-extern char *memccpy();
-extern char *memchr();
-extern char *memcpy();
-extern char *memset();
-#endif /* __STDC__ */
-
-extern int memcmp();
-
-#endif /* __memory_h__ */
-EOF
- fi
-fi
-
-# Fix return type of fread and fwrite on sysV68
-file=stdio.h
-if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
-fi
-
-if [ -r ${LIB}/$file ]; then
- echo Fixing $file, fread and fwrite return type
- sed -e 's/^\(extern int fclose(), fflush()\), \(fread(), fwrite()\)\(.*\)$/extern unsigned int \2;\
-\1\3/' \
- ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm -f ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
-fi
-
-# parameters not const on DECstation Ultrix V4.0 and OSF/1.
-file=stdio.h
-if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
-fi
-
-if [ -r ${LIB}/$file ]; then
- echo Fixing $file, non-const arg
- sed -e 's@perror( char \*__s );@perror( const char *__s );@' \
- -e 's@fputs( char \*__s,@fputs( const char *__s,@' \
- -e 's@fopen( char \*__filename, char \*__type );@fopen( const char *__filename, const char *__type );@' \
- -e 's@fwrite( void \*__ptr,@fwrite( const void *__ptr,@' \
- -e 's@fscanf( FILE \*__stream, char \*__format,@fscanf( FILE *__stream, const char *__format,@' \
- -e 's@scanf( char \*__format,@scanf( const char *__format,@' \
- -e 's@sscanf( char \*__s, char \*__format,@sscanf( const char *__s, const char *__format,@' \
- -e 's@popen(char \*, char \*);@popen(const char *, const char *);@' \
- -e 's@tempnam(char\*,char\*);@tempnam(const char*,const char*);@' \
- ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm -f ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
-fi
-
-# parameters conflict with C++ new on rs/6000
-for file in stdio.h unistd.h ; do
- if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- fi
-
- if [ -r ${LIB}/$file ]; then
- echo Fixing $file, parameter name conflicts
- sed -e 's@rename(const char \*old, const char \*new)@rename(const char *_old, const char *_new)@' \
- ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm -f ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
- fi
-done
-
-# function class(double x) conflicts with C++ keyword on rs/6000
-file=math.h
-if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
-fi
-
-if [ -r ${LIB}/$file ]; then
- if grep '[^a-zA-Z_]class[(]' ${LIB}/$file >/dev/null; then
- echo Fixing $file
- sed -e '/class[(]/i\
-#ifndef __cplusplus
-' \
- -e '/class[(]/a\
-#endif
-' ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
- fi
-fi
-
-# Wrong fchmod prototype on RS/6000.
-file=sys/stat.h
-if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- mkdir ${LIB}/sys 2>/dev/null
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
-fi
-
-if [ -r ${LIB}/$file ]; then
- echo Fixing $file, fchmod prototype
- sed -e 's/fchmod(char \*/fchmod(int/' \
- ${LIB}/$file > ${LIB}/$file.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm -f ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
-fi
-
-# There are several name conflicts with C++ reserved words in X11
-# header files. These are fixed in some versions, so don't do the
-# fixes if we find __cplusplus in the file. These were found on the
-# RS/6000.
-
-# class in X11/ShellP.h
-file=X11/ShellP.h
-if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- mkdir ${LIB}/sys 2>/dev/null
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
-fi
-
-if [ -r ${LIB}/$file ]; then
- if grep __cplusplus ${LIB}/$file >/dev/null 2>/dev/null; then
- true;
- else
- echo Fixing $file, field class
- sed -e '/char [*]class;/i\
-#ifdef __cplusplus\
- char *c_class;\
-#else
-' \
- -e '/char [*]class;/a\
-#endif
-' ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- fi
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm -f ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
-fi
-# new in Xm/Traversal.h
-file=Xm/Traversal.h
-if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- mkdir ${LIB}/sys 2>/dev/null
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
-fi
-
-if [ -r ${LIB}/$file ]; then
- if grep __cplusplus ${LIB}/$file >/dev/null 2>/dev/null; then
- true;
- else
- echo Fixing $file, uses of new
- sed -e '/Widget old, new;/i\
-#ifdef __cplusplus\
- Widget old, c_new;\
-#else
-' \
- -e '/Widget old, new;/a\
-#endif
-' \
- -e 's/Widget new,/Widget c_new,/g' ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- fi
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm -f ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
-fi
-# class in Xm/BaseClassI.h
-file=Xm/BaseClassI.h
-if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- mkdir ${LIB}/sys 2>/dev/null
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
-fi
-
-if [ -r ${LIB}/$file ]; then
- if grep __cplusplus ${LIB}/$file >/dev/null 2>/dev/null; then
- true;
- else
- echo Fixing $file, prototype parameter name
- sed -e 's/ class[)]/ c_class)/g' ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- fi
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm -f ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
-fi
-
-# NeXT 3.2 adds const prefix to some math functions. These conflict
-# with the built-in functions.
-file=ansi/math.h
-if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
-fi
-if [ -r ${LIB}/$file ]; then
- echo Fixing $file
- sed -e '/^extern.*double.*__const__.*sqrt(/s/__const__//' \
- -e '/^extern.*double.*__const__.*fabs(/s/__const__//' \
- -e '/^extern.*double.*__const__.*cos(/s/__const__//' \
- -e '/^extern.*double.*__const__.*hypot(/s/__const__//' \
- -e '/^extern.*double.*__const__.*sin(/s/__const__//' ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm -f ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
-fi
-
-# NeXT 3.2 uses the word "template" as a parameter for some
-# functions. GCC reports an invalid use of a reserved key word
-# with the built-in functions. NeXT 3.2 includes the keyword
-# volatile in the prototype for abort(). This conflicts with
-# the built-in definition.
-file=bsd/libc.h
-if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
-fi
-if [ -r ${LIB}/$file ]; then
- echo Fixing $file
- sed -e '/\(.*template\)/s/template//' \
- -e '/extern.*volatile.*void.*abort/s/volatile//' ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm -f ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
-fi
-
-# NeXT 3.2 includes the keyword volatile in the abort() and
-# exit() function prototypes. That conflicts with the
-# built-in functions.
-file=ansi/stdlib.h
-if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
-fi
-if [ -r ${LIB}/$file ]; then
- echo Fixing $file
- sed -e '/extern.*volatile.*void.*exit/s/volatile//' \
- -e '/extern.*volatile.*void.*abort/s/volatile//' ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm -f ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
-fi
-
-# sys/utsname.h on Ultrix V4.[35] puts the declaration of uname before the
-# definition of struct utsname, so the prototype (added by fixproto) causes
-# havoc.
-file=sys/utsname.h
-if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
-fi
-
-if [ -r ${LIB}/$file ] \
- && grep 'ULTRIX' ${LIB}/$file >/dev/null; then
- echo Fixing $file, uname declaration
- sed -e '/^[ ]*extern[ ]*int[ ]*uname();$/i\
-struct utsname;
-'\
- ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm -f ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
-fi
-
-# sys/wait.h on AIX 3.2.5 puts the declaration of wait3 before the definition
-# of struct rusage, so the prototype (added by fixproto) causes havoc.
-file=sys/wait.h
-if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
-fi
-
-if [ -r ${LIB}/$file ] \
- && grep 'bos325,' ${LIB}/$file >/dev/null; then
- echo Fixing $file, wait3 declaration
- sed -e '/^extern pid_t wait3();$/i\
-struct rusage;
-'\
- ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm -f ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
-fi
-
-# NeXT 2.0 defines 'int wait(union wait*)', which conflicts with Posix.1.
-# Note that version 3 of the NeXT system has wait.h in a different directory,
-# so that this code won't do anything. But wait.h in version 3 has a
-# conditional, so it doesn't need this fix. So everything is okay.
-file=sys/wait.h
-if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
-fi
-
-if [ -r ${LIB}/$file ] \
- && grep 'wait[(]union wait' ${LIB}/$file >/dev/null; then
- echo Fixing $file, bad wait formal
- sed -e 's@wait(union wait@wait(void@' ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm -f ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
-fi
-
-# Don't use or define the name va_list in stdio.h.
-# This is for ANSI and also to interoperate properly with gcc's varargs.h.
-file=stdio.h
-if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
-fi
-
-if [ -r ${LIB}/$file ]; then
- echo Fixing $file, use of va_list
- # Arrange for stdio.h to use stdarg.h to define __gnuc_va_list
- if egrep "__need___va_list" ${LIB}/$file >/dev/null 2>&1; then
- touch ${LIB}/${file}.sed
- else
- (echo "#define __need___va_list"
- echo "#include <stdarg.h>") > ${LIB}/${file}.sed
- fi
- # Use __gnuc_va_list in arg types in place of va_list.
- # On 386BSD use __gnuc_va_list instead of _VA_LIST_. We're hoping the
- # trailing parentheses and semicolon save all other systems from this.
- # Define __va_list__ (something harmless and unused) instead of va_list.
- # Don't claim to have defined va_list.
- sed -e 's@ va_list @ __gnuc_va_list @' \
- -e 's@ va_list)@ __gnuc_va_list)@' \
- -e 's@ _BSD_VA_LIST_));@ __gnuc_va_list));@' \
- -e 's@ _VA_LIST_));@ __gnuc_va_list));@' \
- -e 's@ va_list@ __va_list__@' \
- -e 's@\*va_list@*__va_list__@' \
- -e 's@ __va_list)@ __gnuc_va_list)@' \
- -e 's@GNUC_VA_LIST@GNUC_Va_LIST@' \
- -e 's@_NEED___VA_LIST@_NEED___Va_LIST@' \
- -e 's@VA_LIST@DUMMY_VA_LIST@' \
- -e 's@_Va_LIST@_VA_LIST@' \
- ${LIB}/$file >> ${LIB}/${file}.sed
-
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm -f ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
-fi
-
-# Cancel out ansi_compat.h on Ultrix. Replace it with empty file.
-file=ansi_compat.h
-if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- if grep -s ULTRIX $file; then
- echo "/* This file intentionally left blank. */" > $LIB/$file
- fi
-fi
-
-# parameter to atof not const on DECstation Ultrix V4.0 and NEWS-OS 4.2R.
-# also get rid of bogus inline definitions in HP-UX 8.0
-file=math.h
-if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
-fi
-
-if [ -r ${LIB}/$file ]; then
- echo Fixing $file, non-const arg
- sed -e 's@atof(\([ ]*char[ ]*\*[^)]*\))@atof(const \1)@' \
- -e 's@inline int abs(int [a-z][a-z]*) {.*}@extern "C" int abs(int);@' \
- -e 's@inline double abs(double [a-z][a-z]*) {.*}@@' \
- -e 's@inline int sqr(int [a-z][a-z]*) {.*}@@' \
- -e 's@inline double sqr(double [a-z][a-z]*) {.*}@@' \
- ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm -f ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
-fi
-
-# fix bogus recursive stdlib.h in NEWS-OS 4.0C
-file=stdlib.h
-if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
-fi
-
-if [ -r ${LIB}/$file ]; then
- echo Fixing $file, recursive inclusion
- sed -e '/^#include <stdlib.h>/i\
-#if 0
-' \
- -e '/^#include <stdlib.h>/a\
-#endif
-' \
- ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm -f ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
-fi
-
-# Avoid nested comments on Ultrix 4.3.
-file=rpc/svc.h
-if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- mkdir ${LIB}/rpc 2>/dev/null
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
-fi
-
-if [ -r ${LIB}/$file ]; then
- echo Fixing $file, nested comment
- sed -e 's@^\( \* int protocol; \)/\*@\1*/ /*@' \
- ${LIB}/$file > ${LIB}/$file.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm -f ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
-fi
-
-# This file in RISC/os uses /**/ to concatenate two tokens.
-file=bsd43/bsd43_.h
-if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
-fi
-if [ -r ${LIB}/$file ]; then
- sed -e 's|/\*\*/|##|' ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm -f ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
-fi
-
-file=rpc/rpc.h
-if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- mkdir ${LIB}/rpc 2>/dev/null
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
-fi
-
-if [ -r ${LIB}/$file ]; then
- echo Fixing $file, nested comment
- sed -e 's@^\(/\*.*rpc/auth_des.h>.*\)/\*@\1*/ /*@' \
- ${LIB}/$file > ${LIB}/$file.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm -f ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
-fi
-
-# rpc/types.h on OSF1/2.0 is not C++ ready, even though NO_IMPLICIT_EXTERN_C
-# is defined for the alpha. The problem is the declaration of malloc.
-file=rpc/types.h
-if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- mkdir ${LIB}/rpc 2>/dev/null
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
-fi
-if [ -r ${LIB}/$file ]; then
- if egrep '"C"' ${LIB}/$file >/dev/null 2>&1; then
- true
- else
- echo Fixing $file
- echo '#ifdef __cplusplus
-extern "C" {
-#endif' > ${LIB}/${file}.sed
- cat ${LIB}/${file} >> ${LIB}/${file}.sed
- echo '#ifdef __cplusplus
-}
-#endif' >> ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm -f ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
- fi
-fi
-
-# In limits.h, put #ifndefs around things that are supposed to be defined
-# in float.h to avoid redefinition errors if float.h is included first.
-# On HP/UX this patch does not work, because on HP/UX limits.h uses
-# multi line comments and the inserted #endif winds up inside the
-# comment. Fortunately, HP/UX already uses #ifndefs in limits.h; if
-# we find a #ifndef FLT_MIN we assume that all the required #ifndefs
-# are there, and we do not add them ourselves.
-# Also fix a nested comment problem in sys/limits.h on Motorola sysV68 R3V7.1
-for file in limits.h sys/limits.h; do
- if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- mkdir ${LIB}/sys 2>/dev/null
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
- fi
-
- if [ -r ${LIB}/$file ]; then
- if egrep 'ifndef[ ]+FLT_MIN' ${LIB}/$file >/dev/null; then
- true
- else
- echo Fixing $file
- sed -e '/[ ]FLT_MIN[ ]/i\
-#ifndef FLT_MIN
-'\
- -e '/[ ]FLT_MIN[ ]/a\
-#endif
-'\
- -e '/[ ]FLT_MAX[ ]/i\
-#ifndef FLT_MAX
-'\
- -e '/[ ]FLT_MAX[ ]/a\
-#endif
-'\
- -e '/[ ]FLT_DIG[ ]/i\
-#ifndef FLT_DIG
-'\
- -e '/[ ]FLT_DIG[ ]/a\
-#endif
-'\
- -e '/[ ]DBL_MIN[ ]/i\
-#ifndef DBL_MIN
-'\
- -e '/[ ]DBL_MIN[ ]/a\
-#endif
-'\
- -e '/[ ]DBL_MAX[ ]/i\
-#ifndef DBL_MAX
-'\
- -e '/[ ]DBL_MAX[ ]/a\
-#endif
-'\
- -e '/[ ]DBL_DIG[ ]/i\
-#ifndef DBL_DIG
-'\
- -e '/[ ]DBL_DIG[ ]/a\
-#endif
-'\
- -e '/^\(\/\*#define HUGE_VAL 3\.[0-9e+]* *\)\/\*/s//\1/'\
- ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- fi
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- echo Deleting ${LIB}/$file\; no fixes were needed.
- rm -f ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
- fi
-done
-
-# In math.h, put #ifndefs around things that might be defined in a gcc
-# specific math-*.h file.
-file=math.h
-if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
-fi
-
-if [ -r ${LIB}/$file ]; then
- echo Fixing $file
- sed -e '/define[ ]HUGE_VAL[ ]/i\
-#ifndef HUGE_VAL
-'\
- -e '/define[ ]HUGE_VAL[ ]/a\
-#endif
-'\
- ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
-
- # In addition, copy the definition of DBL_MAX from float.h
- # if math.h requires one. The Lynx math.h requires it.
- if egrep '#define[ ]*HUGE_VAL[ ]+DBL_MAX' $file >/dev/null 2>&1; then
- if egrep '#define[ ]+DBL_MAX[ ]+' $file >/dev/null 2>&1; then
- true;
- else
- dbl_max_def=`egrep 'define[ ]+DBL_MAX[ ]+.*' float.h 2>/dev/null`
- if [ "$dbl_max_def" != "" ]; then
- dbl_max_def=`echo $dbl_max_def | sed 's/.*define[ ]*DBL_MAX[ ]*//'`
- sed -e "/define[ ]HUGE_VAL[ ]DBL_MAX/s/DBL_MAX/$dbl_max_def/" \
- ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- fi
- fi
- fi
-
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- echo Deleting ${LIB}/$file\; no fixes were needed.
- rm -f ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
-fi
-
-# Remove erroneous parentheses in sym.h on Alpha OSF/1.
-file=sym.h
-if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
-fi
-
-if [ -r ${LIB}/$file ]; then
- echo Fixing $file
- sed -e 's/#ifndef(__mips64)/#ifndef __mips64/' \
- ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm -f ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
-fi
-
-# Fix return value of mem{ccpy,chr,cpy,set} and str{len,spn,cspn}
-# in string.h on sysV68
-# Correct the return type for strlen in string.h on Lynx.
-# Correct the argument type for ffs in string.h on Alpha OSF/1 V2.0.
-# Add missing const for strdup on OSF/1 V3.0.
-# On sysV88 layout is slightly different.
-file=string.h
-if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
-fi
-
-if [ -r ${LIB}/$file ]; then
- echo Fixing $file, mem{ccpy,chr,cpy,set} and str{len,spn,cspn} return value
- sed -e 's/extern[ ]*int[ ]*strlen();/extern unsigned int strlen();/' \
- -e 's/extern[ ]*int[ ]*ffs[ ]*(long);/extern int ffs(int);/' \
- -e 's/strdup(char \*s1);/strdup(const char *s1);/' \
- -e '/^extern char$/N' \
- -e 's/^extern char\(\n \*memccpy(),\)$/extern void\1/'\
- -e '/^ strncmp(),$/N'\
- -e 's/^\( strncmp()\),\n\( strlen(),\)$/\1;\
-extern unsigned int\
-\2/'\
- -e '/^extern int$/N'\
- -e 's/^extern int\(\n strlen(),\)/extern size_t\1/' \
- ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm -f ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
-fi
-
-# Correct the return type for strlen in strings.h in SunOS 4.
-file=strings.h
-if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
-fi
-
-if [ -r ${LIB}/$file ]; then
- echo Fixing $file
- sed -e 's/int[ ]*strlen();/__SIZE_TYPE__ strlen();/' \
- ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm -f ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
-fi
-
-# Delete the '#define void int' line from curses.h on Lynx
-file=curses.h
-if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
-fi
-
-if [ -r ${LIB}/$file ]; then
- echo Fixing $file
- sed -e '/#[ ]*define[ ][ ]*void[ ]int/d' \
- ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm -f ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
-fi
-
-# Fix `typedef struct term;' on hppa1.1-hp-hpux9.
-file=curses.h
-if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
-fi
-
-if [ -r ${LIB}/$file ]; then
- echo Fixing $file
- sed -e 's/^[ ]*typedef[ ][ ]*\(struct[ ][ ]*term[ ]*;[ ]*\)$/\1/' \
- ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm -f ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
-fi
-
-# For C++, avoid any typedef or macro definition of bool, and use the
-# built in type instead. HP/UX 10.20, at least, also has it
-# in curses_colr/curses.h.
-for file in curses.h curses_colr/curses.h ; do
- if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
- fi
- if [ -r ${LIB}/$file ] && egrep bool ${LIB}/$file >/dev/null 2>&1; then
- echo Fixing $file, typedef or macro for bool is invalid in C++
- sed -e '/^#[ ]*define[ ][ ]*bool[ ][ ]*char[ ]*$/i\
-#ifndef __cplusplus
-'\
- -e '/^#[ ]*define[ ][ ]*bool[ ][ ]*char[ ]*$/a\
-#endif
-'\
- -e '/^typedef[ ][ ]*char[ ][ ]*bool[ ]*;/i\
-#ifndef __cplusplus
-'\
- -e '/^typedef[ ][ ]*char[ ][ ]*bool[ ]*;/a\
-#endif
-'\
- ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm -f ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
- fi
-done
-
-# Fix incorrect S_IF* definitions on m88k-sysv3.
-file=sys/stat.h
-if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
-fi
-
-if [ -r ${LIB}/$file ]; then
- echo Fixing $file
- sed -e 's/^\(#define[ ]*S_IS[A-Z]*(m)\)[ ]*(m[ ]*&[ ]*\(S_IF[A-Z][A-Z][A-Z][A-Z]*\)[ ]*)/\1 (((m)\&S_IFMT)==\2)/' \
- -e 's/^\(#define[ ]*S_IS[A-Z]*(m)\)[ ]*(m[ ]*&[ ]*\(0[0-9]*\)[ ]*)/\1 (((m)\&S_IFMT)==\2)/' \
- ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm -f ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
-fi
-
-# Fix nested comments in Motorola's <limits.h> and <sys/limits.h>
-for file in limits.h sys/limits.h; do
- if [ $target_canonical = m88k-motorola-sysv3 -o \
- $target_canonical = m68k-motorola-sysv ]; then
-
- if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
- fi
-
- if [ -r ${LIB}/$file ]; then
- echo "Fixing nested comments in Motorola's $file"
- sed \
- -e 's@^\(#undef[ ][ ]*PIPE_BUF[ ]*/\* max # bytes atomic in write to a\)$@\1 */@' \
- -e 's@\(/\*#define HUGE_VAL 3.40282346638528860e+38 \)\(/\*error value returned by Math lib\*/\)$@\1*/ \2@' \
- < ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm -f ${LIB}/$file
- fi
- fi
- fi
-done
-
-# Fix getopt declarations in stdio.h and stdlib.h on Alpha OSF/1 and AIX.
-for file in stdio.h stdlib.h; do
- if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
- fi
-
- if [ -r ${LIB}/$file ]; then
- echo Fixing $file, getopt declaration
- sed -e 's/getopt(int, char \*\[\],[ ]*char \*)/getopt(int, char *const[], const char *)/' \
- ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm -f ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
- fi
-done
-
-# Fix __page_size* declarations in pthread.h AIX 4.1.[34].
-# The original ones fail if uninitialized externs are not common.
-# This is the default for all ANSI standard C++ compilers.
-for file in pthread.h; do
- if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
- fi
-
- if [ -r ${LIB}/$file ]; then
- echo Fixing $file, __page_size* declarations
- sed -e 's/^int __page_size/extern int __page_size/' \
- ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm -f ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
- fi
-done
-
-# Determine if we're on Interactive Unix 2.2 or later, in which case we
-# need to fix some additional files. This is the same test for ISC that
-# Autoconf uses.
-if test -d /etc/conf/kconfig.d \
- && grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1; then
- echo "Fixing ISC __STDC__ goof in several files..."
- for name in stdio.h math.h ctype.h sys/limits.h sys/fcntl.h sys/dirent.h; do
- echo $name
- if test -r ${LIB}/$name; then
- file=${LIB}/$name
- else
- file=${INPUT}/$name
- fi
- # On Interactive 2.2, certain traditional Unix definitions
- # (notably getc and putc in stdio.h) are omitted if __STDC__ is
- # defined, not just if _POSIX_SOURCE is defined. This makes it
- # impossible to compile any nontrivial program except with -posix.
- sed \
-'s/!defined(__STDC__) && !defined(_POSIX_SOURCE)/!defined(_POSIX_SOURCE)/' \
- < $file > ${LIB}/$name.
- mv ${LIB}/$name. ${LIB}/$name
- done
-
- echo "Fixing ISC fmod declaration"
- # This one's already been fixed for other things.
- file=${LIB}/math.h
- sed 's/fmod(double)/fmod(double, double)/' <$file >$file.
- mv $file. $file
-
- echo "Fixing nested comments in ISC <sys/limits.h>"
- file=sys/limits.h
- sed '/CHILD_MAX/s,/\* Max, Max,' < ${INPUT}/$file >${LIB}/$file.
- sed '/OPEN_MAX/s,/\* Max, Max,' < ${LIB}/$file. >${LIB}/$file
-fi
-
-# These files in Sun OS 4.x use /**/ to concatenate tokens.
-for file in sparc/asm_linkage.h sun3/asm_linkage.h sun3x/asm_linkage.h \
- sun4/asm_linkage.h sun4c/asm_linkage.h sun4m/asm_linkage.h \
- sun4c/debug/asm_linkage.h sun4m/debug/asm_linkage.h;
-do
- if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
- fi
-
- if [ -r ${LIB}/$file ]; then
- sed -e 's|/\*\*/|##|g' ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm -f ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
- fi
-done
-
-# These files in ARM/RISCiX use /**/ to concatenate tokens.
-for file in arm/as_support.h arm/mc_type.h arm/xcb.h dev/chardefmac.h \
- dev/ps_irq.h dev/screen.h dev/scsi.h sys/tty.h Xm.acorn/XmP.h
-do
- if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
- fi
-
- if [ -r ${LIB}/$file ]; then
- sed -e 's|/\*\*/|##|g' ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm -f ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
- fi
-done
-
-# libm.a on m88k-motorola-sysv3 contains a stupid optimization for function
-# hypot(), which returns the second argument without even looking at its value
-# if the other is 0.0
-# Another drawback is that fix-header doesn't fix fabs' prototype, and I have
-# no idea why.
-file=math.h
-if [ $target_canonical = m88k-motorola-sysv3 ]; then
- if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
- fi
-
- if [ -r ${LIB}/$file ]; then
- echo Fixing $file, fabs/hypot definition
- sed \
- -e 's/extern double floor(), ceil(), fmod(), fabs();/extern double floor(), ceil(), fmod(), fabs _PARAMS((double));/' \
- -e '/^extern double hypot();$/a\
-\/* Workaround a stupid Motorola optimization if one\
- of x or y is 0.0 and the other is negative! *\/\
-#ifdef __STDC__\
-static __inline__ double fake_hypot (double x, double y)\
-#else\
-static __inline__ double fake_hypot (x, y)\
- double x, y;\
-#endif\
-{\
- return fabs (hypot (x, y));\
-}\
-#define hypot fake_hypot
-' \
- ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm -f ${LIB}/$file
- fi
- fi
-fi
-
-# math.h on SunOS 4 puts the declaration of matherr before the definition
-# of struct exception, so the prototype (added by fixproto) causes havoc.
-file=math.h
-if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
-fi
-
-if [ -r ${LIB}/$file ]; then
- echo Fixing $file, matherr declaration
- sed -e '/^struct exception/,$b' \
- -e '/matherr/i\
-struct exception;
-'\
- ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm -f ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
-fi
-
-# sys/mman.h on HP/UX is not C++ ready, even though
-# NO_IMPLICIT_EXTERN_C is defined on HP/UX.
-for file in sys/mman.h; do
- if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
- fi
-
- if [ -r ${LIB}/$file ]; then
- if egrep '"C"' ${LIB}/$file >/dev/null 2>&1 \
- || egrep '__BEGIN_DECLS' ${LIB}/$file >/dev/null 2>&1; then
- true
- else
- echo Fixing $file
- echo '#ifdef __cplusplus
-extern "C" {
-#endif' > ${LIB}/${file}.sed
- cat ${LIB}/${file} >> ${LIB}/${file}.sed
- echo '#ifdef __cplusplus
-}
-#endif' >> ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- fi
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm -f ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
- fi
-done
-
-# Fix return value of sbrk in unistd.h on Alpha OSF/1 V2.0
-file=unistd.h
-if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
-fi
-
-if [ -r ${LIB}/$file ]; then
- echo Fixing $file, sbrk declaration
- sed -e 's/char\([ ]*\*[ ]*sbrk[ ]*(\)/void\1/' \
- ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm -f ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
-fi
-
-# Fix <c_asm.h> on Digital UNIX V4.0:
-# It contains a prototype for a DEC C internal asm() function, clashing with
-# gcc's asm keyword. So protect this with __DECC.
-file=c_asm.h
-if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
-fi
-
-if [ -r ${LIB}/$file ]; then
- echo Fixing $file
- sed -e '/^[ ]*float[ ]*fasm/i\
-#ifdef __DECC
-' \
- -e '/^[ ]*#[ ]*pragma[ ]*intrinsic([ ]*dasm/a\
-#endif
-' ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
-fi
-
-# This file on SunOS 4 has a very large macro. When the sed loop
-# tries pull it in, it overflows the pattern space size of the SunOS
-# sed (GNU sed does not have this problem). Since the file does not
-# require fixing, we remove it from the fixed directory.
-file=sundev/ipi_error.h
-if [ -r ${LIB}/$file ]; then
- echo "Removing incorrect fix to SunOS <sundev/ipi_error.h>"
- rm -f ${LIB}/$file
-fi
-
-# Put cpp wrappers around these include files to avoid redeclaration
-# errors during multiple inclusion on m88k-tektronix-sysv3.
-for file in time.h sys/time.h ; do
- if egrep '#ifndef' $file >/dev/null 2>&1; then
- true
- else
- if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- fi
- if [ -r ${LIB}/$file ]; then
- echo Fixing $file, to protect against multiple inclusion.
- cpp_wrapper=`echo $file | sed -e 's,\.,_,g' -e 's,/,_,g'`
- (echo "#ifndef __GCC_GOT_${cpp_wrapper}_"
- echo "#define __GCC_GOT_${cpp_wrapper}_"
- cat ${LIB}/${file}
- echo '#endif /* !_GCC_GOT_'${cpp_wrapper}_' */') > ${LIB}/${file}.new
- rm -f ${LIB}/$file; mv ${LIB}/${file}.new ${LIB}/$file
- fi
- fi
-done
-
-# Fix fcntl prototype in fcntl.h on LynxOS.
-file=fcntl.h
-if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
-fi
-
-if [ -r ${LIB}/$file ]; then
- echo Fixing $file, fcntl declaration
- sed -e 's/\(fcntl.*(int, int, \)int)/\1...)/' \
- ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm -f ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
-fi
-
-# Fix definitions of macros used by va-i960.h in VxWorks header file.
-file=arch/i960/archI960.h
-if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
-fi
-
-if [ -r ${LIB}/$file ]; then
- echo Fixing $file
- sed -e 's/__vsiz/__vxvsiz/' -e 's/__vali/__vxvali/' \
- -e s'/__vpad/__vxvpad/' -e 's/__alignof__/__vxalignof__/' \
- ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm -f ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
-fi
-
-# Make VxWorks header which is almost gcc ready fully gcc ready.
-file=types/vxTypesBase.h
-if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
-fi
-
-if [ -r ${LIB}/$file ]; then
- echo Fixing $file
- sed -e 's/#ifdef __GNUC_TYPEOF_FEATURE_BROKEN_USE_DEFAULT_UNTIL_FIXED__/#if 1/' \
- -e '/[ ]size_t/i\
-#ifndef _GCC_SIZE_T\
-#define _GCC_SIZE_T
-' \
- -e '/[ ]size_t/a\
-#endif
-' \
- -e '/[ ]ptrdiff_t/i\
-#ifndef _GCC_PTRDIFF_T\
-#define _GCC_PTRDIFF_T
-' \
- -e '/[ ]ptrdiff_t/a\
-#endif
-' \
- -e '/[ ]wchar_t/i\
-#ifndef _GCC_WCHAR_T\
-#define _GCC_WCHAR_T
-' \
- -e '/[ ]wchar_t/a\
-#endif
-' \
- ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm -f ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
-fi
-
-# Fix VxWorks <sys/stat.h> to not require including <vxWorks.h>.
-file=sys/stat.h
-if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- mkdir ${LIB}/sys 2>/dev/null
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
-fi
-
-if [ -r ${LIB}/$file ]; then
- if egrep '#include' ${LIB}/$file >/dev/null 2>&1; then
- :
- else
- if egrep 'ULONG' ${LIB}/$file >/dev/null 2>&1 \
- && [ -r types/vxTypesOld.h ]; then
- echo Fixing $file
- sed -e '/#define[ ][ ]*__INCstath/a\
-#include <types/vxTypesOld.h>
-' \
- ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- fi
- fi
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm -f ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
-fi
-
-# Fix VxWorks <time.h> to not require including <vxTypes.h>.
-file=time.h
-if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- mkdir ${LIB}/sys 2>/dev/null
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
-fi
-
-if [ -r ${LIB}/$file ]; then
- if egrep 'uint_t[ ][ ]*_clocks_per_sec' ${LIB}/$file >/dev/null 2>&1; then
- echo Fixing $file
- sed -e 's/uint_t/unsigned int/' ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- fi
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm -f ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
-fi
-
-# Fix hpux10.20 <sys/time.h> to avoid invalid forward decl
-file=sys/time.h
-if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- mkdir ${LIB}/sys 2>/dev/null
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
-fi
-
-if [ -r ${LIB}/$file ]; then
- if egrep '^extern struct sigevent;' ${LIB}/$file >/dev/null 2>&1; then
- echo Fixing $file
- sed -e 's/^extern struct sigevent;/struct sigevent;/' ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- fi
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm -f ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
-fi
-
-# Another bad dependency in VxWorks 5.2 <time.h>.
-file=time.h
-if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- mkdir ${LIB}/sys 2>/dev/null
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
-fi
-
-if [ -r ${LIB}/$file ]; then
- if egrep VOIDFUNCPTR ${LIB}/$file >/dev/null 2>&1; then
- if [ -r vxWorks.h ]; then
- echo Fixing $file
- sed -e '/VOIDFUNCPTR/i\
-#ifndef __gcc_VOIDFUNCPTR_defined\
-#ifdef __cplusplus\
-typedef void (*__gcc_VOIDFUNCPTR) (...);\
-#else\
-typedef void (*__gcc_VOIDFUNCPTR) ();\
-#endif\
-#define __gcc_VOIDFUNCPTR_defined\
-#endif
-' \
- -e 's/VOIDFUNCPTR/__gcc_VOIDFUNCPTR/g' \
- ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- fi
- fi
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm -f ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
-fi
-
-# This file in A/UX 3.0.x/3.1.x contains an __asm directive for c89; gcc
-# doesn't understand it.
-file=sys/param.h
-if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
-fi
-
-if [ -r ${LIB}/$file ]; then
- echo "Fixing __asm directive in sys/param.h"
- sed -e 's|#ifndef NOINLINE|#if !defined(NOINLINE) \&\& !defined(__GNUC__)|' \
- ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm -f ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
-fi
-
-# signal.h on SunOS defines signal using (), which causes trouble when
-# compiling with g++ -pedantic.
-for file in signal.h sys/signal.h; do
- if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
- fi
-
- if [ -r ${LIB}/$file ]; then
- echo "Checking for bad C++ prototype in $file"
- sed -e '/^void (\*signal())();$/i\
- #ifdef __cplusplus\
- void (*signal(...))(...);\
- #else
- ' \
- -e '/^void (\*signal())();$/a\
- #endif
- ' \
- ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm -f ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
- fi
-done
-
-# sys/signal.h on some versions of AIX uses volatile in the typedef of
-# sig_atomic_t, which causes gcc to generate a warning about duplicate
-# volatile when a sig_atomic_t variable is declared volatile, as
-# required by ANSI C.
-file=sys/signal.h
-if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
-fi
-
-if [ -r ${LIB}/$file ]; then
- echo "Checking for duplicate volatile in sys/signal.h"
- sed -e 's/typedef volatile int sig_atomic_t/typedef int sig_atomic_t/' \
- ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm -f ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
-fi
-
-# Some math.h files define struct exception, which conflicts with
-# the class exception defined in the C++ file std/stdexcept.h. We
-# redefine it to __math_exception. This is not a great fix, but I
-# haven't been able to think of anything better.
-file=math.h
-if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
-fi
-
-if [ -r ${LIB}/$file ]; then
- echo Fixing $file, exception
- sed -e '/struct exception/i\
-#ifdef __cplusplus\
-#define exception __math_exception\
-#endif
-'\
- -e '/struct exception/a\
-#ifdef __cplusplus\
-#undef exception\
-#endif
-' ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- if egrep 'matherr()' ${LIB}/$file >/dev/null 2>&1; then
- sed -e '/matherr/i\
-#ifdef __cplusplus\
-#define exception __math_exception\
-#endif
-'\
- -e '/matherr/a\
-#ifdef __cplusplus\
-#undef exception\
-#endif
-' ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- fi
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm -f ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
-fi
-
-# rpc/auth.h on SunOS needs prototypes for its AUTH->auth_ops function pointers
-# Similarly for
-# rpc/clnt.h CLIENT->clnt_ops
-# rpc/svc.h SVCXPRT->xp_ops
-# rpc/xdr.h XDR->xdr_ops
-for file in rpc/auth.h rpc/clnt.h rpc/svc.h rpc/xdr.h; do
- # each file has a different name to replace, so if you add a file to
- # that list please update the following case statement.
- case "$file" in
- rpc/auth.h)
- prefix="ah_"
- ;;
- rpc/clnt.h)
- prefix="cl_"
- ;;
- rpc/svc.h)
- prefix="xp_"
- ;;
- rpc/xdr.h)
- prefix="x_"
- ;;
- *)
- # Oh Oh, we shouldn't be here
- exit 1;
- ;;
- esac
-
- if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
- fi
-
- if [ -r ${LIB}/$file ]; then
- echo "Checking for needed C++ prototype in $file"
- sed -e 's/^\(.*\)\*\('$prefix'.*\)();\(.*\)/\
-#ifdef __cplusplus\
-\1*\2(...);\3\
-#else\
-\1*\2();\3\
-#endif/g' \
- $LIB/$file > ${LIB}/${file}.sed
-
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm -f ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
- fi
-done
-
-# sys/lc_core.h on some versions of OSF1/4.x pollutes the namespace by
-# defining regex.h types. This causes C++ library build and usage failures.
-# Fixing this correctly requires checking and modifying 3 files.
-for file in reg_types.h regex.h sys/lc_core.h; do
- if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
- fi
-done
-if [ -r ${LIB}/reg_types.h ]; then
- if egrep '} regex_t;' ${LIB}/reg_types.h >/dev/null 2>&1; then
- if [ -r ${LIB}/sys/lc_core.h ]; then
- if egrep ' regex_t ' ${LIB}/sys/lc_core.h >/dev/null 2>&1; then
- if [ -r ${LIB}/regex.h ]; then
- if egrep '__regex_t' ${LIB}/regex.h >/dev/null 2>&1; then
- true;
- else
- echo Fixing reg_types.h, regex.h, sys/lc_core.h
- for file in reg_types.h sys/lc_core.h; do
- sed -e 's/regex_t/__regex_t/g' \
- -e 's/regoff_t/__regoff_t/g' \
- -e 's/regmatch_t/__regmatch_t/g' \
- ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- done
- sed -e '/#include <reg_types.h>/a\
-typedef __regex_t regex_t;\
-typedef __regoff_t regoff_t;\
-typedef __regmatch_t regmatch_t;\
-' \
- ${LIB}/regex.h > ${LIB}/regex.h.sed
- rm -f ${LIB}/regex.h; mv ${LIB}/regex.h.sed ${LIB}/regex.h
- fi
- fi
- fi
- fi
- fi
-fi
-for file in reg_types.h regex.h sys/lc_core.h; do
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm -f ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
-done
-
-# AIX headers define NULL to be cast to a void pointer, which is illegal
-# in ANSI C++.
-for file in curses.h dbm.h locale.h stdio.h stdlib.h string.h time.h unistd.h sys/dir.h sys/param.h sys/types.h ; do
- if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
- cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
- chmod +w ${LIB}/$file 2>/dev/null
- chmod a+r ${LIB}/$file 2>/dev/null
- fi
-
- if [ -r ${LIB}/$file ]; then
- if egrep '#.*define.*NULL.*void' ${LIB}/$file >/dev/null 2>&1; then
- echo "Fixing $file, bad NULL macro"
- sed -e 's/^#[ ]*define[ ]*NULL[ ]*((void[ ]*\*)0)/#define NULL 0/' \
- ${LIB}/$file > ${LIB}/${file}.sed
- rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
- if cmp $file ${LIB}/$file >/dev/null 2>&1; then
- rm -f ${LIB}/$file
- else
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
- fi
- fi
-done
-
-# HPUX 10.x sys/param.h defines MAXINT which clashes with values.h
-file=sys/param.h
-base=`basename $file`
-if [ -r ${LIB}/$file ]; then
- file_to_fix=${LIB}/$file
-else
- if [ -r ${INPUT}/$file ]; then
- file_to_fix=${INPUT}/$file
- else
- file_to_fix=""
- fi
-fi
-if [ \! -z "$file_to_fix" ]; then
- echo Checking $file_to_fix
- sed -e '/^#[ ]*define[ ]*MAXINT[ ]/i\
-#ifndef MAXINT
-'\
- -e '/^#[ ]*define[ ]*MAXINT[ ]/a\
-#endif
-' $file_to_fix > /tmp/$base
- if cmp $file_to_fix /tmp/$base >/dev/null 2>&1; then \
- true
- else
- echo Fixed $file_to_fix
- rm -f ${LIB}/$file
- cp /tmp/$base ${LIB}/$file
- chmod a+r ${LIB}/$file
- # Find any include directives that use "file".
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $file | sed -e s'|/[^/]*$||'`
- required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
- done
- fi
- rm -f /tmp/$base
-fi
-
-
-# This loop does not appear to do anything, because it uses file
-# rather than $file when setting target. It also appears to be
-# unnecessary, since the main loop processes symbolic links.
-#if $LINKS; then
-# echo 'Making internal symbolic non-directory links'
-# cd ${INPUT}
-# files=`find . -type l -print`
-# for file in $files; do
-# dest=`ls -ld $file | sed -n 's/.*-> //p'`
-# if expr "$dest" : '[^/].*' > /dev/null; then
-# target=${LIB}/`echo file | sed "s|[^/]*\$|$dest|"`
-# if [ -f $target ]; then
-# ln -s $dest ${LIB}/$file >/dev/null 2>&1
-# fi
-# fi
-# done
-#fi
-
-# Make sure that any include files referenced using double quotes
-# exist in the fixed directory. This comes last since otherwise
-# we might end up deleting some of these files "because they don't
-# need any change."
-set x $required
-shift
-while [ $# != 0 ]; do
- newreq=
- while [ $# != 0 ]; do
- # $1 is the directory to copy from, $2 is the unfixed file,
- # $3 is the fixed file name.
- cd ${INPUT}
- cd $1
- if [ -r $2 ] && [ ! -r $3 ]; then
- cp $2 $3 >/dev/null 2>&1 || echo "Can't copy $2"
- chmod +w $3 2>/dev/null
- chmod a+r $3 2>/dev/null
- echo Copied $2
- for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' $3 | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
- dir=`echo $2 | sed -e s'|/[^/]*$||'`
- dir2=`echo $3 | sed -e s'|/[^/]*$||'`
- newreq="$newreq $1 $dir/$include $dir2/$include"
- done
- fi
- shift; shift; shift
- done
- set x $newreq
- shift
-done
-
-echo 'Cleaning up DONE files.'
-cd $LIB
-find . -name DONE -exec rm -f '{}' ';'
-
-echo 'Removing unneeded directories:'
-cd $LIB
-files=`find . -type d \! -name '.' -print | sort -r`
-for file in $files; do
- rmdir $LIB/$file > /dev/null 2>&1
-done
-
-# # # # # # # # # # # # # # # # # # # # #
-#
-# End of for INPUT directories
-#
-done
-#
-# # # # # # # # # # # # # # # # # # # # #
-
-cd $ORIGDIR
-rm -f include/assert.h
-cp ${srcdir}/assert.h include/assert.h || exit 1
-chmod a+r include/assert.h
-
-exit 0
diff --git a/contrib/gcc/frame.c b/contrib/gcc/frame.c
deleted file mode 100644
index 990a0ac81174..000000000000
--- a/contrib/gcc/frame.c
+++ /dev/null
@@ -1,872 +0,0 @@
-/* Subroutines needed for unwinding stack frames for exception handling. */
-/* Compile this one with gcc. */
-/* Copyright (C) 1997, 1998, 2000 Free Software Foundation, Inc.
- Contributed by Jason Merrill <jason@cygnus.com>.
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library does not by itself 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. */
-
-/* It is incorrect to include config.h here, because this file is being
- compiled for the target, and hence definitions concerning only the host
- do not apply. */
-
-#include "tconfig.h"
-
-/* We disable this when inhibit_libc, so that gcc can still be built without
- needing header files first. */
-/* ??? This is not a good solution, since prototypes may be required in
- some cases for correct code. See also libgcc2.c. */
-#ifndef inhibit_libc
-/* fixproto guarantees these system headers exist. */
-#include <stdlib.h>
-#include <unistd.h>
-#endif
-
-#include "defaults.h"
-
-#ifdef DWARF2_UNWIND_INFO
-#include "dwarf2.h"
-#include <stddef.h>
-#include "frame.h"
-#include "gthr.h"
-
-#ifdef __GTHREAD_MUTEX_INIT
-static __gthread_mutex_t object_mutex = __GTHREAD_MUTEX_INIT;
-#else
-static __gthread_mutex_t object_mutex;
-#endif
-
-/* Don't use `fancy_abort' here even if config.h says to use it. */
-#ifdef abort
-#undef abort
-#endif
-
-/* Some types used by the DWARF 2 spec. */
-
-typedef int sword __attribute__ ((mode (SI)));
-typedef unsigned int uword __attribute__ ((mode (SI)));
-typedef unsigned int uaddr __attribute__ ((mode (pointer)));
-typedef int saddr __attribute__ ((mode (pointer)));
-typedef unsigned char ubyte;
-
-/* Terminology:
- CIE - Common Information Element
- FDE - Frame Descriptor Element
-
- There is one per function, and it describes where the function code
- is located, and what the register lifetimes and stack layout are
- within the function.
-
- The data structures are defined in the DWARF specfication, although
- not in a very readable way (see LITERATURE).
-
- Every time an exception is thrown, the code needs to locate the FDE
- for the current function, and starts to look for exception regions
- from that FDE. This works in a two-level search:
- a) in a linear search, find the shared image (i.e. DLL) containing
- the PC
- b) using the FDE table for that shared object, locate the FDE using
- binary search (which requires the sorting). */
-
-/* The first few fields of a CIE. The CIE_id field is 0 for a CIE,
- to distinguish it from a valid FDE. FDEs are aligned to an addressing
- unit boundary, but the fields within are unaligned. */
-
-struct dwarf_cie {
- uword length;
- sword CIE_id;
- ubyte version;
- char augmentation[0];
-} __attribute__ ((packed, aligned (__alignof__ (void *))));
-
-/* The first few fields of an FDE. */
-
-struct dwarf_fde {
- uword length;
- sword CIE_delta;
- void* pc_begin;
- uaddr pc_range;
-} __attribute__ ((packed, aligned (__alignof__ (void *))));
-
-typedef struct dwarf_fde fde;
-
-/* Objects to be searched for frame unwind info. */
-
-static struct object *objects;
-
-/* The information we care about from a CIE. */
-
-struct cie_info {
- char *augmentation;
- void *eh_ptr;
- int code_align;
- int data_align;
- unsigned ra_regno;
-};
-
-/* The current unwind state, plus a saved copy for DW_CFA_remember_state. */
-
-struct frame_state_internal
-{
- struct frame_state s;
- struct frame_state_internal *saved_state;
-};
-
-/* This is undefined below if we need it to be an actual function. */
-#define init_object_mutex_once()
-
-#if __GTHREADS
-#ifdef __GTHREAD_MUTEX_INIT_FUNCTION
-
-/* Helper for init_object_mutex_once. */
-
-static void
-init_object_mutex (void)
-{
- __GTHREAD_MUTEX_INIT_FUNCTION (&object_mutex);
-}
-
-/* Call this to arrange to initialize the object mutex. */
-
-#undef init_object_mutex_once
-static void
-init_object_mutex_once (void)
-{
- static __gthread_once_t once = __GTHREAD_ONCE_INIT;
- __gthread_once (&once, init_object_mutex);
-}
-
-#endif /* __GTHREAD_MUTEX_INIT_FUNCTION */
-#endif /* __GTHREADS */
-
-/* Decode the unsigned LEB128 constant at BUF into the variable pointed to
- by R, and return the new value of BUF. */
-
-static void *
-decode_uleb128 (unsigned char *buf, unsigned *r)
-{
- unsigned shift = 0;
- unsigned result = 0;
-
- while (1)
- {
- unsigned byte = *buf++;
- result |= (byte & 0x7f) << shift;
- if ((byte & 0x80) == 0)
- break;
- shift += 7;
- }
- *r = result;
- return buf;
-}
-
-/* Decode the signed LEB128 constant at BUF into the variable pointed to
- by R, and return the new value of BUF. */
-
-static void *
-decode_sleb128 (unsigned char *buf, int *r)
-{
- unsigned shift = 0;
- unsigned result = 0;
- unsigned byte;
-
- while (1)
- {
- byte = *buf++;
- result |= (byte & 0x7f) << shift;
- shift += 7;
- if ((byte & 0x80) == 0)
- break;
- }
- if (shift < (sizeof (*r) * 8) && (byte & 0x40) != 0)
- result |= - (1 << shift);
-
- *r = result;
- return buf;
-}
-
-/* Read unaligned data from the instruction buffer. */
-
-union unaligned {
- void *p;
- unsigned b2 __attribute__ ((mode (HI)));
- unsigned b4 __attribute__ ((mode (SI)));
- unsigned b8 __attribute__ ((mode (DI)));
-} __attribute__ ((packed));
-static inline void *
-read_pointer (void *p)
-{ union unaligned *up = p; return up->p; }
-static inline unsigned
-read_1byte (void *p)
-{ return *(unsigned char *)p; }
-static inline unsigned
-read_2byte (void *p)
-{ union unaligned *up = p; return up->b2; }
-static inline unsigned
-read_4byte (void *p)
-{ union unaligned *up = p; return up->b4; }
-static inline unsigned long
-read_8byte (void *p)
-{ union unaligned *up = p; return up->b8; }
-
-/* Ordering function for FDEs. Functions can't overlap, so we just compare
- their starting addresses. */
-
-static inline saddr
-fde_compare (fde *x, fde *y)
-{
- return (saddr)x->pc_begin - (saddr)y->pc_begin;
-}
-
-/* Return the address of the FDE after P. */
-
-static inline fde *
-next_fde (fde *p)
-{
- return (fde *)(((char *)p) + p->length + sizeof (p->length));
-}
-
-/* Sorting an array of FDEs by address.
- (Ideally we would have the linker sort the FDEs so we don't have to do
- it at run time. But the linkers are not yet prepared for this.) */
-
-/* This is a special mix of insertion sort and heap sort, optimized for
- the data sets that actually occur. They look like
- 101 102 103 127 128 105 108 110 190 111 115 119 125 160 126 129 130.
- I.e. a linearly increasing sequence (coming from functions in the text
- section), with additionally a few unordered elements (coming from functions
- in gnu_linkonce sections) whose values are higher than the values in the
- surrounding linear sequence (but not necessarily higher than the values
- at the end of the linear sequence!).
- The worst-case total run time is O(N) + O(n log (n)), where N is the
- total number of FDEs and n is the number of erratic ones. */
-
-typedef struct fde_vector
-{
- fde **array;
- size_t count;
-} fde_vector;
-
-typedef struct fde_accumulator
-{
- fde_vector linear;
- fde_vector erratic;
-} fde_accumulator;
-
-static inline void
-start_fde_sort (fde_accumulator *accu, size_t count)
-{
- accu->linear.array = (fde **) malloc (sizeof (fde *) * count);
- accu->erratic.array = (fde **) malloc (sizeof (fde *) * count);
- accu->linear.count = 0;
- accu->erratic.count = 0;
-}
-
-static inline void
-fde_insert (fde_accumulator *accu, fde *this_fde)
-{
- accu->linear.array[accu->linear.count++] = this_fde;
-}
-
-/* Split LINEAR into a linear sequence with low values and an erratic
- sequence with high values, put the linear one (of longest possible
- length) into LINEAR and the erratic one into ERRATIC. This is O(N). */
-static inline void
-fde_split (fde_vector *linear, fde_vector *erratic)
-{
- size_t count = linear->count;
- size_t linear_max = (size_t) -1;
- size_t previous_max[count];
- size_t i, j;
-
- for (i = 0; i < count; i++)
- {
- for (j = linear_max;
- j != (size_t) -1
- && fde_compare (linear->array[i], linear->array[j]) < 0;
- j = previous_max[j])
- {
- erratic->array[erratic->count++] = linear->array[j];
- linear->array[j] = (fde *) NULL;
- }
- previous_max[i] = j;
- linear_max = i;
- }
-
- for (i = 0, j = 0; i < count; i++)
- if (linear->array[i] != (fde *) NULL)
- linear->array[j++] = linear->array[i];
- linear->count = j;
-}
-
-/* This is O(n log(n)). BSD/OS defines heapsort in stdlib.h, so we must
- use a name that does not conflict. */
-static inline void
-frame_heapsort (fde_vector *erratic)
-{
- /* For a description of this algorithm, see:
- Samuel P. Harbison, Guy L. Steele Jr.: C, a reference manual, 2nd ed.,
- p. 60-61. */
- fde ** a = erratic->array;
- /* A portion of the array is called a "heap" if for all i>=0:
- If i and 2i+1 are valid indices, then a[i] >= a[2i+1].
- If i and 2i+2 are valid indices, then a[i] >= a[2i+2]. */
-#define SWAP(x,y) do { fde * tmp = x; x = y; y = tmp; } while (0)
- size_t n = erratic->count;
- size_t m = n;
- size_t i;
-
- while (m > 0)
- {
- /* Invariant: a[m..n-1] is a heap. */
- m--;
- for (i = m; 2*i+1 < n; )
- {
- if (2*i+2 < n
- && fde_compare (a[2*i+2], a[2*i+1]) > 0
- && fde_compare (a[2*i+2], a[i]) > 0)
- {
- SWAP (a[i], a[2*i+2]);
- i = 2*i+2;
- }
- else if (fde_compare (a[2*i+1], a[i]) > 0)
- {
- SWAP (a[i], a[2*i+1]);
- i = 2*i+1;
- }
- else
- break;
- }
- }
- while (n > 1)
- {
- /* Invariant: a[0..n-1] is a heap. */
- n--;
- SWAP (a[0], a[n]);
- for (i = 0; 2*i+1 < n; )
- {
- if (2*i+2 < n
- && fde_compare (a[2*i+2], a[2*i+1]) > 0
- && fde_compare (a[2*i+2], a[i]) > 0)
- {
- SWAP (a[i], a[2*i+2]);
- i = 2*i+2;
- }
- else if (fde_compare (a[2*i+1], a[i]) > 0)
- {
- SWAP (a[i], a[2*i+1]);
- i = 2*i+1;
- }
- else
- break;
- }
- }
-#undef SWAP
-}
-
-/* Merge V1 and V2, both sorted, and put the result into V1. */
-static void
-fde_merge (fde_vector *v1, const fde_vector *v2)
-{
- size_t i1, i2;
- fde * fde2;
-
- i2 = v2->count;
- if (i2 > 0)
- {
- i1 = v1->count;
- do {
- i2--;
- fde2 = v2->array[i2];
- while (i1 > 0 && fde_compare (v1->array[i1-1], fde2) > 0)
- {
- v1->array[i1+i2] = v1->array[i1-1];
- i1--;
- }
- v1->array[i1+i2] = fde2;
- } while (i2 > 0);
- v1->count += v2->count;
- }
-}
-
-static fde **
-end_fde_sort (fde_accumulator *accu, size_t count)
-{
- if (accu->linear.count != count)
- abort ();
- fde_split (&accu->linear, &accu->erratic);
- if (accu->linear.count + accu->erratic.count != count)
- abort ();
- frame_heapsort (&accu->erratic);
- fde_merge (&accu->linear, &accu->erratic);
- free (accu->erratic.array);
- return accu->linear.array;
-}
-
-static size_t
-count_fdes (fde *this_fde)
-{
- size_t count;
-
- for (count = 0; this_fde->length != 0; this_fde = next_fde (this_fde))
- {
- /* Skip CIEs and linked once FDE entries. */
- if (this_fde->CIE_delta == 0 || this_fde->pc_begin == 0)
- continue;
-
- ++count;
- }
-
- return count;
-}
-
-static void
-add_fdes (fde *this_fde, fde_accumulator *accu, void **beg_ptr, void **end_ptr)
-{
- void *pc_begin = *beg_ptr;
- void *pc_end = *end_ptr;
-
- for (; this_fde->length != 0; this_fde = next_fde (this_fde))
- {
- /* Skip CIEs and linked once FDE entries. */
- if (this_fde->CIE_delta == 0 || this_fde->pc_begin == 0)
- continue;
-
- fde_insert (accu, this_fde);
-
- if (this_fde->pc_begin < pc_begin)
- pc_begin = this_fde->pc_begin;
- if (this_fde->pc_begin + this_fde->pc_range > pc_end)
- pc_end = this_fde->pc_begin + this_fde->pc_range;
- }
-
- *beg_ptr = pc_begin;
- *end_ptr = pc_end;
-}
-
-/* Set up a sorted array of pointers to FDEs for a loaded object. We
- count up the entries before allocating the array because it's likely to
- be faster. */
-
-static void
-frame_init (struct object* ob)
-{
- size_t count;
- fde_accumulator accu;
- void *pc_begin, *pc_end;
-
- if (ob->fde_array)
- {
- fde **p = ob->fde_array;
- for (count = 0; *p; ++p)
- count += count_fdes (*p);
- }
- else
- count = count_fdes (ob->fde_begin);
-
- ob->count = count;
-
- start_fde_sort (&accu, count);
- pc_begin = (void*)(uaddr)-1;
- pc_end = 0;
-
- if (ob->fde_array)
- {
- fde **p = ob->fde_array;
- for (; *p; ++p)
- add_fdes (*p, &accu, &pc_begin, &pc_end);
- }
- else
- add_fdes (ob->fde_begin, &accu, &pc_begin, &pc_end);
-
- ob->fde_array = end_fde_sort (&accu, count);
- ob->pc_begin = pc_begin;
- ob->pc_end = pc_end;
-}
-
-/* Return a pointer to the FDE for the function containing PC. */
-
-static fde *
-find_fde (void *pc)
-{
- struct object *ob;
- size_t lo, hi;
-
- init_object_mutex_once ();
- __gthread_mutex_lock (&object_mutex);
-
- for (ob = objects; ob; ob = ob->next)
- {
- if (ob->pc_begin == 0)
- frame_init (ob);
- if (pc >= ob->pc_begin && pc < ob->pc_end)
- break;
- }
-
- __gthread_mutex_unlock (&object_mutex);
-
- if (ob == 0)
- return 0;
-
- /* Standard binary search algorithm. */
- for (lo = 0, hi = ob->count; lo < hi; )
- {
- size_t i = (lo + hi) / 2;
- fde *f = ob->fde_array[i];
-
- if (pc < f->pc_begin)
- hi = i;
- else if (pc >= f->pc_begin + f->pc_range)
- lo = i + 1;
- else
- return f;
- }
-
- return 0;
-}
-
-static inline struct dwarf_cie *
-get_cie (fde *f)
-{
- return ((void *)&f->CIE_delta) - f->CIE_delta;
-}
-
-/* Extract any interesting information from the CIE for the translation
- unit F belongs to. */
-
-static void *
-extract_cie_info (fde *f, struct cie_info *c)
-{
- void *p;
- int i;
-
- c->augmentation = get_cie (f)->augmentation;
-
- if (strcmp (c->augmentation, "") != 0
- && strcmp (c->augmentation, "eh") != 0
- && c->augmentation[0] != 'z')
- return 0;
-
- p = c->augmentation + strlen (c->augmentation) + 1;
-
- if (strcmp (c->augmentation, "eh") == 0)
- {
- c->eh_ptr = read_pointer (p);
- p += sizeof (void *);
- }
- else
- c->eh_ptr = 0;
-
- p = decode_uleb128 (p, &c->code_align);
- p = decode_sleb128 (p, &c->data_align);
- c->ra_regno = *(unsigned char *)p++;
-
- /* If the augmentation starts with 'z', we now see the length of the
- augmentation fields. */
- if (c->augmentation[0] == 'z')
- {
- p = decode_uleb128 (p, &i);
- p += i;
- }
-
- return p;
-}
-
-/* Decode one instruction's worth of DWARF 2 call frame information.
- Used by __frame_state_for. Takes pointers P to the instruction to
- decode, STATE to the current register unwind information, INFO to the
- current CIE information, and PC to the current PC value. Returns a
- pointer to the next instruction. */
-
-static void *
-execute_cfa_insn (void *p, struct frame_state_internal *state,
- struct cie_info *info, void **pc)
-{
- unsigned insn = *(unsigned char *)p++;
- unsigned reg;
- int offset;
-
- if (insn & DW_CFA_advance_loc)
- *pc += ((insn & 0x3f) * info->code_align);
- else if (insn & DW_CFA_offset)
- {
- reg = (insn & 0x3f);
- p = decode_uleb128 (p, &offset);
- offset *= info->data_align;
- state->s.saved[reg] = REG_SAVED_OFFSET;
- state->s.reg_or_offset[reg] = offset;
- }
- else if (insn & DW_CFA_restore)
- {
- reg = (insn & 0x3f);
- state->s.saved[reg] = REG_UNSAVED;
- }
- else switch (insn)
- {
- case DW_CFA_set_loc:
- *pc = read_pointer (p);
- p += sizeof (void *);
- break;
- case DW_CFA_advance_loc1:
- *pc += read_1byte (p);
- p += 1;
- break;
- case DW_CFA_advance_loc2:
- *pc += read_2byte (p);
- p += 2;
- break;
- case DW_CFA_advance_loc4:
- *pc += read_4byte (p);
- p += 4;
- break;
-
- case DW_CFA_offset_extended:
- p = decode_uleb128 (p, &reg);
- p = decode_uleb128 (p, &offset);
- offset *= info->data_align;
- state->s.saved[reg] = REG_SAVED_OFFSET;
- state->s.reg_or_offset[reg] = offset;
- break;
- case DW_CFA_restore_extended:
- p = decode_uleb128 (p, &reg);
- state->s.saved[reg] = REG_UNSAVED;
- break;
-
- case DW_CFA_undefined:
- case DW_CFA_same_value:
- case DW_CFA_nop:
- break;
-
- case DW_CFA_register:
- {
- unsigned reg2;
- p = decode_uleb128 (p, &reg);
- p = decode_uleb128 (p, &reg2);
- state->s.saved[reg] = REG_SAVED_REG;
- state->s.reg_or_offset[reg] = reg2;
- }
- break;
-
- case DW_CFA_def_cfa:
- p = decode_uleb128 (p, &reg);
- p = decode_uleb128 (p, &offset);
- state->s.cfa_reg = reg;
- state->s.cfa_offset = offset;
- break;
- case DW_CFA_def_cfa_register:
- p = decode_uleb128 (p, &reg);
- state->s.cfa_reg = reg;
- break;
- case DW_CFA_def_cfa_offset:
- p = decode_uleb128 (p, &offset);
- state->s.cfa_offset = offset;
- break;
-
- case DW_CFA_remember_state:
- {
- struct frame_state_internal *save =
- (struct frame_state_internal *)
- malloc (sizeof (struct frame_state_internal));
- memcpy (save, state, sizeof (struct frame_state_internal));
- state->saved_state = save;
- }
- break;
- case DW_CFA_restore_state:
- {
- struct frame_state_internal *save = state->saved_state;
- memcpy (state, save, sizeof (struct frame_state_internal));
- free (save);
- }
- break;
-
- /* FIXME: Hardcoded for SPARC register window configuration. */
- case DW_CFA_GNU_window_save:
- for (reg = 16; reg < 32; ++reg)
- {
- state->s.saved[reg] = REG_SAVED_OFFSET;
- state->s.reg_or_offset[reg] = (reg - 16) * sizeof (void *);
- }
- break;
-
- case DW_CFA_GNU_args_size:
- p = decode_uleb128 (p, &offset);
- state->s.args_size = offset;
- break;
-
- case DW_CFA_GNU_negative_offset_extended:
- p = decode_uleb128 (p, &reg);
- p = decode_uleb128 (p, &offset);
- offset *= info->data_align;
- state->s.saved[reg] = REG_SAVED_OFFSET;
- state->s.reg_or_offset[reg] = -offset;
- break;
-
- default:
- abort ();
- }
- return p;
-}
-
-/* Called from crtbegin.o to register the unwind info for an object. */
-
-void
-__register_frame_info (void *begin, struct object *ob)
-{
- ob->fde_begin = begin;
-
- ob->pc_begin = ob->pc_end = 0;
- ob->fde_array = 0;
- ob->count = 0;
-
- init_object_mutex_once ();
- __gthread_mutex_lock (&object_mutex);
-
- ob->next = objects;
- objects = ob;
-
- __gthread_mutex_unlock (&object_mutex);
-}
-
-void
-__register_frame (void *begin)
-{
- struct object *ob = (struct object *) malloc (sizeof (struct object));
- __register_frame_info (begin, ob);
-}
-
-/* Similar, but BEGIN is actually a pointer to a table of unwind entries
- for different translation units. Called from the file generated by
- collect2. */
-
-void
-__register_frame_info_table (void *begin, struct object *ob)
-{
- ob->fde_begin = begin;
- ob->fde_array = begin;
-
- ob->pc_begin = ob->pc_end = 0;
- ob->count = 0;
-
- init_object_mutex_once ();
- __gthread_mutex_lock (&object_mutex);
-
- ob->next = objects;
- objects = ob;
-
- __gthread_mutex_unlock (&object_mutex);
-}
-
-void
-__register_frame_table (void *begin)
-{
- struct object *ob = (struct object *) malloc (sizeof (struct object));
- __register_frame_info_table (begin, ob);
-}
-
-/* Called from crtbegin.o to deregister the unwind info for an object. */
-
-void *
-__deregister_frame_info (void *begin)
-{
- struct object **p;
-
- init_object_mutex_once ();
- __gthread_mutex_lock (&object_mutex);
-
- p = &objects;
- while (*p)
- {
- if ((*p)->fde_begin == begin)
- {
- struct object *ob = *p;
- *p = (*p)->next;
-
- /* If we've run init_frame for this object, free the FDE array. */
- if (ob->pc_begin)
- free (ob->fde_array);
-
- __gthread_mutex_unlock (&object_mutex);
- return (void *) ob;
- }
- p = &((*p)->next);
- }
-
- __gthread_mutex_unlock (&object_mutex);
- abort ();
-}
-
-void
-__deregister_frame (void *begin)
-{
- free (__deregister_frame_info (begin));
-}
-
-/* Called from __throw to find the registers to restore for a given
- PC_TARGET. The caller should allocate a local variable of `struct
- frame_state' (declared in frame.h) and pass its address to STATE_IN. */
-
-struct frame_state *
-__frame_state_for (void *pc_target, struct frame_state *state_in)
-{
- fde *f;
- void *insn, *end, *pc;
- struct cie_info info;
- struct frame_state_internal state;
-
- f = find_fde (pc_target);
- if (f == 0)
- return 0;
-
- insn = extract_cie_info (f, &info);
- if (insn == 0)
- return 0;
-
- memset (&state, 0, sizeof (state));
- state.s.retaddr_column = info.ra_regno;
- state.s.eh_ptr = info.eh_ptr;
-
- /* First decode all the insns in the CIE. */
- end = next_fde ((fde*) get_cie (f));
- while (insn < end)
- insn = execute_cfa_insn (insn, &state, &info, 0);
-
- insn = ((fde *)f) + 1;
-
- if (info.augmentation[0] == 'z')
- {
- int i;
- insn = decode_uleb128 (insn, &i);
- insn += i;
- }
-
- /* Then the insns in the FDE up to our target PC. */
- end = next_fde (f);
- pc = f->pc_begin;
- while (insn < end && pc <= pc_target)
- insn = execute_cfa_insn (insn, &state, &info, &pc);
-
- memcpy (state_in, &state.s, sizeof (state.s));
- return state_in;
-}
-#endif /* DWARF2_UNWIND_INFO */
diff --git a/contrib/gcc/frame.h b/contrib/gcc/frame.h
deleted file mode 100644
index 985416cd1807..000000000000
--- a/contrib/gcc/frame.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/* Header file for unwinding stack frames for exception handling. */
-/* Compile this one with gcc. */
-/* Copyright (C) 1997, 1998 Free Software Foundation, Inc.
- Contributed by Jason Merrill <jason@cygnus.com>.
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-
-typedef struct frame_state
-{
- void *cfa;
- void *eh_ptr;
- long cfa_offset;
- long args_size;
- long reg_or_offset[FIRST_PSEUDO_REGISTER+1];
- unsigned short cfa_reg;
- unsigned short retaddr_column;
- char saved[FIRST_PSEUDO_REGISTER+1];
-} frame_state;
-
-/* Values for 'saved' above. */
-#define REG_UNSAVED 0
-#define REG_SAVED_OFFSET 1
-#define REG_SAVED_REG 2
-
-/* The representation for an "object" to be searched for frame unwind info.
- For targets with named sections, one object is an executable or shared
- library; for other targets, one object is one translation unit.
-
- A copy of this structure declaration is printed by collect2.c;
- keep the copies synchronized! */
-
-struct object {
- void *pc_begin;
- void *pc_end;
- struct dwarf_fde *fde_begin;
- struct dwarf_fde **fde_array;
- size_t count;
- struct object *next;
-};
-
-/* Note the following routines are exported interfaces from libgcc; do not
- change these interfaces. Instead create new interfaces. Also note
- references to these functions may be made weak in files where they
- are referenced. */
-
-extern void __register_frame (void * );
-extern void __register_frame_table (void *);
-extern void __deregister_frame (void *);
-
-/* Called either from crtbegin.o or a static constructor to register the
- unwind info for an object or translation unit, respectively. */
-
-extern void __register_frame_info (void *, struct object *);
-
-/* Similar, but BEGIN is actually a pointer to a table of unwind entries
- for different translation units. Called from the file generated by
- collect2. */
-extern void __register_frame_info_table (void *, struct object *);
-
-/* Called from crtend.o to deregister the unwind info for an object. */
-
-extern void *__deregister_frame_info (void *);
-
-/* Called from __throw to find the registers to restore for a given
- PC_TARGET. The caller should allocate a local variable of `struct
- frame_state' (declared in frame.h) and pass its address to STATE_IN.
- Returns NULL on failure, otherwise returns STATE_IN. */
-
-extern struct frame_state *__frame_state_for (void *, struct frame_state *);
diff --git a/contrib/gcc/gansidecl.h b/contrib/gcc/gansidecl.h
deleted file mode 100644
index cf7762fad6ac..000000000000
--- a/contrib/gcc/gansidecl.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/* ANSI and traditional C compatibility macros.
- Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* This file mimics some of the support provided by include/ansidecl.h
- in binutils and gdb releases.
- ??? Over time the two should be merged into one. */
-
-#ifndef __GANSIDECL_H__
-#define __GANSIDECL_H__
-
-#include "ansidecl.h"
-
-/* Undef ansidecl.h's "obsolete" version. */
-#undef PROTO
-/* These macros are deprecated, use ansidecl.h's PARAMS style instead. */
-#define PROTO(ARGS) PARAMS(ARGS)
-#define VPROTO(ARGS) VPARAMS(ARGS)
-#define PVPROTO(ARGS) PARAMS(ARGS)
-
-/* Autoconf will possibly define the `inline' or `const' keywords as
- macros, however this is only valid for the stage1 compiler. If we
- detect a modern version of gcc, unconditionally reset the values.
- This makes sure the right thing happens in stage2 and later. We
- need to do this very early; i.e. before any systems header files or
- gcc header files in case they use these keywords. Otherwise
- conflicts might occur. */
-#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
-# undef const
-# undef inline
-# define inline __inline__ /* Modern gcc can use `__inline__' freely. */
-#endif /* GCC >= 2.7 */
-
-#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
-# define __attribute__(x)
-#endif
-
-#ifndef ATTRIBUTE_UNUSED_LABEL
-# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 93)
-# define ATTRIBUTE_UNUSED_LABEL
-# else
-# define ATTRIBUTE_UNUSED_LABEL ATTRIBUTE_UNUSED
-# endif /* GNUC < 2.93 */
-#endif /* ATTRIBUTE_UNUSED_LABEL */
-
-#ifndef ATTRIBUTE_UNUSED
-#define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
-#endif /* ATTRIBUTE_UNUSED */
-
-#ifndef ATTRIBUTE_NORETURN
-#define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__))
-#endif /* ATTRIBUTE_NORETURN */
-
-#ifndef ATTRIBUTE_PRINTF
-#define ATTRIBUTE_PRINTF(m, n) __attribute__ ((format (__printf__, m, n)))
-#define ATTRIBUTE_PRINTF_1 ATTRIBUTE_PRINTF(1, 2)
-#define ATTRIBUTE_PRINTF_2 ATTRIBUTE_PRINTF(2, 3)
-#define ATTRIBUTE_PRINTF_3 ATTRIBUTE_PRINTF(3, 4)
-#define ATTRIBUTE_PRINTF_4 ATTRIBUTE_PRINTF(4, 5)
-#define ATTRIBUTE_PRINTF_5 ATTRIBUTE_PRINTF(5, 6)
-#endif /* ATTRIBUTE_PRINTF */
-
-#define GENERIC_PTR PTR
-
-#ifndef NULL_PTR
-#define NULL_PTR ((PTR) 0)
-#endif
-
-#endif /* __GANSIDECL_H__ */
diff --git a/contrib/gcc/gcc.1 b/contrib/gcc/gcc.1
deleted file mode 100644
index 74200a1a169e..000000000000
--- a/contrib/gcc/gcc.1
+++ /dev/null
@@ -1,4191 +0,0 @@
-.\" Copyright (c) 1991, 1992, 1993, 1994 Free Software Foundation -*-Text-*-
-.\" See section COPYING for conditions for redistribution
-.\"
-.\" Set up \*(lq, \*(rq if -man hasn't already set it up.
-.if @@\*(lq@ \{\
-. ds lq "
-. if t .ds lq ``
-. if !@@\(lq@ .ds lq "\(lq
-.\}
-.if @@\*(rq@ \{\
-. ds rq "
-. if t .ds rq ''
-. if !@@\(rq@ .ds rq "\(rq
-.\}
-.de Id
-.ds Rv \\$3
-.ds Dt \\$4
-..
-.de Sp
-.if n .sp
-.if t .sp 0.4
-..
-.Id $Id: gcc.1,v 1.9 1998/12/16 20:55:57 law Exp $
-.TH GCC 1 "\*(Dt" "GNU Tools" "GNU Tools"
-.SH NAME
-gcc, g++ \- GNU project C and C++ Compiler (gcc-2.95)
-.SH SYNOPSIS
-.B gcc
-.RI "[ " option " | " filename " ].\|.\|."
-.br
-.B g++
-.RI "[ " option " | " filename " ].\|.\|."
-.SH WARNING
-The information in this man page is an extract from the full
-documentation of the GNU C compiler, and is limited to the meaning of
-the options.
-.PP
-This man page is not kept up to date except when volunteers want to
-maintain it. If you find a discrepancy between the man page and the
-software, please check the Info file, which is the authoritative
-documentation.
-.PP
-If we find that the things in this man page that are out of date cause
-significant confusion or complaints, we will stop distributing the man
-page. The alternative, updating the man page when we update the Info
-file, is impossible because the rest of the work of maintaining GNU CC
-leaves us no time for that. The GNU project regards man pages as
-obsolete and should not let them take time away from other things.
-.PP
-For complete and current documentation, refer to the Info file `\|\c
-.B gcc\c
-\&\|' or the manual
-.I
-Using and Porting GNU CC (for version 2.0)\c
-\&. Both are made from the Texinfo source file
-.BR gcc.texinfo .
-.SH DESCRIPTION
-The C and C++ compilers are integrated. Both process input files
-through one or more of four stages: preprocessing, compilation,
-assembly, and linking. Source filename suffixes identify the source
-language, but which name you use for the compiler governs default
-assumptions:
-.TP
-.B gcc
-assumes preprocessed (\c
-.B .i\c
-\&) files are C and assumes C style linking.
-.TP
-.B g++
-assumes preprocessed (\c
-.B .i\c
-\&) files are C++ and assumes C++ style linking.
-.PP
-Suffixes of source file names indicate the language and kind of
-processing to be done:
-.Sp
-.nf
-.ta \w'\fB.cxx\fP 'u
-\&\fB.c\fP C source; preprocess, compile, assemble
-\&\fB.C\fP C++ source; preprocess, compile, assemble
-\&\fB.cc\fP C++ source; preprocess, compile, assemble
-\&\fB.cxx\fP C++ source; preprocess, compile, assemble
-\&\fB.m\fP Objective-C source; preprocess, compile, assemble
-\&\fB.i\fP preprocessed C; compile, assemble
-\&\fB.ii\fP preprocessed C++; compile, assemble
-\&\fB.s\fP Assembler source; assemble
-\&\fB.S\fP Assembler source; preprocess, assemble
-\&\fB.h\fP Preprocessor file; not usually named on command line
-.Sp
-.fi
-Files with other suffixes are passed to the linker. Common cases include:
-.Sp
-.nf
-\&\fB.o\fP Object file
-\&\fB.a\fP Archive file
-.br
-.fi
-.Sp
-Linking is always the last stage unless you use one of the
-.BR \-c ,
-.BR \-S ,
-or
-.B \-E
-options to avoid it (or unless compilation errors stop the whole
-process). For the link stage, all
-.B .o
-files corresponding to source files,
-.B \-l
-libraries, unrecognized filenames (including named
-.B .o
-object files and
-.B .a
-archives)
-are passed to the linker in command-line order.
-.SH OPTIONS
-Options must be separate: `\|\c
-.B \-dr\c
-\&\|' is quite different from `\|\c
-.B \-d \-r
-\&\|'.
-.PP
-Most `\|\c
-.B \-f\c
-\&\|' and `\|\c
-.B \-W\c
-\&\|' options have two contrary forms:
-.BI \-f name
-and
-.BI \-fno\- name\c
-\& (or
-.BI \-W name
-and
-.BI \-Wno\- name\c
-\&). Only the non-default forms are shown here.
-.PP
-Here is a summary of all the options, grouped by type. Explanations are
-in the following sections.
-.hy 0
-.na
-.TP
-.B Overall Options
-.br
-\-c
-\-S
-\-E
-.RI "\-o " file
-\-pipe
-\-v
-.RI "\-x " language
-.TP
-.B Language Options
-\-ansi
-\-fall\-virtual
-\-fcond\-mismatch
-\-fdollars\-in\-identifiers
-\-fenum\-int\-equiv
-\-fexternal\-templates
-\-fno\-asm
-\-fno\-builtin
-\-fhosted
-\-fno\-hosted
-\-ffreestanding
-\-fno\-freestanding
-\-fno\-strict\-prototype
-\-fsigned\-bitfields
-\-fsigned\-char
-\-fthis\-is\-variable
-\-funsigned\-bitfields
-\-funsigned\-char
-\-fwritable\-strings
-\-traditional
-\-traditional\-cpp
-\-trigraphs
-.TP
-.B Warning Options
-\-fsyntax\-only
-\-pedantic
-\-pedantic\-errors
-\-w
-\-W
-\-Wall
-\-Waggregate\-return
-\-Wcast\-align
-\-Wcast\-qual
-\-Wchar\-subscript
-\-Wcomment
-\-Wconversion
-\-Wenum\-clash
-\-Werror
-\-Wformat
-.RI \-Wid\-clash\- len
-\-Wimplicit
-\-Wimplicit\-int
-\-Wimplicit\-function\-declaration
-\-Winline
-\-Wlong\-long
-\-Wmain
-\-Wmissing\-prototypes
-\-Wmissing\-declarations
-\-Wnested\-externs
-\-Wno\-import
-\-Wparentheses
-\-Wpointer\-arith
-\-Wredundant\-decls
-\-Wreturn\-type
-\-Wshadow
-\-Wstrict\-prototypes
-\-Wswitch
-\-Wtemplate\-debugging
-\-Wtraditional
-\-Wtrigraphs
-\-Wuninitialized
-\-Wunused
-\-Wwrite\-strings
-.TP
-.B Debugging Options
-\-a
-.RI \-d letters
-\-fpretend\-float
-\-g
-.RI \-g level
-\-gcoff
-\-gxcoff
-\-gxcoff+
-\-gdwarf
-\-gdwarf+
-\-gstabs
-\-gstabs+
-\-ggdb
-\-p
-\-pg
-\-save\-temps
-.RI \-print\-file\-name= library
-\-print\-libgcc\-file\-name
-.RI \-print\-prog\-name= program
-.TP
-.B Optimization Options
-\-fcaller\-saves
-\-fcse\-follow\-jumps
-\-fcse\-skip\-blocks
-\-fdelayed\-branch
-\-felide\-constructors
-\-fexpensive\-optimizations
-\-ffast\-math
-\-ffloat\-store
-\-fforce\-addr
-\-fforce\-mem
-\-finline\-functions
-\-fkeep\-inline\-functions
-\-fmemoize\-lookups
-\-fno\-default\-inline
-\-fno\-defer\-pop
-\-fno\-function\-cse
-\-fno\-inline
-\-fno\-peephole
-\-fomit\-frame\-pointer
-\-frerun\-cse\-after\-loop
-\-fschedule\-insns
-\-fschedule\-insns2
-\-fstrength\-reduce
-\-fthread\-jumps
-\-funroll\-all\-loops
-\-funroll\-loops
-\-O
-\-O2
-\-O3
-.TP
-.B Preprocessor Options
-.RI \-A assertion
-\-C
-\-dD
-\-dM
-\-dN
-.RI \-D macro [\|= defn \|]
-\-E
-\-H
-.RI "\-idirafter " dir
-.RI "\-include " file
-.RI "\-imacros " file
-.RI "\-iprefix " file
-.RI "\-iwithprefix " dir
-\-M
-\-MD
-\-MM
-\-MMD
-\-nostdinc
-\-P
-.RI \-U macro
-\-undef
-.TP
-.B Assembler Option
-.RI \-Wa, option
-.TP
-.B Linker Options
-.RI \-l library
-\-nostartfiles
-\-nostdlib
-\-static
-\-shared
-\-symbolic
-.RI "\-Xlinker\ " option
-.RI \-Wl, option
-.RI "\-u " symbol
-.TP
-.B Directory Options
-.RI \-B prefix
-.RI \-I dir
-\-I\-
-.RI \-L dir
-.TP
-.B Target Options
-.RI "\-b " machine
-.RI "\-V " version
-.TP
-.B Configuration Dependent Options
-.I M680x0\ Options
-.br
-\-m68000
-\-m68020
-\-m68020\-40
-\-m68030
-\-m68040
-\-m68881
-\-mbitfield
-\-mc68000
-\-mc68020
-\-mfpa
-\-mnobitfield
-\-mrtd
-\-mshort
-\-msoft\-float
-.Sp
-.I VAX Options
-.br
-\-mg
-\-mgnu
-\-munix
-.Sp
-.I SPARC Options
-.br
-\-mepilogue
-\-mfpu
-\-mhard\-float
-\-mno\-fpu
-\-mno\-epilogue
-\-msoft\-float
-\-msparclite
-\-mv8
-\-msupersparc
-\-mcypress
-.Sp
-.I Convex Options
-.br
-\-margcount
-\-mc1
-\-mc2
-\-mnoargcount
-.Sp
-.I AMD29K Options
-.br
-\-m29000
-\-m29050
-\-mbw
-\-mdw
-\-mkernel\-registers
-\-mlarge
-\-mnbw
-\-mnodw
-\-msmall
-\-mstack\-check
-\-muser\-registers
-.Sp
-.I M88K Options
-.br
-\-m88000
-\-m88100
-\-m88110
-\-mbig\-pic
-\-mcheck\-zero\-division
-\-mhandle\-large\-shift
-\-midentify\-revision
-\-mno\-check\-zero\-division
-\-mno\-ocs\-debug\-info
-\-mno\-ocs\-frame\-position
-\-mno\-optimize\-arg\-area
-\-mno\-serialize\-volatile
-\-mno\-underscores
-\-mocs\-debug\-info
-\-mocs\-frame\-position
-\-moptimize\-arg\-area
-\-mserialize\-volatile
-.RI \-mshort\-data\- num
-\-msvr3
-\-msvr4
-\-mtrap\-large\-shift
-\-muse\-div\-instruction
-\-mversion\-03.00
-\-mwarn\-passed\-structs
-.Sp
-.I RS6000 Options
-.br
-\-mfp\-in\-toc
-\-mno\-fop\-in\-toc
-.Sp
-.I RT Options
-.br
-\-mcall\-lib\-mul
-\-mfp\-arg\-in\-fpregs
-\-mfp\-arg\-in\-gregs
-\-mfull\-fp\-blocks
-\-mhc\-struct\-return
-\-min\-line\-mul
-\-mminimum\-fp\-blocks
-\-mnohc\-struct\-return
-.Sp
-.I MIPS Options
-.br
-\-mcpu=\fIcpu type\fP
-\-mips2
-\-mips3
-\-mint64
-\-mlong64
-\-mlonglong128
-\-mmips\-as
-\-mgas
-\-mrnames
-\-mno\-rnames
-\-mgpopt
-\-mno\-gpopt
-\-mstats
-\-mno\-stats
-\-mmemcpy
-\-mno\-memcpy
-\-mno\-mips\-tfile
-\-mmips\-tfile
-\-msoft\-float
-\-mhard\-float
-\-mabicalls
-\-mno\-abicalls
-\-mhalf\-pic
-\-mno\-half\-pic
-\-G \fInum\fP
-\-nocpp
-.Sp
-.I i386 Options
-.br
-\-m486
-\-mno\-486
-\-msoft\-float
-\-mno\-fp\-ret\-in\-387
-.Sp
-.I HPPA Options
-.br
-\-mpa\-risc\-1\-0
-\-mpa\-risc\-1\-1
-\-mkernel
-\-mshared\-libs
-\-mno\-shared\-libs
-\-mlong\-calls
-\-mdisable\-fpregs
-\-mdisable\-indexing
-\-mtrailing\-colon
-.Sp
-.I i960 Options
-.br
-\-m\fIcpu-type\fP
-\-mnumerics
-\-msoft\-float
-\-mleaf\-procedures
-\-mno\-leaf\-procedures
-\-mtail\-call
-\-mno\-tail\-call
-\-mcomplex\-addr
-\-mno\-complex\-addr
-\-mcode\-align
-\-mno\-code\-align
-\-mic\-compat
-\-mic2.0\-compat
-\-mic3.0\-compat
-\-masm\-compat
-\-mintel\-asm
-\-mstrict\-align
-\-mno\-strict\-align
-\-mold\-align
-\-mno\-old\-align
-.Sp
-.I DEC Alpha Options
-.br
-\-mfp\-regs
-\-mno\-fp\-regs
-\-mno\-soft\-float
-\-msoft\-float
-.Sp
-.I System V Options
-.br
-\-G
-\-Qy
-\-Qn
-.RI \-YP, paths
-.RI \-Ym, dir
-.TP
-.B Code Generation Options
-.RI \-fcall\-saved\- reg
-.RI \-fcall\-used\- reg
-.RI \-ffixed\- reg
-\-finhibit\-size\-directive
-\-fnonnull\-objects
-\-fno\-common
-\-fno\-ident
-\-fno\-gnu\-linker
-\-fpcc\-struct\-return
-\-fpic
-\-fPIC
-\-freg\-struct\-return
-\-fshared\-data
-\-fshort\-enums
-\-fshort\-double
-\-fvolatile
-\-fvolatile\-global
-\-fverbose\-asm
-.ad b
-.hy 1
-.SH OVERALL OPTIONS
-.TP
-.BI "\-x " "language"
-Specify explicitly the
-.I language\c
-\& for the following input files (rather than choosing a default based
-on the file name suffix) . This option applies to all following input
-files until the next `\|\c
-.B \-x\c
-\&\|' option. Possible values of \c
-.I language\c
-\& are
-`\|\c
-.B c\c
-\&\|', `\|\c
-.B objective\-c\c
-\&\|', `\|\c
-.B c\-header\c
-\&\|', `\|\c
-.B c++\c
-\&\|',
-`\|\c
-.B cpp\-output\c
-\&\|', `\|\c
-.B assembler\c
-\&\|', and `\|\c
-.B assembler\-with\-cpp\c
-\&\|'.
-.TP
-.B \-x none
-Turn off any specification of a language, so that subsequent files are
-handled according to their file name suffixes (as they are if `\|\c
-.B \-x\c
-\&\|'
-has not been used at all).
-.PP
-If you want only some of the four stages (preprocess, compile,
-assemble, link), you can use
-`\|\c
-.B \-x\c
-\&\|' (or filename suffixes) to tell \c
-.B gcc\c
-\& where to start, and
-one of the options `\|\c
-.B \-c\c
-\&\|', `\|\c
-.B \-S\c
-\&\|', or `\|\c
-.B \-E\c
-\&\|' to say where
-.B gcc\c
-\& is to stop. Note that some combinations (for example,
-`\|\c
-.B \-x cpp\-output \-E\c
-\&\|') instruct \c
-.B gcc\c
-\& to do nothing at all.
-.TP
-.B \-c
-Compile or assemble the source files, but do not link. The compiler
-output is an object file corresponding to each source file.
-.Sp
-By default, GCC makes the object file name for a source file by replacing
-the suffix `\|\c
-.B .c\c
-\&\|', `\|\c
-.B .i\c
-\&\|', `\|\c
-.B .s\c
-\&\|', etc., with `\|\c
-.B .o\c
-\&\|'. Use
-.B \-o\c
-\& to select another name.
-.Sp
-GCC ignores any unrecognized input files (those that do not require
-compilation or assembly) with the
-.B \-c
-option.
-.TP
-.B \-S
-Stop after the stage of compilation proper; do not assemble. The output
-is an assembler code file for each non-assembler input
-file specified.
-.Sp
-By default, GCC makes the assembler file name for a source file by
-replacing the suffix `\|\c
-.B .c\c
-\&\|', `\|\c
-.B .i\c
-\&\|', etc., with `\|\c
-.B .s\c
-\&\|'. Use
-.B \-o\c
-\& to select another name.
-.Sp
-GCC ignores any input files that don't require compilation.
-.TP
-.B \-E
-Stop after the preprocessing stage; do not run the compiler proper. The
-output is preprocessed source code, which is sent to the
-standard output.
-.Sp
-GCC ignores input files which don't require preprocessing.
-.TP
-.BI "\-o " file
-Place output in file \c
-.I file\c
-\&. This applies regardless to whatever
-sort of output GCC is producing, whether it be an executable file,
-an object file, an assembler file or preprocessed C code.
-.Sp
-Since only one output file can be specified, it does not make sense to
-use `\|\c
-.B \-o\c
-\&\|' when compiling more than one input file, unless you are
-producing an executable file as output.
-.Sp
-If you do not specify `\|\c
-.B \-o\c
-\&\|', the default is to put an executable file
-in `\|\c
-.B a.out\c
-\&\|', the object file for `\|\c
-.I source\c
-.B \&.\c
-.I suffix\c
-\&\c
-\&\|' in
-`\|\c
-.I source\c
-.B \&.o\c
-\&\|', its assembler file in `\|\c
-.I source\c
-.B \&.s\c
-\&\|', and
-all preprocessed C source on standard output.
-.TP
-.B \-v
-Print (on standard error output) the commands executed to run the stages
-of compilation. Also print the version number of the compiler driver
-program and of the preprocessor and the compiler proper.
-.TP
-.B \-pipe
-Use pipes rather than temporary files for communication between the
-various stages of compilation. This fails to work on some systems where
-the assembler cannot read from a pipe; but the GNU assembler has
-no trouble.
-.PP
-.SH LANGUAGE OPTIONS
-The following options control the dialect of C that the compiler
-accepts:
-.TP
-.B \-ansi
-Support all ANSI standard C programs.
-.Sp
-This turns off certain features of GNU C that are incompatible with
-ANSI C, such as the \c
-.B asm\c
-\&, \c
-.B inline\c
-\& and \c
-.B typeof
-keywords, and predefined macros such as \c
-.B unix\c
-\& and \c
-.B vax
-that identify the type of system you are using. It also enables the
-undesirable and rarely used ANSI trigraph feature, and disallows `\|\c
-.B $\c
-\&\|' as part of identifiers.
-.Sp
-The alternate keywords \c
-.B _\|_asm_\|_\c
-\&, \c
-.B _\|_extension_\|_\c
-\&,
-.B _\|_inline_\|_\c
-\& and \c
-.B _\|_typeof_\|_\c
-\& continue to work despite
-`\|\c
-.B \-ansi\c
-\&\|'. You would not want to use them in an ANSI C program, of
-course, but it is useful to put them in header files that might be included
-in compilations done with `\|\c
-.B \-ansi\c
-\&\|'. Alternate predefined macros
-such as \c
-.B _\|_unix_\|_\c
-\& and \c
-.B _\|_vax_\|_\c
-\& are also available, with or
-without `\|\c
-.B \-ansi\c
-\&\|'.
-.Sp
-The `\|\c
-.B \-ansi\c
-\&\|' option does not cause non-ANSI programs to be
-rejected gratuitously. For that, `\|\c
-.B \-pedantic\c
-\&\|' is required in
-addition to `\|\c
-.B \-ansi\c
-\&\|'.
-.Sp
-The preprocessor predefines a macro \c
-.B _\|_STRICT_ANSI_\|_\c
-\& when you use the `\|\c
-.B \-ansi\c
-\&\|'
-option. Some header files may notice this macro and refrain
-from declaring certain functions or defining certain macros that the
-ANSI standard doesn't call for; this is to avoid interfering with any
-programs that might use these names for other things.
-.TP
-.B \-fno\-asm
-Do not recognize \c
-.B asm\c
-\&, \c
-.B inline\c
-\& or \c
-.B typeof\c
-\& as a
-keyword. These words may then be used as identifiers. You can
-use \c
-.B _\|_asm_\|_\c
-\&, \c
-.B _\|_inline_\|_\c
-\& and \c
-.B _\|_typeof_\|_\c
-\& instead.
-`\|\c
-.B \-ansi\c
-\&\|' implies `\|\c
-.B \-fno\-asm\c
-\&\|'.
-.TP
-.B \-fno\-builtin
-Don't recognize built-in functions that do not begin with two leading
-underscores. Currently, the functions affected include \c
-.B _exit\c
-\&,
-.B abort\c
-\&, \c
-.B abs\c
-\&, \c
-.B alloca\c
-\&, \c
-.B cos\c
-\&, \c
-.B exit\c
-\&,
-.B fabs\c
-\&, \c
-.B labs\c
-\&, \c
-.B memcmp\c
-\&, \c
-.B memcpy\c
-\&, \c
-.B sin\c
-\&,
-.B sqrt\c
-\&, \c
-.B strcmp\c
-\&, \c
-.B strcpy\c
-\&, and \c
-.B strlen\c
-\&.
-.Sp
-The `\|\c
-.B \-ansi\c
-\&\|' option prevents \c
-.B alloca\c
-\& and \c
-.B _exit\c
-\& from
-being builtin functions.
-.TP
-.B \-fhosted
-Compile for a hosted environment; this implies the `\|\c
-.B \-fbuiltin\c
-\&\|' option, and implies that suspicious declarations of
-.B main\c
-\& should be warned about.
-.TP
-.B \-ffreestanding
-Compile for a freestanding environment; this implies the `\|\c
-.B \-fno-builtin\c
-\&\|' option, and implies that
-.B main\c
-\& has no special requirements.
-.TP
-.B \-fno\-strict\-prototype
-Treat a function declaration with no arguments, such as `\|\c
-.B int foo
-();\c
-\&\|', as C would treat it\(em\&as saying nothing about the number of
-arguments or their types (C++ only). Normally, such a declaration in
-C++ means that the function \c
-.B foo\c
-\& takes no arguments.
-.TP
-.B \-trigraphs
-Support ANSI C trigraphs. The `\|\c
-.B \-ansi\c
-\&\|' option implies `\|\c
-.B \-trigraphs\c
-\&\|'.
-.TP
-.B \-traditional
-Attempt to support some aspects of traditional C compilers.
-For details, see the GNU C Manual; the duplicate list here
-has been deleted so that we won't get complaints when it
-is out of date.
-.Sp
-But one note about C++ programs only (not C). `\|\c
-.B \-traditional\c
-\&\|' has one additional effect for C++: assignment to
-.B this
-is permitted. This is the same as the effect of `\|\c
-.B \-fthis\-is\-variable\c
-\&\|'.
-.TP
-.B \-traditional\-cpp
-Attempt to support some aspects of traditional C preprocessors.
-This includes the items that specifically mention the preprocessor above,
-but none of the other effects of `\|\c
-.B \-traditional\c
-\&\|'.
-.TP
-.B \-fdollars\-in\-identifiers
-Permit the use of `\|\c
-.B $\c
-\&\|' in identifiers (C++ only). You can also use
-`\|\c
-.B \-fno\-dollars\-in\-identifiers\c
-\&\|' to explicitly prohibit use of
-`\|\c
-.B $\c
-\&\|'. (GNU C++ allows `\|\c
-.B $\c
-\&\|' by default on some target systems
-but not others.)
-.TP
-.B \-fenum\-int\-equiv
-Permit implicit conversion of \c
-.B int\c
-\& to enumeration types (C++
-only). Normally GNU C++ allows conversion of \c
-.B enum\c
-\& to \c
-.B int\c
-\&,
-but not the other way around.
-.TP
-.B \-fexternal\-templates
-Produce smaller code for template declarations, by generating only a
-single copy of each template function where it is defined (C++ only).
-To use this option successfully, you must also mark all files that
-use templates with either `\|\c
-.B #pragma implementation\c
-\&\|' (the definition) or
-`\|\c
-.B #pragma interface\c
-\&\|' (declarations).
-
-When your code is compiled with `\|\c
-.B \-fexternal\-templates\c
-\&\|', all
-template instantiations are external. You must arrange for all
-necessary instantiations to appear in the implementation file; you can
-do this with a \c
-.B typedef\c
-\& that references each instantiation needed.
-Conversely, when you compile using the default option
-`\|\c
-.B \-fno\-external\-templates\c
-\&\|', all template instantiations are
-explicitly internal.
-.TP
-.B \-fall\-virtual
-Treat all possible member functions as virtual, implicitly. All
-member functions (except for constructor functions and
-.B new
-or
-.B delete
-member operators) are treated as virtual functions of the class where
-they appear.
-.Sp
-This does not mean that all calls to these member functions will be
-made through the internal table of virtual functions. Under some
-circumstances, the compiler can determine that a call to a given
-virtual function can be made directly; in these cases the calls are
-direct in any case.
-.TP
-.B \-fcond\-mismatch
-Allow conditional expressions with mismatched types in the second and
-third arguments. The value of such an expression is void.
-.TP
-.B \-fthis\-is\-variable
-Permit assignment to \c
-.B this\c
-\& (C++ only). The incorporation of
-user-defined free store management into C++ has made assignment to
-`\|\c
-.B this\c
-\&\|' an anachronism. Therefore, by default it is invalid to
-assign to \c
-.B this\c
-\& within a class member function. However, for
-backwards compatibility, you can make it valid with
-`\|\c
-.B \-fthis-is-variable\c
-\&\|'.
-.TP
-.B \-funsigned\-char
-Let the type \c
-.B char\c
-\& be unsigned, like \c
-.B unsigned char\c
-\&.
-.Sp
-Each kind of machine has a default for what \c
-.B char\c
-\& should
-be. It is either like \c
-.B unsigned char\c
-\& by default or like
-.B signed char\c
-\& by default.
-.Sp
-Ideally, a portable program should always use \c
-.B signed char\c
-\& or
-.B unsigned char\c
-\& when it depends on the signedness of an object.
-But many programs have been written to use plain \c
-.B char\c
-\& and
-expect it to be signed, or expect it to be unsigned, depending on the
-machines they were written for. This option, and its inverse, let you
-make such a program work with the opposite default.
-.Sp
-The type \c
-.B char\c
-\& is always a distinct type from each of
-.B signed char\c
-\& and \c
-.B unsigned char\c
-\&, even though its behavior
-is always just like one of those two.
-.TP
-.B \-fsigned\-char
-Let the type \c
-.B char\c
-\& be signed, like \c
-.B signed char\c
-\&.
-.Sp
-Note that this is equivalent to `\|\c
-.B \-fno\-unsigned\-char\c
-\&\|', which is
-the negative form of `\|\c
-.B \-funsigned\-char\c
-\&\|'. Likewise,
-`\|\c
-.B \-fno\-signed\-char\c
-\&\|' is equivalent to `\|\c
-.B \-funsigned\-char\c
-\&\|'.
-.TP
-.B \-fsigned\-bitfields
-.TP
-.B \-funsigned\-bitfields
-.TP
-.B \-fno\-signed\-bitfields
-.TP
-.B \-fno\-unsigned\-bitfields
-These options control whether a bitfield is
-signed or unsigned, when declared with no explicit `\|\c
-.B signed\c
-\&\|' or `\|\c
-.B unsigned\c
-\&\|' qualifier. By default, such a bitfield is
-signed, because this is consistent: the basic integer types such as
-.B int\c
-\& are signed types.
-.Sp
-However, when you specify `\|\c
-.B \-traditional\c
-\&\|', bitfields are all unsigned
-no matter what.
-.TP
-.B \-fwritable\-strings
-Store string constants in the writable data segment and don't uniquize
-them. This is for compatibility with old programs which assume they
-can write into string constants. `\|\c
-.B \-traditional\c
-\&\|' also has this
-effect.
-.Sp
-Writing into string constants is a very bad idea; \*(lqconstants\*(rq should
-be constant.
-.SH PREPROCESSOR OPTIONS
-These options control the C preprocessor, which is run on each C source
-file before actual compilation.
-.PP
-If you use the `\|\c
-.B \-E\c
-\&\|' option, GCC does nothing except preprocessing.
-Some of these options make sense only together with `\|\c
-.B \-E\c
-\&\|' because
-they cause the preprocessor output to be unsuitable for actual
-compilation.
-.TP
-.BI "\-include " "file"
-Process \c
-.I file\c
-\& as input before processing the regular input file.
-In effect, the contents of \c
-.I file\c
-\& are compiled first. Any `\|\c
-.B \-D\c
-\&\|'
-and `\|\c
-.B \-U\c
-\&\|' options on the command line are always processed before
-`\|\c
-.B \-include \c
-.I file\c
-\&\c
-\&\|', regardless of the order in which they are
-written. All the `\|\c
-.B \-include\c
-\&\|' and `\|\c
-.B \-imacros\c
-\&\|' options are
-processed in the order in which they are written.
-.TP
-.BI "\-imacros " file
-Process \c
-.I file\c
-\& as input, discarding the resulting output, before
-processing the regular input file. Because the output generated from
-.I file\c
-\& is discarded, the only effect of `\|\c
-.B \-imacros \c
-.I file\c
-\&\c
-\&\|' is to
-make the macros defined in \c
-.I file\c
-\& available for use in the main
-input. The preprocessor evaluates any `\|\c
-.B \-D\c
-\&\|' and `\|\c
-.B \-U\c
-\&\|' options
-on the command line before processing `\|\c
-.B \-imacros\c
-.I file\c
-\&\|', regardless of the order in
-which they are written. All the `\|\c
-.B \-include\c
-\&\|' and `\|\c
-.B \-imacros\c
-\&\|'
-options are processed in the order in which they are written.
-.TP
-.BI "\-idirafter " "dir"
-Add the directory \c
-.I dir\c
-\& to the second include path. The directories
-on the second include path are searched when a header file is not found
-in any of the directories in the main include path (the one that
-`\|\c
-.B \-I\c
-\&\|' adds to).
-.TP
-.BI "\-iprefix " "prefix"
-Specify \c
-.I prefix\c
-\& as the prefix for subsequent `\|\c
-.B \-iwithprefix\c
-\&\|'
-options.
-.TP
-.BI "\-iwithprefix " "dir"
-Add a directory to the second include path. The directory's name is
-made by concatenating \c
-.I prefix\c
-\& and \c
-.I dir\c
-\&, where \c
-.I prefix
-was specified previously with `\|\c
-.B \-iprefix\c
-\&\|'.
-.TP
-.B \-nostdinc
-Do not search the standard system directories for header files. Only
-the directories you have specified with `\|\c
-.B \-I\c
-\&\|' options (and the
-current directory, if appropriate) are searched.
-.Sp
-By using both `\|\c
-.B \-nostdinc\c
-\&\|' and `\|\c
-.B \-I\-\c
-\&\|', you can limit the include-file search file to only those
-directories you specify explicitly.
-.TP
-.B \-nostdinc++
-Do not search for header files in the C++\-specific standard directories,
-but do still search the other standard directories.
-(This option is used when building `\|\c
-.B libg++\c
-\&\|'.)
-.TP
-.B \-undef
-Do not predefine any nonstandard macros. (Including architecture flags).
-.TP
-.B \-E
-Run only the C preprocessor. Preprocess all the C source files
-specified and output the results to standard output or to the
-specified output file.
-.TP
-.B \-C
-Tell the preprocessor not to discard comments. Used with the
-`\|\c
-.B \-E\c
-\&\|' option.
-.TP
-.B \-P
-Tell the preprocessor not to generate `\|\c
-.B #line\c
-\&\|' commands.
-Used with the `\|\c
-.B \-E\c
-\&\|' option.
-.TP
-.B \-M\ [ \-MG ]
-Tell the preprocessor to output a rule suitable for \c
-.B make
-describing the dependencies of each object file. For each source file,
-the preprocessor outputs one \c
-.B make\c
-\&-rule whose target is the object
-file name for that source file and whose dependencies are all the files
-`\|\c
-.B #include\c
-\&\|'d in it. This rule may be a single line or may be
-continued with `\|\c
-.B \e\c
-\&\|'-newline if it is long. The list of rules is
-printed on standard output instead of the preprocessed C program.
-.Sp
-`\|\c
-.B \-M\c
-\&\|' implies `\|\c
-.B \-E\c
-\&\|'.
-.Sp
-`\|\c
-.B \-MG\c
-\&\|' says to treat missing header files as generated files and assume \c
-they live in the same directory as the source file. It must be specified \c
-in addition to `\|\c
-.B \-M\c
-\&\|'.
-.TP
-.B \-MM\ [ \-MG ]
-Like `\|\c
-.B \-M\c
-\&\|' but the output mentions only the user header files
-included with `\|\c
-.B #include "\c
-.I file\c
-\&"\c
-\&\|'. System header files
-included with `\|\c
-.B #include <\c
-.I file\c
-\&>\c
-\&\|' are omitted.
-.TP
-.B \-MD
-Like `\|\c
-.B \-M\c
-\&\|' but the dependency information is written to files with
-names made by replacing `\|\c
-.B .o\c
-\&\|' with `\|\c
-.B .d\c
-\&\|' at the end of the
-output file names. This is in addition to compiling the file as
-specified\(em\&`\|\c
-.B \-MD\c
-\&\|' does not inhibit ordinary compilation the way
-`\|\c
-.B \-M\c
-\&\|' does.
-.Sp
-The Mach utility `\|\c
-.B md\c
-\&\|' can be used to merge the `\|\c
-.B .d\c
-\&\|' files
-into a single dependency file suitable for using with the `\|\c
-.B make\c
-\&\|'
-command.
-.TP
-.B \-MMD
-Like `\|\c
-.B \-MD\c
-\&\|' except mention only user header files, not system
-header files.
-.TP
-.B \-H
-Print the name of each header file used, in addition to other normal
-activities.
-.TP
-.BI "\-A" "question" ( answer )
-Assert the answer
-.I answer
-for
-.I question\c
-\&, in case it is tested
-with a preprocessor conditional such as `\|\c
-.BI "#if #" question ( answer )\c
-\&\|'. `\|\c
-.B \-A\-\c
-\&\|' disables the standard
-assertions that normally describe the target machine.
-.TP
-.BI "\-A" "question"\c
-\&(\c
-.I answer\c
-\&)
-Assert the answer \c
-.I answer\c
-\& for \c
-.I question\c
-\&, in case it is tested
-with a preprocessor conditional such as `\|\c
-.B #if
-#\c
-.I question\c
-\&(\c
-.I answer\c
-\&)\c
-\&\|'. `\|\c
-.B \-A-\c
-\&\|' disables the standard
-assertions that normally describe the target machine.
-.TP
-.BI \-D macro
-Define macro \c
-.I macro\c
-\& with the string `\|\c
-.B 1\c
-\&\|' as its definition.
-.TP
-.BI \-D macro = defn
-Define macro \c
-.I macro\c
-\& as \c
-.I defn\c
-\&. All instances of `\|\c
-.B \-D\c
-\&\|' on
-the command line are processed before any `\|\c
-.B \-U\c
-\&\|' options.
-.TP
-.BI \-U macro
-Undefine macro \c
-.I macro\c
-\&. `\|\c
-.B \-U\c
-\&\|' options are evaluated after all `\|\c
-.B \-D\c
-\&\|' options, but before any `\|\c
-.B \-include\c
-\&\|' and `\|\c
-.B \-imacros\c
-\&\|' options.
-.TP
-.B \-dM
-Tell the preprocessor to output only a list of the macro definitions
-that are in effect at the end of preprocessing. Used with the `\|\c
-.B \-E\c
-\&\|'
-option.
-.TP
-.B \-dD
-Tell the preprocessor to pass all macro definitions into the output, in
-their proper sequence in the rest of the output.
-.TP
-.B \-dN
-Like `\|\c
-.B \-dD\c
-\&\|' except that the macro arguments and contents are omitted.
-Only `\|\c
-.B #define \c
-.I name\c
-\&\c
-\&\|' is included in the output.
-.SH ASSEMBLER OPTION
-.TP
-.BI "\-Wa," "option"
-Pass \c
-.I option\c
-\& as an option to the assembler. If \c
-.I option
-contains commas, it is split into multiple options at the commas.
-.SH LINKER OPTIONS
-These options come into play when the compiler links object files into
-an executable output file. They are meaningless if the compiler is
-not doing a link step.
-.TP
-.I object-file-name
-A file name that does not end in a special recognized suffix is
-considered to name an object file or library. (Object files are
-distinguished from libraries by the linker according to the file
-contents.) If GCC does a link step, these object files are used as input
-to the linker.
-.TP
-.BI \-l library
-Use the library named \c
-.I library\c
-\& when linking.
-.Sp
-The linker searches a standard list of directories for the library,
-which is actually a file named `\|\c
-.B lib\c
-.I library\c
-\&.a\c
-\&\|'. The linker
-then uses this file as if it had been specified precisely by name.
-.Sp
-The directories searched include several standard system directories
-plus any that you specify with `\|\c
-.B \-L\c
-\&\|'.
-.Sp
-Normally the files found this way are library files\(em\&archive files
-whose members are object files. The linker handles an archive file by
-scanning through it for members which define symbols that have so far
-been referenced but not defined. However, if the linker finds an
-ordinary object file rather than a library, the object file is linked
-in the usual fashion. The only difference between using an `\|\c
-.B \-l\c
-\&\|' option and specifying a file
-name is that `\|\c
-.B \-l\c
-\&\|' surrounds
-.I library
-with `\|\c
-.B lib\c
-\&\|' and `\|\c
-.B .a\c
-\&\|' and searches several directories.
-.TP
-.B \-lobjc
-You need this special case of the
-.B \-l
-option in order to link an Objective C program.
-.TP
-.B \-nostartfiles
-Do not use the standard system startup files when linking.
-The standard libraries are used normally.
-.TP
-.B \-nostdlib
-Don't use the standard system libraries and startup files when linking.
-Only the files you specify will be passed to the linker.
-.TP
-.B \-static
-On systems that support dynamic linking, this prevents linking with the shared
-libraries. On other systems, this option has no effect.
-.TP
-.B \-shared
-Produce a shared object which can then be linked with other objects to
-form an executable. Only a few systems support this option.
-.TP
-.B \-symbolic
-Bind references to global symbols when building a shared object. Warn
-about any unresolved references (unless overridden by the link editor
-option `\|\c
-.B
-\-Xlinker \-z \-Xlinker defs\c
-\&\|'). Only a few systems support
-this option.
-.TP
-.BI "\-Xlinker " "option"
-Pass \c
-.I option
-as an option to the linker. You can use this to
-supply system-specific linker options which GNU CC does not know how to
-recognize.
-.Sp
-If you want to pass an option that takes an argument, you must use
-`\|\c
-.B \-Xlinker\c
-\&\|' twice, once for the option and once for the argument.
-For example, to pass `\|\c
-.B
-\-assert definitions\c
-\&\|', you must write
-`\|\c
-.B
-\-Xlinker \-assert \-Xlinker definitions\c
-\&\|'. It does not work to write
-`\|\c
-.B
-\-Xlinker "\-assert definitions"\c
-\&\|', because this passes the entire
-string as a single argument, which is not what the linker expects.
-.TP
-.BI "\-Wl," "option"
-Pass \c
-.I option\c
-\& as an option to the linker. If \c
-.I option\c
-\& contains
-commas, it is split into multiple options at the commas.
-.TP
-.BI "\-u " "symbol"
-Pretend the symbol
-.I symbol
-is undefined, to force linking of
-library modules to define it. You can use `\|\c
-.B \-u\c
-\&\|' multiple times with
-different symbols to force loading of additional library modules.
-.SH DIRECTORY OPTIONS
-These options specify directories to search for header files, for
-libraries and for parts of the compiler:
-.TP
-.BI "\-I" "dir"
-Append directory \c
-.I dir\c
-\& to the list of directories searched for include files.
-.TP
-.B \-I\-
-Any directories you specify with `\|\c
-.B \-I\c
-\&\|' options before the `\|\c
-.B \-I\-\c
-\&\|'
-option are searched only for the case of `\|\c
-.B
-#include "\c
-.I file\c
-.B
-\&"\c
-\&\|';
-they are not searched for `\|\c
-.B #include <\c
-.I file\c
-\&>\c
-\&\|'.
-.Sp
-If additional directories are specified with `\|\c
-.B \-I\c
-\&\|' options after
-the `\|\c
-.B \-I\-\c
-\&\|', these directories are searched for all `\|\c
-.B #include\c
-\&\|'
-directives. (Ordinarily \c
-.I all\c
-\& `\|\c
-.B \-I\c
-\&\|' directories are used
-this way.)
-.Sp
-In addition, the `\|\c
-.B \-I\-\c
-\&\|' option inhibits the use of the current
-directory (where the current input file came from) as the first search
-directory for `\|\c
-.B
-#include "\c
-.I file\c
-.B
-\&"\c
-\&\|'. There is no way to
-override this effect of `\|\c
-.B \-I\-\c
-\&\|'. With `\|\c
-.B \-I.\c
-\&\|' you can specify
-searching the directory which was current when the compiler was
-invoked. That is not exactly the same as what the preprocessor does
-by default, but it is often satisfactory.
-.Sp
-`\|\c
-.B \-I\-\c
-\&\|' does not inhibit the use of the standard system directories
-for header files. Thus, `\|\c
-.B \-I\-\c
-\&\|' and `\|\c
-.B \-nostdinc\c
-\&\|' are
-independent.
-.TP
-.BI "\-L" "dir"
-Add directory \c
-.I dir\c
-\& to the list of directories to be searched
-for `\|\c
-.B \-l\c
-\&\|'.
-.TP
-.BI "\-B" "prefix"
-This option specifies where to find the executables, libraries and
-data files of the compiler itself.
-.Sp
-The compiler driver program runs one or more of the subprograms
-`\|\c
-.B cpp\c
-\&\|', `\|\c
-.B cc1\c
-\&\|' (or, for C++, `\|\c
-.B cc1plus\c
-\&\|'), `\|\c
-.B as\c
-\&\|' and `\|\c
-.B ld\c
-\&\|'. It tries
-.I prefix\c
-\& as a prefix for each program it tries to run, both with and
-without `\|\c
-.I machine\c
-.B /\c
-.I version\c
-.B /\c
-\&\|'.
-.Sp
-For each subprogram to be run, the compiler driver first tries the
-`\|\c
-.B \-B\c
-\&\|' prefix, if any. If that name is not found, or if `\|\c
-.B \-B\c
-\&\|'
-was not specified, the driver tries two standard prefixes, which are
-`\|\c
-.B /usr/lib/gcc/\c
-\&\|' and `\|\c
-.B /usr/local/lib/gcc-lib/\c
-\&\|'. If neither of
-those results in a file name that is found, the compiler driver
-searches for the unmodified program
-name, using the directories specified in your
-`\|\c
-.B PATH\c
-\&\|' environment variable.
-.Sp
-The run-time support file `\|\c
-.B libgcc.a\c
-\&\|' is also searched for using the
-`\|\c
-.B \-B\c
-\&\|' prefix, if needed. If it is not found there, the two
-standard prefixes above are tried, and that is all. The file is left
-out of the link if it is not found by those means. Most of the time,
-on most machines, `\|\c
-.B libgcc.a\c
-\&\|' is not actually necessary.
-.Sp
-You can get a similar result from the environment variable
-.B GCC_EXEC_PREFIX\c
-\&; if it is defined, its value is used as a prefix
-in the same way. If both the `\|\c
-.B \-B\c
-\&\|' option and the
-.B GCC_EXEC_PREFIX\c
-\& variable are present, the `\|\c
-.B \-B\c
-\&\|' option is
-used first and the environment variable value second.
-.SH WARNING OPTIONS
-Warnings are diagnostic messages that report constructions which
-are not inherently erroneous but which are risky or suggest there
-may have been an error.
-.Sp
-These options control the amount and kinds of warnings produced by GNU
-CC:
-.TP
-.B \-fsyntax\-only
-Check the code for syntax errors, but don't emit any output.
-.TP
-.B \-w
-Inhibit all warning messages.
-.TP
-.B \-Wno\-import
-Inhibit warning messages about the use of
-.BR #import .
-.TP
-.B \-pedantic
-Issue all the warnings demanded by strict ANSI standard C; reject
-all programs that use forbidden extensions.
-.Sp
-Valid ANSI standard C programs should compile properly with or without
-this option (though a rare few will require `\|\c
-.B \-ansi\c
-\&\|'). However,
-without this option, certain GNU extensions and traditional C features
-are supported as well. With this option, they are rejected. There is
-no reason to \c
-.I use\c
-\& this option; it exists only to satisfy pedants.
-.Sp
-`\|\c
-.B \-pedantic\c
-\&\|' does not cause warning messages for use of the
-alternate keywords whose names begin and end with `\|\c
-.B _\|_\c
-\&\|'. Pedantic
-warnings are also disabled in the expression that follows
-.B _\|_extension_\|_\c
-\&. However, only system header files should use
-these escape routes; application programs should avoid them.
-.TP
-.B \-pedantic\-errors
-Like `\|\c
-.B \-pedantic\c
-\&\|', except that errors are produced rather than
-warnings.
-.TP
-.B \-W
-Print extra warning messages for these events:
-.TP
-\ \ \ \(bu
-A nonvolatile automatic variable might be changed by a call to
-.B longjmp\c
-\&. These warnings are possible only in
-optimizing compilation.
-.Sp
-The compiler sees only the calls to \c
-.B setjmp\c
-\&. It cannot know
-where \c
-.B longjmp\c
-\& will be called; in fact, a signal handler could
-call it at any point in the code. As a result, you may get a warning
-even when there is in fact no problem because \c
-.B longjmp\c
-\& cannot
-in fact be called at the place which would cause a problem.
-.TP
-\ \ \ \(bu
-A function can return either with or without a value. (Falling
-off the end of the function body is considered returning without
-a value.) For example, this function would evoke such a
-warning:
-.Sp
-.nf
-foo (a)
-{
- if (a > 0)
- return a;
-}
-.Sp
-.fi
-Spurious warnings can occur because GNU CC does not realize that
-certain functions (including \c
-.B abort\c
-\& and \c
-.B longjmp\c
-\&)
-will never return.
-.TP
-\ \ \ \(bu
-An expression-statement or the left-hand side of a comma expression
-contains no side effects.
-To suppress the warning, cast the unused expression to void.
-For example, an expression such as `\|\c
-.B x[i,j]\c
-\&\|' will cause a warning,
-but `\|\c
-.B x[(void)i,j]\c
-\&\|' will not.
-.TP
-\ \ \ \(bu
-An unsigned value is compared against zero with `\|\c
-.B >\c
-\&\|' or `\|\c
-.B <=\c
-\&\|'.
-.PP
-.TP
-.B \-Wimplicit-int
-Warn whenever a declaration does not specify a type.
-.TP
-.B \-Wimplicit-function-declaration
-Warn whenever a function is used before being declared.
-.TP
-.B \-Wimplicit
-Same as -Wimplicit-int and -Wimplicit-function-declaration.
-.TP
-.B \-Wmain
-Warn if the
-.B main
-function is declared or defined with a suspicious type.
-Typically, it is a function with external linkage, returning
-.B int\c
-\&, and
-taking zero or two arguments.
-
-.TP
-.B \-Wreturn\-type
-Warn whenever a function is defined with a return-type that defaults
-to \c
-.B int\c
-\&. Also warn about any \c
-.B return\c
-\& statement with no
-return-value in a function whose return-type is not \c
-.B void\c
-\&.
-.TP
-.B \-Wunused
-Warn whenever a local variable is unused aside from its declaration,
-whenever a function is declared static but never defined, and whenever
-a statement computes a result that is explicitly not used.
-.TP
-.B \-Wswitch
-Warn whenever a \c
-.B switch\c
-\& statement has an index of enumeral type
-and lacks a \c
-.B case\c
-\& for one or more of the named codes of that
-enumeration. (The presence of a \c
-.B default\c
-\& label prevents this
-warning.) \c
-.B case\c
-\& labels outside the enumeration range also
-provoke warnings when this option is used.
-.TP
-.B \-Wcomment
-Warn whenever a comment-start sequence `\|\c
-.B /\(**\c
-\&\|' appears in a comment.
-.TP
-.B \-Wtrigraphs
-Warn if any trigraphs are encountered (assuming they are enabled).
-.TP
-.B \-Wformat
-Check calls to \c
-.B printf\c
-\& and \c
-.B scanf\c
-\&, etc., to make sure that
-the arguments supplied have types appropriate to the format string
-specified.
-.TP
-.B \-Wchar\-subscripts
-Warn if an array subscript has type
-.BR char .
-This is a common cause of error, as programmers often forget that this
-type is signed on some machines.
-.TP
-.B \-Wuninitialized
-An automatic variable is used without first being initialized.
-.Sp
-These warnings are possible only in optimizing compilation,
-because they require data flow information that is computed only
-when optimizing. If you don't specify `\|\c
-.B \-O\c
-\&\|', you simply won't
-get these warnings.
-.Sp
-These warnings occur only for variables that are candidates for
-register allocation. Therefore, they do not occur for a variable that
-is declared \c
-.B volatile\c
-\&, or whose address is taken, or whose size
-is other than 1, 2, 4 or 8 bytes. Also, they do not occur for
-structures, unions or arrays, even when they are in registers.
-.Sp
-Note that there may be no warning about a variable that is used only
-to compute a value that itself is never used, because such
-computations may be deleted by data flow analysis before the warnings
-are printed.
-.Sp
-These warnings are made optional because GNU CC is not smart
-enough to see all the reasons why the code might be correct
-despite appearing to have an error. Here is one example of how
-this can happen:
-.Sp
-.nf
-{
- int x;
- switch (y)
- {
- case 1: x = 1;
- break;
- case 2: x = 4;
- break;
- case 3: x = 5;
- }
- foo (x);
-}
-.Sp
-.fi
-If the value of \c
-.B y\c
-\& is always 1, 2 or 3, then \c
-.B x\c
-\& is
-always initialized, but GNU CC doesn't know this. Here is
-another common case:
-.Sp
-.nf
-{
- int save_y;
- if (change_y) save_y = y, y = new_y;
- .\|.\|.
- if (change_y) y = save_y;
-}
-.Sp
-.fi
-This has no bug because \c
-.B save_y\c
-\& is used only if it is set.
-.Sp
-Some spurious warnings can be avoided if you declare as
-.B volatile\c
-\& all the functions you use that never return.
-.TP
-.B \-Wparentheses
-Warn if parentheses are omitted in certain contexts.
-.TP
-.B \-Wtemplate\-debugging
-When using templates in a C++ program, warn if debugging is not yet
-fully available (C++ only).
-.TP
-.B \-Wall
-All of the above `\|\c
-.B \-W\c
-\&\|' options combined. These are all the
-options which pertain to usage that we recommend avoiding and that we
-believe is easy to avoid, even in conjunction with macros.
-.PP
-The remaining `\|\c
-.B \-W.\|.\|.\c
-\&\|' options are not implied by `\|\c
-.B \-Wall\c
-\&\|'
-because they warn about constructions that we consider reasonable to
-use, on occasion, in clean programs.
-.TP
-.B \-Wtraditional
-Warn about certain constructs that behave differently in traditional and
-ANSI C.
-.TP
-\ \ \ \(bu
-Macro arguments occurring within string constants in the macro body.
-These would substitute the argument in traditional C, but are part of
-the constant in ANSI C.
-.TP
-\ \ \ \(bu
-A function declared external in one block and then used after the end of
-the block.
-.TP
-\ \ \ \(bu
-A \c
-.B switch\c
-\& statement has an operand of type \c
-.B long\c
-\&.
-.PP
-.TP
-.B \-Wshadow
-Warn whenever a local variable shadows another local variable.
-.TP
-.BI "\-Wid\-clash\-" "len"
-Warn whenever two distinct identifiers match in the first \c
-.I len
-characters. This may help you prepare a program that will compile
-with certain obsolete, brain-damaged compilers.
-.TP
-.B \-Wpointer\-arith
-Warn about anything that depends on the \*(lqsize of\*(rq a function type or
-of \c
-.B void\c
-\&. GNU C assigns these types a size of 1, for
-convenience in calculations with \c
-.B void \(**\c
-\& pointers and pointers
-to functions.
-.TP
-.B \-Wcast\-qual
-Warn whenever a pointer is cast so as to remove a type qualifier from
-the target type. For example, warn if a \c
-.B const char \(**\c
-\& is cast
-to an ordinary \c
-.B char \(**\c
-\&.
-.TP
-.B \-Wcast\-align
-Warn whenever a pointer is cast such that the required alignment of the
-target is increased. For example, warn if a \c
-.B char \(**\c
-\& is cast to
-an \c
-.B int \(**\c
-\& on machines where integers can only be accessed at
-two- or four-byte boundaries.
-.TP
-.B \-Wwrite\-strings
-Give string constants the type \c
-.B const char[\c
-.I length\c
-.B ]\c
-\& so that
-copying the address of one into a non-\c
-.B const\c
-\& \c
-.B char \(**
-pointer will get a warning. These warnings will help you find at
-compile time code that can try to write into a string constant, but
-only if you have been very careful about using \c
-.B const\c
-\& in
-declarations and prototypes. Otherwise, it will just be a nuisance;
-this is why we did not make `\|\c
-.B \-Wall\c
-\&\|' request these warnings.
-.TP
-.B \-Wconversion
-Warn if a prototype causes a type conversion that is different from what
-would happen to the same argument in the absence of a prototype. This
-includes conversions of fixed point to floating and vice versa, and
-conversions changing the width or signedness of a fixed point argument
-except when the same as the default promotion.
-.TP
-.B \-Waggregate\-return
-Warn if any functions that return structures or unions are defined or
-called. (In languages where you can return an array, this also elicits
-a warning.)
-.TP
-.B \-Wstrict\-prototypes
-Warn if a function is declared or defined without specifying the
-argument types. (An old-style function definition is permitted without
-a warning if preceded by a declaration which specifies the argument
-types.)
-.TP
-.B \-Wmissing\-prototypes
-Warn if a global function is defined without a previous prototype
-declaration. This warning is issued even if the definition itself
-provides a prototype. The aim is to detect global functions that fail
-to be declared in header files.
-.TP
-.B \-Wmissing\-declarations
-Warn if a global function is defined without a previous declaration.
-Do so even if the definition itself provides a prototype.
-Use this option to detect global functions that are not declared in
-header files.
-.TP
-.B \-Wredundant-decls
-Warn if anything is declared more than once in the same scope, even in
-cases where multiple declaration is valid and changes nothing.
-.TP
-.B \-Wnested-externs
-Warn if an \c
-.B extern\c
-\& declaration is encountered within an function.
-.TP
-.B \-Wenum\-clash
-Warn about conversion between different enumeration types (C++ only).
-.TP
-.B \-Wlong-long
-Warn if
-.B long long \c
-type is used. This is default. To inhibit
-the warning messages, use flag `\|\c
-.B \-Wno\-long\-long\c
-\&\|'. Flags `\|\c
-.B \-W\-long\-long\c
-\&\|' and `\|\c
-.B \-Wno\-long\-long\c
-\&\|' are taken into account only when flag `\|\c
-.B \-pedantic\c
-\&\|' is used.
-.TP
-.B \-Woverloaded\-virtual
-(C++ only.)
-In a derived class, the definitions of virtual functions must match
-the type signature of a virtual function declared in the base class.
-Use this option to request warnings when a derived class declares a
-function that may be an erroneous attempt to define a virtual
-function: that is, warn when a function with the same name as a
-virtual function in the base class, but with a type signature that
-doesn't match any virtual functions from the base class.
-.TP
-.B \-Winline
-Warn if a function can not be inlined, and either it was declared as inline,
-or else the
-.B \-finline\-functions
-option was given.
-.TP
-.B \-Werror
-Treat warnings as errors; abort compilation after any warning.
-.SH DEBUGGING OPTIONS
-GNU CC has various special options that are used for debugging
-either your program or GCC:
-.TP
-.B \-g
-Produce debugging information in the operating system's native format
-(stabs, COFF, XCOFF, or DWARF). GDB can work with this debugging
-information.
-.Sp
-On most systems that use stabs format, `\|\c
-.B \-g\c
-\&\|' enables use of extra
-debugging information that only GDB can use; this extra information
-makes debugging work better in GDB but will probably make other debuggers
-crash or
-refuse to read the program. If you want to control for certain whether
-to generate the extra information, use `\|\c
-.B \-gstabs+\c
-\&\|', `\|\c
-.B \-gstabs\c
-\&\|',
-`\|\c
-.B \-gxcoff+\c
-\&\|', `\|\c
-.B \-gxcoff\c
-\&\|', `\|\c
-.B \-gdwarf+\c
-\&\|', or `\|\c
-.B \-gdwarf\c
-\&\|'
-(see below).
-.Sp
-Unlike most other C compilers, GNU CC allows you to use `\|\c
-.B \-g\c
-\&\|' with
-`\|\c
-.B \-O\c
-\&\|'. The shortcuts taken by optimized code may occasionally
-produce surprising results: some variables you declared may not exist
-at all; flow of control may briefly move where you did not expect it;
-some statements may not be executed because they compute constant
-results or their values were already at hand; some statements may
-execute in different places because they were moved out of loops.
-.Sp
-Nevertheless it proves possible to debug optimized output. This makes
-it reasonable to use the optimizer for programs that might have bugs.
-.PP
-The following options are useful when GNU CC is generated with the
-capability for more than one debugging format.
-.TP
-.B \-ggdb
-Produce debugging information in the native format (if that is supported),
-including GDB extensions if at all possible.
-.TP
-.B \-gstabs
-Produce debugging information in stabs format (if that is supported),
-without GDB extensions. This is the format used by DBX on most BSD
-systems.
-.TP
-.B \-gstabs+
-Produce debugging information in stabs format (if that is supported),
-using GNU extensions understood only by the GNU debugger (GDB). The
-use of these extensions is likely to make other debuggers crash or
-refuse to read the program.
-.TP
-.B \-gcoff
-Produce debugging information in COFF format (if that is supported).
-This is the format used by SDB on most System V systems prior to
-System V Release 4.
-.TP
-.B \-gxcoff
-Produce debugging information in XCOFF format (if that is supported).
-This is the format used by the DBX debugger on IBM RS/6000 systems.
-.TP
-.B \-gxcoff+
-Produce debugging information in XCOFF format (if that is supported),
-using GNU extensions understood only by the GNU debugger (GDB). The
-use of these extensions is likely to make other debuggers crash or
-refuse to read the program.
-.TP
-.B \-gdwarf
-Produce debugging information in DWARF format (if that is supported).
-This is the format used by SDB on most System V Release 4 systems.
-.TP
-.B \-gdwarf+
-Produce debugging information in DWARF format (if that is supported),
-using GNU extensions understood only by the GNU debugger (GDB). The
-use of these extensions is likely to make other debuggers crash or
-refuse to read the program.
-.PP
-.BI "\-g" "level"
-.br
-.BI "\-ggdb" "level"
-.br
-.BI "\-gstabs" "level"
-.br
-.BI "\-gcoff" "level"
-.BI "\-gxcoff" "level"
-.TP
-.BI "\-gdwarf" "level"
-Request debugging information and also use \c
-.I level\c
-\& to specify how
-much information. The default level is 2.
-.Sp
-Level 1 produces minimal information, enough for making backtraces in
-parts of the program that you don't plan to debug. This includes
-descriptions of functions and external variables, but no information
-about local variables and no line numbers.
-.Sp
-Level 3 includes extra information, such as all the macro definitions
-present in the program. Some debuggers support macro expansion when
-you use `\|\c
-.B \-g3\c
-\&\|'.
-.TP
-.B \-p
-Generate extra code to write profile information suitable for the
-analysis program \c
-.B prof\c
-\&.
-.TP
-.B \-pg
-Generate extra code to write profile information suitable for the
-analysis program \c
-.B gprof\c
-\&.
-.TP
-.B \-a
-Generate extra code to write profile information for basic blocks,
-which will record the number of times each basic block is executed.
-This data could be analyzed by a program like \c
-.B tcov\c
-\&. Note,
-however, that the format of the data is not what \c
-.B tcov\c
-\& expects.
-Eventually GNU \c
-.B gprof\c
-\& should be extended to process this data.
-.TP
-.B \-ax
-Generate extra code to read basic block profiling parameters from
-file `bb.in' and write profiling results to file `bb.out'.
-`bb.in' contains a list of functions. Whenever a function on the list
-is entered, profiling is turned on. When the outmost function is left,
-profiling is turned off. If a function name is prefixed with `-'
-the function is excluded from profiling. If a function name is not
-unique it can be disambiguated by writing
-`/path/filename.d:functionname'. `bb.out' will list some available
-filenames.
-Four function names have a special meaning:
-`__bb_jumps__' will cause jump frequencies to be written to `bb.out'.
-`__bb_trace__' will cause the sequence of basic blocks to be piped
-into `gzip' and written to file `bbtrace.gz'.
-`__bb_hidecall__' will cause call instructions to be excluded from
-the trace.
-`__bb_showret__' will cause return instructions to be included in
-the trace.
-.TP
-.BI "\-d" "letters"
-Says to make debugging dumps during compilation at times specified by
-.I letters\c
-\&. This is used for debugging the compiler. The file names
-for most of the dumps are made by appending a word to the source file
-name (e.g. `\|\c
-.B foo.c.rtl\c
-\&\|' or `\|\c
-.B foo.c.jump\c
-\&\|').
-.TP
-.B \-dM
-Dump all macro definitions, at the end of preprocessing, and write no
-output.
-.TP
-.B \-dN
-Dump all macro names, at the end of preprocessing.
-.TP
-.B \-dD
-Dump all macro definitions, at the end of preprocessing, in addition to
-normal output.
-.TP
-.B \-dy
-Dump debugging information during parsing, to standard error.
-.TP
-.B \-dr
-Dump after RTL generation, to `\|\c
-.I file\c
-.B \&.rtl\c
-\&\|'.
-.TP
-.B \-dx
-Just generate RTL for a function instead of compiling it. Usually used
-with `\|\c
-.B r\c
-\&\|'.
-.TP
-.B \-dj
-Dump after first jump optimization, to `\|\c
-.I file\c
-.B \&.jump\c
-\&\|'.
-.TP
-.B \-ds
-Dump after CSE (including the jump optimization that sometimes
-follows CSE), to `\|\c
-.I file\c
-.B \&.cse\c
-\&\|'.
-.TP
-.B \-dL
-Dump after loop optimization, to `\|\c
-.I file\c
-.B \&.loop\c
-\&\|'.
-.TP
-.B \-dt
-Dump after the second CSE pass (including the jump optimization that
-sometimes follows CSE), to `\|\c
-.I file\c
-.B \&.cse2\c
-\&\|'.
-.TP
-.B \-df
-Dump after flow analysis, to `\|\c
-.I file\c
-.B \&.flow\c
-\&\|'.
-.TP
-.B \-dc
-Dump after instruction combination, to `\|\c
-.I file\c
-.B \&.combine\c
-\&\|'.
-.TP
-.B \-dS
-Dump after the first instruction scheduling pass, to
-`\|\c
-.I file\c
-.B \&.sched\c
-\&\|'.
-.TP
-.B \-dl
-Dump after local register allocation, to `\|\c
-.I file\c
-.B \&.lreg\c
-\&\|'.
-.TP
-.B \-dg
-Dump after global register allocation, to `\|\c
-.I file\c
-.B \&.greg\c
-\&\|'.
-.TP
-.B \-dR
-Dump after the second instruction scheduling pass, to
-`\|\c
-.I file\c
-.B \&.sched2\c
-\&\|'.
-.TP
-.B \-dJ
-Dump after last jump optimization, to `\|\c
-.I file\c
-.B \&.jump2\c
-\&\|'.
-.TP
-.B \-dd
-Dump after delayed branch scheduling, to `\|\c
-.I file\c
-.B \&.dbr\c
-\&\|'.
-.TP
-.B \-dk
-Dump after conversion from registers to stack, to `\|\c
-.I file\c
-.B \&.stack\c
-\&\|'.
-.TP
-.B \-da
-Produce all the dumps listed above.
-.TP
-.B \-dm
-Print statistics on memory usage, at the end of the run, to
-standard error.
-.TP
-.B \-dp
-Annotate the assembler output with a comment indicating which
-pattern and alternative was used.
-.TP
-.B \-fpretend\-float
-When running a cross-compiler, pretend that the target machine uses the
-same floating point format as the host machine. This causes incorrect
-output of the actual floating constants, but the actual instruction
-sequence will probably be the same as GNU CC would make when running on
-the target machine.
-.TP
-.B \-save\-temps
-Store the usual \*(lqtemporary\*(rq intermediate files permanently; place them
-in the current directory and name them based on the source file. Thus,
-compiling `\|\c
-.B foo.c\c
-\&\|' with `\|\c
-.B \-c \-save\-temps\c
-\&\|' would produce files
-`\|\c
-.B foo.cpp\c
-\&\|' and `\|\c
-.B foo.s\c
-\&\|', as well as `\|\c
-.B foo.o\c
-\&\|'.
-.TP
-.BI "\-print\-file\-name=" "library"
-Print the full absolute name of the library file \|\c
-.nh
-.I library
-.hy
-\&\| that
-would be used when linking\(em\&and do not do anything else. With this
-option, GNU CC does not compile or link anything; it just prints the
-file name.
-.TP
-.B \-print\-libgcc\-file\-name
-Same as `\|\c
-.B \-print\-file\-name=libgcc.a\c
-\&\|'.
-.TP
-.BI "\-print\-prog\-name=" "program"
-Like `\|\c
-.B \-print\-file\-name\c
-\&\|', but searches for a program such as `\|\c
-cpp\c
-\&\|'.
-.SH OPTIMIZATION OPTIONS
-These options control various sorts of optimizations:
-.TP
-.B \-O
-.TP
-.B \-O1
-Optimize. Optimizing compilation takes somewhat more time, and a lot
-more memory for a large function.
-.Sp
-Without `\|\c
-.B \-O\c
-\&\|', the compiler's goal is to reduce the cost of
-compilation and to make debugging produce the expected results.
-Statements are independent: if you stop the program with a breakpoint
-between statements, you can then assign a new value to any variable or
-change the program counter to any other statement in the function and
-get exactly the results you would expect from the source code.
-.Sp
-Without `\|\c
-.B \-O\c
-\&\|', only variables declared \c
-.B register\c
-\& are
-allocated in registers. The resulting compiled code is a little worse
-than produced by PCC without `\|\c
-.B \-O\c
-\&\|'.
-.Sp
-With `\|\c
-.B \-O\c
-\&\|', the compiler tries to reduce code size and execution
-time.
-.Sp
-When you specify `\|\c
-.B \-O\c
-\&\|', the two options `\|\c
-.B \-fthread\-jumps\c
-\&\|' and `\|\c
-.B \-fdefer\-pop\c
-\&\|' are turned on. On machines that have delay slots, the `\|\c
-.B \-fdelayed\-branch\c
-\&\|' option is turned on. For those machines that can support debugging even
-without a frame pointer, the `\|\c
-.B \-fomit\-frame\-pointer\c
-\&\|' option is turned on. On some machines other flags may also be turned on.
-.TP
-.B \-O2
-Optimize even more. Nearly all supported optimizations that do not
-involve a space-speed tradeoff are performed. Loop unrolling and function
-inlining are not done, for example. As compared to
-.B \-O\c
-\&,
-this option increases both compilation time and the performance of the
-generated code.
-.TP
-.B \-O3
-Optimize yet more. This turns on everything
-.B \-O2
-does, along with also turning on
-.B \-finline\-functions.
-.TP
-.B \-O0
-Do not optimize.
-.Sp
-If you use multiple
-.B \-O
-options, with or without level numbers, the last such option is the
-one that is effective.
-.PP
-Options of the form `\|\c
-.B \-f\c
-.I flag\c
-\&\c
-\&\|' specify machine-independent
-flags. Most flags have both positive and negative forms; the negative
-form of `\|\c
-.B \-ffoo\c
-\&\|' would be `\|\c
-.B \-fno\-foo\c
-\&\|'. The following list shows
-only one form\(em\&the one which is not the default.
-You can figure out the other form by either removing `\|\c
-.B no\-\c
-\&\|' or
-adding it.
-.TP
-.B \-ffloat\-store
-Do not store floating point variables in registers. This
-prevents undesirable excess precision on machines such as the
-68000 where the floating registers (of the 68881) keep more
-precision than a \c
-.B double\c
-\& is supposed to have.
-.Sp
-For most programs, the excess precision does only good, but a few
-programs rely on the precise definition of IEEE floating point.
-Use `\|\c
-.B \-ffloat\-store\c
-\&\|' for such programs.
-.TP
-.B \-fmemoize\-lookups
-.TP
-.B \-fsave\-memoized
-Use heuristics to compile faster (C++ only). These heuristics are not
-enabled by default, since they are only effective for certain input
-files. Other input files compile more slowly.
-.Sp
-The first time the compiler must build a call to a member function (or
-reference to a data member), it must (1) determine whether the class
-implements member functions of that name; (2) resolve which member
-function to call (which involves figuring out what sorts of type
-conversions need to be made); and (3) check the visibility of the member
-function to the caller. All of this adds up to slower compilation.
-Normally, the second time a call is made to that member function (or
-reference to that data member), it must go through the same lengthy
-process again. This means that code like this
-.Sp
-\& cout << "This " << p << " has " << n << " legs.\en";
-.Sp
-makes six passes through all three steps. By using a software cache,
-a \*(lqhit\*(rq significantly reduces this cost. Unfortunately, using the
-cache introduces another layer of mechanisms which must be implemented,
-and so incurs its own overhead. `\|\c
-.B \-fmemoize\-lookups\c
-\&\|' enables
-the software cache.
-.Sp
-Because access privileges (visibility) to members and member functions
-may differ from one function context to the next,
-.B g++
-may need to flush the cache. With the `\|\c
-.B \-fmemoize\-lookups\c
-\&\|' flag, the cache is flushed after every
-function that is compiled. The `\|\c
-\-fsave\-memoized\c
-\&\|' flag enables the same software cache, but when the compiler
-determines that the context of the last function compiled would yield
-the same access privileges of the next function to compile, it
-preserves the cache.
-This is most helpful when defining many member functions for the same
-class: with the exception of member functions which are friends of
-other classes, each member function has exactly the same access
-privileges as every other, and the cache need not be flushed.
-.TP
-.B \-fno\-default\-inline
-Don't make member functions inline by default merely because they are
-defined inside the class scope (C++ only).
-.TP
-.B \-fno\-defer\-pop
-Always pop the arguments to each function call as soon as that
-function returns. For machines which must pop arguments after a
-function call, the compiler normally lets arguments accumulate on the
-stack for several function calls and pops them all at once.
-.TP
-.B \-fforce\-mem
-Force memory operands to be copied into registers before doing
-arithmetic on them. This may produce better code by making all
-memory references potential common subexpressions. When they are
-not common subexpressions, instruction combination should
-eliminate the separate register-load. I am interested in hearing
-about the difference this makes.
-.TP
-.B \-fforce\-addr
-Force memory address constants to be copied into registers before
-doing arithmetic on them. This may produce better code just as
-`\|\c
-.B \-fforce\-mem\c
-\&\|' may. I am interested in hearing about the
-difference this makes.
-.TP
-.B \-fomit\-frame\-pointer
-Don't keep the frame pointer in a register for functions that
-don't need one. This avoids the instructions to save, set up and
-restore frame pointers; it also makes an extra register available
-in many functions. \c
-.I It also makes debugging impossible on most machines\c
-\&.
-.Sp
-On some machines, such as the Vax, this flag has no effect, because
-the standard calling sequence automatically handles the frame pointer
-and nothing is saved by pretending it doesn't exist. The
-machine-description macro \c
-.B FRAME_POINTER_REQUIRED\c
-\& controls
-whether a target machine supports this flag.
-.TP
-.B \-finline\-functions
-Integrate all simple functions into their callers. The compiler
-heuristically decides which functions are simple enough to be worth
-integrating in this way.
-.Sp
-If all calls to a given function are integrated, and the function is
-declared \c
-.B static\c
-\&, then GCC normally does not output the function as
-assembler code in its own right.
-.TP
-.B \-fcaller\-saves
-Enable values to be allocated in registers that will be clobbered by
-function calls, by emitting extra instructions to save and restore the
-registers around such calls. Such allocation is done only when it
-seems to result in better code than would otherwise be produced.
-.Sp
-This option is enabled by default on certain machines, usually those
-which have no call-preserved registers to use instead.
-.TP
-.B \-fkeep\-inline\-functions
-Even if all calls to a given function are integrated, and the function
-is declared \c
-.B static\c
-\&, nevertheless output a separate run-time
-callable version of the function.
-.TP
-.B \-fno\-function\-cse
-Do not put function addresses in registers; make each instruction that
-calls a constant function contain the function's address explicitly.
-.Sp
-This option results in less efficient code, but some strange hacks
-that alter the assembler output may be confused by the optimizations
-performed when this option is not used.
-.TP
-.B \-fno\-peephole
-Disable any machine-specific peephole optimizations.
-.TP
-.B \-ffast-math
-This option allows GCC to violate some ANSI or IEEE rules/specifications
-in the interest of optimizing code for speed. For example, it allows
-the compiler to assume arguments to the \c
-.B sqrt\c
-\& function are
-non-negative numbers.
-.Sp
-This option should never be turned on by any `\|\c
-.B \-O\c
-\&\|' option since
-it can result in incorrect output for programs which depend on
-an exact implementation of IEEE or ANSI rules/specifications for
-math functions.
-.PP
-The following options control specific optimizations. The `\|\c
-.B \-O2\c
-\&\|'
-option turns on all of these optimizations except `\|\c
-.B \-funroll\-loops\c
-\&\|'
-and `\|\c
-.B \-funroll\-all\-loops\c
-\&\|'.
-.PP
-The `\|\c
-.B \-O\c
-\&\|' option usually turns on
-the `\|\c
-.B \-fthread\-jumps\c
-\&\|' and `\|\c
-.B \-fdelayed\-branch\c
-\&\|' options, but
-specific machines may change the default optimizations.
-.PP
-You can use the following flags in the rare cases when \*(lqfine-tuning\*(rq
-of optimizations to be performed is desired.
-.TP
-.B \-fstrength\-reduce
-Perform the optimizations of loop strength reduction and
-elimination of iteration variables.
-.TP
-.B \-fthread\-jumps
-Perform optimizations where we check to see if a jump branches to a
-location where another comparison subsumed by the first is found. If
-so, the first branch is redirected to either the destination of the
-second branch or a point immediately following it, depending on whether
-the condition is known to be true or false.
-.TP
-.B \-funroll\-loops
-Perform the optimization of loop unrolling. This is only done for loops
-whose number of iterations can be determined at compile time or run time.
-.TP
-.B \-funroll\-all\-loops
-Perform the optimization of loop unrolling. This is done for all loops.
-This usually makes programs run more slowly.
-.TP
-.B \-fcse\-follow\-jumps
-In common subexpression elimination, scan through jump instructions
-when the target of the jump is not reached by any other path. For
-example, when CSE encounters an \c
-.B if\c
-\& statement with an
-.B else\c
-\& clause, CSE will follow the jump when the condition
-tested is false.
-.TP
-.B \-fcse\-skip\-blocks
-This is similar to `\|\c
-.B \-fcse\-follow\-jumps\c
-\&\|', but causes CSE to
-follow jumps which conditionally skip over blocks. When CSE
-encounters a simple \c
-.B if\c
-\& statement with no else clause,
-`\|\c
-.B \-fcse\-skip\-blocks\c
-\&\|' causes CSE to follow the jump around the
-body of the \c
-.B if\c
-\&.
-.TP
-.B \-frerun\-cse\-after\-loop
-Re-run common subexpression elimination after loop optimizations has been
-performed.
-.TP
-.B \-felide\-constructors
-Elide constructors when this seems plausible (C++ only). With this
-flag, GNU C++ initializes \c
-.B y\c
-\& directly from the call to \c
-.B foo
-without going through a temporary in the following code:
-.Sp
-A foo ();
-A y = foo ();
-.Sp
-Without this option, GNU C++ first initializes \c
-.B y\c
-\& by calling the
-appropriate constructor for type \c
-.B A\c
-\&; then assigns the result of
-.B foo\c
-\& to a temporary; and, finally, replaces the initial value of
-`\|\c
-.B y\c
-\&\|' with the temporary.
-.Sp
-The default behavior (`\|\c
-.B \-fno\-elide\-constructors\c
-\&\|') is specified by
-the draft ANSI C++ standard. If your program's constructors have side
-effects, using `\|\c
-.B \-felide-constructors\c
-\&\|' can make your program act
-differently, since some constructor calls may be omitted.
-.TP
-.B \-fexpensive\-optimizations
-Perform a number of minor optimizations that are relatively expensive.
-.TP
-.B \-fdelayed\-branch
-If supported for the target machine, attempt to reorder instructions
-to exploit instruction slots available after delayed branch
-instructions.
-.TP
-.B \-fschedule\-insns
-If supported for the target machine, attempt to reorder instructions to
-eliminate execution stalls due to required data being unavailable. This
-helps machines that have slow floating point or memory load instructions
-by allowing other instructions to be issued until the result of the load
-or floating point instruction is required.
-.TP
-.B \-fschedule\-insns2
-Similar to `\|\c
-.B \-fschedule\-insns\c
-\&\|', but requests an additional pass of
-instruction scheduling after register allocation has been done. This is
-especially useful on machines with a relatively small number of
-registers and where memory load instructions take more than one cycle.
-.SH TARGET OPTIONS
-By default, GNU CC compiles code for the same type of machine that you
-are using. However, it can also be installed as a cross-compiler, to
-compile for some other type of machine. In fact, several different
-configurations of GNU CC, for different target machines, can be
-installed side by side. Then you specify which one to use with the
-`\|\c
-.B \-b\c
-\&\|' option.
-.PP
-In addition, older and newer versions of GNU CC can be installed side
-by side. One of them (probably the newest) will be the default, but
-you may sometimes wish to use another.
-.TP
-.BI "\-b " "machine"
-The argument \c
-.I machine\c
-\& specifies the target machine for compilation.
-This is useful when you have installed GNU CC as a cross-compiler.
-.Sp
-The value to use for \c
-.I machine\c
-\& is the same as was specified as the
-machine type when configuring GNU CC as a cross-compiler. For
-example, if a cross-compiler was configured with `\|\c
-.B configure
-i386v\c
-\&\|', meaning to compile for an 80386 running System V, then you
-would specify `\|\c
-.B \-b i386v\c
-\&\|' to run that cross compiler.
-.Sp
-When you do not specify `\|\c
-.B \-b\c
-\&\|', it normally means to compile for
-the same type of machine that you are using.
-.TP
-.BI "\-V " "version"
-The argument \c
-.I version\c
-\& specifies which version of GNU CC to run.
-This is useful when multiple versions are installed. For example,
-.I version\c
-\& might be `\|\c
-.B 2.0\c
-\&\|', meaning to run GNU CC version 2.0.
-.Sp
-The default version, when you do not specify `\|\c
-.B \-V\c
-\&\|', is controlled
-by the way GNU CC is installed. Normally, it will be a version that
-is recommended for general use.
-.SH MACHINE DEPENDENT OPTIONS
-Each of the target machine types can have its own special options,
-starting with `\|\c
-.B \-m\c
-\&\|', to choose among various hardware models or
-configurations\(em\&for example, 68010 vs 68020, floating coprocessor or
-none. A single installed version of the compiler can compile for any
-model or configuration, according to the options specified.
-.PP
-Some configurations of the compiler also support additional special
-options, usually for command-line compatibility with other compilers on
-the same platform.
-.PP
-These are the `\|\c
-.B \-m\c
-\&\|' options defined for the 68000 series:
-.TP
-.B \-m68000
-.TP
-.B \-mc68000
-Generate output for a 68000. This is the default when the compiler is
-configured for 68000-based systems.
-.TP
-.B \-m68020
-.TP
-.B \-mc68020
-Generate output for a 68020 (rather than a 68000). This is the
-default when the compiler is configured for 68020-based systems.
-.TP
-.B \-m68881
-Generate output containing 68881 instructions for floating point.
-This is the default for most 68020-based systems unless
-.B \-nfp
-was specified when the compiler was configured.
-.TP
-.B \-m68030
-Generate output for a 68030. This is the default when the compiler is
-configured for 68030-based systems.
-.TP
-.B \-m68040
-Generate output for a 68040. This is the default when the compiler is
-configured for 68040-based systems.
-.TP
-.B \-m68020\-40
-Generate output for a 68040, without using any of the new instructions.
-This results in code which can run relatively efficiently on either a
-68020/68881 or a 68030 or a 68040.
-.TP
-.B \-mfpa
-Generate output containing Sun FPA instructions for floating point.
-.TP
-.B \-msoft\-float
-Generate output containing library calls for floating point.
-.I
-WARNING:
-the requisite libraries are not part of GNU CC. Normally the
-facilities of the machine's usual C compiler are used, but this can't
-be done directly in cross-compilation. You must make your own
-arrangements to provide suitable library functions for cross-compilation.
-.TP
-.B \-mshort
-Consider type \c
-.B int\c
-\& to be 16 bits wide, like \c
-.B short int\c
-\&.
-.TP
-.B \-mnobitfield
-Do not use the bit-field instructions. `\|\c
-.B \-m68000\c
-\&\|' implies
-`\|\c
-.B \-mnobitfield\c
-\&\|'.
-.TP
-.B \-mbitfield
-Do use the bit-field instructions. `\|\c
-.B \-m68020\c
-\&\|' implies
-`\|\c
-.B \-mbitfield\c
-\&\|'. This is the default if you use the unmodified
-sources.
-.TP
-.B \-mrtd
-Use a different function-calling convention, in which functions
-that take a fixed number of arguments return with the \c
-.B rtd
-instruction, which pops their arguments while returning. This
-saves one instruction in the caller since there is no need to pop
-the arguments there.
-.Sp
-This calling convention is incompatible with the one normally
-used on Unix, so you cannot use it if you need to call libraries
-compiled with the Unix compiler.
-.Sp
-Also, you must provide function prototypes for all functions that
-take variable numbers of arguments (including \c
-.B printf\c
-\&);
-otherwise incorrect code will be generated for calls to those
-functions.
-.Sp
-In addition, seriously incorrect code will result if you call a
-function with too many arguments. (Normally, extra arguments are
-harmlessly ignored.)
-.Sp
-The \c
-.B rtd\c
-\& instruction is supported by the 68010 and 68020
-processors, but not by the 68000.
-.PP
-These `\|\c
-.B \-m\c
-\&\|' options are defined for the Vax:
-.TP
-.B \-munix
-Do not output certain jump instructions (\c
-.B aobleq\c
-\& and so on)
-that the Unix assembler for the Vax cannot handle across long
-ranges.
-.TP
-.B \-mgnu
-Do output those jump instructions, on the assumption that you
-will assemble with the GNU assembler.
-.TP
-.B \-mg
-Output code for g-format floating point numbers instead of d-format.
-.PP
-These `\|\c
-.B \-m\c
-\&\|' switches are supported on the SPARC:
-.PP
-.B \-mfpu
-.TP
-.B \-mhard\-float
-Generate output containing floating point instructions. This is the
-default.
-.PP
-.B \-mno\-fpu
-.TP
-.B \-msoft\-float
-Generate output containing library calls for floating point.
-.I Warning:
-there is no GNU floating-point library for SPARC.
-Normally the facilities of the machine's usual C compiler are used, but
-this cannot be done directly in cross-compilation. You must make your
-own arrangements to provide suitable library functions for
-cross-compilation.
-.Sp
-.B \-msoft\-float
-changes the calling convention in the output file;
-therefore, it is only useful if you compile
-.I all
-of a program with this option.
-.PP
-.B \-mno\-epilogue
-.TP
-.B \-mepilogue
-With
-.B \-mepilogue
-(the default), the compiler always emits code for
-function exit at the end of each function. Any function exit in
-the middle of the function (such as a return statement in C) will
-generate a jump to the exit code at the end of the function.
-.Sp
-With
-.BR \-mno\-epilogue ,
-the compiler tries to emit exit code inline at every function exit.
-.PP
-.B \-mno\-v8
-.TP
-.B \-mv8
-.TP
-.B \-msparclite
-These three options select variations on the SPARC architecture.
-.Sp
-By default (unless specifically configured for the Fujitsu SPARClite),
-GCC generates code for the v7 variant of the SPARC architecture.
-.Sp
-.B \-mv8
-will give you SPARC v8 code. The only difference from v7
-code is that the compiler emits the integer multiply and integer
-divide instructions which exist in SPARC v8 but not in SPARC v7.
-.Sp
-.B \-msparclite
-will give you SPARClite code. This adds the integer
-multiply, integer divide step and scan (ffs) instructions which
-exist in SPARClite but not in SPARC v7.
-.PP
-.B \-mcypress
-.TP
-.B \-msupersparc
-These two options select the processor for which the code is optimised.
-.Sp
-With
-.B \-mcypress
-(the default), the compiler optimises code for the Cypress CY7C602 chip, as
-used in the SparcStation/SparcServer 3xx series. This is also appropriate for
-the older SparcStation 1, 2, IPX etc.
-.Sp
-With
-.B \-msupersparc
-the compiler optimises code for the SuperSparc cpu, as used in the SparcStation
-10, 1000 and 2000 series. This flag also enables use of the full SPARC v8
-instruction set.
-.PP
-These `\|\c
-.B \-m\c
-\&\|' options are defined for the Convex:
-.TP
-.B \-mc1
-Generate output for a C1. This is the default when the compiler is
-configured for a C1.
-.TP
-.B \-mc2
-Generate output for a C2. This is the default when the compiler is
-configured for a C2.
-.TP
-.B \-margcount
-Generate code which puts an argument count in the word preceding each
-argument list. Some nonportable Convex and Vax programs need this word.
-(Debuggers don't, except for functions with variable-length argument
-lists; this info is in the symbol table.)
-.TP
-.B \-mnoargcount
-Omit the argument count word. This is the default if you use the
-unmodified sources.
-.PP
-These `\|\c
-.B \-m\c
-\&\|' options are defined for the AMD Am29000:
-.TP
-.B \-mdw
-Generate code that assumes the DW bit is set, i.e., that byte and
-halfword operations are directly supported by the hardware. This is the
-default.
-.TP
-.B \-mnodw
-Generate code that assumes the DW bit is not set.
-.TP
-.B \-mbw
-Generate code that assumes the system supports byte and halfword write
-operations. This is the default.
-.TP
-.B \-mnbw
-Generate code that assumes the systems does not support byte and
-halfword write operations. This implies `\|\c
-.B \-mnodw\c
-\&\|'.
-.TP
-.B \-msmall
-Use a small memory model that assumes that all function addresses are
-either within a single 256 KB segment or at an absolute address of less
-than 256K. This allows the \c
-.B call\c
-\& instruction to be used instead
-of a \c
-.B const\c
-\&, \c
-.B consth\c
-\&, \c
-.B calli\c
-\& sequence.
-.TP
-.B \-mlarge
-Do not assume that the \c
-.B call\c
-\& instruction can be used; this is the
-default.
-.TP
-.B \-m29050
-Generate code for the Am29050.
-.TP
-.B \-m29000
-Generate code for the Am29000. This is the default.
-.TP
-.B \-mkernel\-registers
-Generate references to registers \c
-.B gr64-gr95\c
-\& instead of
-.B gr96-gr127\c
-\&. This option can be used when compiling kernel code
-that wants a set of global registers disjoint from that used by
-user-mode code.
-.Sp
-Note that when this option is used, register names in `\|\c
-.B \-f\c
-\&\|' flags
-must use the normal, user-mode, names.
-.TP
-.B \-muser\-registers
-Use the normal set of global registers, \c
-.B gr96-gr127\c
-\&. This is the
-default.
-.TP
-.B \-mstack\-check
-Insert a call to \c
-.B _\|_msp_check\c
-\& after each stack adjustment. This
-is often used for kernel code.
-.PP
-These `\|\c
-.B \-m\c
-\&\|' options are defined for Motorola 88K architectures:
-.TP
-.B \-m88000
-Generate code that works well on both the m88100 and the
-m88110.
-.TP
-.B \-m88100
-Generate code that works best for the m88100, but that also
-runs on the m88110.
-.TP
-.B \-m88110
-Generate code that works best for the m88110, and may not run
-on the m88100.
-.TP
-.B \-midentify\-revision
-Include an \c
-.B ident\c
-\& directive in the assembler output recording the
-source file name, compiler name and version, timestamp, and compilation
-flags used.
-.TP
-.B \-mno\-underscores
-In assembler output, emit symbol names without adding an underscore
-character at the beginning of each name. The default is to use an
-underscore as prefix on each name.
-.TP
-.B \-mno\-check\-zero\-division
-.TP
-.B \-mcheck\-zero\-division
-Early models of the 88K architecture had problems with division by zero;
-in particular, many of them didn't trap. Use these options to avoid
-including (or to include explicitly) additional code to detect division
-by zero and signal an exception. All GCC configurations for the 88K use
-`\|\c
-.B \-mcheck\-zero\-division\c
-\&\|' by default.
-.TP
-.B \-mocs\-debug\-info
-.TP
-.B \-mno\-ocs\-debug\-info
-Include (or omit) additional debugging information (about
-registers used in each stack frame) as specified in the 88Open Object
-Compatibility Standard, \*(lqOCS\*(rq. This extra information is not needed
-by GDB. The default for DG/UX, SVr4, and Delta 88 SVr3.2 is to
-include this information; other 88k configurations omit this information
-by default.
-.TP
-.B \-mocs\-frame\-position
-.TP
-.B \-mno\-ocs\-frame\-position
-Force (or do not require) register values to be stored in a particular
-place in stack frames, as specified in OCS. The DG/UX, Delta88 SVr3.2,
-and BCS configurations use `\|\c
-.B \-mocs\-frame\-position\c
-\&\|'; other 88k
-configurations have the default `\|\c
-.B \-mno\-ocs\-frame\-position\c
-\&\|'.
-.TP
-.B \-moptimize\-arg\-area
-.TP
-.B \-mno\-optimize\-arg\-area
-Control how to store function arguments in stack frames.
-`\|\c
-.B \-moptimize\-arg\-area\c
-\&\|' saves space, but may break some
-debuggers (not GDB). `\|\c
-.B \-mno\-optimize\-arg\-area\c
-\&\|' conforms better to
-standards. By default GCC does not optimize the argument area.
-.TP
-.BI "\-mshort\-data\-" "num"
-.I num
-Generate smaller data references by making them relative to \c
-.B r0\c
-\&,
-which allows loading a value using a single instruction (rather than the
-usual two). You control which data references are affected by
-specifying \c
-.I num\c
-\& with this option. For example, if you specify
-`\|\c
-.B \-mshort\-data\-512\c
-\&\|', then the data references affected are those
-involving displacements of less than 512 bytes.
-`\|\c
-.B \-mshort\-data\-\c
-.I num\c
-\&\c
-\&\|' is not effective for \c
-.I num\c
-\& greater
-than 64K.
-.PP
-.B \-mserialize-volatile
-.TP
-.B \-mno-serialize-volatile
-Do, or do not, generate code to guarantee sequential consistency of
-volatile memory references.
-.Sp
-GNU CC always guarantees consistency by default, for the preferred
-processor submodel. How this is done depends on the submodel.
-.Sp
-The m88100 processor does not reorder memory references and so always
-provides sequential consistency. If you use `\|\c
-.B \-m88100\c
-\&\|', GNU CC does
-not generate any special instructions for sequential consistency.
-.Sp
-The order of memory references made by the m88110 processor does not
-always match the order of the instructions requesting those references.
-In particular, a load instruction may execute before a preceding store
-instruction. Such reordering violates sequential consistency of
-volatile memory references, when there are multiple processors. When
-you use `\|\c
-.B \-m88000\c
-\&\|' or `\|\c
-.B \-m88110\c
-\&\|', GNU CC generates special
-instructions when appropriate, to force execution in the proper order.
-.Sp
-The extra code generated to guarantee consistency may affect the
-performance of your application. If you know that you can safely forgo
-this guarantee, you may use the option `\|\c
-.B \-mno-serialize-volatile\c
-\&\|'.
-.Sp
-If you use the `\|\c
-.B \-m88100\c
-\&\|' option but require sequential consistency
-when running on the m88110 processor, you should use
-`\|\c
-.B \-mserialize-volatile\c
-\&\|'.
-.PP
-.B \-msvr4
-.TP
-.B \-msvr3
-Turn on (`\|\c
-.B \-msvr4\c
-\&\|') or off (`\|\c
-.B \-msvr3\c
-\&\|') compiler extensions
-related to System V release 4 (SVr4). This controls the following:
-.TP
-\ \ \ \(bu
-Which variant of the assembler syntax to emit (which you can select
-independently using `\|\c
-.B \-mversion\-03.00\c
-\&\|').
-.TP
-\ \ \ \(bu
-`\|\c
-.B \-msvr4\c
-\&\|' makes the C preprocessor recognize `\|\c
-.B #pragma weak\c
-\&\|'
-.TP
-\ \ \ \(bu
-`\|\c
-.B \-msvr4\c
-\&\|' makes GCC issue additional declaration directives used in
-SVr4.
-.PP
-`\|\c
-.B \-msvr3\c
-\&\|' is the default for all m88K configurations except
-the SVr4 configuration.
-.TP
-.B \-mtrap\-large\-shift
-.TP
-.B \-mhandle\-large\-shift
-Include code to detect bit-shifts of more than 31 bits; respectively,
-trap such shifts or emit code to handle them properly. By default GCC
-makes no special provision for large bit shifts.
-.TP
-.B \-muse\-div\-instruction
-Very early models of the 88K architecture didn't have a divide
-instruction, so GCC avoids that instruction by default. Use this option
-to specify that it's safe to use the divide instruction.
-.TP
-.B \-mversion\-03.00
-In the DG/UX configuration, there are two flavors of SVr4. This option
-modifies
-.B \-msvr4
-to select whether the hybrid-COFF or real-ELF
-flavor is used. All other configurations ignore this option.
-.TP
-.B \-mwarn\-passed\-structs
-Warn when a function passes a struct as an argument or result.
-Structure-passing conventions have changed during the evolution of the C
-language, and are often the source of portability problems. By default,
-GCC issues no such warning.
-.PP
-These options are defined for the IBM RS6000:
-.PP
-.B \-mfp\-in\-toc
-.TP
-.B \-mno\-fp\-in\-toc
-Control whether or not floating-point constants go in the Table of
-Contents (TOC), a table of all global variable and function addresses. By
-default GCC puts floating-point constants there; if the TOC overflows,
-`\|\c
-.B \-mno\-fp\-in\-toc\c
-\&\|' will reduce the size of the TOC, which may avoid
-the overflow.
-.PP
-These `\|\c
-.B \-m\c
-\&\|' options are defined for the IBM RT PC:
-.TP
-.B \-min\-line\-mul
-Use an in-line code sequence for integer multiplies. This is the
-default.
-.TP
-.B \-mcall\-lib\-mul
-Call \c
-.B lmul$$\c
-\& for integer multiples.
-.TP
-.B \-mfull\-fp\-blocks
-Generate full-size floating point data blocks, including the minimum
-amount of scratch space recommended by IBM. This is the default.
-.TP
-.B \-mminimum\-fp\-blocks
-Do not include extra scratch space in floating point data blocks. This
-results in smaller code, but slower execution, since scratch space must
-be allocated dynamically.
-.TP
-.B \-mfp\-arg\-in\-fpregs
-Use a calling sequence incompatible with the IBM calling convention in
-which floating point arguments are passed in floating point registers.
-Note that \c
-.B varargs.h\c
-\& and \c
-.B stdargs.h\c
-\& will not work with
-floating point operands if this option is specified.
-.TP
-.B \-mfp\-arg\-in\-gregs
-Use the normal calling convention for floating point arguments. This is
-the default.
-.TP
-.B \-mhc\-struct\-return
-Return structures of more than one word in memory, rather than in a
-register. This provides compatibility with the MetaWare HighC (hc)
-compiler. Use `\|\c
-.B \-fpcc\-struct\-return\c
-\&\|' for compatibility with the
-Portable C Compiler (pcc).
-.TP
-.B \-mnohc\-struct\-return
-Return some structures of more than one word in registers, when
-convenient. This is the default. For compatibility with the
-IBM-supplied compilers, use either `\|\c
-.B \-fpcc\-struct\-return\c
-\&\|' or
-`\|\c
-.B \-mhc\-struct\-return\c
-\&\|'.
-.PP
-These `\|\c
-.B \-m\c
-\&\|' options are defined for the MIPS family of computers:
-.TP
-.BI "\-mcpu=" "cpu-type"
-Assume the defaults for the machine type
-.I cpu-type
-when
-scheduling instructions. The default
-.I cpu-type
-is
-.BR default ,
-which picks the longest cycles times for any of the machines, in order
-that the code run at reasonable rates on all MIPS cpu's. Other
-choices for
-.I cpu-type
-are
-.BR r2000 ,
-.BR r3000 ,
-.BR r4000 ,
-and
-.BR r6000 .
-While picking a specific
-.I cpu-type
-will schedule things appropriately for that particular chip, the
-compiler will not generate any code that does not meet level 1 of the
-MIPS ISA (instruction set architecture) without the
-.B \-mips2
-or
-.B \-mips3
-switches being used.
-.TP
-.B \-mips2
-Issue instructions from level 2 of the MIPS ISA (branch likely, square
-root instructions). The
-.B \-mcpu=r4000
-or
-.B \-mcpu=r6000
-switch must be used in conjunction with
-.BR \-mips2 .
-.TP
-.B \-mips3
-Issue instructions from level 3 of the MIPS ISA (64 bit instructions).
-The
-.B \-mcpu=r4000
-switch must be used in conjunction with
-.BR \-mips2 .
-.TP
-.B \-mint64
-.TP
-.B \-mlong64
-.TP
-.B \-mlonglong128
-These options don't work at present.
-.TP
-.B \-mmips\-as
-Generate code for the MIPS assembler, and invoke
-.B mips\-tfile
-to add normal debug information. This is the default for all
-platforms except for the OSF/1 reference platform, using the OSF/rose
-object format. If any of the
-.BR \-ggdb ,
-.BR \-gstabs ,
-or
-.B \-gstabs+
-switches are used, the
-.B mips\-tfile
-program will encapsulate the stabs within MIPS ECOFF.
-.TP
-.B \-mgas
-Generate code for the GNU assembler. This is the default on the OSF/1
-reference platform, using the OSF/rose object format.
-.TP
-.B \-mrnames
-.TP
-.B \-mno\-rnames
-The
-.B \-mrnames
-switch says to output code using the MIPS software names for the
-registers, instead of the hardware names (ie,
-.B a0
-instead of
-.BR $4 ).
-The GNU assembler does not support the
-.B \-mrnames
-switch, and the MIPS assembler will be instructed to run the MIPS C
-preprocessor over the source file. The
-.B \-mno\-rnames
-switch is default.
-.TP
-.B \-mgpopt
-.TP
-.B \-mno\-gpopt
-The
-.B \-mgpopt
-switch says to write all of the data declarations before the
-instructions in the text section, to all the MIPS assembler to
-generate one word memory references instead of using two words for
-short global or static data items. This is on by default if
-optimization is selected.
-.TP
-.B \-mstats
-.TP
-.B \-mno\-stats
-For each non-inline function processed, the
-.B \-mstats
-switch causes the compiler to emit one line to the standard error file
-to print statistics about the program (number of registers saved,
-stack size, etc.).
-.TP
-.B \-mmemcpy
-.TP
-.B \-mno\-memcpy
-The
-.B \-mmemcpy
-switch makes all block moves call the appropriate string function
-.RB ( memcpy
-or
-.BR bcopy )
-instead of possibly generating inline code.
-.TP
-.B \-mmips\-tfile
-.TP
-.B \-mno\-mips\-tfile
-The
-.B \-mno\-mips\-tfile
-switch causes the compiler not postprocess the object file with the
-.B mips\-tfile
-program, after the MIPS assembler has generated it to add debug
-support. If
-.B mips\-tfile
-is not run, then no local variables will be available to the debugger.
-In addition,
-.B stage2
-and
-.B stage3
-objects will have the temporary file names passed to the assembler
-embedded in the object file, which means the objects will not compare
-the same.
-.TP
-.B \-msoft\-float
-Generate output containing library calls for floating point.
-.I
-WARNING:
-the requisite libraries are not part of GNU CC. Normally the
-facilities of the machine's usual C compiler are used, but this can't
-be done directly in cross-compilation. You must make your own
-arrangements to provide suitable library functions for cross-compilation.
-.TP
-.B \-mhard\-float
-Generate output containing floating point instructions. This is the
-default if you use the unmodified sources.
-.TP
-.B \-mfp64
-Assume that the
-.B FR
-bit in the status word is on, and that there are 32 64-bit floating
-point registers, instead of 32 32-bit floating point registers. You
-must also specify the
-.B \-mcpu=r4000
-and
-.B \-mips3
-switches.
-.TP
-.B \-mfp32
-Assume that there are 32 32-bit floating point registers. This is the
-default.
-.PP
-.B \-mabicalls
-.TP
-.B \-mno\-abicalls
-Emit (or do not emit) the
-.BR \&.abicalls ,
-.BR \&.cpload ,
-and
-.B \&.cprestore
-pseudo operations that some System V.4 ports use for position
-independent code.
-.TP
-.B \-mhalf\-pic
-.TP
-.B \-mno\-half\-pic
-The
-.B \-mhalf\-pic
-switch says to put pointers to extern references into the data section
-and load them up, rather than put the references in the text section.
-This option does not work at present.
-.B
-.BI \-G num
-Put global and static items less than or equal to
-.I num
-bytes into the small data or bss sections instead of the normal data
-or bss section. This allows the assembler to emit one word memory
-reference instructions based on the global pointer
-.RB ( gp
-or
-.BR $28 ),
-instead of the normal two words used. By default,
-.I num
-is 8 when the MIPS assembler is used, and 0 when the GNU
-assembler is used. The
-.BI \-G num
-switch is also passed to the assembler and linker. All modules should
-be compiled with the same
-.BI \-G num
-value.
-.TP
-.B \-nocpp
-Tell the MIPS assembler to not run its preprocessor over user
-assembler files (with a `\|\c
-.B .s\c
-\&\|' suffix) when assembling them.
-.PP
-These `\|\c
-.B \-m\c
-\&\|' options are defined for the Intel 80386 family of computers:
-.B \-m486
-.TP
-.B \-mno\-486
-Control whether or not code is optimized for a 486 instead of an
-386. Code generated for a 486 will run on a 386 and vice versa.
-.TP
-.B \-msoft\-float
-Generate output containing library calls for floating point.
-.I Warning:
-the requisite libraries are not part of GNU CC.
-Normally the facilities of the machine's usual C compiler are used, but
-this can't be done directly in cross-compilation. You must make your
-own arrangements to provide suitable library functions for
-cross-compilation.
-.Sp
-On machines where a function returns floating point results in the 80387
-register stack, some floating point opcodes may be emitted even if
-`\|\c
-.B \-msoft-float\c
-\&\|' is used.
-.TP
-.B \-mno-fp-ret-in-387
-Do not use the FPU registers for return values of functions.
-.Sp
-The usual calling convention has functions return values of types
-.B float\c
-\& and \c
-.B double\c
-\& in an FPU register, even if there
-is no FPU. The idea is that the operating system should emulate
-an FPU.
-.Sp
-The option `\|\c
-.B \-mno-fp-ret-in-387\c
-\&\|' causes such values to be returned
-in ordinary CPU registers instead.
-.PP
-These `\|\c
-.B \-m\c
-\&\|' options are defined for the HPPA family of computers:
-.TP
-.B \-mpa-risc-1-0
-Generate code for a PA 1.0 processor.
-.TP
-.B \-mpa-risc-1-1
-Generate code for a PA 1.1 processor.
-.TP
-.B \-mkernel
-Generate code which is suitable for use in kernels. Specifically, avoid
-.B add\c
-\& instructions in which one of the arguments is the DP register;
-generate \c
-.B addil\c
-\& instructions instead. This avoids a rather serious
-bug in the HP-UX linker.
-.TP
-.B \-mshared-libs
-Generate code that can be linked against HP-UX shared libraries. This option
-is not fully function yet, and is not on by default for any PA target. Using
-this option can cause incorrect code to be generated by the compiler.
-.TP
-.B \-mno-shared-libs
-Don't generate code that will be linked against shared libraries. This is
-the default for all PA targets.
-.TP
-.B \-mlong-calls
-Generate code which allows calls to functions greater than 256K away from
-the caller when the caller and callee are in the same source file. Do
-not turn this option on unless code refuses to link with \*(lqbranch out of
-range errors\*('' from the linker.
-.TP
-.B \-mdisable-fpregs
-Prevent floating point registers from being used in any manner. This is
-necessary for compiling kernels which perform lazy context switching of
-floating point registers. If you use this option and attempt to perform
-floating point operations, the compiler will abort.
-.TP
-.B \-mdisable-indexing
-Prevent the compiler from using indexing address modes. This avoids some
-rather obscure problems when compiling MIG generated code under MACH.
-.TP
-.B \-mtrailing-colon
-Add a colon to the end of label definitions (for ELF assemblers).
-.PP
-These `\|\c
-.B \-m\c
-\&\|' options are defined for the Intel 80960 family of computers:
-.TP
-.BI "\-m" "cpu-type"
-Assume the defaults for the machine type
-.I cpu-type
-for instruction and addressing-mode availability and alignment.
-The default
-.I cpu-type
-is
-.BR kb ;
-other choices are
-.BR ka ,
-.BR mc ,
-.BR ca ,
-.BR cf ,
-.BR sa ,
-and
-.BR sb .
-.TP
-.B \-mnumerics
-.TP
-.B \-msoft\-float
-The
-.B \-mnumerics
-option indicates that the processor does support
-floating-point instructions. The
-.B \-msoft\-float
-option indicates
-that floating-point support should not be assumed.
-.TP
-.B \-mleaf\-procedures
-.TP
-.B \-mno\-leaf\-procedures
-Do (or do not) attempt to alter leaf procedures to be callable with the
-.I bal
-instruction as well as
-.IR call .
-This will result in more
-efficient code for explicit calls when the
-.I bal
-instruction can be
-substituted by the assembler or linker, but less efficient code in other
-cases, such as calls via function pointers, or using a linker that doesn't
-support this optimization.
-.TP
-.B \-mtail\-call
-.TP
-.B \-mno\-tail\-call
-Do (or do not) make additional attempts (beyond those of the
-machine-independent portions of the compiler) to optimize tail-recursive
-calls into branches. You may not want to do this because the detection of
-cases where this is not valid is not totally complete. The default is
-.BR \-mno\-tail\-call .
-.TP
-.B \-mcomplex\-addr
-.TP
-.B \-mno\-complex\-addr
-Assume (or do not assume) that the use of a complex addressing mode is a
-win on this implementation of the i960. Complex addressing modes may not
-be worthwhile on the K-series, but they definitely are on the C-series.
-The default is currently
-.B \-mcomplex\-addr
-for all processors except
-the CB and CC.
-.TP
-.B \-mcode\-align
-.TP
-.B \-mno\-code\-align
-Align code to 8-byte boundaries for faster fetching (or don't bother).
-Currently turned on by default for C-series implementations only.
-.TP
-.B \-mic\-compat
-.TP
-.B \-mic2.0\-compat
-.TP
-.B \-mic3.0\-compat
-Enable compatibility with iC960 v2.0 or v3.0.
-.TP
-.B \-masm\-compat
-.TP
-.B \-mintel\-asm
-Enable compatibility with the iC960 assembler.
-.TP
-.B \-mstrict\-align
-.TP
-.B \-mno\-strict\-align
-Do not permit (do permit) unaligned accesses.
-.TP
-.B \-mold\-align
-Enable structure-alignment compatibility with Intel's gcc release version
-1.3 (based on gcc 1.37). Currently this is buggy in that
-.B #pragma align 1
-is always assumed as well, and cannot be turned off.
-.PP
-These `\|\c
-.B \-m\c
-\&\|' options are defined for the DEC Alpha implementations:
-.TP
-.B \-mno-soft-float
-.TP
-.B \-msoft-float
-Use (do not use) the hardware floating-point instructions for
-floating-point operations. When \c
-.B \-msoft-float\c
-\& is specified,
-functions in `\|\c
-.B libgcc1.c\c
-\&\|' will be used to perform floating-point
-operations. Unless they are replaced by routines that emulate the
-floating-point operations, or compiled in such a way as to call such
-emulations routines, these routines will issue floating-point
-operations. If you are compiling for an Alpha without floating-point
-operations, you must ensure that the library is built so as not to call
-them.
-.Sp
-Note that Alpha implementations without floating-point operations are
-required to have floating-point registers.
-.TP
-.B \-mfp-reg
-.TP
-.B \-mno-fp-regs
-Generate code that uses (does not use) the floating-point register set.
-.B \-mno-fp-regs\c
-\& implies \c
-.B \-msoft-float\c
-\&. If the floating-point
-register set is not used, floating point operands are passed in integer
-registers as if they were integers and floating-point results are passed
-in $0 instead of $f0. This is a non-standard calling sequence, so any
-function with a floating-point argument or return value called by code
-compiled with \c
-.B \-mno-fp-regs\c
-\& must also be compiled with that
-option.
-.Sp
-A typical use of this option is building a kernel that does not use,
-and hence need not save and restore, any floating-point registers.
-.PP
-These additional options are available on System V Release 4 for
-compatibility with other compilers on those systems:
-.TP
-.B \-G
-On SVr4 systems, \c
-.B gcc\c
-\& accepts the option `\|\c
-.B \-G\c
-\&\|' (and passes
-it to the system linker), for compatibility with other compilers.
-However, we suggest you use `\|\c
-.B \-symbolic\c
-\&\|' or `\|\c
-.B \-shared\c
-\&\|' as
-appropriate, instead of supplying linker options on the \c
-.B gcc
-command line.
-.TP
-.B \-Qy
-Identify the versions of each tool used by the compiler, in a
-.B .ident\c
-\& assembler directive in the output.
-.TP
-.B \-Qn
-Refrain from adding \c
-.B .ident\c
-\& directives to the output file (this is
-the default).
-.TP
-.BI "\-YP," "dirs"
-Search the directories \c
-.I dirs\c
-\&, and no others, for libraries
-specified with `\|\c
-.B \-l\c
-\&\|'. You can separate directory entries in
-.I dirs\c
-\& from one another with colons.
-.TP
-.BI "\-Ym," "dir"
-Look in the directory \c
-.I dir\c
-\& to find the M4 preprocessor.
-The assembler uses this option.
-.SH CODE GENERATION OPTIONS
-These machine-independent options control the interface conventions
-used in code generation.
-.PP
-Most of them begin with `\|\c
-\-f\c
-\&\|'. These options have both positive and negative forms; the negative form
-of `\|\c
-.B \-ffoo\c
-\&\|' would be `\|\c
-.B \-fno\-foo\c
-\&\|'. In the table below, only
-one of the forms is listed\(em\&the one which is not the default. You
-can figure out the other form by either removing `\|\c
-.B no\-\c
-\&\|' or adding
-it.
-.TP
-.B \-fnonnull\-objects
-Assume that objects reached through references are not null
-(C++ only).
-.Sp
-Normally, GNU C++ makes conservative assumptions about objects reached
-through references. For example, the compiler must check that \c
-.B a
-is not null in code like the following:
-.Sp
-obj &a = g ();
-a.f (2);
-.Sp
-Checking that references of this sort have non-null values requires
-extra code, however, and it is unnecessary for many programs. You can
-use `\|\c
-.B \-fnonnull-objects\c
-\&\|' to omit the checks for null, if your
-program doesn't require checking.
-.TP
-.B \-fpcc\-struct\-return
-Use the same convention for returning \c
-.B struct\c
-\& and \c
-.B union
-values that is used by the usual C compiler on your system. This
-convention is less efficient for small structures, and on many
-machines it fails to be reentrant; but it has the advantage of
-allowing intercallability between GCC-compiled code and PCC-compiled
-code.
-.TP
-.B \-freg\-struct\-return
-Use the convention that
-.B struct
-and
-.B union
-values are returned in registers when possible. This is more
-efficient for small structures than
-.BR \-fpcc\-struct\-return .
-.Sp
-If you specify neither
-.B \-fpcc\-struct\-return
-nor
-.BR \-freg\-struct\-return ,
-GNU CC defaults to whichever convention is standard for the target.
-If there is no standard convention, GNU CC defaults to
-.BR \-fpcc\-struct\-return .
-.TP
-.B \-fshort\-enums
-Allocate to an \c
-.B enum\c
-\& type only as many bytes as it needs for the
-declared range of possible values. Specifically, the \c
-.B enum\c
-\& type
-will be equivalent to the smallest integer type which has enough room.
-.TP
-.B \-fshort\-double
-Use the same size for
-.B double
-as for
-.B float
-\&.
-.TP
-.B \-fshared\-data
-Requests that the data and non-\c
-.B const\c
-\& variables of this
-compilation be shared data rather than private data. The distinction
-makes sense only on certain operating systems, where shared data is
-shared between processes running the same program, while private data
-exists in one copy per process.
-.TP
-.B \-fno\-common
-Allocate even uninitialized global variables in the bss section of the
-object file, rather than generating them as common blocks. This has the
-effect that if the same variable is declared (without \c
-.B extern\c
-\&) in
-two different compilations, you will get an error when you link them.
-The only reason this might be useful is if you wish to verify that the
-program will work on other systems which always work this way.
-.TP
-.B \-fno\-ident
-Ignore the `\|\c
-.B #ident\c
-\&\|' directive.
-.TP
-.B \-fno\-gnu\-linker
-Do not output global initializations (such as C++ constructors and
-destructors) in the form used by the GNU linker (on systems where the GNU
-linker is the standard method of handling them). Use this option when
-you want to use a non-GNU linker, which also requires using the
-.B collect2\c
-\& program to make sure the system linker includes
-constructors and destructors. (\c
-.B collect2\c
-\& is included in the GNU CC
-distribution.) For systems which \c
-.I must\c
-\& use \c
-.B collect2\c
-\&, the
-compiler driver \c
-.B gcc\c
-\& is configured to do this automatically.
-.TP
-.B \-finhibit-size-directive
-Don't output a \c
-.B .size\c
-\& assembler directive, or anything else that
-would cause trouble if the function is split in the middle, and the
-two halves are placed at locations far apart in memory. This option is
-used when compiling `\|\c
-.B crtstuff.c\c
-\&\|'; you should not need to use it
-for anything else.
-.TP
-.B \-fverbose-asm
-Put extra commentary information in the generated assembly code to
-make it more readable. This option is generally only of use to those
-who actually need to read the generated assembly code (perhaps while
-debugging the compiler itself).
-.TP
-.B \-fvolatile
-Consider all memory references through pointers to be volatile.
-.TP
-.B \-fvolatile\-global
-Consider all memory references to extern and global data items to
-be volatile.
-.TP
-.B \-fpic
-If supported for the target machines, generate position-independent code,
-suitable for use in a shared library.
-.TP
-.B \-fPIC
-If supported for the target machine, emit position-independent code,
-suitable for dynamic linking, even if branches need large displacements.
-.TP
-.BI "\-ffixed\-" "reg"
-Treat the register named \c
-.I reg\c
-\& as a fixed register; generated code
-should never refer to it (except perhaps as a stack pointer, frame
-pointer or in some other fixed role).
-.Sp
-.I reg\c
-\& must be the name of a register. The register names accepted
-are machine-specific and are defined in the \c
-.B REGISTER_NAMES
-macro in the machine description macro file.
-.Sp
-This flag does not have a negative form, because it specifies a
-three-way choice.
-.TP
-.BI "\-fcall\-used\-" "reg"
-Treat the register named \c
-.I reg\c
-\& as an allocable register that is
-clobbered by function calls. It may be allocated for temporaries or
-variables that do not live across a call. Functions compiled this way
-will not save and restore the register \c
-.I reg\c
-\&.
-.Sp
-Use of this flag for a register that has a fixed pervasive role in the
-machine's execution model, such as the stack pointer or frame pointer,
-will produce disastrous results.
-.Sp
-This flag does not have a negative form, because it specifies a
-three-way choice.
-.TP
-.BI "\-fcall\-saved\-" "reg"
-Treat the register named \c
-.I reg\c
-\& as an allocable register saved by
-functions. It may be allocated even for temporaries or variables that
-live across a call. Functions compiled this way will save and restore
-the register \c
-.I reg\c
-\& if they use it.
-.Sp
-Use of this flag for a register that has a fixed pervasive role in the
-machine's execution model, such as the stack pointer or frame pointer,
-will produce disastrous results.
-.Sp
-A different sort of disaster will result from the use of this flag for
-a register in which function values may be returned.
-.Sp
-This flag does not have a negative form, because it specifies a
-three-way choice.
-.SH PRAGMAS
-Two `\|\c
-.B #pragma\c
-\&\|' directives are supported for GNU C++, to permit using the same
-header file for two purposes: as a definition of interfaces to a given
-object class, and as the full definition of the contents of that object class.
-.TP
-.B #pragma interface
-(C++ only.)
-Use this directive in header files that define object classes, to save
-space in most of the object files that use those classes. Normally,
-local copies of certain information (backup copies of inline member
-functions, debugging information, and the internal tables that
-implement virtual functions) must be kept in each object file that
-includes class definitions. You can use this pragma to avoid such
-duplication. When a header file containing `\|\c
-.B #pragma interface\c
-\&\|' is included in a compilation, this auxiliary information
-will not be generated (unless the main input source file itself uses
-`\|\c
-.B #pragma implementation\c
-\&\|'). Instead, the object files will contain references to be
-resolved at link time.
-.TP
-.B #pragma implementation
-.TP
-\fB#pragma implementation "\fP\fIobjects\fP\fB.h"\fP
-(C++ only.)
-Use this pragma in a main input file, when you want full output from
-included header files to be generated (and made globally visible).
-The included header file, in turn, should use `\|\c
-.B #pragma interface\c
-\&\|'.
-Backup copies of inline member functions, debugging information, and
-the internal tables used to implement virtual functions are all
-generated in implementation files.
-.Sp
-If you use `\|\c
-.B #pragma implementation\c
-\&\|' with no argument, it applies to an include file with the same
-basename as your source file; for example, in `\|\c
-.B allclass.cc\c
-\&\|', `\|\c
-.B #pragma implementation\c
-\&\|' by itself is equivalent to `\|\c
-.B
-#pragma implementation "allclass.h"\c
-\&\|'. Use the string argument if you want a single implementation
-file to include code from multiple header files.
-.Sp
-There is no way to split up the contents of a single header file into
-multiple implementation files.
-.SH FILES
-.nf
-.ta \w'LIBDIR/g++\-include 'u
-file.c C source file
-file.h C header (preprocessor) file
-file.i preprocessed C source file
-file.C C++ source file
-file.cc C++ source file
-file.cxx C++ source file
-file.m Objective-C source file
-file.s assembly language file
-file.o object file
-a.out link edited output
-\fITMPDIR\fR/cc\(** temporary files
-\fILIBDIR\fR/cpp preprocessor
-\fILIBDIR\fR/cc1 compiler for C
-\fILIBDIR\fR/cc1plus compiler for C++
-\fILIBDIR\fR/collect linker front end needed on some machines
-\fILIBDIR\fR/libgcc.a GCC subroutine library
-/lib/crt[01n].o start-up routine
-\fILIBDIR\fR/ccrt0 additional start-up routine for C++
-/lib/libc.a standard C library, see
-.IR intro (3)
-/usr/include standard directory for \fB#include\fP files
-\fILIBDIR\fR/include standard gcc directory for \fB#include\fP files
-\fILIBDIR\fR/g++\-include additional g++ directory for \fB#include\fP
-.Sp
-.fi
-.I LIBDIR
-is usually
-.B /usr/local/lib/\c
-.IR machine / version .
-.br
-.I TMPDIR
-comes from the environment variable
-.B TMPDIR
-(default
-.B /usr/tmp
-if available, else
-.B /tmp\c
-\&).
-.SH "SEE ALSO"
-cpp(1), as(1), ld(1), gdb(1), adb(1), dbx(1), sdb(1).
-.br
-.RB "`\|" gcc "\|', `\|" cpp \|',
-.RB "`\|" as "\|', `\|" ld \|',
-and
-.RB `\| gdb \|'
-entries in
-.B info\c
-\&.
-.br
-.I
-Using and Porting GNU CC (for version 2.0)\c
-, Richard M. Stallman;
-.I
-The C Preprocessor\c
-, Richard M. Stallman;
-.I
-Debugging with GDB: the GNU Source-Level Debugger\c
-, Richard M. Stallman and Roland H. Pesch;
-.I
-Using as: the GNU Assembler\c
-, Dean Elsner, Jay Fenlason & friends;
-.I
-ld: the GNU linker\c
-, Steve Chamberlain and Roland Pesch.
-.SH BUGS
-For instructions on reporting bugs, see the GCC manual.
-.SH COPYING
-Copyright
-.if t \(co
-1991, 1992, 1993 Free Software Foundation, Inc.
-.PP
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-.PP
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided that the
-entire resulting derived work is distributed under the terms of a
-permission notice identical to this one.
-.PP
-Permission is granted to copy and distribute translations of this
-manual into another language, under the above conditions for modified
-versions, except that this permission notice may be included in
-translations approved by the Free Software Foundation instead of in
-the original English.
-.SH AUTHORS
-See the GNU CC Manual for the contributors to GNU CC.
diff --git a/contrib/gcc/gcc.texi b/contrib/gcc/gcc.texi
deleted file mode 100644
index 9c1f4505b051..000000000000
--- a/contrib/gcc/gcc.texi
+++ /dev/null
@@ -1,4776 +0,0 @@
-\input texinfo @c -*-texinfo-*-
-@c %**start of header
-@setfilename gcc.info
-@c @setfilename usegcc.info
-@c @setfilename portgcc.info
-@c To produce the full manual, use the "gcc.info" setfilename, and
-@c make sure the following do NOT begin with '@c' (and the @clear lines DO)
-@set INTERNALS
-@set USING
-@c To produce a user-only manual, use the "usegcc.info" setfilename, and
-@c make sure the following does NOT begin with '@c':
-@c @clear INTERNALS
-@c To produce a porter-only manual, use the "portgcc.info" setfilename,
-@c and make sure the following does NOT begin with '@c':
-@c @clear USING
-
-@c (For FSF printing, turn on smallbook, comment out finalout below;
-@c that is all that is needed.)
-
-@c 6/27/96 FSF DO wants smallbook fmt for 1st bound edition.
-@c @smallbook
-
-@c i also commented out the finalout command, so if there *are* any
-@c overfulls, you'll (hopefully) see the rectangle in the right hand
-@c margin. -mew 15june93
-@c @finalout
-
-@c NOTE: checks/things to do:
-@c
-@c -have bob do a search in all seven files for "mew" (ideally --mew,
-@c but i may have forgotten the occasional "--"..).
-@c Just checked... all have `--'! Bob 22Jul96
-@c Use this to search: grep -n '\-\-mew' *.texi
-@c -item/itemx, text after all (sub/sub)section titles, etc..
-@c -consider putting the lists of options on pp 17--> etc in columns or
-@c some such.
-@c -spellcheck
-@c -continuity of phrasing; ie, bit-field vs bitfield in rtl.texi
-@c -overfulls. do a search for "mew" in the files, and you will see
-@c overfulls that i noted but could not deal with.
-@c -have to add text: beginning of chapter 8
-
-@c
-@c anything else? --mew 10feb93
-
-
-
-@ifset INTERNALS
-@ifset USING
-@settitle Using and Porting the GNU Compiler Collection (GCC)
-@end ifset
-@end ifset
-@c seems reasonable to assume at least one of INTERNALS or USING is set...
-@ifclear INTERNALS
-@settitle Using the GNU Compiler Collection
-@end ifclear
-@ifclear USING
-@settitle Porting the GNU Compiler Collection
-@end ifclear
-
-@syncodeindex fn cp
-@syncodeindex vr cp
-@c %**end of header
-
-@c Use with @@smallbook.
-
-@c Cause even numbered pages to be printed on the left hand side of
-@c the page and odd numbered pages to be printed on the right hand
-@c side of the page. Using this, you can print on both sides of a
-@c sheet of paper and have the text on the same part of the sheet.
-
-@c The text on right hand pages is pushed towards the right hand
-@c margin and the text on left hand pages is pushed toward the left
-@c hand margin.
-@c (To provide the reverse effect, set bindingoffset to -0.75in.)
-
-@c @tex
-@c \global\bindingoffset=0.75in
-@c \global\normaloffset =0.75in
-@c @end tex
-
-@ifinfo
-@dircategory Programming
-@direntry
-* gcc: (gcc). The GNU Compiler Collection.
-@end direntry
-@ifset INTERNALS
-@ifset USING
-This file documents the use and the internals of the GNU compiler.
-@end ifset
-@end ifset
-@ifclear USING
-This file documents the internals of the GNU compiler.
-@end ifclear
-@ifclear INTERNALS
-This file documents the use of the GNU compiler.
-@end ifclear
-
-Published by the Free Software Foundation
-59 Temple Place - Suite 330
-Boston, MA 02111-1307 USA
-
-Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
-
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-
-@ignore
-Permission is granted to process this file through Tex and print the
-results, provided the printed document carries copying permission
-notice identical to this one except for the removal of this paragraph
-(this paragraph not being relevant to the printed manual).
-
-@end ignore
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided also that the
-sections entitled ``GNU General Public License'' and ``Funding for Free
-Software'' are included exactly as in the original, and provided that
-the entire resulting derived work is distributed under the terms of a
-permission notice identical to this one.
-
-Permission is granted to copy and distribute translations of this manual
-into another language, under the above conditions for modified versions,
-except that the sections entitled ``GNU General Public License'' and
-``Funding for Free Software'', and this permission notice, may be
-included in translations approved by the Free Software Foundation
-instead of in the original English.
-@end ifinfo
-
-@setchapternewpage odd
-@c @finalout
-@titlepage
-@ifset INTERNALS
-@ifset USING
-@center @titlefont{Using and Porting the GNU Compiler Collection}
-
-@end ifset
-@end ifset
-@ifclear INTERNALS
-@title Using the GNU Compiler Collection
-@end ifclear
-@ifclear USING
-@title Porting the GNU Compiler Collection
-@end ifclear
-@sp 2
-@center Richard M. Stallman
-@sp 3
-@center Last updated 28 July 1999
-@sp 1
-@c The version number appears five times more in this file.
-
-@center for gcc-2.95
-@page
-@vskip 0pt plus 1filll
-Copyright @copyright{} 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1998, 1999 Free Software Foundation, Inc.
-@sp 2
-For GCC Version 2.95@*
-@sp 1
-Published by the Free Software Foundation @*
-59 Temple Place - Suite 330@*
-Boston, MA 02111-1307, USA@*
-Last printed April, 1998.@*
-Printed copies are available for $50 each.@*
-ISBN 1-882114-37-X
-@sp 1
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided also that the
-sections entitled ``GNU General Public License'' and ``Funding for Free
-Software'' are included exactly as in the original, and provided that
-the entire resulting derived work is distributed under the terms of a
-permission notice identical to this one.
-
-Permission is granted to copy and distribute translations of this manual
-into another language, under the above conditions for modified versions,
-except that the sections entitled ``GNU General Public License'' and
-``Funding for Free Software'', and this permission notice, may be
-included in translations approved by the Free Software Foundation
-instead of in the original English.
-@end titlepage
-@page
-
-@ifinfo
-
-@node Top, G++ and GCC,, (DIR)
-@top Introduction
-@cindex introduction
-
-@ifset INTERNALS
-@ifset USING
-This manual documents how to run, install and port the GNU
-compiler, as well as its new features and incompatibilities, and how to
-report bugs. It corresponds to GCC version 2.95.
-@end ifset
-@end ifset
-
-@ifclear INTERNALS
-This manual documents how to run and install the GNU compiler,
-as well as its new features and incompatibilities, and how to report
-bugs. It corresponds to GCC version 2.95.
-@end ifclear
-@ifclear USING
-This manual documents how to port the GNU compiler,
-as well as its new features and incompatibilities, and how to report
-bugs. It corresponds to GCC version 2.95.
-@end ifclear
-
-@end ifinfo
-@menu
-@ifset USING
-* G++ and GCC:: You can compile C or C++ programs.
-* Invoking GCC:: Command options supported by @samp{gcc}.
-* Installation:: How to configure, compile and install GCC.
-* C Extensions:: GNU extensions to the C language family.
-* C++ Extensions:: GNU extensions to the C++ language.
-* Gcov:: gcov: a GCC test coverage program.
-* Trouble:: If you have trouble installing GCC.
-* Bugs:: How, why and where to report bugs.
-* Service:: How to find suppliers of support for GCC.
-* Contributing:: How to contribute to testing and developing GCC.
-* VMS:: Using GCC on VMS.
-@end ifset
-@ifset INTERNALS
-* Portability:: Goals of GCC's portability features.
-* Interface:: Function-call interface of GCC output.
-* Passes:: Order of passes, what they do, and what each file is for.
-* RTL:: The intermediate representation that most passes work on.
-* Machine Desc:: How to write machine description instruction patterns.
-* Target Macros:: How to write the machine description C macros.
-* Config:: Writing the @file{xm-@var{machine}.h} file.
-* Fragments:: Writing the @file{t-@var{target}} and @file{x-@var{host}} files.
-@end ifset
-
-* Funding:: How to help assure funding for free software.
-* GNU/Linux:: Linux and the GNU Project
-
-* Copying:: GNU General Public License says
- how you can copy and share GCC.
-* Contributors:: People who have contributed to GCC.
-
-* Index:: Index of concepts and symbol names.
-@end menu
-
-@ifset USING
-@node G++ and GCC
-@chapter Compile C, C++, Objective C, or Fortran
-
-@cindex Objective C
-The C, C++, and Objective C, and Fortran versions of the compiler are
-integrated; this is why we use the name ``GNU Compiler Collection''.
-GCC can compile programs written in C, C++, Objective C, or Fortran.
-The Fortran compiler is described in a separate manual.
-
-@cindex GCC
-``GCC'' is a common shorthand term for the GNU Compiler Collection. This is both
-the most general name for the compiler, and the name used when the
-emphasis is on compiling C programs (as the abbreviation formerly
-stood for ``GNU C Compiler'').
-
-@cindex C++
-@cindex G++
-When referring to C++ compilation, it is usual to call the compiler
-``G++''. Since there is only one compiler, it is also accurate to call
-it ``GCC'' no matter what the language context; however, the term
-``G++'' is more useful when the emphasis is on compiling C++ programs.
-
-We use the name ``GCC'' to refer to the compilation system as a
-whole, and more specifically to the language-independent part of the
-compiler. For example, we refer to the optimization options as
-affecting the behavior of ``GCC'' or sometimes just ``the compiler''.
-
-Front ends for other languages, such as Ada 9X, Fortran, Modula-3, and
-Pascal, are under development. These front-ends, like that for C++, are
-built in subdirectories of GCC and link to it. The result is an
-integrated compiler that can compile programs written in C, C++,
-Objective C, or any of the languages for which you have installed front
-ends.
-
-In this manual, we only discuss the options for the C, Objective-C, and
-C++ compilers and those of the GCC core. Consult the documentation
-of the other front ends for the options to use when compiling programs
-written in other languages.
-
-@cindex compiler compared to C++ preprocessor
-@cindex intermediate C version, nonexistent
-@cindex C intermediate output, nonexistent
-G++ is a @emph{compiler}, not merely a preprocessor. G++ builds object
-code directly from your C++ program source. There is no intermediate C
-version of the program. (By contrast, for example, some other
-implementations use a program that generates a C program from your C++
-source.) Avoiding an intermediate C representation of the program means
-that you get better object code, and better debugging information. The
-GNU debugger, GDB, works with this information in the object code to
-give you comprehensive C++ source-level editing capabilities
-(@pxref{C,,C and C++,gdb.info, Debugging with GDB}).
-
-@c FIXME! Someone who knows something about Objective C ought to put in
-@c a paragraph or two about it here, and move the index entry down when
-@c there is more to point to than the general mention in the 1st par.
-
-@include invoke.texi
-
-@include install.texi
-
-@include extend.texi
-
-@include gcov.texi
-
-@node Trouble
-@chapter Known Causes of Trouble with GCC
-@cindex bugs, known
-@cindex installation trouble
-@cindex known causes of trouble
-
-This section describes known problems that affect users of GCC. Most
-of these are not GCC bugs per se---if they were, we would fix them.
-But the result for a user may be like the result of a bug.
-
-Some of these problems are due to bugs in other software, some are
-missing features that are too much work to add, and some are places
-where people's opinions differ as to what is best.
-
-@menu
-* Actual Bugs:: Bugs we will fix later.
-* Installation Problems:: Problems that manifest when you install GCC.
-* Cross-Compiler Problems:: Common problems of cross compiling with GCC.
-* Interoperation:: Problems using GCC with other compilers,
- and with certain linkers, assemblers and debuggers.
-* External Bugs:: Problems compiling certain programs.
-* Incompatibilities:: GCC is incompatible with traditional C.
-* Fixed Headers:: GNU C uses corrected versions of system header files.
- This is necessary, but doesn't always work smoothly.
-* Standard Libraries:: GNU C uses the system C library, which might not be
- compliant with the ISO/ANSI C standard.
-* Disappointments:: Regrettable things we can't change, but not quite bugs.
-* C++ Misunderstandings:: Common misunderstandings with GNU C++.
-* Protoize Caveats:: Things to watch out for when using @code{protoize}.
-* Non-bugs:: Things we think are right, but some others disagree.
-* Warnings and Errors:: Which problems in your code get warnings,
- and which get errors.
-@end menu
-
-@node Actual Bugs
-@section Actual Bugs We Haven't Fixed Yet
-
-@itemize @bullet
-@item
-The @code{fixincludes} script interacts badly with automounters; if the
-directory of system header files is automounted, it tends to be
-unmounted while @code{fixincludes} is running. This would seem to be a
-bug in the automounter. We don't know any good way to work around it.
-
-@item
-The @code{fixproto} script will sometimes add prototypes for the
-@code{sigsetjmp} and @code{siglongjmp} functions that reference the
-@code{jmp_buf} type before that type is defined. To work around this,
-edit the offending file and place the typedef in front of the
-prototypes.
-
-@item
-There are several obscure case of mis-using struct, union, and
-enum tags that are not detected as errors by the compiler.
-
-@item
-When @samp{-pedantic-errors} is specified, GCC will incorrectly give
-an error message when a function name is specified in an expression
-involving the comma operator.
-
-@item
-Loop unrolling doesn't work properly for certain C++ programs. This is
-a bug in the C++ front end. It sometimes emits incorrect debug info, and
-the loop unrolling code is unable to recover from this error.
-@end itemize
-
-@node Installation Problems
-@section Installation Problems
-
-This is a list of problems (and some apparent problems which don't
-really mean anything is wrong) that show up during installation of GNU
-CC.
-
-@itemize @bullet
-@item
-On certain systems, defining certain environment variables such as
-@code{CC} can interfere with the functioning of @code{make}.
-
-@item
-If you encounter seemingly strange errors when trying to build the
-compiler in a directory other than the source directory, it could be
-because you have previously configured the compiler in the source
-directory. Make sure you have done all the necessary preparations.
-@xref{Other Dir}.
-
-@item
-If you build GCC on a BSD system using a directory stored in a System
-V file system, problems may occur in running @code{fixincludes} if the
-System V file system doesn't support symbolic links. These problems
-result in a failure to fix the declaration of @code{size_t} in
-@file{sys/types.h}. If you find that @code{size_t} is a signed type and
-that type mismatches occur, this could be the cause.
-
-The solution is not to use such a directory for building GCC.
-
-@item
-In previous versions of GCC, the @code{gcc} driver program looked for
-@code{as} and @code{ld} in various places; for example, in files
-beginning with @file{/usr/local/lib/gcc-}. GCC version 2 looks for
-them in the directory
-@file{/usr/local/lib/gcc-lib/@var{target}/@var{version}}.
-
-Thus, to use a version of @code{as} or @code{ld} that is not the system
-default, for example @code{gas} or GNU @code{ld}, you must put them in
-that directory (or make links to them from that directory).
-
-@item
-Some commands executed when making the compiler may fail (return a
-non-zero status) and be ignored by @code{make}. These failures, which
-are often due to files that were not found, are expected, and can safely
-be ignored.
-
-@item
-It is normal to have warnings in compiling certain files about
-unreachable code and about enumeration type clashes. These files' names
-begin with @samp{insn-}. Also, @file{real.c} may get some warnings that
-you can ignore.
-
-@item
-Sometimes @code{make} recompiles parts of the compiler when installing
-the compiler. In one case, this was traced down to a bug in
-@code{make}. Either ignore the problem or switch to GNU Make.
-
-@item
-If you have installed a program known as purify, you may find that it
-causes errors while linking @code{enquire}, which is part of building
-GCC. The fix is to get rid of the file @code{real-ld} which purify
-installs---so that GCC won't try to use it.
-
-@item
-On GNU/Linux SLS 1.01, there is a problem with @file{libc.a}: it does not
-contain the obstack functions. However, GCC assumes that the obstack
-functions are in @file{libc.a} when it is the GNU C library. To work
-around this problem, change the @code{__GNU_LIBRARY__} conditional
-around line 31 to @samp{#if 1}.
-
-@item
-On some 386 systems, building the compiler never finishes because
-@code{enquire} hangs due to a hardware problem in the motherboard---it
-reports floating point exceptions to the kernel incorrectly. You can
-install GCC except for @file{float.h} by patching out the command to
-run @code{enquire}. You may also be able to fix the problem for real by
-getting a replacement motherboard. This problem was observed in
-Revision E of the Micronics motherboard, and is fixed in Revision F.
-It has also been observed in the MYLEX MXA-33 motherboard.
-
-If you encounter this problem, you may also want to consider removing
-the FPU from the socket during the compilation. Alternatively, if you
-are running SCO Unix, you can reboot and force the FPU to be ignored.
-To do this, type @samp{hd(40)unix auto ignorefpu}.
-
-@item
-On some 386 systems, GCC crashes trying to compile @file{enquire.c}.
-This happens on machines that don't have a 387 FPU chip. On 386
-machines, the system kernel is supposed to emulate the 387 when you
-don't have one. The crash is due to a bug in the emulator.
-
-One of these systems is the Unix from Interactive Systems: 386/ix.
-On this system, an alternate emulator is provided, and it does work.
-To use it, execute this command as super-user:
-
-@example
-ln /etc/emulator.rel1 /etc/emulator
-@end example
-
-@noindent
-and then reboot the system. (The default emulator file remains present
-under the name @file{emulator.dflt}.)
-
-Try using @file{/etc/emulator.att}, if you have such a problem on the
-SCO system.
-
-Another system which has this problem is Esix. We don't know whether it
-has an alternate emulator that works.
-
-On NetBSD 0.8, a similar problem manifests itself as these error messages:
-
-@example
-enquire.c: In function `fprop':
-enquire.c:2328: floating overflow
-@end example
-
-@item
-On SCO systems, when compiling GCC with the system's compiler,
-do not use @samp{-O}. Some versions of the system's compiler miscompile
-GCC with @samp{-O}.
-
-@cindex @code{genflags}, crash on Sun 4
-@item
-Sometimes on a Sun 4 you may observe a crash in the program
-@code{genflags} or @code{genoutput} while building GCC. This is said to
-be due to a bug in @code{sh}. You can probably get around it by running
-@code{genflags} or @code{genoutput} manually and then retrying the
-@code{make}.
-
-@item
-On Solaris 2, executables of GCC version 2.0.2 are commonly
-available, but they have a bug that shows up when compiling current
-versions of GCC: undefined symbol errors occur during assembly if you
-use @samp{-g}.
-
-The solution is to compile the current version of GCC without
-@samp{-g}. That makes a working compiler which you can use to recompile
-with @samp{-g}.
-
-@item
-Solaris 2 comes with a number of optional OS packages. Some of these
-packages are needed to use GCC fully. If you did not install all
-optional packages when installing Solaris, you will need to verify that
-the packages that GCC needs are installed.
-
-To check whether an optional package is installed, use
-the @code{pkginfo} command. To add an optional package, use the
-@code{pkgadd} command. For further details, see the Solaris
-documentation.
-
-For Solaris 2.0 and 2.1, GCC needs six packages: @samp{SUNWarc},
-@samp{SUNWbtool}, @samp{SUNWesu}, @samp{SUNWhea}, @samp{SUNWlibm}, and
-@samp{SUNWtoo}.
-
-For Solaris 2.2, GCC needs an additional seventh package: @samp{SUNWsprot}.
-
-@item
-On Solaris 2, trying to use the linker and other tools in
-@file{/usr/ucb} to install GCC has been observed to cause trouble.
-For example, the linker may hang indefinitely. The fix is to remove
-@file{/usr/ucb} from your @code{PATH}.
-
-@item
-If you use the 1.31 version of the MIPS assembler (such as was shipped
-with Ultrix 3.1), you will need to use the -fno-delayed-branch switch
-when optimizing floating point code. Otherwise, the assembler will
-complain when the GCC compiler fills a branch delay slot with a
-floating point instruction, such as @code{add.d}.
-
-@item
-If on a MIPS system you get an error message saying ``does not have gp
-sections for all it's [sic] sectons [sic]'', don't worry about it. This
-happens whenever you use GAS with the MIPS linker, but there is not
-really anything wrong, and it is okay to use the output file. You can
-stop such warnings by installing the GNU linker.
-
-It would be nice to extend GAS to produce the gp tables, but they are
-optional, and there should not be a warning about their absence.
-
-@item
-In Ultrix 4.0 on the MIPS machine, @file{stdio.h} does not work with GNU
-CC at all unless it has been fixed with @code{fixincludes}. This causes
-problems in building GCC. Once GCC is installed, the problems go
-away.
-
-To work around this problem, when making the stage 1 compiler, specify
-this option to Make:
-
-@example
-GCC_FOR_TARGET="./xgcc -B./ -I./include"
-@end example
-
-When making stage 2 and stage 3, specify this option:
-
-@example
-CFLAGS="-g -I./include"
-@end example
-
-@item
-Users have reported some problems with version 2.0 of the MIPS
-compiler tools that were shipped with Ultrix 4.1. Version 2.10
-which came with Ultrix 4.2 seems to work fine.
-
-Users have also reported some problems with version 2.20 of the
-MIPS compiler tools that were shipped with RISC/os 4.x. The earlier
-version 2.11 seems to work fine.
-
-@item
-Some versions of the MIPS linker will issue an assertion failure
-when linking code that uses @code{alloca} against shared
-libraries on RISC-OS 5.0, and DEC's OSF/1 systems. This is a bug
-in the linker, that is supposed to be fixed in future revisions.
-To protect against this, GCC passes @samp{-non_shared} to the
-linker unless you pass an explicit @samp{-shared} or
-@samp{-call_shared} switch.
-
-@item
-On System V release 3, you may get this error message
-while linking:
-
-@smallexample
-ld fatal: failed to write symbol name @var{something}
- in strings table for file @var{whatever}
-@end smallexample
-
-This probably indicates that the disk is full or your ULIMIT won't allow
-the file to be as large as it needs to be.
-
-This problem can also result because the kernel parameter @code{MAXUMEM}
-is too small. If so, you must regenerate the kernel and make the value
-much larger. The default value is reported to be 1024; a value of 32768
-is said to work. Smaller values may also work.
-
-@item
-On System V, if you get an error like this,
-
-@example
-/usr/local/lib/bison.simple: In function `yyparse':
-/usr/local/lib/bison.simple:625: virtual memory exhausted
-@end example
-
-@noindent
-that too indicates a problem with disk space, ULIMIT, or @code{MAXUMEM}.
-
-@item
-Current GCC versions probably do not work on version 2 of the NeXT
-operating system.
-
-@item
-On NeXTStep 3.0, the Objective C compiler does not work, due,
-apparently, to a kernel bug that it happens to trigger. This problem
-does not happen on 3.1.
-
-@item
-On the Tower models 4@var{n}0 and 6@var{n}0, by default a process is not
-allowed to have more than one megabyte of memory. GCC cannot compile
-itself (or many other programs) with @samp{-O} in that much memory.
-
-To solve this problem, reconfigure the kernel adding the following line
-to the configuration file:
-
-@smallexample
-MAXUMEM = 4096
-@end smallexample
-
-@item
-On HP 9000 series 300 or 400 running HP-UX release 8.0, there is a bug
-in the assembler that must be fixed before GCC can be built. This
-bug manifests itself during the first stage of compilation, while
-building @file{libgcc2.a}:
-
-@smallexample
-_floatdisf
-cc1: warning: `-g' option not supported on this version of GCC
-cc1: warning: `-g1' option not supported on this version of GCC
-./xgcc: Internal compiler error: program as got fatal signal 11
-@end smallexample
-
-A patched version of the assembler is available by anonymous ftp from
-@code{altdorf.ai.mit.edu} as the file
-@file{archive/cph/hpux-8.0-assembler}. If you have HP software support,
-the patch can also be obtained directly from HP, as described in the
-following note:
-
-@quotation
-This is the patched assembler, to patch SR#1653-010439, where the
-assembler aborts on floating point constants.
-
-The bug is not really in the assembler, but in the shared library
-version of the function ``cvtnum(3c)''. The bug on ``cvtnum(3c)'' is
-SR#4701-078451. Anyway, the attached assembler uses the archive
-library version of ``cvtnum(3c)'' and thus does not exhibit the bug.
-@end quotation
-
-This patch is also known as PHCO_4484.
-
-@item
-On HP-UX version 8.05, but not on 8.07 or more recent versions,
-the @code{fixproto} shell script triggers a bug in the system shell.
-If you encounter this problem, upgrade your operating system or
-use BASH (the GNU shell) to run @code{fixproto}.
-
-@item
-Some versions of the Pyramid C compiler are reported to be unable to
-compile GCC. You must use an older version of GCC for
-bootstrapping. One indication of this problem is if you get a crash
-when GCC compiles the function @code{muldi3} in file @file{libgcc2.c}.
-
-You may be able to succeed by getting GCC version 1, installing it,
-and using it to compile GCC version 2. The bug in the Pyramid C
-compiler does not seem to affect GCC version 1.
-
-@item
-There may be similar problems on System V Release 3.1 on 386 systems.
-
-@item
-On the Intel Paragon (an i860 machine), if you are using operating
-system version 1.0, you will get warnings or errors about redefinition
-of @code{va_arg} when you build GCC.
-
-If this happens, then you need to link most programs with the library
-@file{iclib.a}. You must also modify @file{stdio.h} as follows: before
-the lines
-
-@example
-#if defined(__i860__) && !defined(_VA_LIST)
-#include <va_list.h>
-@end example
-
-@noindent
-insert the line
-
-@example
-#if __PGC__
-@end example
-
-@noindent
-and after the lines
-
-@example
-extern int vprintf(const char *, va_list );
-extern int vsprintf(char *, const char *, va_list );
-#endif
-@end example
-
-@noindent
-insert the line
-
-@example
-#endif /* __PGC__ */
-@end example
-
-These problems don't exist in operating system version 1.1.
-
-@item
-On the Altos 3068, programs compiled with GCC won't work unless you
-fix a kernel bug. This happens using system versions V.2.2 1.0gT1 and
-V.2.2 1.0e and perhaps later versions as well. See the file
-@file{README.ALTOS}.
-
-@item
-You will get several sorts of compilation and linking errors on the
-we32k if you don't follow the special instructions. @xref{Configurations}.
-
-@item
-A bug in the HP-UX 8.05 (and earlier) shell will cause the fixproto
-program to report an error of the form:
-
-@example
-./fixproto: sh internal 1K buffer overflow
-@end example
-
-To fix this, change the first line of the fixproto script to look like:
-
-@example
-#!/bin/ksh
-@end example
-@end itemize
-
-@node Cross-Compiler Problems
-@section Cross-Compiler Problems
-
-You may run into problems with cross compilation on certain machines,
-for several reasons.
-
-@itemize @bullet
-@item
-Cross compilation can run into trouble for certain machines because
-some target machines' assemblers require floating point numbers to be
-written as @emph{integer} constants in certain contexts.
-
-The compiler writes these integer constants by examining the floating
-point value as an integer and printing that integer, because this is
-simple to write and independent of the details of the floating point
-representation. But this does not work if the compiler is running on
-a different machine with an incompatible floating point format, or
-even a different byte-ordering.
-
-In addition, correct constant folding of floating point values
-requires representing them in the target machine's format.
-(The C standard does not quite require this, but in practice
-it is the only way to win.)
-
-It is now possible to overcome these problems by defining macros such
-as @code{REAL_VALUE_TYPE}. But doing so is a substantial amount of
-work for each target machine.
-@ifset INTERNALS
-@xref{Cross-compilation}.
-@end ifset
-@ifclear INTERNALS
-@xref{Cross-compilation,,Cross Compilation and Floating Point Format,
-gcc.info, Using and Porting GCC}.
-@end ifclear
-
-@item
-At present, the program @file{mips-tfile} which adds debug
-support to object files on MIPS systems does not work in a cross
-compile environment.
-@end itemize
-
-@node Interoperation
-@section Interoperation
-
-This section lists various difficulties encountered in using GNU C or
-GNU C++ together with other compilers or with the assemblers, linkers,
-libraries and debuggers on certain systems.
-
-@itemize @bullet
-@item
-Objective C does not work on the RS/6000.
-
-@item
-GNU C++ does not do name mangling in the same way as other C++
-compilers. This means that object files compiled with one compiler
-cannot be used with another.
-
-This effect is intentional, to protect you from more subtle problems.
-Compilers differ as to many internal details of C++ implementation,
-including: how class instances are laid out, how multiple inheritance is
-implemented, and how virtual function calls are handled. If the name
-encoding were made the same, your programs would link against libraries
-provided from other compilers---but the programs would then crash when
-run. Incompatible libraries are then detected at link time, rather than
-at run time.
-
-@item
-Older GDB versions sometimes fail to read the output of GCC version
-2. If you have trouble, get GDB version 4.4 or later.
-
-@item
-@cindex DBX
-DBX rejects some files produced by GCC, though it accepts similar
-constructs in output from PCC. Until someone can supply a coherent
-description of what is valid DBX input and what is not, there is
-nothing I can do about these problems. You are on your own.
-
-@item
-The GNU assembler (GAS) does not support PIC. To generate PIC code, you
-must use some other assembler, such as @file{/bin/as}.
-
-@item
-On some BSD systems, including some versions of Ultrix, use of profiling
-causes static variable destructors (currently used only in C++) not to
-be run.
-
-@item
-Use of @samp{-I/usr/include} may cause trouble.
-
-Many systems come with header files that won't work with GCC unless
-corrected by @code{fixincludes}. The corrected header files go in a new
-directory; GCC searches this directory before @file{/usr/include}.
-If you use @samp{-I/usr/include}, this tells GCC to search
-@file{/usr/include} earlier on, before the corrected headers. The
-result is that you get the uncorrected header files.
-
-Instead, you should use these options (when compiling C programs):
-
-@smallexample
--I/usr/local/lib/gcc-lib/@var{target}/@var{version}/include -I/usr/include
-@end smallexample
-
-For C++ programs, GCC also uses a special directory that defines C++
-interfaces to standard C subroutines. This directory is meant to be
-searched @emph{before} other standard include directories, so that it
-takes precedence. If you are compiling C++ programs and specifying
-include directories explicitly, use this option first, then the two
-options above:
-
-@example
--I/usr/local/lib/g++-include
-@end example
-
-@ignore
-@cindex @code{vfork}, for the Sun-4
-@item
-There is a bug in @code{vfork} on the Sun-4 which causes the registers
-of the child process to clobber those of the parent. Because of this,
-programs that call @code{vfork} are likely to lose when compiled
-optimized with GCC when the child code alters registers which contain
-C variables in the parent. This affects variables which are live in the
-parent across the call to @code{vfork}.
-
-If you encounter this, you can work around the problem by declaring
-variables @code{volatile} in the function that calls @code{vfork}, until
-the problem goes away, or by not declaring them @code{register} and not
-using @samp{-O} for those source files.
-@end ignore
-
-@item
-On some SGI systems, when you use @samp{-lgl_s} as an option,
-it gets translated magically to @samp{-lgl_s -lX11_s -lc_s}.
-Naturally, this does not happen when you use GCC.
-You must specify all three options explicitly.
-
-@item
-On a Sparc, GCC aligns all values of type @code{double} on an 8-byte
-boundary, and it expects every @code{double} to be so aligned. The Sun
-compiler usually gives @code{double} values 8-byte alignment, with one
-exception: function arguments of type @code{double} may not be aligned.
-
-As a result, if a function compiled with Sun CC takes the address of an
-argument of type @code{double} and passes this pointer of type
-@code{double *} to a function compiled with GCC, dereferencing the
-pointer may cause a fatal signal.
-
-One way to solve this problem is to compile your entire program with GNU
-CC. Another solution is to modify the function that is compiled with
-Sun CC to copy the argument into a local variable; local variables
-are always properly aligned. A third solution is to modify the function
-that uses the pointer to dereference it via the following function
-@code{access_double} instead of directly with @samp{*}:
-
-@smallexample
-inline double
-access_double (double *unaligned_ptr)
-@{
- union d2i @{ double d; int i[2]; @};
-
- union d2i *p = (union d2i *) unaligned_ptr;
- union d2i u;
-
- u.i[0] = p->i[0];
- u.i[1] = p->i[1];
-
- return u.d;
-@}
-@end smallexample
-
-@noindent
-Storing into the pointer can be done likewise with the same union.
-
-@item
-On Solaris, the @code{malloc} function in the @file{libmalloc.a} library
-may allocate memory that is only 4 byte aligned. Since GCC on the
-Sparc assumes that doubles are 8 byte aligned, this may result in a
-fatal signal if doubles are stored in memory allocated by the
-@file{libmalloc.a} library.
-
-The solution is to not use the @file{libmalloc.a} library. Use instead
-@code{malloc} and related functions from @file{libc.a}; they do not have
-this problem.
-
-@item
-Sun forgot to include a static version of @file{libdl.a} with some
-versions of SunOS (mainly 4.1). This results in undefined symbols when
-linking static binaries (that is, if you use @samp{-static}). If you
-see undefined symbols @code{_dlclose}, @code{_dlsym} or @code{_dlopen}
-when linking, compile and link against the file
-@file{mit/util/misc/dlsym.c} from the MIT version of X windows.
-
-@item
-The 128-bit long double format that the Sparc port supports currently
-works by using the architecturally defined quad-word floating point
-instructions. Since there is no hardware that supports these
-instructions they must be emulated by the operating system. Long
-doubles do not work in Sun OS versions 4.0.3 and earlier, because the
-kernel emulator uses an obsolete and incompatible format. Long doubles
-do not work in Sun OS version 4.1.1 due to a problem in a Sun library.
-Long doubles do work on Sun OS versions 4.1.2 and higher, but GCC
-does not enable them by default. Long doubles appear to work in Sun OS
-5.x (Solaris 2.x).
-
-@item
-On HP-UX version 9.01 on the HP PA, the HP compiler @code{cc} does not
-compile GCC correctly. We do not yet know why. However, GCC
-compiled on earlier HP-UX versions works properly on HP-UX 9.01 and can
-compile itself properly on 9.01.
-
-@item
-On the HP PA machine, ADB sometimes fails to work on functions compiled
-with GCC. Specifically, it fails to work on functions that use
-@code{alloca} or variable-size arrays. This is because GCC doesn't
-generate HP-UX unwind descriptors for such functions. It may even be
-impossible to generate them.
-
-@item
-Debugging (@samp{-g}) is not supported on the HP PA machine, unless you use
-the preliminary GNU tools (@pxref{Installation}).
-
-@item
-Taking the address of a label may generate errors from the HP-UX
-PA assembler. GAS for the PA does not have this problem.
-
-@item
-Using floating point parameters for indirect calls to static functions
-will not work when using the HP assembler. There simply is no way for GCC
-to specify what registers hold arguments for static functions when using
-the HP assembler. GAS for the PA does not have this problem.
-
-@item
-In extremely rare cases involving some very large functions you may
-receive errors from the HP linker complaining about an out of bounds
-unconditional branch offset. This used to occur more often in previous
-versions of GCC, but is now exceptionally rare. If you should run
-into it, you can work around by making your function smaller.
-
-@item
-GCC compiled code sometimes emits warnings from the HP-UX assembler of
-the form:
-
-@smallexample
-(warning) Use of GR3 when
- frame >= 8192 may cause conflict.
-@end smallexample
-
-These warnings are harmless and can be safely ignored.
-
-@item
-The current version of the assembler (@file{/bin/as}) for the RS/6000
-has certain problems that prevent the @samp{-g} option in GCC from
-working. Note that @file{Makefile.in} uses @samp{-g} by default when
-compiling @file{libgcc2.c}.
-
-IBM has produced a fixed version of the assembler. The upgraded
-assembler unfortunately was not included in any of the AIX 3.2 update
-PTF releases (3.2.2, 3.2.3, or 3.2.3e). Users of AIX 3.1 should request
-PTF U403044 from IBM and users of AIX 3.2 should request PTF U416277.
-See the file @file{README.RS6000} for more details on these updates.
-
-You can test for the presense of a fixed assembler by using the
-command
-
-@smallexample
-as -u < /dev/null
-@end smallexample
-
-@noindent
-If the command exits normally, the assembler fix already is installed.
-If the assembler complains that "-u" is an unknown flag, you need to
-order the fix.
-
-@item
-On the IBM RS/6000, compiling code of the form
-
-@smallexample
-extern int foo;
-
-@dots{} foo @dots{}
-
-static int foo;
-@end smallexample
-
-@noindent
-will cause the linker to report an undefined symbol @code{foo}.
-Although this behavior differs from most other systems, it is not a
-bug because redefining an @code{extern} variable as @code{static}
-is undefined in ANSI C.
-
-@item
-AIX on the RS/6000 provides support (NLS) for environments outside of
-the United States. Compilers and assemblers use NLS to support
-locale-specific representations of various objects including
-floating-point numbers ("." vs "," for separating decimal fractions).
-There have been problems reported where the library linked with GCC does
-not produce the same floating-point formats that the assembler accepts.
-If you have this problem, set the LANG environment variable to "C" or
-"En_US".
-
-@item
-Even if you specify @samp{-fdollars-in-identifiers},
-you cannot successfully use @samp{$} in identifiers on the RS/6000 due
-to a restriction in the IBM assembler. GAS supports these
-identifiers.
-
-@item
-On the RS/6000, XLC version 1.3.0.0 will miscompile @file{jump.c}. XLC
-version 1.3.0.1 or later fixes this problem. You can obtain XLC-1.3.0.2
-by requesting PTF 421749 from IBM.
-
-@item
-There is an assembler bug in versions of DG/UX prior to 5.4.2.01 that
-occurs when the @samp{fldcr} instruction is used. GCC uses
-@samp{fldcr} on the 88100 to serialize volatile memory references. Use
-the option @samp{-mno-serialize-volatile} if your version of the
-assembler has this bug.
-
-@item
-On VMS, GAS versions 1.38.1 and earlier may cause spurious warning
-messages from the linker. These warning messages complain of mismatched
-psect attributes. You can ignore them. @xref{VMS Install}.
-
-@item
-On NewsOS version 3, if you include both of the files @file{stddef.h}
-and @file{sys/types.h}, you get an error because there are two typedefs
-of @code{size_t}. You should change @file{sys/types.h} by adding these
-lines around the definition of @code{size_t}:
-
-@smallexample
-#ifndef _SIZE_T
-#define _SIZE_T
-@var{actual typedef here}
-#endif
-@end smallexample
-
-@cindex Alliant
-@item
-On the Alliant, the system's own convention for returning structures
-and unions is unusual, and is not compatible with GCC no matter
-what options are used.
-
-@cindex RT PC
-@cindex IBM RT PC
-@item
-On the IBM RT PC, the MetaWare HighC compiler (hc) uses a different
-convention for structure and union returning. Use the option
-@samp{-mhc-struct-return} to tell GCC to use a convention compatible
-with it.
-
-@cindex Vax calling convention
-@cindex Ultrix calling convention
-@item
-On Ultrix, the Fortran compiler expects registers 2 through 5 to be saved
-by function calls. However, the C compiler uses conventions compatible
-with BSD Unix: registers 2 through 5 may be clobbered by function calls.
-
-GCC uses the same convention as the Ultrix C compiler. You can use
-these options to produce code compatible with the Fortran compiler:
-
-@smallexample
--fcall-saved-r2 -fcall-saved-r3 -fcall-saved-r4 -fcall-saved-r5
-@end smallexample
-
-@item
-On the WE32k, you may find that programs compiled with GCC do not
-work with the standard shared C library. You may need to link with
-the ordinary C compiler. If you do so, you must specify the following
-options:
-
-@smallexample
--L/usr/local/lib/gcc-lib/we32k-att-sysv/2.8.1 -lgcc -lc_s
-@end smallexample
-
-The first specifies where to find the library @file{libgcc.a}
-specified with the @samp{-lgcc} option.
-
-GCC does linking by invoking @code{ld}, just as @code{cc} does, and
-there is no reason why it @emph{should} matter which compilation program
-you use to invoke @code{ld}. If someone tracks this problem down,
-it can probably be fixed easily.
-
-@item
-On the Alpha, you may get assembler errors about invalid syntax as a
-result of floating point constants. This is due to a bug in the C
-library functions @code{ecvt}, @code{fcvt} and @code{gcvt}. Given valid
-floating point numbers, they sometimes print @samp{NaN}.
-
-@item
-On Irix 4.0.5F (and perhaps in some other versions), an assembler bug
-sometimes reorders instructions incorrectly when optimization is turned
-on. If you think this may be happening to you, try using the GNU
-assembler; GAS version 2.1 supports ECOFF on Irix.
-
-Or use the @samp{-noasmopt} option when you compile GCC with itself,
-and then again when you compile your program. (This is a temporary
-kludge to turn off assembler optimization on Irix.) If this proves to
-be what you need, edit the assembler spec in the file @file{specs} so
-that it unconditionally passes @samp{-O0} to the assembler, and never
-passes @samp{-O2} or @samp{-O3}.
-@end itemize
-
-@node External Bugs
-@section Problems Compiling Certain Programs
-
-@c prevent bad page break with this line
-Certain programs have problems compiling.
-
-@itemize @bullet
-@item
-Parse errors may occur compiling X11 on a Decstation running Ultrix 4.2
-because of problems in DEC's versions of the X11 header files
-@file{X11/Xlib.h} and @file{X11/Xutil.h}. People recommend adding
-@samp{-I/usr/include/mit} to use the MIT versions of the header files,
-using the @samp{-traditional} switch to turn off ANSI C, or fixing the
-header files by adding this:
-
-@example
-#ifdef __STDC__
-#define NeedFunctionPrototypes 0
-#endif
-@end example
-
-@item
-If you have trouble compiling Perl on a SunOS 4 system, it may be
-because Perl specifies @samp{-I/usr/ucbinclude}. This accesses the
-unfixed header files. Perl specifies the options
-
-@example
--traditional -Dvolatile=__volatile__
--I/usr/include/sun -I/usr/ucbinclude
--fpcc-struct-return
-@end example
-
-@noindent
-most of which are unnecessary with GCC 2.4.5 and newer versions. You
-can make a properly working Perl by setting @code{ccflags} to
-@samp{-fwritable-strings} (implied by the @samp{-traditional} in the
-original options) and @code{cppflags} to empty in @file{config.sh}, then
-typing @samp{./doSH; make depend; make}.
-
-@item
-On various 386 Unix systems derived from System V, including SCO, ISC,
-and ESIX, you may get error messages about running out of virtual memory
-while compiling certain programs.
-
-You can prevent this problem by linking GCC with the GNU malloc
-(which thus replaces the malloc that comes with the system). GNU malloc
-is available as a separate package, and also in the file
-@file{src/gmalloc.c} in the GNU Emacs 19 distribution.
-
-If you have installed GNU malloc as a separate library package, use this
-option when you relink GCC:
-
-@example
-MALLOC=/usr/local/lib/libgmalloc.a
-@end example
-
-Alternatively, if you have compiled @file{gmalloc.c} from Emacs 19, copy
-the object file to @file{gmalloc.o} and use this option when you relink
-GCC:
-
-@example
-MALLOC=gmalloc.o
-@end example
-@end itemize
-
-@node Incompatibilities
-@section Incompatibilities of GCC
-@cindex incompatibilities of GCC
-
-There are several noteworthy incompatibilities between GNU C and most
-existing (non-ANSI) versions of C. The @samp{-traditional} option
-eliminates many of these incompatibilities, @emph{but not all}, by
-telling GNU C to behave like the other C compilers.
-
-@itemize @bullet
-@cindex string constants
-@cindex read-only strings
-@cindex shared strings
-@item
-GCC normally makes string constants read-only. If several
-identical-looking string constants are used, GCC stores only one
-copy of the string.
-
-@cindex @code{mktemp}, and constant strings
-One consequence is that you cannot call @code{mktemp} with a string
-constant argument. The function @code{mktemp} always alters the
-string its argument points to.
-
-@cindex @code{sscanf}, and constant strings
-@cindex @code{fscanf}, and constant strings
-@cindex @code{scanf}, and constant strings
-Another consequence is that @code{sscanf} does not work on some systems
-when passed a string constant as its format control string or input.
-This is because @code{sscanf} incorrectly tries to write into the string
-constant. Likewise @code{fscanf} and @code{scanf}.
-
-The best solution to these problems is to change the program to use
-@code{char}-array variables with initialization strings for these
-purposes instead of string constants. But if this is not possible,
-you can use the @samp{-fwritable-strings} flag, which directs GCC
-to handle string constants the same way most C compilers do.
-@samp{-traditional} also has this effect, among others.
-
-@item
-@code{-2147483648} is positive.
-
-This is because 2147483648 cannot fit in the type @code{int}, so
-(following the ANSI C rules) its data type is @code{unsigned long int}.
-Negating this value yields 2147483648 again.
-
-@item
-GCC does not substitute macro arguments when they appear inside of
-string constants. For example, the following macro in GCC
-
-@example
-#define foo(a) "a"
-@end example
-
-@noindent
-will produce output @code{"a"} regardless of what the argument @var{a} is.
-
-The @samp{-traditional} option directs GCC to handle such cases
-(among others) in the old-fashioned (non-ANSI) fashion.
-
-@cindex @code{setjmp} incompatibilities
-@cindex @code{longjmp} incompatibilities
-@item
-When you use @code{setjmp} and @code{longjmp}, the only automatic
-variables guaranteed to remain valid are those declared
-@code{volatile}. This is a consequence of automatic register
-allocation. Consider this function:
-
-@example
-jmp_buf j;
-
-foo ()
-@{
- int a, b;
-
- a = fun1 ();
- if (setjmp (j))
- return a;
-
- a = fun2 ();
- /* @r{@code{longjmp (j)} may occur in @code{fun3}.} */
- return a + fun3 ();
-@}
-@end example
-
-Here @code{a} may or may not be restored to its first value when the
-@code{longjmp} occurs. If @code{a} is allocated in a register, then
-its first value is restored; otherwise, it keeps the last value stored
-in it.
-
-If you use the @samp{-W} option with the @samp{-O} option, you will
-get a warning when GCC thinks such a problem might be possible.
-
-The @samp{-traditional} option directs GNU C to put variables in
-the stack by default, rather than in registers, in functions that
-call @code{setjmp}. This results in the behavior found in
-traditional C compilers.
-
-@item
-Programs that use preprocessing directives in the middle of macro
-arguments do not work with GCC. For example, a program like this
-will not work:
-
-@example
-foobar (
-#define luser
- hack)
-@end example
-
-ANSI C does not permit such a construct. It would make sense to support
-it when @samp{-traditional} is used, but it is too much work to
-implement.
-
-@cindex external declaration scope
-@cindex scope of external declarations
-@cindex declaration scope
-@item
-Declarations of external variables and functions within a block apply
-only to the block containing the declaration. In other words, they
-have the same scope as any other declaration in the same place.
-
-In some other C compilers, a @code{extern} declaration affects all the
-rest of the file even if it happens within a block.
-
-The @samp{-traditional} option directs GNU C to treat all @code{extern}
-declarations as global, like traditional compilers.
-
-@item
-In traditional C, you can combine @code{long}, etc., with a typedef name,
-as shown here:
-
-@example
-typedef int foo;
-typedef long foo bar;
-@end example
-
-In ANSI C, this is not allowed: @code{long} and other type modifiers
-require an explicit @code{int}. Because this criterion is expressed
-by Bison grammar rules rather than C code, the @samp{-traditional}
-flag cannot alter it.
-
-@cindex typedef names as function parameters
-@item
-PCC allows typedef names to be used as function parameters. The
-difficulty described immediately above applies here too.
-
-@cindex whitespace
-@item
-PCC allows whitespace in the middle of compound assignment operators
-such as @samp{+=}. GCC, following the ANSI standard, does not
-allow this. The difficulty described immediately above applies here
-too.
-
-@cindex apostrophes
-@cindex '
-@item
-GCC complains about unterminated character constants inside of
-preprocessing conditionals that fail. Some programs have English
-comments enclosed in conditionals that are guaranteed to fail; if these
-comments contain apostrophes, GCC will probably report an error. For
-example, this code would produce an error:
-
-@example
-#if 0
-You can't expect this to work.
-#endif
-@end example
-
-The best solution to such a problem is to put the text into an actual
-C comment delimited by @samp{/*@dots{}*/}. However,
-@samp{-traditional} suppresses these error messages.
-
-@item
-Many user programs contain the declaration @samp{long time ();}. In the
-past, the system header files on many systems did not actually declare
-@code{time}, so it did not matter what type your program declared it to
-return. But in systems with ANSI C headers, @code{time} is declared to
-return @code{time_t}, and if that is not the same as @code{long}, then
-@samp{long time ();} is erroneous.
-
-The solution is to change your program to use @code{time_t} as the return
-type of @code{time}.
-
-@cindex @code{float} as function value type
-@item
-When compiling functions that return @code{float}, PCC converts it to
-a double. GCC actually returns a @code{float}. If you are concerned
-with PCC compatibility, you should declare your functions to return
-@code{double}; you might as well say what you mean.
-
-@cindex structures
-@cindex unions
-@item
-When compiling functions that return structures or unions, GCC
-output code normally uses a method different from that used on most
-versions of Unix. As a result, code compiled with GCC cannot call
-a structure-returning function compiled with PCC, and vice versa.
-
-The method used by GCC is as follows: a structure or union which is
-1, 2, 4 or 8 bytes long is returned like a scalar. A structure or union
-with any other size is stored into an address supplied by the caller
-(usually in a special, fixed register, but on some machines it is passed
-on the stack). The machine-description macros @code{STRUCT_VALUE} and
-@code{STRUCT_INCOMING_VALUE} tell GCC where to pass this address.
-
-By contrast, PCC on most target machines returns structures and unions
-of any size by copying the data into an area of static storage, and then
-returning the address of that storage as if it were a pointer value.
-The caller must copy the data from that memory area to the place where
-the value is wanted. GCC does not use this method because it is
-slower and nonreentrant.
-
-On some newer machines, PCC uses a reentrant convention for all
-structure and union returning. GCC on most of these machines uses a
-compatible convention when returning structures and unions in memory,
-but still returns small structures and unions in registers.
-
-You can tell GCC to use a compatible convention for all structure and
-union returning with the option @samp{-fpcc-struct-return}.
-
-@cindex preprocessing tokens
-@cindex preprocessing numbers
-@item
-GNU C complains about program fragments such as @samp{0x74ae-0x4000}
-which appear to be two hexadecimal constants separated by the minus
-operator. Actually, this string is a single @dfn{preprocessing token}.
-Each such token must correspond to one token in C. Since this does not,
-GNU C prints an error message. Although it may appear obvious that what
-is meant is an operator and two values, the ANSI C standard specifically
-requires that this be treated as erroneous.
-
-A @dfn{preprocessing token} is a @dfn{preprocessing number} if it
-begins with a digit and is followed by letters, underscores, digits,
-periods and @samp{e+}, @samp{e-}, @samp{E+}, or @samp{E-} character
-sequences.
-
-To make the above program fragment valid, place whitespace in front of
-the minus sign. This whitespace will end the preprocessing number.
-@end itemize
-
-@node Fixed Headers
-@section Fixed Header Files
-
-GCC needs to install corrected versions of some system header files.
-This is because most target systems have some header files that won't
-work with GCC unless they are changed. Some have bugs, some are
-incompatible with ANSI C, and some depend on special features of other
-compilers.
-
-Installing GCC automatically creates and installs the fixed header
-files, by running a program called @code{fixincludes} (or for certain
-targets an alternative such as @code{fixinc.svr4}). Normally, you
-don't need to pay attention to this. But there are cases where it
-doesn't do the right thing automatically.
-
-@itemize @bullet
-@item
-If you update the system's header files, such as by installing a new
-system version, the fixed header files of GCC are not automatically
-updated. The easiest way to update them is to reinstall GCC. (If
-you want to be clever, look in the makefile and you can find a
-shortcut.)
-
-@item
-On some systems, in particular SunOS 4, header file directories contain
-machine-specific symbolic links in certain places. This makes it
-possible to share most of the header files among hosts running the
-same version of SunOS 4 on different machine models.
-
-The programs that fix the header files do not understand this special
-way of using symbolic links; therefore, the directory of fixed header
-files is good only for the machine model used to build it.
-
-In SunOS 4, only programs that look inside the kernel will notice the
-difference between machine models. Therefore, for most purposes, you
-need not be concerned about this.
-
-It is possible to make separate sets of fixed header files for the
-different machine models, and arrange a structure of symbolic links so
-as to use the proper set, but you'll have to do this by hand.
-
-@item
-On Lynxos, GCC by default does not fix the header files. This is
-because bugs in the shell cause the @code{fixincludes} script to fail.
-
-This means you will encounter problems due to bugs in the system header
-files. It may be no comfort that they aren't GCC's fault, but it
-does mean that there's nothing for us to do about them.
-@end itemize
-
-@node Standard Libraries
-@section Standard Libraries
-
-GCC by itself attempts to be what the ISO/ANSI C standard calls a
-@dfn{conforming freestanding implementation}. This means all ANSI
-C language features are available, as well as the contents of
-@file{float.h}, @file{limits.h}, @file{stdarg.h}, and
-@file{stddef.h}. The rest of the C library is supplied by the
-vendor of the operating system. If that C library doesn't conform to
-the C standards, then your programs might get warnings (especially when
-using @samp{-Wall}) that you don't expect.
-
-For example, the @code{sprintf} function on SunOS 4.1.3 returns
-@code{char *} while the C standard says that @code{sprintf} returns an
-@code{int}. The @code{fixincludes} program could make the prototype for
-this function match the Standard, but that would be wrong, since the
-function will still return @code{char *}.
-
-If you need a Standard compliant library, then you need to find one, as
-GCC does not provide one. The GNU C library (called @code{glibc})
-has been ported to a number of operating systems, and provides ANSI/ISO,
-POSIX, BSD and SystemV compatibility. You could also ask your operating
-system vendor if newer libraries are available.
-
-@node Disappointments
-@section Disappointments and Misunderstandings
-
-These problems are perhaps regrettable, but we don't know any practical
-way around them.
-
-@itemize @bullet
-@item
-Certain local variables aren't recognized by debuggers when you compile
-with optimization.
-
-This occurs because sometimes GCC optimizes the variable out of
-existence. There is no way to tell the debugger how to compute the
-value such a variable ``would have had'', and it is not clear that would
-be desirable anyway. So GCC simply does not mention the eliminated
-variable when it writes debugging information.
-
-You have to expect a certain amount of disagreement between the
-executable and your source code, when you use optimization.
-
-@cindex conflicting types
-@cindex scope of declaration
-@item
-Users often think it is a bug when GCC reports an error for code
-like this:
-
-@example
-int foo (struct mumble *);
-
-struct mumble @{ @dots{} @};
-
-int foo (struct mumble *x)
-@{ @dots{} @}
-@end example
-
-This code really is erroneous, because the scope of @code{struct
-mumble} in the prototype is limited to the argument list containing it.
-It does not refer to the @code{struct mumble} defined with file scope
-immediately below---they are two unrelated types with similar names in
-different scopes.
-
-But in the definition of @code{foo}, the file-scope type is used
-because that is available to be inherited. Thus, the definition and
-the prototype do not match, and you get an error.
-
-This behavior may seem silly, but it's what the ANSI standard specifies.
-It is easy enough for you to make your code work by moving the
-definition of @code{struct mumble} above the prototype. It's not worth
-being incompatible with ANSI C just to avoid an error for the example
-shown above.
-
-@item
-Accesses to bitfields even in volatile objects works by accessing larger
-objects, such as a byte or a word. You cannot rely on what size of
-object is accessed in order to read or write the bitfield; it may even
-vary for a given bitfield according to the precise usage.
-
-If you care about controlling the amount of memory that is accessed, use
-volatile but do not use bitfields.
-
-@item
-GCC comes with shell scripts to fix certain known problems in system
-header files. They install corrected copies of various header files in
-a special directory where only GCC will normally look for them. The
-scripts adapt to various systems by searching all the system header
-files for the problem cases that we know about.
-
-If new system header files are installed, nothing automatically arranges
-to update the corrected header files. You will have to reinstall GCC
-to fix the new header files. More specifically, go to the build
-directory and delete the files @file{stmp-fixinc} and
-@file{stmp-headers}, and the subdirectory @code{include}; then do
-@samp{make install} again.
-
-@item
-@cindex floating point precision
-On 68000 and x86 systems, for instance, you can get paradoxical results
-if you test the precise values of floating point numbers. For example,
-you can find that a floating point value which is not a NaN is not equal
-to itself. This results from the fact that the floating point registers
-hold a few more bits of precision than fit in a @code{double} in memory.
-Compiled code moves values between memory and floating point registers
-at its convenience, and moving them into memory truncates them.
-
-You can partially avoid this problem by using the @samp{-ffloat-store}
-option (@pxref{Optimize Options}).
-
-@item
-On the MIPS, variable argument functions using @file{varargs.h}
-cannot have a floating point value for the first argument. The
-reason for this is that in the absence of a prototype in scope,
-if the first argument is a floating point, it is passed in a
-floating point register, rather than an integer register.
-
-If the code is rewritten to use the ANSI standard @file{stdarg.h}
-method of variable arguments, and the prototype is in scope at
-the time of the call, everything will work fine.
-
-@item
-On the H8/300 and H8/300H, variable argument functions must be
-implemented using the ANSI standard @file{stdarg.h} method of
-variable arguments. Furthermore, calls to functions using @file{stdarg.h}
-variable arguments must have a prototype for the called function
-in scope at the time of the call.
-@end itemize
-
-@node C++ Misunderstandings
-@section Common Misunderstandings with GNU C++
-
-@cindex misunderstandings in C++
-@cindex surprises in C++
-@cindex C++ misunderstandings
-C++ is a complex language and an evolving one, and its standard
-definition (the ISO C++ standard) was only recently completed. As a
-result, your C++ compiler may occasionally surprise you, even when its
-behavior is correct. This section discusses some areas that frequently
-give rise to questions of this sort.
-
-@menu
-* Static Definitions:: Static member declarations are not definitions
-* Temporaries:: Temporaries may vanish before you expect
-* Copy Assignment:: Copy Assignment operators copy virtual bases twice
-@end menu
-
-@node Static Definitions
-@subsection Declare @emph{and} Define Static Members
-
-@cindex C++ static data, declaring and defining
-@cindex static data in C++, declaring and defining
-@cindex declaring static data in C++
-@cindex defining static data in C++
-When a class has static data members, it is not enough to @emph{declare}
-the static member; you must also @emph{define} it. For example:
-
-@example
-class Foo
-@{
- @dots{}
- void method();
- static int bar;
-@};
-@end example
-
-This declaration only establishes that the class @code{Foo} has an
-@code{int} named @code{Foo::bar}, and a member function named
-@code{Foo::method}. But you still need to define @emph{both}
-@code{method} and @code{bar} elsewhere. According to the draft ANSI
-standard, you must supply an initializer in one (and only one) source
-file, such as:
-
-@example
-int Foo::bar = 0;
-@end example
-
-Other C++ compilers may not correctly implement the standard behavior.
-As a result, when you switch to @code{g++} from one of these compilers,
-you may discover that a program that appeared to work correctly in fact
-does not conform to the standard: @code{g++} reports as undefined
-symbols any static data members that lack definitions.
-
-@node Temporaries
-@subsection Temporaries May Vanish Before You Expect
-
-@cindex temporaries, lifetime of
-@cindex portions of temporary objects, pointers to
-It is dangerous to use pointers or references to @emph{portions} of a
-temporary object. The compiler may very well delete the object before
-you expect it to, leaving a pointer to garbage. The most common place
-where this problem crops up is in classes like string classes,
-especially ones that define a conversion function to type @code{char *}
-or @code{const char *} -- which is one reason why the standard
-@code{string} class requires you to call the @code{c_str} member
-function. However, any class that returns a pointer to some internal
-structure is potentially subject to this problem.
-
-For example, a program may use a function @code{strfunc} that returns
-@code{string} objects, and another function @code{charfunc} that
-operates on pointers to @code{char}:
-
-@example
-string strfunc ();
-void charfunc (const char *);
-
-void
-f ()
-@{
- const char *p = strfunc().c_str();
- ...
- charfunc (p);
- ...
- charfunc (p);
-@}
-@end example
-
-@noindent
-In this situation, it may seem reasonable to save a pointer to the C
-string returned by the @code{c_str} member function and use that rather
-than call @code{c_str} repeatedly. However, the temporary string
-created by the call to @code{strfunc} is destroyed after @code{p} is
-initialized, at which point @code{p} is left pointing to freed memory.
-
-Code like this may run successfully under some other compilers,
-particularly obsolete cfront-based compilers that delete temporaries
-along with normal local variables. However, the GNU C++ behavior is
-standard-conforming, so if your program depends on late destruction of
-temporaries it is not portable.
-
-The safe way to write such code is to give the temporary a name, which
-forces it to remain until the end of the scope of the name. For
-example:
-
-@example
-string& tmp = strfunc ();
-charfunc (tmp.c_str ());
-@end example
-
-@node Copy Assignment
-@subsection Implicit Copy-Assignment for Virtual Bases
-
-When a base class is virtual, only one subobject of the base class
-belongs to each full object. Also, the constructors and destructors are
-invoked only once, and called from the most-derived class. However, such
-objects behave unspecified when being assigned. For example:
-
-@example
-struct Base@{
- char *name;
- Base(char *n) : name(strdup(n))@{@}
- Base& operator= (const Base& other)@{
- free (name);
- name = strdup (other.name);
- @}
-@};
-
-struct A:virtual Base@{
- int val;
- A():Base("A")@{@}
-@};
-
-struct B:virtual Base@{
- int bval;
- B():Base("B")@{@}
-@};
-
-struct Derived:public A, public B@{
- Derived():Base("Derived")@{@}
-@};
-
-void func(Derived &d1, Derived &d2)
-@{
- d1 = d2;
-@}
-@end example
-
-The C++ standard specifies that @samp{Base::Base} is only called once
-when constructing or copy-constructing a Derived object. It is
-unspecified whether @samp{Base::operator=} is called more than once when
-the implicit copy-assignment for Derived objects is invoked (as it is
-inside @samp{func} in the example).
-
-g++ implements the "intuitive" algorithm for copy-assignment: assign all
-direct bases, then assign all members. In that algorithm, the virtual
-base subobject can be encountered many times. In the example, copying
-proceeds in the following order: @samp{val}, @samp{name} (via
-@code{strdup}), @samp{bval}, and @samp{name} again.
-
-If application code relies on copy-assignment, a user-defined
-copy-assignment operator removes any uncertainties. With such an
-operator, the application can define whether and how the virtual base
-subobject is assigned.
-
-@node Protoize Caveats
-@section Caveats of using @code{protoize}
-
-The conversion programs @code{protoize} and @code{unprotoize} can
-sometimes change a source file in a way that won't work unless you
-rearrange it.
-
-@itemize @bullet
-@item
-@code{protoize} can insert references to a type name or type tag before
-the definition, or in a file where they are not defined.
-
-If this happens, compiler error messages should show you where the new
-references are, so fixing the file by hand is straightforward.
-
-@item
-There are some C constructs which @code{protoize} cannot figure out.
-For example, it can't determine argument types for declaring a
-pointer-to-function variable; this you must do by hand. @code{protoize}
-inserts a comment containing @samp{???} each time it finds such a
-variable; so you can find all such variables by searching for this
-string. ANSI C does not require declaring the argument types of
-pointer-to-function types.
-
-@item
-Using @code{unprotoize} can easily introduce bugs. If the program
-relied on prototypes to bring about conversion of arguments, these
-conversions will not take place in the program without prototypes.
-One case in which you can be sure @code{unprotoize} is safe is when
-you are removing prototypes that were made with @code{protoize}; if
-the program worked before without any prototypes, it will work again
-without them.
-
-You can find all the places where this problem might occur by compiling
-the program with the @samp{-Wconversion} option. It prints a warning
-whenever an argument is converted.
-
-@item
-Both conversion programs can be confused if there are macro calls in and
-around the text to be converted. In other words, the standard syntax
-for a declaration or definition must not result from expanding a macro.
-This problem is inherent in the design of C and cannot be fixed. If
-only a few functions have confusing macro calls, you can easily convert
-them manually.
-
-@item
-@code{protoize} cannot get the argument types for a function whose
-definition was not actually compiled due to preprocessing conditionals.
-When this happens, @code{protoize} changes nothing in regard to such
-a function. @code{protoize} tries to detect such instances and warn
-about them.
-
-You can generally work around this problem by using @code{protoize} step
-by step, each time specifying a different set of @samp{-D} options for
-compilation, until all of the functions have been converted. There is
-no automatic way to verify that you have got them all, however.
-
-@item
-Confusion may result if there is an occasion to convert a function
-declaration or definition in a region of source code where there is more
-than one formal parameter list present. Thus, attempts to convert code
-containing multiple (conditionally compiled) versions of a single
-function header (in the same vicinity) may not produce the desired (or
-expected) results.
-
-If you plan on converting source files which contain such code, it is
-recommended that you first make sure that each conditionally compiled
-region of source code which contains an alternative function header also
-contains at least one additional follower token (past the final right
-parenthesis of the function header). This should circumvent the
-problem.
-
-@item
-@code{unprotoize} can become confused when trying to convert a function
-definition or declaration which contains a declaration for a
-pointer-to-function formal argument which has the same name as the
-function being defined or declared. We recommand you avoid such choices
-of formal parameter names.
-
-@item
-You might also want to correct some of the indentation by hand and break
-long lines. (The conversion programs don't write lines longer than
-eighty characters in any case.)
-@end itemize
-
-@node Non-bugs
-@section Certain Changes We Don't Want to Make
-
-This section lists changes that people frequently request, but which
-we do not make because we think GCC is better without them.
-
-@itemize @bullet
-@item
-Checking the number and type of arguments to a function which has an
-old-fashioned definition and no prototype.
-
-Such a feature would work only occasionally---only for calls that appear
-in the same file as the called function, following the definition. The
-only way to check all calls reliably is to add a prototype for the
-function. But adding a prototype eliminates the motivation for this
-feature. So the feature is not worthwhile.
-
-@item
-Warning about using an expression whose type is signed as a shift count.
-
-Shift count operands are probably signed more often than unsigned.
-Warning about this would cause far more annoyance than good.
-
-@item
-Warning about assigning a signed value to an unsigned variable.
-
-Such assignments must be very common; warning about them would cause
-more annoyance than good.
-
-@item
-Warning about unreachable code.
-
-It's very common to have unreachable code in machine-generated
-programs. For example, this happens normally in some files of GNU C
-itself.
-
-@item
-Warning when a non-void function value is ignored.
-
-Coming as I do from a Lisp background, I balk at the idea that there is
-something dangerous about discarding a value. There are functions that
-return values which some callers may find useful; it makes no sense to
-clutter the program with a cast to @code{void} whenever the value isn't
-useful.
-
-@item
-Assuming (for optimization) that the address of an external symbol is
-never zero.
-
-This assumption is false on certain systems when @samp{#pragma weak} is
-used.
-
-@item
-Making @samp{-fshort-enums} the default.
-
-This would cause storage layout to be incompatible with most other C
-compilers. And it doesn't seem very important, given that you can get
-the same result in other ways. The case where it matters most is when
-the enumeration-valued object is inside a structure, and in that case
-you can specify a field width explicitly.
-
-@item
-Making bitfields unsigned by default on particular machines where ``the
-ABI standard'' says to do so.
-
-The ANSI C standard leaves it up to the implementation whether a bitfield
-declared plain @code{int} is signed or not. This in effect creates two
-alternative dialects of C.
-
-The GNU C compiler supports both dialects; you can specify the signed
-dialect with @samp{-fsigned-bitfields} and the unsigned dialect with
-@samp{-funsigned-bitfields}. However, this leaves open the question of
-which dialect to use by default.
-
-Currently, the preferred dialect makes plain bitfields signed, because
-this is simplest. Since @code{int} is the same as @code{signed int} in
-every other context, it is cleanest for them to be the same in bitfields
-as well.
-
-Some computer manufacturers have published Application Binary Interface
-standards which specify that plain bitfields should be unsigned. It is
-a mistake, however, to say anything about this issue in an ABI. This is
-because the handling of plain bitfields distinguishes two dialects of C.
-Both dialects are meaningful on every type of machine. Whether a
-particular object file was compiled using signed bitfields or unsigned
-is of no concern to other object files, even if they access the same
-bitfields in the same data structures.
-
-A given program is written in one or the other of these two dialects.
-The program stands a chance to work on most any machine if it is
-compiled with the proper dialect. It is unlikely to work at all if
-compiled with the wrong dialect.
-
-Many users appreciate the GNU C compiler because it provides an
-environment that is uniform across machines. These users would be
-inconvenienced if the compiler treated plain bitfields differently on
-certain machines.
-
-Occasionally users write programs intended only for a particular machine
-type. On these occasions, the users would benefit if the GNU C compiler
-were to support by default the same dialect as the other compilers on
-that machine. But such applications are rare. And users writing a
-program to run on more than one type of machine cannot possibly benefit
-from this kind of compatibility.
-
-This is why GCC does and will treat plain bitfields in the same
-fashion on all types of machines (by default).
-
-There are some arguments for making bitfields unsigned by default on all
-machines. If, for example, this becomes a universal de facto standard,
-it would make sense for GCC to go along with it. This is something
-to be considered in the future.
-
-(Of course, users strongly concerned about portability should indicate
-explicitly in each bitfield whether it is signed or not. In this way,
-they write programs which have the same meaning in both C dialects.)
-
-@item
-Undefining @code{__STDC__} when @samp{-ansi} is not used.
-
-Currently, GCC defines @code{__STDC__} as long as you don't use
-@samp{-traditional}. This provides good results in practice.
-
-Programmers normally use conditionals on @code{__STDC__} to ask whether
-it is safe to use certain features of ANSI C, such as function
-prototypes or ANSI token concatenation. Since plain @samp{gcc} supports
-all the features of ANSI C, the correct answer to these questions is
-``yes''.
-
-Some users try to use @code{__STDC__} to check for the availability of
-certain library facilities. This is actually incorrect usage in an ANSI
-C program, because the ANSI C standard says that a conforming
-freestanding implementation should define @code{__STDC__} even though it
-does not have the library facilities. @samp{gcc -ansi -pedantic} is a
-conforming freestanding implementation, and it is therefore required to
-define @code{__STDC__}, even though it does not come with an ANSI C
-library.
-
-Sometimes people say that defining @code{__STDC__} in a compiler that
-does not completely conform to the ANSI C standard somehow violates the
-standard. This is illogical. The standard is a standard for compilers
-that claim to support ANSI C, such as @samp{gcc -ansi}---not for other
-compilers such as plain @samp{gcc}. Whatever the ANSI C standard says
-is relevant to the design of plain @samp{gcc} without @samp{-ansi} only
-for pragmatic reasons, not as a requirement.
-
-GCC normally defines @code{__STDC__} to be 1, and in addition
-defines @code{__STRICT_ANSI__} if you specify the @samp{-ansi} option.
-On some hosts, system include files use a different convention, where
-@code{__STDC__} is normally 0, but is 1 if the user specifies strict
-conformance to the C Standard. GCC follows the host convention when
-processing system include files, but when processing user files it follows
-the usual GNU C convention.
-
-@item
-Undefining @code{__STDC__} in C++.
-
-Programs written to compile with C++-to-C translators get the
-value of @code{__STDC__} that goes with the C compiler that is
-subsequently used. These programs must test @code{__STDC__}
-to determine what kind of C preprocessor that compiler uses:
-whether they should concatenate tokens in the ANSI C fashion
-or in the traditional fashion.
-
-These programs work properly with GNU C++ if @code{__STDC__} is defined.
-They would not work otherwise.
-
-In addition, many header files are written to provide prototypes in ANSI
-C but not in traditional C. Many of these header files can work without
-change in C++ provided @code{__STDC__} is defined. If @code{__STDC__}
-is not defined, they will all fail, and will all need to be changed to
-test explicitly for C++ as well.
-
-@item
-Deleting ``empty'' loops.
-
-Historically, GCC has not deleted ``empty'' loops under the
-assumption that the most likely reason you would put one in a program is
-to have a delay, so deleting them will not make real programs run any
-faster.
-
-However, the rationale here is that optimization of a nonempty loop
-cannot produce an empty one, which holds for C but is not always the
-case for C++.
-
-Moreover, with @samp{-funroll-loops} small ``empty'' loops are already
-removed, so the current behavior is both sub-optimal and inconsistent
-and will change in the future.
-
-@item
-Making side effects happen in the same order as in some other compiler.
-
-@cindex side effects, order of evaluation
-@cindex order of evaluation, side effects
-It is never safe to depend on the order of evaluation of side effects.
-For example, a function call like this may very well behave differently
-from one compiler to another:
-
-@example
-void func (int, int);
-
-int i = 2;
-func (i++, i++);
-@end example
-
-There is no guarantee (in either the C or the C++ standard language
-definitions) that the increments will be evaluated in any particular
-order. Either increment might happen first. @code{func} might get the
-arguments @samp{2, 3}, or it might get @samp{3, 2}, or even @samp{2, 2}.
-
-@item
-Not allowing structures with volatile fields in registers.
-
-Strictly speaking, there is no prohibition in the ANSI C standard
-against allowing structures with volatile fields in registers, but
-it does not seem to make any sense and is probably not what you wanted
-to do. So the compiler will give an error message in this case.
-@end itemize
-
-@node Warnings and Errors
-@section Warning Messages and Error Messages
-
-@cindex error messages
-@cindex warnings vs errors
-@cindex messages, warning and error
-The GNU compiler can produce two kinds of diagnostics: errors and
-warnings. Each kind has a different purpose:
-
-@itemize @w{}
-@item
-@emph{Errors} report problems that make it impossible to compile your
-program. GCC reports errors with the source file name and line
-number where the problem is apparent.
-
-@item
-@emph{Warnings} report other unusual conditions in your code that
-@emph{may} indicate a problem, although compilation can (and does)
-proceed. Warning messages also report the source file name and line
-number, but include the text @samp{warning:} to distinguish them
-from error messages.
-@end itemize
-
-Warnings may indicate danger points where you should check to make sure
-that your program really does what you intend; or the use of obsolete
-features; or the use of nonstandard features of GNU C or C++. Many
-warnings are issued only if you ask for them, with one of the @samp{-W}
-options (for instance, @samp{-Wall} requests a variety of useful
-warnings).
-
-GCC always tries to compile your program if possible; it never
-gratuitously rejects a program whose meaning is clear merely because
-(for instance) it fails to conform to a standard. In some cases,
-however, the C and C++ standards specify that certain extensions are
-forbidden, and a diagnostic @emph{must} be issued by a conforming
-compiler. The @samp{-pedantic} option tells GCC to issue warnings in
-such cases; @samp{-pedantic-errors} says to make them errors instead.
-This does not mean that @emph{all} non-ANSI constructs get warnings
-or errors.
-
-@xref{Warning Options,,Options to Request or Suppress Warnings}, for
-more detail on these and related command-line options.
-
-@node Bugs
-@chapter Reporting Bugs
-@cindex bugs
-@cindex reporting bugs
-
-Your bug reports play an essential role in making GCC reliable.
-
-When you encounter a problem, the first thing to do is to see if it is
-already known. @xref{Trouble}. If it isn't known, then you should
-report the problem.
-
-Reporting a bug may help you by bringing a solution to your problem, or
-it may not. (If it does not, look in the service directory; see
-@ref{Service}.) In any case, the principal function of a bug report is
-to help the entire community by making the next version of GCC work
-better. Bug reports are your contribution to the maintenance of GCC.
-
-Since the maintainers are very overloaded, we cannot respond to every
-bug report. However, if the bug has not been fixed, we are likely to
-send you a patch and ask you to tell us whether it works.
-
-In order for a bug report to serve its purpose, you must include the
-information that makes for fixing the bug.
-
-@menu
-* Criteria: Bug Criteria. Have you really found a bug?
-* Where: Bug Lists. Where to send your bug report.
-* Reporting: Bug Reporting. How to report a bug effectively.
-* Patches: Sending Patches. How to send a patch for GCC.
-* Known: Trouble. Known problems.
-* Help: Service. Where to ask for help.
-@end menu
-
-@node Bug Criteria
-@section Have You Found a Bug?
-@cindex bug criteria
-
-If you are not sure whether you have found a bug, here are some guidelines:
-
-@itemize @bullet
-@cindex fatal signal
-@cindex core dump
-@item
-If the compiler gets a fatal signal, for any input whatever, that is a
-compiler bug. Reliable compilers never crash.
-
-@cindex invalid assembly code
-@cindex assembly code, invalid
-@item
-If the compiler produces invalid assembly code, for any input whatever
-(except an @code{asm} statement), that is a compiler bug, unless the
-compiler reports errors (not just warnings) which would ordinarily
-prevent the assembler from being run.
-
-@cindex undefined behavior
-@cindex undefined function value
-@cindex increment operators
-@item
-If the compiler produces valid assembly code that does not correctly
-execute the input source code, that is a compiler bug.
-
-However, you must double-check to make sure, because you may have run
-into an incompatibility between GNU C and traditional C
-(@pxref{Incompatibilities}). These incompatibilities might be considered
-bugs, but they are inescapable consequences of valuable features.
-
-Or you may have a program whose behavior is undefined, which happened
-by chance to give the desired results with another C or C++ compiler.
-
-For example, in many nonoptimizing compilers, you can write @samp{x;}
-at the end of a function instead of @samp{return x;}, with the same
-results. But the value of the function is undefined if @code{return}
-is omitted; it is not a bug when GCC produces different results.
-
-Problems often result from expressions with two increment operators,
-as in @code{f (*p++, *p++)}. Your previous compiler might have
-interpreted that expression the way you intended; GCC might
-interpret it another way. Neither compiler is wrong. The bug is
-in your code.
-
-After you have localized the error to a single source line, it should
-be easy to check for these things. If your program is correct and
-well defined, you have found a compiler bug.
-
-@item
-If the compiler produces an error message for valid input, that is a
-compiler bug.
-
-@cindex invalid input
-@item
-If the compiler does not produce an error message for invalid input,
-that is a compiler bug. However, you should note that your idea of
-``invalid input'' might be my idea of ``an extension'' or ``support
-for traditional practice''.
-
-@item
-If you are an experienced user of C or C++ (or Fortran or Objective-C)
-compilers, your suggestions
-for improvement of GCC are welcome in any case.
-@end itemize
-
-@node Bug Lists
-@section Where to Report Bugs
-@cindex bug report mailing lists
-@kindex gcc-bugs@@gcc.gnu.org or bug-gcc@@gnu.org
-Send bug reports for the GNU Compiler Collection to
-@samp{gcc-bugs@@gcc.gnu.org}. In accordance with the GNU-wide
-convention, in which bug reports for tool ``foo'' are sent
-to @samp{bug-foo@@gnu.org}, the address @samp{bug-gcc@@gnu.org}
-may also be used; it will forward to the address given above.
-
-Please read @samp{<URL:http://www.gnu.org/software/gcc/bugs.html>} for
-bug reporting instructions before you post a bug report.
-
-Often people think of posting bug reports to the newsgroup instead of
-mailing them. This appears to work, but it has one problem which can be
-crucial: a newsgroup posting does not contain a mail path back to the
-sender. Thus, if maintainers need more information, they may be unable
-to reach you. For this reason, you should always send bug reports by
-mail to the proper mailing list.
-
-As a last resort, send bug reports on paper to:
-
-@example
-GNU Compiler Bugs
-Free Software Foundation
-59 Temple Place - Suite 330
-Boston, MA 02111-1307, USA
-@end example
-
-@node Bug Reporting
-@section How to Report Bugs
-@cindex compiler bugs, reporting
-
-You may find additional and/or more up-to-date instructions at
-@samp{<URL:http://www.gnu.org/software/gcc/bugs.html>}.
-
-The fundamental principle of reporting bugs usefully is this:
-@strong{report all the facts}. If you are not sure whether to state a
-fact or leave it out, state it!
-
-Often people omit facts because they think they know what causes the
-problem and they conclude that some details don't matter. Thus, you might
-assume that the name of the variable you use in an example does not matter.
-Well, probably it doesn't, but one cannot be sure. Perhaps the bug is a
-stray memory reference which happens to fetch from the location where that
-name is stored in memory; perhaps, if the name were different, the contents
-of that location would fool the compiler into doing the right thing despite
-the bug. Play it safe and give a specific, complete example. That is the
-easiest thing for you to do, and the most helpful.
-
-Keep in mind that the purpose of a bug report is to enable someone to
-fix the bug if it is not known. It isn't very important what happens if
-the bug is already known. Therefore, always write your bug reports on
-the assumption that the bug is not known.
-
-Sometimes people give a few sketchy facts and ask, ``Does this ring a
-bell?'' This cannot help us fix a bug, so it is basically useless. We
-respond by asking for enough details to enable us to investigate.
-You might as well expedite matters by sending them to begin with.
-
-Try to make your bug report self-contained. If we have to ask you for
-more information, it is best if you include all the previous information
-in your response, as well as the information that was missing.
-
-Please report each bug in a separate message. This makes it easier for
-us to track which bugs have been fixed and to forward your bugs reports
-to the appropriate maintainer.
-
-To enable someone to investigate the bug, you should include all these
-things:
-
-@itemize @bullet
-@item
-The version of GCC. You can get this by running it with the
-@samp{-v} option.
-
-Without this, we won't know whether there is any point in looking for
-the bug in the current version of GCC.
-
-@item
-A complete input file that will reproduce the bug. If the bug is in the
-C preprocessor, send a source file and any header files that it
-requires. If the bug is in the compiler proper (@file{cc1}), send the
-preprocessor output generated by adding @samp{-save-temps} to the
-compilation command (@pxref{Debugging Options}). When you do this, use
-the same @samp{-I}, @samp{-D} or @samp{-U} options that you used in
-actual compilation. Then send the @var{input}.i or @var{input}.ii files
-generated.
-
-A single statement is not enough of an example. In order to compile it,
-it must be embedded in a complete file of compiler input; and the bug
-might depend on the details of how this is done.
-
-Without a real example one can compile, all anyone can do about your bug
-report is wish you luck. It would be futile to try to guess how to
-provoke the bug. For example, bugs in register allocation and reloading
-frequently depend on every little detail of the function they happen in.
-
-Even if the input file that fails comes from a GNU program, you should
-still send the complete test case. Don't ask the GCC maintainers to
-do the extra work of obtaining the program in question---they are all
-overworked as it is. Also, the problem may depend on what is in the
-header files on your system; it is unreliable for the GCC maintainers
-to try the problem with the header files available to them. By sending
-CPP output, you can eliminate this source of uncertainty and save us
-a certain percentage of wild goose chases.
-
-@item
-The command arguments you gave GCC to compile that example
-and observe the bug. For example, did you use @samp{-O}? To guarantee
-you won't omit something important, list all the options.
-
-If we were to try to guess the arguments, we would probably guess wrong
-and then we would not encounter the bug.
-
-@item
-The type of machine you are using, and the operating system name and
-version number.
-
-@item
-The operands you gave to the @code{configure} command when you installed
-the compiler.
-
-@item
-A complete list of any modifications you have made to the compiler
-source. (We don't promise to investigate the bug unless it happens in
-an unmodified compiler. But if you've made modifications and don't tell
-us, then you are sending us on a wild goose chase.)
-
-Be precise about these changes. A description in English is not
-enough---send a context diff for them.
-
-Adding files of your own (such as a machine description for a machine we
-don't support) is a modification of the compiler source.
-
-@item
-Details of any other deviations from the standard procedure for installing
-GCC.
-
-@item
-A description of what behavior you observe that you believe is
-incorrect. For example, ``The compiler gets a fatal signal,'' or,
-``The assembler instruction at line 208 in the output is incorrect.''
-
-Of course, if the bug is that the compiler gets a fatal signal, then one
-can't miss it. But if the bug is incorrect output, the maintainer might
-not notice unless it is glaringly wrong. None of us has time to study
-all the assembler code from a 50-line C program just on the chance that
-one instruction might be wrong. We need @emph{you} to do this part!
-
-Even if the problem you experience is a fatal signal, you should still
-say so explicitly. Suppose something strange is going on, such as, your
-copy of the compiler is out of synch, or you have encountered a bug in
-the C library on your system. (This has happened!) Your copy might
-crash and the copy here would not. If you @i{said} to expect a crash,
-then when the compiler here fails to crash, we would know that the bug
-was not happening. If you don't say to expect a crash, then we would
-not know whether the bug was happening. We would not be able to draw
-any conclusion from our observations.
-
-If the problem is a diagnostic when compiling GCC with some other
-compiler, say whether it is a warning or an error.
-
-Often the observed symptom is incorrect output when your program is run.
-Sad to say, this is not enough information unless the program is short
-and simple. None of us has time to study a large program to figure out
-how it would work if compiled correctly, much less which line of it was
-compiled wrong. So you will have to do that. Tell us which source line
-it is, and what incorrect result happens when that line is executed. A
-person who understands the program can find this as easily as finding a
-bug in the program itself.
-
-@item
-If you send examples of assembler code output from GCC,
-please use @samp{-g} when you make them. The debugging information
-includes source line numbers which are essential for correlating the
-output with the input.
-
-@item
-If you wish to mention something in the GCC source, refer to it by
-context, not by line number.
-
-The line numbers in the development sources don't match those in your
-sources. Your line numbers would convey no useful information to the
-maintainers.
-
-@item
-Additional information from a debugger might enable someone to find a
-problem on a machine which he does not have available. However, you
-need to think when you collect this information if you want it to have
-any chance of being useful.
-
-@cindex backtrace for bug reports
-For example, many people send just a backtrace, but that is never
-useful by itself. A simple backtrace with arguments conveys little
-about GCC because the compiler is largely data-driven; the same
-functions are called over and over for different RTL insns, doing
-different things depending on the details of the insn.
-
-Most of the arguments listed in the backtrace are useless because they
-are pointers to RTL list structure. The numeric values of the
-pointers, which the debugger prints in the backtrace, have no
-significance whatever; all that matters is the contents of the objects
-they point to (and most of the contents are other such pointers).
-
-In addition, most compiler passes consist of one or more loops that
-scan the RTL insn sequence. The most vital piece of information about
-such a loop---which insn it has reached---is usually in a local variable,
-not in an argument.
-
-@findex debug_rtx
-What you need to provide in addition to a backtrace are the values of
-the local variables for several stack frames up. When a local
-variable or an argument is an RTX, first print its value and then use
-the GDB command @code{pr} to print the RTL expression that it points
-to. (If GDB doesn't run on your machine, use your debugger to call
-the function @code{debug_rtx} with the RTX as an argument.) In
-general, whenever a variable is a pointer, its value is no use
-without the data it points to.
-@end itemize
-
-Here are some things that are not necessary:
-
-@itemize @bullet
-@item
-A description of the envelope of the bug.
-
-Often people who encounter a bug spend a lot of time investigating
-which changes to the input file will make the bug go away and which
-changes will not affect it.
-
-This is often time consuming and not very useful, because the way we
-will find the bug is by running a single example under the debugger with
-breakpoints, not by pure deduction from a series of examples. You might
-as well save your time for something else.
-
-Of course, if you can find a simpler example to report @emph{instead} of
-the original one, that is a convenience. Errors in the output will be
-easier to spot, running under the debugger will take less time, etc.
-Most GCC bugs involve just one function, so the most straightforward
-way to simplify an example is to delete all the function definitions
-except the one where the bug occurs. Those earlier in the file may be
-replaced by external declarations if the crucial function depends on
-them. (Exception: inline functions may affect compilation of functions
-defined later in the file.)
-
-However, simplification is not vital; if you don't want to do this,
-report the bug anyway and send the entire test case you used.
-
-@item
-In particular, some people insert conditionals @samp{#ifdef BUG} around
-a statement which, if removed, makes the bug not happen. These are just
-clutter; we won't pay any attention to them anyway. Besides, you should
-send us cpp output, and that can't have conditionals.
-
-@item
-A patch for the bug.
-
-A patch for the bug is useful if it is a good one. But don't omit the
-necessary information, such as the test case, on the assumption that a
-patch is all we need. We might see problems with your patch and decide
-to fix the problem another way, or we might not understand it at all.
-
-Sometimes with a program as complicated as GCC it is very hard to
-construct an example that will make the program follow a certain path
-through the code. If you don't send the example, we won't be able to
-construct one, so we won't be able to verify that the bug is fixed.
-
-And if we can't understand what bug you are trying to fix, or why your
-patch should be an improvement, we won't install it. A test case will
-help us to understand.
-
-@xref{Sending Patches}, for guidelines on how to make it easy for us to
-understand and install your patches.
-
-@item
-A guess about what the bug is or what it depends on.
-
-Such guesses are usually wrong. Even I can't guess right about such
-things without first using the debugger to find the facts.
-
-@item
-A core dump file.
-
-We have no way of examining a core dump for your type of machine
-unless we have an identical system---and if we do have one,
-we should be able to reproduce the crash ourselves.
-@end itemize
-
-@node Sending Patches,, Bug Reporting, Bugs
-@section Sending Patches for GCC
-
-If you would like to write bug fixes or improvements for the GNU C
-compiler, that is very helpful. Send suggested fixes to the patches
-mailing list, @code{gcc-patches@@gcc.gnu.org}.
-
-Please follow these guidelines so we can study your patches efficiently.
-If you don't follow these guidelines, your information might still be
-useful, but using it will take extra work. Maintaining GNU C is a lot
-of work in the best of circumstances, and we can't keep up unless you do
-your best to help.
-
-@itemize @bullet
-@item
-Send an explanation with your changes of what problem they fix or what
-improvement they bring about. For a bug fix, just include a copy of the
-bug report, and explain why the change fixes the bug.
-
-(Referring to a bug report is not as good as including it, because then
-we will have to look it up, and we have probably already deleted it if
-we've already fixed the bug.)
-
-@item
-Always include a proper bug report for the problem you think you have
-fixed. We need to convince ourselves that the change is right before
-installing it. Even if it is right, we might have trouble judging it if
-we don't have a way to reproduce the problem.
-
-@item
-Include all the comments that are appropriate to help people reading the
-source in the future understand why this change was needed.
-
-@item
-Don't mix together changes made for different reasons.
-Send them @emph{individually}.
-
-If you make two changes for separate reasons, then we might not want to
-install them both. We might want to install just one. If you send them
-all jumbled together in a single set of diffs, we have to do extra work
-to disentangle them---to figure out which parts of the change serve
-which purpose. If we don't have time for this, we might have to ignore
-your changes entirely.
-
-If you send each change as soon as you have written it, with its own
-explanation, then the two changes never get tangled up, and we can
-consider each one properly without any extra work to disentangle them.
-
-Ideally, each change you send should be impossible to subdivide into
-parts that we might want to consider separately, because each of its
-parts gets its motivation from the other parts.
-
-@item
-Send each change as soon as that change is finished. Sometimes people
-think they are helping us by accumulating many changes to send them all
-together. As explained above, this is absolutely the worst thing you
-could do.
-
-Since you should send each change separately, you might as well send it
-right away. That gives us the option of installing it immediately if it
-is important.
-
-@item
-Use @samp{diff -c} to make your diffs. Diffs without context are hard
-for us to install reliably. More than that, they make it hard for us to
-study the diffs to decide whether we want to install them. Unidiff
-format is better than contextless diffs, but not as easy to read as
-@samp{-c} format.
-
-If you have GNU diff, use @samp{diff -cp}, which shows the name of the
-function that each change occurs in.
-
-@item
-Write the change log entries for your changes. We get lots of changes,
-and we don't have time to do all the change log writing ourselves.
-
-Read the @file{ChangeLog} file to see what sorts of information to put
-in, and to learn the style that we use. The purpose of the change log
-is to show people where to find what was changed. So you need to be
-specific about what functions you changed; in large functions, it's
-often helpful to indicate where within the function the change was.
-
-On the other hand, once you have shown people where to find the change,
-you need not explain its purpose. Thus, if you add a new function, all
-you need to say about it is that it is new. If you feel that the
-purpose needs explaining, it probably does---but the explanation will be
-much more useful if you put it in comments in the code.
-
-If you would like your name to appear in the header line for who made
-the change, send us the header line.
-
-@item
-When you write the fix, keep in mind that we can't install a change that
-would break other systems.
-
-People often suggest fixing a problem by changing machine-independent
-files such as @file{toplev.c} to do something special that a particular
-system needs. Sometimes it is totally obvious that such changes would
-break GCC for almost all users. We can't possibly make a change like
-that. At best it might tell us how to write another patch that would
-solve the problem acceptably.
-
-Sometimes people send fixes that @emph{might} be an improvement in
-general---but it is hard to be sure of this. It's hard to install
-such changes because we have to study them very carefully. Of course,
-a good explanation of the reasoning by which you concluded the change
-was correct can help convince us.
-
-The safest changes are changes to the configuration files for a
-particular machine. These are safe because they can't create new bugs
-on other machines.
-
-Please help us keep up with the workload by designing the patch in a
-form that is good to install.
-@end itemize
-
-@node Service
-@chapter How To Get Help with GCC
-
-If you need help installing, using or changing GCC, there are two
-ways to find it:
-
-@itemize @bullet
-@item
-Send a message to a suitable network mailing list. First try
-@code{gcc-bugs@@gcc.gnu.org} or @code{bug-gcc@@gnu.org}, and if that
-brings no response, try @code{gcc@@gcc.gnu.org}.
-
-@item
-Look in the service directory for someone who might help you for a fee.
-The service directory is found in the file named @file{SERVICE} in the
-GCC distribution.
-@end itemize
-
-@node Contributing
-@chapter Contributing to GCC Development
-
-If you would like to help pretest GCC releases to assure they work
-well, or if you would like to work on improving GCC, please contact
-the maintainers at @code{gcc@@gcc.gnu.org}. A pretester should
-be willing to try to investigate bugs as well as report them.
-
-If you'd like to work on improvements, please ask for suggested projects
-or suggest your own ideas. If you have already written an improvement,
-please tell us about it. If you have not yet started work, it is useful
-to contact @code{gcc@@gcc.gnu.org} before you start; the
-maintainers may be able to suggest ways to make your extension fit in
-better with the rest of GCC and with other development plans.
-
-@node VMS
-@chapter Using GCC on VMS
-
-@c prevent bad page break with this line
-Here is how to use GCC on VMS.
-
-@menu
-* Include Files and VMS:: Where the preprocessor looks for the include files.
-* Global Declarations:: How to do globaldef, globalref and globalvalue with
- GCC.
-* VMS Misc:: Misc information.
-@end menu
-
-@node Include Files and VMS
-@section Include Files and VMS
-
-@cindex include files and VMS
-@cindex VMS and include files
-@cindex header files and VMS
-Due to the differences between the filesystems of Unix and VMS, GCC
-attempts to translate file names in @samp{#include} into names that VMS
-will understand. The basic strategy is to prepend a prefix to the
-specification of the include file, convert the whole filename to a VMS
-filename, and then try to open the file. GCC tries various prefixes
-one by one until one of them succeeds:
-
-@enumerate
-@item
-The first prefix is the @samp{GNU_CC_INCLUDE:} logical name: this is
-where GNU C header files are traditionally stored. If you wish to store
-header files in non-standard locations, then you can assign the logical
-@samp{GNU_CC_INCLUDE} to be a search list, where each element of the
-list is suitable for use with a rooted logical.
-
-@item
-The next prefix tried is @samp{SYS$SYSROOT:[SYSLIB.]}. This is where
-VAX-C header files are traditionally stored.
-
-@item
-If the include file specification by itself is a valid VMS filename, the
-preprocessor then uses this name with no prefix in an attempt to open
-the include file.
-
-@item
-If the file specification is not a valid VMS filename (i.e. does not
-contain a device or a directory specifier, and contains a @samp{/}
-character), the preprocessor tries to convert it from Unix syntax to
-VMS syntax.
-
-Conversion works like this: the first directory name becomes a device,
-and the rest of the directories are converted into VMS-format directory
-names. For example, the name @file{X11/foobar.h} is
-translated to @file{X11:[000000]foobar.h} or @file{X11:foobar.h},
-whichever one can be opened. This strategy allows you to assign a
-logical name to point to the actual location of the header files.
-
-@item
-If none of these strategies succeeds, the @samp{#include} fails.
-@end enumerate
-
-Include directives of the form:
-
-@example
-#include foobar
-@end example
-
-@noindent
-are a common source of incompatibility between VAX-C and GCC. VAX-C
-treats this much like a standard @code{#include <foobar.h>} directive.
-That is incompatible with the ANSI C behavior implemented by GCC: to
-expand the name @code{foobar} as a macro. Macro expansion should
-eventually yield one of the two standard formats for @code{#include}:
-
-@example
-#include "@var{file}"
-#include <@var{file}>
-@end example
-
-If you have this problem, the best solution is to modify the source to
-convert the @code{#include} directives to one of the two standard forms.
-That will work with either compiler. If you want a quick and dirty fix,
-define the file names as macros with the proper expansion, like this:
-
-@example
-#define stdio <stdio.h>
-@end example
-
-@noindent
-This will work, as long as the name doesn't conflict with anything else
-in the program.
-
-Another source of incompatibility is that VAX-C assumes that:
-
-@example
-#include "foobar"
-@end example
-
-@noindent
-is actually asking for the file @file{foobar.h}. GCC does not
-make this assumption, and instead takes what you ask for literally;
-it tries to read the file @file{foobar}. The best way to avoid this
-problem is to always specify the desired file extension in your include
-directives.
-
-GCC for VMS is distributed with a set of include files that is
-sufficient to compile most general purpose programs. Even though the
-GCC distribution does not contain header files to define constants
-and structures for some VMS system-specific functions, there is no
-reason why you cannot use GCC with any of these functions. You first
-may have to generate or create header files, either by using the public
-domain utility @code{UNSDL} (which can be found on a DECUS tape), or by
-extracting the relevant modules from one of the system macro libraries,
-and using an editor to construct a C header file.
-
-A @code{#include} file name cannot contain a DECNET node name. The
-preprocessor reports an I/O error if you attempt to use a node name,
-whether explicitly, or implicitly via a logical name.
-
-@node Global Declarations
-@section Global Declarations and VMS
-
-@findex GLOBALREF
-@findex GLOBALDEF
-@findex GLOBALVALUEDEF
-@findex GLOBALVALUEREF
-GCC does not provide the @code{globalref}, @code{globaldef} and
-@code{globalvalue} keywords of VAX-C. You can get the same effect with
-an obscure feature of GAS, the GNU assembler. (This requires GAS
-version 1.39 or later.) The following macros allow you to use this
-feature in a fairly natural way:
-
-@smallexample
-#ifdef __GNUC__
-#define GLOBALREF(TYPE,NAME) \
- TYPE NAME \
- asm ("_$$PsectAttributes_GLOBALSYMBOL$$" #NAME)
-#define GLOBALDEF(TYPE,NAME,VALUE) \
- TYPE NAME \
- asm ("_$$PsectAttributes_GLOBALSYMBOL$$" #NAME) \
- = VALUE
-#define GLOBALVALUEREF(TYPE,NAME) \
- const TYPE NAME[1] \
- asm ("_$$PsectAttributes_GLOBALVALUE$$" #NAME)
-#define GLOBALVALUEDEF(TYPE,NAME,VALUE) \
- const TYPE NAME[1] \
- asm ("_$$PsectAttributes_GLOBALVALUE$$" #NAME) \
- = @{VALUE@}
-#else
-#define GLOBALREF(TYPE,NAME) \
- globalref TYPE NAME
-#define GLOBALDEF(TYPE,NAME,VALUE) \
- globaldef TYPE NAME = VALUE
-#define GLOBALVALUEDEF(TYPE,NAME,VALUE) \
- globalvalue TYPE NAME = VALUE
-#define GLOBALVALUEREF(TYPE,NAME) \
- globalvalue TYPE NAME
-#endif
-@end smallexample
-
-@noindent
-(The @code{_$$PsectAttributes_GLOBALSYMBOL} prefix at the start of the
-name is removed by the assembler, after it has modified the attributes
-of the symbol). These macros are provided in the VMS binaries
-distribution in a header file @file{GNU_HACKS.H}. An example of the
-usage is:
-
-@example
-GLOBALREF (int, ijk);
-GLOBALDEF (int, jkl, 0);
-@end example
-
-The macros @code{GLOBALREF} and @code{GLOBALDEF} cannot be used
-straightforwardly for arrays, since there is no way to insert the array
-dimension into the declaration at the right place. However, you can
-declare an array with these macros if you first define a typedef for the
-array type, like this:
-
-@example
-typedef int intvector[10];
-GLOBALREF (intvector, foo);
-@end example
-
-Array and structure initializers will also break the macros; you can
-define the initializer to be a macro of its own, or you can expand the
-@code{GLOBALDEF} macro by hand. You may find a case where you wish to
-use the @code{GLOBALDEF} macro with a large array, but you are not
-interested in explicitly initializing each element of the array. In
-such cases you can use an initializer like: @code{@{0,@}}, which will
-initialize the entire array to @code{0}.
-
-A shortcoming of this implementation is that a variable declared with
-@code{GLOBALVALUEREF} or @code{GLOBALVALUEDEF} is always an array. For
-example, the declaration:
-
-@example
-GLOBALVALUEREF(int, ijk);
-@end example
-
-@noindent
-declares the variable @code{ijk} as an array of type @code{int [1]}.
-This is done because a globalvalue is actually a constant; its ``value''
-is what the linker would normally consider an address. That is not how
-an integer value works in C, but it is how an array works. So treating
-the symbol as an array name gives consistent results---with the
-exception that the value seems to have the wrong type. @strong{Don't
-try to access an element of the array.} It doesn't have any elements.
-The array ``address'' may not be the address of actual storage.
-
-The fact that the symbol is an array may lead to warnings where the
-variable is used. Insert type casts to avoid the warnings. Here is an
-example; it takes advantage of the ANSI C feature allowing macros that
-expand to use the same name as the macro itself.
-
-@example
-GLOBALVALUEREF (int, ss$_normal);
-GLOBALVALUEDEF (int, xyzzy,123);
-#ifdef __GNUC__
-#define ss$_normal ((int) ss$_normal)
-#define xyzzy ((int) xyzzy)
-#endif
-@end example
-
-Don't use @code{globaldef} or @code{globalref} with a variable whose
-type is an enumeration type; this is not implemented. Instead, make the
-variable an integer, and use a @code{globalvaluedef} for each of the
-enumeration values. An example of this would be:
-
-@example
-#ifdef __GNUC__
-GLOBALDEF (int, color, 0);
-GLOBALVALUEDEF (int, RED, 0);
-GLOBALVALUEDEF (int, BLUE, 1);
-GLOBALVALUEDEF (int, GREEN, 3);
-#else
-enum globaldef color @{RED, BLUE, GREEN = 3@};
-#endif
-@end example
-
-@node VMS Misc
-@section Other VMS Issues
-
-@cindex exit status and VMS
-@cindex return value of @code{main}
-@cindex @code{main} and the exit status
-GCC automatically arranges for @code{main} to return 1 by default if
-you fail to specify an explicit return value. This will be interpreted
-by VMS as a status code indicating a normal successful completion.
-Version 1 of GCC did not provide this default.
-
-GCC on VMS works only with the GNU assembler, GAS. You need version
-1.37 or later of GAS in order to produce value debugging information for
-the VMS debugger. Use the ordinary VMS linker with the object files
-produced by GAS.
-
-@cindex shared VMS run time system
-@cindex @file{VAXCRTL}
-Under previous versions of GCC, the generated code would occasionally
-give strange results when linked to the sharable @file{VAXCRTL} library.
-Now this should work.
-
-A caveat for use of @code{const} global variables: the @code{const}
-modifier must be specified in every external declaration of the variable
-in all of the source files that use that variable. Otherwise the linker
-will issue warnings about conflicting attributes for the variable. Your
-program will still work despite the warnings, but the variable will be
-placed in writable storage.
-
-@cindex name augmentation
-@cindex case sensitivity and VMS
-@cindex VMS and case sensitivity
-Although the VMS linker does distinguish between upper and lower case
-letters in global symbols, most VMS compilers convert all such symbols
-into upper case and most run-time library routines also have upper case
-names. To be able to reliably call such routines, GCC (by means of
-the assembler GAS) converts global symbols into upper case like other
-VMS compilers. However, since the usual practice in C is to distinguish
-case, GCC (via GAS) tries to preserve usual C behavior by augmenting
-each name that is not all lower case. This means truncating the name
-to at most 23 characters and then adding more characters at the end
-which encode the case pattern of those 23. Names which contain at
-least one dollar sign are an exception; they are converted directly into
-upper case without augmentation.
-
-Name augmentation yields bad results for programs that use precompiled
-libraries (such as Xlib) which were generated by another compiler. You
-can use the compiler option @samp{/NOCASE_HACK} to inhibit augmentation;
-it makes external C functions and variables case-independent as is usual
-on VMS. Alternatively, you could write all references to the functions
-and variables in such libraries using lower case; this will work on VMS,
-but is not portable to other systems. The compiler option @samp{/NAMES}
-also provides control over global name handling.
-
-Function and variable names are handled somewhat differently with GNU
-C++. The GNU C++ compiler performs @dfn{name mangling} on function
-names, which means that it adds information to the function name to
-describe the data types of the arguments that the function takes. One
-result of this is that the name of a function can become very long.
-Since the VMS linker only recognizes the first 31 characters in a name,
-special action is taken to ensure that each function and variable has a
-unique name that can be represented in 31 characters.
-
-If the name (plus a name augmentation, if required) is less than 32
-characters in length, then no special action is performed. If the name
-is longer than 31 characters, the assembler (GAS) will generate a
-hash string based upon the function name, truncate the function name to
-23 characters, and append the hash string to the truncated name. If the
-@samp{/VERBOSE} compiler option is used, the assembler will print both
-the full and truncated names of each symbol that is truncated.
-
-The @samp{/NOCASE_HACK} compiler option should not be used when you are
-compiling programs that use libg++. libg++ has several instances of
-objects (i.e. @code{Filebuf} and @code{filebuf}) which become
-indistinguishable in a case-insensitive environment. This leads to
-cases where you need to inhibit augmentation selectively (if you were
-using libg++ and Xlib in the same program, for example). There is no
-special feature for doing this, but you can get the result by defining a
-macro for each mixed case symbol for which you wish to inhibit
-augmentation. The macro should expand into the lower case equivalent of
-itself. For example:
-
-@example
-#define StuDlyCapS studlycaps
-@end example
-
-These macro definitions can be placed in a header file to minimize the
-number of changes to your source code.
-@end ifset
-
-@ifset INTERNALS
-@node Portability
-@chapter GCC and Portability
-@cindex portability
-@cindex GCC and portability
-
-The main goal of GCC was to make a good, fast compiler for machines in
-the class that the GNU system aims to run on: 32-bit machines that address
-8-bit bytes and have several general registers. Elegance, theoretical
-power and simplicity are only secondary.
-
-GCC gets most of the information about the target machine from a machine
-description which gives an algebraic formula for each of the machine's
-instructions. This is a very clean way to describe the target. But when
-the compiler needs information that is difficult to express in this
-fashion, I have not hesitated to define an ad-hoc parameter to the machine
-description. The purpose of portability is to reduce the total work needed
-on the compiler; it was not of interest for its own sake.
-
-@cindex endianness
-@cindex autoincrement addressing, availability
-@findex abort
-GCC does not contain machine dependent code, but it does contain code
-that depends on machine parameters such as endianness (whether the most
-significant byte has the highest or lowest address of the bytes in a word)
-and the availability of autoincrement addressing. In the RTL-generation
-pass, it is often necessary to have multiple strategies for generating code
-for a particular kind of syntax tree, strategies that are usable for different
-combinations of parameters. Often I have not tried to address all possible
-cases, but only the common ones or only the ones that I have encountered.
-As a result, a new target may require additional strategies. You will know
-if this happens because the compiler will call @code{abort}. Fortunately,
-the new strategies can be added in a machine-independent fashion, and will
-affect only the target machines that need them.
-@end ifset
-
-@ifset INTERNALS
-@node Interface
-@chapter Interfacing to GCC Output
-@cindex interfacing to GCC output
-@cindex run-time conventions
-@cindex function call conventions
-@cindex conventions, run-time
-
-GCC is normally configured to use the same function calling convention
-normally in use on the target system. This is done with the
-machine-description macros described (@pxref{Target Macros}).
-
-@cindex unions, returning
-@cindex structures, returning
-@cindex returning structures and unions
-However, returning of structure and union values is done differently on
-some target machines. As a result, functions compiled with PCC
-returning such types cannot be called from code compiled with GCC,
-and vice versa. This does not cause trouble often because few Unix
-library routines return structures or unions.
-
-GCC code returns structures and unions that are 1, 2, 4 or 8 bytes
-long in the same registers used for @code{int} or @code{double} return
-values. (GCC typically allocates variables of such types in
-registers also.) Structures and unions of other sizes are returned by
-storing them into an address passed by the caller (usually in a
-register). The machine-description macros @code{STRUCT_VALUE} and
-@code{STRUCT_INCOMING_VALUE} tell GCC where to pass this address.
-
-By contrast, PCC on most target machines returns structures and unions
-of any size by copying the data into an area of static storage, and then
-returning the address of that storage as if it were a pointer value.
-The caller must copy the data from that memory area to the place where
-the value is wanted. This is slower than the method used by GCC, and
-fails to be reentrant.
-
-On some target machines, such as RISC machines and the 80386, the
-standard system convention is to pass to the subroutine the address of
-where to return the value. On these machines, GCC has been
-configured to be compatible with the standard compiler, when this method
-is used. It may not be compatible for structures of 1, 2, 4 or 8 bytes.
-
-@cindex argument passing
-@cindex passing arguments
-GCC uses the system's standard convention for passing arguments. On
-some machines, the first few arguments are passed in registers; in
-others, all are passed on the stack. It would be possible to use
-registers for argument passing on any machine, and this would probably
-result in a significant speedup. But the result would be complete
-incompatibility with code that follows the standard convention. So this
-change is practical only if you are switching to GCC as the sole C
-compiler for the system. We may implement register argument passing on
-certain machines once we have a complete GNU system so that we can
-compile the libraries with GCC.
-
-On some machines (particularly the Sparc), certain types of arguments
-are passed ``by invisible reference''. This means that the value is
-stored in memory, and the address of the memory location is passed to
-the subroutine.
-
-@cindex @code{longjmp} and automatic variables
-If you use @code{longjmp}, beware of automatic variables. ANSI C says that
-automatic variables that are not declared @code{volatile} have undefined
-values after a @code{longjmp}. And this is all GCC promises to do,
-because it is very difficult to restore register variables correctly, and
-one of GCC's features is that it can put variables in registers without
-your asking it to.
-
-If you want a variable to be unaltered by @code{longjmp}, and you don't
-want to write @code{volatile} because old C compilers don't accept it,
-just take the address of the variable. If a variable's address is ever
-taken, even if just to compute it and ignore it, then the variable cannot
-go in a register:
-
-@example
-@{
- int careful;
- &careful;
- @dots{}
-@}
-@end example
-
-@cindex arithmetic libraries
-@cindex math libraries
-Code compiled with GCC may call certain library routines. Most of
-them handle arithmetic for which there are no instructions. This
-includes multiply and divide on some machines, and floating point
-operations on any machine for which floating point support is disabled
-with @samp{-msoft-float}. Some standard parts of the C library, such as
-@code{bcopy} or @code{memcpy}, are also called automatically. The usual
-function call interface is used for calling the library routines.
-
-These library routines should be defined in the library @file{libgcc.a},
-which GCC automatically searches whenever it links a program. On
-machines that have multiply and divide instructions, if hardware
-floating point is in use, normally @file{libgcc.a} is not needed, but it
-is searched just in case.
-
-Each arithmetic function is defined in @file{libgcc1.c} to use the
-corresponding C arithmetic operator. As long as the file is compiled
-with another C compiler, which supports all the C arithmetic operators,
-this file will work portably. However, @file{libgcc1.c} does not work if
-compiled with GCC, because each arithmetic function would compile
-into a call to itself!
-@end ifset
-
-@ifset INTERNALS
-@node Passes
-@chapter Passes and Files of the Compiler
-@cindex passes and files of the compiler
-@cindex files and passes of the compiler
-@cindex compiler passes and files
-
-@cindex top level of compiler
-The overall control structure of the compiler is in @file{toplev.c}. This
-file is responsible for initialization, decoding arguments, opening and
-closing files, and sequencing the passes.
-
-@cindex parsing pass
-The parsing pass is invoked only once, to parse the entire input. The RTL
-intermediate code for a function is generated as the function is parsed, a
-statement at a time. Each statement is read in as a syntax tree and then
-converted to RTL; then the storage for the tree for the statement is
-reclaimed. Storage for types (and the expressions for their sizes),
-declarations, and a representation of the binding contours and how they nest,
-remain until the function is finished being compiled; these are all needed
-to output the debugging information.
-
-@findex rest_of_compilation
-@findex rest_of_decl_compilation
-Each time the parsing pass reads a complete function definition or
-top-level declaration, it calls either the function
-@code{rest_of_compilation}, or the function
-@code{rest_of_decl_compilation} in @file{toplev.c}, which are
-responsible for all further processing necessary, ending with output of
-the assembler language. All other compiler passes run, in sequence,
-within @code{rest_of_compilation}. When that function returns from
-compiling a function definition, the storage used for that function
-definition's compilation is entirely freed, unless it is an inline
-function
-@ifset USING
-(@pxref{Inline,,An Inline Function is As Fast As a Macro}).
-@end ifset
-@ifclear USING
-(@pxref{Inline,,An Inline Function is As Fast As a Macro,gcc.texi,Using GCC}).
-@end ifclear
-
-Here is a list of all the passes of the compiler and their source files.
-Also included is a description of where debugging dumps can be requested
-with @samp{-d} options.
-
-@itemize @bullet
-@item
-Parsing. This pass reads the entire text of a function definition,
-constructing partial syntax trees. This and RTL generation are no longer
-truly separate passes (formerly they were), but it is easier to think
-of them as separate.
-
-The tree representation does not entirely follow C syntax, because it is
-intended to support other languages as well.
-
-Language-specific data type analysis is also done in this pass, and every
-tree node that represents an expression has a data type attached.
-Variables are represented as declaration nodes.
-
-@cindex constant folding
-@cindex arithmetic simplifications
-@cindex simplifications, arithmetic
-Constant folding and some arithmetic simplifications are also done
-during this pass.
-
-The language-independent source files for parsing are
-@file{stor-layout.c}, @file{fold-const.c}, and @file{tree.c}.
-There are also header files @file{tree.h} and @file{tree.def}
-which define the format of the tree representation.@refill
-
-@c Avoiding overfull is tricky here.
-The source files to parse C are
-@file{c-parse.in},
-@file{c-decl.c},
-@file{c-typeck.c},
-@file{c-aux-info.c},
-@file{c-convert.c},
-and @file{c-lang.c}
-along with header files
-@file{c-lex.h}, and
-@file{c-tree.h}.
-
-The source files for parsing C++ are @file{cp-parse.y},
-@file{cp-class.c},@*
-@file{cp-cvt.c}, @file{cp-decl.c}, @file{cp-decl2.c},
-@file{cp-dem.c}, @file{cp-except.c},@*
-@file{cp-expr.c}, @file{cp-init.c}, @file{cp-lex.c},
-@file{cp-method.c}, @file{cp-ptree.c},@*
-@file{cp-search.c}, @file{cp-tree.c}, @file{cp-type2.c}, and
-@file{cp-typeck.c}, along with header files @file{cp-tree.def},
-@file{cp-tree.h}, and @file{cp-decl.h}.
-
-The special source files for parsing Objective C are
-@file{objc-parse.y}, @file{objc-actions.c}, @file{objc-tree.def}, and
-@file{objc-actions.h}. Certain C-specific files are used for this as
-well.
-
-The file @file{c-common.c} is also used for all of the above languages.
-
-@cindex RTL generation
-@item
-RTL generation. This is the conversion of syntax tree into RTL code.
-It is actually done statement-by-statement during parsing, but for
-most purposes it can be thought of as a separate pass.
-
-@cindex target-parameter-dependent code
-This is where the bulk of target-parameter-dependent code is found,
-since often it is necessary for strategies to apply only when certain
-standard kinds of instructions are available. The purpose of named
-instruction patterns is to provide this information to the RTL
-generation pass.
-
-@cindex tail recursion optimization
-Optimization is done in this pass for @code{if}-conditions that are
-comparisons, boolean operations or conditional expressions. Tail
-recursion is detected at this time also. Decisions are made about how
-best to arrange loops and how to output @code{switch} statements.
-
-@c Avoiding overfull is tricky here.
-The source files for RTL generation include
-@file{stmt.c},
-@file{calls.c},
-@file{expr.c},
-@file{explow.c},
-@file{expmed.c},
-@file{function.c},
-@file{optabs.c}
-and @file{emit-rtl.c}.
-Also, the file
-@file{insn-emit.c}, generated from the machine description by the
-program @code{genemit}, is used in this pass. The header file
-@file{expr.h} is used for communication within this pass.@refill
-
-@findex genflags
-@findex gencodes
-The header files @file{insn-flags.h} and @file{insn-codes.h},
-generated from the machine description by the programs @code{genflags}
-and @code{gencodes}, tell this pass which standard names are available
-for use and which patterns correspond to them.@refill
-
-Aside from debugging information output, none of the following passes
-refers to the tree structure representation of the function (only
-part of which is saved).
-
-@cindex inline, automatic
-The decision of whether the function can and should be expanded inline
-in its subsequent callers is made at the end of rtl generation. The
-function must meet certain criteria, currently related to the size of
-the function and the types and number of parameters it has. Note that
-this function may contain loops, recursive calls to itself
-(tail-recursive functions can be inlined!), gotos, in short, all
-constructs supported by GCC. The file @file{integrate.c} contains
-the code to save a function's rtl for later inlining and to inline that
-rtl when the function is called. The header file @file{integrate.h}
-is also used for this purpose.
-
-The option @samp{-dr} causes a debugging dump of the RTL code after
-this pass. This dump file's name is made by appending @samp{.rtl} to
-the input file name.
-
-@cindex jump optimization
-@cindex unreachable code
-@cindex dead code
-@item
-Jump optimization. This pass simplifies jumps to the following
-instruction, jumps across jumps, and jumps to jumps. It deletes
-unreferenced labels and unreachable code, except that unreachable code
-that contains a loop is not recognized as unreachable in this pass.
-(Such loops are deleted later in the basic block analysis.) It also
-converts some code originally written with jumps into sequences of
-instructions that directly set values from the results of comparisons,
-if the machine has such instructions.
-
-Jump optimization is performed two or three times. The first time is
-immediately following RTL generation. The second time is after CSE,
-but only if CSE says repeated jump optimization is needed. The
-last time is right before the final pass. That time, cross-jumping
-and deletion of no-op move instructions are done together with the
-optimizations described above.
-
-The source file of this pass is @file{jump.c}.
-
-The option @samp{-dj} causes a debugging dump of the RTL code after
-this pass is run for the first time. This dump file's name is made by
-appending @samp{.jump} to the input file name.
-
-@cindex register use analysis
-@item
-Register scan. This pass finds the first and last use of each
-register, as a guide for common subexpression elimination. Its source
-is in @file{regclass.c}.
-
-@cindex jump threading
-@item
-Jump threading. This pass detects a condition jump that branches to an
-identical or inverse test. Such jumps can be @samp{threaded} through
-the second conditional test. The source code for this pass is in
-@file{jump.c}. This optimization is only performed if
-@samp{-fthread-jumps} is enabled.
-
-@cindex common subexpression elimination
-@cindex constant propagation
-@item
-Common subexpression elimination. This pass also does constant
-propagation. Its source file is @file{cse.c}. If constant
-propagation causes conditional jumps to become unconditional or to
-become no-ops, jump optimization is run again when CSE is finished.
-
-The option @samp{-ds} causes a debugging dump of the RTL code after
-this pass. This dump file's name is made by appending @samp{.cse} to
-the input file name.
-
-@cindex global common subexpression elimination
-@cindex constant propagation
-@cindex copy propagation
-@item
-Global common subexpression elimination. This pass performs GCSE
-using Morel-Renvoise Partial Redundancy Elimination, with the exception
-that it does not try to move invariants out of loops - that is left to
-the loop optimization pass. This pass also performs global constant
-and copy propagation.
-
-The source file for this pass is gcse.c.
-
-The option @samp{-dG} causes a debugging dump of the RTL code after
-this pass. This dump file's name is made by appending @samp{.gcse} to
-the input file name.
-
-@cindex loop optimization
-@cindex code motion
-@cindex strength-reduction
-@item
-Loop optimization. This pass moves constant expressions out of loops,
-and optionally does strength-reduction and loop unrolling as well.
-Its source files are @file{loop.c} and @file{unroll.c}, plus the header
-@file{loop.h} used for communication between them. Loop unrolling uses
-some functions in @file{integrate.c} and the header @file{integrate.h}.
-
-The option @samp{-dL} causes a debugging dump of the RTL code after
-this pass. This dump file's name is made by appending @samp{.loop} to
-the input file name.
-
-@item
-If @samp{-frerun-cse-after-loop} was enabled, a second common
-subexpression elimination pass is performed after the loop optimization
-pass. Jump threading is also done again at this time if it was specified.
-
-The option @samp{-dt} causes a debugging dump of the RTL code after
-this pass. This dump file's name is made by appending @samp{.cse2} to
-the input file name.
-
-@cindex register allocation, stupid
-@cindex stupid register allocation
-@item
-Stupid register allocation is performed at this point in a
-nonoptimizing compilation. It does a little data flow analysis as
-well. When stupid register allocation is in use, the next pass
-executed is the reloading pass; the others in between are skipped.
-The source file is @file{stupid.c}.
-
-@cindex data flow analysis
-@cindex analysis, data flow
-@cindex basic blocks
-@item
-Data flow analysis (@file{flow.c}). This pass divides the program
-into basic blocks (and in the process deletes unreachable loops); then
-it computes which pseudo-registers are live at each point in the
-program, and makes the first instruction that uses a value point at
-the instruction that computed the value.
-
-@cindex autoincrement/decrement analysis
-This pass also deletes computations whose results are never used, and
-combines memory references with add or subtract instructions to make
-autoincrement or autodecrement addressing.
-
-The option @samp{-df} causes a debugging dump of the RTL code after
-this pass. This dump file's name is made by appending @samp{.flow} to
-the input file name. If stupid register allocation is in use, this
-dump file reflects the full results of such allocation.
-
-@cindex instruction combination
-@item
-Instruction combination (@file{combine.c}). This pass attempts to
-combine groups of two or three instructions that are related by data
-flow into single instructions. It combines the RTL expressions for
-the instructions by substitution, simplifies the result using algebra,
-and then attempts to match the result against the machine description.
-
-The option @samp{-dc} causes a debugging dump of the RTL code after
-this pass. This dump file's name is made by appending @samp{.combine}
-to the input file name.
-
-@cindex register movement
-@item
-Register movement (@file{regmove.c}). This pass looks for cases where
-matching constraints would force an instruction to need a reload, and
-this reload would be a register to register move. It them attempts
-to change the registers used by the instruction to avoid the move
-instruction.
-
-The option @samp{-dN} causes a debugging dump of the RTL code after
-this pass. This dump file's name is made by appending @samp{.regmove}
-to the input file name.
-
-@cindex instruction scheduling
-@cindex scheduling, instruction
-@item
-Instruction scheduling (@file{sched.c}). This pass looks for
-instructions whose output will not be available by the time that it is
-used in subsequent instructions. (Memory loads and floating point
-instructions often have this behavior on RISC machines). It re-orders
-instructions within a basic block to try to separate the definition and
-use of items that otherwise would cause pipeline stalls.
-
-Instruction scheduling is performed twice. The first time is immediately
-after instruction combination and the second is immediately after reload.
-
-The option @samp{-dS} causes a debugging dump of the RTL code after this
-pass is run for the first time. The dump file's name is made by
-appending @samp{.sched} to the input file name.
-
-@cindex register class preference pass
-@item
-Register class preferencing. The RTL code is scanned to find out
-which register class is best for each pseudo register. The source
-file is @file{regclass.c}.
-
-@cindex register allocation
-@cindex local register allocation
-@item
-Local register allocation (@file{local-alloc.c}). This pass allocates
-hard registers to pseudo registers that are used only within one basic
-block. Because the basic block is linear, it can use fast and
-powerful techniques to do a very good job.
-
-The option @samp{-dl} causes a debugging dump of the RTL code after
-this pass. This dump file's name is made by appending @samp{.lreg} to
-the input file name.
-
-@cindex global register allocation
-@item
-Global register allocation (@file{global.c}). This pass
-allocates hard registers for the remaining pseudo registers (those
-whose life spans are not contained in one basic block).
-
-@cindex reloading
-@item
-Reloading. This pass renumbers pseudo registers with the hardware
-registers numbers they were allocated. Pseudo registers that did not
-get hard registers are replaced with stack slots. Then it finds
-instructions that are invalid because a value has failed to end up in
-a register, or has ended up in a register of the wrong kind. It fixes
-up these instructions by reloading the problematical values
-temporarily into registers. Additional instructions are generated to
-do the copying.
-
-The reload pass also optionally eliminates the frame pointer and inserts
-instructions to save and restore call-clobbered registers around calls.
-
-Source files are @file{reload.c} and @file{reload1.c}, plus the header
-@file{reload.h} used for communication between them.
-
-The option @samp{-dg} causes a debugging dump of the RTL code after
-this pass. This dump file's name is made by appending @samp{.greg} to
-the input file name.
-
-@cindex instruction scheduling
-@cindex scheduling, instruction
-@item
-Instruction scheduling is repeated here to try to avoid pipeline stalls
-due to memory loads generated for spilled pseudo registers.
-
-The option @samp{-dR} causes a debugging dump of the RTL code after
-this pass. This dump file's name is made by appending @samp{.sched2}
-to the input file name.
-
-@cindex cross-jumping
-@cindex no-op move instructions
-@item
-Jump optimization is repeated, this time including cross-jumping
-and deletion of no-op move instructions.
-
-The option @samp{-dJ} causes a debugging dump of the RTL code after
-this pass. This dump file's name is made by appending @samp{.jump2}
-to the input file name.
-
-@cindex delayed branch scheduling
-@cindex scheduling, delayed branch
-@item
-Delayed branch scheduling. This optional pass attempts to find
-instructions that can go into the delay slots of other instructions,
-usually jumps and calls. The source file name is @file{reorg.c}.
-
-The option @samp{-dd} causes a debugging dump of the RTL code after
-this pass. This dump file's name is made by appending @samp{.dbr}
-to the input file name.
-
-@cindex register-to-stack conversion
-@item
-Conversion from usage of some hard registers to usage of a register
-stack may be done at this point. Currently, this is supported only
-for the floating-point registers of the Intel 80387 coprocessor. The
-source file name is @file{reg-stack.c}.
-
-The options @samp{-dk} causes a debugging dump of the RTL code after
-this pass. This dump file's name is made by appending @samp{.stack}
-to the input file name.
-
-@cindex final pass
-@cindex peephole optimization
-@item
-Final. This pass outputs the assembler code for the function. It is
-also responsible for identifying spurious test and compare
-instructions. Machine-specific peephole optimizations are performed
-at the same time. The function entry and exit sequences are generated
-directly as assembler code in this pass; they never exist as RTL.
-
-The source files are @file{final.c} plus @file{insn-output.c}; the
-latter is generated automatically from the machine description by the
-tool @file{genoutput}. The header file @file{conditions.h} is used
-for communication between these files.
-
-@cindex debugging information generation
-@item
-Debugging information output. This is run after final because it must
-output the stack slot offsets for pseudo registers that did not get
-hard registers. Source files are @file{dbxout.c} for DBX symbol table
-format, @file{sdbout.c} for SDB symbol table format, and
-@file{dwarfout.c} for DWARF symbol table format.
-@end itemize
-
-Some additional files are used by all or many passes:
-
-@itemize @bullet
-@item
-Every pass uses @file{machmode.def} and @file{machmode.h} which define
-the machine modes.
-
-@item
-Several passes use @file{real.h}, which defines the default
-representation of floating point constants and how to operate on them.
-
-@item
-All the passes that work with RTL use the header files @file{rtl.h}
-and @file{rtl.def}, and subroutines in file @file{rtl.c}. The tools
-@code{gen*} also use these files to read and work with the machine
-description RTL.
-
-@findex genconfig
-@item
-Several passes refer to the header file @file{insn-config.h} which
-contains a few parameters (C macro definitions) generated
-automatically from the machine description RTL by the tool
-@code{genconfig}.
-
-@cindex instruction recognizer
-@item
-Several passes use the instruction recognizer, which consists of
-@file{recog.c} and @file{recog.h}, plus the files @file{insn-recog.c}
-and @file{insn-extract.c} that are generated automatically from the
-machine description by the tools @file{genrecog} and
-@file{genextract}.@refill
-
-@item
-Several passes use the header files @file{regs.h} which defines the
-information recorded about pseudo register usage, and @file{basic-block.h}
-which defines the information recorded about basic blocks.
-
-@item
-@file{hard-reg-set.h} defines the type @code{HARD_REG_SET}, a bit-vector
-with a bit for each hard register, and some macros to manipulate it.
-This type is just @code{int} if the machine has few enough hard registers;
-otherwise it is an array of @code{int} and some of the macros expand
-into loops.
-
-@item
-Several passes use instruction attributes. A definition of the
-attributes defined for a particular machine is in file
-@file{insn-attr.h}, which is generated from the machine description by
-the program @file{genattr}. The file @file{insn-attrtab.c} contains
-subroutines to obtain the attribute values for insns. It is generated
-from the machine description by the program @file{genattrtab}.@refill
-@end itemize
-@end ifset
-
-@ifset INTERNALS
-@include rtl.texi
-@include md.texi
-@include tm.texi
-@end ifset
-
-@ifset INTERNALS
-@node Config
-@chapter The Configuration File
-@cindex configuration file
-@cindex @file{xm-@var{machine}.h}
-
-The configuration file @file{xm-@var{machine}.h} contains macro
-definitions that describe the machine and system on which the compiler
-is running, unlike the definitions in @file{@var{machine}.h}, which
-describe the machine for which the compiler is producing output. Most
-of the values in @file{xm-@var{machine}.h} are actually the same on all
-machines that GCC runs on, so large parts of all configuration files
-are identical. But there are some macros that vary:
-
-@table @code
-@findex USG
-@item USG
-Define this macro if the host system is System V.
-
-@findex VMS
-@item VMS
-Define this macro if the host system is VMS.
-
-@findex FATAL_EXIT_CODE
-@item FATAL_EXIT_CODE
-A C expression for the status code to be returned when the compiler
-exits after serious errors.
-
-@findex SUCCESS_EXIT_CODE
-@item SUCCESS_EXIT_CODE
-A C expression for the status code to be returned when the compiler
-exits without serious errors.
-
-@findex HOST_WORDS_BIG_ENDIAN
-@item HOST_WORDS_BIG_ENDIAN
-Defined if the host machine stores words of multi-word values in
-big-endian order. (GCC does not depend on the host byte ordering
-within a word.)
-
-@findex HOST_FLOAT_WORDS_BIG_ENDIAN
-@item HOST_FLOAT_WORDS_BIG_ENDIAN
-Define this macro to be 1 if the host machine stores @code{DFmode},
-@code{XFmode} or @code{TFmode} floating point numbers in memory with the
-word containing the sign bit at the lowest address; otherwise, define it
-to be zero.
-
-This macro need not be defined if the ordering is the same as for
-multi-word integers.
-
-@findex HOST_FLOAT_FORMAT
-@item HOST_FLOAT_FORMAT
-A numeric code distinguishing the floating point format for the host
-machine. See @code{TARGET_FLOAT_FORMAT} in @ref{Storage Layout} for the
-alternatives and default.
-
-@findex HOST_BITS_PER_CHAR
-@item HOST_BITS_PER_CHAR
-A C expression for the number of bits in @code{char} on the host
-machine.
-
-@findex HOST_BITS_PER_SHORT
-@item HOST_BITS_PER_SHORT
-A C expression for the number of bits in @code{short} on the host
-machine.
-
-@findex HOST_BITS_PER_INT
-@item HOST_BITS_PER_INT
-A C expression for the number of bits in @code{int} on the host
-machine.
-
-@findex HOST_BITS_PER_LONG
-@item HOST_BITS_PER_LONG
-A C expression for the number of bits in @code{long} on the host
-machine.
-
-@findex ONLY_INT_FIELDS
-@item ONLY_INT_FIELDS
-Define this macro to indicate that the host compiler only supports
-@code{int} bit fields, rather than other integral types, including
-@code{enum}, as do most C compilers.
-
-@findex OBSTACK_CHUNK_SIZE
-@item OBSTACK_CHUNK_SIZE
-A C expression for the size of ordinary obstack chunks.
-If you don't define this, a usually-reasonable default is used.
-
-@findex OBSTACK_CHUNK_ALLOC
-@item OBSTACK_CHUNK_ALLOC
-The function used to allocate obstack chunks.
-If you don't define this, @code{xmalloc} is used.
-
-@findex OBSTACK_CHUNK_FREE
-@item OBSTACK_CHUNK_FREE
-The function used to free obstack chunks.
-If you don't define this, @code{free} is used.
-
-@findex USE_C_ALLOCA
-@item USE_C_ALLOCA
-Define this macro to indicate that the compiler is running with the
-@code{alloca} implemented in C. This version of @code{alloca} can be
-found in the file @file{alloca.c}; to use it, you must also alter the
-@file{Makefile} variable @code{ALLOCA}. (This is done automatically
-for the systems on which we know it is needed.)
-
-If you do define this macro, you should probably do it as follows:
-
-@example
-#ifndef __GNUC__
-#define USE_C_ALLOCA
-#else
-#define alloca __builtin_alloca
-#endif
-@end example
-
-@noindent
-so that when the compiler is compiled with GCC it uses the more
-efficient built-in @code{alloca} function.
-
-@item FUNCTION_CONVERSION_BUG
-@findex FUNCTION_CONVERSION_BUG
-Define this macro to indicate that the host compiler does not properly
-handle converting a function value to a pointer-to-function when it is
-used in an expression.
-
-@findex MULTIBYTE_CHARS
-@item MULTIBYTE_CHARS
-Define this macro to enable support for multibyte characters in the
-input to GCC. This requires that the host system support the ANSI C
-library functions for converting multibyte characters to wide
-characters.
-
-@findex POSIX
-@item POSIX
-Define this if your system is POSIX.1 compliant.
-
-@findex NO_SYS_SIGLIST
-@item NO_SYS_SIGLIST
-Define this if your system @emph{does not} provide the variable
-@code{sys_siglist}.
-
-@vindex sys_siglist
-Some systems do provide this variable, but with a different name such
-as @code{_sys_siglist}. On these systems, you can define
-@code{sys_siglist} as a macro which expands into the name actually
-provided.
-
-Autoconf normally defines @code{SYS_SIGLIST_DECLARED} when it finds a
-declaration of @code{sys_siglist} in the system header files.
-However, when you define @code{sys_siglist} to a different name
-autoconf will not automatically define @code{SYS_SIGLIST_DECLARED}.
-Therefore, if you define @code{sys_siglist}, you should also define
-@code{SYS_SIGLIST_DECLARED}.
-
-@findex USE_PROTOTYPES
-@item USE_PROTOTYPES
-Define this to be 1 if you know that the host compiler supports
-prototypes, even if it doesn't define __STDC__, or define
-it to be 0 if you do not want any prototypes used in compiling
-GCC. If @samp{USE_PROTOTYPES} is not defined, it will be
-determined automatically whether your compiler supports
-prototypes by checking if @samp{__STDC__} is defined.
-
-@findex NO_MD_PROTOTYPES
-@item NO_MD_PROTOTYPES
-Define this if you wish suppression of prototypes generated from
-the machine description file, but to use other prototypes within
-GCC. If @samp{USE_PROTOTYPES} is defined to be 0, or the
-host compiler does not support prototypes, this macro has no
-effect.
-
-@findex MD_CALL_PROTOTYPES
-@item MD_CALL_PROTOTYPES
-Define this if you wish to generate prototypes for the
-@code{gen_call} or @code{gen_call_value} functions generated from
-the machine description file. If @samp{USE_PROTOTYPES} is
-defined to be 0, or the host compiler does not support
-prototypes, or @samp{NO_MD_PROTOTYPES} is defined, this macro has
-no effect. As soon as all of the machine descriptions are
-modified to have the appropriate number of arguments, this macro
-will be removed.
-
-@findex PATH_SEPARATOR
-@item PATH_SEPARATOR
-Define this macro to be a C character constant representing the
-character used to separate components in paths. The default value is
-the colon character
-
-@findex DIR_SEPARATOR
-@item DIR_SEPARATOR
-If your system uses some character other than slash to separate
-directory names within a file specification, define this macro to be a C
-character constant specifying that character. When GCC displays file
-names, the character you specify will be used. GCC will test for
-both slash and the character you specify when parsing filenames.
-
-@findex OBJECT_SUFFIX
-@item OBJECT_SUFFIX
-Define this macro to be a C string representing the suffix for object
-files on your machine. If you do not define this macro, GCC will use
-@samp{.o} as the suffix for object files.
-
-@findex EXECUTABLE_SUFFIX
-@item EXECUTABLE_SUFFIX
-Define this macro to be a C string representing the suffix for executable
-files on your machine. If you do not define this macro, GCC will use
-the null string as the suffix for object files.
-
-@findex COLLECT_EXPORT_LIST
-@item COLLECT_EXPORT_LIST
-If defined, @code{collect2} will scan the individual object files
-specified on its command line and create an export list for the linker.
-Define this macro for systems like AIX, where the linker discards
-object files that are not referenced from @code{main} and uses export
-lists.
-@end table
-
-@findex bzero
-@findex bcmp
-In addition, configuration files for system V define @code{bcopy},
-@code{bzero} and @code{bcmp} as aliases. Some files define @code{alloca}
-as a macro when compiled with GCC, in order to take advantage of the
-benefit of GCC's built-in @code{alloca}.
-
-@node Fragments
-@chapter Makefile Fragments
-@cindex makefile fragment
-
-When you configure GCC using the @file{configure} script
-(@pxref{Installation}), it will construct the file @file{Makefile} from
-the template file @file{Makefile.in}. When it does this, it will
-incorporate makefile fragment files from the @file{config} directory,
-named @file{t-@var{target}} and @file{x-@var{host}}. If these files do
-not exist, it means nothing needs to be added for a given target or
-host.
-
-@menu
-* Target Fragment:: Writing the @file{t-@var{target}} file.
-* Host Fragment:: Writing the @file{x-@var{host}} file.
-@end menu
-
-@node Target Fragment
-@section The Target Makefile Fragment
-@cindex target makefile fragment
-@cindex @file{t-@var{target}}
-
-The target makefile fragment, @file{t-@var{target}}, defines special
-target dependent variables and targets used in the @file{Makefile}:
-
-@table @code
-@findex LIBGCC1
-@item LIBGCC1
-The rule to use to build @file{libgcc1.a}.
-If your target does not need to use the functions in @file{libgcc1.a},
-set this to empty.
-@xref{Interface}.
-
-@findex CROSS_LIBGCC1
-@item CROSS_LIBGCC1
-The rule to use to build @file{libgcc1.a} when building a cross
-compiler. If your target does not need to use the functions in
-@file{libgcc1.a}, set this to empty. @xref{Cross Runtime}.
-
-@findex LIBGCC2_CFLAGS
-@item LIBGCC2_CFLAGS
-Compiler flags to use when compiling @file{libgcc2.c}.
-
-@findex LIB2FUNCS_EXTRA
-@item LIB2FUNCS_EXTRA
-A list of source file names to be compiled or assembled and inserted
-into @file{libgcc.a}.
-
-@findex CRTSTUFF_T_CFLAGS
-@item CRTSTUFF_T_CFLAGS
-Special flags used when compiling @file{crtstuff.c}.
-@xref{Initialization}.
-
-@findex CRTSTUFF_T_CFLAGS_S
-@item CRTSTUFF_T_CFLAGS_S
-Special flags used when compiling @file{crtstuff.c} for shared
-linking. Used if you use @file{crtbeginS.o} and @file{crtendS.o}
-in @code{EXTRA-PARTS}.
-@xref{Initialization}.
-
-@findex MULTILIB_OPTIONS
-@item MULTILIB_OPTIONS
-For some targets, invoking GCC in different ways produces objects
-that can not be linked together. For example, for some targets GCC
-produces both big and little endian code. For these targets, you must
-arrange for multiple versions of @file{libgcc.a} to be compiled, one for
-each set of incompatible options. When GCC invokes the linker, it
-arranges to link in the right version of @file{libgcc.a}, based on
-the command line options used.
-
-The @code{MULTILIB_OPTIONS} macro lists the set of options for which
-special versions of @file{libgcc.a} must be built. Write options that
-are mutually incompatible side by side, separated by a slash. Write
-options that may be used together separated by a space. The build
-procedure will build all combinations of compatible options.
-
-For example, if you set @code{MULTILIB_OPTIONS} to @samp{m68000/m68020
-msoft-float}, @file{Makefile} will build special versions of
-@file{libgcc.a} using the following sets of options: @samp{-m68000},
-@samp{-m68020}, @samp{-msoft-float}, @samp{-m68000 -msoft-float}, and
-@samp{-m68020 -msoft-float}.
-
-@findex MULTILIB_DIRNAMES
-@item MULTILIB_DIRNAMES
-If @code{MULTILIB_OPTIONS} is used, this variable specifies the
-directory names that should be used to hold the various libraries.
-Write one element in @code{MULTILIB_DIRNAMES} for each element in
-@code{MULTILIB_OPTIONS}. If @code{MULTILIB_DIRNAMES} is not used, the
-default value will be @code{MULTILIB_OPTIONS}, with all slashes treated
-as spaces.
-
-For example, if @code{MULTILIB_OPTIONS} is set to @samp{m68000/m68020
-msoft-float}, then the default value of @code{MULTILIB_DIRNAMES} is
-@samp{m68000 m68020 msoft-float}. You may specify a different value if
-you desire a different set of directory names.
-
-@findex MULTILIB_MATCHES
-@item MULTILIB_MATCHES
-Sometimes the same option may be written in two different ways. If an
-option is listed in @code{MULTILIB_OPTIONS}, GCC needs to know about
-any synonyms. In that case, set @code{MULTILIB_MATCHES} to a list of
-items of the form @samp{option=option} to describe all relevant
-synonyms. For example, @samp{m68000=mc68000 m68020=mc68020}.
-
-@findex MULTILIB_EXCEPTIONS
-@item MULTILIB_EXCEPTIONS
-Sometimes when there are multiple sets of @code{MULTILIB_OPTIONS} being
-specified, there are combinations that should not be built. In that
-case, set @code{MULTILIB_EXCEPTIONS} to be all of the switch exceptions
-in shell case syntax that should not be built.
-
-For example, in the PowerPC embedded ABI support, it was not desirable
-to build libraries that compiled with the @samp{-mcall-aixdesc} option
-and either of the @samp{-mcall-aixdesc} or @samp{-mlittle} options at
-the same time, and therefore @code{MULTILIB_EXCEPTIONS} is set to
-@code{*mrelocatable/*mcall-aixdesc* *mlittle/*mcall-aixdesc*}.
-
-@findex MULTILIB_EXTRA_OPTS
-@item MULTILIB_EXTRA_OPTS
-Sometimes it is desirable that when building multiple versions of
-@file{libgcc.a} certain options should always be passed on to the
-compiler. In that case, set @code{MULTILIB_EXTRA_OPTS} to be the list
-of options to be used for all builds.
-@end table
-
-@node Host Fragment
-@section The Host Makefile Fragment
-@cindex host makefile fragment
-@cindex @file{x-@var{host}}
-
-The host makefile fragment, @file{x-@var{host}}, defines special host
-dependent variables and targets used in the @file{Makefile}:
-
-@table @code
-@findex CC
-@item CC
-The compiler to use when building the first stage.
-
-@findex CLIB
-@item CLIB
-Additional host libraries to link with.
-
-@findex OLDCC
-@item OLDCC
-The compiler to use when building @file{libgcc1.a} for a native
-compilation.
-
-@findex OLDAR
-@item OLDAR
-The version of @code{ar} to use when building @file{libgcc1.a} for a native
-compilation.
-
-@findex INSTALL
-@item INSTALL
-The install program to use.
-@end table
-
-@node Funding
-@unnumbered Funding Free Software
-
-If you want to have more free software a few years from now, it makes
-sense for you to help encourage people to contribute funds for its
-development. The most effective approach known is to encourage
-commercial redistributors to donate.
-
-Users of free software systems can boost the pace of development by
-encouraging for-a-fee distributors to donate part of their selling price
-to free software developers---the Free Software Foundation, and others.
-
-The way to convince distributors to do this is to demand it and expect
-it from them. So when you compare distributors, judge them partly by
-how much they give to free software development. Show distributors
-they must compete to be the one who gives the most.
-
-To make this approach work, you must insist on numbers that you can
-compare, such as, ``We will donate ten dollars to the Frobnitz project
-for each disk sold.'' Don't be satisfied with a vague promise, such as
-``A portion of the profits are donated,'' since it doesn't give a basis
-for comparison.
-
-Even a precise fraction ``of the profits from this disk'' is not very
-meaningful, since creative accounting and unrelated business decisions
-can greatly alter what fraction of the sales price counts as profit.
-If the price you pay is $50, ten percent of the profit is probably
-less than a dollar; it might be a few cents, or nothing at all.
-
-Some redistributors do development work themselves. This is useful too;
-but to keep everyone honest, you need to inquire how much they do, and
-what kind. Some kinds of development make much more long-term
-difference than others. For example, maintaining a separate version of
-a program contributes very little; maintaining the standard version of a
-program for the whole community contributes much. Easy new ports
-contribute little, since someone else would surely do them; difficult
-ports such as adding a new CPU to the GNU Compiler Collection contribute more;
-major new features or packages contribute the most.
-
-By establishing the idea that supporting further development is ``the
-proper thing to do'' when distributing free software for a fee, we can
-assure a steady flow of resources into making more free software.
-
-@display
-Copyright (C) 1994 Free Software Foundation, Inc.
-Verbatim copying and redistribution of this section is permitted
-without royalty; alteration is not permitted.
-@end display
-
-@node GNU/Linux
-@unnumbered Linux and the GNU Project
-
-Many computer users run a modified version of the GNU system every
-day, without realizing it. Through a peculiar turn of events, the
-version of GNU which is widely used today is more often known as
-``Linux'', and many users are not aware of the extent of its
-connection with the GNU Project.
-
-There really is a Linux; it is a kernel, and these people are using
-it. But you can't use a kernel by itself; a kernel is useful only as
-part of a whole system. The system in which Linux is typically used
-is a modified variant of the GNU system---in other words, a Linux-based
-GNU system.
-
-Many users are not fully aware of the distinction between the kernel,
-which is Linux, and the whole system, which they also call ``Linux''.
-The ambiguous use of the name doesn't promote understanding.
-
-Programmers generally know that Linux is a kernel. But since they
-have generally heard the whole system called ``Linux'' as well, they
-often envisage a history which fits that name. For example, many
-believe that once Linus Torvalds finished writing the kernel, his
-friends looked around for other free software, and for no particular
-reason most everything necessary to make a Unix-like system was
-already available.
-
-What they found was no accident---it was the GNU system. The available
-free software added up to a complete system because the GNU Project
-had been working since 1984 to make one. The GNU Manifesto
-had set forth the goal of developing a free Unix-like system, called
-GNU. By the time Linux was written, the system was almost finished.
-
-Most free software projects have the goal of developing a particular
-program for a particular job. For example, Linus Torvalds set out to
-write a Unix-like kernel (Linux); Donald Knuth set out to write a text
-formatter (TeX); Bob Scheifler set out to develop a window system (X
-Windows). It's natural to measure the contribution of this kind of
-project by specific programs that came from the project.
-
-If we tried to measure the GNU Project's contribution in this way,
-what would we conclude? One CD-ROM vendor found that in their ``Linux
-distribution'', GNU software was the largest single contingent, around
-28% of the total source code, and this included some of the essential
-major components without which there could be no system. Linux itself
-was about 3%. So if you were going to pick a name for the system
-based on who wrote the programs in the system, the most appropriate
-single choice would be ``GNU''.
-
-But we don't think that is the right way to consider the question.
-The GNU Project was not, is not, a project to develop specific
-software packages. It was not a project to develop a C compiler,
-although we did. It was not a project to develop a text editor,
-although we developed one. The GNU Project's aim was to develop
-@emph{a complete free Unix-like system}.
-
-Many people have made major contributions to the free software in the
-system, and they all deserve credit. But the reason it is @emph{a
-system}---and not just a collection of useful programs---is because the
-GNU Project set out to make it one. We wrote the programs that were
-needed to make a @emph{complete} free system. We wrote essential but
-unexciting major components, such as the assembler and linker, because
-you can't have a system without them. A complete system needs more
-than just programming tools, so we wrote other components as well,
-such as the Bourne Again SHell, the PostScript interpreter
-Ghostscript, and the GNU C library.
-
-By the early 90s we had put together the whole system aside from the
-kernel (and we were also working on a kernel, the GNU Hurd, which runs
-on top of Mach). Developing this kernel has been a lot harder than we
-expected, and we are still working on finishing it.
-
-Fortunately, you don't have to wait for it, because Linux is working
-now. When Linus Torvalds wrote Linux, he filled the last major gap.
-People could then put Linux together with the GNU system to make a
-complete free system: a Linux-based GNU system (or GNU/Linux system,
-for short).
-
-Putting them together sounds simple, but it was not a trivial job.
-The GNU C library (called glibc for short) needed substantial changes.
-Integrating a complete system as a distribution that would work ``out
-of the box'' was a big job, too. It required addressing the issue of
-how to install and boot the system---a problem we had not tackled,
-because we hadn't yet reached that point. The people who developed
-the various system distributions made a substantial contribution.
-
-The GNU Project supports GNU/Linux systems as well as @emph{the}
-GNU system---even with funds. We funded the rewriting of the
-Linux-related extensions to the GNU C library, so that now they are
-well integrated, and the newest GNU/Linux systems use the current
-library release with no changes. We also funded an early stage of the
-development of Debian GNU/Linux.
-
-We use Linux-based GNU systems today for most of our work, and we hope
-you use them too. But please don't confuse the public by using the
-name ``Linux'' ambiguously. Linux is the kernel, one of the essential
-major components of the system. The system as a whole is more or less
-the GNU system.
-
-@node Copying
-@unnumbered GNU GENERAL PUBLIC LICENSE
-@center Version 2, June 1991
-
-@display
-Copyright @copyright{} 1989, 1991 Free Software Foundation, Inc.
-59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
-
-Everyone is permitted to copy and distribute verbatim copies
-of this license document, but changing it is not allowed.
-@end display
-
-@unnumberedsec Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software---to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
-@iftex
-@unnumberedsec TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-@end iftex
-@ifinfo
-@center TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-@end ifinfo
-
-@enumerate 0
-@item
-This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The ``Program'', below,
-refers to any such program or work, and a ``work based on the Program''
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term ``modification''.) Each licensee is addressed as ``you''.
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
-@item
-You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
-@item
-You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
-@enumerate a
-@item
-You must cause the modified files to carry prominent notices
-stating that you changed the files and the date of any change.
-
-@item
-You must cause any work that you distribute or publish, that in
-whole or in part contains or is derived from the Program or any
-part thereof, to be licensed as a whole at no charge to all third
-parties under the terms of this License.
-
-@item
-If the modified program normally reads commands interactively
-when run, you must cause it, when started running for such
-interactive use in the most ordinary way, to print or display an
-announcement including an appropriate copyright notice and a
-notice that there is no warranty (or else, saying that you provide
-a warranty) and that users may redistribute the program under
-these conditions, and telling the user how to view a copy of this
-License. (Exception: if the Program itself is interactive but
-does not normally print such an announcement, your work based on
-the Program is not required to print an announcement.)
-@end enumerate
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
-@item
-You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
-@enumerate a
-@item
-Accompany it with the complete corresponding machine-readable
-source code, which must be distributed under the terms of Sections
-1 and 2 above on a medium customarily used for software interchange; or,
-
-@item
-Accompany it with a written offer, valid for at least three
-years, to give any third party, for a charge no more than your
-cost of physically performing source distribution, a complete
-machine-readable copy of the corresponding source code, to be
-distributed under the terms of Sections 1 and 2 above on a medium
-customarily used for software interchange; or,
-
-@item
-Accompany it with the information you received as to the offer
-to distribute corresponding source code. (This alternative is
-allowed only for noncommercial distribution and only if you
-received the program in object code or executable form with such
-an offer, in accord with Subsection b above.)
-@end enumerate
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
-@item
-You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
-@item
-You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
-@item
-Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
-@item
-If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
-@item
-If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
-@item
-The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and ``any
-later version'', you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
-@item
-If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
-@iftex
-@heading NO WARRANTY
-@end iftex
-@ifinfo
-@center NO WARRANTY
-@end ifinfo
-
-@item
-BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM ``AS IS'' WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
-@item
-IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-@end enumerate
-
-@iftex
-@heading END OF TERMS AND CONDITIONS
-@end iftex
-@ifinfo
-@center END OF TERMS AND CONDITIONS
-@end ifinfo
-
-@page
-@unnumberedsec How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the ``copyright'' line and a pointer to where the full notice is found.
-
-@smallexample
-@var{one line to give the program's name and a brief idea of what it does.}
-Copyright (C) @var{yyyy} @var{name of author}
-
-This program 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 of the License, or
-(at your option) any later version.
-
-This program 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 program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-@end smallexample
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
-@smallexample
-Gnomovision version 69, Copyright (C) @var{yyyy} @var{name of author}
-Gnomovision comes with ABSOLUTELY NO WARRANTY; for details
-type `show w'.
-This is free software, and you are welcome to redistribute it
-under certain conditions; type `show c' for details.
-@end smallexample
-
-The hypothetical commands @samp{show w} and @samp{show c} should show
-the appropriate parts of the General Public License. Of course, the
-commands you use may be called something other than @samp{show w} and
-@samp{show c}; they could even be mouse-clicks or menu items---whatever
-suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a ``copyright disclaimer'' for the program, if
-necessary. Here is a sample; alter the names:
-
-@smallexample
-Yoyodyne, Inc., hereby disclaims all copyright interest in the program
-`Gnomovision' (which makes passes at compilers) written by James Hacker.
-
-@var{signature of Ty Coon}, 1 April 1989
-Ty Coon, President of Vice
-@end smallexample
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Library General
-Public License instead of this License.
-
-@node Contributors
-@unnumbered Contributors to GCC
-@cindex contributors
-
-In addition to Richard Stallman, several people have written parts
-of GCC.
-
-@itemize @bullet
-@item
-The idea of using RTL and some of the optimization ideas came from the
-program PO written at the University of Arizona by Jack Davidson and
-Christopher Fraser. See ``Register Allocation and Exhaustive Peephole
-Optimization'', Software Practice and Experience 14 (9), Sept. 1984,
-857-866.
-
-@item
-Paul Rubin wrote most of the preprocessor.
-
-@item
-Leonard Tower wrote parts of the parser, RTL generator, and RTL
-definitions, and of the Vax machine description.
-
-@item
-Ted Lemon wrote parts of the RTL reader and printer.
-
-@item
-Jim Wilson implemented loop strength reduction and some other
-loop optimizations.
-
-@item
-Nobuyuki Hikichi of Software Research Associates, Tokyo, contributed
-the support for the Sony NEWS machine.
-
-@item
-Charles LaBrec contributed the support for the Integrated Solutions
-68020 system.
-
-@item
-Michael Tiemann of Cygnus Support wrote the front end for C++, as well
-as the support for inline functions and instruction scheduling. Also
-the descriptions of the National Semiconductor 32000 series cpu, the
-SPARC cpu and part of the Motorola 88000 cpu.
-
-@item
-Gerald Baumgartner added the signature extension to the C++ front-end.
-
-@item
-Jan Stein of the Chalmers Computer Society provided support for
-Genix, as well as part of the 32000 machine description.
-
-@item
-Randy Smith finished the Sun FPA support.
-
-@item
-Robert Brown implemented the support for Encore 32000 systems.
-
-@item
-David Kashtan of SRI adapted GCC to VMS.
-
-@item
-Alex Crain provided changes for the 3b1.
-
-@item
-Greg Satz and Chris Hanson assisted in making GCC work on HP-UX for
-the 9000 series 300.
-
-@item
-William Schelter did most of the work on the Intel 80386 support.
-
-@item
-Christopher Smith did the port for Convex machines.
-
-@item
-Paul Petersen wrote the machine description for the Alliant FX/8.
-
-@item
-Dario Dariol contributed the four varieties of sample programs
-that print a copy of their source.
-
-@item
-Alain Lichnewsky ported GCC to the Mips cpu.
-
-@item
-Devon Bowen, Dale Wiles and Kevin Zachmann ported GCC to the Tahoe.
-
-@item
-Jonathan Stone wrote the machine description for the Pyramid computer.
-
-@item
-Gary Miller ported GCC to Charles River Data Systems machines.
-
-@item
-Richard Kenner of the New York University Ultracomputer Research
-Laboratory wrote the machine descriptions for the AMD 29000, the DEC
-Alpha, the IBM RT PC, and the IBM RS/6000 as well as the support for
-instruction attributes. He also made changes to better support RISC
-processors including changes to common subexpression elimination,
-strength reduction, function calling sequence handling, and condition
-code support, in addition to generalizing the code for frame pointer
-elimination.
-
-@item
-Richard Kenner and Michael Tiemann jointly developed reorg.c, the delay
-slot scheduler.
-
-@item
-Mike Meissner and Tom Wood of Data General finished the port to the
-Motorola 88000.
-
-@item
-Masanobu Yuhara of Fujitsu Laboratories implemented the machine
-description for the Tron architecture (specifically, the Gmicro).
-
-@item
-NeXT, Inc.@: donated the front end that supports the Objective C
-language.
-@c We need to be careful to make it clear that "Objective C"
-@c is the name of a language, not that of a program or product.
-
-@item
-James van Artsdalen wrote the code that makes efficient use of
-the Intel 80387 register stack.
-
-@item
-Mike Meissner at the Open Software Foundation finished the port to the
-MIPS cpu, including adding ECOFF debug support, and worked on the
-Intel port for the Intel 80386 cpu. Later at Cygnus Support, he worked
-on the rs6000 and PowerPC ports.
-
-@item
-Ron Guilmette implemented the @code{protoize} and @code{unprotoize}
-tools, the support for Dwarf symbolic debugging information, and much of
-the support for System V Release 4. He has also worked heavily on the
-Intel 386 and 860 support.
-
-@item
-Torbjorn Granlund implemented multiply- and divide-by-constant
-optimization, improved long long support, and improved leaf function
-register allocation.
-
-@item
-Mike Stump implemented the support for Elxsi 64 bit CPU.
-
-@item
-John Wehle added the machine description for the Western Electric 32000
-processor used in several 3b series machines (no relation to the
-National Semiconductor 32000 processor).
-
-@ignore @c These features aren't advertised yet, since they don't fully work.
-@item
-Analog Devices helped implement the support for complex data types
-and iterators.
-@end ignore
-
-@item
-Holger Teutsch provided the support for the Clipper cpu.
-
-@item
-Kresten Krab Thorup wrote the run time support for the Objective C
-language.
-
-@item
-Stephen Moshier contributed the floating point emulator that assists in
-cross-compilation and permits support for floating point numbers wider
-than 64 bits.
-
-@item
-David Edelsohn contributed the changes to RS/6000 port to make it
-support the PowerPC and POWER2 architectures.
-
-@item
-Steve Chamberlain wrote the support for the Hitachi SH processor.
-
-@item
-Peter Schauer wrote the code to allow debugging to work on the Alpha.
-
-@item
-Oliver M. Kellogg of Deutsche Aerospace contributed the port to the
-MIL-STD-1750A.
-
-@item
-Michael K. Gschwind contributed the port to the PDP-11.
-
-@item
-David Reese of Sun Microsystems contributed to the Solaris on PowerPC
-port.
-@end itemize
-
-@node Index
-@unnumbered Index
-@end ifset
-
-@ifclear INTERNALS
-@node Index
-@unnumbered Index
-@end ifclear
-
-@printindex cp
-
-@summarycontents
-@contents
-@bye
diff --git a/contrib/gcc/gcov.texi b/contrib/gcc/gcov.texi
deleted file mode 100644
index 9c6d77da7d4c..000000000000
--- a/contrib/gcc/gcov.texi
+++ /dev/null
@@ -1,344 +0,0 @@
-@c Copyright (C) 1996, 1997 Free Software Foundation, Inc.
-@c This is part of the GCC manual.
-@c For copying conditions, see the file gcc.texi.
-
-@node Gcov
-@chapter @code{gcov}: a Test Coverage Program
-
-@code{gcov} is a tool you can use in conjunction with @sc{gnu} CC to
-test code coverage in your programs.
-
-This chapter describes version 1.5 of @code{gcov}.
-
-@menu
-* Gcov Intro:: Introduction to gcov.
-* Invoking Gcov:: How to use gcov.
-* Gcov and Optimization:: Using gcov with GCC optimization.
-* Gcov Data Files:: The files used by gcov.
-@end menu
-
-@node Gcov Intro
-@section Introduction to @code{gcov}
-
-@code{gcov} is a test coverage program. Use it in concert with @sc{gnu}
-CC to analyze your programs to help create more efficient, faster
-running code. You can use @code{gcov} as a profiling tool to help
-discover where your optimization efforts will best affect your code. You
-can also use @code{gcov} along with the other profiling tool,
-@code{gprof}, to assess which parts of your code use the greatest amount
-of computing time.
-
-Profiling tools help you analyze your code's performance. Using a
-profiler such as @code{gcov} or @code{gprof}, you can find out some
-basic performance statistics, such as:
-
-@itemize @bullet
-@item
-how often each line of code executes
-
-@item
-what lines of code are actually executed
-
-@item
-how much computing time each section of code uses
-@end itemize
-
-Once you know these things about how your code works when compiled, you
-can look at each module to see which modules should be optimized.
-@code{gcov} helps you determine where to work on optimization.
-
-Software developers also use coverage testing in concert with
-testsuites, to make sure software is actually good enough for a release.
-Testsuites can verify that a program works as expected; a coverage
-program tests to see how much of the program is exercised by the
-testsuite. Developers can then determine what kinds of test cases need
-to be added to the testsuites to create both better testing and a better
-final product.
-
-You should compile your code without optimization if you plan to use
-@code{gcov} because the optimization, by combining some lines of code
-into one function, may not give you as much information as you need to
-look for `hot spots' where the code is using a great deal of computer
-time. Likewise, because @code{gcov} accumulates statistics by line (at
-the lowest resolution), it works best with a programming style that
-places only one statement on each line. If you use complicated macros
-that expand to loops or to other control structures, the statistics are
-less helpful---they only report on the line where the macro call
-appears. If your complex macros behave like functions, you can replace
-them with inline functions to solve this problem.
-
-@code{gcov} creates a logfile called @file{@var{sourcefile}.gcov} which
-indicates how many times each line of a source file @file{@var{sourcefile}.c}
-has executed. You can use these logfiles along with @code{gprof} to aid
-in fine-tuning the performance of your programs. @code{gprof} gives
-timing information you can use along with the information you get from
-@code{gcov}.
-
-@code{gcov} works only on code compiled with @sc{gnu} CC. It is not
-compatible with any other profiling or test coverage mechanism.
-
-@node Invoking Gcov
-@section Invoking gcov
-
-@smallexample
-gcov [-b] [-v] [-n] [-l] [-f] [-o directory] @var{sourcefile}
-@end smallexample
-
-@table @code
-@item -b
-Write branch frequencies to the output file, and write branch summary
-info to the standard output. This option allows you to see how often
-each branch in your program was taken.
-
-@item -v
-Display the @code{gcov} version number (on the standard error stream).
-
-@item -n
-Do not create the @code{gcov} output file.
-
-@item -l
-Create long file names for included source files. For example, if the
-header file @samp{x.h} contains code, and was included in the file
-@samp{a.c}, then running @code{gcov} on the file @samp{a.c} will produce
-an output file called @samp{a.c.x.h.gcov} instead of @samp{x.h.gcov}.
-This can be useful if @samp{x.h} is included in multiple source files.
-
-@item -f
-Output summaries for each function in addition to the file level summary.
-
-@item -o
-The directory where the object files live. Gcov will search for @code{.bb},
-@code{.bbg}, and @code{.da} files in this directory.
-@end table
-
-@need 3000
-When using @code{gcov}, you must first compile your program with two
-special @sc{gnu} CC options: @samp{-fprofile-arcs -ftest-coverage}.
-This tells the compiler to generate additional information needed by
-gcov (basically a flow graph of the program) and also includes
-additional code in the object files for generating the extra profiling
-information needed by gcov. These additional files are placed in the
-directory where the source code is located.
-
-Running the program will cause profile output to be generated. For each
-source file compiled with -fprofile-arcs, an accompanying @code{.da}
-file will be placed in the source directory.
-
-Running @code{gcov} with your program's source file names as arguments
-will now produce a listing of the code along with frequency of execution
-for each line. For example, if your program is called @samp{tmp.c}, this
-is what you see when you use the basic @code{gcov} facility:
-
-@smallexample
-$ gcc -fprofile-arcs -ftest-coverage tmp.c
-$ a.out
-$ gcov tmp.c
- 87.50% of 8 source lines executed in file tmp.c
-Creating tmp.c.gcov.
-@end smallexample
-
-The file @file{tmp.c.gcov} contains output from @code{gcov}.
-Here is a sample:
-
-@smallexample
- main()
- @{
- 1 int i, total;
-
- 1 total = 0;
-
- 11 for (i = 0; i < 10; i++)
- 10 total += i;
-
- 1 if (total != 45)
- ###### printf ("Failure\n");
- else
- 1 printf ("Success\n");
- 1 @}
-@end smallexample
-
-@need 450
-When you use the @samp{-b} option, your output looks like this:
-
-@smallexample
-$ gcov -b tmp.c
- 87.50% of 8 source lines executed in file tmp.c
- 80.00% of 5 branches executed in file tmp.c
- 80.00% of 5 branches taken at least once in file tmp.c
- 50.00% of 2 calls executed in file tmp.c
-Creating tmp.c.gcov.
-@end smallexample
-
-Here is a sample of a resulting @file{tmp.c.gcov} file:
-
-@smallexample
- main()
- @{
- 1 int i, total;
-
- 1 total = 0;
-
- 11 for (i = 0; i < 10; i++)
-branch 0 taken = 91%
-branch 1 taken = 100%
-branch 2 taken = 100%
- 10 total += i;
-
- 1 if (total != 45)
-branch 0 taken = 100%
- ###### printf ("Failure\n");
-call 0 never executed
-branch 1 never executed
- else
- 1 printf ("Success\n");
-call 0 returns = 100%
- 1 @}
-@end smallexample
-
-For each basic block, a line is printed after the last line of the basic
-block describing the branch or call that ends the basic block. There can
-be multiple branches and calls listed for a single source line if there
-are multiple basic blocks that end on that line. In this case, the
-branches and calls are each given a number. There is no simple way to map
-these branches and calls back to source constructs. In general, though,
-the lowest numbered branch or call will correspond to the leftmost construct
-on the source line.
-
-For a branch, if it was executed at least once, then a percentage
-indicating the number of times the branch was taken divided by the
-number of times the branch was executed will be printed. Otherwise, the
-message ``never executed'' is printed.
-
-For a call, if it was executed at least once, then a percentage
-indicating the number of times the call returned divided by the number
-of times the call was executed will be printed. This will usually be
-100%, but may be less for functions call @code{exit} or @code{longjmp},
-and thus may not return everytime they are called.
-
-The execution counts are cumulative. If the example program were
-executed again without removing the @code{.da} file, the count for the
-number of times each line in the source was executed would be added to
-the results of the previous run(s). This is potentially useful in
-several ways. For example, it could be used to accumulate data over a
-number of program runs as part of a test verification suite, or to
-provide more accurate long-term information over a large number of
-program runs.
-
-The data in the @code{.da} files is saved immediately before the program
-exits. For each source file compiled with -fprofile-arcs, the profiling
-code first attempts to read in an existing @code{.da} file; if the file
-doesn't match the executable (differing number of basic block counts) it
-will ignore the contents of the file. It then adds in the new execution
-counts and finally writes the data to the file.
-
-@node Gcov and Optimization
-@section Using @code{gcov} with GCC Optimization
-
-If you plan to use @code{gcov} to help optimize your code, you must
-first compile your program with two special @sc{gnu} CC options:
-@samp{-fprofile-arcs -ftest-coverage}. Aside from that, you can use any
-other @sc{gnu} CC options; but if you want to prove that every single line
-in your program was executed, you should not compile with optimization
-at the same time. On some machines the optimizer can eliminate some
-simple code lines by combining them with other lines. For example, code
-like this:
-
-@smallexample
-if (a != b)
- c = 1;
-else
- c = 0;
-@end smallexample
-
-@noindent
-can be compiled into one instruction on some machines. In this case,
-there is no way for @code{gcov} to calculate separate execution counts
-for each line because there isn't separate code for each line. Hence
-the @code{gcov} output looks like this if you compiled the program with
-optimization:
-
-@smallexample
- 100 if (a != b)
- 100 c = 1;
- 100 else
- 100 c = 0;
-@end smallexample
-
-The output shows that this block of code, combined by optimization,
-executed 100 times. In one sense this result is correct, because there
-was only one instruction representing all four of these lines. However,
-the output does not indicate how many times the result was 0 and how
-many times the result was 1.
-
-@node Gcov Data Files
-@section Brief description of @code{gcov} data files
-
-@code{gcov} uses three files for doing profiling. The names of these
-files are derived from the original @emph{source} file by substituting
-the file suffix with either @code{.bb}, @code{.bbg}, or @code{.da}. All
-of these files are placed in the same directory as the source file, and
-contain data stored in a platform-independent method.
-
-The @code{.bb} and @code{.bbg} files are generated when the source file
-is compiled with the @sc{gnu} CC @samp{-ftest-coverage} option. The
-@code{.bb} file contains a list of source files (including headers),
-functions within those files, and line numbers corresponding to each
-basic block in the source file.
-
-The @code{.bb} file format consists of several lists of 4-byte integers
-which correspond to the line numbers of each basic block in the
-file. Each list is terminated by a line number of 0. A line number of -1
-is used to designate that the source file name (padded to a 4-byte
-boundary and followed by another -1) follows. In addition, a line number
-of -2 is used to designate that the name of a function (also padded to a
-4-byte boundary and followed by a -2) follows.
-
-The @code{.bbg} file is used to reconstruct the program flow graph for
-the source file. It contains a list of the program flow arcs (possible
-branches taken from one basic block to another) for each function which,
-in combination with the @code{.bb} file, enables gcov to reconstruct the
-program flow.
-
-In the @code{.bbg} file, the format is:
-@smallexample
- number of basic blocks for function #0 (4-byte number)
- total number of arcs for function #0 (4-byte number)
- count of arcs in basic block #0 (4-byte number)
- destination basic block of arc #0 (4-byte number)
- flag bits (4-byte number)
- destination basic block of arc #1 (4-byte number)
- flag bits (4-byte number)
- ...
- destination basic block of arc #N (4-byte number)
- flag bits (4-byte number)
- count of arcs in basic block #1 (4-byte number)
- destination basic block of arc #0 (4-byte number)
- flag bits (4-byte number)
- ...
-@end smallexample
-
-A -1 (stored as a 4-byte number) is used to separate each function's
-list of basic blocks, and to verify that the file has been read
-correctly.
-
-The @code{.da} file is generated when a program containing object files
-built with the @sc{gnu} CC @samp{-fprofile-arcs} option is executed. A
-separate @code{.da} file is created for each source file compiled with
-this option, and the name of the @code{.da} file is stored as an
-absolute pathname in the resulting object file. This path name is
-derived from the source file name by substituting a @code{.da} suffix.
-
-The format of the @code{.da} file is fairly simple. The first 8-byte
-number is the number of counts in the file, followed by the counts
-(stored as 8-byte numbers). Each count corresponds to the number of
-times each arc in the program is executed. The counts are cumulative;
-each time the program is executed, it attemps to combine the existing
-@code{.da} files with the new counts for this invocation of the
-program. It ignores the contents of any @code{.da} files whose number of
-arcs doesn't correspond to the current program, and merely overwrites
-them instead.
-
-All three of these files use the functions in @code{gcov-io.h} to store
-integers; the functions in this header provide a machine-independent
-mechanism for storing and retrieving data from a stream.
-
diff --git a/contrib/gcc/getopt.c b/contrib/gcc/getopt.c
deleted file mode 100644
index c41531e667d8..000000000000
--- a/contrib/gcc/getopt.c
+++ /dev/null
@@ -1,1056 +0,0 @@
-/* Getopt for GNU.
- NOTE: getopt is now part of the C library, so if you don't know what
- "Keep this file name-space clean" means, talk to drepper@gnu.org
- before changing it!
-
- Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98
- Free Software Foundation, Inc.
-
- NOTE: The canonical source of this file is maintained with the GNU C Library.
- Bugs can be reported to bug-glibc@gnu.org.
-
- This program 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 program 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 program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
- USA. */
-
-/* This tells Alpha OSF/1 not to define a getopt prototype in <stdio.h>.
- Ditto for AIX 3.2 and <stdlib.h>. */
-#ifndef _NO_PROTO
-# define _NO_PROTO
-#endif
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#if !defined __STDC__ || !__STDC__
-/* This is a separate conditional since some stdc systems
- reject `defined (const)'. */
-# ifndef const
-# define const
-# endif
-#endif
-
-#include <stdio.h>
-
-/* Comment out all this code if we are using the GNU C Library, and are not
- actually compiling the library itself. This code is part of the GNU C
- Library, but also included in many other GNU distributions. Compiling
- and linking in this code is a waste when using the GNU C library
- (especially if it is a shared library). Rather than having every GNU
- program understand `configure --with-gnu-libc' and omit the object files,
- it is simpler to just do this in the source for each such file. */
-
-#define GETOPT_INTERFACE_VERSION 2
-#if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2
-# include <gnu-versions.h>
-# if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION
-# define ELIDE_CODE
-# endif
-#endif
-
-#ifndef ELIDE_CODE
-
-
-/* This needs to come after some library #include
- to get __GNU_LIBRARY__ defined. */
-#ifdef __GNU_LIBRARY__
-/* Don't include stdlib.h for non-GNU C libraries because some of them
- contain conflicting prototypes for getopt. */
-# include <stdlib.h>
-# include <unistd.h>
-#endif /* GNU C library. */
-
-#ifdef VMS
-# include <unixlib.h>
-# if HAVE_STRING_H - 0
-# include <string.h>
-# endif
-#endif
-
-#ifndef _
-/* This is for other GNU distributions with internationalized messages.
- When compiling libc, the _ macro is predefined. */
-# ifdef HAVE_LIBINTL_H
-# include <libintl.h>
-# define _(msgid) gettext (msgid)
-# else
-# define _(msgid) (msgid)
-# endif
-#endif
-
-/* This version of `getopt' appears to the caller like standard Unix `getopt'
- but it behaves differently for the user, since it allows the user
- to intersperse the options with the other arguments.
-
- As `getopt' works, it permutes the elements of ARGV so that,
- when it is done, all the options precede everything else. Thus
- all application programs are extended to handle flexible argument order.
-
- Setting the environment variable POSIXLY_CORRECT disables permutation.
- Then the behavior is completely standard.
-
- GNU application programs can use a third alternative mode in which
- they can distinguish the relative order of options and other arguments. */
-
-#include "getopt.h"
-
-/* For communication from `getopt' to the caller.
- When `getopt' finds an option that takes an argument,
- the argument value is returned here.
- Also, when `ordering' is RETURN_IN_ORDER,
- each non-option ARGV-element is returned here. */
-
-char *optarg = NULL;
-
-/* Index in ARGV of the next element to be scanned.
- This is used for communication to and from the caller
- and for communication between successive calls to `getopt'.
-
- On entry to `getopt', zero means this is the first call; initialize.
-
- When `getopt' returns -1, this is the index of the first of the
- non-option elements that the caller should itself scan.
-
- Otherwise, `optind' communicates from one call to the next
- how much of ARGV has been scanned so far. */
-
-/* 1003.2 says this must be 1 before any call. */
-int optind = 1;
-
-/* Formerly, initialization of getopt depended on optind==0, which
- causes problems with re-calling getopt as programs generally don't
- know that. */
-
-int __getopt_initialized = 0;
-
-/* The next char to be scanned in the option-element
- in which the last option character we returned was found.
- This allows us to pick up the scan where we left off.
-
- If this is zero, or a null string, it means resume the scan
- by advancing to the next ARGV-element. */
-
-static char *nextchar;
-
-/* Callers store zero here to inhibit the error message
- for unrecognized options. */
-
-int opterr = 1;
-
-/* Set to an option character which was unrecognized.
- This must be initialized on some systems to avoid linking in the
- system's own getopt implementation. */
-
-int optopt = '?';
-
-/* Describe how to deal with options that follow non-option ARGV-elements.
-
- If the caller did not specify anything,
- the default is REQUIRE_ORDER if the environment variable
- POSIXLY_CORRECT is defined, PERMUTE otherwise.
-
- REQUIRE_ORDER means don't recognize them as options;
- stop option processing when the first non-option is seen.
- This is what Unix does.
- This mode of operation is selected by either setting the environment
- variable POSIXLY_CORRECT, or using `+' as the first character
- of the list of option characters.
-
- PERMUTE is the default. We permute the contents of ARGV as we scan,
- so that eventually all the non-options are at the end. This allows options
- to be given in any order, even with programs that were not written to
- expect this.
-
- RETURN_IN_ORDER is an option available to programs that were written
- to expect options and other ARGV-elements in any order and that care about
- the ordering of the two. We describe each non-option ARGV-element
- as if it were the argument of an option with character code 1.
- Using `-' as the first character of the list of option characters
- selects this mode of operation.
-
- The special argument `--' forces an end of option-scanning regardless
- of the value of `ordering'. In the case of RETURN_IN_ORDER, only
- `--' can cause `getopt' to return -1 with `optind' != ARGC. */
-
-static enum
-{
- REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER
-} ordering;
-
-/* Value of POSIXLY_CORRECT environment variable. */
-static char *posixly_correct;
-
-#ifdef __GNU_LIBRARY__
-/* We want to avoid inclusion of string.h with non-GNU libraries
- because there are many ways it can cause trouble.
- On some systems, it contains special magic macros that don't work
- in GCC. */
-# include <string.h>
-# define my_index strchr
-#else
-
-# if HAVE_STRING_H
-# include <string.h>
-# else
-# if HAVE_STRINGS_H
-# include <strings.h>
-# endif
-# endif
-
-/* Avoid depending on library functions or files
- whose names are inconsistent. */
-
-#ifndef getenv
-extern char *getenv ();
-#endif
-
-static char *
-my_index (str, chr)
- const char *str;
- int chr;
-{
- while (*str)
- {
- if (*str == chr)
- return (char *) str;
- str++;
- }
- return 0;
-}
-
-/* If using GCC, we can safely declare strlen this way.
- If not using GCC, it is ok not to declare it. */
-#ifdef __GNUC__
-/* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h.
- That was relevant to code that was here before. */
-# if (!defined __STDC__ || !__STDC__) && !defined strlen
-/* gcc with -traditional declares the built-in strlen to return int,
- and has done so at least since version 2.4.5. -- rms. */
-extern int strlen (const char *);
-# endif /* not __STDC__ */
-#endif /* __GNUC__ */
-
-#endif /* not __GNU_LIBRARY__ */
-
-/* Handle permutation of arguments. */
-
-/* Describe the part of ARGV that contains non-options that have
- been skipped. `first_nonopt' is the index in ARGV of the first of them;
- `last_nonopt' is the index after the last of them. */
-
-static int first_nonopt;
-static int last_nonopt;
-
-#ifdef _LIBC
-/* Bash 2.0 gives us an environment variable containing flags
- indicating ARGV elements that should not be considered arguments. */
-
-/* Defined in getopt_init.c */
-extern char *__getopt_nonoption_flags;
-
-static int nonoption_flags_max_len;
-static int nonoption_flags_len;
-
-static int original_argc;
-static char *const *original_argv;
-
-/* Make sure the environment variable bash 2.0 puts in the environment
- is valid for the getopt call we must make sure that the ARGV passed
- to getopt is that one passed to the process. */
-static void
-__attribute__ ((unused))
-store_args_and_env (int argc, char *const *argv)
-{
- /* XXX This is no good solution. We should rather copy the args so
- that we can compare them later. But we must not use malloc(3). */
- original_argc = argc;
- original_argv = argv;
-}
-# ifdef text_set_element
-text_set_element (__libc_subinit, store_args_and_env);
-# endif /* text_set_element */
-
-# define SWAP_FLAGS(ch1, ch2) \
- if (nonoption_flags_len > 0) \
- { \
- char __tmp = __getopt_nonoption_flags[ch1]; \
- __getopt_nonoption_flags[ch1] = __getopt_nonoption_flags[ch2]; \
- __getopt_nonoption_flags[ch2] = __tmp; \
- }
-#else /* !_LIBC */
-# define SWAP_FLAGS(ch1, ch2)
-#endif /* _LIBC */
-
-/* Exchange two adjacent subsequences of ARGV.
- One subsequence is elements [first_nonopt,last_nonopt)
- which contains all the non-options that have been skipped so far.
- The other is elements [last_nonopt,optind), which contains all
- the options processed since those non-options were skipped.
-
- `first_nonopt' and `last_nonopt' are relocated so that they describe
- the new indices of the non-options in ARGV after they are moved. */
-
-#if defined __STDC__ && __STDC__
-static void exchange (char **);
-#endif
-
-static void
-exchange (argv)
- char **argv;
-{
- int bottom = first_nonopt;
- int middle = last_nonopt;
- int top = optind;
- char *tem;
-
- /* Exchange the shorter segment with the far end of the longer segment.
- That puts the shorter segment into the right place.
- It leaves the longer segment in the right place overall,
- but it consists of two parts that need to be swapped next. */
-
-#ifdef _LIBC
- /* First make sure the handling of the `__getopt_nonoption_flags'
- string can work normally. Our top argument must be in the range
- of the string. */
- if (nonoption_flags_len > 0 && top >= nonoption_flags_max_len)
- {
- /* We must extend the array. The user plays games with us and
- presents new arguments. */
- char *new_str = malloc (top + 1);
- if (new_str == NULL)
- nonoption_flags_len = nonoption_flags_max_len = 0;
- else
- {
- memset (__mempcpy (new_str, __getopt_nonoption_flags,
- nonoption_flags_max_len),
- '\0', top + 1 - nonoption_flags_max_len);
- nonoption_flags_max_len = top + 1;
- __getopt_nonoption_flags = new_str;
- }
- }
-#endif
-
- while (top > middle && middle > bottom)
- {
- if (top - middle > middle - bottom)
- {
- /* Bottom segment is the short one. */
- int len = middle - bottom;
- register int i;
-
- /* Swap it with the top part of the top segment. */
- for (i = 0; i < len; i++)
- {
- tem = argv[bottom + i];
- argv[bottom + i] = argv[top - (middle - bottom) + i];
- argv[top - (middle - bottom) + i] = tem;
- SWAP_FLAGS (bottom + i, top - (middle - bottom) + i);
- }
- /* Exclude the moved bottom segment from further swapping. */
- top -= len;
- }
- else
- {
- /* Top segment is the short one. */
- int len = top - middle;
- register int i;
-
- /* Swap it with the bottom part of the bottom segment. */
- for (i = 0; i < len; i++)
- {
- tem = argv[bottom + i];
- argv[bottom + i] = argv[middle + i];
- argv[middle + i] = tem;
- SWAP_FLAGS (bottom + i, middle + i);
- }
- /* Exclude the moved top segment from further swapping. */
- bottom += len;
- }
- }
-
- /* Update records for the slots the non-options now occupy. */
-
- first_nonopt += (optind - last_nonopt);
- last_nonopt = optind;
-}
-
-/* Initialize the internal data when the first call is made. */
-
-#if defined __STDC__ && __STDC__
-static const char *_getopt_initialize (int, char *const *, const char *);
-#endif
-static const char *
-_getopt_initialize (argc, argv, optstring)
- int argc;
- char *const *argv;
- const char *optstring;
-{
- /* Start processing options with ARGV-element 1 (since ARGV-element 0
- is the program name); the sequence of previously skipped
- non-option ARGV-elements is empty. */
-
- first_nonopt = last_nonopt = optind;
-
- nextchar = NULL;
-
- posixly_correct = getenv ("POSIXLY_CORRECT");
-
- /* Determine how to handle the ordering of options and nonoptions. */
-
- if (optstring[0] == '-')
- {
- ordering = RETURN_IN_ORDER;
- ++optstring;
- }
- else if (optstring[0] == '+')
- {
- ordering = REQUIRE_ORDER;
- ++optstring;
- }
- else if (posixly_correct != NULL)
- ordering = REQUIRE_ORDER;
- else
- ordering = PERMUTE;
-
-#ifdef _LIBC
- if (posixly_correct == NULL
- && argc == original_argc && argv == original_argv)
- {
- if (nonoption_flags_max_len == 0)
- {
- if (__getopt_nonoption_flags == NULL
- || __getopt_nonoption_flags[0] == '\0')
- nonoption_flags_max_len = -1;
- else
- {
- const char *orig_str = __getopt_nonoption_flags;
- int len = nonoption_flags_max_len = strlen (orig_str);
- if (nonoption_flags_max_len < argc)
- nonoption_flags_max_len = argc;
- __getopt_nonoption_flags =
- (char *) malloc (nonoption_flags_max_len);
- if (__getopt_nonoption_flags == NULL)
- nonoption_flags_max_len = -1;
- else
- memset (__mempcpy (__getopt_nonoption_flags, orig_str, len),
- '\0', nonoption_flags_max_len - len);
- }
- }
- nonoption_flags_len = nonoption_flags_max_len;
- }
- else
- nonoption_flags_len = 0;
-#endif
-
- return optstring;
-}
-
-/* Scan elements of ARGV (whose length is ARGC) for option characters
- given in OPTSTRING.
-
- If an element of ARGV starts with '-', and is not exactly "-" or "--",
- then it is an option element. The characters of this element
- (aside from the initial '-') are option characters. If `getopt'
- is called repeatedly, it returns successively each of the option characters
- from each of the option elements.
-
- If `getopt' finds another option character, it returns that character,
- updating `optind' and `nextchar' so that the next call to `getopt' can
- resume the scan with the following option character or ARGV-element.
-
- If there are no more option characters, `getopt' returns -1.
- Then `optind' is the index in ARGV of the first ARGV-element
- that is not an option. (The ARGV-elements have been permuted
- so that those that are not options now come last.)
-
- OPTSTRING is a string containing the legitimate option characters.
- If an option character is seen that is not listed in OPTSTRING,
- return '?' after printing an error message. If you set `opterr' to
- zero, the error message is suppressed but we still return '?'.
-
- If a char in OPTSTRING is followed by a colon, that means it wants an arg,
- so the following text in the same ARGV-element, or the text of the following
- ARGV-element, is returned in `optarg'. Two colons mean an option that
- wants an optional arg; if there is text in the current ARGV-element,
- it is returned in `optarg', otherwise `optarg' is set to zero.
-
- If OPTSTRING starts with `-' or `+', it requests different methods of
- handling the non-option ARGV-elements.
- See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above.
-
- Long-named options begin with `--' instead of `-'.
- Their names may be abbreviated as long as the abbreviation is unique
- or is an exact match for some defined option. If they have an
- argument, it follows the option name in the same ARGV-element, separated
- from the option name by a `=', or else the in next ARGV-element.
- When `getopt' finds a long-named option, it returns 0 if that option's
- `flag' field is nonzero, the value of the option's `val' field
- if the `flag' field is zero.
-
- The elements of ARGV aren't really const, because we permute them.
- But we pretend they're const in the prototype to be compatible
- with other systems.
-
- LONGOPTS is a vector of `struct option' terminated by an
- element containing a name which is zero.
-
- LONGIND returns the index in LONGOPT of the long-named option found.
- It is only valid when a long-named option has been found by the most
- recent call.
-
- If LONG_ONLY is nonzero, '-' as well as '--' can introduce
- long-named options. */
-
-int
-_getopt_internal (argc, argv, optstring, longopts, longind, long_only)
- int argc;
- char *const *argv;
- const char *optstring;
- const struct option *longopts;
- int *longind;
- int long_only;
-{
- optarg = NULL;
-
- if (optind == 0 || !__getopt_initialized)
- {
- if (optind == 0)
- optind = 1; /* Don't scan ARGV[0], the program name. */
- optstring = _getopt_initialize (argc, argv, optstring);
- __getopt_initialized = 1;
- }
-
- /* Test whether ARGV[optind] points to a non-option argument.
- Either it does not have option syntax, or there is an environment flag
- from the shell indicating it is not an option. The later information
- is only used when the used in the GNU libc. */
-#ifdef _LIBC
-# define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \
- || (optind < nonoption_flags_len \
- && __getopt_nonoption_flags[optind] == '1'))
-#else
-# define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0')
-#endif
-
- if (nextchar == NULL || *nextchar == '\0')
- {
- /* Advance to the next ARGV-element. */
-
- /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been
- moved back by the user (who may also have changed the arguments). */
- if (last_nonopt > optind)
- last_nonopt = optind;
- if (first_nonopt > optind)
- first_nonopt = optind;
-
- if (ordering == PERMUTE)
- {
- /* If we have just processed some options following some non-options,
- exchange them so that the options come first. */
-
- if (first_nonopt != last_nonopt && last_nonopt != optind)
- exchange ((char **) argv);
- else if (last_nonopt != optind)
- first_nonopt = optind;
-
- /* Skip any additional non-options
- and extend the range of non-options previously skipped. */
-
- while (optind < argc && NONOPTION_P)
- optind++;
- last_nonopt = optind;
- }
-
- /* The special ARGV-element `--' means premature end of options.
- Skip it like a null option,
- then exchange with previous non-options as if it were an option,
- then skip everything else like a non-option. */
-
- if (optind != argc && !strcmp (argv[optind], "--"))
- {
- optind++;
-
- if (first_nonopt != last_nonopt && last_nonopt != optind)
- exchange ((char **) argv);
- else if (first_nonopt == last_nonopt)
- first_nonopt = optind;
- last_nonopt = argc;
-
- optind = argc;
- }
-
- /* If we have done all the ARGV-elements, stop the scan
- and back over any non-options that we skipped and permuted. */
-
- if (optind == argc)
- {
- /* Set the next-arg-index to point at the non-options
- that we previously skipped, so the caller will digest them. */
- if (first_nonopt != last_nonopt)
- optind = first_nonopt;
- return -1;
- }
-
- /* If we have come to a non-option and did not permute it,
- either stop the scan or describe it to the caller and pass it by. */
-
- if (NONOPTION_P)
- {
- if (ordering == REQUIRE_ORDER)
- return -1;
- optarg = argv[optind++];
- return 1;
- }
-
- /* We have found another option-ARGV-element.
- Skip the initial punctuation. */
-
- nextchar = (argv[optind] + 1
- + (longopts != NULL && argv[optind][1] == '-'));
- }
-
- /* Decode the current option-ARGV-element. */
-
- /* Check whether the ARGV-element is a long option.
-
- If long_only and the ARGV-element has the form "-f", where f is
- a valid short option, don't consider it an abbreviated form of
- a long option that starts with f. Otherwise there would be no
- way to give the -f short option.
-
- On the other hand, if there's a long option "fubar" and
- the ARGV-element is "-fu", do consider that an abbreviation of
- the long option, just like "--fu", and not "-f" with arg "u".
-
- This distinction seems to be the most useful approach. */
-
- if (longopts != NULL
- && (argv[optind][1] == '-'
- || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1])))))
- {
- char *nameend;
- const struct option *p;
- const struct option *pfound = NULL;
- int exact = 0;
- int ambig = 0;
- int indfound = -1;
- int option_index;
-
- for (nameend = nextchar; *nameend && *nameend != '='; nameend++)
- /* Do nothing. */ ;
-
- /* Test all long options for either exact match
- or abbreviated matches. */
- for (p = longopts, option_index = 0; p->name; p++, option_index++)
- if (!strncmp (p->name, nextchar, nameend - nextchar))
- {
- if ((unsigned int) (nameend - nextchar)
- == (unsigned int) strlen (p->name))
- {
- /* Exact match found. */
- pfound = p;
- indfound = option_index;
- exact = 1;
- break;
- }
- else if (pfound == NULL)
- {
- /* First nonexact match found. */
- pfound = p;
- indfound = option_index;
- }
- else
- /* Second or later nonexact match found. */
- ambig = 1;
- }
-
- if (ambig && !exact)
- {
- if (opterr)
- fprintf (stderr, _("%s: option `%s' is ambiguous\n"),
- argv[0], argv[optind]);
- nextchar += strlen (nextchar);
- optind++;
- optopt = 0;
- return '?';
- }
-
- if (pfound != NULL)
- {
- option_index = indfound;
- optind++;
- if (*nameend)
- {
- /* Don't test has_arg with >, because some C compilers don't
- allow it to be used on enums. */
- if (pfound->has_arg)
- optarg = nameend + 1;
- else
- {
- if (opterr)
- {
- if (argv[optind - 1][1] == '-')
- /* --option */
- fprintf (stderr,
- _("%s: option `--%s' doesn't allow an argument\n"),
- argv[0], pfound->name);
- else
- /* +option or -option */
- fprintf (stderr,
- _("%s: option `%c%s' doesn't allow an argument\n"),
- argv[0], argv[optind - 1][0], pfound->name);
-
- nextchar += strlen (nextchar);
-
- optopt = pfound->val;
- return '?';
- }
- }
- }
- else if (pfound->has_arg == 1)
- {
- if (optind < argc)
- optarg = argv[optind++];
- else
- {
- if (opterr)
- fprintf (stderr,
- _("%s: option `%s' requires an argument\n"),
- argv[0], argv[optind - 1]);
- nextchar += strlen (nextchar);
- optopt = pfound->val;
- return optstring[0] == ':' ? ':' : '?';
- }
- }
- nextchar += strlen (nextchar);
- if (longind != NULL)
- *longind = option_index;
- if (pfound->flag)
- {
- *(pfound->flag) = pfound->val;
- return 0;
- }
- return pfound->val;
- }
-
- /* Can't find it as a long option. If this is not getopt_long_only,
- or the option starts with '--' or is not a valid short
- option, then it's an error.
- Otherwise interpret it as a short option. */
- if (!long_only || argv[optind][1] == '-'
- || my_index (optstring, *nextchar) == NULL)
- {
- if (opterr)
- {
- if (argv[optind][1] == '-')
- /* --option */
- fprintf (stderr, _("%s: unrecognized option `--%s'\n"),
- argv[0], nextchar);
- else
- /* +option or -option */
- fprintf (stderr, _("%s: unrecognized option `%c%s'\n"),
- argv[0], argv[optind][0], nextchar);
- }
- nextchar = (char *) "";
- optind++;
- optopt = 0;
- return '?';
- }
- }
-
- /* Look at and handle the next short option-character. */
-
- {
- char c = *nextchar++;
- char *temp = my_index (optstring, c);
-
- /* Increment `optind' when we start to process its last character. */
- if (*nextchar == '\0')
- ++optind;
-
- if (temp == NULL || c == ':')
- {
- if (opterr)
- {
- if (posixly_correct)
- /* 1003.2 specifies the format of this message. */
- fprintf (stderr, _("%s: illegal option -- %c\n"),
- argv[0], c);
- else
- fprintf (stderr, _("%s: invalid option -- %c\n"),
- argv[0], c);
- }
- optopt = c;
- return '?';
- }
- /* Convenience. Treat POSIX -W foo same as long option --foo */
- if (temp[0] == 'W' && temp[1] == ';')
- {
- char *nameend;
- const struct option *p;
- const struct option *pfound = NULL;
- int exact = 0;
- int ambig = 0;
- int indfound = 0;
- int option_index;
-
- /* This is an option that requires an argument. */
- if (*nextchar != '\0')
- {
- optarg = nextchar;
- /* If we end this ARGV-element by taking the rest as an arg,
- we must advance to the next element now. */
- optind++;
- }
- else if (optind == argc)
- {
- if (opterr)
- {
- /* 1003.2 specifies the format of this message. */
- fprintf (stderr, _("%s: option requires an argument -- %c\n"),
- argv[0], c);
- }
- optopt = c;
- if (optstring[0] == ':')
- c = ':';
- else
- c = '?';
- return c;
- }
- else
- /* We already incremented `optind' once;
- increment it again when taking next ARGV-elt as argument. */
- optarg = argv[optind++];
-
- /* optarg is now the argument, see if it's in the
- table of longopts. */
-
- for (nextchar = nameend = optarg; *nameend && *nameend != '='; nameend++)
- /* Do nothing. */ ;
-
- /* Test all long options for either exact match
- or abbreviated matches. */
- for (p = longopts, option_index = 0; p->name; p++, option_index++)
- if (!strncmp (p->name, nextchar, nameend - nextchar))
- {
- if ((unsigned int) (nameend - nextchar) == strlen (p->name))
- {
- /* Exact match found. */
- pfound = p;
- indfound = option_index;
- exact = 1;
- break;
- }
- else if (pfound == NULL)
- {
- /* First nonexact match found. */
- pfound = p;
- indfound = option_index;
- }
- else
- /* Second or later nonexact match found. */
- ambig = 1;
- }
- if (ambig && !exact)
- {
- if (opterr)
- fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"),
- argv[0], argv[optind]);
- nextchar += strlen (nextchar);
- optind++;
- return '?';
- }
- if (pfound != NULL)
- {
- option_index = indfound;
- if (*nameend)
- {
- /* Don't test has_arg with >, because some C compilers don't
- allow it to be used on enums. */
- if (pfound->has_arg)
- optarg = nameend + 1;
- else
- {
- if (opterr)
- fprintf (stderr, _("\
-%s: option `-W %s' doesn't allow an argument\n"),
- argv[0], pfound->name);
-
- nextchar += strlen (nextchar);
- return '?';
- }
- }
- else if (pfound->has_arg == 1)
- {
- if (optind < argc)
- optarg = argv[optind++];
- else
- {
- if (opterr)
- fprintf (stderr,
- _("%s: option `%s' requires an argument\n"),
- argv[0], argv[optind - 1]);
- nextchar += strlen (nextchar);
- return optstring[0] == ':' ? ':' : '?';
- }
- }
- nextchar += strlen (nextchar);
- if (longind != NULL)
- *longind = option_index;
- if (pfound->flag)
- {
- *(pfound->flag) = pfound->val;
- return 0;
- }
- return pfound->val;
- }
- nextchar = NULL;
- return 'W'; /* Let the application handle it. */
- }
- if (temp[1] == ':')
- {
- if (temp[2] == ':')
- {
- /* This is an option that accepts an argument optionally. */
- if (*nextchar != '\0')
- {
- optarg = nextchar;
- optind++;
- }
- else
- optarg = NULL;
- nextchar = NULL;
- }
- else
- {
- /* This is an option that requires an argument. */
- if (*nextchar != '\0')
- {
- optarg = nextchar;
- /* If we end this ARGV-element by taking the rest as an arg,
- we must advance to the next element now. */
- optind++;
- }
- else if (optind == argc)
- {
- if (opterr)
- {
- /* 1003.2 specifies the format of this message. */
- fprintf (stderr,
- _("%s: option requires an argument -- %c\n"),
- argv[0], c);
- }
- optopt = c;
- if (optstring[0] == ':')
- c = ':';
- else
- c = '?';
- }
- else
- /* We already incremented `optind' once;
- increment it again when taking next ARGV-elt as argument. */
- optarg = argv[optind++];
- nextchar = NULL;
- }
- }
- return c;
- }
-}
-
-int
-getopt (argc, argv, optstring)
- int argc;
- char *const *argv;
- const char *optstring;
-{
- return _getopt_internal (argc, argv, optstring,
- (const struct option *) 0,
- (int *) 0,
- 0);
-}
-
-#endif /* Not ELIDE_CODE. */
-
-#ifdef TEST
-
-/* Compile with -DTEST to make an executable for use in testing
- the above definition of `getopt'. */
-
-int
-main (argc, argv)
- int argc;
- char **argv;
-{
- int c;
- int digit_optind = 0;
-
- while (1)
- {
- int this_option_optind = optind ? optind : 1;
-
- c = getopt (argc, argv, "abc:d:0123456789");
- if (c == -1)
- break;
-
- switch (c)
- {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- if (digit_optind != 0 && digit_optind != this_option_optind)
- printf ("digits occur in two different argv-elements.\n");
- digit_optind = this_option_optind;
- printf ("option %c\n", c);
- break;
-
- case 'a':
- printf ("option a\n");
- break;
-
- case 'b':
- printf ("option b\n");
- break;
-
- case 'c':
- printf ("option c with value `%s'\n", optarg);
- break;
-
- case '?':
- break;
-
- default:
- printf ("?? getopt returned character code 0%o ??\n", c);
- }
- }
-
- if (optind < argc)
- {
- printf ("non-option ARGV-elements: ");
- while (optind < argc)
- printf ("%s ", argv[optind++]);
- printf ("\n");
- }
-
- exit (0);
-}
-
-#endif /* TEST */
diff --git a/contrib/gcc/getopt.h b/contrib/gcc/getopt.h
deleted file mode 100644
index fb30719a8602..000000000000
--- a/contrib/gcc/getopt.h
+++ /dev/null
@@ -1,133 +0,0 @@
-/* Declarations for getopt.
- Copyright (C) 1989,90,91,92,93,94,96,97 Free Software Foundation, Inc.
-
- NOTE: The canonical source of this file is maintained with the GNU C Library.
- Bugs can be reported to bug-glibc@gnu.org.
-
- This program 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 program 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 program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
- USA. */
-
-#ifndef _GETOPT_H
-#define _GETOPT_H 1
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* For communication from `getopt' to the caller.
- When `getopt' finds an option that takes an argument,
- the argument value is returned here.
- Also, when `ordering' is RETURN_IN_ORDER,
- each non-option ARGV-element is returned here. */
-
-extern char *optarg;
-
-/* Index in ARGV of the next element to be scanned.
- This is used for communication to and from the caller
- and for communication between successive calls to `getopt'.
-
- On entry to `getopt', zero means this is the first call; initialize.
-
- When `getopt' returns -1, this is the index of the first of the
- non-option elements that the caller should itself scan.
-
- Otherwise, `optind' communicates from one call to the next
- how much of ARGV has been scanned so far. */
-
-extern int optind;
-
-/* Callers store zero here to inhibit the error message `getopt' prints
- for unrecognized options. */
-
-extern int opterr;
-
-/* Set to an option character which was unrecognized. */
-
-extern int optopt;
-
-/* Describe the long-named options requested by the application.
- The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector
- of `struct option' terminated by an element containing a name which is
- zero.
-
- The field `has_arg' is:
- no_argument (or 0) if the option does not take an argument,
- required_argument (or 1) if the option requires an argument,
- optional_argument (or 2) if the option takes an optional argument.
-
- If the field `flag' is not NULL, it points to a variable that is set
- to the value given in the field `val' when the option is found, but
- left unchanged if the option is not found.
-
- To have a long-named option do something other than set an `int' to
- a compiled-in constant, such as set a value from `optarg', set the
- option's `flag' field to zero and its `val' field to a nonzero
- value (the equivalent single-letter option character, if there is
- one). For long options that have a zero `flag' field, `getopt'
- returns the contents of the `val' field. */
-
-struct option
-{
-#if defined (__STDC__) && __STDC__
- const char *name;
-#else
- char *name;
-#endif
- /* has_arg can't be an enum because some compilers complain about
- type mismatches in all the code that assumes it is an int. */
- int has_arg;
- int *flag;
- int val;
-};
-
-/* Names for the values of the `has_arg' field of `struct option'. */
-
-#define no_argument 0
-#define required_argument 1
-#define optional_argument 2
-
-#if defined (__STDC__) && __STDC__
-#ifdef __GNU_LIBRARY__
-/* Many other libraries have conflicting prototypes for getopt, with
- differences in the consts, in stdlib.h. To avoid compilation
- errors, only prototype getopt for the GNU C library. */
-extern int getopt (int argc, char *const *argv, const char *shortopts);
-#else /* not __GNU_LIBRARY__ */
-extern int getopt ();
-#endif /* __GNU_LIBRARY__ */
-extern int getopt_long (int argc, char *const *argv, const char *shortopts,
- const struct option *longopts, int *longind);
-extern int getopt_long_only (int argc, char *const *argv,
- const char *shortopts,
- const struct option *longopts, int *longind);
-
-/* Internal only. Users should not call this directly. */
-extern int _getopt_internal (int argc, char *const *argv,
- const char *shortopts,
- const struct option *longopts, int *longind,
- int long_only);
-#else /* not __STDC__ */
-extern int getopt ();
-extern int getopt_long ();
-extern int getopt_long_only ();
-
-extern int _getopt_internal ();
-#endif /* __STDC__ */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* getopt.h */
diff --git a/contrib/gcc/getopt1.c b/contrib/gcc/getopt1.c
deleted file mode 100644
index ff257374c335..000000000000
--- a/contrib/gcc/getopt1.c
+++ /dev/null
@@ -1,190 +0,0 @@
-/* getopt_long and getopt_long_only entry points for GNU getopt.
- Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98
- Free Software Foundation, Inc.
-
- NOTE: The canonical source of this file is maintained with the GNU C Library.
- Bugs can be reported to bug-glibc@gnu.org.
-
- This program 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 program 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 program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
- USA. */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "getopt.h"
-
-#if !defined __STDC__ || !__STDC__
-/* This is a separate conditional since some stdc systems
- reject `defined (const)'. */
-#ifndef const
-#define const
-#endif
-#endif
-
-#include <stdio.h>
-
-/* Comment out all this code if we are using the GNU C Library, and are not
- actually compiling the library itself. This code is part of the GNU C
- Library, but also included in many other GNU distributions. Compiling
- and linking in this code is a waste when using the GNU C library
- (especially if it is a shared library). Rather than having every GNU
- program understand `configure --with-gnu-libc' and omit the object files,
- it is simpler to just do this in the source for each such file. */
-
-#define GETOPT_INTERFACE_VERSION 2
-#if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2
-#include <gnu-versions.h>
-#if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION
-#define ELIDE_CODE
-#endif
-#endif
-
-#ifndef ELIDE_CODE
-
-
-/* This needs to come after some library #include
- to get __GNU_LIBRARY__ defined. */
-#ifdef __GNU_LIBRARY__
-#include <stdlib.h>
-#endif
-
-#ifndef NULL
-#define NULL 0
-#endif
-
-int
-getopt_long (argc, argv, options, long_options, opt_index)
- int argc;
- char *const *argv;
- const char *options;
- const struct option *long_options;
- int *opt_index;
-{
- return _getopt_internal (argc, argv, options, long_options, opt_index, 0);
-}
-
-/* Like getopt_long, but '-' as well as '--' can indicate a long option.
- If an option that starts with '-' (not '--') doesn't match a long option,
- but does match a short option, it is parsed as a short option
- instead. */
-
-int
-getopt_long_only (argc, argv, options, long_options, opt_index)
- int argc;
- char *const *argv;
- const char *options;
- const struct option *long_options;
- int *opt_index;
-{
- return _getopt_internal (argc, argv, options, long_options, opt_index, 1);
-}
-
-
-#endif /* Not ELIDE_CODE. */
-
-#ifdef TEST
-
-#include <stdio.h>
-
-int
-main (argc, argv)
- int argc;
- char **argv;
-{
- int c;
- int digit_optind = 0;
-
- while (1)
- {
- int this_option_optind = optind ? optind : 1;
- int option_index = 0;
- static struct option long_options[] =
- {
- {"add", 1, 0, 0},
- {"append", 0, 0, 0},
- {"delete", 1, 0, 0},
- {"verbose", 0, 0, 0},
- {"create", 0, 0, 0},
- {"file", 1, 0, 0},
- {0, 0, 0, 0}
- };
-
- c = getopt_long (argc, argv, "abc:d:0123456789",
- long_options, &option_index);
- if (c == -1)
- break;
-
- switch (c)
- {
- case 0:
- printf ("option %s", long_options[option_index].name);
- if (optarg)
- printf (" with arg %s", optarg);
- printf ("\n");
- break;
-
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- if (digit_optind != 0 && digit_optind != this_option_optind)
- printf ("digits occur in two different argv-elements.\n");
- digit_optind = this_option_optind;
- printf ("option %c\n", c);
- break;
-
- case 'a':
- printf ("option a\n");
- break;
-
- case 'b':
- printf ("option b\n");
- break;
-
- case 'c':
- printf ("option c with value `%s'\n", optarg);
- break;
-
- case 'd':
- printf ("option d with value `%s'\n", optarg);
- break;
-
- case '?':
- break;
-
- default:
- printf ("?? getopt returned character code 0%o ??\n", c);
- }
- }
-
- if (optind < argc)
- {
- printf ("non-option ARGV-elements: ");
- while (optind < argc)
- printf ("%s ", argv[optind++]);
- printf ("\n");
- }
-
- exit (0);
-}
-
-#endif /* TEST */
diff --git a/contrib/gcc/getpwd.c b/contrib/gcc/getpwd.c
deleted file mode 100644
index c3d155e57414..000000000000
--- a/contrib/gcc/getpwd.c
+++ /dev/null
@@ -1,90 +0,0 @@
-/* getpwd.c - get the working directory */
-
-#include "config.h"
-#include "system.h"
-
-/* Virtually every UN*X system now in common use (except for pre-4.3-tahoe
- BSD systems) now provides getcwd as called for by POSIX. Allow for
- the few exceptions to the general rule here. */
-
-#if !(defined (POSIX) || defined (USG) || defined (VMS)) || defined (HAVE_GETWD)
-#define getcwd(buf,len) getwd(buf)
-#ifdef MAXPATHLEN
-#define GUESSPATHLEN (MAXPATHLEN + 1)
-#else
-#define GUESSPATHLEN 100
-#endif
-#else /* (defined (USG) || defined (VMS)) */
-/* We actually use this as a starting point, not a limit. */
-#define GUESSPATHLEN 100
-#endif /* (defined (USG) || defined (VMS)) */
-
-#if !(defined (VMS) || (defined(_WIN32) && !defined(__CYGWIN__)))
-
-/* Get the working directory. Use the PWD environment variable if it's
- set correctly, since this is faster and gives more uniform answers
- to the user. Yield the working directory if successful; otherwise,
- yield 0 and set errno. */
-
-char *
-getpwd ()
-{
- static char *pwd;
- static int failure_errno;
-
- char *p = pwd;
- size_t s;
- struct stat dotstat, pwdstat;
-
- if (!p && !(errno = failure_errno))
- {
- if (! ((p = getenv ("PWD")) != 0
- && *p == '/'
- && stat (p, &pwdstat) == 0
- && stat (".", &dotstat) == 0
- && dotstat.st_ino == pwdstat.st_ino
- && dotstat.st_dev == pwdstat.st_dev))
-
- /* The shortcut didn't work. Try the slow, ``sure'' way. */
- for (s = GUESSPATHLEN; ! getcwd (p = xmalloc (s), s); s *= 2)
- {
- int e = errno;
- free (p);
-#ifdef ERANGE
- if (e != ERANGE)
-#endif
- {
- errno = failure_errno = e;
- p = 0;
- break;
- }
- }
-
- /* Cache the result. This assumes that the program does
- not invoke chdir between calls to getpwd. */
- pwd = p;
- }
- return p;
-}
-
-#else /* VMS || _WIN32 && !__CYGWIN__ */
-
-#ifndef MAXPATHLEN
-#define MAXPATHLEN 255
-#endif
-
-char *
-getpwd ()
-{
- static char *pwd = 0;
-
- if (!pwd)
- pwd = getcwd (xmalloc (MAXPATHLEN + 1), MAXPATHLEN + 1
-#ifdef VMS
- , 0
-#endif
- );
- return pwd;
-}
-
-#endif /* VMS || _WIN32 && !__CYGWIN__ */
diff --git a/contrib/gcc/ginclude/math-3300.h b/contrib/gcc/ginclude/math-3300.h
deleted file mode 100644
index 5d7ba28f67f6..000000000000
--- a/contrib/gcc/ginclude/math-3300.h
+++ /dev/null
@@ -1,461 +0,0 @@
-/******************************************************************\
-* *
-* <math-68881.h> last modified: 18 May 1989. *
-* *
-* Copyright (C) 1989 by Matthew Self. *
-* You may freely distribute verbatim copies of this software *
-* provided that this copyright notice is retained in all copies. *
-* You may distribute modifications to this software under the *
-* conditions above if you also clearly note such modifications *
-* with their author and date. *
-* *
-* Note: errno is not set to EDOM when domain errors occur for *
-* most of these functions. Rather, it is assumed that the *
-* 68881's OPERR exception will be enabled and handled *
-* appropriately by the operating system. Similarly, overflow *
-* and underflow do not set errno to ERANGE. *
-* *
-* Send bugs to Matthew Self (self@bayes.arc.nasa.gov). *
-* *
-\******************************************************************/
-
-#include <errno.h>
-
-#undef HUGE_VAL
-#define HUGE_VAL \
-({ \
- double huge_val; \
- \
- __asm ("fmove%.d %#0x7ff0000000000000,%0" /* Infinity */ \
- : "=f" (huge_val) \
- : /* no inputs */); \
- huge_val; \
-})
-
-__inline static const double sin (double x)
-{
- double value;
-
- __asm ("fsin%.x %1,%0"
- : "=f" (value)
- : "f" (x));
- return value;
-}
-
-__inline static const double cos (double x)
-{
- double value;
-
- __asm ("fcos%.x %1,%0"
- : "=f" (value)
- : "f" (x));
- return value;
-}
-
-__inline static const double tan (double x)
-{
- double value;
-
- __asm ("ftan%.x %1,%0"
- : "=f" (value)
- : "f" (x));
- return value;
-}
-
-__inline static const double asin (double x)
-{
- double value;
-
- __asm ("fasin%.x %1,%0"
- : "=f" (value)
- : "f" (x));
- return value;
-}
-
-__inline static const double acos (double x)
-{
- double value;
-
- __asm ("facos%.x %1,%0"
- : "=f" (value)
- : "f" (x));
- return value;
-}
-
-__inline static const double atan (double x)
-{
- double value;
-
- __asm ("fatan%.x %1,%0"
- : "=f" (value)
- : "f" (x));
- return value;
-}
-
-__inline static const double atan2 (double y, double x)
-{
- double pi, pi_over_2;
-
- __asm ("fmovecr%.x %#0,%0" /* extended precision pi */
- : "=f" (pi)
- : /* no inputs */ );
- __asm ("fscale%.b %#-1,%0" /* no loss of accuracy */
- : "=f" (pi_over_2)
- : "0" (pi));
- if (x > 0)
- {
- if (y > 0)
- {
- if (x > y)
- return atan (y / x);
- else
- return pi_over_2 - atan (x / y);
- }
- else
- {
- if (x > -y)
- return atan (y / x);
- else
- return - pi_over_2 - atan (x / y);
- }
- }
- else
- {
- if (y > 0)
- {
- if (-x > y)
- return pi + atan (y / x);
- else
- return pi_over_2 - atan (x / y);
- }
- else
- {
- if (-x > -y)
- return - pi + atan (y / x);
- else if (y < 0)
- return - pi_over_2 - atan (x / y);
- else
- {
- double value;
-
- errno = EDOM;
- __asm ("fmove%.d %#0x7fffffffffffffff,%0" /* quiet NaN */
- : "=f" (value)
- : /* no inputs */);
- return value;
- }
- }
- }
-}
-
-__inline static const double sinh (double x)
-{
- double value;
-
- __asm ("fsinh%.x %1,%0"
- : "=f" (value)
- : "f" (x));
- return value;
-}
-
-__inline static const double cosh (double x)
-{
- double value;
-
- __asm ("fcosh%.x %1,%0"
- : "=f" (value)
- : "f" (x));
- return value;
-}
-
-__inline static const double tanh (double x)
-{
- double value;
-
- __asm ("ftanh%.x %1,%0"
- : "=f" (value)
- : "f" (x));
- return value;
-}
-
-__inline static const double atanh (double x)
-{
- double value;
-
- __asm ("fatanh%.x %1,%0"
- : "=f" (value)
- : "f" (x));
- return value;
-}
-
-__inline static const double exp (double x)
-{
- double value;
-
- __asm ("fetox%.x %1,%0"
- : "=f" (value)
- : "f" (x));
- return value;
-}
-
-__inline static const double expm1 (double x)
-{
- double value;
-
- __asm ("fetoxm1%.x %1,%0"
- : "=f" (value)
- : "f" (x));
- return value;
-}
-
-__inline static const double log (double x)
-{
- double value;
-
- __asm ("flogn%.x %1,%0"
- : "=f" (value)
- : "f" (x));
- return value;
-}
-
-__inline static const double log1p (double x)
-{
- double value;
-
- __asm ("flognp1%.x %1,%0"
- : "=f" (value)
- : "f" (x));
- return value;
-}
-
-__inline static const double log10 (double x)
-{
- double value;
-
- __asm ("flog10%.x %1,%0"
- : "=f" (value)
- : "f" (x));
- return value;
-}
-
-__inline static const double sqrt (double x)
-{
- double value;
-
- __asm ("fsqrt%.x %1,%0"
- : "=f" (value)
- : "f" (x));
- return value;
-}
-
-__inline static const double pow (const double x, const double y)
-{
- if (x > 0)
- return exp (y * log (x));
- else if (x == 0)
- {
- if (y > 0)
- return 0.0;
- else
- {
- double value;
-
- errno = EDOM;
- __asm ("fmove%.d %#0x7fffffffffffffff,%0" /* quiet NaN */
- : "=f" (value)
- : /* no inputs */);
- return value;
- }
- }
- else
- {
- double temp;
-
- __asm ("fintrz%.x %1,%0"
- : "=f" (temp) /* integer-valued float */
- : "f" (y));
- if (y == temp)
- {
- int i = (int) y;
-
- if ((i & 1) == 0) /* even */
- return exp (y * log (x));
- else
- return - exp (y * log (x));
- }
- else
- {
- double value;
-
- errno = EDOM;
- __asm ("fmove%.d %#0x7fffffffffffffff,%0" /* quiet NaN */
- : "=f" (value)
- : /* no inputs */);
- return value;
- }
- }
-}
-
-__inline static const double fabs (double x)
-{
- double value;
-
- __asm ("fabs%.x %1,%0"
- : "=f" (value)
- : "f" (x));
- return value;
-}
-
-__inline static const double ceil (double x)
-{
- int rounding_mode, round_up;
- double value;
-
- __asm volatile ("fmove%.l %%fpcr,%0"
- : "=dm" (rounding_mode)
- : /* no inputs */ );
- round_up = rounding_mode | 0x30;
- __asm volatile ("fmove%.l %0,%%fpcr"
- : /* no outputs */
- : "dmi" (round_up));
- __asm volatile ("fint%.x %1,%0"
- : "=f" (value)
- : "f" (x));
- __asm volatile ("fmove%.l %0,%%fpcr"
- : /* no outputs */
- : "dmi" (rounding_mode));
- return value;
-}
-
-__inline static const double floor (double x)
-{
- int rounding_mode, round_down;
- double value;
-
- __asm volatile ("fmove%.l %%fpcr,%0"
- : "=dm" (rounding_mode)
- : /* no inputs */ );
- round_down = (rounding_mode & ~0x10)
- | 0x20;
- __asm volatile ("fmove%.l %0,%%fpcr"
- : /* no outputs */
- : "dmi" (round_down));
- __asm volatile ("fint%.x %1,%0"
- : "=f" (value)
- : "f" (x));
- __asm volatile ("fmove%.l %0,%%fpcr"
- : /* no outputs */
- : "dmi" (rounding_mode));
- return value;
-}
-
-__inline static const double rint (double x)
-{
- int rounding_mode, round_nearest;
- double value;
-
- __asm volatile ("fmove%.l %%fpcr,%0"
- : "=dm" (rounding_mode)
- : /* no inputs */ );
- round_nearest = rounding_mode & ~0x30;
- __asm volatile ("fmove%.l %0,%%fpcr"
- : /* no outputs */
- : "dmi" (round_nearest));
- __asm volatile ("fint%.x %1,%0"
- : "=f" (value)
- : "f" (x));
- __asm volatile ("fmove%.l %0,%%fpcr"
- : /* no outputs */
- : "dmi" (rounding_mode));
- return value;
-}
-
-__inline static const double fmod (double x, double y)
-{
- double value;
-
- __asm ("fmod%.x %2,%0"
- : "=f" (value)
- : "0" (x),
- "f" (y));
- return value;
-}
-
-__inline static const double drem (double x, double y)
-{
- double value;
-
- __asm ("frem%.x %2,%0"
- : "=f" (value)
- : "0" (x),
- "f" (y));
- return value;
-}
-
-__inline static const double scalb (double x, int n)
-{
- double value;
-
- __asm ("fscale%.l %2,%0"
- : "=f" (value)
- : "0" (x),
- "dmi" (n));
- return value;
-}
-
-__inline static double logb (double x)
-{
- double exponent;
-
- __asm ("fgetexp%.x %1,%0"
- : "=f" (exponent)
- : "f" (x));
- return exponent;
-}
-
-__inline static const double ldexp (double x, int n)
-{
- double value;
-
- __asm ("fscale%.l %2,%0"
- : "=f" (value)
- : "0" (x),
- "dmi" (n));
- return value;
-}
-
-__inline static double frexp (double x, int *exp)
-{
- double float_exponent;
- int int_exponent;
- double mantissa;
-
- __asm ("fgetexp%.x %1,%0"
- : "=f" (float_exponent) /* integer-valued float */
- : "f" (x));
- int_exponent = (int) float_exponent;
- __asm ("fgetman%.x %1,%0"
- : "=f" (mantissa) /* 1.0 <= mantissa < 2.0 */
- : "f" (x));
- if (mantissa != 0)
- {
- __asm ("fscale%.b %#-1,%0"
- : "=f" (mantissa) /* mantissa /= 2.0 */
- : "0" (mantissa));
- int_exponent += 1;
- }
- *exp = int_exponent;
- return mantissa;
-}
-
-__inline static double modf (double x, double *ip)
-{
- double temp;
-
- __asm ("fintrz%.x %1,%0"
- : "=f" (temp) /* integer-valued float */
- : "f" (x));
- *ip = temp;
- return x - temp;
-}
-
diff --git a/contrib/gcc/ginclude/math-68881.h b/contrib/gcc/ginclude/math-68881.h
deleted file mode 100644
index 7b91bc56a5db..000000000000
--- a/contrib/gcc/ginclude/math-68881.h
+++ /dev/null
@@ -1,529 +0,0 @@
-/******************************************************************\
-* *
-* <math-68881.h> last modified: 23 May 1992. *
-* *
-* Copyright (C) 1989 by Matthew Self. *
-* You may freely distribute verbatim copies of this software *
-* provided that this copyright notice is retained in all copies. *
-* You may distribute modifications to this software under the *
-* conditions above if you also clearly note such modifications *
-* with their author and date. *
-* *
-* Note: errno is not set to EDOM when domain errors occur for *
-* most of these functions. Rather, it is assumed that the *
-* 68881's OPERR exception will be enabled and handled *
-* appropriately by the operating system. Similarly, overflow *
-* and underflow do not set errno to ERANGE. *
-* *
-* Send bugs to Matthew Self (self@bayes.arc.nasa.gov). *
-* *
-\******************************************************************/
-
-/* This file is NOT a part of GCC, just distributed with it. */
-
-/* If you find this in GCC,
- please send bug reports to bug-gcc@prep.ai.mit.edu. */
-
-/* Changed by Richard Stallman:
- May 1993, add conditional to prevent multiple inclusion.
- % inserted before a #.
- New function `hypot' added.
- Nans written in hex to avoid 0rnan.
- May 1992, use %! for fpcr register. Break lines before function names.
- December 1989, add parens around `&' in pow.
- November 1990, added alternate definition of HUGE_VAL for Sun. */
-
-/* Changed by Jim Wilson:
- September 1993, Use #undef before HUGE_VAL instead of #ifdef/#endif. */
-
-/* Changed by Ian Lance Taylor:
- September 1994, use extern inline instead of static inline. */
-
-#ifndef __math_68881
-#define __math_68881
-
-#include <errno.h>
-
-#undef HUGE_VAL
-#ifdef __sun__
-/* The Sun assembler fails to handle the hex constant in the usual defn. */
-#define HUGE_VAL \
-({ \
- static union { int i[2]; double d; } u = { {0x7ff00000, 0} }; \
- u.d; \
-})
-#else
-#define HUGE_VAL \
-({ \
- double huge_val; \
- \
- __asm ("fmove%.d %#0x7ff0000000000000,%0" /* Infinity */ \
- : "=f" (huge_val) \
- : /* no inputs */); \
- huge_val; \
-})
-#endif
-
-__inline extern double
-sin (double x)
-{
- double value;
-
- __asm ("fsin%.x %1,%0"
- : "=f" (value)
- : "f" (x));
- return value;
-}
-
-__inline extern double
-cos (double x)
-{
- double value;
-
- __asm ("fcos%.x %1,%0"
- : "=f" (value)
- : "f" (x));
- return value;
-}
-
-__inline extern double
-tan (double x)
-{
- double value;
-
- __asm ("ftan%.x %1,%0"
- : "=f" (value)
- : "f" (x));
- return value;
-}
-
-__inline extern double
-asin (double x)
-{
- double value;
-
- __asm ("fasin%.x %1,%0"
- : "=f" (value)
- : "f" (x));
- return value;
-}
-
-__inline extern double
-acos (double x)
-{
- double value;
-
- __asm ("facos%.x %1,%0"
- : "=f" (value)
- : "f" (x));
- return value;
-}
-
-__inline extern double
-atan (double x)
-{
- double value;
-
- __asm ("fatan%.x %1,%0"
- : "=f" (value)
- : "f" (x));
- return value;
-}
-
-__inline extern double
-atan2 (double y, double x)
-{
- double pi, pi_over_2;
-
- __asm ("fmovecr%.x %#0,%0" /* extended precision pi */
- : "=f" (pi)
- : /* no inputs */ );
- __asm ("fscale%.b %#-1,%0" /* no loss of accuracy */
- : "=f" (pi_over_2)
- : "0" (pi));
- if (x > 0)
- {
- if (y > 0)
- {
- if (x > y)
- return atan (y / x);
- else
- return pi_over_2 - atan (x / y);
- }
- else
- {
- if (x > -y)
- return atan (y / x);
- else
- return - pi_over_2 - atan (x / y);
- }
- }
- else
- {
- if (y < 0)
- {
- if (-x > -y)
- return - pi + atan (y / x);
- else
- return - pi_over_2 - atan (x / y);
- }
- else
- {
- if (-x > y)
- return pi + atan (y / x);
- else if (y > 0)
- return pi_over_2 - atan (x / y);
- else
- {
- double value;
-
- errno = EDOM;
- __asm ("fmove%.d %#0x7fffffffffffffff,%0" /* quiet NaN */
- : "=f" (value)
- : /* no inputs */);
- return value;
- }
- }
- }
-}
-
-__inline extern double
-sinh (double x)
-{
- double value;
-
- __asm ("fsinh%.x %1,%0"
- : "=f" (value)
- : "f" (x));
- return value;
-}
-
-__inline extern double
-cosh (double x)
-{
- double value;
-
- __asm ("fcosh%.x %1,%0"
- : "=f" (value)
- : "f" (x));
- return value;
-}
-
-__inline extern double
-tanh (double x)
-{
- double value;
-
- __asm ("ftanh%.x %1,%0"
- : "=f" (value)
- : "f" (x));
- return value;
-}
-
-__inline extern double
-atanh (double x)
-{
- double value;
-
- __asm ("fatanh%.x %1,%0"
- : "=f" (value)
- : "f" (x));
- return value;
-}
-
-__inline extern double
-exp (double x)
-{
- double value;
-
- __asm ("fetox%.x %1,%0"
- : "=f" (value)
- : "f" (x));
- return value;
-}
-
-__inline extern double
-expm1 (double x)
-{
- double value;
-
- __asm ("fetoxm1%.x %1,%0"
- : "=f" (value)
- : "f" (x));
- return value;
-}
-
-__inline extern double
-log (double x)
-{
- double value;
-
- __asm ("flogn%.x %1,%0"
- : "=f" (value)
- : "f" (x));
- return value;
-}
-
-__inline extern double
-log1p (double x)
-{
- double value;
-
- __asm ("flognp1%.x %1,%0"
- : "=f" (value)
- : "f" (x));
- return value;
-}
-
-__inline extern double
-log10 (double x)
-{
- double value;
-
- __asm ("flog10%.x %1,%0"
- : "=f" (value)
- : "f" (x));
- return value;
-}
-
-__inline extern double
-sqrt (double x)
-{
- double value;
-
- __asm ("fsqrt%.x %1,%0"
- : "=f" (value)
- : "f" (x));
- return value;
-}
-
-__inline extern double
-hypot (double x, double y)
-{
- return sqrt (x*x + y*y);
-}
-
-__inline extern double
-pow (double x, double y)
-{
- if (x > 0)
- return exp (y * log (x));
- else if (x == 0)
- {
- if (y > 0)
- return 0.0;
- else
- {
- double value;
-
- errno = EDOM;
- __asm ("fmove%.d %#0x7fffffffffffffff,%0" /* quiet NaN */
- : "=f" (value)
- : /* no inputs */);
- return value;
- }
- }
- else
- {
- double temp;
-
- __asm ("fintrz%.x %1,%0"
- : "=f" (temp) /* integer-valued float */
- : "f" (y));
- if (y == temp)
- {
- int i = (int) y;
-
- if ((i & 1) == 0) /* even */
- return exp (y * log (-x));
- else
- return - exp (y * log (-x));
- }
- else
- {
- double value;
-
- errno = EDOM;
- __asm ("fmove%.d %#0x7fffffffffffffff,%0" /* quiet NaN */
- : "=f" (value)
- : /* no inputs */);
- return value;
- }
- }
-}
-
-__inline extern double
-fabs (double x)
-{
- double value;
-
- __asm ("fabs%.x %1,%0"
- : "=f" (value)
- : "f" (x));
- return value;
-}
-
-__inline extern double
-ceil (double x)
-{
- int rounding_mode, round_up;
- double value;
-
- __asm volatile ("fmove%.l %!,%0"
- : "=dm" (rounding_mode)
- : /* no inputs */ );
- round_up = rounding_mode | 0x30;
- __asm volatile ("fmove%.l %0,%!"
- : /* no outputs */
- : "dmi" (round_up));
- __asm volatile ("fint%.x %1,%0"
- : "=f" (value)
- : "f" (x));
- __asm volatile ("fmove%.l %0,%!"
- : /* no outputs */
- : "dmi" (rounding_mode));
- return value;
-}
-
-__inline extern double
-floor (double x)
-{
- int rounding_mode, round_down;
- double value;
-
- __asm volatile ("fmove%.l %!,%0"
- : "=dm" (rounding_mode)
- : /* no inputs */ );
- round_down = (rounding_mode & ~0x10)
- | 0x20;
- __asm volatile ("fmove%.l %0,%!"
- : /* no outputs */
- : "dmi" (round_down));
- __asm volatile ("fint%.x %1,%0"
- : "=f" (value)
- : "f" (x));
- __asm volatile ("fmove%.l %0,%!"
- : /* no outputs */
- : "dmi" (rounding_mode));
- return value;
-}
-
-__inline extern double
-rint (double x)
-{
- int rounding_mode, round_nearest;
- double value;
-
- __asm volatile ("fmove%.l %!,%0"
- : "=dm" (rounding_mode)
- : /* no inputs */ );
- round_nearest = rounding_mode & ~0x30;
- __asm volatile ("fmove%.l %0,%!"
- : /* no outputs */
- : "dmi" (round_nearest));
- __asm volatile ("fint%.x %1,%0"
- : "=f" (value)
- : "f" (x));
- __asm volatile ("fmove%.l %0,%!"
- : /* no outputs */
- : "dmi" (rounding_mode));
- return value;
-}
-
-__inline extern double
-fmod (double x, double y)
-{
- double value;
-
- __asm ("fmod%.x %2,%0"
- : "=f" (value)
- : "0" (x),
- "f" (y));
- return value;
-}
-
-__inline extern double
-drem (double x, double y)
-{
- double value;
-
- __asm ("frem%.x %2,%0"
- : "=f" (value)
- : "0" (x),
- "f" (y));
- return value;
-}
-
-__inline extern double
-scalb (double x, int n)
-{
- double value;
-
- __asm ("fscale%.l %2,%0"
- : "=f" (value)
- : "0" (x),
- "dmi" (n));
- return value;
-}
-
-__inline extern double
-logb (double x)
-{
- double exponent;
-
- __asm ("fgetexp%.x %1,%0"
- : "=f" (exponent)
- : "f" (x));
- return exponent;
-}
-
-__inline extern double
-ldexp (double x, int n)
-{
- double value;
-
- __asm ("fscale%.l %2,%0"
- : "=f" (value)
- : "0" (x),
- "dmi" (n));
- return value;
-}
-
-__inline extern double
-frexp (double x, int *exp)
-{
- double float_exponent;
- int int_exponent;
- double mantissa;
-
- __asm ("fgetexp%.x %1,%0"
- : "=f" (float_exponent) /* integer-valued float */
- : "f" (x));
- int_exponent = (int) float_exponent;
- __asm ("fgetman%.x %1,%0"
- : "=f" (mantissa) /* 1.0 <= mantissa < 2.0 */
- : "f" (x));
- if (mantissa != 0)
- {
- __asm ("fscale%.b %#-1,%0"
- : "=f" (mantissa) /* mantissa /= 2.0 */
- : "0" (mantissa));
- int_exponent += 1;
- }
- *exp = int_exponent;
- return mantissa;
-}
-
-__inline extern double
-modf (double x, double *ip)
-{
- double temp;
-
- __asm ("fintrz%.x %1,%0"
- : "=f" (temp) /* integer-valued float */
- : "f" (x));
- *ip = temp;
- return x - temp;
-}
-
-#endif /* not __math_68881 */
diff --git a/contrib/gcc/ginclude/ppc-asm.h b/contrib/gcc/ginclude/ppc-asm.h
deleted file mode 100644
index 4512d94352a3..000000000000
--- a/contrib/gcc/ginclude/ppc-asm.h
+++ /dev/null
@@ -1,170 +0,0 @@
-/* PowerPC asm definitions for GNU C. */
-/* Under winnt, 1) gas supports the following as names and 2) in particular
- defining "toc" breaks the FUNC_START macro as ".toc" becomes ".2" */
-
-#if !defined(__WINNT__)
-#define r0 0
-#define sp 1
-#define toc 2
-#define r3 3
-#define r4 4
-#define r5 5
-#define r6 6
-#define r7 7
-#define r8 8
-#define r9 9
-#define r10 10
-#define r11 11
-#define r12 12
-#define r13 13
-#define r14 14
-#define r15 15
-#define r16 16
-#define r17 17
-#define r18 18
-#define r19 19
-#define r20 20
-#define r21 21
-#define r22 22
-#define r23 23
-#define r24 24
-#define r25 25
-#define r26 26
-#define r27 27
-#define r28 28
-#define r29 29
-#define r30 30
-#define r31 31
-
-#define cr0 0
-#define cr1 1
-#define cr2 2
-#define cr3 3
-#define cr4 4
-#define cr5 5
-#define cr6 6
-#define cr7 7
-
-#define f0 0
-#define f1 1
-#define f2 2
-#define f3 3
-#define f4 4
-#define f5 5
-#define f6 6
-#define f7 7
-#define f8 8
-#define f9 9
-#define f10 10
-#define f11 11
-#define f12 12
-#define f13 13
-#define f14 14
-#define f15 15
-#define f16 16
-#define f17 17
-#define f18 18
-#define f19 19
-#define f20 20
-#define f21 21
-#define f22 22
-#define f23 23
-#define f24 24
-#define f25 25
-#define f26 26
-#define f27 27
-#define f28 28
-#define f29 29
-#define f30 30
-#define f31 31
-#endif
-
-/*
- * Macros to glue together two tokens.
- */
-
-#ifdef __STDC__
-#define XGLUE(a,b) a##b
-#else
-#define XGLUE(a,b) a/**/b
-#endif
-
-#define GLUE(a,b) XGLUE(a,b)
-
-/*
- * Macros to begin and end a function written in assembler. If -mcall-aixdesc
- * or -mcall-nt, create a function descriptor with the given name, and create
- * the real function with one or two leading periods respectively.
- */
-
-#ifdef _RELOCATABLE
-#define DESC_SECTION ".got2"
-#else
-#define DESC_SECTION ".got1"
-#endif
-
-#if defined(_CALL_AIXDESC)
-#define FUNC_NAME(name) GLUE(.,name)
-#define FUNC_START(name) \
- .section DESC_SECTION,"aw"; \
-name: \
- .long GLUE(.,name); \
- .long _GLOBAL_OFFSET_TABLE_; \
- .long 0; \
- .previous; \
- .type GLUE(.,name),@function; \
- .globl name; \
- .globl GLUE(.,name); \
-GLUE(.,name):
-
-#define FUNC_END(name) \
-GLUE(.L,name): \
- .size GLUE(.,name),GLUE(.L,name)-GLUE(.,name)
-
-#elif defined(__WINNT__)
-#define FUNC_NAME(name) GLUE(..,name)
-#define FUNC_START(name) \
- .pdata; \
- .align 2; \
- .ualong GLUE(..,name),GLUE(name,.e),0,0,GLUE(..,name); \
- .reldata; \
-name: \
- .ualong GLUE(..,name),.toc; \
- .section .text; \
- .globl name; \
- .globl GLUE(..,name); \
-GLUE(..,name):
-
-#define FUNC_END(name) \
-GLUE(name,.e): ; \
-GLUE(FE_MOT_RESVD..,name):
-
-#elif defined(_CALL_NT)
-#define FUNC_NAME(name) GLUE(..,name)
-#define FUNC_START(name) \
- .section DESC_SECTION,"aw"; \
-name: \
- .long GLUE(..,name); \
- .long _GLOBAL_OFFSET_TABLE_; \
- .previous; \
- .type GLUE(..,name),@function; \
- .globl name; \
- .globl GLUE(..,name); \
-GLUE(..,name):
-
-#define FUNC_END(name) \
-GLUE(.L,name): \
- .size GLUE(..,name),GLUE(.L,name)-GLUE(..,name)
-
-#else
-#define FUNC_NAME(name) name
-#define FUNC_START(name) \
- .type name,@function; \
- .globl name; \
-name:
-
-#define FUNC_END(name) \
-GLUE(.L,name): \
- .size name,GLUE(.L,name)-name
-#endif
-
diff --git a/contrib/gcc/ginclude/proto.h b/contrib/gcc/ginclude/proto.h
deleted file mode 100644
index cc48915d8421..000000000000
--- a/contrib/gcc/ginclude/proto.h
+++ /dev/null
@@ -1,4 +0,0 @@
-/* This header file is to avoid trouble with semi-ANSI header files
- on the Convex in system version 8.0. */
-
-#define _PROTO(list) ()
diff --git a/contrib/gcc/ginclude/va-alpha.h b/contrib/gcc/ginclude/va-alpha.h
deleted file mode 100644
index 2528a712ada2..000000000000
--- a/contrib/gcc/ginclude/va-alpha.h
+++ /dev/null
@@ -1,128 +0,0 @@
-/* GNU C varargs and stdargs support for the DEC Alpha. */
-
-/* Note: We must use the name __builtin_savregs. GCC attaches special
- significance to that name. In particular, regardless of where in a
- function __builtin_saveregs is called, GCC moves the call up to the
- very start of the function. */
-
-/* Define __gnuc_va_list. */
-
-#ifndef __GNUC_VA_LIST
-#define __GNUC_VA_LIST
-
-/* In VMS, __gnuc_va_list is simply char *; on OSF, it's a structure. */
-
-#ifdef __VMS__
-typedef char *__gnuc_va_list;
-#else
-
-typedef struct {
- char *__base; /* Pointer to first integer register. */
- int __offset; /* Byte offset of args so far. */
-} __gnuc_va_list;
-#endif
-
-#endif /* __GNUC_VA_LIST */
-
-/* If this is for internal libc use, don't define anything but
- __gnuc_va_list. */
-
-#if !defined(__GNUC_VA_LIST_1) && (defined (_STDARG_H) || defined (_VARARGS_H))
-#define __GNUC_VA_LIST_1
-
-#define _VA_LIST
-#define _VA_LIST_
-
-typedef __gnuc_va_list va_list;
-
-#if !defined(_STDARG_H)
-
-/* varargs support */
-#define va_alist __builtin_va_alist
-#define va_dcl int __builtin_va_alist;...
-#ifdef __VMS__
-#define va_start(pvar) ((pvar) = __builtin_saveregs ())
-#else
-#define va_start(pvar) ((pvar) = * (__gnuc_va_list *) __builtin_saveregs ())
-#endif
-
-#else /* STDARG.H */
-
-/* ANSI alternative. */
-
-/* Call __builtin_next_arg even though we aren't using its value, so that
- we can verify that firstarg is correct. */
-
-#ifdef __VMS__
-#define va_start(pvar, firstarg) \
- (__builtin_next_arg (firstarg), \
- (pvar) = __builtin_saveregs ())
-#else
-#define va_start(pvar, firstarg) \
- (__builtin_next_arg (firstarg), \
- (pvar) = *(__gnuc_va_list *) __builtin_saveregs ())
-#endif
-
-#endif /* _STDARG_H */
-
-#define va_end(__va) ((void) 0)
-
-/* Values returned by __builtin_classify_type. */
-
-enum {
- __no_type_class = -1,
- __void_type_class,
- __integer_type_class,
- __char_type_class,
- __enumeral_type_class,
- __boolean_type_class,
- __pointer_type_class,
- __reference_type_class,
- __offset_type_class,
- __real_type_class,
- __complex_type_class,
- __function_type_class,
- __method_type_class,
- __record_type_class,
- __union_type_class,
- __array_type_class,
- __string_type_class,
- __set_type_class,
- __file_type_class,
- __lang_type_class
-};
-
-/* Note that parameters are always aligned at least to a word boundary
- (when passed) regardless of what GCC's __alignof__ operator says. */
-
-/* Avoid errors if compiling GCC v2 with GCC v1. */
-#if __GNUC__ == 1
-#define __extension__
-#endif
-
-/* Get the size of a type in bytes, rounded up to an integral number
- of words. */
-
-#define __va_tsize(__type) \
- (((sizeof (__type) + __extension__ sizeof (long long) - 1) \
- / __extension__ sizeof (long long)) * __extension__ sizeof (long long))
-
-#ifdef __VMS__
-#define va_arg(__va, __type) \
-(*(((__va) += __va_tsize (__type)), \
- (__type *)(void *)((__va) - __va_tsize (__type))))
-
-#else
-
-#define va_arg(__va, __type) \
-(*(((__va).__offset += __va_tsize (__type)), \
- (__type *)(void *)((__va).__base + (__va).__offset \
- - (((__builtin_classify_type (* (__type *) 0) \
- == __real_type_class) && (__va).__offset <= (6 * 8)) \
- ? (6 * 8) + 8 : __va_tsize (__type)))))
-#endif
-
-/* Copy __gnuc_va_list into another variable of this type. */
-#define __va_copy(dest, src) (dest) = (src)
-
-#endif /* __GNUC_VA_LIST_1 */
diff --git a/contrib/gcc/ginclude/va-arc.h b/contrib/gcc/ginclude/va-arc.h
deleted file mode 100644
index a718ad6245d6..000000000000
--- a/contrib/gcc/ginclude/va-arc.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/* stdarg/varargs support for the ARC */
-
-/* Define __gnuc_va_list. */
-
-#ifndef __GNUC_VA_LIST
-#define __GNUC_VA_LIST
-typedef void * __gnuc_va_list;
-#endif /* not __GNUC_VA_LIST */
-
-/* If this is for internal libc use, don't define anything but
- __gnuc_va_list. */
-#if defined (_STDARG_H) || defined (_VARARGS_H)
-
-/* In GCC version 2, we want an ellipsis at the end of the declaration
- of the argument list. GCC version 1 can't parse it. */
-
-#if __GNUC__ > 1
-#define __va_ellipsis ...
-#else
-#define __va_ellipsis
-#endif
-
-/* See arc_setup_incoming_varargs for reasons for the oddity in va_start. */
-#ifdef _STDARG_H
-#define va_start(AP, LASTARG) \
-(AP = (__gnuc_va_list) ((int *) __builtin_next_arg (LASTARG) \
- + (__builtin_args_info (0) < 8 \
- ? (__builtin_args_info (0) & 1) \
- : 0)))
-#else
-#define va_alist __builtin_va_alist
-#define va_dcl int __builtin_va_alist; __va_ellipsis
-#define va_start(AP) \
-(AP = (__gnuc_va_list) ((int *) &__builtin_va_alist \
- + (__builtin_args_info (0) < 8 \
- ? (__builtin_args_info (0) & 1) \
- : 0)))
-#endif
-
-#ifndef va_end
-void va_end (__gnuc_va_list); /* Defined in libgcc.a */
-
-/* Values returned by __builtin_classify_type. */
-
-enum __va_type_classes {
- __no_type_class = -1,
- __void_type_class,
- __integer_type_class,
- __char_type_class,
- __enumeral_type_class,
- __boolean_type_class,
- __pointer_type_class,
- __reference_type_class,
- __offset_type_class,
- __real_type_class,
- __complex_type_class,
- __function_type_class,
- __method_type_class,
- __record_type_class,
- __union_type_class,
- __array_type_class,
- __string_type_class,
- __set_type_class,
- __file_type_class,
- __lang_type_class
-};
-
-#endif
-#define va_end(AP) ((void)0)
-
-/* Avoid errors if compiling GCC v2 with GCC v1. */
-#if __GNUC__ == 1
-#define __extension__
-#endif
-
-/* All aggregates are passed by reference. All scalar types larger than 8
- bytes are passed by reference. */
-/* We cast to void * and then to TYPE * because this avoids
- a warning about increasing the alignment requirement.
- The casts to char * avoid warnings about invalid pointer arithmetic. */
-
-#define __va_rounded_size(TYPE) \
- (((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
-
-#ifdef __big_endian__
-#define va_arg(AP,TYPE) \
-__extension__ \
-(*({((__builtin_classify_type (*(TYPE*) 0) >= __record_type_class \
- || __va_rounded_size (TYPE) > 8) \
- ? ((AP) = (char *)(AP) + __va_rounded_size (TYPE *), \
- *(TYPE **) (void *) ((char *)(AP) - __va_rounded_size (TYPE *))) \
- : ((TYPE *) (void *) \
- (AP = (void *) ((__alignof__ (TYPE) > 4 \
- ? ((int) AP + 8 - 1) & -8 \
- : (int) AP) \
- + __va_rounded_size (TYPE))) - 1));}))
-#else
-#define va_arg(AP,TYPE) \
-__extension__ \
-(*({((__builtin_classify_type (*(TYPE*) 0) >= __record_type_class \
- || __va_rounded_size (TYPE) > 8) \
- ? ((AP) = (char *)(AP) + __va_rounded_size (TYPE *), \
- *(TYPE **) (void *) ((char *)(AP) - __va_rounded_size (TYPE *))) \
- : ((AP = (void *) ((__alignof__ (TYPE) > 4 \
- ? ((int) AP + 8 - 1) & -8 \
- : (int) AP) \
- + __va_rounded_size (TYPE))), \
- (TYPE *) (void *) (AP - __va_rounded_size (TYPE))));}))
-#endif
-
-#endif /* defined (_STDARG_H) || defined (_VARARGS_H) */
diff --git a/contrib/gcc/ginclude/va-c4x.h b/contrib/gcc/ginclude/va-c4x.h
deleted file mode 100644
index c73c6d592bdc..000000000000
--- a/contrib/gcc/ginclude/va-c4x.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/* GNU C varargs support for the TMS320C[34]x */
-
-/* C[34]x arguments grow in weird ways (downwards) that the standard
- varargs stuff can't handle. */
-
-#ifndef __GNUC_VA_LIST
-#define __GNUC_VA_LIST
-
-typedef void *__gnuc_va_list;
-
-#endif /* not __GNUC_VA_LIST */
-
-/* If this is for internal libc use, don't define anything but
- __gnuc_va_list. */
-#if defined (_STDARG_H) || defined (_VARARGS_H)
-
-#ifdef _STDARG_H /* stdarg.h support */
-
-#define va_start(AP,LASTARG) AP=(__gnuc_va_list) __builtin_next_arg (LASTARG)
-
-#else /* varargs.h support */
-
-#define __va_ellipsis ...
-#define va_alist __builtin_va_alist
-#define va_dcl int __builtin_va_alist; __va_ellipsis
-#define va_start(AP) AP=(__gnuc_va_list) ((int *)&__builtin_va_alist + 1)
-
-#endif /* _STDARG_H */
-
-#define va_end(AP) ((void) 0)
-#define va_arg(AP,TYPE) (AP = (__gnuc_va_list) ((char *) (AP) - sizeof(TYPE)), \
- *((TYPE *) ((char *) (AP))))
-
-#endif /* defined (_STDARG_H) || defined (_VARARGS_H) */
diff --git a/contrib/gcc/ginclude/va-clipper.h b/contrib/gcc/ginclude/va-clipper.h
deleted file mode 100644
index 213afca93f02..000000000000
--- a/contrib/gcc/ginclude/va-clipper.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/* GNU C varargs and stdargs support for Clipper. */
-
-/* Define __gnuc_va_list. */
-
-#ifndef __GNUC_VA_LIST
-#define __GNUC_VA_LIST
-
-typedef struct
-{
- int __va_ap; /* pointer to stack args */
- void *__va_reg[4]; /* pointer to r0,f0,r1,f1 */
- int __va_num; /* number of args processed */
-} __gnuc_va_list;
-#endif /* not __GNUC_VA_LIST */
-
-
-#if defined (_STDARG_H) || defined (_VARARGS_H)
-typedef __gnuc_va_list va_list;
-#define __va_list __gnuc_va_list /* acc compatibility */
-
-#define _VA_LIST
-#define _VA_LIST_
-#define _SYS_INT_STDARG_H /* acc compatibility */
-
-/* Call __builtin_next_arg even though we aren't using its value, so that
- we can verify that LASTARG is correct. */
-#ifdef _STDARG_H
-#define va_start(AP,LASTARG) \
- (__builtin_next_arg (LASTARG), \
- (AP) = *(va_list *)__builtin_saveregs(), \
- (AP).__va_num = __builtin_args_info (0), \
- (AP).__va_ap += __builtin_args_info (1))
-#else
-#define va_alist __builtin_va_alist
-/* The ... causes current_function_varargs to be set in cc1. */
-#define va_dcl va_list __builtin_va_alist; ...
-#define va_start(AP) \
- ((AP) = *(va_list *)__builtin_saveregs(), \
- (AP).__va_num = __builtin_args_info (0))
-#endif /* _STDARG_H */
-
-/* round to alignment of `type' but keep a least integer alignment */
-#define __va_round(AP,TYPE) \
- ((AP).__va_ap = ((AP).__va_ap + __alignof__ (TYPE) - 1 ) & \
- ~(__alignof__ (TYPE) - 1), \
- ((AP).__va_ap = ((AP).__va_ap + sizeof (int) - 1) & ~(sizeof (int) - 1)))
-
-#define va_arg(AP, TYPE) \
- (*((AP).__va_num < 2 && __builtin_classify_type (* (TYPE *)0) < 12 \
- ? (__builtin_classify_type (* (TYPE *)0) == 8 \
- ? ((TYPE *)(AP).__va_reg[2 * (AP).__va_num++ + 1]) \
- : ((TYPE *)(AP).__va_reg[2 * (AP).__va_num++ ])) \
- : ((AP).__va_num++, __va_round (AP,TYPE), ((TYPE *)((AP).__va_ap))++)))
-
-#define va_end(AP) ((void) 0)
-
-/* Copy __gnuc_va_list into another variable of this type. */
-#define __va_copy(dest, src) (dest) = (src)
-
-#endif /* defined (_STDARG_H) || defined (_VARARGS_H) */
diff --git a/contrib/gcc/ginclude/va-h8300.h b/contrib/gcc/ginclude/va-h8300.h
deleted file mode 100644
index 9565696e9ad6..000000000000
--- a/contrib/gcc/ginclude/va-h8300.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/* stdarg/vararg support for the Hitachi h8/300 and h8/300h */
-
-/* Define __gnuc_va_list. */
-
-#ifndef __GNUC_VA_LIST
-#define __GNUC_VA_LIST
-typedef void *__gnuc_va_list;
-#endif
-
-/* If this is for internal libc use, don't define anything but
- __gnuc_va_list. */
-#if defined (_STDARG_H) || defined (_VARARGS_H)
-
-/* In GCC version 2, we want an ellipsis at the end of the declaration
- of the argument list. GCC version 1 can't parse it. */
-
-#if __GNUC__ > 1
-#define __va_ellipsis ...
-#else
-#define __va_ellipsis
-#endif
-
-#ifdef __H8300__
-#define __va_rounded_size(TYPE) \
- (((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
-#else
-#define __va_rounded_size(TYPE) \
- (((sizeof (TYPE) + sizeof (long) - 1) / sizeof (long)) * sizeof (long))
-#endif
-
-#ifdef _STDARG_H
-
-#define va_start(AP,LASTARG) \
- (AP = ((__gnuc_va_list) __builtin_next_arg (LASTARG)))
-
-#else /* _VARARGS_H */
-
-#define va_alist __builtin_va_alist
-/* The ... causes current_function_varargs to be set in cc1. */
-#define va_dcl int __builtin_va_alist; __va_ellipsis
-#define va_start(AP) AP = (void *) &__builtin_va_alist
-
-#endif /* _VARARGS_H */
-
-#define va_arg(AP, TYPE) \
- (AP = (__gnuc_va_list) ((char *) (AP) + __va_rounded_size (TYPE)), \
- *((TYPE *) (void *) ((char *) (AP) \
- - ((sizeof (TYPE) < __va_rounded_size (int) \
- ? sizeof (TYPE) : __va_rounded_size (TYPE))))))
-
-#define va_end(AP) ((void) 0)
-
-/* Copy __gnuc_va_list into another variable of this type. */
-#define __va_copy(dest, src) (dest) = (src)
-
-#endif /* defined (_STDARG_H) || defined (_VARARGS_H) */
diff --git a/contrib/gcc/ginclude/va-i860.h b/contrib/gcc/ginclude/va-i860.h
deleted file mode 100644
index 56d2c7fe1d3b..000000000000
--- a/contrib/gcc/ginclude/va-i860.h
+++ /dev/null
@@ -1,214 +0,0 @@
-/* Note: We must use the name __builtin_savregs. GCC attaches special
- significance to that name. In particular, regardless of where in a
- function __builtin_saveregs is called, GCC moves the call up to the
- very start of the function. */
-
-
-/* Define __gnuc_va_list. */
-
-#ifndef __GNUC_VA_LIST
-#define __GNUC_VA_LIST
-
-typedef union {
- float __freg[8];
- double __dreg[4];
-} __f_regs;
-
-typedef struct {
-#if defined (__SVR4__) || defined (__svr4__) || defined (__alliant__) || defined (__PARAGON__)
- __f_regs __float_regs; long __ireg[12];
-#else /* pre-SVR4 */
- long __ireg[12]; __f_regs __float_regs;
-#endif
-} __va_saved_regs;
-
-typedef struct {
-#if defined(__SVR4__) || defined(__svr4__) || defined(__alliant__) || defined (__PARAGON__)
- unsigned __ireg_used; /* How many int regs consumed 'til now? */
- unsigned __freg_used; /* How many flt regs consumed 'til now? */
- long *__reg_base; /* Address of where we stored the regs. */
- long * __mem_ptr; /* Address of memory overflow args area. */
-#else /* pre-SVR4 */
- long *__reg_base; /* Address of where we stored the regs. */
- long * __mem_ptr; /* Address of memory overflow args area. */
- unsigned __ireg_used; /* How many int regs consumed 'til now? */
- unsigned __freg_used; /* How many flt regs consumed 'til now? */
-#endif
-} __gnuc_va_list;
-#endif /* not __GNUC_VA_LIST */
-
-/* If this is for internal libc use, don't define anything but
- __gnuc_va_list. */
-#if defined (_STDARG_H) || defined (_VARARGS_H)
-
-#if !defined(_STDARG_H)
-
-/* varargs support */
-#define va_alist __builtin_va_alist
-#if defined (__PARAGON__)
-#define va_dcl int va_alist;
-#else /* __PARAGON__ */
-#define va_dcl
-#endif /* __PARAGON__ */
-#define va_start(pvar) ((pvar) = * (__gnuc_va_list *) __builtin_saveregs ())
-
-#else /* STDARG.H */
-
-/* ANSI alternative. */
-/* Note that CUMULATIVE_ARGS elements are measured in bytes on the i860,
- so we divide by 4 to get # of registers. */
-#define va_start(pvar, firstarg) \
- ((pvar) = *(__gnuc_va_list *) __builtin_saveregs (), \
- (pvar).__ireg_used = __builtin_args_info (0) / 4, \
- (pvar).__freg_used = __builtin_args_info (1) / 4, \
- (pvar).__mem_ptr = __builtin_next_arg (firstarg))
-
-#endif /* _STDARG_H */
-
-/* Values returned by __builtin_classify_type. */
-
-#ifndef va_end
-enum {
- __no_type_class = -1,
- __void_type_class,
- __integer_type_class,
- __char_type_class,
- __enumeral_type_class,
- __boolean_type_class,
- __pointer_type_class,
- __reference_type_class,
- __offset_type_class,
- __real_type_class,
- __complex_type_class,
- __function_type_class,
- __method_type_class,
- __record_type_class,
- __union_type_class,
- __array_type_class,
- __string_type_class,
- __set_type_class,
- __file_type_class,
- __lang_type_class
-};
-
-void va_end (__gnuc_va_list); /* Defined in libgcc.a */
-#endif
-#define va_end(__va) ((void) 0)
-
-#define __NUM_PARM_FREGS 8
-#define __NUM_PARM_IREGS 12
-
-#define __savereg(__va) ((__va_saved_regs *) ((__va).__reg_base))
-
-/* This macro works both for SVR4 and pre-SVR4 environments. */
-
-/* Note that parameters are always aligned at least to a word boundary
- (when passed) regardless of what GCC's __alignof__ operator says. */
-
-/* Make allowances here for adding 128-bit (long double) floats someday. */
-
-#if 0 /* What was this for? */
-#ifndef __GNU_VA_LIST
-#define __ireg_used ireg_used
-#define __freg_used freg_used
-#define __mem_ptr mem_ptr
-#define __reg_base reg_base
-#endif
-#endif /* 0 */
-
-/* Avoid errors if compiling GCC v2 with GCC v1. */
-#if __GNUC__ == 1
-#define __extension__
-#endif
-
-#define va_arg(__va, __type) \
-__extension__ \
-(* (__type *) \
-({ \
- register void *__rv; /* result value */ \
- register unsigned __align; \
- switch (__builtin_classify_type (* (__type *) 0)) \
- { \
- case __real_type_class: \
- switch (sizeof (__type)) \
- { \
- case sizeof (float): \
- case sizeof (double): \
- if ((__va).__freg_used < __NUM_PARM_FREGS - 1) \
- { \
- if (((__va).__freg_used & 1) != 0) \
- (__va).__freg_used++; /* skip odd */ \
- __rv = &__savereg((__va))->__float_regs.__freg[(__va).__freg_used];\
- (__va).__freg_used += 2; \
- } \
- else \
- { \
- if ((((unsigned) (__va).__mem_ptr) & (sizeof(double)-1)) != 0) \
- (__va).__mem_ptr++; /* skip odd */ \
- __rv = (__va).__mem_ptr; \
- (__va).__mem_ptr += 2; \
- } \
- if (sizeof (__type) == sizeof (float)) \
- { \
- *((float *) __rv) = *((double *) __rv); \
- *(((long *) __rv) + 1) = 0xfff00001; \
- } \
- break; \
- default: \
- abort (); \
- } \
- break; \
- case __void_type_class: \
- case __integer_type_class: \
- case __char_type_class: \
- case __enumeral_type_class: \
- case __boolean_type_class: \
- case __pointer_type_class: \
- case __reference_type_class: \
- case __offset_type_class: \
- if (sizeof (__type) <= 4) \
- { \
- __rv = ((__va).__ireg_used < __NUM_PARM_IREGS \
- ? (&__savereg((__va))->__ireg[(__va).__ireg_used++]) \
- : (__va).__mem_ptr++); \
- break; \
- } \
- else if ((__va).__ireg_used + sizeof (__type) / 4 <= __NUM_PARM_IREGS) \
- { \
- __rv = &__savereg((__va))->__ireg[(__va).__ireg_used]; \
- (__va).__ireg_used += sizeof (__type) / 4; \
- break; \
- } \
- /* Fall through to fetch from memory. */ \
- case __record_type_class: \
- case __union_type_class: \
- __align = (__alignof__ (__type) < sizeof (long) \
- ? sizeof (long) \
- : __alignof__ (__type)); \
- (__va).__mem_ptr \
- = (long *) \
- ((((unsigned) (__va).__mem_ptr) + (__align-1)) & ~(__align-1)); \
- __rv = (__va).__mem_ptr; \
- (__va).__mem_ptr \
- += ((sizeof (__type) + sizeof (long) - 1) / sizeof (long)); \
- break; \
- case __complex_type_class: \
- case __function_type_class: \
- case __method_type_class: \
- case __array_type_class: \
- case __string_type_class: \
- case __set_type_class: \
- case __file_type_class: \
- case __lang_type_class: \
- case __no_type_class: \
- default: \
- abort (); \
- } \
- __rv; \
-}))
-
-/* Copy __gnuc_va_list into another variable of this type. */
-#define __va_copy(dest, src) (dest) = (src)
-
-#endif /* defined (_STDARG_H) || defined (_VARARGS_H) */
-
diff --git a/contrib/gcc/ginclude/va-i960.h b/contrib/gcc/ginclude/va-i960.h
deleted file mode 100644
index 5588d4112917..000000000000
--- a/contrib/gcc/ginclude/va-i960.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/* GNU C varargs support for the Intel 80960. */
-
-/* Define __gnuc_va_list. */
-
-#ifndef __GNUC_VA_LIST
-#define __GNUC_VA_LIST
-/* The first element is the address of the first argument.
- The second element is the number of bytes skipped past so far. */
-typedef unsigned __gnuc_va_list[2];
-#endif /* not __GNUC_VA_LIST */
-
-/* If this is for internal libc use, don't define anything but
- __gnuc_va_list. */
-#if defined (_STDARG_H) || defined (_VARARGS_H)
-
-/* In GCC version 2, we want an ellipsis at the end of the declaration
- of the argument list. GCC version 1 can't parse it. */
-
-#if __GNUC__ > 1
-#define __va_ellipsis ...
-#else
-#define __va_ellipsis
-#endif
-
-/* The stack size of the type t. */
-#define __vsiz(T) (((sizeof (T) + 3) / 4) * 4)
-/* The stack alignment of the type t. */
-#define __vali(T) (__alignof__ (T) >= 4 ? __alignof__ (T) : 4)
-/* The offset of the next stack argument after one of type t at offset i. */
-#define __vpad(I, T) ((((I) + __vali (T) - 1) / __vali (T)) \
- * __vali (T) + __vsiz (T))
-
-/* Avoid errors if compiling GCC v2 with GCC v1. */
-#if __GNUC__ == 1
-#define __extension__
-#endif
-
-#ifdef _STDARG_H
-/* Call __builtin_next_arg even though we aren't using its value, so that
- we can verify that firstarg is correct. */
-#define va_start(AP, LASTARG) \
-__extension__ \
-({ __builtin_next_arg (LASTARG); \
- __asm__ ("st g14,%0" : "=m" (*(AP))); \
- (AP)[1] = (__builtin_args_info (0) + __builtin_args_info (1)) * 4; })
-
-#else
-
-#define va_alist __builtin_va_alist
-#define va_dcl char *__builtin_va_alist; __va_ellipsis
-#define va_start(AP) \
-__extension__ \
-({ __asm__ ("st g14,%0" : "=m" (*(AP))); \
- (AP)[1] = (__builtin_args_info (0) + __builtin_args_info (1)) * 4; })
-#endif
-
-/* We cast to void * and then to TYPE * because this avoids
- a warning about increasing the alignment requirement. */
-#define va_arg(AP, T) \
-( \
- ( \
- ((AP)[1] <= 48 && (__vpad ((AP)[1], T) > 48 || __vsiz (T) > 16)) \
- ? ((AP)[1] = 48 + __vsiz (T)) \
- : ((AP)[1] = __vpad ((AP)[1], T)) \
- ), \
- \
- *((T *) (void *) ((char *) *(AP) + (AP)[1] - __vsiz (T))) \
-)
-
-#ifndef va_end
-void va_end (__gnuc_va_list); /* Defined in libgcc.a */
-#endif
-#define va_end(AP) ((void) 0)
-
-/* Copy __gnuc_va_list into another variable of this type. */
-#define __va_copy(dest, src) (dest) = (src)
-
-#endif /* defined (_STDARG_H) || defined (_VARARGS_H) */
-
diff --git a/contrib/gcc/ginclude/va-m32r.h b/contrib/gcc/ginclude/va-m32r.h
deleted file mode 100644
index 4ef0ad8267a8..000000000000
--- a/contrib/gcc/ginclude/va-m32r.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/* GNU C stdarg/varargs support for the M32R */
-
-/* Define __gnuc_va_list. */
-#ifndef __GNUC_VA_LIST
-#define __GNUC_VA_LIST
-typedef void *__gnuc_va_list;
-#endif /* not __GNUC_VA_LIST */
-
-/* If this is for internal libc use, don't define anything but
- __gnuc_va_list. */
-#if defined (_STDARG_H) || defined (_VARARGS_H)
-
-/* Common code for va_start for both varargs and stdarg. */
-
-#define __va_rounded_size(TYPE) \
- (((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
-
-#ifdef _STDARG_H /* stdarg.h support */
-
-/* Calling __builtin_next_arg gives the proper error message if LASTARG is
- not indeed the last argument. */
-#define va_start(AP, LASTARG) \
- (AP = ((__gnuc_va_list) __builtin_next_arg (LASTARG)))
-
-#else /* varargs.h support */
-
-#define va_alist __builtin_va_alist
-/* The ... causes current_function_varargs to be set in cc1. */
-#define va_dcl int __builtin_va_alist; ...
-#define va_start(AP) AP=(char *) &__builtin_va_alist
-
-#endif /* _STDARG_H */
-
-/* Nothing needs to be done to end varargs/stdarg processing */
-#define va_end(AP) ((void) 0)
-
-/* Values returned by __builtin_classify_type. */
-enum __type_class
-{
- __no_type_class = -1,
- __void_type_class,
- __integer_type_class,
- __char_type_class,
- __enumeral_type_class,
- __boolean_type_class,
- __pointer_type_class,
- __reference_type_class,
- __offset_type_class,
- __real_type_class,
- __complex_type_class,
- __function_type_class,
- __method_type_class,
- __record_type_class,
- __union_type_class,
- __array_type_class,
- __string_type_class,
- __set_type_class,
- __file_type_class,
- __lang_type_class
-};
-
-/* Return whether a type is passed by reference. */
-#define __va_by_reference_p(TYPE) (sizeof (TYPE) > 8)
-
-#define va_arg(AP,TYPE) \
-__extension__ (*({ \
- register TYPE *__ptr; \
- \
- if (__va_by_reference_p (TYPE)) \
- { \
- __ptr = *(TYPE **)(void *) (AP); \
- (AP) = (__gnuc_va_list) ((char *) (AP) + sizeof (void *)); \
- } \
- else \
- { \
- __ptr = (TYPE *)(void *) \
- ((char *) (AP) + (sizeof (TYPE) < __va_rounded_size (char) \
- ? __va_rounded_size (TYPE) - sizeof (TYPE) \
- : 0)); \
- (AP) = (__gnuc_va_list) ((char *) (AP) + __va_rounded_size (TYPE)); \
- } \
- \
- __ptr; \
-}))
-
-#endif /* defined (_STDARG_H) || defined (_VARARGS_H) */
diff --git a/contrib/gcc/ginclude/va-m88k.h b/contrib/gcc/ginclude/va-m88k.h
deleted file mode 100644
index 0a20d84501ce..000000000000
--- a/contrib/gcc/ginclude/va-m88k.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/* GNU C varargs support for the Motorola 88100 */
-
-/* Define __gnuc_va_list. */
-
-#ifndef __GNUC_VA_LIST
-#define __GNUC_VA_LIST
-
-typedef struct
-{
- int __va_arg; /* argument number */
- int *__va_stk; /* start of args passed on stack */
- int *__va_reg; /* start of args passed in regs */
-} __gnuc_va_list;
-#endif /* not __GNUC_VA_LIST */
-
-/* If this is for internal libc use, don't define anything but
- __gnuc_va_list. */
-#if defined (_STDARG_H) || defined (_VARARGS_H)
-
-#ifdef _STDARG_H /* stdarg.h support */
-
-/* Call __builtin_next_arg even though we aren't using its value, so that
- we can verify that LASTARG is correct. */
-#if __GNUC__ > 1 /* GCC 2.0 and beyond */
-#define va_start(AP,LASTARG) \
- (__builtin_next_arg (LASTARG), \
- (AP) = *(__gnuc_va_list *)__builtin_saveregs())
-#else
-#define va_start(AP,LASTARG) \
- ( (AP).__va_reg = (int *) __builtin_saveregs2(0), \
- (AP).__va_stk = (int *) __builtin_argptr(), \
- (AP).__va_arg = (int) (__builtin_argsize() + 3) / 4 )
-#endif
-
-#else /* varargs.h support */
-
-#if __GNUC__ > 1 /* GCC 2.0 and beyond */
-#define va_start(AP) ((AP) = *(__gnuc_va_list *)__builtin_saveregs())
-#else
-#define va_start(AP) \
- ( (AP).__va_reg = (int *) __builtin_saveregs2(1), \
- (AP).__va_stk = (int *) __builtin_argptr(), \
- (AP).__va_arg = (int) (__builtin_argsize() - 4 + 3) / 4 )
-#endif
-#define va_alist __va_1st_arg
-#define va_dcl register int va_alist;...
-
-#endif /* _STDARG_H */
-
-/* Avoid trouble between this file and _int_varargs.h under DG/UX. This file
- can be included by <stdio.h> and others and provides definitions of
- __va_size and __va_reg_p and a va_list typedef. Avoid defining va_list
- again with _VA_LIST. */
-#ifdef __INT_VARARGS_H
-#undef __va_size
-#undef __va_reg_p
-#define __gnuc_va_list va_list
-#define _VA_LIST
-#define _VA_LIST_
-#else
-/* Similarly, if this gets included first, do nothing in _int_varargs.h. */
-#define __INT_VARARGS_H
-#endif
-
-#define __va_reg_p(TYPE) \
- (__builtin_classify_type(*(TYPE *)0) < 12 \
- ? sizeof(TYPE) <= 8 : sizeof(TYPE) == 4 && __alignof__(TYPE) == 4)
-
-#define __va_size(TYPE) ((sizeof(TYPE) + 3) >> 2)
-
-/* We cast to void * and then to TYPE * because this avoids
- a warning about increasing the alignment requirement. */
-#define va_arg(AP,TYPE) \
- ( (AP).__va_arg = (((AP).__va_arg + (1 << (__alignof__(TYPE) >> 3)) - 1) \
- & ~((1 << (__alignof__(TYPE) >> 3)) - 1)) \
- + __va_size(TYPE), \
- *((TYPE *) (void *) ((__va_reg_p(TYPE) \
- && (AP).__va_arg < 8 + __va_size(TYPE) \
- ? (AP).__va_reg : (AP).__va_stk) \
- + ((AP).__va_arg - __va_size(TYPE)))))
-
-#define va_end(AP) ((void)0)
-
-/* Copy __gnuc_va_list into another variable of this type. */
-#define __va_copy(dest, src) (dest) = (src)
-
-#endif /* defined (_STDARG_H) || defined (_VARARGS_H) */
diff --git a/contrib/gcc/ginclude/va-mips.h b/contrib/gcc/ginclude/va-mips.h
deleted file mode 100644
index 96db5b466cc3..000000000000
--- a/contrib/gcc/ginclude/va-mips.h
+++ /dev/null
@@ -1,277 +0,0 @@
-/* ---------------------------------------- */
-/* VARARGS for MIPS/GNU CC */
-/* */
-/* */
-/* */
-/* */
-/* ---------------------------------------- */
-
-
-/* These macros implement varargs for GNU C--either traditional or ANSI. */
-
-/* Define __gnuc_va_list. */
-
-#ifndef __GNUC_VA_LIST
-#define __GNUC_VA_LIST
-#if defined (__mips_eabi) && ! defined (__mips_soft_float) && ! defined (__mips_single_float)
-
-typedef struct {
- /* Pointer to FP regs. */
- char *__fp_regs;
- /* Number of FP regs remaining. */
- int __fp_left;
- /* Pointer to GP regs followed by stack parameters. */
- char *__gp_regs;
-} __gnuc_va_list;
-
-#else /* ! (defined (__mips_eabi) && ! defined (__mips_soft_float) && ! defined (__mips_single_float)) */
-
-typedef char * __gnuc_va_list;
-
-#endif /* ! (defined (__mips_eabi) && ! defined (__mips_soft_float) && ! defined (__mips_single_float)) */
-#endif /* not __GNUC_VA_LIST */
-
-/* If this is for internal libc use, don't define anything but
- __gnuc_va_list. */
-#if defined (_STDARG_H) || defined (_VARARGS_H)
-
-#ifndef _VA_MIPS_H_ENUM
-#define _VA_MIPS_H_ENUM
-enum {
- __no_type_class = -1,
- __void_type_class,
- __integer_type_class,
- __char_type_class,
- __enumeral_type_class,
- __boolean_type_class,
- __pointer_type_class,
- __reference_type_class,
- __offset_type_class,
- __real_type_class,
- __complex_type_class,
- __function_type_class,
- __method_type_class,
- __record_type_class,
- __union_type_class,
- __array_type_class,
- __string_type_class,
- __set_type_class,
- __file_type_class,
- __lang_type_class
-};
-#endif
-
-/* In GCC version 2, we want an ellipsis at the end of the declaration
- of the argument list. GCC version 1 can't parse it. */
-
-#if __GNUC__ > 1
-#define __va_ellipsis ...
-#else
-#define __va_ellipsis
-#endif
-
-#ifdef __mips64
-#define __va_rounded_size(__TYPE) \
- (((sizeof (__TYPE) + 8 - 1) / 8) * 8)
-#else
-#define __va_rounded_size(__TYPE) \
- (((sizeof (__TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
-#endif
-
-#ifdef __mips64
-#define __va_reg_size 8
-#else
-#define __va_reg_size 4
-#endif
-
-/* Get definitions for _MIPS_SIM_ABI64 etc. */
-#ifdef _MIPS_SIM
-#include <sgidefs.h>
-#endif
-
-#ifdef _STDARG_H
-#if defined (__mips_eabi)
-#if ! defined (__mips_soft_float) && ! defined (__mips_single_float)
-#ifdef __mips64
-#define va_start(__AP, __LASTARG) \
- (__AP.__gp_regs = ((char *) __builtin_next_arg (__LASTARG) \
- - (__builtin_args_info (2) < 8 \
- ? (8 - __builtin_args_info (2)) * __va_reg_size \
- : 0)), \
- __AP.__fp_left = 8 - __builtin_args_info (3), \
- __AP.__fp_regs = __AP.__gp_regs - __AP.__fp_left * __va_reg_size)
-#else /* ! defined (__mips64) */
-#define va_start(__AP, __LASTARG) \
- (__AP.__gp_regs = ((char *) __builtin_next_arg (__LASTARG) \
- - (__builtin_args_info (2) < 8 \
- ? (8 - __builtin_args_info (2)) * __va_reg_size \
- : 0)), \
- __AP.__fp_left = (8 - __builtin_args_info (3)) / 2, \
- __AP.__fp_regs = __AP.__gp_regs - __AP.__fp_left * 8, \
- __AP.__fp_regs = (char *) ((int) __AP.__fp_regs & -8))
-#endif /* ! defined (__mips64) */
-#else /* ! (! defined (__mips_soft_float) && ! defined (__mips_single_float) ) */
-#define va_start(__AP, __LASTARG) \
- (__AP = ((__gnuc_va_list) __builtin_next_arg (__LASTARG) \
- - (__builtin_args_info (2) >= 8 ? 0 \
- : (8 - __builtin_args_info (2)) * __va_reg_size)))
-#endif /* ! (! defined (__mips_soft_float) && ! defined (__mips_single_float) ) */
-#else /* ! defined (__mips_eabi) */
-#define va_start(__AP, __LASTARG) \
- (__AP = (__gnuc_va_list) __builtin_next_arg (__LASTARG))
-#endif /* ! (defined (__mips_eabi) && ! defined (__mips_soft_float) && ! defined (__mips_single_float)) */
-#else /* ! _STDARG_H */
-#define va_alist __builtin_va_alist
-#ifdef __mips64
-/* This assumes that `long long int' is always a 64 bit type. */
-#define va_dcl long long int __builtin_va_alist; __va_ellipsis
-#else
-#define va_dcl int __builtin_va_alist; __va_ellipsis
-#endif
-#if defined (__mips_eabi)
-#if ! defined (__mips_soft_float) && ! defined (__mips_single_float)
-#ifdef __mips64
-#define va_start(__AP) \
- (__AP.__gp_regs = ((char *) __builtin_next_arg () \
- - (__builtin_args_info (2) < 8 \
- ? (8 - __builtin_args_info (2)) * __va_reg_size \
- : __va_reg_size)), \
- __AP.__fp_left = 8 - __builtin_args_info (3), \
- __AP.__fp_regs = __AP.__gp_regs - __AP.__fp_left * __va_reg_size)
-#else /* ! defined (__mips64) */
-#define va_start(__AP) \
- (__AP.__gp_regs = ((char *) __builtin_next_arg () \
- - (__builtin_args_info (2) < 8 \
- ? (8 - __builtin_args_info (2)) * __va_reg_size \
- : __va_reg_size)), \
- __AP.__fp_left = (8 - __builtin_args_info (3)) / 2, \
- __AP.__fp_regs = __AP.__gp_regs - __AP.__fp_left * 8, \
- __AP.__fp_regs = (char *) ((int) __AP.__fp_regs & -8))
-#endif /* ! defined (__mips64) */
-#else /* ! (! defined (__mips_soft_float) && ! defined (__mips_single_float)) */
-#define va_start(__AP) \
- (__AP = ((__gnuc_va_list) __builtin_next_arg () \
- - (__builtin_args_info (2) >= 8 ? __va_reg_size \
- : (8 - __builtin_args_info (2)) * __va_reg_size)))
-#endif /* ! (! defined (__mips_soft_float) && ! defined (__mips_single_float)) */
-/* Need alternate code for _MIPS_SIM_ABI64. */
-#elif defined(_MIPS_SIM) && (_MIPS_SIM == _MIPS_SIM_ABI64 || _MIPS_SIM == _MIPS_SIM_NABI32)
-#define va_start(__AP) \
- (__AP = (__gnuc_va_list) __builtin_next_arg () \
- + (__builtin_args_info (2) >= 8 ? -8 : 0))
-#else
-#define va_start(__AP) __AP = (char *) &__builtin_va_alist
-#endif
-#endif /* ! _STDARG_H */
-
-#ifndef va_end
-void va_end (__gnuc_va_list); /* Defined in libgcc.a */
-#endif
-#define va_end(__AP) ((void)0)
-
-#if defined (__mips_eabi)
-
-#if ! defined (__mips_soft_float) && ! defined (__mips_single_float)
-#ifdef __mips64
-#define __va_next_addr(__AP, __type) \
- ((__builtin_classify_type (*(__type *) 0) == __real_type_class \
- && __AP.__fp_left > 0) \
- ? (--__AP.__fp_left, (__AP.__fp_regs += 8) - 8) \
- : (__AP.__gp_regs += __va_reg_size) - __va_reg_size)
-#else
-#define __va_next_addr(__AP, __type) \
- ((__builtin_classify_type (*(__type *) 0) == __real_type_class \
- && __AP.__fp_left > 0) \
- ? (--__AP.__fp_left, (__AP.__fp_regs += 8) - 8) \
- : (((__builtin_classify_type (* (__type *) 0) < __record_type_class \
- && __alignof__ (__type) > 4) \
- ? __AP.__gp_regs = (char *) (((int) __AP.__gp_regs + 8 - 1) & -8) \
- : (char *) 0), \
- (__builtin_classify_type (* (__type *) 0) >= __record_type_class \
- ? (__AP.__gp_regs += __va_reg_size) - __va_reg_size \
- : ((__AP.__gp_regs += __va_rounded_size (__type)) \
- - __va_rounded_size (__type)))))
-#endif
-#else /* ! (! defined (__mips_soft_float) && ! defined (__mips_single_float)) */
-#ifdef __mips64
-#define __va_next_addr(__AP, __type) \
- ((__AP += __va_reg_size) - __va_reg_size)
-#else
-#define __va_next_addr(__AP, __type) \
- (((__builtin_classify_type (* (__type *) 0) < __record_type_class \
- && __alignof__ (__type) > 4) \
- ? __AP = (char *) (((__PTRDIFF_TYPE__) __AP + 8 - 1) & -8) \
- : (char *) 0), \
- (__builtin_classify_type (* (__type *) 0) >= __record_type_class \
- ? (__AP += __va_reg_size) - __va_reg_size \
- : ((__AP += __va_rounded_size (__type)) \
- - __va_rounded_size (__type))))
-#endif
-#endif /* ! (! defined (__mips_soft_float) && ! defined (__mips_single_float)) */
-
-#ifdef __MIPSEB__
-#define va_arg(__AP, __type) \
- ((__va_rounded_size (__type) <= __va_reg_size) \
- ? *(__type *) (void *) (__va_next_addr (__AP, __type) \
- + __va_reg_size \
- - sizeof (__type)) \
- : (__builtin_classify_type (*(__type *) 0) >= __record_type_class \
- ? **(__type **) (void *) (__va_next_addr (__AP, __type) \
- + __va_reg_size \
- - sizeof (char *)) \
- : *(__type *) (void *) __va_next_addr (__AP, __type)))
-#else
-#define va_arg(__AP, __type) \
- ((__va_rounded_size (__type) <= __va_reg_size) \
- ? *(__type *) (void *) __va_next_addr (__AP, __type) \
- : (__builtin_classify_type (* (__type *) 0) >= __record_type_class \
- ? **(__type **) (void *) __va_next_addr (__AP, __type) \
- : *(__type *) (void *) __va_next_addr (__AP, __type)))
-#endif
-
-#else /* ! defined (__mips_eabi) */
-
-/* We cast to void * and then to TYPE * because this avoids
- a warning about increasing the alignment requirement. */
-/* The __mips64 cases are reversed from the 32 bit cases, because the standard
- 32 bit calling convention left-aligns all parameters smaller than a word,
- whereas the __mips64 calling convention does not (and hence they are
- right aligned). */
-#ifdef __mips64
-#ifdef __MIPSEB__
-#define va_arg(__AP, __type) \
- ((__type *) (void *) (__AP = (char *) \
- ((((__PTRDIFF_TYPE__)__AP + 8 - 1) & -8) \
- + __va_rounded_size (__type))))[-1]
-#else
-#define va_arg(__AP, __type) \
- ((__AP = (char *) ((((__PTRDIFF_TYPE__)__AP + 8 - 1) & -8) \
- + __va_rounded_size (__type))), \
- *(__type *) (void *) (__AP - __va_rounded_size (__type)))
-#endif
-
-#else /* not __mips64 */
-
-#ifdef __MIPSEB__
-/* For big-endian machines. */
-#define va_arg(__AP, __type) \
- ((__AP = (char *) ((__alignof__ (__type) > 4 \
- ? ((__PTRDIFF_TYPE__)__AP + 8 - 1) & -8 \
- : ((__PTRDIFF_TYPE__)__AP + 4 - 1) & -4) \
- + __va_rounded_size (__type))), \
- *(__type *) (void *) (__AP - __va_rounded_size (__type)))
-#else
-/* For little-endian machines. */
-#define va_arg(__AP, __type) \
- ((__type *) (void *) (__AP = (char *) ((__alignof__(__type) > 4 \
- ? ((__PTRDIFF_TYPE__)__AP + 8 - 1) & -8 \
- : ((__PTRDIFF_TYPE__)__AP + 4 - 1) & -4) \
- + __va_rounded_size(__type))))[-1]
-#endif
-#endif
-#endif /* ! defined (__mips_eabi) */
-
-/* Copy __gnuc_va_list into another variable of this type. */
-#define __va_copy(dest, src) (dest) = (src)
-
-#endif /* defined (_STDARG_H) || defined (_VARARGS_H) */
diff --git a/contrib/gcc/ginclude/va-mn10200.h b/contrib/gcc/ginclude/va-mn10200.h
deleted file mode 100644
index b458b56e0beb..000000000000
--- a/contrib/gcc/ginclude/va-mn10200.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* CYGNUS LOCAL entire file/law */
-/* Define __gnuc_va_list. */
-
-#ifndef __GNUC_VA_LIST
-#define __GNUC_VA_LIST
-typedef void *__gnuc_va_list;
-#endif /* not __GNUC_VA_LIST */
-
-/* If this is for internal libc use, don't define anything but
- __gnuc_va_list. */
-#if defined (_STDARG_H) || defined (_VARARGS_H)
-#define __gnuc_va_start(AP) (AP = (__gnuc_va_list)__builtin_saveregs())
-#define __va_ellipsis ...
-
-#ifdef _STDARG_H
-#define va_start(AP, LASTARG) \
- (AP = ((__gnuc_va_list) __builtin_next_arg (LASTARG)))
-#else
-#define va_alist __builtin_va_alist
-#define va_dcl int __builtin_va_alist; __va_ellipsis
-#define va_start(AP) AP=(char *) &__builtin_va_alist
-#endif
-
-/* Now stuff common to both varargs & stdarg implementations. */
-#define __va_rounded_size(TYPE) \
- (((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
-#undef va_end
-void va_end (__gnuc_va_list);
-#define va_end(AP) ((void)0)
-#define va_arg(AP, TYPE) \
- (sizeof (TYPE) > 8 \
- ? (AP = (__gnuc_va_list) ((char *) (AP) + __va_rounded_size (char *)),\
- **((TYPE **) (void *) ((char *) (AP) - __va_rounded_size (char *))))\
- : (AP = (__gnuc_va_list) ((char *) (AP) + __va_rounded_size (TYPE)), \
- *((TYPE *) (void *) ((char *) (AP) - __va_rounded_size (TYPE)))))
-#endif
-/* END CYGNUS LOCAL */
diff --git a/contrib/gcc/ginclude/va-mn10300.h b/contrib/gcc/ginclude/va-mn10300.h
deleted file mode 100644
index e156ccf5939b..000000000000
--- a/contrib/gcc/ginclude/va-mn10300.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Define __gnuc_va_list. */
-
-#ifndef __GNUC_VA_LIST
-#define __GNUC_VA_LIST
-typedef void *__gnuc_va_list;
-#endif /* not __GNUC_VA_LIST */
-
-/* If this is for internal libc use, don't define anything but
- __gnuc_va_list. */
-#if defined (_STDARG_H) || defined (_VARARGS_H)
-#define __gnuc_va_start(AP) (AP = (__gnuc_va_list)__builtin_saveregs())
-#define __va_ellipsis ...
-
-#ifdef _STDARG_H
-#define va_start(AP, LASTARG) \
- (__builtin_next_arg (LASTARG), __gnuc_va_start (AP))
-#else
-#define va_alist __builtin_va_alist
-#define va_dcl int __builtin_va_alist; __va_ellipsis
-#define va_start(AP) AP=(char *) &__builtin_va_alist
-#endif
-
-/* Now stuff common to both varargs & stdarg implementations. */
-#define __va_rounded_size(TYPE) \
- (((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
-#undef va_end
-void va_end (__gnuc_va_list);
-#define va_end(AP) ((void)0)
-#define va_arg(AP, TYPE) \
- (sizeof (TYPE) > 8 \
- ? (AP = (__gnuc_va_list) ((char *) (AP) + __va_rounded_size (char *)),\
- **((TYPE **) (void *) ((char *) (AP) - __va_rounded_size (char *))))\
- : (AP = (__gnuc_va_list) ((char *) (AP) + __va_rounded_size (TYPE)), \
- *((TYPE *) (void *) ((char *) (AP) - __va_rounded_size (TYPE)))))
-#endif
diff --git a/contrib/gcc/ginclude/va-pa.h b/contrib/gcc/ginclude/va-pa.h
deleted file mode 100644
index 4865f6bfac08..000000000000
--- a/contrib/gcc/ginclude/va-pa.h
+++ /dev/null
@@ -1,52 +0,0 @@
-
-/* Define __gnuc_va_list. */
-
-#ifndef __GNUC_VA_LIST
-#define __GNUC_VA_LIST
-
-typedef void *__gnuc_va_list;
-#endif /* not __GNUC_VA_LIST */
-
-/* If this is for internal libc use, don't define anything but
- __gnuc_va_list. */
-#if defined (_STDARG_H) || defined (_VARARGS_H)
-#if __GNUC__ > 1
-#define __va_ellipsis ...
-#define __gnuc_va_start(AP) ((AP) = (va_list)__builtin_saveregs())
-#else
-#define va_alist __va_a__, __va_b__, __va_c__, __va_d__
-#define __va_ellipsis
-#define __gnuc_va_start(AP)\
- (AP) = (double *) &__va_a__, &__va_b__, &__va_c__, &__va_d__, \
- (AP) = (double *)((char *)(AP) + 4)
-#endif /* __GNUC__ > 1 */
-
-/* Call __builtin_next_arg even though we aren't using its value, so that
- we can verify that LASTARG is correct. */
-#ifdef _STDARG_H
-#define va_start(AP,LASTARG) \
- (__builtin_next_arg (LASTARG), __gnuc_va_start (AP))
-#else
-/* The ... causes current_function_varargs to be set in cc1. */
-#define va_dcl long va_alist; __va_ellipsis
-#define va_start(AP) __gnuc_va_start (AP)
-#endif
-
-#define va_arg(AP,TYPE) \
- (*(sizeof(TYPE) > 8 ? \
- ((AP = (__gnuc_va_list) ((char *)AP - sizeof (int))), \
- (((TYPE *) (void *) (*((int *) (AP)))))) \
- :((AP = \
- (__gnuc_va_list) ((long)((char *)AP - sizeof (TYPE)) \
- & (sizeof(TYPE) > 4 ? ~0x7 : ~0x3))), \
- (((TYPE *) (void *) ((char *)AP + ((8 - sizeof(TYPE)) % 4)))))))
-
-#ifndef va_end
-void va_end (__gnuc_va_list); /* Defined in libgcc.a */
-#endif
-#define va_end(AP) ((void)0)
-
-/* Copy __gnuc_va_list into another variable of this type. */
-#define __va_copy(dest, src) (dest) = (src)
-
-#endif /* defined (_STDARG_H) || defined (_VARARGS_H) */
diff --git a/contrib/gcc/ginclude/va-ppc.h b/contrib/gcc/ginclude/va-ppc.h
deleted file mode 100644
index de299b59cf9f..000000000000
--- a/contrib/gcc/ginclude/va-ppc.h
+++ /dev/null
@@ -1,255 +0,0 @@
-/* GNU C varargs support for the PowerPC with either the V.4 or Windows NT calling sequences */
-
-#ifndef _WIN32
-/* System V.4 support */
-/* Define __gnuc_va_list. */
-
-#ifndef __GNUC_VA_LIST
-#define __GNUC_VA_LIST
-
-#ifndef _SYS_VA_LIST_H
-#define _SYS_VA_LIST_H /* Solaris sys/va_list.h */
-
-/* Solaris decided to rename overflow_arg_area to input_arg_area,
- so handle it via a macro. */
-#define __va_overflow(AP) (AP)->overflow_arg_area
-
-/* Note that the names in this structure are in the user's namespace, but
- that the V.4 abi explicitly states that these names should be used. */
-typedef struct __va_list_tag {
- unsigned char gpr; /* index into the array of 8 GPRs stored in the
- register save area gpr=0 corresponds to r3,
- gpr=1 to r4, etc. */
- unsigned char fpr; /* index into the array of 8 FPRs stored in the
- register save area fpr=0 corresponds to f1,
- fpr=1 to f2, etc. */
- char *overflow_arg_area; /* location on stack that holds the next
- overflow argument */
- char *reg_save_area; /* where r3:r10 and f1:f8, if saved are stored */
-} __va_list[1], __gnuc_va_list[1];
-
-#else /* _SYS_VA_LIST */
-
-typedef __va_list __gnuc_va_list;
-#define __va_overflow(AP) (AP)->input_arg_area
-
-#endif /* not _SYS_VA_LIST */
-#endif /* not __GNUC_VA_LIST */
-
-/* If this is for internal libc use, don't define anything but
- __gnuc_va_list. */
-#if defined (_STDARG_H) || defined (_VARARGS_H)
-
-/* Register save area located below the frame pointer */
-#ifndef __VA_PPC_H__
-#define __VA_PPC_H__
-typedef struct {
- long __gp_save[8]; /* save area for GP registers */
- double __fp_save[8]; /* save area for FP registers */
-} __va_regsave_t;
-
-/* Macros to access the register save area */
-/* We cast to void * and then to TYPE * because this avoids
- a warning about increasing the alignment requirement. */
-#define __VA_FP_REGSAVE(AP,OFS,TYPE) \
- ((TYPE *) (void *) (&(((__va_regsave_t *) \
- (AP)->reg_save_area)->__fp_save[OFS])))
-
-#define __VA_GP_REGSAVE(AP,OFS,TYPE) \
- ((TYPE *) (void *) (&(((__va_regsave_t *) \
- (AP)->reg_save_area)->__gp_save[OFS])))
-
-/* Common code for va_start for both varargs and stdarg. We allow all
- the work to be done by __builtin_saveregs. It returns a pointer to
- a va_list that was constructed on the stack; we must simply copy it
- to the user's variable. */
-
-#define __va_start_common(AP, FAKE) \
- __builtin_memcpy ((AP), __builtin_saveregs (), sizeof(__gnuc_va_list))
-
-#ifdef _STDARG_H /* stdarg.h support */
-
-/* Calling __builtin_next_arg gives the proper error message if LASTARG is
- not indeed the last argument. */
-#define va_start(AP,LASTARG) \
- (__builtin_next_arg (LASTARG), __va_start_common (AP, 0))
-
-#else /* varargs.h support */
-
-#define va_start(AP) __va_start_common (AP, 1)
-#define va_alist __va_1st_arg
-#define va_dcl register int va_alist; ...
-
-#endif /* _STDARG_H */
-
-#ifdef _SOFT_FLOAT
-#define __va_float_p(TYPE) 0
-#else
-#define __va_float_p(TYPE) (__builtin_classify_type(*(TYPE *)0) == 8)
-#endif
-
-#define __va_aggregate_p(TYPE) (__builtin_classify_type(*(TYPE *)0) >= 12)
-#define __va_size(TYPE) ((sizeof(TYPE) + sizeof (long) - 1) / sizeof (long))
-
-/* This symbol isn't defined. It is used to flag type promotion violations
- at link time. We can only do this when optimizing. Use __builtin_trap
- instead of abort so that we don't require a prototype for abort.
-
- __builtin_trap stuff is not available on the gcc-2.95 branch, so we just
- avoid calling it for now. */
-
-#ifdef __OPTIMIZE__
-extern void __va_arg_type_violation(void) __attribute__((__noreturn__));
-#else
-#define __va_arg_type_violation()
-#endif
-
-#define va_arg(AP,TYPE) \
-__extension__ (*({ \
- register TYPE *__ptr; \
- \
- if (__va_float_p (TYPE) && sizeof (TYPE) < 16) \
- { \
- unsigned char __fpr = (AP)->fpr; \
- if (__fpr < 8) \
- { \
- __ptr = __VA_FP_REGSAVE (AP, __fpr, TYPE); \
- (AP)->fpr = __fpr + 1; \
- } \
- else if (sizeof (TYPE) == 8) \
- { \
- unsigned long __addr = (unsigned long) (__va_overflow (AP)); \
- __ptr = (TYPE *)((__addr + 7) & -8); \
- __va_overflow (AP) = (char *)(__ptr + 1); \
- } \
- else \
- { \
- /* float is promoted to double. */ \
- __va_arg_type_violation (); \
- } \
- } \
- \
- /* Aggregates and long doubles are passed by reference. */ \
- else if (__va_aggregate_p (TYPE) || __va_float_p (TYPE)) \
- { \
- unsigned char __gpr = (AP)->gpr; \
- if (__gpr < 8) \
- { \
- __ptr = * __VA_GP_REGSAVE (AP, __gpr, TYPE *); \
- (AP)->gpr = __gpr + 1; \
- } \
- else \
- { \
- TYPE **__pptr = (TYPE **) (__va_overflow (AP)); \
- __ptr = * __pptr; \
- __va_overflow (AP) = (char *) (__pptr + 1); \
- } \
- } \
- \
- /* Only integrals remaining. */ \
- else \
- { \
- /* longlong is aligned. */ \
- if (sizeof (TYPE) == 8) \
- { \
- unsigned char __gpr = (AP)->gpr; \
- if (__gpr < 7) \
- { \
- __gpr += __gpr & 1; \
- __ptr = __VA_GP_REGSAVE (AP, __gpr, TYPE); \
- (AP)->gpr = __gpr + 2; \
- } \
- else \
- { \
- unsigned long __addr = (unsigned long) (__va_overflow (AP)); \
- __ptr = (TYPE *)((__addr + 7) & -8); \
- (AP)->gpr = 8; \
- __va_overflow (AP) = (char *)(__ptr + 1); \
- } \
- } \
- else if (sizeof (TYPE) == 4) \
- { \
- unsigned char __gpr = (AP)->gpr; \
- if (__gpr < 8) \
- { \
- __ptr = __VA_GP_REGSAVE (AP, __gpr, TYPE); \
- (AP)->gpr = __gpr + 1; \
- } \
- else \
- { \
- __ptr = (TYPE *) __va_overflow (AP); \
- __va_overflow (AP) = (char *)(__ptr + 1); \
- } \
- } \
- else \
- { \
- /* Everything else was promoted to int. */ \
- __va_arg_type_violation (); \
- } \
- } \
- __ptr; \
-}))
-
-#define va_end(AP) ((void)0)
-
-/* Copy __gnuc_va_list into another variable of this type. */
-#define __va_copy(dest, src) *(dest) = *(src)
-
-#endif /* __VA_PPC_H__ */
-#endif /* defined (_STDARG_H) || defined (_VARARGS_H) */
-
-
-#else
-/* Windows NT */
-/* Define __gnuc_va_list. */
-
-#ifndef __GNUC_VA_LIST
-#define __GNUC_VA_LIST
-typedef char *__gnuc_va_list;
-#endif /* not __GNUC_VA_LIST */
-
-/* If this is for internal libc use, don't define anything but
- __gnuc_va_list. */
-#if defined (_STDARG_H) || defined (_VARARGS_H)
-
-#define __va_start_common(AP, LASTARG, FAKE) \
- ((__builtin_saveregs ()), ((AP) = ((char *) &LASTARG) + __va_rounded_size (AP)), 0)
-
-#ifdef _STDARG_H /* stdarg.h support */
-
-/* Calling __builtin_next_arg gives the proper error message if LASTARG is
- not indeed the last argument. */
-#define va_start(AP,LASTARG) \
- (__builtin_saveregs (), \
- (AP) = __builtin_next_arg (LASTARG), \
- 0)
-
-#else /* varargs.h support */
-
-#define va_start(AP) \
- (__builtin_saveregs (), \
- (AP) = __builtin_next_arg (__va_1st_arg) - sizeof (int), \
- 0)
-
-#define va_alist __va_1st_arg
-#define va_dcl register int __va_1st_arg; ...
-
-#endif /* _STDARG_H */
-
-#define __va_rounded_size(TYPE) ((sizeof (TYPE) + 3) & ~3)
-#define __va_align(AP, TYPE) \
- ((((unsigned long)(AP)) + ((sizeof (TYPE) >= 8) ? 7 : 3)) \
- & ~((sizeof (TYPE) >= 8) ? 7 : 3))
-
-#define va_arg(AP,TYPE) \
-( *(TYPE *)((AP = (char *) (__va_align(AP, TYPE) \
- + __va_rounded_size(TYPE))) \
- - __va_rounded_size(TYPE)))
-
-#define va_end(AP) ((void)0)
-
-/* Copy __gnuc_va_list into another variable of this type. */
-#define __va_copy(dest, src) (dest) = (src)
-
-#endif /* defined (_STDARG_H) || defined (_VARARGS_H) */
-#endif /* Windows NT */
diff --git a/contrib/gcc/ginclude/va-pyr.h b/contrib/gcc/ginclude/va-pyr.h
deleted file mode 100644
index 5ad4ba9d763e..000000000000
--- a/contrib/gcc/ginclude/va-pyr.h
+++ /dev/null
@@ -1,130 +0,0 @@
-/**
- *
- * Varargs for PYR/GNU CC
- *
- * WARNING -- WARNING -- DANGER
- *
- * The code in this file implements varargs for gcc on a pyr in
- * a way that is compatible with code compiled by the Pyramid Technology
- * C compiler.
- * As such, it depends strongly on the Pyramid conventions for
- * parameter passing.ct and independent implementation.
- * These (somewhat bizarre) parameter-passing conventions are described
- * in the ``OSx Operating System Porting Guide''.
- *
- * A quick summary is useful:
- * 12 of the 48 register-windowed regs available for
- * parameter passing. Parameters of a function call that are eligible
- * to be passed in registers are assigned registers from TR0/PR0 onwards;
- * all other arguments are passed on the stack.
- * Structure and union parameters are *never* passed in registers,
- * even if they are small enough to fit. They are always passed on
- * the stack.
- *
- * Double-sized parameters cannot be passed in TR11, because
- * TR12 is not used for passing parameters. If, in the absence of this
- * rule, a double-sized param would have been passed in TR11,
- * that parameter is passed on the stack and no parameters are
- * passed in TR11.
- *
- * It is only known to work for passing 32-bit integer quantities
- * (ie chars, shorts, ints/enums, longs), doubles, or pointers.
- * Passing structures on a Pyramid via varargs is a loser.
- * Passing an object larger than 8 bytes on a pyramid via varargs may
- * also be a loser.
- *
- */
-
-
-/*
- * pointer to next stack parameter in __va_buf[0]
- * pointer to next parameter register in __va_buf[1]
- * Count of registers seen at __va_buf[2]
- * saved pr0..pr11 in __va_buf[3..14]
- * # of calls to va_arg (debugging) at __va_buf[15]
- */
-
-/* Define __gnuc_va_list. */
-
-#ifndef __GNUC_VA_LIST
-#define __GNUC_VA_LIST
-
-typedef void *__voidptr;
-#if 1
-
-typedef struct __va_regs {
- __voidptr __stackp,__regp,__count;
- __voidptr __pr0,__pr1,__pr2,__pr3,__pr4,__pr5,__pr6,__pr7,__pr8,__pr9,__pr10,__pr11;
- } __va_regs;
-
-typedef __va_regs __va_buf;
-#else
-
-/* __va_buf[0] = address of next arg passed on the stack
- __va_buf[1] = address of next arg passed in a register
- __va_buf[2] = register-# of next arg passed in a register
- */
-typedef __voidptr(*__va_buf);
-
-#endif
-
-typedef __va_buf __gnuc_va_list;
-
-#endif /* not __GNUC_VA_LIST */
-
-/* If this is for internal libc use, don't define anything but
- __gnuc_va_list. */
-#if defined (_STDARG_H) || defined (_VARARGS_H)
-
-/* In GCC version 2, we want an ellipsis at the end of the declaration
- of the argument list. GCC version 1 can't parse it. */
-
-#if __GNUC__ > 1
-#define __va_ellipsis ...
-#else
-#define __va_ellipsis
-#endif
-
-#define va_alist \
- __va0,__va1,__va2,__va3,__va4,__va5,__va6,__va7,__va8,__va9,__va10,__va11, \
- __builtin_va_alist
-
-/* The ... causes current_function_varargs to be set in cc1. */
-#define va_dcl __voidptr va_alist; __va_ellipsis
-
-
-/* __asm ("rcsp %0" : "=r" ( _AP [0]));*/
-
-#define va_start(_AP) \
- _AP = ((struct __va_regs) { \
- &(_AP.__pr0), (void*)&__builtin_va_alist, (void*)0, \
- __va0,__va1,__va2,__va3,__va4,__va5, \
- __va6,__va7,__va8,__va9,__va10,__va11})
-
-
-/* Avoid errors if compiling GCC v2 with GCC v1. */
-#if __GNUC__ == 1
-#define __extension__
-#endif
-
-/* We cast to void * and then to TYPE * because this avoids
- a warning about increasing the alignment requirement. */
-#define va_arg(_AP, _MODE) \
-__extension__ \
-(*({__voidptr *__ap = (__voidptr*)&_AP; \
- register int __size = sizeof (_MODE); \
- register int __onstack = \
- (__size > 8 || ( (int)(__ap[2]) > 11) || \
- (__size==8 && (int)(__ap[2])==11)); \
- register int* __param_addr = ((int*)((__ap) [__onstack])); \
- \
- ((void *)__ap[__onstack])+=__size; \
- if (__onstack==0 || (int)(__ap[2])==11) \
- __ap[2]+= (__size >> 2); \
- (( _MODE *) (void *) __param_addr); \
-}))
-
-void va_end (__gnuc_va_list); /* Defined in libgcc.a */
-#define va_end(_X) ((void)0)
-
-#endif /* defined (_STDARG_H) || defined (_VARARGS_H) */
diff --git a/contrib/gcc/ginclude/va-sh.h b/contrib/gcc/ginclude/va-sh.h
deleted file mode 100644
index dc4e3ae8079f..000000000000
--- a/contrib/gcc/ginclude/va-sh.h
+++ /dev/null
@@ -1,229 +0,0 @@
-/* The ! __SH3E_VARG case is similar to the default gvarargs.h . */
-
-#if (defined (__SH3E__) || defined (__SH4_SINGLE__) || defined (__SH4__) || defined (__SH4_SINGLE_ONLY__)) && ! defined (__HITACHI__)
-#define __SH3E_VARG
-#endif
-
-/* Define __gnuc_va_list. */
-
-#ifndef __GNUC_VA_LIST
-#define __GNUC_VA_LIST
-
-#ifdef __SH3E_VARG
-
-typedef long __va_greg;
-typedef float __va_freg;
-
-typedef struct {
- __va_greg * __va_next_o; /* next available register */
- __va_greg * __va_next_o_limit; /* past last available register */
- __va_freg * __va_next_fp; /* next available fp register */
- __va_freg * __va_next_fp_limit; /* last available fp register */
- __va_greg * __va_next_stack; /* next extended word on stack */
-} __gnuc_va_list;
-
-#else /* ! SH3E */
-
-typedef void *__gnuc_va_list;
-
-#endif /* ! SH3E */
-
-#endif /* __GNUC_VA_LIST */
-
-/* If this is for internal libc use, don't define anything but
- __gnuc_va_list. */
-#if defined (_STDARG_H) || defined (_VARARGS_H)
-
-#ifdef _STDARG_H
-
-#ifdef __SH3E_VARG
-
-#define va_start(AP, LASTARG) \
-__extension__ \
- ({ \
- (AP).__va_next_fp = (__va_freg *) __builtin_saveregs (); \
- (AP).__va_next_fp_limit = ((AP).__va_next_fp + \
- (__builtin_args_info (1) < 8 ? 8 - __builtin_args_info (1) : 0)); \
- (AP).__va_next_o = (__va_greg *) (AP).__va_next_fp_limit; \
- (AP).__va_next_o_limit = ((AP).__va_next_o + \
- (__builtin_args_info (0) < 4 ? 4 - __builtin_args_info (0) : 0)); \
- (AP).__va_next_stack = (__va_greg *) __builtin_next_arg (LASTARG); \
- })
-
-#else /* ! SH3E */
-
-#define va_start(AP, LASTARG) \
- ((AP) = ((__gnuc_va_list) __builtin_next_arg (LASTARG)))
-
-#endif /* ! SH3E */
-
-#else /* _VARARGS_H */
-
-#define va_alist __builtin_va_alist
-#define va_dcl int __builtin_va_alist;...
-
-#ifdef __SH3E_VARG
-
-#define va_start(AP) \
-__extension__ \
- ({ \
- (AP).__va_next_fp = (__va_freg *) __builtin_saveregs (); \
- (AP).__va_next_fp_limit = ((AP).__va_next_fp + \
- (__builtin_args_info (1) < 8 ? 8 - __builtin_args_info (1) : 0)); \
- (AP).__va_next_o = (__va_greg *) (AP).__va_next_fp_limit; \
- (AP).__va_next_o_limit = ((AP).__va_next_o + \
- (__builtin_args_info (0) < 4 ? 4 - __builtin_args_info (0) : 0)); \
- (AP).__va_next_stack \
- = ((__va_greg *) __builtin_next_arg (__builtin_va_alist) \
- - (__builtin_args_info (0) >= 4 || __builtin_args_info (1) >= 8 \
- ? 1 : 0)); \
- })
-
-#else /* ! SH3E */
-
-#define va_start(AP) ((AP) = (char *) &__builtin_va_alist)
-
-#endif /* ! SH3E */
-
-#endif /* _STDARG */
-
-#ifndef va_end
-void va_end (__gnuc_va_list); /* Defined in libgcc.a */
-
-/* Values returned by __builtin_classify_type. */
-
-enum __va_type_classes {
- __no_type_class = -1,
- __void_type_class,
- __integer_type_class,
- __char_type_class,
- __enumeral_type_class,
- __boolean_type_class,
- __pointer_type_class,
- __reference_type_class,
- __offset_type_class,
- __real_type_class,
- __complex_type_class,
- __function_type_class,
- __method_type_class,
- __record_type_class,
- __union_type_class,
- __array_type_class,
- __string_type_class,
- __set_type_class,
- __file_type_class,
- __lang_type_class
-};
-
-#endif
-#define va_end(pvar) ((void)0)
-
-#ifdef __LITTLE_ENDIAN__
-#define __LITTLE_ENDIAN_P 1
-#else
-#define __LITTLE_ENDIAN_P 0
-#endif
-
-#define __SCALAR_TYPE(TYPE) \
- ((TYPE) == __integer_type_class \
- || (TYPE) == __char_type_class \
- || (TYPE) == __enumeral_type_class)
-
-/* RECORD_TYPE args passed using the C calling convention are
- passed by invisible reference. ??? RECORD_TYPE args passed
- in the stack are made to be word-aligned; for an aggregate that is
- not word-aligned, we advance the pointer to the first non-reg slot. */
-
- /* When this is a smaller-than-int integer, using
- auto-increment in the promoted (SImode) is fastest;
- however, there is no way to express that is C. Therefore,
- we use an asm.
- We want the MEM_IN_STRUCT_P bit set in the emitted RTL, therefore we
- use unions even when it would otherwise be unnecessary. */
-
-/* gcc has an extension that allows to use a casted lvalue as an lvalue,
- But it doesn't work in C++ with -pedantic - even in the presence of
- __extension__ . We work around this problem by using a reference type. */
-#ifdef __cplusplus
-#define __VA_REF &
-#else
-#define __VA_REF
-#endif
-
-#define __va_arg_sh1(AP, TYPE) __extension__ \
-({(sizeof (TYPE) == 1 \
- ? ({union {TYPE t; char c;} __t; \
- __asm("" \
- : "=r" (__t.c) \
- : "0" ((((union { int i, j; } *__VA_REF) (AP))++)->i)); \
- __t.t;}) \
- : sizeof (TYPE) == 2 \
- ? ({union {TYPE t; short s;} __t; \
- __asm("" \
- : "=r" (__t.s) \
- : "0" ((((union { int i, j; } *__VA_REF) (AP))++)->i)); \
- __t.t;}) \
- : sizeof (TYPE) >= 4 || __LITTLE_ENDIAN_P \
- ? (((union { TYPE t; int i;} *__VA_REF) (AP))++)->t \
- : ((union {TYPE t;TYPE u;}*) ((char *)++(int *__VA_REF)(AP) - sizeof (TYPE)))->t);})
-
-#ifdef __SH3E_VARG
-
-#define __PASS_AS_FLOAT(TYPE_CLASS,SIZE) \
- (TYPE_CLASS == __real_type_class && SIZE == 4)
-
-#define __TARGET_SH4_P 0
-
-#if defined(__SH4__) || defined(__SH4_SINGLE__)
-#undef __PASS_AS_FLOAT
-#define __PASS_AS_FLOAT(TYPE_CLASS,SIZE) \
- (TYPE_CLASS == __real_type_class && SIZE <= 8 \
- || TYPE_CLASS == __complex_type_class && SIZE <= 16)
-#undef __TARGET_SH4_P
-#define __TARGET_SH4_P 1
-#endif
-
-#define va_arg(pvar,TYPE) \
-__extension__ \
-({int __type = __builtin_classify_type (* (TYPE *) 0); \
- void * __result_p; \
- if (__PASS_AS_FLOAT (__type, sizeof(TYPE))) \
- { \
- if ((pvar).__va_next_fp < (pvar).__va_next_fp_limit) \
- { \
- if (((__type == __real_type_class && sizeof (TYPE) > 4)\
- || sizeof (TYPE) > 8) \
- && (((int) (pvar).__va_next_fp ^ (int) (pvar).__va_next_fp_limit)\
- & 4)) \
- (pvar).__va_next_fp++; \
- __result_p = &(pvar).__va_next_fp; \
- } \
- else \
- __result_p = &(pvar).__va_next_stack; \
- } \
- else \
- { \
- if ((pvar).__va_next_o + ((sizeof (TYPE) + 3) / 4) \
- <= (pvar).__va_next_o_limit) \
- __result_p = &(pvar).__va_next_o; \
- else \
- { \
- if (sizeof (TYPE) > 4) \
- if (! __TARGET_SH4_P) \
- (pvar).__va_next_o = (pvar).__va_next_o_limit; \
- \
- __result_p = &(pvar).__va_next_stack; \
- } \
- } \
- __va_arg_sh1(*(void **)__result_p, TYPE);})
-
-#else /* ! SH3E */
-
-#define va_arg(AP, TYPE) __va_arg_sh1((AP), TYPE)
-
-#endif /* SH3E */
-
-/* Copy __gnuc_va_list into another variable of this type. */
-#define __va_copy(dest, src) ((dest) = (src))
-
-#endif /* defined (_STDARG_H) || defined (_VARARGS_H) */
diff --git a/contrib/gcc/ginclude/va-sparc.h b/contrib/gcc/ginclude/va-sparc.h
deleted file mode 100644
index 73c9de1cd9a0..000000000000
--- a/contrib/gcc/ginclude/va-sparc.h
+++ /dev/null
@@ -1,165 +0,0 @@
-/* This is just like the default gvarargs.h
- except for differences described below. */
-
-/* Define __gnuc_va_list. */
-
-#ifndef __GNUC_VA_LIST
-#define __GNUC_VA_LIST
-#if ! defined (__svr4__) && ! defined (__linux__) && ! defined (__arch64__)
-/* This has to be a char * to be compatible with Sun.
- i.e., we have to pass a `va_list' to vsprintf. */
-typedef char * __gnuc_va_list;
-#else
-/* This has to be a void * to be compatible with Sun svr4.
- i.e., we have to pass a `va_list' to vsprintf. */
-typedef void * __gnuc_va_list;
-#endif
-#endif /* not __GNUC_VA_LIST */
-
-/* If this is for internal libc use, don't define anything but
- __gnuc_va_list. */
-#if defined (_STDARG_H) || defined (_VARARGS_H)
-
-#ifdef _STDARG_H
-
-/* Call __builtin_next_arg even though we aren't using its value, so that
- we can verify that LASTARG is correct. */
-#if defined (__GCC_NEW_VARARGS__) || defined (__arch64__)
-#define va_start(AP, LASTARG) \
- (__builtin_next_arg (LASTARG), AP = (char *) __builtin_saveregs ())
-#else
-#define va_start(AP, LASTARG) \
- (__builtin_saveregs (), AP = ((char *) __builtin_next_arg (LASTARG)))
-#endif
-
-#else
-
-#define va_alist __builtin_va_alist
-#define va_dcl int __builtin_va_alist;...
-
-#if defined (__GCC_NEW_VARARGS__) || defined (__arch64__)
-#define va_start(AP) ((AP) = (char *) __builtin_saveregs ())
-#else
-#define va_start(AP) \
- (__builtin_saveregs (), (AP) = ((char *) &__builtin_va_alist))
-#endif
-
-#endif
-
-#ifndef va_end
-void va_end (__gnuc_va_list); /* Defined in libgcc.a */
-
-/* Values returned by __builtin_classify_type. */
-
-enum __va_type_classes {
- __no_type_class = -1,
- __void_type_class,
- __integer_type_class,
- __char_type_class,
- __enumeral_type_class,
- __boolean_type_class,
- __pointer_type_class,
- __reference_type_class,
- __offset_type_class,
- __real_type_class,
- __complex_type_class,
- __function_type_class,
- __method_type_class,
- __record_type_class,
- __union_type_class,
- __array_type_class,
- __string_type_class,
- __set_type_class,
- __file_type_class,
- __lang_type_class
-};
-
-#endif
-#define va_end(pvar) ((void)0)
-
-/* Avoid errors if compiling GCC v2 with GCC v1. */
-#if __GNUC__ == 1
-#define __extension__
-#endif
-
-/* RECORD_TYPE args passed using the C calling convention are
- passed by invisible reference. ??? RECORD_TYPE args passed
- in the stack are made to be word-aligned; for an aggregate that is
- not word-aligned, we advance the pointer to the first non-reg slot. */
-
-#ifdef __arch64__
-
-typedef unsigned int __ptrint __attribute__ ((__mode__ (__DI__)));
-
-/* ??? TODO: little endian support */
-
-#define va_arg(pvar, TYPE) \
-__extension__ \
-(*({int __type = __builtin_classify_type (* (TYPE *) 0); \
- char * __result; \
- if (__type == __real_type_class) /* float? */ \
- { \
- if (__alignof__ (TYPE) == 16) \
- (pvar) = (void *) (((__ptrint) (pvar) + 15) & -16); \
- __result = (pvar); \
- (pvar) = (char *) (pvar) + sizeof (TYPE); \
- } \
- else if (__type < __record_type_class) /* integer? */ \
- { \
- (pvar) = (char *) (pvar) + 8; \
- __result = (char *) (pvar) - sizeof (TYPE); \
- } \
- else /* aggregate object */ \
- { \
- if (sizeof (TYPE) <= 8) \
- { \
- __result = (pvar); \
- (pvar) = (char *) (pvar) + 8; \
- } \
- else if (sizeof (TYPE) <= 16) \
- { \
- if (__alignof__ (TYPE) == 16) \
- (pvar) = (void *) (((__ptrint) (pvar) + 15) & -16); \
- __result = (pvar); \
- (pvar) = (char *) (pvar) + 16; \
- } \
- else \
- { \
- __result = * (void **) (pvar); \
- (pvar) = (char *) (pvar) + 8; \
- } \
- } \
- (TYPE *) __result;}))
-
-#else /* not __arch64__ */
-
-#define __va_rounded_size(TYPE) \
- (((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
-
-/* We don't declare the union member `d' to have type TYPE
- because that would lose in C++ if TYPE has a constructor. */
-/* We cast to void * and then to TYPE * because this avoids
- a warning about increasing the alignment requirement.
- The casts to char * avoid warnings about invalid pointer arithmetic. */
-#define va_arg(pvar,TYPE) \
-__extension__ \
-(*({((__builtin_classify_type (*(TYPE*) 0) >= __record_type_class \
- || (__builtin_classify_type (*(TYPE*) 0) == __real_type_class \
- && sizeof (TYPE) == 16)) \
- ? ((pvar) = (char *)(pvar) + __va_rounded_size (TYPE *), \
- *(TYPE **) (void *) ((char *)(pvar) - __va_rounded_size (TYPE *))) \
- : __va_rounded_size (TYPE) == 8 \
- ? ({ union {char __d[sizeof (TYPE)]; int __i[2];} __u; \
- __u.__i[0] = ((int *) (void *) (pvar))[0]; \
- __u.__i[1] = ((int *) (void *) (pvar))[1]; \
- (pvar) = (char *)(pvar) + 8; \
- (TYPE *) (void *) __u.__d; }) \
- : ((pvar) = (char *)(pvar) + __va_rounded_size (TYPE), \
- ((TYPE *) (void *) ((char *)(pvar) - __va_rounded_size (TYPE)))));}))
-
-#endif /* not __arch64__ */
-
-/* Copy __gnuc_va_list into another variable of this type. */
-#define __va_copy(dest, src) (dest) = (src)
-
-#endif /* defined (_STDARG_H) || defined (_VARARGS_H) */
diff --git a/contrib/gcc/ginclude/va-spur.h b/contrib/gcc/ginclude/va-spur.h
deleted file mode 100644
index 7457ceb9fcdb..000000000000
--- a/contrib/gcc/ginclude/va-spur.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/* varargs.h for SPUR */
-
-/* NB. This is NOT the definition needed for the new ANSI proposed
- standard */
-
-
-struct __va_struct { char __regs[20]; };
-
-#define va_alist __va_regs, __va_stack
-
-/* In GCC version 2, we want an ellipsis at the end of the declaration
- of the argument list. GCC version 1 can't parse it. */
-
-#if __GNUC__ > 1
-#define __va_ellipsis ...
-#else
-#define __va_ellipsis
-#endif
-
-/* The ... causes current_function_varargs to be set in cc1. */
-#define va_dcl struct __va_struct __va_regs; int __va_stack;
-
-typedef struct {
- int __pnt;
- char *__regs;
- char *__stack;
-} va_list;
-
-#define va_start(pvar) \
- ((pvar).__pnt = 0, (pvar).__regs = __va_regs.__regs, \
- (pvar).__stack = (char *) &__va_stack)
-#define va_end(pvar) ((void)0)
-
-/* Avoid errors if compiling GCC v2 with GCC v1. */
-#if __GNUC__ == 1
-#define __extension__
-#endif
-
-#define va_arg(pvar,type) \
-__extension__ \
- (*({ type *__va_result; \
- if ((pvar).__pnt >= 20) { \
- __va_result = ( (type *) ((pvar).__stack + (pvar).__pnt - 20)); \
- (pvar).__pnt += (sizeof(type) + 7) & ~7; \
- } \
- else if ((pvar).__pnt + sizeof(type) > 20) { \
- __va_result = (type *) (pvar).__stack; \
- (pvar).__pnt = 20 + ( (sizeof(type) + 7) & ~7); \
- } \
- else if (sizeof(type) == 8) { \
- union {double d; int i[2];} __u; \
- __u.i[0] = *(int *) ((pvar).__regs + (pvar).__pnt); \
- __u.i[1] = *(int *) ((pvar).__regs + (pvar).__pnt + 4); \
- __va_result = (type *) &__u; \
- (pvar).__pnt += 8; \
- } \
- else { \
- __va_result = (type *) ((pvar).__regs + (pvar).__pnt); \
- (pvar).__pnt += (sizeof(type) + 3) & ~3; \
- } \
- __va_result; }))
-
-/* Copy __gnuc_va_list into another variable of this type. */
-#define __va_copy(dest, src) (dest) = (src)
diff --git a/contrib/gcc/ginclude/va-v850.h b/contrib/gcc/ginclude/va-v850.h
deleted file mode 100644
index 96da6d5a3dea..000000000000
--- a/contrib/gcc/ginclude/va-v850.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Define __gnuc_va_list. */
-
-#ifndef __GNUC_VA_LIST
-#define __GNUC_VA_LIST
-typedef void *__gnuc_va_list;
-#endif /* not __GNUC_VA_LIST */
-
-/* If this is for internal libc use, don't define anything but
- __gnuc_va_list. */
-#if defined (_STDARG_H) || defined (_VARARGS_H)
-
-#ifdef _STDARG_H
-#define va_start(AP, LASTARG) \
- (AP = ((__gnuc_va_list) __builtin_next_arg (LASTARG)))
-#else
-#define __va_ellipsis ...
-#define va_alist __builtin_va_alist
-#define va_dcl int __builtin_va_alist; __va_ellipsis
-#define va_start(AP) AP=(char *) &__builtin_va_alist
-#endif
-
-/* Now stuff common to both varargs & stdarg implementations. */
-#define __va_rounded_size(TYPE) \
- (((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
-#undef va_end
-void va_end (__gnuc_va_list);
-#define va_end(AP) ((void)0)
-#define va_arg(AP, TYPE) \
- (sizeof (TYPE) > 8 \
- ? (AP = (__gnuc_va_list) ((char *) (AP) + __va_rounded_size (char *)),\
- **((TYPE **) (void *) ((char *) (AP) - __va_rounded_size (char *))))\
- : (AP = (__gnuc_va_list) ((char *) (AP) + __va_rounded_size (TYPE)), \
- *((TYPE *) (void *) ((char *) (AP) - __va_rounded_size (TYPE)))))
-#endif
diff --git a/contrib/gcc/install.texi b/contrib/gcc/install.texi
deleted file mode 100644
index 5e3da8e58c1a..000000000000
--- a/contrib/gcc/install.texi
+++ /dev/null
@@ -1,2381 +0,0 @@
-@c Copyright (C) 1988,89,92,93,94,95,96,97,1998 Free Software Foundation, Inc.
-@c This is part of the GCC manual.
-@c For copying conditions, see the file gcc.texi.
-
-@c The text of this file appears in the file INSTALL
-@c in the GCC distribution, as well as in the GCC manual.
-
-Note most of this information is out of date and superceded by the EGCS
-install procedures. It is provided for historical reference only.
-
-@ifclear INSTALLONLY
-@node Installation
-@chapter Installing GNU CC
-@end ifclear
-@cindex installing GNU CC
-
-@menu
-* Configurations:: Configurations Supported by GNU CC.
-* Other Dir:: Compiling in a separate directory (not where the source is).
-* Cross-Compiler:: Building and installing a cross-compiler.
-* Sun Install:: See below for installation on the Sun.
-* VMS Install:: See below for installation on VMS.
-* Collect2:: How @code{collect2} works; how it finds @code{ld}.
-* Header Dirs:: Understanding the standard header file directories.
-@end menu
-
-Here is the procedure for installing GNU CC on a Unix system. See
-@ref{VMS Install}, for VMS systems. In this section we assume you
-compile in the same directory that contains the source files; see
-@ref{Other Dir}, to find out how to compile in a separate directory on Unix
-systems.
-
-You cannot install GNU C by itself on MSDOS; it will not compile under
-any MSDOS compiler except itself. You need to get the complete
-compilation package DJGPP, which includes binaries as well as sources,
-and includes all the necessary compilation tools and libraries.
-
-@enumerate
-@item
-If you have built GNU CC previously in the same directory for a
-different target machine, do @samp{make distclean} to delete all files
-that might be invalid. One of the files this deletes is
-@file{Makefile}; if @samp{make distclean} complains that @file{Makefile}
-does not exist, it probably means that the directory is already suitably
-clean.
-
-@item
-On a System V release 4 system, make sure @file{/usr/bin} precedes
-@file{/usr/ucb} in @code{PATH}. The @code{cc} command in
-@file{/usr/ucb} uses libraries which have bugs.
-
-@item
-Specify the host, build and target machine configurations. You do this
-by running the file @file{configure}.
-
-The @dfn{build} machine is the system which you are using, the
-@dfn{host} machine is the system where you want to run the resulting
-compiler (normally the build machine), and the @dfn{target} machine is
-the system for which you want the compiler to generate code.
-
-If you are building a compiler to produce code for the machine it runs
-on (a native compiler), you normally do not need to specify any operands
-to @file{configure}; it will try to guess the type of machine you are on
-and use that as the build, host and target machines. So you don't need
-to specify a configuration when building a native compiler unless
-@file{configure} cannot figure out what your configuration is or guesses
-wrong.
-
-In those cases, specify the build machine's @dfn{configuration name}
-with the @samp{--host} option; the host and target will default to be
-the same as the host machine. (If you are building a cross-compiler,
-see @ref{Cross-Compiler}.)
-
-Here is an example:
-
-@smallexample
-./configure --host=sparc-sun-sunos4.1
-@end smallexample
-
-A configuration name may be canonical or it may be more or less
-abbreviated.
-
-A canonical configuration name has three parts, separated by dashes.
-It looks like this: @samp{@var{cpu}-@var{company}-@var{system}}.
-(The three parts may themselves contain dashes; @file{configure}
-can figure out which dashes serve which purpose.) For example,
-@samp{m68k-sun-sunos4.1} specifies a Sun 3.
-
-You can also replace parts of the configuration by nicknames or aliases.
-For example, @samp{sun3} stands for @samp{m68k-sun}, so
-@samp{sun3-sunos4.1} is another way to specify a Sun 3. You can also
-use simply @samp{sun3-sunos}, since the version of SunOS is assumed by
-default to be version 4.
-
-You can specify a version number after any of the system types, and some
-of the CPU types. In most cases, the version is irrelevant, and will be
-ignored. So you might as well specify the version if you know it.
-
-See @ref{Configurations}, for a list of supported configuration names and
-notes on many of the configurations. You should check the notes in that
-section before proceeding any further with the installation of GNU CC.
-
-There are four additional options you can specify independently to
-describe variant hardware and software configurations. These are
-@samp{--with-gnu-as}, @samp{--with-gnu-ld}, @samp{--with-stabs} and
-@samp{--nfp}.
-
-@table @samp
-@item --with-gnu-as
-If you will use GNU CC with the GNU assembler (GAS), you should declare
-this by using the @samp{--with-gnu-as} option when you run
-@file{configure}.
-
-Using this option does not install GAS. It only modifies the output of
-GNU CC to work with GAS. Building and installing GAS is up to you.
-
-Conversely, if you @emph{do not} wish to use GAS and do not specify
-@samp{--with-gnu-as} when building GNU CC, it is up to you to make sure
-that GAS is not installed. GNU CC searches for a program named
-@code{as} in various directories; if the program it finds is GAS, then
-it runs GAS. If you are not sure where GNU CC finds the assembler it is
-using, try specifying @samp{-v} when you run it.
-
-The systems where it makes a difference whether you use GAS are@*
-@samp{hppa1.0-@var{any}-@var{any}}, @samp{hppa1.1-@var{any}-@var{any}},
-@samp{i386-@var{any}-sysv}, @samp{i386-@var{any}-isc},@*
-@samp{i860-@var{any}-bsd}, @samp{m68k-bull-sysv},@*
-@samp{m68k-hp-hpux}, @samp{m68k-sony-bsd},@*
-@samp{m68k-altos-sysv}, @samp{m68000-hp-hpux},@*
-@samp{m68000-att-sysv}, @samp{@var{any}-lynx-lynxos},
-and @samp{mips-@var{any}}).
-On any other system, @samp{--with-gnu-as} has no effect.
-
-On the systems listed above (except for the HP-PA, for ISC on the
-386, and for @samp{mips-sgi-irix5.*}), if you use GAS, you should also
-use the GNU linker (and specify @samp{--with-gnu-ld}).
-
-@item --with-gnu-ld
-Specify the option @samp{--with-gnu-ld} if you plan to use the GNU
-linker with GNU CC.
-
-This option does not cause the GNU linker to be installed; it just
-modifies the behavior of GNU CC to work with the GNU linker.
-@c Specifically, it inhibits the installation of @code{collect2}, a program
-@c which otherwise serves as a front-end for the system's linker on most
-@c configurations.
-
-@item --with-stabs
-On MIPS based systems and on Alphas, you must specify whether you want
-GNU CC to create the normal ECOFF debugging format, or to use BSD-style
-stabs passed through the ECOFF symbol table. The normal ECOFF debug
-format cannot fully handle languages other than C. BSD stabs format can
-handle other languages, but it only works with the GNU debugger GDB.
-
-Normally, GNU CC uses the ECOFF debugging format by default; if you
-prefer BSD stabs, specify @samp{--with-stabs} when you configure GNU
-CC.
-
-No matter which default you choose when you configure GNU CC, the user
-can use the @samp{-gcoff} and @samp{-gstabs+} options to specify explicitly
-the debug format for a particular compilation.
-
-@samp{--with-stabs} is meaningful on the ISC system on the 386, also, if
-@samp{--with-gas} is used. It selects use of stabs debugging
-information embedded in COFF output. This kind of debugging information
-supports C++ well; ordinary COFF debugging information does not.
-
-@samp{--with-stabs} is also meaningful on 386 systems running SVR4. It
-selects use of stabs debugging information embedded in ELF output. The
-C++ compiler currently (2.6.0) does not support the DWARF debugging
-information normally used on 386 SVR4 platforms; stabs provide a
-workable alternative. This requires gas and gdb, as the normal SVR4
-tools can not generate or interpret stabs.
-
-@item --nfp
-On certain systems, you must specify whether the machine has a floating
-point unit. These systems include @samp{m68k-sun-sunos@var{n}} and
-@samp{m68k-isi-bsd}. On any other system, @samp{--nfp} currently has no
-effect, though perhaps there are other systems where it could usefully
-make a difference.
-
-@cindex Haifa scheduler
-@cindex scheduler, experimental
-@item --enable-haifa
-@itemx --disable-haifa
-Use @samp{--enable-haifa} to enable use of an experimental instruction
-scheduler (from IBM Haifa). This may or may not produce better code.
-Some targets on which it is known to be a win enable it by default; use
-@samp{--disable-haifa} to disable it in these cases. @code{configure}
-will print out whether the Haifa scheduler is enabled when it is run.
-
-@cindex Objective C threads
-@cindex threads, Objective C
-@item --enable-threads=@var{type}
-Certain systems, notably Linux-based GNU systems, can't be relied on to
-supply a threads facility for the Objective C runtime and so will
-default to single-threaded runtime. They may, however, have a library
-threads implementation available, in which case threads can be enabled
-with this option by supplying a suitable @var{type}, probably
-@samp{posix}. The possibilities for @var{type} are @samp{single},
-@samp{posix}, @samp{win32}, @samp{solaris}, @samp{irix} and @samp{mach}.
-
-@cindex Internal Compiler Checking
-@item --enable-checking
-When you specify this option, the compiler is built to perform checking
-of tree node types when referencing fields of that node. This does not
-change the generated code, but adds error checking within the compiler.
-This will slow down the compiler and may only work properly if you
-are building the compiler with GNU C.
-@end table
-
-The @file{configure} script searches subdirectories of the source
-directory for other compilers that are to be integrated into GNU CC.
-The GNU compiler for C++, called G++ is in a subdirectory named
-@file{cp}. @file{configure} inserts rules into @file{Makefile} to build
-all of those compilers.
-
-Here we spell out what files will be set up by @code{configure}. Normally
-you need not be concerned with these files.
-
-@itemize @bullet
-@item
-@ifset INTERNALS
-A file named @file{config.h} is created that contains a @samp{#include}
-of the top-level config file for the machine you will run the compiler
-on (@pxref{Config}). This file is responsible for defining information
-about the host machine. It includes @file{tm.h}.
-@end ifset
-@ifclear INTERNALS
-A file named @file{config.h} is created that contains a @samp{#include}
-of the top-level config file for the machine you will run the compiler
-on (@pxref{Config,,The Configuration File, gcc.info, Using and Porting
-GCC}). This file is responsible for defining information about the host
-machine. It includes @file{tm.h}.
-@end ifclear
-
-The top-level config file is located in the subdirectory @file{config}.
-Its name is always @file{xm-@var{something}.h}; usually
-@file{xm-@var{machine}.h}, but there are some exceptions.
-
-If your system does not support symbolic links, you might want to
-set up @file{config.h} to contain a @samp{#include} command which
-refers to the appropriate file.
-
-@item
-A file named @file{tconfig.h} is created which includes the top-level config
-file for your target machine. This is used for compiling certain
-programs to run on that machine.
-
-@item
-A file named @file{tm.h} is created which includes the
-machine-description macro file for your target machine. It should be in
-the subdirectory @file{config} and its name is often
-@file{@var{machine}.h}.
-
-@item
-The command file @file{configure} also constructs the file
-@file{Makefile} by adding some text to the template file
-@file{Makefile.in}. The additional text comes from files in the
-@file{config} directory, named @file{t-@var{target}} and
-@file{x-@var{host}}. If these files do not exist, it means nothing
-needs to be added for a given target or host.
-@end itemize
-
-@item
-The standard directory for installing GNU CC is @file{/usr/local/lib}.
-If you want to install its files somewhere else, specify
-@samp{--prefix=@var{dir}} when you run @file{configure}. Here @var{dir}
-is a directory name to use instead of @file{/usr/local} for all purposes
-with one exception: the directory @file{/usr/local/include} is searched
-for header files no matter where you install the compiler. To override
-this name, use the @code{--with-local-prefix} option below. The directory
-you specify need not exist, but its parent directory must exist.
-
-@item
-Specify @samp{--with-local-prefix=@var{dir}} if you want the compiler to
-search directory @file{@var{dir}/include} for locally installed header
-files @emph{instead} of @file{/usr/local/include}.
-
-You should specify @samp{--with-local-prefix} @strong{only} if your site has
-a different convention (not @file{/usr/local}) for where to put
-site-specific files.
-
-The default value for @samp{--with-local-prefix} is @file{/usr/local}
-regardless of the value of @samp{--prefix}. Specifying @samp{--prefix}
-has no effect on which directory GNU CC searches for local header files.
-This may seem counterintuitive, but actually it is logical.
-
-The purpose of @samp{--prefix} is to specify where to @emph{install GNU
-CC}. The local header files in @file{/usr/local/include}---if you put
-any in that directory---are not part of GNU CC. They are part of other
-programs---perhaps many others. (GNU CC installs its own header files
-in another directory which is based on the @samp{--prefix} value.)
-
-@strong{Do not} specify @file{/usr} as the @samp{--with-local-prefix}! The
-directory you use for @samp{--with-local-prefix} @strong{must not} contain
-any of the system's standard header files. If it did contain them,
-certain programs would be miscompiled (including GNU Emacs, on certain
-targets), because this would override and nullify the header file
-corrections made by the @code{fixincludes} script.
-
-Indications are that people who use this option use it based on
-mistaken ideas of what it is for. People use it as if it specified
-where to install part of GNU CC. Perhaps they make this assumption
-because installing GNU CC creates the directory.
-
-@cindex Bison parser generator
-@cindex parser generator, Bison
-@item
-Make sure the Bison parser generator is installed. (This is
-unnecessary if the Bison output files @file{c-parse.c} and
-@file{cexp.c} are more recent than @file{c-parse.y} and @file{cexp.y}
-and you do not plan to change the @samp{.y} files.)
-
-Bison versions older than Sept 8, 1988 will produce incorrect output
-for @file{c-parse.c}.
-
-@item
-If you have chosen a configuration for GNU CC which requires other GNU
-tools (such as GAS or the GNU linker) instead of the standard system
-tools, install the required tools in the build directory under the names
-@file{as}, @file{ld} or whatever is appropriate. This will enable the
-compiler to find the proper tools for compilation of the program
-@file{enquire}.
-
-Alternatively, you can do subsequent compilation using a value of the
-@code{PATH} environment variable such that the necessary GNU tools come
-before the standard system tools.
-
-@item
-Build the compiler. Just type @samp{make LANGUAGES=c} in the compiler
-directory.
-
-@samp{LANGUAGES=c} specifies that only the C compiler should be
-compiled. The makefile normally builds compilers for all the supported
-languages; currently, C, C++ and Objective C. However, C is the only
-language that is sure to work when you build with other non-GNU C
-compilers. In addition, building anything but C at this stage is a
-waste of time.
-
-In general, you can specify the languages to build by typing the
-argument @samp{LANGUAGES="@var{list}"}, where @var{list} is one or more
-words from the list @samp{c}, @samp{c++}, and @samp{objective-c}. If
-you have any additional GNU compilers as subdirectories of the GNU CC
-source directory, you may also specify their names in this list.
-
-Ignore any warnings you may see about ``statement not reached'' in
-@file{insn-emit.c}; they are normal. Also, warnings about ``unknown
-escape sequence'' are normal in @file{genopinit.c} and perhaps some
-other files. Likewise, you should ignore warnings about ``constant is
-so large that it is unsigned'' in @file{insn-emit.c} and
-@file{insn-recog.c}, a warning about a comparison always being zero
-in @file{enquire.o}, and warnings about shift counts exceeding type
-widths in @file{cexp.y}. Any other compilation errors may represent bugs in
-the port to your machine or operating system, and
-@ifclear INSTALLONLY
-should be investigated and reported (@pxref{Bugs}).
-@end ifclear
-@ifset INSTALLONLY
-should be investigated and reported.
-@end ifset
-
-Some commercial compilers fail to compile GNU CC because they have bugs
-or limitations. For example, the Microsoft compiler is said to run out
-of macro space. Some Ultrix compilers run out of expression space; then
-you need to break up the statement where the problem happens.
-
-@item
-If you are building a cross-compiler, stop here. @xref{Cross-Compiler}.
-
-@cindex stage1
-@item
-Move the first-stage object files and executables into a subdirectory
-with this command:
-
-@smallexample
-make stage1
-@end smallexample
-
-The files are moved into a subdirectory named @file{stage1}.
-Once installation is complete, you may wish to delete these files
-with @code{rm -r stage1}.
-
-@item
-If you have chosen a configuration for GNU CC which requires other GNU
-tools (such as GAS or the GNU linker) instead of the standard system
-tools, install the required tools in the @file{stage1} subdirectory
-under the names @file{as}, @file{ld} or whatever is appropriate. This
-will enable the stage 1 compiler to find the proper tools in the
-following stage.
-
-Alternatively, you can do subsequent compilation using a value of the
-@code{PATH} environment variable such that the necessary GNU tools come
-before the standard system tools.
-
-@item
-Recompile the compiler with itself, with this command:
-
-@smallexample
-make CC="stage1/xgcc -Bstage1/" CFLAGS="-g -O2"
-@end smallexample
-
-This is called making the stage 2 compiler.
-
-The command shown above builds compilers for all the supported
-languages. If you don't want them all, you can specify the languages to
-build by typing the argument @samp{LANGUAGES="@var{list}"}. @var{list}
-should contain one or more words from the list @samp{c}, @samp{c++},
-@samp{objective-c}, and @samp{proto}. Separate the words with spaces.
-@samp{proto} stands for the programs @code{protoize} and
-@code{unprotoize}; they are not a separate language, but you use
-@code{LANGUAGES} to enable or disable their installation.
-
-If you are going to build the stage 3 compiler, then you might want to
-build only the C language in stage 2.
-
-Once you have built the stage 2 compiler, if you are short of disk
-space, you can delete the subdirectory @file{stage1}.
-
-On a 68000 or 68020 system lacking floating point hardware,
-unless you have selected a @file{tm.h} file that expects by default
-that there is no such hardware, do this instead:
-
-@smallexample
-make CC="stage1/xgcc -Bstage1/" CFLAGS="-g -O2 -msoft-float"
-@end smallexample
-
-@item
-If you wish to test the compiler by compiling it with itself one more
-time, install any other necessary GNU tools (such as GAS or the GNU
-linker) in the @file{stage2} subdirectory as you did in the
-@file{stage1} subdirectory, then do this:
-
-@smallexample
-make stage2
-make CC="stage2/xgcc -Bstage2/" CFLAGS="-g -O2"
-@end smallexample
-
-@noindent
-This is called making the stage 3 compiler. Aside from the @samp{-B}
-option, the compiler options should be the same as when you made the
-stage 2 compiler. But the @code{LANGUAGES} option need not be the
-same. The command shown above builds compilers for all the supported
-languages; if you don't want them all, you can specify the languages to
-build by typing the argument @samp{LANGUAGES="@var{list}"}, as described
-above.
-
-If you do not have to install any additional GNU tools, you may use the
-command
-
-@smallexample
-make bootstrap LANGUAGES=@var{language-list} BOOT_CFLAGS=@var{option-list}
-@end smallexample
-
-@noindent
-instead of making @file{stage1}, @file{stage2}, and performing
-the two compiler builds.
-
-@item
-Then compare the latest object files with the stage 2 object
-files---they ought to be identical, aside from time stamps (if any).
-
-On some systems, meaningful comparison of object files is impossible;
-they always appear ``different.'' This is currently true on Solaris and
-some systems that use ELF object file format. On some versions of Irix
-on SGI machines and DEC Unix (OSF/1) on Alpha systems, you will not be
-able to compare the files without specifying @file{-save-temps}; see the
-description of individual systems above to see if you get comparison
-failures. You may have similar problems on other systems.
-
-Use this command to compare the files:
-
-@smallexample
-make compare
-@end smallexample
-
-This will mention any object files that differ between stage 2 and stage
-3. Any difference, no matter how innocuous, indicates that the stage 2
-compiler has compiled GNU CC incorrectly, and is therefore a potentially
-@ifclear INSTALLONLY
-serious bug which you should investigate and report (@pxref{Bugs}).
-@end ifclear
-@ifset INSTALLONLY
-serious bug which you should investigate and report.
-@end ifset
-
-If your system does not put time stamps in the object files, then this
-is a faster way to compare them (using the Bourne shell):
-
-@smallexample
-for file in *.o; do
-cmp $file stage2/$file
-done
-@end smallexample
-
-If you have built the compiler with the @samp{-mno-mips-tfile} option on
-MIPS machines, you will not be able to compare the files.
-
-@item
-Install the compiler driver, the compiler's passes and run-time support
-with @samp{make install}. Use the same value for @code{CC},
-@code{CFLAGS} and @code{LANGUAGES} that you used when compiling the
-files that are being installed. One reason this is necessary is that
-some versions of Make have bugs and recompile files gratuitously when
-you do this step. If you use the same variable values, those files will
-be recompiled properly.
-
-For example, if you have built the stage 2 compiler, you can use the
-following command:
-
-@smallexample
-make install CC="stage2/xgcc -Bstage2/" CFLAGS="-g -O" LANGUAGES="@var{list}"
-@end smallexample
-
-@noindent
-This copies the files @file{cc1}, @file{cpp} and @file{libgcc.a} to
-files @file{cc1}, @file{cpp} and @file{libgcc.a} in the directory
-@file{/usr/local/lib/gcc-lib/@var{target}/@var{version}}, which is where
-the compiler driver program looks for them. Here @var{target} is the
-canonicalized form of target machine type specified when you ran
-@file{configure}, and @var{version} is the version number of GNU CC.
-This naming scheme permits various versions and/or cross-compilers to
-coexist. It also copies the executables for compilers for other
-languages (e.g., @file{cc1plus} for C++) to the same directory.
-
-This also copies the driver program @file{xgcc} into
-@file{/usr/local/bin/gcc}, so that it appears in typical execution
-search paths. It also copies @file{gcc.1} into
-@file{/usr/local/man/man1} and info pages into @file{/usr/local/info}.
-
-On some systems, this command causes recompilation of some files. This
-is usually due to bugs in @code{make}. You should either ignore this
-problem, or use GNU Make.
-
-@cindex @code{alloca} and SunOS
-@strong{Warning: there is a bug in @code{alloca} in the Sun library. To
-avoid this bug, be sure to install the executables of GNU CC that were
-compiled by GNU CC. (That is, the executables from stage 2 or 3, not
-stage 1.) They use @code{alloca} as a built-in function and never the
-one in the library.}
-
-(It is usually better to install GNU CC executables from stage 2 or 3,
-since they usually run faster than the ones compiled with some other
-compiler.)
-
-@item
-@cindex C++ runtime library
-@cindex @code{libstdc++}
-If you're going to use C++, it's likely that you need to also install
-a C++ runtime library. Just as GNU C does not
-distribute a C runtime library, it also does not include a C++ runtime
-library. All I/O functionality, special class libraries, etc., are
-provided by the C++ runtime library.
-
-The standard C++ runtime library for GNU CC is called @samp{libstdc++}.
-An obsolescent library @samp{libg++} may also be available, but it's
-necessary only for older software that hasn't been converted yet; if
-you don't know whether you need @samp{libg++} then you probably don't
-need it.
-
-Here's one way to build and install @samp{libstdc++} for GNU CC:
-
-@itemize @bullet
-@item
-Build and install GNU CC, so that invoking @samp{gcc} obtains the GNU CC
-that was just built.
-
-@item
-Obtain a copy of a compatible @samp{libstdc++} distribution. For
-example, the @samp{libstdc++-2.8.0.tar.gz} distribution should be
-compatible with GCC 2.8.0. GCC distributors normally distribute
-@samp{libstdc++} as well.
-
-@item
-Set the @samp{CXX} environment variable to @samp{gcc} while running the
-@samp{libstdc++} distribution's @file{configure} command. Use the same
-@file{configure} options that you used when you invoked GCC's
-@file{configure} command.
-
-@item
-Invoke @samp{make} to build the C++ runtime.
-
-@item
-Invoke @samp{make install} to install the C++ runtime.
-
-@end itemize
-
-To summarize, after building and installing GNU CC, invoke the following
-shell commands in the topmost directory of the C++ library distribution.
-For @var{configure-options}, use the same options that
-you used to configure GNU CC.
-
-@example
-$ CXX=gcc ./configure @var{configure-options}
-$ make
-$ make install
-@end example
-
-@item
-GNU CC includes a runtime library for Objective-C because it is an
-integral part of the language. You can find the files associated with
-the library in the subdirectory @file{objc}. The GNU Objective-C
-Runtime Library requires header files for the target's C library in
-order to be compiled,and also requires the header files for the target's
-thread library if you want thread support. @xref{Cross Headers,
-Cross-Compilers and Header Files, Cross-Compilers and Header Files}, for
-discussion about header files issues for cross-compilation.
-
-When you run @file{configure}, it picks the appropriate Objective-C
-thread implementation file for the target platform. In some situations,
-you may wish to choose a different back-end as some platforms support
-multiple thread implementations or you may wish to disable thread
-support completely. You do this by specifying a value for the
-@var{OBJC_THREAD_FILE} makefile variable on the command line when you
-run make, for example:
-
-@smallexample
-make CC="stage2/xgcc -Bstage2/" CFLAGS="-g -O2" OBJC_THREAD_FILE=thr-single
-@end smallexample
-
-@noindent
-Below is a list of the currently available back-ends.
-
-@itemize @bullet
-@item thr-single
-Disable thread support, should work for all platforms.
-@item thr-decosf1
-DEC OSF/1 thread support.
-@item thr-irix
-SGI IRIX thread support.
-@item thr-mach
-Generic MACH thread support, known to work on NEXTSTEP.
-@item thr-os2
-IBM OS/2 thread support.
-@item thr-posix
-Generix POSIX thread support.
-@item thr-pthreads
-PCThreads on Linux-based GNU systems.
-@item thr-solaris
-SUN Solaris thread support.
-@item thr-win32
-Microsoft Win32 API thread support.
-@end itemize
-@end enumerate
-
-@node Configurations
-@section Configurations Supported by GNU CC
-@cindex configurations supported by GNU CC
-
-Here are the possible CPU types:
-
-@quotation
-@c gmicro, alliant, spur and tahoe omitted since they don't work.
-1750a, a29k, alpha, arm, c@var{n}, clipper, dsp16xx, elxsi, h8300,
-hppa1.0, hppa1.1, i370, i386, i486, i586, i860, i960, m32r, m68000, m68k,
-m88k, mips, mipsel, mips64, mips64el, ns32k, powerpc, powerpcle,
-pyramid, romp, rs6000, sh, sparc, sparclite, sparc64, vax, we32k.
-@end quotation
-
-Here are the recognized company names. As you can see, customary
-abbreviations are used rather than the longer official names.
-
-@c What should be done about merlin, tek*, dolphin?
-@quotation
-acorn, alliant, altos, apollo, apple, att, bull,
-cbm, convergent, convex, crds, dec, dg, dolphin,
-elxsi, encore, harris, hitachi, hp, ibm, intergraph, isi,
-mips, motorola, ncr, next, ns, omron, plexus,
-sequent, sgi, sony, sun, tti, unicom, wrs.
-@end quotation
-
-The company name is meaningful only to disambiguate when the rest of
-the information supplied is insufficient. You can omit it, writing
-just @samp{@var{cpu}-@var{system}}, if it is not needed. For example,
-@samp{vax-ultrix4.2} is equivalent to @samp{vax-dec-ultrix4.2}.
-
-Here is a list of system types:
-
-@quotation
-386bsd, aix, acis, amigaos, aos, aout, aux, bosx, bsd, clix, coff, ctix, cxux,
-dgux, dynix, ebmon, ecoff, elf, esix, freebsd, hms, genix, gnu, linux-gnu,
-hiux, hpux, iris, irix, isc, luna, lynxos, mach, minix, msdos, mvs,
-netbsd, newsos, nindy, ns, osf, osfrose, ptx, riscix, riscos, rtu, sco, sim,
-solaris, sunos, sym, sysv, udi, ultrix, unicos, uniplus, unos, vms, vsta,
-vxworks, winnt, xenix.
-@end quotation
-
-@noindent
-You can omit the system type; then @file{configure} guesses the
-operating system from the CPU and company.
-
-You can add a version number to the system type; this may or may not
-make a difference. For example, you can write @samp{bsd4.3} or
-@samp{bsd4.4} to distinguish versions of BSD. In practice, the version
-number is most needed for @samp{sysv3} and @samp{sysv4}, which are often
-treated differently.
-
-If you specify an impossible combination such as @samp{i860-dg-vms},
-then you may get an error message from @file{configure}, or it may
-ignore part of the information and do the best it can with the rest.
-@file{configure} always prints the canonical name for the alternative
-that it used. GNU CC does not support all possible alternatives.
-
-Often a particular model of machine has a name. Many machine names are
-recognized as aliases for CPU/company combinations. Thus, the machine
-name @samp{sun3}, mentioned above, is an alias for @samp{m68k-sun}.
-Sometimes we accept a company name as a machine name, when the name is
-popularly used for a particular machine. Here is a table of the known
-machine names:
-
-@quotation
-3300, 3b1, 3b@var{n}, 7300, altos3068, altos,
-apollo68, att-7300, balance,
-convex-c@var{n}, crds, decstation-3100,
-decstation, delta, encore,
-fx2800, gmicro, hp7@var{nn}, hp8@var{nn},
-hp9k2@var{nn}, hp9k3@var{nn}, hp9k7@var{nn},
-hp9k8@var{nn}, iris4d, iris, isi68,
-m3230, magnum, merlin, miniframe,
-mmax, news-3600, news800, news, next,
-pbd, pc532, pmax, powerpc, powerpcle, ps2, risc-news,
-rtpc, sun2, sun386i, sun386, sun3,
-sun4, symmetry, tower-32, tower.
-@end quotation
-
-@noindent
-Remember that a machine name specifies both the cpu type and the company
-name.
-If you want to install your own homemade configuration files, you can
-use @samp{local} as the company name to access them. If you use
-configuration @samp{@var{cpu}-local}, the configuration name
-without the cpu prefix
-is used to form the configuration file names.
-
-Thus, if you specify @samp{m68k-local}, configuration uses
-files @file{m68k.md}, @file{local.h}, @file{m68k.c},
-@file{xm-local.h}, @file{t-local}, and @file{x-local}, all in the
-directory @file{config/m68k}.
-
-Here is a list of configurations that have special treatment or special
-things you must know:
-
-@table @samp
-@item 1750a-*-*
-MIL-STD-1750A processors.
-
-The MIL-STD-1750A cross configuration produces output for
-@code{as1750}, an assembler/linker available under the GNU Public
-License for the 1750A. @code{as1750} can be obtained at
-@emph{ftp://ftp.fta-berlin.de/pub/crossgcc/1750gals/}.
-A similarly licensed simulator for
-the 1750A is available from same address.
-
-You should ignore a fatal error during the building of libgcc (libgcc is
-not yet implemented for the 1750A.)
-
-The @code{as1750} assembler requires the file @file{ms1750.inc}, which is
-found in the directory @file{config/1750a}.
-
-GNU CC produced the same sections as the Fairchild F9450 C Compiler,
-namely:
-
-@table @code
-@item Normal
-The program code section.
-
-@item Static
-The read/write (RAM) data section.
-
-@item Konst
-The read-only (ROM) constants section.
-
-@item Init
-Initialization section (code to copy KREL to SREL).
-@end table
-
-The smallest addressable unit is 16 bits (BITS_PER_UNIT is 16). This
-means that type `char' is represented with a 16-bit word per character.
-The 1750A's "Load/Store Upper/Lower Byte" instructions are not used by
-GNU CC.
-
-@item alpha-*-osf1
-Systems using processors that implement the DEC Alpha architecture and
-are running the DEC Unix (OSF/1) operating system, for example the DEC
-Alpha AXP systems.CC.)
-
-GNU CC writes a @samp{.verstamp} directive to the assembler output file
-unless it is built as a cross-compiler. It gets the version to use from
-the system header file @file{/usr/include/stamp.h}. If you install a
-new version of DEC Unix, you should rebuild GCC to pick up the new version
-stamp.
-
-Note that since the Alpha is a 64-bit architecture, cross-compilers from
-32-bit machines will not generate code as efficient as that generated
-when the compiler is running on a 64-bit machine because many
-optimizations that depend on being able to represent a word on the
-target in an integral value on the host cannot be performed. Building
-cross-compilers on the Alpha for 32-bit machines has only been tested in
-a few cases and may not work properly.
-
-@code{make compare} may fail on old versions of DEC Unix unless you add
-@samp{-save-temps} to @code{CFLAGS}. On these systems, the name of the
-assembler input file is stored in the object file, and that makes
-comparison fail if it differs between the @code{stage1} and
-@code{stage2} compilations. The option @samp{-save-temps} forces a
-fixed name to be used for the assembler input file, instead of a
-randomly chosen name in @file{/tmp}. Do not add @samp{-save-temps}
-unless the comparisons fail without that option. If you add
-@samp{-save-temps}, you will have to manually delete the @samp{.i} and
-@samp{.s} files after each series of compilations.
-
-GNU CC now supports both the native (ECOFF) debugging format used by DBX
-and GDB and an encapsulated STABS format for use only with GDB. See the
-discussion of the @samp{--with-stabs} option of @file{configure} above
-for more information on these formats and how to select them.
-
-There is a bug in DEC's assembler that produces incorrect line numbers
-for ECOFF format when the @samp{.align} directive is used. To work
-around this problem, GNU CC will not emit such alignment directives
-while writing ECOFF format debugging information even if optimization is
-being performed. Unfortunately, this has the very undesirable
-side-effect that code addresses when @samp{-O} is specified are
-different depending on whether or not @samp{-g} is also specified.
-
-To avoid this behavior, specify @samp{-gstabs+} and use GDB instead of
-DBX. DEC is now aware of this problem with the assembler and hopes to
-provide a fix shortly.
-
-@item arc-*-elf
-Argonaut ARC processor.
-This configuration is intended for embedded systems.
-
-@item arm-*-aout
-Advanced RISC Machines ARM-family processors. These are often used in
-embedded applications. There are no standard Unix configurations.
-This configuration corresponds to the basic instruction sequences and will
-produce @file{a.out} format object modules.
-
-You may need to make a variant of the file @file{arm.h} for your particular
-configuration.
-
-@item arm-*-linuxaout
-Any of the ARM family processors running the Linux-based GNU system with
-the @file{a.out} binary format (ELF is not yet supported). You must use
-version 2.8.1.0.7 or later of the GNU/Linux binutils, which you can download
-from @file{sunsite.unc.edu:/pub/Linux/GCC} and other mirror sites for
-Linux-based GNU systems.
-
-@item arm-*-riscix
-The ARM2 or ARM3 processor running RISC iX, Acorn's port of BSD Unix.
-If you are running a version of RISC iX prior to 1.2 then you must
-specify the version number during configuration. Note that the
-assembler shipped with RISC iX does not support stabs debugging
-information; a new version of the assembler, with stabs support
-included, is now available from Acorn and via ftp
-@file{ftp.acorn.com:/pub/riscix/as+xterm.tar.Z}. To enable stabs
-debugging, pass @samp{--with-gnu-as} to configure.
-
-You will need to install GNU @file{sed} before you can run configure.
-
-@item a29k
-AMD Am29k-family processors. These are normally used in embedded
-applications. There are no standard Unix configurations.
-This configuration
-corresponds to AMD's standard calling sequence and binary interface
-and is compatible with other 29k tools.
-
-You may need to make a variant of the file @file{a29k.h} for your
-particular configuration.
-
-@item a29k-*-bsd
-AMD Am29050 used in a system running a variant of BSD Unix.
-
-@item decstation-*
-MIPS-based DECstations can support three different personalities:
-Ultrix, DEC OSF/1, and OSF/rose. (Alpha-based DECstation products have
-a configuration name beginning with @samp{alpha-dec}.) To configure GCC
-for these platforms use the following configurations:
-
-@table @samp
-@item decstation-ultrix
-Ultrix configuration.
-
-@item decstation-osf1
-Dec's version of OSF/1.
-
-@item decstation-osfrose
-Open Software Foundation reference port of OSF/1 which uses the
-OSF/rose object file format instead of ECOFF. Normally, you
-would not select this configuration.
-@end table
-
-The MIPS C compiler needs to be told to increase its table size
-for switch statements with the @samp{-Wf,-XNg1500} option in
-order to compile @file{cp/parse.c}. If you use the @samp{-O2}
-optimization option, you also need to use @samp{-Olimit 3000}.
-Both of these options are automatically generated in the
-@file{Makefile} that the shell script @file{configure} builds.
-If you override the @code{CC} make variable and use the MIPS
-compilers, you may need to add @samp{-Wf,-XNg1500 -Olimit 3000}.
-
-@item elxsi-elxsi-bsd
-The Elxsi's C compiler has known limitations that prevent it from
-compiling GNU C. Please contact @code{mrs@@cygnus.com} for more details.
-
-@item dsp16xx
-A port to the AT&T DSP1610 family of processors.
-
-@ignore
-@item fx80
-Alliant FX/8 computer. Note that the standard installed C compiler in
-Concentrix 5.0 has a bug which prevent it from compiling GNU CC
-correctly. You can patch the compiler bug as follows:
-
-@smallexample
-cp /bin/pcc ./pcc
-adb -w ./pcc - << EOF
-15f6?w 6610
-EOF
-@end smallexample
-
-Then you must use the @samp{-ip12} option when compiling GNU CC
-with the patched compiler, as shown here:
-
-@smallexample
-make CC="./pcc -ip12" CFLAGS=-w
-@end smallexample
-
-Note also that Alliant's version of DBX does not manage to work with the
-output from GNU CC.
-@end ignore
-
-@item h8300-*-*
-Hitachi H8/300 series of processors.
-
-The calling convention and structure layout has changed in release 2.6.
-All code must be recompiled. The calling convention now passes the
-first three arguments in function calls in registers. Structures are no
-longer a multiple of 2 bytes.
-
-@item hppa*-*-*
-There are several variants of the HP-PA processor which run a variety
-of operating systems. GNU CC must be configured to use the correct
-processor type and operating system, or GNU CC will not function correctly.
-The easiest way to handle this problem is to @emph{not} specify a target
-when configuring GNU CC, the @file{configure} script will try to automatically
-determine the right processor type and operating system.
-
-@samp{-g} does not work on HP-UX, since that system uses a peculiar
-debugging format which GNU CC does not know about. However, @samp{-g}
-will work if you also use GAS and GDB in conjunction with GCC. We
-highly recommend using GAS for all HP-PA configurations.
-
-You should be using GAS-2.6 (or later) along with GDB-4.16 (or later). These
-can be retrieved from all the traditional GNU ftp archive sites.
-
-On some versions of HP-UX, you will need to install GNU @file{sed}.
-
-You will need to be install GAS into a directory before @code{/bin},
-@code{/usr/bin}, and @code{/usr/ccs/bin} in your search path. You
-should install GAS before you build GNU CC.
-
-To enable debugging, you must configure GNU CC with the @samp{--with-gnu-as}
-option before building.
-
-@item i370-*-*
-This port is very preliminary and has many known bugs. We hope to
-have a higher-quality port for this machine soon.
-
-@item i386-*-linux-gnuoldld
-Use this configuration to generate @file{a.out} binaries on Linux-based
-GNU systems if you do not have gas/binutils version 2.5.2 or later
-installed. This is an obsolete configuration.
-
-@item i386-*-linux-gnuaout
-Use this configuration to generate @file{a.out} binaries on Linux-based
-GNU systems. This configuration is being superseded. You must use
-gas/binutils version 2.5.2 or later.
-
-@item i386-*-linux-gnu
-Use this configuration to generate ELF binaries on Linux-based GNU
-systems. You must use gas/binutils version 2.5.2 or later.
-
-@item i386-*-sco
-Compilation with RCC is recommended. Also, it may be a good idea to
-link with GNU malloc instead of the malloc that comes with the system.
-
-@item i386-*-sco3.2v4
-Use this configuration for SCO release 3.2 version 4.
-
-@item i386-*-sco3.2v5*
-Use this for the SCO OpenServer Release family including 5.0.0, 5.0.2,
-5.0.4, 5.0.5, Internet FastStart 1.0, and Internet FastStart 1.1.
-
-GNU CC can generate COFF binaries if you specify @samp{-mcoff} or ELF
-binaries, the default. A full @samp{make bootstrap} is recommended
-so that an ELF compiler that builds ELF is generated.
-
-You must have TLS597 from @uref{ftp://ftp.sco.com/TLS} installed for ELF
-C++ binaries to work correctly on releases before 5.0.4.
-
-The native SCO assembler that is provided with the OS at no charge
-is normally required. If, however, you must be able to use the GNU
-assembler (perhaps you have complex asms) you must configure this
-package @samp{--with-gnu-as}. To do this, install (cp or symlink)
-gcc/as to your copy of the GNU assembler. You must use a recent version
-of GNU binutils; version 2.9.1 seems to work well. If you select this
-option, you will be unable to build COFF images. Trying to do so will
-result in non-obvious failures. In general, the "--with-gnu-as" option
-isn't as well tested as the native assembler.
-
-@emph{NOTE:} If you are building C++, you must follow the instructions
-about invoking @samp{make bootstrap} because the native OpenServer
-compiler may build a @file{cc1plus} that will not correctly parse many
-valid C++ programs. You must do a @samp{make bootstrap} if you are
-building with the native compiler.
-
-@item i386-*-isc
-It may be a good idea to link with GNU malloc instead of the malloc that
-comes with the system.
-
-In ISC version 4.1, @file{sed} core dumps when building
-@file{deduced.h}. Use the version of @file{sed} from version 4.0.
-
-@item i386-*-esix
-It may be good idea to link with GNU malloc instead of the malloc that
-comes with the system.
-
-@item i386-ibm-aix
-You need to use GAS version 2.1 or later, and LD from
-GNU binutils version 2.2 or later.
-
-@item i386-sequent-bsd
-Go to the Berkeley universe before compiling.
-
-@item i386-sequent-ptx1*
-@itemx i386-sequent-ptx2*
-You must install GNU @file{sed} before running @file{configure}.
-
-@item i386-sun-sunos4
-You may find that you need another version of GNU CC to begin
-bootstrapping with, since the current version when built with the
-system's own compiler seems to get an infinite loop compiling part of
-@file{libgcc2.c}. GNU CC version 2 compiled with GNU CC (any version)
-seems not to have this problem.
-
-See @ref{Sun Install}, for information on installing GNU CC on Sun
-systems.
-
-@item i[345]86-*-winnt3.5
-This version requires a GAS that has not yet been released. Until it
-is, you can get a prebuilt binary version via anonymous ftp from
-@file{cs.washington.edu:pub/gnat} or @file{cs.nyu.edu:pub/gnat}. You
-must also use the Microsoft header files from the Windows NT 3.5 SDK.
-Find these on the CDROM in the @file{/mstools/h} directory dated 9/4/94. You
-must use a fixed version of Microsoft linker made especially for NT 3.5,
-which is also is available on the NT 3.5 SDK CDROM. If you do not have
-this linker, can you also use the linker from Visual C/C++ 1.0 or 2.0.
-
-Installing GNU CC for NT builds a wrapper linker, called @file{ld.exe},
-which mimics the behaviour of Unix @file{ld} in the specification of
-libraries (@samp{-L} and @samp{-l}). @file{ld.exe} looks for both Unix
-and Microsoft named libraries. For example, if you specify
-@samp{-lfoo}, @file{ld.exe} will look first for @file{libfoo.a}
-and then for @file{foo.lib}.
-
-You may install GNU CC for Windows NT in one of two ways, depending on
-whether or not you have a Unix-like shell and various Unix-like
-utilities.
-
-@enumerate
-@item
-If you do not have a Unix-like shell and few Unix-like utilities, you
-will use a DOS style batch script called @file{configure.bat}. Invoke
-it as @code{configure winnt} from an MSDOS console window or from the
-program manager dialog box. @file{configure.bat} assumes you have
-already installed and have in your path a Unix-like @file{sed} program
-which is used to create a working @file{Makefile} from @file{Makefile.in}.
-
-@file{Makefile} uses the Microsoft Nmake program maintenance utility and
-the Visual C/C++ V8.00 compiler to build GNU CC. You need only have the
-utilities @file{sed} and @file{touch} to use this installation method,
-which only automatically builds the compiler itself. You must then
-examine what @file{fixinc.winnt} does, edit the header files by hand and
-build @file{libgcc.a} manually.
-
-@item
-The second type of installation assumes you are running a Unix-like
-shell, have a complete suite of Unix-like utilities in your path, and
-have a previous version of GNU CC already installed, either through
-building it via the above installation method or acquiring a pre-built
-binary. In this case, use the @file{configure} script in the normal
-fashion.
-@end enumerate
-
-@item i860-intel-osf1
-This is the Paragon.
-@ifset INSTALLONLY
-If you have version 1.0 of the operating system, you need to take
-special steps to build GNU CC due to peculiarities of the system. Newer
-system versions have no problem. See the section `Installation Problems'
-in the GNU CC Manual.
-@end ifset
-@ifclear INSTALLONLY
-If you have version 1.0 of the operating system,
-see @ref{Installation Problems}, for special things you need to do to
-compensate for peculiarities in the system.
-@end ifclear
-
-@item *-lynx-lynxos
-LynxOS 2.2 and earlier comes with GNU CC 1.x already installed as
-@file{/bin/gcc}. You should compile with this instead of @file{/bin/cc}.
-You can tell GNU CC to use the GNU assembler and linker, by specifying
-@samp{--with-gnu-as --with-gnu-ld} when configuring. These will produce
-COFF format object files and executables; otherwise GNU CC will use the
-installed tools, which produce @file{a.out} format executables.
-
-@item m32r-*-elf
-Mitsubishi M32R processor.
-This configuration is intended for embedded systems.
-
-@item m68000-hp-bsd
-HP 9000 series 200 running BSD. Note that the C compiler that comes
-with this system cannot compile GNU CC; contact @code{law@@cygnus.com}
-to get binaries of GNU CC for bootstrapping.
-
-@item m68k-altos
-Altos 3068. You must use the GNU assembler, linker and debugger.
-Also, you must fix a kernel bug. Details in the file @file{README.ALTOS}.
-
-@item m68k-apple-aux
-Apple Macintosh running A/UX.
-You may configure GCC to use either the system assembler and
-linker or the GNU assembler and linker. You should use the GNU configuration
-if you can, especially if you also want to use GNU C++. You enabled
-that configuration with + the @samp{--with-gnu-as} and @samp{--with-gnu-ld}
-options to @code{configure}.
-
-Note the C compiler that comes
-with this system cannot compile GNU CC. You can find binaries of GNU CC
-for bootstrapping on @code{jagubox.gsfc.nasa.gov}.
-You will also a patched version of @file{/bin/ld} there that
-raises some of the arbitrary limits found in the original.
-
-@item m68k-att-sysv
-AT&T 3b1, a.k.a. 7300 PC. Special procedures are needed to compile GNU
-CC with this machine's standard C compiler, due to bugs in that
-compiler. You can bootstrap it more easily with
-previous versions of GNU CC if you have them.
-
-Installing GNU CC on the 3b1 is difficult if you do not already have
-GNU CC running, due to bugs in the installed C compiler. However,
-the following procedure might work. We are unable to test it.
-
-@enumerate
-@item
-Comment out the @samp{#include "config.h"} line near the start of
-@file{cccp.c} and do @samp{make cpp}. This makes a preliminary version
-of GNU cpp.
-
-@item
-Save the old @file{/lib/cpp} and copy the preliminary GNU cpp to that
-file name.
-
-@item
-Undo your change in @file{cccp.c}, or reinstall the original version,
-and do @samp{make cpp} again.
-
-@item
-Copy this final version of GNU cpp into @file{/lib/cpp}.
-
-@findex obstack_free
-@item
-Replace every occurrence of @code{obstack_free} in the file
-@file{tree.c} with @code{_obstack_free}.
-
-@item
-Run @code{make} to get the first-stage GNU CC.
-
-@item
-Reinstall the original version of @file{/lib/cpp}.
-
-@item
-Now you can compile GNU CC with itself and install it in the normal
-fashion.
-@end enumerate
-
-@item m68k-bull-sysv
-Bull DPX/2 series 200 and 300 with BOS-2.00.45 up to BOS-2.01. GNU CC works
-either with native assembler or GNU assembler. You can use
-GNU assembler with native coff generation by providing @samp{--with-gnu-as} to
-the configure script or use GNU assembler with dbx-in-coff encapsulation
-by providing @samp{--with-gnu-as --stabs}. For any problem with native
-assembler or for availability of the DPX/2 port of GAS, contact
-@code{F.Pierresteguy@@frcl.bull.fr}.
-
-@item m68k-crds-unox
-Use @samp{configure unos} for building on Unos.
-
-The Unos assembler is named @code{casm} instead of @code{as}. For some
-strange reason linking @file{/bin/as} to @file{/bin/casm} changes the
-behavior, and does not work. So, when installing GNU CC, you should
-install the following script as @file{as} in the subdirectory where
-the passes of GCC are installed:
-
-@example
-#!/bin/sh
-casm $*
-@end example
-
-The default Unos library is named @file{libunos.a} instead of
-@file{libc.a}. To allow GNU CC to function, either change all
-references to @samp{-lc} in @file{gcc.c} to @samp{-lunos} or link
-@file{/lib/libc.a} to @file{/lib/libunos.a}.
-
-@cindex @code{alloca}, for Unos
-When compiling GNU CC with the standard compiler, to overcome bugs in
-the support of @code{alloca}, do not use @samp{-O} when making stage 2.
-Then use the stage 2 compiler with @samp{-O} to make the stage 3
-compiler. This compiler will have the same characteristics as the usual
-stage 2 compiler on other systems. Use it to make a stage 4 compiler
-and compare that with stage 3 to verify proper compilation.
-
-(Perhaps simply defining @code{ALLOCA} in @file{x-crds} as described in
-the comments there will make the above paragraph superfluous. Please
-inform us of whether this works.)
-
-Unos uses memory segmentation instead of demand paging, so you will need
-a lot of memory. 5 Mb is barely enough if no other tasks are running.
-If linking @file{cc1} fails, try putting the object files into a library
-and linking from that library.
-
-@item m68k-hp-hpux
-HP 9000 series 300 or 400 running HP-UX. HP-UX version 8.0 has a bug in
-the assembler that prevents compilation of GNU CC. To fix it, get patch
-PHCO_4484 from HP.
-
-In addition, if you wish to use gas @samp{--with-gnu-as} you must use
-gas version 2.1 or later, and you must use the GNU linker version 2.1 or
-later. Earlier versions of gas relied upon a program which converted the
-gas output into the native HP-UX format, but that program has not been
-kept up to date. gdb does not understand that native HP-UX format, so
-you must use gas if you wish to use gdb.
-
-@item m68k-sun
-Sun 3. We do not provide a configuration file to use the Sun FPA by
-default, because programs that establish signal handlers for floating
-point traps inherently cannot work with the FPA.
-
-See @ref{Sun Install}, for information on installing GNU CC on Sun
-systems.
-
-@item m88k-*-svr3
-Motorola m88k running the AT&T/Unisoft/Motorola V.3 reference port.
-These systems tend to use the Green Hills C, revision 1.8.5, as the
-standard C compiler. There are apparently bugs in this compiler that
-result in object files differences between stage 2 and stage 3. If this
-happens, make the stage 4 compiler and compare it to the stage 3
-compiler. If the stage 3 and stage 4 object files are identical, this
-suggests you encountered a problem with the standard C compiler; the
-stage 3 and 4 compilers may be usable.
-
-It is best, however, to use an older version of GNU CC for bootstrapping
-if you have one.
-
-@item m88k-*-dgux
-Motorola m88k running DG/UX. To build 88open BCS native or cross
-compilers on DG/UX, specify the configuration name as
-@samp{m88k-*-dguxbcs} and build in the 88open BCS software development
-environment. To build ELF native or cross compilers on DG/UX, specify
-@samp{m88k-*-dgux} and build in the DG/UX ELF development environment.
-You set the software development environment by issuing
-@samp{sde-target} command and specifying either @samp{m88kbcs} or
-@samp{m88kdguxelf} as the operand.
-
-If you do not specify a configuration name, @file{configure} guesses the
-configuration based on the current software development environment.
-
-@item m88k-tektronix-sysv3
-Tektronix XD88 running UTekV 3.2e. Do not turn on
-optimization while building stage1 if you bootstrap with
-the buggy Green Hills compiler. Also, The bundled LAI
-System V NFS is buggy so if you build in an NFS mounted
-directory, start from a fresh reboot, or avoid NFS all together.
-Otherwise you may have trouble getting clean comparisons
-between stages.
-
-@item mips-mips-bsd
-MIPS machines running the MIPS operating system in BSD mode. It's
-possible that some old versions of the system lack the functions
-@code{memcpy}, @code{memcmp}, and @code{memset}. If your system lacks
-these, you must remove or undo the definition of
-@code{TARGET_MEM_FUNCTIONS} in @file{mips-bsd.h}.
-
-The MIPS C compiler needs to be told to increase its table size
-for switch statements with the @samp{-Wf,-XNg1500} option in
-order to compile @file{cp/parse.c}. If you use the @samp{-O2}
-optimization option, you also need to use @samp{-Olimit 3000}.
-Both of these options are automatically generated in the
-@file{Makefile} that the shell script @file{configure} builds.
-If you override the @code{CC} make variable and use the MIPS
-compilers, you may need to add @samp{-Wf,-XNg1500 -Olimit 3000}.
-
-@item mips-mips-riscos*
-The MIPS C compiler needs to be told to increase its table size
-for switch statements with the @samp{-Wf,-XNg1500} option in
-order to compile @file{cp/parse.c}. If you use the @samp{-O2}
-optimization option, you also need to use @samp{-Olimit 3000}.
-Both of these options are automatically generated in the
-@file{Makefile} that the shell script @file{configure} builds.
-If you override the @code{CC} make variable and use the MIPS
-compilers, you may need to add @samp{-Wf,-XNg1500 -Olimit 3000}.
-
-MIPS computers running RISC-OS can support four different
-personalities: default, BSD 4.3, System V.3, and System V.4
-(older versions of RISC-OS don't support V.4). To configure GCC
-for these platforms use the following configurations:
-
-@table @samp
-@item mips-mips-riscos@code{rev}
-Default configuration for RISC-OS, revision @code{rev}.
-
-@item mips-mips-riscos@code{rev}bsd
-BSD 4.3 configuration for RISC-OS, revision @code{rev}.
-
-@item mips-mips-riscos@code{rev}sysv4
-System V.4 configuration for RISC-OS, revision @code{rev}.
-
-@item mips-mips-riscos@code{rev}sysv
-System V.3 configuration for RISC-OS, revision @code{rev}.
-@end table
-
-The revision @code{rev} mentioned above is the revision of
-RISC-OS to use. You must reconfigure GCC when going from a
-RISC-OS revision 4 to RISC-OS revision 5. This has the effect of
-avoiding a linker
-@ifclear INSTALLONLY
-bug (see @ref{Installation Problems}, for more details).
-@end ifclear
-@ifset INSTALLONLY
-bug.
-@end ifset
-
-@item mips-sgi-*
-In order to compile GCC on an SGI running IRIX 4, the "c.hdr.lib"
-option must be installed from the CD-ROM supplied from Silicon Graphics.
-This is found on the 2nd CD in release 4.0.1.
-
-In order to compile GCC on an SGI running IRIX 5, the "compiler_dev.hdr"
-subsystem must be installed from the IDO CD-ROM supplied by Silicon
-Graphics.
-
-@code{make compare} may fail on version 5 of IRIX unless you add
-@samp{-save-temps} to @code{CFLAGS}. On these systems, the name of the
-assembler input file is stored in the object file, and that makes
-comparison fail if it differs between the @code{stage1} and
-@code{stage2} compilations. The option @samp{-save-temps} forces a
-fixed name to be used for the assembler input file, instead of a
-randomly chosen name in @file{/tmp}. Do not add @samp{-save-temps}
-unless the comparisons fail without that option. If you do you
-@samp{-save-temps}, you will have to manually delete the @samp{.i} and
-@samp{.s} files after each series of compilations.
-
-The MIPS C compiler needs to be told to increase its table size
-for switch statements with the @samp{-Wf,-XNg1500} option in
-order to compile @file{cp/parse.c}. If you use the @samp{-O2}
-optimization option, you also need to use @samp{-Olimit 3000}.
-Both of these options are automatically generated in the
-@file{Makefile} that the shell script @file{configure} builds.
-If you override the @code{CC} make variable and use the MIPS
-compilers, you may need to add @samp{-Wf,-XNg1500 -Olimit 3000}.
-
-On Irix version 4.0.5F, and perhaps on some other versions as well,
-there is an assembler bug that reorders instructions incorrectly. To
-work around it, specify the target configuration
-@samp{mips-sgi-irix4loser}. This configuration inhibits assembler
-optimization.
-
-In a compiler configured with target @samp{mips-sgi-irix4}, you can turn
-off assembler optimization by using the @samp{-noasmopt} option. This
-compiler option passes the option @samp{-O0} to the assembler, to
-inhibit reordering.
-
-The @samp{-noasmopt} option can be useful for testing whether a problem
-is due to erroneous assembler reordering. Even if a problem does not go
-away with @samp{-noasmopt}, it may still be due to assembler
-reordering---perhaps GNU CC itself was miscompiled as a result.
-
-To enable debugging under Irix 5, you must use GNU as 2.5 or later,
-and use the @samp{--with-gnu-as} configure option when configuring gcc.
-GNU as is distributed as part of the binutils package.
-
-@item mips-sony-sysv
-Sony MIPS NEWS. This works in NEWSOS 5.0.1, but not in 5.0.2 (which
-uses ELF instead of COFF). Support for 5.0.2 will probably be provided
-soon by volunteers. In particular, the linker does not like the
-code generated by GCC when shared libraries are linked in.
-
-@item ns32k-encore
-Encore ns32000 system. Encore systems are supported only under BSD.
-
-@item ns32k-*-genix
-National Semiconductor ns32000 system. Genix has bugs in @code{alloca}
-and @code{malloc}; you must get the compiled versions of these from GNU
-Emacs.
-
-@item ns32k-sequent
-Go to the Berkeley universe before compiling.
-
-@item ns32k-utek
-UTEK ns32000 system (``merlin''). The C compiler that comes with this
-system cannot compile GNU CC; contact @samp{tektronix!reed!mason} to get
-binaries of GNU CC for bootstrapping.
-
-@item romp-*-aos
-@itemx romp-*-mach
-The only operating systems supported for the IBM RT PC are AOS and
-MACH. GNU CC does not support AIX running on the RT. We recommend you
-compile GNU CC with an earlier version of itself; if you compile GNU CC
-with @code{hc}, the Metaware compiler, it will work, but you will get
-mismatches between the stage 2 and stage 3 compilers in various files.
-These errors are minor differences in some floating-point constants and
-can be safely ignored; the stage 3 compiler is correct.
-
-@item rs6000-*-aix
-@itemx powerpc-*-aix
-Various early versions of each release of the IBM XLC compiler will not
-bootstrap GNU CC. Symptoms include differences between the stage2 and
-stage3 object files, and errors when compiling @file{libgcc.a} or
-@file{enquire}. Known problematic releases include: xlc-1.2.1.8,
-xlc-1.3.0.0 (distributed with AIX 3.2.5), and xlc-1.3.0.19. Both
-xlc-1.2.1.28 and xlc-1.3.0.24 (PTF 432238) are known to produce working
-versions of GNU CC, but most other recent releases correctly bootstrap
-GNU CC.
-
-Release 4.3.0 of AIX and ones prior to AIX 3.2.4 include a version of
-the IBM assembler which does not accept debugging directives: assembler
-updates are available as PTFs. Also, if you are using AIX 3.2.5 or
-greater and the GNU assembler, you must have a version modified after
-October 16th, 1995 in order for the GNU C compiler to build. See the
-file @file{README.RS6000} for more details on any of these problems.
-
-GNU CC does not yet support the 64-bit PowerPC instructions.
-
-Objective C does not work on this architecture because it makes assumptions
-that are incompatible with the calling conventions.
-
-AIX on the RS/6000 provides support (NLS) for environments outside of
-the United States. Compilers and assemblers use NLS to support
-locale-specific representations of various objects including
-floating-point numbers ("." vs "," for separating decimal fractions).
-There have been problems reported where the library linked with GNU CC
-does not produce the same floating-point formats that the assembler
-accepts. If you have this problem, set the LANG environment variable to
-"C" or "En_US".
-
-Due to changes in the way that GNU CC invokes the binder (linker) for AIX
-4.1, you may now receive warnings of duplicate symbols from the link step
-that were not reported before. The assembly files generated by GNU CC for
-AIX have always included multiple symbol definitions for certain global
-variable and function declarations in the original program. The warnings
-should not prevent the linker from producing a correct library or runnable
-executable.
-
-By default, AIX 4.1 produces code that can be used on either Power or
-PowerPC processors.
-
-You can specify a default version for the @samp{-mcpu=}@var{cpu_type}
-switch by using the configure option @samp{--with-cpu-}@var{cpu_type}.
-
-@item powerpc-*-elf
-@itemx powerpc-*-sysv4
-PowerPC system in big endian mode, running System V.4.
-
-You can specify a default version for the @samp{-mcpu=}@var{cpu_type}
-switch by using the configure option @samp{--with-cpu-}@var{cpu_type}.
-
-@item powerpc-*-linux-gnu
-PowerPC system in big endian mode, running the Linux-based GNU system.
-
-You can specify a default version for the @samp{-mcpu=}@var{cpu_type}
-switch by using the configure option @samp{--with-cpu-}@var{cpu_type}.
-
-@item powerpc-*-eabiaix
-Embedded PowerPC system in big endian mode with -mcall-aix selected as
-the default.
-
-You can specify a default version for the @samp{-mcpu=}@var{cpu_type}
-switch by using the configure option @samp{--with-cpu-}@var{cpu_type}.
-
-@item powerpc-*-eabisim
-Embedded PowerPC system in big endian mode for use in running under the
-PSIM simulator.
-
-You can specify a default version for the @samp{-mcpu=}@var{cpu_type}
-switch by using the configure option @samp{--with-cpu-}@var{cpu_type}.
-
-@item powerpc-*-eabi
-Embedded PowerPC system in big endian mode.
-
-You can specify a default version for the @samp{-mcpu=}@var{cpu_type}
-switch by using the configure option @samp{--with-cpu-}@var{cpu_type}.
-
-@item powerpcle-*-elf
-@itemx powerpcle-*-sysv4
-PowerPC system in little endian mode, running System V.4.
-
-You can specify a default version for the @samp{-mcpu=}@var{cpu_type}
-switch by using the configure option @samp{--with-cpu-}@var{cpu_type}.
-
-@item powerpcle-*-solaris2*
-PowerPC system in little endian mode, running Solaris 2.5.1 or higher.
-
-You can specify a default version for the @samp{-mcpu=}@var{cpu_type}
-switch by using the configure option @samp{--with-cpu-}@var{cpu_type}.
-Beta versions of the Sun 4.0 compiler do not seem to be able to build
-GNU CC correctly. There are also problems with the host assembler and
-linker that are fixed by using the GNU versions of these tools.
-
-@item powerpcle-*-eabisim
-Embedded PowerPC system in little endian mode for use in running under
-the PSIM simulator.
-
-@itemx powerpcle-*-eabi
-Embedded PowerPC system in little endian mode.
-
-You can specify a default version for the @samp{-mcpu=}@var{cpu_type}
-switch by using the configure option @samp{--with-cpu-}@var{cpu_type}.
-
-@item powerpcle-*-winnt
-@itemx powerpcle-*-pe
-PowerPC system in little endian mode running Windows NT.
-
-You can specify a default version for the @samp{-mcpu=}@var{cpu_type}
-switch by using the configure option @samp{--with-cpu-}@var{cpu_type}.
-
-@item vax-dec-ultrix
-Don't try compiling with Vax C (@code{vcc}). It produces incorrect code
-in some cases (for example, when @code{alloca} is used).
-
-Meanwhile, compiling @file{cp/parse.c} with pcc does not work because of
-an internal table size limitation in that compiler. To avoid this
-problem, compile just the GNU C compiler first, and use it to recompile
-building all the languages that you want to run.
-
-@item sparc-sun-*
-See @ref{Sun Install}, for information on installing GNU CC on Sun
-systems.
-
-@item vax-dec-vms
-See @ref{VMS Install}, for details on how to install GNU CC on VMS.
-
-@item we32k-*-*
-These computers are also known as the 3b2, 3b5, 3b20 and other similar
-names. (However, the 3b1 is actually a 68000; see
-@ref{Configurations}.)
-
-Don't use @samp{-g} when compiling with the system's compiler. The
-system's linker seems to be unable to handle such a large program with
-debugging information.
-
-The system's compiler runs out of capacity when compiling @file{stmt.c}
-in GNU CC. You can work around this by building @file{cpp} in GNU CC
-first, then use that instead of the system's preprocessor with the
-system's C compiler to compile @file{stmt.c}. Here is how:
-
-@smallexample
-mv /lib/cpp /lib/cpp.att
-cp cpp /lib/cpp.gnu
-echo '/lib/cpp.gnu -traditional $@{1+"$@@"@}' > /lib/cpp
-chmod +x /lib/cpp
-@end smallexample
-
-The system's compiler produces bad code for some of the GNU CC
-optimization files. So you must build the stage 2 compiler without
-optimization. Then build a stage 3 compiler with optimization.
-That executable should work. Here are the necessary commands:
-
-@smallexample
-make LANGUAGES=c CC=stage1/xgcc CFLAGS="-Bstage1/ -g"
-make stage2
-make CC=stage2/xgcc CFLAGS="-Bstage2/ -g -O"
-@end smallexample
-
-You may need to raise the ULIMIT setting to build a C++ compiler,
-as the file @file{cc1plus} is larger than one megabyte.
-@end table
-
-@node Other Dir
-@section Compilation in a Separate Directory
-@cindex other directory, compilation in
-@cindex compilation in a separate directory
-@cindex separate directory, compilation in
-
-If you wish to build the object files and executables in a directory
-other than the one containing the source files, here is what you must
-do differently:
-
-@enumerate
-@item
-Make sure you have a version of Make that supports the @code{VPATH}
-feature. (GNU Make supports it, as do Make versions on most BSD
-systems.)
-
-@item
-If you have ever run @file{configure} in the source directory, you must undo
-the configuration. Do this by running:
-
-@example
-make distclean
-@end example
-
-@item
-Go to the directory in which you want to build the compiler before
-running @file{configure}:
-
-@example
-mkdir gcc-sun3
-cd gcc-sun3
-@end example
-
-On systems that do not support symbolic links, this directory must be
-on the same file system as the source code directory.
-
-@item
-Specify where to find @file{configure} when you run it:
-
-@example
-../gcc/configure @dots{}
-@end example
-
-This also tells @code{configure} where to find the compiler sources;
-@code{configure} takes the directory from the file name that was used to
-invoke it. But if you want to be sure, you can specify the source
-directory with the @samp{--srcdir} option, like this:
-
-@example
-../gcc/configure --srcdir=../gcc @var{other options}
-@end example
-
-The directory you specify with @samp{--srcdir} need not be the same
-as the one that @code{configure} is found in.
-@end enumerate
-
-Now, you can run @code{make} in that directory. You need not repeat the
-configuration steps shown above, when ordinary source files change. You
-must, however, run @code{configure} again when the configuration files
-change, if your system does not support symbolic links.
-
-@node Cross-Compiler
-@section Building and Installing a Cross-Compiler
-@cindex cross-compiler, installation
-
-GNU CC can function as a cross-compiler for many machines, but not all.
-
-@itemize @bullet
-@item
-Cross-compilers for the Mips as target using the Mips assembler
-currently do not work, because the auxiliary programs
-@file{mips-tdump.c} and @file{mips-tfile.c} can't be compiled on
-anything but a Mips. It does work to cross compile for a Mips
-if you use the GNU assembler and linker.
-
-@item
-Cross-compilers between machines with different floating point formats
-have not all been made to work. GNU CC now has a floating point
-emulator with which these can work, but each target machine description
-needs to be updated to take advantage of it.
-
-@item
-Cross-compilation between machines of different word sizes is
-somewhat problematic and sometimes does not work.
-@end itemize
-
-Since GNU CC generates assembler code, you probably need a
-cross-assembler that GNU CC can run, in order to produce object files.
-If you want to link on other than the target machine, you need a
-cross-linker as well. You also need header files and libraries suitable
-for the target machine that you can install on the host machine.
-
-@menu
-* Steps of Cross:: Using a cross-compiler involves several steps
- that may be carried out on different machines.
-* Configure Cross:: Configuring a cross-compiler.
-* Tools and Libraries:: Where to put the linker and assembler, and the C library.
-* Cross Headers:: Finding and installing header files
- for a cross-compiler.
-* Cross Runtime:: Supplying arithmetic runtime routines (@file{libgcc1.a}).
-* Build Cross:: Actually compiling the cross-compiler.
-@end menu
-
-@node Steps of Cross
-@subsection Steps of Cross-Compilation
-
-To compile and run a program using a cross-compiler involves several
-steps:
-
-@itemize @bullet
-@item
-Run the cross-compiler on the host machine to produce assembler files
-for the target machine. This requires header files for the target
-machine.
-
-@item
-Assemble the files produced by the cross-compiler. You can do this
-either with an assembler on the target machine, or with a
-cross-assembler on the host machine.
-
-@item
-Link those files to make an executable. You can do this either with a
-linker on the target machine, or with a cross-linker on the host
-machine. Whichever machine you use, you need libraries and certain
-startup files (typically @file{crt@dots{}.o}) for the target machine.
-@end itemize
-
-It is most convenient to do all of these steps on the same host machine,
-since then you can do it all with a single invocation of GNU CC. This
-requires a suitable cross-assembler and cross-linker. For some targets,
-the GNU assembler and linker are available.
-
-@node Configure Cross
-@subsection Configuring a Cross-Compiler
-
-To build GNU CC as a cross-compiler, you start out by running
-@file{configure}. Use the @samp{--target=@var{target}} to specify the
-target type. If @file{configure} was unable to correctly identify the
-system you are running on, also specify the @samp{--build=@var{build}}
-option. For example, here is how to configure for a cross-compiler that
-produces code for an HP 68030 system running BSD on a system that
-@file{configure} can correctly identify:
-
-@smallexample
-./configure --target=m68k-hp-bsd4.3
-@end smallexample
-
-@node Tools and Libraries
-@subsection Tools and Libraries for a Cross-Compiler
-
-If you have a cross-assembler and cross-linker available, you should
-install them now. Put them in the directory
-@file{/usr/local/@var{target}/bin}. Here is a table of the tools
-you should put in this directory:
-
-@table @file
-@item as
-This should be the cross-assembler.
-
-@item ld
-This should be the cross-linker.
-
-@item ar
-This should be the cross-archiver: a program which can manipulate
-archive files (linker libraries) in the target machine's format.
-
-@item ranlib
-This should be a program to construct a symbol table in an archive file.
-@end table
-
-The installation of GNU CC will find these programs in that directory,
-and copy or link them to the proper place to for the cross-compiler to
-find them when run later.
-
-The easiest way to provide these files is to build the Binutils package
-and GAS. Configure them with the same @samp{--host} and @samp{--target}
-options that you use for configuring GNU CC, then build and install
-them. They install their executables automatically into the proper
-directory. Alas, they do not support all the targets that GNU CC
-supports.
-
-If you want to install libraries to use with the cross-compiler, such as
-a standard C library, put them in the directory
-@file{/usr/local/@var{target}/lib}; installation of GNU CC copies
-all the files in that subdirectory into the proper place for GNU CC to
-find them and link with them. Here's an example of copying some
-libraries from a target machine:
-
-@example
-ftp @var{target-machine}
-lcd /usr/local/@var{target}/lib
-cd /lib
-get libc.a
-cd /usr/lib
-get libg.a
-get libm.a
-quit
-@end example
-
-@noindent
-The precise set of libraries you'll need, and their locations on
-the target machine, vary depending on its operating system.
-
-@cindex start files
-Many targets require ``start files'' such as @file{crt0.o} and
-@file{crtn.o} which are linked into each executable; these too should be
-placed in @file{/usr/local/@var{target}/lib}. There may be several
-alternatives for @file{crt0.o}, for use with profiling or other
-compilation options. Check your target's definition of
-@code{STARTFILE_SPEC} to find out what start files it uses.
-Here's an example of copying these files from a target machine:
-
-@example
-ftp @var{target-machine}
-lcd /usr/local/@var{target}/lib
-prompt
-cd /lib
-mget *crt*.o
-cd /usr/lib
-mget *crt*.o
-quit
-@end example
-
-@node Cross Runtime
-@subsection @file{libgcc.a} and Cross-Compilers
-
-Code compiled by GNU CC uses certain runtime support functions
-implicitly. Some of these functions can be compiled successfully with
-GNU CC itself, but a few cannot be. These problem functions are in the
-source file @file{libgcc1.c}; the library made from them is called
-@file{libgcc1.a}.
-
-When you build a native compiler, these functions are compiled with some
-other compiler--the one that you use for bootstrapping GNU CC.
-Presumably it knows how to open code these operations, or else knows how
-to call the run-time emulation facilities that the machine comes with.
-But this approach doesn't work for building a cross-compiler. The
-compiler that you use for building knows about the host system, not the
-target system.
-
-So, when you build a cross-compiler you have to supply a suitable
-library @file{libgcc1.a} that does the job it is expected to do.
-
-To compile @file{libgcc1.c} with the cross-compiler itself does not
-work. The functions in this file are supposed to implement arithmetic
-operations that GNU CC does not know how to open code for your target
-machine. If these functions are compiled with GNU CC itself, they
-will compile into infinite recursion.
-
-On any given target, most of these functions are not needed. If GNU CC
-can open code an arithmetic operation, it will not call these functions
-to perform the operation. It is possible that on your target machine,
-none of these functions is needed. If so, you can supply an empty
-library as @file{libgcc1.a}.
-
-Many targets need library support only for multiplication and division.
-If you are linking with a library that contains functions for
-multiplication and division, you can tell GNU CC to call them directly
-by defining the macros @code{MULSI3_LIBCALL}, and the like. These
-macros need to be defined in the target description macro file. For
-some targets, they are defined already. This may be sufficient to
-avoid the need for libgcc1.a; if so, you can supply an empty library.
-
-Some targets do not have floating point instructions; they need other
-functions in @file{libgcc1.a}, which do floating arithmetic.
-Recent versions of GNU CC have a file which emulates floating point.
-With a certain amount of work, you should be able to construct a
-floating point emulator that can be used as @file{libgcc1.a}. Perhaps
-future versions will contain code to do this automatically and
-conveniently. That depends on whether someone wants to implement it.
-
-Some embedded targets come with all the necessary @file{libgcc1.a}
-routines written in C or assembler. These targets build
-@file{libgcc1.a} automatically and you do not need to do anything
-special for them. Other embedded targets do not need any
-@file{libgcc1.a} routines since all the necessary operations are
-supported by the hardware.
-
-If your target system has another C compiler, you can configure GNU CC
-as a native compiler on that machine, build just @file{libgcc1.a} with
-@samp{make libgcc1.a} on that machine, and use the resulting file with
-the cross-compiler. To do this, execute the following on the target
-machine:
-
-@example
-cd @var{target-build-dir}
-./configure --host=sparc --target=sun3
-make libgcc1.a
-@end example
-
-@noindent
-And then this on the host machine:
-
-@example
-ftp @var{target-machine}
-binary
-cd @var{target-build-dir}
-get libgcc1.a
-quit
-@end example
-
-Another way to provide the functions you need in @file{libgcc1.a} is to
-define the appropriate @code{perform_@dots{}} macros for those
-functions. If these definitions do not use the C arithmetic operators
-that they are meant to implement, you should be able to compile them
-with the cross-compiler you are building. (If these definitions already
-exist for your target file, then you are all set.)
-
-To build @file{libgcc1.a} using the perform macros, use
-@samp{LIBGCC1=libgcc1.a OLDCC=./xgcc} when building the compiler.
-Otherwise, you should place your replacement library under the name
-@file{libgcc1.a} in the directory in which you will build the
-cross-compiler, before you run @code{make}.
-
-@node Cross Headers
-@subsection Cross-Compilers and Header Files
-
-If you are cross-compiling a standalone program or a program for an
-embedded system, then you may not need any header files except the few
-that are part of GNU CC (and those of your program). However, if you
-intend to link your program with a standard C library such as
-@file{libc.a}, then you probably need to compile with the header files
-that go with the library you use.
-
-The GNU C compiler does not come with these files, because (1) they are
-system-specific, and (2) they belong in a C library, not in a compiler.
-
-If the GNU C library supports your target machine, then you can get the
-header files from there (assuming you actually use the GNU library when
-you link your program).
-
-If your target machine comes with a C compiler, it probably comes with
-suitable header files also. If you make these files accessible from the host
-machine, the cross-compiler can use them also.
-
-Otherwise, you're on your own in finding header files to use when
-cross-compiling.
-
-When you have found suitable header files, put them in the directory
-@file{/usr/local/@var{target}/include}, before building the cross
-compiler. Then installation will run fixincludes properly and install
-the corrected versions of the header files where the compiler will use
-them.
-
-Provide the header files before you build the cross-compiler, because
-the build stage actually runs the cross-compiler to produce parts of
-@file{libgcc.a}. (These are the parts that @emph{can} be compiled with
-GNU CC.) Some of them need suitable header files.
-
-Here's an example showing how to copy the header files from a target
-machine. On the target machine, do this:
-
-@example
-(cd /usr/include; tar cf - .) > tarfile
-@end example
-
-Then, on the host machine, do this:
-
-@example
-ftp @var{target-machine}
-lcd /usr/local/@var{target}/include
-get tarfile
-quit
-tar xf tarfile
-@end example
-
-@node Build Cross
-@subsection Actually Building the Cross-Compiler
-
-Now you can proceed just as for compiling a single-machine compiler
-through the step of building stage 1. If you have not provided some
-sort of @file{libgcc1.a}, then compilation will give up at the point
-where it needs that file, printing a suitable error message. If you
-do provide @file{libgcc1.a}, then building the compiler will automatically
-compile and link a test program called @file{libgcc1-test}; if you get
-errors in the linking, it means that not all of the necessary routines
-in @file{libgcc1.a} are available.
-
-You must provide the header file @file{float.h}. One way to do this is
-to compile @file{enquire} and run it on your target machine. The job of
-@file{enquire} is to run on the target machine and figure out by
-experiment the nature of its floating point representation.
-@file{enquire} records its findings in the header file @file{float.h}.
-If you can't produce this file by running @file{enquire} on the target
-machine, then you will need to come up with a suitable @file{float.h} in
-some other way (or else, avoid using it in your programs).
-
-Do not try to build stage 2 for a cross-compiler. It doesn't work to
-rebuild GNU CC as a cross-compiler using the cross-compiler, because
-that would produce a program that runs on the target machine, not on the
-host. For example, if you compile a 386-to-68030 cross-compiler with
-itself, the result will not be right either for the 386 (because it was
-compiled into 68030 code) or for the 68030 (because it was configured
-for a 386 as the host). If you want to compile GNU CC into 68030 code,
-whether you compile it on a 68030 or with a cross-compiler on a 386, you
-must specify a 68030 as the host when you configure it.
-
-To install the cross-compiler, use @samp{make install}, as usual.
-
-@node Sun Install
-@section Installing GNU CC on the Sun
-@cindex Sun installation
-@cindex installing GNU CC on the Sun
-
-On Solaris, do not use the linker or other tools in
-@file{/usr/ucb} to build GNU CC. Use @code{/usr/ccs/bin}.
-
-If the assembler reports @samp{Error: misaligned data} when bootstrapping,
-you are probably using an obsolete version of the GNU assembler. Upgrade
-to the latest version of GNU @code{binutils}, or use the Solaris assembler.
-
-Make sure the environment variable @code{FLOAT_OPTION} is not set when
-you compile @file{libgcc.a}. If this option were set to @code{f68881}
-when @file{libgcc.a} is compiled, the resulting code would demand to be
-linked with a special startup file and would not link properly without
-special pains.
-
-@cindex @code{alloca}, for SunOS
-There is a bug in @code{alloca} in certain versions of the Sun library.
-To avoid this bug, install the binaries of GNU CC that were compiled by
-GNU CC. They use @code{alloca} as a built-in function and never the one
-in the library.
-
-Some versions of the Sun compiler crash when compiling GNU CC. The
-problem is a segmentation fault in cpp. This problem seems to be due to
-the bulk of data in the environment variables. You may be able to avoid
-it by using the following command to compile GNU CC with Sun CC:
-
-@example
-make CC="TERMCAP=x OBJS=x LIBFUNCS=x STAGESTUFF=x cc"
-@end example
-
-SunOS 4.1.3 and 4.1.3_U1 have bugs that can cause intermittent core
-dumps when compiling GNU CC. A common symptom is an
-internal compiler error which does not recur if you run it again.
-To fix the problem, install Sun recommended patch 100726 (for SunOS 4.1.3)
-or 101508 (for SunOS 4.1.3_U1), or upgrade to a later SunOS release.
-
-@node VMS Install
-@section Installing GNU CC on VMS
-@cindex VMS installation
-@cindex installing GNU CC on VMS
-
-The VMS version of GNU CC is distributed in a backup saveset containing
-both source code and precompiled binaries.
-
-To install the @file{gcc} command so you can use the compiler easily, in
-the same manner as you use the VMS C compiler, you must install the VMS CLD
-file for GNU CC as follows:
-
-@enumerate
-@item
-Define the VMS logical names @samp{GNU_CC} and @samp{GNU_CC_INCLUDE}
-to point to the directories where the GNU CC executables
-(@file{gcc-cpp.exe}, @file{gcc-cc1.exe}, etc.) and the C include files are
-kept respectively. This should be done with the commands:@refill
-
-@smallexample
-$ assign /system /translation=concealed -
- disk:[gcc.] gnu_cc
-$ assign /system /translation=concealed -
- disk:[gcc.include.] gnu_cc_include
-@end smallexample
-
-@noindent
-with the appropriate disk and directory names. These commands can be
-placed in your system startup file so they will be executed whenever
-the machine is rebooted. You may, if you choose, do this via the
-@file{GCC_INSTALL.COM} script in the @file{[GCC]} directory.
-
-@item
-Install the @file{GCC} command with the command line:
-
-@smallexample
-$ set command /table=sys$common:[syslib]dcltables -
- /output=sys$common:[syslib]dcltables gnu_cc:[000000]gcc
-$ install replace sys$common:[syslib]dcltables
-@end smallexample
-
-@item
-To install the help file, do the following:
-
-@smallexample
-$ library/help sys$library:helplib.hlb gcc.hlp
-@end smallexample
-
-@noindent
-Now you can invoke the compiler with a command like @samp{gcc /verbose
-file.c}, which is equivalent to the command @samp{gcc -v -c file.c} in
-Unix.
-@end enumerate
-
-If you wish to use GNU C++ you must first install GNU CC, and then
-perform the following steps:
-
-@enumerate
-@item
-Define the VMS logical name @samp{GNU_GXX_INCLUDE} to point to the
-directory where the preprocessor will search for the C++ header files.
-This can be done with the command:@refill
-
-@smallexample
-$ assign /system /translation=concealed -
- disk:[gcc.gxx_include.] gnu_gxx_include
-@end smallexample
-
-@noindent
-with the appropriate disk and directory name. If you are going to be
-using a C++ runtime library, this is where its install procedure will install
-its header files.
-
-@item
-Obtain the file @file{gcc-cc1plus.exe}, and place this in the same
-directory that @file{gcc-cc1.exe} is kept.
-
-The GNU C++ compiler can be invoked with a command like @samp{gcc /plus
-/verbose file.cc}, which is equivalent to the command @samp{g++ -v -c
-file.cc} in Unix.
-@end enumerate
-
-We try to put corresponding binaries and sources on the VMS distribution
-tape. But sometimes the binaries will be from an older version than the
-sources, because we don't always have time to update them. (Use the
-@samp{/version} option to determine the version number of the binaries and
-compare it with the source file @file{version.c} to tell whether this is
-so.) In this case, you should use the binaries you get to recompile the
-sources. If you must recompile, here is how:
-
-@enumerate
-@item
-Execute the command procedure @file{vmsconfig.com} to set up the files
-@file{tm.h}, @file{config.h}, @file{aux-output.c}, and @file{md.}, and
-to create files @file{tconfig.h} and @file{hconfig.h}. This procedure
-also creates several linker option files used by @file{make-cc1.com} and
-a data file used by @file{make-l2.com}.@refill
-
-@smallexample
-$ @@vmsconfig.com
-@end smallexample
-
-@item
-Setup the logical names and command tables as defined above. In
-addition, define the VMS logical name @samp{GNU_BISON} to point at the
-to the directories where the Bison executable is kept. This should be
-done with the command:@refill
-
-@smallexample
-$ assign /system /translation=concealed -
- disk:[bison.] gnu_bison
-@end smallexample
-
-You may, if you choose, use the @file{INSTALL_BISON.COM} script in the
-@file{[BISON]} directory.
-
-@item
-Install the @samp{BISON} command with the command line:@refill
-
-@smallexample
-$ set command /table=sys$common:[syslib]dcltables -
- /output=sys$common:[syslib]dcltables -
- gnu_bison:[000000]bison
-$ install replace sys$common:[syslib]dcltables
-@end smallexample
-
-@item
-Type @samp{@@make-gcc} to recompile everything (alternatively, submit
-the file @file{make-gcc.com} to a batch queue). If you wish to build
-the GNU C++ compiler as well as the GNU CC compiler, you must first edit
-@file{make-gcc.com} and follow the instructions that appear in the
-comments.@refill
-
-@item
-In order to use GCC, you need a library of functions which GCC compiled code
-will call to perform certain tasks, and these functions are defined in the
-file @file{libgcc2.c}. To compile this you should use the command procedure
-@file{make-l2.com}, which will generate the library @file{libgcc2.olb}.
-@file{libgcc2.olb} should be built using the compiler built from
-the same distribution that @file{libgcc2.c} came from, and
-@file{make-gcc.com} will automatically do all of this for you.
-
-To install the library, use the following commands:@refill
-
-@smallexample
-$ library gnu_cc:[000000]gcclib/delete=(new,eprintf)
-$ library gnu_cc:[000000]gcclib/delete=L_*
-$ library libgcc2/extract=*/output=libgcc2.obj
-$ library gnu_cc:[000000]gcclib libgcc2.obj
-@end smallexample
-
-The first command simply removes old modules that will be replaced with
-modules from @file{libgcc2} under different module names. The modules
-@code{new} and @code{eprintf} may not actually be present in your
-@file{gcclib.olb}---if the VMS librarian complains about those modules
-not being present, simply ignore the message and continue on with the
-next command. The second command removes the modules that came from the
-previous version of the library @file{libgcc2.c}.
-
-Whenever you update the compiler on your system, you should also update the
-library with the above procedure.
-
-@item
-You may wish to build GCC in such a way that no files are written to the
-directory where the source files reside. An example would be the when
-the source files are on a read-only disk. In these cases, execute the
-following DCL commands (substituting your actual path names):
-
-@smallexample
-$ assign dua0:[gcc.build_dir.]/translation=concealed, -
- dua1:[gcc.source_dir.]/translation=concealed gcc_build
-$ set default gcc_build:[000000]
-@end smallexample
-
-@noindent
-where the directory @file{dua1:[gcc.source_dir]} contains the source
-code, and the directory @file{dua0:[gcc.build_dir]} is meant to contain
-all of the generated object files and executables. Once you have done
-this, you can proceed building GCC as described above. (Keep in mind
-that @file{gcc_build} is a rooted logical name, and thus the device
-names in each element of the search list must be an actual physical
-device name rather than another rooted logical name).
-
-@item
-@strong{If you are building GNU CC with a previous version of GNU CC,
-you also should check to see that you have the newest version of the
-assembler}. In particular, GNU CC version 2 treats global constant
-variables slightly differently from GNU CC version 1, and GAS version
-1.38.1 does not have the patches required to work with GCC version 2.
-If you use GAS 1.38.1, then @code{extern const} variables will not have
-the read-only bit set, and the linker will generate warning messages
-about mismatched psect attributes for these variables. These warning
-messages are merely a nuisance, and can safely be ignored.
-
-If you are compiling with a version of GNU CC older than 1.33, specify
-@samp{/DEFINE=("inline=")} as an option in all the compilations. This
-requires editing all the @code{gcc} commands in @file{make-cc1.com}.
-(The older versions had problems supporting @code{inline}.) Once you
-have a working 1.33 or newer GNU CC, you can change this file back.
-
-@item
-If you want to build GNU CC with the VAX C compiler, you will need to
-make minor changes in @file{make-cccp.com} and @file{make-cc1.com}
-to choose alternate definitions of @code{CC}, @code{CFLAGS}, and
-@code{LIBS}. See comments in those files. However, you must
-also have a working version of the GNU assembler (GNU as, aka GAS) as
-it is used as the back-end for GNU CC to produce binary object modules
-and is not included in the GNU CC sources. GAS is also needed to
-compile @file{libgcc2} in order to build @file{gcclib} (see above);
-@file{make-l2.com} expects to be able to find it operational in
-@file{gnu_cc:[000000]gnu-as.exe}.
-
-To use GNU CC on VMS, you need the VMS driver programs
-@file{gcc.exe}, @file{gcc.com}, and @file{gcc.cld}. They are
-distributed with the VMS binaries (@file{gcc-vms}) rather than the
-GNU CC sources. GAS is also included in @file{gcc-vms}, as is Bison.
-
-Once you have successfully built GNU CC with VAX C, you should use the
-resulting compiler to rebuild itself. Before doing this, be sure to
-restore the @code{CC}, @code{CFLAGS}, and @code{LIBS} definitions in
-@file{make-cccp.com} and @file{make-cc1.com}. The second generation
-compiler will be able to take advantage of many optimizations that must
-be suppressed when building with other compilers.
-@end enumerate
-
-Under previous versions of GNU CC, the generated code would occasionally
-give strange results when linked with the sharable @file{VAXCRTL} library.
-Now this should work.
-
-Even with this version, however, GNU CC itself should not be linked with
-the sharable @file{VAXCRTL}. The version of @code{qsort} in
-@file{VAXCRTL} has a bug (known to be present in VMS versions V4.6
-through V5.5) which causes the compiler to fail.
-
-The executables are generated by @file{make-cc1.com} and
-@file{make-cccp.com} use the object library version of @file{VAXCRTL} in
-order to make use of the @code{qsort} routine in @file{gcclib.olb}. If
-you wish to link the compiler executables with the shareable image
-version of @file{VAXCRTL}, you should edit the file @file{tm.h} (created
-by @file{vmsconfig.com}) to define the macro @code{QSORT_WORKAROUND}.
-
-@code{QSORT_WORKAROUND} is always defined when GNU CC is compiled with
-VAX C, to avoid a problem in case @file{gcclib.olb} is not yet
-available.
-
-@node Collect2
-@section @code{collect2}
-
-GNU CC uses a utility called @code{collect2} on nearly all systems to arrange
-to call various initialization functions at start time.
-
-The program @code{collect2} works by linking the program once and
-looking through the linker output file for symbols with particular names
-indicating they are constructor functions. If it finds any, it
-creates a new temporary @samp{.c} file containing a table of them,
-compiles it, and links the program a second time including that file.
-
-@findex __main
-@cindex constructors, automatic calls
-The actual calls to the constructors are carried out by a subroutine
-called @code{__main}, which is called (automatically) at the beginning
-of the body of @code{main} (provided @code{main} was compiled with GNU
-CC). Calling @code{__main} is necessary, even when compiling C code, to
-allow linking C and C++ object code together. (If you use
-@samp{-nostdlib}, you get an unresolved reference to @code{__main},
-since it's defined in the standard GCC library. Include @samp{-lgcc} at
-the end of your compiler command line to resolve this reference.)
-
-The program @code{collect2} is installed as @code{ld} in the directory
-where the passes of the compiler are installed. When @code{collect2}
-needs to find the @emph{real} @code{ld}, it tries the following file
-names:
-
-@itemize @bullet
-@item
-@file{real-ld} in the directories listed in the compiler's search
-directories.
-
-@item
-@file{real-ld} in the directories listed in the environment variable
-@code{PATH}.
-
-@item
-The file specified in the @code{REAL_LD_FILE_NAME} configuration macro,
-if specified.
-
-@item
-@file{ld} in the compiler's search directories, except that
-@code{collect2} will not execute itself recursively.
-
-@item
-@file{ld} in @code{PATH}.
-@end itemize
-
-``The compiler's search directories'' means all the directories where
-@code{gcc} searches for passes of the compiler. This includes
-directories that you specify with @samp{-B}.
-
-Cross-compilers search a little differently:
-
-@itemize @bullet
-@item
-@file{real-ld} in the compiler's search directories.
-
-@item
-@file{@var{target}-real-ld} in @code{PATH}.
-
-@item
-The file specified in the @code{REAL_LD_FILE_NAME} configuration macro,
-if specified.
-
-@item
-@file{ld} in the compiler's search directories.
-
-@item
-@file{@var{target}-ld} in @code{PATH}.
-@end itemize
-
-@code{collect2} explicitly avoids running @code{ld} using the file name
-under which @code{collect2} itself was invoked. In fact, it remembers
-up a list of such names---in case one copy of @code{collect2} finds
-another copy (or version) of @code{collect2} installed as @code{ld} in a
-second place in the search path.
-
-@code{collect2} searches for the utilities @code{nm} and @code{strip}
-using the same algorithm as above for @code{ld}.
-
-@node Header Dirs
-@section Standard Header File Directories
-
-@code{GCC_INCLUDE_DIR} means the same thing for native and cross. It is
-where GNU CC stores its private include files, and also where GNU CC
-stores the fixed include files. A cross compiled GNU CC runs
-@code{fixincludes} on the header files in @file{$(tooldir)/include}.
-(If the cross compilation header files need to be fixed, they must be
-installed before GNU CC is built. If the cross compilation header files
-are already suitable for ANSI C and GNU CC, nothing special need be
-done).
-
-@code{GPLUS_INCLUDE_DIR} means the same thing for native and cross. It
-is where @code{g++} looks first for header files. The C++ library
-installs only target independent header files in that directory.
-
-@code{LOCAL_INCLUDE_DIR} is used only for a native compiler. It is
-normally @file{/usr/local/include}. GNU CC searches this directory so
-that users can install header files in @file{/usr/local/include}.
-
-@code{CROSS_INCLUDE_DIR} is used only for a cross compiler. GNU CC
-doesn't install anything there.
-
-@code{TOOL_INCLUDE_DIR} is used for both native and cross compilers. It
-is the place for other packages to install header files that GNU CC will
-use. For a cross-compiler, this is the equivalent of
-@file{/usr/include}. When you build a cross-compiler,
-@code{fixincludes} processes any header files in this directory.
diff --git a/contrib/gcc/invoke.texi b/contrib/gcc/invoke.texi
deleted file mode 100644
index e97495e1b6c4..000000000000
--- a/contrib/gcc/invoke.texi
+++ /dev/null
@@ -1,6785 +0,0 @@
-@c Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-@c 2000, 2001 Free Software Foundation, Inc.
-@c This is part of the GCC manual.
-@c For copying conditions, see the file gcc.texi.
-
-@node Invoking GCC
-@chapter GCC Command Options
-@cindex GCC command options
-@cindex command options
-@cindex options, GCC command
-
-When you invoke GCC, it normally does preprocessing, compilation,
-assembly and linking. The ``overall options'' allow you to stop this
-process at an intermediate stage. For example, the @samp{-c} option
-says not to run the linker. Then the output consists of object files
-output by the assembler.
-
-Other options are passed on to one stage of processing. Some options
-control the preprocessor and others the compiler itself. Yet other
-options control the assembler and linker; most of these are not
-documented here, since you rarely need to use any of them.
-
-@cindex C compilation options
-Most of the command line options that you can use with GCC are useful
-for C programs; when an option is only useful with another language
-(usually C++), the explanation says so explicitly. If the description
-for a particular option does not mention a source language, you can use
-that option with all supported languages.
-
-@cindex C++ compilation options
-@xref{Invoking G++,,Compiling C++ Programs}, for a summary of special
-options for compiling C++ programs.
-
-@cindex grouping options
-@cindex options, grouping
-The @code{gcc} program accepts options and file names as operands. Many
-options have multiletter names; therefore multiple single-letter options
-may @emph{not} be grouped: @samp{-dr} is very different from @w{@samp{-d
--r}}.
-
-@cindex order of options
-@cindex options, order
-You can mix options and other arguments. For the most part, the order
-you use doesn't matter. Order does matter when you use several options
-of the same kind; for example, if you specify @samp{-L} more than once,
-the directories are searched in the order specified.
-
-Many options have long names starting with @samp{-f} or with
-@samp{-W}---for example, @samp{-fforce-mem},
-@samp{-fstrength-reduce}, @samp{-Wformat} and so on. Most of
-these have both positive and negative forms; the negative form of
-@samp{-ffoo} would be @samp{-fno-foo}. This manual documents
-only one of these two forms, whichever one is not the default.
-
-@menu
-* Option Summary:: Brief list of all options, without explanations.
-* Overall Options:: Controlling the kind of output:
- an executable, object files, assembler files,
- or preprocessed source.
-* Invoking G++:: Compiling C++ programs.
-* C Dialect Options:: Controlling the variant of C language compiled.
-* C++ Dialect Options:: Variations on C++.
-* Warning Options:: How picky should the compiler be?
-* Debugging Options:: Symbol tables, measurements, and debugging dumps.
-* Optimize Options:: How much optimization?
-* Preprocessor Options:: Controlling header files and macro definitions.
- Also, getting dependency information for Make.
-* Assembler Options:: Passing options to the assembler.
-* Link Options:: Specifying libraries and so on.
-* Directory Options:: Where to find header files and libraries.
- Where to find the compiler executable files.
-* Target Options:: Running a cross-compiler, or an old version of GCC.
-* Submodel Options:: Specifying minor hardware or convention variations,
- such as 68010 vs 68020.
-* Code Gen Options:: Specifying conventions for function calls, data layout
- and register usage.
-* Environment Variables:: Env vars that affect GCC.
-* Running Protoize:: Automatically adding or removing function prototypes.
-@end menu
-
-@node Option Summary
-@section Option Summary
-
-Here is a summary of all the options, grouped by type. Explanations are
-in the following sections.
-
-@table @emph
-@item Overall Options
-@xref{Overall Options,,Options Controlling the Kind of Output}.
-@smallexample
--c -S -E -o @var{file} -pipe -v --help -x @var{language}
-@end smallexample
-
-@item C Language Options
-@xref{C Dialect Options,,Options Controlling C Dialect}.
-@smallexample
--ansi -fstd -fallow-single-precision -fcond-mismatch -fno-asm
--fno-builtin -ffreestanding -fhosted -fsigned-bitfields -fsigned-char
--funsigned-bitfields -funsigned-char -fwritable-strings
--traditional -traditional-cpp -trigraphs
-@end smallexample
-
-@item C++ Language Options
-@xref{C++ Dialect Options,,Options Controlling C++ Dialect}.
-@smallexample
--fno-access-control -fcheck-new -fconserve-space -fdollars-in-identifiers
--fno-elide-constructors -fexternal-templates -ffor-scope
--fno-for-scope -fno-gnu-keywords -fguiding-decls -fhandle-signatures
--fhonor-std -fhuge-objects -fno-implicit-templates -finit-priority
--fno-implement-inlines -fname-mangling-version-@var{n} -fno-default-inline
--foperator-names -fno-optional-diags -fpermissive -frepo -fstrict-prototype
--fsquangle -ftemplate-depth-@var{n} -fthis-is-variable -fvtable-thunks
--nostdinc++ -Wctor-dtor-privacy -Wno-deprecated -Weffc++
--Wno-non-template-friend
--Wnon-virtual-dtor -Wold-style-cast -Woverloaded-virtual
--Wno-pmf-conversions -Wreorder -Wsign-promo -Wsynth
-@end smallexample
-
-@item Warning Options
-@xref{Warning Options,,Options to Request or Suppress Warnings}.
-@smallexample
--fsyntax-only -pedantic -pedantic-errors
--w -W -Wall -Waggregate-return -Wbad-function-cast
--Wcast-align -Wcast-qual -Wchar-subscripts -Wcomment
--Wconversion -Werror -Wformat
--Wid-clash-@var{len} -Wimplicit -Wimplicit-int
--Wimplicit-function-declaration -Wimport
--Werror-implicit-function-declaration -Winline
--Wlarger-than-@var{len} -Wlong-long
--Wmain -Wmissing-declarations -Wmissing-noreturn
--Wmissing-prototypes -Wmultichar -Wnested-externs -Wno-import
--Wparentheses -Wpointer-arith -Wredundant-decls
--Wreturn-type -Wshadow -Wsign-compare -Wstrict-prototypes
--Wswitch -Wtraditional
--Wtrigraphs -Wundef -Wuninitialized -Wunused -Wwrite-strings
--Wunknown-pragmas
-@end smallexample
-
-@item Debugging Options
-@xref{Debugging Options,,Options for Debugging Your Program or GCC}.
-@smallexample
--a -ax -d@var{letters} -fdump-unnumbered -fpretend-float
--fprofile-arcs -ftest-coverage
--g -g@var{level} -gcoff -gdwarf -gdwarf-1 -gdwarf-1+ -gdwarf-2
--ggdb -gstabs -gstabs+ -gxcoff -gxcoff+
--p -pg -print-file-name=@var{library} -print-libgcc-file-name
--print-prog-name=@var{program} -print-search-dirs -save-temps
-@end smallexample
-
-@item Optimization Options
-@xref{Optimize Options,,Options that Control Optimization}.
-@smallexample
--fbranch-probabilities -foptimize-register-moves
--fcaller-saves -fcse-follow-jumps -fcse-skip-blocks
--fdelayed-branch -fexpensive-optimizations
--ffast-math -ffloat-store -fforce-addr -fforce-mem
--fdata-sections -ffunction-sections -fgcse
--finline-functions -finline-limit-@var{n} -fkeep-inline-functions
--fno-default-inline -fno-defer-pop -fno-function-cse
--fno-inline -fno-peephole -fomit-frame-pointer -fregmove
--frerun-cse-after-loop -frerun-loop-opt -fschedule-insns
--fschedule-insns2 -fstrength-reduce -fthread-jumps
--funroll-all-loops -funroll-loops
--fmove-all-movables -freduce-all-givs -fstrict-aliasing
--O -O0 -O1 -O2 -O3 -Os
-@end smallexample
-
-@item Preprocessor Options
-@xref{Preprocessor Options,,Options Controlling the Preprocessor}.
-@smallexample
--A@var{question}(@var{answer}) -C -dD -dM -dN
--D@var{macro}@r{[}=@var{defn}@r{]} -E -H
--idirafter @var{dir}
--include @var{file} -imacros @var{file}
--iprefix @var{file} -iwithprefix @var{dir}
--iwithprefixbefore @var{dir} -isystem @var{dir} -isystem-c++ @var{dir}
--M -MD -MM -MMD -MG -nostdinc -P -trigraphs
--undef -U@var{macro} -Wp,@var{option}
-@end smallexample
-
-@item Assembler Option
-@xref{Assembler Options,,Passing Options to the Assembler}.
-@smallexample
--Wa,@var{option}
-@end smallexample
-
-@item Linker Options
-@xref{Link Options,,Options for Linking}.
-@smallexample
-@var{object-file-name} -l@var{library}
--nostartfiles -nodefaultlibs -nostdlib
--s -static -shared -symbolic
--Wl,@var{option} -Xlinker @var{option}
--u @var{symbol}
-@end smallexample
-
-@item Directory Options
-@xref{Directory Options,,Options for Directory Search}.
-@smallexample
--B@var{prefix} -I@var{dir} -I- -L@var{dir} -specs=@var{file}
-@end smallexample
-
-@item Target Options
-@c I wrote this xref this way to avoid overfull hbox. -- rms
-@xref{Target Options}.
-@smallexample
--b @var{machine} -V @var{version}
-@end smallexample
-
-@item Machine Dependent Options
-@xref{Submodel Options,,Hardware Models and Configurations}.
-@smallexample
-@emph{M680x0 Options}
--m68000 -m68020 -m68020-40 -m68020-60 -m68030 -m68040
--m68060 -mcpu32 -m5200 -m68881 -mbitfield -mc68000 -mc68020
--mfpa -mnobitfield -mrtd -mshort -msoft-float
--malign-int
-
-@emph{VAX Options}
--mg -mgnu -munix
-
-@emph{SPARC Options}
--mcpu=@var{cpu type}
--mtune=@var{cpu type}
--mcmodel=@var{code model}
--malign-jumps=@var{num} -malign-loops=@var{num}
--malign-functions=@var{num}
--m32 -m64
--mapp-regs -mbroken-saverestore -mcypress -mepilogue
--mflat -mfpu -mhard-float -mhard-quad-float
--mimpure-text -mlive-g0 -mno-app-regs -mno-epilogue
--mno-flat -mno-fpu -mno-impure-text
--mno-stack-bias -mno-unaligned-doubles
--msoft-float -msoft-quad-float -msparclite -mstack-bias
--msupersparc -munaligned-doubles -mv8
-
-@emph{Convex Options}
--mc1 -mc2 -mc32 -mc34 -mc38
--margcount -mnoargcount
--mlong32 -mlong64
--mvolatile-cache -mvolatile-nocache
-
-@emph{AMD29K Options}
--m29000 -m29050 -mbw -mnbw -mdw -mndw
--mlarge -mnormal -msmall
--mkernel-registers -mno-reuse-arg-regs
--mno-stack-check -mno-storem-bug
--mreuse-arg-regs -msoft-float -mstack-check
--mstorem-bug -muser-registers
-
-@emph{ARM Options}
--mapcs-frame -mno-apcs-frame
--mapcs-26 -mapcs-32
--mapcs-stack-check -mno-apcs-stack-check
--mapcs-float -mno-apcs-float
--mapcs-reentrant -mno-apcs-reentrant
--msched-prolog -mno-sched-prolog
--mlittle-endian -mbig-endian -mwords-little-endian
--mshort-load-bytes -mno-short-load-bytes -mshort-load-words -mno-short-load-words
--msoft-float -mhard-float -mfpe
--mthumb-interwork -mno-thumb-interwork
--mcpu= -march= -mfpe=
--mstructure-size-boundary=
--mbsd -mxopen -mno-symrename
--mabort-on-noreturn
--mno-sched-prolog
-
-@emph{Thumb Options}
--mtpcs-frame -mno-tpcs-frame
--mtpcs-leaf-frame -mno-tpcs-leaf-frame
--mlittle-endian -mbig-endian
--mthumb-interwork -mno-thumb-interwork
--mstructure-size-boundary=
-
-@emph{MN10200 Options}
--mrelax
-
-@emph{MN10300 Options}
--mmult-bug
--mno-mult-bug
--mrelax
-
-@emph{M32R/D Options}
--mcode-model=@var{model type} -msdata=@var{sdata type}
--G @var{num}
-
-@emph{M88K Options}
--m88000 -m88100 -m88110 -mbig-pic
--mcheck-zero-division -mhandle-large-shift
--midentify-revision -mno-check-zero-division
--mno-ocs-debug-info -mno-ocs-frame-position
--mno-optimize-arg-area -mno-serialize-volatile
--mno-underscores -mocs-debug-info
--mocs-frame-position -moptimize-arg-area
--mserialize-volatile -mshort-data-@var{num} -msvr3
--msvr4 -mtrap-large-shift -muse-div-instruction
--mversion-03.00 -mwarn-passed-structs
-
-@emph{RS/6000 and PowerPC Options}
--mcpu=@var{cpu type}
--mtune=@var{cpu type}
--mpower -mno-power -mpower2 -mno-power2
--mpowerpc -mno-powerpc
--mpowerpc-gpopt -mno-powerpc-gpopt
--mpowerpc-gfxopt -mno-powerpc-gfxopt
--mnew-mnemonics -mno-new-mnemonics
--mfull-toc -mminimal-toc -mno-fop-in-toc -mno-sum-in-toc
--maix64 -maix32 -mxl-call -mno-xl-call -mthreads -mpe
--msoft-float -mhard-float -mmultiple -mno-multiple
--mstring -mno-string -mupdate -mno-update
--mfused-madd -mno-fused-madd -mbit-align -mno-bit-align
--mstrict-align -mno-strict-align -mrelocatable
--mno-relocatable -mrelocatable-lib -mno-relocatable-lib
--mtoc -mno-toc -mlittle -mlittle-endian -mbig -mbig-endian
--mcall-aix -mcall-sysv -mprototype -mno-prototype
--msim -mmvme -mads -myellowknife -memb -msdata
--msdata=@var{opt} -G @var{num}
-
-@emph{RT Options}
--mcall-lib-mul -mfp-arg-in-fpregs -mfp-arg-in-gregs
--mfull-fp-blocks -mhc-struct-return -min-line-mul
--mminimum-fp-blocks -mnohc-struct-return
-
-@emph{MIPS Options}
--mabicalls -mcpu=@var{cpu type} -membedded-data
--membedded-pic -mfp32 -mfp64 -mgas -mgp32 -mgp64
--mgpopt -mhalf-pic -mhard-float -mint64 -mips1
--mips2 -mips3 -mips4 -mlong64 -mlong32 -mlong-calls -mmemcpy
--mmips-as -mmips-tfile -mno-abicalls
--mno-embedded-data -mno-embedded-pic
--mno-gpopt -mno-long-calls
--mno-memcpy -mno-mips-tfile -mno-rnames -mno-stats
--mrnames -msoft-float
--m4650 -msingle-float -mmad
--mstats -EL -EB -G @var{num} -nocpp
--mabi=32 -mabi=n32 -mabi=64 -mabi=eabi
-
-@emph{i386 Options}
--mcpu=@var{cpu type}
--march=@var{cpu type}
--mieee-fp -mno-fancy-math-387
--mno-fp-ret-in-387 -msoft-float -msvr3-shlib
--mno-wide-multiply -mrtd -malign-double
--mreg-alloc=@var{list} -mregparm=@var{num}
--malign-jumps=@var{num} -malign-loops=@var{num}
--malign-functions=@var{num} -mpreferred-stack-boundary=@var{num}
-
-@emph{HPPA Options}
--march=@var{architecture type}
--mbig-switch -mdisable-fpregs -mdisable-indexing
--mfast-indirect-calls -mgas -mjump-in-delay
--mlong-load-store -mno-big-switch -mno-disable-fpregs
--mno-disable-indexing -mno-fast-indirect-calls -mno-gas
--mno-jump-in-delay -mno-long-load-store
--mno-portable-runtime -mno-soft-float -mno-space
--mno-space-regs -msoft-float -mpa-risc-1-0
--mpa-risc-1-1 -mpa-risc-2-0 -mportable-runtime
--mschedule=@var{cpu type} -mspace -mspace-regs
-
-@emph{Intel 960 Options}
--m@var{cpu type} -masm-compat -mclean-linkage
--mcode-align -mcomplex-addr -mleaf-procedures
--mic-compat -mic2.0-compat -mic3.0-compat
--mintel-asm -mno-clean-linkage -mno-code-align
--mno-complex-addr -mno-leaf-procedures
--mno-old-align -mno-strict-align -mno-tail-call
--mnumerics -mold-align -msoft-float -mstrict-align
--mtail-call
-
-@emph{DEC Alpha Options}
--mfp-regs -mno-fp-regs -mno-soft-float -msoft-float
--malpha-as -mgas
--mieee -mieee-with-inexact -mieee-conformant
--mfp-trap-mode=@var{mode} -mfp-rounding-mode=@var{mode}
--mtrap-precision=@var{mode} -mbuild-constants
--mcpu=@var{cpu type}
--mbwx -mno-bwx -mcix -mno-cix -mmax -mno-max
--mmemory-latency=@var{time}
-
-@emph{Clipper Options}
--mc300 -mc400
-
-@emph{H8/300 Options}
--mrelax -mh -ms -mint32 -malign-300
-
-@emph{SH Options}
--m1 -m2 -m3 -m3e -mb -ml -mdalign -mrelax
-
-@emph{System V Options}
--Qy -Qn -YP,@var{paths} -Ym,@var{dir}
-
-@emph{ARC Options}
--EB -EL
--mmangle-cpu -mcpu=@var{cpu} -mtext=@var{text section}
--mdata=@var{data section} -mrodata=@var{readonly data section}
-
-@emph{TMS320C3x/C4x Options}
--mcpu=@var{cpu} -mbig -msmall -mregparm -mmemparm
--mfast-fix -mmpyi -mbk -mti -mdp-isr-reload
--mrpts=@var{count} -mrptb -mdb -mloop-unsigned
--mparallel-insns -mparallel-mpy -mpreserve-float
-
-@emph{V850 Options}
--mlong-calls -mno-long-calls -mep -mno-ep
--mprolog-function -mno-prolog-function -mspace
--mtda=@var{n} -msda=@var{n} -mzda=@var{n}
--mv850 -mbig-switch
-
-@emph{NS32K Options}
--m32032 -m32332 -m32532 -m32081 -m32381 -mmult-add -mnomult-add
--msoft-float -mrtd -mnortd -mregparam -mnoregparam -msb -mnosb
--mbitfield -mnobitfield -mhimem -mnohimem
-@end smallexample
-
-@item Code Generation Options
-@xref{Code Gen Options,,Options for Code Generation Conventions}.
-@smallexample
--fcall-saved-@var{reg} -fcall-used-@var{reg}
--fexceptions -ffixed-@var{reg} -finhibit-size-directive
--fcheck-memory-usage -fprefix-function-name
--fno-common -fno-ident -fno-gnu-linker
--fpcc-struct-return -fpic -fPIC
--freg-struct-return -fshared-data -fshort-enums
--fshort-double -fvolatile -fvolatile-global -fvolatile-static
--fverbose-asm -fpack-struct -fstack-check
--fargument-alias -fargument-noalias
--fargument-noalias-global
--fleading-underscore
-@end smallexample
-@end table
-
-@menu
-* Overall Options:: Controlling the kind of output:
- an executable, object files, assembler files,
- or preprocessed source.
-* C Dialect Options:: Controlling the variant of C language compiled.
-* C++ Dialect Options:: Variations on C++.
-* Warning Options:: How picky should the compiler be?
-* Debugging Options:: Symbol tables, measurements, and debugging dumps.
-* Optimize Options:: How much optimization?
-* Preprocessor Options:: Controlling header files and macro definitions.
- Also, getting dependency information for Make.
-* Assembler Options:: Passing options to the assembler.
-* Link Options:: Specifying libraries and so on.
-* Directory Options:: Where to find header files and libraries.
- Where to find the compiler executable files.
-* Target Options:: Running a cross-compiler, or an old version of GCC.
-@end menu
-
-@node Overall Options
-@section Options Controlling the Kind of Output
-
-Compilation can involve up to four stages: preprocessing, compilation
-proper, assembly and linking, always in that order. The first three
-stages apply to an individual source file, and end by producing an
-object file; linking combines all the object files (those newly
-compiled, and those specified as input) into an executable file.
-
-@cindex file name suffix
-For any given input file, the file name suffix determines what kind of
-compilation is done:
-
-@table @code
-@item @var{file}.c
-C source code which must be preprocessed.
-
-@item @var{file}.i
-C source code which should not be preprocessed.
-
-@item @var{file}.ii
-C++ source code which should not be preprocessed.
-
-@item @var{file}.m
-Objective-C source code. Note that you must link with the library
-@file{libobjc.a} to make an Objective-C program work.
-
-@item @var{file}.h
-C header file (not to be compiled or linked).
-
-@item @var{file}.cc
-@itemx @var{file}.cxx
-@itemx @var{file}.cpp
-@itemx @var{file}.C
-C++ source code which must be preprocessed. Note that in @samp{.cxx},
-the last two letters must both be literally @samp{x}. Likewise,
-@samp{.C} refers to a literal capital C.
-
-@item @var{file}.s
-Assembler code.
-
-@item @var{file}.S
-Assembler code which must be preprocessed.
-
-@item @var{other}
-An object file to be fed straight into linking.
-Any file name with no recognized suffix is treated this way.
-@end table
-
-You can specify the input language explicitly with the @samp{-x} option:
-
-@table @code
-@item -x @var{language}
-Specify explicitly the @var{language} for the following input files
-(rather than letting the compiler choose a default based on the file
-name suffix). This option applies to all following input files until
-the next @samp{-x} option. Possible values for @var{language} are:
-@example
-c objective-c c++
-c-header cpp-output c++-cpp-output
-assembler assembler-with-cpp
-@end example
-
-@item -x none
-Turn off any specification of a language, so that subsequent files are
-handled according to their file name suffixes (as they are if @samp{-x}
-has not been used at all).
-@end table
-
-If you only want some of the stages of compilation, you can use
-@samp{-x} (or filename suffixes) to tell @code{gcc} where to start, and
-one of the options @samp{-c}, @samp{-S}, or @samp{-E} to say where
-@code{gcc} is to stop. Note that some combinations (for example,
-@samp{-x cpp-output -E} instruct @code{gcc} to do nothing at all.
-
-@table @code
-@item -c
-Compile or assemble the source files, but do not link. The linking
-stage simply is not done. The ultimate output is in the form of an
-object file for each source file.
-
-By default, the object file name for a source file is made by replacing
-the suffix @samp{.c}, @samp{.i}, @samp{.s}, etc., with @samp{.o}.
-
-Unrecognized input files, not requiring compilation or assembly, are
-ignored.
-
-@item -S
-Stop after the stage of compilation proper; do not assemble. The output
-is in the form of an assembler code file for each non-assembler input
-file specified.
-
-By default, the assembler file name for a source file is made by
-replacing the suffix @samp{.c}, @samp{.i}, etc., with @samp{.s}.
-
-Input files that don't require compilation are ignored.
-
-@item -E
-Stop after the preprocessing stage; do not run the compiler proper. The
-output is in the form of preprocessed source code, which is sent to the
-standard output.
-
-Input files which don't require preprocessing are ignored.
-
-@cindex output file option
-@item -o @var{file}
-Place output in file @var{file}. This applies regardless to whatever
-sort of output is being produced, whether it be an executable file,
-an object file, an assembler file or preprocessed C code.
-
-Since only one output file can be specified, it does not make sense to
-use @samp{-o} when compiling more than one input file, unless you are
-producing an executable file as output.
-
-If @samp{-o} is not specified, the default is to put an executable file
-in @file{a.out}, the object file for @file{@var{source}.@var{suffix}} in
-@file{@var{source}.o}, its assembler file in @file{@var{source}.s}, and
-all preprocessed C source on standard output.@refill
-
-@item -v
-Print (on standard error output) the commands executed to run the stages
-of compilation. Also print the version number of the compiler driver
-program and of the preprocessor and the compiler proper.
-
-@item -pipe
-Use pipes rather than temporary files for communication between the
-various stages of compilation. This fails to work on some systems where
-the assembler is unable to read from a pipe; but the GNU assembler has
-no trouble.
-
-@item --help
-Print (on the standard output) a description of the command line options
-understood by @code{gcc}. If the @code{-v} option is also specified
-then @code{--help} will also be passed on to the various processes
-invoked by @code{gcc}, so that they can display the command line options
-they accept. If the @code{-W} option is also specified then command
-line options which have no documentation associated with them will also
-be displayed.
-@end table
-
-@node Invoking G++
-@section Compiling C++ Programs
-
-@cindex suffixes for C++ source
-@cindex C++ source file suffixes
-C++ source files conventionally use one of the suffixes @samp{.C},
-@samp{.cc}, @samp{.cpp}, @samp{.c++}, @samp{.cp}, or @samp{.cxx};
-preprocessed C++ files use the suffix @samp{.ii}. GCC recognizes
-files with these names and compiles them as C++ programs even if you
-call the compiler the same way as for compiling C programs (usually with
-the name @code{gcc}).
-
-@findex g++
-@findex c++
-However, C++ programs often require class libraries as well as a
-compiler that understands the C++ language---and under some
-circumstances, you might want to compile programs from standard input,
-or otherwise without a suffix that flags them as C++ programs.
-@code{g++} is a program that calls GCC with the default language
-set to C++, and automatically specifies linking against the C++
-library. On many systems, the script @code{g++} is also
-installed with the name @code{c++}.
-
-@cindex invoking @code{g++}
-When you compile C++ programs, you may specify many of the same
-command-line options that you use for compiling programs in any
-language; or command-line options meaningful for C and related
-languages; or options that are meaningful only for C++ programs.
-@xref{C Dialect Options,,Options Controlling C Dialect}, for
-explanations of options for languages related to C.
-@xref{C++ Dialect Options,,Options Controlling C++ Dialect}, for
-explanations of options that are meaningful only for C++ programs.
-
-@node C Dialect Options
-@section Options Controlling C Dialect
-@cindex dialect options
-@cindex language dialect options
-@cindex options, dialect
-
-The following options control the dialect of C (or languages derived
-from C, such as C++ and Objective C) that the compiler accepts:
-
-@table @code
-@cindex ANSI support
-@item -ansi
-In C mode, support all ANSI standard C programs. In C++ mode,
-remove GNU extensions that conflict with ANSI C++.
-@c shouldn't we be saying "ISO"?
-
-This turns off certain features of GCC that are incompatible with ANSI
-C (when compiling C code), or of ANSI standard C++ (when compiling C++ code),
-such as the @code{asm} and @code{typeof} keywords, and
-predefined macros such as @code{unix} and @code{vax} that identify the
-type of system you are using. It also enables the undesirable and
-rarely used ANSI trigraph feature. For the C compiler,
-it disables recognition of C++ style @samp{//} comments as well as
-the @code{inline} keyword. For the C++ compiler,
-@samp{-foperator-names} is enabled as well.
-
-
-The alternate keywords @code{__asm__}, @code{__extension__},
-@code{__inline__} and @code{__typeof__} continue to work despite
-@samp{-ansi}. You would not want to use them in an ANSI C program, of
-course, but it is useful to put them in header files that might be included
-in compilations done with @samp{-ansi}. Alternate predefined macros
-such as @code{__unix__} and @code{__vax__} are also available, with or
-without @samp{-ansi}.
-
-The @samp{-ansi} option does not cause non-ANSI programs to be
-rejected gratuitously. For that, @samp{-pedantic} is required in
-addition to @samp{-ansi}. @xref{Warning Options}.
-
-The macro @code{__STRICT_ANSI__} is predefined when the @samp{-ansi}
-option is used. Some header files may notice this macro and refrain
-from declaring certain functions or defining certain macros that the
-ANSI standard doesn't call for; this is to avoid interfering with any
-programs that might use these names for other things.
-
-The functions @code{alloca}, @code{abort}, @code{exit}, and
-@code{_exit} are not builtin functions when @samp{-ansi} is used.
-
-@item -fstd=
-Determine the language standard. A value for this option must be provided;
-possible values are
-
-@itemize @minus
-@item iso9899:1990
-Same as -ansi
-
-@item iso9899:199409
-ISO C as modified in amend. 1
-
-@item iso9899:199x
-ISO C 9x
-
-@item c89
-same as -std=iso9899:1990
-
-@item c9x
-same as -std=iso9899:199x
-
-@item gnu89
-default, iso9899:1990 + gnu extensions
-
-@item gnu9x
-iso9899:199x + gnu extensions
-@end itemize
-
-Even when this option is not specified, you can still use some of the
-features of newer standards in so far as they do not conflict with
-previous C standards. For example, you may use @code{__restrict__} even
-when -fstd=c9x is not specified.
-
-@item -fno-asm
-Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
-keyword, so that code can use these words as identifiers. You can use
-the keywords @code{__asm__}, @code{__inline__} and @code{__typeof__}
-instead. @samp{-ansi} implies @samp{-fno-asm}.
-
-In C++, this switch only affects the @code{typeof} keyword, since
-@code{asm} and @code{inline} are standard keywords. You may want to
-use the @samp{-fno-gnu-keywords} flag instead, as it also disables the
-other, C++-specific, extension keywords such as @code{headof}.
-
-@item -fno-builtin
-@cindex builtin functions
-@findex abort
-@findex abs
-@findex alloca
-@findex cos
-@findex exit
-@findex fabs
-@findex ffs
-@findex labs
-@findex memcmp
-@findex memcpy
-@findex sin
-@findex sqrt
-@findex strcmp
-@findex strcpy
-@findex strlen
-Don't recognize builtin functions that do not begin with @samp{__builtin_}
-as prefix. Currently, the functions affected include @code{abort},
-@code{abs}, @code{alloca}, @code{cos}, @code{exit}, @code{fabs},
-@code{ffs}, @code{labs}, @code{memcmp}, @code{memcpy}, @code{sin},
-@code{sqrt}, @code{strcmp}, @code{strcpy}, and @code{strlen}.
-
-GCC normally generates special code to handle certain builtin functions
-more efficiently; for instance, calls to @code{alloca} may become single
-instructions that adjust the stack directly, and calls to @code{memcpy}
-may become inline copy loops. The resulting code is often both smaller
-and faster, but since the function calls no longer appear as such, you
-cannot set a breakpoint on those calls, nor can you change the behavior
-of the functions by linking with a different library.
-
-The @samp{-ansi} option prevents @code{alloca} and @code{ffs} from being
-builtin functions, since these functions do not have an ANSI standard
-meaning.
-
-@item -fhosted
-@cindex hosted environment
-
-Assert that compilation takes place in a hosted environment. This implies
-@samp{-fbuiltin}. A hosted environment is one in which the
-entire standard library is available, and in which @code{main} has a return
-type of @code{int}. Examples are nearly everything except a kernel.
-This is equivalent to @samp{-fno-freestanding}.
-
-@item -ffreestanding
-@cindex hosted environment
-
-Assert that compilation takes place in a freestanding environment. This
-implies @samp{-fno-builtin}. A freestanding environment
-is one in which the standard library may not exist, and program startup may
-not necessarily be at @code{main}. The most obvious example is an OS kernel.
-This is equivalent to @samp{-fno-hosted}.
-
-@item -trigraphs
-Support ANSI C trigraphs. You don't want to know about this
-brain-damage. The @samp{-ansi} option implies @samp{-trigraphs}.
-
-@cindex traditional C language
-@cindex C language, traditional
-@item -traditional
-Attempt to support some aspects of traditional C compilers.
-Specifically:
-
-@itemize @bullet
-@item
-All @code{extern} declarations take effect globally even if they
-are written inside of a function definition. This includes implicit
-declarations of functions.
-
-@item
-The newer keywords @code{typeof}, @code{inline}, @code{signed}, @code{const}
-and @code{volatile} are not recognized. (You can still use the
-alternative keywords such as @code{__typeof__}, @code{__inline__}, and
-so on.)
-
-@item
-Comparisons between pointers and integers are always allowed.
-
-@item
-Integer types @code{unsigned short} and @code{unsigned char} promote
-to @code{unsigned int}.
-
-@item
-Out-of-range floating point literals are not an error.
-
-@item
-Certain constructs which ANSI regards as a single invalid preprocessing
-number, such as @samp{0xe-0xd}, are treated as expressions instead.
-
-@item
-String ``constants'' are not necessarily constant; they are stored in
-writable space, and identical looking constants are allocated
-separately. (This is the same as the effect of
-@samp{-fwritable-strings}.)
-
-@cindex @code{longjmp} and automatic variables
-@item
-All automatic variables not declared @code{register} are preserved by
-@code{longjmp}. Ordinarily, GNU C follows ANSI C: automatic variables
-not declared @code{volatile} may be clobbered.
-
-@item
-@kindex \x
-@kindex \a
-@cindex escape sequences, traditional
-The character escape sequences @samp{\x} and @samp{\a} evaluate as the
-literal characters @samp{x} and @samp{a} respectively. Without
-@w{@samp{-traditional}}, @samp{\x} is a prefix for the hexadecimal
-representation of a character, and @samp{\a} produces a bell.
-@end itemize
-
-You may wish to use @samp{-fno-builtin} as well as @samp{-traditional}
-if your program uses names that are normally GNU C builtin functions for
-other purposes of its own.
-
-You cannot use @samp{-traditional} if you include any header files that
-rely on ANSI C features. Some vendors are starting to ship systems with
-ANSI C header files and you cannot use @samp{-traditional} on such
-systems to compile files that include any system headers.
-
-The @samp{-traditional} option also enables @samp{-traditional-cpp},
-which is described next.
-
-@item -traditional-cpp
-Attempt to support some aspects of traditional C preprocessors.
-Specifically:
-
-@itemize @bullet
-@item
-Comments convert to nothing at all, rather than to a space. This allows
-traditional token concatenation.
-
-@item
-In a preprocessing directive, the @samp{#} symbol must appear as the first
-character of a line.
-
-@item
-Macro arguments are recognized within string constants in a macro
-definition (and their values are stringified, though without additional
-quote marks, when they appear in such a context). The preprocessor
-always considers a string constant to end at a newline.
-
-@item
-@cindex detecting @w{@samp{-traditional}}
-The predefined macro @code{__STDC__} is not defined when you use
-@samp{-traditional}, but @code{__GNUC__} is (since the GNU extensions
-which @code{__GNUC__} indicates are not affected by
-@samp{-traditional}). If you need to write header files that work
-differently depending on whether @samp{-traditional} is in use, by
-testing both of these predefined macros you can distinguish four
-situations: GNU C, traditional GNU C, other ANSI C compilers, and other
-old C compilers. The predefined macro @code{__STDC_VERSION__} is also
-not defined when you use @samp{-traditional}. @xref{Standard
-Predefined,,Standard Predefined Macros,cpp.info,The C Preprocessor},
-for more discussion of these and other predefined macros.
-
-@item
-@cindex string constants vs newline
-@cindex newline vs string constants
-The preprocessor considers a string constant to end at a newline (unless
-the newline is escaped with @samp{\}). (Without @w{@samp{-traditional}},
-string constants can contain the newline character as typed.)
-@end itemize
-
-@item -fcond-mismatch
-Allow conditional expressions with mismatched types in the second and
-third arguments. The value of such an expression is void.
-
-@item -funsigned-char
-Let the type @code{char} be unsigned, like @code{unsigned char}.
-
-Each kind of machine has a default for what @code{char} should
-be. It is either like @code{unsigned char} by default or like
-@code{signed char} by default.
-
-Ideally, a portable program should always use @code{signed char} or
-@code{unsigned char} when it depends on the signedness of an object.
-But many programs have been written to use plain @code{char} and
-expect it to be signed, or expect it to be unsigned, depending on the
-machines they were written for. This option, and its inverse, let you
-make such a program work with the opposite default.
-
-The type @code{char} is always a distinct type from each of
-@code{signed char} or @code{unsigned char}, even though its behavior
-is always just like one of those two.
-
-@item -fsigned-char
-Let the type @code{char} be signed, like @code{signed char}.
-
-Note that this is equivalent to @samp{-fno-unsigned-char}, which is
-the negative form of @samp{-funsigned-char}. Likewise, the option
-@samp{-fno-signed-char} is equivalent to @samp{-funsigned-char}.
-
-You may wish to use @samp{-fno-builtin} as well as @samp{-traditional}
-if your program uses names that are normally GNU C builtin functions for
-other purposes of its own.
-
-You cannot use @samp{-traditional} if you include any header files that
-rely on ANSI C features. Some vendors are starting to ship systems with
-ANSI C header files and you cannot use @samp{-traditional} on such
-systems to compile files that include any system headers.
-
-@item -fsigned-bitfields
-@itemx -funsigned-bitfields
-@itemx -fno-signed-bitfields
-@itemx -fno-unsigned-bitfields
-These options control whether a bitfield is signed or unsigned, when the
-declaration does not use either @code{signed} or @code{unsigned}. By
-default, such a bitfield is signed, because this is consistent: the
-basic integer types such as @code{int} are signed types.
-
-However, when @samp{-traditional} is used, bitfields are all unsigned
-no matter what.
-
-@item -fwritable-strings
-Store string constants in the writable data segment and don't uniquize
-them. This is for compatibility with old programs which assume they can
-write into string constants. The option @samp{-traditional} also has
-this effect.
-
-Writing into string constants is a very bad idea; ``constants'' should
-be constant.
-
-@item -fallow-single-precision
-Do not promote single precision math operations to double precision,
-even when compiling with @samp{-traditional}.
-
-Traditional K&R C promotes all floating point operations to double
-precision, regardless of the sizes of the operands. On the
-architecture for which you are compiling, single precision may be faster
-than double precision. If you must use @samp{-traditional}, but want
-to use single precision operations when the operands are single
-precision, use this option. This option has no effect when compiling
-with ANSI or GNU C conventions (the default).
-
-@end table
-
-@node C++ Dialect Options
-@section Options Controlling C++ Dialect
-
-@cindex compiler options, C++
-@cindex C++ options, command line
-@cindex options, C++
-This section describes the command-line options that are only meaningful
-for C++ programs; but you can also use most of the GNU compiler options
-regardless of what language your program is in. For example, you
-might compile a file @code{firstClass.C} like this:
-
-@example
-g++ -g -frepo -O -c firstClass.C
-@end example
-
-@noindent
-In this example, only @samp{-frepo} is an option meant
-only for C++ programs; you can use the other options with any
-language supported by GCC.
-
-Here is a list of options that are @emph{only} for compiling C++ programs:
-
-@table @code
-@item -fno-access-control
-Turn off all access checking. This switch is mainly useful for working
-around bugs in the access control code.
-
-@item -fcheck-new
-Check that the pointer returned by @code{operator new} is non-null
-before attempting to modify the storage allocated. The current Working
-Paper requires that @code{operator new} never return a null pointer, so
-this check is normally unnecessary.
-
-An alternative to using this option is to specify that your
-@code{operator new} does not throw any exceptions; if you declare it
-@samp{throw()}, g++ will check the return value. See also @samp{new
-(nothrow)}.
-
-@item -fconserve-space
-Put uninitialized or runtime-initialized global variables into the
-common segment, as C does. This saves space in the executable at the
-cost of not diagnosing duplicate definitions. If you compile with this
-flag and your program mysteriously crashes after @code{main()} has
-completed, you may have an object that is being destroyed twice because
-two definitions were merged.
-
-This option is no longer useful on most targets, now that support has
-been added for putting variables into BSS without making them common.
-
-@item -fdollars-in-identifiers
-Accept @samp{$} in identifiers. You can also explicitly prohibit use of
-@samp{$} with the option @samp{-fno-dollars-in-identifiers}. (GNU C allows
-@samp{$} by default on most target systems, but there are a few exceptions.)
-Traditional C allowed the character @samp{$} to form part of
-identifiers. However, ANSI C and C++ forbid @samp{$} in identifiers.
-
-@item -fno-elide-constructors
-The C++ standard allows an implementation to omit creating a temporary
-which is only used to initialize another object of the same type.
-Specifying this option disables that optimization, and forces g++ to
-call the copy constructor in all cases.
-
-@item -fexternal-templates
-Cause template instantiations to obey @samp{#pragma interface} and
-@samp{implementation}; template instances are emitted or not according
-to the location of the template definition. @xref{Template
-Instantiation}, for more information.
-
-This option is deprecated.
-
-@item -falt-external-templates
-Similar to -fexternal-templates, but template instances are emitted or
-not according to the place where they are first instantiated.
-@xref{Template Instantiation}, for more information.
-
-This option is deprecated.
-
-@item -ffor-scope
-@itemx -fno-for-scope
-If -ffor-scope is specified, the scope of variables declared in
-a @i{for-init-statement} is limited to the @samp{for} loop itself,
-as specified by the draft C++ standard.
-If -fno-for-scope is specified, the scope of variables declared in
-a @i{for-init-statement} extends to the end of the enclosing scope,
-as was the case in old versions of gcc, and other (traditional)
-implementations of C++.
-
-The default if neither flag is given to follow the standard,
-but to allow and give a warning for old-style code that would
-otherwise be invalid, or have different behavior.
-
-@item -fno-gnu-keywords
-Do not recognize @code{classof}, @code{headof}, @code{signature},
-@code{sigof} or @code{typeof} as a keyword, so that code can use these
-words as identifiers. You can use the keywords @code{__classof__},
-@code{__headof__}, @code{__signature__}, @code{__sigof__}, and
-@code{__typeof__} instead. @samp{-ansi} implies
-@samp{-fno-gnu-keywords}.
-
-@item -fguiding-decls
-Treat a function declaration with the same type as a potential function
-template instantiation as though it declares that instantiation, not a
-normal function. If a definition is given for the function later in the
-translation unit (or another translation unit if the target supports
-weak symbols), that definition will be used; otherwise the template will
-be instantiated. This behavior reflects the C++ language prior to
-September 1996, when guiding declarations were removed.
-
-This option implies @samp{-fname-mangling-version-0}, and will not work
-with other name mangling versions. Like all options that change the
-ABI, all C++ code, @emph{including libgcc.a} must be built with the same
-setting of this option.
-
-@item -fhandle-signatures
-Recognize the @code{signature} and @code{sigof} keywords for specifying
-abstract types. The default (@samp{-fno-handle-signatures}) is not to
-recognize them. @xref{C++ Signatures, Type Abstraction using
-Signatures}.
-
-@item -fhonor-std
-Treat the @code{namespace std} as a namespace, instead of ignoring
-it. For compatibility with earlier versions of g++, the compiler will,
-by default, ignore @code{namespace-declarations},
-@code{using-declarations}, @code{using-directives}, and
-@code{namespace-names}, if they involve @code{std}.
-
-@item -fhuge-objects
-Support virtual function calls for objects that exceed the size
-representable by a @samp{short int}. Users should not use this flag by
-default; if you need to use it, the compiler will tell you so.
-
-This flag is not useful when compiling with -fvtable-thunks.
-
-Like all options that change the ABI, all C++ code, @emph{including
-libgcc} must be built with the same setting of this option.
-
-@item -fno-implicit-templates
-Never emit code for non-inline templates which are instantiated
-implicitly (i.e. by use); only emit code for explicit instantiations.
-@xref{Template Instantiation}, for more information.
-
-@item -fno-implicit-inline-templates
-Don't emit code for implicit instantiations of inline templates, either.
-The default is to handle inlines differently so that compiles with and
-without optimization will need the same set of explicit instantiations.
-
-@item -finit-priority
-Support @samp{__attribute__ ((init_priority (n)))} for controlling the
-order of initialization of file-scope objects. On ELF targets, this
-requires GNU ld 2.10 or later.
-
-@item -fno-implement-inlines
-To save space, do not emit out-of-line copies of inline functions
-controlled by @samp{#pragma implementation}. This will cause linker
-errors if these functions are not inlined everywhere they are called.
-
-@item -fname-mangling-version-@var{n}
-Control the way in which names are mangled. Version 0 is compatible
-with versions of g++ before 2.8. Version 1 is the default. Version 1
-will allow correct mangling of function templates. For example,
-version 0 mangling does not mangle foo<int, double> and foo<int, char>
-given this declaration:
-
-@example
-template <class T, class U> void foo(T t);
-@end example
-
-Like all options that change the ABI, all C++ code, @emph{including
-libgcc} must be built with the same setting of this option.
-
-@item -foperator-names
-Recognize the operator name keywords @code{and}, @code{bitand},
-@code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
-synonyms for the symbols they refer to. @samp{-ansi} implies
-@samp{-foperator-names}.
-
-@item -fno-optional-diags
-Disable diagnostics that the standard says a compiler does not need to
-issue. Currently, the only such diagnostic issued by g++ is the one for
-a name having multiple meanings within a class.
-
-@item -fpermissive
-Downgrade messages about nonconformant code from errors to warnings. By
-default, g++ effectively sets @samp{-pedantic-errors} without
-@samp{-pedantic}; this option reverses that. This behavior and this
-option are superceded by @samp{-pedantic}, which works as it does for GNU C.
-
-@item -frepo
-Enable automatic template instantiation. This option also implies
-@samp{-fno-implicit-templates}. @xref{Template Instantiation}, for more
-information.
-
-@item -fno-rtti
-Disable generation of the information used by C++ runtime type
-identification features (@samp{dynamic_cast} and @samp{typeid}). If you
-don't use those parts of the language (or exception handling, which uses
-@samp{dynamic_cast} internally), you can save some space by using this
-flag.
-
-@item -fstrict-prototype
-Within an @samp{extern "C"} linkage specification, treat a function
-declaration with no arguments, such as @samp{int foo ();}, as declaring
-the function to take no arguments. Normally, such a declaration means
-that the function @code{foo} can take any combination of arguments, as
-in C. @samp{-pedantic} implies @samp{-fstrict-prototype} unless
-overridden with @samp{-fno-strict-prototype}.
-
-Specifying this option will also suppress implicit declarations of
-functions.
-
-This flag no longer affects declarations with C++ linkage.
-
-@item -fsquangle
-@itemx -fno-squangle
-@samp{-fsquangle} will enable a compressed form of name mangling for
-identifiers. In particular, it helps to shorten very long names by recognizing
-types and class names which occur more than once, replacing them with special
-short ID codes. This option also requires any C++ libraries being used to
-be compiled with this option as well. The compiler has this disabled (the
-equivalent of @samp{-fno-squangle}) by default.
-
-Like all options that change the ABI, all C++ code, @emph{including
-libgcc.a} must be built with the same setting of this option.
-
-@item -ftemplate-depth-@var{n}
-Set the maximum instantiation depth for template classes to @var{n}.
-A limit on the template instantiation depth is needed to detect
-endless recursions during template class instantiation. ANSI/ISO C++
-conforming programs must not rely on a maximum depth greater than 17.
-
-@item -fthis-is-variable
-Permit assignment to @code{this}. The incorporation of user-defined
-free store management into C++ has made assignment to @samp{this} an
-anachronism. Therefore, by default it is invalid to assign to
-@code{this} within a class member function; that is, GNU C++ treats
-@samp{this} in a member function of class @code{X} as a non-lvalue of
-type @samp{X *}. However, for backwards compatibility, you can make it
-valid with @samp{-fthis-is-variable}.
-
-@item -fvtable-thunks=@var{thunks-version}
-Use @samp{thunks} to implement the virtual function dispatch table
-(@samp{vtable}). The traditional (cfront-style) approach to
-implementing vtables was to store a pointer to the function and two
-offsets for adjusting the @samp{this} pointer at the call site. Newer
-implementations store a single pointer to a @samp{thunk} function which
-does any necessary adjustment and then calls the target function.
-
-The original implementation of thunks (version 1) had a bug regarding
-virtual base classes; this bug is fixed with version 2 of the thunks
-implementation. With setting the version to 2, compatibility to the
-version 1 thunks is provided, at the cost of extra machine code. Version
-3 does not include this compatibility.
-
-This option also enables a heuristic for controlling emission of
-vtables; if a class has any non-inline virtual functions, the vtable
-will be emitted in the translation unit containing the first one of
-those.
-
-Like all options that change the ABI, all C++ code, @emph{including
-libgcc.a} must be built with the same setting of this option. Since
-version 1 and version 2 are also incompatible (for classes with virtual
-bases defining virtual functions), all code must also be compiled with
-the same version.
-
-In this version of gcc, there are no targets for which version 2 thunks
-are the default. On all targets, not giving the option will use the
-traditional implementation, and -fvtable-thunks will produce version 2
-thunks.
-
-@item -nostdinc++
-Do not search for header files in the standard directories specific to
-C++, but do still search the other standard directories. (This option
-is used when building the C++ library.)
-@end table
-
-In addition, these optimization, warning, and code generation options
-have meanings only for C++ programs:
-
-@table @code
-@item -fno-default-inline
-Do not assume @samp{inline} for functions defined inside a class scope.
-@xref{Optimize Options,,Options That Control Optimization}. Note that these
-functions will have linkage like inline functions; they just won't be
-inlined by default.
-
-@item -Wctor-dtor-privacy (C++ only)
-Warn when a class seems unusable, because all the constructors or
-destructors in a class are private and the class has no friends or
-public static member functions.
-
-@item -Wnon-virtual-dtor (C++ only)
-Warn when a class declares a non-virtual destructor that should probably
-be virtual, because it looks like the class will be used polymorphically.
-
-@item -Wreorder (C++ only)
-@cindex reordering, warning
-@cindex warning for reordering of member initializers
-Warn when the order of member initializers given in the code does not
-match the order in which they must be executed. For instance:
-
-@smallexample
-struct A @{
- int i;
- int j;
- A(): j (0), i (1) @{ @}
-@};
-@end smallexample
-
-Here the compiler will warn that the member initializers for @samp{i}
-and @samp{j} will be rearranged to match the declaration order of the
-members.
-@end table
-
-The following @samp{-W@dots{}} options are not affected by @samp{-Wall}.
-
-@table @code
-@item -Weffc++ (C++ only)
-Warn about violations of various style guidelines from Scott Meyers'
-@cite{Effective C++} books. If you use this option, you should be aware
-that the standard library headers do not obey all of these guidelines;
-you can use @samp{grep -v} to filter out those warnings.
-
-@item -Wno-deprecated (C++ only)
-Do not warn about usage of deprecated features. @xref{Deprecated Features}.
-
-@item -Wno-non-template-friend (C++ only)
-Disable warnings when non-templatized friend functions are declared
-within a template. With the advent of explicit template specification
-support in g++, if the name of the friend is an unqualified-id (ie,
-@samp{friend foo(int)}), the C++ language specification demands that the
-friend declare or define an ordinary, nontemplate function. (Section
-14.5.3). Before g++ implemented explicit specification, unqualified-ids
-could be interpreted as a particular specialization of a templatized
-function. Because this non-conforming behavior is no longer the default
-behavior for g++, @samp{-Wnon-template-friend} allows the compiler to
-check existing code for potential trouble spots, and is on by default.
-This new compiler behavior can also be turned off with the flag
-@samp{-fguiding-decls}, which activates the older, non-specification
-compiler code, or with @samp{-Wno-non-template-friend} which keeps the
-conformant compiler code but disables the helpful warning.
-
-@item -Wold-style-cast (C++ only)
-Warn if an old-style (C-style) cast is used within a C++ program. The
-new-style casts (@samp{static_cast}, @samp{reinterpret_cast}, and
-@samp{const_cast}) are less vulnerable to unintended effects.
-
-@item -Woverloaded-virtual (C++ only)
-@cindex overloaded virtual fn, warning
-@cindex warning for overloaded virtual fn
-Warn when a derived class function declaration may be an error in
-defining a virtual function. In a derived class, the
-definitions of virtual functions must match the type signature of a
-virtual function declared in the base class. With this option, the
-compiler warns when you define a function with the same name as a
-virtual function, but with a type signature that does not match any
-declarations from the base class.
-
-@item -Wno-pmf-conversions (C++ only)
-Disable the diagnostic for converting a bound pointer to member function
-to a plain pointer.
-
-@item -Wsign-promo (C++ only)
-Warn when overload resolution chooses a promotion from unsigned or
-enumeral type to a signed type over a conversion to an unsigned type of
-the same size. Previous versions of g++ would try to preserve
-unsignedness, but the standard mandates the current behavior.
-
-@item -Wsynth (C++ only)
-@cindex warning for synthesized methods
-@cindex synthesized methods, warning
-Warn when g++'s synthesis behavior does not match that of cfront. For
-instance:
-
-@smallexample
-struct A @{
- operator int ();
- A& operator = (int);
-@};
-
-main ()
-@{
- A a,b;
- a = b;
-@}
-@end smallexample
-
-In this example, g++ will synthesize a default @samp{A& operator =
-(const A&);}, while cfront will use the user-defined @samp{operator =}.
-@end table
-
-@node Warning Options
-@section Options to Request or Suppress Warnings
-@cindex options to control warnings
-@cindex warning messages
-@cindex messages, warning
-@cindex suppressing warnings
-
-Warnings are diagnostic messages that report constructions which
-are not inherently erroneous but which are risky or suggest there
-may have been an error.
-
-You can request many specific warnings with options beginning @samp{-W},
-for example @samp{-Wimplicit} to request warnings on implicit
-declarations. Each of these specific warning options also has a
-negative form beginning @samp{-Wno-} to turn off warnings;
-for example, @samp{-Wno-implicit}. This manual lists only one of the
-two forms, whichever is not the default.
-
-These options control the amount and kinds of warnings produced by GCC:
-
-@table @code
-@cindex syntax checking
-@item -fsyntax-only
-Check the code for syntax errors, but don't do anything beyond that.
-
-@item -pedantic
-Issue all the warnings demanded by strict ANSI C and ISO C++;
-reject all programs that use forbidden extensions.
-
-Valid ANSI C and ISO C++ programs should compile properly with or without
-this option (though a rare few will require @samp{-ansi}). However,
-without this option, certain GNU extensions and traditional C and C++
-features are supported as well. With this option, they are rejected.
-
-@samp{-pedantic} does not cause warning messages for use of the
-alternate keywords whose names begin and end with @samp{__}. Pedantic
-warnings are also disabled in the expression that follows
-@code{__extension__}. However, only system header files should use
-these escape routes; application programs should avoid them.
-@xref{Alternate Keywords}.
-
-This option is not intended to be @i{useful}; it exists only to satisfy
-pedants who would otherwise claim that GCC fails to support the ANSI
-standard.
-
-Some users try to use @samp{-pedantic} to check programs for strict ANSI
-C conformance. They soon find that it does not do quite what they want:
-it finds some non-ANSI practices, but not all---only those for which
-ANSI C @emph{requires} a diagnostic.
-
-A feature to report any failure to conform to ANSI C might be useful in
-some instances, but would require considerable additional work and would
-be quite different from @samp{-pedantic}. We don't have plans to
-support such a feature in the near future.
-
-@item -pedantic-errors
-Like @samp{-pedantic}, except that errors are produced rather than
-warnings.
-
-@item -w
-Inhibit all warning messages.
-
-@item -Wno-import
-Inhibit warning messages about the use of @samp{#import}.
-
-@item -Wchar-subscripts
-Warn if an array subscript has type @code{char}. This is a common cause
-of error, as programmers often forget that this type is signed on some
-machines.
-
-@item -Wcomment
-Warn whenever a comment-start sequence @samp{/*} appears in a @samp{/*}
-comment, or whenever a Backslash-Newline appears in a @samp{//} comment.
-
-@item -Wformat
-Check calls to @code{printf} and @code{scanf}, etc., to make sure that
-the arguments supplied have types appropriate to the format string
-specified.
-
-@item -Wimplicit-int
-Warn when a declaration does not specify a type.
-
-@item -Wimplicit-function-declaration
-@itemx -Werror-implicit-function-declaration
-Give a warning (or error) whenever a function is used before being
-declared.
-
-@item -Wimplicit
-Same as @samp{-Wimplicit-int} and @samp{-Wimplicit-function-}@*
-@samp{declaration}.
-
-@item -Wmain
-Warn if the type of @samp{main} is suspicious. @samp{main} should be a
-function with external linkage, returning int, taking either zero
-arguments, two, or three arguments of appropriate types.
-
-@item -Wmultichar
-Warn if a multicharacter constant (@samp{'FOOF'}) is used. Usually they
-indicate a typo in the user's code, as they have implementation-defined
-values, and should not be used in portable code.
-
-@item -Wparentheses
-Warn if parentheses are omitted in certain contexts, such
-as when there is an assignment in a context where a truth value
-is expected, or when operators are nested whose precedence people
-often get confused about.
-
-Also warn about constructions where there may be confusion to which
-@code{if} statement an @code{else} branch belongs. Here is an example of
-such a case:
-
-@smallexample
-@{
- if (a)
- if (b)
- foo ();
- else
- bar ();
-@}
-@end smallexample
-
-In C, every @code{else} branch belongs to the innermost possible @code{if}
-statement, which in this example is @code{if (b)}. This is often not
-what the programmer expected, as illustrated in the above example by
-indentation the programmer chose. When there is the potential for this
-confusion, GNU C will issue a warning when this flag is specified.
-To eliminate the warning, add explicit braces around the innermost
-@code{if} statement so there is no way the @code{else} could belong to
-the enclosing @code{if}. The resulting code would look like this:
-
-@smallexample
-@{
- if (a)
- @{
- if (b)
- foo ();
- else
- bar ();
- @}
-@}
-@end smallexample
-
-@item -Wreturn-type
-Warn whenever a function is defined with a return-type that defaults
-to @code{int}. Also warn about any @code{return} statement with no
-return-value in a function whose return-type is not @code{void}.
-
-@item -Wswitch
-Warn whenever a @code{switch} statement has an index of enumeral type
-and lacks a @code{case} for one or more of the named codes of that
-enumeration. (The presence of a @code{default} label prevents this
-warning.) @code{case} labels outside the enumeration range also
-provoke warnings when this option is used.
-
-@item -Wtrigraphs
-Warn if any trigraphs are encountered (assuming they are enabled).
-
-@item -Wunused
-Warn whenever a variable is unused aside from its declaration,
-whenever a function is declared static but never defined, whenever a
-label is declared but not used, and whenever a statement computes a
-result that is explicitly not used.
-
-In order to get a warning about an unused function parameter, you must
-specify both @samp{-W} and @samp{-Wunused}.
-
-To suppress this warning for an expression, simply cast it to void. For
-unused variables, parameters and labels, use the @samp{unused} attribute
-(@pxref{Variable Attributes}).
-
-@item -Wuninitialized
-An automatic variable is used without first being initialized.
-
-These warnings are possible only in optimizing compilation,
-because they require data flow information that is computed only
-when optimizing. If you don't specify @samp{-O}, you simply won't
-get these warnings.
-
-These warnings occur only for variables that are candidates for
-register allocation. Therefore, they do not occur for a variable that
-is declared @code{volatile}, or whose address is taken, or whose size
-is other than 1, 2, 4 or 8 bytes. Also, they do not occur for
-structures, unions or arrays, even when they are in registers.
-
-Note that there may be no warning about a variable that is used only
-to compute a value that itself is never used, because such
-computations may be deleted by data flow analysis before the warnings
-are printed.
-
-These warnings are made optional because GCC is not smart
-enough to see all the reasons why the code might be correct
-despite appearing to have an error. Here is one example of how
-this can happen:
-
-@smallexample
-@{
- int x;
- switch (y)
- @{
- case 1: x = 1;
- break;
- case 2: x = 4;
- break;
- case 3: x = 5;
- @}
- foo (x);
-@}
-@end smallexample
-
-@noindent
-If the value of @code{y} is always 1, 2 or 3, then @code{x} is
-always initialized, but GCC doesn't know this. Here is
-another common case:
-
-@smallexample
-@{
- int save_y;
- if (change_y) save_y = y, y = new_y;
- @dots{}
- if (change_y) y = save_y;
-@}
-@end smallexample
-
-@noindent
-This has no bug because @code{save_y} is used only if it is set.
-
-Some spurious warnings can be avoided if you declare all the functions
-you use that never return as @code{noreturn}. @xref{Function
-Attributes}.
-
-@item -Wunknown-pragmas
-@cindex warning for unknown pragmas
-@cindex unknown pragmas, warning
-@cindex pragmas, warning of unknown
-Warn when a #pragma directive is encountered which is not understood by
-GCC. If this command line option is used, warnings will even be issued
-for unknown pragmas in system header files. This is not the case if
-the warnings were only enabled by the @samp{-Wall} command line option.
-
-@item -Wall
-All of the above @samp{-W} options combined. This enables all the
-warnings about constructions that some users consider questionable, and
-that are easy to avoid (or modify to prevent the warning), even in
-conjunction with macros.
-@end table
-
-The following @samp{-W@dots{}} options are not implied by @samp{-Wall}.
-Some of them warn about constructions that users generally do not
-consider questionable, but which occasionally you might wish to check
-for; others warn about constructions that are necessary or hard to avoid
-in some cases, and there is no simple way to modify the code to suppress
-the warning.
-
-@table @code
-@item -W
-Print extra warning messages for these events:
-
-@itemize @bullet
-@cindex @code{longjmp} warnings
-@item
-A nonvolatile automatic variable might be changed by a call to
-@code{longjmp}. These warnings as well are possible only in
-optimizing compilation.
-
-The compiler sees only the calls to @code{setjmp}. It cannot know
-where @code{longjmp} will be called; in fact, a signal handler could
-call it at any point in the code. As a result, you may get a warning
-even when there is in fact no problem because @code{longjmp} cannot
-in fact be called at the place which would cause a problem.
-
-@item
-A function can return either with or without a value. (Falling
-off the end of the function body is considered returning without
-a value.) For example, this function would evoke such a
-warning:
-
-@smallexample
-@group
-foo (a)
-@{
- if (a > 0)
- return a;
-@}
-@end group
-@end smallexample
-
-@item
-An expression-statement or the left-hand side of a comma expression
-contains no side effects.
-To suppress the warning, cast the unused expression to void.
-For example, an expression such as @samp{x[i,j]} will cause a warning,
-but @samp{x[(void)i,j]} will not.
-
-@item
-An unsigned value is compared against zero with @samp{<} or @samp{<=}.
-
-@item
-A comparison like @samp{x<=y<=z} appears; this is equivalent to
-@samp{(x<=y ? 1 : 0) <= z}, which is a different interpretation from
-that of ordinary mathematical notation.
-
-@item
-Storage-class specifiers like @code{static} are not the first things in
-a declaration. According to the C Standard, this usage is obsolescent.
-
-@item
-If @samp{-Wall} or @samp{-Wunused} is also specified, warn about unused
-arguments.
-
-@item
-A comparison between signed and unsigned values could produce an
-incorrect result when the signed value is converted to unsigned.
-(But don't warn if @samp{-Wno-sign-compare} is also specified.)
-
-@item
-An aggregate has a partly bracketed initializer.
-For example, the following code would evoke such a warning,
-because braces are missing around the initializer for @code{x.h}:
-
-@smallexample
-struct s @{ int f, g; @};
-struct t @{ struct s h; int i; @};
-struct t x = @{ 1, 2, 3 @};
-@end smallexample
-
-@item
-An aggregate has an initializer which does not initialize all members.
-For example, the following code would cause such a warning, because
-@code{x.h} would be implicitly initialized to zero:
-
-@smallexample
-struct s @{ int f, g, h; @};
-struct s x = @{ 3, 4 @};
-@end smallexample
-@end itemize
-
-@item -Wtraditional
-Warn about certain constructs that behave differently in traditional and
-ANSI C.
-
-@itemize @bullet
-@item
-Macro arguments occurring within string constants in the macro body.
-These would substitute the argument in traditional C, but are part of
-the constant in ANSI C.
-
-@item
-A function declared external in one block and then used after the end of
-the block.
-
-@item
-A @code{switch} statement has an operand of type @code{long}.
-
-@item
-A non-@code{static} function declaration follows a @code{static} one.
-This construct is not accepted by some traditional C compilers.
-@end itemize
-
-@item -Wundef
-Warn if an undefined identifier is evaluated in an @samp{#if} directive.
-
-@item -Wshadow
-Warn whenever a local variable shadows another local variable.
-
-@item -Wid-clash-@var{len}
-Warn whenever two distinct identifiers match in the first @var{len}
-characters. This may help you prepare a program that will compile
-with certain obsolete, brain-damaged compilers.
-
-@item -Wlarger-than-@var{len}
-Warn whenever an object of larger than @var{len} bytes is defined.
-
-@item -Wpointer-arith
-Warn about anything that depends on the ``size of'' a function type or
-of @code{void}. GNU C assigns these types a size of 1, for
-convenience in calculations with @code{void *} pointers and pointers
-to functions.
-
-@item -Wbad-function-cast
-Warn whenever a function call is cast to a non-matching type.
-For example, warn if @code{int malloc()} is cast to @code{anything *}.
-
-@item -Wcast-qual
-Warn whenever a pointer is cast so as to remove a type qualifier from
-the target type. For example, warn if a @code{const char *} is cast
-to an ordinary @code{char *}.
-
-@item -Wcast-align
-Warn whenever a pointer is cast such that the required alignment of the
-target is increased. For example, warn if a @code{char *} is cast to
-an @code{int *} on machines where integers can only be accessed at
-two- or four-byte boundaries.
-
-@item -Wwrite-strings
-Give string constants the type @code{const char[@var{length}]} so that
-copying the address of one into a non-@code{const} @code{char *}
-pointer will get a warning. These warnings will help you find at
-compile time code that can try to write into a string constant, but
-only if you have been very careful about using @code{const} in
-declarations and prototypes. Otherwise, it will just be a nuisance;
-this is why we did not make @samp{-Wall} request these warnings.
-
-@item -Wconversion
-Warn if a prototype causes a type conversion that is different from what
-would happen to the same argument in the absence of a prototype. This
-includes conversions of fixed point to floating and vice versa, and
-conversions changing the width or signedness of a fixed point argument
-except when the same as the default promotion.
-
-Also, warn if a negative integer constant expression is implicitly
-converted to an unsigned type. For example, warn about the assignment
-@code{x = -1} if @code{x} is unsigned. But do not warn about explicit
-casts like @code{(unsigned) -1}.
-
-@item -Wsign-compare
-@cindex warning for comparison of signed and unsigned values
-@cindex comparison of signed and unsigned values, warning
-@cindex signed and unsigned values, comparison warning
-Warn when a comparison between signed and unsigned values could produce
-an incorrect result when the signed value is converted to unsigned.
-This warning is also enabled by @samp{-W}; to get the other warnings
-of @samp{-W} without this warning, use @samp{-W -Wno-sign-compare}.
-
-@item -Waggregate-return
-Warn if any functions that return structures or unions are defined or
-called. (In languages where you can return an array, this also elicits
-a warning.)
-
-@item -Wstrict-prototypes
-Warn if a function is declared or defined without specifying the
-argument types. (An old-style function definition is permitted without
-a warning if preceded by a declaration which specifies the argument
-types.)
-
-@item -Wmissing-prototypes
-Warn if a global function is defined without a previous prototype
-declaration. This warning is issued even if the definition itself
-provides a prototype. The aim is to detect global functions that fail
-to be declared in header files.
-
-@item -Wmissing-declarations
-Warn if a global function is defined without a previous declaration.
-Do so even if the definition itself provides a prototype.
-Use this option to detect global functions that are not declared in
-header files.
-
-@item -Wmissing-noreturn
-Warn about functions which might be candidates for attribute @code{noreturn}.
-Note these are only possible candidates, not absolute ones. Care should
-be taken to manually verify functions actually do not ever return before
-adding the @code{noreturn} attribute, otherwise subtle code generation
-bugs could be introduced.
-
-@item -Wredundant-decls
-Warn if anything is declared more than once in the same scope, even in
-cases where multiple declaration is valid and changes nothing.
-
-@item -Wnested-externs
-Warn if an @code{extern} declaration is encountered within an function.
-
-@item -Winline
-Warn if a function can not be inlined, and either it was declared as inline,
-or else the @samp{-finline-functions} option was given.
-
-@item -Wlong-long
-Warn if @samp{long long} type is used. This is default. To inhibit
-the warning messages, use @samp{-Wno-long-long}. Flags
-@samp{-Wlong-long} and @samp{-Wno-long-long} are taken into account
-only when @samp{-pedantic} flag is used.
-
-@item -Werror
-Make all warnings into errors.
-@end table
-
-@node Debugging Options
-@section Options for Debugging Your Program or GCC
-@cindex options, debugging
-@cindex debugging information options
-
-GCC has various special options that are used for debugging
-either your program or GCC:
-
-@table @code
-@item -g
-Produce debugging information in the operating system's native format
-(stabs, COFF, XCOFF, or DWARF). GDB can work with this debugging
-information.
-
-On most systems that use stabs format, @samp{-g} enables use of extra
-debugging information that only GDB can use; this extra information
-makes debugging work better in GDB but will probably make other debuggers
-crash or
-refuse to read the program. If you want to control for certain whether
-to generate the extra information, use @samp{-gstabs+}, @samp{-gstabs},
-@samp{-gxcoff+}, @samp{-gxcoff}, @samp{-gdwarf-1+}, or @samp{-gdwarf-1}
-(see below).
-
-Unlike most other C compilers, GCC allows you to use @samp{-g} with
-@samp{-O}. The shortcuts taken by optimized code may occasionally
-produce surprising results: some variables you declared may not exist
-at all; flow of control may briefly move where you did not expect it;
-some statements may not be executed because they compute constant
-results or their values were already at hand; some statements may
-execute in different places because they were moved out of loops.
-
-Nevertheless it proves possible to debug optimized output. This makes
-it reasonable to use the optimizer for programs that might have bugs.
-
-The following options are useful when GCC is generated with the
-capability for more than one debugging format.
-
-@item -ggdb
-Produce debugging information for use by GDB. This means to use the
-most expressive format available (DWARF 2, stabs, or the native format
-if neither of those are supported), including GDB extensions if at all
-possible.
-
-@item -gstabs
-Produce debugging information in stabs format (if that is supported),
-without GDB extensions. This is the format used by DBX on most BSD
-systems. On MIPS, Alpha and System V Release 4 systems this option
-produces stabs debugging output which is not understood by DBX or SDB.
-On System V Release 4 systems this option requires the GNU assembler.
-
-@item -gstabs+
-Produce debugging information in stabs format (if that is supported),
-using GNU extensions understood only by the GNU debugger (GDB). The
-use of these extensions is likely to make other debuggers crash or
-refuse to read the program.
-
-@item -gcoff
-Produce debugging information in COFF format (if that is supported).
-This is the format used by SDB on most System V systems prior to
-System V Release 4.
-
-@item -gxcoff
-Produce debugging information in XCOFF format (if that is supported).
-This is the format used by the DBX debugger on IBM RS/6000 systems.
-
-@item -gxcoff+
-Produce debugging information in XCOFF format (if that is supported),
-using GNU extensions understood only by the GNU debugger (GDB). The
-use of these extensions is likely to make other debuggers crash or
-refuse to read the program, and may cause assemblers other than the GNU
-assembler (GAS) to fail with an error.
-
-@item -gdwarf
-Produce debugging information in DWARF version 1 format (if that is
-supported). This is the format used by SDB on most System V Release 4
-systems.
-
-@item -gdwarf+
-Produce debugging information in DWARF version 1 format (if that is
-supported), using GNU extensions understood only by the GNU debugger
-(GDB). The use of these extensions is likely to make other debuggers
-crash or refuse to read the program.
-
-@item -gdwarf-2
-Produce debugging information in DWARF version 2 format (if that is
-supported). This is the format used by DBX on IRIX 6.
-
-@item -g@var{level}
-@itemx -ggdb@var{level}
-@itemx -gstabs@var{level}
-@itemx -gcoff@var{level}
-@itemx -gxcoff@var{level}
-@itemx -gdwarf@var{level}
-@itemx -gdwarf-2@var{level}
-Request debugging information and also use @var{level} to specify how
-much information. The default level is 2.
-
-Level 1 produces minimal information, enough for making backtraces in
-parts of the program that you don't plan to debug. This includes
-descriptions of functions and external variables, but no information
-about local variables and no line numbers.
-
-Level 3 includes extra information, such as all the macro definitions
-present in the program. Some debuggers support macro expansion when
-you use @samp{-g3}.
-
-@cindex @code{prof}
-@item -p
-Generate extra code to write profile information suitable for the
-analysis program @code{prof}. You must use this option when compiling
-the source files you want data about, and you must also use it when
-linking.
-
-@cindex @code{gprof}
-@item -pg
-Generate extra code to write profile information suitable for the
-analysis program @code{gprof}. You must use this option when compiling
-the source files you want data about, and you must also use it when
-linking.
-
-@cindex @code{tcov}
-@item -a
-Generate extra code to write profile information for basic blocks, which will
-record the number of times each basic block is executed, the basic block start
-address, and the function name containing the basic block. If @samp{-g} is
-used, the line number and filename of the start of the basic block will also be
-recorded. If not overridden by the machine description, the default action is
-to append to the text file @file{bb.out}.
-
-This data could be analyzed by a program like @code{tcov}. Note,
-however, that the format of the data is not what @code{tcov} expects.
-Eventually GNU @code{gprof} should be extended to process this data.
-
-@item -Q
-Makes the compiler print out each function name as it is compiled, and
-print some statistics about each pass when it finishes.
-
-@item -ax
-Generate extra code to profile basic blocks. Your executable will
-produce output that is a superset of that produced when @samp{-a} is
-used. Additional output is the source and target address of the basic
-blocks where a jump takes place, the number of times a jump is executed,
-and (optionally) the complete sequence of basic blocks being executed.
-The output is appended to file @file{bb.out}.
-
-You can examine different profiling aspects without recompilation. Your
-executable will read a list of function names from file @file{bb.in}.
-Profiling starts when a function on the list is entered and stops when
-that invocation is exited. To exclude a function from profiling, prefix
-its name with `-'. If a function name is not unique, you can
-disambiguate it by writing it in the form
-@samp{/path/filename.d:functionname}. Your executable will write the
-available paths and filenames in file @file{bb.out}.
-
-Several function names have a special meaning:
-@table @code
-@item __bb_jumps__
-Write source, target and frequency of jumps to file @file{bb.out}.
-@item __bb_hidecall__
-Exclude function calls from frequency count.
-@item __bb_showret__
-Include function returns in frequency count.
-@item __bb_trace__
-Write the sequence of basic blocks executed to file @file{bbtrace.gz}.
-The file will be compressed using the program @samp{gzip}, which must
-exist in your @code{PATH}. On systems without the @samp{popen}
-function, the file will be named @file{bbtrace} and will not be
-compressed. @strong{Profiling for even a few seconds on these systems
-will produce a very large file.} Note: @code{__bb_hidecall__} and
-@code{__bb_showret__} will not affect the sequence written to
-@file{bbtrace.gz}.
-@end table
-
-Here's a short example using different profiling parameters
-in file @file{bb.in}. Assume function @code{foo} consists of basic blocks
-1 and 2 and is called twice from block 3 of function @code{main}. After
-the calls, block 3 transfers control to block 4 of @code{main}.
-
-With @code{__bb_trace__} and @code{main} contained in file @file{bb.in},
-the following sequence of blocks is written to file @file{bbtrace.gz}:
-0 3 1 2 1 2 4. The return from block 2 to block 3 is not shown, because
-the return is to a point inside the block and not to the top. The
-block address 0 always indicates, that control is transferred
-to the trace from somewhere outside the observed functions. With
-@samp{-foo} added to @file{bb.in}, the blocks of function
-@code{foo} are removed from the trace, so only 0 3 4 remains.
-
-With @code{__bb_jumps__} and @code{main} contained in file @file{bb.in},
-jump frequencies will be written to file @file{bb.out}. The
-frequencies are obtained by constructing a trace of blocks
-and incrementing a counter for every neighbouring pair of blocks
-in the trace. The trace 0 3 1 2 1 2 4 displays the following
-frequencies:
-
-@example
-Jump from block 0x0 to block 0x3 executed 1 time(s)
-Jump from block 0x3 to block 0x1 executed 1 time(s)
-Jump from block 0x1 to block 0x2 executed 2 time(s)
-Jump from block 0x2 to block 0x1 executed 1 time(s)
-Jump from block 0x2 to block 0x4 executed 1 time(s)
-@end example
-
-With @code{__bb_hidecall__}, control transfer due to call instructions
-is removed from the trace, that is the trace is cut into three parts: 0
-3 4, 0 1 2 and 0 1 2. With @code{__bb_showret__}, control transfer due
-to return instructions is added to the trace. The trace becomes: 0 3 1
-2 3 1 2 3 4. Note, that this trace is not the same, as the sequence
-written to @file{bbtrace.gz}. It is solely used for counting jump
-frequencies.
-
-@item -fprofile-arcs
-Instrument @dfn{arcs} during compilation. For each function of your
-program, GCC creates a program flow graph, then finds a spanning tree
-for the graph. Only arcs that are not on the spanning tree have to be
-instrumented: the compiler adds code to count the number of times that these
-arcs are executed. When an arc is the only exit or only entrance to a
-block, the instrumentation code can be added to the block; otherwise, a
-new basic block must be created to hold the instrumentation code.
-
-Since not every arc in the program must be instrumented, programs
-compiled with this option run faster than programs compiled with
-@samp{-a}, which adds instrumentation code to every basic block in the
-program. The tradeoff: since @code{gcov} does not have
-execution counts for all branches, it must start with the execution
-counts for the instrumented branches, and then iterate over the program
-flow graph until the entire graph has been solved. Hence, @code{gcov}
-runs a little more slowly than a program which uses information from
-@samp{-a}.
-
-@samp{-fprofile-arcs} also makes it possible to estimate branch
-probabilities, and to calculate basic block execution counts. In
-general, basic block execution counts do not give enough information to
-estimate all branch probabilities. When the compiled program exits, it
-saves the arc execution counts to a file called
-@file{@var{sourcename}.da}. Use the compiler option
-@samp{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
-Control Optimization}) when recompiling, to optimize using estimated
-branch probabilities.
-
-@need 2000
-@item -ftest-coverage
-Create data files for the @code{gcov} code-coverage utility
-(@pxref{Gcov,, @code{gcov}: a GCC Test Coverage Program}).
-The data file names begin with the name of your source file:
-
-@table @code
-@item @var{sourcename}.bb
-A mapping from basic blocks to line numbers, which @code{gcov} uses to
-associate basic block execution counts with line numbers.
-
-@item @var{sourcename}.bbg
-A list of all arcs in the program flow graph. This allows @code{gcov}
-to reconstruct the program flow graph, so that it can compute all basic
-block and arc execution counts from the information in the
-@code{@var{sourcename}.da} file (this last file is the output from
-@samp{-fprofile-arcs}).
-@end table
-
-@item -Q
-Makes the compiler print out each function name as it is compiled, and
-print some statistics about each pass when it finishes.
-
-@item -d@var{letters}
-Says to make debugging dumps during compilation at times specified by
-@var{letters}. This is used for debugging the compiler. The file names
-for most of the dumps are made by appending a word to the source file
-name (e.g. @file{foo.c.rtl} or @file{foo.c.jump}). Here are the
-possible letters for use in @var{letters}, and their meanings:
-
-@table @samp
-@item b
-Dump after computing branch probabilities, to @file{@var{file}.bp}.
-@item c
-Dump after instruction combination, to the file @file{@var{file}.combine}.
-@item d
-Dump after delayed branch scheduling, to @file{@var{file}.dbr}.
-@item D
-Dump all macro definitions, at the end of preprocessing, in addition to
-normal output.
-@item r
-Dump after RTL generation, to @file{@var{file}.rtl}.
-@item j
-Dump after first jump optimization, to @file{@var{file}.jump}.
-@item F
-Dump after purging ADDRESSOF, to @file{@var{file}.addressof}.
-@item f
-Dump after flow analysis, to @file{@var{file}.flow}.
-@item g
-Dump after global register allocation, to @file{@var{file}.greg}.
-@item G
-Dump after GCSE, to @file{@var{file}.gcse}.
-@item j
-Dump after first jump optimization, to @file{@var{file}.jump}.
-@item J
-Dump after last jump optimization, to @file{@var{file}.jump2}.
-@item k
-Dump after conversion from registers to stack, to @file{@var{file}.stack}.
-@item l
-Dump after local register allocation, to @file{@var{file}.lreg}.
-@item L
-Dump after loop optimization, to @file{@var{file}.loop}.
-@item M
-Dump after performing the machine dependent reorganisation pass, to
-@file{@var{file}.mach}.
-@item N
-Dump after the register move pass, to @file{@var{file}.regmove}.
-@item r
-Dump after RTL generation, to @file{@var{file}.rtl}.
-@item R
-Dump after the second instruction scheduling pass, to @file{@var{file}.sched2}.
-@item s
-Dump after CSE (including the jump optimization that sometimes follows
-CSE), to @file{@var{file}.cse}.
-@item S
-Dump after the first instruction scheduling pass, to @file{@var{file}.sched}.
-@item t
-Dump after the second CSE pass (including the jump optimization that
-sometimes follows CSE), to @file{@var{file}.cse2}.
-@item a
-Produce all the dumps listed above.
-@item m
-Print statistics on memory usage, at the end of the run, to
-standard error.
-@item p
-Annotate the assembler output with a comment indicating which
-pattern and alternative was used. The length of each instruction is
-also printed.
-@item x
-Just generate RTL for a function instead of compiling it. Usually used
-with @samp{r}.
-@item y
-Dump debugging information during parsing, to standard error.
-@item A
-Annotate the assembler output with miscellaneous debugging information.
-@end table
-
-@item -fdump-unnumbered
-When doing debugging dumps (see -d option above), suppress instruction
-numbers and line number note output. This makes it more feasible to
-use diff on debugging dumps for compiler invokations with different
-options, in particular with and without -g.
-
-@item -fpretend-float
-When running a cross-compiler, pretend that the target machine uses the
-same floating point format as the host machine. This causes incorrect
-output of the actual floating constants, but the actual instruction
-sequence will probably be the same as GCC would make when running on
-the target machine.
-
-@item -save-temps
-Store the usual ``temporary'' intermediate files permanently; place them
-in the current directory and name them based on the source file. Thus,
-compiling @file{foo.c} with @samp{-c -save-temps} would produce files
-@file{foo.i} and @file{foo.s}, as well as @file{foo.o}.
-
-@item -print-file-name=@var{library}
-Print the full absolute name of the library file @var{library} that
-would be used when linking---and don't do anything else. With this
-option, GCC does not compile or link anything; it just prints the
-file name.
-
-@item -print-prog-name=@var{program}
-Like @samp{-print-file-name}, but searches for a program such as @samp{cpp}.
-
-@item -print-libgcc-file-name
-Same as @samp{-print-file-name=libgcc.a}.
-
-This is useful when you use @samp{-nostdlib} or @samp{-nodefaultlibs}
-but you do want to link with @file{libgcc.a}. You can do
-
-@example
-gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
-@end example
-
-@item -print-search-dirs
-Print the name of the configured installation directory and a list of
-program and library directories gcc will search---and don't do anything else.
-
-This is useful when gcc prints the error message
-@samp{installation problem, cannot exec cpp: No such file or directory}.
-To resolve this you either need to put @file{cpp} and the other compiler
-components where gcc expects to find them, or you can set the environment
-variable @code{GCC_EXEC_PREFIX} to the directory where you installed them.
-Don't forget the trailing '/'.
-@xref{Environment Variables}.
-@end table
-
-@node Optimize Options
-@section Options That Control Optimization
-@cindex optimize options
-@cindex options, optimization
-
-These options control various sorts of optimizations:
-
-@table @code
-@item -O
-@itemx -O1
-Optimize. Optimizing compilation takes somewhat more time, and a lot
-more memory for a large function.
-
-Without @samp{-O}, the compiler's goal is to reduce the cost of
-compilation and to make debugging produce the expected results.
-Statements are independent: if you stop the program with a breakpoint
-between statements, you can then assign a new value to any variable or
-change the program counter to any other statement in the function and
-get exactly the results you would expect from the source code.
-
-Without @samp{-O}, the compiler only allocates variables declared
-@code{register} in registers. The resulting compiled code is a little
-worse than produced by PCC without @samp{-O}.
-
-With @samp{-O}, the compiler tries to reduce code size and execution
-time.
-
-When you specify @samp{-O}, the compiler turns on @samp{-fthread-jumps}
-and @samp{-fdefer-pop} on all machines. The compiler turns on
-@samp{-fdelayed-branch} on machines that have delay slots, and
-@samp{-fomit-frame-pointer} on machines that can support debugging even
-without a frame pointer. On some machines the compiler also turns
-on other flags.@refill
-
-@item -O2
-Optimize even more. GCC performs nearly all supported optimizations
-that do not involve a space-speed tradeoff. The compiler does not
-perform loop unrolling or function inlining when you specify @samp{-O2}.
-As compared to @samp{-O}, this option increases both compilation time
-and the performance of the generated code.
-
-@samp{-O2} turns on all optional optimizations except for loop unrolling,
-function inlining, and strict aliasing optimizations. It also turns on the
-@samp{-fforce-mem} option on all machines and frame pointer elimination on
-machines where doing so does not interfere with debugging.
-
-@item -O3
-Optimize yet more. @samp{-O3} turns on all optimizations specified by
-@samp{-O2} and also turns on the @samp{inline-functions} option.
-
-@item -O0
-Do not optimize.
-
-@item -Os
-Optimize for size. @samp{-Os} enables all @samp{-O2} optimizations that
-do not typically increase code size. It also performs further
-optimizations designed to reduce code size.
-
-If you use multiple @samp{-O} options, with or without level numbers,
-the last such option is the one that is effective.
-@end table
-
-Options of the form @samp{-f@var{flag}} specify machine-independent
-flags. Most flags have both positive and negative forms; the negative
-form of @samp{-ffoo} would be @samp{-fno-foo}. In the table below,
-only one of the forms is listed---the one which is not the default.
-You can figure out the other form by either removing @samp{no-} or
-adding it.
-
-@table @code
-@item -ffloat-store
-Do not store floating point variables in registers, and inhibit other
-options that might change whether a floating point value is taken from a
-register or memory.
-
-@cindex floating point precision
-This option prevents undesirable excess precision on machines such as
-the 68000 where the floating registers (of the 68881) keep more
-precision than a @code{double} is supposed to have. Similarly for the
-x86 architecture. For most programs, the excess precision does only
-good, but a few programs rely on the precise definition of IEEE floating
-point. Use @samp{-ffloat-store} for such programs, after modifying
-them to store all pertinent intermediate computations into variables.
-
-@item -fno-default-inline
-Do not make member functions inline by default merely because they are
-defined inside the class scope (C++ only). Otherwise, when you specify
-@w{@samp{-O}}, member functions defined inside class scope are compiled
-inline by default; i.e., you don't need to add @samp{inline} in front of
-the member function name.
-
-@item -fno-defer-pop
-Always pop the arguments to each function call as soon as that function
-returns. For machines which must pop arguments after a function call,
-the compiler normally lets arguments accumulate on the stack for several
-function calls and pops them all at once.
-
-@item -fforce-mem
-Force memory operands to be copied into registers before doing
-arithmetic on them. This produces better code by making all memory
-references potential common subexpressions. When they are not common
-subexpressions, instruction combination should eliminate the separate
-register-load. The @samp{-O2} option turns on this option.
-
-@item -fforce-addr
-Force memory address constants to be copied into registers before
-doing arithmetic on them. This may produce better code just as
-@samp{-fforce-mem} may.
-
-@item -fomit-frame-pointer
-Don't keep the frame pointer in a register for functions that
-don't need one. This avoids the instructions to save, set up and
-restore frame pointers; it also makes an extra register available
-in many functions. @strong{It also makes debugging impossible on
-some machines.}
-
-@ifset INTERNALS
-On some machines, such as the Vax, this flag has no effect, because
-the standard calling sequence automatically handles the frame pointer
-and nothing is saved by pretending it doesn't exist. The
-machine-description macro @code{FRAME_POINTER_REQUIRED} controls
-whether a target machine supports this flag. @xref{Registers}.@refill
-@end ifset
-@ifclear INTERNALS
-On some machines, such as the Vax, this flag has no effect, because
-the standard calling sequence automatically handles the frame pointer
-and nothing is saved by pretending it doesn't exist. The
-machine-description macro @code{FRAME_POINTER_REQUIRED} controls
-whether a target machine supports this flag. @xref{Registers,,Register
-Usage, gcc.info, Using and Porting GCC}.@refill
-@end ifclear
-
-@item -fno-inline
-Don't pay attention to the @code{inline} keyword. Normally this option
-is used to keep the compiler from expanding any functions inline.
-Note that if you are not optimizing, no functions can be expanded inline.
-
-@item -finline-functions
-Integrate all simple functions into their callers. The compiler
-heuristically decides which functions are simple enough to be worth
-integrating in this way.
-
-If all calls to a given function are integrated, and the function is
-declared @code{static}, then the function is normally not output as
-assembler code in its own right.
-
-@item -finline-limit-@var{n}
-By default, gcc limits the size of functions that can be inlined. This flag
-allows the control of this limit for functions that are explicitly marked as
-inline (ie marked with the inline keyword or defined within the class
-definition in c++). @var{n} is the size of functions that can be inlined in
-number of pseudo instructions (not counting parameter handling). The default
-value of n is 10000. Increasing this value can result in more inlined code at
-the cost of compilation time and memory consumption. Decreasing usually makes
-the compilation faster and less code will be inlined (which presumably
-means slower programs). This option is particularly useful for programs that
-use inlining heavily such as those based on recursive templates with c++.
-
-@emph{Note:} pseudo instruction represents, in this particular context, an
-abstract measurement of function's size. In no way, it represents a count
-of assembly instructions and as such its exact meaning might change from one
-release to an another.
-
-@item -fkeep-inline-functions
-Even if all calls to a given function are integrated, and the function
-is declared @code{static}, nevertheless output a separate run-time
-callable version of the function. This switch does not affect
-@code{extern inline} functions.
-
-@item -fkeep-static-consts
-Emit variables declared @code{static const} when optimization isn't turned
-on, even if the variables aren't referenced.
-
-GCC enables this option by default. If you want to force the compiler to
-check if the variable was referenced, regardless of whether or not
-optimization is turned on, use the @samp{-fno-keep-static-consts} option.
-
-@item -fno-function-cse
-Do not put function addresses in registers; make each instruction that
-calls a constant function contain the function's address explicitly.
-
-This option results in less efficient code, but some strange hacks
-that alter the assembler output may be confused by the optimizations
-performed when this option is not used.
-
-@item -ffast-math
-This option allows GCC to violate some ANSI or IEEE rules and/or
-specifications in the interest of optimizing code for speed. For
-example, it allows the compiler to assume arguments to the @code{sqrt}
-function are non-negative numbers and that no floating-point values
-are NaNs.
-
-This option should never be turned on by any @samp{-O} option since
-it can result in incorrect output for programs which depend on
-an exact implementation of IEEE or ANSI rules/specifications for
-math functions.
-@end table
-
-@c following causes underfulls.. they don't look great, but we deal.
-@c --mew 26jan93
-The following options control specific optimizations. The @samp{-O2}
-option turns on all of these optimizations except @samp{-funroll-loops}
-@samp{-funroll-all-loops}, and @samp{-fstrict-aliasing}. On most machines, the
-@samp{-O} option turns on the @samp{-fthread-jumps} and @samp{-fdelayed-branch}
-options, but specific machines may handle it differently.
-
-You can use the following flags in the rare cases when ``fine-tuning''
-of optimizations to be performed is desired.
-
-@table @code
-@item -fstrength-reduce
-Perform the optimizations of loop strength reduction and
-elimination of iteration variables.
-
-@item -fthread-jumps
-Perform optimizations where we check to see if a jump branches to a
-location where another comparison subsumed by the first is found. If
-so, the first branch is redirected to either the destination of the
-second branch or a point immediately following it, depending on whether
-the condition is known to be true or false.
-
-@item -fcse-follow-jumps
-In common subexpression elimination, scan through jump instructions
-when the target of the jump is not reached by any other path. For
-example, when CSE encounters an @code{if} statement with an
-@code{else} clause, CSE will follow the jump when the condition
-tested is false.
-
-@item -fcse-skip-blocks
-This is similar to @samp{-fcse-follow-jumps}, but causes CSE to
-follow jumps which conditionally skip over blocks. When CSE
-encounters a simple @code{if} statement with no else clause,
-@samp{-fcse-skip-blocks} causes CSE to follow the jump around the
-body of the @code{if}.
-
-@item -frerun-cse-after-loop
-Re-run common subexpression elimination after loop optimizations has been
-performed.
-
-@item -frerun-loop-opt
-Run the loop optimizer twice.
-
-@item -fgcse
-Perform a global common subexpression elimination pass.
-This pass also performs global constant and copy propagation.
-
-@item -fexpensive-optimizations
-Perform a number of minor optimizations that are relatively expensive.
-
-@item -foptimize-register-moves
-@itemx -fregmove
-Attempt to reassign register numbers in move instructions and as
-operands of other simple instructions in order to maximize the amount of
-register tying. This is especially helpful on machines with two-operand
-instructions. GCC enables this optimization by default with @samp{-O2}
-or higher.
-
-Note @code{-fregmove} and @code{-foptimize-register-moves} are the same
-optimization.
-
-@item -fdelayed-branch
-If supported for the target machine, attempt to reorder instructions
-to exploit instruction slots available after delayed branch
-instructions.
-
-@item -fschedule-insns
-If supported for the target machine, attempt to reorder instructions to
-eliminate execution stalls due to required data being unavailable. This
-helps machines that have slow floating point or memory load instructions
-by allowing other instructions to be issued until the result of the load
-or floating point instruction is required.
-
-@item -fschedule-insns2
-Similar to @samp{-fschedule-insns}, but requests an additional pass of
-instruction scheduling after register allocation has been done. This is
-especially useful on machines with a relatively small number of
-registers and where memory load instructions take more than one cycle.
-
-@item -ffunction-sections
-@itemx -fdata-sections
-Place each function or data item into its own section in the output
-file if the target supports arbitrary sections. The name of the
-function or the name of the data item determines the section's name
-in the output file.
-
-Use these options on systems where the linker can perform optimizations
-to improve locality of reference in the instruction space. HPPA
-processors running HP-UX and Sparc processors running Solaris 2 have
-linkers with such optimizations. Other systems using the ELF object format
-as well as AIX may have these optimizations in the future.
-
-Only use these options when there are significant benefits from doing
-so. When you specify these options, the assembler and linker will
-create larger object and executable files and will also be slower.
-You will not be able to use @code{gprof} on all systems if you
-specify this option and you may have problems with debugging if
-you specify both this option and @samp{-g}.
-
-@item -fcaller-saves
-Enable values to be allocated in registers that will be clobbered by
-function calls, by emitting extra instructions to save and restore the
-registers around such calls. Such allocation is done only when it
-seems to result in better code than would otherwise be produced.
-
-This option is always enabled by default on certain machines, usually
-those which have no call-preserved registers to use instead.
-
-For all machines, optimization level 2 and higher enables this flag by
-default.
-
-@item -funroll-loops
-Perform the optimization of loop unrolling. This is only done for loops
-whose number of iterations can be determined at compile time or run time.
-@samp{-funroll-loops} implies both @samp{-fstrength-reduce} and
-@samp{-frerun-cse-after-loop}.
-
-@item -funroll-all-loops
-Perform the optimization of loop unrolling. This is done for all loops
-and usually makes programs run more slowly. @samp{-funroll-all-loops}
-implies @samp{-fstrength-reduce} as well as @samp{-frerun-cse-after-loop}.
-
-@item -fmove-all-movables
-Forces all invariant computations in loops to be moved
-outside the loop.
-
-@item -freduce-all-givs
-Forces all general-induction variables in loops to be
-strength-reduced.
-
-@emph{Note:} When compiling programs written in Fortran,
-@samp{-fmove-all-movables} and @samp{-freduce-all-givs} are enabled
-by default when you use the optimizer.
-
-These options may generate better or worse code; results are highly
-dependent on the structure of loops within the source code.
-
-These two options are intended to be removed someday, once
-they have helped determine the efficacy of various
-approaches to improving loop optimizations.
-
-Please let us (@code{gcc@@gcc.gnu.org} and @code{fortran@@gnu.org})
-know how use of these options affects
-the performance of your production code.
-We're very interested in code that runs @emph{slower}
-when these options are @emph{enabled}.
-
-@item -fno-peephole
-Disable any machine-specific peephole optimizations.
-
-@item -fbranch-probabilities
-After running a program compiled with @samp{-fprofile-arcs}
-(@pxref{Debugging Options,, Options for Debugging Your Program or
-@code{gcc}}), you can compile it a second time using
-@samp{-fbranch-probabilities}, to improve optimizations based on
-guessing the path a branch might take.
-
-@ifset INTERNALS
-With @samp{-fbranch-probabilities}, GCC puts a @samp{REG_EXEC_COUNT}
-note on the first instruction of each basic block, and a
-@samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
-These can be used to improve optimization. Currently, they are only
-used in one place: in @file{reorg.c}, instead of guessing which path a
-branch is mostly to take, the @samp{REG_BR_PROB} values are used to
-exactly determine which path is taken more often.
-@end ifset
-
-@item -fstrict-aliasing
-Allows the compiler to assume the strictest aliasing rules applicable to
-the language being compiled. For C (and C++), this activates
-optimizations based on the type of expressions. In particular, an
-object of one type is assumed never to reside at the same address as an
-object of a different type, unless the types are almost the same. For
-example, an @code{unsigned int} can alias an @code{int}, but not a
-@code{void*} or a @code{double}. A character type may alias any other
-type.
-
-Pay special attention to code like this:
-@example
-union a_union @{
- int i;
- double d;
-@};
-
-int f() @{
- a_union t;
- t.d = 3.0;
- return t.i;
-@}
-@end example
-The practice of reading from a different union member than the one most
-recently written to (called ``type-punning'') is common. Even with
-@samp{-fstrict-aliasing}, type-punning is allowed, provided the memory
-is accessed through the union type. So, the code above will work as
-expected. However, this code might not:
-@example
-int f() @{
- a_union t;
- int* ip;
- t.d = 3.0;
- ip = &t.i;
- return *ip;
-@}
-@end example
-
-@ifset INTERNALS
-Every language that wishes to perform language-specific alias analysis
-should define a function that computes, given an @code{tree}
-node, an alias set for the node. Nodes in different alias sets are not
-allowed to alias. For an example, see the C front-end function
-@code{c_get_alias_set}.
-@end ifset
-
-@end table
-
-@node Preprocessor Options
-@section Options Controlling the Preprocessor
-@cindex preprocessor options
-@cindex options, preprocessor
-
-These options control the C preprocessor, which is run on each C source
-file before actual compilation.
-
-If you use the @samp{-E} option, nothing is done except preprocessing.
-Some of these options make sense only together with @samp{-E} because
-they cause the preprocessor output to be unsuitable for actual
-compilation.
-
-@table @code
-@item -include @var{file}
-Process @var{file} as input before processing the regular input file.
-In effect, the contents of @var{file} are compiled first. Any @samp{-D}
-and @samp{-U} options on the command line are always processed before
-@samp{-include @var{file}}, regardless of the order in which they are
-written. All the @samp{-include} and @samp{-imacros} options are
-processed in the order in which they are written.
-
-@item -imacros @var{file}
-Process @var{file} as input, discarding the resulting output, before
-processing the regular input file. Because the output generated from
-@var{file} is discarded, the only effect of @samp{-imacros @var{file}}
-is to make the macros defined in @var{file} available for use in the
-main input.
-
-Any @samp{-D} and @samp{-U} options on the command line are always
-processed before @samp{-imacros @var{file}}, regardless of the order in
-which they are written. All the @samp{-include} and @samp{-imacros}
-options are processed in the order in which they are written.
-
-@item -idirafter @var{dir}
-@cindex second include path
-Add the directory @var{dir} to the second include path. The directories
-on the second include path are searched when a header file is not found
-in any of the directories in the main include path (the one that
-@samp{-I} adds to).
-
-@item -iprefix @var{prefix}
-Specify @var{prefix} as the prefix for subsequent @samp{-iwithprefix}
-options.
-
-@item -iwithprefix @var{dir}
-Add a directory to the second include path. The directory's name is
-made by concatenating @var{prefix} and @var{dir}, where @var{prefix} was
-specified previously with @samp{-iprefix}. If you have not specified a
-prefix yet, the directory containing the installed passes of the
-compiler is used as the default.
-
-@item -iwithprefixbefore @var{dir}
-Add a directory to the main include path. The directory's name is made
-by concatenating @var{prefix} and @var{dir}, as in the case of
-@samp{-iwithprefix}.
-
-@item -isystem @var{dir}
-Add a directory to the beginning of the second include path, marking it
-as a system directory, so that it gets the same special treatment as
-is applied to the standard system directories.
-
-@item -nostdinc
-Do not search the standard system directories for header files. Only
-the directories you have specified with @samp{-I} options (and the
-current directory, if appropriate) are searched. @xref{Directory
-Options}, for information on @samp{-I}.
-
-By using both @samp{-nostdinc} and @samp{-I-}, you can limit the include-file
-search path to only those directories you specify explicitly.
-
-@item -undef
-Do not predefine any nonstandard macros. (Including architecture flags).
-
-@item -E
-Run only the C preprocessor. Preprocess all the C source files
-specified and output the results to standard output or to the
-specified output file.
-
-@item -C
-Tell the preprocessor not to discard comments. Used with the
-@samp{-E} option.
-
-@item -P
-Tell the preprocessor not to generate @samp{#line} directives.
-Used with the @samp{-E} option.
-
-@cindex make
-@cindex dependencies, make
-@item -M
-Tell the preprocessor to output a rule suitable for @code{make}
-describing the dependencies of each object file. For each source file,
-the preprocessor outputs one @code{make}-rule whose target is the object
-file name for that source file and whose dependencies are all the
-@code{#include} header files it uses. This rule may be a single line or
-may be continued with @samp{\}-newline if it is long. The list of rules
-is printed on standard output instead of the preprocessed C program.
-
-@samp{-M} implies @samp{-E}.
-
-Another way to specify output of a @code{make} rule is by setting
-the environment variable @code{DEPENDENCIES_OUTPUT} (@pxref{Environment
-Variables}).
-
-@item -MM
-Like @samp{-M} but the output mentions only the user header files
-included with @samp{#include "@var{file}"}. System header files
-included with @samp{#include <@var{file}>} are omitted.
-
-@item -MD
-Like @samp{-M} but the dependency information is written to a file made by
-replacing ".c" with ".d" at the end of the input file names.
-This is in addition to compiling the file as specified---@samp{-MD} does
-not inhibit ordinary compilation the way @samp{-M} does.
-
-In Mach, you can use the utility @code{md} to merge multiple dependency
-files into a single dependency file suitable for using with the @samp{make}
-command.
-
-@item -MMD
-Like @samp{-MD} except mention only user header files, not system
-header files.
-
-@item -MG
-Treat missing header files as generated files and assume they live in the
-same directory as the source file. If you specify @samp{-MG}, you
-must also specify either @samp{-M} or @samp{-MM}. @samp{-MG} is not
-supported with @samp{-MD} or @samp{-MMD}.
-
-@item -H
-Print the name of each header file used, in addition to other normal
-activities.
-
-@item -A@var{question}(@var{answer})
-Assert the answer @var{answer} for @var{question}, in case it is tested
-with a preprocessing conditional such as @samp{#if
-#@var{question}(@var{answer})}. @samp{-A-} disables the standard
-assertions that normally describe the target machine.
-
-@item -D@var{macro}
-Define macro @var{macro} with the string @samp{1} as its definition.
-
-@item -D@var{macro}=@var{defn}
-Define macro @var{macro} as @var{defn}. All instances of @samp{-D} on
-the command line are processed before any @samp{-U} options.
-
-@item -U@var{macro}
-Undefine macro @var{macro}. @samp{-U} options are evaluated after all
-@samp{-D} options, but before any @samp{-include} and @samp{-imacros}
-options.
-
-@item -dM
-Tell the preprocessor to output only a list of the macro definitions
-that are in effect at the end of preprocessing. Used with the @samp{-E}
-option.
-
-@item -dD
-Tell the preprocessing to pass all macro definitions into the output, in
-their proper sequence in the rest of the output.
-
-@item -dN
-Like @samp{-dD} except that the macro arguments and contents are omitted.
-Only @samp{#define @var{name}} is included in the output.
-
-@item -trigraphs
-Support ANSI C trigraphs. The @samp{-ansi} option also has this effect.
-
-@item -Wp,@var{option}
-Pass @var{option} as an option to the preprocessor. If @var{option}
-contains commas, it is split into multiple options at the commas.
-@end table
-
-@node Assembler Options
-@section Passing Options to the Assembler
-
-@c prevent bad page break with this line
-You can pass options to the assembler.
-
-@table @code
-@item -Wa,@var{option}
-Pass @var{option} as an option to the assembler. If @var{option}
-contains commas, it is split into multiple options at the commas.
-@end table
-
-@node Link Options
-@section Options for Linking
-@cindex link options
-@cindex options, linking
-
-These options come into play when the compiler links object files into
-an executable output file. They are meaningless if the compiler is
-not doing a link step.
-
-@table @code
-@cindex file names
-@item @var{object-file-name}
-A file name that does not end in a special recognized suffix is
-considered to name an object file or library. (Object files are
-distinguished from libraries by the linker according to the file
-contents.) If linking is done, these object files are used as input
-to the linker.
-
-@item -c
-@itemx -S
-@itemx -E
-If any of these options is used, then the linker is not run, and
-object file names should not be used as arguments. @xref{Overall
-Options}.
-
-@cindex Libraries
-@item -l@var{library}
-Search the library named @var{library} when linking.
-
-It makes a difference where in the command you write this option; the
-linker searches processes libraries and object files in the order they
-are specified. Thus, @samp{foo.o -lz bar.o} searches library @samp{z}
-after file @file{foo.o} but before @file{bar.o}. If @file{bar.o} refers
-to functions in @samp{z}, those functions may not be loaded.
-
-The linker searches a standard list of directories for the library,
-which is actually a file named @file{lib@var{library}.a}. The linker
-then uses this file as if it had been specified precisely by name.
-
-The directories searched include several standard system directories
-plus any that you specify with @samp{-L}.
-
-Normally the files found this way are library files---archive files
-whose members are object files. The linker handles an archive file by
-scanning through it for members which define symbols that have so far
-been referenced but not defined. But if the file that is found is an
-ordinary object file, it is linked in the usual fashion. The only
-difference between using an @samp{-l} option and specifying a file name
-is that @samp{-l} surrounds @var{library} with @samp{lib} and @samp{.a}
-and searches several directories.
-
-@item -lobjc
-You need this special case of the @samp{-l} option in order to
-link an Objective C program.
-
-@item -nostartfiles
-Do not use the standard system startup files when linking.
-The standard system libraries are used normally, unless @code{-nostdlib}
-or @code{-nodefaultlibs} is used.
-
-@item -nodefaultlibs
-Do not use the standard system libraries when linking.
-Only the libraries you specify will be passed to the linker.
-The standard startup files are used normally, unless @code{-nostartfiles}
-is used. The compiler may generate calls to memcmp, memset, and memcpy
-for System V (and ANSI C) environments or to bcopy and bzero for
-BSD environments. These entries are usually resolved by entries in
-libc. These entry points should be supplied through some other
-mechanism when this option is specified.
-
-@item -nostdlib
-Do not use the standard system startup files or libraries when linking.
-No startup files and only the libraries you specify will be passed to
-the linker. The compiler may generate calls to memcmp, memset, and memcpy
-for System V (and ANSI C) environments or to bcopy and bzero for
-BSD environments. These entries are usually resolved by entries in
-libc. These entry points should be supplied through some other
-mechanism when this option is specified.
-
-@cindex @code{-lgcc}, use with @code{-nostdlib}
-@cindex @code{-nostdlib} and unresolved references
-@cindex unresolved references and @code{-nostdlib}
-@cindex @code{-lgcc}, use with @code{-nodefaultlibs}
-@cindex @code{-nodefaultlibs} and unresolved references
-@cindex unresolved references and @code{-nodefaultlibs}
-One of the standard libraries bypassed by @samp{-nostdlib} and
-@samp{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
-that GCC uses to overcome shortcomings of particular machines, or special
-needs for some languages.
-@ifset INTERNALS
-(@xref{Interface,,Interfacing to GCC Output}, for more discussion of
-@file{libgcc.a}.)
-@end ifset
-@ifclear INTERNALS
-(@xref{Interface,,Interfacing to GCC Output,gcc.info,Porting GCC},
-for more discussion of @file{libgcc.a}.)
-@end ifclear
-In most cases, you need @file{libgcc.a} even when you want to avoid
-other standard libraries. In other words, when you specify @samp{-nostdlib}
-or @samp{-nodefaultlibs} you should usually specify @samp{-lgcc} as well.
-This ensures that you have no unresolved references to internal GCC
-library subroutines. (For example, @samp{__main}, used to ensure C++
-constructors will be called; @pxref{Collect2,,@code{collect2}}.)
-
-@item -s
-Remove all symbol table and relocation information from the executable.
-
-@item -static
-On systems that support dynamic linking, this prevents linking with the shared
-libraries. On other systems, this option has no effect.
-
-@item -shared
-Produce a shared object which can then be linked with other objects to
-form an executable. Not all systems support this option. You must
-also specify @samp{-fpic} or @samp{-fPIC} on some systems when
-you specify this option.
-
-@item -symbolic
-Bind references to global symbols when building a shared object. Warn
-about any unresolved references (unless overridden by the link editor
-option @samp{-Xlinker -z -Xlinker defs}). Only a few systems support
-this option.
-
-@item -Xlinker @var{option}
-Pass @var{option} as an option to the linker. You can use this to
-supply system-specific linker options which GCC does not know how to
-recognize.
-
-If you want to pass an option that takes an argument, you must use
-@samp{-Xlinker} twice, once for the option and once for the argument.
-For example, to pass @samp{-assert definitions}, you must write
-@samp{-Xlinker -assert -Xlinker definitions}. It does not work to write
-@samp{-Xlinker "-assert definitions"}, because this passes the entire
-string as a single argument, which is not what the linker expects.
-
-@item -Wl,@var{option}
-Pass @var{option} as an option to the linker. If @var{option} contains
-commas, it is split into multiple options at the commas.
-
-@item -u @var{symbol}
-Pretend the symbol @var{symbol} is undefined, to force linking of
-library modules to define it. You can use @samp{-u} multiple times with
-different symbols to force loading of additional library modules.
-@end table
-
-@node Directory Options
-@section Options for Directory Search
-@cindex directory options
-@cindex options, directory search
-@cindex search path
-
-These options specify directories to search for header files, for
-libraries and for parts of the compiler:
-
-@table @code
-@item -I@var{dir}
-Add the directory @var{dir} to the head of the list of directories to be
-searched for header files. This can be used to override a system header
-file, substituting your own version, since these directories are
-searched before the system header file directories. If you use more
-than one @samp{-I} option, the directories are scanned in left-to-right
-order; the standard system directories come after.
-
-@item -I-
-Any directories you specify with @samp{-I} options before the @samp{-I-}
-option are searched only for the case of @samp{#include "@var{file}"};
-they are not searched for @samp{#include <@var{file}>}.
-
-If additional directories are specified with @samp{-I} options after
-the @samp{-I-}, these directories are searched for all @samp{#include}
-directives. (Ordinarily @emph{all} @samp{-I} directories are used
-this way.)
-
-In addition, the @samp{-I-} option inhibits the use of the current
-directory (where the current input file came from) as the first search
-directory for @samp{#include "@var{file}"}. There is no way to
-override this effect of @samp{-I-}. With @samp{-I.} you can specify
-searching the directory which was current when the compiler was
-invoked. That is not exactly the same as what the preprocessor does
-by default, but it is often satisfactory.
-
-@samp{-I-} does not inhibit the use of the standard system directories
-for header files. Thus, @samp{-I-} and @samp{-nostdinc} are
-independent.
-
-@item -L@var{dir}
-Add directory @var{dir} to the list of directories to be searched
-for @samp{-l}.
-
-@item -B@var{prefix}
-This option specifies where to find the executables, libraries,
-include files, and data files of the compiler itself.
-
-The compiler driver program runs one or more of the subprograms
-@file{cpp}, @file{cc1}, @file{as} and @file{ld}. It tries
-@var{prefix} as a prefix for each program it tries to run, both with and
-without @samp{@var{machine}/@var{version}/} (@pxref{Target Options}).
-
-For each subprogram to be run, the compiler driver first tries the
-@samp{-B} prefix, if any. If that name is not found, or if @samp{-B}
-was not specified, the driver tries two standard prefixes, which are
-@file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc-lib/}. If neither of
-those results in a file name that is found, the unmodified program
-name is searched for using the directories specified in your
-@samp{PATH} environment variable.
-
-@samp{-B} prefixes that effectively specify directory names also apply
-to libraries in the linker, because the compiler translates these
-options into @samp{-L} options for the linker. They also apply to
-includes files in the preprocessor, because the compiler translates these
-options into @samp{-isystem} options for the preprocessor. In this case,
-the compiler appends @samp{include} to the prefix.
-
-The run-time support file @file{libgcc.a} can also be searched for using
-the @samp{-B} prefix, if needed. If it is not found there, the two
-standard prefixes above are tried, and that is all. The file is left
-out of the link if it is not found by those means.
-
-Another way to specify a prefix much like the @samp{-B} prefix is to use
-the environment variable @code{GCC_EXEC_PREFIX}. @xref{Environment
-Variables}.
-
-@item -specs=@var{file}
-Process @var{file} after the compiler reads in the standard @file{specs}
-file, in order to override the defaults that the @file{gcc} driver
-program uses when determining what switches to pass to @file{cc1},
-@file{cc1plus}, @file{as}, @file{ld}, etc. More than one
-@samp{-specs=}@var{file} can be specified on the command line, and they
-are processed in order, from left to right.
-@end table
-
-@node Target Options
-@section Specifying Target Machine and Compiler Version
-@cindex target options
-@cindex cross compiling
-@cindex specifying machine version
-@cindex specifying compiler version and target machine
-@cindex compiler version, specifying
-@cindex target machine, specifying
-
-By default, GCC compiles code for the same type of machine that you
-are using. However, it can also be installed as a cross-compiler, to
-compile for some other type of machine. In fact, several different
-configurations of GCC, for different target machines, can be
-installed side by side. Then you specify which one to use with the
-@samp{-b} option.
-
-In addition, older and newer versions of GCC can be installed side
-by side. One of them (probably the newest) will be the default, but
-you may sometimes wish to use another.
-
-@table @code
-@item -b @var{machine}
-The argument @var{machine} specifies the target machine for compilation.
-This is useful when you have installed GCC as a cross-compiler.
-
-The value to use for @var{machine} is the same as was specified as the
-machine type when configuring GCC as a cross-compiler. For
-example, if a cross-compiler was configured with @samp{configure
-i386v}, meaning to compile for an 80386 running System V, then you
-would specify @samp{-b i386v} to run that cross compiler.
-
-When you do not specify @samp{-b}, it normally means to compile for
-the same type of machine that you are using.
-
-@item -V @var{version}
-The argument @var{version} specifies which version of GCC to run.
-This is useful when multiple versions are installed. For example,
-@var{version} might be @samp{2.0}, meaning to run GCC version 2.0.
-
-The default version, when you do not specify @samp{-V}, is the last
-version of GCC that you installed.
-@end table
-
-The @samp{-b} and @samp{-V} options actually work by controlling part of
-the file name used for the executable files and libraries used for
-compilation. A given version of GCC, for a given target machine, is
-normally kept in the directory @file{/usr/local/lib/gcc-lib/@var{machine}/@var{version}}.@refill
-
-Thus, sites can customize the effect of @samp{-b} or @samp{-V} either by
-changing the names of these directories or adding alternate names (or
-symbolic links). If in directory @file{/usr/local/lib/gcc-lib/} the
-file @file{80386} is a link to the file @file{i386v}, then @samp{-b
-80386} becomes an alias for @samp{-b i386v}.
-
-In one respect, the @samp{-b} or @samp{-V} do not completely change
-to a different compiler: the top-level driver program @code{gcc}
-that you originally invoked continues to run and invoke the other
-executables (preprocessor, compiler per se, assembler and linker)
-that do the real work. However, since no real work is done in the
-driver program, it usually does not matter that the driver program
-in use is not the one for the specified target and version.
-
-The only way that the driver program depends on the target machine is
-in the parsing and handling of special machine-specific options.
-However, this is controlled by a file which is found, along with the
-other executables, in the directory for the specified version and
-target machine. As a result, a single installed driver program adapts
-to any specified target machine and compiler version.
-
-The driver program executable does control one significant thing,
-however: the default version and target machine. Therefore, you can
-install different instances of the driver program, compiled for
-different targets or versions, under different names.
-
-For example, if the driver for version 2.0 is installed as @code{ogcc}
-and that for version 2.1 is installed as @code{gcc}, then the command
-@code{gcc} will use version 2.1 by default, while @code{ogcc} will use
-2.0 by default. However, you can choose either version with either
-command with the @samp{-V} option.
-
-@node Submodel Options
-@section Hardware Models and Configurations
-@cindex submodel options
-@cindex specifying hardware config
-@cindex hardware models and configurations, specifying
-@cindex machine dependent options
-
-Earlier we discussed the standard option @samp{-b} which chooses among
-different installed compilers for completely different target
-machines, such as Vax vs. 68000 vs. 80386.
-
-In addition, each of these target machine types can have its own
-special options, starting with @samp{-m}, to choose among various
-hardware models or configurations---for example, 68010 vs 68020,
-floating coprocessor or none. A single installed version of the
-compiler can compile for any model or configuration, according to the
-options specified.
-
-Some configurations of the compiler also support additional special
-options, usually for compatibility with other compilers on the same
-platform.
-
-@ifset INTERNALS
-These options are defined by the macro @code{TARGET_SWITCHES} in the
-machine description. The default for the options is also defined by
-that macro, which enables you to change the defaults.
-@end ifset
-
-@menu
-* M680x0 Options::
-* VAX Options::
-* SPARC Options::
-* Convex Options::
-* AMD29K Options::
-* ARM Options::
-* Thumb Options::
-* MN10200 Options::
-* MN10300 Options::
-* M32R/D Options::
-* M88K Options::
-* RS/6000 and PowerPC Options::
-* RT Options::
-* MIPS Options::
-* i386 Options::
-* HPPA Options::
-* Intel 960 Options::
-* DEC Alpha Options::
-* Clipper Options::
-* H8/300 Options::
-* SH Options::
-* System V Options::
-* TMS320C3x/C4x Options::
-* V850 Options::
-* ARC Options::
-* NS32K Options::
-@end menu
-
-@node M680x0 Options
-@subsection M680x0 Options
-@cindex M680x0 options
-
-These are the @samp{-m} options defined for the 68000 series. The default
-values for these options depends on which style of 68000 was selected when
-the compiler was configured; the defaults for the most common choices are
-given below.
-
-@table @code
-@item -m68000
-@itemx -mc68000
-Generate output for a 68000. This is the default
-when the compiler is configured for 68000-based systems.
-
-Use this option for microcontrollers with a 68000 or EC000 core,
-including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
-
-@item -m68020
-@itemx -mc68020
-Generate output for a 68020. This is the default
-when the compiler is configured for 68020-based systems.
-
-@item -m68881
-Generate output containing 68881 instructions for floating point.
-This is the default for most 68020 systems unless @samp{-nfp} was
-specified when the compiler was configured.
-
-@item -m68030
-Generate output for a 68030. This is the default when the compiler is
-configured for 68030-based systems.
-
-@item -m68040
-Generate output for a 68040. This is the default when the compiler is
-configured for 68040-based systems.
-
-This option inhibits the use of 68881/68882 instructions that have to be
-emulated by software on the 68040. Use this option if your 68040 does not
-have code to emulate those instructions.
-
-@item -m68060
-Generate output for a 68060. This is the default when the compiler is
-configured for 68060-based systems.
-
-This option inhibits the use of 68020 and 68881/68882 instructions that
-have to be emulated by software on the 68060. Use this option if your 68060
-does not have code to emulate those instructions.
-
-@item -mcpu32
-Generate output for a CPU32. This is the default
-when the compiler is configured for CPU32-based systems.
-
-Use this option for microcontrollers with a
-CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
-68336, 68340, 68341, 68349 and 68360.
-
-@item -m5200
-Generate output for a 520X "coldfire" family cpu. This is the default
-when the compiler is configured for 520X-based systems.
-
-Use this option for microcontroller with a 5200 core, including
-the MCF5202, MCF5203, MCF5204 and MCF5202.
-
-
-@item -m68020-40
-Generate output for a 68040, without using any of the new instructions.
-This results in code which can run relatively efficiently on either a
-68020/68881 or a 68030 or a 68040. The generated code does use the
-68881 instructions that are emulated on the 68040.
-
-@item -m68020-60
-Generate output for a 68060, without using any of the new instructions.
-This results in code which can run relatively efficiently on either a
-68020/68881 or a 68030 or a 68040. The generated code does use the
-68881 instructions that are emulated on the 68060.
-
-@item -mfpa
-Generate output containing Sun FPA instructions for floating point.
-
-@item -msoft-float
-Generate output containing library calls for floating point.
-@strong{Warning:} the requisite libraries are not available for all m68k
-targets. Normally the facilities of the machine's usual C compiler are
-used, but this can't be done directly in cross-compilation. You must
-make your own arrangements to provide suitable library functions for
-cross-compilation. The embedded targets @samp{m68k-*-aout} and
-@samp{m68k-*-coff} do provide software floating point support.
-
-@item -mshort
-Consider type @code{int} to be 16 bits wide, like @code{short int}.
-
-@item -mnobitfield
-Do not use the bit-field instructions. The @samp{-m68000}, @samp{-mcpu32}
-and @samp{-m5200} options imply @w{@samp{-mnobitfield}}.
-
-@item -mbitfield
-Do use the bit-field instructions. The @samp{-m68020} option implies
-@samp{-mbitfield}. This is the default if you use a configuration
-designed for a 68020.
-
-@item -mrtd
-Use a different function-calling convention, in which functions
-that take a fixed number of arguments return with the @code{rtd}
-instruction, which pops their arguments while returning. This
-saves one instruction in the caller since there is no need to pop
-the arguments there.
-
-This calling convention is incompatible with the one normally
-used on Unix, so you cannot use it if you need to call libraries
-compiled with the Unix compiler.
-
-Also, you must provide function prototypes for all functions that
-take variable numbers of arguments (including @code{printf});
-otherwise incorrect code will be generated for calls to those
-functions.
-
-In addition, seriously incorrect code will result if you call a
-function with too many arguments. (Normally, extra arguments are
-harmlessly ignored.)
-
-The @code{rtd} instruction is supported by the 68010, 68020, 68030,
-68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
-
-@item -malign-int
-@itemx -mno-align-int
-Control whether GCC aligns @code{int}, @code{long}, @code{long long},
-@code{float}, @code{double}, and @code{long double} variables on a 32-bit
-boundary (@samp{-malign-int}) or a 16-bit boundary (@samp{-mno-align-int}).
-Aligning variables on 32-bit boundaries produces code that runs somewhat
-faster on processors with 32-bit busses at the expense of more memory.
-
-@strong{Warning:} if you use the @samp{-malign-int} switch, GCC will
-align structures containing the above types differently than
-most published application binary interface specifications for the m68k.
-
-@end table
-
-@node VAX Options
-@subsection VAX Options
-@cindex VAX options
-
-These @samp{-m} options are defined for the Vax:
-
-@table @code
-@item -munix
-Do not output certain jump instructions (@code{aobleq} and so on)
-that the Unix assembler for the Vax cannot handle across long
-ranges.
-
-@item -mgnu
-Do output those jump instructions, on the assumption that you
-will assemble with the GNU assembler.
-
-@item -mg
-Output code for g-format floating point numbers instead of d-format.
-@end table
-
-@node SPARC Options
-@subsection SPARC Options
-@cindex SPARC options
-
-These @samp{-m} switches are supported on the SPARC:
-
-@table @code
-@item -mno-app-regs
-@itemx -mapp-regs
-Specify @samp{-mapp-regs} to generate output using the global registers
-2 through 4, which the SPARC SVR4 ABI reserves for applications. This
-is the default.
-
-To be fully SVR4 ABI compliant at the cost of some performance loss,
-specify @samp{-mno-app-regs}. You should compile libraries and system
-software with this option.
-
-@item -mfpu
-@itemx -mhard-float
-Generate output containing floating point instructions. This is the
-default.
-
-@item -mno-fpu
-@itemx -msoft-float
-Generate output containing library calls for floating point.
-@strong{Warning:} the requisite libraries are not available for all SPARC
-targets. Normally the facilities of the machine's usual C compiler are
-used, but this cannot be done directly in cross-compilation. You must make
-your own arrangements to provide suitable library functions for
-cross-compilation. The embedded targets @samp{sparc-*-aout} and
-@samp{sparclite-*-*} do provide software floating point support.
-
-@samp{-msoft-float} changes the calling convention in the output file;
-therefore, it is only useful if you compile @emph{all} of a program with
-this option. In particular, you need to compile @file{libgcc.a}, the
-library that comes with GCC, with @samp{-msoft-float} in order for
-this to work.
-
-@item -mhard-quad-float
-Generate output containing quad-word (long double) floating point
-instructions.
-
-@item -msoft-quad-float
-Generate output containing library calls for quad-word (long double)
-floating point instructions. The functions called are those specified
-in the SPARC ABI. This is the default.
-
-As of this writing, there are no sparc implementations that have hardware
-support for the quad-word floating point instructions. They all invoke
-a trap handler for one of these instructions, and then the trap handler
-emulates the effect of the instruction. Because of the trap handler overhead,
-this is much slower than calling the ABI library routines. Thus the
-@samp{-msoft-quad-float} option is the default.
-
-@item -mno-epilogue
-@itemx -mepilogue
-With @samp{-mepilogue} (the default), the compiler always emits code for
-function exit at the end of each function. Any function exit in
-the middle of the function (such as a return statement in C) will
-generate a jump to the exit code at the end of the function.
-
-With @samp{-mno-epilogue}, the compiler tries to emit exit code inline
-at every function exit.
-
-@item -mno-flat
-@itemx -mflat
-With @samp{-mflat}, the compiler does not generate save/restore instructions
-and will use a "flat" or single register window calling convention.
-This model uses %i7 as the frame pointer and is compatible with the normal
-register window model. Code from either may be intermixed.
-The local registers and the input registers (0-5) are still treated as
-"call saved" registers and will be saved on the stack as necessary.
-
-With @samp{-mno-flat} (the default), the compiler emits save/restore
-instructions (except for leaf functions) and is the normal mode of operation.
-
-@item -mno-unaligned-doubles
-@itemx -munaligned-doubles
-Assume that doubles have 8 byte alignment. This is the default.
-
-With @samp{-munaligned-doubles}, GCC assumes that doubles have 8 byte
-alignment only if they are contained in another type, or if they have an
-absolute address. Otherwise, it assumes they have 4 byte alignment.
-Specifying this option avoids some rare compatibility problems with code
-generated by other compilers. It is not the default because it results
-in a performance loss, especially for floating point code.
-
-@item -mv8
-@itemx -msparclite
-These two options select variations on the SPARC architecture.
-
-By default (unless specifically configured for the Fujitsu SPARClite),
-GCC generates code for the v7 variant of the SPARC architecture.
-
-@samp{-mv8} will give you SPARC v8 code. The only difference from v7
-code is that the compiler emits the integer multiply and integer
-divide instructions which exist in SPARC v8 but not in SPARC v7.
-
-@samp{-msparclite} will give you SPARClite code. This adds the integer
-multiply, integer divide step and scan (@code{ffs}) instructions which
-exist in SPARClite but not in SPARC v7.
-
-These options are deprecated and will be deleted in a future GCC release.
-They have been replaced with @samp{-mcpu=xxx}.
-
-@item -mcypress
-@itemx -msupersparc
-These two options select the processor for which the code is optimised.
-
-With @samp{-mcypress} (the default), the compiler optimizes code for the
-Cypress CY7C602 chip, as used in the SparcStation/SparcServer 3xx series.
-This is also appropriate for the older SparcStation 1, 2, IPX etc.
-
-With @samp{-msupersparc} the compiler optimizes code for the SuperSparc cpu, as
-used in the SparcStation 10, 1000 and 2000 series. This flag also enables use
-of the full SPARC v8 instruction set.
-
-These options are deprecated and will be deleted in a future GCC release.
-They have been replaced with @samp{-mcpu=xxx}.
-
-@item -mcpu=@var{cpu_type}
-Set the instruction set, register set, and instruction scheduling parameters
-for machine type @var{cpu_type}. Supported values for @var{cpu_type} are
-@samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{sparclite},
-@samp{hypersparc}, @samp{sparclite86x}, @samp{f930}, @samp{f934},
-@samp{sparclet}, @samp{tsc701}, @samp{v9}, and @samp{ultrasparc}.
-
-Default instruction scheduling parameters are used for values that select
-an architecture and not an implementation. These are @samp{v7}, @samp{v8},
-@samp{sparclite}, @samp{sparclet}, @samp{v9}.
-
-Here is a list of each supported architecture and their supported
-implementations.
-
-@smallexample
- v7: cypress
- v8: supersparc, hypersparc
- sparclite: f930, f934, sparclite86x
- sparclet: tsc701
- v9: ultrasparc
-@end smallexample
-
-@item -mtune=@var{cpu_type}
-Set the instruction scheduling parameters for machine type
-@var{cpu_type}, but do not set the instruction set or register set that the
-option @samp{-mcpu=}@var{cpu_type} would.
-
-The same values for @samp{-mcpu=}@var{cpu_type} are used for
-@samp{-mtune=}@*@var{cpu_type}, though the only useful values are those that
-select a particular cpu implementation: @samp{cypress}, @samp{supersparc},
-@samp{hypersparc}, @samp{f930}, @samp{f934}, @samp{sparclite86x},
-@samp{tsc701}, @samp{ultrasparc}.
-
-@item -malign-loops=@var{num}
-Align loops to a 2 raised to a @var{num} byte boundary. If
-@samp{-malign-loops} is not specified, the default is 2.
-
-@item -malign-jumps=@var{num}
-Align instructions that are only jumped to to a 2 raised to a @var{num}
-byte boundary. If @samp{-malign-jumps} is not specified, the default is 2.
-
-@item -malign-functions=@var{num}
-Align the start of functions to a 2 raised to @var{num} byte boundary.
-If @samp{-malign-functions} is not specified, the default is 2 if compiling
-for 32 bit sparc, and 5 if compiling for 64 bit sparc.
-
-@end table
-
-These @samp{-m} switches are supported in addition to the above
-on the SPARCLET processor.
-
-@table @code
-@item -mlittle-endian
-Generate code for a processor running in little-endian mode.
-
-@item -mlive-g0
-Treat register @code{%g0} as a normal register.
-GCC will continue to clobber it as necessary but will not assume
-it always reads as 0.
-
-@item -mbroken-saverestore
-Generate code that does not use non-trivial forms of the @code{save} and
-@code{restore} instructions. Early versions of the SPARCLET processor do
-not correctly handle @code{save} and @code{restore} instructions used with
-arguments. They correctly handle them used without arguments. A @code{save}
-instruction used without arguments increments the current window pointer
-but does not allocate a new stack frame. It is assumed that the window
-overflow trap handler will properly handle this case as will interrupt
-handlers.
-@end table
-
-These @samp{-m} switches are supported in addition to the above
-on SPARC V9 processors in 64 bit environments.
-
-@table @code
-@item -mlittle-endian
-Generate code for a processor running in little-endian mode.
-
-@item -m32
-@itemx -m64
-Generate code for a 32 bit or 64 bit environment.
-The 32 bit environment sets int, long and pointer to 32 bits.
-The 64 bit environment sets int to 32 bits and long and pointer
-to 64 bits.
-
-@item -mcmodel=medlow
-Generate code for the Medium/Low code model: the program must be linked
-in the low 32 bits of the address space. Pointers are 64 bits.
-Programs can be statically or dynamically linked.
-
-@item -mcmodel=medmid
-Generate code for the Medium/Middle code model: the program must be linked
-in the low 44 bits of the address space, the text segment must be less than
-2G bytes, and data segment must be within 2G of the text segment.
-Pointers are 64 bits.
-
-@item -mcmodel=medany
-Generate code for the Medium/Anywhere code model: the program may be linked
-anywhere in the address space, the text segment must be less than
-2G bytes, and data segment must be within 2G of the text segment.
-Pointers are 64 bits.
-
-@item -mcmodel=embmedany
-Generate code for the Medium/Anywhere code model for embedded systems:
-assume a 32 bit text and a 32 bit data segment, both starting anywhere
-(determined at link time). Register %g4 points to the base of the
-data segment. Pointers still 64 bits.
-Programs are statically linked, PIC is not supported.
-
-@item -mstack-bias
-@itemx -mno-stack-bias
-With @samp{-mstack-bias}, GCC assumes that the stack pointer, and
-frame pointer if present, are offset by -2047 which must be added back
-when making stack frame references.
-Otherwise, assume no such offset is present.
-@end table
-
-@node Convex Options
-@subsection Convex Options
-@cindex Convex options
-
-These @samp{-m} options are defined for Convex:
-
-@table @code
-@item -mc1
-Generate output for C1. The code will run on any Convex machine.
-The preprocessor symbol @code{__convex__c1__} is defined.
-
-@item -mc2
-Generate output for C2. Uses instructions not available on C1.
-Scheduling and other optimizations are chosen for max performance on C2.
-The preprocessor symbol @code{__convex_c2__} is defined.
-
-@item -mc32
-Generate output for C32xx. Uses instructions not available on C1.
-Scheduling and other optimizations are chosen for max performance on C32.
-The preprocessor symbol @code{__convex_c32__} is defined.
-
-@item -mc34
-Generate output for C34xx. Uses instructions not available on C1.
-Scheduling and other optimizations are chosen for max performance on C34.
-The preprocessor symbol @code{__convex_c34__} is defined.
-
-@item -mc38
-Generate output for C38xx. Uses instructions not available on C1.
-Scheduling and other optimizations are chosen for max performance on C38.
-The preprocessor symbol @code{__convex_c38__} is defined.
-
-@item -margcount
-Generate code which puts an argument count in the word preceding each
-argument list. This is compatible with regular CC, and a few programs
-may need the argument count word. GDB and other source-level debuggers
-do not need it; this info is in the symbol table.
-
-@item -mnoargcount
-Omit the argument count word. This is the default.
-
-@item -mvolatile-cache
-Allow volatile references to be cached. This is the default.
-
-@item -mvolatile-nocache
-Volatile references bypass the data cache, going all the way to memory.
-This is only needed for multi-processor code that does not use standard
-synchronization instructions. Making non-volatile references to volatile
-locations will not necessarily work.
-
-@item -mlong32
-Type long is 32 bits, the same as type int. This is the default.
-
-@item -mlong64
-Type long is 64 bits, the same as type long long. This option is useless,
-because no library support exists for it.
-@end table
-
-@node AMD29K Options
-@subsection AMD29K Options
-@cindex AMD29K options
-
-These @samp{-m} options are defined for the AMD Am29000:
-
-@table @code
-@item -mdw
-@kindex -mdw
-@cindex DW bit (29k)
-Generate code that assumes the @code{DW} bit is set, i.e., that byte and
-halfword operations are directly supported by the hardware. This is the
-default.
-
-@item -mndw
-@kindex -mndw
-Generate code that assumes the @code{DW} bit is not set.
-
-@item -mbw
-@kindex -mbw
-@cindex byte writes (29k)
-Generate code that assumes the system supports byte and halfword write
-operations. This is the default.
-
-@item -mnbw
-@kindex -mnbw
-Generate code that assumes the systems does not support byte and
-halfword write operations. @samp{-mnbw} implies @samp{-mndw}.
-
-@item -msmall
-@kindex -msmall
-@cindex memory model (29k)
-Use a small memory model that assumes that all function addresses are
-either within a single 256 KB segment or at an absolute address of less
-than 256k. This allows the @code{call} instruction to be used instead
-of a @code{const}, @code{consth}, @code{calli} sequence.
-
-@item -mnormal
-@kindex -mnormal
-Use the normal memory model: Generate @code{call} instructions only when
-calling functions in the same file and @code{calli} instructions
-otherwise. This works if each file occupies less than 256 KB but allows
-the entire executable to be larger than 256 KB. This is the default.
-
-@item -mlarge
-Always use @code{calli} instructions. Specify this option if you expect
-a single file to compile into more than 256 KB of code.
-
-@item -m29050
-@kindex -m29050
-@cindex processor selection (29k)
-Generate code for the Am29050.
-
-@item -m29000
-@kindex -m29000
-Generate code for the Am29000. This is the default.
-
-@item -mkernel-registers
-@kindex -mkernel-registers
-@cindex kernel and user registers (29k)
-Generate references to registers @code{gr64-gr95} instead of to
-registers @code{gr96-gr127}. This option can be used when compiling
-kernel code that wants a set of global registers disjoint from that used
-by user-mode code.
-
-Note that when this option is used, register names in @samp{-f} flags
-must use the normal, user-mode, names.
-
-@item -muser-registers
-@kindex -muser-registers
-Use the normal set of global registers, @code{gr96-gr127}. This is the
-default.
-
-@item -mstack-check
-@itemx -mno-stack-check
-@kindex -mstack-check
-@cindex stack checks (29k)
-Insert (or do not insert) a call to @code{__msp_check} after each stack
-adjustment. This is often used for kernel code.
-
-@item -mstorem-bug
-@itemx -mno-storem-bug
-@kindex -mstorem-bug
-@cindex storem bug (29k)
-@samp{-mstorem-bug} handles 29k processors which cannot handle the
-separation of a mtsrim insn and a storem instruction (most 29000 chips
-to date, but not the 29050).
-
-@item -mno-reuse-arg-regs
-@itemx -mreuse-arg-regs
-@kindex -mreuse-arg-regs
-@samp{-mno-reuse-arg-regs} tells the compiler to only use incoming argument
-registers for copying out arguments. This helps detect calling a function
-with fewer arguments than it was declared with.
-
-@item -mno-impure-text
-@itemx -mimpure-text
-@kindex -mimpure-text
-@samp{-mimpure-text}, used in addition to @samp{-shared}, tells the compiler to
-not pass @samp{-assert pure-text} to the linker when linking a shared object.
-
-@item -msoft-float
-@kindex -msoft-float
-Generate output containing library calls for floating point.
-@strong{Warning:} the requisite libraries are not part of GCC.
-Normally the facilities of the machine's usual C compiler are used, but
-this can't be done directly in cross-compilation. You must make your
-own arrangements to provide suitable library functions for
-cross-compilation.
-
-@item -mno-multm
-@kindex -mno-multm
-Do not generate multm or multmu instructions. This is useful for some embedded
-systems which do not have trap handlers for these instructions.
-@end table
-
-@node ARM Options
-@subsection ARM Options
-@cindex ARM options
-
-These @samp{-m} options are defined for Advanced RISC Machines (ARM)
-architectures:
-
-@table @code
-@item -mapcs-frame
-@kindex -mapcs-frame
-Generate a stack frame that is compliant with the ARM Procedure Call
-Standard for all functions, even if this is not strictly necessary for
-correct execution of the code. Specifying @samp{-fomit-frame-pointer}
-with this option will cause the stack frames not to be generated for
-leaf functions. The default is @samp{-mno-apcs-frame}.
-
-@item -mapcs
-@kindex -mapcs
-This is a synonym for @samp{-mapcs-frame}.
-
-@item -mapcs-26
-@kindex -mapcs-26
-Generate code for a processor running with a 26-bit program counter,
-and conforming to the function calling standards for the APCS 26-bit
-option. This option replaces the @samp{-m2} and @samp{-m3} options
-of previous releases of the compiler.
-
-@item -mapcs-32
-@kindex -mapcs-32
-Generate code for a processor running with a 32-bit program counter,
-and conforming to the function calling standards for the APCS 32-bit
-option. This option replaces the @samp{-m6} option of previous releases
-of the compiler.
-
-@item -mapcs-stack-check
-@kindex -mapcs-stack-check
-@kindex -mno-apcs-stack-check
-Generate code to check the amount of stack space available upon entry to
-every function (that actually uses some stack space). If there is
-insufficient space available then either the function
-@samp{__rt_stkovf_split_small} or @samp{__rt_stkovf_split_big} will be
-called, depending upon the amount of stack space required. The run time
-system is required to provide these functions. The default is
-@samp{-mno-apcs-stack-check}, since this produces smaller code.
-
-@item -mapcs-float
-@kindex -mapcs-float
-@kindex -mno-apcs-float
-Pass floating point arguments using the float point registers. This is
-one of the variants of the APCS. This option is reccommended if the
-target hardware has a floating point unit or if a lot of floating point
-arithmetic is going to be performed by the code. The default is
-@samp{-mno-apcs-float}, since integer only code is slightly increased in
-size if @samp{-mapcs-float} is used.
-
-@item -mapcs-reentrant
-@kindex -mapcs-reentrant
-@kindex -mno-apcs-reentrant
-Generate reentrant, position independent code. This is the equivalent
-to specifying the @samp{-fpic} option. The default is
-@samp{-mno-apcs-reentrant}.
-
-@item -mthumb-interwork
-@kindex -mthumb-interwork
-@kindex -mno-thumb-interwork
-Generate code which supports calling between the ARM and THUMB
-instruction sets. Without this option the two instruction sets cannot
-be reliably used inside one program. The default is
-@samp{-mno-thumb-interwork}, since slightly larger code is generated
-when @samp{-mthumb-interwork} is specified.
-
-@item -mno-sched-prolog
-@kindex -mno-sched-prolog
-@kindex -msched-prolog
-Prevent the reordering of instructions in the function prolog, or the
-merging of those instruction with the instructions in the function's
-body. This means that all functions will start with a recognisable set
-of instructions (or in fact one of a chioce from a small set of
-different function prologues), and this information can be used to
-locate the start if functions inside an executable piece of code. The
-default is @samp{-msched-prolog}.
-
-@item -mhard-float
-Generate output containing floating point instructions. This is the
-default.
-
-@item -msoft-float
-Generate output containing library calls for floating point.
-@strong{Warning:} the requisite libraries are not available for all ARM
-targets. Normally the facilities of the machine's usual C compiler are
-used, but this cannot be done directly in cross-compilation. You must make
-your own arrangements to provide suitable library functions for
-cross-compilation.
-
-@samp{-msoft-float} changes the calling convention in the output file;
-therefore, it is only useful if you compile @emph{all} of a program with
-this option. In particular, you need to compile @file{libgcc.a}, the
-library that comes with GCC, with @samp{-msoft-float} in order for
-this to work.
-
-@item -mlittle-endian
-Generate code for a processor running in little-endian mode. This is
-the default for all standard configurations.
-
-@item -mbig-endian
-Generate code for a processor running in big-endian mode; the default is
-to compile code for a little-endian processor.
-
-@item -mwords-little-endian
-This option only applies when generating code for big-endian processors.
-Generate code for a little-endian word order but a big-endian byte
-order. That is, a byte order of the form @samp{32107654}. Note: this
-option should only be used if you require compatibility with code for
-big-endian ARM processors generated by versions of the compiler prior to
-2.8.
-
-@item -mshort-load-bytes
-@kindex -mshort-load-bytes
-Do not try to load half-words (eg @samp{short}s) by loading a word from
-an unaligned address. For some targets the MMU is configured to trap
-unaligned loads; use this option to generate code that is safe in these
-environments.
-
-@item -mno-short-load-bytes
-@kindex -mno-short-load-bytes
-Use unaligned word loads to load half-words (eg @samp{short}s). This
-option produces more efficient code, but the MMU is sometimes configured
-to trap these instructions.
-
-@item -mshort-load-words
-@kindex -mshort-load-words
-This is a synonym for the @samp{-mno-short-load-bytes}.
-
-@item -mno-short-load-words
-@kindex -mno-short-load-words
-This is a synonym for the @samp{-mshort-load-bytes}.
-
-@item -mbsd
-@kindex -mbsd
-This option only applies to RISC iX. Emulate the native BSD-mode
-compiler. This is the default if @samp{-ansi} is not specified.
-
-@item -mxopen
-@kindex -mxopen
-This option only applies to RISC iX. Emulate the native X/Open-mode
-compiler.
-
-@item -mno-symrename
-@kindex -mno-symrename
-This option only applies to RISC iX. Do not run the assembler
-post-processor, @samp{symrename}, after code has been assembled.
-Normally it is necessary to modify some of the standard symbols in
-preparation for linking with the RISC iX C library; this option
-suppresses this pass. The post-processor is never run when the
-compiler is built for cross-compilation.
-
-@item -mcpu=<name>
-@itemx -mtune=<name>
-@kindex -mcpu=
-@kindex -mtune=
-This specifies the name of the target ARM processor. GCC uses this name
-to determine what kind of instructions it can use when generating
-assembly code. Permissable names are: arm2, arm250, arm3, arm6, arm60,
-arm600, arm610, arm620, arm7, arm7m, arm7d, arm7dm, arm7di, arm7dmi,
-arm70, arm700, arm700i, arm710, arm710c, arm7100, arm7500, arm7500fe,
-arm7tdmi, arm8, strongarm, strongarm110, strongarm1100, arm8, arm810,
-arm9, arm9tdmi. @samp{-mtune=} is a synonym for @samp{-mcpue=} to
-support older versions of GCC.
-
-@item -march=<name>
-@kindex -march=
-This specifies the name of the target ARM architecture. GCC uses this
-name to determine what kind of instructions it can use when generating
-assembly code. This option can be used in conjunction with or instead
-of the @samp{-mcpu=} option. Permissable names are: armv2, armv2a,
-armv3, armv3m, armv4, armv4t
-
-@item -mfpe=<number>
-@itemx -mfp=<number>
-@kindex -mfpe=
-@kindex -mfp=
-This specifes the version of the floating point emulation available on
-the target. Permissable values are 2 and 3. @samp{-mfp=} is a synonym
-for @samp{-mfpe=} to support older versions of GCC.
-
-@item -mstructure-size-boundary=<n>
-@kindex -mstructure-size-boundary
-The size of all structures and unions will be rounded up to a multiple
-of the number of bits set by this option. Permissable values are 8 and
-32. The default value varies for different toolchains. For the COFF
-targeted toolchain the default value is 8. Specifying the larger number
-can produced faster, more efficient code, but can also increase the size
-of the program. The two values are potentially incompatible. Code
-compiled with one value cannot necessarily expect to work with code or
-libraries compiled with the other value, if they exchange information
-using structures or unions. Programmers are encouraged to use the 32
-value as future versions of the toolchain may default to this value.
-
-@item -mabort-on-noreturn
-@kindex -mabort-on-noreturn
-@kindex -mnoabort-on-noreturn
-Generate a call to the function abort at the end of a noreturn function.
-It will be executed if the function tries to return.
-
-@end table
-
-@node Thumb Options
-@subsection Thumb Options
-@cindex Thumb Options
-
-@table @code
-
-@item -mthumb-interwork
-@kindex -mthumb-interwork
-@kindex -mno-thumb-interwork
-Generate code which supports calling between the THUMB and ARM
-instruction sets. Without this option the two instruction sets cannot
-be reliably used inside one program. The default is
-@samp{-mno-thumb-interwork}, since slightly smaller code is generated
-with this option.
-
-@item -mtpcs-frame
-@kindex -mtpcs-frame
-@kindex -mno-tpcs-frame
-Generate a stack frame that is compliant with the Thumb Procedure Call
-Standard for all non-leaf functions. (A leaf function is one that does
-not call any other functions). The default is @samp{-mno-apcs-frame}.
-
-@item -mtpcs-leaf-frame
-@kindex -mtpcs-leaf-frame
-@kindex -mno-tpcs-leaf-frame
-Generate a stack frame that is compliant with the Thumb Procedure Call
-Standard for all leaf functions. (A leaf function is one that does
-not call any other functions). The default is @samp{-mno-apcs-leaf-frame}.
-
-@item -mlittle-endian
-@kindex -mlittle-endian
-Generate code for a processor running in little-endian mode. This is
-the default for all standard configurations.
-
-@item -mbig-endian
-@kindex -mbig-endian
-Generate code for a processor running in big-endian mode.
-
-@item -mstructure-size-boundary=<n>
-@kindex -mstructure-size-boundary
-The size of all structures and unions will be rounded up to a multiple
-of the number of bits set by this option. Permissable values are 8 and
-32. The default value varies for different toolchains. For the COFF
-targeted toolchain the default value is 8. Specifying the larger number
-can produced faster, more efficient code, but can also increase the size
-of the program. The two values are potentially incompatible. Code
-compiled with one value cannot necessarily expect to work with code or
-libraries compiled with the other value, if they exchange information
-using structures or unions. Programmers are encouraged to use the 32
-value as future versions of the toolchain may default to this value.
-
-@end table
-
-@node MN10200 Options
-@subsection MN10200 Options
-@cindex MN10200 options
-These @samp{-m} options are defined for Matsushita MN10200 architectures:
-@table @code
-
-@item -mrelax
-Indicate to the linker that it should perform a relaxation optimization pass
-to shorten branches, calls and absolute memory addresses. This option only
-has an effect when used on the command line for the final link step.
-
-This option makes symbolic debugging impossible.
-@end table
-
-@node MN10300 Options
-@subsection MN10300 Options
-@cindex MN10300 options
-These @samp{-m} options are defined for Matsushita MN10300 architectures:
-
-@table @code
-@item -mmult-bug
-Generate code to avoid bugs in the multiply instructions for the MN10300
-processors. This is the default.
-
-@item -mno-mult-bug
-Do not generate code to avoid bugs in the multiply instructions for the
-MN10300 processors.
-
-@item -mrelax
-Indicate to the linker that it should perform a relaxation optimization pass
-to shorten branches, calls and absolute memory addresses. This option only
-has an effect when used on the command line for the final link step.
-
-This option makes symbolic debugging impossible.
-@end table
-
-
-@node M32R/D Options
-@subsection M32R/D Options
-@cindex M32R/D options
-
-These @samp{-m} options are defined for Mitsubishi M32R/D architectures:
-
-@table @code
-@item -mcode-model=small
-Assume all objects live in the lower 16MB of memory (so that their addresses
-can be loaded with the @code{ld24} instruction), and assume all subroutines
-are reachable with the @code{bl} instruction.
-This is the default.
-
-The addressability of a particular object can be set with the
-@code{model} attribute.
-
-@item -mcode-model=medium
-Assume objects may be anywhere in the 32 bit address space (the compiler
-will generate @code{seth/add3} instructions to load their addresses), and
-assume all subroutines are reachable with the @code{bl} instruction.
-
-@item -mcode-model=large
-Assume objects may be anywhere in the 32 bit address space (the compiler
-will generate @code{seth/add3} instructions to load their addresses), and
-assume subroutines may not be reachable with the @code{bl} instruction
-(the compiler will generate the much slower @code{seth/add3/jl}
-instruction sequence).
-
-@item -msdata=none
-Disable use of the small data area. Variables will be put into
-one of @samp{.data}, @samp{bss}, or @samp{.rodata} (unless the
-@code{section} attribute has been specified).
-This is the default.
-
-The small data area consists of sections @samp{.sdata} and @samp{.sbss}.
-Objects may be explicitly put in the small data area with the
-@code{section} attribute using one of these sections.
-
-@item -msdata=sdata
-Put small global and static data in the small data area, but do not
-generate special code to reference them.
-
-@item -msdata=use
-Put small global and static data in the small data area, and generate
-special instructions to reference them.
-
-@item -G @var{num}
-@cindex smaller data references
-Put global and static objects less than or equal to @var{num} bytes
-into the small data or bss sections instead of the normal data or bss
-sections. The default value of @var{num} is 8.
-The @samp{-msdata} option must be set to one of @samp{sdata} or @samp{use}
-for this option to have any effect.
-
-All modules should be compiled with the same @samp{-G @var{num}} value.
-Compiling with different values of @var{num} may or may not work; if it
-doesn't the linker will give an error message - incorrect code will not be
-generated.
-
-@end table
-
-@node M88K Options
-@subsection M88K Options
-@cindex M88k options
-
-These @samp{-m} options are defined for Motorola 88k architectures:
-
-@table @code
-@item -m88000
-@kindex -m88000
-Generate code that works well on both the m88100 and the
-m88110.
-
-@item -m88100
-@kindex -m88100
-Generate code that works best for the m88100, but that also
-runs on the m88110.
-
-@item -m88110
-@kindex -m88110
-Generate code that works best for the m88110, and may not run
-on the m88100.
-
-@item -mbig-pic
-@kindex -mbig-pic
-Obsolete option to be removed from the next revision.
-Use @samp{-fPIC}.
-
-@item -midentify-revision
-@kindex -midentify-revision
-@kindex ident
-@cindex identifying source, compiler (88k)
-Include an @code{ident} directive in the assembler output recording the
-source file name, compiler name and version, timestamp, and compilation
-flags used.
-
-@item -mno-underscores
-@kindex -mno-underscores
-@cindex underscores, avoiding (88k)
-In assembler output, emit symbol names without adding an underscore
-character at the beginning of each name. The default is to use an
-underscore as prefix on each name.
-
-@item -mocs-debug-info
-@itemx -mno-ocs-debug-info
-@kindex -mocs-debug-info
-@kindex -mno-ocs-debug-info
-@cindex OCS (88k)
-@cindex debugging, 88k OCS
-Include (or omit) additional debugging information (about registers used
-in each stack frame) as specified in the 88open Object Compatibility
-Standard, ``OCS''. This extra information allows debugging of code that
-has had the frame pointer eliminated. The default for DG/UX, SVr4, and
-Delta 88 SVr3.2 is to include this information; other 88k configurations
-omit this information by default.
-
-@item -mocs-frame-position
-@kindex -mocs-frame-position
-@cindex register positions in frame (88k)
-When emitting COFF debugging information for automatic variables and
-parameters stored on the stack, use the offset from the canonical frame
-address, which is the stack pointer (register 31) on entry to the
-function. The DG/UX, SVr4, Delta88 SVr3.2, and BCS configurations use
-@samp{-mocs-frame-position}; other 88k configurations have the default
-@samp{-mno-ocs-frame-position}.
-
-@item -mno-ocs-frame-position
-@kindex -mno-ocs-frame-position
-@cindex register positions in frame (88k)
-When emitting COFF debugging information for automatic variables and
-parameters stored on the stack, use the offset from the frame pointer
-register (register 30). When this option is in effect, the frame
-pointer is not eliminated when debugging information is selected by the
--g switch.
-
-@item -moptimize-arg-area
-@itemx -mno-optimize-arg-area
-@kindex -moptimize-arg-area
-@kindex -mno-optimize-arg-area
-@cindex arguments in frame (88k)
-Control how function arguments are stored in stack frames.
-@samp{-moptimize-arg-area} saves space by optimizing them, but this
-conflicts with the 88open specifications. The opposite alternative,
-@samp{-mno-optimize-arg-area}, agrees with 88open standards. By default
-GCC does not optimize the argument area.
-
-@item -mshort-data-@var{num}
-@kindex -mshort-data-@var{num}
-@cindex smaller data references (88k)
-@cindex r0-relative references (88k)
-Generate smaller data references by making them relative to @code{r0},
-which allows loading a value using a single instruction (rather than the
-usual two). You control which data references are affected by
-specifying @var{num} with this option. For example, if you specify
-@samp{-mshort-data-512}, then the data references affected are those
-involving displacements of less than 512 bytes.
-@samp{-mshort-data-@var{num}} is not effective for @var{num} greater
-than 64k.
-
-@item -mserialize-volatile
-@kindex -mserialize-volatile
-@itemx -mno-serialize-volatile
-@kindex -mno-serialize-volatile
-@cindex sequential consistency on 88k
-Do, or don't, generate code to guarantee sequential consistency
-of volatile memory references. By default, consistency is
-guaranteed.
-
-The order of memory references made by the MC88110 processor does
-not always match the order of the instructions requesting those
-references. In particular, a load instruction may execute before
-a preceding store instruction. Such reordering violates
-sequential consistency of volatile memory references, when there
-are multiple processors. When consistency must be guaranteed,
-GNU C generates special instructions, as needed, to force
-execution in the proper order.
-
-The MC88100 processor does not reorder memory references and so
-always provides sequential consistency. However, by default, GNU
-C generates the special instructions to guarantee consistency
-even when you use @samp{-m88100}, so that the code may be run on an
-MC88110 processor. If you intend to run your code only on the
-MC88100 processor, you may use @samp{-mno-serialize-volatile}.
-
-The extra code generated to guarantee consistency may affect the
-performance of your application. If you know that you can safely
-forgo this guarantee, you may use @samp{-mno-serialize-volatile}.
-
-@item -msvr4
-@itemx -msvr3
-@kindex -msvr4
-@kindex -msvr3
-@cindex assembler syntax, 88k
-@cindex SVr4
-Turn on (@samp{-msvr4}) or off (@samp{-msvr3}) compiler extensions
-related to System V release 4 (SVr4). This controls the following:
-
-@enumerate
-@item
-Which variant of the assembler syntax to emit.
-@item
-@samp{-msvr4} makes the C preprocessor recognize @samp{#pragma weak}
-that is used on System V release 4.
-@item
-@samp{-msvr4} makes GCC issue additional declaration directives used in
-SVr4.
-@end enumerate
-
-@samp{-msvr4} is the default for the m88k-motorola-sysv4 and
-m88k-dg-dgux m88k configurations. @samp{-msvr3} is the default for all
-other m88k configurations.
-
-@item -mversion-03.00
-@kindex -mversion-03.00
-This option is obsolete, and is ignored.
-@c ??? which asm syntax better for GAS? option there too?
-
-@item -mno-check-zero-division
-@itemx -mcheck-zero-division
-@kindex -mno-check-zero-division
-@kindex -mcheck-zero-division
-@cindex zero division on 88k
-Do, or don't, generate code to guarantee that integer division by
-zero will be detected. By default, detection is guaranteed.
-
-Some models of the MC88100 processor fail to trap upon integer
-division by zero under certain conditions. By default, when
-compiling code that might be run on such a processor, GNU C
-generates code that explicitly checks for zero-valued divisors
-and traps with exception number 503 when one is detected. Use of
-mno-check-zero-division suppresses such checking for code
-generated to run on an MC88100 processor.
-
-GNU C assumes that the MC88110 processor correctly detects all
-instances of integer division by zero. When @samp{-m88110} is
-specified, both @samp{-mcheck-zero-division} and
-@samp{-mno-check-zero-division} are ignored, and no explicit checks for
-zero-valued divisors are generated.
-
-@item -muse-div-instruction
-@kindex -muse-div-instruction
-@cindex divide instruction, 88k
-Use the div instruction for signed integer division on the
-MC88100 processor. By default, the div instruction is not used.
-
-On the MC88100 processor the signed integer division instruction
-div) traps to the operating system on a negative operand. The
-operating system transparently completes the operation, but at a
-large cost in execution time. By default, when compiling code
-that might be run on an MC88100 processor, GNU C emulates signed
-integer division using the unsigned integer division instruction
-divu), thereby avoiding the large penalty of a trap to the
-operating system. Such emulation has its own, smaller, execution
-cost in both time and space. To the extent that your code's
-important signed integer division operations are performed on two
-nonnegative operands, it may be desirable to use the div
-instruction directly.
-
-On the MC88110 processor the div instruction (also known as the
-divs instruction) processes negative operands without trapping to
-the operating system. When @samp{-m88110} is specified,
-@samp{-muse-div-instruction} is ignored, and the div instruction is used
-for signed integer division.
-
-Note that the result of dividing INT_MIN by -1 is undefined. In
-particular, the behavior of such a division with and without
-@samp{-muse-div-instruction} may differ.
-
-@item -mtrap-large-shift
-@itemx -mhandle-large-shift
-@kindex -mtrap-large-shift
-@kindex -mhandle-large-shift
-@cindex bit shift overflow (88k)
-@cindex large bit shifts (88k)
-Include code to detect bit-shifts of more than 31 bits; respectively,
-trap such shifts or emit code to handle them properly. By default GCC
-makes no special provision for large bit shifts.
-
-@item -mwarn-passed-structs
-@kindex -mwarn-passed-structs
-@cindex structure passing (88k)
-Warn when a function passes a struct as an argument or result.
-Structure-passing conventions have changed during the evolution of the C
-language, and are often the source of portability problems. By default,
-GCC issues no such warning.
-@end table
-
-@node RS/6000 and PowerPC Options
-@subsection IBM RS/6000 and PowerPC Options
-@cindex RS/6000 and PowerPC Options
-@cindex IBM RS/6000 and PowerPC Options
-
-These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
-@table @code
-@item -mpower
-@itemx -mno-power
-@itemx -mpower2
-@itemx -mno-power2
-@itemx -mpowerpc
-@itemx -mno-powerpc
-@itemx -mpowerpc-gpopt
-@itemx -mno-powerpc-gpopt
-@itemx -mpowerpc-gfxopt
-@itemx -mno-powerpc-gfxopt
-@itemx -mpowerpc64
-@itemx -mno-powerpc64
-@kindex -mpower
-@kindex -mpower2
-@kindex -mpowerpc
-@kindex -mpowerpc-gpopt
-@kindex -mpowerpc-gfxopt
-@kindex -mpowerpc64
-GCC supports two related instruction set architectures for the
-RS/6000 and PowerPC. The @dfn{POWER} instruction set are those
-instructions supported by the @samp{rios} chip set used in the original
-RS/6000 systems and the @dfn{PowerPC} instruction set is the
-architecture of the Motorola MPC5xx, MPC6xx, MPC8xx microprocessors, and
-the IBM 4xx microprocessors.
-
-Neither architecture is a subset of the other. However there is a
-large common subset of instructions supported by both. An MQ
-register is included in processors supporting the POWER architecture.
-
-You use these options to specify which instructions are available on the
-processor you are using. The default value of these options is
-determined when configuring GCC. Specifying the
-@samp{-mcpu=@var{cpu_type}} overrides the specification of these
-options. We recommend you use the @samp{-mcpu=@var{cpu_type}} option
-rather than the options listed above.
-
-The @samp{-mpower} option allows GCC to generate instructions that
-are found only in the POWER architecture and to use the MQ register.
-Specifying @samp{-mpower2} implies @samp{-power} and also allows GCC
-to generate instructions that are present in the POWER2 architecture but
-not the original POWER architecture.
-
-The @samp{-mpowerpc} option allows GCC to generate instructions that
-are found only in the 32-bit subset of the PowerPC architecture.
-Specifying @samp{-mpowerpc-gpopt} implies @samp{-mpowerpc} and also allows
-GCC to use the optional PowerPC architecture instructions in the
-General Purpose group, including floating-point square root. Specifying
-@samp{-mpowerpc-gfxopt} implies @samp{-mpowerpc} and also allows GCC to
-use the optional PowerPC architecture instructions in the Graphics
-group, including floating-point select.
-
-The @samp{-mpowerpc64} option allows GCC to generate the additional
-64-bit instructions that are found in the full PowerPC64 architecture
-and to treat GPRs as 64-bit, doubleword quantities. GCC defaults to
-@samp{-mno-powerpc64}.
-
-If you specify both @samp{-mno-power} and @samp{-mno-powerpc}, GCC
-will use only the instructions in the common subset of both
-architectures plus some special AIX common-mode calls, and will not use
-the MQ register. Specifying both @samp{-mpower} and @samp{-mpowerpc}
-permits GCC to use any instruction from either architecture and to
-allow use of the MQ register; specify this for the Motorola MPC601.
-
-@item -mnew-mnemonics
-@itemx -mold-mnemonics
-@kindex -mnew-mnemonics
-@kindex -mold-mnemonics
-Select which mnemonics to use in the generated assembler code.
-@samp{-mnew-mnemonics} requests output that uses the assembler mnemonics
-defined for the PowerPC architecture, while @samp{-mold-mnemonics}
-requests the assembler mnemonics defined for the POWER architecture.
-Instructions defined in only one architecture have only one mnemonic;
-GCC uses that mnemonic irrespective of which of these options is
-specified.
-
-GCC defaults to the mnemonics appropriate for the architecture in
-use. Specifying @samp{-mcpu=@var{cpu_type}} sometimes overrides the
-value of these option. Unless you are building a cross-compiler, you
-should normally not specify either @samp{-mnew-mnemonics} or
-@samp{-mold-mnemonics}, but should instead accept the default.
-
-@item -mcpu=@var{cpu_type}
-@kindex -mcpu
-Set architecture type, register usage, choice of mnemonics, and
-instruction scheduling parameters for machine type @var{cpu_type}.
-Supported values for @var{cpu_type} are @samp{rs6000}, @samp{rios1},
-@samp{rios2}, @samp{rsc}, @samp{601}, @samp{602}, @samp{603},
-@samp{603e}, @samp{604}, @samp{604e}, @samp{620}, @samp{740},
-@samp{750}, @samp{power}, @samp{power2}, @samp{powerpc}, @samp{403},
-@samp{505}, @samp{801}, @samp{821}, @samp{823}, and @samp{860} and
-@samp{common}. @samp{-mcpu=power}, @samp{-mcpu=power2}, and
-@samp{-mcpu=powerpc} specify generic POWER, POWER2 and pure PowerPC
-(i.e., not MPC601) architecture machine types, with an appropriate,
-generic processor model assumed for scheduling purposes.@refill
-
-@c overfull hbox here --bob 22 jul96
-@c original text between ignore ... end ignore
-@ignore
-Specifying any of the @samp{-mcpu=rios1}, @samp{-mcpu=rios2},
-@samp{-mcpu=rsc}, @samp{-mcpu=power}, or @samp{-mcpu=power2} options
-enables the @samp{-mpower} option and disables the @samp{-mpowerpc}
-option; @samp{-mcpu=601} enables both the @samp{-mpower} and
-@samp{-mpowerpc} options; all of @samp{-mcpu=602}, @samp{-mcpu=603},
-@samp{-mcpu=603e}, @samp{-mcpu=604}, @samp{-mcpu=604e},
-@samp{-mcpu=620}, @samp{-mcpu=403}, @samp{-mcpu=505}, @samp{-mcpu=801},
-@samp{-mcpu=821}, @samp{-mcpu=823}, @samp{-mcpu=860} and
-@samp{-mcpu=powerpc} enable the @samp{-mpowerpc} option and disable the
-@samp{-mpower} option; @samp{-mcpu=common} disables both the
-@samp{-mpower} and @samp{-mpowerpc} options.@refill
-@end ignore
-@c changed paragraph
-Specifying any of the following options:
-@samp{-mcpu=rios1}, @samp{-mcpu=rios2}, @samp{-mcpu=rsc},
-@samp{-mcpu=power}, or @samp{-mcpu=power2}
-enables the @samp{-mpower} option and disables the @samp{-mpowerpc} option;
-@samp{-mcpu=601} enables both the @samp{-mpower} and @samp{-mpowerpc} options.
-All of @samp{-mcpu=602}, @samp{-mcpu=603}, @samp{-mcpu=603e},
-@samp{-mcpu=604}, @samp{-mcpu=620},
-enable the @samp{-mpowerpc} option and disable the @samp{-mpower} option.
-Exactly similarly, all of @samp{-mcpu=403},
-@samp{-mcpu=505}, @samp{-mcpu=821}, @samp{-mcpu=860} and @samp{-mcpu=powerpc}
-enable the @samp{-mpowerpc} option and disable the @samp{-mpower} option.
-@samp{-mcpu=common} disables both the
-@samp{-mpower} and @samp{-mpowerpc} options.@refill
-@c end changes to prevent overfull hboxes
-
-AIX versions 4 or greater selects @samp{-mcpu=common} by default, so
-that code will operate on all members of the RS/6000 and PowerPC
-families. In that case, GCC will use only the instructions in the
-common subset of both architectures plus some special AIX common-mode
-calls, and will not use the MQ register. GCC assumes a generic
-processor model for scheduling purposes.
-
-Specifying any of the options @samp{-mcpu=rios1}, @samp{-mcpu=rios2},
-@samp{-mcpu=rsc}, @samp{-mcpu=power}, or @samp{-mcpu=power2} also
-disables the @samp{new-mnemonics} option. Specifying @samp{-mcpu=601},
-@samp{-mcpu=602}, @samp{-mcpu=603}, @samp{-mcpu=603e}, @samp{-mcpu=604},
-@samp{620}, @samp{403}, or @samp{-mcpu=powerpc} also enables the
-@samp{new-mnemonics} option.@refill
-
-Specifying @samp{-mcpu=403}, @samp{-mcpu=821}, or @samp{-mcpu=860} also
-enables the @samp{-msoft-float} option.
-
-@item -mtune=@var{cpu_type}
-Set the instruction scheduling parameters for machine type
-@var{cpu_type}, but do not set the architecture type, register usage,
-choice of mnemonics like @samp{-mcpu=}@var{cpu_type} would. The same
-values for @var{cpu_type} are used for @samp{-mtune=}@var{cpu_type} as
-for @samp{-mcpu=}@var{cpu_type}. The @samp{-mtune=}@var{cpu_type}
-option overrides the @samp{-mcpu=}@var{cpu_type} option in terms of
-instruction scheduling parameters.
-
-@item -mfull-toc
-@itemx -mno-fp-in-toc
-@itemx -mno-sum-in-toc
-@itemx -mminimal-toc
-@kindex -mminimal-toc
-Modify generation of the TOC (Table Of Contents), which is created for
-every executable file. The @samp{-mfull-toc} option is selected by
-default. In that case, GCC will allocate at least one TOC entry for
-each unique non-automatic variable reference in your program. GCC
-will also place floating-point constants in the TOC. However, only
-16,384 entries are available in the TOC.
-
-If you receive a linker error message that saying you have overflowed
-the available TOC space, you can reduce the amount of TOC space used
-with the @samp{-mno-fp-in-toc} and @samp{-mno-sum-in-toc} options.
-@samp{-mno-fp-in-toc} prevents GCC from putting floating-point
-constants in the TOC and @samp{-mno-sum-in-toc} forces GCC to
-generate code to calculate the sum of an address and a constant at
-run-time instead of putting that sum into the TOC. You may specify one
-or both of these options. Each causes GCC to produce very slightly
-slower and larger code at the expense of conserving TOC space.
-
-If you still run out of space in the TOC even when you specify both of
-these options, specify @samp{-mminimal-toc} instead. This option causes
-GCC to make only one TOC entry for every file. When you specify this
-option, GCC will produce code that is slower and larger but which
-uses extremely little TOC space. You may wish to use this option
-only on files that contain less frequently executed code. @refill
-
-@item -maix64
-@itemx -maix32
-@kindex -maix64
-@kindex -maix32
-Enable AIX 64-bit ABI and calling convention: 64-bit pointers, 64-bit
-@code{long} type, and the infrastructure needed to support them.
-Specifying @samp{-maix64} implies @samp{-mpowerpc64} and
-@samp{-mpowerpc}, while @samp{-maix32} disables the 64-bit ABI and
-implies @samp{-mno-powerpc64}. GCC defaults to @samp{-maix32}.
-
-@item -mxl-call
-@itemx -mno-xl-call
-@kindex -mxl-call
-On AIX, pass floating-point arguments to prototyped functions beyond the
-register save area (RSA) on the stack in addition to argument FPRs. The
-AIX calling convention was extended but not initially documented to
-handle an obscure K&R C case of calling a function that takes the
-address of its arguments with fewer arguments than declared. AIX XL
-compilers access floating point arguments which do not fit in the
-RSA from the stack when a subroutine is compiled without
-optimization. Because always storing floating-point arguments on the
-stack is inefficient and rarely needed, this option is not enabled by
-default and only is necessary when calling subroutines compiled by AIX
-XL compilers without optimization.
-
-@item -mthreads
-@kindex -mthreads
-Support @dfn{AIX Threads}. Link an application written to use
-@dfn{pthreads} with special libraries and startup code to enable the
-application to run.
-
-@item -mpe
-@kindex -mpe
-Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE). Link an
-application written to use message passing with special startup code to
-enable the application to run. The system must have PE installed in the
-standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
-must be overridden with the @samp{-specs=} option to specify the
-appropriate directory location. The Parallel Environment does not
-support threads, so the @samp{-mpe} option and the @samp{-mthreads}
-option are incompatible.
-
-@item -msoft-float
-@itemx -mhard-float
-@kindex -msoft-float
-Generate code that does not use (uses) the floating-point register set.
-Software floating point emulation is provided if you use the
-@samp{-msoft-float} option, and pass the option to GCC when linking.
-
-@item -mmultiple
-@itemx -mno-multiple
-Generate code that uses (does not use) the load multiple word
-instructions and the store multiple word instructions. These
-instructions are generated by default on POWER systems, and not
-generated on PowerPC systems. Do not use @samp{-mmultiple} on little
-endian PowerPC systems, since those instructions do not work when the
-processor is in little endian mode. The exceptions are PPC740 and
-PPC750 which permit the instructions usage in little endian mode.
-
-@item -mstring
-@itemx -mno-string
-@kindex -mstring
-Generate code that uses (does not use) the load string instructions
-and the store string word instructions to save multiple registers and
-do small block moves. These instructions are generated by default on
-POWER systems, and not generated on PowerPC systems. Do not use
-@samp{-mstring} on little endian PowerPC systems, since those
-instructions do not work when the processor is in little endian mode.
-The exceptions are PPC740 and PPC750 which permit the instructions
-usage in little endian mode.
-
-@item -mupdate
-@itemx -mno-update
-@kindex -mupdate
-Generate code that uses (does not use) the load or store instructions
-that update the base register to the address of the calculated memory
-location. These instructions are generated by default. If you use
-@samp{-mno-update}, there is a small window between the time that the
-stack pointer is updated and the address of the previous frame is
-stored, which means code that walks the stack frame across interrupts or
-signals may get corrupted data.
-
-@item -mfused-madd
-@itemx -mno-fused-madd
-@kindex -mfused-madd
-Generate code that uses (does not use) the floating point multiply and
-accumulate instructions. These instructions are generated by default if
-hardware floating is used.
-
-@item -mno-bit-align
-@itemx -mbit-align
-@kindex -mbit-align
-On System V.4 and embedded PowerPC systems do not (do) force structures
-and unions that contain bit fields to be aligned to the base type of the
-bit field.
-
-For example, by default a structure containing nothing but 8
-@code{unsigned} bitfields of length 1 would be aligned to a 4 byte
-boundary and have a size of 4 bytes. By using @samp{-mno-bit-align},
-the structure would be aligned to a 1 byte boundary and be one byte in
-size.
-
-@item -mno-strict-align
-@itemx -mstrict-align
-@kindex -mstrict-align
-On System V.4 and embedded PowerPC systems do not (do) assume that
-unaligned memory references will be handled by the system.
-
-@item -mrelocatable
-@itemx -mno-relocatable
-@kindex -mrelocatable
-On embedded PowerPC systems generate code that allows (does not allow)
-the program to be relocated to a different address at runtime. If you
-use @samp{-mrelocatable} on any module, all objects linked together must
-be compiled with @samp{-mrelocatable} or @samp{-mrelocatable-lib}.
-
-@item -mrelocatable-lib
-@itemx -mno-relocatable-lib
-On embedded PowerPC systems generate code that allows (does not allow)
-the program to be relocated to a different address at runtime. Modules
-compiled with @samp{-mrelocatable-lib} can be linked with either modules
-compiled without @samp{-mrelocatable} and @samp{-mrelocatable-lib} or
-with modules compiled with the @samp{-mrelocatable} options.
-
-@item -mno-toc
-@itemx -mtoc
-On System V.4 and embedded PowerPC systems do not (do) assume that
-register 2 contains a pointer to a global area pointing to the addresses
-used in the program.
-
-@item -mlittle
-@itemx -mlittle-endian
-On System V.4 and embedded PowerPC systems compile code for the
-processor in little endian mode. The @samp{-mlittle-endian} option is
-the same as @samp{-mlittle}.
-
-@item -mbig
-@itemx -mbig-endian
-On System V.4 and embedded PowerPC systems compile code for the
-processor in big endian mode. The @samp{-mbig-endian} option is
-the same as @samp{-mbig}.
-
-@item -mcall-sysv
-On System V.4 and embedded PowerPC systems compile code using calling
-conventions that adheres to the March 1995 draft of the System V
-Application Binary Interface, PowerPC processor supplement. This is the
-default unless you configured GCC using @samp{powerpc-*-eabiaix}.
-
-@item -mcall-sysv-eabi
-Specify both @samp{-mcall-sysv} and @samp{-meabi} options.
-
-@item -mcall-sysv-noeabi
-Specify both @samp{-mcall-sysv} and @samp{-mno-eabi} options.
-
-@item -mcall-aix
-On System V.4 and embedded PowerPC systems compile code using calling
-conventions that are similar to those used on AIX. This is the
-default if you configured GCC using @samp{powerpc-*-eabiaix}.
-
-@item -mcall-solaris
-On System V.4 and embedded PowerPC systems compile code for the Solaris
-operating system.
-
-@item -mcall-linux
-On System V.4 and embedded PowerPC systems compile code for the
-Linux-based GNU system.
-
-@item -mprototype
-@itemx -mno-prototype
-On System V.4 and embedded PowerPC systems assume that all calls to
-variable argument functions are properly prototyped. Otherwise, the
-compiler must insert an instruction before every non prototyped call to
-set or clear bit 6 of the condition code register (@var{CR}) to
-indicate whether floating point values were passed in the floating point
-registers in case the function takes a variable arguments. With
-@samp{-mprototype}, only calls to prototyped variable argument functions
-will set or clear the bit.
-
-@item -msim
-On embedded PowerPC systems, assume that the startup module is called
-@file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
-@file{libc.a}. This is the default for @samp{powerpc-*-eabisim}.
-configurations.
-
-@item -mmvme
-On embedded PowerPC systems, assume that the startup module is called
-@file{crt0.o} and the standard C libraries are @file{libmvme.a} and
-@file{libc.a}.
-
-@item -mads
-On embedded PowerPC systems, assume that the startup module is called
-@file{crt0.o} and the standard C libraries are @file{libads.a} and
-@file{libc.a}.
-
-@item -myellowknife
-On embedded PowerPC systems, assume that the startup module is called
-@file{crt0.o} and the standard C libraries are @file{libyk.a} and
-@file{libc.a}.
-
-@item -memb
-On embedded PowerPC systems, set the @var{PPC_EMB} bit in the ELF flags
-header to indicate that @samp{eabi} extended relocations are used.
-
-@item -meabi
-@itemx -mno-eabi
-On System V.4 and embedded PowerPC systems do (do not) adhere to the
-Embedded Applications Binary Interface (eabi) which is a set of
-modifications to the System V.4 specifications. Selecting @code{-meabi}
-means that the stack is aligned to an 8 byte boundary, a function
-@code{__eabi} is called to from @code{main} to set up the eabi
-environment, and the @samp{-msdata} option can use both @code{r2} and
-@code{r13} to point to two separate small data areas. Selecting
-@code{-mno-eabi} means that the stack is aligned to a 16 byte boundary,
-do not call an initialization function from @code{main}, and the
-@samp{-msdata} option will only use @code{r13} to point to a single
-small data area. The @samp{-meabi} option is on by default if you
-configured GCC using one of the @samp{powerpc*-*-eabi*} options.
-
-@item -msdata=eabi
-On System V.4 and embedded PowerPC systems, put small initialized
-@code{const} global and static data in the @samp{.sdata2} section, which
-is pointed to by register @code{r2}. Put small initialized
-non-@code{const} global and static data in the @samp{.sdata} section,
-which is pointed to by register @code{r13}. Put small uninitialized
-global and static data in the @samp{.sbss} section, which is adjacent to
-the @samp{.sdata} section. The @samp{-msdata=eabi} option is
-incompatible with the @samp{-mrelocatable} option. The
-@samp{-msdata=eabi} option also sets the @samp{-memb} option.
-
-@item -msdata=sysv
-On System V.4 and embedded PowerPC systems, put small global and static
-data in the @samp{.sdata} section, which is pointed to by register
-@code{r13}. Put small uninitialized global and static data in the
-@samp{.sbss} section, which is adjacent to the @samp{.sdata} section.
-The @samp{-msdata=sysv} option is incompatible with the
-@samp{-mrelocatable} option.
-
-@item -msdata=default
-@itemx -msdata
-On System V.4 and embedded PowerPC systems, if @samp{-meabi} is used,
-compile code the same as @samp{-msdata=eabi}, otherwise compile code the
-same as @samp{-msdata=sysv}.
-
-@item -msdata-data
-On System V.4 and embedded PowerPC systems, put small global and static
-data in the @samp{.sdata} section. Put small uninitialized global and
-static data in the @samp{.sbss} section. Do not use register @code{r13}
-to address small data however. This is the default behavior unless
-other @samp{-msdata} options are used.
-
-@item -msdata=none
-@itemx -mno-sdata
-On embedded PowerPC systems, put all initialized global and static data
-in the @samp{.data} section, and all uninitialized data in the
-@samp{.bss} section.
-
-@item -G @var{num}
-@cindex smaller data references (PowerPC)
-@cindex .sdata/.sdata2 references (PowerPC)
-On embedded PowerPC systems, put global and static items less than or
-equal to @var{num} bytes into the small data or bss sections instead of
-the normal data or bss section. By default, @var{num} is 8. The
-@samp{-G @var{num}} switch is also passed to the linker.
-All modules should be compiled with the same @samp{-G @var{num}} value.
-
-@item -mregnames
-@itemx -mno-regnames
-On System V.4 and embedded PowerPC systems do (do not) emit register
-names in the assembly language output using symbolic forms.
-
-@end table
-
-@node RT Options
-@subsection IBM RT Options
-@cindex RT options
-@cindex IBM RT options
-
-These @samp{-m} options are defined for the IBM RT PC:
-
-@table @code
-@item -min-line-mul
-Use an in-line code sequence for integer multiplies. This is the
-default.
-
-@item -mcall-lib-mul
-Call @code{lmul$$} for integer multiples.
-
-@item -mfull-fp-blocks
-Generate full-size floating point data blocks, including the minimum
-amount of scratch space recommended by IBM. This is the default.
-
-@item -mminimum-fp-blocks
-Do not include extra scratch space in floating point data blocks. This
-results in smaller code, but slower execution, since scratch space must
-be allocated dynamically.
-
-@cindex @file{varargs.h} and RT PC
-@cindex @file{stdarg.h} and RT PC
-@item -mfp-arg-in-fpregs
-Use a calling sequence incompatible with the IBM calling convention in
-which floating point arguments are passed in floating point registers.
-Note that @code{varargs.h} and @code{stdargs.h} will not work with
-floating point operands if this option is specified.
-
-@item -mfp-arg-in-gregs
-Use the normal calling convention for floating point arguments. This is
-the default.
-
-@item -mhc-struct-return
-Return structures of more than one word in memory, rather than in a
-register. This provides compatibility with the MetaWare HighC (hc)
-compiler. Use the option @samp{-fpcc-struct-return} for compatibility
-with the Portable C Compiler (pcc).
-
-@item -mnohc-struct-return
-Return some structures of more than one word in registers, when
-convenient. This is the default. For compatibility with the
-IBM-supplied compilers, use the option @samp{-fpcc-struct-return} or the
-option @samp{-mhc-struct-return}.
-@end table
-
-@node MIPS Options
-@subsection MIPS Options
-@cindex MIPS options
-
-These @samp{-m} options are defined for the MIPS family of computers:
-
-@table @code
-@item -mcpu=@var{cpu type}
-Assume the defaults for the machine type @var{cpu type} when scheduling
-instructions. The choices for @var{cpu type} are @samp{r2000}, @samp{r3000},
-@samp{r3900}, @samp{r4000}, @samp{r4100}, @samp{r4300}, @samp{r4400},
-@samp{r4600}, @samp{r4650}, @samp{r5000}, @samp{r6000}, @samp{r8000},
-and @samp{orion}. Additionally, the @samp{r2000}, @samp{r3000},
-@samp{r4000}, @samp{r5000}, and @samp{r6000} can be abbreviated as
-@samp{r2k} (or @samp{r2K}), @samp{r3k}, etc. While picking a specific
-@var{cpu type} will schedule things appropriately for that particular
-chip, the compiler will not generate any code that does not meet level 1
-of the MIPS ISA (instruction set architecture) without a @samp{-mipsX}
-or @samp{-mabi} switch being used.
-
-@item -mips1
-Issue instructions from level 1 of the MIPS ISA. This is the default.
-@samp{r3000} is the default @var{cpu type} at this ISA level.
-
-@item -mips2
-Issue instructions from level 2 of the MIPS ISA (branch likely, square
-root instructions). @samp{r6000} is the default @var{cpu type} at this
-ISA level.
-
-@item -mips3
-Issue instructions from level 3 of the MIPS ISA (64 bit instructions).
-@samp{r4000} is the default @var{cpu type} at this ISA level.
-
-@item -mips4
-Issue instructions from level 4 of the MIPS ISA (conditional move,
-prefetch, enhanced FPU instructions). @samp{r8000} is the default
-@var{cpu type} at this ISA level.
-
-@item -mfp32
-Assume that 32 32-bit floating point registers are available. This is
-the default.
-
-@item -mfp64
-Assume that 32 64-bit floating point registers are available. This is
-the default when the @samp{-mips3} option is used.
-
-@item -mgp32
-Assume that 32 32-bit general purpose registers are available. This is
-the default.
-
-@item -mgp64
-Assume that 32 64-bit general purpose registers are available. This is
-the default when the @samp{-mips3} option is used.
-
-@item -mint64
-Force int and long types to be 64 bits wide. See @samp{-mlong32} for an
-explanation of the default, and the width of pointers.
-
-@item -mlong64
-Force long types to be 64 bits wide. See @samp{-mlong32} for an
-explanation of the default, and the width of pointers.
-
-@item -mlong32
-Force long, int, and pointer types to be 32 bits wide.
-
-If none of @samp{-mlong32}, @samp{-mlong64}, or @samp{-mint64} are set,
-the size of ints, longs, and pointers depends on the ABI and ISA choosen.
-For @samp{-mabi=32}, and @samp{-mabi=n32}, ints and longs are 32 bits
-wide. For @samp{-mabi=64}, ints are 32 bits, and longs are 64 bits wide.
-For @samp{-mabi=eabi} and either @samp{-mips1} or @samp{-mips2}, ints
-and longs are 32 bits wide. For @samp{-mabi=eabi} and higher ISAs, ints
-are 32 bits, and longs are 64 bits wide. The width of pointer types is
-the smaller of the width of longs or the width of general purpose
-registers (which in turn depends on the ISA).
-
-@item -mabi=32
-@itemx -mabi=o64
-@itemx -mabi=n32
-@itemx -mabi=64
-@itemx -mabi=eabi
-Generate code for the indicated ABI. The default instruction level is
-@samp{-mips1} for @samp{32}, @samp{-mips3} for @samp{n32}, and
-@samp{-mips4} otherwise. Conversely, with @samp{-mips1} or
-@samp{-mips2}, the default ABI is @samp{32}; otherwise, the default ABI
-is @samp{64}.
-
-@item -mmips-as
-Generate code for the MIPS assembler, and invoke @file{mips-tfile} to
-add normal debug information. This is the default for all
-platforms except for the OSF/1 reference platform, using the OSF/rose
-object format. If the either of the @samp{-gstabs} or @samp{-gstabs+}
-switches are used, the @file{mips-tfile} program will encapsulate the
-stabs within MIPS ECOFF.
-
-@item -mgas
-Generate code for the GNU assembler. This is the default on the OSF/1
-reference platform, using the OSF/rose object format. Also, this is
-the default if the configure option @samp{--with-gnu-as} is used.
-
-@item -msplit-addresses
-@itemx -mno-split-addresses
-Generate code to load the high and low parts of address constants separately.
-This allows @code{gcc} to optimize away redundant loads of the high order
-bits of addresses. This optimization requires GNU as and GNU ld.
-This optimization is enabled by default for some embedded targets where
-GNU as and GNU ld are standard.
-
-@item -mrnames
-@itemx -mno-rnames
-The @samp{-mrnames} switch says to output code using the MIPS software
-names for the registers, instead of the hardware names (ie, @var{a0}
-instead of @var{$4}). The only known assembler that supports this option
-is the Algorithmics assembler.
-
-@item -mgpopt
-@itemx -mno-gpopt
-The @samp{-mgpopt} switch says to write all of the data declarations
-before the instructions in the text section, this allows the MIPS
-assembler to generate one word memory references instead of using two
-words for short global or static data items. This is on by default if
-optimization is selected.
-
-@item -mstats
-@itemx -mno-stats
-For each non-inline function processed, the @samp{-mstats} switch
-causes the compiler to emit one line to the standard error file to
-print statistics about the program (number of registers saved, stack
-size, etc.).
-
-@item -mmemcpy
-@itemx -mno-memcpy
-The @samp{-mmemcpy} switch makes all block moves call the appropriate
-string function (@samp{memcpy} or @samp{bcopy}) instead of possibly
-generating inline code.
-
-@item -mmips-tfile
-@itemx -mno-mips-tfile
-The @samp{-mno-mips-tfile} switch causes the compiler not
-postprocess the object file with the @file{mips-tfile} program,
-after the MIPS assembler has generated it to add debug support. If
-@file{mips-tfile} is not run, then no local variables will be
-available to the debugger. In addition, @file{stage2} and
-@file{stage3} objects will have the temporary file names passed to the
-assembler embedded in the object file, which means the objects will
-not compare the same. The @samp{-mno-mips-tfile} switch should only
-be used when there are bugs in the @file{mips-tfile} program that
-prevents compilation.
-
-@item -msoft-float
-Generate output containing library calls for floating point.
-@strong{Warning:} the requisite libraries are not part of GCC.
-Normally the facilities of the machine's usual C compiler are used, but
-this can't be done directly in cross-compilation. You must make your
-own arrangements to provide suitable library functions for
-cross-compilation.
-
-@item -mhard-float
-Generate output containing floating point instructions. This is the
-default if you use the unmodified sources.
-
-@item -mabicalls
-@itemx -mno-abicalls
-Emit (or do not emit) the pseudo operations @samp{.abicalls},
-@samp{.cpload}, and @samp{.cprestore} that some System V.4 ports use for
-position independent code.
-
-@item -mlong-calls
-@itemx -mno-long-calls
-Do all calls with the @samp{JALR} instruction, which requires
-loading up a function's address into a register before the call.
-You need to use this switch, if you call outside of the current
-512 megabyte segment to functions that are not through pointers.
-
-@item -mhalf-pic
-@itemx -mno-half-pic
-Put pointers to extern references into the data section and load them
-up, rather than put the references in the text section.
-
-@item -membedded-pic
-@itemx -mno-embedded-pic
-Generate PIC code suitable for some embedded systems. All calls are
-made using PC relative address, and all data is addressed using the $gp
-register. No more than 65536 bytes of global data may be used. This
-requires GNU as and GNU ld which do most of the work. This currently
-only works on targets which use ECOFF; it does not work with ELF.
-
-@item -membedded-data
-@itemx -mno-embedded-data
-Allocate variables to the read-only data section first if possible, then
-next in the small data section if possible, otherwise in data. This gives
-slightly slower code than the default, but reduces the amount of RAM required
-when executing, and thus may be preferred for some embedded systems.
-
-@item -msingle-float
-@itemx -mdouble-float
-The @samp{-msingle-float} switch tells gcc to assume that the floating
-point coprocessor only supports single precision operations, as on the
-@samp{r4650} chip. The @samp{-mdouble-float} switch permits gcc to use
-double precision operations. This is the default.
-
-@item -mmad
-@itemx -mno-mad
-Permit use of the @samp{mad}, @samp{madu} and @samp{mul} instructions,
-as on the @samp{r4650} chip.
-
-@item -m4650
-Turns on @samp{-msingle-float}, @samp{-mmad}, and, at least for now,
-@samp{-mcpu=r4650}.
-
-@item -mips16
-@itemx -mno-mips16
-Enable 16-bit instructions.
-
-@item -mentry
-Use the entry and exit pseudo ops. This option can only be used with
-@samp{-mips16}.
-
-@item -EL
-Compile code for the processor in little endian mode.
-The requisite libraries are assumed to exist.
-
-@item -EB
-Compile code for the processor in big endian mode.
-The requisite libraries are assumed to exist.
-
-@item -G @var{num}
-@cindex smaller data references (MIPS)
-@cindex gp-relative references (MIPS)
-Put global and static items less than or equal to @var{num} bytes into
-the small data or bss sections instead of the normal data or bss
-section. This allows the assembler to emit one word memory reference
-instructions based on the global pointer (@var{gp} or @var{$28}),
-instead of the normal two words used. By default, @var{num} is 8 when
-the MIPS assembler is used, and 0 when the GNU assembler is used. The
-@samp{-G @var{num}} switch is also passed to the assembler and linker.
-All modules should be compiled with the same @samp{-G @var{num}}
-value.
-
-@item -nocpp
-Tell the MIPS assembler to not run its preprocessor over user
-assembler files (with a @samp{.s} suffix) when assembling them.
-@end table
-
-@ifset INTERNALS
-These options are defined by the macro
-@code{TARGET_SWITCHES} in the machine description. The default for the
-options is also defined by that macro, which enables you to change the
-defaults.
-@end ifset
-
-@node i386 Options
-@subsection Intel 386 Options
-@cindex i386 Options
-@cindex Intel 386 Options
-
-These @samp{-m} options are defined for the i386 family of computers:
-
-@table @code
-@item -mcpu=@var{cpu type}
-Assume the defaults for the machine type @var{cpu type} when scheduling
-instructions. The choices for @var{cpu type} are:
-
-@multitable @columnfractions .20 .20 .20 .20
-@item @samp{i386} @tab @samp{i486} @tab @samp{i586} @tab @samp{i686}
-@item @samp{pentium} @tab @samp{pentiumpro} @tab @samp{k6}
-@end multitable
-
-While picking a specific @var{cpu type} will schedule things appropriately
-for that particular chip, the compiler will not generate any code that
-does not run on the i386 without the @samp{-march=@var{cpu type}} option
-being used. @samp{i586} is equivalent to @samp{pentium} and @samp{i686}
-is equivalent to @samp{pentiumpro}. @samp{k6} is the AMD chip as
-opposed to the Intel ones.
-
-@item -march=@var{cpu type}
-Generate instructions for the machine type @var{cpu type}. The choices
-for @var{cpu type} are the same as for @samp{-mcpu}. Moreover,
-specifying @samp{-march=@var{cpu type}} implies @samp{-mcpu=@var{cpu type}}.
-
-@item -m386
-@itemx -m486
-@itemx -mpentium
-@itemx -mpentiumpro
-Synonyms for -mcpu=i386, -mcpu=i486, -mcpu=pentium, and -mcpu=pentiumpro
-respectively. These synonyms are deprecated.
-
-@item -mieee-fp
-@itemx -mno-ieee-fp
-Control whether or not the compiler uses IEEE floating point
-comparisons. These handle correctly the case where the result of a
-comparison is unordered.
-
-@item -msoft-float
-Generate output containing library calls for floating point.
-@strong{Warning:} the requisite libraries are not part of GCC.
-Normally the facilities of the machine's usual C compiler are used, but
-this can't be done directly in cross-compilation. You must make your
-own arrangements to provide suitable library functions for
-cross-compilation.
-
-On machines where a function returns floating point results in the 80387
-register stack, some floating point opcodes may be emitted even if
-@samp{-msoft-float} is used.
-
-@item -mno-fp-ret-in-387
-Do not use the FPU registers for return values of functions.
-
-The usual calling convention has functions return values of types
-@code{float} and @code{double} in an FPU register, even if there
-is no FPU. The idea is that the operating system should emulate
-an FPU.
-
-The option @samp{-mno-fp-ret-in-387} causes such values to be returned
-in ordinary CPU registers instead.
-
-@item -mno-fancy-math-387
-Some 387 emulators do not support the @code{sin}, @code{cos} and
-@code{sqrt} instructions for the 387. Specify this option to avoid
-generating those instructions. This option is the default on FreeBSD.
-As of revision 2.6.1, these instructions are not generated unless you
-also use the @samp{-ffast-math} switch.
-
-@item -malign-double
-@itemx -mno-align-double
-Control whether GCC aligns @code{double}, @code{long double}, and
-@code{long long} variables on a two word boundary or a one word
-boundary. Aligning @code{double} variables on a two word boundary will
-produce code that runs somewhat faster on a @samp{Pentium} at the
-expense of more memory.
-
-@strong{Warning:} if you use the @samp{-malign-double} switch,
-structures containing the above types will be aligned differently than
-the published application binary interface specifications for the 386.
-
-@item -msvr3-shlib
-@itemx -mno-svr3-shlib
-Control whether GCC places uninitialized locals into @code{bss} or
-@code{data}. @samp{-msvr3-shlib} places these locals into @code{bss}.
-These options are meaningful only on System V Release 3.
-
-@item -mno-wide-multiply
-@itemx -mwide-multiply
-Control whether GCC uses the @code{mul} and @code{imul} that produce
-64 bit results in @code{eax:edx} from 32 bit operands to do @code{long
-long} multiplies and 32-bit division by constants.
-
-@item -mrtd
-Use a different function-calling convention, in which functions that
-take a fixed number of arguments return with the @code{ret} @var{num}
-instruction, which pops their arguments while returning. This saves one
-instruction in the caller since there is no need to pop the arguments
-there.
-
-You can specify that an individual function is called with this calling
-sequence with the function attribute @samp{stdcall}. You can also
-override the @samp{-mrtd} option by using the function attribute
-@samp{cdecl}. @xref{Function Attributes}.
-
-@strong{Warning:} this calling convention is incompatible with the one
-normally used on Unix, so you cannot use it if you need to call
-libraries compiled with the Unix compiler.
-
-Also, you must provide function prototypes for all functions that
-take variable numbers of arguments (including @code{printf});
-otherwise incorrect code will be generated for calls to those
-functions.
-
-In addition, seriously incorrect code will result if you call a
-function with too many arguments. (Normally, extra arguments are
-harmlessly ignored.)
-
-@item -mreg-alloc=@var{regs}
-Control the default allocation order of integer registers. The
-string @var{regs} is a series of letters specifying a register. The
-supported letters are: @code{a} allocate EAX; @code{b} allocate EBX;
-@code{c} allocate ECX; @code{d} allocate EDX; @code{S} allocate ESI;
-@code{D} allocate EDI; @code{B} allocate EBP.
-
-@item -mregparm=@var{num}
-Control how many registers are used to pass integer arguments. By
-default, no registers are used to pass arguments, and at most 3
-registers can be used. You can control this behavior for a specific
-function by using the function attribute @samp{regparm}.
-@xref{Function Attributes}.
-
-@strong{Warning:} if you use this switch, and
-@var{num} is nonzero, then you must build all modules with the same
-value, including any libraries. This includes the system libraries and
-startup modules.
-
-@item -malign-loops=@var{num}
-Align loops to a 2 raised to a @var{num} byte boundary. If
-@samp{-malign-loops} is not specified, the default is 2 unless
-gas 2.8 (or later) is being used in which case the default is
-to align the loop on a 16 byte boundary if it is less than 8
-bytes away.
-
-@item -malign-jumps=@var{num}
-Align instructions that are only jumped to to a 2 raised to a @var{num}
-byte boundary. If @samp{-malign-jumps} is not specified, the default is
-2 if optimizing for a 386, and 4 if optimizing for a 486 unless
-gas 2.8 (or later) is being used in which case the default is
-to align the instruction on a 16 byte boundary if it is less
-than 8 bytes away.
-
-@item -malign-functions=@var{num}
-Align the start of functions to a 2 raised to @var{num} byte boundary.
-If @samp{-malign-functions} is not specified, the default is 2 if optimizing
-for a 386, and 4 if optimizing for a 486.
-
-@item -mpreferred-stack-boundary=@var{num}
-Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
-byte boundary. If @samp{-mpreferred-stack-boundary} is not specified,
-the default is 4 (16 bytes or 128 bits).
-
-The stack is required to be aligned on a 4 byte boundary. On Pentium
-and PentiumPro, @code{double} and @code{long double} values should be
-aligned to an 8 byte boundary (see @samp{-malign-double}) or suffer
-significant run time performance penalties. On Pentium III, the
-Streaming SIMD Extention (SSE) data type @code{__m128} suffers similar
-penalties if it is not 16 byte aligned.
-
-To ensure proper alignment of this values on the stack, the stack boundary
-must be as aligned as that required by any value stored on the stack.
-Further, every function must be generated such that it keeps the stack
-aligned. Thus calling a function compiled with a higher preferred
-stack boundary from a function compiled with a lower preferred stack
-boundary will most likely misalign the stack. It is recommended that
-libraries that use callbacks always use the default setting.
-
-This extra alignment does consume extra stack space. Code that is sensitive
-to stack space usage, such as embedded systems and operating system kernels,
-may want to reduce the preferred alignment to
-@samp{-mpreferred-stack-boundary=2}.
-@end table
-
-@node HPPA Options
-@subsection HPPA Options
-@cindex HPPA Options
-
-These @samp{-m} options are defined for the HPPA family of computers:
-
-@table @code
-@item -march=@var{architecture type}
-Generate code for the specified architecture. The choices for
-@var{architecture type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
-1.1, and @samp{2.0} for PA 2.0 processors. Refer to
-@file{/usr/lib/sched.models} on an HP-UX system to determine the proper
-architecture option for your machine. Code compiled for lower numbered
-architectures will run on higher numbered architectures, but not the
-other way around.
-
-PA 2.0 support currently requires gas snapshot 19990413 or later. The
-next release of binutils (current is 2.9.1) will probably contain PA 2.0
-support.
-
-@item -mpa-risc-1-0
-@itemx -mpa-risc-1-1
-@itemx -mpa-risc-2-0
-Synonyms for -march=1.0, -march=1.1, and -march=2.0 respectively.
-
-@item -mbig-switch
-Generate code suitable for big switch tables. Use this option only if
-the assembler/linker complain about out of range branches within a switch
-table.
-
-@item -mjump-in-delay
-Fill delay slots of function calls with unconditional jump instructions
-by modifying the return pointer for the function call to be the target
-of the conditional jump.
-
-@item -mdisable-fpregs
-Prevent floating point registers from being used in any manner. This is
-necessary for compiling kernels which perform lazy context switching of
-floating point registers. If you use this option and attempt to perform
-floating point operations, the compiler will abort.
-
-@item -mdisable-indexing
-Prevent the compiler from using indexing address modes. This avoids some
-rather obscure problems when compiling MIG generated code under MACH.
-
-@item -mno-space-regs
-Generate code that assumes the target has no space registers. This allows
-GCC to generate faster indirect calls and use unscaled index address modes.
-
-Such code is suitable for level 0 PA systems and kernels.
-
-@item -mfast-indirect-calls
-Generate code that assumes calls never cross space boundaries. This
-allows GCC to emit code which performs faster indirect calls.
-
-This option will not work in the presense of shared libraries or nested
-functions.
-
-@item -mspace
-Optimize for space rather than execution time. Currently this only
-enables out of line function prologues and epilogues. This option is
-incompatible with PIC code generation and profiling.
-
-@item -mlong-load-store
-Generate 3-instruction load and store sequences as sometimes required by
-the HP-UX 10 linker. This is equivalent to the @samp{+k} option to
-the HP compilers.
-
-@item -mportable-runtime
-Use the portable calling conventions proposed by HP for ELF systems.
-
-@item -mgas
-Enable the use of assembler directives only GAS understands.
-
-@item -mschedule=@var{cpu type}
-Schedule code according to the constraints for the machine type
-@var{cpu type}. The choices for @var{cpu type} are @samp{700}
-@samp{7100}, @samp{7100LC}, @samp{7200}, and @samp{8000}. Refer to
-@file{/usr/lib/sched.models} on an HP-UX system to determine the
-proper scheduling option for your machine.
-
-@item -mlinker-opt
-Enable the optimization pass in the HPUX linker. Note this makes symbolic
-debugging impossible. It also triggers a bug in the HPUX 8 and HPUX 9 linkers
-in which they give bogus error messages when linking some programs.
-
-@item -msoft-float
-Generate output containing library calls for floating point.
-@strong{Warning:} the requisite libraries are not available for all HPPA
-targets. Normally the facilities of the machine's usual C compiler are
-used, but this cannot be done directly in cross-compilation. You must make
-your own arrangements to provide suitable library functions for
-cross-compilation. The embedded target @samp{hppa1.1-*-pro}
-does provide software floating point support.
-
-@samp{-msoft-float} changes the calling convention in the output file;
-therefore, it is only useful if you compile @emph{all} of a program with
-this option. In particular, you need to compile @file{libgcc.a}, the
-library that comes with GCC, with @samp{-msoft-float} in order for
-this to work.
-@end table
-
-@node Intel 960 Options
-@subsection Intel 960 Options
-
-These @samp{-m} options are defined for the Intel 960 implementations:
-
-@table @code
-@item -m@var{cpu type}
-Assume the defaults for the machine type @var{cpu type} for some of
-the other options, including instruction scheduling, floating point
-support, and addressing modes. The choices for @var{cpu type} are
-@samp{ka}, @samp{kb}, @samp{mc}, @samp{ca}, @samp{cf},
-@samp{sa}, and @samp{sb}.
-The default is
-@samp{kb}.
-
-@item -mnumerics
-@itemx -msoft-float
-The @samp{-mnumerics} option indicates that the processor does support
-floating-point instructions. The @samp{-msoft-float} option indicates
-that floating-point support should not be assumed.
-
-@item -mleaf-procedures
-@itemx -mno-leaf-procedures
-Do (or do not) attempt to alter leaf procedures to be callable with the
-@code{bal} instruction as well as @code{call}. This will result in more
-efficient code for explicit calls when the @code{bal} instruction can be
-substituted by the assembler or linker, but less efficient code in other
-cases, such as calls via function pointers, or using a linker that doesn't
-support this optimization.
-
-@item -mtail-call
-@itemx -mno-tail-call
-Do (or do not) make additional attempts (beyond those of the
-machine-independent portions of the compiler) to optimize tail-recursive
-calls into branches. You may not want to do this because the detection of
-cases where this is not valid is not totally complete. The default is
-@samp{-mno-tail-call}.
-
-@item -mcomplex-addr
-@itemx -mno-complex-addr
-Assume (or do not assume) that the use of a complex addressing mode is a
-win on this implementation of the i960. Complex addressing modes may not
-be worthwhile on the K-series, but they definitely are on the C-series.
-The default is currently @samp{-mcomplex-addr} for all processors except
-the CB and CC.
-
-@item -mcode-align
-@itemx -mno-code-align
-Align code to 8-byte boundaries for faster fetching (or don't bother).
-Currently turned on by default for C-series implementations only.
-
-@ignore
-@item -mclean-linkage
-@itemx -mno-clean-linkage
-These options are not fully implemented.
-@end ignore
-
-@item -mic-compat
-@itemx -mic2.0-compat
-@itemx -mic3.0-compat
-Enable compatibility with iC960 v2.0 or v3.0.
-
-@item -masm-compat
-@itemx -mintel-asm
-Enable compatibility with the iC960 assembler.
-
-@item -mstrict-align
-@itemx -mno-strict-align
-Do not permit (do permit) unaligned accesses.
-
-@item -mold-align
-Enable structure-alignment compatibility with Intel's gcc release version
-1.3 (based on gcc 1.37). This option implies @samp{-mstrict-align}.
-
-@item -mlong-double-64
-Implement type @samp{long double} as 64-bit floating point numbers.
-Without the option @samp{long double} is implemented by 80-bit
-floating point numbers. The only reason we have it because there is
-no 128-bit @samp{long double} support in @samp{fp-bit.c} yet. So it
-is only useful for people using soft-float targets. Otherwise, we
-should recommend against use of it.
-
-@end table
-
-@node DEC Alpha Options
-@subsection DEC Alpha Options
-
-These @samp{-m} options are defined for the DEC Alpha implementations:
-
-@table @code
-@item -mno-soft-float
-@itemx -msoft-float
-Use (do not use) the hardware floating-point instructions for
-floating-point operations. When @code{-msoft-float} is specified,
-functions in @file{libgcc1.c} will be used to perform floating-point
-operations. Unless they are replaced by routines that emulate the
-floating-point operations, or compiled in such a way as to call such
-emulations routines, these routines will issue floating-point
-operations. If you are compiling for an Alpha without floating-point
-operations, you must ensure that the library is built so as not to call
-them.
-
-Note that Alpha implementations without floating-point operations are
-required to have floating-point registers.
-
-@item -mfp-reg
-@itemx -mno-fp-regs
-Generate code that uses (does not use) the floating-point register set.
-@code{-mno-fp-regs} implies @code{-msoft-float}. If the floating-point
-register set is not used, floating point operands are passed in integer
-registers as if they were integers and floating-point results are passed
-in $0 instead of $f0. This is a non-standard calling sequence, so any
-function with a floating-point argument or return value called by code
-compiled with @code{-mno-fp-regs} must also be compiled with that
-option.
-
-A typical use of this option is building a kernel that does not use,
-and hence need not save and restore, any floating-point registers.
-
-@item -mieee
-The Alpha architecture implements floating-point hardware optimized for
-maximum performance. It is mostly compliant with the IEEE floating
-point standard. However, for full compliance, software assistance is
-required. This option generates code fully IEEE compliant code
-@emph{except} that the @var{inexact flag} is not maintained (see below).
-If this option is turned on, the CPP macro @code{_IEEE_FP} is defined
-during compilation. The option is a shorthand for: @samp{-D_IEEE_FP
--mfp-trap-mode=su -mtrap-precision=i -mieee-conformant}. The resulting
-code is less efficient but is able to correctly support denormalized
-numbers and exceptional IEEE values such as not-a-number and plus/minus
-infinity. Other Alpha compilers call this option
-@code{-ieee_with_no_inexact}.
-
-@item -mieee-with-inexact
-@c overfull hbox here --bob 22 jul96
-@c original text between ignore ... end ignore
-@ignore
-This is like @samp{-mieee} except the generated code also maintains the
-IEEE @var{inexact flag}. Turning on this option causes the generated
-code to implement fully-compliant IEEE math. The option is a shorthand
-for @samp{-D_IEEE_FP -D_IEEE_FP_INEXACT} plus @samp{-mieee-conformant},
-@samp{-mfp-trap-mode=sui}, and @samp{-mtrap-precision=i}. On some Alpha
-implementations the resulting code may execute significantly slower than
-the code generated by default. Since there is very little code that
-depends on the @var{inexact flag}, you should normally not specify this
-option. Other Alpha compilers call this option
-@samp{-ieee_with_inexact}.
-@end ignore
-@c changed paragraph
-This is like @samp{-mieee} except the generated code also maintains the
-IEEE @var{inexact flag}. Turning on this option causes the generated
-code to implement fully-compliant IEEE math. The option is a shorthand
-for @samp{-D_IEEE_FP -D_IEEE_FP_INEXACT} plus the three following:
-@samp{-mieee-conformant},
-@samp{-mfp-trap-mode=sui},
-and @samp{-mtrap-precision=i}.
-On some Alpha implementations the resulting code may execute
-significantly slower than the code generated by default. Since there
-is very little code that depends on the @var{inexact flag}, you should
-normally not specify this option. Other Alpha compilers call this
-option @samp{-ieee_with_inexact}.
-@c end changes to prevent overfull hboxes
-
-@item -mfp-trap-mode=@var{trap mode}
-This option controls what floating-point related traps are enabled.
-Other Alpha compilers call this option @samp{-fptm }@var{trap mode}.
-The trap mode can be set to one of four values:
-
-@table @samp
-@item n
-This is the default (normal) setting. The only traps that are enabled
-are the ones that cannot be disabled in software (e.g., division by zero
-trap).
-
-@item u
-In addition to the traps enabled by @samp{n}, underflow traps are enabled
-as well.
-
-@item su
-Like @samp{su}, but the instructions are marked to be safe for software
-completion (see Alpha architecture manual for details).
-
-@item sui
-Like @samp{su}, but inexact traps are enabled as well.
-@end table
-
-@item -mfp-rounding-mode=@var{rounding mode}
-Selects the IEEE rounding mode. Other Alpha compilers call this option
-@samp{-fprm }@var{rounding mode}. The @var{rounding mode} can be one
-of:
-
-@table @samp
-@item n
-Normal IEEE rounding mode. Floating point numbers are rounded towards
-the nearest machine number or towards the even machine number in case
-of a tie.
-
-@item m
-Round towards minus infinity.
-
-@item c
-Chopped rounding mode. Floating point numbers are rounded towards zero.
-
-@item d
-Dynamic rounding mode. A field in the floating point control register
-(@var{fpcr}, see Alpha architecture reference manual) controls the
-rounding mode in effect. The C library initializes this register for
-rounding towards plus infinity. Thus, unless your program modifies the
-@var{fpcr}, @samp{d} corresponds to round towards plus infinity.
-@end table
-
-@item -mtrap-precision=@var{trap precision}
-In the Alpha architecture, floating point traps are imprecise. This
-means without software assistance it is impossible to recover from a
-floating trap and program execution normally needs to be terminated.
-GCC can generate code that can assist operating system trap handlers
-in determining the exact location that caused a floating point trap.
-Depending on the requirements of an application, different levels of
-precisions can be selected:
-
-@table @samp
-@item p
-Program precision. This option is the default and means a trap handler
-can only identify which program caused a floating point exception.
-
-@item f
-Function precision. The trap handler can determine the function that
-caused a floating point exception.
-
-@item i
-Instruction precision. The trap handler can determine the exact
-instruction that caused a floating point exception.
-@end table
-
-Other Alpha compilers provide the equivalent options called
-@samp{-scope_safe} and @samp{-resumption_safe}.
-
-@item -mieee-conformant
-This option marks the generated code as IEEE conformant. You must not
-use this option unless you also specify @samp{-mtrap-precision=i} and either
-@samp{-mfp-trap-mode=su} or @samp{-mfp-trap-mode=sui}. Its only effect
-is to emit the line @samp{.eflag 48} in the function prologue of the
-generated assembly file. Under DEC Unix, this has the effect that
-IEEE-conformant math library routines will be linked in.
-
-@item -mbuild-constants
-Normally GCC examines a 32- or 64-bit integer constant to
-see if it can construct it from smaller constants in two or three
-instructions. If it cannot, it will output the constant as a literal and
-generate code to load it from the data segment at runtime.
-
-Use this option to require GCC to construct @emph{all} integer constants
-using code, even if it takes more instructions (the maximum is six).
-
-You would typically use this option to build a shared library dynamic
-loader. Itself a shared library, it must relocate itself in memory
-before it can find the variables and constants in its own data segment.
-
-@item -malpha-as
-@itemx -mgas
-Select whether to generate code to be assembled by the vendor-supplied
-assembler (@samp{-malpha-as}) or by the GNU assembler @samp{-mgas}.
-
-@item -mbwx
-@itemx -mno-bwx
-@itemx -mcix
-@itemx -mno-cix
-@itemx -mmax
-@itemx -mno-max
-Indicate whether GCC should generate code to use the optional BWX,
-CIX, and MAX instruction sets. The default is to use the instruction sets
-supported by the CPU type specified via @samp{-mcpu=} option or that
-of the CPU on which GCC was built if none was specified.
-
-@item -mcpu=@var{cpu_type}
-Set the instruction set, register set, and instruction scheduling
-parameters for machine type @var{cpu_type}. You can specify either the
-@samp{EV} style name or the corresponding chip number. GCC
-supports scheduling parameters for the EV4 and EV5 family of processors
-and will choose the default values for the instruction set from
-the processor you specify. If you do not specify a processor type,
-GCC will default to the processor on which the compiler was built.
-
-Supported values for @var{cpu_type} are
-
-@table @samp
-@item ev4
-@itemx 21064
-Schedules as an EV4 and has no instruction set extensions.
-
-@item ev5
-@itemx 21164
-Schedules as an EV5 and has no instruction set extensions.
-
-@item ev56
-@itemx 21164a
-Schedules as an EV5 and supports the BWX extension.
-
-@item pca56
-@itemx 21164pc
-@itemx 21164PC
-Schedules as an EV5 and supports the BWX and MAX extensions.
-
-@item ev6
-@itemx 21264
-Schedules as an EV5 (until Digital releases the scheduling parameters
-for the EV6) and supports the BWX, CIX, and MAX extensions.
-@end table
-
-@item -mmemory-latency=@var{time}
-Sets the latency the scheduler should assume for typical memory
-references as seen by the application. This number is highly
-dependant on the memory access patterns used by the application
-and the size of the external cache on the machine.
-
-Valid options for @var{time} are
-
-@table @samp
-@item @var{number}
-A decimal number representing clock cycles.
-
-@item L1
-@itemx L2
-@itemx L3
-@itemx main
-The compiler contains estimates of the number of clock cycles for
-``typical'' EV4 & EV5 hardware for the Level 1, 2 & 3 caches
-(also called Dcache, Scache, and Bcache), as well as to main memory.
-Note that L3 is only valid for EV5.
-
-@end table
-@end table
-
-@node Clipper Options
-@subsection Clipper Options
-
-These @samp{-m} options are defined for the Clipper implementations:
-
-@table @code
-@item -mc300
-Produce code for a C300 Clipper processor. This is the default.
-
-@item -mc400
-Produce code for a C400 Clipper processor i.e. use floating point
-registers f8..f15.
-@end table
-
-@node H8/300 Options
-@subsection H8/300 Options
-
-These @samp{-m} options are defined for the H8/300 implementations:
-
-@table @code
-@item -mrelax
-Shorten some address references at link time, when possible; uses the
-linker option @samp{-relax}. @xref{H8/300,, @code{ld} and the H8/300,
-ld.info, Using ld}, for a fuller description.
-
-@item -mh
-Generate code for the H8/300H.
-
-@item -ms
-Generate code for the H8/S.
-
-@item -mint32
-Make @code{int} data 32 bits by default.
-
-@item -malign-300
-On the h8/300h, use the same alignment rules as for the h8/300.
-The default for the h8/300h is to align longs and floats on 4 byte boundaries.
-@samp{-malign-300} causes them to be aligned on 2 byte boundaries.
-This option has no effect on the h8/300.
-@end table
-
-@node SH Options
-@subsection SH Options
-
-These @samp{-m} options are defined for the SH implementations:
-
-@table @code
-@item -m1
-Generate code for the SH1.
-
-@item -m2
-Generate code for the SH2.
-
-@item -m3
-Generate code for the SH3.
-
-@item -m3e
-Generate code for the SH3e.
-
-@item -mb
-Compile code for the processor in big endian mode.
-
-@item -ml
-Compile code for the processor in little endian mode.
-
-@item -mdalign
-Align doubles at 64 bit boundaries. Note that this changes the calling
-conventions, and thus some functions from the standard C library will
-not work unless you recompile it first with -mdalign.
-
-@item -mrelax
-Shorten some address references at link time, when possible; uses the
-linker option @samp{-relax}.
-@end table
-
-@node System V Options
-@subsection Options for System V
-
-These additional options are available on System V Release 4 for
-compatibility with other compilers on those systems:
-
-@table @code
-@item -G
-Create a shared object.
-It is recommended that @samp{-symbolic} or @samp{-shared} be used instead.
-
-@item -Qy
-Identify the versions of each tool used by the compiler, in a
-@code{.ident} assembler directive in the output.
-
-@item -Qn
-Refrain from adding @code{.ident} directives to the output file (this is
-the default).
-
-@item -YP,@var{dirs}
-Search the directories @var{dirs}, and no others, for libraries
-specified with @samp{-l}.
-
-@item -Ym,@var{dir}
-Look in the directory @var{dir} to find the M4 preprocessor.
-The assembler uses this option.
-@c This is supposed to go with a -Yd for predefined M4 macro files, but
-@c the generic assembler that comes with Solaris takes just -Ym.
-@end table
-
-@node TMS320C3x/C4x Options
-@subsection TMS320C3x/C4x Options
-@cindex TMS320C3x/C4x Options
-
-These @samp{-m} options are defined for TMS320C3x/C4x implementations:
-
-@table @code
-
-@item -mcpu=@var{cpu_type}
-Set the instruction set, register set, and instruction scheduling
-parameters for machine type @var{cpu_type}. Supported values for
-@var{cpu_type} are @samp{c30}, @samp{c31}, @samp{c32}, @samp{c40}, and
-@samp{c44}. The default is @samp{c40} to generate code for the
-TMS320C40.
-
-@item -mbig-memory
-@item -mbig
-@itemx -msmall-memory
-@itemx -msmall
-Generates code for the big or small memory model. The small memory
-model assumed that all data fits into one 64K word page. At run-time
-the data page (DP) register must be set to point to the 64K page
-containing the .bss and .data program sections. The big memory model is
-the default and requires reloading of the DP register for every direct
-memory access.
-
-@item -mbk
-@itemx -mno-bk
-Allow (disallow) allocation of general integer operands into the block
-count register BK.
-
-@item -mdb
-@itemx -mno-db
-Enable (disable) generation of code using decrement and branch,
-DBcond(D), instructions. This is enabled by default for the C4x. To be
-on the safe side, this is disabled for the C3x, since the maximum
-iteration count on the C3x is 2^23 + 1 (but who iterates loops more than
-2^23 times on the C3x?). Note that GCC will try to reverse a loop so
-that it can utilise the decrement and branch instruction, but will give
-up if there is more than one memory reference in the loop. Thus a loop
-where the loop counter is decremented can generate slightly more
-efficient code, in cases where the RPTB instruction cannot be utilised.
-
-@item -mdp-isr-reload
-@itemx -mparanoid
-Force the DP register to be saved on entry to an interrupt service
-routine (ISR), reloaded to point to the data section, and restored on
-exit from the ISR. This should not be required unless someone has
-violated the small memory model by modifying the DP register, say within
-an object library.
-
-@item -mmpyi
-@itemx -mno-mpyi
-For the C3x use the 24-bit MPYI instruction for integer multiplies
-instead of a library call to guarantee 32-bit results. Note that if one
-of the operands is a constant, then the multiplication will be performed
-using shifts and adds. If the -mmpyi option is not specified for the C3x,
-then squaring operations are performed inline instead of a library call.
-
-@item -mfast-fix
-@itemx -mno-fast-fix
-The C3x/C4x FIX instruction to convert a floating point value to an
-integer value chooses the nearest integer less than or equal to the
-floating point value rather than to the nearest integer. Thus if the
-floating point number is negative, the result will be incorrectly
-truncated an additional code is necessary to detect and correct this
-case. This option can be used to disable generation of the additional
-code required to correct the result.
-
-@item -mrptb
-@itemx -mno-rptb
-Enable (disable) generation of repeat block sequences using the RPTB
-instruction for zero overhead looping. The RPTB construct is only used
-for innermost loops that do not call functions or jump across the loop
-boundaries. There is no advantage having nested RPTB loops due to the
-overhead required to save and restore the RC, RS, and RE registers.
-This is enabled by default with -O2.
-
-@item -mrpts=@var{count}
-@itemx -mno-rpts
-Enable (disable) the use of the single instruction repeat instruction
-RPTS. If a repeat block contains a single instruction, and the loop
-count can be guaranteed to be less than the value @var{count}, GCC will
-emit a RPTS instruction instead of a RPTB. If no value is specified,
-then a RPTS will be emitted even if the loop count cannot be determined
-at compile time. Note that the repeated instruction following RPTS does
-not have to be reloaded from memory each iteration, thus freeing up the
-CPU buses for oeprands. However, since interrupts are blocked by this
-instruction, it is disabled by default.
-
-@item -mloop-unsigned
-@itemx -mno-loop-unsigned
-The maximum iteration count when using RPTS and RPTB (and DB on the C40)
-is 2^31 + 1 since these instructions test if the iteration count is
-negative to terminate the loop. If the iteration count is unsigned
-there is a possibility than the 2^31 + 1 maximum iteration count may be
-exceeded. This switch allows an unsigned iteration count.
-
-@item -mti
-Try to emit an assembler syntax that the TI assembler (asm30) is happy
-with. This also enforces compatibility with the API employed by the TI
-C3x C compiler. For example, long doubles are passed as structures
-rather than in floating point registers.
-
-@item -mregparm
-@itemx -mmemparm
-Generate code that uses registers (stack) for passing arguments to functions.
-By default, arguments are passed in registers where possible rather
-than by pushing arguments on to the stack.
-
-@item -mparallel-insns
-@itemx -mno-parallel-insns
-Allow the generation of parallel instructions. This is enabled by
-default with -O2.
-
-@item -mparallel-mpy
-@itemx -mno-parallel-mpy
-Allow the generation of MPY||ADD and MPY||SUB parallel instructions,
-provided -mparallel-insns is also specified. These instructions have
-tight register constraints which can pessimize the code generation
-of large functions.
-
-@end table
-
-@node V850 Options
-@subsection V850 Options
-@cindex V850 Options
-
-These @samp{-m} options are defined for V850 implementations:
-
-@table @code
-@item -mlong-calls
-@itemx -mno-long-calls
-Treat all calls as being far away (near). If calls are assumed to be
-far away, the compiler will always load the functions address up into a
-register, and call indirect through the pointer.
-
-@item -mno-ep
-@itemx -mep
-Do not optimize (do optimize) basic blocks that use the same index
-pointer 4 or more times to copy pointer into the @code{ep} register, and
-use the shorter @code{sld} and @code{sst} instructions. The @samp{-mep}
-option is on by default if you optimize.
-
-@item -mno-prolog-function
-@itemx -mprolog-function
-Do not use (do use) external functions to save and restore registers at
-the prolog and epilog of a function. The external functions are slower,
-but use less code space if more than one function saves the same number
-of registers. The @samp{-mprolog-function} option is on by default if
-you optimize.
-
-@item -mspace
-Try to make the code as small as possible. At present, this just turns
-on the @samp{-mep} and @samp{-mprolog-function} options.
-
-@item -mtda=@var{n}
-Put static or global variables whose size is @var{n} bytes or less into
-the tiny data area that register @code{ep} points to. The tiny data
-area can hold up to 256 bytes in total (128 bytes for byte references).
-
-@item -msda=@var{n}
-Put static or global variables whose size is @var{n} bytes or less into
-the small data area that register @code{gp} points to. The small data
-area can hold up to 64 kilobytes.
-
-@item -mzda=@var{n}
-Put static or global variables whose size is @var{n} bytes or less into
-the first 32 kilobytes of memory.
-
-@item -mv850
-Specify that the target processor is the V850.
-
-@item -mbig-switch
-Generate code suitable for big switch tables. Use this option only if
-the assembler/linker complain about out of range branches within a switch
-table.
-@end table
-
-@node ARC Options
-@subsection ARC Options
-@cindex ARC Options
-
-These options are defined for ARC implementations:
-
-@table @code
-@item -EL
-Compile code for little endian mode. This is the default.
-
-@item -EB
-Compile code for big endian mode.
-
-@item -mmangle-cpu
-Prepend the name of the cpu to all public symbol names.
-In multiple-processor systems, there are many ARC variants with different
-instruction and register set characteristics. This flag prevents code
-compiled for one cpu to be linked with code compiled for another.
-No facility exists for handling variants that are "almost identical".
-This is an all or nothing option.
-
-@item -mcpu=@var{cpu}
-Compile code for ARC variant @var{cpu}.
-Which variants are supported depend on the configuration.
-All variants support @samp{-mcpu=base}, this is the default.
-
-@item -mtext=@var{text section}
-@itemx -mdata=@var{data section}
-@itemx -mrodata=@var{readonly data section}
-Put functions, data, and readonly data in @var{text section},
-@var{data section}, and @var{readonly data section} respectively
-by default. This can be overridden with the @code{section} attribute.
-@xref{Variable Attributes}.
-
-@end table
-
-@node NS32K Options
-@subsection NS32K Options
-@cindex NS32K options
-
-These are the @samp{-m} options defined for the 32000 series. The default
-values for these options depends on which style of 32000 was selected when
-the compiler was configured; the defaults for the most common choices are
-given below.
-
-@table @code
-@item -m32032
-@itemx -m32032
-Generate output for a 32032. This is the default
-when the compiler is configured for 32032 and 32016 based systems.
-
-@item -m32332
-@itemx -m32332
-Generate output for a 32332. This is the default
-when the compiler is configured for 32332-based systems.
-
-@item -m32532
-@itemx -m32532
-Generate output for a 32532. This is the default
-when the compiler is configured for 32532-based systems.
-
-@item -m32081
-Generate output containing 32081 instructions for floating point.
-This is the default for all systems.
-
-@item -m32381
-Generate output containing 32381 instructions for floating point. This
-also implies @samp{-m32081}. The 32381 is only compatible with the 32332
-and 32532 cpus. This is the default for the pc532-netbsd configuration.
-
-@item -mmulti-add
-Try and generate multiply-add floating point instructions @code{polyF}
-and @code{dotF}. This option is only available if the @samp{-m32381}
-option is in effect. Using these instructions requires changes to to
-register allocation which generally has a negative impact on
-performance. This option should only be enabled when compiling code
-particularly likely to make heavy use of multiply-add instructions.
-
-@item -mnomulti-add
-Do not try and generate multiply-add floating point instructions
-@code{polyF} and @code{dotF}. This is the default on all platforms.
-
-@item -msoft-float
-Generate output containing library calls for floating point.
-@strong{Warning:} the requisite libraries may not be available.
-
-@item -mnobitfield
-Do not use the bit-field instructions. On some machines it is faster to
-use shifting and masking operations. This is the default for the pc532.
-
-@item -mbitfield
-Do use the bit-field instructions. This is the default for all platforms
-except the pc532.
-
-@item -mrtd
-Use a different function-calling convention, in which functions
-that take a fixed number of arguments return pop their
-arguments on return with the @code{ret} instruction.
-
-This calling convention is incompatible with the one normally
-used on Unix, so you cannot use it if you need to call libraries
-compiled with the Unix compiler.
-
-Also, you must provide function prototypes for all functions that
-take variable numbers of arguments (including @code{printf});
-otherwise incorrect code will be generated for calls to those
-functions.
-
-In addition, seriously incorrect code will result if you call a
-function with too many arguments. (Normally, extra arguments are
-harmlessly ignored.)
-
-This option takes its name from the 680x0 @code{rtd} instruction.
-
-
-@item -mregparam
-Use a different function-calling convention where the first two arguments
-are passed in registers.
-
-This calling convention is incompatible with the one normally
-used on Unix, so you cannot use it if you need to call libraries
-compiled with the Unix compiler.
-
-@item -mnoregparam
-Do not pass any arguments in registers. This is the default for all
-targets.
-
-@item -msb
-It is OK to use the sb as an index register which is always loaded with
-zero. This is the default for the pc532-netbsd target.
-
-@item -mnosb
-The sb register is not available for use or has not been initialized to
-zero by the run time system. This is the default for all targets except
-the pc532-netbsd. It is also implied whenever @samp{-mhimem} or
-@samp{-fpic} is set.
-
-@item -mhimem
-Many ns32000 series addressing modes use displacements of up to 512MB.
-If an address is above 512MB then displacements from zero can not be used.
-This option causes code to be generated which can be loaded above 512MB.
-This may be useful for operating systems or ROM code.
-
-@item -mnohimem
-Assume code will be loaded in the first 512MB of virtual address space.
-This is the default for all platforms.
-
-
-@end table
-
-
-
-@node Code Gen Options
-@section Options for Code Generation Conventions
-@cindex code generation conventions
-@cindex options, code generation
-@cindex run-time options
-
-These machine-independent options control the interface conventions
-used in code generation.
-
-Most of them have both positive and negative forms; the negative form
-of @samp{-ffoo} would be @samp{-fno-foo}. In the table below, only
-one of the forms is listed---the one which is not the default. You
-can figure out the other form by either removing @samp{no-} or adding
-it.
-
-@table @code
-@item -fexceptions
-Enable exception handling. Generates extra code needed to propagate
-exceptions. For some targets, this implies generation of frame unwind
-information for all functions. This can produce significant data size
-overhead, although it does not affect execution.
-If you do not specify this option, it is enabled by
-default for languages like C++ which normally require exception handling,
-and disabled for languages like C that do not normally require it.
-However, when compiling C code that needs to interoperate properly with
-exception handlers written in C++, you may need to enable this option.
-You may also wish to disable this option is you are compiling older C++
-programs that don't use exception handling.
-
-@item -fpcc-struct-return
-Return ``short'' @code{struct} and @code{union} values in memory like
-longer ones, rather than in registers. This convention is less
-efficient, but it has the advantage of allowing intercallability between
-GCC-compiled files and files compiled with other compilers.
-
-The precise convention for returning structures in memory depends
-on the target configuration macros.
-
-Short structures and unions are those whose size and alignment match
-that of some integer type.
-
-@item -freg-struct-return
-Use the convention that @code{struct} and @code{union} values are
-returned in registers when possible. This is more efficient for small
-structures than @samp{-fpcc-struct-return}.
-
-If you specify neither @samp{-fpcc-struct-return} nor its contrary
-@samp{-freg-struct-return}, GCC defaults to whichever convention is
-standard for the target. If there is no standard convention, GCC
-defaults to @samp{-fpcc-struct-return}, except on targets where GCC
-is the principal compiler. In those cases, we can choose the standard,
-and we chose the more efficient register return alternative.
-
-@item -fshort-enums
-Allocate to an @code{enum} type only as many bytes as it needs for the
-declared range of possible values. Specifically, the @code{enum} type
-will be equivalent to the smallest integer type which has enough room.
-
-@item -fshort-double
-Use the same size for @code{double} as for @code{float}.
-
-@item -fshared-data
-Requests that the data and non-@code{const} variables of this
-compilation be shared data rather than private data. The distinction
-makes sense only on certain operating systems, where shared data is
-shared between processes running the same program, while private data
-exists in one copy per process.
-
-@item -fno-common
-Allocate even uninitialized global variables in the bss section of the
-object file, rather than generating them as common blocks. This has the
-effect that if the same variable is declared (without @code{extern}) in
-two different compilations, you will get an error when you link them.
-The only reason this might be useful is if you wish to verify that the
-program will work on other systems which always work this way.
-
-@item -fno-ident
-Ignore the @samp{#ident} directive.
-
-@item -fno-gnu-linker
-Do not output global initializations (such as C++ constructors and
-destructors) in the form used by the GNU linker (on systems where the GNU
-linker is the standard method of handling them). Use this option when
-you want to use a non-GNU linker, which also requires using the
-@code{collect2} program to make sure the system linker includes
-constructors and destructors. (@code{collect2} is included in the GCC
-distribution.) For systems which @emph{must} use @code{collect2}, the
-compiler driver @code{gcc} is configured to do this automatically.
-
-@item -finhibit-size-directive
-Don't output a @code{.size} assembler directive, or anything else that
-would cause trouble if the function is split in the middle, and the
-two halves are placed at locations far apart in memory. This option is
-used when compiling @file{crtstuff.c}; you should not need to use it
-for anything else.
-
-@item -fverbose-asm
-Put extra commentary information in the generated assembly code to
-make it more readable. This option is generally only of use to those
-who actually need to read the generated assembly code (perhaps while
-debugging the compiler itself).
-
-@samp{-fno-verbose-asm}, the default, causes the
-extra information to be omitted and is useful when comparing two assembler
-files.
-
-@item -fvolatile
-Consider all memory references through pointers to be volatile.
-
-@item -fvolatile-global
-Consider all memory references to extern and global data items to
-be volatile. GCC does not consider static data items to be volatile
-because of this switch.
-
-@item -fvolatile-static
-Consider all memory references to static data to be volatile.
-
-@item -fpic
-@cindex global offset table
-@cindex PIC
-Generate position-independent code (PIC) suitable for use in a shared
-library, if supported for the target machine. Such code accesses all
-constant addresses through a global offset table (GOT). The dynamic
-loader resolves the GOT entries when the program starts (the dynamic
-loader is not part of GCC; it is part of the operating system). If
-the GOT size for the linked executable exceeds a machine-specific
-maximum size, you get an error message from the linker indicating that
-@samp{-fpic} does not work; in that case, recompile with @samp{-fPIC}
-instead. (These maximums are 16k on the m88k, 8k on the Sparc, and 32k
-on the m68k and RS/6000. The 386 has no such limit.)
-
-Position-independent code requires special support, and therefore works
-only on certain machines. For the 386, GCC supports PIC for System V
-but not for the Sun 386i. Code generated for the IBM RS/6000 is always
-position-independent.
-
-@item -fPIC
-If supported for the target machine, emit position-independent code,
-suitable for dynamic linking and avoiding any limit on the size of the
-global offset table. This option makes a difference on the m68k, m88k,
-and the Sparc.
-
-Position-independent code requires special support, and therefore works
-only on certain machines.
-
-@item -ffixed-@var{reg}
-Treat the register named @var{reg} as a fixed register; generated code
-should never refer to it (except perhaps as a stack pointer, frame
-pointer or in some other fixed role).
-
-@var{reg} must be the name of a register. The register names accepted
-are machine-specific and are defined in the @code{REGISTER_NAMES}
-macro in the machine description macro file.
-
-This flag does not have a negative form, because it specifies a
-three-way choice.
-
-@item -fcall-used-@var{reg}
-Treat the register named @var{reg} as an allocable register that is
-clobbered by function calls. It may be allocated for temporaries or
-variables that do not live across a call. Functions compiled this way
-will not save and restore the register @var{reg}.
-
-It is an error to used this flag with the frame pointer or stack pointer.
-Use of this flag for other registers that have fixed pervasive roles in
-the machine's execution model will produce disastrous results.
-
-This flag does not have a negative form, because it specifies a
-three-way choice.
-
-@item -fcall-saved-@var{reg}
-Treat the register named @var{reg} as an allocable register saved by
-functions. It may be allocated even for temporaries or variables that
-live across a call. Functions compiled this way will save and restore
-the register @var{reg} if they use it.
-
-It is an error to used this flag with the frame pointer or stack pointer.
-Use of this flag for other registers that have fixed pervasive roles in
-the machine's execution model will produce disastrous results.
-
-A different sort of disaster will result from the use of this flag for
-a register in which function values may be returned.
-
-This flag does not have a negative form, because it specifies a
-three-way choice.
-
-@item -fpack-struct
-Pack all structure members together without holes. Usually you would
-not want to use this option, since it makes the code suboptimal, and
-the offsets of structure members won't agree with system libraries.
-
-@item -fcheck-memory-usage
-Generate extra code to check each memory access. GCC will generate
-code that is suitable for a detector of bad memory accesses such as
-@file{Checker}.
-
-Normally, you should compile all, or none, of your code with this option.
-
-If you do mix code compiled with and without this option,
-you must ensure that all code that has side effects
-and that is called by code compiled with this option
-is, itself, compiled with this option.
-If you do not, you might get erroneous messages from the detector.
-
-If you use functions from a library that have side-effects (such as
-@code{read}), you might not be able to recompile the library and
-specify this option. In that case, you can enable the
-@samp{-fprefix-function-name} option, which requests GCC to encapsulate
-your code and make other functions look as if they were compiled with
-@samp{-fcheck-memory-usage}. This is done by calling ``stubs'',
-which are provided by the detector. If you cannot find or build
-stubs for every function you call, you might have to specify
-@samp{-fcheck-memory-usage} without @samp{-fprefix-function-name}.
-
-If you specify this option, you can not use the @code{asm} or
-@code{__asm__} keywords in functions with memory checking enabled. The
-compiler cannot understand what the @code{asm} statement will do, and
-therefore cannot generate the appropriate code, so it is rejected.
-However, the function attribute @code{no_check_memory_usage} will
-disable memory checking within a function, and @code{asm} statements can
-be put inside such functions. Inline expansion of a non-checked
-function within a checked function is permitted; the inline function's
-memory accesses won't be checked, but the rest will.
-
-If you move your @code{asm} statements to non-checked inline functions,
-but they do access memory, you can add calls to the support code in your
-inline function, to indicate any reads, writes, or copies being done.
-These calls would be similar to those done in the stubs described above.
-
-@c FIXME: The support-routine interface is defined by the compiler and
-@c should be documented!
-
-@item -fprefix-function-name
-Request GCC to add a prefix to the symbols generated for function names.
-GCC adds a prefix to the names of functions defined as well as
-functions called. Code compiled with this option and code compiled
-without the option can't be linked together, unless stubs are used.
-
-If you compile the following code with @samp{-fprefix-function-name}
-@example
-extern void bar (int);
-void
-foo (int a)
-@{
- return bar (a + 5);
-@}
-@end example
-
-@noindent
-GCC will compile the code as if it was written:
-@example
-extern void prefix_bar (int);
-void
-prefix_foo (int a)
-@{
- return prefix_bar (a + 5);
-@}
-@end example
-This option is designed to be used with @samp{-fcheck-memory-usage}.
-
-@item -finstrument-functions
-Generate instrumentation calls for entry and exit to functions. Just
-after function entry and just before function exit, the following
-profiling functions will be called with the address of the current
-function and its call site. (On some platforms,
-@code{__builtin_return_address} does not work beyond the current
-function, so the call site information may not be available to the
-profiling functions otherwise.)
-
-@example
-void __cyg_profile_func_enter (void *this_fn, void *call_site);
-void __cyg_profile_func_exit (void *this_fn, void *call_site);
-@end example
-
-The first argument is the address of the start of the current function,
-which may be looked up exactly in the symbol table.
-
-This instrumentation is also done for functions expanded inline in other
-functions. The profiling calls will indicate where, conceptually, the
-inline function is entered and exited. This means that addressable
-versions of such functions must be available. If all your uses of a
-function are expanded inline, this may mean an additional expansion of
-code size. If you use @samp{extern inline} in your C code, an
-addressable version of such functions must be provided. (This is
-normally the case anyways, but if you get lucky and the optimizer always
-expands the functions inline, you might have gotten away without
-providing static copies.)
-
-A function may be given the attribute @code{no_instrument_function}, in
-which case this instrumentation will not be done. This can be used, for
-example, for the profiling functions listed above, high-priority
-interrupt routines, and any functions from which the profiling functions
-cannot safely be called (perhaps signal handlers, if the profiling
-routines generate output or allocate memory).
-
-@item -fstack-check
-Generate code to verify that you do not go beyond the boundary of the
-stack. You should specify this flag if you are running in an
-environment with multiple threads, but only rarely need to specify it in
-a single-threaded environment since stack overflow is automatically
-detected on nearly all systems if there is only one stack.
-
-@cindex aliasing of parameters
-@cindex parameters, aliased
-@item -fargument-alias
-@itemx -fargument-noalias
-@itemx -fargument-noalias-global
-Specify the possible relationships among parameters and between
-parameters and global data.
-
-@samp{-fargument-alias} specifies that arguments (parameters) may
-alias each other and may alias global storage.
-@samp{-fargument-noalias} specifies that arguments do not alias
-each other, but may alias global storage.
-@samp{-fargument-noalias-global} specifies that arguments do not
-alias each other and do not alias global storage.
-
-Each language will automatically use whatever option is required by
-the language standard. You should not need to use these options yourself.
-
-@item -fleading-underscore
-This option and its counterpart, -fno-leading-underscore, forcibly
-change the way C symbols are represented in the object file. One use
-is to help link with legacy assembly code.
-
-Be warned that you should know what you are doing when invoking this
-option, and that not all targets provide complete support for it.
-@end table
-
-@node Environment Variables
-@section Environment Variables Affecting GCC
-@cindex environment variables
-
-This section describes several environment variables that affect how GCC
-operates. Some of them work by specifying directories or prefixes to use
-when searching for various kinds of files. Some are used to specify other
-aspects of the compilation environment.
-
-@ifclear INTERNALS
-Note that you can also specify places to search using options such as
-@samp{-B}, @samp{-I} and @samp{-L} (@pxref{Directory Options}). These
-take precedence over places specified using environment variables, which
-in turn take precedence over those specified by the configuration of GCC.
-
-@end ifclear
-@ifset INTERNALS
-Note that you can also specify places to search using options such as
-@samp{-B}, @samp{-I} and @samp{-L} (@pxref{Directory Options}). These
-take precedence over places specified using environment variables, which
-in turn take precedence over those specified by the configuration of GCC.
-@xref{Driver}.
-@end ifset
-
-@table @code
-@item LANG
-@itemx LC_CTYPE
-@c @itemx LC_COLLATE
-@itemx LC_MESSAGES
-@c @itemx LC_MONETARY
-@c @itemx LC_NUMERIC
-@c @itemx LC_TIME
-@itemx LC_ALL
-@findex LANG
-@findex LC_CTYPE
-@c @findex LC_COLLATE
-@findex LC_MESSAGES
-@c @findex LC_MONETARY
-@c @findex LC_NUMERIC
-@c @findex LC_TIME
-@findex LC_ALL
-@cindex locale
-These environment variables control the way that GCC uses
-localization information that allow GCC to work with different
-national conventions. GCC inspects the locale categories
-@code{LC_CTYPE} and @code{LC_MESSAGES} if it has been configured to do
-so. These locale categories can be set to any value supported by your
-installation. A typical value is @samp{en_UK} for English in the United
-Kingdom.
-
-The @code{LC_CTYPE} environment variable specifies character
-classification. GCC uses it to determine the character boundaries in
-a string; this is needed for some multibyte encodings that contain quote
-and escape characters that would otherwise be interpreted as a string
-end or escape.
-
-The @code{LC_MESSAGES} environment variable specifies the language to
-use in diagnostic messages.
-
-If the @code{LC_ALL} environment variable is set, it overrides the value
-of @code{LC_CTYPE} and @code{LC_MESSAGES}; otherwise, @code{LC_CTYPE}
-and @code{LC_MESSAGES} default to the value of the @code{LANG}
-environment variable. If none of these variables are set, GCC
-defaults to traditional C English behavior.
-
-@item TMPDIR
-@findex TMPDIR
-If @code{TMPDIR} is set, it specifies the directory to use for temporary
-files. GCC uses temporary files to hold the output of one stage of
-compilation which is to be used as input to the next stage: for example,
-the output of the preprocessor, which is the input to the compiler
-proper.
-
-@item GCC_EXEC_PREFIX
-@findex GCC_EXEC_PREFIX
-If @code{GCC_EXEC_PREFIX} is set, it specifies a prefix to use in the
-names of the subprograms executed by the compiler. No slash is added
-when this prefix is combined with the name of a subprogram, but you can
-specify a prefix that ends with a slash if you wish.
-
-If GCC cannot find the subprogram using the specified prefix, it
-tries looking in the usual places for the subprogram.
-
-The default value of @code{GCC_EXEC_PREFIX} is
-@file{@var{prefix}/lib/gcc-lib/} where @var{prefix} is the value
-of @code{prefix} when you ran the @file{configure} script.
-
-Other prefixes specified with @samp{-B} take precedence over this prefix.
-
-This prefix is also used for finding files such as @file{crt0.o} that are
-used for linking.
-
-In addition, the prefix is used in an unusual way in finding the
-directories to search for header files. For each of the standard
-directories whose name normally begins with @samp{/usr/local/lib/gcc-lib}
-(more precisely, with the value of @code{GCC_INCLUDE_DIR}), GCC tries
-replacing that beginning with the specified prefix to produce an
-alternate directory name. Thus, with @samp{-Bfoo/}, GCC will search
-@file{foo/bar} where it would normally search @file{/usr/local/lib/bar}.
-These alternate directories are searched first; the standard directories
-come next.
-
-@item COMPILER_PATH
-@findex COMPILER_PATH
-The value of @code{COMPILER_PATH} is a colon-separated list of
-directories, much like @code{PATH}. GCC tries the directories thus
-specified when searching for subprograms, if it can't find the
-subprograms using @code{GCC_EXEC_PREFIX}.
-
-@item LIBRARY_PATH
-@findex LIBRARY_PATH
-The value of @code{LIBRARY_PATH} is a colon-separated list of
-directories, much like @code{PATH}. When configured as a native compiler,
-GCC tries the directories thus specified when searching for special
-linker files, if it can't find them using @code{GCC_EXEC_PREFIX}. Linking
-using GCC also uses these directories when searching for ordinary
-libraries for the @samp{-l} option (but directories specified with
-@samp{-L} come first).
-
-@item C_INCLUDE_PATH
-@itemx CPLUS_INCLUDE_PATH
-@itemx OBJC_INCLUDE_PATH
-@findex C_INCLUDE_PATH
-@findex CPLUS_INCLUDE_PATH
-@findex OBJC_INCLUDE_PATH
-@c @itemx OBJCPLUS_INCLUDE_PATH
-These environment variables pertain to particular languages. Each
-variable's value is a colon-separated list of directories, much like
-@code{PATH}. When GCC searches for header files, it tries the
-directories listed in the variable for the language you are using, after
-the directories specified with @samp{-I} but before the standard header
-file directories.
-
-@item DEPENDENCIES_OUTPUT
-@findex DEPENDENCIES_OUTPUT
-@cindex dependencies for make as output
-If this variable is set, its value specifies how to output dependencies
-for Make based on the header files processed by the compiler. This
-output looks much like the output from the @samp{-M} option
-(@pxref{Preprocessor Options}), but it goes to a separate file, and is
-in addition to the usual results of compilation.
-
-The value of @code{DEPENDENCIES_OUTPUT} can be just a file name, in
-which case the Make rules are written to that file, guessing the target
-name from the source file name. Or the value can have the form
-@samp{@var{file} @var{target}}, in which case the rules are written to
-file @var{file} using @var{target} as the target name.
-
-@item LANG
-@findex LANG
-@cindex locale definition
-This variable is used to pass locale information to the compiler. One way in
-which this information is used is to determine the character set to be used
-when character literals, string literals and comments are parsed in C and C++.
-When the compiler is configured to allow multibyte characters,
-the following values for @code{LANG} are recognized:
-
-@table @code
-@item C-JIS
-Recognize JIS characters.
-@item C-SJIS
-Recognize SJIS characters.
-@item C-EUCJP
-Recognize EUCJP characters.
-@end table
-
-If @code{LANG} is not defined, or if it has some other value, then the
-compiler will use mblen and mbtowc as defined by the default locale to
-recognize and translate multibyte characters.
-@end table
-
-@node Running Protoize
-@section Running Protoize
-
-The program @code{protoize} is an optional part of GNU C. You can use
-it to add prototypes to a program, thus converting the program to ANSI
-C in one respect. The companion program @code{unprotoize} does the
-reverse: it removes argument types from any prototypes that are found.
-
-When you run these programs, you must specify a set of source files as
-command line arguments. The conversion programs start out by compiling
-these files to see what functions they define. The information gathered
-about a file @var{foo} is saved in a file named @file{@var{foo}.X}.
-
-After scanning comes actual conversion. The specified files are all
-eligible to be converted; any files they include (whether sources or
-just headers) are eligible as well.
-
-But not all the eligible files are converted. By default,
-@code{protoize} and @code{unprotoize} convert only source and header
-files in the current directory. You can specify additional directories
-whose files should be converted with the @samp{-d @var{directory}}
-option. You can also specify particular files to exclude with the
-@samp{-x @var{file}} option. A file is converted if it is eligible, its
-directory name matches one of the specified directory names, and its
-name within the directory has not been excluded.
-
-Basic conversion with @code{protoize} consists of rewriting most
-function definitions and function declarations to specify the types of
-the arguments. The only ones not rewritten are those for varargs
-functions.
-
-@code{protoize} optionally inserts prototype declarations at the
-beginning of the source file, to make them available for any calls that
-precede the function's definition. Or it can insert prototype
-declarations with block scope in the blocks where undeclared functions
-are called.
-
-Basic conversion with @code{unprotoize} consists of rewriting most
-function declarations to remove any argument types, and rewriting
-function definitions to the old-style pre-ANSI form.
-
-Both conversion programs print a warning for any function declaration or
-definition that they can't convert. You can suppress these warnings
-with @samp{-q}.
-
-The output from @code{protoize} or @code{unprotoize} replaces the
-original source file. The original file is renamed to a name ending
-with @samp{.save}. If the @samp{.save} file already exists, then
-the source file is simply discarded.
-
-@code{protoize} and @code{unprotoize} both depend on GCC itself to
-scan the program and collect information about the functions it uses.
-So neither of these programs will work until GCC is installed.
-
-Here is a table of the options you can use with @code{protoize} and
-@code{unprotoize}. Each option works with both programs unless
-otherwise stated.
-
-@table @code
-@item -B @var{directory}
-Look for the file @file{SYSCALLS.c.X} in @var{directory}, instead of the
-usual directory (normally @file{/usr/local/lib}). This file contains
-prototype information about standard system functions. This option
-applies only to @code{protoize}.
-
-@item -c @var{compilation-options}
-Use @var{compilation-options} as the options when running @code{gcc} to
-produce the @samp{.X} files. The special option @samp{-aux-info} is
-always passed in addition, to tell @code{gcc} to write a @samp{.X} file.
-
-Note that the compilation options must be given as a single argument to
-@code{protoize} or @code{unprotoize}. If you want to specify several
-@code{gcc} options, you must quote the entire set of compilation options
-to make them a single word in the shell.
-
-There are certain @code{gcc} arguments that you cannot use, because they
-would produce the wrong kind of output. These include @samp{-g},
-@samp{-O}, @samp{-c}, @samp{-S}, and @samp{-o} If you include these in
-the @var{compilation-options}, they are ignored.
-
-@item -C
-Rename files to end in @samp{.C} instead of @samp{.c}.
-This is convenient if you are converting a C program to C++.
-This option applies only to @code{protoize}.
-
-@item -g
-Add explicit global declarations. This means inserting explicit
-declarations at the beginning of each source file for each function
-that is called in the file and was not declared. These declarations
-precede the first function definition that contains a call to an
-undeclared function. This option applies only to @code{protoize}.
-
-@item -i @var{string}
-Indent old-style parameter declarations with the string @var{string}.
-This option applies only to @code{protoize}.
-
-@code{unprotoize} converts prototyped function definitions to old-style
-function definitions, where the arguments are declared between the
-argument list and the initial @samp{@{}. By default, @code{unprotoize}
-uses five spaces as the indentation. If you want to indent with just
-one space instead, use @samp{-i " "}.
-
-@item -k
-Keep the @samp{.X} files. Normally, they are deleted after conversion
-is finished.
-
-@item -l
-Add explicit local declarations. @code{protoize} with @samp{-l} inserts
-a prototype declaration for each function in each block which calls the
-function without any declaration. This option applies only to
-@code{protoize}.
-
-@item -n
-Make no real changes. This mode just prints information about the conversions
-that would have been done without @samp{-n}.
-
-@item -N
-Make no @samp{.save} files. The original files are simply deleted.
-Use this option with caution.
-
-@item -p @var{program}
-Use the program @var{program} as the compiler. Normally, the name
-@file{gcc} is used.
-
-@item -q
-Work quietly. Most warnings are suppressed.
-
-@item -v
-Print the version number, just like @samp{-v} for @code{gcc}.
-@end table
-
-If you need special compiler options to compile one of your program's
-source files, then you should generate that file's @samp{.X} file
-specially, by running @code{gcc} on that source file with the
-appropriate options and the option @samp{-aux-info}. Then run
-@code{protoize} on the entire set of files. @code{protoize} will use
-the existing @samp{.X} file because it is newer than the source file.
-For example:
-
-@example
-gcc -Dfoo=bar file1.c -aux-info
-protoize *.c
-@end example
-
-@noindent
-You need to include the special files along with the rest in the
-@code{protoize} command, even though their @samp{.X} files already
-exist, because otherwise they won't get converted.
-
-@xref{Protoize Caveats}, for more information on how to use
-@code{protoize} successfully.
-
diff --git a/contrib/gcc/just-fixinc b/contrib/gcc/just-fixinc
deleted file mode 100755
index a7d1968ae5a3..000000000000
--- a/contrib/gcc/just-fixinc
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/bin/sh
-# $Id: just-fixinc,v 1.2 1998/04/03 16:35:58 law Exp $
-# This script exists for use after installing
-# the GCC binaries from a distribution tape/CD-ROM.
-# Use it *after* copying the directory of binaries
-# to the proper installed location.
-# It runs fixincludes (or fixinc.svr4, if appropriate) to correct bugs in
-# the system header files.
-# This script needs to be customized for each type of installation so that
-# others may run it after the installation-sans-fixincludes is completed.
-
-# The corrected header files go in the GCC installation directory
-# so that only GCC sees them.
-# This script does not modify the original header files in /usr/include.
-# It only modifies copies in the GCC installation directory.
-
-installed=/opt/gnu/lib/gcc-lib/sparc-sun-solaris2/2.6.0
-cd $installed/include
-
-rmdir tmpfoo > /dev/null 2>&1
-mkdir tmpfoo
-mv va-sparc.h varargs.h stdarg.h stddef.h limits.h float.h proto.h tmpfoo
-
-$installed/fixinc.svr4 $installed/include /usr/include $installed
-
-# Make sure fixed native limits.h gets renamed to syslimits.h before gcc's
-# limits.h from tmpfoo is moved back.
-rm -f syslimits.h
-if test -f limits.h ; then
- mv limits.h syslimits.h
-else
- cp $installed/gsyslimits.h syslimits.h
-fi
-chmod a+r syslimits.h
-
-mv tmpfoo/* .
-rmdir tmpfoo
-
-# eof
diff --git a/contrib/gcc/libgcc1-test.c b/contrib/gcc/libgcc1-test.c
deleted file mode 100644
index d9c250e99d00..000000000000
--- a/contrib/gcc/libgcc1-test.c
+++ /dev/null
@@ -1,106 +0,0 @@
-/* This small function uses all the arithmetic operators that
- libgcc1.c can handle. If you can link it, then
- you have provided replacements for all the libgcc1.c functions that
- your target machine needs. */
-
-int foo ();
-double dfoo ();
-
-/* We don't want __main here because that can drag in atexit (among other
- things) which won't necessarily exist yet. */
-
-main_without__main ()
-{
- int a = foo (), b = foo ();
- unsigned int au = foo (), bu = foo ();
- float af = dfoo (), bf = dfoo ();
- double ad = dfoo (), bd = dfoo ();
-
- discard (a * b);
- discard (a / b);
- discard (a % b);
-
- discard (au / bu);
- discard (au % bu);
-
- discard (a >> b);
- discard (a << b);
-
- discard (au >> bu);
- discard (au << bu);
-
- ddiscard (ad + bd);
- ddiscard (ad - bd);
- ddiscard (ad * bd);
- ddiscard (ad / bd);
- ddiscard (-ad);
-
- ddiscard (af + bf);
- ddiscard (af - bf);
- ddiscard (af * bf);
- ddiscard (af / bf);
- ddiscard (-af);
-
- discard ((int) ad);
- discard ((int) af);
-
- ddiscard ((double) a);
- ddiscard ((float) a);
- ddiscard ((float) ad);
-
- discard (ad == bd);
- discard (ad < bd);
- discard (ad > bd);
- discard (ad != bd);
- discard (ad <= bd);
- discard (ad >= bd);
-
- discard (af == bf);
- discard (af < bf);
- discard (af > bf);
- discard (af != bf);
- discard (af <= bf);
- discard (af >= bf);
-
- return 0;
-}
-
-discard (x)
- int x;
-{}
-
-ddiscard (x)
- double x;
-{}
-
-foo ()
-{
- static int table[] = {20, 69, 4, 12};
- static int idx;
-
- return table[idx++];
-}
-
-double
-dfoo ()
-{
- static double table[] = {20.4, 69.96, 4.4, 202.202};
- static int idx;
-
- return table[idx++];
-}
-
-/* Provide functions that some versions of the linker use to default
- the start address if -e symbol is not used, to avoid the warning
- message saying the start address is defaulted. */
-extern void start() __asm__("start");
-extern void _start() __asm__("_start");
-extern void __start() __asm__("__start");
-
-/* Provide functions that might be needed by soft-float emulation routines. */
-void memcpy() {}
-
-void start() {}
-void _start() {}
-void __start() {}
-void mainCRTStartup() {}
diff --git a/contrib/gcc/libgcc1.c b/contrib/gcc/libgcc1.c
deleted file mode 100644
index bece50034222..000000000000
--- a/contrib/gcc/libgcc1.c
+++ /dev/null
@@ -1,596 +0,0 @@
-/* Subroutines needed by GCC output code on some machines. */
-/* Compile this file with the Unix C compiler! */
-/* Copyright (C) 1987, 1988, 1992, 1994, 1995 Free Software Foundation, Inc.
-
-This file 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.
-
-In addition to the permissions in the GNU General Public License, the
-Free Software Foundation gives you unlimited permission to link the
-compiled version of this file with other programs, and to distribute
-those programs without any restriction coming from the use of this
-file. (The General Public License restrictions do apply in other
-respects; for example, they cover modification of the file, and
-distribution when not linked into another program.)
-
-This file 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 program; 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 other files,
- some of which are compiled with GCC, to produce an executable,
- this library does not by itself 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 "config.h"
-
-/* Don't use `fancy_abort' here even if config.h says to use it. */
-#ifdef abort
-#undef abort
-#endif
-
-/* On some machines, cc is really GCC. For these machines, we can't
- expect these functions to be properly compiled unless GCC open codes
- the operation (which is precisely when the function won't be used).
- So allow tm.h to specify ways of accomplishing the operations
- by defining the macros perform_*.
-
- On a machine where cc is some other compiler, there is usually no
- reason to define perform_*. The other compiler normally has other ways
- of implementing all of these operations.
-
- In some cases a certain machine may come with GCC installed as cc
- or may have some other compiler. Then it may make sense for tm.h
- to define perform_* only if __GNUC__ is defined. */
-
-#ifndef perform_mulsi3
-#define perform_mulsi3(a, b) return a * b
-#endif
-
-#ifndef perform_divsi3
-#define perform_divsi3(a, b) return a / b
-#endif
-
-#ifndef perform_udivsi3
-#define perform_udivsi3(a, b) return a / b
-#endif
-
-#ifndef perform_modsi3
-#define perform_modsi3(a, b) return a % b
-#endif
-
-#ifndef perform_umodsi3
-#define perform_umodsi3(a, b) return a % b
-#endif
-
-#ifndef perform_lshrsi3
-#define perform_lshrsi3(a, b) return a >> b
-#endif
-
-#ifndef perform_ashrsi3
-#define perform_ashrsi3(a, b) return a >> b
-#endif
-
-#ifndef perform_ashlsi3
-#define perform_ashlsi3(a, b) return a << b
-#endif
-
-#ifndef perform_adddf3
-#define perform_adddf3(a, b) return a + b
-#endif
-
-#ifndef perform_subdf3
-#define perform_subdf3(a, b) return a - b
-#endif
-
-#ifndef perform_muldf3
-#define perform_muldf3(a, b) return a * b
-#endif
-
-#ifndef perform_divdf3
-#define perform_divdf3(a, b) return a / b
-#endif
-
-#ifndef perform_addsf3
-#define perform_addsf3(a, b) return INTIFY (a + b)
-#endif
-
-#ifndef perform_subsf3
-#define perform_subsf3(a, b) return INTIFY (a - b)
-#endif
-
-#ifndef perform_mulsf3
-#define perform_mulsf3(a, b) return INTIFY (a * b)
-#endif
-
-#ifndef perform_divsf3
-#define perform_divsf3(a, b) return INTIFY (a / b)
-#endif
-
-#ifndef perform_negdf2
-#define perform_negdf2(a) return -a
-#endif
-
-#ifndef perform_negsf2
-#define perform_negsf2(a) return INTIFY (-a)
-#endif
-
-#ifndef perform_fixdfsi
-#define perform_fixdfsi(a) return (nongcc_SI_type) a;
-#endif
-
-#ifndef perform_fixsfsi
-#define perform_fixsfsi(a) return (nongcc_SI_type) a
-#endif
-
-#ifndef perform_floatsidf
-#define perform_floatsidf(a) return (double) a
-#endif
-
-#ifndef perform_floatsisf
-#define perform_floatsisf(a) return INTIFY ((float) a)
-#endif
-
-#ifndef perform_extendsfdf2
-#define perform_extendsfdf2(a) return a
-#endif
-
-#ifndef perform_truncdfsf2
-#define perform_truncdfsf2(a) return INTIFY (a)
-#endif
-
-/* Note that eqdf2 returns a value for "true" that is == 0,
- nedf2 returns a value for "true" that is != 0,
- gtdf2 returns a value for "true" that is > 0,
- and so on. */
-
-#ifndef perform_eqdf2
-#define perform_eqdf2(a, b) return !(a == b)
-#endif
-
-#ifndef perform_nedf2
-#define perform_nedf2(a, b) return a != b
-#endif
-
-#ifndef perform_gtdf2
-#define perform_gtdf2(a, b) return a > b
-#endif
-
-#ifndef perform_gedf2
-#define perform_gedf2(a, b) return (a >= b) - 1
-#endif
-
-#ifndef perform_ltdf2
-#define perform_ltdf2(a, b) return -(a < b)
-#endif
-
-#ifndef perform_ledf2
-#define perform_ledf2(a, b) return 1 - (a <= b)
-#endif
-
-#ifndef perform_eqsf2
-#define perform_eqsf2(a, b) return !(a == b)
-#endif
-
-#ifndef perform_nesf2
-#define perform_nesf2(a, b) return a != b
-#endif
-
-#ifndef perform_gtsf2
-#define perform_gtsf2(a, b) return a > b
-#endif
-
-#ifndef perform_gesf2
-#define perform_gesf2(a, b) return (a >= b) - 1
-#endif
-
-#ifndef perform_ltsf2
-#define perform_ltsf2(a, b) return -(a < b)
-#endif
-
-#ifndef perform_lesf2
-#define perform_lesf2(a, b) return 1 - (a <= b);
-#endif
-
-/* Define the C data type to use for an SImode value. */
-
-#ifndef nongcc_SI_type
-#define nongcc_SI_type long int
-#endif
-
-/* Define the C data type to use for a value of word size */
-#ifndef nongcc_word_type
-#define nongcc_word_type nongcc_SI_type
-#endif
-
-/* Define the type to be used for returning an SF mode value
- and the method for turning a float into that type.
- These definitions work for machines where an SF value is
- returned in the same register as an int. */
-
-#ifndef FLOAT_VALUE_TYPE
-#define FLOAT_VALUE_TYPE int
-#endif
-
-#ifndef INTIFY
-#define INTIFY(FLOATVAL) (intify.f = (FLOATVAL), intify.i)
-#endif
-
-#ifndef FLOATIFY
-#define FLOATIFY(INTVAL) ((INTVAL).f)
-#endif
-
-#ifndef FLOAT_ARG_TYPE
-#define FLOAT_ARG_TYPE union flt_or_int
-#endif
-
-union flt_or_value { FLOAT_VALUE_TYPE i; float f; };
-
-union flt_or_int { int i; float f; };
-
-
-#ifdef L_mulsi3
-nongcc_SI_type
-__mulsi3 (a, b)
- nongcc_SI_type a, b;
-{
- perform_mulsi3 (a, b);
-}
-#endif
-
-#ifdef L_udivsi3
-nongcc_SI_type
-__udivsi3 (a, b)
- unsigned nongcc_SI_type a, b;
-{
- perform_udivsi3 (a, b);
-}
-#endif
-
-#ifdef L_divsi3
-nongcc_SI_type
-__divsi3 (a, b)
- nongcc_SI_type a, b;
-{
- perform_divsi3 (a, b);
-}
-#endif
-
-#ifdef L_umodsi3
-nongcc_SI_type
-__umodsi3 (a, b)
- unsigned nongcc_SI_type a, b;
-{
- perform_umodsi3 (a, b);
-}
-#endif
-
-#ifdef L_modsi3
-nongcc_SI_type
-__modsi3 (a, b)
- nongcc_SI_type a, b;
-{
- perform_modsi3 (a, b);
-}
-#endif
-
-#ifdef L_lshrsi3
-nongcc_SI_type
-__lshrsi3 (a, b)
- unsigned nongcc_SI_type a, b;
-{
- perform_lshrsi3 (a, b);
-}
-#endif
-
-#ifdef L_ashrsi3
-nongcc_SI_type
-__ashrsi3 (a, b)
- nongcc_SI_type a, b;
-{
- perform_ashrsi3 (a, b);
-}
-#endif
-
-#ifdef L_ashlsi3
-nongcc_SI_type
-__ashlsi3 (a, b)
- nongcc_SI_type a, b;
-{
- perform_ashlsi3 (a, b);
-}
-#endif
-
-#ifdef L_divdf3
-double
-__divdf3 (a, b)
- double a, b;
-{
- perform_divdf3 (a, b);
-}
-#endif
-
-#ifdef L_muldf3
-double
-__muldf3 (a, b)
- double a, b;
-{
- perform_muldf3 (a, b);
-}
-#endif
-
-#ifdef L_negdf2
-double
-__negdf2 (a)
- double a;
-{
- perform_negdf2 (a);
-}
-#endif
-
-#ifdef L_adddf3
-double
-__adddf3 (a, b)
- double a, b;
-{
- perform_adddf3 (a, b);
-}
-#endif
-
-#ifdef L_subdf3
-double
-__subdf3 (a, b)
- double a, b;
-{
- perform_subdf3 (a, b);
-}
-#endif
-
-/* Note that eqdf2 returns a value for "true" that is == 0,
- nedf2 returns a value for "true" that is != 0,
- gtdf2 returns a value for "true" that is > 0,
- and so on. */
-
-#ifdef L_eqdf2
-nongcc_word_type
-__eqdf2 (a, b)
- double a, b;
-{
- /* Value == 0 iff a == b. */
- perform_eqdf2 (a, b);
-}
-#endif
-
-#ifdef L_nedf2
-nongcc_word_type
-__nedf2 (a, b)
- double a, b;
-{
- /* Value != 0 iff a != b. */
- perform_nedf2 (a, b);
-}
-#endif
-
-#ifdef L_gtdf2
-nongcc_word_type
-__gtdf2 (a, b)
- double a, b;
-{
- /* Value > 0 iff a > b. */
- perform_gtdf2 (a, b);
-}
-#endif
-
-#ifdef L_gedf2
-nongcc_word_type
-__gedf2 (a, b)
- double a, b;
-{
- /* Value >= 0 iff a >= b. */
- perform_gedf2 (a, b);
-}
-#endif
-
-#ifdef L_ltdf2
-nongcc_word_type
-__ltdf2 (a, b)
- double a, b;
-{
- /* Value < 0 iff a < b. */
- perform_ltdf2 (a, b);
-}
-#endif
-
-#ifdef L_ledf2
-nongcc_word_type
-__ledf2 (a, b)
- double a, b;
-{
- /* Value <= 0 iff a <= b. */
- perform_ledf2 (a, b);
-}
-#endif
-
-#ifdef L_fixdfsi
-nongcc_SI_type
-__fixdfsi (a)
- double a;
-{
- perform_fixdfsi (a);
-}
-#endif
-
-#ifdef L_fixsfsi
-nongcc_SI_type
-__fixsfsi (a)
- FLOAT_ARG_TYPE a;
-{
- union flt_or_value intify;
- perform_fixsfsi (FLOATIFY (a));
-}
-#endif
-
-#ifdef L_floatsidf
-double
-__floatsidf (a)
- nongcc_SI_type a;
-{
- perform_floatsidf (a);
-}
-#endif
-
-#ifdef L_floatsisf
-FLOAT_VALUE_TYPE
-__floatsisf (a)
- nongcc_SI_type a;
-{
- union flt_or_value intify;
- perform_floatsisf (a);
-}
-#endif
-
-#ifdef L_addsf3
-FLOAT_VALUE_TYPE
-__addsf3 (a, b)
- FLOAT_ARG_TYPE a, b;
-{
- union flt_or_value intify;
- perform_addsf3 (FLOATIFY (a), FLOATIFY (b));
-}
-#endif
-
-#ifdef L_negsf2
-FLOAT_VALUE_TYPE
-__negsf2 (a)
- FLOAT_ARG_TYPE a;
-{
- union flt_or_value intify;
- perform_negsf2 (FLOATIFY (a));
-}
-#endif
-
-#ifdef L_subsf3
-FLOAT_VALUE_TYPE
-__subsf3 (a, b)
- FLOAT_ARG_TYPE a, b;
-{
- union flt_or_value intify;
- perform_subsf3 (FLOATIFY (a), FLOATIFY (b));
-}
-#endif
-
-#ifdef L_eqsf2
-nongcc_word_type
-__eqsf2 (a, b)
- FLOAT_ARG_TYPE a, b;
-{
- union flt_or_int intify;
- /* Value == 0 iff a == b. */
- perform_eqsf2 (FLOATIFY (a), FLOATIFY (b));
-}
-#endif
-
-#ifdef L_nesf2
-nongcc_word_type
-__nesf2 (a, b)
- FLOAT_ARG_TYPE a, b;
-{
- union flt_or_int intify;
- /* Value != 0 iff a != b. */
- perform_nesf2 (FLOATIFY (a), FLOATIFY (b));
-}
-#endif
-
-#ifdef L_gtsf2
-nongcc_word_type
-__gtsf2 (a, b)
- FLOAT_ARG_TYPE a, b;
-{
- union flt_or_int intify;
- /* Value > 0 iff a > b. */
- perform_gtsf2 (FLOATIFY (a), FLOATIFY (b));
-}
-#endif
-
-#ifdef L_gesf2
-nongcc_word_type
-__gesf2 (a, b)
- FLOAT_ARG_TYPE a, b;
-{
- union flt_or_int intify;
- /* Value >= 0 iff a >= b. */
- perform_gesf2 (FLOATIFY (a), FLOATIFY (b));
-}
-#endif
-
-#ifdef L_ltsf2
-nongcc_word_type
-__ltsf2 (a, b)
- FLOAT_ARG_TYPE a, b;
-{
- union flt_or_int intify;
- /* Value < 0 iff a < b. */
- perform_ltsf2 (FLOATIFY (a), FLOATIFY (b));
-}
-#endif
-
-#ifdef L_lesf2
-nongcc_word_type
-__lesf2 (a, b)
- FLOAT_ARG_TYPE a, b;
-{
- union flt_or_int intify;
- /* Value <= 0 iff a <= b. */
- perform_lesf2 (FLOATIFY (a), FLOATIFY (b));
-}
-#endif
-
-#ifdef L_mulsf3
-FLOAT_VALUE_TYPE
-__mulsf3 (a, b)
- FLOAT_ARG_TYPE a, b;
-{
- union flt_or_value intify;
- perform_mulsf3 (FLOATIFY (a), FLOATIFY (b));
-}
-#endif
-
-#ifdef L_divsf3
-FLOAT_VALUE_TYPE
-__divsf3 (a, b)
- FLOAT_ARG_TYPE a, b;
-{
- union flt_or_value intify;
- perform_divsf3 (FLOATIFY (a), FLOATIFY (b));
-}
-#endif
-
-#ifdef L_truncdfsf2
-FLOAT_VALUE_TYPE
-__truncdfsf2 (a)
- double a;
-{
- union flt_or_value intify;
- perform_truncdfsf2 (a);
-}
-#endif
-
-#ifdef L_extendsfdf2
-double
-__extendsfdf2 (a)
- FLOAT_ARG_TYPE a;
-{
- union flt_or_value intify;
- perform_extendsfdf2 (FLOATIFY (a));
-}
-#endif
diff --git a/contrib/gcc/libiberty.h b/contrib/gcc/libiberty.h
deleted file mode 100644
index cf313662ef42..000000000000
--- a/contrib/gcc/libiberty.h
+++ /dev/null
@@ -1,180 +0,0 @@
-/* Function declarations for libiberty.
- Written by Cygnus Support, 1994.
-
- The libiberty library provides a number of functions which are
- missing on some operating systems. We do not declare those here,
- to avoid conflicts with the system header files on operating
- systems that do support those functions. In this file we only
- declare those functions which are specific to libiberty. */
-
-#ifndef LIBIBERTY_H
-#define LIBIBERTY_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "ansidecl.h"
-
-/* Build an argument vector from a string. Allocates memory using
- malloc. Use freeargv to free the vector. */
-
-extern char **buildargv PARAMS ((char *));
-
-/* Free a vector returned by buildargv. */
-
-extern void freeargv PARAMS ((char **));
-
-/* Duplicate an argument vector. Allocates memory using malloc. Use
- freeargv to free the vector. */
-
-extern char **dupargv PARAMS ((char **));
-
-
-/* Return the last component of a path name. Note that we can't use a
- prototype here because the parameter is declared inconsistently
- across different systems, sometimes as "char *" and sometimes as
- "const char *" */
-
-#if defined (__GNU_LIBRARY__ ) || defined (__linux__) || defined (__FreeBSD__) || defined (__CYGWIN__) || defined (__CYGWIN32__)
-extern char *basename PARAMS ((const char *));
-#else
-extern char *basename ();
-#endif
-
-/* Concatenate an arbitrary number of strings, up to (char *) NULL.
- Allocates memory using xmalloc. */
-
-extern char *concat PARAMS ((const char *, ...));
-
-/* Check whether two file descriptors refer to the same file. */
-
-extern int fdmatch PARAMS ((int fd1, int fd2));
-
-/* Get the amount of time the process has run, in microseconds. */
-
-extern long get_run_time PARAMS ((void));
-
-/* Choose a temporary directory to use for scratch files. */
-
-extern char *choose_temp_base PARAMS ((void));
-
-/* Allocate memory filled with spaces. Allocates using malloc. */
-
-extern const char *spaces PARAMS ((int count));
-
-/* Return the maximum error number for which strerror will return a
- string. */
-
-extern int errno_max PARAMS ((void));
-
-/* Return the name of an errno value (e.g., strerrno (EINVAL) returns
- "EINVAL"). */
-
-extern const char *strerrno PARAMS ((int));
-
-/* Given the name of an errno value, return the value. */
-
-extern int strtoerrno PARAMS ((const char *));
-
-/* ANSI's strerror(), but more robust. */
-
-extern char *xstrerror PARAMS ((int));
-
-/* Return the maximum signal number for which strsignal will return a
- string. */
-
-extern int signo_max PARAMS ((void));
-
-/* Return a signal message string for a signal number
- (e.g., strsignal (SIGHUP) returns something like "Hangup"). */
-/* This is commented out as it can conflict with one in system headers.
- We still document its existence though. */
-
-/*extern const char *strsignal PARAMS ((int));*/
-
-/* Return the name of a signal number (e.g., strsigno (SIGHUP) returns
- "SIGHUP"). */
-
-extern const char *strsigno PARAMS ((int));
-
-/* Given the name of a signal, return its number. */
-
-extern int strtosigno PARAMS ((const char *));
-
-/* Register a function to be run by xexit. Returns 0 on success. */
-
-extern int xatexit PARAMS ((void (*fn) (void)));
-
-/* Exit, calling all the functions registered with xatexit. */
-
-#ifndef __GNUC__
-extern void xexit PARAMS ((int status));
-#else
-void xexit PARAMS ((int status)) __attribute__ ((noreturn));
-#endif
-
-/* Set the program name used by xmalloc. */
-
-extern void xmalloc_set_program_name PARAMS ((const char *));
-
-/* Allocate memory without fail. If malloc fails, this will print a
- message to stderr (using the name set by xmalloc_set_program_name,
- if any) and then call xexit. */
-
-#ifdef ANSI_PROTOTYPES
-/* Get a definition for size_t. */
-#include <stddef.h>
-#endif
-extern PTR xmalloc PARAMS ((size_t));
-
-/* Reallocate memory without fail. This works like xmalloc.
-
- FIXME: We do not declare the parameter types for the same reason as
- xmalloc. */
-
-extern PTR xrealloc PARAMS ((PTR, size_t));
-
-/* Allocate memory without fail and set it to zero. This works like
- xmalloc. */
-
-extern PTR xcalloc PARAMS ((size_t, size_t));
-
-/* Copy a string into a memory buffer without fail. */
-
-extern char *xstrdup PARAMS ((const char *));
-
-/* hex character manipulation routines */
-
-#define _hex_array_size 256
-#define _hex_bad 99
-extern char _hex_value[_hex_array_size];
-extern void hex_init PARAMS ((void));
-#define hex_p(c) (hex_value (c) != _hex_bad)
-/* If you change this, note well: Some code relies on side effects in
- the argument being performed exactly once. */
-#define hex_value(c) (_hex_value[(unsigned char) (c)])
-
-/* Definitions used by the pexecute routine. */
-
-#define PEXECUTE_FIRST 1
-#define PEXECUTE_LAST 2
-#define PEXECUTE_ONE (PEXECUTE_FIRST + PEXECUTE_LAST)
-#define PEXECUTE_SEARCH 4
-#define PEXECUTE_VERBOSE 8
-
-/* Execute a program. */
-
-extern int pexecute PARAMS ((const char *, char * const *, const char *,
- const char *, char **, char **, int));
-
-/* Wait for pexecute to finish. */
-
-extern int pwait PARAMS ((int, int *, int));
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif /* ! defined (LIBIBERTY_H) */
diff --git a/contrib/gcc/listing b/contrib/gcc/listing
deleted file mode 100755
index dc989f6eaef2..000000000000
--- a/contrib/gcc/listing
+++ /dev/null
@@ -1,227 +0,0 @@
-#!/bin/sh -f
-# Generate a source code listing for C or C++ code with assembler code. The
-# listing is always written to stdout.
-# Author: Igor Metz <metz@iam.unibe.ch>
-
-# Revision 1.4 94/08/26 13:58:27 coxs <coxs@dg-rtp.dg.com>
-# lister now guesses how to should be configured. Added elf and coff support.
-#
-# Revision 1.3 89/12/18 13:58:27 metz
-# lister must now be configured before it can be used. This is done in the
-# /bin/sh part of the code.
-#
-#
-# Revision 1.2 89/08/16 17:35:02 metz
-# Support for SPARC added.
-#
-# Revision 1.1 89/08/16 16:49:22 metz
-# Initial revision
-#
-
-# Requires: gawk (may be it works also with nawk)
-
-# usage: lister filename [compiler-options]
-
-# Method:
-# compile the source with -g option to assembler code, then merge the
-# generated assembler code with the source code. Compiler options
-# can be supplied on the command line (for example -O)
-
-# To install lister, assign one of the supported values to the variable MYSYS:
-# mc68020 for Motorola 68020 (Sun-3, ..)
-# mc68030 for Motorola 68030 (Sun-3, ..)
-# sparc for SPARC (SUN-4, ..)
-# i386 for i386 (Sun i386, ...)
-# i386-gnu-linux for i386 (GNU/Linux, ...)
-
-# Guess what kind of objects we are creating and thus what type of assembler
-# symbols to look for
-
-ex /tmp/$$.c <<END >/dev/null
-a
-main (){}
-.
-w
-q
-END
-WD=`pwd`
-cd /tmp
-gcc -c $$.c
-case "`file $$.o`" in
-*ELF*) MYSYS=elf ;;
-*COFF*|*BCS*) MYSYS=coff ;;
-*mc68k*|*M68000*) MYSYS=mc68030 ;;
-*SPARC*) MYSYS=sparc ;;
-*386*) MYSYS=i386 ;;
-esac
-rm $$.c $$.o
-cd $WD
-
-# uncomment the line you need if the above guesses incorrectly:
-# MYSYS=mc68020
-# MYSYS=mc68030
-# MYSYS=sparc
-# MYSYS=i386
-# MYSYS=i386-gnu-linux
-# MYSYS=`mach` # this will work on Suns with SunOS > 4.0.0
-# MYSYS=elf
-# MYSYS=coff
-
-WHOAMI=$0
-if [ $# -gt 0 ] ; then
-FILENAME=$1
-shift
-fi
-
-exec gawk -v whoami=$WHOAMI -vsys=$MYSYS -voptions="$*" '
-# commandline arguments:
-# ARGV[0] = "gawk"
-# ARGV[1] = processid
-# ARGV[2] = filename
-BEGIN {
- if (ARGC != 3) {
- usage()
- exit 1
- }
-
- # Declaration of global variables
- c_filename = ""
- asm_filename = ""
- cmdline = ""
- asm_code = ""
- c_code = ""
- c_lineno = 0
- oldlineno = 0
- newlineno = 0
- ignore_stabd = 0
- num_of_fields = 0
-
- # check processor architecture and set sourcecode line_hint accordingly
- if (sys == "sparc" || sys == "i386") {
- line_hint = "^[ \t]*\.stabn.*"
- line_field = 3;
- line_delimiter = ",";
- line_offset = 0;
- }
- else if (sys == "mc68020" || sys == "mc68030" || sys == "i386-gnu-linux") {
- line_hint = "^[ \t]*\.stabd.*"
- line_field = 3;
- line_delimiter = ",";
- line_offset = 0;
- }
- else if (sys == "elf") {
- line_hint = "section.*\.line"
- line_field = 3;
- line_delimiter = "\t";
- line_offset = 0;
- }
- else if (sys == "coff") {
- line_hint = "^[ \t]*ln"
- line_field = 3;
- line_delimiter = "\t";
- }
- else {
- error("Processor type " sys " is not supported yet, sorry")
- }
-
- parse_cmdline()
-
- printf("compiling %s to asm code\n", c_filename ) > "/dev/stderr"
-
- if (system(cmdline) != 0 ) {
- error("Compilation of " c_filename " failed")
- }
-
- printf("generating listing\n") > "/dev/stderr"
-
-
- while ( getline asm_code < asm_filename > 0 ) {
- if ( (ignore_stabd==0) && (asm_code ~ line_hint)) {
- while ( sys == "elf" && (asm_code !~ "word" && asm_code !~ "byte") &&
- getline asm_code < asm_filename > 0);
- # source line hint found. Split the line into fields separated by commas.
- # num_of_fields is 4 for sparc, 3 for m68k
- num_of_fields = split(asm_code, fields, line_delimiter)
- newlineno = fields[line_field] + line_offset;
-
- if (newlineno > oldlineno) {
- while ( newlineno > c_lineno && getline c_code < c_filename > 0) {
- c_lineno++
- printf("%4d %s\n", c_lineno, c_code)
- }
- oldlineno = newlineno
- }
- }
- else if ( asm_code ~ ".*Ltext[ \t]*$" ) {
- # filename hint found
- if ( match(asm_code, c_filename)) {
- ignore_stabd = 0
- }
- else {
- ignore_stabd = 1
- }
- }
- else if ( sys == "elf" && asm_code ~ "section.*\.debug" ) {
- while ( asm_code !~ "^[ \t]*[.]*previous" &&
- asm_code !~ "\.popsection" &&
- getline asm_code < asm_filename > 0 );
- if ( ! (getline asm_code < asm_filename > 0)) break;
- }
- else if ( sys == "coff" && asm_code ~ "^[ \t]*sdef" ) {
- if ( asm_code ~ "\.bf" ) {
- while ( asm_code !~ "^[ \t]*line" &&
- getline asm_code < asm_filename > 0 ) {
- num_of_fields = split(asm_code, fields, "\t")
- line_offset = fields[line_field] - 1;
- }
- }
- while ( asm_code !~ "^[ \t]*endef" &&
- getline asm_code < asm_filename > 0 ) {
- }
- if ( ! (getline asm_code < asm_filename > 0)) break;
- }
- printf("\t\t\t%s\n", asm_code)
- }
-
- # general cleanup
- system("/bin/rm " asm_filename)
-}
-
-function usage() {
- printf("usage: %s filename compiler-options\n", whoami) > "/dev/stderr"
-}
-
-function error(s) {
- printf("error: %s\n", s) > "/dev/stderr"
- exit 1
-}
-
-function parse_cmdline( i) {
- # construct filenames to use
- asm_filename = "/tmp/lister" ARGV[1] ".s"
- ARGV[1] = ""
- c_filename = ARGV[2]
- ARGV[2] = ""
-
- # construct commandline to use
- if ( match(c_filename, ".C") || match(c_filename, ".cc") ) {
- cmdline = "g++"
- }
- else if (match(c_filename, ".c") || match(c_filename, ".i")) {
- cmdline = "gcc"
- }
- else {
- error("unknown extension for file " c_filename)
- }
-
- cmdline = cmdline " -g -S -o " asm_filename
-
- # now we append the compiler options specified by the user
- cmdline = cmdline " " options
-
- # last but not least: the name of the file to compile
- cmdline = cmdline " " c_filename
-}
-
-' $$ $FILENAME
-
diff --git a/contrib/gcc/makefile.vms b/contrib/gcc/makefile.vms
deleted file mode 100644
index 7f0b7ae309ff..000000000000
--- a/contrib/gcc/makefile.vms
+++ /dev/null
@@ -1,413 +0,0 @@
-#
-# makefile for egcs
-#
-# Created by Klaus K"ampf, kkaempf@progis.de
-#
-
-# choose egcs or dec c
-#CC = gcc
-CC = cc
-
-# With or withou haifa scheduler ?
-#HAIFA=,"HAIFA"
-HAIFA=
-
-PWD=sys$$disk:[]
-RM=delete/nolog
-
-ifeq ($(CC),gcc)
-ifeq ($(ARCH),ALPHA)
-CFLAGS=/define=("HAVE_CONFIG_H=1","USE_COLLECT2" $(HAIFA))
-LIBS=,gnu_cc_library:libgcc.olb/lib,sys$$library:vaxcrtl.olb/lib,gnu_cc_library:crt0.obj
-else
-CFLAGS=/define=("HAVE_CONFIG_H=1","USE_COLLECT2" $(HAIFA))
-LIBS=,gnu_cc_library:libgcc.olb/lib,sys$$library:vaxcrtl.olb/lib
-endif
-LFLAGS=/map/full
-#LFLAGS=
-else
-ifeq ($(ARCH),ALPHA)
-CFLAGS=/names=as_is/float=ieee/noopt/debug/define=("HAVE_CONFIG_H=1","USE_COLLECT2" $(HAIFA))\
-/warning=disable=(missingreturn,implicitfunc,ptrmismatch,undefescap,longextern,duptypespec)
-else
-CFLAGS=/noopt/debug/define=("HAVE_CONFIG_H=1","USE_COLLECT2" $(HAIFA))
-endif
-LFLAGS=/nomap
-LIBS=,sys$$library:vaxcrtl.olb/lib
-endif
-
-BISON = bison
-BISON_FLAGS= /Yacc/Define/Verbose
-RENAME= rename/New_Version
-LINK = link #/noshare/nosysshr
-EDIT = edit
-SEARCH= search
-ABORT = exit %x002C
-echo = write sys$$output
-
-CINCL1 = /Incl=([],[.config])
-CINCL2 = /Incl=([],[.ginclude],[.config])
-CINCL_SUB = /Incl=([],[-],[-.ginclude],[-.config])
-CINCL_CP= /Incl=([],[.config],[.cp],[.cp.inc])
-
-MDFILE = [.config.$(ARCH)]$(ARCH).md
-
-ifeq ($(HAIFA),)
-SCHED=sched
-else
-SCHED=haifa-sched
-endif
-
-GENOBJS=[]rtl.obj,obstack.obj
-
-INDEPOBJS= []toplev.obj,version.obj,tree.obj,print-tree.obj,stor-layout.obj,\
-fold-const.obj,function.obj,stmt.obj,except.obj,expr.obj,calls.obj,expmed.obj,\
-explow.obj,optabs.obj,varasm.obj,rtl.obj,print-rtl.obj,rtlanal.obj,\
-emit-rtl.obj,genrtl.obj,real.obj,regmove.obj,dbxout.obj,sdbout.obj,dwarfout.obj,\
-dwarf2out.obj,xcoffout.obj,bitmap.obj,alias.obj,\
-integrate.obj,jump.obj,cse.obj,loop.obj,unroll.obj,flow.obj,stupid.obj,\
-combine.obj,regclass.obj,local-alloc.obj,global.obj,reload.obj,\
-reload1.obj,caller-save.obj,insn-peep.obj,reorg.obj,$(SCHED).obj,\
-final.obj,recog.obj,reg-stack.obj,insn-opinit.obj,insn-recog.obj,\
-insn-extract.obj,insn-output.obj,insn-emit.obj,\
-profile.obj,insn-attrtab.obj,\
-aux-output.obj,getpwd.obj,convert.obj
-
-CC1OBJS=[]c-parse.obj,c-lang.obj,c-lex.obj,c-pragma.obj,c-decl.obj,\
-c-typeck.obj,c-convert.obj,c-aux-info.obj,c-common.obj,c-iterate.obj,\
-obstack.obj
-
-OBJCOBJS=
-
-# list copied from cc1plus-objs.opt
-
-CC1PLUSOBJS=[.cp]call.obj,[.cp]decl2.obj,\
-[.cp]except.obj,[.cp]pt.obj,\
-[.cp]spew.obj,[.cp]xref.obj,[.cp]class.obj,\
-[.cp]expr.obj,[.cp]lex.obj,\
-[.cp]ptree.obj,[.cp]tree.obj,[.cp]cvt.obj,\
-[.cp]errfn.obj,[.cp]rtti.obj,[.cp]method.obj,\
-[.cp]search.obj,[.cp]typeck.obj,[.cp]decl.obj,\
-[.cp]error.obj,[.cp]friend.obj,[.cp]init.obj,[.cp]parse.obj,\
-[.cp]sig.obj,[.cp]typeck2.obj,[.cp]repo.obj,\
-[.cp]input.obj,\
-[]obstack.obj,\
-[]c-common.obj,[]c-pragma.obj
-
-CCCPOBJS=[]cccp.obj,cexp.obj,version.obj,prefix.obj
-
-ALLOCA=,[]alloca.obj
-
-LIBIBERTY = [-.libiberty]libiberty.olb
-
-CXX_LIB2FUNCS = [.cp]tinfo.obj,[.cp]tinfo2.obj,\
-[.cp]new.obj,[.cp]new1.obj,[.cp]new2.obj,[.cp]exception.obj
-
-.c.obj:
- $(CC) $(CFLAGS) $(CINCL1) $</obj=$@
-
-.cc.obj:
- $(CC)/plus/CPP="-nostdinc++" $(CFLAGS) $(CINCL_CP) $</obj=$@
-
-INSN_INCLUDES=insn-attr.h insn-codes.h insn-config.h insn-flags.h
-
-#
-#
-#
-
-all: cpp.exe cc1.exe float.h limits.h libgcc2.olb
-
-allplus: cc1plus.exe libgccplus.olb
-
-libplus: libgccplus.olb
-
-cc1.exe: $(CC1OBJS) $(ALLOCA) $(INDEPOBJS)
- $(LINK)$(LFLAGS)/exe=$@ version.opt/opt,cc1-objs.opt/Opt,independent.opt/Opt$(ALLOCA)$(LIBS)
-
-cpp.exe: $(CCCPOBJS) $(ALLOCA)
- $(LINK)$(LFLAGS)/exe=$@ $(CCCPOBJS),version.opt/opt$(ALLOCA)$(LIBS)
-
-cc1plus.exe: $(CC1PLUSOBJS) $(ALLOCA) $(INDEPOBJS)
- $(LINK)$(LFLAGS)/exe=$@ version.opt/opt,cc1plus-objs.opt/Opt,independent.opt/Opt$(ALLOCA)$(LIBS)
-
-gcc.exe: gcc.obj version.obj choose-temp.obj pexecute.obj prefix.obj obstack.obj
- $(LINK)$(LFLAGS)/exe=$@ $^$(ALLOCA)$(LIBS)
-
-install: cpp.exe cc1.exe gcc.exe libgcc2.olb
- $(CP) $^ GNU_CC_LIBRARY
-
-installplus: cc1plus.exe libgccplus.olb
- $(CP) $^ GNU_CC_LIBRARY
-
-float.h: enquire.exe
- mcr $(PWD)enquire.exe -f > $@
-
-limits.h: enquire.exe
- mcr $(PWD)enquire.exe -l > $@
-
-enquire.exe: enquire.obj
- $(LINK)$(LFLAGS)/exe=$@ enquire.obj$(ALLOCA)$(LIBS)
-
-libgcc2.olb:
- $$ @make-l2
-
-libgccplus.olb: $(CXX_LIB2FUNCS)
- lib/create libgccplus $(CXX_LIB2FUNCS)
-
-genattr.exe: genattr.obj,$(GENOBJS)$(ALLOCA)
- $(LINK) $(LFLAGS)/exe=$@ $^$(LIBS)
-
-insn-attr.h: genattr.exe $(MDFILE)
- mcr $(PWD)genattr.exe $(MDFILE) > $@
-
-genflags.exe: genflags.obj,$(GENOBJS)$(ALLOCA)
- $(LINK) $(LFLAGS)/exe=$@ $^$(LIBS)
-
-insn-flags.h: genflags.exe $(MDFILE)
- mcr $(PWD)genflags.exe $(MDFILE) > $@
-
-gencodes.exe: gencodes.obj,$(GENOBJS)$(ALLOCA)
- $(LINK) $(LFLAGS)/exe=$@ $^$(LIBS)
-
-insn-codes.h: gencodes.exe $(MDFILE)
- mcr $(PWD)gencodes.exe $(MDFILE) > $@
-
-genconfig.exe: genconfig.obj,$(GENOBJS)$(ALLOCA)
- $(LINK) $(LFLAGS)/exe=$@ $^$(LIBS)
-
-insn-config.h: genconfig.exe $(MDFILE)
- mcr $(PWD)genconfig.exe $(MDFILE) > $@
-
-genpeep.exe: genpeep.obj,$(GENOBJS)$(ALLOCA)
- $(LINK) $(LFLAGS)/exe=$@ $^$(LIBS)
-
-insn-peep.c: genpeep.exe $(MDFILE)
- mcr $(PWD)genpeep.exe $(MDFILE) > $@
-
-genopinit.exe: genopinit.obj,$(GENOBJS)$(ALLOCA)
- $(LINK) $(LFLAGS)/exe=$@ $^$(LIBS)
-
-insn-opinit.c: genopinit.exe $(MDFILE)
- mcr $(PWD)genopinit.exe $(MDFILE) > $@
-
-genrecog.exe: genrecog.obj,$(GENOBJS)$(ALLOCA)
- $(LINK) $(LFLAGS)/exe=$@ $^$(LIBS)
-
-insn-recog.c: genrecog.exe $(MDFILE)
- mcr $(PWD)genrecog.exe $(MDFILE) > $@
-
-genextract.exe: genextract.obj,$(GENOBJS)$(ALLOCA)
- $(LINK) $(LFLAGS)/exe=$@ $^$(LIBS)
-
-insn-extract.c: genextract.exe $(MDFILE)
- mcr $(PWD)genextract.exe $(MDFILE) > $@
-
-genoutput.exe: genoutput.obj,$(GENOBJS)$(ALLOCA)
- $(LINK) $(LFLAGS)/exe=$@ $^$(LIBS)
-
-insn-output.c: genoutput.exe $(MDFILE)
- mcr $(PWD)genoutput.exe $(MDFILE) > $@
-
-genemit.exe: genemit.obj,$(GENOBJS)$(ALLOCA)
- $(LINK) $(LFLAGS)/exe=$@ $^$(LIBS)
-
-insn-emit.c: genemit.exe $(MDFILE)
- mcr $(PWD)genemit.exe $(MDFILE) > $@
-
-genattrtab.exe: genattrtab.obj,rtlanal.obj,$(GENOBJS)$(ALLOCA)
- $(LINK) $(LFLAGS)/exe=$@ $^$(LIBS)
-
-insn-attrtab.c: genattrtab.exe $(MDFILE)
- mcr $(PWD)genattrtab.exe $(MDFILE) > $@
-
-gengenrtl.exe: gengenrtl.obj,obstack.obj,$(ALLOCA)
- $(LINK) $(LFLAGS)/exe=$@ $^$(LIBS)
-
-genrtl.h genrtl.c: gengenrtl.exe
- mcr $(PWD)gengenrtl.exe genrtl.h genrtl.c
-
-cccp.obj: cccp.c config.h
-aux-output.obj: aux-output.c insn-attr.h insn-flags.h insn-config.h
-caller-save.obj: caller-save.c insn-config.h
-calls.obj: calls.c insn-flags.h
-combine.obj: combine.c insn-attr.h insn-flags.h insn-codes.h insn-config.h
-cse.obj: cse.c insn-config.h
-c-decl.obj: c-decl.c expr.h integrate.h insn-codes.h insn-config.h
-c-lex.obj: c-lex.c genrtl.h
-c-typeck.obj: c-typeck.c
-dbxout.obj: dbxout.c insn-config.h
-dwarfout.obj: dwarfout.c insn-config.h
-dwarf2out.obj: dwarf2out.c insn-config.h
-emit-rtl.obj: emit-rtl.c insn-config.h
-except.obj: except.c insn-flags.h insn-codes.h insn-config.h
-explow.obj: explow.c insn-flags.h insn-codes.h insn-config.h
-expmed.obj: expmed.c insn-flags.h insn-codes.h insn-config.h
-expr.obj: expr.c insn-flags.h insn-config.h
-final.obj: final.c tm.h insn-attr.h insn-flags.h insn-codes.h insn-config.h
-flow.obj: flow.c insn-config.h
-function.obj: function.c insn-flags.h insn-codes.h insn-config.h insn-codes.h insn-config.h
-genattrtab.obj: genattrtab.c insn-config.h
-genextract.obj: genextract.c insn-config.h
-global.obj: global.c insn-config.h
-integrate.obj: integrate.c integrate.h insn-flags.h insn-config.h
-jump.obj: jump.c insn-flags.h insn-config.h
-local-alloc.obj: local-alloc.c insn-config.h
-loop.obj: loop.c insn-flags.h insn-config.h
-optabs.obj: optabs.c insn-flags.h insn-codes.h insn-config.h
-print-rtl.obj: print-rtl.c
-profile.obj: profile.c insn-flags.h insn-config.h
-recog.obj: recog.c insn-attr.h insn-flags.h insn-codes.h insn-config.h
-regclass.obj: regclass.c insn-config.h
-reg-stack.obj: reg-stack.c insn-config.h
-reload.obj: reload.c insn-codes.h insn-config.h
-reload1.obj: reload1.c insn-flags.h insn-codes.h insn-config.h
-reorg.obj: reorg.c insn-attr.h insn-flags.h insn-config.h
-sched.obj: sched.c insn-attr.h insn-config.h
-haifa-sched.obj: haifa-sched.c insn-attr.h insn-config.h
-stmt.obj: stmt.c insn-flags.h insn-codes.h insn-config.h
-stor-layout.obj: stor-layout.c
-stupid.obj: stupid.c
-toplev.obj: toplev.c insn-attr.h insn-config.h
-unroll.obj: unroll.c insn-config.h
-
-insn-attrtab.obj: insn-attrtab.c insn-attr.h insn-config.h
-insn-output.obj: insn-output.c insn-attr.h insn-flags.h insn-codes.h
-insn-emit.obj: insn-emit.c insn-flags.h insn-codes.h insn-config.h
-insn-opinit.obj: insn-opinit.c insn-flags.h insn-codes.h insn-config.h
-insn-output.obj: insn-config.h
-insn-recog.obj: insn-config.h
-
-varasm.obj: varasm.c tm.h
-toplev.obj: toplev.c tm.h
-
-cexp.c: cexp.y
- $(BISON) $(BISON_FLAGS)/output=$@ $<
-c-parse.c: c-parse.y
- $(BISON) $(BISON_FLAGS)/output=$@ $<
-[.cp]parse.c: [.cp]parse.y
- $(BISON) $(BISON_FLAGS)/output=$@ $<
-[.cp]parse.h: [.cp]parse.c
- @$(ECHO) "Must copy YYEMPTY from [.cp]parse.c to [.cp]parse.h"
- $$ stop
-aux-output.c: [.config.$(ARCH)]$(ARCH).c
- copy $< $@
-
-expr.h: insn-codes.h
-reload.h: insn-config.h
-integrate.h: insn-config.h
-
-config.h:
- $$ @vmsconfig
-
-cleancccp:
- $$ purge
- $(RM) cccp.obj;,cexp.obj;
- $(RM) cpp.exe;
-
-cleanlib:
- $$ purge
- $(RM) libgcc2.olb;
-
-cleanlibplus:
- $$ purge
- $(RM) [.cp]tinfo.obj;
- $(RM) [.cp]tinfo2.obj;
- $(RM) [.cp]new.obj;
- $(RM) [.cp]new1.obj;
- $(RM) [.cp]new2.obj;
- $(RM) [.cp]exception.obj;
- $(RM) libgccplus.olb;
-
-clean:
- $$ purge
- $$ purge [.cp]
- $(RM) *.obj;*
- $(RM) [.cp]*.obj;*
- $(RM) [.cp]parse.output;*
- $(RM) *.cpp;*
- $(RM) *.s;*
- $(RM) *.rtl;*
- $(RM) a.out;
- $(RM) *.combine;
- $(RM) *.cpp;
- $(RM) *.cse;
- $(RM) *.cse2;
- $(RM) *.dbr;
- $(RM) *.flow;
- $(RM) *.greg;
- $(RM) *.jump;
- $(RM) *.jump2;
- $(RM) *.loop;
- $(RM) *.lreg;
- $(RM) *.rtl;
- $(RM) *.sched;
- $(RM) *.sched2;
- $(RM) *.map;
- $(RM) genattr.exe;,insn-attr.h;
- $(RM) genflags.exe;,insn-flags.h;
- $(RM) gencodes.exe;,insn-codes.h;
- $(RM) genconfig.exe;,insn-config.h;
- $(RM) genpeep.exe;,insn-peep.c;
- $(RM) genopinit.exe;,insn-opinit.c;
- $(RM) genrecog.exe;,insn-recog.c;
- $(RM) genextract.exe;,insn-extract.c;
- $(RM) genoutput.exe;,insn-output.c;
- $(RM) genemit.exe;,insn-emit.c;
- $(RM) genattrtab.exe;,insn-attrtab.c;
- $(RM) gengenrtl.exe;,genrtl.c;,genrtl.h;
- $(RM) cc1.exe;
- $(RM) cpp.exe;
- $(RM) cc1plus.exe;
- $(RM) libgcc2.olb;
- $(RM) libgccplus.olb;
- $(RM) enquire.exe;,float.h;,limits.h;
-#
-# clean everything axpconfig.com creates
-#
-distclean: clean cleancccp
- purge [...]
- $(RM) config.h;
- $(RM) tconfig.h;
- $(RM) hconfig.h;
- $(RM) tm.h;
- $(RM) options.h;
- $(RM) specs.h;
- $(RM) aux-output.c;
-
-[.cp]call.obj: [.cp]call.c
-[.cp]decl2.obj: [.cp]decl2.c
-[.cp]except.obj: [.cp]except.c insn-codes.h insn-flags.h
-[.cp]pt.obj: [.cp]pt.c
-[.cp]spew.obj: [.cp]spew.c
-[.cp]xref.obj: [.cp]xref.c
-[.cp]class.obj: [.cp]class.c
-[.cp]expr.obj: [.cp]expr.c insn-codes.h
-[.cp]lex.obj: [.cp]lex.c [.cp]parse.h
-[.cp]ptree.obj: [.cp]ptree.c
-[.cp]tree.obj: [.cp]tree.c
-[.cp]cvt.obj: [.cp]cvt.c
-[.cp]errfn.obj: [.cp]errfn.c
-[.cp]rtti.obj: [.cp]rtti.c
-[.cp]method.obj: [.cp]method.c insn-codes.h
-[.cp]search.obj: [.cp]search.c
-[.cp]typeck.obj: [.cp]typeck.c
-[.cp]decl.obj: [.cp]decl.c
-[.cp]error.obj: [.cp]error.c
-[.cp]friend.obj: [.cp]friend.c
-[.cp]init.obj: [.cp]init.c
-[.cp]parse.obj: [.cp]parse.c
- $(CC) $(CFLAGS) $(CINCL_CP) $^/obj=$@
-[.cp]sig.obj: [.cp]sig.c
-[.cp]typeck2.obj: [.cp]typeck2.c
-[.cp]repo.obj: [.cp]repo.c
-[.cp]input.obj: [.cp]input.c
- $(TOUCH) $@
-# g++ library
-[.cp]tinfo.obj: [.cp]tinfo.cc
-[.cp]tinfo2.obj: [.cp]tinfo2.cc
-[.cp]new.obj: [.cp]new.cc
-[.cp]new1.obj: [.cp]new1.cc
-[.cp]new2.obj: [.cp]new2.cc
-[.cp]exception.obj: [.cp]exception.cc
-
-#EOF
diff --git a/contrib/gcc/md.texi b/contrib/gcc/md.texi
deleted file mode 100644
index 907df37080e8..000000000000
--- a/contrib/gcc/md.texi
+++ /dev/null
@@ -1,4258 +0,0 @@
-@c Copyright (C) 1988, 89, 92, 93, 94, 96, 1998 Free Software Foundation, Inc.
-@c This is part of the GCC manual.
-@c For copying conditions, see the file gcc.texi.
-
-@ifset INTERNALS
-@node Machine Desc
-@chapter Machine Descriptions
-@cindex machine descriptions
-
-A machine description has two parts: a file of instruction patterns
-(@file{.md} file) and a C header file of macro definitions.
-
-The @file{.md} file for a target machine contains a pattern for each
-instruction that the target machine supports (or at least each instruction
-that is worth telling the compiler about). It may also contain comments.
-A semicolon causes the rest of the line to be a comment, unless the semicolon
-is inside a quoted string.
-
-See the next chapter for information on the C header file.
-
-@menu
-* Patterns:: How to write instruction patterns.
-* Example:: An explained example of a @code{define_insn} pattern.
-* RTL Template:: The RTL template defines what insns match a pattern.
-* Output Template:: The output template says how to make assembler code
- from such an insn.
-* Output Statement:: For more generality, write C code to output
- the assembler code.
-* Constraints:: When not all operands are general operands.
-* Standard Names:: Names mark patterns to use for code generation.
-* Pattern Ordering:: When the order of patterns makes a difference.
-* Dependent Patterns:: Having one pattern may make you need another.
-* Jump Patterns:: Special considerations for patterns for jump insns.
-* Insn Canonicalizations::Canonicalization of Instructions
-* Peephole Definitions::Defining machine-specific peephole optimizations.
-* Expander Definitions::Generating a sequence of several RTL insns
- for a standard operation.
-* Insn Splitting:: Splitting Instructions into Multiple Instructions
-* Insn Attributes:: Specifying the value of attributes for generated insns.
-@end menu
-
-@node Patterns
-@section Everything about Instruction Patterns
-@cindex patterns
-@cindex instruction patterns
-
-@findex define_insn
-Each instruction pattern contains an incomplete RTL expression, with pieces
-to be filled in later, operand constraints that restrict how the pieces can
-be filled in, and an output pattern or C code to generate the assembler
-output, all wrapped up in a @code{define_insn} expression.
-
-A @code{define_insn} is an RTL expression containing four or five operands:
-
-@enumerate
-@item
-An optional name. The presence of a name indicate that this instruction
-pattern can perform a certain standard job for the RTL-generation
-pass of the compiler. This pass knows certain names and will use
-the instruction patterns with those names, if the names are defined
-in the machine description.
-
-The absence of a name is indicated by writing an empty string
-where the name should go. Nameless instruction patterns are never
-used for generating RTL code, but they may permit several simpler insns
-to be combined later on.
-
-Names that are not thus known and used in RTL-generation have no
-effect; they are equivalent to no name at all.
-
-@item
-The @dfn{RTL template} (@pxref{RTL Template}) is a vector of incomplete
-RTL expressions which show what the instruction should look like. It is
-incomplete because it may contain @code{match_operand},
-@code{match_operator}, and @code{match_dup} expressions that stand for
-operands of the instruction.
-
-If the vector has only one element, that element is the template for the
-instruction pattern. If the vector has multiple elements, then the
-instruction pattern is a @code{parallel} expression containing the
-elements described.
-
-@item
-@cindex pattern conditions
-@cindex conditions, in patterns
-A condition. This is a string which contains a C expression that is
-the final test to decide whether an insn body matches this pattern.
-
-@cindex named patterns and conditions
-For a named pattern, the condition (if present) may not depend on
-the data in the insn being matched, but only the target-machine-type
-flags. The compiler needs to test these conditions during
-initialization in order to learn exactly which named instructions are
-available in a particular run.
-
-@findex operands
-For nameless patterns, the condition is applied only when matching an
-individual insn, and only after the insn has matched the pattern's
-recognition template. The insn's operands may be found in the vector
-@code{operands}.
-
-@item
-The @dfn{output template}: a string that says how to output matching
-insns as assembler code. @samp{%} in this string specifies where
-to substitute the value of an operand. @xref{Output Template}.
-
-When simple substitution isn't general enough, you can specify a piece
-of C code to compute the output. @xref{Output Statement}.
-
-@item
-Optionally, a vector containing the values of attributes for insns matching
-this pattern. @xref{Insn Attributes}.
-@end enumerate
-
-@node Example
-@section Example of @code{define_insn}
-@cindex @code{define_insn} example
-
-Here is an actual example of an instruction pattern, for the 68000/68020.
-
-@example
-(define_insn "tstsi"
- [(set (cc0)
- (match_operand:SI 0 "general_operand" "rm"))]
- ""
- "*
-@{ if (TARGET_68020 || ! ADDRESS_REG_P (operands[0]))
- return \"tstl %0\";
- return \"cmpl #0,%0\"; @}")
-@end example
-
-This is an instruction that sets the condition codes based on the value of
-a general operand. It has no condition, so any insn whose RTL description
-has the form shown may be handled according to this pattern. The name
-@samp{tstsi} means ``test a @code{SImode} value'' and tells the RTL generation
-pass that, when it is necessary to test such a value, an insn to do so
-can be constructed using this pattern.
-
-The output control string is a piece of C code which chooses which
-output template to return based on the kind of operand and the specific
-type of CPU for which code is being generated.
-
-@samp{"rm"} is an operand constraint. Its meaning is explained below.
-
-@node RTL Template
-@section RTL Template
-@cindex RTL insn template
-@cindex generating insns
-@cindex insns, generating
-@cindex recognizing insns
-@cindex insns, recognizing
-
-The RTL template is used to define which insns match the particular pattern
-and how to find their operands. For named patterns, the RTL template also
-says how to construct an insn from specified operands.
-
-Construction involves substituting specified operands into a copy of the
-template. Matching involves determining the values that serve as the
-operands in the insn being matched. Both of these activities are
-controlled by special expression types that direct matching and
-substitution of the operands.
-
-@table @code
-@findex match_operand
-@item (match_operand:@var{m} @var{n} @var{predicate} @var{constraint})
-This expression is a placeholder for operand number @var{n} of
-the insn. When constructing an insn, operand number @var{n}
-will be substituted at this point. When matching an insn, whatever
-appears at this position in the insn will be taken as operand
-number @var{n}; but it must satisfy @var{predicate} or this instruction
-pattern will not match at all.
-
-Operand numbers must be chosen consecutively counting from zero in
-each instruction pattern. There may be only one @code{match_operand}
-expression in the pattern for each operand number. Usually operands
-are numbered in the order of appearance in @code{match_operand}
-expressions. In the case of a @code{define_expand}, any operand numbers
-used only in @code{match_dup} expressions have higher values than all
-other operand numbers.
-
-@var{predicate} is a string that is the name of a C function that accepts two
-arguments, an expression and a machine mode. During matching, the
-function will be called with the putative operand as the expression and
-@var{m} as the mode argument (if @var{m} is not specified,
-@code{VOIDmode} will be used, which normally causes @var{predicate} to accept
-any mode). If it returns zero, this instruction pattern fails to match.
-@var{predicate} may be an empty string; then it means no test is to be done
-on the operand, so anything which occurs in this position is valid.
-
-Most of the time, @var{predicate} will reject modes other than @var{m}---but
-not always. For example, the predicate @code{address_operand} uses
-@var{m} as the mode of memory ref that the address should be valid for.
-Many predicates accept @code{const_int} nodes even though their mode is
-@code{VOIDmode}.
-
-@var{constraint} controls reloading and the choice of the best register
-class to use for a value, as explained later (@pxref{Constraints}).
-
-People are often unclear on the difference between the constraint and the
-predicate. The predicate helps decide whether a given insn matches the
-pattern. The constraint plays no role in this decision; instead, it
-controls various decisions in the case of an insn which does match.
-
-@findex general_operand
-On CISC machines, the most common @var{predicate} is
-@code{"general_operand"}. This function checks that the putative
-operand is either a constant, a register or a memory reference, and that
-it is valid for mode @var{m}.
-
-@findex register_operand
-For an operand that must be a register, @var{predicate} should be
-@code{"register_operand"}. Using @code{"general_operand"} would be
-valid, since the reload pass would copy any non-register operands
-through registers, but this would make GNU CC do extra work, it would
-prevent invariant operands (such as constant) from being removed from
-loops, and it would prevent the register allocator from doing the best
-possible job. On RISC machines, it is usually most efficient to allow
-@var{predicate} to accept only objects that the constraints allow.
-
-@findex immediate_operand
-For an operand that must be a constant, you must be sure to either use
-@code{"immediate_operand"} for @var{predicate}, or make the instruction
-pattern's extra condition require a constant, or both. You cannot
-expect the constraints to do this work! If the constraints allow only
-constants, but the predicate allows something else, the compiler will
-crash when that case arises.
-
-@findex match_scratch
-@item (match_scratch:@var{m} @var{n} @var{constraint})
-This expression is also a placeholder for operand number @var{n}
-and indicates that operand must be a @code{scratch} or @code{reg}
-expression.
-
-When matching patterns, this is equivalent to
-
-@smallexample
-(match_operand:@var{m} @var{n} "scratch_operand" @var{pred})
-@end smallexample
-
-but, when generating RTL, it produces a (@code{scratch}:@var{m})
-expression.
-
-If the last few expressions in a @code{parallel} are @code{clobber}
-expressions whose operands are either a hard register or
-@code{match_scratch}, the combiner can add or delete them when
-necessary. @xref{Side Effects}.
-
-@findex match_dup
-@item (match_dup @var{n})
-This expression is also a placeholder for operand number @var{n}.
-It is used when the operand needs to appear more than once in the
-insn.
-
-In construction, @code{match_dup} acts just like @code{match_operand}:
-the operand is substituted into the insn being constructed. But in
-matching, @code{match_dup} behaves differently. It assumes that operand
-number @var{n} has already been determined by a @code{match_operand}
-appearing earlier in the recognition template, and it matches only an
-identical-looking expression.
-
-@findex match_operator
-@item (match_operator:@var{m} @var{n} @var{predicate} [@var{operands}@dots{}])
-This pattern is a kind of placeholder for a variable RTL expression
-code.
-
-When constructing an insn, it stands for an RTL expression whose
-expression code is taken from that of operand @var{n}, and whose
-operands are constructed from the patterns @var{operands}.
-
-When matching an expression, it matches an expression if the function
-@var{predicate} returns nonzero on that expression @emph{and} the
-patterns @var{operands} match the operands of the expression.
-
-Suppose that the function @code{commutative_operator} is defined as
-follows, to match any expression whose operator is one of the
-commutative arithmetic operators of RTL and whose mode is @var{mode}:
-
-@smallexample
-int
-commutative_operator (x, mode)
- rtx x;
- enum machine_mode mode;
-@{
- enum rtx_code code = GET_CODE (x);
- if (GET_MODE (x) != mode)
- return 0;
- return (GET_RTX_CLASS (code) == 'c'
- || code == EQ || code == NE);
-@}
-@end smallexample
-
-Then the following pattern will match any RTL expression consisting
-of a commutative operator applied to two general operands:
-
-@smallexample
-(match_operator:SI 3 "commutative_operator"
- [(match_operand:SI 1 "general_operand" "g")
- (match_operand:SI 2 "general_operand" "g")])
-@end smallexample
-
-Here the vector @code{[@var{operands}@dots{}]} contains two patterns
-because the expressions to be matched all contain two operands.
-
-When this pattern does match, the two operands of the commutative
-operator are recorded as operands 1 and 2 of the insn. (This is done
-by the two instances of @code{match_operand}.) Operand 3 of the insn
-will be the entire commutative expression: use @code{GET_CODE
-(operands[3])} to see which commutative operator was used.
-
-The machine mode @var{m} of @code{match_operator} works like that of
-@code{match_operand}: it is passed as the second argument to the
-predicate function, and that function is solely responsible for
-deciding whether the expression to be matched ``has'' that mode.
-
-When constructing an insn, argument 3 of the gen-function will specify
-the operation (i.e. the expression code) for the expression to be
-made. It should be an RTL expression, whose expression code is copied
-into a new expression whose operands are arguments 1 and 2 of the
-gen-function. The subexpressions of argument 3 are not used;
-only its expression code matters.
-
-When @code{match_operator} is used in a pattern for matching an insn,
-it usually best if the operand number of the @code{match_operator}
-is higher than that of the actual operands of the insn. This improves
-register allocation because the register allocator often looks at
-operands 1 and 2 of insns to see if it can do register tying.
-
-There is no way to specify constraints in @code{match_operator}. The
-operand of the insn which corresponds to the @code{match_operator}
-never has any constraints because it is never reloaded as a whole.
-However, if parts of its @var{operands} are matched by
-@code{match_operand} patterns, those parts may have constraints of
-their own.
-
-@findex match_op_dup
-@item (match_op_dup:@var{m} @var{n}[@var{operands}@dots{}])
-Like @code{match_dup}, except that it applies to operators instead of
-operands. When constructing an insn, operand number @var{n} will be
-substituted at this point. But in matching, @code{match_op_dup} behaves
-differently. It assumes that operand number @var{n} has already been
-determined by a @code{match_operator} appearing earlier in the
-recognition template, and it matches only an identical-looking
-expression.
-
-@findex match_parallel
-@item (match_parallel @var{n} @var{predicate} [@var{subpat}@dots{}])
-This pattern is a placeholder for an insn that consists of a
-@code{parallel} expression with a variable number of elements. This
-expression should only appear at the top level of an insn pattern.
-
-When constructing an insn, operand number @var{n} will be substituted at
-this point. When matching an insn, it matches if the body of the insn
-is a @code{parallel} expression with at least as many elements as the
-vector of @var{subpat} expressions in the @code{match_parallel}, if each
-@var{subpat} matches the corresponding element of the @code{parallel},
-@emph{and} the function @var{predicate} returns nonzero on the
-@code{parallel} that is the body of the insn. It is the responsibility
-of the predicate to validate elements of the @code{parallel} beyond
-those listed in the @code{match_parallel}.@refill
-
-A typical use of @code{match_parallel} is to match load and store
-multiple expressions, which can contain a variable number of elements
-in a @code{parallel}. For example,
-@c the following is *still* going over. need to change the code.
-@c also need to work on grouping of this example. --mew 1feb93
-
-@smallexample
-(define_insn ""
- [(match_parallel 0 "load_multiple_operation"
- [(set (match_operand:SI 1 "gpc_reg_operand" "=r")
- (match_operand:SI 2 "memory_operand" "m"))
- (use (reg:SI 179))
- (clobber (reg:SI 179))])]
- ""
- "loadm 0,0,%1,%2")
-@end smallexample
-
-This example comes from @file{a29k.md}. The function
-@code{load_multiple_operations} is defined in @file{a29k.c} and checks
-that subsequent elements in the @code{parallel} are the same as the
-@code{set} in the pattern, except that they are referencing subsequent
-registers and memory locations.
-
-An insn that matches this pattern might look like:
-
-@smallexample
-(parallel
- [(set (reg:SI 20) (mem:SI (reg:SI 100)))
- (use (reg:SI 179))
- (clobber (reg:SI 179))
- (set (reg:SI 21)
- (mem:SI (plus:SI (reg:SI 100)
- (const_int 4))))
- (set (reg:SI 22)
- (mem:SI (plus:SI (reg:SI 100)
- (const_int 8))))])
-@end smallexample
-
-@findex match_par_dup
-@item (match_par_dup @var{n} [@var{subpat}@dots{}])
-Like @code{match_op_dup}, but for @code{match_parallel} instead of
-@code{match_operator}.
-
-@findex match_insn
-@item (match_insn @var{predicate})
-Match a complete insn. Unlike the other @code{match_*} recognizers,
-@code{match_insn} does not take an operand number.
-
-The machine mode @var{m} of @code{match_insn} works like that of
-@code{match_operand}: it is passed as the second argument to the
-predicate function, and that function is solely responsible for
-deciding whether the expression to be matched ``has'' that mode.
-
-@findex match_insn2
-@item (match_insn2 @var{n} @var{predicate})
-Match a complete insn.
-
-The machine mode @var{m} of @code{match_insn2} works like that of
-@code{match_operand}: it is passed as the second argument to the
-predicate function, and that function is solely responsible for
-deciding whether the expression to be matched ``has'' that mode.
-
-@findex address
-@item (address (match_operand:@var{m} @var{n} "address_operand" ""))
-This complex of expressions is a placeholder for an operand number
-@var{n} in a ``load address'' instruction: an operand which specifies
-a memory location in the usual way, but for which the actual operand
-value used is the address of the location, not the contents of the
-location.
-
-@code{address} expressions never appear in RTL code, only in machine
-descriptions. And they are used only in machine descriptions that do
-not use the operand constraint feature. When operand constraints are
-in use, the letter @samp{p} in the constraint serves this purpose.
-
-@var{m} is the machine mode of the @emph{memory location being
-addressed}, not the machine mode of the address itself. That mode is
-always the same on a given target machine (it is @code{Pmode}, which
-normally is @code{SImode}), so there is no point in mentioning it;
-thus, no machine mode is written in the @code{address} expression. If
-some day support is added for machines in which addresses of different
-kinds of objects appear differently or are used differently (such as
-the PDP-10), different formats would perhaps need different machine
-modes and these modes might be written in the @code{address}
-expression.
-@end table
-
-@node Output Template
-@section Output Templates and Operand Substitution
-@cindex output templates
-@cindex operand substitution
-
-@cindex @samp{%} in template
-@cindex percent sign
-The @dfn{output template} is a string which specifies how to output the
-assembler code for an instruction pattern. Most of the template is a
-fixed string which is output literally. The character @samp{%} is used
-to specify where to substitute an operand; it can also be used to
-identify places where different variants of the assembler require
-different syntax.
-
-In the simplest case, a @samp{%} followed by a digit @var{n} says to output
-operand @var{n} at that point in the string.
-
-@samp{%} followed by a letter and a digit says to output an operand in an
-alternate fashion. Four letters have standard, built-in meanings described
-below. The machine description macro @code{PRINT_OPERAND} can define
-additional letters with nonstandard meanings.
-
-@samp{%c@var{digit}} can be used to substitute an operand that is a
-constant value without the syntax that normally indicates an immediate
-operand.
-
-@samp{%n@var{digit}} is like @samp{%c@var{digit}} except that the value of
-the constant is negated before printing.
-
-@samp{%a@var{digit}} can be used to substitute an operand as if it were a
-memory reference, with the actual operand treated as the address. This may
-be useful when outputting a ``load address'' instruction, because often the
-assembler syntax for such an instruction requires you to write the operand
-as if it were a memory reference.
-
-@samp{%l@var{digit}} is used to substitute a @code{label_ref} into a jump
-instruction.
-
-@samp{%=} outputs a number which is unique to each instruction in the
-entire compilation. This is useful for making local labels to be
-referred to more than once in a single template that generates multiple
-assembler instructions.
-
-@samp{%} followed by a punctuation character specifies a substitution that
-does not use an operand. Only one case is standard: @samp{%%} outputs a
-@samp{%} into the assembler code. Other nonstandard cases can be
-defined in the @code{PRINT_OPERAND} macro. You must also define
-which punctuation characters are valid with the
-@code{PRINT_OPERAND_PUNCT_VALID_P} macro.
-
-@cindex \
-@cindex backslash
-The template may generate multiple assembler instructions. Write the text
-for the instructions, with @samp{\;} between them.
-
-@cindex matching operands
-When the RTL contains two operands which are required by constraint to match
-each other, the output template must refer only to the lower-numbered operand.
-Matching operands are not always identical, and the rest of the compiler
-arranges to put the proper RTL expression for printing into the lower-numbered
-operand.
-
-One use of nonstandard letters or punctuation following @samp{%} is to
-distinguish between different assembler languages for the same machine; for
-example, Motorola syntax versus MIT syntax for the 68000. Motorola syntax
-requires periods in most opcode names, while MIT syntax does not. For
-example, the opcode @samp{movel} in MIT syntax is @samp{move.l} in Motorola
-syntax. The same file of patterns is used for both kinds of output syntax,
-but the character sequence @samp{%.} is used in each place where Motorola
-syntax wants a period. The @code{PRINT_OPERAND} macro for Motorola syntax
-defines the sequence to output a period; the macro for MIT syntax defines
-it to do nothing.
-
-@cindex @code{#} in template
-As a special case, a template consisting of the single character @code{#}
-instructs the compiler to first split the insn, and then output the
-resulting instructions separately. This helps eliminate redundancy in the
-output templates. If you have a @code{define_insn} that needs to emit
-multiple assembler instructions, and there is an matching @code{define_split}
-already defined, then you can simply use @code{#} as the output template
-instead of writing an output template that emits the multiple assembler
-instructions.
-
-If the macro @code{ASSEMBLER_DIALECT} is defined, you can use construct
-of the form @samp{@{option0|option1|option2@}} in the templates. These
-describe multiple variants of assembler language syntax.
-@xref{Instruction Output}.
-
-@node Output Statement
-@section C Statements for Assembler Output
-@cindex output statements
-@cindex C statements for assembler output
-@cindex generating assembler output
-
-Often a single fixed template string cannot produce correct and efficient
-assembler code for all the cases that are recognized by a single
-instruction pattern. For example, the opcodes may depend on the kinds of
-operands; or some unfortunate combinations of operands may require extra
-machine instructions.
-
-If the output control string starts with a @samp{@@}, then it is actually
-a series of templates, each on a separate line. (Blank lines and
-leading spaces and tabs are ignored.) The templates correspond to the
-pattern's constraint alternatives (@pxref{Multi-Alternative}). For example,
-if a target machine has a two-address add instruction @samp{addr} to add
-into a register and another @samp{addm} to add a register to memory, you
-might write this pattern:
-
-@smallexample
-(define_insn "addsi3"
- [(set (match_operand:SI 0 "general_operand" "=r,m")
- (plus:SI (match_operand:SI 1 "general_operand" "0,0")
- (match_operand:SI 2 "general_operand" "g,r")))]
- ""
- "@@
- addr %2,%0
- addm %2,%0")
-@end smallexample
-
-@cindex @code{*} in template
-@cindex asterisk in template
-If the output control string starts with a @samp{*}, then it is not an
-output template but rather a piece of C program that should compute a
-template. It should execute a @code{return} statement to return the
-template-string you want. Most such templates use C string literals, which
-require doublequote characters to delimit them. To include these
-doublequote characters in the string, prefix each one with @samp{\}.
-
-The operands may be found in the array @code{operands}, whose C data type
-is @code{rtx []}.
-
-It is very common to select different ways of generating assembler code
-based on whether an immediate operand is within a certain range. Be
-careful when doing this, because the result of @code{INTVAL} is an
-integer on the host machine. If the host machine has more bits in an
-@code{int} than the target machine has in the mode in which the constant
-will be used, then some of the bits you get from @code{INTVAL} will be
-superfluous. For proper results, you must carefully disregard the
-values of those bits.
-
-@findex output_asm_insn
-It is possible to output an assembler instruction and then go on to output
-or compute more of them, using the subroutine @code{output_asm_insn}. This
-receives two arguments: a template-string and a vector of operands. The
-vector may be @code{operands}, or it may be another array of @code{rtx}
-that you declare locally and initialize yourself.
-
-@findex which_alternative
-When an insn pattern has multiple alternatives in its constraints, often
-the appearance of the assembler code is determined mostly by which alternative
-was matched. When this is so, the C code can test the variable
-@code{which_alternative}, which is the ordinal number of the alternative
-that was actually satisfied (0 for the first, 1 for the second alternative,
-etc.).
-
-For example, suppose there are two opcodes for storing zero, @samp{clrreg}
-for registers and @samp{clrmem} for memory locations. Here is how
-a pattern could use @code{which_alternative} to choose between them:
-
-@smallexample
-(define_insn ""
- [(set (match_operand:SI 0 "general_operand" "=r,m")
- (const_int 0))]
- ""
- "*
- return (which_alternative == 0
- ? \"clrreg %0\" : \"clrmem %0\");
- ")
-@end smallexample
-
-The example above, where the assembler code to generate was
-@emph{solely} determined by the alternative, could also have been specified
-as follows, having the output control string start with a @samp{@@}:
-
-@smallexample
-@group
-(define_insn ""
- [(set (match_operand:SI 0 "general_operand" "=r,m")
- (const_int 0))]
- ""
- "@@
- clrreg %0
- clrmem %0")
-@end group
-@end smallexample
-@end ifset
-
-@c Most of this node appears by itself (in a different place) even
-@c when the INTERNALS flag is clear. Passages that require the full
-@c manual's context are conditionalized to appear only in the full manual.
-@ifset INTERNALS
-@node Constraints
-@section Operand Constraints
-@cindex operand constraints
-@cindex constraints
-
-Each @code{match_operand} in an instruction pattern can specify a
-constraint for the type of operands allowed.
-@end ifset
-@ifclear INTERNALS
-@node Constraints
-@section Constraints for @code{asm} Operands
-@cindex operand constraints, @code{asm}
-@cindex constraints, @code{asm}
-@cindex @code{asm} constraints
-
-Here are specific details on what constraint letters you can use with
-@code{asm} operands.
-@end ifclear
-Constraints can say whether
-an operand may be in a register, and which kinds of register; whether the
-operand can be a memory reference, and which kinds of address; whether the
-operand may be an immediate constant, and which possible values it may
-have. Constraints can also require two operands to match.
-
-@ifset INTERNALS
-@menu
-* Simple Constraints:: Basic use of constraints.
-* Multi-Alternative:: When an insn has two alternative constraint-patterns.
-* Class Preferences:: Constraints guide which hard register to put things in.
-* Modifiers:: More precise control over effects of constraints.
-* Machine Constraints:: Existing constraints for some particular machines.
-* No Constraints:: Describing a clean machine without constraints.
-@end menu
-@end ifset
-
-@ifclear INTERNALS
-@menu
-* Simple Constraints:: Basic use of constraints.
-* Multi-Alternative:: When an insn has two alternative constraint-patterns.
-* Modifiers:: More precise control over effects of constraints.
-* Machine Constraints:: Special constraints for some particular machines.
-@end menu
-@end ifclear
-
-@node Simple Constraints
-@subsection Simple Constraints
-@cindex simple constraints
-
-The simplest kind of constraint is a string full of letters, each of
-which describes one kind of operand that is permitted. Here are
-the letters that are allowed:
-
-@table @asis
-@cindex @samp{m} in constraint
-@cindex memory references in constraints
-@item @samp{m}
-A memory operand is allowed, with any kind of address that the machine
-supports in general.
-
-@cindex offsettable address
-@cindex @samp{o} in constraint
-@item @samp{o}
-A memory operand is allowed, but only if the address is
-@dfn{offsettable}. This means that adding a small integer (actually,
-the width in bytes of the operand, as determined by its machine mode)
-may be added to the address and the result is also a valid memory
-address.
-
-@cindex autoincrement/decrement addressing
-For example, an address which is constant is offsettable; so is an
-address that is the sum of a register and a constant (as long as a
-slightly larger constant is also within the range of address-offsets
-supported by the machine); but an autoincrement or autodecrement
-address is not offsettable. More complicated indirect/indexed
-addresses may or may not be offsettable depending on the other
-addressing modes that the machine supports.
-
-Note that in an output operand which can be matched by another
-operand, the constraint letter @samp{o} is valid only when accompanied
-by both @samp{<} (if the target machine has predecrement addressing)
-and @samp{>} (if the target machine has preincrement addressing).
-
-@cindex @samp{V} in constraint
-@item @samp{V}
-A memory operand that is not offsettable. In other words, anything that
-would fit the @samp{m} constraint but not the @samp{o} constraint.
-
-@cindex @samp{<} in constraint
-@item @samp{<}
-A memory operand with autodecrement addressing (either predecrement or
-postdecrement) is allowed.
-
-@cindex @samp{>} in constraint
-@item @samp{>}
-A memory operand with autoincrement addressing (either preincrement or
-postincrement) is allowed.
-
-@cindex @samp{r} in constraint
-@cindex registers in constraints
-@item @samp{r}
-A register operand is allowed provided that it is in a general
-register.
-
-@cindex @samp{d} in constraint
-@item @samp{d}, @samp{a}, @samp{f}, @dots{}
-Other letters can be defined in machine-dependent fashion to stand for
-particular classes of registers. @samp{d}, @samp{a} and @samp{f} are
-defined on the 68000/68020 to stand for data, address and floating
-point registers.
-
-@cindex constants in constraints
-@cindex @samp{i} in constraint
-@item @samp{i}
-An immediate integer operand (one with constant value) is allowed.
-This includes symbolic constants whose values will be known only at
-assembly time.
-
-@cindex @samp{n} in constraint
-@item @samp{n}
-An immediate integer operand with a known numeric value is allowed.
-Many systems cannot support assembly-time constants for operands less
-than a word wide. Constraints for these operands should use @samp{n}
-rather than @samp{i}.
-
-@cindex @samp{I} in constraint
-@item @samp{I}, @samp{J}, @samp{K}, @dots{} @samp{P}
-Other letters in the range @samp{I} through @samp{P} may be defined in
-a machine-dependent fashion to permit immediate integer operands with
-explicit integer values in specified ranges. For example, on the
-68000, @samp{I} is defined to stand for the range of values 1 to 8.
-This is the range permitted as a shift count in the shift
-instructions.
-
-@cindex @samp{E} in constraint
-@item @samp{E}
-An immediate floating operand (expression code @code{const_double}) is
-allowed, but only if the target floating point format is the same as
-that of the host machine (on which the compiler is running).
-
-@cindex @samp{F} in constraint
-@item @samp{F}
-An immediate floating operand (expression code @code{const_double}) is
-allowed.
-
-@cindex @samp{G} in constraint
-@cindex @samp{H} in constraint
-@item @samp{G}, @samp{H}
-@samp{G} and @samp{H} may be defined in a machine-dependent fashion to
-permit immediate floating operands in particular ranges of values.
-
-@cindex @samp{s} in constraint
-@item @samp{s}
-An immediate integer operand whose value is not an explicit integer is
-allowed.
-
-This might appear strange; if an insn allows a constant operand with a
-value not known at compile time, it certainly must allow any known
-value. So why use @samp{s} instead of @samp{i}? Sometimes it allows
-better code to be generated.
-
-For example, on the 68000 in a fullword instruction it is possible to
-use an immediate operand; but if the immediate value is between -128
-and 127, better code results from loading the value into a register and
-using the register. This is because the load into the register can be
-done with a @samp{moveq} instruction. We arrange for this to happen
-by defining the letter @samp{K} to mean ``any integer outside the
-range -128 to 127'', and then specifying @samp{Ks} in the operand
-constraints.
-
-@cindex @samp{g} in constraint
-@item @samp{g}
-Any register, memory or immediate integer operand is allowed, except for
-registers that are not general registers.
-
-@cindex @samp{X} in constraint
-@item @samp{X}
-@ifset INTERNALS
-Any operand whatsoever is allowed, even if it does not satisfy
-@code{general_operand}. This is normally used in the constraint of
-a @code{match_scratch} when certain alternatives will not actually
-require a scratch register.
-@end ifset
-@ifclear INTERNALS
-Any operand whatsoever is allowed.
-@end ifclear
-
-@cindex @samp{0} in constraint
-@cindex digits in constraint
-@item @samp{0}, @samp{1}, @samp{2}, @dots{} @samp{9}
-An operand that matches the specified operand number is allowed. If a
-digit is used together with letters within the same alternative, the
-digit should come last.
-
-@cindex matching constraint
-@cindex constraint, matching
-This is called a @dfn{matching constraint} and what it really means is
-that the assembler has only a single operand that fills two roles
-@ifset INTERNALS
-considered separate in the RTL insn. For example, an add insn has two
-input operands and one output operand in the RTL, but on most CISC
-@end ifset
-@ifclear INTERNALS
-which @code{asm} distinguishes. For example, an add instruction uses
-two input operands and an output operand, but on most CISC
-@end ifclear
-machines an add instruction really has only two operands, one of them an
-input-output operand:
-
-@smallexample
-addl #35,r12
-@end smallexample
-
-Matching constraints are used in these circumstances.
-More precisely, the two operands that match must include one input-only
-operand and one output-only operand. Moreover, the digit must be a
-smaller number than the number of the operand that uses it in the
-constraint.
-
-@ifset INTERNALS
-For operands to match in a particular case usually means that they
-are identical-looking RTL expressions. But in a few special cases
-specific kinds of dissimilarity are allowed. For example, @code{*x}
-as an input operand will match @code{*x++} as an output operand.
-For proper results in such cases, the output template should always
-use the output-operand's number when printing the operand.
-@end ifset
-
-@cindex load address instruction
-@cindex push address instruction
-@cindex address constraints
-@cindex @samp{p} in constraint
-@item @samp{p}
-An operand that is a valid memory address is allowed. This is
-for ``load address'' and ``push address'' instructions.
-
-@findex address_operand
-@samp{p} in the constraint must be accompanied by @code{address_operand}
-as the predicate in the @code{match_operand}. This predicate interprets
-the mode specified in the @code{match_operand} as the mode of the memory
-reference for which the address would be valid.
-
-@cindex extensible constraints
-@cindex @samp{Q}, in constraint
-@item @samp{Q}, @samp{R}, @samp{S}, @dots{} @samp{U}
-Letters in the range @samp{Q} through @samp{U} may be defined in a
-machine-dependent fashion to stand for arbitrary operand types.
-@ifset INTERNALS
-The machine description macro @code{EXTRA_CONSTRAINT} is passed the
-operand as its first argument and the constraint letter as its
-second operand.
-
-A typical use for this would be to distinguish certain types of
-memory references that affect other insn operands.
-
-Do not define these constraint letters to accept register references
-(@code{reg}); the reload pass does not expect this and would not handle
-it properly.
-@end ifset
-@end table
-
-@ifset INTERNALS
-In order to have valid assembler code, each operand must satisfy
-its constraint. But a failure to do so does not prevent the pattern
-from applying to an insn. Instead, it directs the compiler to modify
-the code so that the constraint will be satisfied. Usually this is
-done by copying an operand into a register.
-
-Contrast, therefore, the two instruction patterns that follow:
-
-@smallexample
-(define_insn ""
- [(set (match_operand:SI 0 "general_operand" "=r")
- (plus:SI (match_dup 0)
- (match_operand:SI 1 "general_operand" "r")))]
- ""
- "@dots{}")
-@end smallexample
-
-@noindent
-which has two operands, one of which must appear in two places, and
-
-@smallexample
-(define_insn ""
- [(set (match_operand:SI 0 "general_operand" "=r")
- (plus:SI (match_operand:SI 1 "general_operand" "0")
- (match_operand:SI 2 "general_operand" "r")))]
- ""
- "@dots{}")
-@end smallexample
-
-@noindent
-which has three operands, two of which are required by a constraint to be
-identical. If we are considering an insn of the form
-
-@smallexample
-(insn @var{n} @var{prev} @var{next}
- (set (reg:SI 3)
- (plus:SI (reg:SI 6) (reg:SI 109)))
- @dots{})
-@end smallexample
-
-@noindent
-the first pattern would not apply at all, because this insn does not
-contain two identical subexpressions in the right place. The pattern would
-say, ``That does not look like an add instruction; try other patterns.''
-The second pattern would say, ``Yes, that's an add instruction, but there
-is something wrong with it.'' It would direct the reload pass of the
-compiler to generate additional insns to make the constraint true. The
-results might look like this:
-
-@smallexample
-(insn @var{n2} @var{prev} @var{n}
- (set (reg:SI 3) (reg:SI 6))
- @dots{})
-
-(insn @var{n} @var{n2} @var{next}
- (set (reg:SI 3)
- (plus:SI (reg:SI 3) (reg:SI 109)))
- @dots{})
-@end smallexample
-
-It is up to you to make sure that each operand, in each pattern, has
-constraints that can handle any RTL expression that could be present for
-that operand. (When multiple alternatives are in use, each pattern must,
-for each possible combination of operand expressions, have at least one
-alternative which can handle that combination of operands.) The
-constraints don't need to @emph{allow} any possible operand---when this is
-the case, they do not constrain---but they must at least point the way to
-reloading any possible operand so that it will fit.
-
-@itemize @bullet
-@item
-If the constraint accepts whatever operands the predicate permits,
-there is no problem: reloading is never necessary for this operand.
-
-For example, an operand whose constraints permit everything except
-registers is safe provided its predicate rejects registers.
-
-An operand whose predicate accepts only constant values is safe
-provided its constraints include the letter @samp{i}. If any possible
-constant value is accepted, then nothing less than @samp{i} will do;
-if the predicate is more selective, then the constraints may also be
-more selective.
-
-@item
-Any operand expression can be reloaded by copying it into a register.
-So if an operand's constraints allow some kind of register, it is
-certain to be safe. It need not permit all classes of registers; the
-compiler knows how to copy a register into another register of the
-proper class in order to make an instruction valid.
-
-@cindex nonoffsettable memory reference
-@cindex memory reference, nonoffsettable
-@item
-A nonoffsettable memory reference can be reloaded by copying the
-address into a register. So if the constraint uses the letter
-@samp{o}, all memory references are taken care of.
-
-@item
-A constant operand can be reloaded by allocating space in memory to
-hold it as preinitialized data. Then the memory reference can be used
-in place of the constant. So if the constraint uses the letters
-@samp{o} or @samp{m}, constant operands are not a problem.
-
-@item
-If the constraint permits a constant and a pseudo register used in an insn
-was not allocated to a hard register and is equivalent to a constant,
-the register will be replaced with the constant. If the predicate does
-not permit a constant and the insn is re-recognized for some reason, the
-compiler will crash. Thus the predicate must always recognize any
-objects allowed by the constraint.
-@end itemize
-
-If the operand's predicate can recognize registers, but the constraint does
-not permit them, it can make the compiler crash. When this operand happens
-to be a register, the reload pass will be stymied, because it does not know
-how to copy a register temporarily into memory.
-
-If the predicate accepts a unary operator, the constraint applies to the
-operand. For example, the MIPS processor at ISA level 3 supports an
-instruction which adds two registers in @code{SImode} to produce a
-@code{DImode} result, but only if the registers are correctly sign
-extended. This predicate for the input operands accepts a
-@code{sign_extend} of an @code{SImode} register. Write the constraint
-to indicate the type of register that is required for the operand of the
-@code{sign_extend}.
-@end ifset
-
-@node Multi-Alternative
-@subsection Multiple Alternative Constraints
-@cindex multiple alternative constraints
-
-Sometimes a single instruction has multiple alternative sets of possible
-operands. For example, on the 68000, a logical-or instruction can combine
-register or an immediate value into memory, or it can combine any kind of
-operand into a register; but it cannot combine one memory location into
-another.
-
-These constraints are represented as multiple alternatives. An alternative
-can be described by a series of letters for each operand. The overall
-constraint for an operand is made from the letters for this operand
-from the first alternative, a comma, the letters for this operand from
-the second alternative, a comma, and so on until the last alternative.
-@ifset INTERNALS
-Here is how it is done for fullword logical-or on the 68000:
-
-@smallexample
-(define_insn "iorsi3"
- [(set (match_operand:SI 0 "general_operand" "=m,d")
- (ior:SI (match_operand:SI 1 "general_operand" "%0,0")
- (match_operand:SI 2 "general_operand" "dKs,dmKs")))]
- @dots{})
-@end smallexample
-
-The first alternative has @samp{m} (memory) for operand 0, @samp{0} for
-operand 1 (meaning it must match operand 0), and @samp{dKs} for operand
-2. The second alternative has @samp{d} (data register) for operand 0,
-@samp{0} for operand 1, and @samp{dmKs} for operand 2. The @samp{=} and
-@samp{%} in the constraints apply to all the alternatives; their
-meaning is explained in the next section (@pxref{Class Preferences}).
-@end ifset
-
-@c FIXME Is this ? and ! stuff of use in asm()? If not, hide unless INTERNAL
-If all the operands fit any one alternative, the instruction is valid.
-Otherwise, for each alternative, the compiler counts how many instructions
-must be added to copy the operands so that that alternative applies.
-The alternative requiring the least copying is chosen. If two alternatives
-need the same amount of copying, the one that comes first is chosen.
-These choices can be altered with the @samp{?} and @samp{!} characters:
-
-@table @code
-@cindex @samp{?} in constraint
-@cindex question mark
-@item ?
-Disparage slightly the alternative that the @samp{?} appears in,
-as a choice when no alternative applies exactly. The compiler regards
-this alternative as one unit more costly for each @samp{?} that appears
-in it.
-
-@cindex @samp{!} in constraint
-@cindex exclamation point
-@item !
-Disparage severely the alternative that the @samp{!} appears in.
-This alternative can still be used if it fits without reloading,
-but if reloading is needed, some other alternative will be used.
-@end table
-
-@ifset INTERNALS
-When an insn pattern has multiple alternatives in its constraints, often
-the appearance of the assembler code is determined mostly by which
-alternative was matched. When this is so, the C code for writing the
-assembler code can use the variable @code{which_alternative}, which is
-the ordinal number of the alternative that was actually satisfied (0 for
-the first, 1 for the second alternative, etc.). @xref{Output Statement}.
-@end ifset
-
-@ifset INTERNALS
-@node Class Preferences
-@subsection Register Class Preferences
-@cindex class preference constraints
-@cindex register class preference constraints
-
-@cindex voting between constraint alternatives
-The operand constraints have another function: they enable the compiler
-to decide which kind of hardware register a pseudo register is best
-allocated to. The compiler examines the constraints that apply to the
-insns that use the pseudo register, looking for the machine-dependent
-letters such as @samp{d} and @samp{a} that specify classes of registers.
-The pseudo register is put in whichever class gets the most ``votes''.
-The constraint letters @samp{g} and @samp{r} also vote: they vote in
-favor of a general register. The machine description says which registers
-are considered general.
-
-Of course, on some machines all registers are equivalent, and no register
-classes are defined. Then none of this complexity is relevant.
-@end ifset
-
-@node Modifiers
-@subsection Constraint Modifier Characters
-@cindex modifiers in constraints
-@cindex constraint modifier characters
-
-@c prevent bad page break with this line
-Here are constraint modifier characters.
-
-@table @samp
-@cindex @samp{=} in constraint
-@item =
-Means that this operand is write-only for this instruction: the previous
-value is discarded and replaced by output data.
-
-@cindex @samp{+} in constraint
-@item +
-Means that this operand is both read and written by the instruction.
-
-When the compiler fixes up the operands to satisfy the constraints,
-it needs to know which operands are inputs to the instruction and
-which are outputs from it. @samp{=} identifies an output; @samp{+}
-identifies an operand that is both input and output; all other operands
-are assumed to be input only.
-
-@cindex @samp{&} in constraint
-@cindex earlyclobber operand
-@item &
-Means (in a particular alternative) that this operand is an
-@dfn{earlyclobber} operand, which is modified before the instruction is
-finished using the input operands. Therefore, this operand may not lie
-in a register that is used as an input operand or as part of any memory
-address.
-
-@samp{&} applies only to the alternative in which it is written. In
-constraints with multiple alternatives, sometimes one alternative
-requires @samp{&} while others do not. See, for example, the
-@samp{movdf} insn of the 68000.
-
-An input operand can be tied to an earlyclobber operand if its only
-use as an input occurs before the early result is written. Adding
-alternatives of this form often allows GCC to produce better code
-when only some of the inputs can be affected by the earlyclobber.
-See, for example, the @samp{mulsi3} insn of the ARM.
-
-@samp{&} does not obviate the need to write @samp{=}.
-
-@cindex @samp{%} in constraint
-@item %
-Declares the instruction to be commutative for this operand and the
-following operand. This means that the compiler may interchange the
-two operands if that is the cheapest way to make all operands fit the
-constraints.
-@ifset INTERNALS
-This is often used in patterns for addition instructions
-that really have only two operands: the result must go in one of the
-arguments. Here for example, is how the 68000 halfword-add
-instruction is defined:
-
-@smallexample
-(define_insn "addhi3"
- [(set (match_operand:HI 0 "general_operand" "=m,r")
- (plus:HI (match_operand:HI 1 "general_operand" "%0,0")
- (match_operand:HI 2 "general_operand" "di,g")))]
- @dots{})
-@end smallexample
-@end ifset
-
-@cindex @samp{#} in constraint
-@item #
-Says that all following characters, up to the next comma, are to be
-ignored as a constraint. They are significant only for choosing
-register preferences.
-
-@ifset INTERNALS
-@cindex @samp{*} in constraint
-@item *
-Says that the following character should be ignored when choosing
-register preferences. @samp{*} has no effect on the meaning of the
-constraint as a constraint, and no effect on reloading.
-
-Here is an example: the 68000 has an instruction to sign-extend a
-halfword in a data register, and can also sign-extend a value by
-copying it into an address register. While either kind of register is
-acceptable, the constraints on an address-register destination are
-less strict, so it is best if register allocation makes an address
-register its goal. Therefore, @samp{*} is used so that the @samp{d}
-constraint letter (for data register) is ignored when computing
-register preferences.
-
-@smallexample
-(define_insn "extendhisi2"
- [(set (match_operand:SI 0 "general_operand" "=*d,a")
- (sign_extend:SI
- (match_operand:HI 1 "general_operand" "0,g")))]
- @dots{})
-@end smallexample
-@end ifset
-@end table
-
-@node Machine Constraints
-@subsection Constraints for Particular Machines
-@cindex machine specific constraints
-@cindex constraints, machine specific
-
-Whenever possible, you should use the general-purpose constraint letters
-in @code{asm} arguments, since they will convey meaning more readily to
-people reading your code. Failing that, use the constraint letters
-that usually have very similar meanings across architectures. The most
-commonly used constraints are @samp{m} and @samp{r} (for memory and
-general-purpose registers respectively; @pxref{Simple Constraints}), and
-@samp{I}, usually the letter indicating the most common
-immediate-constant format.
-
-For each machine architecture, the @file{config/@var{machine}.h} file
-defines additional constraints. These constraints are used by the
-compiler itself for instruction generation, as well as for @code{asm}
-statements; therefore, some of the constraints are not particularly
-interesting for @code{asm}. The constraints are defined through these
-macros:
-
-@table @code
-@item REG_CLASS_FROM_LETTER
-Register class constraints (usually lower case).
-
-@item CONST_OK_FOR_LETTER_P
-Immediate constant constraints, for non-floating point constants of
-word size or smaller precision (usually upper case).
-
-@item CONST_DOUBLE_OK_FOR_LETTER_P
-Immediate constant constraints, for all floating point constants and for
-constants of greater than word size precision (usually upper case).
-
-@item EXTRA_CONSTRAINT
-Special cases of registers or memory. This macro is not required, and
-is only defined for some machines.
-@end table
-
-Inspecting these macro definitions in the compiler source for your
-machine is the best way to be certain you have the right constraints.
-However, here is a summary of the machine-dependent constraints
-available on some particular machines.
-
-@table @emph
-@item ARM family---@file{arm.h}
-@table @code
-@item f
-Floating-point register
-
-@item F
-One of the floating-point constants 0.0, 0.5, 1.0, 2.0, 3.0, 4.0, 5.0
-or 10.0
-
-@item G
-Floating-point constant that would satisfy the constraint @samp{F} if it
-were negated
-
-@item I
-Integer that is valid as an immediate operand in a data processing
-instruction. That is, an integer in the range 0 to 255 rotated by a
-multiple of 2
-
-@item J
-Integer in the range -4095 to 4095
-
-@item K
-Integer that satisfies constraint @samp{I} when inverted (ones complement)
-
-@item L
-Integer that satisfies constraint @samp{I} when negated (twos complement)
-
-@item M
-Integer in the range 0 to 32
-
-@item Q
-A memory reference where the exact address is in a single register
-(`@samp{m}' is preferable for @code{asm} statements)
-
-@item R
-An item in the constant pool
-
-@item S
-A symbol in the text segment of the current file
-@end table
-
-@item AMD 29000 family---@file{a29k.h}
-@table @code
-@item l
-Local register 0
-
-@item b
-Byte Pointer (@samp{BP}) register
-
-@item q
-@samp{Q} register
-
-@item h
-Special purpose register
-
-@item A
-First accumulator register
-
-@item a
-Other accumulator register
-
-@item f
-Floating point register
-
-@item I
-Constant greater than 0, less than 0x100
-
-@item J
-Constant greater than 0, less than 0x10000
-
-@item K
-Constant whose high 24 bits are on (1)
-
-@item L
-16 bit constant whose high 8 bits are on (1)
-
-@item M
-32 bit constant whose high 16 bits are on (1)
-
-@item N
-32 bit negative constant that fits in 8 bits
-
-@item O
-The constant 0x80000000 or, on the 29050, any 32 bit constant
-whose low 16 bits are 0.
-
-@item P
-16 bit negative constant that fits in 8 bits
-
-@item G
-@itemx H
-A floating point constant (in @code{asm} statements, use the machine
-independent @samp{E} or @samp{F} instead)
-@end table
-
-@item IBM RS6000---@file{rs6000.h}
-@table @code
-@item b
-Address base register
-
-@item f
-Floating point register
-
-@item h
-@samp{MQ}, @samp{CTR}, or @samp{LINK} register
-
-@item q
-@samp{MQ} register
-
-@item c
-@samp{CTR} register
-
-@item l
-@samp{LINK} register
-
-@item x
-@samp{CR} register (condition register) number 0
-
-@item y
-@samp{CR} register (condition register)
-
-@item z
-@samp{FPMEM} stack memory for FPR-GPR transfers
-
-@item I
-Signed 16 bit constant
-
-@item J
-Constant whose low 16 bits are 0
-
-@item K
-Constant whose high 16 bits are 0
-
-@item L
-Constant suitable as a mask operand
-
-@item M
-Constant larger than 31
-
-@item N
-Exact power of 2
-
-@item O
-Zero
-
-@item P
-Constant whose negation is a signed 16 bit constant
-
-@item G
-Floating point constant that can be loaded into a register with one
-instruction per word
-
-@item Q
-Memory operand that is an offset from a register (@samp{m} is preferable
-for @code{asm} statements)
-
-@item R
-AIX TOC entry
-
-@item S
-Constant suitable as a 64-bit mask operand
-
-@item U
-System V Release 4 small data area reference
-@end table
-
-@item Intel 386---@file{i386.h}
-@table @code
-@item q
-@samp{a}, @code{b}, @code{c}, or @code{d} register
-
-@item A
-@samp{a}, or @code{d} register (for 64-bit ints)
-
-@item f
-Floating point register
-
-@item t
-First (top of stack) floating point register
-
-@item u
-Second floating point register
-
-@item a
-@samp{a} register
-
-@item b
-@samp{b} register
-
-@item c
-@samp{c} register
-
-@item d
-@samp{d} register
-
-@item D
-@samp{di} register
-
-@item S
-@samp{si} register
-
-@item I
-Constant in range 0 to 31 (for 32 bit shifts)
-
-@item J
-Constant in range 0 to 63 (for 64 bit shifts)
-
-@item K
-@samp{0xff}
-
-@item L
-@samp{0xffff}
-
-@item M
-0, 1, 2, or 3 (shifts for @code{lea} instruction)
-
-@item N
-Constant in range 0 to 255 (for @code{out} instruction)
-
-@item G
-Standard 80387 floating point constant
-@end table
-
-@item Intel 960---@file{i960.h}
-@table @code
-@item f
-Floating point register (@code{fp0} to @code{fp3})
-
-@item l
-Local register (@code{r0} to @code{r15})
-
-@item b
-Global register (@code{g0} to @code{g15})
-
-@item d
-Any local or global register
-
-@item I
-Integers from 0 to 31
-
-@item J
-0
-
-@item K
-Integers from -31 to 0
-
-@item G
-Floating point 0
-
-@item H
-Floating point 1
-@end table
-
-@item MIPS---@file{mips.h}
-@table @code
-@item d
-General-purpose integer register
-
-@item f
-Floating-point register (if available)
-
-@item h
-@samp{Hi} register
-
-@item l
-@samp{Lo} register
-
-@item x
-@samp{Hi} or @samp{Lo} register
-
-@item y
-General-purpose integer register
-
-@item z
-Floating-point status register
-
-@item I
-Signed 16 bit constant (for arithmetic instructions)
-
-@item J
-Zero
-
-@item K
-Zero-extended 16-bit constant (for logic instructions)
-
-@item L
-Constant with low 16 bits zero (can be loaded with @code{lui})
-
-@item M
-32 bit constant which requires two instructions to load (a constant
-which is not @samp{I}, @samp{K}, or @samp{L})
-
-@item N
-Negative 16 bit constant
-
-@item O
-Exact power of two
-
-@item P
-Positive 16 bit constant
-
-@item G
-Floating point zero
-
-@item Q
-Memory reference that can be loaded with more than one instruction
-(@samp{m} is preferable for @code{asm} statements)
-
-@item R
-Memory reference that can be loaded with one instruction
-(@samp{m} is preferable for @code{asm} statements)
-
-@item S
-Memory reference in external OSF/rose PIC format
-(@samp{m} is preferable for @code{asm} statements)
-@end table
-
-@item Motorola 680x0---@file{m68k.h}
-@table @code
-@item a
-Address register
-
-@item d
-Data register
-
-@item f
-68881 floating-point register, if available
-
-@item x
-Sun FPA (floating-point) register, if available
-
-@item y
-First 16 Sun FPA registers, if available
-
-@item I
-Integer in the range 1 to 8
-
-@item J
-16 bit signed number
-
-@item K
-Signed number whose magnitude is greater than 0x80
-
-@item L
-Integer in the range -8 to -1
-
-@item M
-Signed number whose magnitude is greater than 0x100
-
-@item G
-Floating point constant that is not a 68881 constant
-
-@item H
-Floating point constant that can be used by Sun FPA
-@end table
-
-@need 1000
-@item SPARC---@file{sparc.h}
-@table @code
-@item f
-Floating-point register that can hold 32 or 64 bit values.
-
-@item e
-Floating-point register that can hold 64 or 128 bit values.
-
-@item I
-Signed 13 bit constant
-
-@item J
-Zero
-
-@item K
-32 bit constant with the low 12 bits clear (a constant that can be
-loaded with the @code{sethi} instruction)
-
-@item G
-Floating-point zero
-
-@item H
-Signed 13 bit constant, sign-extended to 32 or 64 bits
-
-@item Q
-Memory reference that can be loaded with one instruction (@samp{m} is
-more appropriate for @code{asm} statements)
-
-@item S
-Constant, or memory address
-
-@item T
-Memory address aligned to an 8-byte boundary
-
-@item U
-Even register
-@end table
-@end table
-
-@ifset INTERNALS
-@node No Constraints
-@subsection Not Using Constraints
-@cindex no constraints
-@cindex not using constraints
-
-Some machines are so clean that operand constraints are not required. For
-example, on the Vax, an operand valid in one context is valid in any other
-context. On such a machine, every operand constraint would be @samp{g},
-excepting only operands of ``load address'' instructions which are
-written as if they referred to a memory location's contents but actual
-refer to its address. They would have constraint @samp{p}.
-
-@cindex empty constraints
-For such machines, instead of writing @samp{g} and @samp{p} for all
-the constraints, you can choose to write a description with empty constraints.
-Then you write @samp{""} for the constraint in every @code{match_operand}.
-Address operands are identified by writing an @code{address} expression
-around the @code{match_operand}, not by their constraints.
-
-When the machine description has just empty constraints, certain parts
-of compilation are skipped, making the compiler faster. However,
-few machines actually do not need constraints; all machine descriptions
-now in existence use constraints.
-@end ifset
-
-@ifset INTERNALS
-@node Standard Names
-@section Standard Pattern Names For Generation
-@cindex standard pattern names
-@cindex pattern names
-@cindex names, pattern
-
-Here is a table of the instruction names that are meaningful in the RTL
-generation pass of the compiler. Giving one of these names to an
-instruction pattern tells the RTL generation pass that it can use the
-pattern to accomplish a certain task.
-
-@table @asis
-@cindex @code{mov@var{m}} instruction pattern
-@item @samp{mov@var{m}}
-Here @var{m} stands for a two-letter machine mode name, in lower case.
-This instruction pattern moves data with that machine mode from operand
-1 to operand 0. For example, @samp{movsi} moves full-word data.
-
-If operand 0 is a @code{subreg} with mode @var{m} of a register whose
-own mode is wider than @var{m}, the effect of this instruction is
-to store the specified value in the part of the register that corresponds
-to mode @var{m}. The effect on the rest of the register is undefined.
-
-This class of patterns is special in several ways. First of all, each
-of these names @emph{must} be defined, because there is no other way
-to copy a datum from one place to another.
-
-Second, these patterns are not used solely in the RTL generation pass.
-Even the reload pass can generate move insns to copy values from stack
-slots into temporary registers. When it does so, one of the operands is
-a hard register and the other is an operand that can need to be reloaded
-into a register.
-
-@findex force_reg
-Therefore, when given such a pair of operands, the pattern must generate
-RTL which needs no reloading and needs no temporary registers---no
-registers other than the operands. For example, if you support the
-pattern with a @code{define_expand}, then in such a case the
-@code{define_expand} mustn't call @code{force_reg} or any other such
-function which might generate new pseudo registers.
-
-This requirement exists even for subword modes on a RISC machine where
-fetching those modes from memory normally requires several insns and
-some temporary registers. Look in @file{spur.md} to see how the
-requirement can be satisfied.
-
-@findex change_address
-During reload a memory reference with an invalid address may be passed
-as an operand. Such an address will be replaced with a valid address
-later in the reload pass. In this case, nothing may be done with the
-address except to use it as it stands. If it is copied, it will not be
-replaced with a valid address. No attempt should be made to make such
-an address into a valid address and no routine (such as
-@code{change_address}) that will do so may be called. Note that
-@code{general_operand} will fail when applied to such an address.
-
-@findex reload_in_progress
-The global variable @code{reload_in_progress} (which must be explicitly
-declared if required) can be used to determine whether such special
-handling is required.
-
-The variety of operands that have reloads depends on the rest of the
-machine description, but typically on a RISC machine these can only be
-pseudo registers that did not get hard registers, while on other
-machines explicit memory references will get optional reloads.
-
-If a scratch register is required to move an object to or from memory,
-it can be allocated using @code{gen_reg_rtx} prior to life analysis.
-
-If there are cases needing
-scratch registers after reload, you must define
-@code{SECONDARY_INPUT_RELOAD_CLASS} and perhaps also
-@code{SECONDARY_OUTPUT_RELOAD_CLASS} to detect them, and provide
-patterns @samp{reload_in@var{m}} or @samp{reload_out@var{m}} to handle
-them. @xref{Register Classes}.
-
-@findex no_new_pseudos
-The global variable @code{no_new_pseudos} can be used to determine if it
-is unsafe to create new pseudo registers. If this variable is nonzero, then
-it is unsafe to call @code{gen_reg_rtx} to allocate a new pseudo.
-
-The constraints on a @samp{mov@var{m}} must permit moving any hard
-register to any other hard register provided that
-@code{HARD_REGNO_MODE_OK} permits mode @var{m} in both registers and
-@code{REGISTER_MOVE_COST} applied to their classes returns a value of 2.
-
-It is obligatory to support floating point @samp{mov@var{m}}
-instructions into and out of any registers that can hold fixed point
-values, because unions and structures (which have modes @code{SImode} or
-@code{DImode}) can be in those registers and they may have floating
-point members.
-
-There may also be a need to support fixed point @samp{mov@var{m}}
-instructions in and out of floating point registers. Unfortunately, I
-have forgotten why this was so, and I don't know whether it is still
-true. If @code{HARD_REGNO_MODE_OK} rejects fixed point values in
-floating point registers, then the constraints of the fixed point
-@samp{mov@var{m}} instructions must be designed to avoid ever trying to
-reload into a floating point register.
-
-@cindex @code{reload_in} instruction pattern
-@cindex @code{reload_out} instruction pattern
-@item @samp{reload_in@var{m}}
-@itemx @samp{reload_out@var{m}}
-Like @samp{mov@var{m}}, but used when a scratch register is required to
-move between operand 0 and operand 1. Operand 2 describes the scratch
-register. See the discussion of the @code{SECONDARY_RELOAD_CLASS}
-macro in @pxref{Register Classes}.
-
-@cindex @code{movstrict@var{m}} instruction pattern
-@item @samp{movstrict@var{m}}
-Like @samp{mov@var{m}} except that if operand 0 is a @code{subreg}
-with mode @var{m} of a register whose natural mode is wider,
-the @samp{movstrict@var{m}} instruction is guaranteed not to alter
-any of the register except the part which belongs to mode @var{m}.
-
-@cindex @code{load_multiple} instruction pattern
-@item @samp{load_multiple}
-Load several consecutive memory locations into consecutive registers.
-Operand 0 is the first of the consecutive registers, operand 1
-is the first memory location, and operand 2 is a constant: the
-number of consecutive registers.
-
-Define this only if the target machine really has such an instruction;
-do not define this if the most efficient way of loading consecutive
-registers from memory is to do them one at a time.
-
-On some machines, there are restrictions as to which consecutive
-registers can be stored into memory, such as particular starting or
-ending register numbers or only a range of valid counts. For those
-machines, use a @code{define_expand} (@pxref{Expander Definitions})
-and make the pattern fail if the restrictions are not met.
-
-Write the generated insn as a @code{parallel} with elements being a
-@code{set} of one register from the appropriate memory location (you may
-also need @code{use} or @code{clobber} elements). Use a
-@code{match_parallel} (@pxref{RTL Template}) to recognize the insn. See
-@file{a29k.md} and @file{rs6000.md} for examples of the use of this insn
-pattern.
-
-@cindex @samp{store_multiple} instruction pattern
-@item @samp{store_multiple}
-Similar to @samp{load_multiple}, but store several consecutive registers
-into consecutive memory locations. Operand 0 is the first of the
-consecutive memory locations, operand 1 is the first register, and
-operand 2 is a constant: the number of consecutive registers.
-
-@cindex @code{add@var{m}3} instruction pattern
-@item @samp{add@var{m}3}
-Add operand 2 and operand 1, storing the result in operand 0. All operands
-must have mode @var{m}. This can be used even on two-address machines, by
-means of constraints requiring operands 1 and 0 to be the same location.
-
-@cindex @code{sub@var{m}3} instruction pattern
-@cindex @code{mul@var{m}3} instruction pattern
-@cindex @code{div@var{m}3} instruction pattern
-@cindex @code{udiv@var{m}3} instruction pattern
-@cindex @code{mod@var{m}3} instruction pattern
-@cindex @code{umod@var{m}3} instruction pattern
-@cindex @code{smin@var{m}3} instruction pattern
-@cindex @code{smax@var{m}3} instruction pattern
-@cindex @code{umin@var{m}3} instruction pattern
-@cindex @code{umax@var{m}3} instruction pattern
-@cindex @code{and@var{m}3} instruction pattern
-@cindex @code{ior@var{m}3} instruction pattern
-@cindex @code{xor@var{m}3} instruction pattern
-@item @samp{sub@var{m}3}, @samp{mul@var{m}3}
-@itemx @samp{div@var{m}3}, @samp{udiv@var{m}3}, @samp{mod@var{m}3}, @samp{umod@var{m}3}
-@itemx @samp{smin@var{m}3}, @samp{smax@var{m}3}, @samp{umin@var{m}3}, @samp{umax@var{m}3}
-@itemx @samp{and@var{m}3}, @samp{ior@var{m}3}, @samp{xor@var{m}3}
-Similar, for other arithmetic operations.
-
-@cindex @code{mulhisi3} instruction pattern
-@item @samp{mulhisi3}
-Multiply operands 1 and 2, which have mode @code{HImode}, and store
-a @code{SImode} product in operand 0.
-
-@cindex @code{mulqihi3} instruction pattern
-@cindex @code{mulsidi3} instruction pattern
-@item @samp{mulqihi3}, @samp{mulsidi3}
-Similar widening-multiplication instructions of other widths.
-
-@cindex @code{umulqihi3} instruction pattern
-@cindex @code{umulhisi3} instruction pattern
-@cindex @code{umulsidi3} instruction pattern
-@item @samp{umulqihi3}, @samp{umulhisi3}, @samp{umulsidi3}
-Similar widening-multiplication instructions that do unsigned
-multiplication.
-
-@cindex @code{smul@var{m}3_highpart} instruction pattern
-@item @samp{mul@var{m}3_highpart}
-Perform a signed multiplication of operands 1 and 2, which have mode
-@var{m}, and store the most significant half of the product in operand 0.
-The least significant half of the product is discarded.
-
-@cindex @code{umul@var{m}3_highpart} instruction pattern
-@item @samp{umul@var{m}3_highpart}
-Similar, but the multiplication is unsigned.
-
-@cindex @code{divmod@var{m}4} instruction pattern
-@item @samp{divmod@var{m}4}
-Signed division that produces both a quotient and a remainder.
-Operand 1 is divided by operand 2 to produce a quotient stored
-in operand 0 and a remainder stored in operand 3.
-
-For machines with an instruction that produces both a quotient and a
-remainder, provide a pattern for @samp{divmod@var{m}4} but do not
-provide patterns for @samp{div@var{m}3} and @samp{mod@var{m}3}. This
-allows optimization in the relatively common case when both the quotient
-and remainder are computed.
-
-If an instruction that just produces a quotient or just a remainder
-exists and is more efficient than the instruction that produces both,
-write the output routine of @samp{divmod@var{m}4} to call
-@code{find_reg_note} and look for a @code{REG_UNUSED} note on the
-quotient or remainder and generate the appropriate instruction.
-
-@cindex @code{udivmod@var{m}4} instruction pattern
-@item @samp{udivmod@var{m}4}
-Similar, but does unsigned division.
-
-@cindex @code{ashl@var{m}3} instruction pattern
-@item @samp{ashl@var{m}3}
-Arithmetic-shift operand 1 left by a number of bits specified by operand
-2, and store the result in operand 0. Here @var{m} is the mode of
-operand 0 and operand 1; operand 2's mode is specified by the
-instruction pattern, and the compiler will convert the operand to that
-mode before generating the instruction.
-
-@cindex @code{ashr@var{m}3} instruction pattern
-@cindex @code{lshr@var{m}3} instruction pattern
-@cindex @code{rotl@var{m}3} instruction pattern
-@cindex @code{rotr@var{m}3} instruction pattern
-@item @samp{ashr@var{m}3}, @samp{lshr@var{m}3}, @samp{rotl@var{m}3}, @samp{rotr@var{m}3}
-Other shift and rotate instructions, analogous to the
-@code{ashl@var{m}3} instructions.
-
-@cindex @code{neg@var{m}2} instruction pattern
-@item @samp{neg@var{m}2}
-Negate operand 1 and store the result in operand 0.
-
-@cindex @code{abs@var{m}2} instruction pattern
-@item @samp{abs@var{m}2}
-Store the absolute value of operand 1 into operand 0.
-
-@cindex @code{sqrt@var{m}2} instruction pattern
-@item @samp{sqrt@var{m}2}
-Store the square root of operand 1 into operand 0.
-
-The @code{sqrt} built-in function of C always uses the mode which
-corresponds to the C data type @code{double}.
-
-@cindex @code{ffs@var{m}2} instruction pattern
-@item @samp{ffs@var{m}2}
-Store into operand 0 one plus the index of the least significant 1-bit
-of operand 1. If operand 1 is zero, store zero. @var{m} is the mode
-of operand 0; operand 1's mode is specified by the instruction
-pattern, and the compiler will convert the operand to that mode before
-generating the instruction.
-
-The @code{ffs} built-in function of C always uses the mode which
-corresponds to the C data type @code{int}.
-
-@cindex @code{one_cmpl@var{m}2} instruction pattern
-@item @samp{one_cmpl@var{m}2}
-Store the bitwise-complement of operand 1 into operand 0.
-
-@cindex @code{cmp@var{m}} instruction pattern
-@item @samp{cmp@var{m}}
-Compare operand 0 and operand 1, and set the condition codes.
-The RTL pattern should look like this:
-
-@smallexample
-(set (cc0) (compare (match_operand:@var{m} 0 @dots{})
- (match_operand:@var{m} 1 @dots{})))
-@end smallexample
-
-@cindex @code{tst@var{m}} instruction pattern
-@item @samp{tst@var{m}}
-Compare operand 0 against zero, and set the condition codes.
-The RTL pattern should look like this:
-
-@smallexample
-(set (cc0) (match_operand:@var{m} 0 @dots{}))
-@end smallexample
-
-@samp{tst@var{m}} patterns should not be defined for machines that do
-not use @code{(cc0)}. Doing so would confuse the optimizer since it
-would no longer be clear which @code{set} operations were comparisons.
-The @samp{cmp@var{m}} patterns should be used instead.
-
-@cindex @code{movstr@var{m}} instruction pattern
-@item @samp{movstr@var{m}}
-Block move instruction. The addresses of the destination and source
-strings are the first two operands, and both are in mode @code{Pmode}.
-
-The number of bytes to move is the third operand, in mode @var{m}.
-Usually, you specify @code{word_mode} for @var{m}. However, if you can
-generate better code knowing the range of valid lengths is smaller than
-those representable in a full word, you should provide a pattern with a
-mode corresponding to the range of values you can handle efficiently
-(e.g., @code{QImode} for values in the range 0--127; note we avoid numbers
-that appear negative) and also a pattern with @code{word_mode}.
-
-The fourth operand is the known shared alignment of the source and
-destination, in the form of a @code{const_int} rtx. Thus, if the
-compiler knows that both source and destination are word-aligned,
-it may provide the value 4 for this operand.
-
-Descriptions of multiple @code{movstr@var{m}} patterns can only be
-beneficial if the patterns for smaller modes have fewer restrictions
-on their first, second and fourth operands. Note that the mode @var{m}
-in @code{movstr@var{m}} does not impose any restriction on the mode of
-individually moved data units in the block.
-
-These patterns need not give special consideration to the possibility
-that the source and destination strings might overlap.
-
-@cindex @code{clrstr@var{m}} instruction pattern
-@item @samp{clrstr@var{m}}
-Block clear instruction. The addresses of the destination string is the
-first operand, in mode @code{Pmode}. The number of bytes to clear is
-the second operand, in mode @var{m}. See @samp{movstr@var{m}} for
-a discussion of the choice of mode.
-
-The third operand is the known alignment of the destination, in the form
-of a @code{const_int} rtx. Thus, if the compiler knows that the
-destination is word-aligned, it may provide the value 4 for this
-operand.
-
-The use for multiple @code{clrstr@var{m}} is as for @code{movstr@var{m}}.
-
-@cindex @code{cmpstr@var{m}} instruction pattern
-@item @samp{cmpstr@var{m}}
-Block compare instruction, with five operands. Operand 0 is the output;
-it has mode @var{m}. The remaining four operands are like the operands
-of @samp{movstr@var{m}}. The two memory blocks specified are compared
-byte by byte in lexicographic order. The effect of the instruction is
-to store a value in operand 0 whose sign indicates the result of the
-comparison.
-
-@cindex @code{strlen@var{m}} instruction pattern
-@item @samp{strlen@var{m}}
-Compute the length of a string, with three operands.
-Operand 0 is the result (of mode @var{m}), operand 1 is
-a @code{mem} referring to the first character of the string,
-operand 2 is the character to search for (normally zero),
-and operand 3 is a constant describing the known alignment
-of the beginning of the string.
-
-@cindex @code{float@var{mn}2} instruction pattern
-@item @samp{float@var{m}@var{n}2}
-Convert signed integer operand 1 (valid for fixed point mode @var{m}) to
-floating point mode @var{n} and store in operand 0 (which has mode
-@var{n}).
-
-@cindex @code{floatuns@var{mn}2} instruction pattern
-@item @samp{floatuns@var{m}@var{n}2}
-Convert unsigned integer operand 1 (valid for fixed point mode @var{m})
-to floating point mode @var{n} and store in operand 0 (which has mode
-@var{n}).
-
-@cindex @code{fix@var{mn}2} instruction pattern
-@item @samp{fix@var{m}@var{n}2}
-Convert operand 1 (valid for floating point mode @var{m}) to fixed
-point mode @var{n} as a signed number and store in operand 0 (which
-has mode @var{n}). This instruction's result is defined only when
-the value of operand 1 is an integer.
-
-@cindex @code{fixuns@var{mn}2} instruction pattern
-@item @samp{fixuns@var{m}@var{n}2}
-Convert operand 1 (valid for floating point mode @var{m}) to fixed
-point mode @var{n} as an unsigned number and store in operand 0 (which
-has mode @var{n}). This instruction's result is defined only when the
-value of operand 1 is an integer.
-
-@cindex @code{ftrunc@var{m}2} instruction pattern
-@item @samp{ftrunc@var{m}2}
-Convert operand 1 (valid for floating point mode @var{m}) to an
-integer value, still represented in floating point mode @var{m}, and
-store it in operand 0 (valid for floating point mode @var{m}).
-
-@cindex @code{fix_trunc@var{mn}2} instruction pattern
-@item @samp{fix_trunc@var{m}@var{n}2}
-Like @samp{fix@var{m}@var{n}2} but works for any floating point value
-of mode @var{m} by converting the value to an integer.
-
-@cindex @code{fixuns_trunc@var{mn}2} instruction pattern
-@item @samp{fixuns_trunc@var{m}@var{n}2}
-Like @samp{fixuns@var{m}@var{n}2} but works for any floating point
-value of mode @var{m} by converting the value to an integer.
-
-@cindex @code{trunc@var{mn}2} instruction pattern
-@item @samp{trunc@var{m}@var{n}2}
-Truncate operand 1 (valid for mode @var{m}) to mode @var{n} and
-store in operand 0 (which has mode @var{n}). Both modes must be fixed
-point or both floating point.
-
-@cindex @code{extend@var{mn}2} instruction pattern
-@item @samp{extend@var{m}@var{n}2}
-Sign-extend operand 1 (valid for mode @var{m}) to mode @var{n} and
-store in operand 0 (which has mode @var{n}). Both modes must be fixed
-point or both floating point.
-
-@cindex @code{zero_extend@var{mn}2} instruction pattern
-@item @samp{zero_extend@var{m}@var{n}2}
-Zero-extend operand 1 (valid for mode @var{m}) to mode @var{n} and
-store in operand 0 (which has mode @var{n}). Both modes must be fixed
-point.
-
-@cindex @code{extv} instruction pattern
-@item @samp{extv}
-Extract a bit field from operand 1 (a register or memory operand), where
-operand 2 specifies the width in bits and operand 3 the starting bit,
-and store it in operand 0. Operand 0 must have mode @code{word_mode}.
-Operand 1 may have mode @code{byte_mode} or @code{word_mode}; often
-@code{word_mode} is allowed only for registers. Operands 2 and 3 must
-be valid for @code{word_mode}.
-
-The RTL generation pass generates this instruction only with constants
-for operands 2 and 3.
-
-The bit-field value is sign-extended to a full word integer
-before it is stored in operand 0.
-
-@cindex @code{extzv} instruction pattern
-@item @samp{extzv}
-Like @samp{extv} except that the bit-field value is zero-extended.
-
-@cindex @code{insv} instruction pattern
-@item @samp{insv}
-Store operand 3 (which must be valid for @code{word_mode}) into a bit
-field in operand 0, where operand 1 specifies the width in bits and
-operand 2 the starting bit. Operand 0 may have mode @code{byte_mode} or
-@code{word_mode}; often @code{word_mode} is allowed only for registers.
-Operands 1 and 2 must be valid for @code{word_mode}.
-
-The RTL generation pass generates this instruction only with constants
-for operands 1 and 2.
-
-@cindex @code{mov@var{mode}cc} instruction pattern
-@item @samp{mov@var{mode}cc}
-Conditionally move operand 2 or operand 3 into operand 0 according to the
-comparison in operand 1. If the comparison is true, operand 2 is moved
-into operand 0, otherwise operand 3 is moved.
-
-The mode of the operands being compared need not be the same as the operands
-being moved. Some machines, sparc64 for example, have instructions that
-conditionally move an integer value based on the floating point condition
-codes and vice versa.
-
-If the machine does not have conditional move instructions, do not
-define these patterns.
-
-@cindex @code{s@var{cond}} instruction pattern
-@item @samp{s@var{cond}}
-Store zero or nonzero in the operand according to the condition codes.
-Value stored is nonzero iff the condition @var{cond} is true.
-@var{cond} is the name of a comparison operation expression code, such
-as @code{eq}, @code{lt} or @code{leu}.
-
-You specify the mode that the operand must have when you write the
-@code{match_operand} expression. The compiler automatically sees
-which mode you have used and supplies an operand of that mode.
-
-The value stored for a true condition must have 1 as its low bit, or
-else must be negative. Otherwise the instruction is not suitable and
-you should omit it from the machine description. You describe to the
-compiler exactly which value is stored by defining the macro
-@code{STORE_FLAG_VALUE} (@pxref{Misc}). If a description cannot be
-found that can be used for all the @samp{s@var{cond}} patterns, you
-should omit those operations from the machine description.
-
-These operations may fail, but should do so only in relatively
-uncommon cases; if they would fail for common cases involving
-integer comparisons, it is best to omit these patterns.
-
-If these operations are omitted, the compiler will usually generate code
-that copies the constant one to the target and branches around an
-assignment of zero to the target. If this code is more efficient than
-the potential instructions used for the @samp{s@var{cond}} pattern
-followed by those required to convert the result into a 1 or a zero in
-@code{SImode}, you should omit the @samp{s@var{cond}} operations from
-the machine description.
-
-@cindex @code{b@var{cond}} instruction pattern
-@item @samp{b@var{cond}}
-Conditional branch instruction. Operand 0 is a @code{label_ref} that
-refers to the label to jump to. Jump if the condition codes meet
-condition @var{cond}.
-
-Some machines do not follow the model assumed here where a comparison
-instruction is followed by a conditional branch instruction. In that
-case, the @samp{cmp@var{m}} (and @samp{tst@var{m}}) patterns should
-simply store the operands away and generate all the required insns in a
-@code{define_expand} (@pxref{Expander Definitions}) for the conditional
-branch operations. All calls to expand @samp{b@var{cond}} patterns are
-immediately preceded by calls to expand either a @samp{cmp@var{m}}
-pattern or a @samp{tst@var{m}} pattern.
-
-Machines that use a pseudo register for the condition code value, or
-where the mode used for the comparison depends on the condition being
-tested, should also use the above mechanism. @xref{Jump Patterns}.
-
-The above discussion also applies to the @samp{mov@var{mode}cc} and
-@samp{s@var{cond}} patterns.
-
-@cindex @code{call} instruction pattern
-@item @samp{call}
-Subroutine call instruction returning no value. Operand 0 is the
-function to call; operand 1 is the number of bytes of arguments pushed
-as a @code{const_int}; operand 2 is the number of registers used as
-operands.
-
-On most machines, operand 2 is not actually stored into the RTL
-pattern. It is supplied for the sake of some RISC machines which need
-to put this information into the assembler code; they can put it in
-the RTL instead of operand 1.
-
-Operand 0 should be a @code{mem} RTX whose address is the address of the
-function. Note, however, that this address can be a @code{symbol_ref}
-expression even if it would not be a legitimate memory address on the
-target machine. If it is also not a valid argument for a call
-instruction, the pattern for this operation should be a
-@code{define_expand} (@pxref{Expander Definitions}) that places the
-address into a register and uses that register in the call instruction.
-
-@cindex @code{call_value} instruction pattern
-@item @samp{call_value}
-Subroutine call instruction returning a value. Operand 0 is the hard
-register in which the value is returned. There are three more
-operands, the same as the three operands of the @samp{call}
-instruction (but with numbers increased by one).
-
-Subroutines that return @code{BLKmode} objects use the @samp{call}
-insn.
-
-@cindex @code{call_pop} instruction pattern
-@cindex @code{call_value_pop} instruction pattern
-@item @samp{call_pop}, @samp{call_value_pop}
-Similar to @samp{call} and @samp{call_value}, except used if defined and
-if @code{RETURN_POPS_ARGS} is non-zero. They should emit a @code{parallel}
-that contains both the function call and a @code{set} to indicate the
-adjustment made to the frame pointer.
-
-For machines where @code{RETURN_POPS_ARGS} can be non-zero, the use of these
-patterns increases the number of functions for which the frame pointer
-can be eliminated, if desired.
-
-@cindex @code{untyped_call} instruction pattern
-@item @samp{untyped_call}
-Subroutine call instruction returning a value of any type. Operand 0 is
-the function to call; operand 1 is a memory location where the result of
-calling the function is to be stored; operand 2 is a @code{parallel}
-expression where each element is a @code{set} expression that indicates
-the saving of a function return value into the result block.
-
-This instruction pattern should be defined to support
-@code{__builtin_apply} on machines where special instructions are needed
-to call a subroutine with arbitrary arguments or to save the value
-returned. This instruction pattern is required on machines that have
-multiple registers that can hold a return value (i.e.
-@code{FUNCTION_VALUE_REGNO_P} is true for more than one register).
-
-@cindex @code{return} instruction pattern
-@item @samp{return}
-Subroutine return instruction. This instruction pattern name should be
-defined only if a single instruction can do all the work of returning
-from a function.
-
-Like the @samp{mov@var{m}} patterns, this pattern is also used after the
-RTL generation phase. In this case it is to support machines where
-multiple instructions are usually needed to return from a function, but
-some class of functions only requires one instruction to implement a
-return. Normally, the applicable functions are those which do not need
-to save any registers or allocate stack space.
-
-@findex reload_completed
-@findex leaf_function_p
-For such machines, the condition specified in this pattern should only
-be true when @code{reload_completed} is non-zero and the function's
-epilogue would only be a single instruction. For machines with register
-windows, the routine @code{leaf_function_p} may be used to determine if
-a register window push is required.
-
-Machines that have conditional return instructions should define patterns
-such as
-
-@smallexample
-(define_insn ""
- [(set (pc)
- (if_then_else (match_operator
- 0 "comparison_operator"
- [(cc0) (const_int 0)])
- (return)
- (pc)))]
- "@var{condition}"
- "@dots{}")
-@end smallexample
-
-where @var{condition} would normally be the same condition specified on the
-named @samp{return} pattern.
-
-@cindex @code{untyped_return} instruction pattern
-@item @samp{untyped_return}
-Untyped subroutine return instruction. This instruction pattern should
-be defined to support @code{__builtin_return} on machines where special
-instructions are needed to return a value of any type.
-
-Operand 0 is a memory location where the result of calling a function
-with @code{__builtin_apply} is stored; operand 1 is a @code{parallel}
-expression where each element is a @code{set} expression that indicates
-the restoring of a function return value from the result block.
-
-@cindex @code{nop} instruction pattern
-@item @samp{nop}
-No-op instruction. This instruction pattern name should always be defined
-to output a no-op in assembler code. @code{(const_int 0)} will do as an
-RTL pattern.
-
-@cindex @code{indirect_jump} instruction pattern
-@item @samp{indirect_jump}
-An instruction to jump to an address which is operand zero.
-This pattern name is mandatory on all machines.
-
-@cindex @code{casesi} instruction pattern
-@item @samp{casesi}
-Instruction to jump through a dispatch table, including bounds checking.
-This instruction takes five operands:
-
-@enumerate
-@item
-The index to dispatch on, which has mode @code{SImode}.
-
-@item
-The lower bound for indices in the table, an integer constant.
-
-@item
-The total range of indices in the table---the largest index
-minus the smallest one (both inclusive).
-
-@item
-A label that precedes the table itself.
-
-@item
-A label to jump to if the index has a value outside the bounds.
-(If the machine-description macro @code{CASE_DROPS_THROUGH} is defined,
-then an out-of-bounds index drops through to the code following
-the jump table instead of jumping to this label. In that case,
-this label is not actually used by the @samp{casesi} instruction,
-but it is always provided as an operand.)
-@end enumerate
-
-The table is a @code{addr_vec} or @code{addr_diff_vec} inside of a
-@code{jump_insn}. The number of elements in the table is one plus the
-difference between the upper bound and the lower bound.
-
-@cindex @code{tablejump} instruction pattern
-@item @samp{tablejump}
-Instruction to jump to a variable address. This is a low-level
-capability which can be used to implement a dispatch table when there
-is no @samp{casesi} pattern.
-
-This pattern requires two operands: the address or offset, and a label
-which should immediately precede the jump table. If the macro
-@code{CASE_VECTOR_PC_RELATIVE} evaluates to a nonzero value then the first
-operand is an offset which counts from the address of the table; otherwise,
-it is an absolute address to jump to. In either case, the first operand has
-mode @code{Pmode}.
-
-The @samp{tablejump} insn is always the last insn before the jump
-table it uses. Its assembler code normally has no need to use the
-second operand, but you should incorporate it in the RTL pattern so
-that the jump optimizer will not delete the table as unreachable code.
-
-@cindex @code{canonicalize_funcptr_for_compare} instruction pattern
-@item @samp{canonicalize_funcptr_for_compare}
-Canonicalize the function pointer in operand 1 and store the result
-into operand 0.
-
-Operand 0 is always a @code{reg} and has mode @code{Pmode}; operand 1
-may be a @code{reg}, @code{mem}, @code{symbol_ref}, @code{const_int}, etc
-and also has mode @code{Pmode}.
-
-Canonicalization of a function pointer usually involves computing
-the address of the function which would be called if the function
-pointer were used in an indirect call.
-
-Only define this pattern if function pointers on the target machine
-can have different values but still call the same function when
-used in an indirect call.
-
-@cindex @code{save_stack_block} instruction pattern
-@cindex @code{save_stack_function} instruction pattern
-@cindex @code{save_stack_nonlocal} instruction pattern
-@cindex @code{restore_stack_block} instruction pattern
-@cindex @code{restore_stack_function} instruction pattern
-@cindex @code{restore_stack_nonlocal} instruction pattern
-@item @samp{save_stack_block}
-@itemx @samp{save_stack_function}
-@itemx @samp{save_stack_nonlocal}
-@itemx @samp{restore_stack_block}
-@itemx @samp{restore_stack_function}
-@itemx @samp{restore_stack_nonlocal}
-Most machines save and restore the stack pointer by copying it to or
-from an object of mode @code{Pmode}. Do not define these patterns on
-such machines.
-
-Some machines require special handling for stack pointer saves and
-restores. On those machines, define the patterns corresponding to the
-non-standard cases by using a @code{define_expand} (@pxref{Expander
-Definitions}) that produces the required insns. The three types of
-saves and restores are:
-
-@enumerate
-@item
-@samp{save_stack_block} saves the stack pointer at the start of a block
-that allocates a variable-sized object, and @samp{restore_stack_block}
-restores the stack pointer when the block is exited.
-
-@item
-@samp{save_stack_function} and @samp{restore_stack_function} do a
-similar job for the outermost block of a function and are used when the
-function allocates variable-sized objects or calls @code{alloca}. Only
-the epilogue uses the restored stack pointer, allowing a simpler save or
-restore sequence on some machines.
-
-@item
-@samp{save_stack_nonlocal} is used in functions that contain labels
-branched to by nested functions. It saves the stack pointer in such a
-way that the inner function can use @samp{restore_stack_nonlocal} to
-restore the stack pointer. The compiler generates code to restore the
-frame and argument pointer registers, but some machines require saving
-and restoring additional data such as register window information or
-stack backchains. Place insns in these patterns to save and restore any
-such required data.
-@end enumerate
-
-When saving the stack pointer, operand 0 is the save area and operand 1
-is the stack pointer. The mode used to allocate the save area defaults
-to @code{Pmode} but you can override that choice by defining the
-@code{STACK_SAVEAREA_MODE} macro (@pxref{Storage Layout}). You must
-specify an integral mode, or @code{VOIDmode} if no save area is needed
-for a particular type of save (either because no save is needed or
-because a machine-specific save area can be used). Operand 0 is the
-stack pointer and operand 1 is the save area for restore operations. If
-@samp{save_stack_block} is defined, operand 0 must not be
-@code{VOIDmode} since these saves can be arbitrarily nested.
-
-A save area is a @code{mem} that is at a constant offset from
-@code{virtual_stack_vars_rtx} when the stack pointer is saved for use by
-nonlocal gotos and a @code{reg} in the other two cases.
-
-@cindex @code{allocate_stack} instruction pattern
-@item @samp{allocate_stack}
-Subtract (or add if @code{STACK_GROWS_DOWNWARD} is undefined) operand 1 from
-the stack pointer to create space for dynamically allocated data.
-
-Store the resultant pointer to this space into operand 0. If you
-are allocating space from the main stack, do this by emitting a
-move insn to copy @code{virtual_stack_dynamic_rtx} to operand 0.
-If you are allocating the space elsewhere, generate code to copy the
-location of the space to operand 0. In the latter case, you must
-ensure this space gets freed when the corresponding space on the main
-stack is free.
-
-Do not define this pattern if all that must be done is the subtraction.
-Some machines require other operations such as stack probes or
-maintaining the back chain. Define this pattern to emit those
-operations in addition to updating the stack pointer.
-
-@cindex @code{probe} instruction pattern
-@item @samp{probe}
-Some machines require instructions to be executed after space is
-allocated from the stack, for example to generate a reference at
-the bottom of the stack.
-
-If you need to emit instructions before the stack has been adjusted,
-put them into the @samp{allocate_stack} pattern. Otherwise, define
-this pattern to emit the required instructions.
-
-No operands are provided.
-
-@cindex @code{check_stack} instruction pattern
-@item @samp{check_stack}
-If stack checking cannot be done on your system by probing the stack with
-a load or store instruction (@pxref{Stack Checking}), define this pattern
-to perform the needed check and signaling an error if the stack
-has overflowed. The single operand is the location in the stack furthest
-from the current stack pointer that you need to validate. Normally,
-on machines where this pattern is needed, you would obtain the stack
-limit from a global or thread-specific variable or register.
-
-@cindex @code{nonlocal_goto} instruction pattern
-@item @samp{nonlocal_goto}
-Emit code to generate a non-local goto, e.g., a jump from one function
-to a label in an outer function. This pattern has four arguments,
-each representing a value to be used in the jump. The first
-argument is to be loaded into the frame pointer, the second is
-the address to branch to (code to dispatch to the actual label),
-the third is the address of a location where the stack is saved,
-and the last is the address of the label, to be placed in the
-location for the incoming static chain.
-
-On most machines you need not define this pattern, since GNU CC will
-already generate the correct code, which is to load the frame pointer
-and static chain, restore the stack (using the
-@samp{restore_stack_nonlocal} pattern, if defined), and jump indirectly
-to the dispatcher. You need only define this pattern if this code will
-not work on your machine.
-
-@cindex @code{nonlocal_goto_receiver} instruction pattern
-@item @samp{nonlocal_goto_receiver}
-This pattern, if defined, contains code needed at the target of a
-nonlocal goto after the code already generated by GNU CC. You will not
-normally need to define this pattern. A typical reason why you might
-need this pattern is if some value, such as a pointer to a global table,
-must be restored when the frame pointer is restored. Note that a nonlocal
-goto only ocurrs within a unit-of-translation, so a global table pointer
-that is shared by all functions of a given module need not be restored.
-There are no arguments.
-
-@cindex @code{exception_receiver} instruction pattern
-@item @samp{exception_receiver}
-This pattern, if defined, contains code needed at the site of an
-exception handler that isn't needed at the site of a nonlocal goto. You
-will not normally need to define this pattern. A typical reason why you
-might need this pattern is if some value, such as a pointer to a global
-table, must be restored after control flow is branched to the handler of
-an exception. There are no arguments.
-
-@cindex @code{builtin_setjmp_setup} instruction pattern
-@item @samp{builtin_setjmp_setup}
-This pattern, if defined, contains additional code needed to initialize
-the @code{jmp_buf}. You will not normally need to define this pattern.
-A typical reason why you might need this pattern is if some value, such
-as a pointer to a global table, must be restored. Though it is
-preferred that the pointer value be recalculated if possible (given the
-address of a label for instance). The single argument is a pointer to
-the @code{jmp_buf}. Note that the buffer is five words long and that
-the first three are normally used by the generic mechanism.
-
-@cindex @code{builtin_setjmp_receiver} instruction pattern
-@item @samp{builtin_setjmp_receiver}
-This pattern, if defined, contains code needed at the site of an
-builtin setjmp that isn't needed at the site of a nonlocal goto. You
-will not normally need to define this pattern. A typical reason why you
-might need this pattern is if some value, such as a pointer to a global
-table, must be restored. It takes one argument, which is the label
-to which builtin_longjmp transfered control; this pattern may be emitted
-at a small offset from that label.
-
-@cindex @code{builtin_longjmp} instruction pattern
-@item @samp{builtin_longjmp}
-This pattern, if defined, performs the entire action of the longjmp.
-You will not normally need to define this pattern unless you also define
-@code{builtin_setjmp_setup}. The single argument is a pointer to the
-@code{jmp_buf}.
-
-@cindex @code{eh_epilogue} instruction pattern
-@item @samp{eh_epilogue}
-This pattern, if defined, affects the way @code{__builtin_eh_return},
-and thence @code{__throw} are built. It is intended to allow communication
-between the exception handling machinery and the normal epilogue code
-for the target.
-
-The pattern takes three arguments. The first is the exception context
-pointer. This will have already been copied to the function return
-register appropriate for a pointer; normally this can be ignored. The
-second argument is an offset to be added to the stack pointer. It will
-have been copied to some arbitrary call-clobbered hard reg so that it
-will survive until after reload to when the normal epilogue is generated.
-The final argument is the address of the exception handler to which
-the function should return. This will normally need to copied by the
-pattern to some special register.
-
-This pattern must be defined if @code{RETURN_ADDR_RTX} does not yield
-something that can be reliably and permanently modified, i.e. a fixed
-hard register or a stack memory reference.
-
-@cindex @code{prologue} instruction pattern
-@item @samp{prologue}
-This pattern, if defined, emits RTL for entry to a function. The function
-entry is resposible for setting up the stack frame, initializing the frame
-pointer register, saving callee saved registers, etc.
-
-Using a prologue pattern is generally preferred over defining
-@code{FUNCTION_PROLOGUE} to emit assembly code for the prologue.
-
-The @code{prologue} pattern is particularly useful for targets which perform
-instruction scheduling.
-
-@cindex @code{epilogue} instruction pattern
-@item @samp{epilogue}
-This pattern, if defined, emits RTL for exit from a function. The function
-exit is resposible for deallocating the stack frame, restoring callee saved
-registers and emitting the return instruction.
-
-Using an epilogue pattern is generally preferred over defining
-@code{FUNCTION_EPILOGUE} to emit assembly code for the prologue.
-
-The @code{epilogue} pattern is particularly useful for targets which perform
-instruction scheduling or which have delay slots for their return instruction.
-
-@cindex @code{sibcall_epilogue} instruction pattern
-@item @samp{sibcall_epilogue}
-This pattern, if defined, emits RTL for exit from a function without the final
-branch back to the calling function. This pattern will be emitted before any
-sibling call (aka tail call) sites.
-
-The @code{sibcall_epilogue} pattern must not clobber any arguments used for
-parameter passing or any stack slots for arguments passed to the current
-function.
-@end table
-
-@node Pattern Ordering
-@section When the Order of Patterns Matters
-@cindex Pattern Ordering
-@cindex Ordering of Patterns
-
-Sometimes an insn can match more than one instruction pattern. Then the
-pattern that appears first in the machine description is the one used.
-Therefore, more specific patterns (patterns that will match fewer things)
-and faster instructions (those that will produce better code when they
-do match) should usually go first in the description.
-
-In some cases the effect of ordering the patterns can be used to hide
-a pattern when it is not valid. For example, the 68000 has an
-instruction for converting a fullword to floating point and another
-for converting a byte to floating point. An instruction converting
-an integer to floating point could match either one. We put the
-pattern to convert the fullword first to make sure that one will
-be used rather than the other. (Otherwise a large integer might
-be generated as a single-byte immediate quantity, which would not work.)
-Instead of using this pattern ordering it would be possible to make the
-pattern for convert-a-byte smart enough to deal properly with any
-constant value.
-
-@node Dependent Patterns
-@section Interdependence of Patterns
-@cindex Dependent Patterns
-@cindex Interdependence of Patterns
-
-Every machine description must have a named pattern for each of the
-conditional branch names @samp{b@var{cond}}. The recognition template
-must always have the form
-
-@example
-(set (pc)
- (if_then_else (@var{cond} (cc0) (const_int 0))
- (label_ref (match_operand 0 "" ""))
- (pc)))
-@end example
-
-@noindent
-In addition, every machine description must have an anonymous pattern
-for each of the possible reverse-conditional branches. Their templates
-look like
-
-@example
-(set (pc)
- (if_then_else (@var{cond} (cc0) (const_int 0))
- (pc)
- (label_ref (match_operand 0 "" ""))))
-@end example
-
-@noindent
-They are necessary because jump optimization can turn direct-conditional
-branches into reverse-conditional branches.
-
-It is often convenient to use the @code{match_operator} construct to
-reduce the number of patterns that must be specified for branches. For
-example,
-
-@example
-(define_insn ""
- [(set (pc)
- (if_then_else (match_operator 0 "comparison_operator"
- [(cc0) (const_int 0)])
- (pc)
- (label_ref (match_operand 1 "" ""))))]
- "@var{condition}"
- "@dots{}")
-@end example
-
-In some cases machines support instructions identical except for the
-machine mode of one or more operands. For example, there may be
-``sign-extend halfword'' and ``sign-extend byte'' instructions whose
-patterns are
-
-@example
-(set (match_operand:SI 0 @dots{})
- (extend:SI (match_operand:HI 1 @dots{})))
-
-(set (match_operand:SI 0 @dots{})
- (extend:SI (match_operand:QI 1 @dots{})))
-@end example
-
-@noindent
-Constant integers do not specify a machine mode, so an instruction to
-extend a constant value could match either pattern. The pattern it
-actually will match is the one that appears first in the file. For correct
-results, this must be the one for the widest possible mode (@code{HImode},
-here). If the pattern matches the @code{QImode} instruction, the results
-will be incorrect if the constant value does not actually fit that mode.
-
-Such instructions to extend constants are rarely generated because they are
-optimized away, but they do occasionally happen in nonoptimized
-compilations.
-
-If a constraint in a pattern allows a constant, the reload pass may
-replace a register with a constant permitted by the constraint in some
-cases. Similarly for memory references. Because of this substitution,
-you should not provide separate patterns for increment and decrement
-instructions. Instead, they should be generated from the same pattern
-that supports register-register add insns by examining the operands and
-generating the appropriate machine instruction.
-
-@node Jump Patterns
-@section Defining Jump Instruction Patterns
-@cindex jump instruction patterns
-@cindex defining jump instruction patterns
-
-For most machines, GNU CC assumes that the machine has a condition code.
-A comparison insn sets the condition code, recording the results of both
-signed and unsigned comparison of the given operands. A separate branch
-insn tests the condition code and branches or not according its value.
-The branch insns come in distinct signed and unsigned flavors. Many
-common machines, such as the Vax, the 68000 and the 32000, work this
-way.
-
-Some machines have distinct signed and unsigned compare instructions, and
-only one set of conditional branch instructions. The easiest way to handle
-these machines is to treat them just like the others until the final stage
-where assembly code is written. At this time, when outputting code for the
-compare instruction, peek ahead at the following branch using
-@code{next_cc0_user (insn)}. (The variable @code{insn} refers to the insn
-being output, in the output-writing code in an instruction pattern.) If
-the RTL says that is an unsigned branch, output an unsigned compare;
-otherwise output a signed compare. When the branch itself is output, you
-can treat signed and unsigned branches identically.
-
-The reason you can do this is that GNU CC always generates a pair of
-consecutive RTL insns, possibly separated by @code{note} insns, one to
-set the condition code and one to test it, and keeps the pair inviolate
-until the end.
-
-To go with this technique, you must define the machine-description macro
-@code{NOTICE_UPDATE_CC} to do @code{CC_STATUS_INIT}; in other words, no
-compare instruction is superfluous.
-
-Some machines have compare-and-branch instructions and no condition code.
-A similar technique works for them. When it is time to ``output'' a
-compare instruction, record its operands in two static variables. When
-outputting the branch-on-condition-code instruction that follows, actually
-output a compare-and-branch instruction that uses the remembered operands.
-
-It also works to define patterns for compare-and-branch instructions.
-In optimizing compilation, the pair of compare and branch instructions
-will be combined according to these patterns. But this does not happen
-if optimization is not requested. So you must use one of the solutions
-above in addition to any special patterns you define.
-
-In many RISC machines, most instructions do not affect the condition
-code and there may not even be a separate condition code register. On
-these machines, the restriction that the definition and use of the
-condition code be adjacent insns is not necessary and can prevent
-important optimizations. For example, on the IBM RS/6000, there is a
-delay for taken branches unless the condition code register is set three
-instructions earlier than the conditional branch. The instruction
-scheduler cannot perform this optimization if it is not permitted to
-separate the definition and use of the condition code register.
-
-On these machines, do not use @code{(cc0)}, but instead use a register
-to represent the condition code. If there is a specific condition code
-register in the machine, use a hard register. If the condition code or
-comparison result can be placed in any general register, or if there are
-multiple condition registers, use a pseudo register.
-
-@findex prev_cc0_setter
-@findex next_cc0_user
-On some machines, the type of branch instruction generated may depend on
-the way the condition code was produced; for example, on the 68k and
-Sparc, setting the condition code directly from an add or subtract
-instruction does not clear the overflow bit the way that a test
-instruction does, so a different branch instruction must be used for
-some conditional branches. For machines that use @code{(cc0)}, the set
-and use of the condition code must be adjacent (separated only by
-@code{note} insns) allowing flags in @code{cc_status} to be used.
-(@xref{Condition Code}.) Also, the comparison and branch insns can be
-located from each other by using the functions @code{prev_cc0_setter}
-and @code{next_cc0_user}.
-
-However, this is not true on machines that do not use @code{(cc0)}. On
-those machines, no assumptions can be made about the adjacency of the
-compare and branch insns and the above methods cannot be used. Instead,
-we use the machine mode of the condition code register to record
-different formats of the condition code register.
-
-Registers used to store the condition code value should have a mode that
-is in class @code{MODE_CC}. Normally, it will be @code{CCmode}. If
-additional modes are required (as for the add example mentioned above in
-the Sparc), define the macro @code{EXTRA_CC_MODES} to list the
-additional modes required (@pxref{Condition Code}). Also define
-@code{EXTRA_CC_NAMES} to list the names of those modes and
-@code{SELECT_CC_MODE} to choose a mode given an operand of a compare.
-
-If it is known during RTL generation that a different mode will be
-required (for example, if the machine has separate compare instructions
-for signed and unsigned quantities, like most IBM processors), they can
-be specified at that time.
-
-If the cases that require different modes would be made by instruction
-combination, the macro @code{SELECT_CC_MODE} determines which machine
-mode should be used for the comparison result. The patterns should be
-written using that mode. To support the case of the add on the Sparc
-discussed above, we have the pattern
-
-@smallexample
-(define_insn ""
- [(set (reg:CC_NOOV 0)
- (compare:CC_NOOV
- (plus:SI (match_operand:SI 0 "register_operand" "%r")
- (match_operand:SI 1 "arith_operand" "rI"))
- (const_int 0)))]
- ""
- "@dots{}")
-@end smallexample
-
-The @code{SELECT_CC_MODE} macro on the Sparc returns @code{CC_NOOVmode}
-for comparisons whose argument is a @code{plus}.
-
-@node Insn Canonicalizations
-@section Canonicalization of Instructions
-@cindex canonicalization of instructions
-@cindex insn canonicalization
-
-There are often cases where multiple RTL expressions could represent an
-operation performed by a single machine instruction. This situation is
-most commonly encountered with logical, branch, and multiply-accumulate
-instructions. In such cases, the compiler attempts to convert these
-multiple RTL expressions into a single canonical form to reduce the
-number of insn patterns required.
-
-In addition to algebraic simplifications, following canonicalizations
-are performed:
-
-@itemize @bullet
-@item
-For commutative and comparison operators, a constant is always made the
-second operand. If a machine only supports a constant as the second
-operand, only patterns that match a constant in the second operand need
-be supplied.
-
-@cindex @code{neg}, canonicalization of
-@cindex @code{not}, canonicalization of
-@cindex @code{mult}, canonicalization of
-@cindex @code{plus}, canonicalization of
-@cindex @code{minus}, canonicalization of
-For these operators, if only one operand is a @code{neg}, @code{not},
-@code{mult}, @code{plus}, or @code{minus} expression, it will be the
-first operand.
-
-@cindex @code{compare}, canonicalization of
-@item
-For the @code{compare} operator, a constant is always the second operand
-on machines where @code{cc0} is used (@pxref{Jump Patterns}). On other
-machines, there are rare cases where the compiler might want to construct
-a @code{compare} with a constant as the first operand. However, these
-cases are not common enough for it to be worthwhile to provide a pattern
-matching a constant as the first operand unless the machine actually has
-such an instruction.
-
-An operand of @code{neg}, @code{not}, @code{mult}, @code{plus}, or
-@code{minus} is made the first operand under the same conditions as
-above.
-
-@item
-@code{(minus @var{x} (const_int @var{n}))} is converted to
-@code{(plus @var{x} (const_int @var{-n}))}.
-
-@item
-Within address computations (i.e., inside @code{mem}), a left shift is
-converted into the appropriate multiplication by a power of two.
-
-@cindex @code{ior}, canonicalization of
-@cindex @code{and}, canonicalization of
-@cindex De Morgan's law
-@item
-De`Morgan's Law is used to move bitwise negation inside a bitwise
-logical-and or logical-or operation. If this results in only one
-operand being a @code{not} expression, it will be the first one.
-
-A machine that has an instruction that performs a bitwise logical-and of one
-operand with the bitwise negation of the other should specify the pattern
-for that instruction as
-
-@example
-(define_insn ""
- [(set (match_operand:@var{m} 0 @dots{})
- (and:@var{m} (not:@var{m} (match_operand:@var{m} 1 @dots{}))
- (match_operand:@var{m} 2 @dots{})))]
- "@dots{}"
- "@dots{}")
-@end example
-
-@noindent
-Similarly, a pattern for a ``NAND'' instruction should be written
-
-@example
-(define_insn ""
- [(set (match_operand:@var{m} 0 @dots{})
- (ior:@var{m} (not:@var{m} (match_operand:@var{m} 1 @dots{}))
- (not:@var{m} (match_operand:@var{m} 2 @dots{}))))]
- "@dots{}"
- "@dots{}")
-@end example
-
-In both cases, it is not necessary to include patterns for the many
-logically equivalent RTL expressions.
-
-@cindex @code{xor}, canonicalization of
-@item
-The only possible RTL expressions involving both bitwise exclusive-or
-and bitwise negation are @code{(xor:@var{m} @var{x} @var{y})}
-and @code{(not:@var{m} (xor:@var{m} @var{x} @var{y}))}.@refill
-
-@item
-The sum of three items, one of which is a constant, will only appear in
-the form
-
-@example
-(plus:@var{m} (plus:@var{m} @var{x} @var{y}) @var{constant})
-@end example
-
-@item
-On machines that do not use @code{cc0},
-@code{(compare @var{x} (const_int 0))} will be converted to
-@var{x}.@refill
-
-@cindex @code{zero_extract}, canonicalization of
-@cindex @code{sign_extract}, canonicalization of
-@item
-Equality comparisons of a group of bits (usually a single bit) with zero
-will be written using @code{zero_extract} rather than the equivalent
-@code{and} or @code{sign_extract} operations.
-
-@end itemize
-
-@node Peephole Definitions
-@section Machine-Specific Peephole Optimizers
-@cindex peephole optimizer definitions
-@cindex defining peephole optimizers
-
-In addition to instruction patterns the @file{md} file may contain
-definitions of machine-specific peephole optimizations.
-
-The combiner does not notice certain peephole optimizations when the data
-flow in the program does not suggest that it should try them. For example,
-sometimes two consecutive insns related in purpose can be combined even
-though the second one does not appear to use a register computed in the
-first one. A machine-specific peephole optimizer can detect such
-opportunities.
-
-@need 1000
-A definition looks like this:
-
-@smallexample
-(define_peephole
- [@var{insn-pattern-1}
- @var{insn-pattern-2}
- @dots{}]
- "@var{condition}"
- "@var{template}"
- "@var{optional insn-attributes}")
-@end smallexample
-
-@noindent
-The last string operand may be omitted if you are not using any
-machine-specific information in this machine description. If present,
-it must obey the same rules as in a @code{define_insn}.
-
-In this skeleton, @var{insn-pattern-1} and so on are patterns to match
-consecutive insns. The optimization applies to a sequence of insns when
-@var{insn-pattern-1} matches the first one, @var{insn-pattern-2} matches
-the next, and so on.@refill
-
-Each of the insns matched by a peephole must also match a
-@code{define_insn}. Peepholes are checked only at the last stage just
-before code generation, and only optionally. Therefore, any insn which
-would match a peephole but no @code{define_insn} will cause a crash in code
-generation in an unoptimized compilation, or at various optimization
-stages.
-
-The operands of the insns are matched with @code{match_operands},
-@code{match_operator}, and @code{match_dup}, as usual. What is not
-usual is that the operand numbers apply to all the insn patterns in the
-definition. So, you can check for identical operands in two insns by
-using @code{match_operand} in one insn and @code{match_dup} in the
-other.
-
-The operand constraints used in @code{match_operand} patterns do not have
-any direct effect on the applicability of the peephole, but they will
-be validated afterward, so make sure your constraints are general enough
-to apply whenever the peephole matches. If the peephole matches
-but the constraints are not satisfied, the compiler will crash.
-
-It is safe to omit constraints in all the operands of the peephole; or
-you can write constraints which serve as a double-check on the criteria
-previously tested.
-
-Once a sequence of insns matches the patterns, the @var{condition} is
-checked. This is a C expression which makes the final decision whether to
-perform the optimization (we do so if the expression is nonzero). If
-@var{condition} is omitted (in other words, the string is empty) then the
-optimization is applied to every sequence of insns that matches the
-patterns.
-
-The defined peephole optimizations are applied after register allocation
-is complete. Therefore, the peephole definition can check which
-operands have ended up in which kinds of registers, just by looking at
-the operands.
-
-@findex prev_active_insn
-The way to refer to the operands in @var{condition} is to write
-@code{operands[@var{i}]} for operand number @var{i} (as matched by
-@code{(match_operand @var{i} @dots{})}). Use the variable @code{insn}
-to refer to the last of the insns being matched; use
-@code{prev_active_insn} to find the preceding insns.
-
-@findex dead_or_set_p
-When optimizing computations with intermediate results, you can use
-@var{condition} to match only when the intermediate results are not used
-elsewhere. Use the C expression @code{dead_or_set_p (@var{insn},
-@var{op})}, where @var{insn} is the insn in which you expect the value
-to be used for the last time (from the value of @code{insn}, together
-with use of @code{prev_nonnote_insn}), and @var{op} is the intermediate
-value (from @code{operands[@var{i}]}).@refill
-
-Applying the optimization means replacing the sequence of insns with one
-new insn. The @var{template} controls ultimate output of assembler code
-for this combined insn. It works exactly like the template of a
-@code{define_insn}. Operand numbers in this template are the same ones
-used in matching the original sequence of insns.
-
-The result of a defined peephole optimizer does not need to match any of
-the insn patterns in the machine description; it does not even have an
-opportunity to match them. The peephole optimizer definition itself serves
-as the insn pattern to control how the insn is output.
-
-Defined peephole optimizers are run as assembler code is being output,
-so the insns they produce are never combined or rearranged in any way.
-
-Here is an example, taken from the 68000 machine description:
-
-@smallexample
-(define_peephole
- [(set (reg:SI 15) (plus:SI (reg:SI 15) (const_int 4)))
- (set (match_operand:DF 0 "register_operand" "=f")
- (match_operand:DF 1 "register_operand" "ad"))]
- "FP_REG_P (operands[0]) && ! FP_REG_P (operands[1])"
- "*
-@{
- rtx xoperands[2];
- xoperands[1] = gen_rtx (REG, SImode, REGNO (operands[1]) + 1);
-#ifdef MOTOROLA
- output_asm_insn (\"move.l %1,(sp)\", xoperands);
- output_asm_insn (\"move.l %1,-(sp)\", operands);
- return \"fmove.d (sp)+,%0\";
-#else
- output_asm_insn (\"movel %1,sp@@\", xoperands);
- output_asm_insn (\"movel %1,sp@@-\", operands);
- return \"fmoved sp@@+,%0\";
-#endif
-@}
-")
-@end smallexample
-
-@need 1000
-The effect of this optimization is to change
-
-@smallexample
-@group
-jbsr _foobar
-addql #4,sp
-movel d1,sp@@-
-movel d0,sp@@-
-fmoved sp@@+,fp0
-@end group
-@end smallexample
-
-@noindent
-into
-
-@smallexample
-@group
-jbsr _foobar
-movel d1,sp@@
-movel d0,sp@@-
-fmoved sp@@+,fp0
-@end group
-@end smallexample
-
-@ignore
-@findex CC_REVERSED
-If a peephole matches a sequence including one or more jump insns, you must
-take account of the flags such as @code{CC_REVERSED} which specify that the
-condition codes are represented in an unusual manner. The compiler
-automatically alters any ordinary conditional jumps which occur in such
-situations, but the compiler cannot alter jumps which have been replaced by
-peephole optimizations. So it is up to you to alter the assembler code
-that the peephole produces. Supply C code to write the assembler output,
-and in this C code check the condition code status flags and change the
-assembler code as appropriate.
-@end ignore
-
-@var{insn-pattern-1} and so on look @emph{almost} like the second
-operand of @code{define_insn}. There is one important difference: the
-second operand of @code{define_insn} consists of one or more RTX's
-enclosed in square brackets. Usually, there is only one: then the same
-action can be written as an element of a @code{define_peephole}. But
-when there are multiple actions in a @code{define_insn}, they are
-implicitly enclosed in a @code{parallel}. Then you must explicitly
-write the @code{parallel}, and the square brackets within it, in the
-@code{define_peephole}. Thus, if an insn pattern looks like this,
-
-@smallexample
-(define_insn "divmodsi4"
- [(set (match_operand:SI 0 "general_operand" "=d")
- (div:SI (match_operand:SI 1 "general_operand" "0")
- (match_operand:SI 2 "general_operand" "dmsK")))
- (set (match_operand:SI 3 "general_operand" "=d")
- (mod:SI (match_dup 1) (match_dup 2)))]
- "TARGET_68020"
- "divsl%.l %2,%3:%0")
-@end smallexample
-
-@noindent
-then the way to mention this insn in a peephole is as follows:
-
-@smallexample
-(define_peephole
- [@dots{}
- (parallel
- [(set (match_operand:SI 0 "general_operand" "=d")
- (div:SI (match_operand:SI 1 "general_operand" "0")
- (match_operand:SI 2 "general_operand" "dmsK")))
- (set (match_operand:SI 3 "general_operand" "=d")
- (mod:SI (match_dup 1) (match_dup 2)))])
- @dots{}]
- @dots{})
-@end smallexample
-
-@node Expander Definitions
-@section Defining RTL Sequences for Code Generation
-@cindex expander definitions
-@cindex code generation RTL sequences
-@cindex defining RTL sequences for code generation
-
-On some target machines, some standard pattern names for RTL generation
-cannot be handled with single insn, but a sequence of RTL insns can
-represent them. For these target machines, you can write a
-@code{define_expand} to specify how to generate the sequence of RTL.
-
-@findex define_expand
-A @code{define_expand} is an RTL expression that looks almost like a
-@code{define_insn}; but, unlike the latter, a @code{define_expand} is used
-only for RTL generation and it can produce more than one RTL insn.
-
-A @code{define_expand} RTX has four operands:
-
-@itemize @bullet
-@item
-The name. Each @code{define_expand} must have a name, since the only
-use for it is to refer to it by name.
-
-@findex define_peephole
-@item
-The RTL template. This is just like the RTL template for a
-@code{define_peephole} in that it is a vector of RTL expressions
-each being one insn.
-
-@item
-The condition, a string containing a C expression. This expression is
-used to express how the availability of this pattern depends on
-subclasses of target machine, selected by command-line options when GNU
-CC is run. This is just like the condition of a @code{define_insn} that
-has a standard name. Therefore, the condition (if present) may not
-depend on the data in the insn being matched, but only the
-target-machine-type flags. The compiler needs to test these conditions
-during initialization in order to learn exactly which named instructions
-are available in a particular run.
-
-@item
-The preparation statements, a string containing zero or more C
-statements which are to be executed before RTL code is generated from
-the RTL template.
-
-Usually these statements prepare temporary registers for use as
-internal operands in the RTL template, but they can also generate RTL
-insns directly by calling routines such as @code{emit_insn}, etc.
-Any such insns precede the ones that come from the RTL template.
-@end itemize
-
-Every RTL insn emitted by a @code{define_expand} must match some
-@code{define_insn} in the machine description. Otherwise, the compiler
-will crash when trying to generate code for the insn or trying to optimize
-it.
-
-The RTL template, in addition to controlling generation of RTL insns,
-also describes the operands that need to be specified when this pattern
-is used. In particular, it gives a predicate for each operand.
-
-A true operand, which needs to be specified in order to generate RTL from
-the pattern, should be described with a @code{match_operand} in its first
-occurrence in the RTL template. This enters information on the operand's
-predicate into the tables that record such things. GNU CC uses the
-information to preload the operand into a register if that is required for
-valid RTL code. If the operand is referred to more than once, subsequent
-references should use @code{match_dup}.
-
-The RTL template may also refer to internal ``operands'' which are
-temporary registers or labels used only within the sequence made by the
-@code{define_expand}. Internal operands are substituted into the RTL
-template with @code{match_dup}, never with @code{match_operand}. The
-values of the internal operands are not passed in as arguments by the
-compiler when it requests use of this pattern. Instead, they are computed
-within the pattern, in the preparation statements. These statements
-compute the values and store them into the appropriate elements of
-@code{operands} so that @code{match_dup} can find them.
-
-There are two special macros defined for use in the preparation statements:
-@code{DONE} and @code{FAIL}. Use them with a following semicolon,
-as a statement.
-
-@table @code
-
-@findex DONE
-@item DONE
-Use the @code{DONE} macro to end RTL generation for the pattern. The
-only RTL insns resulting from the pattern on this occasion will be
-those already emitted by explicit calls to @code{emit_insn} within the
-preparation statements; the RTL template will not be generated.
-
-@findex FAIL
-@item FAIL
-Make the pattern fail on this occasion. When a pattern fails, it means
-that the pattern was not truly available. The calling routines in the
-compiler will try other strategies for code generation using other patterns.
-
-Failure is currently supported only for binary (addition, multiplication,
-shifting, etc.) and bitfield (@code{extv}, @code{extzv}, and @code{insv})
-operations.
-@end table
-
-Here is an example, the definition of left-shift for the SPUR chip:
-
-@smallexample
-@group
-(define_expand "ashlsi3"
- [(set (match_operand:SI 0 "register_operand" "")
- (ashift:SI
-@end group
-@group
- (match_operand:SI 1 "register_operand" "")
- (match_operand:SI 2 "nonmemory_operand" "")))]
- ""
- "
-@end group
-@end smallexample
-
-@smallexample
-@group
-@{
- if (GET_CODE (operands[2]) != CONST_INT
- || (unsigned) INTVAL (operands[2]) > 3)
- FAIL;
-@}")
-@end group
-@end smallexample
-
-@noindent
-This example uses @code{define_expand} so that it can generate an RTL insn
-for shifting when the shift-count is in the supported range of 0 to 3 but
-fail in other cases where machine insns aren't available. When it fails,
-the compiler tries another strategy using different patterns (such as, a
-library call).
-
-If the compiler were able to handle nontrivial condition-strings in
-patterns with names, then it would be possible to use a
-@code{define_insn} in that case. Here is another case (zero-extension
-on the 68000) which makes more use of the power of @code{define_expand}:
-
-@smallexample
-(define_expand "zero_extendhisi2"
- [(set (match_operand:SI 0 "general_operand" "")
- (const_int 0))
- (set (strict_low_part
- (subreg:HI
- (match_dup 0)
- 0))
- (match_operand:HI 1 "general_operand" ""))]
- ""
- "operands[1] = make_safe_from (operands[1], operands[0]);")
-@end smallexample
-
-@noindent
-@findex make_safe_from
-Here two RTL insns are generated, one to clear the entire output operand
-and the other to copy the input operand into its low half. This sequence
-is incorrect if the input operand refers to [the old value of] the output
-operand, so the preparation statement makes sure this isn't so. The
-function @code{make_safe_from} copies the @code{operands[1]} into a
-temporary register if it refers to @code{operands[0]}. It does this
-by emitting another RTL insn.
-
-Finally, a third example shows the use of an internal operand.
-Zero-extension on the SPUR chip is done by @code{and}-ing the result
-against a halfword mask. But this mask cannot be represented by a
-@code{const_int} because the constant value is too large to be legitimate
-on this machine. So it must be copied into a register with
-@code{force_reg} and then the register used in the @code{and}.
-
-@smallexample
-(define_expand "zero_extendhisi2"
- [(set (match_operand:SI 0 "register_operand" "")
- (and:SI (subreg:SI
- (match_operand:HI 1 "register_operand" "")
- 0)
- (match_dup 2)))]
- ""
- "operands[2]
- = force_reg (SImode, GEN_INT (65535)); ")
-@end smallexample
-
-@strong{Note:} If the @code{define_expand} is used to serve a
-standard binary or unary arithmetic operation or a bitfield operation,
-then the last insn it generates must not be a @code{code_label},
-@code{barrier} or @code{note}. It must be an @code{insn},
-@code{jump_insn} or @code{call_insn}. If you don't need a real insn
-at the end, emit an insn to copy the result of the operation into
-itself. Such an insn will generate no code, but it can avoid problems
-in the compiler.@refill
-
-@node Insn Splitting
-@section Defining How to Split Instructions
-@cindex insn splitting
-@cindex instruction splitting
-@cindex splitting instructions
-
-There are two cases where you should specify how to split a pattern into
-multiple insns. On machines that have instructions requiring delay
-slots (@pxref{Delay Slots}) or that have instructions whose output is
-not available for multiple cycles (@pxref{Function Units}), the compiler
-phases that optimize these cases need to be able to move insns into
-one-instruction delay slots. However, some insns may generate more than one
-machine instruction. These insns cannot be placed into a delay slot.
-
-Often you can rewrite the single insn as a list of individual insns,
-each corresponding to one machine instruction. The disadvantage of
-doing so is that it will cause the compilation to be slower and require
-more space. If the resulting insns are too complex, it may also
-suppress some optimizations. The compiler splits the insn if there is a
-reason to believe that it might improve instruction or delay slot
-scheduling.
-
-The insn combiner phase also splits putative insns. If three insns are
-merged into one insn with a complex expression that cannot be matched by
-some @code{define_insn} pattern, the combiner phase attempts to split
-the complex pattern into two insns that are recognized. Usually it can
-break the complex pattern into two patterns by splitting out some
-subexpression. However, in some other cases, such as performing an
-addition of a large constant in two insns on a RISC machine, the way to
-split the addition into two insns is machine-dependent.
-
-@cindex define_split
-The @code{define_split} definition tells the compiler how to split a
-complex insn into several simpler insns. It looks like this:
-
-@smallexample
-(define_split
- [@var{insn-pattern}]
- "@var{condition}"
- [@var{new-insn-pattern-1}
- @var{new-insn-pattern-2}
- @dots{}]
- "@var{preparation statements}")
-@end smallexample
-
-@var{insn-pattern} is a pattern that needs to be split and
-@var{condition} is the final condition to be tested, as in a
-@code{define_insn}. When an insn matching @var{insn-pattern} and
-satisfying @var{condition} is found, it is replaced in the insn list
-with the insns given by @var{new-insn-pattern-1},
-@var{new-insn-pattern-2}, etc.
-
-The @var{preparation statements} are similar to those statements that
-are specified for @code{define_expand} (@pxref{Expander Definitions})
-and are executed before the new RTL is generated to prepare for the
-generated code or emit some insns whose pattern is not fixed. Unlike
-those in @code{define_expand}, however, these statements must not
-generate any new pseudo-registers. Once reload has completed, they also
-must not allocate any space in the stack frame.
-
-Patterns are matched against @var{insn-pattern} in two different
-circumstances. If an insn needs to be split for delay slot scheduling
-or insn scheduling, the insn is already known to be valid, which means
-that it must have been matched by some @code{define_insn} and, if
-@code{reload_completed} is non-zero, is known to satisfy the constraints
-of that @code{define_insn}. In that case, the new insn patterns must
-also be insns that are matched by some @code{define_insn} and, if
-@code{reload_completed} is non-zero, must also satisfy the constraints
-of those definitions.
-
-As an example of this usage of @code{define_split}, consider the following
-example from @file{a29k.md}, which splits a @code{sign_extend} from
-@code{HImode} to @code{SImode} into a pair of shift insns:
-
-@smallexample
-(define_split
- [(set (match_operand:SI 0 "gen_reg_operand" "")
- (sign_extend:SI (match_operand:HI 1 "gen_reg_operand" "")))]
- ""
- [(set (match_dup 0)
- (ashift:SI (match_dup 1)
- (const_int 16)))
- (set (match_dup 0)
- (ashiftrt:SI (match_dup 0)
- (const_int 16)))]
- "
-@{ operands[1] = gen_lowpart (SImode, operands[1]); @}")
-@end smallexample
-
-When the combiner phase tries to split an insn pattern, it is always the
-case that the pattern is @emph{not} matched by any @code{define_insn}.
-The combiner pass first tries to split a single @code{set} expression
-and then the same @code{set} expression inside a @code{parallel}, but
-followed by a @code{clobber} of a pseudo-reg to use as a scratch
-register. In these cases, the combiner expects exactly two new insn
-patterns to be generated. It will verify that these patterns match some
-@code{define_insn} definitions, so you need not do this test in the
-@code{define_split} (of course, there is no point in writing a
-@code{define_split} that will never produce insns that match).
-
-Here is an example of this use of @code{define_split}, taken from
-@file{rs6000.md}:
-
-@smallexample
-(define_split
- [(set (match_operand:SI 0 "gen_reg_operand" "")
- (plus:SI (match_operand:SI 1 "gen_reg_operand" "")
- (match_operand:SI 2 "non_add_cint_operand" "")))]
- ""
- [(set (match_dup 0) (plus:SI (match_dup 1) (match_dup 3)))
- (set (match_dup 0) (plus:SI (match_dup 0) (match_dup 4)))]
-"
-@{
- int low = INTVAL (operands[2]) & 0xffff;
- int high = (unsigned) INTVAL (operands[2]) >> 16;
-
- if (low & 0x8000)
- high++, low |= 0xffff0000;
-
- operands[3] = GEN_INT (high << 16);
- operands[4] = GEN_INT (low);
-@}")
-@end smallexample
-
-Here the predicate @code{non_add_cint_operand} matches any
-@code{const_int} that is @emph{not} a valid operand of a single add
-insn. The add with the smaller displacement is written so that it
-can be substituted into the address of a subsequent operation.
-
-An example that uses a scratch register, from the same file, generates
-an equality comparison of a register and a large constant:
-
-@smallexample
-(define_split
- [(set (match_operand:CC 0 "cc_reg_operand" "")
- (compare:CC (match_operand:SI 1 "gen_reg_operand" "")
- (match_operand:SI 2 "non_short_cint_operand" "")))
- (clobber (match_operand:SI 3 "gen_reg_operand" ""))]
- "find_single_use (operands[0], insn, 0)
- && (GET_CODE (*find_single_use (operands[0], insn, 0)) == EQ
- || GET_CODE (*find_single_use (operands[0], insn, 0)) == NE)"
- [(set (match_dup 3) (xor:SI (match_dup 1) (match_dup 4)))
- (set (match_dup 0) (compare:CC (match_dup 3) (match_dup 5)))]
- "
-@{
- /* Get the constant we are comparing against, C, and see what it
- looks like sign-extended to 16 bits. Then see what constant
- could be XOR'ed with C to get the sign-extended value. */
-
- int c = INTVAL (operands[2]);
- int sextc = (c << 16) >> 16;
- int xorv = c ^ sextc;
-
- operands[4] = GEN_INT (xorv);
- operands[5] = GEN_INT (sextc);
-@}")
-@end smallexample
-
-To avoid confusion, don't write a single @code{define_split} that
-accepts some insns that match some @code{define_insn} as well as some
-insns that don't. Instead, write two separate @code{define_split}
-definitions, one for the insns that are valid and one for the insns that
-are not valid.
-
-@node Insn Attributes
-@section Instruction Attributes
-@cindex insn attributes
-@cindex instruction attributes
-
-In addition to describing the instruction supported by the target machine,
-the @file{md} file also defines a group of @dfn{attributes} and a set of
-values for each. Every generated insn is assigned a value for each attribute.
-One possible attribute would be the effect that the insn has on the machine's
-condition code. This attribute can then be used by @code{NOTICE_UPDATE_CC}
-to track the condition codes.
-
-@menu
-* Defining Attributes:: Specifying attributes and their values.
-* Expressions:: Valid expressions for attribute values.
-* Tagging Insns:: Assigning attribute values to insns.
-* Attr Example:: An example of assigning attributes.
-* Insn Lengths:: Computing the length of insns.
-* Constant Attributes:: Defining attributes that are constant.
-* Delay Slots:: Defining delay slots required for a machine.
-* Function Units:: Specifying information for insn scheduling.
-@end menu
-
-@node Defining Attributes
-@subsection Defining Attributes and their Values
-@cindex defining attributes and their values
-@cindex attributes, defining
-
-@findex define_attr
-The @code{define_attr} expression is used to define each attribute required
-by the target machine. It looks like:
-
-@smallexample
-(define_attr @var{name} @var{list-of-values} @var{default})
-@end smallexample
-
-@var{name} is a string specifying the name of the attribute being defined.
-
-@var{list-of-values} is either a string that specifies a comma-separated
-list of values that can be assigned to the attribute, or a null string to
-indicate that the attribute takes numeric values.
-
-@var{default} is an attribute expression that gives the value of this
-attribute for insns that match patterns whose definition does not include
-an explicit value for this attribute. @xref{Attr Example}, for more
-information on the handling of defaults. @xref{Constant Attributes},
-for information on attributes that do not depend on any particular insn.
-
-@findex insn-attr.h
-For each defined attribute, a number of definitions are written to the
-@file{insn-attr.h} file. For cases where an explicit set of values is
-specified for an attribute, the following are defined:
-
-@itemize @bullet
-@item
-A @samp{#define} is written for the symbol @samp{HAVE_ATTR_@var{name}}.
-
-@item
-An enumeral class is defined for @samp{attr_@var{name}} with
-elements of the form @samp{@var{upper-name}_@var{upper-value}} where
-the attribute name and value are first converted to upper case.
-
-@item
-A function @samp{get_attr_@var{name}} is defined that is passed an insn and
-returns the attribute value for that insn.
-@end itemize
-
-For example, if the following is present in the @file{md} file:
-
-@smallexample
-(define_attr "type" "branch,fp,load,store,arith" @dots{})
-@end smallexample
-
-@noindent
-the following lines will be written to the file @file{insn-attr.h}.
-
-@smallexample
-#define HAVE_ATTR_type
-enum attr_type @{TYPE_BRANCH, TYPE_FP, TYPE_LOAD,
- TYPE_STORE, TYPE_ARITH@};
-extern enum attr_type get_attr_type ();
-@end smallexample
-
-If the attribute takes numeric values, no @code{enum} type will be
-defined and the function to obtain the attribute's value will return
-@code{int}.
-
-@node Expressions
-@subsection Attribute Expressions
-@cindex attribute expressions
-
-RTL expressions used to define attributes use the codes described above
-plus a few specific to attribute definitions, to be discussed below.
-Attribute value expressions must have one of the following forms:
-
-@table @code
-@cindex @code{const_int} and attributes
-@item (const_int @var{i})
-The integer @var{i} specifies the value of a numeric attribute. @var{i}
-must be non-negative.
-
-The value of a numeric attribute can be specified either with a
-@code{const_int}, or as an integer represented as a string in
-@code{const_string}, @code{eq_attr} (see below), @code{attr},
-@code{symbol_ref}, simple arithmetic expressions, and @code{set_attr}
-overrides on specific instructions (@pxref{Tagging Insns}).
-
-@cindex @code{const_string} and attributes
-@item (const_string @var{value})
-The string @var{value} specifies a constant attribute value.
-If @var{value} is specified as @samp{"*"}, it means that the default value of
-the attribute is to be used for the insn containing this expression.
-@samp{"*"} obviously cannot be used in the @var{default} expression
-of a @code{define_attr}.@refill
-
-If the attribute whose value is being specified is numeric, @var{value}
-must be a string containing a non-negative integer (normally
-@code{const_int} would be used in this case). Otherwise, it must
-contain one of the valid values for the attribute.
-
-@cindex @code{if_then_else} and attributes
-@item (if_then_else @var{test} @var{true-value} @var{false-value})
-@var{test} specifies an attribute test, whose format is defined below.
-The value of this expression is @var{true-value} if @var{test} is true,
-otherwise it is @var{false-value}.
-
-@cindex @code{cond} and attributes
-@item (cond [@var{test1} @var{value1} @dots{}] @var{default})
-The first operand of this expression is a vector containing an even
-number of expressions and consisting of pairs of @var{test} and @var{value}
-expressions. The value of the @code{cond} expression is that of the
-@var{value} corresponding to the first true @var{test} expression. If
-none of the @var{test} expressions are true, the value of the @code{cond}
-expression is that of the @var{default} expression.
-@end table
-
-@var{test} expressions can have one of the following forms:
-
-@table @code
-@cindex @code{const_int} and attribute tests
-@item (const_int @var{i})
-This test is true if @var{i} is non-zero and false otherwise.
-
-@cindex @code{not} and attributes
-@cindex @code{ior} and attributes
-@cindex @code{and} and attributes
-@item (not @var{test})
-@itemx (ior @var{test1} @var{test2})
-@itemx (and @var{test1} @var{test2})
-These tests are true if the indicated logical function is true.
-
-@cindex @code{match_operand} and attributes
-@item (match_operand:@var{m} @var{n} @var{pred} @var{constraints})
-This test is true if operand @var{n} of the insn whose attribute value
-is being determined has mode @var{m} (this part of the test is ignored
-if @var{m} is @code{VOIDmode}) and the function specified by the string
-@var{pred} returns a non-zero value when passed operand @var{n} and mode
-@var{m} (this part of the test is ignored if @var{pred} is the null
-string).
-
-The @var{constraints} operand is ignored and should be the null string.
-
-@cindex @code{le} and attributes
-@cindex @code{leu} and attributes
-@cindex @code{lt} and attributes
-@cindex @code{gt} and attributes
-@cindex @code{gtu} and attributes
-@cindex @code{ge} and attributes
-@cindex @code{geu} and attributes
-@cindex @code{ne} and attributes
-@cindex @code{eq} and attributes
-@cindex @code{plus} and attributes
-@cindex @code{minus} and attributes
-@cindex @code{mult} and attributes
-@cindex @code{div} and attributes
-@cindex @code{mod} and attributes
-@cindex @code{abs} and attributes
-@cindex @code{neg} and attributes
-@cindex @code{ashift} and attributes
-@cindex @code{lshiftrt} and attributes
-@cindex @code{ashiftrt} and attributes
-@item (le @var{arith1} @var{arith2})
-@itemx (leu @var{arith1} @var{arith2})
-@itemx (lt @var{arith1} @var{arith2})
-@itemx (ltu @var{arith1} @var{arith2})
-@itemx (gt @var{arith1} @var{arith2})
-@itemx (gtu @var{arith1} @var{arith2})
-@itemx (ge @var{arith1} @var{arith2})
-@itemx (geu @var{arith1} @var{arith2})
-@itemx (ne @var{arith1} @var{arith2})
-@itemx (eq @var{arith1} @var{arith2})
-These tests are true if the indicated comparison of the two arithmetic
-expressions is true. Arithmetic expressions are formed with
-@code{plus}, @code{minus}, @code{mult}, @code{div}, @code{mod},
-@code{abs}, @code{neg}, @code{and}, @code{ior}, @code{xor}, @code{not},
-@code{ashift}, @code{lshiftrt}, and @code{ashiftrt} expressions.@refill
-
-@findex get_attr
-@code{const_int} and @code{symbol_ref} are always valid terms (@pxref{Insn
-Lengths},for additional forms). @code{symbol_ref} is a string
-denoting a C expression that yields an @code{int} when evaluated by the
-@samp{get_attr_@dots{}} routine. It should normally be a global
-variable.@refill
-
-@findex eq_attr
-@item (eq_attr @var{name} @var{value})
-@var{name} is a string specifying the name of an attribute.
-
-@var{value} is a string that is either a valid value for attribute
-@var{name}, a comma-separated list of values, or @samp{!} followed by a
-value or list. If @var{value} does not begin with a @samp{!}, this
-test is true if the value of the @var{name} attribute of the current
-insn is in the list specified by @var{value}. If @var{value} begins
-with a @samp{!}, this test is true if the attribute's value is
-@emph{not} in the specified list.
-
-For example,
-
-@smallexample
-(eq_attr "type" "load,store")
-@end smallexample
-
-@noindent
-is equivalent to
-
-@smallexample
-(ior (eq_attr "type" "load") (eq_attr "type" "store"))
-@end smallexample
-
-If @var{name} specifies an attribute of @samp{alternative}, it refers to the
-value of the compiler variable @code{which_alternative}
-(@pxref{Output Statement}) and the values must be small integers. For
-example,@refill
-
-@smallexample
-(eq_attr "alternative" "2,3")
-@end smallexample
-
-@noindent
-is equivalent to
-
-@smallexample
-(ior (eq (symbol_ref "which_alternative") (const_int 2))
- (eq (symbol_ref "which_alternative") (const_int 3)))
-@end smallexample
-
-Note that, for most attributes, an @code{eq_attr} test is simplified in cases
-where the value of the attribute being tested is known for all insns matching
-a particular pattern. This is by far the most common case.@refill
-
-@findex attr_flag
-@item (attr_flag @var{name})
-The value of an @code{attr_flag} expression is true if the flag
-specified by @var{name} is true for the @code{insn} currently being
-scheduled.
-
-@var{name} is a string specifying one of a fixed set of flags to test.
-Test the flags @code{forward} and @code{backward} to determine the
-direction of a conditional branch. Test the flags @code{very_likely},
-@code{likely}, @code{very_unlikely}, and @code{unlikely} to determine
-if a conditional branch is expected to be taken.
-
-If the @code{very_likely} flag is true, then the @code{likely} flag is also
-true. Likewise for the @code{very_unlikely} and @code{unlikely} flags.
-
-This example describes a conditional branch delay slot which
-can be nullified for forward branches that are taken (annul-true) or
-for backward branches which are not taken (annul-false).
-
-@smallexample
-(define_delay (eq_attr "type" "cbranch")
- [(eq_attr "in_branch_delay" "true")
- (and (eq_attr "in_branch_delay" "true")
- (attr_flag "forward"))
- (and (eq_attr "in_branch_delay" "true")
- (attr_flag "backward"))])
-@end smallexample
-
-The @code{forward} and @code{backward} flags are false if the current
-@code{insn} being scheduled is not a conditional branch.
-
-The @code{very_likely} and @code{likely} flags are true if the
-@code{insn} being scheduled is not a conditional branch.
-The @code{very_unlikely} and @code{unlikely} flags are false if the
-@code{insn} being scheduled is not a conditional branch.
-
-@code{attr_flag} is only used during delay slot scheduling and has no
-meaning to other passes of the compiler.
-
-@findex attr
-@item (attr @var{name})
-The value of another attribute is returned. This is most useful
-for numeric attributes, as @code{eq_attr} and @code{attr_flag}
-produce more efficient code for non-numeric attributes.
-@end table
-
-@node Tagging Insns
-@subsection Assigning Attribute Values to Insns
-@cindex tagging insns
-@cindex assigning attribute values to insns
-
-The value assigned to an attribute of an insn is primarily determined by
-which pattern is matched by that insn (or which @code{define_peephole}
-generated it). Every @code{define_insn} and @code{define_peephole} can
-have an optional last argument to specify the values of attributes for
-matching insns. The value of any attribute not specified in a particular
-insn is set to the default value for that attribute, as specified in its
-@code{define_attr}. Extensive use of default values for attributes
-permits the specification of the values for only one or two attributes
-in the definition of most insn patterns, as seen in the example in the
-next section.@refill
-
-The optional last argument of @code{define_insn} and
-@code{define_peephole} is a vector of expressions, each of which defines
-the value for a single attribute. The most general way of assigning an
-attribute's value is to use a @code{set} expression whose first operand is an
-@code{attr} expression giving the name of the attribute being set. The
-second operand of the @code{set} is an attribute expression
-(@pxref{Expressions}) giving the value of the attribute.@refill
-
-When the attribute value depends on the @samp{alternative} attribute
-(i.e., which is the applicable alternative in the constraint of the
-insn), the @code{set_attr_alternative} expression can be used. It
-allows the specification of a vector of attribute expressions, one for
-each alternative.
-
-@findex set_attr
-When the generality of arbitrary attribute expressions is not required,
-the simpler @code{set_attr} expression can be used, which allows
-specifying a string giving either a single attribute value or a list
-of attribute values, one for each alternative.
-
-The form of each of the above specifications is shown below. In each case,
-@var{name} is a string specifying the attribute to be set.
-
-@table @code
-@item (set_attr @var{name} @var{value-string})
-@var{value-string} is either a string giving the desired attribute value,
-or a string containing a comma-separated list giving the values for
-succeeding alternatives. The number of elements must match the number
-of alternatives in the constraint of the insn pattern.
-
-Note that it may be useful to specify @samp{*} for some alternative, in
-which case the attribute will assume its default value for insns matching
-that alternative.
-
-@findex set_attr_alternative
-@item (set_attr_alternative @var{name} [@var{value1} @var{value2} @dots{}])
-Depending on the alternative of the insn, the value will be one of the
-specified values. This is a shorthand for using a @code{cond} with
-tests on the @samp{alternative} attribute.
-
-@findex attr
-@item (set (attr @var{name}) @var{value})
-The first operand of this @code{set} must be the special RTL expression
-@code{attr}, whose sole operand is a string giving the name of the
-attribute being set. @var{value} is the value of the attribute.
-@end table
-
-The following shows three different ways of representing the same
-attribute value specification:
-
-@smallexample
-(set_attr "type" "load,store,arith")
-
-(set_attr_alternative "type"
- [(const_string "load") (const_string "store")
- (const_string "arith")])
-
-(set (attr "type")
- (cond [(eq_attr "alternative" "1") (const_string "load")
- (eq_attr "alternative" "2") (const_string "store")]
- (const_string "arith")))
-@end smallexample
-
-@need 1000
-@findex define_asm_attributes
-The @code{define_asm_attributes} expression provides a mechanism to
-specify the attributes assigned to insns produced from an @code{asm}
-statement. It has the form:
-
-@smallexample
-(define_asm_attributes [@var{attr-sets}])
-@end smallexample
-
-@noindent
-where @var{attr-sets} is specified the same as for both the
-@code{define_insn} and the @code{define_peephole} expressions.
-
-These values will typically be the ``worst case'' attribute values. For
-example, they might indicate that the condition code will be clobbered.
-
-A specification for a @code{length} attribute is handled specially. The
-way to compute the length of an @code{asm} insn is to multiply the
-length specified in the expression @code{define_asm_attributes} by the
-number of machine instructions specified in the @code{asm} statement,
-determined by counting the number of semicolons and newlines in the
-string. Therefore, the value of the @code{length} attribute specified
-in a @code{define_asm_attributes} should be the maximum possible length
-of a single machine instruction.
-
-@node Attr Example
-@subsection Example of Attribute Specifications
-@cindex attribute specifications example
-@cindex attribute specifications
-
-The judicious use of defaulting is important in the efficient use of
-insn attributes. Typically, insns are divided into @dfn{types} and an
-attribute, customarily called @code{type}, is used to represent this
-value. This attribute is normally used only to define the default value
-for other attributes. An example will clarify this usage.
-
-Assume we have a RISC machine with a condition code and in which only
-full-word operations are performed in registers. Let us assume that we
-can divide all insns into loads, stores, (integer) arithmetic
-operations, floating point operations, and branches.
-
-Here we will concern ourselves with determining the effect of an insn on
-the condition code and will limit ourselves to the following possible
-effects: The condition code can be set unpredictably (clobbered), not
-be changed, be set to agree with the results of the operation, or only
-changed if the item previously set into the condition code has been
-modified.
-
-Here is part of a sample @file{md} file for such a machine:
-
-@smallexample
-(define_attr "type" "load,store,arith,fp,branch" (const_string "arith"))
-
-(define_attr "cc" "clobber,unchanged,set,change0"
- (cond [(eq_attr "type" "load")
- (const_string "change0")
- (eq_attr "type" "store,branch")
- (const_string "unchanged")
- (eq_attr "type" "arith")
- (if_then_else (match_operand:SI 0 "" "")
- (const_string "set")
- (const_string "clobber"))]
- (const_string "clobber")))
-
-(define_insn ""
- [(set (match_operand:SI 0 "general_operand" "=r,r,m")
- (match_operand:SI 1 "general_operand" "r,m,r"))]
- ""
- "@@
- move %0,%1
- load %0,%1
- store %0,%1"
- [(set_attr "type" "arith,load,store")])
-@end smallexample
-
-Note that we assume in the above example that arithmetic operations
-performed on quantities smaller than a machine word clobber the condition
-code since they will set the condition code to a value corresponding to the
-full-word result.
-
-@node Insn Lengths
-@subsection Computing the Length of an Insn
-@cindex insn lengths, computing
-@cindex computing the length of an insn
-
-For many machines, multiple types of branch instructions are provided, each
-for different length branch displacements. In most cases, the assembler
-will choose the correct instruction to use. However, when the assembler
-cannot do so, GCC can when a special attribute, the @samp{length}
-attribute, is defined. This attribute must be defined to have numeric
-values by specifying a null string in its @code{define_attr}.
-
-In the case of the @samp{length} attribute, two additional forms of
-arithmetic terms are allowed in test expressions:
-
-@table @code
-@cindex @code{match_dup} and attributes
-@item (match_dup @var{n})
-This refers to the address of operand @var{n} of the current insn, which
-must be a @code{label_ref}.
-
-@cindex @code{pc} and attributes
-@item (pc)
-This refers to the address of the @emph{current} insn. It might have
-been more consistent with other usage to make this the address of the
-@emph{next} insn but this would be confusing because the length of the
-current insn is to be computed.
-@end table
-
-@cindex @code{addr_vec}, length of
-@cindex @code{addr_diff_vec}, length of
-For normal insns, the length will be determined by value of the
-@samp{length} attribute. In the case of @code{addr_vec} and
-@code{addr_diff_vec} insn patterns, the length is computed as
-the number of vectors multiplied by the size of each vector.
-
-Lengths are measured in addressable storage units (bytes).
-
-The following macros can be used to refine the length computation:
-
-@table @code
-@findex FIRST_INSN_ADDRESS
-@item FIRST_INSN_ADDRESS
-When the @code{length} insn attribute is used, this macro specifies the
-value to be assigned to the address of the first insn in a function. If
-not specified, 0 is used.
-
-@findex ADJUST_INSN_LENGTH
-@item ADJUST_INSN_LENGTH (@var{insn}, @var{length})
-If defined, modifies the length assigned to instruction @var{insn} as a
-function of the context in which it is used. @var{length} is an lvalue
-that contains the initially computed length of the insn and should be
-updated with the correct length of the insn.
-
-This macro will normally not be required. A case in which it is
-required is the ROMP. On this machine, the size of an @code{addr_vec}
-insn must be increased by two to compensate for the fact that alignment
-may be required.
-@end table
-
-@findex get_attr_length
-The routine that returns @code{get_attr_length} (the value of the
-@code{length} attribute) can be used by the output routine to
-determine the form of the branch instruction to be written, as the
-example below illustrates.
-
-As an example of the specification of variable-length branches, consider
-the IBM 360. If we adopt the convention that a register will be set to
-the starting address of a function, we can jump to labels within 4k of
-the start using a four-byte instruction. Otherwise, we need a six-byte
-sequence to load the address from memory and then branch to it.
-
-On such a machine, a pattern for a branch instruction might be specified
-as follows:
-
-@smallexample
-(define_insn "jump"
- [(set (pc)
- (label_ref (match_operand 0 "" "")))]
- ""
- "*
-@{
- return (get_attr_length (insn) == 4
- ? \"b %l0\" : \"l r15,=a(%l0); br r15\");
-@}"
- [(set (attr "length") (if_then_else (lt (match_dup 0) (const_int 4096))
- (const_int 4)
- (const_int 6)))])
-@end smallexample
-
-@node Constant Attributes
-@subsection Constant Attributes
-@cindex constant attributes
-
-A special form of @code{define_attr}, where the expression for the
-default value is a @code{const} expression, indicates an attribute that
-is constant for a given run of the compiler. Constant attributes may be
-used to specify which variety of processor is used. For example,
-
-@smallexample
-(define_attr "cpu" "m88100,m88110,m88000"
- (const
- (cond [(symbol_ref "TARGET_88100") (const_string "m88100")
- (symbol_ref "TARGET_88110") (const_string "m88110")]
- (const_string "m88000"))))
-
-(define_attr "memory" "fast,slow"
- (const
- (if_then_else (symbol_ref "TARGET_FAST_MEM")
- (const_string "fast")
- (const_string "slow"))))
-@end smallexample
-
-The routine generated for constant attributes has no parameters as it
-does not depend on any particular insn. RTL expressions used to define
-the value of a constant attribute may use the @code{symbol_ref} form,
-but may not use either the @code{match_operand} form or @code{eq_attr}
-forms involving insn attributes.
-
-@node Delay Slots
-@subsection Delay Slot Scheduling
-@cindex delay slots, defining
-
-The insn attribute mechanism can be used to specify the requirements for
-delay slots, if any, on a target machine. An instruction is said to
-require a @dfn{delay slot} if some instructions that are physically
-after the instruction are executed as if they were located before it.
-Classic examples are branch and call instructions, which often execute
-the following instruction before the branch or call is performed.
-
-On some machines, conditional branch instructions can optionally
-@dfn{annul} instructions in the delay slot. This means that the
-instruction will not be executed for certain branch outcomes. Both
-instructions that annul if the branch is true and instructions that
-annul if the branch is false are supported.
-
-Delay slot scheduling differs from instruction scheduling in that
-determining whether an instruction needs a delay slot is dependent only
-on the type of instruction being generated, not on data flow between the
-instructions. See the next section for a discussion of data-dependent
-instruction scheduling.
-
-@findex define_delay
-The requirement of an insn needing one or more delay slots is indicated
-via the @code{define_delay} expression. It has the following form:
-
-@smallexample
-(define_delay @var{test}
- [@var{delay-1} @var{annul-true-1} @var{annul-false-1}
- @var{delay-2} @var{annul-true-2} @var{annul-false-2}
- @dots{}])
-@end smallexample
-
-@var{test} is an attribute test that indicates whether this
-@code{define_delay} applies to a particular insn. If so, the number of
-required delay slots is determined by the length of the vector specified
-as the second argument. An insn placed in delay slot @var{n} must
-satisfy attribute test @var{delay-n}. @var{annul-true-n} is an
-attribute test that specifies which insns may be annulled if the branch
-is true. Similarly, @var{annul-false-n} specifies which insns in the
-delay slot may be annulled if the branch is false. If annulling is not
-supported for that delay slot, @code{(nil)} should be coded.@refill
-
-For example, in the common case where branch and call insns require
-a single delay slot, which may contain any insn other than a branch or
-call, the following would be placed in the @file{md} file:
-
-@smallexample
-(define_delay (eq_attr "type" "branch,call")
- [(eq_attr "type" "!branch,call") (nil) (nil)])
-@end smallexample
-
-Multiple @code{define_delay} expressions may be specified. In this
-case, each such expression specifies different delay slot requirements
-and there must be no insn for which tests in two @code{define_delay}
-expressions are both true.
-
-For example, if we have a machine that requires one delay slot for branches
-but two for calls, no delay slot can contain a branch or call insn,
-and any valid insn in the delay slot for the branch can be annulled if the
-branch is true, we might represent this as follows:
-
-@smallexample
-(define_delay (eq_attr "type" "branch")
- [(eq_attr "type" "!branch,call")
- (eq_attr "type" "!branch,call")
- (nil)])
-
-(define_delay (eq_attr "type" "call")
- [(eq_attr "type" "!branch,call") (nil) (nil)
- (eq_attr "type" "!branch,call") (nil) (nil)])
-@end smallexample
-@c the above is *still* too long. --mew 4feb93
-
-@node Function Units
-@subsection Specifying Function Units
-@cindex function units, for scheduling
-
-On most RISC machines, there are instructions whose results are not
-available for a specific number of cycles. Common cases are instructions
-that load data from memory. On many machines, a pipeline stall will result
-if the data is referenced too soon after the load instruction.
-
-In addition, many newer microprocessors have multiple function units, usually
-one for integer and one for floating point, and often will incur pipeline
-stalls when a result that is needed is not yet ready.
-
-The descriptions in this section allow the specification of how much
-time must elapse between the execution of an instruction and the time
-when its result is used. It also allows specification of when the
-execution of an instruction will delay execution of similar instructions
-due to function unit conflicts.
-
-For the purposes of the specifications in this section, a machine is
-divided into @dfn{function units}, each of which execute a specific
-class of instructions in first-in-first-out order. Function units that
-accept one instruction each cycle and allow a result to be used in the
-succeeding instruction (usually via forwarding) need not be specified.
-Classic RISC microprocessors will normally have a single function unit,
-which we can call @samp{memory}. The newer ``superscalar'' processors
-will often have function units for floating point operations, usually at
-least a floating point adder and multiplier.
-
-@findex define_function_unit
-Each usage of a function units by a class of insns is specified with a
-@code{define_function_unit} expression, which looks like this:
-
-@smallexample
-(define_function_unit @var{name} @var{multiplicity} @var{simultaneity}
- @var{test} @var{ready-delay} @var{issue-delay}
- [@var{conflict-list}])
-@end smallexample
-
-@var{name} is a string giving the name of the function unit.
-
-@var{multiplicity} is an integer specifying the number of identical
-units in the processor. If more than one unit is specified, they will
-be scheduled independently. Only truly independent units should be
-counted; a pipelined unit should be specified as a single unit. (The
-only common example of a machine that has multiple function units for a
-single instruction class that are truly independent and not pipelined
-are the two multiply and two increment units of the CDC 6600.)
-
-@var{simultaneity} specifies the maximum number of insns that can be
-executing in each instance of the function unit simultaneously or zero
-if the unit is pipelined and has no limit.
-
-All @code{define_function_unit} definitions referring to function unit
-@var{name} must have the same name and values for @var{multiplicity} and
-@var{simultaneity}.
-
-@var{test} is an attribute test that selects the insns we are describing
-in this definition. Note that an insn may use more than one function
-unit and a function unit may be specified in more than one
-@code{define_function_unit}.
-
-@var{ready-delay} is an integer that specifies the number of cycles
-after which the result of the instruction can be used without
-introducing any stalls.
-
-@var{issue-delay} is an integer that specifies the number of cycles
-after the instruction matching the @var{test} expression begins using
-this unit until a subsequent instruction can begin. A cost of @var{N}
-indicates an @var{N-1} cycle delay. A subsequent instruction may also
-be delayed if an earlier instruction has a longer @var{ready-delay}
-value. This blocking effect is computed using the @var{simultaneity},
-@var{ready-delay}, @var{issue-delay}, and @var{conflict-list} terms.
-For a normal non-pipelined function unit, @var{simultaneity} is one, the
-unit is taken to block for the @var{ready-delay} cycles of the executing
-insn, and smaller values of @var{issue-delay} are ignored.
-
-@var{conflict-list} is an optional list giving detailed conflict costs
-for this unit. If specified, it is a list of condition test expressions
-to be applied to insns chosen to execute in @var{name} following the
-particular insn matching @var{test} that is already executing in
-@var{name}. For each insn in the list, @var{issue-delay} specifies the
-conflict cost; for insns not in the list, the cost is zero. If not
-specified, @var{conflict-list} defaults to all instructions that use the
-function unit.
-
-Typical uses of this vector are where a floating point function unit can
-pipeline either single- or double-precision operations, but not both, or
-where a memory unit can pipeline loads, but not stores, etc.
-
-As an example, consider a classic RISC machine where the result of a
-load instruction is not available for two cycles (a single ``delay''
-instruction is required) and where only one load instruction can be executed
-simultaneously. This would be specified as:
-
-@smallexample
-(define_function_unit "memory" 1 1 (eq_attr "type" "load") 2 0)
-@end smallexample
-
-For the case of a floating point function unit that can pipeline either
-single or double precision, but not both, the following could be specified:
-
-@smallexample
-(define_function_unit
- "fp" 1 0 (eq_attr "type" "sp_fp") 4 4 [(eq_attr "type" "dp_fp")])
-(define_function_unit
- "fp" 1 0 (eq_attr "type" "dp_fp") 4 4 [(eq_attr "type" "sp_fp")])
-@end smallexample
-
-@strong{Note:} The scheduler attempts to avoid function unit conflicts
-and uses all the specifications in the @code{define_function_unit}
-expression. It has recently come to our attention that these
-specifications may not allow modeling of some of the newer
-``superscalar'' processors that have insns using multiple pipelined
-units. These insns will cause a potential conflict for the second unit
-used during their execution and there is no way of representing that
-conflict. We welcome any examples of how function unit conflicts work
-in such processors and suggestions for their representation.
-@end ifset
diff --git a/contrib/gcc/objc/Makefile.in b/contrib/gcc/objc/Makefile.in
deleted file mode 100644
index 71c564c6c59c..000000000000
--- a/contrib/gcc/objc/Makefile.in
+++ /dev/null
@@ -1,73 +0,0 @@
-# GNU Objective C frontend Makefile
-# Copyright (C) 1993, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
-#
-# This file is part of GNU CC.
-#
-# GNU CC 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.
-#
-# GNU CC is distributed in the hope that it will be useful, but WITHOUT ANY
-# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
-# details.
-#
-# You should have received a copy of the GNU General Public License along with
-# GNU CC; see the file COPYING. If not, write to the Free Software
-# Foundation, 59 Temple Place - Suite 330,
-# Boston, MA 02111-1307, USA.
-
-# The Makefile built from this file lives in the objc language subdirectory.
-# Its purpose is to provide support for:
-#
-# 1. recursion where necessary, and only then (building .o's), and
-# 2. building and debugging cc1objc from the language subdirectory.
-#
-# The parent Makefile handles all other chores, with help from the language
-# Makefile fragment.
-#
-# The targets for external use are `all' and `mostlyclean'.
-
-SHELL=/bin/sh
-
-OPTIMIZE= -O
-
-srcdir = .
-VPATH = $(srcdir)
-
-AR = ar
-AR_FLAGS = rc
-
-# Define this as & to perform parallel make on a Sequent.
-# Note that this has some bugs, and it seems currently necessary
-# to compile all the gen* files first by hand to avoid erroneous results.
-P =
-
-# Definition of `all' is here so that new rules inserted by sed
-# do not specify the default target.
-all: all.indirect
-
-# sed inserts variable overrides after the following line.
-####target overrides
-####host overrides
-####cross overrides
-####build overrides
-#
-
-# Now figure out from those variables how to compile and link.
-all.indirect: Makefile frontend
-
-frontend:
- cd ..; $(MAKE) cc1obj$(exeext)
-
-Makefile: $(srcdir)/Makefile.in $(srcdir)/../configure
- cd ..; $(SHELL) config.status
-
-mostlyclean:
- -rm -f *.o xforward fflags
-clean: mostlyclean
-distclean: mostlyclean
-extraclean: mostlyclean
-
-# For Sun VPATH.
-
diff --git a/contrib/gcc/objc/objc.gperf b/contrib/gcc/objc/objc.gperf
deleted file mode 100644
index 407459f15898..000000000000
--- a/contrib/gcc/objc/objc.gperf
+++ /dev/null
@@ -1,64 +0,0 @@
-%{
-/* Command-line: gperf -p -j1 -i 1 -g -o -t -N is_reserved_word -k1,3,$ objc.gperf */
-%}
-struct resword { char *name; short token; enum rid rid; };
-%%
-@defs, DEFS, NORID
-@encode, ENCODE, NORID
-@end, END, NORID
-@implementation, IMPLEMENTATION, NORID
-@interface, INTERFACE, NORID
-@public, PUBLIC, NORID
-@selector, SELECTOR, NORID
-__alignof, ALIGNOF, NORID
-__alignof__, ALIGNOF, NORID
-__asm, ASM, NORID
-__asm__, ASM, NORID
-__attribute, ATTRIBUTE, NORID
-__attribute__, ATTRIBUTE, NORID
-__const, TYPE_QUAL, RID_CONST
-__const__, TYPE_QUAL, RID_CONST
-__extension__, EXTENSION, NORID
-__inline, SCSPEC, RID_INLINE
-__inline__, SCSPEC, RID_INLINE
-__signed, TYPESPEC, RID_SIGNED
-__signed__, TYPESPEC, RID_SIGNED
-__typeof, TYPEOF, NORID
-__typeof__, TYPEOF, NORID
-__volatile, TYPE_QUAL, RID_VOLATILE
-__volatile__, TYPE_QUAL, RID_VOLATILE
-asm, ASM, NORID
-auto, SCSPEC, RID_AUTO
-break, BREAK, NORID
-case, CASE, NORID
-char, TYPESPEC, RID_CHAR
-const, TYPE_QUAL, RID_CONST
-continue, CONTINUE, NORID
-default, DEFAULT, NORID
-do, DO, NORID
-double, TYPESPEC, RID_DOUBLE
-else, ELSE, NORID
-enum, ENUM, NORID
-extern, SCSPEC, RID_EXTERN
-float, TYPESPEC, RID_FLOAT
-for, FOR, NORID
-goto, GOTO, NORID
-if, IF, NORID
-inline, SCSPEC, RID_INLINE
-int, TYPESPEC, RID_INT
-long, TYPESPEC, RID_LONG
-register, SCSPEC, RID_REGISTER
-return, RETURN, NORID
-short, TYPESPEC, RID_SHORT
-signed, TYPESPEC, RID_SIGNED
-sizeof, SIZEOF, NORID
-static, SCSPEC, RID_STATIC
-struct, STRUCT, NORID
-switch, SWITCH, NORID
-typedef, SCSPEC, RID_TYPEDEF
-typeof, TYPEOF, NORID
-union, UNION, NORID
-unsigned, TYPESPEC, RID_UNSIGNED
-void, TYPESPEC, RID_VOID
-volatile, TYPE_QUAL, RID_VOLATILE
-while, WHILE, NORID
diff --git a/contrib/gcc/objc/sendmsg.c b/contrib/gcc/objc/sendmsg.c
deleted file mode 100644
index 245b8b9eaf79..000000000000
--- a/contrib/gcc/objc/sendmsg.c
+++ /dev/null
@@ -1,651 +0,0 @@
-/* GNU Objective C Runtime message lookup
- Copyright (C) 1993, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
- Contributed by Kresten Krab Thorup
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
-details.
-
-You should have received a copy of the GNU General Public License along with
-GNU CC; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with files compiled with
- GCC 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 "../tconfig.h"
-#include "runtime.h"
-#include "sarray.h"
-#include "encoding.h"
-#include "runtime-info.h"
-
-/* this is how we hack STRUCT_VALUE to be 1 or 0 */
-#define gen_rtx(args...) 1
-#define gen_rtx_MEM(args...) 1
-#define rtx int
-
-#if !defined(STRUCT_VALUE) || STRUCT_VALUE == 0
-#define INVISIBLE_STRUCT_RETURN 1
-#else
-#define INVISIBLE_STRUCT_RETURN 0
-#endif
-
-/* The uninstalled dispatch table */
-struct sarray* __objc_uninstalled_dtable = 0; /* !T:MUTEX */
-
-/* Send +initialize to class */
-static void __objc_send_initialize(Class);
-
-static void __objc_install_dispatch_table_for_class (Class);
-
-/* Forward declare some functions */
-static void __objc_init_install_dtable(id, SEL);
-
-/* Various forwarding functions that are used based upon the
- return type for the selector.
- __objc_block_forward for structures.
- __objc_double_forward for floats/doubles.
- __objc_word_forward for pointers or types that fit in registers.
- */
-static double __objc_double_forward(id, SEL, ...);
-static id __objc_word_forward(id, SEL, ...);
-typedef struct { id many[8]; } __big;
-#if INVISIBLE_STRUCT_RETURN
-static __big
-#else
-static id
-#endif
-__objc_block_forward(id, SEL, ...);
-static Method_t search_for_method_in_hierarchy (Class class, SEL sel);
-Method_t search_for_method_in_list(MethodList_t list, SEL op);
-id nil_method(id, SEL, ...);
-
-/* Given a selector, return the proper forwarding implementation. */
-__inline__
-IMP
-__objc_get_forward_imp (SEL sel)
-{
- const char *t = sel->sel_types;
-
- if (t && (*t == '[' || *t == '(' || *t == '{')
-#ifdef OBJC_MAX_STRUCT_BY_VALUE
- && objc_sizeof_type(t) > OBJC_MAX_STRUCT_BY_VALUE
-#endif
- )
- return (IMP)__objc_block_forward;
- else if (t && (*t == 'f' || *t == 'd'))
- return (IMP)__objc_double_forward;
- else
- return (IMP)__objc_word_forward;
-}
-
-/* Given a class and selector, return the selector's implementation. */
-__inline__
-IMP
-get_imp (Class class, SEL sel)
-{
- void* res = sarray_get_safe (class->dtable, (size_t) sel->sel_id);
- if (res == 0)
- {
- /* Not a valid method */
- if(class->dtable == __objc_uninstalled_dtable)
- {
- /* The dispatch table needs to be installed. */
- objc_mutex_lock(__objc_runtime_mutex);
- __objc_install_dispatch_table_for_class (class);
- objc_mutex_unlock(__objc_runtime_mutex);
- /* Call ourselves with the installed dispatch table
- and get the real method */
- res = get_imp(class, sel);
- }
- else
- {
- /* The dispatch table has been installed so the
- method just doesn't exist for the class.
- Return the forwarding implementation. */
- res = __objc_get_forward_imp(sel);
- }
- }
- return res;
-}
-
-/* Query if an object can respond to a selector, returns YES if the
-object implements the selector otherwise NO. Does not check if the
-method can be forwarded. */
-__inline__
-BOOL
-__objc_responds_to (id object, SEL sel)
-{
- void* res;
-
- /* Install dispatch table if need be */
- if (object->class_pointer->dtable == __objc_uninstalled_dtable)
- {
- objc_mutex_lock(__objc_runtime_mutex);
- __objc_install_dispatch_table_for_class (object->class_pointer);
- objc_mutex_unlock(__objc_runtime_mutex);
- }
-
- /* Get the method from the dispatch table */
- res = sarray_get_safe (object->class_pointer->dtable, (size_t) sel->sel_id);
- return (res != 0);
-}
-
-/* This is the lookup function. All entries in the table are either a
- valid method *or* zero. If zero then either the dispatch table
- needs to be installed or it doesn't exist and forwarding is attempted. */
-__inline__
-IMP
-objc_msg_lookup(id receiver, SEL op)
-{
- IMP result;
- if(receiver)
- {
- result = sarray_get_safe (receiver->class_pointer->dtable,
- (sidx)op->sel_id);
- if (result == 0)
- {
- /* Not a valid method */
- if(receiver->class_pointer->dtable == __objc_uninstalled_dtable)
- {
- /* The dispatch table needs to be installed.
- This happens on the very first method call to the class. */
- __objc_init_install_dtable(receiver, op);
-
- /* Get real method for this in newly installed dtable */
- result = get_imp(receiver->class_pointer, op);
- }
- else
- {
- /* The dispatch table has been installed so the
- method just doesn't exist for the class.
- Attempt to forward the method. */
- result = __objc_get_forward_imp(op);
- }
- }
- return result;
- }
- else
- return nil_method;
-}
-
-IMP
-objc_msg_lookup_super (Super_t super, SEL sel)
-{
- if (super->self)
- return get_imp (super->class, sel);
- else
- return nil_method;
-}
-
-int method_get_sizeof_arguments (Method*);
-
-retval_t
-objc_msg_sendv(id object, SEL op, arglist_t arg_frame)
-{
- Method* m = class_get_instance_method(object->class_pointer, op);
- const char *type;
- *((id*)method_get_first_argument (m, arg_frame, &type)) = object;
- *((SEL*)method_get_next_argument (arg_frame, &type)) = op;
- return __builtin_apply((apply_t)m->method_imp,
- arg_frame,
- method_get_sizeof_arguments (m));
-}
-
-void
-__objc_init_dispatch_tables()
-{
- __objc_uninstalled_dtable
- = sarray_new(200, 0);
-}
-
-/* This function is called by objc_msg_lookup when the
- dispatch table needs to be installed; thus it is called once
- for each class, namely when the very first message is sent to it. */
-static void
-__objc_init_install_dtable(id receiver, SEL op)
-{
- /* This may happen, if the programmer has taken the address of a
- method before the dtable was initialized... too bad for him! */
- if(receiver->class_pointer->dtable != __objc_uninstalled_dtable)
- return;
-
- objc_mutex_lock(__objc_runtime_mutex);
-
- if(CLS_ISCLASS(receiver->class_pointer))
- {
- /* receiver is an ordinary object */
- assert(CLS_ISCLASS(receiver->class_pointer));
-
- /* install instance methods table */
- __objc_install_dispatch_table_for_class (receiver->class_pointer);
-
- /* call +initialize -- this will in turn install the factory
- dispatch table if not already done :-) */
- __objc_send_initialize(receiver->class_pointer);
- }
- else
- {
- /* receiver is a class object */
- assert(CLS_ISCLASS((Class)receiver));
- assert(CLS_ISMETA(receiver->class_pointer));
-
- /* Install real dtable for factory methods */
- __objc_install_dispatch_table_for_class (receiver->class_pointer);
-
- if (strcmp (sel_get_name (op), "initialize"))
- __objc_send_initialize((Class)receiver);
- else
- CLS_SETINITIALIZED((Class)receiver);
- }
- objc_mutex_unlock(__objc_runtime_mutex);
-}
-
-/* Install dummy table for class which causes the first message to
- that class (or instances hereof) to be initialized properly */
-void
-__objc_install_premature_dtable(Class class)
-{
- assert(__objc_uninstalled_dtable);
- class->dtable = __objc_uninstalled_dtable;
-}
-
-/* Send +initialize to class if not already done */
-static void
-__objc_send_initialize(Class class)
-{
- /* This *must* be a class object */
- assert(CLS_ISCLASS(class));
- assert(!CLS_ISMETA(class));
-
- if (!CLS_ISINITIALIZED(class))
- {
- CLS_SETINITIALIZED(class);
- CLS_SETINITIALIZED(class->class_pointer);
-
- if(class->super_class)
- __objc_send_initialize(class->super_class);
-
- {
- SEL op = sel_register_name ("initialize");
- Class tmpclass = class;
- IMP imp = 0;
-
- while (!imp && tmpclass) {
- MethodList_t method_list = tmpclass->class_pointer->methods;
-
- while(!imp && method_list) {
- int i;
- Method_t method;
-
- for (i=0;i<method_list->method_count;i++) {
- method = &(method_list->method_list[i]);
- if (method->method_name
- && method->method_name->sel_id == op->sel_id) {
- imp = method->method_imp;
- break;
- }
- }
-
- method_list = method_list->method_next;
-
- }
-
- tmpclass = tmpclass->super_class;
- }
- if (imp)
- (*imp)((id)class, op);
-
- }
- }
-}
-
-/* Walk on the methods list of class and install the methods in the reverse
- order of the lists. Since methods added by categories are before the methods
- of class in the methods list, this allows categories to substitute methods
- declared in class. However if more than one category replaces the same
- method nothing is guaranteed about what method will be used.
- Assumes that __objc_runtime_mutex is locked down. */
-static void
-__objc_install_methods_in_dtable (Class class, MethodList_t method_list)
-{
- int i;
-
- if (!method_list)
- return;
-
- if (method_list->method_next)
- __objc_install_methods_in_dtable (class, method_list->method_next);
-
- for (i = 0; i < method_list->method_count; i++)
- {
- Method_t method = &(method_list->method_list[i]);
- sarray_at_put_safe (class->dtable,
- (sidx) method->method_name->sel_id,
- method->method_imp);
- }
-}
-
-/* Assumes that __objc_runtime_mutex is locked down. */
-static void
-__objc_install_dispatch_table_for_class (Class class)
-{
- Class super;
-
- /* If the class has not yet had its class links resolved, we must
- re-compute all class links */
- if(!CLS_ISRESOLV(class))
- __objc_resolve_class_links();
-
- super = class->super_class;
-
- if (super != 0 && (super->dtable == __objc_uninstalled_dtable))
- __objc_install_dispatch_table_for_class (super);
-
- /* Allocate dtable if necessary */
- if (super == 0)
- {
- objc_mutex_lock(__objc_runtime_mutex);
- class->dtable = sarray_new (__objc_selector_max_index, 0);
- objc_mutex_unlock(__objc_runtime_mutex);
- }
- else
- class->dtable = sarray_lazy_copy (super->dtable);
-
- __objc_install_methods_in_dtable (class, class->methods);
-}
-
-void
-__objc_update_dispatch_table_for_class (Class class)
-{
- Class next;
- struct sarray *arr;
-
- /* not yet installed -- skip it */
- if (class->dtable == __objc_uninstalled_dtable)
- return;
-
- objc_mutex_lock(__objc_runtime_mutex);
-
- arr = class->dtable;
- __objc_install_premature_dtable (class); /* someone might require it... */
- sarray_free (arr); /* release memory */
-
- /* could have been lazy... */
- __objc_install_dispatch_table_for_class (class);
-
- if (class->subclass_list) /* Traverse subclasses */
- for (next = class->subclass_list; next; next = next->sibling_class)
- __objc_update_dispatch_table_for_class (next);
-
- objc_mutex_unlock(__objc_runtime_mutex);
-}
-
-
-/* This function adds a method list to a class. This function is
- typically called by another function specific to the run-time. As
- such this function does not worry about thread safe issues.
-
- This one is only called for categories. Class objects have their
- methods installed right away, and their selectors are made into
- SEL's by the function __objc_register_selectors_from_class. */
-void
-class_add_method_list (Class class, MethodList_t list)
-{
- int i;
-
- /* Passing of a linked list is not allowed. Do multiple calls. */
- assert (!list->method_next);
-
- /* Check for duplicates. */
- for (i = 0; i < list->method_count; ++i)
- {
- Method_t method = &list->method_list[i];
-
- if (method->method_name) /* Sometimes these are NULL */
- {
- /* This is where selector names are transmogrified to SEL's */
- method->method_name =
- sel_register_typed_name ((const char*)method->method_name,
- method->method_types);
- }
- }
-
- /* Add the methods to the class's method list. */
- list->method_next = class->methods;
- class->methods = list;
-
- /* Update the dispatch table of class */
- __objc_update_dispatch_table_for_class (class);
-}
-
-Method_t
-class_get_instance_method(Class class, SEL op)
-{
- return search_for_method_in_hierarchy(class, op);
-}
-
-Method_t
-class_get_class_method(MetaClass class, SEL op)
-{
- return search_for_method_in_hierarchy(class, op);
-}
-
-
-/* Search for a method starting from the current class up its hierarchy.
- Return a pointer to the method's method structure if found. NULL
- otherwise. */
-
-static Method_t
-search_for_method_in_hierarchy (Class cls, SEL sel)
-{
- Method_t method = NULL;
- Class class;
-
- if (! sel_is_mapped (sel))
- return NULL;
-
- /* Scan the method list of the class. If the method isn't found in the
- list then step to its super class. */
- for (class = cls; ((! method) && class); class = class->super_class)
- method = search_for_method_in_list (class->methods, sel);
-
- return method;
-}
-
-
-
-/* Given a linked list of method and a method's name. Search for the named
- method's method structure. Return a pointer to the method's method
- structure if found. NULL otherwise. */
-Method_t
-search_for_method_in_list (MethodList_t list, SEL op)
-{
- MethodList_t method_list = list;
-
- if (! sel_is_mapped (op))
- return NULL;
-
- /* If not found then we'll search the list. */
- while (method_list)
- {
- int i;
-
- /* Search the method list. */
- for (i = 0; i < method_list->method_count; ++i)
- {
- Method_t method = &method_list->method_list[i];
-
- if (method->method_name)
- if (method->method_name->sel_id == op->sel_id)
- return method;
- }
-
- /* The method wasn't found. Follow the link to the next list of
- methods. */
- method_list = method_list->method_next;
- }
-
- return NULL;
-}
-
-static retval_t __objc_forward (id object, SEL sel, arglist_t args);
-
-/* Forwarding pointers/integers through the normal registers */
-static id
-__objc_word_forward (id rcv, SEL op, ...)
-{
- void *args, *res;
-
- args = __builtin_apply_args ();
- res = __objc_forward (rcv, op, args);
- if (res)
- __builtin_return (res);
- else
- return res;
-}
-
-/* Specific routine for forwarding floats/double because of
- architectural differences on some processors. i386s for
- example which uses a floating point stack versus general
- registers for floating point numbers. This forward routine
- makes sure that GCC restores the proper return values */
-static double
-__objc_double_forward (id rcv, SEL op, ...)
-{
- void *args, *res;
-
- args = __builtin_apply_args ();
- res = __objc_forward (rcv, op, args);
- __builtin_return (res);
-}
-
-#if INVISIBLE_STRUCT_RETURN
-static __big
-#else
-static id
-#endif
-__objc_block_forward (id rcv, SEL op, ...)
-{
- void *args, *res;
-
- args = __builtin_apply_args ();
- res = __objc_forward (rcv, op, args);
- if (res)
- __builtin_return (res);
- else
-#if INVISIBLE_STRUCT_RETURN
- return (__big) {{0, 0, 0, 0, 0, 0, 0, 0}};
-#else
- return nil;
-#endif
-}
-
-
-/* This function is installed in the dispatch table for all methods which are
- not implemented. Thus, it is called when a selector is not recognized. */
-static retval_t
-__objc_forward (id object, SEL sel, arglist_t args)
-{
- IMP imp;
- static SEL frwd_sel = 0; /* !T:SAFE2 */
- SEL err_sel;
-
- /* first try if the object understands forward:: */
- if (!frwd_sel)
- frwd_sel = sel_get_any_uid("forward::");
-
- if (__objc_responds_to (object, frwd_sel))
- {
- imp = get_imp(object->class_pointer, frwd_sel);
- return (*imp)(object, frwd_sel, sel, args);
- }
-
- /* If the object recognizes the doesNotRecognize: method then we're going
- to send it. */
- err_sel = sel_get_any_uid ("doesNotRecognize:");
- if (__objc_responds_to (object, err_sel))
- {
- imp = get_imp (object->class_pointer, err_sel);
- return (*imp) (object, err_sel, sel);
- }
-
- /* The object doesn't recognize the method. Check for responding to
- error:. If it does then sent it. */
- {
- size_t strlen (const char*);
- char msg[256 + strlen ((const char*)sel_get_name (sel))
- + strlen ((const char*)object->class_pointer->name)];
-
- sprintf (msg, "(%s) %s does not recognize %s",
- (CLS_ISMETA(object->class_pointer)
- ? "class"
- : "instance" ),
- object->class_pointer->name, sel_get_name (sel));
-
- err_sel = sel_get_any_uid ("error:");
- if (__objc_responds_to (object, err_sel))
- {
- imp = get_imp (object->class_pointer, err_sel);
- return (*imp) (object, sel_get_any_uid ("error:"), msg);
- }
-
- /* The object doesn't respond to doesNotRecognize: or error:; Therefore,
- a default action is taken. */
- objc_error (object, OBJC_ERR_UNIMPLEMENTED, "%s\n", msg);
-
- return 0;
- }
-}
-
-void
-__objc_print_dtable_stats()
-{
- int total = 0;
-
- objc_mutex_lock(__objc_runtime_mutex);
-
- printf("memory usage: (%s)\n",
-#ifdef OBJC_SPARSE2
- "2-level sparse arrays"
-#else
- "3-level sparse arrays"
-#endif
- );
-
- printf("arrays: %d = %ld bytes\n", narrays,
- (long)narrays*sizeof(struct sarray));
- total += narrays*sizeof(struct sarray);
- printf("buckets: %d = %ld bytes\n", nbuckets,
- (long)nbuckets*sizeof(struct sbucket));
- total += nbuckets*sizeof(struct sbucket);
-
- printf("idxtables: %d = %ld bytes\n", idxsize, (long)idxsize*sizeof(void*));
- total += idxsize*sizeof(void*);
- printf("-----------------------------------\n");
- printf("total: %d bytes\n", total);
- printf("===================================\n");
-
- objc_mutex_unlock(__objc_runtime_mutex);
-}
-
-/* Returns the uninstalled dispatch table indicator.
- If a class' dispatch table points to __objc_uninstalled_dtable
- then that means it needs its dispatch table to be installed. */
-__inline__
-struct sarray*
-objc_get_uninstalled_dtable()
-{
- return __objc_uninstalled_dtable;
-}
diff --git a/contrib/gcc/obstack.c b/contrib/gcc/obstack.c
deleted file mode 100644
index bc318b37790e..000000000000
--- a/contrib/gcc/obstack.c
+++ /dev/null
@@ -1,593 +0,0 @@
-/* obstack.c - subroutines used implicitly by object stack macros
- Copyright (C) 1988,89,90,91,92,93,94,96,97 Free Software Foundation, Inc.
-
-
- NOTE: The canonical source of this file is maintained with the GNU C Library.
- Bugs can be reported to bug-glibc@gnu.org.
-
- This program 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 program 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 program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
- USA. */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "obstack.h"
-
-/* NOTE BEFORE MODIFYING THIS FILE: This version number must be
- incremented whenever callers compiled using an old obstack.h can no
- longer properly call the functions in this obstack.c. */
-#define OBSTACK_INTERFACE_VERSION 1
-
-/* Comment out all this code if we are using the GNU C Library, and are not
- actually compiling the library itself, and the installed library
- supports the same library interface we do. This code is part of the GNU
- C Library, but also included in many other GNU distributions. Compiling
- and linking in this code is a waste when using the GNU C library
- (especially if it is a shared library). Rather than having every GNU
- program understand `configure --with-gnu-libc' and omit the object
- files, it is simpler to just do this in the source for each such file. */
-
-#include <stdio.h> /* Random thing to get __GNU_LIBRARY__. */
-#if !defined (_LIBC) && defined (__GNU_LIBRARY__) && __GNU_LIBRARY__ > 1
-#include <gnu-versions.h>
-#if _GNU_OBSTACK_INTERFACE_VERSION == OBSTACK_INTERFACE_VERSION
-#define ELIDE_CODE
-#endif
-#endif
-
-
-#ifndef ELIDE_CODE
-
-
-#if defined (__STDC__) && __STDC__
-#define POINTER void *
-#else
-#define POINTER char *
-#endif
-
-/* Determine default alignment. */
-struct fooalign {char x; double d;};
-#define DEFAULT_ALIGNMENT \
- ((PTR_INT_TYPE) ((char *) &((struct fooalign *) 0)->d - (char *) 0))
-/* If malloc were really smart, it would round addresses to DEFAULT_ALIGNMENT.
- But in fact it might be less smart and round addresses to as much as
- DEFAULT_ROUNDING. So we prepare for it to do that. */
-union fooround {long x; double d;};
-#define DEFAULT_ROUNDING (sizeof (union fooround))
-
-/* When we copy a long block of data, this is the unit to do it with.
- On some machines, copying successive ints does not work;
- in such a case, redefine COPYING_UNIT to `long' (if that works)
- or `char' as a last resort. */
-#ifndef COPYING_UNIT
-#define COPYING_UNIT int
-#endif
-
-
-/* The functions allocating more room by calling `obstack_chunk_alloc'
- jump to the handler pointed to by `obstack_alloc_failed_handler'.
- This variable by default points to the internal function
- `print_and_abort'. */
-#if defined (__STDC__) && __STDC__
-static void print_and_abort (void);
-void (*obstack_alloc_failed_handler) (void) = print_and_abort;
-#else
-static void print_and_abort ();
-void (*obstack_alloc_failed_handler) () = print_and_abort;
-#endif
-
-/* Exit value used when `print_and_abort' is used. */
-#if defined __GNU_LIBRARY__ || defined HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#ifndef EXIT_FAILURE
-#define EXIT_FAILURE 1
-#endif
-int obstack_exit_failure = EXIT_FAILURE;
-
-/* The non-GNU-C macros copy the obstack into this global variable
- to avoid multiple evaluation. */
-
-struct obstack *_obstack;
-
-/* Define a macro that either calls functions with the traditional malloc/free
- calling interface, or calls functions with the mmalloc/mfree interface
- (that adds an extra first argument), based on the state of use_extra_arg.
- For free, do not use ?:, since some compilers, like the MIPS compilers,
- do not allow (expr) ? void : void. */
-
-#if defined (__STDC__) && __STDC__
-#define CALL_CHUNKFUN(h, size) \
- (((h) -> use_extra_arg) \
- ? (*(h)->chunkfun) ((h)->extra_arg, (size)) \
- : (*(struct _obstack_chunk *(*) (long)) (h)->chunkfun) ((size)))
-
-#define CALL_FREEFUN(h, old_chunk) \
- do { \
- if ((h) -> use_extra_arg) \
- (*(h)->freefun) ((h)->extra_arg, (old_chunk)); \
- else \
- (*(void (*) (void *)) (h)->freefun) ((old_chunk)); \
- } while (0)
-#else
-#define CALL_CHUNKFUN(h, size) \
- (((h) -> use_extra_arg) \
- ? (*(h)->chunkfun) ((h)->extra_arg, (size)) \
- : (*(struct _obstack_chunk *(*) ()) (h)->chunkfun) ((size)))
-
-#define CALL_FREEFUN(h, old_chunk) \
- do { \
- if ((h) -> use_extra_arg) \
- (*(h)->freefun) ((h)->extra_arg, (old_chunk)); \
- else \
- (*(void (*) ()) (h)->freefun) ((old_chunk)); \
- } while (0)
-#endif
-
-
-/* Initialize an obstack H for use. Specify chunk size SIZE (0 means default).
- Objects start on multiples of ALIGNMENT (0 means use default).
- CHUNKFUN is the function to use to allocate chunks,
- and FREEFUN the function to free them.
-
- Return nonzero if successful, zero if out of memory.
- To recover from an out of memory error,
- free up some memory, then call this again. */
-
-int
-_obstack_begin (h, size, alignment, chunkfun, freefun)
- struct obstack *h;
- int size;
- int alignment;
-#if defined (__STDC__) && __STDC__
- POINTER (*chunkfun) (long);
- void (*freefun) (void *);
-#else
- POINTER (*chunkfun) ();
- void (*freefun) ();
-#endif
-{
- register struct _obstack_chunk *chunk; /* points to new chunk */
-
- if (alignment == 0)
- alignment = (int) DEFAULT_ALIGNMENT;
- if (size == 0)
- /* Default size is what GNU malloc can fit in a 4096-byte block. */
- {
- /* 12 is sizeof (mhead) and 4 is EXTRA from GNU malloc.
- Use the values for range checking, because if range checking is off,
- the extra bytes won't be missed terribly, but if range checking is on
- and we used a larger request, a whole extra 4096 bytes would be
- allocated.
-
- These number are irrelevant to the new GNU malloc. I suspect it is
- less sensitive to the size of the request. */
- int extra = ((((12 + DEFAULT_ROUNDING - 1) & ~(DEFAULT_ROUNDING - 1))
- + 4 + DEFAULT_ROUNDING - 1)
- & ~(DEFAULT_ROUNDING - 1));
- size = 4096 - extra;
- }
-
-#if defined (__STDC__) && __STDC__
- h->chunkfun = (struct _obstack_chunk * (*)(void *, long)) chunkfun;
- h->freefun = (void (*) (void *, struct _obstack_chunk *)) freefun;
-#else
- h->chunkfun = (struct _obstack_chunk * (*)()) chunkfun;
- h->freefun = freefun;
-#endif
- h->chunk_size = size;
- h->alignment_mask = alignment - 1;
- h->use_extra_arg = 0;
-
- chunk = h->chunk = CALL_CHUNKFUN (h, h -> chunk_size);
- if (!chunk)
- (*obstack_alloc_failed_handler) ();
- h->next_free = h->object_base = chunk->contents;
- h->chunk_limit = chunk->limit
- = (char *) chunk + h->chunk_size;
- chunk->prev = 0;
- /* The initial chunk now contains no empty object. */
- h->maybe_empty_object = 0;
- h->alloc_failed = 0;
- return 1;
-}
-
-int
-_obstack_begin_1 (h, size, alignment, chunkfun, freefun, arg)
- struct obstack *h;
- int size;
- int alignment;
-#if defined (__STDC__) && __STDC__
- POINTER (*chunkfun) (POINTER, long);
- void (*freefun) (POINTER, POINTER);
-#else
- POINTER (*chunkfun) ();
- void (*freefun) ();
-#endif
- POINTER arg;
-{
- register struct _obstack_chunk *chunk; /* points to new chunk */
-
- if (alignment == 0)
- alignment = (int) DEFAULT_ALIGNMENT;
- if (size == 0)
- /* Default size is what GNU malloc can fit in a 4096-byte block. */
- {
- /* 12 is sizeof (mhead) and 4 is EXTRA from GNU malloc.
- Use the values for range checking, because if range checking is off,
- the extra bytes won't be missed terribly, but if range checking is on
- and we used a larger request, a whole extra 4096 bytes would be
- allocated.
-
- These number are irrelevant to the new GNU malloc. I suspect it is
- less sensitive to the size of the request. */
- int extra = ((((12 + DEFAULT_ROUNDING - 1) & ~(DEFAULT_ROUNDING - 1))
- + 4 + DEFAULT_ROUNDING - 1)
- & ~(DEFAULT_ROUNDING - 1));
- size = 4096 - extra;
- }
-
-#if defined(__STDC__) && __STDC__
- h->chunkfun = (struct _obstack_chunk * (*)(void *,long)) chunkfun;
- h->freefun = (void (*) (void *, struct _obstack_chunk *)) freefun;
-#else
- h->chunkfun = (struct _obstack_chunk * (*)()) chunkfun;
- h->freefun = freefun;
-#endif
- h->chunk_size = size;
- h->alignment_mask = alignment - 1;
- h->extra_arg = arg;
- h->use_extra_arg = 1;
-
- chunk = h->chunk = CALL_CHUNKFUN (h, h -> chunk_size);
- if (!chunk)
- (*obstack_alloc_failed_handler) ();
- h->next_free = h->object_base = chunk->contents;
- h->chunk_limit = chunk->limit
- = (char *) chunk + h->chunk_size;
- chunk->prev = 0;
- /* The initial chunk now contains no empty object. */
- h->maybe_empty_object = 0;
- h->alloc_failed = 0;
- return 1;
-}
-
-/* Allocate a new current chunk for the obstack *H
- on the assumption that LENGTH bytes need to be added
- to the current object, or a new object of length LENGTH allocated.
- Copies any partial object from the end of the old chunk
- to the beginning of the new one. */
-
-void
-_obstack_newchunk (h, length)
- struct obstack *h;
- int length;
-{
- register struct _obstack_chunk *old_chunk = h->chunk;
- register struct _obstack_chunk *new_chunk;
- register long new_size;
- register long obj_size = h->next_free - h->object_base;
- register long i;
- long already;
-
- /* Compute size for new chunk. */
- new_size = (obj_size + length) + (obj_size >> 3) + 100;
- if (new_size < h->chunk_size)
- new_size = h->chunk_size;
-
- /* Allocate and initialize the new chunk. */
- new_chunk = CALL_CHUNKFUN (h, new_size);
- if (!new_chunk)
- (*obstack_alloc_failed_handler) ();
- h->chunk = new_chunk;
- new_chunk->prev = old_chunk;
- new_chunk->limit = h->chunk_limit = (char *) new_chunk + new_size;
-
- /* Move the existing object to the new chunk.
- Word at a time is fast and is safe if the object
- is sufficiently aligned. */
- if (h->alignment_mask + 1 >= DEFAULT_ALIGNMENT)
- {
- for (i = obj_size / sizeof (COPYING_UNIT) - 1;
- i >= 0; i--)
- ((COPYING_UNIT *)new_chunk->contents)[i]
- = ((COPYING_UNIT *)h->object_base)[i];
- /* We used to copy the odd few remaining bytes as one extra COPYING_UNIT,
- but that can cross a page boundary on a machine
- which does not do strict alignment for COPYING_UNITS. */
- already = obj_size / sizeof (COPYING_UNIT) * sizeof (COPYING_UNIT);
- }
- else
- already = 0;
- /* Copy remaining bytes one by one. */
- for (i = already; i < obj_size; i++)
- new_chunk->contents[i] = h->object_base[i];
-
- /* If the object just copied was the only data in OLD_CHUNK,
- free that chunk and remove it from the chain.
- But not if that chunk might contain an empty object. */
- if (h->object_base == old_chunk->contents && ! h->maybe_empty_object)
- {
- new_chunk->prev = old_chunk->prev;
- CALL_FREEFUN (h, old_chunk);
- }
-
- h->object_base = new_chunk->contents;
- h->next_free = h->object_base + obj_size;
- /* The new chunk certainly contains no empty object yet. */
- h->maybe_empty_object = 0;
-}
-
-/* Return nonzero if object OBJ has been allocated from obstack H.
- This is here for debugging.
- If you use it in a program, you are probably losing. */
-
-#if defined (__STDC__) && __STDC__
-/* Suppress -Wmissing-prototypes warning. We don't want to declare this in
- obstack.h because it is just for debugging. */
-int _obstack_allocated_p (struct obstack *h, POINTER obj);
-#endif
-
-int
-_obstack_allocated_p (h, obj)
- struct obstack *h;
- POINTER obj;
-{
- register struct _obstack_chunk *lp; /* below addr of any objects in this chunk */
- register struct _obstack_chunk *plp; /* point to previous chunk if any */
-
- lp = (h)->chunk;
- /* We use >= rather than > since the object cannot be exactly at
- the beginning of the chunk but might be an empty object exactly
- at the end of an adjacent chunk. */
- while (lp != 0 && ((POINTER) lp >= obj || (POINTER) (lp)->limit < obj))
- {
- plp = lp->prev;
- lp = plp;
- }
- return lp != 0;
-}
-
-/* Free objects in obstack H, including OBJ and everything allocate
- more recently than OBJ. If OBJ is zero, free everything in H. */
-
-#undef obstack_free
-
-/* This function has two names with identical definitions.
- This is the first one, called from non-ANSI code. */
-
-void
-_obstack_free (h, obj)
- struct obstack *h;
- POINTER obj;
-{
- register struct _obstack_chunk *lp; /* below addr of any objects in this chunk */
- register struct _obstack_chunk *plp; /* point to previous chunk if any */
-
- lp = h->chunk;
- /* We use >= because there cannot be an object at the beginning of a chunk.
- But there can be an empty object at that address
- at the end of another chunk. */
- while (lp != 0 && ((POINTER) lp >= obj || (POINTER) (lp)->limit < obj))
- {
- plp = lp->prev;
- CALL_FREEFUN (h, lp);
- lp = plp;
- /* If we switch chunks, we can't tell whether the new current
- chunk contains an empty object, so assume that it may. */
- h->maybe_empty_object = 1;
- }
- if (lp)
- {
- h->object_base = h->next_free = (char *) (obj);
- h->chunk_limit = lp->limit;
- h->chunk = lp;
- }
- else if (obj != 0)
- /* obj is not in any of the chunks! */
- abort ();
-}
-
-/* This function is used from ANSI code. */
-
-void
-obstack_free (h, obj)
- struct obstack *h;
- POINTER obj;
-{
- register struct _obstack_chunk *lp; /* below addr of any objects in this chunk */
- register struct _obstack_chunk *plp; /* point to previous chunk if any */
-
- lp = h->chunk;
- /* We use >= because there cannot be an object at the beginning of a chunk.
- But there can be an empty object at that address
- at the end of another chunk. */
- while (lp != 0 && ((POINTER) lp >= obj || (POINTER) (lp)->limit < obj))
- {
- plp = lp->prev;
- CALL_FREEFUN (h, lp);
- lp = plp;
- /* If we switch chunks, we can't tell whether the new current
- chunk contains an empty object, so assume that it may. */
- h->maybe_empty_object = 1;
- }
- if (lp)
- {
- h->object_base = h->next_free = (char *) (obj);
- h->chunk_limit = lp->limit;
- h->chunk = lp;
- }
- else if (obj != 0)
- /* obj is not in any of the chunks! */
- abort ();
-}
-
-int
-_obstack_memory_used (h)
- struct obstack *h;
-{
- register struct _obstack_chunk* lp;
- register int nbytes = 0;
-
- for (lp = h->chunk; lp != 0; lp = lp->prev)
- {
- nbytes += lp->limit - (char *) lp;
- }
- return nbytes;
-}
-
-/* Define the error handler. */
-#ifndef _
-# ifdef HAVE_LIBINTL_H
-# include <libintl.h>
-# ifndef _
-# define _(Str) gettext (Str)
-# endif
-# else
-# define _(Str) (Str)
-# endif
-#endif
-
-static void
-print_and_abort ()
-{
- fputs (_("memory exhausted\n"), stderr);
- exit (obstack_exit_failure);
-}
-
-#if 0
-/* These are now turned off because the applications do not use it
- and it uses bcopy via obstack_grow, which causes trouble on sysV. */
-
-/* Now define the functional versions of the obstack macros.
- Define them to simply use the corresponding macros to do the job. */
-
-#if defined (__STDC__) && __STDC__
-/* These function definitions do not work with non-ANSI preprocessors;
- they won't pass through the macro names in parentheses. */
-
-/* The function names appear in parentheses in order to prevent
- the macro-definitions of the names from being expanded there. */
-
-POINTER (obstack_base) (obstack)
- struct obstack *obstack;
-{
- return obstack_base (obstack);
-}
-
-POINTER (obstack_next_free) (obstack)
- struct obstack *obstack;
-{
- return obstack_next_free (obstack);
-}
-
-int (obstack_object_size) (obstack)
- struct obstack *obstack;
-{
- return obstack_object_size (obstack);
-}
-
-int (obstack_room) (obstack)
- struct obstack *obstack;
-{
- return obstack_room (obstack);
-}
-
-int (obstack_make_room) (obstack, length)
- struct obstack *obstack;
- int length;
-{
- return obstack_make_room (obstack, length);
-}
-
-void (obstack_grow) (obstack, pointer, length)
- struct obstack *obstack;
- POINTER pointer;
- int length;
-{
- obstack_grow (obstack, pointer, length);
-}
-
-void (obstack_grow0) (obstack, pointer, length)
- struct obstack *obstack;
- POINTER pointer;
- int length;
-{
- obstack_grow0 (obstack, pointer, length);
-}
-
-void (obstack_1grow) (obstack, character)
- struct obstack *obstack;
- int character;
-{
- obstack_1grow (obstack, character);
-}
-
-void (obstack_blank) (obstack, length)
- struct obstack *obstack;
- int length;
-{
- obstack_blank (obstack, length);
-}
-
-void (obstack_1grow_fast) (obstack, character)
- struct obstack *obstack;
- int character;
-{
- obstack_1grow_fast (obstack, character);
-}
-
-void (obstack_blank_fast) (obstack, length)
- struct obstack *obstack;
- int length;
-{
- obstack_blank_fast (obstack, length);
-}
-
-POINTER (obstack_finish) (obstack)
- struct obstack *obstack;
-{
- return obstack_finish (obstack);
-}
-
-POINTER (obstack_alloc) (obstack, length)
- struct obstack *obstack;
- int length;
-{
- return obstack_alloc (obstack, length);
-}
-
-POINTER (obstack_copy) (obstack, pointer, length)
- struct obstack *obstack;
- POINTER pointer;
- int length;
-{
- return obstack_copy (obstack, pointer, length);
-}
-
-POINTER (obstack_copy0) (obstack, pointer, length)
- struct obstack *obstack;
- POINTER pointer;
- int length;
-{
- return obstack_copy0 (obstack, pointer, length);
-}
-
-#endif /* __STDC__ */
-
-#endif /* 0 */
-
-#endif /* !ELIDE_CODE */
diff --git a/contrib/gcc/obstack.h b/contrib/gcc/obstack.h
deleted file mode 100644
index 38e96777660d..000000000000
--- a/contrib/gcc/obstack.h
+++ /dev/null
@@ -1,593 +0,0 @@
-/* obstack.h - object stack macros
- Copyright (C) 1988,89,90,91,92,93,94,96,97,98 Free Software Foundation, Inc.
-
-
- NOTE: The canonical source of this file is maintained with the GNU C Library.
- Bugs can be reported to bug-glibc@gnu.org.
-
- This program 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 program 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 program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
- USA. */
-
-/* Summary:
-
-All the apparent functions defined here are macros. The idea
-is that you would use these pre-tested macros to solve a
-very specific set of problems, and they would run fast.
-Caution: no side-effects in arguments please!! They may be
-evaluated MANY times!!
-
-These macros operate a stack of objects. Each object starts life
-small, and may grow to maturity. (Consider building a word syllable
-by syllable.) An object can move while it is growing. Once it has
-been "finished" it never changes address again. So the "top of the
-stack" is typically an immature growing object, while the rest of the
-stack is of mature, fixed size and fixed address objects.
-
-These routines grab large chunks of memory, using a function you
-supply, called `obstack_chunk_alloc'. On occasion, they free chunks,
-by calling `obstack_chunk_free'. You must define them and declare
-them before using any obstack macros.
-
-Each independent stack is represented by a `struct obstack'.
-Each of the obstack macros expects a pointer to such a structure
-as the first argument.
-
-One motivation for this package is the problem of growing char strings
-in symbol tables. Unless you are "fascist pig with a read-only mind"
---Gosper's immortal quote from HAKMEM item 154, out of context--you
-would not like to put any arbitrary upper limit on the length of your
-symbols.
-
-In practice this often means you will build many short symbols and a
-few long symbols. At the time you are reading a symbol you don't know
-how long it is. One traditional method is to read a symbol into a
-buffer, realloc()ating the buffer every time you try to read a symbol
-that is longer than the buffer. This is beaut, but you still will
-want to copy the symbol from the buffer to a more permanent
-symbol-table entry say about half the time.
-
-With obstacks, you can work differently. Use one obstack for all symbol
-names. As you read a symbol, grow the name in the obstack gradually.
-When the name is complete, finalize it. Then, if the symbol exists already,
-free the newly read name.
-
-The way we do this is to take a large chunk, allocating memory from
-low addresses. When you want to build a symbol in the chunk you just
-add chars above the current "high water mark" in the chunk. When you
-have finished adding chars, because you got to the end of the symbol,
-you know how long the chars are, and you can create a new object.
-Mostly the chars will not burst over the highest address of the chunk,
-because you would typically expect a chunk to be (say) 100 times as
-long as an average object.
-
-In case that isn't clear, when we have enough chars to make up
-the object, THEY ARE ALREADY CONTIGUOUS IN THE CHUNK (guaranteed)
-so we just point to it where it lies. No moving of chars is
-needed and this is the second win: potentially long strings need
-never be explicitly shuffled. Once an object is formed, it does not
-change its address during its lifetime.
-
-When the chars burst over a chunk boundary, we allocate a larger
-chunk, and then copy the partly formed object from the end of the old
-chunk to the beginning of the new larger chunk. We then carry on
-accreting characters to the end of the object as we normally would.
-
-A special macro is provided to add a single char at a time to a
-growing object. This allows the use of register variables, which
-break the ordinary 'growth' macro.
-
-Summary:
- We allocate large chunks.
- We carve out one object at a time from the current chunk.
- Once carved, an object never moves.
- We are free to append data of any size to the currently
- growing object.
- Exactly one object is growing in an obstack at any one time.
- You can run one obstack per control block.
- You may have as many control blocks as you dare.
- Because of the way we do it, you can `unwind' an obstack
- back to a previous state. (You may remove objects much
- as you would with a stack.)
-*/
-
-
-/* Don't do the contents of this file more than once. */
-
-#ifndef _OBSTACK_H
-#define _OBSTACK_H 1
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* We use subtraction of (char *) 0 instead of casting to int
- because on word-addressable machines a simple cast to int
- may ignore the byte-within-word field of the pointer. */
-
-#ifndef __PTR_TO_INT
-# define __PTR_TO_INT(P) ((P) - (char *) 0)
-#endif
-
-#ifndef __INT_TO_PTR
-# define __INT_TO_PTR(P) ((P) + (char *) 0)
-#endif
-
-/* We need the type of the resulting object. If __PTRDIFF_TYPE__ is
- defined, as with GNU C, use that; that way we don't pollute the
- namespace with <stddef.h>'s symbols. Otherwise, if <stddef.h> is
- available, include it and use ptrdiff_t. In traditional C, long is
- the best that we can do. */
-
-#ifdef __PTRDIFF_TYPE__
-# define PTR_INT_TYPE __PTRDIFF_TYPE__
-#else
-# ifdef HAVE_STDDEF_H
-# include <stddef.h>
-# define PTR_INT_TYPE ptrdiff_t
-# else
-# define PTR_INT_TYPE long
-# endif
-#endif
-
-#if defined _LIBC || defined HAVE_STRING_H
-# include <string.h>
-# define _obstack_memcpy(To, From, N) memcpy ((To), (From), (N))
-#else
-# ifdef memcpy
-# define _obstack_memcpy(To, From, N) memcpy ((To), (From), (N))
-# else
-# define _obstack_memcpy(To, From, N) bcopy ((From), (To), (N))
-# endif
-#endif
-
-struct _obstack_chunk /* Lives at front of each chunk. */
-{
- char *limit; /* 1 past end of this chunk */
- struct _obstack_chunk *prev; /* address of prior chunk or NULL */
- char contents[4]; /* objects begin here */
-};
-
-struct obstack /* control current object in current chunk */
-{
- long chunk_size; /* preferred size to allocate chunks in */
- struct _obstack_chunk *chunk; /* address of current struct obstack_chunk */
- char *object_base; /* address of object we are building */
- char *next_free; /* where to add next char to current object */
- char *chunk_limit; /* address of char after current chunk */
- PTR_INT_TYPE temp; /* Temporary for some macros. */
- int alignment_mask; /* Mask of alignment for each object. */
-#if defined __STDC__ && __STDC__
- /* These prototypes vary based on `use_extra_arg', and we use
- casts to the prototypeless function type in all assignments,
- but having prototypes here quiets -Wstrict-prototypes. */
- struct _obstack_chunk *(*chunkfun) (void *, long);
- void (*freefun) (void *, struct _obstack_chunk *);
- void *extra_arg; /* first arg for chunk alloc/dealloc funcs */
-#else
- struct _obstack_chunk *(*chunkfun) (); /* User's fcn to allocate a chunk. */
- void (*freefun) (); /* User's function to free a chunk. */
- char *extra_arg; /* first arg for chunk alloc/dealloc funcs */
-#endif
- unsigned use_extra_arg:1; /* chunk alloc/dealloc funcs take extra arg */
- unsigned maybe_empty_object:1;/* There is a possibility that the current
- chunk contains a zero-length object. This
- prevents freeing the chunk if we allocate
- a bigger chunk to replace it. */
- unsigned alloc_failed:1; /* No longer used, as we now call the failed
- handler on error, but retained for binary
- compatibility. */
-};
-
-/* Declare the external functions we use; they are in obstack.c. */
-
-#if defined __STDC__ && __STDC__
-extern void _obstack_newchunk (struct obstack *, int);
-extern void _obstack_free (struct obstack *, void *);
-extern int _obstack_begin (struct obstack *, int, int,
- void *(*) (long), void (*) (void *));
-extern int _obstack_begin_1 (struct obstack *, int, int,
- void *(*) (void *, long),
- void (*) (void *, void *), void *);
-extern int _obstack_memory_used (struct obstack *);
-#else
-extern void _obstack_newchunk ();
-extern void _obstack_free ();
-extern int _obstack_begin ();
-extern int _obstack_begin_1 ();
-extern int _obstack_memory_used ();
-#endif
-
-#if defined __STDC__ && __STDC__
-
-/* Do the function-declarations after the structs
- but before defining the macros. */
-
-void obstack_init (struct obstack *obstack);
-
-void * obstack_alloc (struct obstack *obstack, int size);
-
-void * obstack_copy (struct obstack *obstack, void *address, int size);
-void * obstack_copy0 (struct obstack *obstack, void *address, int size);
-
-void obstack_free (struct obstack *obstack, void *block);
-
-void obstack_blank (struct obstack *obstack, int size);
-
-void obstack_grow (struct obstack *obstack, void *data, int size);
-void obstack_grow0 (struct obstack *obstack, void *data, int size);
-
-void obstack_1grow (struct obstack *obstack, int data_char);
-void obstack_ptr_grow (struct obstack *obstack, void *data);
-void obstack_int_grow (struct obstack *obstack, int data);
-
-void * obstack_finish (struct obstack *obstack);
-
-int obstack_object_size (struct obstack *obstack);
-
-int obstack_room (struct obstack *obstack);
-void obstack_make_room (struct obstack *obstack, int size);
-void obstack_1grow_fast (struct obstack *obstack, int data_char);
-void obstack_ptr_grow_fast (struct obstack *obstack, void *data);
-void obstack_int_grow_fast (struct obstack *obstack, int data);
-void obstack_blank_fast (struct obstack *obstack, int size);
-
-void * obstack_base (struct obstack *obstack);
-void * obstack_next_free (struct obstack *obstack);
-int obstack_alignment_mask (struct obstack *obstack);
-int obstack_chunk_size (struct obstack *obstack);
-int obstack_memory_used (struct obstack *obstack);
-
-#endif /* __STDC__ */
-
-/* Non-ANSI C cannot really support alternative functions for these macros,
- so we do not declare them. */
-
-/* Error handler called when `obstack_chunk_alloc' failed to allocate
- more memory. This can be set to a user defined function. The
- default action is to print a message and abort. */
-#if defined __STDC__ && __STDC__
-extern void (*obstack_alloc_failed_handler) (void);
-#else
-extern void (*obstack_alloc_failed_handler) ();
-#endif
-
-/* Exit value used when `print_and_abort' is used. */
-extern int obstack_exit_failure;
-
-/* Pointer to beginning of object being allocated or to be allocated next.
- Note that this might not be the final address of the object
- because a new chunk might be needed to hold the final size. */
-
-#define obstack_base(h) ((h)->object_base)
-
-/* Size for allocating ordinary chunks. */
-
-#define obstack_chunk_size(h) ((h)->chunk_size)
-
-/* Pointer to next byte not yet allocated in current chunk. */
-
-#define obstack_next_free(h) ((h)->next_free)
-
-/* Mask specifying low bits that should be clear in address of an object. */
-
-#define obstack_alignment_mask(h) ((h)->alignment_mask)
-
-/* To prevent prototype warnings provide complete argument list in
- standard C version. */
-#if defined __STDC__ && __STDC__
-
-# define obstack_init(h) \
- _obstack_begin ((h), 0, 0, \
- (void *(*) (long)) obstack_chunk_alloc, (void (*) (void *)) obstack_chunk_free)
-
-# define obstack_begin(h, size) \
- _obstack_begin ((h), (size), 0, \
- (void *(*) (long)) obstack_chunk_alloc, (void (*) (void *)) obstack_chunk_free)
-
-# define obstack_specify_allocation(h, size, alignment, chunkfun, freefun) \
- _obstack_begin ((h), (size), (alignment), \
- (void *(*) (long)) (chunkfun), (void (*) (void *)) (freefun))
-
-# define obstack_specify_allocation_with_arg(h, size, alignment, chunkfun, freefun, arg) \
- _obstack_begin_1 ((h), (size), (alignment), \
- (void *(*) (void *, long)) (chunkfun), \
- (void (*) (void *, void *)) (freefun), (arg))
-
-# define obstack_chunkfun(h, newchunkfun) \
- ((h) -> chunkfun = (struct _obstack_chunk *(*)(void *, long)) (newchunkfun))
-
-# define obstack_freefun(h, newfreefun) \
- ((h) -> freefun = (void (*)(void *, struct _obstack_chunk *)) (newfreefun))
-
-#else
-
-# define obstack_init(h) \
- _obstack_begin ((h), 0, 0, \
- (void *(*) ()) obstack_chunk_alloc, (void (*) ()) obstack_chunk_free)
-
-# define obstack_begin(h, size) \
- _obstack_begin ((h), (size), 0, \
- (void *(*) ()) obstack_chunk_alloc, (void (*) ()) obstack_chunk_free)
-
-# define obstack_specify_allocation(h, size, alignment, chunkfun, freefun) \
- _obstack_begin ((h), (size), (alignment), \
- (void *(*) ()) (chunkfun), (void (*) ()) (freefun))
-
-# define obstack_specify_allocation_with_arg(h, size, alignment, chunkfun, freefun, arg) \
- _obstack_begin_1 ((h), (size), (alignment), \
- (void *(*) ()) (chunkfun), (void (*) ()) (freefun), (arg))
-
-# define obstack_chunkfun(h, newchunkfun) \
- ((h) -> chunkfun = (struct _obstack_chunk *(*)()) (newchunkfun))
-
-# define obstack_freefun(h, newfreefun) \
- ((h) -> freefun = (void (*)()) (newfreefun))
-
-#endif
-
-#define obstack_1grow_fast(h,achar) (*((h)->next_free)++ = achar)
-
-#define obstack_blank_fast(h,n) ((h)->next_free += (n))
-
-#define obstack_memory_used(h) _obstack_memory_used (h)
-
-#if defined __GNUC__ && defined __STDC__ && __STDC__
-/* NextStep 2.0 cc is really gcc 1.93 but it defines __GNUC__ = 2 and
- does not implement __extension__. But that compiler doesn't define
- __GNUC_MINOR__. */
-# if __GNUC__ < 2 || (__NeXT__ && !__GNUC_MINOR__)
-# define __extension__
-# endif
-
-/* For GNU C, if not -traditional,
- we can define these macros to compute all args only once
- without using a global variable.
- Also, we can avoid using the `temp' slot, to make faster code. */
-
-# define obstack_object_size(OBSTACK) \
- __extension__ \
- ({ struct obstack *__o = (OBSTACK); \
- (unsigned) (__o->next_free - __o->object_base); })
-
-# define obstack_room(OBSTACK) \
- __extension__ \
- ({ struct obstack *__o = (OBSTACK); \
- (unsigned) (__o->chunk_limit - __o->next_free); })
-
-# define obstack_make_room(OBSTACK,length) \
-__extension__ \
-({ struct obstack *__o = (OBSTACK); \
- int __len = (length); \
- if (__o->chunk_limit - __o->next_free < __len) \
- _obstack_newchunk (__o, __len); \
- (void) 0; })
-
-# define obstack_empty_p(OBSTACK) \
- __extension__ \
- ({ struct obstack *__o = (OBSTACK); \
- (__o->chunk->prev == 0 && __o->next_free - __o->chunk->contents == 0); })
-
-# define obstack_grow(OBSTACK,where,length) \
-__extension__ \
-({ struct obstack *__o = (OBSTACK); \
- int __len = (length); \
- if (__o->next_free + __len > __o->chunk_limit) \
- _obstack_newchunk (__o, __len); \
- _obstack_memcpy (__o->next_free, (char *) (where), __len); \
- __o->next_free += __len; \
- (void) 0; })
-
-# define obstack_grow0(OBSTACK,where,length) \
-__extension__ \
-({ struct obstack *__o = (OBSTACK); \
- int __len = (length); \
- if (__o->next_free + __len + 1 > __o->chunk_limit) \
- _obstack_newchunk (__o, __len + 1); \
- _obstack_memcpy (__o->next_free, (char *) (where), __len); \
- __o->next_free += __len; \
- *(__o->next_free)++ = 0; \
- (void) 0; })
-
-# define obstack_1grow(OBSTACK,datum) \
-__extension__ \
-({ struct obstack *__o = (OBSTACK); \
- if (__o->next_free + 1 > __o->chunk_limit) \
- _obstack_newchunk (__o, 1); \
- *(__o->next_free)++ = (datum); \
- (void) 0; })
-
-/* These assume that the obstack alignment is good enough for pointers or ints,
- and that the data added so far to the current object
- shares that much alignment. */
-
-# define obstack_ptr_grow(OBSTACK,datum) \
-__extension__ \
-({ struct obstack *__o = (OBSTACK); \
- if (__o->next_free + sizeof (void *) > __o->chunk_limit) \
- _obstack_newchunk (__o, sizeof (void *)); \
- *((void **)__o->next_free)++ = ((void *)datum); \
- (void) 0; })
-
-# define obstack_int_grow(OBSTACK,datum) \
-__extension__ \
-({ struct obstack *__o = (OBSTACK); \
- if (__o->next_free + sizeof (int) > __o->chunk_limit) \
- _obstack_newchunk (__o, sizeof (int)); \
- *((int *)__o->next_free)++ = ((int)datum); \
- (void) 0; })
-
-# define obstack_ptr_grow_fast(h,aptr) (*((void **) (h)->next_free)++ = (void *)aptr)
-# define obstack_int_grow_fast(h,aint) (*((int *) (h)->next_free)++ = (int) aint)
-
-# define obstack_blank(OBSTACK,length) \
-__extension__ \
-({ struct obstack *__o = (OBSTACK); \
- int __len = (length); \
- if (__o->chunk_limit - __o->next_free < __len) \
- _obstack_newchunk (__o, __len); \
- __o->next_free += __len; \
- (void) 0; })
-
-# define obstack_alloc(OBSTACK,length) \
-__extension__ \
-({ struct obstack *__h = (OBSTACK); \
- obstack_blank (__h, (length)); \
- obstack_finish (__h); })
-
-# define obstack_copy(OBSTACK,where,length) \
-__extension__ \
-({ struct obstack *__h = (OBSTACK); \
- obstack_grow (__h, (where), (length)); \
- obstack_finish (__h); })
-
-# define obstack_copy0(OBSTACK,where,length) \
-__extension__ \
-({ struct obstack *__h = (OBSTACK); \
- obstack_grow0 (__h, (where), (length)); \
- obstack_finish (__h); })
-
-/* The local variable is named __o1 to avoid a name conflict
- when obstack_blank is called. */
-# define obstack_finish(OBSTACK) \
-__extension__ \
-({ struct obstack *__o1 = (OBSTACK); \
- void *value; \
- value = (void *) __o1->object_base; \
- if (__o1->next_free == value) \
- __o1->maybe_empty_object = 1; \
- __o1->next_free \
- = __INT_TO_PTR ((__PTR_TO_INT (__o1->next_free)+__o1->alignment_mask)\
- & ~ (__o1->alignment_mask)); \
- if (__o1->next_free - (char *)__o1->chunk \
- > __o1->chunk_limit - (char *)__o1->chunk) \
- __o1->next_free = __o1->chunk_limit; \
- __o1->object_base = __o1->next_free; \
- value; })
-
-# define obstack_free(OBSTACK, OBJ) \
-__extension__ \
-({ struct obstack *__o = (OBSTACK); \
- void *__obj = (OBJ); \
- if (__obj > (void *)__o->chunk && __obj < (void *)__o->chunk_limit) \
- __o->next_free = __o->object_base = __obj; \
- else (obstack_free) (__o, __obj); })
-
-#else /* not __GNUC__ or not __STDC__ */
-
-# define obstack_object_size(h) \
- (unsigned) ((h)->next_free - (h)->object_base)
-
-# define obstack_room(h) \
- (unsigned) ((h)->chunk_limit - (h)->next_free)
-
-# define obstack_empty_p(h) \
- ((h)->chunk->prev == 0 && (h)->next_free - (h)->chunk->contents == 0)
-
-/* Note that the call to _obstack_newchunk is enclosed in (..., 0)
- so that we can avoid having void expressions
- in the arms of the conditional expression.
- Casting the third operand to void was tried before,
- but some compilers won't accept it. */
-
-# define obstack_make_room(h,length) \
-( (h)->temp = (length), \
- (((h)->next_free + (h)->temp > (h)->chunk_limit) \
- ? (_obstack_newchunk ((h), (h)->temp), 0) : 0))
-
-# define obstack_grow(h,where,length) \
-( (h)->temp = (length), \
- (((h)->next_free + (h)->temp > (h)->chunk_limit) \
- ? (_obstack_newchunk ((h), (h)->temp), 0) : 0), \
- _obstack_memcpy ((h)->next_free, (char *) (where), (h)->temp), \
- (h)->next_free += (h)->temp)
-
-# define obstack_grow0(h,where,length) \
-( (h)->temp = (length), \
- (((h)->next_free + (h)->temp + 1 > (h)->chunk_limit) \
- ? (_obstack_newchunk ((h), (h)->temp + 1), 0) : 0), \
- _obstack_memcpy ((h)->next_free, (char *) (where), (h)->temp), \
- (h)->next_free += (h)->temp, \
- *((h)->next_free)++ = 0)
-
-# define obstack_1grow(h,datum) \
-( (((h)->next_free + 1 > (h)->chunk_limit) \
- ? (_obstack_newchunk ((h), 1), 0) : 0), \
- (*((h)->next_free)++ = (datum)))
-
-# define obstack_ptr_grow(h,datum) \
-( (((h)->next_free + sizeof (char *) > (h)->chunk_limit) \
- ? (_obstack_newchunk ((h), sizeof (char *)), 0) : 0), \
- (*((char **) (((h)->next_free+=sizeof(char *))-sizeof(char *))) = ((char *) datum)))
-
-# define obstack_int_grow(h,datum) \
-( (((h)->next_free + sizeof (int) > (h)->chunk_limit) \
- ? (_obstack_newchunk ((h), sizeof (int)), 0) : 0), \
- (*((int *) (((h)->next_free+=sizeof(int))-sizeof(int))) = ((int) datum)))
-
-# define obstack_ptr_grow_fast(h,aptr) (*((char **) (h)->next_free)++ = (char *) aptr)
-# define obstack_int_grow_fast(h,aint) (*((int *) (h)->next_free)++ = (int) aint)
-
-# define obstack_blank(h,length) \
-( (h)->temp = (length), \
- (((h)->chunk_limit - (h)->next_free < (h)->temp) \
- ? (_obstack_newchunk ((h), (h)->temp), 0) : 0), \
- ((h)->next_free += (h)->temp))
-
-# define obstack_alloc(h,length) \
- (obstack_blank ((h), (length)), obstack_finish ((h)))
-
-# define obstack_copy(h,where,length) \
- (obstack_grow ((h), (where), (length)), obstack_finish ((h)))
-
-# define obstack_copy0(h,where,length) \
- (obstack_grow0 ((h), (where), (length)), obstack_finish ((h)))
-
-# define obstack_finish(h) \
-( ((h)->next_free == (h)->object_base \
- ? (((h)->maybe_empty_object = 1), 0) \
- : 0), \
- (h)->temp = __PTR_TO_INT ((h)->object_base), \
- (h)->next_free \
- = __INT_TO_PTR ((__PTR_TO_INT ((h)->next_free)+(h)->alignment_mask) \
- & ~ ((h)->alignment_mask)), \
- (((h)->next_free - (char *) (h)->chunk \
- > (h)->chunk_limit - (char *) (h)->chunk) \
- ? ((h)->next_free = (h)->chunk_limit) : 0), \
- (h)->object_base = (h)->next_free, \
- __INT_TO_PTR ((h)->temp))
-
-# if defined __STDC__ && __STDC__
-# define obstack_free(h,obj) \
-( (h)->temp = (char *) (obj) - (char *) (h)->chunk, \
- (((h)->temp > 0 && (h)->temp < (h)->chunk_limit - (char *) (h)->chunk)\
- ? (int) ((h)->next_free = (h)->object_base \
- = (h)->temp + (char *) (h)->chunk) \
- : (((obstack_free) ((h), (h)->temp + (char *) (h)->chunk), 0), 0)))
-# else
-# define obstack_free(h,obj) \
-( (h)->temp = (char *) (obj) - (char *) (h)->chunk, \
- (((h)->temp > 0 && (h)->temp < (h)->chunk_limit - (char *) (h)->chunk)\
- ? (int) ((h)->next_free = (h)->object_base \
- = (h)->temp + (char *) (h)->chunk) \
- : (_obstack_free ((h), (h)->temp + (char *) (h)->chunk), 0)))
-# endif
-
-#endif /* not __GNUC__ or not __STDC__ */
-
-#ifdef __cplusplus
-} /* C++ */
-#endif
-
-#endif /* obstack.h */
diff --git a/contrib/gcc/patch-apollo-includes b/contrib/gcc/patch-apollo-includes
deleted file mode 100755
index 8daf88cb54e8..000000000000
--- a/contrib/gcc/patch-apollo-includes
+++ /dev/null
@@ -1,69 +0,0 @@
-#!/bin/sh
-# patch-apollo-includes -- fix some (but not all!) Apollo brain damage.
-
-FILES_TO_PATCH='sys/types.h setjmp.h'
-
-mkdir sys
-
-for i in $FILES_TO_PATCH;
-do
- cp /bsd4.3/usr/include/$i ./$i
-done
-
-patch -b -apollo <<'EOP'
-*** /bsd4.3/usr/include/sys/types.h Fri Apr 8 20:29:06 1988
---- sys/types.h Wed Feb 26 21:17:57 1992
-***************
-*** 38,44 ****
---- 38,47 ----
- typedef char * caddr_t;
- typedef u_long ino_t;
- typedef long swblk_t;
-+ #ifndef _SIZE_T
-+ #define _SIZE_T
- typedef long size_t;
-+ #endif
- typedef long time_t;
- typedef long dev_t;
- typedef long off_t;
-*** /bsd4.3/usr/include/setjmp.h Fri Feb 3 21:40:21 1989
---- setjmp.h Sun Feb 23 19:06:55 1992
-***************
-*** 24,30 ****
---- 24,39 ----
- #endif
-
-
-+ #ifdef __GNUC__
- #ifdef _PROTOTYPES
-+ extern int sigsetjmp (sigjmp_buf env, int savemask);
-+ extern void siglongjmp (sigjmp_buf env, int val);
-+ #else
-+ extern int sigsetjmp();
-+ extern void siglongjmp();
-+ #endif /* _PROTOTYPES */
-+ #else /* not __GNUC__ */
-+ #ifdef _PROTOTYPES
- extern int sigsetjmp(
- sigjmp_buf env,
- int savemask
-***************
-*** 37,43 ****
- extern int sigsetjmp() #options(abnormal);
- extern void siglongjmp() #options(noreturn);
- #endif /* _PROTOTYPES */
-!
- #undef _PROTOTYPES
-
- #ifdef __cplusplus
---- 46,52 ----
- extern int sigsetjmp() #options(abnormal);
- extern void siglongjmp() #options(noreturn);
- #endif /* _PROTOTYPES */
-! #endif /* not __GNUC__ */
- #undef _PROTOTYPES
-
- #ifdef __cplusplus
-EOP
-
-exit 0
diff --git a/contrib/gcc/pcp.h b/contrib/gcc/pcp.h
deleted file mode 100644
index 280a65ec35da..000000000000
--- a/contrib/gcc/pcp.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/* pcp.h -- Describes the format of a precompiled file
- Copyright (C) 1990 Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-
-
-/* Structure allocated for every string in a precompiled file */
-typedef struct stringdef STRINGDEF;
-struct stringdef
-{
- U_CHAR *contents; /* String to include */
- int len; /* Its length */
- int writeflag; /* Whether we write this */
- int lineno; /* Linenumber of source file */
- U_CHAR *filename; /* Name of source file */
- STRINGDEF *chain; /* Global list of strings in natural order */
- int output_mark; /* Where in the output this goes */
-};
-
-typedef struct keydef KEYDEF;
-struct keydef
-{
- STRINGDEF *str;
- KEYDEF *chain;
-};
-
-/* Format: */
-/* A precompiled file starts with a series of #define and #undef
- statements:
- #define MAC DEF --- Indicates MAC must be defined with defn DEF
- #define MAC --- Indicates MAC must be defined with any defn
- #undef MAC --- Indicates MAC cannot be defined
-
-These preconditions must be true for a precompiled file to be used.
-The preconditions section is null terminated. */
-
-/* Then, there is a four byte number (in network byte order) which */
- /* indicates the number of strings the file contains. */
-
-/* Each string contains a STRINGDEF structure. The only component of */
- /* the STRINGDEF structure which is used is the lineno field, which */
- /* should hold the line number in the original header file. */
- /* Then follows the string, followed by a null. Then comes a four */
- /* byte number (again, in network byte order) indicating the number */
- /* of keys for this string. Each key is a KEYDEF structure, with */
- /* irrelevant contents, followed by the null-terminated string. */
-
-/* If the number of keys is 0, then there are no keys for the string, */
- /* in other words, the string will never be included. If the number */
- /* of keys is -1, this is a special flag indicating there are no keys */
- /* in the file, and the string is mandatory (that is, it must be */
- /* included regardless in the included output). */
-
-/* A file, then, looks like this:
-
- Precondition 1
- Precondition 2
- .
- .
- .
- <NUL>
- Number of strings
- STRINGDEF
- String . . . <NUL>
- Number of keys
- KEYDEF
- Key . . . <NUL>
- KEYDEF
- Key . . . <NUL>
- .
- .
- .
- STRINGDEF
- String . . . <NUL>
- Number of keys
- KEYDEF
- Key . . . <NUL>
- .
- .
- .
- .
- .
- .
-
-*/
diff --git a/contrib/gcc/pexecute.c b/contrib/gcc/pexecute.c
deleted file mode 100644
index 6f6a0449d097..000000000000
--- a/contrib/gcc/pexecute.c
+++ /dev/null
@@ -1,734 +0,0 @@
-/* Utilities to execute a program in a subprocess (possibly linked by pipes
- with other subprocesses), and wait for it.
- Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
-
-This file is part of the libiberty library.
-Libiberty 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.
-
-Libiberty 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 libiberty; see the file COPYING.LIB. If not,
-write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* This file exports two functions: pexecute and pwait. */
-
-/* This file lives in at least two places: libiberty and gcc.
- Don't change one without the other. */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <stdio.h>
-#include <errno.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#define ISSPACE (x) isspace(x)
-#ifdef HAVE_SYS_WAIT_H
-#include <sys/wait.h>
-#endif
-
-#ifdef vfork /* Autoconf may define this to fork for us. */
-# define VFORK_STRING "fork"
-#else
-# define VFORK_STRING "vfork"
-#endif
-#ifdef HAVE_VFORK_H
-#include <vfork.h>
-#endif
-#ifdef VMS
-#define vfork() (decc$$alloc_vfork_blocks() >= 0 ? \
- lib$get_current_invo_context(decc$$get_vfork_jmpbuf()) : -1)
-#endif /* VMS */
-
-#include "libiberty.h"
-
-/* stdin file number. */
-#define STDIN_FILE_NO 0
-
-/* stdout file number. */
-#define STDOUT_FILE_NO 1
-
-/* value of `pipe': port index for reading. */
-#define READ_PORT 0
-
-/* value of `pipe': port index for writing. */
-#define WRITE_PORT 1
-
-static char *install_error_msg = "installation problem, cannot exec `%s'";
-
-/* pexecute: execute a program.
-
- PROGRAM and ARGV are the arguments to execv/execvp.
-
- THIS_PNAME is name of the calling program (i.e. argv[0]).
-
- TEMP_BASE is the path name, sans suffix, of a temporary file to use
- if needed. This is currently only needed for MSDOS ports that don't use
- GO32 (do any still exist?). Ports that don't need it can pass NULL.
-
- (FLAGS & PEXECUTE_SEARCH) is non-zero if $PATH should be searched
- (??? It's not clear that GCC passes this flag correctly).
- (FLAGS & PEXECUTE_FIRST) is nonzero for the first process in chain.
- (FLAGS & PEXECUTE_FIRST) is nonzero for the last process in chain.
- FIRST_LAST could be simplified to only mark the last of a chain of processes
- but that requires the caller to always mark the last one (and not give up
- early if some error occurs). It's more robust to require the caller to
- mark both ends of the chain.
-
- The result is the pid on systems like Unix where we fork/exec and on systems
- like WIN32 and OS2 where we use spawn. It is up to the caller to wait for
- the child.
-
- The result is the WEXITSTATUS on systems like MSDOS where we spawn and wait
- for the child here.
-
- Upon failure, ERRMSG_FMT and ERRMSG_ARG are set to the text of the error
- message with an optional argument (if not needed, ERRMSG_ARG is set to
- NULL), and -1 is returned. `errno' is available to the caller to use.
-
- pwait: cover function for wait.
-
- PID is the process id of the task to wait for.
- STATUS is the `status' argument to wait.
- FLAGS is currently unused (allows future enhancement without breaking
- upward compatibility). Pass 0 for now.
-
- The result is the pid of the child reaped,
- or -1 for failure (errno says why).
-
- On systems that don't support waiting for a particular child, PID is
- ignored. On systems like MSDOS that don't really multitask pwait
- is just a mechanism to provide a consistent interface for the caller.
-
- pfinish: finish generation of script
-
- pfinish is necessary for systems like MPW where a script is generated that
- runs the requested programs.
-*/
-
-#ifdef __MSDOS__
-
-/* MSDOS doesn't multitask, but for the sake of a consistent interface
- the code behaves like it does. pexecute runs the program, tucks the
- exit code away, and returns a "pid". pwait must be called to fetch the
- exit code. */
-
-#include <process.h>
-
-/* For communicating information from pexecute to pwait. */
-static int last_pid = 0;
-static int last_status = 0;
-static int last_reaped = 0;
-
-int
-pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, flags)
- const char *program;
- char * const *argv;
- const char *this_pname;
- const char *temp_base;
- char **errmsg_fmt, **errmsg_arg;
- int flags;
-{
- int rc;
-
- last_pid++;
- if (last_pid < 0)
- last_pid = 1;
-
- if ((flags & PEXECUTE_ONE) != PEXECUTE_ONE)
- abort ();
-
-#ifdef __GO32__
- /* ??? What are the possible return values from spawnv? */
- rc = (flags & PEXECUTE_SEARCH ? spawnvp : spawnv) (1, program, argv);
-#else
- char *scmd, *rf;
- FILE *argfile;
- int i, el = flags & PEXECUTE_SEARCH ? 4 : 0;
-
- scmd = (char *) xmalloc (strlen (program) + strlen (temp_base) + 6 + el);
- rf = scmd + strlen(program) + 2 + el;
- sprintf (scmd, "%s%s @%s.gp", program,
- (flags & PEXECUTE_SEARCH ? ".exe" : ""), temp_base);
- argfile = fopen (rf, "w");
- if (argfile == 0)
- {
- int errno_save = errno;
- free (scmd);
- errno = errno_save;
- *errmsg_fmt = "cannot open `%s.gp'";
- *errmsg_arg = temp_base;
- return -1;
- }
-
- for (i=1; argv[i]; i++)
- {
- char *cp;
- for (cp = argv[i]; *cp; cp++)
- {
- if (*cp == '"' || *cp == '\'' || *cp == '\\' || ISSPACE (*cp))
- fputc ('\\', argfile);
- fputc (*cp, argfile);
- }
- fputc ('\n', argfile);
- }
- fclose (argfile);
-
- rc = system (scmd);
-
- {
- int errno_save = errno;
- remove (rf);
- free (scmd);
- errno = errno_save;
- }
-#endif
-
- if (rc == -1)
- {
- *errmsg_fmt = install_error_msg;
- *errmsg_arg = program;
- return -1;
- }
-
- /* Tuck the status away for pwait, and return a "pid". */
- last_status = rc << 8;
- return last_pid;
-}
-
-int
-pwait (pid, status, flags)
- int pid;
- int *status;
- int flags;
-{
- /* On MSDOS each pexecute must be followed by it's associated pwait. */
- if (pid != last_pid
- /* Called twice for the same child? */
- || pid == last_reaped)
- {
- /* ??? ECHILD would be a better choice. Can we use it here? */
- errno = EINVAL;
- return -1;
- }
- /* ??? Here's an opportunity to canonicalize the values in STATUS.
- Needed? */
- *status = last_status;
- last_reaped = last_pid;
- return last_pid;
-}
-
-#endif /* MSDOS */
-
-#if defined (_WIN32) && ! defined (_UWIN)
-
-#include <process.h>
-
-#ifdef __CYGWIN__
-
-#define fix_argv(argvec) (argvec)
-
-extern int _spawnv ();
-extern int _spawnvp ();
-
-#else /* ! __CYGWIN__ */
-
-/* This is a kludge to get around the Microsoft C spawn functions' propensity
- to remove the outermost set of double quotes from all arguments. */
-
-const char * const *
-fix_argv (argvec)
- char **argvec;
-{
- int i;
-
- for (i = 1; argvec[i] != 0; i++)
- {
- int len, j;
- char *temp, *newtemp;
-
- temp = argvec[i];
- len = strlen (temp);
- for (j = 0; j < len; j++)
- {
- if (temp[j] == '"')
- {
- newtemp = xmalloc (len + 2);
- strncpy (newtemp, temp, j);
- newtemp [j] = '\\';
- strncpy (&newtemp [j+1], &temp [j], len-j);
- newtemp [len+1] = 0;
- temp = newtemp;
- len++;
- j++;
- }
- }
-
- argvec[i] = temp;
- }
-
- return (const char * const *) argvec;
-}
-#endif /* __CYGWIN__ */
-
-#include <io.h>
-#include <fcntl.h>
-#include <signal.h>
-
-/* mingw32 headers may not define the following. */
-
-#ifndef _P_WAIT
-# define _P_WAIT 0
-# define _P_NOWAIT 1
-# define _P_OVERLAY 2
-# define _P_NOWAITO 3
-# define _P_DETACH 4
-
-# define WAIT_CHILD 0
-# define WAIT_GRANDCHILD 1
-#endif
-
-/* Win32 supports pipes */
-int
-pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, flags)
- const char *program;
- char * const *argv;
- const char *this_pname;
- const char *temp_base;
- char **errmsg_fmt, **errmsg_arg;
- int flags;
-{
- int pid;
- int pdes[2], org_stdin, org_stdout;
- int input_desc, output_desc;
- int retries, sleep_interval;
-
- /* Pipe waiting from last process, to be used as input for the next one.
- Value is STDIN_FILE_NO if no pipe is waiting
- (i.e. the next command is the first of a group). */
- static int last_pipe_input;
-
- /* If this is the first process, initialize. */
- if (flags & PEXECUTE_FIRST)
- last_pipe_input = STDIN_FILE_NO;
-
- input_desc = last_pipe_input;
-
- /* If this isn't the last process, make a pipe for its output,
- and record it as waiting to be the input to the next process. */
- if (! (flags & PEXECUTE_LAST))
- {
- if (_pipe (pdes, 256, O_BINARY) < 0)
- {
- *errmsg_fmt = "pipe";
- *errmsg_arg = NULL;
- return -1;
- }
- output_desc = pdes[WRITE_PORT];
- last_pipe_input = pdes[READ_PORT];
- }
- else
- {
- /* Last process. */
- output_desc = STDOUT_FILE_NO;
- last_pipe_input = STDIN_FILE_NO;
- }
-
- if (input_desc != STDIN_FILE_NO)
- {
- org_stdin = dup (STDIN_FILE_NO);
- dup2 (input_desc, STDIN_FILE_NO);
- close (input_desc);
- }
-
- if (output_desc != STDOUT_FILE_NO)
- {
- org_stdout = dup (STDOUT_FILE_NO);
- dup2 (output_desc, STDOUT_FILE_NO);
- close (output_desc);
- }
-
- pid = (flags & PEXECUTE_SEARCH ? _spawnvp : _spawnv)
- (_P_NOWAIT, program, fix_argv(argv));
-
- if (input_desc != STDIN_FILE_NO)
- {
- dup2 (org_stdin, STDIN_FILE_NO);
- close (org_stdin);
- }
-
- if (output_desc != STDOUT_FILE_NO)
- {
- dup2 (org_stdout, STDOUT_FILE_NO);
- close (org_stdout);
- }
-
- if (pid == -1)
- {
- *errmsg_fmt = install_error_msg;
- *errmsg_arg = program;
- return -1;
- }
-
- return pid;
-}
-
-/* MS CRTDLL doesn't return enough information in status to decide if the
- child exited due to a signal or not, rather it simply returns an
- integer with the exit code of the child; eg., if the child exited with
- an abort() call and didn't have a handler for SIGABRT, it simply returns
- with status = 3. We fix the status code to conform to the usual WIF*
- macros. Note that WIFSIGNALED will never be true under CRTDLL. */
-
-int
-pwait (pid, status, flags)
- int pid;
- int *status;
- int flags;
-{
-#ifdef __CYGWIN__
- return wait (status);
-#else
- int termstat;
-
- pid = _cwait (&termstat, pid, WAIT_CHILD);
-
- /* ??? Here's an opportunity to canonicalize the values in STATUS.
- Needed? */
-
- /* cwait returns the child process exit code in termstat.
- A value of 3 indicates that the child caught a signal, but not
- which one. Since only SIGABRT, SIGFPE and SIGINT do anything, we
- report SIGABRT. */
- if (termstat == 3)
- *status = SIGABRT;
- else
- *status = (((termstat) & 0xff) << 8);
-
- return pid;
-#endif /* __CYGWIN__ */
-}
-
-#endif /* _WIN32 && ! _UWIN */
-
-#ifdef OS2
-
-/* ??? Does OS2 have process.h? */
-extern int spawnv ();
-extern int spawnvp ();
-
-int
-pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, flags)
- const char *program;
- char * const *argv;
- const char *this_pname;
- const char *temp_base;
- char **errmsg_fmt, **errmsg_arg;
- int flags;
-{
- int pid;
-
- if ((flags & PEXECUTE_ONE) != PEXECUTE_ONE)
- abort ();
- /* ??? Presumably 1 == _P_NOWAIT. */
- pid = (flags & PEXECUTE_SEARCH ? spawnvp : spawnv) (1, program, argv);
- if (pid == -1)
- {
- *errmsg_fmt = install_error_msg;
- *errmsg_arg = program;
- return -1;
- }
- return pid;
-}
-
-int
-pwait (pid, status, flags)
- int pid;
- int *status;
- int flags;
-{
- /* ??? Here's an opportunity to canonicalize the values in STATUS.
- Needed? */
- int pid = wait (status);
- return pid;
-}
-
-#endif /* OS2 */
-
-#ifdef MPW
-
-/* MPW pexecute doesn't actually run anything; instead, it writes out
- script commands that, when run, will do the actual executing.
-
- For example, in GCC's case, GCC will write out several script commands:
-
- cpp ...
- cc1 ...
- as ...
- ld ...
-
- and then exit. None of the above programs will have run yet. The task
- that called GCC will then execute the script and cause cpp,etc. to run.
- The caller must invoke pfinish before calling exit. This adds
- the finishing touches to the generated script. */
-
-static int first_time = 1;
-
-int
-pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, flags)
- const char *program;
- char * const *argv;
- const char *this_pname;
- const char *temp_base;
- char **errmsg_fmt, **errmsg_arg;
- int flags;
-{
- char tmpprogram[255];
- char *cp, *tmpname;
- int i;
-
- mpwify_filename (program, tmpprogram);
- if (first_time)
- {
- printf ("Set Failed 0\n");
- first_time = 0;
- }
-
- fputs ("If {Failed} == 0\n", stdout);
- /* If being verbose, output a copy of the command. It should be
- accurate enough and escaped enough to be "clickable". */
- if (flags & PEXECUTE_VERBOSE)
- {
- fputs ("\tEcho ", stdout);
- fputc ('\'', stdout);
- fputs (tmpprogram, stdout);
- fputc ('\'', stdout);
- fputc (' ', stdout);
- for (i=1; argv[i]; i++)
- {
- fputc ('\'', stdout);
- /* See if we have an argument that needs fixing. */
- if (strchr(argv[i], '/'))
- {
- tmpname = (char *) xmalloc (256);
- mpwify_filename (argv[i], tmpname);
- argv[i] = tmpname;
- }
- for (cp = argv[i]; *cp; cp++)
- {
- /* Write an Option-d escape char in front of special chars. */
- if (strchr("'+", *cp))
- fputc ('\266', stdout);
- fputc (*cp, stdout);
- }
- fputc ('\'', stdout);
- fputc (' ', stdout);
- }
- fputs ("\n", stdout);
- }
- fputs ("\t", stdout);
- fputs (tmpprogram, stdout);
- fputc (' ', stdout);
-
- for (i=1; argv[i]; i++)
- {
- /* See if we have an argument that needs fixing. */
- if (strchr(argv[i], '/'))
- {
- tmpname = (char *) xmalloc (256);
- mpwify_filename (argv[i], tmpname);
- argv[i] = tmpname;
- }
- if (strchr (argv[i], ' '))
- fputc ('\'', stdout);
- for (cp = argv[i]; *cp; cp++)
- {
- /* Write an Option-d escape char in front of special chars. */
- if (strchr("'+", *cp))
- fputc ('\266', stdout);
- fputc (*cp, stdout);
- }
- if (strchr (argv[i], ' '))
- fputc ('\'', stdout);
- fputc (' ', stdout);
- }
-
- fputs ("\n", stdout);
-
- /* Output commands that arrange to clean up and exit if a failure occurs.
- We have to be careful to collect the status from the program that was
- run, rather than some other script command. Also, we don't exit
- immediately, since necessary cleanups are at the end of the script. */
- fputs ("\tSet TmpStatus {Status}\n", stdout);
- fputs ("\tIf {TmpStatus} != 0\n", stdout);
- fputs ("\t\tSet Failed {TmpStatus}\n", stdout);
- fputs ("\tEnd\n", stdout);
- fputs ("End\n", stdout);
-
- /* We're just composing a script, can't fail here. */
- return 0;
-}
-
-int
-pwait (pid, status, flags)
- int pid;
- int *status;
- int flags;
-{
- *status = 0;
- return 0;
-}
-
-/* Write out commands that will exit with the correct error code
- if something in the script failed. */
-
-void
-pfinish ()
-{
- printf ("\tExit \"{Failed}\"\n");
-}
-
-#endif /* MPW */
-
-/* include for Unix-like environments but not for Dos-like environments */
-#if ! defined (__MSDOS__) && ! defined (OS2) && ! defined (MPW) \
- && ! (defined (_WIN32) && ! defined (_UWIN))
-
-extern int execv ();
-extern int execvp ();
-
-int
-pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, flags)
- const char *program;
- char * const *argv;
- const char *this_pname;
- const char *temp_base;
- char **errmsg_fmt, **errmsg_arg;
- int flags;
-{
- int (*func)() = (flags & PEXECUTE_SEARCH ? execvp : execv);
- int pid;
- int pdes[2];
- int input_desc, output_desc;
- int retries, sleep_interval;
- /* Pipe waiting from last process, to be used as input for the next one.
- Value is STDIN_FILE_NO if no pipe is waiting
- (i.e. the next command is the first of a group). */
- static int last_pipe_input;
-
- /* If this is the first process, initialize. */
- if (flags & PEXECUTE_FIRST)
- last_pipe_input = STDIN_FILE_NO;
-
- input_desc = last_pipe_input;
-
- /* If this isn't the last process, make a pipe for its output,
- and record it as waiting to be the input to the next process. */
- if (! (flags & PEXECUTE_LAST))
- {
- if (pipe (pdes) < 0)
- {
- *errmsg_fmt = "pipe";
- *errmsg_arg = NULL;
- return -1;
- }
- output_desc = pdes[WRITE_PORT];
- last_pipe_input = pdes[READ_PORT];
- }
- else
- {
- /* Last process. */
- output_desc = STDOUT_FILE_NO;
- last_pipe_input = STDIN_FILE_NO;
- }
-
- /* Fork a subprocess; wait and retry if it fails. */
- sleep_interval = 1;
- for (retries = 0; retries < 4; retries++)
- {
- pid = vfork ();
- if (pid >= 0)
- break;
- sleep (sleep_interval);
- sleep_interval *= 2;
- }
-
- switch (pid)
- {
- case -1:
- {
- *errmsg_fmt = VFORK_STRING;
- *errmsg_arg = NULL;
- return -1;
- }
-
- case 0: /* child */
- /* Move the input and output pipes into place, if necessary. */
- if (input_desc != STDIN_FILE_NO)
- {
- close (STDIN_FILE_NO);
- dup (input_desc);
- close (input_desc);
- }
- if (output_desc != STDOUT_FILE_NO)
- {
- close (STDOUT_FILE_NO);
- dup (output_desc);
- close (output_desc);
- }
-
- /* Close the parent's descs that aren't wanted here. */
- if (last_pipe_input != STDIN_FILE_NO)
- close (last_pipe_input);
-
- /* Exec the program. */
- (*func) (program, argv);
-
- /* Note: Calling fprintf and exit here doesn't seem right for vfork. */
- fprintf (stderr, "%s: ", this_pname);
- fprintf (stderr, install_error_msg, program);
- fprintf (stderr, ": %s\n", xstrerror (errno));
- exit (-1);
- /* NOTREACHED */
- return 0;
-
- default:
- /* In the parent, after forking.
- Close the descriptors that we made for this child. */
- if (input_desc != STDIN_FILE_NO)
- close (input_desc);
- if (output_desc != STDOUT_FILE_NO)
- close (output_desc);
-
- /* Return child's process number. */
- return pid;
- }
-}
-
-int
-pwait (pid, status, flags)
- int pid;
- int *status;
- int flags;
-{
- /* ??? Here's an opportunity to canonicalize the values in STATUS.
- Needed? */
-#ifdef VMS
- pid = waitpid (-1, status, 0);
-#else
- pid = wait (status);
-#endif
- return pid;
-}
-
-#endif /* ! __MSDOS__ && ! OS2 && ! MPW && ! (_WIN32 && ! _UWIN) */
diff --git a/contrib/gcc/pself.c b/contrib/gcc/pself.c
deleted file mode 100644
index d8471daafeae..000000000000
--- a/contrib/gcc/pself.c
+++ /dev/null
@@ -1 +0,0 @@
-main(){char*p="main(){char*p=%c%s%c;(void)printf(p,34,p,34,10);}%c";(void)printf(p,34,p,34,10);}
diff --git a/contrib/gcc/pself1.c b/contrib/gcc/pself1.c
deleted file mode 100644
index acdfc650583d..000000000000
--- a/contrib/gcc/pself1.c
+++ /dev/null
@@ -1 +0,0 @@
-main(a){a="main(a){a=%c%s%c;printf(a,34,a,34);}";printf(a,34,a,34);} \ No newline at end of file
diff --git a/contrib/gcc/pself2.c b/contrib/gcc/pself2.c
deleted file mode 100644
index c88a8c1046d8..000000000000
--- a/contrib/gcc/pself2.c
+++ /dev/null
@@ -1 +0,0 @@
-main(){char*a="main(){char*a=%c%s%c;int b='%c';printf(a,b,a,b,b);}";int b='"';printf(a,b,a,b,b);}
diff --git a/contrib/gcc/pself3.c b/contrib/gcc/pself3.c
deleted file mode 100644
index dbdeac6e4104..000000000000
--- a/contrib/gcc/pself3.c
+++ /dev/null
@@ -1 +0,0 @@
-main(a){printf(a,34,a="main(a){printf(a,34,a=%c%s%c,34);}",34);}
diff --git a/contrib/gcc/pself4.c b/contrib/gcc/pself4.c
deleted file mode 100644
index 02a6f7cded63..000000000000
--- a/contrib/gcc/pself4.c
+++ /dev/null
@@ -1,2 +0,0 @@
-#include <stdio.h>
-int main(void){char*p="#include <stdio.h>%cint main(void){char*p=%c%s%c;(void)printf(p,10,34,p,34,10);return 0;}%c";(void)printf(p,10,34,p,34,10);return 0;}
diff --git a/contrib/gcc/pself5.c b/contrib/gcc/pself5.c
deleted file mode 100644
index 8f6f8e3b26f2..000000000000
--- a/contrib/gcc/pself5.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <stdio.h>
-#define N '\n'
-#define Q '\"'
-#define B '\\'
-int main(void){char*p="#include <stdio.h>%c#define N '%cn'%c#define Q '%c%c'%c#define B '%c%c'%cint main(void){char*p=%c%s%c;(void)printf(p,N,B,N,B,Q,N,B,B,N,Q,p,Q,N);return 0;}%c";(void)printf(p,N,B,N,B,Q,N,B,B,N,Q,p,Q,N);return 0;}
diff --git a/contrib/gcc/rtl.texi b/contrib/gcc/rtl.texi
deleted file mode 100644
index ebb07acabb27..000000000000
--- a/contrib/gcc/rtl.texi
+++ /dev/null
@@ -1,2998 +0,0 @@
-@c Copyright (C) 1988, 89, 92, 94, 97, 1998, 1999 Free Software Foundation, Inc.
-@c This is part of the GCC manual.
-@c For copying conditions, see the file gcc.texi.
-
-@node RTL
-@chapter RTL Representation
-@cindex RTL representation
-@cindex representation of RTL
-@cindex Register Transfer Language (RTL)
-
-Most of the work of the compiler is done on an intermediate representation
-called register transfer language. In this language, the instructions to be
-output are described, pretty much one by one, in an algebraic form that
-describes what the instruction does.
-
-RTL is inspired by Lisp lists. It has both an internal form, made up of
-structures that point at other structures, and a textual form that is used
-in the machine description and in printed debugging dumps. The textual
-form uses nested parentheses to indicate the pointers in the internal form.
-
-@menu
-* RTL Objects:: Expressions vs vectors vs strings vs integers.
-* RTL Classes:: Categories of RTL expresion objects, and their structure.
-* Accessors:: Macros to access expression operands or vector elts.
-* Flags:: Other flags in an RTL expression.
-* Machine Modes:: Describing the size and format of a datum.
-* Constants:: Expressions with constant values.
-* Regs and Memory:: Expressions representing register contents or memory.
-* Arithmetic:: Expressions representing arithmetic on other expressions.
-* Comparisons:: Expressions representing comparison of expressions.
-* Bit Fields:: Expressions representing bitfields in memory or reg.
-* Conversions:: Extending, truncating, floating or fixing.
-* RTL Declarations:: Declaring volatility, constancy, etc.
-* Side Effects:: Expressions for storing in registers, etc.
-* Incdec:: Embedded side-effects for autoincrement addressing.
-* Assembler:: Representing @code{asm} with operands.
-* Insns:: Expression types for entire insns.
-* Calls:: RTL representation of function call insns.
-* Sharing:: Some expressions are unique; others *must* be copied.
-* Reading RTL:: Reading textual RTL from a file.
-@end menu
-
-@node RTL Objects, RTL Classes, RTL, RTL
-@section RTL Object Types
-@cindex RTL object types
-
-@cindex RTL integers
-@cindex RTL strings
-@cindex RTL vectors
-@cindex RTL expression
-@cindex RTX (See RTL)
-RTL uses five kinds of objects: expressions, integers, wide integers,
-strings and vectors. Expressions are the most important ones. An RTL
-expression (``RTX'', for short) is a C structure, but it is usually
-referred to with a pointer; a type that is given the typedef name
-@code{rtx}.
-
-An integer is simply an @code{int}; their written form uses decimal digits.
-A wide integer is an integral object whose type is @code{HOST_WIDE_INT}
-(@pxref{Config}); their written form uses decimal digits.
-
-A string is a sequence of characters. In core it is represented as a
-@code{char *} in usual C fashion, and it is written in C syntax as well.
-However, strings in RTL may never be null. If you write an empty string in
-a machine description, it is represented in core as a null pointer rather
-than as a pointer to a null character. In certain contexts, these null
-pointers instead of strings are valid. Within RTL code, strings are most
-commonly found inside @code{symbol_ref} expressions, but they appear in
-other contexts in the RTL expressions that make up machine descriptions.
-
-A vector contains an arbitrary number of pointers to expressions. The
-number of elements in the vector is explicitly present in the vector.
-The written form of a vector consists of square brackets
-(@samp{[@dots{}]}) surrounding the elements, in sequence and with
-whitespace separating them. Vectors of length zero are not created;
-null pointers are used instead.
-
-@cindex expression codes
-@cindex codes, RTL expression
-@findex GET_CODE
-@findex PUT_CODE
-Expressions are classified by @dfn{expression codes} (also called RTX
-codes). The expression code is a name defined in @file{rtl.def}, which is
-also (in upper case) a C enumeration constant. The possible expression
-codes and their meanings are machine-independent. The code of an RTX can
-be extracted with the macro @code{GET_CODE (@var{x})} and altered with
-@code{PUT_CODE (@var{x}, @var{newcode})}.
-
-The expression code determines how many operands the expression contains,
-and what kinds of objects they are. In RTL, unlike Lisp, you cannot tell
-by looking at an operand what kind of object it is. Instead, you must know
-from its context---from the expression code of the containing expression.
-For example, in an expression of code @code{subreg}, the first operand is
-to be regarded as an expression and the second operand as an integer. In
-an expression of code @code{plus}, there are two operands, both of which
-are to be regarded as expressions. In a @code{symbol_ref} expression,
-there is one operand, which is to be regarded as a string.
-
-Expressions are written as parentheses containing the name of the
-expression type, its flags and machine mode if any, and then the operands
-of the expression (separated by spaces).
-
-Expression code names in the @samp{md} file are written in lower case,
-but when they appear in C code they are written in upper case. In this
-manual, they are shown as follows: @code{const_int}.
-
-@cindex (nil)
-@cindex nil
-In a few contexts a null pointer is valid where an expression is normally
-wanted. The written form of this is @code{(nil)}.
-
-@node RTL Classes, Accessors, RTL Objects, RTL
-@section RTL Classes and Formats
-@cindex RTL classes
-@cindex classes of RTX codes
-@cindex RTX codes, classes of
-@findex GET_RTX_CLASS
-
-The various expression codes are divided into several @dfn{classes},
-which are represented by single characters. You can determine the class
-of an RTX code with the macro @code{GET_RTX_CLASS (@var{code})}.
-Currently, @file{rtx.def} defines these classes:
-
-@table @code
-@item o
-An RTX code that represents an actual object, such as a register
-(@code{REG}) or a memory location (@code{MEM}, @code{SYMBOL_REF}).
-Constants and basic transforms on objects (@code{ADDRESSOF},
-@code{HIGH}, @code{LO_SUM}) are also included. Note that @code{SUBREG}
-and @code{STRICT_LOW_PART} are not in this class, but in class @code{x}.
-
-@item <
-An RTX code for a comparison, such as @code{NE} or @code{LT}.
-
-@item 1
-An RTX code for a unary arithmetic operation, such as @code{NEG},
-@code{NOT}, or @code{ABS}. This category also includes value extension
-(sign or zero) and conversions between integer and floating point.
-
-@item c
-An RTX code for a commutative binary operation, such as @code{PLUS} or
-@code{AND}. @code{NE} and @code{EQ} are comparisons, so they have class
-@code{<}.
-
-@item 2
-An RTX code for a non-commutative binary operation, such as @code{MINUS},
-@code{DIV}, or @code{ASHIFTRT}.
-
-@item b
-An RTX code for a bitfield operation. Currently only
-@code{ZERO_EXTRACT} and @code{SIGN_EXTRACT}. These have three inputs
-and are lvalues (so they can be used for insertion as well). @xref{Bit
-Fields}.
-
-@item 3
-An RTX code for other three input operations. Currently only
-@code{IF_THEN_ELSE}.
-
-@item i
-An RTX code for an entire instruction: @code{INSN}, @code{JUMP_INSN}, and
-@code{CALL_INSN}. @xref{Insns}.
-
-@item m
-An RTX code for something that matches in insns, such as
-@code{MATCH_DUP}. These only occur in machine descriptions.
-
-@item x
-All other RTX codes. This category includes the remaining codes used
-only in machine descriptions (@code{DEFINE_*}, etc.). It also includes
-all the codes describing side effects (@code{SET}, @code{USE},
-@code{CLOBBER}, etc.) and the non-insns that may appear on an insn
-chain, such as @code{NOTE}, @code{BARRIER}, and @code{CODE_LABEL}.
-@end table
-
-@cindex RTL format
-For each expression type @file{rtl.def} specifies the number of
-contained objects and their kinds, with four possibilities: @samp{e} for
-expression (actually a pointer to an expression), @samp{i} for integer,
-@samp{w} for wide integer, @samp{s} for string, and @samp{E} for vector
-of expressions. The sequence of letters for an expression code is
-called its @dfn{format}. For example, the format of @code{subreg} is
-@samp{ei}.@refill
-
-@cindex RTL format characters
-A few other format characters are used occasionally:
-
-@table @code
-@item u
-@samp{u} is equivalent to @samp{e} except that it is printed differently
-in debugging dumps. It is used for pointers to insns.
-
-@item n
-@samp{n} is equivalent to @samp{i} except that it is printed differently
-in debugging dumps. It is used for the line number or code number of a
-@code{note} insn.
-
-@item S
-@samp{S} indicates a string which is optional. In the RTL objects in
-core, @samp{S} is equivalent to @samp{s}, but when the object is read,
-from an @samp{md} file, the string value of this operand may be omitted.
-An omitted string is taken to be the null string.
-
-@item V
-@samp{V} indicates a vector which is optional. In the RTL objects in
-core, @samp{V} is equivalent to @samp{E}, but when the object is read
-from an @samp{md} file, the vector value of this operand may be omitted.
-An omitted vector is effectively the same as a vector of no elements.
-
-@item 0
-@samp{0} means a slot whose contents do not fit any normal category.
-@samp{0} slots are not printed at all in dumps, and are often used in
-special ways by small parts of the compiler.
-@end table
-
-There are macros to get the number of operands and the format
-of an expression code:
-
-@table @code
-@findex GET_RTX_LENGTH
-@item GET_RTX_LENGTH (@var{code})
-Number of operands of an RTX of code @var{code}.
-
-@findex GET_RTX_FORMAT
-@item GET_RTX_FORMAT (@var{code})
-The format of an RTX of code @var{code}, as a C string.
-@end table
-
-Some classes of RTX codes always have the same format. For example, it
-is safe to assume that all comparison operations have format @code{ee}.
-
-@table @code
-@item 1
-All codes of this class have format @code{e}.
-
-@item <
-@itemx c
-@itemx 2
-All codes of these classes have format @code{ee}.
-
-@item b
-@itemx 3
-All codes of these classes have format @code{eee}.
-
-@item i
-All codes of this class have formats that begin with @code{iuueiee}.
-@xref{Insns}. Note that not all RTL objects linked onto an insn chain
-are of class @code{i}.
-
-@item o
-@itemx m
-@itemx x
-You can make no assumptions about the format of these codes.
-@end table
-
-@node Accessors, Flags, RTL Classes, RTL
-@section Access to Operands
-@cindex accessors
-@cindex access to operands
-@cindex operand access
-
-@findex XEXP
-@findex XINT
-@findex XWINT
-@findex XSTR
-Operands of expressions are accessed using the macros @code{XEXP},
-@code{XINT}, @code{XWINT} and @code{XSTR}. Each of these macros takes
-two arguments: an expression-pointer (RTX) and an operand number
-(counting from zero). Thus,@refill
-
-@example
-XEXP (@var{x}, 2)
-@end example
-
-@noindent
-accesses operand 2 of expression @var{x}, as an expression.
-
-@example
-XINT (@var{x}, 2)
-@end example
-
-@noindent
-accesses the same operand as an integer. @code{XSTR}, used in the same
-fashion, would access it as a string.
-
-Any operand can be accessed as an integer, as an expression or as a string.
-You must choose the correct method of access for the kind of value actually
-stored in the operand. You would do this based on the expression code of
-the containing expression. That is also how you would know how many
-operands there are.
-
-For example, if @var{x} is a @code{subreg} expression, you know that it has
-two operands which can be correctly accessed as @code{XEXP (@var{x}, 0)}
-and @code{XINT (@var{x}, 1)}. If you did @code{XINT (@var{x}, 0)}, you
-would get the address of the expression operand but cast as an integer;
-that might occasionally be useful, but it would be cleaner to write
-@code{(int) XEXP (@var{x}, 0)}. @code{XEXP (@var{x}, 1)} would also
-compile without error, and would return the second, integer operand cast as
-an expression pointer, which would probably result in a crash when
-accessed. Nothing stops you from writing @code{XEXP (@var{x}, 28)} either,
-but this will access memory past the end of the expression with
-unpredictable results.@refill
-
-Access to operands which are vectors is more complicated. You can use the
-macro @code{XVEC} to get the vector-pointer itself, or the macros
-@code{XVECEXP} and @code{XVECLEN} to access the elements and length of a
-vector.
-
-@table @code
-@findex XVEC
-@item XVEC (@var{exp}, @var{idx})
-Access the vector-pointer which is operand number @var{idx} in @var{exp}.
-
-@findex XVECLEN
-@item XVECLEN (@var{exp}, @var{idx})
-Access the length (number of elements) in the vector which is
-in operand number @var{idx} in @var{exp}. This value is an @code{int}.
-
-@findex XVECEXP
-@item XVECEXP (@var{exp}, @var{idx}, @var{eltnum})
-Access element number @var{eltnum} in the vector which is
-in operand number @var{idx} in @var{exp}. This value is an RTX.
-
-It is up to you to make sure that @var{eltnum} is not negative
-and is less than @code{XVECLEN (@var{exp}, @var{idx})}.
-@end table
-
-All the macros defined in this section expand into lvalues and therefore
-can be used to assign the operands, lengths and vector elements as well as
-to access them.
-
-@node Flags, Machine Modes, Accessors, RTL
-@section Flags in an RTL Expression
-@cindex flags in RTL expression
-
-RTL expressions contain several flags (one-bit bitfields) and other
-values that are used in certain types of expression. Most often they
-are accessed with the following macros:
-
-@table @code
-@findex MEM_VOLATILE_P
-@cindex @code{mem} and @samp{/v}
-@cindex @code{volatil}, in @code{mem}
-@cindex @samp{/v} in RTL dump
-@item MEM_VOLATILE_P (@var{x})
-In @code{mem} expressions, nonzero for volatile memory references.
-Stored in the @code{volatil} field and printed as @samp{/v}.
-
-@findex MEM_IN_STRUCT_P
-@cindex @code{mem} and @samp{/s}
-@cindex @code{in_struct}, in @code{mem}
-@cindex @samp{/s} in RTL dump
-@item MEM_IN_STRUCT_P (@var{x})
-In @code{mem} expressions, nonzero for reference to an entire structure,
-union or array, or to a component of one. Zero for references to a
-scalar variable or through a pointer to a scalar. Stored in the
-@code{in_struct} field and printed as @samp{/s}. If both this flag and
-MEM_SCALAR_P are clear, then we don't know whether this MEM is in a
-structure or not. Both flags should never be simultaneously set.
-
-@findex MEM_SCALAR_P
-@cindex @code{mem} and @samp{/f}
-@cindex @code{frame_related}, in@code{mem}
-@cindex @samp{/f} in RTL dump
-@item MEM_SCALAR_P (@var{x})
-In @code{mem} expressions, nonzero for reference to a scalar known not
-to be a member of a structure, union, or array. Zero for such
-references and for indirections through pointers, even pointers pointing
-to scalar types. If both this flag and MEM_STRUCT_P are clear, then we
-don't know whether this MEM is in a structure or not. Both flags should
-never be simultaneously set.
-
-@findex MEM_ALIAS_SET
-@item MEM_ALIAS_SET (@var{x})
-In @code{mem} expressions, the alias set to which @var{x} belongs. If
-zero, @var{x} is not in any alias set, and may alias anything. If
-nonzero, @var{x} may only alias objects in the same alias set. This
-value is set (in a language-specific manner) by the front-end. This
-field is not a bit-field; it is in an integer, found as the second
-argument to the @code{mem}.
-
-@findex REG_LOOP_TEST_P
-@cindex @code{reg} and @samp{/s}
-@cindex @code{in_struct}, in @code{reg}
-@item REG_LOOP_TEST_P
-In @code{reg} expressions, nonzero if this register's entire life is
-contained in the exit test code for some loop. Stored in the
-@code{in_struct} field and printed as @samp{/s}.
-
-@findex REG_USERVAR_P
-@cindex @code{reg} and @samp{/v}
-@cindex @code{volatil}, in @code{reg}
-@item REG_USERVAR_P (@var{x})
-In a @code{reg}, nonzero if it corresponds to a variable present in
-the user's source code. Zero for temporaries generated internally by
-the compiler. Stored in the @code{volatil} field and printed as
-@samp{/v}.
-
-@cindex @samp{/i} in RTL dump
-@findex REG_FUNCTION_VALUE_P
-@cindex @code{reg} and @samp{/i}
-@cindex @code{integrated}, in @code{reg}
-@item REG_FUNCTION_VALUE_P (@var{x})
-Nonzero in a @code{reg} if it is the place in which this function's
-value is going to be returned. (This happens only in a hard
-register.) Stored in the @code{integrated} field and printed as
-@samp{/i}.
-
-The same hard register may be used also for collecting the values of
-functions called by this one, but @code{REG_FUNCTION_VALUE_P} is zero
-in this kind of use.
-
-@findex SUBREG_PROMOTED_VAR_P
-@cindex @code{subreg} and @samp{/s}
-@cindex @code{in_struct}, in @code{subreg}
-@item SUBREG_PROMOTED_VAR_P
-Nonzero in a @code{subreg} if it was made when accessing an object that
-was promoted to a wider mode in accord with the @code{PROMOTED_MODE} machine
-description macro (@pxref{Storage Layout}). In this case, the mode of
-the @code{subreg} is the declared mode of the object and the mode of
-@code{SUBREG_REG} is the mode of the register that holds the object.
-Promoted variables are always either sign- or zero-extended to the wider
-mode on every assignment. Stored in the @code{in_struct} field and
-printed as @samp{/s}.
-
-@findex SUBREG_PROMOTED_UNSIGNED_P
-@cindex @code{subreg} and @samp{/u}
-@cindex @code{unchanging}, in @code{subreg}
-@item SUBREG_PROMOTED_UNSIGNED_P
-Nonzero in a @code{subreg} that has @code{SUBREG_PROMOTED_VAR_P} nonzero
-if the object being referenced is kept zero-extended and zero if it
-is kept sign-extended. Stored in the @code{unchanging} field and
-printed as @samp{/u}.
-
-@findex RTX_UNCHANGING_P
-@cindex @code{reg} and @samp{/u}
-@cindex @code{mem} and @samp{/u}
-@cindex @code{unchanging}, in @code{reg} and @code{mem}
-@cindex @samp{/u} in RTL dump
-@item RTX_UNCHANGING_P (@var{x})
-Nonzero in a @code{reg} or @code{mem} if the value is not changed.
-(This flag is not set for memory references via pointers to constants.
-Such pointers only guarantee that the object will not be changed
-explicitly by the current function. The object might be changed by
-other functions or by aliasing.) Stored in the
-@code{unchanging} field and printed as @samp{/u}.
-
-@findex RTX_INTEGRATED_P
-@cindex @code{integrated}, in @code{insn}
-@item RTX_INTEGRATED_P (@var{insn})
-Nonzero in an insn if it resulted from an in-line function call.
-Stored in the @code{integrated} field and printed as @samp{/i}.
-
-@findex RTX_FRAME_RELATED_P
-@item RTX_FRAME_RELATED_P (@var{x})
-Nonzero in an insn or expression which is part of a function
-prologue and sets the stack pointer, sets the frame pointer, or saves a
-register. This flag is required for exception handling support
-on targets with RTL prologues.
-
-@findex SYMBOL_REF_USED
-@cindex @code{used}, in @code{symbol_ref}
-@item SYMBOL_REF_USED (@var{x})
-In a @code{symbol_ref}, indicates that @var{x} has been used. This is
-normally only used to ensure that @var{x} is only declared external
-once. Stored in the @code{used} field.
-
-@findex SYMBOL_REF_FLAG
-@cindex @code{symbol_ref} and @samp{/v}
-@cindex @code{volatil}, in @code{symbol_ref}
-@item SYMBOL_REF_FLAG (@var{x})
-In a @code{symbol_ref}, this is used as a flag for machine-specific purposes.
-Stored in the @code{volatil} field and printed as @samp{/v}.
-
-@findex LABEL_OUTSIDE_LOOP_P
-@cindex @code{label_ref} and @samp{/s}
-@cindex @code{in_struct}, in @code{label_ref}
-@item LABEL_OUTSIDE_LOOP_P
-In @code{label_ref} expressions, nonzero if this is a reference to a
-label that is outside the innermost loop containing the reference to the
-label. Stored in the @code{in_struct} field and printed as @samp{/s}.
-
-@findex INSN_DELETED_P
-@cindex @code{volatil}, in @code{insn}
-@item INSN_DELETED_P (@var{insn})
-In an insn, nonzero if the insn has been deleted. Stored in the
-@code{volatil} field and printed as @samp{/v}.
-
-@findex INSN_ANNULLED_BRANCH_P
-@cindex @code{insn} and @samp{/u}
-@cindex @code{unchanging}, in @code{insn}
-@item INSN_ANNULLED_BRANCH_P (@var{insn})
-In an @code{insn} in the delay slot of a branch insn, indicates that an
-annulling branch should be used. See the discussion under
-@code{sequence} below. Stored in the @code{unchanging} field and printed
-as @samp{/u}.
-
-@findex INSN_FROM_TARGET_P
-@cindex @code{insn} and @samp{/s}
-@cindex @code{in_struct}, in @code{insn}
-@cindex @samp{/s} in RTL dump
-@item INSN_FROM_TARGET_P (@var{insn})
-In an @code{insn} in a delay slot of a branch, indicates that the insn
-is from the target of the branch. If the branch insn has
-@code{INSN_ANNULLED_BRANCH_P} set, this insn will only be executed if
-the branch is taken. For annulled branches with
-@code{INSN_FROM_TARGET_P} clear, the insn will be executed only if the
-branch is not taken. When @code{INSN_ANNULLED_BRANCH_P} is not set,
-this insn will always be executed. Stored in the @code{in_struct}
-field and printed as @samp{/s}.
-
-@findex CONSTANT_POOL_ADDRESS_P
-@cindex @code{symbol_ref} and @samp{/u}
-@cindex @code{unchanging}, in @code{symbol_ref}
-@item CONSTANT_POOL_ADDRESS_P (@var{x})
-Nonzero in a @code{symbol_ref} if it refers to part of the current
-function's ``constants pool''. These are addresses close to the
-beginning of the function, and GNU CC assumes they can be addressed
-directly (perhaps with the help of base registers). Stored in the
-@code{unchanging} field and printed as @samp{/u}.
-
-@findex CONST_CALL_P
-@cindex @code{call_insn} and @samp{/u}
-@cindex @code{unchanging}, in @code{call_insn}
-@item CONST_CALL_P (@var{x})
-In a @code{call_insn}, indicates that the insn represents a call to a const
-function. Stored in the @code{unchanging} field and printed as @samp{/u}.
-
-@findex LABEL_PRESERVE_P
-@cindex @code{code_label} and @samp{/i}
-@cindex @code{in_struct}, in @code{code_label}
-@item LABEL_PRESERVE_P (@var{x})
-In a @code{code_label}, indicates that the label can never be deleted.
-Labels referenced by a non-local goto will have this bit set. Stored
-in the @code{in_struct} field and printed as @samp{/s}.
-
-@findex SCHED_GROUP_P
-@cindex @code{insn} and @samp{/i}
-@cindex @code{in_struct}, in @code{insn}
-@item SCHED_GROUP_P (@var{insn})
-During instruction scheduling, in an insn, indicates that the previous insn
-must be scheduled together with this insn. This is used to ensure that
-certain groups of instructions will not be split up by the instruction
-scheduling pass, for example, @code{use} insns before a @code{call_insn} may
-not be separated from the @code{call_insn}. Stored in the @code{in_struct}
-field and printed as @samp{/s}.
-@end table
-
-These are the fields which the above macros refer to:
-
-@table @code
-@findex used
-@item used
-Normally, this flag is used only momentarily, at the end of RTL
-generation for a function, to count the number of times an expression
-appears in insns. Expressions that appear more than once are copied,
-according to the rules for shared structure (@pxref{Sharing}).
-
-In a @code{symbol_ref}, it indicates that an external declaration for
-the symbol has already been written.
-
-In a @code{reg}, it is used by the leaf register renumbering code to ensure
-that each register is only renumbered once.
-
-@findex volatil
-@item volatil
-This flag is used in @code{mem}, @code{symbol_ref} and @code{reg}
-expressions and in insns. In RTL dump files, it is printed as
-@samp{/v}.
-
-@cindex volatile memory references
-In a @code{mem} expression, it is 1 if the memory reference is volatile.
-Volatile memory references may not be deleted, reordered or combined.
-
-In a @code{symbol_ref} expression, it is used for machine-specific
-purposes.
-
-In a @code{reg} expression, it is 1 if the value is a user-level variable.
-0 indicates an internal compiler temporary.
-
-In an insn, 1 means the insn has been deleted.
-
-@findex in_struct
-@item in_struct
-In @code{mem} expressions, it is 1 if the memory datum referred to is
-all or part of a structure or array; 0 if it is (or might be) a scalar
-variable. A reference through a C pointer has 0 because the pointer
-might point to a scalar variable. This information allows the compiler
-to determine something about possible cases of aliasing.
-
-In an insn in the delay slot of a branch, 1 means that this insn is from
-the target of the branch.
-
-During instruction scheduling, in an insn, 1 means that this insn must be
-scheduled as part of a group together with the previous insn.
-
-In @code{reg} expressions, it is 1 if the register has its entire life
-contained within the test expression of some loop.
-
-In @code{subreg} expressions, 1 means that the @code{subreg} is accessing
-an object that has had its mode promoted from a wider mode.
-
-In @code{label_ref} expressions, 1 means that the referenced label is
-outside the innermost loop containing the insn in which the @code{label_ref}
-was found.
-
-In @code{code_label} expressions, it is 1 if the label may never be deleted.
-This is used for labels which are the target of non-local gotos.
-
-In an RTL dump, this flag is represented as @samp{/s}.
-
-@findex unchanging
-@item unchanging
-In @code{reg} and @code{mem} expressions, 1 means
-that the value of the expression never changes.
-
-In @code{subreg} expressions, it is 1 if the @code{subreg} references an
-unsigned object whose mode has been promoted to a wider mode.
-
-In an insn, 1 means that this is an annulling branch.
-
-In a @code{symbol_ref} expression, 1 means that this symbol addresses
-something in the per-function constants pool.
-
-In a @code{call_insn}, 1 means that this instruction is a call to a
-const function.
-
-In an RTL dump, this flag is represented as @samp{/u}.
-
-@findex integrated
-@item integrated
-In some kinds of expressions, including insns, this flag means the
-rtl was produced by procedure integration.
-
-In a @code{reg} expression, this flag indicates the register
-containing the value to be returned by the current function. On
-machines that pass parameters in registers, the same register number
-may be used for parameters as well, but this flag is not set on such
-uses.
-@end table
-
-@node Machine Modes, Constants, Flags, RTL
-@section Machine Modes
-@cindex machine modes
-
-@findex enum machine_mode
-A machine mode describes a size of data object and the representation used
-for it. In the C code, machine modes are represented by an enumeration
-type, @code{enum machine_mode}, defined in @file{machmode.def}. Each RTL
-expression has room for a machine mode and so do certain kinds of tree
-expressions (declarations and types, to be precise).
-
-In debugging dumps and machine descriptions, the machine mode of an RTL
-expression is written after the expression code with a colon to separate
-them. The letters @samp{mode} which appear at the end of each machine mode
-name are omitted. For example, @code{(reg:SI 38)} is a @code{reg}
-expression with machine mode @code{SImode}. If the mode is
-@code{VOIDmode}, it is not written at all.
-
-Here is a table of machine modes. The term ``byte'' below refers to an
-object of @code{BITS_PER_UNIT} bits (@pxref{Storage Layout}).
-
-@table @code
-@findex QImode
-@item QImode
-``Quarter-Integer'' mode represents a single byte treated as an integer.
-
-@findex HImode
-@item HImode
-``Half-Integer'' mode represents a two-byte integer.
-
-@findex PSImode
-@item PSImode
-``Partial Single Integer'' mode represents an integer which occupies
-four bytes but which doesn't really use all four. On some machines,
-this is the right mode to use for pointers.
-
-@findex SImode
-@item SImode
-``Single Integer'' mode represents a four-byte integer.
-
-@findex PDImode
-@item PDImode
-``Partial Double Integer'' mode represents an integer which occupies
-eight bytes but which doesn't really use all eight. On some machines,
-this is the right mode to use for certain pointers.
-
-@findex DImode
-@item DImode
-``Double Integer'' mode represents an eight-byte integer.
-
-@findex TImode
-@item TImode
-``Tetra Integer'' (?) mode represents a sixteen-byte integer.
-
-@findex SFmode
-@item SFmode
-``Single Floating'' mode represents a single-precision (four byte) floating
-point number.
-
-@findex DFmode
-@item DFmode
-``Double Floating'' mode represents a double-precision (eight byte) floating
-point number.
-
-@findex XFmode
-@item XFmode
-``Extended Floating'' mode represents a triple-precision (twelve byte)
-floating point number. This mode is used for IEEE extended floating
-point. On some systems not all bits within these bytes will actually
-be used.
-
-@findex TFmode
-@item TFmode
-``Tetra Floating'' mode represents a quadruple-precision (sixteen byte)
-floating point number.
-
-@findex CCmode
-@item CCmode
-``Condition Code'' mode represents the value of a condition code, which
-is a machine-specific set of bits used to represent the result of a
-comparison operation. Other machine-specific modes may also be used for
-the condition code. These modes are not used on machines that use
-@code{cc0} (see @pxref{Condition Code}).
-
-@findex BLKmode
-@item BLKmode
-``Block'' mode represents values that are aggregates to which none of
-the other modes apply. In RTL, only memory references can have this mode,
-and only if they appear in string-move or vector instructions. On machines
-which have no such instructions, @code{BLKmode} will not appear in RTL.
-
-@findex VOIDmode
-@item VOIDmode
-Void mode means the absence of a mode or an unspecified mode.
-For example, RTL expressions of code @code{const_int} have mode
-@code{VOIDmode} because they can be taken to have whatever mode the context
-requires. In debugging dumps of RTL, @code{VOIDmode} is expressed by
-the absence of any mode.
-
-@findex SCmode
-@findex DCmode
-@findex XCmode
-@findex TCmode
-@item SCmode, DCmode, XCmode, TCmode
-These modes stand for a complex number represented as a pair of floating
-point values. The floating point values are in @code{SFmode},
-@code{DFmode}, @code{XFmode}, and @code{TFmode}, respectively.
-
-@findex CQImode
-@findex CHImode
-@findex CSImode
-@findex CDImode
-@findex CTImode
-@findex COImode
-@item CQImode, CHImode, CSImode, CDImode, CTImode, COImode
-These modes stand for a complex number represented as a pair of integer
-values. The integer values are in @code{QImode}, @code{HImode},
-@code{SImode}, @code{DImode}, @code{TImode}, and @code{OImode},
-respectively.
-@end table
-
-The machine description defines @code{Pmode} as a C macro which expands
-into the machine mode used for addresses. Normally this is the mode
-whose size is @code{BITS_PER_WORD}, @code{SImode} on 32-bit machines.
-
-The only modes which a machine description @i{must} support are
-@code{QImode}, and the modes corresponding to @code{BITS_PER_WORD},
-@code{FLOAT_TYPE_SIZE} and @code{DOUBLE_TYPE_SIZE}.
-The compiler will attempt to use @code{DImode} for 8-byte structures and
-unions, but this can be prevented by overriding the definition of
-@code{MAX_FIXED_MODE_SIZE}. Alternatively, you can have the compiler
-use @code{TImode} for 16-byte structures and unions. Likewise, you can
-arrange for the C type @code{short int} to avoid using @code{HImode}.
-
-@cindex mode classes
-Very few explicit references to machine modes remain in the compiler and
-these few references will soon be removed. Instead, the machine modes
-are divided into mode classes. These are represented by the enumeration
-type @code{enum mode_class} defined in @file{machmode.h}. The possible
-mode classes are:
-
-@table @code
-@findex MODE_INT
-@item MODE_INT
-Integer modes. By default these are @code{QImode}, @code{HImode},
-@code{SImode}, @code{DImode}, and @code{TImode}.
-
-@findex MODE_PARTIAL_INT
-@item MODE_PARTIAL_INT
-The ``partial integer'' modes, @code{PSImode} and @code{PDImode}.
-
-@findex MODE_FLOAT
-@item MODE_FLOAT
-floating point modes. By default these are @code{SFmode}, @code{DFmode},
-@code{XFmode} and @code{TFmode}.
-
-@findex MODE_COMPLEX_INT
-@item MODE_COMPLEX_INT
-Complex integer modes. (These are not currently implemented).
-
-@findex MODE_COMPLEX_FLOAT
-@item MODE_COMPLEX_FLOAT
-Complex floating point modes. By default these are @code{SCmode},
-@code{DCmode}, @code{XCmode}, and @code{TCmode}.
-
-@findex MODE_FUNCTION
-@item MODE_FUNCTION
-Algol or Pascal function variables including a static chain.
-(These are not currently implemented).
-
-@findex MODE_CC
-@item MODE_CC
-Modes representing condition code values. These are @code{CCmode} plus
-any modes listed in the @code{EXTRA_CC_MODES} macro. @xref{Jump Patterns},
-also see @ref{Condition Code}.
-
-@findex MODE_RANDOM
-@item MODE_RANDOM
-This is a catchall mode class for modes which don't fit into the above
-classes. Currently @code{VOIDmode} and @code{BLKmode} are in
-@code{MODE_RANDOM}.
-@end table
-
-Here are some C macros that relate to machine modes:
-
-@table @code
-@findex GET_MODE
-@item GET_MODE (@var{x})
-Returns the machine mode of the RTX @var{x}.
-
-@findex PUT_MODE
-@item PUT_MODE (@var{x}, @var{newmode})
-Alters the machine mode of the RTX @var{x} to be @var{newmode}.
-
-@findex NUM_MACHINE_MODES
-@item NUM_MACHINE_MODES
-Stands for the number of machine modes available on the target
-machine. This is one greater than the largest numeric value of any
-machine mode.
-
-@findex GET_MODE_NAME
-@item GET_MODE_NAME (@var{m})
-Returns the name of mode @var{m} as a string.
-
-@findex GET_MODE_CLASS
-@item GET_MODE_CLASS (@var{m})
-Returns the mode class of mode @var{m}.
-
-@findex GET_MODE_WIDER_MODE
-@item GET_MODE_WIDER_MODE (@var{m})
-Returns the next wider natural mode. For example, the expression
-@code{GET_MODE_WIDER_MODE (QImode)} returns @code{HImode}.
-
-@findex GET_MODE_SIZE
-@item GET_MODE_SIZE (@var{m})
-Returns the size in bytes of a datum of mode @var{m}.
-
-@findex GET_MODE_BITSIZE
-@item GET_MODE_BITSIZE (@var{m})
-Returns the size in bits of a datum of mode @var{m}.
-
-@findex GET_MODE_MASK
-@item GET_MODE_MASK (@var{m})
-Returns a bitmask containing 1 for all bits in a word that fit within
-mode @var{m}. This macro can only be used for modes whose bitsize is
-less than or equal to @code{HOST_BITS_PER_INT}.
-
-@findex GET_MODE_ALIGNMENT
-@item GET_MODE_ALIGNMENT (@var{m)})
-Return the required alignment, in bits, for an object of mode @var{m}.
-
-@findex GET_MODE_UNIT_SIZE
-@item GET_MODE_UNIT_SIZE (@var{m})
-Returns the size in bytes of the subunits of a datum of mode @var{m}.
-This is the same as @code{GET_MODE_SIZE} except in the case of complex
-modes. For them, the unit size is the size of the real or imaginary
-part.
-
-@findex GET_MODE_NUNITS
-@item GET_MODE_NUNITS (@var{m})
-Returns the number of units contained in a mode, i.e.,
-@code{GET_MODE_SIZE} divided by @code{GET_MODE_UNIT_SIZE}.
-
-@findex GET_CLASS_NARROWEST_MODE
-@item GET_CLASS_NARROWEST_MODE (@var{c})
-Returns the narrowest mode in mode class @var{c}.
-@end table
-
-@findex byte_mode
-@findex word_mode
-The global variables @code{byte_mode} and @code{word_mode} contain modes
-whose classes are @code{MODE_INT} and whose bitsizes are either
-@code{BITS_PER_UNIT} or @code{BITS_PER_WORD}, respectively. On 32-bit
-machines, these are @code{QImode} and @code{SImode}, respectively.
-
-@node Constants, Regs and Memory, Machine Modes, RTL
-@section Constant Expression Types
-@cindex RTL constants
-@cindex RTL constant expression types
-
-The simplest RTL expressions are those that represent constant values.
-
-@table @code
-@findex const_int
-@item (const_int @var{i})
-This type of expression represents the integer value @var{i}. @var{i}
-is customarily accessed with the macro @code{INTVAL} as in
-@code{INTVAL (@var{exp})}, which is equivalent to @code{XWINT (@var{exp}, 0)}.
-
-@findex const0_rtx
-@findex const1_rtx
-@findex const2_rtx
-@findex constm1_rtx
-There is only one expression object for the integer value zero; it is
-the value of the variable @code{const0_rtx}. Likewise, the only
-expression for integer value one is found in @code{const1_rtx}, the only
-expression for integer value two is found in @code{const2_rtx}, and the
-only expression for integer value negative one is found in
-@code{constm1_rtx}. Any attempt to create an expression of code
-@code{const_int} and value zero, one, two or negative one will return
-@code{const0_rtx}, @code{const1_rtx}, @code{const2_rtx} or
-@code{constm1_rtx} as appropriate.@refill
-
-@findex const_true_rtx
-Similarly, there is only one object for the integer whose value is
-@code{STORE_FLAG_VALUE}. It is found in @code{const_true_rtx}. If
-@code{STORE_FLAG_VALUE} is one, @code{const_true_rtx} and
-@code{const1_rtx} will point to the same object. If
-@code{STORE_FLAG_VALUE} is -1, @code{const_true_rtx} and
-@code{constm1_rtx} will point to the same object.@refill
-
-@findex const_double
-@item (const_double:@var{m} @var{addr} @var{i0} @var{i1} @dots{})
-Represents either a floating-point constant of mode @var{m} or an
-integer constant too large to fit into @code{HOST_BITS_PER_WIDE_INT}
-bits but small enough to fit within twice that number of bits (GNU CC
-does not provide a mechanism to represent even larger constants). In
-the latter case, @var{m} will be @code{VOIDmode}.
-
-@findex CONST_DOUBLE_MEM
-@findex CONST_DOUBLE_CHAIN
-@var{addr} is used to contain the @code{mem} expression that corresponds
-to the location in memory that at which the constant can be found. If
-it has not been allocated a memory location, but is on the chain of all
-@code{const_double} expressions in this compilation (maintained using an
-undisplayed field), @var{addr} contains @code{const0_rtx}. If it is not
-on the chain, @var{addr} contains @code{cc0_rtx}. @var{addr} is
-customarily accessed with the macro @code{CONST_DOUBLE_MEM} and the
-chain field via @code{CONST_DOUBLE_CHAIN}.@refill
-
-@findex CONST_DOUBLE_LOW
-If @var{m} is @code{VOIDmode}, the bits of the value are stored in
-@var{i0} and @var{i1}. @var{i0} is customarily accessed with the macro
-@code{CONST_DOUBLE_LOW} and @var{i1} with @code{CONST_DOUBLE_HIGH}.
-
-If the constant is floating point (regardless of its precision), then
-the number of integers used to store the value depends on the size of
-@code{REAL_VALUE_TYPE} (@pxref{Cross-compilation}). The integers
-represent a floating point number, but not precisely in the target
-machine's or host machine's floating point format. To convert them to
-the precise bit pattern used by the target machine, use the macro
-@code{REAL_VALUE_TO_TARGET_DOUBLE} and friends (@pxref{Data Output}).
-
-@findex CONST0_RTX
-@findex CONST1_RTX
-@findex CONST2_RTX
-The macro @code{CONST0_RTX (@var{mode})} refers to an expression with
-value 0 in mode @var{mode}. If mode @var{mode} is of mode class
-@code{MODE_INT}, it returns @code{const0_rtx}. Otherwise, it returns a
-@code{CONST_DOUBLE} expression in mode @var{mode}. Similarly, the macro
-@code{CONST1_RTX (@var{mode})} refers to an expression with value 1 in
-mode @var{mode} and similarly for @code{CONST2_RTX}.
-
-@findex const_string
-@item (const_string @var{str})
-Represents a constant string with value @var{str}. Currently this is
-used only for insn attributes (@pxref{Insn Attributes}) since constant
-strings in C are placed in memory.
-
-@findex symbol_ref
-@item (symbol_ref:@var{mode} @var{symbol})
-Represents the value of an assembler label for data. @var{symbol} is
-a string that describes the name of the assembler label. If it starts
-with a @samp{*}, the label is the rest of @var{symbol} not including
-the @samp{*}. Otherwise, the label is @var{symbol}, usually prefixed
-with @samp{_}.
-
-The @code{symbol_ref} contains a mode, which is usually @code{Pmode}.
-Usually that is the only mode for which a symbol is directly valid.
-
-@findex label_ref
-@item (label_ref @var{label})
-Represents the value of an assembler label for code. It contains one
-operand, an expression, which must be a @code{code_label} that appears
-in the instruction sequence to identify the place where the label
-should go.
-
-The reason for using a distinct expression type for code label
-references is so that jump optimization can distinguish them.
-
-@item (const:@var{m} @var{exp})
-Represents a constant that is the result of an assembly-time
-arithmetic computation. The operand, @var{exp}, is an expression that
-contains only constants (@code{const_int}, @code{symbol_ref} and
-@code{label_ref} expressions) combined with @code{plus} and
-@code{minus}. However, not all combinations are valid, since the
-assembler cannot do arbitrary arithmetic on relocatable symbols.
-
-@var{m} should be @code{Pmode}.
-
-@findex high
-@item (high:@var{m} @var{exp})
-Represents the high-order bits of @var{exp}, usually a
-@code{symbol_ref}. The number of bits is machine-dependent and is
-normally the number of bits specified in an instruction that initializes
-the high order bits of a register. It is used with @code{lo_sum} to
-represent the typical two-instruction sequence used in RISC machines to
-reference a global memory location.
-
-@var{m} should be @code{Pmode}.
-@end table
-
-@node Regs and Memory, Arithmetic, Constants, RTL
-@section Registers and Memory
-@cindex RTL register expressions
-@cindex RTL memory expressions
-
-Here are the RTL expression types for describing access to machine
-registers and to main memory.
-
-@table @code
-@findex reg
-@cindex hard registers
-@cindex pseudo registers
-@item (reg:@var{m} @var{n})
-For small values of the integer @var{n} (those that are less than
-@code{FIRST_PSEUDO_REGISTER}), this stands for a reference to machine
-register number @var{n}: a @dfn{hard register}. For larger values of
-@var{n}, it stands for a temporary value or @dfn{pseudo register}.
-The compiler's strategy is to generate code assuming an unlimited
-number of such pseudo registers, and later convert them into hard
-registers or into memory references.
-
-@var{m} is the machine mode of the reference. It is necessary because
-machines can generally refer to each register in more than one mode.
-For example, a register may contain a full word but there may be
-instructions to refer to it as a half word or as a single byte, as
-well as instructions to refer to it as a floating point number of
-various precisions.
-
-Even for a register that the machine can access in only one mode,
-the mode must always be specified.
-
-The symbol @code{FIRST_PSEUDO_REGISTER} is defined by the machine
-description, since the number of hard registers on the machine is an
-invariant characteristic of the machine. Note, however, that not
-all of the machine registers must be general registers. All the
-machine registers that can be used for storage of data are given
-hard register numbers, even those that can be used only in certain
-instructions or can hold only certain types of data.
-
-A hard register may be accessed in various modes throughout one
-function, but each pseudo register is given a natural mode
-and is accessed only in that mode. When it is necessary to describe
-an access to a pseudo register using a nonnatural mode, a @code{subreg}
-expression is used.
-
-A @code{reg} expression with a machine mode that specifies more than
-one word of data may actually stand for several consecutive registers.
-If in addition the register number specifies a hardware register, then
-it actually represents several consecutive hardware registers starting
-with the specified one.
-
-Each pseudo register number used in a function's RTL code is
-represented by a unique @code{reg} expression.
-
-@findex FIRST_VIRTUAL_REGISTER
-@findex LAST_VIRTUAL_REGISTER
-Some pseudo register numbers, those within the range of
-@code{FIRST_VIRTUAL_REGISTER} to @code{LAST_VIRTUAL_REGISTER} only
-appear during the RTL generation phase and are eliminated before the
-optimization phases. These represent locations in the stack frame that
-cannot be determined until RTL generation for the function has been
-completed. The following virtual register numbers are defined:
-
-@table @code
-@findex VIRTUAL_INCOMING_ARGS_REGNUM
-@item VIRTUAL_INCOMING_ARGS_REGNUM
-This points to the first word of the incoming arguments passed on the
-stack. Normally these arguments are placed there by the caller, but the
-callee may have pushed some arguments that were previously passed in
-registers.
-
-@cindex @code{FIRST_PARM_OFFSET} and virtual registers
-@cindex @code{ARG_POINTER_REGNUM} and virtual registers
-When RTL generation is complete, this virtual register is replaced
-by the sum of the register given by @code{ARG_POINTER_REGNUM} and the
-value of @code{FIRST_PARM_OFFSET}.
-
-@findex VIRTUAL_STACK_VARS_REGNUM
-@cindex @code{FRAME_GROWS_DOWNWARD} and virtual registers
-@item VIRTUAL_STACK_VARS_REGNUM
-If @code{FRAME_GROWS_DOWNWARD} is defined, this points to immediately
-above the first variable on the stack. Otherwise, it points to the
-first variable on the stack.
-
-@cindex @code{STARTING_FRAME_OFFSET} and virtual registers
-@cindex @code{FRAME_POINTER_REGNUM} and virtual registers
-@code{VIRTUAL_STACK_VARS_REGNUM} is replaced with the sum of the
-register given by @code{FRAME_POINTER_REGNUM} and the value
-@code{STARTING_FRAME_OFFSET}.
-
-@findex VIRTUAL_STACK_DYNAMIC_REGNUM
-@item VIRTUAL_STACK_DYNAMIC_REGNUM
-This points to the location of dynamically allocated memory on the stack
-immediately after the stack pointer has been adjusted by the amount of
-memory desired.
-
-@cindex @code{STACK_DYNAMIC_OFFSET} and virtual registers
-@cindex @code{STACK_POINTER_REGNUM} and virtual registers
-This virtual register is replaced by the sum of the register given by
-@code{STACK_POINTER_REGNUM} and the value @code{STACK_DYNAMIC_OFFSET}.
-
-@findex VIRTUAL_OUTGOING_ARGS_REGNUM
-@item VIRTUAL_OUTGOING_ARGS_REGNUM
-This points to the location in the stack at which outgoing arguments
-should be written when the stack is pre-pushed (arguments pushed using
-push insns should always use @code{STACK_POINTER_REGNUM}).
-
-@cindex @code{STACK_POINTER_OFFSET} and virtual registers
-This virtual register is replaced by the sum of the register given by
-@code{STACK_POINTER_REGNUM} and the value @code{STACK_POINTER_OFFSET}.
-@end table
-
-@findex subreg
-@item (subreg:@var{m} @var{reg} @var{wordnum})
-@code{subreg} expressions are used to refer to a register in a machine
-mode other than its natural one, or to refer to one register of
-a multi-word @code{reg} that actually refers to several registers.
-
-Each pseudo-register has a natural mode. If it is necessary to
-operate on it in a different mode---for example, to perform a fullword
-move instruction on a pseudo-register that contains a single
-byte---the pseudo-register must be enclosed in a @code{subreg}. In
-such a case, @var{wordnum} is zero.
-
-Usually @var{m} is at least as narrow as the mode of @var{reg}, in which
-case it is restricting consideration to only the bits of @var{reg} that
-are in @var{m}.
-
-Sometimes @var{m} is wider than the mode of @var{reg}. These
-@code{subreg} expressions are often called @dfn{paradoxical}. They are
-used in cases where we want to refer to an object in a wider mode but do
-not care what value the additional bits have. The reload pass ensures
-that paradoxical references are only made to hard registers.
-
-The other use of @code{subreg} is to extract the individual registers of
-a multi-register value. Machine modes such as @code{DImode} and
-@code{TImode} can indicate values longer than a word, values which
-usually require two or more consecutive registers. To access one of the
-registers, use a @code{subreg} with mode @code{SImode} and a
-@var{wordnum} that says which register.
-
-Storing in a non-paradoxical @code{subreg} has undefined results for
-bits belonging to the same word as the @code{subreg}. This laxity makes
-it easier to generate efficient code for such instructions. To
-represent an instruction that preserves all the bits outside of those in
-the @code{subreg}, use @code{strict_low_part} around the @code{subreg}.
-
-@cindex @code{WORDS_BIG_ENDIAN}, effect on @code{subreg}
-The compilation parameter @code{WORDS_BIG_ENDIAN}, if set to 1, says
-that word number zero is the most significant part; otherwise, it is
-the least significant part.
-
-@cindex @code{FLOAT_WORDS_BIG_ENDIAN}, (lack of) effect on @code{subreg}
-On a few targets, @code{FLOAT_WORDS_BIG_ENDIAN} disagrees with
-@code{WORDS_BIG_ENDIAN}.
-However, most parts of the compiler treat floating point values as if
-they had the same endianness as integer values. This works because
-they handle them solely as a collection of integer values, with no
-particular numerical value. Only real.c and the runtime libraries
-care about @code{FLOAT_WORDS_BIG_ENDIAN}.
-
-@cindex combiner pass
-@cindex reload pass
-@cindex @code{subreg}, special reload handling
-Between the combiner pass and the reload pass, it is possible to have a
-paradoxical @code{subreg} which contains a @code{mem} instead of a
-@code{reg} as its first operand. After the reload pass, it is also
-possible to have a non-paradoxical @code{subreg} which contains a
-@code{mem}; this usually occurs when the @code{mem} is a stack slot
-which replaced a pseudo register.
-
-Note that it is not valid to access a @code{DFmode} value in @code{SFmode}
-using a @code{subreg}. On some machines the most significant part of a
-@code{DFmode} value does not have the same format as a single-precision
-floating value.
-
-It is also not valid to access a single word of a multi-word value in a
-hard register when less registers can hold the value than would be
-expected from its size. For example, some 32-bit machines have
-floating-point registers that can hold an entire @code{DFmode} value.
-If register 10 were such a register @code{(subreg:SI (reg:DF 10) 1)}
-would be invalid because there is no way to convert that reference to
-a single machine register. The reload pass prevents @code{subreg}
-expressions such as these from being formed.
-
-@findex SUBREG_REG
-@findex SUBREG_WORD
-The first operand of a @code{subreg} expression is customarily accessed
-with the @code{SUBREG_REG} macro and the second operand is customarily
-accessed with the @code{SUBREG_WORD} macro.
-
-@findex scratch
-@cindex scratch operands
-@item (scratch:@var{m})
-This represents a scratch register that will be required for the
-execution of a single instruction and not used subsequently. It is
-converted into a @code{reg} by either the local register allocator or
-the reload pass.
-
-@code{scratch} is usually present inside a @code{clobber} operation
-(@pxref{Side Effects}).
-
-@findex cc0
-@cindex condition code register
-@item (cc0)
-This refers to the machine's condition code register. It has no
-operands and may not have a machine mode. There are two ways to use it:
-
-@itemize @bullet
-@item
-To stand for a complete set of condition code flags. This is best on
-most machines, where each comparison sets the entire series of flags.
-
-With this technique, @code{(cc0)} may be validly used in only two
-contexts: as the destination of an assignment (in test and compare
-instructions) and in comparison operators comparing against zero
-(@code{const_int} with value zero; that is to say, @code{const0_rtx}).
-
-@item
-To stand for a single flag that is the result of a single condition.
-This is useful on machines that have only a single flag bit, and in
-which comparison instructions must specify the condition to test.
-
-With this technique, @code{(cc0)} may be validly used in only two
-contexts: as the destination of an assignment (in test and compare
-instructions) where the source is a comparison operator, and as the
-first operand of @code{if_then_else} (in a conditional branch).
-@end itemize
-
-@findex cc0_rtx
-There is only one expression object of code @code{cc0}; it is the
-value of the variable @code{cc0_rtx}. Any attempt to create an
-expression of code @code{cc0} will return @code{cc0_rtx}.
-
-Instructions can set the condition code implicitly. On many machines,
-nearly all instructions set the condition code based on the value that
-they compute or store. It is not necessary to record these actions
-explicitly in the RTL because the machine description includes a
-prescription for recognizing the instructions that do so (by means of
-the macro @code{NOTICE_UPDATE_CC}). @xref{Condition Code}. Only
-instructions whose sole purpose is to set the condition code, and
-instructions that use the condition code, need mention @code{(cc0)}.
-
-On some machines, the condition code register is given a register number
-and a @code{reg} is used instead of @code{(cc0)}. This is usually the
-preferable approach if only a small subset of instructions modify the
-condition code. Other machines store condition codes in general
-registers; in such cases a pseudo register should be used.
-
-Some machines, such as the Sparc and RS/6000, have two sets of
-arithmetic instructions, one that sets and one that does not set the
-condition code. This is best handled by normally generating the
-instruction that does not set the condition code, and making a pattern
-that both performs the arithmetic and sets the condition code register
-(which would not be @code{(cc0)} in this case). For examples, search
-for @samp{addcc} and @samp{andcc} in @file{sparc.md}.
-
-@findex pc
-@item (pc)
-@cindex program counter
-This represents the machine's program counter. It has no operands and
-may not have a machine mode. @code{(pc)} may be validly used only in
-certain specific contexts in jump instructions.
-
-@findex pc_rtx
-There is only one expression object of code @code{pc}; it is the value
-of the variable @code{pc_rtx}. Any attempt to create an expression of
-code @code{pc} will return @code{pc_rtx}.
-
-All instructions that do not jump alter the program counter implicitly
-by incrementing it, but there is no need to mention this in the RTL.
-
-@findex mem
-@item (mem:@var{m} @var{addr})
-This RTX represents a reference to main memory at an address
-represented by the expression @var{addr}. @var{m} specifies how large
-a unit of memory is accessed.
-
-@findex addressof
-@item (addressof:@var{m} @var{reg})
-This RTX represents a request for the address of register @var{reg}. Its mode
-is always @code{Pmode}. If there are any @code{addressof}
-expressions left in the function after CSE, @var{reg} is forced into the
-stack and the @code{addressof} expression is replaced with a @code{plus}
-expression for the address of its stack slot.
-@end table
-
-@node Arithmetic, Comparisons, Regs and Memory, RTL
-@section RTL Expressions for Arithmetic
-@cindex arithmetic, in RTL
-@cindex math, in RTL
-@cindex RTL expressions for arithmetic
-
-Unless otherwise specified, all the operands of arithmetic expressions
-must be valid for mode @var{m}. An operand is valid for mode @var{m}
-if it has mode @var{m}, or if it is a @code{const_int} or
-@code{const_double} and @var{m} is a mode of class @code{MODE_INT}.
-
-For commutative binary operations, constants should be placed in the
-second operand.
-
-@table @code
-@findex plus
-@cindex RTL addition
-@cindex RTL sum
-@item (plus:@var{m} @var{x} @var{y})
-Represents the sum of the values represented by @var{x} and @var{y}
-carried out in machine mode @var{m}.
-
-@findex lo_sum
-@item (lo_sum:@var{m} @var{x} @var{y})
-Like @code{plus}, except that it represents that sum of @var{x} and the
-low-order bits of @var{y}. The number of low order bits is
-machine-dependent but is normally the number of bits in a @code{Pmode}
-item minus the number of bits set by the @code{high} code
-(@pxref{Constants}).
-
-@var{m} should be @code{Pmode}.
-
-@findex minus
-@cindex RTL subtraction
-@cindex RTL difference
-@item (minus:@var{m} @var{x} @var{y})
-Like @code{plus} but represents subtraction.
-
-@findex compare
-@cindex RTL comparison
-@item (compare:@var{m} @var{x} @var{y})
-Represents the result of subtracting @var{y} from @var{x} for purposes
-of comparison. The result is computed without overflow, as if with
-infinite precision.
-
-Of course, machines can't really subtract with infinite precision.
-However, they can pretend to do so when only the sign of the
-result will be used, which is the case when the result is stored
-in the condition code. And that is the only way this kind of expression
-may validly be used: as a value to be stored in the condition codes.
-
-The mode @var{m} is not related to the modes of @var{x} and @var{y},
-but instead is the mode of the condition code value. If @code{(cc0)}
-is used, it is @code{VOIDmode}. Otherwise it is some mode in class
-@code{MODE_CC}, often @code{CCmode}. @xref{Condition Code}.
-
-Normally, @var{x} and @var{y} must have the same mode. Otherwise,
-@code{compare} is valid only if the mode of @var{x} is in class
-@code{MODE_INT} and @var{y} is a @code{const_int} or
-@code{const_double} with mode @code{VOIDmode}. The mode of @var{x}
-determines what mode the comparison is to be done in; thus it must not
-be @code{VOIDmode}.
-
-If one of the operands is a constant, it should be placed in the
-second operand and the comparison code adjusted as appropriate.
-
-A @code{compare} specifying two @code{VOIDmode} constants is not valid
-since there is no way to know in what mode the comparison is to be
-performed; the comparison must either be folded during the compilation
-or the first operand must be loaded into a register while its mode is
-still known.
-
-@findex neg
-@item (neg:@var{m} @var{x})
-Represents the negation (subtraction from zero) of the value represented
-by @var{x}, carried out in mode @var{m}.
-
-@findex mult
-@cindex multiplication
-@cindex product
-@item (mult:@var{m} @var{x} @var{y})
-Represents the signed product of the values represented by @var{x} and
-@var{y} carried out in machine mode @var{m}.
-
-Some machines support a multiplication that generates a product wider
-than the operands. Write the pattern for this as
-
-@example
-(mult:@var{m} (sign_extend:@var{m} @var{x}) (sign_extend:@var{m} @var{y}))
-@end example
-
-where @var{m} is wider than the modes of @var{x} and @var{y}, which need
-not be the same.
-
-Write patterns for unsigned widening multiplication similarly using
-@code{zero_extend}.
-
-@findex div
-@cindex division
-@cindex signed division
-@cindex quotient
-@item (div:@var{m} @var{x} @var{y})
-Represents the quotient in signed division of @var{x} by @var{y},
-carried out in machine mode @var{m}. If @var{m} is a floating point
-mode, it represents the exact quotient; otherwise, the integerized
-quotient.
-
-Some machines have division instructions in which the operands and
-quotient widths are not all the same; you should represent
-such instructions using @code{truncate} and @code{sign_extend} as in,
-
-@example
-(truncate:@var{m1} (div:@var{m2} @var{x} (sign_extend:@var{m2} @var{y})))
-@end example
-
-@findex udiv
-@cindex unsigned division
-@cindex division
-@item (udiv:@var{m} @var{x} @var{y})
-Like @code{div} but represents unsigned division.
-
-@findex mod
-@findex umod
-@cindex remainder
-@cindex division
-@item (mod:@var{m} @var{x} @var{y})
-@itemx (umod:@var{m} @var{x} @var{y})
-Like @code{div} and @code{udiv} but represent the remainder instead of
-the quotient.
-
-@findex smin
-@findex smax
-@cindex signed minimum
-@cindex signed maximum
-@item (smin:@var{m} @var{x} @var{y})
-@itemx (smax:@var{m} @var{x} @var{y})
-Represents the smaller (for @code{smin}) or larger (for @code{smax}) of
-@var{x} and @var{y}, interpreted as signed integers in mode @var{m}.
-
-@findex umin
-@findex umax
-@cindex unsigned minimum and maximum
-@item (umin:@var{m} @var{x} @var{y})
-@itemx (umax:@var{m} @var{x} @var{y})
-Like @code{smin} and @code{smax}, but the values are interpreted as unsigned
-integers.
-
-@findex not
-@cindex complement, bitwise
-@cindex bitwise complement
-@item (not:@var{m} @var{x})
-Represents the bitwise complement of the value represented by @var{x},
-carried out in mode @var{m}, which must be a fixed-point machine mode.
-
-@findex and
-@cindex logical-and, bitwise
-@cindex bitwise logical-and
-@item (and:@var{m} @var{x} @var{y})
-Represents the bitwise logical-and of the values represented by
-@var{x} and @var{y}, carried out in machine mode @var{m}, which must be
-a fixed-point machine mode.
-
-@findex ior
-@cindex inclusive-or, bitwise
-@cindex bitwise inclusive-or
-@item (ior:@var{m} @var{x} @var{y})
-Represents the bitwise inclusive-or of the values represented by @var{x}
-and @var{y}, carried out in machine mode @var{m}, which must be a
-fixed-point mode.
-
-@findex xor
-@cindex exclusive-or, bitwise
-@cindex bitwise exclusive-or
-@item (xor:@var{m} @var{x} @var{y})
-Represents the bitwise exclusive-or of the values represented by @var{x}
-and @var{y}, carried out in machine mode @var{m}, which must be a
-fixed-point mode.
-
-@findex ashift
-@cindex left shift
-@cindex shift
-@cindex arithmetic shift
-@item (ashift:@var{m} @var{x} @var{c})
-Represents the result of arithmetically shifting @var{x} left by @var{c}
-places. @var{x} have mode @var{m}, a fixed-point machine mode. @var{c}
-be a fixed-point mode or be a constant with mode @code{VOIDmode}; which
-mode is determined by the mode called for in the machine description
-entry for the left-shift instruction. For example, on the Vax, the mode
-of @var{c} is @code{QImode} regardless of @var{m}.
-
-@findex lshiftrt
-@cindex right shift
-@findex ashiftrt
-@item (lshiftrt:@var{m} @var{x} @var{c})
-@itemx (ashiftrt:@var{m} @var{x} @var{c})
-Like @code{ashift} but for right shift. Unlike the case for left shift,
-these two operations are distinct.
-
-@findex rotate
-@cindex rotate
-@cindex left rotate
-@findex rotatert
-@cindex right rotate
-@item (rotate:@var{m} @var{x} @var{c})
-@itemx (rotatert:@var{m} @var{x} @var{c})
-Similar but represent left and right rotate. If @var{c} is a constant,
-use @code{rotate}.
-
-@findex abs
-@cindex absolute value
-@item (abs:@var{m} @var{x})
-Represents the absolute value of @var{x}, computed in mode @var{m}.
-
-@findex sqrt
-@cindex square root
-@item (sqrt:@var{m} @var{x})
-Represents the square root of @var{x}, computed in mode @var{m}.
-Most often @var{m} will be a floating point mode.
-
-@findex ffs
-@item (ffs:@var{m} @var{x})
-Represents one plus the index of the least significant 1-bit in
-@var{x}, represented as an integer of mode @var{m}. (The value is
-zero if @var{x} is zero.) The mode of @var{x} need not be @var{m};
-depending on the target machine, various mode combinations may be
-valid.
-@end table
-
-@node Comparisons, Bit Fields, Arithmetic, RTL
-@section Comparison Operations
-@cindex RTL comparison operations
-
-Comparison operators test a relation on two operands and are considered
-to represent a machine-dependent nonzero value described by, but not
-necessarily equal to, @code{STORE_FLAG_VALUE} (@pxref{Misc})
-if the relation holds, or zero if it does not. The mode of the
-comparison operation is independent of the mode of the data being
-compared. If the comparison operation is being tested (e.g., the first
-operand of an @code{if_then_else}), the mode must be @code{VOIDmode}.
-If the comparison operation is producing data to be stored in some
-variable, the mode must be in class @code{MODE_INT}. All comparison
-operations producing data must use the same mode, which is
-machine-specific.
-
-@cindex condition codes
-There are two ways that comparison operations may be used. The
-comparison operators may be used to compare the condition codes
-@code{(cc0)} against zero, as in @code{(eq (cc0) (const_int 0))}. Such
-a construct actually refers to the result of the preceding instruction
-in which the condition codes were set. The instructing setting the
-condition code must be adjacent to the instruction using the condition
-code; only @code{note} insns may separate them.
-
-Alternatively, a comparison operation may directly compare two data
-objects. The mode of the comparison is determined by the operands; they
-must both be valid for a common machine mode. A comparison with both
-operands constant would be invalid as the machine mode could not be
-deduced from it, but such a comparison should never exist in RTL due to
-constant folding.
-
-In the example above, if @code{(cc0)} were last set to
-@code{(compare @var{x} @var{y})}, the comparison operation is
-identical to @code{(eq @var{x} @var{y})}. Usually only one style
-of comparisons is supported on a particular machine, but the combine
-pass will try to merge the operations to produce the @code{eq} shown
-in case it exists in the context of the particular insn involved.
-
-Inequality comparisons come in two flavors, signed and unsigned. Thus,
-there are distinct expression codes @code{gt} and @code{gtu} for signed and
-unsigned greater-than. These can produce different results for the same
-pair of integer values: for example, 1 is signed greater-than -1 but not
-unsigned greater-than, because -1 when regarded as unsigned is actually
-@code{0xffffffff} which is greater than 1.
-
-The signed comparisons are also used for floating point values. Floating
-point comparisons are distinguished by the machine modes of the operands.
-
-@table @code
-@findex eq
-@cindex equal
-@item (eq:@var{m} @var{x} @var{y})
-1 if the values represented by @var{x} and @var{y} are equal,
-otherwise 0.
-
-@findex ne
-@cindex not equal
-@item (ne:@var{m} @var{x} @var{y})
-1 if the values represented by @var{x} and @var{y} are not equal,
-otherwise 0.
-
-@findex gt
-@cindex greater than
-@item (gt:@var{m} @var{x} @var{y})
-1 if the @var{x} is greater than @var{y}. If they are fixed-point,
-the comparison is done in a signed sense.
-
-@findex gtu
-@cindex greater than
-@cindex unsigned greater than
-@item (gtu:@var{m} @var{x} @var{y})
-Like @code{gt} but does unsigned comparison, on fixed-point numbers only.
-
-@findex lt
-@cindex less than
-@findex ltu
-@cindex unsigned less than
-@item (lt:@var{m} @var{x} @var{y})
-@itemx (ltu:@var{m} @var{x} @var{y})
-Like @code{gt} and @code{gtu} but test for ``less than''.
-
-@findex ge
-@cindex greater than
-@findex geu
-@cindex unsigned greater than
-@item (ge:@var{m} @var{x} @var{y})
-@itemx (geu:@var{m} @var{x} @var{y})
-Like @code{gt} and @code{gtu} but test for ``greater than or equal''.
-
-@findex le
-@cindex less than or equal
-@findex leu
-@cindex unsigned less than
-@item (le:@var{m} @var{x} @var{y})
-@itemx (leu:@var{m} @var{x} @var{y})
-Like @code{gt} and @code{gtu} but test for ``less than or equal''.
-
-@findex if_then_else
-@item (if_then_else @var{cond} @var{then} @var{else})
-This is not a comparison operation but is listed here because it is
-always used in conjunction with a comparison operation. To be
-precise, @var{cond} is a comparison expression. This expression
-represents a choice, according to @var{cond}, between the value
-represented by @var{then} and the one represented by @var{else}.
-
-On most machines, @code{if_then_else} expressions are valid only
-to express conditional jumps.
-
-@findex cond
-@item (cond [@var{test1} @var{value1} @var{test2} @var{value2} @dots{}] @var{default})
-Similar to @code{if_then_else}, but more general. Each of @var{test1},
-@var{test2}, @dots{} is performed in turn. The result of this expression is
-the @var{value} corresponding to the first non-zero test, or @var{default} if
-none of the tests are non-zero expressions.
-
-This is currently not valid for instruction patterns and is supported only
-for insn attributes. @xref{Insn Attributes}.
-@end table
-
-@node Bit Fields, Conversions, Comparisons, RTL
-@section Bit Fields
-@cindex bit fields
-
-Special expression codes exist to represent bitfield instructions.
-These types of expressions are lvalues in RTL; they may appear
-on the left side of an assignment, indicating insertion of a value
-into the specified bit field.
-
-@table @code
-@findex sign_extract
-@cindex @code{BITS_BIG_ENDIAN}, effect on @code{sign_extract}
-@item (sign_extract:@var{m} @var{loc} @var{size} @var{pos})
-This represents a reference to a sign-extended bit field contained or
-starting in @var{loc} (a memory or register reference). The bit field
-is @var{size} bits wide and starts at bit @var{pos}. The compilation
-option @code{BITS_BIG_ENDIAN} says which end of the memory unit
-@var{pos} counts from.
-
-If @var{loc} is in memory, its mode must be a single-byte integer mode.
-If @var{loc} is in a register, the mode to use is specified by the
-operand of the @code{insv} or @code{extv} pattern
-(@pxref{Standard Names}) and is usually a full-word integer mode,
-which is the default if none is specified.
-
-The mode of @var{pos} is machine-specific and is also specified
-in the @code{insv} or @code{extv} pattern.
-
-The mode @var{m} is the same as the mode that would be used for
-@var{loc} if it were a register.
-
-@findex zero_extract
-@item (zero_extract:@var{m} @var{loc} @var{size} @var{pos})
-Like @code{sign_extract} but refers to an unsigned or zero-extended
-bit field. The same sequence of bits are extracted, but they
-are filled to an entire word with zeros instead of by sign-extension.
-@end table
-
-@node Conversions, RTL Declarations, Bit Fields, RTL
-@section Conversions
-@cindex conversions
-@cindex machine mode conversions
-
-All conversions between machine modes must be represented by
-explicit conversion operations. For example, an expression
-which is the sum of a byte and a full word cannot be written as
-@code{(plus:SI (reg:QI 34) (reg:SI 80))} because the @code{plus}
-operation requires two operands of the same machine mode.
-Therefore, the byte-sized operand is enclosed in a conversion
-operation, as in
-
-@example
-(plus:SI (sign_extend:SI (reg:QI 34)) (reg:SI 80))
-@end example
-
-The conversion operation is not a mere placeholder, because there
-may be more than one way of converting from a given starting mode
-to the desired final mode. The conversion operation code says how
-to do it.
-
-For all conversion operations, @var{x} must not be @code{VOIDmode}
-because the mode in which to do the conversion would not be known.
-The conversion must either be done at compile-time or @var{x}
-must be placed into a register.
-
-@table @code
-@findex sign_extend
-@item (sign_extend:@var{m} @var{x})
-Represents the result of sign-extending the value @var{x}
-to machine mode @var{m}. @var{m} must be a fixed-point mode
-and @var{x} a fixed-point value of a mode narrower than @var{m}.
-
-@findex zero_extend
-@item (zero_extend:@var{m} @var{x})
-Represents the result of zero-extending the value @var{x}
-to machine mode @var{m}. @var{m} must be a fixed-point mode
-and @var{x} a fixed-point value of a mode narrower than @var{m}.
-
-@findex float_extend
-@item (float_extend:@var{m} @var{x})
-Represents the result of extending the value @var{x}
-to machine mode @var{m}. @var{m} must be a floating point mode
-and @var{x} a floating point value of a mode narrower than @var{m}.
-
-@findex truncate
-@item (truncate:@var{m} @var{x})
-Represents the result of truncating the value @var{x}
-to machine mode @var{m}. @var{m} must be a fixed-point mode
-and @var{x} a fixed-point value of a mode wider than @var{m}.
-
-@findex float_truncate
-@item (float_truncate:@var{m} @var{x})
-Represents the result of truncating the value @var{x}
-to machine mode @var{m}. @var{m} must be a floating point mode
-and @var{x} a floating point value of a mode wider than @var{m}.
-
-@findex float
-@item (float:@var{m} @var{x})
-Represents the result of converting fixed point value @var{x},
-regarded as signed, to floating point mode @var{m}.
-
-@findex unsigned_float
-@item (unsigned_float:@var{m} @var{x})
-Represents the result of converting fixed point value @var{x},
-regarded as unsigned, to floating point mode @var{m}.
-
-@findex fix
-@item (fix:@var{m} @var{x})
-When @var{m} is a fixed point mode, represents the result of
-converting floating point value @var{x} to mode @var{m}, regarded as
-signed. How rounding is done is not specified, so this operation may
-be used validly in compiling C code only for integer-valued operands.
-
-@findex unsigned_fix
-@item (unsigned_fix:@var{m} @var{x})
-Represents the result of converting floating point value @var{x} to
-fixed point mode @var{m}, regarded as unsigned. How rounding is done
-is not specified.
-
-@findex fix
-@item (fix:@var{m} @var{x})
-When @var{m} is a floating point mode, represents the result of
-converting floating point value @var{x} (valid for mode @var{m}) to an
-integer, still represented in floating point mode @var{m}, by rounding
-towards zero.
-@end table
-
-@node RTL Declarations, Side Effects, Conversions, RTL
-@section Declarations
-@cindex RTL declarations
-@cindex declarations, RTL
-
-Declaration expression codes do not represent arithmetic operations
-but rather state assertions about their operands.
-
-@table @code
-@findex strict_low_part
-@cindex @code{subreg}, in @code{strict_low_part}
-@item (strict_low_part (subreg:@var{m} (reg:@var{n} @var{r}) 0))
-This expression code is used in only one context: as the destination operand of a
-@code{set} expression. In addition, the operand of this expression
-must be a non-paradoxical @code{subreg} expression.
-
-The presence of @code{strict_low_part} says that the part of the
-register which is meaningful in mode @var{n}, but is not part of
-mode @var{m}, is not to be altered. Normally, an assignment to such
-a subreg is allowed to have undefined effects on the rest of the
-register when @var{m} is less than a word.
-@end table
-
-@node Side Effects, Incdec, RTL Declarations, RTL
-@section Side Effect Expressions
-@cindex RTL side effect expressions
-
-The expression codes described so far represent values, not actions.
-But machine instructions never produce values; they are meaningful
-only for their side effects on the state of the machine. Special
-expression codes are used to represent side effects.
-
-The body of an instruction is always one of these side effect codes;
-the codes described above, which represent values, appear only as
-the operands of these.
-
-@table @code
-@findex set
-@item (set @var{lval} @var{x})
-Represents the action of storing the value of @var{x} into the place
-represented by @var{lval}. @var{lval} must be an expression
-representing a place that can be stored in: @code{reg} (or
-@code{subreg} or @code{strict_low_part}), @code{mem}, @code{pc} or
-@code{cc0}.@refill
-
-If @var{lval} is a @code{reg}, @code{subreg} or @code{mem}, it has a
-machine mode; then @var{x} must be valid for that mode.@refill
-
-If @var{lval} is a @code{reg} whose machine mode is less than the full
-width of the register, then it means that the part of the register
-specified by the machine mode is given the specified value and the
-rest of the register receives an undefined value. Likewise, if
-@var{lval} is a @code{subreg} whose machine mode is narrower than
-the mode of the register, the rest of the register can be changed in
-an undefined way.
-
-If @var{lval} is a @code{strict_low_part} of a @code{subreg}, then the
-part of the register specified by the machine mode of the
-@code{subreg} is given the value @var{x} and the rest of the register
-is not changed.@refill
-
-If @var{lval} is @code{(cc0)}, it has no machine mode, and @var{x} may
-be either a @code{compare} expression or a value that may have any mode.
-The latter case represents a ``test'' instruction. The expression
-@code{(set (cc0) (reg:@var{m} @var{n}))} is equivalent to
-@code{(set (cc0) (compare (reg:@var{m} @var{n}) (const_int 0)))}.
-Use the former expression to save space during the compilation.
-
-@cindex jump instructions and @code{set}
-@cindex @code{if_then_else} usage
-If @var{lval} is @code{(pc)}, we have a jump instruction, and the
-possibilities for @var{x} are very limited. It may be a
-@code{label_ref} expression (unconditional jump). It may be an
-@code{if_then_else} (conditional jump), in which case either the
-second or the third operand must be @code{(pc)} (for the case which
-does not jump) and the other of the two must be a @code{label_ref}
-(for the case which does jump). @var{x} may also be a @code{mem} or
-@code{(plus:SI (pc) @var{y})}, where @var{y} may be a @code{reg} or a
-@code{mem}; these unusual patterns are used to represent jumps through
-branch tables.@refill
-
-If @var{lval} is neither @code{(cc0)} nor @code{(pc)}, the mode of
-@var{lval} must not be @code{VOIDmode} and the mode of @var{x} must be
-valid for the mode of @var{lval}.
-
-@findex SET_DEST
-@findex SET_SRC
-@var{lval} is customarily accessed with the @code{SET_DEST} macro and
-@var{x} with the @code{SET_SRC} macro.
-
-@findex return
-@item (return)
-As the sole expression in a pattern, represents a return from the
-current function, on machines where this can be done with one
-instruction, such as Vaxes. On machines where a multi-instruction
-``epilogue'' must be executed in order to return from the function,
-returning is done by jumping to a label which precedes the epilogue, and
-the @code{return} expression code is never used.
-
-Inside an @code{if_then_else} expression, represents the value to be
-placed in @code{pc} to return to the caller.
-
-Note that an insn pattern of @code{(return)} is logically equivalent to
-@code{(set (pc) (return))}, but the latter form is never used.
-
-@findex call
-@item (call @var{function} @var{nargs})
-Represents a function call. @var{function} is a @code{mem} expression
-whose address is the address of the function to be called.
-@var{nargs} is an expression which can be used for two purposes: on
-some machines it represents the number of bytes of stack argument; on
-others, it represents the number of argument registers.
-
-Each machine has a standard machine mode which @var{function} must
-have. The machine description defines macro @code{FUNCTION_MODE} to
-expand into the requisite mode name. The purpose of this mode is to
-specify what kind of addressing is allowed, on machines where the
-allowed kinds of addressing depend on the machine mode being
-addressed.
-
-@findex clobber
-@item (clobber @var{x})
-Represents the storing or possible storing of an unpredictable,
-undescribed value into @var{x}, which must be a @code{reg},
-@code{scratch} or @code{mem} expression.
-
-One place this is used is in string instructions that store standard
-values into particular hard registers. It may not be worth the
-trouble to describe the values that are stored, but it is essential to
-inform the compiler that the registers will be altered, lest it
-attempt to keep data in them across the string instruction.
-
-If @var{x} is @code{(mem:BLK (const_int 0))}, it means that all memory
-locations must be presumed clobbered.
-
-Note that the machine description classifies certain hard registers as
-``call-clobbered''. All function call instructions are assumed by
-default to clobber these registers, so there is no need to use
-@code{clobber} expressions to indicate this fact. Also, each function
-call is assumed to have the potential to alter any memory location,
-unless the function is declared @code{const}.
-
-If the last group of expressions in a @code{parallel} are each a
-@code{clobber} expression whose arguments are @code{reg} or
-@code{match_scratch} (@pxref{RTL Template}) expressions, the combiner
-phase can add the appropriate @code{clobber} expressions to an insn it
-has constructed when doing so will cause a pattern to be matched.
-
-This feature can be used, for example, on a machine that whose multiply
-and add instructions don't use an MQ register but which has an
-add-accumulate instruction that does clobber the MQ register. Similarly,
-a combined instruction might require a temporary register while the
-constituent instructions might not.
-
-When a @code{clobber} expression for a register appears inside a
-@code{parallel} with other side effects, the register allocator
-guarantees that the register is unoccupied both before and after that
-insn. However, the reload phase may allocate a register used for one of
-the inputs unless the @samp{&} constraint is specified for the selected
-alternative (@pxref{Modifiers}). You can clobber either a specific hard
-register, a pseudo register, or a @code{scratch} expression; in the
-latter two cases, GNU CC will allocate a hard register that is available
-there for use as a temporary.
-
-For instructions that require a temporary register, you should use
-@code{scratch} instead of a pseudo-register because this will allow the
-combiner phase to add the @code{clobber} when required. You do this by
-coding (@code{clobber} (@code{match_scratch} @dots{})). If you do
-clobber a pseudo register, use one which appears nowhere else---generate
-a new one each time. Otherwise, you may confuse CSE.
-
-There is one other known use for clobbering a pseudo register in a
-@code{parallel}: when one of the input operands of the insn is also
-clobbered by the insn. In this case, using the same pseudo register in
-the clobber and elsewhere in the insn produces the expected results.
-
-@findex use
-@item (use @var{x})
-Represents the use of the value of @var{x}. It indicates that the
-value in @var{x} at this point in the program is needed, even though
-it may not be apparent why this is so. Therefore, the compiler will
-not attempt to delete previous instructions whose only effect is to
-store a value in @var{x}. @var{x} must be a @code{reg} expression.
-
-During the reload phase, an insn that has a @code{use} as pattern
-can carry a reg_equal note. These @code{use} insns will be deleted
-before the reload phase exits.
-
-During the delayed branch scheduling phase, @var{x} may be an insn.
-This indicates that @var{x} previously was located at this place in the
-code and its data dependencies need to be taken into account. These
-@code{use} insns will be deleted before the delayed branch scheduling
-phase exits.
-
-@findex parallel
-@item (parallel [@var{x0} @var{x1} @dots{}])
-Represents several side effects performed in parallel. The square
-brackets stand for a vector; the operand of @code{parallel} is a
-vector of expressions. @var{x0}, @var{x1} and so on are individual
-side effect expressions---expressions of code @code{set}, @code{call},
-@code{return}, @code{clobber} or @code{use}.@refill
-
-``In parallel'' means that first all the values used in the individual
-side-effects are computed, and second all the actual side-effects are
-performed. For example,
-
-@example
-(parallel [(set (reg:SI 1) (mem:SI (reg:SI 1)))
- (set (mem:SI (reg:SI 1)) (reg:SI 1))])
-@end example
-
-@noindent
-says unambiguously that the values of hard register 1 and the memory
-location addressed by it are interchanged. In both places where
-@code{(reg:SI 1)} appears as a memory address it refers to the value
-in register 1 @emph{before} the execution of the insn.
-
-It follows that it is @emph{incorrect} to use @code{parallel} and
-expect the result of one @code{set} to be available for the next one.
-For example, people sometimes attempt to represent a jump-if-zero
-instruction this way:
-
-@example
-(parallel [(set (cc0) (reg:SI 34))
- (set (pc) (if_then_else
- (eq (cc0) (const_int 0))
- (label_ref @dots{})
- (pc)))])
-@end example
-
-@noindent
-But this is incorrect, because it says that the jump condition depends
-on the condition code value @emph{before} this instruction, not on the
-new value that is set by this instruction.
-
-@cindex peephole optimization, RTL representation
-Peephole optimization, which takes place together with final assembly
-code output, can produce insns whose patterns consist of a @code{parallel}
-whose elements are the operands needed to output the resulting
-assembler code---often @code{reg}, @code{mem} or constant expressions.
-This would not be well-formed RTL at any other stage in compilation,
-but it is ok then because no further optimization remains to be done.
-However, the definition of the macro @code{NOTICE_UPDATE_CC}, if
-any, must deal with such insns if you define any peephole optimizations.
-
-@findex sequence
-@item (sequence [@var{insns} @dots{}])
-Represents a sequence of insns. Each of the @var{insns} that appears
-in the vector is suitable for appearing in the chain of insns, so it
-must be an @code{insn}, @code{jump_insn}, @code{call_insn},
-@code{code_label}, @code{barrier} or @code{note}.
-
-A @code{sequence} RTX is never placed in an actual insn during RTL
-generation. It represents the sequence of insns that result from a
-@code{define_expand} @emph{before} those insns are passed to
-@code{emit_insn} to insert them in the chain of insns. When actually
-inserted, the individual sub-insns are separated out and the
-@code{sequence} is forgotten.
-
-After delay-slot scheduling is completed, an insn and all the insns that
-reside in its delay slots are grouped together into a @code{sequence}.
-The insn requiring the delay slot is the first insn in the vector;
-subsequent insns are to be placed in the delay slot.
-
-@code{INSN_ANNULLED_BRANCH_P} is set on an insn in a delay slot to
-indicate that a branch insn should be used that will conditionally annul
-the effect of the insns in the delay slots. In such a case,
-@code{INSN_FROM_TARGET_P} indicates that the insn is from the target of
-the branch and should be executed only if the branch is taken; otherwise
-the insn should be executed only if the branch is not taken.
-@xref{Delay Slots}.
-@end table
-
-These expression codes appear in place of a side effect, as the body of
-an insn, though strictly speaking they do not always describe side
-effects as such:
-
-@table @code
-@findex asm_input
-@item (asm_input @var{s})
-Represents literal assembler code as described by the string @var{s}.
-
-@findex unspec
-@findex unspec_volatile
-@item (unspec [@var{operands} @dots{}] @var{index})
-@itemx (unspec_volatile [@var{operands} @dots{}] @var{index})
-Represents a machine-specific operation on @var{operands}. @var{index}
-selects between multiple machine-specific operations.
-@code{unspec_volatile} is used for volatile operations and operations
-that may trap; @code{unspec} is used for other operations.
-
-These codes may appear inside a @code{pattern} of an
-insn, inside a @code{parallel}, or inside an expression.
-
-@findex addr_vec
-@item (addr_vec:@var{m} [@var{lr0} @var{lr1} @dots{}])
-Represents a table of jump addresses. The vector elements @var{lr0},
-etc., are @code{label_ref} expressions. The mode @var{m} specifies
-how much space is given to each address; normally @var{m} would be
-@code{Pmode}.
-
-@findex addr_diff_vec
-@item (addr_diff_vec:@var{m} @var{base} [@var{lr0} @var{lr1} @dots{}] @var{min} @var{max} @var{flags})
-Represents a table of jump addresses expressed as offsets from
-@var{base}. The vector elements @var{lr0}, etc., are @code{label_ref}
-expressions and so is @var{base}. The mode @var{m} specifies how much
-space is given to each address-difference. @var{min} and @var{max}
-are set up by branch shortening and hold a label with a minimum and a
-maximum address, respectively. @var{flags} indicates the relative
-position of @var{base}, @var{min} and @var{max} to the cointaining insn
-and of @var{min} and @var{max} to @var{base}. See rtl.def for details.@refill
-@end table
-
-@node Incdec, Assembler, Side Effects, RTL
-@section Embedded Side-Effects on Addresses
-@cindex RTL preincrement
-@cindex RTL postincrement
-@cindex RTL predecrement
-@cindex RTL postdecrement
-
-Six special side-effect expression codes appear as memory addresses.
-
-@table @code
-@findex pre_dec
-@item (pre_dec:@var{m} @var{x})
-Represents the side effect of decrementing @var{x} by a standard
-amount and represents also the value that @var{x} has after being
-decremented. @var{x} must be a @code{reg} or @code{mem}, but most
-machines allow only a @code{reg}. @var{m} must be the machine mode
-for pointers on the machine in use. The amount @var{x} is decremented
-by is the length in bytes of the machine mode of the containing memory
-reference of which this expression serves as the address. Here is an
-example of its use:@refill
-
-@example
-(mem:DF (pre_dec:SI (reg:SI 39)))
-@end example
-
-@noindent
-This says to decrement pseudo register 39 by the length of a @code{DFmode}
-value and use the result to address a @code{DFmode} value.
-
-@findex pre_inc
-@item (pre_inc:@var{m} @var{x})
-Similar, but specifies incrementing @var{x} instead of decrementing it.
-
-@findex post_dec
-@item (post_dec:@var{m} @var{x})
-Represents the same side effect as @code{pre_dec} but a different
-value. The value represented here is the value @var{x} has @i{before}
-being decremented.
-
-@findex post_inc
-@item (post_inc:@var{m} @var{x})
-Similar, but specifies incrementing @var{x} instead of decrementing it.
-
-@findex post_modify
-@item (post_modify:@var{m} @var{x} @var{y})
-
-Represents the side effect of setting @var{x} to @var{y} and
-represents @var{x} before @var{x} is modified. @var{x} must be a
-@code{reg} or @code{mem}, but most machines allow only a @code{reg}.
-@var{m} must be the machine mode for pointers on the machine in use.
-The amount @var{x} is decremented by is the length in bytes of the
-machine mode of the containing memory reference of which this expression
-serves as the address. Note that this is not currently implemented.
-
-The expression @var{y} must be one of three forms:
-@table @code
-@code{(plus:@var{m} @var{x} @var{z})},
-@code{(minus:@var{m} @var{x} @var{z})}, or
-@code{(plus:@var{m} @var{x} @var{i})},
-@end table
-where @var{z} is an index register and @var{i} is a constant.
-
-Here is an example of its use:@refill
-
-@example
-(mem:SF (post_modify:SI (reg:SI 42) (plus (reg:SI 42) (reg:SI 48))))
-@end example
-
-This says to modify pseudo register 42 by adding the contents of pseudo
-register 48 to it, after the use of what ever 42 points to.
-
-@findex post_modify
-@item (pre_modify:@var{m} @var{x} @var{expr})
-Similar except side effects happen before the use.
-@end table
-
-These embedded side effect expressions must be used with care. Instruction
-patterns may not use them. Until the @samp{flow} pass of the compiler,
-they may occur only to represent pushes onto the stack. The @samp{flow}
-pass finds cases where registers are incremented or decremented in one
-instruction and used as an address shortly before or after; these cases are
-then transformed to use pre- or post-increment or -decrement.
-
-If a register used as the operand of these expressions is used in
-another address in an insn, the original value of the register is used.
-Uses of the register outside of an address are not permitted within the
-same insn as a use in an embedded side effect expression because such
-insns behave differently on different machines and hence must be treated
-as ambiguous and disallowed.
-
-An instruction that can be represented with an embedded side effect
-could also be represented using @code{parallel} containing an additional
-@code{set} to describe how the address register is altered. This is not
-done because machines that allow these operations at all typically
-allow them wherever a memory address is called for. Describing them as
-additional parallel stores would require doubling the number of entries
-in the machine description.
-
-@node Assembler, Insns, Incdec, RTL
-@section Assembler Instructions as Expressions
-@cindex assembler instructions in RTL
-
-@cindex @code{asm_operands}, usage
-The RTX code @code{asm_operands} represents a value produced by a
-user-specified assembler instruction. It is used to represent
-an @code{asm} statement with arguments. An @code{asm} statement with
-a single output operand, like this:
-
-@smallexample
-asm ("foo %1,%2,%0" : "=a" (outputvar) : "g" (x + y), "di" (*z));
-@end smallexample
-
-@noindent
-is represented using a single @code{asm_operands} RTX which represents
-the value that is stored in @code{outputvar}:
-
-@smallexample
-(set @var{rtx-for-outputvar}
- (asm_operands "foo %1,%2,%0" "a" 0
- [@var{rtx-for-addition-result} @var{rtx-for-*z}]
- [(asm_input:@var{m1} "g")
- (asm_input:@var{m2} "di")]))
-@end smallexample
-
-@noindent
-Here the operands of the @code{asm_operands} RTX are the assembler
-template string, the output-operand's constraint, the index-number of the
-output operand among the output operands specified, a vector of input
-operand RTX's, and a vector of input-operand modes and constraints. The
-mode @var{m1} is the mode of the sum @code{x+y}; @var{m2} is that of
-@code{*z}.
-
-When an @code{asm} statement has multiple output values, its insn has
-several such @code{set} RTX's inside of a @code{parallel}. Each @code{set}
-contains a @code{asm_operands}; all of these share the same assembler
-template and vectors, but each contains the constraint for the respective
-output operand. They are also distinguished by the output-operand index
-number, which is 0, 1, @dots{} for successive output operands.
-
-@node Insns, Calls, Assembler, RTL
-@section Insns
-@cindex insns
-
-The RTL representation of the code for a function is a doubly-linked
-chain of objects called @dfn{insns}. Insns are expressions with
-special codes that are used for no other purpose. Some insns are
-actual instructions; others represent dispatch tables for @code{switch}
-statements; others represent labels to jump to or various sorts of
-declarative information.
-
-In addition to its own specific data, each insn must have a unique
-id-number that distinguishes it from all other insns in the current
-function (after delayed branch scheduling, copies of an insn with the
-same id-number may be present in multiple places in a function, but
-these copies will always be identical and will only appear inside a
-@code{sequence}), and chain pointers to the preceding and following
-insns. These three fields occupy the same position in every insn,
-independent of the expression code of the insn. They could be accessed
-with @code{XEXP} and @code{XINT}, but instead three special macros are
-always used:
-
-@table @code
-@findex INSN_UID
-@item INSN_UID (@var{i})
-Accesses the unique id of insn @var{i}.
-
-@findex PREV_INSN
-@item PREV_INSN (@var{i})
-Accesses the chain pointer to the insn preceding @var{i}.
-If @var{i} is the first insn, this is a null pointer.
-
-@findex NEXT_INSN
-@item NEXT_INSN (@var{i})
-Accesses the chain pointer to the insn following @var{i}.
-If @var{i} is the last insn, this is a null pointer.
-@end table
-
-@findex get_insns
-@findex get_last_insn
-The first insn in the chain is obtained by calling @code{get_insns}; the
-last insn is the result of calling @code{get_last_insn}. Within the
-chain delimited by these insns, the @code{NEXT_INSN} and
-@code{PREV_INSN} pointers must always correspond: if @var{insn} is not
-the first insn,
-
-@example
-NEXT_INSN (PREV_INSN (@var{insn})) == @var{insn}
-@end example
-
-@noindent
-is always true and if @var{insn} is not the last insn,
-
-@example
-PREV_INSN (NEXT_INSN (@var{insn})) == @var{insn}
-@end example
-
-@noindent
-is always true.
-
-After delay slot scheduling, some of the insns in the chain might be
-@code{sequence} expressions, which contain a vector of insns. The value
-of @code{NEXT_INSN} in all but the last of these insns is the next insn
-in the vector; the value of @code{NEXT_INSN} of the last insn in the vector
-is the same as the value of @code{NEXT_INSN} for the @code{sequence} in
-which it is contained. Similar rules apply for @code{PREV_INSN}.
-
-This means that the above invariants are not necessarily true for insns
-inside @code{sequence} expressions. Specifically, if @var{insn} is the
-first insn in a @code{sequence}, @code{NEXT_INSN (PREV_INSN (@var{insn}))}
-is the insn containing the @code{sequence} expression, as is the value
-of @code{PREV_INSN (NEXT_INSN (@var{insn}))} is @var{insn} is the last
-insn in the @code{sequence} expression. You can use these expressions
-to find the containing @code{sequence} expression.@refill
-
-Every insn has one of the following six expression codes:
-
-@table @code
-@findex insn
-@item insn
-The expression code @code{insn} is used for instructions that do not jump
-and do not do function calls. @code{sequence} expressions are always
-contained in insns with code @code{insn} even if one of those insns
-should jump or do function calls.
-
-Insns with code @code{insn} have four additional fields beyond the three
-mandatory ones listed above. These four are described in a table below.
-
-@findex jump_insn
-@item jump_insn
-The expression code @code{jump_insn} is used for instructions that may
-jump (or, more generally, may contain @code{label_ref} expressions). If
-there is an instruction to return from the current function, it is
-recorded as a @code{jump_insn}.
-
-@findex JUMP_LABEL
-@code{jump_insn} insns have the same extra fields as @code{insn} insns,
-accessed in the same way and in addition contain a field
-@code{JUMP_LABEL} which is defined once jump optimization has completed.
-
-For simple conditional and unconditional jumps, this field contains the
-@code{code_label} to which this insn will (possibly conditionally)
-branch. In a more complex jump, @code{JUMP_LABEL} records one of the
-labels that the insn refers to; the only way to find the others
-is to scan the entire body of the insn.
-
-Return insns count as jumps, but since they do not refer to any labels,
-they have zero in the @code{JUMP_LABEL} field.
-
-@findex call_insn
-@item call_insn
-The expression code @code{call_insn} is used for instructions that may do
-function calls. It is important to distinguish these instructions because
-they imply that certain registers and memory locations may be altered
-unpredictably.
-
-@findex CALL_INSN_FUNCTION_USAGE
-@code{call_insn} insns have the same extra fields as @code{insn} insns,
-accessed in the same way and in addition contain a field
-@code{CALL_INSN_FUNCTION_USAGE}, which contains a list (chain of
-@code{expr_list} expressions) containing @code{use} and @code{clobber}
-expressions that denote hard registers used or clobbered by the called
-function. A register specified in a @code{clobber} in this list is
-modified @emph{after} the execution of the @code{call_insn}, while a
-register in a @code{clobber} in the body of the @code{call_insn} is
-clobbered before the insn completes execution. @code{clobber}
-expressions in this list augment registers specified in
-@code{CALL_USED_REGISTERS} (@pxref{Register Basics}).
-
-@findex code_label
-@findex CODE_LABEL_NUMBER
-@item code_label
-A @code{code_label} insn represents a label that a jump insn can jump
-to. It contains two special fields of data in addition to the three
-standard ones. @code{CODE_LABEL_NUMBER} is used to hold the @dfn{label
-number}, a number that identifies this label uniquely among all the
-labels in the compilation (not just in the current function).
-Ultimately, the label is represented in the assembler output as an
-assembler label, usually of the form @samp{L@var{n}} where @var{n} is
-the label number.
-
-When a @code{code_label} appears in an RTL expression, it normally
-appears within a @code{label_ref} which represents the address of
-the label, as a number.
-
-@findex LABEL_NUSES
-The field @code{LABEL_NUSES} is only defined once the jump optimization
-phase is completed and contains the number of times this label is
-referenced in the current function.
-
-@findex barrier
-@item barrier
-Barriers are placed in the instruction stream when control cannot flow
-past them. They are placed after unconditional jump instructions to
-indicate that the jumps are unconditional and after calls to
-@code{volatile} functions, which do not return (e.g., @code{exit}).
-They contain no information beyond the three standard fields.
-
-@findex note
-@findex NOTE_LINE_NUMBER
-@findex NOTE_SOURCE_FILE
-@item note
-@code{note} insns are used to represent additional debugging and
-declarative information. They contain two nonstandard fields, an
-integer which is accessed with the macro @code{NOTE_LINE_NUMBER} and a
-string accessed with @code{NOTE_SOURCE_FILE}.
-
-If @code{NOTE_LINE_NUMBER} is positive, the note represents the
-position of a source line and @code{NOTE_SOURCE_FILE} is the source file name
-that the line came from. These notes control generation of line
-number data in the assembler output.
-
-Otherwise, @code{NOTE_LINE_NUMBER} is not really a line number but a
-code with one of the following values (and @code{NOTE_SOURCE_FILE}
-must contain a null pointer):
-
-@table @code
-@findex NOTE_INSN_DELETED
-@item NOTE_INSN_DELETED
-Such a note is completely ignorable. Some passes of the compiler
-delete insns by altering them into notes of this kind.
-
-@findex NOTE_INSN_BLOCK_BEG
-@findex NOTE_INSN_BLOCK_END
-@item NOTE_INSN_BLOCK_BEG
-@itemx NOTE_INSN_BLOCK_END
-These types of notes indicate the position of the beginning and end
-of a level of scoping of variable names. They control the output
-of debugging information.
-
-@findex NOTE_INSN_EH_REGION_BEG
-@findex NOTE_INSN_EH_REGION_END
-@item NOTE_INSN_EH_REGION_BEG
-@itemx NOTE_INSN_EH_REGION_END
-These types of notes indicate the position of the beginning and end of a
-level of scoping for exception handling. @code{NOTE_BLOCK_NUMBER}
-identifies which @code{CODE_LABEL} is associated with the given region.
-
-@findex NOTE_INSN_LOOP_BEG
-@findex NOTE_INSN_LOOP_END
-@item NOTE_INSN_LOOP_BEG
-@itemx NOTE_INSN_LOOP_END
-These types of notes indicate the position of the beginning and end
-of a @code{while} or @code{for} loop. They enable the loop optimizer
-to find loops quickly.
-
-@findex NOTE_INSN_LOOP_CONT
-@item NOTE_INSN_LOOP_CONT
-Appears at the place in a loop that @code{continue} statements jump to.
-
-@findex NOTE_INSN_LOOP_VTOP
-@item NOTE_INSN_LOOP_VTOP
-This note indicates the place in a loop where the exit test begins for
-those loops in which the exit test has been duplicated. This position
-becomes another virtual start of the loop when considering loop
-invariants.
-
-@findex NOTE_INSN_FUNCTION_END
-@item NOTE_INSN_FUNCTION_END
-Appears near the end of the function body, just before the label that
-@code{return} statements jump to (on machine where a single instruction
-does not suffice for returning). This note may be deleted by jump
-optimization.
-
-@findex NOTE_INSN_SETJMP
-@item NOTE_INSN_SETJMP
-Appears following each call to @code{setjmp} or a related function.
-@end table
-
-These codes are printed symbolically when they appear in debugging dumps.
-@end table
-
-@cindex @code{TImode}, in @code{insn}
-@cindex @code{HImode}, in @code{insn}
-@cindex @code{QImode}, in @code{insn}
-The machine mode of an insn is normally @code{VOIDmode}, but some
-phases use the mode for various purposes.
-
-The common subexpression elimination pass sets the mode of an insn to
-@code{QImode} when it is the first insn in a block that has already
-been processed.
-
-The second Haifa scheduling pass, for targets that can multiple issue,
-sets the mode of an insn to @code{TImode} when it is believed that the
-instruction begins an issue group. That is, when the instruction
-cannot issue simultaneously with the previous. This may be relied on
-by later passes, in particular machine-dependant reorg.
-
-Here is a table of the extra fields of @code{insn}, @code{jump_insn}
-and @code{call_insn} insns:
-
-@table @code
-@findex PATTERN
-@item PATTERN (@var{i})
-An expression for the side effect performed by this insn. This must be
-one of the following codes: @code{set}, @code{call}, @code{use},
-@code{clobber}, @code{return}, @code{asm_input}, @code{asm_output},
-@code{addr_vec}, @code{addr_diff_vec}, @code{trap_if}, @code{unspec},
-@code{unspec_volatile}, @code{parallel}, or @code{sequence}. If it is a @code{parallel},
-each element of the @code{parallel} must be one these codes, except that
-@code{parallel} expressions cannot be nested and @code{addr_vec} and
-@code{addr_diff_vec} are not permitted inside a @code{parallel} expression.
-
-@findex INSN_CODE
-@item INSN_CODE (@var{i})
-An integer that says which pattern in the machine description matches
-this insn, or -1 if the matching has not yet been attempted.
-
-Such matching is never attempted and this field remains -1 on an insn
-whose pattern consists of a single @code{use}, @code{clobber},
-@code{asm_input}, @code{addr_vec} or @code{addr_diff_vec} expression.
-
-@findex asm_noperands
-Matching is also never attempted on insns that result from an @code{asm}
-statement. These contain at least one @code{asm_operands} expression.
-The function @code{asm_noperands} returns a non-negative value for
-such insns.
-
-In the debugging output, this field is printed as a number followed by
-a symbolic representation that locates the pattern in the @file{md}
-file as some small positive or negative offset from a named pattern.
-
-@findex LOG_LINKS
-@item LOG_LINKS (@var{i})
-A list (chain of @code{insn_list} expressions) giving information about
-dependencies between instructions within a basic block. Neither a jump
-nor a label may come between the related insns.
-
-@findex REG_NOTES
-@item REG_NOTES (@var{i})
-A list (chain of @code{expr_list} and @code{insn_list} expressions)
-giving miscellaneous information about the insn. It is often
-information pertaining to the registers used in this insn.
-@end table
-
-The @code{LOG_LINKS} field of an insn is a chain of @code{insn_list}
-expressions. Each of these has two operands: the first is an insn,
-and the second is another @code{insn_list} expression (the next one in
-the chain). The last @code{insn_list} in the chain has a null pointer
-as second operand. The significant thing about the chain is which
-insns appear in it (as first operands of @code{insn_list}
-expressions). Their order is not significant.
-
-This list is originally set up by the flow analysis pass; it is a null
-pointer until then. Flow only adds links for those data dependencies
-which can be used for instruction combination. For each insn, the flow
-analysis pass adds a link to insns which store into registers values
-that are used for the first time in this insn. The instruction
-scheduling pass adds extra links so that every dependence will be
-represented. Links represent data dependencies, antidependencies and
-output dependencies; the machine mode of the link distinguishes these
-three types: antidependencies have mode @code{REG_DEP_ANTI}, output
-dependencies have mode @code{REG_DEP_OUTPUT}, and data dependencies have
-mode @code{VOIDmode}.
-
-The @code{REG_NOTES} field of an insn is a chain similar to the
-@code{LOG_LINKS} field but it includes @code{expr_list} expressions in
-addition to @code{insn_list} expressions. There are several kinds of
-register notes, which are distinguished by the machine mode, which in a
-register note is really understood as being an @code{enum reg_note}.
-The first operand @var{op} of the note is data whose meaning depends on
-the kind of note.
-
-@findex REG_NOTE_KIND
-@findex PUT_REG_NOTE_KIND
-The macro @code{REG_NOTE_KIND (@var{x})} returns the kind of
-register note. Its counterpart, the macro @code{PUT_REG_NOTE_KIND
-(@var{x}, @var{newkind})} sets the register note type of @var{x} to be
-@var{newkind}.
-
-Register notes are of three classes: They may say something about an
-input to an insn, they may say something about an output of an insn, or
-they may create a linkage between two insns. There are also a set
-of values that are only used in @code{LOG_LINKS}.
-
-These register notes annotate inputs to an insn:
-
-@table @code
-@findex REG_DEAD
-@item REG_DEAD
-The value in @var{op} dies in this insn; that is to say, altering the
-value immediately after this insn would not affect the future behavior
-of the program.
-
-This does not necessarily mean that the register @var{op} has no useful
-value after this insn since it may also be an output of the insn. In
-such a case, however, a @code{REG_DEAD} note would be redundant and is
-usually not present until after the reload pass, but no code relies on
-this fact.
-
-@findex REG_INC
-@item REG_INC
-The register @var{op} is incremented (or decremented; at this level
-there is no distinction) by an embedded side effect inside this insn.
-This means it appears in a @code{post_inc}, @code{pre_inc},
-@code{post_dec} or @code{pre_dec} expression.
-
-@findex REG_NONNEG
-@item REG_NONNEG
-The register @var{op} is known to have a nonnegative value when this
-insn is reached. This is used so that decrement and branch until zero
-instructions, such as the m68k dbra, can be matched.
-
-The @code{REG_NONNEG} note is added to insns only if the machine
-description has a @samp{decrement_and_branch_until_zero} pattern.
-
-@findex REG_NO_CONFLICT
-@item REG_NO_CONFLICT
-This insn does not cause a conflict between @var{op} and the item
-being set by this insn even though it might appear that it does.
-In other words, if the destination register and @var{op} could
-otherwise be assigned the same register, this insn does not
-prevent that assignment.
-
-Insns with this note are usually part of a block that begins with a
-@code{clobber} insn specifying a multi-word pseudo register (which will
-be the output of the block), a group of insns that each set one word of
-the value and have the @code{REG_NO_CONFLICT} note attached, and a final
-insn that copies the output to itself with an attached @code{REG_EQUAL}
-note giving the expression being computed. This block is encapsulated
-with @code{REG_LIBCALL} and @code{REG_RETVAL} notes on the first and
-last insns, respectively.
-
-@findex REG_LABEL
-@item REG_LABEL
-This insn uses @var{op}, a @code{code_label}, but is not a
-@code{jump_insn}. The presence of this note allows jump optimization to
-be aware that @var{op} is, in fact, being used.
-@end table
-
-The following notes describe attributes of outputs of an insn:
-
-@table @code
-@findex REG_EQUIV
-@findex REG_EQUAL
-@item REG_EQUIV
-@itemx REG_EQUAL
-This note is only valid on an insn that sets only one register and
-indicates that that register will be equal to @var{op} at run time; the
-scope of this equivalence differs between the two types of notes. The
-value which the insn explicitly copies into the register may look
-different from @var{op}, but they will be equal at run time. If the
-output of the single @code{set} is a @code{strict_low_part} expression,
-the note refers to the register that is contained in @code{SUBREG_REG}
-of the @code{subreg} expression.
-
-For @code{REG_EQUIV}, the register is equivalent to @var{op} throughout
-the entire function, and could validly be replaced in all its
-occurrences by @var{op}. (``Validly'' here refers to the data flow of
-the program; simple replacement may make some insns invalid.) For
-example, when a constant is loaded into a register that is never
-assigned any other value, this kind of note is used.
-
-When a parameter is copied into a pseudo-register at entry to a function,
-a note of this kind records that the register is equivalent to the stack
-slot where the parameter was passed. Although in this case the register
-may be set by other insns, it is still valid to replace the register
-by the stack slot throughout the function.
-
-A @code{REG_EQUIV} note is also used on an instruction which copies a
-register parameter into a pseudo-register at entry to a function, if
-there is a stack slot where that parameter could be stored. Although
-other insns may set the pseudo-register, it is valid for the compiler to
-replace the pseudo-register by stack slot throughout the function,
-provided the compiler ensures that the stack slot is properly
-initialized by making the replacement in the initial copy instruction as
-well. This is used on machines for which the calling convention
-allocates stack space for register parameters. See
-@code{REG_PARM_STACK_SPACE} in @ref{Stack Arguments}.
-
-In the case of @code{REG_EQUAL}, the register that is set by this insn
-will be equal to @var{op} at run time at the end of this insn but not
-necessarily elsewhere in the function. In this case, @var{op}
-is typically an arithmetic expression. For example, when a sequence of
-insns such as a library call is used to perform an arithmetic operation,
-this kind of note is attached to the insn that produces or copies the
-final value.
-
-These two notes are used in different ways by the compiler passes.
-@code{REG_EQUAL} is used by passes prior to register allocation (such as
-common subexpression elimination and loop optimization) to tell them how
-to think of that value. @code{REG_EQUIV} notes are used by register
-allocation to indicate that there is an available substitute expression
-(either a constant or a @code{mem} expression for the location of a
-parameter on the stack) that may be used in place of a register if
-insufficient registers are available.
-
-Except for stack homes for parameters, which are indicated by a
-@code{REG_EQUIV} note and are not useful to the early optimization
-passes and pseudo registers that are equivalent to a memory location
-throughout there entire life, which is not detected until later in
-the compilation, all equivalences are initially indicated by an attached
-@code{REG_EQUAL} note. In the early stages of register allocation, a
-@code{REG_EQUAL} note is changed into a @code{REG_EQUIV} note if
-@var{op} is a constant and the insn represents the only set of its
-destination register.
-
-Thus, compiler passes prior to register allocation need only check for
-@code{REG_EQUAL} notes and passes subsequent to register allocation
-need only check for @code{REG_EQUIV} notes.
-
-@findex REG_UNUSED
-@item REG_UNUSED
-The register @var{op} being set by this insn will not be used in a
-subsequent insn. This differs from a @code{REG_DEAD} note, which
-indicates that the value in an input will not be used subsequently.
-These two notes are independent; both may be present for the same
-register.
-
-@findex REG_WAS_0
-@item REG_WAS_0
-The single output of this insn contained zero before this insn.
-@var{op} is the insn that set it to zero. You can rely on this note if
-it is present and @var{op} has not been deleted or turned into a @code{note};
-its absence implies nothing.
-@end table
-
-These notes describe linkages between insns. They occur in pairs: one
-insn has one of a pair of notes that points to a second insn, which has
-the inverse note pointing back to the first insn.
-
-@table @code
-@findex REG_RETVAL
-@item REG_RETVAL
-This insn copies the value of a multi-insn sequence (for example, a
-library call), and @var{op} is the first insn of the sequence (for a
-library call, the first insn that was generated to set up the arguments
-for the library call).
-
-Loop optimization uses this note to treat such a sequence as a single
-operation for code motion purposes and flow analysis uses this note to
-delete such sequences whose results are dead.
-
-A @code{REG_EQUAL} note will also usually be attached to this insn to
-provide the expression being computed by the sequence.
-
-These notes will be deleted after reload, since they are no longer
-accurate or useful.
-
-@findex REG_LIBCALL
-@item REG_LIBCALL
-This is the inverse of @code{REG_RETVAL}: it is placed on the first
-insn of a multi-insn sequence, and it points to the last one.
-
-These notes are deleted after reload, since they are no longer useful or
-accurate.
-
-@findex REG_CC_SETTER
-@findex REG_CC_USER
-@item REG_CC_SETTER
-@itemx REG_CC_USER
-On machines that use @code{cc0}, the insns which set and use @code{cc0}
-set and use @code{cc0} are adjacent. However, when branch delay slot
-filling is done, this may no longer be true. In this case a
-@code{REG_CC_USER} note will be placed on the insn setting @code{cc0} to
-point to the insn using @code{cc0} and a @code{REG_CC_SETTER} note will
-be placed on the insn using @code{cc0} to point to the insn setting
-@code{cc0}.@refill
-@end table
-
-These values are only used in the @code{LOG_LINKS} field, and indicate
-the type of dependency that each link represents. Links which indicate
-a data dependence (a read after write dependence) do not use any code,
-they simply have mode @code{VOIDmode}, and are printed without any
-descriptive text.
-
-@table @code
-@findex REG_DEP_ANTI
-@item REG_DEP_ANTI
-This indicates an anti dependence (a write after read dependence).
-
-@findex REG_DEP_OUTPUT
-@item REG_DEP_OUTPUT
-This indicates an output dependence (a write after write dependence).
-@end table
-
-These notes describe information gathered from gcov profile data. They
-are stored in the @code{REG_NOTES} field of an insn as an
-@code{expr_list}.
-
-@table @code
-@findex REG_EXEC_COUNT
-@item REG_EXEC_COUNT
-This is used to indicate the number of times a basic block was executed
-according to the profile data. The note is attached to the first insn in
-the basic block.
-
-@findex REG_BR_PROB
-@item REG_BR_PROB
-This is used to specify the ratio of branches to non-branches of a
-branch insn according to the profile data. The value is stored as a
-value between 0 and REG_BR_PROB_BASE; larger values indicate a higher
-probability that the branch will be taken.
-
-@findex REG_BR_PRED
-@item REG_BR_PRED
-These notes are found in JUMP insns after delayed branch scheduling
-has taken place. They indicate both the direction and the likelyhood
-of the JUMP. The format is a bitmask of ATTR_FLAG_* values.
-
-@findex REG_FRAME_RELATED_EXPR
-@item REG_FRAME_RELATED_EXPR
-This is used on an RTX_FRAME_RELATED_P insn wherein the attached expression
-is used in place of the actual insn pattern. This is done in cases where
-the pattern is either complex or misleading.
-@end table
-
-For convenience, the machine mode in an @code{insn_list} or
-@code{expr_list} is printed using these symbolic codes in debugging dumps.
-
-@findex insn_list
-@findex expr_list
-The only difference between the expression codes @code{insn_list} and
-@code{expr_list} is that the first operand of an @code{insn_list} is
-assumed to be an insn and is printed in debugging dumps as the insn's
-unique id; the first operand of an @code{expr_list} is printed in the
-ordinary way as an expression.
-
-@node Calls, Sharing, Insns, RTL
-@section RTL Representation of Function-Call Insns
-@cindex calling functions in RTL
-@cindex RTL function-call insns
-@cindex function-call insns
-
-Insns that call subroutines have the RTL expression code @code{call_insn}.
-These insns must satisfy special rules, and their bodies must use a special
-RTL expression code, @code{call}.
-
-@cindex @code{call} usage
-A @code{call} expression has two operands, as follows:
-
-@example
-(call (mem:@var{fm} @var{addr}) @var{nbytes})
-@end example
-
-@noindent
-Here @var{nbytes} is an operand that represents the number of bytes of
-argument data being passed to the subroutine, @var{fm} is a machine mode
-(which must equal as the definition of the @code{FUNCTION_MODE} macro in
-the machine description) and @var{addr} represents the address of the
-subroutine.
-
-For a subroutine that returns no value, the @code{call} expression as
-shown above is the entire body of the insn, except that the insn might
-also contain @code{use} or @code{clobber} expressions.
-
-@cindex @code{BLKmode}, and function return values
-For a subroutine that returns a value whose mode is not @code{BLKmode},
-the value is returned in a hard register. If this register's number is
-@var{r}, then the body of the call insn looks like this:
-
-@example
-(set (reg:@var{m} @var{r})
- (call (mem:@var{fm} @var{addr}) @var{nbytes}))
-@end example
-
-@noindent
-This RTL expression makes it clear (to the optimizer passes) that the
-appropriate register receives a useful value in this insn.
-
-When a subroutine returns a @code{BLKmode} value, it is handled by
-passing to the subroutine the address of a place to store the value.
-So the call insn itself does not ``return'' any value, and it has the
-same RTL form as a call that returns nothing.
-
-On some machines, the call instruction itself clobbers some register,
-for example to contain the return address. @code{call_insn} insns
-on these machines should have a body which is a @code{parallel}
-that contains both the @code{call} expression and @code{clobber}
-expressions that indicate which registers are destroyed. Similarly,
-if the call instruction requires some register other than the stack
-pointer that is not explicitly mentioned it its RTL, a @code{use}
-subexpression should mention that register.
-
-Functions that are called are assumed to modify all registers listed in
-the configuration macro @code{CALL_USED_REGISTERS} (@pxref{Register
-Basics}) and, with the exception of @code{const} functions and library
-calls, to modify all of memory.
-
-Insns containing just @code{use} expressions directly precede the
-@code{call_insn} insn to indicate which registers contain inputs to the
-function. Similarly, if registers other than those in
-@code{CALL_USED_REGISTERS} are clobbered by the called function, insns
-containing a single @code{clobber} follow immediately after the call to
-indicate which registers.
-
-@node Sharing
-@section Structure Sharing Assumptions
-@cindex sharing of RTL components
-@cindex RTL structure sharing assumptions
-
-The compiler assumes that certain kinds of RTL expressions are unique;
-there do not exist two distinct objects representing the same value.
-In other cases, it makes an opposite assumption: that no RTL expression
-object of a certain kind appears in more than one place in the
-containing structure.
-
-These assumptions refer to a single function; except for the RTL
-objects that describe global variables and external functions,
-and a few standard objects such as small integer constants,
-no RTL objects are common to two functions.
-
-@itemize @bullet
-@cindex @code{reg}, RTL sharing
-@item
-Each pseudo-register has only a single @code{reg} object to represent it,
-and therefore only a single machine mode.
-
-@cindex symbolic label
-@cindex @code{symbol_ref}, RTL sharing
-@item
-For any symbolic label, there is only one @code{symbol_ref} object
-referring to it.
-
-@cindex @code{const_int}, RTL sharing
-@item
-There is only one @code{const_int} expression with value 0, only
-one with value 1, and only one with value @minus{}1.
-Some other integer values are also stored uniquely.
-
-@cindex @code{pc}, RTL sharing
-@item
-There is only one @code{pc} expression.
-
-@cindex @code{cc0}, RTL sharing
-@item
-There is only one @code{cc0} expression.
-
-@cindex @code{const_double}, RTL sharing
-@item
-There is only one @code{const_double} expression with value 0 for
-each floating point mode. Likewise for values 1 and 2.
-
-@cindex @code{label_ref}, RTL sharing
-@cindex @code{scratch}, RTL sharing
-@item
-No @code{label_ref} or @code{scratch} appears in more than one place in
-the RTL structure; in other words, it is safe to do a tree-walk of all
-the insns in the function and assume that each time a @code{label_ref}
-or @code{scratch} is seen it is distinct from all others that are seen.
-
-@cindex @code{mem}, RTL sharing
-@item
-Only one @code{mem} object is normally created for each static
-variable or stack slot, so these objects are frequently shared in all
-the places they appear. However, separate but equal objects for these
-variables are occasionally made.
-
-@cindex @code{asm_operands}, RTL sharing
-@item
-When a single @code{asm} statement has multiple output operands, a
-distinct @code{asm_operands} expression is made for each output operand.
-However, these all share the vector which contains the sequence of input
-operands. This sharing is used later on to test whether two
-@code{asm_operands} expressions come from the same statement, so all
-optimizations must carefully preserve the sharing if they copy the
-vector at all.
-
-@item
-No RTL object appears in more than one place in the RTL structure
-except as described above. Many passes of the compiler rely on this
-by assuming that they can modify RTL objects in place without unwanted
-side-effects on other insns.
-
-@findex unshare_all_rtl
-@item
-During initial RTL generation, shared structure is freely introduced.
-After all the RTL for a function has been generated, all shared
-structure is copied by @code{unshare_all_rtl} in @file{emit-rtl.c},
-after which the above rules are guaranteed to be followed.
-
-@findex copy_rtx_if_shared
-@item
-During the combiner pass, shared structure within an insn can exist
-temporarily. However, the shared structure is copied before the
-combiner is finished with the insn. This is done by calling
-@code{copy_rtx_if_shared}, which is a subroutine of
-@code{unshare_all_rtl}.
-@end itemize
-
-@node Reading RTL
-@section Reading RTL
-
-To read an RTL object from a file, call @code{read_rtx}. It takes one
-argument, a stdio stream, and returns a single RTL object.
-
-Reading RTL from a file is very slow. This is not currently a
-problem since reading RTL occurs only as part of building the
-compiler.
-
-People frequently have the idea of using RTL stored as text in a file as
-an interface between a language front end and the bulk of GNU CC. This
-idea is not feasible.
-
-GNU CC was designed to use RTL internally only. Correct RTL for a given
-program is very dependent on the particular target machine. And the RTL
-does not contain all the information about the program.
-
-The proper way to interface GNU CC to a new language front end is with
-the ``tree'' data structure. There is no manual for this data
-structure, but it is described in the files @file{tree.h} and
-@file{tree.def}.
diff --git a/contrib/gcc/sched.c b/contrib/gcc/sched.c
deleted file mode 100644
index f09a68ae3694..000000000000
--- a/contrib/gcc/sched.c
+++ /dev/null
@@ -1,4470 +0,0 @@
-/* Instruction scheduling pass.
- Copyright (C) 1992, 93-98, 1999 Free Software Foundation, Inc.
- Contributed by Michael Tiemann (tiemann@cygnus.com)
- Enhanced by, and currently maintained by, Jim Wilson (wilson@cygnus.com)
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* Instruction scheduling pass.
-
- This pass implements list scheduling within basic blocks. It is
- run after flow analysis, but before register allocation. The
- scheduler works as follows:
-
- We compute insn priorities based on data dependencies. Flow
- analysis only creates a fraction of the data-dependencies we must
- observe: namely, only those dependencies which the combiner can be
- expected to use. For this pass, we must therefore create the
- remaining dependencies we need to observe: register dependencies,
- memory dependencies, dependencies to keep function calls in order,
- and the dependence between a conditional branch and the setting of
- condition codes are all dealt with here.
-
- The scheduler first traverses the data flow graph, starting with
- the last instruction, and proceeding to the first, assigning
- values to insn_priority as it goes. This sorts the instructions
- topologically by data dependence.
-
- Once priorities have been established, we order the insns using
- list scheduling. This works as follows: starting with a list of
- all the ready insns, and sorted according to priority number, we
- schedule the insn from the end of the list by placing its
- predecessors in the list according to their priority order. We
- consider this insn scheduled by setting the pointer to the "end" of
- the list to point to the previous insn. When an insn has no
- predecessors, we either queue it until sufficient time has elapsed
- or add it to the ready list. As the instructions are scheduled or
- when stalls are introduced, the queue advances and dumps insns into
- the ready list. When all insns down to the lowest priority have
- been scheduled, the critical path of the basic block has been made
- as short as possible. The remaining insns are then scheduled in
- remaining slots.
-
- Function unit conflicts are resolved during reverse list scheduling
- by tracking the time when each insn is committed to the schedule
- and from that, the time the function units it uses must be free.
- As insns on the ready list are considered for scheduling, those
- that would result in a blockage of the already committed insns are
- queued until no blockage will result. Among the remaining insns on
- the ready list to be considered, the first one with the largest
- potential for causing a subsequent blockage is chosen.
-
- The following list shows the order in which we want to break ties
- among insns in the ready list:
-
- 1. choose insn with lowest conflict cost, ties broken by
- 2. choose insn with the longest path to end of bb, ties broken by
- 3. choose insn that kills the most registers, ties broken by
- 4. choose insn that conflicts with the most ready insns, or finally
- 5. choose insn with lowest UID.
-
- Memory references complicate matters. Only if we can be certain
- that memory references are not part of the data dependency graph
- (via true, anti, or output dependence), can we move operations past
- memory references. To first approximation, reads can be done
- independently, while writes introduce dependencies. Better
- approximations will yield fewer dependencies.
-
- Dependencies set up by memory references are treated in exactly the
- same way as other dependencies, by using LOG_LINKS.
-
- Having optimized the critical path, we may have also unduly
- extended the lifetimes of some registers. If an operation requires
- that constants be loaded into registers, it is certainly desirable
- to load those constants as early as necessary, but no earlier.
- I.e., it will not do to load up a bunch of registers at the
- beginning of a basic block only to use them at the end, if they
- could be loaded later, since this may result in excessive register
- utilization.
-
- Note that since branches are never in basic blocks, but only end
- basic blocks, this pass will not do any branch scheduling. But
- that is ok, since we can use GNU's delayed branch scheduling
- pass to take care of this case.
-
- Also note that no further optimizations based on algebraic identities
- are performed, so this pass would be a good one to perform instruction
- splitting, such as breaking up a multiply instruction into shifts
- and adds where that is profitable.
-
- Given the memory aliasing analysis that this pass should perform,
- it should be possible to remove redundant stores to memory, and to
- load values from registers instead of hitting memory.
-
- This pass must update information that subsequent passes expect to be
- correct. Namely: reg_n_refs, reg_n_sets, reg_n_deaths,
- reg_n_calls_crossed, and reg_live_length. Also, BLOCK_HEAD,
- BLOCK_END.
-
- The information in the line number notes is carefully retained by
- this pass. Notes that refer to the starting and ending of
- exception regions are also carefully retained by this pass. All
- other NOTE insns are grouped in their same relative order at the
- beginning of basic blocks that have been scheduled. */
-
-#include "config.h"
-#include "system.h"
-#include "toplev.h"
-#include "rtl.h"
-#include "basic-block.h"
-#include "regs.h"
-#include "hard-reg-set.h"
-#include "flags.h"
-#include "insn-config.h"
-#include "insn-attr.h"
-#include "recog.h"
-
-#ifndef INSN_SCHEDULING
-void
-schedule_insns (dump_file)
- FILE *dump_file ATTRIBUTE_UNUSED;
-{
-}
-#else /* INSN_SCHEDULING -- rest of file */
-
-extern char *reg_known_equiv_p;
-extern rtx *reg_known_value;
-
-/* Arrays set up by scheduling for the same respective purposes as
- similar-named arrays set up by flow analysis. We work with these
- arrays during the scheduling pass so we can compare values against
- unscheduled code.
-
- Values of these arrays are copied at the end of this pass into the
- arrays set up by flow analysis. */
-static int *sched_reg_n_calls_crossed;
-static int *sched_reg_live_length;
-
-/* Element N is the next insn that sets (hard or pseudo) register
- N within the current basic block; or zero, if there is no
- such insn. Needed for new registers which may be introduced
- by splitting insns. */
-static rtx *reg_last_uses;
-static rtx *reg_last_sets;
-static regset reg_pending_sets;
-static int reg_pending_sets_all;
-
-/* Vector indexed by INSN_UID giving the original ordering of the insns. */
-static int *insn_luid;
-#define INSN_LUID(INSN) (insn_luid[INSN_UID (INSN)])
-
-/* Vector indexed by INSN_UID giving each instruction a priority. */
-static int *insn_priority;
-#define INSN_PRIORITY(INSN) (insn_priority[INSN_UID (INSN)])
-
-static short *insn_costs;
-#define INSN_COST(INSN) insn_costs[INSN_UID (INSN)]
-
-/* Vector indexed by INSN_UID giving an encoding of the function units
- used. */
-static short *insn_units;
-#define INSN_UNIT(INSN) insn_units[INSN_UID (INSN)]
-
-/* Vector indexed by INSN_UID giving an encoding of the blockage range
- function. The unit and the range are encoded. */
-static unsigned int *insn_blockage;
-#define INSN_BLOCKAGE(INSN) insn_blockage[INSN_UID (INSN)]
-#define UNIT_BITS 5
-#define BLOCKAGE_MASK ((1 << BLOCKAGE_BITS) - 1)
-#define ENCODE_BLOCKAGE(U,R) \
- ((((U) << UNIT_BITS) << BLOCKAGE_BITS \
- | MIN_BLOCKAGE_COST (R)) << BLOCKAGE_BITS \
- | MAX_BLOCKAGE_COST (R))
-#define UNIT_BLOCKED(B) ((B) >> (2 * BLOCKAGE_BITS))
-#define BLOCKAGE_RANGE(B) \
- (((((B) >> BLOCKAGE_BITS) & BLOCKAGE_MASK) << (HOST_BITS_PER_INT / 2)) \
- | ((B) & BLOCKAGE_MASK))
-
-/* Encodings of the `<name>_unit_blockage_range' function. */
-#define MIN_BLOCKAGE_COST(R) ((R) >> (HOST_BITS_PER_INT / 2))
-#define MAX_BLOCKAGE_COST(R) ((R) & ((1 << (HOST_BITS_PER_INT / 2)) - 1))
-
-#define DONE_PRIORITY -1
-#define MAX_PRIORITY 0x7fffffff
-#define TAIL_PRIORITY 0x7ffffffe
-#define LAUNCH_PRIORITY 0x7f000001
-#define DONE_PRIORITY_P(INSN) (INSN_PRIORITY (INSN) < 0)
-#define LOW_PRIORITY_P(INSN) ((INSN_PRIORITY (INSN) & 0x7f000000) == 0)
-
-/* Vector indexed by INSN_UID giving number of insns referring to this insn. */
-static int *insn_ref_count;
-#define INSN_REF_COUNT(INSN) (insn_ref_count[INSN_UID (INSN)])
-
-/* Vector indexed by INSN_UID giving line-number note in effect for each
- insn. For line-number notes, this indicates whether the note may be
- reused. */
-static rtx *line_note;
-#define LINE_NOTE(INSN) (line_note[INSN_UID (INSN)])
-
-/* Vector indexed by basic block number giving the starting line-number
- for each basic block. */
-static rtx *line_note_head;
-
-/* List of important notes we must keep around. This is a pointer to the
- last element in the list. */
-static rtx note_list;
-
-/* Regsets telling whether a given register is live or dead before the last
- scheduled insn. Must scan the instructions once before scheduling to
- determine what registers are live or dead at the end of the block. */
-static regset bb_dead_regs;
-static regset bb_live_regs;
-
-/* Regset telling whether a given register is live after the insn currently
- being scheduled. Before processing an insn, this is equal to bb_live_regs
- above. This is used so that we can find registers that are newly born/dead
- after processing an insn. */
-static regset old_live_regs;
-
-/* The chain of REG_DEAD notes. REG_DEAD notes are removed from all insns
- during the initial scan and reused later. If there are not exactly as
- many REG_DEAD notes in the post scheduled code as there were in the
- prescheduled code then we trigger an abort because this indicates a bug. */
-static rtx dead_notes;
-
-/* Queues, etc. */
-
-/* An instruction is ready to be scheduled when all insns following it
- have already been scheduled. It is important to ensure that all
- insns which use its result will not be executed until its result
- has been computed. An insn is maintained in one of four structures:
-
- (P) the "Pending" set of insns which cannot be scheduled until
- their dependencies have been satisfied.
- (Q) the "Queued" set of insns that can be scheduled when sufficient
- time has passed.
- (R) the "Ready" list of unscheduled, uncommitted insns.
- (S) the "Scheduled" list of insns.
-
- Initially, all insns are either "Pending" or "Ready" depending on
- whether their dependencies are satisfied.
-
- Insns move from the "Ready" list to the "Scheduled" list as they
- are committed to the schedule. As this occurs, the insns in the
- "Pending" list have their dependencies satisfied and move to either
- the "Ready" list or the "Queued" set depending on whether
- sufficient time has passed to make them ready. As time passes,
- insns move from the "Queued" set to the "Ready" list. Insns may
- move from the "Ready" list to the "Queued" set if they are blocked
- due to a function unit conflict.
-
- The "Pending" list (P) are the insns in the LOG_LINKS of the unscheduled
- insns, i.e., those that are ready, queued, and pending.
- The "Queued" set (Q) is implemented by the variable `insn_queue'.
- The "Ready" list (R) is implemented by the variables `ready' and
- `n_ready'.
- The "Scheduled" list (S) is the new insn chain built by this pass.
-
- The transition (R->S) is implemented in the scheduling loop in
- `schedule_block' when the best insn to schedule is chosen.
- The transition (R->Q) is implemented in `schedule_select' when an
- insn is found to have a function unit conflict with the already
- committed insns.
- The transitions (P->R and P->Q) are implemented in `schedule_insn' as
- insns move from the ready list to the scheduled list.
- The transition (Q->R) is implemented at the top of the scheduling
- loop in `schedule_block' as time passes or stalls are introduced. */
-
-/* Implement a circular buffer to delay instructions until sufficient
- time has passed. INSN_QUEUE_SIZE is a power of two larger than
- MAX_BLOCKAGE and MAX_READY_COST computed by genattr.c. This is the
- longest time an isnsn may be queued. */
-static rtx insn_queue[INSN_QUEUE_SIZE];
-static int q_ptr = 0;
-static int q_size = 0;
-#define NEXT_Q(X) (((X)+1) & (INSN_QUEUE_SIZE-1))
-#define NEXT_Q_AFTER(X,C) (((X)+C) & (INSN_QUEUE_SIZE-1))
-
-/* Vector indexed by INSN_UID giving the minimum clock tick at which
- the insn becomes ready. This is used to note timing constraints for
- insns in the pending list. */
-static int *insn_tick;
-#define INSN_TICK(INSN) (insn_tick[INSN_UID (INSN)])
-
-/* Data structure for keeping track of register information
- during that register's life. */
-
-struct sometimes
-{
- int regno;
- int live_length;
- int calls_crossed;
-};
-
-/* Forward declarations. */
-static void add_dependence PROTO((rtx, rtx, enum reg_note));
-static void remove_dependence PROTO((rtx, rtx));
-static rtx find_insn_list PROTO((rtx, rtx));
-static int insn_unit PROTO((rtx));
-static unsigned int blockage_range PROTO((int, rtx));
-static void clear_units PROTO((void));
-static void prepare_unit PROTO((int));
-static int actual_hazard_this_instance PROTO((int, int, rtx, int, int));
-static void schedule_unit PROTO((int, rtx, int));
-static int actual_hazard PROTO((int, rtx, int, int));
-static int potential_hazard PROTO((int, rtx, int));
-static int insn_cost PROTO((rtx, rtx, rtx));
-static int priority PROTO((rtx));
-static void free_pending_lists PROTO((void));
-static void add_insn_mem_dependence PROTO((rtx *, rtx *, rtx, rtx));
-static void flush_pending_lists PROTO((rtx, int));
-static void sched_analyze_1 PROTO((rtx, rtx));
-static void sched_analyze_2 PROTO((rtx, rtx));
-static void sched_analyze_insn PROTO((rtx, rtx, rtx));
-static int sched_analyze PROTO((rtx, rtx));
-static void sched_note_set PROTO((rtx, int));
-static int rank_for_schedule PROTO((const GENERIC_PTR, const GENERIC_PTR));
-static void swap_sort PROTO((rtx *, int));
-static void queue_insn PROTO((rtx, int));
-static int birthing_insn_p PROTO((rtx));
-static void adjust_priority PROTO((rtx));
-static int schedule_insn PROTO((rtx, rtx *, int, int));
-static int schedule_select PROTO((rtx *, int, int, FILE *));
-static void create_reg_dead_note PROTO((rtx, rtx));
-static void attach_deaths PROTO((rtx, rtx, int));
-static void attach_deaths_insn PROTO((rtx));
-static rtx unlink_notes PROTO((rtx, rtx));
-static int new_sometimes_live PROTO((struct sometimes *, int, int));
-static void finish_sometimes_live PROTO((struct sometimes *, int));
-static rtx reemit_notes PROTO((rtx, rtx));
-static void schedule_block PROTO((int, FILE *));
-static void split_hard_reg_notes PROTO((rtx, rtx, rtx));
-static void new_insn_dead_notes PROTO((rtx, rtx, rtx, rtx));
-static void update_n_sets PROTO((rtx, int));
-
-/* Main entry point of this file. */
-void schedule_insns PROTO((FILE *));
-
-#define SIZE_FOR_MODE(X) (GET_MODE_SIZE (GET_MODE (X)))
-
-/* Helper functions for instruction scheduling. */
-
-/* Add ELEM wrapped in an INSN_LIST with reg note kind DEP_TYPE to the
- LOG_LINKS of INSN, if not already there. DEP_TYPE indicates the type
- of dependence that this link represents. */
-
-static void
-add_dependence (insn, elem, dep_type)
- rtx insn;
- rtx elem;
- enum reg_note dep_type;
-{
- rtx link, next;
-
- /* Don't depend an insn on itself. */
- if (insn == elem)
- return;
-
- /* If elem is part of a sequence that must be scheduled together, then
- make the dependence point to the last insn of the sequence.
- When HAVE_cc0, it is possible for NOTEs to exist between users and
- setters of the condition codes, so we must skip past notes here.
- Otherwise, NOTEs are impossible here. */
-
- next = NEXT_INSN (elem);
-
-#ifdef HAVE_cc0
- while (next && GET_CODE (next) == NOTE)
- next = NEXT_INSN (next);
-#endif
-
- if (next && SCHED_GROUP_P (next)
- && GET_CODE (next) != CODE_LABEL)
- {
- /* Notes will never intervene here though, so don't bother checking
- for them. */
- /* We must reject CODE_LABELs, so that we don't get confused by one
- that has LABEL_PRESERVE_P set, which is represented by the same
- bit in the rtl as SCHED_GROUP_P. A CODE_LABEL can never be
- SCHED_GROUP_P. */
- while (NEXT_INSN (next) && SCHED_GROUP_P (NEXT_INSN (next))
- && GET_CODE (NEXT_INSN (next)) != CODE_LABEL)
- next = NEXT_INSN (next);
-
- /* Again, don't depend an insn on itself. */
- if (insn == next)
- return;
-
- /* Make the dependence to NEXT, the last insn of the group, instead
- of the original ELEM. */
- elem = next;
- }
-
- /* Check that we don't already have this dependence. */
- for (link = LOG_LINKS (insn); link; link = XEXP (link, 1))
- if (XEXP (link, 0) == elem)
- {
- /* If this is a more restrictive type of dependence than the existing
- one, then change the existing dependence to this type. */
- if ((int) dep_type < (int) REG_NOTE_KIND (link))
- PUT_REG_NOTE_KIND (link, dep_type);
- return;
- }
- /* Might want to check one level of transitivity to save conses. */
-
- link = rtx_alloc (INSN_LIST);
- /* Insn dependency, not data dependency. */
- PUT_REG_NOTE_KIND (link, dep_type);
- XEXP (link, 0) = elem;
- XEXP (link, 1) = LOG_LINKS (insn);
- LOG_LINKS (insn) = link;
-}
-
-/* Remove ELEM wrapped in an INSN_LIST from the LOG_LINKS
- of INSN. Abort if not found. */
-
-static void
-remove_dependence (insn, elem)
- rtx insn;
- rtx elem;
-{
- rtx prev, link;
- int found = 0;
-
- for (prev = 0, link = LOG_LINKS (insn); link; link = XEXP (link, 1))
- {
- if (XEXP (link, 0) == elem)
- {
- RTX_INTEGRATED_P (link) = 1;
- if (prev)
- XEXP (prev, 1) = XEXP (link, 1);
- else
- LOG_LINKS (insn) = XEXP (link, 1);
- found = 1;
- }
- else
- prev = link;
- }
-
- if (! found)
- abort ();
- return;
-}
-
-#ifndef __GNUC__
-#define __inline
-#endif
-
-/* Computation of memory dependencies. */
-
-/* The *_insns and *_mems are paired lists. Each pending memory operation
- will have a pointer to the MEM rtx on one list and a pointer to the
- containing insn on the other list in the same place in the list. */
-
-/* We can't use add_dependence like the old code did, because a single insn
- may have multiple memory accesses, and hence needs to be on the list
- once for each memory access. Add_dependence won't let you add an insn
- to a list more than once. */
-
-/* An INSN_LIST containing all insns with pending read operations. */
-static rtx pending_read_insns;
-
-/* An EXPR_LIST containing all MEM rtx's which are pending reads. */
-static rtx pending_read_mems;
-
-/* An INSN_LIST containing all insns with pending write operations. */
-static rtx pending_write_insns;
-
-/* An EXPR_LIST containing all MEM rtx's which are pending writes. */
-static rtx pending_write_mems;
-
-/* Indicates the combined length of the two pending lists. We must prevent
- these lists from ever growing too large since the number of dependencies
- produced is at least O(N*N), and execution time is at least O(4*N*N), as
- a function of the length of these pending lists. */
-
-static int pending_lists_length;
-
-/* An INSN_LIST containing all INSN_LISTs allocated but currently unused. */
-
-static rtx unused_insn_list;
-
-/* An EXPR_LIST containing all EXPR_LISTs allocated but currently unused. */
-
-static rtx unused_expr_list;
-
-/* The last insn upon which all memory references must depend.
- This is an insn which flushed the pending lists, creating a dependency
- between it and all previously pending memory references. This creates
- a barrier (or a checkpoint) which no memory reference is allowed to cross.
-
- This includes all non constant CALL_INSNs. When we do interprocedural
- alias analysis, this restriction can be relaxed.
- This may also be an INSN that writes memory if the pending lists grow
- too large. */
-
-static rtx last_pending_memory_flush;
-
-/* The last function call we have seen. All hard regs, and, of course,
- the last function call, must depend on this. */
-
-static rtx last_function_call;
-
-/* The LOG_LINKS field of this is a list of insns which use a pseudo register
- that does not already cross a call. We create dependencies between each
- of those insn and the next call insn, to ensure that they won't cross a call
- after scheduling is done. */
-
-static rtx sched_before_next_call;
-
-/* Pointer to the last instruction scheduled. Used by rank_for_schedule,
- so that insns independent of the last scheduled insn will be preferred
- over dependent instructions. */
-
-static rtx last_scheduled_insn;
-
-/* Process an insn's memory dependencies. There are four kinds of
- dependencies:
-
- (0) read dependence: read follows read
- (1) true dependence: read follows write
- (2) anti dependence: write follows read
- (3) output dependence: write follows write
-
- We are careful to build only dependencies which actually exist, and
- use transitivity to avoid building too many links. */
-
-/* Return the INSN_LIST containing INSN in LIST, or NULL
- if LIST does not contain INSN. */
-
-__inline static rtx
-find_insn_list (insn, list)
- rtx insn;
- rtx list;
-{
- while (list)
- {
- if (XEXP (list, 0) == insn)
- return list;
- list = XEXP (list, 1);
- }
- return 0;
-}
-
-/* Compute the function units used by INSN. This caches the value
- returned by function_units_used. A function unit is encoded as the
- unit number if the value is non-negative and the compliment of a
- mask if the value is negative. A function unit index is the
- non-negative encoding. */
-
-__inline static int
-insn_unit (insn)
- rtx insn;
-{
- register int unit = INSN_UNIT (insn);
-
- if (unit == 0)
- {
- recog_memoized (insn);
-
- /* A USE insn, or something else we don't need to understand.
- We can't pass these directly to function_units_used because it will
- trigger a fatal error for unrecognizable insns. */
- if (INSN_CODE (insn) < 0)
- unit = -1;
- else
- {
- unit = function_units_used (insn);
- /* Increment non-negative values so we can cache zero. */
- if (unit >= 0) unit++;
- }
- /* We only cache 16 bits of the result, so if the value is out of
- range, don't cache it. */
- if (FUNCTION_UNITS_SIZE < HOST_BITS_PER_SHORT
- || unit >= 0
- || (unit & ~((1 << (HOST_BITS_PER_SHORT - 1)) - 1)) == 0)
- INSN_UNIT (insn) = unit;
- }
- return (unit > 0 ? unit - 1 : unit);
-}
-
-/* Compute the blockage range for executing INSN on UNIT. This caches
- the value returned by the blockage_range_function for the unit.
- These values are encoded in an int where the upper half gives the
- minimum value and the lower half gives the maximum value. */
-
-__inline static unsigned int
-blockage_range (unit, insn)
- int unit;
- rtx insn;
-{
- unsigned int blockage = INSN_BLOCKAGE (insn);
- unsigned int range;
-
- if ((int) UNIT_BLOCKED (blockage) != unit + 1)
- {
- range = function_units[unit].blockage_range_function (insn);
- /* We only cache the blockage range for one unit and then only if
- the values fit. */
- if (HOST_BITS_PER_INT >= UNIT_BITS + 2 * BLOCKAGE_BITS)
- INSN_BLOCKAGE (insn) = ENCODE_BLOCKAGE (unit + 1, range);
- }
- else
- range = BLOCKAGE_RANGE (blockage);
-
- return range;
-}
-
-/* A vector indexed by function unit instance giving the last insn to use
- the unit. The value of the function unit instance index for unit U
- instance I is (U + I * FUNCTION_UNITS_SIZE). */
-static rtx unit_last_insn[FUNCTION_UNITS_SIZE * MAX_MULTIPLICITY];
-
-/* A vector indexed by function unit instance giving the minimum time when
- the unit will unblock based on the maximum blockage cost. */
-static int unit_tick[FUNCTION_UNITS_SIZE * MAX_MULTIPLICITY];
-
-/* A vector indexed by function unit number giving the number of insns
- that remain to use the unit. */
-static int unit_n_insns[FUNCTION_UNITS_SIZE];
-
-/* Reset the function unit state to the null state. */
-
-static void
-clear_units ()
-{
- bzero ((char *) unit_last_insn, sizeof (unit_last_insn));
- bzero ((char *) unit_tick, sizeof (unit_tick));
- bzero ((char *) unit_n_insns, sizeof (unit_n_insns));
-}
-
-/* Record an insn as one that will use the units encoded by UNIT. */
-
-__inline static void
-prepare_unit (unit)
- int unit;
-{
- int i;
-
- if (unit >= 0)
- unit_n_insns[unit]++;
- else
- for (i = 0, unit = ~unit; unit; i++, unit >>= 1)
- if ((unit & 1) != 0)
- prepare_unit (i);
-}
-
-/* Return the actual hazard cost of executing INSN on the unit UNIT,
- instance INSTANCE at time CLOCK if the previous actual hazard cost
- was COST. */
-
-__inline static int
-actual_hazard_this_instance (unit, instance, insn, clock, cost)
- int unit, instance, clock, cost;
- rtx insn;
-{
- int tick = unit_tick[instance];
-
- if (tick - clock > cost)
- {
- /* The scheduler is operating in reverse, so INSN is the executing
- insn and the unit's last insn is the candidate insn. We want a
- more exact measure of the blockage if we execute INSN at CLOCK
- given when we committed the execution of the unit's last insn.
-
- The blockage value is given by either the unit's max blockage
- constant, blockage range function, or blockage function. Use
- the most exact form for the given unit. */
-
- if (function_units[unit].blockage_range_function)
- {
- if (function_units[unit].blockage_function)
- tick += (function_units[unit].blockage_function
- (insn, unit_last_insn[instance])
- - function_units[unit].max_blockage);
- else
- tick += ((int) MAX_BLOCKAGE_COST (blockage_range (unit, insn))
- - function_units[unit].max_blockage);
- }
- if (tick - clock > cost)
- cost = tick - clock;
- }
- return cost;
-}
-
-/* Record INSN as having begun execution on the units encoded by UNIT at
- time CLOCK. */
-
-__inline static void
-schedule_unit (unit, insn, clock)
- int unit, clock;
- rtx insn;
-{
- int i;
-
- if (unit >= 0)
- {
- int instance = unit;
-#if MAX_MULTIPLICITY > 1
- /* Find the first free instance of the function unit and use that
- one. We assume that one is free. */
- for (i = function_units[unit].multiplicity - 1; i > 0; i--)
- {
- if (! actual_hazard_this_instance (unit, instance, insn, clock, 0))
- break;
- instance += FUNCTION_UNITS_SIZE;
- }
-#endif
- unit_last_insn[instance] = insn;
- unit_tick[instance] = (clock + function_units[unit].max_blockage);
- }
- else
- for (i = 0, unit = ~unit; unit; i++, unit >>= 1)
- if ((unit & 1) != 0)
- schedule_unit (i, insn, clock);
-}
-
-/* Return the actual hazard cost of executing INSN on the units encoded by
- UNIT at time CLOCK if the previous actual hazard cost was COST. */
-
-__inline static int
-actual_hazard (unit, insn, clock, cost)
- int unit, clock, cost;
- rtx insn;
-{
- int i;
-
- if (unit >= 0)
- {
- /* Find the instance of the function unit with the minimum hazard. */
- int instance = unit;
- int best_cost = actual_hazard_this_instance (unit, instance, insn,
- clock, cost);
-#if MAX_MULTIPLICITY > 1
- int this_cost;
-
- if (best_cost > cost)
- {
- for (i = function_units[unit].multiplicity - 1; i > 0; i--)
- {
- instance += FUNCTION_UNITS_SIZE;
- this_cost = actual_hazard_this_instance (unit, instance, insn,
- clock, cost);
- if (this_cost < best_cost)
- {
- best_cost = this_cost;
- if (this_cost <= cost)
- break;
- }
- }
- }
-#endif
- cost = MAX (cost, best_cost);
- }
- else
- for (i = 0, unit = ~unit; unit; i++, unit >>= 1)
- if ((unit & 1) != 0)
- cost = actual_hazard (i, insn, clock, cost);
-
- return cost;
-}
-
-/* Return the potential hazard cost of executing an instruction on the
- units encoded by UNIT if the previous potential hazard cost was COST.
- An insn with a large blockage time is chosen in preference to one
- with a smaller time; an insn that uses a unit that is more likely
- to be used is chosen in preference to one with a unit that is less
- used. We are trying to minimize a subsequent actual hazard. */
-
-__inline static int
-potential_hazard (unit, insn, cost)
- int unit, cost;
- rtx insn;
-{
- int i, ncost;
- unsigned int minb, maxb;
-
- if (unit >= 0)
- {
- minb = maxb = function_units[unit].max_blockage;
- if (maxb > 1)
- {
- if (function_units[unit].blockage_range_function)
- {
- maxb = minb = blockage_range (unit, insn);
- maxb = MAX_BLOCKAGE_COST (maxb);
- minb = MIN_BLOCKAGE_COST (minb);
- }
-
- if (maxb > 1)
- {
- /* Make the number of instructions left dominate. Make the
- minimum delay dominate the maximum delay. If all these
- are the same, use the unit number to add an arbitrary
- ordering. Other terms can be added. */
- ncost = minb * 0x40 + maxb;
- ncost *= (unit_n_insns[unit] - 1) * 0x1000 + unit;
- if (ncost > cost)
- cost = ncost;
- }
- }
- }
- else
- for (i = 0, unit = ~unit; unit; i++, unit >>= 1)
- if ((unit & 1) != 0)
- cost = potential_hazard (i, insn, cost);
-
- return cost;
-}
-
-/* Compute cost of executing INSN given the dependence LINK on the insn USED.
- This is the number of virtual cycles taken between instruction issue and
- instruction results. */
-
-__inline static int
-insn_cost (insn, link, used)
- rtx insn, link, used;
-{
- register int cost = INSN_COST (insn);
-
- if (cost == 0)
- {
- recog_memoized (insn);
-
- /* A USE insn, or something else we don't need to understand.
- We can't pass these directly to result_ready_cost because it will
- trigger a fatal error for unrecognizable insns. */
- if (INSN_CODE (insn) < 0)
- {
- INSN_COST (insn) = 1;
- return 1;
- }
- else
- {
- cost = result_ready_cost (insn);
-
- if (cost < 1)
- cost = 1;
-
- INSN_COST (insn) = cost;
- }
- }
-
- /* A USE insn should never require the value used to be computed. This
- allows the computation of a function's result and parameter values to
- overlap the return and call. */
- recog_memoized (used);
- if (INSN_CODE (used) < 0)
- LINK_COST_FREE (link) = 1;
-
- /* If some dependencies vary the cost, compute the adjustment. Most
- commonly, the adjustment is complete: either the cost is ignored
- (in the case of an output- or anti-dependence), or the cost is
- unchanged. These values are cached in the link as LINK_COST_FREE
- and LINK_COST_ZERO. */
-
- if (LINK_COST_FREE (link))
- cost = 1;
-#ifdef ADJUST_COST
- else if (! LINK_COST_ZERO (link))
- {
- int ncost = cost;
-
- ADJUST_COST (used, link, insn, ncost);
- if (ncost <= 1)
- LINK_COST_FREE (link) = ncost = 1;
- if (cost == ncost)
- LINK_COST_ZERO (link) = 1;
- cost = ncost;
- }
-#endif
- return cost;
-}
-
-/* Compute the priority number for INSN. */
-
-static int
-priority (insn)
- rtx insn;
-{
- if (insn && GET_RTX_CLASS (GET_CODE (insn)) == 'i')
- {
- int prev_priority;
- int max_priority;
- int this_priority = INSN_PRIORITY (insn);
- rtx prev;
-
- if (this_priority > 0)
- return this_priority;
-
- max_priority = 1;
-
- /* Nonzero if these insns must be scheduled together. */
- if (SCHED_GROUP_P (insn))
- {
- prev = insn;
- while (SCHED_GROUP_P (prev))
- {
- prev = PREV_INSN (prev);
- INSN_REF_COUNT (prev) += 1;
- }
- }
-
- for (prev = LOG_LINKS (insn); prev; prev = XEXP (prev, 1))
- {
- rtx x = XEXP (prev, 0);
-
- /* If this was a duplicate of a dependence we already deleted,
- ignore it. */
- if (RTX_INTEGRATED_P (prev))
- continue;
-
- /* A dependence pointing to a note or deleted insn is always
- obsolete, because sched_analyze_insn will have created any
- necessary new dependences which replace it. Notes and deleted
- insns can be created when instructions are deleted by insn
- splitting, or by register allocation. */
- if (GET_CODE (x) == NOTE || INSN_DELETED_P (x))
- {
- remove_dependence (insn, x);
- continue;
- }
-
- /* Clear the link cost adjustment bits. */
- LINK_COST_FREE (prev) = 0;
-#ifdef ADJUST_COST
- LINK_COST_ZERO (prev) = 0;
-#endif
-
- /* This priority calculation was chosen because it results in the
- least instruction movement, and does not hurt the performance
- of the resulting code compared to the old algorithm.
- This makes the sched algorithm more stable, which results
- in better code, because there is less register pressure,
- cross jumping is more likely to work, and debugging is easier.
-
- When all instructions have a latency of 1, there is no need to
- move any instructions. Subtracting one here ensures that in such
- cases all instructions will end up with a priority of one, and
- hence no scheduling will be done.
-
- The original code did not subtract the one, and added the
- insn_cost of the current instruction to its priority (e.g.
- move the insn_cost call down to the end). */
-
- prev_priority = priority (x) + insn_cost (x, prev, insn) - 1;
-
- if (prev_priority > max_priority)
- max_priority = prev_priority;
- INSN_REF_COUNT (x) += 1;
- }
-
- prepare_unit (insn_unit (insn));
- INSN_PRIORITY (insn) = max_priority;
- return INSN_PRIORITY (insn);
- }
- return 0;
-}
-
-/* Remove all INSN_LISTs and EXPR_LISTs from the pending lists and add
- them to the unused_*_list variables, so that they can be reused. */
-
-static void
-free_pending_lists ()
-{
- register rtx link, prev_link;
-
- if (pending_read_insns)
- {
- prev_link = pending_read_insns;
- link = XEXP (prev_link, 1);
-
- while (link)
- {
- prev_link = link;
- link = XEXP (link, 1);
- }
-
- XEXP (prev_link, 1) = unused_insn_list;
- unused_insn_list = pending_read_insns;
- pending_read_insns = 0;
- }
-
- if (pending_write_insns)
- {
- prev_link = pending_write_insns;
- link = XEXP (prev_link, 1);
-
- while (link)
- {
- prev_link = link;
- link = XEXP (link, 1);
- }
-
- XEXP (prev_link, 1) = unused_insn_list;
- unused_insn_list = pending_write_insns;
- pending_write_insns = 0;
- }
-
- if (pending_read_mems)
- {
- prev_link = pending_read_mems;
- link = XEXP (prev_link, 1);
-
- while (link)
- {
- prev_link = link;
- link = XEXP (link, 1);
- }
-
- XEXP (prev_link, 1) = unused_expr_list;
- unused_expr_list = pending_read_mems;
- pending_read_mems = 0;
- }
-
- if (pending_write_mems)
- {
- prev_link = pending_write_mems;
- link = XEXP (prev_link, 1);
-
- while (link)
- {
- prev_link = link;
- link = XEXP (link, 1);
- }
-
- XEXP (prev_link, 1) = unused_expr_list;
- unused_expr_list = pending_write_mems;
- pending_write_mems = 0;
- }
-}
-
-/* Add an INSN and MEM reference pair to a pending INSN_LIST and MEM_LIST.
- The MEM is a memory reference contained within INSN, which we are saving
- so that we can do memory aliasing on it. */
-
-static void
-add_insn_mem_dependence (insn_list, mem_list, insn, mem)
- rtx *insn_list, *mem_list, insn, mem;
-{
- register rtx link;
-
- if (unused_insn_list)
- {
- link = unused_insn_list;
- unused_insn_list = XEXP (link, 1);
- }
- else
- link = rtx_alloc (INSN_LIST);
- XEXP (link, 0) = insn;
- XEXP (link, 1) = *insn_list;
- *insn_list = link;
-
- if (unused_expr_list)
- {
- link = unused_expr_list;
- unused_expr_list = XEXP (link, 1);
- }
- else
- link = rtx_alloc (EXPR_LIST);
- XEXP (link, 0) = mem;
- XEXP (link, 1) = *mem_list;
- *mem_list = link;
-
- pending_lists_length++;
-}
-
-/* Make a dependency between every memory reference on the pending lists
- and INSN, thus flushing the pending lists. If ONLY_WRITE, don't flush
- the read list. */
-
-static void
-flush_pending_lists (insn, only_write)
- rtx insn;
- int only_write;
-{
- rtx link;
-
- while (pending_read_insns && ! only_write)
- {
- add_dependence (insn, XEXP (pending_read_insns, 0), REG_DEP_ANTI);
-
- link = pending_read_insns;
- pending_read_insns = XEXP (pending_read_insns, 1);
- XEXP (link, 1) = unused_insn_list;
- unused_insn_list = link;
-
- link = pending_read_mems;
- pending_read_mems = XEXP (pending_read_mems, 1);
- XEXP (link, 1) = unused_expr_list;
- unused_expr_list = link;
- }
- while (pending_write_insns)
- {
- add_dependence (insn, XEXP (pending_write_insns, 0), REG_DEP_ANTI);
-
- link = pending_write_insns;
- pending_write_insns = XEXP (pending_write_insns, 1);
- XEXP (link, 1) = unused_insn_list;
- unused_insn_list = link;
-
- link = pending_write_mems;
- pending_write_mems = XEXP (pending_write_mems, 1);
- XEXP (link, 1) = unused_expr_list;
- unused_expr_list = link;
- }
- pending_lists_length = 0;
-
- if (last_pending_memory_flush)
- add_dependence (insn, last_pending_memory_flush, REG_DEP_ANTI);
-
- last_pending_memory_flush = insn;
-}
-
-/* Analyze a single SET or CLOBBER rtx, X, creating all dependencies generated
- by the write to the destination of X, and reads of everything mentioned. */
-
-static void
-sched_analyze_1 (x, insn)
- rtx x;
- rtx insn;
-{
- register int regno;
- register rtx dest = SET_DEST (x);
-
- if (dest == 0)
- return;
-
- while (GET_CODE (dest) == STRICT_LOW_PART || GET_CODE (dest) == SUBREG
- || GET_CODE (dest) == ZERO_EXTRACT || GET_CODE (dest) == SIGN_EXTRACT)
- {
- if (GET_CODE (dest) == ZERO_EXTRACT || GET_CODE (dest) == SIGN_EXTRACT)
- {
- /* The second and third arguments are values read by this insn. */
- sched_analyze_2 (XEXP (dest, 1), insn);
- sched_analyze_2 (XEXP (dest, 2), insn);
- }
- dest = SUBREG_REG (dest);
- }
-
- if (GET_CODE (dest) == REG)
- {
- register int i;
-
- regno = REGNO (dest);
-
- /* A hard reg in a wide mode may really be multiple registers.
- If so, mark all of them just like the first. */
- if (regno < FIRST_PSEUDO_REGISTER)
- {
- i = HARD_REGNO_NREGS (regno, GET_MODE (dest));
- while (--i >= 0)
- {
- rtx u;
-
- for (u = reg_last_uses[regno+i]; u; u = XEXP (u, 1))
- add_dependence (insn, XEXP (u, 0), REG_DEP_ANTI);
- reg_last_uses[regno + i] = 0;
- if (reg_last_sets[regno + i])
- add_dependence (insn, reg_last_sets[regno + i],
- REG_DEP_OUTPUT);
- SET_REGNO_REG_SET (reg_pending_sets, regno + i);
- if ((call_used_regs[i] || global_regs[i])
- && last_function_call)
- /* Function calls clobber all call_used regs. */
- add_dependence (insn, last_function_call, REG_DEP_ANTI);
- }
- }
- else
- {
- rtx u;
-
- for (u = reg_last_uses[regno]; u; u = XEXP (u, 1))
- add_dependence (insn, XEXP (u, 0), REG_DEP_ANTI);
- reg_last_uses[regno] = 0;
- if (reg_last_sets[regno])
- add_dependence (insn, reg_last_sets[regno], REG_DEP_OUTPUT);
- SET_REGNO_REG_SET (reg_pending_sets, regno);
-
- /* Pseudos that are REG_EQUIV to something may be replaced
- by that during reloading. We need only add dependencies for
- the address in the REG_EQUIV note. */
- if (! reload_completed
- && reg_known_equiv_p[regno]
- && GET_CODE (reg_known_value[regno]) == MEM)
- sched_analyze_2 (XEXP (reg_known_value[regno], 0), insn);
-
- /* Don't let it cross a call after scheduling if it doesn't
- already cross one. */
- if (REG_N_CALLS_CROSSED (regno) == 0 && last_function_call)
- add_dependence (insn, last_function_call, REG_DEP_ANTI);
- }
- }
- else if (GET_CODE (dest) == MEM)
- {
- /* Writing memory. */
-
- if (pending_lists_length > 32)
- {
- /* Flush all pending reads and writes to prevent the pending lists
- from getting any larger. Insn scheduling runs too slowly when
- these lists get long. The number 32 was chosen because it
- seems like a reasonable number. When compiling GCC with itself,
- this flush occurs 8 times for sparc, and 10 times for m88k using
- the number 32. */
- flush_pending_lists (insn, 0);
- }
- else
- {
- rtx pending, pending_mem;
-
- pending = pending_read_insns;
- pending_mem = pending_read_mems;
- while (pending)
- {
- /* If a dependency already exists, don't create a new one. */
- if (! find_insn_list (XEXP (pending, 0), LOG_LINKS (insn)))
- if (anti_dependence (XEXP (pending_mem, 0), dest))
- add_dependence (insn, XEXP (pending, 0), REG_DEP_ANTI);
-
- pending = XEXP (pending, 1);
- pending_mem = XEXP (pending_mem, 1);
- }
-
- pending = pending_write_insns;
- pending_mem = pending_write_mems;
- while (pending)
- {
- /* If a dependency already exists, don't create a new one. */
- if (! find_insn_list (XEXP (pending, 0), LOG_LINKS (insn)))
- if (output_dependence (XEXP (pending_mem, 0), dest))
- add_dependence (insn, XEXP (pending, 0), REG_DEP_OUTPUT);
-
- pending = XEXP (pending, 1);
- pending_mem = XEXP (pending_mem, 1);
- }
-
- if (last_pending_memory_flush)
- add_dependence (insn, last_pending_memory_flush, REG_DEP_ANTI);
-
- add_insn_mem_dependence (&pending_write_insns, &pending_write_mems,
- insn, dest);
- }
- sched_analyze_2 (XEXP (dest, 0), insn);
- }
-
- /* Analyze reads. */
- if (GET_CODE (x) == SET)
- sched_analyze_2 (SET_SRC (x), insn);
-}
-
-/* Analyze the uses of memory and registers in rtx X in INSN. */
-
-static void
-sched_analyze_2 (x, insn)
- rtx x;
- rtx insn;
-{
- register int i;
- register int j;
- register enum rtx_code code;
- register char *fmt;
-
- if (x == 0)
- return;
-
- code = GET_CODE (x);
-
- switch (code)
- {
- case CONST_INT:
- case CONST_DOUBLE:
- case SYMBOL_REF:
- case CONST:
- case LABEL_REF:
- /* Ignore constants. Note that we must handle CONST_DOUBLE here
- because it may have a cc0_rtx in its CONST_DOUBLE_CHAIN field, but
- this does not mean that this insn is using cc0. */
- return;
-
-#ifdef HAVE_cc0
- case CC0:
- {
- rtx link, prev;
-
- /* User of CC0 depends on immediately preceding insn. */
- SCHED_GROUP_P (insn) = 1;
-
- /* There may be a note before this insn now, but all notes will
- be removed before we actually try to schedule the insns, so
- it won't cause a problem later. We must avoid it here though. */
- prev = prev_nonnote_insn (insn);
-
- /* Make a copy of all dependencies on the immediately previous insn,
- and add to this insn. This is so that all the dependencies will
- apply to the group. Remove an explicit dependence on this insn
- as SCHED_GROUP_P now represents it. */
-
- if (find_insn_list (prev, LOG_LINKS (insn)))
- remove_dependence (insn, prev);
-
- for (link = LOG_LINKS (prev); link; link = XEXP (link, 1))
- add_dependence (insn, XEXP (link, 0), REG_NOTE_KIND (link));
-
- return;
- }
-#endif
-
- case REG:
- {
- int regno = REGNO (x);
- if (regno < FIRST_PSEUDO_REGISTER)
- {
- int i;
-
- i = HARD_REGNO_NREGS (regno, GET_MODE (x));
- while (--i >= 0)
- {
- reg_last_uses[regno + i]
- = gen_rtx_INSN_LIST (VOIDmode,
- insn, reg_last_uses[regno + i]);
- if (reg_last_sets[regno + i])
- add_dependence (insn, reg_last_sets[regno + i], 0);
- if ((call_used_regs[regno + i] || global_regs[regno + i])
- && last_function_call)
- /* Function calls clobber all call_used regs. */
- add_dependence (insn, last_function_call, REG_DEP_ANTI);
- }
- }
- else
- {
- reg_last_uses[regno]
- = gen_rtx_INSN_LIST (VOIDmode, insn, reg_last_uses[regno]);
- if (reg_last_sets[regno])
- add_dependence (insn, reg_last_sets[regno], 0);
-
- /* Pseudos that are REG_EQUIV to something may be replaced
- by that during reloading. We need only add dependencies for
- the address in the REG_EQUIV note. */
- if (! reload_completed
- && reg_known_equiv_p[regno]
- && GET_CODE (reg_known_value[regno]) == MEM)
- sched_analyze_2 (XEXP (reg_known_value[regno], 0), insn);
-
- /* If the register does not already cross any calls, then add this
- insn to the sched_before_next_call list so that it will still
- not cross calls after scheduling. */
- if (REG_N_CALLS_CROSSED (regno) == 0)
- add_dependence (sched_before_next_call, insn, REG_DEP_ANTI);
- }
- return;
- }
-
- case MEM:
- {
- /* Reading memory. */
-
- rtx pending, pending_mem;
-
- pending = pending_read_insns;
- pending_mem = pending_read_mems;
- while (pending)
- {
- /* If a dependency already exists, don't create a new one. */
- if (! find_insn_list (XEXP (pending, 0), LOG_LINKS (insn)))
- if (read_dependence (XEXP (pending_mem, 0), x))
- add_dependence (insn, XEXP (pending, 0), REG_DEP_ANTI);
-
- pending = XEXP (pending, 1);
- pending_mem = XEXP (pending_mem, 1);
- }
-
- pending = pending_write_insns;
- pending_mem = pending_write_mems;
- while (pending)
- {
- /* If a dependency already exists, don't create a new one. */
- if (! find_insn_list (XEXP (pending, 0), LOG_LINKS (insn)))
- if (true_dependence (XEXP (pending_mem, 0), VOIDmode,
- x, rtx_varies_p))
- add_dependence (insn, XEXP (pending, 0), 0);
-
- pending = XEXP (pending, 1);
- pending_mem = XEXP (pending_mem, 1);
- }
- if (last_pending_memory_flush)
- add_dependence (insn, last_pending_memory_flush, REG_DEP_ANTI);
-
- /* Always add these dependencies to pending_reads, since
- this insn may be followed by a write. */
- add_insn_mem_dependence (&pending_read_insns, &pending_read_mems,
- insn, x);
-
- /* Take advantage of tail recursion here. */
- sched_analyze_2 (XEXP (x, 0), insn);
- return;
- }
-
- case ASM_OPERANDS:
- case ASM_INPUT:
- case UNSPEC_VOLATILE:
- case TRAP_IF:
- {
- rtx u;
-
- /* Traditional and volatile asm instructions must be considered to use
- and clobber all hard registers, all pseudo-registers and all of
- memory. So must TRAP_IF and UNSPEC_VOLATILE operations.
-
- Consider for instance a volatile asm that changes the fpu rounding
- mode. An insn should not be moved across this even if it only uses
- pseudo-regs because it might give an incorrectly rounded result. */
- if (code != ASM_OPERANDS || MEM_VOLATILE_P (x))
- {
- int max_reg = max_reg_num ();
- for (i = 0; i < max_reg; i++)
- {
- for (u = reg_last_uses[i]; u; u = XEXP (u, 1))
- add_dependence (insn, XEXP (u, 0), REG_DEP_ANTI);
- reg_last_uses[i] = 0;
- if (reg_last_sets[i])
- add_dependence (insn, reg_last_sets[i], 0);
- }
- reg_pending_sets_all = 1;
-
- flush_pending_lists (insn, 0);
- }
-
- /* For all ASM_OPERANDS, we must traverse the vector of input operands.
- We can not just fall through here since then we would be confused
- by the ASM_INPUT rtx inside ASM_OPERANDS, which do not indicate
- traditional asms unlike their normal usage. */
-
- if (code == ASM_OPERANDS)
- {
- for (j = 0; j < ASM_OPERANDS_INPUT_LENGTH (x); j++)
- sched_analyze_2 (ASM_OPERANDS_INPUT (x, j), insn);
- return;
- }
- break;
- }
-
- case PRE_DEC:
- case POST_DEC:
- case PRE_INC:
- case POST_INC:
- /* These both read and modify the result. We must handle them as writes
- to get proper dependencies for following instructions. We must handle
- them as reads to get proper dependencies from this to previous
- instructions. Thus we need to pass them to both sched_analyze_1
- and sched_analyze_2. We must call sched_analyze_2 first in order
- to get the proper antecedent for the read. */
- sched_analyze_2 (XEXP (x, 0), insn);
- sched_analyze_1 (x, insn);
- return;
-
- default:
- break;
- }
-
- /* Other cases: walk the insn. */
- fmt = GET_RTX_FORMAT (code);
- for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
- {
- if (fmt[i] == 'e')
- sched_analyze_2 (XEXP (x, i), insn);
- else if (fmt[i] == 'E')
- for (j = 0; j < XVECLEN (x, i); j++)
- sched_analyze_2 (XVECEXP (x, i, j), insn);
- }
-}
-
-/* Analyze an INSN with pattern X to find all dependencies. */
-
-static void
-sched_analyze_insn (x, insn, loop_notes)
- rtx x, insn;
- rtx loop_notes;
-{
- register RTX_CODE code = GET_CODE (x);
- rtx link;
- int maxreg = max_reg_num ();
- int i;
-
- if (code == SET || code == CLOBBER)
- sched_analyze_1 (x, insn);
- else if (code == PARALLEL)
- {
- register int i;
- for (i = XVECLEN (x, 0) - 1; i >= 0; i--)
- {
- code = GET_CODE (XVECEXP (x, 0, i));
- if (code == SET || code == CLOBBER)
- sched_analyze_1 (XVECEXP (x, 0, i), insn);
- else
- sched_analyze_2 (XVECEXP (x, 0, i), insn);
- }
- }
- else
- sched_analyze_2 (x, insn);
-
- /* Mark registers CLOBBERED or used by called function. */
- if (GET_CODE (insn) == CALL_INSN)
- for (link = CALL_INSN_FUNCTION_USAGE (insn); link; link = XEXP (link, 1))
- {
- if (GET_CODE (XEXP (link, 0)) == CLOBBER)
- sched_analyze_1 (XEXP (link, 0), insn);
- else
- sched_analyze_2 (XEXP (link, 0), insn);
- }
-
- /* If there is a {LOOP,EHREGION}_{BEG,END} note in the middle of a basic block, then
- we must be sure that no instructions are scheduled across it.
- Otherwise, the reg_n_refs info (which depends on loop_depth) would
- become incorrect. */
-
- if (loop_notes)
- {
- int max_reg = max_reg_num ();
- rtx link;
-
- for (i = 0; i < max_reg; i++)
- {
- rtx u;
- for (u = reg_last_uses[i]; u; u = XEXP (u, 1))
- add_dependence (insn, XEXP (u, 0), REG_DEP_ANTI);
- reg_last_uses[i] = 0;
- if (reg_last_sets[i])
- add_dependence (insn, reg_last_sets[i], 0);
- }
- reg_pending_sets_all = 1;
-
- flush_pending_lists (insn, 0);
-
- link = loop_notes;
- while (XEXP (link, 1))
- link = XEXP (link, 1);
- XEXP (link, 1) = REG_NOTES (insn);
- REG_NOTES (insn) = loop_notes;
- }
-
- EXECUTE_IF_SET_IN_REG_SET (reg_pending_sets, 0, i,
- {
- reg_last_sets[i] = insn;
- });
- CLEAR_REG_SET (reg_pending_sets);
-
- if (reg_pending_sets_all)
- {
- for (i = 0; i < maxreg; i++)
- reg_last_sets[i] = insn;
- reg_pending_sets_all = 0;
- }
-
- /* Handle function calls and function returns created by the epilogue
- threading code. */
- if (GET_CODE (insn) == CALL_INSN || GET_CODE (insn) == JUMP_INSN)
- {
- rtx dep_insn;
- rtx prev_dep_insn;
-
- /* When scheduling instructions, we make sure calls don't lose their
- accompanying USE insns by depending them one on another in order.
-
- Also, we must do the same thing for returns created by the epilogue
- threading code. Note this code works only in this special case,
- because other passes make no guarantee that they will never emit
- an instruction between a USE and a RETURN. There is such a guarantee
- for USE instructions immediately before a call. */
-
- prev_dep_insn = insn;
- dep_insn = PREV_INSN (insn);
- while (GET_CODE (dep_insn) == INSN
- && GET_CODE (PATTERN (dep_insn)) == USE
- && GET_CODE (XEXP (PATTERN (dep_insn), 0)) == REG)
- {
- SCHED_GROUP_P (prev_dep_insn) = 1;
-
- /* Make a copy of all dependencies on dep_insn, and add to insn.
- This is so that all of the dependencies will apply to the
- group. */
-
- for (link = LOG_LINKS (dep_insn); link; link = XEXP (link, 1))
- add_dependence (insn, XEXP (link, 0), REG_NOTE_KIND (link));
-
- prev_dep_insn = dep_insn;
- dep_insn = PREV_INSN (dep_insn);
- }
- }
-}
-
-/* Analyze every insn between HEAD and TAIL inclusive, creating LOG_LINKS
- for every dependency. */
-
-static int
-sched_analyze (head, tail)
- rtx head, tail;
-{
- register rtx insn;
- register int n_insns = 0;
- register rtx u;
- register int luid = 0;
- rtx loop_notes = 0;
-
- for (insn = head; ; insn = NEXT_INSN (insn))
- {
- INSN_LUID (insn) = luid++;
-
- if (GET_CODE (insn) == INSN || GET_CODE (insn) == JUMP_INSN)
- {
- sched_analyze_insn (PATTERN (insn), insn, loop_notes);
- loop_notes = 0;
- n_insns += 1;
- }
- else if (GET_CODE (insn) == CALL_INSN)
- {
- rtx x;
- register int i;
-
- /* Any instruction using a hard register which may get clobbered
- by a call needs to be marked as dependent on this call.
- This prevents a use of a hard return reg from being moved
- past a void call (i.e. it does not explicitly set the hard
- return reg). */
-
- /* If this call is followed by a NOTE_INSN_SETJMP, then assume that
- all registers, not just hard registers, may be clobbered by this
- call. */
-
- /* Insn, being a CALL_INSN, magically depends on
- `last_function_call' already. */
-
- if (NEXT_INSN (insn) && GET_CODE (NEXT_INSN (insn)) == NOTE
- && NOTE_LINE_NUMBER (NEXT_INSN (insn)) == NOTE_INSN_SETJMP)
- {
- int max_reg = max_reg_num ();
- for (i = 0; i < max_reg; i++)
- {
- for (u = reg_last_uses[i]; u; u = XEXP (u, 1))
- add_dependence (insn, XEXP (u, 0), REG_DEP_ANTI);
- reg_last_uses[i] = 0;
- if (reg_last_sets[i])
- add_dependence (insn, reg_last_sets[i], 0);
- }
- reg_pending_sets_all = 1;
-
- /* Add a pair of fake REG_NOTEs which we will later
- convert back into a NOTE_INSN_SETJMP note. See
- reemit_notes for why we use a pair of NOTEs. */
-
- REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_DEAD,
- GEN_INT (0),
- REG_NOTES (insn));
- REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_DEAD,
- GEN_INT (NOTE_INSN_SETJMP),
- REG_NOTES (insn));
- }
- else
- {
- for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
- if (call_used_regs[i] || global_regs[i])
- {
- for (u = reg_last_uses[i]; u; u = XEXP (u, 1))
- add_dependence (insn, XEXP (u, 0), REG_DEP_ANTI);
- reg_last_uses[i] = 0;
- if (reg_last_sets[i])
- add_dependence (insn, reg_last_sets[i], REG_DEP_ANTI);
- SET_REGNO_REG_SET (reg_pending_sets, i);
- }
- }
-
- /* For each insn which shouldn't cross a call, add a dependence
- between that insn and this call insn. */
- x = LOG_LINKS (sched_before_next_call);
- while (x)
- {
- add_dependence (insn, XEXP (x, 0), REG_DEP_ANTI);
- x = XEXP (x, 1);
- }
- LOG_LINKS (sched_before_next_call) = 0;
-
- sched_analyze_insn (PATTERN (insn), insn, loop_notes);
- loop_notes = 0;
-
- /* In the absence of interprocedural alias analysis, we must flush
- all pending reads and writes, and start new dependencies starting
- from here. But only flush writes for constant calls (which may
- be passed a pointer to something we haven't written yet). */
- flush_pending_lists (insn, CONST_CALL_P (insn));
-
- /* Depend this function call (actually, the user of this
- function call) on all hard register clobberage. */
- last_function_call = insn;
- n_insns += 1;
- }
-
- /* See comments on reemit_notes as to why we do this. */
- else if (GET_CODE (insn) == NOTE
- && (NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_BEG
- || NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_END
- || NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_BEG
- || NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_END
- || NOTE_LINE_NUMBER (insn) == NOTE_INSN_RANGE_START
- || NOTE_LINE_NUMBER (insn) == NOTE_INSN_RANGE_END
- || (NOTE_LINE_NUMBER (insn) == NOTE_INSN_SETJMP
- && GET_CODE (PREV_INSN (insn)) != CALL_INSN)))
- {
- loop_notes = gen_rtx_EXPR_LIST (REG_DEAD,
- GEN_INT (NOTE_BLOCK_NUMBER (insn)),
- loop_notes);
- loop_notes = gen_rtx_EXPR_LIST (REG_DEAD,
- GEN_INT (NOTE_LINE_NUMBER (insn)),
- loop_notes);
- CONST_CALL_P (loop_notes) = CONST_CALL_P (insn);
- }
-
- if (insn == tail)
- return n_insns;
- }
-
- abort ();
-}
-
-/* Called when we see a set of a register. If death is true, then we are
- scanning backwards. Mark that register as unborn. If nobody says
- otherwise, that is how things will remain. If death is false, then we
- are scanning forwards. Mark that register as being born. */
-
-static void
-sched_note_set (x, death)
- rtx x;
- int death;
-{
- register int regno;
- register rtx reg = SET_DEST (x);
- int subreg_p = 0;
-
- if (reg == 0)
- return;
-
- while (GET_CODE (reg) == SUBREG || GET_CODE (reg) == STRICT_LOW_PART
- || GET_CODE (reg) == SIGN_EXTRACT || GET_CODE (reg) == ZERO_EXTRACT)
- {
- /* Must treat modification of just one hardware register of a multi-reg
- value or just a byte field of a register exactly the same way that
- mark_set_1 in flow.c does, i.e. anything except a paradoxical subreg
- does not kill the entire register. */
- if (GET_CODE (reg) != SUBREG
- || REG_SIZE (SUBREG_REG (reg)) > REG_SIZE (reg))
- subreg_p = 1;
-
- reg = SUBREG_REG (reg);
- }
-
- if (GET_CODE (reg) != REG)
- return;
-
- /* Global registers are always live, so the code below does not apply
- to them. */
-
- regno = REGNO (reg);
- if (regno >= FIRST_PSEUDO_REGISTER || ! global_regs[regno])
- {
- if (death)
- {
- /* If we only set part of the register, then this set does not
- kill it. */
- if (subreg_p)
- return;
-
- /* Try killing this register. */
- if (regno < FIRST_PSEUDO_REGISTER)
- {
- int j = HARD_REGNO_NREGS (regno, GET_MODE (reg));
- while (--j >= 0)
- {
- CLEAR_REGNO_REG_SET (bb_live_regs, regno + j);
- SET_REGNO_REG_SET (bb_dead_regs, regno + j);
- }
- }
- else
- {
- CLEAR_REGNO_REG_SET (bb_live_regs, regno);
- SET_REGNO_REG_SET (bb_dead_regs, regno);
- }
- }
- else
- {
- /* Make the register live again. */
- if (regno < FIRST_PSEUDO_REGISTER)
- {
- int j = HARD_REGNO_NREGS (regno, GET_MODE (reg));
- while (--j >= 0)
- {
- SET_REGNO_REG_SET (bb_live_regs, regno + j);
- CLEAR_REGNO_REG_SET (bb_dead_regs, regno + j);
- }
- }
- else
- {
- SET_REGNO_REG_SET (bb_live_regs, regno);
- CLEAR_REGNO_REG_SET (bb_dead_regs, regno);
- }
- }
- }
-}
-
-/* Macros and functions for keeping the priority queue sorted, and
- dealing with queueing and dequeueing of instructions. */
-
-#define SCHED_SORT(READY, NEW_READY, OLD_READY) \
- do { if ((NEW_READY) - (OLD_READY) == 1) \
- swap_sort (READY, NEW_READY); \
- else if ((NEW_READY) - (OLD_READY) > 1) \
- qsort (READY, NEW_READY, sizeof (rtx), rank_for_schedule); } \
- while (0)
-
-/* Returns a positive value if y is preferred; returns a negative value if
- x is preferred. Should never return 0, since that will make the sort
- unstable. */
-
-static int
-rank_for_schedule (x, y)
- const GENERIC_PTR x;
- const GENERIC_PTR y;
-{
- rtx tmp = *(rtx *)y;
- rtx tmp2 = *(rtx *)x;
- rtx link;
- int tmp_class, tmp2_class;
- int value;
-
- /* Choose the instruction with the highest priority, if different. */
- if ((value = INSN_PRIORITY (tmp) - INSN_PRIORITY (tmp2)))
- return value;
-
- if (last_scheduled_insn)
- {
- /* Classify the instructions into three classes:
- 1) Data dependent on last schedule insn.
- 2) Anti/Output dependent on last scheduled insn.
- 3) Independent of last scheduled insn, or has latency of one.
- Choose the insn from the highest numbered class if different. */
- link = find_insn_list (tmp, LOG_LINKS (last_scheduled_insn));
- if (link == 0 || insn_cost (tmp, link, last_scheduled_insn) == 1)
- tmp_class = 3;
- else if (REG_NOTE_KIND (link) == 0) /* Data dependence. */
- tmp_class = 1;
- else
- tmp_class = 2;
-
- link = find_insn_list (tmp2, LOG_LINKS (last_scheduled_insn));
- if (link == 0 || insn_cost (tmp2, link, last_scheduled_insn) == 1)
- tmp2_class = 3;
- else if (REG_NOTE_KIND (link) == 0) /* Data dependence. */
- tmp2_class = 1;
- else
- tmp2_class = 2;
-
- if ((value = tmp_class - tmp2_class))
- return value;
- }
-
- /* If insns are equally good, sort by INSN_LUID (original insn order),
- so that we make the sort stable. This minimizes instruction movement,
- thus minimizing sched's effect on debugging and cross-jumping. */
- return INSN_LUID (tmp) - INSN_LUID (tmp2);
-}
-
-/* Resort the array A in which only element at index N may be out of order. */
-
-__inline static void
-swap_sort (a, n)
- rtx *a;
- int n;
-{
- rtx insn = a[n-1];
- int i = n-2;
-
- while (i >= 0 && rank_for_schedule (a+i, &insn) >= 0)
- {
- a[i+1] = a[i];
- i -= 1;
- }
- a[i+1] = insn;
-}
-
-static int max_priority;
-
-/* Add INSN to the insn queue so that it fires at least N_CYCLES
- before the currently executing insn. */
-
-__inline static void
-queue_insn (insn, n_cycles)
- rtx insn;
- int n_cycles;
-{
- int next_q = NEXT_Q_AFTER (q_ptr, n_cycles);
- NEXT_INSN (insn) = insn_queue[next_q];
- insn_queue[next_q] = insn;
- q_size += 1;
-}
-
-/* Return nonzero if PAT is the pattern of an insn which makes a
- register live. */
-
-__inline static int
-birthing_insn_p (pat)
- rtx pat;
-{
- int j;
-
- if (reload_completed == 1)
- return 0;
-
- if (GET_CODE (pat) == SET
- && GET_CODE (SET_DEST (pat)) == REG)
- {
- rtx dest = SET_DEST (pat);
- int i = REGNO (dest);
-
- /* It would be more accurate to use refers_to_regno_p or
- reg_mentioned_p to determine when the dest is not live before this
- insn. */
-
- if (REGNO_REG_SET_P (bb_live_regs, i))
- return (REG_N_SETS (i) == 1);
-
- return 0;
- }
- if (GET_CODE (pat) == PARALLEL)
- {
- for (j = 0; j < XVECLEN (pat, 0); j++)
- if (birthing_insn_p (XVECEXP (pat, 0, j)))
- return 1;
- }
- return 0;
-}
-
-/* PREV is an insn that is ready to execute. Adjust its priority if that
- will help shorten register lifetimes. */
-
-__inline static void
-adjust_priority (prev)
- rtx prev;
-{
- /* Trying to shorten register lives after reload has completed
- is useless and wrong. It gives inaccurate schedules. */
- if (reload_completed == 0)
- {
- rtx note;
- int n_deaths = 0;
-
- /* ??? This code has no effect, because REG_DEAD notes are removed
- before we ever get here. */
- for (note = REG_NOTES (prev); note; note = XEXP (note, 1))
- if (REG_NOTE_KIND (note) == REG_DEAD)
- n_deaths += 1;
-
- /* Defer scheduling insns which kill registers, since that
- shortens register lives. Prefer scheduling insns which
- make registers live for the same reason. */
- switch (n_deaths)
- {
- default:
- INSN_PRIORITY (prev) >>= 3;
- break;
- case 3:
- INSN_PRIORITY (prev) >>= 2;
- break;
- case 2:
- case 1:
- INSN_PRIORITY (prev) >>= 1;
- break;
- case 0:
- if (birthing_insn_p (PATTERN (prev)))
- {
- int max = max_priority;
-
- if (max > INSN_PRIORITY (prev))
- INSN_PRIORITY (prev) = max;
- }
- break;
- }
-#ifdef ADJUST_PRIORITY
- ADJUST_PRIORITY (prev);
-#endif
- }
-}
-
-/* INSN is the "currently executing insn". Launch each insn which was
- waiting on INSN (in the backwards dataflow sense). READY is a
- vector of insns which are ready to fire. N_READY is the number of
- elements in READY. CLOCK is the current virtual cycle. */
-
-static int
-schedule_insn (insn, ready, n_ready, clock)
- rtx insn;
- rtx *ready;
- int n_ready;
- int clock;
-{
- rtx link;
- int new_ready = n_ready;
-
- if (MAX_BLOCKAGE > 1)
- schedule_unit (insn_unit (insn), insn, clock);
-
- if (LOG_LINKS (insn) == 0)
- return n_ready;
-
- /* This is used by the function adjust_priority above. */
- if (n_ready > 0)
- max_priority = MAX (INSN_PRIORITY (ready[0]), INSN_PRIORITY (insn));
- else
- max_priority = INSN_PRIORITY (insn);
-
- for (link = LOG_LINKS (insn); link != 0; link = XEXP (link, 1))
- {
- rtx prev = XEXP (link, 0);
- int cost = insn_cost (prev, link, insn);
-
- if ((INSN_REF_COUNT (prev) -= 1) != 0)
- {
- /* We satisfied one requirement to fire PREV. Record the earliest
- time when PREV can fire. No need to do this if the cost is 1,
- because PREV can fire no sooner than the next cycle. */
- if (cost > 1)
- INSN_TICK (prev) = MAX (INSN_TICK (prev), clock + cost);
- }
- else
- {
- /* We satisfied the last requirement to fire PREV. Ensure that all
- timing requirements are satisfied. */
- if (INSN_TICK (prev) - clock > cost)
- cost = INSN_TICK (prev) - clock;
-
- /* Adjust the priority of PREV and either put it on the ready
- list or queue it. */
- adjust_priority (prev);
- if (cost <= 1)
- ready[new_ready++] = prev;
- else
- queue_insn (prev, cost);
- }
- }
-
- return new_ready;
-}
-
-/* Given N_READY insns in the ready list READY at time CLOCK, queue
- those that are blocked due to function unit hazards and rearrange
- the remaining ones to minimize subsequent function unit hazards. */
-
-static int
-schedule_select (ready, n_ready, clock, file)
- rtx *ready;
- int n_ready, clock;
- FILE *file;
-{
- int pri = INSN_PRIORITY (ready[0]);
- int i, j, k, q, cost, best_cost, best_insn = 0, new_ready = n_ready;
- rtx insn;
-
- /* Work down the ready list in groups of instructions with the same
- priority value. Queue insns in the group that are blocked and
- select among those that remain for the one with the largest
- potential hazard. */
- for (i = 0; i < n_ready; i = j)
- {
- int opri = pri;
- for (j = i + 1; j < n_ready; j++)
- if ((pri = INSN_PRIORITY (ready[j])) != opri)
- break;
-
- /* Queue insns in the group that are blocked. */
- for (k = i, q = 0; k < j; k++)
- {
- insn = ready[k];
- if ((cost = actual_hazard (insn_unit (insn), insn, clock, 0)) != 0)
- {
- q++;
- ready[k] = 0;
- queue_insn (insn, cost);
- if (file)
- fprintf (file, "\n;; blocking insn %d for %d cycles",
- INSN_UID (insn), cost);
- }
- }
- new_ready -= q;
-
- /* Check the next group if all insns were queued. */
- if (j - i - q == 0)
- continue;
-
- /* If more than one remains, select the first one with the largest
- potential hazard. */
- else if (j - i - q > 1)
- {
- best_cost = -1;
- for (k = i; k < j; k++)
- {
- if ((insn = ready[k]) == 0)
- continue;
- if ((cost = potential_hazard (insn_unit (insn), insn, 0))
- > best_cost)
- {
- best_cost = cost;
- best_insn = k;
- }
- }
- }
- /* We have found a suitable insn to schedule. */
- break;
- }
-
- /* Move the best insn to be front of the ready list. */
- if (best_insn != 0)
- {
- if (file)
- {
- fprintf (file, ", now");
- for (i = 0; i < n_ready; i++)
- if (ready[i])
- fprintf (file, " %d", INSN_UID (ready[i]));
- fprintf (file, "\n;; insn %d has a greater potential hazard",
- INSN_UID (ready[best_insn]));
- }
- for (i = best_insn; i > 0; i--)
- {
- insn = ready[i-1];
- ready[i-1] = ready[i];
- ready[i] = insn;
- }
- }
-
- /* Compact the ready list. */
- if (new_ready < n_ready)
- for (i = j = 0; i < n_ready; i++)
- if (ready[i])
- ready[j++] = ready[i];
-
- return new_ready;
-}
-
-/* Add a REG_DEAD note for REG to INSN, reusing a REG_DEAD note from the
- dead_notes list. */
-
-static void
-create_reg_dead_note (reg, insn)
- rtx reg, insn;
-{
- rtx link;
-
- /* The number of registers killed after scheduling must be the same as the
- number of registers killed before scheduling. The number of REG_DEAD
- notes may not be conserved, i.e. two SImode hard register REG_DEAD notes
- might become one DImode hard register REG_DEAD note, but the number of
- registers killed will be conserved.
-
- We carefully remove REG_DEAD notes from the dead_notes list, so that
- there will be none left at the end. If we run out early, then there
- is a bug somewhere in flow, combine and/or sched. */
-
- if (dead_notes == 0)
- {
-#if 1
- abort ();
-#else
- link = rtx_alloc (EXPR_LIST);
- PUT_REG_NOTE_KIND (link, REG_DEAD);
-#endif
- }
- else
- {
- /* Number of regs killed by REG. */
- int regs_killed = (REGNO (reg) >= FIRST_PSEUDO_REGISTER ? 1
- : HARD_REGNO_NREGS (REGNO (reg), GET_MODE (reg)));
- /* Number of regs killed by REG_DEAD notes taken off the list. */
- int reg_note_regs;
-
- link = dead_notes;
- reg_note_regs = (REGNO (XEXP (link, 0)) >= FIRST_PSEUDO_REGISTER ? 1
- : HARD_REGNO_NREGS (REGNO (XEXP (link, 0)),
- GET_MODE (XEXP (link, 0))));
- while (reg_note_regs < regs_killed)
- {
- /* LINK might be zero if we killed more registers after scheduling
- than before, and the last hard register we kill is actually
- multiple hard regs. */
- if (link == NULL_RTX)
- abort ();
-
- link = XEXP (link, 1);
- reg_note_regs += (REGNO (XEXP (link, 0)) >= FIRST_PSEUDO_REGISTER ? 1
- : HARD_REGNO_NREGS (REGNO (XEXP (link, 0)),
- GET_MODE (XEXP (link, 0))));
- }
- dead_notes = XEXP (link, 1);
-
- /* If we took too many regs kills off, put the extra ones back. */
- while (reg_note_regs > regs_killed)
- {
- rtx temp_reg, temp_link;
-
- temp_reg = gen_rtx_REG (word_mode, 0);
- temp_link = rtx_alloc (EXPR_LIST);
- PUT_REG_NOTE_KIND (temp_link, REG_DEAD);
- XEXP (temp_link, 0) = temp_reg;
- XEXP (temp_link, 1) = dead_notes;
- dead_notes = temp_link;
- reg_note_regs--;
- }
- }
-
- XEXP (link, 0) = reg;
- XEXP (link, 1) = REG_NOTES (insn);
- REG_NOTES (insn) = link;
-}
-
-/* Subroutine on attach_deaths_insn--handles the recursive search
- through INSN. If SET_P is true, then x is being modified by the insn. */
-
-static void
-attach_deaths (x, insn, set_p)
- rtx x;
- rtx insn;
- int set_p;
-{
- register int i;
- register int j;
- register enum rtx_code code;
- register char *fmt;
-
- if (x == 0)
- return;
-
- code = GET_CODE (x);
-
- switch (code)
- {
- case CONST_INT:
- case CONST_DOUBLE:
- case LABEL_REF:
- case SYMBOL_REF:
- case CONST:
- case CODE_LABEL:
- case PC:
- case CC0:
- /* Get rid of the easy cases first. */
- return;
-
- case REG:
- {
- /* If the register dies in this insn, queue that note, and mark
- this register as needing to die. */
- /* This code is very similar to mark_used_1 (if set_p is false)
- and mark_set_1 (if set_p is true) in flow.c. */
-
- register int regno;
- int some_needed;
- int all_needed;
-
- if (set_p)
- return;
-
- regno = REGNO (x);
- all_needed = some_needed = REGNO_REG_SET_P (old_live_regs, regno);
- if (regno < FIRST_PSEUDO_REGISTER)
- {
- int n;
-
- n = HARD_REGNO_NREGS (regno, GET_MODE (x));
- while (--n > 0)
- {
- int needed = (REGNO_REG_SET_P (old_live_regs, regno + n));
- some_needed |= needed;
- all_needed &= needed;
- }
- }
-
- /* If it wasn't live before we started, then add a REG_DEAD note.
- We must check the previous lifetime info not the current info,
- because we may have to execute this code several times, e.g.
- once for a clobber (which doesn't add a note) and later
- for a use (which does add a note).
-
- Always make the register live. We must do this even if it was
- live before, because this may be an insn which sets and uses
- the same register, in which case the register has already been
- killed, so we must make it live again.
-
- Global registers are always live, and should never have a REG_DEAD
- note added for them, so none of the code below applies to them. */
-
- if (regno >= FIRST_PSEUDO_REGISTER || ! global_regs[regno])
- {
- /* Never add REG_DEAD notes for STACK_POINTER_REGNUM
- since it's always considered to be live. Similarly
- for FRAME_POINTER_REGNUM if a frame pointer is needed
- and for ARG_POINTER_REGNUM if it is fixed. */
- if (! (regno == FRAME_POINTER_REGNUM
- && (! reload_completed || frame_pointer_needed))
-#if HARD_FRAME_POINTER_REGNUM != FRAME_POINTER_REGNUM
- && ! (regno == HARD_FRAME_POINTER_REGNUM
- && (! reload_completed || frame_pointer_needed))
-#endif
-#if ARG_POINTER_REGNUM != FRAME_POINTER_REGNUM
- && ! (regno == ARG_POINTER_REGNUM && fixed_regs[regno])
-#endif
- && regno != STACK_POINTER_REGNUM)
- {
- if (! all_needed && ! dead_or_set_p (insn, x))
- {
- /* Check for the case where the register dying partially
- overlaps the register set by this insn. */
- if (regno < FIRST_PSEUDO_REGISTER
- && HARD_REGNO_NREGS (regno, GET_MODE (x)) > 1)
- {
- int n = HARD_REGNO_NREGS (regno, GET_MODE (x));
- while (--n >= 0)
- some_needed |= dead_or_set_regno_p (insn, regno + n);
- }
-
- /* If none of the words in X is needed, make a REG_DEAD
- note. Otherwise, we must make partial REG_DEAD
- notes. */
- if (! some_needed)
- create_reg_dead_note (x, insn);
- else
- {
- int i;
-
- /* Don't make a REG_DEAD note for a part of a
- register that is set in the insn. */
- for (i = HARD_REGNO_NREGS (regno, GET_MODE (x)) - 1;
- i >= 0; i--)
- if (! REGNO_REG_SET_P (old_live_regs, regno + i)
- && ! dead_or_set_regno_p (insn, regno + i))
- create_reg_dead_note (gen_rtx_REG (reg_raw_mode[regno + i],
- regno + i),
- insn);
- }
- }
- }
-
- if (regno < FIRST_PSEUDO_REGISTER)
- {
- int j = HARD_REGNO_NREGS (regno, GET_MODE (x));
- while (--j >= 0)
- {
- CLEAR_REGNO_REG_SET (bb_dead_regs, regno + j);
- SET_REGNO_REG_SET (bb_live_regs, regno + j);
- }
- }
- else
- {
- CLEAR_REGNO_REG_SET (bb_dead_regs, regno);
- SET_REGNO_REG_SET (bb_live_regs, regno);
- }
- }
- return;
- }
-
- case MEM:
- /* Handle tail-recursive case. */
- attach_deaths (XEXP (x, 0), insn, 0);
- return;
-
- case SUBREG:
- attach_deaths (SUBREG_REG (x), insn,
- set_p && ((GET_MODE_SIZE (GET_MODE (SUBREG_REG (x)))
- <= UNITS_PER_WORD)
- || (GET_MODE_SIZE (GET_MODE (SUBREG_REG (x)))
- == GET_MODE_SIZE (GET_MODE ((x))))));
- return;
-
- case STRICT_LOW_PART:
- attach_deaths (XEXP (x, 0), insn, 0);
- return;
-
- case ZERO_EXTRACT:
- case SIGN_EXTRACT:
- attach_deaths (XEXP (x, 0), insn, 0);
- attach_deaths (XEXP (x, 1), insn, 0);
- attach_deaths (XEXP (x, 2), insn, 0);
- return;
-
- default:
- /* Other cases: walk the insn. */
- fmt = GET_RTX_FORMAT (code);
- for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
- {
- if (fmt[i] == 'e')
- attach_deaths (XEXP (x, i), insn, 0);
- else if (fmt[i] == 'E')
- for (j = 0; j < XVECLEN (x, i); j++)
- attach_deaths (XVECEXP (x, i, j), insn, 0);
- }
- }
-}
-
-/* After INSN has executed, add register death notes for each register
- that is dead after INSN. */
-
-static void
-attach_deaths_insn (insn)
- rtx insn;
-{
- rtx x = PATTERN (insn);
- register RTX_CODE code = GET_CODE (x);
- rtx link;
-
- if (code == SET)
- {
- attach_deaths (SET_SRC (x), insn, 0);
-
- /* A register might die here even if it is the destination, e.g.
- it is the target of a volatile read and is otherwise unused.
- Hence we must always call attach_deaths for the SET_DEST. */
- attach_deaths (SET_DEST (x), insn, 1);
- }
- else if (code == PARALLEL)
- {
- register int i;
- for (i = XVECLEN (x, 0) - 1; i >= 0; i--)
- {
- code = GET_CODE (XVECEXP (x, 0, i));
- if (code == SET)
- {
- attach_deaths (SET_SRC (XVECEXP (x, 0, i)), insn, 0);
-
- attach_deaths (SET_DEST (XVECEXP (x, 0, i)), insn, 1);
- }
- /* Flow does not add REG_DEAD notes to registers that die in
- clobbers, so we can't either. */
- else if (code != CLOBBER)
- attach_deaths (XVECEXP (x, 0, i), insn, 0);
- }
- }
- /* If this is a CLOBBER, only add REG_DEAD notes to registers inside a
- MEM being clobbered, just like flow. */
- else if (code == CLOBBER && GET_CODE (XEXP (x, 0)) == MEM)
- attach_deaths (XEXP (XEXP (x, 0), 0), insn, 0);
- /* Otherwise don't add a death note to things being clobbered. */
- else if (code != CLOBBER)
- attach_deaths (x, insn, 0);
-
- /* Make death notes for things used in the called function. */
- if (GET_CODE (insn) == CALL_INSN)
- for (link = CALL_INSN_FUNCTION_USAGE (insn); link; link = XEXP (link, 1))
- attach_deaths (XEXP (XEXP (link, 0), 0), insn,
- GET_CODE (XEXP (link, 0)) == CLOBBER);
-}
-
-/* Delete notes beginning with INSN and maybe put them in the chain
- of notes ended by NOTE_LIST.
- Returns the insn following the notes. */
-
-static rtx
-unlink_notes (insn, tail)
- rtx insn, tail;
-{
- rtx prev = PREV_INSN (insn);
-
- while (insn != tail && GET_CODE (insn) == NOTE)
- {
- rtx next = NEXT_INSN (insn);
- /* Delete the note from its current position. */
- if (prev)
- NEXT_INSN (prev) = next;
- if (next)
- PREV_INSN (next) = prev;
-
- if (write_symbols != NO_DEBUG && NOTE_LINE_NUMBER (insn) > 0)
- /* Record line-number notes so they can be reused. */
- LINE_NOTE (insn) = insn;
-
- /* Don't save away NOTE_INSN_SETJMPs, because they must remain
- immediately after the call they follow. We use a fake
- (REG_DEAD (const_int -1)) note to remember them.
- Likewise with NOTE_INSN_{LOOP,EHREGION}_{BEG, END}. */
- else if (NOTE_LINE_NUMBER (insn) != NOTE_INSN_SETJMP
- && NOTE_LINE_NUMBER (insn) != NOTE_INSN_LOOP_BEG
- && NOTE_LINE_NUMBER (insn) != NOTE_INSN_LOOP_END
- && NOTE_LINE_NUMBER (insn) != NOTE_INSN_RANGE_START
- && NOTE_LINE_NUMBER (insn) != NOTE_INSN_RANGE_END
- && NOTE_LINE_NUMBER (insn) != NOTE_INSN_EH_REGION_BEG
- && NOTE_LINE_NUMBER (insn) != NOTE_INSN_EH_REGION_END)
- {
- /* Insert the note at the end of the notes list. */
- PREV_INSN (insn) = note_list;
- if (note_list)
- NEXT_INSN (note_list) = insn;
- note_list = insn;
- }
-
- insn = next;
- }
- return insn;
-}
-
-/* Constructor for `sometimes' data structure. */
-
-static int
-new_sometimes_live (regs_sometimes_live, regno, sometimes_max)
- struct sometimes *regs_sometimes_live;
- int regno;
- int sometimes_max;
-{
- register struct sometimes *p;
-
- /* There should never be a register greater than max_regno here. If there
- is, it means that a define_split has created a new pseudo reg. This
- is not allowed, since there will not be flow info available for any
- new register, so catch the error here. */
- if (regno >= max_regno)
- abort ();
-
- p = &regs_sometimes_live[sometimes_max];
- p->regno = regno;
- p->live_length = 0;
- p->calls_crossed = 0;
- sometimes_max++;
- return sometimes_max;
-}
-
-/* Count lengths of all regs we are currently tracking,
- and find new registers no longer live. */
-
-static void
-finish_sometimes_live (regs_sometimes_live, sometimes_max)
- struct sometimes *regs_sometimes_live;
- int sometimes_max;
-{
- int i;
-
- for (i = 0; i < sometimes_max; i++)
- {
- register struct sometimes *p = &regs_sometimes_live[i];
- int regno = p->regno;
-
- sched_reg_live_length[regno] += p->live_length;
- sched_reg_n_calls_crossed[regno] += p->calls_crossed;
- }
-}
-
-/* Search INSN for fake REG_DEAD note pairs for NOTE_INSN_SETJMP,
- NOTE_INSN_{LOOP,EHREGION}_{BEG,END}; and convert them back into
- NOTEs. The REG_DEAD note following first one is contains the saved
- value for NOTE_BLOCK_NUMBER which is useful for
- NOTE_INSN_EH_REGION_{BEG,END} NOTEs. LAST is the last instruction
- output by the instruction scheduler. Return the new value of LAST. */
-
-static rtx
-reemit_notes (insn, last)
- rtx insn;
- rtx last;
-{
- rtx note;
-
- for (note = REG_NOTES (insn); note; note = XEXP (note, 1))
- {
- if (REG_NOTE_KIND (note) == REG_DEAD
- && GET_CODE (XEXP (note, 0)) == CONST_INT)
- {
- if (INTVAL (XEXP (note, 0)) == NOTE_INSN_SETJMP)
- {
- CONST_CALL_P (emit_note_after (INTVAL (XEXP (note, 0)), insn))
- = CONST_CALL_P (note);
- remove_note (insn, note);
- note = XEXP (note, 1);
- }
- else
- {
- last = emit_note_before (INTVAL (XEXP (note, 0)), last);
- remove_note (insn, note);
- note = XEXP (note, 1);
- NOTE_BLOCK_NUMBER (last) = INTVAL (XEXP (note, 0));
- }
- remove_note (insn, note);
- }
- }
- return last;
-}
-
-/* Use modified list scheduling to rearrange insns in basic block
- B. FILE, if nonzero, is where we dump interesting output about
- this pass. */
-
-static void
-schedule_block (b, file)
- int b;
- FILE *file;
-{
- rtx insn, last;
- rtx *ready, link;
- int i, j, n_ready = 0, new_ready, n_insns;
- int sched_n_insns = 0;
- int clock;
-#define NEED_NOTHING 0
-#define NEED_HEAD 1
-#define NEED_TAIL 2
- int new_needs;
-
- /* HEAD and TAIL delimit the region being scheduled. */
- rtx head = BLOCK_HEAD (b);
- rtx tail = BLOCK_END (b);
- /* PREV_HEAD and NEXT_TAIL are the boundaries of the insns
- being scheduled. When the insns have been ordered,
- these insns delimit where the new insns are to be
- spliced back into the insn chain. */
- rtx next_tail;
- rtx prev_head;
-
- /* Keep life information accurate. */
- register struct sometimes *regs_sometimes_live;
- int sometimes_max;
-
- if (file)
- fprintf (file, ";;\t -- basic block number %d from %d to %d --\n",
- b, INSN_UID (BLOCK_HEAD (b)), INSN_UID (BLOCK_END (b)));
-
- i = max_reg_num ();
- reg_last_uses = (rtx *) alloca (i * sizeof (rtx));
- bzero ((char *) reg_last_uses, i * sizeof (rtx));
- reg_last_sets = (rtx *) alloca (i * sizeof (rtx));
- bzero ((char *) reg_last_sets, i * sizeof (rtx));
- reg_pending_sets = ALLOCA_REG_SET ();
- CLEAR_REG_SET (reg_pending_sets);
- reg_pending_sets_all = 0;
- clear_units ();
-
-#if 0
- /* We used to have code to avoid getting parameters moved from hard
- argument registers into pseudos.
-
- However, it was removed when it proved to be of marginal benefit and
- caused problems because of different notions of what the "head" insn
- was. */
-
- /* Remove certain insns at the beginning from scheduling,
- by advancing HEAD. */
-
- /* At the start of a function, before reload has run, don't delay getting
- parameters from hard registers into pseudo registers. */
- if (reload_completed == 0 && b == 0)
- {
- while (head != tail
- && GET_CODE (head) == NOTE
- && NOTE_LINE_NUMBER (head) != NOTE_INSN_FUNCTION_BEG)
- head = NEXT_INSN (head);
- while (head != tail
- && GET_CODE (head) == INSN
- && GET_CODE (PATTERN (head)) == SET)
- {
- rtx src = SET_SRC (PATTERN (head));
- while (GET_CODE (src) == SUBREG
- || GET_CODE (src) == SIGN_EXTEND
- || GET_CODE (src) == ZERO_EXTEND
- || GET_CODE (src) == SIGN_EXTRACT
- || GET_CODE (src) == ZERO_EXTRACT)
- src = XEXP (src, 0);
- if (GET_CODE (src) != REG
- || REGNO (src) >= FIRST_PSEUDO_REGISTER)
- break;
- /* Keep this insn from ever being scheduled. */
- INSN_REF_COUNT (head) = 1;
- head = NEXT_INSN (head);
- }
- }
-#endif
-
- /* Don't include any notes or labels at the beginning of the
- basic block, or notes at the ends of basic blocks. */
- while (head != tail)
- {
- if (GET_CODE (head) == NOTE)
- head = NEXT_INSN (head);
- else if (GET_CODE (tail) == NOTE)
- tail = PREV_INSN (tail);
- else if (GET_CODE (head) == CODE_LABEL)
- head = NEXT_INSN (head);
- else break;
- }
- /* If the only insn left is a NOTE or a CODE_LABEL, then there is no need
- to schedule this block. */
- if (head == tail
- && (GET_CODE (head) == NOTE || GET_CODE (head) == CODE_LABEL))
- goto ret;
-
-#if 0
- /* This short-cut doesn't work. It does not count call insns crossed by
- registers in reg_sometimes_live. It does not mark these registers as
- dead if they die in this block. It does not mark these registers live
- (or create new reg_sometimes_live entries if necessary) if they are born
- in this block.
-
- The easy solution is to just always schedule a block. This block only
- has one insn, so this won't slow down this pass by much. */
-
- if (head == tail)
- goto ret;
-#endif
-
- /* Now HEAD through TAIL are the insns actually to be rearranged;
- Let PREV_HEAD and NEXT_TAIL enclose them. */
- prev_head = PREV_INSN (head);
- next_tail = NEXT_INSN (tail);
-
- /* Initialize basic block data structures. */
- dead_notes = 0;
- pending_read_insns = 0;
- pending_read_mems = 0;
- pending_write_insns = 0;
- pending_write_mems = 0;
- pending_lists_length = 0;
- last_pending_memory_flush = 0;
- last_function_call = 0;
- last_scheduled_insn = 0;
-
- LOG_LINKS (sched_before_next_call) = 0;
-
- n_insns = sched_analyze (head, tail);
- if (n_insns == 0)
- {
- free_pending_lists ();
- goto ret;
- }
-
- /* Allocate vector to hold insns to be rearranged (except those
- insns which are controlled by an insn with SCHED_GROUP_P set).
- All these insns are included between ORIG_HEAD and ORIG_TAIL,
- as those variables ultimately are set up. */
- ready = (rtx *) alloca ((n_insns+1) * sizeof (rtx));
-
- /* TAIL is now the last of the insns to be rearranged.
- Put those insns into the READY vector. */
- insn = tail;
-
- /* For all branches, calls, uses, and cc0 setters, force them to remain
- in order at the end of the block by adding dependencies and giving
- the last a high priority. There may be notes present, and prev_head
- may also be a note.
-
- Branches must obviously remain at the end. Calls should remain at the
- end since moving them results in worse register allocation. Uses remain
- at the end to ensure proper register allocation. cc0 setters remaim
- at the end because they can't be moved away from their cc0 user. */
- last = 0;
- while (GET_CODE (insn) == CALL_INSN || GET_CODE (insn) == JUMP_INSN
- || (GET_CODE (insn) == INSN
- && (GET_CODE (PATTERN (insn)) == USE
-#ifdef HAVE_cc0
- || sets_cc0_p (PATTERN (insn))
-#endif
- ))
- || GET_CODE (insn) == NOTE)
- {
- if (GET_CODE (insn) != NOTE)
- {
- priority (insn);
- if (last == 0)
- {
- ready[n_ready++] = insn;
- INSN_PRIORITY (insn) = TAIL_PRIORITY - i;
- INSN_REF_COUNT (insn) = 0;
- }
- else if (! find_insn_list (insn, LOG_LINKS (last)))
- {
- add_dependence (last, insn, REG_DEP_ANTI);
- INSN_REF_COUNT (insn)++;
- }
- last = insn;
-
- /* Skip over insns that are part of a group. */
- while (SCHED_GROUP_P (insn))
- {
- insn = prev_nonnote_insn (insn);
- priority (insn);
- }
- }
-
- insn = PREV_INSN (insn);
- /* Don't overrun the bounds of the basic block. */
- if (insn == prev_head)
- break;
- }
-
- /* Assign priorities to instructions. Also check whether they
- are in priority order already. If so then I will be nonnegative.
- We use this shortcut only before reloading. */
-#if 0
- i = reload_completed ? DONE_PRIORITY : MAX_PRIORITY;
-#endif
-
- for (; insn != prev_head; insn = PREV_INSN (insn))
- {
- if (GET_RTX_CLASS (GET_CODE (insn)) == 'i')
- {
- priority (insn);
- if (INSN_REF_COUNT (insn) == 0)
- {
- if (last == 0)
- ready[n_ready++] = insn;
- else
- {
- /* Make this dependent on the last of the instructions
- that must remain in order at the end of the block. */
- add_dependence (last, insn, REG_DEP_ANTI);
- INSN_REF_COUNT (insn) = 1;
- }
- }
- if (SCHED_GROUP_P (insn))
- {
- while (SCHED_GROUP_P (insn))
- {
- insn = prev_nonnote_insn (insn);
- priority (insn);
- }
- continue;
- }
-#if 0
- if (i < 0)
- continue;
- if (INSN_PRIORITY (insn) < i)
- i = INSN_PRIORITY (insn);
- else if (INSN_PRIORITY (insn) > i)
- i = DONE_PRIORITY;
-#endif
- }
- }
-
-#if 0
- /* This short-cut doesn't work. It does not count call insns crossed by
- registers in reg_sometimes_live. It does not mark these registers as
- dead if they die in this block. It does not mark these registers live
- (or create new reg_sometimes_live entries if necessary) if they are born
- in this block.
-
- The easy solution is to just always schedule a block. These blocks tend
- to be very short, so this doesn't slow down this pass by much. */
-
- /* If existing order is good, don't bother to reorder. */
- if (i != DONE_PRIORITY)
- {
- if (file)
- fprintf (file, ";; already scheduled\n");
-
- if (reload_completed == 0)
- {
- for (i = 0; i < sometimes_max; i++)
- regs_sometimes_live[i].live_length += n_insns;
-
- finish_sometimes_live (regs_sometimes_live, sometimes_max);
- }
- free_pending_lists ();
- goto ret;
- }
-#endif
-
- /* Scan all the insns to be scheduled, removing NOTE insns
- and register death notes.
- Line number NOTE insns end up in NOTE_LIST.
- Register death notes end up in DEAD_NOTES.
-
- Recreate the register life information for the end of this basic
- block. */
-
- if (reload_completed == 0)
- {
- COPY_REG_SET (bb_live_regs, BASIC_BLOCK (b)->global_live_at_start);
- CLEAR_REG_SET (bb_dead_regs);
-
- if (b == 0)
- {
- /* This is the first block in the function. There may be insns
- before head that we can't schedule. We still need to examine
- them though for accurate register lifetime analysis. */
-
- /* We don't want to remove any REG_DEAD notes as the code below
- does. */
-
- for (insn = BLOCK_HEAD (b); insn != head;
- insn = NEXT_INSN (insn))
- if (GET_RTX_CLASS (GET_CODE (insn)) == 'i')
- {
- /* See if the register gets born here. */
- /* We must check for registers being born before we check for
- registers dying. It is possible for a register to be born
- and die in the same insn, e.g. reading from a volatile
- memory location into an otherwise unused register. Such
- a register must be marked as dead after this insn. */
- if (GET_CODE (PATTERN (insn)) == SET
- || GET_CODE (PATTERN (insn)) == CLOBBER)
- sched_note_set (PATTERN (insn), 0);
- else if (GET_CODE (PATTERN (insn)) == PARALLEL)
- {
- int j;
- for (j = XVECLEN (PATTERN (insn), 0) - 1; j >= 0; j--)
- if (GET_CODE (XVECEXP (PATTERN (insn), 0, j)) == SET
- || GET_CODE (XVECEXP (PATTERN (insn), 0, j)) == CLOBBER)
- sched_note_set (XVECEXP (PATTERN (insn), 0, j), 0);
-
- /* ??? This code is obsolete and should be deleted. It
- is harmless though, so we will leave it in for now. */
- for (j = XVECLEN (PATTERN (insn), 0) - 1; j >= 0; j--)
- if (GET_CODE (XVECEXP (PATTERN (insn), 0, j)) == USE)
- sched_note_set (XVECEXP (PATTERN (insn), 0, j), 0);
- }
-
- /* Each call clobbers (makes live) all call-clobbered regs
- that are not global or fixed. Note that the function-value
- reg is a call_clobbered reg. */
-
- if (GET_CODE (insn) == CALL_INSN)
- {
- int j;
- for (j = 0; j < FIRST_PSEUDO_REGISTER; j++)
- if (call_used_regs[j] && ! global_regs[j]
- && ! fixed_regs[j])
- {
- SET_REGNO_REG_SET (bb_live_regs, j);
- CLEAR_REGNO_REG_SET (bb_dead_regs, j);
- }
- }
-
- for (link = REG_NOTES (insn); link; link = XEXP (link, 1))
- {
- if ((REG_NOTE_KIND (link) == REG_DEAD
- || REG_NOTE_KIND (link) == REG_UNUSED)
- /* Verify that the REG_NOTE has a valid value. */
- && GET_CODE (XEXP (link, 0)) == REG)
- {
- register int regno = REGNO (XEXP (link, 0));
-
- if (regno < FIRST_PSEUDO_REGISTER)
- {
- int j = HARD_REGNO_NREGS (regno,
- GET_MODE (XEXP (link, 0)));
- while (--j >= 0)
- {
- CLEAR_REGNO_REG_SET (bb_live_regs, regno + j);
- SET_REGNO_REG_SET (bb_dead_regs, regno + j);
- }
- }
- else
- {
- CLEAR_REGNO_REG_SET (bb_live_regs, regno);
- SET_REGNO_REG_SET (bb_dead_regs, regno);
- }
- }
- }
- }
- }
- }
-
- /* If debugging information is being produced, keep track of the line
- number notes for each insn. */
- if (write_symbols != NO_DEBUG)
- {
- /* We must use the true line number for the first insn in the block
- that was computed and saved at the start of this pass. We can't
- use the current line number, because scheduling of the previous
- block may have changed the current line number. */
- rtx line = line_note_head[b];
-
- for (insn = BLOCK_HEAD (b);
- insn != next_tail;
- insn = NEXT_INSN (insn))
- if (GET_CODE (insn) == NOTE && NOTE_LINE_NUMBER (insn) > 0)
- line = insn;
- else
- LINE_NOTE (insn) = line;
- }
-
- for (insn = head; insn != next_tail; insn = NEXT_INSN (insn))
- {
- rtx prev, next, link;
-
- /* Farm out notes. This is needed to keep the debugger from
- getting completely deranged. */
- if (GET_CODE (insn) == NOTE)
- {
- prev = insn;
- insn = unlink_notes (insn, next_tail);
- if (prev == tail)
- abort ();
- if (prev == head)
- abort ();
- if (insn == next_tail)
- abort ();
- }
-
- if (reload_completed == 0
- && GET_RTX_CLASS (GET_CODE (insn)) == 'i')
- {
- /* See if the register gets born here. */
- /* We must check for registers being born before we check for
- registers dying. It is possible for a register to be born and
- die in the same insn, e.g. reading from a volatile memory
- location into an otherwise unused register. Such a register
- must be marked as dead after this insn. */
- if (GET_CODE (PATTERN (insn)) == SET
- || GET_CODE (PATTERN (insn)) == CLOBBER)
- sched_note_set (PATTERN (insn), 0);
- else if (GET_CODE (PATTERN (insn)) == PARALLEL)
- {
- int j;
- for (j = XVECLEN (PATTERN (insn), 0) - 1; j >= 0; j--)
- if (GET_CODE (XVECEXP (PATTERN (insn), 0, j)) == SET
- || GET_CODE (XVECEXP (PATTERN (insn), 0, j)) == CLOBBER)
- sched_note_set (XVECEXP (PATTERN (insn), 0, j), 0);
-
- /* ??? This code is obsolete and should be deleted. It
- is harmless though, so we will leave it in for now. */
- for (j = XVECLEN (PATTERN (insn), 0) - 1; j >= 0; j--)
- if (GET_CODE (XVECEXP (PATTERN (insn), 0, j)) == USE)
- sched_note_set (XVECEXP (PATTERN (insn), 0, j), 0);
- }
-
- /* Each call clobbers (makes live) all call-clobbered regs that are
- not global or fixed. Note that the function-value reg is a
- call_clobbered reg. */
-
- if (GET_CODE (insn) == CALL_INSN)
- {
- int j;
- for (j = 0; j < FIRST_PSEUDO_REGISTER; j++)
- if (call_used_regs[j] && ! global_regs[j]
- && ! fixed_regs[j])
- {
- SET_REGNO_REG_SET (bb_live_regs, j);
- CLEAR_REGNO_REG_SET (bb_dead_regs, j);
- }
- }
-
- /* Need to know what registers this insn kills. */
- for (prev = 0, link = REG_NOTES (insn); link; link = next)
- {
- next = XEXP (link, 1);
- if ((REG_NOTE_KIND (link) == REG_DEAD
- || REG_NOTE_KIND (link) == REG_UNUSED)
- /* Verify that the REG_NOTE has a valid value. */
- && GET_CODE (XEXP (link, 0)) == REG)
- {
- register int regno = REGNO (XEXP (link, 0));
-
- /* Only unlink REG_DEAD notes; leave REG_UNUSED notes
- alone. */
- if (REG_NOTE_KIND (link) == REG_DEAD)
- {
- if (prev)
- XEXP (prev, 1) = next;
- else
- REG_NOTES (insn) = next;
- XEXP (link, 1) = dead_notes;
- dead_notes = link;
- }
- else
- prev = link;
-
- if (regno < FIRST_PSEUDO_REGISTER)
- {
- int j = HARD_REGNO_NREGS (regno,
- GET_MODE (XEXP (link, 0)));
- while (--j >= 0)
- {
- CLEAR_REGNO_REG_SET (bb_live_regs, regno + j);
- SET_REGNO_REG_SET (bb_dead_regs, regno + j);
- }
- }
- else
- {
- CLEAR_REGNO_REG_SET (bb_live_regs, regno);
- SET_REGNO_REG_SET (bb_dead_regs, regno);
- }
- }
- else
- prev = link;
- }
- }
- }
-
- if (reload_completed == 0)
- {
- /* Keep track of register lives. */
- old_live_regs = ALLOCA_REG_SET ();
- regs_sometimes_live
- = (struct sometimes *) alloca (max_regno * sizeof (struct sometimes));
- sometimes_max = 0;
-
- /* Start with registers live at end. */
- COPY_REG_SET (old_live_regs, bb_live_regs);
- EXECUTE_IF_SET_IN_REG_SET (bb_live_regs, 0, j,
- {
- sometimes_max
- = new_sometimes_live (regs_sometimes_live,
- j, sometimes_max);
- });
- }
-
- SCHED_SORT (ready, n_ready, 1);
-
- if (file)
- {
- fprintf (file, ";; ready list initially:\n;; ");
- for (i = 0; i < n_ready; i++)
- fprintf (file, "%d ", INSN_UID (ready[i]));
- fprintf (file, "\n\n");
-
- for (insn = head; insn != next_tail; insn = NEXT_INSN (insn))
- if (INSN_PRIORITY (insn) > 0)
- fprintf (file, ";; insn[%4d]: priority = %4d, ref_count = %4d\n",
- INSN_UID (insn), INSN_PRIORITY (insn),
- INSN_REF_COUNT (insn));
- }
-
- /* Now HEAD and TAIL are going to become disconnected
- entirely from the insn chain. */
- tail = 0;
-
- /* Q_SIZE will always be zero here. */
- q_ptr = 0; clock = 0;
- bzero ((char *) insn_queue, sizeof (insn_queue));
-
- /* Now, perform list scheduling. */
-
- /* Where we start inserting insns is after TAIL. */
- last = next_tail;
-
- new_needs = (NEXT_INSN (prev_head) == BLOCK_HEAD (b)
- ? NEED_HEAD : NEED_NOTHING);
- if (PREV_INSN (next_tail) == BLOCK_END (b))
- new_needs |= NEED_TAIL;
-
- new_ready = n_ready;
- while (sched_n_insns < n_insns)
- {
- q_ptr = NEXT_Q (q_ptr); clock++;
-
- /* Add all pending insns that can be scheduled without stalls to the
- ready list. */
- for (insn = insn_queue[q_ptr]; insn; insn = NEXT_INSN (insn))
- {
- if (file)
- fprintf (file, ";; launching %d before %d with no stalls at T-%d\n",
- INSN_UID (insn), INSN_UID (last), clock);
- ready[new_ready++] = insn;
- q_size -= 1;
- }
- insn_queue[q_ptr] = 0;
-
- /* If there are no ready insns, stall until one is ready and add all
- of the pending insns at that point to the ready list. */
- if (new_ready == 0)
- {
- register int stalls;
-
- for (stalls = 1; stalls < INSN_QUEUE_SIZE; stalls++)
- if ((insn = insn_queue[NEXT_Q_AFTER (q_ptr, stalls)]))
- {
- for (; insn; insn = NEXT_INSN (insn))
- {
- if (file)
- fprintf (file, ";; launching %d before %d with %d stalls at T-%d\n",
- INSN_UID (insn), INSN_UID (last), stalls, clock);
- ready[new_ready++] = insn;
- q_size -= 1;
- }
- insn_queue[NEXT_Q_AFTER (q_ptr, stalls)] = 0;
- break;
- }
-
- q_ptr = NEXT_Q_AFTER (q_ptr, stalls); clock += stalls;
- }
-
- /* There should be some instructions waiting to fire. */
- if (new_ready == 0)
- abort ();
-
- if (file)
- {
- fprintf (file, ";; ready list at T-%d:", clock);
- for (i = 0; i < new_ready; i++)
- fprintf (file, " %d (%x)",
- INSN_UID (ready[i]), INSN_PRIORITY (ready[i]));
- }
-
- /* Sort the ready list and choose the best insn to schedule. Select
- which insn should issue in this cycle and queue those that are
- blocked by function unit hazards.
-
- N_READY holds the number of items that were scheduled the last time,
- minus the one instruction scheduled on the last loop iteration; it
- is not modified for any other reason in this loop. */
-
- SCHED_SORT (ready, new_ready, n_ready);
- if (MAX_BLOCKAGE > 1)
- {
- new_ready = schedule_select (ready, new_ready, clock, file);
- if (new_ready == 0)
- {
- if (file)
- fprintf (file, "\n");
- /* We must set n_ready here, to ensure that sorting always
- occurs when we come back to the SCHED_SORT line above. */
- n_ready = 0;
- continue;
- }
- }
- n_ready = new_ready;
- last_scheduled_insn = insn = ready[0];
-
- /* The first insn scheduled becomes the new tail. */
- if (tail == 0)
- tail = insn;
-
- if (file)
- {
- fprintf (file, ", now");
- for (i = 0; i < n_ready; i++)
- fprintf (file, " %d", INSN_UID (ready[i]));
- fprintf (file, "\n");
- }
-
- if (DONE_PRIORITY_P (insn))
- abort ();
-
- if (reload_completed == 0)
- {
- /* Process this insn, and each insn linked to this one which must
- be immediately output after this insn. */
- do
- {
- /* First we kill registers set by this insn, and then we
- make registers used by this insn live. This is the opposite
- order used above because we are traversing the instructions
- backwards. */
-
- /* Strictly speaking, we should scan REG_UNUSED notes and make
- every register mentioned there live, however, we will just
- kill them again immediately below, so there doesn't seem to
- be any reason why we bother to do this. */
-
- /* See if this is the last notice we must take of a register. */
- if (GET_CODE (PATTERN (insn)) == SET
- || GET_CODE (PATTERN (insn)) == CLOBBER)
- sched_note_set (PATTERN (insn), 1);
- else if (GET_CODE (PATTERN (insn)) == PARALLEL)
- {
- int j;
- for (j = XVECLEN (PATTERN (insn), 0) - 1; j >= 0; j--)
- if (GET_CODE (XVECEXP (PATTERN (insn), 0, j)) == SET
- || GET_CODE (XVECEXP (PATTERN (insn), 0, j)) == CLOBBER)
- sched_note_set (XVECEXP (PATTERN (insn), 0, j), 1);
- }
-
- /* This code keeps life analysis information up to date. */
- if (GET_CODE (insn) == CALL_INSN)
- {
- register struct sometimes *p;
-
- /* A call kills all call used registers that are not
- global or fixed, except for those mentioned in the call
- pattern which will be made live again later. */
- for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
- if (call_used_regs[i] && ! global_regs[i]
- && ! fixed_regs[i])
- {
- CLEAR_REGNO_REG_SET (bb_live_regs, i);
- SET_REGNO_REG_SET (bb_dead_regs, i);
- }
-
- /* Regs live at the time of a call instruction must not
- go in a register clobbered by calls. Record this for
- all regs now live. Note that insns which are born or
- die in a call do not cross a call, so this must be done
- after the killings (above) and before the births
- (below). */
- p = regs_sometimes_live;
- for (i = 0; i < sometimes_max; i++, p++)
- if (REGNO_REG_SET_P (bb_live_regs, p->regno))
- p->calls_crossed += 1;
- }
-
- /* Make every register used live, and add REG_DEAD notes for
- registers which were not live before we started. */
- attach_deaths_insn (insn);
-
- /* Find registers now made live by that instruction. */
- EXECUTE_IF_AND_COMPL_IN_REG_SET (bb_live_regs, old_live_regs, 0, i,
- {
- sometimes_max
- = new_sometimes_live (regs_sometimes_live,
- i, sometimes_max);
- });
- IOR_REG_SET (old_live_regs, bb_live_regs);
-
- /* Count lengths of all regs we are worrying about now,
- and handle registers no longer live. */
-
- for (i = 0; i < sometimes_max; i++)
- {
- register struct sometimes *p = &regs_sometimes_live[i];
- int regno = p->regno;
-
- p->live_length += 1;
-
- if (!REGNO_REG_SET_P (bb_live_regs, p->regno))
- {
- /* This is the end of one of this register's lifetime
- segments. Save the lifetime info collected so far,
- and clear its bit in the old_live_regs entry. */
- sched_reg_live_length[regno] += p->live_length;
- sched_reg_n_calls_crossed[regno] += p->calls_crossed;
- CLEAR_REGNO_REG_SET (old_live_regs, p->regno);
-
- /* Delete the reg_sometimes_live entry for this reg by
- copying the last entry over top of it. */
- *p = regs_sometimes_live[--sometimes_max];
- /* ...and decrement i so that this newly copied entry
- will be processed. */
- i--;
- }
- }
-
- link = insn;
- insn = PREV_INSN (insn);
- }
- while (SCHED_GROUP_P (link));
-
- /* Set INSN back to the insn we are scheduling now. */
- insn = ready[0];
- }
-
- /* Schedule INSN. Remove it from the ready list. */
- ready += 1;
- n_ready -= 1;
-
- sched_n_insns += 1;
- NEXT_INSN (insn) = last;
- PREV_INSN (last) = insn;
-
- /* Everything that precedes INSN now either becomes "ready", if
- it can execute immediately before INSN, or "pending", if
- there must be a delay. Give INSN high enough priority that
- at least one (maybe more) reg-killing insns can be launched
- ahead of all others. Mark INSN as scheduled by changing its
- priority to -1. */
- INSN_PRIORITY (insn) = LAUNCH_PRIORITY;
- new_ready = schedule_insn (insn, ready, n_ready, clock);
- INSN_PRIORITY (insn) = DONE_PRIORITY;
-
- /* Schedule all prior insns that must not be moved. */
- if (SCHED_GROUP_P (insn))
- {
- /* Disable these insns from being launched, in case one of the
- insns in the group has a dependency on an earlier one. */
- link = insn;
- while (SCHED_GROUP_P (link))
- {
- /* Disable these insns from being launched by anybody. */
- link = PREV_INSN (link);
- INSN_REF_COUNT (link) = 0;
- }
-
- /* Now handle each group insn like the main insn was handled
- above. */
- link = insn;
- while (SCHED_GROUP_P (link))
- {
- link = PREV_INSN (link);
-
- sched_n_insns += 1;
-
- /* ??? Why don't we set LAUNCH_PRIORITY here? */
- new_ready = schedule_insn (link, ready, new_ready, clock);
- INSN_PRIORITY (link) = DONE_PRIORITY;
- }
- }
-
- /* Put back NOTE_INSN_SETJMP,
- NOTE_INSN_{LOOP,EHREGION}_{BEGIN,END} notes. */
-
- /* To prime the loop. We need to handle INSN and all the insns in the
- sched group. */
- last = NEXT_INSN (insn);
- do
- {
- insn = PREV_INSN (last);
-
- /* Maintain a valid chain so emit_note_before works.
- This is necessary because PREV_INSN (insn) isn't valid
- (if ! SCHED_GROUP_P) and if it points to an insn already
- scheduled, a circularity will result. */
- if (! SCHED_GROUP_P (insn))
- {
- NEXT_INSN (prev_head) = insn;
- PREV_INSN (insn) = prev_head;
- }
-
- last = reemit_notes (insn, insn);
- }
- while (SCHED_GROUP_P (insn));
- }
- if (q_size != 0)
- abort ();
-
- if (reload_completed == 0)
- finish_sometimes_live (regs_sometimes_live, sometimes_max);
-
- /* HEAD is now the first insn in the chain of insns that
- been scheduled by the loop above.
- TAIL is the last of those insns. */
- head = last;
-
- /* NOTE_LIST is the end of a chain of notes previously found
- among the insns. Insert them at the beginning of the insns. */
- if (note_list != 0)
- {
- rtx note_head = note_list;
- while (PREV_INSN (note_head))
- note_head = PREV_INSN (note_head);
-
- PREV_INSN (head) = note_list;
- NEXT_INSN (note_list) = head;
- head = note_head;
- }
-
- /* There should be no REG_DEAD notes leftover at the end.
- In practice, this can occur as the result of bugs in flow, combine.c,
- and/or sched.c. The values of the REG_DEAD notes remaining are
- meaningless, because dead_notes is just used as a free list. */
-#if 1
- if (dead_notes != 0)
- abort ();
-#endif
-
- if (new_needs & NEED_HEAD)
- BLOCK_HEAD (b) = head;
- PREV_INSN (head) = prev_head;
- NEXT_INSN (prev_head) = head;
-
- if (new_needs & NEED_TAIL)
- BLOCK_END (b) = tail;
- NEXT_INSN (tail) = next_tail;
- PREV_INSN (next_tail) = tail;
-
- /* Restore the line-number notes of each insn. */
- if (write_symbols != NO_DEBUG)
- {
- rtx line, note, prev, new;
- int notes = 0;
-
- head = BLOCK_HEAD (b);
- next_tail = NEXT_INSN (BLOCK_END (b));
-
- /* Determine the current line-number. We want to know the current
- line number of the first insn of the block here, in case it is
- different from the true line number that was saved earlier. If
- different, then we need a line number note before the first insn
- of this block. If it happens to be the same, then we don't want to
- emit another line number note here. */
- for (line = head; line; line = PREV_INSN (line))
- if (GET_CODE (line) == NOTE && NOTE_LINE_NUMBER (line) > 0)
- break;
-
- /* Walk the insns keeping track of the current line-number and inserting
- the line-number notes as needed. */
- for (insn = head; insn != next_tail; insn = NEXT_INSN (insn))
- if (GET_CODE (insn) == NOTE && NOTE_LINE_NUMBER (insn) > 0)
- line = insn;
- /* This used to emit line number notes before every non-deleted note.
- However, this confuses a debugger, because line notes not separated
- by real instructions all end up at the same address. I can find no
- use for line number notes before other notes, so none are emitted. */
- else if (GET_CODE (insn) != NOTE
- && (note = LINE_NOTE (insn)) != 0
- && note != line
- && (line == 0
- || NOTE_LINE_NUMBER (note) != NOTE_LINE_NUMBER (line)
- || NOTE_SOURCE_FILE (note) != NOTE_SOURCE_FILE (line)))
- {
- line = note;
- prev = PREV_INSN (insn);
- if (LINE_NOTE (note))
- {
- /* Re-use the original line-number note. */
- LINE_NOTE (note) = 0;
- PREV_INSN (note) = prev;
- NEXT_INSN (prev) = note;
- PREV_INSN (insn) = note;
- NEXT_INSN (note) = insn;
- }
- else
- {
- notes++;
- new = emit_note_after (NOTE_LINE_NUMBER (note), prev);
- NOTE_SOURCE_FILE (new) = NOTE_SOURCE_FILE (note);
- RTX_INTEGRATED_P (new) = RTX_INTEGRATED_P (note);
- }
- }
- if (file && notes)
- fprintf (file, ";; added %d line-number notes\n", notes);
- }
-
- if (file)
- {
- fprintf (file, ";; total time = %d\n;; new basic block head = %d\n;; new basic block end = %d\n\n",
- clock, INSN_UID (BLOCK_HEAD (b)), INSN_UID (BLOCK_END (b)));
- }
-
- /* Yow! We're done! */
- free_pending_lists ();
-
-ret:
- FREE_REG_SET (reg_pending_sets);
- FREE_REG_SET (old_live_regs);
-
- return;
-}
-
-/* Subroutine of update_flow_info. Determines whether any new REG_NOTEs are
- needed for the hard register mentioned in the note. This can happen
- if the reference to the hard register in the original insn was split into
- several smaller hard register references in the split insns. */
-
-static void
-split_hard_reg_notes (note, first, last)
- rtx note, first, last;
-{
- rtx reg, temp, link;
- int n_regs, i, new_reg;
- rtx insn;
-
- /* Assume that this is a REG_DEAD note. */
- if (REG_NOTE_KIND (note) != REG_DEAD)
- abort ();
-
- reg = XEXP (note, 0);
-
- n_regs = HARD_REGNO_NREGS (REGNO (reg), GET_MODE (reg));
-
- for (i = 0; i < n_regs; i++)
- {
- new_reg = REGNO (reg) + i;
-
- /* Check for references to new_reg in the split insns. */
- for (insn = last; ; insn = PREV_INSN (insn))
- {
- if (GET_RTX_CLASS (GET_CODE (insn)) == 'i'
- && (temp = regno_use_in (new_reg, PATTERN (insn))))
- {
- /* Create a new reg dead note here. */
- link = rtx_alloc (EXPR_LIST);
- PUT_REG_NOTE_KIND (link, REG_DEAD);
- XEXP (link, 0) = temp;
- XEXP (link, 1) = REG_NOTES (insn);
- REG_NOTES (insn) = link;
-
- /* If killed multiple registers here, then add in the excess. */
- i += HARD_REGNO_NREGS (REGNO (temp), GET_MODE (temp)) - 1;
-
- break;
- }
- /* It isn't mentioned anywhere, so no new reg note is needed for
- this register. */
- if (insn == first)
- break;
- }
- }
-}
-
-/* Subroutine of update_flow_info. Determines whether a SET or CLOBBER in an
- insn created by splitting needs a REG_DEAD or REG_UNUSED note added. */
-
-static void
-new_insn_dead_notes (pat, insn, last, orig_insn)
- rtx pat, insn, last, orig_insn;
-{
- rtx dest, tem, set;
-
- /* PAT is either a CLOBBER or a SET here. */
- dest = XEXP (pat, 0);
-
- while (GET_CODE (dest) == ZERO_EXTRACT || GET_CODE (dest) == SUBREG
- || GET_CODE (dest) == STRICT_LOW_PART
- || GET_CODE (dest) == SIGN_EXTRACT)
- dest = XEXP (dest, 0);
-
- if (GET_CODE (dest) == REG)
- {
- /* If the original insn already used this register, we may not add new
- notes for it. One example for a split that needs this test is
- when a multi-word memory access with register-indirect addressing
- is split into multiple memory accesses with auto-increment and
- one adjusting add instruction for the address register. */
- if (reg_referenced_p (dest, PATTERN (orig_insn)))
- return;
- for (tem = last; tem != insn; tem = PREV_INSN (tem))
- {
- if (GET_RTX_CLASS (GET_CODE (tem)) == 'i'
- && reg_overlap_mentioned_p (dest, PATTERN (tem))
- && (set = single_set (tem)))
- {
- rtx tem_dest = SET_DEST (set);
-
- while (GET_CODE (tem_dest) == ZERO_EXTRACT
- || GET_CODE (tem_dest) == SUBREG
- || GET_CODE (tem_dest) == STRICT_LOW_PART
- || GET_CODE (tem_dest) == SIGN_EXTRACT)
- tem_dest = XEXP (tem_dest, 0);
-
- if (! rtx_equal_p (tem_dest, dest))
- {
- /* Use the same scheme as combine.c, don't put both REG_DEAD
- and REG_UNUSED notes on the same insn. */
- if (! find_regno_note (tem, REG_UNUSED, REGNO (dest))
- && ! find_regno_note (tem, REG_DEAD, REGNO (dest)))
- {
- rtx note = rtx_alloc (EXPR_LIST);
- PUT_REG_NOTE_KIND (note, REG_DEAD);
- XEXP (note, 0) = dest;
- XEXP (note, 1) = REG_NOTES (tem);
- REG_NOTES (tem) = note;
- }
- /* The reg only dies in one insn, the last one that uses
- it. */
- break;
- }
- else if (reg_overlap_mentioned_p (dest, SET_SRC (set)))
- /* We found an instruction that both uses the register,
- and sets it, so no new REG_NOTE is needed for this set. */
- break;
- }
- }
- /* If this is a set, it must die somewhere, unless it is the dest of
- the original insn, and hence is live after the original insn. Abort
- if it isn't supposed to be live after the original insn.
-
- If this is a clobber, then just add a REG_UNUSED note. */
- if (tem == insn)
- {
- int live_after_orig_insn = 0;
- rtx pattern = PATTERN (orig_insn);
- int i;
-
- if (GET_CODE (pat) == CLOBBER)
- {
- rtx note = rtx_alloc (EXPR_LIST);
- PUT_REG_NOTE_KIND (note, REG_UNUSED);
- XEXP (note, 0) = dest;
- XEXP (note, 1) = REG_NOTES (insn);
- REG_NOTES (insn) = note;
- return;
- }
-
- /* The original insn could have multiple sets, so search the
- insn for all sets. */
- if (GET_CODE (pattern) == SET)
- {
- if (reg_overlap_mentioned_p (dest, SET_DEST (pattern)))
- live_after_orig_insn = 1;
- }
- else if (GET_CODE (pattern) == PARALLEL)
- {
- for (i = 0; i < XVECLEN (pattern, 0); i++)
- if (GET_CODE (XVECEXP (pattern, 0, i)) == SET
- && reg_overlap_mentioned_p (dest,
- SET_DEST (XVECEXP (pattern,
- 0, i))))
- live_after_orig_insn = 1;
- }
-
- if (! live_after_orig_insn)
- abort ();
- }
- }
-}
-
-/* Subroutine of update_flow_info. Update the value of reg_n_sets for all
- registers modified by X. INC is -1 if the containing insn is being deleted,
- and is 1 if the containing insn is a newly generated insn. */
-
-static void
-update_n_sets (x, inc)
- rtx x;
- int inc;
-{
- rtx dest = SET_DEST (x);
-
- while (GET_CODE (dest) == STRICT_LOW_PART || GET_CODE (dest) == SUBREG
- || GET_CODE (dest) == ZERO_EXTRACT || GET_CODE (dest) == SIGN_EXTRACT)
- dest = SUBREG_REG (dest);
-
- if (GET_CODE (dest) == REG)
- {
- int regno = REGNO (dest);
-
- if (regno < FIRST_PSEUDO_REGISTER)
- {
- register int i;
- int endregno = regno + HARD_REGNO_NREGS (regno, GET_MODE (dest));
-
- for (i = regno; i < endregno; i++)
- REG_N_SETS (i) += inc;
- }
- else
- REG_N_SETS (regno) += inc;
- }
-}
-
-/* Updates all flow-analysis related quantities (including REG_NOTES) for
- the insns from FIRST to LAST inclusive that were created by splitting
- ORIG_INSN. NOTES are the original REG_NOTES. */
-
-void
-update_flow_info (notes, first, last, orig_insn)
- rtx notes;
- rtx first, last;
- rtx orig_insn;
-{
- rtx insn, note;
- rtx next;
- rtx orig_dest, temp;
- rtx set;
-
- /* Get and save the destination set by the original insn. */
-
- orig_dest = single_set (orig_insn);
- if (orig_dest)
- orig_dest = SET_DEST (orig_dest);
-
- /* Move REG_NOTES from the original insn to where they now belong. */
-
- for (note = notes; note; note = next)
- {
- next = XEXP (note, 1);
- switch (REG_NOTE_KIND (note))
- {
- case REG_DEAD:
- case REG_UNUSED:
- /* Move these notes from the original insn to the last new insn where
- the register is now set. */
-
- for (insn = last; ; insn = PREV_INSN (insn))
- {
- if (GET_RTX_CLASS (GET_CODE (insn)) == 'i'
- && reg_mentioned_p (XEXP (note, 0), PATTERN (insn)))
- {
- /* If this note refers to a multiple word hard register, it
- may have been split into several smaller hard register
- references, so handle it specially. */
- temp = XEXP (note, 0);
- if (REG_NOTE_KIND (note) == REG_DEAD
- && GET_CODE (temp) == REG
- && REGNO (temp) < FIRST_PSEUDO_REGISTER
- && HARD_REGNO_NREGS (REGNO (temp), GET_MODE (temp)) > 1)
- split_hard_reg_notes (note, first, last);
- else
- {
- XEXP (note, 1) = REG_NOTES (insn);
- REG_NOTES (insn) = note;
- }
-
- /* Sometimes need to convert REG_UNUSED notes to REG_DEAD
- notes. */
- /* ??? This won't handle multiple word registers correctly,
- but should be good enough for now. */
- if (REG_NOTE_KIND (note) == REG_UNUSED
- && GET_CODE (XEXP (note, 0)) != SCRATCH
- && ! dead_or_set_p (insn, XEXP (note, 0)))
- PUT_REG_NOTE_KIND (note, REG_DEAD);
-
- /* The reg only dies in one insn, the last one that uses
- it. */
- break;
- }
- /* It must die somewhere, fail it we couldn't find where it died.
-
- If this is a REG_UNUSED note, then it must be a temporary
- register that was not needed by this instantiation of the
- pattern, so we can safely ignore it. */
- if (insn == first)
- {
- if (REG_NOTE_KIND (note) != REG_UNUSED)
- abort ();
-
- break;
- }
- }
- break;
-
- case REG_WAS_0:
- /* If the insn that set the register to 0 was deleted, this
- note cannot be relied on any longer. The destination might
- even have been moved to memory.
- This was observed for SH4 with execute/920501-6.c compilation,
- -O2 -fomit-frame-pointer -finline-functions . */
- if (GET_CODE (XEXP (note, 0)) == NOTE
- || INSN_DELETED_P (XEXP (note, 0)))
- break;
- /* This note applies to the dest of the original insn. Find the
- first new insn that now has the same dest, and move the note
- there. */
-
- if (! orig_dest)
- abort ();
-
- for (insn = first; ; insn = NEXT_INSN (insn))
- {
- if (GET_RTX_CLASS (GET_CODE (insn)) == 'i'
- && (temp = single_set (insn))
- && rtx_equal_p (SET_DEST (temp), orig_dest))
- {
- XEXP (note, 1) = REG_NOTES (insn);
- REG_NOTES (insn) = note;
- /* The reg is only zero before one insn, the first that
- uses it. */
- break;
- }
- /* If this note refers to a multiple word hard
- register, it may have been split into several smaller
- hard register references. We could split the notes,
- but simply dropping them is good enough. */
- if (GET_CODE (orig_dest) == REG
- && REGNO (orig_dest) < FIRST_PSEUDO_REGISTER
- && HARD_REGNO_NREGS (REGNO (orig_dest),
- GET_MODE (orig_dest)) > 1)
- break;
- /* It must be set somewhere, fail if we couldn't find where it
- was set. */
- if (insn == last)
- abort ();
- }
- break;
-
- case REG_EQUAL:
- case REG_EQUIV:
- /* A REG_EQUIV or REG_EQUAL note on an insn with more than one
- set is meaningless. Just drop the note. */
- if (! orig_dest)
- break;
-
- case REG_NO_CONFLICT:
- /* These notes apply to the dest of the original insn. Find the last
- new insn that now has the same dest, and move the note there. */
-
- if (! orig_dest)
- abort ();
-
- for (insn = last; ; insn = PREV_INSN (insn))
- {
- if (GET_RTX_CLASS (GET_CODE (insn)) == 'i'
- && (temp = single_set (insn))
- && rtx_equal_p (SET_DEST (temp), orig_dest))
- {
- XEXP (note, 1) = REG_NOTES (insn);
- REG_NOTES (insn) = note;
- /* Only put this note on one of the new insns. */
- break;
- }
-
- /* The original dest must still be set someplace. Abort if we
- couldn't find it. */
- if (insn == first)
- {
- /* However, if this note refers to a multiple word hard
- register, it may have been split into several smaller
- hard register references. We could split the notes,
- but simply dropping them is good enough. */
- if (GET_CODE (orig_dest) == REG
- && REGNO (orig_dest) < FIRST_PSEUDO_REGISTER
- && HARD_REGNO_NREGS (REGNO (orig_dest),
- GET_MODE (orig_dest)) > 1)
- break;
- /* Likewise for multi-word memory references. */
- if (GET_CODE (orig_dest) == MEM
- && SIZE_FOR_MODE (orig_dest) > MOVE_MAX)
- break;
- abort ();
- }
- }
- break;
-
- case REG_LIBCALL:
- /* Move a REG_LIBCALL note to the first insn created, and update
- the corresponding REG_RETVAL note. */
- XEXP (note, 1) = REG_NOTES (first);
- REG_NOTES (first) = note;
-
- insn = XEXP (note, 0);
- note = find_reg_note (insn, REG_RETVAL, NULL_RTX);
- if (note)
- XEXP (note, 0) = first;
- break;
-
- case REG_EXEC_COUNT:
- /* Move a REG_EXEC_COUNT note to the first insn created. */
- XEXP (note, 1) = REG_NOTES (first);
- REG_NOTES (first) = note;
- break;
-
- case REG_RETVAL:
- /* Move a REG_RETVAL note to the last insn created, and update
- the corresponding REG_LIBCALL note. */
- XEXP (note, 1) = REG_NOTES (last);
- REG_NOTES (last) = note;
-
- insn = XEXP (note, 0);
- note = find_reg_note (insn, REG_LIBCALL, NULL_RTX);
- if (note)
- XEXP (note, 0) = last;
- break;
-
- case REG_NONNEG:
- case REG_BR_PROB:
- /* This should be moved to whichever instruction is a JUMP_INSN. */
-
- for (insn = last; ; insn = PREV_INSN (insn))
- {
- if (GET_CODE (insn) == JUMP_INSN)
- {
- XEXP (note, 1) = REG_NOTES (insn);
- REG_NOTES (insn) = note;
- /* Only put this note on one of the new insns. */
- break;
- }
- /* Fail if we couldn't find a JUMP_INSN. */
- if (insn == first)
- abort ();
- }
- break;
-
- case REG_INC:
- /* reload sometimes leaves obsolete REG_INC notes around. */
- if (reload_completed)
- break;
- /* This should be moved to whichever instruction now has the
- increment operation. */
- abort ();
-
- case REG_LABEL:
- /* Should be moved to the new insn(s) which use the label. */
- for (insn = first; insn != NEXT_INSN (last); insn = NEXT_INSN (insn))
- if (GET_RTX_CLASS (GET_CODE (insn)) == 'i'
- && reg_mentioned_p (XEXP (note, 0), PATTERN (insn)))
- REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_LABEL,
- XEXP (note, 0),
- REG_NOTES (insn));
- break;
-
- case REG_CC_SETTER:
- case REG_CC_USER:
- /* These two notes will never appear until after reorg, so we don't
- have to handle them here. */
- default:
- abort ();
- }
- }
-
- /* Each new insn created, except the last, has a new set. If the destination
- is a register, then this reg is now live across several insns, whereas
- previously the dest reg was born and died within the same insn. To
- reflect this, we now need a REG_DEAD note on the insn where this
- dest reg dies.
-
- Similarly, the new insns may have clobbers that need REG_UNUSED notes. */
-
- for (insn = first; insn != last; insn = NEXT_INSN (insn))
- {
- rtx pat;
- int i;
-
- pat = PATTERN (insn);
- if (GET_CODE (pat) == SET || GET_CODE (pat) == CLOBBER)
- new_insn_dead_notes (pat, insn, last, orig_insn);
- else if (GET_CODE (pat) == PARALLEL)
- {
- for (i = 0; i < XVECLEN (pat, 0); i++)
- if (GET_CODE (XVECEXP (pat, 0, i)) == SET
- || GET_CODE (XVECEXP (pat, 0, i)) == CLOBBER)
- new_insn_dead_notes (XVECEXP (pat, 0, i), insn, last, orig_insn);
- }
- }
-
- /* If any insn, except the last, uses the register set by the last insn,
- then we need a new REG_DEAD note on that insn. In this case, there
- would not have been a REG_DEAD note for this register in the original
- insn because it was used and set within one insn. */
-
- set = single_set (last);
- if (set)
- {
- rtx dest = SET_DEST (set);
-
- while (GET_CODE (dest) == ZERO_EXTRACT || GET_CODE (dest) == SUBREG
- || GET_CODE (dest) == STRICT_LOW_PART
- || GET_CODE (dest) == SIGN_EXTRACT)
- dest = XEXP (dest, 0);
-
- if (GET_CODE (dest) == REG
- /* Global registers are always live, so the code below does not
- apply to them. */
- && (REGNO (dest) >= FIRST_PSEUDO_REGISTER
- || ! global_regs[REGNO (dest)]))
- {
- rtx stop_insn = PREV_INSN (first);
-
- /* If the last insn uses the register that it is setting, then
- we don't want to put a REG_DEAD note there. Search backwards
- to find the first insn that sets but does not use DEST. */
-
- insn = last;
- if (reg_overlap_mentioned_p (dest, SET_SRC (set)))
- {
- for (insn = PREV_INSN (insn); insn != first;
- insn = PREV_INSN (insn))
- {
- if ((set = single_set (insn))
- && reg_mentioned_p (dest, SET_DEST (set))
- && ! reg_overlap_mentioned_p (dest, SET_SRC (set)))
- break;
- }
- }
-
- /* Now find the first insn that uses but does not set DEST. */
-
- for (insn = PREV_INSN (insn); insn != stop_insn;
- insn = PREV_INSN (insn))
- {
- if (GET_RTX_CLASS (GET_CODE (insn)) == 'i'
- && reg_mentioned_p (dest, PATTERN (insn))
- && (set = single_set (insn)))
- {
- rtx insn_dest = SET_DEST (set);
-
- while (GET_CODE (insn_dest) == ZERO_EXTRACT
- || GET_CODE (insn_dest) == SUBREG
- || GET_CODE (insn_dest) == STRICT_LOW_PART
- || GET_CODE (insn_dest) == SIGN_EXTRACT)
- insn_dest = XEXP (insn_dest, 0);
-
- if (insn_dest != dest)
- {
- note = rtx_alloc (EXPR_LIST);
- PUT_REG_NOTE_KIND (note, REG_DEAD);
- XEXP (note, 0) = dest;
- XEXP (note, 1) = REG_NOTES (insn);
- REG_NOTES (insn) = note;
- /* The reg only dies in one insn, the last one
- that uses it. */
- break;
- }
- }
- }
- }
- }
-
- /* If the original dest is modifying a multiple register target, and the
- original instruction was split such that the original dest is now set
- by two or more SUBREG sets, then the split insns no longer kill the
- destination of the original insn.
-
- In this case, if there exists an instruction in the same basic block,
- before the split insn, which uses the original dest, and this use is
- killed by the original insn, then we must remove the REG_DEAD note on
- this insn, because it is now superfluous.
-
- This does not apply when a hard register gets split, because the code
- knows how to handle overlapping hard registers properly. */
- if (orig_dest && GET_CODE (orig_dest) == REG)
- {
- int found_orig_dest = 0;
- int found_split_dest = 0;
-
- for (insn = first; ; insn = NEXT_INSN (insn))
- {
- rtx pat = PATTERN (insn);
- int i = GET_CODE (pat) == PARALLEL ? XVECLEN (pat, 0) : 0;
- set = pat;
- for (;;)
- {
- if (GET_CODE (set) == SET)
- {
- if (GET_CODE (SET_DEST (set)) == REG
- && REGNO (SET_DEST (set)) == REGNO (orig_dest))
- {
- found_orig_dest = 1;
- break;
- }
- else if (GET_CODE (SET_DEST (set)) == SUBREG
- && SUBREG_REG (SET_DEST (set)) == orig_dest)
- {
- found_split_dest = 1;
- break;
- }
- }
- if (--i < 0)
- break;
- set = XVECEXP (pat, 0, i);
- }
-
- if (insn == last)
- break;
- }
-
- if (found_split_dest)
- {
- /* Search backwards from FIRST, looking for the first insn that uses
- the original dest. Stop if we pass a CODE_LABEL or a JUMP_INSN.
- If we find an insn, and it has a REG_DEAD note, then delete the
- note. */
-
- for (insn = first; insn; insn = PREV_INSN (insn))
- {
- if (GET_CODE (insn) == CODE_LABEL
- || GET_CODE (insn) == JUMP_INSN)
- break;
- else if (GET_RTX_CLASS (GET_CODE (insn)) == 'i'
- && reg_mentioned_p (orig_dest, insn))
- {
- note = find_regno_note (insn, REG_DEAD, REGNO (orig_dest));
- if (note)
- remove_note (insn, note);
- }
- }
- }
- else if (! found_orig_dest)
- {
- int i, regno;
-
- /* Should never reach here for a pseudo reg. */
- if (REGNO (orig_dest) >= FIRST_PSEUDO_REGISTER)
- abort ();
-
- /* This can happen for a hard register, if the splitter
- does not bother to emit instructions which would be no-ops.
- We try to verify that this is the case by checking to see if
- the original instruction uses all of the registers that it
- set. This case is OK, because deleting a no-op can not affect
- REG_DEAD notes on other insns. If this is not the case, then
- abort. */
-
- regno = REGNO (orig_dest);
- for (i = HARD_REGNO_NREGS (regno, GET_MODE (orig_dest)) - 1;
- i >= 0; i--)
- if (! refers_to_regno_p (regno + i, regno + i + 1, orig_insn,
- NULL_PTR))
- break;
- if (i >= 0)
- abort ();
- }
- }
-
- /* Update reg_n_sets. This is necessary to prevent local alloc from
- converting REG_EQUAL notes to REG_EQUIV when splitting has modified
- a reg from set once to set multiple times. */
-
- {
- rtx x = PATTERN (orig_insn);
- RTX_CODE code = GET_CODE (x);
-
- if (code == SET || code == CLOBBER)
- update_n_sets (x, -1);
- else if (code == PARALLEL)
- {
- int i;
- for (i = XVECLEN (x, 0) - 1; i >= 0; i--)
- {
- code = GET_CODE (XVECEXP (x, 0, i));
- if (code == SET || code == CLOBBER)
- update_n_sets (XVECEXP (x, 0, i), -1);
- }
- }
-
- for (insn = first; ; insn = NEXT_INSN (insn))
- {
- x = PATTERN (insn);
- code = GET_CODE (x);
-
- if (code == SET || code == CLOBBER)
- update_n_sets (x, 1);
- else if (code == PARALLEL)
- {
- int i;
- for (i = XVECLEN (x, 0) - 1; i >= 0; i--)
- {
- code = GET_CODE (XVECEXP (x, 0, i));
- if (code == SET || code == CLOBBER)
- update_n_sets (XVECEXP (x, 0, i), 1);
- }
- }
-
- if (insn == last)
- break;
- }
- }
-}
-
-/* The one entry point in this file. DUMP_FILE is the dump file for
- this pass. */
-
-void
-schedule_insns (dump_file)
- FILE *dump_file;
-{
- int max_uid = MAX_INSNS_PER_SPLIT * (get_max_uid () + 1);
- int b;
- rtx insn;
-
- /* Taking care of this degenerate case makes the rest of
- this code simpler. */
- if (n_basic_blocks == 0)
- return;
-
- /* Create an insn here so that we can hang dependencies off of it later. */
- sched_before_next_call
- = gen_rtx_INSN (VOIDmode, 0, NULL_RTX, NULL_RTX,
- NULL_RTX, 0, NULL_RTX, NULL_RTX);
-
- /* Initialize the unused_*_lists. We can't use the ones left over from
- the previous function, because gcc has freed that memory. We can use
- the ones left over from the first sched pass in the second pass however,
- so only clear them on the first sched pass. The first pass is before
- reload if flag_schedule_insns is set, otherwise it is afterwards. */
-
- if (reload_completed == 0 || ! flag_schedule_insns)
- {
- unused_insn_list = 0;
- unused_expr_list = 0;
- }
-
- /* We create no insns here, only reorder them, so we
- remember how far we can cut back the stack on exit. */
-
- /* Allocate data for this pass. See comments, above,
- for what these vectors do.
-
- We use xmalloc instead of alloca, because max_uid can be very large
- when there is a lot of function inlining. If we used alloca, we could
- exceed stack limits on some hosts for some inputs. */
- insn_luid = (int *) xmalloc (max_uid * sizeof (int));
- insn_priority = (int *) xmalloc (max_uid * sizeof (int));
- insn_tick = (int *) xmalloc (max_uid * sizeof (int));
- insn_costs = (short *) xmalloc (max_uid * sizeof (short));
- insn_units = (short *) xmalloc (max_uid * sizeof (short));
- insn_blockage = (unsigned int *) xmalloc (max_uid * sizeof (unsigned int));
- insn_ref_count = (int *) xmalloc (max_uid * sizeof (int));
-
- if (reload_completed == 0)
- {
- sched_reg_n_calls_crossed = (int *) alloca (max_regno * sizeof (int));
- sched_reg_live_length = (int *) alloca (max_regno * sizeof (int));
- bb_dead_regs = ALLOCA_REG_SET ();
- bb_live_regs = ALLOCA_REG_SET ();
- bzero ((char *) sched_reg_n_calls_crossed, max_regno * sizeof (int));
- bzero ((char *) sched_reg_live_length, max_regno * sizeof (int));
- }
- else
- {
- sched_reg_n_calls_crossed = 0;
- sched_reg_live_length = 0;
- bb_dead_regs = 0;
- bb_live_regs = 0;
- }
- init_alias_analysis ();
-
- if (write_symbols != NO_DEBUG)
- {
- rtx line;
-
- line_note = (rtx *) xmalloc (max_uid * sizeof (rtx));
- bzero ((char *) line_note, max_uid * sizeof (rtx));
- line_note_head = (rtx *) alloca (n_basic_blocks * sizeof (rtx));
- bzero ((char *) line_note_head, n_basic_blocks * sizeof (rtx));
-
- /* Determine the line-number at the start of each basic block.
- This must be computed and saved now, because after a basic block's
- predecessor has been scheduled, it is impossible to accurately
- determine the correct line number for the first insn of the block. */
-
- for (b = 0; b < n_basic_blocks; b++)
- for (line = BLOCK_HEAD (b); line; line = PREV_INSN (line))
- if (GET_CODE (line) == NOTE && NOTE_LINE_NUMBER (line) > 0)
- {
- line_note_head[b] = line;
- break;
- }
- }
-
- bzero ((char *) insn_luid, max_uid * sizeof (int));
- bzero ((char *) insn_priority, max_uid * sizeof (int));
- bzero ((char *) insn_tick, max_uid * sizeof (int));
- bzero ((char *) insn_costs, max_uid * sizeof (short));
- bzero ((char *) insn_units, max_uid * sizeof (short));
- bzero ((char *) insn_blockage, max_uid * sizeof (unsigned int));
- bzero ((char *) insn_ref_count, max_uid * sizeof (int));
-
- /* Schedule each basic block, block by block. */
-
- /* ??? Add a NOTE after the last insn of the last basic block. It is not
- known why this is done. */
- /* ??? Perhaps it's done to ensure NEXT_TAIL in schedule_block is a
- valid insn. */
-
- insn = BLOCK_END (n_basic_blocks-1);
- if (NEXT_INSN (insn) == 0
- || (GET_CODE (insn) != NOTE
- && GET_CODE (insn) != CODE_LABEL
- /* Don't emit a NOTE if it would end up between an unconditional
- jump and a BARRIER. */
- && ! (GET_CODE (insn) == JUMP_INSN
- && GET_CODE (NEXT_INSN (insn)) == BARRIER)))
- emit_note_after (NOTE_INSN_DELETED, BLOCK_END (n_basic_blocks-1));
-
- for (b = 0; b < n_basic_blocks; b++)
- {
- note_list = 0;
-
- split_block_insns (b, reload_completed == 0 || ! flag_schedule_insns);
-
- schedule_block (b, dump_file);
-
-#ifdef USE_C_ALLOCA
- alloca (0);
-#endif
- }
-
- /* Reposition the prologue and epilogue notes in case we moved the
- prologue/epilogue insns. */
- if (reload_completed)
- reposition_prologue_and_epilogue_notes (get_insns ());
-
- if (write_symbols != NO_DEBUG)
- {
- rtx line = 0;
- rtx insn = get_insns ();
- int active_insn = 0;
- int notes = 0;
-
- /* Walk the insns deleting redundant line-number notes. Many of these
- are already present. The remainder tend to occur at basic
- block boundaries. */
- for (insn = get_last_insn (); insn; insn = PREV_INSN (insn))
- if (GET_CODE (insn) == NOTE && NOTE_LINE_NUMBER (insn) > 0)
- {
- /* If there are no active insns following, INSN is redundant. */
- if (active_insn == 0)
- {
- notes++;
- NOTE_SOURCE_FILE (insn) = 0;
- NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED;
- }
- /* If the line number is unchanged, LINE is redundant. */
- else if (line
- && NOTE_LINE_NUMBER (line) == NOTE_LINE_NUMBER (insn)
- && NOTE_SOURCE_FILE (line) == NOTE_SOURCE_FILE (insn))
- {
- notes++;
- NOTE_SOURCE_FILE (line) = 0;
- NOTE_LINE_NUMBER (line) = NOTE_INSN_DELETED;
- line = insn;
- }
- else
- line = insn;
- active_insn = 0;
- }
- else if (! ((GET_CODE (insn) == NOTE
- && NOTE_LINE_NUMBER (insn) == NOTE_INSN_DELETED)
- || (GET_CODE (insn) == INSN
- && (GET_CODE (PATTERN (insn)) == USE
- || GET_CODE (PATTERN (insn)) == CLOBBER))))
- active_insn++;
-
- if (dump_file && notes)
- fprintf (dump_file, ";; deleted %d line-number notes\n", notes);
- }
-
- if (reload_completed == 0)
- {
- int regno;
- for (regno = 0; regno < max_regno; regno++)
- if (sched_reg_live_length[regno])
- {
- if (dump_file)
- {
- if (REG_LIVE_LENGTH (regno) > sched_reg_live_length[regno])
- fprintf (dump_file,
- ";; register %d life shortened from %d to %d\n",
- regno, REG_LIVE_LENGTH (regno),
- sched_reg_live_length[regno]);
- /* Negative values are special; don't overwrite the current
- reg_live_length value if it is negative. */
- else if (REG_LIVE_LENGTH (regno) < sched_reg_live_length[regno]
- && REG_LIVE_LENGTH (regno) >= 0)
- fprintf (dump_file,
- ";; register %d life extended from %d to %d\n",
- regno, REG_LIVE_LENGTH (regno),
- sched_reg_live_length[regno]);
-
- if (! REG_N_CALLS_CROSSED (regno)
- && sched_reg_n_calls_crossed[regno])
- fprintf (dump_file,
- ";; register %d now crosses calls\n", regno);
- else if (REG_N_CALLS_CROSSED (regno)
- && ! sched_reg_n_calls_crossed[regno]
- && REG_BASIC_BLOCK (regno) != REG_BLOCK_GLOBAL)
- fprintf (dump_file,
- ";; register %d no longer crosses calls\n", regno);
-
- }
- /* Negative values are special; don't overwrite the current
- reg_live_length value if it is negative. */
- if (REG_LIVE_LENGTH (regno) >= 0)
- REG_LIVE_LENGTH (regno) = sched_reg_live_length[regno];
-
- /* We can't change the value of reg_n_calls_crossed to zero for
- pseudos which are live in more than one block.
-
- This is because combine might have made an optimization which
- invalidated basic_block_live_at_start and reg_n_calls_crossed,
- but it does not update them. If we update reg_n_calls_crossed
- here, the two variables are now inconsistent, and this might
- confuse the caller-save code into saving a register that doesn't
- need to be saved. This is only a problem when we zero calls
- crossed for a pseudo live in multiple basic blocks.
-
- Alternatively, we could try to correctly update basic block live
- at start here in sched, but that seems complicated. */
- if (sched_reg_n_calls_crossed[regno]
- || REG_BASIC_BLOCK (regno) != REG_BLOCK_GLOBAL)
- REG_N_CALLS_CROSSED (regno) = sched_reg_n_calls_crossed[regno];
- }
- }
-
- free (insn_luid);
- free (insn_priority);
- free (insn_tick);
- free (insn_costs);
- free (insn_units);
- free (insn_blockage);
- free (insn_ref_count);
-
- if (write_symbols != NO_DEBUG)
- free (line_note);
-
- if (reload_completed == 0)
- {
- FREE_REG_SET (bb_dead_regs);
- FREE_REG_SET (bb_live_regs);
- }
-
-}
-#endif /* INSN_SCHEDULING */
diff --git a/contrib/gcc/splay-tree.c b/contrib/gcc/splay-tree.c
deleted file mode 100644
index b6bb5a6a8f05..000000000000
--- a/contrib/gcc/splay-tree.c
+++ /dev/null
@@ -1,368 +0,0 @@
-/* A splay-tree datatype.
- Copyright (C) 1998 Free Software Foundation, Inc.
- Contributed by Mark Mitchell (mark@markmitchell.com).
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* For an easily readable description of splay-trees, see:
-
- Lewis, Harry R. and Denenberg, Larry. Data Structures and Their
- Algorithms. Harper-Collins, Inc. 1991. */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-
-#include "libiberty.h"
-#include "splay-tree.h"
-
-static void splay_tree_delete_helper PARAMS((splay_tree,
- splay_tree_node));
-static void splay_tree_splay PARAMS((splay_tree,
- splay_tree_key));
-static splay_tree_node splay_tree_splay_helper
- PARAMS((splay_tree,
- splay_tree_key,
- splay_tree_node*,
- splay_tree_node*,
- splay_tree_node*));
-static int splay_tree_foreach_helper PARAMS((splay_tree,
- splay_tree_node,
- splay_tree_foreach_fn,
- void*));
-
-/* Deallocate NODE (a member of SP), and all its sub-trees. */
-
-static void
-splay_tree_delete_helper (sp, node)
- splay_tree sp;
- splay_tree_node node;
-{
- if (!node)
- return;
-
- splay_tree_delete_helper (sp, node->left);
- splay_tree_delete_helper (sp, node->right);
-
- if (sp->delete_key)
- (*sp->delete_key)(node->key);
- if (sp->delete_value)
- (*sp->delete_value)(node->value);
-
- free ((char*) node);
-}
-
-/* Help splay SP around KEY. PARENT and GRANDPARENT are the parent
- and grandparent, respectively, of NODE. */
-
-static splay_tree_node
-splay_tree_splay_helper (sp, key, node, parent, grandparent)
- splay_tree sp;
- splay_tree_key key;
- splay_tree_node *node;
- splay_tree_node *parent;
- splay_tree_node *grandparent;
-{
- splay_tree_node *next;
- splay_tree_node n;
- int comparison;
-
- n = *node;
-
- if (!n)
- return *parent;
-
- comparison = (*sp->comp) (key, n->key);
-
- if (comparison == 0)
- /* We've found the target. */
- next = 0;
- else if (comparison < 0)
- /* The target is to the left. */
- next = &n->left;
- else
- /* The target is to the right. */
- next = &n->right;
-
- if (next)
- {
- /* Continue down the tree. */
- n = splay_tree_splay_helper (sp, key, next, node, parent);
-
- /* The recursive call will change the place to which NODE
- points. */
- if (*node != n)
- return n;
- }
-
- if (!parent)
- /* NODE is the root. We are done. */
- return n;
-
- /* First, handle the case where there is no grandparent (i.e.,
- *PARENT is the root of the tree.) */
- if (!grandparent)
- {
- if (n == (*parent)->left)
- {
- *node = n->right;
- n->right = *parent;
- }
- else
- {
- *node = n->left;
- n->left = *parent;
- }
- *parent = n;
- return n;
- }
-
- /* Next handle the cases where both N and *PARENT are left children,
- or where both are right children. */
- if (n == (*parent)->left && *parent == (*grandparent)->left)
- {
- splay_tree_node p = *parent;
-
- (*grandparent)->left = p->right;
- p->right = *grandparent;
- p->left = n->right;
- n->right = p;
- *grandparent = n;
- return n;
- }
- else if (n == (*parent)->right && *parent == (*grandparent)->right)
- {
- splay_tree_node p = *parent;
-
- (*grandparent)->right = p->left;
- p->left = *grandparent;
- p->right = n->left;
- n->left = p;
- *grandparent = n;
- return n;
- }
-
- /* Finally, deal with the case where N is a left child, but *PARENT
- is a right child, or vice versa. */
- if (n == (*parent)->left)
- {
- (*parent)->left = n->right;
- n->right = *parent;
- (*grandparent)->right = n->left;
- n->left = *grandparent;
- *grandparent = n;
- return n;
- }
- else
- {
- (*parent)->right = n->left;
- n->left = *parent;
- (*grandparent)->left = n->right;
- n->right = *grandparent;
- *grandparent = n;
- return n;
- }
-}
-
-/* Splay SP around KEY. */
-
-static void
-splay_tree_splay (sp, key)
- splay_tree sp;
- splay_tree_key key;
-{
- if (sp->root == 0)
- return;
-
- splay_tree_splay_helper (sp, key, &sp->root,
- /*grandparent=*/0, /*parent=*/0);
-}
-
-/* Call FN, passing it the DATA, for every node below NODE, all of
- which are from SP, following an in-order traversal. If FN every
- returns a non-zero value, the iteration ceases immediately, and the
- value is returned. Otherwise, this function returns 0. */
-
-static int
-splay_tree_foreach_helper (sp, node, fn, data)
- splay_tree sp;
- splay_tree_node node;
- splay_tree_foreach_fn fn;
- void* data;
-{
- int val;
-
- if (!node)
- return 0;
-
- val = splay_tree_foreach_helper (sp, node->left, fn, data);
- if (val)
- return val;
-
- val = (*fn)(node, data);
- if (val)
- return val;
-
- return splay_tree_foreach_helper (sp, node->right, fn, data);
-}
-
-/* Allocate a new splay tree, using COMPARE_FN to compare nodes,
- DELETE_KEY_FN to deallocate keys, and DELETE_VALUE_FN to deallocate
- values. */
-
-splay_tree
-splay_tree_new (compare_fn, delete_key_fn, delete_value_fn)
- splay_tree_compare_fn compare_fn;
- splay_tree_delete_key_fn delete_key_fn;
- splay_tree_delete_value_fn delete_value_fn;
-{
- splay_tree sp = (splay_tree) xmalloc (sizeof (struct splay_tree));
- sp->root = 0;
- sp->comp = compare_fn;
- sp->delete_key = delete_key_fn;
- sp->delete_value = delete_value_fn;
-
- return sp;
-}
-
-/* Deallocate SP. */
-
-void
-splay_tree_delete (sp)
- splay_tree sp;
-{
- splay_tree_delete_helper (sp, sp->root);
- free ((char*) sp);
-}
-
-/* Insert a new node (associating KEY with DATA) into SP. If a
- previous node with the indicated KEY exists, its data is replaced
- with the new value. */
-
-void
-splay_tree_insert (sp, key, value)
- splay_tree sp;
- splay_tree_key key;
- splay_tree_value value;
-{
- int comparison;
-
- splay_tree_splay (sp, key);
-
- if (sp->root)
- comparison = (*sp->comp)(sp->root->key, key);
-
- if (sp->root && comparison == 0)
- {
- /* If the root of the tree already has the indicated KEY, just
- replace the value with VALUE. */
- if (sp->delete_value)
- (*sp->delete_value)(sp->root->value);
- sp->root->value = value;
- }
- else
- {
- /* Create a new node, and insert it at the root. */
- splay_tree_node node;
-
- node = (splay_tree_node) xmalloc (sizeof (struct splay_tree_node));
- node->key = key;
- node->value = value;
-
- if (!sp->root)
- node->left = node->right = 0;
- else if (comparison < 0)
- {
- node->left = sp->root;
- node->right = node->left->right;
- node->left->right = 0;
- }
- else
- {
- node->right = sp->root;
- node->left = node->right->left;
- node->right->left = 0;
- }
-
- sp->root = node;
- }
-}
-
-/* Lookup KEY in SP, returning VALUE if present, and NULL
- otherwise. */
-
-splay_tree_node
-splay_tree_lookup (sp, key)
- splay_tree sp;
- splay_tree_key key;
-{
- splay_tree_splay (sp, key);
-
- if (sp->root && (*sp->comp)(sp->root->key, key) == 0)
- return sp->root;
- else
- return 0;
-}
-
-/* Call FN, passing it the DATA, for every node in SP, following an
- in-order traversal. If FN every returns a non-zero value, the
- iteration ceases immediately, and the value is returned.
- Otherwise, this function returns 0. */
-
-int
-splay_tree_foreach (sp, fn, data)
- splay_tree sp;
- splay_tree_foreach_fn fn;
- void *data;
-{
- return splay_tree_foreach_helper (sp, sp->root, fn, data);
-}
-
-/* Splay-tree comparison function, treating the keys as ints. */
-
-int
-splay_tree_compare_ints (k1, k2)
- splay_tree_key k1;
- splay_tree_key k2;
-{
- if ((int) k1 < (int) k2)
- return -1;
- else if ((int) k1 > (int) k2)
- return 1;
- else
- return 0;
-}
-
-/* Splay-tree comparison function, treating the keys as pointers. */
-
-int
-splay_tree_compare_pointers (k1, k2)
- splay_tree_key k1;
- splay_tree_key k2;
-{
- if ((char*) k1 < (char*) k2)
- return -1;
- else if ((char*) k1 > (char*) k2)
- return 1;
- else
- return 0;
-}
diff --git a/contrib/gcc/splay-tree.h b/contrib/gcc/splay-tree.h
deleted file mode 100644
index e828fe7e9077..000000000000
--- a/contrib/gcc/splay-tree.h
+++ /dev/null
@@ -1,116 +0,0 @@
-/* A splay-tree datatype.
- Copyright (C) 1998 Free Software Foundation, Inc.
- Contributed by Mark Mitchell (mark@markmitchell.com).
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* For an easily readable description of splay-trees, see:
-
- Lewis, Harry R. and Denenberg, Larry. Data Structures and Their
- Algorithms. Harper-Collins, Inc. 1991.
-
- The major feature of splay trees is that all basic tree operations
- are amortized O(log n) time for a tree with n nodes. */
-
-#ifndef _SPLAY_TREE_H
-#define _SPLAY_TREE_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-#include <ansidecl.h>
-
-/* Use typedefs for the key and data types to facilitate changing
- these types, if necessary. These types should be sufficiently wide
- that any pointer or scalar can be cast to these types, and then
- cast back, without loss of precision. */
-typedef unsigned long int splay_tree_key;
-typedef unsigned long int splay_tree_value;
-
-/* Forward declaration for a node in the tree. */
-typedef struct splay_tree_node *splay_tree_node;
-
-/* The type of a function which compares two splay-tree keys. The
- function should return values as for qsort. */
-typedef int (*splay_tree_compare_fn) PARAMS((splay_tree_key, splay_tree_key));
-
-/* The type of a function used to deallocate any resources associated
- with the key. */
-typedef void (*splay_tree_delete_key_fn) PARAMS((splay_tree_key));
-
-/* The type of a function used to deallocate any resources associated
- with the value. */
-typedef void (*splay_tree_delete_value_fn) PARAMS((splay_tree_value));
-
-/* The type of a function used to iterate over the tree. */
-typedef int (*splay_tree_foreach_fn) PARAMS((splay_tree_node, void*));
-
-/* The nodes in the splay tree. */
-struct splay_tree_node
-{
- /* The key. */
- splay_tree_key key;
-
- /* The value. */
- splay_tree_value value;
-
- /* The left and right children, respectively. */
- splay_tree_node left;
- splay_tree_node right;
-};
-
-/* The splay tree itself. */
-typedef struct splay_tree
-{
- /* The root of the tree. */
- splay_tree_node root;
-
- /* The comparision function. */
- splay_tree_compare_fn comp;
-
- /* The deallocate-key function. NULL if no cleanup is necessary. */
- splay_tree_delete_key_fn delete_key;
-
- /* The deallocate-value function. NULL if no cleanup is necessary. */
- splay_tree_delete_value_fn delete_value;
-} *splay_tree;
-
-extern splay_tree splay_tree_new PARAMS((splay_tree_compare_fn,
- splay_tree_delete_key_fn,
- splay_tree_delete_value_fn));
-extern void splay_tree_delete PARAMS((splay_tree));
-extern void splay_tree_insert PARAMS((splay_tree,
- splay_tree_key,
- splay_tree_value));
-extern splay_tree_node splay_tree_lookup
- PARAMS((splay_tree,
- splay_tree_key));
-extern int splay_tree_foreach PARAMS((splay_tree,
- splay_tree_foreach_fn,
- void*));
-extern int splay_tree_compare_ints PARAMS((splay_tree_key,
- splay_tree_key));
-extern int splay_tree_compare_pointers PARAMS((splay_tree_key,
- splay_tree_key));
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* _SPLAY_TREE_H */
diff --git a/contrib/gcc/stupid.c b/contrib/gcc/stupid.c
deleted file mode 100644
index b2cd170c8c34..000000000000
--- a/contrib/gcc/stupid.c
+++ /dev/null
@@ -1,770 +0,0 @@
-/* Dummy data flow analysis for GNU compiler in nonoptimizing mode.
- Copyright (C) 1987, 91, 94-96, 1998 Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-
-/* This file performs stupid register allocation, which is used
- when cc1 gets the -noreg switch (which is when cc does not get -O).
-
- Stupid register allocation goes in place of the flow_analysis,
- local_alloc and global_alloc passes. combine_instructions cannot
- be done with stupid allocation because the data flow info that it needs
- is not computed here.
-
- In stupid allocation, the only user-defined variables that can
- go in registers are those declared "register". They are assumed
- to have a life span equal to their scope. Other user variables
- are given stack slots in the rtl-generation pass and are not
- represented as pseudo regs. A compiler-generated temporary
- is assumed to live from its first mention to its last mention.
-
- Since each pseudo-reg's life span is just an interval, it can be
- represented as a pair of numbers, each of which identifies an insn by
- its position in the function (number of insns before it). The first
- thing done for stupid allocation is to compute such a number for each
- insn. It is called the suid. Then the life-interval of each
- pseudo reg is computed. Then the pseudo regs are ordered by priority
- and assigned hard regs in priority order. */
-
-#include "config.h"
-#include "system.h"
-
-#include "rtl.h"
-#include "hard-reg-set.h"
-#include "basic-block.h"
-#include "regs.h"
-#include "insn-config.h"
-#include "reload.h"
-#include "flags.h"
-#include "toplev.h"
-
-/* Vector mapping INSN_UIDs to suids.
- The suids are like uids but increase monotonically always.
- We use them to see whether a subroutine call came
- between a variable's birth and its death. */
-
-static int *uid_suid;
-
-/* Get the suid of an insn. */
-
-#define INSN_SUID(INSN) (uid_suid[INSN_UID (INSN)])
-
-/* Record the suid of the last CALL_INSN
- so we can tell whether a pseudo reg crosses any calls. */
-
-static int last_call_suid;
-
-/* Record the suid of the last NOTE_INSN_SETJMP
- so we can tell whether a pseudo reg crosses any setjmp. */
-
-static int last_setjmp_suid;
-
-/* Element N is suid of insn where life span of pseudo reg N ends.
- Element is 0 if register N has not been seen yet on backward scan. */
-
-static int *reg_where_dead;
-
-/* Likewise, but point to the insn_chain structure of the insn at which
- the reg dies. */
-static struct insn_chain **reg_where_dead_chain;
-
-/* Element N is suid of insn where life span of pseudo reg N begins. */
-static int *reg_where_born_exact;
-
-/* Element N is 1 if the birth of pseudo reg N is due to a CLOBBER,
- 0 otherwise. */
-static int *reg_where_born_clobber;
-
-/* Return the suid of the insn where the register is born, or the suid
- of the insn before if the birth is due to a CLOBBER. */
-#define REG_WHERE_BORN(N) \
- (reg_where_born_exact[(N)] - reg_where_born_clobber[(N)])
-
-/* Numbers of pseudo-regs to be allocated, highest priority first. */
-
-static int *reg_order;
-
-/* Indexed by reg number (hard or pseudo), nonzero if register is live
- at the current point in the instruction stream. */
-
-static char *regs_live;
-
-/* Indexed by reg number, nonzero if reg was used in a SUBREG that changes
- its size. */
-
-static char *regs_change_size;
-
-/* Indexed by reg number, nonzero if reg crosses a setjmp. */
-
-static char *regs_crosses_setjmp;
-
-/* Indexed by insn's suid, the set of hard regs live after that insn. */
-
-static HARD_REG_SET *after_insn_hard_regs;
-
-/* Record that hard reg REGNO is live after insn INSN. */
-
-#define MARK_LIVE_AFTER(INSN,REGNO) \
- SET_HARD_REG_BIT (after_insn_hard_regs[INSN_SUID (INSN)], (REGNO))
-
-static int stupid_reg_compare PROTO((const GENERIC_PTR,const GENERIC_PTR));
-static int stupid_find_reg PROTO((int, enum reg_class, enum machine_mode,
- int, int, int));
-static void stupid_mark_refs PROTO((rtx, struct insn_chain *));
-static void find_clobbered_regs PROTO((rtx, rtx));
-
-/* For communication between stupid_life_analysis and find_clobbered_regs. */
-static struct insn_chain *current_chain;
-
-/* This function, called via note_stores, marks any hard registers that are
- clobbered in an insn as being live in the live_after and live_before fields
- of the appropriate insn_chain structure. */
-
-static void
-find_clobbered_regs (reg, setter)
- rtx reg, setter;
-{
- int regno, nregs;
- if (setter == 0 || GET_CODE (setter) != CLOBBER)
- return;
-
- if (GET_CODE (reg) == SUBREG)
- reg = SUBREG_REG (reg);
-
- if (GET_CODE (reg) != REG)
- return;
- regno = REGNO (reg);
- if (regno >= FIRST_PSEUDO_REGISTER)
- return;
-
- if (GET_MODE (reg) == VOIDmode)
- abort ();
- else
- nregs = HARD_REGNO_NREGS (regno, GET_MODE (reg));
- while (nregs-- > 0)
- {
- SET_REGNO_REG_SET (current_chain->live_after, regno);
- SET_REGNO_REG_SET (current_chain->live_before, regno++);
- }
-}
-
-/* Stupid life analysis is for the case where only variables declared
- `register' go in registers. For this case, we mark all
- pseudo-registers that belong to register variables as
- dying in the last instruction of the function, and all other
- pseudo registers as dying in the last place they are referenced.
- Hard registers are marked as dying in the last reference before
- the end or before each store into them. */
-
-void
-stupid_life_analysis (f, nregs, file)
- rtx f;
- int nregs;
- FILE *file;
-{
- register int i;
- register rtx last, insn;
- int max_uid, max_suid;
-
- current_function_has_computed_jump = 0;
-
- bzero (regs_ever_live, sizeof regs_ever_live);
-
- regs_live = (char *) xmalloc (nregs);
-
- /* First find the last real insn, and count the number of insns,
- and assign insns their suids. */
-
- for (insn = f, i = 0; insn; insn = NEXT_INSN (insn))
- if (INSN_UID (insn) > i)
- i = INSN_UID (insn);
-
- max_uid = i + 1;
- uid_suid = (int *) xmalloc ((i + 1) * sizeof (int));
-
- /* Compute the mapping from uids to suids.
- Suids are numbers assigned to insns, like uids,
- except that suids increase monotonically through the code. */
-
- last = 0; /* In case of empty function body */
- for (insn = f, i = 0; insn; insn = NEXT_INSN (insn))
- {
- if (GET_RTX_CLASS (GET_CODE (insn)) == 'i')
- last = insn;
-
- INSN_SUID (insn) = ++i;
- }
-
- last_call_suid = i + 1;
- last_setjmp_suid = i + 1;
- max_suid = i + 1;
-
- max_regno = nregs;
-
- /* Allocate tables to record info about regs. */
-
- reg_where_dead = (int *) xmalloc (nregs * sizeof (int));
- bzero ((char *) reg_where_dead, nregs * sizeof (int));
-
- reg_where_born_exact = (int *) xmalloc (nregs * sizeof (int));
- bzero ((char *) reg_where_born_exact, nregs * sizeof (int));
-
- reg_where_born_clobber = (int *) xmalloc (nregs * sizeof (int));
- bzero ((char *) reg_where_born_clobber, nregs * sizeof (int));
-
- reg_where_dead_chain = (struct insn_chain **) xmalloc (nregs * sizeof (struct insn_chain *));
- bzero ((char *) reg_where_dead_chain, nregs * sizeof (struct insn_chain *));
-
- reg_order = (int *) xmalloc (nregs * sizeof (int));
- bzero ((char *) reg_order, nregs * sizeof (int));
-
- regs_change_size = (char *) xmalloc (nregs * sizeof (char));
- bzero ((char *) regs_change_size, nregs * sizeof (char));
-
- regs_crosses_setjmp = (char *) xmalloc (nregs * sizeof (char));
- bzero ((char *) regs_crosses_setjmp, nregs * sizeof (char));
-
- /* Allocate the reg_renumber array */
- allocate_reg_info (max_regno, FALSE, TRUE);
- for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
- reg_renumber[i] = i;
-
- after_insn_hard_regs
- = (HARD_REG_SET *) xmalloc (max_suid * sizeof (HARD_REG_SET));
-
- bzero ((char *) after_insn_hard_regs, max_suid * sizeof (HARD_REG_SET));
-
- /* Allocate and zero out many data structures
- that will record the data from lifetime analysis. */
-
- allocate_reg_life_data ();
- allocate_bb_life_data ();
-
- for (i = 0; i < max_regno; i++)
- REG_N_DEATHS (i) = 1;
-
- bzero (regs_live, nregs);
-
- /* Find where each pseudo register is born and dies,
- by scanning all insns from the end to the start
- and noting all mentions of the registers.
-
- Also find where each hard register is live
- and record that info in after_insn_hard_regs.
- regs_live[I] is 1 if hard reg I is live
- at the current point in the scan.
-
- Build reload_insn_chain while we're walking the insns. */
-
- reload_insn_chain = 0;
- for (insn = last; insn; insn = PREV_INSN (insn))
- {
- register HARD_REG_SET *p = after_insn_hard_regs + INSN_SUID (insn);
- struct insn_chain *chain;
-
- /* Copy the info in regs_live into the element of after_insn_hard_regs
- for the current position in the rtl code. */
-
- for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
- if (regs_live[i])
- SET_HARD_REG_BIT (*p, i);
-
- if (GET_CODE (insn) != NOTE && GET_CODE (insn) != BARRIER)
- {
- chain = new_insn_chain ();
- if (reload_insn_chain)
- reload_insn_chain->prev = chain;
- chain->next = reload_insn_chain;
- chain->prev = 0;
- reload_insn_chain = chain;
- chain->block = 0;
- chain->insn = insn;
- for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
- if (regs_live[i])
- SET_REGNO_REG_SET (chain->live_before, i);
- }
-
- /* Update which hard regs are currently live
- and also the birth and death suids of pseudo regs
- based on the pattern of this insn. */
-
- if (GET_RTX_CLASS (GET_CODE (insn)) == 'i')
- stupid_mark_refs (PATTERN (insn), chain);
-
- if (GET_CODE (insn) == NOTE
- && NOTE_LINE_NUMBER (insn) == NOTE_INSN_SETJMP)
- last_setjmp_suid = INSN_SUID (insn);
-
- /* Mark all call-clobbered regs as dead after each call insn so that
- a pseudo whose life span includes this insn will not go in one of
- them. If the function contains a non-local goto, mark all hard
- registers dead (except for stack related bits).
-
- Then mark those regs as all dead for the continuing scan
- of the insns before the call. */
-
- if (GET_CODE (insn) == CALL_INSN)
- {
- last_call_suid = INSN_SUID (insn);
-
- if (current_function_has_nonlocal_label)
- {
- IOR_COMPL_HARD_REG_SET (after_insn_hard_regs[last_call_suid],
- fixed_reg_set);
- for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
- if (! fixed_regs[i])
- regs_live[i] = 0;
- }
- else
- {
- IOR_HARD_REG_SET (after_insn_hard_regs[last_call_suid],
- call_used_reg_set);
- for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
- if (call_used_regs[i])
- regs_live[i] = 0;
- }
-
- /* It is important that this be done after processing the insn's
- pattern because we want the function result register to still
- be live if it's also used to pass arguments. */
- stupid_mark_refs (CALL_INSN_FUNCTION_USAGE (insn), chain);
- }
-
- if (GET_CODE (insn) != NOTE && GET_CODE (insn) != BARRIER)
- {
- for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
- if (regs_live[i])
- SET_REGNO_REG_SET (chain->live_after, i);
-
- /* The regs_live array doesn't say anything about hard registers
- clobbered by this insn. So we need an extra pass over the
- pattern. */
- current_chain = chain;
- if (GET_RTX_CLASS (GET_CODE (insn)) == 'i')
- note_stores (PATTERN (insn), find_clobbered_regs);
- }
-
- if (GET_CODE (insn) == JUMP_INSN && computed_jump_p (insn))
- current_function_has_computed_jump = 1;
- }
-
- /* Now decide the order in which to allocate the pseudo registers. */
-
- for (i = LAST_VIRTUAL_REGISTER + 1; i < max_regno; i++)
- reg_order[i] = i;
-
- qsort (&reg_order[LAST_VIRTUAL_REGISTER + 1],
- max_regno - LAST_VIRTUAL_REGISTER - 1, sizeof (int),
- stupid_reg_compare);
-
- /* Now, in that order, try to find hard registers for those pseudo regs. */
-
- for (i = LAST_VIRTUAL_REGISTER + 1; i < max_regno; i++)
- {
- register int r = reg_order[i];
-
- /* Some regnos disappear from the rtl. Ignore them to avoid crash.
- Also don't allocate registers that cross a setjmp, or live across
- a call if this function receives a nonlocal goto.
- Also ignore registers we didn't see during the scan. */
- if (regno_reg_rtx[r] == 0 || regs_crosses_setjmp[r]
- || (reg_where_born_exact[r] == 0 && reg_where_dead[r] == 0)
- || (REG_N_CALLS_CROSSED (r) > 0
- && current_function_has_nonlocal_label))
- continue;
-
- /* Now find the best hard-register class for this pseudo register */
- if (N_REG_CLASSES > 1)
- reg_renumber[r] = stupid_find_reg (REG_N_CALLS_CROSSED (r),
- reg_preferred_class (r),
- PSEUDO_REGNO_MODE (r),
- REG_WHERE_BORN (r),
- reg_where_dead[r],
- regs_change_size[r]);
-
- /* If no reg available in that class, try alternate class. */
- if (reg_renumber[r] == -1 && reg_alternate_class (r) != NO_REGS)
- reg_renumber[r] = stupid_find_reg (REG_N_CALLS_CROSSED (r),
- reg_alternate_class (r),
- PSEUDO_REGNO_MODE (r),
- REG_WHERE_BORN (r),
- reg_where_dead[r],
- regs_change_size[r]);
- }
-
- /* Fill in the pseudo reg life information into the insn chain. */
- for (i = LAST_VIRTUAL_REGISTER + 1; i < max_regno; i++)
- {
- struct insn_chain *chain;
- int regno;
-
- regno = reg_renumber[i];
- if (regno < 0)
- continue;
-
- chain = reg_where_dead_chain[i];
- if (reg_where_dead[i] > INSN_SUID (chain->insn))
- SET_REGNO_REG_SET (chain->live_after, i);
-
- while (INSN_SUID (chain->insn) > reg_where_born_exact[i])
- {
- SET_REGNO_REG_SET (chain->live_before, i);
- chain = chain->prev;
- if (!chain)
- break;
- SET_REGNO_REG_SET (chain->live_after, i);
- }
-
- if (INSN_SUID (chain->insn) == reg_where_born_exact[i]
- && reg_where_born_clobber[i])
- SET_REGNO_REG_SET (chain->live_before, i);
- }
-
- if (file)
- dump_flow_info (file);
-
- free (regs_live);
- free (uid_suid);
- free (reg_where_dead);
- free (reg_where_born_exact);
- free (reg_where_born_clobber);
- free (reg_where_dead_chain);
- free (reg_order);
- free (regs_change_size);
- free (regs_crosses_setjmp);
- free (after_insn_hard_regs);
-}
-
-/* Comparison function for qsort.
- Returns -1 (1) if register *R1P is higher priority than *R2P. */
-
-static int
-stupid_reg_compare (r1p, r2p)
- const GENERIC_PTR r1p;
- const GENERIC_PTR r2p;
-{
- register int r1 = *(int *)r1p, r2 = *(int *)r2p;
- register int len1 = reg_where_dead[r1] - REG_WHERE_BORN (r1);
- register int len2 = reg_where_dead[r2] - REG_WHERE_BORN (r2);
- int tem;
-
- tem = len2 - len1;
- if (tem != 0)
- return tem;
-
- tem = REG_N_REFS (r1) - REG_N_REFS (r2);
- if (tem != 0)
- return tem;
-
- /* If regs are equally good, sort by regno,
- so that the results of qsort leave nothing to chance. */
- return r1 - r2;
-}
-
-/* Find a block of SIZE words of hard registers in reg_class CLASS
- that can hold a value of machine-mode MODE
- (but actually we test only the first of the block for holding MODE)
- currently free from after insn whose suid is BORN_INSN
- through the insn whose suid is DEAD_INSN,
- and return the number of the first of them.
- Return -1 if such a block cannot be found.
-
- If CALL_PRESERVED is nonzero, insist on registers preserved
- over subroutine calls, and return -1 if cannot find such.
-
- If CHANGES_SIZE is nonzero, it means this register was used as the
- operand of a SUBREG that changes its size. */
-
-static int
-stupid_find_reg (call_preserved, class, mode,
- born_insn, dead_insn, changes_size)
- int call_preserved;
- enum reg_class class;
- enum machine_mode mode;
- int born_insn, dead_insn;
- int changes_size ATTRIBUTE_UNUSED;
-{
- register int i, ins;
-#ifdef HARD_REG_SET
- register /* Declare them register if they are scalars. */
-#endif
- HARD_REG_SET used, this_reg;
-#ifdef ELIMINABLE_REGS
- static struct {int from, to; } eliminables[] = ELIMINABLE_REGS;
-#endif
-
- /* If this register's life is more than 5,000 insns, we probably
- can't allocate it, so don't waste the time trying. This avoids
- quadratic behavior on programs that have regularly-occurring
- SAVE_EXPRs. */
- if (dead_insn > born_insn + 5000)
- return -1;
-
- COPY_HARD_REG_SET (used,
- call_preserved ? call_used_reg_set : fixed_reg_set);
-
-#ifdef ELIMINABLE_REGS
- for (i = 0; i < (int)(sizeof eliminables / sizeof eliminables[0]); i++)
- SET_HARD_REG_BIT (used, eliminables[i].from);
-#if HARD_FRAME_POINTER_REGNUM != FRAME_POINTER_REGNUM
- SET_HARD_REG_BIT (used, HARD_FRAME_POINTER_REGNUM);
-#endif
-#else
- SET_HARD_REG_BIT (used, FRAME_POINTER_REGNUM);
-#endif
-
- for (ins = born_insn; ins < dead_insn; ins++)
- IOR_HARD_REG_SET (used, after_insn_hard_regs[ins]);
-
-#ifdef STACK_REGS
- if (current_function_has_computed_jump)
- for (i = FIRST_STACK_REG; i <= LAST_STACK_REG; i++)
- SET_HARD_REG_BIT (used, i);
-#endif
-
- IOR_COMPL_HARD_REG_SET (used, reg_class_contents[(int) class]);
-
-#ifdef CLASS_CANNOT_CHANGE_SIZE
- if (changes_size)
- IOR_HARD_REG_SET (used,
- reg_class_contents[(int) CLASS_CANNOT_CHANGE_SIZE]);
-#endif
-
- for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
- {
-#ifdef REG_ALLOC_ORDER
- int regno = reg_alloc_order[i];
-#else
- int regno = i;
-#endif
-
- /* If a register has screwy overlap problems,
- don't use it at all if not optimizing.
- Actually this is only for the 387 stack register,
- and it's because subsequent code won't work. */
-#ifdef OVERLAPPING_REGNO_P
- if (OVERLAPPING_REGNO_P (regno))
- continue;
-#endif
-
- if (! TEST_HARD_REG_BIT (used, regno)
- && HARD_REGNO_MODE_OK (regno, mode))
- {
- register int j;
- register int size1 = HARD_REGNO_NREGS (regno, mode);
- for (j = 1; j < size1 && ! TEST_HARD_REG_BIT (used, regno + j); j++);
- if (j == size1)
- {
- CLEAR_HARD_REG_SET (this_reg);
- while (--j >= 0)
- SET_HARD_REG_BIT (this_reg, regno + j);
- for (ins = born_insn; ins < dead_insn; ins++)
- {
- IOR_HARD_REG_SET (after_insn_hard_regs[ins], this_reg);
- }
- return regno;
- }
-#ifndef REG_ALLOC_ORDER
- i += j; /* Skip starting points we know will lose */
-#endif
- }
- }
-
- return -1;
-}
-
-/* Walk X, noting all assignments and references to registers
- and recording what they imply about life spans.
- INSN is the current insn, supplied so we can find its suid. */
-
-static void
-stupid_mark_refs (x, chain)
- rtx x;
- struct insn_chain *chain;
-{
- register RTX_CODE code;
- register char *fmt;
- register int regno, i;
- rtx insn = chain->insn;
-
- if (x == 0)
- return;
-
- code = GET_CODE (x);
-
- if (code == SET || code == CLOBBER)
- {
- if (SET_DEST (x) != 0
- && (GET_CODE (SET_DEST (x)) == REG
- || (GET_CODE (SET_DEST (x)) == SUBREG
- && GET_CODE (SUBREG_REG (SET_DEST (x))) == REG
- && (REGNO (SUBREG_REG (SET_DEST (x)))
- >= FIRST_PSEUDO_REGISTER))))
- {
- /* Register is being assigned. */
- /* If setting a SUBREG, we treat the entire reg as being set. */
- if (GET_CODE (SET_DEST (x)) == SUBREG)
- regno = REGNO (SUBREG_REG (SET_DEST (x)));
- else
- regno = REGNO (SET_DEST (x));
-
- /* For hard regs, update the where-live info. */
- if (regno < FIRST_PSEUDO_REGISTER)
- {
- register int j
- = HARD_REGNO_NREGS (regno, GET_MODE (SET_DEST (x)));
-
- while (--j >= 0)
- {
- regs_ever_live[regno+j] = 1;
- regs_live[regno+j] = 0;
-
- /* The following line is for unused outputs;
- they do get stored even though never used again. */
- MARK_LIVE_AFTER (insn, regno+j);
-
- /* When a hard reg is clobbered, mark it in use
- just before this insn, so it is live all through. */
- if (code == CLOBBER && INSN_SUID (insn) > 0)
- SET_HARD_REG_BIT (after_insn_hard_regs[INSN_SUID (insn) - 1],
- regno+j);
- }
- }
- /* For pseudo regs, record where born, where dead, number of
- times used, and whether live across a call. */
- else
- {
- /* Update the life-interval bounds of this pseudo reg. */
-
- /* When a pseudo-reg is CLOBBERed, it is born just before
- the clobbering insn. When setting, just after. */
- int where_born = INSN_SUID (insn) - (code == CLOBBER);
-
- reg_where_born_exact[regno] = INSN_SUID (insn);
- reg_where_born_clobber[regno] = (code == CLOBBER);
-
- if (reg_where_dead_chain[regno] == 0)
- reg_where_dead_chain[regno] = chain;
-
- /* The reg must live at least one insn even
- in it is never again used--because it has to go
- in SOME hard reg. Mark it as dying after the current
- insn so that it will conflict with any other outputs of
- this insn. */
- if (reg_where_dead[regno] < where_born + 2)
- {
- reg_where_dead[regno] = where_born + 2;
- regs_live[regno] = 1;
- }
-
- /* Count the refs of this reg. */
- REG_N_REFS (regno)++;
-
- if (last_call_suid < reg_where_dead[regno])
- REG_N_CALLS_CROSSED (regno) += 1;
-
- if (last_setjmp_suid < reg_where_dead[regno])
- regs_crosses_setjmp[regno] = 1;
-
- /* If this register is clobbered or it is only used in
- this insn and is only set, mark it unused. We have
- to do this even when not optimizing so that MD patterns
- which count on this behavior (e.g., it not causing an
- output reload on an insn setting CC) will operate
- correctly. */
- if (GET_CODE (SET_DEST (x)) == REG
- && (code == CLOBBER
- || (REGNO_FIRST_UID (regno) == INSN_UID (insn)
- && REGNO_LAST_UID (regno) == INSN_UID (insn)
- && ! reg_mentioned_p (SET_DEST (x),
- SET_SRC (x)))))
- REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_UNUSED,
- SET_DEST (x),
- REG_NOTES (insn));
- }
- }
-
- /* Record references from the value being set,
- or from addresses in the place being set if that's not a reg.
- If setting a SUBREG, we treat the entire reg as *used*. */
- if (code == SET)
- {
- stupid_mark_refs (SET_SRC (x), chain);
- if (GET_CODE (SET_DEST (x)) != REG)
- stupid_mark_refs (SET_DEST (x), chain);
- }
- return;
- }
-
- else if (code == SUBREG
- && GET_CODE (SUBREG_REG (x)) == REG
- && REGNO (SUBREG_REG (x)) >= FIRST_PSEUDO_REGISTER
- && (GET_MODE_SIZE (GET_MODE (x))
- != GET_MODE_SIZE (GET_MODE (SUBREG_REG (x))))
- && (INTEGRAL_MODE_P (GET_MODE (x))
- || INTEGRAL_MODE_P (GET_MODE (SUBREG_REG (x)))))
- regs_change_size[REGNO (SUBREG_REG (x))] = 1;
-
- /* Register value being used, not set. */
-
- else if (code == REG)
- {
- regno = REGNO (x);
- if (regno < FIRST_PSEUDO_REGISTER)
- {
- /* Hard reg: mark it live for continuing scan of previous insns. */
- register int j = HARD_REGNO_NREGS (regno, GET_MODE (x));
- while (--j >= 0)
- {
- regs_ever_live[regno+j] = 1;
- regs_live[regno+j] = 1;
- }
- }
- else
- {
- /* Pseudo reg: record first use, last use and number of uses. */
-
- reg_where_born_exact[regno] = INSN_SUID (insn);
- reg_where_born_clobber[regno] = 0;
- REG_N_REFS (regno)++;
- if (regs_live[regno] == 0)
- {
- regs_live[regno] = 1;
- reg_where_dead[regno] = INSN_SUID (insn);
- reg_where_dead_chain[regno] = chain;
- }
- }
- return;
- }
-
- /* Recursive scan of all other rtx's. */
-
- fmt = GET_RTX_FORMAT (code);
- for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
- {
- if (fmt[i] == 'e')
- stupid_mark_refs (XEXP (x, i), chain);
- if (fmt[i] == 'E')
- {
- register int j;
- for (j = XVECLEN (x, i) - 1; j >= 0; j--)
- stupid_mark_refs (XVECEXP (x, i, j), chain);
- }
- }
-}
diff --git a/contrib/gcc/tm.texi b/contrib/gcc/tm.texi
deleted file mode 100644
index a13c6d97424b..000000000000
--- a/contrib/gcc/tm.texi
+++ /dev/null
@@ -1,7691 +0,0 @@
-@c Copyright (C) 1988,89,92,93,94,96,97,98,1999 Free Software Foundation, Inc.
-@c This is part of the GCC manual.
-@c For copying conditions, see the file gcc.texi.
-
-@node Target Macros
-@chapter Target Description Macros
-@cindex machine description macros
-@cindex target description macros
-@cindex macros, target description
-@cindex @file{tm.h} macros
-
-In addition to the file @file{@var{machine}.md}, a machine description
-includes a C header file conventionally given the name
-@file{@var{machine}.h}. This header file defines numerous macros
-that convey the information about the target machine that does not fit
-into the scheme of the @file{.md} file. The file @file{tm.h} should be
-a link to @file{@var{machine}.h}. The header file @file{config.h}
-includes @file{tm.h} and most compiler source files include
-@file{config.h}.
-
-@menu
-* Driver:: Controlling how the driver runs the compilation passes.
-* Run-time Target:: Defining @samp{-m} options like @samp{-m68000} and @samp{-m68020}.
-* Storage Layout:: Defining sizes and alignments of data.
-* Type Layout:: Defining sizes and properties of basic user data types.
-* Registers:: Naming and describing the hardware registers.
-* Register Classes:: Defining the classes of hardware registers.
-* Stack and Calling:: Defining which way the stack grows and by how much.
-* Varargs:: Defining the varargs macros.
-* Trampolines:: Code set up at run time to enter a nested function.
-* Library Calls:: Controlling how library routines are implicitly called.
-* Addressing Modes:: Defining addressing modes valid for memory operands.
-* Condition Code:: Defining how insns update the condition code.
-* Costs:: Defining relative costs of different operations.
-* Sections:: Dividing storage into text, data, and other sections.
-* PIC:: Macros for position independent code.
-* Assembler Format:: Defining how to write insns and pseudo-ops to output.
-* Debugging Info:: Defining the format of debugging output.
-* Cross-compilation:: Handling floating point for cross-compilers.
-* Misc:: Everything else.
-@end menu
-
-@node Driver
-@section Controlling the Compilation Driver, @file{gcc}
-@cindex driver
-@cindex controlling the compilation driver
-
-@c prevent bad page break with this line
-You can control the compilation driver.
-
-@table @code
-@findex SWITCH_TAKES_ARG
-@item SWITCH_TAKES_ARG (@var{char})
-A C expression which determines whether the option @samp{-@var{char}}
-takes arguments. The value should be the number of arguments that
-option takes--zero, for many options.
-
-By default, this macro is defined as
-@code{DEFAULT_SWITCH_TAKES_ARG}, which handles the standard options
-properly. You need not define @code{SWITCH_TAKES_ARG} unless you
-wish to add additional options which take arguments. Any redefinition
-should call @code{DEFAULT_SWITCH_TAKES_ARG} and then check for
-additional options.
-
-@findex WORD_SWITCH_TAKES_ARG
-@item WORD_SWITCH_TAKES_ARG (@var{name})
-A C expression which determines whether the option @samp{-@var{name}}
-takes arguments. The value should be the number of arguments that
-option takes--zero, for many options. This macro rather than
-@code{SWITCH_TAKES_ARG} is used for multi-character option names.
-
-By default, this macro is defined as
-@code{DEFAULT_WORD_SWITCH_TAKES_ARG}, which handles the standard options
-properly. You need not define @code{WORD_SWITCH_TAKES_ARG} unless you
-wish to add additional options which take arguments. Any redefinition
-should call @code{DEFAULT_WORD_SWITCH_TAKES_ARG} and then check for
-additional options.
-
-@findex SWITCH_CURTAILS_COMPILATION
-@item SWITCH_CURTAILS_COMPILATION (@var{char})
-A C expression which determines whether the option @samp{-@var{char}}
-stops compilation before the generation of an executable. The value is
-boolean, non-zero if the option does stop an executable from being
-generated, zero otherwise.
-
-By default, this macro is defined as
-@code{DEFAULT_SWITCH_CURTAILS_COMPILATION}, which handles the standard
-options properly. You need not define
-@code{SWITCH_CURTAILS_COMPILATION} unless you wish to add additional
-options which affect the generation of an executable. Any redefinition
-should call @code{DEFAULT_SWITCH_CURTAILS_COMPILATION} and then check
-for additional options.
-
-@findex SWITCHES_NEED_SPACES
-@item SWITCHES_NEED_SPACES
-A string-valued C expression which enumerates the options for which
-the linker needs a space between the option and its argument.
-
-If this macro is not defined, the default value is @code{""}.
-
-@findex CPP_SPEC
-@item CPP_SPEC
-A C string constant that tells the GNU CC driver program options to
-pass to CPP. It can also specify how to translate options you
-give to GNU CC into options for GNU CC to pass to the CPP.
-
-Do not define this macro if it does not need to do anything.
-
-@findex NO_BUILTIN_SIZE_TYPE
-@item NO_BUILTIN_SIZE_TYPE
-If this macro is defined, the preprocessor will not define the builtin macro
-@code{__SIZE_TYPE__}. The macro @code{__SIZE_TYPE__} must then be defined
-by @code{CPP_SPEC} instead.
-
-This should be defined if @code{SIZE_TYPE} depends on target dependent flags
-which are not accessible to the preprocessor. Otherwise, it should not
-be defined.
-
-@findex NO_BUILTIN_PTRDIFF_TYPE
-@item NO_BUILTIN_PTRDIFF_TYPE
-If this macro is defined, the preprocessor will not define the builtin macro
-@code{__PTRDIFF_TYPE__}. The macro @code{__PTRDIFF_TYPE__} must then be
-defined by @code{CPP_SPEC} instead.
-
-This should be defined if @code{PTRDIFF_TYPE} depends on target dependent flags
-which are not accessible to the preprocessor. Otherwise, it should not
-be defined.
-
-@findex SIGNED_CHAR_SPEC
-@item SIGNED_CHAR_SPEC
-A C string constant that tells the GNU CC driver program options to
-pass to CPP. By default, this macro is defined to pass the option
-@samp{-D__CHAR_UNSIGNED__} to CPP if @code{char} will be treated as
-@code{unsigned char} by @code{cc1}.
-
-Do not define this macro unless you need to override the default
-definition.
-
-@findex CC1_SPEC
-@item CC1_SPEC
-A C string constant that tells the GNU CC driver program options to
-pass to @code{cc1}. It can also specify how to translate options you
-give to GNU CC into options for GNU CC to pass to the @code{cc1}.
-
-Do not define this macro if it does not need to do anything.
-
-@findex CC1PLUS_SPEC
-@item CC1PLUS_SPEC
-A C string constant that tells the GNU CC driver program options to
-pass to @code{cc1plus}. It can also specify how to translate options you
-give to GNU CC into options for GNU CC to pass to the @code{cc1plus}.
-
-Do not define this macro if it does not need to do anything.
-
-@findex ASM_SPEC
-@item ASM_SPEC
-A C string constant that tells the GNU CC driver program options to
-pass to the assembler. It can also specify how to translate options
-you give to GNU CC into options for GNU CC to pass to the assembler.
-See the file @file{sun3.h} for an example of this.
-
-Do not define this macro if it does not need to do anything.
-
-@findex ASM_FINAL_SPEC
-@item ASM_FINAL_SPEC
-A C string constant that tells the GNU CC driver program how to
-run any programs which cleanup after the normal assembler.
-Normally, this is not needed. See the file @file{mips.h} for
-an example of this.
-
-Do not define this macro if it does not need to do anything.
-
-@findex LINK_SPEC
-@item LINK_SPEC
-A C string constant that tells the GNU CC driver program options to
-pass to the linker. It can also specify how to translate options you
-give to GNU CC into options for GNU CC to pass to the linker.
-
-Do not define this macro if it does not need to do anything.
-
-@findex LIB_SPEC
-@item LIB_SPEC
-Another C string constant used much like @code{LINK_SPEC}. The difference
-between the two is that @code{LIB_SPEC} is used at the end of the
-command given to the linker.
-
-If this macro is not defined, a default is provided that
-loads the standard C library from the usual place. See @file{gcc.c}.
-
-@findex LIBGCC_SPEC
-@item LIBGCC_SPEC
-Another C string constant that tells the GNU CC driver program
-how and when to place a reference to @file{libgcc.a} into the
-linker command line. This constant is placed both before and after
-the value of @code{LIB_SPEC}.
-
-If this macro is not defined, the GNU CC driver provides a default that
-passes the string @samp{-lgcc} to the linker unless the @samp{-shared}
-option is specified.
-
-@findex STARTFILE_SPEC
-@item STARTFILE_SPEC
-Another C string constant used much like @code{LINK_SPEC}. The
-difference between the two is that @code{STARTFILE_SPEC} is used at
-the very beginning of the command given to the linker.
-
-If this macro is not defined, a default is provided that loads the
-standard C startup file from the usual place. See @file{gcc.c}.
-
-@findex ENDFILE_SPEC
-@item ENDFILE_SPEC
-Another C string constant used much like @code{LINK_SPEC}. The
-difference between the two is that @code{ENDFILE_SPEC} is used at
-the very end of the command given to the linker.
-
-Do not define this macro if it does not need to do anything.
-
-@findex EXTRA_SPECS
-@item EXTRA_SPECS
-Define this macro to provide additional specifications to put in the
-@file{specs} file that can be used in various specifications like
-@code{CC1_SPEC}.
-
-The definition should be an initializer for an array of structures,
-containing a string constant, that defines the specification name, and a
-string constant that provides the specification.
-
-Do not define this macro if it does not need to do anything.
-
-@code{EXTRA_SPECS} is useful when an architecture contains several
-related targets, which have various @code{..._SPECS} which are similar
-to each other, and the maintainer would like one central place to keep
-these definitions.
-
-For example, the PowerPC System V.4 targets use @code{EXTRA_SPECS} to
-define either @code{_CALL_SYSV} when the System V calling sequence is
-used or @code{_CALL_AIX} when the older AIX-based calling sequence is
-used.
-
-The @file{config/rs6000/rs6000.h} target file defines:
-
-@example
-#define EXTRA_SPECS \
- @{ "cpp_sysv_default", CPP_SYSV_DEFAULT @},
-
-#define CPP_SYS_DEFAULT ""
-@end example
-
-The @file{config/rs6000/sysv.h} target file defines:
-@smallexample
-#undef CPP_SPEC
-#define CPP_SPEC \
-"%@{posix: -D_POSIX_SOURCE @} \
-%@{mcall-sysv: -D_CALL_SYSV @} %@{mcall-aix: -D_CALL_AIX @} \
-%@{!mcall-sysv: %@{!mcall-aix: %(cpp_sysv_default) @}@} \
-%@{msoft-float: -D_SOFT_FLOAT@} %@{mcpu=403: -D_SOFT_FLOAT@}"
-
-#undef CPP_SYSV_DEFAULT
-#define CPP_SYSV_DEFAULT "-D_CALL_SYSV"
-@end smallexample
-
-while the @file{config/rs6000/eabiaix.h} target file defines
-@code{CPP_SYSV_DEFAULT} as:
-
-@smallexample
-#undef CPP_SYSV_DEFAULT
-#define CPP_SYSV_DEFAULT "-D_CALL_AIX"
-@end smallexample
-
-@findex LINK_LIBGCC_SPECIAL
-@item LINK_LIBGCC_SPECIAL
-Define this macro if the driver program should find the library
-@file{libgcc.a} itself and should not pass @samp{-L} options to the
-linker. If you do not define this macro, the driver program will pass
-the argument @samp{-lgcc} to tell the linker to do the search and will
-pass @samp{-L} options to it.
-
-@findex LINK_LIBGCC_SPECIAL_1
-@item LINK_LIBGCC_SPECIAL_1
-Define this macro if the driver program should find the library
-@file{libgcc.a}. If you do not define this macro, the driver program will pass
-the argument @samp{-lgcc} to tell the linker to do the search.
-This macro is similar to @code{LINK_LIBGCC_SPECIAL}, except that it does
-not affect @samp{-L} options.
-
-@findex LINK_COMMAND_SPEC
-@item LINK_COMMAND_SPEC
-A C string constant giving the complete command line need to execute the
-linker. When you do this, you will need to update your port each time a
-change is made to the link command line within @file{gcc.c}. Therefore,
-define this macro only if you need to completely redefine the command
-line for invoking the linker and there is no other way to accomplish
-the effect you need.
-
-@findex MULTILIB_DEFAULTS
-@item MULTILIB_DEFAULTS
-Define this macro as a C expression for the initializer of an array of
-string to tell the driver program which options are defaults for this
-target and thus do not need to be handled specially when using
-@code{MULTILIB_OPTIONS}.
-
-Do not define this macro if @code{MULTILIB_OPTIONS} is not defined in
-the target makefile fragment or if none of the options listed in
-@code{MULTILIB_OPTIONS} are set by default.
-@xref{Target Fragment}.
-
-@findex RELATIVE_PREFIX_NOT_LINKDIR
-@item RELATIVE_PREFIX_NOT_LINKDIR
-Define this macro to tell @code{gcc} that it should only translate
-a @samp{-B} prefix into a @samp{-L} linker option if the prefix
-indicates an absolute file name.
-
-@findex STANDARD_EXEC_PREFIX
-@item STANDARD_EXEC_PREFIX
-Define this macro as a C string constant if you wish to override the
-standard choice of @file{/usr/local/lib/gcc-lib/} as the default prefix to
-try when searching for the executable files of the compiler.
-
-@findex MD_EXEC_PREFIX
-@item MD_EXEC_PREFIX
-If defined, this macro is an additional prefix to try after
-@code{STANDARD_EXEC_PREFIX}. @code{MD_EXEC_PREFIX} is not searched
-when the @samp{-b} option is used, or the compiler is built as a cross
-compiler. If you define @code{MD_EXEC_PREFIX}, then be sure to add it
-to the list of directories used to find the assembler in @file{configure.in}.
-
-@findex STANDARD_STARTFILE_PREFIX
-@item STANDARD_STARTFILE_PREFIX
-Define this macro as a C string constant if you wish to override the
-standard choice of @file{/usr/local/lib/} as the default prefix to
-try when searching for startup files such as @file{crt0.o}.
-
-@findex MD_STARTFILE_PREFIX
-@item MD_STARTFILE_PREFIX
-If defined, this macro supplies an additional prefix to try after the
-standard prefixes. @code{MD_EXEC_PREFIX} is not searched when the
-@samp{-b} option is used, or when the compiler is built as a cross
-compiler.
-
-@findex MD_STARTFILE_PREFIX_1
-@item MD_STARTFILE_PREFIX_1
-If defined, this macro supplies yet another prefix to try after the
-standard prefixes. It is not searched when the @samp{-b} option is
-used, or when the compiler is built as a cross compiler.
-
-@findex INIT_ENVIRONMENT
-@item INIT_ENVIRONMENT
-Define this macro as a C string constant if you wish to set environment
-variables for programs called by the driver, such as the assembler and
-loader. The driver passes the value of this macro to @code{putenv} to
-initialize the necessary environment variables.
-
-@findex LOCAL_INCLUDE_DIR
-@item LOCAL_INCLUDE_DIR
-Define this macro as a C string constant if you wish to override the
-standard choice of @file{/usr/local/include} as the default prefix to
-try when searching for local header files. @code{LOCAL_INCLUDE_DIR}
-comes before @code{SYSTEM_INCLUDE_DIR} in the search order.
-
-Cross compilers do not use this macro and do not search either
-@file{/usr/local/include} or its replacement.
-
-@findex SYSTEM_INCLUDE_DIR
-@item SYSTEM_INCLUDE_DIR
-Define this macro as a C string constant if you wish to specify a
-system-specific directory to search for header files before the standard
-directory. @code{SYSTEM_INCLUDE_DIR} comes before
-@code{STANDARD_INCLUDE_DIR} in the search order.
-
-Cross compilers do not use this macro and do not search the directory
-specified.
-
-@findex STANDARD_INCLUDE_DIR
-@item STANDARD_INCLUDE_DIR
-Define this macro as a C string constant if you wish to override the
-standard choice of @file{/usr/include} as the default prefix to
-try when searching for header files.
-
-Cross compilers do not use this macro and do not search either
-@file{/usr/include} or its replacement.
-
-@findex STANDARD_INCLUDE_COMPONENT
-@item STANDARD_INCLUDE_COMPONENT
-The ``component'' corresponding to @code{STANDARD_INCLUDE_DIR}.
-See @code{INCLUDE_DEFAULTS}, below, for the description of components.
-If you do not define this macro, no component is used.
-
-@findex INCLUDE_DEFAULTS
-@item INCLUDE_DEFAULTS
-Define this macro if you wish to override the entire default search path
-for include files. For a native compiler, the default search path
-usually consists of @code{GCC_INCLUDE_DIR}, @code{LOCAL_INCLUDE_DIR},
-@code{SYSTEM_INCLUDE_DIR}, @code{GPLUSPLUS_INCLUDE_DIR}, and
-@code{STANDARD_INCLUDE_DIR}. In addition, @code{GPLUSPLUS_INCLUDE_DIR}
-and @code{GCC_INCLUDE_DIR} are defined automatically by @file{Makefile},
-and specify private search areas for GCC. The directory
-@code{GPLUSPLUS_INCLUDE_DIR} is used only for C++ programs.
-
-The definition should be an initializer for an array of structures.
-Each array element should have four elements: the directory name (a
-string constant), the component name, and flag for C++-only directories,
-and a flag showing that the includes in the directory don't need to be
-wrapped in @code{extern @samp{C}} when compiling C++. Mark the end of
-the array with a null element.
-
-The component name denotes what GNU package the include file is part of,
-if any, in all upper-case letters. For example, it might be @samp{GCC}
-or @samp{BINUTILS}. If the package is part of the a vendor-supplied
-operating system, code the component name as @samp{0}.
-
-
-For example, here is the definition used for VAX/VMS:
-
-@example
-#define INCLUDE_DEFAULTS \
-@{ \
- @{ "GNU_GXX_INCLUDE:", "G++", 1, 1@}, \
- @{ "GNU_CC_INCLUDE:", "GCC", 0, 0@}, \
- @{ "SYS$SYSROOT:[SYSLIB.]", 0, 0, 0@}, \
- @{ ".", 0, 0, 0@}, \
- @{ 0, 0, 0, 0@} \
-@}
-@end example
-@end table
-
-Here is the order of prefixes tried for exec files:
-
-@enumerate
-@item
-Any prefixes specified by the user with @samp{-B}.
-
-@item
-The environment variable @code{GCC_EXEC_PREFIX}, if any.
-
-@item
-The directories specified by the environment variable @code{COMPILER_PATH}.
-
-@item
-The macro @code{STANDARD_EXEC_PREFIX}.
-
-@item
-@file{/usr/lib/gcc/}.
-
-@item
-The macro @code{MD_EXEC_PREFIX}, if any.
-@end enumerate
-
-Here is the order of prefixes tried for startfiles:
-
-@enumerate
-@item
-Any prefixes specified by the user with @samp{-B}.
-
-@item
-The environment variable @code{GCC_EXEC_PREFIX}, if any.
-
-@item
-The directories specified by the environment variable @code{LIBRARY_PATH}
-(native only, cross compilers do not use this).
-
-@item
-The macro @code{STANDARD_EXEC_PREFIX}.
-
-@item
-@file{/usr/lib/gcc/}.
-
-@item
-The macro @code{MD_EXEC_PREFIX}, if any.
-
-@item
-The macro @code{MD_STARTFILE_PREFIX}, if any.
-
-@item
-The macro @code{STANDARD_STARTFILE_PREFIX}.
-
-@item
-@file{/lib/}.
-
-@item
-@file{/usr/lib/}.
-@end enumerate
-
-@node Run-time Target
-@section Run-time Target Specification
-@cindex run-time target specification
-@cindex predefined macros
-@cindex target specifications
-
-@c prevent bad page break with this line
-Here are run-time target specifications.
-
-@table @code
-@findex CPP_PREDEFINES
-@item CPP_PREDEFINES
-Define this to be a string constant containing @samp{-D} options to
-define the predefined macros that identify this machine and system.
-These macros will be predefined unless the @samp{-ansi} option is
-specified.
-
-In addition, a parallel set of macros are predefined, whose names are
-made by appending @samp{__} at the beginning and at the end. These
-@samp{__} macros are permitted by the ANSI standard, so they are
-predefined regardless of whether @samp{-ansi} is specified.
-
-For example, on the Sun, one can use the following value:
-
-@smallexample
-"-Dmc68000 -Dsun -Dunix"
-@end smallexample
-
-The result is to define the macros @code{__mc68000__}, @code{__sun__}
-and @code{__unix__} unconditionally, and the macros @code{mc68000},
-@code{sun} and @code{unix} provided @samp{-ansi} is not specified.
-
-@findex extern int target_flags
-@item extern int target_flags;
-This declaration should be present.
-
-@cindex optional hardware or system features
-@cindex features, optional, in system conventions
-@item TARGET_@dots{}
-This series of macros is to allow compiler command arguments to
-enable or disable the use of optional features of the target machine.
-For example, one machine description serves both the 68000 and
-the 68020; a command argument tells the compiler whether it should
-use 68020-only instructions or not. This command argument works
-by means of a macro @code{TARGET_68020} that tests a bit in
-@code{target_flags}.
-
-Define a macro @code{TARGET_@var{featurename}} for each such option.
-Its definition should test a bit in @code{target_flags}; for example:
-
-@smallexample
-#define TARGET_68020 (target_flags & 1)
-@end smallexample
-
-One place where these macros are used is in the condition-expressions
-of instruction patterns. Note how @code{TARGET_68020} appears
-frequently in the 68000 machine description file, @file{m68k.md}.
-Another place they are used is in the definitions of the other
-macros in the @file{@var{machine}.h} file.
-
-@findex TARGET_SWITCHES
-@item TARGET_SWITCHES
-This macro defines names of command options to set and clear
-bits in @code{target_flags}. Its definition is an initializer
-with a subgrouping for each command option.
-
-Each subgrouping contains a string constant, that defines the option
-name, a number, which contains the bits to set in
-@code{target_flags}, and a second string which is the description
-displayed by --help. If the number is negative then the bits specified
-by the number are cleared instead of being set. If the description
-string is present but empty, then no help information will be displayed
-for that option, but it will not count as an undocumented option. The
-actual option name is made by appending @samp{-m} to the specified name.
-
-One of the subgroupings should have a null string. The number in
-this grouping is the default value for @code{target_flags}. Any
-target options act starting with that value.
-
-Here is an example which defines @samp{-m68000} and @samp{-m68020}
-with opposite meanings, and picks the latter as the default:
-
-@smallexample
-#define TARGET_SWITCHES \
- @{ @{ "68020", 1, "" @}, \
- @{ "68000", -1, "Compile for the 68000" @}, \
- @{ "", 1, "" @}@}
-@end smallexample
-
-@findex TARGET_OPTIONS
-@item TARGET_OPTIONS
-This macro is similar to @code{TARGET_SWITCHES} but defines names of command
-options that have values. Its definition is an initializer with a
-subgrouping for each command option.
-
-Each subgrouping contains a string constant, that defines the fixed part
-of the option name, the address of a variable, and a description string.
-The variable, type @code{char *}, is set to the variable part of the
-given option if the fixed part matches. The actual option name is made
-by appending @samp{-m} to the specified name.
-
-Here is an example which defines @samp{-mshort-data-@var{number}}. If the
-given option is @samp{-mshort-data-512}, the variable @code{m88k_short_data}
-will be set to the string @code{"512"}.
-
-@smallexample
-extern char *m88k_short_data;
-#define TARGET_OPTIONS \
- @{ @{ "short-data-", &m88k_short_data, "Specify the size of the short data section" @} @}
-@end smallexample
-
-@findex TARGET_VERSION
-@item TARGET_VERSION
-This macro is a C statement to print on @code{stderr} a string
-describing the particular machine description choice. Every machine
-description should define @code{TARGET_VERSION}. For example:
-
-@smallexample
-#ifdef MOTOROLA
-#define TARGET_VERSION \
- fprintf (stderr, " (68k, Motorola syntax)");
-#else
-#define TARGET_VERSION \
- fprintf (stderr, " (68k, MIT syntax)");
-#endif
-@end smallexample
-
-@findex OVERRIDE_OPTIONS
-@item OVERRIDE_OPTIONS
-Sometimes certain combinations of command options do not make sense on
-a particular target machine. You can define a macro
-@code{OVERRIDE_OPTIONS} to take account of this. This macro, if
-defined, is executed once just after all the command options have been
-parsed.
-
-Don't use this macro to turn on various extra optimizations for
-@samp{-O}. That is what @code{OPTIMIZATION_OPTIONS} is for.
-
-@findex OPTIMIZATION_OPTIONS
-@item OPTIMIZATION_OPTIONS (@var{level}, @var{size})
-Some machines may desire to change what optimizations are performed for
-various optimization levels. This macro, if defined, is executed once
-just after the optimization level is determined and before the remainder
-of the command options have been parsed. Values set in this macro are
-used as the default values for the other command line options.
-
-@var{level} is the optimization level specified; 2 if @samp{-O2} is
-specified, 1 if @samp{-O} is specified, and 0 if neither is specified.
-
-@var{size} is non-zero if @samp{-Os} is specified and zero otherwise.
-
-You should not use this macro to change options that are not
-machine-specific. These should uniformly selected by the same
-optimization level on all supported machines. Use this macro to enable
-machine-specific optimizations.
-
-@strong{Do not examine @code{write_symbols} in
-this macro!} The debugging options are not supposed to alter the
-generated code.
-
-@findex CAN_DEBUG_WITHOUT_FP
-@item CAN_DEBUG_WITHOUT_FP
-Define this macro if debugging can be performed even without a frame
-pointer. If this macro is defined, GNU CC will turn on the
-@samp{-fomit-frame-pointer} option whenever @samp{-O} is specified.
-@end table
-
-@node Storage Layout
-@section Storage Layout
-@cindex storage layout
-
-Note that the definitions of the macros in this table which are sizes or
-alignments measured in bits do not need to be constant. They can be C
-expressions that refer to static variables, such as the @code{target_flags}.
-@xref{Run-time Target}.
-
-@table @code
-@findex BITS_BIG_ENDIAN
-@item BITS_BIG_ENDIAN
-Define this macro to have the value 1 if the most significant bit in a
-byte has the lowest number; otherwise define it to have the value zero.
-This means that bit-field instructions count from the most significant
-bit. If the machine has no bit-field instructions, then this must still
-be defined, but it doesn't matter which value it is defined to. This
-macro need not be a constant.
-
-This macro does not affect the way structure fields are packed into
-bytes or words; that is controlled by @code{BYTES_BIG_ENDIAN}.
-
-@findex BYTES_BIG_ENDIAN
-@item BYTES_BIG_ENDIAN
-Define this macro to have the value 1 if the most significant byte in a
-word has the lowest number. This macro need not be a constant.
-
-@findex WORDS_BIG_ENDIAN
-@item WORDS_BIG_ENDIAN
-Define this macro to have the value 1 if, in a multiword object, the
-most significant word has the lowest number. This applies to both
-memory locations and registers; GNU CC fundamentally assumes that the
-order of words in memory is the same as the order in registers. This
-macro need not be a constant.
-
-@findex LIBGCC2_WORDS_BIG_ENDIAN
-@item LIBGCC2_WORDS_BIG_ENDIAN
-Define this macro if WORDS_BIG_ENDIAN is not constant. This must be a
-constant value with the same meaning as WORDS_BIG_ENDIAN, which will be
-used only when compiling libgcc2.c. Typically the value will be set
-based on preprocessor defines.
-
-@findex FLOAT_WORDS_BIG_ENDIAN
-@item FLOAT_WORDS_BIG_ENDIAN
-Define this macro to have the value 1 if @code{DFmode}, @code{XFmode} or
-@code{TFmode} floating point numbers are stored in memory with the word
-containing the sign bit at the lowest address; otherwise define it to
-have the value 0. This macro need not be a constant.
-
-You need not define this macro if the ordering is the same as for
-multi-word integers.
-
-@findex BITS_PER_UNIT
-@item BITS_PER_UNIT
-Define this macro to be the number of bits in an addressable storage
-unit (byte); normally 8.
-
-@findex BITS_PER_WORD
-@item BITS_PER_WORD
-Number of bits in a word; normally 32.
-
-@findex MAX_BITS_PER_WORD
-@item MAX_BITS_PER_WORD
-Maximum number of bits in a word. If this is undefined, the default is
-@code{BITS_PER_WORD}. Otherwise, it is the constant value that is the
-largest value that @code{BITS_PER_WORD} can have at run-time.
-
-@findex UNITS_PER_WORD
-@item UNITS_PER_WORD
-Number of storage units in a word; normally 4.
-
-@findex MIN_UNITS_PER_WORD
-@item MIN_UNITS_PER_WORD
-Minimum number of units in a word. If this is undefined, the default is
-@code{UNITS_PER_WORD}. Otherwise, it is the constant value that is the
-smallest value that @code{UNITS_PER_WORD} can have at run-time.
-
-@findex POINTER_SIZE
-@item POINTER_SIZE
-Width of a pointer, in bits. You must specify a value no wider than the
-width of @code{Pmode}. If it is not equal to the width of @code{Pmode},
-you must define @code{POINTERS_EXTEND_UNSIGNED}.
-
-@findex POINTERS_EXTEND_UNSIGNED
-@item POINTERS_EXTEND_UNSIGNED
-A C expression whose value is nonzero if pointers that need to be
-extended from being @code{POINTER_SIZE} bits wide to @code{Pmode} are to
-be zero-extended and zero if they are to be sign-extended.
-
-You need not define this macro if the @code{POINTER_SIZE} is equal
-to the width of @code{Pmode}.
-
-@findex PROMOTE_MODE
-@item PROMOTE_MODE (@var{m}, @var{unsignedp}, @var{type})
-A macro to update @var{m} and @var{unsignedp} when an object whose type
-is @var{type} and which has the specified mode and signedness is to be
-stored in a register. This macro is only called when @var{type} is a
-scalar type.
-
-On most RISC machines, which only have operations that operate on a full
-register, define this macro to set @var{m} to @code{word_mode} if
-@var{m} is an integer mode narrower than @code{BITS_PER_WORD}. In most
-cases, only integer modes should be widened because wider-precision
-floating-point operations are usually more expensive than their narrower
-counterparts.
-
-For most machines, the macro definition does not change @var{unsignedp}.
-However, some machines, have instructions that preferentially handle
-either signed or unsigned quantities of certain modes. For example, on
-the DEC Alpha, 32-bit loads from memory and 32-bit add instructions
-sign-extend the result to 64 bits. On such machines, set
-@var{unsignedp} according to which kind of extension is more efficient.
-
-Do not define this macro if it would never modify @var{m}.
-
-@findex PROMOTE_FUNCTION_ARGS
-@item PROMOTE_FUNCTION_ARGS
-Define this macro if the promotion described by @code{PROMOTE_MODE}
-should also be done for outgoing function arguments.
-
-@findex PROMOTE_FUNCTION_RETURN
-@item PROMOTE_FUNCTION_RETURN
-Define this macro if the promotion described by @code{PROMOTE_MODE}
-should also be done for the return value of functions.
-
-If this macro is defined, @code{FUNCTION_VALUE} must perform the same
-promotions done by @code{PROMOTE_MODE}.
-
-@findex PROMOTE_FOR_CALL_ONLY
-@item PROMOTE_FOR_CALL_ONLY
-Define this macro if the promotion described by @code{PROMOTE_MODE}
-should @emph{only} be performed for outgoing function arguments or
-function return values, as specified by @code{PROMOTE_FUNCTION_ARGS}
-and @code{PROMOTE_FUNCTION_RETURN}, respectively.
-
-@findex PARM_BOUNDARY
-@item PARM_BOUNDARY
-Normal alignment required for function parameters on the stack, in
-bits. All stack parameters receive at least this much alignment
-regardless of data type. On most machines, this is the same as the
-size of an integer.
-
-@findex STACK_BOUNDARY
-@item STACK_BOUNDARY
-Define this macro if there is a guaranteed alignment for the stack
-pointer on this machine. The definition is a C expression
-for the desired alignment (measured in bits). This value is used as a
-default if PREFERRED_STACK_BOUNDARY is not defined.
-
-@findex PREFERRED_STACK_BOUNDARY
-@item PREFERRED_STACK_BOUNDARY
-Define this macro if you wish to preserve a certain alignment for
-the stack pointer. The definition is a C expression
-for the desired alignment (measured in bits). If STACK_BOUNDARY is
-also defined, this macro must evaluate to a value equal to or larger
-than STACK_BOUNDARY.
-
-@cindex @code{PUSH_ROUNDING}, interaction with @code{PREFERRED_STACK_BOUNDARY}
-If @code{PUSH_ROUNDING} is not defined, the stack will always be aligned
-to the specified boundary. If @code{PUSH_ROUNDING} is defined and specifies
-a less strict alignment than @code{PREFERRED_STACK_BOUNDARY}, the stack may
-be momentarily unaligned while pushing arguments.
-
-@findex FUNCTION_BOUNDARY
-@item FUNCTION_BOUNDARY
-Alignment required for a function entry point, in bits.
-
-@findex BIGGEST_ALIGNMENT
-@item BIGGEST_ALIGNMENT
-Biggest alignment that any data type can require on this machine, in bits.
-
-@findex MINIMUM_ATOMIC_ALIGNMENT
-@item MINIMUM_ATOMIC_ALIGNMENT
-If defined, the smallest alignment, in bits, that can be given to an
-object that can be referenced in one operation, without disturbing any
-nearby object. Normally, this is @code{BITS_PER_UNIT}, but may be larger
-on machines that don't have byte or half-word store operations.
-
-@findex BIGGEST_FIELD_ALIGNMENT
-@item BIGGEST_FIELD_ALIGNMENT
-Biggest alignment that any structure field can require on this machine,
-in bits. If defined, this overrides @code{BIGGEST_ALIGNMENT} for
-structure fields only.
-
-@findex ADJUST_FIELD_ALIGN
-@item ADJUST_FIELD_ALIGN (@var{field}, @var{computed})
-An expression for the alignment of a structure field @var{field} if the
-alignment computed in the usual way is @var{computed}. GNU CC uses
-this value instead of the value in @code{BIGGEST_ALIGNMENT} or
-@code{BIGGEST_FIELD_ALIGNMENT}, if defined, for structure fields only.
-
-@findex MAX_OFILE_ALIGNMENT
-@item MAX_OFILE_ALIGNMENT
-Biggest alignment supported by the object file format of this machine.
-Use this macro to limit the alignment which can be specified using the
-@code{__attribute__ ((aligned (@var{n})))} construct. If not defined,
-the default value is @code{BIGGEST_ALIGNMENT}.
-
-@findex DATA_ALIGNMENT
-@item DATA_ALIGNMENT (@var{type}, @var{basic-align})
-If defined, a C expression to compute the alignment for a variables in
-the static store. @var{type} is the data type, and @var{basic-align} is
-the alignment that the object would ordinarily have. The value of this
-macro is used instead of that alignment to align the object.
-
-If this macro is not defined, then @var{basic-align} is used.
-
-@findex strcpy
-One use of this macro is to increase alignment of medium-size data to
-make it all fit in fewer cache lines. Another is to cause character
-arrays to be word-aligned so that @code{strcpy} calls that copy
-constants to character arrays can be done inline.
-
-@findex CONSTANT_ALIGNMENT
-@item CONSTANT_ALIGNMENT (@var{constant}, @var{basic-align})
-If defined, a C expression to compute the alignment given to a constant
-that is being placed in memory. @var{constant} is the constant and
-@var{basic-align} is the alignment that the object would ordinarily
-have. The value of this macro is used instead of that alignment to
-align the object.
-
-If this macro is not defined, then @var{basic-align} is used.
-
-The typical use of this macro is to increase alignment for string
-constants to be word aligned so that @code{strcpy} calls that copy
-constants can be done inline.
-
-@findex LOCAL_ALIGNMENT
-@item LOCAL_ALIGNMENT (@var{type}, @var{basic-align})
-If defined, a C expression to compute the alignment for a variables in
-the local store. @var{type} is the data type, and @var{basic-align} is
-the alignment that the object would ordinarily have. The value of this
-macro is used instead of that alignment to align the object.
-
-If this macro is not defined, then @var{basic-align} is used.
-
-One use of this macro is to increase alignment of medium-size data to
-make it all fit in fewer cache lines.
-
-@findex EMPTY_FIELD_BOUNDARY
-@item EMPTY_FIELD_BOUNDARY
-Alignment in bits to be given to a structure bit field that follows an
-empty field such as @code{int : 0;}.
-
-Note that @code{PCC_BITFIELD_TYPE_MATTERS} also affects the alignment
-that results from an empty field.
-
-@findex STRUCTURE_SIZE_BOUNDARY
-@item STRUCTURE_SIZE_BOUNDARY
-Number of bits which any structure or union's size must be a multiple of.
-Each structure or union's size is rounded up to a multiple of this.
-
-If you do not define this macro, the default is the same as
-@code{BITS_PER_UNIT}.
-
-@findex STRICT_ALIGNMENT
-@item STRICT_ALIGNMENT
-Define this macro to be the value 1 if instructions will fail to work
-if given data not on the nominal alignment. If instructions will merely
-go slower in that case, define this macro as 0.
-
-@findex PCC_BITFIELD_TYPE_MATTERS
-@item PCC_BITFIELD_TYPE_MATTERS
-Define this if you wish to imitate the way many other C compilers handle
-alignment of bitfields and the structures that contain them.
-
-The behavior is that the type written for a bitfield (@code{int},
-@code{short}, or other integer type) imposes an alignment for the
-entire structure, as if the structure really did contain an ordinary
-field of that type. In addition, the bitfield is placed within the
-structure so that it would fit within such a field, not crossing a
-boundary for it.
-
-Thus, on most machines, a bitfield whose type is written as @code{int}
-would not cross a four-byte boundary, and would force four-byte
-alignment for the whole structure. (The alignment used may not be four
-bytes; it is controlled by the other alignment parameters.)
-
-If the macro is defined, its definition should be a C expression;
-a nonzero value for the expression enables this behavior.
-
-Note that if this macro is not defined, or its value is zero, some
-bitfields may cross more than one alignment boundary. The compiler can
-support such references if there are @samp{insv}, @samp{extv}, and
-@samp{extzv} insns that can directly reference memory.
-
-The other known way of making bitfields work is to define
-@code{STRUCTURE_SIZE_BOUNDARY} as large as @code{BIGGEST_ALIGNMENT}.
-Then every structure can be accessed with fullwords.
-
-Unless the machine has bitfield instructions or you define
-@code{STRUCTURE_SIZE_BOUNDARY} that way, you must define
-@code{PCC_BITFIELD_TYPE_MATTERS} to have a nonzero value.
-
-If your aim is to make GNU CC use the same conventions for laying out
-bitfields as are used by another compiler, here is how to investigate
-what the other compiler does. Compile and run this program:
-
-@example
-struct foo1
-@{
- char x;
- char :0;
- char y;
-@};
-
-struct foo2
-@{
- char x;
- int :0;
- char y;
-@};
-
-main ()
-@{
- printf ("Size of foo1 is %d\n",
- sizeof (struct foo1));
- printf ("Size of foo2 is %d\n",
- sizeof (struct foo2));
- exit (0);
-@}
-@end example
-
-If this prints 2 and 5, then the compiler's behavior is what you would
-get from @code{PCC_BITFIELD_TYPE_MATTERS}.
-
-@findex BITFIELD_NBYTES_LIMITED
-@item BITFIELD_NBYTES_LIMITED
-Like PCC_BITFIELD_TYPE_MATTERS except that its effect is limited to
-aligning a bitfield within the structure.
-
-@findex ROUND_TYPE_SIZE
-@item ROUND_TYPE_SIZE (@var{type}, @var{computed}, @var{specified})
-Define this macro as an expression for the overall size of a type
-(given by @var{type} as a tree node) when the size computed in the
-usual way is @var{computed} and the alignment is @var{specified}.
-
-The default is to round @var{computed} up to a multiple of @var{specified}.
-
-@findex ROUND_TYPE_ALIGN
-@item ROUND_TYPE_ALIGN (@var{type}, @var{computed}, @var{specified})
-Define this macro as an expression for the alignment of a type (given
-by @var{type} as a tree node) if the alignment computed in the usual
-way is @var{computed} and the alignment explicitly specified was
-@var{specified}.
-
-The default is to use @var{specified} if it is larger; otherwise, use
-the smaller of @var{computed} and @code{BIGGEST_ALIGNMENT}
-
-@findex MAX_FIXED_MODE_SIZE
-@item MAX_FIXED_MODE_SIZE
-An integer expression for the size in bits of the largest integer
-machine mode that should actually be used. All integer machine modes of
-this size or smaller can be used for structures and unions with the
-appropriate sizes. If this macro is undefined, @code{GET_MODE_BITSIZE
-(DImode)} is assumed.
-
-@findex STACK_SAVEAREA_MODE
-@item STACK_SAVEAREA_MODE (@var{save_level})
-If defined, an expression of type @code{enum machine_mode} that
-specifies the mode of the save area operand of a
-@code{save_stack_@var{level}} named pattern (@pxref{Standard Names}).
-@var{save_level} is one of @code{SAVE_BLOCK}, @code{SAVE_FUNCTION}, or
-@code{SAVE_NONLOCAL} and selects which of the three named patterns is
-having its mode specified.
-
-You need not define this macro if it always returns @code{Pmode}. You
-would most commonly define this macro if the
-@code{save_stack_@var{level}} patterns need to support both a 32- and a
-64-bit mode.
-
-@findex STACK_SIZE_MODE
-@item STACK_SIZE_MODE
-If defined, an expression of type @code{enum machine_mode} that
-specifies the mode of the size increment operand of an
-@code{allocate_stack} named pattern (@pxref{Standard Names}).
-
-You need not define this macro if it always returns @code{word_mode}.
-You would most commonly define this macro if the @code{allocate_stack}
-pattern needs to support both a 32- and a 64-bit mode.
-
-@findex CHECK_FLOAT_VALUE
-@item CHECK_FLOAT_VALUE (@var{mode}, @var{value}, @var{overflow})
-A C statement to validate the value @var{value} (of type
-@code{double}) for mode @var{mode}. This means that you check whether
-@var{value} fits within the possible range of values for mode
-@var{mode} on this target machine. The mode @var{mode} is always
-a mode of class @code{MODE_FLOAT}. @var{overflow} is nonzero if
-the value is already known to be out of range.
-
-If @var{value} is not valid or if @var{overflow} is nonzero, you should
-set @var{overflow} to 1 and then assign some valid value to @var{value}.
-Allowing an invalid value to go through the compiler can produce
-incorrect assembler code which may even cause Unix assemblers to crash.
-
-This macro need not be defined if there is no work for it to do.
-
-@findex TARGET_FLOAT_FORMAT
-@item TARGET_FLOAT_FORMAT
-A code distinguishing the floating point format of the target machine.
-There are three defined values:
-
-@table @code
-@findex IEEE_FLOAT_FORMAT
-@item IEEE_FLOAT_FORMAT
-This code indicates IEEE floating point. It is the default; there is no
-need to define this macro when the format is IEEE.
-
-@findex VAX_FLOAT_FORMAT
-@item VAX_FLOAT_FORMAT
-This code indicates the peculiar format used on the Vax.
-
-@findex UNKNOWN_FLOAT_FORMAT
-@item UNKNOWN_FLOAT_FORMAT
-This code indicates any other format.
-@end table
-
-The value of this macro is compared with @code{HOST_FLOAT_FORMAT}
-(@pxref{Config}) to determine whether the target machine has the same
-format as the host machine. If any other formats are actually in use on
-supported machines, new codes should be defined for them.
-
-The ordering of the component words of floating point values stored in
-memory is controlled by @code{FLOAT_WORDS_BIG_ENDIAN} for the target
-machine and @code{HOST_FLOAT_WORDS_BIG_ENDIAN} for the host.
-
-@findex DEFAULT_VTABLE_THUNKS
-@item DEFAULT_VTABLE_THUNKS
-GNU CC supports two ways of implementing C++ vtables: traditional or with
-so-called ``thunks''. The flag @samp{-fvtable-thunk} chooses between them.
-Define this macro to be a C expression for the default value of that flag.
-If @code{DEFAULT_VTABLE_THUNKS} is 0, GNU CC uses the traditional
-implementation by default. The ``thunk'' implementation is more efficient
-(especially if you have provided an implementation of
-@code{ASM_OUTPUT_MI_THUNK}, see @ref{Function Entry}), but is not binary
-compatible with code compiled using the traditional implementation.
-If you are writing a new ports, define @code{DEFAULT_VTABLE_THUNKS} to 1.
-
-If you do not define this macro, the default for @samp{-fvtable-thunk} is 0.
-@end table
-
-@node Type Layout
-@section Layout of Source Language Data Types
-
-These macros define the sizes and other characteristics of the standard
-basic data types used in programs being compiled. Unlike the macros in
-the previous section, these apply to specific features of C and related
-languages, rather than to fundamental aspects of storage layout.
-
-@table @code
-@findex INT_TYPE_SIZE
-@item INT_TYPE_SIZE
-A C expression for the size in bits of the type @code{int} on the
-target machine. If you don't define this, the default is one word.
-
-@findex MAX_INT_TYPE_SIZE
-@item MAX_INT_TYPE_SIZE
-Maximum number for the size in bits of the type @code{int} on the target
-machine. If this is undefined, the default is @code{INT_TYPE_SIZE}.
-Otherwise, it is the constant value that is the largest value that
-@code{INT_TYPE_SIZE} can have at run-time. This is used in @code{cpp}.
-
-@findex SHORT_TYPE_SIZE
-@item SHORT_TYPE_SIZE
-A C expression for the size in bits of the type @code{short} on the
-target machine. If you don't define this, the default is half a word.
-(If this would be less than one storage unit, it is rounded up to one
-unit.)
-
-@findex LONG_TYPE_SIZE
-@item LONG_TYPE_SIZE
-A C expression for the size in bits of the type @code{long} on the
-target machine. If you don't define this, the default is one word.
-
-@findex MAX_LONG_TYPE_SIZE
-@item MAX_LONG_TYPE_SIZE
-Maximum number for the size in bits of the type @code{long} on the
-target machine. If this is undefined, the default is
-@code{LONG_TYPE_SIZE}. Otherwise, it is the constant value that is the
-largest value that @code{LONG_TYPE_SIZE} can have at run-time. This is
-used in @code{cpp}.
-
-@findex LONG_LONG_TYPE_SIZE
-@item LONG_LONG_TYPE_SIZE
-A C expression for the size in bits of the type @code{long long} on the
-target machine. If you don't define this, the default is two
-words. If you want to support GNU Ada on your machine, the value of
-macro must be at least 64.
-
-@findex CHAR_TYPE_SIZE
-@item CHAR_TYPE_SIZE
-A C expression for the size in bits of the type @code{char} on the
-target machine. If you don't define this, the default is one quarter
-of a word. (If this would be less than one storage unit, it is rounded up
-to one unit.)
-
-@findex MAX_CHAR_TYPE_SIZE
-@item MAX_CHAR_TYPE_SIZE
-Maximum number for the size in bits of the type @code{char} on the
-target machine. If this is undefined, the default is
-@code{CHAR_TYPE_SIZE}. Otherwise, it is the constant value that is the
-largest value that @code{CHAR_TYPE_SIZE} can have at run-time. This is
-used in @code{cpp}.
-
-@findex FLOAT_TYPE_SIZE
-@item FLOAT_TYPE_SIZE
-A C expression for the size in bits of the type @code{float} on the
-target machine. If you don't define this, the default is one word.
-
-@findex DOUBLE_TYPE_SIZE
-@item DOUBLE_TYPE_SIZE
-A C expression for the size in bits of the type @code{double} on the
-target machine. If you don't define this, the default is two
-words.
-
-@findex LONG_DOUBLE_TYPE_SIZE
-@item LONG_DOUBLE_TYPE_SIZE
-A C expression for the size in bits of the type @code{long double} on
-the target machine. If you don't define this, the default is two
-words.
-
-@findex WIDEST_HARDWARE_FP_SIZE
-@item WIDEST_HARDWARE_FP_SIZE
-A C expression for the size in bits of the widest floating-point format
-supported by the hardware. If you define this macro, you must specify a
-value less than or equal to the value of @code{LONG_DOUBLE_TYPE_SIZE}.
-If you do not define this macro, the value of @code{LONG_DOUBLE_TYPE_SIZE}
-is the default.
-
-@findex DEFAULT_SIGNED_CHAR
-@item DEFAULT_SIGNED_CHAR
-An expression whose value is 1 or 0, according to whether the type
-@code{char} should be signed or unsigned by default. The user can
-always override this default with the options @samp{-fsigned-char}
-and @samp{-funsigned-char}.
-
-@findex DEFAULT_SHORT_ENUMS
-@item DEFAULT_SHORT_ENUMS
-A C expression to determine whether to give an @code{enum} type
-only as many bytes as it takes to represent the range of possible values
-of that type. A nonzero value means to do that; a zero value means all
-@code{enum} types should be allocated like @code{int}.
-
-If you don't define the macro, the default is 0.
-
-@findex SIZE_TYPE
-@item SIZE_TYPE
-A C expression for a string describing the name of the data type to use
-for size values. The typedef name @code{size_t} is defined using the
-contents of the string.
-
-The string can contain more than one keyword. If so, separate them with
-spaces, and write first any length keyword, then @code{unsigned} if
-appropriate, and finally @code{int}. The string must exactly match one
-of the data type names defined in the function
-@code{init_decl_processing} in the file @file{c-decl.c}. You may not
-omit @code{int} or change the order---that would cause the compiler to
-crash on startup.
-
-If you don't define this macro, the default is @code{"long unsigned
-int"}.
-
-@findex PTRDIFF_TYPE
-@item PTRDIFF_TYPE
-A C expression for a string describing the name of the data type to use
-for the result of subtracting two pointers. The typedef name
-@code{ptrdiff_t} is defined using the contents of the string. See
-@code{SIZE_TYPE} above for more information.
-
-If you don't define this macro, the default is @code{"long int"}.
-
-@findex WCHAR_TYPE
-@item WCHAR_TYPE
-A C expression for a string describing the name of the data type to use
-for wide characters. The typedef name @code{wchar_t} is defined using
-the contents of the string. See @code{SIZE_TYPE} above for more
-information.
-
-If you don't define this macro, the default is @code{"int"}.
-
-@findex WCHAR_TYPE_SIZE
-@item WCHAR_TYPE_SIZE
-A C expression for the size in bits of the data type for wide
-characters. This is used in @code{cpp}, which cannot make use of
-@code{WCHAR_TYPE}.
-
-@findex MAX_WCHAR_TYPE_SIZE
-@item MAX_WCHAR_TYPE_SIZE
-Maximum number for the size in bits of the data type for wide
-characters. If this is undefined, the default is
-@code{WCHAR_TYPE_SIZE}. Otherwise, it is the constant value that is the
-largest value that @code{WCHAR_TYPE_SIZE} can have at run-time. This is
-used in @code{cpp}.
-
-@findex OBJC_INT_SELECTORS
-@item OBJC_INT_SELECTORS
-Define this macro if the type of Objective C selectors should be
-@code{int}.
-
-If this macro is not defined, then selectors should have the type
-@code{struct objc_selector *}.
-
-@findex OBJC_SELECTORS_WITHOUT_LABELS
-@item OBJC_SELECTORS_WITHOUT_LABELS
-Define this macro if the compiler can group all the selectors together
-into a vector and use just one label at the beginning of the vector.
-Otherwise, the compiler must give each selector its own assembler
-label.
-
-On certain machines, it is important to have a separate label for each
-selector because this enables the linker to eliminate duplicate selectors.
-
-@findex TARGET_BELL
-@item TARGET_BELL
-A C constant expression for the integer value for escape sequence
-@samp{\a}.
-
-@findex TARGET_TAB
-@findex TARGET_BS
-@findex TARGET_NEWLINE
-@item TARGET_BS
-@itemx TARGET_TAB
-@itemx TARGET_NEWLINE
-C constant expressions for the integer values for escape sequences
-@samp{\b}, @samp{\t} and @samp{\n}.
-
-@findex TARGET_VT
-@findex TARGET_FF
-@findex TARGET_CR
-@item TARGET_VT
-@itemx TARGET_FF
-@itemx TARGET_CR
-C constant expressions for the integer values for escape sequences
-@samp{\v}, @samp{\f} and @samp{\r}.
-@end table
-
-@node Registers
-@section Register Usage
-@cindex register usage
-
-This section explains how to describe what registers the target machine
-has, and how (in general) they can be used.
-
-The description of which registers a specific instruction can use is
-done with register classes; see @ref{Register Classes}. For information
-on using registers to access a stack frame, see @ref{Frame Registers}.
-For passing values in registers, see @ref{Register Arguments}.
-For returning values in registers, see @ref{Scalar Return}.
-
-@menu
-* Register Basics:: Number and kinds of registers.
-* Allocation Order:: Order in which registers are allocated.
-* Values in Registers:: What kinds of values each reg can hold.
-* Leaf Functions:: Renumbering registers for leaf functions.
-* Stack Registers:: Handling a register stack such as 80387.
-* Obsolete Register Macros:: Macros formerly used for the 80387.
-@end menu
-
-@node Register Basics
-@subsection Basic Characteristics of Registers
-
-@c prevent bad page break with this line
-Registers have various characteristics.
-
-@table @code
-@findex FIRST_PSEUDO_REGISTER
-@item FIRST_PSEUDO_REGISTER
-Number of hardware registers known to the compiler. They receive
-numbers 0 through @code{FIRST_PSEUDO_REGISTER-1}; thus, the first
-pseudo register's number really is assigned the number
-@code{FIRST_PSEUDO_REGISTER}.
-
-@item FIXED_REGISTERS
-@findex FIXED_REGISTERS
-@cindex fixed register
-An initializer that says which registers are used for fixed purposes
-all throughout the compiled code and are therefore not available for
-general allocation. These would include the stack pointer, the frame
-pointer (except on machines where that can be used as a general
-register when no frame pointer is needed), the program counter on
-machines where that is considered one of the addressable registers,
-and any other numbered register with a standard use.
-
-This information is expressed as a sequence of numbers, separated by
-commas and surrounded by braces. The @var{n}th number is 1 if
-register @var{n} is fixed, 0 otherwise.
-
-The table initialized from this macro, and the table initialized by
-the following one, may be overridden at run time either automatically,
-by the actions of the macro @code{CONDITIONAL_REGISTER_USAGE}, or by
-the user with the command options @samp{-ffixed-@var{reg}},
-@samp{-fcall-used-@var{reg}} and @samp{-fcall-saved-@var{reg}}.
-
-@findex CALL_USED_REGISTERS
-@item CALL_USED_REGISTERS
-@cindex call-used register
-@cindex call-clobbered register
-@cindex call-saved register
-Like @code{FIXED_REGISTERS} but has 1 for each register that is
-clobbered (in general) by function calls as well as for fixed
-registers. This macro therefore identifies the registers that are not
-available for general allocation of values that must live across
-function calls.
-
-If a register has 0 in @code{CALL_USED_REGISTERS}, the compiler
-automatically saves it on function entry and restores it on function
-exit, if the register is used within the function.
-
-@findex HARD_REGNO_CALL_PART_CLOBBERED
-@item HARD_REGNO_CALL_PART_CLOBBERED (@var{regno}, @var{mode})
-@cindex call-used register
-@cindex call-clobbered register
-@cindex call-saved register
-A C expression that is non-zero if it is not permissible to store a
-value of mode @var{mode} in hard register number @var{regno} across a
-call without some part of it being clobbered. For most machines this
-macro need not be defined. It is only required for machines that do not
-preserve the entire contents of a register across a call.
-
-@findex CONDITIONAL_REGISTER_USAGE
-@findex fixed_regs
-@findex call_used_regs
-@item CONDITIONAL_REGISTER_USAGE
-Zero or more C statements that may conditionally modify four variables
-@code{fixed_regs}, @code{call_used_regs}, @code{global_regs}
-(these three are of type @code{char []}) and @code{reg_class_contents}
-(of type @code{HARD_REG_SET}).
-Before the macro is called @code{fixed_regs}, @code{call_used_regs}
-and @code{reg_class_contents} have been initialized from
-@code{FIXED_REGISTERS}, @code{CALL_USED_REGISTERS} and
-@code{REG_CLASS_CONTENTS}, respectively,
-@code{global_regs} has been cleared, and any @samp{-ffixed-@var{reg}},
-@samp{-fcall-used-@var{reg}} and @samp{-fcall-saved-@var{reg}} command
-options have been applied.
-
-This is necessary in case the fixed or call-clobbered registers depend
-on target flags.
-
-You need not define this macro if it has no work to do.
-
-@cindex disabling certain registers
-@cindex controlling register usage
-If the usage of an entire class of registers depends on the target
-flags, you may indicate this to GCC by using this macro to modify
-@code{fixed_regs} and @code{call_used_regs} to 1 for each of the
-registers in the classes which should not be used by GCC. Also define
-the macro @code{REG_CLASS_FROM_LETTER} to return @code{NO_REGS} if it
-is called with a letter for a class that shouldn't be used.
-
-(However, if this class is not included in @code{GENERAL_REGS} and all
-of the insn patterns whose constraints permit this class are
-controlled by target switches, then GCC will automatically avoid using
-these registers when the target switches are opposed to them.)
-
-@findex NON_SAVING_SETJMP
-@item NON_SAVING_SETJMP
-If this macro is defined and has a nonzero value, it means that
-@code{setjmp} and related functions fail to save the registers, or that
-@code{longjmp} fails to restore them. To compensate, the compiler
-avoids putting variables in registers in functions that use
-@code{setjmp}.
-
-@findex INCOMING_REGNO
-@item INCOMING_REGNO (@var{out})
-Define this macro if the target machine has register windows. This C
-expression returns the register number as seen by the called function
-corresponding to the register number @var{out} as seen by the calling
-function. Return @var{out} if register number @var{out} is not an
-outbound register.
-
-@findex OUTGOING_REGNO
-@item OUTGOING_REGNO (@var{in})
-Define this macro if the target machine has register windows. This C
-expression returns the register number as seen by the calling function
-corresponding to the register number @var{in} as seen by the called
-function. Return @var{in} if register number @var{in} is not an inbound
-register.
-
-@ignore
-@findex PC_REGNUM
-@item PC_REGNUM
-If the program counter has a register number, define this as that
-register number. Otherwise, do not define it.
-@end ignore
-@end table
-
-@node Allocation Order
-@subsection Order of Allocation of Registers
-@cindex order of register allocation
-@cindex register allocation order
-
-@c prevent bad page break with this line
-Registers are allocated in order.
-
-@table @code
-@findex REG_ALLOC_ORDER
-@item REG_ALLOC_ORDER
-If defined, an initializer for a vector of integers, containing the
-numbers of hard registers in the order in which GNU CC should prefer
-to use them (from most preferred to least).
-
-If this macro is not defined, registers are used lowest numbered first
-(all else being equal).
-
-One use of this macro is on machines where the highest numbered
-registers must always be saved and the save-multiple-registers
-instruction supports only sequences of consecutive registers. On such
-machines, define @code{REG_ALLOC_ORDER} to be an initializer that lists
-the highest numbered allocable register first.
-
-@findex ORDER_REGS_FOR_LOCAL_ALLOC
-@item ORDER_REGS_FOR_LOCAL_ALLOC
-A C statement (sans semicolon) to choose the order in which to allocate
-hard registers for pseudo-registers local to a basic block.
-
-Store the desired register order in the array @code{reg_alloc_order}.
-Element 0 should be the register to allocate first; element 1, the next
-register; and so on.
-
-The macro body should not assume anything about the contents of
-@code{reg_alloc_order} before execution of the macro.
-
-On most machines, it is not necessary to define this macro.
-@end table
-
-@node Values in Registers
-@subsection How Values Fit in Registers
-
-This section discusses the macros that describe which kinds of values
-(specifically, which machine modes) each register can hold, and how many
-consecutive registers are needed for a given mode.
-
-@table @code
-@findex HARD_REGNO_NREGS
-@item HARD_REGNO_NREGS (@var{regno}, @var{mode})
-A C expression for the number of consecutive hard registers, starting
-at register number @var{regno}, required to hold a value of mode
-@var{mode}.
-
-On a machine where all registers are exactly one word, a suitable
-definition of this macro is
-
-@smallexample
-#define HARD_REGNO_NREGS(REGNO, MODE) \
- ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) \
- / UNITS_PER_WORD))
-@end smallexample
-
-@findex ALTER_HARD_SUBREG
-@item ALTER_HARD_SUBREG (@var{tgt_mode}, @var{word}, @var{src_mode}, @var{regno})
-A C expression that returns an adjusted hard register number for
-
-@smallexample
-(subreg:@var{tgt_mode} (reg:@var{src_mode} @var{regno}) @var{word})
-@end smallexample
-
-This may be needed if the target machine has mixed sized big-endian
-registers, like Sparc v9.
-
-@findex HARD_REGNO_MODE_OK
-@item HARD_REGNO_MODE_OK (@var{regno}, @var{mode})
-A C expression that is nonzero if it is permissible to store a value
-of mode @var{mode} in hard register number @var{regno} (or in several
-registers starting with that one). For a machine where all registers
-are equivalent, a suitable definition is
-
-@smallexample
-#define HARD_REGNO_MODE_OK(REGNO, MODE) 1
-@end smallexample
-
-You need not include code to check for the numbers of fixed registers,
-because the allocation mechanism considers them to be always occupied.
-
-@cindex register pairs
-On some machines, double-precision values must be kept in even/odd
-register pairs. You can implement that by defining this macro to reject
-odd register numbers for such modes.
-
-The minimum requirement for a mode to be OK in a register is that the
-@samp{mov@var{mode}} instruction pattern support moves between the
-register and other hard register in the same class and that moving a
-value into the register and back out not alter it.
-
-Since the same instruction used to move @code{word_mode} will work for
-all narrower integer modes, it is not necessary on any machine for
-@code{HARD_REGNO_MODE_OK} to distinguish between these modes, provided
-you define patterns @samp{movhi}, etc., to take advantage of this. This
-is useful because of the interaction between @code{HARD_REGNO_MODE_OK}
-and @code{MODES_TIEABLE_P}; it is very desirable for all integer modes
-to be tieable.
-
-Many machines have special registers for floating point arithmetic.
-Often people assume that floating point machine modes are allowed only
-in floating point registers. This is not true. Any registers that
-can hold integers can safely @emph{hold} a floating point machine
-mode, whether or not floating arithmetic can be done on it in those
-registers. Integer move instructions can be used to move the values.
-
-On some machines, though, the converse is true: fixed-point machine
-modes may not go in floating registers. This is true if the floating
-registers normalize any value stored in them, because storing a
-non-floating value there would garble it. In this case,
-@code{HARD_REGNO_MODE_OK} should reject fixed-point machine modes in
-floating registers. But if the floating registers do not automatically
-normalize, if you can store any bit pattern in one and retrieve it
-unchanged without a trap, then any machine mode may go in a floating
-register, so you can define this macro to say so.
-
-The primary significance of special floating registers is rather that
-they are the registers acceptable in floating point arithmetic
-instructions. However, this is of no concern to
-@code{HARD_REGNO_MODE_OK}. You handle it by writing the proper
-constraints for those instructions.
-
-On some machines, the floating registers are especially slow to access,
-so that it is better to store a value in a stack frame than in such a
-register if floating point arithmetic is not being done. As long as the
-floating registers are not in class @code{GENERAL_REGS}, they will not
-be used unless some pattern's constraint asks for one.
-
-@findex MODES_TIEABLE_P
-@item MODES_TIEABLE_P (@var{mode1}, @var{mode2})
-A C expression that is nonzero if a value of mode
-@var{mode1} is accessible in mode @var{mode2} without copying.
-
-If @code{HARD_REGNO_MODE_OK (@var{r}, @var{mode1})} and
-@code{HARD_REGNO_MODE_OK (@var{r}, @var{mode2})} are always the same for
-any @var{r}, then @code{MODES_TIEABLE_P (@var{mode1}, @var{mode2})}
-should be nonzero. If they differ for any @var{r}, you should define
-this macro to return zero unless some other mechanism ensures the
-accessibility of the value in a narrower mode.
-
-You should define this macro to return nonzero in as many cases as
-possible since doing so will allow GNU CC to perform better register
-allocation.
-
-@findex AVOID_CCMODE_COPIES
-@item AVOID_CCMODE_COPIES
-Define this macro if the compiler should avoid copies to/from @code{CCmode}
-registers. You should only define this macro if support fo copying to/from
-@code{CCmode} is incomplete.
-@end table
-
-@node Leaf Functions
-@subsection Handling Leaf Functions
-
-@cindex leaf functions
-@cindex functions, leaf
-On some machines, a leaf function (i.e., one which makes no calls) can run
-more efficiently if it does not make its own register window. Often this
-means it is required to receive its arguments in the registers where they
-are passed by the caller, instead of the registers where they would
-normally arrive.
-
-The special treatment for leaf functions generally applies only when
-other conditions are met; for example, often they may use only those
-registers for its own variables and temporaries. We use the term ``leaf
-function'' to mean a function that is suitable for this special
-handling, so that functions with no calls are not necessarily ``leaf
-functions''.
-
-GNU CC assigns register numbers before it knows whether the function is
-suitable for leaf function treatment. So it needs to renumber the
-registers in order to output a leaf function. The following macros
-accomplish this.
-
-@table @code
-@findex LEAF_REGISTERS
-@item LEAF_REGISTERS
-A C initializer for a vector, indexed by hard register number, which
-contains 1 for a register that is allowable in a candidate for leaf
-function treatment.
-
-If leaf function treatment involves renumbering the registers, then the
-registers marked here should be the ones before renumbering---those that
-GNU CC would ordinarily allocate. The registers which will actually be
-used in the assembler code, after renumbering, should not be marked with 1
-in this vector.
-
-Define this macro only if the target machine offers a way to optimize
-the treatment of leaf functions.
-
-@findex LEAF_REG_REMAP
-@item LEAF_REG_REMAP (@var{regno})
-A C expression whose value is the register number to which @var{regno}
-should be renumbered, when a function is treated as a leaf function.
-
-If @var{regno} is a register number which should not appear in a leaf
-function before renumbering, then the expression should yield -1, which
-will cause the compiler to abort.
-
-Define this macro only if the target machine offers a way to optimize the
-treatment of leaf functions, and registers need to be renumbered to do
-this.
-@end table
-
-@findex current_function_is_leaf
-@findex current_function_uses_only_leaf_regs
-Normally, @code{FUNCTION_PROLOGUE} and @code{FUNCTION_EPILOGUE} must
-treat leaf functions specially. They can test the C variable
-@code{current_function_is_leaf} which is nonzero for leaf functions.
-@code{current_function_is_leaf} is set prior to local register allocation
-and is valid for the remaining compiler passes. They can also test the C
-variable @code{current_function_uses_only_leaf_regs} which is nonzero for
-leaf functions which only use leaf registers.
-@code{current_function_uses_only_leaf_regs} is valid after reload and is
-only useful if @code{LEAF_REGISTERS} is defined.
-@c changed this to fix overfull. ALSO: why the "it" at the beginning
-@c of the next paragraph?! --mew 2feb93
-
-@node Stack Registers
-@subsection Registers That Form a Stack
-
-There are special features to handle computers where some of the
-``registers'' form a stack, as in the 80387 coprocessor for the 80386.
-Stack registers are normally written by pushing onto the stack, and are
-numbered relative to the top of the stack.
-
-Currently, GNU CC can only handle one group of stack-like registers, and
-they must be consecutively numbered.
-
-@table @code
-@findex STACK_REGS
-@item STACK_REGS
-Define this if the machine has any stack-like registers.
-
-@findex FIRST_STACK_REG
-@item FIRST_STACK_REG
-The number of the first stack-like register. This one is the top
-of the stack.
-
-@findex LAST_STACK_REG
-@item LAST_STACK_REG
-The number of the last stack-like register. This one is the bottom of
-the stack.
-@end table
-
-@node Obsolete Register Macros
-@subsection Obsolete Macros for Controlling Register Usage
-
-These features do not work very well. They exist because they used to
-be required to generate correct code for the 80387 coprocessor of the
-80386. They are no longer used by that machine description and may be
-removed in a later version of the compiler. Don't use them!
-
-@table @code
-@findex OVERLAPPING_REGNO_P
-@item OVERLAPPING_REGNO_P (@var{regno})
-If defined, this is a C expression whose value is nonzero if hard
-register number @var{regno} is an overlapping register. This means a
-hard register which overlaps a hard register with a different number.
-(Such overlap is undesirable, but occasionally it allows a machine to
-be supported which otherwise could not be.) This macro must return
-nonzero for @emph{all} the registers which overlap each other. GNU CC
-can use an overlapping register only in certain limited ways. It can
-be used for allocation within a basic block, and may be spilled for
-reloading; that is all.
-
-If this macro is not defined, it means that none of the hard registers
-overlap each other. This is the usual situation.
-
-@findex INSN_CLOBBERS_REGNO_P
-@item INSN_CLOBBERS_REGNO_P (@var{insn}, @var{regno})
-If defined, this is a C expression whose value should be nonzero if
-the insn @var{insn} has the effect of mysteriously clobbering the
-contents of hard register number @var{regno}. By ``mysterious'' we
-mean that the insn's RTL expression doesn't describe such an effect.
-
-If this macro is not defined, it means that no insn clobbers registers
-mysteriously. This is the usual situation; all else being equal,
-it is best for the RTL expression to show all the activity.
-
-@end table
-
-@node Register Classes
-@section Register Classes
-@cindex register class definitions
-@cindex class definitions, register
-
-On many machines, the numbered registers are not all equivalent.
-For example, certain registers may not be allowed for indexed addressing;
-certain registers may not be allowed in some instructions. These machine
-restrictions are described to the compiler using @dfn{register classes}.
-
-You define a number of register classes, giving each one a name and saying
-which of the registers belong to it. Then you can specify register classes
-that are allowed as operands to particular instruction patterns.
-
-@findex ALL_REGS
-@findex NO_REGS
-In general, each register will belong to several classes. In fact, one
-class must be named @code{ALL_REGS} and contain all the registers. Another
-class must be named @code{NO_REGS} and contain no registers. Often the
-union of two classes will be another class; however, this is not required.
-
-@findex GENERAL_REGS
-One of the classes must be named @code{GENERAL_REGS}. There is nothing
-terribly special about the name, but the operand constraint letters
-@samp{r} and @samp{g} specify this class. If @code{GENERAL_REGS} is
-the same as @code{ALL_REGS}, just define it as a macro which expands
-to @code{ALL_REGS}.
-
-Order the classes so that if class @var{x} is contained in class @var{y}
-then @var{x} has a lower class number than @var{y}.
-
-The way classes other than @code{GENERAL_REGS} are specified in operand
-constraints is through machine-dependent operand constraint letters.
-You can define such letters to correspond to various classes, then use
-them in operand constraints.
-
-You should define a class for the union of two classes whenever some
-instruction allows both classes. For example, if an instruction allows
-either a floating point (coprocessor) register or a general register for a
-certain operand, you should define a class @code{FLOAT_OR_GENERAL_REGS}
-which includes both of them. Otherwise you will get suboptimal code.
-
-You must also specify certain redundant information about the register
-classes: for each class, which classes contain it and which ones are
-contained in it; for each pair of classes, the largest class contained
-in their union.
-
-When a value occupying several consecutive registers is expected in a
-certain class, all the registers used must belong to that class.
-Therefore, register classes cannot be used to enforce a requirement for
-a register pair to start with an even-numbered register. The way to
-specify this requirement is with @code{HARD_REGNO_MODE_OK}.
-
-Register classes used for input-operands of bitwise-and or shift
-instructions have a special requirement: each such class must have, for
-each fixed-point machine mode, a subclass whose registers can transfer that
-mode to or from memory. For example, on some machines, the operations for
-single-byte values (@code{QImode}) are limited to certain registers. When
-this is so, each register class that is used in a bitwise-and or shift
-instruction must have a subclass consisting of registers from which
-single-byte values can be loaded or stored. This is so that
-@code{PREFERRED_RELOAD_CLASS} can always have a possible value to return.
-
-@table @code
-@findex enum reg_class
-@item enum reg_class
-An enumeral type that must be defined with all the register class names
-as enumeral values. @code{NO_REGS} must be first. @code{ALL_REGS}
-must be the last register class, followed by one more enumeral value,
-@code{LIM_REG_CLASSES}, which is not a register class but rather
-tells how many classes there are.
-
-Each register class has a number, which is the value of casting
-the class name to type @code{int}. The number serves as an index
-in many of the tables described below.
-
-@findex N_REG_CLASSES
-@item N_REG_CLASSES
-The number of distinct register classes, defined as follows:
-
-@example
-#define N_REG_CLASSES (int) LIM_REG_CLASSES
-@end example
-
-@findex REG_CLASS_NAMES
-@item REG_CLASS_NAMES
-An initializer containing the names of the register classes as C string
-constants. These names are used in writing some of the debugging dumps.
-
-@findex REG_CLASS_CONTENTS
-@item REG_CLASS_CONTENTS
-An initializer containing the contents of the register classes, as integers
-which are bit masks. The @var{n}th integer specifies the contents of class
-@var{n}. The way the integer @var{mask} is interpreted is that
-register @var{r} is in the class if @code{@var{mask} & (1 << @var{r})} is 1.
-
-When the machine has more than 32 registers, an integer does not suffice.
-Then the integers are replaced by sub-initializers, braced groupings containing
-several integers. Each sub-initializer must be suitable as an initializer
-for the type @code{HARD_REG_SET} which is defined in @file{hard-reg-set.h}.
-
-@findex REGNO_REG_CLASS
-@item REGNO_REG_CLASS (@var{regno})
-A C expression whose value is a register class containing hard register
-@var{regno}. In general there is more than one such class; choose a class
-which is @dfn{minimal}, meaning that no smaller class also contains the
-register.
-
-@findex BASE_REG_CLASS
-@item BASE_REG_CLASS
-A macro whose definition is the name of the class to which a valid
-base register must belong. A base register is one used in an address
-which is the register value plus a displacement.
-
-@findex INDEX_REG_CLASS
-@item INDEX_REG_CLASS
-A macro whose definition is the name of the class to which a valid
-index register must belong. An index register is one used in an
-address where its value is either multiplied by a scale factor or
-added to another register (as well as added to a displacement).
-
-@findex REG_CLASS_FROM_LETTER
-@item REG_CLASS_FROM_LETTER (@var{char})
-A C expression which defines the machine-dependent operand constraint
-letters for register classes. If @var{char} is such a letter, the
-value should be the register class corresponding to it. Otherwise,
-the value should be @code{NO_REGS}. The register letter @samp{r},
-corresponding to class @code{GENERAL_REGS}, will not be passed
-to this macro; you do not need to handle it.
-
-@findex REGNO_OK_FOR_BASE_P
-@item REGNO_OK_FOR_BASE_P (@var{num})
-A C expression which is nonzero if register number @var{num} is
-suitable for use as a base register in operand addresses. It may be
-either a suitable hard register or a pseudo register that has been
-allocated such a hard register.
-
-@findex REGNO_MODE_OK_FOR_BASE_P
-@item REGNO_MODE_OK_FOR_BASE_P (@var{num}, @var{mode})
-A C expression that is just like @code{REGNO_OK_FOR_BASE_P}, except that
-that expression may examine the mode of the memory reference in
-@var{mode}. You should define this macro if the mode of the memory
-reference affects whether a register may be used as a base register. If
-you define this macro, the compiler will use it instead of
-@code{REGNO_OK_FOR_BASE_P}.
-
-@findex REGNO_OK_FOR_INDEX_P
-@item REGNO_OK_FOR_INDEX_P (@var{num})
-A C expression which is nonzero if register number @var{num} is
-suitable for use as an index register in operand addresses. It may be
-either a suitable hard register or a pseudo register that has been
-allocated such a hard register.
-
-The difference between an index register and a base register is that
-the index register may be scaled. If an address involves the sum of
-two registers, neither one of them scaled, then either one may be
-labeled the ``base'' and the other the ``index''; but whichever
-labeling is used must fit the machine's constraints of which registers
-may serve in each capacity. The compiler will try both labelings,
-looking for one that is valid, and will reload one or both registers
-only if neither labeling works.
-
-@findex PREFERRED_RELOAD_CLASS
-@item PREFERRED_RELOAD_CLASS (@var{x}, @var{class})
-A C expression that places additional restrictions on the register class
-to use when it is necessary to copy value @var{x} into a register in class
-@var{class}. The value is a register class; perhaps @var{class}, or perhaps
-another, smaller class. On many machines, the following definition is
-safe:
-
-@example
-#define PREFERRED_RELOAD_CLASS(X,CLASS) CLASS
-@end example
-
-Sometimes returning a more restrictive class makes better code. For
-example, on the 68000, when @var{x} is an integer constant that is in range
-for a @samp{moveq} instruction, the value of this macro is always
-@code{DATA_REGS} as long as @var{class} includes the data registers.
-Requiring a data register guarantees that a @samp{moveq} will be used.
-
-If @var{x} is a @code{const_double}, by returning @code{NO_REGS}
-you can force @var{x} into a memory constant. This is useful on
-certain machines where immediate floating values cannot be loaded into
-certain kinds of registers.
-
-@findex PREFERRED_OUTPUT_RELOAD_CLASS
-@item PREFERRED_OUTPUT_RELOAD_CLASS (@var{x}, @var{class})
-Like @code{PREFERRED_RELOAD_CLASS}, but for output reloads instead of
-input reloads. If you don't define this macro, the default is to use
-@var{class}, unchanged.
-
-@findex LIMIT_RELOAD_CLASS
-@item LIMIT_RELOAD_CLASS (@var{mode}, @var{class})
-A C expression that places additional restrictions on the register class
-to use when it is necessary to be able to hold a value of mode
-@var{mode} in a reload register for which class @var{class} would
-ordinarily be used.
-
-Unlike @code{PREFERRED_RELOAD_CLASS}, this macro should be used when
-there are certain modes that simply can't go in certain reload classes.
-
-The value is a register class; perhaps @var{class}, or perhaps another,
-smaller class.
-
-Don't define this macro unless the target machine has limitations which
-require the macro to do something nontrivial.
-
-@findex SECONDARY_RELOAD_CLASS
-@findex SECONDARY_INPUT_RELOAD_CLASS
-@findex SECONDARY_OUTPUT_RELOAD_CLASS
-@item SECONDARY_RELOAD_CLASS (@var{class}, @var{mode}, @var{x})
-@itemx SECONDARY_INPUT_RELOAD_CLASS (@var{class}, @var{mode}, @var{x})
-@itemx SECONDARY_OUTPUT_RELOAD_CLASS (@var{class}, @var{mode}, @var{x})
-Many machines have some registers that cannot be copied directly to or
-from memory or even from other types of registers. An example is the
-@samp{MQ} register, which on most machines, can only be copied to or
-from general registers, but not memory. Some machines allow copying all
-registers to and from memory, but require a scratch register for stores
-to some memory locations (e.g., those with symbolic address on the RT,
-and those with certain symbolic address on the Sparc when compiling
-PIC). In some cases, both an intermediate and a scratch register are
-required.
-
-You should define these macros to indicate to the reload phase that it may
-need to allocate at least one register for a reload in addition to the
-register to contain the data. Specifically, if copying @var{x} to a
-register @var{class} in @var{mode} requires an intermediate register,
-you should define @code{SECONDARY_INPUT_RELOAD_CLASS} to return the
-largest register class all of whose registers can be used as
-intermediate registers or scratch registers.
-
-If copying a register @var{class} in @var{mode} to @var{x} requires an
-intermediate or scratch register, @code{SECONDARY_OUTPUT_RELOAD_CLASS}
-should be defined to return the largest register class required. If the
-requirements for input and output reloads are the same, the macro
-@code{SECONDARY_RELOAD_CLASS} should be used instead of defining both
-macros identically.
-
-The values returned by these macros are often @code{GENERAL_REGS}.
-Return @code{NO_REGS} if no spare register is needed; i.e., if @var{x}
-can be directly copied to or from a register of @var{class} in
-@var{mode} without requiring a scratch register. Do not define this
-macro if it would always return @code{NO_REGS}.
-
-If a scratch register is required (either with or without an
-intermediate register), you should define patterns for
-@samp{reload_in@var{m}} or @samp{reload_out@var{m}}, as required
-(@pxref{Standard Names}. These patterns, which will normally be
-implemented with a @code{define_expand}, should be similar to the
-@samp{mov@var{m}} patterns, except that operand 2 is the scratch
-register.
-
-Define constraints for the reload register and scratch register that
-contain a single register class. If the original reload register (whose
-class is @var{class}) can meet the constraint given in the pattern, the
-value returned by these macros is used for the class of the scratch
-register. Otherwise, two additional reload registers are required.
-Their classes are obtained from the constraints in the insn pattern.
-
-@var{x} might be a pseudo-register or a @code{subreg} of a
-pseudo-register, which could either be in a hard register or in memory.
-Use @code{true_regnum} to find out; it will return -1 if the pseudo is
-in memory and the hard register number if it is in a register.
-
-These macros should not be used in the case where a particular class of
-registers can only be copied to memory and not to another class of
-registers. In that case, secondary reload registers are not needed and
-would not be helpful. Instead, a stack location must be used to perform
-the copy and the @code{mov@var{m}} pattern should use memory as a
-intermediate storage. This case often occurs between floating-point and
-general registers.
-
-@findex SECONDARY_MEMORY_NEEDED
-@item SECONDARY_MEMORY_NEEDED (@var{class1}, @var{class2}, @var{m})
-Certain machines have the property that some registers cannot be copied
-to some other registers without using memory. Define this macro on
-those machines to be a C expression that is non-zero if objects of mode
-@var{m} in registers of @var{class1} can only be copied to registers of
-class @var{class2} by storing a register of @var{class1} into memory
-and loading that memory location into a register of @var{class2}.
-
-Do not define this macro if its value would always be zero.
-
-@findex SECONDARY_MEMORY_NEEDED_RTX
-@item SECONDARY_MEMORY_NEEDED_RTX (@var{mode})
-Normally when @code{SECONDARY_MEMORY_NEEDED} is defined, the compiler
-allocates a stack slot for a memory location needed for register copies.
-If this macro is defined, the compiler instead uses the memory location
-defined by this macro.
-
-Do not define this macro if you do not define
-@code{SECONDARY_MEMORY_NEEDED}.
-
-@findex SECONDARY_MEMORY_NEEDED_MODE
-@item SECONDARY_MEMORY_NEEDED_MODE (@var{mode})
-When the compiler needs a secondary memory location to copy between two
-registers of mode @var{mode}, it normally allocates sufficient memory to
-hold a quantity of @code{BITS_PER_WORD} bits and performs the store and
-load operations in a mode that many bits wide and whose class is the
-same as that of @var{mode}.
-
-This is right thing to do on most machines because it ensures that all
-bits of the register are copied and prevents accesses to the registers
-in a narrower mode, which some machines prohibit for floating-point
-registers.
-
-However, this default behavior is not correct on some machines, such as
-the DEC Alpha, that store short integers in floating-point registers
-differently than in integer registers. On those machines, the default
-widening will not work correctly and you must define this macro to
-suppress that widening in some cases. See the file @file{alpha.h} for
-details.
-
-Do not define this macro if you do not define
-@code{SECONDARY_MEMORY_NEEDED} or if widening @var{mode} to a mode that
-is @code{BITS_PER_WORD} bits wide is correct for your machine.
-
-@findex SMALL_REGISTER_CLASSES
-@item SMALL_REGISTER_CLASSES
-On some machines, it is risky to let hard registers live across arbitrary
-insns. Typically, these machines have instructions that require values
-to be in specific registers (like an accumulator), and reload will fail
-if the required hard register is used for another purpose across such an
-insn.
-
-Define @code{SMALL_REGISTER_CLASSES} to be an expression with a non-zero
-value on these machines. When this macro has a non-zero value, the
-compiler will try to minimize the lifetime of hard registers.
-
-It is always safe to define this macro with a non-zero value, but if you
-unnecessarily define it, you will reduce the amount of optimizations
-that can be performed in some cases. If you do not define this macro
-with a non-zero value when it is required, the compiler will run out of
-spill registers and print a fatal error message. For most machines, you
-should not define this macro at all.
-
-@findex CLASS_LIKELY_SPILLED_P
-@item CLASS_LIKELY_SPILLED_P (@var{class})
-A C expression whose value is nonzero if pseudos that have been assigned
-to registers of class @var{class} would likely be spilled because
-registers of @var{class} are needed for spill registers.
-
-The default value of this macro returns 1 if @var{class} has exactly one
-register and zero otherwise. On most machines, this default should be
-used. Only define this macro to some other expression if pseudos
-allocated by @file{local-alloc.c} end up in memory because their hard
-registers were needed for spill registers. If this macro returns nonzero
-for those classes, those pseudos will only be allocated by
-@file{global.c}, which knows how to reallocate the pseudo to another
-register. If there would not be another register available for
-reallocation, you should not change the definition of this macro since
-the only effect of such a definition would be to slow down register
-allocation.
-
-@findex CLASS_MAX_NREGS
-@item CLASS_MAX_NREGS (@var{class}, @var{mode})
-A C expression for the maximum number of consecutive registers
-of class @var{class} needed to hold a value of mode @var{mode}.
-
-This is closely related to the macro @code{HARD_REGNO_NREGS}. In fact,
-the value of the macro @code{CLASS_MAX_NREGS (@var{class}, @var{mode})}
-should be the maximum value of @code{HARD_REGNO_NREGS (@var{regno},
-@var{mode})} for all @var{regno} values in the class @var{class}.
-
-This macro helps control the handling of multiple-word values
-in the reload pass.
-
-@item CLASS_CANNOT_CHANGE_SIZE
-If defined, a C expression for a class that contains registers which the
-compiler must always access in a mode that is the same size as the mode
-in which it loaded the register.
-
-For the example, loading 32-bit integer or floating-point objects into
-floating-point registers on the Alpha extends them to 64-bits.
-Therefore loading a 64-bit object and then storing it as a 32-bit object
-does not store the low-order 32-bits, as would be the case for a normal
-register. Therefore, @file{alpha.h} defines this macro as
-@code{FLOAT_REGS}.
-@end table
-
-Three other special macros describe which operands fit which constraint
-letters.
-
-@table @code
-@findex CONST_OK_FOR_LETTER_P
-@item CONST_OK_FOR_LETTER_P (@var{value}, @var{c})
-A C expression that defines the machine-dependent operand constraint
-letters (@samp{I}, @samp{J}, @samp{K}, @dots{} @samp{P}) that specify
-particular ranges of integer values. If @var{c} is one of those
-letters, the expression should check that @var{value}, an integer, is in
-the appropriate range and return 1 if so, 0 otherwise. If @var{c} is
-not one of those letters, the value should be 0 regardless of
-@var{value}.
-
-@findex CONST_DOUBLE_OK_FOR_LETTER_P
-@item CONST_DOUBLE_OK_FOR_LETTER_P (@var{value}, @var{c})
-A C expression that defines the machine-dependent operand constraint
-letters that specify particular ranges of @code{const_double} values
-(@samp{G} or @samp{H}).
-
-If @var{c} is one of those letters, the expression should check that
-@var{value}, an RTX of code @code{const_double}, is in the appropriate
-range and return 1 if so, 0 otherwise. If @var{c} is not one of those
-letters, the value should be 0 regardless of @var{value}.
-
-@code{const_double} is used for all floating-point constants and for
-@code{DImode} fixed-point constants. A given letter can accept either
-or both kinds of values. It can use @code{GET_MODE} to distinguish
-between these kinds.
-
-@findex EXTRA_CONSTRAINT
-@item EXTRA_CONSTRAINT (@var{value}, @var{c})
-A C expression that defines the optional machine-dependent constraint
-letters (@samp{Q}, @samp{R}, @samp{S}, @samp{T}, @samp{U}) that can
-be used to segregate specific types of operands, usually memory
-references, for the target machine. Normally this macro will not be
-defined. If it is required for a particular target machine, it should
-return 1 if @var{value} corresponds to the operand type represented by
-the constraint letter @var{c}. If @var{c} is not defined as an extra
-constraint, the value returned should be 0 regardless of @var{value}.
-
-For example, on the ROMP, load instructions cannot have their output in r0 if
-the memory reference contains a symbolic address. Constraint letter
-@samp{Q} is defined as representing a memory address that does
-@emph{not} contain a symbolic address. An alternative is specified with
-a @samp{Q} constraint on the input and @samp{r} on the output. The next
-alternative specifies @samp{m} on the input and a register class that
-does not include r0 on the output.
-@end table
-
-@node Stack and Calling
-@section Stack Layout and Calling Conventions
-@cindex calling conventions
-
-@c prevent bad page break with this line
-This describes the stack layout and calling conventions.
-
-@menu
-* Frame Layout::
-* Stack Checking::
-* Frame Registers::
-* Elimination::
-* Stack Arguments::
-* Register Arguments::
-* Scalar Return::
-* Aggregate Return::
-* Caller Saves::
-* Function Entry::
-* Profiling::
-@end menu
-
-@node Frame Layout
-@subsection Basic Stack Layout
-@cindex stack frame layout
-@cindex frame layout
-
-@c prevent bad page break with this line
-Here is the basic stack layout.
-
-@table @code
-@findex STACK_GROWS_DOWNWARD
-@item STACK_GROWS_DOWNWARD
-Define this macro if pushing a word onto the stack moves the stack
-pointer to a smaller address.
-
-When we say, ``define this macro if @dots{},'' it means that the
-compiler checks this macro only with @code{#ifdef} so the precise
-definition used does not matter.
-
-@findex FRAME_GROWS_DOWNWARD
-@item FRAME_GROWS_DOWNWARD
-Define this macro if the addresses of local variable slots are at negative
-offsets from the frame pointer.
-
-@findex ARGS_GROW_DOWNWARD
-@item ARGS_GROW_DOWNWARD
-Define this macro if successive arguments to a function occupy decreasing
-addresses on the stack.
-
-@findex STARTING_FRAME_OFFSET
-@item STARTING_FRAME_OFFSET
-Offset from the frame pointer to the first local variable slot to be allocated.
-
-If @code{FRAME_GROWS_DOWNWARD}, find the next slot's offset by
-subtracting the first slot's length from @code{STARTING_FRAME_OFFSET}.
-Otherwise, it is found by adding the length of the first slot to the
-value @code{STARTING_FRAME_OFFSET}.
-@c i'm not sure if the above is still correct.. had to change it to get
-@c rid of an overfull. --mew 2feb93
-
-@findex STACK_POINTER_OFFSET
-@item STACK_POINTER_OFFSET
-Offset from the stack pointer register to the first location at which
-outgoing arguments are placed. If not specified, the default value of
-zero is used. This is the proper value for most machines.
-
-If @code{ARGS_GROW_DOWNWARD}, this is the offset to the location above
-the first location at which outgoing arguments are placed.
-
-@findex FIRST_PARM_OFFSET
-@item FIRST_PARM_OFFSET (@var{fundecl})
-Offset from the argument pointer register to the first argument's
-address. On some machines it may depend on the data type of the
-function.
-
-If @code{ARGS_GROW_DOWNWARD}, this is the offset to the location above
-the first argument's address.
-
-@findex STACK_DYNAMIC_OFFSET
-@item STACK_DYNAMIC_OFFSET (@var{fundecl})
-Offset from the stack pointer register to an item dynamically allocated
-on the stack, e.g., by @code{alloca}.
-
-The default value for this macro is @code{STACK_POINTER_OFFSET} plus the
-length of the outgoing arguments. The default is correct for most
-machines. See @file{function.c} for details.
-
-@findex DYNAMIC_CHAIN_ADDRESS
-@item DYNAMIC_CHAIN_ADDRESS (@var{frameaddr})
-A C expression whose value is RTL representing the address in a stack
-frame where the pointer to the caller's frame is stored. Assume that
-@var{frameaddr} is an RTL expression for the address of the stack frame
-itself.
-
-If you don't define this macro, the default is to return the value
-of @var{frameaddr}---that is, the stack frame address is also the
-address of the stack word that points to the previous frame.
-
-@findex SETUP_FRAME_ADDRESSES
-@item SETUP_FRAME_ADDRESSES
-If defined, a C expression that produces the machine-specific code to
-setup the stack so that arbitrary frames can be accessed. For example,
-on the Sparc, we must flush all of the register windows to the stack
-before we can access arbitrary stack frames. You will seldom need to
-define this macro.
-
-@findex BUILTIN_SETJMP_FRAME_VALUE
-@item BUILTIN_SETJMP_FRAME_VALUE
-If defined, a C expression that contains an rtx that is used to store
-the address of the current frame into the built in @code{setjmp} buffer.
-The default value, @code{virtual_stack_vars_rtx}, is correct for most
-machines. One reason you may need to define this macro is if
-@code{hard_frame_pointer_rtx} is the appropriate value on your machine.
-
-@findex RETURN_ADDR_RTX
-@item RETURN_ADDR_RTX (@var{count}, @var{frameaddr})
-A C expression whose value is RTL representing the value of the return
-address for the frame @var{count} steps up from the current frame, after
-the prologue. @var{frameaddr} is the frame pointer of the @var{count}
-frame, or the frame pointer of the @var{count} @minus{} 1 frame if
-@code{RETURN_ADDR_IN_PREVIOUS_FRAME} is defined.
-
-The value of the expression must always be the correct address when
-@var{count} is zero, but may be @code{NULL_RTX} if there is not way to
-determine the return address of other frames.
-
-@findex RETURN_ADDR_IN_PREVIOUS_FRAME
-@item RETURN_ADDR_IN_PREVIOUS_FRAME
-Define this if the return address of a particular stack frame is accessed
-from the frame pointer of the previous stack frame.
-
-@findex INCOMING_RETURN_ADDR_RTX
-@item INCOMING_RETURN_ADDR_RTX
-A C expression whose value is RTL representing the location of the
-incoming return address at the beginning of any function, before the
-prologue. This RTL is either a @code{REG}, indicating that the return
-value is saved in @samp{REG}, or a @code{MEM} representing a location in
-the stack.
-
-You only need to define this macro if you want to support call frame
-debugging information like that provided by DWARF 2.
-
-@findex INCOMING_FRAME_SP_OFFSET
-@item INCOMING_FRAME_SP_OFFSET
-A C expression whose value is an integer giving the offset, in bytes,
-from the value of the stack pointer register to the top of the stack
-frame at the beginning of any function, before the prologue. The top of
-the frame is defined to be the value of the stack pointer in the
-previous frame, just before the call instruction.
-
-You only need to define this macro if you want to support call frame
-debugging information like that provided by DWARF 2.
-
-@findex ARG_POINTER_CFA_OFFSET
-@item ARG_POINTER_CFA_OFFSET
-A C expression whose value is an integer giving the offset, in bytes,
-from the argument pointer to the canonical frame address (cfa). The
-final value should coincide with that calculated by
-@code{INCOMING_FRAME_SP_OFFSET}. Which is unfortunately not usable
-during virtual register instantiation.
-
-You only need to define this macro if you want to support call frame
-debugging information like that provided by DWARF 2.
-@end table
-
-@node Stack Checking
-@subsection Specifying How Stack Checking is Done
-
-GNU CC will check that stack references are within the boundaries of
-the stack, if the @samp{-fstack-check} is specified, in one of three ways:
-
-@enumerate
-@item
-If the value of the @code{STACK_CHECK_BUILTIN} macro is nonzero, GNU CC
-will assume that you have arranged for stack checking to be done at
-appropriate places in the configuration files, e.g., in
-@code{FUNCTION_PROLOGUE}. GNU CC will do not other special processing.
-
-@item
-If @code{STACK_CHECK_BUILTIN} is zero and you defined a named pattern
-called @code{check_stack} in your @file{md} file, GNU CC will call that
-pattern with one argument which is the address to compare the stack
-value against. You must arrange for this pattern to report an error if
-the stack pointer is out of range.
-
-@item
-If neither of the above are true, GNU CC will generate code to periodically
-``probe'' the stack pointer using the values of the macros defined below.
-@end enumerate
-
-Normally, you will use the default values of these macros, so GNU CC
-will use the third approach.
-
-@table @code
-@findex STACK_CHECK_BUILTIN
-@item STACK_CHECK_BUILTIN
-A nonzero value if stack checking is done by the configuration files in a
-machine-dependent manner. You should define this macro if stack checking
-is require by the ABI of your machine or if you would like to have to stack
-checking in some more efficient way than GNU CC's portable approach.
-The default value of this macro is zero.
-
-@findex STACK_CHECK_PROBE_INTERVAL
-@item STACK_CHECK_PROBE_INTERVAL
-An integer representing the interval at which GNU CC must generate stack
-probe instructions. You will normally define this macro to be no larger
-than the size of the ``guard pages'' at the end of a stack area. The
-default value of 4096 is suitable for most systems.
-
-@findex STACK_CHECK_PROBE_LOAD
-@item STACK_CHECK_PROBE_LOAD
-A integer which is nonzero if GNU CC should perform the stack probe
-as a load instruction and zero if GNU CC should use a store instruction.
-The default is zero, which is the most efficient choice on most systems.
-
-@findex STACK_CHECK_PROTECT
-@item STACK_CHECK_PROTECT
-The number of bytes of stack needed to recover from a stack overflow,
-for languages where such a recovery is supported. The default value of
-75 words should be adequate for most machines.
-
-@findex STACK_CHECK_MAX_FRAME_SIZE
-@item STACK_CHECK_MAX_FRAME_SIZE
-The maximum size of a stack frame, in bytes. GNU CC will generate probe
-instructions in non-leaf functions to ensure at least this many bytes of
-stack are available. If a stack frame is larger than this size, stack
-checking will not be reliable and GNU CC will issue a warning. The
-default is chosen so that GNU CC only generates one instruction on most
-systems. You should normally not change the default value of this macro.
-
-@findex STACK_CHECK_FIXED_FRAME_SIZE
-@item STACK_CHECK_FIXED_FRAME_SIZE
-GNU CC uses this value to generate the above warning message. It
-represents the amount of fixed frame used by a function, not including
-space for any callee-saved registers, temporaries and user variables.
-You need only specify an upper bound for this amount and will normally
-use the default of four words.
-
-@findex STACK_CHECK_MAX_VAR_SIZE
-@item STACK_CHECK_MAX_VAR_SIZE
-The maximum size, in bytes, of an object that GNU CC will place in the
-fixed area of the stack frame when the user specifies
-@samp{-fstack-check}.
-GNU CC computed the default from the values of the above macros and you will
-normally not need to override that default.
-@end table
-
-@need 2000
-@node Frame Registers
-@subsection Registers That Address the Stack Frame
-
-@c prevent bad page break with this line
-This discusses registers that address the stack frame.
-
-@table @code
-@findex STACK_POINTER_REGNUM
-@item STACK_POINTER_REGNUM
-The register number of the stack pointer register, which must also be a
-fixed register according to @code{FIXED_REGISTERS}. On most machines,
-the hardware determines which register this is.
-
-@findex FRAME_POINTER_REGNUM
-@item FRAME_POINTER_REGNUM
-The register number of the frame pointer register, which is used to
-access automatic variables in the stack frame. On some machines, the
-hardware determines which register this is. On other machines, you can
-choose any register you wish for this purpose.
-
-@findex HARD_FRAME_POINTER_REGNUM
-@item HARD_FRAME_POINTER_REGNUM
-On some machines the offset between the frame pointer and starting
-offset of the automatic variables is not known until after register
-allocation has been done (for example, because the saved registers are
-between these two locations). On those machines, define
-@code{FRAME_POINTER_REGNUM} the number of a special, fixed register to
-be used internally until the offset is known, and define
-@code{HARD_FRAME_POINTER_REGNUM} to be the actual hard register number
-used for the frame pointer.
-
-You should define this macro only in the very rare circumstances when it
-is not possible to calculate the offset between the frame pointer and
-the automatic variables until after register allocation has been
-completed. When this macro is defined, you must also indicate in your
-definition of @code{ELIMINABLE_REGS} how to eliminate
-@code{FRAME_POINTER_REGNUM} into either @code{HARD_FRAME_POINTER_REGNUM}
-or @code{STACK_POINTER_REGNUM}.
-
-Do not define this macro if it would be the same as
-@code{FRAME_POINTER_REGNUM}.
-
-@findex ARG_POINTER_REGNUM
-@item ARG_POINTER_REGNUM
-The register number of the arg pointer register, which is used to access
-the function's argument list. On some machines, this is the same as the
-frame pointer register. On some machines, the hardware determines which
-register this is. On other machines, you can choose any register you
-wish for this purpose. If this is not the same register as the frame
-pointer register, then you must mark it as a fixed register according to
-@code{FIXED_REGISTERS}, or arrange to be able to eliminate it
-(@pxref{Elimination}).
-
-@findex RETURN_ADDRESS_POINTER_REGNUM
-@item RETURN_ADDRESS_POINTER_REGNUM
-The register number of the return address pointer register, which is used to
-access the current function's return address from the stack. On some
-machines, the return address is not at a fixed offset from the frame
-pointer or stack pointer or argument pointer. This register can be defined
-to point to the return address on the stack, and then be converted by
-@code{ELIMINABLE_REGS} into either the frame pointer or stack pointer.
-
-Do not define this macro unless there is no other way to get the return
-address from the stack.
-
-@findex STATIC_CHAIN_REGNUM
-@findex STATIC_CHAIN_INCOMING_REGNUM
-@item STATIC_CHAIN_REGNUM
-@itemx STATIC_CHAIN_INCOMING_REGNUM
-Register numbers used for passing a function's static chain pointer. If
-register windows are used, the register number as seen by the called
-function is @code{STATIC_CHAIN_INCOMING_REGNUM}, while the register
-number as seen by the calling function is @code{STATIC_CHAIN_REGNUM}. If
-these registers are the same, @code{STATIC_CHAIN_INCOMING_REGNUM} need
-not be defined.@refill
-
-The static chain register need not be a fixed register.
-
-If the static chain is passed in memory, these macros should not be
-defined; instead, the next two macros should be defined.
-
-@findex STATIC_CHAIN
-@findex STATIC_CHAIN_INCOMING
-@item STATIC_CHAIN
-@itemx STATIC_CHAIN_INCOMING
-If the static chain is passed in memory, these macros provide rtx giving
-@code{mem} expressions that denote where they are stored.
-@code{STATIC_CHAIN} and @code{STATIC_CHAIN_INCOMING} give the locations
-as seen by the calling and called functions, respectively. Often the former
-will be at an offset from the stack pointer and the latter at an offset from
-the frame pointer.@refill
-
-@findex stack_pointer_rtx
-@findex frame_pointer_rtx
-@findex arg_pointer_rtx
-The variables @code{stack_pointer_rtx}, @code{frame_pointer_rtx}, and
-@code{arg_pointer_rtx} will have been initialized prior to the use of these
-macros and should be used to refer to those items.
-
-If the static chain is passed in a register, the two previous macros should
-be defined instead.
-@end table
-
-@node Elimination
-@subsection Eliminating Frame Pointer and Arg Pointer
-
-@c prevent bad page break with this line
-This is about eliminating the frame pointer and arg pointer.
-
-@table @code
-@findex FRAME_POINTER_REQUIRED
-@item FRAME_POINTER_REQUIRED
-A C expression which is nonzero if a function must have and use a frame
-pointer. This expression is evaluated in the reload pass. If its value is
-nonzero the function will have a frame pointer.
-
-The expression can in principle examine the current function and decide
-according to the facts, but on most machines the constant 0 or the
-constant 1 suffices. Use 0 when the machine allows code to be generated
-with no frame pointer, and doing so saves some time or space. Use 1
-when there is no possible advantage to avoiding a frame pointer.
-
-In certain cases, the compiler does not know how to produce valid code
-without a frame pointer. The compiler recognizes those cases and
-automatically gives the function a frame pointer regardless of what
-@code{FRAME_POINTER_REQUIRED} says. You don't need to worry about
-them.@refill
-
-In a function that does not require a frame pointer, the frame pointer
-register can be allocated for ordinary usage, unless you mark it as a
-fixed register. See @code{FIXED_REGISTERS} for more information.
-
-@findex INITIAL_FRAME_POINTER_OFFSET
-@findex get_frame_size
-@item INITIAL_FRAME_POINTER_OFFSET (@var{depth-var})
-A C statement to store in the variable @var{depth-var} the difference
-between the frame pointer and the stack pointer values immediately after
-the function prologue. The value would be computed from information
-such as the result of @code{get_frame_size ()} and the tables of
-registers @code{regs_ever_live} and @code{call_used_regs}.
-
-If @code{ELIMINABLE_REGS} is defined, this macro will be not be used and
-need not be defined. Otherwise, it must be defined even if
-@code{FRAME_POINTER_REQUIRED} is defined to always be true; in that
-case, you may set @var{depth-var} to anything.
-
-@findex ELIMINABLE_REGS
-@item ELIMINABLE_REGS
-If defined, this macro specifies a table of register pairs used to
-eliminate unneeded registers that point into the stack frame. If it is not
-defined, the only elimination attempted by the compiler is to replace
-references to the frame pointer with references to the stack pointer.
-
-The definition of this macro is a list of structure initializations, each
-of which specifies an original and replacement register.
-
-On some machines, the position of the argument pointer is not known until
-the compilation is completed. In such a case, a separate hard register
-must be used for the argument pointer. This register can be eliminated by
-replacing it with either the frame pointer or the argument pointer,
-depending on whether or not the frame pointer has been eliminated.
-
-In this case, you might specify:
-@example
-#define ELIMINABLE_REGS \
-@{@{ARG_POINTER_REGNUM, STACK_POINTER_REGNUM@}, \
- @{ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM@}, \
- @{FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM@}@}
-@end example
-
-Note that the elimination of the argument pointer with the stack pointer is
-specified first since that is the preferred elimination.
-
-@findex CAN_ELIMINATE
-@item CAN_ELIMINATE (@var{from-reg}, @var{to-reg})
-A C expression that returns non-zero if the compiler is allowed to try
-to replace register number @var{from-reg} with register number
-@var{to-reg}. This macro need only be defined if @code{ELIMINABLE_REGS}
-is defined, and will usually be the constant 1, since most of the cases
-preventing register elimination are things that the compiler already
-knows about.
-
-@findex INITIAL_ELIMINATION_OFFSET
-@item INITIAL_ELIMINATION_OFFSET (@var{from-reg}, @var{to-reg}, @var{offset-var})
-This macro is similar to @code{INITIAL_FRAME_POINTER_OFFSET}. It
-specifies the initial difference between the specified pair of
-registers. This macro must be defined if @code{ELIMINABLE_REGS} is
-defined.
-
-@findex LONGJMP_RESTORE_FROM_STACK
-@item LONGJMP_RESTORE_FROM_STACK
-Define this macro if the @code{longjmp} function restores registers from
-the stack frames, rather than from those saved specifically by
-@code{setjmp}. Certain quantities must not be kept in registers across
-a call to @code{setjmp} on such machines.
-@end table
-
-@node Stack Arguments
-@subsection Passing Function Arguments on the Stack
-@cindex arguments on stack
-@cindex stack arguments
-
-The macros in this section control how arguments are passed
-on the stack. See the following section for other macros that
-control passing certain arguments in registers.
-
-@table @code
-@findex PROMOTE_PROTOTYPES
-@item PROMOTE_PROTOTYPES
-Define this macro if an argument declared in a prototype as an
-integral type smaller than @code{int} should actually be passed as an
-@code{int}. In addition to avoiding errors in certain cases of
-mismatch, it also makes for better code on certain machines.
-
-@findex PUSH_ROUNDING
-@item PUSH_ROUNDING (@var{npushed})
-A C expression that is the number of bytes actually pushed onto the
-stack when an instruction attempts to push @var{npushed} bytes.
-
-If the target machine does not have a push instruction, do not define
-this macro. That directs GNU CC to use an alternate strategy: to
-allocate the entire argument block and then store the arguments into
-it.
-
-On some machines, the definition
-
-@example
-#define PUSH_ROUNDING(BYTES) (BYTES)
-@end example
-
-@noindent
-will suffice. But on other machines, instructions that appear
-to push one byte actually push two bytes in an attempt to maintain
-alignment. Then the definition should be
-
-@example
-#define PUSH_ROUNDING(BYTES) (((BYTES) + 1) & ~1)
-@end example
-
-@findex ACCUMULATE_OUTGOING_ARGS
-@findex current_function_outgoing_args_size
-@item ACCUMULATE_OUTGOING_ARGS
-If defined, the maximum amount of space required for outgoing arguments
-will be computed and placed into the variable
-@code{current_function_outgoing_args_size}. No space will be pushed
-onto the stack for each call; instead, the function prologue should
-increase the stack frame size by this amount.
-
-Defining both @code{PUSH_ROUNDING} and @code{ACCUMULATE_OUTGOING_ARGS}
-is not proper.
-
-@findex REG_PARM_STACK_SPACE
-@item REG_PARM_STACK_SPACE (@var{fndecl})
-Define this macro if functions should assume that stack space has been
-allocated for arguments even when their values are passed in
-registers.
-
-The value of this macro is the size, in bytes, of the area reserved for
-arguments passed in registers for the function represented by @var{fndecl},
-which can be zero if GNU CC is calling a library function.
-
-This space can be allocated by the caller, or be a part of the
-machine-dependent stack frame: @code{OUTGOING_REG_PARM_STACK_SPACE} says
-which.
-@c above is overfull. not sure what to do. --mew 5feb93 did
-@c something, not sure if it looks good. --mew 10feb93
-
-@findex MAYBE_REG_PARM_STACK_SPACE
-@findex FINAL_REG_PARM_STACK_SPACE
-@item MAYBE_REG_PARM_STACK_SPACE
-@itemx FINAL_REG_PARM_STACK_SPACE (@var{const_size}, @var{var_size})
-Define these macros in addition to the one above if functions might
-allocate stack space for arguments even when their values are passed
-in registers. These should be used when the stack space allocated
-for arguments in registers is not a simple constant independent of the
-function declaration.
-
-The value of the first macro is the size, in bytes, of the area that
-we should initially assume would be reserved for arguments passed in registers.
-
-The value of the second macro is the actual size, in bytes, of the area
-that will be reserved for arguments passed in registers. This takes two
-arguments: an integer representing the number of bytes of fixed sized
-arguments on the stack, and a tree representing the number of bytes of
-variable sized arguments on the stack.
-
-When these macros are defined, @code{REG_PARM_STACK_SPACE} will only be
-called for libcall functions, the current function, or for a function
-being called when it is known that such stack space must be allocated.
-In each case this value can be easily computed.
-
-When deciding whether a called function needs such stack space, and how
-much space to reserve, GNU CC uses these two macros instead of
-@code{REG_PARM_STACK_SPACE}.
-
-@findex OUTGOING_REG_PARM_STACK_SPACE
-@item OUTGOING_REG_PARM_STACK_SPACE
-Define this if it is the responsibility of the caller to allocate the area
-reserved for arguments passed in registers.
-
-If @code{ACCUMULATE_OUTGOING_ARGS} is defined, this macro controls
-whether the space for these arguments counts in the value of
-@code{current_function_outgoing_args_size}.
-
-@findex STACK_PARMS_IN_REG_PARM_AREA
-@item STACK_PARMS_IN_REG_PARM_AREA
-Define this macro if @code{REG_PARM_STACK_SPACE} is defined, but the
-stack parameters don't skip the area specified by it.
-@c i changed this, makes more sens and it should have taken care of the
-@c overfull.. not as specific, tho. --mew 5feb93
-
-Normally, when a parameter is not passed in registers, it is placed on the
-stack beyond the @code{REG_PARM_STACK_SPACE} area. Defining this macro
-suppresses this behavior and causes the parameter to be passed on the
-stack in its natural location.
-
-@findex RETURN_POPS_ARGS
-@item RETURN_POPS_ARGS (@var{fundecl}, @var{funtype}, @var{stack-size})
-A C expression that should indicate the number of bytes of its own
-arguments that a function pops on returning, or 0 if the
-function pops no arguments and the caller must therefore pop them all
-after the function returns.
-
-@var{fundecl} is a C variable whose value is a tree node that describes
-the function in question. Normally it is a node of type
-@code{FUNCTION_DECL} that describes the declaration of the function.
-From this you can obtain the DECL_MACHINE_ATTRIBUTES of the function.
-
-@var{funtype} is a C variable whose value is a tree node that
-describes the function in question. Normally it is a node of type
-@code{FUNCTION_TYPE} that describes the data type of the function.
-From this it is possible to obtain the data types of the value and
-arguments (if known).
-
-When a call to a library function is being considered, @var{fundecl}
-will contain an identifier node for the library function. Thus, if
-you need to distinguish among various library functions, you can do so
-by their names. Note that ``library function'' in this context means
-a function used to perform arithmetic, whose name is known specially
-in the compiler and was not mentioned in the C code being compiled.
-
-@var{stack-size} is the number of bytes of arguments passed on the
-stack. If a variable number of bytes is passed, it is zero, and
-argument popping will always be the responsibility of the calling function.
-
-On the Vax, all functions always pop their arguments, so the definition
-of this macro is @var{stack-size}. On the 68000, using the standard
-calling convention, no functions pop their arguments, so the value of
-the macro is always 0 in this case. But an alternative calling
-convention is available in which functions that take a fixed number of
-arguments pop them but other functions (such as @code{printf}) pop
-nothing (the caller pops all). When this convention is in use,
-@var{funtype} is examined to determine whether a function takes a fixed
-number of arguments.
-@end table
-
-@node Register Arguments
-@subsection Passing Arguments in Registers
-@cindex arguments in registers
-@cindex registers arguments
-
-This section describes the macros which let you control how various
-types of arguments are passed in registers or how they are arranged in
-the stack.
-
-@table @code
-@findex FUNCTION_ARG
-@item FUNCTION_ARG (@var{cum}, @var{mode}, @var{type}, @var{named})
-A C expression that controls whether a function argument is passed
-in a register, and which register.
-
-The arguments are @var{cum}, which summarizes all the previous
-arguments; @var{mode}, the machine mode of the argument; @var{type},
-the data type of the argument as a tree node or 0 if that is not known
-(which happens for C support library functions); and @var{named},
-which is 1 for an ordinary argument and 0 for nameless arguments that
-correspond to @samp{@dots{}} in the called function's prototype.
-
-The value of the expression is usually either a @code{reg} RTX for the
-hard register in which to pass the argument, or zero to pass the
-argument on the stack.
-
-For machines like the Vax and 68000, where normally all arguments are
-pushed, zero suffices as a definition.
-
-The value of the expression can also be a @code{parallel} RTX. This is
-used when an argument is passed in multiple locations. The mode of the
-of the @code{parallel} should be the mode of the entire argument. The
-@code{parallel} holds any number of @code{expr_list} pairs; each one
-describes where part of the argument is passed. In each
-@code{expr_list} the first operand must be a @code{reg} RTX for the hard
-register in which to pass this part of the argument, and the mode of the
-register RTX indicates how large this part of the argument is. The
-second operand of the @code{expr_list} is a @code{const_int} which gives
-the offset in bytes into the entire argument of where this part starts.
-As a special exception the first @code{expr_list} in the @code{parallel}
-RTX may have a first operand of zero. This indicates that the bytes
-starting from the second operand of that @code{expr_list} are stored on
-the stack and not held in a register.
-
-@cindex @file{stdarg.h} and register arguments
-The usual way to make the ANSI library @file{stdarg.h} work on a machine
-where some arguments are usually passed in registers, is to cause
-nameless arguments to be passed on the stack instead. This is done
-by making @code{FUNCTION_ARG} return 0 whenever @var{named} is 0.
-
-@cindex @code{MUST_PASS_IN_STACK}, and @code{FUNCTION_ARG}
-@cindex @code{REG_PARM_STACK_SPACE}, and @code{FUNCTION_ARG}
-You may use the macro @code{MUST_PASS_IN_STACK (@var{mode}, @var{type})}
-in the definition of this macro to determine if this argument is of a
-type that must be passed in the stack. If @code{REG_PARM_STACK_SPACE}
-is not defined and @code{FUNCTION_ARG} returns non-zero for such an
-argument, the compiler will abort. If @code{REG_PARM_STACK_SPACE} is
-defined, the argument will be computed in the stack and then loaded into
-a register.
-
-@findex MUST_PASS_IN_STACK
-@item MUST_PASS_IN_STACK (@var{mode}, @var{type})
-Define as a C expression that evaluates to nonzero if we do not know how
-to pass TYPE solely in registers. The file @file{expr.h} defines a
-definition that is usually appropriate, refer to @file{expr.h} for additional
-documentation.
-
-@findex FUNCTION_INCOMING_ARG
-@item FUNCTION_INCOMING_ARG (@var{cum}, @var{mode}, @var{type}, @var{named})
-Define this macro if the target machine has ``register windows'', so
-that the register in which a function sees an arguments is not
-necessarily the same as the one in which the caller passed the
-argument.
-
-For such machines, @code{FUNCTION_ARG} computes the register in which
-the caller passes the value, and @code{FUNCTION_INCOMING_ARG} should
-be defined in a similar fashion to tell the function being called
-where the arguments will arrive.
-
-If @code{FUNCTION_INCOMING_ARG} is not defined, @code{FUNCTION_ARG}
-serves both purposes.@refill
-
-@findex FUNCTION_ARG_PARTIAL_NREGS
-@item FUNCTION_ARG_PARTIAL_NREGS (@var{cum}, @var{mode}, @var{type}, @var{named})
-A C expression for the number of words, at the beginning of an
-argument, must be put in registers. The value must be zero for
-arguments that are passed entirely in registers or that are entirely
-pushed on the stack.
-
-On some machines, certain arguments must be passed partially in
-registers and partially in memory. On these machines, typically the
-first @var{n} words of arguments are passed in registers, and the rest
-on the stack. If a multi-word argument (a @code{double} or a
-structure) crosses that boundary, its first few words must be passed
-in registers and the rest must be pushed. This macro tells the
-compiler when this occurs, and how many of the words should go in
-registers.
-
-@code{FUNCTION_ARG} for these arguments should return the first
-register to be used by the caller for this argument; likewise
-@code{FUNCTION_INCOMING_ARG}, for the called function.
-
-@findex FUNCTION_ARG_PASS_BY_REFERENCE
-@item FUNCTION_ARG_PASS_BY_REFERENCE (@var{cum}, @var{mode}, @var{type}, @var{named})
-A C expression that indicates when an argument must be passed by reference.
-If nonzero for an argument, a copy of that argument is made in memory and a
-pointer to the argument is passed instead of the argument itself.
-The pointer is passed in whatever way is appropriate for passing a pointer
-to that type.
-
-On machines where @code{REG_PARM_STACK_SPACE} is not defined, a suitable
-definition of this macro might be
-@smallexample
-#define FUNCTION_ARG_PASS_BY_REFERENCE\
-(CUM, MODE, TYPE, NAMED) \
- MUST_PASS_IN_STACK (MODE, TYPE)
-@end smallexample
-@c this is *still* too long. --mew 5feb93
-
-@findex FUNCTION_ARG_CALLEE_COPIES
-@item FUNCTION_ARG_CALLEE_COPIES (@var{cum}, @var{mode}, @var{type}, @var{named})
-If defined, a C expression that indicates when it is the called function's
-responsibility to make a copy of arguments passed by invisible reference.
-Normally, the caller makes a copy and passes the address of the copy to the
-routine being called. When FUNCTION_ARG_CALLEE_COPIES is defined and is
-nonzero, the caller does not make a copy. Instead, it passes a pointer to the
-``live'' value. The called function must not modify this value. If it can be
-determined that the value won't be modified, it need not make a copy;
-otherwise a copy must be made.
-
-@findex CUMULATIVE_ARGS
-@item CUMULATIVE_ARGS
-A C type for declaring a variable that is used as the first argument of
-@code{FUNCTION_ARG} and other related values. For some target machines,
-the type @code{int} suffices and can hold the number of bytes of
-argument so far.
-
-There is no need to record in @code{CUMULATIVE_ARGS} anything about the
-arguments that have been passed on the stack. The compiler has other
-variables to keep track of that. For target machines on which all
-arguments are passed on the stack, there is no need to store anything in
-@code{CUMULATIVE_ARGS}; however, the data structure must exist and
-should not be empty, so use @code{int}.
-
-@findex INIT_CUMULATIVE_ARGS
-@item INIT_CUMULATIVE_ARGS (@var{cum}, @var{fntype}, @var{libname}, @var{indirect})
-A C statement (sans semicolon) for initializing the variable @var{cum}
-for the state at the beginning of the argument list. The variable has
-type @code{CUMULATIVE_ARGS}. The value of @var{fntype} is the tree node
-for the data type of the function which will receive the args, or 0
-if the args are to a compiler support library function. The value of
-@var{indirect} is nonzero when processing an indirect call, for example
-a call through a function pointer. The value of @var{indirect} is zero
-for a call to an explicitly named function, a library function call, or when
-@code{INIT_CUMULATIVE_ARGS} is used to find arguments for the function
-being compiled.
-
-When processing a call to a compiler support library function,
-@var{libname} identifies which one. It is a @code{symbol_ref} rtx which
-contains the name of the function, as a string. @var{libname} is 0 when
-an ordinary C function call is being processed. Thus, each time this
-macro is called, either @var{libname} or @var{fntype} is nonzero, but
-never both of them at once.
-
-@findex INIT_CUMULATIVE_INCOMING_ARGS
-@item INIT_CUMULATIVE_INCOMING_ARGS (@var{cum}, @var{fntype}, @var{libname})
-Like @code{INIT_CUMULATIVE_ARGS} but overrides it for the purposes of
-finding the arguments for the function being compiled. If this macro is
-undefined, @code{INIT_CUMULATIVE_ARGS} is used instead.
-
-The value passed for @var{libname} is always 0, since library routines
-with special calling conventions are never compiled with GNU CC. The
-argument @var{libname} exists for symmetry with
-@code{INIT_CUMULATIVE_ARGS}.
-@c could use "this macro" in place of @code{INIT_CUMULATIVE_ARGS}, maybe.
-@c --mew 5feb93 i switched the order of the sentences. --mew 10feb93
-
-@findex FUNCTION_ARG_ADVANCE
-@item FUNCTION_ARG_ADVANCE (@var{cum}, @var{mode}, @var{type}, @var{named})
-A C statement (sans semicolon) to update the summarizer variable
-@var{cum} to advance past an argument in the argument list. The
-values @var{mode}, @var{type} and @var{named} describe that argument.
-Once this is done, the variable @var{cum} is suitable for analyzing
-the @emph{following} argument with @code{FUNCTION_ARG}, etc.@refill
-
-This macro need not do anything if the argument in question was passed
-on the stack. The compiler knows how to track the amount of stack space
-used for arguments without any special help.
-
-@findex FUNCTION_ARG_PADDING
-@item FUNCTION_ARG_PADDING (@var{mode}, @var{type})
-If defined, a C expression which determines whether, and in which direction,
-to pad out an argument with extra space. The value should be of type
-@code{enum direction}: either @code{upward} to pad above the argument,
-@code{downward} to pad below, or @code{none} to inhibit padding.
-
-The @emph{amount} of padding is always just enough to reach the next
-multiple of @code{FUNCTION_ARG_BOUNDARY}; this macro does not control
-it.
-
-This macro has a default definition which is right for most systems.
-For little-endian machines, the default is to pad upward. For
-big-endian machines, the default is to pad downward for an argument of
-constant size shorter than an @code{int}, and upward otherwise.
-
-@findex FUNCTION_ARG_BOUNDARY
-@item FUNCTION_ARG_BOUNDARY (@var{mode}, @var{type})
-If defined, a C expression that gives the alignment boundary, in bits,
-of an argument with the specified mode and type. If it is not defined,
-@code{PARM_BOUNDARY} is used for all arguments.
-
-@findex FUNCTION_ARG_REGNO_P
-@item FUNCTION_ARG_REGNO_P (@var{regno})
-A C expression that is nonzero if @var{regno} is the number of a hard
-register in which function arguments are sometimes passed. This does
-@emph{not} include implicit arguments such as the static chain and
-the structure-value address. On many machines, no registers can be
-used for this purpose since all function arguments are pushed on the
-stack.
-
-@findex LOAD_ARGS_REVERSED
-@item LOAD_ARGS_REVERSED
-If defined, the order in which arguments are loaded into their
-respective argument registers is reversed so that the last
-argument is loaded first. This macro only effects arguments
-passed in registers.
-
-@end table
-
-@node Scalar Return
-@subsection How Scalar Function Values Are Returned
-@cindex return values in registers
-@cindex values, returned by functions
-@cindex scalars, returned as values
-
-This section discusses the macros that control returning scalars as
-values---values that can fit in registers.
-
-@table @code
-@findex TRADITIONAL_RETURN_FLOAT
-@item TRADITIONAL_RETURN_FLOAT
-Define this macro if @samp{-traditional} should not cause functions
-declared to return @code{float} to convert the value to @code{double}.
-
-@findex FUNCTION_VALUE
-@item FUNCTION_VALUE (@var{valtype}, @var{func})
-A C expression to create an RTX representing the place where a
-function returns a value of data type @var{valtype}. @var{valtype} is
-a tree node representing a data type. Write @code{TYPE_MODE
-(@var{valtype})} to get the machine mode used to represent that type.
-On many machines, only the mode is relevant. (Actually, on most
-machines, scalar values are returned in the same place regardless of
-mode).@refill
-
-The value of the expression is usually a @code{reg} RTX for the hard
-register where the return value is stored. The value can also be a
-@code{parallel} RTX, if the return value is in multiple places. See
-@code{FUNCTION_ARG} for an explanation of the @code{parallel} form.
-
-If @code{PROMOTE_FUNCTION_RETURN} is defined, you must apply the same
-promotion rules specified in @code{PROMOTE_MODE} if @var{valtype} is a
-scalar type.
-
-If the precise function being called is known, @var{func} is a tree
-node (@code{FUNCTION_DECL}) for it; otherwise, @var{func} is a null
-pointer. This makes it possible to use a different value-returning
-convention for specific functions when all their calls are
-known.@refill
-
-@code{FUNCTION_VALUE} is not used for return vales with aggregate data
-types, because these are returned in another way. See
-@code{STRUCT_VALUE_REGNUM} and related macros, below.
-
-@findex FUNCTION_OUTGOING_VALUE
-@item FUNCTION_OUTGOING_VALUE (@var{valtype}, @var{func})
-Define this macro if the target machine has ``register windows''
-so that the register in which a function returns its value is not
-the same as the one in which the caller sees the value.
-
-For such machines, @code{FUNCTION_VALUE} computes the register in which
-the caller will see the value. @code{FUNCTION_OUTGOING_VALUE} should be
-defined in a similar fashion to tell the function where to put the
-value.@refill
-
-If @code{FUNCTION_OUTGOING_VALUE} is not defined,
-@code{FUNCTION_VALUE} serves both purposes.@refill
-
-@code{FUNCTION_OUTGOING_VALUE} is not used for return vales with
-aggregate data types, because these are returned in another way. See
-@code{STRUCT_VALUE_REGNUM} and related macros, below.
-
-@findex LIBCALL_VALUE
-@item LIBCALL_VALUE (@var{mode})
-A C expression to create an RTX representing the place where a library
-function returns a value of mode @var{mode}. If the precise function
-being called is known, @var{func} is a tree node
-(@code{FUNCTION_DECL}) for it; otherwise, @var{func} is a null
-pointer. This makes it possible to use a different value-returning
-convention for specific functions when all their calls are
-known.@refill
-
-Note that ``library function'' in this context means a compiler
-support routine, used to perform arithmetic, whose name is known
-specially by the compiler and was not mentioned in the C code being
-compiled.
-
-The definition of @code{LIBRARY_VALUE} need not be concerned aggregate
-data types, because none of the library functions returns such types.
-
-@findex FUNCTION_VALUE_REGNO_P
-@item FUNCTION_VALUE_REGNO_P (@var{regno})
-A C expression that is nonzero if @var{regno} is the number of a hard
-register in which the values of called function may come back.
-
-A register whose use for returning values is limited to serving as the
-second of a pair (for a value of type @code{double}, say) need not be
-recognized by this macro. So for most machines, this definition
-suffices:
-
-@example
-#define FUNCTION_VALUE_REGNO_P(N) ((N) == 0)
-@end example
-
-If the machine has register windows, so that the caller and the called
-function use different registers for the return value, this macro
-should recognize only the caller's register numbers.
-
-@findex APPLY_RESULT_SIZE
-@item APPLY_RESULT_SIZE
-Define this macro if @samp{untyped_call} and @samp{untyped_return}
-need more space than is implied by @code{FUNCTION_VALUE_REGNO_P} for
-saving and restoring an arbitrary return value.
-@end table
-
-@node Aggregate Return
-@subsection How Large Values Are Returned
-@cindex aggregates as return values
-@cindex large return values
-@cindex returning aggregate values
-@cindex structure value address
-
-When a function value's mode is @code{BLKmode} (and in some other
-cases), the value is not returned according to @code{FUNCTION_VALUE}
-(@pxref{Scalar Return}). Instead, the caller passes the address of a
-block of memory in which the value should be stored. This address
-is called the @dfn{structure value address}.
-
-This section describes how to control returning structure values in
-memory.
-
-@table @code
-@findex RETURN_IN_MEMORY
-@item RETURN_IN_MEMORY (@var{type})
-A C expression which can inhibit the returning of certain function
-values in registers, based on the type of value. A nonzero value says
-to return the function value in memory, just as large structures are
-always returned. Here @var{type} will be a C expression of type
-@code{tree}, representing the data type of the value.
-
-Note that values of mode @code{BLKmode} must be explicitly handled
-by this macro. Also, the option @samp{-fpcc-struct-return}
-takes effect regardless of this macro. On most systems, it is
-possible to leave the macro undefined; this causes a default
-definition to be used, whose value is the constant 1 for @code{BLKmode}
-values, and 0 otherwise.
-
-Do not use this macro to indicate that structures and unions should always
-be returned in memory. You should instead use @code{DEFAULT_PCC_STRUCT_RETURN}
-to indicate this.
-
-@findex DEFAULT_PCC_STRUCT_RETURN
-@item DEFAULT_PCC_STRUCT_RETURN
-Define this macro to be 1 if all structure and union return values must be
-in memory. Since this results in slower code, this should be defined
-only if needed for compatibility with other compilers or with an ABI.
-If you define this macro to be 0, then the conventions used for structure
-and union return values are decided by the @code{RETURN_IN_MEMORY} macro.
-
-If not defined, this defaults to the value 1.
-
-@findex STRUCT_VALUE_REGNUM
-@item STRUCT_VALUE_REGNUM
-If the structure value address is passed in a register, then
-@code{STRUCT_VALUE_REGNUM} should be the number of that register.
-
-@findex STRUCT_VALUE
-@item STRUCT_VALUE
-If the structure value address is not passed in a register, define
-@code{STRUCT_VALUE} as an expression returning an RTX for the place
-where the address is passed. If it returns 0, the address is passed as
-an ``invisible'' first argument.
-
-@findex STRUCT_VALUE_INCOMING_REGNUM
-@item STRUCT_VALUE_INCOMING_REGNUM
-On some architectures the place where the structure value address
-is found by the called function is not the same place that the
-caller put it. This can be due to register windows, or it could
-be because the function prologue moves it to a different place.
-
-If the incoming location of the structure value address is in a
-register, define this macro as the register number.
-
-@findex STRUCT_VALUE_INCOMING
-@item STRUCT_VALUE_INCOMING
-If the incoming location is not a register, then you should define
-@code{STRUCT_VALUE_INCOMING} as an expression for an RTX for where the
-called function should find the value. If it should find the value on
-the stack, define this to create a @code{mem} which refers to the frame
-pointer. A definition of 0 means that the address is passed as an
-``invisible'' first argument.
-
-@findex PCC_STATIC_STRUCT_RETURN
-@item PCC_STATIC_STRUCT_RETURN
-Define this macro if the usual system convention on the target machine
-for returning structures and unions is for the called function to return
-the address of a static variable containing the value.
-
-Do not define this if the usual system convention is for the caller to
-pass an address to the subroutine.
-
-This macro has effect in @samp{-fpcc-struct-return} mode, but it does
-nothing when you use @samp{-freg-struct-return} mode.
-@end table
-
-@node Caller Saves
-@subsection Caller-Saves Register Allocation
-
-If you enable it, GNU CC can save registers around function calls. This
-makes it possible to use call-clobbered registers to hold variables that
-must live across calls.
-
-@table @code
-@findex DEFAULT_CALLER_SAVES
-@item DEFAULT_CALLER_SAVES
-Define this macro if function calls on the target machine do not preserve
-any registers; in other words, if @code{CALL_USED_REGISTERS} has 1
-for all registers. When defined, this macro enables @samp{-fcaller-saves}
-by default for all optimization levels. It has no effect for optimization
-levels 2 and higher, where @samp{-fcaller-saves} is the default.
-
-@findex CALLER_SAVE_PROFITABLE
-@item CALLER_SAVE_PROFITABLE (@var{refs}, @var{calls})
-A C expression to determine whether it is worthwhile to consider placing
-a pseudo-register in a call-clobbered hard register and saving and
-restoring it around each function call. The expression should be 1 when
-this is worth doing, and 0 otherwise.
-
-If you don't define this macro, a default is used which is good on most
-machines: @code{4 * @var{calls} < @var{refs}}.
-
-@findex HARD_REGNO_CALLER_SAVE_MODE
-@item HARD_REGNO_CALLER_SAVE_MODE (@var{regno}, @var{nregs})
-A C expression specifying which mode is required for saving @var{nregs}
-of a pseudo-register in call-clobbered hard register @var{regno}. If
-@var{regno} is unsuitable for caller save, @code{VOIDmode} should be
-returned. For most machines this macro need not be defined since GCC
-will select the smallest suitable mode.
-@end table
-
-@node Function Entry
-@subsection Function Entry and Exit
-@cindex function entry and exit
-@cindex prologue
-@cindex epilogue
-
-This section describes the macros that output function entry
-(@dfn{prologue}) and exit (@dfn{epilogue}) code.
-
-@table @code
-@findex FUNCTION_PROLOGUE
-@item FUNCTION_PROLOGUE (@var{file}, @var{size})
-A C compound statement that outputs the assembler code for entry to a
-function. The prologue is responsible for setting up the stack frame,
-initializing the frame pointer register, saving registers that must be
-saved, and allocating @var{size} additional bytes of storage for the
-local variables. @var{size} is an integer. @var{file} is a stdio
-stream to which the assembler code should be output.
-
-The label for the beginning of the function need not be output by this
-macro. That has already been done when the macro is run.
-
-@findex regs_ever_live
-To determine which registers to save, the macro can refer to the array
-@code{regs_ever_live}: element @var{r} is nonzero if hard register
-@var{r} is used anywhere within the function. This implies the function
-prologue should save register @var{r}, provided it is not one of the
-call-used registers. (@code{FUNCTION_EPILOGUE} must likewise use
-@code{regs_ever_live}.)
-
-On machines that have ``register windows'', the function entry code does
-not save on the stack the registers that are in the windows, even if
-they are supposed to be preserved by function calls; instead it takes
-appropriate steps to ``push'' the register stack, if any non-call-used
-registers are used in the function.
-
-@findex frame_pointer_needed
-On machines where functions may or may not have frame-pointers, the
-function entry code must vary accordingly; it must set up the frame
-pointer if one is wanted, and not otherwise. To determine whether a
-frame pointer is in wanted, the macro can refer to the variable
-@code{frame_pointer_needed}. The variable's value will be 1 at run
-time in a function that needs a frame pointer. @xref{Elimination}.
-
-The function entry code is responsible for allocating any stack space
-required for the function. This stack space consists of the regions
-listed below. In most cases, these regions are allocated in the
-order listed, with the last listed region closest to the top of the
-stack (the lowest address if @code{STACK_GROWS_DOWNWARD} is defined, and
-the highest address if it is not defined). You can use a different order
-for a machine if doing so is more convenient or required for
-compatibility reasons. Except in cases where required by standard
-or by a debugger, there is no reason why the stack layout used by GCC
-need agree with that used by other compilers for a machine.
-
-@itemize @bullet
-@item
-@findex current_function_pretend_args_size
-A region of @code{current_function_pretend_args_size} bytes of
-uninitialized space just underneath the first argument arriving on the
-stack. (This may not be at the very start of the allocated stack region
-if the calling sequence has pushed anything else since pushing the stack
-arguments. But usually, on such machines, nothing else has been pushed
-yet, because the function prologue itself does all the pushing.) This
-region is used on machines where an argument may be passed partly in
-registers and partly in memory, and, in some cases to support the
-features in @file{varargs.h} and @file{stdargs.h}.
-
-@item
-An area of memory used to save certain registers used by the function.
-The size of this area, which may also include space for such things as
-the return address and pointers to previous stack frames, is
-machine-specific and usually depends on which registers have been used
-in the function. Machines with register windows often do not require
-a save area.
-
-@item
-A region of at least @var{size} bytes, possibly rounded up to an allocation
-boundary, to contain the local variables of the function. On some machines,
-this region and the save area may occur in the opposite order, with the
-save area closer to the top of the stack.
-
-@item
-@cindex @code{ACCUMULATE_OUTGOING_ARGS} and stack frames
-Optionally, when @code{ACCUMULATE_OUTGOING_ARGS} is defined, a region of
-@code{current_function_outgoing_args_size} bytes to be used for outgoing
-argument lists of the function. @xref{Stack Arguments}.
-@end itemize
-
-Normally, it is necessary for the macros @code{FUNCTION_PROLOGUE} and
-@code{FUNCTION_EPILOGUE} to treat leaf functions specially. The C
-variable @code{current_function_is_leaf} is nonzero for such a function.
-
-@findex EXIT_IGNORE_STACK
-@item EXIT_IGNORE_STACK
-Define this macro as a C expression that is nonzero if the return
-instruction or the function epilogue ignores the value of the stack
-pointer; in other words, if it is safe to delete an instruction to
-adjust the stack pointer before a return from the function.
-
-Note that this macro's value is relevant only for functions for which
-frame pointers are maintained. It is never safe to delete a final
-stack adjustment in a function that has no frame pointer, and the
-compiler knows this regardless of @code{EXIT_IGNORE_STACK}.
-
-@findex EPILOGUE_USES
-@item EPILOGUE_USES (@var{regno})
-Define this macro as a C expression that is nonzero for registers are
-used by the epilogue or the @samp{return} pattern. The stack and frame
-pointer registers are already be assumed to be used as needed.
-
-@findex FUNCTION_EPILOGUE
-@item FUNCTION_EPILOGUE (@var{file}, @var{size})
-A C compound statement that outputs the assembler code for exit from a
-function. The epilogue is responsible for restoring the saved
-registers and stack pointer to their values when the function was
-called, and returning control to the caller. This macro takes the
-same arguments as the macro @code{FUNCTION_PROLOGUE}, and the
-registers to restore are determined from @code{regs_ever_live} and
-@code{CALL_USED_REGISTERS} in the same way.
-
-On some machines, there is a single instruction that does all the work
-of returning from the function. On these machines, give that
-instruction the name @samp{return} and do not define the macro
-@code{FUNCTION_EPILOGUE} at all.
-
-Do not define a pattern named @samp{return} if you want the
-@code{FUNCTION_EPILOGUE} to be used. If you want the target switches
-to control whether return instructions or epilogues are used, define a
-@samp{return} pattern with a validity condition that tests the target
-switches appropriately. If the @samp{return} pattern's validity
-condition is false, epilogues will be used.
-
-On machines where functions may or may not have frame-pointers, the
-function exit code must vary accordingly. Sometimes the code for these
-two cases is completely different. To determine whether a frame pointer
-is wanted, the macro can refer to the variable
-@code{frame_pointer_needed}. The variable's value will be 1 when compiling
-a function that needs a frame pointer.
-
-Normally, @code{FUNCTION_PROLOGUE} and @code{FUNCTION_EPILOGUE} must
-treat leaf functions specially. The C variable @code{current_function_is_leaf}
-is nonzero for such a function. @xref{Leaf Functions}.
-
-On some machines, some functions pop their arguments on exit while
-others leave that for the caller to do. For example, the 68020 when
-given @samp{-mrtd} pops arguments in functions that take a fixed
-number of arguments.
-
-@findex current_function_pops_args
-Your definition of the macro @code{RETURN_POPS_ARGS} decides which
-functions pop their own arguments. @code{FUNCTION_EPILOGUE} needs to
-know what was decided. The variable that is called
-@code{current_function_pops_args} is the number of bytes of its
-arguments that a function should pop. @xref{Scalar Return}.
-@c what is the "its arguments" in the above sentence referring to, pray
-@c tell? --mew 5feb93
-
-@findex DELAY_SLOTS_FOR_EPILOGUE
-@item DELAY_SLOTS_FOR_EPILOGUE
-Define this macro if the function epilogue contains delay slots to which
-instructions from the rest of the function can be ``moved''. The
-definition should be a C expression whose value is an integer
-representing the number of delay slots there.
-
-@findex ELIGIBLE_FOR_EPILOGUE_DELAY
-@item ELIGIBLE_FOR_EPILOGUE_DELAY (@var{insn}, @var{n})
-A C expression that returns 1 if @var{insn} can be placed in delay
-slot number @var{n} of the epilogue.
-
-The argument @var{n} is an integer which identifies the delay slot now
-being considered (since different slots may have different rules of
-eligibility). It is never negative and is always less than the number
-of epilogue delay slots (what @code{DELAY_SLOTS_FOR_EPILOGUE} returns).
-If you reject a particular insn for a given delay slot, in principle, it
-may be reconsidered for a subsequent delay slot. Also, other insns may
-(at least in principle) be considered for the so far unfilled delay
-slot.
-
-@findex current_function_epilogue_delay_list
-@findex final_scan_insn
-The insns accepted to fill the epilogue delay slots are put in an RTL
-list made with @code{insn_list} objects, stored in the variable
-@code{current_function_epilogue_delay_list}. The insn for the first
-delay slot comes first in the list. Your definition of the macro
-@code{FUNCTION_EPILOGUE} should fill the delay slots by outputting the
-insns in this list, usually by calling @code{final_scan_insn}.
-
-You need not define this macro if you did not define
-@code{DELAY_SLOTS_FOR_EPILOGUE}.
-
-@findex ASM_OUTPUT_MI_THUNK
-@item ASM_OUTPUT_MI_THUNK (@var{file}, @var{thunk_fndecl}, @var{delta}, @var{function})
-A C compound statement that outputs the assembler code for a thunk
-function, used to implement C++ virtual function calls with multiple
-inheritance. The thunk acts as a wrapper around a virtual function,
-adjusting the implicit object parameter before handing control off to
-the real function.
-
-First, emit code to add the integer @var{delta} to the location that
-contains the incoming first argument. Assume that this argument
-contains a pointer, and is the one used to pass the @code{this} pointer
-in C++. This is the incoming argument @emph{before} the function prologue,
-e.g. @samp{%o0} on a sparc. The addition must preserve the values of
-all other incoming arguments.
-
-After the addition, emit code to jump to @var{function}, which is a
-@code{FUNCTION_DECL}. This is a direct pure jump, not a call, and does
-not touch the return address. Hence returning from @var{FUNCTION} will
-return to whoever called the current @samp{thunk}.
-
-The effect must be as if @var{function} had been called directly with
-the adjusted first argument. This macro is responsible for emitting all
-of the code for a thunk function; @code{FUNCTION_PROLOGUE} and
-@code{FUNCTION_EPILOGUE} are not invoked.
-
-The @var{thunk_fndecl} is redundant. (@var{delta} and @var{function}
-have already been extracted from it.) It might possibly be useful on
-some targets, but probably not.
-
-If you do not define this macro, the target-independent code in the C++
-frontend will generate a less efficient heavyweight thunk that calls
-@var{function} instead of jumping to it. The generic approach does
-not support varargs.
-@end table
-
-@node Profiling
-@subsection Generating Code for Profiling
-@cindex profiling, code generation
-
-These macros will help you generate code for profiling.
-
-@table @code
-@findex FUNCTION_PROFILER
-@item FUNCTION_PROFILER (@var{file}, @var{labelno})
-A C statement or compound statement to output to @var{file} some
-assembler code to call the profiling subroutine @code{mcount}.
-Before calling, the assembler code must load the address of a
-counter variable into a register where @code{mcount} expects to
-find the address. The name of this variable is @samp{LP} followed
-by the number @var{labelno}, so you would generate the name using
-@samp{LP%d} in a @code{fprintf}.
-
-@findex mcount
-The details of how the address should be passed to @code{mcount} are
-determined by your operating system environment, not by GNU CC. To
-figure them out, compile a small program for profiling using the
-system's installed C compiler and look at the assembler code that
-results.
-
-@findex PROFILE_BEFORE_PROLOGUE
-@item PROFILE_BEFORE_PROLOGUE
-Define this macro if the code for function profiling should come before
-the function prologue. Normally, the profiling code comes after.
-
-@findex FUNCTION_BLOCK_PROFILER
-@vindex profile_block_flag
-@item FUNCTION_BLOCK_PROFILER (@var{file}, @var{labelno})
-A C statement or compound statement to output to @var{file} some
-assembler code to initialize basic-block profiling for the current
-object module. The global compile flag @code{profile_block_flag}
-distinguishes two profile modes.
-
-@table @code
-@findex __bb_init_func
-@item profile_block_flag != 2
-Output code to call the subroutine @code{__bb_init_func} once per
-object module, passing it as its sole argument the address of a block
-allocated in the object module.
-
-The name of the block is a local symbol made with this statement:
-
-@smallexample
-ASM_GENERATE_INTERNAL_LABEL (@var{buffer}, "LPBX", 0);
-@end smallexample
-
-Of course, since you are writing the definition of
-@code{ASM_GENERATE_INTERNAL_LABEL} as well as that of this macro, you
-can take a short cut in the definition of this macro and use the name
-that you know will result.
-
-The first word of this block is a flag which will be nonzero if the
-object module has already been initialized. So test this word first,
-and do not call @code{__bb_init_func} if the flag is
-nonzero. BLOCK_OR_LABEL contains a unique number which may be used to
-generate a label as a branch destination when @code{__bb_init_func}
-will not be called.
-
-Described in assembler language, the code to be output looks like:
-
-@example
- cmp (LPBX0),0
- bne local_label
- parameter1 <- LPBX0
- call __bb_init_func
-local_label:
-@end example
-
-@findex __bb_init_trace_func
-@item profile_block_flag == 2
-Output code to call the subroutine @code{__bb_init_trace_func}
-and pass two parameters to it. The first parameter is the same as
-for @code{__bb_init_func}. The second parameter is the number of the
-first basic block of the function as given by BLOCK_OR_LABEL. Note
-that @code{__bb_init_trace_func} has to be called, even if the object
-module has been initialized already.
-
-Described in assembler language, the code to be output looks like:
-@example
-parameter1 <- LPBX0
-parameter2 <- BLOCK_OR_LABEL
-call __bb_init_trace_func
-@end example
-@end table
-
-@findex BLOCK_PROFILER
-@vindex profile_block_flag
-@item BLOCK_PROFILER (@var{file}, @var{blockno})
-A C statement or compound statement to output to @var{file} some
-assembler code to increment the count associated with the basic
-block number @var{blockno}. The global compile flag
-@code{profile_block_flag} distinguishes two profile modes.
-
-@table @code
-@item profile_block_flag != 2
-Output code to increment the counter directly. Basic blocks are
-numbered separately from zero within each compilation. The count
-associated with block number @var{blockno} is at index
-@var{blockno} in a vector of words; the name of this array is a local
-symbol made with this statement:
-
-@smallexample
-ASM_GENERATE_INTERNAL_LABEL (@var{buffer}, "LPBX", 2);
-@end smallexample
-
-@c This paragraph is the same as one a few paragraphs up.
-@c That is not an error.
-Of course, since you are writing the definition of
-@code{ASM_GENERATE_INTERNAL_LABEL} as well as that of this macro, you
-can take a short cut in the definition of this macro and use the name
-that you know will result.
-
-Described in assembler language, the code to be output looks like:
-
-@smallexample
-inc (LPBX2+4*BLOCKNO)
-@end smallexample
-
-@vindex __bb
-@findex __bb_trace_func
-@item profile_block_flag == 2
-Output code to initialize the global structure @code{__bb} and
-call the function @code{__bb_trace_func}, which will increment the
-counter.
-
-@code{__bb} consists of two words. In the first word, the current
-basic block number, as given by BLOCKNO, has to be stored. In
-the second word, the address of a block allocated in the object
-module has to be stored. The address is given by the label created
-with this statement:
-
-@smallexample
-ASM_GENERATE_INTERNAL_LABEL (@var{buffer}, "LPBX", 0);
-@end smallexample
-
-Described in assembler language, the code to be output looks like:
-@example
-move BLOCKNO -> (__bb)
-move LPBX0 -> (__bb+4)
-call __bb_trace_func
-@end example
-@end table
-
-@findex FUNCTION_BLOCK_PROFILER_EXIT
-@findex __bb_trace_ret
-@vindex profile_block_flag
-@item FUNCTION_BLOCK_PROFILER_EXIT (@var{file})
-A C statement or compound statement to output to @var{file}
-assembler code to call function @code{__bb_trace_ret}. The
-assembler code should only be output
-if the global compile flag @code{profile_block_flag} == 2. This
-macro has to be used at every place where code for returning from
-a function is generated (e.g. @code{FUNCTION_EPILOGUE}). Although
-you have to write the definition of @code{FUNCTION_EPILOGUE}
-as well, you have to define this macro to tell the compiler, that
-the proper call to @code{__bb_trace_ret} is produced.
-
-@findex MACHINE_STATE_SAVE
-@findex __bb_init_trace_func
-@findex __bb_trace_func
-@findex __bb_trace_ret
-@item MACHINE_STATE_SAVE (@var{id})
-A C statement or compound statement to save all registers, which may
-be clobbered by a function call, including condition codes. The
-@code{asm} statement will be mostly likely needed to handle this
-task. Local labels in the assembler code can be concatenated with the
-string @var{id}, to obtain a unique lable name.
-
-Registers or condition codes clobbered by @code{FUNCTION_PROLOGUE} or
-@code{FUNCTION_EPILOGUE} must be saved in the macros
-@code{FUNCTION_BLOCK_PROFILER}, @code{FUNCTION_BLOCK_PROFILER_EXIT} and
-@code{BLOCK_PROFILER} prior calling @code{__bb_init_trace_func},
-@code{__bb_trace_ret} and @code{__bb_trace_func} respectively.
-
-@findex MACHINE_STATE_RESTORE
-@findex __bb_init_trace_func
-@findex __bb_trace_func
-@findex __bb_trace_ret
-@item MACHINE_STATE_RESTORE (@var{id})
-A C statement or compound statement to restore all registers, including
-condition codes, saved by @code{MACHINE_STATE_SAVE}.
-
-Registers or condition codes clobbered by @code{FUNCTION_PROLOGUE} or
-@code{FUNCTION_EPILOGUE} must be restored in the macros
-@code{FUNCTION_BLOCK_PROFILER}, @code{FUNCTION_BLOCK_PROFILER_EXIT} and
-@code{BLOCK_PROFILER} after calling @code{__bb_init_trace_func},
-@code{__bb_trace_ret} and @code{__bb_trace_func} respectively.
-
-@findex BLOCK_PROFILER_CODE
-@item BLOCK_PROFILER_CODE
-A C function or functions which are needed in the library to
-support block profiling.
-@end table
-
-@node Varargs
-@section Implementing the Varargs Macros
-@cindex varargs implementation
-
-GNU CC comes with an implementation of @file{varargs.h} and
-@file{stdarg.h} that work without change on machines that pass arguments
-on the stack. Other machines require their own implementations of
-varargs, and the two machine independent header files must have
-conditionals to include it.
-
-ANSI @file{stdarg.h} differs from traditional @file{varargs.h} mainly in
-the calling convention for @code{va_start}. The traditional
-implementation takes just one argument, which is the variable in which
-to store the argument pointer. The ANSI implementation of
-@code{va_start} takes an additional second argument. The user is
-supposed to write the last named argument of the function here.
-
-However, @code{va_start} should not use this argument. The way to find
-the end of the named arguments is with the built-in functions described
-below.
-
-@table @code
-@findex __builtin_saveregs
-@item __builtin_saveregs ()
-Use this built-in function to save the argument registers in memory so
-that the varargs mechanism can access them. Both ANSI and traditional
-versions of @code{va_start} must use @code{__builtin_saveregs}, unless
-you use @code{SETUP_INCOMING_VARARGS} (see below) instead.
-
-On some machines, @code{__builtin_saveregs} is open-coded under the
-control of the macro @code{EXPAND_BUILTIN_SAVEREGS}. On other machines,
-it calls a routine written in assembler language, found in
-@file{libgcc2.c}.
-
-Code generated for the call to @code{__builtin_saveregs} appears at the
-beginning of the function, as opposed to where the call to
-@code{__builtin_saveregs} is written, regardless of what the code is.
-This is because the registers must be saved before the function starts
-to use them for its own purposes.
-@c i rewrote the first sentence above to fix an overfull hbox. --mew
-@c 10feb93
-
-@findex __builtin_args_info
-@item __builtin_args_info (@var{category})
-Use this built-in function to find the first anonymous arguments in
-registers.
-
-In general, a machine may have several categories of registers used for
-arguments, each for a particular category of data types. (For example,
-on some machines, floating-point registers are used for floating-point
-arguments while other arguments are passed in the general registers.)
-To make non-varargs functions use the proper calling convention, you
-have defined the @code{CUMULATIVE_ARGS} data type to record how many
-registers in each category have been used so far
-
-@code{__builtin_args_info} accesses the same data structure of type
-@code{CUMULATIVE_ARGS} after the ordinary argument layout is finished
-with it, with @var{category} specifying which word to access. Thus, the
-value indicates the first unused register in a given category.
-
-Normally, you would use @code{__builtin_args_info} in the implementation
-of @code{va_start}, accessing each category just once and storing the
-value in the @code{va_list} object. This is because @code{va_list} will
-have to update the values, and there is no way to alter the
-values accessed by @code{__builtin_args_info}.
-
-@findex __builtin_next_arg
-@item __builtin_next_arg (@var{lastarg})
-This is the equivalent of @code{__builtin_args_info}, for stack
-arguments. It returns the address of the first anonymous stack
-argument, as type @code{void *}. If @code{ARGS_GROW_DOWNWARD}, it
-returns the address of the location above the first anonymous stack
-argument. Use it in @code{va_start} to initialize the pointer for
-fetching arguments from the stack. Also use it in @code{va_start} to
-verify that the second parameter @var{lastarg} is the last named argument
-of the current function.
-
-@findex __builtin_classify_type
-@item __builtin_classify_type (@var{object})
-Since each machine has its own conventions for which data types are
-passed in which kind of register, your implementation of @code{va_arg}
-has to embody these conventions. The easiest way to categorize the
-specified data type is to use @code{__builtin_classify_type} together
-with @code{sizeof} and @code{__alignof__}.
-
-@code{__builtin_classify_type} ignores the value of @var{object},
-considering only its data type. It returns an integer describing what
-kind of type that is---integer, floating, pointer, structure, and so on.
-
-The file @file{typeclass.h} defines an enumeration that you can use to
-interpret the values of @code{__builtin_classify_type}.
-@end table
-
-These machine description macros help implement varargs:
-
-@table @code
-@findex EXPAND_BUILTIN_SAVEREGS
-@item EXPAND_BUILTIN_SAVEREGS (@var{args})
-If defined, is a C expression that produces the machine-specific code
-for a call to @code{__builtin_saveregs}. This code will be moved to the
-very beginning of the function, before any parameter access are made.
-The return value of this function should be an RTX that contains the
-value to use as the return of @code{__builtin_saveregs}.
-
-The argument @var{args} is a @code{tree_list} containing the arguments
-that were passed to @code{__builtin_saveregs}.
-
-If this macro is not defined, the compiler will output an ordinary
-call to the library function @samp{__builtin_saveregs}.
-
-@findex SETUP_INCOMING_VARARGS
-@item SETUP_INCOMING_VARARGS (@var{args_so_far}, @var{mode}, @var{type}, @var{pretend_args_size}, @var{second_time})
-This macro offers an alternative to using @code{__builtin_saveregs} and
-defining the macro @code{EXPAND_BUILTIN_SAVEREGS}. Use it to store the
-anonymous register arguments into the stack so that all the arguments
-appear to have been passed consecutively on the stack. Once this is
-done, you can use the standard implementation of varargs that works for
-machines that pass all their arguments on the stack.
-
-The argument @var{args_so_far} is the @code{CUMULATIVE_ARGS} data
-structure, containing the values that obtain after processing of the
-named arguments. The arguments @var{mode} and @var{type} describe the
-last named argument---its machine mode and its data type as a tree node.
-
-The macro implementation should do two things: first, push onto the
-stack all the argument registers @emph{not} used for the named
-arguments, and second, store the size of the data thus pushed into the
-@code{int}-valued variable whose name is supplied as the argument
-@var{pretend_args_size}. The value that you store here will serve as
-additional offset for setting up the stack frame.
-
-Because you must generate code to push the anonymous arguments at
-compile time without knowing their data types,
-@code{SETUP_INCOMING_VARARGS} is only useful on machines that have just
-a single category of argument register and use it uniformly for all data
-types.
-
-If the argument @var{second_time} is nonzero, it means that the
-arguments of the function are being analyzed for the second time. This
-happens for an inline function, which is not actually compiled until the
-end of the source file. The macro @code{SETUP_INCOMING_VARARGS} should
-not generate any instructions in this case.
-
-@findex STRICT_ARGUMENT_NAMING
-@item STRICT_ARGUMENT_NAMING
-Define this macro to be a nonzero value if the location where a function
-argument is passed depends on whether or not it is a named argument.
-
-This macro controls how the @var{named} argument to @code{FUNCTION_ARG}
-is set for varargs and stdarg functions. If this macro returns a
-nonzero value, the @var{named} argument is always true for named
-arguments, and false for unnamed arguments. If it returns a value of
-zero, but @code{SETUP_INCOMING_VARARGS} is defined, then all arguments
-are treated as named. Otherwise, all named arguments except the last
-are treated as named.
-
-You need not define this macro if it always returns zero.
-
-@findex PRETEND_OUTGOING_VARARGS_NAMED
-@item PRETEND_OUTGOING_VARARGS_NAMED
-If you need to conditionally change ABIs so that one works with
-@code{SETUP_INCOMING_VARARGS}, but the other works like neither
-@code{SETUP_INCOMING_VARARGS} nor @code{STRICT_ARGUMENT_NAMING} was
-defined, then define this macro to return nonzero if
-@code{SETUP_INCOMING_VARARGS} is used, zero otherwise.
-Otherwise, you should not define this macro.
-@end table
-
-@node Trampolines
-@section Trampolines for Nested Functions
-@cindex trampolines for nested functions
-@cindex nested functions, trampolines for
-
-A @dfn{trampoline} is a small piece of code that is created at run time
-when the address of a nested function is taken. It normally resides on
-the stack, in the stack frame of the containing function. These macros
-tell GNU CC how to generate code to allocate and initialize a
-trampoline.
-
-The instructions in the trampoline must do two things: load a constant
-address into the static chain register, and jump to the real address of
-the nested function. On CISC machines such as the m68k, this requires
-two instructions, a move immediate and a jump. Then the two addresses
-exist in the trampoline as word-long immediate operands. On RISC
-machines, it is often necessary to load each address into a register in
-two parts. Then pieces of each address form separate immediate
-operands.
-
-The code generated to initialize the trampoline must store the variable
-parts---the static chain value and the function address---into the
-immediate operands of the instructions. On a CISC machine, this is
-simply a matter of copying each address to a memory reference at the
-proper offset from the start of the trampoline. On a RISC machine, it
-may be necessary to take out pieces of the address and store them
-separately.
-
-@table @code
-@findex TRAMPOLINE_TEMPLATE
-@item TRAMPOLINE_TEMPLATE (@var{file})
-A C statement to output, on the stream @var{file}, assembler code for a
-block of data that contains the constant parts of a trampoline. This
-code should not include a label---the label is taken care of
-automatically.
-
-If you do not define this macro, it means no template is needed
-for the target. Do not define this macro on systems where the block move
-code to copy the trampoline into place would be larger than the code
-to generate it on the spot.
-
-@findex TRAMPOLINE_SECTION
-@item TRAMPOLINE_SECTION
-The name of a subroutine to switch to the section in which the
-trampoline template is to be placed (@pxref{Sections}). The default is
-a value of @samp{readonly_data_section}, which places the trampoline in
-the section containing read-only data.
-
-@findex TRAMPOLINE_SIZE
-@item TRAMPOLINE_SIZE
-A C expression for the size in bytes of the trampoline, as an integer.
-
-@findex TRAMPOLINE_ALIGNMENT
-@item TRAMPOLINE_ALIGNMENT
-Alignment required for trampolines, in bits.
-
-If you don't define this macro, the value of @code{BIGGEST_ALIGNMENT}
-is used for aligning trampolines.
-
-@findex INITIALIZE_TRAMPOLINE
-@item INITIALIZE_TRAMPOLINE (@var{addr}, @var{fnaddr}, @var{static_chain})
-A C statement to initialize the variable parts of a trampoline.
-@var{addr} is an RTX for the address of the trampoline; @var{fnaddr} is
-an RTX for the address of the nested function; @var{static_chain} is an
-RTX for the static chain value that should be passed to the function
-when it is called.
-
-@findex ALLOCATE_TRAMPOLINE
-@item ALLOCATE_TRAMPOLINE (@var{fp})
-A C expression to allocate run-time space for a trampoline. The
-expression value should be an RTX representing a memory reference to the
-space for the trampoline.
-
-@cindex @code{FUNCTION_EPILOGUE} and trampolines
-@cindex @code{FUNCTION_PROLOGUE} and trampolines
-If this macro is not defined, by default the trampoline is allocated as
-a stack slot. This default is right for most machines. The exceptions
-are machines where it is impossible to execute instructions in the stack
-area. On such machines, you may have to implement a separate stack,
-using this macro in conjunction with @code{FUNCTION_PROLOGUE} and
-@code{FUNCTION_EPILOGUE}.
-
-@var{fp} points to a data structure, a @code{struct function}, which
-describes the compilation status of the immediate containing function of
-the function which the trampoline is for. Normally (when
-@code{ALLOCATE_TRAMPOLINE} is not defined), the stack slot for the
-trampoline is in the stack frame of this containing function. Other
-allocation strategies probably must do something analogous with this
-information.
-@end table
-
-Implementing trampolines is difficult on many machines because they have
-separate instruction and data caches. Writing into a stack location
-fails to clear the memory in the instruction cache, so when the program
-jumps to that location, it executes the old contents.
-
-Here are two possible solutions. One is to clear the relevant parts of
-the instruction cache whenever a trampoline is set up. The other is to
-make all trampolines identical, by having them jump to a standard
-subroutine. The former technique makes trampoline execution faster; the
-latter makes initialization faster.
-
-To clear the instruction cache when a trampoline is initialized, define
-the following macros which describe the shape of the cache.
-
-@table @code
-@findex INSN_CACHE_SIZE
-@item INSN_CACHE_SIZE
-The total size in bytes of the cache.
-
-@findex INSN_CACHE_LINE_WIDTH
-@item INSN_CACHE_LINE_WIDTH
-The length in bytes of each cache line. The cache is divided into cache
-lines which are disjoint slots, each holding a contiguous chunk of data
-fetched from memory. Each time data is brought into the cache, an
-entire line is read at once. The data loaded into a cache line is
-always aligned on a boundary equal to the line size.
-
-@findex INSN_CACHE_DEPTH
-@item INSN_CACHE_DEPTH
-The number of alternative cache lines that can hold any particular memory
-location.
-@end table
-
-Alternatively, if the machine has system calls or instructions to clear
-the instruction cache directly, you can define the following macro.
-
-@table @code
-@findex CLEAR_INSN_CACHE
-@item CLEAR_INSN_CACHE (@var{BEG}, @var{END})
-If defined, expands to a C expression clearing the @emph{instruction
-cache} in the specified interval. If it is not defined, and the macro
-INSN_CACHE_SIZE is defined, some generic code is generated to clear the
-cache. The definition of this macro would typically be a series of
-@code{asm} statements. Both @var{BEG} and @var{END} are both pointer
-expressions.
-@end table
-
-To use a standard subroutine, define the following macro. In addition,
-you must make sure that the instructions in a trampoline fill an entire
-cache line with identical instructions, or else ensure that the
-beginning of the trampoline code is always aligned at the same point in
-its cache line. Look in @file{m68k.h} as a guide.
-
-@table @code
-@findex TRANSFER_FROM_TRAMPOLINE
-@item TRANSFER_FROM_TRAMPOLINE
-Define this macro if trampolines need a special subroutine to do their
-work. The macro should expand to a series of @code{asm} statements
-which will be compiled with GNU CC. They go in a library function named
-@code{__transfer_from_trampoline}.
-
-If you need to avoid executing the ordinary prologue code of a compiled
-C function when you jump to the subroutine, you can do so by placing a
-special label of your own in the assembler code. Use one @code{asm}
-statement to generate an assembler label, and another to make the label
-global. Then trampolines can use that label to jump directly to your
-special assembler code.
-@end table
-
-@node Library Calls
-@section Implicit Calls to Library Routines
-@cindex library subroutine names
-@cindex @file{libgcc.a}
-
-@c prevent bad page break with this line
-Here is an explanation of implicit calls to library routines.
-
-@table @code
-@findex MULSI3_LIBCALL
-@item MULSI3_LIBCALL
-A C string constant giving the name of the function to call for
-multiplication of one signed full-word by another. If you do not
-define this macro, the default name is used, which is @code{__mulsi3},
-a function defined in @file{libgcc.a}.
-
-@findex DIVSI3_LIBCALL
-@item DIVSI3_LIBCALL
-A C string constant giving the name of the function to call for
-division of one signed full-word by another. If you do not define
-this macro, the default name is used, which is @code{__divsi3}, a
-function defined in @file{libgcc.a}.
-
-@findex UDIVSI3_LIBCALL
-@item UDIVSI3_LIBCALL
-A C string constant giving the name of the function to call for
-division of one unsigned full-word by another. If you do not define
-this macro, the default name is used, which is @code{__udivsi3}, a
-function defined in @file{libgcc.a}.
-
-@findex MODSI3_LIBCALL
-@item MODSI3_LIBCALL
-A C string constant giving the name of the function to call for the
-remainder in division of one signed full-word by another. If you do
-not define this macro, the default name is used, which is
-@code{__modsi3}, a function defined in @file{libgcc.a}.
-
-@findex UMODSI3_LIBCALL
-@item UMODSI3_LIBCALL
-A C string constant giving the name of the function to call for the
-remainder in division of one unsigned full-word by another. If you do
-not define this macro, the default name is used, which is
-@code{__umodsi3}, a function defined in @file{libgcc.a}.
-
-@findex MULDI3_LIBCALL
-@item MULDI3_LIBCALL
-A C string constant giving the name of the function to call for
-multiplication of one signed double-word by another. If you do not
-define this macro, the default name is used, which is @code{__muldi3},
-a function defined in @file{libgcc.a}.
-
-@findex DIVDI3_LIBCALL
-@item DIVDI3_LIBCALL
-A C string constant giving the name of the function to call for
-division of one signed double-word by another. If you do not define
-this macro, the default name is used, which is @code{__divdi3}, a
-function defined in @file{libgcc.a}.
-
-@findex UDIVDI3_LIBCALL
-@item UDIVDI3_LIBCALL
-A C string constant giving the name of the function to call for
-division of one unsigned full-word by another. If you do not define
-this macro, the default name is used, which is @code{__udivdi3}, a
-function defined in @file{libgcc.a}.
-
-@findex MODDI3_LIBCALL
-@item MODDI3_LIBCALL
-A C string constant giving the name of the function to call for the
-remainder in division of one signed double-word by another. If you do
-not define this macro, the default name is used, which is
-@code{__moddi3}, a function defined in @file{libgcc.a}.
-
-@findex UMODDI3_LIBCALL
-@item UMODDI3_LIBCALL
-A C string constant giving the name of the function to call for the
-remainder in division of one unsigned full-word by another. If you do
-not define this macro, the default name is used, which is
-@code{__umoddi3}, a function defined in @file{libgcc.a}.
-
-@findex INIT_TARGET_OPTABS
-@item INIT_TARGET_OPTABS
-Define this macro as a C statement that declares additional library
-routines renames existing ones. @code{init_optabs} calls this macro after
-initializing all the normal library routines.
-
-@findex TARGET_EDOM
-@cindex @code{EDOM}, implicit usage
-@item TARGET_EDOM
-The value of @code{EDOM} on the target machine, as a C integer constant
-expression. If you don't define this macro, GNU CC does not attempt to
-deposit the value of @code{EDOM} into @code{errno} directly. Look in
-@file{/usr/include/errno.h} to find the value of @code{EDOM} on your
-system.
-
-If you do not define @code{TARGET_EDOM}, then compiled code reports
-domain errors by calling the library function and letting it report the
-error. If mathematical functions on your system use @code{matherr} when
-there is an error, then you should leave @code{TARGET_EDOM} undefined so
-that @code{matherr} is used normally.
-
-@findex GEN_ERRNO_RTX
-@cindex @code{errno}, implicit usage
-@item GEN_ERRNO_RTX
-Define this macro as a C expression to create an rtl expression that
-refers to the global ``variable'' @code{errno}. (On certain systems,
-@code{errno} may not actually be a variable.) If you don't define this
-macro, a reasonable default is used.
-
-@findex TARGET_MEM_FUNCTIONS
-@cindex @code{bcopy}, implicit usage
-@cindex @code{memcpy}, implicit usage
-@cindex @code{bzero}, implicit usage
-@cindex @code{memset}, implicit usage
-@item TARGET_MEM_FUNCTIONS
-Define this macro if GNU CC should generate calls to the System V
-(and ANSI C) library functions @code{memcpy} and @code{memset}
-rather than the BSD functions @code{bcopy} and @code{bzero}.
-
-@findex LIBGCC_NEEDS_DOUBLE
-@item LIBGCC_NEEDS_DOUBLE
-Define this macro if only @code{float} arguments cannot be passed to
-library routines (so they must be converted to @code{double}). This
-macro affects both how library calls are generated and how the library
-routines in @file{libgcc1.c} accept their arguments. It is useful on
-machines where floating and fixed point arguments are passed
-differently, such as the i860.
-
-@findex FLOAT_ARG_TYPE
-@item FLOAT_ARG_TYPE
-Define this macro to override the type used by the library routines to
-pick up arguments of type @code{float}. (By default, they use a union
-of @code{float} and @code{int}.)
-
-The obvious choice would be @code{float}---but that won't work with
-traditional C compilers that expect all arguments declared as @code{float}
-to arrive as @code{double}. To avoid this conversion, the library routines
-ask for the value as some other type and then treat it as a @code{float}.
-
-On some systems, no other type will work for this. For these systems,
-you must use @code{LIBGCC_NEEDS_DOUBLE} instead, to force conversion of
-the values @code{double} before they are passed.
-
-@findex FLOATIFY
-@item FLOATIFY (@var{passed-value})
-Define this macro to override the way library routines redesignate a
-@code{float} argument as a @code{float} instead of the type it was
-passed as. The default is an expression which takes the @code{float}
-field of the union.
-
-@findex FLOAT_VALUE_TYPE
-@item FLOAT_VALUE_TYPE
-Define this macro to override the type used by the library routines to
-return values that ought to have type @code{float}. (By default, they
-use @code{int}.)
-
-The obvious choice would be @code{float}---but that won't work with
-traditional C compilers gratuitously convert values declared as
-@code{float} into @code{double}.
-
-@findex INTIFY
-@item INTIFY (@var{float-value})
-Define this macro to override the way the value of a
-@code{float}-returning library routine should be packaged in order to
-return it. These functions are actually declared to return type
-@code{FLOAT_VALUE_TYPE} (normally @code{int}).
-
-These values can't be returned as type @code{float} because traditional
-C compilers would gratuitously convert the value to a @code{double}.
-
-A local variable named @code{intify} is always available when the macro
-@code{INTIFY} is used. It is a union of a @code{float} field named
-@code{f} and a field named @code{i} whose type is
-@code{FLOAT_VALUE_TYPE} or @code{int}.
-
-If you don't define this macro, the default definition works by copying
-the value through that union.
-
-@findex nongcc_SI_type
-@item nongcc_SI_type
-Define this macro as the name of the data type corresponding to
-@code{SImode} in the system's own C compiler.
-
-You need not define this macro if that type is @code{long int}, as it usually
-is.
-
-@findex nongcc_word_type
-@item nongcc_word_type
-Define this macro as the name of the data type corresponding to the
-word_mode in the system's own C compiler.
-
-You need not define this macro if that type is @code{long int}, as it usually
-is.
-
-@findex perform_@dots{}
-@item perform_@dots{}
-Define these macros to supply explicit C statements to carry out various
-arithmetic operations on types @code{float} and @code{double} in the
-library routines in @file{libgcc1.c}. See that file for a full list
-of these macros and their arguments.
-
-On most machines, you don't need to define any of these macros, because
-the C compiler that comes with the system takes care of doing them.
-
-@findex NEXT_OBJC_RUNTIME
-@item NEXT_OBJC_RUNTIME
-Define this macro to generate code for Objective C message sending using
-the calling convention of the NeXT system. This calling convention
-involves passing the object, the selector and the method arguments all
-at once to the method-lookup library function.
-
-The default calling convention passes just the object and the selector
-to the lookup function, which returns a pointer to the method.
-@end table
-
-@node Addressing Modes
-@section Addressing Modes
-@cindex addressing modes
-
-@c prevent bad page break with this line
-This is about addressing modes.
-
-@table @code
-@findex HAVE_POST_INCREMENT
-@item HAVE_POST_INCREMENT
-A C expression that is nonzero the machine supports post-increment addressing.
-
-@findex HAVE_PRE_INCREMENT
-@findex HAVE_POST_DECREMENT
-@findex HAVE_PRE_DECREMENT
-@item HAVE_PRE_INCREMENT
-@itemx HAVE_POST_DECREMENT
-@itemx HAVE_PRE_DECREMENT
-Similar for other kinds of addressing.
-
-@findex CONSTANT_ADDRESS_P
-@item CONSTANT_ADDRESS_P (@var{x})
-A C expression that is 1 if the RTX @var{x} is a constant which
-is a valid address. On most machines, this can be defined as
-@code{CONSTANT_P (@var{x})}, but a few machines are more restrictive
-in which constant addresses are supported.
-
-@findex CONSTANT_P
-@code{CONSTANT_P} accepts integer-values expressions whose values are
-not explicitly known, such as @code{symbol_ref}, @code{label_ref}, and
-@code{high} expressions and @code{const} arithmetic expressions, in
-addition to @code{const_int} and @code{const_double} expressions.
-
-@findex MAX_REGS_PER_ADDRESS
-@item MAX_REGS_PER_ADDRESS
-A number, the maximum number of registers that can appear in a valid
-memory address. Note that it is up to you to specify a value equal to
-the maximum number that @code{GO_IF_LEGITIMATE_ADDRESS} would ever
-accept.
-
-@findex GO_IF_LEGITIMATE_ADDRESS
-@item GO_IF_LEGITIMATE_ADDRESS (@var{mode}, @var{x}, @var{label})
-A C compound statement with a conditional @code{goto @var{label};}
-executed if @var{x} (an RTX) is a legitimate memory address on the
-target machine for a memory operand of mode @var{mode}.
-
-It usually pays to define several simpler macros to serve as
-subroutines for this one. Otherwise it may be too complicated to
-understand.
-
-This macro must exist in two variants: a strict variant and a
-non-strict one. The strict variant is used in the reload pass. It
-must be defined so that any pseudo-register that has not been
-allocated a hard register is considered a memory reference. In
-contexts where some kind of register is required, a pseudo-register
-with no hard register must be rejected.
-
-The non-strict variant is used in other passes. It must be defined to
-accept all pseudo-registers in every context where some kind of
-register is required.
-
-@findex REG_OK_STRICT
-Compiler source files that want to use the strict variant of this
-macro define the macro @code{REG_OK_STRICT}. You should use an
-@code{#ifdef REG_OK_STRICT} conditional to define the strict variant
-in that case and the non-strict variant otherwise.
-
-Subroutines to check for acceptable registers for various purposes (one
-for base registers, one for index registers, and so on) are typically
-among the subroutines used to define @code{GO_IF_LEGITIMATE_ADDRESS}.
-Then only these subroutine macros need have two variants; the higher
-levels of macros may be the same whether strict or not.@refill
-
-Normally, constant addresses which are the sum of a @code{symbol_ref}
-and an integer are stored inside a @code{const} RTX to mark them as
-constant. Therefore, there is no need to recognize such sums
-specifically as legitimate addresses. Normally you would simply
-recognize any @code{const} as legitimate.
-
-Usually @code{PRINT_OPERAND_ADDRESS} is not prepared to handle constant
-sums that are not marked with @code{const}. It assumes that a naked
-@code{plus} indicates indexing. If so, then you @emph{must} reject such
-naked constant sums as illegitimate addresses, so that none of them will
-be given to @code{PRINT_OPERAND_ADDRESS}.
-
-@cindex @code{ENCODE_SECTION_INFO} and address validation
-On some machines, whether a symbolic address is legitimate depends on
-the section that the address refers to. On these machines, define the
-macro @code{ENCODE_SECTION_INFO} to store the information into the
-@code{symbol_ref}, and then check for it here. When you see a
-@code{const}, you will have to look inside it to find the
-@code{symbol_ref} in order to determine the section. @xref{Assembler
-Format}.
-
-@findex saveable_obstack
-The best way to modify the name string is by adding text to the
-beginning, with suitable punctuation to prevent any ambiguity. Allocate
-the new name in @code{saveable_obstack}. You will have to modify
-@code{ASM_OUTPUT_LABELREF} to remove and decode the added text and
-output the name accordingly, and define @code{STRIP_NAME_ENCODING} to
-access the original name string.
-
-You can check the information stored here into the @code{symbol_ref} in
-the definitions of the macros @code{GO_IF_LEGITIMATE_ADDRESS} and
-@code{PRINT_OPERAND_ADDRESS}.
-
-@findex REG_OK_FOR_BASE_P
-@item REG_OK_FOR_BASE_P (@var{x})
-A C expression that is nonzero if @var{x} (assumed to be a @code{reg}
-RTX) is valid for use as a base register. For hard registers, it
-should always accept those which the hardware permits and reject the
-others. Whether the macro accepts or rejects pseudo registers must be
-controlled by @code{REG_OK_STRICT} as described above. This usually
-requires two variant definitions, of which @code{REG_OK_STRICT}
-controls the one actually used.
-
-@findex REG_MODE_OK_FOR_BASE_P
-@item REG_MODE_OK_FOR_BASE_P (@var{x}, @var{mode})
-A C expression that is just like @code{REG_OK_FOR_BASE_P}, except that
-that expression may examine the mode of the memory reference in
-@var{mode}. You should define this macro if the mode of the memory
-reference affects whether a register may be used as a base register. If
-you define this macro, the compiler will use it instead of
-@code{REG_OK_FOR_BASE_P}.
-
-@findex REG_OK_FOR_INDEX_P
-@item REG_OK_FOR_INDEX_P (@var{x})
-A C expression that is nonzero if @var{x} (assumed to be a @code{reg}
-RTX) is valid for use as an index register.
-
-The difference between an index register and a base register is that
-the index register may be scaled. If an address involves the sum of
-two registers, neither one of them scaled, then either one may be
-labeled the ``base'' and the other the ``index''; but whichever
-labeling is used must fit the machine's constraints of which registers
-may serve in each capacity. The compiler will try both labelings,
-looking for one that is valid, and will reload one or both registers
-only if neither labeling works.
-
-@findex LEGITIMIZE_ADDRESS
-@item LEGITIMIZE_ADDRESS (@var{x}, @var{oldx}, @var{mode}, @var{win})
-A C compound statement that attempts to replace @var{x} with a valid
-memory address for an operand of mode @var{mode}. @var{win} will be a
-C statement label elsewhere in the code; the macro definition may use
-
-@example
-GO_IF_LEGITIMATE_ADDRESS (@var{mode}, @var{x}, @var{win});
-@end example
-
-@noindent
-to avoid further processing if the address has become legitimate.
-
-@findex break_out_memory_refs
-@var{x} will always be the result of a call to @code{break_out_memory_refs},
-and @var{oldx} will be the operand that was given to that function to produce
-@var{x}.
-
-The code generated by this macro should not alter the substructure of
-@var{x}. If it transforms @var{x} into a more legitimate form, it
-should assign @var{x} (which will always be a C variable) a new value.
-
-It is not necessary for this macro to come up with a legitimate
-address. The compiler has standard ways of doing so in all cases. In
-fact, it is safe for this macro to do nothing. But often a
-machine-dependent strategy can generate better code.
-
-@findex LEGITIMIZE_RELOAD_ADDRESS
-@item LEGITIMIZE_RELOAD_ADDRESS (@var{x}, @var{mode}, @var{opnum}, @var{type}, @var{ind_levels}, @var{win})
-A C compound statement that attempts to replace @var{x}, which is an address
-that needs reloading, with a valid memory address for an operand of mode
-@var{mode}. @var{win} will be a C statement label elsewhere in the code.
-It is not necessary to define this macro, but it might be useful for
-performance reasons.
-
-For example, on the i386, it is sometimes possible to use a single
-reload register instead of two by reloading a sum of two pseudo
-registers into a register. On the other hand, for number of RISC
-processors offsets are limited so that often an intermediate address
-needs to be generated in order to address a stack slot. By defining
-LEGITIMIZE_RELOAD_ADDRESS appropriately, the intermediate addresses
-generated for adjacent some stack slots can be made identical, and thus
-be shared.
-
-@emph{Note}: This macro should be used with caution. It is necessary
-to know something of how reload works in order to effectively use this,
-and it is quite easy to produce macros that build in too much knowledge
-of reload internals.
-
-@emph{Note}: This macro must be able to reload an address created by a
-previous invocation of this macro. If it fails to handle such addresses
-then the compiler may generate incorrect code or abort.
-
-@findex push_reload
-The macro definition should use @code{push_reload} to indicate parts that
-need reloading; @var{opnum}, @var{type} and @var{ind_levels} are usually
-suitable to be passed unaltered to @code{push_reload}.
-
-The code generated by this macro must not alter the substructure of
-@var{x}. If it transforms @var{x} into a more legitimate form, it
-should assign @var{x} (which will always be a C variable) a new value.
-This also applies to parts that you change indirectly by calling
-@code{push_reload}.
-
-@findex strict_memory_address_p
-The macro definition may use @code{strict_memory_address_p} to test if
-the address has become legitimate.
-
-@findex copy_rtx
-If you want to change only a part of @var{x}, one standard way of doing
-this is to use @code{copy_rtx}. Note, however, that is unshares only a
-single level of rtl. Thus, if the part to be changed is not at the
-top level, you'll need to replace first the top leve
-It is not necessary for this macro to come up with a legitimate
-address; but often a machine-dependent strategy can generate better code.
-
-@findex GO_IF_MODE_DEPENDENT_ADDRESS
-@item GO_IF_MODE_DEPENDENT_ADDRESS (@var{addr}, @var{label})
-A C statement or compound statement with a conditional @code{goto
-@var{label};} executed if memory address @var{x} (an RTX) can have
-different meanings depending on the machine mode of the memory
-reference it is used for or if the address is valid for some modes
-but not others.
-
-Autoincrement and autodecrement addresses typically have mode-dependent
-effects because the amount of the increment or decrement is the size
-of the operand being addressed. Some machines have other mode-dependent
-addresses. Many RISC machines have no mode-dependent addresses.
-
-You may assume that @var{addr} is a valid address for the machine.
-
-@findex LEGITIMATE_CONSTANT_P
-@item LEGITIMATE_CONSTANT_P (@var{x})
-A C expression that is nonzero if @var{x} is a legitimate constant for
-an immediate operand on the target machine. You can assume that
-@var{x} satisfies @code{CONSTANT_P}, so you need not check this. In fact,
-@samp{1} is a suitable definition for this macro on machines where
-anything @code{CONSTANT_P} is valid.@refill
-@end table
-
-@node Condition Code
-@section Condition Code Status
-@cindex condition code status
-
-@c prevent bad page break with this line
-This describes the condition code status.
-
-@findex cc_status
-The file @file{conditions.h} defines a variable @code{cc_status} to
-describe how the condition code was computed (in case the interpretation of
-the condition code depends on the instruction that it was set by). This
-variable contains the RTL expressions on which the condition code is
-currently based, and several standard flags.
-
-Sometimes additional machine-specific flags must be defined in the machine
-description header file. It can also add additional machine-specific
-information by defining @code{CC_STATUS_MDEP}.
-
-@table @code
-@findex CC_STATUS_MDEP
-@item CC_STATUS_MDEP
-C code for a data type which is used for declaring the @code{mdep}
-component of @code{cc_status}. It defaults to @code{int}.
-
-This macro is not used on machines that do not use @code{cc0}.
-
-@findex CC_STATUS_MDEP_INIT
-@item CC_STATUS_MDEP_INIT
-A C expression to initialize the @code{mdep} field to ``empty''.
-The default definition does nothing, since most machines don't use
-the field anyway. If you want to use the field, you should probably
-define this macro to initialize it.
-
-This macro is not used on machines that do not use @code{cc0}.
-
-@findex NOTICE_UPDATE_CC
-@item NOTICE_UPDATE_CC (@var{exp}, @var{insn})
-A C compound statement to set the components of @code{cc_status}
-appropriately for an insn @var{insn} whose body is @var{exp}. It is
-this macro's responsibility to recognize insns that set the condition
-code as a byproduct of other activity as well as those that explicitly
-set @code{(cc0)}.
-
-This macro is not used on machines that do not use @code{cc0}.
-
-If there are insns that do not set the condition code but do alter
-other machine registers, this macro must check to see whether they
-invalidate the expressions that the condition code is recorded as
-reflecting. For example, on the 68000, insns that store in address
-registers do not set the condition code, which means that usually
-@code{NOTICE_UPDATE_CC} can leave @code{cc_status} unaltered for such
-insns. But suppose that the previous insn set the condition code
-based on location @samp{a4@@(102)} and the current insn stores a new
-value in @samp{a4}. Although the condition code is not changed by
-this, it will no longer be true that it reflects the contents of
-@samp{a4@@(102)}. Therefore, @code{NOTICE_UPDATE_CC} must alter
-@code{cc_status} in this case to say that nothing is known about the
-condition code value.
-
-The definition of @code{NOTICE_UPDATE_CC} must be prepared to deal
-with the results of peephole optimization: insns whose patterns are
-@code{parallel} RTXs containing various @code{reg}, @code{mem} or
-constants which are just the operands. The RTL structure of these
-insns is not sufficient to indicate what the insns actually do. What
-@code{NOTICE_UPDATE_CC} should do when it sees one is just to run
-@code{CC_STATUS_INIT}.
-
-A possible definition of @code{NOTICE_UPDATE_CC} is to call a function
-that looks at an attribute (@pxref{Insn Attributes}) named, for example,
-@samp{cc}. This avoids having detailed information about patterns in
-two places, the @file{md} file and in @code{NOTICE_UPDATE_CC}.
-
-@findex EXTRA_CC_MODES
-@item EXTRA_CC_MODES
-A list of names to be used for additional modes for condition code
-values in registers (@pxref{Jump Patterns}). These names are added
-to @code{enum machine_mode} and all have class @code{MODE_CC}. By
-convention, they should start with @samp{CC} and end with @samp{mode}.
-
-You should only define this macro if your machine does not use @code{cc0}
-and only if additional modes are required.
-
-@findex EXTRA_CC_NAMES
-@item EXTRA_CC_NAMES
-A list of C strings giving the names for the modes listed in
-@code{EXTRA_CC_MODES}. For example, the Sparc defines this macro and
-@code{EXTRA_CC_MODES} as
-
-@smallexample
-#define EXTRA_CC_MODES CC_NOOVmode, CCFPmode, CCFPEmode
-#define EXTRA_CC_NAMES "CC_NOOV", "CCFP", "CCFPE"
-@end smallexample
-
-This macro is not required if @code{EXTRA_CC_MODES} is not defined.
-
-@findex SELECT_CC_MODE
-@item SELECT_CC_MODE (@var{op}, @var{x}, @var{y})
-Returns a mode from class @code{MODE_CC} to be used when comparison
-operation code @var{op} is applied to rtx @var{x} and @var{y}. For
-example, on the Sparc, @code{SELECT_CC_MODE} is defined as (see
-@pxref{Jump Patterns} for a description of the reason for this
-definition)
-
-@smallexample
-#define SELECT_CC_MODE(OP,X,Y) \
- (GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT \
- ? ((OP == EQ || OP == NE) ? CCFPmode : CCFPEmode) \
- : ((GET_CODE (X) == PLUS || GET_CODE (X) == MINUS \
- || GET_CODE (X) == NEG) \
- ? CC_NOOVmode : CCmode))
-@end smallexample
-
-You need not define this macro if @code{EXTRA_CC_MODES} is not defined.
-
-@findex CANONICALIZE_COMPARISON
-@item CANONICALIZE_COMPARISON (@var{code}, @var{op0}, @var{op1})
-One some machines not all possible comparisons are defined, but you can
-convert an invalid comparison into a valid one. For example, the Alpha
-does not have a @code{GT} comparison, but you can use an @code{LT}
-comparison instead and swap the order of the operands.
-
-On such machines, define this macro to be a C statement to do any
-required conversions. @var{code} is the initial comparison code
-and @var{op0} and @var{op1} are the left and right operands of the
-comparison, respectively. You should modify @var{code}, @var{op0}, and
-@var{op1} as required.
-
-GNU CC will not assume that the comparison resulting from this macro is
-valid but will see if the resulting insn matches a pattern in the
-@file{md} file.
-
-You need not define this macro if it would never change the comparison
-code or operands.
-
-@findex REVERSIBLE_CC_MODE
-@item REVERSIBLE_CC_MODE (@var{mode})
-A C expression whose value is one if it is always safe to reverse a
-comparison whose mode is @var{mode}. If @code{SELECT_CC_MODE}
-can ever return @var{mode} for a floating-point inequality comparison,
-then @code{REVERSIBLE_CC_MODE (@var{mode})} must be zero.
-
-You need not define this macro if it would always returns zero or if the
-floating-point format is anything other than @code{IEEE_FLOAT_FORMAT}.
-For example, here is the definition used on the Sparc, where floating-point
-inequality comparisons are always given @code{CCFPEmode}:
-
-@smallexample
-#define REVERSIBLE_CC_MODE(MODE) ((MODE) != CCFPEmode)
-@end smallexample
-
-@end table
-
-@node Costs
-@section Describing Relative Costs of Operations
-@cindex costs of instructions
-@cindex relative costs
-@cindex speed of instructions
-
-These macros let you describe the relative speed of various operations
-on the target machine.
-
-@table @code
-@findex CONST_COSTS
-@item CONST_COSTS (@var{x}, @var{code}, @var{outer_code})
-A part of a C @code{switch} statement that describes the relative costs
-of constant RTL expressions. It must contain @code{case} labels for
-expression codes @code{const_int}, @code{const}, @code{symbol_ref},
-@code{label_ref} and @code{const_double}. Each case must ultimately
-reach a @code{return} statement to return the relative cost of the use
-of that kind of constant value in an expression. The cost may depend on
-the precise value of the constant, which is available for examination in
-@var{x}, and the rtx code of the expression in which it is contained,
-found in @var{outer_code}.
-
-@var{code} is the expression code---redundant, since it can be
-obtained with @code{GET_CODE (@var{x})}.
-
-@findex RTX_COSTS
-@findex COSTS_N_INSNS
-@item RTX_COSTS (@var{x}, @var{code}, @var{outer_code})
-Like @code{CONST_COSTS} but applies to nonconstant RTL expressions.
-This can be used, for example, to indicate how costly a multiply
-instruction is. In writing this macro, you can use the construct
-@code{COSTS_N_INSNS (@var{n})} to specify a cost equal to @var{n} fast
-instructions. @var{outer_code} is the code of the expression in which
-@var{x} is contained.
-
-This macro is optional; do not define it if the default cost assumptions
-are adequate for the target machine.
-
-@findex DEFAULT_RTX_COSTS
-@item DEFAULT_RTX_COSTS (@var{x}, @var{code}, @var{outer_code})
-This macro, if defined, is called for any case not handled by the
-@code{RTX_COSTS} or @code{CONST_COSTS} macros. This eliminates the need
-to put case labels into the macro, but the code, or any functions it
-calls, must assume that the RTL in @var{x} could be of any type that has
-not already been handled. The arguments are the same as for
-@code{RTX_COSTS}, and the macro should execute a return statement giving
-the cost of any RTL expressions that it can handle. The default cost
-calculation is used for any RTL for which this macro does not return a
-value.
-
-This macro is optional; do not define it if the default cost assumptions
-are adequate for the target machine.
-
-@findex ADDRESS_COST
-@item ADDRESS_COST (@var{address})
-An expression giving the cost of an addressing mode that contains
-@var{address}. If not defined, the cost is computed from
-the @var{address} expression and the @code{CONST_COSTS} values.
-
-For most CISC machines, the default cost is a good approximation of the
-true cost of the addressing mode. However, on RISC machines, all
-instructions normally have the same length and execution time. Hence
-all addresses will have equal costs.
-
-In cases where more than one form of an address is known, the form with
-the lowest cost will be used. If multiple forms have the same, lowest,
-cost, the one that is the most complex will be used.
-
-For example, suppose an address that is equal to the sum of a register
-and a constant is used twice in the same basic block. When this macro
-is not defined, the address will be computed in a register and memory
-references will be indirect through that register. On machines where
-the cost of the addressing mode containing the sum is no higher than
-that of a simple indirect reference, this will produce an additional
-instruction and possibly require an additional register. Proper
-specification of this macro eliminates this overhead for such machines.
-
-Similar use of this macro is made in strength reduction of loops.
-
-@var{address} need not be valid as an address. In such a case, the cost
-is not relevant and can be any value; invalid addresses need not be
-assigned a different cost.
-
-On machines where an address involving more than one register is as
-cheap as an address computation involving only one register, defining
-@code{ADDRESS_COST} to reflect this can cause two registers to be live
-over a region of code where only one would have been if
-@code{ADDRESS_COST} were not defined in that manner. This effect should
-be considered in the definition of this macro. Equivalent costs should
-probably only be given to addresses with different numbers of registers
-on machines with lots of registers.
-
-This macro will normally either not be defined or be defined as a
-constant.
-
-@findex REGISTER_MOVE_COST
-@item REGISTER_MOVE_COST (@var{from}, @var{to})
-A C expression for the cost of moving data from a register in class
-@var{from} to one in class @var{to}. The classes are expressed using
-the enumeration values such as @code{GENERAL_REGS}. A value of 2 is the
-default; other values are interpreted relative to that.
-
-It is not required that the cost always equal 2 when @var{from} is the
-same as @var{to}; on some machines it is expensive to move between
-registers if they are not general registers.
-
-If reload sees an insn consisting of a single @code{set} between two
-hard registers, and if @code{REGISTER_MOVE_COST} applied to their
-classes returns a value of 2, reload does not check to ensure that the
-constraints of the insn are met. Setting a cost of other than 2 will
-allow reload to verify that the constraints are met. You should do this
-if the @samp{mov@var{m}} pattern's constraints do not allow such copying.
-
-@findex MEMORY_MOVE_COST
-@item MEMORY_MOVE_COST (@var{mode}, @var{class}, @var{in})
-A C expression for the cost of moving data of mode @var{mode} between a
-register of class @var{class} and memory; @var{in} is zero if the value
-is to be written to memory, non-zero if it is to be read in. This cost
-is relative to those in @code{REGISTER_MOVE_COST}. If moving between
-registers and memory is more expensive than between two registers, you
-should define this macro to express the relative cost.
-
-If you do not define this macro, GNU CC uses a default cost of 4 plus
-the cost of copying via a secondary reload register, if one is
-needed. If your machine requires a secondary reload register to copy
-between memory and a register of @var{class} but the reload mechanism is
-more complex than copying via an intermediate, define this macro to
-reflect the actual cost of the move.
-
-GNU CC defines the function @code{memory_move_secondary_cost} if
-secondary reloads are needed. It computes the costs due to copying via
-a secondary register. If your machine copies from memory using a
-secondary register in the conventional way but the default base value of
-4 is not correct for your machine, define this macro to add some other
-value to the result of that function. The arguments to that function
-are the same as to this macro.
-
-@findex BRANCH_COST
-@item BRANCH_COST
-A C expression for the cost of a branch instruction. A value of 1 is
-the default; other values are interpreted relative to that.
-@end table
-
-Here are additional macros which do not specify precise relative costs,
-but only that certain actions are more expensive than GNU CC would
-ordinarily expect.
-
-@table @code
-@findex SLOW_BYTE_ACCESS
-@item SLOW_BYTE_ACCESS
-Define this macro as a C expression which is nonzero if accessing less
-than a word of memory (i.e. a @code{char} or a @code{short}) is no
-faster than accessing a word of memory, i.e., if such access
-require more than one instruction or if there is no difference in cost
-between byte and (aligned) word loads.
-
-When this macro is not defined, the compiler will access a field by
-finding the smallest containing object; when it is defined, a fullword
-load will be used if alignment permits. Unless bytes accesses are
-faster than word accesses, using word accesses is preferable since it
-may eliminate subsequent memory access if subsequent accesses occur to
-other fields in the same word of the structure, but to different bytes.
-
-@findex SLOW_ZERO_EXTEND
-@item SLOW_ZERO_EXTEND
-Define this macro if zero-extension (of a @code{char} or @code{short}
-to an @code{int}) can be done faster if the destination is a register
-that is known to be zero.
-
-If you define this macro, you must have instruction patterns that
-recognize RTL structures like this:
-
-@smallexample
-(set (strict_low_part (subreg:QI (reg:SI @dots{}) 0)) @dots{})
-@end smallexample
-
-@noindent
-and likewise for @code{HImode}.
-
-@findex SLOW_UNALIGNED_ACCESS
-@item SLOW_UNALIGNED_ACCESS
-Define this macro to be the value 1 if unaligned accesses have a cost
-many times greater than aligned accesses, for example if they are
-emulated in a trap handler.
-
-When this macro is non-zero, the compiler will act as if
-@code{STRICT_ALIGNMENT} were non-zero when generating code for block
-moves. This can cause significantly more instructions to be produced.
-Therefore, do not set this macro non-zero if unaligned accesses only add a
-cycle or two to the time for a memory access.
-
-If the value of this macro is always zero, it need not be defined.
-
-@findex DONT_REDUCE_ADDR
-@item DONT_REDUCE_ADDR
-Define this macro to inhibit strength reduction of memory addresses.
-(On some machines, such strength reduction seems to do harm rather
-than good.)
-
-@findex MOVE_RATIO
-@item MOVE_RATIO
-The threshold of number of scalar memory-to-memory move insns, @emph{below}
-which a sequence of insns should be generated instead of a
-string move insn or a library call. Increasing the value will always
-make code faster, but eventually incurs high cost in increased code size.
-
-Note that on machines with no memory-to-memory move insns, this macro denotes
-the corresponding number of memory-to-memory @emph{sequences}.
-
-If you don't define this, a reasonable default is used.
-
-@findex MOVE_BY_PIECES_P
-@item MOVE_BY_PIECES_P (@var{size}, @var{alignment})
-A C expression used to determine whether @code{move_by_pieces} will be used to
-copy a chunk of memory, or whether some other block move mechanism
-will be used. Defaults to 1 if @code{move_by_pieces_ninsns} returns less
-than @code{MOVE_RATIO}.
-
-@findex MOVE_MAX_PIECES
-@item MOVE_MAX_PIECES
-A C expression used by @code{move_by_pieces} to determine the largest unit
-a load or store used to copy memory is. Defaults to @code{MOVE_MAX}.
-
-@findex USE_LOAD_POST_INCREMENT
-@item USE_LOAD_POST_INCREMENT (@var{mode})
-A C expression used to determine whether a load postincrement is a good
-thing to use for a given mode. Defaults to the value of
-@code{HAVE_POST_INCREMENT}.
-
-@findex USE_LOAD_POST_DECREMENT
-@item USE_LOAD_POST_DECREMENT (@var{mode})
-A C expression used to determine whether a load postdecrement is a good
-thing to use for a given mode. Defaults to the value of
-@code{HAVE_POST_DECREMENT}.
-
-@findex USE_LOAD_PRE_INCREMENT
-@item USE_LOAD_PRE_INCREMENT (@var{mode})
-A C expression used to determine whether a load preincrement is a good
-thing to use for a given mode. Defaults to the value of
-@code{HAVE_PRE_INCREMENT}.
-
-@findex USE_LOAD_PRE_DECREMENT
-@item USE_LOAD_PRE_DECREMENT (@var{mode})
-A C expression used to determine whether a load predecrement is a good
-thing to use for a given mode. Defaults to the value of
-@code{HAVE_PRE_DECREMENT}.
-
-@findex USE_STORE_POST_INCREMENT
-@item USE_STORE_POST_INCREMENT (@var{mode})
-A C expression used to determine whether a store postincrement is a good
-thing to use for a given mode. Defaults to the value of
-@code{HAVE_POST_INCREMENT}.
-
-@findex USE_STORE_POST_DECREMENT
-@item USE_STORE_POST_DECREMENT (@var{mode})
-A C expression used to determine whether a store postdeccrement is a good
-thing to use for a given mode. Defaults to the value of
-@code{HAVE_POST_DECREMENT}.
-
-@findex USE_STORE_PRE_INCREMENT
-@item USE_STORE_PRE_INCREMENT (@var{mode})
-This macro is used to determine whether a store preincrement is a good
-thing to use for a given mode. Defaults to the value of
-@code{HAVE_PRE_INCREMENT}.
-
-@findex USE_STORE_PRE_DECREMENT
-@item USE_STORE_PRE_DECREMENT (@var{mode})
-This macro is used to determine whether a store predecrement is a good
-thing to use for a given mode. Defaults to the value of
-@code{HAVE_PRE_DECREMENT}.
-
-@findex NO_FUNCTION_CSE
-@item NO_FUNCTION_CSE
-Define this macro if it is as good or better to call a constant
-function address than to call an address kept in a register.
-
-@findex NO_RECURSIVE_FUNCTION_CSE
-@item NO_RECURSIVE_FUNCTION_CSE
-Define this macro if it is as good or better for a function to call
-itself with an explicit address than to call an address kept in a
-register.
-
-@findex ADJUST_COST
-@item ADJUST_COST (@var{insn}, @var{link}, @var{dep_insn}, @var{cost})
-A C statement (sans semicolon) to update the integer variable @var{cost}
-based on the relationship between @var{insn} that is dependent on
-@var{dep_insn} through the dependence @var{link}. The default is to
-make no adjustment to @var{cost}. This can be used for example to
-specify to the scheduler that an output- or anti-dependence does not
-incur the same cost as a data-dependence.
-
-@findex ADJUST_PRIORITY
-@item ADJUST_PRIORITY (@var{insn})
-A C statement (sans semicolon) to update the integer scheduling
-priority @code{INSN_PRIORITY(@var{insn})}. Reduce the priority
-to execute the @var{insn} earlier, increase the priority to execute
-@var{insn} later. Do not define this macro if you do not need to
-adjust the scheduling priorities of insns.
-@end table
-
-@node Sections
-@section Dividing the Output into Sections (Texts, Data, @dots{})
-@c the above section title is WAY too long. maybe cut the part between
-@c the (...)? --mew 10feb93
-
-An object file is divided into sections containing different types of
-data. In the most common case, there are three sections: the @dfn{text
-section}, which holds instructions and read-only data; the @dfn{data
-section}, which holds initialized writable data; and the @dfn{bss
-section}, which holds uninitialized data. Some systems have other kinds
-of sections.
-
-The compiler must tell the assembler when to switch sections. These
-macros control what commands to output to tell the assembler this. You
-can also define additional sections.
-
-@table @code
-@findex TEXT_SECTION_ASM_OP
-@item TEXT_SECTION_ASM_OP
-A C expression whose value is a string containing the assembler
-operation that should precede instructions and read-only data. Normally
-@code{".text"} is right.
-
-@findex DATA_SECTION_ASM_OP
-@item DATA_SECTION_ASM_OP
-A C expression whose value is a string containing the assembler
-operation to identify the following data as writable initialized data.
-Normally @code{".data"} is right.
-
-@findex SHARED_SECTION_ASM_OP
-@item SHARED_SECTION_ASM_OP
-If defined, a C expression whose value is a string containing the
-assembler operation to identify the following data as shared data. If
-not defined, @code{DATA_SECTION_ASM_OP} will be used.
-
-@findex BSS_SECTION_ASM_OP
-@item BSS_SECTION_ASM_OP
-If defined, a C expression whose value is a string containing the
-assembler operation to identify the following data as uninitialized global
-data. If not defined, and neither @code{ASM_OUTPUT_BSS} nor
-@code{ASM_OUTPUT_ALIGNED_BSS} are defined, uninitialized global data will be
-output in the data section if @samp{-fno-common} is passed, otherwise
-@code{ASM_OUTPUT_COMMON} will be used.
-
-@findex SHARED_BSS_SECTION_ASM_OP
-@item SHARED_BSS_SECTION_ASM_OP
-If defined, a C expression whose value is a string containing the
-assembler operation to identify the following data as uninitialized global
-shared data. If not defined, and @code{BSS_SECTION_ASM_OP} is, the latter
-will be used.
-
-@findex INIT_SECTION_ASM_OP
-@item INIT_SECTION_ASM_OP
-If defined, a C expression whose value is a string containing the
-assembler operation to identify the following data as initialization
-code. If not defined, GNU CC will assume such a section does not
-exist.
-
-@findex EXTRA_SECTIONS
-@findex in_text
-@findex in_data
-@item EXTRA_SECTIONS
-A list of names for sections other than the standard two, which are
-@code{in_text} and @code{in_data}. You need not define this macro
-on a system with no other sections (that GCC needs to use).
-
-@findex EXTRA_SECTION_FUNCTIONS
-@findex text_section
-@findex data_section
-@item EXTRA_SECTION_FUNCTIONS
-One or more functions to be defined in @file{varasm.c}. These
-functions should do jobs analogous to those of @code{text_section} and
-@code{data_section}, for your additional sections. Do not define this
-macro if you do not define @code{EXTRA_SECTIONS}.
-
-@findex READONLY_DATA_SECTION
-@item READONLY_DATA_SECTION
-On most machines, read-only variables, constants, and jump tables are
-placed in the text section. If this is not the case on your machine,
-this macro should be defined to be the name of a function (either
-@code{data_section} or a function defined in @code{EXTRA_SECTIONS}) that
-switches to the section to be used for read-only items.
-
-If these items should be placed in the text section, this macro should
-not be defined.
-
-@findex SELECT_SECTION
-@item SELECT_SECTION (@var{exp}, @var{reloc})
-A C statement or statements to switch to the appropriate section for
-output of @var{exp}. You can assume that @var{exp} is either a
-@code{VAR_DECL} node or a constant of some sort. @var{reloc}
-indicates whether the initial value of @var{exp} requires link-time
-relocations. Select the section by calling @code{text_section} or one
-of the alternatives for other sections.
-
-Do not define this macro if you put all read-only variables and
-constants in the read-only data section (usually the text section).
-
-@findex SELECT_RTX_SECTION
-@item SELECT_RTX_SECTION (@var{mode}, @var{rtx})
-A C statement or statements to switch to the appropriate section for
-output of @var{rtx} in mode @var{mode}. You can assume that @var{rtx}
-is some kind of constant in RTL. The argument @var{mode} is redundant
-except in the case of a @code{const_int} rtx. Select the section by
-calling @code{text_section} or one of the alternatives for other
-sections.
-
-Do not define this macro if you put all constants in the read-only
-data section.
-
-@findex JUMP_TABLES_IN_TEXT_SECTION
-@item JUMP_TABLES_IN_TEXT_SECTION
-Define this macro to be an expression with a non-zero value if jump
-tables (for @code{tablejump} insns) should be output in the text
-section, along with the assembler instructions. Otherwise, the
-readonly data section is used.
-
-This macro is irrelevant if there is no separate readonly data section.
-
-@findex ENCODE_SECTION_INFO
-@item ENCODE_SECTION_INFO (@var{decl})
-Define this macro if references to a symbol must be treated differently
-depending on something about the variable or function named by the
-symbol (such as what section it is in).
-
-The macro definition, if any, is executed immediately after the rtl for
-@var{decl} has been created and stored in @code{DECL_RTL (@var{decl})}.
-The value of the rtl will be a @code{mem} whose address is a
-@code{symbol_ref}.
-
-@cindex @code{SYMBOL_REF_FLAG}, in @code{ENCODE_SECTION_INFO}
-The usual thing for this macro to do is to record a flag in the
-@code{symbol_ref} (such as @code{SYMBOL_REF_FLAG}) or to store a
-modified name string in the @code{symbol_ref} (if one bit is not enough
-information).
-
-@findex STRIP_NAME_ENCODING
-@item STRIP_NAME_ENCODING (@var{var}, @var{sym_name})
-Decode @var{sym_name} and store the real name part in @var{var}, sans
-the characters that encode section info. Define this macro if
-@code{ENCODE_SECTION_INFO} alters the symbol's name string.
-
-@findex UNIQUE_SECTION_P
-@item UNIQUE_SECTION_P (@var{decl})
-A C expression which evaluates to true if @var{decl} should be placed
-into a unique section for some target-specific reason. If you do not
-define this macro, the default is @samp{0}. Note that the flag
-@samp{-ffunction-sections} will also cause functions to be placed into
-unique sections.
-
-@findex UNIQUE_SECTION
-@item UNIQUE_SECTION (@var{decl}, @var{reloc})
-A C statement to build up a unique section name, expressed as a
-STRING_CST node, and assign it to @samp{DECL_SECTION_NAME (@var{decl})}.
-@var{reloc} indicates whether the initial value of @var{exp} requires
-link-time relocations. If you do not define this macro, GNU CC will use
-the symbol name prefixed by @samp{.} as the section name.
-@end table
-
-@node PIC
-@section Position Independent Code
-@cindex position independent code
-@cindex PIC
-
-This section describes macros that help implement generation of position
-independent code. Simply defining these macros is not enough to
-generate valid PIC; you must also add support to the macros
-@code{GO_IF_LEGITIMATE_ADDRESS} and @code{PRINT_OPERAND_ADDRESS}, as
-well as @code{LEGITIMIZE_ADDRESS}. You must modify the definition of
-@samp{movsi} to do something appropriate when the source operand
-contains a symbolic address. You may also need to alter the handling of
-switch statements so that they use relative addresses.
-@c i rearranged the order of the macros above to try to force one of
-@c them to the next line, to eliminate an overfull hbox. --mew 10feb93
-
-@table @code
-@findex PIC_OFFSET_TABLE_REGNUM
-@item PIC_OFFSET_TABLE_REGNUM
-The register number of the register used to address a table of static
-data addresses in memory. In some cases this register is defined by a
-processor's ``application binary interface'' (ABI). When this macro
-is defined, RTL is generated for this register once, as with the stack
-pointer and frame pointer registers. If this macro is not defined, it
-is up to the machine-dependent files to allocate such a register (if
-necessary).
-
-@findex PIC_OFFSET_TABLE_REG_CALL_CLOBBERED
-@item PIC_OFFSET_TABLE_REG_CALL_CLOBBERED
-Define this macro if the register defined by
-@code{PIC_OFFSET_TABLE_REGNUM} is clobbered by calls. Do not define
-this macro if @code{PIC_OFFSET_TABLE_REGNUM} is not defined.
-
-@findex FINALIZE_PIC
-@item FINALIZE_PIC
-By generating position-independent code, when two different programs (A
-and B) share a common library (libC.a), the text of the library can be
-shared whether or not the library is linked at the same address for both
-programs. In some of these environments, position-independent code
-requires not only the use of different addressing modes, but also
-special code to enable the use of these addressing modes.
-
-The @code{FINALIZE_PIC} macro serves as a hook to emit these special
-codes once the function is being compiled into assembly code, but not
-before. (It is not done before, because in the case of compiling an
-inline function, it would lead to multiple PIC prologues being
-included in functions which used inline functions and were compiled to
-assembly language.)
-
-@findex LEGITIMATE_PIC_OPERAND_P
-@item LEGITIMATE_PIC_OPERAND_P (@var{x})
-A C expression that is nonzero if @var{x} is a legitimate immediate
-operand on the target machine when generating position independent code.
-You can assume that @var{x} satisfies @code{CONSTANT_P}, so you need not
-check this. You can also assume @var{flag_pic} is true, so you need not
-check it either. You need not define this macro if all constants
-(including @code{SYMBOL_REF}) can be immediate operands when generating
-position independent code.
-@end table
-
-@node Assembler Format
-@section Defining the Output Assembler Language
-
-This section describes macros whose principal purpose is to describe how
-to write instructions in assembler language--rather than what the
-instructions do.
-
-@menu
-* File Framework:: Structural information for the assembler file.
-* Data Output:: Output of constants (numbers, strings, addresses).
-* Uninitialized Data:: Output of uninitialized variables.
-* Label Output:: Output and generation of labels.
-* Initialization:: General principles of initialization
- and termination routines.
-* Macros for Initialization::
- Specific macros that control the handling of
- initialization and termination routines.
-* Instruction Output:: Output of actual instructions.
-* Dispatch Tables:: Output of jump tables.
-* Exception Region Output:: Output of exception region code.
-* Alignment Output:: Pseudo ops for alignment and skipping data.
-@end menu
-
-@node File Framework
-@subsection The Overall Framework of an Assembler File
-@cindex assembler format
-@cindex output of assembler code
-
-@c prevent bad page break with this line
-This describes the overall framework of an assembler file.
-
-@table @code
-@findex ASM_FILE_START
-@item ASM_FILE_START (@var{stream})
-A C expression which outputs to the stdio stream @var{stream}
-some appropriate text to go at the start of an assembler file.
-
-Normally this macro is defined to output a line containing
-@samp{#NO_APP}, which is a comment that has no effect on most
-assemblers but tells the GNU assembler that it can save time by not
-checking for certain assembler constructs.
-
-On systems that use SDB, it is necessary to output certain commands;
-see @file{attasm.h}.
-
-@findex ASM_FILE_END
-@item ASM_FILE_END (@var{stream})
-A C expression which outputs to the stdio stream @var{stream}
-some appropriate text to go at the end of an assembler file.
-
-If this macro is not defined, the default is to output nothing
-special at the end of the file. Most systems don't require any
-definition.
-
-On systems that use SDB, it is necessary to output certain commands;
-see @file{attasm.h}.
-
-@findex ASM_IDENTIFY_GCC
-@item ASM_IDENTIFY_GCC (@var{file})
-A C statement to output assembler commands which will identify
-the object file as having been compiled with GNU CC (or another
-GNU compiler).
-
-If you don't define this macro, the string @samp{gcc_compiled.:}
-is output. This string is calculated to define a symbol which,
-on BSD systems, will never be defined for any other reason.
-GDB checks for the presence of this symbol when reading the
-symbol table of an executable.
-
-On non-BSD systems, you must arrange communication with GDB in
-some other fashion. If GDB is not used on your system, you can
-define this macro with an empty body.
-
-@findex ASM_COMMENT_START
-@item ASM_COMMENT_START
-A C string constant describing how to begin a comment in the target
-assembler language. The compiler assumes that the comment will end at
-the end of the line.
-
-@findex ASM_APP_ON
-@item ASM_APP_ON
-A C string constant for text to be output before each @code{asm}
-statement or group of consecutive ones. Normally this is
-@code{"#APP"}, which is a comment that has no effect on most
-assemblers but tells the GNU assembler that it must check the lines
-that follow for all valid assembler constructs.
-
-@findex ASM_APP_OFF
-@item ASM_APP_OFF
-A C string constant for text to be output after each @code{asm}
-statement or group of consecutive ones. Normally this is
-@code{"#NO_APP"}, which tells the GNU assembler to resume making the
-time-saving assumptions that are valid for ordinary compiler output.
-
-@findex ASM_OUTPUT_SOURCE_FILENAME
-@item ASM_OUTPUT_SOURCE_FILENAME (@var{stream}, @var{name})
-A C statement to output COFF information or DWARF debugging information
-which indicates that filename @var{name} is the current source file to
-the stdio stream @var{stream}.
-
-This macro need not be defined if the standard form of output
-for the file format in use is appropriate.
-
-@findex OUTPUT_QUOTED_STRING
-@item OUTPUT_QUOTED_STRING (@var{stream}, @var{name})
-A C statement to output the string @var{string} to the stdio stream
-@var{stream}. If you do not call the function @code{output_quoted_string}
-in your config files, GNU CC will only call it to output filenames to
-the assembler source. So you can use it to canonicalize the format
-of the filename using this macro.
-
-@findex ASM_OUTPUT_SOURCE_LINE
-@item ASM_OUTPUT_SOURCE_LINE (@var{stream}, @var{line})
-A C statement to output DBX or SDB debugging information before code
-for line number @var{line} of the current source file to the
-stdio stream @var{stream}.
-
-This macro need not be defined if the standard form of debugging
-information for the debugger in use is appropriate.
-
-@findex ASM_OUTPUT_IDENT
-@item ASM_OUTPUT_IDENT (@var{stream}, @var{string})
-A C statement to output something to the assembler file to handle a
-@samp{#ident} directive containing the text @var{string}. If this
-macro is not defined, nothing is output for a @samp{#ident} directive.
-
-@findex ASM_OUTPUT_SECTION_NAME
-@item ASM_OUTPUT_SECTION_NAME (@var{stream}, @var{decl}, @var{name}, @var{reloc})
-A C statement to output something to the assembler file to switch to section
-@var{name} for object @var{decl} which is either a @code{FUNCTION_DECL}, a
-@code{VAR_DECL} or @code{NULL_TREE}. @var{reloc}
-indicates whether the initial value of @var{exp} requires link-time
-relocations. Some target formats do not support
-arbitrary sections. Do not define this macro in such cases.
-
-At present this macro is only used to support section attributes.
-When this macro is undefined, section attributes are disabled.
-
-@findex OBJC_PROLOGUE
-@item OBJC_PROLOGUE
-A C statement to output any assembler statements which are required to
-precede any Objective C object definitions or message sending. The
-statement is executed only when compiling an Objective C program.
-@end table
-
-@need 2000
-@node Data Output
-@subsection Output of Data
-
-@c prevent bad page break with this line
-This describes data output.
-
-@table @code
-@findex ASM_OUTPUT_LONG_DOUBLE
-@findex ASM_OUTPUT_DOUBLE
-@findex ASM_OUTPUT_FLOAT
-@item ASM_OUTPUT_LONG_DOUBLE (@var{stream}, @var{value})
-@itemx ASM_OUTPUT_DOUBLE (@var{stream}, @var{value})
-@itemx ASM_OUTPUT_FLOAT (@var{stream}, @var{value})
-@itemx ASM_OUTPUT_THREE_QUARTER_FLOAT (@var{stream}, @var{value})
-@itemx ASM_OUTPUT_SHORT_FLOAT (@var{stream}, @var{value})
-@itemx ASM_OUTPUT_BYTE_FLOAT (@var{stream}, @var{value})
-A C statement to output to the stdio stream @var{stream} an assembler
-instruction to assemble a floating-point constant of @code{TFmode},
-@code{DFmode}, @code{SFmode}, @code{TQFmode}, @code{HFmode}, or
-@code{QFmode}, respectively, whose value is @var{value}. @var{value}
-will be a C expression of type @code{REAL_VALUE_TYPE}. Macros such as
-@code{REAL_VALUE_TO_TARGET_DOUBLE} are useful for writing these
-definitions.
-
-@findex ASM_OUTPUT_QUADRUPLE_INT
-@findex ASM_OUTPUT_DOUBLE_INT
-@findex ASM_OUTPUT_INT
-@findex ASM_OUTPUT_SHORT
-@findex ASM_OUTPUT_CHAR
-@findex output_addr_const
-@item ASM_OUTPUT_QUADRUPLE_INT (@var{stream}, @var{exp})
-@itemx ASM_OUTPUT_DOUBLE_INT (@var{stream}, @var{exp})
-@itemx ASM_OUTPUT_INT (@var{stream}, @var{exp})
-@itemx ASM_OUTPUT_SHORT (@var{stream}, @var{exp})
-@itemx ASM_OUTPUT_CHAR (@var{stream}, @var{exp})
-A C statement to output to the stdio stream @var{stream} an assembler
-instruction to assemble an integer of 16, 8, 4, 2 or 1 bytes,
-respectively, whose value is @var{value}. The argument @var{exp} will
-be an RTL expression which represents a constant value. Use
-@samp{output_addr_const (@var{stream}, @var{exp})} to output this value
-as an assembler expression.@refill
-
-For sizes larger than @code{UNITS_PER_WORD}, if the action of a macro
-would be identical to repeatedly calling the macro corresponding to
-a size of @code{UNITS_PER_WORD}, once for each word, you need not define
-the macro.
-
-@findex ASM_OUTPUT_BYTE
-@item ASM_OUTPUT_BYTE (@var{stream}, @var{value})
-A C statement to output to the stdio stream @var{stream} an assembler
-instruction to assemble a single byte containing the number @var{value}.
-
-@findex ASM_BYTE_OP
-@item ASM_BYTE_OP
-A C string constant giving the pseudo-op to use for a sequence of
-single-byte constants. If this macro is not defined, the default is
-@code{"byte"}.
-
-@findex ASM_OUTPUT_ASCII
-@item ASM_OUTPUT_ASCII (@var{stream}, @var{ptr}, @var{len})
-A C statement to output to the stdio stream @var{stream} an assembler
-instruction to assemble a string constant containing the @var{len}
-bytes at @var{ptr}. @var{ptr} will be a C expression of type
-@code{char *} and @var{len} a C expression of type @code{int}.
-
-If the assembler has a @code{.ascii} pseudo-op as found in the
-Berkeley Unix assembler, do not define the macro
-@code{ASM_OUTPUT_ASCII}.
-
-@findex CONSTANT_POOL_BEFORE_FUNCTION
-@item CONSTANT_POOL_BEFORE_FUNCTION
-You may define this macro as a C expression. You should define the
-expression to have a non-zero value if GNU CC should output the constant
-pool for a function before the code for the function, or a zero value if
-GNU CC should output the constant pool after the function. If you do
-not define this macro, the usual case, GNU CC will output the constant
-pool before the function.
-
-@findex ASM_OUTPUT_POOL_PROLOGUE
-@item ASM_OUTPUT_POOL_PROLOGUE (@var{file} @var{funname} @var{fundecl} @var{size})
-A C statement to output assembler commands to define the start of the
-constant pool for a function. @var{funname} is a string giving
-the name of the function. Should the return type of the function
-be required, it can be obtained via @var{fundecl}. @var{size}
-is the size, in bytes, of the constant pool that will be written
-immediately after this call.
-
-If no constant-pool prefix is required, the usual case, this macro need
-not be defined.
-
-@findex ASM_OUTPUT_SPECIAL_POOL_ENTRY
-@item ASM_OUTPUT_SPECIAL_POOL_ENTRY (@var{file}, @var{x}, @var{mode}, @var{align}, @var{labelno}, @var{jumpto})
-A C statement (with or without semicolon) to output a constant in the
-constant pool, if it needs special treatment. (This macro need not do
-anything for RTL expressions that can be output normally.)
-
-The argument @var{file} is the standard I/O stream to output the
-assembler code on. @var{x} is the RTL expression for the constant to
-output, and @var{mode} is the machine mode (in case @var{x} is a
-@samp{const_int}). @var{align} is the required alignment for the value
-@var{x}; you should output an assembler directive to force this much
-alignment.
-
-The argument @var{labelno} is a number to use in an internal label for
-the address of this pool entry. The definition of this macro is
-responsible for outputting the label definition at the proper place.
-Here is how to do this:
-
-@example
-ASM_OUTPUT_INTERNAL_LABEL (@var{file}, "LC", @var{labelno});
-@end example
-
-When you output a pool entry specially, you should end with a
-@code{goto} to the label @var{jumpto}. This will prevent the same pool
-entry from being output a second time in the usual manner.
-
-You need not define this macro if it would do nothing.
-
-@findex CONSTANT_AFTER_FUNCTION_P
-@item CONSTANT_AFTER_FUNCTION_P (@var{exp})
-Define this macro as a C expression which is nonzero if the constant
-@var{exp}, of type @code{tree}, should be output after the code for a
-function. The compiler will normally output all constants before the
-function; you need not define this macro if this is OK.
-
-@findex ASM_OUTPUT_POOL_EPILOGUE
-@item ASM_OUTPUT_POOL_EPILOGUE (@var{file} @var{funname} @var{fundecl} @var{size})
-A C statement to output assembler commands to at the end of the constant
-pool for a function. @var{funname} is a string giving the name of the
-function. Should the return type of the function be required, you can
-obtain it via @var{fundecl}. @var{size} is the size, in bytes, of the
-constant pool that GNU CC wrote immediately before this call.
-
-If no constant-pool epilogue is required, the usual case, you need not
-define this macro.
-
-@findex IS_ASM_LOGICAL_LINE_SEPARATOR
-@item IS_ASM_LOGICAL_LINE_SEPARATOR (@var{C})
-Define this macro as a C expression which is nonzero if @var{C} is
-used as a logical line separator by the assembler.
-
-If you do not define this macro, the default is that only
-the character @samp{;} is treated as a logical line separator.
-
-
-@findex ASM_OPEN_PAREN
-@findex ASM_CLOSE_PAREN
-@item ASM_OPEN_PAREN
-@itemx ASM_CLOSE_PAREN
-These macros are defined as C string constant, describing the syntax
-in the assembler for grouping arithmetic expressions. The following
-definitions are correct for most assemblers:
-
-@example
-#define ASM_OPEN_PAREN "("
-#define ASM_CLOSE_PAREN ")"
-@end example
-@end table
-
- These macros are provided by @file{real.h} for writing the definitions
-of @code{ASM_OUTPUT_DOUBLE} and the like:
-
-@table @code
-@item REAL_VALUE_TO_TARGET_SINGLE (@var{x}, @var{l})
-@itemx REAL_VALUE_TO_TARGET_DOUBLE (@var{x}, @var{l})
-@itemx REAL_VALUE_TO_TARGET_LONG_DOUBLE (@var{x}, @var{l})
-@findex REAL_VALUE_TO_TARGET_SINGLE
-@findex REAL_VALUE_TO_TARGET_DOUBLE
-@findex REAL_VALUE_TO_TARGET_LONG_DOUBLE
-These translate @var{x}, of type @code{REAL_VALUE_TYPE}, to the target's
-floating point representation, and store its bit pattern in the array of
-@code{long int} whose address is @var{l}. The number of elements in the
-output array is determined by the size of the desired target floating
-point data type: 32 bits of it go in each @code{long int} array
-element. Each array element holds 32 bits of the result, even if
-@code{long int} is wider than 32 bits on the host machine.
-
-The array element values are designed so that you can print them out
-using @code{fprintf} in the order they should appear in the target
-machine's memory.
-
-@item REAL_VALUE_TO_DECIMAL (@var{x}, @var{format}, @var{string})
-@findex REAL_VALUE_TO_DECIMAL
-This macro converts @var{x}, of type @code{REAL_VALUE_TYPE}, to a
-decimal number and stores it as a string into @var{string}.
-You must pass, as @var{string}, the address of a long enough block
-of space to hold the result.
-
-The argument @var{format} is a @code{printf}-specification that serves
-as a suggestion for how to format the output string.
-@end table
-
-@node Uninitialized Data
-@subsection Output of Uninitialized Variables
-
-Each of the macros in this section is used to do the whole job of
-outputting a single uninitialized variable.
-
-@table @code
-@findex ASM_OUTPUT_COMMON
-@item ASM_OUTPUT_COMMON (@var{stream}, @var{name}, @var{size}, @var{rounded})
-A C statement (sans semicolon) to output to the stdio stream
-@var{stream} the assembler definition of a common-label named
-@var{name} whose size is @var{size} bytes. The variable @var{rounded}
-is the size rounded up to whatever alignment the caller wants.
-
-Use the expression @code{assemble_name (@var{stream}, @var{name})} to
-output the name itself; before and after that, output the additional
-assembler syntax for defining the name, and a newline.
-
-This macro controls how the assembler definitions of uninitialized
-common global variables are output.
-
-@findex ASM_OUTPUT_ALIGNED_COMMON
-@item ASM_OUTPUT_ALIGNED_COMMON (@var{stream}, @var{name}, @var{size}, @var{alignment})
-Like @code{ASM_OUTPUT_COMMON} except takes the required alignment as a
-separate, explicit argument. If you define this macro, it is used in
-place of @code{ASM_OUTPUT_COMMON}, and gives you more flexibility in
-handling the required alignment of the variable. The alignment is specified
-as the number of bits.
-
-@findex ASM_OUTPUT_ALIGNED_DECL_COMMON
-@item ASM_OUTPUT_ALIGNED_DECL_COMMON (@var{stream}, @var{decl}, @var{name}, @var{size}, @var{alignment})
-Like @code{ASM_OUTPUT_ALIGNED_COMMON} except that @var{decl} of the
-variable to be output, if there is one, or @code{NULL_TREE} if there
-is not corresponding variable. If you define this macro, GNU CC wil use it
-in place of both @code{ASM_OUTPUT_COMMON} and
-@code{ASM_OUTPUT_ALIGNED_COMMON}. Define this macro when you need to see
-the variable's decl in order to chose what to output.
-
-@findex ASM_OUTPUT_SHARED_COMMON
-@item ASM_OUTPUT_SHARED_COMMON (@var{stream}, @var{name}, @var{size}, @var{rounded})
-If defined, it is similar to @code{ASM_OUTPUT_COMMON}, except that it
-is used when @var{name} is shared. If not defined, @code{ASM_OUTPUT_COMMON}
-will be used.
-
-@findex ASM_OUTPUT_BSS
-@item ASM_OUTPUT_BSS (@var{stream}, @var{decl}, @var{name}, @var{size}, @var{rounded})
-A C statement (sans semicolon) to output to the stdio stream
-@var{stream} the assembler definition of uninitialized global @var{decl} named
-@var{name} whose size is @var{size} bytes. The variable @var{rounded}
-is the size rounded up to whatever alignment the caller wants.
-
-Try to use function @code{asm_output_bss} defined in @file{varasm.c} when
-defining this macro. If unable, use the expression
-@code{assemble_name (@var{stream}, @var{name})} to output the name itself;
-before and after that, output the additional assembler syntax for defining
-the name, and a newline.
-
-This macro controls how the assembler definitions of uninitialized global
-variables are output. This macro exists to properly support languages like
-@code{c++} which do not have @code{common} data. However, this macro currently
-is not defined for all targets. If this macro and
-@code{ASM_OUTPUT_ALIGNED_BSS} are not defined then @code{ASM_OUTPUT_COMMON}
-or @code{ASM_OUTPUT_ALIGNED_COMMON} or
-@code{ASM_OUTPUT_ALIGNED_DECL_COMMON} is used.
-
-@findex ASM_OUTPUT_ALIGNED_BSS
-@item ASM_OUTPUT_ALIGNED_BSS (@var{stream}, @var{decl}, @var{name}, @var{size}, @var{alignment})
-Like @code{ASM_OUTPUT_BSS} except takes the required alignment as a
-separate, explicit argument. If you define this macro, it is used in
-place of @code{ASM_OUTPUT_BSS}, and gives you more flexibility in
-handling the required alignment of the variable. The alignment is specified
-as the number of bits.
-
-Try to use function @code{asm_output_aligned_bss} defined in file
-@file{varasm.c} when defining this macro.
-
-@findex ASM_OUTPUT_SHARED_BSS
-@item ASM_OUTPUT_SHARED_BSS (@var{stream}, @var{decl}, @var{name}, @var{size}, @var{rounded})
-If defined, it is similar to @code{ASM_OUTPUT_BSS}, except that it
-is used when @var{name} is shared. If not defined, @code{ASM_OUTPUT_BSS}
-will be used.
-
-@findex ASM_OUTPUT_LOCAL
-@item ASM_OUTPUT_LOCAL (@var{stream}, @var{name}, @var{size}, @var{rounded})
-A C statement (sans semicolon) to output to the stdio stream
-@var{stream} the assembler definition of a local-common-label named
-@var{name} whose size is @var{size} bytes. The variable @var{rounded}
-is the size rounded up to whatever alignment the caller wants.
-
-Use the expression @code{assemble_name (@var{stream}, @var{name})} to
-output the name itself; before and after that, output the additional
-assembler syntax for defining the name, and a newline.
-
-This macro controls how the assembler definitions of uninitialized
-static variables are output.
-
-@findex ASM_OUTPUT_ALIGNED_LOCAL
-@item ASM_OUTPUT_ALIGNED_LOCAL (@var{stream}, @var{name}, @var{size}, @var{alignment})
-Like @code{ASM_OUTPUT_LOCAL} except takes the required alignment as a
-separate, explicit argument. If you define this macro, it is used in
-place of @code{ASM_OUTPUT_LOCAL}, and gives you more flexibility in
-handling the required alignment of the variable. The alignment is specified
-as the number of bits.
-
-@findex ASM_OUTPUT_ALIGNED_DECL_LOCAL
-@item ASM_OUTPUT_ALIGNED_DECL_LOCAL (@var{stream}, @var{decl}, @var{name}, @var{size}, @var{alignment})
-Like @code{ASM_OUTPUT_ALIGNED_DECL} except that @var{decl} of the
-variable to be output, if there is one, or @code{NULL_TREE} if there
-is not corresponding variable. If you define this macro, GNU CC wil use it
-in place of both @code{ASM_OUTPUT_DECL} and
-@code{ASM_OUTPUT_ALIGNED_DECL}. Define this macro when you need to see
-the variable's decl in order to chose what to output.
-
-
-@findex ASM_OUTPUT_SHARED_LOCAL
-@item ASM_OUTPUT_SHARED_LOCAL (@var{stream}, @var{name}, @var{size}, @var{rounded})
-If defined, it is similar to @code{ASM_OUTPUT_LOCAL}, except that it
-is used when @var{name} is shared. If not defined, @code{ASM_OUTPUT_LOCAL}
-will be used.
-@end table
-
-@node Label Output
-@subsection Output and Generation of Labels
-
-@c prevent bad page break with this line
-This is about outputting labels.
-
-@table @code
-@findex ASM_OUTPUT_LABEL
-@findex assemble_name
-@item ASM_OUTPUT_LABEL (@var{stream}, @var{name})
-A C statement (sans semicolon) to output to the stdio stream
-@var{stream} the assembler definition of a label named @var{name}.
-Use the expression @code{assemble_name (@var{stream}, @var{name})} to
-output the name itself; before and after that, output the additional
-assembler syntax for defining the name, and a newline.
-
-@findex ASM_DECLARE_FUNCTION_NAME
-@item ASM_DECLARE_FUNCTION_NAME (@var{stream}, @var{name}, @var{decl})
-A C statement (sans semicolon) to output to the stdio stream
-@var{stream} any text necessary for declaring the name @var{name} of a
-function which is being defined. This macro is responsible for
-outputting the label definition (perhaps using
-@code{ASM_OUTPUT_LABEL}). The argument @var{decl} is the
-@code{FUNCTION_DECL} tree node representing the function.
-
-If this macro is not defined, then the function name is defined in the
-usual manner as a label (by means of @code{ASM_OUTPUT_LABEL}).
-
-@findex ASM_DECLARE_FUNCTION_SIZE
-@item ASM_DECLARE_FUNCTION_SIZE (@var{stream}, @var{name}, @var{decl})
-A C statement (sans semicolon) to output to the stdio stream
-@var{stream} any text necessary for declaring the size of a function
-which is being defined. The argument @var{name} is the name of the
-function. The argument @var{decl} is the @code{FUNCTION_DECL} tree node
-representing the function.
-
-If this macro is not defined, then the function size is not defined.
-
-@findex ASM_DECLARE_OBJECT_NAME
-@item ASM_DECLARE_OBJECT_NAME (@var{stream}, @var{name}, @var{decl})
-A C statement (sans semicolon) to output to the stdio stream
-@var{stream} any text necessary for declaring the name @var{name} of an
-initialized variable which is being defined. This macro must output the
-label definition (perhaps using @code{ASM_OUTPUT_LABEL}). The argument
-@var{decl} is the @code{VAR_DECL} tree node representing the variable.
-
-If this macro is not defined, then the variable name is defined in the
-usual manner as a label (by means of @code{ASM_OUTPUT_LABEL}).
-
-@findex ASM_FINISH_DECLARE_OBJECT
-@item ASM_FINISH_DECLARE_OBJECT (@var{stream}, @var{decl}, @var{toplevel}, @var{atend})
-A C statement (sans semicolon) to finish up declaring a variable name
-once the compiler has processed its initializer fully and thus has had a
-chance to determine the size of an array when controlled by an
-initializer. This is used on systems where it's necessary to declare
-something about the size of the object.
-
-If you don't define this macro, that is equivalent to defining it to do
-nothing.
-
-@findex ASM_GLOBALIZE_LABEL
-@item ASM_GLOBALIZE_LABEL (@var{stream}, @var{name})
-A C statement (sans semicolon) to output to the stdio stream
-@var{stream} some commands that will make the label @var{name} global;
-that is, available for reference from other files. Use the expression
-@code{assemble_name (@var{stream}, @var{name})} to output the name
-itself; before and after that, output the additional assembler syntax
-for making that name global, and a newline.
-
-@findex ASM_WEAKEN_LABEL
-@item ASM_WEAKEN_LABEL
-A C statement (sans semicolon) to output to the stdio stream
-@var{stream} some commands that will make the label @var{name} weak;
-that is, available for reference from other files but only used if
-no other definition is available. Use the expression
-@code{assemble_name (@var{stream}, @var{name})} to output the name
-itself; before and after that, output the additional assembler syntax
-for making that name weak, and a newline.
-
-If you don't define this macro, GNU CC will not support weak
-symbols and you should not define the @code{SUPPORTS_WEAK} macro.
-
-@findex SUPPORTS_WEAK
-@item SUPPORTS_WEAK
-A C expression which evaluates to true if the target supports weak symbols.
-
-If you don't define this macro, @file{defaults.h} provides a default
-definition. If @code{ASM_WEAKEN_LABEL} is defined, the default
-definition is @samp{1}; otherwise, it is @samp{0}. Define this macro if
-you want to control weak symbol support with a compiler flag such as
-@samp{-melf}.
-
-@findex MAKE_DECL_ONE_ONLY (@var{decl})
-@item MAKE_DECL_ONE_ONLY
-A C statement (sans semicolon) to mark @var{decl} to be emitted as a
-public symbol such that extra copies in multiple translation units will
-be discarded by the linker. Define this macro if your object file
-format provides support for this concept, such as the @samp{COMDAT}
-section flags in the Microsoft Windows PE/COFF format, and this support
-requires changes to @var{decl}, such as putting it in a separate section.
-
-@findex SUPPORTS_ONE_ONLY
-@item SUPPORTS_ONE_ONLY
-A C expression which evaluates to true if the target supports one-only
-semantics.
-
-If you don't define this macro, @file{varasm.c} provides a default
-definition. If @code{MAKE_DECL_ONE_ONLY} is defined, the default
-definition is @samp{1}; otherwise, it is @samp{0}. Define this macro if
-you want to control one-only symbol support with a compiler flag, or if
-setting the @code{DECL_ONE_ONLY} flag is enough to mark a declaration to
-be emitted as one-only.
-
-@findex ASM_OUTPUT_EXTERNAL
-@item ASM_OUTPUT_EXTERNAL (@var{stream}, @var{decl}, @var{name})
-A C statement (sans semicolon) to output to the stdio stream
-@var{stream} any text necessary for declaring the name of an external
-symbol named @var{name} which is referenced in this compilation but
-not defined. The value of @var{decl} is the tree node for the
-declaration.
-
-This macro need not be defined if it does not need to output anything.
-The GNU assembler and most Unix assemblers don't require anything.
-
-@findex ASM_OUTPUT_EXTERNAL_LIBCALL
-@item ASM_OUTPUT_EXTERNAL_LIBCALL (@var{stream}, @var{symref})
-A C statement (sans semicolon) to output on @var{stream} an assembler
-pseudo-op to declare a library function name external. The name of the
-library function is given by @var{symref}, which has type @code{rtx} and
-is a @code{symbol_ref}.
-
-This macro need not be defined if it does not need to output anything.
-The GNU assembler and most Unix assemblers don't require anything.
-
-@findex ASM_OUTPUT_LABELREF
-@item ASM_OUTPUT_LABELREF (@var{stream}, @var{name})
-A C statement (sans semicolon) to output to the stdio stream
-@var{stream} a reference in assembler syntax to a label named
-@var{name}. This should add @samp{_} to the front of the name, if that
-is customary on your operating system, as it is in most Berkeley Unix
-systems. This macro is used in @code{assemble_name}.
-
-@ignore @c Seems not to exist anymore.
-@findex ASM_OUTPUT_LABELREF_AS_INT
-@item ASM_OUTPUT_LABELREF_AS_INT (@var{file}, @var{label})
-Define this macro for systems that use the program @code{collect2}.
-The definition should be a C statement to output a word containing
-a reference to the label @var{label}.
-@end ignore
-
-@findex ASM_OUTPUT_INTERNAL_LABEL
-@item ASM_OUTPUT_INTERNAL_LABEL (@var{stream}, @var{prefix}, @var{num})
-A C statement to output to the stdio stream @var{stream} a label whose
-name is made from the string @var{prefix} and the number @var{num}.
-
-It is absolutely essential that these labels be distinct from the labels
-used for user-level functions and variables. Otherwise, certain programs
-will have name conflicts with internal labels.
-
-It is desirable to exclude internal labels from the symbol table of the
-object file. Most assemblers have a naming convention for labels that
-should be excluded; on many systems, the letter @samp{L} at the
-beginning of a label has this effect. You should find out what
-convention your system uses, and follow it.
-
-The usual definition of this macro is as follows:
-
-@example
-fprintf (@var{stream}, "L%s%d:\n", @var{prefix}, @var{num})
-@end example
-
-@findex ASM_GENERATE_INTERNAL_LABEL
-@item ASM_GENERATE_INTERNAL_LABEL (@var{string}, @var{prefix}, @var{num})
-A C statement to store into the string @var{string} a label whose name
-is made from the string @var{prefix} and the number @var{num}.
-
-This string, when output subsequently by @code{assemble_name}, should
-produce the output that @code{ASM_OUTPUT_INTERNAL_LABEL} would produce
-with the same @var{prefix} and @var{num}.
-
-If the string begins with @samp{*}, then @code{assemble_name} will
-output the rest of the string unchanged. It is often convenient for
-@code{ASM_GENERATE_INTERNAL_LABEL} to use @samp{*} in this way. If the
-string doesn't start with @samp{*}, then @code{ASM_OUTPUT_LABELREF} gets
-to output the string, and may change it. (Of course,
-@code{ASM_OUTPUT_LABELREF} is also part of your machine description, so
-you should know what it does on your machine.)
-
-@findex ASM_FORMAT_PRIVATE_NAME
-@item ASM_FORMAT_PRIVATE_NAME (@var{outvar}, @var{name}, @var{number})
-A C expression to assign to @var{outvar} (which is a variable of type
-@code{char *}) a newly allocated string made from the string
-@var{name} and the number @var{number}, with some suitable punctuation
-added. Use @code{alloca} to get space for the string.
-
-The string will be used as an argument to @code{ASM_OUTPUT_LABELREF} to
-produce an assembler label for an internal static variable whose name is
-@var{name}. Therefore, the string must be such as to result in valid
-assembler code. The argument @var{number} is different each time this
-macro is executed; it prevents conflicts between similarly-named
-internal static variables in different scopes.
-
-Ideally this string should not be a valid C identifier, to prevent any
-conflict with the user's own symbols. Most assemblers allow periods
-or percent signs in assembler symbols; putting at least one of these
-between the name and the number will suffice.
-
-@findex ASM_OUTPUT_DEF
-@item ASM_OUTPUT_DEF (@var{stream}, @var{name}, @var{value})
-A C statement to output to the stdio stream @var{stream} assembler code
-which defines (equates) the symbol @var{name} to have the value @var{value}.
-
-If SET_ASM_OP is defined, a default definition is provided which is
-correct for most systems.
-
-@findex ASM_OUTPUT_DEFINE_LABEL_DIFFERENCE_SYMBOL
-@item ASM_OUTPUT_DEFINE_LABEL_DIFFERENCE_SYMBOL (@var{stream}, @var{symbol}, @var{high}, @var{low})
-A C statement to output to the stdio stream @var{stream} assembler code
-which defines (equates) the symbol @var{symbol} to have a value equal to
-the difference of the two symbols @var{high} and @var{low}, i.e.
-@var{high} minus @var{low}. GNU CC guarantees that the symbols @var{high}
-and @var{low} are already known by the assembler so that the difference
-resolves into a constant.
-
-If SET_ASM_OP is defined, a default definition is provided which is
-correct for most systems.
-
-@findex ASM_OUTPUT_WEAK_ALIAS
-@item ASM_OUTPUT_WEAK_ALIAS (@var{stream}, @var{name}, @var{value})
-A C statement to output to the stdio stream @var{stream} assembler code
-which defines (equates) the weak symbol @var{name} to have the value
-@var{value}.
-
-Define this macro if the target only supports weak aliases; define
-ASM_OUTPUT_DEF instead if possible.
-
-@findex OBJC_GEN_METHOD_LABEL
-@item OBJC_GEN_METHOD_LABEL (@var{buf}, @var{is_inst}, @var{class_name}, @var{cat_name}, @var{sel_name})
-Define this macro to override the default assembler names used for
-Objective C methods.
-
-The default name is a unique method number followed by the name of the
-class (e.g.@: @samp{_1_Foo}). For methods in categories, the name of
-the category is also included in the assembler name (e.g.@:
-@samp{_1_Foo_Bar}).
-
-These names are safe on most systems, but make debugging difficult since
-the method's selector is not present in the name. Therefore, particular
-systems define other ways of computing names.
-
-@var{buf} is an expression of type @code{char *} which gives you a
-buffer in which to store the name; its length is as long as
-@var{class_name}, @var{cat_name} and @var{sel_name} put together, plus
-50 characters extra.
-
-The argument @var{is_inst} specifies whether the method is an instance
-method or a class method; @var{class_name} is the name of the class;
-@var{cat_name} is the name of the category (or NULL if the method is not
-in a category); and @var{sel_name} is the name of the selector.
-
-On systems where the assembler can handle quoted names, you can use this
-macro to provide more human-readable names.
-@end table
-
-@node Initialization
-@subsection How Initialization Functions Are Handled
-@cindex initialization routines
-@cindex termination routines
-@cindex constructors, output of
-@cindex destructors, output of
-
-The compiled code for certain languages includes @dfn{constructors}
-(also called @dfn{initialization routines})---functions to initialize
-data in the program when the program is started. These functions need
-to be called before the program is ``started''---that is to say, before
-@code{main} is called.
-
-Compiling some languages generates @dfn{destructors} (also called
-@dfn{termination routines}) that should be called when the program
-terminates.
-
-To make the initialization and termination functions work, the compiler
-must output something in the assembler code to cause those functions to
-be called at the appropriate time. When you port the compiler to a new
-system, you need to specify how to do this.
-
-There are two major ways that GCC currently supports the execution of
-initialization and termination functions. Each way has two variants.
-Much of the structure is common to all four variations.
-
-@findex __CTOR_LIST__
-@findex __DTOR_LIST__
-The linker must build two lists of these functions---a list of
-initialization functions, called @code{__CTOR_LIST__}, and a list of
-termination functions, called @code{__DTOR_LIST__}.
-
-Each list always begins with an ignored function pointer (which may hold
-0, @minus{}1, or a count of the function pointers after it, depending on
-the environment). This is followed by a series of zero or more function
-pointers to constructors (or destructors), followed by a function
-pointer containing zero.
-
-Depending on the operating system and its executable file format, either
-@file{crtstuff.c} or @file{libgcc2.c} traverses these lists at startup
-time and exit time. Constructors are called in reverse order of the
-list; destructors in forward order.
-
-The best way to handle static constructors works only for object file
-formats which provide arbitrarily-named sections. A section is set
-aside for a list of constructors, and another for a list of destructors.
-Traditionally these are called @samp{.ctors} and @samp{.dtors}. Each
-object file that defines an initialization function also puts a word in
-the constructor section to point to that function. The linker
-accumulates all these words into one contiguous @samp{.ctors} section.
-Termination functions are handled similarly.
-
-To use this method, you need appropriate definitions of the macros
-@code{ASM_OUTPUT_CONSTRUCTOR} and @code{ASM_OUTPUT_DESTRUCTOR}. Usually
-you can get them by including @file{svr4.h}.
-
-When arbitrary sections are available, there are two variants, depending
-upon how the code in @file{crtstuff.c} is called. On systems that
-support an @dfn{init} section which is executed at program startup,
-parts of @file{crtstuff.c} are compiled into that section. The
-program is linked by the @code{gcc} driver like this:
-
-@example
-ld -o @var{output_file} crtbegin.o @dots{} crtend.o -lgcc
-@end example
-
-The head of a function (@code{__do_global_ctors}) appears in the init
-section of @file{crtbegin.o}; the remainder of the function appears in
-the init section of @file{crtend.o}. The linker will pull these two
-parts of the section together, making a whole function. If any of the
-user's object files linked into the middle of it contribute code, then that
-code will be executed as part of the body of @code{__do_global_ctors}.
-
-To use this variant, you must define the @code{INIT_SECTION_ASM_OP}
-macro properly.
-
-If no init section is available, do not define
-@code{INIT_SECTION_ASM_OP}. Then @code{__do_global_ctors} is built into
-the text section like all other functions, and resides in
-@file{libgcc.a}. When GCC compiles any function called @code{main}, it
-inserts a procedure call to @code{__main} as the first executable code
-after the function prologue. The @code{__main} function, also defined
-in @file{libgcc2.c}, simply calls @file{__do_global_ctors}.
-
-In file formats that don't support arbitrary sections, there are again
-two variants. In the simplest variant, the GNU linker (GNU @code{ld})
-and an `a.out' format must be used. In this case,
-@code{ASM_OUTPUT_CONSTRUCTOR} is defined to produce a @code{.stabs}
-entry of type @samp{N_SETT}, referencing the name @code{__CTOR_LIST__},
-and with the address of the void function containing the initialization
-code as its value. The GNU linker recognizes this as a request to add
-the value to a ``set''; the values are accumulated, and are eventually
-placed in the executable as a vector in the format described above, with
-a leading (ignored) count and a trailing zero element.
-@code{ASM_OUTPUT_DESTRUCTOR} is handled similarly. Since no init
-section is available, the absence of @code{INIT_SECTION_ASM_OP} causes
-the compilation of @code{main} to call @code{__main} as above, starting
-the initialization process.
-
-The last variant uses neither arbitrary sections nor the GNU linker.
-This is preferable when you want to do dynamic linking and when using
-file formats which the GNU linker does not support, such as `ECOFF'. In
-this case, @code{ASM_OUTPUT_CONSTRUCTOR} does not produce an
-@code{N_SETT} symbol; initialization and termination functions are
-recognized simply by their names. This requires an extra program in the
-linkage step, called @code{collect2}. This program pretends to be the
-linker, for use with GNU CC; it does its job by running the ordinary
-linker, but also arranges to include the vectors of initialization and
-termination functions. These functions are called via @code{__main} as
-described above.
-
-Choosing among these configuration options has been simplified by a set
-of operating-system-dependent files in the @file{config} subdirectory.
-These files define all of the relevant parameters. Usually it is
-sufficient to include one into your specific machine-dependent
-configuration file. These files are:
-
-@table @file
-@item aoutos.h
-For operating systems using the `a.out' format.
-
-@item next.h
-For operating systems using the `MachO' format.
-
-@item svr3.h
-For System V Release 3 and similar systems using `COFF' format.
-
-@item svr4.h
-For System V Release 4 and similar systems using `ELF' format.
-
-@item vms.h
-For the VMS operating system.
-@end table
-
-@ifinfo
-The following section describes the specific macros that control and
-customize the handling of initialization and termination functions.
-@end ifinfo
-
-@node Macros for Initialization
-@subsection Macros Controlling Initialization Routines
-
-Here are the macros that control how the compiler handles initialization
-and termination functions:
-
-@table @code
-@findex INIT_SECTION_ASM_OP
-@item INIT_SECTION_ASM_OP
-If defined, a C string constant for the assembler operation to identify
-the following data as initialization code. If not defined, GNU CC will
-assume such a section does not exist. When you are using special
-sections for initialization and termination functions, this macro also
-controls how @file{crtstuff.c} and @file{libgcc2.c} arrange to run the
-initialization functions.
-
-@item HAS_INIT_SECTION
-@findex HAS_INIT_SECTION
-If defined, @code{main} will not call @code{__main} as described above.
-This macro should be defined for systems that control the contents of the
-init section on a symbol-by-symbol basis, such as OSF/1, and should not
-be defined explicitly for systems that support
-@code{INIT_SECTION_ASM_OP}.
-
-@item LD_INIT_SWITCH
-@findex LD_INIT_SWITCH
-If defined, a C string constant for a switch that tells the linker that
-the following symbol is an initialization routine.
-
-@item LD_FINI_SWITCH
-@findex LD_FINI_SWITCH
-If defined, a C string constant for a switch that tells the linker that
-the following symbol is a finalization routine.
-
-@item INVOKE__main
-@findex INVOKE__main
-If defined, @code{main} will call @code{__main} despite the presence of
-@code{INIT_SECTION_ASM_OP}. This macro should be defined for systems
-where the init section is not actually run automatically, but is still
-useful for collecting the lists of constructors and destructors.
-
-@item ASM_OUTPUT_CONSTRUCTOR (@var{stream}, @var{name})
-@findex ASM_OUTPUT_CONSTRUCTOR
-Define this macro as a C statement to output on the stream @var{stream}
-the assembler code to arrange to call the function named @var{name} at
-initialization time.
-
-Assume that @var{name} is the name of a C function generated
-automatically by the compiler. This function takes no arguments. Use
-the function @code{assemble_name} to output the name @var{name}; this
-performs any system-specific syntactic transformations such as adding an
-underscore.
-
-If you don't define this macro, nothing special is output to arrange to
-call the function. This is correct when the function will be called in
-some other manner---for example, by means of the @code{collect2} program,
-which looks through the symbol table to find these functions by their
-names.
-
-@item ASM_OUTPUT_DESTRUCTOR (@var{stream}, @var{name})
-@findex ASM_OUTPUT_DESTRUCTOR
-This is like @code{ASM_OUTPUT_CONSTRUCTOR} but used for termination
-functions rather than initialization functions.
-
-When @code{ASM_OUTPUT_CONSTRUCTOR} and @code{ASM_OUTPUT_DESTRUCTOR} are
-defined, the initializaiton routine generated for the generated object
-file will have static linkage.
-@end table
-
-If your system uses @code{collect2} as the means of processing
-constructors, then that program normally uses @code{nm} to scan an
-object file for constructor functions to be called. On such systems you
-must not define @code{ASM_OUTPUT_CONSTRUCTOR} and @code{ASM_OUTPUT_DESTRUCTOR}
-as the object file's initialization routine must have global scope.
-
-On certain kinds of systems, you can define these macros to make
-@code{collect2} work faster (and, in some cases, make it work at all):
-
-@table @code
-@findex OBJECT_FORMAT_COFF
-@item OBJECT_FORMAT_COFF
-Define this macro if the system uses COFF (Common Object File Format)
-object files, so that @code{collect2} can assume this format and scan
-object files directly for dynamic constructor/destructor functions.
-
-@findex OBJECT_FORMAT_ROSE
-@item OBJECT_FORMAT_ROSE
-Define this macro if the system uses ROSE format object files, so that
-@code{collect2} can assume this format and scan object files directly
-for dynamic constructor/destructor functions.
-
-These macros are effective only in a native compiler; @code{collect2} as
-part of a cross compiler always uses @code{nm} for the target machine.
-
-@findex REAL_NM_FILE_NAME
-@item REAL_NM_FILE_NAME
-Define this macro as a C string constant containing the file name to use
-to execute @code{nm}. The default is to search the path normally for
-@code{nm}.
-
-If your system supports shared libraries and has a program to list the
-dynamic dependencies of a given library or executable, you can define
-these macros to enable support for running initialization and
-termination functions in shared libraries:
-
-@findex LDD_SUFFIX
-@item LDD_SUFFIX
-Define this macro to a C string constant containing the name of the
-program which lists dynamic dependencies, like @code{"ldd"} under SunOS 4.
-
-@findex PARSE_LDD_OUTPUT
-@item PARSE_LDD_OUTPUT (@var{PTR})
-Define this macro to be C code that extracts filenames from the output
-of the program denoted by @code{LDD_SUFFIX}. @var{PTR} is a variable
-of type @code{char *} that points to the beginning of a line of output
-from @code{LDD_SUFFIX}. If the line lists a dynamic dependency, the
-code must advance @var{PTR} to the beginning of the filename on that
-line. Otherwise, it must set @var{PTR} to @code{NULL}.
-
-@end table
-
-@node Instruction Output
-@subsection Output of Assembler Instructions
-
-@c prevent bad page break with this line
-This describes assembler instruction output.
-
-@table @code
-@findex REGISTER_NAMES
-@item REGISTER_NAMES
-A C initializer containing the assembler's names for the machine
-registers, each one as a C string constant. This is what translates
-register numbers in the compiler into assembler language.
-
-@findex ADDITIONAL_REGISTER_NAMES
-@item ADDITIONAL_REGISTER_NAMES
-If defined, a C initializer for an array of structures containing a name
-and a register number. This macro defines additional names for hard
-registers, thus allowing the @code{asm} option in declarations to refer
-to registers using alternate names.
-
-@findex ASM_OUTPUT_OPCODE
-@item ASM_OUTPUT_OPCODE (@var{stream}, @var{ptr})
-Define this macro if you are using an unusual assembler that
-requires different names for the machine instructions.
-
-The definition is a C statement or statements which output an
-assembler instruction opcode to the stdio stream @var{stream}. The
-macro-operand @var{ptr} is a variable of type @code{char *} which
-points to the opcode name in its ``internal'' form---the form that is
-written in the machine description. The definition should output the
-opcode name to @var{stream}, performing any translation you desire, and
-increment the variable @var{ptr} to point at the end of the opcode
-so that it will not be output twice.
-
-In fact, your macro definition may process less than the entire opcode
-name, or more than the opcode name; but if you want to process text
-that includes @samp{%}-sequences to substitute operands, you must take
-care of the substitution yourself. Just be sure to increment
-@var{ptr} over whatever text should not be output normally.
-
-@findex recog_operand
-If you need to look at the operand values, they can be found as the
-elements of @code{recog_operand}.
-
-If the macro definition does nothing, the instruction is output
-in the usual way.
-
-@findex FINAL_PRESCAN_INSN
-@item FINAL_PRESCAN_INSN (@var{insn}, @var{opvec}, @var{noperands})
-If defined, a C statement to be executed just prior to the output of
-assembler code for @var{insn}, to modify the extracted operands so
-they will be output differently.
-
-Here the argument @var{opvec} is the vector containing the operands
-extracted from @var{insn}, and @var{noperands} is the number of
-elements of the vector which contain meaningful data for this insn.
-The contents of this vector are what will be used to convert the insn
-template into assembler code, so you can change the assembler output
-by changing the contents of the vector.
-
-This macro is useful when various assembler syntaxes share a single
-file of instruction patterns; by defining this macro differently, you
-can cause a large class of instructions to be output differently (such
-as with rearranged operands). Naturally, variations in assembler
-syntax affecting individual insn patterns ought to be handled by
-writing conditional output routines in those patterns.
-
-If this macro is not defined, it is equivalent to a null statement.
-
-@findex FINAL_PRESCAN_LABEL
-@item FINAL_PRESCAN_LABEL
-If defined, @code{FINAL_PRESCAN_INSN} will be called on each
-@code{CODE_LABEL}. In that case, @var{opvec} will be a null pointer and
-@var{noperands} will be zero.
-
-@findex PRINT_OPERAND
-@item PRINT_OPERAND (@var{stream}, @var{x}, @var{code})
-A C compound statement to output to stdio stream @var{stream} the
-assembler syntax for an instruction operand @var{x}. @var{x} is an
-RTL expression.
-
-@var{code} is a value that can be used to specify one of several ways
-of printing the operand. It is used when identical operands must be
-printed differently depending on the context. @var{code} comes from
-the @samp{%} specification that was used to request printing of the
-operand. If the specification was just @samp{%@var{digit}} then
-@var{code} is 0; if the specification was @samp{%@var{ltr}
-@var{digit}} then @var{code} is the ASCII code for @var{ltr}.
-
-@findex reg_names
-If @var{x} is a register, this macro should print the register's name.
-The names can be found in an array @code{reg_names} whose type is
-@code{char *[]}. @code{reg_names} is initialized from
-@code{REGISTER_NAMES}.
-
-When the machine description has a specification @samp{%@var{punct}}
-(a @samp{%} followed by a punctuation character), this macro is called
-with a null pointer for @var{x} and the punctuation character for
-@var{code}.
-
-@findex PRINT_OPERAND_PUNCT_VALID_P
-@item PRINT_OPERAND_PUNCT_VALID_P (@var{code})
-A C expression which evaluates to true if @var{code} is a valid
-punctuation character for use in the @code{PRINT_OPERAND} macro. If
-@code{PRINT_OPERAND_PUNCT_VALID_P} is not defined, it means that no
-punctuation characters (except for the standard one, @samp{%}) are used
-in this way.
-
-@findex PRINT_OPERAND_ADDRESS
-@item PRINT_OPERAND_ADDRESS (@var{stream}, @var{x})
-A C compound statement to output to stdio stream @var{stream} the
-assembler syntax for an instruction operand that is a memory reference
-whose address is @var{x}. @var{x} is an RTL expression.
-
-@cindex @code{ENCODE_SECTION_INFO} usage
-On some machines, the syntax for a symbolic address depends on the
-section that the address refers to. On these machines, define the macro
-@code{ENCODE_SECTION_INFO} to store the information into the
-@code{symbol_ref}, and then check for it here. @xref{Assembler Format}.
-
-@findex DBR_OUTPUT_SEQEND
-@findex dbr_sequence_length
-@item DBR_OUTPUT_SEQEND(@var{file})
-A C statement, to be executed after all slot-filler instructions have
-been output. If necessary, call @code{dbr_sequence_length} to
-determine the number of slots filled in a sequence (zero if not
-currently outputting a sequence), to decide how many no-ops to output,
-or whatever.
-
-Don't define this macro if it has nothing to do, but it is helpful in
-reading assembly output if the extent of the delay sequence is made
-explicit (e.g. with white space).
-
-@findex final_sequence
-Note that output routines for instructions with delay slots must be
-prepared to deal with not being output as part of a sequence (i.e.
-when the scheduling pass is not run, or when no slot fillers could be
-found.) The variable @code{final_sequence} is null when not
-processing a sequence, otherwise it contains the @code{sequence} rtx
-being output.
-
-@findex REGISTER_PREFIX
-@findex LOCAL_LABEL_PREFIX
-@findex USER_LABEL_PREFIX
-@findex IMMEDIATE_PREFIX
-@findex asm_fprintf
-@item REGISTER_PREFIX
-@itemx LOCAL_LABEL_PREFIX
-@itemx USER_LABEL_PREFIX
-@itemx IMMEDIATE_PREFIX
-If defined, C string expressions to be used for the @samp{%R}, @samp{%L},
-@samp{%U}, and @samp{%I} options of @code{asm_fprintf} (see
-@file{final.c}). These are useful when a single @file{md} file must
-support multiple assembler formats. In that case, the various @file{tm.h}
-files can define these macros differently.
-
-@findex ASSEMBLER_DIALECT
-@item ASSEMBLER_DIALECT
-If your target supports multiple dialects of assembler language (such as
-different opcodes), define this macro as a C expression that gives the
-numeric index of the assembler language dialect to use, with zero as the
-first variant.
-
-If this macro is defined, you may use constructs of the form
-@samp{@{option0|option1|option2@dots{}@}} in the output
-templates of patterns (@pxref{Output Template}) or in the first argument
-of @code{asm_fprintf}. This construct outputs @samp{option0},
-@samp{option1} or @samp{option2}, etc., if the value of
-@code{ASSEMBLER_DIALECT} is zero, one or two, etc. Any special
-characters within these strings retain their usual meaning.
-
-If you do not define this macro, the characters @samp{@{}, @samp{|} and
-@samp{@}} do not have any special meaning when used in templates or
-operands to @code{asm_fprintf}.
-
-Define the macros @code{REGISTER_PREFIX}, @code{LOCAL_LABEL_PREFIX},
-@code{USER_LABEL_PREFIX} and @code{IMMEDIATE_PREFIX} if you can express
-the variations in assembler language syntax with that mechanism. Define
-@code{ASSEMBLER_DIALECT} and use the @samp{@{option0|option1@}} syntax
-if the syntax variant are larger and involve such things as different
-opcodes or operand order.
-
-@findex ASM_OUTPUT_REG_PUSH
-@item ASM_OUTPUT_REG_PUSH (@var{stream}, @var{regno})
-A C expression to output to @var{stream} some assembler code
-which will push hard register number @var{regno} onto the stack.
-The code need not be optimal, since this macro is used only when
-profiling.
-
-@findex ASM_OUTPUT_REG_POP
-@item ASM_OUTPUT_REG_POP (@var{stream}, @var{regno})
-A C expression to output to @var{stream} some assembler code
-which will pop hard register number @var{regno} off of the stack.
-The code need not be optimal, since this macro is used only when
-profiling.
-@end table
-
-@node Dispatch Tables
-@subsection Output of Dispatch Tables
-
-@c prevent bad page break with this line
-This concerns dispatch tables.
-
-@table @code
-@cindex dispatch table
-@findex ASM_OUTPUT_ADDR_DIFF_ELT
-@item ASM_OUTPUT_ADDR_DIFF_ELT (@var{stream}, @var{body}, @var{value}, @var{rel})
-A C statement to output to the stdio stream @var{stream} an assembler
-pseudo-instruction to generate a difference between two labels.
-@var{value} and @var{rel} are the numbers of two internal labels. The
-definitions of these labels are output using
-@code{ASM_OUTPUT_INTERNAL_LABEL}, and they must be printed in the same
-way here. For example,
-
-@example
-fprintf (@var{stream}, "\t.word L%d-L%d\n",
- @var{value}, @var{rel})
-@end example
-
-You must provide this macro on machines where the addresses in a
-dispatch table are relative to the table's own address. If defined, GNU
-CC will also use this macro on all machines when producing PIC.
-@var{body} is the body of the ADDR_DIFF_VEC; it is provided so that the
-mode and flags can be read.
-
-@findex ASM_OUTPUT_ADDR_VEC_ELT
-@item ASM_OUTPUT_ADDR_VEC_ELT (@var{stream}, @var{value})
-This macro should be provided on machines where the addresses
-in a dispatch table are absolute.
-
-The definition should be a C statement to output to the stdio stream
-@var{stream} an assembler pseudo-instruction to generate a reference to
-a label. @var{value} is the number of an internal label whose
-definition is output using @code{ASM_OUTPUT_INTERNAL_LABEL}.
-For example,
-
-@example
-fprintf (@var{stream}, "\t.word L%d\n", @var{value})
-@end example
-
-@findex ASM_OUTPUT_CASE_LABEL
-@item ASM_OUTPUT_CASE_LABEL (@var{stream}, @var{prefix}, @var{num}, @var{table})
-Define this if the label before a jump-table needs to be output
-specially. The first three arguments are the same as for
-@code{ASM_OUTPUT_INTERNAL_LABEL}; the fourth argument is the
-jump-table which follows (a @code{jump_insn} containing an
-@code{addr_vec} or @code{addr_diff_vec}).
-
-This feature is used on system V to output a @code{swbeg} statement
-for the table.
-
-If this macro is not defined, these labels are output with
-@code{ASM_OUTPUT_INTERNAL_LABEL}.
-
-@findex ASM_OUTPUT_CASE_END
-@item ASM_OUTPUT_CASE_END (@var{stream}, @var{num}, @var{table})
-Define this if something special must be output at the end of a
-jump-table. The definition should be a C statement to be executed
-after the assembler code for the table is written. It should write
-the appropriate code to stdio stream @var{stream}. The argument
-@var{table} is the jump-table insn, and @var{num} is the label-number
-of the preceding label.
-
-If this macro is not defined, nothing special is output at the end of
-the jump-table.
-@end table
-
-@node Exception Region Output
-@subsection Assembler Commands for Exception Regions
-
-@c prevent bad page break with this line
-
-This describes commands marking the start and the end of an exception
-region.
-
-@table @code
-@findex ASM_OUTPUT_EH_REGION_BEG
-@item ASM_OUTPUT_EH_REGION_BEG ()
-A C expression to output text to mark the start of an exception region.
-
-This macro need not be defined on most platforms.
-
-@findex ASM_OUTPUT_EH_REGION_END
-@item ASM_OUTPUT_EH_REGION_END ()
-A C expression to output text to mark the end of an exception region.
-
-This macro need not be defined on most platforms.
-
-@findex EXCEPTION_SECTION
-@item EXCEPTION_SECTION ()
-A C expression to switch to the section in which the main
-exception table is to be placed (@pxref{Sections}). The default is a
-section named @code{.gcc_except_table} on machines that support named
-sections via @code{ASM_OUTPUT_SECTION_NAME}, otherwise if @samp{-fpic}
-or @samp{-fPIC} is in effect, the @code{data_section}, otherwise the
-@code{readonly_data_section}.
-
-@findex EH_FRAME_SECTION_ASM_OP
-@item EH_FRAME_SECTION_ASM_OP
-If defined, a C string constant for the assembler operation to switch to
-the section for exception handling frame unwind information. If not
-defined, GNU CC will provide a default definition if the target supports
-named sections. @file{crtstuff.c} uses this macro to switch to the
-appropriate section.
-
-You should define this symbol if your target supports DWARF 2 frame
-unwind information and the default definition does not work.
-
-@findex OMIT_EH_TABLE
-@item OMIT_EH_TABLE ()
-A C expression that is nonzero if the normal exception table output
-should be omitted.
-
-This macro need not be defined on most platforms.
-
-@findex EH_TABLE_LOOKUP
-@item EH_TABLE_LOOKUP ()
-Alternate runtime support for looking up an exception at runtime and
-finding the associated handler, if the default method won't work.
-
-This macro need not be defined on most platforms.
-
-@findex DOESNT_NEED_UNWINDER
-@item DOESNT_NEED_UNWINDER
-A C expression that decides whether or not the current function needs to
-have a function unwinder generated for it. See the file @code{except.c}
-for details on when to define this, and how.
-
-@findex MASK_RETURN_ADDR
-@item MASK_RETURN_ADDR
-An rtx used to mask the return address found via RETURN_ADDR_RTX, so
-that it does not contain any extraneous set bits in it.
-
-@findex DWARF2_UNWIND_INFO
-@item DWARF2_UNWIND_INFO
-Define this macro to 0 if your target supports DWARF 2 frame unwind
-information, but it does not yet work with exception handling.
-Otherwise, if your target supports this information (if it defines
-@samp{INCOMING_RETURN_ADDR_RTX} and either @samp{UNALIGNED_INT_ASM_OP}
-or @samp{OBJECT_FORMAT_ELF}), GCC will provide a default definition of
-1.
-
-If this macro is defined to 1, the DWARF 2 unwinder will be the default
-exception handling mechanism; otherwise, setjmp/longjmp will be used by
-default.
-
-If this macro is defined to anything, the DWARF 2 unwinder will be used
-instead of inline unwinders and __unwind_function in the non-setjmp case.
-
-@end table
-
-@node Alignment Output
-@subsection Assembler Commands for Alignment
-
-@c prevent bad page break with this line
-This describes commands for alignment.
-
-@table @code
-@findex LABEL_ALIGN_AFTER_BARRIER
-@item LABEL_ALIGN_AFTER_BARRIER (@var{label})
-The alignment (log base 2) to put in front of @var{label}, which follows
-a BARRIER.
-
-This macro need not be defined if you don't want any special alignment
-to be done at such a time. Most machine descriptions do not currently
-define the macro.
-
-@findex LOOP_ALIGN
-@item LOOP_ALIGN (@var{label})
-The alignment (log base 2) to put in front of @var{label}, which follows
-a NOTE_INSN_LOOP_BEG note.
-
-This macro need not be defined if you don't want any special alignment
-to be done at such a time. Most machine descriptions do not currently
-define the macro.
-
-@findex LABEL_ALIGN
-@item LABEL_ALIGN (@var{label})
-The alignment (log base 2) to put in front of @var{label}.
-If LABEL_ALIGN_AFTER_BARRIER / LOOP_ALIGN specify a different alignment,
-the maximum of the specified values is used.
-
-@findex ASM_OUTPUT_SKIP
-@item ASM_OUTPUT_SKIP (@var{stream}, @var{nbytes})
-A C statement to output to the stdio stream @var{stream} an assembler
-instruction to advance the location counter by @var{nbytes} bytes.
-Those bytes should be zero when loaded. @var{nbytes} will be a C
-expression of type @code{int}.
-
-@findex ASM_NO_SKIP_IN_TEXT
-@item ASM_NO_SKIP_IN_TEXT
-Define this macro if @code{ASM_OUTPUT_SKIP} should not be used in the
-text section because it fails to put zeros in the bytes that are skipped.
-This is true on many Unix systems, where the pseudo--op to skip bytes
-produces no-op instructions rather than zeros when used in the text
-section.
-
-@findex ASM_OUTPUT_ALIGN
-@item ASM_OUTPUT_ALIGN (@var{stream}, @var{power})
-A C statement to output to the stdio stream @var{stream} an assembler
-command to advance the location counter to a multiple of 2 to the
-@var{power} bytes. @var{power} will be a C expression of type @code{int}.
-
-@findex ASM_OUTPUT_MAX_SKIP_ALIGN
-@item ASM_OUTPUT_MAX_SKIP_ALIGN (@var{stream}, @var{power}, @var{max_skip})
-A C statement to output to the stdio stream @var{stream} an assembler
-command to advance the location counter to a multiple of 2 to the
-@var{power} bytes, but only if @var{max_skip} or fewer bytes are needed to
-satisfy the alignment request. @var{power} and @var{max_skip} will be
-a C expression of type @code{int}.
-@end table
-
-@need 3000
-@node Debugging Info
-@section Controlling Debugging Information Format
-
-@c prevent bad page break with this line
-This describes how to specify debugging information.
-
-@menu
-* All Debuggers:: Macros that affect all debugging formats uniformly.
-* DBX Options:: Macros enabling specific options in DBX format.
-* DBX Hooks:: Hook macros for varying DBX format.
-* File Names and DBX:: Macros controlling output of file names in DBX format.
-* SDB and DWARF:: Macros for SDB (COFF) and DWARF formats.
-@end menu
-
-@node All Debuggers
-@subsection Macros Affecting All Debugging Formats
-
-@c prevent bad page break with this line
-These macros affect all debugging formats.
-
-@table @code
-@findex DBX_REGISTER_NUMBER
-@item DBX_REGISTER_NUMBER (@var{regno})
-A C expression that returns the DBX register number for the compiler
-register number @var{regno}. In simple cases, the value of this
-expression may be @var{regno} itself. But sometimes there are some
-registers that the compiler knows about and DBX does not, or vice
-versa. In such cases, some register may need to have one number in
-the compiler and another for DBX.
-
-If two registers have consecutive numbers inside GNU CC, and they can be
-used as a pair to hold a multiword value, then they @emph{must} have
-consecutive numbers after renumbering with @code{DBX_REGISTER_NUMBER}.
-Otherwise, debuggers will be unable to access such a pair, because they
-expect register pairs to be consecutive in their own numbering scheme.
-
-If you find yourself defining @code{DBX_REGISTER_NUMBER} in way that
-does not preserve register pairs, then what you must do instead is
-redefine the actual register numbering scheme.
-
-@findex DEBUGGER_AUTO_OFFSET
-@item DEBUGGER_AUTO_OFFSET (@var{x})
-A C expression that returns the integer offset value for an automatic
-variable having address @var{x} (an RTL expression). The default
-computation assumes that @var{x} is based on the frame-pointer and
-gives the offset from the frame-pointer. This is required for targets
-that produce debugging output for DBX or COFF-style debugging output
-for SDB and allow the frame-pointer to be eliminated when the
-@samp{-g} options is used.
-
-@findex DEBUGGER_ARG_OFFSET
-@item DEBUGGER_ARG_OFFSET (@var{offset}, @var{x})
-A C expression that returns the integer offset value for an argument
-having address @var{x} (an RTL expression). The nominal offset is
-@var{offset}.
-
-@findex PREFERRED_DEBUGGING_TYPE
-@item PREFERRED_DEBUGGING_TYPE
-A C expression that returns the type of debugging output GNU CC should
-produce when the user specifies just @samp{-g}. Define
-this if you have arranged for GNU CC to support more than one format of
-debugging output. Currently, the allowable values are @code{DBX_DEBUG},
-@code{SDB_DEBUG}, @code{DWARF_DEBUG}, @code{DWARF2_DEBUG}, and
-@code{XCOFF_DEBUG}.
-
-When the user specifies @samp{-ggdb}, GNU CC normally also uses the
-value of this macro to select the debugging output format, but with two
-exceptions. If @code{DWARF2_DEBUGGING_INFO} is defined and
-@code{LINKER_DOES_NOT_WORK_WITH_DWARF2} is not defined, GNU CC uses the
-value @code{DWARF2_DEBUG}. Otherwise, if @code{DBX_DEBUGGING_INFO} is
-defined, GNU CC uses @code{DBX_DEBUG}.
-
-The value of this macro only affects the default debugging output; the
-user can always get a specific type of output by using @samp{-gstabs},
-@samp{-gcoff}, @samp{-gdwarf-1}, @samp{-gdwarf-2}, or @samp{-gxcoff}.
-@end table
-
-@node DBX Options
-@subsection Specific Options for DBX Output
-
-@c prevent bad page break with this line
-These are specific options for DBX output.
-
-@table @code
-@findex DBX_DEBUGGING_INFO
-@item DBX_DEBUGGING_INFO
-Define this macro if GNU CC should produce debugging output for DBX
-in response to the @samp{-g} option.
-
-@findex XCOFF_DEBUGGING_INFO
-@item XCOFF_DEBUGGING_INFO
-Define this macro if GNU CC should produce XCOFF format debugging output
-in response to the @samp{-g} option. This is a variant of DBX format.
-
-@findex DEFAULT_GDB_EXTENSIONS
-@item DEFAULT_GDB_EXTENSIONS
-Define this macro to control whether GNU CC should by default generate
-GDB's extended version of DBX debugging information (assuming DBX-format
-debugging information is enabled at all). If you don't define the
-macro, the default is 1: always generate the extended information
-if there is any occasion to.
-
-@findex DEBUG_SYMS_TEXT
-@item DEBUG_SYMS_TEXT
-Define this macro if all @code{.stabs} commands should be output while
-in the text section.
-
-@findex ASM_STABS_OP
-@item ASM_STABS_OP
-A C string constant naming the assembler pseudo op to use instead of
-@code{.stabs} to define an ordinary debugging symbol. If you don't
-define this macro, @code{.stabs} is used. This macro applies only to
-DBX debugging information format.
-
-@findex ASM_STABD_OP
-@item ASM_STABD_OP
-A C string constant naming the assembler pseudo op to use instead of
-@code{.stabd} to define a debugging symbol whose value is the current
-location. If you don't define this macro, @code{.stabd} is used.
-This macro applies only to DBX debugging information format.
-
-@findex ASM_STABN_OP
-@item ASM_STABN_OP
-A C string constant naming the assembler pseudo op to use instead of
-@code{.stabn} to define a debugging symbol with no name. If you don't
-define this macro, @code{.stabn} is used. This macro applies only to
-DBX debugging information format.
-
-@findex DBX_NO_XREFS
-@item DBX_NO_XREFS
-Define this macro if DBX on your system does not support the construct
-@samp{xs@var{tagname}}. On some systems, this construct is used to
-describe a forward reference to a structure named @var{tagname}.
-On other systems, this construct is not supported at all.
-
-@findex DBX_CONTIN_LENGTH
-@item DBX_CONTIN_LENGTH
-A symbol name in DBX-format debugging information is normally
-continued (split into two separate @code{.stabs} directives) when it
-exceeds a certain length (by default, 80 characters). On some
-operating systems, DBX requires this splitting; on others, splitting
-must not be done. You can inhibit splitting by defining this macro
-with the value zero. You can override the default splitting-length by
-defining this macro as an expression for the length you desire.
-
-@findex DBX_CONTIN_CHAR
-@item DBX_CONTIN_CHAR
-Normally continuation is indicated by adding a @samp{\} character to
-the end of a @code{.stabs} string when a continuation follows. To use
-a different character instead, define this macro as a character
-constant for the character you want to use. Do not define this macro
-if backslash is correct for your system.
-
-@findex DBX_STATIC_STAB_DATA_SECTION
-@item DBX_STATIC_STAB_DATA_SECTION
-Define this macro if it is necessary to go to the data section before
-outputting the @samp{.stabs} pseudo-op for a non-global static
-variable.
-
-@findex DBX_TYPE_DECL_STABS_CODE
-@item DBX_TYPE_DECL_STABS_CODE
-The value to use in the ``code'' field of the @code{.stabs} directive
-for a typedef. The default is @code{N_LSYM}.
-
-@findex DBX_STATIC_CONST_VAR_CODE
-@item DBX_STATIC_CONST_VAR_CODE
-The value to use in the ``code'' field of the @code{.stabs} directive
-for a static variable located in the text section. DBX format does not
-provide any ``right'' way to do this. The default is @code{N_FUN}.
-
-@findex DBX_REGPARM_STABS_CODE
-@item DBX_REGPARM_STABS_CODE
-The value to use in the ``code'' field of the @code{.stabs} directive
-for a parameter passed in registers. DBX format does not provide any
-``right'' way to do this. The default is @code{N_RSYM}.
-
-@findex DBX_REGPARM_STABS_LETTER
-@item DBX_REGPARM_STABS_LETTER
-The letter to use in DBX symbol data to identify a symbol as a parameter
-passed in registers. DBX format does not customarily provide any way to
-do this. The default is @code{'P'}.
-
-@findex DBX_MEMPARM_STABS_LETTER
-@item DBX_MEMPARM_STABS_LETTER
-The letter to use in DBX symbol data to identify a symbol as a stack
-parameter. The default is @code{'p'}.
-
-@findex DBX_FUNCTION_FIRST
-@item DBX_FUNCTION_FIRST
-Define this macro if the DBX information for a function and its
-arguments should precede the assembler code for the function. Normally,
-in DBX format, the debugging information entirely follows the assembler
-code.
-
-@findex DBX_LBRAC_FIRST
-@item DBX_LBRAC_FIRST
-Define this macro if the @code{N_LBRAC} symbol for a block should
-precede the debugging information for variables and functions defined in
-that block. Normally, in DBX format, the @code{N_LBRAC} symbol comes
-first.
-
-@findex DBX_BLOCKS_FUNCTION_RELATIVE
-@item DBX_BLOCKS_FUNCTION_RELATIVE
-Define this macro if the value of a symbol describing the scope of a
-block (@code{N_LBRAC} or @code{N_RBRAC}) should be relative to the start
-of the enclosing function. Normally, GNU C uses an absolute address.
-
-@findex DBX_USE_BINCL
-@item DBX_USE_BINCL
-Define this macro if GNU C should generate @code{N_BINCL} and
-@code{N_EINCL} stabs for included header files, as on Sun systems. This
-macro also directs GNU C to output a type number as a pair of a file
-number and a type number within the file. Normally, GNU C does not
-generate @code{N_BINCL} or @code{N_EINCL} stabs, and it outputs a single
-number for a type number.
-@end table
-
-@node DBX Hooks
-@subsection Open-Ended Hooks for DBX Format
-
-@c prevent bad page break with this line
-These are hooks for DBX format.
-
-@table @code
-@findex DBX_OUTPUT_LBRAC
-@item DBX_OUTPUT_LBRAC (@var{stream}, @var{name})
-Define this macro to say how to output to @var{stream} the debugging
-information for the start of a scope level for variable names. The
-argument @var{name} is the name of an assembler symbol (for use with
-@code{assemble_name}) whose value is the address where the scope begins.
-
-@findex DBX_OUTPUT_RBRAC
-@item DBX_OUTPUT_RBRAC (@var{stream}, @var{name})
-Like @code{DBX_OUTPUT_LBRAC}, but for the end of a scope level.
-
-@findex DBX_OUTPUT_ENUM
-@item DBX_OUTPUT_ENUM (@var{stream}, @var{type})
-Define this macro if the target machine requires special handling to
-output an enumeration type. The definition should be a C statement
-(sans semicolon) to output the appropriate information to @var{stream}
-for the type @var{type}.
-
-@findex DBX_OUTPUT_FUNCTION_END
-@item DBX_OUTPUT_FUNCTION_END (@var{stream}, @var{function})
-Define this macro if the target machine requires special output at the
-end of the debugging information for a function. The definition should
-be a C statement (sans semicolon) to output the appropriate information
-to @var{stream}. @var{function} is the @code{FUNCTION_DECL} node for
-the function.
-
-@findex DBX_OUTPUT_STANDARD_TYPES
-@item DBX_OUTPUT_STANDARD_TYPES (@var{syms})
-Define this macro if you need to control the order of output of the
-standard data types at the beginning of compilation. The argument
-@var{syms} is a @code{tree} which is a chain of all the predefined
-global symbols, including names of data types.
-
-Normally, DBX output starts with definitions of the types for integers
-and characters, followed by all the other predefined types of the
-particular language in no particular order.
-
-On some machines, it is necessary to output different particular types
-first. To do this, define @code{DBX_OUTPUT_STANDARD_TYPES} to output
-those symbols in the necessary order. Any predefined types that you
-don't explicitly output will be output afterward in no particular order.
-
-Be careful not to define this macro so that it works only for C. There
-are no global variables to access most of the built-in types, because
-another language may have another set of types. The way to output a
-particular type is to look through @var{syms} to see if you can find it.
-Here is an example:
-
-@smallexample
-@{
- tree decl;
- for (decl = syms; decl; decl = TREE_CHAIN (decl))
- if (!strcmp (IDENTIFIER_POINTER (DECL_NAME (decl)),
- "long int"))
- dbxout_symbol (decl);
- @dots{}
-@}
-@end smallexample
-
-@noindent
-This does nothing if the expected type does not exist.
-
-See the function @code{init_decl_processing} in @file{c-decl.c} to find
-the names to use for all the built-in C types.
-
-Here is another way of finding a particular type:
-
-@c this is still overfull. --mew 10feb93
-@smallexample
-@{
- tree decl;
- for (decl = syms; decl; decl = TREE_CHAIN (decl))
- if (TREE_CODE (decl) == TYPE_DECL
- && (TREE_CODE (TREE_TYPE (decl))
- == INTEGER_CST)
- && TYPE_PRECISION (TREE_TYPE (decl)) == 16
- && TYPE_UNSIGNED (TREE_TYPE (decl)))
-@group
- /* @r{This must be @code{unsigned short}.} */
- dbxout_symbol (decl);
- @dots{}
-@}
-@end group
-@end smallexample
-
-@findex NO_DBX_FUNCTION_END
-@item NO_DBX_FUNCTION_END
-Some stabs encapsulation formats (in particular ECOFF), cannot handle the
-@code{.stabs "",N_FUN,,0,0,Lscope-function-1} gdb dbx extention construct.
-On those machines, define this macro to turn this feature off without
-disturbing the rest of the gdb extensions.
-
-@end table
-
-@node File Names and DBX
-@subsection File Names in DBX Format
-
-@c prevent bad page break with this line
-This describes file names in DBX format.
-
-@table @code
-@findex DBX_WORKING_DIRECTORY
-@item DBX_WORKING_DIRECTORY
-Define this if DBX wants to have the current directory recorded in each
-object file.
-
-Note that the working directory is always recorded if GDB extensions are
-enabled.
-
-@findex DBX_OUTPUT_MAIN_SOURCE_FILENAME
-@item DBX_OUTPUT_MAIN_SOURCE_FILENAME (@var{stream}, @var{name})
-A C statement to output DBX debugging information to the stdio stream
-@var{stream} which indicates that file @var{name} is the main source
-file---the file specified as the input file for compilation.
-This macro is called only once, at the beginning of compilation.
-
-This macro need not be defined if the standard form of output
-for DBX debugging information is appropriate.
-
-@findex DBX_OUTPUT_MAIN_SOURCE_DIRECTORY
-@item DBX_OUTPUT_MAIN_SOURCE_DIRECTORY (@var{stream}, @var{name})
-A C statement to output DBX debugging information to the stdio stream
-@var{stream} which indicates that the current directory during
-compilation is named @var{name}.
-
-This macro need not be defined if the standard form of output
-for DBX debugging information is appropriate.
-
-@findex DBX_OUTPUT_MAIN_SOURCE_FILE_END
-@item DBX_OUTPUT_MAIN_SOURCE_FILE_END (@var{stream}, @var{name})
-A C statement to output DBX debugging information at the end of
-compilation of the main source file @var{name}.
-
-If you don't define this macro, nothing special is output at the end
-of compilation, which is correct for most machines.
-
-@findex DBX_OUTPUT_SOURCE_FILENAME
-@item DBX_OUTPUT_SOURCE_FILENAME (@var{stream}, @var{name})
-A C statement to output DBX debugging information to the stdio stream
-@var{stream} which indicates that file @var{name} is the current source
-file. This output is generated each time input shifts to a different
-source file as a result of @samp{#include}, the end of an included file,
-or a @samp{#line} command.
-
-This macro need not be defined if the standard form of output
-for DBX debugging information is appropriate.
-@end table
-
-@need 2000
-@node SDB and DWARF
-@subsection Macros for SDB and DWARF Output
-
-@c prevent bad page break with this line
-Here are macros for SDB and DWARF output.
-
-@table @code
-@findex SDB_DEBUGGING_INFO
-@item SDB_DEBUGGING_INFO
-Define this macro if GNU CC should produce COFF-style debugging output
-for SDB in response to the @samp{-g} option.
-
-@findex DWARF_DEBUGGING_INFO
-@item DWARF_DEBUGGING_INFO
-Define this macro if GNU CC should produce dwarf format debugging output
-in response to the @samp{-g} option.
-
-@findex DWARF2_DEBUGGING_INFO
-@item DWARF2_DEBUGGING_INFO
-Define this macro if GNU CC should produce dwarf version 2 format
-debugging output in response to the @samp{-g} option.
-
-To support optional call frame debugging information, you must also
-define @code{INCOMING_RETURN_ADDR_RTX} and either set
-@code{RTX_FRAME_RELATED_P} on the prologue insns if you use RTL for the
-prologue, or call @code{dwarf2out_def_cfa} and @code{dwarf2out_reg_save}
-as appropriate from @code{FUNCTION_PROLOGUE} if you don't.
-
-@findex DWARF2_FRAME_INFO
-@item DWARF2_FRAME_INFO
-Define this macro to a nonzero value if GNU CC should always output
-Dwarf 2 frame information. If @code{DWARF2_UNWIND_INFO}
-(@pxref{Exception Region Output} is nonzero, GNU CC will output this
-information not matter how you define @code{DWARF2_FRAME_INFO}.
-
-@findex LINKER_DOES_NOT_WORK_WITH_DWARF2
-@item LINKER_DOES_NOT_WORK_WITH_DWARF2
-Define this macro if the linker does not work with Dwarf version 2.
-Normally, if the user specifies only @samp{-ggdb} GNU CC will use Dwarf
-version 2 if available; this macro disables this. See the description
-of the @code{PREFERRED_DEBUGGING_TYPE} macro for more details.
-
-@findex PUT_SDB_@dots{}
-@item PUT_SDB_@dots{}
-Define these macros to override the assembler syntax for the special
-SDB assembler directives. See @file{sdbout.c} for a list of these
-macros and their arguments. If the standard syntax is used, you need
-not define them yourself.
-
-@findex SDB_DELIM
-@item SDB_DELIM
-Some assemblers do not support a semicolon as a delimiter, even between
-SDB assembler directives. In that case, define this macro to be the
-delimiter to use (usually @samp{\n}). It is not necessary to define
-a new set of @code{PUT_SDB_@var{op}} macros if this is the only change
-required.
-
-@findex SDB_GENERATE_FAKE
-@item SDB_GENERATE_FAKE
-Define this macro to override the usual method of constructing a dummy
-name for anonymous structure and union types. See @file{sdbout.c} for
-more information.
-
-@findex SDB_ALLOW_UNKNOWN_REFERENCES
-@item SDB_ALLOW_UNKNOWN_REFERENCES
-Define this macro to allow references to unknown structure,
-union, or enumeration tags to be emitted. Standard COFF does not
-allow handling of unknown references, MIPS ECOFF has support for
-it.
-
-@findex SDB_ALLOW_FORWARD_REFERENCES
-@item SDB_ALLOW_FORWARD_REFERENCES
-Define this macro to allow references to structure, union, or
-enumeration tags that have not yet been seen to be handled. Some
-assemblers choke if forward tags are used, while some require it.
-@end table
-
-@node Cross-compilation
-@section Cross Compilation and Floating Point
-@cindex cross compilation and floating point
-@cindex floating point and cross compilation
-
-While all modern machines use 2's complement representation for integers,
-there are a variety of representations for floating point numbers. This
-means that in a cross-compiler the representation of floating point numbers
-in the compiled program may be different from that used in the machine
-doing the compilation.
-
-@findex atof
-Because different representation systems may offer different amounts of
-range and precision, the cross compiler cannot safely use the host
-machine's floating point arithmetic. Therefore, floating point constants
-must be represented in the target machine's format. This means that the
-cross compiler cannot use @code{atof} to parse a floating point constant;
-it must have its own special routine to use instead. Also, constant
-folding must emulate the target machine's arithmetic (or must not be done
-at all).
-
-The macros in the following table should be defined only if you are cross
-compiling between different floating point formats.
-
-Otherwise, don't define them. Then default definitions will be set up which
-use @code{double} as the data type, @code{==} to test for equality, etc.
-
-You don't need to worry about how many times you use an operand of any
-of these macros. The compiler never uses operands which have side effects.
-
-@table @code
-@findex REAL_VALUE_TYPE
-@item REAL_VALUE_TYPE
-A macro for the C data type to be used to hold a floating point value
-in the target machine's format. Typically this would be a
-@code{struct} containing an array of @code{int}.
-
-@findex REAL_VALUES_EQUAL
-@item REAL_VALUES_EQUAL (@var{x}, @var{y})
-A macro for a C expression which compares for equality the two values,
-@var{x} and @var{y}, both of type @code{REAL_VALUE_TYPE}.
-
-@findex REAL_VALUES_LESS
-@item REAL_VALUES_LESS (@var{x}, @var{y})
-A macro for a C expression which tests whether @var{x} is less than
-@var{y}, both values being of type @code{REAL_VALUE_TYPE} and
-interpreted as floating point numbers in the target machine's
-representation.
-
-@findex REAL_VALUE_LDEXP
-@findex ldexp
-@item REAL_VALUE_LDEXP (@var{x}, @var{scale})
-A macro for a C expression which performs the standard library
-function @code{ldexp}, but using the target machine's floating point
-representation. Both @var{x} and the value of the expression have
-type @code{REAL_VALUE_TYPE}. The second argument, @var{scale}, is an
-integer.
-
-@findex REAL_VALUE_FIX
-@item REAL_VALUE_FIX (@var{x})
-A macro whose definition is a C expression to convert the target-machine
-floating point value @var{x} to a signed integer. @var{x} has type
-@code{REAL_VALUE_TYPE}.
-
-@findex REAL_VALUE_UNSIGNED_FIX
-@item REAL_VALUE_UNSIGNED_FIX (@var{x})
-A macro whose definition is a C expression to convert the target-machine
-floating point value @var{x} to an unsigned integer. @var{x} has type
-@code{REAL_VALUE_TYPE}.
-
-@findex REAL_VALUE_RNDZINT
-@item REAL_VALUE_RNDZINT (@var{x})
-A macro whose definition is a C expression to round the target-machine
-floating point value @var{x} towards zero to an integer value (but still
-as a floating point number). @var{x} has type @code{REAL_VALUE_TYPE},
-and so does the value.
-
-@findex REAL_VALUE_UNSIGNED_RNDZINT
-@item REAL_VALUE_UNSIGNED_RNDZINT (@var{x})
-A macro whose definition is a C expression to round the target-machine
-floating point value @var{x} towards zero to an unsigned integer value
-(but still represented as a floating point number). @var{x} has type
-@code{REAL_VALUE_TYPE}, and so does the value.
-
-@findex REAL_VALUE_ATOF
-@item REAL_VALUE_ATOF (@var{string}, @var{mode})
-A macro for a C expression which converts @var{string}, an expression of
-type @code{char *}, into a floating point number in the target machine's
-representation for mode @var{mode}. The value has type
-@code{REAL_VALUE_TYPE}.
-
-@findex REAL_INFINITY
-@item REAL_INFINITY
-Define this macro if infinity is a possible floating point value, and
-therefore division by 0 is legitimate.
-
-@findex REAL_VALUE_ISINF
-@findex isinf
-@item REAL_VALUE_ISINF (@var{x})
-A macro for a C expression which determines whether @var{x}, a floating
-point value, is infinity. The value has type @code{int}.
-By default, this is defined to call @code{isinf}.
-
-@findex REAL_VALUE_ISNAN
-@findex isnan
-@item REAL_VALUE_ISNAN (@var{x})
-A macro for a C expression which determines whether @var{x}, a floating
-point value, is a ``nan'' (not-a-number). The value has type
-@code{int}. By default, this is defined to call @code{isnan}.
-@end table
-
-@cindex constant folding and floating point
-Define the following additional macros if you want to make floating
-point constant folding work while cross compiling. If you don't
-define them, cross compilation is still possible, but constant folding
-will not happen for floating point values.
-
-@table @code
-@findex REAL_ARITHMETIC
-@item REAL_ARITHMETIC (@var{output}, @var{code}, @var{x}, @var{y})
-A macro for a C statement which calculates an arithmetic operation of
-the two floating point values @var{x} and @var{y}, both of type
-@code{REAL_VALUE_TYPE} in the target machine's representation, to
-produce a result of the same type and representation which is stored
-in @var{output} (which will be a variable).
-
-The operation to be performed is specified by @var{code}, a tree code
-which will always be one of the following: @code{PLUS_EXPR},
-@code{MINUS_EXPR}, @code{MULT_EXPR}, @code{RDIV_EXPR},
-@code{MAX_EXPR}, @code{MIN_EXPR}.@refill
-
-@cindex overflow while constant folding
-The expansion of this macro is responsible for checking for overflow.
-If overflow happens, the macro expansion should execute the statement
-@code{return 0;}, which indicates the inability to perform the
-arithmetic operation requested.
-
-@findex REAL_VALUE_NEGATE
-@item REAL_VALUE_NEGATE (@var{x})
-A macro for a C expression which returns the negative of the floating
-point value @var{x}. Both @var{x} and the value of the expression
-have type @code{REAL_VALUE_TYPE} and are in the target machine's
-floating point representation.
-
-There is no way for this macro to report overflow, since overflow
-can't happen in the negation operation.
-
-@findex REAL_VALUE_TRUNCATE
-@item REAL_VALUE_TRUNCATE (@var{mode}, @var{x})
-A macro for a C expression which converts the floating point value
-@var{x} to mode @var{mode}.
-
-Both @var{x} and the value of the expression are in the target machine's
-floating point representation and have type @code{REAL_VALUE_TYPE}.
-However, the value should have an appropriate bit pattern to be output
-properly as a floating constant whose precision accords with mode
-@var{mode}.
-
-There is no way for this macro to report overflow.
-
-@findex REAL_VALUE_TO_INT
-@item REAL_VALUE_TO_INT (@var{low}, @var{high}, @var{x})
-A macro for a C expression which converts a floating point value
-@var{x} into a double-precision integer which is then stored into
-@var{low} and @var{high}, two variables of type @var{int}.
-
-@item REAL_VALUE_FROM_INT (@var{x}, @var{low}, @var{high}, @var{mode})
-@findex REAL_VALUE_FROM_INT
-A macro for a C expression which converts a double-precision integer
-found in @var{low} and @var{high}, two variables of type @var{int},
-into a floating point value which is then stored into @var{x}.
-The value is in the target machine's representation for mode @var{mode}
-and has the type @code{REAL_VALUE_TYPE}.
-@end table
-
-@node Misc
-@section Miscellaneous Parameters
-@cindex parameters, miscellaneous
-
-@c prevent bad page break with this line
-Here are several miscellaneous parameters.
-
-@table @code
-@item PREDICATE_CODES
-@findex PREDICATE_CODES
-Define this if you have defined special-purpose predicates in the file
-@file{@var{machine}.c}. This macro is called within an initializer of an
-array of structures. The first field in the structure is the name of a
-predicate and the second field is an array of rtl codes. For each
-predicate, list all rtl codes that can be in expressions matched by the
-predicate. The list should have a trailing comma. Here is an example
-of two entries in the list for a typical RISC machine:
-
-@smallexample
-#define PREDICATE_CODES \
- @{"gen_reg_rtx_operand", @{SUBREG, REG@}@}, \
- @{"reg_or_short_cint_operand", @{SUBREG, REG, CONST_INT@}@},
-@end smallexample
-
-Defining this macro does not affect the generated code (however,
-incorrect definitions that omit an rtl code that may be matched by the
-predicate can cause the compiler to malfunction). Instead, it allows
-the table built by @file{genrecog} to be more compact and efficient,
-thus speeding up the compiler. The most important predicates to include
-in the list specified by this macro are those used in the most insn
-patterns.
-
-@findex CASE_VECTOR_MODE
-@item CASE_VECTOR_MODE
-An alias for a machine mode name. This is the machine mode that
-elements of a jump-table should have.
-
-@findex CASE_VECTOR_SHORTEN_MODE
-@item CASE_VECTOR_SHORTEN_MODE (@var{min_offset}, @var{max_offset}, @var{body})
-Optional: return the preferred mode for an @code{addr_diff_vec}
-when the minimum and maximum offset are known. If you define this,
-it enables extra code in branch shortening to deal with @code{addr_diff_vec}.
-To make this work, you also have to define INSN_ALIGN and
-make the alignment for @code{addr_diff_vec} explicit.
-The @var{body} argument is provided so that the offset_unsigned and scale
-flags can be updated.
-
-@findex CASE_VECTOR_PC_RELATIVE
-@item CASE_VECTOR_PC_RELATIVE
-Define this macro to be a C expression to indicate when jump-tables
-should contain relative addresses. If jump-tables never contain
-relative addresses, then you need not define this macro.
-
-@findex CASE_DROPS_THROUGH
-@item CASE_DROPS_THROUGH
-Define this if control falls through a @code{case} insn when the index
-value is out of range. This means the specified default-label is
-actually ignored by the @code{case} insn proper.
-
-@findex CASE_VALUES_THRESHOLD
-@item CASE_VALUES_THRESHOLD
-Define this to be the smallest number of different values for which it
-is best to use a jump-table instead of a tree of conditional branches.
-The default is four for machines with a @code{casesi} instruction and
-five otherwise. This is best for most machines.
-
-@findex WORD_REGISTER_OPERATIONS
-@item WORD_REGISTER_OPERATIONS
-Define this macro if operations between registers with integral mode
-smaller than a word are always performed on the entire register.
-Most RISC machines have this property and most CISC machines do not.
-
-@findex LOAD_EXTEND_OP
-@item LOAD_EXTEND_OP (@var{mode})
-Define this macro to be a C expression indicating when insns that read
-memory in @var{mode}, an integral mode narrower than a word, set the
-bits outside of @var{mode} to be either the sign-extension or the
-zero-extension of the data read. Return @code{SIGN_EXTEND} for values
-of @var{mode} for which the
-insn sign-extends, @code{ZERO_EXTEND} for which it zero-extends, and
-@code{NIL} for other modes.
-
-This macro is not called with @var{mode} non-integral or with a width
-greater than or equal to @code{BITS_PER_WORD}, so you may return any
-value in this case. Do not define this macro if it would always return
-@code{NIL}. On machines where this macro is defined, you will normally
-define it as the constant @code{SIGN_EXTEND} or @code{ZERO_EXTEND}.
-
-@findex SHORT_IMMEDIATES_SIGN_EXTEND
-@item SHORT_IMMEDIATES_SIGN_EXTEND
-Define this macro if loading short immediate values into registers sign
-extends.
-
-@findex IMPLICIT_FIX_EXPR
-@item IMPLICIT_FIX_EXPR
-An alias for a tree code that should be used by default for conversion
-of floating point values to fixed point. Normally,
-@code{FIX_ROUND_EXPR} is used.@refill
-
-@findex FIXUNS_TRUNC_LIKE_FIX_TRUNC
-@item FIXUNS_TRUNC_LIKE_FIX_TRUNC
-Define this macro if the same instructions that convert a floating
-point number to a signed fixed point number also convert validly to an
-unsigned one.
-
-@findex EASY_DIV_EXPR
-@item EASY_DIV_EXPR
-An alias for a tree code that is the easiest kind of division to
-compile code for in the general case. It may be
-@code{TRUNC_DIV_EXPR}, @code{FLOOR_DIV_EXPR}, @code{CEIL_DIV_EXPR} or
-@code{ROUND_DIV_EXPR}. These four division operators differ in how
-they round the result to an integer. @code{EASY_DIV_EXPR} is used
-when it is permissible to use any of those kinds of division and the
-choice should be made on the basis of efficiency.@refill
-
-@findex MOVE_MAX
-@item MOVE_MAX
-The maximum number of bytes that a single instruction can move quickly
-between memory and registers or between two memory locations.
-
-@findex MAX_MOVE_MAX
-@item MAX_MOVE_MAX
-The maximum number of bytes that a single instruction can move quickly
-between memory and registers or between two memory locations. If this
-is undefined, the default is @code{MOVE_MAX}. Otherwise, it is the
-constant value that is the largest value that @code{MOVE_MAX} can have
-at run-time.
-
-@findex SHIFT_COUNT_TRUNCATED
-@item SHIFT_COUNT_TRUNCATED
-A C expression that is nonzero if on this machine the number of bits
-actually used for the count of a shift operation is equal to the number
-of bits needed to represent the size of the object being shifted. When
-this macro is non-zero, the compiler will assume that it is safe to omit
-a sign-extend, zero-extend, and certain bitwise `and' instructions that
-truncates the count of a shift operation. On machines that have
-instructions that act on bitfields at variable positions, which may
-include `bit test' instructions, a nonzero @code{SHIFT_COUNT_TRUNCATED}
-also enables deletion of truncations of the values that serve as
-arguments to bitfield instructions.
-
-If both types of instructions truncate the count (for shifts) and
-position (for bitfield operations), or if no variable-position bitfield
-instructions exist, you should define this macro.
-
-However, on some machines, such as the 80386 and the 680x0, truncation
-only applies to shift operations and not the (real or pretended)
-bitfield operations. Define @code{SHIFT_COUNT_TRUNCATED} to be zero on
-such machines. Instead, add patterns to the @file{md} file that include
-the implied truncation of the shift instructions.
-
-You need not define this macro if it would always have the value of zero.
-
-@findex TRULY_NOOP_TRUNCATION
-@item TRULY_NOOP_TRUNCATION (@var{outprec}, @var{inprec})
-A C expression which is nonzero if on this machine it is safe to
-``convert'' an integer of @var{inprec} bits to one of @var{outprec}
-bits (where @var{outprec} is smaller than @var{inprec}) by merely
-operating on it as if it had only @var{outprec} bits.
-
-On many machines, this expression can be 1.
-
-@c rearranged this, removed the phrase "it is reported that". this was
-@c to fix an overfull hbox. --mew 10feb93
-When @code{TRULY_NOOP_TRUNCATION} returns 1 for a pair of sizes for
-modes for which @code{MODES_TIEABLE_P} is 0, suboptimal code can result.
-If this is the case, making @code{TRULY_NOOP_TRUNCATION} return 0 in
-such cases may improve things.
-
-@findex STORE_FLAG_VALUE
-@item STORE_FLAG_VALUE
-A C expression describing the value returned by a comparison operator
-with an integral mode and stored by a store-flag instruction
-(@samp{s@var{cond}}) when the condition is true. This description must
-apply to @emph{all} the @samp{s@var{cond}} patterns and all the
-comparison operators whose results have a @code{MODE_INT} mode.
-
-A value of 1 or -1 means that the instruction implementing the
-comparison operator returns exactly 1 or -1 when the comparison is true
-and 0 when the comparison is false. Otherwise, the value indicates
-which bits of the result are guaranteed to be 1 when the comparison is
-true. This value is interpreted in the mode of the comparison
-operation, which is given by the mode of the first operand in the
-@samp{s@var{cond}} pattern. Either the low bit or the sign bit of
-@code{STORE_FLAG_VALUE} be on. Presently, only those bits are used by
-the compiler.
-
-If @code{STORE_FLAG_VALUE} is neither 1 or -1, the compiler will
-generate code that depends only on the specified bits. It can also
-replace comparison operators with equivalent operations if they cause
-the required bits to be set, even if the remaining bits are undefined.
-For example, on a machine whose comparison operators return an
-@code{SImode} value and where @code{STORE_FLAG_VALUE} is defined as
-@samp{0x80000000}, saying that just the sign bit is relevant, the
-expression
-
-@smallexample
-(ne:SI (and:SI @var{x} (const_int @var{power-of-2})) (const_int 0))
-@end smallexample
-
-@noindent
-can be converted to
-
-@smallexample
-(ashift:SI @var{x} (const_int @var{n}))
-@end smallexample
-
-@noindent
-where @var{n} is the appropriate shift count to move the bit being
-tested into the sign bit.
-
-There is no way to describe a machine that always sets the low-order bit
-for a true value, but does not guarantee the value of any other bits,
-but we do not know of any machine that has such an instruction. If you
-are trying to port GNU CC to such a machine, include an instruction to
-perform a logical-and of the result with 1 in the pattern for the
-comparison operators and let us know
-@ifset USING
-(@pxref{Bug Reporting,,How to Report Bugs}).
-@end ifset
-@ifclear USING
-(@pxref{Bug Reporting,,How to Report Bugs,gcc.info,Using GCC}).
-@end ifclear
-
-Often, a machine will have multiple instructions that obtain a value
-from a comparison (or the condition codes). Here are rules to guide the
-choice of value for @code{STORE_FLAG_VALUE}, and hence the instructions
-to be used:
-
-@itemize @bullet
-@item
-Use the shortest sequence that yields a valid definition for
-@code{STORE_FLAG_VALUE}. It is more efficient for the compiler to
-``normalize'' the value (convert it to, e.g., 1 or 0) than for the
-comparison operators to do so because there may be opportunities to
-combine the normalization with other operations.
-
-@item
-For equal-length sequences, use a value of 1 or -1, with -1 being
-slightly preferred on machines with expensive jumps and 1 preferred on
-other machines.
-
-@item
-As a second choice, choose a value of @samp{0x80000001} if instructions
-exist that set both the sign and low-order bits but do not define the
-others.
-
-@item
-Otherwise, use a value of @samp{0x80000000}.
-@end itemize
-
-Many machines can produce both the value chosen for
-@code{STORE_FLAG_VALUE} and its negation in the same number of
-instructions. On those machines, you should also define a pattern for
-those cases, e.g., one matching
-
-@smallexample
-(set @var{A} (neg:@var{m} (ne:@var{m} @var{B} @var{C})))
-@end smallexample
-
-Some machines can also perform @code{and} or @code{plus} operations on
-condition code values with less instructions than the corresponding
-@samp{s@var{cond}} insn followed by @code{and} or @code{plus}. On those
-machines, define the appropriate patterns. Use the names @code{incscc}
-and @code{decscc}, respectively, for the patterns which perform
-@code{plus} or @code{minus} operations on condition code values. See
-@file{rs6000.md} for some examples. The GNU Superoptizer can be used to
-find such instruction sequences on other machines.
-
-You need not define @code{STORE_FLAG_VALUE} if the machine has no store-flag
-instructions.
-
-@findex FLOAT_STORE_FLAG_VALUE
-@item FLOAT_STORE_FLAG_VALUE
-A C expression that gives a non-zero floating point value that is
-returned when comparison operators with floating-point results are true.
-Define this macro on machine that have comparison operations that return
-floating-point values. If there are no such operations, do not define
-this macro.
-
-@findex Pmode
-@item Pmode
-An alias for the machine mode for pointers. On most machines, define
-this to be the integer mode corresponding to the width of a hardware
-pointer; @code{SImode} on 32-bit machine or @code{DImode} on 64-bit machines.
-On some machines you must define this to be one of the partial integer
-modes, such as @code{PSImode}.
-
-The width of @code{Pmode} must be at least as large as the value of
-@code{POINTER_SIZE}. If it is not equal, you must define the macro
-@code{POINTERS_EXTEND_UNSIGNED} to specify how pointers are extended
-to @code{Pmode}.
-
-@findex FUNCTION_MODE
-@item FUNCTION_MODE
-An alias for the machine mode used for memory references to functions
-being called, in @code{call} RTL expressions. On most machines this
-should be @code{QImode}.
-
-@findex INTEGRATE_THRESHOLD
-@item INTEGRATE_THRESHOLD (@var{decl})
-A C expression for the maximum number of instructions above which the
-function @var{decl} should not be inlined. @var{decl} is a
-@code{FUNCTION_DECL} node.
-
-The default definition of this macro is 64 plus 8 times the number of
-arguments that the function accepts. Some people think a larger
-threshold should be used on RISC machines.
-
-@findex SCCS_DIRECTIVE
-@item SCCS_DIRECTIVE
-Define this if the preprocessor should ignore @code{#sccs} directives
-and print no error message.
-
-@findex NO_IMPLICIT_EXTERN_C
-@item NO_IMPLICIT_EXTERN_C
-Define this macro if the system header files support C++ as well as C.
-This macro inhibits the usual method of using system header files in
-C++, which is to pretend that the file's contents are enclosed in
-@samp{extern "C" @{@dots{}@}}.
-
-@findex HANDLE_PRAGMA
-@findex #pragma
-@findex pragma
-@item HANDLE_PRAGMA (@var{getc}, @var{ungetc}, @var{name})
-Define this macro if you want to implement any pragmas. If defined, it
-is a C expression whose value is 1 if the pragma was handled by the
-macro, zero otherwise. The argument @var{getc} is a function of type
-@samp{int (*)(void)} which will return the next character in the input
-stream, or EOF if no characters are left. The argument @var{ungetc} is
-a function of type @samp{void (*)(int)} which will push a character back
-into the input stream. The argument @var{name} is the word following
-#pragma in the input stream. The input stream pointer will be pointing
-just beyond the end of this word. The input stream should be left
-undistrubed if the expression returns zero, otherwise it should be
-pointing at the next character after the end of the pragma. Any
-characters remaining on the line will be ignored.
-
-It is generally a bad idea to implement new uses of @code{#pragma}. The
-only reason to define this macro is for compatibility with other
-compilers that do support @code{#pragma} for the sake of any user
-programs which already use it.
-
-If the pragma can be implemented by atttributes then the macro
-@samp{INSERT_ATTRIBUTES} might be a useful one to define as well.
-
-Note: older versions of this macro only had two arguments: @var{stream}
-and @var{token}. The macro was changed in order to allow it to work
-when gcc is built both with and without a cpp library.
-
-@findex HANDLE_SYSV_PRAGMA
-@findex #pragma
-@findex pragma
-@item HANDLE_SYSV_PRAGMA
-Define this macro (to a value of 1) if you want the System V style
-pragmas @samp{#pragma pack(<n>)} and @samp{#pragma weak <name>
-[=<value>]} to be supported by gcc.
-
-The pack pragma specifies the maximum alignment (in bytes) of fields
-within a structure, in much the same way as the @samp{__aligned__} and
-@samp{__packed__} @code{__attribute__}s do. A pack value of zero resets
-the behaviour to the default.
-
-The weak pragma only works if @code{SUPPORTS_WEAK} and
-@code{ASM_WEAKEN_LABEL} are defined. If enabled it allows the creation
-of specifically named weak labels, optionally with a value.
-
-@findex HANDLE_PRAGMA_PACK_PUSH_POP
-@findex #pragma
-@findex pragma
-@item HANDLE_PRAGMA_PACK_PUSH_POP
-Define this macro (to a value of 1) if you want to support the Win32
-style pragmas @samp{#pragma pack(push,<n>)} and @samp{#pragma
-pack(pop)}. The pack(push,<n>) pragma specifies the maximum alignment
-(in bytes) of fields within a structure, in much the same way as the
-@samp{__aligned__} and @samp{__packed__} @code{__attribute__}s do. A
-pack value of zero resets the behaviour to the default. Successive
-invocations of this pragma cause the previous values to be stacked, so
-that invocations of @samp{#pragma pack(pop)} will return to the previous
-value.
-
-@findex VALID_MACHINE_DECL_ATTRIBUTE
-@item VALID_MACHINE_DECL_ATTRIBUTE (@var{decl}, @var{attributes}, @var{identifier}, @var{args})
-If defined, a C expression whose value is nonzero if @var{identifier} with
-arguments @var{args} is a valid machine specific attribute for @var{decl}.
-The attributes in @var{attributes} have previously been assigned to @var{decl}.
-
-@findex VALID_MACHINE_TYPE_ATTRIBUTE
-@item VALID_MACHINE_TYPE_ATTRIBUTE (@var{type}, @var{attributes}, @var{identifier}, @var{args})
-If defined, a C expression whose value is nonzero if @var{identifier} with
-arguments @var{args} is a valid machine specific attribute for @var{type}.
-The attributes in @var{attributes} have previously been assigned to @var{type}.
-
-@findex COMP_TYPE_ATTRIBUTES
-@item COMP_TYPE_ATTRIBUTES (@var{type1}, @var{type2})
-If defined, a C expression whose value is zero if the attributes on
-@var{type1} and @var{type2} are incompatible, one if they are compatible,
-and two if they are nearly compatible (which causes a warning to be
-generated).
-
-@findex SET_DEFAULT_TYPE_ATTRIBUTES
-@item SET_DEFAULT_TYPE_ATTRIBUTES (@var{type})
-If defined, a C statement that assigns default attributes to
-newly defined @var{type}.
-
-@findex MERGE_MACHINE_TYPE_ATTRIBUTES
-@item MERGE_MACHINE_TYPE_ATTRIBUTES (@var{type1}, @var{type2})
-Define this macro if the merging of type attributes needs special handling.
-If defined, the result is a list of the combined TYPE_ATTRIBUTES of
-@var{type1} and @var{type2}. It is assumed that comptypes has already been
-called and returned 1.
-
-@findex MERGE_MACHINE_DECL_ATTRIBUTES
-@item MERGE_MACHINE_DECL_ATTRIBUTES (@var{olddecl}, @var{newdecl})
-Define this macro if the merging of decl attributes needs special handling.
-If defined, the result is a list of the combined DECL_MACHINE_ATTRIBUTES of
-@var{olddecl} and @var{newdecl}. @var{newdecl} is a duplicate declaration
-of @var{olddecl}. Examples of when this is needed are when one attribute
-overrides another, or when an attribute is nullified by a subsequent
-definition.
-
-@findex INSERT_ATTRIBUTES
-@item INSERT_ATTRIBUTES (@var{node}, @var{attr_ptr}, @var{prefix_ptr})
-Define this macro if you want to be able to add attributes to a decl
-when it is being created. This is normally useful for backends which
-wish to implement a pragma by using the attributes which correspond to
-the pragma's effect. The @var{node} argument is the decl which is being
-created. The @var{attr_ptr} argument is a pointer to the attribute list
-for this decl. The @var{prefix_ptr} is a pointer to the list of
-attributes that have appeared after the specifiers and modifiers of the
-declaration, but before the declaration proper.
-
-@findex SET_DEFAULT_DECL_ATTRIBUTES
-@item SET_DEFAULT_DECL_ATTRIBUTES (@var{decl}, @var{attributes})
-If defined, a C statement that assigns default attributes to
-newly defined @var{decl}.
-
-@findex DOLLARS_IN_IDENTIFIERS
-@item DOLLARS_IN_IDENTIFIERS
-Define this macro to control use of the character @samp{$} in identifier
-names. 0 means @samp{$} is not allowed by default; 1 means it is allowed.
-1 is the default; there is no need to define this macro in that case.
-This macro controls the compiler proper; it does not affect the preprocessor.
-
-@findex NO_DOLLAR_IN_LABEL
-@item NO_DOLLAR_IN_LABEL
-Define this macro if the assembler does not accept the character
-@samp{$} in label names. By default constructors and destructors in
-G++ have @samp{$} in the identifiers. If this macro is defined,
-@samp{.} is used instead.
-
-@findex NO_DOT_IN_LABEL
-@item NO_DOT_IN_LABEL
-Define this macro if the assembler does not accept the character
-@samp{.} in label names. By default constructors and destructors in G++
-have names that use @samp{.}. If this macro is defined, these names
-are rewritten to avoid @samp{.}.
-
-@findex DEFAULT_MAIN_RETURN
-@item DEFAULT_MAIN_RETURN
-Define this macro if the target system expects every program's @code{main}
-function to return a standard ``success'' value by default (if no other
-value is explicitly returned).
-
-The definition should be a C statement (sans semicolon) to generate the
-appropriate rtl instructions. It is used only when compiling the end of
-@code{main}.
-
-@item HAVE_ATEXIT
-@findex HAVE_ATEXIT
-Define this if the target system supports the function
-@code{atexit} from the ANSI C standard. If this is not defined,
-and @code{INIT_SECTION_ASM_OP} is not defined, a default
-@code{exit} function will be provided to support C++.
-
-@item EXIT_BODY
-@findex EXIT_BODY
-Define this if your @code{exit} function needs to do something
-besides calling an external function @code{_cleanup} before
-terminating with @code{_exit}. The @code{EXIT_BODY} macro is
-only needed if neither @code{HAVE_ATEXIT} nor
-@code{INIT_SECTION_ASM_OP} are defined.
-
-@findex INSN_SETS_ARE_DELAYED
-@item INSN_SETS_ARE_DELAYED (@var{insn})
-Define this macro as a C expression that is nonzero if it is safe for the
-delay slot scheduler to place instructions in the delay slot of @var{insn},
-even if they appear to use a resource set or clobbered in @var{insn}.
-@var{insn} is always a @code{jump_insn} or an @code{insn}; GNU CC knows that
-every @code{call_insn} has this behavior. On machines where some @code{insn}
-or @code{jump_insn} is really a function call and hence has this behavior,
-you should define this macro.
-
-You need not define this macro if it would always return zero.
-
-@findex INSN_REFERENCES_ARE_DELAYED
-@item INSN_REFERENCES_ARE_DELAYED (@var{insn})
-Define this macro as a C expression that is nonzero if it is safe for the
-delay slot scheduler to place instructions in the delay slot of @var{insn},
-even if they appear to set or clobber a resource referenced in @var{insn}.
-@var{insn} is always a @code{jump_insn} or an @code{insn}. On machines where
-some @code{insn} or @code{jump_insn} is really a function call and its operands
-are registers whose use is actually in the subroutine it calls, you should
-define this macro. Doing so allows the delay slot scheduler to move
-instructions which copy arguments into the argument registers into the delay
-slot of @var{insn}.
-
-You need not define this macro if it would always return zero.
-
-@findex MACHINE_DEPENDENT_REORG
-@item MACHINE_DEPENDENT_REORG (@var{insn})
-In rare cases, correct code generation requires extra machine
-dependent processing between the second jump optimization pass and
-delayed branch scheduling. On those machines, define this macro as a C
-statement to act on the code starting at @var{insn}.
-
-@findex MULTIPLE_SYMBOL_SPACES
-@item MULTIPLE_SYMBOL_SPACES
-Define this macro if in some cases global symbols from one translation
-unit may not be bound to undefined symbols in another translation unit
-without user intervention. For instance, under Microsoft Windows
-symbols must be explicitly imported from shared libraries (DLLs).
-
-@findex ISSUE_RATE
-@item ISSUE_RATE
-A C expression that returns how many instructions can be issued at the
-same time if the machine is a superscalar machine. This is only used by
-the @samp{Haifa} scheduler, and not the traditional scheduler.
-
-@findex MD_SCHED_INIT
-@item MD_SCHED_INIT (@var{file}, @var{verbose})
-A C statement which is executed by the @samp{Haifa} scheduler at the
-beginning of each block of instructions that are to be scheduled.
-@var{file} is either a null pointer, or a stdio stream to write any
-debug output to. @var{verbose} is the verbose level provided by
-@samp{-fsched-verbose-}@var{n}.
-
-@findex MD_SCHED_REORDER
-@item MD_SCHED_REORDER (@var{file}, @var{verbose}, @var{ready}, @var{n_ready})
-A C statement which is executed by the @samp{Haifa} scheduler after it
-has scheduled the ready list to allow the machine description to reorder
-it (for example to combine two small instructions together on
-@samp{VLIW} machines). @var{file} is either a null pointer, or a stdio
-stream to write any debug output to. @var{verbose} is the verbose level
-provided by @samp{-fsched-verbose-}@var{n}. @var{ready} is a pointer to
-the ready list of instructions that are ready to be scheduled.
-@var{n_ready} is the number of elements in the ready list. The
-scheduler reads the ready list in reverse order, starting with
-@var{ready}[@var{n_ready}-1] and going to @var{ready}[0].
-
-@findex MD_SCHED_VARIABLE_ISSUE
-@item MD_SCHED_VARIABLE_ISSUE (@var{file}, @var{verbose}, @var{insn}, @var{more})
-A C statement which is executed by the @samp{Haifa} scheduler after it
-has scheduled an insn from the ready list. @var{file} is either a null
-pointer, or a stdio stream to write any debug output to. @var{verbose}
-is the verbose level provided by @samp{-fsched-verbose-}@var{n}.
-@var{insn} is the instruction that was scheduled. @var{more} is the
-number of instructions that can be issued in the current cycle. The
-@samp{MD_SCHED_VARIABLE_ISSUE} macro is responsible for updating the
-value of @var{more} (typically by @var{more}--).
-
-@findex MAX_INTEGER_COMPUTATION_MODE
-@item MAX_INTEGER_COMPUTATION_MODE
-Define this to the largest integer machine mode which can be used for
-operations other than load, store and copy operations.
-
-You need only define this macro if the target holds values larger than
-@code{word_mode} in general purpose registers. Most targets should not define
-this macro.
-
-@findex MATH_LIBRARY
-@item MATH_LIBRARY
-Define this macro as a C string constant for the linker argument to link
-in the system math library, or @samp{""} if the target does not have a
-separate math library.
-
-You need only define this macro if the default of @samp{"-lm"} is wrong.
-@end table
diff --git a/contrib/libf2c/ChangeLog b/contrib/libf2c/ChangeLog
deleted file mode 100644
index 4b01ec934b24..000000000000
--- a/contrib/libf2c/ChangeLog
+++ /dev/null
@@ -1,1842 +0,0 @@
-2001-10-23 Release Manager
-
- * GCC 3.0.2 Released.
-
-2001-08-19 Release Manager
-
- * GCC 3.0.1 Released.
-
-2001-08-19 Release Manager
-
- * GCC 3.0.1 Released.
-
-20010617 Release Manager
-
- * GCC 3.0 Released.
-
-2001-06-13 Toon Moene <toon@moene.indiv.nluug.nl>
-
- * libI77/inquire.c: Include "config.h".
-
-2001-05-21 Loren J. Rittle <ljrittle@acm.org>
-
- * libI77/Makefile.in (stamp-h): Create in $(objdir) instead
- of $(srcdir).
-
-2001-05-18 Andreas Jaeger <aj@suse.de>
-
- * libI77/Makefile.in (stamp-h): Only create config.h, touch stamp-h.
- (${srcdir}/config.h.in): Add true rule.
-
- * libI77/stamp-h.in: Added.
-
-2001-05-17 Andreas Jaeger <aj@suse.de>
-
- * libI77/Makefile.in: Add rules to rebuild config.h.in when
- needed.
-
-2001-05-16 Andreas Jaeger <aj@suse.de>
-
- * libI77/backspace.c: Include "config.h".
- * libI77/close.c: Likewise.
- * libI77/dfe.c: Likewise.
- * libI77/dolio.c: Likewise.
- * libI77/due.c: Likewise.
- * libI77/err.c: Likewise.
- * libI77/fmt.c: Likewise.
- * libI77/fmtlib.c: Likewise.
- * libI77/ftell_.c: Likewise.
- * libI77/ilnw.c: Likewise.
- * libI77/lread.c: Likewise.
- * libI77/open.c: Likewise.
- * libI77/rdfmt.c: Likewise.
- * libI77/rsfe.c: Likewise.
- * libI77/rsne.c: Likewise.
- * libI77/util.c: Likewise.
- * libI77/wrtfmt.c: Likewise.
- * libI77/wsne.c: Likewise.
- * libI77/xwsne.c: Likewise.
-
- * libI77/config.h.in: Generate with autoheader.
-
- * libI77/configure.in: Add comments for all AC_DEFINES so that
- autoheader can grok it.
- * libI77/configure: Regenerated.
-
-2001-05-16 Andreas Jaeger <aj@suse.de>
-
- * libI77/Makefile.in (endfile.o): Add dependency on config.h.
-
- * libI77/endfile.c: Include config.h and sys/types for off_t.
-
- * libI77/config.h.in: New file.
-
- * libI77/configure.in: Add test for off_t, create config.h file.
- * libI77/configure: Regenerated.
-
-2001-05-15 Loren J. Rittle <ljrittle@acm.org>
-
- * libI77/endfile.c (t_runc): Add cast to help case where
- ftruncate() prototype is somehow missing even though autoconf
- test found it properly.
-
-2001-02-27 Toon Moene <toon@moene.indiv.nluug.nl>
-
- * libI77/configure.in: Test for ftruncate.
- * libI77/configure: Rebuilt.
- * libI77/endfile.c: Use fflush/ftruncate when available.
-
-2001-02-08 Geoffrey Keating <geoffk@redhat.com>
-
- * configure.in: Don't run AC_PROG_CC_WORKS, because
- we're not interested in the result and it might fail.
- * libF77/configure.in: Likewise.
- * libI77/configure.in: Likewise.
- * libU77/configure.in: Likewise.
- * configure: Regenerated.
- * libF77/configure: Likewise.
- * libI77/configure: Likewise.
- * libU77/configure: Likewise.
-
-2001-01-29 Phil Edwards <pme@sources.redhat.com>
-
- * libU77/COPYING.LIB: Update to LGPL 2.1 from the FSF.
-
-2001-01-24 Michael Sokolov <msokolov@ivan.Harhan.ORG>
-
- * libU77/alarm_.c: Separate the #ifdef KR_headers logic from the
- G77_alarm_0 function definition. Check for SIG_ERR and provide our own
- if missing.
-
-2001-01-24 David Billinghurst <David.Billinghurst@riotinto.com>
-
- * libU77/Makefile.in: Explicitly generate a.out for check.
-
-2001-01-23 Michael Sokolov <msokolov@ivan.Harhan.ORG>
-
- * libU77/ctime_.c: #include <sys/types.h> for time_t.
- * libU77/datetime_.c: Likewise.
- * libU77/fdate_.c: Likewise.
- * libU77/gmtime_.c: Likewise.
- * libU77/idate_.c: Likewise.
- * libU77/itime_.c: Likewise.
- * libU77/ltime_.c: Likewise.
- * libU77/sys_clock_.c: Likewise.
- * libU77/vxtidate_.c: Likewise.
- * libU77/vxttime_.c: Likewise.
-
- * libU77/sys_clock_.c: #include <sys/param.h> for the clock tick rate.
-
-2000-12-09 Toon Moene <toon@moene.indiv.nluug.nl>
-
- Update to Netlib version 20001205.
- Thanks go to David M. Gay for these updates.
-
- * libF77/Version.c: Update version information.
- * libF77/z_log.c: Improve accuracy of real(log(z)) for
- z near (+-1,eps) with |eps| small.
- * libF77/s_cat.c: Adjust call when ftnint and ftnlen are
- of different size.
- * libF77/dtime_.c, libF77/etime_.c: Use floating point divide.
-
- * libI77/Version.c: Update version information.
- * libI77/rsne.c, libI77/xwsne.c: Adjust code for when ftnint
- and ftnlen differ in size.
- * libI77/lread.c: Fix reading of namelist logical values followed
- by <name>= where <name> starts with T or F.
-
-2000-11-26 Toon Moene <toon@moene.indiv.nluug.nl>
-
- * libI77/Version.c, libF77/Version.c, libU77/Version.c:
- Designate version as (experimental) instead of (prerelease)
-
-2000-11-15 Toon Moene <toon@moene.indiv.nluug.nl>
-
- * libI77/configure.in: See if `mkstemp' is available.
- * libI77/configure: Regenerate.
- * libI77/open.c: Use `mkstemp' to create scratch
- file atomically.
-
-2000-07-03 Donn Terry (donnte@microsoft.com)
- * libU77/aclocal.m4: check for 2 argument gettimeofday without
- struct timezone
-
-2000-07-02 Toon Moene <toon@moene.indiv.nluug.nl>
- * libF77/Version.c: Bumped version number to 0.5.26.
- * libI77/Version.c: Ditto.
- * libU77/Version.c: Ditto.
-
-2000-06-21 Zack Weinberg <zack@wolery.cumb.org>
-
- * libU77/dtime_.c, libU77/etime_.c: Include stdlib.h if
- HAVE_STDLIB_H is defined.
-
-2000-06-11 Herman A.J. ten Brugge <Haj.Ten.Brugge@net.HCC.nl>
-
- * rdfmt.c (rd_L): Use if-then-else instead of case statement to
- solve problems when sizeof(char) == sizeof(short).
-
-2000-05-18 Chris Demetriou <cgd@sibyte.com>
-
- * configure.in: Test for __g77_integer, __g77_uinteger,
- __g77_longint, and __g77_ulongint builtin types, rather
- than mucking around with compiler headers.
- * configure: Regenerate.
- * g2c.hin (integer, logical, flag, ftnlen, ftnint): Use
- __g77_integer rather than autoconfigured value.
- (uinteger): Use __g77_uinteger rather than autoconfigured value.
- (longint): Use __g77_longint rather than autoconfigured value.
- (ulongint): Use __g77_ulongint rather than autoconfigured value.
-
-Sun Mar 12 20:12;30 2000 Toon Moene <toon@moene.indiv.nluug.nl>
- Based on work done by David M. Gay (Bell Labs)
-
- * libF77/configure.in: Define IEEE_COMPLEX_DIVIDE.
- * libF77/[cz]_div.c: Arrange for compilation under
- -DIEEE_COMPLEX_DIVIDE to make these routines
- avoid calling sig_die when the denominator vanishes.
- * libF77/s_rnge.c: Add casts for the case of
- sizeof(ftnint) == sizeof(int) < sizeof(long).
- * libI77/endfile.c: Set state to writing (b->uwrt = 1) when an
- endfile statement requires copying the file
- Also, supply a missing (long) cast in the sprintf call.
- * libI77/sfe.c: Add #ifdef ALWAYS_FLUSH logic, for formatted I/O.
-
-Wed Feb 16 11:10:05 2000 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * configure.in (gcc_version): When setting, narrow search to
- lines containing `version_string'.
-
-Tue Nov 16 20:39:42 1999 Geoffrey Keating <geoffk@cygnus.com>
-
- * libU77/u77-test.f (wd): Allow for longer working directory
- pathnames.
-
-1999-10-14 Theo Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr>
-
- * libU77/acconfig.h: Define GETTIMEOFDAY_ONE_ARGUMENT and
- HAVE_TIMEZONE in acconfig.h.
- * libU77/config.hin: Rebuilt.
-
-1999-10-12 Dave Love <fx@gnu.org>
-
- * libU77/aclocal.m4: Re-write, defining LIBU77_GETTIMEOFDAY, not
- LIBU77_HAVE_STRUCT_TIMEZONE.
-
- * libU77/configure.in: Use LIBU77_GETTIMEOFDAY, not
- LIBU77_HAVE_STRUCT_TIMEZONE. Don't check for gettimeofday
- separately.
-
- * libU77/datetime_.c (G77_date_and_time_0): Use
- GETTIMEOFDAY_ONE_ARGUMENT.
-
-Tue Sep 14 01:44:01 1999 Marc Espie <espie@cvs.openbsd.org>
-
- * Makefile.in: Prepend $(SHELL) to move-if-change calls.
-
-Fri Aug 6 23:32:29 1999 Daniel Jacobowitz <drow@drow.them.org>
-
- * Makefile.in (FLAGS_TO_PASS): Include prefix, exec_prefix,
- libdir, libsubdir and tooldir.
-
-Wed Jul 7 15:58:16 1999 Craig Burley <craig@jcb-sc.com>
-
- * libU77/date_.c (G77_date_y2kbug_0): G77_time_0 returns
- longint, not integer, and G77_ctime_0 takes longint, not
- integer, argument.
-
- * libU77/Version.c: Bump version.
-
-Mon Jun 28 21:27:08 1999 Craig Burley <craig@jcb-sc.com>
-
- Update to Netlib version of 1999-06-28:
- * changes.netlib, libI77/Version.c, libI77/rsne.c
- readme.netlib: See changes.netlib for info.
-
-Fri Jun 18 11:38:07 1999 Craig Burley <craig@jcb-sc.com>
-
- * libU77/ttynam_.c: if !defined (HAVE_TTYNAM),
- write all spaces into return value instead of trying
- to return -1 from a void function.
-
-Fri Jun 18 11:22:21 1999 Craig Burley <craig@jcb-sc.com>
-
- Update to Netlib version of 1999-05-10:
- * changes.netlib, libI77/Version.c, libI77/backspace.c
- readme.netlib: See changes.netlib for info.
-
-Fri Jun 18 11:15:24 1999 Craig Burley <craig@jcb-sc.com>
-
- * libI77/backspace.c: Undo Wednesday's change, in
- preparation for slightly different Netlib change.
-
-Wed Jun 16 11:38:58 1999 Craig Burley <craig@jcb-sc.com>
-
- From Ian Watson <WATSON_IAN_A@Lilly.com> 1999-06-12:
- * libI77/backspace.c: Reload file descriptor after
- calling t_runc.
- * libI77/Version.c: Bump libg2c version.
-
-Wed May 26 14:26:35 1999 Craig Burley <craig@jcb-sc.com>
-
- * libF77/Version.c, libI77/Version.c, libU77/Version.c:
- Use 0.5.24 to designate the version of g77 within GCC 2.95.
-
-Thu May 20 03:20:59 1999 Jeffrey A Law (law@cygnus.com)
-
- * configure.in (AC_EXEEXT): Remove call.
- (compiler_name): Explicitly check with no extension and .exe
- extension.
- * configure: Regenerate.
-
-Mon May 10 17:33:45 1999 Craig Burley <craig@jcb-sc.com>
-
- Update to Netlib version of 1999-05-10:
- * changes.netlib, libF77/Version.c, libF77/abort_.c,
- libF77/c_log.c, libF77/ef1asc_.c, libF77/s_rnge.c,
- libF77/s_stop.c, libI77/Version.c, libI77/open.c,
- readme.netlib: See changes.netlib for info.
-
-Fri May 7 9:33:55 1999 Donn Terry (donn@interix.com)
-
- * libU77/dtime_.c (G77_dtime_0): Standard-conforming error check.
- * libU77/etime_.c (G77_etime_0): Likewise.
-
-Mon May 3 19:15:07 1999 Craig Burley <craig@jcb-sc.com>
-
- * libU77/u77-test.f (main): Declare ABORT as intrinsic.
-
-1999-05-03 Craig Burley <craig@jcb-sc.com>
-
- * libU77/u77-test.f: Reverse order of two arguments to
- CTIME_subr, DTIME_subr, ETIME_subr, and TTYNAM_subr.
-
-Mon May 3 11:21:35 1999 Craig Burley <craig@jcb-sc.com>
-
- * libF77/c_log.c: Cope with partial overlap a la z_log.c.
- (Change likely to be made to netlib version shortly.)
-
-Mon May 3 11:12:38 1999 Craig Burley <craig@jcb-sc.com>
-
- Update to Netlib version of 1999-05-03:
- * changes.netlib, libF77/Version.c, libF77/c_cos.c,
- libF77/c_exp.c, libF77/c_sin.c, libF77/d_cnjg.c,
- libF77/dtime_.c, libF77/etime_.c, libF77/getenv_.c,
- libF77/r_cnjg.c, libF77/z_cos.c, libF77/z_exp.c,
- libF77/z_log.c, libF77/z_sin.c, libI77/Version.c,
- libI77/err.c, libI77/open.c, libI77/rdfmt.c, readme.netlib:
- See changes.netlib for info.
-
-Mon May 3 10:52:53 1999 Craig Burley <craig@jcb-sc.com>
-
- * libF77/c_cos.c, libF77/c_div.c, libF77/c_exp.c, libF77/c_log.c,
- libF77/c_sin.c, libF77/c_sqrt.c, libF77/d_cnjg.c, libF77/pow_zi.c,
- libF77/r_cnjg.c, libF77/z_cos.c, libF77/z_div.c, libF77/z_exp.c,
- libF77/z_log.c, libF77/z_sin.c, libF77/z_sqrt.c: Revert back to
- netlib versions as of f2c-19990501.
-
-Sun May 2 01:38:50 1999 Craig Burley <craig@jcb-sc.com>
-
- * libU77/u77-test.f (main): Declare FTELL as intrinsic.
-
-Sun May 2 01:13:37 1999 Craig Burley <craig@jcb-sc.com>
-
- * libU77/u77-test.f (main): List libU77 intrinsics
- not currently tested.
- Add tests for TIME8, CTIME_subr, IARGC, TTYNAM_subr,
- GETENV, FDATE_subr, DTIME_subr, ETIME_subr, DATE, ITIME,
- FTELL_subr, MCLOCK, MCLOCK8, and CPU_TIME.
- Trim blanks off the ends of some printed strings.
-
-Sun May 2 00:06:45 1999 Craig Burley <craig@jcb-sc.com>
-
- * libU77/u77-test.f (main): Just warn about FSTAT gid
- disagreement, as it's expected on some systems.
-
-Sat May 1 23:57:18 1999 Craig Burley <craig@jcb-sc.com>
-
- * libU77/u77-test.f: Generalize sum-checking to
- use a new function, which allows for some slop.
- Clean up some commentary.
- (issum): The new function.
- (sgladd): Deleted subroutine.
-
-Sat May 1 23:35:18 1999 Craig Burley <craig@jcb-sc.com>
-
- * libU77/u77-test.f: Modify to be more like testsuite
- version, bringing patches to that version here.
- Add suitable commentary.
-
-Sat Apr 24 11:02:48 1999 Craig Burley <craig@jcb-sc.com>
-
- * Makefile.in (s-libi77, s-libf77, s-libu77): Revert
- the patch from <hjl@gnu.org>, as per the commentary.
-
-Sat Apr 17 17:33:30 1999 Craig Burley <craig@jcb-sc.com>
-
- From H.J. Lu <hjl@gnu.org>:
- * Makefile.in (s-libi77): Depend on i77.
- (s-libf77): Depend on i77.
- (s-libu77): Depend on u77.
-
-Mon Apr 12 21:38:14 1999 Mumit Khan <khan@xraylith.wisc.edu>
-
- * libF77/getenv_.c: Include stdlib.h.
-
-Sun Apr 11 23:30:42 1999 Mumit Khan <khan@xraylith.wisc.edu>
-
- * libU77/dtime_.c: Handle all variants of WIN32.
- * libU77/etime_.c: Likewise.
-
- * libU77/aclocal.m4: New file.
- * libU77/configure.in (LIBU77_HAVE_STRUCT_TIMEZONE): Add test.
- * libU77/acconfig.h (HAVE_STRUCT_TIMEZONE): Add macro.
- * libU77/datetime_c.c (G77_date_and_time_0): Use.
- * libU77/config.hin: Regenerate.
- * libU77/configure: Likewise.
-
-Wed Mar 31 13:50:24 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * configure.in (extra_includes): Don't attempt to calculate the
- location of the gcc src or obj directories. Instead rely on
- precomputed variables, $topsrcdir and $r, to obtain these values.
- Set -I flags appropriately.
-
-1999-03-28 Dave Love <fx@gnu.org>
-
- * configure: Rebuilt.
-
- * configure.in: Fix integer size tests: sanity check first; search
- toplevel include dir (from Rainer Orth); only mess with ac_cpp
- once; use -DIN_GCC -DHAVE_CONFIG_H.
-
- * configure.in: Use `g77_cv_...', not `f77_cv_...'.
-
-Wed Mar 24 22:41:28 1999 Mumit Khan <khan@xraylith.wisc.edu>
-
- * configure.in (AC_PREREQ): Update to 2.13.
- (AC_EXEEXT): Call to find possible file extension.
- (compiler_name): Use.
- * configure: Regenerate.
-
-1999-03-17 Craig Burley <craig@jcb-sc.com>
-
- Update to Netlib version of 1999-03-17:
- * libF77/F77_aloc.c, libF77/README.netlib, libF77/dtime_.c,
- libF77/etime_.c, libF77/signal1.h0, libI77/Version.c,
- libI77/dfe.c, libI77/endfile.c, libI77/lread.c,
- libI77/sfe.c, readme.netlib, changes.netlib:
- See changes.netlib for info.
-
-1999-03-06 Craig Burley <craig@jcb-sc.com>
-
- Mon Dec 21 23:03:54 1998 Hans-Peter Nilsson <hp@axis.se>:
- * libI77/Makefile.in (all *.o except VersionI.o): Added dependence
- on respective .c file.
- * libF77/Makefile.in (all .o except VersionF.o): Similarly.
- * libU77/Makefile.in (date_.o): Added dependence on date_.c
-
-1999-03-06 Craig Burley <craig@jcb-sc.com>
-
- Rename non-Y2K-compliant intrinsics:
- * Makefile.in (F2CEXT): Now two versions each of
- `date' and `vxtidt'.
- * f2cext.c (date_, vxtidate_): Split into two versions,
- the existing one calling a new "y2kbuggy" routine that
- does not exist, and a new one named with "y2kbug" that
- calls the newly renamed underlying routine.
- * libU77/date_.c (G77_date_y2kbug_0): Rename from G77_date_0.
- * libU77/vxtidate_.c (G77_vxtidate_y2kbug_0): Rename from
- G77_vxtidate_0.
- * libU77/Version.c: Bump version.
-
-1999-03-03 Craig Burley <craig@jcb-sc.com>
-
- * libU77/vxtidate_.c (G77_vxtidate_0): Truncate
- year to last two digits (i.e. modulo 100), as per
- documentation and (documented) Y2K non-compliance.
-
-1999-02-20 Craig Burley <craig@jcb-sc.com>
-
- From Krister Walfridsson <cato@df.lth.se>:
- * libU77/lstat_.c (G77_lstat_0): Kill spurious setting
- of element 6 to zero, as it undid the previous setting.
-
-1999-02-15 Craig Burley <craig@jcb-sc.com>
-
- * f2c.h: Delete my (old) email address.
-
-1999-02-14 Craig Burley <craig@jcb-sc.com>
-
- * libU77/Version.c: Bump ("update" below) to date of last change.
- * libI77/Version.c: Bump to date of last change.
-
-Tue Feb 9 18:13:30 GMT 1999 Nathan Sidwell <nathan@acm.org>
-
- * Makefile.in (distclean): Move Makefile deletion to end of
- commands.
-
-1999-01-15 Dave Love <fx@gnu.org>
-
- * libU77/datetime_.c (G77_date_and_time_0): Return milliseconds as
- such, not as microseconds.
- (s_copy): Declare.
-
-1998-11-26 Manfred Hollstein <manfred@s-direktnet.de>
-
- * configure.in (compiler_name): Add check to detect if this
- language's compiler has been built.
- * configure: Regenerate.
-
-Mon Nov 23 16:52:22 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * configure.in: Use AC_PREREQ(2.12.1).
- * libF77/configure.in: Likewise.
- * libI77/configure.in: Likewise.
- * libU77/configure.in: Likewise.
-
-1998-10-24 Dave Love <d.love@dl.ac.uk>
-
- * configure.in: Touch g2c.h in AC_OUTPUT after multilib
- disturbance.
-
-1998-10-23 Dave Love <d.love@dl.ac.uk>
-
- * f2cext.c: Include math.h.
-
-1998-10-19 Dave Love <d.love@dl.ac.uk>
-
- * configure: Regenerate.
-
- * configure.in: Use AC_CONFIG_AUX_DIR.
-
-1998-10-12 Dave Love <fx@gnu.org>
-
- * libI77/open.c (_XOPEN_SOURCE): Define.
-
-1998-10-12 Dave Love <fx@gnu.org>
-
- * Makefile.in (.SUFFIXES): Don't use any.
- (all-unilib): New target, like old all.
- (all): Use it.
- (.PHONY): Add all-unilib.
-
-1998-10-12 Dave Love <d.love@dl.ac.uk>
-
- * configure.in: Reorder Makefile, g2c.h in AC_OUTPUT.
-
-Tue Oct 6 21:16:58 1998 Jeffrey A Law (law@cygnus.com)
-
- * Makefile.in: Revert last patch.
-
-Mon Oct 5 01:16:10 1998 H.J. Lu (hjl@gnu.org)
-
- * Makefile.in (s-libi77): Depend on i77.
- (s-libf77): Depend on i77.
- (s-libu77): Depend on u77.
-
-1998-09-30 Dave Love <d.love@dl.ac.uk>
-
- * Makefile.in (f2cext.c): Depend on g2c.h.
-
-1998-09-30 Robert Lipe <robertl@dgii.com>
-
- * Makefile.in (all): Correct dependencies so --disable-multilibs
- works again.
- (distclean): Correct typo.
-
-1998-09-28 Dave Love <d.love@dl.ac.uk>
-
- * libI77/open.c: Back out part of last Netlib update affecting
- scratch files which clashed with the g77 variations and broke
- implicit endfile on rewind.
-
-1998-09-21 Dave Love <d.love@dl.ac.uk>
-
- * libI77/Version.c: Update.
-
-Mon Sep 21 12:27:27 1998 Robert Lipe <robertl@dgii.com>
-
- * Makefile.in (distclean, clean, uninstall, install, all): Add
- multilib support.
- * configure.in: Likewise.
- * configure: Regenerate.
- * libF77/Makefile.in, libU77/Makefile.in, libI77/Makefile.in (clean):
- Explictly remove stamp in parent's directory.
-
-1998-09-20 Dave Love <d.love@dl.ac.uk>
-
- * libI77/sfe.c (e_wdfe): Set f__init to avoid spurious recursive
- i/o error from formatted direct i/o.
-
-Thu Sep 10 14:57:25 1998 Kamil Iskra <iskra@student.uci.agh.edu.pl>
-
- * Makefile.in (install): Add missing "else true;".
-
-1998-09-09 Craig Burley <burley@gnu.org>
-
- * configure.in: Test $srcdir, not $subdir (probable typo).
- Clarify commentary, fix a bit of spacing.
-
-1998-09-07 Dave Love <d.love@dl.ac.uk>
-
- * ChangeLog.egcs: Deleted. Entries merged here.
-
-1998-09-07 Dave Love <d.love@dl.ac.uk>
-
- * libI77/sfe.c, libI77/dfe.c: Revert last change.
-
-1998-09-06 Dave Love <d.love@dl.ac.uk>
-
- From Toon to fix spurious recursive i/o errors:
- * libI77/sfe.c (e_wdfe): Set f__init.
-
- * libI77/dfe.c (c_dfe): Check and set f__init.
- (s_rdfe, s_wdfe): Don't check and set f__init.
-
-Fri Sep 4 18:40:32 1998 Craig Burley <burley@gnu.org>
-
- * libU77/sys_clock_.c (G77_system_clock_0): Fix indentation.
-
-Tue Sep 1 10:06:06 1998 Craig Burley <burley@gnu.org>
-
- * libF77/Version.c: Update.
- * libU77/Version.c: Update.
- * libI77/Version.c: Update.
-
-Wed Aug 26 23:19:40 1998 Jeffrey A Law (law@cygnus.com)
-
- * Makefile.in (FLAGS_TO_PASS): Fix typo.
-
-1998-08-11 Dave Love <d.love@dl.ac.uk>
-
- * README: Update from Craig.
-
-1998-07-24 Dave Love <d.love@dl.ac.uk>
-
- * Makefile.in (s-libe77, ${srcdir}/configure, g2c.h, Makefile)
- (config.status, rebuilt): Rely on VPATH, dropping explicit use of
- $(srcdir) in various places.
-
-1998-07-19 Dave Love <d.love@dl.ac.uk>
-
- * Makefile.in (all): Depend on s-libe77, not e77.
- (.PHONY): Remove e77.
-
-Thu Jul 16 00:58:52 1998 Jeffrey A Law (law@cygnus.com)
-
- * libU77/Makefile.in: Missed one config.h.in -> config.hin change.
-
- * g2c.hin: Renamed from g2c.h.in.
- * Makefile.in, configure.in: Changed as needed.
- * configure: Rebuilt.
-
- * libU77/config.hin: Renamed from libU77/config.h.in.
- * Makefile.in, configure.in: Changed as needed.
- * configure: Rebuilt.
-
-Tue Jul 14 21:35:30 1998 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
-
- * Makefile.in (all): Invoke $(MAKE) instead of just make.
-
-Tue Jul 14 02:16:34 1998 Jeffrey A Law (law@cygnus.com)
-
- * Makefile.in: stamp-lib* -> s-lib*.
- * libU77/Makefile.in: Likewise.
- * libF77/Makefile.in: Likewise.
- * libI77/Makefile.in: Likewise.
-
- * libU77/Makefile.in (ALL_CFLAGS): Add -I$(F2C_H_DIR).
-
-Mon Jul 13 13:31:03 1998 Craig Burley <burley@gnu.org>
-
- * libU77/u77-test.f: Double-check ETIME results, just
- like 0.5.24 does.
-
-1998-07-10 Dave Love <d.love@dl.ac.uk>
-
- * Makefile.in: Re-write build procedure mainly to honour
- dependencies correctly but also allow making in the build
- directory by configuring the relevant variables. The lib[FIU]77
- subdirs do dependency checking of their objects. Stamp files
- dictate when to run (new) archive targets in subdirs. Some
- tidying of variables. Supply full set of standard targets.
-
- * configure.in: Move much of testing to new configures in
- subdirs. Tidy up handling of RANLIB etc.
-
- * stamp-h.in, libF77/configure.in, libI77/configure.in:
- * libF77/configure, libI77/configure: New files.
-
- * libF77/Makefile.in, libI77/Makefile.in, libU77/Makefile.in:
- Change in step with libf2c/Makefile.in.
-
-1998-07-09 Dave Love <d.love@dl.ac.uk>
-
- * libU77/Makefile.in (check): Wrap -lg2c ... -lm around $(LIBS) in
- case of static link.
-
- * libU77/Version.c, libI77/Version.c: Update version info.
-
- * libU77/sys_clock_.c: Replace TIMES conditional stuff removed in
- error by last change.
-
-1998-07-06 Mike Stump <mrs@wrs.com>
-
- * Makefile.in (clean): Don't remove Makefiles, that is done in
- distclean.
-
-1998-07-06 Dave Love <d.love@dl.ac.uk>
-
- * libU77/Makefile.in (lib): Change variable lib to LIBS.
-
-1998-07-06 Robert Lipe <robertl@dgii.com>
-
- * libU77/configure.in: Look for -lsocket, add to LIBS if found.
-
- * libU77/Makefile.in (lib): Use LIBS from above.
-
-1998-07-05 Dave Love <d.love@dl.ac.uk>
-
- * f2cext.c (system_clock_): Remove (just f90 intrinsic).
-
- * Makefile.in (F2CEXT): Remove sclock.
- (UOBJ): Add libU77/datetime_.o.
-
- * libU77/config.h.in: Add HAVE_GETTIMEOFDAY.
-
- * libU77/configure.in: Check for gettimeofday.
-
- * libU77/datetime_.c: New file.
-
- * libU77/sys_clock_.c: Allow optional args.
-
- * libU77/Makefile.in (G77DIR): Fix for current directory
- structure.
- (SRCS, OBJS): Add datetime.
-
- * libU77/u77-test.f: Call date_and_time. Call system_clock
- omitting args.
-
-1998-06-29 Dave Love <d.love@dl.ac.uk>
-
- * libI77/wsfe.c (s_wsfe): Fix setting of f__curunit lost in
- previous change.
- * libI77/rsfe.c (s_rsfe): Likewise.
-
-Sat Jun 27 23:04:49 1998 Jeffrey A Law (law@cygnus.com)
-
- * Makefile.in (FLAGS_TO_PASS, case G2C_H_DIR): Use $(TARGET_SUBDIR)
- instead of hardcoding "libraries".
-
-1998-06-26 Manfred Hollstein <manfred@s-direktnet.de>
-
- * Makefile.in (gcc_version_trigger): Add new macro.
- (config.status): Add dependency upon $(gcc_version_trigger).
-
- * configure.in (gcc_version_trigger): New variable; initialize
- using value from toplevel configure; add AC_SUBST for it.
- (gcc_version): Change initialization to use this new variable.
- * configure: Regenerate.
-
-1998-06-24 Manfred Hollstein <manfred@s-direktnet.de>
-
- * Makefile.in (version): Rename to gcc_version.
- * configure.in (version): Likewise.
- (gcc_version): Add code to use an option passed from parent configure.
- * configure: Regenerate.
-
-1998-06-23 Dave Love <d.love@dl.ac.uk>
-
- * libI77/backspace.c, libI77/dfe.c, libI77/due.c, libI77/iio.c:
- * libI77/lread.c, libI77/sfe.c, libI77/sue.c, libI77/wsfe.c: Update
- to Netlib version of 1998-06-18.
-
-1998-06-21 Dave Love <d.love@dl.ac.uk>
-
- * configure.in (version, target_alias): Define.
-
- * Makefile.in (version, target_alias, libsubdir): Define.
- (install): Remove check for libsubdir.
-
-Sat Jun 13 03:46:40 1998 Craig Burley <burley@gnu.org>
-
- * Makefile.in (install): Don't install if $(libsubdir)
- is empty; issue a diagnostic saying top-level Makefile
- must pass it in instead, and exit.
-
- * Makefile.in (g2c.h): Rename from f2c.h.
-
- * Makefile.in, libF77/Makefile.in, libI77/Makefile.in:
- * libU77/Makefile.in: Rewrite config and var assignment
- sections to be even more minimal than before, and to
- more clearly documented what macros are expected to be
- set and to what sorts of values. Eliminate CROSS and
- related stuff, since there's no such things as CROSS
- in egcs. Rename GCC_FOR_TARGET to CC throughout.
- * Makefile.in (stamp-libi77, stamp-libf77, stamp-libu77):
- Eliminate CROSS.
- * configure.in: Eliminate CROSS.
-
- Rename libf2c.a and f2c.h to libg2c.a and g2c.h,
- normalize and simplify g77/libg2c build process:
- * Makefile.in: Remove all stuff pertaining to
- installation, cleaning, and so on. Parent Makefile
- does all that now. Pass F2C_H_DIR,
- G2C_H_DIR, and GCC_H_DIR, the pathnames for the
- directories containing f2c.h, g2c.h, and other
- #include files, to subdirectory Makefiles.
- (stamp-libf77, stamp-libi77, stamp-libu77):
- Don't specify `-f Makefile' anymore, it's not needed
- now that subdirectory makefile's from netlib are
- renamed to makefile.netlib in g77 source (and to
- makefile.ori by configuration process, in case they're
- still around somehow).
- (stamp-libe77): Don't make libE77 dir unless it doesn't
- exist, if it does just delete all objects in it.
- Compile using $(GCC_FOR_TARGET), not $(CC).
- (rebuilt): Remove this and all subordinate targets,
- as parent Makefile now handles all that.
- (*clean): Remove.
- * configure.in (Pad_UDread, ALWAYS_FLUSH, WANT_LEAD_0):
- Remove these and commentary to new f2c.h file.
- AC_OUTPUT g2c.h instead of f2c.h. Remove old commentary
- regarding concatenation.
- * g2c.h.in: Rename from f2c.h.in, add appropriate
- commentary.
- * f2c.h: New file, a wrapper for g2c.h that does
- libg2c-specific stuff.
- * libF77/Makefile.in, libI77/Makefile.in, libU77/Makefile.in:
- Change $(ALL_CFLAGS) to use F2C_H_DIR, G2C_H_DIR, and GCC_H_DIR
- macros. Remove F2C_H macro, replace use with explicit
- dependencies on f2c.h and g2c.h.
- (*clean): Remove.
-
-Mon Apr 27 22:52:31 1998 Richard Henderson <rth@cygnus.com>
-
- * libU77/ltime_.c: Bounce the ftnint argument through a local time_t.
- * libU77/gmtime_.c: Likewise.
-
-Sun Apr 26 18:07:56 1998 Richard Henderson <rth@cygnus.com>
-
- * configure.in: Adjust include paths in F2C_INTEGER and F2C_LONGINT
- tests to work out of the build directory.
-
-1998-05-20 Dave Love <d.love@dl.ac.uk>
-
- * Makefile.in ($(lib)): Use shell loop instead of unportable
- make variable substitution.
-
-Tue May 19 12:50:27 1998 Craig Burley <burley@gnu.org>
-
- Break up main() into separate .o's so making and
- linking against shared libraries with non-Fortran
- main() routines is easier:
- * Makefile.in (MISC): Add setarg.o and setsig.o.
- * libF77/Makefile.in (MISC): Ditto.
- * libF77/setarg.c: New file, contains f_setarg().
- * libF77/setsig.c: New file, contains f_setsig().
- * libF77/getarg_.c: Rename xarg* to f__xarg*.
- * libF77/iargc_.c: Ditto
-
-Sat May 2 16:44:46 1998 Craig Burley <burley@gnu.org>
-
- * libF77/signal_.c, libI77/dfe.c, libI77/due.c,
- libI77/wsfe.c: Tweaks to eliminate unnecessary
- differences vs. netlib libf2c.
-
-Fri May 1 11:57:45 1998 Craig Burley <burley@gnu.org>
-
- Update to Netlib version of 1998-04-20:
- * libF77/dtime_.c, libF77/etime_.c, libF77/h_dnnt.c,
- libF77/h_nint.c, libF77/i_dnnt.c, libF77/i_nint.c,
- libF77/main.c, libF77/s_paus.c, libF77/signal1.h0,
- libI77/backspace.c, libI77/close.c, libI77/dfe.c,
- libI77/endfile.c, libI77/err.c, libI77/fio.h,
- libI77/iio.c, libI77/ilnw.c, libI77/lread.c,
- libI77/lwrite.c, libI77/open.c, libI77/rawio.h,
- libI77/sfe.c, libI77/util.c, libI77/wrtfmt.c,
- libI77/wsfe.c, libI77/wsle.c, libI77/wsne.c:
- See changes.netlib for info.
-
-Sun Apr 26 09:13:41 1998 Craig Burley <burley@gnu.org>
-
- * libU77/hostnm_.c (G77_hostnm_0): Fix off-by-one error
- that was trashing the byte just beyond the CHARACTER*(*)
- argument.
-
-Wed Mar 4 16:32:46 1998 Craig Burley <burley@gnu.org>
-
- * libU77/u77-test.f: Don't bother declaring etime.
- Use `implicit none' and declare mask and lenstr.
- Do ETIME/DTIME consistency check before loop, then
- use loop to verify that dtime "ticks" at some point.
- Check ETIME array-sum using single-precision add, to
- avoid spurious complaint on systems (like x86) that
- use more precision for intermediate results.
- Fix `Results of ETIME and DTIME...' message to print
- pertinent values (r1 and r2 instead of i and j).
- Change loop from 10M to 1K repeated up to 1000 times
- or until dtime "ticks".
- Print the number of 1K loops needed to see this tick.
- Answer a commented question.
- Split up a long line of output and do other prettying.
- Preset lognam in case GETLOG fails to overwrite it.
-
-Sat Feb 28 15:32:15 1998 Craig Burley <burley@gnu.org>
-
- * libI77/open.c (f_open): Use sizeof(buf) instead of
- 256, for the usual reasons.
-
-1998-02-17 Dave Love <d.love@dl.ac.uk>
-
- * libU77/u77-test.f: Tweak some o/p.
-
- * libU77/Makefile.in (check): Use -L for new directory structure.
-
- * Makefile.in (check): Run the u77 check.
- (config.status, Makefile): New targets.
-
-Wed Feb 11 01:46:20 1998 Manfred Hollstein <manfred@s-direktnet.de>
-
- * Makefile.in ($(lib)): Call $(AR) repeatedly to avoid overflowing
- argument size limit on ancious System V.
-
-Sun Feb 8 00:32:17 1998 Manfred Hollstein <manfred@s-direktnet.de>
-
- * Makefile.in: Add `info install-info clean-info check dvi' targets.
-
-Mon Feb 2 11:08:49 1998 Richard Henderson <rth@cygnus.com>
-
- * configure.in: Update F2C_INTEGER and F2C_LONGINT tests
- for the new placement in the hierarchy.
-
-Sun Feb 1 02:36:33 1998 Richard Henderson <rth@cygnus.com>
-
- * Previous contents of gcc/f/runtime moved into toplevel
- "libf2c" directory.
-
-Sun Feb 1 01:42:47 1998 Mumit Khan <khan@xraylith.wisc.edu>
-
- * libU77/configure.in (getlogin,getgid,getuid, kill,link,ttyname):
- Check.
- * libU77/config.h.in (HAVE_GETLOGIN, HAVE_GETGID, HAVE_GETUID,
- HAVE_KILL, HAVE_LINK, HAVE_TTYNAME): New defs.
- * libU77/getlog_.c: Conditionalize for target platform. Set errno
- to ENOSYS if target libc doesn't have the function.
- * libU77/getgid_.c: Likewise.
- * libU77/getuid_.c: Likewise.
- * libU77/kill_.c: Likewise.
- * libU77/link_.c: Likewise.
- * libU77/ttynam_.c: Likewise.
-
-Sun Jan 18 20:01:37 1998 Toon Moene <toon@moene.indiv.nluug.nl>
-
- * libI77/backspace.c: (f_back): Use type `uiolen' to determine size
- of record length specifier.
-
-Sat Jan 17 22:40:31 1998 Mumit Khan <khan@xraylith.wisc.edu>
-
- * libU77/configure.in (sys/param.h,sys/times.h): Check.
- (times,alarm): Likewise.
- * libU77/config.h.in (HAVE_SYS_PARAM_H, HAVE_SYS_TIMES_H)
- (HAVE_ALARM, HAVE_TIMES): New defs.
- * libU77/alarm_.c: Conditionalize for target platform. Set errno
- to ENOSYS if target libc doesn't have the function.
- * libU77/dtime_.c: Likewise.
- * libU77/etime_.c: Likewise.
- * libU77/sys_clock_.c: Likewise.
-
- * configure.in (NON_UNIX_STDIO): Define if MINGW32.
- (NON_ANSI_RW_MODE): Do not define for CYGWIN32 or MINGW32.
-
- * libI77/rawio.h: Don't providing conflicting declarations for
- read() and write(). MINGW32 header files use "const" quals.
-
- * libF77/s_paus.c: _WIN32 does not have pause().
-
-Mon Apr 27 22:52:31 1998 Richard Henderson <rth@cygnus.com>
-
- * libU77/ltime_.c: Bounce the ftnint argument through a local time_t.
- * libU77/gmtime_.c: Likewise.
-
-Sun Apr 26 18:07:56 1998 Richard Henderson <rth@cygnus.com>
-
- * configure.in: Adjust include paths in F2C_INTEGER and F2C_LONGINT
- tests to work out of the build directory.
-
-Tue Dec 23 22:56:01 1997 Craig Burley <burley@gnu.org>
-
- * libF77/signal_.c (G77_signal_0): Return type is
- now `void *', to cope with returning previous signal
- handler on 64-bit systems like Alphas.
- * f2cext.c (signal_): Changed accordingly.
-
-Tue Nov 18 09:49:04 1997 Mumit Khan (khan@xraylith.wisc.edu)
-
- * libI77/close.c (f_exit): Reset f__init so that f_clos does not
- (incorrectly) think there is an I/O recursion when program is
- interrupted.
-
-Sat Nov 1 18:03:42 1997 Jeffrey A Law (law@cygnus.com)
-
- * libF77/signal_.c: Undo last change until we can fix it right.
-
-Wed Oct 29 01:01:04 1997 Mumit Khan <khan@brahma.xraylith.wisc.edu>
-
- * configure.in: Set CC to CC_FOR_TARGET when cross-compiling.
-
-Fri Oct 24 11:15:22 1997 Mumit Khan <khan@brahma.xraylith.wisc.edu>
-
- * libI77/close.c (f_exit): Reset f__init so that f_clos does not
- (incorrectly) think there is an I/O recursion when program is
- interrupted.
-
-Wed Oct 15 10:06:29 1997 Richard Henderson <rth@cygnus.com>
-
- * libF77/signal_.c (G77_signal_0): Make return type sig_pf as well.
- * libI77/fio.h: Include <string.h> if STDC_HEADERS.
- * libU77/chmod_.c: Likewise.
-
-Tue Oct 7 18:22:10 1997 Richard Henderson <rth@cygnus.com>
-
- * Makefile.in (CGFLAGS): Don't force -g0.
- * libF77/Makefile.in, libI77/Makefile.in, libU77/Makefile.in: Likewise.
-
-Mon Oct 6 14:16:46 1997 Jeffrey A Law (law@cygnus.com)
-
- * Makefile.in (distclean): Do a better job at cleaning up.
-
-1997-10-03 Dave Love <d.love@dl.ac.uk>
-
- * configure.in: Check for tempnam (best because it obeys TMPDIR).
- * libI77/open.c: Use it.
- * libI77/err.c: New message # 132.
-
-Wed Oct 1 01:46:16 1997 Philippe De Muyter <phdm@info.ucl.ac.be>
-
- * libU77/sys_clock_.c: File renamed from system_clock_.c.
- * libU77/Makefile.in, Makefile.in : Reference sys_clock_.*, not
- system_clock_.*.
- * libU77/dtime_.c (clk_tck): Try also HZ macro.
- * libU77/access.c (G77_access_0): Check malloc return value against 0,
- not NULL.
- * libU77/getlog_.c, libU77/ttynam_.c, libU77/chdir_.c: Ditto.
- * libU77/chmod_.c, libU77/rename_.c: Ditto.
-
-Tue Sep 30 00:41:39 1997 Craig Burley <burley@gnu.ai.mit.edu>
-
- Do a better job of printing the offending FORMAT string
- when producing a diagnostic:
- * libI77/err.c (f__fmtlen): New variable to hold operating
- length of format string.
- (f__fatal): Use new variable to limit length of printed string.
- * libI77/fmt.c (f_s): Don't skip spaces after closing paren,
- so nicer message results (and nested case already skips them).
- (pars_f): Record operating length of format string as indicated
- by a successful call to f_s, or ad-hoc-calculate it if failure,
- limiting the length to 80 characters (and stopping at NUL).
- (do_fio): Use new variable to limit length of printed string.
- * libI77/fmt.h (f__fmtlen): Declare new variable.
- * libI77/lread.c (c_le): Set new variable to known length.
-
-Mon Sep 29 16:30:31 1997 Craig Burley <burley@gnu.ai.mit.edu>
-
- Update to Netlib version of 1997-09-23:
- * libF77/dtime_.c (dtime_), libF77/etime_.c (dtime_):
- Return `double' instead of `float' (these are not used
- in g77's version of libf2c).
- * libI77/fmt.c, libI77/fmt.h, libI77/rdfmt.c, libI77/wrtfmt.c:
- Support machines with 64-bit pointers and 32-bit ints (e.g.
- Linux on DEC Alpha).
-
-1997-09-19 Dave Love <d.love@dl.ac.uk>
-
- * libU77/dtime_.c (G77_dtime_0): Fix types in HAVE_GETRUSAGE case
- so as not to truncate results to integer values.
- * libU77/Version.c: Bump.
-
-Thu Sep 18 16:58:46 1997 Jeffrey A Law (law@cygnus.com)
-
- * Makefile.in (stamp-lib): Don't use '$?', explicitly
- list the variables containing the object files to include
- in libf2c.a
-
-Tue Sep 9 00:33:24 1997 Craig Burley <burley@gnu.ai.mit.edu>
-
- * Version 0.5.21 released.
-
-Mon Sep 8 19:39:01 1997 Craig Burley <burley@gnu.ai.mit.edu>
-
- * libI77/close.c (f_exit): Fix thinko, inverted test
- of whether initialization done, so exiting now closes
- open units again.
-
-Fri Sep 5 00:18:17 1997 Jeffrey A Law (law@cygnus.com)
-
- * Makefile.in (clean): Don't remove config.cache.
- (distclean): Do it here instead.
-
-Tue Aug 26 20:14:08 1997 Robert Lipe (robertl@dgii.com)
-
- * hostnm_.c: Include errno.h
-
-Tue Aug 26 01:42:21 1997 Craig Burley <burley@gnu.ai.mit.edu>
-
- From Jim Wilson:
- * configure.in: Make sure RANLIB_TEST is set also.
-
- From Robert Lipe <robertl@dgii.com>:
- * libU77/getcwd_.c, libU77/hostnm_.c, libU77/lstat_.c:
- Also #include <errno.h>, to define ENOSYS.
-
-Tue Aug 26 01:25:58 1997 Craig Burley <burley@gnu.ai.mit.edu>
-
- * Makefile.in (stamp-lib): Put all f2cext.c objects in
- a temp directory named libE77, then `ar' them all at
- once into libf2c.a, to get the job done a bit faster.
- Still remove the objects (and libE77 directory) afterward.
-
-Mon Aug 25 23:26:05 1997 H.J. Lu (hjl@gnu.ai.mit.edu)
-
- * Makefile.in (mostlyclean, clean): Check if Makefile exists
- before using it. Remove stamp-*.
- (stamp-libi77, stamp-libf77, stamp-libu77): New.
- (stamp-lib): Only depend on stamp-libi77 stamp-libf77
- stamp-libu77
-
-Sun Aug 24 05:04:35 1997 Craig Burley <burley@gnu.ai.mit.edu>
-
- * libU77/rand_.c (G77_rand_0), libU77/dtime_.c (G77_dtime_0),
- libU77/etime_.c (G77_etime_0), libU77/secnds_.c (G77_secnds_0),
- libU77/second_.c (G77_second_0): Really return `double', not
- `doublereal', since the result is cast to `float'.
- * f2cext.c: (rand_, dtime_, etime_, secnds_, second_): Ditto.
- (erf_, erfc_, besj0_, besj1_, besjn_, besy0_, besy1_,
- besyn_, dbesj0_, dbesj1_, dbesjn_, dbesy0_, dbesy1_,
- dbesyn_): All of these return `double', not `doublereal',
- as they either have `float' or `double' results.
- * libU77/bes.c (besj0_, besj1_, besjn_, besy0_, besy1_,
- besyn_): Ditto.
- * libU77/dbes.c (dbesj0_, dbesj1_, dbesjn_, dbesy0_, dbesy1_,
- dbesyn_): Ditto.
-
- Update to Netlib version of 1997-08-16:
- * libI77/iio.c: Fix bug in internal writes to an array
- of character strings.
-
- * Makefile.in (UOBJ): Restore fixes made by Dan Pettet I
- lost, which included the addition of mclock_.o already noted
- below, plus adding symlnk_.o.
-
-Thu Aug 21 03:58:34 1997 Craig Burley <burley@gnu.ai.mit.edu>
-
- * Makefile.in (UOBJ): Add mclock_.o, thanks to Mumit Khan!
-
-1997-08-21 Dave Love <d.love@dl.ac.uk>
-
- * libU77/alarm_.c: Fix return type: `integer'.
-
-Mon Aug 11 20:12:42 1997 Craig Burley <burley@gnu.ai.mit.edu>
-
- * Makefile.in ($(lib), stamp-lib): Ensure that library
- gets fully updated even if updating was aborted earlier.
-
- * libU77/hostnm_.c (G77_hostnm_0): Return ENOSYS and stuff
- in errno if system has no gethostname() function.
-
- * libU77/lstat_.c (G77_lstat_0): Return ENOSYS and stuff
- in errno if system has no lstat() function.
-
- * libU77/getcwd_.c (G77_getcwd_0): Return ENOSYS and stuff
- in errno if system has no getcwd() or getwd() function.
- Test HAVE_GETCWD properly.
-
- * libU77/symlnk_.c (G77_symlink_0): Return ENOSYS and stuff
- in errno if system has no symlink() function.
-
- * libU77/mclock_.c (G77_mclock_0): Return -1 if system
- has no clock() function.
-
-Mon Aug 11 01:55:36 1997 Craig Burley <burley@gnu.ai.mit.edu>
-
- * Makefile.in (F2CEXT): Add `alarm' to this list.
-
- * f2cext.c (alarm_): Fix some typos in this function.
- Delete third `status' argument.
-
- * libU77/alarm_.c: Delete third `status' argument,
- as caller gets this from function result; return
- status value as function result for caller.
-
- * configure.in: Rename `ac_cv_struct_FILE' to
- `g77_cv_struct_FILE' according to 1997-06-26 change.
-
-1997-08-06 Dave Love <d.love@dl.ac.uk>
-
- * libU77/vxtidate_.c: Correct day/month argument order.
- * f2cext.c: Likewise.
-
-1997-07-07 Dave Love <d.love@dl.ac.uk>
-
- * f2cext.c: Add alarm_.
-
- * Makefile.in, libU77/Makefile.in: Add alarm_.
-
- * libU77/alarm_.c: New file.
-
-1997-06-26 Dave Love <d.love@dl.ac.uk>
-
- * configure.in: Generally use prefix `g77_' for cached values
- we've invented, not `ac_'.
-
-Tue Jun 24 18:50:06 1997 Craig Burley <burley@gnu.ai.mit.edu>
-
- * libI77/ilnw.c (s_wsni): Call f_init() here.
- (s_wsli): Ditto.
- (e_wsli): Turn off "doing I/O" flag here.
-
-1997-06-20 Dave Love <d.love@dl.ac.uk>
-
- * runtime/configure.in: Check for cygwin32 after Mumit Khan (but
- differently); if cygwin32 define NON_UNIX_STDIO and don't define
- NON_ANSI_RW_MODES.
-
-Tue Jun 01 06:26:29 1997 Craig Burley <burley@gnu.ai.mit.edu>
-
- * libI77/rsne.c (nl_init): Don't call f_init() here,
- since s_rsne() already does.
- (c_lir): Call f_init() here instead.
- * libI77/rsli.c (e_rsli): Turn off "doing I/O" flag here.
- * libI77/sue.c (e_rsue): Ditto.
-
-Sun Jun 22 23:27:22 1997 Craig Burley <burley@gnu.ai.mit.edu>
-
- * libI77/fio.h (err): Mark I/O as no longer in progress
- before returning a non-zero error indicator (since
- that tells the caller to jump over the remaining I/O
- calls, including the corresponding `e_whatever' call).
- * libI77/err.c (endif): Ditto.
- * libI77/sfe.c (e_wsfe): Ditto.
- * libI77/lread.c (ERR): Ditto.
- * libI77/lread.c (l_read): Ditto by having quad case
- use ERR, not return, to return non-zero error code.
-
-Sat Jun 21 12:31:28 1997 Craig Burley <burley@gnu.ai.mit.edu>
-
- * libI77/open.c (fk_open): Temporarily turn off
- "doing I/O" flag during f_open() call to avoid recursive
- I/O error.
-
-Tue Jun 17 22:40:47 1997 Craig Burley <burley@gnu.ai.mit.edu>
-
- * err.c, close.c, rewind.c, inquire.c, backspace.c, endfile.c,
- iio.c, open.c, Version.c, sfe.c, wsle.c, rsne.c, sue.c, rsfe.c,
- lread.c, wsfe.c, fio.h, due.c, dfe.c: Change f__init from
- `flag' to `int' and to signal not just whether initialization
- has happened (bit 0), but also whether I/O is in progress
- already (bit 1). Consistently produce a clear diagnostic
- in cases of recursive I/O. Avoid infinite recursion in
- f__fatal, in case sig_die triggers another error. Don't
- output info on internals if not initialized in f__fatal. Don't
- bother closing units in f_exit if initialization hasn't
- happened.
-
-Tue Jun 10 12:57:44 1997 Craig Burley <burley@gnu.ai.mit.edu>
-
- Update to Netlib version of 1997-06-09:
- * libI77/err.c, libI77/lread.c, libI77/rdfmt.c,
- libI77/wref.c: Move some #include's around.
-
-Mon Jun 9 18:11:56 1997 Craig Burley <burley@gnu.ai.mit.edu>
-
- * libU77/kill_.c (kill_): KR_headers version needed
- `*' in front of args in decls.
-
-Sun May 25 03:16:53 1997 Craig Burley <burley@gnu.ai.mit.edu>
-
- Update to Netlib version of 1997-05-24:
- * libF77/README, libF77/Version.c, libF77/main.c,
- libF77/makefile, libF77/s_paus.c, libF77/signal1.h,
- libF77/signal_.c, libF77/z_div.c, libI77/Notice,
- libI77/README, libI77/Version.c, libI77/dfe.c,
- libI77/err.c, libI77/fmt.c, libI77/makefile,
- libI77/rawio.h: Apply many, but not all, of the changes
- made to libf2c since last update.
- * libF77/Makefile.in (MISC), Makefile.in (MISC): Rename
- exit.o to exit_.o to go along with Netlib.
- * libF77/signal.c: Make the prologue much simpler than
- Netlib has it.
-
-Sun May 18 20:56:02 1997 Craig Burley <burley@gnu.ai.mit.edu>
-
- * libU77/unlink_.c, libU77/stat_.c, libU77/symlnk_.c,
- libU77/chmod_.c: g_char first arg is const.
-
- * libU77/chmod_.c: s_cat expects ftnlen[], not int[] or
- integer[], change types of array and variables
- accordingly.
-
-May 7 1997 Daniel Pettet <dan.pettet@bchydro.bc.ca>
-
- * libU77/dbes_.c: Commented out the code in the
- same way the bes* routines are commented out. This
- was done because corresponding C routines are referenced
- directly in com-rt.def.
-
-Mon May 5 13:56:02 1997 Craig Burley <burley@gnu.ai.mit.edu>
-
- * libU77/stat_.c: Reverse KR/ANSI decls of g_char().
-
-Apr 18 1997 Daniel Pettet <dan.pettet@bchydro.bc.ca>
-
- * libF77/F77_aloc.c, libF77/abort_.c, libF77/derf_.c,
- libF77/derfc_.c, libF77/ef1asc_.c, libF77/ef1cmc_.c,
- libF77/erf_.c, libF77/erfc_.c, libF77/exit.c,
- libF77/getarg_.c, libF77/getenv_.c, libF77/iargc_.c,
- libF77/s_cat.c, libF77/signal_.c, libF77/system_.c,
- libI77/close.c, libI77/ftell_.c, libU77/access_.c,
- libU77/bes.c, libU77/chdir_.c, libU77/chmod_.c, libU77/ctime_.c,
- libU77/date_.c, libU77/dbes.c, libU77/dtime_.c, libU77/etime_.c,
- libU77/fdate_.c, libU77/fgetc_.c, libU77/flush1_.c,
- libU77/fnum_.c, libU77/fputc_.c, libU77/fstat_.c,
- libU77/gerror_.c, libU77/getcwd_.c, libU77/getgid_.c,
- libU77/getlog_.c, libU77/getpid_.c, libU77/getuid_.c,
- libU77/gmtime_.c, libU77/hostnm_.c, libU77/idate_.c,
- libU77/ierrno_.c, libU77/irand_.c, libU77/isatty_.c,
- libU77/itime_.c, libU77/kill_.c, libU77/link_.c,
- libU77/lnblnk_.c, libU77/ltime_.c, libU77/mclock_.c,
- libU77/perror_.c, libU77/rand_.c, libU77/rename_.c,
- libU77/secnds_.c, libU77/second_.c, libU77/sleep_.c,
- libU77/srand_.c, libU77/stat_.c, libU77/symlnk_.c,
- libU77/system_clock_.c, libU77/time_.c, libU77/ttynam_.c,
- libU77/umask_.c, libU77/unlink_.c, libU77/vxtidate_.c,
- libU77/vxttime_.c: Completed renaming routines that are directly
- callable from g77 to internal names of the form
- G77_xxxx_0 that are known as intrinsics by g77.
-
-Apr 8 1997 Daniel Pettet <dan.pettet@bchydro.bc.ca>
-
- * Makefile.in: Add libU77/mclock_.o and libU77/symlnk_.o to UOBJ.
- * libU77/Makefile.in: Add mclock_.c to SRCS.
- Add mclock_.o and symlnk_.o to OBJS.
- Add mclock_.o dependency.
-
-Apr 8 1997 Daniel Pettet <dan.pettet@bchydro.bc.ca>
-
- * libU77/symlnk_.c: Added a couple of (char*) casts to malloc
- to silence the compiler.
-
-1997-03-17 Dave Love <d.love@dl.ac.uk>
-
- * libU77/access_.c, libU77/chdir_.c, libU77/chmod_.c,
- libU77/link_.c, libU77/lstat_.c, libU77/rename_.c, libU77/stat_.c,
- libU77/symlnk_.c, libU77/u77-test.f, libU77/unlink_.c: Strip
- trailing blanks from file names for consistency with other
- implementations (notably Sun's).
-
- * libU77/chmod_.c: Quote the file name given to the shell.
-
-Mon Mar 10 00:19:17 1997 Craig Burley <burley@gnu.ai.mit.edu>
-
- * libI77/uio.c (do_ud) [PAD_UDread]: Add semicolon to err()
- invocation when macro not defined (from Mumit Khan
- <khan@xraylith.wisc.edu>).
-
-Fri Feb 28 13:16:50 1997 Craig Burley <burley@gnu.ai.mit.edu>
-
- * Version 0.5.20 released.
-
-Wed Feb 26 20:28:53 1997 Craig Burley <burley@gnu.ai.mit.edu>
-
- * Makefile.in: $(MAKE) invocations now explicitly
- specify `-f Makefile', just in case the `makefile's
- from the netlib distribution would get used instead.
-
-Mon Feb 24 16:43:39 1997 Craig Burley <burley@gnu.ai.mit.edu>
-
- * libU77/Makefile.in (check): Specify driver, and
- don't bother enabling already-enabled intrinsic groups.
- Also, get the $(srcdir) version of u77-test.f.
-
-Sat Feb 22 14:08:42 1997 Craig Burley <burley@gnu.ai.mit.edu>
-
- * libU77/u77-test.f: Explicitly declare intrinsics, get
- rid of useless CHARACTER declarations on intrinsics (maybe
- someday appropriate to implement meaning of that in g77
- and restore them?).
- Add spin loop just to fatten up the timings a bit.
- Clarify ETIME output as having three fields.
- Call TIME with CHARACTER*8, not CHARACTER*6, argument.
- Call new SECOND intrinsic subroutine, after calling
- new DUMDUM subroutine just to ensure the correct value
- doesn't get left around in a register or something.
-
-Thu Feb 20 15:22:42 1997 Craig Burley <burley@gnu.ai.mit.edu>
-
- * libU77/bes.c: Comment out all the code, as g77 avoids actually
- calling it, going directly to the system's library instead.
-
-Mon Feb 17 02:27:41 1997 Craig Burley <burley@gnu.ai.mit.edu>
-
- * libU77/fgetc_.c (fgetc_): Allow return value to be
- CHARACTER*(*), properly handle CHARACTER*0 and blank-pad
- CHARACTER*n where n>1.
-
-Tue Feb 11 14:12:19 1997 Craig Burley <burley@gnu.ai.mit.edu>
-
- * Makefile.in: Clarify role of $(srcdir) here. Fix
- various targets accordingly. Don't rely at all on
- gcc/f/include/ being a link to gcc/include/ -- just
- use it directly.
- (${srcdir}/configure, ${srcdir}/libU77/configure):
- Remove the config.cache files in build directory before
- cd'ing to source directory as well.
-
- * libF77/Makefile.in, libI77/Makefile.in (ALL_CFLAGS):
- Include `-I.' to pick up build directory.
- Use gcc/include/ directly.
- * libU77/Makefile.in (ALL_CFLAGS): Include `-I$(srcdir)'
- to pick up source directory.
- (OBJS): Fix typo in `chmod_.o' (was `chmod.o').
-
-Mon Feb 10 12:54:47 1997 Craig Burley <burley@gnu.ai.mit.edu>
-
- * Makefile.in (UOBJ), libU77/Makefile.in (OBJS): Add
- libU77/chmod_.o to list of objects.
- * libU77/chmod_.c: Fix up headers.
- Fix implementation to not prematurely truncate command
- string and make room for trailing null.
-
- * libU77/ctime_.c: Incoming xstime argument is now longint.
- * libU77/mclock_.c: Now returns longint.
- * libU77/time_.c: Now returns longint.
-
-1997-02-10 Dave Love <d.love@dl.ac.uk>
-
- * etime_.c, dtime_.c: Typo rounded times to seconds.
-
- * date_.c: Add missing return.
-
- * hostnm_.c: #include unistd.h.
-
-Sat Feb 8 03:30:19 1997 Craig Burley <burley@gnu.ai.mit.edu>
-
- INTEGER*8 support built in to f2c.h and libf2c (since
- gcc will be used to compile relevant code anyway):
- * Makefile.in, libF77/Makefile.in: Add pow_qq.o,
- qbitbits.o, and qbitshft.o to $POW and $F90BIT macros,
- as appropriate.
- * f2c.h.in: Define appropriate types and macros.
- Place #error directive correctly.
- * configure.in: Determine appropriate types for long
- integer (F2C_LONGINT).
- Meanwhile, quote strings in #error, for consistency.
- Fix restoring of ac_cpp macro.
- * configure: Regenerated using autoconf-2.12.
-
- * libF77/Version.c, libI77/Version.c, libU77/Version.c:
- Update version numbers.
- Change names and code for g77-specific version-printing
- routines (shorter names should be safer to link on
- weird, 8-char systems).
-
- * libF77/c_cos.c, libF77/c_div.c, libF77/c_exp.c,
- libF77/c_log.c, libF77/c_sin.c, libF77/c_sqrt.c,
- libF77/d_cnjg.c, libF77/pow_zi.c, libF77/r_cnjg.c,
- libF77/z_cos.c, libF77/z_div.c, libF77/z_exp.c,
- libF77/z_log.c, libF77/z_sin.c, libF77/z_sqrt.c:
- Changed to work properly even when result is aliased
- with any inputs.
-
- * libF77/makefile, libI77/makefile: Leave these in
- the g77 distribution, so it is easier to track changes
- to official libf2c.
-
- * libF77/signal_.c: Eliminate redundant `return 0;'.
-
- * libI77/fio.h (err, errfl): Fix these so they work
- (and must be expressed) as statements.
- Fix up many users of err() to include trailing semicolon.
-
- * Incorporate changes by Bell Labs to libf2c through 1997-02-07.
-
-1997-02-06 Dave Love <d.love@dl.ac.uk>
-
- * libU77/etime_.c, libU77/dtime_.c: Fix getrusage stuff.
-
- * libU77/config.h.in: Regenerate for HAVE_GETRUSAGE.
-
- * libU77/Makefile.in, libI77/Makefile.in, libF77/Makefile.in:
- Redo *clean targets; distclean and maintainer-clean remove the stage?
- and include links. This probably want looking at further.
-
-Wed Feb 5 00:21:23 1997 Craig Burley <burley@gnu.ai.mit.edu>
-
- Add libU77 library from Dave Love <d.love@dl.ac.uk>:
- * Makefile.in: Add libU77 directory, rules, etc.
- * configure.in: New libU77 directory, Makefile, etc.
-
- * Makefile.in, libF77/Makefile.in, libI77/Makefile.in,
- libU77/Makefile.in: Reorganize these so $(AR) commands
- handled by the top-level Makefile instead of the
- subordinates. This permits it to do $(AR) only when
- one or more object files actually change, instead of
- having to force-update it as was necessary before.
- And that had the disadvantage of requiring, e.g., user
- root to have access to $(AR) to the library simply to
- install g77, which might be problematic on an NFS setup.
- (mostlyclean, clean, distclean, maintainer-clean):
- Properly handle these rules.
-
- * Makefile.in: Don't invoke config.status here -- let
- compiler-level stuff handle all that.
-
- * libI77/err.c [MISSING_FILE_ELEMS]: Declare malloc in this case
- too, so it doesn't end up as an integer.
-
-Sat Feb 1 02:43:48 1997 Craig Burley <burley@gnu.ai.mit.edu>
-
- * libF77/Makefile.in: More fixup for $(F90BIT) -- wasn't
- in list for ar command, and it wasn't correctly listed
- in the list of things depending on f2c.h.
-
- * f2c.h.in: Fix up #error directive.
-
-1997-01-31 Dave Love <d.love@dl.ac.uk>
-
- * libF77/Makefile.in ($(lib)): Add $(F90BIT); shouldn't exclude
- stuff f2c needs so we can share the library.
-
-Sat Jan 18 19:39:03 1997 Craig Burley <burley@gnu.ai.mit.edu>
-
- * configure.in: No longer define ALWAYS_FLUSH, the
- resulting performance is too low.
-
-Wed Dec 18 12:06:02 1996 Craig Burley <burley@gnu.ai.mit.edu>
-
- Patch from Mumit Khan <khan@xraylith.wisc.edu>:
- * libF77/s_paus.c: Add __CYGWIN32__ to list of macros
- controlling how to pause.
-
-Sun Dec 1 21:25:27 1996 Craig Burley <burley@gnu.ai.mit.edu>
-
- * configure: Regenerated using autoconf-2.12.
-
-Mon Nov 25 21:16:15 1996 Craig Burley <burley@gnu.ai.mit.edu>
-
- * configure: Regenerated using autoconf-2.11.
-
-1996-11-19 Dave Love <d.love@dl.ac.uk>
-
- * libI77/backspace.c: Include sys/types.h for size_t.
-
-Wed Nov 6 14:17:27 1996 Craig Burley <burley@gnu.ai.mit.edu>
-
- * f2c.h.in: Properly comment out the unsupported stuff so
- we don't get build-time errors.
-
- * libF77/Version.c, libI77/Version.c: Restore macro definition
- of version information.
-
- * libI77/Makefile.in (OBJ) [foo]: Add ftell_.o to list of objects.
-
- * libI77/uio.c (do_ud): Fix up casts in PAD_UDread case just
- like they were fixed in the other case.
-
-Thu Oct 31 22:27:45 1996 Craig Burley <burley@gnu.ai.mit.edu>
-
- * libI77/ftell_.c (fseek_): Map incoming whence argument to
- system's actual SEEK_CUR, SEEK_SET, or SEEK_END macro for
- fseek(), and crash (gracefully) if the argument is invalid.
-
-1996-10-19 Dave Love <d.love@dl.ac.uk>
-
- * configure.in: Add check that we have the tools to cross-compile
- if appropriate.
- (NO_EOF_CHAR_CHECK,Skip_f2c_Undefs): Define.
-
- * libF77/Makefile.in (F90BIT): New routines from Netlib.
-
- * f2c.h.in:
- Use more sanitary #error (indented for K&R compliance if necessary) if
- f2c_i2 defined.
- Sync with Netlib: Add `uninteger'. (Commented out) integer*8 stuff.
- bit_{test,clear,set} macros.
-
-1996-10-19 Dave Love <d.love@dl.ac.uk>
-
- Update to Netlib version of 1996-09-26.
-
- * libI77/Version.c: Use <stdio.h>, not "stdio.h".
- * libF77/Version.c: Likewise.
-
-Wed Aug 28 13:25:29 1996 Dave Love <d.love@dl.ac.uk>
-
- * libI77/rsne.c (x_rsne): Use size_t instead of int.
-
- * libI77/endfile.c (copy): Use size_t in place of int.
-
-Wed Aug 28 13:22:20 1996 Dave Love <d.love@dl.ac.uk>
-
- * libI77/backspace.c (f_back): Cast fread arg to size_t.
-
-Tue Aug 27 19:11:30 1996 Dave Love <d.love@dl.ac.uk>
-
- * libI77/Version.c: Supply */ to avoid apparent nested comment.
-
-Tue Aug 20 09:21:43 1996 Dave Love <d.love@dl.ac.uk>
-
- * libF77/Makefile.in (ALL_CFLAGS): Fix missing ../ for include.
- * libI77/Makefile.in (ALL_CFLAGS): Likewise.
-
-Sat Aug 17 13:00:47 1996 Dave Love <d.love@dl.ac.uk>
-
- * libF77/qbitshft.c, libF77/qbitbits.c, libF77/lbitshft.c,
- libF77/lbitbits.c: New file from Netlib. qbit... not currently
- compiled.
-
-Sun Jul 7 18:06:33 1996 Dave Love <d.love@dl.ac.uk>
-
- * libF77/z_sqrt.c, libF77/z_sin.c, libF77/z_exp.c, libF77/z_log.c,
- libF77/system_.c, libF77/z_cos.c, libF77/signal_.c,
- libF77/s_stop.c, libF77/sig_die.c, libF77/s_paus.c,
- libF77/s_rnge.c, libF77/s_cat.c, libF77/r_tan.c, libF77/r_tanh.c,
- libF77/r_sinh.c, libF77/r_sqrt.c, libF77/r_sin.c, libF77/r_mod.c,
- libF77/r_nint.c, libF77/r_lg10.c, libF77/r_log.c, libF77/r_exp.c,
- libF77/r_int.c, libF77/r_cosh.c, libF77/r_atn2.c, libF77/r_cos.c,
- libF77/r_asin.c, libF77/r_atan.c, libF77/r_acos.c,
- libF77/pow_dd.c, libF77/pow_zz.c, libF77/main.c, libF77/i_dnnt.c,
- libF77/i_nint.c, libF77/h_dnnt.c, libF77/h_nint.c, libF77/exit.c,
- libF77/d_tan.c, libF77/d_tanh.c, libF77/d_sqrt.c, libF77/d_sin.c,
- libF77/d_sinh.c, libF77/d_mod.c, libF77/d_nint.c, libF77/d_log.c,
- libF77/d_int.c, libF77/d_lg10.c, libF77/d_cosh.c, libF77/d_exp.c,
- libF77/d_atn2.c, libF77/d_cos.c, libF77/d_atan.c, libF77/d_acos.c,
- libF77/d_asin.c, libF77/c_sqrt.c, libF77/cabs.c, libF77/c_sin.c,
- libF77/c_exp.c, libF77/c_log.c, libF77/c_cos.c, libF77/F77_aloc.c,
- libF77/abort_.c, libI77/xwsne.c, libI77/wref.c, libI77/util.c,
- libI77/uio.c, libI77/rsne.c, libI77/rdfmt.c, libI77/rawio.h,
- libI77/open.c, libI77/lread.c, libI77/inquire.c, libI77/fio.h,
- libI77/err.c, libI77/endfile.c, libI77/close.c:
- Use #include <...>, not #include "..." for mkdeps
-
-Sat Jul 6 21:39:21 1996 Dave Love <d.love@dl.ac.uk>
-
- * libI77/ftell_.c: Added from Netlib distribution.
-
-Sat Mar 30 20:57:24 1996 Dave Love <d.love@dl.ac.uk>
-
- * configure.in: Eliminate explicit use of
- {RANLIB,AR}_FOR_TARGET.
- * Makefile.in: Likewise.
- * libF77/Makefile.in: Likewise.
- * libI77/Makefile.in: Likewise.
- * configure: Regenerated.
-
-Sat Mar 30 21:02:03 1996 Dave Love <d.love@dl.ac.uk>
-
- * Makefile.in: Eliminate explicit use of
- {RANLIB,AR}_FOR_TARGET.
-
-Tue Mar 26 23:39:59 1996 Dave Love <d.love@dl.ac.uk>
-
- * Makefile.in: Remove hardwired RANLIB and RANLIB_TEST (unnoted
- change).
-
-Mon Mar 25 21:04:56 1996 Craig Burley <burley@gnu.ai.mit.edu>
-
- * Incorporate changes by Bell Labs to libf2c through 1996-03-23,
- including changes to dmg and netlib email addresses.
-
-Tue Mar 19 13:10:02 1996 Craig Burley <burley@gnu.ai.mit.edu>
-
- * Incorporate changes by AT&T/Bellcore to libf2c through 1996-03-19.
-
- * Makefile.in (rebuilt): New target.
-
- * libF77/Makefile.in, libI77/Makefile.in: Use $AR_FOR_TARGET, not
- $AR.
-
-Tue Mar 19 12:53:19 1996 Dave Love <d.love@dl.ac.uk>
-
- * configure.in (ac_cpp): #include <stdio.h> instead
- of <features.h>.
-
-Tue Mar 19 12:52:09 1996 Mumit Khan <khan@xraylith.wisc.edu>
-
- * configure.in (ac_cpp): For f2c integer type,
- add -I$srcdir/../.. to make it work on mips-ultrix4.2.
-
-Sat Mar 9 17:37:15 1996 Craig Burley <burley@gnu.ai.mit.edu>
-
- * libI77/Makefile.in (.c.o): Add -DAllow_TYQUAD, to enable
- I/O support for INTEGER*8.
- * f2c.h.in: Turn on longint type.
-
-Fri Dec 29 18:22:01 1995 Craig Burley <burley@gnu.ai.mit.edu>
-
- * Makefile.in: Reorganize the *clean rules to more closely
- parallel gcc's.
-
- * libF77/Makefile.in, libI77/Makefile.in: Ignore error from $(AR)
- command, in case just doing an install and installer has no write
- access to library (this is a kludge fix -- perhaps install targets
- should never try updating anything?).
-
-Sat Nov 18 19:37:22 1995 Craig Burley (burley@gnu.ai.mit.edu)
-
- * Version 0.5.17 released.
-
-Thu Nov 16 07:20:35 1995 Craig Burley (burley@gnu.ai.mit.edu)
-
- * Incorporate changes by AT&T/Bellcore to libf2c through 1995-11-15.
-
-Fri Sep 22 02:19:59 1995 Craig Burley (burley@gnu.ai.mit.edu)
-
- * libI77/backspace.c, libI77/close.c, libI77/endfile.c,
- libI77/fio.h, libI77/inquire.c, libI77/rawio.h,
- libF77/s_paus.c: Not an MSDOS system if GO32
- is defined, in the sense that the run-time environment
- is thus more UNIX-like.
-
-Wed Sep 20 02:24:51 1995 Craig Burley (burley@gnu.ai.mit.edu)
-
- * libF77/Makefile.in, libI77/Makefile.in: Comment out `ld -r -x'
- and `mv' line pairs, since `-x' isn't supported on systems
- such as Solaris, and these lines don't seem to do anything
- useful after all.
-
-Wed Aug 30 15:58:35 1995 Craig Burley (burley@gnu.ai.mit.edu)
-
- * Version 0.5.16 released.
-
- * Incorporate changes by AT&T/Bellcore to libf2c through 950829.
-
-Mon Aug 28 12:50:34 1995 Craig Burley (burley@gnu.ai.mit.edu)
-
- * libF77/Makefile.in, libI77/Makefile.in ($(lib)): Force ar'ing
- and ranlib'ing of libf2c.a, else after rm'ing libf2c.a and
- doing a make, only libI77 or libF77 would be added to
- the newly created archive.
- Also, instead of `$?' list all targets explicitly so all
- objects are updated in libf2c.a even if only one actually
- needs recompiling, for similar reason -- we can't easily tell
- if a given object is really up-to-date in libf2c.a, or even
- present there.
-
-Sun Aug 27 14:54:24 1995 Craig Burley (burley@gnu.ai.mit.edu)
-
- * libF77/Makefile.in, libI77/Makefile.in: Fix spacing so
- initial tabs are present in all appropriate places.
- Move identical $(AR) commands in if then/else clauses
- to single command preceding if.
- (.c.o, Version[FI].o): Use $@ instead of $* because AIX (RS/6000)
- says $@ means source, not object, basename, and $@ seems to work
- everywhere.
-
-Wed Aug 23 15:44:25 1995 Craig Burley (burley@gnu.ai.mit.edu)
-
- * libF77/system_.c (system_): Declare as returning `ftnint',
- consistent with signal_, instead of defaulting to `int'.
- Hope dmg@research.att.com agrees, else probably will
- change to whatever he determines is correct (and change
- g77 accordingly).
-
-Thu Aug 17 08:46:17 1995 Craig Burley (burley@gnu.ai.mit.edu)
-
- * libI77/rsne.c (s_rsne): Call f_init if not already done.
-
-Thu Aug 17 04:35:28 1995 Craig Burley (burley@gnu.ai.mit.edu)
-
- * Incorporate changes by Bellcore to libf2c through 950817.
- And this text is for EMACS: (foo at bar).
-
-Wed Aug 16 17:33:06 1995 Craig Burley (burley@gnu.ai.mit.edu)
-
- * libF77/Makefile.in, libI77/Makefile.in (CFLAGS): Put -g1
- after configured CFLAGS but before GCC_CFLAGS, so by default
- the libraries are built with minimal debugging information.
-
-Fri Jul 28 10:30:15 1995 Dave Love <d.love@dl.ac.uk>
-
- * libI77/open.c (f_open): Call f_init if not already done.
-
-Sat Jul 1 19:31:56 1995 Craig Burley (burley@gnu.ai.mit.edu)
-
- * libF77/system_.c (system_): Make buff one byte bigger so
- following byte doesn't get overwritten by call with large
- string.
-
-Tue Jun 27 23:28:16 1995 Craig Burley (burley@gnu.ai.mit.edu)
-
- * Incorporate changes by Bellcore to libf2c through 950613.
-
- * libF77/Version.c (__G77_LIBF77_VERSION__): Add this string
- to track g77 mods to libf2c.
-
- * libI77/Version.c (__G77_LIBI77_VERSION__): Add this string
- to track g77 mods to libf2c.
-
- * libI77/rawio.h: #include <rawio.h> only conditionally,
- using macro intended for that purpose.
-
-Fri May 19 11:20:00 1995 Craig Burley (burley@gnu.ai.mit.edu)
-
- * configure.in: Incorporate change made by d.love,
-
- * configure: Regenerated.
-
-Wed Apr 26 21:08:57 BST 1995 Dave Love <d.love@dl.ac.uk>
-
- * configure.in: Fix quoting problem in atexit check.
-
- * configure: Regenerated (with current autoconf).
-
-Wed Mar 15 12:49:58 1995 Craig Burley (burley@gnu.ai.mit.edu)
-
- * Incorporate changes by Bellcore to libf2c through 950315.
-
-Sun Mar 5 18:54:29 1995 Craig Burley (burley@gnu.ai.mit.edu)
-
- * README: Tell people not to read lib[fi]77/README.
-
-Wed Feb 15 14:30:58 1995 Craig Burley (burley@gnu.ai.mit.edu)
-
- * configure.in: Update copyright notice at top of file.
-
- * f2c.h.in (f2c_i2): Make sure defining this crashes compilations.
-
- * libI77/Makefile.in (F2C_H): Fix typo in definition of this
- symbol (was FF2C_H=...).
-
-Sun Feb 12 13:39:36 1995 Craig Burley (burley@gnu.ai.mit.edu)
-
- * README: Remove some obsolete items.
- Add date.
-
- * TODO: Add date.
-
-Sat Feb 11 22:07:54 1995 Craig Burley (burley@gnu.ai.mit.edu)
-
- * Makefile.in (libf77, libi77): Add rules to .PHONY list.
-
- * f2c.h.in (flag): Make same type as friends.
-
- * libF77/Makefile.in (libf77): Rename to $(lib), remove from
- .PHONY list. Fix some typos.
-
- * libI77/Makefile.in (libi77): Rename to $(lib), remove from
- .PHONY list. Fix some typos.
-
-Thu Feb 2 12:22:41 1995 Craig Burley (burley@gnu.ai.mit.edu)
-
- * Makefile.in (libF77/Makefile): Fix typos in this rule's name
- and dependencies.
-
- * libF77/Makefile.in (libf77): Add rule to .PHONY list.
-
- * libI77/Makefile.in (libi77): Add rule to .PHONY list.
-
-Local Variables:
-add-log-time-format: current-time-string
-End:
diff --git a/contrib/libf2c/ChangeLog.egcs b/contrib/libf2c/ChangeLog.egcs
deleted file mode 100644
index e0802612e68b..000000000000
--- a/contrib/libf2c/ChangeLog.egcs
+++ /dev/null
@@ -1,200 +0,0 @@
-Thu Jul 16 00:58:52 1998 Jeffrey A Law (law@cygnus.com)
-
- * libU77/Makefile.in: Missed one config.h.in -> config.hin change.
-
- * g2c.hin: Renamed from g2c.h.in.
- * Makefile.in, configure.in: Changed as needed.
- * configure: Rebuilt.
-
- * libU77/config.hin: Renamed from libU77/config.h.in.
- * Makefile.in, configure.in: Changed as needed.
- * configure: Rebuilt.
-
-Tue Jul 14 21:35:30 1998 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
-
- * Makefile.in (all): Invoke $(MAKE) instead of just make.
-
-Tue Jul 14 02:16:34 1998 Jeffrey A Law (law@cygnus.com)
-
- * Makefile.in: stamp-lib* -> s-lib*.
- * libU77/Makefile.in: Likewise.
- * libF77/Makefile.in: Likewise.
- * libI77/Makefile.in: Likewise.
-
- * libU77/Makefile.in (ALL_CFLAGS): Add -I$(F2C_H_DIR).
-
-1998-07-06 Mike Stump <mrs@wrs.com>
-
- * Makefile.in (clean): Don't remove Makefiles, that is done in
- distclean.
-
-Sat Jun 27 23:04:49 1998 Jeffrey A Law (law@cygnus.com)
-
- * Makefile.in (FLAGS_TO_PASS, case G2C_H_DIR): Use $(TARGET_SUBDIR)
- instead of hardcoding "libraries".
-
-1998-06-26 Manfred Hollstein <manfred@s-direktnet.de>
-
- * Makefile.in (gcc_version_trigger): Add new macro.
- (config.status): Add dependency upon $(gcc_version_trigger).
-
- * configure.in (gcc_version_trigger): New variable; initialize
- using value from toplevel configure; add AC_SUBST for it.
- (gcc_version): Change initialization to use this new variable.
- * configure: Regenerate.
-
-1998-06-24 Manfred Hollstein <manfred@s-direktnet.de>
-
- * Makefile.in (version): Rename to gcc_version.
- * configure.in (version): Likewise.
- (gcc_version): Add code to use an option passed from parent configure.
- * configure: Regenerate.
-
-1998-06-21 Dave Love <d.love@dl.ac.uk>
-
- * configure.in (version, target_alias): Define.
-
- * Makefile.in (version, target_alias, libsubdir): Define.
- (install): Remove check for libsubdir.
-
-Mon Apr 27 22:52:31 1998 Richard Henderson <rth@cygnus.com>
-
- * libU77/ltime_.c: Bounce the ftnint argument through a local time_t.
- * libU77/gmtime_.c: Likewise.
-
-Sun Apr 26 18:07:56 1998 Richard Henderson <rth@cygnus.com>
-
- * configure.in: Adjust include paths in F2C_INTEGER and F2C_LONGINT
- tests to work out of the build directory.
-
-1998-02-17 Dave Love <d.love@dl.ac.uk>
-
- * libU77/u77-test.f: Tweak some o/p.
-
- * libU77/Makefile.in (check): Use -L for new directory structure.
-
- * Makefile.in (check): Run the u77 check.
- (config.status, Makefile): New targets.
-
-Wed Feb 11 01:46:20 1998 Manfred Hollstein <manfred@s-direktnet.de>
-
- * Makefile.in ($(lib)): Call $(AR) repeatedly to avoid overflowing
- argument size limit on ancious System V.
-
-Sun Feb 8 00:32:17 1998 Manfred Hollstein <manfred@s-direktnet.de>
-
- * Makefile.in: Add `info install-info clean-info check dvi' targets.
-
-Mon Feb 2 11:08:49 1998 Richard Henderson <rth@cygnus.com>
-
- * configure.in: Update F2C_INTEGER and F2C_LONGINT tests
- for the new placement in the hierarchy.
-
-Sun Feb 1 02:36:33 1998 Richard Henderson <rth@cygnus.com>
-
- * Previous contents of gcc/f/runtime moved into toplevel
- "libf2c" directory.
-
-Sun Feb 1 01:42:47 1998 Mumit Khan <khan@xraylith.wisc.edu>
-
- * libU77/configure.in (getlogin,getgid,getuid, kill,link,ttyname):
- Check.
- * libU77/config.h.in (HAVE_GETLOGIN, HAVE_GETGID, HAVE_GETUID,
- HAVE_KILL, HAVE_LINK, HAVE_TTYNAME): New defs.
- * libU77/getlog_.c: Conditionalize for target platform. Set errno
- to ENOSYS if target libc doesn't have the function.
- * libU77/getgid_.c: Likewise.
- * libU77/getuid_.c: Likewise.
- * libU77/kill_.c: Likewise.
- * libU77/link_.c: Likewise.
- * libU77/ttynam_.c: Likewise.
-
-Sun Jan 18 20:01:37 1998 Toon Moene <toon@moene.indiv.nluug.nl>
-
- * libI77/backspace.c: (f_back): Use type `uiolen' to determine size
- of record length specifier.
-
-Sat Jan 17 22:40:31 1998 Mumit Khan <khan@xraylith.wisc.edu>
-
- * libU77/configure.in (sys/param.h,sys/times.h): Check.
- (times,alarm): Likewise.
- * libU77/config.h.in (HAVE_SYS_PARAM_H, HAVE_SYS_TIMES_H,
- HAVE_ALARM, HAVE_TIMES): New defs.
- * libU77/alarm_.c: Conditionalize for target platform. Set errno
- to ENOSYS if target libc doesn't have the function.
- * libU77/dtime_.c: Likewise.
- * libU77/etime_.c: Likewise.
- * libU77/sys_clock_.c: Likewise.
-
- * configure.in (NON_UNIX_STDIO): Define if MINGW32.
- (NON_ANSI_RW_MODE): Do not define for CYGWIN32 or MINGW32.
-
- * libI77/rawio.h: Don't providing conflicting declarations for
- read() and write(). MINGW32 header files use "const" quals.
-
- * libF77/s_paus.c: _WIN32 does not have pause().
-
-Tue Nov 18 09:49:04 1997 Mumit Khan (khan@xraylith.wisc.edu)
-
- * libI77/close.c (f_exit): Reset f__init so that f_clos does not
- (incorrectly) think there is an I/O recursion when program is
- interrupted.
-
-Sat Nov 1 18:03:42 1997 Jeffrey A Law (law@cygnus.com)
-
- * libF77/signal_.c: Undo last change until we can fix it right.
-
-Wed Oct 15 10:06:29 1997 Richard Henderson <rth@cygnus.com>
-
- * libF77/signal_.c (G77_signal_0): Make return type sig_pf as well.
- * libI77/fio.h: Include <string.h> if STDC_HEADERS.
- * libU77/chmod_.c: Likewise.
-
-Tue Oct 7 18:22:10 1997 Richard Henderson <rth@cygnus.com>
-
- * Makefile.in (CGFLAGS): Don't force -g0.
- * libF77/Makefile.in, libI77/Makefile.in, libU77/Makefile.in: Likewise.
-
-Mon Oct 6 14:16:46 1997 Jeffrey A Law (law@cygnus.com)
-
- * Makefile.in (distclean): Do a better job at cleaning up.
-
-Wed Oct 1 01:46:16 1997 Philippe De Muyter <phdm@info.ucl.ac.be>
-
- * libU77/sys_clock_.c: File renamed from system_clock_.c.
- * libU77/Makefile.in, Makefile.in : Reference sys_clock_.*, not
- system_clock_.*.
- * libU77/dtime_.c (clk_tck): Try also HZ macro.
- * libU77/access.c (G77_access_0): Check malloc return value against 0,
- not NULL.
- * libU77/getlog_.c, libU77/ttynam_.c, libU77/chdir_.c: Ditto.
- * libU77/chmod_.c, libU77/rename_.c: Ditto.
-
-1997-09-19 Dave Love <d.love@dl.ac.uk>
-
- * libU77/dtime_.c (G77_dtime_0): Fix types in HAVE_GETRUSAGE case
- so as not to truncate results to integer values.
- * libU77/Version.c: Bump.
-
-Thu Sep 18 16:58:46 1997 Jeffrey A Law (law@cygnus.com)
-
- * Makefile.in (stamp-lib): Don't use '$?', explicitly
- list the variables containing the object files to include
- in libf2c.a
-
-Fri Sep 5 00:18:17 1997 Jeffrey A Law (law@cygnus.com)
-
- * Makefile.in (clean): Don't remove config.cache.
- (distclean): Do it here instead.
-
-Tue Aug 26 20:14:08 1997 Robert Lipe (robertl@dgii.com)
-
- * hostnm_.c: Include errno.h
-
-Mon Aug 25 23:26:05 1997 H.J. Lu (hjl@gnu.ai.mit.edu)
-
- * Makefile.in (mostlyclean, clean): Check if Makefile exists
- before using it. Remove stamp-*.
- (stamp-libi77, stamp-libf77, stamp-libu77): New.
- (stamp-lib): Only depend on stamp-libi77 stamp-libf77
- stamp-libu77
diff --git a/contrib/libf2c/Makefile.in b/contrib/libf2c/Makefile.in
deleted file mode 100644
index 9075360fe9bb..000000000000
--- a/contrib/libf2c/Makefile.in
+++ /dev/null
@@ -1,262 +0,0 @@
-# Makefile for GNU F77 compiler runtime.
-# Copyright (C) 1995-1998 Free Software Foundation, Inc.
-# Contributed by Dave Love (d.love@dl.ac.uk).
-#
-#This file is part of GNU Fortran.
-#
-#GNU Fortran 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.
-#
-#GNU Fortran is distributed in the hope that it will be useful,
-#but WITHOUT ANY WARRANTY; without even the implied warranty of
-#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-#GNU General Public License for more details.
-#
-#You should have received a copy of the GNU General Public License
-#along with GNU Fortran; see the file COPYING. If not, write to
-#the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-#02111-1307, USA.
-
-SHELL = /bin/sh
-
-#### Start of system configuration section. ####
-
-srcdir = @srcdir@
-VPATH = @srcdir@
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-target_alias = @target_alias@
-gcc_version = @gcc_version@
-gcc_version_trigger = @gcc_version_trigger@
-
-libdir = $(exec_prefix)/lib
-libsubdir = $(libdir)/gcc-lib/$(target_alias)/$(gcc_version)
-
-# Multilib support variables.
-MULTISRCTOP =
-MULTIBUILDTOP =
-MULTIDIRS =
-MULTISUBDIR =
-MULTIDO = true
-MULTICLEAN = true
-
-# Not configured per top-level version, since that doesn't get passed
-# down at configure time, but overrridden by the top-level install
-# target.
-INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_DATA = @INSTALL_DATA@
-
-AR = @AR@
-AR_FLAGS = rc
-
-RANLIB = @RANLIB@
-
-CC = @CC@
-CFLAGS = @CFLAGS@
-
-# List of variables to pass to sub-makes.
-# Quote this way so that it can be used to set shell variables too.
-# Currently no use for PICFLAG, RUNTESTFLAGS -- check usage.
-FLAGS_TO_PASS= \
- CC='$(CC)' \
- CFLAGS='$(CFLAGS)' \
- CPPFLAGS='$(CPPFLAGS)' \
- AR='$(AR)' \
- RANLIB='$(RANLIB)' \
- PICFLAG='$(PICFLAG)' \
- RUNTESTFLAGS='$(RUNTESTFLAGS)' \
- prefix='$(prefix)' \
- exec_prefix='$(exec_prefix)' \
- libdir='$(libdir)' \
- libsubdir='$(libsubdir)' \
- tooldir='$(tooldir)'
-
-LIBG2C = libg2c.a
-
-SUBDIRS = libI77 libF77 libU77
-
-F2CEXT = abort derf derfc ef1asc ef1cmc erf erfc exit getarg getenv iargc \
- signal system flush ftell fseek access besj0 besj1 besjn besy0 besy1 \
- besyn chdir chmod ctime dbesj0 dbesj1 dbesjn dbesy0 dbesy1 dbesyn \
- dtime etime fdate fgetc fget flush1 fnum fputc fput fstat gerror \
- getcwd getgid getlog getpid getuid gmtime hostnm idate ierrno irand \
- isatty itime kill link lnblnk lstat ltime mclock perror rand rename \
- secnds second sleep srand stat symlnk time ttynam umask unlink \
- vxttim alarm \
- date_y2kbuggy date_y2kbug vxtidt_y2kbuggy vxtidt_y2kbug
-
-.SUFFIXES:
-
-# The logic here is partly dictated by the desire to keep the lib?77
-# subdirs for compatibility with the Netlib version and because libU77
-# has a different copyright; then the libe77 bit (EXTERNALly-callable
-# versions) is funny. Given that, as well as keeping things as simple
-# as possible we want (at least) the following:
-# * Allow make to be run at the top level (all-target-libf2c), at this
-# level, or the subdirs of this level. In the latter case we only
-# compile, rather than updating libg2c.a;
-# * A robust set of dependencies, so that we rebuild (as little as
-# possible) if a configuration file, g2c.h or any lib?77/*.c file
-# changes;
-# * Avoid unnecessary running of ar and ranlib;
-# * Expose parallelism where reasonable, but not as a priority.
-
-# The intended top-level target here does a non-multilib build (via
-# the dependency) and then (perhaps) builds multilibs.
-
-all: all-unilib
- $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO="all-unilib"
-
-# `all-unilib' is the overall target in the absence of multilibs,
-# meant to be invoked via multi-do for multilibs.
-
-# Its dependencies can be satisfied in parallel. The [fiu]77 targets
-# update stamp files (see the subdir makefiles) which the $(LIBG2C)
-# target checks in the sub make to decide whether to run ar/ranlib.
-# (Probably only one stamp file is really needed.) The stamp files
-# s-lib[fiu]77 are intentionally not targets, since we're only meant
-# to come in at the level of this target. The [fiu]77 targets always
-# invoke sub makes to check dependencies in the subdirs, else we'd
-# have to maintain them at this level; we live with the overhead of
-# some recursive makes which may do nothing.
-
-all-unilib: i77 f77 u77 s-libe77
- $(MAKE) $(FLAGS_TO_PASS) $(LIBG2C)
-
-i77 f77 u77: g2c.h
-
-# This target should normally only get invoked via `all-unilib' --
-# after all's well in the subdirs -- actually to assemble the library.
-# The stamp file dependencies are just to check whether libg2c.a is
-# up-to-date (to avoid running ar regardless) -- the files should
-# always have been created by a successful `all-unilib'.
-
-$(LIBG2C): s-libi77 s-libf77 s-libu77 s-libe77
- rm -f $(LIBG2C)
- set -e; \
- for i in $(SUBDIRS); \
- do (cd $$i && $(MAKE) $(FLAGS_TO_PASS) LIBG2C=../$(LIBG2C) archive); \
- done
- objs=""; for i in $(F2CEXT); do objs="$$objs libE77/L$$i.o"; done; \
- $(AR) $(AR_FLAGS) $(LIBG2C) $$objs
- $(RANLIB) $(LIBG2C)
-
-i77:
- cd libI77; $(MAKE) $(FLAGS_TO_PASS) all
-
-f77:
- cd libF77; $(MAKE) $(FLAGS_TO_PASS) all
-
-u77:
- cd libU77; $(MAKE) $(FLAGS_TO_PASS) all
-
-s-libe77: f2cext.c
- if [ -d libE77 ]; then rm -f libE77/*.o; else mkdir libE77; fi
- for name in $(F2CEXT); \
- do \
- echo $${name}; \
- $(CC) -c -I. -I$(srcdir) -I../../include $(CPPFLAGS) $(CFLAGS) \
- -DL$${name} $(srcdir)/f2cext.c \
- -o libE77/L$${name}.o; \
- if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
- done
- echo timestamp >s-libe77
-
-f2cext.c: g2c.h
-
-${srcdir}/configure: configure.in
- rm -f config.cache
- cd $(srcdir) && autoconf
-
-# Dependence on Makefile serializes for parallel make.
-g2c.h: g2c.hin config.status Makefile
-# Might try to avoid rebuilding everything if Makefile or configure
-# changes and g2c.h doesn't; see also the Makefile rule. Should
-# depend on another stamp file rather than using the commented-out
-# lines below, since g2c.h isn't necessarily brought up to date.
-# mv g2c.h g2c.x
- $(SHELL) config.status
-# $(SHELL) $(srcdir)/../move-if-change g2c.h g2c.x && mv g2c.x g2c.h
-
-Makefile: Makefile.in config.status
-# Autoconf doc uses `./config.status'. Is there a good reason to use $(SHELL)?
- $(SHELL) config.status
-
-config.status: configure $(gcc_version_trigger)
-# Make sure we don't pick up a site config file and that configure
-# gets run with correct values of variables such as CC.
- CONFIG_SITE=no-such-file $(FLAGS_TO_PASS) \
- $(SHELL) config.status --recheck
-
-info install-info clean-info dvi TAGS dist installcheck installdirs:
-
-check:
- cd libU77; $(MAKE) G77DIR=../../../gcc/ check
-
-install: all
- $(INSTALL_DATA) $(LIBG2C) $(libsubdir)/$(MULTISUBDIR)/$(LIBG2C).n
- ( cd $(libsubdir)/$(MULTISUBDIR) ; $(RANLIB) $(LIBG2C).n )
- mv -f $(libsubdir)/$(MULTISUBDIR)/$(LIBG2C).n $(libsubdir)/$(MULTISUBDIR)/$(LIBG2C)
- $(INSTALL_DATA) g2c.h $(libsubdir)/include/g2c.h
- @if [ -f f2c-install-ok -o -f $(srcdir)/f2c-install-ok ]; then \
- echo ''; \
- echo 'Warning: g77 no longer installs libf2c.a or f2c.h.'; \
- echo ' You must do so yourself. For more information,'; \
- echo ' read "Distributing Binaries" in the g77 docs.'; \
- echo ' (To turn off this warning, delete the file'; \
- echo ' f2c-install-ok in the source or build directory.)'; \
- echo ''; \
- else true; fi
- $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO="$@"
-
-install-strip:
- $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' install
-
-uninstall:
- rm -f $(libsubdir)/$(MULTISUBDIR)/include/g2c.h $(libsubdir)/$(MULTISUBDIR)/$(LIBG2C)
- $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO="$@"
-
-mostlyclean:
- rm -f $(LIBG2C)
- $(MAKE) DO=$@ DODIRS="$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do; \
- $(MULTICLEAN) multi-clean DO=$@
- rm -fr libE77 s-libe77
-
-clean: mostlyclean
- rm -f config.log
- $(MAKE) DO=$@ DODIRS="$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do; \
- $(MULTICLEAN) multi-clean DO=$@
-
-distclean: clean
- rm -f g2c.h s-libe77
- $(MAKE) DO=$@ DODIRS="$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do; \
- $(MULTICLEAN) multi-clean DO=distclean
- rm -f config.cache config.status Makefile
-
-maintainer-clean:
-
-rebuilt: configure
-
-.PHONY: rebuilt mostlyclean clean distclean maintainer-clean all \
- i77 f77 u77 check uninstall install-strip dist \
- installcheck installdirs all-unilib
-
-subdir_do:
- @rootpre=`pwd`/; export rootpre; \
- srcrootpre=`cd $(srcdir); pwd`/; export srcrootpre; \
- for i in .. $(DODIRS); do \
- if [ x$$i != x.. ]; then \
- if [ -f ./$$i/Makefile ]; then \
- if (cd ./$$i; $(MAKE) $(FLAGS_TO_PASS) $(DO)); then \
- true; \
- else \
- exit 1; \
- fi; \
- else true; fi; \
- else true; fi; \
- done
-
-# multidoings may be added here by configure.
diff --git a/contrib/libf2c/README b/contrib/libf2c/README
deleted file mode 100644
index 008654b3c775..000000000000
--- a/contrib/libf2c/README
+++ /dev/null
@@ -1,109 +0,0 @@
-1998-08-11
-
-This directory contains the libf2c library packaged for use with g77
-to configure and build automatically (in principle!) as part of the
-top-level configure and make steps. g77 names this library `libg2c'
-to avoid conflicts with existing copies of `libf2c' on a system.
-
-Some small changes have been made vis-a-vis the netlib distribution of
-libf2c, which comes from <ftp:bell-labs.com/netlib/f2c/> and is maintained
-(excellently) by David M. Gay <dmg@bell-labs.com>. See the Notice files
-for copyright information. We usually try to get g77-specific changes
-rolled back into the libf2c distribution.
-
-Files that come directly from netlib are either maintained in the
-libf2c directory under their original names or, if they are not pertinent
-for g77's version of libf2c, under their original names with `.netlib'
-appended. For example, permissions.netlib is a copy of f2c's top-level
-`permissions' file in the netlib distribution. In this case, it applies
-only to the relevant portions of the libF77/ and libI77/ directories; it
-does not apply to the libU77/ directory, which is distributed under
-different licensing arrangements. Similarly, the `makefile.netlib' files
-in the libF77/ and libI77/ subdirectories are copies of the respective
-`makefile' files in the netlib distribution, but are not used when
-building g77's version of libf2c.
-
-The README.netlib files in libF77/ and libI77/ thus might be
-interesting, but should not be taken as guidelines for how to
-configure and build libf2c in g77's distribution.
-
-* Read permissions.netlib for licensing conditions that apply to
- distributing programs containing portions of code in the libF77/ and
- libI77/ subdirectories. Also read disclaimer.netlib.
-
-* Read libU77/COPYING.LIB for licensing conditions that apply to
- distributing programs containing portions of code in the libU77/
- subdirectory.
-
-Among the user-visible changes (choices) g77 makes in its version of libf2c:
-
-- f2c.h configured to default to padding unformatted direct reads
- (#define Pad_UDread), because that's the behavior most users
- expect.
-
-- f2c.h configured to default to outputting leading zeros before
- decimal points in formatted and list-directed output, to be compatible
- with many other compilers (#define WANT_LEAD_0). Either way is
- standard-conforming, however, and you should try to avoid writing
- code that assumes one format or another.
-
-- dtime_() and etime_() are from Dave Love's libU77, not from
- netlib's libF77.
-
-- Routines that are intended to be called directly via user code
- (as in `CALL EXIT', but not the support routines for `OPEN')
- have been renamed from `<name>' to `G77_<name>_0'. This, in
- combination with g77 recognizing these names as intrinsics and
- calling them directly by those names, reduces the likelihood of
- interface mismatches occurring due to use of compiler options
- that change code generation, and permits use of these names as
- both intrinsics and user-supplied routines in applications (as
- required by the Fortran standards). f2cext.c contains "jacket"
- routines named `<name>' that call `G77_<name>_0', to support
- code that relies on calling the relevant routines as `EXTERNAL'
- routines.
-
- Note that the `_0' in the name denotes version 0 of the *interface*,
- not the *implementation*, of a routine. The interface of a
- given routine *must not change* -- instead, introduce a new copy
- of the code, with an increment (e.g. `_1') suffix, having the
- new interface. Whether the previous interface is maintained is
- not as important as ensuring the routine implementing the new
- interface is never successfully linked to a call in existing,
- e.g. previously compiled, code that expects the old interface.
-
-- Version.c in the subdirectories contains g77-specific version
- information and a routine (per subdirectory) to print both the
- netlib and g77 version information when called. The `g77 -v'
- command is designed to trigger this, by compiling, linking, and
- running a small program that calls the routines in sequence.
-
-- libF77/main.c no longer contains the actual code to copy the
- argc and argv values into globals or to set up the signal-handling
- environment. These have been removed to libF77/setarg.c and
- libF77/setsig.c, respectively. libF77/main.c contains procedure
- calls to the new code in place of the code itself. This should
- simplify linking executables with a main() function other than
- that in libF77/main.c (such as one written by the user in C or
- C++). See the g77 documentation for more information.
-
-- Complex-arithmetic support routines in libF77/ take a different approach
- to avoiding problems resulting from aliased input and output arguments,
- which should avoid particularly unusual alias problems that netlib
- libf2c might suffer from.
-
-- libF77/signal_.c supports systems with 64-bit pointers and 32-bit
- integers.
-
-- I/O routines in libI77/ have code to detect attempts to do recursive
- I/O more "directly", mainly to lead to a clearer diagnostic than
- typically occurs under such conditions.
-
-- Formatted-I/O routines in libI77/ have code to pretty-print a FORMAT
- string when printing a fatal diagnostic involving formatted I/O.
-
-- libI77/open.c supports a more robust, perhaps more secure, method
- of naming temporary files on some systems.
-
-- Some g77-specific handling of building under Microsoft operating
- systems exists, mainly in libI77/.
diff --git a/contrib/libf2c/TODO b/contrib/libf2c/TODO
deleted file mode 100644
index 84cbb0c733dd..000000000000
--- a/contrib/libf2c/TODO
+++ /dev/null
@@ -1,14 +0,0 @@
-980709
-
-TODO list for the g77 library
-
-* Investigate building shared libraries on systems we know about
- (probably using libtool).
-
-* Better test cases.
-
-* Allow the library to be stripped to save space. (The install-strip
- makefile target now allows this, should it be easily invocable.)
-
-* An interface to IEEE maths functions from libc where this makes
- sense.
diff --git a/contrib/libf2c/changes.netlib b/contrib/libf2c/changes.netlib
deleted file mode 100644
index 4ec0e7f58253..000000000000
--- a/contrib/libf2c/changes.netlib
+++ /dev/null
@@ -1,3026 +0,0 @@
-31 Aug. 1989:
- 1. A(min(i,j)) now is translated correctly (where A is an array).
- 2. 7 and 8 character variable names are allowed (but elicit a
- complaint under -ext).
- 3. LOGICAL*1 is treated as LOGICAL, with just one error message
- per LOGICAL*1 statement (rather than one per variable declared
- in that statement). [Note that LOGICAL*1 is not in Fortran 77.]
- Like f77, f2c now allows the format in a read or write statement
- to be an integer array.
-
-5 Sept. 1989:
- Fixed botch in argument passing of substrings of equivalenced
-variables.
-
-15 Sept. 1989:
- Warn about incorrect code generated when a character-valued
-function is not declared external and is passed as a parameter
-(in violation of the Fortran 77 standard) before it is invoked.
-Example:
-
- subroutine foo(a,b)
- character*10 a,b
- call goo(a,b)
- b = a(3)
- end
-
-18 Sept. 1989:
- Complain about overlapping initializations.
-
-20 Sept. 1989:
- Warn about names declared EXTERNAL but never referenced;
-include such names as externs in the generated C (even
-though most C compilers will discard them).
-
-24 Sept. 1989:
- New option -w8 to suppress complaint when COMMON or EQUIVALENCE
-forces word alignment of a double.
- Under -A (for ANSI C), ensure that floating constants (terminated
-by 'f') contain either a decimal point or an exponent field.
- Repair bugs sometimes encountered with CHAR and ICHAR intrinsic
-functions.
- Restore f77's optimizations for copying and comparing character
-strings of length 1.
- Always assume floating-point valued routines in libF77 return
-doubles, even under -R.
- Repair occasional omission of arguments in routines having multiple
-entry points.
- Repair bugs in computing offsets of character strings involved
-in EQUIVALENCE.
- Don't omit structure qualification when COMMON variables are used
-as FORMATs or internal files.
-
-2 Oct. 1989:
- Warn about variables that appear only in data stmts; don't emit them.
- Fix bugs in character DATA for noncharacter variables
-involved in EQUIVALENCE.
- Treat noncharacter variables initialized (at least partly) with
-character data as though they were equivalenced -- put out a struct
-and #define the variables. This eliminates the hideous and nonportable
-numeric values that were used to initialize such variables.
- Treat IMPLICIT NONE as IMPLICIT UNDEFINED(A-Z) .
- Quit when given invalid options.
-
-8 Oct. 1989:
- Modified naming scheme for generated intermediate variables;
-more are recycled, fewer distinct ones used.
- New option -W nn specifies nn characters/word for Hollerith
-data initializing non-character variables.
- Bug fix: x(i:min(i+10,j)) used to elicit "Can't handle opcode 31 yet".
- Integer expressions of the form (i+const1) - (i+const2), where
-i is a scalar integer variable, are now simplified to (const1-const2);
-this leads to simpler translation of some substring expressions.
- Initialize uninitialized portions of character string arrays to 0
-rather than to blanks.
-
-9 Oct. 1989:
- New option -c to insert comments showing original Fortran source.
- New option -g to insert line numbers of original Fortran source.
-
-10 Oct. 1989:
- ! recognized as in-line comment delimiter (a la Fortran 88).
-
-24 Oct. 1989:
- New options to ease coping with systems that want the structs
-that result from COMMON blocks to be defined just once:
- -E causes uninitialized COMMON blocks to be declared Extern;
-if Extern is undefined, f2c.h #defines it to be extern.
- -ec causes a separate .c file to be emitted for each
-uninitialized COMMON block: COMMON /ABC/ yields abc_com.c;
-thus one can compile *_com.c into a library to ensure
-precisely one definition.
- -e1c is similar to -ec, except that everything goes into
-one file, along with comments that give a sed script for
-splitting the file into the pieces that -ec would give.
-This is for use with netlib's "execute f2c" service (for which
--ec is coerced into -e1c, and the sed script will put everything
-but the COMMON definitions into f2c_out.c ).
-
-28 Oct. 1989:
- Convert "i = i op ..." into "i op= ...;" even when i is a
-dummy argument.
-
-13 Nov. 1989:
- Name integer constants (passed as arguments) c__... rather
-than c_... so
- common /c/stuff
- call foo(1)
- ...
-is translated correctly.
-
-19 Nov. 1989:
- Floating-point constants are now kept as strings unless they
-are involved in constant expressions that get simplified. The
-floating-point constants kept as strings can have arbitrarily
-many significant figures and a very large exponent field (as
-large as long int allows on the machine on which f2c runs).
-Thus, for example, the body of
-
- subroutine zot(x)
- double precision x(6), pi
- parameter (pi=3.1415926535897932384626433832795028841972)
- x(1) = pi
- x(2) = pi+1
- x(3) = 9287349823749272.7429874923740978492734D-298374
- x(4) = .89
- x(5) = 4.0005
- x(6) = 10D7
- end
-
-now gets translated into
-
- x[1] = 3.1415926535897932384626433832795028841972;
- x[2] = 4.1415926535897931;
- x[3] = 9.2873498237492727429874923740978492734e-298359;
- x[4] = (float).89;
- x[5] = (float)4.0005;
- x[6] = 1e8;
-
-rather than the former
-
- x[1] = 3.1415926535897931;
- x[2] = 4.1415926535897931;
- x[3] = 0.;
- x[4] = (float)0.89000000000000003;
- x[5] = (float)4.0004999999999997;
- x[6] = 100000000.;
-
- Recognition of f77 machine-constant intrinsics deleted, i.e.,
-epbase, epprec, epemin, epemax, eptiny, ephuge, epmrsp.
-
-22 Nov. 1989:
- Workarounds for glitches on some Sun systems...
- libf77: libF77/makefile modified to point out possible need
-to compile libF77/main.c with -Donexit=on_exit .
- libi77: libI77/wref.c (and libI77/README) modified so non-ANSI
-systems can compile with USE_STRLEN defined, which will cause
- sprintf(b = buf, "%#.*f", d, x);
- n = strlen(b) + d1;
-rather than
- n = sprintf(b = buf, "%#.*f", d, x) + d1;
-to be compiled.
-
-26 Nov. 1989:
- Longer names are now accepted (up to 50 characters); names may
-contain underscores (in which case they will have two underscores
-appended, to avoid clashes with library names).
-
-28 Nov. 1989:
- libi77 updated:
- 1. Allow 3 (or, on Crays, 4) digit exponents under format Ew.d .
- 2. Try to get things right on machines where ints have 16 bits.
-
-29 Nov. 1989:
- Supplied missing semicolon in parameterless subroutines that
-have multiple entry points (all of them parameterless).
-
-30 Nov. 1989:
- libf77 and libi77 revised to use types from f2c.h.
- f2c now types floating-point valued C library routines as "double"
-rather than "doublereal" (for use with nonstandard C compilers for
-which "double" is IEEE double extended).
-
-1 Dec. 1989:
- f2c.h updated to eliminate #defines rendered unnecessary (and,
-indeed, dangerous) by change of 26 Nov. to long names possibly
-containing underscores.
- libi77 further revised: yesterday's change omitted two tweaks to fmt.h
-(tweaks which only matter if float and real or double and doublereal are
-different types).
-
-2 Dec. 1989:
- Better error message (than "bad tag") for NAMELIST, which no longer
-inhibits C output.
-
-4 Dec. 1989:
- Allow capital letters in hex constants (f77 extension; e.g.,
-x'a012BCd', X'A012BCD' and x'a012bcd' are all treated as the integer
-167848909).
- libi77 further revised: lio.c lio.h lread.c wref.c wrtfmt.c tweaked
-again to allow float and real or double and doublereal to be different.
-
-6 Dec. 1989:
- Revised f2c.h -- required for the following...
- Simpler looking translations for abs, min, max, using #defines in
-revised f2c.h .
- libi77: more corrections to types; additions for NAMELIST.
- Corrected casts in some I/O calls.
- Translation of NAMELIST; libi77 must still be revised. Currently
-libi77 gives you a run-time error message if you attempt NAMELIST I/O.
-
-7 Dec. 1989:
- Fixed bug that prevented local integer variables that appear in DATA
-stmts from being ASSIGNed statement labels.
- Fillers (for DATA statements initializing EQUIVALENCEd variables and
-variables in COMMON) typed integer rather than doublereal (for slightly
-more portability, e.g. to Crays).
- libi77: missing return values supplied in a few places; some tests
-reordered for better working on the Cray.
- libf77: better accuracy for complex divide, complex square root,
-real mod function (casts to double; double temporaries).
-
-9 Dec. 1989:
- Fixed bug that caused needless (albeit harmless) empty lines to be
-inserted in the C output when a comment line contained trailing blanks.
- Further tweak to type of fillers: allow doublereal fillers if the
-struct has doublereal data.
-
-11 Dec. 1989:
- Alteration of rule for producing external (C) names from names that
-contain underscores. Now the external name is always obtained by
-appending a pair of underscores.
-
-12 Dec. 1989:
- C production inhibited after most errors.
-
-15 Dec. 1989:
- Fixed bug in headers for subroutines having two or more character
-strings arguments: the length arguments were reversed.
-
-19 Dec. 1989:
- f2c.h libf77 libi77: adjusted so #undefs in f2c.h should not foil
-compilation of libF77 and libI77.
- libf77: getenv_ adjusted to work with unsorted environments.
- libi77: the iostat= specifier should now work right with internal I/O.
-
-20 Dec. 1989:
- f2c bugs fixed: In the absence of an err= specifier, the iostat=
-specifier was generally set wrong. Character strings containing
-explicit nulls (\0) were truncated at the first null.
- Unlabeled DO loops recognized; must be terminated by ENDDO.
-(Don't ask for CYCLE, EXIT, named DO loops, or DO WHILE.)
-
-29 Dec. 1989:
- Nested unlabeled DO loops now handled properly; new warning for
-extraneous text at end of FORMAT.
-
-30 Dec. 1989:
- Fixed bug in translating dble(real(...)), dble(sngl(...)), and
-dble(float(...)), where ... is either of type double complex or
-is an expression requiring assignment to intermediate variables (e.g.,
-dble(real(foo(x+1))), where foo is a function and x is a variable).
-Regard nonblank label fields on continuation lines as an error.
-
-3 Jan. 1990:
- New option -C++ yields output that should be understood
-by C++ compilers.
-
-6 Jan. 1989:
- -a now excludes variables that appear in a namelist from those
-that it makes automatic. (As before, it also excludes variables
-that appear in a common, data, equivalence, or save statement.)
- The syntactically correct Fortran
- read(*,i) x
- end
-now yields syntactically correct C (even though both the Fortran
-and C are buggy -- no FORMAT has not been ASSIGNed to i).
-
-7 Jan. 1990:
- libi77: routines supporting NAMELIST added. Surrounding quotes
-made optional when no ambiguity arises in a list or namelist READ
-of a character-string value.
-
-9 Jan. 1990:
- f2c.src made available.
-
-16 Jan. 1990:
- New options -P to produce ANSI C or C++ prototypes for procedures
-defined. Change to -A and -C++: f2c tries to infer prototypes for
-invoked procedures unless the new -!P option is given. New warning
-messages for inconsistent calling sequences among procedures within
-a single file. Most of f2c/src is affected.
- f2c.h: typedefs for procedure arguments added; netlib's f2c service
-will insert appropriate typedefs for use with older versions of f2c.h.
-
-17 Jan. 1990:
- f2c/src: defs.h exec.c format.c proc.c putpcc.c version.c xsum0.out
-updated. Castargs and protofile made extern in defs.h; exec.c
-modified so superfluous else clauses are diagnosed; unused variables
-omitted from declarations in format.c proc.c putpcc.c .
-
-21 Jan. 1990:
- No C emitted for procedures declared external but not referenced.
- f2c.h: more new types added for use with -P.
- New feature: f2c accepts as arguments files ending in .p or .P;
-such files are assumed to be prototype files, such as produced by
-the -P option. All prototype files are read before any Fortran files
-and apply globally to all Fortran files. Suitable prototypes help f2c
-warn about calling-sequence errors and can tell f2c how to type
-procedures declared external but not explicitly typed; the latter is
-mainly of interest for users of the -A and -C++ options. (Prototype
-arguments are not available to netlib's "execute f2c" service.)
- New option -it tells f2c to try to infer types of untyped external
-arguments from their use as parameters to prototyped or previously
-defined procedures.
- f2c/src: many minor cleanups; most modules changed. Individual
-files in f2c/src are now in "bundle" format. The former f2c.1 is
-now f2c.1t; "f2c.1t from f2c" and "f2c.1t from f2c/src" are now the
-same, as are "f2c.1 from f2c" and "f2c.1 from f2c/src". People who
-do not obtain a new copy of "all from f2c/src" should at least add
- fclose(sortfp);
-after the call on do_init_data(outfile, sortfp) in format_data.c .
-
-22 Jan. 1990:
- Cleaner man page wording (thanks to Doug McIlroy).
- -it now also applies to all untyped EXTERNAL procedures, not just
-arguments.
-
-23 Jan. 01:34:00 EST 1990:
- Bug fixes: under -A and -C++, incorrect C was generated for
-subroutines having multiple entries but no arguments.
- Under -A -P, subroutines of no arguments were given prototype
-calling sequence () rather than (void).
- Character-valued functions elicited erroneous warning messages
-about inconsistent calling sequences when referenced by another
-procedure in the same file.
- f2c.1t: omit first appearance of libF77.a in FILES section;
-load order of libraries is -lF77 -lI77, not vice versa (bug
-introduced in yesterday's edits); define .F macro for those whose
--man lacks it. (For a while after yesterday's fixes were posted,
-f2c.1t was out of date. Sorry!)
-
-23 Jan. 9:53:24 EST 1990:
- Character substring expressions involving function calls having
-character arguments (including the intrinsic len function) yielded
-incorrect C.
- Procedures defined after invocation (in the same file) with
-conflicting argument types also got an erroneous message about
-the wrong number of arguments.
-
-24 Jan. 11:44:00 EST 1990:
- Bug fixes: -p omitted #undefs; COMMON block names containing
-underscores had their C names incorrectly computed; a COMMON block
-having the name of a previously defined procedure wreaked havoc;
-if all arguments were .P files, f2c tried reading the second as a
-Fortran file.
- New feature: -P emits comments showing COMMON block lengths, so one
-can get warnings of incompatible COMMON block lengths by having f2c
-read .P (or .p) files. Now by running f2c twice, first with -P -!c
-(or -P!c), then with *.P among the arguments, you can be warned of
-inconsistent COMMON usage, and COMMON blocks having inconsistent
-lengths will be given the maximum length. (The latter always did
-happen within each input file; now -P lets you extend this behavior
-across files.)
-
-26 Jan. 16:44:00 EST 1990:
- Option -it made less aggressive: untyped external procedures that
-are invoked are now typed by the rules of Fortran, rather than by
-previous use of procedures to which they are passed as arguments
-before being invoked.
- Option -P now includes information about references, i.e., called
-procedures, in the prototype files (in the form of special comments).
-This allows iterative invocations of f2c to infer more about untyped
-external names, particularly when multiple Fortran files are involved.
- As usual, there are some obscure bug fixes:
-1. Repair of erroneous warning messages about inconsistent number of
-arguments that arose when a character dummy parameter was discovered
-to be a function or when multiple entry points involved character
-variables appearing in a previous entry point.
-2. Repair of memory fault after error msg about "adjustable character
-function".
-3. Under -U, allow MAIN_ as a subroutine name (in the same file as a
-main program).
-4. Change for consistency: a known function invoked as a subroutine,
-then as a function elicits a warning rather than an error.
-
-26 Jan. 22:32:00 EST 1990:
- Fixed two bugs that resulted in incorrect C for substrings, within
-the body of a character-valued function, of the function's name, when
-those substrings were arguments to another function (even implicitly,
-as in character-string assignment).
-
-28 Jan. 18:32:00 EST 1990:
- libf77, libi77: checksum files added; "make check" looks for
-transmission errors. NAMELIST read modified to allow $ rather than &
-to precede a namelist name, to allow $ rather than / to terminate
-input where the name of another variable would otherwise be expected,
-and to regard all nonprinting ASCII characters <= ' ' as spaces.
-
-29 Jan. 02:11:00 EST 1990:
- "fc from f2c" added.
- -it option made the default; -!it turns it off. Type information is
-now updated in a previously missed case.
- -P option tweaked again; message about when rerunning f2c may change
-prototypes or declarations made more accurate.
- New option -Ps implies -P and returns exit status 4 if rerunning
-f2c -P with prototype inputs might change prototypes or declarations.
-Now you can execute a crude script like
-
- cat *.f >zap.F
- rm -f zap.P
- while :; do
- f2c -Ps -!c zap.[FP]
- case $? in 4) ;; *) break;; esac
- done
-
-to get a file zap.P of the best prototypes f2c can determine for *.f .
-
-Jan. 29 07:30:21 EST 1990:
- Forgot to check for error status when setting return code 4 under -Ps;
-error status (1, 2, 3, or, for caught signal, 126) now takes precedence.
-
-Jan 29 14:17:00 EST 1990:
- Incorrect handling of
- open(n,'filename')
-repaired -- now treated as
- open(n,file='filename')
-(and, under -ext, given an error message).
- New optional source file memset.c for people whose systems don't
-provide memset, memcmp, and memcpy; #include <string.h> in mem.c
-changed to #include "string.h" so BSD people can create a local
-string.h that simply says #include <strings.h> .
-
-Jan 30 10:34:00 EST 1990:
- Fix erroneous warning at end of definition of a procedure with
-character arguments when the procedure had previously been called with
-a numeric argument instead of a character argument. (There were two
-warnings, the second one incorrectly complaining of a wrong number of
-arguments.)
-
-Jan 30 16:29:41 EST 1990:
- Fix case where -P and -Ps erroneously reported another iteration
-necessary. (Only harm is the extra iteration.)
-
-Feb 3 01:40:00 EST 1990:
- Supply semicolon occasionally omitted under -c .
- Try to force correct alignment when numeric variables are initialized
-with character data (a non-standard and non-portable practice). You
-must use the -W option if your code has such data statements and is
-meant to run on a machine with other than 4 characters/word; e.g., for
-code meant to run on a Cray, you would specify -W8 .
- Allow parentheses around expressions in output lists (in write and
-print statements).
- Rename source files so their names are <= 12 characters long
-(so there's room to append .Z and still have <= 14 characters);
-renamed files: formatdata.c niceprintf.c niceprintf.h safstrncpy.c .
- f2c material made available by anonymous ftp from research.att.com
-(look in dist/f2c ).
-
-Feb 3 03:49:00 EST 1990:
- Repair memory fault that arose from use (in an assignment or
-call) of a non-argument variable declared CHARACTER*(*).
-
-Feb 9 01:35:43 EST 1990:
- Fix erroneous error msg about bad types in
- subroutine foo(a,adim)
- dimension a(adim)
- integer adim
- Fix improper passing of character args (and possible memory fault)
-in the expression part of a computed goto.
- Fix botched calling sequences in array references involving
-functions having character args.
- Fix memory fault caused by invocation of character-valued functions
-of no arguments.
- Fix botched calling sequence of a character*1-valued function
-assigned to a character*1 variable.
- Fix bug in error msg for inconsistent number of args in prototypes.
- Allow generation of C output despite inconsistencies in prototypes,
-but give exit code 8.
- Simplify include logic (by removing some bogus logic); never
-prepend "/usr/include/" to file names.
- Minor cleanups (that should produce no visible change in f2c's
-behavior) in intr.c parse.h main.c defs.h formatdata.c p1output.c .
-
-Feb 10 00:19:38 EST 1990:
- Insert (integer) casts when floating-point expressions are used
-as subscripts.
- Make SAVE stmt (with no variable list) override -a .
- Minor cleanups: change field to Field in struct Addrblock (for the
-benefit of buggy C compilers); omit system("/bin/cp ...") in misc.c .
-
-Feb 13 00:39:00 EST 1990:
- Error msg fix in gram.dcl: change "cannot make %s parameter"
-to "cannot make into parameter".
-
-Feb 14 14:02:00 EST 1990:
- Various cleanups (invisible on systems with 4-byte ints), thanks
-to Dave Regan: vaxx.c eliminated; %d changed to %ld various places;
-external names adjusted for the benefit of stupid systems (that ignore
-case and recognize only 6 significant characters in external names);
-buffer shortened in xsum.c (e.g. for MS-DOS); fopen modes distinguish
-text and binary files; several unused functions eliminated; missing
-arg supplied to an unlikely fatalstr invocation.
-
-Thu Feb 15 19:15:53 EST 1990:
- More cleanups (invisible on systems with 4 byte ints); casts inserted
-so most complaints from cyntax(1) and lint(1) go away; a few (int)
-versus (long) casts corrected.
-
-Fri Feb 16 19:55:00 EST 1990:
- Recognize and translate unnamed Fortran 8x do while statements.
- Fix bug that occasionally caused improper breaking of character
-strings.
- New error message for attempts to provide DATA in a type-declaration
-statement.
-
-Sat Feb 17 11:43:00 EST 1990:
- Fix infinite loop clf -> Fatal -> done -> clf after I/O error.
- Change "if (addrp->vclass = CLPROC)" to "if (addrp->vclass == CLPROC)"
-in p1_addr (in p1output.c); this was probably harmless.
- Move a misplaced } in lex.c (which slowed initkey()).
- Thanks to Gary Word for pointing these things out.
-
-Sun Feb 18 18:07:00 EST 1990:
- Detect overlapping initializations of arrays and scalar variables
-in previously missed cases.
- Treat logical*2 as logical (after issuing a warning).
- Don't pass string literals to p1_comment().
- Correct a cast (introduced 16 Feb.) in gram.expr; this matters e.g.
-on a Cray.
- Attempt to isolate UNIX-specific things in sysdep.c (a new source
-file). Unless sysdep.c is compiled with SYSTEM_SORT defined, the
-intermediate files created for DATA statements are now sorted in-core
-without invoking system().
-
-Tue Feb 20 16:10:35 EST 1990:
- Move definition of binread and binwrite from init.c to sysdep.c .
- Recognize Fortran 8x tokens < <= == >= > <> as synonyms for
-.LT. .LE. .EQ. .GE. .GT. .NE.
- Minor cleanup in putpcc.c: fully remove simoffset().
- More discussion of system dependencies added to libI77/README.
-
-Tue Feb 20 21:44:07 EST 1990:
- Minor cleanups for the benefit of EBCDIC machines -- try to remove
-the assumption that 'a' through 'z' are contiguous. (Thanks again to
-Gary Word.) Also, change log2 to log_2 (shouldn't be necessary).
-
-Wed Feb 21 06:24:56 EST 1990:
- Fix botch in init.c introduced in previous change; only matters
-to non-ASCII machines.
-
-Thu Feb 22 17:29:12 EST 1990:
- Allow several entry points to mention the same array. Protect
-parameter adjustments with if's (for the case that an array is not
-an argument to all entrypoints).
- Under -u, allow
- subroutine foo(x,n)
- real x(n)
- integer n
- Compute intermediate variables used to evaluate dimension expressions
-at the right time. Example previously mistranslated:
- subroutine foo(x,k,m,n)
- real x(min(k,m,n))
- ...
- write(*,*) x
- Detect duplicate arguments. (The error msg points to the first
-executable stmt -- not wonderful, but not worth fixing.)
- Minor cleanup of min/max computation (sometimes slightly simpler).
-
-Sun Feb 25 09:39:01 EST 1990:
- Minor tweak to multiple entry points: protect parameter adjustments
-with if's only for (array) args that do not appear in all entry points.
- Minor tweaks to format.c and io.c (invisible unless your compiler
-complained at the duplicate #defines of IOSUNIT and IOSFMT or at
-comparisons of p1gets(...) with NULL).
-
-Sun Feb 25 18:40:10 EST 1990:
- Fix bug introduced Feb. 22: if a subprogram contained DATA and the
-first executable statement was labeled, then the label got lost.
-(Just change INEXEC to INDATA in p1output.c; it occurs just once.)
-
-Mon Feb 26 17:45:10 EST 1990:
- Fix bug in handling of " and ' in comments.
-
-Wed Mar 28 01:43:06 EST 1990:
-libI77:
- 1. Repair nasty I/O bug: opening two files and closing the first
-(after possibly reading or writing it), then writing the second caused
-the last buffer of the second to be lost.
- 2. Formatted reads of logical values treated all letters other than
-t or T as f (false).
- libI77 files changed: err.c rdfmt.c Version.c
- (Request "libi77 from f2c" -- you can't get these files individually.)
-
-f2c itself:
- Repair nasty bug in translation of
- ELSE IF (condition involving complicated abs, min, or max)
--- auxiliary statements were emitted at the wrong place.
- Supply semicolon previously omitted from the translation of a label
-(of a CONTINUE) immediately preceding an ELSE IF or an ELSE. This
-bug made f2c produce invalid C.
- Correct a memory fault that occurred (on some machines) when the
-error message "adjustable dimension on non-argument" should be given.
- Minor tweaks to remove some harmless warnings by overly chatty C
-compilers.
- Argument arays having constant dimensions but a variable lower bound
-(e.g., x(n+1:n+3)) had a * omitted from scalar arguments involved in
-the array offset computation.
-
-Wed Mar 28 18:47:59 EST 1990:
-libf77: add exit(0) to end of main [return(0) encounters a Cray bug]
-
-Sun Apr 1 16:20:58 EDT 1990:
- Avoid dereferencing null when processing equivalences after an error.
-
-Fri Apr 6 08:29:49 EDT 1990:
- Calls involving alternate return specifiers omitted processing
-needed for things like min, max, abs, and // (concatenation).
- INTEGER*2 PARAMETERs were treated as INTEGER*4.
- Convert some O(n^2) parsing to O(n).
-
-Tue Apr 10 20:07:02 EDT 1990:
- When inconsistent calling sequences involve differing numbers of
-arguments, report the first differing argument rather than the numbers
-of arguments.
- Fix bug under -a: formatted I/O in which either the unit or the
-format was a local character variable sometimes resulted in invalid C
-(a static struct initialized with an automatic component).
- Improve error message for invalid flag after elided -.
- Complain when literal table overflows, rather than infinitely
-looping. (The complaint mentions the new and otherwise undocumented
--NL option for specifying a larger literal table.)
- New option -h for forcing strings to word (or, with -hd, double-word)
-boundaries where possible.
- Repair a bug that could cause improper splitting of strings.
- Fix bug (cast of c to doublereal) in
- subroutine foo(c,r)
- double complex c
- double precision r
- c = cmplx(r,real(c))
- end
- New include file "sysdep.h" has some things from defs.h (and
-elsewhere) that one may need to modify on some systems.
- Some large arrays that were previously statically allocated are now
-dynamically allocated when f2c starts running.
- f2c/src files changed:
- README cds.c defs.h f2c.1 f2c.1t format.c formatdata.c init.c
- io.c lex.c main.c makefile mem.c misc.c names.c niceprintf.c
- output.c parse_args.c pread.c put.c putpcc.c sysdep.h
- version.c xsum0.out
-
-Wed Apr 11 18:27:12 EDT 1990:
- Fix bug in argument consistency checking of character, complex, and
-double complex valued functions. If the same source file contained a
-definition of such a function with arguments not explicitly typed,
-then subsequent references to the function might get erroneous
-warnings of inconsistent calling sequences.
- Tweaks to sysdep.h for partially ANSI systems.
- New options -kr and -krd cause f2c to use temporary variables to
-enforce Fortran evaluation-order rules with pernicious, old-style C
-compilers that apply the associative law to floating-point operations.
-
-Sat Apr 14 15:50:15 EDT 1990:
- libi77: libI77 adjusted to allow list-directed and namelist I/O
-of internal files; bug in namelist I/O of logical and character arrays
-fixed; list input of complex numbers adjusted to permit d or D to
-denote the start of the exponent field of a component.
- f2c itself: fix bug in handling complicated lower-bound
-expressions for character substrings; e.g., min and max did not work
-right, nor did function invocations involving character arguments.
- Switch to octal notation, rather than hexadecimal, for nonprinting
-characters in character and string constants.
- Fix bug (when neither -A nor -C++ was specified) in typing of
-external arguments of type complex, double complex, or character:
- subroutine foo(c)
- external c
- complex c
-now results in
- /* Complex */ int (*c) ();
-(as, indeed, it once did) rather than
- complex (*c) ();
-
-Sat Apr 14 22:50:39 EDT 1990:
- libI77/makefile: updated "make check" to omit lio.c
- lib[FI]77/makefile: trivial change: define CC = cc, reference $(CC).
- (Request, e.g., "libi77 from f2c" -- you can't ask for individual
-files from lib[FI]77.)
-
-Wed Apr 18 00:56:37 EDT 1990:
- Move declaration of atof() from defs.h to sysdep.h, where it is
-now not declared if stdlib.h is included. (NeXT's stdlib.h has a
-#define atof that otherwise wreaks havoc.)
- Under -u, provide a more intelligible error message (than "bad tag")
-for an attempt to define a function without specifying its type.
-
-Wed Apr 18 17:26:27 EDT 1990:
- Recognize \v (vertical tab) in Hollerith as well as quoted strings;
-add recognition of \r (carriage return).
- New option -!bs turns off recognition of escapes in character strings
-(\0, \\, \b, \f, \n, \r, \t, \v).
- Move to sysdep.c initialization of some arrays whose initialization
-assumed ASCII; #define Table_size in sysdep.h rather than using
-hard-coded 256 in allocating arrays of size 1 << (bits/byte).
-
-Thu Apr 19 08:13:21 EDT 1990:
- Warn when escapes would make Hollerith extend beyond statement end.
- Omit max() definition from misc.c (should be invisible except on
-systems that erroneously #define max in stdlib.h).
-
-Mon Apr 23 22:24:51 EDT 1990:
- When producing default-style C (no -A or -C++), cast switch
-expressions to (int).
- Move "-lF77 -lI77 -lm -lc" to link_msg, defined in sysdep.c .
- Add #define scrub(x) to sysdep.h, with invocations in format.c and
-formatdata.c, so that people who have systems like VMS that would
-otherwise create multiple versions of intermediate files can
-#define scrub(x) unlink(x)
-
-Tue Apr 24 18:28:36 EDT 1990:
- Pass string lengths once rather than twice to a function of character
-arguments involved in comparison of character strings of length 1.
-
-Fri Apr 27 13:11:52 EDT 1990:
- Fix bug that made f2c gag on concatenations involving char(...) on
-some systems.
-
-Sat Apr 28 23:20:16 EDT 1990:
- Fix control-stack bug in
- if(...) then
- else if (complicated condition)
- else
- endif
-(where the complicated condition causes assignment to an auxiliary
-variable, e.g., max(a*b,c)).
-
-Mon Apr 30 13:30:10 EDT 1990:
- Change fillers for DATA with holes from substructures to arrays
-(in an attempt to make things work right with C compilers that have
-funny padding rules for substructures, e.g., Sun C compilers).
- Minor cleanup of exec.c (should not affect generated C).
-
-Mon Apr 30 23:13:51 EDT 1990:
- Fix bug in handling return values of functions having multiple
-entry points of differing return types.
-
-Sat May 5 01:45:18 EDT 1990:
- Fix type inference bug in
- subroutine foo(x)
- call goo(x)
- end
- subroutine goo(i)
- i = 3
- end
-Instead of warning of inconsistent calling sequences for goo,
-f2c was simply making i a real variable; now i is correctly
-typed as an integer variable, and f2c issues an error message.
- Adjust error messages issued at end of declarations so they
-don't blame the first executable statement.
-
-Sun May 6 01:29:07 EDT 1990:
- Fix bug in -P and -Ps: warn when the definition of a subprogram adds
-information that would change prototypes or previous declarations.
-
-Thu May 10 18:09:15 EDT 1990:
- Fix further obscure bug with (default) -it: inconsistent calling
-sequences and I/O statements could interact to cause a memory fault.
-Example:
- SUBROUTINE FOO
- CALL GOO(' Something') ! Forgot integer first arg
- END
- SUBROUTINE GOO(IUNIT,MSG)
- CHARACTER*(*)MSG
- WRITE(IUNIT,'(1X,A)') MSG
- END
-
-Fri May 11 16:49:11 EDT 1990:
- Under -!c, do not delete any .c files (when there are errors).
- Avoid dereferencing 0 when a fatal error occurs while reading
-Fortran on stdin.
-
-Wed May 16 18:24:42 EDT 1990:
- f2c.ps made available.
-
-Mon Jun 4 12:53:08 EDT 1990:
- Diagnose I/O units of invalid type.
- Add specific error msg about dummy arguments in common.
-
-Wed Jun 13 12:43:17 EDT 1990:
- Under -A, supply a missing "[1]" for CHARACTER*1 variables that appear
-both in a DATA statement and in either COMMON or EQUIVALENCE.
-
-Mon Jun 18 16:58:31 EDT 1990:
- Trivial updates to f2c.ps . ("Fortran 8x" --> "Fortran 90"; omit
-"(draft)" from "(draft) ANSI C".)
-
-Tue Jun 19 07:36:32 EDT 1990:
- Fix incorrect code generated for ELSE IF(expression involving
-function call passing non-constant substring).
- Under -h, preserve the property that strings are null-terminated
-where possible.
- Remove spaces between # and define in lex.c output.c parse.h .
-
-Mon Jun 25 07:22:59 EDT 1990:
- Minor tweak to makefile to reduce unnecessary recompilations.
-
-Tue Jun 26 11:49:53 EDT 1990:
- Fix unintended truncation of some integer constants on machines
-where casting a long to (int) may change the value. E.g., when f2c
-ran on machines with 16-bit ints, "i = 99999" was being translated
-to "i = -31073;".
-
-Wed Jun 27 11:05:32 EDT 1990:
- Arrange for CHARACTER-valued PARAMETERs to honor their length
-specifications. Allow CHAR(nn) in expressions defining such PARAMETERs.
-
-Fri Jul 20 09:17:30 EDT 1990:
- Avoid dereferencing 0 when a FORMAT statement has no label.
-
-Thu Jul 26 11:09:39 EDT 1990:
- Remarks about VOID and binread,binwrite added to README.
- Tweaks to parse_args: should be invisible unless your compiler
-complained at (short)*store.
-
-Thu Aug 2 02:07:58 EDT 1990:
- f2c.ps: change the first line of page 5 from
- include stuff
-to
- include 'stuff'
-
-Tue Aug 14 13:21:24 EDT 1990:
- libi77: libI77 adjusted to treat tabs as spaces in list input.
-
-Fri Aug 17 07:24:53 EDT 1990:
- libi77: libI77 adjusted so a blank='ZERO' clause (upper case Z)
-in an open of a currently open file works right.
-
-Tue Aug 28 01:56:44 EDT 1990:
- Fix bug in warnings of inconsistent calling sequences: if an
-argument to a subprogram was never referenced, then a previous
-invocation of the subprogram (in the same source file) that
-passed something of the wrong type for that argument did not
-elicit a warning message.
-
-Thu Aug 30 09:46:12 EDT 1990:
- libi77: prevent embedded blanks in list output of complex values;
-omit exponent field in list output of values of magnitude between
-10 and 1e8; prevent writing stdin and reading stdout or stderr;
-don't close stdin, stdout, or stderr when reopening units 5, 6, 0.
-
-Tue Sep 4 12:30:57 EDT 1990:
- Fix bug in C emitted under -I2 or -i2 for INTEGER*4 FUNCTION.
- Warn of missing final END even if there are previous errors.
-
-Fri Sep 7 13:55:34 EDT 1990:
- Remark about "make xsum.out" and "make f2c" added to README.
-
-Tue Sep 18 23:50:01 EDT 1990:
- Fix null dereference (and, on some systems, writing of bogus *_com.c
-files) under -ec or -e1c when a prototype file (*.p or *.P) describes
-COMMON blocks that do not appear in the Fortran source.
- libi77:
- Add some #ifdef lines (#ifdef MSDOS, #ifndef MSDOS) to avoid
-references to stat and fstat on non-UNIX systems.
- On UNIX systems, add component udev to unit; decide that old
-and new files are the same iff both the uinode and udev components
-of unit agree.
- When an open stmt specifies STATUS='OLD', use stat rather than
-access (on UNIX systems) to check the existence of the file (in case
-directories leading to the file have funny permissions and this is
-a setuid or setgid program).
-
-Thu Sep 27 16:04:09 EDT 1990:
- Supply missing entry for Impldoblock in blksize array of cpexpr
-(in expr.c). No examples are known where this omission caused trouble.
-
-Tue Oct 2 22:58:09 EDT 1990:
- libf77: test signal(...) == SIG_IGN rather than & 01 in main().
- libi77: adjust rewind.c so two successive rewinds after a write
-don't clobber the file.
-
-Thu Oct 11 18:00:14 EDT 1990:
- libi77: minor cleanups: add #include "fcntl.h" to endfile.c, err.c,
-open.c; adjust g_char in util.c for segmented memories; in f_inqu
-(inquire.c), define x appropriately when MSDOS is defined.
-
-Mon Oct 15 20:02:11 EDT 1990:
- Add #ifdef MSDOS pointer adjustments to mem.c; treat NAME= as a
-synonym for FILE= in OPEN statements.
-
-Wed Oct 17 16:40:37 EDT 1990:
- libf77, libi77: minor cleanups: _cleanup() and abort() invocations
-replaced by invocations of sig_die in main.c; some error messages
-previously lost in buffers will now appear.
-
-Mon Oct 22 16:11:27 EDT 1990:
- libf77: separate sig_die from main (for folks who don't want to use
-the main in libF77).
- libi77: minor tweak to comments in README.
-
-Fri Nov 2 13:49:35 EST 1990:
- Use two underscores rather than one in generated temporary variable
-names to avoid conflict with COMMON names. f2c.ps updated to reflect
-this change and the NAME= extension introduced 15 Oct.
- Repair a rare memory fault in io.c .
-
-Mon Nov 5 16:43:55 EST 1990:
- libi77: changes to open.c (and err.c): complain if an open stmt
-specifies new= and the file already exists (as specified by Fortrans 77
-and 90); allow file= to be omitted in open stmts and allow
-status='replace' (Fortran 90 extensions).
-
-Fri Nov 30 10:10:14 EST 1990:
- Adjust malloc.c for unusual systems whose sbrk() can return values
-not properly aligned for doubles.
- Arrange for slightly more helpful and less repetitive warnings for
-non-character variables initialized with character data; these warnings
-are (still) suppressed by -w66.
-
-Fri Nov 30 15:57:59 EST 1990:
- Minor tweak to README (about changing VOID in f2c.h).
-
-Mon Dec 3 07:36:20 EST 1990:
- Fix spelling of "character" in f2c.1t.
-
-Tue Dec 4 09:48:56 EST 1990:
- Remark about link_msg and libf2c added to f2c/README.
-
-Thu Dec 6 08:33:24 EST 1990:
- Under -U, render label nnn as L_nnn rather than Lnnn.
-
-Fri Dec 7 18:05:00 EST 1990:
- Add more names from f2c.h (e.g. integer, real) to the c_keywords
-list of names to which an underscore is appended to avoid confusion.
-
-Mon Dec 10 19:11:15 EST 1990:
- Minor tweaks to makefile (./xsum) and README (binread/binwrite).
- libi77: a few modifications for POSIX systems; meant to be invisible
-elsewhere.
-
-Sun Dec 16 23:03:16 EST 1990:
- Fix null dereference caused by unusual erroneous input, e.g.
- call foo('abc')
- end
- subroutine foo(msg)
- data n/3/
- character*(*) msg
- end
-(Subroutine foo is illegal because the character statement comes after a
-data statement.)
- Use decimal rather than hex constants in xsum.c (to prevent
-erroneous warning messages about constant overflow).
-
-Mon Dec 17 12:26:40 EST 1990:
- Fix rare extra underscore in character length parameters passed
-for multiple entry points.
-
-Wed Dec 19 17:19:26 EST 1990:
- Allow generation of C despite error messages about bad alignment
-forced by equivalence.
- Allow variable-length concatenations in I/O statements, such as
- open(3, file=bletch(1:n) // '.xyz')
-
-Fri Dec 28 17:08:30 EST 1990:
- Fix bug under -p with formats and internal I/O "units" in COMMON,
-as in
- COMMON /FIGLEA/F
- CHARACTER*20 F
- F = '(A)'
- WRITE (*,FMT=F) 'Hello, world!'
- END
-
-Tue Jan 15 12:00:24 EST 1991:
- Fix bug when two equivalence groups are merged, the second with
-nonzero offset, and the result is then merged into a common block.
-Example:
- INTEGER W(3), X(3), Y(3), Z(3)
- COMMON /ZOT/ Z
- EQUIVALENCE (W(1),X(1)), (X(2),Y(1)), (Z(3),X(1))
-***** W WAS GIVEN THE WRONG OFFSET
- Recognize Fortran 90's optional NML= in NAMELIST READs and WRITEs.
-(Currently NML= and FMT= are treated as synonyms -- there's no
-error message if, e.g., NML= specifies a format.)
- libi77: minor adjustment to allow internal READs from character
-string constants in read-only memory.
-
-Fri Jan 18 22:56:15 EST 1991:
- Add comment to README about needing to comment out the typedef of
-size_t in sysdep.h on some systems, e.g. Sun 4.1.
- Fix misspelling of "statement" in an error message in lex.c
-
-Wed Jan 23 00:38:48 EST 1991:
- Allow hex, octal, and binary constants to have the qualifying letter
-(z, x, o, or b) either before or after the quoted string containing the
-digits. For now this change will not be reflected in f2c.ps .
-
-Tue Jan 29 16:23:45 EST 1991:
- Arrange for character-valued statement functions to give results of
-the right length (that of the statement function's name).
-
-Wed Jan 30 07:05:32 EST 1991:
- More tweaks for character-valued statement functions: an error
-check and an adjustment so a right-hand side of nonconstant length
-(e.g., a substring) is handled right.
-
-Wed Jan 30 09:49:36 EST 1991:
- Fix p1_head to avoid printing (char *)0 with %s.
-
-Thu Jan 31 13:53:44 EST 1991:
- Add a test after the cleanup call generated for I/O statements with
-ERR= or END= clauses to catch the unlikely event that the cleanup
-routine encounters an error.
-
-Mon Feb 4 08:00:58 EST 1991:
- Minor cleanup: omit unneeded jumps and labels from code generated for
-some NAMELIST READs and WRITEs with IOSTAT=, ERR=, and/or END=.
-
-Tue Feb 5 01:39:36 EST 1991:
- Change Mktemp to mktmp (for the benefit of systems so brain-damaged
-that they do not distinguish case in external names -- and that for
-some reason want to load mktemp). Try to get xsum0.out right this
-time (it somehow didn't get updated on 4 Feb. 1991).
- Add note to libi77/README about adjusting the interpretation of
-RECL= specifiers in OPENs for direct unformatted I/O.
-
-Thu Feb 7 17:24:42 EST 1991:
- New option -r casts values of REAL functions, including intrinsics,
-to REAL. This only matters for unportable code like
- real r
- r = asin(1.)
- if (r .eq. asin(1.)) ...
-[The behavior of such code varies with the Fortran compiler used --
-and sometimes is affected by compiler options.] For now, the man page
-at the end of f2c.ps is the only part of f2c.ps that reflects this new
-option.
-
-Fri Feb 8 18:12:51 EST 1991:
- Cast pointer differences passed as arguments to the appropriate type.
-This matters, e.g., with MSDOS compilers that yield a long pointer
-difference but have int == short.
- Disallow nonpositive dimensions.
-
-Fri Feb 15 12:24:15 EST 1991:
- Change %d to %ld in sprintf call in putpower in putpcc.c.
- Free more memory (e.g. allowing translation of larger Fortran
-files under MS-DOS).
- Recognize READ (character expression) and WRITE (character expression)
-as formatted I/O with the format given by the character expression.
- Update year in Notice.
-
-Sat Feb 16 00:42:32 EST 1991:
- Recant recognizing WRITE(character expression) as formatted output
--- Fortran 77 is not symmetric in its syntax for READ and WRITE.
-
-Mon Mar 4 15:19:42 EST 1991:
- Fix bug in passing the real part of a complex argument to an intrinsic
-function. Omit unneeded parentheses in nested calls to intrinsics.
-Example:
- subroutine foo(x, y)
- complex y
- x = exp(sin(real(y))) + exp(imag(y))
- end
-
-Fri Mar 8 15:05:42 EST 1991:
- Fix a comment in expr.c; omit safstrncpy.c (which had bugs in
-cases not used by f2c).
-
-Wed Mar 13 02:27:23 EST 1991:
- Initialize firstmemblock->next in mem_init in mem.c . [On most
-systems it was fortuituously 0, but with System V, -lmalloc could
-trip on this missed initialization.]
-
-Wed Mar 13 11:47:42 EST 1991:
- Fix a reference to freed memory.
-
-Wed Mar 27 00:42:19 EST 1991:
- Fix a memory fault caused by such illegal Fortran as
- function foo
- x = 3
- logical foo ! declaration among executables
- foo=.false. ! used to suffer memory fault
- end
-
-Fri Apr 5 08:30:31 EST 1991:
- Fix loss of % in some format expressions, e.g.
- write(*,'(1h%)')
- Fix botch introduced 27 March 1991 that caused subroutines with
-multiple entry points to have extraneous declarations of ret_val.
-
-Fri Apr 5 12:44:02 EST 1991
- Try again to omit extraneous ret_val declarations -- this morning's
-fix was sometimes wrong.
-
-Mon Apr 8 13:47:06 EDT 1991:
- Arrange for s_rnge to have the right prototype under -A -C .
-
-Wed Apr 17 13:36:03 EDT 1991:
- New fatal error message for apparent invocation of a recursive
-statement function.
-
-Thu Apr 25 15:13:37 EDT 1991:
- F2c and libi77 adjusted so NAMELIST works with -i2. (I forgot
-about -i2 when adding NAMELIST.) This required a change to f2c.h
-(that only affects NAMELIST I/O under -i2.) Man-page description of
--i2 adjusted to reflect that -i2 stores array lengths in short ints.
-
-Fri Apr 26 02:54:41 EDT 1991:
- Libi77: fix some bugs in NAMELIST reading of multi-dimensional arrays
-(file rsne.c).
-
-Thu May 9 02:13:51 EDT 1991:
- Omit a trailing space in expr.c (could cause a false xsum value if
-a mailer drops the trailing blank).
-
-Thu May 16 13:14:59 EDT 1991:
- Libi77: increase LEFBL in lio.h to overcome a NeXT bug.
- Tweak for compilers that recognize "nested" comments: inside comments,
-turn /* into /+ (as well as */ into +/).
-
-Sat May 25 11:44:25 EDT 1991:
- libf77: s_rnge: declare line long int rather than int.
-
-Fri May 31 07:51:50 EDT 1991:
- libf77: system_: officially return status.
-
-Mon Jun 17 16:52:53 EDT 1991:
- Minor tweaks: omit unnecessary declaration of strcmp (that caused
-trouble on a system where strcmp was a macro) from misc.c; add
-SHELL = /bin/sh to makefiles.
- Fix a dereference of null when a CHARACTER*(*) declaration appears
-(illegally) after DATA. Complain only once per subroutine about
-declarations appearing after DATA.
-
-Mon Jul 1 00:28:13 EDT 1991:
- Add test and error message for illegal use of subroutine names, e.g.
- SUBROUTINE ZAP(A)
- ZAP = A
- END
-
-Mon Jul 8 21:49:20 EDT 1991:
- Issue a warning about things like
- integer i
- i = 'abc'
-(which is treated as i = ichar('a')). [It might be nice to treat 'abc'
-as an integer initialized (in a DATA statement) with 'abc', but
-other matters have higher priority.]
- Render
- i = ichar('A')
-as
- i = 'A';
-rather than
- i = 65;
-(which assumes ASCII).
-
-Fri Jul 12 07:41:30 EDT 1991:
- Note added to README about erroneous definitions of __STDC__ .
-
-Sat Jul 13 13:38:54 EDT 1991:
- Fix bugs in double type convesions of complex values, e.g.
-sngl(real(...)) or dble(real(...)) (where ... is complex).
-
-Mon Jul 15 13:21:42 EDT 1991:
- Fix bug introduced 8 July 1991 that caused erroneous warnings
-"ichar([first char. of] char. string) assumed for conversion to numeric"
-when a subroutine had an array of character strings as an argument.
-
-Wed Aug 28 01:12:17 EDT 1991:
- Omit an unused function in format.c, an unused variable in proc.c .
- Under -r8, promote complex to double complex (as the man page claims).
-
-Fri Aug 30 17:19:17 EDT 1991:
- f2c.ps updated: slightly expand description of intrinsics and,or,xor,
-not; add mention of intrinsics lshift, rshift; add note about f2c
-accepting Fortran 90 inline comments (starting with !); update Cobalt
-Blue address.
-
-Tue Sep 17 07:17:33 EDT 1991:
- libI77: err.c and open.c modified to use modes "rb" and "wb"
-when (f)opening unformatted files; README updated to point out
-that it may be necessary to change these modes to "r" and "w"
-on some non-ANSI systems.
-
-Tue Oct 15 10:25:49 EDT 1991:
- Minor tweaks that make some PC compilers happier: insert some
-casts, add args to signal functions.
- Change -g to emit uncommented #line lines -- and to emit more of them;
-update fc, f2c.1, f2c.1t, f2c.ps to reflect this.
- Change uchar to Uchar in xsum.c .
- Bring gram.c up to date.
-
-Thu Oct 17 09:22:05 EDT 1991:
- libi77: README, fio.h, sue.c, uio.c changed so the length field
-in unformatted sequential records has type long rather than int
-(unless UIOLEN_int is #defined). This is for systems where sizeof(int)
-can vary, depending on the compiler or compiler options.
-
-Thu Oct 17 13:42:59 EDT 1991:
- libi77: inquire.c: when MSDOS is defined, don't strcmp units[i].ufnm
-when it is NULL.
-
-Fri Oct 18 15:16:00 EDT 1991:
- Correct xsum0.out in "all from f2c/src" (somehow botched on 15 Oct.).
-
-Tue Oct 22 18:12:56 EDT 1991:
- Fix memory fault when a character*(*) argument is used (illegally)
-as a dummy variable in the definition of a statement function. (The
-memory fault occurred when the statement function was invoked.)
- Complain about implicit character*(*).
-
-Thu Nov 14 08:50:42 EST 1991:
- libi77: change uint to Uint in fmt.h, rdfmt.c, wrtfmt.c; this change
-should be invisible unless you're running a brain-damaged system.
-
-Mon Nov 25 19:04:40 EST 1991:
- libi77: correct botches introduced 17 Oct. 1991 and 14 Nov. 1991
-(change uint to Uint in lwrite.c; other changes that only matter if
-sizeof(int) != sizeof(long)).
- Add a more meaningful error message when bailing out due to an attempt
-to invoke a COMMON variable as a function.
-
-Sun Dec 1 19:29:24 EST 1991:
- libi77: uio.c: add test for read failure (seq. unformatted reads);
-adjust an error return from EOF to off end of record.
-
-Tue Dec 10 17:42:28 EST 1991:
- Add tests to prevent memory faults with bad uses of character*(*).
-
-Thu Dec 12 11:24:41 EST 1991:
- libi77: fix bug with internal list input that caused the last
-character of each record to be ignored; adjust error message in
-internal formatted input from "end-of-file" to "off end of record"
-if the format specifies more characters than the record contains.
-
-Wed Dec 18 17:48:11 EST 1991:
- Fix bug in translating nonsensical ichar invocations involving
-concatenations.
- Fix bug in passing intrinsics lle, llt, lge, lgt as arguments;
-hl_le was being passed rather than l_le, etc.
- libf77: adjust length parameters from long to ftnlen, for
-compiling with f2c_i2 defined.
-
-Sat Dec 21 15:30:57 EST 1991:
- Allow DO nnn ... to end with an END DO statement labelled nnn.
-
-Tue Dec 31 13:53:47 EST 1991:
- Fix bug in handling dimension a(n**3,2) -- pow_ii was called
-incorrectly.
- Fix bug in translating
- subroutine x(abc,n)
- character abc(n)
- write(abc,'(i10)') 123
- end
-(omitted declaration and initialiation of abc_dim1).
- Complain about dimension expressions of such invalid types
-as complex and logical.
-
-Fri Jan 17 11:54:20 EST 1992:
- Diagnose some illegal uses of main program name (rather than
-memory faulting).
- libi77: (1) In list and namelist input, treat "r* ," and "r*,"
-alike (where r is a positive integer constant), and fix a bug in
-handling null values following items with repeat counts (e.g.,
-2*1,,3). (2) For namelist reading of a numeric array, allow a new
-name-value subsequence to terminate the current one (as though the
-current one ended with the right number of null values).
-(3) [lio.h, lwrite.c]: omit insignificant zeros in list and namelist
-output. (Compile with -DOld_list_output to get the old behavior.)
-
-Sat Jan 18 15:58:01 EST 1992:
- libi77: make list output consistent with F format by printing .1
-rather than 0.1 (introduced yesterday).
-
-Wed Jan 22 08:32:43 EST 1992:
- libi77: add comment to README pointing out preconnection of
-Fortran units 5, 6, 0 to stdin, stdout, stderr (respectively).
-
-Mon Feb 3 11:57:53 EST 1992:
- libi77: fix namelist read bug that caused the character following
-a comma to be ignored.
-
-Fri Feb 28 01:04:26 EST 1992:
- libf77: fix buggy z_sqrt.c (double precision square root), which
-misbehaved for arguments in the southwest quadrant.
-
-Thu Mar 19 15:05:18 EST 1992:
- Fix bug (introduced 17 Jan 1992) in handling multiple entry points
-of differing types (with implicitly typed entries appearing after
-the first executable statement).
- Fix memory fault in the following illegal Fortran:
- double precision foo(i)
-* illegal: above should be "double precision function foo(i)"
- foo = i * 3.2
- entry moo(i)
- end
- Note about ANSI_Libraries (relevant, e.g., to IRIX 4.0.1 and AIX)
-added to README.
- Abort zero divides during constant simplification.
-
-Sat Mar 21 01:27:09 EST 1992:
- Tweak ckalloc (misc.c) for systems where malloc(0) = 0; this matters
-for subroutines with multiple entry points but no arguments.
- Add "struct memblock;" to init.c (irrelevant to most compilers).
-
-Wed Mar 25 13:31:05 EST 1992:
- Fix bug with IMPLICIT INTEGER*4(...): under -i2 or -I2, the *4 was
-ignored.
-
-Tue May 5 09:53:55 EDT 1992:
- Tweaks to README; e.g., ANSI_LIbraries changed to ANSI_Libraries .
-
-Wed May 6 23:49:07 EDT 1992
- Under -A and -C++, have subroutines return 0 (even if they have
-no * arguments).
- Adjust libi77 (rsne.c and lread.c) for systems where ungetc is
-a macro. Tweak lib[FI]77/makefile to use unique intermediate file
-names (for parallel makes).
-
-Tue May 19 09:03:05 EDT 1992:
- Adjust libI77 to make err= work with internal list and formatted I/O.
-
-Sat May 23 18:17:42 EDT 1992:
- Under -A and -C++, supply "return 0;" after the code generated for
-a STOP statement -- the C compiler doesn't know that s_stop won't
-return.
- New (mutually exclusive) options:
- -f treats all input lines as free-format lines,
- honoring text that appears after column 72
- and not padding lines shorter than 72 characters
- with blanks (which matters if a character string
- is continued across 2 or more lines).
- -72 treats text appearing after column 72 as an error.
-
-Sun May 24 09:45:37 EDT 1992:
- Tweak description of -f in f2c.1 and f2c.1t; update f2c.ps .
-
-Fri May 29 01:17:15 EDT 1992:
- Complain about externals used as variables. Example
- subroutine foo(a,b)
- external b
- a = a*b ! illegal use of b; perhaps should be b()
- end
-
-Mon Jun 15 11:15:27 EDT 1992:
- Fix bug in handling namelists with names that have underscores.
-
-Sat Jun 27 17:30:59 EDT 1992:
- Under -A and -C++, end Main program aliases with "return 0;".
- Under -A and -C++, use .P files and usage in previous subprograms
-in the current file to give prototypes for functions declared EXTERNAL
-but not invoked.
- Fix memory fault under -d1 -P .
- Under -A and -C++, cast arguments to the right types in calling
-a function that has been defined in the current file or in a .P file.
- Fix bug in handling multi-dimensional arrays with array references
-in their leading dimensions.
- Fix bug in the intrinsic cmplx function when the first argument
-involves an expression for which f2c generates temporary variables,
-e.g. cmplx(abs(real(a)),1.) .
-
-Sat Jul 18 07:36:58 EDT 1992:
- Fix buglet with -e1c (invisible on most systems) temporary file
-f2c_functions was unlinked before being closed.
- libf77: fix bugs in evaluating m**n for integer n < 0 and m an
-integer different from 1 or a real or double precision 0.
-Catch SIGTRAP (to print "Trace trap" before aborting). Programs
-that previously erroneously computed 1 for 0**-1 may now fault.
-Relevant routines: main.c pow_di.c pow_hh.c pow_ii.c pow_ri.c .
-
-Sat Jul 18 08:40:10 EDT 1992:
- libi77: allow namelist input to end with & (e.g. &end).
-
-Thu Jul 23 00:14:43 EDT 1992
- Append two underscores rather than one to C keywords used as
-local variables to avoid conflicts with similarly named COMMON blocks.
-
-Thu Jul 23 11:20:55 EDT 1992:
- libf77, libi77 updated to assume ANSI prototypes unless KR_headers
-is #defined.
- libi77 now recognizes a Z format item as in Fortran 90;
-the implementation assumes 8-bit bytes and botches character strings
-on little-endian machines (by printing their bytes from right to
-left): expect this bug to persist; fixing it would require a
-change to the I/O calling sequences.
-
-Tue Jul 28 15:18:33 EDT 1992:
- libi77: insert missed "#ifdef KR_headers" lines around getnum
-header in rsne.c. Version not updated.
-
-NOTE: "index from f2c" now ends with current timestamps of files in
-"all from f2c/src", sorted by time. To bring your source up to date,
-obtain source files with a timestamp later than the time shown in your
-version.c.
-
-Fri Aug 14 08:07:09 EDT 1992:
- libi77: tweak wrt_E in wref.c to avoid signing NaNs.
-
-Sun Aug 23 19:05:22 EDT 1992:
- fc: supply : after O in getopt invocation (for -O1 -O2 -O3).
-
-Mon Aug 24 18:37:59 EDT 1992:
- Recant above tweak to fc: getopt is dumber than I thought;
-it's necessary to say -O 1 (etc.).
- libF77/README: add comments about ABORT, ERF, DERF, ERFC, DERFC,
-GETARG, GETENV, IARGC, SIGNAL, and SYSTEM.
-
-Tue Oct 27 01:57:42 EST 1992:
- libf77, libi77:
- 1. Fix botched indirection in signal_.c.
- 2. Supply missing l_eof = 0 assignment to s_rsne() in rsne.c (so
-end-of-file on other files won't confuse namelist reads of external
-files).
- 3. Prepend f__ to external names that are only of internal
-interest to lib[FI]77.
-
-Thu Oct 29 12:37:18 EST 1992:
- libf77: Fix botch in signal_.c when KR_headers is #defined;
-add CFLAGS to makefile.
- libi77: trivial change to makefile for consistency with
-libF77/makefile.
-
-Wed Feb 3 02:05:16 EST 1993:
- Recognize types INTEGER*1, LOGICAL*1, LOGICAL*2, INTEGER*8.
-INTEGER*8 is not well tested and will only work reasonably on
-systems where int = 4 bytes, long = 8 bytes; on such systems,
-you'll have to modify f2c.h appropriately, changing integer
-from long to int and adding typedef long longint. You'll also
-have to compile libI77 with Allow_TYQUAD #defined and adjust
-libF77/makefile to compile pow_qq.c. In the f2c source, changes
-for INTEGER*8 are delimited by #ifdef TYQUAD ... #endif. You
-can omit the INTEGER*8 changes by compiling with NO_TYQUAD
-#defined. Otherwise, the new command-line option -!i8
-disables recognition of INTEGER*8.
- libf77: add pow_qq.c
- libi77: add #ifdef Allow_TYQUAD stuff. Changes for INTEGER*1,
-LOGICAL*1, and LOGICAL*2 came last 23 July 1992. Fix bug in
-backspace (that only bit when the last character of the second
-or subsequent buffer read was the previous newline). Guard
-against L_tmpnam being too small in endfile.c. For MSDOS,
-close and reopen files when copying to truncate. Lengthen
-LINTW (buffer size in lwrite.c).
- Add \ to the end of #define lines that get broken.
- Fix bug in handling NAMELIST of items in EQUIVALENCE.
- Under -h (or -hd), convert Hollerith to integer in general expressions
-(e.g., assignments), not just when they're passed as arguments, and
-blank-pad rather than 0-pad the Hollerith to a multiple of
-sizeof(integer) or sizeof(doublereal).
- Add command-line option -s, which instructs f2c preserve multi-
-dimensional subscripts (by emitting and using appropriate #defines).
- Fix glitch (with default type inferences) in examples like
- call foo('abc')
- end
- subroutine foo(goo)
- end
-This gave two warning messages:
- Warning on line 4 of y.f: inconsistent calling sequences for foo:
- here 1, previously 2 args and string lengths.
- Warning on line 4 of y.f: inconsistent calling sequences for foo:
- here 2, previously 1 args and string lengths.
-Now the second Warning is suppressed.
- Complain about all inconsistent arguments, not just the first.
- Switch to automatic creation of "all from f2c/src". For folks
-getting f2c source via ftp, this means f2c/src/all.Z is now an
-empty file rather than a bundle.
- Separate -P and -A: -P no longer implies -A.
-
-Thu Feb 4 00:32:20 EST 1993:
- Fix some glitches (introduced yesterday) with -h .
-
-Fri Feb 5 01:40:38 EST 1993:
- Fix bug in types conveyed for namelists (introduced 3 Feb. 1993).
-
-Fri Feb 5 21:26:43 EST 1993:
- libi77: tweaks to NAMELIST and open (after comments by Harold
-Youngren):
- 1. Reading a ? instead of &name (the start of a namelist) causes
- the namelist being sought to be written to stdout (unit 6);
- to omit this feature, compile rsne.c with -DNo_Namelist_Questions.
- 2. Reading the wrong namelist name now leads to an error message
- and an attempt to skip input until the right namelist name is found;
- to omit this feature, compile rsne.c with -DNo_Bad_Namelist_Skip.
- 3. Namelist writes now insert newlines before each variable; to omit
- this feature, compile xwsne.c with -DNo_Extra_Namelist_Newlines.
- 4. For OPEN of sequential files, ACCESS='APPEND' (or
- access='anything else starting with "A" or "a"') causes the file to
- be positioned at end-of-file, so a write will append to the file.
- (This is nonstandard, but does not require modifying data
- structures.)
-
-Mon Feb 8 14:40:37 EST 1993:
- Increase number of continuation lines allowed from 19 to 99,
-and allow changing this limit with -NC (e.g. -NC200 for 200 lines).
- Treat control-Z (at the beginning of a line) as end-of-file: see
-the new penultimate paragraph of README.
- Fix a rarely seen glitch that could make an error messages to say
-"line 0".
-
-Tue Feb 9 02:05:40 EST 1993
- libi77: change some #ifdef MSDOS lines to #ifdef NON_UNIX_STDIO,
-and, in err.c under NON_UNIX_STDIO, avoid close(creat(name,0666))
-when the unit has another file descriptor for name.
-
-Tue Feb 9 17:12:49 EST 1993
- libi77: more tweaks for NON_UNIX_STDIO: use stdio routines
-rather than open, close, creat, seek, fdopen (except for f__isdev).
-
-Fri Feb 12 15:49:33 EST 1993
- Update src/gram.c (which was forgotten in the recent updates).
-Most folks regenerate it anyway (wity yacc or bison).
-
-Thu Mar 4 17:07:38 EST 1993
- Increase default max labels in computed gotos and alternate returns
-to 257, and allow -Nl1234 to specify this number.
- Tweak put.c to check p->tag == TADDR in realpart() and imagpart().
- Adjust fc script to allow .r (RATFOR) files and -C (check subscripts).
- Avoid declaring strchr in niceprintf.c under -DANSI_Libraries .
- gram.c updated again.
- libi77: err.c, open.c: take declaration of fdopen from rawio.h.
-
-Sat Mar 6 07:09:11 EST 1993
- libi77: uio.c: adjust off-end-of-record test for sequential
-unformatted reads to respond to err= rather than end= .
-
-Sat Mar 6 16:12:47 EST 1993
- Treat scalar arguments of the form (v) and v+0, where v is a variable,
-as expressions: assign to a temporary variable, and pass the latter.
- gram.c updated.
-
-Mon Mar 8 09:35:38 EST 1993
- "f2c.h from f2c" updated to add types logical1 and integer1 for
-LOGICAL*1 and INTEGER*1. ("f2c.h from f2c" is supposed to be the
-same as "f2c.h from f2c/src", which was updated 3 Feb. 1993.)
-
-Mon Mar 8 17:57:55 EST 1993
- Fix rarely seen bug that could cause strange casts in function
-invocations (revealed by an example with msdos/f2c.exe).
- msdos/f2cx.exe.Z and msdos/f2c.exe.Z updated (ftp access only).
-
-Fri Mar 12 12:37:01 EST 1993
- Fix bug with -s in handling subscripts involving min, max, and
-complicated expressions requiring temporaries.
- Fix bug in handling COMMONs that need padding by a char array.
- msdos/f2cx.exe.Z and msdos/f2c.exe.Z updated (ftp access only).
-
-Fri Mar 12 17:16:16 EST 1993
- libf77, libi77: updated for compiling under C++.
-
-Mon Mar 15 16:21:37 EST 1993
- libi77: more minor tweaks (for -DKR_headers); Version.c not changed.
-
-Thu Mar 18 12:37:30 EST 1993
- Flag -r (for discarding carriage-returns on systems that end lines
-with carriage-return/newline pairs, e.g. PCs) added to xsum, and
-xsum.c converted to ANSI/ISO syntax (with K&R syntax available with
--DKR_headers). [When time permits, the f2c source will undergo a
-similar conversion.]
- libi77: tweaks to #includes in endfile.c, err.c, open.c, rawio.h;
-Version.c not changed.
- f2c.ps updated (to pick up revision of 2 Feb. 1993 to f2c.1).
-
-Fri Mar 19 09:19:26 EST 1993
- libi77: add (char *) casts to malloc and realloc invocations
-in err.c, open.c; Version.c not changed.
-
-Tue Mar 30 07:17:15 EST 1993
- Fix bug introduced 6 March 1993: possible memory corruption when
-loops in data statements involve constant subscripts, as in
- DATA (GUNIT(1,I),I=0,14)/15*-1/
-
-Tue Mar 30 16:17:42 EST 1993
- Fix bug with -s: (floating-point array item)*(complex item)
-generates an _subscr() reference for the floating-point array,
-but a #define for the _subscr() was omitted.
-
-Tue Apr 6 12:11:22 EDT 1993
- libi77: adjust error returns for formatted inputs to flush the current
-input line when err= is specified. To restore the old behavior (input
-left mid-line), either adjust the #definition of errfl in fio.h or omit
-the invocation of f__doend in err__fl (in err.c).
-
-Tue Apr 6 13:30:04 EDT 1993
- Fix bug revealed in
- subroutine foo(i)
- call goo(int(i))
- end
-which now passes a copy of i, rather than i itself.
-
-Sat Apr 17 11:41:02 EDT 1993
- Adjust appending of underscores to conform with f2c.ps ("A Fortran
-to C Converter"): names that conflict with C keywords or f2c type
-names now have just one underscore appended (rather than two); add
-"integer1", "logical1", "longint" to the keyword list.
- Append underscores to names that appear in EQUIVALENCE and are
-component names in a structure declared in f2c.h, thus avoiding a
-problem caused by the #defines emitted for equivalences. Example:
- complex a
- equivalence (i,j)
- a = 1 ! a.i went awry because of #define i
- j = 2
- write(*,*) a, i
- end
- Adjust line-breaking logic to avoid splitting very long constants
-(and names). Example:
- ! The next line starts with tab and thus is a free-format line.
- a=.012345689012345689012345689012345689012345689012345689012345689012345689
- end
- Omit extraneous "return 0;" from entry stubs emitted for multiple
-entry points of type character, complex, or double complex.
-
-Sat Apr 17 14:35:05 EDT 1993
- Fix bug (introduced 4 Feb.) in separating -P from -A that kept f2c
-from re-reading a .P file written without -A or -C++ describing a
-routine with an external argument. [See the just-added note about
-separating -P from -A in the changes above for 3 Feb. 1993.]
- Fix bug (type UNKNOWN for V in the example below) revealed by
- subroutine a()
- external c
- call b(c)
- end
- subroutine b(v)
- end
-
-Sun Apr 18 19:55:26 EDT 1993
- Fix wrong calling sequence for mem() in yesterday's addition to
-equiv.c .
-
-Wed Apr 21 17:39:46 EDT 1993
- Fix bug revealed in
-
- ASSIGN 10 TO L1
- GO TO 20
- 10 ASSIGN 30 TO L2
- STOP 10
-
- 20 ASSIGN 10 TO L2 ! Bug here because 10 had been assigned
- ! to another label, then defined.
- GO TO L2
- 30 END
-
-Fri Apr 23 18:38:50 EDT 1993
- Fix bug with -h revealed in
- CHARACTER*9 FOO
- WRITE(FOO,'(I6)') 1
- WRITE(FOO,'(I6)') 2 ! struct icilist io___3 botched
- END
-
-Tue Apr 27 16:08:28 EDT 1993
- Tweak to makefile: remove "size f2c".
-
-Tue May 4 23:48:20 EDT 1993
- libf77: tweak signal_ line of f2ch.add .
-
-Tue Jun 1 13:47:13 EDT 1993
- Fix bug introduced 3 Feb. 1993 in handling multiple entry
-points with differing return types -- the postfix array in proc.c
-needed a new entry for integer*8 (which resulted in wrong
-Multitype suffixes for non-integral types).
- For (default) K&R C, generate VOID rather than int functions for
-functions of Fortran type character, complex, and double complex.
- msdos/f2cx.exe.Z and msdos/f2c.exe.Z updated (ftp access only).
-
-Tue Jun 1 23:11:15 EDT 1993
- f2c.h: add Multitype component g and commented type longint.
- proc.c: omit "return 0;" from stubs for complex and double complex
-entries (when entries have multiple types); add test to avoid memory
-fault with illegal combinations of entry types.
-
-Mon Jun 7 12:00:47 EDT 1993
- Fix memory fault in
- common /c/ m
- integer m(1)
- data m(1)/1/, m(2)/2/ ! one too many initializers
- end
- msdos/f2cx.exe.Z and msdos/f2c.exe.Z updated (ftp access only).
-
-Fri Jun 18 13:55:51 EDT 1993
- libi77: change type of signal_ in f2ch.add; change type of il in
-union Uint from long to integer (for machines like the DEC Alpha,
-where integer should be the same as int). Version.c not changed.
- Tweak gram.dcl and gram.head: add semicolons after some rules that
-lacked them, and remove an extraneous semicolon. These changes are
-completely transparent to our local yacc programs, but apparently
-matter on some VMS systems.
-
-Wed Jun 23 01:02:56 EDT 1993
- Update "fc" shell script, and bring f2c.1 and f2c.1t up to date:
-they're meant to be linked with (i.e., the same as) src/f2c.1 and
-src/f2c.1t . [In the last update of f2c.1* (2 Feb. 1993), only
-src/f2c.1 and src/f2c.1t got changed -- a mistake.]
-
-Wed Jun 23 09:04:31 EDT 1993
- libi77: fix bug in format reversions for internal writes.
-Example:
- character*60 lines(2)
- write(lines,"('n =',i3,2(' more text',i3))") 3, 4, 5, 6
- write(*,*) 'lines(1) = ', lines(1)
- write(*,*) 'lines(2) = ', lines(2)
- end
-gave an error message that began "iio: off end of record", rather
-than giving the correct output:
-
- lines(1) = n = 3 more text 4 more text 5
- lines(2) = more text 6 more text
-
-Thu Aug 5 11:31:14 EDT 1993
- libi77: lread.c: fix bug in handling repetition counts for logical
-data (during list or namelist input). Change struct f__syl to
-struct syl (for buggy compilers).
-
-Sat Aug 7 16:05:30 EDT 1993
- libi77: lread.c (again): fix bug in namelist reading of incomplete
-logical arrays.
- Fix minor calling-sequence errors in format.c, output.c, putpcc.c:
-should be invisible.
-
-Mon Aug 9 09:12:38 EDT 1993
- Fix erroneous cast under -A in translating
- character*(*) function getc()
- getc(2:3)=' ' !wrong cast in first arg to s_copy
- end
- libi77: lread.c: fix bug in namelist reading of an incomplete array
-of numeric data followed by another namelist item whose name starts
-with 'd', 'D', 'e', or 'E'.
-
-Fri Aug 20 13:22:10 EDT 1993
- Fix bug in do while revealed by
- subroutine skdig (line, i)
- character line*(*), ch*1
- integer i
- logical isdigit
- isdigit(ch) = ch.ge.'0' .and. ch.le.'9'
- do while (isdigit(line(i:i))) ! ch__1[0] was set before
- ! "while(...) {...}"
- i = i + 1
- enddo
- end
-
-Fri Aug 27 08:22:54 EDT 1993
- Add #ifdefs to avoid declaring atol when it is a macro; version.c
-not updated.
-
-Wed Sep 8 12:24:26 EDT 1993
- libi77: open.c: protect #include "sys/..." with
-#ifndef NON_UNIX_STDIO; Version date not changed.
-
-Thu Sep 9 08:51:21 EDT 1993
- Adjust "include" to interpret file names relative to the directory
-of the file that contains the "include".
-
-Fri Sep 24 00:56:12 EDT 1993
- Fix offset error resulting from repeating the same equivalence
-statement twice. Example:
- real a(2), b(2)
- equivalence (a(2), b(2))
- equivalence (a(2), b(2))
- end
- Increase MAXTOKENLEN (to roughly the largest allowed by ANSI C).
-
-Mon Sep 27 08:55:09 EDT 1993
- libi77: endfile.c: protect #include "sys/types.h" with
-#ifndef NON_UNIX_STDIO; Version.c not changed.
-
-Fri Oct 15 15:37:26 EDT 1993
- Fix rarely seen parsing bug illustrated by
- subroutine foo(xabcdefghij)
- character*(*) xabcdefghij
- IF (xabcdefghij.NE.'##') GOTO 40
- 40 end
-in which the spacing in the IF line is crucial.
-
-Thu Oct 21 13:55:11 EDT 1993
- Give more meaningful error message (then "unexpected character in
-cds") when constant simplification leads to Infinity or NaN.
-
-Wed Nov 10 15:01:05 EST 1993
- libi77: backspace.c: adjust, under -DMSDOS, to cope with MSDOS
-text files, as handled by some popular PC C compilers. Beware:
-the (defective) libraries associated with these compilers assume lines
-end with \r\n (conventional MS-DOS text files) -- and ftell (and
-hence the current implementation of backspace) screws up if lines with
-just \n.
-
-Thu Nov 18 09:37:47 EST 1993
- Give a better error (than "control stack empty") for an extraneous
-ENDDO. Example:
- enddo
- end
- Update comments about ftp in "readme from f2c".
-
-Sun Nov 28 17:26:50 EST 1993
- Change format of time stamp in version.c to yyyymmdd.
- Sort parameter adjustments (or complain of impossible dependencies)
-so that dummy arguments are referenced only after being adjusted.
-Example:
- subroutine foo(a,b)
- integer a(2) ! a must be adjusted before b
- double precision b(a(1),a(2))
- call goo(b(3,4))
- end
- Adjust structs for initialized common blocks and equivalence classes
-to omit the trailing struct component added to force alignment when
-padding already forces the desired alignment. Example:
- PROGRAM TEST
- COMMON /Z/ A, CC
- CHARACTER*4 CC
- DATA cc /'a'/
- END
-now gives
- struct {
- integer fill_1[1];
- char e_2[4];
- } z_ = { {0}, {'a', ' ', ' ', ' '} };
-rather than
-struct {
- integer fill_1[1];
- char e_2[4];
- real e_3;
- } z_ = { {0}, {'a', ' ', ' ', ' '}, (float)0. };
-
-Wed Dec 8 16:24:43 EST 1993
- Adjust lex.c to recognize # nnn "filename" lines emitted by cpp;
-this affects the file names and line numbers in error messages and
-the #line lines emitted under -g.
- Under -g, arrange for a file that starts with an executable
-statement to have the first #line line indicate line 1, rather
-than the line number of the END statement ending the main program.
- Adjust fc script to run files ending in .F through /lib/cpp.
- Fix bug ("Impossible tag 2") in
- if (t .eq. (0,2)) write(*,*) 'Bug!'
- end
- libi77: iio.c: adjust internal formatted reads to treat short records
-as though padded with blanks (rather than causing an "off end of record"
-error).
-
-Wed Dec 15 15:19:15 EST 1993
- fc: adjusted for .F files to pass -D and -I options to cpp.
-
-Fri Dec 17 20:03:38 EST 1993
- Fix botch introduced 28 Nov. 1993 in vax.c; change "version of"
-to "version".
-
-Tue Jan 4 15:39:52 EST 1994
- msdos/f2cx.exe.Z and msdos/f2c.exe.Z updated (ftp access only).
-
-Wed Jan 19 08:55:19 EST 1994
- Arrange to accept
- integer Nx, Ny, Nz
- parameter (Nx = 10, Ny = 20)
- parameter (Nz = max(Nx, Ny))
- integer c(Nz)
- call foo(c)
- end
-rather than complaining "Declaration error for c: adjustable dimension
-on non-argument". The necessary changes cause some hitherto unfolded
-constant expressions to be folded.
- Accept BYTE as a synonym for INTEGER*1.
-
-Thu Jan 27 08:57:40 EST 1994
- Fix botch in changes of 19 Jan. 1994 that broke entry points with
-multi-dimensional array arguments that did not appear in the subprogram
-argument list and whose leading dimensions depend on arguments.
-
-Mon Feb 7 09:24:30 EST 1994
- Remove artifact in "fc" script that caused -O to be ignored:
- 87c87
- < # lcc ignores -O...
- ---
- > CFLAGS="$CFLAGS $O"
-
-Sun Feb 20 17:04:58 EST 1994
- Fix bugs reading .P files for routines with arguments of type
-INTEGER*1, INTEGER*8, LOGICAL*2.
- Fix glitch in reporting inconsistent arguments for routines involving
-character arguments: "arg n" had n too large by the number of
-character arguments.
-
-Tue Feb 22 20:50:08 EST 1994
- Trivial changes to data.c format.c main.c niceprintf.c output.h and
-sysdep.h (consistency improvements).
- libI77: lread.c: check for NULL return from realloc.
-
-Fri Feb 25 23:56:08 EST 1994
- output.c, sysdep.h: arrange for -DUSE_DTOA to use dtoa.c and g_fmt.c
-for correctly rounded decimal values on IEEE-arithmetic machines
-(plus machines with VAX and IBM-mainframe arithmetic). These
-routines are available from netlib's fp directory.
- msdos/f2cx.exe.Z and msdos/f2c.exe.Z updated (ftp access only); the
-former uses -DUSE_DTOA to keep 12 from printing as 12.000000000000001.
- vax.c: fix wrong arguments to badtag and frchain introduced
-28 Nov. 1993.
- Source for f2c converted to ANSI/ISO format, with the K&R format
-available by compilation with -DKR_headers .
- Arrange for (double precision expression) relop (single precision
-constant) to retain the single-precision nature of the constant.
-Example:
- double precision t
- if (t .eq. 0.3) ...
-
-Mon Feb 28 11:40:24 EST 1994
- README updated to reflect a modification just made to netlib's
-"dtoa.c from fp":
-96a97,105
-> Also add the rule
->
-> dtoa.o: dtoa.c
-> $(CC) -c $(CFLAGS) -DMALLOC=ckalloc -DIEEE... dtoa.c
->
-> (without the initial tab) to the makefile, where IEEE... is one of
-> IEEE_MC68k, IEEE_8087, VAX, or IBM, depending on your machine's
-> arithmetic. See the comments near the start of dtoa.c.
->
-
-Sat Mar 5 09:41:52 EST 1994
- Complain about functions with the name of a previously declared
-common block (which is illegal).
- New option -d specifies the directory for output .c and .P files;
-f2c.1 and f2c.1t updated. The former undocumented debug option -dnnn
-is now -Dnnn.
-
-Thu Mar 10 10:21:44 EST 1994
- libf77: add #undef min and #undef max lines to s_paus.c s_stop.c
-and system_.c; Version.c not changed.
- libi77: add -DPad_UDread lines to uio.c and explanation to README:
- Some buggy Fortran programs use unformatted direct I/O to write
- an incomplete record and later read more from that record than
- they have written. For records other than the last, the unwritten
- portion of the record reads as binary zeros. The last record is
- a special case: attempting to read more from it than was written
- gives end-of-file -- which may help one find a bug. Some other
- Fortran I/O libraries treat the last record no differently than
- others and thus give no help in finding the bug of reading more
- than was written. If you wish to have this behavior, compile
- uio.c with -DPad_UDread .
-Version.c not changed.
-
-Tue Mar 29 17:27:54 EST 1994
- Adjust make_param so dimensions involving min, max, and other
-complicated constant expressions do not provoke error messages
-about adjustable dimensions on non-arguments.
- Fix botch introduced 19 Jan 1994: "adjustable dimension on non-
-argument" messages could cause some things to be freed twice.
-
-Tue May 10 07:55:12 EDT 1994
- Trivial changes to exec.c, p1output.c, parse_args.c, proc.c,
-and putpcc.c: change arguments from
- type foo[]
-to
- type *foo
-for consistency with defs.h. For most compilers, this makes no
-difference.
-
-Thu Jun 2 12:18:18 EDT 1994
- Fix bug in handling FORMAT statements that have adjacent character
-(or Hollerith) strings: an extraneous \002 appeared between the
-strings.
- libf77: under -DNO_ONEXIT, arrange for f_exit to be called just
-once; previously, upon abnormal termination (including stop statements),
-it was called twice.
-
-Mon Jun 6 15:52:57 EDT 1994
- libf77: Avoid references to SIGABRT and SIGIOT if neither is defined;
-Version.c not changed.
- libi77: Add cast to definition of errfl() in fio.h; this only matters
-on systems with sizeof(int) < sizeof(long). Under -DNON_UNIX_STDIO,
-use binary mode for direct formatted files (to avoid any confusion
-connected with \n characters).
-
-Fri Jun 10 16:47:31 EDT 1994
- Fix bug under -A in handling unreferenced (and undeclared)
-external arguments in subroutines with multiple entry points. Example:
- subroutine m(fcn,futil)
- external fcn,futil
- call fcn
- entry mintio(i1) ! (D_fp)0 rather than (U_fp)0 for futil
- end
-
-Wed Jun 15 10:38:14 EDT 1994
- Allow char(constant expression) function in parameter declarations.
-(This was probably broken in the changes of 29 March 1994.)
-
-Fri Jul 1 23:54:00 EDT 1994
- Minor adjustments to makefile (rule for f2c.1 commented out) and
-sysdep.h (#undef KR_headers if __STDC__ is #defined, and base test
-for ANSI_Libraries and ANSI_Prototypes on KR_headers rather than
-__STDC__); version.c touched but not changed.
- libi77: adjust fp.h so local.h is only needed under -DV10;
-Version.c not changed.
-
-Tue Jul 5 03:05:46 EDT 1994
- Fix segmentation fault in
- subroutine foo(a,b,k)
- data i/1/
- double precision a(k,1) ! sequence error: must precede data
- b = a(i,1)
- end
- libi77: Fix bug (introduced 6 June 1994?) in reopening files under
-NON_UNIX_STDIO.
- Fix some error messages caused by illegal Fortran. Examples:
-* 1.
- x(i) = 0 !Missing declaration for array x
- call f(x) !Said Impossible storage class 8 in routine mkaddr
- end !Now says invalid use of statement function x
-* 2.
- f = g !No declaration for g; by default it's a real variable
- call g !Said invalid class code 2 for function g
- end !Now says g cannot be called
-* 3.
- intrinsic foo !Invalid intrinsic name
- a = foo(b) !Said intrcall: bad intrgroup 0
- end !Now just complains about line 1
-
-Tue Jul 5 11:14:26 EDT 1994
- Fix glitch in handling erroneous statement function declarations.
-Example:
- a(j(i) - i) = a(j(i) - i) + 1 ! bad statement function
- call foo(a(3)) ! Said Impossible type 0 in routine mktmpn
- end ! Now warns that i and j are not used
-
-Wed Jul 6 17:31:25 EDT 1994
- Tweak test for statement functions that (illegally) call themselves;
-f2c will now proceed to check for other errors, rather than bailing
-out at the first recursive statement function reference.
- Warn about but retain divisions by 0 (instead of calling them
-"compiler errors" and quiting). On IEEE machines, this permits
- double precision nan, ninf, pinf
- nan = 0.d0/0.d0
- pinf = 1.d0/0.d0
- ninf = -1.d0/0.d0
- write(*,*) 'nan, pinf, ninf = ', nan, pinf, ninf
- end
-to print
- nan, pinf, ninf = NaN Infinity -Infinity
- libi77: wref.c: protect with #ifdef GOOD_SPRINTF_EXPONENT an
-optimization that requires exponents to have 2 digits when 2 digits
-suffice. lwrite.c wsfe.c (list and formatted external output):
-omit ' ' carriage-control when compiled with -DOMIT_BLANK_CC .
-Off-by-one bug fixed in character count for list output of character
-strings. Omit '.' in list-directed printing of Nan, Infinity.
-
-Mon Jul 11 13:05:33 EDT 1994
- src/gram.c updated.
-
-Tue Jul 12 10:24:42 EDT 1994
- libi77: wrtfmt.c: under G11.4, write 0. as " .0000 " rather
-than " .0000E+00".
-
-Thu Jul 14 17:55:46 EDT 1994
- Fix glitch in changes of 6 July 1994 that could cause erroneous
-"division by zero" warnings (or worse). Example:
- subroutine foo(a,b)
- y = b
- a = a / y ! erroneous warning of division by zero
- end
-
-Mon Aug 1 16:45:17 EDT 1994
- libi77: lread.c rsne.c: for benefit of systems with a buggy stdio.h,
-declare ungetc when neither KR_headers nor ungetc is #defined.
-Version.c not changed.
-
-Wed Aug 3 01:53:00 EDT 1994
- libi77: lwrite.c (list output): do not insert a newline when
-appending an oversize item to an empty line.
-
-Mon Aug 8 00:51:01 EDT 1994
- Fix bug (introduced 3 Feb. 1993) that, under -i2, kept LOGICAL*2
-variables from appearing in INQUIRE statements. Under -I2, allow
-LOGICAL*4 variables to appear in INQUIRE. Fix intrinsic function
-LEN so it returns a short value under -i2, a long value otherwise.
- exec.c: fix obscure memory fault possible with bizarre (and highly
-erroneous) DO-loop syntax.
-
-Fri Aug 12 10:45:57 EDT 1994
- libi77: fix glitch that kept ERR= (in list- or format-directed input)
-from working after a NAMELIST READ.
-
-Thu Aug 25 13:58:26 EDT 1994
- Suppress -s when -C is specified.
- Give full pathname (netlib@research.att.com) for netlib in readme and
-src/README.
-
-Wed Sep 7 22:13:20 EDT 1994
- libi77: typesize.c: adjust to allow types LOGICAL*1, LOGICAL*2,
-INTEGER*1, and (under -DAllow_TYQUAD) INTEGER*8 in NAMELISTs.
-
-Fri Sep 16 17:50:18 EDT 1994
- Change name adjustment for reserved words: instead of just appending
-"_" (a single underscore), append "_a_" to local variable names to avoid
-trouble when a common block is named a reserved word and the same
-reserved word is also a local variable name. Example:
- common /const/ a,b,c
- real const(3)
- equivalence (const(1),a)
- a = 1.234
- end
- Arrange for ichar() to treat characters as unsigned.
- libf77: s_cmp.c: treat characters as unsigned in comparisons.
-These changes for unsignedness only matter for strings that contain
-non-ASCII characters. Now ichar() should always be >= 0.
-
-Sat Sep 17 11:19:32 EDT 1994
- fc: set rc=$? before exit (to get exit code right in trap code).
-
-Mon Sep 19 17:49:43 EDT 1994
- libf77: s_paus.c: flush stderr after PAUSE; add #ifdef MSDOS stuff.
- libi77: README: point out general need for -DMSDOS under MS-DOS.
-
-Tue Sep 20 11:42:30 EDT 1994
- Fix bug in comparing identically named common blocks, in which
-all components have the same names and types, but at least one is
-dimensioned (1) and the other is not dimensioned. Example:
- subroutine foo
- common /ab/ a
- a=1. !!! translated correctly to ab_1.a = (float)1.;
- end
- subroutine goo
- common /ab/ a(1)
- a(1)=2. !!! translated erroneously to ab_1.a[0] = (float)2.
- end
-
-Tue Sep 27 23:47:34 EDT 1994
- Fix bug introduced 16 Sept. 1994: don't add _a_ to C keywords
-used as external names. In fact, return to earlier behavior of
-appending __ to C keywords unless they are used as external names,
-in which case they get just one underscore appended.
- Adjust constant handling so integer and logical PARAMETERs retain
-type information, particularly under -I2. Example:
- SUBROUTINE FOO
- INTEGER I
- INTEGER*1 I1
- INTEGER*2 I2
- INTEGER*4 I4
- LOGICAL L
- LOGICAL*1 L1
- LOGICAL*2 L2
- LOGICAL*4 L4
- PARAMETER (L=.FALSE., L1=.FALSE., L2=.FALSE., L4=.FALSE.)
- PARAMETER (I=0,I1=0,I2=0,I4=0)
- CALL DUMMY(I, I1, I2, I4, L, L1, L2, L4)
- END
- f2c.1t: Change f\^2c to f2c (omit half-narrow space) in line following
-".SH NAME" for benefit of systems that cannot cope with troff commands
-in this context.
-
-Wed Sep 28 12:45:19 EDT 1994
- libf77: s_cmp.c fix glitch in -DKR_headers version introduced
-12 days ago.
-
-Thu Oct 6 09:46:53 EDT 1994
- libi77: util.c: omit f__mvgbt (which is never used).
- f2c.h: change "long" to "long int" to facilitate the adjustments
-by means of sed described above. Comment out unused typedef of Long.
-
-Fri Oct 21 18:02:24 EDT 1994
- libf77: add s_catow.c and adjust README to point out that changing
-"s_cat.o" to "s_catow.o" in the makefile will permit the target of a
-concatenation to appear on its right-hand side (contrary to the
-Fortran 77 Standard and at the cost of some run-time efficiency).
-
-Wed Nov 2 00:03:58 EST 1994
- Adjust -g output to contain only one #line line per statement,
-inserting \ before the \n ending lines broken because of their
-length [this insertion was recanted 10 Dec. 1994]. This change
-accommodates an idiocy in the ANSI/ISO C standard, which leaves
-undefined the behavior of #line lines that occur within the arguments
-to a macro call.
-
-Wed Nov 2 14:44:27 EST 1994
- libi77: under compilation with -DALWAYS_FLUSH, flush buffers at
-the end of each write statement, and test (via the return from
-fflush) for write failures, which can be caught with an ERR=
-specifier in the write statement. This extra flushing slows
-execution, but can abort execution or alter the flow of control
-when a disk fills up.
- f2c/src/io.c: Add ERR= test to e_wsle invocation (end of
-list-directed external output) to catch write failures when libI77
-is compiled with -DALWAYS_FLUSH.
-
-Thu Nov 3 10:59:13 EST 1994
- Fix bug in handling dimensions involving certain intrinsic
-functions of constant expressions: the expressions, rather than
-pointers to them, were passed. Example:
- subroutine subtest(n,x)
- real x(2**n,n) ! pow_ii(2,n) was called; now it's pow_ii(&c__2,n)
- x(2,2)=3.
- end
-
-Tue Nov 8 23:56:30 EST 1994
- malloc.c: remove assumption that only malloc calls sbrk. This
-appears to make malloc.c useful on RS6000 systems.
-
-Sun Nov 13 13:09:38 EST 1994
- Turn off constant folding of integers used in floating-point
-expressions, so the assignment in
- subroutine foo(x)
- double precision x
- x = x*1000000*500000
- end
-is rendered as
- *x = *x * 1000000 * 500000;
-rather than as
- *x *= 1783793664;
-
-Sat Dec 10 16:31:40 EST 1994
- Supply a better error message (than "Impossible type 14") for
- subroutine foo
- foo = 3
- end
- Under -g, convey name of included files to #line lines.
- Recant insertion of \ introduced (under -g) 2 Nov. 1994.
-
-Thu Dec 15 14:33:55 EST 1994
- New command-line option -Idir specifies directories in which to
-look for non-absolute include files (after looking in the directory
-of the current input file). There can be several -Idir options, each
-specifying one directory. All -Idir options are considered, from
-left to right, until a suitably named file is found. The -I2 and -I4
-command-line options have precedence, so directories named 2 or 4
-must be spelled by some circumlocation, such as -I./2 .
- f2c.ps updated to mention the new -Idir option, correct a typo,
-and bring the man page at the end up to date.
- lex.c: fix bug in reading line numbers in #line lines.
- fc updated to pass -Idir options to f2c.
-
-Thu Dec 29 09:48:03 EST 1994
- Fix bug (e.g., addressing fault) in diagnosing inconsistency in
-the type of function eta in the following example:
- function foo(c1,c2)
- double complex foo,c1,c2
- double precision eta
- foo = eta(c1,c2)
- end
- function eta(c1,c2)
- double complex eta,c1,c2
- eta = c1*c2
- end
-
-Mon Jan 2 13:27:26 EST 1995
- Retain casts for SNGL (or FLOAT) that were erroneously optimized
-away. Example:
- subroutine foo(a,b)
- double precision a,b
- a = float(b) ! now rendered as *a = (real) (*b);
- end
- Use float (rather than double) temporaries in certain expressions
-of type complex. Example: the temporary for sngl(b) in
- complex a
- double precision b
- a = sngl(b) - (3.,4.)
-is now of type float.
-
-Fri Jan 6 00:00:27 EST 1995
- Adjust intrinsic function cmplx to act as dcmplx (returning
-double complex rather than complex) if either of its args is of
-type double precision. The double temporaries used prior to 2 Jan.
-1995 previously gave it this same behavior.
-
-Thu Jan 12 12:31:35 EST 1995
- Adjust -krd to use double temporaries in some calculations of
-type complex.
- libf77: pow_[dhiqrz][hiq].c: adjust x**i to work on machines
-that sign-extend right shifts when i is the most negative integer.
-
-Wed Jan 25 00:14:42 EST 1995
- Fix memory fault in handling overlapping initializations in
- block data
- common /zot/ d
- double precision d(3)
- character*6 v(4)
- real r(2)
- equivalence (d(3),r(1)), (d(1),v(1))
- data v/'abcdef', 'ghijkl', 'mnopqr', 'stuvwx'/
- data r/4.,5./
- end
- names.c: add "far", "huge", "near" to c_keywords (causing them
-to have __ appended when used as local variables).
- libf77: add s_copyow.c, an alternative to s_copy.c for handling
-(illegal) character assignments where the right- and left-hand
-sides overlap, as in a(2:4) = a(1:3).
-
-Thu Jan 26 14:21:19 EST 1995
- libf77: roll s_catow.c and s_copyow.c into s_cat.c and s_copy.c,
-respectively, allowing the left-hand side of a character assignment
-to appear on its right-hand side unless s_cat.c and s_copy.c are
-compiled with -DNO_OVERWRITE (which is a bit more efficient).
-Fortran 77 forbids the left-hand side from participating in the
-right-hand side (of a character assignment), but Fortran 90 allows it.
- libi77: wref.c: fix glitch in printing the exponent of 0 when
-GOOD_SPRINTF_EXPONENT is not #defined.
-
-Fri Jan 27 12:25:41 EST 1995
- Under -C++ -ec (or -C++ -e1c), surround struct declarations with
- #ifdef __cplusplus
- extern "C" {
- #endif
-and
- #ifdef __cplusplus
- }
- #endif
-(This isn't needed with cfront, but apparently is necessary with
-some other C++ compilers.)
- libf77: minor tweak to s_copy.c: copy forward whenever possible
-(for better cache behavior).
-
-Wed Feb 1 10:26:12 EST 1995
- Complain about parameter statements that assign values to dummy
-arguments, as in
- subroutine foo(x)
- parameter(x = 3.4)
- end
-
-Sat Feb 4 20:22:02 EST 1995
- fc: omit "lib=/lib/num/lib.lo".
-
-Wed Feb 8 08:41:14 EST 1995
- Minor changes to exec.c, putpcc.c to avoid "bad tag" or "error
-in frexpr" with certain invalid Fortran.
-
-Sat Feb 11 08:57:39 EST 1995
- Complain about integer overflows, both in simplifying integer
-expressions, and in converting integers from decimal to binary.
- Fix a memory fault in putcx1() associated with invalid input.
-
-Thu Feb 23 11:20:59 EST 1995
- Omit MAXTOKENLEN; realloc token if necessary (to handle very long
-strings).
-
-Fri Feb 24 11:02:00 EST 1995
- libi77: iio.c: z_getc: insert (unsigned char *) to allow internal
-reading of characters with high-bit set (on machines that sign-extend
-characters).
-
-Tue Mar 14 18:22:42 EST 1995
- Fix glitch (in io.c) in handling 0-length strings in format
-statements, as in
- write(*,10)
- 10 format(' ab','','cd')
- libi77: lread.c and rsfe.c: adjust s_rsle and s_rsfe to check for
-end-of-file (to prevent infinite loops with empty read statements).
-
-Wed Mar 22 10:01:46 EST 1995
- f2c.ps: adjust discussion of -P on p. 7 to reflect a change made
-3 Feb. 1993: -P no longer implies -A.
-
-Fri Apr 21 18:35:00 EDT 1995
- fc script: remove absolute paths (since PATH specifies only standard
-places). On most systems, it's still necessary to adjust the PATH
-assignment at the start of fc to fit the local conventions.
-
-Fri May 26 10:03:17 EDT 1995
- fc script: add recognition of -P and .P files.
- libi77: iio.c: z_wnew: fix bug in handling T format items in internal
-writes whose last item is written to an earlier position than some
-previous item.
-
-Wed May 31 11:39:48 EDT 1995
- libf77: added subroutine exit(rc) (with integer return code rc),
-which works like a stop statement but supplies rc as the program's
-return code.
-
-Fri Jun 2 11:56:50 EDT 1995
- Fix memory fault in
- parameter (x=2.)
- data x /2./
- end
-This now elicits two error messages; the second ("too many
-initializers"), though not desirable, seems hard to eliminate
-without considerable hassle.
-
-Mon Jul 17 23:24:20 EDT 1995
- Fix botch in simplifying constants in certain complex
-expressions. Example:
- subroutine foo(s,z)
- double complex z
- double precision s, M, P
- parameter ( M = 100.d0, P = 2.d0 )
- z = M * M / s * dcmplx (1.d0, P/M)
-*** The imaginary part of z was miscomputed ***
- end
- Under -ext, complain about nonintegral dimensions.
-
-Fri Jul 21 11:18:36 EDT 1995
- Fix glitch on line 159 of init.c: change
- "(shortlogical *)0)",
-to
- "(shortlogical *)0",
-This affects multiple entry points when some but not all have
-arguments of type logical*2.
- libi77: adjust lwrite.c, wref.c, wrtfmt.c so compiling with
--DWANT_LEAD_0 causes formatted writes of floating-point numbers of
-magnitude < 1 to have an explicit 0 before the decimal point (if the
-field-width permits it). Note that the Fortran 77 Standard leaves it
-up to the implementation whether to supply these superfluous zeros.
-
-Tue Aug 1 09:25:56 EDT 1995
- Permit real (or double precision) parameters in dimension expressions.
-
-Mon Aug 7 08:04:00 EDT 1995
- Append "_eqv" rather than just "_" to names that that appear in
-EQUIVALENCE statements as well as structs in f2c.h (to avoid a
-conflict when these names also name common blocks).
-
-Tue Aug 8 12:49:02 EDT 1995
- Modify yesterday's change: merge st_fields with c_keywords, to
-cope with equivalences introduced to permit initializing numeric
-variables with character data. DATA statements causing these
-equivalences can appear after executable statements, so the only
-safe course is to rename all local variable with names in the
-former st_fields list. This has the unfortunate side effect that
-the common local variable "i" will henceforth be renamed "i__".
-
-Wed Aug 30 00:19:32 EDT 1995
- libf77: add F77_aloc, now used in s_cat and system_ (to allocate
-memory and check for failure in so doing).
- libi77: improve MSDOS logic in backspace.c.
-
-Wed Sep 6 09:06:19 EDT 1995
- libf77: Fix return type of system_ (integer) under -DKR_headers.
- libi77: Move some f_init calls around for people who do not use
-libF77's main(); now open and namelist read statements that are the
-first I/O statements executed should work right in that context.
-Adjust namelist input to treat a subscripted name whose subscripts do
-not involve colons similarly to the name without a subscript: accept
-several values, stored in successive elements starting at the
-indicated subscript. Adjust namelist output to quote character
-strings (avoiding confusion with arrays of character strings).
-
-Thu Sep 7 00:36:04 EDT 1995
- Fix glitch in integer*8 exponentiation function: it's pow_qq, not
-pow_qi.
- libi77: fix some bugs with -DAllow_TYQUAD (for integer*8); when
-looking for the &name that starts NAMELIST input, treat lines whose
-first nonblank character is something other than &, $, or ? as
-comment lines (i.e., ignore them), unless rsne.c is compiled with
--DNo_Namelist_Comments.
-
-Thu Sep 7 09:05:40 EDT 1995
- libi77: rdfmt.c: one more tweak for -DAllow_TYQUAD.
-
-Tue Sep 19 00:03:02 EDT 1995
- Adjust handling of floating-point subscript bounds (a questionable
-f2c extension) so subscripts in the generated C are of integral type.
- Move #define of roundup to proc.c (where its use is commented out);
-version.c left at 19950918.
-
-Wed Sep 20 17:24:19 EDT 1995
- Fix bug in handling ichar() under -h.
-
-Thu Oct 5 07:52:56 EDT 1995
- libi77: wrtfmt.c: fix bug with t editing (f__cursor was not always
-zeroed in mv_cur).
-
-Tue Oct 10 10:47:54 EDT 1995
- Under -ext, warn about X**-Y and X**+Y. Following the original f77,
-f2c treats these as X**(-Y) and X**(+Y), respectively. (They are not
-allowed by the official Fortran 77 Standard.) Some Fortran compilers
-give a bizarre interpretation to larger contexts, making multiplication
-noncommutative: they treat X**-Y*Z as X**(-Y*Z) rather than X**(-Y)*Z,
-which, following the rules of Fortran 77, is the same as (X**(-Y))*Z.
-
-Wed Oct 11 13:27:05 EDT 1995
- libi77: move defs of f__hiwater, f__svic, f__icptr from wrtfmt.c
-to err.c. This should work around a problem with buggy loaders and
-sometimes leads to smaller executable programs.
-
-Sat Oct 21 23:54:22 EDT 1995
- Under -h, fix bug in the treatment of ichar('0') in arithmetic
-expressions.
- Demote to -dneg (a new command-line option not mentioned in the
-man page) imitation of the original f77's treatment of unary minus
-applied to a REAL operand (yielding a DOUBLE PRECISION result).
-Previously this imitation (which was present for debugging) occurred
-under (the default) -!R. It is still suppressed by -R.
-
-Tue Nov 7 23:52:57 EST 1995
- Adjust assigned GOTOs to honor SAVE declarations.
- Add comments about ranlib to lib[FI]77/README and makefile.
-
-Tue Dec 19 22:54:06 EST 1995
- libf77: s_cat.c: fix bug when 2nd or later arg overlaps lhs.
-
-Tue Jan 2 17:54:00 EST 1996
- libi77: rdfmt.c: move #include "ctype.h" up before "stdlib.h"; no
-change to Version.c.
-
-Sun Feb 25 22:20:20 EST 1996
- Adjust expr.c to permit raising the integer constants 1 and -1 to
-negative constant integral powers.
- Avoid faulting when -T and -d are not followed by a directory name
-(immediately, without intervening spaces).
-
-Wed Feb 28 12:49:01 EST 1996
- Fix a glitch in handling complex parameters assigned a "wrong" type.
-Example:
- complex d, z
- parameter(z = (0d0,0d0))
- data d/z/ ! elicited "non-constant initializer"
- call foo(d)
- end
-
-Thu Feb 29 00:53:12 EST 1996
- Fix bug in handling character parameters assigned a char() value.
-Example:
- character*2 b,c
- character*1 esc
- parameter(esc = char(27))
- integer i
- data (b(i:i),i=1,2)/esc,'a'/
- data (c(i:i),i=1,2)/esc,'b'/ ! memory fault
- call foo(b,c)
- end
-
-Fri Mar 1 23:44:51 EST 1996
- Fix glitch in evaluating .EQ. and .NE. when both operands are
-logical constants (.TRUE. or .FALSE.).
-
-Fri Mar 15 17:29:54 EST 1996
- libi77: lread.c, rsfe.c: honor END= in READ stmts with empty iolist.
-
-Tue Mar 19 23:08:32 EST 1996
- lex.c: arrange for a "statement" consisting of a single short bogus
-keyword to elicit an error message showing the whole keyword. The
-error message formerly omitted the last letter of the bad keyword.
- libf77: s_cat.c: supply missing break after overlap detection.
-
-Mon May 13 23:35:26 EDT 1996
- Recognize Fortran 90's /= as a synonym for .NE.. (<> remains a
-synonym for .NE..)
- Emit an empty int function of no arguments to supply an external
-name to named block data subprograms (so they can be called somewhere
-to force them to be loaded from a library).
- Fix bug (memory fault) in handling the following illegal Fortran:
- parameter(i=1)
- equivalence(i,j)
- end
- Treat cdabs, cdcos, cdexp, cdlog, cdsin, and cdsqrt as synonyms for
-the double complex intrinsics zabs, zcos, zexp, zlog, zsin, and zsqrt,
-respectively, unless -cd is specified.
- Recognize the Fortran 90 bit-manipulation intrinsics btest, iand,
-ibclr, ibits, ibset, ieor, ior, ishft, and ishftc, unless -i90 is
-specified. Note that iand, ieor, and ior are thus now synonyms for
-"and", "xor", and "or", respectively.
- Add three macros (bit_test, bit_clear, bit_set) to f2c.h for use
-with btest, ibclr, and ibset, respectively. Add new functions
-[lq]bit_bits, [lq]bit_shift, and [lq]_bit_cshift to libF77 for
-use with ibits, ishft, and ishftc, respectively.
- Add integer function ftell(unit) (returning -1 on error) and
-subroutine fseek(unit, offset, whence, *) to libI77 (with branch to
-label * on error).
-
-Tue May 14 23:21:12 EDT 1996
- Fix glitch (possible memory fault, or worse) in handling multiple
-entry points with names over 28 characters long.
-
-Mon Jun 10 01:20:16 EDT 1996
- Update netlib E-mail and ftp addresses in f2c/readme and
-f2c/src/readme (which are different files) -- to reflect the upcoming
-breakup of AT&T.
- libf77: trivial tweaks to F77_aloc.c and system_.c; Version.c not
-changed.
- libi77: Adjust rsli.c and lread.c so internal list input with too
-few items in the input string will honor end= .
-
-Mon Jun 10 22:59:57 EDT 1996
- Add Bits_per_Byte to sysdep.h and adjust definition of Table_size
-to depend on Bits_per_Byte (forcing Table_size to be a power of 2); in
-lex.c, change "comstart[c & 0xfff]" to "comstart[c & (Table_size-1)]"
-to avoid an out-of-range subscript on end-of-file.
-
-Wed Jun 12 00:24:28 EDT 1996
- Fix bug in output.c (dereferencing a freed pointer) revealed in
- print * !np in out_call in output.c clobbered by free
- end !during out_expr.
-
-Wed Jun 19 08:12:47 EDT 1996
- f2c.h: add types uinteger, ulongint (for libF77); add qbit_clear
-and qbit_set macros (in a commented-out section) for integer*8.
- For integer*8, use qbit_clear and qbit_set for ibclr and ibset.
- libf77: add casts to unsigned in [lq]bitshft.c.
-
-Thu Jun 20 13:30:43 EDT 1996
- Complain at character*(*) in common (rather than faulting).
- Fix bug in recognizing hex constants that start with "16#" (e.g.,
-16#1234abcd, which is a synonym for z'1234abcd').
- Fix bugs in constant folding of expressions involving btest, ibclr,
-and ibset.
- Fix bug in constant folding of rshift(16#80000000, -31) (on a 32-bit
-machine; more generally, the bug was in constant folding of
-rshift(ibset(0,NBITS-1), 1-NBITS) when f2c runs on a machine with
-long ints having NBITS bits.
-
-Mon Jun 24 07:58:53 EDT 1996
- Adjust struct Literal and newlabel() function to accommodate huge
-source files (with more than 32767 newlabel() invocations).
- Omit .c file when the .f file has a missing final end statement.
-
-Wed Jun 26 14:00:02 EDT 1996
- libi77: Add discussion of MXUNIT (highest allowed Fortran unit number)
-to libI77/README.
-
-Fri Jun 28 14:16:11 EDT 1996
- Fix glitch with -onetrip: the temporary variable used for nonconstant
-initial loop variable values was recycled too soon. Example:
- do i = j+1, k
- call foo(i+1) ! temp for j+1 was reused here
- enddo
- end
-
-Tue Jul 2 16:11:27 EDT 1996
- formatdata.c: add a 0 to the end of the basetype array (for TYBLANK)
-(an omission that was harmless on most machines).
- expr.c: fix a dereference of NULL that was only possible with buggy
-input, such as
- subroutine $sub(s) ! the '$' is erroneous
- character s*(*)
- s(1:) = ' '
- end
-
-Sat Jul 6 00:44:56 EDT 1996
- Fix glitch in the intrinsic "real" function when applied to a
-complex (or double complex) variable and passed as an argument to
-some intrinsic functions. Example:
- complex a
- b = sqrt(a)
- end
- Fix glitch (only visible if you do not use f2c's malloc and the
-malloc you do use is defective in the sense that malloc(0) returns 0)
-in handling include files that end with another include (perhaps
-followed by comments).
- Fix glitch with character*(*) arguments named "h" and "i" when
-the body of the subroutine invokes the intrinsic LEN function.
- Arrange that after a previous "f2c -P foo.f" has produced foo.P,
-running "f2c foo.P foo.f" will produce valid C when foo.f contains
- call sub('1234')
- end
- subroutine sub(msg)
- end
-Specifically, the length argument in "call sub" is now suppressed.
-With or without foo.P, it is also now suppressed when the order of
-subprograms in file foo.f is reversed:
- subroutine sub(msg)
- end
- call sub('1234')
- end
- Adjust copyright notices to reflect AT&T breakup.
-
-Wed Jul 10 09:25:49 EDT 1996
- Fix bug (possible memory fault) in handling erroneously placed
-and inconsistent declarations. Example that faulted:
- character*1 w(8)
- call foo(w)
- end
- subroutine foo(m)
- data h /0.5/
- integer m(2) ! should be before data
- end
- Fix bug (possible fault) in handling illegal "if" constructions.
-Example (that faulted):
- subroutine foo(i,j)
- if (i) then ! bug: i is integer, not logical
- else if (j) then ! bug: j is integer, not logical
- endif
- end
- Fix glitch with character*(*) argument named "ret_len" to a
-character*(*) function.
-
-Wed Jul 10 23:04:16 EDT 1996
- Fix more glitches in the intrinsic "real" function when applied to a
-complex (or double complex) variable and passed as an argument to
-some intrinsic functions. Example:
- complex a, b
- r = sqrt(real(conjg(a))) + sqrt(real(a*b))
- end
-
-Thu Jul 11 17:27:16 EDT 1996
- Fix a memory fault associated with complicated, illegal input.
-Example:
- subroutine goo
- character a
- call foo(a) ! inconsistent with subsequent def and call
- end
- subroutine foo(a)
- end
- call foo(a)
- end
-
-Wed Jul 17 19:18:28 EDT 1996
- Fix yet another case of intrinsic "real" applied to a complex
-argument. Example:
- complex a(3)
- x = sqrt(real(a(2))) ! gave error message about bad tag
- end
-
-Mon Aug 26 11:28:57 EDT 1996
- Tweak sysdep.c for non-Unix systems in which process ID's can be
-over 5 digits long.
-
-Tue Aug 27 08:31:32 EDT 1996
- Adjust the ishft intrinsic to use unsigned right shifts. (Previously,
-a negative constant second operand resulted in a possibly signed shift.)
-
-Thu Sep 12 14:04:07 EDT 1996
- equiv.c: fix glitch with -DKR_headers.
- libi77: fmtlib.c: fix bug in printing the most negative integer.
-
-Fri Sep 13 08:54:40 EDT 1996
- Diagnose some illegal appearances of substring notation.
-
-Tue Sep 17 17:48:09 EDT 1996
- Fix fault in handling some complex parameters. Example:
- subroutine foo(a)
- double complex a, b
- parameter(b = (0,1))
- a = b ! f2c faulted here
- end
-
-Thu Sep 26 07:47:10 EDT 1996
- libi77: fmt.h: for formatted writes of negative integer*1 values,
-make ic signed on ANSI systems. If formatted writes of integer*1
-values trouble you when using a K&R C compiler, switch to an ANSI
-compiler or use a compiler flag that makes characters signed.
-
-Tue Oct 1 14:41:36 EDT 1996
- Give a better error message when dummy arguments appear in data
-statements.
-
-Thu Oct 17 13:37:22 EDT 1996
- Fix bug in typechecking arguments to character and complex (or
-double complex) functions; the bug could cause length arguments
-for character arguments to be omitted on invocations appearing
-textually after the first invocation. For example, in
- subroutine foo
- character c
- complex zot
- call goo(zot(c), zot(c))
- end
-the length was omitted from the second invocation of zot, and
-there was an erroneous error message about inconsistent calling
-sequences.
-
-Wed Dec 4 13:59:14 EST 1996
- Fix bug revealed by
- subroutine test(cdum,rdum)
- complex cdum
- rdum=cos(real(cdum)) ! "Unexpected tag 3 in opconv_fudge"
- end
- Fix glitch in parsing "DO 10 D0 = 1, 10".
- Fix glitch in parsing
- real*8 x
- real*8 x ! erroneous "incompatible type" message
- call foo(x)
- end
-
-Mon Dec 9 23:15:02 EST 1996
- Fix glitch in parameter adjustments for arrays whose lower
-bound depends on a scalar argument. Example:
- subroutine bug(p,z,m,n)
- integer z(*),m,n
- double precision p(z(m):z(m) + n) ! p_offset botched
- call foo(p(0), p(n))
- end
- libi77: complain about non-positive rec= in direct read and write
-statements.
- libf77: trivial adjustments; Version.c not changed.
-
-Wed Feb 12 00:18:03 EST 1997
- output.c: fix (seldom problematic) glitch in out_call: put parens
-around the ... in a test of the form "if (q->tag == TADDR && ...)".
- vax.c: fix bug revealed in the "psi_offset =" assignment in the
-following example:
- subroutine foo(psi,m)
- integer z(100),m
- common /a/ z
- double precision psi(z(m):z(m) + 10)
- call foo(m+1, psi(0),psi(10))
- end
-
-Mon Feb 24 23:44:54 EST 1997
- For consistency with f2c's current treatment of adjacent character
-strings in FORMAT statements, recognize a Hollerith string following
-a string (and merge adjacent strings in FORMAT statements).
-
-Wed Feb 26 13:41:11 EST 1997
- New libf2c.zip, a combination of the libf77 and libi77 bundles (and
-available only by ftp).
- libf77: adjust functions with a complex output argument to permit
-aliasing it with input arguments. (For now, at least, this is just
-for possible benefit of g77.)
- libi77: tweak to ftell_.c for systems with strange definitions of
-SEEK_SET, etc.
-
-Tue Apr 8 20:57:08 EDT 1997
- libf77: [cz]_div.c: tweaks invisible on most systems (that may
-improve things slightly with optimized compilation on systems that use
-gratuitous extra precision).
- libi77: fmt.c: adjust to complain at missing numbers in formats
-(but still treat missing ".nnn" as ".0").
-
-Fri Apr 11 14:05:57 EDT 1997
- libi77: err.c: attempt to make stderr line buffered rather than
-fully buffered. (Buffering is needed for format items T and TR.)
-
-Thu Apr 17 22:42:43 EDT 1997
- libf77: add F77_aloc.o to makefile (and makefile.u in libf2c.zip).
-
-Fri Apr 25 19:32:09 EDT 1997
- libf77: add [de]time_.c (which may give trouble on some systems).
-
-Tue May 27 09:18:52 EDT 1997
- libi77: ftell_.c: fix typo that caused the third argument to be
-treated as 2 on some systems.
-
-Mon Jun 9 00:04:37 EDT 1997
- libi77 (and libf2c.zip): adjust include order in err.c lread.c wref.c
-rdfmt.c to include fmt.h (etc.) after system includes. Version.c not
-changed.
-
-Mon Jul 21 16:04:54 EDT 1997
- proc.c: fix glitch in logic for "nonpositive dimension" message.
- libi77: inquire.c: always include string.h (for possible use with
--DNON_UNIX_STDIO); Version.c not changed.
-
-Thu Jul 24 17:11:23 EDT 1997
- Tweak "Notice" to reflect the AT&T breakup -- we missed it when
-updating the copyright notices in the source files last summer.
- Adjust src/makefile so malloc.o is not used by default, but can
-be specified with "make MALLOC=malloc.o".
- Add comments to src/README about the "CRAY" T3E.
-
-Tue Aug 5 14:53:25 EDT 1997
- Add definition of calloc to malloc.c; this makes f2c's malloc
-work on some systems where trouble hitherto arose because references
-to calloc brought in the system's malloc. (On sensible systems,
-calloc is defined separately from malloc. To avoid confusion on
-other systems, f2c/malloc.c now defines calloc.)
- libi77: lread.c: adjust to accord with a change to the Fortran 8X
-draft (in 1990 or 1991) that rescinded permission to elide quote marks
-in namelist input of character data; to get the old behavior, compile
-with F8X_NML_ELIDE_QUOTES #defined. wrtfmt.o: wrt_G: tweak to print
-the right number of 0's for zero under G format.
-
-Sat Aug 16 05:45:32 EDT 1997
- libi77: iio.c: fix bug in internal writes to an array of character
-strings that sometimes caused one more array element than required by
-the format to be blank-filled. Example: format(1x).
-
-Wed Sep 17 00:39:29 EDT 1997
- libi77: fmt.[ch] rdfmt.c wrtfmt.c: tweak struct syl for machines
-with 64-bit pointers and 32-bit ints that did not 64-bit align
-struct syl (e.g., Linux on the DEC Alpha). This change should be
-invisible on other machines.
-
-Sun Sep 21 22:05:19 EDT 1997
- libf77: [de]time_.c (Unix systems only): change return type to double.
-
-Thu Dec 4 22:10:09 EST 1997
- Fix bug with handling large blocks of comments (over 4k); parts of the
-second and subsequent blocks were likely to be lost (not copied into
-comments in the resulting C). Allow comment lines to be longer before
-breaking them.
-
-Mon Jan 19 17:19:27 EST 1998
- makefile: change the rule for making gram.c to one for making gram1.c;
-henceforth, asking netlib to "send all from f2c/src" will bring you a
-working gram.c. Nowadays there are simply too many broken versions of
-yacc floating around.
- libi77: backspace.c: for b->ufmt==0, change sizeof(int) to
-sizeof(uiolen). On machines where this would make a difference, it is
-best for portability to compile libI77 with -DUIOLEN_int, which will
-render the change invisible.
-
-Tue Feb 24 08:35:33 EST 1998
- makefile: remove gram.c from the "make clean" rule.
-
-Wed Feb 25 08:29:39 EST 1998
- makefile: change CFLAGS assignment to -O; add "veryclean" rule.
-
-Wed Mar 4 13:13:21 EST 1998
- libi77: open.c: fix glitch in comparing file names under
--DNON_UNIX_STDIO.
-
-Mon Mar 9 23:56:56 EST 1998
- putpcc.c: omit an unnecessary temporary variable in computing
-(expr)**3.
- libf77, libi77: minor tweaks to make some C++ compilers happy;
-Version.c not changed.
-
-Wed Mar 18 18:08:47 EST 1998
- libf77: minor tweaks to [ed]time_.c; Version.c not changed.
- libi77: endfile.c, open.c: acquire temporary files from tmpfile(),
-unless compiled with -DNON_ANSI_STDIO, which uses mktemp().
-New buffering scheme independent of NON_UNIX_STDIO for handling T
-format items. Now -DNON_UNIX_STDIO is no longer be necessary for
-Linux, and libf2c no longer causes stderr to be buffered -- the former
-setbuf or setvbuf call for stderr was to make T format items work.
-open.c: use the Posix access() function to check existence or
-nonexistence of files, except under -DNON_POSIX_STDIO, where trial
-fopen calls are used. In open.c, fix botch in changes of 19980304.
- libf2c.zip: the PC makefiles are now set for NT/W95, with comments
-about changes for DOS.
-
-Fri Apr 3 17:22:12 EST 1998
- Adjust fix of 19960913 to again permit substring notation on
-character variables in data statements.
-
-Sun Apr 5 19:26:50 EDT 1998
- libi77: wsfe.c: make $ format item work: this was lost in the changes
-of 17 March 1998.
-
-Sat May 16 19:08:51 EDT 1998
- Adjust output of ftnlen constants: rather than appending L,
-prepend (ftnlen). This should make the resulting C more portable,
-e.g., to systems (such as DEC Alpha Unix systems) on which long
-may be longer than ftnlen.
- Adjust -r so it also casts REAL expressions passed to intrinsic
-functions to REAL.
-
-Wed May 27 16:02:35 EDT 1998
- libf2c.zip: tweak description of compiling libf2c for INTEGER*8
-to accord with makefile.u rather than libF77/makefile.
-
-Thu May 28 22:45:59 EDT 1998
- libi77: backspace.c dfe.c due.c iio.c lread.c rsfe.c sue.c wsfe.c:
-set f__curunit sooner so various error messages will correctly
-identify the I/O unit involved.
- libf2c.zip: above, plus tweaks to PC makefiles: for some purposes,
-it's still best to compile with -DMSDOS (even for use with NT).
-
-Thu Jun 18 01:22:52 EDT 1998
- libi77: lread.c: modified so floating-point numbers (containing
-either a decimal point or an exponent field) are treated as errors
-when they appear as list input for integer data. Compile lread.c with
--DALLOW_FLOAT_IN_INTEGER_LIST_INPUT to restore the old behavior.
-
-Mon Aug 31 10:38:54 EDT 1998
- formatdata.c: if possible, and assuming doubles must be aligned on
-double boundaries, use existing holes in DATA for common blocks to
-force alignment of the block. For example,
- block data
- common /abc/ a, b
- double precision a
- integer b(2)
- data b(2)/1/
- end
-used to generate
- struct {
- integer fill_1[3];
- integer e_2;
- doublereal e_3;
- } abc_ = { {0}, 1, 0. };
-and now generates
- struct {
- doublereal fill_1[1];
- integer fill_2[1];
- integer e_3;
- } abc_ = { {0}, {0}, 1 };
-In the old generated C, e_3 was added to force alignment; in the new C,
-fill_1 does this job.
-
-Mon Sep 7 19:48:51 EDT 1998
- libi77: move e_wdfe from sfe.c to dfe.c, where it was originally.
-Why did it ever move to sfe.c?
-
-Tue Sep 8 10:22:50 EDT 1998
- Treat dreal as a synonym for dble unless -cd is specified on the
-command line.
-
-Sun Sep 13 22:23:41 EDT 1998
- format.c: fix bug in writing prototypes under f2c -A ... *.P:
-under some circumstances involving external functions with no known
-type, a null pointer was passed to printf.
-
-Tue Oct 20 23:25:54 EDT 1998
- Comments added to libf2c/README and libF77/README, pointing out
-the need to modify signal1.h on some systems.
-
-Wed Feb 10 22:59:52 EST 1999
- defs.h lex.c: permit long names (up to at least roughly
-MAX_SHARPLINE_LEN = 1000 characters long) in #line lines (which only
-matters under -g).
- fc: add -U option; recognize .so files.
-
-Sat Feb 13 10:18:27 EST 1999
- libf2c: endfile.c, lread.c, signal1.h0: minor tweaks to make some
-(C++) compilers happier; f77_aloc.c: make exit_() visible to C++
-compilers. Version strings not changed.
-
-Thu Mar 11 23:14:02 EST 1999
- Modify f2c (exec.c, expr.c) to diagnose incorrect mixing of types
-when (f2c extended) intrinsic functions are involved, as in
-(not(17) .and. 4). Catching this in the first executable statement
-is a bit tricky, as some checking must be postponed until all statement
-function declarations have been parsed. Thus there is a chance of
-today's changes introducing bugs under (let us hope) unusual conditions.
-
-Sun Mar 28 13:17:44 EST 1999
- lex.c: tweak to get the file name right in error messages caused
-by statements just after a # nnn "filename" line emitted by the C
-preprocessor. (The trouble is that the line following the # nnn line
-must be read to see if it is a continuation of the stuff that preceded
-the # nnn line.) When # nnn "filename" lines appear among the lines
-for a Fortran statement, the filename reported in an error message for
-the statement should now be the file that was current when the first
-line of the statement was read.
-
-Sun May 2 22:38:25 EDT 1999
- libf77, libi77, libf2c.zip: make getenv_() more portable (call
-getenv() rather than knowing about char **environ); adjust some
-complex intrinsics to work with overlapping arguments (caused by
-inappropriate use of equivalence); open.c: get "external" versus
-"internal" right in the error message if a file cannot be opened;
-err.c: cast a pointer difference to (int) for %d; rdfmt.c: omit
-fixed-length buffer that could be overwritten by formats Inn or Lnn
-with nn > 83.
-
-Mon May 3 13:14:07 EDT 1999
- "Invisible" changes to omit a few compiler warnings in f2c and
-libf2c; two new casts in libf2c/open.c that matter with 64-bit longs,
-and one more tweak (libf2c/c_log.c) for pathological equivalences.
- Minor update to "fc" script: new -L flag and comment correction.
-
-Fri Jun 18 02:33:08 EDT 1999
- libf2c.zip: rename backspace.c backspac.c, and fix a glitch in it
--- b->ufd may change in t_runc(). (For now, it's still backspace.c
-in the libi77 bundle.)
-
-Sun Jun 27 22:05:47 EDT 1999
- libf2c.zip, libi77: rsne.c: fix bug in namelist input: a misplaced
-increment could cause wrong array elements to be assigned; e.g.,
-"&input k(5)=10*1 &end" assigned k(5) and k(15 .. 23).
diff --git a/contrib/libf2c/configure b/contrib/libf2c/configure
deleted file mode 100755
index 75b9e5fe9b72..000000000000
--- a/contrib/libf2c/configure
+++ /dev/null
@@ -1,1563 +0,0 @@
-#! /bin/sh
-
-# Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 2.13
-# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
-#
-# This configure script is free software; the Free Software Foundation
-# gives unlimited permission to copy, distribute and modify it.
-
-# Defaults:
-ac_help=
-ac_default_prefix=/usr/local
-# Any additions from configure.in:
-
-# Initialize some variables set by options.
-# The variables have the same names as the options, with
-# dashes changed to underlines.
-build=NONE
-cache_file=./config.cache
-exec_prefix=NONE
-host=NONE
-no_create=
-nonopt=NONE
-no_recursion=
-prefix=NONE
-program_prefix=NONE
-program_suffix=NONE
-program_transform_name=s,x,x,
-silent=
-site=
-srcdir=
-target=NONE
-verbose=
-x_includes=NONE
-x_libraries=NONE
-bindir='${exec_prefix}/bin'
-sbindir='${exec_prefix}/sbin'
-libexecdir='${exec_prefix}/libexec'
-datadir='${prefix}/share'
-sysconfdir='${prefix}/etc'
-sharedstatedir='${prefix}/com'
-localstatedir='${prefix}/var'
-libdir='${exec_prefix}/lib'
-includedir='${prefix}/include'
-oldincludedir='/usr/include'
-infodir='${prefix}/info'
-mandir='${prefix}/man'
-
-# Initialize some other variables.
-subdirs=
-MFLAGS= MAKEFLAGS=
-SHELL=${CONFIG_SHELL-/bin/sh}
-# Maximum number of lines to put in a shell here document.
-ac_max_here_lines=12
-
-ac_prev=
-for ac_option
-do
-
- # If the previous option needs an argument, assign it.
- if test -n "$ac_prev"; then
- eval "$ac_prev=\$ac_option"
- ac_prev=
- continue
- fi
-
- case "$ac_option" in
- -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
- *) ac_optarg= ;;
- esac
-
- # Accept the important Cygnus configure options, so we can diagnose typos.
-
- case "$ac_option" in
-
- -bindir | --bindir | --bindi | --bind | --bin | --bi)
- ac_prev=bindir ;;
- -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
- bindir="$ac_optarg" ;;
-
- -build | --build | --buil | --bui | --bu)
- ac_prev=build ;;
- -build=* | --build=* | --buil=* | --bui=* | --bu=*)
- build="$ac_optarg" ;;
-
- -cache-file | --cache-file | --cache-fil | --cache-fi \
- | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
- ac_prev=cache_file ;;
- -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
- | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
- cache_file="$ac_optarg" ;;
-
- -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
- ac_prev=datadir ;;
- -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
- | --da=*)
- datadir="$ac_optarg" ;;
-
- -disable-* | --disable-*)
- ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
- # Reject names that are not valid shell variable names.
- if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
- { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
- fi
- ac_feature=`echo $ac_feature| sed 's/-/_/g'`
- eval "enable_${ac_feature}=no" ;;
-
- -enable-* | --enable-*)
- ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
- # Reject names that are not valid shell variable names.
- if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
- { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
- fi
- ac_feature=`echo $ac_feature| sed 's/-/_/g'`
- case "$ac_option" in
- *=*) ;;
- *) ac_optarg=yes ;;
- esac
- eval "enable_${ac_feature}='$ac_optarg'" ;;
-
- -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
- | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
- | --exec | --exe | --ex)
- ac_prev=exec_prefix ;;
- -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
- | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
- | --exec=* | --exe=* | --ex=*)
- exec_prefix="$ac_optarg" ;;
-
- -gas | --gas | --ga | --g)
- # Obsolete; use --with-gas.
- with_gas=yes ;;
-
- -help | --help | --hel | --he)
- # Omit some internal or obsolete options to make the list less imposing.
- # This message is too long to be a string in the A/UX 3.1 sh.
- cat << EOF
-Usage: configure [options] [host]
-Options: [defaults in brackets after descriptions]
-Configuration:
- --cache-file=FILE cache test results in FILE
- --help print this message
- --no-create do not create output files
- --quiet, --silent do not print \`checking...' messages
- --version print the version of autoconf that created configure
-Directory and file names:
- --prefix=PREFIX install architecture-independent files in PREFIX
- [$ac_default_prefix]
- --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
- [same as prefix]
- --bindir=DIR user executables in DIR [EPREFIX/bin]
- --sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
- --libexecdir=DIR program executables in DIR [EPREFIX/libexec]
- --datadir=DIR read-only architecture-independent data in DIR
- [PREFIX/share]
- --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
- --sharedstatedir=DIR modifiable architecture-independent data in DIR
- [PREFIX/com]
- --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
- --libdir=DIR object code libraries in DIR [EPREFIX/lib]
- --includedir=DIR C header files in DIR [PREFIX/include]
- --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
- --infodir=DIR info documentation in DIR [PREFIX/info]
- --mandir=DIR man documentation in DIR [PREFIX/man]
- --srcdir=DIR find the sources in DIR [configure dir or ..]
- --program-prefix=PREFIX prepend PREFIX to installed program names
- --program-suffix=SUFFIX append SUFFIX to installed program names
- --program-transform-name=PROGRAM
- run sed PROGRAM on installed program names
-EOF
- cat << EOF
-Host type:
- --build=BUILD configure for building on BUILD [BUILD=HOST]
- --host=HOST configure for HOST [guessed]
- --target=TARGET configure for TARGET [TARGET=HOST]
-Features and packages:
- --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
- --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
- --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
- --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
- --x-includes=DIR X include files are in DIR
- --x-libraries=DIR X library files are in DIR
-EOF
- if test -n "$ac_help"; then
- echo "--enable and --with options recognized:$ac_help"
- fi
- exit 0 ;;
-
- -host | --host | --hos | --ho)
- ac_prev=host ;;
- -host=* | --host=* | --hos=* | --ho=*)
- host="$ac_optarg" ;;
-
- -includedir | --includedir | --includedi | --included | --include \
- | --includ | --inclu | --incl | --inc)
- ac_prev=includedir ;;
- -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
- | --includ=* | --inclu=* | --incl=* | --inc=*)
- includedir="$ac_optarg" ;;
-
- -infodir | --infodir | --infodi | --infod | --info | --inf)
- ac_prev=infodir ;;
- -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
- infodir="$ac_optarg" ;;
-
- -libdir | --libdir | --libdi | --libd)
- ac_prev=libdir ;;
- -libdir=* | --libdir=* | --libdi=* | --libd=*)
- libdir="$ac_optarg" ;;
-
- -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
- | --libexe | --libex | --libe)
- ac_prev=libexecdir ;;
- -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
- | --libexe=* | --libex=* | --libe=*)
- libexecdir="$ac_optarg" ;;
-
- -localstatedir | --localstatedir | --localstatedi | --localstated \
- | --localstate | --localstat | --localsta | --localst \
- | --locals | --local | --loca | --loc | --lo)
- ac_prev=localstatedir ;;
- -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
- | --localstate=* | --localstat=* | --localsta=* | --localst=* \
- | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
- localstatedir="$ac_optarg" ;;
-
- -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
- ac_prev=mandir ;;
- -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
- mandir="$ac_optarg" ;;
-
- -nfp | --nfp | --nf)
- # Obsolete; use --without-fp.
- with_fp=no ;;
-
- -no-create | --no-create | --no-creat | --no-crea | --no-cre \
- | --no-cr | --no-c)
- no_create=yes ;;
-
- -no-recursion | --no-recursion | --no-recursio | --no-recursi \
- | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
- no_recursion=yes ;;
-
- -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
- | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
- | --oldin | --oldi | --old | --ol | --o)
- ac_prev=oldincludedir ;;
- -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
- | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
- | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
- oldincludedir="$ac_optarg" ;;
-
- -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
- ac_prev=prefix ;;
- -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
- prefix="$ac_optarg" ;;
-
- -program-prefix | --program-prefix | --program-prefi | --program-pref \
- | --program-pre | --program-pr | --program-p)
- ac_prev=program_prefix ;;
- -program-prefix=* | --program-prefix=* | --program-prefi=* \
- | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
- program_prefix="$ac_optarg" ;;
-
- -program-suffix | --program-suffix | --program-suffi | --program-suff \
- | --program-suf | --program-su | --program-s)
- ac_prev=program_suffix ;;
- -program-suffix=* | --program-suffix=* | --program-suffi=* \
- | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
- program_suffix="$ac_optarg" ;;
-
- -program-transform-name | --program-transform-name \
- | --program-transform-nam | --program-transform-na \
- | --program-transform-n | --program-transform- \
- | --program-transform | --program-transfor \
- | --program-transfo | --program-transf \
- | --program-trans | --program-tran \
- | --progr-tra | --program-tr | --program-t)
- ac_prev=program_transform_name ;;
- -program-transform-name=* | --program-transform-name=* \
- | --program-transform-nam=* | --program-transform-na=* \
- | --program-transform-n=* | --program-transform-=* \
- | --program-transform=* | --program-transfor=* \
- | --program-transfo=* | --program-transf=* \
- | --program-trans=* | --program-tran=* \
- | --progr-tra=* | --program-tr=* | --program-t=*)
- program_transform_name="$ac_optarg" ;;
-
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil)
- silent=yes ;;
-
- -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
- ac_prev=sbindir ;;
- -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
- | --sbi=* | --sb=*)
- sbindir="$ac_optarg" ;;
-
- -sharedstatedir | --sharedstatedir | --sharedstatedi \
- | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
- | --sharedst | --shareds | --shared | --share | --shar \
- | --sha | --sh)
- ac_prev=sharedstatedir ;;
- -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
- | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
- | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
- | --sha=* | --sh=*)
- sharedstatedir="$ac_optarg" ;;
-
- -site | --site | --sit)
- ac_prev=site ;;
- -site=* | --site=* | --sit=*)
- site="$ac_optarg" ;;
-
- -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
- ac_prev=srcdir ;;
- -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
- srcdir="$ac_optarg" ;;
-
- -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
- | --syscon | --sysco | --sysc | --sys | --sy)
- ac_prev=sysconfdir ;;
- -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
- | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
- sysconfdir="$ac_optarg" ;;
-
- -target | --target | --targe | --targ | --tar | --ta | --t)
- ac_prev=target ;;
- -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
- target="$ac_optarg" ;;
-
- -v | -verbose | --verbose | --verbos | --verbo | --verb)
- verbose=yes ;;
-
- -version | --version | --versio | --versi | --vers)
- echo "configure generated by autoconf version 2.13"
- exit 0 ;;
-
- -with-* | --with-*)
- ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
- # Reject names that are not valid shell variable names.
- if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
- { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
- fi
- ac_package=`echo $ac_package| sed 's/-/_/g'`
- case "$ac_option" in
- *=*) ;;
- *) ac_optarg=yes ;;
- esac
- eval "with_${ac_package}='$ac_optarg'" ;;
-
- -without-* | --without-*)
- ac_package=`echo $ac_option|sed -e 's/-*without-//'`
- # Reject names that are not valid shell variable names.
- if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
- { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
- fi
- ac_package=`echo $ac_package| sed 's/-/_/g'`
- eval "with_${ac_package}=no" ;;
-
- --x)
- # Obsolete; use --with-x.
- with_x=yes ;;
-
- -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
- | --x-incl | --x-inc | --x-in | --x-i)
- ac_prev=x_includes ;;
- -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
- | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
- x_includes="$ac_optarg" ;;
-
- -x-libraries | --x-libraries | --x-librarie | --x-librari \
- | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
- ac_prev=x_libraries ;;
- -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
- | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
- x_libraries="$ac_optarg" ;;
-
- -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
- ;;
-
- *)
- if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
- echo "configure: warning: $ac_option: invalid host type" 1>&2
- fi
- if test "x$nonopt" != xNONE; then
- { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
- fi
- nonopt="$ac_option"
- ;;
-
- esac
-done
-
-if test -n "$ac_prev"; then
- { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
-fi
-
-trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
-
-# File descriptor usage:
-# 0 standard input
-# 1 file creation
-# 2 errors and warnings
-# 3 some systems may open it to /dev/tty
-# 4 used on the Kubota Titan
-# 6 checking for... messages and results
-# 5 compiler messages saved in config.log
-if test "$silent" = yes; then
- exec 6>/dev/null
-else
- exec 6>&1
-fi
-exec 5>./config.log
-
-echo "\
-This file contains any messages produced by compilers while
-running configure, to aid debugging if configure makes a mistake.
-" 1>&5
-
-# Strip out --no-create and --no-recursion so they do not pile up.
-# Also quote any args containing shell metacharacters.
-ac_configure_args=
-for ac_arg
-do
- case "$ac_arg" in
- -no-create | --no-create | --no-creat | --no-crea | --no-cre \
- | --no-cr | --no-c) ;;
- -no-recursion | --no-recursion | --no-recursio | --no-recursi \
- | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
- *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
- ac_configure_args="$ac_configure_args '$ac_arg'" ;;
- *) ac_configure_args="$ac_configure_args $ac_arg" ;;
- esac
-done
-
-# NLS nuisances.
-# Only set these to C if already set. These must not be set unconditionally
-# because not all systems understand e.g. LANG=C (notably SCO).
-# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
-# Non-C LC_CTYPE values break the ctype check.
-if test "${LANG+set}" = set; then LANG=C; export LANG; fi
-if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
-if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
-if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
-
-# confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -rf conftest* confdefs.h
-# AIX cpp loses on an empty file, so make sure it contains at least a newline.
-echo > confdefs.h
-
-# A filename unique to this package, relative to the directory that
-# configure is in, which we can look for to find out if srcdir is correct.
-ac_unique_file=libF77/Version.c
-
-# Find the source files, if location was not specified.
-if test -z "$srcdir"; then
- ac_srcdir_defaulted=yes
- # Try the directory containing this script, then its parent.
- ac_prog=$0
- ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
- test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
- srcdir=$ac_confdir
- if test ! -r $srcdir/$ac_unique_file; then
- srcdir=..
- fi
-else
- ac_srcdir_defaulted=no
-fi
-if test ! -r $srcdir/$ac_unique_file; then
- if test "$ac_srcdir_defaulted" = yes; then
- { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
- else
- { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
- fi
-fi
-srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
-
-# Prefer explicitly selected file to automatically selected ones.
-if test -z "$CONFIG_SITE"; then
- if test "x$prefix" != xNONE; then
- CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
- else
- CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
- fi
-fi
-for ac_site_file in $CONFIG_SITE; do
- if test -r "$ac_site_file"; then
- echo "loading site script $ac_site_file"
- . "$ac_site_file"
- fi
-done
-
-if test -r "$cache_file"; then
- echo "loading cache $cache_file"
- . $cache_file
-else
- echo "creating cache $cache_file"
- > $cache_file
-fi
-
-ac_ext=c
-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
-
-ac_exeext=
-ac_objext=o
-if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
- # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
- if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
- ac_n= ac_c='
-' ac_t=' '
- else
- ac_n=-n ac_c= ac_t=
- fi
-else
- ac_n= ac_c='\c' ac_t=
-fi
-
-
-
-if test "${srcdir}" = "." ; then
- if test "${with_target_subdir}" != "." ; then
- topsrcdir=${with_multisrctop}../..
- else
- topsrcdir=${with_multisrctop}..
- fi
-else
- topsrcdir=${srcdir}/..
-fi
-ac_aux_dir=
-for ac_dir in $topsrcdir $srcdir/$topsrcdir; do
- if test -f $ac_dir/install-sh; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install-sh -c"
- break
- elif test -f $ac_dir/install.sh; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install.sh -c"
- break
- fi
-done
-if test -z "$ac_aux_dir"; then
- { echo "configure: error: can not find install-sh or install.sh in $topsrcdir $srcdir/$topsrcdir" 1>&2; exit 1; }
-fi
-ac_config_guess=$ac_aux_dir/config.guess
-ac_config_sub=$ac_aux_dir/config.sub
-ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
-
-
-# If the language specific compiler does not exist, but the "gcc" directory
-# does, we do not build anything. Note, $r is set by the top-level Makefile.
-# Note that when we look for the compiler, we search both with and without
-# extension to handle cross and canadian cross builds.
-compiler_name=f771
-rm -f skip-this-dir
-echo $ac_n "checking if compiler $compiler_name has been built""... $ac_c" 1>&6
-echo "configure:562: checking if compiler $compiler_name has been built" >&5
-if eval "test \"`echo '$''{'g77_cv_compiler_exists'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- g77_cv_compiler_exists=yes
-if test -n "$r"; then
- if test -d "$r"/gcc; then
- if test -f "$r"/gcc/$compiler_name \
- || test -f "$r"/gcc/$compiler_name.exe; then
- true
- else
- g77_cv_compiler_exists=no
- echo "rm -f config.cache config.log multilib.out" > skip-this-dir
- fi
- fi
-fi
-
-fi
-
-echo "$ac_t""$g77_cv_compiler_exists" 1>&6
-if test x$g77_cv_compiler_exists = xno
-then
- rm -f Makefile conftest* confdefs* core
- exit 0
-fi
-
-
-
-
-# For g77 we'll set CC to point at the built gcc, but this will get it into
-# the makefiles
-
-# Extract the first word of "gcc", so it can be a program name with args.
-set dummy gcc; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:597: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_prog_CC="gcc"
- break
- fi
- done
- IFS="$ac_save_ifs"
-fi
-fi
-CC="$ac_cv_prog_CC"
-if test -n "$CC"; then
- echo "$ac_t""$CC" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-if test -z "$CC"; then
- # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:627: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_prog_rejected=no
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
- ac_prog_rejected=yes
- continue
- fi
- ac_cv_prog_CC="cc"
- break
- fi
- done
- IFS="$ac_save_ifs"
-if test $ac_prog_rejected = yes; then
- # We found a bogon in the path, so make sure we never use it.
- set dummy $ac_cv_prog_CC
- shift
- if test $# -gt 0; then
- # We chose a different compiler from the bogus one.
- # However, it has the same basename, so the bogon will be chosen
- # first if we set CC to just the basename; use the full file name.
- shift
- set dummy "$ac_dir/$ac_word" "$@"
- shift
- ac_cv_prog_CC="$@"
- fi
-fi
-fi
-fi
-CC="$ac_cv_prog_CC"
-if test -n "$CC"; then
- echo "$ac_t""$CC" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
- if test -z "$CC"; then
- case "`uname -s`" in
- *win32* | *WIN32*)
- # Extract the first word of "cl", so it can be a program name with args.
-set dummy cl; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:678: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_prog_CC="cl"
- break
- fi
- done
- IFS="$ac_save_ifs"
-fi
-fi
-CC="$ac_cv_prog_CC"
-if test -n "$CC"; then
- echo "$ac_t""$CC" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
- ;;
- esac
- fi
- test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
-fi
-
-
-echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:711: checking whether we are using GNU C" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.c <<EOF
-#ifdef __GNUC__
- yes;
-#endif
-EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:720: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
- ac_cv_prog_gcc=yes
-else
- ac_cv_prog_gcc=no
-fi
-fi
-
-echo "$ac_t""$ac_cv_prog_gcc" 1>&6
-
-if test $ac_cv_prog_gcc = yes; then
- GCC=yes
-else
- GCC=
-fi
-
-ac_test_CFLAGS="${CFLAGS+set}"
-ac_save_CFLAGS="$CFLAGS"
-CFLAGS=
-echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:739: checking whether ${CC-cc} accepts -g" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- echo 'void f(){}' > conftest.c
-if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
- ac_cv_prog_cc_g=yes
-else
- ac_cv_prog_cc_g=no
-fi
-rm -f conftest*
-
-fi
-
-echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
-if test "$ac_test_CFLAGS" = set; then
- CFLAGS="$ac_save_CFLAGS"
-elif test $ac_cv_prog_cc_g = yes; then
- if test "$GCC" = yes; then
- CFLAGS="-g -O2"
- else
- CFLAGS="-g"
- fi
-else
- if test "$GCC" = yes; then
- CFLAGS="-O2"
- else
- CFLAGS=
- fi
-fi
-
-
-test "$AR" || AR=ar
-
-if test "$RANLIB"; then :
-
-else
- # Extract the first word of "ranlib", so it can be a program name with args.
-set dummy ranlib; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:779: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- if test -n "$RANLIB"; then
- ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
-else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_prog_RANLIB="ranlib"
- break
- fi
- done
- IFS="$ac_save_ifs"
- test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
-fi
-fi
-RANLIB="$ac_cv_prog_RANLIB"
-if test -n "$RANLIB"; then
- echo "$ac_t""$RANLIB" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-fi
-# Find a good install program. We prefer a C program (faster),
-# so one script is as good as another. But avoid the broken or
-# incompatible versions:
-# SysV /etc/install, /usr/sbin/install
-# SunOS /usr/etc/install
-# IRIX /sbin/install
-# AIX /bin/install
-# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
-# AFS /usr/afsws/bin/install, which mishandles nonexistent args
-# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
-# ./install, which can be erroneously created by make from ./install.sh.
-echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:819: checking for a BSD compatible install" >&5
-if test -z "$INSTALL"; then
-if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":"
- for ac_dir in $PATH; do
- # Account for people who put trailing slashes in PATH elements.
- case "$ac_dir/" in
- /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
- *)
- # OSF1 and SCO ODT 3.0 have their own names for install.
- # Don't use installbsd from OSF since it installs stuff as root
- # by default.
- for ac_prog in ginstall scoinst install; do
- if test -f $ac_dir/$ac_prog; then
- if test $ac_prog = install &&
- grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
- # AIX install. It has an incompatible calling convention.
- :
- else
- ac_cv_path_install="$ac_dir/$ac_prog -c"
- break 2
- fi
- fi
- done
- ;;
- esac
- done
- IFS="$ac_save_IFS"
-
-fi
- if test "${ac_cv_path_install+set}" = set; then
- INSTALL="$ac_cv_path_install"
- else
- # As a last resort, use the slow shell script. We don't cache a
- # path for INSTALL within a source directory, because that will
- # break other packages using the cache if that directory is
- # removed, or if the path is relative.
- INSTALL="$ac_install_sh"
- fi
-fi
-echo "$ac_t""$INSTALL" 1>&6
-
-# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
-# It thinks the first close brace ends the variable substitution.
-test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
-
-test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
-
-test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-
-echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:872: checking whether ${MAKE-make} sets \${MAKE}" >&5
-set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftestmake <<\EOF
-all:
- @echo 'ac_maketemp="${MAKE}"'
-EOF
-# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
-eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
-if test -n "$ac_maketemp"; then
- eval ac_cv_prog_make_${ac_make}_set=yes
-else
- eval ac_cv_prog_make_${ac_make}_set=no
-fi
-rm -f conftestmake
-fi
-if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- SET_MAKE=
-else
- echo "$ac_t""no" 1>&6
- SET_MAKE="MAKE=${MAKE-make}"
-fi
-
-
-# Sanity check for the cross-compilation case:
-echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:901: checking how to run the C preprocessor" >&5
-# On Suns, sometimes $CPP names a directory.
-if test -n "$CPP" && test -d "$CPP"; then
- CPP=
-fi
-if test -z "$CPP"; then
-if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- # This must be in double quotes, not single quotes, because CPP may get
- # substituted into the Makefile and "${CC-cc}" will confuse make.
- CPP="${CC-cc} -E"
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp.
- cat > conftest.$ac_ext <<EOF
-#line 916 "configure"
-#include "confdefs.h"
-#include <assert.h>
-Syntax Error
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:922: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- :
-else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- CPP="${CC-cc} -E -traditional-cpp"
- cat > conftest.$ac_ext <<EOF
-#line 933 "configure"
-#include "confdefs.h"
-#include <assert.h>
-Syntax Error
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:939: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- :
-else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- CPP="${CC-cc} -nologo -E"
- cat > conftest.$ac_ext <<EOF
-#line 950 "configure"
-#include "confdefs.h"
-#include <assert.h>
-Syntax Error
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:956: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- :
-else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- CPP=/lib/cpp
-fi
-rm -f conftest*
-fi
-rm -f conftest*
-fi
-rm -f conftest*
- ac_cv_prog_CPP="$CPP"
-fi
- CPP="$ac_cv_prog_CPP"
-else
- ac_cv_prog_CPP="$CPP"
-fi
-echo "$ac_t""$CPP" 1>&6
-
-ac_safe=`echo "stdio.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for stdio.h""... $ac_c" 1>&6
-echo "configure:982: checking for stdio.h" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 987 "configure"
-#include "confdefs.h"
-#include <stdio.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:992: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=yes"
-else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- :
-else
- echo "$ac_t""no" 1>&6
-{ echo "configure: error: Can't find stdio.h.
-You must have a usable C system for the target already installed, at least
-including headers and, preferably, the library, before you can configure
-the G77 runtime system. If necessary, install gcc now with \`LANGUAGES=c',
-then the target library, then build with \`LANGUAGES=f77'." 1>&2; exit 1; }
-fi
-
-
-echo $ac_n "checking for built-in g77 integer types""... $ac_c" 1>&6
-echo "configure:1020: checking for built-in g77 integer types" >&5
-if eval "test \"`echo '$''{'libf2c_cv_has_g77_builtin_types'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1025 "configure"
-#include "confdefs.h"
-
-int main() {
-__g77_integer g77i;
-__g77_uinteger g77ui;
-__g77_longint g77l;
-__g77_ulongint g77ul;
-; return 0; }
-EOF
-if { (eval echo configure:1035: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- libf2c_cv_has_g77_builtin_types=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- libf2c_cv_has_g77_builtin_types=no
-fi
-rm -f conftest*
-fi
-
-echo "$ac_t""$libf2c_cv_has_g77_builtin_types" 1>&6
-if test $libf2c_cv_has_g77_builtin_types = no; then
- { echo "configure: error: gcc doesn't define all of the built in types __g77_integer,
-__g77_uinteger, __g77_longint, and __g77_ulongint. You may not be using
-a new enough version of gcc, or your target may not have type sizes which
-accommodate those types." 1>&2; exit 1; }
-fi
-
-# avoid confusion in case the `makefile's from the f2c distribution have
-# got put here
-test -f libF77/makefile && mv libF77/makefile libF77/makefile.ori
-test -f libI77/makefile && mv libI77/makefile libI77/makefile.ori
-test -f libU77/makefile && mv libU77/makefile libU77/makefile.ori
-
-# Get the version trigger filename from the toplevel
-if [ "${with_gcc_version_trigger+set}" = set ]; then
- gcc_version_trigger=$with_gcc_version_trigger
- gcc_version=`grep version_string ${gcc_version_trigger} | sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/'`
-else
- gcc_version_trigger=
- gcc_version=UNKNOWN
-fi
-
-
-
-
-# Do some error checking and defaulting for the host and target type.
-# The inputs are:
-# configure --host=HOST --target=TARGET --build=BUILD NONOPT
-#
-# The rules are:
-# 1. You are not allowed to specify --host, --target, and nonopt at the
-# same time.
-# 2. Host defaults to nonopt.
-# 3. If nonopt is not specified, then host defaults to the current host,
-# as determined by config.guess.
-# 4. Target and build default to nonopt.
-# 5. If nonopt is not specified, then target and build default to host.
-
-# The aliases save the names the user supplied, while $host etc.
-# will get canonicalized.
-case $host---$target---$nonopt in
-NONE---*---* | *---NONE---* | *---*---NONE) ;;
-*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
-esac
-
-
-# Make sure we can run config.sub.
-if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
-else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
-fi
-
-echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:1100: checking host system type" >&5
-
-host_alias=$host
-case "$host_alias" in
-NONE)
- case $nonopt in
- NONE)
- if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
- else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
- fi ;;
- *) host_alias=$nonopt ;;
- esac ;;
-esac
-
-host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
-host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-echo "$ac_t""$host" 1>&6
-
-echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:1121: checking target system type" >&5
-
-target_alias=$target
-case "$target_alias" in
-NONE)
- case $nonopt in
- NONE) target_alias=$host_alias ;;
- *) target_alias=$nonopt ;;
- esac ;;
-esac
-
-target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias`
-target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-echo "$ac_t""$target" 1>&6
-
-echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:1139: checking build system type" >&5
-
-build_alias=$build
-case "$build_alias" in
-NONE)
- case $nonopt in
- NONE) build_alias=$host_alias ;;
- *) build_alias=$nonopt ;;
- esac ;;
-esac
-
-build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
-build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-echo "$ac_t""$build" 1>&6
-
-test "$host_alias" != "$target_alias" &&
- test "$program_prefix$program_suffix$program_transform_name" = \
- NONENONEs,x,x, &&
- program_prefix=${target_alias}-
-
-
-subdirs="libU77 libI77 libF77"
-
-# Do Makefile first since g2c.h depends on it and shouldn't get an
-# earlier timestamp. Of course, it does when the multilib gunk below
-# edits Makefile, sigh; see additional touch below.
-trap '' 1 2 15
-cat > confcache <<\EOF
-# This file is a shell script that caches the results of configure
-# tests run on this system so they can be shared between configure
-# scripts and configure runs. It is not useful on other systems.
-# If it contains results you don't want to keep, you may remove or edit it.
-#
-# By default, configure uses ./config.cache as the cache file,
-# creating it if it does not exist already. You can give configure
-# the --cache-file=FILE option to use a different cache file; that is
-# what configure does when it calls configure scripts in
-# subdirectories, so they share the cache.
-# Giving --cache-file=/dev/null disables caching, for debugging configure.
-# config.status only pays attention to the cache file if you give it the
-# --recheck option to rerun configure.
-#
-EOF
-# The following way of writing the cache mishandles newlines in values,
-# but we know of no workaround that is simple, portable, and efficient.
-# So, don't put newlines in cache variables' values.
-# Ultrix sh set writes to stderr and can't be redirected directly,
-# and sets the high bit in the cache file unless we assign to the vars.
-(set) 2>&1 |
- case `(ac_space=' '; set | grep ac_space) 2>&1` in
- *ac_space=\ *)
- # `set' does not quote correctly, so add quotes (double-quote substitution
- # turns \\\\ into \\, and sed turns \\ into \).
- sed -n \
- -e "s/'/'\\\\''/g" \
- -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
- ;;
- *)
- # `set' quotes correctly as required by POSIX, so do not add quotes.
- sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
- ;;
- esac >> confcache
-if cmp -s $cache_file confcache; then
- :
-else
- if test -w $cache_file; then
- echo "updating cache $cache_file"
- cat confcache > $cache_file
- else
- echo "not updating unwritable cache $cache_file"
- fi
-fi
-rm -f confcache
-
-trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
-
-test "x$prefix" = xNONE && prefix=$ac_default_prefix
-# Let make expand exec_prefix.
-test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-
-# Any assignment to VPATH causes Sun make to only execute
-# the first set of double-colon rules, so remove it if not needed.
-# If there is a colon in the path, we need to keep it.
-if test "x$srcdir" = x.; then
- ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
-fi
-
-trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
-
-# Transform confdefs.h into DEFS.
-# Protect against shell expansion while executing Makefile rules.
-# Protect against Makefile macro expansion.
-cat > conftest.defs <<\EOF
-s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g
-s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g
-s%\[%\\&%g
-s%\]%\\&%g
-s%\$%$$%g
-EOF
-DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
-rm -f conftest.defs
-
-
-# Without the "./", some shells look in PATH for config.status.
-: ${CONFIG_STATUS=./config.status}
-
-echo creating $CONFIG_STATUS
-rm -f $CONFIG_STATUS
-cat > $CONFIG_STATUS <<EOF
-#! /bin/sh
-# Generated automatically by configure.
-# Run this file to recreate the current configuration.
-# This directory was configured as follows,
-# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-#
-# $0 $ac_configure_args
-#
-# Compiler output produced by configure, useful for debugging
-# configure, is in ./config.log if it exists.
-
-ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
-for ac_option
-do
- case "\$ac_option" in
- -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
- echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
- exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
- -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
- echo "$CONFIG_STATUS generated by autoconf version 2.13"
- exit 0 ;;
- -help | --help | --hel | --he | --h)
- echo "\$ac_cs_usage"; exit 0 ;;
- *) echo "\$ac_cs_usage"; exit 1 ;;
- esac
-done
-
-ac_given_srcdir=$srcdir
-ac_given_INSTALL="$INSTALL"
-
-trap 'rm -fr `echo "Makefile g2c.h:g2c.hin" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
-EOF
-cat >> $CONFIG_STATUS <<EOF
-
-# Protect against being on the right side of a sed subst in config.status.
-sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
- s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
-$ac_vpsub
-$extrasub
-s%@SHELL@%$SHELL%g
-s%@CFLAGS@%$CFLAGS%g
-s%@CPPFLAGS@%$CPPFLAGS%g
-s%@CXXFLAGS@%$CXXFLAGS%g
-s%@FFLAGS@%$FFLAGS%g
-s%@DEFS@%$DEFS%g
-s%@LDFLAGS@%$LDFLAGS%g
-s%@LIBS@%$LIBS%g
-s%@exec_prefix@%$exec_prefix%g
-s%@prefix@%$prefix%g
-s%@program_transform_name@%$program_transform_name%g
-s%@bindir@%$bindir%g
-s%@sbindir@%$sbindir%g
-s%@libexecdir@%$libexecdir%g
-s%@datadir@%$datadir%g
-s%@sysconfdir@%$sysconfdir%g
-s%@sharedstatedir@%$sharedstatedir%g
-s%@localstatedir@%$localstatedir%g
-s%@libdir@%$libdir%g
-s%@includedir@%$includedir%g
-s%@oldincludedir@%$oldincludedir%g
-s%@infodir@%$infodir%g
-s%@mandir@%$mandir%g
-s%@CC@%$CC%g
-s%@AR@%$AR%g
-s%@RANLIB@%$RANLIB%g
-s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
-s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
-s%@INSTALL_DATA@%$INSTALL_DATA%g
-s%@SET_MAKE@%$SET_MAKE%g
-s%@CPP@%$CPP%g
-s%@gcc_version@%$gcc_version%g
-s%@gcc_version_trigger@%$gcc_version_trigger%g
-s%@host@%$host%g
-s%@host_alias@%$host_alias%g
-s%@host_cpu@%$host_cpu%g
-s%@host_vendor@%$host_vendor%g
-s%@host_os@%$host_os%g
-s%@target@%$target%g
-s%@target_alias@%$target_alias%g
-s%@target_cpu@%$target_cpu%g
-s%@target_vendor@%$target_vendor%g
-s%@target_os@%$target_os%g
-s%@build@%$build%g
-s%@build_alias@%$build_alias%g
-s%@build_cpu@%$build_cpu%g
-s%@build_vendor@%$build_vendor%g
-s%@build_os@%$build_os%g
-s%@subdirs@%$subdirs%g
-
-CEOF
-EOF
-
-cat >> $CONFIG_STATUS <<\EOF
-
-# Split the substitutions into bite-sized pieces for seds with
-# small command number limits, like on Digital OSF/1 and HP-UX.
-ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
-ac_file=1 # Number of current file.
-ac_beg=1 # First line for current file.
-ac_end=$ac_max_sed_cmds # Line after last line for current file.
-ac_more_lines=:
-ac_sed_cmds=""
-while $ac_more_lines; do
- if test $ac_beg -gt 1; then
- sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
- else
- sed "${ac_end}q" conftest.subs > conftest.s$ac_file
- fi
- if test ! -s conftest.s$ac_file; then
- ac_more_lines=false
- rm -f conftest.s$ac_file
- else
- if test -z "$ac_sed_cmds"; then
- ac_sed_cmds="sed -f conftest.s$ac_file"
- else
- ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
- fi
- ac_file=`expr $ac_file + 1`
- ac_beg=$ac_end
- ac_end=`expr $ac_end + $ac_max_sed_cmds`
- fi
-done
-if test -z "$ac_sed_cmds"; then
- ac_sed_cmds=cat
-fi
-EOF
-
-cat >> $CONFIG_STATUS <<EOF
-
-CONFIG_FILES=\${CONFIG_FILES-"Makefile g2c.h:g2c.hin"}
-EOF
-cat >> $CONFIG_STATUS <<\EOF
-for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
- # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
- case "$ac_file" in
- *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
- ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
- *) ac_file_in="${ac_file}.in" ;;
- esac
-
- # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
-
- # Remove last slash and all that follows it. Not all systems have dirname.
- ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
- if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
- # The file is in a subdirectory.
- test ! -d "$ac_dir" && mkdir "$ac_dir"
- ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
- # A "../" for each directory in $ac_dir_suffix.
- ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
- else
- ac_dir_suffix= ac_dots=
- fi
-
- case "$ac_given_srcdir" in
- .) srcdir=.
- if test -z "$ac_dots"; then top_srcdir=.
- else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
- /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
- *) # Relative path.
- srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
- top_srcdir="$ac_dots$ac_given_srcdir" ;;
- esac
-
- case "$ac_given_INSTALL" in
- [/$]*) INSTALL="$ac_given_INSTALL" ;;
- *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
- esac
-
- echo creating "$ac_file"
- rm -f "$ac_file"
- configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
- case "$ac_file" in
- *Makefile*) ac_comsub="1i\\
-# $configure_input" ;;
- *) ac_comsub= ;;
- esac
-
- ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
- sed -e "$ac_comsub
-s%@configure_input@%$configure_input%g
-s%@srcdir@%$srcdir%g
-s%@top_srcdir@%$top_srcdir%g
-s%@INSTALL@%$INSTALL%g
-" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
-fi; done
-rm -f conftest.s*
-
-EOF
-cat >> $CONFIG_STATUS <<EOF
-srcdir=${srcdir}
-host=${host}
-target=${target}
-with_target_subdir=${with_target_subdir}
-with_multisubdir=${with_multisubdir}
-ac_configure_args="--enable-multilib ${ac_configure_args}"
-CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-topsrcdir=${topsrcdir}
-
-EOF
-cat >> $CONFIG_STATUS <<\EOF
-test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h
-if test -n "$CONFIG_FILES"; then
- if test -n "${with_target_subdir}"; then
- # FIXME: We shouldn't need to set ac_file
- ac_file=Makefile
- . ${topsrcdir}/config-ml.in
- touch g2c.h # to keep it more recent than Makefile
- fi
-fi
-exit 0
-EOF
-chmod +x $CONFIG_STATUS
-rm -fr confdefs* $ac_clean_files
-test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
-
-if test "$no_recursion" != yes; then
-
- # Remove --cache-file and --srcdir arguments so they do not pile up.
- ac_sub_configure_args=
- ac_prev=
- for ac_arg in $ac_configure_args; do
- if test -n "$ac_prev"; then
- ac_prev=
- continue
- fi
- case "$ac_arg" in
- -cache-file | --cache-file | --cache-fil | --cache-fi \
- | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
- ac_prev=cache_file ;;
- -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
- | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
- ;;
- -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
- ac_prev=srcdir ;;
- -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
- ;;
- *) ac_sub_configure_args="$ac_sub_configure_args $ac_arg" ;;
- esac
- done
-
- for ac_config_dir in libU77 libI77 libF77; do
-
- # Do not complain, so a configure script can configure whichever
- # parts of a large source tree are present.
- if test ! -d $srcdir/$ac_config_dir; then
- continue
- fi
-
- echo configuring in $ac_config_dir
-
- case "$srcdir" in
- .) ;;
- *)
- if test -d ./$ac_config_dir || mkdir ./$ac_config_dir; then :;
- else
- { echo "configure: error: can not create `pwd`/$ac_config_dir" 1>&2; exit 1; }
- fi
- ;;
- esac
-
- ac_popdir=`pwd`
- cd $ac_config_dir
-
- # A "../" for each directory in /$ac_config_dir.
- ac_dots=`echo $ac_config_dir|sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'`
-
- case "$srcdir" in
- .) # No --srcdir option. We are building in place.
- ac_sub_srcdir=$srcdir ;;
- /*) # Absolute path.
- ac_sub_srcdir=$srcdir/$ac_config_dir ;;
- *) # Relative path.
- ac_sub_srcdir=$ac_dots$srcdir/$ac_config_dir ;;
- esac
-
- # Check for guested configure; otherwise get Cygnus style configure.
- if test -f $ac_sub_srcdir/configure; then
- ac_sub_configure=$ac_sub_srcdir/configure
- elif test -f $ac_sub_srcdir/configure.in; then
- ac_sub_configure=$ac_configure
- else
- echo "configure: warning: no configuration information is in $ac_config_dir" 1>&2
- ac_sub_configure=
- fi
-
- # The recursion is here.
- if test -n "$ac_sub_configure"; then
-
- # Make the cache file name correct relative to the subdirectory.
- case "$cache_file" in
- /*) ac_sub_cache_file=$cache_file ;;
- *) # Relative path.
- ac_sub_cache_file="$ac_dots$cache_file" ;;
- esac
- case "$ac_given_INSTALL" in
- [/$]*) INSTALL="$ac_given_INSTALL" ;;
- *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
- esac
-
- echo "running ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir"
- # The eval makes quoting arguments work.
- if eval ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir
- then :
- else
- { echo "configure: error: $ac_sub_configure failed for $ac_config_dir" 1>&2; exit 1; }
- fi
- fi
-
- cd $ac_popdir
- done
-fi
-
-
-
diff --git a/contrib/libf2c/configure.in b/contrib/libf2c/configure.in
deleted file mode 100644
index bbcaac76a02f..000000000000
--- a/contrib/libf2c/configure.in
+++ /dev/null
@@ -1,164 +0,0 @@
-# Process this file with autoconf to produce a configure script.
-# Copyright (C) 1995, 1997, 1998, 1999 Free Software Foundation, Inc.
-# Contributed by Dave Love (d.love@dl.ac.uk).
-#
-#This file is part of GNU Fortran.
-#
-#GNU Fortran 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.
-#
-#GNU Fortran is distributed in the hope that it will be useful,
-#but WITHOUT ANY WARRANTY; without even the implied warranty of
-#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-#GNU General Public License for more details.
-#
-#You should have received a copy of the GNU General Public License
-#along with GNU Fortran; see the file COPYING. If not, write to
-#the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-#02111-1307, USA.
-
-AC_PREREQ(2.13)
-AC_INIT(libF77/Version.c)
-
-if test "${srcdir}" = "." ; then
- if test "${with_target_subdir}" != "." ; then
- topsrcdir=${with_multisrctop}../..
- else
- topsrcdir=${with_multisrctop}..
- fi
-else
- topsrcdir=${srcdir}/..
-fi
-dnl This is needed for a multilibbed build in the source tree so
-dnl that install-sh and config.sub get found.
-AC_CONFIG_AUX_DIR($topsrcdir)
-
-# If the language specific compiler does not exist, but the "gcc" directory
-# does, we do not build anything. Note, $r is set by the top-level Makefile.
-# Note that when we look for the compiler, we search both with and without
-# extension to handle cross and canadian cross builds.
-compiler_name=f771
-rm -f skip-this-dir
-AC_MSG_CHECKING(if compiler $compiler_name has been built)
-AC_CACHE_VAL(g77_cv_compiler_exists,
-[g77_cv_compiler_exists=yes
-if test -n "$r"; then
- if test -d "$r"/gcc; then
- if test -f "$r"/gcc/$compiler_name \
- || test -f "$r"/gcc/$compiler_name.exe; then
- true
- else
- g77_cv_compiler_exists=no
- echo "rm -f config.cache config.log multilib.out" > skip-this-dir
- fi
- fi
-fi
-])
-AC_MSG_RESULT($g77_cv_compiler_exists)
-if test x$g77_cv_compiler_exists = xno
-then
- rm -f Makefile conftest* confdefs* core
- exit 0
-fi
-
-dnl Checks for programs.
-
-dnl FIXME AC_PROG_CC wants CC to be able to link things, but it may
-dnl not be able to.
-define([AC_PROG_CC_WORKS],[])
-
-# For g77 we'll set CC to point at the built gcc, but this will get it into
-# the makefiles
-
-AC_PROG_CC
-
-dnl These should be inherited in the recursive make, but ensure they are
-dnl defined:
-test "$AR" || AR=ar
-AC_SUBST(AR)
-if test "$RANLIB"; then :
- AC_SUBST(RANLIB)
-else
- AC_PROG_RANLIB
-fi
-AC_PROG_INSTALL
-AC_PROG_MAKE_SET
-
-dnl Checks for header files.
-# Sanity check for the cross-compilation case:
-AC_CHECK_HEADER(stdio.h,:,
- [AC_MSG_ERROR([Can't find stdio.h.
-You must have a usable C system for the target already installed, at least
-including headers and, preferably, the library, before you can configure
-the G77 runtime system. If necessary, install gcc now with \`LANGUAGES=c',
-then the target library, then build with \`LANGUAGES=f77'.])])
-
-dnl Checks for g77 integer types built into gcc's C front end.
-AC_MSG_CHECKING(for built-in g77 integer types)
-AC_CACHE_VAL(libf2c_cv_has_g77_builtin_types,
-[AC_TRY_COMPILE(,
- [__g77_integer g77i;
-__g77_uinteger g77ui;
-__g77_longint g77l;
-__g77_ulongint g77ul;],
- libf2c_cv_has_g77_builtin_types=yes,
- libf2c_cv_has_g77_builtin_types=no)])
-AC_MSG_RESULT($libf2c_cv_has_g77_builtin_types)
-if test $libf2c_cv_has_g77_builtin_types = no; then
- AC_MSG_ERROR([gcc doesn't define all of the built in types __g77_integer,
-__g77_uinteger, __g77_longint, and __g77_ulongint. You may not be using
-a new enough version of gcc, or your target may not have type sizes which
-accommodate those types.])
-fi
-
-# avoid confusion in case the `makefile's from the f2c distribution have
-# got put here
-test -f libF77/makefile && mv libF77/makefile libF77/makefile.ori
-test -f libI77/makefile && mv libI77/makefile libI77/makefile.ori
-test -f libU77/makefile && mv libU77/makefile libU77/makefile.ori
-
-# Get the version trigger filename from the toplevel
-if [[ "${with_gcc_version_trigger+set}" = set ]]; then
- gcc_version_trigger=$with_gcc_version_trigger
- gcc_version=`grep version_string ${gcc_version_trigger} | sed -e 's/.*\"\([[^ \"]]*\)[[ \"]].*/\1/'`
-else
- gcc_version_trigger=
- gcc_version=UNKNOWN
-fi
-
-AC_SUBST(gcc_version)
-AC_SUBST(gcc_version_trigger)
-AC_CANONICAL_SYSTEM
-AC_SUBST(target_alias)
-AC_CONFIG_SUBDIRS(libU77 libI77 libF77)
-# Do Makefile first since g2c.h depends on it and shouldn't get an
-# earlier timestamp. Of course, it does when the multilib gunk below
-# edits Makefile, sigh; see additional touch below.
-AC_OUTPUT(Makefile g2c.h:g2c.hin,
- [test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h
-if test -n "$CONFIG_FILES"; then
- if test -n "${with_target_subdir}"; then
- # FIXME: We shouldn't need to set ac_file
- ac_file=Makefile
- . ${topsrcdir}/config-ml.in
- touch g2c.h # to keep it more recent than Makefile
- fi
-fi],
-srcdir=${srcdir}
-host=${host}
-target=${target}
-with_target_subdir=${with_target_subdir}
-with_multisubdir=${with_multisubdir}
-ac_configure_args="--enable-multilib ${ac_configure_args}"
-CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-topsrcdir=${topsrcdir}
-)
-
-
-dnl Local Variables:
-dnl comment-start: "dnl "
-dnl comment-end: ""
-dnl comment-start-skip: "\\bdnl\\b\\s *"
-dnl End:
diff --git a/contrib/libf2c/disclaimer.netlib b/contrib/libf2c/disclaimer.netlib
deleted file mode 100644
index a11108f83db9..000000000000
--- a/contrib/libf2c/disclaimer.netlib
+++ /dev/null
@@ -1,15 +0,0 @@
-f2c is a Fortran to C converter under development since 1990 by
- David M. Gay (then AT&T Bell Labs, now Bell Labs, Lucent Technologies)
- Stu Feldman (then at Bellcore, now at IBM)
- Mark Maimone (Carnegie-Mellon University)
- Norm Schryer (then AT&T Bell Labs, now AT&T Labs)
-Please send bug reports to dmg@research.bell-labs.com .
-
-AT&T, Bellcore and Lucent disclaim all warranties with regard to this
-software, including all implied warranties of merchantability
-and fitness. In no event shall AT&T, Bellcore or Lucent be liable for
-any special, indirect or consequential damages or any damages
-whatsoever resulting from loss of use, data or profits, whether
-in an action of contract, negligence or other tortious action,
-arising out of or in connection with the use or performance of
-this software.
diff --git a/contrib/libf2c/f2c.h b/contrib/libf2c/f2c.h
deleted file mode 100644
index 71e536164974..000000000000
--- a/contrib/libf2c/f2c.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/* f2c.h file for GNU Fortran run-time library
- Copyright (C) 1998 Free Software Foundation, Inc.
- Contributed by James Craig Burley.
-
-This file is part of GNU Fortran.
-
-GNU Fortran 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.
-
-GNU Fortran is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* This file currently is just a stub through which g77's copy
- of netlib's libf2c, which g77 builds and installs as libg2c.a
- (to avoid conflict), #include's g77's version of f2c.h, named
- g2c.h. That file is, in turn, produced via g77's library
- configuration process from g2c.h.in.
-
- By going through this extra "hoop", it is easy to provide for
- libg2c-specific configuration and typedefs that aren't appropriate
- in g2c.h itself (since that is intended to be installed so it can
- be shared with f2c users), without changing the libf2c (libg2c)
- routines themselves. (They continue to #include "f2c.h", just
- like they do in netlib's version.) */
-
-#include "g2c.h"
-
-/* For GNU Fortran (g77), we always enable the following behaviors for
- libf2c, to make things easy on the programmer. The alternate
- behaviors have their uses, and g77 might provide them as compiler,
- rather than library, options, so only a single copy of a shared libf2c
- need be built for a system. */
-
-/* This makes unformatted I/O more consistent in relation to other
- systems. It is not required by the F77 standard. */
-
-#define Pad_UDread
-
-/* This makes ERR= and IOSTAT= returns work properly in disk-full
- situations, making things work more as expected. It slows things
- down, so g77 will probably someday choose the original implementation
- on a case-by-case basis when it can be shown to not be necessary
- (e.g. no ERR= or IOSTAT=) or when it is given the appropriate
- compile-time option or, perhaps, source-code directive.
-
- (No longer defined, since it really slows down NFS access too much.) */
-
-/* #define ALWAYS_FLUSH */
-
-/* Most Fortran implementations do this, so to make it easier
- to compare the output of g77-compiled programs to those compiled
- by most other compilers, tell libf2c to put leading zeros in
- appropriate places on output. */
-
-#define WANT_LEAD_0
diff --git a/contrib/libf2c/f2cext.c b/contrib/libf2c/f2cext.c
deleted file mode 100644
index 56f9490c6f51..000000000000
--- a/contrib/libf2c/f2cext.c
+++ /dev/null
@@ -1,581 +0,0 @@
-/* Copyright (C) 1997 Free Software Foundation, Inc.
-This file is part of GNU Fortran run-time library.
-
-This library is free software; you can redistribute it and/or modify it
-under the terms of the GNU Library General Public License as published
-by the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-GNU Fortran 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 GNU Fortran; 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 <math.h> /* for j0 et al */
-#include <f2c.h>
-typedef void *sig_proc; /* For now, this will have to do. */
-
-#ifdef Labort
-int abort_ (void) {
- extern int G77_abort_0 (void);
- return G77_abort_0 ();
-}
-#endif
-
-#ifdef Lderf
-double derf_ (doublereal *x) {
- extern double G77_derf_0 (doublereal *x);
- return G77_derf_0 (x);
-}
-#endif
-
-#ifdef Lderfc
-double derfc_ (doublereal *x) {
- extern double G77_derfc_0 (doublereal *x);
- return G77_derfc_0 (x);
-}
-#endif
-
-#ifdef Lef1asc
-int ef1asc_ (ftnint *a, ftnlen *la, ftnint *b, ftnlen *lb) {
- extern int G77_ef1asc_0 (ftnint *a, ftnlen *la, ftnint *b, ftnlen *lb);
- return G77_ef1asc_0 (a, la, b, lb);
-}
-#endif
-
-#ifdef Lef1cmc
-integer ef1cmc_ (ftnint *a, ftnlen *la, ftnint *b, ftnlen *lb) {
- extern integer G77_ef1cmc_0 (ftnint *a, ftnlen *la, ftnint *b, ftnlen *lb);
- return G77_ef1cmc_0 (a, la, b, lb);
-}
-#endif
-
-#ifdef Lerf
-double erf_ (real *x) {
- extern double G77_erf_0 (real *x);
- return G77_erf_0 (x);
-}
-#endif
-
-#ifdef Lerfc
-double erfc_ (real *x) {
- extern double G77_erfc_0 (real *x);
- return G77_erfc_0 (x);
-}
-#endif
-
-#ifdef Lexit
-void exit_ (integer *rc) {
- extern void G77_exit_0 (integer *rc);
- G77_exit_0 (rc);
-}
-#endif
-
-#ifdef Lgetarg
-void getarg_ (ftnint *n, char *s, ftnlen ls) {
- extern void G77_getarg_0 (ftnint *n, char *s, ftnlen ls);
- G77_getarg_0 (n, s, ls);
-}
-#endif
-
-#ifdef Lgetenv
-void getenv_ (char *fname, char *value, ftnlen flen, ftnlen vlen) {
- extern void G77_getenv_0 (char *fname, char *value, ftnlen flen, ftnlen vlen);
- G77_getenv_0 (fname, value, flen, vlen);
-}
-#endif
-
-#ifdef Liargc
-ftnint iargc_ (void) {
- extern ftnint G77_iargc_0 (void);
- return G77_iargc_0 ();
-}
-#endif
-
-#ifdef Lsignal
-void *signal_ (integer *sigp, sig_proc proc) {
- extern void *G77_signal_0 (integer *sigp, sig_proc proc);
- return G77_signal_0 (sigp, proc);
-}
-#endif
-
-#ifdef Lsystem
-integer system_ (char *s, ftnlen n) {
- extern integer G77_system_0 (char *s, ftnlen n);
- return G77_system_0 (s, n);
-}
-#endif
-
-#ifdef Lflush
-int flush_ (void) {
- extern int G77_flush_0 (void);
- return G77_flush_0 ();
-}
-#endif
-
-#ifdef Lftell
-integer ftell_ (integer *Unit) {
- extern integer G77_ftell_0 (integer *Unit);
- return G77_ftell_0 (Unit);
-}
-#endif
-
-#ifdef Lfseek
-integer fseek_ (integer *Unit, integer *offset, integer *xwhence) {
- extern integer G77_fseek_0 (integer *Unit, integer *offset, integer *xwhence);
- return G77_fseek_0 (Unit, offset, xwhence);
-}
-#endif
-
-#ifdef Laccess
-integer access_ (const char *name, const char *mode, ftnlen Lname, ftnlen Lmode) {
- extern integer G77_access_0 (const char *name, const char *mode, ftnlen Lname, ftnlen Lmode);
- return G77_access_0 (name, mode, Lname, Lmode);
-}
-#endif
-
-#ifdef Lalarm
-integer alarm_ (integer *seconds, sig_proc proc, integer *status) {
- extern integer G77_alarm_0 (integer *seconds, sig_proc proc);
- return G77_alarm_0 (seconds, proc);
-}
-#endif
-
-#ifdef Lbesj0
-double besj0_ (const real *x) {
- return j0 (*x);
-}
-#endif
-
-#ifdef Lbesj1
-double besj1_ (const real *x) {
- return j1 (*x);
-}
-#endif
-
-#ifdef Lbesjn
-double besjn_ (const integer *n, real *x) {
- return jn (*n, *x);
-}
-#endif
-
-#ifdef Lbesy0
-double besy0_ (const real *x) {
- return y0 (*x);
-}
-#endif
-
-#ifdef Lbesy1
-double besy1_ (const real *x) {
- return y1 (*x);
-}
-#endif
-
-#ifdef Lbesyn
-double besyn_ (const integer *n, real *x) {
- return yn (*n, *x);
-}
-#endif
-
-#ifdef Lchdir
-integer chdir_ (const char *name, const ftnlen Lname) {
- extern integer G77_chdir_0 (const char *name, const ftnlen Lname);
- return G77_chdir_0 (name, Lname);
-}
-#endif
-
-#ifdef Lchmod
-integer chmod_ (const char *name, const char *mode, const ftnlen Lname, const ftnlen Lmode) {
- extern integer G77_chmod_0 (const char *name, const char *mode, const ftnlen Lname, const ftnlen Lmode);
- return G77_chmod_0 (name, mode, Lname, Lmode);
-}
-#endif
-
-#ifdef Lctime
-void ctime_ (char *chtime, const ftnlen Lchtime, longint *xstime) {
- extern void G77_ctime_0 (char *chtime, const ftnlen Lchtime, longint *xstime);
- G77_ctime_0 (chtime, Lchtime, xstime);
-}
-#endif
-
-#ifdef Ldate_y2kbuggy
-int date_ (char *buf, ftnlen buf_len) {
- /* Fail to link, so user sees attempt to invoke non-Y2K-compliant
- routine. */
- extern int G77_date_y2kbuggy_0 (char *buf, ftnlen buf_len);
- return G77_date_y2kbuggy_0 (buf, buf_len);
-}
-#endif
-
-#ifdef Ldate_y2kbug
-int date_y2kbug__ (char *buf, ftnlen buf_len) {
- /* If user wants to invoke the non-Y2K-compliant routine via
- an `EXTERNAL' interface, avoiding the warning via g77's
- `INTRINSIC' interface, force coding of "y2kbug" string in
- user's program. */
- extern int G77_date_y2kbug_0 (char *buf, ftnlen buf_len);
- return G77_date_y2kbug_0 (buf, buf_len);
-}
-#endif
-
-#ifdef Ldbesj0
-double dbesj0_ (const double *x) {
- return j0 (*x);
-}
-#endif
-
-#ifdef Ldbesj1
-double dbesj1_ (const double *x) {
- return j1 (*x);
-}
-#endif
-
-#ifdef Ldbesjn
-double dbesjn_ (const integer *n, double *x) {
- return jn (*n, *x);
-}
-#endif
-
-#ifdef Ldbesy0
-double dbesy0_ (const double *x) {
- return y0 (*x);
-}
-#endif
-
-#ifdef Ldbesy1
-double dbesy1_ (const double *x) {
- return y1 (*x);
-}
-#endif
-
-#ifdef Ldbesyn
-double dbesyn_ (const integer *n, double *x) {
- return yn (*n, *x);
-}
-#endif
-
-#ifdef Ldtime
-double dtime_ (real tarray[2]) {
- extern double G77_dtime_0 (real tarray[2]);
- return G77_dtime_0 (tarray);
-}
-#endif
-
-#ifdef Letime
-double etime_ (real tarray[2]) {
- extern double G77_etime_0 (real tarray[2]);
- return G77_etime_0 (tarray);
-}
-#endif
-
-#ifdef Lfdate
-void fdate_ (char *ret_val, ftnlen ret_val_len) {
- extern void G77_fdate_0 (char *ret_val, ftnlen ret_val_len);
- G77_fdate_0 (ret_val, ret_val_len);
-}
-#endif
-
-#ifdef Lfgetc
-integer fgetc_ (const integer *lunit, char *c, ftnlen Lc) {
- extern integer G77_fgetc_0 (const integer *lunit, char *c, ftnlen Lc);
- return G77_fgetc_0 (lunit, c, Lc);
-}
-#endif
-
-#ifdef Lfget
-integer fget_ (char *c, const ftnlen Lc) {
- extern integer G77_fget_0 (char *c, const ftnlen Lc);
- return G77_fget_0 (c, Lc);
-}
-#endif
-
-#ifdef Lflush1
-int flush1_ (const integer *lunit) {
- extern int G77_flush1_0 (const integer *lunit);
- return G77_flush1_0 (lunit);
-}
-#endif
-
-#ifdef Lfnum
-integer fnum_ (integer *lunit) {
- extern integer G77_fnum_0 (integer *lunit);
- return G77_fnum_0 (lunit);
-}
-#endif
-
-#ifdef Lfputc
-integer fputc_ (const integer *lunit, const char *c, const ftnlen Lc) {
- extern integer G77_fputc_0 (const integer *lunit, const char *c, const ftnlen Lc);
- return G77_fputc_0 (lunit, c, Lc);
-}
-#endif
-
-#ifdef Lfput
-integer fput_ (const char *c, const ftnlen Lc) {
- extern integer G77_fput_0 (const char *c, const ftnlen Lc);
- return G77_fput_0 (c, Lc);
-}
-#endif
-
-#ifdef Lfstat
-integer fstat_ (const integer *lunit, integer statb[13]) {
- extern integer G77_fstat_0 (const integer *lunit, integer statb[13]);
- return G77_fstat_0 (lunit, statb);
-}
-#endif
-
-#ifdef Lgerror
-int gerror_ (char *str, ftnlen Lstr) {
- extern int G77_gerror_0 (char *str, ftnlen Lstr);
- return G77_gerror_0 (str, Lstr);
-}
-#endif
-
-#ifdef Lgetcwd
-integer getcwd_ (char *str, const ftnlen Lstr) {
- extern integer G77_getcwd_0 (char *str, const ftnlen Lstr);
- return G77_getcwd_0 (str, Lstr);
-}
-#endif
-
-#ifdef Lgetgid
-integer getgid_ (void) {
- extern integer G77_getgid_0 (void);
- return G77_getgid_0 ();
-}
-#endif
-
-#ifdef Lgetlog
-int getlog_ (char *str, const ftnlen Lstr) {
- extern int G77_getlog_0 (char *str, const ftnlen Lstr);
- return G77_getlog_0 (str, Lstr);
-}
-#endif
-
-#ifdef Lgetpid
-integer getpid_ (void) {
- extern integer G77_getpid_0 (void);
- return G77_getpid_0 ();
-}
-#endif
-
-#ifdef Lgetuid
-integer getuid_ (void) {
- extern integer G77_getuid_0 (void);
- return G77_getuid_0 ();
-}
-#endif
-
-#ifdef Lgmtime
-int gmtime_ (const integer *stime, integer tarray[9]) {
- extern int G77_gmtime_0 (const integer *stime, integer tarray[9]);
- return G77_gmtime_0 (stime, tarray);
-}
-#endif
-
-#ifdef Lhostnm
-integer hostnm_ (char *name, ftnlen Lname) {
- extern integer G77_hostnm_0 (char *name, ftnlen Lname);
- return G77_hostnm_0 (name, Lname);
-}
-#endif
-
-#ifdef Lidate
-int idate_ (int iarray[3]) {
- extern int G77_idate_0 (int iarray[3]);
- return G77_idate_0 (iarray);
-}
-#endif
-
-#ifdef Lierrno
-integer ierrno_ (void) {
- extern integer G77_ierrno_0 (void);
- return G77_ierrno_0 ();
-}
-#endif
-
-#ifdef Lirand
-integer irand_ (integer *flag) {
- extern integer G77_irand_0 (integer *flag);
- return G77_irand_0 (flag);
-}
-#endif
-
-#ifdef Lisatty
-logical isatty_ (integer *lunit) {
- extern logical G77_isatty_0 (integer *lunit);
- return G77_isatty_0 (lunit);
-}
-#endif
-
-#ifdef Litime
-int itime_ (integer tarray[3]) {
- extern int G77_itime_0 (integer tarray[3]);
- return G77_itime_0 (tarray);
-}
-#endif
-
-#ifdef Lkill
-integer kill_ (const integer *pid, const integer *signum) {
- extern integer G77_kill_0 (const integer *pid, const integer *signum);
- return G77_kill_0 (pid, signum);
-}
-#endif
-
-#ifdef Llink
-integer link_ (const char *path1, const char *path2, const ftnlen Lpath1, const ftnlen Lpath2) {
- extern integer G77_link_0 (const char *path1, const char *path2, const ftnlen Lpath1, const ftnlen Lpath2);
- return G77_link_0 (path1, path2, Lpath1, Lpath2);
-}
-#endif
-
-#ifdef Llnblnk
-integer lnblnk_ (char *str, ftnlen str_len) {
- extern integer G77_lnblnk_0 (char *str, ftnlen str_len);
- return G77_lnblnk_0 (str, str_len);
-}
-#endif
-
-#ifdef Llstat
-integer lstat_ (const char *name, integer statb[13], const ftnlen Lname) {
- extern integer G77_lstat_0 (const char *name, integer statb[13], const ftnlen Lname);
- return G77_lstat_0 (name, statb, Lname);
-}
-#endif
-
-#ifdef Lltime
-int ltime_ (const integer *stime, integer tarray[9]) {
- extern int G77_ltime_0 (const integer *stime, integer tarray[9]);
- return G77_ltime_0 (stime, tarray);
-}
-#endif
-
-#ifdef Lmclock
-longint mclock_ (void) {
- extern longint G77_mclock_0 (void);
- return G77_mclock_0 ();
-}
-#endif
-
-#ifdef Lperror
-int perror_ (const char *str, const ftnlen Lstr) {
- extern int G77_perror_0 (const char *str, const ftnlen Lstr);
- return G77_perror_0 (str, Lstr);
-}
-#endif
-
-#ifdef Lrand
-double rand_ (integer *flag) {
- extern double G77_rand_0 (integer *flag);
- return G77_rand_0 (flag);
-}
-#endif
-
-#ifdef Lrename
-integer rename_ (const char *path1, const char *path2, const ftnlen Lpath1, const ftnlen Lpath2) {
- extern integer G77_rename_0 (const char *path1, const char *path2, const ftnlen Lpath1, const ftnlen Lpath2);
- return G77_rename_0 (path1, path2, Lpath1, Lpath2);
-}
-#endif
-
-#ifdef Lsecnds
-double secnds_ (real *r) {
- extern double G77_secnds_0 (real *r);
- return G77_secnds_0 (r);
-}
-#endif
-
-#ifdef Lsecond
-double second_ () {
- extern double G77_second_0 ();
- return G77_second_0 ();
-}
-#endif
-
-#ifdef Lsleep
-int sleep_ (const integer *seconds) {
- extern int G77_sleep_0 (const integer *seconds);
- return G77_sleep_0 (seconds);
-}
-#endif
-
-#ifdef Lsrand
-int srand_ (const integer *seed) {
- extern int G77_srand_0 (const integer *seed);
- return G77_srand_0 (seed);
-}
-#endif
-
-#ifdef Lstat
-integer stat_ (const char *name, integer statb[13], const ftnlen Lname) {
- extern integer G77_stat_0 (const char *name, integer statb[13], const ftnlen Lname);
- return G77_stat_0 (name, statb, Lname);
-}
-#endif
-
-#ifdef Lsymlnk
-integer symlnk_ (const char *path1, const char *path2, const ftnlen Lpath1, const ftnlen Lpath2) {
- extern integer G77_symlnk_0 (const char *path1, const char *path2, const ftnlen Lpath1, const ftnlen Lpath2);
- return G77_symlnk_0 (path1, path2, Lpath1, Lpath2);
-}
-#endif
-
-#ifdef Ltime
-longint time_ (void) {
- extern longint G77_time_0 (void);
- return G77_time_0 ();
-}
-#endif
-
-#ifdef Lttynam
-void ttynam_ (char *ret_val, ftnlen ret_val_len, integer *lunit) {
- extern void G77_ttynam_0 (char *ret_val, ftnlen ret_val_len, integer *lunit);
- G77_ttynam_0 (ret_val, ret_val_len, lunit);
-}
-#endif
-
-#ifdef Lumask
-integer umask_ (integer *mask) {
- extern integer G77_umask_0 (integer *mask);
- return G77_umask_0 (mask);
-}
-#endif
-
-#ifdef Lunlink
-integer unlink_ (const char *str, const ftnlen Lstr) {
- extern integer G77_unlink_0 (const char *str, const ftnlen Lstr);
- return G77_unlink_0 (str, Lstr);
-}
-#endif
-
-#ifdef Lvxtidt_y2kbuggy
-int vxtidate_ (integer *m, integer *d, integer *y) {
- /* Fail to link, so user sees attempt to invoke non-Y2K-compliant
- routine. */
- extern int G77_vxtidate_y2kbuggy_0 (integer *m, integer *d, integer *y);
- return G77_vxtidate_y2kbuggy_0 (m, d, y);
-}
-#endif
-
-#ifdef Lvxtidt_y2kbug
-int vxtidate_y2kbug__ (integer *m, integer *d, integer *y) {
- /* If user wants to invoke the non-Y2K-compliant routine via
- an `EXTERNAL' interface, avoiding the warning via g77's
- `INTRINSIC' interface, force coding of "y2kbug" string in
- user's program. */
- extern int G77_vxtidate_y2kbug_0 (integer *m, integer *d, integer *y);
- return G77_vxtidate_y2kbug_0 (m, d, y);
-}
-#endif
-
-#ifdef Lvxttim
-void vxttime_ (char chtime[8], const ftnlen Lchtime) {
- extern void G77_vxttime_0 (char chtime[8], const ftnlen Lchtime);
- G77_vxttime_0 (chtime, Lchtime);
-}
-#endif
diff --git a/contrib/libf2c/g2c.hin b/contrib/libf2c/g2c.hin
deleted file mode 100644
index 57947ce6e80e..000000000000
--- a/contrib/libf2c/g2c.hin
+++ /dev/null
@@ -1,236 +0,0 @@
-/* g2c.h -- g77 version of f2c (Standard Fortran to C header file) */
-
-/* This file is generated by the g77 libg2c configuration process from a
- file named g2c.hin. This process sets up the appropriate types,
- defines the appropriate macros, and so on. The resulting g2c.h file
- is used to build g77's copy of libf2c, named libg2c, and also can
- be used when compiling C code produced by f2c to link the resulting
- object file(s) with those produced by the same version of g77 that
- produced this file, allowing inter-operability of f2c-compiled and
- g77-compiled code. */
-
-/** barf [ba:rf] 2. "He suggested using FORTRAN, and everybody barfed."
-
- - From The Shogakukan DICTIONARY OF NEW ENGLISH (Second edition) */
-
-#ifndef F2C_INCLUDE
-#define F2C_INCLUDE
-
-/* F2C_INTEGER will normally be `int' but would be `long' on 16-bit systems */
-/* we assume short, float are OK */
-typedef __g77_integer integer;
-typedef __g77_uinteger uinteger;
-typedef char *address;
-typedef short int shortint;
-typedef float real;
-typedef double doublereal;
-typedef struct { real r, i; } complex;
-typedef struct { doublereal r, i; } doublecomplex;
-typedef __g77_integer logical;
-typedef short int shortlogical;
-typedef char logical1;
-typedef char integer1;
-typedef __g77_longint longint; /* system-dependent */
-typedef __g77_ulongint ulongint; /* system-dependent */
-#define qbit_clear(a,b) ((a) & ~((ulongint)1 << (b)))
-#define qbit_set(a,b) ((a) | ((ulongint)1 << (b)))
-
-#define TRUE_ (1)
-#define FALSE_ (0)
-
-/* Extern is for use with -E */
-#ifndef Extern
-#define Extern extern
-#endif
-
-/* I/O stuff */
-
-#ifdef f2c_i2
-#error "f2c_i2 will not work with g77!!!!"
-/* for -i2 */
-typedef short flag;
-typedef short ftnlen;
-typedef short ftnint;
-#else
-typedef __g77_integer flag;
-typedef __g77_integer ftnlen;
-typedef __g77_integer ftnint;
-#endif
-
-/*external read, write*/
-typedef struct
-{ flag cierr;
- ftnint ciunit;
- flag ciend;
- char *cifmt;
- ftnint cirec;
-} cilist;
-
-/*internal read, write*/
-typedef struct
-{ flag icierr;
- char *iciunit;
- flag iciend;
- char *icifmt;
- ftnint icirlen;
- ftnint icirnum;
-} icilist;
-
-/*open*/
-typedef struct
-{ flag oerr;
- ftnint ounit;
- char *ofnm;
- ftnlen ofnmlen;
- char *osta;
- char *oacc;
- char *ofm;
- ftnint orl;
- char *oblnk;
-} olist;
-
-/*close*/
-typedef struct
-{ flag cerr;
- ftnint cunit;
- char *csta;
-} cllist;
-
-/*rewind, backspace, endfile*/
-typedef struct
-{ flag aerr;
- ftnint aunit;
-} alist;
-
-/* inquire */
-typedef struct
-{ flag inerr;
- ftnint inunit;
- char *infile;
- ftnlen infilen;
- ftnint *inex; /*parameters in standard's order*/
- ftnint *inopen;
- ftnint *innum;
- ftnint *innamed;
- char *inname;
- ftnlen innamlen;
- char *inacc;
- ftnlen inacclen;
- char *inseq;
- ftnlen inseqlen;
- char *indir;
- ftnlen indirlen;
- char *infmt;
- ftnlen infmtlen;
- char *inform;
- ftnint informlen;
- char *inunf;
- ftnlen inunflen;
- ftnint *inrecl;
- ftnint *innrec;
- char *inblank;
- ftnlen inblanklen;
-} inlist;
-
-#define VOID void
-
-union Multitype { /* for multiple entry points */
- integer1 g;
- shortint h;
- integer i;
- /* longint j; */
- real r;
- doublereal d;
- complex c;
- doublecomplex z;
- };
-
-typedef union Multitype Multitype;
-
-/*typedef long int Long;*/ /* No longer used; formerly in Namelist */
-
-struct Vardesc { /* for Namelist */
- char *name;
- char *addr;
- ftnlen *dims;
- int type;
- };
-typedef struct Vardesc Vardesc;
-
-struct Namelist {
- char *name;
- Vardesc **vars;
- int nvars;
- };
-typedef struct Namelist Namelist;
-
-#define abs(x) ((x) >= 0 ? (x) : -(x))
-#define dabs(x) (doublereal)abs(x)
-#define min(a,b) ((a) <= (b) ? (a) : (b))
-#define max(a,b) ((a) >= (b) ? (a) : (b))
-#define dmin(a,b) (doublereal)min(a,b)
-#define dmax(a,b) (doublereal)max(a,b)
-#define bit_test(a,b) ((a) >> (b) & 1)
-#define bit_clear(a,b) ((a) & ~((uinteger)1 << (b)))
-#define bit_set(a,b) ((a) | ((uinteger)1 << (b)))
-
-/* procedure parameter types for -A and -C++ */
-
-#define F2C_proc_par_types 1
-#ifdef __cplusplus
-typedef int /* Unknown procedure type */ (*U_fp)(...);
-typedef shortint (*J_fp)(...);
-typedef integer (*I_fp)(...);
-typedef real (*R_fp)(...);
-typedef doublereal (*D_fp)(...), (*E_fp)(...);
-typedef /* Complex */ VOID (*C_fp)(...);
-typedef /* Double Complex */ VOID (*Z_fp)(...);
-typedef logical (*L_fp)(...);
-typedef shortlogical (*K_fp)(...);
-typedef /* Character */ VOID (*H_fp)(...);
-typedef /* Subroutine */ int (*S_fp)(...);
-#else
-typedef int /* Unknown procedure type */ (*U_fp)();
-typedef shortint (*J_fp)();
-typedef integer (*I_fp)();
-typedef real (*R_fp)();
-typedef doublereal (*D_fp)(), (*E_fp)();
-typedef /* Complex */ VOID (*C_fp)();
-typedef /* Double Complex */ VOID (*Z_fp)();
-typedef logical (*L_fp)();
-typedef shortlogical (*K_fp)();
-typedef /* Character */ VOID (*H_fp)();
-typedef /* Subroutine */ int (*S_fp)();
-#endif
-/* E_fp is for real functions when -R is not specified */
-typedef VOID C_f; /* complex function */
-typedef VOID H_f; /* character function */
-typedef VOID Z_f; /* double complex function */
-typedef doublereal E_f; /* real function with -R not specified */
-
-/* undef any lower-case symbols that your C compiler predefines, e.g.: */
-
-#ifndef Skip_f2c_Undefs
-/* (No such symbols should be defined in a strict ANSI C compiler.
- We can avoid trouble with f2c-translated code by using
- gcc -ansi [-traditional].) */
-#undef cray
-#undef gcos
-#undef mc68010
-#undef mc68020
-#undef mips
-#undef pdp11
-#undef sgi
-#undef sparc
-#undef sun
-#undef sun2
-#undef sun3
-#undef sun4
-#undef u370
-#undef u3b
-#undef u3b2
-#undef u3b5
-#undef unix
-#undef vax
-#endif
-#endif
diff --git a/contrib/libf2c/libF77/F77_aloc.c b/contrib/libf2c/libF77/F77_aloc.c
deleted file mode 100644
index e329a1bfb341..000000000000
--- a/contrib/libf2c/libF77/F77_aloc.c
+++ /dev/null
@@ -1,38 +0,0 @@
-#include "f2c.h"
-#undef abs
-#undef min
-#undef max
-#include <stdio.h>
-
-static integer memfailure = 3;
-
-#ifdef KR_headers
-extern char *malloc();
-extern void G77_exit_0 ();
-
- char *
-F77_aloc(Len, whence) integer Len; char *whence;
-#else
-#include <stdlib.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
-extern void G77_exit_0 (integer*);
-#ifdef __cplusplus
- }
-#endif
-
- char *
-F77_aloc(integer Len, char *whence)
-#endif
-{
- char *rv;
- unsigned int uLen = (unsigned int) Len; /* for K&R C */
-
- if (!(rv = (char*)malloc(uLen))) {
- fprintf(stderr, "malloc(%u) failure in %s\n",
- uLen, whence);
- G77_exit_0 (&memfailure);
- }
- return rv;
- }
diff --git a/contrib/libf2c/libF77/Makefile.in b/contrib/libf2c/libF77/Makefile.in
deleted file mode 100644
index 74c69a0915a6..000000000000
--- a/contrib/libf2c/libF77/Makefile.in
+++ /dev/null
@@ -1,247 +0,0 @@
-# Makefile for GNU F77 compiler runtime.
-# Copyright 1990 - 1994 by AT&T Bell Laboratories and Bellcore (see the
-# file `Notice').
-# Portions of this file Copyright (C) 1995-1998 Free Software Foundation, Inc.
-# Contributed by Dave Love (d.love@dl.ac.uk).
-#
-#This file is part of GNU Fortran.
-#
-#GNU Fortran 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.
-#
-#GNU Fortran is distributed in the hope that it will be useful,
-#but WITHOUT ANY WARRANTY; without even the implied warranty of
-#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-#GNU General Public License for more details.
-#
-#You should have received a copy of the GNU General Public License
-#along with GNU Fortran; see the file COPYING. If not, write to
-#the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-#02111-1307, USA.
-
-#### Start of system configuration section. ####
-
-# $(srcdir) must be set to the g77 runtime libF77 source directory.
-srcdir = @srcdir@
-VPATH = @srcdir@
-
-# configure sets this to all the -D options appropriate for the
-# configuration.
-DEFS = @DEFS@
-
-LIBG2C = ../libg2c.a
-
-F2C_H_DIR = @srcdir@/..
-G2C_H_DIR = ..
-CC = @CC@
-CFLAGS = @CFLAGS@
-CPPFLAGS = @CPPFLAGS@
-AR = @AR@
-ARFLAGS = rc
-@SET_MAKE@
-
-SHELL = /bin/sh
-
-#### End of system configuration section. ####
-
-ALL_CFLAGS = -I. -I$(srcdir) -I$(G2C_H_DIR) -I$(F2C_H_DIR) $(CPPFLAGS) $(DEFS) $(CFLAGS)
-
-.SUFFIXES:
-.SUFFIXES: .c .o
-
-.c.o:
- $(CC) -c -DSkip_f2c_Undefs $(ALL_CFLAGS) $<
-
-MISC = F77_aloc.o VersionF.o main.o s_rnge.o abort_.o getarg_.o iargc_.o\
- getenv_.o signal_.o s_stop.o s_paus.o system_.o cabs.o\
- derf_.o derfc_.o erf_.o erfc_.o sig_die.o exit_.o setarg.o setsig.o
-POW = pow_ci.o pow_dd.o pow_di.o pow_hh.o pow_ii.o pow_ri.o pow_zi.o pow_zz.o \
- pow_qq.o
-CX = c_abs.o c_cos.o c_div.o c_exp.o c_log.o c_sin.o c_sqrt.o
-DCX = z_abs.o z_cos.o z_div.o z_exp.o z_log.o z_sin.o z_sqrt.o
-REAL = r_abs.o r_acos.o r_asin.o r_atan.o r_atn2.o r_cnjg.o r_cos.o\
- r_cosh.o r_dim.o r_exp.o r_imag.o r_int.o\
- r_lg10.o r_log.o r_mod.o r_nint.o r_sign.o\
- r_sin.o r_sinh.o r_sqrt.o r_tan.o r_tanh.o
-DBL = d_abs.o d_acos.o d_asin.o d_atan.o d_atn2.o\
- d_cnjg.o d_cos.o d_cosh.o d_dim.o d_exp.o\
- d_imag.o d_int.o d_lg10.o d_log.o d_mod.o\
- d_nint.o d_prod.o d_sign.o d_sin.o d_sinh.o\
- d_sqrt.o d_tan.o d_tanh.o
-INT = i_abs.o i_dim.o i_dnnt.o i_indx.o i_len.o i_mod.o i_nint.o i_sign.o
-HALF = h_abs.o h_dim.o h_dnnt.o h_indx.o h_len.o h_mod.o h_nint.o h_sign.o
-CMP = l_ge.o l_gt.o l_le.o l_lt.o hl_ge.o hl_gt.o hl_le.o hl_lt.o
-EFL = ef1asc_.o ef1cmc_.o
-CHAR = s_cat.o s_cmp.o s_copy.o
-F90BIT = lbitbits.o lbitshft.o qbitbits.o qbitshft.o
-
-OBJS = $(MISC) $(POW) $(CX) $(DCX) $(REAL) $(DBL) $(INT) \
- $(HALF) $(CMP) $(EFL) $(CHAR) $(F90BIT)
-
-all: ../s-libf77
-
-../s-libf77: $(OBJS)
- echo timestamp > ../s-libf77
-
-archive:
- $(AR) $(ARFLAGS) $(LIBG2C) $(OBJS)
-
-Makefile: Makefile.in config.status
- $(SHELL) config.status
-
-config.status: configure
- rm -f config.cache
- CONFIG_SITE=no-such-file CC='$(CC)' AR='$(AR)' CFLAGS='$(CFLAGS)' \
- CPPFLAGS='$(CPPFLAGS)' $(SHELL) config.status --recheck
-
-${srcdir}/configure: configure.in
- rm -f config.cache
- cd ${srcdir} && autoconf
-
-VersionF.o: Version.c
- $(CC) -c $(ALL_CFLAGS) -o $@ $(srcdir)/Version.c
-
-F77_aloc.o: F77_aloc.c
-main.o: main.c
-s_rnge.o: s_rnge.c
-abort_.o: abort_.c
-getarg_.o: getarg_.c
-iargc_.o: iargc_.c
-getenv_.o: getenv_.c
-signal_.o: signal_.c
-s_stop.o: s_stop.c
-s_paus.o: s_paus.c
-system_.o: system_.c
-cabs.o: cabs.c
-derf_.o: derf_.c
-derfc_.o: derfc_.c
-erf_.o: erf_.c
-erfc_.o: erfc_.c
-sig_die.o: sig_die.c
-exit_.o: exit_.c
-setarg.o: setarg.c
-setsig.o: setsig.c
-pow_ci.o: pow_ci.c
-pow_dd.o: pow_dd.c
-pow_di.o: pow_di.c
-pow_hh.o: pow_hh.c
-pow_ii.o: pow_ii.c
-pow_ri.o: pow_ri.c
-pow_zi.o: pow_zi.c
-pow_zz.o: pow_zz.c
-pow_qq.o: pow_qq.c
-c_abs.o: c_abs.c
-c_cos.o: c_cos.c
-c_div.o: c_div.c
-c_exp.o: c_exp.c
-c_log.o: c_log.c
-c_sin.o: c_sin.c
-c_sqrt.o: c_sqrt.c
-z_abs.o: z_abs.c
-z_cos.o: z_cos.c
-z_div.o: z_div.c
-z_exp.o: z_exp.c
-z_log.o: z_log.c
-z_sin.o: z_sin.c
-z_sqrt.o: z_sqrt.c
-r_abs.o: r_abs.c
-r_acos.o: r_acos.c
-r_asin.o: r_asin.c
-r_atan.o: r_atan.c
-r_atn2.o: r_atn2.c
-r_cnjg.o: r_cnjg.c
-r_cos.o: r_cos.c
-r_cosh.o: r_cosh.c
-r_dim.o: r_dim.c
-r_exp.o: r_exp.c
-r_imag.o: r_imag.c
-r_int.o: r_int.c
-r_lg10.o: r_lg10.c
-r_log.o: r_log.c
-r_mod.o: r_mod.c
-r_nint.o: r_nint.c
-r_sign.o: r_sign.c
-r_sin.o: r_sin.c
-r_sinh.o: r_sinh.c
-r_sqrt.o: r_sqrt.c
-r_tan.o: r_tan.c
-r_tanh.o: r_tanh.c
-d_abs.o: d_abs.c
-d_acos.o: d_acos.c
-d_asin.o: d_asin.c
-d_atan.o: d_atan.c
-d_atn2.o: d_atn2.c
-d_cnjg.o: d_cnjg.c
-d_cos.o: d_cos.c
-d_cosh.o: d_cosh.c
-d_dim.o: d_dim.c
-d_exp.o: d_exp.c
-d_imag.o: d_imag.c
-d_int.o: d_int.c
-d_lg10.o: d_lg10.c
-d_log.o: d_log.c
-d_mod.o: d_mod.c
-d_nint.o: d_nint.c
-d_prod.o: d_prod.c
-d_sign.o: d_sign.c
-d_sin.o: d_sin.c
-d_sinh.o: d_sinh.c
-d_sqrt.o: d_sqrt.c
-d_tan.o: d_tan.c
-d_tanh.o: d_tanh.c
-i_abs.o: i_abs.c
-i_dim.o: i_dim.c
-i_dnnt.o: i_dnnt.c
-i_indx.o: i_indx.c
-i_len.o: i_len.c
-i_mod.o: i_mod.c
-i_nint.o: i_nint.c
-i_sign.o: i_sign.c
-h_abs.o: h_abs.c
-h_dim.o: h_dim.c
-h_dnnt.o: h_dnnt.c
-h_indx.o: h_indx.c
-h_len.o: h_len.c
-h_mod.o: h_mod.c
-h_nint.o: h_nint.c
-h_sign.o: h_sign.c
-l_ge.o: l_ge.c
-l_gt.o: l_gt.c
-l_le.o: l_le.c
-l_lt.o: l_lt.c
-hl_ge.o: hl_ge.c
-hl_gt.o: hl_gt.c
-hl_le.o: hl_le.c
-hl_lt.o: hl_lt.c
-ef1asc_.o: ef1asc_.c
-ef1cmc_.o: ef1cmc_.c
-s_cat.o: s_cat.c
-s_cmp.o: s_cmp.c
-s_copy.o: s_copy.c
-lbitbits.o: lbitbits.c
-lbitshft.o: lbitshft.c
-qbitbits.o: qbitbits.c
-qbitshft.o: qbitshft.c
-
-# Not quite all these actually do depend on f2c.h...
-$(MISC) $(POW) $(CX) $(DCX) $(REAL) $(DBL) $(INT) $(HALF) $(CMP) $(EFL) \
- $(CHAR) $(F90BIT): $(F2C_H_DIR)/f2c.h $(G2C_H_DIR)/g2c.h
-
-check install uninstall install-strip dist installcheck installdirs:
-
-mostlyclean:
- rm -f *.o
-
-clean: mostlyclean
- rm -f config.log
- rm -f ../s-libf77
-
-distclean: clean
- rm -f config.cache config.status Makefile ../s-libf77 configure
-
-maintainer-clean:
-
-.PHONY: mostlyclean clean distclean maintainer-clean all check uninstall \
- install-strip dist installcheck installdirs archive
diff --git a/contrib/libf2c/libF77/Notice b/contrib/libf2c/libF77/Notice
deleted file mode 100644
index 261b719bc57e..000000000000
--- a/contrib/libf2c/libF77/Notice
+++ /dev/null
@@ -1,23 +0,0 @@
-/****************************************************************
-Copyright 1990 - 1997 by AT&T, Lucent Technologies and Bellcore.
-
-Permission to use, copy, modify, and distribute this software
-and its documentation for any purpose and without fee is hereby
-granted, provided that the above copyright notice appear in all
-copies and that both that the copyright notice and this
-permission notice and warranty disclaimer appear in supporting
-documentation, and that the names of AT&T, Bell Laboratories,
-Lucent or Bellcore or any of their entities not be used in
-advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-AT&T, Lucent and Bellcore disclaim all warranties with regard to
-this software, including all implied warranties of
-merchantability and fitness. In no event shall AT&T, Lucent or
-Bellcore be liable for any special, indirect or consequential
-damages or any damages whatsoever resulting from loss of use,
-data or profits, whether in an action of contract, negligence or
-other tortious action, arising out of or in connection with the
-use or performance of this software.
-****************************************************************/
-
diff --git a/contrib/libf2c/libF77/README.netlib b/contrib/libf2c/libF77/README.netlib
deleted file mode 100644
index 5e532ee09902..000000000000
--- a/contrib/libf2c/libF77/README.netlib
+++ /dev/null
@@ -1,112 +0,0 @@
-If your compiler does not recognize ANSI C headers,
-compile with KR_headers defined: either add -DKR_headers
-to the definition of CFLAGS in the makefile, or insert
-
-#define KR_headers
-
-at the top of f2c.h , cabs.c , main.c , and sig_die.c .
-
-Under MS-DOS, compile s_paus.c with -DMSDOS.
-
-If you have a really ancient K&R C compiler that does not understand
-void, add -Dvoid=int to the definition of CFLAGS in the makefile.
-
-If you use a C++ compiler, first create a local f2c.h by appending
-f2ch.add to the usual f2c.h, e.g., by issuing the command
- make f2c.h
-which assumes f2c.h is installed in /usr/include .
-
-If your system lacks onexit() and you are not using an ANSI C
-compiler, then you should compile main.c, s_paus.c, s_stop.c, and
-sig_die.c with NO_ONEXIT defined. See the comments about onexit in
-the makefile.
-
-If your system has a double drem() function such that drem(a,b)
-is the IEEE remainder function (with double a, b), then you may
-wish to compile r_mod.c and d_mod.c with IEEE_drem defined.
-On some systems, you may also need to compile with -Ddrem=remainder .
-
-To check for transmission errors, issue the command
- make check
-This assumes you have the xsum program whose source, xsum.c,
-is distributed as part of "all from f2c/src". If you do not
-have xsum, you can obtain xsum.c by sending the following E-mail
-message to netlib@netlib.bell-labs.com
- send xsum.c from f2c/src
-
-The makefile assumes you have installed f2c.h in a standard
-place (and does not cause recompilation when f2c.h is changed);
-f2c.h comes with "all from f2c" (the source for f2c) and is
-available separately ("f2c.h from f2c").
-
-Most of the routines in libF77 are support routines for Fortran
-intrinsic functions or for operations that f2c chooses not
-to do "in line". There are a few exceptions, summarized below --
-functions and subroutines that appear to your program as ordinary
-external Fortran routines.
-
-1. CALL ABORT prints a message and causes a core dump.
-
-2. ERF(r) and DERF(d) and the REAL and DOUBLE PRECISION
- error functions (with x REAL and d DOUBLE PRECISION);
- DERF must be declared DOUBLE PRECISION in your program.
- Both ERF and DERF assume your C library provides the
- underlying erf() function (which not all systems do).
-
-3. ERFC(r) and DERFC(d) are the complementary error functions:
- ERFC(r) = 1 - ERF(r) and DERFC(d) = 1.d0 - DERFC(d)
- (except that their results may be more accurate than
- explicitly evaluating the above formulae would give).
- Again, ERFC and r are REAL, and DERFC and d are DOUBLE
- PRECISION (and must be declared as such in your program),
- and ERFC and DERFC rely on your system's erfc().
-
-4. CALL GETARG(n,s), where n is an INTEGER and s is a CHARACTER
- variable, sets s to the n-th command-line argument (or to
- all blanks if there are fewer than n command-line arguments);
- CALL GETARG(0,s) sets s to the name of the program (on systems
- that support this feature). See IARGC below.
-
-5. CALL GETENV(name, value), where name and value are of type
- CHARACTER, sets value to the environment value, $name, of
- name (or to blanks if $name has not been set).
-
-6. NARGS = IARGC() sets NARGS to the number of command-line
- arguments (an INTEGER value).
-
-7. CALL SIGNAL(n,func), where n is an INTEGER and func is an
- EXTERNAL procedure, arranges for func to be invoked when
- signal n occurs (on systems where this makes sense).
-
-8. CALL SYSTEM(cmd), where cmd is of type CHARACTER, passes
- cmd to the system's command processor (on systems where
- this can be done).
-
-The makefile does not attempt to compile pow_qq.c, qbitbits.c,
-and qbitshft.c, which are meant for use with INTEGER*8. To use
-INTEGER*8, you must modify f2c.h to declare longint and ulongint
-appropriately; then add pow_qq.o to the POW = line in the makefile,
-and add " qbitbits.o qbitshft.o" to the makefile's F90BIT = line.
-
-Following Fortran 90, s_cat.c and s_copy.c allow the target of a
-(character string) assignment to be appear on its right-hand, at
-the cost of some extra overhead for all run-time concatenations.
-If you prefer the extra efficiency that comes with the Fortran 77
-requirement that the left-hand side of a character assignment not
-be involved in the right-hand side, compile s_cat.c and s_copy.c
-with -DNO_OVERWRITE .
-
-If your system lacks a ranlib command, you don't need it.
-Either comment out the makefile's ranlib invocation, or install
-a harmless "ranlib" command somewhere in your PATH, such as the
-one-line shell script
-
- exit 0
-
-or (on some systems)
-
- exec /usr/bin/ar lts $1 >/dev/null
-
-If your compiler complains about the signal calls in main.c, s_paus.c,
-and signal_.c, you may need to adjust signal1.h suitably. See the
-comments in signal1.h.
diff --git a/contrib/libf2c/libF77/Version.c b/contrib/libf2c/libF77/Version.c
deleted file mode 100644
index ad367f4d95db..000000000000
--- a/contrib/libf2c/libF77/Version.c
+++ /dev/null
@@ -1,92 +0,0 @@
-static char junk[] = "\n@(#)LIBF77 VERSION 20000929\n";
-
-/*
-*/
-
-char __G77_LIBF77_VERSION__[] = "0.5.26 20011023 (release)";
-
-/*
-2.00 11 June 1980. File version.c added to library.
-2.01 31 May 1988. s_paus() flushes stderr; names of hl_* fixed
- [ d]erf[c ] added
- 8 Aug. 1989: #ifdefs for f2c -i2 added to s_cat.c
- 29 Nov. 1989: s_cmp returns long (for f2c)
- 30 Nov. 1989: arg types from f2c.h
- 12 Dec. 1989: s_rnge allows long names
- 19 Dec. 1989: getenv_ allows unsorted environment
- 28 Mar. 1990: add exit(0) to end of main()
- 2 Oct. 1990: test signal(...) == SIG_IGN rather than & 01 in main
- 17 Oct. 1990: abort() calls changed to sig_die(...,1)
- 22 Oct. 1990: separate sig_die from main
- 25 Apr. 1991: minor, theoretically invisible tweaks to s_cat, sig_die
- 31 May 1991: make system_ return status
- 18 Dec. 1991: change long to ftnlen (for -i2) many places
- 28 Feb. 1992: repair z_sqrt.c (scribbled on input, gave wrong answer)
- 18 July 1992: for n < 0, repair handling of 0**n in pow_[dr]i.c
- and m**n in pow_hh.c and pow_ii.c;
- catch SIGTRAP in main() for error msg before abort
- 23 July 1992: switch to ANSI prototypes unless KR_headers is #defined
- 23 Oct. 1992: fix botch in signal_.c (erroneous deref of 2nd arg);
- change Cabs to f__cabs.
- 12 March 1993: various tweaks for C++
- 2 June 1994: adjust so abnormal terminations invoke f_exit just once
- 16 Sept. 1994: s_cmp: treat characters as unsigned in comparisons.
- 19 Sept. 1994: s_paus: flush after end of PAUSE; add -DMSDOS
- 12 Jan. 1995: pow_[dhiqrz][hiq]: adjust x**i to work on machines
- that sign-extend right shifts when i is the most
- negative integer.
- 26 Jan. 1995: adjust s_cat.c, s_copy.c to permit the left-hand side
- of character assignments to appear on the right-hand
- side (unless compiled with -DNO_OVERWRITE).
- 27 Jan. 1995: minor tweak to s_copy.c: copy forward whenever
- possible (for better cache behavior).
- 30 May 1995: added subroutine exit(rc) integer rc. Version not changed.
- 29 Aug. 1995: add F77_aloc.c; use it in s_cat.c and system_.c.
- 6 Sept. 1995: fix return type of system_ under -DKR_headers.
- 19 Dec. 1995: s_cat.c: fix bug when 2nd or later arg overlaps lhs.
- 19 Mar. 1996: s_cat.c: supply missing break after overlap detection.
- 13 May 1996: add [lq]bitbits.c and [lq]bitshft.c (f90 bit intrinsics).
- 19 June 1996: add casts to unsigned in [lq]bitshft.c.
- 26 Feb. 1997: adjust functions with a complex output argument
- to permit aliasing it with input arguments.
- (For now, at least, this is just for possible
- benefit of g77.)
- 4 April 1997: [cz]_div.c: tweaks invisible on most systems (that may
- affect systems using gratuitous extra precision).
- 19 Sept. 1997: [de]time_.c (Unix systems only): change return
- type to double.
- 2 May 1999: getenv_.c: omit environ in favor of getenv().
- c_cos.c, c_exp.c, c_sin.c, d_cnjg.c, r_cnjg.c,
- z_cos.c, z_exp.c, z_log.c, z_sin.c: cope fully with
- overlapping arguments caused by equivalence.
- 3 May 1999: "invisible" tweaks to omit compiler warnings in
- abort_.c, ef1asc_.c, s_rnge.c, s_stop.c.
- 7 Sept. 1999: [cz]_div.c: arrange for compilation under
- -DIEEE_COMPLEX_DIVIDE to make these routines
- avoid calling sig_die when the denominator
- vanishes; instead, they return pairs of NaNs
- or Infinities, depending whether the numerator
- also vanishes or not. VERSION not changed.
- 15 Nov. 1999: s_rnge.c: add casts for the case of
- sizeof(ftnint) == sizeof(int) < sizeof(long).
- 10 March 2000: z_log.c: improve accuracy of Real(log(z)) for, e.g.,
- z near (+-1,eps) with |eps| small. For the old
- evaluation, compile with -DPre20000310 .
- 20 April 2000: s_cat.c: tweak argument types to accord with
- calls by f2c when ftnint and ftnlen are of
- different sizes (different numbers of bits).
- 4 July 2000: adjustments to permit compilation by C++ compilers;
- VERSION string remains unchanged. NOT APPLIED FOR G77.
- 29 Sept. 2000: dtime_.c, etime_.c: use floating-point divide.
- dtime_.d, erf_.c, erfc_.c, etime.c: for use with
- "f2c -R", compile with -DREAL=float.
-*/
-
-#include <stdio.h>
-
-void
-g77__fvers__ ()
-{
- fprintf (stderr, "__G77_LIBF77_VERSION__: %s", __G77_LIBF77_VERSION__);
- fputs (junk, stderr);
-}
diff --git a/contrib/libf2c/libF77/abort_.c b/contrib/libf2c/libF77/abort_.c
deleted file mode 100644
index f0c2f8df3599..000000000000
--- a/contrib/libf2c/libF77/abort_.c
+++ /dev/null
@@ -1,16 +0,0 @@
-#include <stdio.h>
-#include "f2c.h"
-
-#ifdef KR_headers
-extern VOID sig_die();
-
-int G77_abort_0 ()
-#else
-extern void sig_die(char*,int);
-
-int G77_abort_0 (void)
-#endif
-{
-sig_die("Fortran abort routine called", 1);
-return 0; /* not reached */
-}
diff --git a/contrib/libf2c/libF77/c_abs.c b/contrib/libf2c/libF77/c_abs.c
deleted file mode 100644
index 041fbd3d8bb0..000000000000
--- a/contrib/libf2c/libF77/c_abs.c
+++ /dev/null
@@ -1,14 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-extern double f__cabs();
-
-double c_abs(z) complex *z;
-#else
-extern double f__cabs(double, double);
-
-double c_abs(complex *z)
-#endif
-{
-return( f__cabs( z->r, z->i ) );
-}
diff --git a/contrib/libf2c/libF77/c_cos.c b/contrib/libf2c/libF77/c_cos.c
deleted file mode 100644
index 549953dc6562..000000000000
--- a/contrib/libf2c/libF77/c_cos.c
+++ /dev/null
@@ -1,17 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-extern double sin(), cos(), sinh(), cosh();
-
-VOID c_cos(r, z) complex *r, *z;
-#else
-#undef abs
-#include "math.h"
-
-void c_cos(complex *r, complex *z)
-#endif
-{
- double zi = z->i, zr = z->r;
- r->r = cos(zr) * cosh(zi);
- r->i = - sin(zr) * sinh(zi);
- }
diff --git a/contrib/libf2c/libF77/c_div.c b/contrib/libf2c/libF77/c_div.c
deleted file mode 100644
index 4d153b4c4afc..000000000000
--- a/contrib/libf2c/libF77/c_div.c
+++ /dev/null
@@ -1,47 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-extern VOID sig_die();
-VOID c_div(c, a, b)
-complex *a, *b, *c;
-#else
-extern void sig_die(char*,int);
-void c_div(complex *c, complex *a, complex *b)
-#endif
-{
- double ratio, den;
- double abr, abi, cr;
-
- if( (abr = b->r) < 0.)
- abr = - abr;
- if( (abi = b->i) < 0.)
- abi = - abi;
- if( abr <= abi )
- {
- if(abi == 0) {
-#ifdef IEEE_COMPLEX_DIVIDE
- float af, bf;
- af = bf = abr;
- if (a->i != 0 || a->r != 0)
- af = 1.;
- c->i = c->r = af / bf;
- return;
-#else
- sig_die("complex division by zero", 1);
-#endif
- }
- ratio = (double)b->r / b->i ;
- den = b->i * (1 + ratio*ratio);
- cr = (a->r*ratio + a->i) / den;
- c->i = (a->i*ratio - a->r) / den;
- }
-
- else
- {
- ratio = (double)b->i / b->r ;
- den = b->r * (1 + ratio*ratio);
- cr = (a->r + a->i*ratio) / den;
- c->i = (a->i - a->r*ratio) / den;
- }
- c->r = cr;
- }
diff --git a/contrib/libf2c/libF77/c_exp.c b/contrib/libf2c/libF77/c_exp.c
deleted file mode 100644
index 52d0d2ffc95c..000000000000
--- a/contrib/libf2c/libF77/c_exp.c
+++ /dev/null
@@ -1,19 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-extern double exp(), cos(), sin();
-
- VOID c_exp(r, z) complex *r, *z;
-#else
-#undef abs
-#include "math.h"
-
-void c_exp(complex *r, complex *z)
-#endif
-{
- double expx, zi = z->i;
-
- expx = exp(z->r);
- r->r = expx * cos(zi);
- r->i = expx * sin(zi);
- }
diff --git a/contrib/libf2c/libF77/c_log.c b/contrib/libf2c/libF77/c_log.c
deleted file mode 100644
index 24d1a3c957b4..000000000000
--- a/contrib/libf2c/libF77/c_log.c
+++ /dev/null
@@ -1,17 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-extern double log(), f__cabs(), atan2();
-VOID c_log(r, z) complex *r, *z;
-#else
-#undef abs
-#include "math.h"
-extern double f__cabs(double, double);
-
-void c_log(complex *r, complex *z)
-#endif
-{
- double zi, zr;
- r->i = atan2(zi = z->i, zr = z->r);
- r->r = log( f__cabs(zr, zi) );
- }
diff --git a/contrib/libf2c/libF77/c_sin.c b/contrib/libf2c/libF77/c_sin.c
deleted file mode 100644
index 93a57660a902..000000000000
--- a/contrib/libf2c/libF77/c_sin.c
+++ /dev/null
@@ -1,17 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-extern double sin(), cos(), sinh(), cosh();
-
-VOID c_sin(r, z) complex *r, *z;
-#else
-#undef abs
-#include "math.h"
-
-void c_sin(complex *r, complex *z)
-#endif
-{
- double zi = z->i, zr = z->r;
- r->r = sin(zr) * cosh(zi);
- r->i = cos(zr) * sinh(zi);
- }
diff --git a/contrib/libf2c/libF77/c_sqrt.c b/contrib/libf2c/libF77/c_sqrt.c
deleted file mode 100644
index 8481ee4857e0..000000000000
--- a/contrib/libf2c/libF77/c_sqrt.c
+++ /dev/null
@@ -1,35 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-extern double sqrt(), f__cabs();
-
-VOID c_sqrt(r, z) complex *r, *z;
-#else
-#undef abs
-#include "math.h"
-extern double f__cabs(double, double);
-
-void c_sqrt(complex *r, complex *z)
-#endif
-{
- double mag, t;
- double zi = z->i, zr = z->r;
-
- if( (mag = f__cabs(zr, zi)) == 0.)
- r->r = r->i = 0.;
- else if(zr > 0)
- {
- r->r = t = sqrt(0.5 * (mag + zr) );
- t = zi / t;
- r->i = 0.5 * t;
- }
- else
- {
- t = sqrt(0.5 * (mag - zr) );
- if(zi < 0)
- t = -t;
- r->i = t;
- t = zi / t;
- r->r = 0.5 * t;
- }
- }
diff --git a/contrib/libf2c/libF77/cabs.c b/contrib/libf2c/libF77/cabs.c
deleted file mode 100644
index 2fad044e8840..000000000000
--- a/contrib/libf2c/libF77/cabs.c
+++ /dev/null
@@ -1,27 +0,0 @@
-#ifdef KR_headers
-extern double sqrt();
-double f__cabs(real, imag) double real, imag;
-#else
-#undef abs
-#include <math.h>
-double f__cabs(double real, double imag)
-#endif
-{
-double temp;
-
-if(real < 0)
- real = -real;
-if(imag < 0)
- imag = -imag;
-if(imag > real){
- temp = real;
- real = imag;
- imag = temp;
-}
-if((real+imag) == real)
- return(real);
-
-temp = imag/real;
-temp = real*sqrt(1.0 + temp*temp); /*overflow!!*/
-return(temp);
-}
diff --git a/contrib/libf2c/libF77/configure b/contrib/libf2c/libF77/configure
deleted file mode 100755
index 9017e8354bc9..000000000000
--- a/contrib/libf2c/libF77/configure
+++ /dev/null
@@ -1,1530 +0,0 @@
-#! /bin/sh
-
-# Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 2.13
-# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
-#
-# This configure script is free software; the Free Software Foundation
-# gives unlimited permission to copy, distribute and modify it.
-
-# Defaults:
-ac_help=
-ac_default_prefix=/usr/local
-# Any additions from configure.in:
-
-# Initialize some variables set by options.
-# The variables have the same names as the options, with
-# dashes changed to underlines.
-build=NONE
-cache_file=./config.cache
-exec_prefix=NONE
-host=NONE
-no_create=
-nonopt=NONE
-no_recursion=
-prefix=NONE
-program_prefix=NONE
-program_suffix=NONE
-program_transform_name=s,x,x,
-silent=
-site=
-srcdir=
-target=NONE
-verbose=
-x_includes=NONE
-x_libraries=NONE
-bindir='${exec_prefix}/bin'
-sbindir='${exec_prefix}/sbin'
-libexecdir='${exec_prefix}/libexec'
-datadir='${prefix}/share'
-sysconfdir='${prefix}/etc'
-sharedstatedir='${prefix}/com'
-localstatedir='${prefix}/var'
-libdir='${exec_prefix}/lib'
-includedir='${prefix}/include'
-oldincludedir='/usr/include'
-infodir='${prefix}/info'
-mandir='${prefix}/man'
-
-# Initialize some other variables.
-subdirs=
-MFLAGS= MAKEFLAGS=
-SHELL=${CONFIG_SHELL-/bin/sh}
-# Maximum number of lines to put in a shell here document.
-ac_max_here_lines=12
-
-ac_prev=
-for ac_option
-do
-
- # If the previous option needs an argument, assign it.
- if test -n "$ac_prev"; then
- eval "$ac_prev=\$ac_option"
- ac_prev=
- continue
- fi
-
- case "$ac_option" in
- -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
- *) ac_optarg= ;;
- esac
-
- # Accept the important Cygnus configure options, so we can diagnose typos.
-
- case "$ac_option" in
-
- -bindir | --bindir | --bindi | --bind | --bin | --bi)
- ac_prev=bindir ;;
- -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
- bindir="$ac_optarg" ;;
-
- -build | --build | --buil | --bui | --bu)
- ac_prev=build ;;
- -build=* | --build=* | --buil=* | --bui=* | --bu=*)
- build="$ac_optarg" ;;
-
- -cache-file | --cache-file | --cache-fil | --cache-fi \
- | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
- ac_prev=cache_file ;;
- -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
- | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
- cache_file="$ac_optarg" ;;
-
- -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
- ac_prev=datadir ;;
- -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
- | --da=*)
- datadir="$ac_optarg" ;;
-
- -disable-* | --disable-*)
- ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
- # Reject names that are not valid shell variable names.
- if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
- { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
- fi
- ac_feature=`echo $ac_feature| sed 's/-/_/g'`
- eval "enable_${ac_feature}=no" ;;
-
- -enable-* | --enable-*)
- ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
- # Reject names that are not valid shell variable names.
- if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
- { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
- fi
- ac_feature=`echo $ac_feature| sed 's/-/_/g'`
- case "$ac_option" in
- *=*) ;;
- *) ac_optarg=yes ;;
- esac
- eval "enable_${ac_feature}='$ac_optarg'" ;;
-
- -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
- | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
- | --exec | --exe | --ex)
- ac_prev=exec_prefix ;;
- -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
- | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
- | --exec=* | --exe=* | --ex=*)
- exec_prefix="$ac_optarg" ;;
-
- -gas | --gas | --ga | --g)
- # Obsolete; use --with-gas.
- with_gas=yes ;;
-
- -help | --help | --hel | --he)
- # Omit some internal or obsolete options to make the list less imposing.
- # This message is too long to be a string in the A/UX 3.1 sh.
- cat << EOF
-Usage: configure [options] [host]
-Options: [defaults in brackets after descriptions]
-Configuration:
- --cache-file=FILE cache test results in FILE
- --help print this message
- --no-create do not create output files
- --quiet, --silent do not print \`checking...' messages
- --version print the version of autoconf that created configure
-Directory and file names:
- --prefix=PREFIX install architecture-independent files in PREFIX
- [$ac_default_prefix]
- --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
- [same as prefix]
- --bindir=DIR user executables in DIR [EPREFIX/bin]
- --sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
- --libexecdir=DIR program executables in DIR [EPREFIX/libexec]
- --datadir=DIR read-only architecture-independent data in DIR
- [PREFIX/share]
- --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
- --sharedstatedir=DIR modifiable architecture-independent data in DIR
- [PREFIX/com]
- --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
- --libdir=DIR object code libraries in DIR [EPREFIX/lib]
- --includedir=DIR C header files in DIR [PREFIX/include]
- --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
- --infodir=DIR info documentation in DIR [PREFIX/info]
- --mandir=DIR man documentation in DIR [PREFIX/man]
- --srcdir=DIR find the sources in DIR [configure dir or ..]
- --program-prefix=PREFIX prepend PREFIX to installed program names
- --program-suffix=SUFFIX append SUFFIX to installed program names
- --program-transform-name=PROGRAM
- run sed PROGRAM on installed program names
-EOF
- cat << EOF
-Host type:
- --build=BUILD configure for building on BUILD [BUILD=HOST]
- --host=HOST configure for HOST [guessed]
- --target=TARGET configure for TARGET [TARGET=HOST]
-Features and packages:
- --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
- --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
- --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
- --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
- --x-includes=DIR X include files are in DIR
- --x-libraries=DIR X library files are in DIR
-EOF
- if test -n "$ac_help"; then
- echo "--enable and --with options recognized:$ac_help"
- fi
- exit 0 ;;
-
- -host | --host | --hos | --ho)
- ac_prev=host ;;
- -host=* | --host=* | --hos=* | --ho=*)
- host="$ac_optarg" ;;
-
- -includedir | --includedir | --includedi | --included | --include \
- | --includ | --inclu | --incl | --inc)
- ac_prev=includedir ;;
- -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
- | --includ=* | --inclu=* | --incl=* | --inc=*)
- includedir="$ac_optarg" ;;
-
- -infodir | --infodir | --infodi | --infod | --info | --inf)
- ac_prev=infodir ;;
- -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
- infodir="$ac_optarg" ;;
-
- -libdir | --libdir | --libdi | --libd)
- ac_prev=libdir ;;
- -libdir=* | --libdir=* | --libdi=* | --libd=*)
- libdir="$ac_optarg" ;;
-
- -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
- | --libexe | --libex | --libe)
- ac_prev=libexecdir ;;
- -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
- | --libexe=* | --libex=* | --libe=*)
- libexecdir="$ac_optarg" ;;
-
- -localstatedir | --localstatedir | --localstatedi | --localstated \
- | --localstate | --localstat | --localsta | --localst \
- | --locals | --local | --loca | --loc | --lo)
- ac_prev=localstatedir ;;
- -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
- | --localstate=* | --localstat=* | --localsta=* | --localst=* \
- | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
- localstatedir="$ac_optarg" ;;
-
- -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
- ac_prev=mandir ;;
- -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
- mandir="$ac_optarg" ;;
-
- -nfp | --nfp | --nf)
- # Obsolete; use --without-fp.
- with_fp=no ;;
-
- -no-create | --no-create | --no-creat | --no-crea | --no-cre \
- | --no-cr | --no-c)
- no_create=yes ;;
-
- -no-recursion | --no-recursion | --no-recursio | --no-recursi \
- | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
- no_recursion=yes ;;
-
- -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
- | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
- | --oldin | --oldi | --old | --ol | --o)
- ac_prev=oldincludedir ;;
- -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
- | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
- | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
- oldincludedir="$ac_optarg" ;;
-
- -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
- ac_prev=prefix ;;
- -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
- prefix="$ac_optarg" ;;
-
- -program-prefix | --program-prefix | --program-prefi | --program-pref \
- | --program-pre | --program-pr | --program-p)
- ac_prev=program_prefix ;;
- -program-prefix=* | --program-prefix=* | --program-prefi=* \
- | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
- program_prefix="$ac_optarg" ;;
-
- -program-suffix | --program-suffix | --program-suffi | --program-suff \
- | --program-suf | --program-su | --program-s)
- ac_prev=program_suffix ;;
- -program-suffix=* | --program-suffix=* | --program-suffi=* \
- | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
- program_suffix="$ac_optarg" ;;
-
- -program-transform-name | --program-transform-name \
- | --program-transform-nam | --program-transform-na \
- | --program-transform-n | --program-transform- \
- | --program-transform | --program-transfor \
- | --program-transfo | --program-transf \
- | --program-trans | --program-tran \
- | --progr-tra | --program-tr | --program-t)
- ac_prev=program_transform_name ;;
- -program-transform-name=* | --program-transform-name=* \
- | --program-transform-nam=* | --program-transform-na=* \
- | --program-transform-n=* | --program-transform-=* \
- | --program-transform=* | --program-transfor=* \
- | --program-transfo=* | --program-transf=* \
- | --program-trans=* | --program-tran=* \
- | --progr-tra=* | --program-tr=* | --program-t=*)
- program_transform_name="$ac_optarg" ;;
-
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil)
- silent=yes ;;
-
- -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
- ac_prev=sbindir ;;
- -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
- | --sbi=* | --sb=*)
- sbindir="$ac_optarg" ;;
-
- -sharedstatedir | --sharedstatedir | --sharedstatedi \
- | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
- | --sharedst | --shareds | --shared | --share | --shar \
- | --sha | --sh)
- ac_prev=sharedstatedir ;;
- -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
- | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
- | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
- | --sha=* | --sh=*)
- sharedstatedir="$ac_optarg" ;;
-
- -site | --site | --sit)
- ac_prev=site ;;
- -site=* | --site=* | --sit=*)
- site="$ac_optarg" ;;
-
- -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
- ac_prev=srcdir ;;
- -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
- srcdir="$ac_optarg" ;;
-
- -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
- | --syscon | --sysco | --sysc | --sys | --sy)
- ac_prev=sysconfdir ;;
- -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
- | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
- sysconfdir="$ac_optarg" ;;
-
- -target | --target | --targe | --targ | --tar | --ta | --t)
- ac_prev=target ;;
- -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
- target="$ac_optarg" ;;
-
- -v | -verbose | --verbose | --verbos | --verbo | --verb)
- verbose=yes ;;
-
- -version | --version | --versio | --versi | --vers)
- echo "configure generated by autoconf version 2.13"
- exit 0 ;;
-
- -with-* | --with-*)
- ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
- # Reject names that are not valid shell variable names.
- if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
- { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
- fi
- ac_package=`echo $ac_package| sed 's/-/_/g'`
- case "$ac_option" in
- *=*) ;;
- *) ac_optarg=yes ;;
- esac
- eval "with_${ac_package}='$ac_optarg'" ;;
-
- -without-* | --without-*)
- ac_package=`echo $ac_option|sed -e 's/-*without-//'`
- # Reject names that are not valid shell variable names.
- if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
- { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
- fi
- ac_package=`echo $ac_package| sed 's/-/_/g'`
- eval "with_${ac_package}=no" ;;
-
- --x)
- # Obsolete; use --with-x.
- with_x=yes ;;
-
- -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
- | --x-incl | --x-inc | --x-in | --x-i)
- ac_prev=x_includes ;;
- -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
- | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
- x_includes="$ac_optarg" ;;
-
- -x-libraries | --x-libraries | --x-librarie | --x-librari \
- | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
- ac_prev=x_libraries ;;
- -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
- | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
- x_libraries="$ac_optarg" ;;
-
- -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
- ;;
-
- *)
- if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
- echo "configure: warning: $ac_option: invalid host type" 1>&2
- fi
- if test "x$nonopt" != xNONE; then
- { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
- fi
- nonopt="$ac_option"
- ;;
-
- esac
-done
-
-if test -n "$ac_prev"; then
- { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
-fi
-
-trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
-
-# File descriptor usage:
-# 0 standard input
-# 1 file creation
-# 2 errors and warnings
-# 3 some systems may open it to /dev/tty
-# 4 used on the Kubota Titan
-# 6 checking for... messages and results
-# 5 compiler messages saved in config.log
-if test "$silent" = yes; then
- exec 6>/dev/null
-else
- exec 6>&1
-fi
-exec 5>./config.log
-
-echo "\
-This file contains any messages produced by compilers while
-running configure, to aid debugging if configure makes a mistake.
-" 1>&5
-
-# Strip out --no-create and --no-recursion so they do not pile up.
-# Also quote any args containing shell metacharacters.
-ac_configure_args=
-for ac_arg
-do
- case "$ac_arg" in
- -no-create | --no-create | --no-creat | --no-crea | --no-cre \
- | --no-cr | --no-c) ;;
- -no-recursion | --no-recursion | --no-recursio | --no-recursi \
- | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
- *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
- ac_configure_args="$ac_configure_args '$ac_arg'" ;;
- *) ac_configure_args="$ac_configure_args $ac_arg" ;;
- esac
-done
-
-# NLS nuisances.
-# Only set these to C if already set. These must not be set unconditionally
-# because not all systems understand e.g. LANG=C (notably SCO).
-# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
-# Non-C LC_CTYPE values break the ctype check.
-if test "${LANG+set}" = set; then LANG=C; export LANG; fi
-if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
-if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
-if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
-
-# confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -rf conftest* confdefs.h
-# AIX cpp loses on an empty file, so make sure it contains at least a newline.
-echo > confdefs.h
-
-# A filename unique to this package, relative to the directory that
-# configure is in, which we can look for to find out if srcdir is correct.
-ac_unique_file=getarg_.c
-
-# Find the source files, if location was not specified.
-if test -z "$srcdir"; then
- ac_srcdir_defaulted=yes
- # Try the directory containing this script, then its parent.
- ac_prog=$0
- ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
- test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
- srcdir=$ac_confdir
- if test ! -r $srcdir/$ac_unique_file; then
- srcdir=..
- fi
-else
- ac_srcdir_defaulted=no
-fi
-if test ! -r $srcdir/$ac_unique_file; then
- if test "$ac_srcdir_defaulted" = yes; then
- { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
- else
- { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
- fi
-fi
-srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
-
-# Prefer explicitly selected file to automatically selected ones.
-if test -z "$CONFIG_SITE"; then
- if test "x$prefix" != xNONE; then
- CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
- else
- CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
- fi
-fi
-for ac_site_file in $CONFIG_SITE; do
- if test -r "$ac_site_file"; then
- echo "loading site script $ac_site_file"
- . "$ac_site_file"
- fi
-done
-
-if test -r "$cache_file"; then
- echo "loading cache $cache_file"
- . $cache_file
-else
- echo "creating cache $cache_file"
- > $cache_file
-fi
-
-ac_ext=c
-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
-
-ac_exeext=
-ac_objext=o
-if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
- # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
- if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
- ac_n= ac_c='
-' ac_t=' '
- else
- ac_n=-n ac_c= ac_t=
- fi
-else
- ac_n= ac_c='\c' ac_t=
-fi
-
-
-
-
-
-
-# For g77 we'll set CC to point at the built gcc, but this will get it into
-# the makefiles
-# Extract the first word of "gcc", so it can be a program name with args.
-set dummy gcc; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:534: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_prog_CC="gcc"
- break
- fi
- done
- IFS="$ac_save_ifs"
-fi
-fi
-CC="$ac_cv_prog_CC"
-if test -n "$CC"; then
- echo "$ac_t""$CC" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-if test -z "$CC"; then
- # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:564: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_prog_rejected=no
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
- ac_prog_rejected=yes
- continue
- fi
- ac_cv_prog_CC="cc"
- break
- fi
- done
- IFS="$ac_save_ifs"
-if test $ac_prog_rejected = yes; then
- # We found a bogon in the path, so make sure we never use it.
- set dummy $ac_cv_prog_CC
- shift
- if test $# -gt 0; then
- # We chose a different compiler from the bogus one.
- # However, it has the same basename, so the bogon will be chosen
- # first if we set CC to just the basename; use the full file name.
- shift
- set dummy "$ac_dir/$ac_word" "$@"
- shift
- ac_cv_prog_CC="$@"
- fi
-fi
-fi
-fi
-CC="$ac_cv_prog_CC"
-if test -n "$CC"; then
- echo "$ac_t""$CC" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
- if test -z "$CC"; then
- case "`uname -s`" in
- *win32* | *WIN32*)
- # Extract the first word of "cl", so it can be a program name with args.
-set dummy cl; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:615: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_prog_CC="cl"
- break
- fi
- done
- IFS="$ac_save_ifs"
-fi
-fi
-CC="$ac_cv_prog_CC"
-if test -n "$CC"; then
- echo "$ac_t""$CC" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
- ;;
- esac
- fi
- test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
-fi
-
-
-echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:648: checking whether we are using GNU C" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.c <<EOF
-#ifdef __GNUC__
- yes;
-#endif
-EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:657: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
- ac_cv_prog_gcc=yes
-else
- ac_cv_prog_gcc=no
-fi
-fi
-
-echo "$ac_t""$ac_cv_prog_gcc" 1>&6
-
-if test $ac_cv_prog_gcc = yes; then
- GCC=yes
-else
- GCC=
-fi
-
-ac_test_CFLAGS="${CFLAGS+set}"
-ac_save_CFLAGS="$CFLAGS"
-CFLAGS=
-echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:676: checking whether ${CC-cc} accepts -g" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- echo 'void f(){}' > conftest.c
-if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
- ac_cv_prog_cc_g=yes
-else
- ac_cv_prog_cc_g=no
-fi
-rm -f conftest*
-
-fi
-
-echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
-if test "$ac_test_CFLAGS" = set; then
- CFLAGS="$ac_save_CFLAGS"
-elif test $ac_cv_prog_cc_g = yes; then
- if test "$GCC" = yes; then
- CFLAGS="-g -O2"
- else
- CFLAGS="-g"
- fi
-else
- if test "$GCC" = yes; then
- CFLAGS="-O2"
- else
- CFLAGS=
- fi
-fi
-
-
-test "$AR" || AR=ar
-
-echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:711: checking whether ${MAKE-make} sets \${MAKE}" >&5
-set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftestmake <<\EOF
-all:
- @echo 'ac_maketemp="${MAKE}"'
-EOF
-# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
-eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
-if test -n "$ac_maketemp"; then
- eval ac_cv_prog_make_${ac_make}_set=yes
-else
- eval ac_cv_prog_make_${ac_make}_set=no
-fi
-rm -f conftestmake
-fi
-if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- SET_MAKE=
-else
- echo "$ac_t""no" 1>&6
- SET_MAKE="MAKE=${MAKE-make}"
-fi
-
-
-
-# Sanity check for the cross-compilation case:
-echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:741: checking how to run the C preprocessor" >&5
-# On Suns, sometimes $CPP names a directory.
-if test -n "$CPP" && test -d "$CPP"; then
- CPP=
-fi
-if test -z "$CPP"; then
-if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- # This must be in double quotes, not single quotes, because CPP may get
- # substituted into the Makefile and "${CC-cc}" will confuse make.
- CPP="${CC-cc} -E"
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp.
- cat > conftest.$ac_ext <<EOF
-#line 756 "configure"
-#include "confdefs.h"
-#include <assert.h>
-Syntax Error
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:762: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- :
-else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- CPP="${CC-cc} -E -traditional-cpp"
- cat > conftest.$ac_ext <<EOF
-#line 773 "configure"
-#include "confdefs.h"
-#include <assert.h>
-Syntax Error
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:779: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- :
-else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- CPP="${CC-cc} -nologo -E"
- cat > conftest.$ac_ext <<EOF
-#line 790 "configure"
-#include "confdefs.h"
-#include <assert.h>
-Syntax Error
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:796: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- :
-else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- CPP=/lib/cpp
-fi
-rm -f conftest*
-fi
-rm -f conftest*
-fi
-rm -f conftest*
- ac_cv_prog_CPP="$CPP"
-fi
- CPP="$ac_cv_prog_CPP"
-else
- ac_cv_prog_CPP="$CPP"
-fi
-echo "$ac_t""$CPP" 1>&6
-
-ac_safe=`echo "stdio.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for stdio.h""... $ac_c" 1>&6
-echo "configure:822: checking for stdio.h" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 827 "configure"
-#include "confdefs.h"
-#include <stdio.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:832: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=yes"
-else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- :
-else
- echo "$ac_t""no" 1>&6
-{ echo "configure: error: Can't find stdio.h.
-You must have a usable C system for the target already installed, at least
-including headers and, preferably, the library, before you can configure
-the G77 runtime system. If necessary, install gcc now with \`LANGUAGES=c',
-then the target library, then build with \`LANGUAGES=f77'." 1>&2; exit 1; }
-fi
-
-
-echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:860: checking for ANSI C header files" >&5
-if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 865 "configure"
-#include "confdefs.h"
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:873: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- rm -rf conftest*
- ac_cv_header_stdc=yes
-else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-if test $ac_cv_header_stdc = yes; then
- # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
-cat > conftest.$ac_ext <<EOF
-#line 890 "configure"
-#include "confdefs.h"
-#include <string.h>
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "memchr" >/dev/null 2>&1; then
- :
-else
- rm -rf conftest*
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
-cat > conftest.$ac_ext <<EOF
-#line 908 "configure"
-#include "confdefs.h"
-#include <stdlib.h>
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "free" >/dev/null 2>&1; then
- :
-else
- rm -rf conftest*
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
-if test "$cross_compiling" = yes; then
- :
-else
- cat > conftest.$ac_ext <<EOF
-#line 929 "configure"
-#include "confdefs.h"
-#include <ctype.h>
-#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int main () { int i; for (i = 0; i < 256; i++)
-if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
-exit (0); }
-
-EOF
-if { (eval echo configure:940: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
- :
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -fr conftest*
- ac_cv_header_stdc=no
-fi
-rm -fr conftest*
-fi
-
-fi
-fi
-
-echo "$ac_t""$ac_cv_header_stdc" 1>&6
-if test $ac_cv_header_stdc = yes; then
- cat >> confdefs.h <<\EOF
-#define STDC_HEADERS 1
-EOF
-
-fi
-
-
-echo $ac_n "checking for posix""... $ac_c" 1>&6
-echo "configure:965: checking for posix" >&5
-if eval "test \"`echo '$''{'g77_cv_header_posix'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 970 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#include <unistd.h>
-#ifdef _POSIX_VERSION
- yes
-#endif
-
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "yes" >/dev/null 2>&1; then
- rm -rf conftest*
- g77_cv_header_posix=yes
-else
- rm -rf conftest*
- g77_cv_header_posix=no
-fi
-rm -f conftest*
-
-fi
-
-echo "$ac_t""$g77_cv_header_posix" 1>&6
-
-# We can rely on the GNU library being posix-ish. I guess checking the
-# header isn't actually like checking the functions, though...
-echo $ac_n "checking for GNU library""... $ac_c" 1>&6
-echo "configure:996: checking for GNU library" >&5
-if eval "test \"`echo '$''{'g77_cv_lib_gnu'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1001 "configure"
-#include "confdefs.h"
-#include <stdio.h>
-#ifdef __GNU_LIBRARY__
- yes
-#endif
-
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "yes" >/dev/null 2>&1; then
- rm -rf conftest*
- g77_cv_lib_gnu=yes
-else
- rm -rf conftest*
- g77_cv_lib_gnu=no
-fi
-rm -f conftest*
-
-fi
-
-echo "$ac_t""$g77_cv_lib_gnu" 1>&6
-
-echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:1024: checking return type of signal handlers" >&5
-if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1029 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#include <signal.h>
-#ifdef signal
-#undef signal
-#endif
-#ifdef __cplusplus
-extern "C" void (*signal (int, void (*)(int)))(int);
-#else
-void (*signal ()) ();
-#endif
-
-int main() {
-int i;
-; return 0; }
-EOF
-if { (eval echo configure:1046: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- ac_cv_type_signal=void
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_cv_type_signal=int
-fi
-rm -f conftest*
-fi
-
-echo "$ac_t""$ac_cv_type_signal" 1>&6
-cat >> confdefs.h <<EOF
-#define RETSIGTYPE $ac_cv_type_signal
-EOF
-
-
-# we'll get atexit by default
-if test $ac_cv_header_stdc != yes; then
-echo $ac_n "checking for atexit""... $ac_c" 1>&6
-echo "configure:1067: checking for atexit" >&5
-if eval "test \"`echo '$''{'ac_cv_func_atexit'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1072 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char atexit(); below. */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char atexit();
-
-int main() {
-
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_atexit) || defined (__stub___atexit)
-choke me
-#else
-atexit();
-#endif
-
-; return 0; }
-EOF
-if { (eval echo configure:1095: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_atexit=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_atexit=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'atexit`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- cat >> confdefs.h <<\EOF
-#define onexit atexit
-EOF
-
-else
- echo "$ac_t""no" 1>&6
- cat >> confdefs.h <<\EOF
-#define NO_ONEXIT 1
-EOF
-
- echo $ac_n "checking for onexit""... $ac_c" 1>&6
-echo "configure:1120: checking for onexit" >&5
-if eval "test \"`echo '$''{'ac_cv_func_onexit'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1125 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char onexit(); below. */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char onexit();
-
-int main() {
-
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_onexit) || defined (__stub___onexit)
-choke me
-#else
-onexit();
-#endif
-
-; return 0; }
-EOF
-if { (eval echo configure:1148: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_onexit=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_onexit=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'onexit`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- :
-else
- echo "$ac_t""no" 1>&6
-echo $ac_n "checking for on_exit""... $ac_c" 1>&6
-echo "configure:1166: checking for on_exit" >&5
-if eval "test \"`echo '$''{'ac_cv_func_on_exit'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1171 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char on_exit(); below. */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char on_exit();
-
-int main() {
-
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_on_exit) || defined (__stub___on_exit)
-choke me
-#else
-on_exit();
-#endif
-
-; return 0; }
-EOF
-if { (eval echo configure:1194: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_on_exit=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_on_exit=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'on_exit`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- cat >> confdefs.h <<\EOF
-#define onexit on_exit
-EOF
-
-else
- echo "$ac_t""no" 1>&6
-fi
-
-fi
-
-fi
-
-else true
-fi
-
-echo $ac_n "checking for drem in -lm""... $ac_c" 1>&6
-echo "configure:1224: checking for drem in -lm" >&5
-ac_lib_var=`echo m'_'drem | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- ac_save_LIBS="$LIBS"
-LIBS="-lm $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 1232 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char drem();
-
-int main() {
-drem()
-; return 0; }
-EOF
-if { (eval echo configure:1243: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- cat >> confdefs.h <<\EOF
-#define IEEE_drem 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
-fi
-
-
-cat >> confdefs.h <<\EOF
-#define Skip_f2c_Undefs 1
-EOF
-
-cat >> confdefs.h <<\EOF
-#define IEEE_COMPLEX_DIVIDE 1
-EOF
-
-
-trap '' 1 2 15
-cat > confcache <<\EOF
-# This file is a shell script that caches the results of configure
-# tests run on this system so they can be shared between configure
-# scripts and configure runs. It is not useful on other systems.
-# If it contains results you don't want to keep, you may remove or edit it.
-#
-# By default, configure uses ./config.cache as the cache file,
-# creating it if it does not exist already. You can give configure
-# the --cache-file=FILE option to use a different cache file; that is
-# what configure does when it calls configure scripts in
-# subdirectories, so they share the cache.
-# Giving --cache-file=/dev/null disables caching, for debugging configure.
-# config.status only pays attention to the cache file if you give it the
-# --recheck option to rerun configure.
-#
-EOF
-# The following way of writing the cache mishandles newlines in values,
-# but we know of no workaround that is simple, portable, and efficient.
-# So, don't put newlines in cache variables' values.
-# Ultrix sh set writes to stderr and can't be redirected directly,
-# and sets the high bit in the cache file unless we assign to the vars.
-(set) 2>&1 |
- case `(ac_space=' '; set | grep ac_space) 2>&1` in
- *ac_space=\ *)
- # `set' does not quote correctly, so add quotes (double-quote substitution
- # turns \\\\ into \\, and sed turns \\ into \).
- sed -n \
- -e "s/'/'\\\\''/g" \
- -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
- ;;
- *)
- # `set' quotes correctly as required by POSIX, so do not add quotes.
- sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
- ;;
- esac >> confcache
-if cmp -s $cache_file confcache; then
- :
-else
- if test -w $cache_file; then
- echo "updating cache $cache_file"
- cat confcache > $cache_file
- else
- echo "not updating unwritable cache $cache_file"
- fi
-fi
-rm -f confcache
-
-trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
-
-test "x$prefix" = xNONE && prefix=$ac_default_prefix
-# Let make expand exec_prefix.
-test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-
-# Any assignment to VPATH causes Sun make to only execute
-# the first set of double-colon rules, so remove it if not needed.
-# If there is a colon in the path, we need to keep it.
-if test "x$srcdir" = x.; then
- ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
-fi
-
-trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
-
-# Transform confdefs.h into DEFS.
-# Protect against shell expansion while executing Makefile rules.
-# Protect against Makefile macro expansion.
-cat > conftest.defs <<\EOF
-s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g
-s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g
-s%\[%\\&%g
-s%\]%\\&%g
-s%\$%$$%g
-EOF
-DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
-rm -f conftest.defs
-
-
-# Without the "./", some shells look in PATH for config.status.
-: ${CONFIG_STATUS=./config.status}
-
-echo creating $CONFIG_STATUS
-rm -f $CONFIG_STATUS
-cat > $CONFIG_STATUS <<EOF
-#! /bin/sh
-# Generated automatically by configure.
-# Run this file to recreate the current configuration.
-# This directory was configured as follows,
-# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-#
-# $0 $ac_configure_args
-#
-# Compiler output produced by configure, useful for debugging
-# configure, is in ./config.log if it exists.
-
-ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
-for ac_option
-do
- case "\$ac_option" in
- -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
- echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
- exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
- -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
- echo "$CONFIG_STATUS generated by autoconf version 2.13"
- exit 0 ;;
- -help | --help | --hel | --he | --h)
- echo "\$ac_cs_usage"; exit 0 ;;
- *) echo "\$ac_cs_usage"; exit 1 ;;
- esac
-done
-
-ac_given_srcdir=$srcdir
-
-trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
-EOF
-cat >> $CONFIG_STATUS <<EOF
-
-# Protect against being on the right side of a sed subst in config.status.
-sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
- s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
-$ac_vpsub
-$extrasub
-s%@SHELL@%$SHELL%g
-s%@CFLAGS@%$CFLAGS%g
-s%@CPPFLAGS@%$CPPFLAGS%g
-s%@CXXFLAGS@%$CXXFLAGS%g
-s%@FFLAGS@%$FFLAGS%g
-s%@DEFS@%$DEFS%g
-s%@LDFLAGS@%$LDFLAGS%g
-s%@LIBS@%$LIBS%g
-s%@exec_prefix@%$exec_prefix%g
-s%@prefix@%$prefix%g
-s%@program_transform_name@%$program_transform_name%g
-s%@bindir@%$bindir%g
-s%@sbindir@%$sbindir%g
-s%@libexecdir@%$libexecdir%g
-s%@datadir@%$datadir%g
-s%@sysconfdir@%$sysconfdir%g
-s%@sharedstatedir@%$sharedstatedir%g
-s%@localstatedir@%$localstatedir%g
-s%@libdir@%$libdir%g
-s%@includedir@%$includedir%g
-s%@oldincludedir@%$oldincludedir%g
-s%@infodir@%$infodir%g
-s%@mandir@%$mandir%g
-s%@CC@%$CC%g
-s%@AR@%$AR%g
-s%@SET_MAKE@%$SET_MAKE%g
-s%@CPP@%$CPP%g
-
-CEOF
-EOF
-
-cat >> $CONFIG_STATUS <<\EOF
-
-# Split the substitutions into bite-sized pieces for seds with
-# small command number limits, like on Digital OSF/1 and HP-UX.
-ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
-ac_file=1 # Number of current file.
-ac_beg=1 # First line for current file.
-ac_end=$ac_max_sed_cmds # Line after last line for current file.
-ac_more_lines=:
-ac_sed_cmds=""
-while $ac_more_lines; do
- if test $ac_beg -gt 1; then
- sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
- else
- sed "${ac_end}q" conftest.subs > conftest.s$ac_file
- fi
- if test ! -s conftest.s$ac_file; then
- ac_more_lines=false
- rm -f conftest.s$ac_file
- else
- if test -z "$ac_sed_cmds"; then
- ac_sed_cmds="sed -f conftest.s$ac_file"
- else
- ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
- fi
- ac_file=`expr $ac_file + 1`
- ac_beg=$ac_end
- ac_end=`expr $ac_end + $ac_max_sed_cmds`
- fi
-done
-if test -z "$ac_sed_cmds"; then
- ac_sed_cmds=cat
-fi
-EOF
-
-cat >> $CONFIG_STATUS <<EOF
-
-CONFIG_FILES=\${CONFIG_FILES-"Makefile"}
-EOF
-cat >> $CONFIG_STATUS <<\EOF
-for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
- # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
- case "$ac_file" in
- *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
- ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
- *) ac_file_in="${ac_file}.in" ;;
- esac
-
- # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
-
- # Remove last slash and all that follows it. Not all systems have dirname.
- ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
- if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
- # The file is in a subdirectory.
- test ! -d "$ac_dir" && mkdir "$ac_dir"
- ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
- # A "../" for each directory in $ac_dir_suffix.
- ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
- else
- ac_dir_suffix= ac_dots=
- fi
-
- case "$ac_given_srcdir" in
- .) srcdir=.
- if test -z "$ac_dots"; then top_srcdir=.
- else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
- /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
- *) # Relative path.
- srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
- top_srcdir="$ac_dots$ac_given_srcdir" ;;
- esac
-
-
- echo creating "$ac_file"
- rm -f "$ac_file"
- configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
- case "$ac_file" in
- *Makefile*) ac_comsub="1i\\
-# $configure_input" ;;
- *) ac_comsub= ;;
- esac
-
- ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
- sed -e "$ac_comsub
-s%@configure_input@%$configure_input%g
-s%@srcdir@%$srcdir%g
-s%@top_srcdir@%$top_srcdir%g
-" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
-fi; done
-rm -f conftest.s*
-
-EOF
-cat >> $CONFIG_STATUS <<EOF
-
-EOF
-cat >> $CONFIG_STATUS <<\EOF
-
-exit 0
-EOF
-chmod +x $CONFIG_STATUS
-rm -fr confdefs* $ac_clean_files
-test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
-
-
diff --git a/contrib/libf2c/libF77/configure.in b/contrib/libf2c/libF77/configure.in
deleted file mode 100644
index 9d344822fb09..000000000000
--- a/contrib/libf2c/libF77/configure.in
+++ /dev/null
@@ -1,114 +0,0 @@
-# Process this file with autoconf to produce a configure script.
-# Copyright (C) 1995, 1997, 1998 Free Software Foundation, Inc.
-# Contributed by Dave Love (d.love@dl.ac.uk).
-#
-#This file is part of GNU Fortran.
-#
-#GNU Fortran 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.
-#
-#GNU Fortran is distributed in the hope that it will be useful,
-#but WITHOUT ANY WARRANTY; without even the implied warranty of
-#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-#GNU General Public License for more details.
-#
-#You should have received a copy of the GNU General Public License
-#along with GNU Fortran; see the file COPYING. If not, write to
-#the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-#02111-1307, USA.
-
-AC_PREREQ(2.12.1)
-AC_INIT(getarg_.c)
-
-dnl Checks for programs.
-
-dnl FIXME AC_PROG_CC wants CC to be able to link things, but it may
-dnl not be able to.
-define([AC_PROG_CC_WORKS],[])
-
-# For g77 we'll set CC to point at the built gcc, but this will get it into
-# the makefiles
-AC_PROG_CC
-
-test "$AR" || AR=ar
-AC_SUBST(AR)
-AC_PROG_MAKE_SET
-
-dnl Checks for libraries.
-
-dnl Checks for header files.
-# Sanity check for the cross-compilation case:
-AC_CHECK_HEADER(stdio.h,:,
- [AC_MSG_ERROR([Can't find stdio.h.
-You must have a usable C system for the target already installed, at least
-including headers and, preferably, the library, before you can configure
-the G77 runtime system. If necessary, install gcc now with \`LANGUAGES=c',
-then the target library, then build with \`LANGUAGES=f77'.])])
-
-AC_HEADER_STDC
-dnl We could do this if we didn't know we were using gcc
-dnl AC_MSG_CHECKING(for prototype-savvy compiler)
-dnl AC_CACHE_VAL(g77_cv_sys_proto,
-dnl [AC_TRY_LINK(,
-dnl dnl looks screwy because TRY_LINK expects a function body
-dnl [return 0;} int foo (int * bar) {],
-dnl g77_cv_sys_proto=yes,
-dnl [g77_cv_sys_proto=no
-dnl AC_DEFINE(KR_headers)])])
-dnl AC_MSG_RESULT($g77_cv_sys_proto)
-
-AC_MSG_CHECKING(for posix)
-AC_CACHE_VAL(g77_cv_header_posix,
- AC_EGREP_CPP(yes,
- [#include <sys/types.h>
-#include <unistd.h>
-#ifdef _POSIX_VERSION
- yes
-#endif
-],
- g77_cv_header_posix=yes,
- g77_cv_header_posix=no))
-AC_MSG_RESULT($g77_cv_header_posix)
-
-# We can rely on the GNU library being posix-ish. I guess checking the
-# header isn't actually like checking the functions, though...
-AC_MSG_CHECKING(for GNU library)
-AC_CACHE_VAL(g77_cv_lib_gnu,
- AC_EGREP_CPP(yes,
- [#include <stdio.h>
-#ifdef __GNU_LIBRARY__
- yes
-#endif
-],
- g77_cv_lib_gnu=yes, g77_cv_lib_gnu=no))
-AC_MSG_RESULT($g77_cv_lib_gnu)
-
-dnl Checks for library functions.
-AC_TYPE_SIGNAL
-# we'll get atexit by default
-if test $ac_cv_header_stdc != yes; then
-AC_CHECK_FUNC(atexit,
- AC_DEFINE(onexit,atexit),dnl just in case
- [AC_DEFINE(NO_ONEXIT)
- AC_CHECK_FUNC(onexit,,
- [AC_CHECK_FUNC(on_exit,
- AC_DEFINE(onexit,on_exit),)])])
-else true
-fi
-
-dnl perhaps should check also for remainder
-dnl Unfortunately, the message implies we're just checking for -lm...
-AC_CHECK_LIB(m,drem,AC_DEFINE(IEEE_drem))
-
-AC_DEFINE(Skip_f2c_Undefs)
-AC_DEFINE(IEEE_COMPLEX_DIVIDE)
-
-AC_OUTPUT(Makefile)
-
-dnl Local Variables:
-dnl comment-start: "dnl "
-dnl comment-end: ""
-dnl comment-start-skip: "\\bdnl\\b\\s *"
-dnl End:
diff --git a/contrib/libf2c/libF77/d_abs.c b/contrib/libf2c/libF77/d_abs.c
deleted file mode 100644
index cb157e067b73..000000000000
--- a/contrib/libf2c/libF77/d_abs.c
+++ /dev/null
@@ -1,12 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-double d_abs(x) doublereal *x;
-#else
-double d_abs(doublereal *x)
-#endif
-{
-if(*x >= 0)
- return(*x);
-return(- *x);
-}
diff --git a/contrib/libf2c/libF77/d_acos.c b/contrib/libf2c/libF77/d_acos.c
deleted file mode 100644
index 33da5369db21..000000000000
--- a/contrib/libf2c/libF77/d_acos.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-double acos();
-double d_acos(x) doublereal *x;
-#else
-#undef abs
-#include <math.h>
-double d_acos(doublereal *x)
-#endif
-{
-return( acos(*x) );
-}
diff --git a/contrib/libf2c/libF77/d_asin.c b/contrib/libf2c/libF77/d_asin.c
deleted file mode 100644
index 79b33ca1bd6d..000000000000
--- a/contrib/libf2c/libF77/d_asin.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-double asin();
-double d_asin(x) doublereal *x;
-#else
-#undef abs
-#include <math.h>
-double d_asin(doublereal *x)
-#endif
-{
-return( asin(*x) );
-}
diff --git a/contrib/libf2c/libF77/d_atan.c b/contrib/libf2c/libF77/d_atan.c
deleted file mode 100644
index caea4a406e0b..000000000000
--- a/contrib/libf2c/libF77/d_atan.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-double atan();
-double d_atan(x) doublereal *x;
-#else
-#undef abs
-#include <math.h>
-double d_atan(doublereal *x)
-#endif
-{
-return( atan(*x) );
-}
diff --git a/contrib/libf2c/libF77/d_atn2.c b/contrib/libf2c/libF77/d_atn2.c
deleted file mode 100644
index 6748a55d56fb..000000000000
--- a/contrib/libf2c/libF77/d_atn2.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-double atan2();
-double d_atn2(x,y) doublereal *x, *y;
-#else
-#undef abs
-#include <math.h>
-double d_atn2(doublereal *x, doublereal *y)
-#endif
-{
-return( atan2(*x,*y) );
-}
diff --git a/contrib/libf2c/libF77/d_cnjg.c b/contrib/libf2c/libF77/d_cnjg.c
deleted file mode 100644
index c1970a56da9f..000000000000
--- a/contrib/libf2c/libF77/d_cnjg.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include "f2c.h"
-
- VOID
-#ifdef KR_headers
-d_cnjg(r, z) doublecomplex *r, *z;
-#else
-d_cnjg(doublecomplex *r, doublecomplex *z)
-#endif
-{
- doublereal zi = z->i;
- r->r = z->r;
- r->i = -zi;
- }
diff --git a/contrib/libf2c/libF77/d_cos.c b/contrib/libf2c/libF77/d_cos.c
deleted file mode 100644
index fa4d6ca406f1..000000000000
--- a/contrib/libf2c/libF77/d_cos.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-double cos();
-double d_cos(x) doublereal *x;
-#else
-#undef abs
-#include <math.h>
-double d_cos(doublereal *x)
-#endif
-{
-return( cos(*x) );
-}
diff --git a/contrib/libf2c/libF77/d_cosh.c b/contrib/libf2c/libF77/d_cosh.c
deleted file mode 100644
index edc0ebc10923..000000000000
--- a/contrib/libf2c/libF77/d_cosh.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-double cosh();
-double d_cosh(x) doublereal *x;
-#else
-#undef abs
-#include <math.h>
-double d_cosh(doublereal *x)
-#endif
-{
-return( cosh(*x) );
-}
diff --git a/contrib/libf2c/libF77/d_dim.c b/contrib/libf2c/libF77/d_dim.c
deleted file mode 100644
index 1d0ecb7bbb64..000000000000
--- a/contrib/libf2c/libF77/d_dim.c
+++ /dev/null
@@ -1,10 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-double d_dim(a,b) doublereal *a, *b;
-#else
-double d_dim(doublereal *a, doublereal *b)
-#endif
-{
-return( *a > *b ? *a - *b : 0);
-}
diff --git a/contrib/libf2c/libF77/d_exp.c b/contrib/libf2c/libF77/d_exp.c
deleted file mode 100644
index be12fd70551e..000000000000
--- a/contrib/libf2c/libF77/d_exp.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-double exp();
-double d_exp(x) doublereal *x;
-#else
-#undef abs
-#include <math.h>
-double d_exp(doublereal *x)
-#endif
-{
-return( exp(*x) );
-}
diff --git a/contrib/libf2c/libF77/d_imag.c b/contrib/libf2c/libF77/d_imag.c
deleted file mode 100644
index 793a3f9c4059..000000000000
--- a/contrib/libf2c/libF77/d_imag.c
+++ /dev/null
@@ -1,10 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-double d_imag(z) doublecomplex *z;
-#else
-double d_imag(doublecomplex *z)
-#endif
-{
-return(z->i);
-}
diff --git a/contrib/libf2c/libF77/d_int.c b/contrib/libf2c/libF77/d_int.c
deleted file mode 100644
index beff1e7d3781..000000000000
--- a/contrib/libf2c/libF77/d_int.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-double floor();
-double d_int(x) doublereal *x;
-#else
-#undef abs
-#include <math.h>
-double d_int(doublereal *x)
-#endif
-{
-return( (*x>0) ? floor(*x) : -floor(- *x) );
-}
diff --git a/contrib/libf2c/libF77/d_lg10.c b/contrib/libf2c/libF77/d_lg10.c
deleted file mode 100644
index c0892bd512aa..000000000000
--- a/contrib/libf2c/libF77/d_lg10.c
+++ /dev/null
@@ -1,15 +0,0 @@
-#include "f2c.h"
-
-#define log10e 0.43429448190325182765
-
-#ifdef KR_headers
-double log();
-double d_lg10(x) doublereal *x;
-#else
-#undef abs
-#include <math.h>
-double d_lg10(doublereal *x)
-#endif
-{
-return( log10e * log(*x) );
-}
diff --git a/contrib/libf2c/libF77/d_log.c b/contrib/libf2c/libF77/d_log.c
deleted file mode 100644
index 592015b28212..000000000000
--- a/contrib/libf2c/libF77/d_log.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-double log();
-double d_log(x) doublereal *x;
-#else
-#undef abs
-#include <math.h>
-double d_log(doublereal *x)
-#endif
-{
-return( log(*x) );
-}
diff --git a/contrib/libf2c/libF77/d_mod.c b/contrib/libf2c/libF77/d_mod.c
deleted file mode 100644
index 23f19299168e..000000000000
--- a/contrib/libf2c/libF77/d_mod.c
+++ /dev/null
@@ -1,40 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-#ifdef IEEE_drem
-double drem();
-#else
-double floor();
-#endif
-double d_mod(x,y) doublereal *x, *y;
-#else
-#ifdef IEEE_drem
-double drem(double, double);
-#else
-#undef abs
-#include <math.h>
-#endif
-double d_mod(doublereal *x, doublereal *y)
-#endif
-{
-#ifdef IEEE_drem
- double xa, ya, z;
- if ((ya = *y) < 0.)
- ya = -ya;
- z = drem(xa = *x, ya);
- if (xa > 0) {
- if (z < 0)
- z += ya;
- }
- else if (z > 0)
- z -= ya;
- return z;
-#else
- double quotient;
- if( (quotient = *x / *y) >= 0)
- quotient = floor(quotient);
- else
- quotient = -floor(-quotient);
- return(*x - (*y) * quotient );
-#endif
-}
diff --git a/contrib/libf2c/libF77/d_nint.c b/contrib/libf2c/libF77/d_nint.c
deleted file mode 100644
index 064beff669ce..000000000000
--- a/contrib/libf2c/libF77/d_nint.c
+++ /dev/null
@@ -1,14 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-double floor();
-double d_nint(x) doublereal *x;
-#else
-#undef abs
-#include <math.h>
-double d_nint(doublereal *x)
-#endif
-{
-return( (*x)>=0 ?
- floor(*x + .5) : -floor(.5 - *x) );
-}
diff --git a/contrib/libf2c/libF77/d_prod.c b/contrib/libf2c/libF77/d_prod.c
deleted file mode 100644
index 3d4cef7835c2..000000000000
--- a/contrib/libf2c/libF77/d_prod.c
+++ /dev/null
@@ -1,10 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-double d_prod(x,y) real *x, *y;
-#else
-double d_prod(real *x, real *y)
-#endif
-{
-return( (*x) * (*y) );
-}
diff --git a/contrib/libf2c/libF77/d_sign.c b/contrib/libf2c/libF77/d_sign.c
deleted file mode 100644
index 514ff0bbff82..000000000000
--- a/contrib/libf2c/libF77/d_sign.c
+++ /dev/null
@@ -1,12 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-double d_sign(a,b) doublereal *a, *b;
-#else
-double d_sign(doublereal *a, doublereal *b)
-#endif
-{
-double x;
-x = (*a >= 0 ? *a : - *a);
-return( *b >= 0 ? x : -x);
-}
diff --git a/contrib/libf2c/libF77/d_sin.c b/contrib/libf2c/libF77/d_sin.c
deleted file mode 100644
index fdd699eede53..000000000000
--- a/contrib/libf2c/libF77/d_sin.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-double sin();
-double d_sin(x) doublereal *x;
-#else
-#undef abs
-#include <math.h>
-double d_sin(doublereal *x)
-#endif
-{
-return( sin(*x) );
-}
diff --git a/contrib/libf2c/libF77/d_sinh.c b/contrib/libf2c/libF77/d_sinh.c
deleted file mode 100644
index 77f36904f8e5..000000000000
--- a/contrib/libf2c/libF77/d_sinh.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-double sinh();
-double d_sinh(x) doublereal *x;
-#else
-#undef abs
-#include <math.h>
-double d_sinh(doublereal *x)
-#endif
-{
-return( sinh(*x) );
-}
diff --git a/contrib/libf2c/libF77/d_sqrt.c b/contrib/libf2c/libF77/d_sqrt.c
deleted file mode 100644
index b5cf83b946f8..000000000000
--- a/contrib/libf2c/libF77/d_sqrt.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-double sqrt();
-double d_sqrt(x) doublereal *x;
-#else
-#undef abs
-#include <math.h>
-double d_sqrt(doublereal *x)
-#endif
-{
-return( sqrt(*x) );
-}
diff --git a/contrib/libf2c/libF77/d_tan.c b/contrib/libf2c/libF77/d_tan.c
deleted file mode 100644
index af94a053223c..000000000000
--- a/contrib/libf2c/libF77/d_tan.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-double tan();
-double d_tan(x) doublereal *x;
-#else
-#undef abs
-#include <math.h>
-double d_tan(doublereal *x)
-#endif
-{
-return( tan(*x) );
-}
diff --git a/contrib/libf2c/libF77/d_tanh.c b/contrib/libf2c/libF77/d_tanh.c
deleted file mode 100644
index 92a02d4fd6ba..000000000000
--- a/contrib/libf2c/libF77/d_tanh.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-double tanh();
-double d_tanh(x) doublereal *x;
-#else
-#undef abs
-#include <math.h>
-double d_tanh(doublereal *x)
-#endif
-{
-return( tanh(*x) );
-}
diff --git a/contrib/libf2c/libF77/derf_.c b/contrib/libf2c/libF77/derf_.c
deleted file mode 100644
index fba6b6b11f39..000000000000
--- a/contrib/libf2c/libF77/derf_.c
+++ /dev/null
@@ -1,12 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-double erf();
-double G77_derf_0 (x) doublereal *x;
-#else
-extern double erf(double);
-double G77_derf_0 (doublereal *x)
-#endif
-{
-return( erf(*x) );
-}
diff --git a/contrib/libf2c/libF77/derfc_.c b/contrib/libf2c/libF77/derfc_.c
deleted file mode 100644
index ae1ac7403022..000000000000
--- a/contrib/libf2c/libF77/derfc_.c
+++ /dev/null
@@ -1,14 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-extern double erfc();
-
-double G77_derfc_0 (x) doublereal *x;
-#else
-extern double erfc(double);
-
-double G77_derfc_0 (doublereal *x)
-#endif
-{
-return( erfc(*x) );
-}
diff --git a/contrib/libf2c/libF77/dtime_.c b/contrib/libf2c/libF77/dtime_.c
deleted file mode 100644
index e2c3a03cb7ad..000000000000
--- a/contrib/libf2c/libF77/dtime_.c
+++ /dev/null
@@ -1,53 +0,0 @@
-#include "time.h"
-
-#ifdef MSDOS
-#undef USE_CLOCK
-#define USE_CLOCK
-#endif
-
-#ifndef USE_CLOCK
-#define _INCLUDE_POSIX_SOURCE /* for HP-UX */
-#define _INCLUDE_XOPEN_SOURCE /* for HP-UX */
-#include "sys/types.h"
-#include "sys/times.h"
-#endif
-
-#undef Hz
-#ifdef CLK_TCK
-#define Hz CLK_TCK
-#else
-#ifdef HZ
-#define Hz HZ
-#else
-#define Hz 60
-#endif
-#endif
-
- double
-#ifdef KR_headers
-dtime_(tarray) float *tarray;
-#else
-dtime_(float *tarray)
-#endif
-{
-#ifdef USE_CLOCK
-#ifndef CLOCKS_PER_SECOND
-#define CLOCKS_PER_SECOND Hz
-#endif
- static double t0;
- double t = clock();
- tarray[1] = 0;
- tarray[0] = (t - t0) / CLOCKS_PER_SECOND;
- t0 = t;
- return tarray[0];
-#else
- struct tms t;
- static struct tms t0;
-
- times(&t);
- tarray[0] = (double)(t.tms_utime - t0.tms_utime) / Hz;
- tarray[1] = (double)(t.tms_stime - t0.tms_stime) / Hz;
- t0 = t;
- return tarray[0] + tarray[1];
-#endif
- }
diff --git a/contrib/libf2c/libF77/ef1asc_.c b/contrib/libf2c/libF77/ef1asc_.c
deleted file mode 100644
index 8588584fbabe..000000000000
--- a/contrib/libf2c/libF77/ef1asc_.c
+++ /dev/null
@@ -1,19 +0,0 @@
-/* EFL support routine to copy string b to string a */
-
-#include "f2c.h"
-
-
-#define M ( (long) (sizeof(long) - 1) )
-#define EVEN(x) ( ( (x)+ M) & (~M) )
-
-#ifdef KR_headers
-extern VOID s_copy();
-G77_ef1asc_0 (a, la, b, lb) ftnint *a, *b; ftnlen *la, *lb;
-#else
-extern void s_copy(char*,char*,ftnlen,ftnlen);
-int G77_ef1asc_0 (ftnint *a, ftnlen *la, ftnint *b, ftnlen *lb)
-#endif
-{
-s_copy( (char *)a, (char *)b, EVEN(*la), *lb );
-return 0; /* ignored return value */
-}
diff --git a/contrib/libf2c/libF77/ef1cmc_.c b/contrib/libf2c/libF77/ef1cmc_.c
deleted file mode 100644
index f471172935f5..000000000000
--- a/contrib/libf2c/libF77/ef1cmc_.c
+++ /dev/null
@@ -1,14 +0,0 @@
-/* EFL support routine to compare two character strings */
-
-#include "f2c.h"
-
-#ifdef KR_headers
-extern integer s_cmp();
-integer G77_ef1cmc_0 (a, la, b, lb) ftnint *a, *b; ftnlen *la, *lb;
-#else
-extern integer s_cmp(char*,char*,ftnlen,ftnlen);
-integer G77_ef1cmc_0 (ftnint *a, ftnlen *la, ftnint *b, ftnlen *lb)
-#endif
-{
-return( s_cmp( (char *)a, (char *)b, *la, *lb) );
-}
diff --git a/contrib/libf2c/libF77/erf_.c b/contrib/libf2c/libF77/erf_.c
deleted file mode 100644
index 1ba4350ad05c..000000000000
--- a/contrib/libf2c/libF77/erf_.c
+++ /dev/null
@@ -1,12 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-double erf();
-double G77_erf_0 (x) real *x;
-#else
-extern double erf(double);
-double G77_erf_0 (real *x)
-#endif
-{
-return( erf(*x) );
-}
diff --git a/contrib/libf2c/libF77/erfc_.c b/contrib/libf2c/libF77/erfc_.c
deleted file mode 100644
index f44b1d49d84b..000000000000
--- a/contrib/libf2c/libF77/erfc_.c
+++ /dev/null
@@ -1,12 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-double erfc();
-double G77_erfc_0 (x) real *x;
-#else
-extern double erfc(double);
-double G77_erfc_0 (real *x)
-#endif
-{
-return( erfc(*x) );
-}
diff --git a/contrib/libf2c/libF77/etime_.c b/contrib/libf2c/libF77/etime_.c
deleted file mode 100644
index 0c3209d26126..000000000000
--- a/contrib/libf2c/libF77/etime_.c
+++ /dev/null
@@ -1,47 +0,0 @@
-#include "time.h"
-
-#ifdef MSDOS
-#undef USE_CLOCK
-#define USE_CLOCK
-#endif
-
-#ifndef USE_CLOCK
-#define _INCLUDE_POSIX_SOURCE /* for HP-UX */
-#define _INCLUDE_XOPEN_SOURCE /* for HP-UX */
-#include "sys/types.h"
-#include "sys/times.h"
-#endif
-
-#undef Hz
-#ifdef CLK_TCK
-#define Hz CLK_TCK
-#else
-#ifdef HZ
-#define Hz HZ
-#else
-#define Hz 60
-#endif
-#endif
-
- double
-#ifdef KR_headers
-etime_(tarray) float *tarray;
-#else
-etime_(float *tarray)
-#endif
-{
-#ifdef USE_CLOCK
-#ifndef CLOCKS_PER_SECOND
-#define CLOCKS_PER_SECOND Hz
-#endif
- double t = clock();
- tarray[1] = 0;
- return tarray[0] = t / CLOCKS_PER_SECOND;
-#else
- struct tms t;
-
- times(&t);
- return (tarray[0] = (double)t.tms_utime/Hz)
- + (tarray[1] = (double)t.tms_stime/Hz);
-#endif
- }
diff --git a/contrib/libf2c/libF77/exit_.c b/contrib/libf2c/libF77/exit_.c
deleted file mode 100644
index 4c0582add127..000000000000
--- a/contrib/libf2c/libF77/exit_.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/* This gives the effect of
-
- subroutine exit(rc)
- integer*4 rc
- stop
- end
-
- * with the added side effect of supplying rc as the program's exit code.
- */
-
-#include "f2c.h"
-#undef abs
-#undef min
-#undef max
-#ifndef KR_headers
-#include <stdlib.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
-extern void f_exit(void);
-#endif
-
- void
-#ifdef KR_headers
-G77_exit_0 (rc) integer *rc;
-#else
-G77_exit_0 (integer *rc)
-#endif
-{
-#ifdef NO_ONEXIT
- f_exit();
-#endif
- exit(*rc);
- }
-#ifdef __cplusplus
-}
-#endif
diff --git a/contrib/libf2c/libF77/f2ch.add b/contrib/libf2c/libF77/f2ch.add
deleted file mode 100644
index a2acc17a1596..000000000000
--- a/contrib/libf2c/libF77/f2ch.add
+++ /dev/null
@@ -1,162 +0,0 @@
-/* If you are using a C++ compiler, append the following to f2c.h
- for compiling libF77 and libI77. */
-
-#ifdef __cplusplus
-extern "C" {
-extern int abort_(void);
-extern double c_abs(complex *);
-extern void c_cos(complex *, complex *);
-extern void c_div(complex *, complex *, complex *);
-extern void c_exp(complex *, complex *);
-extern void c_log(complex *, complex *);
-extern void c_sin(complex *, complex *);
-extern void c_sqrt(complex *, complex *);
-extern double d_abs(double *);
-extern double d_acos(double *);
-extern double d_asin(double *);
-extern double d_atan(double *);
-extern double d_atn2(double *, double *);
-extern void d_cnjg(doublecomplex *, doublecomplex *);
-extern double d_cos(double *);
-extern double d_cosh(double *);
-extern double d_dim(double *, double *);
-extern double d_exp(double *);
-extern double d_imag(doublecomplex *);
-extern double d_int(double *);
-extern double d_lg10(double *);
-extern double d_log(double *);
-extern double d_mod(double *, double *);
-extern double d_nint(double *);
-extern double d_prod(float *, float *);
-extern double d_sign(double *, double *);
-extern double d_sin(double *);
-extern double d_sinh(double *);
-extern double d_sqrt(double *);
-extern double d_tan(double *);
-extern double d_tanh(double *);
-extern double derf_(double *);
-extern double derfc_(double *);
-extern integer do_fio(ftnint *, char *, ftnlen);
-extern integer do_lio(ftnint *, ftnint *, char *, ftnlen);
-extern integer do_uio(ftnint *, char *, ftnlen);
-extern integer e_rdfe(void);
-extern integer e_rdue(void);
-extern integer e_rsfe(void);
-extern integer e_rsfi(void);
-extern integer e_rsle(void);
-extern integer e_rsli(void);
-extern integer e_rsue(void);
-extern integer e_wdfe(void);
-extern integer e_wdue(void);
-extern integer e_wsfe(void);
-extern integer e_wsfi(void);
-extern integer e_wsle(void);
-extern integer e_wsli(void);
-extern integer e_wsue(void);
-extern int ef1asc_(ftnint *, ftnlen *, ftnint *, ftnlen *);
-extern integer ef1cmc_(ftnint *, ftnlen *, ftnint *, ftnlen *);
-extern double erf(double);
-extern double erf_(float *);
-extern double erfc(double);
-extern double erfc_(float *);
-extern integer f_back(alist *);
-extern integer f_clos(cllist *);
-extern integer f_end(alist *);
-extern void f_exit(void);
-extern integer f_inqu(inlist *);
-extern integer f_open(olist *);
-extern integer f_rew(alist *);
-extern int flush_(void);
-extern void getarg_(integer *, char *, ftnlen);
-extern void getenv_(char *, char *, ftnlen, ftnlen);
-extern short h_abs(short *);
-extern short h_dim(short *, short *);
-extern short h_dnnt(double *);
-extern short h_indx(char *, char *, ftnlen, ftnlen);
-extern short h_len(char *, ftnlen);
-extern short h_mod(short *, short *);
-extern short h_nint(float *);
-extern short h_sign(short *, short *);
-extern short hl_ge(char *, char *, ftnlen, ftnlen);
-extern short hl_gt(char *, char *, ftnlen, ftnlen);
-extern short hl_le(char *, char *, ftnlen, ftnlen);
-extern short hl_lt(char *, char *, ftnlen, ftnlen);
-extern integer i_abs(integer *);
-extern integer i_dim(integer *, integer *);
-extern integer i_dnnt(double *);
-extern integer i_indx(char *, char *, ftnlen, ftnlen);
-extern integer i_len(char *, ftnlen);
-extern integer i_mod(integer *, integer *);
-extern integer i_nint(float *);
-extern integer i_sign(integer *, integer *);
-extern integer iargc_(void);
-extern ftnlen l_ge(char *, char *, ftnlen, ftnlen);
-extern ftnlen l_gt(char *, char *, ftnlen, ftnlen);
-extern ftnlen l_le(char *, char *, ftnlen, ftnlen);
-extern ftnlen l_lt(char *, char *, ftnlen, ftnlen);
-extern void pow_ci(complex *, complex *, integer *);
-extern double pow_dd(double *, double *);
-extern double pow_di(double *, integer *);
-extern short pow_hh(short *, shortint *);
-extern integer pow_ii(integer *, integer *);
-extern double pow_ri(float *, integer *);
-extern void pow_zi(doublecomplex *, doublecomplex *, integer *);
-extern void pow_zz(doublecomplex *, doublecomplex *, doublecomplex *);
-extern double r_abs(float *);
-extern double r_acos(float *);
-extern double r_asin(float *);
-extern double r_atan(float *);
-extern double r_atn2(float *, float *);
-extern void r_cnjg(complex *, complex *);
-extern double r_cos(float *);
-extern double r_cosh(float *);
-extern double r_dim(float *, float *);
-extern double r_exp(float *);
-extern double r_imag(complex *);
-extern double r_int(float *);
-extern double r_lg10(float *);
-extern double r_log(float *);
-extern double r_mod(float *, float *);
-extern double r_nint(float *);
-extern double r_sign(float *, float *);
-extern double r_sin(float *);
-extern double r_sinh(float *);
-extern double r_sqrt(float *);
-extern double r_tan(float *);
-extern double r_tanh(float *);
-extern void s_cat(char *, char **, integer *, integer *, ftnlen);
-extern integer s_cmp(char *, char *, ftnlen, ftnlen);
-extern void s_copy(char *, char *, ftnlen, ftnlen);
-extern int s_paus(char *, ftnlen);
-extern integer s_rdfe(cilist *);
-extern integer s_rdue(cilist *);
-extern integer s_rnge(char *, integer, char *, integer);
-extern integer s_rsfe(cilist *);
-extern integer s_rsfi(icilist *);
-extern integer s_rsle(cilist *);
-extern integer s_rsli(icilist *);
-extern integer s_rsne(cilist *);
-extern integer s_rsni(icilist *);
-extern integer s_rsue(cilist *);
-extern int s_stop(char *, ftnlen);
-extern integer s_wdfe(cilist *);
-extern integer s_wdue(cilist *);
-extern integer s_wsfe(cilist *);
-extern integer s_wsfi(icilist *);
-extern integer s_wsle(cilist *);
-extern integer s_wsli(icilist *);
-extern integer s_wsne(cilist *);
-extern integer s_wsni(icilist *);
-extern integer s_wsue(cilist *);
-extern void sig_die(char *, int);
-extern integer signal_(integer *, void (*)(int));
-extern integer system_(char *, ftnlen);
-extern double z_abs(doublecomplex *);
-extern void z_cos(doublecomplex *, doublecomplex *);
-extern void z_div(doublecomplex *, doublecomplex *, doublecomplex *);
-extern void z_exp(doublecomplex *, doublecomplex *);
-extern void z_log(doublecomplex *, doublecomplex *);
-extern void z_sin(doublecomplex *, doublecomplex *);
-extern void z_sqrt(doublecomplex *, doublecomplex *);
- }
-#endif
diff --git a/contrib/libf2c/libF77/getarg_.c b/contrib/libf2c/libF77/getarg_.c
deleted file mode 100644
index 5cf3ffb85999..000000000000
--- a/contrib/libf2c/libF77/getarg_.c
+++ /dev/null
@@ -1,28 +0,0 @@
-#include "f2c.h"
-
-/*
- * subroutine getarg(k, c)
- * returns the kth unix command argument in fortran character
- * variable argument c
-*/
-
-#ifdef KR_headers
-VOID G77_getarg_0 (n, s, ls) ftnint *n; register char *s; ftnlen ls;
-#else
-void G77_getarg_0 (ftnint *n, register char *s, ftnlen ls)
-#endif
-{
-extern int f__xargc;
-extern char **f__xargv;
-register char *t;
-register int i;
-
-if(*n>=0 && *n<f__xargc)
- t = f__xargv[*n];
-else
- t = "";
-for(i = 0; i<ls && *t!='\0' ; ++i)
- *s++ = *t++;
-for( ; i<ls ; ++i)
- *s++ = ' ';
-}
diff --git a/contrib/libf2c/libF77/getenv_.c b/contrib/libf2c/libF77/getenv_.c
deleted file mode 100644
index 4d0b7cf7b04b..000000000000
--- a/contrib/libf2c/libF77/getenv_.c
+++ /dev/null
@@ -1,56 +0,0 @@
-#include "f2c.h"
-#undef abs
-#ifdef KR_headers
-extern char *F77_aloc(), *getenv();
-#else
-#include <stdlib.h>
-#include <string.h>
-extern char *F77_aloc(ftnlen, char*);
-#endif
-
-/*
- * getenv - f77 subroutine to return environment variables
- *
- * called by:
- * call getenv (ENV_NAME, char_var)
- * where:
- * ENV_NAME is the name of an environment variable
- * char_var is a character variable which will receive
- * the current value of ENV_NAME, or all blanks
- * if ENV_NAME is not defined
- */
-
-#ifdef KR_headers
- VOID
-G77_getenv_0 (fname, value, flen, vlen) char *value, *fname; ftnlen vlen, flen;
-#else
- void
-G77_getenv_0 (char *fname, char *value, ftnlen flen, ftnlen vlen)
-#endif
-{
- char buf[256], *ep, *fp;
- integer i;
-
- if (flen <= 0)
- goto add_blanks;
- for(i = 0; i < sizeof(buf); i++) {
- if (i == flen || (buf[i] = fname[i]) == ' ') {
- buf[i] = 0;
- ep = getenv(buf);
- goto have_ep;
- }
- }
- while(i < flen && fname[i] != ' ')
- i++;
- strncpy(fp = F77_aloc(i+1, "getenv_"), fname, (int)i);
- fp[i] = 0;
- ep = getenv(fp);
- free(fp);
- have_ep:
- if (ep)
- while(*ep && vlen-- > 0)
- *value++ = *ep++;
- add_blanks:
- while(vlen-- > 0)
- *value++ = ' ';
- }
diff --git a/contrib/libf2c/libF77/h_abs.c b/contrib/libf2c/libF77/h_abs.c
deleted file mode 100644
index 73b82151ac1d..000000000000
--- a/contrib/libf2c/libF77/h_abs.c
+++ /dev/null
@@ -1,12 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-shortint h_abs(x) shortint *x;
-#else
-shortint h_abs(shortint *x)
-#endif
-{
-if(*x >= 0)
- return(*x);
-return(- *x);
-}
diff --git a/contrib/libf2c/libF77/h_dim.c b/contrib/libf2c/libF77/h_dim.c
deleted file mode 100644
index ceff660e26cd..000000000000
--- a/contrib/libf2c/libF77/h_dim.c
+++ /dev/null
@@ -1,10 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-shortint h_dim(a,b) shortint *a, *b;
-#else
-shortint h_dim(shortint *a, shortint *b)
-#endif
-{
-return( *a > *b ? *a - *b : 0);
-}
diff --git a/contrib/libf2c/libF77/h_dnnt.c b/contrib/libf2c/libF77/h_dnnt.c
deleted file mode 100644
index 005ac6fc4124..000000000000
--- a/contrib/libf2c/libF77/h_dnnt.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-double floor();
-shortint h_dnnt(x) doublereal *x;
-#else
-#undef abs
-#include <math.h>
-shortint h_dnnt(doublereal *x)
-#endif
-{
-return (shortint)(*x >= 0. ? floor(*x + .5) : -floor(.5 - *x));
-}
diff --git a/contrib/libf2c/libF77/h_indx.c b/contrib/libf2c/libF77/h_indx.c
deleted file mode 100644
index a211cc7fa0fb..000000000000
--- a/contrib/libf2c/libF77/h_indx.c
+++ /dev/null
@@ -1,26 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-shortint h_indx(a, b, la, lb) char *a, *b; ftnlen la, lb;
-#else
-shortint h_indx(char *a, char *b, ftnlen la, ftnlen lb)
-#endif
-{
-ftnlen i, n;
-char *s, *t, *bend;
-
-n = la - lb + 1;
-bend = b + lb;
-
-for(i = 0 ; i < n ; ++i)
- {
- s = a + i;
- t = b;
- while(t < bend)
- if(*s++ != *t++)
- goto no;
- return((shortint)i+1);
- no: ;
- }
-return(0);
-}
diff --git a/contrib/libf2c/libF77/h_len.c b/contrib/libf2c/libF77/h_len.c
deleted file mode 100644
index 00a2151bfa11..000000000000
--- a/contrib/libf2c/libF77/h_len.c
+++ /dev/null
@@ -1,10 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-shortint h_len(s, n) char *s; ftnlen n;
-#else
-shortint h_len(char *s, ftnlen n)
-#endif
-{
-return(n);
-}
diff --git a/contrib/libf2c/libF77/h_mod.c b/contrib/libf2c/libF77/h_mod.c
deleted file mode 100644
index 43431c1c503c..000000000000
--- a/contrib/libf2c/libF77/h_mod.c
+++ /dev/null
@@ -1,10 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-shortint h_mod(a,b) short *a, *b;
-#else
-shortint h_mod(short *a, short *b)
-#endif
-{
-return( *a % *b);
-}
diff --git a/contrib/libf2c/libF77/h_nint.c b/contrib/libf2c/libF77/h_nint.c
deleted file mode 100644
index 6b8dc29b1542..000000000000
--- a/contrib/libf2c/libF77/h_nint.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-double floor();
-shortint h_nint(x) real *x;
-#else
-#undef abs
-#include <math.h>
-shortint h_nint(real *x)
-#endif
-{
-return (shortint)(*x >= 0 ? floor(*x + .5) : -floor(.5 - *x));
-}
diff --git a/contrib/libf2c/libF77/h_sign.c b/contrib/libf2c/libF77/h_sign.c
deleted file mode 100644
index 7b06c157a74e..000000000000
--- a/contrib/libf2c/libF77/h_sign.c
+++ /dev/null
@@ -1,12 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-shortint h_sign(a,b) shortint *a, *b;
-#else
-shortint h_sign(shortint *a, shortint *b)
-#endif
-{
-shortint x;
-x = (*a >= 0 ? *a : - *a);
-return( *b >= 0 ? x : -x);
-}
diff --git a/contrib/libf2c/libF77/hl_ge.c b/contrib/libf2c/libF77/hl_ge.c
deleted file mode 100644
index 4c29527065a2..000000000000
--- a/contrib/libf2c/libF77/hl_ge.c
+++ /dev/null
@@ -1,12 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-extern integer s_cmp();
-shortlogical hl_ge(a,b,la,lb) char *a, *b; ftnlen la, lb;
-#else
-extern integer s_cmp(char *, char *, ftnlen, ftnlen);
-shortlogical hl_ge(char *a, char *b, ftnlen la, ftnlen lb)
-#endif
-{
-return(s_cmp(a,b,la,lb) >= 0);
-}
diff --git a/contrib/libf2c/libF77/hl_gt.c b/contrib/libf2c/libF77/hl_gt.c
deleted file mode 100644
index c4f345a0859e..000000000000
--- a/contrib/libf2c/libF77/hl_gt.c
+++ /dev/null
@@ -1,12 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-extern integer s_cmp();
-shortlogical hl_gt(a,b,la,lb) char *a, *b; ftnlen la, lb;
-#else
-extern integer s_cmp(char *, char *, ftnlen, ftnlen);
-shortlogical hl_gt(char *a, char *b, ftnlen la, ftnlen lb)
-#endif
-{
-return(s_cmp(a,b,la,lb) > 0);
-}
diff --git a/contrib/libf2c/libF77/hl_le.c b/contrib/libf2c/libF77/hl_le.c
deleted file mode 100644
index a9cce596c715..000000000000
--- a/contrib/libf2c/libF77/hl_le.c
+++ /dev/null
@@ -1,12 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-extern integer s_cmp();
-shortlogical hl_le(a,b,la,lb) char *a, *b; ftnlen la, lb;
-#else
-extern integer s_cmp(char *, char *, ftnlen, ftnlen);
-shortlogical hl_le(char *a, char *b, ftnlen la, ftnlen lb)
-#endif
-{
-return(s_cmp(a,b,la,lb) <= 0);
-}
diff --git a/contrib/libf2c/libF77/hl_lt.c b/contrib/libf2c/libF77/hl_lt.c
deleted file mode 100644
index 162d919c3b48..000000000000
--- a/contrib/libf2c/libF77/hl_lt.c
+++ /dev/null
@@ -1,12 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-extern integer s_cmp();
-shortlogical hl_lt(a,b,la,lb) char *a, *b; ftnlen la, lb;
-#else
-extern integer s_cmp(char *, char *, ftnlen, ftnlen);
-shortlogical hl_lt(char *a, char *b, ftnlen la, ftnlen lb)
-#endif
-{
-return(s_cmp(a,b,la,lb) < 0);
-}
diff --git a/contrib/libf2c/libF77/i_abs.c b/contrib/libf2c/libF77/i_abs.c
deleted file mode 100644
index be21295aaa12..000000000000
--- a/contrib/libf2c/libF77/i_abs.c
+++ /dev/null
@@ -1,12 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-integer i_abs(x) integer *x;
-#else
-integer i_abs(integer *x)
-#endif
-{
-if(*x >= 0)
- return(*x);
-return(- *x);
-}
diff --git a/contrib/libf2c/libF77/i_dim.c b/contrib/libf2c/libF77/i_dim.c
deleted file mode 100644
index 6e1b1707b555..000000000000
--- a/contrib/libf2c/libF77/i_dim.c
+++ /dev/null
@@ -1,10 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-integer i_dim(a,b) integer *a, *b;
-#else
-integer i_dim(integer *a, integer *b)
-#endif
-{
-return( *a > *b ? *a - *b : 0);
-}
diff --git a/contrib/libf2c/libF77/i_dnnt.c b/contrib/libf2c/libF77/i_dnnt.c
deleted file mode 100644
index 4ede56ac3559..000000000000
--- a/contrib/libf2c/libF77/i_dnnt.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-double floor();
-integer i_dnnt(x) doublereal *x;
-#else
-#undef abs
-#include <math.h>
-integer i_dnnt(doublereal *x)
-#endif
-{
-return (integer)(*x >= 0. ? floor(*x + .5) : -floor(.5 - *x));
-}
diff --git a/contrib/libf2c/libF77/i_indx.c b/contrib/libf2c/libF77/i_indx.c
deleted file mode 100644
index 96e7bc51ba85..000000000000
--- a/contrib/libf2c/libF77/i_indx.c
+++ /dev/null
@@ -1,26 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-integer i_indx(a, b, la, lb) char *a, *b; ftnlen la, lb;
-#else
-integer i_indx(char *a, char *b, ftnlen la, ftnlen lb)
-#endif
-{
-ftnlen i, n;
-char *s, *t, *bend;
-
-n = la - lb + 1;
-bend = b + lb;
-
-for(i = 0 ; i < n ; ++i)
- {
- s = a + i;
- t = b;
- while(t < bend)
- if(*s++ != *t++)
- goto no;
- return(i+1);
- no: ;
- }
-return(0);
-}
diff --git a/contrib/libf2c/libF77/i_len.c b/contrib/libf2c/libF77/i_len.c
deleted file mode 100644
index 4020fee46183..000000000000
--- a/contrib/libf2c/libF77/i_len.c
+++ /dev/null
@@ -1,10 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-integer i_len(s, n) char *s; ftnlen n;
-#else
-integer i_len(char *s, ftnlen n)
-#endif
-{
-return(n);
-}
diff --git a/contrib/libf2c/libF77/i_mod.c b/contrib/libf2c/libF77/i_mod.c
deleted file mode 100644
index 6937c4213570..000000000000
--- a/contrib/libf2c/libF77/i_mod.c
+++ /dev/null
@@ -1,10 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-integer i_mod(a,b) integer *a, *b;
-#else
-integer i_mod(integer *a, integer *b)
-#endif
-{
-return( *a % *b);
-}
diff --git a/contrib/libf2c/libF77/i_nint.c b/contrib/libf2c/libF77/i_nint.c
deleted file mode 100644
index 411ce32821e3..000000000000
--- a/contrib/libf2c/libF77/i_nint.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-double floor();
-integer i_nint(x) real *x;
-#else
-#undef abs
-#include <math.h>
-integer i_nint(real *x)
-#endif
-{
-return (integer)(*x >= 0 ? floor(*x + .5) : -floor(.5 - *x));
-}
diff --git a/contrib/libf2c/libF77/i_sign.c b/contrib/libf2c/libF77/i_sign.c
deleted file mode 100644
index 94009b86e6fa..000000000000
--- a/contrib/libf2c/libF77/i_sign.c
+++ /dev/null
@@ -1,12 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-integer i_sign(a,b) integer *a, *b;
-#else
-integer i_sign(integer *a, integer *b)
-#endif
-{
-integer x;
-x = (*a >= 0 ? *a : - *a);
-return( *b >= 0 ? x : -x);
-}
diff --git a/contrib/libf2c/libF77/iargc_.c b/contrib/libf2c/libF77/iargc_.c
deleted file mode 100644
index 1e04c7744b3b..000000000000
--- a/contrib/libf2c/libF77/iargc_.c
+++ /dev/null
@@ -1,11 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-ftnint G77_iargc_0 ()
-#else
-ftnint G77_iargc_0 (void)
-#endif
-{
-extern int f__xargc;
-return ( f__xargc - 1 );
-}
diff --git a/contrib/libf2c/libF77/l_ge.c b/contrib/libf2c/libF77/l_ge.c
deleted file mode 100644
index 86b4a1f5a7f5..000000000000
--- a/contrib/libf2c/libF77/l_ge.c
+++ /dev/null
@@ -1,12 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-extern integer s_cmp();
-logical l_ge(a,b,la,lb) char *a, *b; ftnlen la, lb;
-#else
-extern integer s_cmp(char *, char *, ftnlen, ftnlen);
-logical l_ge(char *a, char *b, ftnlen la, ftnlen lb)
-#endif
-{
-return(s_cmp(a,b,la,lb) >= 0);
-}
diff --git a/contrib/libf2c/libF77/l_gt.c b/contrib/libf2c/libF77/l_gt.c
deleted file mode 100644
index c4b52f5bf7dd..000000000000
--- a/contrib/libf2c/libF77/l_gt.c
+++ /dev/null
@@ -1,12 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-extern integer s_cmp();
-logical l_gt(a,b,la,lb) char *a, *b; ftnlen la, lb;
-#else
-extern integer s_cmp(char *, char *, ftnlen, ftnlen);
-logical l_gt(char *a, char *b, ftnlen la, ftnlen lb)
-#endif
-{
-return(s_cmp(a,b,la,lb) > 0);
-}
diff --git a/contrib/libf2c/libF77/l_le.c b/contrib/libf2c/libF77/l_le.c
deleted file mode 100644
index f2740a238143..000000000000
--- a/contrib/libf2c/libF77/l_le.c
+++ /dev/null
@@ -1,12 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-extern integer s_cmp();
-logical l_le(a,b,la,lb) char *a, *b; ftnlen la, lb;
-#else
-extern integer s_cmp(char *, char *, ftnlen, ftnlen);
-logical l_le(char *a, char *b, ftnlen la, ftnlen lb)
-#endif
-{
-return(s_cmp(a,b,la,lb) <= 0);
-}
diff --git a/contrib/libf2c/libF77/l_lt.c b/contrib/libf2c/libF77/l_lt.c
deleted file mode 100644
index c48dc946f9a7..000000000000
--- a/contrib/libf2c/libF77/l_lt.c
+++ /dev/null
@@ -1,12 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-extern integer s_cmp();
-logical l_lt(a,b,la,lb) char *a, *b; ftnlen la, lb;
-#else
-extern integer s_cmp(char *, char *, ftnlen, ftnlen);
-logical l_lt(char *a, char *b, ftnlen la, ftnlen lb)
-#endif
-{
-return(s_cmp(a,b,la,lb) < 0);
-}
diff --git a/contrib/libf2c/libF77/lbitbits.c b/contrib/libf2c/libF77/lbitbits.c
deleted file mode 100644
index 75e9f9c603f9..000000000000
--- a/contrib/libf2c/libF77/lbitbits.c
+++ /dev/null
@@ -1,62 +0,0 @@
-#include "f2c.h"
-
-#ifndef LONGBITS
-#define LONGBITS 32
-#endif
-
- integer
-#ifdef KR_headers
-lbit_bits(a, b, len) integer a, b, len;
-#else
-lbit_bits(integer a, integer b, integer len)
-#endif
-{
- /* Assume 2's complement arithmetic */
-
- unsigned long x, y;
-
- x = (unsigned long) a;
- y = (unsigned long)-1L;
- x >>= b;
- y <<= len;
- return (integer)(x & ~y);
- }
-
- integer
-#ifdef KR_headers
-lbit_cshift(a, b, len) integer a, b, len;
-#else
-lbit_cshift(integer a, integer b, integer len)
-#endif
-{
- unsigned long x, y, z;
-
- x = (unsigned long)a;
- if (len <= 0) {
- if (len == 0)
- return 0;
- goto full_len;
- }
- if (len >= LONGBITS) {
- full_len:
- if (b >= 0) {
- b %= LONGBITS;
- return (integer)(x << b | x >> LONGBITS -b );
- }
- b = -b;
- b %= LONGBITS;
- return (integer)(x << LONGBITS - b | x >> b);
- }
- y = z = (unsigned long)-1;
- y <<= len;
- z &= ~y;
- y &= x;
- x &= z;
- if (b >= 0) {
- b %= len;
- return (integer)(y | z & (x << b | x >> len - b));
- }
- b = -b;
- b %= len;
- return (integer)(y | z & (x >> b | x << len - b));
- }
diff --git a/contrib/libf2c/libF77/lbitshft.c b/contrib/libf2c/libF77/lbitshft.c
deleted file mode 100644
index 81b0fdbeaba1..000000000000
--- a/contrib/libf2c/libF77/lbitshft.c
+++ /dev/null
@@ -1,11 +0,0 @@
-#include "f2c.h"
-
- integer
-#ifdef KR_headers
-lbit_shift(a, b) integer a; integer b;
-#else
-lbit_shift(integer a, integer b)
-#endif
-{
- return b >= 0 ? a << b : (integer)((uinteger)a >> -b);
- }
diff --git a/contrib/libf2c/libF77/main.c b/contrib/libf2c/libF77/main.c
deleted file mode 100644
index 17bf449e4024..000000000000
--- a/contrib/libf2c/libF77/main.c
+++ /dev/null
@@ -1,68 +0,0 @@
-/* STARTUP PROCEDURE FOR UNIX FORTRAN PROGRAMS */
-
-#include <stdio.h>
-#include "signal1.h"
-
-#ifndef KR_headers
-#undef VOID
-#include <stdlib.h>
-#endif
-
-#ifndef VOID
-#define VOID void
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef NO__STDC
-#define ONEXIT onexit
-extern VOID f_exit();
-#else
-#ifndef KR_headers
-extern void f_exit(void);
-#ifndef NO_ONEXIT
-#define ONEXIT atexit
-extern int atexit(void (*)(void));
-#endif
-#else
-#ifndef NO_ONEXIT
-#define ONEXIT onexit
-extern VOID f_exit();
-#endif
-#endif
-#endif
-
-#ifdef KR_headers
-extern VOID f_init();
-extern int MAIN__();
-#else
-extern void f_init(void);
-extern int MAIN__(void);
-#endif
-
-#ifdef __cplusplus
- }
-#endif
-
-#ifdef KR_headers
-main(argc, argv) int argc; char **argv;
-#else
-main(int argc, char **argv)
-#endif
-{
-f_setarg(argc, argv);
-f_setsig();
-f_init();
-#ifndef NO_ONEXIT
-ONEXIT(f_exit);
-#endif
-MAIN__();
-#ifdef NO_ONEXIT
-f_exit();
-#endif
-exit(0); /* exit(0) rather than return(0) to bypass Cray bug */
-return 0; /* For compilers that complain of missing return values; */
- /* others will complain that this is unreachable code. */
-}
diff --git a/contrib/libf2c/libF77/makefile.netlib b/contrib/libf2c/libF77/makefile.netlib
deleted file mode 100644
index 230ca7e9f939..000000000000
--- a/contrib/libf2c/libF77/makefile.netlib
+++ /dev/null
@@ -1,103 +0,0 @@
-.SUFFIXES: .c .o
-CC = cc
-SHELL = /bin/sh
-CFLAGS = -O
-
-# If your system lacks onexit() and you are not using an
-# ANSI C compiler, then you should add -DNO_ONEXIT to CFLAGS,
-# e.g., by changing the above "CFLAGS =" line to
-# CFLAGS = -O -DNO_ONEXIT
-
-# On at least some Sun systems, it is more appropriate to change the
-# "CFLAGS =" line to
-# CFLAGS = -O -Donexit=on_exit
-
-# compile, then strip unnecessary symbols
-.c.o:
- $(CC) -c -DSkip_f2c_Undefs $(CFLAGS) $*.c
- ld -r -x -o $*.xxx $*.o
- mv $*.xxx $*.o
-## Under Solaris (and other systems that do not understand ld -x),
-## omit -x in the ld line above.
-## If your system does not have the ld command, comment out
-## or remove both the ld and mv lines above.
-
-MISC = F77_aloc.o Version.o main.o s_rnge.o abort_.o getarg_.o iargc_.o \
- getenv_.o signal_.o s_stop.o s_paus.o system_.o cabs.o\
- derf_.o derfc_.o erf_.o erfc_.o sig_die.o exit_.o
-POW = pow_ci.o pow_dd.o pow_di.o pow_hh.o pow_ii.o pow_ri.o pow_zi.o pow_zz.o
-CX = c_abs.o c_cos.o c_div.o c_exp.o c_log.o c_sin.o c_sqrt.o
-DCX = z_abs.o z_cos.o z_div.o z_exp.o z_log.o z_sin.o z_sqrt.o
-REAL = r_abs.o r_acos.o r_asin.o r_atan.o r_atn2.o r_cnjg.o r_cos.o\
- r_cosh.o r_dim.o r_exp.o r_imag.o r_int.o\
- r_lg10.o r_log.o r_mod.o r_nint.o r_sign.o\
- r_sin.o r_sinh.o r_sqrt.o r_tan.o r_tanh.o
-DBL = d_abs.o d_acos.o d_asin.o d_atan.o d_atn2.o\
- d_cnjg.o d_cos.o d_cosh.o d_dim.o d_exp.o\
- d_imag.o d_int.o d_lg10.o d_log.o d_mod.o\
- d_nint.o d_prod.o d_sign.o d_sin.o d_sinh.o\
- d_sqrt.o d_tan.o d_tanh.o
-INT = i_abs.o i_dim.o i_dnnt.o i_indx.o i_len.o i_mod.o i_nint.o i_sign.o
-HALF = h_abs.o h_dim.o h_dnnt.o h_indx.o h_len.o h_mod.o h_nint.o h_sign.o
-CMP = l_ge.o l_gt.o l_le.o l_lt.o hl_ge.o hl_gt.o hl_le.o hl_lt.o
-EFL = ef1asc_.o ef1cmc_.o
-CHAR = F77_aloc.o s_cat.o s_cmp.o s_copy.o
-F90BIT = lbitbits.o lbitshft.o
-QINT = pow_qq.o qbitbits.o qbitshft.o
-TIME = dtime_.o etime_.o
-
-all: signal1.h libF77.a
-
-# You may need to adjust signal1.h suitably for your system...
-signal1.h: signal1.h0
- cp signal1.h0 signal1.h
-
-# If you get an error compiling dtime_.c or etime_.c, try adding
-# -DUSE_CLOCK to the CFLAGS assignment above; if that does not work,
-# omit $(TIME) from the dependency list for libF77.a below.
-
-# For INTEGER*8 support (which requires system-dependent adjustments to
-# f2c.h), add $(QINT) to the libf2c.a dependency list below...
-
-libF77.a : $(MISC) $(POW) $(CX) $(DCX) $(REAL) $(DBL) $(INT) \
- $(HALF) $(CMP) $(EFL) $(CHAR) $(F90BIT) $(TIME)
- ar r libF77.a $?
- -ranlib libF77.a
-
-### If your system lacks ranlib, you don't need it; see README.
-
-Version.o: Version.c
- $(CC) -c Version.c
-
-# To compile with C++, first "make f2c.h"
-f2c.h: f2ch.add
- cat /usr/include/f2c.h f2ch.add >f2c.h
-
-install: libF77.a
- mv libF77.a /usr/lib
- ranlib /usr/lib/libF77.a
-
-clean:
- rm -f libF77.a *.o
-
-check:
- xsum F77_aloc.c Notice README Version.c abort_.c c_abs.c c_cos.c \
- c_div.c c_exp.c c_log.c c_sin.c c_sqrt.c cabs.c d_abs.c d_acos.c \
- d_asin.c d_atan.c d_atn2.c d_cnjg.c d_cos.c d_cosh.c d_dim.c \
- d_exp.c d_imag.c d_int.c d_lg10.c d_log.c d_mod.c d_nint.c \
- d_prod.c d_sign.c d_sin.c d_sinh.c d_sqrt.c d_tan.c d_tanh.c \
- derf_.c derfc_.c dtime_.c \
- ef1asc_.c ef1cmc_.c erf_.c erfc_.c etime_.c exit_.c f2ch.add \
- getarg_.c getenv_.c h_abs.c h_dim.c h_dnnt.c h_indx.c h_len.c \
- h_mod.c h_nint.c h_sign.c hl_ge.c hl_gt.c hl_le.c hl_lt.c \
- i_abs.c i_dim.c i_dnnt.c i_indx.c i_len.c i_mod.c i_nint.c \
- i_sign.c iargc_.c l_ge.c l_gt.c l_le.c l_lt.c lbitbits.c lbitshft.c \
- main.c makefile pow_ci.c pow_dd.c pow_di.c pow_hh.c pow_ii.c \
- pow_qq.c pow_ri.c pow_zi.c pow_zz.c qbitbits.c qbitshft.c \
- r_abs.c r_acos.c r_asin.c r_atan.c r_atn2.c \
- r_cnjg.c r_cos.c r_cosh.c r_dim.c r_exp.c r_imag.c r_int.c r_lg10.c \
- r_log.c r_mod.c r_nint.c r_sign.c r_sin.c r_sinh.c r_sqrt.c \
- r_tan.c r_tanh.c s_cat.c s_cmp.c s_copy.c \
- s_paus.c s_rnge.c s_stop.c sig_die.c signal1.h0 signal_.c system_.c \
- z_abs.c z_cos.c z_div.c z_exp.c z_log.c z_sin.c z_sqrt.c >zap
- cmp zap libF77.xsum && rm zap || diff libF77.xsum zap
diff --git a/contrib/libf2c/libF77/pow_ci.c b/contrib/libf2c/libF77/pow_ci.c
deleted file mode 100644
index 37e2ce0f2eb9..000000000000
--- a/contrib/libf2c/libF77/pow_ci.c
+++ /dev/null
@@ -1,20 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-VOID pow_ci(p, a, b) /* p = a**b */
- complex *p, *a; integer *b;
-#else
-extern void pow_zi(doublecomplex*, doublecomplex*, integer*);
-void pow_ci(complex *p, complex *a, integer *b) /* p = a**b */
-#endif
-{
-doublecomplex p1, a1;
-
-a1.r = a->r;
-a1.i = a->i;
-
-pow_zi(&p1, &a1, b);
-
-p->r = p1.r;
-p->i = p1.i;
-}
diff --git a/contrib/libf2c/libF77/pow_dd.c b/contrib/libf2c/libF77/pow_dd.c
deleted file mode 100644
index d0dd0ff27447..000000000000
--- a/contrib/libf2c/libF77/pow_dd.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-double pow();
-double pow_dd(ap, bp) doublereal *ap, *bp;
-#else
-#undef abs
-#include <math.h>
-double pow_dd(doublereal *ap, doublereal *bp)
-#endif
-{
-return(pow(*ap, *bp) );
-}
diff --git a/contrib/libf2c/libF77/pow_di.c b/contrib/libf2c/libF77/pow_di.c
deleted file mode 100644
index affed625a911..000000000000
--- a/contrib/libf2c/libF77/pow_di.c
+++ /dev/null
@@ -1,35 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-double pow_di(ap, bp) doublereal *ap; integer *bp;
-#else
-double pow_di(doublereal *ap, integer *bp)
-#endif
-{
-double pow, x;
-integer n;
-unsigned long u;
-
-pow = 1;
-x = *ap;
-n = *bp;
-
-if(n != 0)
- {
- if(n < 0)
- {
- n = -n;
- x = 1/x;
- }
- for(u = n; ; )
- {
- if(u & 01)
- pow *= x;
- if(u >>= 1)
- x *= x;
- else
- break;
- }
- }
-return(pow);
-}
diff --git a/contrib/libf2c/libF77/pow_hh.c b/contrib/libf2c/libF77/pow_hh.c
deleted file mode 100644
index 24a019734da1..000000000000
--- a/contrib/libf2c/libF77/pow_hh.c
+++ /dev/null
@@ -1,33 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-shortint pow_hh(ap, bp) shortint *ap, *bp;
-#else
-shortint pow_hh(shortint *ap, shortint *bp)
-#endif
-{
- shortint pow, x, n;
- unsigned u;
-
- x = *ap;
- n = *bp;
-
- if (n <= 0) {
- if (n == 0 || x == 1)
- return 1;
- if (x != -1)
- return x == 0 ? 1/x : 0;
- n = -n;
- }
- u = n;
- for(pow = 1; ; )
- {
- if(u & 01)
- pow *= x;
- if(u >>= 1)
- x *= x;
- else
- break;
- }
- return(pow);
- }
diff --git a/contrib/libf2c/libF77/pow_ii.c b/contrib/libf2c/libF77/pow_ii.c
deleted file mode 100644
index 84d1c7e0b5ec..000000000000
--- a/contrib/libf2c/libF77/pow_ii.c
+++ /dev/null
@@ -1,33 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-integer pow_ii(ap, bp) integer *ap, *bp;
-#else
-integer pow_ii(integer *ap, integer *bp)
-#endif
-{
- integer pow, x, n;
- unsigned long u;
-
- x = *ap;
- n = *bp;
-
- if (n <= 0) {
- if (n == 0 || x == 1)
- return 1;
- if (x != -1)
- return x == 0 ? 1/x : 0;
- n = -n;
- }
- u = n;
- for(pow = 1; ; )
- {
- if(u & 01)
- pow *= x;
- if(u >>= 1)
- x *= x;
- else
- break;
- }
- return(pow);
- }
diff --git a/contrib/libf2c/libF77/pow_qq.c b/contrib/libf2c/libF77/pow_qq.c
deleted file mode 100644
index 3bc80e05f7f0..000000000000
--- a/contrib/libf2c/libF77/pow_qq.c
+++ /dev/null
@@ -1,33 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-longint pow_qq(ap, bp) longint *ap, *bp;
-#else
-longint pow_qq(longint *ap, longint *bp)
-#endif
-{
- longint pow, x, n;
- unsigned long long u; /* system-dependent */
-
- x = *ap;
- n = *bp;
-
- if (n <= 0) {
- if (n == 0 || x == 1)
- return 1;
- if (x != -1)
- return x == 0 ? 1/x : 0;
- n = -n;
- }
- u = n;
- for(pow = 1; ; )
- {
- if(u & 01)
- pow *= x;
- if(u >>= 1)
- x *= x;
- else
- break;
- }
- return(pow);
- }
diff --git a/contrib/libf2c/libF77/pow_ri.c b/contrib/libf2c/libF77/pow_ri.c
deleted file mode 100644
index 6e5816bbf109..000000000000
--- a/contrib/libf2c/libF77/pow_ri.c
+++ /dev/null
@@ -1,35 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-double pow_ri(ap, bp) real *ap; integer *bp;
-#else
-double pow_ri(real *ap, integer *bp)
-#endif
-{
-double pow, x;
-integer n;
-unsigned long u;
-
-pow = 1;
-x = *ap;
-n = *bp;
-
-if(n != 0)
- {
- if(n < 0)
- {
- n = -n;
- x = 1/x;
- }
- for(u = n; ; )
- {
- if(u & 01)
- pow *= x;
- if(u >>= 1)
- x *= x;
- else
- break;
- }
- }
-return(pow);
-}
diff --git a/contrib/libf2c/libF77/pow_zi.c b/contrib/libf2c/libF77/pow_zi.c
deleted file mode 100644
index abb3cb2b5302..000000000000
--- a/contrib/libf2c/libF77/pow_zi.c
+++ /dev/null
@@ -1,54 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-VOID pow_zi(p, a, b) /* p = a**b */
- doublecomplex *p, *a; integer *b;
-#else
-extern void z_div(doublecomplex*, doublecomplex*, doublecomplex*);
-void pow_zi(doublecomplex *p, doublecomplex *a, integer *b) /* p = a**b */
-#endif
-{
- integer n;
- unsigned long u;
- double t;
- doublecomplex q, x;
- static doublecomplex one = {1.0, 0.0};
-
- n = *b;
- q.r = 1;
- q.i = 0;
-
- if(n == 0)
- goto done;
- if(n < 0)
- {
- n = -n;
- z_div(&x, &one, a);
- }
- else
- {
- x.r = a->r;
- x.i = a->i;
- }
-
- for(u = n; ; )
- {
- if(u & 01)
- {
- t = q.r * x.r - q.i * x.i;
- q.i = q.r * x.i + q.i * x.r;
- q.r = t;
- }
- if(u >>= 1)
- {
- t = x.r * x.r - x.i * x.i;
- x.i = 2 * x.r * x.i;
- x.r = t;
- }
- else
- break;
- }
- done:
- p->i = q.i;
- p->r = q.r;
- }
diff --git a/contrib/libf2c/libF77/pow_zz.c b/contrib/libf2c/libF77/pow_zz.c
deleted file mode 100644
index 20faf29cfb89..000000000000
--- a/contrib/libf2c/libF77/pow_zz.c
+++ /dev/null
@@ -1,23 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-double log(), exp(), cos(), sin(), atan2(), f__cabs();
-VOID pow_zz(r,a,b) doublecomplex *r, *a, *b;
-#else
-#undef abs
-#include <math.h>
-extern double f__cabs(double,double);
-void pow_zz(doublecomplex *r, doublecomplex *a, doublecomplex *b)
-#endif
-{
-double logr, logi, x, y;
-
-logr = log( f__cabs(a->r, a->i) );
-logi = atan2(a->i, a->r);
-
-x = exp( logr * b->r - logi * b->i );
-y = logr * b->i + logi * b->r;
-
-r->r = x * cos(y);
-r->i = x * sin(y);
-}
diff --git a/contrib/libf2c/libF77/qbitbits.c b/contrib/libf2c/libF77/qbitbits.c
deleted file mode 100644
index ad4ac963ce20..000000000000
--- a/contrib/libf2c/libF77/qbitbits.c
+++ /dev/null
@@ -1,66 +0,0 @@
-#include "f2c.h"
-
-#ifndef LONGBITS
-#define LONGBITS 32
-#endif
-
-#ifndef LONG8BITS
-#define LONG8BITS (2*LONGBITS)
-#endif
-
- integer
-#ifdef KR_headers
-qbit_bits(a, b, len) longint a; integer b, len;
-#else
-qbit_bits(longint a, integer b, integer len)
-#endif
-{
- /* Assume 2's complement arithmetic */
-
- ulongint x, y;
-
- x = (ulongint) a;
- y = (ulongint)-1L;
- x >>= b;
- y <<= len;
- return (longint)(x & y);
- }
-
- longint
-#ifdef KR_headers
-qbit_cshift(a, b, len) longint a; integer b, len;
-#else
-qbit_cshift(longint a, integer b, integer len)
-#endif
-{
- ulongint x, y, z;
-
- x = (ulongint)a;
- if (len <= 0) {
- if (len == 0)
- return 0;
- goto full_len;
- }
- if (len >= LONG8BITS) {
- full_len:
- if (b >= 0) {
- b %= LONG8BITS;
- return (longint)(x << b | x >> LONG8BITS - b );
- }
- b = -b;
- b %= LONG8BITS;
- return (longint)(x << LONG8BITS - b | x >> b);
- }
- y = z = (unsigned long)-1;
- y <<= len;
- z &= ~y;
- y &= x;
- x &= z;
- if (b >= 0) {
- b %= len;
- return (longint)(y | z & (x << b | x >> len - b));
- }
- b = -b;
- b %= len;
- return (longint)(y | z & (x >> b | x << len - b));
- }
diff --git a/contrib/libf2c/libF77/qbitshft.c b/contrib/libf2c/libF77/qbitshft.c
deleted file mode 100644
index 87fffb91ff8e..000000000000
--- a/contrib/libf2c/libF77/qbitshft.c
+++ /dev/null
@@ -1,11 +0,0 @@
-#include "f2c.h"
-
- longint
-#ifdef KR_headers
-qbit_shift(a, b) longint a; integer b;
-#else
-qbit_shift(longint a, integer b)
-#endif
-{
- return b >= 0 ? a << b : (longint)((ulongint)a >> -b);
- }
diff --git a/contrib/libf2c/libF77/r_abs.c b/contrib/libf2c/libF77/r_abs.c
deleted file mode 100644
index 7b222961d16d..000000000000
--- a/contrib/libf2c/libF77/r_abs.c
+++ /dev/null
@@ -1,12 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-double r_abs(x) real *x;
-#else
-double r_abs(real *x)
-#endif
-{
-if(*x >= 0)
- return(*x);
-return(- *x);
-}
diff --git a/contrib/libf2c/libF77/r_acos.c b/contrib/libf2c/libF77/r_acos.c
deleted file mode 100644
index 330f88a30929..000000000000
--- a/contrib/libf2c/libF77/r_acos.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-double acos();
-double r_acos(x) real *x;
-#else
-#undef abs
-#include <math.h>
-double r_acos(real *x)
-#endif
-{
-return( acos(*x) );
-}
diff --git a/contrib/libf2c/libF77/r_asin.c b/contrib/libf2c/libF77/r_asin.c
deleted file mode 100644
index 45ece4b749e3..000000000000
--- a/contrib/libf2c/libF77/r_asin.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-double asin();
-double r_asin(x) real *x;
-#else
-#undef abs
-#include <math.h>
-double r_asin(real *x)
-#endif
-{
-return( asin(*x) );
-}
diff --git a/contrib/libf2c/libF77/r_atan.c b/contrib/libf2c/libF77/r_atan.c
deleted file mode 100644
index 36479c915b05..000000000000
--- a/contrib/libf2c/libF77/r_atan.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-double atan();
-double r_atan(x) real *x;
-#else
-#undef abs
-#include <math.h>
-double r_atan(real *x)
-#endif
-{
-return( atan(*x) );
-}
diff --git a/contrib/libf2c/libF77/r_atn2.c b/contrib/libf2c/libF77/r_atn2.c
deleted file mode 100644
index 9347e1f13a9a..000000000000
--- a/contrib/libf2c/libF77/r_atn2.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-double atan2();
-double r_atn2(x,y) real *x, *y;
-#else
-#undef abs
-#include <math.h>
-double r_atn2(real *x, real *y)
-#endif
-{
-return( atan2(*x,*y) );
-}
diff --git a/contrib/libf2c/libF77/r_cnjg.c b/contrib/libf2c/libF77/r_cnjg.c
deleted file mode 100644
index 756c694ee7a8..000000000000
--- a/contrib/libf2c/libF77/r_cnjg.c
+++ /dev/null
@@ -1,12 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-VOID r_cnjg(r, z) complex *r, *z;
-#else
-VOID r_cnjg(complex *r, complex *z)
-#endif
-{
- real zi = z->i;
- r->r = z->r;
- r->i = -zi;
- }
diff --git a/contrib/libf2c/libF77/r_cos.c b/contrib/libf2c/libF77/r_cos.c
deleted file mode 100644
index 5bda158cee95..000000000000
--- a/contrib/libf2c/libF77/r_cos.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-double cos();
-double r_cos(x) real *x;
-#else
-#undef abs
-#include <math.h>
-double r_cos(real *x)
-#endif
-{
-return( cos(*x) );
-}
diff --git a/contrib/libf2c/libF77/r_cosh.c b/contrib/libf2c/libF77/r_cosh.c
deleted file mode 100644
index 7ae72cc0cef9..000000000000
--- a/contrib/libf2c/libF77/r_cosh.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-double cosh();
-double r_cosh(x) real *x;
-#else
-#undef abs
-#include <math.h>
-double r_cosh(real *x)
-#endif
-{
-return( cosh(*x) );
-}
diff --git a/contrib/libf2c/libF77/r_dim.c b/contrib/libf2c/libF77/r_dim.c
deleted file mode 100644
index baca95cd9e47..000000000000
--- a/contrib/libf2c/libF77/r_dim.c
+++ /dev/null
@@ -1,10 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-double r_dim(a,b) real *a, *b;
-#else
-double r_dim(real *a, real *b)
-#endif
-{
-return( *a > *b ? *a - *b : 0);
-}
diff --git a/contrib/libf2c/libF77/r_exp.c b/contrib/libf2c/libF77/r_exp.c
deleted file mode 100644
index d1dea75563f0..000000000000
--- a/contrib/libf2c/libF77/r_exp.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-double exp();
-double r_exp(x) real *x;
-#else
-#undef abs
-#include <math.h>
-double r_exp(real *x)
-#endif
-{
-return( exp(*x) );
-}
diff --git a/contrib/libf2c/libF77/r_imag.c b/contrib/libf2c/libF77/r_imag.c
deleted file mode 100644
index d51252bbb791..000000000000
--- a/contrib/libf2c/libF77/r_imag.c
+++ /dev/null
@@ -1,10 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-double r_imag(z) complex *z;
-#else
-double r_imag(complex *z)
-#endif
-{
-return(z->i);
-}
diff --git a/contrib/libf2c/libF77/r_int.c b/contrib/libf2c/libF77/r_int.c
deleted file mode 100644
index 8378e775726a..000000000000
--- a/contrib/libf2c/libF77/r_int.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-double floor();
-double r_int(x) real *x;
-#else
-#undef abs
-#include <math.h>
-double r_int(real *x)
-#endif
-{
-return( (*x>0) ? floor(*x) : -floor(- *x) );
-}
diff --git a/contrib/libf2c/libF77/r_lg10.c b/contrib/libf2c/libF77/r_lg10.c
deleted file mode 100644
index 51f842017118..000000000000
--- a/contrib/libf2c/libF77/r_lg10.c
+++ /dev/null
@@ -1,15 +0,0 @@
-#include "f2c.h"
-
-#define log10e 0.43429448190325182765
-
-#ifdef KR_headers
-double log();
-double r_lg10(x) real *x;
-#else
-#undef abs
-#include <math.h>
-double r_lg10(real *x)
-#endif
-{
-return( log10e * log(*x) );
-}
diff --git a/contrib/libf2c/libF77/r_log.c b/contrib/libf2c/libF77/r_log.c
deleted file mode 100644
index 4873fb418e89..000000000000
--- a/contrib/libf2c/libF77/r_log.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-double log();
-double r_log(x) real *x;
-#else
-#undef abs
-#include <math.h>
-double r_log(real *x)
-#endif
-{
-return( log(*x) );
-}
diff --git a/contrib/libf2c/libF77/r_mod.c b/contrib/libf2c/libF77/r_mod.c
deleted file mode 100644
index faea344a7b76..000000000000
--- a/contrib/libf2c/libF77/r_mod.c
+++ /dev/null
@@ -1,40 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-#ifdef IEEE_drem
-double drem();
-#else
-double floor();
-#endif
-double r_mod(x,y) real *x, *y;
-#else
-#ifdef IEEE_drem
-double drem(double, double);
-#else
-#undef abs
-#include <math.h>
-#endif
-double r_mod(real *x, real *y)
-#endif
-{
-#ifdef IEEE_drem
- double xa, ya, z;
- if ((ya = *y) < 0.)
- ya = -ya;
- z = drem(xa = *x, ya);
- if (xa > 0) {
- if (z < 0)
- z += ya;
- }
- else if (z > 0)
- z -= ya;
- return z;
-#else
- double quotient;
- if( (quotient = (double)*x / *y) >= 0)
- quotient = floor(quotient);
- else
- quotient = -floor(-quotient);
- return(*x - (*y) * quotient );
-#endif
-}
diff --git a/contrib/libf2c/libF77/r_nint.c b/contrib/libf2c/libF77/r_nint.c
deleted file mode 100644
index f5382af660af..000000000000
--- a/contrib/libf2c/libF77/r_nint.c
+++ /dev/null
@@ -1,14 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-double floor();
-double r_nint(x) real *x;
-#else
-#undef abs
-#include <math.h>
-double r_nint(real *x)
-#endif
-{
-return( (*x)>=0 ?
- floor(*x + .5) : -floor(.5 - *x) );
-}
diff --git a/contrib/libf2c/libF77/r_sign.c b/contrib/libf2c/libF77/r_sign.c
deleted file mode 100644
index df6d02af00a7..000000000000
--- a/contrib/libf2c/libF77/r_sign.c
+++ /dev/null
@@ -1,12 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-double r_sign(a,b) real *a, *b;
-#else
-double r_sign(real *a, real *b)
-#endif
-{
-double x;
-x = (*a >= 0 ? *a : - *a);
-return( *b >= 0 ? x : -x);
-}
diff --git a/contrib/libf2c/libF77/r_sin.c b/contrib/libf2c/libF77/r_sin.c
deleted file mode 100644
index 095b9510de90..000000000000
--- a/contrib/libf2c/libF77/r_sin.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-double sin();
-double r_sin(x) real *x;
-#else
-#undef abs
-#include <math.h>
-double r_sin(real *x)
-#endif
-{
-return( sin(*x) );
-}
diff --git a/contrib/libf2c/libF77/r_sinh.c b/contrib/libf2c/libF77/r_sinh.c
deleted file mode 100644
index 3bf4bb138be9..000000000000
--- a/contrib/libf2c/libF77/r_sinh.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-double sinh();
-double r_sinh(x) real *x;
-#else
-#undef abs
-#include <math.h>
-double r_sinh(real *x)
-#endif
-{
-return( sinh(*x) );
-}
diff --git a/contrib/libf2c/libF77/r_sqrt.c b/contrib/libf2c/libF77/r_sqrt.c
deleted file mode 100644
index d0203d3d19bd..000000000000
--- a/contrib/libf2c/libF77/r_sqrt.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-double sqrt();
-double r_sqrt(x) real *x;
-#else
-#undef abs
-#include <math.h>
-double r_sqrt(real *x)
-#endif
-{
-return( sqrt(*x) );
-}
diff --git a/contrib/libf2c/libF77/r_tan.c b/contrib/libf2c/libF77/r_tan.c
deleted file mode 100644
index fc0009e4774d..000000000000
--- a/contrib/libf2c/libF77/r_tan.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-double tan();
-double r_tan(x) real *x;
-#else
-#undef abs
-#include <math.h>
-double r_tan(real *x)
-#endif
-{
-return( tan(*x) );
-}
diff --git a/contrib/libf2c/libF77/r_tanh.c b/contrib/libf2c/libF77/r_tanh.c
deleted file mode 100644
index 818c6a8451bf..000000000000
--- a/contrib/libf2c/libF77/r_tanh.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-double tanh();
-double r_tanh(x) real *x;
-#else
-#undef abs
-#include <math.h>
-double r_tanh(real *x)
-#endif
-{
-return( tanh(*x) );
-}
diff --git a/contrib/libf2c/libF77/s_cat.c b/contrib/libf2c/libF77/s_cat.c
deleted file mode 100644
index 77a94f647453..000000000000
--- a/contrib/libf2c/libF77/s_cat.c
+++ /dev/null
@@ -1,75 +0,0 @@
-/* Unless compiled with -DNO_OVERWRITE, this variant of s_cat allows the
- * target of a concatenation to appear on its right-hand side (contrary
- * to the Fortran 77 Standard, but in accordance with Fortran 90).
- */
-
-#include "f2c.h"
-#ifndef NO_OVERWRITE
-#include <stdio.h>
-#undef abs
-#ifdef KR_headers
- extern char *F77_aloc();
- extern void free();
- extern void G77_exit_0 ();
-#else
-#undef min
-#undef max
-#include <stdlib.h>
- extern char *F77_aloc(ftnlen, char*);
-#endif
-#include <string.h>
-#endif /* NO_OVERWRITE */
-
- VOID
-#ifdef KR_headers
-s_cat(lp, rpp, rnp, np, ll) char *lp, *rpp[]; ftnint rnp[], *np; ftnlen ll;
-#else
-s_cat(char *lp, char *rpp[], ftnint rnp[], ftnint *np, ftnlen ll)
-#endif
-{
- ftnlen i, nc;
- char *rp;
- ftnlen n = *np;
-#ifndef NO_OVERWRITE
- ftnlen L, m;
- char *lp0, *lp1;
-
- lp0 = 0;
- lp1 = lp;
- L = ll;
- i = 0;
- while(i < n) {
- rp = rpp[i];
- m = rnp[i++];
- if (rp >= lp1 || rp + m <= lp) {
- if ((L -= m) <= 0) {
- n = i;
- break;
- }
- lp1 += m;
- continue;
- }
- lp0 = lp;
- lp = lp1 = F77_aloc(L = ll, "s_cat");
- break;
- }
- lp1 = lp;
-#endif /* NO_OVERWRITE */
- for(i = 0 ; i < n ; ++i) {
- nc = ll;
- if(rnp[i] < nc)
- nc = rnp[i];
- ll -= nc;
- rp = rpp[i];
- while(--nc >= 0)
- *lp++ = *rp++;
- }
- while(--ll >= 0)
- *lp++ = ' ';
-#ifndef NO_OVERWRITE
- if (lp0) {
- memcpy(lp0, lp1, L);
- free(lp1);
- }
-#endif
- }
diff --git a/contrib/libf2c/libF77/s_cmp.c b/contrib/libf2c/libF77/s_cmp.c
deleted file mode 100644
index 1e052f286426..000000000000
--- a/contrib/libf2c/libF77/s_cmp.c
+++ /dev/null
@@ -1,44 +0,0 @@
-#include "f2c.h"
-
-/* compare two strings */
-
-#ifdef KR_headers
-integer s_cmp(a0, b0, la, lb) char *a0, *b0; ftnlen la, lb;
-#else
-integer s_cmp(char *a0, char *b0, ftnlen la, ftnlen lb)
-#endif
-{
-register unsigned char *a, *aend, *b, *bend;
-a = (unsigned char *)a0;
-b = (unsigned char *)b0;
-aend = a + la;
-bend = b + lb;
-
-if(la <= lb)
- {
- while(a < aend)
- if(*a != *b)
- return( *a - *b );
- else
- { ++a; ++b; }
-
- while(b < bend)
- if(*b != ' ')
- return( ' ' - *b );
- else ++b;
- }
-
-else
- {
- while(b < bend)
- if(*a == *b)
- { ++a; ++b; }
- else
- return( *a - *b );
- while(a < aend)
- if(*a != ' ')
- return(*a - ' ');
- else ++a;
- }
-return(0);
-}
diff --git a/contrib/libf2c/libF77/s_copy.c b/contrib/libf2c/libF77/s_copy.c
deleted file mode 100644
index d1673510c62b..000000000000
--- a/contrib/libf2c/libF77/s_copy.c
+++ /dev/null
@@ -1,51 +0,0 @@
-/* Unless compiled with -DNO_OVERWRITE, this variant of s_copy allows the
- * target of an assignment to appear on its right-hand side (contrary
- * to the Fortran 77 Standard, but in accordance with Fortran 90),
- * as in a(2:5) = a(4:7) .
- */
-
-#include "f2c.h"
-
-/* assign strings: a = b */
-
-#ifdef KR_headers
-VOID s_copy(a, b, la, lb) register char *a, *b; ftnlen la, lb;
-#else
-void s_copy(register char *a, register char *b, ftnlen la, ftnlen lb)
-#endif
-{
- register char *aend, *bend;
-
- aend = a + la;
-
- if(la <= lb)
-#ifndef NO_OVERWRITE
- if (a <= b || a >= b + la)
-#endif
- while(a < aend)
- *a++ = *b++;
-#ifndef NO_OVERWRITE
- else
- for(b += la; a < aend; )
- *--aend = *--b;
-#endif
-
- else {
- bend = b + lb;
-#ifndef NO_OVERWRITE
- if (a <= b || a >= bend)
-#endif
- while(b < bend)
- *a++ = *b++;
-#ifndef NO_OVERWRITE
- else {
- a += lb;
- while(b < bend)
- *--a = *--bend;
- a += lb;
- }
-#endif
- while(a < aend)
- *a++ = ' ';
- }
- }
diff --git a/contrib/libf2c/libF77/s_paus.c b/contrib/libf2c/libF77/s_paus.c
deleted file mode 100644
index a7733a533620..000000000000
--- a/contrib/libf2c/libF77/s_paus.c
+++ /dev/null
@@ -1,88 +0,0 @@
-#include <stdio.h>
-#include "f2c.h"
-#define PAUSESIG 15
-
-#include "signal1.h"
-#ifdef KR_headers
-#define Void /* void */
-#define Int /* int */
-#else
-#define Void void
-#define Int int
-#undef abs
-#undef min
-#undef max
-#include <stdlib.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
-extern int getpid(void), isatty(int), pause(void);
-#endif
-
-extern VOID f_exit(Void);
-
- static VOID
-waitpause(Sigarg)
-{ Use_Sigarg;
- return;
- }
-
- static VOID
-#ifdef KR_headers
-s_1paus(fin) FILE *fin;
-#else
-s_1paus(FILE *fin)
-#endif
-{
- fprintf(stderr,
- "To resume execution, type go. Other input will terminate the job.\n");
- fflush(stderr);
- if( getc(fin)!='g' || getc(fin)!='o' || getc(fin)!='\n' ) {
- fprintf(stderr, "STOP\n");
-#ifdef NO_ONEXIT
- f_exit();
-#endif
- exit(0);
- }
- }
-
- int
-#ifdef KR_headers
-s_paus(s, n) char *s; ftnlen n;
-#else
-s_paus(char *s, ftnlen n)
-#endif
-{
- fprintf(stderr, "PAUSE ");
- if(n > 0)
- fprintf(stderr, " %.*s", (int)n, s);
- fprintf(stderr, " statement executed\n");
- if( isatty(fileno(stdin)) )
- s_1paus(stdin);
- else {
-#if (defined (MSDOS) && !defined (GO32)) || defined (_WIN32)
- FILE *fin;
- fin = fopen("con", "r");
- if (!fin) {
- fprintf(stderr, "s_paus: can't open con!\n");
- fflush(stderr);
- exit(1);
- }
- s_1paus(fin);
- fclose(fin);
-#else
- fprintf(stderr,
- "To resume execution, execute a kill -%d %d command\n",
- PAUSESIG, getpid() );
- signal1(PAUSESIG, waitpause);
- fflush(stderr);
- pause();
-#endif
- }
- fprintf(stderr, "Execution resumes after PAUSE.\n");
- fflush(stderr);
- return 0; /* NOT REACHED */
-#ifdef __cplusplus
- }
-#endif
-}
diff --git a/contrib/libf2c/libF77/s_rnge.c b/contrib/libf2c/libF77/s_rnge.c
deleted file mode 100644
index 766889bbfa59..000000000000
--- a/contrib/libf2c/libF77/s_rnge.c
+++ /dev/null
@@ -1,26 +0,0 @@
-#include <stdio.h>
-#include "f2c.h"
-
-/* called when a subscript is out of range */
-
-#ifdef KR_headers
-extern VOID sig_die();
-integer s_rnge(varn, offset, procn, line) char *varn, *procn; ftnint offset, line;
-#else
-extern VOID sig_die(char*,int);
-integer s_rnge(char *varn, ftnint offset, char *procn, ftnint line)
-#endif
-{
-register int i;
-
-fprintf(stderr, "Subscript out of range on file line %ld, procedure ",
- (long)line);
-while((i = *procn) && i != '_' && i != ' ')
- putc(*procn++, stderr);
-fprintf(stderr, ".\nAttempt to access the %ld-th element of variable ",
- (long)offset+1);
-while((i = *varn) && i != ' ')
- putc(*varn++, stderr);
-sig_die(".", 1);
-return 0; /* not reached */
-}
diff --git a/contrib/libf2c/libF77/s_stop.c b/contrib/libf2c/libF77/s_stop.c
deleted file mode 100644
index 975edb7d4ad0..000000000000
--- a/contrib/libf2c/libF77/s_stop.c
+++ /dev/null
@@ -1,42 +0,0 @@
-#include <stdio.h>
-#include "f2c.h"
-
-#ifdef KR_headers
-extern void f_exit();
-VOID s_stop(s, n) char *s; ftnlen n;
-#else
-#undef abs
-#undef min
-#undef max
-#include <stdlib.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
-void f_exit(void);
-
-int s_stop(char *s, ftnlen n)
-#endif
-{
-int i;
-
-if(n > 0)
- {
- fprintf(stderr, "STOP ");
- for(i = 0; i<n ; ++i)
- putc(*s++, stderr);
- fprintf(stderr, " statement executed\n");
- }
-#ifdef NO_ONEXIT
-f_exit();
-#endif
-exit(0);
-
-/* We cannot avoid (useless) compiler diagnostics here: */
-/* some compilers complain if there is no return statement, */
-/* and others complain that this one cannot be reached. */
-
-return 0; /* NOT REACHED */
-}
-#ifdef __cplusplus
-}
-#endif
diff --git a/contrib/libf2c/libF77/setarg.c b/contrib/libf2c/libF77/setarg.c
deleted file mode 100644
index 929860aeef3a..000000000000
--- a/contrib/libf2c/libF77/setarg.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Set up the global argc/argv info for use by getarg_, iargc_, and
- g77's inlined intrinsic equivalents. */
-
-#ifndef KR_headers
-#undef VOID
-#include <stdlib.h>
-#endif
-
-#ifndef VOID
-#define VOID void
-#endif
-
-int f__xargc;
-char **f__xargv;
-
-#ifdef __cplusplus
- }
-#endif
-
- void
-#ifdef KR_headers
-f_setarg(argc, argv) int argc; char **argv;
-#else
-f_setarg(int argc, char **argv)
-#endif
-{
-f__xargc = argc;
-f__xargv = argv;
-}
diff --git a/contrib/libf2c/libF77/setsig.c b/contrib/libf2c/libF77/setsig.c
deleted file mode 100644
index 8fde2fa27e81..000000000000
--- a/contrib/libf2c/libF77/setsig.c
+++ /dev/null
@@ -1,101 +0,0 @@
-/* Set up the signal behavior. */
-
-#include <stdio.h>
-#include "signal1.h"
-
-#ifndef SIGIOT
-#ifdef SIGABRT
-#define SIGIOT SIGABRT
-#endif
-#endif
-
-#ifndef KR_headers
-#undef VOID
-#include <stdlib.h>
-#endif
-
-#ifndef VOID
-#define VOID void
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef KR_headers
-extern VOID sig_die();
-#define Int /* int */
-#else
-extern void sig_die(char*, int);
-#define Int int
-#endif
-
-static VOID sigfdie(Sigarg)
-{
-Use_Sigarg;
-sig_die("Floating Exception", 1);
-}
-
-
-static VOID sigidie(Sigarg)
-{
-Use_Sigarg;
-sig_die("IOT Trap", 1);
-}
-
-#ifdef SIGQUIT
-static VOID sigqdie(Sigarg)
-{
-Use_Sigarg;
-sig_die("Quit signal", 1);
-}
-#endif
-
-
-static VOID sigindie(Sigarg)
-{
-Use_Sigarg;
-sig_die("Interrupt", 0);
-}
-
-static VOID sigtdie(Sigarg)
-{
-Use_Sigarg;
-sig_die("Killed", 0);
-}
-
-#ifdef SIGTRAP
-static VOID sigtrdie(Sigarg)
-{
-Use_Sigarg;
-sig_die("Trace trap", 1);
-}
-#endif
-
-
-#ifdef __cplusplus
- }
-#endif
-
- void
-f_setsig()
-{
-signal1(SIGFPE, sigfdie); /* ignore underflow, enable overflow */
-#ifdef SIGIOT
-signal1(SIGIOT, sigidie);
-#endif
-#ifdef SIGTRAP
-signal1(SIGTRAP, sigtrdie);
-#endif
-#ifdef SIGQUIT
-if(signal1(SIGQUIT,sigqdie) == SIG_IGN)
- signal1(SIGQUIT, SIG_IGN);
-#endif
-if(signal1(SIGINT, sigindie) == SIG_IGN)
- signal1(SIGINT, SIG_IGN);
-signal1(SIGTERM,sigtdie);
-
-#ifdef pdp11
- ldfps(01200); /* detect overflow as an exception */
-#endif
-}
diff --git a/contrib/libf2c/libF77/sig_die.c b/contrib/libf2c/libF77/sig_die.c
deleted file mode 100644
index bebb1e7b8f78..000000000000
--- a/contrib/libf2c/libF77/sig_die.c
+++ /dev/null
@@ -1,45 +0,0 @@
-#include <stdio.h>
-#include <signal.h>
-
-#ifndef SIGIOT
-#ifdef SIGABRT
-#define SIGIOT SIGABRT
-#endif
-#endif
-
-#ifdef KR_headers
-void sig_die(s, kill) register char *s; int kill;
-#else
-#include <stdlib.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
- extern void f_exit(void);
-
-void sig_die(register char *s, int kill)
-#endif
-{
- /* print error message, then clear buffers */
- fprintf(stderr, "%s\n", s);
-
- if(kill)
- {
- fflush(stderr);
- f_exit();
- fflush(stderr);
- /* now get a core */
-#ifdef SIGIOT
- signal(SIGIOT, SIG_DFL);
-#endif
- abort();
- }
- else {
-#ifdef NO_ONEXIT
- f_exit();
-#endif
- exit(1);
- }
- }
-#ifdef __cplusplus
-}
-#endif
diff --git a/contrib/libf2c/libF77/signal1.h b/contrib/libf2c/libF77/signal1.h
deleted file mode 100644
index b559211e8e4a..000000000000
--- a/contrib/libf2c/libF77/signal1.h
+++ /dev/null
@@ -1,5 +0,0 @@
-/* The g77 implementation of libf2c directly includes signal1.h0,
- instead of copying it to signal1.h, since that seems easier to
- cope with at this point. */
-
-#include "signal1.h0"
diff --git a/contrib/libf2c/libF77/signal1.h0 b/contrib/libf2c/libF77/signal1.h0
deleted file mode 100644
index a383774b82d2..000000000000
--- a/contrib/libf2c/libF77/signal1.h0
+++ /dev/null
@@ -1,35 +0,0 @@
-/* You may need to adjust the definition of signal1 to supply a */
-/* cast to the correct argument type. This detail is system- and */
-/* compiler-dependent. The #define below assumes signal.h declares */
-/* type SIG_PF for the signal function's second argument. */
-
-/* For some C++ compilers, "#define Sigarg_t ..." may be appropriate. */
-
-#include <signal.h>
-
-#ifndef Sigret_t
-#define Sigret_t void
-#endif
-#ifndef Sigarg_t
-#ifdef KR_headers
-#define Sigarg_t
-#else
-#define Sigarg_t int
-#endif
-#endif /*Sigarg_t*/
-
-#ifdef USE_SIG_PF /* compile with -DUSE_SIG_PF under IRIX */
-#define sig_pf SIG_PF
-#else
-typedef Sigret_t (*sig_pf)(Sigarg_t);
-#endif
-
-#define signal1(a,b) signal(a,(sig_pf)b)
-
-#ifdef __cplusplus
-#define Sigarg ...
-#define Use_Sigarg
-#else
-#define Sigarg Int n
-#define Use_Sigarg n = n /* shut up compiler warning */
-#endif
diff --git a/contrib/libf2c/libF77/signal_.c b/contrib/libf2c/libF77/signal_.c
deleted file mode 100644
index b0d7ce6a69bc..000000000000
--- a/contrib/libf2c/libF77/signal_.c
+++ /dev/null
@@ -1,16 +0,0 @@
-#include "f2c.h"
-#include "signal1.h"
-
-#ifdef KR_headers
-void *
-G77_signal_0 (sigp, proc) integer *sigp; sig_pf proc;
-#else
-void *
-G77_signal_0 (integer *sigp, sig_pf proc)
-#endif
-{
- int sig;
- sig = (int)*sigp;
-
- return (void *) signal(sig, proc);
- }
diff --git a/contrib/libf2c/libF77/system_.c b/contrib/libf2c/libF77/system_.c
deleted file mode 100644
index ed024a14ded5..000000000000
--- a/contrib/libf2c/libF77/system_.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/* f77 interface to system routine */
-
-#include "f2c.h"
-
-#ifdef KR_headers
-extern char *F77_aloc();
-
- integer
-G77_system_0 (s, n) register char *s; ftnlen n;
-#else
-#undef abs
-#undef min
-#undef max
-#include <stdlib.h>
-extern char *F77_aloc(ftnlen, char*);
-
- integer
-G77_system_0 (register char *s, ftnlen n)
-#endif
-{
- char buff0[256], *buff;
- register char *bp, *blast;
- integer rv;
-
- buff = bp = n < sizeof(buff0)
- ? buff0 : F77_aloc(n+1, "system_");
- blast = bp + n;
-
- while(bp < blast && *s)
- *bp++ = *s++;
- *bp = 0;
- rv = system(buff);
- if (buff != buff0)
- free(buff);
- return rv;
- }
diff --git a/contrib/libf2c/libF77/z_abs.c b/contrib/libf2c/libF77/z_abs.c
deleted file mode 100644
index 7e67ad2957fb..000000000000
--- a/contrib/libf2c/libF77/z_abs.c
+++ /dev/null
@@ -1,12 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-double f__cabs();
-double z_abs(z) doublecomplex *z;
-#else
-double f__cabs(double, double);
-double z_abs(doublecomplex *z)
-#endif
-{
-return( f__cabs( z->r, z->i ) );
-}
diff --git a/contrib/libf2c/libF77/z_cos.c b/contrib/libf2c/libF77/z_cos.c
deleted file mode 100644
index 2d4a24d28186..000000000000
--- a/contrib/libf2c/libF77/z_cos.c
+++ /dev/null
@@ -1,15 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-double sin(), cos(), sinh(), cosh();
-VOID z_cos(r, z) doublecomplex *r, *z;
-#else
-#undef abs
-#include "math.h"
-void z_cos(doublecomplex *r, doublecomplex *z)
-#endif
-{
- double zi = z->i, zr = z->r;
- r->r = cos(zr) * cosh(zi);
- r->i = - sin(zr) * sinh(zi);
- }
diff --git a/contrib/libf2c/libF77/z_div.c b/contrib/libf2c/libF77/z_div.c
deleted file mode 100644
index e14df32a1f8a..000000000000
--- a/contrib/libf2c/libF77/z_div.c
+++ /dev/null
@@ -1,44 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-extern VOID sig_die();
-VOID z_div(c, a, b) doublecomplex *a, *b, *c;
-#else
-extern void sig_die(char*, int);
-void z_div(doublecomplex *c, doublecomplex *a, doublecomplex *b)
-#endif
-{
- double ratio, den;
- double abr, abi, cr;
-
- if( (abr = b->r) < 0.)
- abr = - abr;
- if( (abi = b->i) < 0.)
- abi = - abi;
- if( abr <= abi )
- {
- if(abi == 0) {
-#ifdef IEEE_COMPLEX_DIVIDE
- if (a->i != 0 || a->r != 0)
- abi = 1.;
- c->i = c->r = abi / abr;
- return;
-#else
- sig_die("complex division by zero", 1);
-#endif
- }
- ratio = b->r / b->i ;
- den = b->i * (1 + ratio*ratio);
- cr = (a->r*ratio + a->i) / den;
- c->i = (a->i*ratio - a->r) / den;
- }
-
- else
- {
- ratio = b->i / b->r ;
- den = b->r * (1 + ratio*ratio);
- cr = (a->r + a->i*ratio) / den;
- c->i = (a->i - a->r*ratio) / den;
- }
- c->r = cr;
- }
diff --git a/contrib/libf2c/libF77/z_exp.c b/contrib/libf2c/libF77/z_exp.c
deleted file mode 100644
index ecf84296d720..000000000000
--- a/contrib/libf2c/libF77/z_exp.c
+++ /dev/null
@@ -1,17 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-double exp(), cos(), sin();
-VOID z_exp(r, z) doublecomplex *r, *z;
-#else
-#undef abs
-#include "math.h"
-void z_exp(doublecomplex *r, doublecomplex *z)
-#endif
-{
- double expx, zi = z->i;
-
- expx = exp(z->r);
- r->r = expx * cos(zi);
- r->i = expx * sin(zi);
- }
diff --git a/contrib/libf2c/libF77/z_log.c b/contrib/libf2c/libF77/z_log.c
deleted file mode 100644
index 9dcc7f73fe5d..000000000000
--- a/contrib/libf2c/libF77/z_log.c
+++ /dev/null
@@ -1,63 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-double log(), f__cabs(), atan2();
-VOID z_log(r, z) doublecomplex *r, *z;
-#else
-#undef abs
-#include "math.h"
-extern double f__cabs(double, double);
-void z_log(doublecomplex *r, doublecomplex *z)
-#endif
-{
- double s, s0, t, t2, u, v;
- double zi = z->i, zr = z->r;
-
- r->i = atan2(zi, zr);
-#ifdef Pre20000310
- r->r = log( f__cabs( zr, zi ) );
-#else
- if (zi < 0)
- zi = -zi;
- if (zr < 0)
- zr = -zr;
- if (zr < zi) {
- t = zi;
- zi = zr;
- zr = t;
- }
- t = zi/zr;
- s = zr * sqrt(1 + t*t);
- /* now s = f__cabs(zi,zr), and zr = |zr| >= |zi| = zi */
- if ((t = s - 1) < 0)
- t = -t;
- if (t > .01)
- r->r = log(s);
- else {
-
-#ifdef Comment
-
- log(1+x) = x - x^2/2 + x^3/3 - x^4/4 + - ...
-
- = x(1 - x/2 + x^2/3 -+...)
-
- [sqrt(y^2 + z^2) - 1] * [sqrt(y^2 + z^2) + 1] = y^2 + z^2 - 1, so
-
- sqrt(y^2 + z^2) - 1 = (y^2 + z^2 - 1) / [sqrt(y^2 + z^2) + 1]
-
-#endif /*Comment*/
-
- t = ((zr*zr - 1.) + zi*zi) / (s + 1);
- t2 = t*t;
- s = 1. - 0.5*t;
- u = v = 1;
- do {
- s0 = s;
- u *= t2;
- v += 2;
- s += u/v - t*u/(v+1);
- } while(s > s0);
- r->r = s*t;
- }
-#endif
- }
diff --git a/contrib/libf2c/libF77/z_sin.c b/contrib/libf2c/libF77/z_sin.c
deleted file mode 100644
index e24caff927e9..000000000000
--- a/contrib/libf2c/libF77/z_sin.c
+++ /dev/null
@@ -1,15 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-double sin(), cos(), sinh(), cosh();
-VOID z_sin(r, z) doublecomplex *r, *z;
-#else
-#undef abs
-#include "math.h"
-void z_sin(doublecomplex *r, doublecomplex *z)
-#endif
-{
- double zi = z->i, zr = z->r;
- r->r = sin(zr) * cosh(zi);
- r->i = cos(zr) * sinh(zi);
- }
diff --git a/contrib/libf2c/libF77/z_sqrt.c b/contrib/libf2c/libF77/z_sqrt.c
deleted file mode 100644
index c04e8f0a1a72..000000000000
--- a/contrib/libf2c/libF77/z_sqrt.c
+++ /dev/null
@@ -1,29 +0,0 @@
-#include "f2c.h"
-
-#ifdef KR_headers
-double sqrt(), f__cabs();
-VOID z_sqrt(r, z) doublecomplex *r, *z;
-#else
-#undef abs
-#include "math.h"
-extern double f__cabs(double, double);
-void z_sqrt(doublecomplex *r, doublecomplex *z)
-#endif
-{
- double mag, zi = z->i, zr = z->r;
-
- if( (mag = f__cabs(zr, zi)) == 0.)
- r->r = r->i = 0.;
- else if(zr > 0)
- {
- r->r = sqrt(0.5 * (mag + zr) );
- r->i = zi / r->r / 2;
- }
- else
- {
- r->i = sqrt(0.5 * (mag - zr) );
- if(zi < 0)
- r->i = - r->i;
- r->r = zi / r->i / 2;
- }
- }
diff --git a/contrib/libf2c/libI77/Makefile.in b/contrib/libf2c/libI77/Makefile.in
deleted file mode 100644
index 544f24ef4d50..000000000000
--- a/contrib/libf2c/libI77/Makefile.in
+++ /dev/null
@@ -1,172 +0,0 @@
-# Makefile for GNU F77 compiler runtime.
-# Copyright 1990 - 1994 by AT&T Bell Laboratories and Bellcore (see the
-# file `Notice').
-# Portions of this file Copyright (C) 1995, 1996, 1998, 2001 Free Software Foundation, Inc.
-# Contributed by Dave Love (d.love@dl.ac.uk).
-#
-#This file is part of GNU Fortran.
-#
-#GNU Fortran 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.
-#
-#GNU Fortran is distributed in the hope that it will be useful,
-#but WITHOUT ANY WARRANTY; without even the implied warranty of
-#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-#GNU General Public License for more details.
-#
-#You should have received a copy of the GNU General Public License
-#along with GNU Fortran; see the file COPYING. If not, write to
-#the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-#02111-1307, USA.
-
-#### Start of system configuration section. ####
-
-# $(srcdir) must be set to the g77 runtime libI77 source directory.
-srcdir = @srcdir@
-VPATH = @srcdir@
-
-# configure sets this to all the -D options appropriate for the
-# configuration.
-DEFS = @DEFS@
-
-LIBG2C = ../libg2c.a
-
-F2C_H_DIR = @srcdir@/..
-G2C_H_DIR = ..
-CC = @CC@
-CFLAGS = @CFLAGS@
-CPPFLAGS = @CPPFLAGS@
-AR = @AR@
-ARFLAGS = rc
-@SET_MAKE@
-
-SHELL = /bin/sh
-
-#### End of system configuration section. ####
-
-ALL_CFLAGS = -I. -I$(srcdir) -I$(G2C_H_DIR) -I$(F2C_H_DIR) $(CPPFLAGS) \
- $(DEFS) $(CFLAGS)
-
-.SUFFIXES:
-.SUFFIXES: .c .o
-
-.c.o:
- $(CC) -c -DSkip_f2c_Undefs -DAllow_TYQUAD $(ALL_CFLAGS) $<
-
-OBJ = VersionI.o backspace.o close.o dfe.o dolio.o due.o endfile.o err.o \
- fmt.o fmtlib.o iio.o ilnw.o inquire.o lread.o lwrite.o open.o \
- rdfmt.o rewind.o rsfe.o rsli.o rsne.o sfe.o sue.o typesize.o uio.o \
- util.o wref.o wrtfmt.o wsfe.o wsle.o wsne.o xwsne.o \
- ftell_.o
-
-all: ../s-libi77
-
-../s-libi77: $(OBJ)
- echo timestamp > ../s-libi77
-
-archive:
- $(AR) $(ARFLAGS) $(LIBG2C) $(OBJ)
-
-Makefile: Makefile.in config.status
- $(SHELL) config.status
-
-config.status: configure
- rm -f config.cache
- CONFIG_SITE=no-such-file CC='$(CC)' AR='$(AR)' CFLAGS='$(CFLAGS)' \
- CPPFLAGS='$(CPPFLAGS)' $(SHELL) config.status --recheck
-
-${srcdir}/configure: configure.in
- rm -f config.cache
- cd ${srcdir} && autoconf
-
-# autoheader might not change config.h.in, so touch a stamp file.
-${srcdir}/config.h.in: stamp-h.in; @true
-${srcdir}/stamp-h.in: configure.in
- (cd ${srcdir} && autoheader)
- @rm -f ${srcdir}/stamp-h.in
- echo timestamp > ${srcdir}/stamp-h.in
-
-config.h: stamp-h; @true
-stamp-h: config.h.in config.status
- CONFIG_FILES= CONFIG_HEADERS=config.h $(SHELL) config.status
- echo timestamp > stamp-h
-
-VersionI.o: Version.c
- $(CC) -c $(ALL_CFLAGS) -o $@ $(srcdir)/Version.c
-
-backspace.o: backspace.c fio.h
-close.o: close.c fio.h
-dfe.o: fio.h
-dfe.o: dfe.c fmt.h
-dolio.o: dolio.c
-due.o: due.c fio.h
-endfile.o: endfile.c fio.h rawio.h config.h
-err.o: err.c fio.h rawio.h
-fmt.o: fio.h
-fmt.o: fmt.c fmt.h
-fmtlib.o: fmtlib.c
-ftell_.o: ftell_.c fio.h
-iio.o: fio.h
-iio.o: iio.c fmt.h
-ilnw.o: fio.h
-ilnw.o: ilnw.c lio.h
-inquire.o: inquire.c fio.h
-lread.o: fio.h
-lread.o: fmt.h
-lread.o: lio.h
-lread.o: lread.c fp.h
-lwrite.o: fio.h
-lwrite.o: fmt.h
-lwrite.o: lwrite.c lio.h
-open.o: open.c fio.h rawio.h
-rdfmt.o: fio.h
-rdfmt.o: fmt.h
-rdfmt.o: rdfmt.c fp.h
-rewind.o: rewind.c fio.h
-rsfe.o: fio.h
-rsfe.o: rsfe.c fmt.h
-rsli.o: fio.h
-rsli.o: rsli.c lio.h
-rsne.o: fio.h
-rsne.o: rsne.c lio.h
-sfe.o: sfe.c fio.h
-sue.o: sue.c fio.h
-typesize.o: typesize.c
-uio.o: uio.c fio.h
-util.o: util.c fio.h
-wref.o: fio.h
-wref.o: fmt.h
-wref.o: wref.c fp.h
-wrtfmt.o: fio.h
-wrtfmt.o: wrtfmt.c fmt.h
-wsfe.o: fio.h
-wsfe.o: wsfe.c fmt.h
-wsle.o: fio.h
-wsle.o: fmt.h
-wsle.o: wsle.c lio.h
-wsne.o: fio.h
-wsne.o: wsne.c lio.h
-xwsne.o: fio.h
-xwsne.o: lio.h
-xwsne.o: xwsne.c fmt.h
-
-# May be pessimistic:
-$(OBJ): $(F2C_H_DIR)/f2c.h $(G2C_H_DIR)/g2c.h
-
-check install uninstall install-strip dist installcheck installdirs:
-
-mostlyclean:
- rm -f *.o
-
-clean: mostlyclean
- rm -f config.log ../s-libi77
-
-distclean: clean
- rm -f config.cache config.status Makefile ../s-libi77 configure
-
-maintainer-clean:
-
-.PHONY: mostlyclean clean distclean maintainer-clean all check uninstall \
- install-strip dist installcheck installdirs archive
diff --git a/contrib/libf2c/libI77/Notice b/contrib/libf2c/libI77/Notice
deleted file mode 100644
index 261b719bc57e..000000000000
--- a/contrib/libf2c/libI77/Notice
+++ /dev/null
@@ -1,23 +0,0 @@
-/****************************************************************
-Copyright 1990 - 1997 by AT&T, Lucent Technologies and Bellcore.
-
-Permission to use, copy, modify, and distribute this software
-and its documentation for any purpose and without fee is hereby
-granted, provided that the above copyright notice appear in all
-copies and that both that the copyright notice and this
-permission notice and warranty disclaimer appear in supporting
-documentation, and that the names of AT&T, Bell Laboratories,
-Lucent or Bellcore or any of their entities not be used in
-advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-AT&T, Lucent and Bellcore disclaim all warranties with regard to
-this software, including all implied warranties of
-merchantability and fitness. In no event shall AT&T, Lucent or
-Bellcore be liable for any special, indirect or consequential
-damages or any damages whatsoever resulting from loss of use,
-data or profits, whether in an action of contract, negligence or
-other tortious action, arising out of or in connection with the
-use or performance of this software.
-****************************************************************/
-
diff --git a/contrib/libf2c/libI77/README.netlib b/contrib/libf2c/libI77/README.netlib
deleted file mode 100644
index 30dd5b5223dc..000000000000
--- a/contrib/libf2c/libI77/README.netlib
+++ /dev/null
@@ -1,225 +0,0 @@
-If your compiler does not recognize ANSI C headers,
-compile with KR_headers defined: either add -DKR_headers
-to the definition of CFLAGS in the makefile, or insert
-
-#define KR_headers
-
-at the top of f2c.h and fmtlib.c .
-
-
-If you have a really ancient K&R C compiler that does not understand
-void, add -Dvoid=int to the definition of CFLAGS in the makefile.
-
-If you use a C++ compiler, first create a local f2c.h by appending
-f2ch.add to the usual f2c.h, e.g., by issuing the command
- make f2c.h
-which assumes f2c.h is installed in /usr/include .
-
-If your system lacks /usr/include/fcntl.h , then you
-should simply create an empty fcntl.h in this directory.
-If your compiler then complains about creat and open not
-having a prototype, compile with OPEN_DECL defined.
-On many systems, open and creat are declared in fcntl.h .
-
-If your system has /usr/include/fcntl.h, you may need to add
--D_POSIX_SOURCE to the makefile's definition of CFLAGS.
-
-If your system's sprintf does not work the way ANSI C
-specifies -- specifically, if it does not return the
-number of characters transmitted -- then insert the line
-
-#define USE_STRLEN
-
-at the end of fmt.h . This is necessary with
-at least some versions of Sun and DEC software.
-In particular, if you get a warning about an improper
-pointer/integer combination in compiling wref.c, then
-you need to compile with -DUSE_STRLEN .
-
-If your system's fopen does not like the ANSI binary
-reading and writing modes "rb" and "wb", then you should
-compile open.c with NON_ANSI_RW_MODES #defined.
-
-If you get error messages about references to cf->_ptr
-and cf->_base when compiling wrtfmt.c and wsfe.c or to
-stderr->_flag when compiling err.c, then insert the line
-
-#define NON_UNIX_STDIO
-
-at the beginning of fio.h, and recompile everything (or
-at least those modules that contain NON_UNIX_STDIO).
-
-Unformatted sequential records consist of a length of record
-contents, the record contents themselves, and the length of
-record contents again (for backspace). Prior to 17 Oct. 1991,
-the length was of type int; now it is of type long, but you
-can change it back to int by inserting
-
-#define UIOLEN_int
-
-at the beginning of fio.h. This affects only sue.c and uio.c .
-
-On VAX, Cray, or Research Tenth-Edition Unix systems, you may
-need to add -DVAX, -DCRAY, or -DV10 (respectively) to CFLAGS
-to make fp.h work correctly. Alternatively, you may need to
-edit fp.h to suit your machine.
-
-You may need to supply the following non-ANSI routines:
-
- fstat(int fileds, struct stat *buf) is similar
-to stat(char *name, struct stat *buf), except that
-the first argument, fileds, is the file descriptor
-returned by open rather than the name of the file.
-fstat is used in the system-dependent routine
-canseek (in the libI77 source file err.c), which
-is supposed to return 1 if it's possible to issue
-seeks on the file in question, 0 if it's not; you may
-need to suitably modify err.c . On non-UNIX systems,
-you can avoid references to fstat and stat by compiling
-with NON_UNIX_STDIO defined; in that case, you may need
-to supply access(char *Name,0), which is supposed to
-return 0 if file Name exists, nonzero otherwise.
-
- char * mktemp(char *buf) is supposed to replace the
-6 trailing X's in buf with a unique number and then
-return buf. The idea is to get a unique name for
-a temporary file.
-
-On non-UNIX systems, you may need to change a few other,
-e.g.: the form of name computed by mktemp() in endfile.c and
-open.c; the use of the open(), close(), and creat() system
-calls in endfile.c, err.c, open.c; and the modes in calls on
-fopen() and fdopen() (and perhaps the use of fdopen() itself
--- it's supposed to return a FILE* corresponding to a given
-an integer file descriptor) in err.c and open.c (component ufmt
-of struct unit is 1 for formatted I/O -- text mode on some systems
--- and 0 for unformatted I/O -- binary mode on some systems).
-Compiling with -DNON_UNIX_STDIO omits all references to creat()
-and almost all references to open() and close(), the exception
-being in the function f__isdev() (in open.c).
-
-For MS-DOS, compile all of libI77 with -DMSDOS (which implies
--DNON_UNIX_STDIO). You may need to make other compiler-dependent
-adjustments; for example, for Turbo C++ you need to adjust the mktemp
-invocations and to #undef ungetc in lread.c and rsne.c .
-
-If you want to be able to load against libI77 but not libF77,
-then you will need to add sig_die.o (from libF77) to libI77.
-
-If you wish to use translated Fortran that has funny notions
-of record length for direct unformatted I/O (i.e., that assumes
-RECL= values in OPEN statements are not bytes but rather counts
-of some other units -- e.g., 4-character words for VMS), then you
-should insert an appropriate #define for url_Adjust at the
-beginning of open.c . For VMS Fortran, for example,
-#define url_Adjust(x) x *= 4
-would suffice.
-
-To check for transmission errors, issue the command
- make check
-This assumes you have the xsum program whose source, xsum.c,
-is distributed as part of "all from f2c/src". If you do not
-have xsum, you can obtain xsum.c by sending the following E-mail
-message to netlib@netlib.bell-labs.com
- send xsum.c from f2c/src
-
-The makefile assumes you have installed f2c.h in a standard
-place (and does not cause recompilation when f2c.h is changed);
-f2c.h comes with "all from f2c" (the source for f2c) and is
-available separately ("f2c.h from f2c").
-
-By default, Fortran I/O units 5, 6, and 0 are pre-connected to
-stdin, stdout, and stderr, respectively. You can change this
-behavior by changing f_init() in err.c to suit your needs.
-Note that f2c assumes READ(*... means READ(5... and WRITE(*...
-means WRITE(6... . Moreover, an OPEN(n,... statement that does
-not specify a file name (and does not specify STATUS='SCRATCH')
-assumes FILE='fort.n' . You can change this by editing open.c
-and endfile.c suitably.
-
-Unless you adjust the "#define MXUNIT" line in fio.h, Fortran units
-0, 1, ..., 99 are available, i.e., the highest allowed unit number
-is MXUNIT - 1.
-
-Lines protected from compilation by #ifdef Allow_TYQUAD
-are for a possible extension to 64-bit integers in which
-integer = int = 32 bits and longint = long = 64 bits.
-
-Extensions (Feb. 1993) to NAMELIST processing:
- 1. Reading a ? instead of &name (the start of a namelist) causes
-the namelist being sought to be written to stdout (unit 6);
-to omit this feature, compile rsne.c with -DNo_Namelist_Questions.
- 2. Reading the wrong namelist name now leads to an error message
-and an attempt to skip input until the right namelist name is found;
-to omit this feature, compile rsne.c with -DNo_Bad_Namelist_Skip.
- 3. Namelist writes now insert newlines before each variable; to omit
-this feature, compile xwsne.c with -DNo_Extra_Namelist_Newlines.
- 4. (Sept. 1995) When looking for the &name that starts namelist
-input, lines whose first non-blank character is something other
-than &, $, or ? are treated as comment lines and ignored, unless
-rsne.c is compiled with -DNo_Namelist_Comments.
-
-Nonstandard extension (Feb. 1993) to open: for sequential files,
-ACCESS='APPEND' (or access='anything else starting with "A" or "a"')
-causes the file to be positioned at end-of-file, so a write will
-append to the file.
-
-Some buggy Fortran programs use unformatted direct I/O to write
-an incomplete record and later read more from that record than
-they have written. For records other than the last, the unwritten
-portion of the record reads as binary zeros. The last record is
-a special case: attempting to read more from it than was written
-gives end-of-file -- which may help one find a bug. Some other
-Fortran I/O libraries treat the last record no differently than
-others and thus give no help in finding the bug of reading more
-than was written. If you wish to have this behavior, compile
-uio.c with -DPad_UDread .
-
-If you want to be able to catch write failures (e.g., due to a
-disk being full) with an ERR= specifier, compile dfe.c, due.c,
-sfe.c, sue.c, and wsle.c with -DALWAYS_FLUSH. This will lead to
-slower execution and more I/O, but should make ERR= work as
-expected, provided fflush returns an error return when its
-physical write fails.
-
-Carriage controls are meant to be interpreted by the UNIX col
-program (or a similar program). Sometimes it's convenient to use
-only ' ' as the carriage control character (normal single spacing).
-If you compile lwrite.c and wsfe.c with -DOMIT_BLANK_CC, formatted
-external output lines will have an initial ' ' quietly omitted,
-making use of the col program unnecessary with output that only
-has ' ' for carriage control.
-
-The Fortran 77 Standard leaves it up to the implementation whether
-formatted writes of floating-point numbers of absolute value < 1 have
-a zero before the decimal point. By default, libI77 omits such
-superfluous zeros, but you can cause them to appear by compiling
-lwrite.c, wref.c, and wrtfmt.c with -DWANT_LEAD_0 .
-
-If your system lacks a ranlib command, you don't need it.
-Either comment out the makefile's ranlib invocation, or install
-a harmless "ranlib" command somewhere in your PATH, such as the
-one-line shell script
-
- exit 0
-
-or (on some systems)
-
- exec /usr/bin/ar lts $1 >/dev/null
-
-Most of the routines in libI77 are support routines for Fortran
-I/O. There are a few exceptions, summarized below -- I/O related
-functions and subroutines that appear to your program as ordinary
-external Fortran routines.
-
-1. CALL FLUSH flushes all buffers.
-
-2. FTELL(i) is an INTEGER function that returns the current
- offset of Fortran unit i (or -1 if unit i is not open).
-
-3. CALL FSEEK(i, offset, whence, *errlab) attemps to move
- Fortran unit i to the specified offset: absolute offset
- if whence = 0; relative to the current offset if whence = 1;
- relative to the end of the file if whence = 2. It branches
- to label errlab if unit i is not open or if the call
- otherwise fails.
diff --git a/contrib/libf2c/libI77/Version.c b/contrib/libf2c/libI77/Version.c
deleted file mode 100644
index 0ff447fecc8e..000000000000
--- a/contrib/libf2c/libI77/Version.c
+++ /dev/null
@@ -1,340 +0,0 @@
-static char junk[] = "\n@(#) LIBI77 VERSION pjw,dmg-mods 20001205\n";
-
-/*
-*/
-
-char __G77_LIBI77_VERSION__[] = "0.5.26 20011023 (release)";
-
-/*
-2.01 $ format added
-2.02 Coding bug in open.c repaired
-2.03 fixed bugs in lread.c (read * with negative f-format) and lio.c
- and lio.h (e-format conforming to spec)
-2.04 changed open.c and err.c (fopen and freopen respectively) to
- update to new c-library (append mode)
-2.05 added namelist capability
-2.06 allow internal list and namelist I/O
-*/
-
-/*
-close.c:
- allow upper-case STATUS= values
-endfile.c
- create fort.nnn if unit nnn not open;
- else if (file length == 0) use creat() rather than copy;
- use local copy() rather than forking /bin/cp;
- rewind, fseek to clear buffer (for no reading past EOF)
-err.c
- use neither setbuf nor setvbuf; make stderr buffered
-fio.h
- #define _bufend
-inquire.c
- upper case responses;
- omit byfile test from SEQUENTIAL=
- answer "YES" to DIRECT= for unopened file (open to debate)
-lio.c
- flush stderr, stdout at end of each stmt
- space before character strings in list output only at line start
-lio.h
- adjust LEW, LED consistent with old libI77
-lread.c
- use atof()
- allow "nnn*," when reading complex constants
-open.c
- try opening for writing when open for read fails, with
- special uwrt value (2) delaying creat() to first write;
- set curunit so error messages don't drop core;
- no file name ==> fort.nnn except for STATUS='SCRATCH'
-rdfmt.c
- use atof(); trust EOF == end-of-file (so don't read past
- end-of-file after endfile stmt)
-sfe.c
- flush stderr, stdout at end of each stmt
-wrtfmt.c:
- use upper case
- put wrt_E and wrt_F into wref.c, use sprintf()
- rather than ecvt() and fcvt() [more accurate on VAX]
-*/
-
-/* 16 Oct. 1988: uwrt = 3 after write, rewind, so close won't zap the file. */
-
-/* 10 July 1989: change _bufend to buf_end in fio.h, wsfe.c, wrtfmt.c */
-
-/* 28 Nov. 1989: corrections for IEEE and Cray arithmetic */
-/* 29 Nov. 1989: change various int return types to long for f2c */
-/* 30 Nov. 1989: various types from f2c.h */
-/* 6 Dec. 1989: types corrected various places */
-/* 19 Dec. 1989: make iostat= work right for internal I/O */
-/* 8 Jan. 1990: add rsne, wsne -- routines for handling NAMELIST */
-/* 28 Jan. 1990: have NAMELIST read treat $ as &, general white
- space as blank */
-/* 27 Mar. 1990: change an = to == in rd_L(rdfmt.c) so formatted reads
- of logical values reject letters other than fFtT;
- have nowwriting reset cf */
-/* 14 Aug. 1990: adjust lread.c to treat tabs as spaces in list input */
-/* 17 Aug. 1990: adjust open.c to recognize blank='Z...' as well as
- blank='z...' when reopening an open file */
-/* 30 Aug. 1990: prevent embedded blanks in list output of complex values;
- omit exponent field in list output of values of
- magnitude between 10 and 1e8; prevent writing stdin
- and reading stdout or stderr; don't close stdin, stdout,
- or stderr when reopening units 5, 6, 0. */
-/* 18 Sep. 1990: add component udev to unit and consider old == new file
- iff uinode and udev values agree; use stat rather than
- access to check existence of file (when STATUS='OLD')*/
-/* 2 Oct. 1990: adjust rewind.c so two successive rewinds after a write
- don't clobber the file. */
-/* 9 Oct. 1990: add #include "fcntl.h" to endfile.c, err.c, open.c;
- adjust g_char in util.c for segmented memories. */
-/* 17 Oct. 1990: replace abort() and _cleanup() with calls on
- sig_die(...,1) (defined in main.c). */
-/* 5 Nov. 1990: changes to open.c: complain if new= is specified and the
- file already exists; allow file= to be omitted in open stmts
- and allow status='replace' (Fortran 90 extensions). */
-/* 11 Dec. 1990: adjustments for POSIX. */
-/* 15 Jan. 1991: tweak i_ungetc in rsli.c to allow reading from
- strings in read-only memory. */
-/* 25 Apr. 1991: adjust namelist stuff to work with f2c -i2 */
-/* 26 Apr. 1991: fix some bugs with NAMELIST read of multi-dim. arrays */
-/* 16 May 1991: increase LEFBL in lio.h to bypass NeXT bug */
-/* 17 Oct. 1991: change type of length field in sequential unformatted
- records from int to long (for systems where sizeof(int)
- can vary, depending on the compiler or compiler options). */
-/* 14 Nov. 1991: change uint to Uint in fmt.h, rdfmt.c, wrtfmt.c. */
-/* 25 Nov. 1991: change uint to Uint in lwrite.c; change sizeof(int) to
- sizeof(uioint) in fseeks in sue.c (missed on 17 Oct.). */
-/* 1 Dec. 1991: uio.c: add test for read failure (seq. unformatted reads);
- adjust an error return from EOF to off end of record */
-/* 12 Dec. 1991: rsli.c: fix bug with internal list input that caused
- the last character of each record to be ignored.
- iio.c: adjust error message in internal formatted
- input from "end-of-file" to "off end of record" if
- the format specifies more characters than the
- record contains. */
-/* 17 Jan. 1992: lread.c, rsne.c: in list and namelist input,
- treat "r* ," and "r*," alike (where r is a
- positive integer constant), and fix a bug in
- handling null values following items with repeat
- counts (e.g., 2*1,,3); for namelist reading
- of a numeric array, allow a new name-value subsequence
- to terminate the current one (as though the current
- one ended with the right number of null values).
- lio.h, lwrite.c: omit insignificant zeros in
- list and namelist output. To get the old
- behavior, compile with -DOld_list_output . */
-/* 18 Jan. 1992: make list output consistent with F format by
- printing .1 rather than 0.1 (introduced yesterday). */
-/* 3 Feb. 1992: rsne.c: fix namelist read bug that caused the
- character following a comma to be ignored. */
-/* 19 May 1992: adjust iio.c, ilnw.c, rdfmt.c and rsli.c to make err=
- work with internal list and formatted I/O. */
-/* 18 July 1992: adjust rsne.c to allow namelist input to stop at
- an & (e.g. &end). */
-/* 23 July 1992: switch to ANSI prototypes unless KR_headers is #defined ;
- recognize Z format (assuming 8-bit bytes). */
-/* 14 Aug. 1992: tweak wrt_E in wref.c to avoid -NaN */
-/* 23 Oct. 1992: Supply missing l_eof = 0 assignment to s_rsne() in rsne.c
- (so end-of-file on other files won't confuse namelist
- reads of external files). Prepend f__ to external
- names that are only of internal interest to lib[FI]77. */
-/* 1 Feb. 1993: backspace.c: fix bug that bit when last char of 2nd
- buffer == '\n'.
- endfile.c: guard against tiny L_tmpnam; close and reopen
- files in t_runc().
- lio.h: lengthen LINTW (buffer size in lwrite.c).
- err.c, open.c: more prepending of f__ (to [rw]_mode). */
-/* 5 Feb. 1993: tweaks to NAMELIST: rsne.c: ? prints the namelist being
- sought; namelists of the wrong name are skipped (after
- an error message; xwsne.c: namelist writes have a
- newline before each new variable.
- open.c: ACCESS='APPEND' positions sequential files
- at EOF (nonstandard extension -- that doesn't require
- changing data structures). */
-/* 9 Feb. 1993: Change some #ifdef MSDOS lines to #ifdef NON_UNIX_STDIO.
- err.c: under NON_UNIX_STDIO, avoid close(creat(name,0666))
- when the unit has another file descriptor for name. */
-/* 4 March 1993: err.c, open.c: take declaration of fdopen from rawio.h;
- open.c: always give f__w_mode[] 4 elements for use
- in t_runc (in endfile.c -- for change of 1 Feb. 1993). */
-/* 6 March 1993: uio.c: adjust off-end-of-record test for sequential
- unformatted reads to respond to err= rather than end=. */
-/* 12 March 1993: various tweaks for C++ */
-/* 6 April 1993: adjust error returns for formatted inputs to flush
- the current input line when err=label is specified.
- To restore the old behavior (input left mid-line),
- either adjust the #definition of errfl in fio.h or
- omit the invocation of f__doend in err__fl (in err.c). */
-/* 23 June 1993: iio.c: fix bug in format reversions for internal writes. */
-/* 5 Aug. 1993: lread.c: fix bug in handling repetition counts for
- logical data (during list or namelist input).
- Change struct f__syl to struct syl (for buggy compilers). */
-/* 7 Aug. 1993: lread.c: fix bug in namelist reading of incomplete
- logical arrays. */
-/* 9 Aug. 1993: lread.c: fix bug in namelist reading of an incomplete
- array of numeric data followed by another namelist
- item whose name starts with 'd', 'D', 'e', or 'E'. */
-/* 8 Sept. 1993: open.c: protect #include "sys/..." with
- #ifndef NON_UNIX_STDIO; Version date not changed. */
-/* 10 Nov. 1993: backspace.c: add nonsense for #ifdef MSDOS */
-/* 8 Dec. 1993: iio.c: adjust internal formatted reads to treat
- short records as though padded with blanks
- (rather than causing an "off end of record" error). */
-/* 22 Feb. 1994: lread.c: check that realloc did not return NULL. */
-/* 6 June 1994: Under NON_UNIX_STDIO, use binary mode for direct
- formatted files (avoiding any confusion regarding \n). */
-/* 5 July 1994: Fix bug (introduced 6 June 1994?) in reopening files
- under NON_UNIX_STDIO. */
-/* 6 July 1994: wref.c: protect with #ifdef GOOD_SPRINTF_EXPONENT an
- optimization that requires exponents to have 2 digits
- when 2 digits suffice.
- lwrite.c wsfe.c (list and formatted external output):
- omit ' ' carriage-control when compiled with
- -DOMIT_BLANK_CC . Off-by-one bug fixed in character
- count for list output of character strings.
- Omit '.' in list-directed printing of Nan, Infinity. */
-/* 12 July 1994: wrtfmt.c: under G11.4, write 0. as " .0000 " rather
- than " .0000E+00". */
-/* 3 Aug. 1994: lwrite.c: do not insert a newline when appending an
- oversize item to an empty line. */
-/* 12 Aug. 1994: rsli.c rsne.c: fix glitch (reset nml_read) that kept
- ERR= (in list- or format-directed input) from working
- after a NAMELIST READ. */
-/* 7 Sept. 1994: typesize.c: adjust to allow types LOGICAL*1, LOGICAL*2,
- INTEGER*1, and (under -DAllow_TYQUAD) INTEGER*8
- in NAMELISTs. */
-/* 6 Oct. 1994: util.c: omit f__mvgbt, as it is never used. */
-/* 2 Nov. 1994: add #ifdef ALWAYS_FLUSH logic. */
-/* 26 Jan. 1995: wref.c: fix glitch in printing the exponent of 0 when
- GOOD_SPRINTF_EXPONENT is not #defined. */
-/* 24 Feb. 1995: iio.c: z_getc: insert (unsigned char *) to allow
- internal reading of characters with high-bit set
- (on machines that sign-extend characters). */
-/* 14 March 1995:lread.c and rsfe.c: adjust s_rsle and s_rsfe to
- check for end-of-file (to prevent infinite loops
- with empty read statements). */
-/* 26 May 1995: iio.c: z_wnew: fix bug in handling T format items
- in internal writes whose last item is written to
- an earlier position than some previous item. */
-/* 29 Aug. 1995: backspace.c: adjust MSDOS logic. */
-/* 6 Sept. 1995: Adjust namelist input to treat a subscripted name
- whose subscripts do not involve colons similarly
- to the name without a subscript: accept several
- values, stored in successive elements starting at
- the indicated subscript. Adjust namelist output
- to quote character strings (avoiding confusion with
- arrays of character strings). Adjust f_init calls
- for people who don't use libF77's main(); now open and
- namelist read statements invoke f_init if needed. */
-/* 7 Sept. 1995: Fix some bugs with -DAllow_TYQUAD (for integer*8).
- Add -DNo_Namelist_Comments lines to rsne.c. */
-/* 5 Oct. 1995: wrtfmt.c: fix bug with t editing (f__cursor was not
- always zeroed in mv_cur). */
-/* 11 Oct. 1995: move defs of f__hiwater, f__svic, f__icptr from wrtfmt.c
- to err.c */
-/* 15 Mar. 1996: lread.c, rsfe.c: honor END= in READ stmt with empty iolist */
-
-/* 13 May 1996: add ftell_.c and fseek_.c */
-/* 9 June 1996: Adjust rsli.c and lread.c so internal list input with
- too few items in the input string will honor end= . */
-/* 12 Sept. 1995:fmtlib.c: fix glitch in printing the most negative integer. */
-/* 25 Sept. 1995:fmt.h: for formatted writes of negative integer*1 values,
- make ic signed on ANSI systems. If formatted writes of
- integer*1 values trouble you when using a K&R C compiler,
- switch to an ANSI compiler or use a compiler flag that
- makes characters signed. */
-/* 9 Dec. 1996: d[fu]e.c, err.c: complain about non-positive rec=
- in direct read and write statements.
- ftell_.c: change param "unit" to "Unit" for -DKR_headers. */
-/* 26 Feb. 1997: ftell_.c: on systems that define SEEK_SET, etc., use
- SEEK_SET, SEEK_CUR, SEEK_END for *whence = 0, 1, 2. */
-/* 7 Apr. 1997: fmt.c: adjust to complain at missing numbers in formats
- (but still treat missing ".nnn" as ".0"). */
-/* 11 Apr. 1997: err.c: attempt to make stderr line buffered rather
- than fully buffered. (Buffering is needed for format
- items T and TR.) */
-/* 27 May 1997: ftell_.c: fix typo (that caused the third argument to be
- treated as 2 on some systems). */
-/* 5 Aug. 1997: lread.c: adjust to accord with a change to the Fortran 8X
- draft (in 1990 or 1991) that rescinded permission to elide
- quote marks in namelist input of character data; compile
- with -DF8X_NML_ELIDE_QUOTES to get the old behavior.
- wrtfmt.o: wrt_G: tweak to print the right number of 0's
- for zero under G format. */
-/* 16 Aug. 1997: iio.c: fix bug in internal writes to an array of character
- strings that sometimes caused one more array element than
- required by the format to be blank-filled. Example:
- format(1x). */
-/* 16 Sept. 1997:fmt.[ch] rdfmt.c wrtfmt.c: tweak struct syl for machines
- with 64-bit pointers and 32-bit ints that did not 64-bit
- align struct syl (e.g., Linux on the DEC Alpha). */
-/* 19 Jan. 1998: backspace.c: for b->ufmt==0, change sizeof(int) to
- sizeof(uiolen). On machines where this would make a
- difference, it is best for portability to compile libI77 with
- -DUIOLEN_int (which will render the change invisible). */
-/* 4 March 1998: open.c: fix glitch in comparing file names under
- -DNON_UNIX_STDIO */
-/* 17 March 1998: endfile.c, open.c: acquire temporary files from tmpfile(),
- unless compiled with -DNON_ANSI_STDIO, which uses mktemp().
- New buffering scheme independent of NON_UNIX_STDIO for
- handling T format items. Now -DNON_UNIX_STDIO is no
- longer be necessary for Linux, and libf2c no longer
- causes stderr to be buffered -- the former setbuf or
- setvbuf call for stderr was to make T format items work.
- open.c: use the Posix access() function to check existence
- or nonexistence of files, except under -DNON_POSIX_STDIO,
- where trial fopen calls are used. */
-/* 5 April 1998: wsfe.c: make $ format item work: this was lost in the
- changes of 17 March 1998. */
-/* 28 May 1998: backspace.c dfe.c due.c iio.c lread.c rsfe.c sue.c wsfe.c:
- set f__curunit sooner so various error messages will
- correctly identify the I/O unit involved. */
-/* 17 June 1998: lread.c: unless compiled with
- ALLOW_FLOAT_IN_INTEGER_LIST_INPUT #defined, treat
- floating-point numbers (containing either a decimal point
- or an exponent field) as errors when they appear as list
- input for integer data. */
-/* 7 Sept. 1998: move e_wdfe from sfe.c to dfe.c, where it was originally.
- Why did it ever move to sfe.c? */
-/* 2 May 1999: open.c: set f__external (to get "external" versus "internal"
- right in the error message if we cannot open the file).
- err.c: cast a pointer difference to (int) for %d.
- rdfmt.c: omit fixed-length buffer that could be overwritten
- by formats Inn or Lnn with nn > 83. */
-/* 3 May 1999: open.c: insert two casts for machines with 64-bit longs. */
-/* 18 June 1999: backspace.c: allow for b->ufd changing in t_runc */
-/* 27 June 1999: rsne.c: fix bug in namelist input: a misplaced increment */
-/* could cause wrong array elements to be assigned; e.g., */
-/* "&input k(5)=10*1 &end" assigned k(5) and k(15..23) */
-/* 15 Nov. 1999: endfile.c: set state to writing (b->uwrt = 1) when an */
-/* endfile statement requires copying the file. */
-/* (Otherwise an immediately following rewind statement */
-/* could make the file appear empty.) Also, supply a */
-/* missing (long) cast in the sprintf call. */
-/* sfe.c: add #ifdef ALWAYS_FLUSH logic, for formatted I/O: */
-/* Compiling libf2c with -DALWAYS_FLUSH should prevent losing */
-/* any data in buffers should the program fault. It also */
-/* makes the program run more slowly. */
-/* 20 April 2000: rsne.c, xwsne.c: tweaks that only matter if ftnint and */
-/* ftnlen are of different fundamental types (different numbers */
-/* of bits). Since these files will not compile when this */
-/* change matters, the above VERSION string remains unchanged. */
-/* 4 July 2000: adjustments to permit compilation by C++ compilers; */
-/* VERSION string remains unchanged. NOT APPLIED FOR G77 */
-/* 5 Dec. 2000: lread.c: under namelist input, when reading a logical array, */
-/* treat Tstuff= and Fstuff= as new assignments rather than as */
-/* logical constants. */
-
-
-
-/* Changes for GNU Fortran (g77) version of libf2c: */
-
-/* 17 June 1997: detect recursive I/O and call f__fatal explaining it. */
-
-#include <stdio.h>
-
-void
-g77__ivers__ ()
-{
- fprintf (stderr, "__G77_LIBI77_VERSION__: %s", __G77_LIBI77_VERSION__);
- fputs (junk, stderr);
-}
diff --git a/contrib/libf2c/libI77/backspace.c b/contrib/libf2c/libI77/backspace.c
deleted file mode 100644
index b2bd4163222a..000000000000
--- a/contrib/libf2c/libI77/backspace.c
+++ /dev/null
@@ -1,74 +0,0 @@
-#include "config.h"
-#include <sys/types.h>
-#include "f2c.h"
-#include "fio.h"
-#ifdef KR_headers
-integer f_back(a) alist *a;
-#else
-integer f_back(alist *a)
-#endif
-{ unit *b;
- long v, w, x, y, z;
- uiolen n;
- FILE *f;
-
- f__curunit = b = &f__units[a->aunit]; /* curunit for error messages */
- if (f__init & 2)
- f__fatal (131, "I/O recursion");
- if(a->aunit >= MXUNIT || a->aunit < 0)
- err(a->aerr,101,"backspace");
- if(b->useek==0) err(a->aerr,106,"backspace");
- if(b->ufd == NULL) {
- fk_open(1, 1, a->aunit);
- return(0);
- }
- if(b->uend==1)
- { b->uend=0;
- return(0);
- }
- if(b->uwrt) {
- t_runc(a);
- if (f__nowreading(b))
- err(a->aerr,errno,"backspace");
- }
- f = b->ufd; /* may have changed in t_runc() */
- if(b->url>0)
- {
- x=ftell(f);
- y = x % b->url;
- if(y == 0) x--;
- x /= b->url;
- x *= b->url;
- (void) fseek(f,x,SEEK_SET);
- return(0);
- }
-
- if(b->ufmt==0)
- { fseek(f,-(long)sizeof(uiolen),SEEK_CUR);
- fread((char *)&n,sizeof(uiolen),1,f);
- fseek(f,-(long)n-2*sizeof(uiolen),SEEK_CUR);
- return(0);
- }
- w = x = ftell(f);
- z = 0;
- loop:
- while(x) {
- x -= x < 64 ? x : 64;
- fseek(f,x,SEEK_SET);
- for(y = x; y < w; y++) {
- if (getc(f) != '\n')
- continue;
- v = ftell(f);
- if (v == w) {
- if (z)
- goto break2;
- goto loop;
- }
- z = v;
- }
- err(a->aerr,(EOF),"backspace");
- }
- break2:
- fseek(f, z, SEEK_SET);
- return 0;
-}
diff --git a/contrib/libf2c/libI77/close.c b/contrib/libf2c/libI77/close.c
deleted file mode 100644
index 79a349369ed3..000000000000
--- a/contrib/libf2c/libI77/close.c
+++ /dev/null
@@ -1,106 +0,0 @@
-#include "config.h"
-#include "f2c.h"
-#include "fio.h"
-#ifdef KR_headers
-integer f_clos(a) cllist *a;
-#else
-#undef abs
-#undef min
-#undef max
-#include <stdlib.h>
-#ifdef NON_UNIX_STDIO
-#ifndef unlink
-#define unlink remove
-#endif
-#else
-#if defined (MSDOS) && !defined (GO32)
-#include "io.h"
-#else
-#ifdef __cplusplus
-extern "C" int unlink(const char*);
-#else
-extern int unlink(const char*);
-#endif
-#endif
-#endif
-
-integer f_clos(cllist *a)
-#endif
-{ unit *b;
-
- if (f__init & 2)
- f__fatal (131, "I/O recursion");
- if(a->cunit >= MXUNIT) return(0);
- b= &f__units[a->cunit];
- if(b->ufd==NULL)
- goto done;
- if (b->uscrtch == 1)
- goto Delete;
- if (!a->csta)
- goto Keep;
- switch(*a->csta) {
- default:
- Keep:
- case 'k':
- case 'K':
- if(b->uwrt == 1)
- t_runc((alist *)a);
- if(b->ufnm) {
- fclose(b->ufd);
- free(b->ufnm);
- }
- break;
- case 'd':
- case 'D':
- Delete:
- fclose(b->ufd);
- if(b->ufnm) {
- unlink(b->ufnm); /*SYSDEP*/
- free(b->ufnm);
- }
- }
- b->ufd=NULL;
- done:
- b->uend=0;
- b->ufnm=NULL;
- return(0);
- }
- void
-#ifdef KR_headers
-f_exit()
-#else
-f_exit(void)
-#endif
-{ int i;
- static cllist xx;
- if (! (f__init & 1))
- return; /* Not initialized, so no open units. */
- /* I/O no longer in progress. If, during an I/O operation (such
- as waiting for the user to enter a line), there is an
- interrupt (such as ^C to stop the program on a UNIX system),
- f_exit() is called, but there is no longer any I/O in
- progress. Without turning off this flag, f_clos() would
- think that there is an I/O recursion in this circumstance. */
- f__init &= ~2;
- if (!xx.cerr) {
- xx.cerr=1;
- xx.csta=NULL;
- for(i=0;i<MXUNIT;i++)
- {
- xx.cunit=i;
- (void) f_clos(&xx);
- }
- }
-}
- int
-#ifdef KR_headers
-G77_flush_0 ()
-#else
-G77_flush_0 (void)
-#endif
-{ int i;
- for(i=0;i<MXUNIT;i++)
- if(f__units[i].ufd != NULL && f__units[i].uwrt)
- fflush(f__units[i].ufd);
-return 0;
-}
diff --git a/contrib/libf2c/libI77/config.h.in b/contrib/libf2c/libI77/config.h.in
deleted file mode 100644
index 58f83af092fd..000000000000
--- a/contrib/libf2c/libI77/config.h.in
+++ /dev/null
@@ -1,47 +0,0 @@
-/* config.h.in. Generated automatically from configure.in by autoheader. */
-
-/* Define to empty if the keyword does not work. */
-#undef const
-
-/* Define to `long' if <sys/types.h> doesn't define. */
-#undef off_t
-
-/* Define if you need to in order for stat and other things to work. */
-#undef _POSIX_SOURCE
-
-/* Define to `unsigned' if <sys/types.h> doesn't define. */
-#undef size_t
-
-/* Define if you have the ANSI C header files. */
-#undef STDC_HEADERS
-
-/* Define if you have the ftruncate function. */
-#undef HAVE_FTRUNCATE
-
-/* Define if you have the mkstemp function. */
-#undef HAVE_MKSTEMP
-
-/* Define if you have the tempnam function. */
-#undef HAVE_TEMPNAM
-
-/* Define if fcntl.h is missing. */
-#undef NO_FCNTL
-
-/* Define if fcntl.h is missing. */
-#undef OPEN_DECL
-
-/* Define if we do not have Unix Stdio. */
-#undef NON_UNIX_STDIO
-
-/* Define if we use strlen. */
-#undef USE_STRLEN
-
-/* Define if we have non ANSI RW modes. */
-#undef NON_ANSI_RW_MODES
-
-/* Always defined. */
-#undef NO_EOF_CHAR_CHECK
-
-/* Define to skip f2c undefs. */
-#undef Skip_f2c_Undefs
-
diff --git a/contrib/libf2c/libI77/configure b/contrib/libf2c/libI77/configure
deleted file mode 100755
index ec7988e86b4c..000000000000
--- a/contrib/libf2c/libI77/configure
+++ /dev/null
@@ -1,1950 +0,0 @@
-#! /bin/sh
-
-# Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 2.13
-# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
-#
-# This configure script is free software; the Free Software Foundation
-# gives unlimited permission to copy, distribute and modify it.
-
-# Defaults:
-ac_help=
-ac_default_prefix=/usr/local
-# Any additions from configure.in:
-
-# Initialize some variables set by options.
-# The variables have the same names as the options, with
-# dashes changed to underlines.
-build=NONE
-cache_file=./config.cache
-exec_prefix=NONE
-host=NONE
-no_create=
-nonopt=NONE
-no_recursion=
-prefix=NONE
-program_prefix=NONE
-program_suffix=NONE
-program_transform_name=s,x,x,
-silent=
-site=
-srcdir=
-target=NONE
-verbose=
-x_includes=NONE
-x_libraries=NONE
-bindir='${exec_prefix}/bin'
-sbindir='${exec_prefix}/sbin'
-libexecdir='${exec_prefix}/libexec'
-datadir='${prefix}/share'
-sysconfdir='${prefix}/etc'
-sharedstatedir='${prefix}/com'
-localstatedir='${prefix}/var'
-libdir='${exec_prefix}/lib'
-includedir='${prefix}/include'
-oldincludedir='/usr/include'
-infodir='${prefix}/info'
-mandir='${prefix}/man'
-
-# Initialize some other variables.
-subdirs=
-MFLAGS= MAKEFLAGS=
-SHELL=${CONFIG_SHELL-/bin/sh}
-# Maximum number of lines to put in a shell here document.
-ac_max_here_lines=12
-
-ac_prev=
-for ac_option
-do
-
- # If the previous option needs an argument, assign it.
- if test -n "$ac_prev"; then
- eval "$ac_prev=\$ac_option"
- ac_prev=
- continue
- fi
-
- case "$ac_option" in
- -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
- *) ac_optarg= ;;
- esac
-
- # Accept the important Cygnus configure options, so we can diagnose typos.
-
- case "$ac_option" in
-
- -bindir | --bindir | --bindi | --bind | --bin | --bi)
- ac_prev=bindir ;;
- -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
- bindir="$ac_optarg" ;;
-
- -build | --build | --buil | --bui | --bu)
- ac_prev=build ;;
- -build=* | --build=* | --buil=* | --bui=* | --bu=*)
- build="$ac_optarg" ;;
-
- -cache-file | --cache-file | --cache-fil | --cache-fi \
- | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
- ac_prev=cache_file ;;
- -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
- | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
- cache_file="$ac_optarg" ;;
-
- -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
- ac_prev=datadir ;;
- -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
- | --da=*)
- datadir="$ac_optarg" ;;
-
- -disable-* | --disable-*)
- ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
- # Reject names that are not valid shell variable names.
- if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
- { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
- fi
- ac_feature=`echo $ac_feature| sed 's/-/_/g'`
- eval "enable_${ac_feature}=no" ;;
-
- -enable-* | --enable-*)
- ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
- # Reject names that are not valid shell variable names.
- if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
- { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
- fi
- ac_feature=`echo $ac_feature| sed 's/-/_/g'`
- case "$ac_option" in
- *=*) ;;
- *) ac_optarg=yes ;;
- esac
- eval "enable_${ac_feature}='$ac_optarg'" ;;
-
- -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
- | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
- | --exec | --exe | --ex)
- ac_prev=exec_prefix ;;
- -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
- | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
- | --exec=* | --exe=* | --ex=*)
- exec_prefix="$ac_optarg" ;;
-
- -gas | --gas | --ga | --g)
- # Obsolete; use --with-gas.
- with_gas=yes ;;
-
- -help | --help | --hel | --he)
- # Omit some internal or obsolete options to make the list less imposing.
- # This message is too long to be a string in the A/UX 3.1 sh.
- cat << EOF
-Usage: configure [options] [host]
-Options: [defaults in brackets after descriptions]
-Configuration:
- --cache-file=FILE cache test results in FILE
- --help print this message
- --no-create do not create output files
- --quiet, --silent do not print \`checking...' messages
- --version print the version of autoconf that created configure
-Directory and file names:
- --prefix=PREFIX install architecture-independent files in PREFIX
- [$ac_default_prefix]
- --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
- [same as prefix]
- --bindir=DIR user executables in DIR [EPREFIX/bin]
- --sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
- --libexecdir=DIR program executables in DIR [EPREFIX/libexec]
- --datadir=DIR read-only architecture-independent data in DIR
- [PREFIX/share]
- --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
- --sharedstatedir=DIR modifiable architecture-independent data in DIR
- [PREFIX/com]
- --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
- --libdir=DIR object code libraries in DIR [EPREFIX/lib]
- --includedir=DIR C header files in DIR [PREFIX/include]
- --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
- --infodir=DIR info documentation in DIR [PREFIX/info]
- --mandir=DIR man documentation in DIR [PREFIX/man]
- --srcdir=DIR find the sources in DIR [configure dir or ..]
- --program-prefix=PREFIX prepend PREFIX to installed program names
- --program-suffix=SUFFIX append SUFFIX to installed program names
- --program-transform-name=PROGRAM
- run sed PROGRAM on installed program names
-EOF
- cat << EOF
-Host type:
- --build=BUILD configure for building on BUILD [BUILD=HOST]
- --host=HOST configure for HOST [guessed]
- --target=TARGET configure for TARGET [TARGET=HOST]
-Features and packages:
- --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
- --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
- --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
- --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
- --x-includes=DIR X include files are in DIR
- --x-libraries=DIR X library files are in DIR
-EOF
- if test -n "$ac_help"; then
- echo "--enable and --with options recognized:$ac_help"
- fi
- exit 0 ;;
-
- -host | --host | --hos | --ho)
- ac_prev=host ;;
- -host=* | --host=* | --hos=* | --ho=*)
- host="$ac_optarg" ;;
-
- -includedir | --includedir | --includedi | --included | --include \
- | --includ | --inclu | --incl | --inc)
- ac_prev=includedir ;;
- -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
- | --includ=* | --inclu=* | --incl=* | --inc=*)
- includedir="$ac_optarg" ;;
-
- -infodir | --infodir | --infodi | --infod | --info | --inf)
- ac_prev=infodir ;;
- -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
- infodir="$ac_optarg" ;;
-
- -libdir | --libdir | --libdi | --libd)
- ac_prev=libdir ;;
- -libdir=* | --libdir=* | --libdi=* | --libd=*)
- libdir="$ac_optarg" ;;
-
- -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
- | --libexe | --libex | --libe)
- ac_prev=libexecdir ;;
- -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
- | --libexe=* | --libex=* | --libe=*)
- libexecdir="$ac_optarg" ;;
-
- -localstatedir | --localstatedir | --localstatedi | --localstated \
- | --localstate | --localstat | --localsta | --localst \
- | --locals | --local | --loca | --loc | --lo)
- ac_prev=localstatedir ;;
- -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
- | --localstate=* | --localstat=* | --localsta=* | --localst=* \
- | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
- localstatedir="$ac_optarg" ;;
-
- -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
- ac_prev=mandir ;;
- -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
- mandir="$ac_optarg" ;;
-
- -nfp | --nfp | --nf)
- # Obsolete; use --without-fp.
- with_fp=no ;;
-
- -no-create | --no-create | --no-creat | --no-crea | --no-cre \
- | --no-cr | --no-c)
- no_create=yes ;;
-
- -no-recursion | --no-recursion | --no-recursio | --no-recursi \
- | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
- no_recursion=yes ;;
-
- -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
- | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
- | --oldin | --oldi | --old | --ol | --o)
- ac_prev=oldincludedir ;;
- -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
- | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
- | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
- oldincludedir="$ac_optarg" ;;
-
- -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
- ac_prev=prefix ;;
- -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
- prefix="$ac_optarg" ;;
-
- -program-prefix | --program-prefix | --program-prefi | --program-pref \
- | --program-pre | --program-pr | --program-p)
- ac_prev=program_prefix ;;
- -program-prefix=* | --program-prefix=* | --program-prefi=* \
- | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
- program_prefix="$ac_optarg" ;;
-
- -program-suffix | --program-suffix | --program-suffi | --program-suff \
- | --program-suf | --program-su | --program-s)
- ac_prev=program_suffix ;;
- -program-suffix=* | --program-suffix=* | --program-suffi=* \
- | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
- program_suffix="$ac_optarg" ;;
-
- -program-transform-name | --program-transform-name \
- | --program-transform-nam | --program-transform-na \
- | --program-transform-n | --program-transform- \
- | --program-transform | --program-transfor \
- | --program-transfo | --program-transf \
- | --program-trans | --program-tran \
- | --progr-tra | --program-tr | --program-t)
- ac_prev=program_transform_name ;;
- -program-transform-name=* | --program-transform-name=* \
- | --program-transform-nam=* | --program-transform-na=* \
- | --program-transform-n=* | --program-transform-=* \
- | --program-transform=* | --program-transfor=* \
- | --program-transfo=* | --program-transf=* \
- | --program-trans=* | --program-tran=* \
- | --progr-tra=* | --program-tr=* | --program-t=*)
- program_transform_name="$ac_optarg" ;;
-
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil)
- silent=yes ;;
-
- -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
- ac_prev=sbindir ;;
- -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
- | --sbi=* | --sb=*)
- sbindir="$ac_optarg" ;;
-
- -sharedstatedir | --sharedstatedir | --sharedstatedi \
- | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
- | --sharedst | --shareds | --shared | --share | --shar \
- | --sha | --sh)
- ac_prev=sharedstatedir ;;
- -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
- | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
- | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
- | --sha=* | --sh=*)
- sharedstatedir="$ac_optarg" ;;
-
- -site | --site | --sit)
- ac_prev=site ;;
- -site=* | --site=* | --sit=*)
- site="$ac_optarg" ;;
-
- -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
- ac_prev=srcdir ;;
- -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
- srcdir="$ac_optarg" ;;
-
- -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
- | --syscon | --sysco | --sysc | --sys | --sy)
- ac_prev=sysconfdir ;;
- -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
- | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
- sysconfdir="$ac_optarg" ;;
-
- -target | --target | --targe | --targ | --tar | --ta | --t)
- ac_prev=target ;;
- -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
- target="$ac_optarg" ;;
-
- -v | -verbose | --verbose | --verbos | --verbo | --verb)
- verbose=yes ;;
-
- -version | --version | --versio | --versi | --vers)
- echo "configure generated by autoconf version 2.13"
- exit 0 ;;
-
- -with-* | --with-*)
- ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
- # Reject names that are not valid shell variable names.
- if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
- { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
- fi
- ac_package=`echo $ac_package| sed 's/-/_/g'`
- case "$ac_option" in
- *=*) ;;
- *) ac_optarg=yes ;;
- esac
- eval "with_${ac_package}='$ac_optarg'" ;;
-
- -without-* | --without-*)
- ac_package=`echo $ac_option|sed -e 's/-*without-//'`
- # Reject names that are not valid shell variable names.
- if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
- { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
- fi
- ac_package=`echo $ac_package| sed 's/-/_/g'`
- eval "with_${ac_package}=no" ;;
-
- --x)
- # Obsolete; use --with-x.
- with_x=yes ;;
-
- -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
- | --x-incl | --x-inc | --x-in | --x-i)
- ac_prev=x_includes ;;
- -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
- | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
- x_includes="$ac_optarg" ;;
-
- -x-libraries | --x-libraries | --x-librarie | --x-librari \
- | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
- ac_prev=x_libraries ;;
- -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
- | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
- x_libraries="$ac_optarg" ;;
-
- -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
- ;;
-
- *)
- if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
- echo "configure: warning: $ac_option: invalid host type" 1>&2
- fi
- if test "x$nonopt" != xNONE; then
- { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
- fi
- nonopt="$ac_option"
- ;;
-
- esac
-done
-
-if test -n "$ac_prev"; then
- { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
-fi
-
-trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
-
-# File descriptor usage:
-# 0 standard input
-# 1 file creation
-# 2 errors and warnings
-# 3 some systems may open it to /dev/tty
-# 4 used on the Kubota Titan
-# 6 checking for... messages and results
-# 5 compiler messages saved in config.log
-if test "$silent" = yes; then
- exec 6>/dev/null
-else
- exec 6>&1
-fi
-exec 5>./config.log
-
-echo "\
-This file contains any messages produced by compilers while
-running configure, to aid debugging if configure makes a mistake.
-" 1>&5
-
-# Strip out --no-create and --no-recursion so they do not pile up.
-# Also quote any args containing shell metacharacters.
-ac_configure_args=
-for ac_arg
-do
- case "$ac_arg" in
- -no-create | --no-create | --no-creat | --no-crea | --no-cre \
- | --no-cr | --no-c) ;;
- -no-recursion | --no-recursion | --no-recursio | --no-recursi \
- | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
- *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
- ac_configure_args="$ac_configure_args '$ac_arg'" ;;
- *) ac_configure_args="$ac_configure_args $ac_arg" ;;
- esac
-done
-
-# NLS nuisances.
-# Only set these to C if already set. These must not be set unconditionally
-# because not all systems understand e.g. LANG=C (notably SCO).
-# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
-# Non-C LC_CTYPE values break the ctype check.
-if test "${LANG+set}" = set; then LANG=C; export LANG; fi
-if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
-if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
-if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
-
-# confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -rf conftest* confdefs.h
-# AIX cpp loses on an empty file, so make sure it contains at least a newline.
-echo > confdefs.h
-
-# A filename unique to this package, relative to the directory that
-# configure is in, which we can look for to find out if srcdir is correct.
-ac_unique_file=ftell_.c
-
-# Find the source files, if location was not specified.
-if test -z "$srcdir"; then
- ac_srcdir_defaulted=yes
- # Try the directory containing this script, then its parent.
- ac_prog=$0
- ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
- test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
- srcdir=$ac_confdir
- if test ! -r $srcdir/$ac_unique_file; then
- srcdir=..
- fi
-else
- ac_srcdir_defaulted=no
-fi
-if test ! -r $srcdir/$ac_unique_file; then
- if test "$ac_srcdir_defaulted" = yes; then
- { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
- else
- { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
- fi
-fi
-srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
-
-# Prefer explicitly selected file to automatically selected ones.
-if test -z "$CONFIG_SITE"; then
- if test "x$prefix" != xNONE; then
- CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
- else
- CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
- fi
-fi
-for ac_site_file in $CONFIG_SITE; do
- if test -r "$ac_site_file"; then
- echo "loading site script $ac_site_file"
- . "$ac_site_file"
- fi
-done
-
-if test -r "$cache_file"; then
- echo "loading cache $cache_file"
- . $cache_file
-else
- echo "creating cache $cache_file"
- > $cache_file
-fi
-
-ac_ext=c
-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
-
-ac_exeext=
-ac_objext=o
-if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
- # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
- if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
- ac_n= ac_c='
-' ac_t=' '
- else
- ac_n=-n ac_c= ac_t=
- fi
-else
- ac_n= ac_c='\c' ac_t=
-fi
-
-
-
-
-
-
-
-# For g77 we'll set CC to point at the built gcc, but this will get it into
-# the makefiles
-# Extract the first word of "gcc", so it can be a program name with args.
-set dummy gcc; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:535: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_prog_CC="gcc"
- break
- fi
- done
- IFS="$ac_save_ifs"
-fi
-fi
-CC="$ac_cv_prog_CC"
-if test -n "$CC"; then
- echo "$ac_t""$CC" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-if test -z "$CC"; then
- # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:565: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_prog_rejected=no
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
- ac_prog_rejected=yes
- continue
- fi
- ac_cv_prog_CC="cc"
- break
- fi
- done
- IFS="$ac_save_ifs"
-if test $ac_prog_rejected = yes; then
- # We found a bogon in the path, so make sure we never use it.
- set dummy $ac_cv_prog_CC
- shift
- if test $# -gt 0; then
- # We chose a different compiler from the bogus one.
- # However, it has the same basename, so the bogon will be chosen
- # first if we set CC to just the basename; use the full file name.
- shift
- set dummy "$ac_dir/$ac_word" "$@"
- shift
- ac_cv_prog_CC="$@"
- fi
-fi
-fi
-fi
-CC="$ac_cv_prog_CC"
-if test -n "$CC"; then
- echo "$ac_t""$CC" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
- if test -z "$CC"; then
- case "`uname -s`" in
- *win32* | *WIN32*)
- # Extract the first word of "cl", so it can be a program name with args.
-set dummy cl; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:616: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_prog_CC="cl"
- break
- fi
- done
- IFS="$ac_save_ifs"
-fi
-fi
-CC="$ac_cv_prog_CC"
-if test -n "$CC"; then
- echo "$ac_t""$CC" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
- ;;
- esac
- fi
- test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
-fi
-
-
-echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:649: checking whether we are using GNU C" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.c <<EOF
-#ifdef __GNUC__
- yes;
-#endif
-EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:658: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
- ac_cv_prog_gcc=yes
-else
- ac_cv_prog_gcc=no
-fi
-fi
-
-echo "$ac_t""$ac_cv_prog_gcc" 1>&6
-
-if test $ac_cv_prog_gcc = yes; then
- GCC=yes
-else
- GCC=
-fi
-
-ac_test_CFLAGS="${CFLAGS+set}"
-ac_save_CFLAGS="$CFLAGS"
-CFLAGS=
-echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:677: checking whether ${CC-cc} accepts -g" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- echo 'void f(){}' > conftest.c
-if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
- ac_cv_prog_cc_g=yes
-else
- ac_cv_prog_cc_g=no
-fi
-rm -f conftest*
-
-fi
-
-echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
-if test "$ac_test_CFLAGS" = set; then
- CFLAGS="$ac_save_CFLAGS"
-elif test $ac_cv_prog_cc_g = yes; then
- if test "$GCC" = yes; then
- CFLAGS="-g -O2"
- else
- CFLAGS="-g"
- fi
-else
- if test "$GCC" = yes; then
- CFLAGS="-O2"
- else
- CFLAGS=
- fi
-fi
-
-
-test "$AR" || AR=ar
-
-echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:712: checking whether ${MAKE-make} sets \${MAKE}" >&5
-set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftestmake <<\EOF
-all:
- @echo 'ac_maketemp="${MAKE}"'
-EOF
-# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
-eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
-if test -n "$ac_maketemp"; then
- eval ac_cv_prog_make_${ac_make}_set=yes
-else
- eval ac_cv_prog_make_${ac_make}_set=no
-fi
-rm -f conftestmake
-fi
-if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- SET_MAKE=
-else
- echo "$ac_t""no" 1>&6
- SET_MAKE="MAKE=${MAKE-make}"
-fi
-
-
-
-# Sanity check for the cross-compilation case:
-echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:742: checking how to run the C preprocessor" >&5
-# On Suns, sometimes $CPP names a directory.
-if test -n "$CPP" && test -d "$CPP"; then
- CPP=
-fi
-if test -z "$CPP"; then
-if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- # This must be in double quotes, not single quotes, because CPP may get
- # substituted into the Makefile and "${CC-cc}" will confuse make.
- CPP="${CC-cc} -E"
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp.
- cat > conftest.$ac_ext <<EOF
-#line 757 "configure"
-#include "confdefs.h"
-#include <assert.h>
-Syntax Error
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:763: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- :
-else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- CPP="${CC-cc} -E -traditional-cpp"
- cat > conftest.$ac_ext <<EOF
-#line 774 "configure"
-#include "confdefs.h"
-#include <assert.h>
-Syntax Error
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:780: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- :
-else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- CPP="${CC-cc} -nologo -E"
- cat > conftest.$ac_ext <<EOF
-#line 791 "configure"
-#include "confdefs.h"
-#include <assert.h>
-Syntax Error
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:797: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- :
-else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- CPP=/lib/cpp
-fi
-rm -f conftest*
-fi
-rm -f conftest*
-fi
-rm -f conftest*
- ac_cv_prog_CPP="$CPP"
-fi
- CPP="$ac_cv_prog_CPP"
-else
- ac_cv_prog_CPP="$CPP"
-fi
-echo "$ac_t""$CPP" 1>&6
-
-ac_safe=`echo "stdio.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for stdio.h""... $ac_c" 1>&6
-echo "configure:823: checking for stdio.h" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 828 "configure"
-#include "confdefs.h"
-#include <stdio.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:833: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=yes"
-else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- :
-else
- echo "$ac_t""no" 1>&6
-{ echo "configure: error: Can't find stdio.h.
-You must have a usable C system for the target already installed, at least
-including headers and, preferably, the library, before you can configure
-the G77 runtime system. If necessary, install gcc now with \`LANGUAGES=c',
-then the target library, then build with \`LANGUAGES=f77'." 1>&2; exit 1; }
-fi
-
-
-echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:861: checking for ANSI C header files" >&5
-if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 866 "configure"
-#include "confdefs.h"
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:874: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- rm -rf conftest*
- ac_cv_header_stdc=yes
-else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-if test $ac_cv_header_stdc = yes; then
- # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
-cat > conftest.$ac_ext <<EOF
-#line 891 "configure"
-#include "confdefs.h"
-#include <string.h>
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "memchr" >/dev/null 2>&1; then
- :
-else
- rm -rf conftest*
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
-cat > conftest.$ac_ext <<EOF
-#line 909 "configure"
-#include "confdefs.h"
-#include <stdlib.h>
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "free" >/dev/null 2>&1; then
- :
-else
- rm -rf conftest*
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
-if test "$cross_compiling" = yes; then
- :
-else
- cat > conftest.$ac_ext <<EOF
-#line 930 "configure"
-#include "confdefs.h"
-#include <ctype.h>
-#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int main () { int i; for (i = 0; i < 256; i++)
-if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
-exit (0); }
-
-EOF
-if { (eval echo configure:941: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
- :
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -fr conftest*
- ac_cv_header_stdc=no
-fi
-rm -fr conftest*
-fi
-
-fi
-fi
-
-echo "$ac_t""$ac_cv_header_stdc" 1>&6
-if test $ac_cv_header_stdc = yes; then
- cat >> confdefs.h <<\EOF
-#define STDC_HEADERS 1
-EOF
-
-fi
-
-
-echo $ac_n "checking for posix""... $ac_c" 1>&6
-echo "configure:966: checking for posix" >&5
-if eval "test \"`echo '$''{'g77_cv_header_posix'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 971 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#include <unistd.h>
-#ifdef _POSIX_VERSION
- yes
-#endif
-
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "yes" >/dev/null 2>&1; then
- rm -rf conftest*
- g77_cv_header_posix=yes
-else
- rm -rf conftest*
- g77_cv_header_posix=no
-fi
-rm -f conftest*
-
-fi
-
-echo "$ac_t""$g77_cv_header_posix" 1>&6
-
-# We can rely on the GNU library being posix-ish. I guess checking the
-# header isn't actually like checking the functions, though...
-echo $ac_n "checking for GNU library""... $ac_c" 1>&6
-echo "configure:997: checking for GNU library" >&5
-if eval "test \"`echo '$''{'g77_cv_lib_gnu'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1002 "configure"
-#include "confdefs.h"
-#include <stdio.h>
-#ifdef __GNU_LIBRARY__
- yes
-#endif
-
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "yes" >/dev/null 2>&1; then
- rm -rf conftest*
- g77_cv_lib_gnu=yes
-else
- rm -rf conftest*
- g77_cv_lib_gnu=no
-fi
-rm -f conftest*
-
-fi
-
-echo "$ac_t""$g77_cv_lib_gnu" 1>&6
-
-# Apparently cygwin needs to be special-cased.
-echo $ac_n "checking for cyg\`win'32""... $ac_c" 1>&6
-echo "configure:1026: checking for cyg\`win'32" >&5
-if eval "test \"`echo '$''{'g77_cv_sys_cygwin32'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1031 "configure"
-#include "confdefs.h"
-#ifdef __CYGWIN32__
- yes
-#endif
-
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "yes" >/dev/null 2>&1; then
- rm -rf conftest*
- g77_cv_sys_cygwin32=yes
-else
- rm -rf conftest*
- g77_cv_sys_cygwin32=no
-fi
-rm -f conftest*
-
-fi
-
-echo "$ac_t""$g77_cv_sys_cygwin32" 1>&6
-
-# ditto for mingw32.
-echo $ac_n "checking for mingw32""... $ac_c" 1>&6
-echo "configure:1054: checking for mingw32" >&5
-if eval "test \"`echo '$''{'g77_cv_sys_mingw32'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1059 "configure"
-#include "confdefs.h"
-#ifdef __MINGW32__
- yes
-#endif
-
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "yes" >/dev/null 2>&1; then
- rm -rf conftest*
- g77_cv_sys_mingw32=yes
-else
- rm -rf conftest*
- g77_cv_sys_mingw32=no
-fi
-rm -f conftest*
-
-fi
-
-echo "$ac_t""$g77_cv_sys_mingw32" 1>&6
-
-
-ac_safe=`echo "fcntl.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for fcntl.h""... $ac_c" 1>&6
-echo "configure:1083: checking for fcntl.h" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1088 "configure"
-#include "confdefs.h"
-#include <fcntl.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1093: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=yes"
-else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- test $g77_cv_header_posix = yes && cat >> confdefs.h <<\EOF
-#define _POSIX_SOURCE 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
-cat >> confdefs.h <<\EOF
-#define NO_FCNTL 1
-EOF
-
- cat >> confdefs.h <<\EOF
-#define OPEN_DECL 1
-EOF
-
-fi
-
-
-echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:1127: checking for working const" >&5
-if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1132 "configure"
-#include "confdefs.h"
-
-int main() {
-
-/* Ultrix mips cc rejects this. */
-typedef int charset[2]; const charset x;
-/* SunOS 4.1.1 cc rejects this. */
-char const *const *ccp;
-char **p;
-/* NEC SVR4.0.2 mips cc rejects this. */
-struct point {int x, y;};
-static struct point const zero = {0,0};
-/* AIX XL C 1.02.0.0 rejects this.
- It does not let you subtract one const X* pointer from another in an arm
- of an if-expression whose if-part is not a constant expression */
-const char *g = "string";
-ccp = &g + (g ? g-g : 0);
-/* HPUX 7.0 cc rejects these. */
-++ccp;
-p = (char**) ccp;
-ccp = (char const *const *) p;
-{ /* SCO 3.2v4 cc rejects this. */
- char *t;
- char const *s = 0 ? (char *) 0 : (char const *) 0;
-
- *t++ = 0;
-}
-{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
- int x[] = {25, 17};
- const int *foo = &x[0];
- ++foo;
-}
-{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
- typedef const int *iptr;
- iptr p = 0;
- ++p;
-}
-{ /* AIX XL C 1.02.0.0 rejects this saying
- "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
- struct s { int j; const int *ap[3]; };
- struct s *b; b->j = 5;
-}
-{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
- const int foo = 10;
-}
-
-; return 0; }
-EOF
-if { (eval echo configure:1181: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- ac_cv_c_const=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_cv_c_const=no
-fi
-rm -f conftest*
-fi
-
-echo "$ac_t""$ac_cv_c_const" 1>&6
-if test $ac_cv_c_const = no; then
- cat >> confdefs.h <<\EOF
-#define const
-EOF
-
-fi
-
-echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:1202: checking for size_t" >&5
-if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1207 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#if STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
-#endif
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
- rm -rf conftest*
- ac_cv_type_size_t=yes
-else
- rm -rf conftest*
- ac_cv_type_size_t=no
-fi
-rm -f conftest*
-
-fi
-echo "$ac_t""$ac_cv_type_size_t" 1>&6
-if test $ac_cv_type_size_t = no; then
- cat >> confdefs.h <<\EOF
-#define size_t unsigned
-EOF
-
-fi
-
-
-
-# This should always succeed on unix.
-# Apparently positive result on cygwin loses re. NON_UNIX_STDIO
-# (as of cygwin b18). Likewise on mingw.
-echo $ac_n "checking for fstat""... $ac_c" 1>&6
-echo "configure:1240: checking for fstat" >&5
-if eval "test \"`echo '$''{'ac_cv_func_fstat'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1245 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char fstat(); below. */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char fstat();
-
-int main() {
-
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_fstat) || defined (__stub___fstat)
-choke me
-#else
-fstat();
-#endif
-
-; return 0; }
-EOF
-if { (eval echo configure:1268: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_fstat=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_fstat=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'fstat`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- :
-else
- echo "$ac_t""no" 1>&6
-fi
-
-echo $ac_n "checking need for NON_UNIX_STDIO""... $ac_c" 1>&6
-echo "configure:1288: checking need for NON_UNIX_STDIO" >&5
-if test $g77_cv_sys_cygwin32 = yes \
- || test $g77_cv_sys_mingw32 = yes \
- || test $ac_cv_func_fstat = no; then
- echo "$ac_t""yes" 1>&6
- cat >> confdefs.h <<\EOF
-#define NON_UNIX_STDIO 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
-fi
-
-for ac_func in ftruncate
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1304: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1309 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func(); below. */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char $ac_func();
-
-int main() {
-
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-$ac_func();
-#endif
-
-; return 0; }
-EOF
-if { (eval echo configure:1332: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
-fi
-done
-
-for ac_func in mkstemp
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1359: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1364 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func(); below. */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char $ac_func();
-
-int main() {
-
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-$ac_func();
-#endif
-
-; return 0; }
-EOF
-if { (eval echo configure:1387: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
-fi
-done
-
-for ac_func in tempnam
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1414: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1419 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func(); below. */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char $ac_func();
-
-int main() {
-
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-$ac_func();
-#endif
-
-; return 0; }
-EOF
-if { (eval echo configure:1442: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
-fi
-done
-
-
-# posix will guarantee the right behaviour for sprintf, else we can't be
-# sure; HEADER_STDC wouldn't be the right check in sunos4, for instance.
-# However, on my sunos4/gcc setup unistd.h leads us wrongly to believe
-# we're posix-conformant, so always do the test.
-echo $ac_n "checking for ansi/posix sprintf result""... $ac_c" 1>&6
-echo "configure:1472: checking for ansi/posix sprintf result" >&5
-if test "$cross_compiling" = yes; then
- g77_cv_sys_sprintf_ansi=no
-else
- cat > conftest.$ac_ext <<EOF
-#line 1477 "configure"
-#include "confdefs.h"
- #include <stdio.h>
- /* does sprintf return the number of chars transferred? */
- main () {char foo[2]; (sprintf(foo, "1") == 1) ? exit(0) : exit(1);}
-
-EOF
-if { (eval echo configure:1484: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
- g77_cv_sys_sprintf_ansi=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -fr conftest*
- g77_cv_sys_sprintf_ansi=no
-fi
-rm -fr conftest*
-fi
-
-if eval "test \"`echo '$''{'g77_cv_sys_sprintf_ansi'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- g77_cv_sys_sprintf_ansi=$g77_cv_sys_sprintf_ansi
-fi
-
-echo "$ac_t""$g77_cv_sys_sprintf_ansi" 1>&6
-
-# The cygwin patch takes steps to avoid defining USE_STRLEN here -- I don't
-# understand why.
-if test $g77_cv_sys_sprintf_ansi != yes; then
- cat >> confdefs.h <<\EOF
-#define USE_STRLEN 1
-EOF
-
-fi
-
-# define NON_ANSI_RW_MODES on unix (can't hurt)
-echo $ac_n "checking NON_ANSI_RW_MODES""... $ac_c" 1>&6
-echo "configure:1515: checking NON_ANSI_RW_MODES" >&5
-cat > conftest.$ac_ext <<EOF
-#line 1517 "configure"
-#include "confdefs.h"
-#ifdef unix
- yes
-#endif
-#ifdef __unix
- yes
-#endif
-#ifdef __unix__
- yes
-#endif
-
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "yes" >/dev/null 2>&1; then
- rm -rf conftest*
- is_unix=yes
-else
- rm -rf conftest*
- is_unix=no
-fi
-rm -f conftest*
-
-# NON_ANSI_RW_MODES shouldn't be necessary on cygwin for binary mounts.
-if test $g77_cv_sys_cygwin32 = yes || test $g77_cv_sys_mingw32 = yes; then
- echo "$ac_t""no" 1>&6
-else
- if test $is_unix = yes; then
- cat >> confdefs.h <<\EOF
-#define NON_ANSI_RW_MODES 1
-EOF
-
- echo "$ac_t""yes" 1>&6
- else
- echo "$ac_t""no" 1>&6
- fi
-fi
-
-# This EOF_CHAR is a misfeature on unix.
-cat >> confdefs.h <<\EOF
-#define NO_EOF_CHAR_CHECK 1
-EOF
-
-
-echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:1562: checking for off_t" >&5
-if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1567 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#if STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
-#endif
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
- rm -rf conftest*
- ac_cv_type_off_t=yes
-else
- rm -rf conftest*
- ac_cv_type_off_t=no
-fi
-rm -f conftest*
-
-fi
-echo "$ac_t""$ac_cv_type_off_t" 1>&6
-if test $ac_cv_type_off_t = no; then
- cat >> confdefs.h <<\EOF
-#define off_t long
-EOF
-
-fi
-
-
-cat >> confdefs.h <<\EOF
-#define Skip_f2c_Undefs 1
-EOF
-
-
-trap '' 1 2 15
-cat > confcache <<\EOF
-# This file is a shell script that caches the results of configure
-# tests run on this system so they can be shared between configure
-# scripts and configure runs. It is not useful on other systems.
-# If it contains results you don't want to keep, you may remove or edit it.
-#
-# By default, configure uses ./config.cache as the cache file,
-# creating it if it does not exist already. You can give configure
-# the --cache-file=FILE option to use a different cache file; that is
-# what configure does when it calls configure scripts in
-# subdirectories, so they share the cache.
-# Giving --cache-file=/dev/null disables caching, for debugging configure.
-# config.status only pays attention to the cache file if you give it the
-# --recheck option to rerun configure.
-#
-EOF
-# The following way of writing the cache mishandles newlines in values,
-# but we know of no workaround that is simple, portable, and efficient.
-# So, don't put newlines in cache variables' values.
-# Ultrix sh set writes to stderr and can't be redirected directly,
-# and sets the high bit in the cache file unless we assign to the vars.
-(set) 2>&1 |
- case `(ac_space=' '; set | grep ac_space) 2>&1` in
- *ac_space=\ *)
- # `set' does not quote correctly, so add quotes (double-quote substitution
- # turns \\\\ into \\, and sed turns \\ into \).
- sed -n \
- -e "s/'/'\\\\''/g" \
- -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
- ;;
- *)
- # `set' quotes correctly as required by POSIX, so do not add quotes.
- sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
- ;;
- esac >> confcache
-if cmp -s $cache_file confcache; then
- :
-else
- if test -w $cache_file; then
- echo "updating cache $cache_file"
- cat confcache > $cache_file
- else
- echo "not updating unwritable cache $cache_file"
- fi
-fi
-rm -f confcache
-
-trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
-
-test "x$prefix" = xNONE && prefix=$ac_default_prefix
-# Let make expand exec_prefix.
-test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-
-# Any assignment to VPATH causes Sun make to only execute
-# the first set of double-colon rules, so remove it if not needed.
-# If there is a colon in the path, we need to keep it.
-if test "x$srcdir" = x.; then
- ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
-fi
-
-trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
-
-DEFS=-DHAVE_CONFIG_H
-
-# Without the "./", some shells look in PATH for config.status.
-: ${CONFIG_STATUS=./config.status}
-
-echo creating $CONFIG_STATUS
-rm -f $CONFIG_STATUS
-cat > $CONFIG_STATUS <<EOF
-#! /bin/sh
-# Generated automatically by configure.
-# Run this file to recreate the current configuration.
-# This directory was configured as follows,
-# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-#
-# $0 $ac_configure_args
-#
-# Compiler output produced by configure, useful for debugging
-# configure, is in ./config.log if it exists.
-
-ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
-for ac_option
-do
- case "\$ac_option" in
- -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
- echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
- exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
- -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
- echo "$CONFIG_STATUS generated by autoconf version 2.13"
- exit 0 ;;
- -help | --help | --hel | --he | --h)
- echo "\$ac_cs_usage"; exit 0 ;;
- *) echo "\$ac_cs_usage"; exit 1 ;;
- esac
-done
-
-ac_given_srcdir=$srcdir
-
-trap 'rm -fr `echo "Makefile config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
-EOF
-cat >> $CONFIG_STATUS <<EOF
-
-# Protect against being on the right side of a sed subst in config.status.
-sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
- s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
-$ac_vpsub
-$extrasub
-s%@SHELL@%$SHELL%g
-s%@CFLAGS@%$CFLAGS%g
-s%@CPPFLAGS@%$CPPFLAGS%g
-s%@CXXFLAGS@%$CXXFLAGS%g
-s%@FFLAGS@%$FFLAGS%g
-s%@DEFS@%$DEFS%g
-s%@LDFLAGS@%$LDFLAGS%g
-s%@LIBS@%$LIBS%g
-s%@exec_prefix@%$exec_prefix%g
-s%@prefix@%$prefix%g
-s%@program_transform_name@%$program_transform_name%g
-s%@bindir@%$bindir%g
-s%@sbindir@%$sbindir%g
-s%@libexecdir@%$libexecdir%g
-s%@datadir@%$datadir%g
-s%@sysconfdir@%$sysconfdir%g
-s%@sharedstatedir@%$sharedstatedir%g
-s%@localstatedir@%$localstatedir%g
-s%@libdir@%$libdir%g
-s%@includedir@%$includedir%g
-s%@oldincludedir@%$oldincludedir%g
-s%@infodir@%$infodir%g
-s%@mandir@%$mandir%g
-s%@CC@%$CC%g
-s%@AR@%$AR%g
-s%@SET_MAKE@%$SET_MAKE%g
-s%@CPP@%$CPP%g
-
-CEOF
-EOF
-
-cat >> $CONFIG_STATUS <<\EOF
-
-# Split the substitutions into bite-sized pieces for seds with
-# small command number limits, like on Digital OSF/1 and HP-UX.
-ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
-ac_file=1 # Number of current file.
-ac_beg=1 # First line for current file.
-ac_end=$ac_max_sed_cmds # Line after last line for current file.
-ac_more_lines=:
-ac_sed_cmds=""
-while $ac_more_lines; do
- if test $ac_beg -gt 1; then
- sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
- else
- sed "${ac_end}q" conftest.subs > conftest.s$ac_file
- fi
- if test ! -s conftest.s$ac_file; then
- ac_more_lines=false
- rm -f conftest.s$ac_file
- else
- if test -z "$ac_sed_cmds"; then
- ac_sed_cmds="sed -f conftest.s$ac_file"
- else
- ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
- fi
- ac_file=`expr $ac_file + 1`
- ac_beg=$ac_end
- ac_end=`expr $ac_end + $ac_max_sed_cmds`
- fi
-done
-if test -z "$ac_sed_cmds"; then
- ac_sed_cmds=cat
-fi
-EOF
-
-cat >> $CONFIG_STATUS <<EOF
-
-CONFIG_FILES=\${CONFIG_FILES-"Makefile"}
-EOF
-cat >> $CONFIG_STATUS <<\EOF
-for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
- # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
- case "$ac_file" in
- *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
- ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
- *) ac_file_in="${ac_file}.in" ;;
- esac
-
- # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
-
- # Remove last slash and all that follows it. Not all systems have dirname.
- ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
- if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
- # The file is in a subdirectory.
- test ! -d "$ac_dir" && mkdir "$ac_dir"
- ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
- # A "../" for each directory in $ac_dir_suffix.
- ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
- else
- ac_dir_suffix= ac_dots=
- fi
-
- case "$ac_given_srcdir" in
- .) srcdir=.
- if test -z "$ac_dots"; then top_srcdir=.
- else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
- /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
- *) # Relative path.
- srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
- top_srcdir="$ac_dots$ac_given_srcdir" ;;
- esac
-
-
- echo creating "$ac_file"
- rm -f "$ac_file"
- configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
- case "$ac_file" in
- *Makefile*) ac_comsub="1i\\
-# $configure_input" ;;
- *) ac_comsub= ;;
- esac
-
- ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
- sed -e "$ac_comsub
-s%@configure_input@%$configure_input%g
-s%@srcdir@%$srcdir%g
-s%@top_srcdir@%$top_srcdir%g
-" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
-fi; done
-rm -f conftest.s*
-
-# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
-# NAME is the cpp macro being defined and VALUE is the value it is being given.
-#
-# ac_d sets the value in "#define NAME VALUE" lines.
-ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)'
-ac_dB='\([ ][ ]*\)[^ ]*%\1#\2'
-ac_dC='\3'
-ac_dD='%g'
-# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
-ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
-ac_uB='\([ ]\)%\1#\2define\3'
-ac_uC=' '
-ac_uD='\4%g'
-# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
-ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
-ac_eB='$%\1#\2define\3'
-ac_eC=' '
-ac_eD='%g'
-
-if test "${CONFIG_HEADERS+set}" != set; then
-EOF
-cat >> $CONFIG_STATUS <<EOF
- CONFIG_HEADERS="config.h"
-EOF
-cat >> $CONFIG_STATUS <<\EOF
-fi
-for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
- # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
- case "$ac_file" in
- *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
- ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
- *) ac_file_in="${ac_file}.in" ;;
- esac
-
- echo creating $ac_file
-
- rm -f conftest.frag conftest.in conftest.out
- ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
- cat $ac_file_inputs > conftest.in
-
-EOF
-
-# Transform confdefs.h into a sed script conftest.vals that substitutes
-# the proper values into config.h.in to produce config.h. And first:
-# Protect against being on the right side of a sed subst in config.status.
-# Protect against being in an unquoted here document in config.status.
-rm -f conftest.vals
-cat > conftest.hdr <<\EOF
-s/[\\&%]/\\&/g
-s%[\\$`]%\\&%g
-s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
-s%ac_d%ac_u%gp
-s%ac_u%ac_e%gp
-EOF
-sed -n -f conftest.hdr confdefs.h > conftest.vals
-rm -f conftest.hdr
-
-# This sed command replaces #undef with comments. This is necessary, for
-# example, in the case of _POSIX_SOURCE, which is predefined and required
-# on some systems where configure will not decide to define it.
-cat >> conftest.vals <<\EOF
-s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
-EOF
-
-# Break up conftest.vals because some shells have a limit on
-# the size of here documents, and old seds have small limits too.
-
-rm -f conftest.tail
-while :
-do
- ac_lines=`grep -c . conftest.vals`
- # grep -c gives empty output for an empty file on some AIX systems.
- if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
- # Write a limited-size here document to conftest.frag.
- echo ' cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
- sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
- echo 'CEOF
- sed -f conftest.frag conftest.in > conftest.out
- rm -f conftest.in
- mv conftest.out conftest.in
-' >> $CONFIG_STATUS
- sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
- rm -f conftest.vals
- mv conftest.tail conftest.vals
-done
-rm -f conftest.vals
-
-cat >> $CONFIG_STATUS <<\EOF
- rm -f conftest.frag conftest.h
- echo "/* $ac_file. Generated automatically by configure. */" > conftest.h
- cat conftest.in >> conftest.h
- rm -f conftest.in
- if cmp -s $ac_file conftest.h 2>/dev/null; then
- echo "$ac_file is unchanged"
- rm -f conftest.h
- else
- # Remove last slash and all that follows it. Not all systems have dirname.
- ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
- if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
- # The file is in a subdirectory.
- test ! -d "$ac_dir" && mkdir "$ac_dir"
- fi
- rm -f $ac_file
- mv conftest.h $ac_file
- fi
-fi; done
-
-EOF
-cat >> $CONFIG_STATUS <<EOF
-
-EOF
-cat >> $CONFIG_STATUS <<\EOF
-
-exit 0
-EOF
-chmod +x $CONFIG_STATUS
-rm -fr confdefs* $ac_clean_files
-test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
-
-
-
diff --git a/contrib/libf2c/libI77/configure.in b/contrib/libf2c/libI77/configure.in
deleted file mode 100644
index 20f2628ba3a2..000000000000
--- a/contrib/libf2c/libI77/configure.in
+++ /dev/null
@@ -1,213 +0,0 @@
-# Process this file with autoconf to produce a configure script.
-# Copyright (C) 1995, 1997, 1998, 2001 Free Software Foundation, Inc.
-# Contributed by Dave Love (d.love@dl.ac.uk).
-#
-#This file is part of GNU Fortran.
-#
-#GNU Fortran 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.
-#
-#GNU Fortran is distributed in the hope that it will be useful,
-#but WITHOUT ANY WARRANTY; without even the implied warranty of
-#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-#GNU General Public License for more details.
-#
-#You should have received a copy of the GNU General Public License
-#along with GNU Fortran; see the file COPYING. If not, write to
-#the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-#02111-1307, USA.
-
-AC_PREREQ(2.12.1)
-AC_INIT(ftell_.c)
-AC_CONFIG_HEADER(config.h)
-
-dnl Checks for programs.
-
-dnl FIXME AC_PROG_CC wants CC to be able to link things, but it may
-dnl not be able to.
-define([AC_PROG_CC_WORKS],[])
-
-# For g77 we'll set CC to point at the built gcc, but this will get it into
-# the makefiles
-AC_PROG_CC
-
-test "$AR" || AR=ar
-AC_SUBST(AR)
-AC_PROG_MAKE_SET
-
-dnl Checks for libraries.
-
-dnl Checks for header files.
-# Sanity check for the cross-compilation case:
-AC_CHECK_HEADER(stdio.h,:,
- [AC_MSG_ERROR([Can't find stdio.h.
-You must have a usable C system for the target already installed, at least
-including headers and, preferably, the library, before you can configure
-the G77 runtime system. If necessary, install gcc now with \`LANGUAGES=c',
-then the target library, then build with \`LANGUAGES=f77'.])])
-
-AC_HEADER_STDC
-dnl We could do this if we didn't know we were using gcc
-dnl AC_MSG_CHECKING(for prototype-savvy compiler)
-dnl AC_CACHE_VAL(g77_cv_sys_proto,
-dnl [AC_TRY_LINK(,
-dnl dnl looks screwy because TRY_LINK expects a function body
-dnl [return 0;} int foo (int * bar) {],
-dnl g77_cv_sys_proto=yes,
-dnl [g77_cv_sys_proto=no
-dnl AC_DEFINE(KR_headers)])])
-dnl AC_MSG_RESULT($g77_cv_sys_proto)
-
-AC_MSG_CHECKING(for posix)
-AC_CACHE_VAL(g77_cv_header_posix,
- AC_EGREP_CPP(yes,
- [#include <sys/types.h>
-#include <unistd.h>
-#ifdef _POSIX_VERSION
- yes
-#endif
-],
- g77_cv_header_posix=yes,
- g77_cv_header_posix=no))
-AC_MSG_RESULT($g77_cv_header_posix)
-
-# We can rely on the GNU library being posix-ish. I guess checking the
-# header isn't actually like checking the functions, though...
-AC_MSG_CHECKING(for GNU library)
-AC_CACHE_VAL(g77_cv_lib_gnu,
- AC_EGREP_CPP(yes,
- [#include <stdio.h>
-#ifdef __GNU_LIBRARY__
- yes
-#endif
-],
- g77_cv_lib_gnu=yes, g77_cv_lib_gnu=no))
-AC_MSG_RESULT($g77_cv_lib_gnu)
-
-# Apparently cygwin needs to be special-cased.
-AC_MSG_CHECKING([for cyg\`win'32])
-AC_CACHE_VAL(g77_cv_sys_cygwin32,
- AC_EGREP_CPP(yes,
- [#ifdef __CYGWIN32__
- yes
-#endif
-],
- g77_cv_sys_cygwin32=yes,
- g77_cv_sys_cygwin32=no))
-AC_MSG_RESULT($g77_cv_sys_cygwin32)
-
-# ditto for mingw32.
-AC_MSG_CHECKING([for mingw32])
-AC_CACHE_VAL(g77_cv_sys_mingw32,
- AC_EGREP_CPP(yes,
- [#ifdef __MINGW32__
- yes
-#endif
-],
- g77_cv_sys_mingw32=yes,
- g77_cv_sys_mingw32=no))
-AC_MSG_RESULT($g77_cv_sys_mingw32)
-
-
-AC_CHECK_HEADER(fcntl.h,
- test $g77_cv_header_posix = yes && AC_DEFINE(_POSIX_SOURCE),
- AC_DEFINE(NO_FCNTL, 1, [Define if fcntl.h is missing.])
- AC_DEFINE(OPEN_DECL, 1, [Define if fcntl.h is missing.]))
-
-dnl Checks for typedefs, structures, and compiler characteristics.
-AC_C_CONST
-AC_TYPE_SIZE_T
-
-dnl Checks for library functions.
-
-# This should always succeed on unix.
-# Apparently positive result on cygwin loses re. NON_UNIX_STDIO
-# (as of cygwin b18). Likewise on mingw.
-AC_CHECK_FUNC(fstat)
-AC_MSG_CHECKING([need for NON_UNIX_STDIO])
-if test $g77_cv_sys_cygwin32 = yes \
- || test $g77_cv_sys_mingw32 = yes \
- || test $ac_cv_func_fstat = no; then
- AC_MSG_RESULT(yes)
- AC_DEFINE(NON_UNIX_STDIO, 1, [Define if we do not have Unix Stdio.])
-else
- AC_MSG_RESULT(no)
-fi
-
-AC_CHECK_FUNCS(ftruncate)
-AC_CHECK_FUNCS(mkstemp)
-AC_CHECK_FUNCS(tempnam)
-
-# posix will guarantee the right behaviour for sprintf, else we can't be
-# sure; HEADER_STDC wouldn't be the right check in sunos4, for instance.
-# However, on my sunos4/gcc setup unistd.h leads us wrongly to believe
-# we're posix-conformant, so always do the test.
-AC_MSG_CHECKING(for ansi/posix sprintf result)
-dnl This loses if included as an argument to AC_CACHE_VAL because the
-dnl changequote doesn't take effect and the [] vanish.
-dnl fixme: use cached value
-AC_TRY_RUN(changequote(<<, >>)dnl
- <<#include <stdio.h>
- /* does sprintf return the number of chars transferred? */
- main () {char foo[2]; (sprintf(foo, "1") == 1) ? exit(0) : exit(1);}
->>changequote([, ]),
- g77_cv_sys_sprintf_ansi=yes,
- g77_cv_sys_sprintf_ansi=no,
- g77_cv_sys_sprintf_ansi=no)
-AC_CACHE_VAL(g77_cv_sys_sprintf_ansi,
- g77_cv_sys_sprintf_ansi=$g77_cv_sys_sprintf_ansi)
-dnl We get a misleading `(cached)' message...
-AC_MSG_RESULT($g77_cv_sys_sprintf_ansi)
-
-# The cygwin patch takes steps to avoid defining USE_STRLEN here -- I don't
-# understand why.
-if test $g77_cv_sys_sprintf_ansi != yes; then
- AC_DEFINE(USE_STRLEN, 1, [Define if we use strlen.])
-fi
-
-# define NON_ANSI_RW_MODES on unix (can't hurt)
-AC_MSG_CHECKING(NON_ANSI_RW_MODES)
-AC_EGREP_CPP(yes,
-[#ifdef unix
- yes
-#endif
-#ifdef __unix
- yes
-#endif
-#ifdef __unix__
- yes
-#endif
-], is_unix=yes, is_unix=no)
-# NON_ANSI_RW_MODES shouldn't be necessary on cygwin for binary mounts.
-if test $g77_cv_sys_cygwin32 = yes || test $g77_cv_sys_mingw32 = yes; then
- AC_MSG_RESULT(no)
-else
- if test $is_unix = yes; then
- AC_DEFINE(NON_ANSI_RW_MODES, 1, [Define if we have non ANSI RW modes.])
- AC_MSG_RESULT(yes)
- else
- AC_MSG_RESULT(no)
- fi
-fi
-
-# This EOF_CHAR is a misfeature on unix.
-AC_DEFINE(NO_EOF_CHAR_CHECK, 1, [Always defined.])
-
-AC_TYPE_OFF_T
-
-AC_DEFINE(Skip_f2c_Undefs, 1, [Define to skip f2c undefs.])
-
-AC_OUTPUT(Makefile)
-
-dnl We might have configuration options to:
-dnl * change unit preconnexion in err.c (f_init.c)
-dnl * -DALWAYS_FLUSH
-dnl * -DOMIT_BLANK_CC
-
-dnl Local Variables:
-dnl comment-start: "dnl "
-dnl comment-end: ""
-dnl comment-start-skip: "\\bdnl\\b\\s *"
-dnl End:
diff --git a/contrib/libf2c/libI77/dfe.c b/contrib/libf2c/libI77/dfe.c
deleted file mode 100644
index e90b16d05511..000000000000
--- a/contrib/libf2c/libI77/dfe.c
+++ /dev/null
@@ -1,147 +0,0 @@
-#include "config.h"
-#include "f2c.h"
-#include "fio.h"
-#include "fmt.h"
-
-y_rsk(Void)
-{
- if(f__curunit->uend || f__curunit->url <= f__recpos
- || f__curunit->url == 1) return 0;
- do {
- getc(f__cf);
- } while(++f__recpos < f__curunit->url);
- return 0;
-}
-y_getc(Void)
-{
- int ch;
- if(f__curunit->uend) return(-1);
- if((ch=getc(f__cf))!=EOF)
- {
- f__recpos++;
- if(f__curunit->url>=f__recpos ||
- f__curunit->url==1)
- return(ch);
- else return(' ');
- }
- if(feof(f__cf))
- {
- f__curunit->uend=1;
- errno=0;
- return(-1);
- }
- err(f__elist->cierr,errno,"readingd");
-}
-
- static int
-y_rev(Void)
-{
- if (f__recpos < f__hiwater)
- f__recpos = f__hiwater;
- if (f__curunit->url > 1)
- while(f__recpos < f__curunit->url)
- (*f__putn)(' ');
- if (f__recpos)
- f__putbuf(0);
- f__recpos = 0;
- return(0);
-}
-
- static int
-y_err(Void)
-{
- err(f__elist->cierr, 110, "dfe");
-}
-
- static int
-y_newrec(Void)
-{
- y_rev();
- f__hiwater = f__cursor = 0;
- return(1);
-}
-
-#ifdef KR_headers
-c_dfe(a) cilist *a;
-#else
-c_dfe(cilist *a)
-#endif
-{
- f__sequential=0;
- f__formatted=f__external=1;
- f__elist=a;
- f__cursor=f__scale=f__recpos=0;
- f__curunit = &f__units[a->ciunit];
- if(a->ciunit>MXUNIT || a->ciunit<0)
- err(a->cierr,101,"startchk");
- if(f__curunit->ufd==NULL && fk_open(DIR,FMT,a->ciunit))
- err(a->cierr,104,"dfe");
- f__cf=f__curunit->ufd;
- if(!f__curunit->ufmt) err(a->cierr,102,"dfe");
- if(!f__curunit->useek) err(a->cierr,104,"dfe");
- f__fmtbuf=a->cifmt;
- if(a->cirec <= 0)
- err(a->cierr,130,"dfe");
- (void) fseek(f__cf,(long)f__curunit->url * (a->cirec-1),SEEK_SET);
- f__curunit->uend = 0;
- return(0);
-}
-#ifdef KR_headers
-integer s_rdfe(a) cilist *a;
-#else
-integer s_rdfe(cilist *a)
-#endif
-{
- int n;
- if(f__init != 1) f_init();
- f__init = 3;
- f__reading=1;
- if(n=c_dfe(a))return(n);
- if(f__curunit->uwrt && f__nowreading(f__curunit))
- err(a->cierr,errno,"read start");
- f__getn = y_getc;
- f__doed = rd_ed;
- f__doned = rd_ned;
- f__dorevert = f__donewrec = y_err;
- f__doend = y_rsk;
- if(pars_f(f__fmtbuf)<0)
- err(a->cierr,100,"read start");
- fmt_bg();
- return(0);
-}
-#ifdef KR_headers
-integer s_wdfe(a) cilist *a;
-#else
-integer s_wdfe(cilist *a)
-#endif
-{
- int n;
- if(f__init != 1) f_init();
- f__init = 3;
- f__reading=0;
- if(n=c_dfe(a)) return(n);
- if(f__curunit->uwrt != 1 && f__nowwriting(f__curunit))
- err(a->cierr,errno,"startwrt");
- f__putn = x_putc;
- f__doed = w_ed;
- f__doned= w_ned;
- f__dorevert = y_err;
- f__donewrec = y_newrec;
- f__doend = y_rev;
- if(pars_f(f__fmtbuf)<0)
- err(a->cierr,100,"startwrt");
- fmt_bg();
- return(0);
-}
-integer e_rdfe(Void)
-{
- f__init = 1;
- en_fio();
- return(0);
-}
-
-integer e_wdfe(Void)
-{
- f__init = 1;
- return en_fio();
-}
diff --git a/contrib/libf2c/libI77/dolio.c b/contrib/libf2c/libI77/dolio.c
deleted file mode 100644
index 1e0c3779bb5d..000000000000
--- a/contrib/libf2c/libI77/dolio.c
+++ /dev/null
@@ -1,21 +0,0 @@
-#include "config.h"
-#include "f2c.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-#ifdef KR_headers
-extern int (*f__lioproc)();
-
-integer do_lio(type,number,ptr,len) ftnint *number,*type; char *ptr; ftnlen len;
-#else
-extern int (*f__lioproc)(ftnint*, char*, ftnlen, ftnint);
-
-integer do_lio(ftnint *type, ftnint *number, char *ptr, ftnlen len)
-#endif
-{
- return((*f__lioproc)(number,ptr,len,*type));
-}
-#ifdef __cplusplus
- }
-#endif
diff --git a/contrib/libf2c/libI77/due.c b/contrib/libf2c/libI77/due.c
deleted file mode 100644
index df3413321500..000000000000
--- a/contrib/libf2c/libI77/due.c
+++ /dev/null
@@ -1,76 +0,0 @@
-#include "config.h"
-#include "f2c.h"
-#include "fio.h"
-
-#ifdef KR_headers
-c_due(a) cilist *a;
-#else
-c_due(cilist *a)
-#endif
-{
- if(f__init != 1) f_init();
- f__init = 3;
- if(a->ciunit>=MXUNIT || a->ciunit<0)
- err(a->cierr,101,"startio");
- f__sequential=f__formatted=f__recpos=0;
- f__external=1;
- f__curunit = &f__units[a->ciunit];
- if(a->ciunit>=MXUNIT || a->ciunit<0)
- err(a->cierr,101,"startio");
- f__elist=a;
- if(f__curunit->ufd==NULL && fk_open(DIR,UNF,a->ciunit) ) err(a->cierr,104,"due");
- f__cf=f__curunit->ufd;
- if(f__curunit->ufmt) err(a->cierr,102,"cdue");
- if(!f__curunit->useek) err(a->cierr,104,"cdue");
- if(f__curunit->ufd==NULL) err(a->cierr,114,"cdue");
- if(a->cirec <= 0)
- err(a->cierr,130,"due");
- fseek(f__cf,(long)(a->cirec-1)*f__curunit->url,SEEK_SET);
- f__curunit->uend = 0;
- return(0);
-}
-#ifdef KR_headers
-integer s_rdue(a) cilist *a;
-#else
-integer s_rdue(cilist *a)
-#endif
-{
- int n;
- f__reading=1;
- if(n=c_due(a)) return(n);
- if(f__curunit->uwrt && f__nowreading(f__curunit))
- err(a->cierr,errno,"read start");
- return(0);
-}
-#ifdef KR_headers
-integer s_wdue(a) cilist *a;
-#else
-integer s_wdue(cilist *a)
-#endif
-{
- int n;
- f__reading=0;
- if(n=c_due(a)) return(n);
- if(f__curunit->uwrt != 1 && f__nowwriting(f__curunit))
- err(a->cierr,errno,"write start");
- return(0);
-}
-integer e_rdue(Void)
-{
- f__init = 1;
- if(f__curunit->url==1 || f__recpos==f__curunit->url)
- return(0);
- fseek(f__cf,(long)(f__curunit->url-f__recpos),SEEK_CUR);
- if(ftell(f__cf)%f__curunit->url)
- err(f__elist->cierr,200,"syserr");
- return(0);
-}
-integer e_wdue(Void)
-{
- f__init = 1;
-#ifdef ALWAYS_FLUSH
- if (fflush(f__cf))
- err(f__elist->cierr,errno,"write end");
-#endif
- return(e_rdue());
-}
diff --git a/contrib/libf2c/libI77/endfile.c b/contrib/libf2c/libI77/endfile.c
deleted file mode 100644
index 980c91d22820..000000000000
--- a/contrib/libf2c/libI77/endfile.c
+++ /dev/null
@@ -1,139 +0,0 @@
-#include "config.h"
-#include "f2c.h"
-#include "fio.h"
-
-#include <sys/types.h>
-#include <unistd.h>
-
-#ifdef KR_headers
-extern char *strcpy();
-extern FILE *tmpfile();
-#else
-#undef abs
-#undef min
-#undef max
-#include <stdlib.h>
-#include <string.h>
-#endif
-
-extern char *f__r_mode[], *f__w_mode[];
-
-#ifdef KR_headers
-integer f_end(a) alist *a;
-#else
-integer f_end(alist *a)
-#endif
-{
- unit *b;
- FILE *tf;
-
- if (f__init & 2)
- f__fatal (131, "I/O recursion");
- if(a->aunit>=MXUNIT || a->aunit<0) err(a->aerr,101,"endfile");
- b = &f__units[a->aunit];
- if(b->ufd==NULL) {
- char nbuf[10];
- sprintf(nbuf,"fort.%ld",(long)a->aunit);
- if (tf = fopen(nbuf, f__w_mode[0]))
- fclose(tf);
- return(0);
- }
- b->uend=1;
- return(b->useek ? t_runc(a) : 0);
-}
-
-#ifndef HAVE_FTRUNCATE
- static int
-#ifdef KR_headers
-copy(from, len, to) FILE *from, *to; register long len;
-#else
-copy(FILE *from, register long len, FILE *to)
-#endif
-{
- int len1;
- char buf[BUFSIZ];
-
- while(fread(buf, len1 = len > BUFSIZ ? BUFSIZ : (int)len, 1, from)) {
- if (!fwrite(buf, len1, 1, to))
- return 1;
- if ((len -= len1) <= 0)
- break;
- }
- return 0;
- }
-#endif /* !defined(HAVE_FTRUNCATE) */
-
- int
-#ifdef KR_headers
-t_runc(a) alist *a;
-#else
-t_runc(alist *a)
-#endif
-{
- long loc, len;
- unit *b;
- int rc;
- FILE *bf;
-#ifndef HAVE_FTRUNCATE
- FILE *tf;
-#endif /* !defined(HAVE_FTRUNCATE) */
-
- b = &f__units[a->aunit];
- if(b->url)
- return(0); /*don't truncate direct files*/
- loc=ftell(bf = b->ufd);
- fseek(bf,0L,SEEK_END);
- len=ftell(bf);
- if (loc >= len || b->useek == 0 || b->ufnm == NULL)
- return(0);
-#ifndef HAVE_FTRUNCATE
- rc = 0;
- fclose(b->ufd);
- if (!loc) {
- if (!(bf = fopen(b->ufnm, f__w_mode[b->ufmt])))
- rc = 1;
- if (b->uwrt)
- b->uwrt = 1;
- goto done;
- }
- if (!(bf = fopen(b->ufnm, f__r_mode[0]))
- || !(tf = tmpfile())) {
-#ifdef NON_UNIX_STDIO
- bad:
-#endif
- rc = 1;
- goto done;
- }
- if (copy(bf, loc, tf)) {
- bad1:
- rc = 1;
- goto done1;
- }
- if (!(bf = freopen(b->ufnm, f__w_mode[0], bf)))
- goto bad1;
- rewind(tf);
- if (copy(tf, loc, bf))
- goto bad1;
- b->uwrt = 1;
- b->urw = 2;
-#ifdef NON_UNIX_STDIO
- if (b->ufmt) {
- fclose(bf);
- if (!(bf = fopen(b->ufnm, f__w_mode[3])))
- goto bad;
- fseek(bf,0L,SEEK_END);
- b->urw = 3;
- }
-#endif
-done1:
- fclose(tf);
-done:
- f__cf = b->ufd = bf;
-#else /* !defined(HAVE_FTRUNCATE) */
- fflush(b->ufd);
- rc = ftruncate(fileno(b->ufd), (off_t)loc);
-#endif /* !defined(HAVE_FTRUNCATE) */
- if (rc)
- err(a->aerr,111,"endfile");
- return 0;
- }
diff --git a/contrib/libf2c/libI77/err.c b/contrib/libf2c/libI77/err.c
deleted file mode 100644
index 6784cdd45766..000000000000
--- a/contrib/libf2c/libI77/err.c
+++ /dev/null
@@ -1,290 +0,0 @@
-#include "config.h"
-#ifndef NON_UNIX_STDIO
-#define _INCLUDE_POSIX_SOURCE /* for HP-UX */
-#define _INCLUDE_XOPEN_SOURCE /* for HP-UX */
-#include <sys/types.h>
-#include <sys/stat.h>
-#endif
-#include "f2c.h"
-#ifdef KR_headers
-extern char *malloc();
-#else
-#undef abs
-#undef min
-#undef max
-#include <stdlib.h>
-#endif
-#include "fio.h"
-#include "fmt.h" /* for struct syl */
-
-/*global definitions*/
-unit f__units[MXUNIT]; /*unit table*/
-int f__init; /*bit 0: set after initializations;
- bit 1: set during I/O involving returns to
- caller of library (or calls to user code)*/
-cilist *f__elist; /*active external io list*/
-icilist *f__svic; /*active internal io list*/
-flag f__reading; /*1 if reading, 0 if writing*/
-flag f__cplus,f__cblank;
-char *f__fmtbuf;
-int f__fmtlen;
-flag f__external; /*1 if external io, 0 if internal */
-#ifdef KR_headers
-int (*f__doed)(),(*f__doned)();
-int (*f__doend)(),(*f__donewrec)(),(*f__dorevert)();
-int (*f__getn)(); /* for formatted input */
-void (*f__putn)(); /* for formatted output */
-#else
-int (*f__getn)(void); /* for formatted input */
-void (*f__putn)(int); /* for formatted output */
-int (*f__doed)(struct syl*, char*, ftnlen),(*f__doned)(struct syl*);
-int (*f__dorevert)(void),(*f__donewrec)(void),(*f__doend)(void);
-#endif
-flag f__sequential; /*1 if sequential io, 0 if direct*/
-flag f__formatted; /*1 if formatted io, 0 if unformatted*/
-FILE *f__cf; /*current file*/
-unit *f__curunit; /*current unit*/
-int f__recpos; /*place in current record*/
-int f__cursor, f__hiwater, f__scale;
-char *f__icptr;
-
-/*error messages*/
-char *F_err[] =
-{
- "error in format", /* 100 */
- "illegal unit number", /* 101 */
- "formatted io not allowed", /* 102 */
- "unformatted io not allowed", /* 103 */
- "direct io not allowed", /* 104 */
- "sequential io not allowed", /* 105 */
- "can't backspace file", /* 106 */
- "null file name", /* 107 */
- "can't stat file", /* 108 */
- "unit not connected", /* 109 */
- "off end of record", /* 110 */
- "truncation failed in endfile", /* 111 */
- "incomprehensible list input", /* 112 */
- "out of free space", /* 113 */
- "unit not connected", /* 114 */
- "read unexpected character", /* 115 */
- "bad logical input field", /* 116 */
- "bad variable type", /* 117 */
- "bad namelist name", /* 118 */
- "variable not in namelist", /* 119 */
- "no end record", /* 120 */
- "variable count incorrect", /* 121 */
- "subscript for scalar variable", /* 122 */
- "invalid array section", /* 123 */
- "substring out of bounds", /* 124 */
- "subscript out of bounds", /* 125 */
- "can't read file", /* 126 */
- "can't write file", /* 127 */
- "'new' file exists", /* 128 */
- "can't append to file", /* 129 */
- "non-positive record number", /* 130 */
- "I/O started while already doing I/O", /* 131 */
- "Temporary file name (TMPDIR?) too long" /* 132 */
-};
-#define MAXERR (sizeof(F_err)/sizeof(char *)+100)
-
-#ifdef KR_headers
-f__canseek(f) FILE *f; /*SYSDEP*/
-#else
-f__canseek(FILE *f) /*SYSDEP*/
-#endif
-{
-#ifdef NON_UNIX_STDIO
- return !isatty(fileno(f));
-#else
- struct stat x;
-
- if (fstat(fileno(f),&x) < 0)
- return(0);
-#ifdef S_IFMT
- switch(x.st_mode & S_IFMT) {
- case S_IFDIR:
- case S_IFREG:
- if(x.st_nlink > 0) /* !pipe */
- return(1);
- else
- return(0);
- case S_IFCHR:
- if(isatty(fileno(f)))
- return(0);
- return(1);
-#ifdef S_IFBLK
- case S_IFBLK:
- return(1);
-#endif
- }
-#else
-#ifdef S_ISDIR
- /* POSIX version */
- if (S_ISREG(x.st_mode) || S_ISDIR(x.st_mode)) {
- if(x.st_nlink > 0) /* !pipe */
- return(1);
- else
- return(0);
- }
- if (S_ISCHR(x.st_mode)) {
- if(isatty(fileno(f)))
- return(0);
- return(1);
- }
- if (S_ISBLK(x.st_mode))
- return(1);
-#else
- Help! How does fstat work on this system?
-#endif
-#endif
- return(0); /* who knows what it is? */
-#endif
-}
-
- void
-#ifdef KR_headers
-f__fatal(n,s) char *s;
-#else
-f__fatal(int n, char *s)
-#endif
-{
- static int dead = 0;
-
- if(n<100 && n>=0) perror(s); /*SYSDEP*/
- else if(n >= (int)MAXERR || n < -1)
- { fprintf(stderr,"%s: illegal error number %d\n",s,n);
- }
- else if(n == -1) fprintf(stderr,"%s: end of file\n",s);
- else
- fprintf(stderr,"%s: %s\n",s,F_err[n-100]);
- if (dead) {
- fprintf (stderr, "(libf2c f__fatal already called, aborting.)");
- abort();
- }
- dead = 1;
- if (f__init & 1) {
- if (f__curunit) {
- fprintf(stderr,"apparent state: unit %d ",
- (int)(f__curunit-f__units));
- fprintf(stderr, f__curunit->ufnm ? "named %s\n" : "(unnamed)\n",
- f__curunit->ufnm);
- }
- else
- fprintf(stderr,"apparent state: internal I/O\n");
- if (f__fmtbuf)
- fprintf(stderr,"last format: %.*s\n",f__fmtlen,f__fmtbuf);
- fprintf(stderr,"lately %s %s %s %s",f__reading?"reading":"writing",
- f__sequential?"sequential":"direct",f__formatted?"formatted":"unformatted",
- f__external?"external":"internal");
- }
- f__init &= ~2; /* No longer doing I/O (no more user code to be called). */
- sig_die(" IO", 1);
-}
-/*initialization routine*/
- VOID
-f_init(Void)
-{ unit *p;
-
- if (f__init & 2)
- f__fatal (131, "I/O recursion");
- f__init = 1;
- p= &f__units[0];
- p->ufd=stderr;
- p->useek=f__canseek(stderr);
- p->ufmt=1;
- p->uwrt=1;
- p = &f__units[5];
- p->ufd=stdin;
- p->useek=f__canseek(stdin);
- p->ufmt=1;
- p->uwrt=0;
- p= &f__units[6];
- p->ufd=stdout;
- p->useek=f__canseek(stdout);
- p->ufmt=1;
- p->uwrt=1;
-}
-#ifdef KR_headers
-f__nowreading(x) unit *x;
-#else
-f__nowreading(unit *x)
-#endif
-{
- long loc;
- int ufmt, urw;
- extern char *f__r_mode[], *f__w_mode[];
-
- if (x->urw & 1)
- goto done;
- if (!x->ufnm)
- goto cantread;
- ufmt = x->url ? 0 : x->ufmt;
- loc = ftell(x->ufd);
- urw = 3;
- if (!freopen(x->ufnm, f__w_mode[ufmt|2], x->ufd)) {
- urw = 1;
- if(!freopen(x->ufnm, f__r_mode[ufmt], x->ufd)) {
- cantread:
- errno = 126;
- return 1;
- }
- }
- fseek(x->ufd,loc,SEEK_SET);
- x->urw = urw;
- done:
- x->uwrt = 0;
- return 0;
-}
-#ifdef KR_headers
-f__nowwriting(x) unit *x;
-#else
-f__nowwriting(unit *x)
-#endif
-{
- long loc;
- int ufmt;
- extern char *f__w_mode[];
-
- if (x->urw & 2)
- goto done;
- if (!x->ufnm)
- goto cantwrite;
- ufmt = x->url ? 0 : x->ufmt;
- if (x->uwrt == 3) { /* just did write, rewind */
- if (!(f__cf = x->ufd =
- freopen(x->ufnm,f__w_mode[ufmt],x->ufd)))
- goto cantwrite;
- x->urw = 2;
- }
- else {
- loc=ftell(x->ufd);
- if (!(f__cf = x->ufd =
- freopen(x->ufnm, f__w_mode[ufmt |= 2], x->ufd)))
- {
- x->ufd = NULL;
- cantwrite:
- errno = 127;
- return(1);
- }
- x->urw = 3;
- fseek(x->ufd,loc,SEEK_SET);
- }
- done:
- x->uwrt = 1;
- return 0;
-}
-
- int
-#ifdef KR_headers
-err__fl(f, m, s) int f, m; char *s;
-#else
-err__fl(int f, int m, char *s)
-#endif
-{
- if (!f)
- f__fatal(m, s);
- if (f__doend)
- (*f__doend)();
- f__init &= ~2;
- return errno = m;
- }
diff --git a/contrib/libf2c/libI77/f2ch.add b/contrib/libf2c/libI77/f2ch.add
deleted file mode 100644
index a2acc17a1596..000000000000
--- a/contrib/libf2c/libI77/f2ch.add
+++ /dev/null
@@ -1,162 +0,0 @@
-/* If you are using a C++ compiler, append the following to f2c.h
- for compiling libF77 and libI77. */
-
-#ifdef __cplusplus
-extern "C" {
-extern int abort_(void);
-extern double c_abs(complex *);
-extern void c_cos(complex *, complex *);
-extern void c_div(complex *, complex *, complex *);
-extern void c_exp(complex *, complex *);
-extern void c_log(complex *, complex *);
-extern void c_sin(complex *, complex *);
-extern void c_sqrt(complex *, complex *);
-extern double d_abs(double *);
-extern double d_acos(double *);
-extern double d_asin(double *);
-extern double d_atan(double *);
-extern double d_atn2(double *, double *);
-extern void d_cnjg(doublecomplex *, doublecomplex *);
-extern double d_cos(double *);
-extern double d_cosh(double *);
-extern double d_dim(double *, double *);
-extern double d_exp(double *);
-extern double d_imag(doublecomplex *);
-extern double d_int(double *);
-extern double d_lg10(double *);
-extern double d_log(double *);
-extern double d_mod(double *, double *);
-extern double d_nint(double *);
-extern double d_prod(float *, float *);
-extern double d_sign(double *, double *);
-extern double d_sin(double *);
-extern double d_sinh(double *);
-extern double d_sqrt(double *);
-extern double d_tan(double *);
-extern double d_tanh(double *);
-extern double derf_(double *);
-extern double derfc_(double *);
-extern integer do_fio(ftnint *, char *, ftnlen);
-extern integer do_lio(ftnint *, ftnint *, char *, ftnlen);
-extern integer do_uio(ftnint *, char *, ftnlen);
-extern integer e_rdfe(void);
-extern integer e_rdue(void);
-extern integer e_rsfe(void);
-extern integer e_rsfi(void);
-extern integer e_rsle(void);
-extern integer e_rsli(void);
-extern integer e_rsue(void);
-extern integer e_wdfe(void);
-extern integer e_wdue(void);
-extern integer e_wsfe(void);
-extern integer e_wsfi(void);
-extern integer e_wsle(void);
-extern integer e_wsli(void);
-extern integer e_wsue(void);
-extern int ef1asc_(ftnint *, ftnlen *, ftnint *, ftnlen *);
-extern integer ef1cmc_(ftnint *, ftnlen *, ftnint *, ftnlen *);
-extern double erf(double);
-extern double erf_(float *);
-extern double erfc(double);
-extern double erfc_(float *);
-extern integer f_back(alist *);
-extern integer f_clos(cllist *);
-extern integer f_end(alist *);
-extern void f_exit(void);
-extern integer f_inqu(inlist *);
-extern integer f_open(olist *);
-extern integer f_rew(alist *);
-extern int flush_(void);
-extern void getarg_(integer *, char *, ftnlen);
-extern void getenv_(char *, char *, ftnlen, ftnlen);
-extern short h_abs(short *);
-extern short h_dim(short *, short *);
-extern short h_dnnt(double *);
-extern short h_indx(char *, char *, ftnlen, ftnlen);
-extern short h_len(char *, ftnlen);
-extern short h_mod(short *, short *);
-extern short h_nint(float *);
-extern short h_sign(short *, short *);
-extern short hl_ge(char *, char *, ftnlen, ftnlen);
-extern short hl_gt(char *, char *, ftnlen, ftnlen);
-extern short hl_le(char *, char *, ftnlen, ftnlen);
-extern short hl_lt(char *, char *, ftnlen, ftnlen);
-extern integer i_abs(integer *);
-extern integer i_dim(integer *, integer *);
-extern integer i_dnnt(double *);
-extern integer i_indx(char *, char *, ftnlen, ftnlen);
-extern integer i_len(char *, ftnlen);
-extern integer i_mod(integer *, integer *);
-extern integer i_nint(float *);
-extern integer i_sign(integer *, integer *);
-extern integer iargc_(void);
-extern ftnlen l_ge(char *, char *, ftnlen, ftnlen);
-extern ftnlen l_gt(char *, char *, ftnlen, ftnlen);
-extern ftnlen l_le(char *, char *, ftnlen, ftnlen);
-extern ftnlen l_lt(char *, char *, ftnlen, ftnlen);
-extern void pow_ci(complex *, complex *, integer *);
-extern double pow_dd(double *, double *);
-extern double pow_di(double *, integer *);
-extern short pow_hh(short *, shortint *);
-extern integer pow_ii(integer *, integer *);
-extern double pow_ri(float *, integer *);
-extern void pow_zi(doublecomplex *, doublecomplex *, integer *);
-extern void pow_zz(doublecomplex *, doublecomplex *, doublecomplex *);
-extern double r_abs(float *);
-extern double r_acos(float *);
-extern double r_asin(float *);
-extern double r_atan(float *);
-extern double r_atn2(float *, float *);
-extern void r_cnjg(complex *, complex *);
-extern double r_cos(float *);
-extern double r_cosh(float *);
-extern double r_dim(float *, float *);
-extern double r_exp(float *);
-extern double r_imag(complex *);
-extern double r_int(float *);
-extern double r_lg10(float *);
-extern double r_log(float *);
-extern double r_mod(float *, float *);
-extern double r_nint(float *);
-extern double r_sign(float *, float *);
-extern double r_sin(float *);
-extern double r_sinh(float *);
-extern double r_sqrt(float *);
-extern double r_tan(float *);
-extern double r_tanh(float *);
-extern void s_cat(char *, char **, integer *, integer *, ftnlen);
-extern integer s_cmp(char *, char *, ftnlen, ftnlen);
-extern void s_copy(char *, char *, ftnlen, ftnlen);
-extern int s_paus(char *, ftnlen);
-extern integer s_rdfe(cilist *);
-extern integer s_rdue(cilist *);
-extern integer s_rnge(char *, integer, char *, integer);
-extern integer s_rsfe(cilist *);
-extern integer s_rsfi(icilist *);
-extern integer s_rsle(cilist *);
-extern integer s_rsli(icilist *);
-extern integer s_rsne(cilist *);
-extern integer s_rsni(icilist *);
-extern integer s_rsue(cilist *);
-extern int s_stop(char *, ftnlen);
-extern integer s_wdfe(cilist *);
-extern integer s_wdue(cilist *);
-extern integer s_wsfe(cilist *);
-extern integer s_wsfi(icilist *);
-extern integer s_wsle(cilist *);
-extern integer s_wsli(icilist *);
-extern integer s_wsne(cilist *);
-extern integer s_wsni(icilist *);
-extern integer s_wsue(cilist *);
-extern void sig_die(char *, int);
-extern integer signal_(integer *, void (*)(int));
-extern integer system_(char *, ftnlen);
-extern double z_abs(doublecomplex *);
-extern void z_cos(doublecomplex *, doublecomplex *);
-extern void z_div(doublecomplex *, doublecomplex *, doublecomplex *);
-extern void z_exp(doublecomplex *, doublecomplex *);
-extern void z_log(doublecomplex *, doublecomplex *);
-extern void z_sin(doublecomplex *, doublecomplex *);
-extern void z_sqrt(doublecomplex *, doublecomplex *);
- }
-#endif
diff --git a/contrib/libf2c/libI77/fio.h b/contrib/libf2c/libI77/fio.h
deleted file mode 100644
index 846351d5413f..000000000000
--- a/contrib/libf2c/libI77/fio.h
+++ /dev/null
@@ -1,110 +0,0 @@
-#include <stdio.h>
-#include <errno.h>
-#ifndef NULL
-/* ANSI C */
-#include <stddef.h>
-#endif
-#ifdef STDC_HEADERS
-#include <string.h>
-#endif
-
-#ifndef SEEK_SET
-#define SEEK_SET 0
-#define SEEK_CUR 1
-#define SEEK_END 2
-#endif
-
-#if defined (MSDOS) && !defined (GO32)
-#ifndef NON_UNIX_STDIO
-#define NON_UNIX_STDIO
-#endif
-#endif
-
-#ifdef UIOLEN_int
-typedef int uiolen;
-#else
-typedef long uiolen;
-#endif
-
-/*units*/
-typedef struct
-{ FILE *ufd; /*0=unconnected*/
- char *ufnm;
-#if !(defined (MSDOS) && !defined (GO32))
- long uinode;
- int udev;
-#endif
- int url; /*0=sequential*/
- flag useek; /*true=can backspace, use dir, ...*/
- flag ufmt;
- flag urw; /* (1 for can read) | (2 for can write) */
- flag ublnk;
- flag uend;
- flag uwrt; /*last io was write*/
- flag uscrtch;
-} unit;
-
-extern int f__init;
-extern cilist *f__elist; /*active external io list*/
-extern flag f__reading,f__external,f__sequential,f__formatted;
-#undef Void
-#ifdef KR_headers
-#define Void /*void*/
-extern int (*f__getn)(); /* for formatted input */
-extern void (*f__putn)(); /* for formatted output */
-extern void x_putc();
-extern long f__inode();
-extern VOID sig_die();
-extern int (*f__donewrec)(), t_putc(), x_wSL();
-extern int c_sfe(), err__fl(), xrd_SL(), f__putbuf();
-#else
-#define Void void
-#ifdef __cplusplus
-extern "C" {
-#endif
-extern int (*f__getn)(void); /* for formatted input */
-extern void (*f__putn)(int); /* for formatted output */
-extern void x_putc(int);
-extern long f__inode(char*,int*);
-extern void sig_die(char*,int);
-extern void f__fatal(int,char*);
-extern int t_runc(alist*);
-extern int f__nowreading(unit*), f__nowwriting(unit*);
-extern int fk_open(int,int,ftnint);
-extern int en_fio(void);
-extern void f_init(void);
-extern int (*f__donewrec)(void), t_putc(int), x_wSL(void);
-extern void b_char(char*,char*,ftnlen), g_char(char*,ftnlen,char*);
-extern int c_sfe(cilist*), z_rnew(void);
-extern int isatty(int);
-extern int err__fl(int,int,char*);
-extern int xrd_SL(void);
-extern int f__putbuf(int);
-#ifdef __cplusplus
- }
-#endif
-#endif
-extern int (*f__doend)(Void);
-extern FILE *f__cf; /*current file*/
-extern unit *f__curunit; /*current unit*/
-extern unit f__units[];
-#define err(f,m,s) do {if(f) {f__init &= ~2; errno= m;} else f__fatal(m,s); return(m);} while(0)
-#define errfl(f,m,s) do {return err__fl((int)f,m,s);} while(0)
-
-/*Table sizes*/
-#define MXUNIT 100
-
-extern int f__recpos; /*position in current record*/
-extern int f__cursor; /* offset to move to */
-extern int f__hiwater; /* so TL doesn't confuse us */
-
-#define WRITE 1
-#define READ 2
-#define SEQ 3
-#define DIR 4
-#define FMT 5
-#define UNF 6
-#define EXT 7
-#define INT 8
-
-#define buf_end(x) (x->_flag & _IONBF ? x->_ptr : x->_base + BUFSIZ)
diff --git a/contrib/libf2c/libI77/fmt.c b/contrib/libf2c/libI77/fmt.c
deleted file mode 100644
index 793dceb53b8e..000000000000
--- a/contrib/libf2c/libI77/fmt.c
+++ /dev/null
@@ -1,544 +0,0 @@
-#include "config.h"
-#include "f2c.h"
-#include "fio.h"
-#include "fmt.h"
-#define skip(s) while(*s==' ') s++
-#ifdef interdata
-#define SYLMX 300
-#endif
-#ifdef pdp11
-#define SYLMX 300
-#endif
-#ifdef vax
-#define SYLMX 300
-#endif
-#ifndef SYLMX
-#define SYLMX 300
-#endif
-#define GLITCH '\2'
- /* special quote character for stu */
-extern int f__cursor,f__scale;
-extern flag f__cblank,f__cplus; /*blanks in I and compulsory plus*/
-static struct syl f__syl[SYLMX];
-int f__parenlvl,f__pc,f__revloc;
-
- static
-#ifdef KR_headers
-char *ap_end(s) char *s;
-#else
-char *ap_end(char *s)
-#endif
-{ char quote;
- quote= *s++;
- for(;*s;s++)
- { if(*s!=quote) continue;
- if(*++s!=quote) return(s);
- }
- if(f__elist->cierr) {
- errno = 100;
- return(NULL);
- }
- f__fatal(100, "bad string");
- /*NOTREACHED*/ return 0;
-}
- static
-#ifdef KR_headers
-op_gen(a,b,c,d)
-#else
-op_gen(int a, int b, int c, int d)
-#endif
-{ struct syl *p= &f__syl[f__pc];
- if(f__pc>=SYLMX)
- { fprintf(stderr,"format too complicated:\n");
- sig_die(f__fmtbuf, 1);
- }
- p->op=a;
- p->p1=b;
- p->p2.i[0]=c;
- p->p2.i[1]=d;
- return(f__pc++);
-}
-#ifdef KR_headers
-static char *f_list();
-static char *gt_num(s,n,n1) char *s; int *n, n1;
-#else
-static char *f_list(char*);
-static char *gt_num(char *s, int *n, int n1)
-#endif
-{ int m=0,f__cnt=0;
- char c;
- for(c= *s;;c = *s)
- { if(c==' ')
- { s++;
- continue;
- }
- if(c>'9' || c<'0') break;
- m=10*m+c-'0';
- f__cnt++;
- s++;
- }
- if(f__cnt==0) {
- if (!n1)
- s = 0;
- *n=n1;
- }
- else *n=m;
- return(s);
-}
-
- static
-#ifdef KR_headers
-char *f_s(s,curloc) char *s;
-#else
-char *f_s(char *s, int curloc)
-#endif
-{
- skip(s);
- if(*s++!='(')
- {
- return(NULL);
- }
- if(f__parenlvl++ ==1) f__revloc=curloc;
- if(op_gen(RET1,curloc,0,0)<0 ||
- (s=f_list(s))==NULL)
- {
- return(NULL);
- }
- return(s);
-}
-
- static
-#ifdef KR_headers
-ne_d(s,p) char *s,**p;
-#else
-ne_d(char *s, char **p)
-#endif
-{ int n,x,sign=0;
- struct syl *sp;
- switch(*s)
- {
- default:
- return(0);
- case ':': (void) op_gen(COLON,0,0,0); break;
- case '$':
- (void) op_gen(NONL, 0, 0, 0); break;
- case 'B':
- case 'b':
- if(*++s=='z' || *s == 'Z') (void) op_gen(BZ,0,0,0);
- else (void) op_gen(BN,0,0,0);
- break;
- case 'S':
- case 's':
- if(*(s+1)=='s' || *(s+1) == 'S')
- { x=SS;
- s++;
- }
- else if(*(s+1)=='p' || *(s+1) == 'P')
- { x=SP;
- s++;
- }
- else x=S;
- (void) op_gen(x,0,0,0);
- break;
- case '/': (void) op_gen(SLASH,0,0,0); break;
- case '-': sign=1;
- case '+': s++; /*OUTRAGEOUS CODING TRICK*/
- case '0': case '1': case '2': case '3': case '4':
- case '5': case '6': case '7': case '8': case '9':
- if (!(s=gt_num(s,&n,0))) {
- bad: *p = 0;
- return 1;
- }
- switch(*s)
- {
- default:
- return(0);
- case 'P':
- case 'p': if(sign) n= -n; (void) op_gen(P,n,0,0); break;
- case 'X':
- case 'x': (void) op_gen(X,n,0,0); break;
- case 'H':
- case 'h':
- sp = &f__syl[op_gen(H,n,0,0)];
- sp->p2.s = s + 1;
- s+=n;
- break;
- }
- break;
- case GLITCH:
- case '"':
- case '\'':
- sp = &f__syl[op_gen(APOS,0,0,0)];
- sp->p2.s = s;
- if((*p = ap_end(s)) == NULL)
- return(0);
- return(1);
- case 'T':
- case 't':
- if(*(s+1)=='l' || *(s+1) == 'L')
- { x=TL;
- s++;
- }
- else if(*(s+1)=='r'|| *(s+1) == 'R')
- { x=TR;
- s++;
- }
- else x=T;
- if (!(s=gt_num(s+1,&n,0)))
- goto bad;
- s--;
- (void) op_gen(x,n,0,0);
- break;
- case 'X':
- case 'x': (void) op_gen(X,1,0,0); break;
- case 'P':
- case 'p': (void) op_gen(P,1,0,0); break;
- }
- s++;
- *p=s;
- return(1);
-}
-
- static
-#ifdef KR_headers
-e_d(s,p) char *s,**p;
-#else
-e_d(char *s, char **p)
-#endif
-{ int i,im,n,w,d,e,found=0,x=0;
- char *sv=s;
- s=gt_num(s,&n,1);
- (void) op_gen(STACK,n,0,0);
- switch(*s++)
- {
- default: break;
- case 'E':
- case 'e': x=1;
- case 'G':
- case 'g':
- found=1;
- if (!(s=gt_num(s,&w,0))) {
- bad:
- *p = 0;
- return 1;
- }
- if(w==0) break;
- if(*s=='.') {
- if (!(s=gt_num(s+1,&d,0)))
- goto bad;
- }
- else d=0;
- if(*s!='E' && *s != 'e')
- (void) op_gen(x==1?E:G,w,d,0); /* default is Ew.dE2 */
- else {
- if (!(s=gt_num(s+1,&e,0)))
- goto bad;
- (void) op_gen(x==1?EE:GE,w,d,e);
- }
- break;
- case 'O':
- case 'o':
- i = O;
- im = OM;
- goto finish_I;
- case 'Z':
- case 'z':
- i = Z;
- im = ZM;
- goto finish_I;
- case 'L':
- case 'l':
- found=1;
- if (!(s=gt_num(s,&w,0)))
- goto bad;
- if(w==0) break;
- (void) op_gen(L,w,0,0);
- break;
- case 'A':
- case 'a':
- found=1;
- skip(s);
- if(*s>='0' && *s<='9')
- { s=gt_num(s,&w,1);
- if(w==0) break;
- (void) op_gen(AW,w,0,0);
- break;
- }
- (void) op_gen(A,0,0,0);
- break;
- case 'F':
- case 'f':
- if (!(s=gt_num(s,&w,0)))
- goto bad;
- found=1;
- if(w==0) break;
- if(*s=='.') {
- if (!(s=gt_num(s+1,&d,0)))
- goto bad;
- }
- else d=0;
- (void) op_gen(F,w,d,0);
- break;
- case 'D':
- case 'd':
- found=1;
- if (!(s=gt_num(s,&w,0)))
- goto bad;
- if(w==0) break;
- if(*s=='.') {
- if (!(s=gt_num(s+1,&d,0)))
- goto bad;
- }
- else d=0;
- (void) op_gen(D,w,d,0);
- break;
- case 'I':
- case 'i':
- i = I;
- im = IM;
- finish_I:
- if (!(s=gt_num(s,&w,0)))
- goto bad;
- found=1;
- if(w==0) break;
- if(*s!='.')
- { (void) op_gen(i,w,0,0);
- break;
- }
- if (!(s=gt_num(s+1,&d,0)))
- goto bad;
- (void) op_gen(im,w,d,0);
- break;
- }
- if(found==0)
- { f__pc--; /*unSTACK*/
- *p=sv;
- return(0);
- }
- *p=s;
- return(1);
-}
- static
-#ifdef KR_headers
-char *i_tem(s) char *s;
-#else
-char *i_tem(char *s)
-#endif
-{ char *t;
- int n,curloc;
- if(*s==')') return(s);
- if(ne_d(s,&t)) return(t);
- if(e_d(s,&t)) return(t);
- s=gt_num(s,&n,1);
- if((curloc=op_gen(STACK,n,0,0))<0) return(NULL);
- return(f_s(s,curloc));
-}
-
- static
-#ifdef KR_headers
-char *f_list(s) char *s;
-#else
-char *f_list(char *s)
-#endif
-{
- for(;*s!=0;)
- { skip(s);
- if((s=i_tem(s))==NULL) return(NULL);
- skip(s);
- if(*s==',') s++;
- else if(*s==')')
- { if(--f__parenlvl==0)
- {
- (void) op_gen(REVERT,f__revloc,0,0);
- return(++s);
- }
- (void) op_gen(GOTO,0,0,0);
- return(++s);
- }
- }
- return(NULL);
-}
-
-#ifdef KR_headers
-pars_f(s) char *s;
-#else
-pars_f(char *s)
-#endif
-{
- char *e;
-
- f__parenlvl=f__revloc=f__pc=0;
- if((e=f_s(s,0)) == NULL)
- {
- /* Try and delimit the format string. Parens within
- hollerith and quoted strings have to match for this
- to work, but it's probably adequate for most needs.
- Note that this is needed because a valid CHARACTER
- variable passed for FMT= can contain '(I)garbage',
- where `garbage' is billions and billions of junk
- characters, and it's up to the run-time library to
- know where the format string ends by counting parens.
- Meanwhile, still treat NUL byte as "hard stop", since
- f2c still appends that at end of FORMAT-statement
- strings. */
-
- int level=0;
-
- for (f__fmtlen=0;
- ((*s!=')') || (--level > 0))
- && (*s!='\0')
- && (f__fmtlen<80);
- ++s, ++f__fmtlen)
- {
- if (*s=='(')
- ++level;
- }
- if (*s==')')
- ++f__fmtlen;
- return(-1);
- }
- f__fmtlen = e - s;
- return(0);
-}
-#define STKSZ 10
-int f__cnt[STKSZ],f__ret[STKSZ],f__cp,f__rp;
-flag f__workdone, f__nonl;
-
- static
-#ifdef KR_headers
-type_f(n)
-#else
-type_f(int n)
-#endif
-{
- switch(n)
- {
- default:
- return(n);
- case RET1:
- return(RET1);
- case REVERT: return(REVERT);
- case GOTO: return(GOTO);
- case STACK: return(STACK);
- case X:
- case SLASH:
- case APOS: case H:
- case T: case TL: case TR:
- return(NED);
- case F:
- case I:
- case IM:
- case A: case AW:
- case O: case OM:
- case L:
- case E: case EE: case D:
- case G: case GE:
- case Z: case ZM:
- return(ED);
- }
-}
-#ifdef KR_headers
-integer do_fio(number,ptr,len) ftnint *number; ftnlen len; char *ptr;
-#else
-integer do_fio(ftnint *number, char *ptr, ftnlen len)
-#endif
-{ struct syl *p;
- int n,i;
- for(i=0;i<*number;i++,ptr+=len)
- {
-loop: switch(type_f((p= &f__syl[f__pc])->op))
- {
- default:
- fprintf(stderr,"unknown code in do_fio: %d\n%.*s\n",
- p->op,f__fmtlen,f__fmtbuf);
- err(f__elist->cierr,100,"do_fio");
- case NED:
- if((*f__doned)(p))
- { f__pc++;
- goto loop;
- }
- f__pc++;
- continue;
- case ED:
- if(f__cnt[f__cp]<=0)
- { f__cp--;
- f__pc++;
- goto loop;
- }
- if(ptr==NULL)
- return((*f__doend)());
- f__cnt[f__cp]--;
- f__workdone=1;
- if((n=(*f__doed)(p,ptr,len))>0)
- errfl(f__elist->cierr,errno,"fmt");
- if(n<0)
- err(f__elist->ciend,(EOF),"fmt");
- continue;
- case STACK:
- f__cnt[++f__cp]=p->p1;
- f__pc++;
- goto loop;
- case RET1:
- f__ret[++f__rp]=p->p1;
- f__pc++;
- goto loop;
- case GOTO:
- if(--f__cnt[f__cp]<=0)
- { f__cp--;
- f__rp--;
- f__pc++;
- goto loop;
- }
- f__pc=1+f__ret[f__rp--];
- goto loop;
- case REVERT:
- f__rp=f__cp=0;
- f__pc = p->p1;
- if(ptr==NULL)
- return((*f__doend)());
- if(!f__workdone) return(0);
- if((n=(*f__dorevert)()) != 0) return(n);
- goto loop;
- case COLON:
- if(ptr==NULL)
- return((*f__doend)());
- f__pc++;
- goto loop;
- case NONL:
- f__nonl = 1;
- f__pc++;
- goto loop;
- case S:
- case SS:
- f__cplus=0;
- f__pc++;
- goto loop;
- case SP:
- f__cplus = 1;
- f__pc++;
- goto loop;
- case P: f__scale=p->p1;
- f__pc++;
- goto loop;
- case BN:
- f__cblank=0;
- f__pc++;
- goto loop;
- case BZ:
- f__cblank=1;
- f__pc++;
- goto loop;
- }
- }
- return(0);
-}
-en_fio(Void)
-{ ftnint one=1;
- return(do_fio(&one,(char *)NULL,(ftnint)0));
-}
- VOID
-fmt_bg(Void)
-{
- f__workdone=f__cp=f__rp=f__pc=f__cursor=0;
- f__cnt[0]=f__ret[0]=0;
-}
diff --git a/contrib/libf2c/libI77/fmt.h b/contrib/libf2c/libI77/fmt.h
deleted file mode 100644
index 6197e76ed5a4..000000000000
--- a/contrib/libf2c/libI77/fmt.h
+++ /dev/null
@@ -1,101 +0,0 @@
-struct syl
-{ int op;
- int p1;
- union { int i[2]; char *s;} p2;
- };
-#define RET1 1
-#define REVERT 2
-#define GOTO 3
-#define X 4
-#define SLASH 5
-#define STACK 6
-#define I 7
-#define ED 8
-#define NED 9
-#define IM 10
-#define APOS 11
-#define H 12
-#define TL 13
-#define TR 14
-#define T 15
-#define COLON 16
-#define S 17
-#define SP 18
-#define SS 19
-#define P 20
-#define BN 21
-#define BZ 22
-#define F 23
-#define E 24
-#define EE 25
-#define D 26
-#define G 27
-#define GE 28
-#define L 29
-#define A 30
-#define AW 31
-#define O 32
-#define NONL 33
-#define OM 34
-#define Z 35
-#define ZM 36
-extern int f__pc,f__parenlvl,f__revloc;
-typedef union
-{ real pf;
- doublereal pd;
-} ufloat;
-typedef union
-{ short is;
-#ifndef KR_headers
- signed
-#endif
- char ic;
- integer il;
-#ifdef Allow_TYQUAD
- longint ili;
-#endif
-} Uint;
-#ifdef KR_headers
-extern int (*f__doed)(),(*f__doned)();
-extern int (*f__dorevert)();
-extern int rd_ed(),rd_ned();
-extern int w_ed(),w_ned();
-#else
-#ifdef __cplusplus
-extern "C" {
-#endif
-extern int (*f__doed)(struct syl*, char*, ftnlen),(*f__doned)(struct syl*);
-extern int (*f__dorevert)(void);
-extern void fmt_bg(void);
-extern int pars_f(char*);
-extern int rd_ed(struct syl*, char*, ftnlen),rd_ned(struct syl*);
-extern int w_ed(struct syl*, char*, ftnlen),w_ned(struct syl*);
-extern int wrt_E(ufloat*, int, int, int, ftnlen);
-extern int wrt_F(ufloat*, int, int, ftnlen);
-extern int wrt_L(Uint*, int, ftnlen);
-#ifdef __cplusplus
- }
-#endif
-#endif
-extern flag f__cblank,f__cplus,f__workdone, f__nonl;
-extern char *f__fmtbuf;
-extern int f__fmtlen;
-extern int f__scale;
-#define GET(x) if((x=(*f__getn)())<0) return(x)
-#define VAL(x) (x!='\n'?x:' ')
-#define PUT(x) (*f__putn)(x)
-extern int f__cursor;
-
-#undef TYQUAD
-#ifndef Allow_TYQUAD
-#undef longint
-#define longint long
-#else
-#define TYQUAD 14
-#endif
-
-#ifdef KR_headers
-extern char *f__icvt();
-#else
-extern char *f__icvt(longint, int*, int*, int);
-#endif
diff --git a/contrib/libf2c/libI77/fmtlib.c b/contrib/libf2c/libI77/fmtlib.c
deleted file mode 100644
index 69c0d9b406fc..000000000000
--- a/contrib/libf2c/libI77/fmtlib.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/* @(#)fmtlib.c 1.2 */
-#define MAXINTLENGTH 23
-#include "config.h"
-
-#include "f2c.h"
-#ifndef Allow_TYQUAD
-#undef longint
-#define longint long
-#undef ulongint
-#define ulongint unsigned long
-#endif
-
-#ifdef KR_headers
-char *f__icvt(value,ndigit,sign, base) longint value; int *ndigit,*sign;
- register int base;
-#else
-char *f__icvt(longint value, int *ndigit, int *sign, int base)
-#endif
-{
- static char buf[MAXINTLENGTH+1];
- register int i;
- ulongint uvalue;
-
- if(value > 0) {
- uvalue = value;
- *sign = 0;
- }
- else if (value < 0) {
- uvalue = -value;
- *sign = 1;
- }
- else {
- *sign = 0;
- *ndigit = 1;
- buf[MAXINTLENGTH-1] = '0';
- return &buf[MAXINTLENGTH-1];
- }
- i = MAXINTLENGTH;
- do {
- buf[--i] = (uvalue%base) + '0';
- uvalue /= base;
- }
- while(uvalue > 0);
- *ndigit = MAXINTLENGTH - i;
- return &buf[i];
- }
diff --git a/contrib/libf2c/libI77/fp.h b/contrib/libf2c/libI77/fp.h
deleted file mode 100644
index 40743d79f748..000000000000
--- a/contrib/libf2c/libI77/fp.h
+++ /dev/null
@@ -1,28 +0,0 @@
-#define FMAX 40
-#define EXPMAXDIGS 8
-#define EXPMAX 99999999
-/* FMAX = max number of nonzero digits passed to atof() */
-/* EXPMAX = 10^EXPMAXDIGS - 1 = largest allowed exponent absolute value */
-
-#ifdef V10 /* Research Tenth-Edition Unix */
-#include "local.h"
-#endif
-
-/* MAXFRACDIGS and MAXINTDIGS are for wrt_F -- bounds (not necessarily
- tight) on the maximum number of digits to the right and left of
- * the decimal point.
- */
-
-#ifdef VAX
-#define MAXFRACDIGS 56
-#define MAXINTDIGS 38
-#else
-#ifdef CRAY
-#define MAXFRACDIGS 9880
-#define MAXINTDIGS 9864
-#else
-/* values that suffice for IEEE double */
-#define MAXFRACDIGS 344
-#define MAXINTDIGS 308
-#endif
-#endif
diff --git a/contrib/libf2c/libI77/ftell_.c b/contrib/libf2c/libI77/ftell_.c
deleted file mode 100644
index 1f6d87f50bd5..000000000000
--- a/contrib/libf2c/libI77/ftell_.c
+++ /dev/null
@@ -1,47 +0,0 @@
-#include "config.h"
-#include "f2c.h"
-#include "fio.h"
-
- static FILE *
-#ifdef KR_headers
-unit_chk(Unit, who) integer Unit; char *who;
-#else
-unit_chk(integer Unit, char *who)
-#endif
-{
- if (Unit >= MXUNIT || Unit < 0)
- f__fatal(101, who);
- return f__units[Unit].ufd;
- }
-
- integer
-#ifdef KR_headers
-G77_ftell_0 (Unit) integer *Unit;
-#else
-G77_ftell_0 (integer *Unit)
-#endif
-{
- FILE *f;
- return (f = unit_chk(*Unit, "ftell")) ? ftell(f) : -1L;
- }
-
- integer
-#ifdef KR_headers
-G77_fseek_0 (Unit, offset, xwhence) integer *Unit, *offset, *xwhence;
-#else
-G77_fseek_0 (integer *Unit, integer *offset, integer *xwhence)
-#endif
-{
- FILE *f;
- int w = (int)*xwhence;
-#ifdef SEEK_SET
- static int wohin[3] = { SEEK_SET, SEEK_CUR, SEEK_END };
-#endif
- if (w < 0 || w > 2)
- w = 0;
-#ifdef SEEK_SET
- w = wohin[w];
-#endif
- return !(f = unit_chk(*Unit, "fseek"))
- || fseek(f, *offset, w) ? 1 : 0;
- }
diff --git a/contrib/libf2c/libI77/iio.c b/contrib/libf2c/libI77/iio.c
deleted file mode 100644
index 931f15aab631..000000000000
--- a/contrib/libf2c/libI77/iio.c
+++ /dev/null
@@ -1,154 +0,0 @@
-#include "f2c.h"
-#include "fio.h"
-#include "fmt.h"
-extern char *f__icptr;
-char *f__icend;
-extern icilist *f__svic;
-int f__icnum;
-extern int f__hiwater;
-z_getc(Void)
-{
- if(f__recpos++ < f__svic->icirlen) {
- if(f__icptr >= f__icend) err(f__svic->iciend,(EOF),"endfile");
- return(*(unsigned char *)f__icptr++);
- }
- return '\n';
-}
-
- void
-#ifdef KR_headers
-z_putc(c)
-#else
-z_putc(int c)
-#endif
-{
- if (f__icptr < f__icend && f__recpos++ < f__svic->icirlen)
- *f__icptr++ = c;
-}
-z_rnew(Void)
-{
- f__icptr = f__svic->iciunit + (++f__icnum)*f__svic->icirlen;
- f__recpos = 0;
- f__cursor = 0;
- f__hiwater = 0;
- return 1;
-}
-
- static int
-z_endp(Void)
-{
- (*f__donewrec)();
- return 0;
- }
-
-#ifdef KR_headers
-c_si(a) icilist *a;
-#else
-c_si(icilist *a)
-#endif
-{
- if (f__init & 2)
- f__fatal (131, "I/O recursion");
- f__init |= 2;
- f__elist = (cilist *)a;
- f__fmtbuf=a->icifmt;
- f__curunit = 0;
- f__sequential=f__formatted=1;
- f__external=0;
- if(pars_f(f__fmtbuf)<0)
- err(a->icierr,100,"startint");
- fmt_bg();
- f__cblank=f__cplus=f__scale=0;
- f__svic=a;
- f__icnum=f__recpos=0;
- f__cursor = 0;
- f__hiwater = 0;
- f__icptr = a->iciunit;
- f__icend = f__icptr + a->icirlen*a->icirnum;
- f__cf = 0;
- return(0);
-}
-
- int
-iw_rev(Void)
-{
- if(f__workdone)
- z_endp();
- f__hiwater = f__recpos = f__cursor = 0;
- return(f__workdone=0);
- }
-
-#ifdef KR_headers
-integer s_rsfi(a) icilist *a;
-#else
-integer s_rsfi(icilist *a)
-#endif
-{ int n;
- if(n=c_si(a)) return(n);
- f__reading=1;
- f__doed=rd_ed;
- f__doned=rd_ned;
- f__getn=z_getc;
- f__dorevert = z_endp;
- f__donewrec = z_rnew;
- f__doend = z_endp;
- return(0);
-}
-
-z_wnew(Void)
-{
- if (f__recpos < f__hiwater) {
- f__icptr += f__hiwater - f__recpos;
- f__recpos = f__hiwater;
- }
- while(f__recpos++ < f__svic->icirlen)
- *f__icptr++ = ' ';
- f__recpos = 0;
- f__cursor = 0;
- f__hiwater = 0;
- f__icnum++;
- return 1;
-}
-#ifdef KR_headers
-integer s_wsfi(a) icilist *a;
-#else
-integer s_wsfi(icilist *a)
-#endif
-{ int n;
- if(n=c_si(a)) return(n);
- f__reading=0;
- f__doed=w_ed;
- f__doned=w_ned;
- f__putn=z_putc;
- f__dorevert = iw_rev;
- f__donewrec = z_wnew;
- f__doend = z_endp;
- return(0);
-}
-integer e_rsfi(Void)
-{ int n;
- f__init &= ~2;
- n = en_fio();
- f__fmtbuf = NULL;
- return(n);
-}
-integer e_wsfi(Void)
-{
- int n;
- f__init &= ~2;
- n = en_fio();
- f__fmtbuf = NULL;
- if(f__svic->icirnum != 1
- && (f__icnum > f__svic->icirnum
- || (f__icnum == f__svic->icirnum && (f__recpos | f__hiwater))))
- err(f__svic->icierr,110,"inwrite");
- if (f__recpos < f__hiwater)
- f__recpos = f__hiwater;
- if (f__recpos >= f__svic->icirlen)
- err(f__svic->icierr,110,"recend");
- if (!f__recpos && f__icnum)
- return n;
- while(f__recpos++ < f__svic->icirlen)
- *f__icptr++ = ' ';
- return n;
-}
diff --git a/contrib/libf2c/libI77/ilnw.c b/contrib/libf2c/libI77/ilnw.c
deleted file mode 100644
index 58fca0d326a7..000000000000
--- a/contrib/libf2c/libI77/ilnw.c
+++ /dev/null
@@ -1,83 +0,0 @@
-#include "config.h"
-#include "f2c.h"
-#include "fio.h"
-#include "lio.h"
-extern char *f__icptr;
-extern char *f__icend;
-extern icilist *f__svic;
-extern int f__icnum;
-#ifdef KR_headers
-extern void z_putc();
-#else
-extern void z_putc(int);
-#endif
-
- static int
-z_wSL(Void)
-{
- while(f__recpos < f__svic->icirlen)
- z_putc(' ');
- return z_rnew();
- }
-
- static void
-#ifdef KR_headers
-c_liw(a) icilist *a;
-#else
-c_liw(icilist *a)
-#endif
-{
- f__reading = 0;
- f__external = 0;
- f__formatted = 1;
- f__putn = z_putc;
- L_len = a->icirlen;
- f__donewrec = z_wSL;
- f__svic = a;
- f__icnum = f__recpos = 0;
- f__cursor = 0;
- f__cf = 0;
- f__curunit = 0;
- f__icptr = a->iciunit;
- f__icend = f__icptr + a->icirlen*a->icirnum;
- f__elist = (cilist *)a;
- }
-
- integer
-#ifdef KR_headers
-s_wsni(a) icilist *a;
-#else
-s_wsni(icilist *a)
-#endif
-{
- cilist ca;
-
- if(f__init != 1) f_init();
- f__init = 3;
- c_liw(a);
- ca.cifmt = a->icifmt;
- x_wsne(&ca);
- z_wSL();
- return 0;
- }
-
- integer
-#ifdef KR_headers
-s_wsli(a) icilist *a;
-#else
-s_wsli(icilist *a)
-#endif
-{
- if(f__init != 1) f_init();
- f__init = 3;
- f__lioproc = l_write;
- c_liw(a);
- return(0);
- }
-
-integer e_wsli(Void)
-{
- f__init = 1;
- z_wSL();
- return(0);
- }
diff --git a/contrib/libf2c/libI77/inquire.c b/contrib/libf2c/libI77/inquire.c
deleted file mode 100644
index 71eb700a57a1..000000000000
--- a/contrib/libf2c/libI77/inquire.c
+++ /dev/null
@@ -1,109 +0,0 @@
-#include "config.h"
-#include "f2c.h"
-#include "fio.h"
-#include <string.h>
-#ifdef KR_headers
-integer f_inqu(a) inlist *a;
-#else
-#if defined (MSDOS) && !defined (GO32)
-#undef abs
-#undef min
-#undef max
-#include "io.h"
-#endif
-integer f_inqu(inlist *a)
-#endif
-{ flag byfile;
- int i, n;
- unit *p;
- char buf[256];
- long x;
- if (f__init & 2)
- f__fatal (131, "I/O recursion");
- if(a->infile!=NULL)
- { byfile=1;
- g_char(a->infile,a->infilen,buf);
-#ifdef NON_UNIX_STDIO
- x = access(buf,0) ? -1 : 0;
- for(i=0,p=NULL;i<MXUNIT;i++)
- if(f__units[i].ufd != NULL
- && f__units[i].ufnm != NULL
- && !strcmp(f__units[i].ufnm,buf)) {
- p = &f__units[i];
- break;
- }
-#else
- x=f__inode(buf, &n);
- for(i=0,p=NULL;i<MXUNIT;i++)
- if(f__units[i].uinode==x
- && f__units[i].ufd!=NULL
- && f__units[i].udev == n) {
- p = &f__units[i];
- break;
- }
-#endif
- }
- else
- {
- byfile=0;
- if(a->inunit<MXUNIT && a->inunit>=0)
- {
- p= &f__units[a->inunit];
- }
- else
- {
- p=NULL;
- }
- }
- if(a->inex!=NULL)
- if(byfile && x != -1 || !byfile && p!=NULL)
- *a->inex=1;
- else *a->inex=0;
- if(a->inopen!=NULL)
- if(byfile) *a->inopen=(p!=NULL);
- else *a->inopen=(p!=NULL && p->ufd!=NULL);
- if(a->innum!=NULL) *a->innum= p-f__units;
- if(a->innamed!=NULL)
- if(byfile || p!=NULL && p->ufnm!=NULL)
- *a->innamed=1;
- else *a->innamed=0;
- if(a->inname!=NULL)
- if(byfile)
- b_char(buf,a->inname,a->innamlen);
- else if(p!=NULL && p->ufnm!=NULL)
- b_char(p->ufnm,a->inname,a->innamlen);
- if(a->inacc!=NULL && p!=NULL && p->ufd!=NULL)
- if(p->url)
- b_char("DIRECT",a->inacc,a->inacclen);
- else b_char("SEQUENTIAL",a->inacc,a->inacclen);
- if(a->inseq!=NULL)
- if(p!=NULL && p->url)
- b_char("NO",a->inseq,a->inseqlen);
- else b_char("YES",a->inseq,a->inseqlen);
- if(a->indir!=NULL)
- if(p==NULL || p->url)
- b_char("YES",a->indir,a->indirlen);
- else b_char("NO",a->indir,a->indirlen);
- if(a->infmt!=NULL)
- if(p!=NULL && p->ufmt==0)
- b_char("UNFORMATTED",a->infmt,a->infmtlen);
- else b_char("FORMATTED",a->infmt,a->infmtlen);
- if(a->inform!=NULL)
- if(p!=NULL && p->ufmt==0)
- b_char("NO",a->inform,a->informlen);
- else b_char("YES",a->inform,a->informlen);
- if(a->inunf)
- if(p!=NULL && p->ufmt==0)
- b_char("YES",a->inunf,a->inunflen);
- else if (p!=NULL) b_char("NO",a->inunf,a->inunflen);
- else b_char("UNKNOWN",a->inunf,a->inunflen);
- if(a->inrecl!=NULL && p!=NULL)
- *a->inrecl=p->url;
- if(a->innrec!=NULL && p!=NULL && p->url>0)
- *a->innrec=ftell(p->ufd)/p->url+1;
- if(a->inblank && p!=NULL && p->ufmt)
- if(p->ublnk)
- b_char("ZERO",a->inblank,a->inblanklen);
- else b_char("NULL",a->inblank,a->inblanklen);
- return(0);
-}
diff --git a/contrib/libf2c/libI77/lio.h b/contrib/libf2c/libI77/lio.h
deleted file mode 100644
index 012317206aaf..000000000000
--- a/contrib/libf2c/libI77/lio.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/* copy of ftypes from the compiler */
-/* variable types
- * numeric assumptions:
- * int < reals < complexes
- * TYDREAL-TYREAL = TYDCOMPLEX-TYCOMPLEX
- */
-
-/* 0-10 retain their old (pre LOGICAL*1, etc.) */
-/* values to allow mixing old and new objects. */
-
-#define TYUNKNOWN 0
-#define TYADDR 1
-#define TYSHORT 2
-#define TYLONG 3
-#define TYREAL 4
-#define TYDREAL 5
-#define TYCOMPLEX 6
-#define TYDCOMPLEX 7
-#define TYLOGICAL 8
-#define TYCHAR 9
-#define TYSUBR 10
-#define TYINT1 11
-#define TYLOGICAL1 12
-#define TYLOGICAL2 13
-#ifdef Allow_TYQUAD
-#undef TYQUAD
-#define TYQUAD 14
-#endif
-
-#define LINTW 24
-#define LINE 80
-#define LLOGW 2
-#ifdef Old_list_output
-#define LLOW 1.0
-#define LHIGH 1.e9
-#define LEFMT " %# .8E"
-#define LFFMT " %# .9g"
-#else
-#define LGFMT "%.9G"
-#endif
-/* LEFBL 20 should suffice; 24 overcomes a NeXT bug. */
-#define LEFBL 24
-
-typedef union
-{
- char flchar;
- short flshort;
- ftnint flint;
-#ifdef Allow_TYQUAD
- longint fllongint;
-#endif
- real flreal;
- doublereal fldouble;
-} flex;
-extern int f__scale;
-#ifdef KR_headers
-extern int (*f__lioproc)(), (*l_getc)(), (*l_ungetc)();
-extern int l_read(), l_write();
-#else
-#ifdef __cplusplus
-extern "C" {
-#endif
-extern int (*f__lioproc)(ftnint*, char*, ftnlen, ftnint);
-extern int l_write(ftnint*, char*, ftnlen, ftnint);
-extern void x_wsne(cilist*);
-extern int c_le(cilist*), (*l_getc)(void), (*l_ungetc)(int,FILE*);
-extern int l_read(ftnint*,char*,ftnlen,ftnint);
-extern integer e_rsle(void), e_wsle(void), s_wsne(cilist*);
-extern int z_rnew(void);
-#ifdef __cplusplus
- }
-#endif
-#endif
-extern ftnint L_len;
diff --git a/contrib/libf2c/libI77/lread.c b/contrib/libf2c/libI77/lread.c
deleted file mode 100644
index d546efcc4e13..000000000000
--- a/contrib/libf2c/libI77/lread.c
+++ /dev/null
@@ -1,798 +0,0 @@
-#include "config.h"
-#include <ctype.h>
-#include "f2c.h"
-#include "fio.h"
-
-/* Compile with -DF8X_NML_ELIDE_QUOTES to permit eliding quotation */
-/* marks in namelist input a la the Fortran 8X Draft published in */
-/* the May 1989 issue of Fortran Forum. */
-
-
-extern char *f__fmtbuf;
-extern int f__fmtlen;
-
-#ifdef Allow_TYQUAD
-static longint f__llx;
-static int quad_read;
-#endif
-
-#ifdef KR_headers
-extern double atof();
-extern char *malloc(), *realloc();
-int (*f__lioproc)(), (*l_getc)(), (*l_ungetc)();
-#else
-#undef abs
-#undef min
-#undef max
-#include <stdlib.h>
-#endif
-
-#include "fmt.h"
-#include "lio.h"
-#include "fp.h"
-
-#ifndef KR_headers
-int (*f__lioproc)(ftnint*, char*, ftnlen, ftnint), (*l_getc)(void),
- (*l_ungetc)(int,FILE*);
-#endif
-
-int l_eof;
-
-#define isblnk(x) (f__ltab[x+1]&B)
-#define issep(x) (f__ltab[x+1]&SX)
-#define isapos(x) (f__ltab[x+1]&AX)
-#define isexp(x) (f__ltab[x+1]&EX)
-#define issign(x) (f__ltab[x+1]&SG)
-#define iswhit(x) (f__ltab[x+1]&WH)
-#define SX 1
-#define B 2
-#define AX 4
-#define EX 8
-#define SG 16
-#define WH 32
-char f__ltab[128+1] = { /* offset one for EOF */
- 0,
- 0,0,AX,0,0,0,0,0,0,WH|B,SX|WH,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- SX|B|WH,0,AX,0,0,0,0,AX,0,0,0,SG,SX,SG,0,SX,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,EX,EX,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- AX,0,0,0,EX,EX,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-};
-
-#ifdef ungetc
- static int
-#ifdef KR_headers
-un_getc(x,f__cf) int x; FILE *f__cf;
-#else
-un_getc(int x, FILE *f__cf)
-#endif
-{ return ungetc(x,f__cf); }
-#else
-#define un_getc ungetc
-#ifdef KR_headers
- extern int ungetc();
-#else
-extern int ungetc(int, FILE*); /* for systems with a buggy stdio.h */
-#endif
-#endif
-
-t_getc(Void)
-{ int ch;
- if(f__curunit->uend) return(EOF);
- if((ch=getc(f__cf))!=EOF) return(ch);
- if(feof(f__cf))
- f__curunit->uend = l_eof = 1;
- return(EOF);
-}
-integer e_rsle(Void)
-{
- int ch;
- f__init = 1;
- if(f__curunit->uend) return(0);
- while((ch=t_getc())!='\n')
- if (ch == EOF) {
- if(feof(f__cf))
- f__curunit->uend = l_eof = 1;
- return EOF;
- }
- return(0);
-}
-
-flag f__lquit;
-int f__lcount,f__ltype,nml_read;
-char *f__lchar;
-double f__lx,f__ly;
-#define ERR(x) if(n=(x)) {f__init &= ~2; return(n);}
-#define GETC(x) (x=(*l_getc)())
-#define Ungetc(x,y) (*l_ungetc)(x,y)
-
- static int
-#ifdef KR_headers
-l_R(poststar, reqint) int poststar, reqint;
-#else
-l_R(int poststar, int reqint)
-#endif
-{
- char s[FMAX+EXPMAXDIGS+4];
- register int ch;
- register char *sp, *spe, *sp1;
- long e, exp;
- int havenum, havestar, se;
-
- if (!poststar) {
- if (f__lcount > 0)
- return(0);
- f__lcount = 1;
- }
-#ifdef Allow_TYQUAD
- f__llx = 0;
-#endif
- f__ltype = 0;
- exp = 0;
- havestar = 0;
-retry:
- sp1 = sp = s;
- spe = sp + FMAX;
- havenum = 0;
-
- switch(GETC(ch)) {
- case '-': *sp++ = ch; sp1++; spe++;
- case '+':
- GETC(ch);
- }
- while(ch == '0') {
- ++havenum;
- GETC(ch);
- }
- while(isdigit(ch)) {
- if (sp < spe) *sp++ = ch;
- else ++exp;
- GETC(ch);
- }
- if (ch == '*' && !poststar) {
- if (sp == sp1 || exp || *s == '-') {
- errfl(f__elist->cierr,112,"bad repetition count");
- }
- poststar = havestar = 1;
- *sp = 0;
- f__lcount = atoi(s);
- goto retry;
- }
- if (ch == '.') {
-#ifndef ALLOW_FLOAT_IN_INTEGER_LIST_INPUT
- if (reqint)
- errfl(f__elist->cierr,115,"invalid integer");
-#endif
- GETC(ch);
- if (sp == sp1)
- while(ch == '0') {
- ++havenum;
- --exp;
- GETC(ch);
- }
- while(isdigit(ch)) {
- if (sp < spe)
- { *sp++ = ch; --exp; }
- GETC(ch);
- }
- }
- havenum += sp - sp1;
- se = 0;
- if (issign(ch))
- goto signonly;
- if (havenum && isexp(ch)) {
-#ifndef ALLOW_FLOAT_IN_INTEGER_LIST_INPUT
- if (reqint)
- errfl(f__elist->cierr,115,"invalid integer");
-#endif
- GETC(ch);
- if (issign(ch)) {
-signonly:
- if (ch == '-') se = 1;
- GETC(ch);
- }
- if (!isdigit(ch)) {
-bad:
- errfl(f__elist->cierr,112,"exponent field");
- }
-
- e = ch - '0';
- while(isdigit(GETC(ch))) {
- e = 10*e + ch - '0';
- if (e > EXPMAX)
- goto bad;
- }
- if (se)
- exp -= e;
- else
- exp += e;
- }
- (void) Ungetc(ch, f__cf);
- if (sp > sp1) {
- ++havenum;
- while(*--sp == '0')
- ++exp;
- if (exp)
- sprintf(sp+1, "e%ld", exp);
- else
- sp[1] = 0;
- f__lx = atof(s);
-#ifdef Allow_TYQUAD
- if (reqint&2 && (se = sp - sp1 + exp) > 14 && se < 20) {
- /* Assuming 64-bit longint and 32-bit long. */
- if (exp < 0)
- sp += exp;
- if (sp1 <= sp) {
- f__llx = *sp1 - '0';
- while(++sp1 <= sp)
- f__llx = 10*f__llx + (*sp1 - '0');
- }
- while(--exp >= 0)
- f__llx *= 10;
- if (*s == '-')
- f__llx = -f__llx;
- }
-#endif
- }
- else
- f__lx = 0.;
- if (havenum)
- f__ltype = TYLONG;
- else
- switch(ch) {
- case ',':
- case '/':
- break;
- default:
- if (havestar && ( ch == ' '
- ||ch == '\t'
- ||ch == '\n'))
- break;
- if (nml_read > 1) {
- f__lquit = 2;
- return 0;
- }
- errfl(f__elist->cierr,112,"invalid number");
- }
- return 0;
- }
-
- static int
-#ifdef KR_headers
-rd_count(ch) register int ch;
-#else
-rd_count(register int ch)
-#endif
-{
- if (ch < '0' || ch > '9')
- return 1;
- f__lcount = ch - '0';
- while(GETC(ch) >= '0' && ch <= '9')
- f__lcount = 10*f__lcount + ch - '0';
- Ungetc(ch,f__cf);
- return f__lcount <= 0;
- }
-
- static int
-l_C(Void)
-{ int ch, nml_save;
- double lz;
- if(f__lcount>0) return(0);
- f__ltype=0;
- GETC(ch);
- if(ch!='(')
- {
- if (nml_read > 1 && (ch < '0' || ch > '9')) {
- Ungetc(ch,f__cf);
- f__lquit = 2;
- return 0;
- }
- if (rd_count(ch))
- if(!f__cf || !feof(f__cf))
- errfl(f__elist->cierr,112,"complex format");
- else
- err(f__elist->cierr,(EOF),"lread");
- if(GETC(ch)!='*')
- {
- if(!f__cf || !feof(f__cf))
- errfl(f__elist->cierr,112,"no star");
- else
- err(f__elist->cierr,(EOF),"lread");
- }
- if(GETC(ch)!='(')
- { Ungetc(ch,f__cf);
- return(0);
- }
- }
- else
- f__lcount = 1;
- while(iswhit(GETC(ch)));
- Ungetc(ch,f__cf);
- nml_save = nml_read;
- nml_read = 0;
- if (ch = l_R(1,0))
- return ch;
- if (!f__ltype)
- errfl(f__elist->cierr,112,"no real part");
- lz = f__lx;
- while(iswhit(GETC(ch)));
- if(ch!=',')
- { (void) Ungetc(ch,f__cf);
- errfl(f__elist->cierr,112,"no comma");
- }
- while(iswhit(GETC(ch)));
- (void) Ungetc(ch,f__cf);
- if (ch = l_R(1,0))
- return ch;
- if (!f__ltype)
- errfl(f__elist->cierr,112,"no imaginary part");
- while(iswhit(GETC(ch)));
- if(ch!=')') errfl(f__elist->cierr,112,"no )");
- f__ly = f__lx;
- f__lx = lz;
-#ifdef Allow_TYQUAD
- f__llx = 0;
-#endif
- nml_read = nml_save;
- return(0);
-}
-
- static char nmLbuf[256], *nmL_next;
- static int (*nmL_getc_save)(Void);
-#ifdef KR_headers
- static int (*nmL_ungetc_save)(/* int, FILE* */);
-#else
- static int (*nmL_ungetc_save)(int, FILE*);
-#endif
-
- static int
-nmL_getc(Void)
-{
- int rv;
- if (rv = *nmL_next++)
- return rv;
- l_getc = nmL_getc_save;
- l_ungetc = nmL_ungetc_save;
- return (*l_getc)();
- }
-
- static int
-#ifdef KR_headers
-nmL_ungetc(x, f) int x; FILE *f;
-#else
-nmL_ungetc(int x, FILE *f)
-#endif
-{
- f = f; /* banish non-use warning */
- return *--nmL_next = x;
- }
-
- static int
-#ifdef KR_headers
-Lfinish(ch, dot, rvp) int ch, dot, *rvp;
-#else
-Lfinish(int ch, int dot, int *rvp)
-#endif
-{
- char *s, *se;
- static char what[] = "namelist input";
-
- s = nmLbuf + 2;
- se = nmLbuf + sizeof(nmLbuf) - 1;
- *s++ = ch;
- while(!issep(GETC(ch)) && ch!=EOF) {
- if (s >= se) {
- nmLbuf_ovfl:
- return *rvp = err__fl(f__elist->cierr,131,what);
- }
- *s++ = ch;
- if (ch != '=')
- continue;
- if (dot)
- return *rvp = err__fl(f__elist->cierr,112,what);
- got_eq:
- *s = 0;
- nmL_getc_save = l_getc;
- l_getc = nmL_getc;
- nmL_ungetc_save = l_ungetc;
- l_ungetc = nmL_ungetc;
- nmLbuf[1] = *(nmL_next = nmLbuf) = ',';
- *rvp = f__lcount = 0;
- return 1;
- }
- if (dot)
- goto done;
- for(;;) {
- if (s >= se)
- goto nmLbuf_ovfl;
- *s++ = ch;
- if (!isblnk(ch))
- break;
- if (GETC(ch) == EOF)
- goto done;
- }
- if (ch == '=')
- goto got_eq;
- done:
- Ungetc(ch, f__cf);
- return 0;
- }
-
- static int
-l_L(Void)
-{
- int ch, rv, sawdot;
- if(f__lcount>0)
- return(0);
- f__lcount = 1;
- f__ltype=0;
- GETC(ch);
- if(isdigit(ch))
- {
- rd_count(ch);
- if(GETC(ch)!='*')
- if(!f__cf || !feof(f__cf))
- errfl(f__elist->cierr,112,"no star");
- else
- err(f__elist->cierr,(EOF),"lread");
- GETC(ch);
- }
- sawdot = 0;
- if(ch == '.') {
- sawdot = 1;
- GETC(ch);
- }
- switch(ch)
- {
- case 't':
- case 'T':
- if (nml_read && Lfinish(ch, sawdot, &rv))
- return rv;
- f__lx=1;
- break;
- case 'f':
- case 'F':
- if (nml_read && Lfinish(ch, sawdot, &rv))
- return rv;
- f__lx=0;
- break;
- default:
- if(isblnk(ch) || issep(ch) || ch==EOF)
- { (void) Ungetc(ch,f__cf);
- return(0);
- }
- if (nml_read > 1) {
- Ungetc(ch,f__cf);
- f__lquit = 2;
- return 0;
- }
- errfl(f__elist->cierr,112,"logical");
- }
- f__ltype=TYLONG;
- while(!issep(GETC(ch)) && ch!=EOF);
- (void) Ungetc(ch, f__cf);
- return(0);
-}
-
-#define BUFSIZE 128
-
- static int
-l_CHAR(Void)
-{ int ch,size,i;
- static char rafail[] = "realloc failure";
- char quote,*p;
- if(f__lcount>0) return(0);
- f__ltype=0;
- if(f__lchar!=NULL) free(f__lchar);
- size=BUFSIZE;
- p=f__lchar = (char *)malloc((unsigned int)size);
- if(f__lchar == NULL)
- errfl(f__elist->cierr,113,"no space");
-
- GETC(ch);
- if(isdigit(ch)) {
- /* allow Fortran 8x-style unquoted string... */
- /* either find a repetition count or the string */
- f__lcount = ch - '0';
- *p++ = ch;
- for(i = 1;;) {
- switch(GETC(ch)) {
- case '*':
- if (f__lcount == 0) {
- f__lcount = 1;
-#ifndef F8X_NML_ELIDE_QUOTES
- if (nml_read)
- goto no_quote;
-#endif
- goto noquote;
- }
- p = f__lchar;
- goto have_lcount;
- case ',':
- case ' ':
- case '\t':
- case '\n':
- case '/':
- Ungetc(ch,f__cf);
- /* no break */
- case EOF:
- f__lcount = 1;
- f__ltype = TYCHAR;
- return *p = 0;
- }
- if (!isdigit(ch)) {
- f__lcount = 1;
-#ifndef F8X_NML_ELIDE_QUOTES
- if (nml_read) {
- no_quote:
- errfl(f__elist->cierr,112,
- "undelimited character string");
- }
-#endif
- goto noquote;
- }
- *p++ = ch;
- f__lcount = 10*f__lcount + ch - '0';
- if (++i == size) {
- f__lchar = (char *)realloc(f__lchar,
- (unsigned int)(size += BUFSIZE));
- if(f__lchar == NULL)
- errfl(f__elist->cierr,113,rafail);
- p = f__lchar + i;
- }
- }
- }
- else (void) Ungetc(ch,f__cf);
- have_lcount:
- if(GETC(ch)=='\'' || ch=='"') quote=ch;
- else if(isblnk(ch) || (issep(ch) && ch != '\n') || ch==EOF) {
- Ungetc(ch,f__cf);
- return 0;
- }
-#ifndef F8X_NML_ELIDE_QUOTES
- else if (nml_read > 1) {
- Ungetc(ch,f__cf);
- f__lquit = 2;
- return 0;
- }
-#endif
- else {
- /* Fortran 8x-style unquoted string */
- *p++ = ch;
- for(i = 1;;) {
- switch(GETC(ch)) {
- case ',':
- case ' ':
- case '\t':
- case '\n':
- case '/':
- Ungetc(ch,f__cf);
- /* no break */
- case EOF:
- f__ltype = TYCHAR;
- return *p = 0;
- }
- noquote:
- *p++ = ch;
- if (++i == size) {
- f__lchar = (char *)realloc(f__lchar,
- (unsigned int)(size += BUFSIZE));
- if(f__lchar == NULL)
- errfl(f__elist->cierr,113,rafail);
- p = f__lchar + i;
- }
- }
- }
- f__ltype=TYCHAR;
- for(i=0;;)
- { while(GETC(ch)!=quote && ch!='\n'
- && ch!=EOF && ++i<size) *p++ = ch;
- if(i==size)
- {
- newone:
- f__lchar= (char *)realloc(f__lchar,
- (unsigned int)(size += BUFSIZE));
- if(f__lchar == NULL)
- errfl(f__elist->cierr,113,rafail);
- p=f__lchar+i-1;
- *p++ = ch;
- }
- else if(ch==EOF) return(EOF);
- else if(ch=='\n')
- { if(*(p-1) != '\\') continue;
- i--;
- p--;
- if(++i<size) *p++ = ch;
- else goto newone;
- }
- else if(GETC(ch)==quote)
- { if(++i<size) *p++ = ch;
- else goto newone;
- }
- else
- { (void) Ungetc(ch,f__cf);
- *p = 0;
- return(0);
- }
- }
-}
-#ifdef KR_headers
-c_le(a) cilist *a;
-#else
-c_le(cilist *a)
-#endif
-{
- if(f__init != 1) f_init();
- f__init = 3;
- f__fmtbuf="list io";
- f__curunit = &f__units[a->ciunit];
- f__fmtlen=7;
- if(a->ciunit>=MXUNIT || a->ciunit<0)
- err(a->cierr,101,"stler");
- f__scale=f__recpos=0;
- f__elist=a;
- if(f__curunit->ufd==NULL && fk_open(SEQ,FMT,a->ciunit))
- err(a->cierr,102,"lio");
- f__cf=f__curunit->ufd;
- if(!f__curunit->ufmt) err(a->cierr,103,"lio");
- return(0);
-}
-#ifdef KR_headers
-l_read(number,ptr,len,type) ftnint *number,type; char *ptr; ftnlen len;
-#else
-l_read(ftnint *number, char *ptr, ftnlen len, ftnint type)
-#endif
-{
-#define Ptr ((flex *)ptr)
- int i,n,ch;
- doublereal *yy;
- real *xx;
- for(i=0;i<*number;i++)
- {
- if(f__lquit) return(0);
- if(l_eof)
- err(f__elist->ciend, EOF, "list in");
- if(f__lcount == 0) {
- f__ltype = 0;
- for(;;) {
- GETC(ch);
- switch(ch) {
- case EOF:
- err(f__elist->ciend,(EOF),"list in");
- case ' ':
- case '\t':
- case '\n':
- continue;
- case '/':
- f__lquit = 1;
- goto loopend;
- case ',':
- f__lcount = 1;
- goto loopend;
- default:
- (void) Ungetc(ch, f__cf);
- goto rddata;
- }
- }
- }
- rddata:
- switch((int)type)
- {
- case TYINT1:
- case TYSHORT:
- case TYLONG:
-#ifndef ALLOW_FLOAT_IN_INTEGER_LIST_INPUT
- ERR(l_R(0,1));
- break;
-#endif
- case TYREAL:
- case TYDREAL:
- ERR(l_R(0,0));
- break;
-#ifdef TYQUAD
- case TYQUAD:
- n = l_R(0,2);
- if (n)
- return n;
- break;
-#endif
- case TYCOMPLEX:
- case TYDCOMPLEX:
- ERR(l_C());
- break;
- case TYLOGICAL1:
- case TYLOGICAL2:
- case TYLOGICAL:
- ERR(l_L());
- break;
- case TYCHAR:
- ERR(l_CHAR());
- break;
- }
- while (GETC(ch) == ' ' || ch == '\t');
- if (ch != ',' || f__lcount > 1)
- Ungetc(ch,f__cf);
- loopend:
- if(f__lquit) return(0);
- if(f__cf && ferror(f__cf)) {
- clearerr(f__cf);
- errfl(f__elist->cierr,errno,"list in");
- }
- if(f__ltype==0) goto bump;
- switch((int)type)
- {
- case TYINT1:
- case TYLOGICAL1:
- Ptr->flchar = (char)f__lx;
- break;
- case TYLOGICAL2:
- case TYSHORT:
- Ptr->flshort = (short)f__lx;
- break;
- case TYLOGICAL:
- case TYLONG:
- Ptr->flint = (ftnint)f__lx;
- break;
-#ifdef Allow_TYQUAD
- case TYQUAD:
- if (!(Ptr->fllongint = f__llx))
- Ptr->fllongint = f__lx;
- break;
-#endif
- case TYREAL:
- Ptr->flreal=f__lx;
- break;
- case TYDREAL:
- Ptr->fldouble=f__lx;
- break;
- case TYCOMPLEX:
- xx=(real *)ptr;
- *xx++ = f__lx;
- *xx = f__ly;
- break;
- case TYDCOMPLEX:
- yy=(doublereal *)ptr;
- *yy++ = f__lx;
- *yy = f__ly;
- break;
- case TYCHAR:
- b_char(f__lchar,ptr,len);
- break;
- }
- bump:
- if(f__lcount>0) f__lcount--;
- ptr += len;
- if (nml_read)
- nml_read++;
- }
- return(0);
-#undef Ptr
-}
-#ifdef KR_headers
-integer s_rsle(a) cilist *a;
-#else
-integer s_rsle(cilist *a)
-#endif
-{
- int n;
-
- f__reading=1;
- f__external=1;
- f__formatted=1;
- if(n=c_le(a)) return(n);
- f__lioproc = l_read;
- f__lquit = 0;
- f__lcount = 0;
- l_eof = 0;
- if(f__curunit->uwrt && f__nowreading(f__curunit))
- err(a->cierr,errno,"read start");
- if(f__curunit->uend)
- err(f__elist->ciend,(EOF),"read start");
- l_getc = t_getc;
- l_ungetc = un_getc;
- f__doend = xrd_SL;
- return(0);
-}
diff --git a/contrib/libf2c/libI77/lwrite.c b/contrib/libf2c/libI77/lwrite.c
deleted file mode 100644
index bf209f47ed20..000000000000
--- a/contrib/libf2c/libI77/lwrite.c
+++ /dev/null
@@ -1,302 +0,0 @@
-#include "f2c.h"
-#include "fio.h"
-#include "fmt.h"
-#include "lio.h"
-
-ftnint L_len;
-int f__Aquote;
-
- static VOID
-donewrec(Void)
-{
- if (f__recpos)
- (*f__donewrec)();
- }
-
- static VOID
-#ifdef KR_headers
-lwrt_I(n) longint n;
-#else
-lwrt_I(longint n)
-#endif
-{
- char *p;
- int ndigit, sign;
-
- p = f__icvt(n, &ndigit, &sign, 10);
- if(f__recpos + ndigit >= L_len)
- donewrec();
- PUT(' ');
- if (sign)
- PUT('-');
- while(*p)
- PUT(*p++);
-}
- static VOID
-#ifdef KR_headers
-lwrt_L(n, len) ftnint n; ftnlen len;
-#else
-lwrt_L(ftnint n, ftnlen len)
-#endif
-{
- if(f__recpos+LLOGW>=L_len)
- donewrec();
- wrt_L((Uint *)&n,LLOGW, len);
-}
- static VOID
-#ifdef KR_headers
-lwrt_A(p,len) char *p; ftnlen len;
-#else
-lwrt_A(char *p, ftnlen len)
-#endif
-{
- int a;
- char *p1, *pe;
-
- a = 0;
- pe = p + len;
- if (f__Aquote) {
- a = 3;
- if (len > 1 && p[len-1] == ' ') {
- while(--len > 1 && p[len-1] == ' ');
- pe = p + len;
- }
- p1 = p;
- while(p1 < pe)
- if (*p1++ == '\'')
- a++;
- }
- if(f__recpos+len+a >= L_len)
- donewrec();
- if (a
-#ifndef OMIT_BLANK_CC
- || !f__recpos
-#endif
- )
- PUT(' ');
- if (a) {
- PUT('\'');
- while(p < pe) {
- if (*p == '\'')
- PUT('\'');
- PUT(*p++);
- }
- PUT('\'');
- }
- else
- while(p < pe)
- PUT(*p++);
-}
-
- static int
-#ifdef KR_headers
-l_g(buf, n) char *buf; double n;
-#else
-l_g(char *buf, double n)
-#endif
-{
-#ifdef Old_list_output
- doublereal absn;
- char *fmt;
-
- absn = n;
- if (absn < 0)
- absn = -absn;
- fmt = LLOW <= absn && absn < LHIGH ? LFFMT : LEFMT;
-#ifdef USE_STRLEN
- sprintf(buf, fmt, n);
- return strlen(buf);
-#else
- return sprintf(buf, fmt, n);
-#endif
-
-#else
- register char *b, c, c1;
-
- b = buf;
- *b++ = ' ';
- if (n < 0) {
- *b++ = '-';
- n = -n;
- }
- else
- *b++ = ' ';
- if (n == 0) {
- *b++ = '0';
- *b++ = '.';
- *b = 0;
- goto f__ret;
- }
- sprintf(b, LGFMT, n);
- switch(*b) {
-#ifndef WANT_LEAD_0
- case '0':
- while(b[0] = b[1])
- b++;
- break;
-#endif
- case 'i':
- case 'I':
- /* Infinity */
- case 'n':
- case 'N':
- /* NaN */
- while(*++b);
- break;
-
- default:
- /* Fortran 77 insists on having a decimal point... */
- for(;; b++)
- switch(*b) {
- case 0:
- *b++ = '.';
- *b = 0;
- goto f__ret;
- case '.':
- while(*++b);
- goto f__ret;
- case 'E':
- for(c1 = '.', c = 'E'; *b = c1;
- c1 = c, c = *++b);
- goto f__ret;
- }
- }
- f__ret:
- return b - buf;
-#endif
- }
-
- static VOID
-#ifdef KR_headers
-l_put(s) register char *s;
-#else
-l_put(register char *s)
-#endif
-{
-#ifdef KR_headers
- register void (*pn)() = f__putn;
-#else
- register void (*pn)(int) = f__putn;
-#endif
- register int c;
-
- while(c = *s++)
- (*pn)(c);
- }
-
- static VOID
-#ifdef KR_headers
-lwrt_F(n) double n;
-#else
-lwrt_F(double n)
-#endif
-{
- char buf[LEFBL];
-
- if(f__recpos + l_g(buf,n) >= L_len)
- donewrec();
- l_put(buf);
-}
- static VOID
-#ifdef KR_headers
-lwrt_C(a,b) double a,b;
-#else
-lwrt_C(double a, double b)
-#endif
-{
- char *ba, *bb, bufa[LEFBL], bufb[LEFBL];
- int al, bl;
-
- al = l_g(bufa, a);
- for(ba = bufa; *ba == ' '; ba++)
- --al;
- bl = l_g(bufb, b) + 1; /* intentionally high by 1 */
- for(bb = bufb; *bb == ' '; bb++)
- --bl;
- if(f__recpos + al + bl + 3 >= L_len)
- donewrec();
-#ifdef OMIT_BLANK_CC
- else
-#endif
- PUT(' ');
- PUT('(');
- l_put(ba);
- PUT(',');
- if (f__recpos + bl >= L_len) {
- (*f__donewrec)();
-#ifndef OMIT_BLANK_CC
- PUT(' ');
-#endif
- }
- l_put(bb);
- PUT(')');
-}
-#ifdef KR_headers
-l_write(number,ptr,len,type) ftnint *number,type; char *ptr; ftnlen len;
-#else
-l_write(ftnint *number, char *ptr, ftnlen len, ftnint type)
-#endif
-{
-#define Ptr ((flex *)ptr)
- int i;
- longint x;
- double y,z;
- real *xx;
- doublereal *yy;
- for(i=0;i< *number; i++)
- {
- switch((int)type)
- {
- default: f__fatal(204,"unknown type in lio");
- case TYINT1:
- x = Ptr->flchar;
- goto xint;
- case TYSHORT:
- x=Ptr->flshort;
- goto xint;
-#ifdef Allow_TYQUAD
- case TYQUAD:
- x = Ptr->fllongint;
- goto xint;
-#endif
- case TYLONG:
- x=Ptr->flint;
- xint: lwrt_I(x);
- break;
- case TYREAL:
- y=Ptr->flreal;
- goto xfloat;
- case TYDREAL:
- y=Ptr->fldouble;
- xfloat: lwrt_F(y);
- break;
- case TYCOMPLEX:
- xx= &Ptr->flreal;
- y = *xx++;
- z = *xx;
- goto xcomplex;
- case TYDCOMPLEX:
- yy = &Ptr->fldouble;
- y= *yy++;
- z = *yy;
- xcomplex:
- lwrt_C(y,z);
- break;
- case TYLOGICAL1:
- x = Ptr->flchar;
- goto xlog;
- case TYLOGICAL2:
- x = Ptr->flshort;
- goto xlog;
- case TYLOGICAL:
- x = Ptr->flint;
- xlog: lwrt_L(Ptr->flint, len);
- break;
- case TYCHAR:
- lwrt_A(ptr,len);
- break;
- }
- ptr += len;
- }
- return(0);
-}
diff --git a/contrib/libf2c/libI77/makefile.netlib b/contrib/libf2c/libI77/makefile.netlib
deleted file mode 100644
index edba1fe8569f..000000000000
--- a/contrib/libf2c/libI77/makefile.netlib
+++ /dev/null
@@ -1,104 +0,0 @@
-.SUFFIXES: .c .o
-CC = cc
-CFLAGS = -O
-SHELL = /bin/sh
-
-# compile, then strip unnecessary symbols
-.c.o:
- $(CC) -c -DSkip_f2c_Undefs $(CFLAGS) $*.c
- ld -r -x -o $*.xxx $*.o
- mv $*.xxx $*.o
-## Under Solaris (and other systems that do not understand ld -x),
-## omit -x in the ld line above.
-## If your system does not have the ld command, comment out
-## or remove both the ld and mv lines above.
-
-OBJ = Version.o backspace.o close.o dfe.o dolio.o due.o endfile.o err.o \
- fmt.o fmtlib.o ftell_.o iio.o ilnw.o inquire.o lread.o lwrite.o \
- open.o rdfmt.o rewind.o rsfe.o rsli.o rsne.o sfe.o sue.o typesize.o \
- uio.o util.o wref.o wrtfmt.o wsfe.o wsle.o wsne.o xwsne.o
-libI77.a: $(OBJ)
- ar r libI77.a $?
- -ranlib libI77.a
-
-### If your system lacks ranlib, you don't need it; see README.
-
-install: libI77.a
- cp libI77.a /usr/lib/libI77.a
- ranlib /usr/lib/libI77.a
-
-Version.o: Version.c
- $(CC) -c Version.c
-
-# To compile with C++, first "make f2c.h"
-f2c.h: f2ch.add
- cat /usr/include/f2c.h f2ch.add >f2c.h
-
-
-clean:
- rm -f $(OBJ) libI77.a
-
-clobber: clean
- rm -f libI77.a
-
-backspace.o: fio.h
-close.o: fio.h
-dfe.o: fio.h
-dfe.o: fmt.h
-due.o: fio.h
-endfile.o: fio.h rawio.h
-err.o: fio.h rawio.h
-fmt.o: fio.h
-fmt.o: fmt.h
-ftell_.o: fio.h
-iio.o: fio.h
-iio.o: fmt.h
-ilnw.o: fio.h
-ilnw.o: lio.h
-inquire.o: fio.h
-lread.o: fio.h
-lread.o: fmt.h
-lread.o: lio.h
-lread.o: fp.h
-lwrite.o: fio.h
-lwrite.o: fmt.h
-lwrite.o: lio.h
-open.o: fio.h rawio.h
-rdfmt.o: fio.h
-rdfmt.o: fmt.h
-rdfmt.o: fp.h
-rewind.o: fio.h
-rsfe.o: fio.h
-rsfe.o: fmt.h
-rsli.o: fio.h
-rsli.o: lio.h
-rsne.o: fio.h
-rsne.o: lio.h
-sfe.o: fio.h
-sue.o: fio.h
-uio.o: fio.h
-util.o: fio.h
-wref.o: fio.h
-wref.o: fmt.h
-wref.o: fp.h
-wrtfmt.o: fio.h
-wrtfmt.o: fmt.h
-wsfe.o: fio.h
-wsfe.o: fmt.h
-wsle.o: fio.h
-wsle.o: fmt.h
-wsle.o: lio.h
-wsne.o: fio.h
-wsne.o: lio.h
-xwsne.o: fio.h
-xwsne.o: lio.h
-xwsne.o: fmt.h
-
-check:
- xsum Notice README Version.c backspace.c close.c dfe.c dolio.c \
- due.c endfile.c err.c f2ch.add fio.h fmt.c fmt.h fmtlib.c fp.h \
- ftell_.c iio.c ilnw.c inquire.c lio.h lread.c lwrite.c makefile \
- open.c rawio.h rdfmt.c rewind.c rsfe.c rsli.c rsne.c sfe.c sue.c \
- typesize.c uio.c util.c wref.c wrtfmt.c wsfe.c wsle.c wsne.c \
- xwsne.c >zap
- cmp zap libI77.xsum && rm zap || diff libI77.xsum zap
diff --git a/contrib/libf2c/libI77/open.c b/contrib/libf2c/libI77/open.c
deleted file mode 100644
index 56bbc5232eee..000000000000
--- a/contrib/libf2c/libI77/open.c
+++ /dev/null
@@ -1,315 +0,0 @@
-/* Define _XOPEN_SOURCE to get tempnam prototype with glibc et al --
- more general than _INCLUDE_XOPEN_SOURCE used elsewhere `for HP-UX'. */
-#define _XOPEN_SOURCE 1
-#include "config.h"
-#include "f2c.h"
-#include "fio.h"
-#include <string.h>
-#ifndef NON_POSIX_STDIO
-#ifdef MSDOS
-#include "io.h"
-#else
-#include "unistd.h" /* for access */
-#endif
-#endif
-
-#ifdef KR_headers
-extern char *malloc();
-#ifdef NON_ANSI_STDIO
-extern char *mktemp();
-#endif
-extern integer f_clos();
-#else
-#undef abs
-#undef min
-#undef max
-#include <stdlib.h>
-extern int f__canseek(FILE*);
-extern integer f_clos(cllist*);
-#endif
-
-#ifdef NON_ANSI_RW_MODES
-char *f__r_mode[2] = {"r", "r"};
-char *f__w_mode[4] = {"w", "w", "r+w", "r+w"};
-#else
-char *f__r_mode[2] = {"rb", "r"};
-char *f__w_mode[4] = {"wb", "w", "r+b", "r+"};
-#endif
-
- static char f__buf0[400], *f__buf = f__buf0;
- int f__buflen = (int)sizeof(f__buf0);
-
- static void
-#ifdef KR_headers
-f__bufadj(n, c) int n, c;
-#else
-f__bufadj(int n, int c)
-#endif
-{
- unsigned int len;
- char *nbuf, *s, *t, *te;
-
- if (f__buf == f__buf0)
- f__buflen = 1024;
- while(f__buflen <= n)
- f__buflen <<= 1;
- len = (unsigned int)f__buflen;
- if (len != f__buflen || !(nbuf = (char*)malloc(len)))
- f__fatal(113, "malloc failure");
- s = nbuf;
- t = f__buf;
- te = t + c;
- while(t < te)
- *s++ = *t++;
- if (f__buf != f__buf0)
- free(f__buf);
- f__buf = nbuf;
- }
-
- int
-#ifdef KR_headers
-f__putbuf(c) int c;
-#else
-f__putbuf(int c)
-#endif
-{
- char *s, *se;
- int n;
-
- if (f__hiwater > f__recpos)
- f__recpos = f__hiwater;
- n = f__recpos + 1;
- if (n >= f__buflen)
- f__bufadj(n, f__recpos);
- s = f__buf;
- se = s + f__recpos;
- if (c)
- *se++ = c;
- *se = 0;
- for(;;) {
- fputs(s, f__cf);
- s += strlen(s);
- if (s >= se)
- break; /* normally happens the first time */
- putc(*s++, f__cf);
- }
- return 0;
- }
-
- void
-#ifdef KR_headers
-x_putc(c)
-#else
-x_putc(int c)
-#endif
-{
- if (f__recpos >= f__buflen)
- f__bufadj(f__recpos, f__buflen);
- f__buf[f__recpos++] = c;
- }
-
-#define opnerr(f,m,s) \
- do {if(f) {f__init &= ~2; errno= m;} else opn_err(m,s,a); return(m);} while(0)
-
- static void
-#ifdef KR_headers
-opn_err(m, s, a) int m; char *s; olist *a;
-#else
-opn_err(int m, char *s, olist *a)
-#endif
-{
- if (a->ofnm) {
- /* supply file name to error message */
- if (a->ofnmlen >= f__buflen)
- f__bufadj((int)a->ofnmlen, 0);
- g_char(a->ofnm, a->ofnmlen, f__curunit->ufnm = f__buf);
- }
- f__fatal(m, s);
- }
-
-#ifdef KR_headers
-integer f_open(a) olist *a;
-#else
-integer f_open(olist *a)
-#endif
-{ unit *b;
- integer rv;
- char buf[256], *s, *env;
- cllist x;
- int ufmt;
- FILE *tf;
- int fd, len;
-#ifndef NON_UNIX_STDIO
- int n;
-#endif
- if(f__init != 1) f_init();
- f__external = 1;
- if(a->ounit>=MXUNIT || a->ounit<0)
- err(a->oerr,101,"open");
- f__curunit = b = &f__units[a->ounit];
- if(b->ufd) {
- if(a->ofnm==0)
- {
- same: if (a->oblnk)
- b->ublnk = *a->oblnk == 'z' || *a->oblnk == 'Z';
- return(0);
- }
-#ifdef NON_UNIX_STDIO
- if (b->ufnm
- && strlen(b->ufnm) == a->ofnmlen
- && !strncmp(b->ufnm, a->ofnm, (unsigned)a->ofnmlen))
- goto same;
-#else
- g_char(a->ofnm,a->ofnmlen,buf);
- if (f__inode(buf,&n) == b->uinode && n == b->udev)
- goto same;
-#endif
- x.cunit=a->ounit;
- x.csta=0;
- x.cerr=a->oerr;
- if ((rv = f_clos(&x)) != 0)
- return rv;
- }
- b->url = (int)a->orl;
- b->ublnk = a->oblnk && (*a->oblnk == 'z' || *a->oblnk == 'Z');
- if(a->ofm==0)
- { if(b->url>0) b->ufmt=0;
- else b->ufmt=1;
- }
- else if(*a->ofm=='f' || *a->ofm == 'F') b->ufmt=1;
- else b->ufmt=0;
- ufmt = b->ufmt;
-#ifdef url_Adjust
- if (b->url && !ufmt)
- url_Adjust(b->url);
-#endif
- if (a->ofnm) {
- g_char(a->ofnm,a->ofnmlen,buf);
- if (!buf[0])
- opnerr(a->oerr,107,"open");
- }
- else
- sprintf(buf, "fort.%ld", (long)a->ounit);
- b->uscrtch = 0;
- b->uend=0;
- b->uwrt = 0;
- b->ufd = 0;
- b->urw = 3;
- switch(a->osta ? *a->osta : 'u')
- {
- case 'o':
- case 'O':
-#ifdef NON_POSIX_STDIO
- if (!(tf = fopen(buf,"r")))
- opnerr(a->oerr,errno,"open");
- fclose(tf);
-#else
- if (access(buf,0))
- opnerr(a->oerr,errno,"open");
-#endif
- break;
- case 's':
- case 'S':
- b->uscrtch=1;
-#ifdef HAVE_MKSTEMP /* Allow use of TMPDIR preferentially. */
- env = getenv("TMPDIR");
- if (!env) env = getenv("TEMP");
- if (!env) env = "/tmp";
- len = strlen(env);
- if (len > 256 - sizeof "/tmp.FXXXXXX")
- err (a->oerr, 132, "open");
- strcpy(buf, env);
- strcat(buf, "/tmp.FXXXXXX");
- fd = mkstemp(buf);
- if (fd == -1 || close(fd))
- err (a->oerr, 132, "open");
-#else /* ! defined (HAVE_MKSTEMP) */
-#ifdef HAVE_TEMPNAM /* Allow use of TMPDIR preferentially. */
- s = tempnam (0, buf);
- if (strlen (s) >= sizeof (buf))
- err (a->oerr, 132, "open");
- (void) strcpy (buf, s);
- free (s);
-#else /* ! defined (HAVE_TEMPNAM) */
-#ifdef _POSIX_SOURCE
- tmpnam(buf);
-#else
- (void) strcpy(buf,"tmp.FXXXXXX");
- (void) mktemp(buf);
-#endif
-#endif /* ! defined (HAVE_TEMPNAM) */
-#endif /* ! defined (HAVE_MKSTEMP) */
- goto replace;
- case 'n':
- case 'N':
-#ifdef NON_POSIX_STDIO
- if ((tf = fopen(buf,"r")) || (tf = fopen(buf,"a"))) {
- fclose(tf);
- opnerr(a->oerr,128,"open");
- }
-#else
- if (!access(buf,0))
- opnerr(a->oerr,128,"open");
-#endif
- /* no break */
- case 'r': /* Fortran 90 replace option */
- case 'R':
- replace:
- if (tf = fopen(buf,f__w_mode[0]))
- fclose(tf);
- }
-
- b->ufnm=(char *) malloc((unsigned int)(strlen(buf)+1));
- if(b->ufnm==NULL) opnerr(a->oerr,113,"no space");
- (void) strcpy(b->ufnm,buf);
- if ((s = a->oacc) && b->url)
- ufmt = 0;
- if(!(tf = fopen(buf, f__w_mode[ufmt|2]))) {
- if (tf = fopen(buf, f__r_mode[ufmt]))
- b->urw = 1;
- else if (tf = fopen(buf, f__w_mode[ufmt])) {
- b->uwrt = 1;
- b->urw = 2;
- }
- else
- err(a->oerr, errno, "open");
- }
- b->useek = f__canseek(b->ufd = tf);
-#ifndef NON_UNIX_STDIO
- if((b->uinode = f__inode(buf,&b->udev)) == -1)
- opnerr(a->oerr,108,"open");
-#endif
- if(b->useek)
- if (a->orl)
- rewind(b->ufd);
- else if ((s = a->oacc) && (*s == 'a' || *s == 'A')
- && fseek(b->ufd, 0L, SEEK_END))
- opnerr(a->oerr,129,"open");
- return(0);
-}
-#ifdef KR_headers
-fk_open(seq,fmt,n) ftnint n;
-#else
-fk_open(int seq, int fmt, ftnint n)
-#endif
-{ char nbuf[10];
- olist a;
- int rtn;
- int save_init;
-
- (void) sprintf(nbuf,"fort.%ld",(long)n);
- a.oerr=1;
- a.ounit=n;
- a.ofnm=nbuf;
- a.ofnmlen=strlen(nbuf);
- a.osta=NULL;
- a.oacc= seq==SEQ?"s":"d";
- a.ofm = fmt==FMT?"f":"u";
- a.orl = seq==DIR?1:0;
- a.oblnk=NULL;
- save_init = f__init;
- f__init &= ~2;
- rtn = f_open(&a);
- f__init = save_init | 1;
- return rtn;
-}
diff --git a/contrib/libf2c/libI77/rawio.h b/contrib/libf2c/libI77/rawio.h
deleted file mode 100644
index f3a59fdab4dc..000000000000
--- a/contrib/libf2c/libI77/rawio.h
+++ /dev/null
@@ -1,45 +0,0 @@
-#ifndef KR_headers
-#if defined (MSDOS) && !defined (GO32)
-#include "io.h"
-#ifndef WATCOM
-#define close _close
-#define creat _creat
-#define open _open
-#define read _read
-#define write _write
-#endif /*WATCOM*/
-#endif /*MSDOS*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-#if !(defined (MSDOS) && !defined (GO32))
-#ifdef OPEN_DECL
-extern int creat(const char*,int), open(const char*,int);
-#endif
-extern int close(int);
-#if !(defined(_WIN32) && !defined(__CYGWIN32__))
-extern int read(int,void*,size_t), write(int,void*,size_t);
-#endif
-extern int unlink(const char*);
-#ifndef _POSIX_SOURCE
-#ifndef NON_UNIX_STDIO
-extern FILE *fdopen(int, const char*);
-#endif
-#endif
-#endif /*KR_HEADERS*/
-
-extern char *mktemp(char*);
-
-#ifdef __cplusplus
- }
-#endif
-#endif
-
-#ifndef NO_FCNTL
-#include <fcntl.h>
-#endif
-
-#ifndef O_WRONLY
-#define O_RDONLY 0
-#define O_WRONLY 1
-#endif
diff --git a/contrib/libf2c/libI77/rdfmt.c b/contrib/libf2c/libI77/rdfmt.c
deleted file mode 100644
index 6ddd36958a5b..000000000000
--- a/contrib/libf2c/libI77/rdfmt.c
+++ /dev/null
@@ -1,546 +0,0 @@
-#include "config.h"
-#include <ctype.h>
-#include "f2c.h"
-#include "fio.h"
-
-extern int f__cursor;
-#ifdef KR_headers
-extern double atof();
-#else
-#undef abs
-#undef min
-#undef max
-#include <stdlib.h>
-#endif
-
-#include "fmt.h"
-#include "fp.h"
-
- static int
-#ifdef KR_headers
-rd_Z(n,w,len) Uint *n; ftnlen len;
-#else
-rd_Z(Uint *n, int w, ftnlen len)
-#endif
-{
- long x[9];
- char *s, *s0, *s1, *se, *t;
- int ch, i, w1, w2;
- static char hex[256];
- static int one = 1;
- int bad = 0;
-
- if (!hex['0']) {
- s = "0123456789";
- while(ch = *s++)
- hex[ch] = ch - '0' + 1;
- s = "ABCDEF";
- while(ch = *s++)
- hex[ch] = hex[ch + 'a' - 'A'] = ch - 'A' + 11;
- }
- s = s0 = (char *)x;
- s1 = (char *)&x[4];
- se = (char *)&x[8];
- if (len > 4*sizeof(long))
- return errno = 117;
- while (w) {
- GET(ch);
- if (ch==',' || ch=='\n')
- break;
- w--;
- if (ch > ' ') {
- if (!hex[ch & 0xff])
- bad++;
- *s++ = ch;
- if (s == se) {
- /* discard excess characters */
- for(t = s0, s = s1; t < s1;)
- *t++ = *s++;
- s = s1;
- }
- }
- }
- if (bad)
- return errno = 115;
- w = (int)len;
- w1 = s - s0;
- w2 = w1+1 >> 1;
- t = (char *)n;
- if (*(char *)&one) {
- /* little endian */
- t += w - 1;
- i = -1;
- }
- else
- i = 1;
- for(; w > w2; t += i, --w)
- *t = 0;
- if (!w)
- return 0;
- if (w < w2)
- s0 = s - (w << 1);
- else if (w1 & 1) {
- *t = hex[*s0++ & 0xff] - 1;
- if (!--w)
- return 0;
- t += i;
- }
- do {
- *t = hex[*s0 & 0xff]-1 << 4 | hex[s0[1] & 0xff]-1;
- t += i;
- s0 += 2;
- }
- while(--w);
- return 0;
- }
-
- static int
-#ifdef KR_headers
-rd_I(n,w,len, base) Uint *n; int w; ftnlen len; register int base;
-#else
-rd_I(Uint *n, int w, ftnlen len, register int base)
-#endif
-{
- int bad, ch, sign;
- longint x = 0;
-
- if (w <= 0)
- goto have_x;
- for(;;) {
- GET(ch);
- if (ch != ' ')
- break;
- if (!--w)
- goto have_x;
- }
- sign = 0;
- switch(ch) {
- case ',':
- case '\n':
- w = 0;
- goto have_x;
- case '-':
- sign = 1;
- case '+':
- break;
- default:
- if (ch >= '0' && ch <= '9') {
- x = ch - '0';
- break;
- }
- goto have_x;
- }
- while(--w) {
- GET(ch);
- if (ch >= '0' && ch <= '9') {
- x = x*base + ch - '0';
- continue;
- }
- if (ch != ' ') {
- if (ch == '\n' || ch == ',')
- w = 0;
- break;
- }
- if (f__cblank)
- x *= base;
- }
- if (sign)
- x = -x;
- have_x:
- if(len == sizeof(integer))
- n->il=x;
- else if(len == sizeof(char))
- n->ic = (char)x;
-#ifdef Allow_TYQUAD
- else if (len == sizeof(longint))
- n->ili = x;
-#endif
- else
- n->is = (short)x;
- if (w) {
- while(--w)
- GET(ch);
- return errno = 115;
- }
- return 0;
-}
-
- static int
-#ifdef KR_headers
-rd_L(n,w,len) ftnint *n; ftnlen len;
-#else
-rd_L(ftnint *n, int w, ftnlen len)
-#endif
-{ int ch, dot, lv;
-
- if (w <= 0)
- goto bad;
- for(;;) {
- GET(ch);
- --w;
- if (ch != ' ')
- break;
- if (!w)
- goto bad;
- }
- dot = 0;
- retry:
- switch(ch) {
- case '.':
- if (dot++ || !w)
- goto bad;
- GET(ch);
- --w;
- goto retry;
- case 't':
- case 'T':
- lv = 1;
- break;
- case 'f':
- case 'F':
- lv = 0;
- break;
- default:
- bad:
- for(; w > 0; --w)
- GET(ch);
- /* no break */
- case ',':
- case '\n':
- return errno = 116;
- }
- /* The switch statement that was here
- didn't cut it: It broke down for targets
- where sizeof(char) == sizeof(short). */
- if (len == sizeof(char))
- *(char *)n = (char)lv;
- else if (len == sizeof(short))
- *(short *)n = (short)lv;
- else
- *n = lv;
- while(w-- > 0) {
- GET(ch);
- if (ch == ',' || ch == '\n')
- break;
- }
- return 0;
-}
-
- static int
-#ifdef KR_headers
-rd_F(p, w, d, len) ufloat *p; ftnlen len;
-#else
-rd_F(ufloat *p, int w, int d, ftnlen len)
-#endif
-{
- char s[FMAX+EXPMAXDIGS+4];
- register int ch;
- register char *sp, *spe, *sp1;
- double x;
- int scale1, se;
- long e, exp;
-
- sp1 = sp = s;
- spe = sp + FMAX;
- exp = -d;
- x = 0.;
-
- do {
- GET(ch);
- w--;
- } while (ch == ' ' && w);
- switch(ch) {
- case '-': *sp++ = ch; sp1++; spe++;
- case '+':
- if (!w) goto zero;
- --w;
- GET(ch);
- }
- while(ch == ' ') {
-blankdrop:
- if (!w--) goto zero; GET(ch); }
- while(ch == '0')
- { if (!w--) goto zero; GET(ch); }
- if (ch == ' ' && f__cblank)
- goto blankdrop;
- scale1 = f__scale;
- while(isdigit(ch)) {
-digloop1:
- if (sp < spe) *sp++ = ch;
- else ++exp;
-digloop1e:
- if (!w--) goto done;
- GET(ch);
- }
- if (ch == ' ') {
- if (f__cblank)
- { ch = '0'; goto digloop1; }
- goto digloop1e;
- }
- if (ch == '.') {
- exp += d;
- if (!w--) goto done;
- GET(ch);
- if (sp == sp1) { /* no digits yet */
- while(ch == '0') {
-skip01:
- --exp;
-skip0:
- if (!w--) goto done;
- GET(ch);
- }
- if (ch == ' ') {
- if (f__cblank) goto skip01;
- goto skip0;
- }
- }
- while(isdigit(ch)) {
-digloop2:
- if (sp < spe)
- { *sp++ = ch; --exp; }
-digloop2e:
- if (!w--) goto done;
- GET(ch);
- }
- if (ch == ' ') {
- if (f__cblank)
- { ch = '0'; goto digloop2; }
- goto digloop2e;
- }
- }
- switch(ch) {
- default:
- break;
- case '-': se = 1; goto signonly;
- case '+': se = 0; goto signonly;
- case 'e':
- case 'E':
- case 'd':
- case 'D':
- if (!w--)
- goto bad;
- GET(ch);
- while(ch == ' ') {
- if (!w--)
- goto bad;
- GET(ch);
- }
- se = 0;
- switch(ch) {
- case '-': se = 1;
- case '+':
-signonly:
- if (!w--)
- goto bad;
- GET(ch);
- }
- while(ch == ' ') {
- if (!w--)
- goto bad;
- GET(ch);
- }
- if (!isdigit(ch))
- goto bad;
-
- e = ch - '0';
- for(;;) {
- if (!w--)
- { ch = '\n'; break; }
- GET(ch);
- if (!isdigit(ch)) {
- if (ch == ' ') {
- if (f__cblank)
- ch = '0';
- else continue;
- }
- else
- break;
- }
- e = 10*e + ch - '0';
- if (e > EXPMAX && sp > sp1)
- goto bad;
- }
- if (se)
- exp -= e;
- else
- exp += e;
- scale1 = 0;
- }
- switch(ch) {
- case '\n':
- case ',':
- break;
- default:
-bad:
- return (errno = 115);
- }
-done:
- if (sp > sp1) {
- while(*--sp == '0')
- ++exp;
- if (exp -= scale1)
- sprintf(sp+1, "e%ld", exp);
- else
- sp[1] = 0;
- x = atof(s);
- }
-zero:
- if (len == sizeof(real))
- p->pf = x;
- else
- p->pd = x;
- return(0);
- }
-
-
- static int
-#ifdef KR_headers
-rd_A(p,len) char *p; ftnlen len;
-#else
-rd_A(char *p, ftnlen len)
-#endif
-{ int i,ch;
- for(i=0;i<len;i++)
- { GET(ch);
- *p++=VAL(ch);
- }
- return(0);
-}
- static int
-#ifdef KR_headers
-rd_AW(p,w,len) char *p; ftnlen len;
-#else
-rd_AW(char *p, int w, ftnlen len)
-#endif
-{ int i,ch;
- if(w>=len)
- { for(i=0;i<w-len;i++)
- GET(ch);
- for(i=0;i<len;i++)
- { GET(ch);
- *p++=VAL(ch);
- }
- return(0);
- }
- for(i=0;i<w;i++)
- { GET(ch);
- *p++=VAL(ch);
- }
- for(i=0;i<len-w;i++) *p++=' ';
- return(0);
-}
- static int
-#ifdef KR_headers
-rd_H(n,s) char *s;
-#else
-rd_H(int n, char *s)
-#endif
-{ int i,ch;
- for(i=0;i<n;i++)
- if((ch=(*f__getn)())<0) return(ch);
- else *s++ = ch=='\n'?' ':ch;
- return(1);
-}
- static int
-#ifdef KR_headers
-rd_POS(s) char *s;
-#else
-rd_POS(char *s)
-#endif
-{ char quote;
- int ch;
- quote= *s++;
- for(;*s;s++)
- if(*s==quote && *(s+1)!=quote) break;
- else if((ch=(*f__getn)())<0) return(ch);
- else *s = ch=='\n'?' ':ch;
- return(1);
-}
-#ifdef KR_headers
-rd_ed(p,ptr,len) struct syl *p; char *ptr; ftnlen len;
-#else
-rd_ed(struct syl *p, char *ptr, ftnlen len)
-#endif
-{ int ch;
- for(;f__cursor>0;f__cursor--) if((ch=(*f__getn)())<0) return(ch);
- if(f__cursor<0)
- { if(f__recpos+f__cursor < 0) /*err(elist->cierr,110,"fmt")*/
- f__cursor = -f__recpos; /* is this in the standard? */
- if(f__external == 0) {
- extern char *f__icptr;
- f__icptr += f__cursor;
- }
- else if(f__curunit && f__curunit->useek)
- (void) fseek(f__cf,(long) f__cursor,SEEK_CUR);
- else
- err(f__elist->cierr,106,"fmt");
- f__recpos += f__cursor;
- f__cursor=0;
- }
- switch(p->op)
- {
- default: fprintf(stderr,"rd_ed, unexpected code: %d\n", p->op);
- sig_die(f__fmtbuf, 1);
- case IM:
- case I: ch = rd_I((Uint *)ptr,p->p1,len, 10);
- break;
-
- /* O and OM don't work right for character, double, complex, */
- /* or doublecomplex, and they differ from Fortran 90 in */
- /* showing a minus sign for negative values. */
-
- case OM:
- case O: ch = rd_I((Uint *)ptr, p->p1, len, 8);
- break;
- case L: ch = rd_L((ftnint *)ptr,p->p1,len);
- break;
- case A: ch = rd_A(ptr,len);
- break;
- case AW:
- ch = rd_AW(ptr,p->p1,len);
- break;
- case E: case EE:
- case D:
- case G:
- case GE:
- case F: ch = rd_F((ufloat *)ptr,p->p1,p->p2.i[0],len);
- break;
-
- /* Z and ZM assume 8-bit bytes. */
-
- case ZM:
- case Z:
- ch = rd_Z((Uint *)ptr, p->p1, len);
- break;
- }
- if(ch == 0) return(ch);
- else if(ch == EOF) return(EOF);
- if (f__cf)
- clearerr(f__cf);
- return(errno);
-}
-#ifdef KR_headers
-rd_ned(p) struct syl *p;
-#else
-rd_ned(struct syl *p)
-#endif
-{
- switch(p->op)
- {
- default: fprintf(stderr,"rd_ned, unexpected code: %d\n", p->op);
- sig_die(f__fmtbuf, 1);
- case APOS:
- return(rd_POS(p->p2.s));
- case H: return(rd_H(p->p1,p->p2.s));
- case SLASH: return((*f__donewrec)());
- case TR:
- case X: f__cursor += p->p1;
- return(1);
- case T: f__cursor=p->p1-f__recpos - 1;
- return(1);
- case TL: f__cursor -= p->p1;
- if(f__cursor < -f__recpos) /* TL1000, 1X */
- f__cursor = -f__recpos;
- return(1);
- }
-}
diff --git a/contrib/libf2c/libI77/rewind.c b/contrib/libf2c/libI77/rewind.c
deleted file mode 100644
index 9ba4b239f328..000000000000
--- a/contrib/libf2c/libI77/rewind.c
+++ /dev/null
@@ -1,26 +0,0 @@
-#include "f2c.h"
-#include "fio.h"
-#ifdef KR_headers
-integer f_rew(a) alist *a;
-#else
-integer f_rew(alist *a)
-#endif
-{
- unit *b;
- if (f__init & 2)
- f__fatal (131, "I/O recursion");
- if(a->aunit>=MXUNIT || a->aunit<0)
- err(a->aerr,101,"rewind");
- b = &f__units[a->aunit];
- if(b->ufd == NULL || b->uwrt == 3)
- return(0);
- if(!b->useek)
- err(a->aerr,106,"rewind");
- if(b->uwrt) {
- (void) t_runc(a);
- b->uwrt = 3;
- }
- rewind(b->ufd);
- b->uend=0;
- return(0);
-}
diff --git a/contrib/libf2c/libI77/rsfe.c b/contrib/libf2c/libI77/rsfe.c
deleted file mode 100644
index 1be45310f517..000000000000
--- a/contrib/libf2c/libI77/rsfe.c
+++ /dev/null
@@ -1,81 +0,0 @@
-/* read sequential formatted external */
-#include "config.h"
-#include "f2c.h"
-#include "fio.h"
-#include "fmt.h"
-
-xrd_SL(Void)
-{ int ch;
- if(!f__curunit->uend)
- while((ch=getc(f__cf))!='\n')
- if (ch == EOF) {
- f__curunit->uend = 1;
- break;
- }
- f__cursor=f__recpos=0;
- return(1);
-}
-x_getc(Void)
-{ int ch;
- if(f__curunit->uend) return(EOF);
- ch = getc(f__cf);
- if(ch!=EOF && ch!='\n')
- { f__recpos++;
- return(ch);
- }
- if(ch=='\n')
- { (void) ungetc(ch,f__cf);
- return(ch);
- }
- if(f__curunit->uend || feof(f__cf))
- { errno=0;
- f__curunit->uend=1;
- return(-1);
- }
- return(-1);
-}
-x_endp(Void)
-{
- xrd_SL();
- return f__curunit->uend == 1 ? EOF : 0;
-}
-x_rev(Void)
-{
- (void) xrd_SL();
- return(0);
-}
-#ifdef KR_headers
-integer s_rsfe(a) cilist *a; /* start */
-#else
-integer s_rsfe(cilist *a) /* start */
-#endif
-{ int n;
- if(f__init != 1) f_init();
- f__init = 3;
- f__reading=1;
- f__sequential=1;
- f__formatted=1;
- f__external=1;
- if(n=c_sfe(a)) return(n);
- f__elist=a;
- f__cursor=f__recpos=0;
- f__scale=0;
- f__fmtbuf=a->cifmt;
- f__curunit= &f__units[a->ciunit];
- f__cf=f__curunit->ufd;
- if(pars_f(f__fmtbuf)<0) err(a->cierr,100,"startio");
- f__getn= x_getc;
- f__doed= rd_ed;
- f__doned= rd_ned;
- fmt_bg();
- f__doend=x_endp;
- f__donewrec=xrd_SL;
- f__dorevert=x_rev;
- f__cblank=f__curunit->ublnk;
- f__cplus=0;
- if(f__curunit->uwrt && f__nowreading(f__curunit))
- err(a->cierr,errno,"read start");
- if(f__curunit->uend)
- err(f__elist->ciend,(EOF),"read start");
- return(0);
-}
diff --git a/contrib/libf2c/libI77/rsli.c b/contrib/libf2c/libI77/rsli.c
deleted file mode 100644
index baf2ba548736..000000000000
--- a/contrib/libf2c/libI77/rsli.c
+++ /dev/null
@@ -1,105 +0,0 @@
-#include "f2c.h"
-#include "fio.h"
-#include "lio.h"
-#include "fmt.h" /* for f__doend */
-
-extern flag f__lquit;
-extern int f__lcount;
-extern char *f__icptr;
-extern char *f__icend;
-extern icilist *f__svic;
-extern int f__icnum, f__recpos;
-
-static int i_getc(Void)
-{
- if(f__recpos >= f__svic->icirlen) {
- if (f__recpos++ == f__svic->icirlen)
- return '\n';
- z_rnew();
- }
- f__recpos++;
- if(f__icptr >= f__icend)
- return EOF;
- return(*f__icptr++);
- }
-
- static
-#ifdef KR_headers
-int i_ungetc(ch, f) int ch; FILE *f;
-#else
-int i_ungetc(int ch, FILE *f)
-#endif
-{
- if (--f__recpos == f__svic->icirlen)
- return '\n';
- if (f__recpos < -1)
- err(f__svic->icierr,110,"recend");
- /* *--icptr == ch, and icptr may point to read-only memory */
- return *--f__icptr /* = ch */;
- }
-
- static void
-#ifdef KR_headers
-c_lir(a) icilist *a;
-#else
-c_lir(icilist *a)
-#endif
-{
- extern int l_eof;
- if(f__init != 1) f_init();
- f__init = 3;
- f__reading = 1;
- f__external = 0;
- f__formatted = 1;
- f__svic = a;
- L_len = a->icirlen;
- f__recpos = -1;
- f__icnum = f__recpos = 0;
- f__cursor = 0;
- l_getc = i_getc;
- l_ungetc = i_ungetc;
- l_eof = 0;
- f__icptr = a->iciunit;
- f__icend = f__icptr + a->icirlen*a->icirnum;
- f__cf = 0;
- f__curunit = 0;
- f__elist = (cilist *)a;
- }
-
-
-#ifdef KR_headers
-integer s_rsli(a) icilist *a;
-#else
-integer s_rsli(icilist *a)
-#endif
-{
- f__lioproc = l_read;
- f__lquit = 0;
- f__lcount = 0;
- c_lir(a);
- f__doend = 0;
- return(0);
- }
-
-integer e_rsli(Void)
-{ f__init = 1; return 0; }
-
-#ifdef KR_headers
-integer s_rsni(a) icilist *a;
-#else
-extern int x_rsne(cilist*);
-
-integer s_rsni(icilist *a)
-#endif
-{
- extern int nml_read;
- integer rv;
- cilist ca;
- ca.ciend = a->iciend;
- ca.cierr = a->icierr;
- ca.cifmt = a->icifmt;
- c_lir(a);
- rv = x_rsne(&ca);
- nml_read = 0;
- return rv;
- }
diff --git a/contrib/libf2c/libI77/rsne.c b/contrib/libf2c/libI77/rsne.c
deleted file mode 100644
index a0d0bfe407d8..000000000000
--- a/contrib/libf2c/libI77/rsne.c
+++ /dev/null
@@ -1,608 +0,0 @@
-#include "config.h"
-#include "f2c.h"
-#include "fio.h"
-#include "lio.h"
-
-#define MAX_NL_CACHE 3 /* maximum number of namelist hash tables to cache */
-#define MAXDIM 20 /* maximum number of subscripts */
-
- struct dimen {
- ftnlen extent;
- ftnlen curval;
- ftnlen delta;
- ftnlen stride;
- };
- typedef struct dimen dimen;
-
- struct hashentry {
- struct hashentry *next;
- char *name;
- Vardesc *vd;
- };
- typedef struct hashentry hashentry;
-
- struct hashtab {
- struct hashtab *next;
- Namelist *nl;
- int htsize;
- hashentry *tab[1];
- };
- typedef struct hashtab hashtab;
-
- static hashtab *nl_cache;
- static int n_nlcache;
- static hashentry **zot;
- static int colonseen;
- extern ftnlen f__typesize[];
-
- extern flag f__lquit;
- extern int f__lcount, nml_read;
- extern t_getc(Void);
-
-#ifdef KR_headers
- extern char *malloc(), *memset();
-
-#ifdef ungetc
- static int
-un_getc(x,f__cf) int x; FILE *f__cf;
-{ return ungetc(x,f__cf); }
-#else
-#define un_getc ungetc
- extern int ungetc();
-#endif
-
-#else
-#undef abs
-#undef min
-#undef max
-#include <stdlib.h>
-#include <string.h>
-
-#ifdef ungetc
- static int
-un_getc(int x, FILE *f__cf)
-{ return ungetc(x,f__cf); }
-#else
-#define un_getc ungetc
-extern int ungetc(int, FILE*); /* for systems with a buggy stdio.h */
-#endif
-#endif
-
- static Vardesc *
-#ifdef KR_headers
-hash(ht, s) hashtab *ht; register char *s;
-#else
-hash(hashtab *ht, register char *s)
-#endif
-{
- register int c, x;
- register hashentry *h;
- char *s0 = s;
-
- for(x = 0; c = *s++; x = x & 0x4000 ? ((x << 1) & 0x7fff) + 1 : x << 1)
- x += c;
- for(h = *(zot = ht->tab + x % ht->htsize); h; h = h->next)
- if (!strcmp(s0, h->name))
- return h->vd;
- return 0;
- }
-
- hashtab *
-#ifdef KR_headers
-mk_hashtab(nl) Namelist *nl;
-#else
-mk_hashtab(Namelist *nl)
-#endif
-{
- int nht, nv;
- hashtab *ht;
- Vardesc *v, **vd, **vde;
- hashentry *he;
-
- hashtab **x, **x0, *y;
- for(x = &nl_cache; y = *x; x0 = x, x = &y->next)
- if (nl == y->nl)
- return y;
- if (n_nlcache >= MAX_NL_CACHE) {
- /* discard least recently used namelist hash table */
- y = *x0;
- free((char *)y->next);
- y->next = 0;
- }
- else
- n_nlcache++;
- nv = nl->nvars;
- if (nv >= 0x4000)
- nht = 0x7fff;
- else {
- for(nht = 1; nht < nv; nht <<= 1);
- nht += nht - 1;
- }
- ht = (hashtab *)malloc(sizeof(hashtab) + (nht-1)*sizeof(hashentry *)
- + nv*sizeof(hashentry));
- if (!ht)
- return 0;
- he = (hashentry *)&ht->tab[nht];
- ht->nl = nl;
- ht->htsize = nht;
- ht->next = nl_cache;
- nl_cache = ht;
- memset((char *)ht->tab, 0, nht*sizeof(hashentry *));
- vd = nl->vars;
- vde = vd + nv;
- while(vd < vde) {
- v = *vd++;
- if (!hash(ht, v->name)) {
- he->next = *zot;
- *zot = he;
- he->name = v->name;
- he->vd = v;
- he++;
- }
- }
- return ht;
- }
-
-static char Alpha[256], Alphanum[256];
-
- static VOID
-nl_init(Void) {
- register char *s;
- register int c;
-
- for(s = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; c = *s++; )
- Alpha[c]
- = Alphanum[c]
- = Alpha[c + 'a' - 'A']
- = Alphanum[c + 'a' - 'A']
- = c;
- for(s = "0123456789_"; c = *s++; )
- Alphanum[c] = c;
- }
-
-#define GETC(x) (x=(*l_getc)())
-#define Ungetc(x,y) (*l_ungetc)(x,y)
-
- static int
-#ifdef KR_headers
-getname(s, slen) register char *s; int slen;
-#else
-getname(register char *s, int slen)
-#endif
-{
- register char *se = s + slen - 1;
- register int ch;
-
- GETC(ch);
- if (!(*s++ = Alpha[ch & 0xff])) {
- if (ch != EOF)
- ch = 115;
- errfl(f__elist->cierr, ch, "namelist read");
- }
- while(*s = Alphanum[GETC(ch) & 0xff])
- if (s < se)
- s++;
- if (ch == EOF)
- err(f__elist->cierr, EOF, "namelist read");
- if (ch > ' ')
- Ungetc(ch,f__cf);
- return *s = 0;
- }
-
- static int
-#ifdef KR_headers
-getnum(chp, val) int *chp; ftnlen *val;
-#else
-getnum(int *chp, ftnlen *val)
-#endif
-{
- register int ch, sign;
- register ftnlen x;
-
- while(GETC(ch) <= ' ' && ch >= 0);
- if (ch == '-') {
- sign = 1;
- GETC(ch);
- }
- else {
- sign = 0;
- if (ch == '+')
- GETC(ch);
- }
- x = ch - '0';
- if (x < 0 || x > 9)
- return 115;
- while(GETC(ch) >= '0' && ch <= '9')
- x = 10*x + ch - '0';
- while(ch <= ' ' && ch >= 0)
- GETC(ch);
- if (ch == EOF)
- return EOF;
- *val = sign ? -x : x;
- *chp = ch;
- return 0;
- }
-
- static int
-#ifdef KR_headers
-getdimen(chp, d, delta, extent, x1)
- int *chp; dimen *d; ftnlen delta, extent, *x1;
-#else
-getdimen(int *chp, dimen *d, ftnlen delta, ftnlen extent, ftnlen *x1)
-#endif
-{
- register int k;
- ftnlen x2, x3;
-
- if (k = getnum(chp, x1))
- return k;
- x3 = 1;
- if (*chp == ':') {
- if (k = getnum(chp, &x2))
- return k;
- x2 -= *x1;
- if (*chp == ':') {
- if (k = getnum(chp, &x3))
- return k;
- if (!x3)
- return 123;
- x2 /= x3;
- colonseen = 1;
- }
- if (x2 < 0 || x2 >= extent)
- return 123;
- d->extent = x2 + 1;
- }
- else
- d->extent = 1;
- d->curval = 0;
- d->delta = delta;
- d->stride = x3;
- return 0;
- }
-
-#ifndef No_Namelist_Questions
- static Void
-#ifdef KR_headers
-print_ne(a) cilist *a;
-#else
-print_ne(cilist *a)
-#endif
-{
- flag intext = f__external;
- int rpsave = f__recpos;
- FILE *cfsave = f__cf;
- unit *usave = f__curunit;
- cilist t;
- t = *a;
- t.ciunit = 6;
- s_wsne(&t);
- fflush(f__cf);
- f__external = intext;
- f__reading = 1;
- f__recpos = rpsave;
- f__cf = cfsave;
- f__curunit = usave;
- f__elist = a;
- }
-#endif
-
- static char where0[] = "namelist read start ";
-
-#ifdef KR_headers
-x_rsne(a) cilist *a;
-#else
-x_rsne(cilist *a)
-#endif
-{
- int ch, got1, k, n, nd, quote, readall;
- Namelist *nl;
- static char where[] = "namelist read";
- char buf[64];
- hashtab *ht;
- Vardesc *v;
- dimen *dn, *dn0, *dn1;
- ftnlen *dims, *dims1;
- ftnlen b, b0, b1, ex, no, nomax, size, span;
- ftnint no1, type;
- char *vaddr;
- long iva, ivae;
- dimen dimens[MAXDIM], substr;
-
- if (!Alpha['a'])
- nl_init();
- f__reading=1;
- f__formatted=1;
- got1 = 0;
- top:
- for(;;) switch(GETC(ch)) {
- case EOF:
- eof:
- err(a->ciend,(EOF),where0);
- case '&':
- case '$':
- goto have_amp;
-#ifndef No_Namelist_Questions
- case '?':
- print_ne(a);
- continue;
-#endif
- default:
- if (ch <= ' ' && ch >= 0)
- continue;
-#ifndef No_Namelist_Comments
- while(GETC(ch) != '\n')
- if (ch == EOF)
- goto eof;
-#else
- errfl(a->cierr, 115, where0);
-#endif
- }
- have_amp:
- if (ch = getname(buf,sizeof(buf)))
- return ch;
- nl = (Namelist *)a->cifmt;
- if (strcmp(buf, nl->name))
-#ifdef No_Bad_Namelist_Skip
- errfl(a->cierr, 118, where0);
-#else
- {
- fprintf(stderr,
- "Skipping namelist \"%s\": seeking namelist \"%s\".\n",
- buf, nl->name);
- fflush(stderr);
- for(;;) switch(GETC(ch)) {
- case EOF:
- err(a->ciend, EOF, where0);
- case '/':
- case '&':
- case '$':
- if (f__external)
- e_rsle();
- else
- z_rnew();
- goto top;
- case '"':
- case '\'':
- quote = ch;
- more_quoted:
- while(GETC(ch) != quote)
- if (ch == EOF)
- err(a->ciend, EOF, where0);
- if (GETC(ch) == quote)
- goto more_quoted;
- Ungetc(ch,f__cf);
- default:
- continue;
- }
- }
-#endif
- ht = mk_hashtab(nl);
- if (!ht)
- errfl(f__elist->cierr, 113, where0);
- for(;;) {
- for(;;) switch(GETC(ch)) {
- case EOF:
- if (got1)
- return 0;
- err(a->ciend, EOF, where0);
- case '/':
- case '$':
- case '&':
- return 0;
- default:
- if (ch <= ' ' && ch >= 0 || ch == ',')
- continue;
- Ungetc(ch,f__cf);
- if (ch = getname(buf,sizeof(buf)))
- return ch;
- goto havename;
- }
- havename:
- v = hash(ht,buf);
- if (!v)
- errfl(a->cierr, 119, where);
- while(GETC(ch) <= ' ' && ch >= 0);
- vaddr = v->addr;
- type = v->type;
- if (type < 0) {
- size = -type;
- type = TYCHAR;
- }
- else
- size = f__typesize[type];
- ivae = size;
- iva = readall = 0;
- if (ch == '(' /*)*/ ) {
- dn = dimens;
- if (!(dims = v->dims)) {
- if (type != TYCHAR)
- errfl(a->cierr, 122, where);
- if (k = getdimen(&ch, dn, (ftnlen)size,
- (ftnlen)size, &b))
- errfl(a->cierr, k, where);
- if (ch != ')')
- errfl(a->cierr, 115, where);
- b1 = dn->extent;
- if (--b < 0 || b + b1 > size)
- return 124;
- iva += b;
- size = b1;
- while(GETC(ch) <= ' ' && ch >= 0);
- goto scalar;
- }
- nd = (int)dims[0];
- nomax = span = dims[1];
- ivae = iva + size*nomax;
- colonseen = 0;
- if (k = getdimen(&ch, dn, size, nomax, &b))
- errfl(a->cierr, k, where);
- no = dn->extent;
- b0 = dims[2];
- dims1 = dims += 3;
- ex = 1;
- for(n = 1; n++ < nd; dims++) {
- if (ch != ',')
- errfl(a->cierr, 115, where);
- dn1 = dn + 1;
- span /= *dims;
- if (k = getdimen(&ch, dn1, dn->delta**dims,
- span, &b1))
- errfl(a->cierr, k, where);
- ex *= *dims;
- b += b1*ex;
- no *= dn1->extent;
- dn = dn1;
- }
- if (ch != ')')
- errfl(a->cierr, 115, where);
- readall = 1 - colonseen;
- b -= b0;
- if (b < 0 || b >= nomax)
- errfl(a->cierr, 125, where);
- iva += size * b;
- dims = dims1;
- while(GETC(ch) <= ' ' && ch >= 0);
- no1 = 1;
- dn0 = dimens;
- if (type == TYCHAR && ch == '(' /*)*/) {
- if (k = getdimen(&ch, &substr, size, size, &b))
- errfl(a->cierr, k, where);
- if (ch != ')')
- errfl(a->cierr, 115, where);
- b1 = substr.extent;
- if (--b < 0 || b + b1 > size)
- return 124;
- iva += b;
- b0 = size;
- size = b1;
- while(GETC(ch) <= ' ' && ch >= 0);
- if (b1 < b0)
- goto delta_adj;
- }
- if (readall)
- goto delta_adj;
- for(; dn0 < dn; dn0++) {
- if (dn0->extent != *dims++ || dn0->stride != 1)
- break;
- no1 *= dn0->extent;
- }
- if (dn0 == dimens && dimens[0].stride == 1) {
- no1 = dimens[0].extent;
- dn0++;
- }
- delta_adj:
- ex = 0;
- for(dn1 = dn0; dn1 <= dn; dn1++)
- ex += (dn1->extent-1)
- * (dn1->delta *= dn1->stride);
- for(dn1 = dn; dn1 > dn0; dn1--) {
- ex -= (dn1->extent - 1) * dn1->delta;
- dn1->delta -= ex;
- }
- }
- else if (dims = v->dims) {
- no = no1 = dims[1];
- ivae = iva + no*size;
- }
- else
- scalar:
- no = no1 = 1;
- if (ch != '=')
- errfl(a->cierr, 115, where);
- got1 = nml_read = 1;
- f__lcount = 0;
- readloop:
- for(;;) {
- if (iva >= ivae || iva < 0) {
- f__lquit = 1;
- goto mustend;
- }
- else if (iva + no1*size > ivae)
- no1 = (ivae - iva)/size;
- f__lquit = 0;
- if (k = l_read(&no1, vaddr + iva, size, type))
- return k;
- if (f__lquit == 1)
- return 0;
- if (readall) {
- iva += dn0->delta;
- if (f__lcount > 0) {
- no1 = (ivae - iva)/size;
- if (no1 > f__lcount)
- no1 = f__lcount;
- if (k = l_read(&no1, vaddr + iva,
- size, type))
- return k;
- iva += no1 * dn0->delta;
- }
- }
- mustend:
- GETC(ch);
- if (readall)
- if (iva >= ivae)
- readall = 0;
- else for(;;) {
- switch(ch) {
- case ' ':
- case '\t':
- case '\n':
- GETC(ch);
- continue;
- }
- break;
- }
- if (ch == '/' || ch == '$' || ch == '&') {
- f__lquit = 1;
- return 0;
- }
- else if (f__lquit) {
- while(ch <= ' ' && ch >= 0)
- GETC(ch);
- Ungetc(ch,f__cf);
- if (!Alpha[ch & 0xff] && ch >= 0)
- errfl(a->cierr, 125, where);
- break;
- }
- Ungetc(ch,f__cf);
- if (readall && !Alpha[ch & 0xff])
- goto readloop;
- if ((no -= no1) <= 0)
- break;
- for(dn1 = dn0; dn1 <= dn; dn1++) {
- if (++dn1->curval < dn1->extent) {
- iva += dn1->delta;
- goto readloop;
- }
- dn1->curval = 0;
- }
- break;
- }
- }
- }
-
- integer
-#ifdef KR_headers
-s_rsne(a) cilist *a;
-#else
-s_rsne(cilist *a)
-#endif
-{
- extern int l_eof;
- int n;
-
- f__external=1;
- l_eof = 0;
- if(n = c_le(a))
- return n;
- if(f__curunit->uwrt && f__nowreading(f__curunit))
- err(a->cierr,errno,where0);
- l_getc = t_getc;
- l_ungetc = un_getc;
- f__doend = xrd_SL;
- n = x_rsne(a);
- nml_read = 0;
- if (n)
- return n;
- return e_rsle();
- }
diff --git a/contrib/libf2c/libI77/sfe.c b/contrib/libf2c/libI77/sfe.c
deleted file mode 100644
index 77ade5b5a7f5..000000000000
--- a/contrib/libf2c/libI77/sfe.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/* sequential formatted external common routines*/
-#include "f2c.h"
-#include "fio.h"
-
-extern char *f__fmtbuf;
-
-integer e_rsfe(Void)
-{ int n;
- f__init = 1;
- n=en_fio();
- f__fmtbuf=NULL;
- return(n);
-}
-#ifdef KR_headers
-c_sfe(a) cilist *a; /* check */
-#else
-c_sfe(cilist *a) /* check */
-#endif
-{ unit *p;
- if(a->ciunit >= MXUNIT || a->ciunit<0)
- err(a->cierr,101,"startio");
- p = &f__units[a->ciunit];
- if(p->ufd==NULL && fk_open(SEQ,FMT,a->ciunit)) err(a->cierr,114,"sfe");
- if(!p->ufmt) err(a->cierr,102,"sfe");
- return(0);
-}
-integer e_wsfe(Void)
-{
- int n;
- f__init = 1;
- n = en_fio();
- f__fmtbuf=NULL;
-#ifdef ALWAYS_FLUSH
- if (!n && fflush(f__cf))
- err(f__elist->cierr, errno, "write end");
-#endif
- return n;
-}
diff --git a/contrib/libf2c/libI77/stamp-h.in b/contrib/libf2c/libI77/stamp-h.in
deleted file mode 100644
index 9788f70238c9..000000000000
--- a/contrib/libf2c/libI77/stamp-h.in
+++ /dev/null
@@ -1 +0,0 @@
-timestamp
diff --git a/contrib/libf2c/libI77/sue.c b/contrib/libf2c/libI77/sue.c
deleted file mode 100644
index e7dbba02bd48..000000000000
--- a/contrib/libf2c/libI77/sue.c
+++ /dev/null
@@ -1,88 +0,0 @@
-#include "config.h"
-#include "f2c.h"
-#include "fio.h"
-extern uiolen f__reclen;
-long f__recloc;
-
-#ifdef KR_headers
-c_sue(a) cilist *a;
-#else
-c_sue(cilist *a)
-#endif
-{
- f__external=f__sequential=1;
- f__formatted=0;
- f__curunit = &f__units[a->ciunit];
- if(a->ciunit >= MXUNIT || a->ciunit < 0)
- err(a->cierr,101,"startio");
- f__elist=a;
- if(f__curunit->ufd==NULL && fk_open(SEQ,UNF,a->ciunit))
- err(a->cierr,114,"sue");
- f__cf=f__curunit->ufd;
- if(f__curunit->ufmt) err(a->cierr,103,"sue");
- if(!f__curunit->useek) err(a->cierr,103,"sue");
- return(0);
-}
-#ifdef KR_headers
-integer s_rsue(a) cilist *a;
-#else
-integer s_rsue(cilist *a)
-#endif
-{
- int n;
- if(f__init != 1) f_init();
- f__init = 3;
- f__reading=1;
- if(n=c_sue(a)) return(n);
- f__recpos=0;
- if(f__curunit->uwrt && f__nowreading(f__curunit))
- err(a->cierr, errno, "read start");
- if(fread((char *)&f__reclen,sizeof(uiolen),1,f__cf)
- != 1)
- { if(feof(f__cf))
- { f__curunit->uend = 1;
- err(a->ciend, EOF, "start");
- }
- clearerr(f__cf);
- err(a->cierr, errno, "start");
- }
- return(0);
-}
-#ifdef KR_headers
-integer s_wsue(a) cilist *a;
-#else
-integer s_wsue(cilist *a)
-#endif
-{
- int n;
- if(f__init != 1) f_init();
- f__init = 3;
- if(n=c_sue(a)) return(n);
- f__reading=0;
- f__reclen=0;
- if(f__curunit->uwrt != 1 && f__nowwriting(f__curunit))
- err(a->cierr, errno, "write start");
- f__recloc=ftell(f__cf);
- (void) fseek(f__cf,(long)sizeof(uiolen),SEEK_CUR);
- return(0);
-}
-integer e_wsue(Void)
-{ long loc;
- f__init = 1;
- fwrite((char *)&f__reclen,sizeof(uiolen),1,f__cf);
-#ifdef ALWAYS_FLUSH
- if (fflush(f__cf))
- err(f__elist->cierr, errno, "write end");
-#endif
- loc=ftell(f__cf);
- fseek(f__cf,f__recloc,SEEK_SET);
- fwrite((char *)&f__reclen,sizeof(uiolen),1,f__cf);
- fseek(f__cf,loc,SEEK_SET);
- return(0);
-}
-integer e_rsue(Void)
-{
- f__init = 1;
- (void) fseek(f__cf,(long)(f__reclen-f__recpos+sizeof(uiolen)),SEEK_CUR);
- return(0);
-}
diff --git a/contrib/libf2c/libI77/typesize.c b/contrib/libf2c/libI77/typesize.c
deleted file mode 100644
index 7f42aa1bcc87..000000000000
--- a/contrib/libf2c/libI77/typesize.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include "config.h"
-#include "f2c.h"
-
-ftnlen f__typesize[] = { 0, 0, sizeof(shortint), sizeof(integer),
- sizeof(real), sizeof(doublereal),
- sizeof(complex), sizeof(doublecomplex),
- sizeof(logical), sizeof(char),
- 0, sizeof(integer1),
- sizeof(logical1), sizeof(shortlogical),
-#ifdef Allow_TYQUAD
- sizeof(longint),
-#endif
- 0};
diff --git a/contrib/libf2c/libI77/uio.c b/contrib/libf2c/libI77/uio.c
deleted file mode 100644
index ea733cec06c2..000000000000
--- a/contrib/libf2c/libI77/uio.c
+++ /dev/null
@@ -1,69 +0,0 @@
-#include "f2c.h"
-#include "fio.h"
-#include <sys/types.h>
-uiolen f__reclen;
-
-#ifdef KR_headers
-do_us(number,ptr,len) ftnint *number; char *ptr; ftnlen len;
-#else
-do_us(ftnint *number, char *ptr, ftnlen len)
-#endif
-{
- if(f__reading)
- {
- f__recpos += (int)(*number * len);
- if(f__recpos>f__reclen)
- err(f__elist->cierr, 110, "do_us");
- if (fread(ptr,(size_t)len,(size_t)(*number),f__cf) != *number)
- err(f__elist->ciend, EOF, "do_us");
- return(0);
- }
- else
- {
- f__reclen += *number * len;
- (void) fwrite(ptr,(size_t)len,(size_t)(*number),f__cf);
- return(0);
- }
-}
-#ifdef KR_headers
-integer do_ud(number,ptr,len) ftnint *number; char *ptr; ftnlen len;
-#else
-integer do_ud(ftnint *number, char *ptr, ftnlen len)
-#endif
-{
- f__recpos += (int)(*number * len);
- if(f__recpos > f__curunit->url && f__curunit->url!=1)
- err(f__elist->cierr,110,"do_ud");
- if(f__reading)
- {
-#ifdef Pad_UDread
-#ifdef KR_headers
- int i;
-#else
- size_t i;
-#endif
- if (!(i = fread(ptr,(size_t)len,(size_t)(*number),f__cf))
- && !(f__recpos - *number*len))
- err(f__elist->cierr,EOF,"do_ud");
- if (i < *number)
- memset(ptr + i*len, 0, (*number - i)*len);
- return 0;
-#else
- if(fread(ptr,(size_t)len,(size_t)(*number),f__cf) != *number)
- err(f__elist->cierr,EOF,"do_ud");
- else return(0);
-#endif
- }
- (void) fwrite(ptr,(size_t)len,(size_t)(*number),f__cf);
- return(0);
-}
-#ifdef KR_headers
-integer do_uio(number,ptr,len) ftnint *number; char *ptr; ftnlen len;
-#else
-integer do_uio(ftnint *number, char *ptr, ftnlen len)
-#endif
-{
- if(f__sequential)
- return(do_us(number,ptr,len));
- else return(do_ud(number,ptr,len));
-}
diff --git a/contrib/libf2c/libI77/util.c b/contrib/libf2c/libI77/util.c
deleted file mode 100644
index 8280ac06a7fc..000000000000
--- a/contrib/libf2c/libI77/util.c
+++ /dev/null
@@ -1,54 +0,0 @@
-#include "config.h"
-#ifndef NON_UNIX_STDIO
-#define _INCLUDE_POSIX_SOURCE /* for HP-UX */
-#define _INCLUDE_XOPEN_SOURCE /* for HP-UX */
-#include <sys/types.h>
-#include <sys/stat.h>
-#endif
-#include "f2c.h"
-#include "fio.h"
-
- VOID
-#ifdef KR_headers
-g_char(a,alen,b) char *a,*b; ftnlen alen;
-#else
-g_char(char *a, ftnlen alen, char *b)
-#endif
-{
- char *x = a + alen, *y = b + alen;
-
- for(;; y--) {
- if (x <= a) {
- *b = 0;
- return;
- }
- if (*--x != ' ')
- break;
- }
- *y-- = 0;
- do *y-- = *x;
- while(x-- > a);
- }
-
- VOID
-#ifdef KR_headers
-b_char(a,b,blen) char *a,*b; ftnlen blen;
-#else
-b_char(char *a, char *b, ftnlen blen)
-#endif
-{ int i;
- for(i=0;i<blen && *a!=0;i++) *b++= *a++;
- for(;i<blen;i++) *b++=' ';
-}
-#ifndef NON_UNIX_STDIO
-#ifdef KR_headers
-long f__inode(a, dev) char *a; int *dev;
-#else
-long f__inode(char *a, int *dev)
-#endif
-{ struct stat x;
- if(stat(a,&x)<0) return(-1);
- *dev = x.st_dev;
- return(x.st_ino);
-}
-#endif
diff --git a/contrib/libf2c/libI77/wref.c b/contrib/libf2c/libI77/wref.c
deleted file mode 100644
index a10bcaa1236c..000000000000
--- a/contrib/libf2c/libI77/wref.c
+++ /dev/null
@@ -1,276 +0,0 @@
-#include "f2c.h"
-#include "fio.h"
-#ifndef VAX
-#include <ctype.h>
-#endif
-
-#ifndef KR_headers
-#undef abs
-#undef min
-#undef max
-#include <stdlib.h>
-#include <string.h>
-#endif
-
-#include "fmt.h"
-#include "fp.h"
-
-#ifdef KR_headers
-wrt_E(p,w,d,e,len) ufloat *p; ftnlen len;
-#else
-wrt_E(ufloat *p, int w, int d, int e, ftnlen len)
-#endif
-{
- char buf[FMAX+EXPMAXDIGS+4], *s, *se;
- int d1, delta, e1, i, sign, signspace;
- double dd;
-#ifdef WANT_LEAD_0
- int insert0 = 0;
-#endif
-#ifndef VAX
- int e0 = e;
-#endif
-
- if(e <= 0)
- e = 2;
- if(f__scale) {
- if(f__scale >= d + 2 || f__scale <= -d)
- goto nogood;
- }
- if(f__scale <= 0)
- --d;
- if (len == sizeof(real))
- dd = p->pf;
- else
- dd = p->pd;
- if (dd < 0.) {
- signspace = sign = 1;
- dd = -dd;
- }
- else {
- sign = 0;
- signspace = (int)f__cplus;
-#ifndef VAX
- if (!dd)
- dd = 0.; /* avoid -0 */
-#endif
- }
- delta = w - (2 /* for the . and the d adjustment above */
- + 2 /* for the E+ */ + signspace + d + e);
-#ifdef WANT_LEAD_0
- if (f__scale <= 0 && delta > 0) {
- delta--;
- insert0 = 1;
- }
- else
-#endif
- if (delta < 0) {
-nogood:
- while(--w >= 0)
- PUT('*');
- return(0);
- }
- if (f__scale < 0)
- d += f__scale;
- if (d > FMAX) {
- d1 = d - FMAX;
- d = FMAX;
- }
- else
- d1 = 0;
- sprintf(buf,"%#.*E", d, dd);
-#ifndef VAX
- /* check for NaN, Infinity */
- if (!isdigit(buf[0])) {
- switch(buf[0]) {
- case 'n':
- case 'N':
- signspace = 0; /* no sign for NaNs */
- }
- delta = w - strlen(buf) - signspace;
- if (delta < 0)
- goto nogood;
- while(--delta >= 0)
- PUT(' ');
- if (signspace)
- PUT(sign ? '-' : '+');
- for(s = buf; *s; s++)
- PUT(*s);
- return 0;
- }
-#endif
- se = buf + d + 3;
-#ifdef GOOD_SPRINTF_EXPONENT /* When possible, exponent has 2 digits. */
- if (f__scale != 1 && dd)
- sprintf(se, "%+.2d", atoi(se) + 1 - f__scale);
-#else
- if (dd)
- sprintf(se, "%+.2d", atoi(se) + 1 - f__scale);
- else
- strcpy(se, "+00");
-#endif
- s = ++se;
- if (e < 2) {
- if (*s != '0')
- goto nogood;
- }
-#ifndef VAX
- /* accommodate 3 significant digits in exponent */
- if (s[2]) {
-#ifdef Pedantic
- if (!e0 && !s[3])
- for(s -= 2, e1 = 2; s[0] = s[1]; s++);
-
- /* Pedantic gives the behavior that Fortran 77 specifies, */
- /* i.e., requires that E be specified for exponent fields */
- /* of more than 3 digits. With Pedantic undefined, we get */
- /* the behavior that Cray displays -- you get a bigger */
- /* exponent field if it fits. */
-#else
- if (!e0) {
- for(s -= 2, e1 = 2; s[0] = s[1]; s++)
-#ifdef CRAY
- delta--;
- if ((delta += 4) < 0)
- goto nogood
-#endif
- ;
- }
-#endif
- else if (e0 >= 0)
- goto shift;
- else
- e1 = e;
- }
- else
- shift:
-#endif
- for(s += 2, e1 = 2; *s; ++e1, ++s)
- if (e1 >= e)
- goto nogood;
- while(--delta >= 0)
- PUT(' ');
- if (signspace)
- PUT(sign ? '-' : '+');
- s = buf;
- i = f__scale;
- if (f__scale <= 0) {
-#ifdef WANT_LEAD_0
- if (insert0)
- PUT('0');
-#endif
- PUT('.');
- for(; i < 0; ++i)
- PUT('0');
- PUT(*s);
- s += 2;
- }
- else if (f__scale > 1) {
- PUT(*s);
- s += 2;
- while(--i > 0)
- PUT(*s++);
- PUT('.');
- }
- if (d1) {
- se -= 2;
- while(s < se) PUT(*s++);
- se += 2;
- do PUT('0'); while(--d1 > 0);
- }
- while(s < se)
- PUT(*s++);
- if (e < 2)
- PUT(s[1]);
- else {
- while(++e1 <= e)
- PUT('0');
- while(*s)
- PUT(*s++);
- }
- return 0;
- }
-
-#ifdef KR_headers
-wrt_F(p,w,d,len) ufloat *p; ftnlen len;
-#else
-wrt_F(ufloat *p, int w, int d, ftnlen len)
-#endif
-{
- int d1, sign, n;
- double x;
- char *b, buf[MAXINTDIGS+MAXFRACDIGS+4], *s;
-
- x= (len==sizeof(real)?p->pf:p->pd);
- if (d < MAXFRACDIGS)
- d1 = 0;
- else {
- d1 = d - MAXFRACDIGS;
- d = MAXFRACDIGS;
- }
- if (x < 0.)
- { x = -x; sign = 1; }
- else {
- sign = 0;
-#ifndef VAX
- if (!x)
- x = 0.;
-#endif
- }
-
- if (n = f__scale)
- if (n > 0)
- do x *= 10.; while(--n > 0);
- else
- do x *= 0.1; while(++n < 0);
-
-#ifdef USE_STRLEN
- sprintf(b = buf, "%#.*f", d, x);
- n = strlen(b) + d1;
-#else
- n = sprintf(b = buf, "%#.*f", d, x) + d1;
-#endif
-
-#ifndef WANT_LEAD_0
- if (buf[0] == '0' && d)
- { ++b; --n; }
-#endif
- if (sign) {
- /* check for all zeros */
- for(s = b;;) {
- while(*s == '0') s++;
- switch(*s) {
- case '.':
- s++; continue;
- case 0:
- sign = 0;
- }
- break;
- }
- }
- if (sign || f__cplus)
- ++n;
- if (n > w) {
-#ifdef WANT_LEAD_0
- if (buf[0] == '0' && --n == w)
- ++b;
- else
-#endif
- {
- while(--w >= 0)
- PUT('*');
- return 0;
- }
- }
- for(w -= n; --w >= 0; )
- PUT(' ');
- if (sign)
- PUT('-');
- else if (f__cplus)
- PUT('+');
- while(n = *b++)
- PUT(n);
- while(--d1 >= 0)
- PUT('0');
- return 0;
- }
diff --git a/contrib/libf2c/libI77/wrtfmt.c b/contrib/libf2c/libI77/wrtfmt.c
deleted file mode 100644
index 37006ba77c28..000000000000
--- a/contrib/libf2c/libI77/wrtfmt.c
+++ /dev/null
@@ -1,366 +0,0 @@
-#include "config.h"
-#include "f2c.h"
-#include "fio.h"
-#include "fmt.h"
-
-extern icilist *f__svic;
-extern char *f__icptr;
-
- static int
-mv_cur(Void) /* shouldn't use fseek because it insists on calling fflush */
- /* instead we know too much about stdio */
-{
- int cursor = f__cursor;
- f__cursor = 0;
- if(f__external == 0) {
- if(cursor < 0) {
- if(f__hiwater < f__recpos)
- f__hiwater = f__recpos;
- f__recpos += cursor;
- f__icptr += cursor;
- if(f__recpos < 0)
- err(f__elist->cierr, 110, "left off");
- }
- else if(cursor > 0) {
- if(f__recpos + cursor >= f__svic->icirlen)
- err(f__elist->cierr, 110, "recend");
- if(f__hiwater <= f__recpos)
- for(; cursor > 0; cursor--)
- (*f__putn)(' ');
- else if(f__hiwater <= f__recpos + cursor) {
- cursor -= f__hiwater - f__recpos;
- f__icptr += f__hiwater - f__recpos;
- f__recpos = f__hiwater;
- for(; cursor > 0; cursor--)
- (*f__putn)(' ');
- }
- else {
- f__icptr += cursor;
- f__recpos += cursor;
- }
- }
- return(0);
- }
- if (cursor > 0) {
- if(f__hiwater <= f__recpos)
- for(;cursor>0;cursor--) (*f__putn)(' ');
- else if(f__hiwater <= f__recpos + cursor) {
- cursor -= f__hiwater - f__recpos;
- f__recpos = f__hiwater;
- for(; cursor > 0; cursor--)
- (*f__putn)(' ');
- }
- else {
- f__recpos += cursor;
- }
- }
- else if (cursor < 0)
- {
- if(cursor + f__recpos < 0)
- err(f__elist->cierr,110,"left off");
- if(f__hiwater < f__recpos)
- f__hiwater = f__recpos;
- f__recpos += cursor;
- }
- return(0);
-}
-
- static int
-#ifdef KR_headers
-wrt_Z(n,w,minlen,len) Uint *n; int w, minlen; ftnlen len;
-#else
-wrt_Z(Uint *n, int w, int minlen, ftnlen len)
-#endif
-{
- register char *s, *se;
- register int i, w1;
- static int one = 1;
- static char hex[] = "0123456789ABCDEF";
- s = (char *)n;
- --len;
- if (*(char *)&one) {
- /* little endian */
- se = s;
- s += len;
- i = -1;
- }
- else {
- se = s + len;
- i = 1;
- }
- for(;; s += i)
- if (s == se || *s)
- break;
- w1 = (i*(se-s) << 1) + 1;
- if (*s & 0xf0)
- w1++;
- if (w1 > w)
- for(i = 0; i < w; i++)
- (*f__putn)('*');
- else {
- if ((minlen -= w1) > 0)
- w1 += minlen;
- while(--w >= w1)
- (*f__putn)(' ');
- while(--minlen >= 0)
- (*f__putn)('0');
- if (!(*s & 0xf0)) {
- (*f__putn)(hex[*s & 0xf]);
- if (s == se)
- return 0;
- s += i;
- }
- for(;; s += i) {
- (*f__putn)(hex[*s >> 4 & 0xf]);
- (*f__putn)(hex[*s & 0xf]);
- if (s == se)
- break;
- }
- }
- return 0;
- }
-
- static int
-#ifdef KR_headers
-wrt_I(n,w,len, base) Uint *n; ftnlen len; register int base;
-#else
-wrt_I(Uint *n, int w, ftnlen len, register int base)
-#endif
-{ int ndigit,sign,spare,i;
- longint x;
- char *ans;
- if(len==sizeof(integer)) x=n->il;
- else if(len == sizeof(char)) x = n->ic;
-#ifdef Allow_TYQUAD
- else if (len == sizeof(longint)) x = n->ili;
-#endif
- else x=n->is;
- ans=f__icvt(x,&ndigit,&sign, base);
- spare=w-ndigit;
- if(sign || f__cplus) spare--;
- if(spare<0)
- for(i=0;i<w;i++) (*f__putn)('*');
- else
- { for(i=0;i<spare;i++) (*f__putn)(' ');
- if(sign) (*f__putn)('-');
- else if(f__cplus) (*f__putn)('+');
- for(i=0;i<ndigit;i++) (*f__putn)(*ans++);
- }
- return(0);
-}
- static int
-#ifdef KR_headers
-wrt_IM(n,w,m,len,base) Uint *n; ftnlen len; int base;
-#else
-wrt_IM(Uint *n, int w, int m, ftnlen len, int base)
-#endif
-{ int ndigit,sign,spare,i,xsign;
- longint x;
- char *ans;
- if(sizeof(integer)==len) x=n->il;
- else if(len == sizeof(char)) x = n->ic;
-#ifdef Allow_TYQUAD
- else if (len == sizeof(longint)) x = n->ili;
-#endif
- else x=n->is;
- ans=f__icvt(x,&ndigit,&sign, base);
- if(sign || f__cplus) xsign=1;
- else xsign=0;
- if(ndigit+xsign>w || m+xsign>w)
- { for(i=0;i<w;i++) (*f__putn)('*');
- return(0);
- }
- if(x==0 && m==0)
- { for(i=0;i<w;i++) (*f__putn)(' ');
- return(0);
- }
- if(ndigit>=m)
- spare=w-ndigit-xsign;
- else
- spare=w-m-xsign;
- for(i=0;i<spare;i++) (*f__putn)(' ');
- if(sign) (*f__putn)('-');
- else if(f__cplus) (*f__putn)('+');
- for(i=0;i<m-ndigit;i++) (*f__putn)('0');
- for(i=0;i<ndigit;i++) (*f__putn)(*ans++);
- return(0);
-}
- static int
-#ifdef KR_headers
-wrt_AP(s) char *s;
-#else
-wrt_AP(char *s)
-#endif
-{ char quote;
- int i;
-
- if(f__cursor && (i = mv_cur()))
- return i;
- quote = *s++;
- for(;*s;s++)
- { if(*s!=quote) (*f__putn)(*s);
- else if(*++s==quote) (*f__putn)(*s);
- else return(1);
- }
- return(1);
-}
- static int
-#ifdef KR_headers
-wrt_H(a,s) char *s;
-#else
-wrt_H(int a, char *s)
-#endif
-{
- int i;
-
- if(f__cursor && (i = mv_cur()))
- return i;
- while(a--) (*f__putn)(*s++);
- return(1);
-}
-#ifdef KR_headers
-wrt_L(n,len, sz) Uint *n; ftnlen sz;
-#else
-wrt_L(Uint *n, int len, ftnlen sz)
-#endif
-{ int i;
- long x;
- if(sizeof(long)==sz) x=n->il;
- else if(sz == sizeof(char)) x = n->ic;
- else x=n->is;
- for(i=0;i<len-1;i++)
- (*f__putn)(' ');
- if(x) (*f__putn)('T');
- else (*f__putn)('F');
- return(0);
-}
- static int
-#ifdef KR_headers
-wrt_A(p,len) char *p; ftnlen len;
-#else
-wrt_A(char *p, ftnlen len)
-#endif
-{
- while(len-- > 0) (*f__putn)(*p++);
- return(0);
-}
- static int
-#ifdef KR_headers
-wrt_AW(p,w,len) char * p; ftnlen len;
-#else
-wrt_AW(char * p, int w, ftnlen len)
-#endif
-{
- while(w>len)
- { w--;
- (*f__putn)(' ');
- }
- while(w-- > 0)
- (*f__putn)(*p++);
- return(0);
-}
-
- static int
-#ifdef KR_headers
-wrt_G(p,w,d,e,len) ufloat *p; ftnlen len;
-#else
-wrt_G(ufloat *p, int w, int d, int e, ftnlen len)
-#endif
-{ double up = 1,x;
- int i=0,oldscale,n,j;
- x = len==sizeof(real)?p->pf:p->pd;
- if(x < 0 ) x = -x;
- if(x<.1) {
- if (x != 0.)
- return(wrt_E(p,w,d,e,len));
- i = 1;
- goto have_i;
- }
- for(;i<=d;i++,up*=10)
- { if(x>=up) continue;
- have_i:
- oldscale = f__scale;
- f__scale = 0;
- if(e==0) n=4;
- else n=e+2;
- i=wrt_F(p,w-n,d-i,len);
- for(j=0;j<n;j++) (*f__putn)(' ');
- f__scale=oldscale;
- return(i);
- }
- return(wrt_E(p,w,d,e,len));
-}
-#ifdef KR_headers
-w_ed(p,ptr,len) struct syl *p; char *ptr; ftnlen len;
-#else
-w_ed(struct syl *p, char *ptr, ftnlen len)
-#endif
-{
- int i;
-
- if(f__cursor && (i = mv_cur()))
- return i;
- switch(p->op)
- {
- default:
- fprintf(stderr,"w_ed, unexpected code: %d\n", p->op);
- sig_die(f__fmtbuf, 1);
- case I: return(wrt_I((Uint *)ptr,p->p1,len, 10));
- case IM:
- return(wrt_IM((Uint *)ptr,p->p1,p->p2.i[0],len,10));
-
- /* O and OM don't work right for character, double, complex, */
- /* or doublecomplex, and they differ from Fortran 90 in */
- /* showing a minus sign for negative values. */
-
- case O: return(wrt_I((Uint *)ptr, p->p1, len, 8));
- case OM:
- return(wrt_IM((Uint *)ptr,p->p1,p->p2.i[0],len,8));
- case L: return(wrt_L((Uint *)ptr,p->p1, len));
- case A: return(wrt_A(ptr,len));
- case AW:
- return(wrt_AW(ptr,p->p1,len));
- case D:
- case E:
- case EE:
- return(wrt_E((ufloat *)ptr,p->p1,p->p2.i[0],p->p2.i[1],len));
- case G:
- case GE:
- return(wrt_G((ufloat *)ptr,p->p1,p->p2.i[0],p->p2.i[1],len));
- case F: return(wrt_F((ufloat *)ptr,p->p1,p->p2.i[0],len));
-
- /* Z and ZM assume 8-bit bytes. */
-
- case Z: return(wrt_Z((Uint *)ptr,p->p1,0,len));
- case ZM:
- return(wrt_Z((Uint *)ptr,p->p1,p->p2.i[0],len));
- }
-}
-#ifdef KR_headers
-w_ned(p) struct syl *p;
-#else
-w_ned(struct syl *p)
-#endif
-{
- switch(p->op)
- {
- default: fprintf(stderr,"w_ned, unexpected code: %d\n", p->op);
- sig_die(f__fmtbuf, 1);
- case SLASH:
- return((*f__donewrec)());
- case T: f__cursor = p->p1-f__recpos - 1;
- return(1);
- case TL: f__cursor -= p->p1;
- if(f__cursor < -f__recpos) /* TL1000, 1X */
- f__cursor = -f__recpos;
- return(1);
- case TR:
- case X:
- f__cursor += p->p1;
- return(1);
- case APOS:
- return(wrt_AP(p->p2.s));
- case H:
- return(wrt_H(p->p1,p->p2.s));
- }
-}
diff --git a/contrib/libf2c/libI77/wsfe.c b/contrib/libf2c/libI77/wsfe.c
deleted file mode 100644
index babfb3479d9a..000000000000
--- a/contrib/libf2c/libI77/wsfe.c
+++ /dev/null
@@ -1,75 +0,0 @@
-/*write sequential formatted external*/
-#include "f2c.h"
-#include "fio.h"
-#include "fmt.h"
-extern int f__hiwater;
-
- int
-x_wSL(Void)
-{
- int n = f__putbuf('\n');
- f__hiwater = f__recpos = f__cursor = 0;
- return(n == 0);
-}
-
- static int
-xw_end(Void)
-{
- int n;
-
- if(f__nonl) {
- f__putbuf(n = 0);
- fflush(f__cf);
- }
- else
- n = f__putbuf('\n');
- f__hiwater = f__recpos = f__cursor = 0;
- return n;
-}
-
- static int
-xw_rev(Void)
-{
- int n = 0;
- if(f__workdone) {
- n = f__putbuf('\n');
- f__workdone = 0;
- }
- f__hiwater = f__recpos = f__cursor = 0;
- return n;
-}
-
-#ifdef KR_headers
-integer s_wsfe(a) cilist *a; /*start*/
-#else
-integer s_wsfe(cilist *a) /*start*/
-#endif
-{ int n;
- if(f__init != 1) f_init();
- f__init = 3;
- f__reading=0;
- f__sequential=1;
- f__formatted=1;
- f__external=1;
- if(n=c_sfe(a)) return(n);
- f__elist=a;
- f__hiwater = f__cursor=f__recpos=0;
- f__nonl = 0;
- f__scale=0;
- f__fmtbuf=a->cifmt;
- f__curunit = &f__units[a->ciunit];
- f__cf=f__curunit->ufd;
- if(pars_f(f__fmtbuf)<0) err(a->cierr,100,"startio");
- f__putn= x_putc;
- f__doed= w_ed;
- f__doned= w_ned;
- f__doend=xw_end;
- f__dorevert=xw_rev;
- f__donewrec=x_wSL;
- fmt_bg();
- f__cplus=0;
- f__cblank=f__curunit->ublnk;
- if(f__curunit->uwrt != 1 && f__nowwriting(f__curunit))
- err(a->cierr,errno,"write start");
- return(0);
-}
diff --git a/contrib/libf2c/libI77/wsle.c b/contrib/libf2c/libI77/wsle.c
deleted file mode 100644
index 386e8678aadd..000000000000
--- a/contrib/libf2c/libI77/wsle.c
+++ /dev/null
@@ -1,39 +0,0 @@
-#include "config.h"
-#include "f2c.h"
-#include "fio.h"
-#include "fmt.h"
-#include "lio.h"
-#include "string.h"
-
-#ifdef KR_headers
-integer s_wsle(a) cilist *a;
-#else
-integer s_wsle(cilist *a)
-#endif
-{
- int n;
- if(n=c_le(a)) return(n);
- f__reading=0;
- f__external=1;
- f__formatted=1;
- f__putn = x_putc;
- f__lioproc = l_write;
- L_len = LINE;
- f__donewrec = x_wSL;
- if(f__curunit->uwrt != 1 && f__nowwriting(f__curunit))
- err(a->cierr, errno, "list output start");
- return(0);
- }
-
-integer e_wsle(Void)
-{
- int n;
- f__init = 1;
- n = f__putbuf('\n');
- f__recpos=0;
-#ifdef ALWAYS_FLUSH
- if (!n && fflush(f__cf))
- err(f__elist->cierr, errno, "write end");
-#endif
- return(n);
- }
diff --git a/contrib/libf2c/libI77/wsne.c b/contrib/libf2c/libI77/wsne.c
deleted file mode 100644
index ae3f8178949c..000000000000
--- a/contrib/libf2c/libI77/wsne.c
+++ /dev/null
@@ -1,26 +0,0 @@
-#include "f2c.h"
-#include "fio.h"
-#include "lio.h"
-
- integer
-#ifdef KR_headers
-s_wsne(a) cilist *a;
-#else
-s_wsne(cilist *a)
-#endif
-{
- int n;
-
- if(n=c_le(a))
- return(n);
- f__reading=0;
- f__external=1;
- f__formatted=1;
- f__putn = x_putc;
- L_len = LINE;
- f__donewrec = x_wSL;
- if(f__curunit->uwrt != 1 && f__nowwriting(f__curunit))
- err(a->cierr, errno, "namelist output start");
- x_wsne(a);
- return e_wsle();
- }
diff --git a/contrib/libf2c/libI77/xwsne.c b/contrib/libf2c/libI77/xwsne.c
deleted file mode 100644
index 96fdd0219168..000000000000
--- a/contrib/libf2c/libI77/xwsne.c
+++ /dev/null
@@ -1,72 +0,0 @@
-#include "config.h"
-#include "f2c.h"
-#include "fio.h"
-#include "lio.h"
-#include "fmt.h"
-
-extern int f__Aquote;
-
- static VOID
-nl_donewrec(Void)
-{
- (*f__donewrec)();
- PUT(' ');
- }
-
-#ifdef KR_headers
-x_wsne(a) cilist *a;
-#else
-#include <string.h>
-
- VOID
-x_wsne(cilist *a)
-#endif
-{
- Namelist *nl;
- char *s;
- Vardesc *v, **vd, **vde;
- ftnint number, type;
- ftnlen *dims;
- ftnlen size;
- extern ftnlen f__typesize[];
-
- nl = (Namelist *)a->cifmt;
- PUT('&');
- for(s = nl->name; *s; s++)
- PUT(*s);
- PUT(' ');
- f__Aquote = 1;
- vd = nl->vars;
- vde = vd + nl->nvars;
- while(vd < vde) {
- v = *vd++;
- s = v->name;
-#ifdef No_Extra_Namelist_Newlines
- if (f__recpos+strlen(s)+2 >= L_len)
-#endif
- nl_donewrec();
- while(*s)
- PUT(*s++);
- PUT(' ');
- PUT('=');
- number = (dims = v->dims) ? dims[1] : 1;
- type = v->type;
- if (type < 0) {
- size = -type;
- type = TYCHAR;
- }
- else
- size = f__typesize[type];
- l_write(&number, v->addr, size, type);
- if (vd < vde) {
- if (f__recpos+2 >= L_len)
- nl_donewrec();
- PUT(',');
- PUT(' ');
- }
- else if (f__recpos+1 >= L_len)
- nl_donewrec();
- }
- f__Aquote = 0;
- PUT('/');
- }
diff --git a/contrib/libf2c/libU77/COPYING.LIB b/contrib/libf2c/libU77/COPYING.LIB
deleted file mode 100644
index b1e3f5a26387..000000000000
--- a/contrib/libf2c/libU77/COPYING.LIB
+++ /dev/null
@@ -1,504 +0,0 @@
- GNU LESSER GENERAL PUBLIC LICENSE
- Version 2.1, February 1999
-
- Copyright (C) 1991, 1999 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-[This is the first released version of the Lesser GPL. It also counts
- as the successor of the GNU Library Public License, version 2, hence
- the version number 2.1.]
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-Licenses are intended to guarantee your freedom to share and change
-free software--to make sure the software is free for all its users.
-
- This license, the Lesser General Public License, applies to some
-specially designated software packages--typically libraries--of the
-Free Software Foundation and other authors who decide to use it. You
-can use it too, but we suggest you first think carefully about whether
-this license or the ordinary General Public License is the better
-strategy to use in any particular case, based on the explanations below.
-
- When we speak of free software, we are referring to freedom of use,
-not price. Our General Public Licenses are designed to make sure that
-you have the freedom to distribute copies of free software (and charge
-for this service if you wish); that you receive source code or can get
-it if you want it; that you can change the software and use pieces of
-it in new free programs; and that you are informed that you can do
-these things.
-
- To protect your rights, we need to make restrictions that forbid
-distributors to deny you these rights or to ask you to surrender these
-rights. These restrictions translate to certain responsibilities for
-you if you distribute copies of the library or if you modify it.
-
- For example, if you distribute copies of the library, whether gratis
-or for a fee, you must give the recipients all the rights that we gave
-you. You must make sure that they, too, receive or can get the source
-code. If you link other code with the library, you must provide
-complete object files to the recipients, so that they can relink them
-with the library after making changes to the library and recompiling
-it. And you must show them these terms so they know their rights.
-
- We protect your rights with a two-step method: (1) we copyright the
-library, and (2) we offer you this license, which gives you legal
-permission to copy, distribute and/or modify the library.
-
- To protect each distributor, we want to make it very clear that
-there is no warranty for the free library. Also, if the library is
-modified by someone else and passed on, the recipients should know
-that what they have is not the original version, so that the original
-author's reputation will not be affected by problems that might be
-introduced by others.
-
- Finally, software patents pose a constant threat to the existence of
-any free program. We wish to make sure that a company cannot
-effectively restrict the users of a free program by obtaining a
-restrictive license from a patent holder. Therefore, we insist that
-any patent license obtained for a version of the library must be
-consistent with the full freedom of use specified in this license.
-
- Most GNU software, including some libraries, is covered by the
-ordinary GNU General Public License. This license, the GNU Lesser
-General Public License, applies to certain designated libraries, and
-is quite different from the ordinary General Public License. We use
-this license for certain libraries in order to permit linking those
-libraries into non-free programs.
-
- When a program is linked with a library, whether statically or using
-a shared library, the combination of the two is legally speaking a
-combined work, a derivative of the original library. The ordinary
-General Public License therefore permits such linking only if the
-entire combination fits its criteria of freedom. The Lesser General
-Public License permits more lax criteria for linking other code with
-the library.
-
- We call this license the "Lesser" General Public License because it
-does Less to protect the user's freedom than the ordinary General
-Public License. It also provides other free software developers Less
-of an advantage over competing non-free programs. These disadvantages
-are the reason we use the ordinary General Public License for many
-libraries. However, the Lesser license provides advantages in certain
-special circumstances.
-
- For example, on rare occasions, there may be a special need to
-encourage the widest possible use of a certain library, so that it becomes
-a de-facto standard. To achieve this, non-free programs must be
-allowed to use the library. A more frequent case is that a free
-library does the same job as widely used non-free libraries. In this
-case, there is little to gain by limiting the free library to free
-software only, so we use the Lesser General Public License.
-
- In other cases, permission to use a particular library in non-free
-programs enables a greater number of people to use a large body of
-free software. For example, permission to use the GNU C Library in
-non-free programs enables many more people to use the whole GNU
-operating system, as well as its variant, the GNU/Linux operating
-system.
-
- Although the Lesser General Public License is Less protective of the
-users' freedom, it does ensure that the user of a program that is
-linked with the Library has the freedom and the wherewithal to run
-that program using a modified version of the Library.
-
- The precise terms and conditions for copying, distribution and
-modification follow. Pay close attention to the difference between a
-"work based on the library" and a "work that uses the library". The
-former contains code derived from the library, whereas the latter must
-be combined with the library in order to run.
-
- GNU LESSER GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License Agreement applies to any software library or other
-program which contains a notice placed by the copyright holder or
-other authorized party saying it may be distributed under the terms of
-this Lesser General Public License (also called "this License").
-Each licensee is addressed as "you".
-
- A "library" means a collection of software functions and/or data
-prepared so as to be conveniently linked with application programs
-(which use some of those functions and data) to form executables.
-
- The "Library", below, refers to any such software library or work
-which has been distributed under these terms. A "work based on the
-Library" means either the Library or any derivative work under
-copyright law: that is to say, a work containing the Library or a
-portion of it, either verbatim or with modifications and/or translated
-straightforwardly into another language. (Hereinafter, translation is
-included without limitation in the term "modification".)
-
- "Source code" for a work means the preferred form of the work for
-making modifications to it. For a library, complete source code means
-all the source code for all modules it contains, plus any associated
-interface definition files, plus the scripts used to control compilation
-and installation of the library.
-
- Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running a program using the Library is not restricted, and output from
-such a program is covered only if its contents constitute a work based
-on the Library (independent of the use of the Library in a tool for
-writing it). Whether that is true depends on what the Library does
-and what the program that uses the Library does.
-
- 1. You may copy and distribute verbatim copies of the Library's
-complete source code as you receive it, in any medium, provided that
-you conspicuously and appropriately publish on each copy an
-appropriate copyright notice and disclaimer of warranty; keep intact
-all the notices that refer to this License and to the absence of any
-warranty; and distribute a copy of this License along with the
-Library.
-
- You may charge a fee for the physical act of transferring a copy,
-and you may at your option offer warranty protection in exchange for a
-fee.
-
- 2. You may modify your copy or copies of the Library or any portion
-of it, thus forming a work based on the Library, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) The modified work must itself be a software library.
-
- b) You must cause the files modified to carry prominent notices
- stating that you changed the files and the date of any change.
-
- c) You must cause the whole of the work to be licensed at no
- charge to all third parties under the terms of this License.
-
- d) If a facility in the modified Library refers to a function or a
- table of data to be supplied by an application program that uses
- the facility, other than as an argument passed when the facility
- is invoked, then you must make a good faith effort to ensure that,
- in the event an application does not supply such function or
- table, the facility still operates, and performs whatever part of
- its purpose remains meaningful.
-
- (For example, a function in a library to compute square roots has
- a purpose that is entirely well-defined independent of the
- application. Therefore, Subsection 2d requires that any
- application-supplied function or table used by this function must
- be optional: if the application does not supply it, the square
- root function must still compute square roots.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Library,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Library, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote
-it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Library.
-
-In addition, mere aggregation of another work not based on the Library
-with the Library (or with a work based on the Library) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may opt to apply the terms of the ordinary GNU General Public
-License instead of this License to a given copy of the Library. To do
-this, you must alter all the notices that refer to this License, so
-that they refer to the ordinary GNU General Public License, version 2,
-instead of to this License. (If a newer version than version 2 of the
-ordinary GNU General Public License has appeared, then you can specify
-that version instead if you wish.) Do not make any other change in
-these notices.
-
- Once this change is made in a given copy, it is irreversible for
-that copy, so the ordinary GNU General Public License applies to all
-subsequent copies and derivative works made from that copy.
-
- This option is useful when you wish to copy part of the code of
-the Library into a program that is not a library.
-
- 4. You may copy and distribute the Library (or a portion or
-derivative of it, under Section 2) in object code or executable form
-under the terms of Sections 1 and 2 above provided that you accompany
-it with the complete corresponding machine-readable source code, which
-must be distributed under the terms of Sections 1 and 2 above on a
-medium customarily used for software interchange.
-
- If distribution of object code is made by offering access to copy
-from a designated place, then offering equivalent access to copy the
-source code from the same place satisfies the requirement to
-distribute the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 5. A program that contains no derivative of any portion of the
-Library, but is designed to work with the Library by being compiled or
-linked with it, is called a "work that uses the Library". Such a
-work, in isolation, is not a derivative work of the Library, and
-therefore falls outside the scope of this License.
-
- However, linking a "work that uses the Library" with the Library
-creates an executable that is a derivative of the Library (because it
-contains portions of the Library), rather than a "work that uses the
-library". The executable is therefore covered by this License.
-Section 6 states terms for distribution of such executables.
-
- When a "work that uses the Library" uses material from a header file
-that is part of the Library, the object code for the work may be a
-derivative work of the Library even though the source code is not.
-Whether this is true is especially significant if the work can be
-linked without the Library, or if the work is itself a library. The
-threshold for this to be true is not precisely defined by law.
-
- If such an object file uses only numerical parameters, data
-structure layouts and accessors, and small macros and small inline
-functions (ten lines or less in length), then the use of the object
-file is unrestricted, regardless of whether it is legally a derivative
-work. (Executables containing this object code plus portions of the
-Library will still fall under Section 6.)
-
- Otherwise, if the work is a derivative of the Library, you may
-distribute the object code for the work under the terms of Section 6.
-Any executables containing that work also fall under Section 6,
-whether or not they are linked directly with the Library itself.
-
- 6. As an exception to the Sections above, you may also combine or
-link a "work that uses the Library" with the Library to produce a
-work containing portions of the Library, and distribute that work
-under terms of your choice, provided that the terms permit
-modification of the work for the customer's own use and reverse
-engineering for debugging such modifications.
-
- You must give prominent notice with each copy of the work that the
-Library is used in it and that the Library and its use are covered by
-this License. You must supply a copy of this License. If the work
-during execution displays copyright notices, you must include the
-copyright notice for the Library among them, as well as a reference
-directing the user to the copy of this License. Also, you must do one
-of these things:
-
- a) Accompany the work with the complete corresponding
- machine-readable source code for the Library including whatever
- changes were used in the work (which must be distributed under
- Sections 1 and 2 above); and, if the work is an executable linked
- with the Library, with the complete machine-readable "work that
- uses the Library", as object code and/or source code, so that the
- user can modify the Library and then relink to produce a modified
- executable containing the modified Library. (It is understood
- that the user who changes the contents of definitions files in the
- Library will not necessarily be able to recompile the application
- to use the modified definitions.)
-
- b) Use a suitable shared library mechanism for linking with the
- Library. A suitable mechanism is one that (1) uses at run time a
- copy of the library already present on the user's computer system,
- rather than copying library functions into the executable, and (2)
- will operate properly with a modified version of the library, if
- the user installs one, as long as the modified version is
- interface-compatible with the version that the work was made with.
-
- c) Accompany the work with a written offer, valid for at
- least three years, to give the same user the materials
- specified in Subsection 6a, above, for a charge no more
- than the cost of performing this distribution.
-
- d) If distribution of the work is made by offering access to copy
- from a designated place, offer equivalent access to copy the above
- specified materials from the same place.
-
- e) Verify that the user has already received a copy of these
- materials or that you have already sent this user a copy.
-
- For an executable, the required form of the "work that uses the
-Library" must include any data and utility programs needed for
-reproducing the executable from it. However, as a special exception,
-the materials to be distributed need not include anything that is
-normally distributed (in either source or binary form) with the major
-components (compiler, kernel, and so on) of the operating system on
-which the executable runs, unless that component itself accompanies
-the executable.
-
- It may happen that this requirement contradicts the license
-restrictions of other proprietary libraries that do not normally
-accompany the operating system. Such a contradiction means you cannot
-use both them and the Library together in an executable that you
-distribute.
-
- 7. You may place library facilities that are a work based on the
-Library side-by-side in a single library together with other library
-facilities not covered by this License, and distribute such a combined
-library, provided that the separate distribution of the work based on
-the Library and of the other library facilities is otherwise
-permitted, and provided that you do these two things:
-
- a) Accompany the combined library with a copy of the same work
- based on the Library, uncombined with any other library
- facilities. This must be distributed under the terms of the
- Sections above.
-
- b) Give prominent notice with the combined library of the fact
- that part of it is a work based on the Library, and explaining
- where to find the accompanying uncombined form of the same work.
-
- 8. You may not copy, modify, sublicense, link with, or distribute
-the Library except as expressly provided under this License. Any
-attempt otherwise to copy, modify, sublicense, link with, or
-distribute the Library is void, and will automatically terminate your
-rights under this License. However, parties who have received copies,
-or rights, from you under this License will not have their licenses
-terminated so long as such parties remain in full compliance.
-
- 9. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Library or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Library (or any work based on the
-Library), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Library or works based on it.
-
- 10. Each time you redistribute the Library (or any work based on the
-Library), the recipient automatically receives a license from the
-original licensor to copy, distribute, link with or modify the Library
-subject to these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties with
-this License.
-
- 11. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Library at all. For example, if a patent
-license would not permit royalty-free redistribution of the Library by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Library.
-
-If any portion of this section is held invalid or unenforceable under any
-particular circumstance, the balance of the section is intended to apply,
-and the section as a whole is intended to apply in other circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 12. If the distribution and/or use of the Library is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Library under this License may add
-an explicit geographical distribution limitation excluding those countries,
-so that distribution is permitted only in or among countries not thus
-excluded. In such case, this License incorporates the limitation as if
-written in the body of this License.
-
- 13. The Free Software Foundation may publish revised and/or new
-versions of the Lesser General Public License from time to time.
-Such new versions will be similar in spirit to the present version,
-but may differ in detail to address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Library
-specifies a version number of this License which applies to it and
-"any later version", you have the option of following the terms and
-conditions either of that version or of any later version published by
-the Free Software Foundation. If the Library does not specify a
-license version number, you may choose any version ever published by
-the Free Software Foundation.
-
- 14. If you wish to incorporate parts of the Library into other free
-programs whose distribution conditions are incompatible with these,
-write to the author to ask for permission. For software which is
-copyrighted by the Free Software Foundation, write to the Free
-Software Foundation; we sometimes make exceptions for this. Our
-decision will be guided by the two goals of preserving the free status
-of all derivatives of our free software and of promoting the sharing
-and reuse of software generally.
-
- NO WARRANTY
-
- 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
-WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
-EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
-OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
-KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
-LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
-THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
-WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
-AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
-FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
-CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
-LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
-RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
-FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
-SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Libraries
-
- If you develop a new library, and you want it to be of the greatest
-possible use to the public, we recommend making it free software that
-everyone can redistribute and change. You can do so by permitting
-redistribution under these terms (or, alternatively, under the terms of the
-ordinary General Public License).
-
- To apply these terms, attach the following notices to the library. It is
-safest to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least the
-"copyright" line and a pointer to where the full notice is found.
-
- <one line to give the library's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-Also add information on how to contact you by electronic and paper mail.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the library, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the
- library `Frob' (a library for tweaking knobs) written by James Random Hacker.
-
- <signature of Ty Coon>, 1 April 1990
- Ty Coon, President of Vice
-
-That's all there is to it!
-
-
diff --git a/contrib/libf2c/libU77/Makefile.in b/contrib/libf2c/libU77/Makefile.in
deleted file mode 100644
index ac91077dae0e..000000000000
--- a/contrib/libf2c/libU77/Makefile.in
+++ /dev/null
@@ -1,194 +0,0 @@
-# Makefile for GNU F77 compiler runtime, libc interface.
-# Copyright (C) 1995-1998 Free Software Foundation, Inc.
-# Contributed by Dave Love (d.love@dl.ac.uk).
-#
-#This file is part of the GNU Fortran libU77 library.
-#
-#The GNU Fortran libU77 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,
-#or (at your option) any later version.
-#
-#GNU Fortran 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 General Public License
-#along with GNU Fortran; see the file COPYING. If not, write to
-#the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-#02111-1307, USA.
-
-#### Start of system configuration section. ####
-
-# $(srcdir) must be set to the g77 runtime libU77 source directory
-srcdir = @srcdir@
-VPATH = @srcdir@
-
-# configure sets this to all the -D options appropriate for the
-# configuration.
-DEFS = @DEFS@
-LIBS = @LIBS@
-
-LIBG2C = ../libg2c.a
-
-F2C_H_DIR = @srcdir@/..
-G2C_H_DIR = ..
-CC = @CC@
-CFLAGS = @CFLAGS@
-CPPFLAGS = @CPPFLAGS@
-AR = @AR@
-ARFLAGS = rc
-@SET_MAKE@
-
-SHELL = /bin/sh
-
-#### End of system configuration section. ####
-
-# fio.h is in libI77. config.h is in `.'.
-ALL_CFLAGS = -I. -I$(srcdir) -I$(F2C_H_DIR)/libI77 -I$(G2C_H_DIR) \
- -I$(F2C_H_DIR) $(CPPFLAGS) $(DEFS) $(CFLAGS)
-
-# This could probably be done more elegantly, but it's currently
-# just for running the u77-test test.
-G77DIR = ../../../gcc/
-
-.SUFFIXES:
-.SUFFIXES: .c .o
-
-.c.o:
- $(CC) -c -DSkip_f2c_Undefs $(ALL_CFLAGS) $<
-
-OBJS = VersionU.o gerror_.o perror_.o ierrno_.o itime_.o time_.o \
- unlink_.o fnum_.o getpid_.o getuid_.o getgid_.o kill_.o rand_.o \
- srand_.o irand_.o sleep_.o idate_.o ctime_.o etime_.o \
- dtime_.o isatty_.o ltime_.o fstat_.o stat_.o \
- lstat_.o access_.o link_.o getlog_.o ttynam_.o getcwd_.o symlnk_.o \
- vxttime_.o vxtidate_.o gmtime_.o fdate_.o secnds_.o \
- bes.o dbes.o \
- chdir_.o chmod_.o lnblnk_.o hostnm_.o rename_.o fgetc_.o fputc_.o \
- umask_.o sys_clock_.o date_.o second_.o flush1_.o mclock_.o \
- alarm_.o datetime_.o
-SRCS = Version.c gerror_.c perror_.c ierrno_.c itime_.c time_.c \
- unlink_.c fnum_.c getpid_.c getuid_.c getgid_.c kill_.c rand_.c \
- srand_.c irand_.c sleep_.c idate_.c ctime_.c etime_.c \
- dtime_.c isatty_.c ltime_.c fstat_.c stat_.c \
- lstat_.c access_.c link_.c getlog_.c ttynam_.c getcwd_.c symlnk_.c \
- vxttime_.c vxtidate_.c gmtime_.c fdate_.c secnds_.c \
- bes.c dbes.c \
- chdir_.c chmod_.c lnblnk_.c hostnm_.c rename_.c fgetc_.c fputc_.c \
- umask_.c sys_clock_.c date_.c second_.c flush1_.c mclock_.c \
- alarm_.c datetime_.c
-
-all: ../s-libu77
-
-../s-libu77: $(OBJS)
- echo timestamp > ../s-libu77
-
-archive:
- $(AR) $(ARFLAGS) $(LIBG2C) $(OBJS)
-
-Makefile: Makefile.in config.status
- $(SHELL) config.status
-
-config.status: configure
- rm -f config.cache
- CONFIG_SITE=no-such-file CC='$(CC)' AR='$(AR)' CFLAGS='$(CFLAGS)' \
- CPPFLAGS='$(CPPFLAGS)' $(SHELL) config.status --recheck
-
-${srcdir}/configure: configure.in
- cd ${srcdir} && autoconf
-
-${srcdir}/config.hin: stamp-h.in
-${srcdir}/stamp-h.in: configure.in acconfig.h
- cd ${srcdir} && autoheader
- echo timestamp > ${srcdir}/stamp-h.in
-
-config.h: stamp-h
-stamp-h: config.hin config.status
- $(SHELL) config.status
- echo timestamp > stamp-h
-
-VersionU.o: Version.c
- $(CC) -c $(ALL_CFLAGS) -o $@ $(srcdir)/Version.c
-
-$(OBJS): $(F2C_H_DIR)/f2c.h $(G2C_H_DIR)/g2c.h config.h
-access_.o: access_.c
-ctime_.o: ctime_.c
-dtime_.o: dtime_.c
-etime_.o: etime_.c
-fnum_.o: fnum_.c $(F2C_H_DIR)/libI77/fio.h
-fstat_.o: fstat_.c
-gerror_.o: gerror_.c
-getcwd_.o: getcwd_.c
-getgid_.o: getgid_.c
-getlog_.o: getlog_.c
-getpid_.o: getpid_.c
-getuid_.o: getuid_.c
-idate_.o: idate_.c
-ierrno_.o: ierrno_.c
-irand_.o: irand_.c
-isatty_.o: isatty_.c $(F2C_H_DIR)/libI77/fio.h
-itime_.o: itime_.c
-kill_.o: kill_.c
-link_.o: link_.c
-loc_.o: loc_.c
-lstat_.o: lstat_.c
-ltime_.o: ltime_.c
-perror_.o: perror_.c
-qsort.o: qsort.c
-qsort_.o: qsort_.c
-rand_.o: rand_.c
-rename_.o: rename_.c
-second_.o: second_.c
-sleep_.o: sleep_.c
-srand_.o: srand_.c
-stat_.o: stat_.c
-symlnk_.o: symlnk_.c
-time_.o: time_.c
-ttynam_.o: ttynam_.c
-unlink_.o: unlink_.c
-wait_.o: wait_.c
-vxttime_.o: vxttime_.c
-vtxidate_.o: vxtidate_.c
-fdate_.o: fdate_.c
-gmtime_.o: gmtime_.c
-secnds_.o: secnds_.c
-bes.o: bes.c
-dbes.o: dbes.c
-lnblnk_.o: lnblnk_.c
-chmod_.o: chmod_.c
-chdir_.o: chdir_.c
-hostnm_.o: hostnm_.c
-rename_.o: rename_.c
-fputc_.o: fputc_.c
-fgetc_.o: fgetc_.c
-sys_clock_.o: sys_clock_.c
-date_.o: date_.c
-umask_.o: umask_.c
-flush1_.o: flush1_.c
-mclock_.o: mclock_.c
-alarm_.o: alarm_.c
-datetime_.o: datetime_.c
-
-check:
- -$(G77DIR)g77 -B$(G77DIR) -L.. -g $(srcdir)/u77-test.f \
- -lg2c $(LIBS) -lm -o a.out && ./a.out
- rm -f a.out
-
-install uninstall install-strip dist installcheck installdirs:
-
-mostlyclean:
- rm -f *.o a.out
-
-clean: mostlyclean
- rm -f config.log ../s-libu77
-
-distclean: clean
- rm -f config.cache config.status Makefile config.h stamp.h \
- ../s-libu77 configure
-
-maintainer-clean:
-
-.PHONY: mostlyclean clean distclean maintainer-clean all check uninstall \
- install-strip dist installcheck installdirs archive
diff --git a/contrib/libf2c/libU77/PROJECTS b/contrib/libf2c/libU77/PROJECTS
deleted file mode 100644
index 0cf1383cbf97..000000000000
--- a/contrib/libf2c/libU77/PROJECTS
+++ /dev/null
@@ -1,10 +0,0 @@
- -*- indented-text-*-
-
-* Interface to strget
-
-* Non-blocking (`asynchronous') i/o (per c.l.f. discussion)
-
-* `ioinit'-type routine for various i/o options
-
-* IEEE/VAX/... number format conversion (or XDR interface). This
- might be made optionally transparent per logical unit a la DECtran.
diff --git a/contrib/libf2c/libU77/README b/contrib/libf2c/libU77/README
deleted file mode 100644
index bfedb90bd97d..000000000000
--- a/contrib/libf2c/libU77/README
+++ /dev/null
@@ -1,40 +0,0 @@
-19970811 -*-text-*-
-
-g77 libU77
-----------
-
-This directory contains an implementation of most of the `traditional'
-Unix libU77 routines, mostly an interface to libc and libm routines
-and some extra ones for time and date etc. It's intended for use with
-g77, to whose configuration procedure it's currently tied, but should
-be compatible with f2c otherwise, if using the same f2c.h.
-
-The contents of libU77 and its interfaces aren't consistent across
-implementations. This one is mostly taken from documentation for (an
-old version of) the Convex implementation and the v2 SunPro one.
-As of g77 version 0.5.20, most of these routines have been made
-into g77 intrinsics. Some routines have a version with a name prefixed
-by `vxt', corresponding to the VMS Fortran versions, and these should
-be integrated with g77's intrinsics visibility control.
-
-A few routines are currently missing; in the case of `fork', for
-instance, because they're probably not useful, and in the case of
-`qsort' and those for stream-based i/o handling, because they need
-more effort/research. The configuration should weed out those few
-which correspond to facilities which may not be present on some Unix
-systems, such as symbolic links. It's unclear whether the interfaces
-to the native library random number routines should be retained, since
-their implementation is likely to be something one should avoid
-assiduously.
-
-This library has been tested it under SunOS4.1.3 and Irix5.2 and there
-has been some feedback from Linux; presumably potential problems lie
-mainly with systems with impoverished native C library support which
-haven't been properly taken care of with autoconf.
-
-There's another GPL'd implementation of this stuff which I only found
-out about recently (despite having looked) and I haven't yet checked
-how they should be amalgamated.
-
-Dave Love <d.love@dl.ac.uk> Aug '95
-(minor changes by Craig Burley <burley@gnu.org> Aug '97)
diff --git a/contrib/libf2c/libU77/Version.c b/contrib/libf2c/libU77/Version.c
deleted file mode 100644
index a2ae11889d90..000000000000
--- a/contrib/libf2c/libU77/Version.c
+++ /dev/null
@@ -1,12 +0,0 @@
-static char junk[] = "\n@(#) LIBU77 VERSION 19980709\n";
-
-char __G77_LIBU77_VERSION__[] = "0.5.26 20011023 (release)";
-
-#include <stdio.h>
-
-void
-g77__uvers__ ()
-{
- fprintf (stderr, "__G77_LIBU77_VERSION__: %s", __G77_LIBU77_VERSION__);
- fputs (junk, stderr);
-}
diff --git a/contrib/libf2c/libU77/access_.c b/contrib/libf2c/libU77/access_.c
deleted file mode 100644
index fefdebb0d8dc..000000000000
--- a/contrib/libf2c/libU77/access_.c
+++ /dev/null
@@ -1,80 +0,0 @@
-/* Copyright (C) 1995, 1997 Free Software Foundation, Inc.
-This file is part of GNU Fortran libU77 library.
-
-This library is free software; you can redistribute it and/or modify it
-under the terms of the GNU Library General Public License as published
-by the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-GNU Fortran 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 GNU Fortran; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-#if HAVE_STDLIB_H
-# include <stdlib.h>
-#else
-# include <stdio.h>
-#endif
-
-#include <errno.h>
-#include <limits.h>
-#include "f2c.h"
-
-#ifndef R_OK /* for SVR1-2 */
-# define R_OK 4
-#endif
-#ifndef W_OK
-# define W_OK 2
-#endif
-#ifndef X_OK
-# define X_OK 1
-#endif
-#ifndef F_OK
-# define F_OK 0
-#endif
-
-#ifdef KR_headers
-void g_char ();
-
-integer G77_access_0 (name, mode, Lname, Lmode)
- char *name, *mode;
- ftnlen Lname, Lmode;
-#else
-void g_char(const char *a, ftnlen alen, char *b);
-
-integer G77_access_0 (const char *name, const char *mode, ftnlen Lname, ftnlen Lmode)
-#endif
-{
- char *buff;
- char *bp, *blast;
- int amode, i;
-
- buff = malloc (Lname+1);
- if (!buff) return -1;
- g_char (name, Lname, buff);
- amode = 0;
- for (i=0;i<Lmode;i++) {
- switch (mode[i]) {
- case 'r': amode |= R_OK; break;
- case 'w': amode |= W_OK; break;
- case 'x': amode |= X_OK; break;
- case ' ': amode |= F_OK; break; /* as per Sun, at least */
- default: return EINVAL;
- }
- }
- i = access (buff, amode);
- free (buff);
- return i;
-}
diff --git a/contrib/libf2c/libU77/acconfig.h b/contrib/libf2c/libU77/acconfig.h
deleted file mode 100644
index 778e15410c85..000000000000
--- a/contrib/libf2c/libU77/acconfig.h
+++ /dev/null
@@ -1,11 +0,0 @@
-/* Define as the path of the `chmod' program. */
-#undef CHMOD_PATH
-
-/* Define if your sys/time.h defines struct timezone. */
-#undef HAVE_STRUCT_TIMEZONE
-
-/* Define if your gettimeofday takes only one argument. */
-#undef GETTIMEOFDAY_ONE_ARGUMENT
-
-/* Define if your gettimeofday takes a time zome argument. */
-#undef HAVE_TIMEZONE
diff --git a/contrib/libf2c/libU77/aclocal.m4 b/contrib/libf2c/libU77/aclocal.m4
deleted file mode 100644
index 58f6a675899a..000000000000
--- a/contrib/libf2c/libU77/aclocal.m4
+++ /dev/null
@@ -1,69 +0,0 @@
-dnl Check:
-dnl * If we have gettimeofday;
-dnl * If we have struct timezone for use in calling it;
-dnl * If calling it with a timezone pointer actually works -- this is deemed
-dnl obsolete or undefined on some systems which say you should use a null
-dnl pointer -- and undefine HAVE_TIMEZONE if so;
-dnl * Whether it only takes one arg.
-AC_DEFUN(LIBU77_GETTIMEOFDAY, [
- AC_CHECK_FUNCS(gettimeofday)
- if test "$ac_cv_func_gettimeofday" = yes; then
- AC_CACHE_CHECK([for struct timezone], g77_cv_struct_timezone,
- [AC_TRY_COMPILE([#include <sys/time.h>],
- [struct timezone tz;],
- g77_cv_struct_timezone=yes, g77_cv_struct_timezone=no)])
- if test $g77_cv_struct_timezone = yes; then
- dnl It may be that we can't call gettimeofday with a non-null pointer.
- dnl In that case we'll lie about struct timezone.
- AC_TRY_RUN([
-#ifdef TIME_WITH_SYS_TIME
-#include <sys/time.h>
-#include <time.h>
-#else
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#else
-#include <time.h>
-#endif
-#endif
-main ()
-{
- struct timeval time;
- struct timezone dummy;
- if (gettimeofday (&time, &dummy))
- exit (1);
- else
- exit (0);
-}],
- [AC_DEFINE(HAVE_TIMEZONE)], ,[AC_DEFINE(HAVE_TIMEZONE)])
- fi
- AC_REQUIRE([AC_HEADER_TIME])
- AC_CACHE_CHECK(whether gettimeofday can accept two arguments,
- emacs_cv_gettimeofday_two_arguments,
- AC_TRY_LINK([
-#ifdef TIME_WITH_SYS_TIME
-#include <sys/time.h>
-#include <time.h>
-#else
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#else
-#include <time.h>
-#endif
-#endif
- ],
- [
- struct timeval time;
-#ifdef HAVE_TIMEZONE
- struct timezone dummy;
-#define DUMMY &dummy
-#else
-#define DUMMY NULL
-#endif
- gettimeofday (&time, DUMMY);],
- emacs_cv_gettimeofday_two_arguments=yes,
- emacs_cv_gettimeofday_two_arguments=no))
- if test $emacs_cv_gettimeofday_two_arguments = no; then
- AC_DEFINE(GETTIMEOFDAY_ONE_ARGUMENT)
- fi
- fi])
diff --git a/contrib/libf2c/libU77/alarm_.c b/contrib/libf2c/libU77/alarm_.c
deleted file mode 100644
index e7f9c2ddcc4a..000000000000
--- a/contrib/libf2c/libU77/alarm_.c
+++ /dev/null
@@ -1,70 +0,0 @@
-/* Copyright (C) 1997, 2001 Free Software Foundation, Inc.
-This file is part of GNU Fortran libU77 library.
-
-This library is free software; you can redistribute it and/or modify it
-under the terms of the GNU Library General Public License as published
-by the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-GNU Fortran 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 GNU Fortran; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-
-#include <errno.h> /* for ENOSYS */
-#include "f2c.h"
-
-#ifndef RETSIGTYPE
-/* we shouldn't rely on this... */
-#ifdef KR_headers
-#define RETSIGTYPE int
-#else
-#define RETSIGTYPE void
-#endif
-#endif
-typedef RETSIGTYPE (*sig_type)();
-
-#ifdef KR_headers
-extern sig_type signal();
-#else
-#include <signal.h>
-typedef int (*sig_proc)(int);
-#endif
-
-#ifndef SIG_ERR
-#define SIG_ERR ((sig_type) -1)
-#endif
-
-#ifdef KR_headers
-integer G77_alarm_0 (seconds, proc)
- integer *seconds;
- sig_type proc;
-#else
-integer G77_alarm_0 (integer *seconds, sig_proc proc)
-#endif
-{
- int status;
-#if defined (HAVE_ALARM) && defined (SIGALRM)
- if (signal(SIGALRM, (sig_type)proc) == SIG_ERR)
- status = -1;
- else
- status = alarm (*seconds);
-#else /* ! HAVE_ALARM || ! SIGALRM */
- errno = ENOSYS;
- status = -1;
-#endif
- return status;
-}
diff --git a/contrib/libf2c/libU77/bes.c b/contrib/libf2c/libU77/bes.c
deleted file mode 100644
index 442337fd77a7..000000000000
--- a/contrib/libf2c/libU77/bes.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/* Copyright (C) 1995, 1996 Free Software Foundation, Inc.
-This file is part of GNU Fortran libU77 library.
-
-This library is free software; you can redistribute it and/or modify it
-under the terms of the GNU Library General Public License as published
-by the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-GNU Fortran 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 GNU Fortran; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#if 0 /* Don't include these unless necessary -- jcb. */
-#include "f2c.h"
-#include <math.h>
-
-double G77_besj0_0 (const real *x) {
- return j0 (*x);
-}
-
-double G77_besj1_0 (const real *x) {
- return j1 (*x);
-}
-
-double G77_besjn_0 (const integer *n, real *x) {
- return jn (*n, *x);
- }
-
-double G77_besy0_0 (const real *x) {
- return y0 (*x);
-}
-
-double G77_besy1_0 (const real *x) {
- return y1 (*x);
-}
-
-double G77_besyn_0 (const integer *n, real *x) {
- return yn (*n, *x);
-}
-#endif
diff --git a/contrib/libf2c/libU77/chdir_.c b/contrib/libf2c/libU77/chdir_.c
deleted file mode 100644
index 9bd53fb95d7f..000000000000
--- a/contrib/libf2c/libU77/chdir_.c
+++ /dev/null
@@ -1,57 +0,0 @@
-/* Copyright (C) 1995, 1997 Free Software Foundation, Inc.
-This file is part of GNU Fortran libU77 library.
-
-This library is free software; you can redistribute it and/or modify it
-under the terms of the GNU Library General Public License as published
-by the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-GNU Fortran 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 GNU Fortran; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-#if HAVE_STDLIB_H
-# include <stdlib.h>
-#else
-# include <stdio.h>
-#endif
-
-#include <errno.h>
-#include "f2c.h"
-
-
-#ifdef KR_headers
-void g_char ();
-
-integer G77_chdir_0 (name, Lname)
- char *name;
- ftnlen Lname;
-#else
-void g_char(const char *a, ftnlen alen, char *b);
-
-integer G77_chdir_0 (const char *name, const ftnlen Lname)
-#endif
-{
- char *buff;
- char *bp, *blast;
- int i;
-
- buff = malloc (Lname+1);
- if (!buff) return -1;
- g_char (name, Lname, buff);
- i = chdir (buff);
- free (buff);
- return i ? errno : 0;
-}
diff --git a/contrib/libf2c/libU77/chmod_.c b/contrib/libf2c/libU77/chmod_.c
deleted file mode 100644
index d482d9ed8284..000000000000
--- a/contrib/libf2c/libU77/chmod_.c
+++ /dev/null
@@ -1,82 +0,0 @@
-/* Copyright (C) 1995, 1997 Free Software Foundation, Inc.
-This file is part of GNU Fortran libU77 library.
-
-This library is free software; you can redistribute it and/or modify it
-under the terms of the GNU Library General Public License as published
-by the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-GNU Fortran 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 GNU Fortran; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-
-/* This definitely shouldn't be done this way -- should canibalise
- chmod(1) from GNU or BSD. */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-#if HAVE_STDLIB_H
-# include <stdlib.h>
-#else
-# include <stdio.h>
-#endif
-#if STDC_HEADERS
-# include <string.h>
-#endif
-
-#include "f2c.h"
-
-#ifndef CHMOD_PATH
-#define CHMOD_PATH "/bin/chmod"
-#endif
-
-#ifdef KR_headers
-extern void s_cat ();
-void g_char ();
-
-integer G77_chmod_0 (name, mode, Lname, Lmode)
- char *name, *mode;
- ftnlen Lname, Lmode;
-#else
-extern void s_cat(char *lp, char *rpp[], ftnlen rnp[], ftnlen *np, ftnlen ll);
-void g_char(const char *a, ftnlen alen, char *b);
-
-integer G77_chmod_0 (/* const */ char *name, /* const */ char *mode, const ftnlen Lname, const ftnlen Lmode)
-#endif
-{
- char *buff;
- char *bp, *blast;
- int i;
- ftnlen l, l2;
- ftnlen six = 6;
- address a[6];
- ftnlen ii[6];
- char chmod_path [] = CHMOD_PATH;
- l = strlen (chmod_path);
- buff = malloc (Lname+Lmode+l+3+13+1);
- if (!buff) return -1;
- ii[0] = l; a[0] = chmod_path;
- ii[1] = 1; a[1] = " ";
- ii[2] = Lmode; a[2] = mode;
- ii[3] = 2; a[3] = " '";
- for (l2=Lname; (l2 > 1) && (name[l2-1] == ' '); )
- l2--;
- ii[4] = l2; a[4] = name;
- ii[5] = 13; a[5] = "' 2>/dev/null";
- s_cat (buff, a, ii, &six, Lname+Lmode+l+3+13);
- buff[Lname+Lmode+l+3+13] = '\0';
- i = system (buff);
- free (buff);
- return i;
-}
diff --git a/contrib/libf2c/libU77/config.hin b/contrib/libf2c/libU77/config.hin
deleted file mode 100644
index 19f5399d5385..000000000000
--- a/contrib/libf2c/libU77/config.hin
+++ /dev/null
@@ -1,112 +0,0 @@
-/* config.hin. Generated automatically from configure.in by autoheader. */
-
-/* Define to empty if the keyword does not work. */
-#undef const
-
-/* Define if your struct stat has st_blksize. */
-#undef HAVE_ST_BLKSIZE
-
-/* Define if your struct stat has st_blocks. */
-#undef HAVE_ST_BLOCKS
-
-/* Define if your struct stat has st_rdev. */
-#undef HAVE_ST_RDEV
-
-/* Define to `int' if <sys/types.h> doesn't define. */
-#undef mode_t
-
-/* Define to `int' if <sys/types.h> doesn't define. */
-#undef pid_t
-
-/* Define to `unsigned' if <sys/types.h> doesn't define. */
-#undef size_t
-
-/* Define if you have the ANSI C header files. */
-#undef STDC_HEADERS
-
-/* Define if you can safely include both <sys/time.h> and <time.h>. */
-#undef TIME_WITH_SYS_TIME
-
-/* Define if your <sys/time.h> declares struct tm. */
-#undef TM_IN_SYS_TIME
-
-/* Define as the path of the `chmod' program. */
-#undef CHMOD_PATH
-
-/* Define if your gettimeofday takes only one argument. */
-#undef GETTIMEOFDAY_ONE_ARGUMENT
-
-/* Define if your gettimeofday takes a time zome argument. */
-#undef HAVE_TIMEZONE
-
-/* Define if you have the alarm function. */
-#undef HAVE_ALARM
-
-/* Define if you have the clock function. */
-#undef HAVE_CLOCK
-
-/* Define if you have the getcwd function. */
-#undef HAVE_GETCWD
-
-/* Define if you have the getgid function. */
-#undef HAVE_GETGID
-
-/* Define if you have the gethostname function. */
-#undef HAVE_GETHOSTNAME
-
-/* Define if you have the getlogin function. */
-#undef HAVE_GETLOGIN
-
-/* Define if you have the getrusage function. */
-#undef HAVE_GETRUSAGE
-
-/* Define if you have the gettimeofday function. */
-#undef HAVE_GETTIMEOFDAY
-
-/* Define if you have the getuid function. */
-#undef HAVE_GETUID
-
-/* Define if you have the getwd function. */
-#undef HAVE_GETWD
-
-/* Define if you have the kill function. */
-#undef HAVE_KILL
-
-/* Define if you have the link function. */
-#undef HAVE_LINK
-
-/* Define if you have the lstat function. */
-#undef HAVE_LSTAT
-
-/* Define if you have the strerror function. */
-#undef HAVE_STRERROR
-
-/* Define if you have the symlink function. */
-#undef HAVE_SYMLINK
-
-/* Define if you have the times function. */
-#undef HAVE_TIMES
-
-/* Define if you have the ttyname function. */
-#undef HAVE_TTYNAME
-
-/* Define if you have the <limits.h> header file. */
-#undef HAVE_LIMITS_H
-
-/* Define if you have the <stdlib.h> header file. */
-#undef HAVE_STDLIB_H
-
-/* Define if you have the <string.h> header file. */
-#undef HAVE_STRING_H
-
-/* Define if you have the <sys/param.h> header file. */
-#undef HAVE_SYS_PARAM_H
-
-/* Define if you have the <sys/time.h> header file. */
-#undef HAVE_SYS_TIME_H
-
-/* Define if you have the <sys/times.h> header file. */
-#undef HAVE_SYS_TIMES_H
-
-/* Define if you have the <unistd.h> header file. */
-#undef HAVE_UNISTD_H
diff --git a/contrib/libf2c/libU77/configure b/contrib/libf2c/libU77/configure
deleted file mode 100755
index 713704226c04..000000000000
--- a/contrib/libf2c/libU77/configure
+++ /dev/null
@@ -1,2010 +0,0 @@
-#! /bin/sh
-
-# Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 2.13
-# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
-#
-# This configure script is free software; the Free Software Foundation
-# gives unlimited permission to copy, distribute and modify it.
-
-# Defaults:
-ac_help=
-ac_default_prefix=/usr/local
-# Any additions from configure.in:
-
-# Initialize some variables set by options.
-# The variables have the same names as the options, with
-# dashes changed to underlines.
-build=NONE
-cache_file=./config.cache
-exec_prefix=NONE
-host=NONE
-no_create=
-nonopt=NONE
-no_recursion=
-prefix=NONE
-program_prefix=NONE
-program_suffix=NONE
-program_transform_name=s,x,x,
-silent=
-site=
-srcdir=
-target=NONE
-verbose=
-x_includes=NONE
-x_libraries=NONE
-bindir='${exec_prefix}/bin'
-sbindir='${exec_prefix}/sbin'
-libexecdir='${exec_prefix}/libexec'
-datadir='${prefix}/share'
-sysconfdir='${prefix}/etc'
-sharedstatedir='${prefix}/com'
-localstatedir='${prefix}/var'
-libdir='${exec_prefix}/lib'
-includedir='${prefix}/include'
-oldincludedir='/usr/include'
-infodir='${prefix}/info'
-mandir='${prefix}/man'
-
-# Initialize some other variables.
-subdirs=
-MFLAGS= MAKEFLAGS=
-SHELL=${CONFIG_SHELL-/bin/sh}
-# Maximum number of lines to put in a shell here document.
-ac_max_here_lines=12
-
-ac_prev=
-for ac_option
-do
-
- # If the previous option needs an argument, assign it.
- if test -n "$ac_prev"; then
- eval "$ac_prev=\$ac_option"
- ac_prev=
- continue
- fi
-
- case "$ac_option" in
- -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
- *) ac_optarg= ;;
- esac
-
- # Accept the important Cygnus configure options, so we can diagnose typos.
-
- case "$ac_option" in
-
- -bindir | --bindir | --bindi | --bind | --bin | --bi)
- ac_prev=bindir ;;
- -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
- bindir="$ac_optarg" ;;
-
- -build | --build | --buil | --bui | --bu)
- ac_prev=build ;;
- -build=* | --build=* | --buil=* | --bui=* | --bu=*)
- build="$ac_optarg" ;;
-
- -cache-file | --cache-file | --cache-fil | --cache-fi \
- | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
- ac_prev=cache_file ;;
- -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
- | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
- cache_file="$ac_optarg" ;;
-
- -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
- ac_prev=datadir ;;
- -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
- | --da=*)
- datadir="$ac_optarg" ;;
-
- -disable-* | --disable-*)
- ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
- # Reject names that are not valid shell variable names.
- if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
- { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
- fi
- ac_feature=`echo $ac_feature| sed 's/-/_/g'`
- eval "enable_${ac_feature}=no" ;;
-
- -enable-* | --enable-*)
- ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
- # Reject names that are not valid shell variable names.
- if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
- { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
- fi
- ac_feature=`echo $ac_feature| sed 's/-/_/g'`
- case "$ac_option" in
- *=*) ;;
- *) ac_optarg=yes ;;
- esac
- eval "enable_${ac_feature}='$ac_optarg'" ;;
-
- -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
- | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
- | --exec | --exe | --ex)
- ac_prev=exec_prefix ;;
- -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
- | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
- | --exec=* | --exe=* | --ex=*)
- exec_prefix="$ac_optarg" ;;
-
- -gas | --gas | --ga | --g)
- # Obsolete; use --with-gas.
- with_gas=yes ;;
-
- -help | --help | --hel | --he)
- # Omit some internal or obsolete options to make the list less imposing.
- # This message is too long to be a string in the A/UX 3.1 sh.
- cat << EOF
-Usage: configure [options] [host]
-Options: [defaults in brackets after descriptions]
-Configuration:
- --cache-file=FILE cache test results in FILE
- --help print this message
- --no-create do not create output files
- --quiet, --silent do not print \`checking...' messages
- --version print the version of autoconf that created configure
-Directory and file names:
- --prefix=PREFIX install architecture-independent files in PREFIX
- [$ac_default_prefix]
- --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
- [same as prefix]
- --bindir=DIR user executables in DIR [EPREFIX/bin]
- --sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
- --libexecdir=DIR program executables in DIR [EPREFIX/libexec]
- --datadir=DIR read-only architecture-independent data in DIR
- [PREFIX/share]
- --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
- --sharedstatedir=DIR modifiable architecture-independent data in DIR
- [PREFIX/com]
- --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
- --libdir=DIR object code libraries in DIR [EPREFIX/lib]
- --includedir=DIR C header files in DIR [PREFIX/include]
- --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
- --infodir=DIR info documentation in DIR [PREFIX/info]
- --mandir=DIR man documentation in DIR [PREFIX/man]
- --srcdir=DIR find the sources in DIR [configure dir or ..]
- --program-prefix=PREFIX prepend PREFIX to installed program names
- --program-suffix=SUFFIX append SUFFIX to installed program names
- --program-transform-name=PROGRAM
- run sed PROGRAM on installed program names
-EOF
- cat << EOF
-Host type:
- --build=BUILD configure for building on BUILD [BUILD=HOST]
- --host=HOST configure for HOST [guessed]
- --target=TARGET configure for TARGET [TARGET=HOST]
-Features and packages:
- --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
- --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
- --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
- --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
- --x-includes=DIR X include files are in DIR
- --x-libraries=DIR X library files are in DIR
-EOF
- if test -n "$ac_help"; then
- echo "--enable and --with options recognized:$ac_help"
- fi
- exit 0 ;;
-
- -host | --host | --hos | --ho)
- ac_prev=host ;;
- -host=* | --host=* | --hos=* | --ho=*)
- host="$ac_optarg" ;;
-
- -includedir | --includedir | --includedi | --included | --include \
- | --includ | --inclu | --incl | --inc)
- ac_prev=includedir ;;
- -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
- | --includ=* | --inclu=* | --incl=* | --inc=*)
- includedir="$ac_optarg" ;;
-
- -infodir | --infodir | --infodi | --infod | --info | --inf)
- ac_prev=infodir ;;
- -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
- infodir="$ac_optarg" ;;
-
- -libdir | --libdir | --libdi | --libd)
- ac_prev=libdir ;;
- -libdir=* | --libdir=* | --libdi=* | --libd=*)
- libdir="$ac_optarg" ;;
-
- -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
- | --libexe | --libex | --libe)
- ac_prev=libexecdir ;;
- -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
- | --libexe=* | --libex=* | --libe=*)
- libexecdir="$ac_optarg" ;;
-
- -localstatedir | --localstatedir | --localstatedi | --localstated \
- | --localstate | --localstat | --localsta | --localst \
- | --locals | --local | --loca | --loc | --lo)
- ac_prev=localstatedir ;;
- -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
- | --localstate=* | --localstat=* | --localsta=* | --localst=* \
- | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
- localstatedir="$ac_optarg" ;;
-
- -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
- ac_prev=mandir ;;
- -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
- mandir="$ac_optarg" ;;
-
- -nfp | --nfp | --nf)
- # Obsolete; use --without-fp.
- with_fp=no ;;
-
- -no-create | --no-create | --no-creat | --no-crea | --no-cre \
- | --no-cr | --no-c)
- no_create=yes ;;
-
- -no-recursion | --no-recursion | --no-recursio | --no-recursi \
- | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
- no_recursion=yes ;;
-
- -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
- | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
- | --oldin | --oldi | --old | --ol | --o)
- ac_prev=oldincludedir ;;
- -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
- | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
- | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
- oldincludedir="$ac_optarg" ;;
-
- -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
- ac_prev=prefix ;;
- -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
- prefix="$ac_optarg" ;;
-
- -program-prefix | --program-prefix | --program-prefi | --program-pref \
- | --program-pre | --program-pr | --program-p)
- ac_prev=program_prefix ;;
- -program-prefix=* | --program-prefix=* | --program-prefi=* \
- | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
- program_prefix="$ac_optarg" ;;
-
- -program-suffix | --program-suffix | --program-suffi | --program-suff \
- | --program-suf | --program-su | --program-s)
- ac_prev=program_suffix ;;
- -program-suffix=* | --program-suffix=* | --program-suffi=* \
- | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
- program_suffix="$ac_optarg" ;;
-
- -program-transform-name | --program-transform-name \
- | --program-transform-nam | --program-transform-na \
- | --program-transform-n | --program-transform- \
- | --program-transform | --program-transfor \
- | --program-transfo | --program-transf \
- | --program-trans | --program-tran \
- | --progr-tra | --program-tr | --program-t)
- ac_prev=program_transform_name ;;
- -program-transform-name=* | --program-transform-name=* \
- | --program-transform-nam=* | --program-transform-na=* \
- | --program-transform-n=* | --program-transform-=* \
- | --program-transform=* | --program-transfor=* \
- | --program-transfo=* | --program-transf=* \
- | --program-trans=* | --program-tran=* \
- | --progr-tra=* | --program-tr=* | --program-t=*)
- program_transform_name="$ac_optarg" ;;
-
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil)
- silent=yes ;;
-
- -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
- ac_prev=sbindir ;;
- -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
- | --sbi=* | --sb=*)
- sbindir="$ac_optarg" ;;
-
- -sharedstatedir | --sharedstatedir | --sharedstatedi \
- | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
- | --sharedst | --shareds | --shared | --share | --shar \
- | --sha | --sh)
- ac_prev=sharedstatedir ;;
- -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
- | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
- | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
- | --sha=* | --sh=*)
- sharedstatedir="$ac_optarg" ;;
-
- -site | --site | --sit)
- ac_prev=site ;;
- -site=* | --site=* | --sit=*)
- site="$ac_optarg" ;;
-
- -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
- ac_prev=srcdir ;;
- -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
- srcdir="$ac_optarg" ;;
-
- -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
- | --syscon | --sysco | --sysc | --sys | --sy)
- ac_prev=sysconfdir ;;
- -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
- | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
- sysconfdir="$ac_optarg" ;;
-
- -target | --target | --targe | --targ | --tar | --ta | --t)
- ac_prev=target ;;
- -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
- target="$ac_optarg" ;;
-
- -v | -verbose | --verbose | --verbos | --verbo | --verb)
- verbose=yes ;;
-
- -version | --version | --versio | --versi | --vers)
- echo "configure generated by autoconf version 2.13"
- exit 0 ;;
-
- -with-* | --with-*)
- ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
- # Reject names that are not valid shell variable names.
- if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
- { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
- fi
- ac_package=`echo $ac_package| sed 's/-/_/g'`
- case "$ac_option" in
- *=*) ;;
- *) ac_optarg=yes ;;
- esac
- eval "with_${ac_package}='$ac_optarg'" ;;
-
- -without-* | --without-*)
- ac_package=`echo $ac_option|sed -e 's/-*without-//'`
- # Reject names that are not valid shell variable names.
- if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
- { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
- fi
- ac_package=`echo $ac_package| sed 's/-/_/g'`
- eval "with_${ac_package}=no" ;;
-
- --x)
- # Obsolete; use --with-x.
- with_x=yes ;;
-
- -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
- | --x-incl | --x-inc | --x-in | --x-i)
- ac_prev=x_includes ;;
- -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
- | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
- x_includes="$ac_optarg" ;;
-
- -x-libraries | --x-libraries | --x-librarie | --x-librari \
- | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
- ac_prev=x_libraries ;;
- -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
- | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
- x_libraries="$ac_optarg" ;;
-
- -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
- ;;
-
- *)
- if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
- echo "configure: warning: $ac_option: invalid host type" 1>&2
- fi
- if test "x$nonopt" != xNONE; then
- { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
- fi
- nonopt="$ac_option"
- ;;
-
- esac
-done
-
-if test -n "$ac_prev"; then
- { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
-fi
-
-trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
-
-# File descriptor usage:
-# 0 standard input
-# 1 file creation
-# 2 errors and warnings
-# 3 some systems may open it to /dev/tty
-# 4 used on the Kubota Titan
-# 6 checking for... messages and results
-# 5 compiler messages saved in config.log
-if test "$silent" = yes; then
- exec 6>/dev/null
-else
- exec 6>&1
-fi
-exec 5>./config.log
-
-echo "\
-This file contains any messages produced by compilers while
-running configure, to aid debugging if configure makes a mistake.
-" 1>&5
-
-# Strip out --no-create and --no-recursion so they do not pile up.
-# Also quote any args containing shell metacharacters.
-ac_configure_args=
-for ac_arg
-do
- case "$ac_arg" in
- -no-create | --no-create | --no-creat | --no-crea | --no-cre \
- | --no-cr | --no-c) ;;
- -no-recursion | --no-recursion | --no-recursio | --no-recursi \
- | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
- *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
- ac_configure_args="$ac_configure_args '$ac_arg'" ;;
- *) ac_configure_args="$ac_configure_args $ac_arg" ;;
- esac
-done
-
-# NLS nuisances.
-# Only set these to C if already set. These must not be set unconditionally
-# because not all systems understand e.g. LANG=C (notably SCO).
-# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
-# Non-C LC_CTYPE values break the ctype check.
-if test "${LANG+set}" = set; then LANG=C; export LANG; fi
-if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
-if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
-if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
-
-# confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -rf conftest* confdefs.h
-# AIX cpp loses on an empty file, so make sure it contains at least a newline.
-echo > confdefs.h
-
-# A filename unique to this package, relative to the directory that
-# configure is in, which we can look for to find out if srcdir is correct.
-ac_unique_file=access_.c
-
-# Find the source files, if location was not specified.
-if test -z "$srcdir"; then
- ac_srcdir_defaulted=yes
- # Try the directory containing this script, then its parent.
- ac_prog=$0
- ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
- test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
- srcdir=$ac_confdir
- if test ! -r $srcdir/$ac_unique_file; then
- srcdir=..
- fi
-else
- ac_srcdir_defaulted=no
-fi
-if test ! -r $srcdir/$ac_unique_file; then
- if test "$ac_srcdir_defaulted" = yes; then
- { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
- else
- { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
- fi
-fi
-srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
-
-# Prefer explicitly selected file to automatically selected ones.
-if test -z "$CONFIG_SITE"; then
- if test "x$prefix" != xNONE; then
- CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
- else
- CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
- fi
-fi
-for ac_site_file in $CONFIG_SITE; do
- if test -r "$ac_site_file"; then
- echo "loading site script $ac_site_file"
- . "$ac_site_file"
- fi
-done
-
-if test -r "$cache_file"; then
- echo "loading cache $cache_file"
- . $cache_file
-else
- echo "creating cache $cache_file"
- > $cache_file
-fi
-
-ac_ext=c
-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
-
-ac_exeext=
-ac_objext=o
-if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
- # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
- if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
- ac_n= ac_c='
-' ac_t=' '
- else
- ac_n=-n ac_c= ac_t=
- fi
-else
- ac_n= ac_c='\c' ac_t=
-fi
-
-
-
-
-
-
-
-# For g77 we'll set CC to point at the built gcc, but this will get it into
-# the makefiles
-# Extract the first word of "gcc", so it can be a program name with args.
-set dummy gcc; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:535: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_prog_CC="gcc"
- break
- fi
- done
- IFS="$ac_save_ifs"
-fi
-fi
-CC="$ac_cv_prog_CC"
-if test -n "$CC"; then
- echo "$ac_t""$CC" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-if test -z "$CC"; then
- # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:565: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_prog_rejected=no
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
- ac_prog_rejected=yes
- continue
- fi
- ac_cv_prog_CC="cc"
- break
- fi
- done
- IFS="$ac_save_ifs"
-if test $ac_prog_rejected = yes; then
- # We found a bogon in the path, so make sure we never use it.
- set dummy $ac_cv_prog_CC
- shift
- if test $# -gt 0; then
- # We chose a different compiler from the bogus one.
- # However, it has the same basename, so the bogon will be chosen
- # first if we set CC to just the basename; use the full file name.
- shift
- set dummy "$ac_dir/$ac_word" "$@"
- shift
- ac_cv_prog_CC="$@"
- fi
-fi
-fi
-fi
-CC="$ac_cv_prog_CC"
-if test -n "$CC"; then
- echo "$ac_t""$CC" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
- if test -z "$CC"; then
- case "`uname -s`" in
- *win32* | *WIN32*)
- # Extract the first word of "cl", so it can be a program name with args.
-set dummy cl; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:616: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_prog_CC="cl"
- break
- fi
- done
- IFS="$ac_save_ifs"
-fi
-fi
-CC="$ac_cv_prog_CC"
-if test -n "$CC"; then
- echo "$ac_t""$CC" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
- ;;
- esac
- fi
- test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
-fi
-
-
-echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:649: checking whether we are using GNU C" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.c <<EOF
-#ifdef __GNUC__
- yes;
-#endif
-EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:658: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
- ac_cv_prog_gcc=yes
-else
- ac_cv_prog_gcc=no
-fi
-fi
-
-echo "$ac_t""$ac_cv_prog_gcc" 1>&6
-
-if test $ac_cv_prog_gcc = yes; then
- GCC=yes
-else
- GCC=
-fi
-
-ac_test_CFLAGS="${CFLAGS+set}"
-ac_save_CFLAGS="$CFLAGS"
-CFLAGS=
-echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:677: checking whether ${CC-cc} accepts -g" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- echo 'void f(){}' > conftest.c
-if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
- ac_cv_prog_cc_g=yes
-else
- ac_cv_prog_cc_g=no
-fi
-rm -f conftest*
-
-fi
-
-echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
-if test "$ac_test_CFLAGS" = set; then
- CFLAGS="$ac_save_CFLAGS"
-elif test $ac_cv_prog_cc_g = yes; then
- if test "$GCC" = yes; then
- CFLAGS="-g -O2"
- else
- CFLAGS="-g"
- fi
-else
- if test "$GCC" = yes; then
- CFLAGS="-O2"
- else
- CFLAGS=
- fi
-fi
-
-if test "$CROSS";then
- ac_cv_c_cross=yes
-else
- ac_cv_c_cross=no
-fi
-
-test "$AR" || AR=ar
-
-echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:717: checking whether ${MAKE-make} sets \${MAKE}" >&5
-set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftestmake <<\EOF
-all:
- @echo 'ac_maketemp="${MAKE}"'
-EOF
-# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
-eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
-if test -n "$ac_maketemp"; then
- eval ac_cv_prog_make_${ac_make}_set=yes
-else
- eval ac_cv_prog_make_${ac_make}_set=no
-fi
-rm -f conftestmake
-fi
-if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- SET_MAKE=
-else
- echo "$ac_t""no" 1>&6
- SET_MAKE="MAKE=${MAKE-make}"
-fi
-
-
-# Extract the first word of "chmod", so it can be a program name with args.
-set dummy chmod; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:747: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_ac_cv_prog_chmod'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- case "$ac_cv_prog_chmod" in
- /*)
- ac_cv_path_ac_cv_prog_chmod="$ac_cv_prog_chmod" # Let the user override the test with a path.
- ;;
- ?:/*)
- ac_cv_path_ac_cv_prog_chmod="$ac_cv_prog_chmod" # Let the user override the test with a dos path.
- ;;
- *)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_path_ac_cv_prog_chmod="$ac_dir/$ac_word"
- break
- fi
- done
- IFS="$ac_save_ifs"
- test -z "$ac_cv_path_ac_cv_prog_chmod" && ac_cv_path_ac_cv_prog_chmod="no"
- ;;
-esac
-fi
-ac_cv_prog_chmod="$ac_cv_path_ac_cv_prog_chmod"
-if test -n "$ac_cv_prog_chmod"; then
- echo "$ac_t""$ac_cv_prog_chmod" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-if test "$ac_cv_prog_chmod" != no || test "$CROSS"; then
- MAYBES=chmod_.o
- cat >> confdefs.h <<EOF
-#define CHMOD_PATH "$ac_cv_prog_chmod"
-EOF
-
-else
- MAYBES=""
-fi
-
-echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:791: checking how to run the C preprocessor" >&5
-# On Suns, sometimes $CPP names a directory.
-if test -n "$CPP" && test -d "$CPP"; then
- CPP=
-fi
-if test -z "$CPP"; then
-if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- # This must be in double quotes, not single quotes, because CPP may get
- # substituted into the Makefile and "${CC-cc}" will confuse make.
- CPP="${CC-cc} -E"
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp.
- cat > conftest.$ac_ext <<EOF
-#line 806 "configure"
-#include "confdefs.h"
-#include <assert.h>
-Syntax Error
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:812: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- :
-else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- CPP="${CC-cc} -E -traditional-cpp"
- cat > conftest.$ac_ext <<EOF
-#line 823 "configure"
-#include "confdefs.h"
-#include <assert.h>
-Syntax Error
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:829: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- :
-else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- CPP="${CC-cc} -nologo -E"
- cat > conftest.$ac_ext <<EOF
-#line 840 "configure"
-#include "confdefs.h"
-#include <assert.h>
-Syntax Error
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:846: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- :
-else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- CPP=/lib/cpp
-fi
-rm -f conftest*
-fi
-rm -f conftest*
-fi
-rm -f conftest*
- ac_cv_prog_CPP="$CPP"
-fi
- CPP="$ac_cv_prog_CPP"
-else
- ac_cv_prog_CPP="$CPP"
-fi
-echo "$ac_t""$CPP" 1>&6
-
-echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:871: checking for ANSI C header files" >&5
-if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 876 "configure"
-#include "confdefs.h"
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:884: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- rm -rf conftest*
- ac_cv_header_stdc=yes
-else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-if test $ac_cv_header_stdc = yes; then
- # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
-cat > conftest.$ac_ext <<EOF
-#line 901 "configure"
-#include "confdefs.h"
-#include <string.h>
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "memchr" >/dev/null 2>&1; then
- :
-else
- rm -rf conftest*
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
-cat > conftest.$ac_ext <<EOF
-#line 919 "configure"
-#include "confdefs.h"
-#include <stdlib.h>
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "free" >/dev/null 2>&1; then
- :
-else
- rm -rf conftest*
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
-if test "$cross_compiling" = yes; then
- :
-else
- cat > conftest.$ac_ext <<EOF
-#line 940 "configure"
-#include "confdefs.h"
-#include <ctype.h>
-#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int main () { int i; for (i = 0; i < 256; i++)
-if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
-exit (0); }
-
-EOF
-if { (eval echo configure:951: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
- :
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -fr conftest*
- ac_cv_header_stdc=no
-fi
-rm -fr conftest*
-fi
-
-fi
-fi
-
-echo "$ac_t""$ac_cv_header_stdc" 1>&6
-if test $ac_cv_header_stdc = yes; then
- cat >> confdefs.h <<\EOF
-#define STDC_HEADERS 1
-EOF
-
-fi
-
-
-echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:976: checking whether time.h and sys/time.h may both be included" >&5
-if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 981 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#include <sys/time.h>
-#include <time.h>
-int main() {
-struct tm *tp;
-; return 0; }
-EOF
-if { (eval echo configure:990: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- ac_cv_header_time=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_cv_header_time=no
-fi
-rm -f conftest*
-fi
-
-echo "$ac_t""$ac_cv_header_time" 1>&6
-if test $ac_cv_header_time = yes; then
- cat >> confdefs.h <<\EOF
-#define TIME_WITH_SYS_TIME 1
-EOF
-
-fi
-
-for ac_hdr in limits.h unistd.h sys/time.h string.h stdlib.h \
- sys/param.h sys/times.h
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1015: checking for $ac_hdr" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1020 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1025: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=yes"
-else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
-fi
-done
-
-
-echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:1053: checking for working const" >&5
-if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1058 "configure"
-#include "confdefs.h"
-
-int main() {
-
-/* Ultrix mips cc rejects this. */
-typedef int charset[2]; const charset x;
-/* SunOS 4.1.1 cc rejects this. */
-char const *const *ccp;
-char **p;
-/* NEC SVR4.0.2 mips cc rejects this. */
-struct point {int x, y;};
-static struct point const zero = {0,0};
-/* AIX XL C 1.02.0.0 rejects this.
- It does not let you subtract one const X* pointer from another in an arm
- of an if-expression whose if-part is not a constant expression */
-const char *g = "string";
-ccp = &g + (g ? g-g : 0);
-/* HPUX 7.0 cc rejects these. */
-++ccp;
-p = (char**) ccp;
-ccp = (char const *const *) p;
-{ /* SCO 3.2v4 cc rejects this. */
- char *t;
- char const *s = 0 ? (char *) 0 : (char const *) 0;
-
- *t++ = 0;
-}
-{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
- int x[] = {25, 17};
- const int *foo = &x[0];
- ++foo;
-}
-{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
- typedef const int *iptr;
- iptr p = 0;
- ++p;
-}
-{ /* AIX XL C 1.02.0.0 rejects this saying
- "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
- struct s { int j; const int *ap[3]; };
- struct s *b; b->j = 5;
-}
-{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
- const int foo = 10;
-}
-
-; return 0; }
-EOF
-if { (eval echo configure:1107: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- ac_cv_c_const=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_cv_c_const=no
-fi
-rm -f conftest*
-fi
-
-echo "$ac_t""$ac_cv_c_const" 1>&6
-if test $ac_cv_c_const = no; then
- cat >> confdefs.h <<\EOF
-#define const
-EOF
-
-fi
-
-echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:1128: checking for size_t" >&5
-if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1133 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#if STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
-#endif
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
- rm -rf conftest*
- ac_cv_type_size_t=yes
-else
- rm -rf conftest*
- ac_cv_type_size_t=no
-fi
-rm -f conftest*
-
-fi
-echo "$ac_t""$ac_cv_type_size_t" 1>&6
-if test $ac_cv_type_size_t = no; then
- cat >> confdefs.h <<\EOF
-#define size_t unsigned
-EOF
-
-fi
-
-echo $ac_n "checking for mode_t""... $ac_c" 1>&6
-echo "configure:1161: checking for mode_t" >&5
-if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1166 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#if STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
-#endif
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
- rm -rf conftest*
- ac_cv_type_mode_t=yes
-else
- rm -rf conftest*
- ac_cv_type_mode_t=no
-fi
-rm -f conftest*
-
-fi
-echo "$ac_t""$ac_cv_type_mode_t" 1>&6
-if test $ac_cv_type_mode_t = no; then
- cat >> confdefs.h <<\EOF
-#define mode_t int
-EOF
-
-fi
-
-
-echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:1195: checking for pid_t" >&5
-if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1200 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#if STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
-#endif
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
- rm -rf conftest*
- ac_cv_type_pid_t=yes
-else
- rm -rf conftest*
- ac_cv_type_pid_t=no
-fi
-rm -f conftest*
-
-fi
-echo "$ac_t""$ac_cv_type_pid_t" 1>&6
-if test $ac_cv_type_pid_t = no; then
- cat >> confdefs.h <<\EOF
-#define pid_t int
-EOF
-
-fi
-
-echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6
-echo "configure:1228: checking for st_blksize in struct stat" >&5
-if eval "test \"`echo '$''{'ac_cv_struct_st_blksize'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1233 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#include <sys/stat.h>
-int main() {
-struct stat s; s.st_blksize;
-; return 0; }
-EOF
-if { (eval echo configure:1241: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- ac_cv_struct_st_blksize=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_cv_struct_st_blksize=no
-fi
-rm -f conftest*
-fi
-
-echo "$ac_t""$ac_cv_struct_st_blksize" 1>&6
-if test $ac_cv_struct_st_blksize = yes; then
- cat >> confdefs.h <<\EOF
-#define HAVE_ST_BLKSIZE 1
-EOF
-
-fi
-
-echo $ac_n "checking for st_blocks in struct stat""... $ac_c" 1>&6
-echo "configure:1262: checking for st_blocks in struct stat" >&5
-if eval "test \"`echo '$''{'ac_cv_struct_st_blocks'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1267 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#include <sys/stat.h>
-int main() {
-struct stat s; s.st_blocks;
-; return 0; }
-EOF
-if { (eval echo configure:1275: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- ac_cv_struct_st_blocks=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_cv_struct_st_blocks=no
-fi
-rm -f conftest*
-fi
-
-echo "$ac_t""$ac_cv_struct_st_blocks" 1>&6
-if test $ac_cv_struct_st_blocks = yes; then
- cat >> confdefs.h <<\EOF
-#define HAVE_ST_BLOCKS 1
-EOF
-
-else
- LIBOBJS="$LIBOBJS fileblocks.${ac_objext}"
-fi
-
-echo $ac_n "checking for st_rdev in struct stat""... $ac_c" 1>&6
-echo "configure:1298: checking for st_rdev in struct stat" >&5
-if eval "test \"`echo '$''{'ac_cv_struct_st_rdev'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1303 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#include <sys/stat.h>
-int main() {
-struct stat s; s.st_rdev;
-; return 0; }
-EOF
-if { (eval echo configure:1311: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- ac_cv_struct_st_rdev=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_cv_struct_st_rdev=no
-fi
-rm -f conftest*
-fi
-
-echo "$ac_t""$ac_cv_struct_st_rdev" 1>&6
-if test $ac_cv_struct_st_rdev = yes; then
- cat >> confdefs.h <<\EOF
-#define HAVE_ST_RDEV 1
-EOF
-
-fi
-
-echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
-echo "configure:1332: checking whether struct tm is in sys/time.h or time.h" >&5
-if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1337 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#include <time.h>
-int main() {
-struct tm *tp; tp->tm_sec;
-; return 0; }
-EOF
-if { (eval echo configure:1345: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- ac_cv_struct_tm=time.h
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_cv_struct_tm=sys/time.h
-fi
-rm -f conftest*
-fi
-
-echo "$ac_t""$ac_cv_struct_tm" 1>&6
-if test $ac_cv_struct_tm = sys/time.h; then
- cat >> confdefs.h <<\EOF
-#define TM_IN_SYS_TIME 1
-EOF
-
-fi
-
-
-echo $ac_n "checking for gethostname in -lsocket""... $ac_c" 1>&6
-echo "configure:1367: checking for gethostname in -lsocket" >&5
-ac_lib_var=`echo socket'_'gethostname | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- ac_save_LIBS="$LIBS"
-LIBS="-lsocket $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 1375 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char gethostname();
-
-int main() {
-gethostname()
-; return 0; }
-EOF
-if { (eval echo configure:1386: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- LIBS="$LIBS -lsocket"
-else
- echo "$ac_t""no" 1>&6
-fi
-
-
-
-for ac_func in symlink getcwd getwd lstat gethostname strerror clock \
- getrusage times alarm getlogin getgid getuid kill link ttyname
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1412: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1417 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func(); below. */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char $ac_func();
-
-int main() {
-
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-$ac_func();
-#endif
-
-; return 0; }
-EOF
-if { (eval echo configure:1440: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
-fi
-done
-
-
-
- for ac_func in gettimeofday
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1469: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1474 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func(); below. */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char $ac_func();
-
-int main() {
-
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-$ac_func();
-#endif
-
-; return 0; }
-EOF
-if { (eval echo configure:1497: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
-fi
-done
-
- if test "$ac_cv_func_gettimeofday" = yes; then
- echo $ac_n "checking for struct timezone""... $ac_c" 1>&6
-echo "configure:1523: checking for struct timezone" >&5
-if eval "test \"`echo '$''{'g77_cv_struct_timezone'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1528 "configure"
-#include "confdefs.h"
-#include <sys/time.h>
-int main() {
-struct timezone tz;
-; return 0; }
-EOF
-if { (eval echo configure:1535: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- g77_cv_struct_timezone=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- g77_cv_struct_timezone=no
-fi
-rm -f conftest*
-fi
-
-echo "$ac_t""$g77_cv_struct_timezone" 1>&6
- if test $g77_cv_struct_timezone = yes; then
- if test "$cross_compiling" = yes; then
- cat >> confdefs.h <<\EOF
-#define HAVE_TIMEZONE 1
-EOF
-
-else
- cat > conftest.$ac_ext <<EOF
-#line 1556 "configure"
-#include "confdefs.h"
-
-#ifdef TIME_WITH_SYS_TIME
-#include <sys/time.h>
-#include <time.h>
-#else
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#else
-#include <time.h>
-#endif
-#endif
-main ()
-{
- struct timeval time;
- struct timezone dummy;
- if (gettimeofday (&time, &dummy))
- exit (1);
- else
- exit (0);
-}
-EOF
-if { (eval echo configure:1579: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
- cat >> confdefs.h <<\EOF
-#define HAVE_TIMEZONE 1
-EOF
-
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
-fi
-rm -fr conftest*
-fi
-
- fi
-
- echo $ac_n "checking whether gettimeofday can accept two arguments""... $ac_c" 1>&6
-echo "configure:1595: checking whether gettimeofday can accept two arguments" >&5
-if eval "test \"`echo '$''{'emacs_cv_gettimeofday_two_arguments'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1600 "configure"
-#include "confdefs.h"
-
-#ifdef TIME_WITH_SYS_TIME
-#include <sys/time.h>
-#include <time.h>
-#else
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#else
-#include <time.h>
-#endif
-#endif
-
-int main() {
-
- struct timeval time;
-#ifdef HAVE_TIMEZONE
- struct timezone dummy;
-#define DUMMY &dummy
-#else
-#define DUMMY NULL
-#endif
- gettimeofday (&time, DUMMY);
-; return 0; }
-EOF
-if { (eval echo configure:1626: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- emacs_cv_gettimeofday_two_arguments=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- emacs_cv_gettimeofday_two_arguments=no
-fi
-rm -f conftest*
-fi
-
-echo "$ac_t""$emacs_cv_gettimeofday_two_arguments" 1>&6
- if test $emacs_cv_gettimeofday_two_arguments = no; then
- cat >> confdefs.h <<\EOF
-#define GETTIMEOFDAY_ONE_ARGUMENT 1
-EOF
-
- fi
- fi
-
-test $ac_cv_func_symlink = yes && MAYBES="$MAYBES symlnk_.o"
-test $ac_cv_func_lstat = yes && MAYBES="$MAYBES lstat_.o"
-test $ac_cv_func_gethostname = yes && MAYBES="$MAYBES hostnm_.o"
-test $ac_cv_func_clock = yes && MAYBES="$MAYBES mclock_.o"
-
-
-
-
-
-trap '' 1 2 15
-cat > confcache <<\EOF
-# This file is a shell script that caches the results of configure
-# tests run on this system so they can be shared between configure
-# scripts and configure runs. It is not useful on other systems.
-# If it contains results you don't want to keep, you may remove or edit it.
-#
-# By default, configure uses ./config.cache as the cache file,
-# creating it if it does not exist already. You can give configure
-# the --cache-file=FILE option to use a different cache file; that is
-# what configure does when it calls configure scripts in
-# subdirectories, so they share the cache.
-# Giving --cache-file=/dev/null disables caching, for debugging configure.
-# config.status only pays attention to the cache file if you give it the
-# --recheck option to rerun configure.
-#
-EOF
-# The following way of writing the cache mishandles newlines in values,
-# but we know of no workaround that is simple, portable, and efficient.
-# So, don't put newlines in cache variables' values.
-# Ultrix sh set writes to stderr and can't be redirected directly,
-# and sets the high bit in the cache file unless we assign to the vars.
-(set) 2>&1 |
- case `(ac_space=' '; set | grep ac_space) 2>&1` in
- *ac_space=\ *)
- # `set' does not quote correctly, so add quotes (double-quote substitution
- # turns \\\\ into \\, and sed turns \\ into \).
- sed -n \
- -e "s/'/'\\\\''/g" \
- -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
- ;;
- *)
- # `set' quotes correctly as required by POSIX, so do not add quotes.
- sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
- ;;
- esac >> confcache
-if cmp -s $cache_file confcache; then
- :
-else
- if test -w $cache_file; then
- echo "updating cache $cache_file"
- cat confcache > $cache_file
- else
- echo "not updating unwritable cache $cache_file"
- fi
-fi
-rm -f confcache
-
-trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
-
-test "x$prefix" = xNONE && prefix=$ac_default_prefix
-# Let make expand exec_prefix.
-test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-
-# Any assignment to VPATH causes Sun make to only execute
-# the first set of double-colon rules, so remove it if not needed.
-# If there is a colon in the path, we need to keep it.
-if test "x$srcdir" = x.; then
- ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
-fi
-
-trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
-
-DEFS=-DHAVE_CONFIG_H
-
-# Without the "./", some shells look in PATH for config.status.
-: ${CONFIG_STATUS=./config.status}
-
-echo creating $CONFIG_STATUS
-rm -f $CONFIG_STATUS
-cat > $CONFIG_STATUS <<EOF
-#! /bin/sh
-# Generated automatically by configure.
-# Run this file to recreate the current configuration.
-# This directory was configured as follows,
-# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-#
-# $0 $ac_configure_args
-#
-# Compiler output produced by configure, useful for debugging
-# configure, is in ./config.log if it exists.
-
-ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
-for ac_option
-do
- case "\$ac_option" in
- -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
- echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
- exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
- -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
- echo "$CONFIG_STATUS generated by autoconf version 2.13"
- exit 0 ;;
- -help | --help | --hel | --he | --h)
- echo "\$ac_cs_usage"; exit 0 ;;
- *) echo "\$ac_cs_usage"; exit 1 ;;
- esac
-done
-
-ac_given_srcdir=$srcdir
-
-trap 'rm -fr `echo "Makefile config.h:config.hin" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
-EOF
-cat >> $CONFIG_STATUS <<EOF
-
-# Protect against being on the right side of a sed subst in config.status.
-sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
- s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
-$ac_vpsub
-$extrasub
-s%@SHELL@%$SHELL%g
-s%@CFLAGS@%$CFLAGS%g
-s%@CPPFLAGS@%$CPPFLAGS%g
-s%@CXXFLAGS@%$CXXFLAGS%g
-s%@FFLAGS@%$FFLAGS%g
-s%@DEFS@%$DEFS%g
-s%@LDFLAGS@%$LDFLAGS%g
-s%@LIBS@%$LIBS%g
-s%@exec_prefix@%$exec_prefix%g
-s%@prefix@%$prefix%g
-s%@program_transform_name@%$program_transform_name%g
-s%@bindir@%$bindir%g
-s%@sbindir@%$sbindir%g
-s%@libexecdir@%$libexecdir%g
-s%@datadir@%$datadir%g
-s%@sysconfdir@%$sysconfdir%g
-s%@sharedstatedir@%$sharedstatedir%g
-s%@localstatedir@%$localstatedir%g
-s%@libdir@%$libdir%g
-s%@includedir@%$includedir%g
-s%@oldincludedir@%$oldincludedir%g
-s%@infodir@%$infodir%g
-s%@mandir@%$mandir%g
-s%@CC@%$CC%g
-s%@AR@%$AR%g
-s%@SET_MAKE@%$SET_MAKE%g
-s%@ac_cv_prog_chmod@%$ac_cv_prog_chmod%g
-s%@CPP@%$CPP%g
-s%@LIBOBJS@%$LIBOBJS%g
-s%@MAYBES@%$MAYBES%g
-s%@CROSS@%$CROSS%g
-s%@RANLIB@%$RANLIB%g
-s%@RANLIB_TEST@%$RANLIB_TEST%g
-
-CEOF
-EOF
-
-cat >> $CONFIG_STATUS <<\EOF
-
-# Split the substitutions into bite-sized pieces for seds with
-# small command number limits, like on Digital OSF/1 and HP-UX.
-ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
-ac_file=1 # Number of current file.
-ac_beg=1 # First line for current file.
-ac_end=$ac_max_sed_cmds # Line after last line for current file.
-ac_more_lines=:
-ac_sed_cmds=""
-while $ac_more_lines; do
- if test $ac_beg -gt 1; then
- sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
- else
- sed "${ac_end}q" conftest.subs > conftest.s$ac_file
- fi
- if test ! -s conftest.s$ac_file; then
- ac_more_lines=false
- rm -f conftest.s$ac_file
- else
- if test -z "$ac_sed_cmds"; then
- ac_sed_cmds="sed -f conftest.s$ac_file"
- else
- ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
- fi
- ac_file=`expr $ac_file + 1`
- ac_beg=$ac_end
- ac_end=`expr $ac_end + $ac_max_sed_cmds`
- fi
-done
-if test -z "$ac_sed_cmds"; then
- ac_sed_cmds=cat
-fi
-EOF
-
-cat >> $CONFIG_STATUS <<EOF
-
-CONFIG_FILES=\${CONFIG_FILES-"Makefile"}
-EOF
-cat >> $CONFIG_STATUS <<\EOF
-for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
- # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
- case "$ac_file" in
- *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
- ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
- *) ac_file_in="${ac_file}.in" ;;
- esac
-
- # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
-
- # Remove last slash and all that follows it. Not all systems have dirname.
- ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
- if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
- # The file is in a subdirectory.
- test ! -d "$ac_dir" && mkdir "$ac_dir"
- ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
- # A "../" for each directory in $ac_dir_suffix.
- ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
- else
- ac_dir_suffix= ac_dots=
- fi
-
- case "$ac_given_srcdir" in
- .) srcdir=.
- if test -z "$ac_dots"; then top_srcdir=.
- else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
- /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
- *) # Relative path.
- srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
- top_srcdir="$ac_dots$ac_given_srcdir" ;;
- esac
-
-
- echo creating "$ac_file"
- rm -f "$ac_file"
- configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
- case "$ac_file" in
- *Makefile*) ac_comsub="1i\\
-# $configure_input" ;;
- *) ac_comsub= ;;
- esac
-
- ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
- sed -e "$ac_comsub
-s%@configure_input@%$configure_input%g
-s%@srcdir@%$srcdir%g
-s%@top_srcdir@%$top_srcdir%g
-" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
-fi; done
-rm -f conftest.s*
-
-# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
-# NAME is the cpp macro being defined and VALUE is the value it is being given.
-#
-# ac_d sets the value in "#define NAME VALUE" lines.
-ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)'
-ac_dB='\([ ][ ]*\)[^ ]*%\1#\2'
-ac_dC='\3'
-ac_dD='%g'
-# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
-ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
-ac_uB='\([ ]\)%\1#\2define\3'
-ac_uC=' '
-ac_uD='\4%g'
-# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
-ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
-ac_eB='$%\1#\2define\3'
-ac_eC=' '
-ac_eD='%g'
-
-if test "${CONFIG_HEADERS+set}" != set; then
-EOF
-cat >> $CONFIG_STATUS <<EOF
- CONFIG_HEADERS="config.h:config.hin"
-EOF
-cat >> $CONFIG_STATUS <<\EOF
-fi
-for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
- # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
- case "$ac_file" in
- *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
- ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
- *) ac_file_in="${ac_file}.in" ;;
- esac
-
- echo creating $ac_file
-
- rm -f conftest.frag conftest.in conftest.out
- ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
- cat $ac_file_inputs > conftest.in
-
-EOF
-
-# Transform confdefs.h into a sed script conftest.vals that substitutes
-# the proper values into config.h.in to produce config.h. And first:
-# Protect against being on the right side of a sed subst in config.status.
-# Protect against being in an unquoted here document in config.status.
-rm -f conftest.vals
-cat > conftest.hdr <<\EOF
-s/[\\&%]/\\&/g
-s%[\\$`]%\\&%g
-s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
-s%ac_d%ac_u%gp
-s%ac_u%ac_e%gp
-EOF
-sed -n -f conftest.hdr confdefs.h > conftest.vals
-rm -f conftest.hdr
-
-# This sed command replaces #undef with comments. This is necessary, for
-# example, in the case of _POSIX_SOURCE, which is predefined and required
-# on some systems where configure will not decide to define it.
-cat >> conftest.vals <<\EOF
-s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
-EOF
-
-# Break up conftest.vals because some shells have a limit on
-# the size of here documents, and old seds have small limits too.
-
-rm -f conftest.tail
-while :
-do
- ac_lines=`grep -c . conftest.vals`
- # grep -c gives empty output for an empty file on some AIX systems.
- if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
- # Write a limited-size here document to conftest.frag.
- echo ' cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
- sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
- echo 'CEOF
- sed -f conftest.frag conftest.in > conftest.out
- rm -f conftest.in
- mv conftest.out conftest.in
-' >> $CONFIG_STATUS
- sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
- rm -f conftest.vals
- mv conftest.tail conftest.vals
-done
-rm -f conftest.vals
-
-cat >> $CONFIG_STATUS <<\EOF
- rm -f conftest.frag conftest.h
- echo "/* $ac_file. Generated automatically by configure. */" > conftest.h
- cat conftest.in >> conftest.h
- rm -f conftest.in
- if cmp -s $ac_file conftest.h 2>/dev/null; then
- echo "$ac_file is unchanged"
- rm -f conftest.h
- else
- # Remove last slash and all that follows it. Not all systems have dirname.
- ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
- if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
- # The file is in a subdirectory.
- test ! -d "$ac_dir" && mkdir "$ac_dir"
- fi
- rm -f $ac_file
- mv conftest.h $ac_file
- fi
-fi; done
-
-EOF
-cat >> $CONFIG_STATUS <<EOF
-
-EOF
-cat >> $CONFIG_STATUS <<\EOF
-
-exit 0
-EOF
-chmod +x $CONFIG_STATUS
-rm -fr confdefs* $ac_clean_files
-test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
-
diff --git a/contrib/libf2c/libU77/configure.in b/contrib/libf2c/libU77/configure.in
deleted file mode 100644
index 03bfe660a517..000000000000
--- a/contrib/libf2c/libU77/configure.in
+++ /dev/null
@@ -1,110 +0,0 @@
-# Process this file with autoconf to produce a configure script.
-# Copyright (C) 1995, 1998, 1999 Free Software Foundation, Inc.
-# Contributed by Dave Love (d.love@dl.ac.uk).
-#
-#This file is part of the GNU Fortran libU77 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.
-#
-#GNU Fortran 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 GNU Fortran; see the file COPYING. If not, write
-#to Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-#USA.
-
-AC_PREREQ(2.12.1)
-AC_INIT(access_.c)
-AC_CONFIG_HEADER(config.h:config.hin)
-
-dnl Checks for programs.
-
-dnl FIXME AC_PROG_CC wants CC to be able to link things, but it may
-dnl not be able to.
-define([AC_PROG_CC_WORKS],[])
-
-# For g77 we'll set CC to point at the built gcc, but this will get it into
-# the makefiles
-AC_PROG_CC
-dnl AC_C_CROSS
-dnl Gives misleading `(cached)' message from the check.
-if test "$CROSS";then
- ac_cv_c_cross=yes
-else
- ac_cv_c_cross=no
-fi
-
-test "$AR" || AR=ar
-AC_SUBST(AR)
-AC_PROG_MAKE_SET
-
-dnl This is only because we (horribly) punt the chmod job to the program at
-dnl present. Note that the result of this test could be wrong in the cross
-dnl case.
-AC_PATH_PROG(ac_cv_prog_chmod, chmod, no)
-if test "$ac_cv_prog_chmod" != no || test "$CROSS"; then
- MAYBES=chmod_.o
- AC_DEFINE_UNQUOTED(CHMOD_PATH,"$ac_cv_prog_chmod")
-else
- MAYBES=""
-fi
-
-dnl Checks for header files.
-AC_HEADER_STDC
-dnl We could do this if we didn't know we were using gcc
-dnl AC_MSG_CHECKING(for prototype-savvy compiler)
-dnl AC_CACHE_VAL(ac_cv_sys_proto,
-dnl [AC_TRY_LINK(,
-dnl dnl looks screwy because TRY_LINK expects a function body
-dnl [return 0;} int foo (int * bar) {],
-dnl ac_cv_sys_proto=yes,
-dnl [ac_cv_sys_proto=no
-dnl AC_DEFINE(KR_headers)])])
-dnl AC_MSG_RESULT($ac_cv_sys_proto)
-
-AC_HEADER_TIME
-AC_CHECK_HEADERS(limits.h unistd.h sys/time.h string.h stdlib.h \
- sys/param.h sys/times.h)
-
-dnl Checks for typedefs, structures, and compiler characteristics.
-AC_C_CONST
-AC_TYPE_SIZE_T
-AC_TYPE_MODE_T
-
-AC_TYPE_PID_T
-dnl The next 3 demand a dummy fileblocks.o (added to LIBOJS). We don't use
-dnl LIBOJS, though.
-AC_STRUCT_ST_BLKSIZE
-AC_STRUCT_ST_BLOCKS
-AC_STRUCT_ST_RDEV
-AC_STRUCT_TM
-
-dnl Some systems (SVR4, SCO OpenServer) need -lsocket for gethostname()
-AC_CHECK_LIB(socket, gethostname, [LIBS="$LIBS -lsocket"])
-
-dnl Checks for library functions.
-
-AC_CHECK_FUNCS(symlink getcwd getwd lstat gethostname strerror clock \
- getrusage times alarm getlogin getgid getuid kill link ttyname)
-
-dnl The standard autoconf HAVE_STRUCT_TIMEZONE doesn't actually check
-dnl for struct timezone, as you might think. We also need to check how
-dnl to call gettimeofday if we have it.
-LIBU77_GETTIMEOFDAY
-
-test $ac_cv_func_symlink = yes && MAYBES="$MAYBES symlnk_.o"
-test $ac_cv_func_lstat = yes && MAYBES="$MAYBES lstat_.o"
-test $ac_cv_func_gethostname = yes && MAYBES="$MAYBES hostnm_.o"
-test $ac_cv_func_clock = yes && MAYBES="$MAYBES mclock_.o"
-AC_SUBST(MAYBES)
-
-AC_SUBST(CROSS)
-AC_SUBST(RANLIB)
-AC_SUBST(RANLIB_TEST)
-AC_OUTPUT(Makefile)
diff --git a/contrib/libf2c/libU77/ctime_.c b/contrib/libf2c/libU77/ctime_.c
deleted file mode 100644
index a855cb59539f..000000000000
--- a/contrib/libf2c/libU77/ctime_.c
+++ /dev/null
@@ -1,58 +0,0 @@
-/* Copyright (C) 1995, 1996, 2001 Free Software Foundation, Inc.
-This file is part of GNU Fortran libU77 library.
-
-This library is free software; you can redistribute it and/or modify it
-under the terms of the GNU Library General Public License as published
-by the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-GNU Fortran 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 GNU Fortran; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-#include <sys/types.h>
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <time.h>
-# endif
-#endif
-#if HAVE_STRING_H
-# include <string.h>
-#else
-# include <strings.h>
-#endif
-#include "f2c.h"
-
-/* may need sys/time.h & long arg for stime (bsd, svr1-3) */
-
-#ifdef KR_headers
-/* Character */ void G77_ctime_0 (chtime, Lchtime, xstime)
- char *chtime;
- longint * xstime;
- ftnlen Lchtime;
-#else
-/* Character */ void G77_ctime_0 (char *chtime, const ftnlen Lchtime, longint * xstime)
-#endif
-{
- int i, l;
- int s_copy ();
- time_t stime = *xstime;
-
- /* Allow a length other than 24 for compatibility with what other
- systems do, despite it being documented as 24. */
- s_copy (chtime, ctime (&stime), Lchtime, 24);
-}
diff --git a/contrib/libf2c/libU77/date_.c b/contrib/libf2c/libU77/date_.c
deleted file mode 100644
index 4f8254d37408..000000000000
--- a/contrib/libf2c/libU77/date_.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/* date_.f -- translated by f2c (version 19961001).
- You must link the resulting object file with the libraries:
- -lf2c -lm (in that order)
-*/
-
-#include "f2c.h"
-
-/* Table of constant values */
-
-static integer c__5 = 5;
-
-/* Subroutine */ int G77_date_y2kbug_0 (char *buf, ftnlen buf_len)
-{
- /* System generated locals */
- address a__1[5];
- longint i__1;
- integer i__2[5];
- char ch__1[24];
-
- /* Builtin functions */
- /* Subroutine */ int s_copy(), s_cat();
-
- /* Local variables */
- static char cbuf[24];
- extern longint G77_time_0 ();
- extern /* Character */ VOID G77_ctime_0 ();
-
- i__1 = G77_time_0 ();
- G77_ctime_0 (ch__1, 24L, &i__1);
- s_copy(cbuf, ch__1, 24L, 24L);
-/* Writing concatenation */
- i__2[0] = 2, a__1[0] = cbuf + 8;
- i__2[1] = 1, a__1[1] = "-";
- i__2[2] = 3, a__1[2] = cbuf + 4;
- i__2[3] = 1, a__1[3] = "-";
- i__2[4] = 2, a__1[4] = cbuf + 22;
- s_cat(buf, a__1, i__2, &c__5, buf_len);
- return 0;
-} /* date_ */
-
diff --git a/contrib/libf2c/libU77/datetime_.c b/contrib/libf2c/libU77/datetime_.c
deleted file mode 100644
index 62b06b6ad3b6..000000000000
--- a/contrib/libf2c/libU77/datetime_.c
+++ /dev/null
@@ -1,99 +0,0 @@
-/* Copyright (C) 1997, 1998, 1999, 2001 Free Software Foundation, Inc.
-This file is part of GNU Fortran libU77 library.
-
-This library is free software; you can redistribute it and/or modify it
-under the terms of the GNU Library General Public License as published
-by the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-GNU Fortran 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 GNU Fortran; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-#include <stdio.h>
-#include <sys/types.h>
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <time.h>
-# endif
-#endif
-#include "f2c.h"
-
-#ifdef KR_headers
-VOID s_copy ();
-#else
-void s_copy(register char *a, register char *b, ftnlen la, ftnlen lb);
-#endif
-
-int G77_date_and_time_0 (char *date, char *fftime, char *zone,
- integer *values, ftnlen date_len,
- ftnlen fftime_len, ftnlen zone_len)
-{
- time_t lt=time(&lt);
- struct tm ltime = *localtime(&lt), gtime = *gmtime(&lt);
- char dat[9], zon[6], ftim[11];
- int i, vals[8];
-
- vals[0] = 1900 + ltime.tm_year;
- vals[1] = 1 + ltime.tm_mon;
- vals[2] = ltime.tm_mday;
- /* fixme: year boundaries */
- vals[3] = (ltime.tm_min - gtime.tm_min +
- 60*(ltime.tm_hour - gtime.tm_hour +
- 24*(ltime.tm_yday -gtime.tm_yday)));
- vals[4] = ltime.tm_hour;
- vals[5] = ltime.tm_min;
- vals[6] = ltime.tm_sec;
- vals[7] = 0; /* no STDC/POSIX way to get this */
- /* GNUish way; maybe use `ftime' on other systems. */
-#if HAVE_GETTIMEOFDAY
- {
- struct timeval tp;
-# if GETTIMEOFDAY_ONE_ARGUMENT
- if (! gettimeofday (&tp))
-# else
-# if HAVE_STRUCT_TIMEZONE
- struct timezone tzp;
- /* Some systems such as HPUX, do have struct timezone, but
- gettimeofday takes void* as the 2nd arg. However, the effect
- of passing anything other than a null pointer is unspecified on
- HPUX. Configure checks if gettimeofday actually fails with a
- non-NULL arg and pretends that struct timezone is missing if it
- does fail. */
- if (! gettimeofday (&tp, &tzp))
-# else
- if (! gettimeofday (&tp, (void *) 0))
-# endif /* HAVE_STRUCT_TIMEZONE */
-# endif /* GETTIMEOFDAY_ONE_ARGUMENT */
- vals[7] = tp.tv_usec/1000;
- }
-#endif /* HAVE_GETTIMEOFDAY */
- if (values) /* null pointer for missing optional */
- for (i=0; i<=7; i++)
- values[i] = vals[i];
- sprintf (dat, "%04d%02d%02d", vals[0], vals[1], vals[2]);
- s_copy(date, dat, date_len, 8);
- if (zone) {
- sprintf(zon, "%+03d%02d", vals[3] / 60, abs(vals[3] % 60));
- s_copy(zone, zon, zone_len, 5);
- }
- if (fftime) {
- sprintf (ftim, "%02d%02d%02d.%03d", vals[4], vals[5], vals[6], vals[7]);
- s_copy(fftime, ftim, fftime_len, 10);
- }
- return 0;
-}
diff --git a/contrib/libf2c/libU77/dbes.c b/contrib/libf2c/libU77/dbes.c
deleted file mode 100644
index 1ef5978a8e8d..000000000000
--- a/contrib/libf2c/libU77/dbes.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/* Copyright (C) 1995, 1996 Free Software Foundation, Inc.
-This file is part of GNU Fortran libU77 library.
-
-This library is free software; you can redistribute it and/or modify it
-under the terms of the GNU Library General Public License as published
-by the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-GNU Fortran 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 GNU Fortran; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#if 0 /* Don't include these unless necessary -- dnp. */
-#include "f2c.h"
-#include <math.h>
-
-double G77_dbesj0_0 (const double *x) {
- return j0 (*x);
-}
-
-double G77_dbesj1_0 (const double *x) {
- return j1 (*x);
-}
-
-double G77_dbesjn_0 (const integer *n, double *x) {
- return jn (*n, *x);
- }
-
-double G77_dbesy0_0 (const double *x) {
- return y0 (*x);
-}
-
-double G77_dbesy1_0 (const double *x) {
- return y1 (*x);
-}
-
-double G77_dbesyn_0 (const integer *n, double *x) {
- return yn (*n, *x);
-}
-#endif
diff --git a/contrib/libf2c/libU77/dtime_.c b/contrib/libf2c/libU77/dtime_.c
deleted file mode 100644
index 19100e698de6..000000000000
--- a/contrib/libf2c/libU77/dtime_.c
+++ /dev/null
@@ -1,172 +0,0 @@
-/* Copyright (C) 1995, 1996 Free Software Foundation, Inc.
-This file is part of GNU Fortran libU77 library.
-
-This library is free software; you can redistribute it and/or modify it
-under the terms of the GNU Library General Public License as published
-by the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-GNU Fortran 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 GNU Fortran; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-#if HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-#include <sys/types.h>
-#if HAVE_SYS_TIMES_H
-# include <sys/times.h>
-#endif
-#if HAVE_SYS_PARAM_H
-# include <sys/param.h>
-#endif
-#if HAVE_GETRUSAGE
-# include <sys/time.h>
-# include <sys/resource.h>
-#endif
-#if defined (_WIN32)
-# include <windows.h>
-# undef min
-# undef max
-#endif
-#include <errno.h> /* for ENOSYS */
-#include "f2c.h"
-
-/* For dtime, etime we store the clock tick parameter (clk_tck) the
- first time either of them is invoked rather than each time. This
- approach probably speeds up each invocation by avoiding a system
- call each time, but means that the overhead of the first call is
- different to all others. */
-static long clk_tck = 0;
-
-#ifdef KR_headers
-double G77_dtime_0 (tarray)
- real tarray[2];
-#else
-double G77_dtime_0 (real tarray[2])
-#endif
-{
-#if defined (_WIN32)
- static int win32_platform = -1;
-
- if (win32_platform == -1)
- {
- OSVERSIONINFO osv;
- osv.dwOSVersionInfoSize = sizeof (osv);
- GetVersionEx (&osv);
- win32_platform = osv.dwPlatformId;
- }
-
- /* We need to use this hack on non-NT platforms, where the first call
- returns 0.0 and subsequent ones return the correct value. */
- if (win32_platform != VER_PLATFORM_WIN32_NT)
- {
- static unsigned long long clock_freq;
- static unsigned long long old_count;
- unsigned long long count;
- double delta;
- LARGE_INTEGER counter_val;
-
- if (clock_freq == 0)
- {
- LARGE_INTEGER freq;
- if (! QueryPerformanceFrequency (&freq))
- {
- errno = ENOSYS;
- return 0.0;
- }
- else
- {
- clock_freq = ((unsigned long long) freq.HighPart << 32)
- + ((unsigned) freq.LowPart);
- }
- }
-
- if (! QueryPerformanceCounter (&counter_val))
- return -1.0;
-
- count = ((unsigned long long) counter_val.HighPart << 32)
- + (unsigned) counter_val.LowPart;
- delta = ((double) (count - old_count)) / clock_freq;
- tarray[0] = (float) delta;
- tarray[1] = 0.0;
- old_count = count;
- }
- else
- {
- static unsigned long long old_utime, old_stime;
- unsigned long long utime, stime;
- FILETIME creation_time, exit_time, kernel_time, user_time;
-
- GetProcessTimes (GetCurrentProcess (), &creation_time, &exit_time,
- &kernel_time, &user_time);
- utime = ((unsigned long long) user_time.dwHighDateTime << 32)
- + (unsigned) user_time.dwLowDateTime;
- stime = ((unsigned long long) kernel_time.dwHighDateTime << 32)
- + (unsigned) kernel_time.dwLowDateTime;
-
- tarray[0] = (utime - old_utime) / 1.0e7;
- tarray[1] = (stime - old_stime) / 1.0e7;
- old_utime = utime;
- old_stime = stime;
- }
- return tarray[0] + tarray[1];
-
-#elif defined (HAVE_GETRUSAGE) || defined (HAVE_TIMES)
- /* The getrusage version is only the default for convenience. */
-#ifdef HAVE_GETRUSAGE
- float utime, stime;
- static float old_utime = 0.0, old_stime = 0.0;
- struct rusage rbuff;
-
- if (getrusage (RUSAGE_SELF, &rbuff) != 0)
- abort ();
- utime = (float) (rbuff.ru_utime).tv_sec +
- (float) (rbuff.ru_utime).tv_usec/1000000.0;
- tarray[0] = utime - (float) old_utime;
- stime = (float) (rbuff.ru_stime).tv_sec +
- (float) (rbuff.ru_stime).tv_usec/1000000.0;
- tarray[1] = stime - old_stime;
-#else /* HAVE_GETRUSAGE */
- time_t utime, stime;
- static time_t old_utime = 0, old_stime = 0;
- struct tms buffer;
-
-/* NeXTStep seems to define _SC_CLK_TCK but not to have sysconf;
- fixme: does using _POSIX_VERSION help? */
-# if defined _SC_CLK_TCK && defined _POSIX_VERSION
- if (! clk_tck) clk_tck = sysconf(_SC_CLK_TCK);
-# elif defined CLOCKS_PER_SECOND
- if (! clk_tck) clk_tck = CLOCKS_PER_SECOND;
-# elif defined CLK_TCK
- if (! clk_tck) clk_tck = CLK_TCK;
-# elif defined HZ
- if (! clk_tck) clk_tck = HZ;
-# elif defined HAVE_GETRUSAGE
-# else
- #error Dont know clock tick length
-# endif
- if (times(&buffer) == (clock_t)-1) return -1.0;
- utime = buffer.tms_utime; stime = buffer.tms_stime;
- tarray[0] = ((float)(utime - old_utime)) / (float)clk_tck;
- tarray[1] = ((float)(stime - old_stime)) / (float)clk_tck;
-#endif /* HAVE_GETRUSAGE */
- old_utime = utime; old_stime = stime;
- return (tarray[0]+tarray[1]);
-#else /* ! HAVE_GETRUSAGE && ! HAVE_TIMES */
- errno = ENOSYS;
- return 0.0;
-#endif /* ! HAVE_GETRUSAGE && ! HAVE_TIMES */
-}
diff --git a/contrib/libf2c/libU77/etime_.c b/contrib/libf2c/libU77/etime_.c
deleted file mode 100644
index 88eead3fbb47..000000000000
--- a/contrib/libf2c/libU77/etime_.c
+++ /dev/null
@@ -1,163 +0,0 @@
-/* Copyright (C) 1995, 1996 Free Software Foundation, Inc.
-This file is part of GNU Fortran libU77 library.
-
-This library is free software; you can redistribute it and/or modify it
-under the terms of the GNU Library General Public License as published
-by the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-GNU Fortran 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 GNU Fortran; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-#if HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-#include <sys/types.h>
-#if HAVE_SYS_TIMES_H
-# include <sys/times.h>
-#endif
-#if HAVE_SYS_PARAM_H
-# include <sys/param.h>
-#endif
-#if HAVE_GETRUSAGE
-# include <sys/time.h>
-# include <sys/resource.h>
-#endif
-#if defined (_WIN32)
-# include <windows.h>
-# undef min
-# undef max
-#endif
-#include <errno.h> /* for ENOSYS */
-#include "f2c.h"
-
-/* For dtime, etime we store the clock tick parameter (clk_tck) the
- first time either of them is invoked rather than each time. This
- approach probably speeds up each invocation by avoiding a system
- call each time, but means that the overhead of the first call is
- different to all others. */
-static long clk_tck = 0;
-
-#ifdef KR_headers
-double G77_etime_0 (tarray)
- real tarray[2];
-#else
-double G77_etime_0 (real tarray[2])
-#endif
-{
-#if defined (_WIN32)
- static int win32_platform = -1;
- double usertime, systime;
-
- if (win32_platform == -1)
- {
- OSVERSIONINFO osv;
- osv.dwOSVersionInfoSize = sizeof (osv);
- GetVersionEx (&osv);
- win32_platform = osv.dwPlatformId;
- }
-
- /* non-NT platforms don't have a clue as to how long a process has
- been running, so simply return the uptime. Bad judgement call? */
- if (win32_platform != VER_PLATFORM_WIN32_NT)
- {
- static unsigned long long clock_freq;
- static unsigned long long old_count;
- unsigned long long count;
- LARGE_INTEGER counter_val;
-
- if (clock_freq == 0)
- {
- LARGE_INTEGER freq;
- if (! QueryPerformanceFrequency (&freq))
- {
- errno = ENOSYS;
- return 0.0;
- }
- else
- {
- clock_freq = ((unsigned long long) freq.HighPart << 32)
- + ((unsigned) freq.LowPart);
- if (! QueryPerformanceCounter (&counter_val))
- return -1.0;
- old_count = ((unsigned long long) counter_val.HighPart << 32)
- + (unsigned) counter_val.LowPart;
- }
- }
-
- if (! QueryPerformanceCounter (&counter_val))
- return -1.0;
-
- count = ((unsigned long long) counter_val.HighPart << 32)
- + (unsigned) counter_val.LowPart;
- tarray[0] = usertime = (double) (count - old_count) / clock_freq;
- tarray[1] = systime = 0.0;
- }
- else
- {
- FILETIME creation_time, exit_time, kernel_time, user_time;
- unsigned long long utime, stime;
-
- GetProcessTimes (GetCurrentProcess (), &creation_time, &exit_time,
- &kernel_time, &user_time);
- utime = ((unsigned long long) user_time.dwHighDateTime << 32)
- + (unsigned) user_time.dwLowDateTime;
- stime = ((unsigned long long) kernel_time.dwHighDateTime << 32)
- + (unsigned) kernel_time.dwLowDateTime;
-
- tarray[0] = usertime = utime / 1.0e7;
- tarray[1] = systime = stime / 1.0e7;
- }
- return usertime + systime;
-
-#elif defined (HAVE_GETRUSAGE) || defined (HAVE_TIMES)
- /* The getrusage version is only the default for convenience. */
-#ifdef HAVE_GETRUSAGE
- struct rusage rbuff;
-
- if (getrusage (RUSAGE_SELF, &rbuff) != 0)
- abort ();
- tarray[0] = ((float) (rbuff.ru_utime).tv_sec +
- (float) (rbuff.ru_utime).tv_usec/1000000.0);
- tarray[1] = ((float) (rbuff.ru_stime).tv_sec +
- (float) (rbuff.ru_stime).tv_usec/1000000.0);
-#else /* HAVE_GETRUSAGE */
- struct tms buffer;
-
-/* NeXTStep seems to define _SC_CLK_TCK but not to have sysconf;
- fixme: does using _POSIX_VERSION help? */
-# if defined _SC_CLK_TCK && defined _POSIX_VERSION
- if (! clk_tck) clk_tck = sysconf(_SC_CLK_TCK);
-# elif defined CLOCKS_PER_SECOND
- if (! clk_tck) clk_tck = CLOCKS_PER_SECOND;
-# elif defined CLK_TCK
- if (! clk_tck) clk_tck = CLK_TCK;
-# elif defined HZ
- if (! clk_tck) clk_tck = HZ;
-# elif defined HAVE_GETRUSAGE
-# else
- #error Dont know clock tick length
-# endif
- if (times(&buffer) == (clock_t)-1) return -1.0;
- tarray[0] = (float) buffer.tms_utime / (float)clk_tck;
- tarray[1] = (float) buffer.tms_stime / (float)clk_tck;
-#endif /* HAVE_GETRUSAGE */
- return (tarray[0]+tarray[1]);
-#else /* ! HAVE_GETRUSAGE && ! HAVE_TIMES */
- errno = ENOSYS;
- return 0.0;
-#endif /* ! HAVE_GETRUSAGE && ! HAVE_TIMES */
-}
diff --git a/contrib/libf2c/libU77/fdate_.c b/contrib/libf2c/libU77/fdate_.c
deleted file mode 100644
index a0bc9836f44b..000000000000
--- a/contrib/libf2c/libU77/fdate_.c
+++ /dev/null
@@ -1,54 +0,0 @@
-/* Copyright (C) 1995, 1996, 2001 Free Software Foundation, Inc.
-This file is part of GNU Fortran libU77 library.
-
-This library is free software; you can redistribute it and/or modify it
-under the terms of the GNU Library General Public License as published
-by the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-GNU Fortran 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 GNU Fortran; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-#include <stdio.h>
-#include <sys/types.h>
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <time.h>
-# endif
-#endif
-#if HAVE_STRING_H
-# include <string.h>
-#else
-# include <strings.h>
-#endif
-
-#include "f2c.h"
-
-/* NB. this implementation is for a character*24 function. There's
- also a subroutine version. Of course, the calling convention is
- essentially the same for both. */
-
-/* Character *24 */ void G77_fdate_0 (char *ret_val, ftnlen ret_val_len)
-{
- int s_copy ();
- time_t tloc;
- tloc = time (NULL);
- /* Allow a length other than 24 for compatibility with what other
- systems do, despite it being documented as 24. */
- s_copy (ret_val, ctime ((time_t *) &tloc), ret_val_len, 24);
-}
diff --git a/contrib/libf2c/libU77/fgetc_.c b/contrib/libf2c/libU77/fgetc_.c
deleted file mode 100644
index 49f39830d2c8..000000000000
--- a/contrib/libf2c/libU77/fgetc_.c
+++ /dev/null
@@ -1,70 +0,0 @@
-/* Copyright (C) 1996 Free Software Foundation, Inc.
-This file is part of GNU Fortran libU77 library.
-
-This library is free software; you can redistribute it and/or modify it
-under the terms of the GNU Library General Public License as published
-by the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-GNU Fortran 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 GNU Fortran; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-#include <stdio.h>
-#include "f2c.h"
-#include "fio.h"
-
-#ifdef KR_headers
-integer G77_fgetc_0 (lunit, c, Lc)
- integer *lunit;
- ftnlen Lc; /* should be 1 */
- char *c;
-#else
-integer G77_fgetc_0 (const integer *lunit, char *c, ftnlen Lc)
-#endif
-{
- int err;
- FILE *f = f__units[*lunit].ufd;
-
- if (*lunit>=MXUNIT || *lunit<0)
- return 101; /* bad unit error */
- err = getc (f);
- if (err == EOF) {
- if (feof (f))
- return -1;
- else
- return ferror (f); }
- else {
- if (Lc == 0)
- return 0;
-
- c[0] = err;
- while (--Lc)
- *++c = ' ';
- return 0; }
-}
-
-#ifdef KR_headers
-integer G77_fget_0 (c, Lc)
- ftnlen Lc; /* should be 1 */
- char *c;
-#else
-integer G77_fget_0 (char *c, const ftnlen Lc)
-#endif
-{
- integer five = 5;
-
- return G77_fgetc_0 (&five, c, Lc);
-}
diff --git a/contrib/libf2c/libU77/flush1_.c b/contrib/libf2c/libU77/flush1_.c
deleted file mode 100644
index 451915debaca..000000000000
--- a/contrib/libf2c/libU77/flush1_.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/* Copyright (C) 1995 Free Software Foundation, Inc.
-This file is part of GNU Fortran libU77 library.
-
-This library is free software; you can redistribute it and/or modify it
-under the terms of the GNU Library General Public License as published
-by the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-GNU Fortran 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 GNU Fortran; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-#include <stdio.h>
-#include "f2c.h"
-#include "fio.h"
-
-/* This flushes a single unit, c.f. libI77 version. */
-
-#ifdef KR_headers
-extern integer G77_fnum_0 ();
-
-/* Subroutine */ int G77_flush1_0 (lunit)
- integer *lunit;
-#else
-extern integer G77_fnum_0 (integer *);
-
-/* Subroutine */ int G77_flush1_0 (const integer *lunit)
-#endif
-{
- if (*lunit>=MXUNIT || *lunit<0)
- err(1,101,"flush");
- /* f__units is a table of descriptions for the unit numbers (defined
- in io.h) with file descriptors rather than streams */
- if (f__units[*lunit].ufd != NULL && f__units[*lunit].uwrt)
- fflush(f__units[*lunit].ufd);
- return 0;
-}
diff --git a/contrib/libf2c/libU77/fnum_.c b/contrib/libf2c/libU77/fnum_.c
deleted file mode 100644
index 0a3ba013e061..000000000000
--- a/contrib/libf2c/libU77/fnum_.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Copyright (C) 1995 Free Software Foundation, Inc.
-This file is part of GNU Fortran libU77 library.
-
-This library is free software; you can redistribute it and/or modify it
-under the terms of the GNU Library General Public License as published
-by the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-GNU Fortran 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 GNU Fortran; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-#include "f2c.h"
-#include "fio.h"
-
-#ifdef KR_headers
-integer G77_fnum_0 (lunit)
- integer *lunit;
-#else
-integer G77_fnum_0 (integer *lunit)
-#endif
-{
- if (*lunit>=MXUNIT || *lunit<0)
- err(1,101,"fnum");
- /* f__units is a table of descriptions for the unit numbers (defined
- in io.h). Use file descriptor (ufd) and fileno rather than udev
- field since udev is unix specific */
- return fileno(f__units[*lunit].ufd);
-}
diff --git a/contrib/libf2c/libU77/fputc_.c b/contrib/libf2c/libU77/fputc_.c
deleted file mode 100644
index 5a1109e8d4f6..000000000000
--- a/contrib/libf2c/libU77/fputc_.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/* Copyright (C) 1996 Free Software Foundation, Inc.
-This file is part of GNU Fortran libU77 library.
-
-This library is free software; you can redistribute it and/or modify it
-under the terms of the GNU Library General Public License as published
-by the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-GNU Fortran 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 GNU Fortran; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-#include <stdio.h>
-#include "f2c.h"
-#include "fio.h"
-
-#ifdef KR_headers
-integer G77_fputc_0 (lunit, c, Lc)
- integer *lunit;
- ftnlen Lc; /* should be 1 */
- char *c;
-#else
-integer G77_fputc_0 (const integer *lunit, const char *c, const ftnlen Lc)
-#endif
-{
- int err;
- FILE *f = f__units[*lunit].ufd;
-
- if (*lunit>=MXUNIT || *lunit<0)
- return 101; /* bad unit error */
- err = putc (c[0], f);
- if (err == EOF) {
- if (feof (f))
- return -1;
- else
- return ferror (f);
- }
- else
- return 0;
-}
-
-#ifdef KR_headers
-integer G77_fput_0 (c, Lc)
- ftnlen Lc; /* should be 1 */
- char *c;
-#else
-integer G77_fput_0 (const char *c, const ftnlen Lc)
-#endif
-{
- integer six = 6;
-
- return G77_fputc_0 (&six, c, Lc);
-}
diff --git a/contrib/libf2c/libU77/fstat_.c b/contrib/libf2c/libU77/fstat_.c
deleted file mode 100644
index da5434ad0b73..000000000000
--- a/contrib/libf2c/libU77/fstat_.c
+++ /dev/null
@@ -1,71 +0,0 @@
-/* Copyright (C) 1995 Free Software Foundation, Inc.
-This file is part of GNU Fortran libU77 library.
-
-This library is free software; you can redistribute it and/or modify it
-under the terms of the GNU Library General Public License as published
-by the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-GNU Fortran 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 GNU Fortran; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-#include "f2c.h"
-#include <sys/types.h>
-#include <sys/stat.h>
-
-#ifdef KR_headers
-extern integer G77_fnum_0 ();
-
-integer G77_fstat_0 (lunit, statb)
- integer *lunit;
- integer statb[13];
-#else
-extern integer G77_fnum_0 (const integer *);
-
-integer G77_fstat_0 (const integer *lunit, integer statb[13])
-#endif
-{
- int err;
- struct stat buf;
-
- err = fstat (G77_fnum_0 (lunit), &buf);
- statb[0] = buf.st_dev;
- statb[1] = buf.st_ino;
- statb[2] = buf.st_mode;
- statb[3] = buf.st_nlink;
- statb[4] = buf.st_uid;
- statb[5] = buf.st_gid;
-#if HAVE_ST_RDEV
- statb[6] = buf.st_rdev; /* not posix */
-#else
- statb[6] = 0;
-#endif
- statb[7] = buf.st_size;
- statb[8] = buf.st_atime;
- statb[9] = buf.st_mtime;
- statb[10] = buf.st_ctime;
-#if HAVE_ST_BLKSIZE
- statb[11] = buf.st_blksize; /* not posix */
-#else
- statb[11] = -1;
-#endif
-#if HAVE_ST_BLOCKS
- statb[12] = buf.st_blocks; /* not posix */
-#else
- statb[12] = -1;
-#endif
- return err;
-}
diff --git a/contrib/libf2c/libU77/gerror_.c b/contrib/libf2c/libU77/gerror_.c
deleted file mode 100644
index 6f5943c1dcec..000000000000
--- a/contrib/libf2c/libU77/gerror_.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/* Copyright (C) 1995 Free Software Foundation, Inc.
-This file is part of GNU Fortran libU77 library.
-
-This library is free software; you can redistribute it and/or modify it
-under the terms of the GNU Library General Public License as published
-by the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-GNU Fortran 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 GNU Fortran; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-#include <errno.h>
-#include <stddef.h>
-#if HAVE_STRING_H
-# include <string.h>
-#else
-# include <strings.h>
-#endif
-#include "f2c.h"
-
-#ifndef HAVE_STRERROR
- extern char *sys_errlist [];
-# define strerror(i) (sys_errlist[i])
-#endif
-#ifdef KR_headers
-extern void s_copy ();
-/* Subroutine */ int G77_gerror_0 (str, Lstr)
- char *str; ftnlen Lstr;
-#else
-extern void s_copy(register char *a, register char *b, ftnlen la, ftnlen lb);
-/* Subroutine */ int G77_gerror_0 (char *str, ftnlen Lstr)
-#endif
-{
- char * s;
-
- s = strerror(errno);
- s_copy (str, s, Lstr, strlen (s));
- return 0;
-}
diff --git a/contrib/libf2c/libU77/getcwd_.c b/contrib/libf2c/libU77/getcwd_.c
deleted file mode 100644
index e757803896ad..000000000000
--- a/contrib/libf2c/libU77/getcwd_.c
+++ /dev/null
@@ -1,99 +0,0 @@
-/* Copyright (C) 1995, 1996 Free Software Foundation, Inc.
-This file is part of GNU Fortran libU77 library.
-
-This library is free software; you can redistribute it and/or modify it
-under the terms of the GNU Library General Public License as published
-by the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-GNU Fortran 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 GNU Fortran; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-#include <errno.h>
-#if HAVE_STRING_H
-# include <string.h>
-#else
-# include <strings.h>
-#endif
-#include <stdio.h> /* for NULL */
-#include <errno.h> /* for ENOSYS */
-#include "f2c.h"
-
-#if HAVE_GETCWD
-
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#else
- extern char *getcwd ();
-#endif
-
-#ifdef KR_headers
-extern void s_copy ();
-integer G77_getcwd_0 (str, Lstr)
- char *str; ftnlen Lstr;
-#else
-extern void s_copy(register char *a, register char *b, ftnlen la, ftnlen lb);
-integer G77_getcwd_0 (char *str, const ftnlen Lstr)
-#endif
-{
- int i;
- char *ret;
-
- ret = getcwd (str, Lstr);
- if (ret == NULL) return errno;
- for (i=strlen(str); i<Lstr; i++)
- str[i] = ' ';
- return 0;
-}
-
-#elif HAVE_GETWD /* HAVE_GETCWD */
-
-/* getwd usage taken from SunOS4 man */
-
-# include <sys/param.h>
- extern char *getwd ();
-#ifdef KR_headers
-extern VOID s_copy ();
-integer G77_getcwd_0 (str, Lstr)
- char *str; ftnlen Lstr;
-#else
-extern void s_copy(register char *a, register char *b, ftnlen la, ftnlen lb);
-integer G77_getcwd_0 (char *str, const ftnlen Lstr)
-#endif
-{
- char pathname[MAXPATHLEN];
- size_t l;
-
- if (getwd (pathname) == NULL) {
- return errno;
- } else {
- s_copy (str, pathname, Lstr, strlen (str));
- return 0;
- }
-}
-
-#else /* !HAVE_GETWD && !HAVE_GETCWD */
-
-#ifdef KR_headers
-extern VOID s_copy ();
-integer G77_getcwd_0 (str, Lstr)
- char *str; ftnlen Lstr;
-#else
-extern void s_copy(register char *a, register char *b, ftnlen la, ftnlen lb);
-integer G77_getcwd_0 (char *str, const ftnlen Lstr)
-#endif
-{
- return errno = ENOSYS;
-}
-
-#endif
diff --git a/contrib/libf2c/libU77/getgid_.c b/contrib/libf2c/libU77/getgid_.c
deleted file mode 100644
index b489bacc6ed2..000000000000
--- a/contrib/libf2c/libU77/getgid_.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/* Copyright (C) 1995 Free Software Foundation, Inc.
-This file is part of GNU Fortran libU77 library.
-
-This library is free software; you can redistribute it and/or modify it
-under the terms of the GNU Library General Public License as published
-by the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-GNU Fortran 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 GNU Fortran; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-#if HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#include <sys/types.h>
-#include <errno.h> /* for ENOSYS */
-#include "f2c.h"
-
-#ifdef KR_headers
-integer G77_getgid_0 ()
-#else
-integer G77_getgid_0 (void)
-#endif
-{
-#if defined (HAVE_GETGID)
- return getgid ();
-#else
- errno = ENOSYS;
- return -1;
-#endif
-}
diff --git a/contrib/libf2c/libU77/getlog_.c b/contrib/libf2c/libU77/getlog_.c
deleted file mode 100644
index 82cb564a67a4..000000000000
--- a/contrib/libf2c/libU77/getlog_.c
+++ /dev/null
@@ -1,71 +0,0 @@
-/* Copyright (C) 1995 Free Software Foundation, Inc.
-This file is part of GNU Fortran libU77 library.
-
-This library is free software; you can redistribute it and/or modify it
-under the terms of the GNU Library General Public License as published
-by the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-GNU Fortran 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 GNU Fortran; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-#include <sys/types.h>
-#if HAVE_STDLIB_H
-# include <stdlib.h>
-#else
-# include <stdio.h>
-#endif
-#include <stdio.h>
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-#if HAVE_STRING_H
-# include <string.h>
-#else
-# include <strings.h>
-#endif
-#include <errno.h> /* for ENOSYS */
-#include "f2c.h"
-
-/* getlogin not in svr1-3 */
-
-/* SGI also has character*(*) function getlog() */
-
-#ifdef KR_headers
-extern VOID s_copy ();
-/* Subroutine */ int G77_getlog_0 (str, Lstr)
- char *str; ftnlen Lstr;
-#else
-extern void s_copy(register char *a, register char *b, ftnlen la, ftnlen lb);
-/* Subroutine */ int G77_getlog_0 (char *str, const ftnlen Lstr)
-#endif
-{
- size_t i;
- char *p;
- int status;
-
-#if defined (HAVE_GETLOGIN)
- p = getlogin ();
- if (p != NULL) {
- i = strlen (p);
- s_copy (str, p, Lstr, i);
- } else {
- s_copy (str, " ", Lstr, 1);
- }
- status = 0;
-#else
- errno = ENOSYS;
- status = -1;
-#endif
- return status;
-}
diff --git a/contrib/libf2c/libU77/getpid_.c b/contrib/libf2c/libU77/getpid_.c
deleted file mode 100644
index fa484785957c..000000000000
--- a/contrib/libf2c/libU77/getpid_.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Copyright (C) 1995 Free Software Foundation, Inc.
-This file is part of GNU Fortran libU77 library.
-
-This library is free software; you can redistribute it and/or modify it
-under the terms of the GNU Library General Public License as published
-by the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-GNU Fortran 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 GNU Fortran; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-#if HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#include <sys/types.h>
-#include "f2c.h"
-
-#ifdef KR_headers
-integer G77_getpid_0 ()
-#else
-integer G77_getpid_0 (void)
-#endif
-{
- return getpid ();
-}
diff --git a/contrib/libf2c/libU77/getuid_.c b/contrib/libf2c/libU77/getuid_.c
deleted file mode 100644
index 408ff0ab6004..000000000000
--- a/contrib/libf2c/libU77/getuid_.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/* Copyright (C) 1995 Free Software Foundation, Inc.
-This file is part of GNU Fortran libU77 library.
-
-This library is free software; you can redistribute it and/or modify it
-under the terms of the GNU Library General Public License as published
-by the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-GNU Fortran 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 GNU Fortran; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-#if HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#include <sys/types.h>
-#include <errno.h> /* for ENOSYS */
-#include "f2c.h"
-
-#ifdef KR_headers
-integer G77_getuid_0 ()
-#else
-integer G77_getuid_0 (void)
-#endif
-{
-#if defined (HAVE_GETUID)
- return getuid ();
-#else
- errno = ENOSYS;
- return -1;
-#endif
-}
diff --git a/contrib/libf2c/libU77/gmtime_.c b/contrib/libf2c/libU77/gmtime_.c
deleted file mode 100644
index 8036b5aabe4f..000000000000
--- a/contrib/libf2c/libU77/gmtime_.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/* Copyright (C) 1995, 2001 Free Software Foundation, Inc.
-This file is part of GNU Fortran libU77 library.
-
-This library is free software; you can redistribute it and/or modify it
-under the terms of the GNU Library General Public License as published
-by the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-GNU Fortran 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 GNU Fortran; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-#include <sys/types.h>
-/* fixme: do we need to use TM_IN_SYS_TIME? */
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <time.h>
-# endif
-#endif
-#include "f2c.h"
-
-#ifdef KR_headers
-/* Subroutine */ int G77_gmtime_0 (xstime, tarray)
- integer *xstime, tarray[9];
-#else
-/* Subroutine */ int G77_gmtime_0 (const integer * xstime, integer tarray[9])
-#endif
-{
- struct tm *lt;
- time_t stime = *xstime;
- lt = gmtime (&stime);
- tarray[0] = lt->tm_sec;
- tarray[1] = lt->tm_min;
- tarray[2] = lt->tm_hour;
- tarray[3] = lt->tm_mday;
- tarray[4] = lt->tm_mon;
- tarray[5] = lt->tm_year;
- tarray[6] = lt->tm_wday;
- tarray[7] = lt->tm_yday;
- tarray[8] = lt->tm_isdst;
- return 0;
-}
diff --git a/contrib/libf2c/libU77/hostnm_.c b/contrib/libf2c/libU77/hostnm_.c
deleted file mode 100644
index fd717b9f8572..000000000000
--- a/contrib/libf2c/libU77/hostnm_.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/* Copyright (C) 1995 Free Software Foundation, Inc.
-This file is part of GNU Fortran libU77 library.
-
-This library is free software; you can redistribute it and/or modify it
-under the terms of the GNU Library General Public License as published
-by the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-GNU Fortran 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 GNU Fortran; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-#if HAVE_STRING_H
-# include <string.h>
-#else
-# include <strings.h>
-#endif
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-#include <errno.h> /* for ENOSYS */
-#include "f2c.h"
-
-integer G77_hostnm_0 (char *name, ftnlen Lname)
-{
- int ret, i;
-
-#if HAVE_GETHOSTNAME
- ret = gethostname (name, Lname);
- if (ret==0) {
- /* Pad with blanks (assuming gethostname will make an error
- return if it can't fit in the null). */
- for (i=strlen(name); i<Lname; i++)
- name[i] = ' ';
- }
- return ret;
-#else
- return errno = ENOSYS;
-#endif
-}
diff --git a/contrib/libf2c/libU77/idate_.c b/contrib/libf2c/libU77/idate_.c
deleted file mode 100644
index 572efd956eb1..000000000000
--- a/contrib/libf2c/libU77/idate_.c
+++ /dev/null
@@ -1,58 +0,0 @@
-/* Copyright (C) 1995, 1996, 2001 Free Software Foundation, Inc.
-This file is part of GNU Fortran libU77 library.
-
-This library is free software; you can redistribute it and/or modify it
-under the terms of the GNU Library General Public License as published
-by the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-GNU Fortran 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 GNU Fortran; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-#include <stdio.h>
-#include <sys/types.h>
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <time.h>
-# endif
-#endif
-#include "f2c.h"
-
-/* VMS and Irix versions (at least) differ from libU77 elsewhere */
-
-/* libU77 one: */
-
-#ifdef KR_headers
-/* Subroutine */ int G77_idate_0 (iarray)
- int iarray[3];
-#else
-/* Subroutine */ int G77_idate_0 (int iarray[3])
-#endif
-{
- struct tm *lt;
- time_t tim;
- tim = time(NULL);
- lt = localtime(&tim);
- iarray[0] = lt->tm_mday;
- iarray[1] = lt->tm_mon + 1; /* in range 1-12 in SunOS (experimentally) */
- /* The `+1900' is consistent with SunOS and Irix, but they don't say
- it's added. I think I've seen a system where tm_year was since
- 1970, but can't now verify that, so assume the ANSI definition. */
- iarray[2] = lt->tm_year + 1900;
- return 0;
-}
diff --git a/contrib/libf2c/libU77/ierrno_.c b/contrib/libf2c/libU77/ierrno_.c
deleted file mode 100644
index 557b53a46648..000000000000
--- a/contrib/libf2c/libU77/ierrno_.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Copyright (C) 1995 Free Software Foundation, Inc.
-This file is part of GNU Fortran libU77 library.
-
-This library is free software; you can redistribute it and/or modify it
-under the terms of the GNU Library General Public License as published
-by the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-GNU Fortran 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 GNU Fortran; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-#include <errno.h>
-#include "f2c.h"
-
-#ifdef KR_headers
-integer G77_ierrno_0 ()
-#else
-integer G77_ierrno_0 (void)
-#endif
-{
- return errno;
-}
diff --git a/contrib/libf2c/libU77/irand_.c b/contrib/libf2c/libU77/irand_.c
deleted file mode 100644
index 2bf14ccee263..000000000000
--- a/contrib/libf2c/libU77/irand_.c
+++ /dev/null
@@ -1,57 +0,0 @@
-/* Copyright (C) 1995 Free Software Foundation, Inc.
-This file is part of GNU Fortran libU77 library.
-
-This library is free software; you can redistribute it and/or modify it
-under the terms of the GNU Library General Public License as published
-by the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-GNU Fortran 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 GNU Fortran; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-#if HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
-#include "f2c.h"
-
-/* We could presumably do much better than the traditional libc
- version, though at least the glibc one is reasonable, it seems.
- For the sake of the innocent, I'm not sure we should really do
- this... */
-
-/* Note this is per SunOS -- other s may have no arg. */
-
-#ifdef KR_headers
-integer G77_irand_0 (flag)
- integer *flag;
-#else
-integer G77_irand_0 (integer *flag)
-#endif
-{
- switch (*flag) {
- case 0:
- break;
- case 1:
- srand (0); /* Arbitrary choice of initialiser. */
- break;
- default:
- srand (*flag);
- }
- return rand ();
-}
-
-
-
-
-
-
diff --git a/contrib/libf2c/libU77/isatty_.c b/contrib/libf2c/libU77/isatty_.c
deleted file mode 100644
index 92c33468f539..000000000000
--- a/contrib/libf2c/libU77/isatty_.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Copyright (C) 1995 Free Software Foundation, Inc.
-This file is part of GNU Fortran libU77 library.
-
-This library is free software; you can redistribute it and/or modify it
-under the terms of the GNU Library General Public License as published
-by the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-GNU Fortran 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 GNU Fortran; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-#include "f2c.h"
-#include "fio.h"
-
-#ifdef KR_headers
-extern integer G77_fnum_0 ();
-
-logical G77_isatty_0 (lunit)
- integer *lunit;
-#else
-extern integer G77_fnum_0 (integer *);
-
-logical G77_isatty_0 (integer *lunit)
-#endif
-{
- if (*lunit>=MXUNIT || *lunit<0)
- err(1,101,"isatty");
- /* f__units is a table of descriptions for the unit numbers (defined
- in io.h) with file descriptors rather than streams */
- return (isatty(G77_fnum_0 (lunit)) ? TRUE_ : FALSE_);
-}
diff --git a/contrib/libf2c/libU77/itime_.c b/contrib/libf2c/libU77/itime_.c
deleted file mode 100644
index ad47872dc8d0..000000000000
--- a/contrib/libf2c/libU77/itime_.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/* Copyright (C) 1995, 2001 Free Software Foundation, Inc.
-This file is part of GNU Fortran libU77 library.
-
-This library is free software; you can redistribute it and/or modify it
-under the terms of the GNU Library General Public License as published
-by the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-GNU Fortran 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 GNU Fortran; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-#include <stdio.h>
-#include <sys/types.h>
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <time.h>
-# endif
-#endif
-#include "f2c.h"
-
-#ifdef KR_headers
-/* Subroutine */ int G77_itime_0 (tarray)
- integer tarray[3];
-#else
-/* Subroutine */ int G77_itime_0 (integer tarray[3])
-#endif
-{
- struct tm *lt;
- time_t tim;
-
- tim = time(NULL);
- lt = localtime(&tim);
- tarray[0] = lt->tm_hour;
- tarray[1] = lt->tm_min;
- tarray[2] = lt->tm_sec;
- return 0;
-}
diff --git a/contrib/libf2c/libU77/kill_.c b/contrib/libf2c/libU77/kill_.c
deleted file mode 100644
index 99197bd02e7b..000000000000
--- a/contrib/libf2c/libU77/kill_.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/* Copyright (C) 1995 Free Software Foundation, Inc.
-This file is part of GNU Fortran libU77 library.
-
-This library is free software; you can redistribute it and/or modify it
-under the terms of the GNU Library General Public License as published
-by the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-GNU Fortran 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 GNU Fortran; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-#include <sys/types.h>
-#include <signal.h>
-#include <errno.h>
-#include "f2c.h"
-
-/* fixme: bsd, svr1-3 use int, not pid_t */
-
-#ifdef KR_headers
-integer G77_kill_0 (pid, signum)
- integer *pid, *signum;
-#else
-integer G77_kill_0 (const integer *pid, const integer *signum)
-#endif
-{
-#if defined (HAVE_KILL)
- return kill ((pid_t) *pid, *signum) ? errno : 0;
-#else
- errno = ENOSYS;
- return -1;
-#endif
-}
diff --git a/contrib/libf2c/libU77/link_.c b/contrib/libf2c/libU77/link_.c
deleted file mode 100644
index 003fac8ffe28..000000000000
--- a/contrib/libf2c/libU77/link_.c
+++ /dev/null
@@ -1,66 +0,0 @@
-/* Copyright (C) 1995, 1997 Free Software Foundation, Inc.
-This file is part of GNU Fortran libU77 library.
-
-This library is free software; you can redistribute it and/or modify it
-under the terms of the GNU Library General Public License as published
-by the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-GNU Fortran 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 GNU Fortran; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-#if HAVE_STDLIB_H
-# include <stdlib.h>
-#else
-# include <stdio.h>
-#endif
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-#include <errno.h>
-#if HAVE_SYS_PARAM_H
-# include <sys/param.h>
-#endif
-#include <errno.h> /* for ENOSYS */
-#include "f2c.h"
-
-#ifdef KR_headers
-void g_char ();
-
-integer G77_link_0 (path1, path2, Lpath1, Lpath2)
- char *path1, *path2; ftnlen Lpath1, Lpath2;
-#else
-void g_char(const char *a, ftnlen alen, char *b);
-
-integer G77_link_0 (const char *path1, const char *path2, const ftnlen Lpath1, const ftnlen Lpath2)
-#endif
-{
-#if defined (HAVE_LINK)
- char *buff1, *buff2;
- char *bp, *blast;
- int i;
-
- buff1 = malloc (Lpath1+1);
- if (buff1 == NULL) return -1;
- g_char (path1, Lpath1, buff1);
- buff2 = malloc (Lpath2+1);
- if (buff2 == NULL) return -1;
- g_char (path2, Lpath2, buff2);
- i = link (buff1, buff2);
- free (buff1); free (buff2);
- return i ? errno : 0;
-#else /* ! HAVE_LINK */
- errno = ENOSYS;
- return -1;
-#endif
-}
diff --git a/contrib/libf2c/libU77/lnblnk_.c b/contrib/libf2c/libU77/lnblnk_.c
deleted file mode 100644
index 806eca293f10..000000000000
--- a/contrib/libf2c/libU77/lnblnk_.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Copyright (C) 1995, 1997 Free Software Foundation, Inc.
-This file is part of GNU Fortran libU77 library.
-
-This library is free software; you can redistribute it and/or modify it
-under the terms of the GNU Library General Public License as published
-by the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-GNU Fortran 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 GNU Fortran; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-
-/* via f2c from Fortran */
-
-#include "f2c.h"
-
-integer G77_lnblnk_0 (char *str, ftnlen str_len)
-{
- integer ret_val;
- integer i_len();
-
- for (ret_val = str_len; ret_val >= 1; --ret_val) {
- if (*(unsigned char *)&str[ret_val - 1] != ' ') {
- return ret_val;
- }
- }
- return ret_val;
-}
diff --git a/contrib/libf2c/libU77/lstat_.c b/contrib/libf2c/libU77/lstat_.c
deleted file mode 100644
index 801f6aad1af6..000000000000
--- a/contrib/libf2c/libU77/lstat_.c
+++ /dev/null
@@ -1,86 +0,0 @@
-/* Copyright (C) 1995, 1997 Free Software Foundation, Inc.
-This file is part of GNU Fortran libU77 library.
-
-This library is free software; you can redistribute it and/or modify it
-under the terms of the GNU Library General Public License as published
-by the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-GNU Fortran 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 GNU Fortran; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-#include <stdio.h>
-#if HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <errno.h> /* for ENOSYS */
-#include "f2c.h"
-
-/* lstat isn't posix */
-
-#ifdef KR_headers
-void g_char();
-
-integer G77_lstat_0 (name, statb, Lname)
- char *name;
- integer statb[13];
- ftnlen Lname;
-#else
-void g_char(const char *a, ftnlen alen, char *b);
-
-integer G77_lstat_0 (const char *name, integer statb[13], const ftnlen Lname)
-#endif
-{
-#if HAVE_LSTAT
- char *buff;
- char *bp, *blast;
- int err;
- struct stat buf;
-
- buff = malloc (Lname+1);
- if (buff == NULL) return -1;
- g_char (name, Lname, buff);
- err = lstat (buff, &buf);
- free (buff);
- statb[0] = buf.st_dev;
- statb[1] = buf.st_ino;
- statb[2] = buf.st_mode;
- statb[3] = buf.st_nlink;
- statb[4] = buf.st_uid;
- statb[5] = buf.st_gid;
-#if HAVE_ST_RDEV
- statb[6] = buf.st_rdev;
-#else
- statb[6] = 0;
-#endif
- statb[7] = buf.st_size;
- statb[8] = buf.st_atime;
- statb[9] = buf.st_mtime;
- statb[10] = buf.st_ctime;
-#if HAVE_ST_BLKSIZE
- statb[11] = buf.st_blksize;
-#else
- statb[11] = -1;
-#endif
-#if HAVE_ST_BLOCKS
- statb[12] = buf.st_blocks;
-#else
- statb[12] = -1;
-#endif
- return err;
-#else /* !HAVE_LSTAT */
- return errno = ENOSYS;
-#endif /* !HAVE_LSTAT */
-}
diff --git a/contrib/libf2c/libU77/ltime_.c b/contrib/libf2c/libU77/ltime_.c
deleted file mode 100644
index d4afa878cea3..000000000000
--- a/contrib/libf2c/libU77/ltime_.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/* Copyright (C) 1995, 2001 Free Software Foundation, Inc.
-This file is part of GNU Fortran libU77 library.
-
-This library is free software; you can redistribute it and/or modify it
-under the terms of the GNU Library General Public License as published
-by the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-GNU Fortran 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 GNU Fortran; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-#include <sys/types.h>
-/* fixme: do we need to use TM_IN_SYS_TIME? */
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <time.h>
-# endif
-#endif
-#include "f2c.h"
-
-#ifdef KR_headers
-/* Subroutine */ int G77_ltime_0 (xstime, tarray)
- integer *xstime, tarray[9];
-#else
-/* Subroutine */ int G77_ltime_0 (const integer * xstime, integer tarray[9])
-#endif
-{
- struct tm *lt;
- time_t stime = *xstime;
- lt = localtime (&stime);
- tarray[0] = lt->tm_sec;
- tarray[1] = lt->tm_min;
- tarray[2] = lt->tm_hour;
- tarray[3] = lt->tm_mday;
- tarray[4] = lt->tm_mon;
- tarray[5] = lt->tm_year;
- tarray[6] = lt->tm_wday;
- tarray[7] = lt->tm_yday;
- tarray[8] = lt->tm_isdst;
- return 0;
-}
diff --git a/contrib/libf2c/libU77/mclock_.c b/contrib/libf2c/libU77/mclock_.c
deleted file mode 100644
index 6b7e81b1e045..000000000000
--- a/contrib/libf2c/libU77/mclock_.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/* Copyright (C) 1996 Free Software Foundation, Inc.
-This file is part of GNU Fortran libU77 library.
-
-This library is free software; you can redistribute it and/or modify it
-under the terms of the GNU Library General Public License as published
-by the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-GNU Fortran 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 GNU Fortran; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <time.h>
-# endif
-#endif
-#include "f2c.h"
-
-/* Reported by wd42ej@sgi83.wwb.noaa.gov (Russ Jones AUTO-Sun3) on AIX. */
-
-#ifdef KR_headers
-longint G77_mclock_0 ()
-#else
-longint G77_mclock_0 (void)
-#endif
-{
-#if HAVE_CLOCK
- return clock ();
-#else
- return -1;
-#endif
-}
diff --git a/contrib/libf2c/libU77/perror_.c b/contrib/libf2c/libU77/perror_.c
deleted file mode 100644
index 26d8582dbccf..000000000000
--- a/contrib/libf2c/libU77/perror_.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/* Copyright (C) 1995 Free Software Foundation, Inc.
-This file is part of GNU Fortran libU77 library.
-
-This library is free software; you can redistribute it and/or modify it
-under the terms of the GNU Library General Public License as published
-by the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-GNU Fortran 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 GNU Fortran; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-#include <stdio.h>
-#include <errno.h>
-#if HAVE_STRING_H
-# include <string.h>
-#else
-# include <strings.h>
-#endif
-#include "f2c.h"
-
-#ifdef KR_headers
-/* Subroutine */ int G77_perror_0 (str, Lstr)
- char *str; ftnlen Lstr;
-#else
-/* Subroutine */ int G77_perror_0 (const char *str, const ftnlen Lstr)
-#endif
-{
- char buff[1000];
- char *bp, *blast;
-
- /* same technique as `system' -- what's wrong with malloc? */
- blast = buff + (Lstr < 1000 ? Lstr : 1000);
- for (bp = buff ; bp<blast && *str!='\0' ; )
- *bp++ = *str++;
- *bp = '\0';
- perror (buff);
- return 0;
-}
diff --git a/contrib/libf2c/libU77/rand_.c b/contrib/libf2c/libU77/rand_.c
deleted file mode 100644
index 165aee1220c9..000000000000
--- a/contrib/libf2c/libU77/rand_.c
+++ /dev/null
@@ -1,54 +0,0 @@
-/* Copyright (C) 1995 Free Software Foundation, Inc.
-This file is part of GNU Fortran libU77 library.
-
-This library is free software; you can redistribute it and/or modify it
-under the terms of the GNU Library General Public License as published
-by the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-GNU Fortran 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 GNU Fortran; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-#if HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
-#include "f2c.h"
-#ifndef RAND_MAX
-# define RAND_MAX 2147483647 /* from SunOS */
-#endif
-
-/* We could presumably do much better than the traditional libc
- version, though at least the glibc one is reasonable, it seems.
- For the sake of the innocent, I'm not sure we should really do
- this... */
-
-/* Note this is per SunOS -- other s may have no arg. */
-
-#ifdef KR_headers
-double G77_rand_0 (flag)
- integer *flag;
-#else
-double G77_rand_0 (integer *flag)
-#endif
-{
- switch (*flag) {
- case 0:
- break;
- case 1:
- srand (0); /* Arbitrary choice of initialiser. */
- break;
- default:
- srand (*flag);
- }
- return (float) rand () / RAND_MAX;
-}
diff --git a/contrib/libf2c/libU77/rename_.c b/contrib/libf2c/libU77/rename_.c
deleted file mode 100644
index 9583001c4218..000000000000
--- a/contrib/libf2c/libU77/rename_.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/* Copyright (C) 1995, 1997 Free Software Foundation, Inc.
-This file is part of GNU Fortran libU77 library.
-
-This library is free software; you can redistribute it and/or modify it
-under the terms of the GNU Library General Public License as published
-by the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-GNU Fortran 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 GNU Fortran; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-#if HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
-#include <stdio.h>
-#include <errno.h>
-#include "f2c.h"
-
-#ifdef KR_headers
-void g_char ();
-
-integer G77_rename_0 (path1, path2, Lpath1, Lpath2)
- char *path1, *path2; ftnlen Lpath1, Lpath2;
-#else
-void g_char(const char *a, ftnlen alen, char *b);
-
-integer G77_rename_0 (const char *path1, const char *path2, const ftnlen Lpath1, const ftnlen Lpath2)
-#endif
-{
- char *buff1, *buff2;
- char *bp, *blast;
- int i;
-
- buff1 = malloc (Lpath1+1);
- if (buff1 == NULL) return -1;
- g_char (path1, Lpath1, buff1);
- buff2 = malloc (Lpath2+1);
- if (buff2 == NULL) return -1;
- g_char (path2, Lpath2, buff2);
- i = rename (buff1, buff2);
- free (buff1); free (buff2);
- return i ? errno : 0;
-}
diff --git a/contrib/libf2c/libU77/secnds_.c b/contrib/libf2c/libU77/secnds_.c
deleted file mode 100644
index 1942528530f2..000000000000
--- a/contrib/libf2c/libU77/secnds_.c
+++ /dev/null
@@ -1,51 +0,0 @@
-/* Copyright (C) 1995 Free Software Foundation, Inc.
-This file is part of GNU Fortran libU77 library.
-
-This library is free software; you can redistribute it and/or modify it
-under the terms of the GNU Library General Public License as published
-by the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-GNU Fortran 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 GNU Fortran; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-#include <stdio.h>
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <time.h>
-# endif
-#endif
-#include <sys/types.h>
-
-#include "f2c.h"
-
-/* This is a VMS intrinsic. */
-
-double G77_secnds_0 (real *r)
-{
- struct tm *lt;
- time_t clock;
- float f;
-
- clock = time (NULL);
- lt = localtime (&clock);
- f= (3600.0*((real)lt->tm_hour) + 60.0*((real)lt->tm_min) +
- (real)lt->tm_sec - *r);
- return f;
-}
-
diff --git a/contrib/libf2c/libU77/second_.c b/contrib/libf2c/libU77/second_.c
deleted file mode 100644
index 41bb5a90a928..000000000000
--- a/contrib/libf2c/libU77/second_.c
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Copyright (C) 1996 Free Software Foundation, Inc.
-This file is part of GNU Fortran libU77 library.
-
-This library is free software; you can redistribute it and/or modify it
-under the terms of the GNU Library General Public License as published
-by the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-GNU Fortran 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 GNU Fortran; 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 "f2c.h"
-
-double G77_second_0 () {
- extern double G77_etime_0 ();
- real tarray[2];
-
- return G77_etime_0 (tarray);
-}
diff --git a/contrib/libf2c/libU77/sleep_.c b/contrib/libf2c/libU77/sleep_.c
deleted file mode 100644
index 36e1b8d9a7b5..000000000000
--- a/contrib/libf2c/libU77/sleep_.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Copyright (C) 1995 Free Software Foundation, Inc.
-This file is part of GNU Fortran libU77 library.
-
-This library is free software; you can redistribute it and/or modify it
-under the terms of the GNU Library General Public License as published
-by the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-GNU Fortran 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 GNU Fortran; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-#include "f2c.h"
-
-/* Subroutine */
-#ifdef KR_headers
-int G77_sleep_0 (seconds)
- integer *seconds;
-#else
-int G77_sleep_0 (const integer *seconds)
-#endif
-{
- (void) sleep ((unsigned int) *seconds);
- return 0;
-}
diff --git a/contrib/libf2c/libU77/srand_.c b/contrib/libf2c/libU77/srand_.c
deleted file mode 100644
index 8edc62e4fe03..000000000000
--- a/contrib/libf2c/libU77/srand_.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Copyright (C) 1995 Free Software Foundation, Inc.
-This file is part of GNU Fortran libU77 library.
-
-This library is free software; you can redistribute it and/or modify it
-under the terms of the GNU Library General Public License as published
-by the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-GNU Fortran 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 GNU Fortran; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-#if STDC_HEADERS
-# include <stdlib.h>
-#endif
-#include "f2c.h"
-
-/* Subroutine */
-#ifdef KR_headers
-int G77_srand_0 (seed)
- integer *seed;
-#else
-int G77_srand_0 (const integer *seed)
-#endif
-{
- srand ((unsigned int) *seed);
- return 0;
-}
diff --git a/contrib/libf2c/libU77/stamp-h.in b/contrib/libf2c/libU77/stamp-h.in
deleted file mode 100644
index 9788f70238c9..000000000000
--- a/contrib/libf2c/libU77/stamp-h.in
+++ /dev/null
@@ -1 +0,0 @@
-timestamp
diff --git a/contrib/libf2c/libU77/stat_.c b/contrib/libf2c/libU77/stat_.c
deleted file mode 100644
index b24f38922212..000000000000
--- a/contrib/libf2c/libU77/stat_.c
+++ /dev/null
@@ -1,79 +0,0 @@
-/* Copyright (C) 1995, 1997 Free Software Foundation, Inc.
-This file is part of GNU Fortran libU77 library.
-
-This library is free software; you can redistribute it and/or modify it
-under the terms of the GNU Library General Public License as published
-by the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-GNU Fortran 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 GNU Fortran; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-#include <stdio.h>
-#if HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
-#include <sys/types.h>
-#include <sys/stat.h>
-#include "f2c.h"
-
-#ifdef KR_headers
-void g_char ();
-
-integer G77_stat_0 (name, statb, Lname)
- char *name;
- integer statb[13];
- ftnlen Lname;
-#else
-void g_char(const char *a, ftnlen alen, char *b);
-
-integer G77_stat_0 (const char *name, integer statb[13], const ftnlen Lname)
-#endif
-{
- char *buff;
- char *bp, *blast;
- int err;
- struct stat buf;
-
- buff = malloc (Lname+1);
- if (buff == NULL) return -1;
- g_char (name, Lname, buff);
- err = stat (buff, &buf);
- free (buff);
- statb[0] = buf.st_dev;
- statb[1] = buf.st_ino;
- statb[2] = buf.st_mode;
- statb[3] = buf.st_nlink;
- statb[4] = buf.st_uid;
- statb[5] = buf.st_gid;
-#if HAVE_ST_RDEV
- statb[6] = buf.st_rdev; /* not posix */
-#else
- statb[6] = 0;
-#endif
- statb[7] = buf.st_size;
- statb[8] = buf.st_atime;
- statb[9] = buf.st_mtime;
- statb[10] = buf.st_ctime;
-#if HAVE_ST_BLKSIZE
- statb[11] = buf.st_blksize; /* not posix */
-#else
- statb[11] = -1;
-#endif
-#if HAVE_ST_BLOCKS
- statb[12] = buf.st_blocks; /* not posix */
-#else
- statb[12] = -1;
-#endif
- return err;
-}
diff --git a/contrib/libf2c/libU77/symlnk_.c b/contrib/libf2c/libU77/symlnk_.c
deleted file mode 100644
index 4b0bf24541d2..000000000000
--- a/contrib/libf2c/libU77/symlnk_.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/* Copyright (C) 1995, 1997 Free Software Foundation, Inc.
-This file is part of GNU Fortran.
-
-GNU Fortran 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.
-
-GNU Fortran 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 GNU Fortran; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-#if HAVE_STDLIB_H
-# include <stdlib.h>
-#else
-# include <stdio.h>
-#endif
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-#include <errno.h>
-#if HAVE_SYS_PARAM_H
-# include <sys/param.h>
-#endif
-#include "f2c.h"
-
-#ifdef KR_headers
-void g_char ();
-
-integer G77_symlnk_0 (path1, path2, Lpath1, Lpath2)
- char *path1, *path2; ftnlen Lpath1, Lpath2;
-#else
-void g_char(const char *a, ftnlen alen, char *b);
-
-integer G77_symlnk_0 (const char *path1, const char *path2, const ftnlen Lpath1, const ftnlen Lpath2)
-#endif
-{
-#if HAVE_SYMLINK
- char *buff1, *buff2;
- char *bp, *blast;
- int i;
-
- buff1 = (char *) malloc (Lpath1+1);
- if (buff1 == NULL) return -1;
- g_char (path1, Lpath1, buff1);
- buff2 = (char *) malloc (Lpath2+1);
- if (buff2 == NULL) return -1;
- g_char (path2, Lpath2, buff2);
- i = symlink (buff1, buff2);
- free (buff1); free (buff2);
- return i ? errno : 0;
-#else /* !HAVE_SYMLINK */
- return errno = ENOSYS;
-#endif /* !HAVE_SYMLINK */
-}
diff --git a/contrib/libf2c/libU77/sys_clock_.c b/contrib/libf2c/libU77/sys_clock_.c
deleted file mode 100644
index 86ee2fdefd5a..000000000000
--- a/contrib/libf2c/libU77/sys_clock_.c
+++ /dev/null
@@ -1,81 +0,0 @@
-/* Copyright (C) 1996, 1998, 2001 Free Software Foundation, Inc.
-This file is part of GNU Fortran libU77 library.
-
-This library is free software; you can redistribute it and/or modify it
-under the terms of the GNU Library General Public License as published
-by the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-GNU Fortran 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 GNU Fortran; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-#include <sys/types.h>
-#if HAVE_SYS_PARAM_H
-# include <sys/param.h>
-#endif
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <time.h>
-# endif
-#endif
-#if HAVE_SYS_TIMES_H
-# include <sys/times.h>
-#endif
-#include <limits.h>
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-#include <errno.h> /* for ENOSYS */
-#include "f2c.h"
-
-#ifdef KR_headers
-int G77_system_clock_0 (count, count_rate, count_max)
- integer *count, *count_rate, *count_max;
-#else
-int G77_system_clock_0 (integer *count, integer *count_rate, integer *count_max)
-#endif
-{
-#if defined (HAVE_TIMES)
- struct tms buffer;
- unsigned long cnt;
- if (count_rate) {
-#ifdef _SC_CLK_TCK
- *count_rate = sysconf(_SC_CLK_TCK);
-#elif defined CLOCKS_PER_SECOND
- *count_rate = CLOCKS_PER_SECOND;
-#elif defined CLK_TCK
- *count_rate = CLK_TCK;
-#elif defined HZ
- *count_rate = HZ;
-#else
-#error Dont know clock tick length
-#endif
- }
- if (count_max) /* optional arg present? */
- *count_max = INT_MAX; /* dubious */
- cnt = times (&buffer);
- if (cnt > (unsigned long) (INT_MAX))
- *count = INT_MAX; /* also dubious */
- else
- *count = cnt;
- return 0;
-#else /* ! HAVE_TIMES */
- errno = ENOSYS;
- return -1;
-#endif /* ! HAVE_TIMES */
-}
diff --git a/contrib/libf2c/libU77/time_.c b/contrib/libf2c/libU77/time_.c
deleted file mode 100644
index 73894b0b4136..000000000000
--- a/contrib/libf2c/libU77/time_.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/* Copyright (C) 1995 Free Software Foundation, Inc.
-This file is part of GNU Fortran libU77 library.
-
-This library is free software; you can redistribute it and/or modify it
-under the terms of the GNU Library General Public License as published
-by the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-GNU Fortran 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 GNU Fortran; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-#include <stdio.h>
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <time.h>
-# endif
-#endif
-#include "f2c.h"
-
-/* As well as this external function some compilers have an intrinsic
- subroutine which fills a character argument (which is the VMS way)
- -- caveat emptor. */
-#ifdef KR_headers
-longint G77_time_0 ()
-#else
-longint G77_time_0 (void)
-#endif
-{
- /* There are potential problems with the cast of the time_t here. */
- return time (NULL);
-}
diff --git a/contrib/libf2c/libU77/ttynam_.c b/contrib/libf2c/libU77/ttynam_.c
deleted file mode 100644
index c7610fb0c872..000000000000
--- a/contrib/libf2c/libU77/ttynam_.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/* Copyright (C) 1995, 1996 Free Software Foundation, Inc.
-This file is part of GNU Fortran libU77 library.
-
-This library is free software; you can redistribute it and/or modify it
-under the terms of the GNU Library General Public License as published
-by the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-GNU Fortran 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 GNU Fortran; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-#include <sys/types.h>
-#if STDC_HEADERS
-# include <stdlib.h>
-#endif
-#if HAVE_UNISTD_H
-# include <unistd.h> /* POSIX for ttyname */
-#endif
-#include <stdio.h>
-#if HAVE_STRING_H
-# include <string.h>
-#else
-# include <strings.h>
-#endif
-#include <errno.h> /* for ENOSYS */
-#include "f2c.h"
-
-#ifdef KR_headers
-extern void s_copy ();
-extern integer G77_fnum_0 ();
-/* Character */ void G77_ttynam_0 (ret_val, ret_val_len, lunit)
- char *ret_val; ftnlen ret_val_len; integer *lunit
-#else
-extern integer G77_fnum_0 (integer *lunit);
-extern void s_copy(register char *a, register char *b, ftnlen la, ftnlen lb);
-/* Character */ void G77_ttynam_0 (char *ret_val, ftnlen ret_val_len, integer *lunit)
-#endif
-{
-#if defined (HAVE_TTYNAME)
- size_t i;
- char *p;
-
- p = ttyname (G77_fnum_0 (lunit));
- if (p != NULL) {
- i = strlen (p);
- s_copy (ret_val, p, ret_val_len, i);
- } else {
- s_copy (ret_val, " ", ret_val_len, 1);
- }
-#else
- errno = ENOSYS;
- s_copy (ret_val, " ", ret_val_len, 1);
-#endif
-}
diff --git a/contrib/libf2c/libU77/u77-test.f b/contrib/libf2c/libU77/u77-test.f
deleted file mode 100644
index 3c8151c533df..000000000000
--- a/contrib/libf2c/libU77/u77-test.f
+++ /dev/null
@@ -1,415 +0,0 @@
-*** Some random stuff for testing libU77. Should be done better. It's
-* hard to test things where you can't guarantee the result. Have a
-* good squint at what it prints, though detected errors will cause
-* starred messages.
-*
-* Currently not tested:
-* ALARM
-* CHDIR (func)
-* CHMOD (func)
-* FGET (func/subr)
-* FGETC (func)
-* FPUT (func/subr)
-* FPUTC (func)
-* FSTAT (subr)
-* GETCWD (subr)
-* HOSTNM (subr)
-* IRAND
-* KILL
-* LINK (func)
-* LSTAT (subr)
-* RENAME (func/subr)
-* SIGNAL (subr)
-* SRAND
-* STAT (subr)
-* SYMLNK (func/subr)
-* UMASK (func)
-* UNLINK (func)
-*
-* NOTE! This is the libU77 version, so it should be a bit more
-* "interactive" than the testsuite version, which is in
-* gcc/testsuite/g77.f-torture/execute/u77-test.f.
-* This version purposely exits with a "failure" status, to test
-* returning of non-zero status, and it doesn't call the ABORT
-* intrinsic (it substitutes an EXTERNAL stub, so the code can be
-* kept nearly the same in both copies). Also, it goes ahead and
-* tests the HOSTNM intrinsic. Please keep the other copy up-to-date when
-* you modify this one.
-
- implicit none
-
-* external hostnm
- intrinsic hostnm
- integer hostnm
-
- integer i, j, k, ltarray (9), idat (3), count, rate, count_max,
- + pid, mask
- real tarray1(2), tarray2(2), r1, r2
- double precision d1
- integer(kind=2) bigi
- logical issum
- intrinsic getpid, getuid, getgid, ierrno, gerror, time8,
- + fnum, isatty, getarg, access, unlink, fstat, iargc,
- + stat, lstat, getcwd, gmtime, etime, chmod, itime, date,
- + chdir, fgetc, fputc, system_clock, second, idate, secnds,
- + time, ctime, fdate, ttynam, date_and_time, mclock, mclock8,
- + cpu_time, dtime, ftell, abort
- external lenstr, ctrlc
- integer lenstr
- logical l
- character gerr*80, c*1
- character ctim*25, line*80, lognam*20, wd*1000, line2*80,
- + ddate*8, ttime*10, zone*5, ctim2*25
- integer fstatb (13), statb (13)
- integer *2 i2zero
- integer values(8)
- integer(kind=7) sigret
-
- i = time ()
- ctim = ctime (i)
- WRITE (6,'(A/)') '1 GNU libU77 test at: ' // ctim(:lenstr (ctim))
- write (6,'(A,I3,'', '',I3)')
- + ' Logical units 5 and 6 correspond (FNUM) to'
- + // ' Unix i/o units ', fnum(5), fnum(6)
- if (lnblnk('foo ').ne.3 .or. len_trim('foo ').ne.3) then
- print *, 'LNBLNK or LEN_TRIM failed'
- call abort
- end if
-
- bigi = time8 ()
-
- call ctime (i, ctim2)
- if (ctim .ne. ctim2) then
- write (6, *) '*** CALL CTIME disagrees with CTIME(): ',
- + ctim2(:lenstr (ctim2)), ' vs. ', ctim(:lenstr (ctim))
- call doabort
- end if
-
- j = time ()
- if (i .gt. bigi .or. bigi .gt. j) then
- write (6, *) '*** TIME/TIME8/TIME sequence failures: ',
- + i, bigi, j
- call doabort
- end if
-
- print *, 'Command-line arguments: ', iargc ()
- do i = 0, iargc ()
- call getarg (i, line)
- print *, 'Arg ', i, ' is: ', line(:lenstr (line))
- end do
-
- l= isatty(6)
- line2 = ttynam(6)
- if (l) then
- line = 'and 6 is a tty device (ISATTY) named '//line2
- else
- line = 'and 6 isn''t a tty device (ISATTY)'
- end if
- write (6,'(1X,A)') line(:lenstr(line))
- call ttynam (6, line)
- if (line .ne. line2) then
- print *, '*** CALL TTYNAM disagrees with TTYNAM: ',
- + line(:lenstr (line))
- call doabort
- end if
-
-* regression test for compiler crash fixed by JCB 1998-08-04 com.c
- sigret = signal(2, ctrlc)
-
- pid = getpid()
- WRITE (6,'(A,I10)') ' Process id (GETPID): ', pid
- WRITE (6,'(A,I10)') ' User id (GETUID): ', GETUID ()
- WRITE (6,'(A,I10)') ' Group id (GETGID): ', GETGID ()
- WRITE (6, *) 'If you have the `id'' program, the following call'
- write (6, *) 'of SYSTEM should agree with the above:'
- call flush(6)
- CALL SYSTEM ('echo " " `id`')
- call flush
-
- lognam = 'blahblahblah'
- call getlog (lognam)
- write (6,*) 'Login name (GETLOG): ', lognam(:lenstr (lognam))
-
- wd = 'blahblahblah'
- call getenv ('LOGNAME', wd)
- write (6,*) 'Login name (GETENV of LOGNAME): ', wd(:lenstr (wd))
-
- call umask(0, mask)
- write(6,*) 'UMASK returns', mask
- call umask(mask)
-
- ctim = fdate()
- write (6,*) 'FDATE returns: ', ctim(:lenstr (ctim))
- call fdate (ctim)
- write (6,*) 'CALL FDATE returns: ', ctim(:lenstr (ctim))
-
- j=time()
- call ltime (j, ltarray)
- write (6,'(1x,a,9i4)') 'LTIME returns:', ltarray
- call gmtime (j, ltarray)
- write (6,'(1x,a,9i4)') 'GMTIME returns:', ltarray
-
- call system_clock(count) ! omitting optional args
- call system_clock(count, rate, count_max)
- write(6,*) 'SYSTEM_CLOCK returns: ', count, rate, count_max
-
- call date_and_time(ddate) ! omitting optional args
- call date_and_time(ddate, ttime, zone, values)
- write(6, *) 'DATE_AND_TIME returns: ', ddate, ' ', ttime, ' ',
- + zone, ' ', values
-
- write (6,*) 'Sleeping for 1 second (SLEEP) ...'
- call sleep (1)
-
-c consistency-check etime vs. dtime for first call
- r1 = etime (tarray1)
- r2 = dtime (tarray2)
- if (abs (r1-r2).gt.1.0) then
- write (6,*)
- + 'Results of ETIME and DTIME differ by more than a second:',
- + r1, r2
- call doabort
- end if
- if (.not. issum (r1, tarray1(1), tarray1(2))) then
- write (6,*) '*** ETIME didn''t return sum of the array: ',
- + r1, ' /= ', tarray1(1), '+', tarray1(2)
- call doabort
- end if
- if (.not. issum (r2, tarray2(1), tarray2(2))) then
- write (6,*) '*** DTIME didn''t return sum of the array: ',
- + r2, ' /= ', tarray2(1), '+', tarray2(2)
- call doabort
- end if
- write (6, '(A,3F10.3)')
- + ' Elapsed total, user, system time (ETIME): ',
- + r1, tarray1
-
-c now try to get times to change enough to see in etime/dtime
- write (6,*) 'Looping until clock ticks at least once...'
- do i = 1,1000
- do j = 1,1000
- end do
- call dtime (tarray2, r2)
- if (tarray2(1) .ne. 0. .or. tarray2(2) .ne. 0.) exit
- end do
- call etime (tarray1, r1)
- if (.not. issum (r1, tarray1(1), tarray1(2))) then
- write (6,*) '*** ETIME didn''t return sum of the array: ',
- + r1, ' /= ', tarray1(1), '+', tarray1(2)
- call doabort
- end if
- if (.not. issum (r2, tarray2(1), tarray2(2))) then
- write (6,*) '*** DTIME didn''t return sum of the array: ',
- + r2, ' /= ', tarray2(1), '+', tarray2(2)
- call doabort
- end if
- write (6, '(A,3F10.3)')
- + ' Differences in total, user, system time (DTIME): ',
- + r2, tarray2
- write (6, '(A,3F10.3)')
- + ' Elapsed total, user, system time (ETIME): ',
- + r1, tarray1
- write (6, *) '(Clock-tick detected after ', i, ' 1K loops.)'
-
- call idate (i,j,k)
- call idate (idat)
- write (6,*) 'IDATE (date,month,year): ',idat
- print *, '... and the VXT version (month,date,year): ', i,j,k
- if (i/=idat(2) .or. j/=idat(1) .or. k/=mod(idat(3),100)) then
- print *, '*** VXT and U77 versions don''t agree'
- call doabort
- end if
-
- call date (ctim)
- write (6,*) 'DATE (dd-mmm-yy): ', ctim(:lenstr (ctim))
-
- call itime (idat)
- write (6,*) 'ITIME (hour,minutes,seconds): ', idat
-
- call time(line(:8))
- print *, 'TIME: ', line(:8)
-
- write (6,*) 'SECNDS(0.0) returns: ',secnds(0.0)
-
- write (6,*) 'SECOND returns: ', second()
- call dumdum(r1)
- call second(r1)
- write (6,*) 'CALL SECOND returns: ', r1
-
-* compiler crash fixed by 1998-10-01 com.c change
- if (rand(0).lt.0.0 .or. rand(0).gt.1.0) then
- write (6,*) '*** rand(0) error'
- call doabort()
- end if
-
- i = getcwd(wd)
- if (i.ne.0) then
- call perror ('*** getcwd')
- call doabort
- else
- write (6,*) 'Current directory is "'//wd(:lenstr(wd))//'"'
- end if
- call chdir ('.',i)
- if (i.ne.0) then
- write (6,*) '***CHDIR to ".": ', i
- call doabort
- end if
-
- i=hostnm(wd)
- if(i.ne.0) then
- call perror ('*** hostnm')
- call doabort
- else
- write (6,*) 'Host name is ', wd(:lenstr(wd))
- end if
-
- i = access('/dev/null ', 'rw')
- if (i.ne.0) write (6,*) '***Read/write ACCESS to /dev/null: ', i
- write (6,*) 'Creating file "foo" for testing...'
- open (3,file='foo',status='UNKNOWN')
- rewind 3
- call fputc(3, 'c',i)
- call fputc(3, 'd',j)
- if (i+j.ne.0) write(6,*) '***FPUTC: ', i
-C why is it necessary to reopen? (who wrote this?)
-C the better to test with, my dear! (-- burley)
- close(3)
- open(3,file='foo',status='old')
- call fseek(3,0,0,*10)
- go to 20
- 10 write(6,*) '***FSEEK failed'
- call doabort
- 20 call fgetc(3, c,i)
- if (i.ne.0) then
- write(6,*) '***FGETC: ', i
- call doabort
- end if
- if (c.ne.'c') then
- write(6,*) '***FGETC read the wrong thing: ', ichar(c)
- call doabort
- end if
- i= ftell(3)
- if (i.ne.1) then
- write(6,*) '***FTELL offset: ', i
- call doabort
- end if
- call ftell(3, i)
- if (i.ne.1) then
- write(6,*) '***CALL FTELL offset: ', i
- call doabort
- end if
- call chmod ('foo', 'a+w',i)
- if (i.ne.0) then
- write (6,*) '***CHMOD of "foo": ', i
- call doabort
- end if
- i = fstat (3, fstatb)
- if (i.ne.0) then
- write (6,*) '***FSTAT of "foo": ', i
- call doabort
- end if
- i = stat ('foo', statb)
- if (i.ne.0) then
- write (6,*) '***STAT of "foo": ', i
- call doabort
- end if
- write (6,*) ' with stat array ', statb
- if (statb(6) .ne. getgid ()) then
- write (6,*) 'Note: FSTAT gid wrong (happens on some systems).'
- end if
- if (statb(5) .ne. getuid () .or. statb(4) .ne. 1) then
- write (6,*) '*** FSTAT uid or nlink is wrong'
- call doabort
- end if
- do i=1,13
- if (fstatb (i) .ne. statb (i)) then
- write (6,*) '*** FSTAT and STAT don''t agree on '// '
- + array element ', i, ' value ', fstatb (i), statb (i)
- call doabort
- end if
- end do
- i = lstat ('foo', fstatb)
- do i=1,13
- if (fstatb (i) .ne. statb (i)) then
- write (6,*) '*** LSTAT and STAT don''t agree on '//
- + 'array element ', i, ' value ', fstatb (i), statb (i)
- call doabort
- end if
- end do
-
-C in case it exists already:
- call unlink ('bar',i)
- call link ('foo ', 'bar ',i)
- if (i.ne.0) then
- write (6,*) '***LINK "foo" to "bar" failed: ', i
- call doabort
- end if
- call unlink ('foo',i)
- if (i.ne.0) then
- write (6,*) '***UNLINK "foo" failed: ', i
- call doabort
- end if
- call unlink ('foo',i)
- if (i.eq.0) then
- write (6,*) '***UNLINK "foo" again: ', i
- call doabort
- end if
-
- call gerror (gerr)
- i = ierrno()
- write (6,'(A,I3,A/1X,A)') ' The current error number is: ',
- + i,
- + ' and the corresponding message is:', gerr(:lenstr(gerr))
- write (6,*) 'This is sent to stderr prefixed by the program name'
- call getarg (0, line)
- call perror (line (:lenstr (line)))
- call unlink ('bar')
-
- print *, 'MCLOCK returns ', mclock ()
- print *, 'MCLOCK8 returns ', mclock8 ()
-
- call cpu_time (d1)
- print *, 'CPU_TIME returns ', d1
-
- WRITE (6,*) 'You should see exit status 1'
- CALL EXIT(1)
- 99 END
-
-* Return length of STR not including trailing blanks, but always > 0.
- integer function lenstr (str)
- character*(*) str
- if (str.eq.' ') then
- lenstr=1
- else
- lenstr = lnblnk (str)
- end if
- end
-
-* Just make sure SECOND() doesn't "magically" work the second time.
- subroutine dumdum(r)
- r = 3.14159
- end
-
-* Test whether sum is approximately left+right.
- logical function issum (sum, left, right)
- implicit none
- real sum, left, right
- real mysum, delta, width
- mysum = left + right
- delta = abs (mysum - sum)
- width = abs (left) + abs (right)
- issum = (delta .le. .0001 * width)
- end
-
-* Signal handler
- subroutine ctrlc
- print *, 'Got ^C'
- call doabort
- end
-
-* A problem has been noticed, so maybe abort the test.
- subroutine doabort
-* For this version, print out all problems noticed.
-* intrinsic abort
-* call abort
- end
diff --git a/contrib/libf2c/libU77/umask_.c b/contrib/libf2c/libU77/umask_.c
deleted file mode 100644
index 203acfa916f2..000000000000
--- a/contrib/libf2c/libU77/umask_.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Copyright (C) 1996 Free Software Foundation, Inc.
-This file is part of GNU Fortran libU77 library.
-
-This library is free software; you can redistribute it and/or modify it
-under the terms of the GNU Library General Public License as published
-by the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-GNU Fortran 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 GNU Fortran; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-#include <sys/types.h>
-#include <sys/stat.h>
-#include "f2c.h"
-
-#ifdef KR_headers
-integer G77_umask_0 (mask)
- integer *mask;
-#else
-integer G77_umask_0 (integer *mask)
-#endif
-{
- return umask ((mode_t) *mask);
-}
diff --git a/contrib/libf2c/libU77/unlink_.c b/contrib/libf2c/libU77/unlink_.c
deleted file mode 100644
index cd00559b29ac..000000000000
--- a/contrib/libf2c/libU77/unlink_.c
+++ /dev/null
@@ -1,57 +0,0 @@
-/* Copyright (C) 1995, 1997 Free Software Foundation, Inc.
-This file is part of GNU Fortran libU77 library.
-
-This library is free software; you can redistribute it and/or modify it
-under the terms of the GNU Library General Public License as published
-by the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-GNU Fortran 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 GNU Fortran; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-#if HAVE_STDLIB_H
-# include <stdlib.h>
-#else
-# include <stdio.h>
-#endif
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-#include <errno.h>
-#if HAVE_SYS_PARAM_H
-# include <sys/param.h>
-#endif
-#include "f2c.h"
-
-#ifdef KR_headers
-void g_char ();
-
-integer G77_unlink_0 (str, Lstr)
- char *str; ftnlen Lstr;
-#else
-void g_char(const char *a, ftnlen alen, char *b);
-
-integer G77_unlink_0 (const char *str, const ftnlen Lstr)
-#endif
-{
- char *buff;
- char *bp, *blast;
- int i;
-
- buff = malloc (Lstr+1);
- if (buff == NULL) return -1;
- g_char (str, Lstr, buff);
- i = unlink (buff);
- free (buff);
- return i ? errno : 0; /* SGI version returns -1 on failure. */
-}
diff --git a/contrib/libf2c/libU77/vxtidate_.c b/contrib/libf2c/libU77/vxtidate_.c
deleted file mode 100644
index d5f289c7064b..000000000000
--- a/contrib/libf2c/libU77/vxtidate_.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/* Copyright (C) 1995, 1996, 2001 Free Software Foundation, Inc.
-This file is part of GNU Fortran libU77 library.
-
-This library is free software; you can redistribute it and/or modify it
-under the terms of the GNU Library General Public License as published
-by the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-GNU Fortran 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 GNU Fortran; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-#include <stdio.h>
-#include <sys/types.h>
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <time.h>
-# endif
-#endif
-#include "f2c.h"
-
-/* VMS and Irix versions (at least) differ from libU77 elsewhere */
-
-/* VMS style: */
-
-/* Subroutine */
-#ifdef KR_headers
-int G77_vxtidate_y2kbug_0 (m, d, y)
- integer *y, *m, *d;
-#else
-int G77_vxtidate_y2kbug_0 (integer *m, integer *d, integer *y)
-#endif
-{
- struct tm *lt;
- time_t tim;
- tim = time(NULL);
- lt = localtime(&tim);
- *y = lt->tm_year % 100;
- *m = lt->tm_mon+1;
- *d = lt->tm_mday;
- return 0;
-}
diff --git a/contrib/libf2c/libU77/vxttime_.c b/contrib/libf2c/libU77/vxttime_.c
deleted file mode 100644
index e45cc05d0551..000000000000
--- a/contrib/libf2c/libU77/vxttime_.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/* Copyright (C) 1995, 2001 Free Software Foundation, Inc.
-This file is part of GNU Fortran libU77 library.
-
-This library is free software; you can redistribute it and/or modify it
-under the terms of the GNU Library General Public License as published
-by the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-GNU Fortran 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 GNU Fortran; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-#include <stdio.h>
-#include <sys/types.h>
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <time.h>
-# endif
-#endif
-#if HAVE_STRING_H
-# include <string.h>
-#else
-# include <strings.h>
-#endif
-#include "f2c.h"
-
-/* Subroutine */
-#ifdef KR_headers
-void G77_vxttime_0 (chtime, Lchtime)
- char chtime[8];
- ftnlen Lchtime;
-#else
-void G77_vxttime_0 (char chtime[8], const ftnlen Lchtime)
-#endif
-{
- time_t tim;
- char *ctim;
- tim = time(NULL);
- ctim = ctime (&tim);
- strncpy (chtime, ctim+11, 8);
-}
diff --git a/contrib/libf2c/permission.netlib b/contrib/libf2c/permission.netlib
deleted file mode 100644
index 261b719bc57e..000000000000
--- a/contrib/libf2c/permission.netlib
+++ /dev/null
@@ -1,23 +0,0 @@
-/****************************************************************
-Copyright 1990 - 1997 by AT&T, Lucent Technologies and Bellcore.
-
-Permission to use, copy, modify, and distribute this software
-and its documentation for any purpose and without fee is hereby
-granted, provided that the above copyright notice appear in all
-copies and that both that the copyright notice and this
-permission notice and warranty disclaimer appear in supporting
-documentation, and that the names of AT&T, Bell Laboratories,
-Lucent or Bellcore or any of their entities not be used in
-advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-AT&T, Lucent and Bellcore disclaim all warranties with regard to
-this software, including all implied warranties of
-merchantability and fitness. In no event shall AT&T, Lucent or
-Bellcore be liable for any special, indirect or consequential
-damages or any damages whatsoever resulting from loss of use,
-data or profits, whether in an action of contract, negligence or
-other tortious action, arising out of or in connection with the
-use or performance of this software.
-****************************************************************/
-
diff --git a/contrib/libf2c/readme.netlib b/contrib/libf2c/readme.netlib
deleted file mode 100644
index 1ec98865e5b3..000000000000
--- a/contrib/libf2c/readme.netlib
+++ /dev/null
@@ -1,791 +0,0 @@
-
-====== old index for f2c, now "readme from f2c" ============
-
-FILES:
-
-f2c.h Include file necessary for compiling output of the converter.
- See the second NOTE below.
-
-f2c.1 Man page for f2c.
-
-f2c.1t Source for f2c.1 (to be processed by troff -man or nroff -man).
-
-libf77 Library of non I/O support routines the generated C may need.
- Fortran main programs result in a C function named MAIN__ that
- is meant to be invoked by the main() in libf77.
-
-libi77 Library of Fortran I/O routines the generated C may need.
- Note that some vendors (e.g., BSD, Sun and MIPS) provide a
- libF77 and libI77 that are incompatible with f2c -- they
- provide some differently named routines or routines with the
- names that f2c expects, but with different calling sequences.
- On such systems, the recommended procedure is to merge
- libf77 and libi77 into a single library, say libf2c, and to
- install it where you can access it by specifying -lf2c . The
- definition of link_msg in sysdep.c assumes this arrangement.
-
- Both libf77 and libi77 are bundles, meant to be unpacked by the
- Bourne (or Korn) shell. MS-DOS users can use the MKS Toolkit
- to unpack libf77 and libi77.
-
-libf2c.zip
- Only available by ftp: combination of libf77 and libi77, with
- Unix and PC makefiles.
-
-f2c.ps Postscript for a technical report on f2c. After you strip the
- mail header, the first line should be "%!PS".
-
-fixes The complete change log, reporting bug fixes and other changes.
- (Some recent change-log entries are given below).
-
-fc A shell script that uses f2c and imitates much of the behavior
- of commonly found f77 commands. You will almost certainly
- need to adjust some of the shell-variable assignments to make
- this script work on your system.
-
-
-SUBDIRECTORY:
-
-f2c/src Source for the converter itself, including a file of checksums
- and source for a program to compute the checksums (to verify
- correct transmission of the source), is available: ask netlib
- (e.g., netlib@netlib.bell-labs.com) to
- send all from f2c/src
- If the checksums show damage to just a few source files, or if
- the change log file (see "fixes" below) reports corrections to
- some source files, you can request those files individually
- "from f2c/src". For example, to get defs.h and xsum0.out, you
- would ask netlib to
- send defs.h xsum0.out from f2c/src
- "all from f2c/src" is about 640 kilobytes long; for convenience
- (and checksums), it includes copies of f2c.h, f2c.1, and f2c.1t.
-
- Tip: if asked to send over 99,000 bytes in one request, netlib
- breaks the shipment into 1000 line pieces and sends each piece
- separately (since otherwise some mailers might gag). To avoid
- the hassle of reassembling the pieces, try to keep each request
- under 99,000 bytes long. The final number in each line of
- xsum0.out gives the length of each file in f2c/src. For
- example,
- send exec.c expr.c from f2c/src
- send format.c format_data.c from f2c/src
- will give you slightly less hassle than
- send exec.c expr.c format.c format_data.c from f2c/src
- Alternatively, if all the mailers in your return path allow
- long messages, you can supply an appropriate mailsize line in
- your netlib request, e.g.
- mailsize 200k
- send exec.c expr.c format.c format_data.c from f2c/src
-
- The makefile used to generate gram.c; now we distribute a
- working gram.c, and you must say
- make gram1.c
- mv gram1.c gram.c
- if you want to generate your own gram.c -- there are just too
- many broken variants of yacc floating around nowadays for
- generation of gram.c to be the default.
-
-NOTE: You may exercise f2c by sending netlib@netlib.bell-labs.com
- a message whose first line is "execute f2c" and whose remaining
- lines are the Fortran 77 source that you wish to have converted.
- Return mail brings you the resulting C, with f2c's error
- messages between #ifdef uNdEfInEd and #endif at the end.
- (To understand line numbers in the error messages, regard
- the "execute f2c" line as line 0. It is stripped away by
- the netlib software before f2c sees your Fortran input.)
- Options described in the man page may be transmitted to
- netlib by having the first line of input be a comment
- whose first 6 characters are "c$f2c " and whose remaining
- characters are the desired options, e.g., "c$f2c -R -u".
-
- You may say "execute f2c" in the Subject line instead of (but
- *not* in addition to) in the first line of the message body.
-
- The incoming Fortran is saved, at least for a while. Don't
- send any secrets!
-
-
-BUGS: Please send bug reports (including the shortest example
- you can find that illustrates the bug) to research!dmg
- or dmg@bell-labs.com . You might first check whether
- the bug goes away when you turn optimization off.
-
-
-NOTE: f2c.h defines several types, e.g., real, integer, doublereal.
- The definitions in f2c.h are suitable for most machines, but if
- your machine has sizeof(double) > 2*sizeof(long), you may need
- to adjust f2c.h appropriately. f2c assumes
- sizeof(doublecomplex) = 2*sizeof(doublereal)
- sizeof(doublereal) = sizeof(complex)
- sizeof(doublereal) = 2*sizeof(real)
- sizeof(real) = sizeof(integer)
- sizeof(real) = sizeof(logical)
- sizeof(real) = 2*sizeof(shortint)
- EQUIVALENCEs may not be translated correctly if these
- assumptions are violated.
-
- On machines, such as those using a DEC Alpha processor, on
- which sizeof(short) == 2, sizeof(int) == sizeof(float) == 4,
- and sizeof(long) == sizeof(double) == 8, it suffices to
- modify f2c.h by removing the first occurrence of "long "
- on each line containing "long ", e.g., by issuing the
- commands
- mv f2c.h f2c.h0
- sed 's/long //' f2c.h0 >f2c.h
- On such machines, one can enable INTEGER*8 by uncommenting
- the typedef of longint in f2c.h, so it reads
- typedef long longint;
- by compiling libI77 with -DAllow_TYQUAD, and by adjusting
- libF77/makefile as described in libF77/README.
-
- Some machines may have sizeof(int) == 4, sizeof(float) == 8,
- and sizeof(long long) == 8. On such machines, adjust f2c.h
- by changing "long int " to "long long ", e.g., by saying
- mv f2c.h f2c.h0
- sed 's/long int /long long /' f2c.h0 >f2c.h
- One can enable INTEGER*8 on such machines as described
- above, but with
- typedef long long longint;
-
- There exists a C compiler that objects to the lines
- typedef VOID C_f; /* complex function */
- typedef VOID H_f; /* character function */
- typedef VOID Z_f; /* double complex function */
- in f2c.h . If yours is such a compiler, do two things:
- 1. Complain to your vendor about this compiler bug.
- 2. Find the line
- #define VOID void
- in f2c.h and change it to
- #define VOID int
- (For readability, the f2c.h lines shown above have had two
- tabs inserted before their first character.)
-
-FTP: All the material described above is now available by anonymous
- ftp from netlib.bell-labs.com (login: anonymous; Password: your
- E-mail address; cd netlib/f2c). Note that you can say, e.g.,
-
- cd /netlib/f2c/src
- binary
- prompt
- mget *.gz
-
- to get all the .gz files in src. You must uncompress the .gz
- files once you have a copy of them, e.g., by
-
- gzip -dN *.gz
-
- You can also get the entire f2c tree as a tar file:
-
- ftp://netlib.bell-labs.com/netlib/f2c.tar
-
- (which is a synthetic file -- created on the fly and not visible
- to ftp's "ls" or "dir" commands).
-
- Subdirectory msdos contains two PC versions of f2c,
- f2c.exe.gz and f2cx.exe.gz; the latter uses extended memory.
- The README in that directory provides more details.
-
- Changes appear first in the f2c files available by E-mail
- from netlib@netlib.bell-labs.com. If the deamons work right,
- changed files are available the next day by ftp from
- netlib.bell-labs.com. In due course, they reach other netlib servers.
-
-CHANGE NOTIFICATION:
- Send the E-mail message
- subscribe f2c
- to netlib@netlib.bell-labs.com to request notification of new and
- changed f2c files. (Beware that automatically sent change
- notifications may reach you before changes have reached
- ftp://netlib.bell-labs.com/netlib/f2c or to other netlib servers.)
- Send the E-mail message
- unsubscribe f2c
- to recant your notification request.
-
------------------
-Recent change log (partial)
------------------
-
-Mon May 13 23:35:26 EDT 1996
- Recognize Fortran 90's /= as a synonym for .NE.. (<> remains a
-synonym for .NE..)
- Emit an empty int function of no arguments to supply an external
-name to named block data subprograms (so they can be called somewhere
-to force them to be loaded from a library).
- Fix bug (memory fault) in handling the following illegal Fortran:
- parameter(i=1)
- equivalence(i,j)
- end
- Treat cdabs, cdcos, cdexp, cdlog, cdsin, and cdsqrt as synonyms for
-the double complex intrinsics zabs, zcos, zexp, zlog, zsin, and zsqrt,
-respectively, unless -cd is specified.
- Recognize the Fortran 90 bit-manipulation intrinsics btest, iand,
-ibclr, ibits, ibset, ieor, ior, ishft, and ishftc, unless -i90 is
-specified. Note that iand, ieor, and ior are thus now synonyms for
-"and", "xor", and "or", respectively.
- Add three macros (bit_test, bit_clear, bit_set) to f2c.h for use
-with btest, ibclr, and ibset, respectively. Add new functions
-[lq]bit_bits, [lq]bit_shift, and [lq]_bit_cshift to libF77 for
-use with ibits, ishft, and ishftc, respectively.
- Add integer function ftell(unit) (returning -1 on error) and
-subroutine fseek(unit, offset, whence, *) to libI77 (with branch to
-label * on error).
-
-Tue May 14 23:21:12 EDT 1996
- Fix glitch (possible memory fault, or worse) in handling multiple
-entry points with names over 28 characters long.
-
-Mon Jun 10 01:20:16 EDT 1996
- Update netlib E-mail and ftp addresses in f2c/readme and
-f2c/src/readme (which are different files) -- to reflect the upcoming
-breakup of AT&T.
- libf77: trivial tweaks to F77_aloc.c and system_.c; Version.c not
-changed.
- libi77: Adjust rsli.c and lread.c so internal list input with too
-few items in the input string will honor end= .
-
-Mon Jun 10 22:59:57 EDT 1996
- Add Bits_per_Byte to sysdep.h and adjust definition of Table_size
-to depend on Bits_per_Byte (forcing Table_size to be a power of 2); in
-lex.c, change "comstart[c & 0xfff]" to "comstart[c & (Table_size-1)]"
-to avoid an out-of-range subscript on end-of-file.
-
-Wed Jun 12 00:24:28 EDT 1996
- Fix bug in output.c (dereferencing a freed pointer) revealed in
- print * !np in out_call in output.c clobbered by free
- end !during out_expr.
-
-Wed Jun 19 08:12:47 EDT 1996
- f2c.h: add types uinteger, ulongint (for libF77); add qbit_clear
-and qbit_set macros (in a commented-out section) for integer*8.
- For integer*8, use qbit_clear and qbit_set for ibclr and ibset.
- libf77: add casts to unsigned in [lq]bitshft.c.
-
-Thu Jun 20 13:30:43 EDT 1996
- Complain at character*(*) in common (rather than faulting).
- Fix bug in recognizing hex constants that start with "16#" (e.g.,
-16#1234abcd, which is a synonym for z'1234abcd').
- Fix bugs in constant folding of expressions involving btest, ibclr,
-and ibset.
- Fix bug in constant folding of rshift(16#80000000, -31) (on a 32-bit
-machine; more generally, the bug was in constant folding of
-rshift(ibset(0,NBITS-1), 1-NBITS) when f2c runs on a machine with
-long ints having NBITS bits.
-
-Mon Jun 24 07:58:53 EDT 1996
- Adjust struct Literal and newlabel() function to accommodate huge
-source files (with more than 32767 newlabel() invocations).
- Omit .c file when the .f file has a missing final end statement.
-
-Wed Jun 26 14:00:02 EDT 1996
- libi77: Add discussion of MXUNIT (highest allowed Fortran unit number)
-to libI77/README.
-
-Fri Jun 28 14:16:11 EDT 1996
- Fix glitch with -onetrip: the temporary variable used for nonconstant
-initial loop variable values was recycled too soon. Example:
- do i = j+1, k
- call foo(i+1) ! temp for j+1 was reused here
- enddo
- end
-
-Tue Jul 2 16:11:27 EDT 1996
- formatdata.c: add a 0 to the end of the basetype array (for TYBLANK)
-(an omission that was harmless on most machines).
- expr.c: fix a dereference of NULL that was only possible with buggy
-input, such as
- subroutine $sub(s) ! the '$' is erroneous
- character s*(*)
- s(1:) = ' '
- end
-
-Sat Jul 6 00:44:56 EDT 1996
- Fix glitch in the intrinsic "real" function when applied to a
-complex (or double complex) variable and passed as an argument to
-some intrinsic functions. Example:
- complex a
- b = sqrt(real(a))
- end
- Fix glitch (only visible if you do not use f2c's malloc and the
-malloc you do use is defective in the sense that malloc(0) returns 0)
-in handling include files that end with another include (perhaps
-followed by comments).
- Fix glitch with character*(*) arguments named "h" and "i" when
-the body of the subroutine invokes the intrinsic LEN function.
- Arrange that after a previous "f2c -P foo.f" has produced foo.P,
-running "f2c foo.P foo.f" will produce valid C when foo.f contains
- call sub('1234')
- end
- subroutine sub(msg)
- end
-Specifically, the length argument in "call sub" is now suppressed.
-With or without foo.P, it is also now suppressed when the order of
-subprograms in file foo.f is reversed:
- subroutine sub(msg)
- end
- call sub('1234')
- end
- Adjust copyright notices to reflect AT&T breakup.
-
-Wed Jul 10 09:25:49 EDT 1996
- Fix bug (possible memory fault) in handling erroneously placed
-and inconsistent declarations. Example that faulted:
- character*1 w(8)
- call foo(w)
- end
- subroutine foo(m)
- data h /0.5/
- integer m(2) ! should be before data
- end
- Fix bug (possible fault) in handling illegal "if" constructions.
-Example (that faulted):
- subroutine foo(i,j)
- if (i) then ! bug: i is integer, not logical
- else if (j) then ! bug: j is integer, not logical
- endif
- end
- Fix glitch with character*(*) argument named "ret_len" to a
-character*(*) function.
-
-Wed Jul 10 23:04:16 EDT 1996
- Fix more glitches in the intrinsic "real" function when applied to a
-complex (or double complex) variable and passed as an argument to
-some intrinsic functions. Example:
- complex a, b
- r = sqrt(real(conjg(a))) + sqrt(real(a*b))
- end
-
-Thu Jul 11 17:27:16 EDT 1996
- Fix a memory fault associated with complicated, illegal input.
-Example:
- subroutine goo
- character a
- call foo(a) ! inconsistent with subsequent def and call
- end
- subroutine foo(a)
- end
- call foo(a)
- end
-
-Wed Jul 17 19:18:28 EDT 1996
- Fix yet another case of intrinsic "real" applied to a complex
-argument. Example:
- complex a(3)
- x = sqrt(real(a(2))) ! gave error message about bad tag
- end
-
-Mon Aug 26 11:28:57 EDT 1996
- Tweak sysdep.c for non-Unix systems in which process ID's can be
-over 5 digits long.
-
-Tue Aug 27 08:31:32 EDT 1996
- Adjust the ishft intrinsic to use unsigned right shifts. (Previously,
-a negative constant second operand resulted in a possibly signed shift.)
-
-Thu Sep 12 14:04:07 EDT 1996
- equiv.c: fix glitch with -DKR_headers.
- libi77: fmtlib.c: fix bug in printing the most negative integer.
-
-Fri Sep 13 08:54:40 EDT 1996
- Diagnose some illegal appearances of substring notation.
-
-Tue Sep 17 17:48:09 EDT 1996
- Fix fault in handling some complex parameters. Example:
- subroutine foo(a)
- double complex a, b
- parameter(b = (0,1))
- a = b ! f2c faulted here
- end
-
-Thu Sep 26 07:47:10 EDT 1996
- libi77: fmt.h: for formatted writes of negative integer*1 values,
-make ic signed on ANSI systems. If formatted writes of integer*1
-values trouble you when using a K&R C compiler, switch to an ANSI
-compiler or use a compiler flag that makes characters signed.
-
-Tue Oct 1 14:41:36 EDT 1996
- Give a better error message when dummy arguments appear in data
-statements.
-
-Thu Oct 17 13:37:22 EDT 1996
- Fix bug in typechecking arguments to character and complex (or
-double complex) functions; the bug could cause length arguments
-for character arguments to be omitted on invocations appearing
-textually after the first invocation. For example, in
- subroutine foo
- character c
- complex zot
- call goo(zot(c), zot(c))
- end
-the length was omitted from the second invocation of zot, and
-there was an erroneous error message about inconsistent calling
-sequences.
-
-Wed Dec 4 13:59:14 EST 1996
- Fix bug revealed by
- subroutine test(cdum,rdum)
- complex cdum
- rdum=cos(real(cdum)) ! "Unexpected tag 3 in opconv_fudge"
- end
- Fix glitch in parsing "DO 10 D0 = 1, 10".
- Fix glitch in parsing
- real*8 x
- real*8 x ! erroneous "incompatible type" message
- call foo(x)
- end
- lib[FI]77/makefile: add comment about omitting -x under Solaris.
-
-Mon Dec 9 23:15:02 EST 1996
- Fix glitch in parameter adjustments for arrays whose lower
-bound depends on a scalar argument. Example:
- subroutine bug(p,z,m,n)
- integer z(*),m,n
- double precision p(z(m):z(m) + n) ! p_offset botched
- call foo(p(0), p(n))
- end
- libi77: complain about non-positive rec= in direct read and write
-statements.
- libf77: trivial adjustments; Version.c not changed.
-
-Wed Feb 12 00:18:03 EST 1997
- output.c: fix (seldom problematic) glitch in out_call: put parens
-around the ... in a test of the form "if (q->tag == TADDR && ...)".
- vax.c: fix bug revealed in the "psi_offset =" assignment in the
-following example:
- subroutine foo(psi,m)
- integer z(100),m
- common /a/ z
- double precision psi(z(m):z(m) + 10)
- call foo(m+1, psi(0),psi(10))
- end
-
-Mon Feb 24 23:44:54 EST 1997
- For consistency with f2c's current treatment of adjacent character
-strings in FORMAT statements, recognize a Hollerith string following
-a string (and merge adjacent strings in FORMAT statements).
-
-Wed Feb 26 13:41:11 EST 1997
- New libf2c.zip, a combination of the libf77 and libi77 bundles (and
-available only by ftp).
- libf77: adjust functions with a complex output argument to permit
-aliasing it with input arguments. (For now, at least, this is just
-for possible benefit of g77.)
- libi77: tweak to ftell_.c for systems with strange definitions of
-SEEK_SET, etc.
-
-Tue Apr 8 20:57:08 EDT 1997
- libf77: [cz]_div.c: tweaks invisible on most systems (that may
-improve things slightly with optimized compilation on systems that use
-gratuitous extra precision).
- libi77: fmt.c: adjust to complain at missing numbers in formats
-(but still treat missing ".nnn" as ".0").
-
-Fri Apr 11 14:05:57 EDT 1997
- libi77: err.c: attempt to make stderr line buffered rather than
-fully buffered. (Buffering is needed for format items T and TR.)
-
-Thu Apr 17 22:42:43 EDT 1997
- libf77: add F77_aloc.o to makefile (and makefile.u in libf2c.zip).
-
-Fri Apr 25 19:32:09 EDT 1997
- libf77: add [de]time_.c (which may give trouble on some systems).
-
-Tue May 27 09:18:52 EDT 1997
- libi77: ftell_.c: fix typo that caused the third argument to be
-treated as 2 on some systems.
-
-Mon Jun 9 00:04:37 EDT 1997
- libi77 (and libf2c.zip): adjust include order in err.c lread.c wref.c
-rdfmt.c to include fmt.h (etc.) after system includes. Version.c not
-changed.
-
-Mon Jun 9 14:29:13 EDT 1997
- src/gram.c updated; somehow it did not reflect the change of
-19961001 to gram.dcl.
-
-Mon Jul 21 16:04:54 EDT 1997
- proc.c: fix glitch in logic for "nonpositive dimension" message.
- libi77: inquire.c: always include string.h (for possible use with
--DNON_UNIX_STDIO); Version.c not changed.
-
-Thu Jul 24 17:11:23 EDT 1997
- Tweak "Notice" to reflect the AT&T breakup -- we missed it when
-updating the copyright notices in the source files last summer.
- Adjust src/makefile so malloc.o is not used by default, but can
-be specified with "make MALLOC=malloc.o".
- Add comments to src/README about the "CRAY" T3E.
-
-Tue Aug 5 14:53:25 EDT 1997
- Add definition of calloc to malloc.c; this makes f2c's malloc
-work on some systems where trouble hitherto arose because references
-to calloc brought in the system's malloc. (On sensible systems,
-calloc is defined separately from malloc. To avoid confusion on
-other systems, f2c/malloc.c now defines calloc.)
- libi77: lread.c: adjust to accord with a change to the Fortran 8X
-draft (in 1990 or 1991) that rescinded permission to elide quote marks
-in namelist input of character data; to get the old behavior, compile
-with F8X_NML_ELIDE_QUOTES #defined. wrtfmt.o: wrt_G: tweak to print
-the right number of 0's for zero under G format.
-
-Sat Aug 16 05:45:32 EDT 1997
- libi77: iio.c: fix bug in internal writes to an array of character
-strings that sometimes caused one more array element than required by
-the format to be blank-filled. Example: format(1x).
-
-Wed Sep 17 00:39:29 EDT 1997
- libi77: fmt.[ch] rdfmt.c wrtfmt.c: tweak struct syl for machines
-with 64-bit pointers and 32-bit ints that did not 64-bit align
-struct syl (e.g., Linux on the DEC Alpha). This change should be
-invisible on other machines.
-
-Sun Sep 21 22:05:19 EDT 1997
- libf77: [de]time_.c (Unix systems only): change return type to double.
-
-Thu Dec 4 22:10:09 EST 1997
- Fix bug with handling large blocks of comments (over 4k); parts of the
-second and subsequent blocks were likely to be lost (not copied into
-comments in the resulting C). Allow comment lines to be longer before
-breaking them.
-
-Mon Jan 19 17:19:27 EST 1998
- makefile: change the rule for making gram.c to one for making gram1.c;
-henceforth, asking netlib to "send all from f2c/src" will bring you a
-working gram.c. Nowadays there are simply too many broken versions of
-yacc floating around.
- libi77: backspace.c: for b->ufmt==0, change sizeof(int) to
-sizeof(uiolen). On machines where this would make a difference, it is
-best for portability to compile libI77 with -DUIOLEN_int, which will
-render the change invisible.
-
-Tue Feb 24 08:35:33 EST 1998
- makefile: remove gram.c from the "make clean" rule.
-
-Wed Feb 25 08:29:39 EST 1998
- makefile: change CFLAGS assignment to -O; add "veryclean" rule.
-
-Wed Mar 4 13:13:21 EST 1998
- libi77: open.c: fix glitch in comparing file names under
--DNON_UNIX_STDIO.
-
-Mon Mar 9 23:56:56 EST 1998
- putpcc.c: omit an unnecessary temporary variable in computing
-(expr)**3.
- libf77, libi77: minor tweaks to make some C++ compilers happy;
-Version.c not changed.
-
-Wed Mar 18 18:08:47 EST 1998
- libf77: minor tweaks to [ed]time_.c; Version.c not changed.
- libi77: endfile.c, open.c: acquire temporary files from tmpfile(),
-unless compiled with -DNON_ANSI_STDIO, which uses mktemp().
-New buffering scheme independent of NON_UNIX_STDIO for handling T
-format items. Now -DNON_UNIX_STDIO is no longer be necessary for
-Linux, and libf2c no longer causes stderr to be buffered -- the former
-setbuf or setvbuf call for stderr was to make T format items work.
-open.c: use the Posix access() function to check existence or
-nonexistence of files, except under -DNON_POSIX_STDIO, where trial
-fopen calls are used. In open.c, fix botch in changes of 19980304.
- libf2c.zip: the PC makefiles are now set for NT/W95, with comments
-about changes for DOS.
-
-Fri Apr 3 17:22:12 EST 1998
- Adjust fix of 19960913 to again permit substring notation on
-character variables in data statements.
-
-Sun Apr 5 19:26:50 EDT 1998
- libi77: wsfe.c: make $ format item work: this was lost in the changes
-of 17 March 1998.
-
-Sat May 16 19:08:51 EDT 1998
- Adjust output of ftnlen constants: rather than appending L,
-prepend (ftnlen). This should make the resulting C more portable,
-e.g., to systems (such as DEC Alpha Unix systems) on which long
-may be longer than ftnlen.
- Adjust -r so it also casts REAL expressions passed to intrinsic
-functions to REAL.
-
-Wed May 27 16:02:35 EDT 1998
- libf2c.zip: tweak description of compiling libf2c for INTEGER*8
-to accord with makefile.u rather than libF77/makefile.
-
-Thu May 28 22:45:59 EDT 1998
- libi77: backspace.c dfe.c due.c iio.c lread.c rsfe.c sue.c wsfe.c:
-set f__curunit sooner so various error messages will correctly
-identify the I/O unit involved.
- libf2c.zip: above, plus tweaks to PC makefiles: for some purposes,
-it's still best to compile with -DMSDOS (even for use with NT).
-
-Thu Jun 18 01:22:52 EDT 1998
- libi77: lread.c: modified so floating-point numbers (containing
-either a decimal point or an exponent field) are treated as errors
-when they appear as list input for integer data. Compile lread.c with
--DALLOW_FLOAT_IN_INTEGER_LIST_INPUT to restore the old behavior.
-
-Mon Aug 31 10:38:54 EDT 1998
- formatdata.c: if possible, and assuming doubles must be aligned on
-double boundaries, use existing holes in DATA for common blocks to
-force alignment of the block. For example,
- block data
- common /abc/ a, b
- double precision a
- integer b(2)
- data b(2)/1/
- end
-used to generate
- struct {
- integer fill_1[3];
- integer e_2;
- doublereal e_3;
- } abc_ = { {0}, 1, 0. };
-and now generates
- struct {
- doublereal fill_1[1];
- integer fill_2[1];
- integer e_3;
- } abc_ = { {0}, {0}, 1 };
-In the old generated C, e_3 was added to force alignment; in the new C,
-fill_1 does this job.
-
-Mon Sep 7 19:48:51 EDT 1998
- libi77: move e_wdfe from sfe.c to dfe.c, where it was originally.
-Why did it ever move to sfe.c?
-
-Tue Sep 8 10:22:50 EDT 1998
- Treat dreal as a synonym for dble unless -cd is specified on the
-command line.
-
-Sun Sep 13 22:23:41 EDT 1998
- format.c: fix bug in writing prototypes under f2c -A ... *.P:
-under some circumstances involving external functions with no known
-type, a null pointer was passed to printf.
-
-Tue Oct 20 23:25:54 EDT 1998
- Comments added to libf2c/README and libF77/README, pointing out
-the need to modify signal1.h on some systems.
-
-Thu Nov 12 15:34:09 EST 1998
- libf77, libf2c.zip: minor tweaks to [de]time_.c and the makefiles,
-so makefile.sy, makefile.vc, and makefile.wat deal with [de]time_.c.
-
-Wed Feb 10 22:59:52 EST 1999
- defs.h lex.c: permit long names (up to at least roughly
-MAX_SHARPLINE_LEN = 1000 characters long) in #line lines (which only
-matters under -g).
- fc: add -U option; recognize .so files.
-
-Sat Feb 13 10:18:27 EST 1999
- libf2c: endfile.c, lread.c, signal1.h0: minor tweaks to make some
-(C++) compilers happier; f77_aloc.c: make exit_() visible to C++
-compilers. Version strings not changed.
-
-Thu Mar 11 23:14:02 EST 1999
- Modify f2c (exec.c, expr.c) to diagnose incorrect mixing of types
-when (f2c extended) intrinsic functions are involved, as in
-(not(17) .and. 4). Catching this in the first executable statement
-is a bit tricky, as some checking must be postponed until all statement
-function declarations have been parsed. Thus there is a chance of
-today's changes introducing bugs under (let us hope) unusual conditions.
-
-Sun Mar 28 13:17:44 EST 1999
- lex.c: tweak to get the file name right in error messages caused
-by statements just after a # nnn "filename" line emitted by the C
-preprocessor. (The trouble is that the line following the # nnn line
-must be read to see if it is a continuation of the stuff that preceded
-the # nnn line.) When # nnn "filename" lines appear among the lines
-for a Fortran statement, the filename reported in an error message for
-the statement should now be the file that was current when the first
-line of the statement was read.
-
-Sun May 2 22:38:25 EDT 1999
- libf77, libi77, libf2c.zip: make getenv_() more portable (call
-getenv() rather than knowing about char **environ); adjust some
-complex intrinsics to work with overlapping arguments (caused by
-inappropriate use of equivalence); open.c: get "external" versus
-"internal" right in the error message if a file cannot be opened;
-err.c: cast a pointer difference to (int) for %d; rdfmt.c: omit
-fixed-length buffer that could be overwritten by formats Inn or Lnn
-with nn > 83.
-
-Mon May 3 13:14:07 EDT 1999
- "Invisible" changes to omit a few compiler warnings in f2c and
-libf2c; two new casts in libf2c/open.c that matter with 64-bit longs,
-and one more tweak (libf2c/c_log.c) for pathological equivalences.
- Minor update to "fc" script: new -L flag and comment correction.
-
-Tue May 4 10:06:26 EDT 1999
- libf77, libf2c.zip: forgot to copy yesterday's latest updates to
-netlib.
-
-Fri Jun 18 02:33:08 EDT 1999
- libf2c.zip: rename backspace.c backspac.c, and fix a glitch in it
--- b->ufd may change in t_runc(). (For now, it's still backspace.c
-in the libi77 bundle.)
-
-Sun Jun 27 22:05:47 EDT 1999
- libf2c.zip, libi77: rsne.c: fix bug in namelist input: a misplaced
-increment could cause wrong array elements to be assigned; e.g.,
-"&input k(5)=10*1 &end" assigned k(5) and k(15 .. 23).
-
-
-Current timestamps of files in "all from f2c/src", sorted by time,
-appear below (mm/dd/year hh:mm:ss). To bring your source up to date,
-obtain source files with a timestamp later than the time shown in your
-version.c. Note that the time shown in the current version.c is the
-timestamp of the source module that immediately follows version.c below:
-
- 5/03/1999 12:46:15 version.c
- 5/03/1999 12:39:35 formatdata.c
- 5/03/1999 12:31:14 format.c
- 5/03/1999 12:27:17 p1output.c
- 5/03/1999 12:27:17 data.c
- 5/03/1999 10:01:12 xsum0.out
- 5/03/1999 9:59:36 io.c
- 5/03/1999 9:59:36 misc.c
- 5/03/1999 9:59:36 init.c
- 3/26/1999 23:18:11 lex.c
- 3/11/1999 16:44:17 expr.c
- 3/11/1999 16:42:42 exec.c
- 2/10/1999 17:43:01 defs.h
- 9/08/1998 10:16:51 f2c.1
- 9/08/1998 10:16:48 f2c.1t
- 9/08/1998 10:14:53 intr.c
- 5/16/1998 16:55:49 output.c
- 4/03/1998 17:15:05 gram.c
- 4/03/1998 17:14:59 gram.dcl
- 3/09/1998 0:30:23 putpcc.c
- 2/25/1998 8:18:04 makefile
-12/04/1997 17:44:11 niceprintf.c
- 8/05/1997 10:31:26 malloc.c
- 7/24/1997 17:10:55 README
- 7/24/1997 16:06:19 Notice
- 7/21/1997 12:58:44 proc.c
- 2/11/1997 23:39:14 vax.c
-12/04/1996 13:07:53 gram.exec
- 9/12/1996 12:12:46 equiv.c
- 8/26/1996 9:41:13 sysdep.c
- 7/09/1996 10:40:45 names.c
- 7/04/1996 9:55:45 sysdep.h
- 7/04/1996 9:55:43 put.c
- 7/04/1996 9:55:41 pread.c
- 7/04/1996 9:55:40 parse_args.c
- 7/04/1996 9:55:36 mem.c
- 7/04/1996 9:55:36 memset.c
- 7/04/1996 9:55:35 main.c
- 7/04/1996 9:55:29 error.c
- 7/04/1996 9:55:27 cds.c
- 7/03/1996 15:47:49 xsum.c
- 6/19/1996 7:04:27 f2c.h
- 6/19/1996 2:52:05 defines.h
- 5/13/1996 0:40:32 gram.head
- 2/25/1994 2:07:19 parse.h
- 2/22/1994 19:07:20 iob.h
- 2/22/1994 18:56:53 p1defs.h
- 2/22/1994 18:53:46 output.h
- 2/22/1994 18:51:14 names.h
- 2/22/1994 18:30:41 format.h
- 1/18/1994 18:12:52 tokens
- 3/06/1993 14:13:58 gram.expr
- 1/28/1993 9:03:16 ftypes.h
- 4/06/1990 0:00:57 gram.io
- 2/03/1990 0:58:26 niceprintf.h
- 1/07/1990 1:20:01 usignal.h
-11/27/1989 8:27:37 machdefs.h
- 7/01/1989 11:59:44 pccdefs.h
diff --git a/contrib/libg++/COPYING b/contrib/libg++/COPYING
deleted file mode 100644
index a43ea2126fb6..000000000000
--- a/contrib/libg++/COPYING
+++ /dev/null
@@ -1,339 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 675 Mass Ave, Cambridge, MA 02139, USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- Appendix: How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
- <one line to give the program's name and a brief idea of what it does.>
- Copyright (C) 19yy <name of author>
-
- This program 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 of the License, or
- (at your option) any later version.
-
- This program 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 program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) 19yy name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- <signature of Ty Coon>, 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Library General
-Public License instead of this License.
diff --git a/contrib/libg++/COPYING.LIB b/contrib/libg++/COPYING.LIB
deleted file mode 100644
index eb685a5ec981..000000000000
--- a/contrib/libg++/COPYING.LIB
+++ /dev/null
@@ -1,481 +0,0 @@
- GNU LIBRARY GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1991 Free Software Foundation, Inc.
- 675 Mass Ave, Cambridge, MA 02139, USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-[This is the first released version of the library GPL. It is
- numbered 2 because it goes with version 2 of the ordinary GPL.]
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-Licenses are intended to guarantee your freedom to share and change
-free software--to make sure the software is free for all its users.
-
- This license, the Library General Public License, applies to some
-specially designated Free Software Foundation software, and to any
-other libraries whose authors decide to use it. You can use it for
-your libraries, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if
-you distribute copies of the library, or if you modify it.
-
- For example, if you distribute copies of the library, whether gratis
-or for a fee, you must give the recipients all the rights that we gave
-you. You must make sure that they, too, receive or can get the source
-code. If you link a program with the library, you must provide
-complete object files to the recipients so that they can relink them
-with the library, after making changes to the library and recompiling
-it. And you must show them these terms so they know their rights.
-
- Our method of protecting your rights has two steps: (1) copyright
-the library, and (2) offer you this license which gives you legal
-permission to copy, distribute and/or modify the library.
-
- Also, for each distributor's protection, we want to make certain
-that everyone understands that there is no warranty for this free
-library. If the library is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original
-version, so that any problems introduced by others will not reflect on
-the original authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that companies distributing free
-software will individually obtain patent licenses, thus in effect
-transforming the program into proprietary software. To prevent this,
-we have made it clear that any patent must be licensed for everyone's
-free use or not licensed at all.
-
- Most GNU software, including some libraries, is covered by the ordinary
-GNU General Public License, which was designed for utility programs. This
-license, the GNU Library General Public License, applies to certain
-designated libraries. This license is quite different from the ordinary
-one; be sure to read it in full, and don't assume that anything in it is
-the same as in the ordinary license.
-
- The reason we have a separate public license for some libraries is that
-they blur the distinction we usually make between modifying or adding to a
-program and simply using it. Linking a program with a library, without
-changing the library, is in some sense simply using the library, and is
-analogous to running a utility program or application program. However, in
-a textual and legal sense, the linked executable is a combined work, a
-derivative of the original library, and the ordinary General Public License
-treats it as such.
-
- Because of this blurred distinction, using the ordinary General
-Public License for libraries did not effectively promote software
-sharing, because most developers did not use the libraries. We
-concluded that weaker conditions might promote sharing better.
-
- However, unrestricted linking of non-free programs would deprive the
-users of those programs of all benefit from the free status of the
-libraries themselves. This Library General Public License is intended to
-permit developers of non-free programs to use free libraries, while
-preserving your freedom as a user of such programs to change the free
-libraries that are incorporated in them. (We have not seen how to achieve
-this as regards changes in header files, but we have achieved it as regards
-changes in the actual functions of the Library.) The hope is that this
-will lead to faster development of free libraries.
-
- The precise terms and conditions for copying, distribution and
-modification follow. Pay close attention to the difference between a
-"work based on the library" and a "work that uses the library". The
-former contains code derived from the library, while the latter only
-works together with the library.
-
- Note that it is possible for a library to be covered by the ordinary
-General Public License rather than by this special one.
-
- GNU LIBRARY GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License Agreement applies to any software library which
-contains a notice placed by the copyright holder or other authorized
-party saying it may be distributed under the terms of this Library
-General Public License (also called "this License"). Each licensee is
-addressed as "you".
-
- A "library" means a collection of software functions and/or data
-prepared so as to be conveniently linked with application programs
-(which use some of those functions and data) to form executables.
-
- The "Library", below, refers to any such software library or work
-which has been distributed under these terms. A "work based on the
-Library" means either the Library or any derivative work under
-copyright law: that is to say, a work containing the Library or a
-portion of it, either verbatim or with modifications and/or translated
-straightforwardly into another language. (Hereinafter, translation is
-included without limitation in the term "modification".)
-
- "Source code" for a work means the preferred form of the work for
-making modifications to it. For a library, complete source code means
-all the source code for all modules it contains, plus any associated
-interface definition files, plus the scripts used to control compilation
-and installation of the library.
-
- Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running a program using the Library is not restricted, and output from
-such a program is covered only if its contents constitute a work based
-on the Library (independent of the use of the Library in a tool for
-writing it). Whether that is true depends on what the Library does
-and what the program that uses the Library does.
-
- 1. You may copy and distribute verbatim copies of the Library's
-complete source code as you receive it, in any medium, provided that
-you conspicuously and appropriately publish on each copy an
-appropriate copyright notice and disclaimer of warranty; keep intact
-all the notices that refer to this License and to the absence of any
-warranty; and distribute a copy of this License along with the
-Library.
-
- You may charge a fee for the physical act of transferring a copy,
-and you may at your option offer warranty protection in exchange for a
-fee.
-
- 2. You may modify your copy or copies of the Library or any portion
-of it, thus forming a work based on the Library, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) The modified work must itself be a software library.
-
- b) You must cause the files modified to carry prominent notices
- stating that you changed the files and the date of any change.
-
- c) You must cause the whole of the work to be licensed at no
- charge to all third parties under the terms of this License.
-
- d) If a facility in the modified Library refers to a function or a
- table of data to be supplied by an application program that uses
- the facility, other than as an argument passed when the facility
- is invoked, then you must make a good faith effort to ensure that,
- in the event an application does not supply such function or
- table, the facility still operates, and performs whatever part of
- its purpose remains meaningful.
-
- (For example, a function in a library to compute square roots has
- a purpose that is entirely well-defined independent of the
- application. Therefore, Subsection 2d requires that any
- application-supplied function or table used by this function must
- be optional: if the application does not supply it, the square
- root function must still compute square roots.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Library,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Library, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote
-it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Library.
-
-In addition, mere aggregation of another work not based on the Library
-with the Library (or with a work based on the Library) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may opt to apply the terms of the ordinary GNU General Public
-License instead of this License to a given copy of the Library. To do
-this, you must alter all the notices that refer to this License, so
-that they refer to the ordinary GNU General Public License, version 2,
-instead of to this License. (If a newer version than version 2 of the
-ordinary GNU General Public License has appeared, then you can specify
-that version instead if you wish.) Do not make any other change in
-these notices.
-
- Once this change is made in a given copy, it is irreversible for
-that copy, so the ordinary GNU General Public License applies to all
-subsequent copies and derivative works made from that copy.
-
- This option is useful when you wish to copy part of the code of
-the Library into a program that is not a library.
-
- 4. You may copy and distribute the Library (or a portion or
-derivative of it, under Section 2) in object code or executable form
-under the terms of Sections 1 and 2 above provided that you accompany
-it with the complete corresponding machine-readable source code, which
-must be distributed under the terms of Sections 1 and 2 above on a
-medium customarily used for software interchange.
-
- If distribution of object code is made by offering access to copy
-from a designated place, then offering equivalent access to copy the
-source code from the same place satisfies the requirement to
-distribute the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 5. A program that contains no derivative of any portion of the
-Library, but is designed to work with the Library by being compiled or
-linked with it, is called a "work that uses the Library". Such a
-work, in isolation, is not a derivative work of the Library, and
-therefore falls outside the scope of this License.
-
- However, linking a "work that uses the Library" with the Library
-creates an executable that is a derivative of the Library (because it
-contains portions of the Library), rather than a "work that uses the
-library". The executable is therefore covered by this License.
-Section 6 states terms for distribution of such executables.
-
- When a "work that uses the Library" uses material from a header file
-that is part of the Library, the object code for the work may be a
-derivative work of the Library even though the source code is not.
-Whether this is true is especially significant if the work can be
-linked without the Library, or if the work is itself a library. The
-threshold for this to be true is not precisely defined by law.
-
- If such an object file uses only numerical parameters, data
-structure layouts and accessors, and small macros and small inline
-functions (ten lines or less in length), then the use of the object
-file is unrestricted, regardless of whether it is legally a derivative
-work. (Executables containing this object code plus portions of the
-Library will still fall under Section 6.)
-
- Otherwise, if the work is a derivative of the Library, you may
-distribute the object code for the work under the terms of Section 6.
-Any executables containing that work also fall under Section 6,
-whether or not they are linked directly with the Library itself.
-
- 6. As an exception to the Sections above, you may also compile or
-link a "work that uses the Library" with the Library to produce a
-work containing portions of the Library, and distribute that work
-under terms of your choice, provided that the terms permit
-modification of the work for the customer's own use and reverse
-engineering for debugging such modifications.
-
- You must give prominent notice with each copy of the work that the
-Library is used in it and that the Library and its use are covered by
-this License. You must supply a copy of this License. If the work
-during execution displays copyright notices, you must include the
-copyright notice for the Library among them, as well as a reference
-directing the user to the copy of this License. Also, you must do one
-of these things:
-
- a) Accompany the work with the complete corresponding
- machine-readable source code for the Library including whatever
- changes were used in the work (which must be distributed under
- Sections 1 and 2 above); and, if the work is an executable linked
- with the Library, with the complete machine-readable "work that
- uses the Library", as object code and/or source code, so that the
- user can modify the Library and then relink to produce a modified
- executable containing the modified Library. (It is understood
- that the user who changes the contents of definitions files in the
- Library will not necessarily be able to recompile the application
- to use the modified definitions.)
-
- b) Accompany the work with a written offer, valid for at
- least three years, to give the same user the materials
- specified in Subsection 6a, above, for a charge no more
- than the cost of performing this distribution.
-
- c) If distribution of the work is made by offering access to copy
- from a designated place, offer equivalent access to copy the above
- specified materials from the same place.
-
- d) Verify that the user has already received a copy of these
- materials or that you have already sent this user a copy.
-
- For an executable, the required form of the "work that uses the
-Library" must include any data and utility programs needed for
-reproducing the executable from it. However, as a special exception,
-the source code distributed need not include anything that is normally
-distributed (in either source or binary form) with the major
-components (compiler, kernel, and so on) of the operating system on
-which the executable runs, unless that component itself accompanies
-the executable.
-
- It may happen that this requirement contradicts the license
-restrictions of other proprietary libraries that do not normally
-accompany the operating system. Such a contradiction means you cannot
-use both them and the Library together in an executable that you
-distribute.
-
- 7. You may place library facilities that are a work based on the
-Library side-by-side in a single library together with other library
-facilities not covered by this License, and distribute such a combined
-library, provided that the separate distribution of the work based on
-the Library and of the other library facilities is otherwise
-permitted, and provided that you do these two things:
-
- a) Accompany the combined library with a copy of the same work
- based on the Library, uncombined with any other library
- facilities. This must be distributed under the terms of the
- Sections above.
-
- b) Give prominent notice with the combined library of the fact
- that part of it is a work based on the Library, and explaining
- where to find the accompanying uncombined form of the same work.
-
- 8. You may not copy, modify, sublicense, link with, or distribute
-the Library except as expressly provided under this License. Any
-attempt otherwise to copy, modify, sublicense, link with, or
-distribute the Library is void, and will automatically terminate your
-rights under this License. However, parties who have received copies,
-or rights, from you under this License will not have their licenses
-terminated so long as such parties remain in full compliance.
-
- 9. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Library or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Library (or any work based on the
-Library), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Library or works based on it.
-
- 10. Each time you redistribute the Library (or any work based on the
-Library), the recipient automatically receives a license from the
-original licensor to copy, distribute, link with or modify the Library
-subject to these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 11. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Library at all. For example, if a patent
-license would not permit royalty-free redistribution of the Library by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Library.
-
-If any portion of this section is held invalid or unenforceable under any
-particular circumstance, the balance of the section is intended to apply,
-and the section as a whole is intended to apply in other circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 12. If the distribution and/or use of the Library is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Library under this License may add
-an explicit geographical distribution limitation excluding those countries,
-so that distribution is permitted only in or among countries not thus
-excluded. In such case, this License incorporates the limitation as if
-written in the body of this License.
-
- 13. The Free Software Foundation may publish revised and/or new
-versions of the Library General Public License from time to time.
-Such new versions will be similar in spirit to the present version,
-but may differ in detail to address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Library
-specifies a version number of this License which applies to it and
-"any later version", you have the option of following the terms and
-conditions either of that version or of any later version published by
-the Free Software Foundation. If the Library does not specify a
-license version number, you may choose any version ever published by
-the Free Software Foundation.
-
- 14. If you wish to incorporate parts of the Library into other free
-programs whose distribution conditions are incompatible with these,
-write to the author to ask for permission. For software which is
-copyrighted by the Free Software Foundation, write to the Free
-Software Foundation; we sometimes make exceptions for this. Our
-decision will be guided by the two goals of preserving the free status
-of all derivatives of our free software and of promoting the sharing
-and reuse of software generally.
-
- NO WARRANTY
-
- 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
-WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
-EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
-OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
-KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
-LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
-THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
-WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
-AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
-FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
-CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
-LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
-RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
-FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
-SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- Appendix: How to Apply These Terms to Your New Libraries
-
- If you develop a new library, and you want it to be of the greatest
-possible use to the public, we recommend making it free software that
-everyone can redistribute and change. You can do so by permitting
-redistribution under these terms (or, alternatively, under the terms of the
-ordinary General Public License).
-
- To apply these terms, attach the following notices to the library. It is
-safest to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least the
-"copyright" line and a pointer to where the full notice is found.
-
- <one line to give the library's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-Also add information on how to contact you by electronic and paper mail.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the library, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the
- library `Frob' (a library for tweaking knobs) written by James Random Hacker.
-
- <signature of Ty Coon>, 1 April 1990
- Ty Coon, President of Vice
-
-That's all there is to it!
diff --git a/contrib/libg++/include/ChangeLog b/contrib/libg++/include/ChangeLog
deleted file mode 100644
index 228edd5a9be4..000000000000
--- a/contrib/libg++/include/ChangeLog
+++ /dev/null
@@ -1,990 +0,0 @@
-Tue Jun 4 18:58:16 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * bfdlink.h (struct bfd_link_info): Add notice_all field.
-
-Fri Apr 26 10:33:12 1996 Doug Evans <dje@canuck.cygnus.com>
-
- * demangle.h (#ifdef IN_GCC): #include "gansidecl.h".
- (PROTO,PTR,const): Delete.
-
-Mon Apr 22 17:27:42 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * bfdlink.h (struct bfd_link_info): Add traditional_format field.
-
-Mon Apr 15 15:16:56 1996 Doug Evans <dje@canuck.cygnus.com>
-
- * libiberty.h (choose_temp_base): Add prototype.
-
-Tue Mar 12 17:29:46 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * bfdlink.h (bfd_wrapped_link_hash_lookup): Declare.
- (struct bfd_link_info): Add wrap_hash field.
-
-Wed Feb 14 16:49:17 1996 Martin Anantharaman <martin@mail.imech.uni-duisburg.de>
-
- * ieee.h (ieee_record_enum_type): Define
- ieee_external_reference_info_enum.
-
-Fri Feb 2 17:09:25 1996 Doug Evans <dje@charmed.cygnus.com>
-
- * dis-asm.h (DISASM_RAW_INSN): Delete.
-
-Tue Jan 23 09:21:47 1996 Doug Evans <dje@charmed.cygnus.com>
-
- * dis-asm.h (INIT_DISASSEMBLE_INFO): Set endian to BFD_ENDIAN_UNKNOWN.
- New argument FPRINTF_FUNC.
-
-Mon Jan 22 16:37:59 1996 Doug Evans <dje@charmed.cygnus.com>
-
- * dis-asm.h (disassemble_info): New members arch, mach, endian.
- (INIT_DISASSEMBLE_INFO): Initialize them.
- (DISASM_RAW_INSN{,FLAG}): Define.
-
-Thu Jan 18 11:32:38 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * demangle.h (cplus_demangle_opname): Change opname parameter to
- const char *.
- (cplus_mangle_opname): Change return type and opname parameter to
- const char *.
-
-Fri Jan 5 00:01:22 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * ieee.h (enum ieee_record): Add ieee_asn_record_enum,
- ieee_at_record_enum, ieee_ty_record_enum, ieee_atn_record_enum,
- ieee_bb_record_enum, and ieee_be_record_enum.
-
-Wed Jan 3 13:12:09 1996 Fred Fish <fnf@cygnus.com>
-
- * obstack.h: Update copyright to 1996.
- (_obstack_memory_used): Declare.
- (obstack_memory_used): Define macro.
-
-Thu Dec 28 11:42:12 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * libiberty.h (xstrdup): Declare.
-
-Thu Dec 21 14:47:17 1995 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * wait.h: Protect all macros with #ifndef.
-
-Tue Oct 24 21:45:40 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * bfdlink.h (struct bfd_link_info): Add static_link field.
-
-Tue Sep 12 16:28:04 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * bfdlink.h (struct bfd_link_callbacks): Add symbol parameter to
- warning callback.
-
-Fri Sep 1 13:11:51 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * bfdlink.h (struct bfd_link_callbacks): Change warning callback
- to take BFD, section, and address arguments.
-
-Thu Aug 31 16:45:12 1995 steve chamberlain <sac@slash.cygnus.com>
-
- * bfdlink.h (struct bfd_link_info): Remove PE stuff.
-
-Tue Aug 22 03:18:23 1995 Ken Raeburn <raeburn@kr-laptop.cygnus.com>
-
- * libiberty.h: Declare xstrerror. From Pat Rankin.
-
-Mon Aug 21 18:11:36 1995 steve chamberlain <sac@slash.cygnus.com>
-
- * bfdlink.h (struct bfd_link_info): Remove PE stuff.
-
-Wed Aug 2 08:14:12 1995 Doug Evans <dje@canuck.cygnus.com>
-
- * dis-asm.h (print_insn_sparc64): Declare.
-
-Mon Jul 10 13:26:49 1995 Eric Youngdale <eric@aib.com>
-
- * bfdlink.h (struct bfd_link_info): Add new field symbolic.
-
-Sun Jul 2 17:48:40 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * bfdlink.h (struct bfd_link_info): Change type of base_file to
- PTR.
-
-Thu Jun 29 00:02:45 1995 Steve Chamberlain <sac@slash.cygnus.com>
-
- * bfdlink.h (struct bfd_link_info): Added base_file member.
-
-Tue Jun 20 16:40:04 1995 Steve Chamberlain <sac@slash.cygnus.com>
-
- * ansidecl.h: win32s is ANSI enough.
-
-Thu May 18 04:25:50 1995 Ken Raeburn <raeburn@kr-laptop.cygnus.com>
-
- Wed May 10 14:28:16 1995 Richard Earnshaw (rearnsha@armltd.co.uk)
-
- * dis-asm.h (print_insn_arm): Delete declaration.
- (print_insn_{little,big}_arm): New declarations.
-
- * floatformat.h (floatformat_arm_ext): Declare.
-
-Sat May 13 10:14:08 1995 Steve Chamberlain <sac@slash.cygnus.com>
-
- * coff/pe.h: New file.
- * bfdlink.h (subsytem, stack_heap_parameters): New.
- * coff/i386.h (NT_SECTION_ALIGNMENT, NT_FILE_ALIGNMENT,
- NT_DEF_RESERVE, NT_DEF_COMMIT): New.
- * coff/internal.h (internal_filehdr): New fields for PE.
- (IMAGE_DATA_DIRECTORY): New.
- (internal_aouthdr): New fields for PE.
-
-Thu May 4 14:36:42 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * demangle.h: Don't include ansidecl.h if IN_GCC.
-
-
-Tue Feb 21 00:37:28 1995 Jeff Law (law@snake.cs.utah.edu)
-
- * hp-symtab.h: Don't use bitfield enumerations, the HP C compiler
- does not handle them correctly.
-
-
-Thu Feb 9 14:20:27 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * libiberty.h (basename): Don't declare parameter type; some
- systems have this in their header files.
-
-Wed Feb 8 17:35:38 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * bfdlink.h (struct bfd_link_hash_entry): Change format of common
- symbol information, to remove restrictions on maximum size and
- alignment power, by using a pointer to a structure instead.
-
-Mon Feb 6 14:55:32 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * bfdlink.h (enum bfd_link_hash_type): Rename bfd_link_hash_weak
- to bfd_link_hash_undefweak. Add bfd_link_hash_defweak.
-
-Mon Jan 16 21:00:23 1995 Stan Shebs <shebs@andros.cygnus.com>
-
- * dis-asm.h (GDB_INIT_DISASSEMBLE_INFO, etc): Remove all
- GDB-specific definitions.
-
-Sun Jan 15 18:39:35 1995 Steve Chamberlain <sac@splat>
-
- * dis-asm.h (print_insn_w65): Declare.
-
-Thu Jan 12 17:51:17 1995 Ken Raeburn <raeburn@cujo.cygnus.com>
-
- * libiberty.h (hex_p): Fix sense of test.
-
-Wed Jan 11 22:36:40 1995 Ken Raeburn <raeburn@cujo.cygnus.com>
-
- * libiberty.h (_hex_array_size, _hex_bad, _hex_value, hex_init,
- hex_p, hex_value): New macros and declarations, for hex.c.
-
-Fri Jan 6 17:44:14 1995 Ian Lance Taylor <ian@sanguine.cygnus.com>
-
- * dis-asm.h: Make idempotent.
-
-Wed Dec 14 13:08:43 1994 Stan Shebs <shebs@andros.cygnus.com>
-
- * progress.h: New file, empty definitions for progress macros.
-
-
-Fri Nov 25 00:14:05 1994 Jeff Law (law@snake.cs.utah.edu)
-
- * hp-symtab.h: New file describing the debug symbols emitted
- by the HP C compilers.
-
-Fri Nov 11 15:48:37 1994 Ian Lance Taylor <ian@sanguine.cygnus.com>
-
- * bfdlink.h (struct bfd_link_hash_entry): Change u.c.size from 24
- to 26 bits, and change u.c.alignment_power from 8 to 6 bits. 6
- bit in the alignment power is enough for a 64 bit address space.
-
-Mon Oct 31 13:02:51 1994 Stan Shebs (shebs@andros.cygnus.com)
-
- * demangle.h (cplus_mangle_opname): Declare.
-
-Tue Oct 25 11:38:02 1994 Ian Lance Taylor <ian@sanguine.cygnus.com>
-
- * bfdlink.h (struct bfd_link_callbacks): Fix comments for
- multiple_common field.
-
-Sun Sep 04 17:58:10 1994 Richard Earnshaw (rwe@pegasus.esprit.ec.org)
-
- * aout/aout64.h: Only define QMAGIC if it isn't already defined.
-
- * dis-asm.h: Add support for the ARM.
-
-Wed Aug 10 12:51:41 1994 Doug Evans (dje@canuck.cygnus.com)
-
- * libiberty.h (strsignal): Document its existence even if we
- can't declare it.
-
-Tue Aug 2 14:40:03 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
-
- * os9k.h: Remove u_int16, u_int32, and owner_id typedefs and
- expand their uses. Those names conflict with Mach headers.
-
-Fri Jul 22 14:17:12 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
-
- * bfdlink.h (struct bfd_link_hash_entry): Change u.c.size into a
- bitfield. Add field u.c.alignment_power.
-
-Sun Jul 10 00:26:39 1994 Ian Dall (dall@hfrd.dsto.gov.au)
-
- * dis-asm.h: Add print_insn_ns32k declaration.
-
-Mon Jun 20 17:13:29 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
-
- * bfdlink.h (bfd_link_hash_table): Make creator a const pointer.
-
-Sat Jun 18 16:09:32 1994 Stan Shebs (shebs@andros.cygnus.com)
-
- * demangle.h (cplus_demangle_opname): Declare.
-
-Thu Jun 16 15:19:03 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
-
- * bfdlink.h (struct bfd_link_info): Add new field shared.
-
-Mon Jun 6 14:39:44 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
-
- * bfdlink.h (struct bfd_link_hash_entry): Remove written field:
- not needed for all backends.
-
-Thu Apr 28 19:06:50 1994 Ken Raeburn (raeburn@cujo.cygnus.com)
-
- * dis-asm.h (disassembler): Declare.
-
-Fri Apr 1 00:38:17 1994 Jim Wilson (wilson@mole.gnu.ai.mit.edu)
-
- * obstack.h: Delete use of IN_GCC to control whether
- stddef.h or gstddef.h is included.
-
-Tue Mar 22 13:06:02 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
-
- * bfdlink.h (enum bfd_link_order_type): Add bfd_data_link_order.
- (struct bfd_link_order): Add data field to union.
-
-Mon Mar 21 18:45:26 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
-
- * bfdlink.h (struct bfd_link_callbacks): Change bitsize argument
- to add_to_set to reloc. Remove bitsize argument from constructor.
- Comment that reloc_overflow, reloc_dangerous and unattached_reloc
- must handle NULL pointers for reloc location.
- (enum bfd_link_order_type): Add bfd_section_reloc_link_order and
- bfd_symbol_reloc_link_order.
- (struct bfd_link_order): Add reloc field to union.
- (struct bfd_link_order_reloc): Define.
-
-Mon Mar 14 12:27:50 1994 Ian Lance Taylor (ian@cygnus.com)
-
- * ieee-float.h: Removed; no longer used.
-
-Tue Mar 1 18:10:49 1994 Kung Hsu (kung@mexican.cygnus.com)
-
- * os9k.h: os9000 target specific header file, the header of the
- object file is used now.
-
-Sun Feb 27 21:52:26 1994 Jim Kingdon (kingdon@deneb.cygnus.com)
-
- * floatformat.h: New file, intended to replace ieee-float.h.
-
-Sun Feb 20 17:15:42 1994 Ian Lance Taylor (ian@lisa.cygnus.com)
-
- * ansidecl.h (ANSI_PROTOTYPES): Define if using ANSI prototypes.
-
-Wed Feb 16 01:07:12 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
-
- * libiberty.h: Don't declare strsignal, to avoid conflicts with
- Solaris system header files.
-
-Sat Feb 12 22:11:32 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
-
- * libiberty.h (xexit): Use __volatile__ to avoid losing if
- compiling with gcc -traditional.
-
-Thu Feb 10 14:05:41 1994 Ian Lance Taylor (ian@cygnus.com)
-
- * libiberty.h: New file. Declares functions provided by
- libiberty.
-
-Tue Feb 8 05:19:52 1994 David J. Mackenzie (djm@thepub.cygnus.com)
-
- Handle obstack_chunk_alloc returning NULL. This allows
- obstacks to be used by libraries, without forcing them
- to call exit or longjmp.
- * obstack.h (struct obstack): Add alloc_failed flag.
- _obstack_begin, _obstack_begin_1): Declare to return int, not void.
- (obstack_finish): If alloc_failed, return NULL.
- (obstack_base, obstack_next_free, objstack_object_size):
- If alloc_failed, return 0.
- (obstack_grow, obstack_grow0, obstack_1grow, obstack_ptr_grow,
- obstack_int_grow, obstack_blank): If alloc_failed, do nothing that
- could corrupt the obstack.
-
-Mon Jan 24 15:06:05 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
-
- * bfdlink.h (struct bfd_link_callbacks): Add name, reloc_name and
- addend argments to reloc_overflow callback.
-
-Fri Jan 21 19:13:12 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
-
- * dis-asm.h (print_insn_big_powerpc, print_insn_little_powerpc,
- print_insn_rs6000): Declare.
-
-Thu Jan 6 14:15:55 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
-
- * bfdlink.h (struct bfd_link_callbacks): Add bitsize argument to
- add_to_set field. Add new callback named constructor.
-
-Thu Dec 30 10:44:06 1993 Ian Lance Taylor (ian@rtl.cygnus.com)
-
- * bfdlink.h: New file for new BFD linker backend routines.
-
-Mon Nov 29 10:43:57 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
-
- * dis-asm.h (enum dis_insn_tyupe): Remove non-ANSI trailing comma.
-
-Sat Oct 2 20:42:26 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
-
- * dis-asm.h: Move comment to right place.
-
-Mon Aug 9 19:03:35 1993 David J. Mackenzie (djm@thepub.cygnus.com)
-
- * obstack.h (obstack_chunkfun, obstack_freefun): Add defns from
- previous version. Are these Cygnus local changes?
-
-Fri Aug 6 17:05:47 1993 David J. Mackenzie (djm@thepub.cygnus.com)
-
- * getopt.h, obstack.h: Update to latest FSF version.
-
-Mon Aug 2 16:37:14 1993 Stu Grossman (grossman at cygnus.com)
-
- * coff/i386.h: Add Lynx magic number.
-
-Mon Aug 2 14:45:29 1993 John Gilmore (gnu@cygnus.com)
-
- * dis-asm.h: Move enum outside of struct defn to avoid warnings.
-
-Mon Aug 2 08:49:30 1993 Stu Grossman (grossman at cygnus.com)
-
- * wait.h (WEXITSTATUS, WSTOPSIG): Mask down to 8 bits. This is
- for systems that store stuff into the high 16 bits of a wait
- status.
-
-Fri Jul 30 18:38:02 1993 John Gilmore (gnu@cygnus.com)
-
- * dis-asm.h: Add new fields insn_info_valid, branch_delay_insns,
- data_size, insn_type, target, target2. These are used to return
- information from the instruction decoders back to the calling
- program. Add comments, make more readable.
-
-Mon Jul 19 22:14:14 1993 Fred Fish (fnf@deneb.cygnus.com)
-
- * nlm: New directory containing NLM/NetWare includes.
-
-Thu Jul 15 12:10:04 1993 Ken Raeburn (raeburn@cambridge.cygnus.com)
-
- * dis-asm.h (struct disassemble_info): New field application_data.
-
-Thu Jul 15 12:41:15 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
-
- * dis-asm.h: Added declaration of print_insn_m88k.
-
-Thu Jul 8 09:05:26 1993 Doug Evans (dje@canuck.cygnus.com)
-
- * opcode/h8300.h: Lots of little fixes for the h8/300h.
-
-Fri Jul 2 10:31:59 1993 Ian Lance Taylor (ian@cygnus.com)
-
- * ansidecl.h: Use ANSI macros if __mips and _SYSTYPE_SVR4 are
- defined, since RISC/OS cc handles ANSI declarations in SVR4 mode
- but does not define __STDC__.
-
-Sun Jun 20 18:27:52 1993 Ken Raeburn (raeburn@poseidon.cygnus.com)
-
- * dis-asm.h: Don't need to include ansidecl.h any more.
-
-Fri Jun 18 03:22:10 1993 John Gilmore (gnu@cygnus.com)
-
- * oasys.h: Eliminate "int8_type", "int16_type", "int32_type", and
- their variants. These changes are coordinated with corresponding
- changes in ../bfd/oasys.c.
-
-Wed Jun 16 10:43:08 1993 Fred Fish (fnf@cygnus.com)
-
- * bfd.h: Note that it has been removed.
-
-Tue Jun 8 12:16:03 1993 Steve Chamberlain (sac@phydeaux.cygnus.com)
-
- Support for H8/300-H
- * dis-asm.h (print_insn_h8300, print_insn_h8300h): Declare it.
- * coff/h8300.h: New magic number.
- * coff/internal.h: New relocations.
- * opcode/h8300.h: Lots of new opcodes.
-
-Tue Jun 1 07:35:03 1993 Ken Raeburn (raeburn@kr-pc.cygnus.com)
-
- * ansidecl.h (const): Don't define it if it's already defined.
-
-Thu May 27 18:19:51 1993 Ken Raeburn (raeburn@cambridge.cygnus.com)
-
- * dis-asm.h (print_insn_hppa): Declare it.
-
- * bfd.h: Moved to bfd directory. Small stub here includes it
- without requiring "-I../bfd".
-
-Thu Apr 29 12:06:13 1993 Ken Raeburn (raeburn@deneb.cygnus.com)
-
- * bfd.h: Updated with BSF_FUNCTION.
-
-Mon Apr 26 18:15:50 1993 Steve Chamberlain (sac@thepub.cygnus.com)
-
- * bfd.h, dis-asm.h: Updated with Hitachi SH.
-
-Fri Apr 23 18:41:38 1993 Steve Chamberlain (sac@thepub.cygnus.com)
-
- * bfd.h: Updated with alpha changes.
- * dis-asm.h: Added alpha.
-
-Fri Apr 16 17:35:30 1993 Jim Kingdon (kingdon@cygnus.com)
-
- * bfd.h: Update for signed bfd_*get_*.
-
-Thu Apr 15 09:24:21 1993 Jim Kingdon (kingdon@cygnus.com)
-
- * bfd.h: Updated for file_truncated error.
-
-Thu Apr 8 10:53:47 1993 Ian Lance Taylor (ian@cygnus.com)
-
- * ansidecl.h: If no ANSI, define const to be empty.
-
-Thu Apr 1 09:00:10 1993 Jim Kingdon (kingdon@cygnus.com)
-
- * dis-asm.h: Declare a29k and i960 print_insn_*.
-
- * dis-asm.h: Add print_address_func and related stuff.
-
- * dis-asm.h (dis_asm_read_memory): Fix prototype.
-
-Wed Mar 31 17:40:16 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
-
- * dis-asm.h: Add print_insn_sparc.
-
-Wed Mar 31 17:51:42 1993 Ian Lance Taylor (ian@cygnus.com)
-
- * bfd.h: Updated for BFD_RELOC_MIPS_GPREL and bfd_[gs]et_gp_size
- prototypes.
-
-Wed Mar 31 16:35:12 1993 Stu Grossman (grossman@cygnus.com)
-
- * dis-asm.h: (disassemble_info): Fix typo in prototype of
- dis_asm_memory_error().
-
-Tue Mar 30 19:09:23 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
-
- * dis-asm.h (disassembler_info): Add read_memory_func,
- memory_error_func, buffer, and length.
- ({GDB_,}INIT_DISASSEMBLE_INFO): Set them.
- print_insn_*: Remove second argument.
-
-Tue Mar 30 14:48:55 1993 Steve Chamberlain (sac@thepub.cygnus.com)
-
- * bfd.h: Update for lma field of section.
-
-Tue Mar 30 12:22:55 1993 Jim Kingdon (kingdon@cygnus.com)
-
- * ansidecl.h: Use ANSI versions on AIX regardless of __STDC__.
-
-Fri Mar 19 14:49:49 1993 Steve Chamberlain (sac@thepub.cygnus.com)
-
- * dis-asm.h: Add h8500.
-
-Thu Mar 18 13:49:09 1993 Per Bothner (bothner@rtl.cygnus.com)
-
- * ieee-float.h: Moved from ../gdb.
- * dis-asm.h: New file. Interface to dis-assembler.
-
-Thu Mar 11 10:52:57 1993 Fred Fish (fnf@cygnus.com)
-
- * demangle.h (DMGL_NO_OPTS): Add define (set to 0) to use
- in place of bare 0, for readability reasons.
-
-Tue Mar 2 17:50:11 1993 Fred Fish (fnf@cygnus.com)
-
- * demangle.h: Replace all references to cfront with ARM.
-
-Tue Feb 23 12:21:14 1993 Ian Lance Taylor (ian@cygnus.com)
-
- * bfd.h: Update for new elements in JUMP_TABLE.
-
-Tue Feb 16 00:51:30 1993 John Gilmore (gnu@cygnus.com)
-
- * bfd.h: Update for BFD_VERSION 2.1.
-
-Tue Jan 26 11:49:20 1993 Ian Lance Taylor (ian@cygnus.com)
-
- * bfd.h: Update for SEC_IS_COMMON flag.
-
-Tue Jan 19 12:25:12 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
-
- * bfd.h: Update for bfd_asymbol_value bug fix.
-
-Fri Jan 8 16:37:18 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
-
- * bfd.h: Update to include ECOFF tdata and target_flavour.
-
-Sun Dec 27 17:52:30 1992 Fred Fish (fnf@cygnus.com)
-
- * bfd.h: Add declaration for bfd_get_size().
-
-Tue Dec 22 22:42:46 1992 Fred Fish (fnf@cygnus.com)
-
- * demangle.h: Protect file from multiple inclusions with
- #if !defined(DEMANGLE_H)...#define DEMANGLE_H...#endif.
-
-Mon Dec 21 21:25:50 1992 Stu Grossman (grossman at cygnus.com)
-
- * bfd.h: Update to get hppa_core_struct from bfd.c.
-
-Thu Dec 17 00:42:35 1992 John Gilmore (gnu@cygnus.com)
-
- * bfd.h: Update to get tekhex tdata name change from bfd.
-
-Mon Nov 9 23:55:42 1992 John Gilmore (gnu@cygnus.com)
-
- * ansidecl.h: Update comments to discourage use of EXFUN.
-
-Thu Nov 5 16:35:44 1992 Ian Lance Taylor (ian@cygnus.com)
-
- * bfd.h: Update to bring in SEC_SHARED_LIBRARY.
-
-Thu Nov 5 03:21:32 1992 John Gilmore (gnu@cygnus.com)
-
- * bfd.h: Update to match EXFUN, bfd_seclet_struct, and SDEF
- cleanups in bfd.
-
-Wed Nov 4 07:28:05 1992 Ken Raeburn (raeburn@cygnus.com)
-
- * bout.h (N_CALLNAME, N_BALNAME): Define as char-type values, so
- widening works consistently.
-
-Fri Oct 16 03:17:08 1992 John Gilmore (gnu@cygnus.com)
-
- * getopt.h: Update to Revised Standard FSF Version.
-
-Thu Oct 15 21:43:22 1992 K. Richard Pixley (rich@sendai.cygnus.com)
-
- * getopt.h (struct option): use the provided enum for has_arg.
-
- * demangle.h (AUTO_DEMANGLING, GNU_DEMANGLING,
- LUCID_DEMANGLING): ultrix compilers require enums to be
- enums and ints to be ints and casts where they meet. cast some
- enums into ints.
-
-Thu Oct 15 04:35:51 1992 John Gilmore (gnu@cygnus.com)
-
- * bfd.h: Update after comment changes.
-
-Thu Oct 8 09:03:02 1992 Steve Chamberlain (sac@thepub.cygnus.com)
-
- * bfd.h (bfd_get_symbol_leading_char): new macro for getting in xvec
-
-Thu Sep 3 09:10:50 1992 Stu Grossman (grossman at cygnus.com)
-
- * bfd.h (struct reloc_howto_struct): size needs to be signed if
- it's going to hold negative values.
-
-Sun Aug 30 17:50:27 1992 Per Bothner (bothner@rtl.cygnus.com)
-
- * demangle.h: New file, moved from ../gdb. Made independent
- of gdb. Allow demangling style option to be passed as a
- parameter to cplus_demangle(), but using the
- current_demangling_style global as the default.
-
-Sat Aug 29 10:07:55 1992 Fred Fish (fnf@cygnus.com)
-
- * obstack.h: Merge comment change from current FSF version.
-
-Thu Aug 27 12:59:29 1992 Brendan Kehoe (brendan@cygnus.com)
-
- * bfd.h: add we32k
-
-Tue Aug 25 15:07:47 1992 Steve Chamberlain (sac@thepub.cygnus.com)
-
- * bfd.h: new after Z8000 stuff
-
-Mon Aug 17 09:01:23 1992 Ken Raeburn (raeburn@cygnus.com)
-
- * bfd.h: Regenerated after page/segment size changes.
-
-Sat Aug 1 13:46:31 1992 Fred Fish (fnf@cygnus.com)
-
- * obstack.h: Merge changes from current FSF version.
-
-Mon Jul 20 21:06:23 1992 Fred Fish (fnf@cygnus.com)
-
- * obstack.h (area_id, flags): Remove, replace with extra_arg,
- use_extra_arg, and maybe_empty_object.
- * obstack.h (OBSTACK_MAYBE_EMPTY_OBJECT, OBSTACK_MMALLOC_LIKE):
- Remove, replaced by maybe_empty_object and use_extra_arg bitfields.
- * obstack.h (obstack_full_begin, _obstack_begin): Remove area_id
- and flags arguments.
- * obstack.h (obstack_alloc_arg): New macro to set extra_arg.
-
-Thu Jul 16 08:12:44 1992 Steve Chamberlain (sac@thepub.cygnus.com)
-
- * bfd.h: new after adding BFD_IS_RELAXABLE
-
-Sat Jul 4 03:22:23 1992 John Gilmore (gnu at cygnus.com)
-
- * bfd.h: Regen after adding BSF_FILE.
-
-Mon Jun 29 14:18:36 1992 Fred Fish (fnf at sunfish)
-
- * obstack.h: Convert bcopy() use to memcpy(), which is more
- portable, more standard, and can take advantage of gcc's builtin
- functions for increased performance.
-
-Thu Jun 25 04:46:08 1992 John Gilmore (gnu at cygnus.com)
-
- * ansidecl.h (PARAMS): Incorporate this macro from gdb's defs.h.
- It's a cleaner way to forward-declare function prototypes.
-
-Fri Jun 19 15:46:32 1992 Stu Grossman (grossman at cygnus.com)
-
- * bfd.h: HPPA merge.
-
-Tue Jun 16 21:30:56 1992 K. Richard Pixley (rich@cygnus.com)
-
- * getopt.h: gratuitous white space changes merged from other prep
- releases.
-
-Thu Jun 11 01:10:55 1992 John Gilmore (gnu at cygnus.com)
-
- * bfd.h: Regen'd from bfd.c after removing elf_core_tdata_struct.
-
-Mon May 18 17:29:03 1992 K. Richard Pixley (rich@cygnus.com)
-
- * getopt.h: merged changes from make-3.62.11.
-
- * getopt.h: merged changes from grep-1.6 (alpha).
-
-Fri May 8 14:53:32 1992 K. Richard Pixley (rich@cygnus.com)
-
- * getopt.h: merged changes from bison-1.18.
-
-Sat Mar 14 17:25:20 1992 Fred Fish (fnf@cygnus.com)
-
- * obstack.h: Add "area_id" and "flags" members to obstack
- structure. Add obstack_chunkfun() and obstack_freefun() to
- set functions explicitly. Convert maybe_empty_object to
- a bit in "flags".
-
-Thu Feb 27 22:01:02 1992 Per Bothner (bothner@cygnus.com)
-
- * wait.h (WIFSTOPPED): Add IBM rs6000-specific version.
-
-Fri Feb 21 20:49:20 1992 John Gilmore (gnu at cygnus.com)
-
- * obstack.h: Add obstack_full_begin.
- * bfd.h, obstack.h: Protolint.
-
-Thu Jan 30 01:18:42 1992 John Gilmore (gnu at cygnus.com)
-
- * bfd.h: Remove comma from enum declaration.
-
-Mon Jan 27 22:01:13 1992 Steve Chamberlain (sac at cygnus.com)
-
- * bfd.h : new target entr, bfd_relax_section
-
-Wed Dec 18 17:19:44 1991 Stu Grossman (grossman at cygnus.com)
-
- * bfd.h, ieee.h, opcode/m68k.h, opcode/sparc.h: ANSIfy enums.
-
-Thu Dec 12 20:59:56 1991 John Gilmore (gnu at cygnus.com)
-
- * fopen-same.h, fopen-bin.h: New files for configuring
- whether fopen distinguishes binary files or not. For use
- by host-dependent config files.
-
-Sat Nov 30 20:46:43 1991 Steve Chamberlain (sac at rtl.cygnus.com)
-
- * bfd.h: change the documentation format.
-
- * created coff, elf and opcode and aout directories. Moved:
-
- aout64.h ==> aout/aout64.h
- ar.h ==> aout/ar.h
- a.out.encap.h ==> aout/encap.h
- a.out.host.h ==> aout/host.h
- a.out.hp.h ==> aout/hp.h
- a.out.sun4.h ==> aout/sun4.h
- ranlib.h ==> aout/ranlib.h
- reloc.h ==> aout/reloc.h
- stab.def ==> aout/stab.def
- stab.gnu.h ==> aout/stab_gnu.h
-
- coff-a29k.h ==> coff/a29k.h
- coff-h8300.h ==> coff/h8300.h
- coff-i386.h ==> coff/i386.h
- coff-i960.h ==> coff/i960.h
- internalcoff.h ==> coff/internal.h
- coff-m68k.h ==> coff/m68k.h
- coff-m88k.h ==> coff/m88k.h
- coff-mips.h ==> coff/mips.h
- coff-rs6000.h ==> coff/rs6000.h
-
- elf-common.h ==> elf/common.h
- dwarf.h ==> elf/dwarf.h
- elf-external.h ==> elf/external.h
- elf-internal.h ==> elf/internal.h
-
- a29k-opcode.h ==> opcode/a29k.h
- arm-opcode.h ==> opcode/arm.h
- h8300-opcode.h ==> opcode/h8300.h
- i386-opcode.h ==> opcode/i386.h
- i860-opcode.h ==> opcode/i860.h
- i960-opcode.h ==> opcode/i960.h
- m68k-opcode.h ==> opcode/m68k.h
- m88k-opcode.h ==> opcode/m88k.h
- mips-opcode.h ==> opcode/mips.h
- np1-opcode.h ==> opcode/np1.h
- ns32k-opcode.h ==> opcode/ns32k.h
- pn-opcode.h ==> opcode/pn.h
- pyr-opcode.h ==> opcode/pyr.h
- sparc-opcode.h ==> opcode/sparc.h
- tahoe-opcode.h ==> opcode/tahoe.h
- vax-opcode.h ==> opcode/vax.h
-
-
-
-Wed Nov 27 10:38:31 1991 Steve Chamberlain (sac at rtl.cygnus.com)
-
- * internalcoff.h: (internal_scnhdr) took out #def dependency, now
- s_nreloc and s_nlnno are always long. (internal_reloc): allways
- has an offset field now.
-
-Fri Nov 22 08:12:58 1991 John Gilmore (gnu at cygnus.com)
-
- * coff-rs6000.h: Lint; use unsigned chars for external fields.
- * internalcoff.h: Lint; cast storage classes to signed char.
-
-Thu Nov 21 21:01:05 1991 Per Bothner (bothner at cygnus.com)
-
- * stab.def: Remove the GNU extended type codes (e.g. N_SETT).
- * aout64.h: The heuristic for distinguishing between
- sunos-style and bsd-style ZMAGIC files (wrt. where the
- text segment starts) is moved into (the default definition of)
- the macro N_HEADER_IN_TEXT. This definition is only used
- if no other definition is used - e.g. bfd/newsos3.c defines
- N_HEADER_IN_TEXT(x) to be always 0 (as before).
-
-Thu Nov 21 11:53:03 1991 John Gilmore (gnu at cygnus.com)
-
- * aout64.h (N_TXTADDR, N_TXTOFF, N_TXTSIZE): New definitions
- that should handle all uses. LOGICAL_ versions deleted.
- Eliminate N_HEADER_IN_TEXT, using a_entry to determine which
- kind of zmagic a.out file we are looking at.
- * coff-rs6000.h: Typo.
-
-Tue Nov 19 18:43:37 1991 Per Bothner (bothner at cygnus.com)
-
- (Note: This is a revised entry, as was aout64.h.)
- * aout64.h: Some cleanups of N_TXTADDR and N_TXTOFF:
- Will now work for both old- and new-style ZMAGIC files,
- depending on N_HEADER_IN_TEXT macro.
- Add LOGICAL_TXTADDR, LOICAL_TXTOFF and LOGICAL_TXTSIZE
- that don't count the exec header as part
- of the text segment, to be consistent with bfd.
- * a.out.sun4.h: Simplified/fixed for previous change.
-
-Mon Nov 18 00:02:06 1991 Fred Fish (fnf at cygnus.com)
-
- * dwarf.h: Update to DWARF draft 5 version from gcc2.
-
-Thu Nov 14 19:44:59 1991 Per Bothner (bothner at cygnus.com)
-
- * stab.def: Added defs for extended GNU symbol types,
- such as N_SETT. These are normally ifdef'd out (because
- of conflicts with a.out.gnu.h), but are used by bfb_stab_name().
-
-Thu Nov 14 19:17:03 1991 Fred Fish (fnf at cygnus.com)
-
- * elf-common.h: Add defines to support ELF symbol table code.
-
-Mon Nov 11 19:01:06 1991 Fred Fish (fnf at cygnus.com)
-
- * elf-internal.h, elf-external.h, elf-common.h: Add support for
- note sections, which are used in ELF core files to hold copies
- of various /proc structures.
-
-Thu Nov 7 08:58:26 1991 Steve Chamberlain (sac at cygnus.com)
-
- * internalcoff.h: took out the M88 dependency in the lineno
- struct.
- * coff-m88k.h: defines GET_LINENO_LNNO and PUT_LINENO_LNNO to use
- 32bit linno entries.
- * a29k-opcode.h: fixed encoding of mtacc
-
-Sun Nov 3 11:54:22 1991 Per Bothner (bothner at cygnus.com)
-
- * bfd.h: Updated from ../bfd/bfd-in.h (q.v).
-
-Fri Nov 1 11:13:53 1991 John Gilmore (gnu at cygnus.com)
-
- * internalcoff.h: Add x_csect defines.
-
-Fri Oct 25 03:18:20 1991 John Gilmore (gnu at cygnus.com)
-
- * Rename COFF-related files in `coff-ARCH.h' form.
- coff-a29k.h, coff-i386.h, coff-i960.h, coff-m68k.h, coff-m88k.h,
- coff-mips.h, coff-rs6000.h to be exact.
-
-Thu Oct 24 22:11:11 1991 John Gilmore (gnu at cygnus.com)
-
- RS/6000 support, by Metin G. Ozisik, Mimi Phûông-Thåo Võ, and
- John Gilmore.
-
- * a.out.gnu.h: Update slightly.
- * bfd.h: Add new error code, fix doc, add bfd_arch_rs6000.
- * internalcoff.h: Add more F_ codes for filehdr. Add
- rs/6000-dependent fields to aouthdr. Add storage classes
- to syments. Add 6000-specific auxent. Add r_size in reloc.
- * rs6000coff.c: New file.
-
-Thu Oct 24 04:13:20 1991 Fred Fish (fnf at cygnus.com)
-
- * dwarf.h: New file for dwarf support. Copied from gcc2
- distribution.
-
-Wed Oct 16 13:31:45 1991 John Gilmore (gnu at cygnus.com)
-
- * aout64.h: Remove PAGE_SIZE defines; they are target-dependent.
- Add N_FN_SEQ for N_FN symbol type used on Sequent machines.
- * stab.def: Include N_FN_SEQ in table.
- * bout.h: External formats of structures use unsigned chars.
-
-Fri Oct 11 12:40:43 1991 Steve Chamberlain (steve at cygnus.com)
-
- * bfd.h:upgrade from bfd.c
- * internalcoff.h: add n_name, n_zeroes and n_offset macros
- * amdcoff.h: Define OMAGIC and AOUTHDRSZ.
-
-Fri Oct 11 10:58:06 1991 Per Bothner (bothner at cygnus.com)
-
- * a.out.host.h: Change SEGMENT_SIZE to 0x1000 for Sony.
- * bfd.h (align_power): Add (actually move) comment.
-
-Tue Oct 8 15:29:32 1991 Per Bothner (bothner at cygnus.com)
-
- * sys/h-rtbsd.h: Define MISSING_VFPRINT (for binutils/bucomm.c).
-
-Sun Oct 6 19:24:39 1991 John Gilmore (gnu at cygnus.com)
-
- * aout64.h: Move struct internal_exec to ../bfd/libaout.h so
- it can be shared by all `a.out-family' code. Rename
- EXTERNAL_LIST_SIZE to EXTERNAL_NLIST_SIZE. Use basic types
- for nlist members, and make strx integral rather than pointer.
- More commentary on n_type values.
- * bout.h: Provide a struct external_exec rather than an
- internal_exec.
- * m68kcoff.h: Remove `tagentries' which snuck in from the i960
- COFF port.
-
-Fri Oct 4 01:25:59 1991 John Gilmore (gnu at cygnus.com)
-
- * h8300-opcode.h: Remove `_enum' from the typedef for an enum.
- * bfd.h: Update to match bfd changes.
-
- * sys/h-i386mach.h, sysdep.h: Add 386 Mach host support.
-
-Tue Oct 1 04:58:42 1991 John Gilmore (gnu at cygnus.com)
-
- * bfd.h, elf-common.h, elf-external.h, elf-internal.h:
- Add preliminary ELF support, sufficient for GDB, from Fred Fish.
- * sysdep.h, sys/h-amix.h: Support Amiga SVR4.
-
- * sys/h-vaxult.h: Make it work. (David Taylor <taylor@think.com>)
- * a.out.vax.h: Remove unused and confusing file.
-
-Mon Sep 30 12:52:35 1991 Per Bothner (bothner at cygnus.com)
-
- * sysdep.h: Define NEWSOS3_SYS, and use it.
-
-Fri Sep 20 13:38:21 1991 John Gilmore (gnu at cygnus.com)
-
- * a.out.gnu.h (N_FN): Its value *really is* 0x1F.
- Fix it, and add comments warning about or-ing N_EXT with it
- and/or N_WARNING.
- * aout64.h (N_FN): Fix value, add comments about N_EXT.
- * stab.def (table at end): Update to show all the type
- values <0x20, including low order bits. Move N_FN to
- its rightful place.
-
-Tue Sep 17 17:41:37 1991 Stu Grossman (grossman at cygnus.com)
-
- * sys/h-irix3.h: sgi/irix support.
-
-Tue Sep 17 07:52:59 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- * stab.def (N_DEFD): Add GNU Modula-2 debug stab, from Andrew
- Beers.
-
-Thu Sep 12 14:12:59 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- * internalcoff.h (SYMNMLEN, FILNMLEN, DIMNUM): Define these
- for internalcoff, separately from the various external coff's.
- * amdcoff.h, bcs88kcoff.h, i386coff.h, intel-coff.h, m68kcoff.h,
- m88k-bcs.h: Prefix SYMNMLEN, FILNMLEN, and DIMNUM with E_'s for
- the external struct definitions.
- * ecoff.h: Remove these #define's, kludge no longer needed.
-
- * sys/h-ultra3.h: Add new Ultracomputer host.
- * sysdep.h: Add ULTRA3_SYM1_SYS and use it.
-
-Tue Sep 10 10:11:46 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- * i386coff.h (LINESZ): Always 6, not based on sizeof().
- (Fix from Peter Schauer <pes@regent.e-technik.tu-muenchen.de>.)
-
-Wed Sep 4 08:58:37 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- * a.out.gnu.h, aout64.h: Add N_WARNING. Change N_FN to 0x0E,
- to match SunOS and BSD. Add N_COMM as 0x12 for SunOS shared lib
- support.
- * stab.def: Add N_COMM to table, fix overlap comment.
-
-Tue Sep 3 06:29:20 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- Merge with latest FSF versions of these files.
-
- * stab.gnu.h: Add LAST_UNUSED_STAB_CODE.
- * stab.def: Update to GPL2. Move N_WARNING out, since not a
- debug symbol. Change comments, and reorder table to numeric
- order. Update final table comment.
- (N_DSLINE, N_BSLINE): Renumber from 0x66 and 0x68, to 0x46 and 0x48.
-
- * obstack.h: GPL2. Merge.
-
-Fri Aug 23 01:54:23 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- * a.out.gnu.h, a.out.sun4.h: Make SEGMENT_SIZE able to depend
- on the particular a.out being examined.
- * a.out.sun4.h: Define segment sizes for Sun-3's and Sun-4's.
- * FIXME: a.out.gnu.h is almost obsolete.
- * FIXME: a.out.sun4.h should be renamed a.out.sun.h now.
-
-Wed Aug 21 20:32:13 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- * Start a ChangeLog for the includes directory.
-
- * a.out.gnu.h (N_FN): Fix value -- was 15, should be 0x1E.
- * stab.def: Update allocation table in comments at end,
- to reflect reality as I know it.
-
-
-Local Variables:
-mode: indented-text
-left-margin: 8
-fill-column: 74
-version-control: never
-End:
diff --git a/contrib/libg++/include/ansidecl.h b/contrib/libg++/include/ansidecl.h
deleted file mode 100644
index be04e42d56a3..000000000000
--- a/contrib/libg++/include/ansidecl.h
+++ /dev/null
@@ -1,141 +0,0 @@
-/* ANSI and traditional C compatability macros
- Copyright 1991, 1992 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
-This program 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 of the License, or
-(at your option) any later version.
-
-This program 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 program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-/* ANSI and traditional C compatibility macros
-
- ANSI C is assumed if __STDC__ is #defined.
-
- Macro ANSI C definition Traditional C definition
- ----- ---- - ---------- ----------- - ----------
- PTR `void *' `char *'
- LONG_DOUBLE `long double' `double'
- VOLATILE `volatile' `'
- SIGNED `signed' `'
- PTRCONST `void *const' `char *'
- ANSI_PROTOTYPES 1 not defined
-
- CONST is also defined, but is obsolete. Just use const.
-
- DEFUN (name, arglist, args)
-
- Defines function NAME.
-
- ARGLIST lists the arguments, separated by commas and enclosed in
- parentheses. ARGLIST becomes the argument list in traditional C.
-
- ARGS list the arguments with their types. It becomes a prototype in
- ANSI C, and the type declarations in traditional C. Arguments should
- be separated with `AND'. For functions with a variable number of
- arguments, the last thing listed should be `DOTS'.
-
- DEFUN_VOID (name)
-
- Defines a function NAME, which takes no arguments.
-
- obsolete -- EXFUN (name, (prototype)) -- obsolete.
-
- Replaced by PARAMS. Do not use; will disappear someday soon.
- Was used in external function declarations.
- In ANSI C it is `NAME PROTOTYPE' (so PROTOTYPE should be enclosed in
- parentheses). In traditional C it is `NAME()'.
- For a function that takes no arguments, PROTOTYPE should be `(void)'.
-
- PARAMS ((args))
-
- We could use the EXFUN macro to handle prototype declarations, but
- the name is misleading and the result is ugly. So we just define a
- simple macro to handle the parameter lists, as in:
-
- static int foo PARAMS ((int, char));
-
- This produces: `static int foo();' or `static int foo (int, char);'
-
- EXFUN would have done it like this:
-
- static int EXFUN (foo, (int, char));
-
- but the function is not external...and it's hard to visually parse
- the function name out of the mess. EXFUN should be considered
- obsolete; new code should be written to use PARAMS.
-
- For example:
- extern int printf PARAMS ((CONST char *format DOTS));
- int DEFUN(fprintf, (stream, format),
- FILE *stream AND CONST char *format DOTS) { ... }
- void DEFUN_VOID(abort) { ... }
-*/
-
-#ifndef _ANSIDECL_H
-
-#define _ANSIDECL_H 1
-
-
-/* Every source file includes this file,
- so they will all get the switch for lint. */
-/* LINTLIBRARY */
-
-
-#if defined (__STDC__) || defined (_AIX) || (defined (__mips) && defined (_SYSTYPE_SVR4)) || defined(WIN32)
-/* 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 PTR void *
-#define PTRCONST void *CONST
-#define LONG_DOUBLE long double
-
-#define AND ,
-#define NOARGS void
-#define CONST const
-#define VOLATILE volatile
-#define SIGNED signed
-#define DOTS , ...
-
-#define EXFUN(name, proto) name proto
-#define DEFUN(name, arglist, args) name(args)
-#define DEFUN_VOID(name) name(void)
-
-#define PROTO(type, name, arglist) type name arglist
-#define PARAMS(paramlist) paramlist
-#define ANSI_PROTOTYPES 1
-
-#else /* Not ANSI C. */
-
-#define PTR char *
-#define PTRCONST PTR
-#define LONG_DOUBLE double
-
-#define AND ;
-#define NOARGS
-#define CONST
-#ifndef const /* some systems define it in header files for non-ansi mode */
-#define const
-#endif
-#define VOLATILE
-#define SIGNED
-#define DOTS
-
-#define EXFUN(name, proto) name()
-#define DEFUN(name, arglist, args) name arglist args;
-#define DEFUN_VOID(name) name()
-#define PROTO(type, name, arglist) type name ()
-#define PARAMS(paramlist) ()
-
-#endif /* ANSI C. */
-
-#endif /* ansidecl.h */
diff --git a/contrib/libg++/include/demangle.h b/contrib/libg++/include/demangle.h
deleted file mode 100644
index b0254af05f76..000000000000
--- a/contrib/libg++/include/demangle.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/* Defs for interface to demanglers.
- Copyright 1992, 1995, 1996 Free Software Foundation, Inc.
-
- This program 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 program 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 program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-
-#if !defined (DEMANGLE_H)
-#define DEMANGLE_H
-
-#ifdef IN_GCC
-#include "gansidecl.h"
-#define PARAMS(ARGS) PROTO(ARGS)
-#else /* ! IN_GCC */
-#include <ansidecl.h>
-#endif /* IN_GCC */
-
-/* Options passed to cplus_demangle (in 2nd parameter). */
-
-#define DMGL_NO_OPTS 0 /* For readability... */
-#define DMGL_PARAMS (1 << 0) /* Include function args */
-#define DMGL_ANSI (1 << 1) /* Include const, volatile, etc */
-
-#define DMGL_AUTO (1 << 8)
-#define DMGL_GNU (1 << 9)
-#define DMGL_LUCID (1 << 10)
-#define DMGL_ARM (1 << 11)
-/* If none of these are set, use 'current_demangling_style' as the default. */
-#define DMGL_STYLE_MASK (DMGL_AUTO|DMGL_GNU|DMGL_LUCID|DMGL_ARM)
-
-/* Enumeration of possible demangling styles.
-
- Lucid and ARM styles are still kept logically distinct, even though
- they now both behave identically. The resulting style is actual the
- union of both. I.E. either style recognizes both "__pt__" and "__rf__"
- for operator "->", even though the first is lucid style and the second
- is ARM style. (FIXME?) */
-
-extern enum demangling_styles
-{
- unknown_demangling = 0,
- auto_demangling = DMGL_AUTO,
- gnu_demangling = DMGL_GNU,
- lucid_demangling = DMGL_LUCID,
- arm_demangling = DMGL_ARM
-} current_demangling_style;
-
-/* Define string names for the various demangling styles. */
-
-#define AUTO_DEMANGLING_STYLE_STRING "auto"
-#define GNU_DEMANGLING_STYLE_STRING "gnu"
-#define LUCID_DEMANGLING_STYLE_STRING "lucid"
-#define ARM_DEMANGLING_STYLE_STRING "arm"
-
-/* Some macros to test what demangling style is active. */
-
-#define CURRENT_DEMANGLING_STYLE current_demangling_style
-#define AUTO_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_AUTO)
-#define GNU_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_GNU)
-#define LUCID_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_LUCID)
-#define ARM_DEMANGLING (CURRENT_DEMANGLING_STYLE & DMGL_ARM)
-
-extern char *
-cplus_demangle PARAMS ((const char *mangled, int options));
-
-extern int
-cplus_demangle_opname PARAMS ((const char *opname, char *result, int options));
-
-extern const char *
-cplus_mangle_opname PARAMS ((const char *opname, int options));
-
-/* Note: This sets global state. FIXME if you care about multi-threading. */
-
-extern void
-set_cplus_marker_for_demangling PARAMS ((int ch));
-
-#endif /* DEMANGLE_H */
diff --git a/contrib/libg++/include/floatformat.h b/contrib/libg++/include/floatformat.h
deleted file mode 100644
index 01e3dcb2944d..000000000000
--- a/contrib/libg++/include/floatformat.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/* IEEE floating point support declarations, for GDB, the GNU Debugger.
- Copyright (C) 1991 Free Software Foundation, Inc.
-
-This file is part of GDB.
-
-This program 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 of the License, or
-(at your option) any later version.
-
-This program 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 program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#if !defined (FLOATFORMAT_H)
-#define FLOATFORMAT_H 1
-
-#include "ansidecl.h"
-
-/* A floatformat consists of a sign bit, an exponent and a mantissa. Once the
- bytes are concatenated according to the byteorder flag, then each of those
- fields is contiguous. We number the bits with 0 being the most significant
- (i.e. BITS_BIG_ENDIAN type numbering), and specify which bits each field
- contains with the *_start and *_len fields. */
-
-enum floatformat_byteorders { floatformat_little, floatformat_big };
-
-enum floatformat_intbit { floatformat_intbit_yes, floatformat_intbit_no };
-
-struct floatformat
-{
- enum floatformat_byteorders byteorder;
- unsigned int totalsize; /* Total size of number in bits */
-
- /* Sign bit is always one bit long. 1 means negative, 0 means positive. */
- unsigned int sign_start;
-
- unsigned int exp_start;
- unsigned int exp_len;
- /* Amount added to "true" exponent. 0x3fff for many IEEE extendeds. */
- unsigned int exp_bias;
- /* Exponent value which indicates NaN. This is the actual value stored in
- the float, not adjusted by the exp_bias. This usually consists of all
- one bits. */
- unsigned int exp_nan;
-
- unsigned int man_start;
- unsigned int man_len;
-
- /* Is the integer bit explicit or implicit? */
- enum floatformat_intbit intbit;
-};
-
-/* floatformats for IEEE single and double, big and little endian. */
-
-extern const struct floatformat floatformat_ieee_single_big;
-extern const struct floatformat floatformat_ieee_single_little;
-extern const struct floatformat floatformat_ieee_double_big;
-extern const struct floatformat floatformat_ieee_double_little;
-
-/* floatformats for various extendeds. */
-
-extern const struct floatformat floatformat_i387_ext;
-extern const struct floatformat floatformat_m68881_ext;
-extern const struct floatformat floatformat_i960_ext;
-extern const struct floatformat floatformat_m88110_ext;
-extern const struct floatformat floatformat_arm_ext;
-
-/* Convert from FMT to a double.
- FROM is the address of the extended float.
- Store the double in *TO. */
-
-extern void
-floatformat_to_double PARAMS ((const struct floatformat *, char *, double *));
-
-/* The converse: convert the double *FROM to FMT
- and store where TO points. */
-
-extern void
-floatformat_from_double PARAMS ((const struct floatformat *,
- double *, char *));
-
-#endif /* defined (FLOATFORMAT_H) */
diff --git a/contrib/libg++/include/getopt.h b/contrib/libg++/include/getopt.h
deleted file mode 100644
index abf915383200..000000000000
--- a/contrib/libg++/include/getopt.h
+++ /dev/null
@@ -1,129 +0,0 @@
-/* Declarations for getopt.
- Copyright (C) 1989, 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
-
- This program 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, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public License
- along with this program; if not, write to the Free Software
- Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#ifndef _GETOPT_H
-#define _GETOPT_H 1
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* For communication from `getopt' to the caller.
- When `getopt' finds an option that takes an argument,
- the argument value is returned here.
- Also, when `ordering' is RETURN_IN_ORDER,
- each non-option ARGV-element is returned here. */
-
-extern char *optarg;
-
-/* Index in ARGV of the next element to be scanned.
- This is used for communication to and from the caller
- and for communication between successive calls to `getopt'.
-
- On entry to `getopt', zero means this is the first call; initialize.
-
- When `getopt' returns EOF, this is the index of the first of the
- non-option elements that the caller should itself scan.
-
- Otherwise, `optind' communicates from one call to the next
- how much of ARGV has been scanned so far. */
-
-extern int optind;
-
-/* Callers store zero here to inhibit the error message `getopt' prints
- for unrecognized options. */
-
-extern int opterr;
-
-/* Set to an option character which was unrecognized. */
-
-extern int optopt;
-
-/* Describe the long-named options requested by the application.
- The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector
- of `struct option' terminated by an element containing a name which is
- zero.
-
- The field `has_arg' is:
- no_argument (or 0) if the option does not take an argument,
- required_argument (or 1) if the option requires an argument,
- optional_argument (or 2) if the option takes an optional argument.
-
- If the field `flag' is not NULL, it points to a variable that is set
- to the value given in the field `val' when the option is found, but
- left unchanged if the option is not found.
-
- To have a long-named option do something other than set an `int' to
- a compiled-in constant, such as set a value from `optarg', set the
- option's `flag' field to zero and its `val' field to a nonzero
- value (the equivalent single-letter option character, if there is
- one). For long options that have a zero `flag' field, `getopt'
- returns the contents of the `val' field. */
-
-struct option
-{
-#if __STDC__
- const char *name;
-#else
- char *name;
-#endif
- /* has_arg can't be an enum because some compilers complain about
- type mismatches in all the code that assumes it is an int. */
- int has_arg;
- int *flag;
- int val;
-};
-
-/* Names for the values of the `has_arg' field of `struct option'. */
-
-#define no_argument 0
-#define required_argument 1
-#define optional_argument 2
-
-#if __STDC__
-#if defined(__GNU_LIBRARY__)
-/* Many other libraries have conflicting prototypes for getopt, with
- differences in the consts, in stdlib.h. To avoid compilation
- errors, only prototype getopt for the GNU C library. */
-extern int getopt (int argc, char *const *argv, const char *shortopts);
-#else /* not __GNU_LIBRARY__ */
-extern int getopt ();
-#endif /* not __GNU_LIBRARY__ */
-extern int getopt_long (int argc, char *const *argv, const char *shortopts,
- const struct option *longopts, int *longind);
-extern int getopt_long_only (int argc, char *const *argv,
- const char *shortopts,
- const struct option *longopts, int *longind);
-
-/* Internal only. Users should not call this directly. */
-extern int _getopt_internal (int argc, char *const *argv,
- const char *shortopts,
- const struct option *longopts, int *longind,
- int long_only);
-#else /* not __STDC__ */
-extern int getopt ();
-extern int getopt_long ();
-extern int getopt_long_only ();
-
-extern int _getopt_internal ();
-#endif /* not __STDC__ */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _GETOPT_H */
diff --git a/contrib/libg++/include/libiberty.h b/contrib/libg++/include/libiberty.h
deleted file mode 100644
index 9e290125eed0..000000000000
--- a/contrib/libg++/include/libiberty.h
+++ /dev/null
@@ -1,137 +0,0 @@
-/* Function declarations for libiberty.
- Written by Cygnus Support, 1994.
-
- The libiberty library provides a number of functions which are
- missing on some operating systems. We do not declare those here,
- to avoid conflicts with the system header files on operating
- systems that do support those functions. In this file we only
- declare those functions which are specific to libiberty. */
-
-#ifndef LIBIBERTY_H
-#define LIBIBERTY_H
-
-#include "ansidecl.h"
-
-/* Build an argument vector from a string. Allocates memory using
- malloc. Use freeargv to free the vector. */
-
-extern char **buildargv PARAMS ((char *));
-
-/* Free a vector returned by buildargv. */
-
-extern void freeargv PARAMS ((char **));
-
-/* Return the last component of a path name. */
-
-extern char *basename ();
-
-/* Concatenate an arbitrary number of strings, up to (char *) NULL.
- Allocates memory using xmalloc. */
-
-extern char *concat PARAMS ((const char *, ...));
-
-/* Check whether two file descriptors refer to the same file. */
-
-extern int fdmatch PARAMS ((int fd1, int fd2));
-
-/* Get the amount of time the process has run, in microseconds. */
-
-extern long get_run_time PARAMS ((void));
-
-/* Choose a temporary directory to use for scratch files. */
-
-extern char *choose_temp_base PARAMS ((void));
-
-/* Allocate memory filled with spaces. Allocates using malloc. */
-
-extern const char *spaces PARAMS ((int count));
-
-/* Return the maximum error number for which strerror will return a
- string. */
-
-extern int errno_max PARAMS ((void));
-
-/* Return the name of an errno value (e.g., strerrno (EINVAL) returns
- "EINVAL"). */
-
-extern const char *strerrno PARAMS ((int));
-
-/* Given the name of an errno value, return the value. */
-
-extern int strtoerrno PARAMS ((const char *));
-
-/* ANSI's strerror(), but more robust. */
-
-extern char *xstrerror PARAMS ((int));
-
-/* Return the maximum signal number for which strsignal will return a
- string. */
-
-extern int signo_max PARAMS ((void));
-
-/* Return a signal message string for a signal number
- (e.g., strsignal (SIGHUP) returns something like "Hangup"). */
-/* This is commented out as it can conflict with one in system headers.
- We still document its existence though. */
-
-/*extern const char *strsignal PARAMS ((int));*/
-
-/* Return the name of a signal number (e.g., strsigno (SIGHUP) returns
- "SIGHUP"). */
-
-extern const char *strsigno PARAMS ((int));
-
-/* Given the name of a signal, return its number. */
-
-extern int strtosigno PARAMS ((const char *));
-
-/* Register a function to be run by xexit. Returns 0 on success. */
-
-extern int xatexit PARAMS ((void (*fn) (void)));
-
-/* Exit, calling all the functions registered with xatexit. */
-
-#ifndef __GNUC__
-extern void xexit PARAMS ((int status));
-#else
-typedef void libiberty_voidfn PARAMS ((int status));
-__volatile__ libiberty_voidfn xexit;
-#endif
-
-/* Set the program name used by xmalloc. */
-
-extern void xmalloc_set_program_name PARAMS ((const char *));
-
-/* Allocate memory without fail. If malloc fails, this will print a
- message to stderr (using the name set by xmalloc_set_program_name,
- if any) and then call xexit.
-
- FIXME: We do not declare the parameter type (size_t) in order to
- avoid conflicts with other declarations of xmalloc that exist in
- programs which use libiberty. */
-
-extern PTR xmalloc ();
-
-/* Reallocate memory without fail. This works like xmalloc.
-
- FIXME: We do not declare the parameter types for the same reason as
- xmalloc. */
-
-extern PTR xrealloc ();
-
-/* Copy a string into a memory buffer without fail. */
-
-extern char *xstrdup PARAMS ((const char *));
-
-/* hex character manipulation routines */
-
-#define _hex_array_size 256
-#define _hex_bad 99
-extern char _hex_value[_hex_array_size];
-extern void hex_init PARAMS ((void));
-#define hex_p(c) (hex_value (c) != _hex_bad)
-/* If you change this, note well: Some code relies on side effects in
- the argument being performed exactly once. */
-#define hex_value(c) (_hex_value[(unsigned char) (c)])
-
-#endif /* ! defined (LIBIBERTY_H) */
diff --git a/contrib/libg++/include/obstack.h b/contrib/libg++/include/obstack.h
deleted file mode 100644
index 416b8bf53151..000000000000
--- a/contrib/libg++/include/obstack.h
+++ /dev/null
@@ -1,518 +0,0 @@
-/* obstack.h - object stack macros
- Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 95, 96 Free Software Foundation, Inc.
-
-This program 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, or (at your option) any
-later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU Library General Public License for more details.
-
-You should have received a copy of the GNU Library General Public License
-along with this program; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-/* Summary:
-
-All the apparent functions defined here are macros. The idea
-is that you would use these pre-tested macros to solve a
-very specific set of problems, and they would run fast.
-Caution: no side-effects in arguments please!! They may be
-evaluated MANY times!!
-
-These macros operate a stack of objects. Each object starts life
-small, and may grow to maturity. (Consider building a word syllable
-by syllable.) An object can move while it is growing. Once it has
-been "finished" it never changes address again. So the "top of the
-stack" is typically an immature growing object, while the rest of the
-stack is of mature, fixed size and fixed address objects.
-
-These routines grab large chunks of memory, using a function you
-supply, called `obstack_chunk_alloc'. On occasion, they free chunks,
-by calling `obstack_chunk_free'. You must define them and declare
-them before using any obstack macros.
-
-Each independent stack is represented by a `struct obstack'.
-Each of the obstack macros expects a pointer to such a structure
-as the first argument.
-
-One motivation for this package is the problem of growing char strings
-in symbol tables. Unless you are "fascist pig with a read-only mind"
---Gosper's immortal quote from HAKMEM item 154, out of context--you
-would not like to put any arbitrary upper limit on the length of your
-symbols.
-
-In practice this often means you will build many short symbols and a
-few long symbols. At the time you are reading a symbol you don't know
-how long it is. One traditional method is to read a symbol into a
-buffer, realloc()ating the buffer every time you try to read a symbol
-that is longer than the buffer. This is beaut, but you still will
-want to copy the symbol from the buffer to a more permanent
-symbol-table entry say about half the time.
-
-With obstacks, you can work differently. Use one obstack for all symbol
-names. As you read a symbol, grow the name in the obstack gradually.
-When the name is complete, finalize it. Then, if the symbol exists already,
-free the newly read name.
-
-The way we do this is to take a large chunk, allocating memory from
-low addresses. When you want to build a symbol in the chunk you just
-add chars above the current "high water mark" in the chunk. When you
-have finished adding chars, because you got to the end of the symbol,
-you know how long the chars are, and you can create a new object.
-Mostly the chars will not burst over the highest address of the chunk,
-because you would typically expect a chunk to be (say) 100 times as
-long as an average object.
-
-In case that isn't clear, when we have enough chars to make up
-the object, THEY ARE ALREADY CONTIGUOUS IN THE CHUNK (guaranteed)
-so we just point to it where it lies. No moving of chars is
-needed and this is the second win: potentially long strings need
-never be explicitly shuffled. Once an object is formed, it does not
-change its address during its lifetime.
-
-When the chars burst over a chunk boundary, we allocate a larger
-chunk, and then copy the partly formed object from the end of the old
-chunk to the beginning of the new larger chunk. We then carry on
-accreting characters to the end of the object as we normally would.
-
-A special macro is provided to add a single char at a time to a
-growing object. This allows the use of register variables, which
-break the ordinary 'growth' macro.
-
-Summary:
- We allocate large chunks.
- We carve out one object at a time from the current chunk.
- Once carved, an object never moves.
- We are free to append data of any size to the currently
- growing object.
- Exactly one object is growing in an obstack at any one time.
- You can run one obstack per control block.
- You may have as many control blocks as you dare.
- Because of the way we do it, you can `unwind' an obstack
- back to a previous state. (You may remove objects much
- as you would with a stack.)
-*/
-
-
-/* Don't do the contents of this file more than once. */
-
-#ifndef __OBSTACK_H__
-#define __OBSTACK_H__
-
-/* We use subtraction of (char *)0 instead of casting to int
- because on word-addressable machines a simple cast to int
- may ignore the byte-within-word field of the pointer. */
-
-#ifndef __PTR_TO_INT
-#define __PTR_TO_INT(P) ((P) - (char *)0)
-#endif
-
-#ifndef __INT_TO_PTR
-#define __INT_TO_PTR(P) ((P) + (char *)0)
-#endif
-
-/* We need the type of the resulting object. In ANSI C it is ptrdiff_t
- but in traditional C it is usually long. If we are in ANSI C and
- don't already have ptrdiff_t get it. */
-
-#if defined (__STDC__) && ! defined (offsetof)
-#if defined (__GNUC__) && defined (IN_GCC)
-/* On Next machine, the system's stddef.h screws up if included
- after we have defined just ptrdiff_t, so include all of stddef.h.
- Otherwise, define just ptrdiff_t, which is all we need. */
-#ifndef __NeXT__
-#define __need_ptrdiff_t
-#endif
-#endif
-
-#include <stddef.h>
-#endif
-
-#ifdef __STDC__
-#define PTR_INT_TYPE ptrdiff_t
-#else
-#define PTR_INT_TYPE long
-#endif
-
-struct _obstack_chunk /* Lives at front of each chunk. */
-{
- char *limit; /* 1 past end of this chunk */
- struct _obstack_chunk *prev; /* address of prior chunk or NULL */
- char contents[4]; /* objects begin here */
-};
-
-struct obstack /* control current object in current chunk */
-{
- long chunk_size; /* preferred size to allocate chunks in */
- struct _obstack_chunk* chunk; /* address of current struct obstack_chunk */
- char *object_base; /* address of object we are building */
- char *next_free; /* where to add next char to current object */
- char *chunk_limit; /* address of char after current chunk */
- PTR_INT_TYPE temp; /* Temporary for some macros. */
- int alignment_mask; /* Mask of alignment for each object. */
- struct _obstack_chunk *(*chunkfun) (); /* User's fcn to allocate a chunk. */
- void (*freefun) (); /* User's function to free a chunk. */
- char *extra_arg; /* first arg for chunk alloc/dealloc funcs */
- unsigned use_extra_arg:1; /* chunk alloc/dealloc funcs take extra arg */
- unsigned maybe_empty_object:1;/* There is a possibility that the current
- chunk contains a zero-length object. This
- prevents freeing the chunk if we allocate
- a bigger chunk to replace it. */
- unsigned alloc_failed:1; /* chunk alloc func returned 0 */
-};
-
-/* Declare the external functions we use; they are in obstack.c. */
-
-#ifdef __STDC__
-extern void _obstack_newchunk (struct obstack *, int);
-extern void _obstack_free (struct obstack *, void *);
-extern int _obstack_begin (struct obstack *, int, int,
- void *(*) (), void (*) ());
-extern int _obstack_begin_1 (struct obstack *, int, int,
- void *(*) (), void (*) (), void *);
-extern int _obstack_memory_used (struct obstack *);
-#else
-extern void _obstack_newchunk ();
-extern void _obstack_free ();
-extern int _obstack_begin ();
-extern int _obstack_begin_1 ();
-extern int _obstack_memory_used ();
-#endif
-
-#ifdef __STDC__
-
-/* Do the function-declarations after the structs
- but before defining the macros. */
-
-void obstack_init (struct obstack *obstack);
-
-void * obstack_alloc (struct obstack *obstack, int size);
-
-void * obstack_copy (struct obstack *obstack, void *address, int size);
-void * obstack_copy0 (struct obstack *obstack, void *address, int size);
-
-void obstack_free (struct obstack *obstack, void *block);
-
-void obstack_blank (struct obstack *obstack, int size);
-
-void obstack_grow (struct obstack *obstack, void *data, int size);
-void obstack_grow0 (struct obstack *obstack, void *data, int size);
-
-void obstack_1grow (struct obstack *obstack, int data_char);
-void obstack_ptr_grow (struct obstack *obstack, void *data);
-void obstack_int_grow (struct obstack *obstack, int data);
-
-void * obstack_finish (struct obstack *obstack);
-
-int obstack_object_size (struct obstack *obstack);
-
-int obstack_room (struct obstack *obstack);
-void obstack_1grow_fast (struct obstack *obstack, int data_char);
-void obstack_ptr_grow_fast (struct obstack *obstack, void *data);
-void obstack_int_grow_fast (struct obstack *obstack, int data);
-void obstack_blank_fast (struct obstack *obstack, int size);
-
-void * obstack_base (struct obstack *obstack);
-void * obstack_next_free (struct obstack *obstack);
-int obstack_alignment_mask (struct obstack *obstack);
-int obstack_chunk_size (struct obstack *obstack);
-int obstack_memory_used (struct obstack *obstack);
-
-#endif /* __STDC__ */
-
-/* Non-ANSI C cannot really support alternative functions for these macros,
- so we do not declare them. */
-
-/* Pointer to beginning of object being allocated or to be allocated next.
- Note that this might not be the final address of the object
- because a new chunk might be needed to hold the final size. */
-
-#define obstack_base(h) ((h)->alloc_failed ? 0 : (h)->object_base)
-
-/* Size for allocating ordinary chunks. */
-
-#define obstack_chunk_size(h) ((h)->chunk_size)
-
-/* Pointer to next byte not yet allocated in current chunk. */
-
-#define obstack_next_free(h) ((h)->alloc_failed ? 0 : (h)->next_free)
-
-/* Mask specifying low bits that should be clear in address of an object. */
-
-#define obstack_alignment_mask(h) ((h)->alignment_mask)
-
-#define obstack_init(h) \
- _obstack_begin ((h), 0, 0, \
- (void *(*) ()) obstack_chunk_alloc, (void (*) ()) obstack_chunk_free)
-
-#define obstack_begin(h, size) \
- _obstack_begin ((h), (size), 0, \
- (void *(*) ()) obstack_chunk_alloc, (void (*) ()) obstack_chunk_free)
-
-#define obstack_specify_allocation(h, size, alignment, chunkfun, freefun) \
- _obstack_begin ((h), (size), (alignment), \
- (void *(*) ()) (chunkfun), (void (*) ()) (freefun))
-
-#define obstack_specify_allocation_with_arg(h, size, alignment, chunkfun, freefun, arg) \
- _obstack_begin_1 ((h), (size), (alignment), \
- (void *(*) ()) (chunkfun), (void (*) ()) (freefun), (arg))
-
-#define obstack_chunkfun(h, newchunkfun) \
- ((h) -> chunkfun = (struct _obstack_chunk *(*)()) (newchunkfun))
-
-#define obstack_freefun(h, newfreefun) \
- ((h) -> freefun = (void (*)()) (newfreefun))
-
-#define obstack_1grow_fast(h,achar) (*((h)->next_free)++ = achar)
-
-#define obstack_blank_fast(h,n) ((h)->next_free += (n))
-
-#define obstack_memory_used(h) _obstack_memory_used (h)
-
-#if defined (__GNUC__) && defined (__STDC__)
-#if __GNUC__ < 2
-#define __extension__
-#endif
-
-/* For GNU C, if not -traditional,
- we can define these macros to compute all args only once
- without using a global variable.
- Also, we can avoid using the `temp' slot, to make faster code. */
-
-#define obstack_object_size(OBSTACK) \
- __extension__ \
- ({ struct obstack *__o = (OBSTACK); \
- __o->alloc_failed ? 0 : \
- (unsigned) (__o->next_free - __o->object_base); })
-
-#define obstack_room(OBSTACK) \
- __extension__ \
- ({ struct obstack *__o = (OBSTACK); \
- (unsigned) (__o->chunk_limit - __o->next_free); })
-
-#define obstack_grow(OBSTACK,where,length) \
-__extension__ \
-({ struct obstack *__o = (OBSTACK); \
- int __len = (length); \
- if (__o->next_free + __len > __o->chunk_limit) \
- _obstack_newchunk (__o, __len); \
- if (!__o->alloc_failed) \
- { \
- bcopy (where, __o->next_free, __len); \
- __o->next_free += __len; \
- } \
- (void) 0; })
-
-#define obstack_grow0(OBSTACK,where,length) \
-__extension__ \
-({ struct obstack *__o = (OBSTACK); \
- int __len = (length); \
- if (__o->next_free + __len + 1 > __o->chunk_limit) \
- _obstack_newchunk (__o, __len + 1); \
- if (!__o->alloc_failed) \
- { \
- bcopy (where, __o->next_free, __len); \
- __o->next_free += __len; \
- *(__o->next_free)++ = 0; \
- } \
- (void) 0; })
-
-#define obstack_1grow(OBSTACK,datum) \
-__extension__ \
-({ struct obstack *__o = (OBSTACK); \
- if (__o->next_free + 1 > __o->chunk_limit) \
- _obstack_newchunk (__o, 1); \
- if (!__o->alloc_failed) \
- *(__o->next_free)++ = (datum); \
- (void) 0; })
-
-/* These assume that the obstack alignment is good enough for pointers or ints,
- and that the data added so far to the current object
- shares that much alignment. */
-
-#define obstack_ptr_grow(OBSTACK,datum) \
-__extension__ \
-({ struct obstack *__o = (OBSTACK); \
- if (__o->next_free + sizeof (void *) > __o->chunk_limit) \
- _obstack_newchunk (__o, sizeof (void *)); \
- if (!__o->alloc_failed) \
- *((void **)__o->next_free)++ = ((void *)datum); \
- (void) 0; })
-
-#define obstack_int_grow(OBSTACK,datum) \
-__extension__ \
-({ struct obstack *__o = (OBSTACK); \
- if (__o->next_free + sizeof (int) > __o->chunk_limit) \
- _obstack_newchunk (__o, sizeof (int)); \
- if (!__o->alloc_failed) \
- *((int *)__o->next_free)++ = ((int)datum); \
- (void) 0; })
-
-#define obstack_ptr_grow_fast(h,aptr) (*((void **)(h)->next_free)++ = (void *)aptr)
-#define obstack_int_grow_fast(h,aint) (*((int *)(h)->next_free)++ = (int)aint)
-
-#define obstack_blank(OBSTACK,length) \
-__extension__ \
-({ struct obstack *__o = (OBSTACK); \
- int __len = (length); \
- if (__o->chunk_limit - __o->next_free < __len) \
- _obstack_newchunk (__o, __len); \
- if (!__o->alloc_failed) \
- __o->next_free += __len; \
- (void) 0; })
-
-#define obstack_alloc(OBSTACK,length) \
-__extension__ \
-({ struct obstack *__h = (OBSTACK); \
- obstack_blank (__h, (length)); \
- obstack_finish (__h); })
-
-#define obstack_copy(OBSTACK,where,length) \
-__extension__ \
-({ struct obstack *__h = (OBSTACK); \
- obstack_grow (__h, (where), (length)); \
- obstack_finish (__h); })
-
-#define obstack_copy0(OBSTACK,where,length) \
-__extension__ \
-({ struct obstack *__h = (OBSTACK); \
- obstack_grow0 (__h, (where), (length)); \
- obstack_finish (__h); })
-
-/* The local variable is named __o1 to avoid a name conflict
- when obstack_blank is called. */
-#define obstack_finish(OBSTACK) \
-__extension__ \
-({ struct obstack *__o1 = (OBSTACK); \
- void *value; \
- if (__o1->alloc_failed) \
- value = 0; \
- else \
- { \
- value = (void *) __o1->object_base; \
- if (__o1->next_free == value) \
- __o1->maybe_empty_object = 1; \
- __o1->next_free \
- = __INT_TO_PTR ((__PTR_TO_INT (__o1->next_free)+__o1->alignment_mask)\
- & ~ (__o1->alignment_mask)); \
- if (__o1->next_free - (char *)__o1->chunk \
- > __o1->chunk_limit - (char *)__o1->chunk) \
- __o1->next_free = __o1->chunk_limit; \
- __o1->object_base = __o1->next_free; \
- } \
- value; })
-
-#define obstack_free(OBSTACK, OBJ) \
-__extension__ \
-({ struct obstack *__o = (OBSTACK); \
- void *__obj = (OBJ); \
- if (__obj > (void *)__o->chunk && __obj < (void *)__o->chunk_limit) \
- __o->next_free = __o->object_base = __obj; \
- else (obstack_free) (__o, __obj); })
-
-#else /* not __GNUC__ or not __STDC__ */
-
-#define obstack_object_size(h) \
- (unsigned) ((h)->alloc_failed ? 0 : (h)->next_free - (h)->object_base)
-
-#define obstack_room(h) \
- (unsigned) ((h)->chunk_limit - (h)->next_free)
-
-/* Note that the call to _obstack_newchunk is enclosed in (..., 0)
- so that we can avoid having void expressions
- in the arms of the conditional expression.
- Casting the third operand to void was tried before,
- but some compilers won't accept it. */
-
-#define obstack_grow(h,where,length) \
-( (h)->temp = (length), \
- (((h)->next_free + (h)->temp > (h)->chunk_limit) \
- ? (_obstack_newchunk ((h), (h)->temp), 0) : 0), \
- ((h)->alloc_failed ? 0 : \
- (bcopy (where, (h)->next_free, (h)->temp), \
- (h)->next_free += (h)->temp)))
-
-#define obstack_grow0(h,where,length) \
-( (h)->temp = (length), \
- (((h)->next_free + (h)->temp + 1 > (h)->chunk_limit) \
- ? (_obstack_newchunk ((h), (h)->temp + 1), 0) : 0), \
- ((h)->alloc_failed ? 0 : \
- (bcopy (where, (h)->next_free, (h)->temp), \
- (h)->next_free += (h)->temp, \
- *((h)->next_free)++ = 0)))
-
-#define obstack_1grow(h,datum) \
-( (((h)->next_free + 1 > (h)->chunk_limit) \
- ? (_obstack_newchunk ((h), 1), 0) : 0), \
- ((h)->alloc_failed ? 0 : \
- (*((h)->next_free)++ = (datum))))
-
-#define obstack_ptr_grow(h,datum) \
-( (((h)->next_free + sizeof (char *) > (h)->chunk_limit) \
- ? (_obstack_newchunk ((h), sizeof (char *)), 0) : 0), \
- ((h)->alloc_failed ? 0 : \
- (*((char **)(((h)->next_free+=sizeof(char *))-sizeof(char *))) = ((char *)datum))))
-
-#define obstack_int_grow(h,datum) \
-( (((h)->next_free + sizeof (int) > (h)->chunk_limit) \
- ? (_obstack_newchunk ((h), sizeof (int)), 0) : 0), \
- ((h)->alloc_failed ? 0 : \
- (*((int *)(((h)->next_free+=sizeof(int))-sizeof(int))) = ((int)datum))))
-
-#define obstack_ptr_grow_fast(h,aptr) (*((char **)(h)->next_free)++ = (char *)aptr)
-#define obstack_int_grow_fast(h,aint) (*((int *)(h)->next_free)++ = (int)aint)
-
-#define obstack_blank(h,length) \
-( (h)->temp = (length), \
- (((h)->chunk_limit - (h)->next_free < (h)->temp) \
- ? (_obstack_newchunk ((h), (h)->temp), 0) : 0), \
- ((h)->alloc_failed ? 0 : \
- ((h)->next_free += (h)->temp)))
-
-#define obstack_alloc(h,length) \
- (obstack_blank ((h), (length)), obstack_finish ((h)))
-
-#define obstack_copy(h,where,length) \
- (obstack_grow ((h), (where), (length)), obstack_finish ((h)))
-
-#define obstack_copy0(h,where,length) \
- (obstack_grow0 ((h), (where), (length)), obstack_finish ((h)))
-
-#define obstack_finish(h) \
-( (h)->alloc_failed ? 0 : \
- (((h)->next_free == (h)->object_base \
- ? (((h)->maybe_empty_object = 1), 0) \
- : 0), \
- (h)->temp = __PTR_TO_INT ((h)->object_base), \
- (h)->next_free \
- = __INT_TO_PTR ((__PTR_TO_INT ((h)->next_free)+(h)->alignment_mask) \
- & ~ ((h)->alignment_mask)), \
- (((h)->next_free - (char *)(h)->chunk \
- > (h)->chunk_limit - (char *)(h)->chunk) \
- ? ((h)->next_free = (h)->chunk_limit) : 0), \
- (h)->object_base = (h)->next_free, \
- __INT_TO_PTR ((h)->temp)))
-
-#ifdef __STDC__
-#define obstack_free(h,obj) \
-( (h)->temp = (char *)(obj) - (char *) (h)->chunk, \
- (((h)->temp > 0 && (h)->temp < (h)->chunk_limit - (char *) (h)->chunk)\
- ? (int) ((h)->next_free = (h)->object_base \
- = (h)->temp + (char *) (h)->chunk) \
- : (((obstack_free) ((h), (h)->temp + (char *) (h)->chunk), 0), 0)))
-#else
-#define obstack_free(h,obj) \
-( (h)->temp = (char *)(obj) - (char *) (h)->chunk, \
- (((h)->temp > 0 && (h)->temp < (h)->chunk_limit - (char *) (h)->chunk)\
- ? (int) ((h)->next_free = (h)->object_base \
- = (h)->temp + (char *) (h)->chunk) \
- : (_obstack_free ((h), (h)->temp + (char *) (h)->chunk), 0)))
-#endif
-
-#endif /* not __GNUC__ or not __STDC__ */
-
-#endif /* not __OBSTACK_H__ */
diff --git a/contrib/libg++/libg++/ChangeLog b/contrib/libg++/libg++/ChangeLog
deleted file mode 100644
index 506a841abbdd..000000000000
--- a/contrib/libg++/libg++/ChangeLog
+++ /dev/null
@@ -1,2271 +0,0 @@
-Tue Jun 18 18:36:58 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * Version 2.7.2.
-
-Fri Dec 1 15:35:03 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * libg++.texi: Don't document 'and' function etc, since they
- are no longer available if __STRICT__ANSI__.
-
- * Makefile.in: Generate g++FAQ.txt and g++FAQ.html from g++FAQ.texi.
- (diststuff): Also build g++FAQ.txt.
- * configure.in (REAL_CLEAN): Remove g++FAQ.{txt,html}.
- * g++FAQ.txt: Removed - now generated automatically.
-
- * configure.in (configdirs): Remove old-stream.
-
-Fri Apr 19 17:24:51 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * Version 2.8.0b3.
-
-Wed Apr 10 02:30:52 1996 Jason Molenda (crash@phydeaux.cygnus.com)
-
- * g++FAQ.texi, g++FAQ.txt: Update to April 5 version.
-
-Mon Apr 8 15:04:37 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * configure.in: Permit --enable-shared to specify a list of
- directories.
-
-Wed Mar 27 11:54:08 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * Version 2.8.0b2.
-
-Wed Feb 28 10:00:24 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * Version 2.8.0b1.
-
- * *, config/*: Remove references to curses stuff.
-
- * g++FAQ.txt (Subject): Update to February 15 version.
-
-Tue Dec 19 15:13:08 1995 Jason Merrill <jason@yorick.cygnus.com>
-
- * config/aix.ml (SHFLAGS): Add -Wl,-unix.
-
-Sun Dec 17 00:26:54 1995 Jeffrey A Law (law@cygnus.com)
-
- * Makefile.in (install): Make sure shared libraries
- are installed with mode 555.
-
-Mon Dec 4 14:07:02 1995 Jason Merrill <jason@yorick.cygnus.com>
-
- * config/hpux.ml: HPUX has shared libcurses.
-
- * Makefile.in (install): Make symbolic links relative.
-
-Tue Nov 28 14:26:49 1995 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * Makefile.in (piclist): Use test instead of the left bracket, to
- avoid problems with some versions of make.
-
-Sat Nov 25 11:47:26 1995 Doug Evans <dje@canuck.cygnus.com>
-
- * configure.in: Delete changing LIBIBERTY to xiberty if cross.
-
- * Makefile.in (install): Fix setting of rootme.
-
-Tue Nov 21 14:16:35 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * configure.in: Check ${with_cross_host} rather than comparing
- ${host} and ${target}.
-
-Tue Nov 14 01:34:06 1995 Doug Evans <dje@canuck.cygnus.com>
-
- * Makefile.in (RX_OBJ): Delete MULTITOP reference.
- (SHLIB, ../librx/rx.o): Likewise.
- * configure.in: Delete call to cfg-ml-com.in. Call config-ml.in
- instead of cfg-ml-pos.in.
- * src/configure.in (XCINCLUDES): Delete MULTITOP reference.
- (config-ml.in): Call instead of cfg-ml-pos.in.
- * src/depend: Regenerated.
-
-Sun Nov 12 16:28:06 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * g++FAQ.texi, g++FAQ.txt: Update to September 15 version.
-
- * Makefile.in (VERSION), README: Update to 2.7.1.
-
-Thu Nov 9 17:45:00 1995 Jason Merrill <jason@yorick.cygnus.com>
-
- * config/*.ml: Don't include -lcurses in LIBS. Tweak.
-
- * configure.in (MOSTLYCLEAN): Add piclist.
-
-Wed Nov 8 17:02:42 1995 Jason Merrill <jason@yorick.cygnus.com>
-
- * Makefile.in (piclist): Don't include CursesW.o for targets that
- lack a shared libcurses.
-
-Mon Nov 6 14:18:16 1995 Jason Merrill <jason@yorick.cygnus.com>
-
- * config/linux.ml: Be sure to get the right libstdc++.
-
-Thu Oct 26 22:51:44 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * Makefile.in (VERSION): Increase to 2.7.0.90.
-
-Tue Oct 24 15:53:59 1995 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * config/sol2shm.ml: New file, to pass -R to links.
- * configure.in: For solaris2*, use sol2shm.ml instead of elfshlibm.ml.
-
-Tue Sep 26 15:22:31 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * config/irix5.ml: Pass -rpath to links.
-
-Fri Sep 15 00:24:52 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * config/linux.ml: Conform to Linux shared library numbering scheme.
- * Makefile.in: Ditto.
-
-Mon Aug 21 11:46:03 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * Makefile.in (install): Make shared library executable and
- non-writable. Tidy.
-
-Sat Jul 22 14:00:26 1995 Doug Evans <dje@canuck.cygnus.com>
-
- * Makefile.in (list): Add multilib support.
- ($(SHLIB), rx.o, install): Likewise.
- * configure.in: Likewise.
- * src/Makefile.in (install): Likewise.
- * src/configure.in (XCINCLUDES): Likewise.
- * src/depend: Regenerated.
-
-Wed Jun 28 13:45:24 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * g++FAQ.texi, g++FAQ.txt: New versions from Joe Buck.
-
-Tue Jun 27 01:56:34 1995 Jeffrey A. Law <law@rtl.cygnus.com>
-
- * config/hpux.ml (SHFLAGS): Use $(PICFLAG), not $(LIBCFLAGS).
-
-Fri Jun 23 16:54:17 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * Makefile.in (SHLINK): Force link.
- (install): Ditto.
-
- * Makefile.in (SHARLIB): Provide a default value.
-
-Fri Jun 16 15:35:33 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * g++FAQ.texi, g++FAQ.txt: New files: Joe Buck's FAQ for G++.
-
-Thu Jun 15 21:01:10 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * Makefile.in (VERSION): Set to 2.7.0
-
-Fri Jun 16 13:57:22 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * config/aix.ml: Build both shared and archive libraries.
-
-Wed Jun 14 21:44:21 1995 Jason Merrill <jason@python.cygnus.com>
-
- * configure.in (frags): Use linux.ml for Linux/ELF.
- * config/linux.ml: New file.
-
-Wed Jun 7 11:13:32 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * configure.in (MOSTLYCLEAN): Remove stamp-picdir.
-
-Mon Jun 5 18:41:03 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * Makefile.in (piclist): New rule.
- (SHLIB): Use it.
-
- * configure.in (MOSTLYCLEAN): Remove pic.
- (frags): Use toplevel pic frags.
-
- * config/*.ml: Build both shared and archive libraries.
-
-Mon May 22 23:36:42 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * Makefile.in (VERSION): Bump to 2.6.90.
- (install): Re-format; add missing semi-colon.
-
-Wed May 10 05:07:45 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * config/aix.ml: New file.
-
- * configure.in (enable_shared): Support enable_shared under AIX.
-
- * Makefile.in (SHARLIB): New variable and rule for building an
- archive library containing a single shared object (for AIX).
-
-Wed Apr 19 23:22:36 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * config/dec-osf.ml (SHDEPS): Link with -lstdc++.
-
- * Makefile.in (SHLIB): Don't link with -lstdc++.
-
-Sun Apr 16 17:54:28 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * README: Minor updates.
- * libg++.texi: Fix two typos.
-
-Wed Mar 8 16:34:44 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * config/elf.ml (LIBS): Also link with libstdc++.
- * config/sunos4.ml: Ditto.
-
- * config/dec-osf.ml (LIBS): Pass -rpath to linker.
-
-Thu Feb 16 00:13:44 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * Makefile.in, config/*.ml: Generate shared library on most hosts
- as libg++.so.$(VERSION), with a symlink to libg++.so, so that
- multiple versions can coexist.
-
-Fri Jan 20 01:34:04 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * Makefile.in (list): Don't include files from libio and libiberty.
- (SHLIB): Link with libstdc++.
-
- * README.SHLIB: Add note about setting LD_LIBRARY_PATH.
-
-Mon Dec 5 19:45:21 1994 Per Bothner <bothner@kalessin.cygnus.com>
-
- * README: Add note about AIX.
- * NEWS: Mention STL and shared library support.
-
-Wed Nov 9 01:24:09 1994 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * README.SHLIB: Update for new shared library support.
-
-Mon Nov 7 16:22:44 1994 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * configure.in, config/*.ml: Handle --enable-shared.
- (ALL): Reference 'libs' now.
- (MOSTLYCLEAN): Handle 'list'.
- (CLEAN): $(BUILD_LIBS) replaces $(TARGETLIB).
-
- * Makefile.in (ALL, CHECK, TARGET_LIB): Remove.
- (ARLIB): libg++.a.
- (SHLIB): libg++.so.
- (SHFLAGS): flags used when building $(SHLIB).
- (SHDEPS) : libraries linked when building $(SHLIB).
- (LIBIBERTY_OBJECTS_TO_GET): Reference file in other directory.
- (list): Build master list of objects.
- (libg++.a): Use it.
- (libg++.so): Ditto.
- (install): Only ranlib $(ARLIB).
-
-Sat Nov 5 16:09:24 1994 Per Bothner <bothner@kalessin.cygnus.com>
-
- * Makefile.in (VERSION): Update to 2.6.2.
- * Makefile.in: Support for adding in ../libio/rx.o into libg++.a
- moved here from src/Makefile.in.
- * NEWS, README: Update. Libstdc++ is now enabled by default.
-
-Fri Nov 4 17:14:09 1994 Per Bothner <bothner@kalessin.cygnus.com>
-
- * NEWS, TODO: Fix typos.
-
-Mon Oct 24 15:43:09 1994 Per Bothner <bothner@kalessin.cygnus.com>
-
- * configure.in: Remove no-longer-used NOSTDINC setting.
- * utils/etags.c: Removed. The one in emacs-19 is better maintained.
- * utils/Makefile.in, utils/configure.in, README: Removed etags stuff.
-
-Thu Oct 20 17:07:53 1994 Per Bothner <bothner@kalessin.cygnus.com>
-
- * README, NEWS: Note libstdc++. Other updates.
-
- * README.SHLIB: Update from Joseph E. Sacco <jsacco@ssl.com>.
-
-Tue Oct 18 17:52:42 1994 Per Bothner <bothner@kalessin.cygnus.com>
-
- * README: Minor improvements.
- * README.SHLIB: New file. (Notes on building shared libraries.)
- * utils/c++-mode.el: Removed.
-
-Thu Oct 13 18:29:02 1994 Jason Merrill (jason@phydeaux.cygnus.com)
-
- * Makefile.in (install): Warn if we detect headers from a pre-2.5
- installation.
-
- * README: Add more information about problems from old
- installations.
-
-Wed Aug 24 12:54:04 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
-
- * configure.in: Change i[34]86-*-linux to i[345]86-*-linux.
-
-Sat Aug 20 12:12:01 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * Makefile.in (VERSION): Increase to 2.6.1.
- * NEWS: Note use of librx.
-
-Fri Jul 22 00:09:06 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * utils/etags.c: Replace index -> strchr and rindex -> strrchr.
- Protect extern definitions of strchr, strrchr, strcpy, strncpy,
- and strcmp by #ifndef's in case they are macros.
- (This is a problem under AIX-3.2.5, as reported by
- Tom McConnell <tmcconne@sedona.intel.com>.)
- Remove commented-out definitions of index and rindex.
-
-Wed Jul 13 12:56:43 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * Makefile.in (VERSION): Increase to 2.6.
- * README, NEWS, TODO: Some updating.
-
-Mon Jul 11 18:56:59 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * README: Update libg+.texinfo -> libg++.texi,
- Take out Doug Lea's prominent address.
-
-Tue May 31 09:25:41 1994 Mike Stump (mrs@cygnus.com)
-
- * utils/etags.c: Add #include <string.h>, to avoid warning on alpha.
-
-Mon May 30 17:34:39 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * Makefile.in (install): Various cleaning up.
- Move commands to install include files to src/Makefile.in.
-
-Wed May 25 16:00:55 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * Makefile.in (VERSION): Set to 2.5.4.
-
-Thu Mar 17 22:35:05 1994 Per Bothner (bothner@deneb.cygnus.com)
-
- * configure.in: Always set NOSTDINC in Makefiles. (Don't try
- to determine if C++ compiler can handle it. We can't really
- do that with the current configure setup.)
- * README: Recommend build using 'make all "CC=gcc -O"'.
- Note "make NOSTDIC=" is needed if using non-g++.
-
-Mon Mar 7 13:51:57 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
-
- * Makefile.in (.stmp-tests): Don't recurse into tests directory if
- it does not exist.
-
-Sun Dec 19 19:04:12 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * Makefile.in (VERSION): Set to 2.5.3.
- * README.386bsd: Removed.
-
-Fri Nov 26 19:07:36 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * Makefile.in (VERSION): Set to 2.5.2.
-
-Thu Nov 4 16:58:40 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * Makefile.in (VERSION): Update to version 2.5.1.
- * Makefile.in (install): Remove code to install g++-include.
- * configure.in: Restore code to set NOSTDINC.
-
-Wed Nov 3 11:50:21 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
-
-Mon Nov 1 17:56:05 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * g++-include directory: Removed. (We assume fixproto now.)
-
-Mon Oct 25 21:08:33 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * libg++.texi: Fix typo Slater -> [Daliel] Sleator.
- Reported by Nathan Loofbourrow <loofbour@cis.ohio-state.edu>.
-
-Sat Oct 23 22:06:00 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * Makefile.in (VERSION): Update to version 2.5.
- * README, NEWS: Various updates.
-
-Thu Oct 14 16:04:10 1993 Karen Christiansen (karen@deneb.cygnus.com)
-
- * configure.in: changed mv to mv -f
-
-Mon Oct 11 12:43:51 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * Makefile.in: Bump version number to 2.4.90.
- * README, NEWS: Update.
- * Makefile.in: Remove iostream references.
-
-Mon Oct 4 17:47:51 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * libg++.texi: Note NIHCL availability and status.
- * Makefile.in: Bump version number to 2.4.8.
-
-Wed Aug 25 13:00:55 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * config/{aix3-1.mt, hpux.mt, isc.mt, sco4.mt}:
- Moved to ../libio/config (since they affect _G_config.h).
- * configure.in: Don't set my_target for sco/hpux/isc/aix.
-
-Wed Aug 18 12:23:19 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * Makefile.in: Use FOO.list files instead of SUBDIR/stamp.
-
-Tue Aug 17 18:36:08 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- Set up for using ../libio instead of ./iostream.
- * Makefile.in (SUBDIRS): Don't include IO_DIR.
- * utils/gen-params: Moved to ../libio.
- * Makefile.in: Don't build or use _G_config.h; use ../libio.
- * Makefile.in (stamp-libg++.a, libg++.a): Re-do to use
- $(IO_DIR)/iostream-files, where IO_DIR defaults to ../libio.
- * config.shared: Now just a stub that invokes ../libio/config.shared.
- * utils/configure.in (srctrigger): gen-params -> g++dep.sh.
-
-Wed Aug 4 17:29:14 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com)
-
- * Makefile.in (install): add some 'else true' clauses for the
- dain-bramaged DECstation Bourne shell
-
-Tue Aug 3 11:41:27 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * config.shared: Change INSTALL to use ../install.sh -c.
- * configure.in: Removed setting of INSTALL*.
- * configure.in: Removed reference to aix.mt.
- * config/aix.mt: Removed; no longer needed.
- * config/{aix3-1.mt, hpux.mt, linux.mt, sco4.mt, solaris2.mt}:
- Removed no-longer-needed setting of INSTALL*, NOSTDINC,
- HAVE_CPLUS_EXTERN, and WRAP_C_INCLUDES.
-
-Sun Jul 25 19:21:45 1993 Per Bothner (bothner@kalessin)
-
- * config.shared: Set WRAP_C_INCLUDES to no longer search
- g++-include, now that gcc has the fixproto script.
- * configure.in: Don't need -nostdinc++ flag any more,
- now that we're not using g++-include (with its #include_nexts).
- * config.shared: Restructure *clean rules, partly to
- avoid some duplication.
- * README: Various clarifications.
-
-Wed Jul 7 15:33:39 1993 Brendan Kehoe (brendan@lisa.cygnus.com)
-
- * utils/gen-params (DOLLAR_IN_LABEL): Look for `7filebuf' instead
- of just `filebuf' on the vtable name.
-
-Tue Jun 29 13:02:39 1993 Per Bothner (bothner@rtl.cygnus.com)
-
- * Makefile.in (VERSION): Set to 2.4 (yeah!).
- * Makefile (install): Don't depend on all.
- * config.shared: Undo change of Jun 25.
- * configure.in: Handle *-*-solaris like *-*-solaris2.
-
-Fri Jun 25 12:23:22 1993 Per Bothner (bothner@rtl.cygnus.com)
-
- * config.shared: Make install-info depend on info.
-
-Wed Jun 23 12:56:23 1993 Per Bothner (bothner@rtl.cygnus.com)
-
- * Makefile.in: Define VERSION (for cd ..; make taz).
- * Makefile.in: Set to version 2.3.91.
- * Makefile.in (diststuff): Needed for distributions.
- * Makefile (dts): Rip out. Subsumed by stuff in ../Makefile.in.
-
-Tue Jun 22 13:16:30 1993 Per Bothner (bothner@deneb.cygnus.com)
-
- * README.386bsd: Patches for 386bsd.
- * utils/etags.c: Add AIX alloca support.
- * config.shared (CXXINCLUDES): Fix quoting bug.
- * libg++.texi: Document Integer methods fits_in_long(),
- as_long(), fits_in_double(), as_long().
-
-Tue Jun 15 11:54:42 1993 Per Bothner (bothner@deneb.cygnus.com)
-
- * config.shared (CLEAN): Default to ${TARGETPROG} ${TARGETLIB}.
- * configure.in (DISTCLEAN): Add target-mkfrag.
-
-Mon Jun 7 13:13:27 1993 Per Bothner (bothner@rtl.cygnus.com)
-
- * Makefile.in: Increase version number to 2.3.90.
- * configure.in: Always automatically generate a target Makefile
- fragment, and then posibly append the one in config/*.mt.
- This means the config/*.mt only needs to contain what is
- different from the normal case, which should ease updates.
- * config/rs6000.mt: Replace by aix3-1.mt (for buggy AIX 3.1),
- and aix.mt (for more recent versions).
- * config/isc.mt: New file.
- * configure.in: Update for above config/*.mt changes.
-
-Tue Jun 1 16:53:14 1993 Per Bothner (bothner@rtl.cygnus.com)
-
- * Makefile.in (stamp-$(TARGETLIB)): Delegate adding the
- files from $(IODIR) to the sub-Makefile, invoking latter
- with target add-to-targetlib.
- * Makefile.in (_G_config.h): Set CC=$(CXX) when invoking
- utils/gen-params, to "force" use of C++ compiler.
-
- * no-stream/Makefile.in (add-to-targetlib): New rule.
- * utils/gen-params: Remove OLD_PLACEMENT support.
-
-Fri Jun 4 14:14:39 1993 Ian Lance Taylor (ian@cygnus.com)
-
- * Makefile.in (installcheck): Pass CXXFLAGS to test-install.
- * config.shared: It's .SUFFIXES, not SUFFIXES.
-
-Thu Jun 3 00:53:03 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
-
- * Makefile.in (install): split off the running of the installation
- tests into a new target, installcheck
-
-Wed May 12 13:39:46 1993 Ian Lance Taylor (ian@cygnus.com)
-
- * utils/Makefile.in (etags.o, etags): Build etags via etags.o,
- rather than directly from etags.c.
-
-Tue May 11 16:32:31 1993 Brendan Kehoe (brendan@lisa.cygnus.com)
-
- * utils/gen-params: Look for new types `int32_t' and `uint32_t'.
-
-Mon May 10 09:57:25 1993 Ian Lance Taylor (ian@cygnus.com)
-
- * configure.in: Create target-mkfrag using move-if-change.
-
-Thu May 6 09:24:21 1993 Ian Lance Taylor (ian@cygnus.com)
-
- * Makefile.in (install): If TEST_INSTALL was overridden by
- configure.in, don't try to install the test-install directory.
- * configure.in: If cross, take gperf, test-install and utils out
- of configdirs. Otherwise they wind up in subdirs and get built.
- Override TEST_INSTALL to be empty rather than Makefile.
-
-Mon May 3 18:55:19 1993 Per Bothner (bothner@cygnus.com)
-
- * configure.in: If cross, use sed to hack Makefile, rather
- than appending to target_makefile_frag, since that doesn't
- work if there is a pre-existing fragment.
- * Makefile.in: Re-order INSTALLDIR.
-
-Mon May 3 11:45:41 1993 Ian Lance Taylor (ian@cygnus.com)
-
- * config.shared: Added missing quotes around TOUCH_ON_COMPILE.
-
-Fri Apr 30 15:12:36 1993 Per Bothner (bothner@cygnus.com)
-
- * Makefile.in (tooldir): New definition.
- * Makefile.in (install): Install _G_config in $(tooldir)/include,
- since it is the only include file that is target-dependent.
- * Makefile.in (dist-fix-Makefile): Remove no-longer-needed kludge.
- * config.shared: If TOUCH_ON_COMPILE is defined (at configure
- time), make sure to 'touch stamp' on every compile.
- This prevents unneeded re-builing of libg++.a.
-
-Wed Apr 28 11:44:05 1993 Ian Lance Taylor (ian@rtl.cygnus.com)
-
- * config.shared (MAKEOVERRIDES): Define to be empty.
-
-Tue Apr 27 15:52:19 1993 Per Bothner (bothner@cygnus.com)
-
- * config.shared (FLAGS_TO_PASS): Also pass INSTALL, INSTALL_DATA,
- and INSTALL_PROGRAM.
- * Makefile.in: Remove duplicate definition of FLAGS_TO_PASS.
- Replace uses of BASE_FLAGS_TO_PASS by FLAGS_TO_PASS.
-
-Tue Apr 27 11:09:04 1993 Ian Lance Taylor (ian@cygnus.com)
-
- * config.shared: info depends on .info files, not .texi files.
-
-Fri Apr 23 11:31:01 1993 Brendan Kehoe (brendan@lisa.cygnus.com)
-
- * configure.in (target_makefile_frag): If there was one in srcdir,
- then reset it to include ${srcdir} so we'll copy it properly.
-
-Sun Apr 18 23:54:45 1993 Per Bothner (bothner@cygnus.com)
-
- * Makefile.in and configure.in all directories, config.shared:
- Revamped configure scheme. See libg++/NEWS.
- * README: Some extra information, including a note
- about what it means when test-install fails.
- * libg++.texinfo: Renamed to libg++.texi.
- * gen-params: Minor improvements (we hope) here and there.
-
-Tue Mar 23 00:14:33 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
-
- * Makefile.in: minimal support for installcheck (FIXME), some
- support for dvi target
-
-Fri Mar 19 10:35:32 1993 Ian Lance Taylor (ian@cygnus.com)
-
- * david d `zoo' zuhn's patches for ARG_MAX:
- Makefile.in (BASE_FLAGS_TO_PASS): New variable.
- (FLAGS_TO_PASS): Use BASE_FLAGS_TO_PASS.
- (info, install-info, install): Use BASE_FLAGS_TO_PASS.
- (subdir_do): Don't echo FLAGS_TO_PASS.
-
-Fri Mar 12 18:35:02 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
-
- * configure.in: recognize *-*-solaris2* instead of *-*-solaris2
-
-Fri Mar 5 11:41:15 1993 Ian Lance Taylor (ian@cygnus.com)
-
- * Makefile.in (MAKEOVERRIDES): Override GNU make 3.63 default
- definition in order to reduce length of command line.
-
-Wed Feb 17 05:28:51 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
-
- * Makefile.in: when making include files non-executable, make them
- world readable as well
-
-Mon Jan 25 14:40:28 1993 Brendan Kehoe (brendan@cygnus.com)
-
- * config/alpha.mh: New file, for DEC's Alpha family.
-
-Wed Jan 13 21:17:26 1993 Mike Stump (mrs@cygnus.com)
-
- * .../Makefile.in, utils/gen-params, configure.in: Change .../gcc
- to .../xgcc.
-
-Tue Jan 5 02:38:37 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
-
- * configure.in: get the xiberty kludge "working"
-
-Wed Dec 30 14:15:31 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
-
- * Makefile.in (info): added -I to command line, for @include
-
-Tue Dec 29 08:54:13 1992 Ian Lance Taylor (ian@cygnus.com)
-
- * utils/gen-params: Define _G_MATH_H_INLINES. Based only on
- arguments to gen-params; no test yet.
- * config/sco4.mt, config/hpux.mt (G_CONFIG_ARGS): pass
- MATH_H_INLINES as 1.
-
- * Makefile.in: pass $(FLAGS_TO_PASS) to all calls to make.
-
-Mon Dec 28 12:07:11 1992 Ian Lance Taylor (ian@cygnus.com)
-
- * utils/gen-params: added check for CURSES_FORMAT_ARG, which
- differs from system to system.
-
- * configure.in: for SCO 3.2v4 use sco4.
- * config/sco4.mh: new file: SCO header files are C++ ready, and
- SCO curses doesn't work with libg++ curses.
-
-Tue Dec 22 14:58:04 1992 Per Bothner (bothner@rtl.cygnus.com)
-
- * utils/gen-params: At end, delete all temporary files.
- * configure.in: Don't bother linking lgpl.texinfo.
- Clean up temp.o when done.
- * Makefile.in: Set version number to 2.3.1.
- * Makefile.in (*clean rules): Use ALL_SUBDIRS, which includes
- old-stream and no-stream.
- * Makefile.in: Add dependencies for libg++.a, to support
- parallel makes.
-
-Tue Dec 15 14:45:05 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
-
- * configure.in: configure based on target, instead of host. This
- was a simple text substitution, which also involved renaming:
-
- * config/{hpux.mt,linux.mt,rs6000.mt,solaris2.mt}: renamed from .mh
-
-Sat Dec 12 00:05:42 1992 Per Bothner (bothner@cygnus.com)
-
- * Makefile.in: No longer use HAVE_CPLUS_EXTERN; we can use
- WRAP_C_INCLUDES instead. This should be somewhat more robust,
- since we only depend on WRAP_C_INCLUDES being over-ridden.
- * configure.in: Don't generate HAVE_CPLUS_EXTERN.
-
-Wed Dec 9 15:08:34 1992 Per Bothner (bothner@cygnus.com)
-
- * Makefile.in: Set version to 2.3.
- * README, NEWS, TODO: Various updates.
-
-Fri Dec 4 17:44:40 1992 Per Bothner (bothner@cygnus.com)
-
- * Makefile.in (install): Pass CXX to test-install, not CC.
- * Makefile.in (dist): Use new ../etc directory for config stuff.
-
-Thu Dec 3 20:03:05 1992 Per Bothner (bothner@cygnus.com)
-
- * Makefile.in: Bump to version 2.2.95.
- * Makefile.in (distclean, realclean): Don't delete
- Makefile until *after* recursive makes.
- * Makefile.in: Add a kludge to reconcile FSF/Cygnus conflict.
-
-Fri Nov 20 15:34:27 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
-
- * Makefile.in (install): don't change permissions on all info files,
- just the ones that get installed by this Makefile
-
-Fri Nov 20 14:34:52 1992 Per Bothner (bothner@cygnus.com)
-
- * configure.in: Add etc/fib to subdirs.
- * configure.in, config/{linux,solaris2}.mh: Fix typo
- INSTALLDATA -> INSTALL_DATA.
-
-Tue Nov 17 21:48:10 1992 Per Bothner (bothner@rtl.cygnus.com)
-
- * Makefile.in: Bump to 2.2.92.
- * Makefile.in (install): Use $(FLAGS_TO_PASS).
-
- * utils/gen-params: More "robust" sed patterns for extracting
- type definitions.
-
-Sat Nov 7 19:45:42 1992 Per Bothner (bothner@rtl.cygnus.com)
-
- * config/solaris2.mh: New file, for Sun's Solaris2 OS.
- * configure.in: Use it.
-
-Thu Nov 5 18:45:53 1992 Per Bothner (bothner@rtl.cygnus.com)
-
- * Makefile.in: Bump to version 2.1.91.
- * Makefile.in, */Makefile.in, etc: Replace ${C++} and
- ${C++FLAGS} by ${CXX} and ${CXXFLAGS}. (Some versions of
- 'make' do not like '+' in variable names.)
- * Makefile.in (install): Fix typo (chmod directory).
-
-Mon Nov 2 13:20:54 1992 Per Bothner (bothner@cygnus.com)
-
- * Makefile.in: Don't pass $(NOSTDINC) as part of $(CC).
- * Makefile.in (dist): include/demangle.h is also needed.
-
-Sun Nov 1 16:25:00 1992 Per Bothner (bothner@cygnus.com)
-
- * Makefile.in, */Makefile.in, etc: Use ${C++} (and ${C++FLAGS})
- to compile C++ programs, not ${CC}.
- * Makefile.in: Bump to version 2.2.90.
- * Makefile.in: Use FLAGS_TO_PASS more consistently.
-
-Sat Oct 31 19:24:05 1992 Per Bothner (bothner@rtl.cygnus.com)
-
- * libg++.texinfo: Fix a number of typos (from
- meyering@cs.utexas.edu (Jim Meyering)).
-
-Fri Oct 9 16:44:30 1992 Per Bothner (bothner at PersSony)
-
- * Makefile.in: Fixed rule for building libg++.a to not do
- anything if everyting is up-to-date, using a stamp-libg++.a
- indicator file.
-
-Tue Sep 29 15:47:05 1992 Per Bothner (bothner@rtl.cygnus.com)
-
- * COPYING, COPYING-LIB: Removed (- use versions in ..).
- * README: Update accordingly.
-
-Fri Sep 25 11:28:24 1992 Per Bothner (bothner@cygnus.com)
-
- * utils/gen-params: Define the type names (such as _G_size_t)
- using typedefs, not macros.
- * utils/gen-params: Add commented-out hook for turning
- off use of templates (for old compilers).
-
-Thu Oct 1 23:53:29 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
-
- * configure.in: use cpu-vendor-os triple instead of nested cases
-
-Tue Sep 29 12:07:35 1992 Ian Lance Taylor (ian@cygnus.com)
-
- * utils/gen-params: do the stdarg test with C++, not C, since
- otherwise a type incompatibility is only a warning.
-
-Tue Sep 15 15:43:35 1992 Ian Lance Taylor (ian@cygnus.com)
-
- * Makefile.in (install): install libg++.a in $(INSTALLDIR), which
- defaults to $(libdir), not $(tooldir). Default $(gxx_includedir)
- to $(tooldir/g++-include; the g++-include directory is currently
- target dependent because of the _G_config.h file. Also, gcc now
- looks in $(tooldir) by default.
- configure.in: if cross-compiling, override $(INSTALLDIR) to
- $(tooldir)/lib.
-
-Fri Sep 11 16:05:08 1992 Ian Lance Taylor (ian@cygnus.com)
-
- * configure.in, Makefile.in: When cross-compiling, don't build
- gperf, or the utils directory, or test-install.
-
-Thu Sep 10 22:49:34 1992 Ian Lance Taylor (ian@cygnus.com)
-
- * utils/gen-params: test for existence of curses.h. It's not in
- newlib. Also corrected a couple of typos.
-
-Wed Sep 9 12:34:00 1992 Ian Lance Taylor (ian@cygnus.com)
-
- * Makefile.in: try to get correct version of nm for target for
- gen-params.
-
-Mon Aug 31 16:14:34 1992 Per Bothner (bothner@rtl.cygnus.com)
-
- * Makefile.in: Bump to version 2.2.3.
- * Makefile.in: Convert ${readme} to be `pwd`/ (with a
- trailing slash) (as done in iostream).
-
-Mon Aug 17 17:15:06 1992 Per Bothner (bothner@rtl.cygnus.com)
-
- * utils/gen-params: Allow command-line (e.g. HAVE_UNISTD=0)
- to override feature testing for various include files.
- * Makefile.in: Pass $(NOSTDINC) to gen-params.
- Turn off execute permission after installing data.
-
-Wed Aug 12 00:33:09 1992 Per Bothner (bothner@cygnus.com)
-
- * utils/c++-mode.el: New version.
-
- * Makefile.in: Change to version 2.2.1.
- * Makefile.in: Remove some old junk.
- Let 'install' depend on 'all'.
- Let 'install' also install gperf.
- * utils/gen-params: Test for Posix-compatible (or rather
- iostream/procbuf.C-compatible) sys/wait.h by compiling
- C++ test program, not C. Fixes NeXT problem, I hope.
- Also, fix typo when predefined DOLLAR_IN_LABEL (fixes hpux).
-
-Mon Aug 10 11:38:14 1992 Ian Lance Taylor (ian@dumbest.cygnus.com)
-
- * Makefile.in: always create installation directories.
-
-Fri Jun 26 12:26:35 1992 Per Bothner (bothner@rtl.cygnus.com)
-
- * Makefile.in: Change to version 2.2.
- * Makefile.in: Don't `cd ../libiberty; make'; since this
- may cause some confusion (with old versions of GNU make
- passing the wrong environment); instead assume that
- ../Makefile takes care of it.
- * configure.in, config/hpux.mh: hpux support.
- * utils/etags.c: stat fixes for Posix and SVR3.
- * utils/gen-params: Minor fixes.
-
-Mon Jun 22 23:54:31 1992 Per Bothner (bothner@cygnus.com)
-
- * Makefile.in: Increase to version 2.1.92.
- * utils/gen-params. Add some paranoia when trying to
- figure out a type for _G_ssize_t - make sure it doesn't
- conflict with read().
-
-Fri Jun 19 23:15:13 1992 Per Bothner (bothner@cygnus.com)
-
- * Makefile.in: Increase to version 2.1.91.
- * utils/etags.c: New version, from emacs-19.
- * utils/Makefile.in: New etags needs GNU getopt.
- * utils/gen-params: Take out _G_HAVE_UNION_WAIT testing.
- Instead, check that wait() will accept an (int*) - as
- Posix and tradition (but not NeXT) says it should -
- if it doesn't, say that we don't HAVE_SYS_WAIT.
-
-Wed Jun 17 18:48:16 1992 Per Bothner (bothner@rtl.cygnus.com)
-
- * Makefile.in: Increase version number to 2.1.90.
- * no-stream/Makefile.in: New directory and file.
- Useful for building libg++ *without* iostreams.
- * Makefile.in, */Makefile.in: Cleanup *clean rules,
- following standards.texi.
- * utils/gendepend: Remove tempoary file depend.tmp.
- * utils/gen-params: Check if <sys/wait.h> defines union wait.
- * WHATS.NEW: Merge old stuff from (deleted) etc/release.log.
- * configure.in: Check that we find an install that works;
- for SYSV, also try /usr/ucb/install.
- * TODO, README, libg++.texinfo: Minor changes.
-
-Wed Jun 3 23:10:20 1992 Per Bothner (bothner@rtl.cygnus.com)
-
- * Makefile.in: Set version number to 2.1.
- * utils/gen-params: If ${NAMES_HAVE_UNDERSCORE} is non-null,
- use that value; don't bother trying to deduce it.
- Ditto for ${DOLLAR_IN_LABEL}.
- Replace sed-idiom -n -e 1,1p by -e '2,$d', because the
- former doesn't work in GNU sed.
- Add sigset_t to the list of types searched for.
- Look for <sys/wait.h> and defined _G_HAVE_SYS_WAIT appropriately.
- * vms/{_G_config.h,AAAREADME.TXT}: New versions from Youngdale.
- * libg++.texinfo: Note failure behavior for String::before().
- * Makefile.in: Use FLAGS_TO_PASS variable to be more
- consistent about flags to pass to sub-makes.
- Add some hooks for people with unusual environments:
- Unually powerful C-libraries, or they don't want iostreams
- to be part of libg++.a.
- * configure.in: Test for Linux configuration.
- Avoid confusing error message when looking for ranlib.
-
-Fri May 29 13:08:12 1992 Per Bothner (bothner@rtl.cygnus.com)
-
- * utils/gen-params: Remove TMP before running a sed which
- writes to it (GNU sed supposedly has a bug where in that it
- doesn't truncate a file before writing to it).
- * Makefile.in: Include strerror.o strsignal.o (from libiberty).
-
- * Makefile.in: Bump to version 2.0.91.
- * etags.c: #undef TRUE and FALSE before defining, to
- avoid collisions. (These inevitable collisions make it
- a mistake to define TRUE and FALSE in the first place.)
- * gen-params: Test for <dirent.h>.
- Use ${SED} instead of sed, since GNU sed may be broken.
- Check if the type we found for va_list works, and have
- a fall-back plan for when it doesn't.
- * gen-params: Check for sprintf return type.
- Don't emit unneeded _G_const.
- * config/mt-*: Remove unused and obsolete files.
- * vms directory: Updates from Eric Youngdale.
- * README: Minor fixes.
-
-Thu May 14 12:29:29 1992 Per Bothner (bothner@rtl.cygnus.com)
-
- * Makefile.in: Set version to 2.0.90.
- * Makefile.in: Pass new flags to test-install, now that
- test-install has been changed to to use ../libg++.a etc;
- override that to use -lg++ etc to get inststalled versions.
- * COPYING: Replace by version 2 GPL.
- * README: Explain what copyrights apply to what.
- * libg++.texinfo: Remove comments about gperf, since it
- is not part of libg++ proper (and is GPL, not LGPL).
-
- * util/gen-params: Re-order in a logical order.
- Change _G_NO_UNISTD_H to _G_HAVE_UNISTD for consistency.
- Add test for _G_FRIEND_BUG (if the compiler barfs on
- extern "C" functions as friends).
-
-Wed May 13 12:06:57 1992 Per Bothner (bothner@rtl.cygnus.com)
-
- * configure.in: Make sure to append 'depend' (if it exists)
- to each Makefile.
-
-Sat May 9 12:43:38 1992 Per Bothner (bothner@rtl.cygnus.com)
-
- * Makefile.in: Bump version to 2.0.9.
-
- * WHATS.NEW: Be more expansive.
- * configure.in: Fix some typos.
- * Various Makefile.in's: Pass $(NOSTDINC) when compiling.
- Also, fix some other CFLAGS problems.
-
-Wed May 6 11:48:32 1992 Per Bothner (bothner@rtl.cygnus.com)
-
- * utils/gen-params: Also #include <time.h> in dummy.c,
- so we can get clock_t.
-
- * utils/gen-params: Moved argument evaluation to start.
- Pass -I${gccdir}/include if using ${gccdir}/gcc.
- * Makefile.in: Pass $(XTRAFLAGS) to gen-params.
- * vms directory: Renamed _G_CONFIG.H to _G_config.h.
-
-Sat May 2 16:48:07 1992 Per Bothner (bothner@rtl.cygnus.com)
-
- * vms directory: New files from Eric Youngdale.
-
-Thu Apr 30 13:42:59 1992 Per Bothner (bothner@rtl.cygnus.com)
-
- * Makefile.in: Bump to version 2.0.8 for "progressive" release.
- * every Makefile.in: Replace gcc -O by just gcc, for constiency.
- * utils/gen-params: Rename every temp.c -> dummy.c.
- Add test for sys/resource.h, and use that instead of the
- no-longer-meaning test for sysv.
- * Makefile.in: Install sys/*.h from g++-include, not src.
- Fix so that 'make libg++.a' does the right thing.
-
-Mon Apr 20 14:59:59 1992 Per Bothner (bothner@cygnus.com)
-
- * utils/gen-params: Add introductory commentary.
- Replace tabs by space in dummy.out, so following
- sed scripts don't have to worry about tabs.
-
-Thu Apr 30 09:06:32 1992 K. Richard Pixley (rich@cygnus.com)
-
- * Makefile.in: add .NOEXPORT so that subdirs don't inherit
- bad definitions. Notably, so that libiberty doesn't inherit
- host_makefile_frag.
-
-Fri Apr 17 13:50:41 1992 Per Bothner (bothner@cygnus.com)
-
- * configure.in: Use new 'subdirs' feature of configure,
- to configure all sub-directories in one invocation of
- 'configure'. This means we can get rid of all subdir
- configure.in files, and we can share configuration files.
- * configure.in: If there is no host makefile fragment.
- generate one.
- * Makefile.in, */Makefile.in, etc: Use new configure scheme.
- Also, define CC using a test for ../gcc/gcc, not just
- a ../gcc directory. Similar for AR etc.
- * utils/gen-params: New shell script to generate a .h
- file with various system-specific parameters.
- * Makefile.in: New rule to generate _G_config.h using
- utils/gen-params. All Makefiles include the top-level
- directory in the include search path, to make sure they
- get _G_config.h (which is the the libg++ build directory,
- not the srcdir).
-
-Mon Mar 23 16:46:01 1992 Per Bothner (bothner@rtl.cygnus.com)
-
- * libg++.texinfo: Remove references to itoa and similar
- deprecated functions that return a pseudo-static buffer
- (allocated by AllocRings). Replace by reference
- to (new) printon() methods.
-
-Tue Mar 10 18:06:49 1992 Per Bothner (bothner@cygnus.com)
-
- * Makefile.in: Bump to version 2.0.
- * Makefile.in (dist): Fix to avoid symlink cycles.
-
-Sat Mar 7 19:36:35 1992 Per Bothner (bothner@cygnus.com)
-
- * Makefile.in (dist): Handle '.' as a srcdir.
-
-Sat Mar 7 00:03:05 1992 K. Richard Pixley (rich@rtl.cygnus.com)
-
- * Make.defs: removed.
-
- * libg++.texinfo: added menu item hook.
-
-Fri Mar 6 16:51:58 1992 K. Richard Pixley (rich@cygnus.com)
-
- * Makefile.in: bump version to 1.99.
-
-Fri Mar 6 15:53:13 1992 Per Bothner (bothner@cygnus.com)
-
- * Makefile.in: Remove some obsolete stuff.
- * README, WHATS.NEW: Update.
- * PROBLEMS renamed to TODO.
-
-Thu Mar 5 00:18:15 1992 Heinrich G. Seidl (hgs@cygnus.com)
-
- * configure.in, Makefile.in: use `g++' as compiler for the library
- as does the user.
-
- * Make.defs: use again awk for depend rules, since sed
- has too many bugs (sun's and GNU).
- utils/g++dep.sh: print each dependency on one line
-
-Wed Mar 4 12:04:45 1992 Per Bothner (bothner@cygnus.com)
-
- * Makefile.in: Don't pass $(MAKE_ENVIRON) to test-install,
- since we're trying to test the *installed* compiler.
- Also, install-progs before the test-install.
-
-Tue Mar 3 23:01:05 1992 Per Bothner (bothner@cygnus.com)
-
- * PROBLEMS: Added to list of things to do.
-
-Tue Mar 3 21:06:38 1992 Heinrich G. Seidl (hgs@rtl.cygnus.com)
-
- * Created `utils' directory and moved "progs" from
- `etc' into `utils'.
- Makefile.in: `all' builds only programs and the libary,
- `check' builds all in `tests' and `etc' and
- runs the tests.
- Some minor bug fixes to Makefiles.
-
-Tue Mar 3 16:58:38 1992 Per Bothner (bothner@cygnus.com)
-
- * vms directory: New files from
- Eric Youngdale <youngdale@v6550c.nrl.navy.mil>.
-
-Sun Mar 1 17:17:54 1992 Per Bothner (bothner@cygnus.com)
-
- * Makefile.in: Added 'check' and 'etc-tests' rules.
-
-Thu Feb 27 17:05:49 1992 Per Bothner (bothner@cygnus.com)
-
- * Make.defs: Change GXX from g++ to gcc, since g++
- passes -lg++ to ld, which may not be installed yet.
-
-Wed Feb 26 18:04:40 1992 K. Richard Pixley (rich@cygnus.com)
-
- * Makefile.in, configure.in: removed traces of namesubdir,
- -subdirs, $(subdir), $(unsubdir), some rcs triggers. Forced
- copyrights to '92, changed some from Cygnus to FSF.
-
-Wed Feb 26 12:46:49 1992 Per Bothner (bothner at cygnus.com)
-
- * Make.defs: Change IDIR to use libdir instead of
- datadir, to be compatible with FSF's gcc-2.0.
- * Makefile.in: Removed bogus '@' prefix in rule.
-
-Wed Feb 26 01:24:34 1992 Michael Tiemann (tiemann at cygnus.com)
-
- * Make.defs: Propagate XTRAFLAGS into MAKE_ENVIRON.
-
-Wed Feb 19 23:23:02 1992 Per Bothner (bothner at cygnus.com)
-
- * Make.defs: Add IO_SRCDIR macro to name source
- of either isotream or old-stream. This allows
- an independent iostream distribution.
- * Make.defs (depend rule): Create empty file if no sources.
- * README: Move change summary to WHATS.NEW.
- * WHATS.NEWS: Minor updates (and merge).
- * COPYING-LIB: New file defining Library Licence.
-
-Sat Feb 15 13:06:50 1992 Per Bothner (bothner at cygnus.com)
-
- * Makefile.in (dist): Add some more top-level (above
- libg++) files to the distribution.
-
- * Makefile.in: Bumped LIBG++_DIST_VERSION to 1.91.
- * README: Made some very inadequate updates.
-
-Mon Feb 10 11:28:19 1992 Per Bothner (bothner at rtl.cygnus.com)
-
- * libg++.texinfo: Discourage use of AllocRings,
- and encourage care using String::operator const char *.
- (The latter has just now been changed to not copy
- using an AllocRing.)
-
-Fri Feb 7 11:46:18 1992 Per Bothner (bothner at cygnus.com)
-
- * Makefile.in: Added LIBG++_DIST_VERSION; set it to 1.90.
- Added 'dist' rule to make distribution tar file.
- * libg++.texinfo: Preliminary changes to document
- new iostream facilities.
-
-Fri Jan 31 17:13:11 1992 Per Bothner (bothner at cygnus.com)
-
- * WHATS.NEW: New file, to document recent changes.
-
-Wed Jan 29 12:54:10 1992 Per Bothner (bothner at cygnus.com)
-
- * Make.defs: Change LIBDIR and IDIR so that libg++.a and
- g++-include/* go info $(libdir) and $(datadir)/g++-include.
- Thus we don't have to worry about gcc's $(libsubdir)
- depending on gcc's version number.
- Also, add compilation rules for *.C.
-
-Sat Jan 25 15:59:01 1992 Per Bothner (bothner at PersSony)
-
- * Make.defs, all Makefile.in files: Centralize rules for
- depend, FORCE, and Makefile in MAke.defs. Remove such
- rules from every Makeifle.in.
- * Makefile.in: Don't pass GXXFLAGS or EH_FILES to sub-makes.
-
-Fri Jan 17 15:32:01 1992 Per Bothner (bothner at cygnus.com)
-
- * Make.defs: Make iostream be the default value of IO_DIR.
- Removed duplicate -I$(SRCIDIR) from COMPILE.cc macro.
-
-Sun Jan 5 00:23:20 1992 Per Bothner (bothner at cygnus.com)
-
- * Makefile.in, Make.defs, old-stream/Makefile.in:
- Fix install-include-files rule.
- * Makefile.in, Make.defs: Move installation directory
- names and INSTALL defines from former to latter.
- * configure.in: Add test-install directory.
-
- * Makefile.in, Make.defs: Move stuff from former to latter.
- * Make.defs: Allow switching between old stream and new
- iostream library. Allow use from any sub-directory.
- * configure.in: Add old-stream and gperf sub-directories.
-
-Fri Jan 3 16:36:31 1992 Per Bothner (bothner at cygnus.com)
-
- * Complex.h, Fix.h, String.h, gen/DLList.ccP, gen/SLList.ccP,
- gen/Plex.ccP, gen/Vec.hP: Add #include <builtin.h> as needed.
- It was included by the old stream.h, but not by the new iostream.h.
- * String.h: Fix some portabilty problems that depended
- on the old stream code.
-
-Thu Jan 2 21:07:04 1992 John Gilmore (gnu at cygnus.com)
-
- * Makefile.in (info, install-info, clean-info): Handle info files.
- (assorted): Clean up unused macros, etc.
-
- * libg++.texinfo: Minor lint found by makeinfo and tex.
-
-Tue Dec 31 18:16:12 1991 Per Bothner (bothner at cygnus.com)
-
- Changes that allow makes to take be made either from here,
- or directly in a sub-directory.
- * Make.defs: New file to contain defiitions shared between
- libg++ sub-directories.
- * Makefile.in: Removed stuff now in Make.defs.
- * configure.in: Add iostream to configdirs.
- Define host_makefile_frag to pull in Make.defs.
-
-Tue Feb 19 06:41:00 1991 Doug Lea (dl at g.oswego.edu)
-
- * malloc.c: Don't override use of libg++ version of bcopy
- for SYSV users
-
- * timer.cc: Removed ifdefs for tek4300, since they are reported
- not to be necessary or useful
-
- * CursesW.h, curses.h: removed touchline and touchoverlap,
- since they are apparently nonstandard, and aren't supported
- in most C curses libraries.
-
- * Removed test0 and twrapper from tests, since
- they are not fully supported in g++-1.39.0
-
-Sat Jan 26 05:24:22 1991 Doug Lea (dl at g.oswego.edu)
-
- * signal.h: Reinstate full path name of C version of signal.h
-
-Fri Jan 25 08:45:09 1991 Doug Lea (dl at g.oswego.edu)
-
- * BitSet.h, BitString.h: pos and index fns inlined regardless
- of __OPTIMIZE__, since needed elsewhere.
-
- * RNG.h killed redundant #ifdef __GNU__
-
-Fri Dec 28 06:31:03 1990 Doug Lea (dl at g.oswego.edu)
-
- * FPQueue.hP, FPStack.hP: removed defaults from defs (kept in decls)
-
-Sat Dec 22 14:51:40 1990 Doug Lea (dl at g.oswego.edu)
-
- * Integer.cc; atoIntRep: pulled sgn assignment out of loop
-
-Fri Dec 14 16:43:04 1990 Doug Lea (dl at g.oswego.edu)
-
- * Complex.cc: Fixed pow(Complex, Complex), and added
- pow(Complex, double), from thc@cs.brown.edu
-
-Wed Dec 12 11:47:51 1990 Doug Lea (dl at g.oswego.edu)
-
- * malloc.c: Killed prototype decls of fputs, fprintf;
- just use whatever stdio.h gives.
-
-Thu Nov 29 13:02:32 1990 Doug Lea (dl at g.oswego.edu)
-
- * dtoa.cc: better bounds for workspace arrays
-
-Wed Nov 7 05:53:36 1990 Doug Lea (dl at g.oswego.edu)
-
- * ACG.cc: function LCG marked as static
-
-Sun Oct 28 05:32:30 1990 Doug Lea (dl at g.oswego.edu)
-
- * std.h: ioctl decl now has void*, not char* as last param, since
- sometimes need to pass in structs.
-
-Sat Oct 20 05:51:21 1990 Doug Lea (dl at g.oswego.edu)
-
- * sys/socket.h: added getpeername decl
-
-Tue Oct 16 08:00:14 1990 Doug Lea (dl at g.oswego.edu)
-
- * Integer.cc (div) Overallocate `r' if necessary to ensure
- trailing 0.
-
-Mon Oct 15 05:11:09 1990 Doug Lea (dl at g.oswego.edu)
-
- * EH2.c: Added __raise_exception from tiemann
-
-Thu Oct 11 05:50:34 1990 Doug Lea (dl at g.oswego.edu)
-
- * VHMap.ccP, CHMap.ccP. Base initializers explicitly name base
- classes in constructors
-
-Sat Oct 6 08:56:56 1990 Doug Lea (dl at g.oswego.edu)
-
- * RNG.cc: `volatile' added for vars that might have
- greater precision in FP hardware than in memory, to
- force comparisons to be done with memory versions,
- thus avoiding rounding error.
-
- * Incorporated patches for graph from rich@rice.edu
-
- * CHMap.hP: Fixed ifdef name to match class name for <T><C>CHNode
-
-Sun Sep 30 06:50:45 1990 Doug Lea (dl at g.oswego.edu)
-
- * pow.cc: removed redundant tests
-
-Tue Sep 4 15:07:35 1990 Doug Lea (dl at g.oswego.edu)
-
- * Regex.cc: Don't die when someone declares Regex(0).
-
-Mon Aug 27 06:06:08 1990 Doug Lea (dl at g.oswego.edu)
-
- * curses.h, CursesW: added vax to list of implementations not
- supporting touchline & touchoverlap
-
-Thu Aug 23 05:46:16 1990 Doug Lea (dl at g.oswego.edu)
-
- * std.h, resource.h text.hello.cc: more changes for i386
-
- * sys/wait.h: Include <sys/resource.h>, not <resource.h>
-
- * MPlex.hP: low() now returns lowest valid index. Similar
- changes elsewhere.
-
- * (stdio.h, math.h...) Installed patches for HPUX 7.0
-
-Mon Aug 13 08:17:29 1990 Doug Lea (dl at g.oswego.edu)
-
- * istream.h: ctor istream(int filedesc, char* buf, int buflen,
- int sk, ostream* t = 0) -- made sk non-default to
- prevent ambiguous matches.
-
- * Makefiles: rearrangements, patches from Ron Guillmette
- to enable compiles of etc and gperf files without install
-
- * Added swap.h, from Ron Guilmette. Apparently needed for
- Hansen's C++ answer book code.
-
- * String.h: String operator() made a synonym for at(int, int),
- for compatibilty with Hansen's classes.
-
- * ostream.h: added ostream << (const void * p) to print p in hex.
-
- * std.h: qsort should return void; srand takes unsigned arg
- (required under USG, doesn't matter for others).
-
- * Added complex.h, to include Complex.h & typedef Complex complex;
- similarly with strclass.h
-
- * builtin.h: Added min & max inlines; added min.h, max.h,
- minmax.h, and abs.h to just include builtin.h
-
- * values.h: defined HIBITS, HIBITL
-
- * CursesW.h, curses.h: sequent patches from jw@sics.se
-
- * streambuf.h: sputback renamed sputbackc for AT&T 1.2 compatibility
-
-Sat Aug 11 08:01:00 1990 Doug Lea (dl at g.oswego.edu)
-
- * MPlex.ccP: fixed off by one errors reported by bashford@scripps.edu
-
- * stdio.h: more patches from will@nirvana.westford.ccur.com
-
- * made #pragma implementation files for ctype, MIN, MAX, std,
- curses, compare, math. Changed .h files accordingly
-
-Thu Aug 9 06:19:17 1990 Doug Lea (dl at g.oswego.edu)
-
- * SmplHist.h: fixed bad #include
-
-Wed Aug 8 09:49:56 1990 Doug Lea (dl at g.oswego.edu)
-
- * Shortened all .h and .cc file names to work for SYSV,
- even ones preoviously OK because they were in own subdir.
- Necessary for #pragma interface. Yuck.
-
-Mon Aug 6 09:54:23 1990 Doug Lea (dl at g.oswego.edu)
-
- * stdio.h, math.h, etc., added masscomp support from
- will@nirvana.westford.ccur.com
-
- * twrapper, tgwrapper: killed now-unnecessary deletes
-
-Wed Jul 25 10:05:13 1990 Doug Lea (dl at g.oswego.edu)
-
- * stdio.h: new #defines for i386
-
- * DLList.ccP (ins_after). Prepend if null pix, as stated in doc.
-
- * installed malloc.c revisions
-
-Fri Jul 20 12:00:05 1990 Doug Lea (dl at g.oswego.edu)
-
- * ostream.h (put) prevent sign extension comparing against EOF
-
-Tue Jul 17 10:06:12 1990 Doug Lea (dl at g.oswego.edu)
-
- * libg++.texinfo updated
-
-Thu Jul 12 08:10:07 1990 Doug Lea (dl at g.oswego.edu)
-
- * added Maxima.h from Igor Metz <metz@iam.unibe.ch>
-
-Fri Jul 6 06:19:32 1990 Doug Lea (dl at g.oswego.edu)
-
- * etc/PlotFile3D: updates from ngo
-
- * time.h don't include /usr/include/time.h on NeXT
-
-Mon Jul 2 07:48:51 1990 Doug Lea (dl at g.oswego.edu)
-
- * installed VMS patches from Eric Youngdale
- <YOUNGDALE@v6550c.nrl.navy.mil>
-
- * filebuf.cc (underflow) only reset iobuf ptrs if successful
-
- * filebuf.cc (overflow) loop ::write's in case whole
- request can't be satisfied in one
-
-Sat Jun 23 12:18:54 1990 Doug Lea (dl at g.oswego.edu)
-
- * added bcopy.c, compiled ifdef USG, to guarantee compatibility,
- from Eric Newton. Changed corresponding std.h declarations.
-
- * std.h: added declarations for re_comp, re_exec
-
- * (.h's, .hP's) added conditional compilation of
- inlines under optimization only for all files
- with #pragma interface
-
-Thu Jun 7 08:23:10 1990 Doug Lea (dl at g.oswego.edu)
-
- * killed all g++ prefix const member functions, since they
- are no longer supported in g++.
-
- * (everywhere) added support for #pragma interface
- and #pragma implementation; undid .il files since these
- will be done via same mecahnism in g++.
-
-Fri May 25 10:39:18 1990 Doug Lea (dl at g.oswego.edu)
-
- * filebuf.cc (open) O_WRONLY added to append mode flags
-
-Sun May 6 09:27:06 1990 Doug Lea (dl at g.oswego.edu)
-
- * Complex.cc operator /(Complex&) replaced with that from
- romine, that avoids potential under & overflow.
-
- * std.h; Commented out declaration for umask, pending a better
- fix, since it is wrong for SunOS4.1
-
- * File.cc, Curses.cc: patches to work with vsscanf from bothner
-
-Tue May 1 07:45:29 1990 Doug Lea (dl at g.oswego.edu)
-
- * math.h #include <math-68881.h> belongs inside extern "C"
-
-Fri Apr 27 06:15:32 1990 Doug Lea (dl at g.oswego.edu)
-
- * String.cc (ncopy0): null terminate even if same source
-
-Thu Apr 19 07:29:24 1990 Doug Lea (dl at g.oswego.edu)
-
- * Map.ccP (Map::error): error message reads "Map", not "Set"
-
-Tue Apr 17 10:32:25 1990 Doug Lea (dl at g.oswego.edu)
-
- * Stack, Queue, Set, Bag, Map .hP : added virtual destructors
-
-Fri Apr 6 07:05:31 1990 Doug Lea (dl at g.oswego.edu)
-
- * List.hP (pop) patch from dsouza
-
-Wed Apr 4 12:21:29 1990 Doug Lea (dl at g.oswego.edu)
-
- * Makefiles: use make var AR, not just ar
-
- * streambuf.cc (setbuf) delete old base if one was allocated
-
-Tue Apr 3 08:07:45 1990 Doug Lea (dl at g.oswego.edu)
-
- * time.h, std.h: changes for convex from schmidt
-
- * installed new malloc.c, with valloc & memalign added.
-
-Thu Mar 29 08:28:16 1990 Doug Lea (dl at g.oswego.edu)
-
- * stddef.h : added offsetof macro.
-
-Tue Mar 20 11:24:41 1990 Doug Lea (dl at g.oswego.edu)
-
- * Sample.cc: Confidence intervals now call t with degrees of freedom,
- (n-1), not n.
-
-Sat Mar 17 10:17:02 1990 Doug Lea (dl at g.oswego.edu)
-
- * All genclass-able files moved to g++-include/gen.
- genclass.sh script file changed accordingly.
-
- * (Everywhere) All X.h file inlines moved to il/X.il,
- and only inlcuded when optimizing. Backup libg++.a
- versions now generated via src/Xi.cc files.
- Exceptions: ctype.h, and std.h (for SysV->Bsd conv (like bcopy))
-
- * Regex.h now a separate file from String.h
-
-Mon Mar 12 06:53:57 1990 Doug Lea (dl at g.oswego.edu)
-
- * RPlex.cc:<T>RPlex:: <T>RPlex(int l, int chunksize). Fixed
- incorrect biasing of initial chunk indices.
-
-Sun Mar 11 05:40:29 1990 Doug Lea (dl at g.oswego.edu)
-
- * timer.cc: ifdef USG -> if defined(USG) || defined(tek4300)
-
-Wed Feb 28 05:27:15 1990 Doug Lea (dl at g.oswego.edu)
-
- * gperf: patches from schmidt
-
- * Makefiles: removed dependencies on /usr/include files
-
-Tue Feb 27 05:21:22 1990 Doug Lea (dl at g.oswego.edu)
-
- * Installed c++-mode.el update from detlefs
-
-Mon Feb 26 08:03:32 1990 Doug Lea (dl at g.oswego.edu)
-
- * Incremental.h now includes a default destructor to avoid linking
- problems. Thanks to eirik@elf.TN.Cornell.EDU.
-
- * all `error' routines now have const char*, not char* args.
-
- * Plex classes revamped to support const Plexes. Also,
- removed `changes', `changed', since they aren't necessary anymore
-
-Sat Feb 24 05:56:13 1990 Doug Lea (dl at g.oswego.edu)
-
- * File.h verbose_error_handler, et al now have const char*, not
- char* args
-
- * Installed EH2.cc in src
-
-Mon Feb 19 08:34:51 1990 Doug Lea (dl at g.oswego.edu)
-
- * installed Ngo's PlotFile3D in libg++/etc
-
-Sat Feb 17 05:28:25 1990 Doug Lea (dl at g.oswego.edu)
-
- * installed Schmidt's gperf, trie-gen, and Patricia revisions
-
- * String.cc pos <= 0 should be pos < 0
-
-Tue Feb 13 08:21:11 1990 Doug Lea (dl at g.oswego.edu)
-
- * Itolong (Integer.cc) patch from salzman@rand.org
-
-Mon Feb 12 08:21:07 1990 Doug Lea (dl at g.oswego.edu)
-
- * allowed separate inclusion of ostream.h, istream.h and/or stream.h
-
-Thu Feb 8 07:02:49 1990 Doug Lea (dl at g.oswego.edu)
-
- * PlotFile: patches from ngo for Convex byte-ordering.
-
-Tue Feb 6 06:29:11 1990 Doug Lea (dl at g.oswego.edu)
-
- * Vec.ccP: sort() killed goto, replaced with nested if's,
- since g++ complains about binding contours.
-
-Sat Feb 3 08:30:06 1990 Doug Lea (dl at g.oswego.edu)
-
- * Getopt.h: opterr is public, not private
-
- * builtin.cc, Random.cc, streambuf.cc broken into little pieces
-
- * std.h getpgrp, setpgrp now have (...) signatures, since
- some versions on some systems have arguments.
-
- * put in malloc revision
-
- * prepend-header: globbing changes via ngo's patches
-
- * Plex: fixed declaration mismatches for fill
-
-Tue Jan 30 10:22:35 1990 Doug Lea (dl at g.oswego.edu)
-
- * kmp.cc: modified to use libg++ GetOpt, not libc getopt
-
-Wed Jan 24 05:47:53 1990 Doug Lea (dl at g.oswego.edu)
-
- * broke out struct xyzzy from builtin.cc into its own file in /src
-
-Sun Jan 21 09:44:10 1990 Doug Lea (dl at g.oswego.edu)
-
- * sys/types.h: protect wchar_t and ptrdiff_t from /usr/include version
-
- * stddef.h: wchar_t now defaults as unsigned short
-
-Sat Jan 20 08:51:01 1990 Doug Lea (dl at g.oswego.edu)
-
- * sys/file.h KERNEL now defined only if ultrix.
- Also a typo: file_f should be file_h
-
-Fri Jan 19 05:18:03 1990 Doug Lea (dl at g.oswego.edu)
-
- * malloc.c: added #ifndef NO_NEW_HANDLER, so malloc.c
- compilable in C environments with no new handlers, and
- other #ifdefs to make it C++-compilable as well.
-
-Tue Jan 16 04:54:27 1990 Doug Lea (dl at g.oswego.edu)
-
- * libg++-1.36.3 released.
-
- * etc/benchmarks: enabled various options, now that
- g++ works with them.
-
- * values.h vax MAX/MINFLOAT changed to be same as expected by gcc.
-
- * streambuf.cc: Filebuf::overflow(): Fp->eof() is not an
- error condition.
-
- * std.h, stdio.h: more extern C fns declared as
- returning int, not void when not specified as void by ANSI
- or C man pages.
-
-Sat Jan 13 13:41:29 1990 Doug Lea (dl at g.oswego.edu)
-
- * stdio.h: puts returns int
-
-Fri Jan 12 05:49:09 1990 Doug Lea (dl at g.oswego.edu)
-
- * etc/lf/Dirent.h closedir returns void on some system, so
- Dirent versions do too.
-
-Wed Jan 10 10:01:15 1990 Doug Lea (dl at g.oswego.edu)
-
- * Rational.h: 175 typo
-
-Mon Jan 8 09:43:14 1990 Doug Lea (dl at g.oswego.edu)
-
- * file.h: more protection against getting bad fn declarations
- from /usr/include
-
- * builtin.cc: removed dependency on float.h
-
- * String.h Join, replicate need to be friends
-
-Sat Jan 6 08:48:18 1990 Doug Lea (dl at g.oswego.edu)
-
- * from rfg: minor DGUX accomodations in std.h, stdio.h,
- math.h
-
-Fri Jan 5 06:41:02 1990 Doug Lea (dl at g.oswego.edu)
-
- * from Widen: added warning about tCurses needing linefeeds
- on broken libcurses, fixed misc typos, added cfree() to malloc.c
-
- * math.h -- added inline defs of isnan and isinf for sequents
-
-Wed Jan 3 08:29:43 1990 Doug Lea (dl at g.oswego.edu)
-
- * builtin.cc: Deleted global _libgxx_io_oblast: no longer needed
- killed extern decls of it elsewhere.
-
- * Strings, Integers: finished/cleaned up previous changes
-
-Tue Jan 2 10:43:29 1990 Doug Lea (dl at g.oswego.edu)
-
- * Integer.cc: isolated copy and clear calls to allocation fns
-
- * Strings: Removed StrTmp class, added double concatenation
-
-Mon Dec 11 08:31:48 1989 Doug Lea (dl at g.oswego.edu)
-
- * AVLSet.cc op &= plugged little memory leak: when u is exhausted,
- but t isn't, delete rest of t.
-
- * AVLMap: _delete: cont field wasn't copied in a case it should
- have been
-
- * merged tSet2 back into tSet and tBag2 back into tBag
-
- * BitSet.cc (BitSetCompl) ensure all 1's in s[0] when
- complementing empty set
-
- * builtin.cc (return_elapsd_time, set_timer) No longer #ifdef'ed
- for machines -- new .h organization should work for all.
-
- * builtin.cc (lg) redeclared as unsigned->long
-
- * DGUX patches from rfg installed
-
-Tue Dec 5 11:58:51 1989 Doug Lea (dl at g.oswego.edu)
-
- * BitSet, Integer, Rational: added constness, removed Tmp
- classes, and used named return values
-
-Sat Dec 2 06:21:12 1989 Doug Lea (dl at g.oswego.edu)
-
- * builtin.cc (dtoa) #if _IEEE != 0 handle isnan, isinf
-
- * builtin.cc (itoa) force unsigned division in case
- num == MININT
-
-Fri Dec 1 10:08:21 1989 Doug Lea (dl at g.oswego.edu)
-
- * istream::operator>> clear eof if at eof but got something valid
-
- * String::match and Regex::match return -1 on failure, since
- 0 could be a legal value
-
- * gnulib3.c: Commented out ON_EXIT stuff. On Suns, for some
- reason, on_exit routines don't link into libraries right.
-
- * std.h: fixed getopt proto
-
- * stat.h : added fn protos
-
- * installed Schmidt's reorganization of etc
-
- * math-68881.h fix paren error noted on bug-gcc list
-
- * CursesWindow(WINDOW*) initialize sib
-
- * Renamed AllocQueue to AllocRing
-
- * test.hello.cc #ifdefs for MIPSEL
-
- * Plex::del_chunk() delete the chunk, not just the chunk's data
-
-Sat Nov 25 12:50:06 1989 Doug Lea (dl at g.oswego.edu)
-
- * VStack, VQueue: add operator =()
-
- * Obstack::Obstack don't allocate on constructor, just on
- first use
-
- * String::_gsub: don't build new rep if no matches
-
- * builtin.h: added more versions of abs
-
- * installed new malloc, and new.{h, cc}
-
-
-Thu Nov 23 06:20:17 1989 Doug Lea (dl at g.oswego.edu)
-
- * added Schmidt's g++dep to etc
-
- * math.h: additions for anint(), etc., HP HAVE_FPU
-
-Wed Nov 22 14:48:24 1989 Doug Lea (dl at g.oswego.edu)
-
- * Added Schmidt's trie-gen to libg++/etc
-
-Tue Nov 21 08:50:47 1989 Doug Lea (dl at g.oswego.edu)
-
- * streambuf: eptr is now the pointer to the last valid
- char in buffer, not the fence pointer, for AT&T compatibilty
-
- * stream, streambuf : Added line buffered put's as default
- must #define NO_LINE_BUFFER_STREAMBUF to override
-
-Mon Nov 20 09:52:47 1989 Doug Lea (dl at g.oswego.edu)
-
- * Plex: finish previous change: add_low, add_high don't introduce
- straggling chunks
-
- * new.h: typo, plus add default placement version of new()
-
- * PlotFile, BitString, Fix16 .h's: more cfrontisms
-
-Sun Nov 19 07:38:36 1989 Doug Lea (dl at g.oswego.edu)
-
- * removed File::operator FILE*() because it can lead
- to ambiguities.
-
- * incorporated cfront-dependent #ifdefs, etc. from Schmidt
-
- * Fix24: integrated patches from wang
-
-Sat Nov 18 07:17:04 1989 Doug Lea (dl at g.oswego.edu)
-
- * XPlex, RPlex, MPlex (del_low, del_high) old straggling
- empty chunks weren't being deleted. fixed.
-
-Thu Nov 16 05:56:43 1989 Doug Lea (dl at g.oswego.edu)
-
- * resource.h: added getrlimit, setrlimit
-
-Wed Nov 15 05:54:46 1989 Doug Lea (dl at g.oswego.edu)
-
- * String.h: typo const& Regex => const Regex&
-
-Fri Nov 10 06:45:55 1989 Doug Lea (dl at g.oswego.edu)
-
- * Makefile: force submakes in non-gnumake fashion
-
-Thu Nov 9 09:32:21 1989 Doug Lea (dl at g.oswego.edu)
-
- * Curses.cc, curses.h, ctype.h: patches based on darrlyo's stuff.
-
- * Fix.cc : *Correctly* installed ++i patch!
-
-Wed Nov 8 06:19:39 1989 Doug Lea (dl at g.oswego.edu)
-
- * stdio.h now is now sub-included in other .h's needing USG-based
- info.
-
- * new etc/c++-mode.el from detlefs
-
- * etc/Makefile: -DETAGS for etags.c
-
- * more HPUX patches from darrylo and mike fion
-
-Tue Nov 7 07:23:25 1989 Doug Lea (dl at g.oswego.edu)
-
- * Fix.{h, cc}: cleanup in search of memory leaks
-
- * Added -DNO_GNULIB3 option in top-level Makefile
-
-Mon Nov 6 05:53:42 1989 Doug Lea (dl at g.oswego.edu)
-
- * std.h, stdio.h, ctype.h.... HPUX and DGUX patches from
- cole & darrylo
-
- * tests/Makefile tCurses taken out of checktests
-
- * Bitset.cc: fixed underallocation in BitSettoa according to
- patch from darrylo@hpsrdmo.hp.com
-
-Sun Nov 5 06:45:26 1989 Doug Lea (dl at g.oswego.edu)
-
- * gnulib3, Incremental.h, test.hello.cc: patched
- via Eirik Fuller's incremental loading fixes
-
-Fri Nov 3 11:22:39 1989 Doug Lea (dl at g.oswego.edu)
-
- * 1.36.0 released, after misc cleanup
-
-Tue Oct 31 09:44:32 1989 Doug Lea (dl at g.oswego.edu)
-
- * added Rich Murphey's graph program to libg++/etc
-
-Mon Oct 30 10:13:07 1989 Doug Lea (dl at g.oswego.edu)
-
- * sys/file.h: include types.h & maybe fcntl.h Some folks need them
-
- * std.h: index, bcopy, etc. now inline, not macro if USG
-
- * streambuf.h: sputback returns success;
- stream.h istream::putback/unget: set(_fail) if bad
-
-Tue Oct 24 16:53:05 1989 Doug Lea (dl at g.oswego.edu)
-
- * stddef.h -- now really defines size_t. OK via new sys/types.h
- fake-out.
-
- * time.h -- now includes //usr/include/time.h too
-
-Sun Oct 22 07:58:36 1989 Doug Lea (dl at g.oswego.edu)
-
- * String.h, cc: reworked to allow proper operation for consts
- (some new stuff #ifdef'ed out because of g++ problems)
-
-Sat Oct 21 15:29:55 1989 Doug Lea (dl at g.oswego.edu)
-
- * Fix.cc: (new_Fix) cure for d < 0 problem from eirik fuller
-
- * builtin.cc: added dtoa
-
- * AllocQueue.h,cc: added it & use elsewhere for building
- formatting & ascii conversions
-
-Wed Oct 18 05:37:11 1989 Doug Lea (dl at g.oswego.edu)
-
- * Fix16.cc, Fix24.cc: Fixed operator / per wang's suggestions
-
-Tue Oct 17 06:47:25 1989 Doug Lea (dl at g.oswego.edu)
-
- * stream.cc, Integer.cc: istream op >>, fixed to not read
- after EOF when decoding numbers
-
-Mon Oct 16 15:33:11 1989 Doug Lea (dl at g.oswego.edu)
-
- * added ostream << long long, and itoa's to handle
-
- * values.h, stdio.h, Fix.cc, File.cc: things for convex from
- convex!csmith@uxc.cso.uiuc.edu
-
-Sat Oct 14 07:19:30 1989 Doug Lea (dl at g.oswego.edu)
-
- * time.h: typedef'ed timezone to c_proto_timezone if not USG
-
-Wed Oct 11 09:42:39 1989 Doug Lea (dl at g.oswego.edu)
-
- * Makefiles: fixed various typos
-
- * misc: cleaned up enum clashes reported with -Wenum-clash
-
- * stream.cc Added #ifdefs to use filebufs for standard streams
- if Filebufs give people trouble.
-
-Tue Oct 3 07:02:56 1989 Doug Lea (dl at g.oswego.edu)
-
- * setjmp.h: now #includes host /usr/include/setjmp.h
-
-Mon Oct 2 16:00:59 1989 Doug Lea (dl at g.oswego.edu)
-
- * commented out gcc constness in revised Complex.h since
- it's still officially illegal to declare fns with refs(ptrs)
- as const
-
- * incorporated new gperf from schmidt
-
- * added dhrystone benchmark to etc
-
-Sat Sep 30 09:02:07 1989 Doug Lea (dl at g.oswego.edu)
-
- * Complex.h: revamped to use const, etc.
-
-Fri Sep 29 06:58:56 1989 Doug Lea (dl at g.oswego.edu)
-
- * added src/EH.cc from tiemann
-
- * SLList.hP now #include's the <T>.defs file
-
- * CHSet, CHBag, CHMap, VHSet, VHBag, VHMap -- changed ints
- to unsigned ints to ensure unsigned operations throughout.
-
-Mon Sep 25 07:32:11 1989 Doug Lea (dl at g.oswego.edu)
-
- * added new.h
-
-Sun Sep 24 05:31:50 1989 Doug Lea (dl at g.oswego.edu)
-
- * tgwrapper.cc: added init_nil to avoid crashes on exit.
-
- * other miscellaneous cleanup (fixed enum/int clashes, etc.) to
- adapt to latest g++-1.36.0-
-
- * bool enum now in bool.h
-
-Thu Sep 14 06:18:46 1989 Doug Lea (dl at g.oswego.edu)
-
- * sys/socket.h: select must have void* args, since different
- systems use int* or fd_set*
-
-Wed Sep 13 11:38:19 1989 Doug Lea (dl at g.oswego.edu)
-
- * builtin.cc: added unsigned versions of itoa, hex, dec, oct
-
-Tue Sep 12 09:28:01 1989 Doug Lea (dl at g.oswego.edu)
-
- * more misc. cleanup to avoid warnings: removed redundant
- type information from declarations of all coercion operators.
-
-Sat Sep 9 06:25:03 1989 Doug Lea (dl at g.oswego.edu)
-
- * (everywhere) miscellaneous aesthetic cleanup to minimize g++
- warning messages.
-
- * (lots of files) used 'virtual fn() = 0' for pure virtual
- functions, removing old `error(unimplemented...)' constructs.
- allowed deletion of Stack.ccP, Queue.ccP, Deque.ccP files
- which did only this.
-
- * took all defines out of libconfig.h, and killed it
- HAVE_VPRINTF, etc -> stdio.h
- CHAR_PER_LONG, etc -> Integer.cc
- SHOULD_FREE_TO_REALLOC -> (no longer needed, killed)
- USG -> people should run g++ with -DUSG now
-
-Fri Sep 8 06:48:58 1989 Doug Lea (dl at g.oswego.edu)
-
- * added Clark's version of etags that handles c++, to etc/
-
- * moved special sparc alloca decl from libconfig.h to std.h
-
- * std.h, math.h, ... killed `overload' declarations
-
- * etc/getopt* => src/GetOpt.cc, g++-include/GetOpt.h, with
- various corresponding changes
-
-Wed Sep 6 09:15:50 1989 Doug Lea (dl at g.oswego.edu)
-
- * math.h renamed `struct exception' to `libm_exception'
-
- * regex.c converted to use prototypes, etc. from schmidt
-
-Tue Sep 5 06:43:37 1989 Doug Lea (dl at g.oswego.edu)
-
- * new c++-mode.el from detlefs
-
- * added sys/param.h, which #undefs common macros, but keeps
- needed constants
-
- * Integer.h: rearranged ordering of some inlines to please g++
-
- * Fix.h: need new constructor Fix(int, _Frep*) to please g++
-
- * added __xyzzy hack from tiemann to builtin.cc
-
- * added gnulib3 from tiemann
-
-Thu Aug 31 07:36:42 1989 Doug Lea (dl at g.oswego.edu)
-
- * more USG stuff from Klossner (stdio.h, libconfig.h,
- values.h, ctype.h)
-
-Sun Aug 27 08:30:15 1989 Doug Lea (dl at g.oswego.edu)
-
- * genclass: changed to take output filename prefix argument
- to avoid long file names on SYSV; tests files change accordingly
-
- * installed gperf update from schmidt
-
- * tests: added runtests, checktests to Makefile. Some tests
- modified to suit.
-
-Sat Aug 26 09:00:14 1989 Doug Lea (dl at g.oswego.edu)
-
- * Plex, PHPQ files: deleted const qualifiers for some params
- as temporary measure until all containers revised to use
- const qualifiers as needed.
-
- * curses.h macros converted into inlines
-
- * added RankedAVLMap, based on code from paul%lfcs.ed.ac.uk
-
- * moved non-ANSI stuff (TRUE, etc., ) from stddef.h to builtin.h
-
- * added more USG stuff sent from rfg, grandi, cole, to standard headers
-
- * std.h: added #ifdef USG section for USG->BSD conversions
-
- * Makefiles: made more things adjustable, better USG support
-
- * PHPQ.ccP: (preallocate) added missing size argument to vector delete
-
-Fri Aug 25 12:25:12 1989 Doug Lea (dl at g.oswego.edu)
-
- * streambuf.cc: dumb error in filebuf::overflow
-
-Thu Aug 24 11:46:16 1989 Doug Lea (dl at g.oswego.edu)
-
- * libconfig.h, values.h: #defines for sony from jkp
-
-Wed Aug 23 06:54:43 1989 Doug Lea (dl at g.oswego.edu)
-
- * Fix16.h, Fix32.h: declared op* as friends correctly
-
- * String.h: declared StrTmp op + as friends of String
-
-Mon Aug 21 07:02:53 1989 Doug Lea (dl at g.oswego.edu)
-
- * Poisson.h, Lognormal.h: add missing `public'
-
- * assert.h: abort() declared volatile
-
- * Vec.ccP: made gsort static
-
- * std.h: added rewind & bsearch
-
- * Makefiles: deleted -fchar-charconst
-
-Thu Aug 10 07:31:37 1989 Doug Lea (dl at g.oswego.edu)
-
- * builtin.{h, cc}: added str(const char*, int width = 0)
-
- * streambuf.cc: init_streambuf_ptrs: postpone action if fp->_cnt 0
- (apparently needed for some USG systems)
-
- * stream.cc: get, getline: match AT&T 1.2 _fail conditions
-
-Sun Aug 6 07:16:19 1989 Doug Lea (dl at g.oswego.edu)
-
- * stream.cc, File.cc get(char[], int, char) read too many chars
-
-Thu Jul 20 09:42:44 1989 Doug Lea (dl at g.oswego.edu)
-
- * adapted more C-compatibility .h files from Interviews
-
-Wed Jul 19 09:23:27 1989 Doug Lea (dl at g.oswego.edu)
-
- * installed more C-compatibilty files: pwd.h, grp.h time.h
-
-Mon Jul 17 07:37:35 1989 Doug Lea (dl at g.oswego.edu)
-
- * installed Interviews/et++ compatible (I hope) signal.h
-
- * installed new version of gperf from schmidt
-
- * std.h: declared abort() and exit() as volatile
-
- * builtin.cc: typo in gcd
-
- * math.h: added overload decl for atan, etc
-
- * VHMap.cc: removed assumption that operator = returns value.
-
- * Makefiles: default dir is /usr/gnu/... not /usr/local
-
- * setjmp.h: fixed constants for sun to match those in
- sun /usr/include files, added ns32000
-
- * BSTSet.ccP added new linear-time rebalancing algorithm
-
- * builtin.cc: SYSV versions of timing stuff from ron cole
-
- * File.{h,cc} fixed File::tell, added O_CREAT to exclusive
- access open, added fill(), flush(char).
-
- * incorporated new streams: stream.{h,cc}, streambuf.{h, cc},
- libg++.texinfo
-
-
-Sat May 20 07:42:11 1989 Doug Lea (dl at rocky.oswego.edu)
-
- * math.h,math-68881.h: incorporated Fyfe's fixes to extern "C" problems
-
-Tue May 16 05:52:33 1989 Doug Lea (dl at rocky.oswego.edu)
-
- * RNG.cc ifdef _IEEE_ fixed to if _IEEE == 1
-
- * Installed Staelin's prototype Makefile updates
-
-Mon May 15 06:25:12 1989 Doug Lea (dl at rocky.oswego.edu)
-
- * BitString.h: g++ optimizer bug workaround in left_trim
-
- * math-68881.h - fgetman (not fgetmant) fix from widen
-
-Sat May 13 11:00:35 1989 Doug Lea (dl at rocky.oswego.edu)
-
- * changes from tiemann for constructs of form X::f()
- changed to this->X::f(), necessary now that static members
- are implemented. [postscript: no, it wasn't necessary]
-
- * libg++.texinfo: misc documentation updates
-
-Fri May 12 05:06:06 1989 Doug Lea (dl at rocky.oswego.edu)
-
- * (lots of places) added friends and other minor changes
- to adapt to new ``correct'' (but losing) g++ interpretation
- of `protected:'
-
- * re-inserted `overload' in .h files -- tiemann
- says that gdb needs these for now
-
- * stream.cc: eatwhite was inline by mistake. fixed.
-
-Thu May 11 07:31:06 1989 Doug Lea (dl at rocky.oswego.edu)
-
- * List.ccP: initializer class for Nil, since can't always use
- { ... } initializer. Also made `head' a synonym for `get',
- per request.
-
- * installed changes to etc files from schmidt
-
- * String.cc Scopy: return &NilSrep, not 0 for null
-
- * added math-68881.h to g++-include (from grunwald)
-
-Sun May 7 08:38:10 1989 Doug Lea (dl at rocky.oswego.edu)
-
- * catch-up day!:
- converted header files to use extern "C" and #pragma once
- killed `overload' declarations everywhere
- renamed test files
- added the beginnings of SYSV (USG) support
- included some useful stuff for Suns in top Makefile (from Guilmette)
- cleaned up other Makefiles
- added File::gets (from Schmidt)
- moved gperf from etc to a top level subdir
- added the useless char* chr(ch) to builtin.h
- genclass puts dots in file names to use Staelins GNU Makefile stuff
- (also added his `prepend-header' utility)
- added Schmidt's getopt stuff into etc.
- New versions of fixpoint classes from Baudendistel
- (needed to change set_overflow_handler to
- set_{FixXX}_overflow_handler
- for each FixXX, since overloads clash on typedef'ed fn types)
- Adapted Schmidt's new quicksort for Vec class
-
-Fri Apr 28 16:26:17 1989 Doug Lea (dl at rocky.oswego.edu)
-
- * ACG.cc: fixed ~ACG per grunwald
-
-Thu Apr 20 05:22:46 1989 Doug Lea (dl at rocky.oswego.edu)
-
- * List.hP: first for nil list now returns null Pix
-
- * Integer.cc: rshift fixed problem with 0 shifts
-
-Mon Apr 10 05:17:04 1989 Doug Lea (dl at rocky.oswego.edu)
-
- * stream.h, PlotFile.h added explicit `private' for subclasses
-
-Sat Mar 18 06:08:30 1989 Doug Lea (dl at rocky.oswego.edu)
-
- * String.[h,cc]: added Regex::match_info
-
-Fri Mar 17 14:37:12 1989 Doug Lea (dl at rocky.oswego.edu)
-
- * stream.h: istream >> char now eats whitespace.
-
- * builtin.h: overloaded `even', `odd'
-
-Thu Mar 9 06:43:43 1989 Doug Lea (dl at rocky.oswego.edu)
-
- * Map.ccP: typo in Map::contents <T> => <C>
-
- * stdio.h : inserted coercion in putc macro to avoid incorrect
- sign extension.
-
-Tue Mar 7 05:35:52 1989 Doug Lea (dl at rocky.oswego.edu)
-
- * List.hP: List::push no longer incorrectly calls dereference
-
- * Inserted patches to etc stuff from Doug Schmidt
-
-Sun Mar 5 07:57:01 1989 Doug Lea (dl at rocky.oswego.edu)
-
- * stream.h: added File::check_state to public functions
-
- * BitSet.cc: longtoBitSet: Fixed typo
-
-Sat Mar 4 10:06:24 1989 Doug Lea (dl at rocky.oswego.edu)
-
- * installed CursesWindow files
-
- * miscellaneous corrections to test files in light of
- g++-1.34 changes
-
-Fri Mar 3 06:07:37 1989 Doug Lea (dl at rocky.oswego.edu)
-
- * incorporated new version of Doug Schmidt's gperf
-
- * BitString.cc: fixed reverse searching
-
-Sun Feb 26 05:44:28 1989 Doug Lea (dl at rocky.oswego.edu)
-
- * assert : killed old assert.cc, adapted gcc assert.h
-
-Sat Feb 25 09:23:35 1989 Doug Lea (dl at rocky.oswego.edu)
-
- * tests, libg++.texinfo: miscellaneous updates
-
- * stddef.h NULL is now just `0', not (void*)0
-
- * Makefile: added `prefix' as in g++ Makefile
-
- * put a new c++-mode.el from david detlefs in etc
-
- * BitString.[h,cc] BitSet[h,cc] now use unsigned short arrays instead
- of unsigned longs to avoid long i; i >> 32, which does not
- work on Sun4s and probably other machines. Simplified
- a few shift & mask constructs accordingly.
-
- * values.h, libconfig.h: support for sequent from
- Johan Widen <mcvax!sics.se!jw@uunet.UU.NET>
-
- * Fix.h: repaired type mismatches
-
- * String.[cc,h] gsub now returns number of matches
-
- * String.cc gsub(Regex...): repaired using patches
- from kadmon!jason@mtxinu.com
-
- * stream.h scan didn't return *this if fail -- fixed.
-
- * File.cc get(char*...): get of an empty line not a _fail condition
-
- * RNG.[h,cc] installed new code from grunwald
-
-
-Tue Feb 7 05:53:23 1989 Doug Lea (dl at rocky.oswego.edu)
-
- * Integer.h,cc Added optional base to atoI via code from per bothner
-
- * String.h,cc Added `freq' method in String to count occurrences
- using code from john willis
-
-Mon Feb 6 07:25:06 1989 Doug Lea (dl at rocky.oswego.edu)
-
- * BitSet.cc:op <=, < now work if first arg shorter than second;
- clear() fixed.
- * stream.h, stream.cc: made ostream<<(char*) non-inline
-
-Sun Feb 5 05:31:36 1989 Doug Lea (dl at rocky.oswego.edu)
-
- * test19.cc: typo c.empty fixed to c.empty()
-
-Tue Jan 31 05:51:36 1989 Doug Lea (dl at rocky.oswego.edu)
-
- * String.h: contains(Regex) return fact that search returns >= 0,
- not just raw result.
-
- * Fix.h: correct protection problem in op*
-
- * replace regex.c with emacs 18.52 version
-
-Fri Jan 27 06:29:20 1989 Doug Lea (dl at rocky.oswego.edu)
-
- * AVLSet.ccP, AVLMap.ccP - check to see if root
- is null before trying to delete elements
-
- * libg++/Makefile - change install of libg++ to cd to src
-
-Sat Jan 14 06:03:33 1989 Doug Lea (dl at rocky.oswego.edu)
-
- * fixed info node pointers in libg++.texinfo
-
-Wed Jan 11 06:20:37 1989 Doug Lea (dl at rocky.oswego.edu)
-
- * libg++-1.32.0 released
- * Starting to use ChangeLog as of today
-
-
-Local Variables:
-version-control: never
-End:
diff --git a/contrib/libg++/libg++/Makefile.in b/contrib/libg++/libg++/Makefile.in
deleted file mode 100644
index 4f6d7e0cefd9..000000000000
--- a/contrib/libg++/libg++/Makefile.in
+++ /dev/null
@@ -1,263 +0,0 @@
-# Makefile for GNU C++ class library (libg++)
-# Copyright (C) 1989, 1992, 1993 Free Software Foundation, Inc.
-# written by Doug Lea (dl@rocky.oswego.edu)
-
-#This file is part of GNU libg++.
-
-#GNU libg++ 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 1, or (at your option)
-#any later version.
-
-#GNU libg++ is distributed in the hope that it will be useful,
-#but WITHOUT ANY WARRANTY; without even the implied warranty of
-#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-#GNU General Public License for more details.
-
-#You should have received a copy of the GNU General Public License
-#along with GNU libg++; see the file COPYING. If not, write to the Free
-#Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-srcdir = .
-
-# We specify exactly what we want to pass down; don't let GNU make
-# 3.63 overload the command line.
-MAKEOVERRIDES=
-
-###**######################################################################
-#
-# Directories, paths, compilation flags and program names.
-#
-# If a macro needs to have a different value, then change it in the
-# site/architecture specific makefile in the directory config !
-#
-# This file contains the documentation for the macros and possible values.
-# Don't remove them even, if they are only comments !
-
-VERSION = 2.7.2
-LIBG++_DIST_VERSION = $(VERSION)
-
-# ------- System-dependent defines
-
-# g++ so specific flags
-OSFLAG=
-
-# ld or ld++ os specific libraries
-#OSLIBS =
-
-# Comment out the next line to disable incremental linking test
-# (this test NOT included in 1.39.0, so don't re-enable) ??? H.S.
-#TEST0=test0
-#TEST0=
-
-# targets for test-install
-TEST_INSTALL = test-90S-then-clean # test-90D-then-clean
-VERIFY_GXX_INSTALLATION = foo_main # dfoo_main
-
-
-# You can override gperf to not build it at all
-GPERF = gperf
-NON_IO_SUBDIRS = genclass src $(GPERF) utils tests etc test-install
-SUBDIRS = $(NON_IO_SUBDIRS)
-ALL_SUBDIRS = $(NON_IO_SUBDIRS) old-stream no-stream
-
-UTILS = # utils
-
-# C++ compiler to use when testing that installation has succeeded.
-INSTALLED_CXX=$(bindir)/gcc
-
-ARLIB = libg++.a
-SHLIB = libg++.so.$(VERSION)
-SHARLIB = libg++-sh.a
-SHLINK = libg++.so
-MSHLINK = foo
-SHFLAGS =
-SHDEPS = -L../libstdc++ -lstdc++ -lm
-
-BUILD_LIBS = $(ARLIB)
-
-RX_OBJ = ../librx/rx.o
-
-#### package, host, target, and site dependent Makefile fragments come in here.
-##
-
-tooldir = $(exec_prefix)/$(target)
-INSTALLDIR = $(libdir)
-
-###**######################################################################
-#
-# compilation actions
-
-.PHONY: rest-in-parallel
-rest-in-parallel: .stmp-genclass .stmp-tests .stmp-etc .stmp-gperf .stmp-utils
-
-libs: $(BUILD_LIBS)
-
-# FIXME: Need to multilib librx.
-list: src/libgxx.list $(RX_OBJ)
- -rm -f tlist
- touch tlist
- for f in `cat src/libgxx.list`; do \
- echo "src/$$f" >> tlist ; \
- done
- echo "$(RX_OBJ)" >> tlist
- mv tlist list
-
-piclist: list
- -rm -f piclist
- if [ -z "$(PICFLAG)" ]; then \
- cp list piclist; \
- else \
- sed 's,\([0-9A-Za-z_]*\.o\),pic/\1,g' list > piclist ; \
- fi
-
-$(ARLIB): list
- -rm -f t$(ARLIB)
- $(AR) $(AR_FLAGS) t$(ARLIB) `cat list`
- mv t$(ARLIB) $(ARLIB)
- $(RANLIB) $(ARLIB)
-
-$(SHLIB): piclist ../libstdc++/piclist
- $(CXX) $(SHFLAGS) -shared -o $(SHLIB) `cat piclist` $(SHDEPS)
-
-$(SHARLIB): $(SHLIB)
- -rm -f t$(SHARLIB)
- $(AR) $(AR_FLAGS) t$(SHARLIB) $(SHLIB)
- mv t$(SHARLIB) $(SHARLIB)
- $(RANLIB) $(SHARLIB)
-
-$(SHLINK):
- ln -s -f $(SHLIB) $(SHLINK)
-
-$(MSHLINK):
- ln -s -f $(SHLIB) $(MSHLINK)
-
-src/libgxx.list: force
- @rootme=`pwd`/ ; export rootme ; cd src ; \
- $(MAKE) $(FLAGS_TO_PASS) libgxx.list
-
-../librx/rx.o: $(srcdir)/../librx/rx.c
- rootme=`pwd`/ ; export rootme ; cd ../librx; \
- $(MAKE) $(FLAGS_TO_PASS) rx.o
-
-.PHONY: installcheck
-installcheck: check
-
-.stmp-genclass: $(BUILD_LIBS)
- @rootme=`pwd`/ ; export rootme ; cd genclass ; \
- $(MAKE) $(FLAGS_TO_PASS) "gxx_includedir=$(gxx_includedir)"
- touch $@
-
-.stmp-tests: $(BUILD_LIBS)
- @if [ -f tests/Makefile ]; then \
- rootme=`pwd`/ ; export rootme ; cd tests ; \
- $(MAKE) $(FLAGS_TO_PASS); \
- else true; fi
- touch $@
-
-.stmp-etc: $(BUILD_LIBS)
- @rootme=`pwd`/ ; export rootme ; cd etc ; \
- $(MAKE) $(FLAGS_TO_PASS)
- touch $@
-
-.stmp-gperf: $(BUILD_LIBS)
- @if [ "x$(GPERF)" != "x" ]; then \
- rootme=`pwd`/ ; export rootme ; cd $(GPERF) ; \
- $(MAKE) $(FLAGS_TO_PASS); \
- else true; fi
- touch $@
-
-.stmp-utils: $(BUILD_LIBS)
- @if [ "x$(UTILS)" != "x" ]; then \
- rootme=`pwd`/ ; export rootme ; cd $(UTILS) ; \
- $(MAKE) $(FLAGS_TO_PASS); \
- else true; fi
- touch $@
-
-#
-#
-# Installation
-#
-
-.PHONY: install
-install:
- @if [ -f $(gxx_includedir)/unistd.h ] ; then echo; \
- echo '*** You seem to have files in $(gxx_includedir)/g++-include'; \
- echo '*** left over from an old release of libg++. These must be removed.'; \
- echo '*** Please see $(srcdir)/README for more information.'; \
- echo; \
- else \
- true; \
- fi
- rootme=`pwd`/ ; export rootme ; \
- for FILE in $(BUILD_LIBS) ; do \
- rm -f $(INSTALLDIR)$(MULTISUBDIR)/$$FILE ; \
- if [ $$FILE = $(SHLINK) ] || [ $$FILE = $(MSHLINK) ]; then \
- ln -s -f $(SHLIB) $(INSTALLDIR)$(MULTISUBDIR)/$$FILE ; \
- elif [ $$FILE = $(SHLIB) ]; then \
- $(INSTALL_PROGRAM) $$FILE $(INSTALLDIR)$(MULTISUBDIR)/$$FILE ; \
- : On the HP, shared libraries must be mode 555. ;\
- chmod 555 $(INSTALLDIR)$(MULTISUBDIR)/$$FILE ; \
- else \
- $(INSTALL_DATA) $$FILE $(INSTALLDIR)$(MULTISUBDIR)/$$FILE ; \
- $(RANLIB) $(INSTALLDIR)$(MULTISUBDIR)/$$FILE ; \
- chmod a-x $(INSTALLDIR)$(MULTISUBDIR)/$$FILE ; \
- fi ; \
- done
- @for D in src genclass $(UTILS) ; do \
- if [ -d $$D ] ; then \
- (rootme=`pwd`/ ; export rootme ; cd $$D;\
- $(MAKE) $(FLAGS_TO_PASS) "gxx_includedir=$(gxx_includedir)" install) ; \
- else true ; \
- fi ; \
- done
- if [ "x$(GPERF)" != "x" ]; then \
- rootme=`pwd`/ ; export rootme ; cd gperf ;\
- $(MAKE) $(FLAGS_TO_PASS) install; \
- else true; fi
- @rootme=`pwd`/ ; export rootme ; \
- $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=install
-
-installcheck:
- if [ "x$(TEST_INSTALL)" != "x" ]; then \
- cd test-install; $(MAKE) $(TEST_INSTALL) \
- CXX=$(INSTALLED_CXX) "CXXFLAGS=$(CXXFLAGS)" \
- COMPILE_FLAGS="" LIBS=-lg++; \
- else true; fi
-
-DIST_NAME = libg++-$(LIBG++_DIST_VERSION)
-
-$(DIST_NAME).tar.gz: dist
-
-# Making a dist:
-# cvs rtag libgxx-x-yy libg++
-# cvs co -r libgxx-x-yy libg++
-# Sanitize
-# cd {HERE}/..
-# make -f Makefile.in libg++.tar.gz
-
-diststuff: info g++FAQ.txt
-
-g++FAQ.txt: $(srcdir)/g++FAQ.texi
- $(MAKEINFO) --no-split --no-headers $< -o - \
- | sed -e '/^Concept Index/,$$d' \
- -e 's|Making info file `[---]|Making info file `g++FAQ.txt|' \
- >$@
-
-# Preprocess the texi file so that the final document will have
-# hyperlinks.
-# It would be nice if texi2html could do something like this itself.
-# Assumption 1: the FAQ puts all http: and ftp: links in a @file{...}.
-# Assumption 2: email addresses match the regexp shown.
-
-g++FAQ.html: $(srcdir)/g++FAQ.texi
- mkdir work
- sed -e 's?@file{\([fth]*p://[^}]*\)}?@strong{<A HREF="\1">\1</A>}?' \
- -e 's?\([.+a-zA-Z0-9-]*@@[.a-zA-Z0-9-]*[a-zA-Z0-9]\)?<A HREF="mailto:\1">\1</A>?' \
- $< > work/g++FAQ.texi
- cd work; texi2html g++FAQ.texi
- mv work/*.html .
- rm -r work
-
-force:
-.PHONY: $(SUBDIRS) dist force
diff --git a/contrib/libg++/libg++/NEWS b/contrib/libg++/libg++/NEWS
deleted file mode 100644
index 43983b6948df..000000000000
--- a/contrib/libg++/libg++/NEWS
+++ /dev/null
@@ -1,573 +0,0 @@
-SUMMARY OF RECENT MAJOR CHANGES to LIBG++.
-(Also check ../libio/NEWS.)
-
-*** Major changes in libg++ version 2.7.2:
-
-* The CursesW code is no longer built or supported (though the source is
- still included). This is due to portability and shared library problem.
- CursesW is now distributed with ncurses, the new curses library
- used by BSD and Linux.
-
-*** Major changes in libg++ version 2.7.1:
-
-* Include the g++ FAQ.
-
-*** Major changes in libg++ 2.7.0:
-
-* New configure scheme.
-
-*** Major changes in libg++ version 2.6.2:
-
-* A first release of the "GNU Standard C++ Library" is in the libstdc++
-directory. Building it requires gcc-2.6.1. See ./README. This library
-will contain classes and functions according to the ANSI/ISO standard.
-The copyright conditions are those of libio, not those of libg++ proper.
-[This was announced as being in 2.6.1, but got left out.]
-
-* The new libstc++ also includes a hacked-up version of the
-HP's Standard Template Library. This will eventually replace the
-container classes in libg++/src/gen. See ../libstdc++/stl/README.
-
-* Makefile support for building libg++ as a shared library.
-See README.SHLIB.
-
-*** Major changes in libg++ version 2.6.1:
-
-* The Regex class no longer uses the old GNU regex functions.
-Instead it uses the new GNU rx library (librx), written by Tom Lord.
-(The rx library is also used in new versions of GNU sed.)
-The rx library lazily constructs a deterministic finite-state
-automaton, so it seldom has to do backtracking.
-
-*** Major changes in libg++ version 2.6:
-
-* There is a new set of bit*.c and bit*.h files in the src directory.
-This is a preliminary version of language-independent library for
-general low-level manipulation of bitstrings. The BitString class
-has been (partially) re-written to use the new functions.
-(What kind of copyright to use for this library has not been
-decided yet. It will at least be OK to treat it as LGPL code.)
-
-*** Major changes in libg++ version 2.5:
-
-* The iostream directory is gone. It has been replaced by ../libio.
-The latter is a major re-write. One major change is that libiostream.a
-(which is built in ../libio) can be used independently of libg++,
-which is interesting because you may find its licensing conditions
-less onerous. See ../libio/README.
-
-Also, the guts of the code has been re-written in C instead of C++.
-This is so that you can build a C stdio implementation without
-a C++ compiler (as was needed before). However, this is not 100% done.
-
-* There is (preliminary) iostream manual (in ../libio/iostream.texi).
-
-* The files in libg++/g++-include are now obsolete. Instead, it
-is the compiler's responsibility to generate "fixed" copies of your
-existing C header files (such as /usr/include/stdio.h). These copies
-(together with a g++ compiler modification) provide C++ access
-to the standard C library. See the fixproto script in the gcc-2.5
-distribution.
-
-*** Major changes in libg++ version 2.4:
-
-* The configuration scheme has been largely re-vamped.
-Instead of the definitions that are common to all (or many) of
-the Makefiles being duplicated in each Makefile.in, they have
-now been moved into a shell script libg++/config.shared, which
-generates these standard definitions and rules.
-
-Most of libg++/tests/Makefile, which had a lot of regularity,
-is now generated by the libg++/tests/Makefile.sh shell script.
-
-Also libg++ no longer uses configure's 'subdirs' mechanism.
-Instead, it uses the 'configdirs' mechanism that most Cygnus
-packages use. This means that each directory has its own
-configure.in, and each directory can be independently re-configured.
-
-* Lots of fixes have been made so libg++ can be compiled by compilers
-other than g++ (specifically cfront), though there are still lots of
-warnings. You may still have to edit some Makefiles etc; this
-will probably become easier in the next release. Many of the
-changes involved not depending on g++ extensions. However, some changes
-turned out to be that libg++ was depending on bugs in g++'s overload
-resolution. These bugs in g++ are being fixed; this will cause some
-difficulties for libg++. In some cases, we have decided that the
-cleanest fix is removing some libg++ functionality. Specifically,
-the coersions Integer::operator long and Integer::operator double
-have been replaced by explicit methods Integer::as_long and
-Integer::as_double. This means you may need to change your code.
-Please let us know if this is problematial.
-
-*** Changes in libg++ version 2.3:
-
-* iostream classes use multiple inheritance and virtual base classes.
-This is a little more complicated and slightly less efficient,
-but saves a slight amount of code duplication. More importantly,
-it improves compatibility with other iostream implementations.
-
-* A few of pseudo-template classes have been converted to use
-real templates. The style used emphasizes sharing code for
-multiple template instatiations at the cost of somewhat more
-complex internal logic. No promise is implied about when/if
-the remaining ones will be converted. Using the template classes
-assumes gcc-2.3 or similar compiler.
-
-* Added stdiobuf class which provides a streambuf wrapper around
-a stdio (FILE*). This can be useful when mixing C and C++ code.
-
-* streambuf sputn/sgetn virtuals have been made renamed to xsputn/xsgetn,
-and sputn/sgetn addedas inline methods. This change is to be compatible
-with AT&T and ANSI; it could require changes to user code if you have
-written your own streambuf sub-classes.
-
-* New utils/c++-mode.el (for editing C++ in emacs).
-
-* Lots of little fixes all over.
-
-*** Changes in libg++ version 2.2:
-
-* Accurate input and output of floating-point numbers
-
-* 'make clean' and its variants have been made more consistent.
-
-* Improved portability (SVR4, NeXT, ...)
-
-
-*** Changes in libg++ version 2.1:
-
-* "Class" include files in g++-include moved to src
-
-Those include files that are just wrappers around C header files
-(e.g. signal.h) remain in g++-include, while the header files
-that are specific to libg++ (or C++) have been moved to src.
-If your system includes "C++-ready" C header files (as in SVR4 or
-Linux), you don't need to use the wrappers in g++-include.
-
-* Portability
-
-A lot of effort has gone into making libg++ more portable.
-Code that depends on internals of "traditional" implementations
-had been made more portable. The 'libiberty' library is incorporated
-into libg++; this supplies (if needed) many functions that may be
-missing on particular hosts.
-
-* Auto-configuration
-
-New scripts automaticly figure out various properties of the
-system (and compiler) you use. While these scripts are not
-foolproof, the intent is that on most systems you will no longer
-have to edit Makefiles or build special configuration files.
-
-* Iostream bug-fixes
-
-There have been numerous bug-fixes and enhancements in the
-iostream code. Lots of rough edges in the streambuf and filebuf
-classes have been fixed.
-
-There are still some rough edges of the protocol (as in what the
-streambuf class should do, and what sub-classes such as filebuf
-should handle).
-
-* iostream enhancements for lexing/parsing.
-
-You can now create a 'streammarker' object, which is a "remembered"
-position is a streambuf. Later, you can backtrack to that position.
-This is supposed to work, even if the streambuf is unbuffered and
-otherwise unseekable, because the streambuffer never throws away
-any data following an extant streammarker. This feature will be
-used to build various scanning/parsing facilities (with backup).
-(See iostream.texi for an example.)
-
-* stdio library
-
-Now supports all of ANSI's functionality.
-
-*** Changes in libg++ version 2.0:
-
-* iostream classes
-
-The major change is that input/output uses the new iostream library.
-The design is based on (but not identical to) iostreams from
-AT&T C++ release 2.x, and the ANSI X3J16/WG21 draft C++ standard.
-
-The iostream classes replace the old stream. The new
-package provides some compatibility hooks. Including the
-obsolete <stream.h> (or defining _STREAM_COMPAT) makes
-more obsolete methods and features available. However,
-you will probably have to change your code if you have used
-any libg++-specific extensions (such as the File class).
-
-If you want stick with the old stream classes, change the
-definition of IO_DIR in Make.defs (to old-stream). You will
-also need to 'make depend' in directories that contain depend,
-and then re-configure everything. Note that the old-stream
-classes are *not* supported and *will* go away in a future release.
-
-* Use g++ version 2 features (if available)
-
-The main one is that an include file g++-include/FOO.h
-that is a wrapper for a standard C include file will now
-#include_next <FOO.h> instead of #include "/usr/include/FOO.h".
-This provides more flexibility wrt to using alternate C libraries
-(such as GNU libc), but it is not without its own problems.
-For example, if you compile libg++.a with a g++ that has old
-incompatible g++-include files in its path, these will be
-read (and then in turn read the /usr/include file). If there
-are conflicts, you can remove the previously installed include files,
-or try something like 'make XTRAFLAGS=-I/usr/include' (or whatever
-include path gcc uses by default).
-
-* Major Makefile changes.
-You can now 'make' from any subdirectory.
-
-* Use of 'configure'.
-
-* Copyrights changed to use the Library license version 2.0.
-(Some files have not been updated yet; we'll try to finish it for 2.1.)
-
-* The prototype class SplayNode was put into a separate include file
-(g++-include/gen/SplayNode.hP). This is to avoid duplication.
-It will require you to generate the approriate SplayNode file
-if you use SplayBag, SplaySet, or SplayPQ.
-
-* You can now use inline functions in header files without
-having to use either -O or _DUSE_LIBGXX_INLINES. (The #ifdef
-that depended on these has been removed, so inline functions
-are inline independent of -O).
-
-* Numerous minor bug-fixes and enhancements.
-
-*** Changes in libg++-1.39.0 from libg++-1.37.0
-
- * All files use the new g++ #pragma interface / #pragma implementation
- convention, which minimies duplication of `outlined' inlines
- and vtables. This also causes no inlines to be used at
- all when not compiling with `-O', which speeds compilation
- and simplifies debugging.
-
- * Many .h header file names had to be shortened so as to simulaneously
- work with SYSV and with #pragma interface (since .h and .cc file
- base names must match.) Sorry!
-
- * All genclass-able files have been moved to g++-include/gen.
-
- * various and sundry bug fixes, minor enhancements, and/or portability
- improvements as described in the ChangeLog.
-
-*** changes from libg++-1.36.3 to libg++-1.37.0
-
- * Most utility classes and functions are now in stand-alone .cc and/or .h
- files. This should generate smaller exectuables, and, sometimes
- faster compilation. In particular, istream.h, and ostream.h are
- now separately includable. If you only need one, you don't have
- to get the other.
-
- * The Plex classes now understand `const'. The `changes' and `changed'
- member functions were removed, since it is now possible to
- avoid changes in Plex structures by using const versions.
-
- * class RandomInteger is available, courtesy of John Reidl.
-
- * PlotFile3D, a 3D plot class is in libg++/etc. It will be
- incorporated into libg++ proper for the next release, perhaps
- with a few changes. Thanks to Tom Ngo.
-
- * various and sundry bug fixes, minor enhancements, and/or portability
- improvements as described in the ChangeLog.
-
- * The file etc/HINTS is an emacs RMAIL file that contains recent
- bug-lib-g++ list mail and related messages that may be useful.
-
-
-*** changes from libg++-1.36.1 to libg++-1.36.3
-
- * `Tmp' classes have been eliminated from Strings, Integers, etc.
- (Via some retuning of the main classes, Tmp classes were found
- to not significantly impact performance one way or the other,
- so they were removed.)
-
- * There is now a version of malloc, directly supporting operator
- new, etc. It may be faster and better suited to C++ applications
- than your libc malloc. You should be able to use it unless you need
- a special malloc for a distributed shared memory environment or
- the like. If you can't use it, edit the appropriate flag in
- the top-level Makefile. I would very much appreciate feedback
- about whether this malloc makes any difference in time or space
- efficiency than whatever you are now using.
-
- * By default, output is now line-buffered. Use the
- NO_LINE_BUFFER_STREAMBUF define in the Makefile to override
-
- * Otherwise, the stream classes remain C++-1.2 compatible.
- C++-2.0-compatible versions are still in the works.
-
- * various and sundry bug fixes, minor enhancements, and/or portability
- improvements as described in the ChangeLog.
-
-*** changes from libg++-1.35.0 & 1.35.1 to 1.36.1
-
- * various and sundry bug fixes, minor enhancements, and/or portability
- improvements as described in the ChangeLog.
-
- * Most everything should now work on most SystemV machines. Let me
- know if they don't.
-
- * genclass now allows an optional prefix to be used instead of type
- name concatenation in order to help minimize filename
- lengths for SYSV users. This is not a great solution, but
- is A solution to filename length problems for SYSV users.
-
- * Some, but not all classes now behave well with respect to
- the new 2.0 const specifications. Some uncertainties about
- how g++ will interpret gcc-based const function qualifiers
- (to indicate lack of side effects) versus C++-2.0 const member
- functions has held up the conversion of some classes to use
- const in either or both of these ways.
-
- * A version of etags suitable for use with c++ is in etc/
- (courtesy of J. Clark)
-
- * `graph', a unix graph(1) work-alike is in libg++/etc, courtesy
- of Rich Murphey.
-
- * RAVLMap (Ranked AVLs) prototypes.
-
- * The GetOpt class & support has been moved from etc/ into libg++.a
-
- * Streams have been redone to be nearly 100% AT&T 1.2 compatible.
- One minor possible incompatibility exists (ostream<< char)
- that can be eliminated via #define NO_OUTPUT_CHAR at the
- top of stream.h. This is probably necessary in order to
- compile et++. See libg++.texinfo for more details.
-
- The new stream implementation is not particulary pretty.
- Its main virtue is that it avoids some of the worst things
- about both AT&T streams and old libg++ streams. A much
- superior AT&T 2.0-iostream superset is in the works
- for future release.
-
-*** changes from libg++-1.25.0 to libg++-1.32.0
-
- * Nearly all data and methods previously declared as `private'
- are now declared as `protected' to make subclassing from
- library classes easier.
-
- * Most classes now contain a method `OK()' that checks to
- make sure that an objects internal data is in a valid state.
- See the documentation for further details
-
- * Mosts tests in ./tests now contain various kinds of assert
- statements. If tests execute without assertion failures,
- and without any other errors that cause aborted execution,
- you may consider them successful. The test files now include
- nearly all of my internal tests, which in turn have been
- made more extensive.
-
- * Plex classes are available.
- A bit of propaganda about these:
- Plexes are very attractive replacements for arrays
- in many contexts. Try them!
-
- * `shrink' and `contains' have been added to Obstack
-
- * Files and streams have not yet been revamped (a complete
- reworking awaits the AT&T 2.0 stream specification), but
- have been adjusted to provide slightly faster IO in some
- cases, and now support the use of a user-supplied string
- to read or write from instead of an actual IO source.
-
- * Rationals are now normalized when input via `>>'.
-
- * atoI is fixed.
-
- * variable-length representations in String, Integer, etc., are
- now completely different. See the documentation for details.
-
- * New String functions:
- * readline -- read in a line from an istream as a String
- * prepend -- prepend stuff to a String
- * through -- make a SubString from beginning to match point
- * from -- make a SubString from match point to end
- * s[i] -- now returns the char by reference
-
- * BitVec's are no longer supported, since their capabilities
- are now incorporated in the revised BitString class.
-
- * stdarg.h and regex.h are revised to support the Sun4
-
- * Several interesting and/or useful examples of libg++
- class use are in ./etc, mainly courtesy of Doug Schmidt.
-
- * .cc file names are now all less than 15 characters. Some
- .h file names are longer, but this should not present
- problems on SYSV systems.
-
- * pseudo-generic `proto' classes have been thoroughly revised:
- * The prototype file names now end in `P', not `.proto'
- and are in the g++-include directory
- * A single, simple-to-use collection traversal mechanism
- via pseudo-indices (`Pix') is used instead of particular
- traversal friend classes.
- * `Bag' prototypes are included
- * Base classes are now supplied, so that all implementations
- of Sets, Bags, are derived, allowing programmers to
- mix and match implementations.
- * They are now simpler to create: all comparison operators
- and the like are now defined as macros in a `defs' file
- which uses some reasonable defaults.
- * The `Dictionary' versions of Set prototypes are not now
- supported. Revised versions of such classes are forthcoming.
- * Class prototypes previously labelled as `Assoc' are now
- called `Maps', with slightly different capabilities.
-
- * Splay tree prototypes are available.
- A bit more propaganda: Consider using Splay tree
- based containers (Set, Bag, Map, PQ). They are often
- the most efficient structures when performing mixtures
- of operations (adds, deletes, searches...)
-
- * Fixed precision reals are available, courtesy of Kurt Baudendistel
-
- * An ordered hash Set prototype (VOHSet) is available,
- courtesy of Doug Schmidt.
-
- * MLCG now allows access and modifications to the seeds.
-
- * The Normal random generator is fixed.
-
- * SampleStatistic now allows any prob value for confidence
- intervals.
-
- * some simple timer routines are in builtin.cc, courtesy of Doug Schmidt
-
- * While the Vec class prototypes are still available, they are
- currently undergoing revision in order to correspond to
- the forthcoming Matrix package (which should be available
- in the next libg++ release).
-
- * A C++ version of GPERF, a perfect hash function generator
- program is also available in ./etc, courtesy of Doug Schmidt.
-
-
-*** changes from libg++-1.22.2 to libg++-1.25.0
-
- * All reported errors from the previous release are fixed, and many
- suggested modifications have been performed. Thanks to all who
- have sent bug reports and comments, including those with mail
- addresses that I have not been able to reply to. (My mail connections
- are sometimes more than a little fragile. If you send me mail and
- I have not replied within a few days, you may want to try again. Sorry.)
-
- * A serious problem in the use of Obstacks by conversion functions
- has been repaired.
-
- * A bug in maintaining reference counts on `find' and related operations
- in List prototype classes has been fixed.
-
- * Strings now support self case manipulation in addition to the
- functional versions.
-
- * Some new functions have been added to builtin.[h.cc]. All are now
- documented in libg++.texinfo
-
- * Overload declarations are now performed in std.h and math.h,
- rather than builtin.h, to eliminate some include file ordering
- problems.
-
- * Random, RNG, and SampleStatistic classes are available,
- thanks to Dirk Grunwald.
-
- * A BitVec class is available.
-
- * The are many new generic container class prototype files. These
- support container classes based on elementary data structures
- (and a couple of non-elementary ones). Please read the documentation.
-
- * Class prototype OSet has been modified and renamed OLSet.
-
- * The genclass utility has been modified
-
-*** changes from libg++-1.22.1 to 1.22.2
-
- * Tests files are now in a separate directory.
-
- * Several minor errors (Complex unary -, several BitString functions)
- have been repaired.
-
- * pow(0,0) returns 1 for all versions of pow.
-
- * An experimental generic class prototyping feature is provided,
- including prototypes for lisp-style lists and ordered list-based sets.
-
- * several include files with the same names as those in AT&T CC
- are provided. These simply #include other files. OOPS should now
- compile using only g++-include files. See, however, the note
- about struct exception in file math.h
-
- * Some rearrangement of files containing char* conversion has been
- done to eliminate linking of unnecessary classes.
-
- * The inline-only-when-optimizing feature is still not supported.
-
-* New Random number generator classes are not yet available. Stubs for
- these files are in this directory. They should be available for next
- release.
-
-*** changes from libg++-1.21.1 to 1.22.0
-
- * All documentation is in a stand-alone texinfo file, libg++.texinfo,
- and is on its way to becoming a decent piece of documentation.
-
- * All reported errors from the previous release are fixed, and many
- suggested modifications have been performed. Thanks to all who
- have sent bug reports and comments, including those with mail
- addresses that I have not been able to reply to. (My mail connections
- are sometimes more than a little fragile. If you send me mail and
- I have not replied within a few days, you may want to try again. Sorry.)
-
- * New Complex, BitSet, and BitString classes are available. You will
- be performing a valuable service if you try these out and report
- back any bugs/comments/suggestions about these or any other classes.
-
- * File `values.h' has been added. This contains various system
- constants like the number of bits per long, etc. It contains
- much of the same information as sun <values.h>, although a
- few names and things differ slightly.
-
- * Files `builtin.h', `builtin.cc', and `convert.cc' have been added.
- `builtin' contains common inline and non-inline functions on
- builtin types (like `abs'). `convert' contains code for performing
- IO and char* conversions, mainly via Obstacks. Most of these
- functions are not new -- they have been collected from other .h
- and .cc files.
-
- * Files `std.h' and `math.h' now declare all libc.a C functions
- in a way that allows any of them to be overloaded in C++.
-
- * Strings and Integers now perform expansion via realloc() --
- see libconfig.h about whether you should #define SHOULD_FREE_TO_REALLOC.
-
- * `eatwhite' is supported for istreams.
-
- * File::getline(String, ...) and get(String) have been removed in order to
- maintain greater independence of different classes.
-
- * Strings now provide substring matching via new versions of
- `contains' and `matches', `common_prefix' and `common_suffix'.
- Also, there is more support for case operations via `fcompare', etc.
- The versions of `decompose' that do not deal with Regexes have
- been deleted since they provide little functionality over other
- operations. Also, a few special case functions dealing with char*'s
- have been deleted since the required constructors are necessary
- anyway. Several other corrections have been made in String.cc,
- including the elimination of a few aliasing problems.
-
- * The implementations of Integers and Rationals are now both much
- more efficient and well-tested, while remaining machine independent.
- A few minor visible features have been added and/or changed.
-
- * The `box' command in PlotFile is now simulated, whether or not
- it is present in libplot.a
-
- * The inlining-only-if-optimizing feature is still not fully implemented.
diff --git a/contrib/libg++/libg++/README b/contrib/libg++/libg++/README
deleted file mode 100644
index e3231ad7fe2a..000000000000
--- a/contrib/libg++/libg++/README
+++ /dev/null
@@ -1,247 +0,0 @@
-This is version 2.7.2 of libg++, the GNU C++ class library.
-Release date June 1996 by Cygnus Support
-
-* Please skim through this once BEFORE attempting to make and install libg++.
-
-* You probably want to at least skim ./g++FAQ.txt.
-
-* Contents
-
- * g++ source files (with their include files) are in the ./src directory
- * Some simple tests and demo programs are in ./tests
- * documentation is in ./libg++.texi.
- * A perfect hash function generator is in ./gperf.
- * Some miscellaneous files of possible interest are in ./etc
- (These files are not officially a part of the libg++ distribution,
- and are subject to arbitrary changes, deletions, etc. from release
- to release.)
-
-* Copyright restrictions
-
-The GNU Library General Public License (which is in the file
-../COPYING.LIB) covers all libraries (specificly libg++.a) and
-include files that get installed (by 'make install').
-
-Other parts of the libg++ *distribution* that are not part the libg++
-*library* per se have the GNU General Public License (which is in the
-file ../COPYING).
-
-Individual files should bear the appropriate Copyright (let us know
-if you think there is a mistake). But specificly, if your application
-only uses files that are installed by the normal build+install
-procedure, then it is bound by the restrictions of the GNU Library
-General Public License, but not those of the GNU General Public License.
-
-* Pre-installation
-
- * This version of libg++ requires gcc-2.7.2 or newer.
- It assume that gcc is responsible for fixing standard C include
- files (such as stdio.h) so that they are suitable for C++
- (Using the fixproto script that is part of gcc).
-
- * You can compile libg++ using a gcc that you haven't installed.
- The most convenient way to do that is to make a symlink named
- gcc in the top-level directory (i.e. libg++-2.7.2) that points to
- the directory containing the new gcc. (You should end up with
- libg++/../gcc/xgcc being a valid filename for the uninstalled gcc.)
-
- * With only trivial modifications (like changing file extensions,
- etc.) most things should compile and run with any modern C++ compiler.
- However, notice that libg++ may depend on recent (ANSI/ISO) changes
- to C++. If libg++ depends on a g++ feature that is not specified
- by the C++ draft standard *or* if there is a simple and clean
- work-around that would make it more portable, please let me know.
-
-* Installation (see libg++.texi for more details)
-
- * For VMS, cd to ./vms, and read AAAREADME.TXT
- [NOTE: The VMS support is obsolete. We need a volunteer to fix it.]
-
- * For Linux, things are complicated because the Linux C library is
- based on ../libio. Unfortunately, there is no publicly available
- version of libc that will work quite right with this release of
- libg++ and libio.
-
- The latest released version of libg++ for Linux is
-
- ftp://sunsite.unc.edu/pub/Linux/GCC/libg++-2.7.1.4.bin.tar.gz
-
- To use it you need to upgrade your C library to 5.2.15 or higher; the
- latest released version is
-
- ftp://sunsite.unc.edu/pub/Linux/GCC/libc-5.2.18.bin.tar.gz
-
- This release of libio will mostly work with libc 5.2.18, but a few
- things break; getopt, for instance.
-
- To get beta releases, you may want to join the Linux Gcc developer's
- mailing list; send mail to majordomo@vger.rutgers.edu with the text
- "subscribe linux-gcc" in the message body.
-
- * To build shared libraries, see README.SHLIB.
-
- * Make sure your sed is *not* GNU sed version 1.12.
- Most other versions (including GNU sed 1.13) should be OK.
- (It has been reported at GNU sed 3.0 fails.)
-
- * Go to the directory *above* libg++ (i.e.. libg++-2.7.2).
-
- * Run './configure' to configure the tree and create Makefiles.
-
- Typical example:
- ./configure [SYSTEM] --prefix=/usr/gnu
-
- The prefix says that installation should be into
- /usr/gnu/lib, /usr/gnu/bin, etc as appropriate.
-
- The SYSTEM indicates what machine configuration you're
- running on. If you don't specify it, the system can usually
- guess a default.
-
- IMPORTANT: The configure options (including SYSTEM and
- --prefix) must match those used to configure gcc, otherwise
- g++ may fail to find libg++.
-
- See etc/cfg-paper.texi for more details. (This paper is
- in texinfo format; see the section below on Installing
- the Documentation on how to make it more readable.)
-
- * Type `make all "CC=gcc -O2"'.
- (Builds libg++.a and some other things.) (The "CC=gcc -O2"
- is optional. It forces use of gcc to compile C programs.
- Set CXX to specify the C++ compiler, though it defaults to gcc.)
-
- * Optionally, type `make check' to make and run some tests/demos of libg++.
-
- * Before installing, if you have an old version that was installed
- into the same directory(s), you should probably remove it.
- (There is currently no clean mechanism to do that.
- You should at least remove $(prefix)/lib/g++-include/*.h,
- where $(prefix) is by default /usr/local.)
-
- If the previous version was libg++ 2.4 or older, you *must* remove
- the old includes. Prior to version 2.5, libg++ installed its own
- versions of certain standard headers for use on systems where the
- vendor headers don't include prototypes. Versions 2.5 and later of
- gcc add prototypes to vendor headers that don't have them, so
- the libg++ versions are no longer useful, and are harmful when
- they conflict with the vendor version.
-
- * Type `make install' to install
-
- libg++.a (from .)
- include files (from src and ../libio)
- prototype files (from src/gen)
- gperf (from gperf)
- some other stuff
-
- * Install the documentation
-
- If you are a systems administrator installing libg++ for others,
- please make the documentation available to users!
-
- The libg++.texi file may be formatted as a paper document by
-
- * Get a copy of texinfo.tex.
- This file defines various tex macros used in libg++.texi
- One is in the gcc release.
- You can temporarily copy it into the current directory.
- * Run tex on libg++.texi
- and do whatever you normally do from there to print it.
-
- It may be made into an emacs info file:
-
- * use the 'makeinfo' program (from the texinfo distribution).
-
- * Copy these files into your emacs info directory
- (normally somewhere like /usr/gnu/emacs/info).
- * If you have not done so before, edit the emacs/info/dir file
- to add a libg++ node, by inserting a line like
-
- * Libg++: (libg++). The GNU C++ Library
-
- to the bottom of the file.
-
- * (Optional) Install, from ./utils
- g++dep (a version of mkdep that understands c++)
-
-* Notes on compiling and running libg++/tests
-
-It is a very good idea to also cd to the test directory and run tests
-manually, to see what they do.
-
-Compiling and running the tests consumes a fair amount of time and
-disk space!
-
-Some reported diffs may be perfectly reasonable, owing to things like
-floating point precision differences: The expected.out file was created
-on a Sun4/110.
-
- Some tRational and tFix results depend on floating point precision
- and may generate slightly different output on different machines.
-
- tRandom seeds some random-numbers in a way that also relies on
- floating-point representations -- Your output should be numerically
- similar, but probably not identical.
-
-* Changes since previous versions(s).
-
- See the file NEWS.
-
-* Known bugs and problems
-
- * If "make install" fails with the error message:
-
- Static constructor test failed - see libg++.README
-
- this indicates an error in installing gcc.
- C++ needs special linker support beyond that needed for C, to make
- sure that static objects get initialized and destroyed properly.
- Some linkers (including the GNU linker as well as linkers for
- the Elf object file format) already provide the needed support.
- In other cases, gcc (or g++) uses the "collect2" linker driver.
- Gcc should by default do the right thing, but if you tell
- gcc to assum the GNU linker (with the --with-gnu-linker option),
- and then fail to correctly install GNU ld, you will lose.
-
-* Lots of other information is in the libg++.texi file. It really is
- very important to actually read the documentation before using
- library classes. Examination of the demo files in the test directory
- may also be useful. (Note however, that the demo files are merely
- designed to test examples of each class capability,
- and are not especially good examples of client functions that might
- use these classes.)
-
-* There is now a gnu libg++ mailing list (bug-lib-g++@prep.ai.mit.edu) and
- associated usenet gnu news group (gnu.g++.lib.bug). (It is preferred
- that messages be sent to the mailing list, rather than posted to
- newsgroup.) To subscribe or unsubscribe to the mailing list,
- send a request to bug-lib-g++-request@prep.ai.mit.edu.
-
-* You will be performing a valuable service if you use libg++
- classes and report back any comments, and suggestions, or bugs,
- preferably to the bug-lib-g++ list. Your feedback is extremely
- helpful in efforts to make libg++ as useful and reliable as possible.
-
-* We continue to solicit
-
- * bug reports.
- * suggestions.
- * comments.
- * questions about installing and using libg++
- * other contributions to be incorporated into libg++.
- * sample programs using libg++.
-
- Often, the best place to send such things is bug-lib-g++@prep.ai.mit.edu,
- although direct mail is also welcome.
-
-* Good luck!
-
-Doug Lea <dl@oswego.edu> designed and implemented most of the classes,
-and was the original maintainer and "owner" of libg++.
-He has handed over "ownership" to Cygnus Support.
-
-Per Bothner <bothner@cygnus.com> of Cygnus Support is now
-maintaining libg++, with much help from the rest of the
-Cygnus G++ team (Jason Merrill, Mike Stump, Brendan Kehoe).
-Cygnus Support, 1937 Landings Drive, Mountain View, CA 94043
diff --git a/contrib/libg++/libg++/README.SHLIB b/contrib/libg++/libg++/README.SHLIB
deleted file mode 100644
index 087e569ef194..000000000000
--- a/contrib/libg++/libg++/README.SHLIB
+++ /dev/null
@@ -1,38 +0,0 @@
-NOTES ON BUILDING LIBG++ AS A SHARED LIBRARY
-
-A shared library version of libg++-2.7.2 can be built using gcc-2.7.2 or
-above on the following platforms:
-
-x86 Linux (using the ELF toolchain)
-Sparc running SunOS 4.x
-Alpha running OSF/1
-SGI running IRIX 5.x and up
-HPPA running HPUX 9.x and up
-All SVR4 targets (tested on Sparc Solaris and i486 UnixWare)
-RS/6000 or PowerPC running AIX (requires GNU ld 2.7 or newer)
-
-To build a shared version of libg++ on one of these platforms, pass the
---enable-shared flag to configure, and be sure to compile with gcc.
-
-In order to run a program built with your new shared library (including
-gperf and the tests), you may have to set the environment variable
-LD_LIBRARY_PATH to include the directory where it lives.
-
-Discussion:
-----------
-
-Many shared library implementations have an idiosyncracy [bug ???] which
-requires anything that is declared in a shared library to be defined even
-if it isn't used. libstdc++.so and libg++.so contain a number of classes
-which use the math library. Consequently, if a shared libm does not exist
-(it does under Linux, OSF/1, IRIX, HPUX and Solaris, but not the others),
-either the math library must to added to the link command or you must
-compile with a flag that tells the linker to ignore unresolved references
-(-Wl,-assert,nodefinitions for SunOS, -Wl,-z,nodefs for SVR4).
-
-The `g++' program now adds -lm by default, so you may not have to worry
-about this.
-
-Jason Merrill (jason@cygnus.com)
-Thanks to Dr. Joseph E. Sacco (jsacco@ssl.com) for the original version of
-this note.
diff --git a/contrib/libg++/libg++/TODO b/contrib/libg++/libg++/TODO
deleted file mode 100644
index c1e12b84b1c4..000000000000
--- a/contrib/libg++/libg++/TODO
+++ /dev/null
@@ -1,13 +0,0 @@
-* See iostream/TODO for iostream-specific issues
-
-* Update README.
-
-* Add 'return 0' to end of tests.
-[Not needed, if ANSI makes that implicit.]
-
-* Undo gcc-2.3.2-specific kludge in test-install/bf.cc.
-
-* Remove use of _libgxx_io_ob from Fix.cc.
-
-* Since the libg++ include files in gxx_includedir aren't architecture
- dependent, they belong under $(datadir) not $(libdir).
diff --git a/contrib/libg++/libg++/g++FAQ.texi b/contrib/libg++/libg++/g++FAQ.texi
deleted file mode 100644
index dfed49574b48..000000000000
--- a/contrib/libg++/libg++/g++FAQ.texi
+++ /dev/null
@@ -1,1986 +0,0 @@
-\input texinfo.tex @c -*-texinfo-*-
-@c %**start of header
-@setfilename g++FAQ.info
-@settitle Frequently asked questions about the GNU C++ compiler
-@setchapternewpage off
-@c version: @(#)g++FAQ.texi 1.46 6/20/96
-@c %**end of header
-
-@iftex
-@finalout
-@end iftex
-@titlepage
-@title G++ FAQ
-@subtitle Frequently asked questions about the GNU C++ compiler
-@subtitle June 19, 1996
-@sp 1
-@author Joe Buck
-@page
-@end titlepage
-
-@ifinfo
-@node Top, new stuff, (dir), (dir)
-@top
-@unnumbered FAQ for g++ and libg++, by Joe Buck (jbuck@@synopsys.com)
-@end ifinfo
-
-@cindex FAQ for g++, latest version
-@cindex Archive site for FAQ lists
-@cindex rtfm.mit.edu
-@cindex Joe Buck <jbuck@@synopsys.com>
-@cindex FAQ for C++
-
-This is a list of frequently asked questions (FAQ) for g++ users; thanks to
-all those who sent suggestions for improvements. Thanks to Marcus Speh
-for doing the index. A hypertext version is available on the World Wide
-Web at @file{http://www.cygnus.com/misc/g++FAQ_toc.html}.
-
-Please send updates and corrections to the FAQ to
-@code{jbuck@@synopsys.com}. Please do @emph{not} use me as a resource
-to get your questions answered; that's what @file{gnu.g++.help} is for and I
-don't have the time to support the net's use of g++.
-
-Many FAQs, including this one, are available on the archive site
-``rtfm.mit.edu''; see @*
-@file{ftp://rtfm.mit.edu/pub/usenet/news.answers}.
-This FAQ may be found in the subdirectory g++-FAQ.
-
-@cindex Marshall Cline
-@cindex comp.lang.c++
-@cindex C++ FAQ
-This FAQ is intended to supplement, not replace, Marshall Cline's
-excellent FAQ for the C++ language and for the newsgroup
-@file{comp.lang.c++}. Especially if g++ is the first C++
-compiler you've ever used, the question ``How do I do <X> with g++?''
-is probably really ``How do I do <X> in C++?''.
-You can find this FAQ at
-@file{ftp://rtfm.mit.edu/pub/usenet/comp.lang.c++},
-or in HTML form at @file{http://www.cerfnet.com/~mpcline/On-Line-C++-FAQs/}.
-
-@menu
-* new stuff:: The latest poop -- gcc-2.7.x
-* getting g++:: Obtaining Source Code
-* installation:: Installation Issues and Problems
-* User Problems:: User Problems
-* legalities:: What are the rules for shipping code built with g++ and libg++?
-* index:: Concept Index
-
- --- The Detailed Node Listing ---
-
-New Stuff: The Latest Poop -- Gcc-2.7.x
-
-* version 2.7:: What's new in version 2.7.x of gcc/g++
-* libstdc++:: The GNU Standard C++ Library
-
-Obtaining Source Code
-
-* latest versions:: What is the latest version of gcc, g++, and libg++?
-* g++ for Unix:: How do I get a copy of g++ for Unix?
-* g++ for HP:: Getting gcc/g++ for the HP Precision Architecture
-* g++ for Solaris 2.x:: Getting gcc/g++ binaries for Solaris 2.x
-* g++ for other platforms:: How do I get a copy of g++ for (some other platform)?
-* 1.x vs 2.x versions:: But I can only find g++-1.42!
-
-Installation Issues and Problems
-
-* gcc-2 + g++-1:: I can't build g++ 1.x.y with gcc-2.x.y!
-* what else do I need?:: OK, I've obtained gcc; what else do I need?
-* repository:: How do I use the new template repository code?
-* repo bugs:: Known bugs and problems with the repo patch
-* libstdc++:: The GNU Standard C++ Library
-* use GNU linker?:: Should I use the GNU linker, or should I use "collect"?
-* Use GNU assembler?:: Should I use the GNU assembler, or my vendor's assembler?
-* Use GNU C library?:: Should I use the GNU C library?
-* Global constructor problems:: Global constructors aren't being called
-* Strange assembler errors:: Strange assembler errors when linking C++ programs
-* Other problems building libg++::
-* Rebuild libg++?:: Do I need to rebuild libg++ to go with my new g++?
-* co-existing versions:: I want several versions of g++ and libg++ to co-exist
-* Installing on Linux:: Trouble installing g++ and libg++ on Linux
-* Linux Slackware 3.0:: Problems with g++ on Linux Slackware 3.0
-
-User Problems
-
-* missing virtual table:: Linker complains about missing virtual table
-* for scope:: gcc-2.7.0 breaks declarations in "for" statements!
-* const constructor:: g++ seems to want a const constructor. What's that?
-* unused parameter warnings:: How to silence ``unused parameter'' warnings
-* jump crosses initialization:: g++ objects to a declaration in a case statement
-* Demangler:: Where can I find a demangler?
-* static data members:: Linker reports undefined symbols for static data members
-* internal compiler error:: What does ``internal compiler error'' mean?
-* bug reports:: I think I have found a bug in g++.
-* porting to g++:: Porting programs from other compilers to g++
-* name mangling:: Why does g++ mangle names differently from other C++ compilers?
-* problems linking with other libraries:: Why can't g++ code link with code from other C++ compilers?
-* documentation:: What documentation exists for g++ 2.x?
-* templates:: Problems with the template implementation
-* undefined templates:: I get undefined symbols when using templates
-* redundant templates:: I get multiply defined symbols when using templates
-* Standard Template Library:: Does g++ support the Standard Template Library?
-* exceptions:: Problems and limitations with exceptions
-* namespaces:: Does g++ support namespaces?
-* agreement with standards:: What are the differences between g++ and the ARM specification of C++?
-* compiling standard libraries:: Will g++ compile InterViews? NIHCL? Rogue Wave?
-* debugging on SVR4 systems:: Debugging on SVR4 systems
-* debugging problems on Solaris:: debugging problems on Solaris
-* X11 conflicts with libg++:: Conflict over meaning of String
-* assignment to streams:: Why can't I assign one stream to another?
-@end menu
-
-@node new stuff, getting g++, Top, Top
-@chapter The latest poop -- gcc-2.7.x
-
-This section is intended to describe more recent changes to g++, libg++,
-and such. Some things in this section will eventually move elsewhere.
-
-@strong{News:} as I write this (late February 1996) the gateway
-connecting the bug-g++ mailing list and the @file{gnu.g++.bug} newsgroup
-is broken. Please mail, do not post bug reports.
-
-@menu
-* version 2.7:: What's new in version 2.7.x of gcc/g++
-* libstdc++:: The GNU Standard C++ Library
-@end menu
-
-@node version 2.7, libstdc++, , new stuff
-@section What's new in version 2.7.x of gcc/g++
-
-The current version of gcc/g++ is 2.7.2; the current libg++ is 2.7.1.
-
-By the time you read this, two minor bug-fix releases, gcc 2.7.3
-and libg++ 2.7.2, may be available. These new releases are mainly
-intended to fix platform-specific bugs and do not affect the C++
-``front end'' of the compiler.
-
-The 2.7.x releases represent a great deal of work on the part of the g++
-maintainers to fix outstanding bugs and move the compiler closer to the
-current ANSI/ISO standards committee's working paper, including
-supporting many of the new features that have been added to the
-language. I recommend that everyone read the NEWS file contained in the
-distribution (and that system administrators make the file available to
-their users). I've borrowed liberally from this file here.
-
-@cindex C++ working paper
-If any features seem unfamiliar, you will probably want to
-look at the recently-released public review copy of the C++ Working
-Paper:
-@itemize @bullet
-@item
-PostScript and PDF (Adobe Acrobat):
-see @file{ftp://research.att.com/dist/c++std/WP}.
-@item
-HTML and ASCII versions: see @file{ftp://ftp.cygnus.com/pub/g++}.
-@item
-World Wide Web: see
-@file{http://www.cygnus.com/misc/wp/}.
-@end itemize
-
-Here are the main points:
-
-@itemize @bullet
-@item
-@cindex for scope
-As described above, the scope of variables declared in the
-initialization part of a for statement has been changed; such variables
-are now visible only in the loop body. Use @code{-fno-for-scope} to get
-the old behavior. You'll need this flag to build groff version 1.09,
-Ptolemy, and many other free software packages.
-
-@item
-@cindex vtable duplication
-Code that does not use #pragma interface/implementation will most
-likely shrink dramatically, as g++ now only emits the vtable for a
-class in the translation unit where its first non-inline, non-abstract
-virtual function is defined.
-
-@item
-@cindex automatic template instantiation
-Support for automatic template instantiation has @emph{not} been enabled
-in the official distribution, due to a disagreement over design philosophies.
-But you can get a patch from Cygnus to turn it on; retrieve the patch
-from @file{ftp://ftp.cygnus.com/pub/g++/gcc-2.7.2-repo.gz} to patch
-gcc-2.7.2 (there are also patches for earlier gcc versions).
-
-@item
-@cindex exception handling, 2.7.0
-
-@xref{exceptions}
-
-@item
-@cindex run-time type identification
-Support for Run-Time Type Identification has been added with @code{-frtti}.
-This support is still in alpha; one major restriction is that any file
-compiled with @code{-frtti} must include @code{<typeinfo>} (@emph{not}
-@code{typeinfo.h} as the NEWS file says).
-Also, all code you link with (including libg++) has to be built with
-@code{-frtti}, so it's still tricky to use.
-
-@item
-@cindex compiler-generated operators
-Synthesis of compiler-generated constructors, destructors and
-assignment operators is now deferred until the functions are used.
-
-@item
-@cindex assignment in conditional expressions
-The parsing of expressions such as @code{a ? b : c = 1}
-has changed from
-@code{(a ? b : c) = 1} to @code{a ? b : (c = 1)}. This is a new C/C++
-incompatibility brought to you by the ANSI/ISO standards committee.
-
-@item
-@cindex new operator keywords
-The operator keywords and, and_eq, bitand, bitor, compl, not, not_eq,
-or, or_eq, xor and xor_eq are now supported. Use @code{-ansi} or
-@code{-foperator-names} to enable them.
-
-@item
-@cindex explicit keyword
-The @code{explicit} keyword is now supported. @code{explicit} is used to mark
-constructors and type conversion operators that should not be used
-implicitly.
-
-@item
-@cindex user-defined type conversion
-Handling of user-defined type conversion has been improved.
-
-@item
-@cindex explicit template instantiation
-Explicit instantiation of template methods is now supported. Also,
-@code{inline template class foo<int>;}
-can be used to emit only the vtable
-for a template class.
-
-@item
-@cindex -fcheck-new
-With -fcheck-new, g++ will check the return value of all calls to
-operator new, and not attempt to modify a returned null pointer.
-
-@item
-collect2 now demangles linker output, and c++filt has become part of
-the gcc distribution.
-
-@item
-Improvements to template instantiation: only members actually used
-are instantiated. (Actually this is not quite true: some inline
-templates that are not successfully inlined may be expanded even
-though they are not needed).
-
-@end itemize
-
-@node libstdc++, , version 2.7, new stuff
-@section The GNU Standard C++ Library
-
-The GNU Standard C++ Library (also called the ``GNU ANSI C++ Library''
-in places in the code) is not libg++, though it is included in the
-libg++ distribution. Rather, it contains classes and functions
-required by the ANSI/ISO standard. The copyright conditions are the
-same as those for for the iostreams classes; the LGPL is not used
-(@xref{legalities}).
-
-This library, libstdc++, is in the libg++ distribution in versions 2.6.2
-and later. It requires at least gcc 2.6.3 to build the libg++-2.6.2
-version; use at least gcc 2.7.0 to build the libg++ 2.7.0 version. It
-contains a hacked-up version of HP's implementation of the Standard
-Template Library (see @xref{Standard Template Library}). I've
-successfully used this Standard Template Library version to build
-a number of the demos you'll see on various web pages.
-
-As of version 2.7.0, the streams classes are now in libstdc++ instead of
-libg++, and libiostream is being phased out (don't use it). The g++
-program searches this library.
-
-@node getting g++, installation, new stuff, Top
-@chapter Obtaining Source Code
-@cindex Source code
-
-@menu
-* latest versions:: What is the latest version of gcc, g++, and libg++?
-* g++ for Unix:: How do I get a copy of g++ for Unix?
-* g++ for HP:: Getting gcc/g++ for the HP Precision Architecture
-* g++ for Solaris 2.x:: Getting gcc/g++ binaries for Solaris 2.x
-* g++ for other platforms:: How do I get a copy of g++ for (some other platform)?
-* 1.x vs 2.x versions:: But I can only find g++-1.42!
-@end menu
-
-@node latest versions, g++ for Unix, , getting g++
-@section What is the latest version of gcc, g++, and libg++?
-
-@cindex gcc/g++, version date
-The latest "2.x" version of gcc/g++ is 2.7.2, released November 26, 1995.
-The latest version of libg++ is 2.7.1, released November 12, 1995.
-
-Don't use 2.5.x, with x less than 5, for C++ code; there were some
-serious bugs that didn't have easy workarounds. 2.5.8 is the most
-solid 2.5.x release. 2.6.3 is the most solid 2.6.x release.
-
-For some non-Unix platforms, the latest port of gcc may be an earlier
-version (2.5.8, say). You'll need to use a version of libg++ that
-has the same first two digits as the compiler version, e.g. use libg++
-2.5.x (for the latest x you can find) with gcc version 2.5.8.
-
-The latest "1.x" version of gcc is 1.42, and the latest "1.x" version of
-g++ is 1.42.0.
-While gcc 1.42 is quite usable for C programs,
-I recommend against using g++ 1.x except in special circumstances
-(and I can't think of any such circumstances).
-
-@node g++ for Unix, g++ for HP, latest versions, getting g++
-@section How do I get a copy of g++ for Unix?
-
-First, you may already have it if you have gcc for your platform;
-g++ and gcc are combined now (as of gcc version 2.0).
-@cindex GNU gcc, version
-@cindex GNU g++ and gcc
-
-You can get g++ from a friend who has a copy, by anonymous FTP or
-UUCP, or by ordering a tape or CD-ROM from the Free Software
-Foundation.
-@cindex g++, ordering
-@cindex g++, getting a copy
-
-The Free Software Foundation is a nonprofit organization that
-distributes software and manuals to raise funds for more GNU
-development. Getting your copy from the FSF contributes directly to
-paying staff to develop GNU software. CD-ROMs cost $400 if an
-organization is buying, or $100 if an individual is buying. Tapes
-cost around $200 depending on media type. I recommend asking for
-version 2, not version 1, of g++.
-@cindex FSF [Free Software Foundation]
-@cindex GNU [GNU's not unix]
-
-For more information about ordering from the FSF, contact
-gnu@@prep.ai.mit.edu, phone (617) 542-5942 or anonymous ftp file
-@file{ftp://prep.ai.mit.edu/pub/gnu/GNUinfo/ORDERS} (you can
-also use one of the sites listed below if you can't get into ``prep'').
-
-@cindex FSF, contact <gnu@@prep.ai.mit.edu>
-
-Here is a list of anonymous FTP archive sites for GNU software.
-If no directory is given, look in @file{/pub/gnu}.
-
-@cindex GNUware, anonymous FTP sites
-
-@example
-ASIA: ftp.cs.titech.ac.jp, utsun.s.u-tokyo.ac.jp:/ftpsync/prep,
-cair.kaist.ac.kr, ftp.nectec.or.th:/pub/mirrors/gnu
-
-AUSTRALIA: archie.oz.au:/gnu (archie.oz or archie.oz.au for ACSnet)
-
-AFRICA: ftp.sun.ac.za
-
-MIDDLE-EAST: ftp.technion.ac.il:/pub/unsupported/gnu
-
-EUROPE: irisa.irisa.fr, ftp.univ-lyon1.fr, ftp.mcc.ac.uk,
-unix.hensa.ac.uk:/pub/uunet/systems/gnu, ftp.denet.dk,
-src.doc.ic.ac.uk:/gnu, ftp.eunet.ch, nic.switch.ch:/mirror/gnu,
-ftp.informatik.rwth-aachen.de, ftp.informatik.tu-muenchen.de,
-ftp.win.tue.nl, ftp.funet.fi, ftp.denet.dk, ftp.stacken.kth.se,
-isy.liu.se, ftp.luth.se:/pub/unix/gnu, ftp.sunet.se, archive.eu.net
-
-SOUTH AMERICA: ftp.unicamp.br, ftp.inf.utfsm.cl
-
-WESTERN CANADA: ftp.cs.ubc.ca:/mirror2/gnu
-
-USA: wuarchive.wustl.edu:/systems/gnu, labrea.stanford.edu,
-ftp.digex.net:/pub/gnu, ftp.kpc.com:/pub/mirror/gnu, f.ms.uky.edu:/pub3/gnu,
-jaguar.utah.edu:/gnustuff, ftp.hawaii.edu:/mirrors/gnu,
-uiarchive.cso.uiuc.edu:/pub/gnu, ftp.cs.columbia.edu:/archives/gnu/prep,
-col.hp.com:/mirrors/gnu, gatekeeper.dec.com:/pub/GNU,
-ftp.uu.net:/systems/gnu
-
-@end example
-
-The ``official site'' is prep.ai.mit.edu, but your transfer will probably
-go faster if you use one of the above machines.
-
-@cindex gzip
-Most GNU utilities are compressed with ``gzip'', the GNU compression
-utility. All GNU archive sites should have a copy of this program,
-which you will need to uncompress the distributions.
-
-@cindex UUNET
-@cindex UUCP
-UUNET customers can get GNU sources from UUNET via UUCP.
-UUCP-only sites can get GNU sources by ``anonymous UUCP'' from site
-"osu-cis" at Ohio State University. You pay for the long-distance call
-to OSU; the price isn't too bad on weekends at 9600 bps. Send mail to
-uucp@@cis.ohio-state.edu or osu-cis!uucp for more information.
-
-OSU lines are often busy. If you're in the USA, and are willing to spend
-more money, you can get sources via UUCP from UUNET using their 900 number:
-1-900-GOT-SRCS (900 numbers don't work internationally). You will be
-billed $0.50/minute by your phone company.
-
-@cindex libg++
-Don't forget to retrieve libg++ as well!
-
-@node g++ for HP, g++ for Solaris 2.x, g++ for Unix, getting g++
-@section Getting gcc/g++ for the HP Precision Architecture
-
-@cindex HP Precision Architecture
-@cindex Hewlett-Packard
-@cindex GNU GAS
-@cindex GNU gdb
-
-If you use the HP Precision Architecture (HP-9000/7xx and HP-9000/8xx)
-and you want to use debugging, you'll need to use the GNU assembler, GAS
-(version 2.3 or later). If you build from source, you must tell the
-configure program that you are using GAS or you won't get debugging
-support. A non-standard debug format is used, since until recently HP
-considered their debug format a trade secret. Thanks to the work of
-lots of good folks both inside and outside HP, the company has seen the
-error of its ways and has now released the required information. The
-team at the University of Utah that did the gcc port now has code that
-understands the native HP format.
-
-Some enhancements for the HP that haven't been integrated back into the
-official GCC are available from the University of Utah, site
-jaguar.cs.utah.edu. You can retrieve sources and prebuilt binaries for
-GCC, GDB, binutils,and libg++; see the directory @file{/dist}.
-
-The libg++ version is actually the same as the FSF 2.6. The Utah
-version of GDB can now understand both the GCC and HP C compiler debug
-formats, so it is no longer necessary to have two different GDB versions.
-
-I recommend that HP users use the Utah versions of the tools (see
-above), though at this point the standard FSF versions will work well.
-
-HP GNU users can also find useful stuff on the site geod.emr.ca in the
-@file{/pub/UNIX/GNU-HP} directory.
-
-Jeff Law is leaving the University of Utah, so the Utah prebuilt
-binaries may be discontinued.
-
-@node g++ for Solaris 2.x, g++ for other platforms, g++ for HP, getting g++
-@section Getting gcc/g++ binaries for Solaris 2.x
-
-``Sun took the C compiler out of Solaris 2.x. Am I stuck?''
-
-@cindex Solaris
-@cindex gcc/g++ binaries for Solaris
-
-No; prep.ai.mit.edu and its mirror sites provide GCC binaries for
-Solaris. As a rule, these binaries are not updated as often as the
-sources are, so if you want the very latest version of gcc/g++, you
-may need to grab and install binaries for an older version and use it to
-bootstrap the latest version from source.
-
-@cindex gzip
-The latest gcc binaries on prep.ai.mit.edu and its mirror sites are for
-version 2.5.6 for Solaris on the Sparc, and version 2.4.5 for Solaris on
-Intel 386/486 machines (the Solaris/Intel binaries seem to be gone from
-prep but still exist on some mirrors).
-
-There are also binaries for ``gzip'', the GNU compression utility, which
-you'll need for uncompressing the binary distribution. On any GNU
-archive site, look in subdirectories @file{i486-sun-solaris2} or
-@file{sparc-sun-solaris2}.
-
-@cindex Solaris pkgadd utility
-The ftp directory @file{ftp://ftp.quintus.com/pub/GNU}
-contains various
-GNU and freeware programs for Solaris2.X running on the sparc. These are
-packaged to enable installation using the Solaris ``pkgadd'' utility.
-These include GNU emacs 19.27, gcc (and g++) 2.6.0, Perl 4.036, and others.
-
-@node g++ for other platforms, 1.x vs 2.x versions, g++ for Solaris 2.x, getting g++
-@section How do I get a copy of g++ for (some other platform)?
-
-@cindex Windows NT support
-As of gcc-2.7.x, there is Windows NT support in gcc. Some special
-utilities are required. See the INSTALL file from the distribution.
-If you're interested in GNU tools on Windows NT, see
-@file{http://www.cygnus.com/misc/gnu-win32/} on the WWW, or the
-anonymous FTP directory
-@file{ftp://ftp.cygnus.com/pub/gnu-win32/}.
-
-@cindex VMS support
-@cindex VAX
-@cindex VMS, g++/libg++ precompiled
-The standard gcc/g++ distribution includes VMS support. Since the
-FSF people don't use VMS, it's likely to be somewhat less solid than
-the Unix version. Precompiled copies of g++ and libg++ in VMS-installable
-form are available by FTP from
-@file{ftp://mango.rsmas.miami.edu/pub/VMS-gcc/}.
-
-@cindex MS-DOS support
-@cindex Delorie's gcc/g++
-@cindex DJGPP
-@cindex EMX
-There are two different versions of gcc/g++ for MS-DOS: EMX and DJGPP.
-EMX also works for OS/2 and is described later.
-DJGPP is DJ Delorie's port. It can be found on many FTP archive
-sites; try
-@file{ftp://ftp.coast.net/SimTel/vendors/djgpp/}
-or, for a complete list, see
-@file{http://www.delorie.com/djgpp/getting.html}.
-
-
-The latest version of DJGPP is 1.12.maint4, a port of gcc-2.6.3 plus
-support software. This version runs under Windows 3.x. There's
-also a beta-2.00 version.
-
-FSF sells floppies with DJGPP on them; see above for ordering software
-from the FSF.
-
-DJGPP has its own newsgroup: @file{comp.os.msdos.djgpp}.
-
-@cindex Amiga support
-For information on Amiga ports of gcc/g++, retrieve the file @*
-@file{ftp://prep.ai.mit.edu/pub/gnu/MicrosPorts/Amiga} @*
-or write
-to Markus M. Wild <wild@@nessie.cs.id.ethz.ch>, who I hope won't be too upset
-that I mentioned his name here.
-
-@cindex Atari ST support
-A port of gcc to the Atari ST can be found at @*
-@file{ftp://atari.archive.umich.edu/atari/Gnustuff/Tos}
-along with many
-other GNU programs. This version is usually the same as the latest FSF
-release. See the ``Software FAQ'' for the Usenet group
-@file{comp.sys.atari.st} for more information.
-
-@cindex EMX port
-@cindex gcc/2
-@cindex OS/2 support
-
-There are two different ports of gcc to OS/2, the
-so-called EMX port (which also runs on MS-DOS), and a port called
-``gcc/2''. The latter port is no longer supported, since the EMX
-port includes all of its functionality.
-The EMX port's C library attempts to provide a Unix-like environment.
-For more information ask around on @file{comp.os.os2.programmer.misc}.
-
-The EMX port is available by FTP from
-
-@example
-ftp://ftp.uni-stuttgart.de/pub/systems/os2/emx-0.9a
-ftp://src.doc.ic.ac.uk/pub/packages/os2/unix/emx09a
-ftp://ftp.informatik.tu-muenchen.de/pub/comp/os/os2/devtools/emx+gcc
-@end example
-
-Eberhard Mattes did the EMX port. His address is
-mattes@@azu.informatik.uni-stuttgart.de.
-
-@cindex Apple support
-@cindex Macintosh support
-
-I'm looking for more information on gcc/g++ support on the Apple
-Macintosh. Until recently, this FAQ did not provide such information,
-but FSF is no longer boycotting Apple as the League for Programming
-Freedom boycott has been dropped.
-
-Versions 1.37.1 and 2.3.3 of gcc were ported by Stan Shebs and are available
-at @*
-@file{ftp://ftp.cygnus.com/pub/mac}
-
-They are both interfaced to MPW.
-Stan is working on a version using the current (post-2.7) sources, contact
-him directly (shebs@@cygnus.com) for more information.
-
-@node 1.x vs 2.x versions, ,g++ for other platforms, getting g++
-@section But I can only find g++-1.42!
-
-``I keep hearing people talking about g++ 2.7.2 (or some other number
-starting with 2), but the latest version I can find is g++ 1.42.
-Where is it?''
-
-@cindex Objective-C
-@cindex g++, version number
-As of gcc 2.0, C, C++, and Objective-C as well are all combined into a
-single distribution called gcc. If you get gcc you already have g++. The
-standard installation procedure for any gcc version 2 compiler will
-install the C++ compiler as well.
-
-One could argue that we shouldn't even refer to "g++-2.x.y" but it's a
-convention. It means ``the C++ compiler included with gcc-2.x.y.''
-
-@node installation, User Problems, getting g++, Top
-@chapter Installation Issues and Problems
-
-@menu
-* gcc-2 + g++-1:: I can't build g++ 1.x.y with gcc-2.x.y!
-* what else do I need?:: OK, I've obtained gcc; what else do I need?
-* use GNU linker?:: Should I use the GNU linker, or should I use "collect"?
-* Use GNU assembler?:: Should I use the GNU assembler, or my vendor's assembler?
-* repository:: How do I use the new template repository code?
-* repo bugs:: Known bugs and problems with the repo patch
-* Use GNU C library?:: Should I use the GNU C library?
-* Global constructor problems:: Global constructors aren't being called
-* Strange assembler errors:: Strange assembler errors when linking C++ programs
-* Other problems building libg++:: Other problems building libg++
-* More size_t problems:: But I'm still having problems with size_t!
-* Rebuild libg++?:: Rebuild libg++ to go with my new g++?
-* co-existing versions:: I want several versions of g++ and libg++ to co-exist
-* Installing on Linux:: Trouble installing g++ and libg++ on Linux
-* Linux Slackware 3.0:: On my Linux system, the "hello world" program fails
-@end menu
-
-@node gcc-2 + g++-1, what else do I need?, , installation
-@section I can't build g++ 1.x.y with gcc-2.x.y!
-
-``I obtained gcc-2.x.y and g++ 1.x.y and I'm trying to build it, but
-I'm having major problems. What's going on?''
-
-@cindex g++, building
-If you wish to build g++-1.42, you must obtain gcc-1.42 first. The
-installation instructions for g++ version 1 leave a lot to be desired,
-unfortunately, and I would recommend that, unless you have a special
-reason for needing the 1.x compiler, that C++ users use the latest
-g++-2.x version, as it
-is the version that is being actively maintained.
-
-@cindex g++, template support
-@cindex Templates
-@cindex ANSI draft standard
-There is no template support in g++-1.x, and it is generally much further
-away from the ANSI draft standard than g++-2.x is.
-
-@node what else do I need?, use GNU linker?, gcc-2 + g++-1, installation
-@section OK, I've obtained gcc; what else do I need?
-
-@cindex libg++
-First off, you'll want libg++ as you can do almost nothing without it
-(unless you replace it with some other class library).
-
-@cindex GNU GAS
-@cindex GNU GAS [assembler]
-Second, depending on your platform, you may need "GAS", the GNU assembler,
-or the GNU linker (see next question).
-
-@cindex GNU gdb
-Finally, while it is not required, you'll almost certainly want the GNU
-debugger, gdb. The latest version is 4.15.1, released November 4, 1995. Other
-debuggers (like dbx, for example) will normally not be able to
-understand at least some of the debug information produced by g++.
-
-@node use GNU linker?, Use GNU assembler?, what else do I need?, installation
-@section Should I use the GNU linker, or should I use "collect"?
-
-@cindex Linker
-@cindex System VR3, linker
-@cindex System VR4, linker
-First off, for novices: special measures must be taken with C++ to arrange
-for the calling of constructors for global or static objects before the
-execution of your program, and for the calling of destructors at the end.
-(Exception: System VR3 and System VR4 linkers, Linux/ELF, and some other
-systems support user-defined
-segments; g++ on these systems requires neither the GNU linker nor
-collect. So if you have such a system, the answer is that you don't
-need either one).
-
-@cindex AT&T cfront
-@cindex Cfront-end
-@cindex collect program
-@cindex GNU linker
-@cindex GNU binutils
-If you have experience with AT&T's "cfront", this function is performed
-there by programs named "patch" or "munch". With GNU C++, it is performed
-either by the GNU linker or by a program known as "collect". The collect
-program is part of the gcc-2.x distribution; you can obtain the GNU linker
-separately as part of the "binutils" package. The latest version of
-binutils is 2.5.2, released November 2, 1994.
-
-(To be technical, it's "collect2"; there were originally several
-alternative versions of collect, and this is the one that survived).
-
-There are advantages and disadvantages to either choice.
-
-Advantages of the GNU linker:
-@cindex GNU linker, advantages
-@cindex GNU ld
-@cindex ld [GNU linker]
-
-It's faster than using collect -- collect basically runs the standard Unix
-linker on your program twice, inserting some extra code after the first
-pass to call the constructors. This is a sizable time penalty for large
-programs. The GNU linker does not require this extra pass.
-
-GNU ld reports undefined symbols using their true names, not the mangled
-names (but as of 2.7.0 so does collect).
-
-If there are undefined symbols, GNU ld reports which object file(s) refer to
-the undefined symbol(s).
-
-As of binutils version 2.2, on systems that use the so-called "a.out"
-debug format (e.g. Suns running SunOS 4.x), the GNU linker compresses
-the debug symbol table considerably.
-
-@cindex collect linker, advantages
-Advantages of collect:
-
-@cindex Shared libraries
-If your native linker supports shared libraries, you can use shared
-libraries with collect. This used to be a strong reason @emph{not}
-to use the GNU linker, but recent versions of GNU ld support linking
-with shared libraries on many platforms, and creating shared libraries
-on a few (such as Intel x86 systems that use ELF object format).
-
-Note: using existing shared libraries (X and libc, for example) works
-very nicely. Generating shared libraries from g++-compiled code is
-another matter, generally requiring OS-dependent tricks if it is
-possible at all. But progress has been made recently.
-
-As of 2.7.0, building C++ shared libraries should work fine on supported
-platforms (HPUX 9+, IRIX 5+, DEC UNIX (formerly OSF/1), SunOS 4,
-Linux/ELF
-and all targets using SVR4-style ELF shared libraries).
-
-@cindex Shared version of libg++
-However, as of libg++ 2.6.2, the libg++ distribution contains some
-patches to build libg++ as a shared library on some OSes (those listed
-above). Check the file @file{README.SHLIB} from that distribution.
-
-@cindex GNU linker, porting
-The GNU linker has not been ported to as many platforms as g++ has, so you
-may be forced to use collect.
-
-If you use collect, you don't need to get something extra and figure out
-how to install it; the standard gcc installation procedure will do it for you.
-
-In conclusion, I don't see a clear win for either alternative at this
-point. Take your pick.
-
-@node Use GNU assembler?, repository, use GNU linker?, installation
-@section Should I use the GNU assembler, or my vendor's assembler?
-
-@cindex Assembler
-@cindex GNU GAS
-This depends on your platform and your decision about the GNU linker. For
-most platforms, you'll need to use GAS if you use the GNU linker. For
-some platforms, you have no choice; check the gcc installation notes to
-see whether you must use GAS. But you can usually use the vendor's
-assembler if you don't use the GNU linker.
-
-The GNU assembler assembles faster than many native assemblers; however,
-on many platforms it cannot support the local debugging format.
-
-If you want to build shared libraries from gcc/g++ output and you are on
-a Sun, you must @emph{not} use GNU as, as it cannot do
-position-independent code correctly yet. @emph{Note}: I've been
-told that this problem has been fixed in the most recent binutils
-release, but I haven't checked this yet.
-
-On HPUX or IRIX, you must use GAS (and configure gcc with the
-@code{--with-gnu-as} option) to debug your programs. GAS is
-strongly recommended particularly on the HP platform because of
-limitations in the HP assembler.
-
-The GAS distribution has recently been merged with the binutils
-distribution, so the GNU assembler and linker are now together in
-this package (as of binutils version 2.5.1).
-
-@node repository, repo bugs, Use GNU assembler?, installation
-@section How do I use the new repository code?
-
-@cindex repo patch
-Because there is some disagreement about the details of the template
-repository mechanism, you'll need to obtain a patch from Cygnus Support
-to enable the 2.7.2 repository code. You can obtain the patch by
-anonymous FTP: @file{ftp://ftp.cygnus.com/pub/g++/gcc-2.7.2-repo.gz}.
-
-There are patches for 2.7.0 and 2.7.1 in the same directory, though
-if you're going to rebuild the compiler you should use the latest one.
-
-@cindex repo patch for BSD
-If you're running NetBSD or BSDI, the Cygnus repo patch is not quite
-correct. Tim Liddelow has made an alternate version available at
-@file{ftp://ftp.cst.com.au/pub/gcc-2.7.2-repo-bsd.gz}.
-
-After you've applied the patch, the @code{-frepo} flag will enable the
-repository mechanism. The flag works much like the existing
-@code{-fno-implicit-templates} flag, except that auxiliary files, with
-an @file{.rpo} extension, are built that specify what template
-expansions are needed. At link time, the (patched) collect program
-detects missing templates and recompiles some of the object files
-so that the required templates are expanded.
-
-Note that the mechanism differs from that of cfront in that template
-definitions still must be visible at the point where they are to be
-expanded. No assumption is made that @file{foo.C} contains template
-definitions corresponding to template declarations in @file{foo.h}.
-
-@cindex closure with repo
-@cindex template closure
-Jason Merrill writes: ``To perform closure on a set of objects, just try
-to link them together. It will fail, but as a side effect all needed
-instances will be generated in the objects.''
-
-@node repo bugs, Use GNU C library?, repository, installation
-@section Known bugs and problems with the repo patch
-
-``The @code{-frepo} won't expand templated friend functions!''
-
-This is a known bug; currently you'll have to explicitly instantiate
-friend functions when using @code{-frepo} due to this bug (in 2.7.0
-through 2.7.2 at least).
-
-With earlier versions of the repo patch, there was a bug that happens
-when you have given a quoted command line switch, something like
-
-@example
--D'MESSAGE="hello there"'
-@end example
-
-The repo code tries to recompile files using the same flags you
-originally specified, but doesn't quote arguments that need quoting,
-resulting in failures in some cases. This is no longer a problem
-with the 2.7.2 patch.
-
-@node Use GNU C library?, Global constructor problems, repo bugs, installation
-@section Should I use the GNU C library?
-
-@cindex GNU C library
-@cindex libg++
-At this point in time, no. The GNU C library is still very young, and
-libg++ still conflicts with it in some places. Use your native C library
-unless you know a lot about the gory details of libg++ and gnu-libc. This
-will probably change in the future.
-
-@node Global constructor problems, Strange assembler errors, Use GNU C library?, installation
-@section Global constructors aren't being called
-
-@cindex global constructors
-``I've installed gcc and it almost works, but constructors and
-destructors for global objects and objects at file scope aren't being
-called. What did I do wrong?''
-
-@cindex collect program
-It appears that you are running on a platform that requires you to
-install either "collect2" or the GNU linker, and you have done neither.
-For more information, see the section discussing the GNU linker
-(@xref{use GNU linker?}).
-
-@cindex constructor problems on Solaris
-@cindex Solaris, constructor problems
-On Solaris 2.x, you shouldn't need a collect program and GNU ld doesn't run.
-If your global constructors aren't being called, you may need to install
-a patch, available from Sun, to fix your linker. The number of the
-``jumbo patch'' that applies is 101409-03. Thanks to Russell Street
-(r.street@@auckland.ac.nz) for this info.
-
-@cindex IRIX, installing collect
-It appears that on IRIX, the collect2 program is not being installed
-by default during the installation process, though it is required;
-you can install it manually by executing
-
-@example
-make install-collect2
-@end example
-
-from the gcc source directory after installing the compiler. (I'm
-not certain for which versions of gcc this problem occurs, and whether
-it is still present).
-
-@node Strange assembler errors, Other problems building libg++, Global constructor problems, installation
-@section Strange assembler errors when linking C++ programs
-
-``I've installed gcc and it seemed to go OK, but when I attempt to link
-any C++ program, I'm getting strange errors from the assembler! How
-can that be?''
-
-The messages in question might look something like
-
-@example
-as: "/usr/tmp/cca14605.s", line 8: error: statement syntax
-as: "/usr/tmp/cca14605.s", line 14: error: statement syntax
-@end example
-
-(on a Sun, different on other platforms). The important thing is that
-the errors come out at the link step, @emph{not} when a C++ file is
-being compiled.
-
-@cindex nm program
-@cindex GNU nm program
-Here's what's going on: the collect2 program uses the Unix ``nm''
-program to obtain a list of symbols for the global constructors and
-destructors, and it builds a little assembly language module that
-will permit them all to be called. If you're seeing this symptom,
-you have an old version of GNU nm somewhere on your path. This old
-version prints out symbol names in a format that the collect2 program
-does not expect, so bad assembly code is generated.
-
-The solution is either to remove the old version of GNU nm from your
-path (and that of everyone else who uses g++), or to install a newer
-version (it is part of the GNU "binutils" package). Recent versions
-of GNU nm do not have this problem.
-
-@node Other problems building libg++, More size_t problems, Strange assembler errors, installation
-@section Other problems building libg++
-@cindex libg++ on Ultrix
-@cindex libg++ on SunOS
-
-``I am having trouble building libg++. Help!''
-
-On some platforms (for example, Ultrix), you may see errors complaining
-about being unable to open dummy.o. On other platforms (for example,
-SunOS), you may see problems having to do with the type of size_t.
-The fix for these problems is to make libg++ by saying "make CC=gcc".
-According to Per Bothner, it should no longer be necessary to specify
-"CC=gcc" for libg++-2.3.1 or later.
-
-``I built and installed libg++, but g++ can't find it. Help!''
-
-The string given to @file{configure} that identifies your system must
-be the same when you install libg++ as it was when you installed gcc.
-Also, if you used the @code{--prefix} option to install gcc somewhere
-other than @file{/usr/local}, you must use the same value for
-@code{--prefix} when installing libg++, or else g++ will not be able
-to find libg++.
-
-@cindex patch for libg++-2.6.2
-
-The toplevel Makefile in the libg++ 2.6.2 distribution is broken, which
-along with a bug in g++ 2.6.3 causes problems linking programs that use the
-libstdc++ complex classes. A patch for this is available from
-@file{ftp://ftp.cygnus.com//pub/g++/libg++-2.6.2-fix.gz}.
-
-@node More size_t problems, Rebuild libg++?, Other problems building libg++, installation
-@section But I'm @emph{still} having problems with @code{size_t}!
-
-@cindex Type of size_t
-``I did all that, and I'm @emph{still} having problems with disagreeing
-definitions of size_t, SIZE_TYPE, and the type of functions like
-@code{strlen}.''
-
-@cindex _G_config.h
-The problem may be that you have an old version of @file{_G_config.h}
-lying around. As of libg++ version 2.4, @file{_G_config.h}, since it is
-platform-specific, is inserted into a different directory; most include
-files are in @file{$prefix/lib/g++-include}, but this file now lives in
-@file{$prefix/$arch/include}. If, after upgrading your libg++, you find that
-there is an old copy of @file{_G_config.h} left around, remove it,
-otherwise g++ will find the old one first.
-
-@node Rebuild libg++?, co-existing versions, More size_t problems, installation
-@section Do I need to rebuild libg++ to go with my new g++?
-
-``After I upgraded g++ to the latest version, I'm seeing undefined
-symbols.''
-
-or
-
-``If I upgrade to a new version of g++, do I need to reinstall libg++?''
-
-@cindex Incompatibilities between g++ versions
-
-As a rule, the first two digits of your g++ and libg++ should be the
-same. Normally when you do an upgrade in the ``minor version number''
-(2.5.7 to 2.5.8, say) there isn't a need to rebuild libg++, but there
-have been a couple of exceptions in the past.
-
-@node co-existing versions, Installing on Linux, Rebuild libg++?, installation
-@section I want several versions of g++ and libg++ to co-exist.
-
-I recommend against using the @code{-V} flag to make multiple versions
-of gcc/g++ co-exist, unless they are different minor releases that can use
-the same compiled version of libg++. The reason is that all these
-versions will try to use the same libg++ version, which usually will
-not work.
-
-Instead, use the @code{--prefix} flag when configuring gcc. Use a
-different value of @code{--prefix} for each gcc version. Use the
-same value of @code{--prefix} when configuring libg++. You can then
-have any number of co-existing gcc/libg++ pairs. Symbolic links can
-be used so that users don't need to put all these different directories
-on their paths.
-
-One possible system to use is to set @code{--prefix} to
-@file{/usr/local/gcc-2.x.y} for version 2.x.y of gcc, and to link
-whichever version of gcc you wish to be the default into
-@file{/usr/local/bin/gcc} and @file{/usr/local/bin/g++}.
-
-@node Installing on Linux, Linux Slackware 3.0, co-existing versions, installation
-@section Trouble installing g++ and libg++ on Linux
-
-``I've downloaded the latest g++ and libg++ and I'm trying to install
-them on Linux, and I'm having lots of problems.''
-
-@cindex Linux
-FSF releases of libg++ won't install on Linux unchanged, since Linux
-uses are part of the libio library from libg++ for its standard C
-library, only this is changed in a way that it clashes with libg++.
-This means that you'll need a patched version of libg++ for it to
-work.
-
-If you want to upgrade to a new gcc/libg++ combination, the easiest
-thing to do is to grab the prebuilt versions of gcc and libg++ for Linux
-from @file{ftp://tsx-11.mit.edu/pub/linux/packages/GCC}. Follow the
-directions carefully. If you want to build from source, you'll need
-a patch for libg++; the Linux developers have named the patched libg++
-version libg++-2.7.1.3 and there is a patch file in the above-named
-directory.
-
-See @file{ftp://www.mrc-apu.cam.ac.uk/pub/linux/GCC-FAQ.html},
-the Linux GCC FAQ (though it may be a bit out of date; the Linux
-community moves quickly).
-
-@node Linux Slackware 3.0, , Installing on Linux, installation
-@section Problems with g++ on Linux Slackware 3.0
-
-@cindex Slackware
-@cindex Linux Slackware
-``When I try to compile the traditional Hello, world program on Linux,
-the compiler can't find @file{iostream.h}. What's the deal?''
-
-You probably have the Slackware 3.0 release. There's an error in the
-setup. It's easy to fix, though; log in as root, and make a symbolic
-link:
-
-@example
-ln -s /usr/lib/g++-include /usr/include/g++
-@end example
-
-@node User Problems, legalities, installation, Top
-@chapter User Problems
-
-@menu
-* missing virtual table:: Linker complains about missing virtual table
-* for scope:: gcc-2.7.0 breaks declarations in "for" statements!
-* const constructor:: g++ seems to want a const constructor. What's that?
-* unused parameter warnings:: How to silence ``unused parameter'' warnings
-* jump crosses initialization:: g++ objects to a declaration in a case statement
-* Demangler:: Where can I find a demangler?
-* static data members:: Linker reports undefined symbols for static data members
-* internal compiler error:: What does ``internal compiler error'' mean?
-* bug reports:: I think I have found a bug in g++.
-* porting to g++:: Porting programs from other compilers to g++
-* name mangling:: Why does g++ mangle names differently from other C++ compilers?
-* problems linking with other libraries:: Why can't g++ code link with code from other C++ compilers?
-* documentation:: What documentation exists for g++ 2.x?
-* templates:: Problems with the template implementation
-* undefined templates:: I get undefined symbols when using templates
-* redundant templates:: I get multiply defined symbols when using templates
-* Standard Template Library:: Does g++ support the Standard Template Library?
-* exceptions:: Problems and limitations with exceptions
-* namespaces:: Does g++ support namespaces?
-* agreement with standards:: What are the differences between g++ and the ARM specification of C++?
-* compiling standard libraries:: Will g++ compile InterViews? NIHCL? Rogue Wave?
-* debugging on SVR4 systems:: Debugging on SVR4 systems
-* debugging problems on Solaris:: debugging problems on Solaris
-* X11 conflicts with libg++:: Conflict over meaning of String
-* assignment to streams:: Why can't I assign one stream to another?
-@end menu
-
-@node missing virtual table, for scope, , User Problems
-@section Linker complains about missing virtual table
-
-``I'm getting a message complaining about an undefined virtual table. Is
-this a compiler bug?''
-
-(On platforms that run neither collect nor the GNU linker, like Solaris,
-you may see an odd undefined symbol like "_vt.3foo", where foo is a
-class name).
-
-This is probably because you are missing a definition for the first
-(non-inline) virtual function of the class. Since gcc-2.7.0, g++ uses
-a trick borrowed from cfront: the .o file containing the definition for
-the first non-inline virtual function for the class will also contain
-the virtual function table.
-
-@node for scope, const constructor, missing virtual table, User Problems
-@section gcc-2.7.0 breaks declarations in "for" statements!
-
-@cindex declarations in for statements
-@cindex for statements: declarations
-
-gcc-2.7.0 implements the new ANSI/ISO rule on the scope of variables
-declared in for loops.
-
-@example
-for (int i = 1; i <= 10; i++) @{
- // do something here
-@}
-foo(i);
-@end example
-
-In the above example, most existing C++ compilers would pass the
-value 11 to the function @code{foo}. In gcc 2.7 and in the ANSI/ISO
-working paper, the scope of @code{i} is only the for loop body, so
-this is an error. So that old code can be compiled, the new gcc has
-a flag @code{-fno-for-scope} that causes the old rule to be used.
-@cindex -fno-for-scope
-
-As of 2.7.1, the compiler attempts to issue warnings about code that
-has different meanings under the two sets of rules, but the code is
-not perfect: the intent was that code that has valid, but different,
-meanings under the ARM rules and the working paper rules would give
-warnings but have the new behavior, and this doesn't seem to happen.
-
-The @code{-ffor-scope} flag under 2.7.1 and 2.7.2 gives the 2.7.0 behavior.
-
-@node const constructor, unused parameter warnings, for scope, User Problems
-@section g++ seems to want a const constructor. What's that?
-
-gcc-2.7.1 introduced a bug that causes the compiler to ask for a
-const constructor (there's no such thing in C++) in certain situations
-where a const object appears in a template class. Most cases have been
-fixed in gcc-2.7.2, but unfortunately not all. Still, if you're running
-gcc-2.7.1 and have this problem, upgrade to 2.7.2; it is a vast improvement.
-
-@cindex ObjectSpace<STL>
-
-The default constructor for the template @code{pair} in ObjectSpace's
-implementation of STL triggers the bug in one place, for gcc 2.7.2. If
-you're using ObjectSpace<STL> and having this problem, simply
-change the default constructor from
-
-@example
-os_pair () : first (T1 ()), second (T2 ()) @{@}
-@end example
-
-to just
-
-@example
-os_pair () @{@}
-@end example
-
-Once this is done, ObjectSpace<STL> works fairly well.
-
-@node unused parameter warnings, jump crosses initialization, const constructor,User Problems
-@section How to silence ``unused parameter'' warnings
-
-@cindex -Wall
-@cindex -Wunused
-
-``When I use @code{-Wall} (or @code{-Wunused}), g++ warns about
-unused parameters. But the parameters have to be there, for use
-in derived class functions. How do I get g++ to stop complaining?''
-
-The answer is to simply omit the names of the unused parameters when
-defining the function. This makes clear, both to g++ and to readers
-of your code, that the parameter is unused. For example:
-
-@example
-int Foo::bar(int arg) @{ return 0; @}
-@end example
-
-will give a warning for the unused parameter @code{arg}. To suppress
-the warning write
-
-@example
-int Foo::bar(int) @{ return 0; @}
-@end example
-
-@node jump crosses initialization, Demangler, unused parameter warnings, User Problems
-@section g++ objects to a declaration in a case statement
-
-``The compiler objects to my declaring a variable in one of the branches
-of a case statement. Earlier versions used to accept this code. Why?''
-
-The draft standard does not allow a goto or a jump to a case label to
-skip over an initialization of a variable or a class object. For
-example:
-
-@example
-switch ( i ) @{
- case 1:
- Object obj(0);
- ...
- break;
- case 2:
- ...
- break;
-@}
-@end example
-
-The reason is that @code{obj} is also in scope in the rest of the switch
-statement.
-
-As of version 2.7.0, the compiler will object that the jump to the
-second case level crosses the initialization of @code{obj}. Older
-compiler versions would object only if class Object has a destructor.
-In either case, the solution is to add a set of curly braces around
-the case branch:
-
-@example
- case 1:
- @{
- Object obj(0);
- ...
- break;
- @}
-@end example
-
-@node Demangler, static data members, jump crosses initialization, User Problems
-@section Where can I find a demangler?
-
-@cindex demangler program
-A g++-compatible demangler named @code{c++filt} can be found in the
-@file{binutils} distribution. This distribution (which also contains
-the GNU linker) can be found at any GNU archive site.
-
-As of version 2.7.0, @code{c++filt} is included with gcc and is
-installed automatically. Even better, it is used by the @code{collect}
-linker, so you don't see mangled symbols anymore (except on platforms
-that use neither collect nor the GNU linker, like Solaris).
-
-@node static data members, internal compiler error, Demangler, User Problems
-@section Linker reports undefined symbols for static data members
-
-@cindex Static data members
-``g++ reports undefined symbols for all my static data members when I link,
-even though the program works correctly for compiler XYZ. What's going on?''
-
-The problem is almost certainly that you don't give definitions for
-your static data members. If you have
-
-@example
-class Foo @{
- ...
- void method();
- static int bar;
-@};
-@end example
-
-you have only declared that there is an int named Foo::bar and a member
-function named Foo::method that is defined somewhere. You still need to
-define @emph{both} method() and bar in some source file. According to
-the draft ANSI standard, you must supply an initializer, such as
-
-@example
-int Foo::bar = 0;
-@end example
-
-@noindent
-in one (and only one) source file.
-
-@node internal compiler error, bug reports, static data members, User Problems
-@section What does ``Internal compiler error'' mean?
-
-It means that the compiler has detected a bug in itself. Unfortunately,
-g++ still has many bugs, though it is a lot better than it used to be.
-If you see this message, please send in a complete bug report (see next
-section).
-
-@node bug reports, porting to g++, internal compiler error, User Problems
-@section I think I have found a bug in g++.
-
-@cindex Bug in g++, newly found
-``I think I have found a bug in g++, but I'm not sure. How do I know,
-and who should I tell?''
-
-@cindex Manual, for gcc
-First, see the excellent section on bugs and bug reports in the gcc manual
-(which is included in the gcc distribution). As a short summary of that
-section: if the compiler gets a fatal signal, for any input, it's a bug
-(newer versions of g++ will ask you to send in a bug report when they
-detect an error in themselves). Same thing for producing invalid
-assembly code.
-
-When you report a bug, make sure to describe your platform (the type of
-computer, and the version of the operating system it is running) and the
-version of the compiler that you are running. See the output of the
-command @code{g++ -v} if you aren't sure. Also provide enough code
-so that the g++ maintainers can duplicate your bug. Remember that the
-maintainers won't have your header files; one possibility is to send
-the output of the preprocessor (use @code{g++ -E} to get this). This
-is what a ``complete bug report'' means.
-
-I will add some extra notes that are C++-specific, since the notes from
-the gcc documentation are generally C-specific.
-
-@cindex g++ bug report
-First, mail your bug report to "bug-g++@@prep.ai.mit.edu". You may also
-post to @file{gnu.g++.bug}, but it's better to use mail, particularly if you
-have any doubt as to whether your news software generates correct reply
-addresses. Don't mail C++ bugs to bug-gcc@@prep.ai.mit.edu.
-
-@strong{News:} as I write this (late February 1996) the gateway
-connecting the bug-g++ mailing list and the @file{gnu.g++.bug} newsgroup
-is (temporarily?) broken. Please mail, do not post bug reports.
-
-@cindex libg++ bug report
-If your bug involves libg++ rather than the compiler, mail to
-bug-lib-g++@@prep.ai.mit.edu. If you're not sure, choose one, and if you
-guessed wrong, the maintainers will forward it to the other list.
-
-@cindex C++, reference books
-@cindex ARM [Annotated C++ Ref Manual]
-Second, if your program does one thing, and you think it should do
-something else, it is best to consult a good reference if in doubt.
-The standard reference is the draft working paper from the ANSI/ISO
-C++ standardization committee, which you can get on the net.
-For PostScript and PDF (Adobe Acrobat) versions, see the
-archive at @file{ftp://research.att.com/dist/stdc++/WP}. For HTML and ASCII
-versions, see @file{ftp://ftp.cygnus.com/pub/g++}. On the World Wide Web, see
-@file{http://www.cygnus.com/misc/wp/}.
-
-An older
-standard reference is "The Annotated C++ Reference Manual", by Ellis and
-Stroustrup (copyright 1990, ISBN #0-201-51459-1). This is what they're
-talking about on the net when they refer to ``the ARM''. But you should
-know that changes have been made to the language since then.
-
-The ANSI/ISO C++ standards committee have adopted some changes to the
-C++ language since the publication of the original ARM, and newer
-versions of g++ (2.5.x and later) support some of these changes, notably
-the mutable keyword (added in 2.5.0), the bool type (added in 2.6.0),
-and changes in the scope of variables defined in for statements (added
-in 2.7.0).
-You can obtain an addendum to the ARM explaining many of these changes by FTP
-from @file{ftp://ftp.std.com/AW/stroustrup2e/new_iso.ps}.
-
-@cindex AT&T cfront
-Note that the behavior of (any version of) AT&T's "cfront" compiler is
-NOT the standard for the language.
-
-@node porting to g++, name mangling, bug reports, User Problems
-@section Porting programs from other compilers to g++
-
-``I have a program that runs on <some other C++ compiler>, and I want
-to get it running under g++. Is there anything I should watch out
-for?''
-
-@cindex Porting to g++
-
-Note that g++ supports many of the newer keywords that have recently
-been added to the language. Your other C++ compiler may not support
-them, so you may need to rename variables and members that conflict
-with these keywords.
-
-There are two other reasons why a program that worked under one compiler
-might fail under another: your program may depend on the order of
-evaluation of side effects in an expression, or it may depend on the
-lifetime of a temporary (you may be assuming that a temporary object
-"lives" longer than the standard guarantees). As an example of the
-first:
-
-@example
-void func(int,int);
-
-int i = 3;
-func(i++,i++);
-@end example
-
-@cindex Order of evaluation, problems in porting
-Novice programmers think that the increments will be evaluated in strict
-left-to-right order. Neither C nor C++ guarantees this; the second
-increment might happen first, for example. func might get 3,4, or it
-might get 4,3.
-
-@cindex Classes, problems in porting
-@cindex Problems in porting, class
-The second problem often happens with classes like the libg++ String
-class. Let's say I have
-
-@example
-String func1();
-void func2(const char*);
-@end example
-
-and I say
-
-@example
-func2(func1());
-@end example
-
-because I know that class String has an "operator const char*". So what
-really happens is
-
-@example
-func2(func1().convert());
-@end example
-
-@cindex temporaries
-where I'm pretending I have a convert() method that is the same as the
-cast. This is unsafe in g++ versions before 2.6.0, because the
-temporary String object may be deleted after its last use (the call to
-the conversion function), leaving the pointer pointing to garbage, so by
-the time func2 is called, it gets an invalid argument.
-
-@cindex ANSI draft standard
-Both the cfront and the old g++ behaviors are legal according to the ARM,
-but the powers that be have decided that compiler writers were given
-too much freedom here.
-
-The ANSI C++ committee has now come to a resolution of the lifetime of
-temporaries problem: they specify that temporaries should be deleted at
-end-of-statement (and at a couple of other points). This means that g++
-versions before 2.6.0 now delete temporaries too early, and cfront
-deletes temporaries too late. As of version 2.6.0, g++ does things
-according to the new standard.
-
-@cindex Scope, problems in porting
-@cindex Problems in porting, scope
-For now, the safe way to write such code is to give the temporary a name,
-which forces it to live until the end of the scope of the name. For
-example:
-
-@example
-String& tmp = func1();
-func2(tmp);
-@end example
-
-Finally, like all compilers (but especially C++ compilers, it seems),
-g++ has bugs, and you may have tweaked one. If so, please file a bug
-report (after checking the above issues).
-
-@node name mangling, problems linking with other libraries, porting to g++, User Problems
-@section Why does g++ mangle names differently from other C++ compilers?
-
-See the answer to the next question.
-@cindex Mangling names
-
-@node problems linking with other libraries, documentation, name mangling, User Problems
-@section Why can't g++ code link with code from other C++ compilers?
-
-``Why can't I link g++-compiled programs against libraries compiled by
-some other C++ compiler?''
-
-@cindex Mangling names
-@cindex Cygnus Support
-Some people think that,
-if only the FSF and Cygnus Support folks would stop being
-stubborn and mangle names the same way that, say, cfront does, then any
-g++-compiled program would link successfully against any cfront-compiled
-library and vice versa. Name mangling is the least of the problems.
-Compilers differ as to how objects are laid out, how multiple inheritance
-is implemented, how virtual function calls are handled, and so on, so if
-the name mangling were made the same, your programs would link against
-libraries provided from other compilers but then crash when run. For this
-reason, the ARM @emph{encourages} compiler writers to make their name mangling
-different from that of other compilers for the same platform.
-Incompatible libraries are then detected at link time, rather than at run
-time.
-@cindex ARM [Annotated C++ Ref Manual]
-@cindex Compiler differences
-
-@node documentation, templates, problems linking with other libraries, User Problems
-@section What documentation exists for g++ 2.x?
-
-@cindex g++, documentation
-Relatively little.
-While the gcc manual that comes with the distribution has some coverage
-of the C++ part of the compiler, it focuses mainly on the C compiler
-(though the information on the ``back end'' pertains to C++ as well).
-Still, there is useful information on the command line options and the
-#pragma interface and #pragma implementation directives in the manual,
-and there is a useful section on template instantiation in the 2.6 version.
-There is a Unix-style manual entry, "g++.1", in the gcc-2.x
-distribution; the information here is a subset of what is in the manual.
-
-You can buy a nicely printed and bound copy of this manual from the FSF;
-see above for ordering information.
-
-For versions 2.6.2 and later, the gcc/g++ distribution contains the
-gcc manual in PostScript. Also,
-Postscript versions of GNU documentation in U.S. letter format
-are available by anonymous FTP from @file{ftp://primus.com/pub/gnu-ps}.
-The same, in A4 format, are on @*
-@file{ftp://liasun3.epfl.ch/pub/gnu/ps-doc}.
-
-A draft of a document describing the g++ internals appears in the gcc
-distribution (called g++int.texi); it is incomplete but gives lots of
-information.
-
-@node templates, undefined templates, documentation, User Problems
-@section Problems with the template implementation
-
-@cindex g++, template support
-@cindex Templates
-
-g++ does not implement a separate pass to instantiate template functions
-and classes at this point; for this reason, it will not work, for the most
-part, to declare your template functions in one file and define them in
-another. The compiler will need to see the entire definition of the
-function, and will generate a static copy of the function in each file
-in which it is used.
-
-(The experimental template repository code (see @xref{repository}) that
-can be added to 2.7.0 or later does implement a separate pass, but there
-is still no searching of files that the compiler never saw).
-
-@cindex -fno-implicit-templates
-For version 2.6.0, however, a new switch @code{-fno-implicit-templates}
-was added; with this switch, templates are expanded only under user
-control. I recommend that all g++ users that use templates read the
-section ``Template Instantiation'' in the gcc manual (version 2.6.x
-and newer). g++ now supports explicit template expansion using the
-syntax from the latest C++ working paper:
-
-@example
-template class A<int>;
-template ostream& operator << (ostream&, const A<int>&);
-@end example
-
-@cindex template limitations
-As of version 2.6.3, there are still a few limitations in the template
-implementation besides the above (thanks to Jason Merrill for this info):
-These are still present in version 2.7.2, but a new implementation of
-templates planned for version 2.8 will eliminate them.
-
-@enumerate 1
-@item
-Static data member templates are not supported. You can work around
-this by explicitly declaring the static variable for each template
-specialization:
-
-@example
-template <class T> struct A @{
- static T t;
-@};
-
-template <class T> T A<T>::t = 0; // gets bogus error
-int A<int>::t = 0; // OK (workaround)
-@end example
-
-(still a limitation in 2.7.2)
-
-@item
-Template member names are not available when defining member function
-templates.
-
-@example
-template <class T> struct A @{
- typedef T foo;
- void f (foo);
- void g (foo arg) @{ ... @}; // this works
-@};
-
-template <class T> void A<T>::f (foo) @{ @} // gets bogus error
-@end example
-
-@item
-Templates are instantiated using the parser. This results in two
-problems:
-
-a) Class templates are instantiated in some situations where such
-instantiation should not occur.
-
-@example
-template <class T> class A @{ @};
-A<int> *aip = 0; // should not instantiate A<int> (but does)
-@end example
-
-b) Function templates cannot be inlined at the site of their
-instantiation.
-
-@example
-template <class T> inline T min (T a, T b) @{ return a < b ? a : b; @}
-
-void f () @{
- int i = min (1, 0); // not inlined
-@}
-
-void g () @{
- int j = min (1, 0); // inlined
-@}
-@end example
-
-A workaround that works in version 2.6.1 and later is to specify
-
-@example
-extern template int min (int, int);
-@end example
-
-before @code{f()}; this will force it to be instantiated (though not
-emitted).
-
-@item
-Member function templates are always instantiated when their containing
-class is. This is wrong.
-@end enumerate
-
-@node undefined templates, redundant templates, templates, User Problems
-@section I get undefined symbols when using templates
-
-(Thanks to Jason Merrill for this section).
-
-@cindex template instantiation
-g++ does not automatically instantiate templates defined in other files.
-Because of this, code written for cfront will often produce undefined
-symbol errors when compiled with g++. You need to tell g++ which template
-instances you want, by explicitly instantiating them in the file where they
-are defined. For instance, given the files
-
-@file{templates.h}:
-@example
-template <class T>
-class A @{
-public:
- void f ();
- T t;
-@};
-
-template <class T> void g (T a);
-@end example
-
-@file{templates.cc}:
-@example
-#include "templates.h"
-
-template <class T>
-void A<T>::f () @{ @}
-
-template <class T>
-void g (T a) @{ @}
-@end example
-
-
-main.cc:
-@example
-#include "templates.h"
-
-main ()
-@{
- A<int> a;
- a.f ();
- g (a);
-@}
-@end example
-
-compiling everything with @code{g++ main.cc templates.cc} will result in
-undefined symbol errors for @samp{A<int>::f ()} and @samp{g (A<int>)}. To
-fix these errors, add the lines
-
-@example
-template class A<int>;
-template void g (A<int>);
-@end example
-
-to the bottom of @samp{templates.cc} and recompile.
-
-@node redundant templates, Standard Template Library, undefined templates, User Problems
-@section I get multiply defined symbols using templates
-
-You may be running into a bug that was introduced in version 2.6.1
-(and is still present in 2.6.3) that generated external linkage
-for templates even when neither @code{-fexternal-templates} nor
-@code{-fno-implicit-templates} is specified. There is a patch for
-this problem at @*
-@file{ftp://ftp.cygnus.com/pub/g++/gcc-2.6.3-template-fix}.
-
-I recommend either applying the patch or
-using @code{-fno-implicit-templates}
-together with explicit template instantiation as described in previous
-sections.
-
-This bug is fixed in 2.7.0.
-
-@node Standard Template Library, exceptions, redundant templates, User Problems
-@section Does g++ support the Standard Template Library?
-
-From Per Bothner:
-
-@cindex STL
-@cindex Standard Template Library
-The Standard Template Library (STL) uses many of the extensions that the
-ANSI/ISO committee has made to templates, and g++ doesn't support
-some of these yet. So if you grab HP's free implementation of STL it
-isn't going to work. However, starting with libg++-2.6.2 libg++ contains a
-hacked version of STL, based on work by Carsten Bormann, which permits
-g++ to compile at least the containers. A full implementation is
-going to need improved template support, which will take a while yet
-(2.8.0 will compile the HP version successfully, except for a couple
-of easily fixed places where the HP code violates the draft standard).
-
-Actually, the hacked STL and gcc-2.7.2 work quite well; I've succeeded
-in making significant use of it.
-Almost all of the ObjectSpace examples (a set of
-over 200 simple examples of STL usage) now work.
-
-There are several commercial suppliers of STL implementations;
-ObjectSpace's version supports gcc-2.7.x.
-
-Mumit Khan has produced an ``STL newbie guide'' with lots of information
-on using STL with gcc. See
-
-@file{http://www.xraylith.wisc.edu/~khan/software/stl/STL.newbie.html}
-
-@node exceptions, namespaces, Standard Template Library, User Problems
-@section Problems and limitations with exceptions
-
-Recent g++ versions provide limited support for exceptions. You must
-provide the @code{-fhandle-exceptions} flag to enable exception
-handling. As of version 2.7.2, exceptions may not work properly
-(and you may get odd error messages when compiling) if you turn
-on optimization (the @code{-O} flag).
-
-You must give the @code{-frtti} switch to enable catching
-of derived exception objects with handlers for the base exception class;
-if @code{-frtti} is not given, only exact type matching works.
-
-For exception handling to work with 2.7.0 your CPU must be a SPARC,
-RS6000/PowerPC, 386/486/Pentium, or ARM. Release 2.7.1 added support
-for the Alpha, and ``m68k is rumored to work on some platforms''
-and ``VAX may also work'' (according to Mike Stump).
-@emph{It still doesn't work on HP-PA or MIPS platforms.}
-
-@node namespaces, agreement with standards, exceptions, User Problems
-@section Does g++ support namespaces?
-
-As of version 2.7.2, g++ recognizes the keywords @code{namespace} and
-@code{using}, and there is some rudimentary code present, but almost
-nothing connected with namespaces works yet. It appears that this will
-still be true when 2.8.0 is released.
-
-@node agreement with standards, compiling standard libraries, namespaces, User Problems
-@section What are the differences between g++ and the ARM specification of C++?
-
-@cindex ARM [Annotated C++ Ref Manual]
-@cindex exceptions
-As of version 2.7.0, g++ has exception support on most but not all
-platforms
-(no support on MIPS-based platforms yet), but
-it doesn't work right if optimizaton is enabled, which means the
-exception
-implementation is still
-not really ready for production use.
-
-
-@cindex mutable
-Some features that the ANSI/ISO standardization committee has voted in
-that don't appear in the ARM are supported, notably the @code{mutable}
-keyword, in version 2.5.x. 2.6.x adds support for the built-in boolean
-type @code{bool}, with constants @code{true} and @code{false}. The
-beginnings of run-time type identification are present, so there are
-more reserved words: @code{typeid}, @code{static_cast},
-@code{reinterpret_cast}, @code{const_cast}, and @code{dynamic_cast}.
-
-@cindex g++ bugs
-As with any beta-test compiler, there are bugs. You can help improve
-the compiler by submitting detailed bug reports.
-
-One of the weakest areas of g++ other than templates is the resolution
-of overloaded functions and operators in complex cases. The usual
-symptom is that in a case where the ARM says that it is ambiguous which
-function should be chosen, g++ chooses one (often the first one
-declared). This is usually not a problem when porting C++ code from
-other compilers to g++, but shows up as errors when code developed under
-g++ is ported to other compilers. (I believe this is no longer a
-significant problem in 2.7.0).
-
-[A full bug list would be very long indeed, so I won't put one here.
-I may add a list of frequently-reported bugs and "non-bugs" like the
-static class members issue mentioned above].
-
-@node compiling standard libraries, debugging on SVR4 systems, agreement with standards, User Problems
-@section Will g++ compile InterViews? The NIH class library? Rogue Wave?
-
-@cindex NIH class library
-@cindex NIHCL with g++
-The NIH class library uses a non-portable, compiler-dependent hack
-to initialize itself, which makes life difficult for g++ users.
-It will not work without modification, and I don't know what modifications
-are required or whether anyone has done them successfully.
-
-In short, it's not going to happen any time soon (previous FAQs referred
-to patches that a new NIHCL release would hopefully contain, but this
-hasn't happened).
-
-@strong{Note:} I thought I saw an item indicating that someone
-@emph{had} patched NIHCL to work with g++. Any pointers?
-
-@cindex InterViews
-I think that as of version 2.5.6, the standard g++ will compile the
-standard 3.1 InterViews completely successfully.
-Note that you'll need the @code{-fno-for-scope} flag
-if you use gcc-2.7.0; with 2.7.2 you may be able to omit this flag
-but you'll get warnings.
-
-@cindex Rogue Wave
-According to Jason Merrill, gcc-2.7.0 and newer works with Rogue
-Wave's @code{tools.h++} class library, but you may want to grab
-@file{ftp://ftp.cygnus.com/pub/g++/Tools.h++-6.1-patch}. Again,
-you'll need the @code{-fno-for-scope} flag since Rogue Wave hasn't
-fixed their code to comply with the new standard yet.
-
-@node debugging on SVR4 systems, debugging problems on Solaris, compiling standard libraries, User Problems
-@section Debugging on SVR4 systems
-@cindex System VR4, debugging
-
-``How do I get debugging to work on my System V Release 4 system?''
-
-Most systems based on System V Release 4 (except Solaris) encode symbolic
-debugging information in a format known as `DWARF'.
-
-Although the GNU C compiler already knows how to write out symbolic debugging
-information in the DWARF format, the GNU C++ compiler does not yet have this
-feature, nor is it likely to in the immediate future.
-
-Ron Guilmette has done a great deal of work to try to get the GNU C++ compiler
-to produce DWARF format symbolic debugging information (for C++ code)
-but he gave up on the project because of a lack of funding and/or interest
-from the g++ user community. If you have a strong desire to see this project
-completed, contact Ron at <rfg@@netcom.com>.
-
-@cindex stabs
-@cindex --with-stabs
-
-In the meantime, you @emph{can} get g++ debugging under SVR4 systems by
-configuring gcc with the @code{--with-stabs} option. This causes gcc to
-use an alternate debugging format, one more like that used under SunOS4.
-You won't need to do anything special to GDB; it will always understand
-the ``stabs'' format.
-
-@node debugging problems on Solaris, X11 conflicts with libg++, debugging on SVR4 systems, User Problems
-@section debugging problems on Solaris
-
-``I'm on Solaris, and gdb says it doesn't know about some of my local
-symbols. Help!''
-
-This problem was introduced in gcc 2.7.2, I believe; debug symbols for
-locals that aren't declared at the beginning of a block come out in the
-wrong order, and gdb can't find such symbols.
-
-There are several patches floating around to correct this problem. It
-is, however, fixed in gcc-2.7.3, which should be available very shortly
-(it may already be available by the time you read this).
-
-@node X11 conflicts with libg++, assignment to streams, debugging problems on Solaris, User Problems
-@section X11 conflicts with libg++ in definition of String
-@cindex String, conflicts in definition
-
-``X11 and Motif define String, and this conflicts with the String class
-in libg++. How can I use both together?''
-
-One possible method is the following:
-
-@example
-#define String XString
-#include <X11/Intrinsic.h>
-/* include other X11 and Motif headers */
-#undef String
-@end example
-
-and remember to use the correct @code{String} or @code{XString} when
-you declare things later.
-
-@node assignment to streams, ,X11 conflicts with libg++, User Problems
-@section Why can't I assign one stream to another?
-
-[ Thanks to Per Bothner and Jerry Schwarz for this section. ]
-
-Assigning one stream to another seems like a reasonable thing to do, but
-it's a bad idea. Usually, this comes up because people want to assign
-to @code{cout}. This is poor style, especially for libraries, and is
-contrary to good object-oriented design. (Libraries that write directly
-to @code{cout} are less flexible, modular, and object-oriented).
-
-The iostream classes do not allow assigning to arbitrary streams, because
-this can violate typing:
-
-@example
-ifstream foo ("foo");
-istrstream str(...);
-foo = str;
-foo->close (); /* Oops! Not defined for istrstream! */
-@end example
-
-@cindex assignment to cout
-
-The original cfront implementation of iostreams by Jerry Schwarz allows
-you to assign to @code{cin}, @code{cout}, @code{cerr}, and @code{clog},
-but this is not part of the draft standard for iostreams and generally
-isn't considered a good idea, so standard-conforming code shouldn't use
-this technique.
-
-The GNU implementation of iostream did not support assigning to
-@code{cin}, @code{cout}, @code{cerr}, and @code{clog}
-for quite a while, but it now does, for backward
-compatibility with cfront iostream (versions 2.6.1 and later of libg++).
-
-The ANSI/ISO C++ Working Paper does provide ways of changing the
-streambuf associated with a stream. Assignment isn't allowed;
-there is an explicit named member that must be used.
-
-However, it is not wise to do this, and the results are confusing. For
-example: @code{fstream::rdbuf} is supposed to return the @emph{original}
-filebuf, not the one you assigned. (This is not yet implemented in GNU
-iostream.) This must be so because @code{fstream::rdbuf} is defined to
-return a @code{filebuf *}.
-
-@node legalities, index, User Problems, Top
-@chapter What are the rules for shipping code built with g++ and libg++?
-@cindex Shipping rules
-@cindex GPL [GNU Public License]
-
-``Is it is possible to distribute programs for profit that are created
-with g++ and use the g++ libraries?''
-
-I am not a lawyer, and this is not legal advice. In any case, I have
-little interest in telling people how to violate the spirit of the
-GNU licenses without violating the letter. This section tells you
-how to comply with the intention of the GNU licenses as best I understand
-them.
-
-@cindex FSF [Free Software Foundation]
-The FSF has no objection to your making money. Its only interest is that
-source code to their programs, and libraries, and to modified versions of
-their programs and libraries, is always available.
-
-The short answer is that you do not need to release the source to
-your program, but you can't just ship a stripped executable either,
-unless you use only the subset of libg++ that includes the iostreams
-classes (see discussion below) or the new libstdc++ library (available
-in libg++ 2.6.2 and later).
-
-Compiling your code with a GNU compiler does not affect its copyright;
-it is still yours. However, in order to ship code that links in a GNU
-library such as libg++ there are certain rules you must follow. The
-rules are described in the file COPYING.LIB that accompanies gcc
-distributions; it is also included in the libg++ distribution.
-See that file for the exact rules. The agreement is called the
-Library GNU Public License or LGPL. It is much "looser" than the
-GNU Public License, or GPL, that covers must GNU programs.
-
-@cindex libg++, shipping code
-Here's the deal: let's say that you use some version of libg++,
-completely unchanged, in your software, and you want to ship only
-a binary form of your code. You can do this, but there are several
-special requirements. If you want to use libg++ but ship only object
-code for your code, you have to ship source for libg++ (or ensure
-somehow that your customer already has the source for the exact
-version you are using), and ship your application in linkable form.
-You cannot forbid your customer from reverse-engineering or extending
-your program by exploiting its linkable form.
-
-@cindex libg++, modifying
-Furthermore, if you modify libg++ itself, you must provide source
-for your modifications (making a derived class does not count as
-modifying the library -- that is "a work that uses the library").
-
-@cindex special copying conditions for iostreams
-For certain portions of libg++ that implement required parts of the C++
-language (such as iostreams and other standard classes), the FSF has
-loosened the copyright requirement still more by adding the ``special
-exception'' clause, which reads as follows:
-
-@quotation
-As a special exception, if you link this library with files
-compiled with GCC 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.
-@end quotation
-
-If your only use of libg++ uses code with this exception, you may ship
-stripped executables or license your executables under different
-conditions without fear of violating an FSF copyright. It is the intent
-of FSF and Cygnus that, as the other classes required by the ANSI/ISO
-draft standard are developed, these will also be placed under this
-``special exception'' license.
-The code in the new libstdc++ library, intended to implement standard
-classes as defined by ANSI/ISO, is also licensed this way.
-
-To avoid coming under the influence of the LGPL, you can link with
-@file{-liostream} rather than @file{-lg++} (for version 2.6.x and
-earlier), or @file{-lstdc++} now that it is available. In version 2.7.0
-all the standard classes are in @file{-lstdc++}; you can do the link
-step with @code{c++} instead of @code{g++} to search only the
-@file{-lstdc++} library and avoid the LGPL'ed code in @file{-lg++}.
-
-If you wish to discuss legal issues connected with GNU software on the
-net, please use @file{gnu.misc.discuss}, not the technical newsgroups.
-
-@node index, , legalities, Top
-@comment node-name, next, previous, up
-@appendix Concept Index
-
-@printindex cp
-
-@page
-@contents
-@bye
diff --git a/contrib/libg++/libg++/genclass/ChangeLog b/contrib/libg++/libg++/genclass/ChangeLog
deleted file mode 100644
index 0cc12419064b..000000000000
--- a/contrib/libg++/libg++/genclass/ChangeLog
+++ /dev/null
@@ -1,27 +0,0 @@
-Thu Nov 4 11:18:05 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * Makefile.in (install): Use INSTALL_PROGRAM for genclass.
-
-Wed Aug 12 12:52:16 1992 Per Bothner (bothner@cygnus.com)
-
- * genclass.sh: Don't use RCS id as version number. Instead
- use libg++ version number.
- * Makefile.in (genclass): Hackery to extract libg++ version
- number from ../Makefile and insert it into genclass script.
-
-Mon Aug 10 11:38:48 1992 Ian Lance Taylor (ian@dumbest.cygnus.com)
-
- * Makefile.in: always create installation directories.
-
-Thu May 14 15:10:18 1992 Per Bothner (bothner@rtl.cygnus.com)
-
- * genclass.sh: Move comments inside sed script (which is
- not supported by all versions of sed) outside.
- * Makefile.in: Update IDIR->gxx_includedir.
-
-Wed Feb 26 18:04:40 1992 K. Richard Pixley (rich@cygnus.com)
-
- * Makefile.in, configure.in: removed traces of namesubdir,
- -subdirs, $(subdir), $(unsubdir), some rcs triggers. Forced
- copyrights to '92, changed some from Cygnus to FSF.
-
diff --git a/contrib/libg++/libg++/genclass/Makefile.in b/contrib/libg++/libg++/genclass/Makefile.in
deleted file mode 100644
index c6a04f5f4816..000000000000
--- a/contrib/libg++/libg++/genclass/Makefile.in
+++ /dev/null
@@ -1,23 +0,0 @@
-# Makefile for g++ library genclass test
-
-srcdir = .
-
-#### package, host, target, and site dependent Makefile fragments come in here.
-##
-
-genclass: $(srcdir)/genclass.sh
- echo "/^PROTODIR=/c\\" > sedscript
- echo "PROTODIR=$$\{PROTODIR-$(gxx_includedir)/gen\}" >> sedscript
- sed <../Makefile -n -e '/VERSION/s/LIBG++_DIST_VERSION *= *\(.*\)/s|<VERSION>|\1|/p' >> sedscript
- sed -f sedscript < $(srcdir)/genclass.sh > genclass.tmp
- chmod 0755 genclass.tmp
- rm -f sedscript
- mv genclass.tmp genclass
-
-gentest: $(srcdir)/gentest.sh $(srcdir)/expected.out
- $(srcdir)/gentest.sh > my.out 2>&1
- diff $(srcdir)/expected.out my.out
-
-.PHONY: install
-install:
- $(INSTALL_PROGRAM) genclass $(bindir)/genclass
diff --git a/contrib/libg++/libg++/genclass/configure.in b/contrib/libg++/libg++/genclass/configure.in
deleted file mode 100644
index 6e237d716a86..000000000000
--- a/contrib/libg++/libg++/genclass/configure.in
+++ /dev/null
@@ -1,26 +0,0 @@
-# This file is a shell script fragment that supplies the information
-# necessary to tailor a template configure script into the configure
-# script appropriate for this directory. For more information, check
-# any existing configure script.
-
-configdirs=""
-srctrigger=genclass.sh
-srcname="old libg++ template expander"
-
-target_makefile_frag=../target-mkfrag
-package_makefile_frag=Make.pack
-
-# per-host:
-
-# per-target:
-
-
-TOLIBGXX=../
-CLEAN='genclass *.h *.cc my.out'
-ALL=genclass
-
-(. ${srcdir}/../config.shared) >${package_makefile_frag}
-
-# post-target:
-
-rm -f ${package_makefile_frag}
diff --git a/contrib/libg++/libg++/genclass/expected.out b/contrib/libg++/libg++/genclass/expected.out
deleted file mode 100644
index cecc3cd3c1bd..000000000000
--- a/contrib/libg++/libg++/genclass/expected.out
+++ /dev/null
@@ -1,1027 +0,0 @@
----------- genclass -usage ----------
-usage:
- genclass -list [proto ...]
- genclass -catalog [proto ...]
- genclass type1 {ref|val} proto [out_prefix]
- genclass -2 type1 {ref|val} type2 {ref|val} proto [out_prefix]
------------
----------- genclass -version ----------
-genclass: version 2.1
------------
----------- genclass -requires ----------
-
------------
----------- genclass -catalog ----------
-Catalog of genclass class templates
-directories searched:
- /usr/latest/lib/gcc/sun4/1.95.01/g++-include/gen
- /play/hgs/libg++-1.90/gentests
-selecting: all
-classes available:
- AVLMap AVLSet AVec BSTSet Bag CHBag CHMap CHSet DLDeque DLList
- Deque FPQueue FPStack FPlex List MPlex Map OSLBag OSLSet OXPBag
- OXPSet PHPQ PQ Plex Queue RAVLMap RPlex SLBag SLList SLQueue
- SLSet SLStack Set SplayBag SplayMap SplayPQ SplaySet Stack VHBag
- VHMap VHSet VOHSet VQueue VStack Vec XPBag XPDeque XPPQ XPQueue
- XPSet XPStack XPlex defs
-
------------
----------- genclass -list ----------
-AVLMap
-AVLSet
-AVec
-BSTSet
-Bag
-CHBag
-CHMap
-CHSet
-DLDeque
-DLList
-Deque
-FPQueue
-FPStack
-FPlex
-List
-MPlex
-Map
-OSLBag
-OSLSet
-OXPBag
-OXPSet
-PHPQ
-PQ
-Plex
-Queue
-RAVLMap
-RPlex
-SLBag
-SLList
-SLQueue
-SLSet
-SLStack
-Set
-SplayBag
-SplayMap
-SplayPQ
-SplaySet
-Stack
-VHBag
-VHMap
-VHSet
-VOHSet
-VQueue
-VStack
-Vec
-XPBag
-XPDeque
-XPPQ
-XPQueue
-XPSet
-XPStack
-XPlex
-defs
------------
----------- genclass -catalog PQ Set ----------
-Catalog of genclass class templates
-directories searched:
- /usr/latest/lib/gcc/sun4/1.95.01/g++-include/gen
- /play/hgs/libg++-1.90/gentests
-selecting: PQ Set
-classes available:
- AVLSet BSTSet CHSet OSLSet OXPSet PHPQ PQ SLSet Set SplayPQ
- SplaySet VHSet VOHSet XPPQ XPSet
-
------------
----------- genclass -list Map Stack ----------
-AVLMap
-CHMap
-FPStack
-Map
-RAVLMap
-SLStack
-SplayMap
-Stack
-VHMap
-VStack
-XPStack
------------
-Generating: genclass int ref AVLMap
-genclass: the AVLMap class requires the -2 syntax for the 2nd type
-usage:
- genclass -list [proto ...]
- genclass -catalog [proto ...]
- genclass type1 {ref|val} proto [out_prefix]
- genclass -2 type1 {ref|val} type2 {ref|val} proto [out_prefix]
-Generation for int-AVLMap failed
-
-genclass int ref AVLMap fig
-genclass: the AVLMap class requires the -2 syntax for the 2nd type
-usage:
- genclass -list [proto ...]
- genclass -catalog [proto ...]
- genclass type1 {ref|val} proto [out_prefix]
- genclass -2 type1 {ref|val} type2 {ref|val} proto [out_prefix]
-Generation for int-AVLMap failed
-
-Generating: genclass int ref AVLSet
-Checking for badsub
-removing int.AVLSet.h int.AVLSet.cc
-
-genclass int ref AVLSet fig
-Checking for badsub
-removing figAVLSet.h figAVLSet.cc
-
-Generating: genclass int ref AVec
-Checking for badsub
-removing int.AVec.h int.AVec.cc
-
-genclass int ref AVec fig
-Checking for badsub
-removing figAVec.h figAVec.cc
-
-Generating: genclass int ref BSTSet
-Checking for badsub
-removing int.BSTSet.h int.BSTSet.cc
-
-genclass int ref BSTSet fig
-Checking for badsub
-removing figBSTSet.h figBSTSet.cc
-
-Generating: genclass int ref Bag
-Checking for badsub
-removing int.Bag.h int.Bag.cc
-
-genclass int ref Bag fig
-Checking for badsub
-removing figBag.h figBag.cc
-
-Generating: genclass int ref CHBag
-Checking for badsub
-removing int.CHBag.h int.CHBag.cc
-
-genclass int ref CHBag fig
-Checking for badsub
-removing figCHBag.h figCHBag.cc
-
-Generating: genclass int ref CHMap
-genclass: the CHMap class requires the -2 syntax for the 2nd type
-usage:
- genclass -list [proto ...]
- genclass -catalog [proto ...]
- genclass type1 {ref|val} proto [out_prefix]
- genclass -2 type1 {ref|val} type2 {ref|val} proto [out_prefix]
-Generation for int-CHMap failed
-
-genclass int ref CHMap fig
-genclass: the CHMap class requires the -2 syntax for the 2nd type
-usage:
- genclass -list [proto ...]
- genclass -catalog [proto ...]
- genclass type1 {ref|val} proto [out_prefix]
- genclass -2 type1 {ref|val} type2 {ref|val} proto [out_prefix]
-Generation for int-CHMap failed
-
-Generating: genclass int ref CHSet
-Checking for badsub
-removing int.CHSet.h int.CHSet.cc
-
-genclass int ref CHSet fig
-Checking for badsub
-removing figCHSet.h figCHSet.cc
-
-Generating: genclass int ref DLDeque
-Checking for badsub
-removing int.DLDeque.h int.DLDeque.cc
-
-genclass int ref DLDeque fig
-Checking for badsub
-removing figDLDeque.h figDLDeque.cc
-
-Generating: genclass int ref DLList
-Checking for badsub
-removing int.DLList.h int.DLList.cc
-
-genclass int ref DLList fig
-Checking for badsub
-removing figDLList.h figDLList.cc
-
-Generating: genclass int ref Deque
-Checking for badsub
-removing int.Deque.h int.Deque.cc
-
-genclass int ref Deque fig
-Checking for badsub
-removing figDeque.h figDeque.cc
-
-Generating: genclass int ref FPQueue
-Checking for badsub
-removing int.FPQueue.h int.FPQueue.cc
-
-genclass int ref FPQueue fig
-Checking for badsub
-removing figFPQueue.h figFPQueue.cc
-
-Generating: genclass int ref FPStack
-Checking for badsub
-removing int.FPStack.h int.FPStack.cc
-
-genclass int ref FPStack fig
-Checking for badsub
-removing figFPStack.h figFPStack.cc
-
-Generating: genclass int ref FPlex
-Checking for badsub
-removing int.FPlex.h int.FPlex.cc
-
-genclass int ref FPlex fig
-Checking for badsub
-removing figFPlex.h figFPlex.cc
-
-Generating: genclass int ref List
-Checking for badsub
-removing int.List.h int.List.cc
-
-genclass int ref List fig
-Checking for badsub
-removing figList.h figList.cc
-
-Generating: genclass int ref MPlex
-Checking for badsub
-removing int.MPlex.h int.MPlex.cc
-
-genclass int ref MPlex fig
-Checking for badsub
-removing figMPlex.h figMPlex.cc
-
-Generating: genclass int ref Map
-genclass: the Map class requires the -2 syntax for the 2nd type
-usage:
- genclass -list [proto ...]
- genclass -catalog [proto ...]
- genclass type1 {ref|val} proto [out_prefix]
- genclass -2 type1 {ref|val} type2 {ref|val} proto [out_prefix]
-Generation for int-Map failed
-
-genclass int ref Map fig
-genclass: the Map class requires the -2 syntax for the 2nd type
-usage:
- genclass -list [proto ...]
- genclass -catalog [proto ...]
- genclass type1 {ref|val} proto [out_prefix]
- genclass -2 type1 {ref|val} type2 {ref|val} proto [out_prefix]
-Generation for int-Map failed
-
-Generating: genclass int ref OSLBag
-Checking for badsub
-removing int.OSLBag.h int.OSLBag.cc
-
-genclass int ref OSLBag fig
-Checking for badsub
-removing figOSLBag.h figOSLBag.cc
-
-Generating: genclass int ref OSLSet
-Checking for badsub
-removing int.OSLSet.h int.OSLSet.cc
-
-genclass int ref OSLSet fig
-Checking for badsub
-removing figOSLSet.h figOSLSet.cc
-
-Generating: genclass int ref OXPBag
-Checking for badsub
-removing int.OXPBag.h int.OXPBag.cc
-
-genclass int ref OXPBag fig
-Checking for badsub
-removing figOXPBag.h figOXPBag.cc
-
-Generating: genclass int ref OXPSet
-Checking for badsub
-removing int.OXPSet.h int.OXPSet.cc
-
-genclass int ref OXPSet fig
-Checking for badsub
-removing figOXPSet.h figOXPSet.cc
-
-Generating: genclass int ref PHPQ
-Checking for badsub
-removing int.PHPQ.h int.PHPQ.cc
-
-genclass int ref PHPQ fig
-Checking for badsub
-removing figPHPQ.h figPHPQ.cc
-
-Generating: genclass int ref PQ
-Checking for badsub
-removing int.PQ.h int.PQ.cc
-
-genclass int ref PQ fig
-Checking for badsub
-removing figPQ.h figPQ.cc
-
-Generating: genclass int ref Plex
-Checking for badsub
-removing int.Plex.h int.Plex.cc
-
-genclass int ref Plex fig
-Checking for badsub
-removing figPlex.h figPlex.cc
-
-Generating: genclass int ref Queue
-Checking for badsub
-removing int.Queue.h int.Queue.cc
-
-genclass int ref Queue fig
-Checking for badsub
-removing figQueue.h figQueue.cc
-
-Generating: genclass int ref RAVLMap
-genclass: the RAVLMap class requires the -2 syntax for the 2nd type
-usage:
- genclass -list [proto ...]
- genclass -catalog [proto ...]
- genclass type1 {ref|val} proto [out_prefix]
- genclass -2 type1 {ref|val} type2 {ref|val} proto [out_prefix]
-Generation for int-RAVLMap failed
-
-genclass int ref RAVLMap fig
-genclass: the RAVLMap class requires the -2 syntax for the 2nd type
-usage:
- genclass -list [proto ...]
- genclass -catalog [proto ...]
- genclass type1 {ref|val} proto [out_prefix]
- genclass -2 type1 {ref|val} type2 {ref|val} proto [out_prefix]
-Generation for int-RAVLMap failed
-
-Generating: genclass int ref RPlex
-Checking for badsub
-removing int.RPlex.h int.RPlex.cc
-
-genclass int ref RPlex fig
-Checking for badsub
-removing figRPlex.h figRPlex.cc
-
-Generating: genclass int ref SLBag
-Checking for badsub
-removing int.SLBag.h int.SLBag.cc
-
-genclass int ref SLBag fig
-Checking for badsub
-removing figSLBag.h figSLBag.cc
-
-Generating: genclass int ref SLList
-Checking for badsub
-removing int.SLList.h int.SLList.cc
-
-genclass int ref SLList fig
-Checking for badsub
-removing figSLList.h figSLList.cc
-
-Generating: genclass int ref SLQueue
-Checking for badsub
-removing int.SLQueue.h int.SLQueue.cc
-
-genclass int ref SLQueue fig
-Checking for badsub
-removing figSLQueue.h figSLQueue.cc
-
-Generating: genclass int ref SLSet
-Checking for badsub
-removing int.SLSet.h int.SLSet.cc
-
-genclass int ref SLSet fig
-Checking for badsub
-removing figSLSet.h figSLSet.cc
-
-Generating: genclass int ref SLStack
-Checking for badsub
-removing int.SLStack.h int.SLStack.cc
-
-genclass int ref SLStack fig
-Checking for badsub
-removing figSLStack.h figSLStack.cc
-
-Generating: genclass int ref Set
-Checking for badsub
-removing int.Set.h int.Set.cc
-
-genclass int ref Set fig
-Checking for badsub
-removing figSet.h figSet.cc
-
-Generating: genclass int ref SplayBag
-Checking for badsub
-removing int.SplayBag.h int.SplayBag.cc
-
-genclass int ref SplayBag fig
-Checking for badsub
-removing figSplayBag.h figSplayBag.cc
-
-Generating: genclass int ref SplayMap
-genclass: the SplayMap class requires the -2 syntax for the 2nd type
-usage:
- genclass -list [proto ...]
- genclass -catalog [proto ...]
- genclass type1 {ref|val} proto [out_prefix]
- genclass -2 type1 {ref|val} type2 {ref|val} proto [out_prefix]
-Generation for int-SplayMap failed
-
-genclass int ref SplayMap fig
-genclass: the SplayMap class requires the -2 syntax for the 2nd type
-usage:
- genclass -list [proto ...]
- genclass -catalog [proto ...]
- genclass type1 {ref|val} proto [out_prefix]
- genclass -2 type1 {ref|val} type2 {ref|val} proto [out_prefix]
-Generation for int-SplayMap failed
-
-Generating: genclass int ref SplayPQ
-Checking for badsub
-removing int.SplayPQ.h int.SplayPQ.cc
-
-genclass int ref SplayPQ fig
-Checking for badsub
-removing figSplayPQ.h figSplayPQ.cc
-
-Generating: genclass int ref SplaySet
-Checking for badsub
-removing int.SplaySet.h int.SplaySet.cc
-
-genclass int ref SplaySet fig
-Checking for badsub
-removing figSplaySet.h figSplaySet.cc
-
-Generating: genclass int ref Stack
-Checking for badsub
-removing int.Stack.h int.Stack.cc
-
-genclass int ref Stack fig
-Checking for badsub
-removing figStack.h figStack.cc
-
-Generating: genclass int ref VHBag
-Checking for badsub
-removing int.VHBag.h int.VHBag.cc
-
-genclass int ref VHBag fig
-Checking for badsub
-removing figVHBag.h figVHBag.cc
-
-Generating: genclass int ref VHMap
-genclass: the VHMap class requires the -2 syntax for the 2nd type
-usage:
- genclass -list [proto ...]
- genclass -catalog [proto ...]
- genclass type1 {ref|val} proto [out_prefix]
- genclass -2 type1 {ref|val} type2 {ref|val} proto [out_prefix]
-Generation for int-VHMap failed
-
-genclass int ref VHMap fig
-genclass: the VHMap class requires the -2 syntax for the 2nd type
-usage:
- genclass -list [proto ...]
- genclass -catalog [proto ...]
- genclass type1 {ref|val} proto [out_prefix]
- genclass -2 type1 {ref|val} type2 {ref|val} proto [out_prefix]
-Generation for int-VHMap failed
-
-Generating: genclass int ref VHSet
-Checking for badsub
-removing int.VHSet.h int.VHSet.cc
-
-genclass int ref VHSet fig
-Checking for badsub
-removing figVHSet.h figVHSet.cc
-
-Generating: genclass int ref VOHSet
-Checking for badsub
-removing int.VOHSet.h int.VOHSet.cc
-
-genclass int ref VOHSet fig
-Checking for badsub
-removing figVOHSet.h figVOHSet.cc
-
-Generating: genclass int ref VQueue
-Checking for badsub
-removing int.VQueue.h int.VQueue.cc
-
-genclass int ref VQueue fig
-Checking for badsub
-removing figVQueue.h figVQueue.cc
-
-Generating: genclass int ref VStack
-Checking for badsub
-removing int.VStack.h int.VStack.cc
-
-genclass int ref VStack fig
-Checking for badsub
-removing figVStack.h figVStack.cc
-
-Generating: genclass int ref Vec
-Checking for badsub
-removing int.Vec.h int.Vec.cc
-
-genclass int ref Vec fig
-Checking for badsub
-removing figVec.h figVec.cc
-
-Generating: genclass int ref XPBag
-Checking for badsub
-removing int.XPBag.h int.XPBag.cc
-
-genclass int ref XPBag fig
-Checking for badsub
-removing figXPBag.h figXPBag.cc
-
-Generating: genclass int ref XPDeque
-Checking for badsub
-removing int.XPDeque.h int.XPDeque.cc
-
-genclass int ref XPDeque fig
-Checking for badsub
-removing figXPDeque.h figXPDeque.cc
-
-Generating: genclass int ref XPPQ
-Checking for badsub
-removing int.XPPQ.h int.XPPQ.cc
-
-genclass int ref XPPQ fig
-Checking for badsub
-removing figXPPQ.h figXPPQ.cc
-
-Generating: genclass int ref XPQueue
-Checking for badsub
-removing int.XPQueue.h int.XPQueue.cc
-
-genclass int ref XPQueue fig
-Checking for badsub
-removing figXPQueue.h figXPQueue.cc
-
-Generating: genclass int ref XPSet
-Checking for badsub
-removing int.XPSet.h int.XPSet.cc
-
-genclass int ref XPSet fig
-Checking for badsub
-removing figXPSet.h figXPSet.cc
-
-Generating: genclass int ref XPStack
-Checking for badsub
-removing int.XPStack.h int.XPStack.cc
-
-genclass int ref XPStack fig
-Checking for badsub
-removing figXPStack.h figXPStack.cc
-
-Generating: genclass int ref XPlex
-Checking for badsub
-removing int.XPlex.h int.XPlex.cc
-
-genclass int ref XPlex fig
-Checking for badsub
-removing figXPlex.h figXPlex.cc
-
-Generating: genclass int ref defs
-genclass: warning, class has a .h but no .cc file
-Checking for badsub
-egrep: int.defs.cc: No such file or directory
-removing int.defs.h int.defs.cc
-rm: int.defs.cc: No such file or directory
-
-genclass int ref defs fig
-genclass: warning, class has a .h but no .cc file
-Checking for badsub
-egrep: figdefs.cc: No such file or directory
-removing figdefs.h figdefs.cc
-rm: figdefs.cc: No such file or directory
-
-Generating: genclass -2 int ref char val AVLMap
-Checking for badsub
-removing int.char.AVLMap.h int.char.AVLMap.cc
-
-Generating: genclass -2 int ref char val AVLMap fig
-Checking for badsub
-removing figAVLMap.h figAVLMap.cc
-
-Generating: genclass -2 int ref char val AVLSet
-Checking for badsub
-removing int.char.AVLSet.h int.char.AVLSet.cc
-
-Generating: genclass -2 int ref char val AVLSet fig
-Checking for badsub
-removing figAVLSet.h figAVLSet.cc
-
-Generating: genclass -2 int ref char val AVec
-Checking for badsub
-removing int.char.AVec.h int.char.AVec.cc
-
-Generating: genclass -2 int ref char val AVec fig
-Checking for badsub
-removing figAVec.h figAVec.cc
-
-Generating: genclass -2 int ref char val BSTSet
-Checking for badsub
-removing int.char.BSTSet.h int.char.BSTSet.cc
-
-Generating: genclass -2 int ref char val BSTSet fig
-Checking for badsub
-removing figBSTSet.h figBSTSet.cc
-
-Generating: genclass -2 int ref char val Bag
-Checking for badsub
-removing int.char.Bag.h int.char.Bag.cc
-
-Generating: genclass -2 int ref char val Bag fig
-Checking for badsub
-removing figBag.h figBag.cc
-
-Generating: genclass -2 int ref char val CHBag
-Checking for badsub
-removing int.char.CHBag.h int.char.CHBag.cc
-
-Generating: genclass -2 int ref char val CHBag fig
-Checking for badsub
-removing figCHBag.h figCHBag.cc
-
-Generating: genclass -2 int ref char val CHMap
-Checking for badsub
-removing int.char.CHMap.h int.char.CHMap.cc
-
-Generating: genclass -2 int ref char val CHMap fig
-Checking for badsub
-removing figCHMap.h figCHMap.cc
-
-Generating: genclass -2 int ref char val CHSet
-Checking for badsub
-removing int.char.CHSet.h int.char.CHSet.cc
-
-Generating: genclass -2 int ref char val CHSet fig
-Checking for badsub
-removing figCHSet.h figCHSet.cc
-
-Generating: genclass -2 int ref char val DLDeque
-Checking for badsub
-removing int.char.DLDeque.h int.char.DLDeque.cc
-
-Generating: genclass -2 int ref char val DLDeque fig
-Checking for badsub
-removing figDLDeque.h figDLDeque.cc
-
-Generating: genclass -2 int ref char val DLList
-Checking for badsub
-removing int.char.DLList.h int.char.DLList.cc
-
-Generating: genclass -2 int ref char val DLList fig
-Checking for badsub
-removing figDLList.h figDLList.cc
-
-Generating: genclass -2 int ref char val Deque
-Checking for badsub
-removing int.char.Deque.h int.char.Deque.cc
-
-Generating: genclass -2 int ref char val Deque fig
-Checking for badsub
-removing figDeque.h figDeque.cc
-
-Generating: genclass -2 int ref char val FPQueue
-Checking for badsub
-removing int.char.FPQueue.h int.char.FPQueue.cc
-
-Generating: genclass -2 int ref char val FPQueue fig
-Checking for badsub
-removing figFPQueue.h figFPQueue.cc
-
-Generating: genclass -2 int ref char val FPStack
-Checking for badsub
-removing int.char.FPStack.h int.char.FPStack.cc
-
-Generating: genclass -2 int ref char val FPStack fig
-Checking for badsub
-removing figFPStack.h figFPStack.cc
-
-Generating: genclass -2 int ref char val FPlex
-Checking for badsub
-removing int.char.FPlex.h int.char.FPlex.cc
-
-Generating: genclass -2 int ref char val FPlex fig
-Checking for badsub
-removing figFPlex.h figFPlex.cc
-
-Generating: genclass -2 int ref char val List
-Checking for badsub
-removing int.char.List.h int.char.List.cc
-
-Generating: genclass -2 int ref char val List fig
-Checking for badsub
-removing figList.h figList.cc
-
-Generating: genclass -2 int ref char val MPlex
-Checking for badsub
-removing int.char.MPlex.h int.char.MPlex.cc
-
-Generating: genclass -2 int ref char val MPlex fig
-Checking for badsub
-removing figMPlex.h figMPlex.cc
-
-Generating: genclass -2 int ref char val Map
-Checking for badsub
-removing int.char.Map.h int.char.Map.cc
-
-Generating: genclass -2 int ref char val Map fig
-Checking for badsub
-removing figMap.h figMap.cc
-
-Generating: genclass -2 int ref char val OSLBag
-Checking for badsub
-removing int.char.OSLBag.h int.char.OSLBag.cc
-
-Generating: genclass -2 int ref char val OSLBag fig
-Checking for badsub
-removing figOSLBag.h figOSLBag.cc
-
-Generating: genclass -2 int ref char val OSLSet
-Checking for badsub
-removing int.char.OSLSet.h int.char.OSLSet.cc
-
-Generating: genclass -2 int ref char val OSLSet fig
-Checking for badsub
-removing figOSLSet.h figOSLSet.cc
-
-Generating: genclass -2 int ref char val OXPBag
-Checking for badsub
-removing int.char.OXPBag.h int.char.OXPBag.cc
-
-Generating: genclass -2 int ref char val OXPBag fig
-Checking for badsub
-removing figOXPBag.h figOXPBag.cc
-
-Generating: genclass -2 int ref char val OXPSet
-Checking for badsub
-removing int.char.OXPSet.h int.char.OXPSet.cc
-
-Generating: genclass -2 int ref char val OXPSet fig
-Checking for badsub
-removing figOXPSet.h figOXPSet.cc
-
-Generating: genclass -2 int ref char val PHPQ
-Checking for badsub
-removing int.char.PHPQ.h int.char.PHPQ.cc
-
-Generating: genclass -2 int ref char val PHPQ fig
-Checking for badsub
-removing figPHPQ.h figPHPQ.cc
-
-Generating: genclass -2 int ref char val PQ
-Checking for badsub
-removing int.char.PQ.h int.char.PQ.cc
-
-Generating: genclass -2 int ref char val PQ fig
-Checking for badsub
-removing figPQ.h figPQ.cc
-
-Generating: genclass -2 int ref char val Plex
-Checking for badsub
-removing int.char.Plex.h int.char.Plex.cc
-
-Generating: genclass -2 int ref char val Plex fig
-Checking for badsub
-removing figPlex.h figPlex.cc
-
-Generating: genclass -2 int ref char val Queue
-Checking for badsub
-removing int.char.Queue.h int.char.Queue.cc
-
-Generating: genclass -2 int ref char val Queue fig
-Checking for badsub
-removing figQueue.h figQueue.cc
-
-Generating: genclass -2 int ref char val RAVLMap
-Checking for badsub
-removing int.char.RAVLMap.h int.char.RAVLMap.cc
-
-Generating: genclass -2 int ref char val RAVLMap fig
-Checking for badsub
-removing figRAVLMap.h figRAVLMap.cc
-
-Generating: genclass -2 int ref char val RPlex
-Checking for badsub
-removing int.char.RPlex.h int.char.RPlex.cc
-
-Generating: genclass -2 int ref char val RPlex fig
-Checking for badsub
-removing figRPlex.h figRPlex.cc
-
-Generating: genclass -2 int ref char val SLBag
-Checking for badsub
-removing int.char.SLBag.h int.char.SLBag.cc
-
-Generating: genclass -2 int ref char val SLBag fig
-Checking for badsub
-removing figSLBag.h figSLBag.cc
-
-Generating: genclass -2 int ref char val SLList
-Checking for badsub
-removing int.char.SLList.h int.char.SLList.cc
-
-Generating: genclass -2 int ref char val SLList fig
-Checking for badsub
-removing figSLList.h figSLList.cc
-
-Generating: genclass -2 int ref char val SLQueue
-Checking for badsub
-removing int.char.SLQueue.h int.char.SLQueue.cc
-
-Generating: genclass -2 int ref char val SLQueue fig
-Checking for badsub
-removing figSLQueue.h figSLQueue.cc
-
-Generating: genclass -2 int ref char val SLSet
-Checking for badsub
-removing int.char.SLSet.h int.char.SLSet.cc
-
-Generating: genclass -2 int ref char val SLSet fig
-Checking for badsub
-removing figSLSet.h figSLSet.cc
-
-Generating: genclass -2 int ref char val SLStack
-Checking for badsub
-removing int.char.SLStack.h int.char.SLStack.cc
-
-Generating: genclass -2 int ref char val SLStack fig
-Checking for badsub
-removing figSLStack.h figSLStack.cc
-
-Generating: genclass -2 int ref char val Set
-Checking for badsub
-removing int.char.Set.h int.char.Set.cc
-
-Generating: genclass -2 int ref char val Set fig
-Checking for badsub
-removing figSet.h figSet.cc
-
-Generating: genclass -2 int ref char val SplayBag
-Checking for badsub
-removing int.char.SplayBag.h int.char.SplayBag.cc
-
-Generating: genclass -2 int ref char val SplayBag fig
-Checking for badsub
-removing figSplayBag.h figSplayBag.cc
-
-Generating: genclass -2 int ref char val SplayMap
-Checking for badsub
-removing int.char.SplayMap.h int.char.SplayMap.cc
-
-Generating: genclass -2 int ref char val SplayMap fig
-Checking for badsub
-removing figSplayMap.h figSplayMap.cc
-
-Generating: genclass -2 int ref char val SplayPQ
-Checking for badsub
-removing int.char.SplayPQ.h int.char.SplayPQ.cc
-
-Generating: genclass -2 int ref char val SplayPQ fig
-Checking for badsub
-removing figSplayPQ.h figSplayPQ.cc
-
-Generating: genclass -2 int ref char val SplaySet
-Checking for badsub
-removing int.char.SplaySet.h int.char.SplaySet.cc
-
-Generating: genclass -2 int ref char val SplaySet fig
-Checking for badsub
-removing figSplaySet.h figSplaySet.cc
-
-Generating: genclass -2 int ref char val Stack
-Checking for badsub
-removing int.char.Stack.h int.char.Stack.cc
-
-Generating: genclass -2 int ref char val Stack fig
-Checking for badsub
-removing figStack.h figStack.cc
-
-Generating: genclass -2 int ref char val VHBag
-Checking for badsub
-removing int.char.VHBag.h int.char.VHBag.cc
-
-Generating: genclass -2 int ref char val VHBag fig
-Checking for badsub
-removing figVHBag.h figVHBag.cc
-
-Generating: genclass -2 int ref char val VHMap
-Checking for badsub
-removing int.char.VHMap.h int.char.VHMap.cc
-
-Generating: genclass -2 int ref char val VHMap fig
-Checking for badsub
-removing figVHMap.h figVHMap.cc
-
-Generating: genclass -2 int ref char val VHSet
-Checking for badsub
-removing int.char.VHSet.h int.char.VHSet.cc
-
-Generating: genclass -2 int ref char val VHSet fig
-Checking for badsub
-removing figVHSet.h figVHSet.cc
-
-Generating: genclass -2 int ref char val VOHSet
-Checking for badsub
-removing int.char.VOHSet.h int.char.VOHSet.cc
-
-Generating: genclass -2 int ref char val VOHSet fig
-Checking for badsub
-removing figVOHSet.h figVOHSet.cc
-
-Generating: genclass -2 int ref char val VQueue
-Checking for badsub
-removing int.char.VQueue.h int.char.VQueue.cc
-
-Generating: genclass -2 int ref char val VQueue fig
-Checking for badsub
-removing figVQueue.h figVQueue.cc
-
-Generating: genclass -2 int ref char val VStack
-Checking for badsub
-removing int.char.VStack.h int.char.VStack.cc
-
-Generating: genclass -2 int ref char val VStack fig
-Checking for badsub
-removing figVStack.h figVStack.cc
-
-Generating: genclass -2 int ref char val Vec
-Checking for badsub
-removing int.char.Vec.h int.char.Vec.cc
-
-Generating: genclass -2 int ref char val Vec fig
-Checking for badsub
-removing figVec.h figVec.cc
-
-Generating: genclass -2 int ref char val XPBag
-Checking for badsub
-removing int.char.XPBag.h int.char.XPBag.cc
-
-Generating: genclass -2 int ref char val XPBag fig
-Checking for badsub
-removing figXPBag.h figXPBag.cc
-
-Generating: genclass -2 int ref char val XPDeque
-Checking for badsub
-removing int.char.XPDeque.h int.char.XPDeque.cc
-
-Generating: genclass -2 int ref char val XPDeque fig
-Checking for badsub
-removing figXPDeque.h figXPDeque.cc
-
-Generating: genclass -2 int ref char val XPPQ
-Checking for badsub
-removing int.char.XPPQ.h int.char.XPPQ.cc
-
-Generating: genclass -2 int ref char val XPPQ fig
-Checking for badsub
-removing figXPPQ.h figXPPQ.cc
-
-Generating: genclass -2 int ref char val XPQueue
-Checking for badsub
-removing int.char.XPQueue.h int.char.XPQueue.cc
-
-Generating: genclass -2 int ref char val XPQueue fig
-Checking for badsub
-removing figXPQueue.h figXPQueue.cc
-
-Generating: genclass -2 int ref char val XPSet
-Checking for badsub
-removing int.char.XPSet.h int.char.XPSet.cc
-
-Generating: genclass -2 int ref char val XPSet fig
-Checking for badsub
-removing figXPSet.h figXPSet.cc
-
-Generating: genclass -2 int ref char val XPStack
-Checking for badsub
-removing int.char.XPStack.h int.char.XPStack.cc
-
-Generating: genclass -2 int ref char val XPStack fig
-Checking for badsub
-removing figXPStack.h figXPStack.cc
-
-Generating: genclass -2 int ref char val XPlex
-Checking for badsub
-removing int.char.XPlex.h int.char.XPlex.cc
-
-Generating: genclass -2 int ref char val XPlex fig
-Checking for badsub
-removing figXPlex.h figXPlex.cc
-
-Generating: genclass -2 int ref char val defs
-genclass: warning, class has a .h but no .cc file
-Checking for badsub
-egrep: int.char.defs.cc: No such file or directory
-removing int.char.defs.h int.char.defs.cc
-rm: int.char.defs.cc: No such file or directory
-
-Generating: genclass -2 int ref char val defs fig
-genclass: warning, class has a .h but no .cc file
-Checking for badsub
-egrep: figdefs.cc: No such file or directory
-removing figdefs.h figdefs.cc
-rm: figdefs.cc: No such file or directory
-
diff --git a/contrib/libg++/libg++/genclass/genclass.sh b/contrib/libg++/libg++/genclass/genclass.sh
deleted file mode 100755
index 08d510754ad2..000000000000
--- a/contrib/libg++/libg++/genclass/genclass.sh
+++ /dev/null
@@ -1,452 +0,0 @@
-#!/bin/sh
-
-# Copyright (C) 1989 Free Software Foundation, Inc.
-#
-# genclass program enhanced by Wendell C. Baker
-# (original by Doug Lea (dl@rocky.oswego.edu))
-
-#This file is part of GNU libg++.
-
-#GNU libg++ 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 1, or (at your option)
-#any later version.
-
-#GNU libg++ is distributed in the hope that it will be useful,
-#but WITHOUT ANY WARRANTY; without even the implied warranty of
-#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-#GNU General Public License for more details.
-
-#You should have received a copy of the GNU General Public License
-#along with GNU libg++; see the file COPYING. If not, write to
-#the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
-
-
-#
-# genclass -list [proto ...]
-# genclass -catalog [proto ...]
-# genclass type1 {ref|val} proto [out_prefix]
-# genclass -2 type1 {ref|val} type2 {ref, val} proto [out_prefix]
-#
-# Generate classes from prototypes
-#
-name=genclass ;
-usage="
- $name -list [proto ...]
- $name -catalog [proto ...]
- $name type1 {ref|val} proto [out_prefix]
- $name -2 type1 {ref|val} type2 {ref|val} proto [out_prefix]" ;
-
-case "$1" in
--usage)
- #
- # -usage
- #
- echo "usage: $usage" 1>&2 ;
- exit 0;
- ;;
--version)
- #
- # -version
- #
- # <VERSION> is substituted by the build process.
- # We currently use the libg++ version number (extracted from ../Makefile).
- echo "$name: version <VERSION>" ;
- exit 0;
- ;;
--requires)
- #
- # -requires
- #
- # The following line should contain any nonstandard programs
- # which must be in the users's path (i.e. not referenced by a
- # fullpath);it allows one to check a script for dependencies
- # without exhaustively testing its usages.
- # ... in this case genclass depends on nothing else.
- echo ;
- exit 0;
- ;;
-esac ;
-
-# pull it in from the environment
-[ "$TRACE" = "" ] || set -xv
-
-# Search in standard g++ prototype directory and in the current directory
-# NOTE: this variable is edited by the install process
-PROTODIR=/projects/gnu-cygnus/gnu-cygnus-2/mips/lib/g++-include/gen
-
-pwd=`pwd`
-
-case "$1" in
--catalog*|-list*)
- #
- # genclass -catalog [proto ...]
- # genclass -list [proto ...]
- #
- option="$1" ;
- shift ;
-
- case $# in
- 0)
- #
- # -catalog
- # -list
- #
- select=all ;
- select_pattern=p ;
- ;;
- *)
- #
- # -catalog proto ...
- # -list proto ...
- #
- select="$@" ;
- select_pattern= ;
- for i in $@ ; do
- select_pattern="\
-$select_pattern
-/.*$i\$/ p
-" ;
- done ;
-
- ;;
- esac ;
-
- #
- # select_pattern is now a (possibly-vacuous) newline-
- # separated list of patterns of the form:
- #
- # /.*Proto1$/ p
- # /.*Proto2$/ p
- # /.*Proto3$/ p
- #
- # or select_pattern is simply ``p'' to select everything
-
- # Hmmm... not all systems have a fmt program; should we
- # just go ahead and use ``nroff -Tcrt | cat -s'' here?
- fmt='nroff -Tcrt | cat -s'
- #fmt=fmt ;
-
- case "$option" in
- -catalog*)
- #
- # -catalog [proto ...]
- #
- echo "\
-Catalog of ${name} class templates
-directories searched:
- $PROTODIR
- $pwd
-selecting: $select
-classes available:" ;
- ;;
- -list*)
- #
- # -list [proto ...]
- #
- # no need to do anything (the list is coming out next)
- ;;
- esac ;
-
-# The sed script does the following:
-# - If it does not end in a .ccP or .hP then
-# it's not a template and we are not intereseted.
-# - Get rid of pathname components [s;.*/;;]
-# - Just take the template names
-# - change quoting conventions and select off what we want to see
-# -if it did not pass the patterns, kill it
-
- ls $pwd $PROTODIR | sed -e '
-/\.ccP$/ !{
- /\.hP$/ !{
- d
- }
-}
-s;.*/;;
-s/\.ccP$//
-s/\.hP$//
-' -e "$select_pattern
-d
-" | sort -u | case "$option" in
- -catalog*)
- # The library catalog information preceded the list
- # format the list, and tab in in a bit to make it readable.
- # Re-evaluate $fmt because it might contain a shell command
- eval $fmt | sed -e 's/.*/ &/' ;
- ;;
- -list*)
- # nothing special, just let the sorted list dribble out
- # we must use cat to receive (and reproduce) the incoming list
- cat ;
- ;;
- esac ;
- exit 0;
- ;;
--2)
- #
- # genclass -2 type1 {ref|val} type2 {ref|val} proto [out_prefix]
- #
- N=2 ;
-
- case $# in
- 6) # genclass -2 type1 {ref|val} type2 {ref|val} proto
- ;;
- 7) # genclass -2 type1 {ref|val} type2 {ref|val} proto out_prefix
- ;;
- *)
- echo "usage: $usage" 1>&2 ;
- exit 1;
- esac ;
- shift ;
- ;;
-*)
- #
- # genclass type1 {ref|val} proto [out_prefix]
- #
- N=1 ;
-
- case $# in
- 3) # genclass type1 {ref|val} proto
- ;;
- 4) # genclass type1 {ref|val} proto out_prefix
- ;;
- *)
- echo "usage: $usage" 1>&2 ;
- exit 1;
- esac ;
- ;;
-esac
-
-#
-# Args are now (the point being the leading ``-2'' is gone)
-#
-# type1 {ref|val} proto [out_prefix]
-# type1 {ref|val} type2 {ref|val} proto [out_prefix]
-#
-
-#
-# Quote all of the $1 $2 etc references to guard against
-# dynamic syntax errors due to vacuous arguments (i.e. '')
-# as sometimes occurs when genclass is used from a Makefile
-#
-
-T1="$1";
-T1NAME="$T1." ;
-T1SEDNAME="$T1" ;
-
-case "$2" in
-ref)
- T1ACC="\&" ;
- ;;
-val)
- T1ACC=" " ;
- ;;
-*)
- echo "${name}: Must specify type1 access as ref or val" 1>&2 ;
- echo "usage: $usage" 1>&2 ;
- exit 1;
- ;;
-esac
-
-# N is either 1 or 2
-
-case $N in
-1)
- #
- # type1 {ref|val} proto [out_prefix]
- #
- class="$3" ;
-
- T2="" ;
- T2ACC="" ;
- ;;
-2)
- #
- # type1 {ref|val} type2 {ref|val} proto [out_prefix]
- #
- class="$5" ;
-
- T2="$3";
- T2NAME="$T2." ;
- T2SEDNAME="$T2" ;
-
- case "$4" in
- ref)
- T2ACC="\&" ;
- ;;
- val)
- T2ACC=" " ;
- ;;
- *)
- echo "${name}: Must specify type2 access: ref or val" 1>&2 ;
- echo "usage: $usage" 1>&2 ;
- exit 1;;
- esac;
- ;;
-esac
-
-defaultprefix="$T1NAME$T2NAME" ;
-
-case $# in
-3) # type1 {ref|val} proto
- replaceprefix="N" ;
- prefix="$defaultprefix" ;
- ;;
-5) # type1 {ref|val} type2 {ref|val} proto
- replaceprefix="N" ;
- prefix="$defaultprefix" ;
- ;;
-4) # type1 {ref|val} proto out_prefix
- prefix="$4" ;
- replaceprefix="Y" ;
- ;;
-6) # type1 {ref|val} type2 {ref|val} proto out_prefix
- prefix="$6" ;
- replaceprefix="Y" ;
- ;;
-*)
- echo "${name}: too many arguments" 1>&2 ;
- echo "usage: $usage" 1>&2 ;
- exit 1;
- ;;
-esac ;
-
-src_h=$class.hP
-src_cc=$class.ccP
-out_h=$prefix$class.h;
-out_cc=$prefix$class.cc ;
-
-#
-# Note #1: The .h and .cc parts are done separately
-# in case only a .h exists for the prototype
-#
-# Note #2: Bind the .h and .cc parts to the fullpath
-# directories at the same time to ensure consistency.
-#
-
-if [ -f $pwd/$src_h ] ; then
- fullsrc_h=$pwd/$src_h ;
- fullsrc_cc=$pwd/$src_cc ;
-elif [ -f $PROTODIR/$src_h ] ; then
- fullsrc_h=$PROTODIR/$src_h ;
- fullsrc_cc=$PROTODIR/$src_cc ;
-else
- echo "${name}: there is no prototype for class $class - file $src_h" 1>&2 ;
- $0 -list ;
- exit 1;
-fi
-
-CASES="$N$replaceprefix" ;
-# CASES is one of { 2Y 2N 1Y 1N }
-
-#
-# WATCHOUT - we have no way of checking whether or not
-# the proper case type is being used with the prototype.
-#
-# For example, we have no way of ensuring that any of
-# Map variants are specified with the -2 argument set
-# Further, we have no way of ensuring that -2 is not
-# used with the prototypes which require only one.
-#
-# The second problem is not serious because it still
-# results in correctly-generated C++ code; the first
-# problem is serious because it results in C++ code that
-# still has ``<C>'' and ``<C&>'' syntax inside it. Such
-# code of course will not compile.
-#
-# SO THE BEST WE CAN DO - is check for the presence of
-# <C> and <C&> AFTER the thing has been generated.
-#
-
-case $CASES in
-2Y) # Two output substitutions, change the prefix
- sed < $fullsrc_h > $out_h -e "
-s/<T>/$T1/g
-s/<T&>/$T1$T1ACC/g
-s/<C>/$T2/g
-s/<C&>/$T2$T2ACC/g
-s/$T1SEDNAME\.$T2SEDNAME\./$prefix/g
-s/$T1SEDNAME\./$prefix/g
-s/$T2SEDNAME\./$prefix/g
-" ;
- ;;
-2N) # Two output substitutions, use the default prefix
- sed < $fullsrc_h > $out_h -e "
-s/<T>/$T1/g
-s/<T&>/$T1$T1ACC/g
-s/<C>/$T2/g
-s/<C&>/$T2$T2ACC/g
-" ;
- ;;
-1Y) # One output substitution, change the prefix
- sed < $fullsrc_h > $out_h -e "
-s/<T>/$T1/g
-s/<T&>/$T1$T1ACC/g
-s/$T1SEDNAME\./$prefix/g
-" ;
- ;;
-1N) # One output substitution, use the default prefix
- sed < $fullsrc_h > $out_h -e "
-s/<T>/$T1/g
-s/<T&>/$T1$T1ACC/g
-" ;
- ;;
-esac
-
-if egrep '<C&?>' $out_h > /dev/null ; then
- echo "${name}: the $class class requires the -2 syntax for the 2nd type" 1>&2 ;
- echo "usage: $usage" 1>&2 ;
- # the user does not get to see the mistakes (he might try to compile it)
- rm $out_h ;
- exit 1;
-fi ;
-
-if [ ! -f $fullsrc_cc ] ; then
- echo "${name}: warning, class has a .h but no .cc file" 1>&2 ;
- exit 0;
-fi
-
-case $CASES in
-2Y) # Two output substitutions, change the prefix
- sed < $fullsrc_cc > $out_cc -e "
-s/<T>/$T1/g
-s/<T&>/$T1$T1ACC/g
-s/<C>/$T2/g
-s/<C&>/$T2$T2ACC/g
-s/$T1SEDNAME\.$T2SEDNAME\./$prefix/g
-s/$T1SEDNAME\./$prefix/g
-s/$T2SEDNAME\./$prefix/g
-"
- ;;
-2N) # Two output substitutions, use the default prefix
- sed < $fullsrc_cc > $out_cc -e "
-s/<T>/$T1/g
-s/<T&>/$T1$T1ACC/g
-s/<C>/$T2/g
-s/<C&>/$T2$T2ACC/g
-"
- ;;
-1Y) # One output substitution, change the prefix
- sed < $fullsrc_cc > $out_cc -e "
-s/<T>/$T1/g
-s/<T&>/$T1$T1ACC/g
-s/$T1SEDNAME\./$prefix/g
-"
- ;;
-1N) # One output substitution, use the default prefix
- sed < $fullsrc_cc > $out_cc -e "
-s/<T>/$T1/g
-s/<T&>/$T1$T1ACC/g
-"
- ;;
-esac
-
-if egrep '<C&?>' $out_h $out_cc > /dev/null ; then
- echo "${name}: the $class class requires the -2 syntax for the 2nd type" 1>&2 ;
- echo "usage: $usage" 1>&2 ;
- # the user does not get to see the mistakes (he might try to compile it)
- rm $out_h $out_cc ;
- exit 1;
-fi ;
-
-exit 0;
diff --git a/contrib/libg++/libg++/genclass/gentest.sh b/contrib/libg++/libg++/genclass/gentest.sh
deleted file mode 100755
index f3e23482f84e..000000000000
--- a/contrib/libg++/libg++/genclass/gentest.sh
+++ /dev/null
@@ -1,174 +0,0 @@
-#!/bin/sh
-
-# Copyright (C) 1989 Free Software Foundation, Inc.
-#
-# genclass test program by Wendell C. Baker
-
-#This file is part of GNU libg++.
-
-#GNU libg++ 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 1, or (at your option)
-#any later version.
-
-#GNU libg++ is distributed in the hope that it will be useful,
-#but WITHOUT ANY WARRANTY; without even the implied warranty of
-#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-#GNU General Public License for more details.
-
-#You should have received a copy of the GNU General Public License
-#along with GNU libg++; see the file COPYING. If not, write to
-#the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
-
-#
-# test.sh
-#
-name=gentest.sh
-usage="$name" ;
-genclass=
-
-case "$1" in
--usage)
- #
- # -usage
- #
- echo "usage: $usage" 1>&2 ;
- exit 0;
- ;;
--version)
- #
- # -version
- #
- version="`expr '$Revision: 1.3 $' : '.*Revision: \(.*\) .*'`" ;
- echo "$name: version $version" ;
- exit 0;
- ;;
--requires)
- #
- # -requires
- #
- echo genclass ;
- exit 0;
- ;;
--genclass)
- #
- shift; genclass=$1
- ;;
-esac ;
-
-# pull it in from the environment
-[ "$TRACE" = "" ] || set -xv
-
-if [ "${genclass}" = "" ]
-then
- genclass="./genclass"
-fi
-
-for arg in -usage -version -requires -catalog -list ; do
- echo "---------- genclass $arg ----------"
- ${genclass} $arg
- echo "-----------"
-done ;
-
-arg="-catalog PQ Set"
-echo "---------- genclass $arg ----------"
-${genclass} $arg
-echo "-----------"
-
-arg="-list Map Stack"
-echo "---------- genclass $arg ----------"
-${genclass} $arg
-echo "-----------"
-
-std1=int ;
-std2=char ;
-
-#
-# Do all of them with the single-type syntax
-# The Map-based classes are expected to fail (good)
-#
-for proto in `${genclass} -list` ; do
- file_h=$std1.$proto.h
- file_cc=$std1.$proto.cc
- files="$file_h $file_cc" ;
- echo "Generating: genclass $std1 ref $proto"
- ${genclass} $std1 ref $proto
- if [ $? != 0 ] ; then
- echo "Generation for $std1-$proto failed"
- else
- echo "Checking for badsub"
- egrep '<[TC]&?>' $files
- echo "removing $files"
- rm $files
- fi ;
- echo ""
-
- nonstd1=fig
- file_h=$nonstd1$proto.h
- file_cc=$nonstd1$proto.cc
- files="$file_h $file_cc" ;
- echo "genclass $std1 ref $proto $nonstd1"
- ${genclass} $std1 ref $proto $nonstd1
- if [ $? != 0 ] ; then
- echo "Generation for $std1-$proto failed"
- else
- echo "Checking for badsub"
- egrep '<[TC]?>' $files
- echo "removing $files"
- rm $files
- fi ;
- echo ""
-
-done ;
-
-#
-# Do them all again with the -2 syntax
-# None are expected to fail because there is no
-# way to tell something that requires the single-type syntax
-#
-for proto in `${genclass} -list` ; do
- file1_h=$std1.$proto.h
- file1_cc=$std1.$proto.cc
- files1="$file1_h $file1_cc";
- file2_h=$std1.$std2.$proto.h
- file2_cc=$std1.$std2.$proto.cc
- files2="$file2_h $file2_cc" ;
- files="$file1_h $file1_cc $file2_h $file2_cc" ;
- echo "Generating: genclass -2 $std1 ref $std2 val $proto"
- ${genclass} -2 $std1 ref $std2 val $proto
- if [ $? != 0 ] ; then
- echo "Generation for $std1-$std2-$proto failed"
- else
- echo "Checking for badsub"
- if [ -f $file1_h ] ; then
- # then $file1_cc is expected to exist
- egrep '<[TC]&?>' $files1
- echo "removing $files1"
- rm $files1
- else
- # then [ -f $file2_h ]
- # and $file2_cc is expected to exist
- egrep '<[TC]&?>' $files2
- echo "removing $files2"
- rm $files2
- fi ;
- fi ;
- echo ""
-
- nonstd=fig
- file_h=$nonstd$proto.h
- file_cc=$nonstd$proto.cc
- files="$file_h $file_cc" ;
- echo "Generating: genclass -2 $std1 ref $std2 val $proto $nonstd"
- ${genclass} -2 $std1 ref $std2 val $proto $nonstd
- if [ $? != 0 ] ; then
- echo "Generation for $std1-$std2-$proto failed"
- else
- echo "Checking for badsub"
- egrep '<[TC]&?>' $files
- echo "removing $files"
- rm $files
- fi ;
- echo ""
-
-done ;
diff --git a/contrib/libg++/libg++/libg++.texi b/contrib/libg++/libg++/libg++.texi
deleted file mode 100644
index 4153a7a2e2f4..000000000000
--- a/contrib/libg++/libg++/libg++.texi
+++ /dev/null
@@ -1,4803 +0,0 @@
-\input texinfo @c -*-texinfo-*-
-
-@settitle User's Guide to the GNU C++ Class Library
-@setfilename libg++.info
-
-@ifinfo
-@format
-START-INFO-DIR-ENTRY
-* Libg++: (libg++). The g++ class library.
-END-INFO-DIR-ENTRY
-@end format
-@end ifinfo
-
-@ifinfo
-This file documents the features and implementation of The GNU C++ library
-
-Copyright (C) 1988, 1991, 1992 Free Software Foundation, Inc.
-
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-
-@ignore
-Permission is granted to process this file through @TeX{} and print the
-results, provided the printed document carries copying permission
-notice identical to this one except for the removal of this paragraph
-(this paragraph not being relevant to the printed manual).
-
-@end ignore
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided also that the
-section entitled ``GNU Library General Public License'' is included exactly as
-in the original, and provided that the entire resulting derived work is
-distributed under the terms of a permission notice identical to this one.
-
-Permission is granted to copy and distribute translations of this manual
-into another language, under the above conditions for modified versions,
-except that the section entitled ``GNU Library General Public License'' and
-this permission notice may be included in translations approved by the
-Free Software Foundation instead of in the original English.
-@end ifinfo
-
-@iftex
-@finalout
-@c @smallbook
-@c @cropmarks
-@end iftex
-
-@setchapternewpage odd
-
-@titlepage
-@title User's Guide
-@title to the GNU C++ Library
-@sp 3
-@subtitle last updated April 29, 1992
-@subtitle for version 2.0
-@author Doug Lea (dl@@g.oswego.edu)
-@page
-@vskip 0pt plus 1filll
-Copyright @copyright{} 1988, 1991, 1992 Free Software Foundation, Inc.
-
-
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided also that the
-section entitled ``GNU Library General Public License'' is included exactly as
-in the original, and provided that the entire resulting derived work is
-distributed under the terms of a permission notice identical to this one.
-
-Permission is granted to copy and distribute translations of this manual
-into another language, under the above conditions for modified versions,
-except that the section entitled ``GNU Library General Public License'' may be
-included in a translation approved by the author instead of in the original
-English.
-
-@strong{Note: The GNU C++ library is still in test release. You will
-be performing a valuable service if you report any bugs you encounter.}
-
-@end titlepage
-
-@ifinfo
-@node Top, Copying, , (DIR)
-
-Introduction
-************
-
-This manual documents how to install and use the GNU C++ library.
-
-@end ifinfo
-@menu
-* Copying:: GNU Library Public License says how you can copy
- and share the GNU C++ library.
-* Contributors:: People who have contributed to GNU C++ library.
-* Installation:: How to configure, compile and install GNU C++ library
-* Trouble:: If you have trouble installing GNU C++ library.
-* General:: Aims, objectives, and limitations of the GNU C++ library
-* Conventions:: Stylistic conventions
-* OK:: Support for representation invariants
-* Proto:: Introduction to container class prototypes
-* Pix:: Pseudo-indexes
-* Representations:: How variable-sized objects are represented
-* Expressions:: Some guidance on programming expression-oriented classes
-* Headers:: Header files and other support for interfacing C++ to C
-* Builtin:: Utility functions for builtin types
-* New:: Library dynamic allocation primitives
-* IOStream:(iostream)Top.
- The input/output library (istreams and ostreams).
-* Stream:: obsolete I/O library
-* Obstack:: Obstacks and their uses.
-* AllocRing:: A place to store objects for a while
-* String:: String, SubString, and Regex classes.
-* Integer:: Multiple precision Integer class.
-* Rational:: Multiple precision Rational class
-* Complex:: Complex number class
-* Fix:: Fixed point proportion classes
-* Bit:: BitSet and BitString classes
-* Random:: Random number generators
-* Data:: SampleStatistic and related classes for data collection
-* Curses:: CursesWindow class
-* List:: Lisp-like List prototype
-* LinkList:: Singly and doubly linked list class prototypes
-* Vector:: Vector prototypes
-* Plex:: Plex (adjustable array) prototypes
-* Stack:: Stack prototypes
-* Queue:: Queue prototypes
-* Deque:: Double ended queue prototypes
-* PQ:: Heap (priority queue) class prototypes
-* Set:: Set class prototypes
-* Bag:: Bag class prototypes
-* Map:: Map (Associative array) prototypes
-* GetOpt:: C++ class-based version of the GNU/UNIX getopt function
-* Projects:: Things Still Left to do
-@end menu
-
-@node Copying, Contributors, Top, Top
-@include lgpl.texinfo
-
-@node Contributors, Installation, Copying, Top
-@unnumbered Contributors to GNU C++ library
-
-Aside from Michael Tiemann, who worked out the front end for GNU C++, and
-Richard Stallman, who worked out the back end, the following people (not
-including those who have made their contributions to GNU CC) should not go
-unmentioned.
-
-@itemize @bullet
-@item
-Doug Lea contributed most otherwise unattributed classes.
-
-@item
-Per Bothner contributed the iostream I/O classes.
-
-@item
-Dirk Grunwald contributed the Random number generation classes,
-and PairingHeaps.
-
-@item
-Kurt Baudendistel contributed Fixed precision reals.
-
-@item
-Doug Schmidt contributed ordered hash tables, a perfect
-hash function generator, and several other utilities.
-
-@item
-Marc Shapiro contributed the ideas and preliminary code for Plexes.
-
-@item
-Eric Newton contributed the curses window classes.
-
-@item
-Some of the I/O code is derived from BSD 4.4,
-and was developed by the University of California, Berkeley.
-
-@item
-The code for converting accurately between floating point numbers
-and their string representations was written by David M. Gay of AT&T.
-@end itemize
-
-@node Installation, Trouble, Contributors, Top
-@chapter Installing GNU C++ library
-
-
-@enumerate
-@item
-Read through the README file and the Makefile. Make sure that all
-paths, system-dependent compile switches, and program names are correct.
-
-@item
-Check that files @file{values.h}, @file{stdio.h},
-and @file{math.h} declare and define values appropriate for your
-system.
-
-@item
-Type @samp{make all} to compile the library, test, and install.
-Current details about contents of the tests and utilities are in the
-@file{README} file.
-
-@end enumerate
-
-@node Trouble, General, Installation, Top
-@chapter Trouble in Installation
-
-Here are some of the things that have caused trouble for people installing
-GNU C++ library.
-
-@enumerate
-@item
-Make sure that your GNU C++ version number is at least as high as your
-libg++ version number. For example, libg++ 1.22.0 requires g++ 1.22.0 or
-later releases.
-
-@item
-Double-check system constants in the header files mentioned above.
-
-@end enumerate
-
-@node General, Conventions, Trouble, Top
-@chapter GNU C++ library aims, objectives, and limitations
-
-The GNU C++ library, libg++ is an attempt to provide a variety of C++
-programming tools and other support to GNU C++ programmers.
-
-Differences in distribution policy are only part of the difference
-between libg++.a and AT&T libC.a. libg++ is not intended to be an
-exact clone of libC. For one, libg++ contains bits of code that depend
-on special features of GNU g++ that are either different or lacking in
-the AT&T version, including slightly different inlining and overloading
-strategies, dynamic local arrays, etc. All of these
-differences are minor. For example, while the AT&T and GNU stream
-classes are implemented in very different ways, the vast majority of
-C++ programs compile and run under either version with no visible
-difference. Additionally, all g++-specific constructs are conditionally
-compiled; The library is designed to be compatible with any 2.0 C++
-compiler.
-
-libg++ has also contained workarounds for some limitations in g++: both
-g++ and libg++ are still undergoing rapid development and testing---a
-task that is helped tremendously by the feedback of active users. This
-manual is also still under development; it has some catching up to do
-to include all the facilities now in the library.
-
-libg++ is not the only freely available source of C++ class libraries.
-Some notable alternative sources are Interviews and NIHCL.
-(InterViews has been available on the X-windows X11 tapes and also
-from interviews.stanford.edu. NIHCL is available by anonymous
-ftp from GNU archives (such as the pub directory of prep.ai.mit.edu),
-although it is not supported by the FSF - and needs some work
-before it will work with g++.)
-
-As every C++ programmer knows, the design (moreso than the
-implementation) of a C++ class library is something of a challenge.
-Part of the reason is that C++ supports two, partially incompatible,
-styles of object-oriented programming -- The "forest" approach,
-involving a collection of free-standing classes that can be mixed and
-matched, versus the completely hierarchical (smalltalk style)
-approach, in which all classes are derived from a common ancestor. Of
-course, both styles have advantages and disadvantages. So far, libg++
-has adopted the "forest" approach. Keith Gorlen's OOPS library adopts
-the hierarchical approach, and may be an attractive alternative for C++
-programmers who prefer this style.
-
-Currently (and/or in the near future) libg++ provides support for a
-few basic kinds of classes:
-
-The first kind of support provides an interface between C++ programs and
-C libraries. This includes basic header files (like @file{stdio.h}) as
-well as things like the File and stream classes. Other classes that
-interface to other aspects of C libraries (like those that maintain
-environmental information) are in various stages of development; all
-will undergo implementation modifications when the forthcoming GNU libc
-library is released.
-
-The second kind of support contains general-purpose basic classes that
-transparently manage variable-sized objects on the freestore. This
-includes Obstacks, multiple-precision Integers and Rationals,
-arbitrary length Strings, BitSets, and BitStrings.
-
-Third, several classes and utilities of common interest (e.g.,
-Complex numbers) are provided.
-
-Fourth, a set of pseudo-generic prototype files are available
-as a mechanism for generating common container classes. These
-are described in more detail in the introduction to container
-prototypes. Currently, only a textual substitution
-mechanism is available for generic class creation.
-
-@node Conventions, OK, General, Top
-@chapter GNU C++ library stylistic conventions
-
-@itemize @bullet
-
-@item
-C++ source files have file extension @file{.cc}. Both C-compatibility
-header files and class declaration files have extension @file{.h}.
-
-@item
-C++ class names begin with capital letters, except for @code{istream}
-and @code{ostream}, for AT&T C++ compatibility. Multi-word class
-names capitalize each word, with no underscore separation.
-
-@item
-Include files that define C++ classes begin with capital letters
-(as do the names of the classes themselves). @file{stream.h} is
-uncapitalized for AT&T C++ compatibility.
-
-@item
-Include files that supply function prototypes for other C
-functions (system calls and libraries) are all lower case.
-
-@item
-All include files define a preprocessor variable _X_h, where X
-is the name of the file, and conditionally compile only if this
-has not been already defined. The @code{#pragma once} facility
-is also used to avoid re-inclusion.
-
-@item
-Structures and objects that must be publicly defined,
-but are not intended for public use have names beginning
-with an underscore. (for example, the @code{_Srep} struct, which
-is used only by the String and SubString classes.)
-
-@item
-The underscore is used to separate components of long function
-names, @*e.g., @code{set_File_exception_handler()}.
-
-@item
-When a function could be usefully defined either as a
-member or a friend, it is generally a member if it modifies
-and/or returns itself, else it is a friend. There are cases
-where naturalness of expression wins out over this rule.
-
-@item
-Class declaration files are formatted so that it is easy
-to quickly check them to determine function names, parameters,
-and so on. Because of the different kinds of things that may
-appear in class declarations, there is no perfect way to do
-this. Any suggestions on developing a common class
-declaration formatting style are welcome.
-
-@item
-All classes use the same simple error (exception) handling strategy.
-Almost every class has a member function named @code{error(char* msg)}
-that invokes an associated error handler function via a pointer to that
-function, so that the error handling function may be reset by
-programmers. By default nearly all call @code{*lib_error_handler}, which
-prints the message and then aborts execution. This system is subject
-to change. In general, errors are assumed to be non-recoverable:
-Library classes do not include code that allows graceful continuation
-after exceptions.
-
-@end itemize
-
-@node OK, Proto, Conventions, Top
-@chapter Support for representation invariants
-
-Most GNU C++ library classes possess a method named @code{OK()},
-that is useful in helping to verify correct performance of class
-operations.
-
-The @code{OK()} operations checks the ``representation invariant'' of a
-class object. This is a test to check whether the object is in a valid
-state. In effect, it is a (sometimes partial) verification of the
-library's promise that (1) class operations always leave objects in
-valid states, and (2) the class protects itself so that client functions
-cannot corrupt this state.
-
-While no simple validation technique can assure that all operations
-perform correctly, calls to @code{OK()} can at least verify that
-operations do not corrupt representations. For example for @code{String
-a, b, c; ... a = b + c;}, a call to @code{a.OK();} will guarantee that
-@code{a} is a valid @code{String}, but does not guarantee that it
-contains the concatenation of @code{b + c}. However, given that @code{a}
-is known to be valid, it is possible to further verify its properties,
-for example via @code{a.after(b) == c && a.before(c) == b}. In other
-words, @code{OK()} generally checks only those internal representation
-properties that are otherwise inaccessible to users of the class. Other
-class operations are often useful for further validation.
-
-Failed calls to @code{OK()} call a class's @code{error} method if
-one exists, else directly call @code{abort}. Failure indicates
-an implementation error that should be reported.
-
-With only rare exceptions, the internal support functions for a class
-never themselves call @code{OK()} (although many of the test files
-in the distribution call @code{OK()} extensively).
-
-Verification of representational invariants can sometimes be
-very time consuming for complicated data structures.
-
-
-@node Proto, Representations, OK, Top
-@chapter Introduction to container class prototypes
-
-As a temporary mechanism enabling the support of generic classes, the GNU
-C++ Library distribution contains a directory (@file{g++-include}) of files
-designed to serve as the basis for generating container classes of
-specified elements. These files can be used to generate @file{.h} and
-@file{.cc} files in the current directory via a supplied shell script
-program that performs simple textual substitution to create specific
-classes.
-
-While these classes are generated independently, and thus share no code,
-it is possible to create versions that do share code among subclasses. For
-example, using @code{typedef void* ent}, and then generating a
-@code{entList} class, other derived classes could be created using the
-@code{void*} coercion method described in Stroustrup, pp204-210.
-
-This very simple class-generation facility is useful enough to serve
-current purposes, but will be replaced with a more coherent mechanism for
-handling C++ generics in a way that minimally disrupts current usage.
-Without knowing exactly when or how parametric classes might be
-added to the C++ language, provision of this simplest possible
-mechanism, textual substitution, appears to be the safest strategy,
-although it does require certain redundancies and awkward constructions.
-
-Specific classes may be generated via the @file{genclass} shell script
-program. This program has arguments specifying the kinds of base types(s)
-to be used. Specifying base types requires two arguments. The first is the
-name of the base type, which may be any named type, like @code{int} or
-@code{String}. Only named types are supported; things like @code{int*} are
-not accepted. However, pointers like this may be used by supplying the
-appropriate typedefs (e.g., editing the resulting files to include
-@code{typedef int* intp;}). The type name must be followed by one of the
-words @code{val} or @code{ref}, to indicate whether the base elements
-should be passed to functions by-value or by-reference.
-
-You can specify basic container classes using @code{genclass base
-[val,ref] proto}, where @code{proto} is the name of the class being
-generated. Container classes like dictionaries and maps that require
-two types may be specified via @code{genclass -2 keytype [val, ref],
-basetype [val, ref] proto}, where the key type is specified first and
-the contents type second. The resulting classnames and filenames are
-generated by prepending the specified type names to the prototype names,
-and separating the filename parts with dots. For example,
-@code{genclass int val List} generates class @code{intList} residing in
-files @file{int.List.h} and @file{int.List.cc}. @code{genclass -2 String
-ref int val VHMap} generates (the awkward, but unavoidable) class name
-@code{StringintVHMap}. Of course, programmers may use @code{typedef} or
-simple editing to create more appropriate names. The existence of dot
-seperators in file names allows the use of GNU make to help automate
-configuration and recompilation. An example Makefile exploiting such
-capabilities may be found in the @file{libg++/proto-kit} directory.
-
-The @code{genclass} utility operates via simple text substitution using
-@code{sed}. All occurrences of the pseudo-types @code{<T>} and @code{<C>}
-(if there are two types) are replaced with the indicated type, and
-occurrences of @code{<T&>} and @code{<C&>} are replaced by just the types,
-if @code{val} is specified, or types followed by ``&'' if @code{ref} is
-specified.
-
-Programmers will frequently need to edit the @file{.h} file in order to
-insert additional @code{#include} directives or other modifications. A
-simple utility, @file{prepend-header} to prepend other @file{.h} files
-to generated files is provided in the distribution.
-
-One dubious virtue of the prototyping mechanism is that, because sources files,
-not archived library classes, are generated, it is relatively simple for
-programmers to modify container classes in the common case where slight
-variations of standard container classes are required.
-
-It is often a good idea for programmers to archive (via @code{ar})
-generated classes into @file{.a} files so that only those class
-functions actually used in a given application will be loaded.
-The test subdirectory of the distribution shows an example of this.
-
-Because of @code{#pragma interface} directives, the @file{.cc} files
-should be compiled with @code{-O} or @code{-DUSE_LIBGXX_INLINES}
-enabled.
-
-Many container classes require specifications over and above the base
-class type. For example, classes that maintain some kind of ordering of
-elements require specification of a comparison function upon which to
-base the ordering. This is accomplished via a prototype file
-@file{defs.hP} that contains macros for these functions. While these
-macros default to perform reasonable actions, they can and should be
-changed in particular cases. Most prototypes require only one or a few
-of these. No harm is done if unused macros are defined to perform
-nonsensical actions. The macros are:
-
-@table @code
-
-@item DEFAULT_INITIAL_CAPACITY
-The initial capacity for containers (e.g., hash tables) that require
-an initial capacity argument for constructors.
-Default: 100
-
-@item <T>EQ(a, b)
-return true if a is considered equal to b for the purposes of
-locating, etc., an element in a container.
-Default: (a == b)
-
-@item <T>LE(a, b)
-return true if a is less than or equal to b
-Default: (a <= b)
-
-@item <T>CMP(a, b)
-return an integer < 0 if a<b, 0 if a==b, or > 0 if a>b.
-Default: (a <= b)? (a==b)? 0 : -1 : 1
-
-@item <T>HASH(a)
-return an unsigned integer representing the hash of a.
-Default: hash(a) ; where extern unsigned int hash(<T&>).
-(note: several useful hash functions are declared in builtin.h
-and defined in hash.cc)
-
-@end table
-
-Nearly all prototypes container classes support container
-traversal via @code{Pix} pseudo indices, as described elsewhere.
-
-All object containers must perform either a @code{X::X(X&)} (or
-@code{X::X()} followed by @code{X::operator =(X&)}) to copy objects into
-containers. (The latter form is used for containers built from C++
-arrays, like @code{VHSets}). When containers are destroyed, they invoke
-@code{X::~X()}. Any objects used in containers must have well behaved
-constructors and destructors. If you want to create containers that
-merely reference (point to) objects that reside elsewhere, and are not
-copied or destroyed inside the container, you must use containers
-of pointers, not containers of objects.
-
-All prototypes are designed to generate @emph{HOMOGENOUS} container
-classes. There is no universally applicable method in C++ to support
-heterogenous object collections with elements of various subclasses of
-some specified base class. The only way to get heterogenous structures
-is to use collections of pointers-to-objects, not collections of objects
-(which also requires you to take responsibility for managing storage for
-the objects pointed to yourself).
-
-For example, the following usage illustrates a commonly encountered
-danger in trying to use container classes for heterogenous structures:
-
-@smallexample
-class Base @{ int x; ...@}
-class Derived : public Base @{ int y; ... @}
-
-BaseVHSet s; // class BaseVHSet generated via something like
- // `genclass Base ref VHSet'
-
-void f()
-@{
- Base b;
- s.add(b); // OK
-
- Derived d;
- s.add(d); // (CHOP!)
-@}
-@end smallexample
-
-At the line flagged with @samp{(CHOP!)}, a @code{Base::Base(Base&)} is
-called inside @code{Set::add(Base&)}---@emph{not}
-@code{Derived::Derived(Derived&)}. Actually, in @code{VHSet}, a
-@code{Base::operator =(Base&)}, is used instead to place the element in
-an array slot, but with the same effect. So only the Base part is
-copied as a @code{VHSet} element (a so-called chopped-copy). In this
-case, it has an @code{x} part, but no @code{y} part; and a Base, not
-Derived, vtable. Objects formed via chopped copies are rarely
-sensible.@refill
-
-To avoid this, you must resort to pointers:
-
-@smallexample
-typedef Base* BasePtr;
-
-BasePtrVHSet s; // class BaseVHSet generated via something like
- // `genclass BasePtr val VHSet'
-
-void f()
-@{
- Base* bp = new Base;
- s.add(b);
-
- Base* dp = new Derived;
- s.add(d); // works fine.
-
- // Don't forget to delete bp and dp sometime.
- // The VHSet won't do this for you.
-@}
-@end smallexample
-
-@section Example
-
-The prototypes can be difficult to use on first attempt. Here is an
-example that may be helpful. The utilities in the @file{proto-kit}
-simplify much of the actions described, but are not used here.
-
-Suppose you create a class @code{Person}, and want to make an Map that
-links the social security numbers associated with each person. You start
-off with a file @file{Person.h}
-
-@example
-
-#include <String.h>
-
-class Person
-@{
- String nm;
- String addr;
- //...
-public:
- const String& name() @{ return nm; @}
- const String& address() @{ return addr; @}
- void print() @{ ... @}
- //...
-@}
-
-@end example
-
-And in file @file{SSN.h},
-
-@example
-typedef unsigned int SSN;
-@end example
-
-Your first decision is what storage/usage strategy to use. There are
-several reasonable alternatives here: You might create an ``object
-collection'' of Persons, a ``pointer collection'' of
-pointers-to-Persons, or even a simple String map, housing either copies
-of pointers to the names of Persons, since other fields are unused for
-purposes of the Map. In an object collection, instances of class Person
-``live'' inside the Map, while in a pointer collection, the instances
-live elsewhere. Also, as above, if instances of subclasses of Person are
-to be used inside the Map, you must use pointers. In a String Map, the
-same difference holds, but now only for the name fields. Any of these
-choices might make sense in particular applications.
-
-The second choice is the Map implementation strategy. Either a tree
-or a hash table might make sense. Suppose you want an AVL tree Map.
-There are two things to now check. First, as an object collection,
-the AVLMap requires that the elsement class contain an @code{X(X&)}
-constructor. In C++, if you don't specify such a constructor, one
-is constructed for you, but it is a very good idea to always do this
-yourself, to avoid surprises. In this example, you'd use something like
-@example
-class Person
-@{ ...;
- Person(const Person& p) :nm(p.nm), addr(p.addr) @{@}
-@};
-@end example
-
-Also, an AVLMap requires a comparison function for elements in order
-to maintain order. Rather than requiring you to write a particular
-comparison function, a @file{defs} file is consulted to determine how to
-compare items. You must create and edit such a file.
-
-Before creating @file{Person.defs.h}, you must first make one additional
-decision. Should the Map member functions like @code{m.contains(p)}
-take arguments (@code{p}) by reference (i.e., typed as
-@code{int Map::contains(const Person& p)} or by value (i.e., typed as
-@code{int Map::contains(const Person p)}. Generally, for user-defined
-classes, you want to pass by reference, and for builtins and pointers,
-to pass by value. SO you should pick by-reference.
-
-You can now create @file{Person.defs.h} via @code{genclass Person ref defs}.
-This creates a simple skeleton that you must edit. First, add
-@code{#include "Person.h"} to the top. Second, edit the @code{<T>CMP(a,b)}
-macro to compare on name, via
-
-@example
-#define <T>CMP(a, b) ( compare(a.name(), b.name()) )
-@end example
-
-@noindent
-which invokes the @code{int compare(const String&, const String&)}
-function from @file{String.h}. Of course, you could define this in any
-other way as well. In fact, the default versions in the skeleton turn
-out to be OK (albeit inefficient) in this particular example.
-
-You may also want to create file @file{SSN.defs.h}. Here, choosing
-call-by-value makes sense, and since no other capabilities (like
-comparison functions) of the SSNs are used (and the defaults are OK
-anyway), you'd type
-
-@example
-genclass SSN val defs
-@end example
-
-@noindent
-and then edit to place @code{#include "SSN.h"} at the top.
-
-Finally, you can generate the classes. First, generate the base
-class for Maps via
-
-@example
-genclass -2 Person ref SSN val Map
-@end example
-
-@noindent
-This generates only the abstract class, not the implementation, in file
-@file{Person.SSN.Map.h} and @file{Person.SSN.Map.cc}. To create the
-AVL implementation, type
-
-@example
-genclass -2 Person ref SSN val AVLMap
-@end example
-
-@noindent
-This creates the class @code{PersonSSNAVLMap}, in
-@file{Person.SSN.AVLMap.h} and @file{Person.SSN.AVLMap.cc}.
-
-To use the AVL implementation, compile the two generated @file{.cc} files, and
-specify @samp{#include "Person.SSN.AVLMap.h"} in the application program.
-All other files are included in the right ways automatically.
-
-One last consideration, peculiar to Maps, is to pick a reasonable
-default contents when declaring an AVLMap. Zero might be appropriate
-here, so you might declare a Map,
-
-@example
-PersonSSNAVLMap m((SSN)0);
-@end example
-
-Suppose you wanted a @code{VHMap} instead of an @code{AVLMap} Besides
-generating different implementations, there are two differences in
-how you should prepare the @file{defs} file. First, because a VHMap
-uses a C++ array internally, and because C++ array slots are initialized
-differently than single elements, you must ensure that class Person
-contains (1) a no-argument constructor, and (2) an assignment operator.
-You could arrange this via
-
-@smallexample
-class Person
-@{ ...;
- Person() @{@}
- void operator = (const Person& p) @{ nm = p.nm; addr = p.addr; @}
-@};
-@end smallexample
-
-(The lack of action in the constructor is OK here because @code{Strings}
-possess usable no-argument constructors.)
-
-You also need to edit @file{Person.defs.h} to indicate a usable hash
-function and default capacity, via something like
-
-@example
-#include <builtin.h>
-#define <T>HASH(x) (hashpjw(x.name().chars()))
-#define DEFAULT_INITIAL_CAPACITY 1000
-@end example
-
-Since the @code{hashpjw} function from @file{builtin.h} is
-appropriate here. Changing the default capacity to a value
-expected to exceed the actual capacity helps to avoid
-``hidden'' inefficiencies when a new VHMap is created without
-overriding the default, which is all too easy to do.
-
-Otherwise, everything is the same as above, substituting
-@code{VHMap} for @code{AVLMap}.
-
-@node Representations, Expressions, Proto, Top
-@chapter Variable-Sized Object Representation
-
-One of the first goals of the GNU C++ library is to enrich the kinds of
-basic classes that may be considered as (nearly) ``built into'' C++. A good
-deal of the inspiration for these efforts is derived from considering
-features of other type-rich languages, particularly Common Lisp and Scheme.
-The general characteristics of most class and friend operators and
-functions supported by these classes has been heavily influenced
-by such languages.
-
-Four of these types, Strings, Integers, BitSets, and BitStrings (as well as
-associated and/or derived classes) require representations suitable for
-managing variable-sized objects on the free-store. The basic technique used
-for all of these is the same, although various details necessarily differ
-from class to class.
-
-The general strategy for representing such objects is to create chunks of
-memory that include both header information (e.g., the size of the object),
-as well as the variable-size data (an array of some sort) at the end
-of the chunk. Generally the maximum size of an object is limited to
-something less than all of addressable memory, as a safeguard. The minimum
-size is also limited so as not to waste allocations expanding very small
-chunks. Internally, chunks are allocated in blocks well-tuned to the
-performance of the @code{new} operator.
-
-Class elements themselves are merely pointers to these chunks.
-Most class operations are performed via inline ``translation''
-functions that perform the required operation on the corresponding
-representation. However, constructors and assignments operate by
-copying entire representations, not just pointers.
-
-
-No attempt is made to control temporary creation in expressions
-and functions involving these classes. Users of previous versions
-of the classes will note the disappearance of both ``Tmp'' classes
-and reference counting. These were dropped because, while they
-did improve performance in some cases, they obscure class
-mechanics, lead programmers into the false belief that they need not
-worry about such things, and occasionally have paradoxical behavior.
-
-
-These variable-sized object classes are integrated as well as possible
-into C++. Most such classes possess converters that allow automatic
-coercion both from and to builtin basic types. (e.g., char* to and from
-String, long int to and from Integer, etc.). There are pro's and con's
-to circular converters, since they can sometimes lead to the conversion
-from a builtin type through to a class function and back to a builtin
-type without any special attention on the part of the programmer, both
-for better and worse.
-
-Most of these classes also provide special-case operators and functions
-mixing basic with class types, as a way to avoid constructors in cases
-where the operations do not rely on anything special about the
-representations. For example, there is a special case concatenation
-operator for a String concatenated with a char, since building the
-result does not rely on anything about the String header. Again, there
-are arguments both for and against this approach. Supporting these cases
-adds a non-trivial degree of (mainly inline) function proliferation, but
-results in more efficient operations. Efficiency wins out over parsimony
-here, as part of the goal to produce classes that provide sufficient
-functionality and efficiency so that programmers are not tempted to try
-to manipulate or bypass the underlying representations.
-
-@node Expressions, Pix, Representations, Top
-@chapter Some guidelines for using expression-oriented classes
-
-
-The fact that C++ allows operators to be overloaded for user-defined
-classes can make programming with library classes like @code{Integer},
-@code{String}, and so on very convenient. However, it is worth
-becoming familiar with some of the inherent limitations and problems
-associated with such operators.
-
-Many operators are @emph{constructive}, i.e., create a new object
-based on some function of some arguments. Sometimes the creation
-of such objects is wasteful. Most library classes supporting
-expressions contain facilities that help you avoid such waste.
-
-For example, for @code{Integer a, b, c; ...; c = a + b + a;}, the
-plus operator is called to sum a and b, creating a new temporary object
-as its result. This temporary is then added with a, creating another
-temporary, which is finally copied into c, and the temporaries are then
-deleted. In other words, this code might have an effect similar to
-@code{Integer a, b, c; ...; Integer t1(a); t1 += b; Integer t2(t1);
-t2 += a; c = t2;}.
-
-For small objects, simple operators, and/or non-time/space critical
-programs, creation of temporaries is not a big problem. However, often,
-when fine-tuning a program, it may be a good idea to rewrite such
-code in a less pleasant, but more efficient manner.
-
-For builtin types like ints, and floats, C and C++ compilers already
-know how to optimize such expressions to reduce the need for
-temporaries. Unfortunately, this is not true for C++ user defined
-types, for the simple (but very annoying, in this context) reason that
-nothing at all is guaranteed about the semantics of overloaded operators
-and their interrelations. For example, if the above expression just
-involved ints, not Integers, a compiler might internally convert the
-statement into something like @code{ c = a; c += b; c+= a; }, or
-perhaps something even more clever. But since C++ does not know that
-Integer operator += has any relation to Integer operator +, A C++
-compiler cannot do this kind of expression optimization itself.
-
-In many cases, you can avoid construction of temporaries simply by
-using the assignment versions of operators whenever possible, since
-these versions create no temporaries. However, for maximum flexibility,
-most classes provide a set of ``embedded assembly code'' procedures
-that you can use to fully control time, space, and evaluation strategies.
-Most of these procedures are ``three-address'' procedures that take
-two @code{const} source arguments, and a destination argument. The
-procedures perform the appropriate actions, placing the results in
-the destination (which is may involve overwriting old contents). These
-procedures are designed to be fast and robust. In particular, aliasing
-is always handled correctly, so that, for example
-@code{add(x, x, x); } is perfectly OK. (The names of these procedures
-are listed along with the classes.)
-
-For example, suppose you had an Integer expression
-@code{ a = (b - a) * -(d / c); }
-
-This would be compiled as if it were
-@code{ Integer t1=b-a; Integer t2=d/c; Integer t3=-t2; Integer t4=t1*t3; a=t4;}
-
-But, with some manual cleverness, you might yourself some up with
-@code{ sub(a, b, a); mul(a, d, a); div(a, c, a); }
-
-
-A related phenomenon occurs when creating your own constructive
-functions returning instances of such types. Suppose you wanted
-to write function
-@code{Integer f(const Integer& a) @{ Integer r = a; r += a; return r; @}}
-
-This function, when called (as in @code{ a = f(a); }) demonstrates a
-similar kind of wasted copy. The returned value r must be copied
-out of the function before it can be used by the caller. In GNU
-C++, there is an alternative via the use of named return values.
-Named return values allow you to manipulate the returned object
-directly, rather than requiring you to create a local inside
-a function and then copy it out as the returned value. In this
-example, this can be done via
-@code{Integer f(const Integer& a) return r(a) @{ r += a; return; @}}
-
-
-A final guideline: The overloaded operators are very convenient, and
-much clearer to use than procedural code. It is almost always a good
-idea to make it right, @emph{then} make it fast, by translating
-expression code into procedural code after it is known to be correct.
-
-
-
-@node Pix, Headers, Expressions, Top
-@chapter Pseudo-indexes
-
-Many useful classes operate as containers of elements. Techniques for
-accessing these elements from a container differ from class to class.
-In the GNU C++ library, access methods have been partially standardized
-across different classes via the use of pseudo-indexes called
-@code{Pixes}. A @code{Pix} acts in some ways like an index, and in some
-ways like a pointer. (Their underlying representations are just
-@code{void*} pointers). A @code{Pix} is a kind of ``key'' that is
-translated into an element access by the class. In virtually all cases,
-@code{Pixes} are pointers to some kind internal storage cells. The
-containers use these pointers to extract items.
-
-@code{Pixes} support traversal and inspection of elements in a
-collection using analogs of array indexing. However, they are
-pointer-like in that @code{0} is treated as an invalid @code{Pix}, and
-unsafe insofar as programmers can attempt to access nonexistent elements
-via dangling or otherwise invalid @code{Pixes} without first checking
-for their validity.
-
-In general it is a very bad idea to perform traversals in the the midst
-of destructive modifications to containers.
-
-Typical applications might include code using the idiom
-@example
-for (Pix i = a.first(); i != 0; a.next(i)) use(a(i));
-@end example
-for some container @code{a} and function @code{use}.
-
-Classes supporting the use of @code{Pixes} always contain the following
-methods, assuming a container @code{a} of element types of @code{Base}.
-
-@table @code
-
-@item Pix i = a.first()
-Set i to index the first element of a or 0 if a is empty.
-
-@item a.next(i)
-advance i to the next element of a or 0 if there is no next element;
-
-@item Base x = a(i); a(i) = x;
-a(i) returns a reference to the element indexed by i.
-
-@item int present = a.owns(i)
-returns true if Pix i is a valid Pix in a. This is often a
-relatively slow operation, since the collection must usually
-traverse through elements to see if any correspond to the Pix.
-
-@end table
-
-Some container classes also support backwards traversal via
-
-@table @code
-@item Pix i = a.last()
-Set i to the last element of a or 0 if a is empty.
-
-@item a.prev(i)
-sets i to the previous element in a, or 0 if there is none.
-@end table
-
-Collections supporting elements with an equality operation possess
-
-@table @code
-@item Pix j = a.seek(x)
-sets j to the index of the first occurrence of x, or 0 if x is
-not contained in a.
-@end table
-
-Bag classes possess
-
-@table @code
-@item Pix j = a.seek(x, Pix from = 0)
-sets j to the index of the next occurrence of x following i,
-or 0 if x is not contained in a. If i == 0, the first occurrence
-is returned.
-@end table
-
-Set, Bag, and PQ classes possess
-
-@table @code
-@item Pix j = a.add(x) (or a.enq(x) for priority queues)
-add x to the collection, returning its Pix. The Pix of an item
-can change in collections where further additions and deletions
-involve the actual movement of elements (currently in OXPSet,
-OXPBag, XPPQ, VOHSet), but in all other cases, an item's Pix may
-be considered a permanent key to its location.
-@end table
-
-@node Headers, Builtin, Pix, Top
-@chapter Header files for interfacing C++ to C
-
-The following files are provided so that C++ programmers may
-invoke common C library and system calls. The names and contents
-of these files are subject to change in order to be compatible
-with the forthcoming GNU C library. Other files, not listed
-here, are simply C++-compatible interfaces to corresponding C
-library files.
-
-@table @file
-@item values.h
-A collection of constants defining the numbers of bits in builtin
-types, minimum and maximum values, and the like. Most names are
-the same as those found in @file{values.h} found on Sun systems.
-
-@item std.h
-A collection of common system calls and @file{libc.a} functions.
-Only those functions that can be declared without introducing
-new type definitions (socket structures, for example) are
-provided. Common @code{char*} functions (like @code{strcmp}) are among
-the declarations. All functions are declared along with their
-library names, so that they may be safely overloaded.
-
-@item string.h
-This file merely includes @file{<std.h>}, where string function
-prototypes are declared. This is a workaround for the fact that
-system @file{string.h} and @file{strings.h} files often differ
-in contents.
-
-@item osfcn.h
-This file merely includes @file{<std.h>}, where system function
-prototypes are declared.
-
-@item libc.h
-This file merely includes @file{<std.h>}, where C library function
-prototypes are declared.
-
-@item math.h
-A collection of prototypes for functions usually found in
-libm.a, plus some @code{#define}d constants that appear to be
-consistent with those provided in the AT&T version. The value
-of @code{HUGE} should be checked before using. Declarations of
-all common math functions are preceded with @code{overload}
-declarations, since these are commonly overloaded.
-
-@item stdio.h
-Declaration of @code{FILE} (@code{_iobuf}), common macros (like
-@code{getc}), and function prototypes for @file{libc.a}
-functions that operate on @code{FILE*}'s. The value
-@code{BUFSIZ} and the declaration of @code{_iobuf} should be
-checked before using.
-
-@item assert.h
-C++ versions of assert macros.
-
-@item generic.h
-String concatenation macros useful in creating generic classes.
-They are similar in function to the AT&T CC versions.
-
-@item new.h
-Declarations of the default global operator new, the two-argument
-placement version, and associated error handlers.
-@end table
-
-@node Builtin, New, Headers, Top
-@chapter Utility functions for built in types
-
-Files @file{builtin.h} and corresponding @file{.cc} implementation
-files contain various convenient
-inline and non-inline utility functions. These include useful
-enumeration types, such as @code{TRUE}, @code{FALSE} ,the type
-definition for pointers to libg++ error handling functions, and
-the following functions.
-
-@table @code
-@item long abs(long x); double abs(double x);
-inline versions of abs. Note that the standard libc.a version,
-@code{int abs(int)} is @emph{not} declared as inline.
-
-@item void clearbit(long& x, long b);
-clears the b'th bit of x (inline).
-
-@item void setbit(long& x, long b);
-sets the b'th bit of x (inline)
-
-@item int testbit(long x, long b);
-returns the b'th bit of x (inline).
-
-@item int even(long y);
-returns true if x is even (inline).
-
-@item int odd(long y);
-returns true is x is odd (inline).
-
-@item int sign(long x); int sign(double x);
-returns -1, 0, or 1, indicating whether x is less than, equal to, or
-greater than zero (inline).
-
-@item long gcd(long x, long y);
-returns the greatest common divisor of x and y.
-
-@item long lcm(long x, long y);
-returns the least common multiple of x and y.
-
-@item long lg(long x);
-returns the floor of the base 2 log of x.
-
-@item long pow(long x, long y); double pow(double x, long y);
-returns x to the integer power y using via the iterative O(log y)
-``Russian peasant'' method.
-
-@item long sqr(long x); double sqr(double x);
-returns x squared (inline).
-
-@item long sqrt(long y);
-returns the floor of the square root of x.
-
-@item unsigned int hashpjw(const char* s);
-a hash function for null-terminated char* strings using the
-method described in Aho, Sethi, & Ullman, p 436.
-
-@item unsigned int multiplicativehash(int x);
-a hash function for integers that returns the lower bits of
-multiplying x by the golden ratio times pow(2, 32).
-See Knuth, Vol 3, p 508.
-
-@item unsigned int foldhash(double x);
-a hash function for doubles that exclusive-or's the first and
-second words of x, returning the result as an integer.
-
-@item double start_timer()
-Starts a process timer.
-
-@item double return_elapsed_time(double last_time)
-Returns the process time since last_time.
-If last_time == 0 returns the time since the last start_timer.
-Returns -1 if start_timer was not first called.
-
-@end table
-
-File @file{Maxima.h} includes versions of @code{MAX, MIN}
-for builtin types.
-
-File @file{compare.h} includes versions of @code{compare(x, y)}
-for builtin types. These return negative if the first argument
-is less than the second, zero for equal, and positive for greater.
-
-@node New, Stream, Builtin, Top
-@chapter Library dynamic allocation primitives
-
-Libg++ contains versions of @code{malloc, free, realloc} that were
-designed to be well-tuned to C++ applications. The source file
-@file{malloc.c} contains some design and implementation details.
-Here are the major user-visible differences from most system
-malloc routines:
-
-@enumerate
-
-@item
-These routines @emph{overwrite} storage of freed space. This
-means that it is never permissible to use a @code{delete}'d
-object in any way. Doing so will either result in trapped
-fatal errors or random aborts within malloc, free, or realloc.
-
-@item
-The routines tend to perform well when a large number
-of objects of the same size are allocated and freed. You
-may find that it is not worth it to create your
-own special allocation schemes in such cases.
-
-@item
-The library sets top-level @code{operator new()} to call malloc and
-@code{operator delete()} to call free. Of course, you may override these
-definitions in C++ programs by creating your own operators that will
-take precedence over the library versions. However, if you do so, be
-sure to define @emph{both} @code{operator new()} and @code{operator
-delete()}.
-
-@item
-These routines do @emph{not} support the odd convention, maintained by
-some versions of malloc, that you may call @code{realloc} with a pointer
-that has been @code{free}'d.
-
-@item
-The routines automatically perform simple checks on @code{free}'d
-pointers that can often determine whether users have accidentally
-written beyond the boundaries of allocated space, resulting in a fatal
-error.
-
-@item
-The function @code{malloc_usable_size(void* p)} returns the number of
-bytes actually allocated for @code{p}. For a valid pointer (i.e., one
-that has been @code{malloc}'d or @code{realloc}'d but not yet
-@code{free}'d) this will return a number greater than or equal to the
-requested size, else it will normally return 0. Unfortunately, a
-non-zero return can not be an absolutely perfect indication of lack of
-error. If a chunk has been @code{free}'d but then re-allocated for a
-different purpose somewhere elsewhere, then @code{malloc_usable_size}
-will return non-zero. Despite this, the function can be very valuable
-for performing run-time consistency checks.
-
-@item
-@code{malloc} requires 8 bytes of overhead per allocated chunk, plus a
-mmaximum alignment adjustment of 8 bytes. The number of bytes of usable
-space is exactly as requested, rounded to the nearest 8 byte boundary.
-
-@item
-The routines do @emph{not} contain any synchronization support for
-multiprocessing. If you perform global allocation on a shared
-memory multiprocessor, you should disable compilation and use
-of libg++ malloc in the distribution @file{Makefile} and use your
-system version of malloc.
-
-@end enumerate
-
-@iftex
-@node IOStream
-@chapter The new input/output classes
-
-The iostream classes implement most of the features of AT&T
-version 2.0 iostream library classes, and most of the features
-of the ANSI X3J16 library draft (which is based on the AT&T design).
-These classes are available in @code{libg++} for convenience and for
-compatibility with older releases; however, since the iostream classes
-are licensed under less stringent terms than @code{libg++}, they are now
-also available in a separate library called @code{libio}---and
-documented in a separate manual, corresponding to that library.
-
-@xref{Introduction,,Introduction, iostream.info, The GNU C++ Iostream
-Library}.
-@end iftex
-
-@node Stream, Obstack, New, Top
-@chapter The old I/O library
-
-WARNING: This chapter describes classes that are @emph{obsolete}.
-These classes are normally not available when libg++
-is installed normally. The sources are currently included
-in the distribution, and you can configure libg++ to use
-these classes instead of the new iostream classes.
-This is only a temporary measure; you should convert your
-code to use iostreams as soon as possible. The iostream
-classes provide some compatibility support, but it is
-very incomplete (there is no longer a @code{File} class).
-
-@section File-based classes
-
-The @code{File} class supports basic IO on Unix files. Operations are
-based on common C stdio library functions.
-
-@code{File} serves as the base class for istreams, ostreams, and other
-derived classes. It contains the interface between the Unix stdio file
-library and these more structured classes. Most operations are implemented
-as simple calls to stdio functions. @code{File} class operations are also fully
-compatible with raw system file reads and writes (like the system
-@code{read} and @code{lseek} calls) when buffering is disabled (see below).
-The @code{FILE*} stdio file pointer is, however maintained as protected.
-Classes derived from File may only use the IO operations provided by File,
-which encompass essentially all stdio capabilities.
-
-The class contains four general kinds of functions: methods for binding
-@code{File}s to physical Unix files, basic IO methods, file and buffer
-control methods, and methods for maintaining logical and physical file
-status.
-
-
-Binding and related tasks are accomplished via @code{File} constructors and
-destructors, and member functions @code{open, close, remove, filedesc,
-name, setname}.
-
-If a file name is provided in a constructor or open, it is
-maintained as class variable @code{nm} and is accessible
-via @code{name}. If no name is provided, then @code{nm} remains
-null, except that @code{Files} bound to the default files stdin,
-stdout, and stderr are automatically given the names
-@code{(stdin), (stdout), (stderr)} respectively.
-The function @code{setname} may be used to change the
-internal name of the @code{File}. This does not change the name
-of the physical file bound to the File.
-
-The member function @code{close} closes a file. The
-@code{~File} destructor closes a file if it is open, except
-that stdin, stdout, and stderr are flushed but left open for
-the system to close on program exit since some systems may
-require this, and on others it does not matter. @code{remove}
-closes the file, and then deletes it if possible by calling the
-system function to delete the file with the name provided in
-the @code{nm} field.
-
-@section Basic IO
-
-@itemize @bullet
-
-@item
-@code{read} and @code{write} perform binary IO via stdio
-@code{fread} and @code{fwrite}.
-
-@item
-@code{get} and @code{put} for chars invoke stdio @code{getc}
-and @code{putc} macros.
-
-@item
-@code{put(const char* s)} outputs a null-terminated string via
-stdio @code{fputs}.
-
-@item
-@code{unget} and @code{putback} are synonyms. Both call stdio
-@code{ungetc}.
-
-@end itemize
-
-@section File Control
-
-@code{flush}, @code{seek}, @code{tell}, and @code{tell} call the
-corresponding stdio functions.
-
-@code{flush(char)} and @code{fill()} call stdio @code{_flsbuf}
-and @code{_filbuf} respectively.
-
-@code{setbuf} is mainly useful to turn off buffering in cases
-where nonsequential binary IO is being performed. @code{raw} is a
-synonym for @code{setbuf(_IONBF)}. After a @code{f.raw()}, using
-the stdio functions instead of the system @code{read, write},
-etc., calls entails very little overhead. Moreover, these become
-fully compatible with intermixed system calls (e.g.,
-@code{lseek(f.filedesc(), 0, 0)}). While intermixing @code{File}
-and system IO calls is not at all recommended, this technique
-does allow the @code{File} class to be used in conjunction with
-other functions and libraries already set up to operate on file
-descriptors. @code{setbuf} should be called at most once after a
-constructor or open, but before any IO.
-
-@section File Status
-
-File status is maintained in several ways.
-
-A @code{File} may be checked for accessibility via
-@code{is_open()}, which returns true if the File is bound to a
-usable physical file, @code{readable()}, which returns true if
-the File can be read from (opened for reading, and not in a
-_fail state), or @code{writable()}, which returns true if the
-File can be written to.
-
-@code{File} operations return their status via two means: failure and
-success are represented via the logical state. Also, the
-return values of invoked stdio and system functions that
-return useful numeric values (not just failure/success flags)
-are held in a class variable accessible via @code{iocount}.
-(This is useful, for example, in determining the number of
-items actually read by the @code{read} function.)
-
-Like the AT&T i/o-stream classes, but unlike the description in
-the Stroustrup book, p238, @code{rdstate()} returns the bitwise
-OR of @code{_eof}, @code{_fail} and @code{_bad}, not necessarily
-distinct values. The functions @code{eof()}, @code{fail()},
-@code{bad()}, and @code{good()} can be used to test for each of
-these conditions independently.
-
-@code{_fail} becomes set for any input operation that could not
-read in the desired data, and for other failed operations. As
-with all Unix IO, @code{_eof} becomes true only when an input
-operations fails because of an end of file. Therefore,
-@code{_eof} is not immediately true after the last successful
-read of a file, but only after one final read attempt. Thus, for
-input operations, @code{_fail} and @code{_eof} almost always
-become true at the same time. @code{bad} is set for unbound
-files, and may also be set by applications in order to communicate
-input corruption. Conversely, @code{_good} is defined as 0 and
-is returned by @code{rdstate()} if all is well.
-
-The state may be modified via @code{clear(flag)}, which,
-despite its name, sets the corresponding state_value flag.
-@code{clear()} with no arguments resets the state to @code{_good}.
-@code{failif(int cond)} sets the state to @code{_fail} only if
-@code{cond} is true.
-
-Errors occuring during constructors and file opens also invoke the
-function @code{error}. @code{error} in turn calls a resetable error
-handling function pointed to by the non-member global variable
-@code{File_error_handler} only if a system error has been generated.
-Since @code{error} cannot tell if the current system error is actually
-responsible for a failure, it may at times print out spurious messages.
-Three error handlers are provided. The default,
-@code{verbose_File_error_handler} calls the system function
-@code{perror} to print the corresponding error message on standard
-error, and then returns to the caller. @code{quiet_File_error_handler}
-does nothing, and simply returns. @code{fatal_File_error_handler}
-prints the error and then aborts execution. These three handlers, or any
-other user-defined error handlers can be selected via the non-member
-function @code{set_File_error_handler}.
-
-All read and write operations communicate either logical or
-physical failure by setting the @code{_fail} flag. All further
-operations are blocked if the state is in a @code{_fail} or@code{_bad}
-condition. Programmers must explicitly use @code{clear()} to
-reset the state in order to continue IO processing after
-either a logical or physical failure. C programmers who are
-unfamiliar with these conventions should note that, unlike
-the stdio library, @code{File} functions indicate IO success,
-status, or failure solely through the state, not via return values of
-the functions. The @code{void*} operator or @code{rdstate()}
-may be used to test success. In particular, according to c++
-conversion rules, the @code{void*} coercion is automatically
-applied whenever the @code{File&} return value of any @code{File}
-function is tested in an @code{if} or @code{while}. Thus,
-for example, an easy way to copy all of stdin to stdout until
-eof (at which point @code{get} fails) or some error is
-@code{char c; while(cin.get(c) && cout.put(c));}.
-
-@ignore
-@section The istream and ostream classes
-
-Some of these are supported by incorporating additional,
-mainly virtual, functions into streambufs:
-
-@table @code
-
-@item streambuf::open([various args])
-attaches the streambuf to a file, if applicable
-
-@item streambuf::close()
-detaches the streambuf from a file, if applicable.
-
-@item streambuf::sputs(const char* s)
-outputs null-terminated string s in a generally faster way
-than repeated @code{sputcs}.
-
-@item streambuf::sputsn(const char* s, int n)
-outputs the first n characters of s in a generally faster way
-than repeated @code{sputcs}.
-
-@end table
-@end ignore
-
-The current version of istreams and ostreams differs significantly
-from previous versions in order to obtain compatibility with
-AT&T 1.2 streams. Most code using previous versions should still
-work. However, the following features of @code{File} are not
-incorporated in streams (they are still present in @code{File}):
-@code{scan(const char* fmt...), remove(), read(), write(),
-setbuf(), raw()}. Additionally, the feature of previous streams
-that allowed free intermixing of stream and stdio input and output
-is no longer guaranteed to always behave as desired.
-
-@node Obstack, AllocRing, Stream, Top
-@chapter The Obstack class
-
-
-The @code{Obstack} class is a simple rewrite of the C obstack macros and
-functions provided in the GNU CC compiler source distribution.
-
-Obstacks provide a simple method of creating and maintaining a string
-table, optimized for the very frequent task of building strings
-character-by-character, and sometimes keeping them, and sometimes
-not. They seem especially useful in any parsing application. One of the
-test files demonstrates usage.
-
-A brief summary:
-@table @code
-
-@item grow
-places something on the obstack without committing to wrap
-it up as a single entity yet.
-
-@item finish
-wraps up a constructed object as a single entity,
-and returns the pointer to its start address.
-
-@item copy
-places things on the obstack, and @emph{does} wrap them up.
-@code{copy} is always equivalent to first grow, then finish.
-
-@item free
-deletes something, and anything else put on the obstack since its creation.
-@end table
-
-The other functions are less commonly needed:
-@table @code
-@item blank
-is like grow, except it just grows the space by size units
-without placing anything into this space
-@item alloc
-is like @code{blank}, but it wraps up the object and returns its starting
-address.
-@item chunk_size, base, next_free, alignment_mask, size, room
-returns the appropriate class variables.
-@item grow_fast
-places a character on the obstack without checking if there is enough room.
-@item blank_fast
-like @code{blank}, but without checking if there is enough room.
-@item shrink(int n)
-shrink the current chunk by n bytes.
-@item contains(void* addr)
-returns true if the Obstack holds the address addr.
-@end table
-
-Here is a lightly edited version of the original C documentation:
-
-These functions operate a stack of objects. Each object starts life
-small, and may grow to maturity. (Consider building a word syllable
-by syllable.) An object can move while it is growing. Once it has
-been ``finished'' it never changes address again. So the ``top of the
-stack'' is typically an immature growing object, while the rest of the
-stack is of mature, fixed size and fixed address objects.
-
-These routines grab large chunks of memory, using the GNU C++ @code{new}
-operator. On occasion, they free chunks, via @code{delete}.
-
-Each independent stack is represented by a Obstack.
-
-One motivation for this package is the problem of growing char strings
-in symbol tables. Unless you are a ``fascist pig with a read-only mind''
-[Gosper's immortal quote from HAKMEM item 154, out of context] you
-would not like to put any arbitrary upper limit on the length of your
-symbols.
-
-In practice this often means you will build many short symbols and a
-few long symbols. At the time you are reading a symbol you don't know
-how long it is. One traditional method is to read a symbol into a
-buffer, @code{realloc()}ating the buffer every time you try to read a
-symbol that is longer than the buffer. This is beaut, but you still will
-want to copy the symbol from the buffer to a more permanent
-symbol-table entry say about half the time.
-
-With obstacks, you can work differently. Use one obstack for all symbol
-names. As you read a symbol, grow the name in the obstack gradually.
-When the name is complete, finalize it. Then, if the symbol exists already,
-free the newly read name.
-
-The way we do this is to take a large chunk, allocating memory from
-low addresses. When you want to build a symbol in the chunk you just
-add chars above the current ``high water mark'' in the chunk. When you
-have finished adding chars, because you got to the end of the symbol,
-you know how long the chars are, and you can create a new object.
-Mostly the chars will not burst over the highest address of the chunk,
-because you would typically expect a chunk to be (say) 100 times as
-long as an average object.
-
-In case that isn't clear, when we have enough chars to make up
-the object, @emph{they are already contiguous in the chunk} (guaranteed)
-so we just point to it where it lies. No moving of chars is
-needed and this is the second win: potentially long strings need
-never be explicitly shuffled. Once an object is formed, it does not
-change its address during its lifetime.
-
-When the chars burst over a chunk boundary, we allocate a larger
-chunk, and then copy the partly formed object from the end of the old
-chunk to the beginning of the new larger chunk. We then carry on
-accreting characters to the end of the object as we normally would.
-
-A special version of grow is provided to add a single char at a time
-to a growing object.
-
-Summary:
-
-@itemize @bullet
-@item
-We allocate large chunks.
-@item
-We carve out one object at a time from the current chunk.
-@item
-Once carved, an object never moves.
-@item
-We are free to append data of any size to the currently growing object.
-@item
-Exactly one object is growing in an obstack at any one time.
-@item
-You can run one obstack per control block.
-@item
-You may have as many control blocks as you dare.
-@item
-Because of the way we do it, you can `unwind' a obstack back to a
-previous state. (You may remove objects much as you would with a stack.)
-@end itemize
-
-The obstack data structure is used in many places in the GNU C++ compiler.
-
-Differences from the the GNU C version
-@enumerate
-@item
-The obvious differences stemming from the use of classes and
-inline functions instead of structs and macros. The C
-@code{init} and @code{begin} macros are replaced by constructors.
-
-@item
-Overloaded function names are used for grow (and others),
-rather than the C @code{grow}, @code{grow0}, etc.
-
-@item
-All dynamic allocation uses the the built-in @code{new} operator.
-This restricts flexibility by a little, but maintains compatibility
-with usual C++ conventions.
-
-@item
-There are now two versions of finish:
-
-@enumerate
-@item
-finish() behaves like the C version.
-
-@item
-finish(char terminator) adds @code{terminator}, and then calls
-@code{finish()}. This enables the normal invocation of @code{finish(0)} to
-wrap up a string being grown character-by-character.
-@end enumerate
-
-@item
-There are special versions of grow(const char* s) and
-copy(const char* s) that add the null-terminated string @code{s}
-after computing its length.
-
-@item
-The shrink and contains functions are provided.
-
-@end enumerate
-
-@node AllocRing, String, Obstack, Top
-@chapter The AllocRing class
-
-An AllocRing is a bounded ring (circular list), each of whose elements
-contains a pointer to some space allocated via @code{new
-char[some_size]}. The entries are used cyclicly. The size, n, of the
-ring is fixed at construction. After that, every nth use of the ring
-will reuse (or reallocate) the same space. AllocRings are needed in
-order to temporarily hold chunks of space that are needed transiently,
-but across constructor-destructor scopes. They mainly useful for storing
-strings containing formatted characters to print across various
-functions and coercions. These strings are needed across routines, so
-may not be deleted in any one of them, but should be recovered at some
-point. In other words, an AllocRing is an extremely simple minded
-garbage collection mechanism. The GNU C++ library used to use one
-AllocRing for such formatting purposes, but it is being phased out,
-and is now only used by obsolete functions.
-These days, AllocRings are probably not very useful.
-
-Support includes:
-
-@table @code
-
-@item AllocRing a(int n)
-constructs an Alloc ring with n entries, all null.
-
-@item void* mem = a.alloc(sz)
-moves the ring pointer to the next entry, and reuses the space
-if their is enough, also allocates space via new char[sz].
-
-@item int present = a.contains(void* ptr)
-returns true if ptr is held in one of the ring entries.
-
-@item a.clear()
-deletes all space pointed to in any entry. This is called
-automatically upon destruction.
-
-@item a.free(void* ptr)
-If ptr is one of the entries, calls delete of the pointer,
-and resets to entry pointer to null.
-
-@end table
-
-@node String, Integer, AllocRing, Top
-@chapter The String class
-
-The @code{String} class is designed to extend GNU C++ to support
-string processing capabilities similar to those in languages like
-Awk. The class provides facilities that ought to be convenient
-and efficient enough to be useful replacements for @code{char*}
-based processing via the C string library (i.e., @code{strcpy,
-strcmp,} etc.) in many applications. Many details about String
-representations are described in the Representation section.
-
-A separate @code{SubString} class supports substring extraction
-and modification operations. This is implemented in a way that
-user programs never directly construct or represent substrings,
-which are only used indirectly via String operations.
-
-Another separate class, @code{Regex} is also used indirectly via String
-operations in support of regular expression searching, matching, and the
-like. The Regex class is based entirely on the GNU Emacs regex
-functions. @xref{Regexps, Syntax of Regular Expressions, Syntax of
-Regular Expressions, emacs.info, GNU Emacs Manual}, for a full
-explanation of regular expression syntax. (For implementation details,
-see the internal documentation in files @file{regex.h} and
-@file{regex.c}.)
-
-@section Constructors
-
-Strings are initialized and assigned as in the following examples:
-
-@table @code
-
-@item String x; String y = 0; String z = "";
-Set x, y, and z to the nil string. Note that either 0 or "" may
-always be used to refer to the nil string.
-
-@item String x = "Hello"; String y("Hello");
-Set x and y to a copy of the string "Hello".
-
-@item String x = 'A'; String y('A');
-Set x and y to the string value "A"
-
-@item String u = x; String v(x);
-Set u and v to the same string as String x
-
-@item String u = x.at(1,4); String v(x.at(1,4));
-Set u and v to the length 4 substring of x starting at position 1
-(counting indexes from 0).
-
-@item String x("abc", 2);
-Sets x to "ab", i.e., the first 2 characters of "abc".
-
-@item String x = dec(20);
-Sets x to "20". As here, Strings may be initialized or assigned
-the results of any @code{char*} function.
-
-@end table
-
-There are no directly accessible forms for declaring SubString
-variables.
-
-The declaration @code{Regex r("[a-zA-Z_][a-zA-Z0-9_]*");} creates
-a compiled regular expression suitable for use in String
-operations described below. (In this case, one that matches any
-C++ identifier). The first argument may also be a String.
-Be careful in distinguishing the role of backslashes in quoted
-GNU C++ char* constants versus those in Regexes. For example, a Regex
-that matches either one or more tabs or all strings beginning
-with "ba" and ending with any number of occurrences of "na"
-could be declared as @code{Regex r = "\\(\t+\\)\\|\\(ba\\(na\\)*\\)"}
-Note that only one backslash is needed to signify the tab, but
-two are needed for the parenthesization and virgule, since the
-GNU C++ lexical analyzer decodes and strips backslashes before
-they are seen by Regex.
-
-There are three additional optional arguments to the Regex constructor
-that are less commonly useful:
-
-@table @code
-@item fast (default 0)
-@code{fast} may be set to true (1) if the Regex should be
-"fast-compiled". This causes an additional compilation step that
-is generally worthwhile if the Regex will be used many times.
-
-@item bufsize (default max(40, length of the string))
-This is an estimate of the size of the internal compiled
-expression. Set it to a larger value if you know that the
-expression will require a lot of space. If you do not know,
-do not worry: realloc is used if necessary.
-
-@item transtable (default none == 0)
-The address of a byte translation table (a char[256]) that
-translates each character before matching.
-
-@end table
-
-As a convenience, several Regexes are predefined and usable in
-any program. Here are their declarations from @file{String.h}.
-
-@smallexample
-extern Regex RXwhite; // = "[ \n\t]+"
-extern Regex RXint; // = "-?[0-9]+"
-extern Regex RXdouble; // = "-?\\(\\([0-9]+\\.[0-9]*\\)\\|
- // \\([0-9]+\\)\\|
- // \\(\\.[0-9]+\\)\\)
- // \\([eE][---+]?[0-9]+\\)?"
-extern Regex RXalpha; // = "[A-Za-z]+"
-extern Regex RXlowercase; // = "[a-z]+"
-extern Regex RXuppercase; // = "[A-Z]+"
-extern Regex RXalphanum; // = "[0-9A-Za-z]+"
-extern Regex RXidentifier; // = "[A-Za-z_][A-Za-z0-9_]*"
-
-@end smallexample
-
-@section Examples
-
-Most @code{String} class capabilities are best shown via example.
-The examples below use the following declarations.
-
-@example
- String x = "Hello";
- String y = "world";
- String n = "123";
- String z;
- char* s = ",";
- String lft, mid, rgt;
- Regex r = "e[a-z]*o";
- Regex r2("/[a-z]*/");
- char c;
- int i, pos, len;
- double f;
- String words[10];
- words[0] = "a";
- words[1] = "b";
- words[2] = "c";
-
-@end example
-
-@section Comparing, Searching and Matching
-
-The usual lexicographic relational operators (@code{==, !=, <, <=, >, >=})
-are defined. A functional form @code{compare(String, String)} is also
-provided, as is @code{fcompare(String, String)}, which compares
-Strings without regard for upper vs. lower case.
-
-All other matching and searching operations are based on some form of the
-(non-public) @code{match} and @code{search} functions. @code{match} and
-@code{search} differ in that @code{match} attempts to match only at the
-given starting position, while @code{search} starts at the position, and
-then proceeds left or right looking for a match. As seen in the following
-examples, the second optional @code{startpos} argument to functions using
-@code{match} and @code{search} specifies the starting position of the
-search: If non-negative, it results in a left-to-right search starting at
-position @code{startpos}, and if negative, a right-to-left search starting
-at position @code{x.length() + startpos}. In all cases, the index returned
-is that of the beginning of the match, or -1 if there is no match.
-
-Three String functions serve as front ends to @code{search} and @code{match}.
-@code{index} performs a search, returning the index, @code{matches} performs
-a match, returning nonzero (actually, the length of the match) on success,
-and @code{contains} is a boolean function performing either a search or
-match, depending on whether an index argument is provided:
-
-@table @code
-
-@item x.index("lo")
-returns the zero-based index of the leftmost occurrence of
-substring "lo" (3, in this case). The argument may be a
-String, SubString, char, char*, or Regex.
-
-@item x.index("l", 2)
-returns the index of the first of the leftmost occurrence of "l"
-found starting the search at position x[2], or 2 in this case.
-
-@item x.index("l", -1)
-returns the index of the rightmost occurrence of "l", or 3 here.
-
-@item x.index("l", -3)
-returns the index of the rightmost occurrence of "l" found by
-starting the search at the 3rd to the last position of x,
-returning 2 in this case.
-
-@item pos = r.search("leo", 3, len, 0)
-returns the index of r in the @code{char*} string of length 3,
-starting at position 0, also placing the length of the match
-in reference parameter len.
-
-@item x.contains("He")
-returns nonzero if the String x contains the substring "He". The
-argument may be a String, SubString, char, char*, or Regex.
-
-@item x.contains("el", 1)
-returns nonzero if x contains the substring "el" at position 1.
-As in this example, the second argument to @code{contains},
-if present, means to match the substring only at that position,
-and not to search elsewhere in the string.
-
-@item x.contains(RXwhite);
-returns nonzero if x contains any whitespace (space, tab, or
-newline). Recall that @code{RXwhite} is a global whitespace Regex.
-
-@item x.matches("lo", 3)
-returns nonzero if x starting at position 3 exactly matches "lo", with
-no trailing characters (as it does in this example).
-
-@item x.matches(r)
-returns nonzero if String x as a whole matches Regex r.
-
-@item int f = x.freq("l")
-returns the number of distinct, nonoverlapping matches to the argument
-(2 in this case).
-
-@end table
-
-@section Substring extraction
-
-Substrings may be extracted via the @code{at}, @code{before},
-@code{through}, @code{from}, and @code{after} functions.
-These behave as either lvalues or rvalues.
-
-@table @code
-
-@item z = x.at(2, 3)
-sets String z to be equal to the length 3 substring of String x
-starting at zero-based position 2, setting z to "llo" in this
-case. A nil String is returned if the arguments don't make sense.
-
-@item x.at(2, 2) = "r"
-Sets what was in positions 2 to 3 of x to "r", setting x to
-"Hero" in this case. As indicated here, SubString assignments may
-be of different lengths.
-
-@item x.at("He") = "je";
-x("He") is the substring of x that matches the first occurrence of
-it's argument. The substitution sets x to "jello". If "He" did
-not occur, the substring would be nil, and the assignment would
-have no effect.
-
-@item x.at("l", -1) = "i";
-replaces the rightmost occurrence of "l" with "i", setting x to
-"Helio".
-
-@item z = x.at(r)
-sets String z to the first match in x of Regex r, or "ello" in this
-case. A nil String is returned if there is no match.
-
-@item z = x.before("o")
-sets z to the part of x to the left of the first occurrence of
-"o", or "Hell" in this case. The argument may also be a String,
-SubString, or Regex. (If there is no match, z is set to "".)
-
-@item x.before("ll") = "Bri";
-sets the part of x to the left of "ll" to "Bri", setting x to
-"Brillo".
-
-@item z = x.before(2)
-sets z to the part of x to the left of x[2], or "He" in this
-case.
-
-@item z = x.after("Hel")
-sets z to the part of x to the right of "Hel", or "lo" in this
-case.
-
-@item z = x.through("el")
-sets z to the part of x up and including "el", or "Hel" in this case.
-
-@item z = x.from("el")
-sets z to the part of x from "el" to the end, or "ello" in this case.
-
-@item x.after("Hel") = "p";
-sets x to "Help";
-
-@item z = x.after(3)
-sets z to the part of x to the right of x[3] or "o" in this case.
-
-@item z = " ab c"; z = z.after(RXwhite)
-sets z to the part of its old string to the right of the first
-group of whitespace, setting z to "ab c"; Use gsub(below) to
-strip out multiple occurrences of whitespace or any pattern.
-
-@item x[0] = 'J';
-sets the first element of x to 'J'. x[i] returns a reference to
-the ith element of x, or triggers an error if i is out of range.
-
-@item common_prefix(x, "Help")
-returns the String containing the common prefix of the two Strings
-or "Hel" in this case.
-
-@item common_suffix(x, "to")
-returns the String containing the common suffix of the two Strings
-or "o" in this case.
-
-@end table
-
-@section Concatenation
-
-@table @code
-
-@item z = x + s + ' ' + y.at("w") + y.after("w") + ".";
-sets z to "Hello, world."
-
-@item x += y;
-sets x to "Helloworld"
-
-@item cat(x, y, z)
-A faster way to say z = x + y.
-
-@item cat(z, y, x, x)
-Double concatenation; A faster way to say x = z + y + x.
-
-@item y.prepend(x);
-A faster way to say y = x + y.
-
-@item z = replicate(x, 3);
-sets z to "HelloHelloHello".
-
-@item z = join(words, 3, "/")
-sets z to the concatenation of the first 3 Strings in String
-array words, each separated by "/", setting z to "a/b/c" in this
-case. The last argument may be "" or 0, indicating no separation.
-
-@end table
-
-@section Other manipulations
-
-@table @code
-
-@item z = "this string has five words"; i = split(z, words, 10, RXwhite);
-sets up to 10 elements of String array words to the parts of z
-separated by whitespace, and returns the number of parts actually
-encountered (5 in this case). Here, words[0] = "this", words[1] =
-"string", etc. The last argument may be any of the usual.
-If there is no match, all of z ends up in words[0]. The words array
-is @emph{not} dynamically created by split.
-
-@item int nmatches x.gsub("l","ll")
-substitutes all original occurrences of "l" with "ll", setting x
-to "Hellllo". The first argument may be any of the usual,
-including Regex. If the second argument is "" or 0, all
-occurrences are deleted. gsub returns the number of matches
-that were replaced.
-
-@item z = x + y; z.del("loworl");
-deletes the leftmost occurrence of "loworl" in z, setting z to
-"Held".
-
-@item z = reverse(x)
-sets z to the reverse of x, or "olleH".
-
-@item z = upcase(x)
-sets z to x, with all letters set to uppercase, setting z to "HELLO"
-
-@item z = downcase(x)
-sets z to x, with all letters set to lowercase, setting z to "hello"
-
-@item z = capitalize(x)
-sets z to x, with the first letter of each word set to uppercase,
-and all others to lowercase, setting z to "Hello"
-
-@item x.reverse(), x.upcase(), x.downcase(), x.capitalize()
-in-place, self-modifying versions of the above.
-
-@end table
-
-@section Reading, Writing and Conversion
-
-@table @code
-
-@item cout << x
-writes out x.
-
-@item cout << x.at(2, 3)
-writes out the substring "llo".
-
-@item cin >> x
-reads a whitespace-bounded string into x.
-
-@item x.length()
-returns the length of String x (5, in this case).
-
-@item s = (const char*)x
-can be used to extract the @code{char*} char array. This
-coercion is useful for sending a String as an argument to any
-function expecting a @code{const char*} argument (like
-@code{atoi}, and @code{File::open}). This operator must be
-used with care, since the conversion returns a pointer
-to @code{String} internals without copying the characters:
-The resulting @code{(char*)} is only valid until
-the next String operation, and you must not modify it.
-(The conversion is defined to return a const
-value so that GNU C++ will produce warning and/or error
-messages if changes are attempted.)
-
-@end table
-
-@node Integer, Rational, String, Top
-@chapter The Integer class.
-
-The @code{Integer} class provides multiple precision integer arithmetic
-facilities. Some representation details are discussed in the
-Representation section.
-
-@code{Integers} may be up to @code{b * ((1 << b) - 1)} bits long, where
-@code{b} is the number of bits per short (typically 1048560 bits when
-@code{b = 16}). The implementation assumes that a @code{long} is at least
-twice as long as a @code{short}. This assumption hides beneath almost all
-primitive operations, and would be very difficult to change. It also relies
-on correct behavior of @emph{unsigned} arithmetic operations.
-
-Some of the arithmetic algorithms are very loosely based on those
-provided in the MIT Scheme @file{bignum.c} release, which is
-Copyright (c) 1987 Massachusetts Institute of Technology. Their use
-here falls within the provisions described in the Scheme release.
-
-Integers may be constructed in the following ways:
-@table @code
-
-@item Integer x;
-Declares an uninitialized Integer.
-
-@item Integer x = 2; Integer y(2);
-Set x and y to the Integer value 2;
-
-@item Integer u(x); Integer v = x;
-Set u and v to the same value as x.
-
-@end table
-
-@deftypefn Method long Integer::as_long() const
-Used to coerce an @code{Integer} back into longs via the @code{long}
-coercion operator. If the Integer cannot fit into a long, this returns
-MINLONG or MAXLONG (depending on the sign) where MINLONG is the most
-negative, and MAXLONG is the most positive representable long.
-@end deftypefn
-
-@deftypefn Method int Integer::fits_in_long() const
-Returns true iff the @code{Integer} is @code{< MAXLONG} and @code{> MINLONG}.
-@end deftypefn
-
-@deftypefn Method double Integer::as_double() const
-Coerce the @code{Integer} to a @code{double}, with potential
-loss of precision.
-@code{+/-HUGE} is returned if the Integer cannot fit into a double.
-@end deftypefn
-
-@deftypefn Method int Integer::fits_in_double() const
-Returns true iff the @code{Integer} can fit into a double.
-@end deftypefn
-
-All of the usual arithmetic operators are provided (@code{+, -, *, /,
-%, +=, ++, -=, --, *=, /=, %=, ==, !=, <, <=, >, >=}). All operators
-support special versions for mixed arguments of Integers and regular
-C++ longs in order to avoid useless coercions, as well as to allow
-automatic promotion of shorts and ints to longs, so that they may be
-applied without additional Integer coercion operators. The only
-operators that behave differently than the corresponding int or long
-operators are @code{++} and @code{--}. Because C++ does not
-distinguish prefix from postfix application, these are declared as
-@code{void} operators, so that no confusion can result from applying
-them as postfix. Thus, for Integers x and y, @code{ ++x; y = x; } is
-correct, but @code{ y = ++x; } and @code{ y = x++; } are not.
-
-Bitwise operators (@code{~}, @code{&}, @code{|}, @code{^}, @code{<<},
-@code{>>}, @code{&=}, @code{|=}, @code{^=}, @code{<<=}, @code{>>=}) are
-also provided. However, these operate on sign-magnitude, rather than
-two's complement representations. The sign of the result is arbitrarily
-taken as the sign of the first argument. For example, @code{Integer(-3)
-& Integer(5)} returns @code{Integer(-1)}, not -3, as it would using
-two's complement. Also, @code{~}, the complement operator, complements
-only those bits needed for the representation. Bit operators are also
-provided in the BitSet and BitString classes. One of these classes
-should be used instead of Integers when the results of bit manipulations
-are not interpreted numerically.
-
-The following utility functions are also provided. (All arguments
-are Integers unless otherwise noted).
-
-@deftypefun void divide(const Integer& @var{x}, const Integer& @var{y}, Integer& @var{q}, Integer& @var{r})
-Sets @var{q} to the quotient and @var{r} to the remainder of @var{x} and @var{y}.
-(@var{q} and @var{r} are returned by reference).
-@end deftypefun
-
-@deftypefun Integer pow(const Integer& @var{x}, const Integer& @var{p})
-Returns @var{x} raised to the power @var{p}.
-@end deftypefun
-
-@deftypefun Integer Ipow(long @var{x}, long @var{p})
-Returns @var{x} raised to the power @var{p}.
-@end deftypefun
-
-@deftypefun Integer gcd(const Integer& @var{x}, const Integer& @var{p})
-Returns the greatest common divisor of @var{x} and @var{y}.
-@end deftypefun
-
-@deftypefun Integer lcm(const Integer& @var{x}, const Integer& @var{p})
-Returns the least common multiple of @var{x} and @var{y}.
-@end deftypefun
-
-@deftypefun Integer abs(const Integer& @var{x}
-Returns the absolute value of @var{x}.
-@end deftypefun
-
-@deftypefn Method void Integer::negate()
-Negates @code{this} in place.
-@end deftypefn
-
-@table @code
-
-@item Integer sqr(x)
-returns x * x;
-
-@item Integer sqrt(x)
-returns the floor of the square root of x.
-
-@item long lg(x);
-returns the floor of the base 2 logarithm of abs(x)
-
-@item int sign(x)
-returns -1 if x is negative, 0 if zero, else +1.
-Using @code{if (sign(x) == 0)} is a generally faster method
-of testing for zero than using relational operators.
-
-@item int even(x)
-returns true if x is an even number
-
-@item int odd(x)
-returns true if x is an odd number.
-
-@item void setbit(Integer& x, long b)
-sets the b'th bit (counting right-to-left from zero) of x to 1.
-
-@item void clearbit(Integer& x, long b)
-sets the b'th bit of x to 0.
-
-@item int testbit(Integer x, long b)
-returns true if the b'th bit of x is 1.
-
-@item Integer atoI(char* asciinumber, int base = 10);
-converts the base base char* string into its Integer form.
-
-@item void Integer::printon(ostream& s, int base = 10, int width = 0);
-prints the ascii string value of @code{(*this)} as a base @code{base}
-number, in field width at least @code{width}.
-
-@item ostream << x;
-prints x in base ten format.
-
-@item istream >> x;
-reads x as a base ten number.
-
-@item int compare(Integer x, Integer y)
-returns a negative number if x<y, zero if x==y, or positive if x>y.
-
-@item int ucompare(Integer x, Integer y)
-like compare, but performs unsigned comparison.
-
-@item add(x, y, z)
-A faster way to say z = x + y.
-
-@item sub(x, y, z)
-A faster way to say z = x - y.
-
-@item mul(x, y, z)
-A faster way to say z = x * y.
-
-@item div(x, y, z)
-A faster way to say z = x / y.
-
-@item mod(x, y, z)
-A faster way to say z = x % y.
-
-@item and(x, y, z)
-A faster way to say z = x & y.
-
-@item or(x, y, z)
-A faster way to say z = x | y.
-
-@item xor(x, y, z)
-A faster way to say z = x ^ y.
-
-@item lshift(x, y, z)
-A faster way to say z = x << y.
-
-@item rshift(x, y, z)
-A faster way to say z = x >> y.
-
-@item pow(x, y, z)
-A faster way to say z = pow(x, y).
-
-@item complement(x, z)
-A faster way to say z = ~x.
-
-@item negate(x, z)
-A faster way to say z = -x.
-
-@end table
-
-@node Rational, Complex, Integer, Top
-@chapter The Rational Class
-
-Class @code{Rational} provides multiple precision rational
-number arithmetic. All rationals are maintained in simplest
-form (i.e., with the numerator and denominator relatively
-prime, and with the denominator strictly positive).
-Rational arithmetic and relational operators are provided
-(@code{+, -, *, /, +=, -=, *=, /=, ==, !=, <, <=, >, >=}).
-Operations resulting in a rational number with zero denominator
-trigger an exception.
-
-Rationals may be constructed and used in the following ways:
-
-@table @code
-
-@item Rational x;
-Declares an uninitialized Rational.
-
-@item Rational x = 2; Rational y(2);
-Set x and y to the Rational value 2/1;
-
-@item Rational x(2, 3);
-Sets x to the Rational value 2/3;
-
-@item Rational x = 1.2;
-Sets x to a Rational value close to 1.2. Any double precision value
-may be used to construct a Rational. The Rational will possess
-exactly as much precision as the double. Double values that do
-not have precise floating point equivalents (like 1.2) produce
-similarly imprecise rational values.
-
-@item Rational x(Integer(123), Integer(4567));
-Sets x to the Rational value 123/4567.
-
-@item Rational u(x); Rational v = x;
-Set u and v to the same value as x.
-
-@item double(Rational x)
-A Rational may be coerced to a double with potential
-loss of precision. +/-HUGE is returned if it will not fit.
-
-@item Rational abs(x)
-returns the absolute value of x.
-
-@item void x.negate()
-negates x.
-
-@item void x.invert()
-sets x to 1/x.
-
-@item int sign(x)
-returns 0 if x is zero, 1 if positive, and -1 if negative.
-
-@item Rational sqr(x)
-returns x * x.
-
-@item Rational pow(x, Integer y)
-returns x to the y power.
-
-@item Integer x.numerator()
-returns the numerator.
-
-@item Integer x.denominator()
-returns the denominator.
-
-@item Integer floor(x)
-returns the greatest Integer less than x.
-
-@item Integer ceil(x)
-returns the least Integer greater than x.
-
-@item Integer trunc(x)
-returns the Integer part of x.
-
-@item Integer round(x)
-returns the nearest Integer to x.
-
-@item int compare(x, y)
-returns a negative, zero, or positive number signifying whether x is
-less than, equal to, or greater than y.
-
-@item ostream << x;
-prints x in the form num/den, or just num if the denominator is one.
-
-@item istream >> x;
-reads x in the form num/den, or just num in which case the
-denominator is set to one.
-
-@item add(x, y, z)
-A faster way to say z = x + y.
-
-@item sub(x, y, z)
-A faster way to say z = x - y.
-
-@item mul(x, y, z)
-A faster way to say z = x * y.
-
-@item div(x, y, z)
-A faster way to say z = x / y.
-
-@item pow(x, y, z)
-A faster way to say z = pow(x, y).
-
-@item negate(x, z)
-A faster way to say z = -x.
-
-@end table
-
-@node Complex, Fix, Rational, Top
-@chapter The Complex class.
-
-Class @code{Complex} is implemented in a way similar to that
-described by Stroustrup. In keeping with libg++ conventions,
-the class is named @code{Complex}, not @code{complex}.
-Complex arithmetic and relational operators are provided
-(@code{+, -, *, /, +=, -=, *=, /=, ==, !=}).
-Attempted division by (0, 0) triggers an exception.
-
-Complex numbers may be constructed and used in the following ways:
-
-@table @code
-
-@item Complex x;
-Declares an uninitialized Complex.
-
-@item Complex x = 2; Complex y(2.0);
-Set x and y to the Complex value (2.0, 0.0);
-
-@item Complex x(2, 3);
-Sets x to the Complex value (2, 3);
-
-@item Complex u(x); Complex v = x;
-Set u and v to the same value as x.
-
-@item double real(Complex& x);
-returns the real part of x.
-
-@item double imag(Complex& x);
-returns the imaginary part of x.
-
-@item double abs(Complex& x);
-returns the magnitude of x.
-
-@item double norm(Complex& x);
-returns the square of the magnitude of x.
-
-@item double arg(Complex& x);
-returns the argument (amplitude) of x.
-
-@item Complex polar(double r, double t = 0.0);
-returns a Complex with abs of r and arg of t.
-
-@item Complex conj(Complex& x);
-returns the complex conjugate of x.
-
-@item Complex cos(Complex& x);
-returns the complex cosine of x.
-
-@item Complex sin(Complex& x);
-returns the complex sine of x.
-
-@item Complex cosh(Complex& x);
-returns the complex hyperbolic cosine of x.
-
-@item Complex sinh(Complex& x);
-returns the complex hyperbolic sine of x.
-
-@item Complex exp(Complex& x);
-returns the exponential of x.
-
-@item Complex log(Complex& x);
-returns the natural log of x.
-
-@item Complex pow(Complex& x, long p);
-returns x raised to the p power.
-
-@item Complex pow(Complex& x, Complex& p);
-returns x raised to the p power.
-
-@item Complex sqrt(Complex& x);
-returns the square root of x.
-
-@item ostream << x;
-prints x in the form (re, im).
-
-@item istream >> x;
-reads x in the form (re, im), or just (re) or re in which case the
-imaginary part is set to zero.
-
-@end table
-
-@node Fix, Bit, Complex, Top
-@chapter Fixed precision numbers
-
-Classes @code{Fix16}, @code{Fix24}, @code{Fix32}, and @code{Fix48}
-support operations on 16, 24, 32, or 48 bit quantities that are
-considered as real numbers in the range [-1, +1). Such numbers are
-often encountered in digital signal processing applications. The classes
-may be be used in isolation or together. Class @code{Fix32}
-operations are entirely self-contained. Class @code{Fix16} operations
-are self-contained except that the multiplication operation @code{Fix16
-* Fix16} returns a @code{Fix32}. @code{Fix24} and @code{Fix48} are
-similarly related.
-
-The standard arithmetic and relational operations are supported
-(@code{=}, @code{+}, @code{-}, @code{*}, @code{/}, @code{<<}, @code{>>},
-@code{+=}, @code{-=}, @code{*=}, @code{/=}, @code{<<=}, @code{>>=},
-@code{==}, @code{!=}, @code{<}, @code{<=}, @code{>}, @code{>=}).
-All operations include provisions for special handling in cases where
-the result exceeds +/- 1.0. There are two cases that may be handled
-separately: ``overflow'' where the results of addition and subtraction
-operations go out of range, and all other ``range errors'' in which
-resulting values go off-scale (as with division operations, and
-assignment or initialization with off-scale values). In signal
-processing applications, it is often useful to handle these two cases
-differently. Handlers take one argument, a reference to the integer
-mantissa of the offending value, which may then be manipulated. In
-cases of overflow, this value is the result of the (integer) arithmetic
-computation on the mantissa; in others it is a fully saturated (i.e.,
-most positive or most negative) value. Handling may be reset to any of
-several provided functions or any other user-defined function via
-@code{set_overflow_handler} and @code{set_range_error_handler}. The
-provided functions for @code{Fix16} are as follows (corresponding
-functions are also supported for the others).
-
-@table @code
-
-@item Fix16_overflow_saturate
-The default overflow handler. Results are ``saturated'': positive results
-are set to the largest representable value (binary 0.111111...), and
-negative values to -1.0.
-
-@item Fix16_ignore
-Performs no action. For overflow, this will allow addition and
-subtraction operations to ``wrap around'' in the same manner
-as integer arithmetic, and for saturation, will leave values saturated.
-
-@item Fix16_overflow_warning_saturate
-Prints a warning message on standard error, then saturates the results.
-
-@item Fix16_warning
-The default range_error handler. Prints a warning message
-on standard error; otherwise leaving the argument unmodified.
-
-@item Fix16_abort
-prints an error message on standard error, then aborts execution.
-
-
-@end table
-
-In addition to arithmetic operations, the following are provided:
-
-@table @code
-
-@item Fix16 a = 0.5;
-Constructs fixed precision objects from double precision values.
-Attempting to initialize to a value outside the range invokes
-the range_error handler, except, as a convenience,
-initialization to 1.0 sets the variable to the most positive
-representable value (binary 0.1111111...) without invoking the handler.
-
-@item short& mantissa(a); long& mantissa(b);
-return a * pow(2, 15) or b * pow(2, 31) as an integer. These
-are returned by reference, to enable ``manual'' data manipulation.
-
-@item double value(a); double value(b);
-return a or b as floating point numbers.
-
-@end table
-
-@node Bit, Random, Fix, Top
-@chapter Classes for Bit manipulation
-
-libg++ provides several different classes supporting the use
-and manipulation of collections of bits in different ways.
-
-@itemize @bullet
-
-@item
-Class @code{Integer} provides ``integer'' semantics. It supports
-manipulation of bits in ways that are often useful when treating bit arrays
-as numerical (integer) quantities. This class is described elsewhere.
-
-@item
-Class @code{BitSet} provides ``set'' semantics. It supports operations
-useful when treating collections of bits as representing potentially
-infinite sets of integers.
-
-@item
-Class @code{BitSet32} supports fixed-length BitSets holding exactly
-32 bits.
-
-@item
-Class @code{BitSet256} supports fixed-length BitSets holding exactly
-256 bits.
-
-@item
-Class @code{BitString} provides ``string'' (or ``vector'') semantics.
-It supports operations useful when treating collections of bits as
-strings of zeros and ones.
-
-@end itemize
-
-These classes also differ in the following ways:
-
-@itemize @bullet
-
-
-@item
-BitSets are logically infinite. Their space is dynamically altered to
-adjust to the smallest number of consecutive bits actually required to
-represent the sets. Integers also have this property. BitStrings are
-logically finite, but their sizes are internally dynamically managed to
-maintain proper length. This means that, for example, BitStrings are
-concatenatable while BitSets and Integers are not.
-
-@item
-BitSet32 and BitSet256 have precisely the same properties as BitSets,
-except that they use constant fixed length bit vectors.
-
-@item
-While all classes support basic unary and binary operations @code{~, &,
-|, ^, -}, the semantics differ. BitSets perform bit operations that
-precisely mirror those for infinite sets. For example, complementing an
-empty BitSet returns one representing an infinite number of set bits.
-Operations on BitStrings and Integers operate only on those bits
-actually present in the representation. For BitStrings and Integers,
-the the @code{&} operation returns a BitString with a length equal to
-the minimum length of the operands, and @code{|, ^} return one with
-length of the maximum.
-
-@item
-Only BitStrings support substring extraction and bit pattern matching.
-
-@end itemize
-
-@section BitSet
-
-BitSets are objects that contain logically infinite sets of nonnegative
-integers. Representational details are discussed in the Representation
-chapter. Because they are logically infinite, all BitSets possess a
-trailing, infinitely replicated 0 or 1 bit, called the ``virtual bit'', and
-indicated via 0* or 1*.
-
-BitSet32 and BitSet256 have they same properties, except they are
-of fixed length, and thus have no virtual bit.
-
-BitSets may be constructed as follows:
-
-@table @code
-
-@item BitSet a;
-declares an empty BitSet.
-
-@item BitSet a = atoBitSet("001000");
-sets a to the BitSet 0010*, reading left-to-right. The ``0*''
-indicates that the set ends with an infinite number of zero
-(clear) bits.
-
-@item BitSet a = atoBitSet("00101*");
-sets a to the BitSet 00101*, where ``1*'' means that the set ends
-with an infinite number of one (set) bits.
-
-@item BitSet a = longtoBitSet((long)23);
-sets a to the BitSet 111010*, the binary representation of decimal 23.
-
-@item BitSet a = utoBitSet((unsigned)23);
-sets a to the BitSet 111010*, the binary representation of decimal 23.
-
-@end table
-
-The following functions and operators are provided (Assume the
-declaration of BitSets a = 0011010*, b = 101101*, throughout, as
-examples).
-
-@table @code
-
-@item ~a
-returns the complement of a, or 1100101* in this case.
-
-@item a.complement()
-sets a to ~a.
-
-@item a & b; a &= b;
-returns a intersected with b, or 0011010*.
-
-@item a | b; a |= b;
-returns a unioned with b, or 1011111*.
-
-@item a - b; a -= b;
-returns the set difference of a and b, or 000010*.
-
-@item a ^ b; a ^= b;
-returns the symmetric difference of a and b, or 1000101*.
-
-@item a.empty()
-returns true if a is an empty set.
-
-@item a == b;
-returns true if a and b contain the same set.
-
-@item a <= b;
-returns true if a is a subset of b.
-
-@item a < b;
-returns true if a is a proper subset of b;
-
-@item a != b; a >= b; a > b;
-are the converses of the above.
-
-@item a.set(7)
-sets the 7th (counting from 0) bit of a, setting a to 001111010*
-
-@item a.clear(2)
-clears the 2nd bit bit of a, setting a to 00011110*
-
-@item a.clear()
-clears all bits of a;
-
-@item a.set()
-sets all bits of a;
-
-@item a.invert(0)
-complements the 0th bit of a, setting a to 10011110*
-
-@item a.set(0,1)
-sets the 0th through 1st bits of a, setting a to 110111110*
-The two-argument versions of clear and invert are similar.
-
-@item a.test(3)
-returns true if the 3rd bit of a is set.
-
-@item a.test(3, 5)
-returns true if any of bits 3 through 5 are set.
-
-@item int i = a[3]; a[3] = 0;
-The subscript operator allows bits to be inspected and changed
-via standard subscript semantics, using a friend class BitSetBit.
-The use of the subscript operator a[i] rather than a.test(i)
-requires somewhat greater overhead.
-
-@item a.first(1) or a.first()
-returns the index of the first set bit of a (2 in this case),
-or -1 if no bits are set.
-
-@item a.first(0)
-returns the index of the first clear bit of a (0 in this case),
-or -1 if no bits are clear.
-
-@item a.next(2, 1) or a.next(2)
-returns the index of the next bit after position 2 that is set (3
-in this case) or -1. @code{first} and @code{next} may be used as
-iterators, as in
-@code{for (int i = a.first(); i >= 0; i = a.next(i))...}.
-
-@item a.last(1)
-returns the index of the rightmost set bit, or -1 if there or no set
-bits or all set bits.
-
-@item a.prev(3, 0)
-returns the index of the previous clear bit before position 3.
-
-@item a.count(1)
-returns the number of set bits in a, or -1 if there are
-an infinite number.
-
-@item a.virtual_bit()
-returns the trailing (infinitely replicated) bit of a.
-
-@item a = atoBitSet("ababX", 'a', 'b', 'X');
-converts the char* string into a bitset, with 'a' denoting false,
-'b' denoting true, and 'X' denoting infinite replication.
-
-@item a.printon(cout, '-', '.', 0)
-prints @code{a} to @code{cout} represented with
-@code{'-'} for falses, @code{'.'} for trues, and no replication marker.
-
-@item cout << a
-prints @code{a} to @code{cout} (representing lases by @code{'f'},
-trues by @code{'t'}, and using @code{'*'} as the replication marker).
-
-@end table
-
-@section BitString
-
-BitStrings are objects that contain arbitrary-length strings of
-zeroes and ones. BitStrings possess some features that make them
-behave like sets, and others that behave as strings. They are
-useful in applications (such as signature-based algorithms) where
-both capabilities are needed. Representational details are
-discussed in the Representation chapter. Most capabilities are
-exact analogs of those supported in the BitSet and String
-classes. A BitSubString is used with substring operations along
-the same lines as the String SubString class. A BitPattern class
-is used for masked bit pattern searching.
-
-Only a default constructor is supported. The declaration
-@code{BitString a;} initializes a to be an empty BitString.
-BitStrings may often be initialized via @code{atoBitString}
-and @code{longtoBitString}.
-
-Set operations (@code{ ~, complement, &, &=, |, |=, -, ^, ^=})
-behave just as the BitSet versions, except that there is no
-``virtual bit'': complementing complements only those bits in the
-BitString, and all binary operations across unequal length
-BitStrings assume a virtual bit of zero. The @code{&} operation
-returns a BitString with a length equal to the minimum length of
-the operands, and @code{|, ^} return one with length of the
-maximum.
-
-Set-based relational operations (@code{==, !=, <=, <, >=, >})
-follow the same rules. A string-like lexicographic comparison
-function, @code{lcompare}, tests the lexicographic relation between
-two BitStrings. For example, lcompare(1100, 0101) returns 1,
-since the first BitString starts with 1 and the second with 0.
-
-Individual bit setting, testing, and iterator operations
-(@code{set, clear, invert, test, first, next, last, prev})
-are also like those for BitSets. BitStrings are automatically
-expanded when setting bits at positions greater than their
-current length.
-
-The string-based capabilities are just as those for class String.
-BitStrings may be concatenated (@code{+, +=}), searched
-(@code{index, contains, matches}), and extracted into
-BitSubStrings (@code{before, at, after}) which may be assigned and
-otherwise manipulated. Other string-based utility functions
-(@code{reverse, common_prefix, common_suffix}) are also provided.
-These have the same capabilities and descriptions as those
-for Strings.
-
-String-oriented operations can also be performed with a mask via
-class BitPattern. BitPatterns consist of two BitStrings, a
-pattern and a mask. On searching and matching, bits in the pattern
-that correspond to 0 bits in the mask are ignored. (The mask may
-be shorter than the pattern, in which case trailing mask bits are
-assumed to be 0). The pattern and mask are both public variables,
-and may be individually subjected to other bit operations.
-
-Converting to char* and printing (@code{(atoBitString,
-atoBitPattern, printon, ostream <<)}) are also as in BitSets,
-except that no virtual bit is used, and an 'X' in a BitPattern means
-that the pattern bit is masked out.
-
-The following features are unique to BitStrings.
-
-Assume declarations of BitString a = atoBitString("01010110") and b =
-atoBitSTring("1101").
-
-@table @code
-
-@item a = b + c;
-Sets a to the concatenation of b and c;
-
-@item a = b + 0; a = b + 1;
-sets a to b, appended with a zero (one).
-
-@item a += b;
-appends b to a;
-
-@item a += 0; a += 1;
-appends a zero (one) to a.
-
-@item a << 2; a <<= 2
-return a with 2 zeros prepended, setting a to 0001010110. (Note
-the necessary confusion of << and >> operators. For consistency
-with the integer versions, << shifts low bits to high, even though
-they are printed low bits first.)
-
-@item a >> 3; a >>= 3
-return a with the first 3 bits deleted, setting a to 10110.
-
-@item a.left_trim(0)
-deletes all 0 bits on the left of a, setting a to 1010110.
-
-@item a.right_trim(0)
-deletes all trailing 0 bits of a, setting a to 0101011.
-
-@item cat(x, y, z)
-A faster way to say z = x + y.
-
-@item diff(x, y, z)
-A faster way to say z = x - y.
-
-@item and(x, y, z)
-A faster way to say z = x & y.
-
-@item or(x, y, z)
-A faster way to say z = x | y.
-
-@item xor(x, y, z)
-A faster way to say z = x ^ y.
-
-@item lshift(x, y, z)
-A faster way to say z = x << y.
-
-@item rshift(x, y, z)
-A faster way to say z = x >> y.
-
-@item complement(x, z)
-A faster way to say z = ~x.
-
-@end table
-
-
-@node Random, Data, Bit, Top
-@chapter Random Number Generators and related classes
-
-The two classes @code{RNG} and @code{Random} are used together to
-generate a variety of random number distributions. A distinction must
-be made between @emph{random number generators}, implemented by class
-@code{RNG}, and @emph{random number distributions}. A random number
-generator produces a series of randomly ordered bits. These bits can be
-used directly, or cast to other representations, such as a floating
-point value. A random number generator should produce a @emph{uniform}
-distribution. A random number distribution, on the other hand, uses the
-randomly generated bits of a generator to produce numbers from a
-distribution with specific properties. Each instance of @code{Random}
-uses an instance of class @code{RNG} to provide the raw, uniform
-distribution used to produce the specific distribution. Several
-instances of @code{Random} classes can share the same instance of
-@code{RNG}, or each instance can use its own copy.
-
-@section RNG
-
-Random distributions are constructed from members of class @code{RNG},
-the actual random number generators. The @code{RNG} class contains no
-data; it only serves to define the interface to random number
-generators. The @code{RNG::asLong} member returns an unsigned long
-(typically 32 bits) of random bits. Applications that require a number
-of random bits can use this directly. More often, these random bits are
-transformed to a uniform random number:
-
-@smallexample
- //
- // Return random bits converted to either a float or a double
- //
- float asFloat();
- double asDouble();
-@};
-@end smallexample
-
-@noindent
-using either @code{asFloat} or @code{asDouble}. It is intended that
-@code{asFloat} and @code{asDouble} return differing precisions;
-typically, @code{asDouble} will draw two random longwords and transform
-them into a legal @code{double}, while @code{asFloat} will draw a single
-longword and transform it into a legal @code{float}. These members are
-used by subclasses of the @code{Random} class to implement a variety of
-random number distributions.
-
-@section ACG
-
-Class @code{ACG} is a variant of a Linear Congruential Generator
-(Algorithm M) described in Knuth, @emph{Art of Computer Programming, Vol
-III}. This result is permuted with a Fibonacci Additive Congruential
-Generator to get good independence between samples. This is a very high
-quality random number generator, although it requires a fair amount of
-memory for each instance of the generator.
-
-The @code{ACG::ACG} constructor takes two parameters: the seed and the
-size. The seed is any number to be used as an initial seed. The
-performance of the generator depends on having a distribution of bits
-through the seed. If you choose a number in the range of 0 to 31, a
-seed with more bits is chosen. Other values are deterministically
-modified to give a better distribution of bits. This provides a good
-random number generator while still allowing a sequence to be repeated
-given the same initial seed.
-
-The @code{size} parameter determines the size of two tables used in the
-generator. The first table is used in the Additive Generator; see the
-algorithm in Knuth for more information. In general, this table is
-@code{size} longwords long. The default value, used in the algorithm in
-Knuth, gives a table of 220 bytes. The table size affects the period of
-the generators; smaller values give shorter periods and larger tables
-give longer periods. The smallest table size is 7 longwords, and the
-longest is 98 longwords. The @code{size} parameter also determines the
-size of the table used for the Linear Congruential Generator. This value
-is chosen implicitly based on the size of the Additive Congruential
-Generator table. It is two powers of two larger than the power of two
-that is larger than @code{size}. For example, if @code{size} is 7, the
-ACG table is 7 longwords and the LCG table is 128 longwords. Thus, the
-default size (55) requires 55 + 256 longwords, or 1244 bytes. The
-largest table requires 2440 bytes and the smallest table requires 100
-bytes. Applications that require a large number of generators or
-applications that aren't so fussy about the quality of the generator may
-elect to use the @code{MLCG} generator.
-
-@section MLCG
-
-The @code{MLCG} class implements a @emph{Multiplicative Linear
-Congruential Generator}. In particular, it is an implementation of the
-double MLCG described in @emph{``Efficient and Portable Combined Random
-Number Generators''} by Pierre L'Ecuyer, appearing in
-@emph{Communications of the ACM, Vol. 31. No. 6}. This generator has a
-fairly long period, and has been statistically analyzed to show that it
-gives good inter-sample independence.
-
-The @code{MLCG::MLCG} constructor has two parameters, both of which are
-seeds for the generator. As in the @code{MLCG} generator, both seeds are
-modified to give a ``better'' distribution of seed digits. Thus, you can
-safely use values such as `0' or `1' for the seeds. The @code{MLCG}
-generator used much less state than the @code{ACG} generator; only two
-longwords (8 bytes) are needed for each generator.
-
-@section Random
-
-A random number generator may be declared by first declaring a
-@code{RNG} and then a @code{Random}. For example, @code{ACG gen(10, 20);
-NegativeExpntl rnd (1.0, &gen);} declares an additive congruential
-generator with seed 10 and table size 20, that is used to generate
-exponentially distributed values with mean of 1.0.
-
-The virtual member @code{Random::operator()} is the common way of
-extracting a random number from a particular distribution. The base
-class, @code{Random} does not implement @code{operator()}. This is
-performed by each of the subclasses. Thus, given the above declaration
-of @code{rnd}, new random values may be obtained via, for example,
-@code{double next_exp_rand = rnd();} Currently, the following subclasses
-are provided.
-
-@section Binomial
-
-The binomial distribution models successfully drawing items from
-a pool. The first parameter to the constructor, @code{n}, is the
-number of items in the pool, and the second parameter, @code{u},
-is the probability of each item being successfully drawn. The
-member @code{asDouble} returns the number of samples drawn from
-the pool. Although it is not checked, it is assumed that
-@code{n>0} and @code{0 <= u <= 1}. The remaining members allow
-you to read and set the parameters.
-
-@section Erlang
-
-The @code{Erlang} class implements an Erlang distribution with
-mean @code{mean} and variance @code{variance}.
-
-@section Geometric
-
-The @code{Geometric} class implements a discrete geometric
-distribution. The first parameter to the constructor,
-@code{mean}, is the mean of the distribution. Although it is not
-checked, it is assumed that @code{0 <= mean <= 1}.
-@code{Geometric()} returns the number of uniform random samples
-that were drawn before the sample was larger than @code{mean}.
-This quantity is always greater than zero.
-
-@section HyperGeometric
-
-The @code{HyperGeometric} class implements the hypergeometric
-distribution. The first parameter to the constructor,
-@code{mean}, is the mean and the second, @code{variance}, is the
-variance. The remaining members allow you to inspect and change
-the mean and variance.
-
-@section NegativeExpntl
-
-The @code{NegativeExpntl} class implements the negative
-exponential distribution. The first parameter to the constructor
-is the mean. The remaining members allow you to inspect and
-change the mean.
-
-@section Normal
-
-The @code{Normal}class implements the normal distribution. The
-first parameter to the constructor, @code{mean}, is the mean and
-the second, @code{variance}, is the variance. The remaining
-members allow you to inspect and change the mean and variance.
-The @code{LogNormal} class is a subclass of @code{Normal}.
-
-@section LogNormal
-
-The @code{LogNormal}class implements the logarithmic normal
-distribution. The first parameter to the constructor,
-@code{mean}, is the mean and the second, @code{variance}, is the
-variance. The remaining members allow you to inspect and change
-the mean and variance. The @code{LogNormal} class is a subclass
-of @code{Normal}.
-
-@section Poisson
-
-The @code{Poisson} class implements the poisson distribution.
-The first parameter to the constructor is the mean. The
-remaining members allow you to inspect and change the mean.
-
-@section DiscreteUniform
-
-The @code{DiscreteUniform} class implements a uniform random variable over
-the closed interval ranging from @code{[low..high]}. The first parameter
-to the constructor is @code{low}, and the second is @code{high}, although
-the order of these may be reversed. The remaining members allow you to
-inspect and change @code{low} and @code{high}.
-
-@section Uniform
-
-The @code{Uniform} class implements a uniform random variable over the
-open interval ranging from @code{[low..high)}. The first parameter to
-the constructor is @code{low}, and the second is @code{high}, although
-the order of these may be reversed. The remaining members allow you to
-inspect and change @code{low} and @code{high}.@refill
-
-@section Weibull
-
-The @code{Weibull} class implements a weibull distribution with
-parameters @code{alpha} and @code{beta}. The first parameter to
-the class constructor is @code{alpha}, and the second parameter
-is @code{beta}. The remaining members allow you to inspect and
-change @code{alpha} and @code{beta}.
-
-@section RandomInteger
-
-The @code{RandomInteger} class is @emph{not} a subclass of Random,
-but a stand-alone integer-oriented class that is dependent on the
-RNG classes. RandomInteger returns random integers uniformly from
-the closed interval @code{[low..high]}. The first parameter to the
-constructor is @code{low}, and the second is @code{high}, although
-both are optional. The last argument is always a generator.
-Additional members allow you to inspect and change @code{low} and
-@code{high}. Random integers are generated using @code{asInt()} or
-@code{asLong()}. Operator syntax (@code{()}) is also available as a
-shorthand for @code{asLong()}. Because @code{RandomInteger} is often
-used in simulations for which uniform random integers are desired over
-a variety of ranges, @code{asLong()} and @code{asInt} have @code{high}
-as an optional argument. Using this optional argument produces a
-single value from the new range, but does not change the default
-range.
-
-
-@node Data, Curses, Random, Top
-@chapter Data Collection
-Libg++ currently provides two classes for @emph{data collection}
-and analysis of the collected data.
-
-@section SampleStatistic
-
-Class @code{SampleStatistic} provides a means of accumulating
-samples of @code{double} values and providing common sample statistics.
-
-Assume declaration of @code{double x}.
-
-@table @code
-
-@item SampleStatistic a;
-declares and initializes a.
-
-@item a.reset();
-re-initializes a.
-
-@item a += x;
-adds sample x.
-
-@item int n = a.samples();
-returns the number of samples.
-
-@item x = a.mean;
-returns the means of the samples.
-
-@item x = a.var()
-returns the sample variance of the samples.
-
-@item x = a.stdDev()
-returns the sample standard deviation of the samples.
-
-@item x = a.min()
-returns the minimum encountered sample.
-
-@item x = a.max()
-returns the maximum encountered sample.
-
-@item x = a.confidence(int p)
-returns the p-percent (0 <= p < 100) confidence interval.
-
-@item x = a.confidence(double p)
-returns the p-probability (0 <= p < 1) confidence interval.
-
-
-@end table
-
-@section SampleHistogram
-
-Class @code{SampleHistogram} is a derived class of
-@code{SampleStatistic} that supports collection and display of samples
-in bucketed intervals. It supports the following in addition to
-@code{SampleStatisic} operations.
-
-@table @code
-
-@item SampleHistogram h(double lo, double hi, double width);
-declares and initializes h to have buckets of size width from lo to hi.
-If the optional argument width is not specified, 10 buckets are
-created. The first bucket and also holds samples less than lo,
-and the last one holds samples greater than hi.
-
-@item int n = h.similarSamples(x)
-returns the number of samples in the same bucket as x.
-
-@item int n = h.inBucket(int i)
-returns the number of samples in bucket i.
-
-@item int b = h.buckets()
-returns the number of buckets.
-
-@item h.printBuckets(ostream s)
-prints bucket counts on ostream s.
-
-@item double bound = h.bucketThreshold(int i)
-returns the upper bound of bucket i.
-
-
-@end table
-
-@node Curses, List, Data, Top
-@chapter Curses-based classes
-
-The @code{CursesWindow} class is a repackaging of standard
-curses library features into a class. It relies on @file{curses.h}.
-
-The supplied @file{curses.h} is a fairly conservative declaration
-of curses library features, and does not include features like
-``screen'' or X-window support. It is, for the most part, an
-adaptation, rather than an improvement of C-based @file{curses.h}
-files. The only substantive changes are the declarations of
-many functions as inline functions rather than macros, which
-was done solely to allow overloading.
-
-The @code{CursesWindow} class encapsulates curses window functions
-within a class. Only those functions that control windows are included:
-Terminal control functions and macros like @code{cbreak} are not part
-of the class. All @code{CursesWindows} member functions have names
-identical to the corresponding curses library functions, except that the
-``w'' prefix is generally dropped. Descriptions of these functions may
-be found in your local curses library documentation.
-
-A @code{CursesWindow} may be declared via
-
-@table @code
-
-@item CursesWindow w(WINDOW* win)
-attaches w to the existing WINDOW* win. This is constructor is normally
-used only in the following special case.
-
-@item CursesWindow w(stdscr)
-attaches w to the default curses library standard screen window.
-
-@item CursesWindow w(int lines, int cols, int begin_y, int begin_x)
-attaches to an allocated curses window with the indicated size and
-screen position.
-
-@item CursesWindow sub(CursesWindow& w,int l,int c,int by,int bx,char ar='a')
-attaches to a subwindow of w created via the curses `subwin' command.
-If ar is sent as `r', the origin (by, bx) is relative to the parent
-window, else it is absolute.
-
-@end table
-
-The class maintains a static counter that is used in order to
-automatically call the curses library @code{initscr} and @code{endscr}
-functions at the proper times. These need not, and should not be
-called ``manually''.
-
-@code{CursesWindow}s maintain a tree of their subwindows. Upon
-destruction of a @code{CursesWindow}, all of their subwindows are
-also invalidated if they had not previously been destroyed.
-
-It is possible to traverse trees of subwindows via the following
-member functions
-
-@table @code
-
-@item CursesWindow* w.parent()
-returns a pointer to the parent of the subwindow, or 0 if there is none.
-
-@item CursesWindow* w.child()
-returns the first child subwindow of the window, or 0 if there is none.
-
-@item CursesWindow* w.sibling()
-returns the next sibling of the subwindow, or 0 if there is none.
-
-@end table
-
-For example, to call some function @code{visit} for all subwindows
-of a window, you could write
-
-@example
-
-void traverse(CursesWindow& w)
-@{
- visit(w);
- if (w.child() != 0) traverse(*w.child);
- if (w.sibling() != 0) traverse(*w.sibling);
-@}
-
-@end example
-
-@node List, LinkList, Curses, Top
-@chapter List classes
-
-The files @file{g++-include/List.hP} and @file{g++-include/List.ccP}
-provide pseudo-generic Lisp-type List classes. These lists are homogeneous
-lists, more similar to lists in statically typed functional languages like
-ML than Lisp, but support operations very similar to those found in Lisp.
-Any particular kind of list class may be generated via the @code{genclass}
-shell command. However, the implementation assumes that the base class
-supports an equality operator @code{==}. All equality tests use the
-@code{==} operator, and are thus equivalent to the use of @code{equal}, not
-@code{eq} in Lisp.@refill
-
-All list nodes are created dynamically, and managed via reference counts.
-@code{List} variables are actually pointers to these list nodes.
-Lists may also be traversed via Pixes, as described in the section
-describing Pixes. @xref{Pix}
-
-Supported operations are mirrored closely after those in Lisp. Generally,
-operations with functional forms are constructive, functional operations,
-while member forms (often with the same name) are sometimes
-procedural, possibly destructive operations.
-
-As with Lisp, destructive operations are supported. Programmers
-are allowed to change head and tail fields in any fashion, creating
-circular structures and the like. However, again as with Lisp, some
-operations implicitly assume that they are operating on pure lists, and
-may enter infinite loops when presented with improper lists. Also, the
-reference-counting storage management facility may fail to reclaim
-unused circularly-linked nodes.
-
-Several Lisp-like higher order functions are supported (e.g., @code{map}).
-Typedef declarations for the required functional forms are provided
-int the @file{.h} file.
-
-For purposes of illustration, assume the specification of class
-@code{intList}. Common Lisp versions of supported operations are shown
-in brackets for comparison purposes.
-
-@section Constructors and assignment
-
-@table @code
-
-@item intList a; [ (setq a nil) ]
-Declares a to be a nil intList.
-
-@item intList b(2); [ (setq b (cons 2 nil)) ]
-Declares b to be an intList with a head value of 2, and a nil tail.
-
-@item intList c(3, b); [ (setq c (cons 3 b)) ]
-Declares c to be an intList with a head value of 3, and b as its tail.
-
-@item b = a; [ (setq b a) ]
-Sets b to be the same list as a.
-
-@end table
-
-Assume the declarations of intLists a, b, and c in the following.
-@xref{Pix}.
-
-@section List status
-
-@table @code
-
-@item a.null(); OR !a; [ (null a) ]
-returns true if a is null.
-
-@item a.valid(); [ (listp a) ]
-returns true if a is non-null. Inside a conditional test, the
-@code{void*} coercion may also be used as in @code{if (a) ...}.
-
-@item intList(); [ nil ]
-intList() may be used to null terminate a list, as in
-@code{intList f(int x) @{if (x == 0) return intList(); ... @} }.
-
-@item a.length(); [ (length a) ]
-returns the length of a.
-
-@item a.list_length(); [ (list-length a) ]
-returns the length of a, or -1 if a is circular.
-@end table
-
-@section heads and tails
-
-@table @code
-
-@item a.get(); OR a.head() [ (car a) ]
-returns a reference to the head field.
-
-@item a[2]; [ (elt a 2) ]
-returns a reference to the second (counting from zero) head field.
-
-@item a.tail(); [ (cdr a) ]
-returns the intList that is the tail of a.
-
-@item a.last(); [ (last a) ]
-returns the intList that is the last node of a.
-
-@item a.nth(2); [ (nth a 2) ]
-returns the intList that is the nth node of a.
-
-@item a.set_tail(b); [ (rplacd a b) ]
-sets a's tail to b.
-
-@item a.push(2); [ (push 2 a) ]
-equivalent to a = intList(2, a);
-
-@item int x = a.pop() [ (setq x (car a)) (pop a) ]
-returns the head of a, also setting a to its tail.
-
-@end table
-
-@section Constructive operations
-
-@table @code
-
-@item b = copy(a); [ (setq b (copy-seq a)) ]
-sets b to a copy of a.
-
-@item b = reverse(a); [ (setq b (reverse a)) ]
-Sets b to a reversed copy of a.
-
-@item c = concat(a, b); [ (setq c (concat a b)) ]
-Sets c to a concatenated copy of a and b.
-
-@item c = append(a, b); [ (setq c (append a b)) ]
-Sets c to a concatenated copy of a and b. All nodes of a are
-copied, with the last node pointing to b.
-
-@item b = map(f, a); [ (setq b (mapcar f a)) ]
-Sets b to a new list created by applying function f to each node
-of a.
-
-@item c = combine(f, a, b);
-Sets c to a new list created by applying function f to successive
-pairs of a and b. The resulting list has length the shorter of a
-and b.
-
-@item b = remove(x, a); [ (setq b (remove x a)) ]
-Sets b to a copy of a, omitting all occurrences of x.
-
-@item b = remove(f, a); [ (setq b (remove-if f a)) ]
-Sets b to a copy of a, omitting values causing function f to
-return true.
-
-@item b = select(f, a); [ (setq b (remove-if-not f a)) ]
-Sets b to a copy of a, omitting values causing function f to
-return false.
-
-@item c = merge(a, b, f); [ (setq c (merge a b f)) ]
-Sets c to a list containing the ordered elements (using the
-comparison function f) of the sorted lists a and b.
-
-@end table
-
-@section Destructive operations
-
-@table @code
-
-@item a.append(b); [ (rplacd (last a) b) ]
-appends b to the end of a. No new nodes are constructed.
-
-@item a.prepend(b); [ (setq a (append b a)) ]
-prepends b to the beginning of a.
-
-@item a.del(x); [ (delete x a) ]
-deletes all nodes with value x from a.
-
-@item a.del(f); [ (delete-if f a) ]
-deletes all nodes causing function f to return true.
-
-@item a.select(f); [ (delete-if-not f a) ]
-deletes all nodes causing function f to return false.
-
-@item a.reverse(); [ (nreverse a) ]
-reverses a in-place.
-
-@item a.sort(f); [ (sort a f) ]
-sorts a in-place using ordering (comparison) function f.
-
-@item a.apply(f); [ (mapc f a) ]
-Applies void function f (int x) to each element of a.
-
-@item a.subst(int old, int repl); [ (nsubst repl old a) ]
-substitutes repl for each occurrence of old in a. Note the
-different argument order than the Lisp version.
-
-@end table
-
-@section Other operations
-
-@table @code
-
-@item a.find(int x); [ (find x a) ]
-returns the intList at the first occurrence of x.
-
-@item a.find(b); [ (find b a) ]
-returns the intList at the first occurrence of sublist b.
-
-@item a.contains(int x); [ (member x a) ]
-returns true if a contains x.
-
-@item a.contains(b); [ (member b a) ]
-returns true if a contains sublist b.
-
-@item a.position(int x); [ (position x a) ]
-returns the zero-based index of x in a, or -1 if x does not occur.
-
-@item int x = a.reduce(f, int base); [ (reduce f a :initial-value base) ]
-Accumulates the result of applying int function f(int, int) to
-successive elements of a, starting with base.
-
-@end table
-
-
-@node LinkList, Vector, List, Top
-@chapter Linked Lists
-
-SLLists provide pseudo-generic singly linked lists. DLLists provide
-doubly linked lists. The lists are designed for the simple maintenance
-of elements in a linked structure, and do not provide the more extensive
-operations (or node-sharing) of class @code{List}. They behave similarly
-to the @code{slist} and similar classes described by Stroustrup.@refill
-
-All list nodes are created dynamically. Assignment is performed via
-copying.
-
-Class @code{DLList} supports all @code{SLList} operations, plus
-additional operations described below.
-
-For purposes of illustration, assume the specification of class
-@code{intSLList}. In addition to the operations listed here,
-SLLists support traversal via Pixes. @xref{Pix}
-
-@table @code
-
-@item intSLList a;
-Declares a to be an empty list.
-
-@item intSLList b = a;
-Sets b to an element-by-element copy of a.
-
-@item a.empty()
-returns true if a contains no elements
-
-@item a.length();
-returns the number of elements in a.
-
-@item a.prepend(x);
-places x at the front of the list.
-
-@item a.append(x);
-places x at the end of the list.
-
-@item a.join(b)
-places all nodes from b to the end of a, simultaneously destroying b.
-
-@item x = a.front()
-returns a reference to the item stored at the head of the list,
-or triggers an error if the list is empty.
-
-@item a.rear()
-returns a reference to the rear of the list, or triggers an error if the
-list is empty.
-
-@item x = a.remove_front()
-deletes and returns the item stored at the head of the list.
-
-@item a.del_front()
-deletes the first element, without returning it.
-
-@item a.clear()
-deletes all items from the list.
-
-@item a.ins_after(Pix i, item);
-inserts item after position i. If i is null, insertion is at the front.
-
-@item a.del_after(Pix i);
-deletes the element following i. If i is 0, the first item is deleted.
-
-@end table
-
-@section Doubly linked lists
-
-Class @code{DLList} supports the following additional operations,
-as well as backward traversal via Pixes.
-
-@table @code
-
-@item x = a.remove_rear();
-deletes and returns the item stored at the rear of the list.
-
-@item a.del_rear();
-deletes the last element, without returning it.
-
-@item a.ins_before(Pix i, x)
-inserts x before the i.
-
-@item a.del(Pix& iint dir = 1)
-deletes the item at the current position, then advances forward
-if dir is positive, else backward.
-
-@end table
-
-@node Vector, Plex, LinkList, Top
-@chapter Vector classes
-
-The files @file{g++-include/Vec.ccP} and @file{g++-include/AVec.ccP}
-provide pseudo-generic standard array-based vector operations. The
-corresponding header files are @file{g++-include/Vec.hP} and
-@file{g++-include/AVec.hP}. Class @code{Vec} provides operations
-suitable for any base class that includes an equality operator. Subclass
-@code{AVec} provides additional arithmetic operations suitable for base
-classes that include the full complement of arithmetic operators.
-
-@code{Vecs} are constructed and assigned by copying. Thus, they should
-normally be passed by reference in applications programs.
-
-Several mapping functions are provided that allow programmers to
-specify operations on vectors as a whole.
-
-For illustrative purposes assume that classes @code{intVec} and
-@code{intAVec} have been generated via @code{genclass}.
-
-@section Constructors and assignment
-
-@table @code
-@item intVec a;
-declares a to be an empty vector. Its size may be changed via resize.
-
-@item intVec a(10);
-declares a to be an uninitialized vector of ten elements (numbered 0-9).
-
-@item intVec b(6, 0);
-declares b to be a vector of six elements, all initialized to zero. Any
-value can be used as the initial fill argument.
-
-@item a = b;
-Copies b to a. a is resized to be the same as b.
-
-@item a = b.at(2, 4)
-constructs a from the 4 elements of b starting at b[2].
-@end table
-
-Assume declarations of @code{intVec a, b, c} and @code{int i, x} in
-the following.
-
-@section Status and access
-
-@table @code
-@item a.capacity();
-returns the number of elements that can be held in a.
-
-@item a.resize(20);
-sets a's length to 20. All elements are unchanged, except that if
-the new size is smaller than the original, than trailing elements
-are deleted, and if greater, trailing elements are uninitialized.
-
-@item a[i];
-returns a reference to the i'th element of a, or produces an error
-if i is out of range.
-
-@item a.elem(i)
-returns a reference to the i'th element of a. Unlike the @code{[]} operator,
-i is not checked to ensure that it is within range.
-
-@item a == b;
-returns true if a and b contain the same elements in the same order.
-
-@item a != b;
-is the converse of a == b.
-@end table
-
-@section Constructive operations
-
-@table @code
-@item c = concat(a, b);
-sets c to the new vector constructed from all of the elements of
-a followed by all of b.
-
-@item c = map(f, a);
-sets c to the new vector constructed by applying int function f(int)
-to each element of a.
-
-@item c = merge(a, b, f);
-sets c to the new vector constructed by merging the elements of
-ordered vectors a and b using ordering (comparison) function f.
-
-@item c = combine(f, a, b);
-sets c to the new vector constructed by applying int function f(int, int)
-to successive pairs of a and b. The result has length the shorter of
-a and b.
-
-@item c = reverse(a)
-sets c to a, with elements in reverse order.
-@end table
-
-@section Destructive operations
-
-@table @code
-@item a.reverse();
-reverses a in-place.
-
-@item a.sort(f)
-sorts a in-place using comparison function f. The sorting method is a
-variation of the quicksort functions supplied with GNU emacs.
-
-@item a.fill(0, 4, 2)
-fills the 2 elements starting at a[4] with zero.
-
-@end table
-
-@section Other operations
-
-@table @code
-
-@item a.apply(f)
-applies function f to each element in a.
-
-@item x = a.reduce(f, base)
-accumulates the results of applying function f to successive elements
-of a starting with base.
-
-@item a.index(int targ);
-returns the index of the leftmost occurrence of the target, or -1,
-if it does not occur.
-
-@item a.error(char* msg)
-invokes the error handler. The default version prints the error message,
-then aborts.
-@end table
-
-@section AVec operations.
-
-AVecs provide additional arithmetic operations. All vector-by-vector
-operators generate an error if the vectors are not the same length. The
-following operations are provided, for @code{AVecs a, b} and
-base element (scalar) @code{s}.
-
-@table @code
-@item a = b;
-Copies b to a. a and b must be the same size.
-
-@item a = s;
-fills all elements of a with the value s. a is not resized.
-
-@item a + s; a - s; a * s; a / s
-adds, subtracts, multiplies, or divides each element of a with the scalar.
-
-@item a += s; a -= s; a *= s; a /= s;
-adds, subtracts, multiplies, or divides the scalar into a.
-
-@item a + b; a - b; product(a, b), quotient(a, b)
-adds, subtracts, multiplies, or divides corresponding elements of a and b.
-
-@item a += b; a -= b; a.product(b); a.quotient(b);
-adds, subtracts, multiplies, or divides corresponding elements of b into a.
-
-@item s = a * b;
-returns the inner (dot) product of a and b.
-
-@item x = a.sum();
-returns the sum of elements of a.
-
-@item x = a.sumsq();
-returns the sum of squared elements of a.
-
-@item x = a.min();
-returns the minimum element of a.
-
-@item x = a.max();
-returns the maximum element of a.
-
-@item i = a.min_index();
-returns the index of the minimum element of a.
-
-@item i = a.max_index();
-returns the index of the maximum element of a.
-
-Note that it is possible to apply vector versions other arithmetic
-operators via the mapping functions. For example, to set vector b
-to the cosines of doubleVec a, use @code{b = map(cos, a);}.
-This is often more efficient than performing the operations
-in an element-by-element fashion.
-@end table
-
-@node Plex, Stack, Vector, Top
-@chapter Plex classes
-
-A ``Plex'' is a kind of array with the following properties:
-
-@itemize @bullet
-@item
-Plexes may have arbitrary upper and lower index bounds. For example
-a Plex may be declared to run from indices -10 .. 10.
-
-@item
-Plexes may be dynamically expanded at both the lower and upper bounds
-of the array in steps of one element.
-
-@item
-Only elements that have been specifically initialized or added may
-be accessed.
-
-@item
-Elements may be accessed via indices. Indices are always checked for
-validity at run time. Plexes may be traversed via simple variations of
-standard array indexing loops.
-
-@item
-Plex elements may be accessed and traversed via Pixes.
-
-@item
-Plex-to-Plex assignment and related operations on entire Plexes
-are supported.
-
-@item
-Plex classes contain methods to help programmers check the validity
-of indexing and pointer operations.
-
-@item
-Plexes form ``natural'' base classes for many restricted-access data
-structures relying on logically contiguous indices, such as array-based
-stacks and queues.
-
-@item
-Plexes are implemented as pseudo-generic classes, and must be generated
-via the @code{genclass} utility.
-@end itemize
-
-Four subclasses of Plexes are supported: A @code{FPlex} is a Plex that
-may only grow or shrink within declared bounds; an @code{XPlex} may
-dynamically grow or shrink without bounds; an @code{RPlex} is the
-same as an @code{XPlex} but better supports indexing with poor
-locality of reference; a @code{MPlex} may grow
-or shrink, and additionally allows the logical deletion and restoration
-of elements. Because these classes are virtual subclasses of the
-``abstract'' class @code{Plex}, it is possible to write user code
-such as @code{void f(Plex& a) ...} that operates on any kind of
-Plex. However, as with nearly any virtual class, specifying the
-particular Plex class being used results in more efficient code.
-
-Plexes are implemented as a linked list of @code{IChunks}. Each chunk
-contains a part of the array. Chunk sizes may be specified within Plex
-constructors. Default versions also exist, that use a @code{#define'd}
-default. Plexes grow by filling unused space in existing chunks, if
-possible, else, except for FPlexes, by adding another chunk. Whenever
-Plexes grow by a new chunk, the default element constructors (i.e.,
-those which take no arguments) for all chunk elements are called at
-once. When Plexes shrink, destructors for the elements are not called
-until an entire chunk is freed. For this reason, Plexes (like C++
-arrays) should only be used for elements with default constructors and
-destructors that have no side effects.
-
-Plexes may be indexed and used like arrays, although traversal
-syntax is slightly different. Even though Plexes maintain elements
-in lists of chunks, they are implemented so that iteration and
-other constructs that maintain locality of reference require very
-little overhead over that for simple array traversal
-Pix-based traversal is also supported. For example, for a plex, p,
-of ints, the following traversal methods could be used.
-
-@smallexample
-for (int i = p.low(); i < p.fence(); p.next(i)) use(p[i]);
-for (int i = p.high(); i > p.ecnef(); p.prev(i)) use(p[i]);
-for (Pix t = p.first(); t != 0; p.next(t)) use(p(i));
-for (Pix t = p.last(); t != 0; p.prev(t)) use(p(i));
-@end smallexample
-
-Except for MPlexes, simply using @code{++i} and @code{--i} works just as
-well as @code{p.next(i)} and @code{p.prev(i)} when traversing by index.
-Index-based traversal is generally a bit faster than Pix-based
-traversal.
-
-@code{XPlexes} and @code{MPlexes} are less than optimal for applications
-in which widely scattered elements are indexed, as might occur when
-using Plexes as hash tables or ``manually'' allocated linked lists.
-In such applications, @code{RPlexes} are often preferable. @code{RPlexes}
-use a secondary chunk index table that requires slightly greater,
-but entirely uniform overhead per index operation.
-
-Even though they may grow in either direction, Plexes are normally
-constructed so that their ``natural'' growth direction is upwards,
-in that default chunk construction leaves free space, if present,
-at the end of the plex. However, if the chunksize arguments to
-constructors are negative, they leave space at the beginning.
-
-All versions of Plexes support the following basic capabilities.
-(letting @code{Plex} stand for the type name constructed via the
-genclass utility (e.g., @code{intPlex}, @code{doublePlex})). Assume
-declarations of @code{Plex p, q}, @code{int i, j}, base element
-@code{x}, and Pix @code{pix}.
-
-@table @code
-
-@item Plex p;
-Declares p to be an initially zero-sized Plex with low index of zero,
-and the default chunk size. For FPlexes, chunk sizes represent maximum
-sizes.
-
-@item Plex p(int size);
-Declares p to be an initially zero-sized Plex with low index of zero,
-and the indicated chunk size. If size is negative, then the Plex
-is created with free space at the beginning of the Plex,
-allowing more efficient add_low() operations. Otherwise, it
-leaves space at the end.
-
-@item Plex p(int low, int size);
-Declares p to be an initially zero-sized Plex with low index of low,
-and the indicated chunk size.
-
-@item Plex p(int low, int high, Base initval, int size = 0);
-Declares p to be a Plex with indices from low to high, initially
-filled with initval, and the indicated chunk size if specified,
-else the default or (high - low + 1), whichever is greater.
-
-@item Plex q(p);
-Declares q to be a copy of p.
-
-@item p = q;
-Copies Plex q into p, deleting its previous contents.
-
-@item p.length()
-Returns the number of elements in the Plex.
-
-@item p.empty()
-Returns true if Plex p contains no elements.
-
-@item p.full()
-Returns true if Plex p cannot be expanded. This always returns
-false for XPlexes and MPlexes.
-
-@item p[i]
-Returns a reference to the i'th element of p. An exception (error) occurs
-if i is not a valid index.
-
-@item p.valid(i)
-Returns true if i is a valid index into Plex p.
-
-@item p.low(); p.high();
-Return the minimum (maximum) valid index of the Plex, or the high (low)
-fence if the plex is empty.
-
-@item p.ecnef(); p.fence();
-Return the index one position past the minimum (maximum) valid index.
-
-@item p.next(i); i = p.prev(i);
-Set i to the next (previous) index. This index may not be within bounds.
-
-@item p(pix)
-returns a reference to the item at Pix pix.
-
-@item pix = p.first(); pix = p.last();
-Return the minimum (maximum) valid Pix of the Plex, or 0
-if the plex is empty.
-
-@item p.next(pix); p.prev(pix);
-set pix to the next (previous) Pix, or 0 if there is none.
-
-@item p.owns(pix)
-Returns true if the Plex contains the element associated with pix.
-
-@item p.Pix_to_index(pix)
-If pix is a valid Pix to an element of the Plex,
-returns its corresponding index, else raises an exception.
-
-@item ptr = p.index_to_Pix(i)
-if i is a valid index, returns a the corresponding Pix.
-
-@item p.low_element(); p.high_element();
-Return a reference to the element at the minimum (maximum) valid index.
-An exception occurs if the Plex is empty.
-
-@item p.can_add_low(); p.can_add_high();
-Returns true if the plex can be extended one element downward (upward).
-These always return true for XPlex and MPlex.
-
-@item j = p.add_low(x); j = p.add_high(x);
-Extend the Plex by one element downward (upward). The new minimum
-(maximum) index is returned.
-
-@item j = p.del_low(); j = p.del_high()
-Shrink the Plex by one element on the low (high) end. The new
-minimum (maximum) element is returned. An exception occurs if the
-Plex is empty.
-
-@item p.append(q);
-Append all of Plex q to the high side of p.
-
-@item p.prepend(q);
-Prepend all of q to the low side of p.
-
-@item p.clear()
-Delete all elements, resetting p to a zero-sized Plex.
-
-@item p.reset_low(i);
-Resets p to be indexed starting at low() = i. For example.
-if p were initially declared via @code{Plex p(0, 10, 0)},
-and then re-indexed via @code{p.reset_low(5)},
-it could then be indexed from indices 5 .. 14.
-
-@item p.fill(x)
-sets all p[i] to x.
-
-@item p.fill(x, lo, hi)
-sets all of p[i] from lo to hi, inclusive, to x.
-
-@item p.reverse()
-reverses p in-place.
-
-@item p.chunk_size()
-returns the chunk size used for the plex.
-
-@item p.error(const char * msg)
-calls the resettable error handler.
-
-@end table
-
-MPlexes are plexes with bitmaps that allow items to be logically
-deleted and restored. They behave like other plexes, but
-also support the following additional and modified capabilities:
-
-@table @code
-
-@item p.del_index(i); p.del_Pix(pix)
-logically deletes p[i] (p(pix)). After deletion, attempts to access p[i]
-generate a error. Indexing via low(), high(), prev(),
-and next() skip the element. Deleting an element never changes the
-logical bounds of the plex.
-
-@item p.undel_index(i); p.undel_Pix(pix)
-logically undeletes p[i] (p(pix)).
-
-@item p.del_low(); p.del_high()
-Delete the lowest (highest) undeleted element, resetting the
-logical bounds of the plex to the next lowest (highest) undeleted
-index. Thus, MPlex del_low() and del_high() may shrink the bounds
-of the plex by more than one index.
-
-@item p.adjust_bounds()
-Resets the low and high bounds of the Plex to the indexes of
-the lowest and highest actual undeleted elements.
-
-@item int i = p.add(x)
-Adds x in an unused index, if possible, else performs add_high.
-
-@item p.count()
-returns the number of valid (undeleted) elements.
-
-@item p.available()
-returns the number of available (deleted) indices.
-
-@item int i = p.unused_index()
-returns the index of some deleted element, if one exists,
-else triggers an error. An unused element may be reused via undel.
-
-@item pix = p.unused_Pix()
-returns the pix of some deleted element, if one exists, else 0.
-An unused element may be reused via undel.
-
-@end table
-
-@node Stack, Queue, Plex, Top
-@chapter Stacks
-
-Stacks are declared as an ``abstract'' class. They are currently
-implemented in any of three ways.
-
-@table @code
-
-@item VStack
-implement fixed sized stacks via arrays.
-
-@item XPStack
-implement dynamically-sized stacks via XPlexes.
-
-@item SLStack
-implement dynamically-size stacks via linked lists.
-
-@end table
-
-All possess the same capabilities. They differ only in constructors.
-VStack constructors require a fixed maximum capacity argument.
-XPStack constructors optionally take a chunk size argument.
-SLStack constructors take no argument.
-
-Assume the declaration of a base element @code{x}.
-
-@table @code
-
-@item Stack s; or Stack s(int capacity)
-declares a Stack.
-
-@item s.empty()
-returns true if stack s is empty.
-
-@item s.full()
-returns true if stack s is full. XPStacks and SLStacks never become full.
-
-@item s.length()
-returns the current number of elements in the stack.
-
-@item s.push(x)
-pushes x on stack s.
-
-@item x = s.pop()
-pops and returns the top of stack
-
-@item s.top()
-returns a reference to the top of stack.
-
-@item s.del_top()
-pops, but does not return the top of stack. When large items are held
-on the stack it is often a good idea to use @code{top()} to inspect and use
-the top of stack, followed by a @code{del_top()}
-
-@item s.clear()
-removes all elements from the stack.
-
-@end table
-
-@node Queue, Deque, Stack, Top
-@chapter Queues
-
-Queues are declared as an ``abstract'' class. They are currently
-implemented in any of three ways.
-
-@table @code
-@item VQueue
-implement fixed sized Queues via arrays.
-
-@item XPQueue
-implement dynamically-sized Queues via XPlexes.
-
-@item SLQueue
-implement dynamically-size Queues via linked lists.
-@end table
-
-All possess the same capabilities; they differ only in constructors.
-@code{VQueue} constructors require a fixed maximum capacity argument.
-@code{XPQueue} constructors optionally take a chunk size argument.
-@code{SLQueue} constructors take no argument.
-
-Assume the declaration of a base element @code{x}.
-
-@table @code
-@item Queue q; or Queue q(int capacity);
-declares a queue.
-
-@item q.empty()
-returns true if queue q is empty.
-
-@item q.full()
-returns true if queue q is full. XPQueues and SLQueues are never full.
-
-@item q.length()
-returns the current number of elements in the queue.
-
-@item q.enq(x)
-enqueues x on queue q.
-
-@item x = q.deq()
-dequeues and returns the front of queue
-
-@item q.front()
-returns a reference to the front of queue.
-
-@item q.del_front()
-dequeues, but does not return the front of queue
-
-@item q.clear()
-removes all elements from the queue.
-@end table
-
-@node Deque, PQ, Queue, Top
-@chapter Double ended Queues
-
-Deques are declared as an ``abstract'' class. They are currently
-implemented in two ways.
-
-@table @code
-
-@item XPDeque
-implement dynamically-sized Deques via XPlexes.
-
-@item DLDeque
-implement dynamically-size Deques via linked lists.
-
-@end table
-
-All possess the same capabilities. They differ only in constructors.
-XPDeque constructors optionally take a chunk size argument.
-DLDeque constructors take no argument.
-
-Double-ended queues support both stack-like and queue-like capabilities:
-
-Assume the declaration of a base element @code{x}.
-
-@table @code
-
-@item Deque d; or Deque d(int initial_capacity)
-declares a deque.
-
-@item d.empty()
-returns true if deque d is empty.
-
-@item d.full()
-returns true if deque d is full.
-Always returns false in current implementations.
-
-@item d.length()
-returns the current number of elements in the deque.
-
-@item d.enq(x)
-inserts x at the rear of deque d.
-
-@item d.push(x)
-inserts x at the front of deque d.
-
-@item x = d.deq()
-dequeues and returns the front of deque
-
-@item d.front()
-returns a reference to the front of deque.
-
-@item d.rear()
-returns a reference to the rear of the deque.
-
-@item d.del_front()
-deletes, but does not return the front of deque
-
-@item d.del_rear()
-deletes, but does not return the rear of the deque.
-
-@item d.clear()
-removes all elements from the deque.
-
-@end table
-
-@node PQ, Set, Deque, Top
-@chapter Priority Queue class prototypes.
-
-Priority queues maintain collections of objects arranged for fast
-access to the least element.
-
-Several prototype implementations of priority queues are supported.
-
-@table @code
-
-@item XPPQs
-implement 2-ary heaps via XPlexes.
-
-@item SplayPQs
-implement PQs via Sleator and Tarjan's (JACM 1985)
-splay trees. The algorithms use a version of ``simple top-down
-splaying'' (described on page 669 of the article). The simple-splay
-mechanism for priority queue functions is loosely based on the one used
-by D. Jones in the C splay tree functions available from volume 14 of
-the uunet.uu.net archives.
-
-@item PHPQs
-implement pairing heaps (as described by Fredman and
-Sedgewick in @cite{Algorithmica}, Vol 1, p111-129). Storage for heap elements
-is managed via an internal freelist technique. The constructor allows an
-initial capacity estimate for freelist space. The storage is automatically
-expanded if necessary to hold new items. The deletion technique is a fast
-``lazy deletion'' strategy that marks items as deleted, without reclaiming
-space until the items come to the top of the heap.
-
-@end table
-
-All PQ classes support the following operations, for some PQ class
-@code{Heap}, instance @code{h}, @code{Pix ind}, and base class
-variable @code{x}.
-
-@table @code
-
-@item h.empty()
-returns true if there are no elements in the PQ.
-
-@item h.length()
-returns the number of elements in h.
-
-@item ind = h.enq(x)
-Places x in the PQ, and returns its index.
-
-@item x = h.deq()
-Dequeues the minimum element of the PQ into x, or generates an error
-if the PQ is empty.
-
-@item h.front()
-returns a reference to the minimum element.
-
-@item h.del_front()
-deletes the minimum element.
-
-@item h.clear();
-deletes all elements from h;
-
-@item h.contains(x)
-returns true if x is in h.
-
-@item h(ind)
-returns a reference to the item indexed by ind.
-
-@item ind = h.first()
-returns the Pix of first item in the PQ or 0 if empty.
-This need not be the Pix of the least element.
-
-@item h.next(ind)
-advances ind to the Pix of next element, or 0 if there are no more.
-
-@item ind = h.seek(x)
-Sets ind to the Pix of x, or 0 if x is not in h.
-
-@item h.del(ind)
-deletes the item with Pix ind.
-
-@end table
-
-@node Set, Bag, PQ, Top
-@chapter Set class prototypes
-
-Set classes maintain unbounded collections of items containing
-no duplicate elements.
-
-These are currently implemented in several ways, differing in
-representation strategy, algorithmic efficiency, and appropriateness for
-various tasks. (Listed next to each are average (followed by worst-case,
-if different) time complexities for [a] adding, [f] finding (via seek,
-contains), [d] deleting, elements, and [c] comparing (via ==, <=) and
-[m] merging (via |=, -=, &=) sets).
-
-@table @code
-@item XPSets
-implement unordered sets via XPlexes.
-([a O(n)], [f O(n)], [d O(n)], [c O(n^2)] [m O(n^2)]).
-
-@item OXPSets
-implement ordered sets via XPlexes.
-([a O(n)], [f O(log n)], [d O(n)], [c O(n)] [m O(n)]).
-
-@item SLSets
-implement unordered sets via linked lists
-([a O(n)], [f O(n)], [d O(n)], [c O(n^2)] [m O(n^2)]).
-
-@item OSLSets
-implement ordered sets via linked lists
-([a O(n)], [f O(n)], [d O(n)], [c O(n)] [m O(n)]).
-
-@item AVLSets
-implement ordered sets via threaded AVL trees
-([a O(log n)], [f O(log n)], [d O(log n)], [c O(n)] [m O(n)]).
-
-@item BSTSets
-implement ordered sets via binary search trees. The trees may
-be manually rebalanced via the O(n) @code{balance()} member function.
-([a O(log n)/O(n)], [f O(log n)/O(n)], [d O(log n)/O(n)], [c O(n)] [m O(n)]).
-
-@item SplaySets
-implement ordered sets via Sleator and Tarjan's (JACM 1985)
-splay trees. The algorithms use a version of ``simple top-down
-splaying'' (described on page 669 of the article).
-(Amortized: [a O(log n)], [f O(log n)], [d O(log n)], [c O(n)] [m O(n log n)]).
-
-@item VHSets
-implement unordered sets via hash tables.
-The tables are automatically resized when their capacity is exhausted.
-([a O(1)/O(n)], [f O(1)/O(n)], [d O(1)/O(n)], [c O(n)/O(n^2)] [m O(n)/O(n^2)]).
-
-@item VOHSets
-implement unordered sets via ordered hash tables
-The tables are automatically resized when their capacity is exhausted.
-([a O(1)/O(n)], [f O(1)/O(n)], [d O(1)/O(n)], [c O(n)/O(n^2)] [m O(n)/O(n^2)]).
-
-@item CHSets
-implement unordered sets via chained hash tables.
-([a O(1)/O(n)], [f O(1)/O(n)], [d O(1)/O(n)], [c O(n)/O(n^2)] [m O(n)/O(n^2)]).
-@end table
-
-The different implementations differ in whether their constructors
-require an argument specifying their initial capacity. Initial
-capacities are required for plex and hash table based Sets. If none is
-given @code{DEFAULT_INITIAL_CAPACITY} (from @file{<T>defs.h}) is
-used.@refill
-
-Sets support the following operations, for some class @code{Set},
-instances @code{a} and @code{b}, @code{Pix ind}, and base
-element @code{x}. Since all implementations are virtual derived classes
-of the @code{<T>Set} class, it is possible to mix and match operations
-across different implementations, although, as usual, operations
-are generally faster when the particular classes are specified
-in functions operating on Sets.
-
-Pix-based operations are more fully described in the section
-on Pixes. @xref{Pix}
-
-@table @code
-
-@item Set a; or Set a(int initial_size);
-Declares a to be an empty Set. The second version is allowed in
-set classes that require initial capacity or sizing specifications.
-
-@item a.empty()
-returns true if a is empty.
-
-@item a.length()
-returns the number of elements in a.
-
-@item Pix ind = a.add(x)
-inserts x into a, returning its index.
-
-@item a.del(x)
-deletes x from a.
-
-@item a.clear()
-deletes all elements from a;
-
-@item a.contains(x)
-returns true if x is in a.
-
-@item a(ind)
-returns a reference to the item indexed by ind.
-
-@item ind = a.first()
-returns the Pix of first item in the set or 0 if the Set is empty.
-For ordered Sets, this is the Pix of the least element.
-
-@item a.next(ind)
-advances ind to the Pix of next element, or 0 if there are no more.
-
-@item ind = a.seek(x)
-Sets ind to the Pix of x, or 0 if x is not in a.
-
-@item a == b
-returns true if a and b contain all the same elements.
-
-@item a != b
-returns true if a and b do not contain all the same elements.
-
-@item a <= b
-returns true if a is a subset of b.
-
-@item a |= b
-Adds all elements of b to a.
-
-@item a -= b
-Deletes all elements of b from a.
-
-@item a &= b
-Deletes all elements of a not occurring in b.
-
-@end table
-
-
-@node Bag, Map, Set, Top
-@chapter Bag class prototypes
-
-Bag classes maintain unbounded collections of items potentially
-containing duplicate elements.
-
-These are currently implemented in several ways, differing in
-representation strategy, algorithmic efficiency, and appropriateness for
-various tasks. (Listed next to each are average (followed by worst-case,
-if different) time complexities for [a] adding, [f] finding (via seek,
-contains), [d] deleting elements).
-
-
-@table @code
-
-@item XPBags
-implement unordered Bags via XPlexes.
-([a O(1)], [f O(n)], [d O(n)]).
-
-@item OXPBags
-implement ordered Bags via XPlexes.
-([a O(n)], [f O(log n)], [d O(n)]).
-
-@item SLBags
-implement unordered Bags via linked lists
-([a O(1)], [f O(n)], [d O(n)]).
-
-@item OSLBags
-implement ordered Bags via linked lists
-([a O(n)], [f O(n)], [d O(n)]).
-
-@item SplayBags
-implement ordered Bags via Sleator and Tarjan's (JACM 1985)
-splay trees. The algorithms use a version of ``simple top-down
-splaying'' (described on page 669 of the article).
-(Amortized: [a O(log n)], [f O(log n)], [d O(log n)]).
-
-@item VHBags
-implement unordered Bags via hash tables.
-The tables are automatically resized when their capacity is exhausted.
-([a O(1)/O(n)], [f O(1)/O(n)], [d O(1)/O(n)]).
-
-@item CHBags
-implement unordered Bags via chained hash tables.
-([a O(1)/O(n)], [f O(1)/O(n)], [d O(1)/O(n)]).
-
-@end table
-
-The implementations differ in whether their constructors
-require an argument to specify their initial capacity. Initial
-capacities are required for plex and hash table based Bags. If none is
-given @code{DEFAULT_INITIAL_CAPACITY} (from @file{<T>defs.h}) is used.@refill
-
-Bags support the following operations, for some class @code{Bag},
-instances @code{a} and @code{b}, @code{Pix ind}, and base
-element @code{x}. Since all implementations are virtual derived classes
-of the @code{<T>Bag} class, it is possible to mix and match operations
-across different implementations, although, as usual, operations
-are generally faster when the particular classes are specified
-in functions operating on Bags.
-
-Pix-based operations are more fully described in the section
-on Pixes. @xref{Pix}
-
-@table @code
-
-@item Bag a; or Bag a(int initial_size)
-Declares a to be an empty Bag. The second version is allowed in
-Bag classes that require initial capacity or sizing specifications.
-
-@item a.empty()
-returns true if a is empty.
-
-@item a.length()
-returns the number of elements in a.
-
-@item ind = a.add(x)
-inserts x into a, returning its index.
-
-@item a.del(x)
-deletes one occurrence of x from a.
-
-@item a.remove(x)
-deletes all occurrences of x from a.
-
-@item a.clear()
-deletes all elements from a;
-
-@item a.contains(x)
-returns true if x is in a.
-
-@item a.nof(x)
-returns the number of occurrences of x in a.
-
-@item a(ind)
-returns a reference to the item indexed by ind.
-
-@item int = a.first()
-returns the Pix of first item in the Bag or 0 if the Bag is empty.
-For ordered Bags, this is the Pix of the least element.
-
-@item a.next(ind)
-advances ind to the Pix of next element, or 0 if there are no more.
-
-@item ind = a.seek(x, Pix from = 0)
-Sets ind to the Pix of the next occurrence x, or 0 if there are none.
-If from is 0, the first occurrence is returned, else the following from.
-
-@end table
-
-@node Map, GetOpt, Bag, Top
-@chapter Map Class Prototypes
-
-Maps support associative array operations (insertion, deletion, and
-membership of records based on an associated key). They require
-the specification of two types, the key type and the contents type.
-
-These are currently implemented in several ways, differing in
-representation strategy, algorithmic efficiency, and appropriateness for
-various tasks. (Listed next to each are average (followed by worst-case,
-if different) time complexities for [a] accessing (via op [],
-contains), [d] deleting elements).
-
-
-@table @code
-
-@item AVLMaps
-implement ordered Maps via threaded AVL trees
-([a O(log n)], [d O(log n)]).
-
-@item RAVLMaps
-Similar, but also maintain ranking information, used via
-@code{ranktoPix(int r)}, that returns the @code{Pix} of the
-item at rank r, and @code{rank(key)} that returns the
-rank of the corresponding item.
-([a O(log n)], [d O(log n)]).
-
-@item SplayMaps
-implement ordered Maps via Sleator and Tarjan's (JACM 1985)
-splay trees. The algorithms use a version of ``simple top-down
-splaying'' (described on page 669 of the article).
-(Amortized: [a O(log n)], [d O(log n)]).
-
-@item VHMaps
-implement unordered Maps via hash tables.
-The tables are automatically resized when their capacity is exhausted.
-([a O(1)/O(n)], [d O(1)/O(n)]).
-
-@item CHMaps
-implement unordered Maps via chained hash tables.
-([a O(1)/O(n)], [d O(1)/O(n)]).
-
-@end table
-
-The different implementations differ in whether their constructors
-require an argument specifying their initial capacity. Initial
-capacities are required for hash table based Maps. If none is
-given @code{DEFAULT_INITIAL_CAPACITY} (from @file{<T>defs.h}) is
-used.@refill
-
-All Map classes share the following operations (for some Map class,
-@code{Map} instance @code{d}, @code{Pix ind} and key variable @code{k},
-and contents variable @code{x}).
-
-Pix-based operations are more fully described in the section
-on Pixes. @xref{Pix}
-
-@table @code
-
-@item Map d(x); Map d(x, int initial_capacity)
-Declare d to be an empty Map. The required argument, x, specifies
-the default contents, i.e., the contents of an otherwise
-uninitialized location. The second version, specifying
-initial capacity is allowed for Maps with an initial capacity
-argument.
-
-@item d.empty()
-returns true if d contains no items.
-
-@item d.length()
-returns the number of items in d.
-
-@item d[k]
-returns a reference to the contents of item with key k. If no
-such item exists, it is installed with the default contents.
-Thus d[k] = x installs x, and x = d[k] retrieves it.
-
-@item d.contains(k)
-returns true if an item with key field k exists in d.
-
-@item d.del(k)
-deletes the item with key k.
-
-@item d.clear()
-deletes all items from the table.
-
-@item x = d.dflt()
-returns the default contents.
-
-@item k = d.key(ind)
-returns a reference to the key at Pix ind.
-
-@item x = d.contents(ind)
-returns a reference to the contents at Pix ind.
-
-@item ind = d.first()
-returns the Pix of the first element in d, or 0 if d is empty.
-
-@item d.next(ind)
-advances ind to the next element, or 0 if there are no more.
-
-@item ind = d.seek(k)
-returns the Pix of element with key k, or 0 if k is not in d.
-
-@end table
-
-@node GetOpt, Projects, Map, Top
-@chapter C++ version of the GNU getopt function
-
-The GetOpt class provides an efficient and structured mechanism for
-processing command-line options from an application program. The sample
-program fragment below illustrates a typical use of the GetOpt class
-for some hypothetical application program:
-
-@smallexample
-#include <stdio.h>
-#include <GetOpt.h>
-//...
-int debug_flag, compile_flag, size_in_bytes;
-
-int
-main (int argc, char **argv)
-@{
- // Invokes ctor `GetOpt (int argc, char **argv,
- // char *optstring);'
- GetOpt getopt (argc, argv, "dcs:");
- int option_char;
-
- // Invokes member function `int operator ()(void);'
- while ((option_char = getopt ()) != EOF)
- switch (option_char)
- @{
- case 'd': debug_flag = 1; break;
- case 'c': compile_flag = 1; break;
- case 's': size_in_bytes = atoi (getopt.optarg); break;
- case '?': fprintf (stderr,
- "usage: %s [dcs<size>]\n", argv[0]);
- @}
-@}
-@end smallexample
-
-Unlike the C library version, the libg++ GetOpt class uses its
-constructor to initialize class data members containing the argument
-count, argument vector, and the option string. This simplifies the
-interface for each subsequent call to member function @code{int operator
-()(void)}.
-
-The C version, on the other hand, uses hidden static variables to retain
-the option string and argument list values between calls to
-@code{getopt}. This complicates the @code{getopt} interface since the
-argument count, argument vector, and option string must be passed as
-parameters for each invocation. For the C version, the loop in the
-previous example becomes:
-
-@smallexample
- while ((option_char = getopt (argc, argv, "dcs:")) != EOF)
- // ...
-@end smallexample
-
-which requires extra overhead to pass the parameters for every call.
-
-Along with the GetOpt constructor and @code{int operator ()(void)},
-the other relevant elements of class GetOpt are:
-
-@table @code
-@item char *optarg
-Used for communication from @code{operator ()(void)} to the caller.
-When @code{operator ()(void)} finds an option that takes an argument, the
-argument value is stored here.
-@item int optind
-Index in @code{argv} of the next element to be scanned.
-This is used for communication to and from the caller
-and for communication between successive calls to @code{operator ()(void)}.
-
-When @code{operator ()(void)} returns EOF, this is the index of the
-first of the non-option elements that the caller should itself scan.
-
-Otherwise, @code{optind} communicates from one call to the next how much
-of @code{argv} has been scanned so far.
-@end table
-
-The libg++ version of GetOpt acts like standard UNIX @code{getopt} for
-the calling routine, but it behaves differently for the user, since it
-allows the user to intersperse the options with the other arguments.
-
-As GetOpt works, it permutes the elements of @code{argv} so that, when
-it is done, all the options precede everything else. Thus all
-application programs are extended to handle flexible argument order.
-
-Setting the environment variable _POSIX_OPTION_ORDER disables
-permutation. Then the behavior is completely standard.
-
-@ignore
-((Left out because it is not part of libg++ proper, and does not
-use the library copyright.))
-
-@node Gperf, Projects, GetOpt, Top
-@chapter A Perfect Hash Function Generator
-
-GNU GPERF is a utility program that automatically generates perfect hash
-functions from a list of keywords. The GNU C, GNU C++, GNU Pascal, GNU
-Modula 3 compilers and the GNU indent code formatting program all
-utilize reserved word recognizer routines generated by GPERF. Complete
-documentation and source code is available in the ./gperf subdirectory
-in the libg++ distribution. A paper describing GPERF in detail is
-available in the proceedings of the USENIX Second C++ Conference.
-@end ignore
-
-@node Projects, , GetOpt, Top
-@chapter Projects and other things left to do
-
-@section Coming Attractions
-
-Some things that will probably be available in libg++ in the near future:
-
-@itemize @bullet
-
-@item
-Revamped C-compatibility header files that will be compatible with
-the forthcoming (ANSI-based) GNU libc.a
-
-@item
-A revision of the File-based classes that will use the GNU stdio library,
-and also be 100% compatible (even at the streambuf level) with the AT&T
-2.0 stream classes.
-
-@item
-Additional container class prototypes.
-
-@item
-generic Matrix class prototypes.
-
-@item
-A task package probably based on Dirk Grunwald's threads package.
-
-@end itemize
-
-@section Wish List
-
-Some things that people have mentioned that they would like to
-see in libg++, but for which there have not been any offers:
-
-@itemize @bullet
-
-@item
-A method to automatically convert or incorporate libg++ classes
-so they can be used directly in Gorlen's OOPS environment.
-
-@item
-A class browser.
-
-@item
-A better general exception-handling strategy.
-
-@item
-Better documentation.
-
-@end itemize
-
-@section How to contribute
-
-Programmers who have written C++ classes that they believe to
-be of general interest are encourage to write to dl at rocky.oswego.edu.
-Contributing code is not difficult. Here are some general guidelines:
-
-@itemize @bullet
-
-@item
-FSF must maintain the right to accept or reject potential contributions.
-Generally, the only reasons for rejecting contributions are cases where
-they duplicate existing or nearly-released code, contain unremovable
-specific machine dependencies, or are somehow incompatible with the
-rest of the library.
-
-@item
-Acceptance of contributions means that the code is accepted for adaptation
-into libg++. FSF must reserve the right to make various editorial changes
-in code. Very often, this merely entails formatting, maintenance of various
-conventions, etc. Contributors are always given authorship credit and shown
-the final version for approval.
-
-@item
-Contributors must assign their copyright to FSF via a form sent out
-upon acceptance. Assigning copyright to FSF ensures that the code
-may be freely distributed.
-
-@item
-Assistance in providing documentation, test files, and debugging
-support is strongly encouraged.
-
-@end itemize
-
-Extensions, comments, and suggested modifications of existing libg++
-features are also very welcome.
-@contents
-@bye
diff --git a/contrib/libg++/libg++/src/ACG.cc b/contrib/libg++/libg++/src/ACG.cc
deleted file mode 100644
index b8a3c89e582a..000000000000
--- a/contrib/libg++/libg++/src/ACG.cc
+++ /dev/null
@@ -1,292 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1989 Free Software Foundation
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <ACG.h>
-#include <assert.h>
-
-//
-// This is an extension of the older implementation of Algorithm M
-// which I previously supplied. The main difference between this
-// version and the old code are:
-//
-// + Andres searched high & low for good constants for
-// the LCG.
-//
-// + theres more bit chopping going on.
-//
-// The following contains his comments.
-//
-// agn@UNH.CS.CMU.EDU sez..
-//
-// The generator below is based on 2 well known
-// methods: Linear Congruential (LCGs) and Additive
-// Congruential generators (ACGs).
-//
-// The LCG produces the longest possible sequence
-// of 32 bit random numbers, each being unique in
-// that sequence (it has only 32 bits of state).
-// It suffers from 2 problems: a) Independence
-// isnt great, that is the (n+1)th number is
-// somewhat related to the preceding one, unlike
-// flipping a coin where knowing the past outcomes
-// dont help to predict the next result. b)
-// Taking parts of a LCG generated number can be
-// quite non-random: for example, looking at only
-// the least significant byte gives a permuted
-// 8-bit counter (that has a period length of only
-// 256). The advantage of an LCA is that it is
-// perfectly uniform when run for the entire period
-// length (and very uniform for smaller sequences
-// too, if the parameters are chosen carefully).
-//
-// ACGs have extremly long period lengths and
-// provide good independence. Unfortunately,
-// uniformity isnt not too great. Furthermore, I
-// didnt find any theoretically analysis of ACGs
-// that addresses uniformity.
-//
-// The RNG given below will return numbers
-// generated by an LCA that are permuted under
-// control of a ACG. 2 permutations take place: the
-// 4 bytes of one LCG generated number are
-// subjected to one of 16 permutations selected by
-// 4 bits of the ACG. The permutation a such that
-// byte of the result may come from each byte of
-// the LCG number. This effectively destroys the
-// structure within a word. Finally, the sequence
-// of such numbers is permuted within a range of
-// 256 numbers. This greatly improves independence.
-//
-//
-// Algorithm M as describes in Knuths "Art of Computer Programming",
-// Vol 2. 1969
-// is used with a linear congruential generator (to get a good uniform
-// distribution) that is permuted with a Fibonacci additive congruential
-// generator to get good independence.
-//
-// Bit, byte, and word distributions were extensively tested and pass
-// Chi-squared test near perfect scores (>7E8 numbers tested, Uniformity
-// assumption holds with probability > 0.999)
-//
-// Run-up tests for on 7E8 numbers confirm independence with
-// probability > 0.97.
-//
-// Plotting random points in 2d reveals no apparent structure.
-//
-// Autocorrelation on sequences of 5E5 numbers (A(i) = SUM X(n)*X(n-i),
-// i=1..512)
-// results in no obvious structure (A(i) ~ const).
-//
-// Except for speed and memory requirements, this generator outperforms
-// random() for all tests. (random() scored rather low on uniformity tests,
-// while independence test differences were less dramatic).
-//
-// AGN would like to..
-// thanks to M.Mauldin, H.Walker, J.Saxe and M.Molloy for inspiration & help.
-//
-// And I would (DGC) would like to thank Donald Kunth for AGN for letting me
-// use his extensions in this implementation.
-//
-
-//
-// Part of the table on page 28 of Knuth, vol II. This allows us
-// to adjust the size of the table at the expense of shorter sequences.
-//
-
-static randomStateTable[][3] = {
-{3,7,16}, {4,9, 32}, {3,10, 32}, {1,11, 32}, {1,15,64}, {3,17,128},
-{7,18,128}, {3,20,128}, {2,21, 128}, {1,22, 128}, {5,23, 128}, {3,25, 128},
-{2,29, 128}, {3,31, 128}, {13,33, 256}, {2,35, 256}, {11,36, 256},
-{14,39,256}, {3,41,256}, {9,49,256}, {3,52,256}, {24,55,256}, {7,57, 256},
-{19,58,256}, {38,89,512}, {17,95,512}, {6,97,512}, {11,98,512}, {-1,-1,-1} };
-
-//
-// spatial permutation table
-// RANDOM_PERM_SIZE must be a power of two
-//
-
-#define RANDOM_PERM_SIZE 64
-_G_uint32_t randomPermutations[RANDOM_PERM_SIZE] = {
-0xffffffff, 0x00000000, 0x00000000, 0x00000000, // 3210
-0x0000ffff, 0x00ff0000, 0x00000000, 0xff000000, // 2310
-0xff0000ff, 0x0000ff00, 0x00000000, 0x00ff0000, // 3120
-0x00ff00ff, 0x00000000, 0xff00ff00, 0x00000000, // 1230
-
-0xffff0000, 0x000000ff, 0x00000000, 0x0000ff00, // 3201
-0x00000000, 0x00ff00ff, 0x00000000, 0xff00ff00, // 2301
-0xff000000, 0x00000000, 0x000000ff, 0x00ffff00, // 3102
-0x00000000, 0x00000000, 0x00000000, 0xffffffff, // 2103
-
-0xff00ff00, 0x00000000, 0x00ff00ff, 0x00000000, // 3012
-0x0000ff00, 0x00000000, 0x00ff0000, 0xff0000ff, // 2013
-0x00000000, 0x00000000, 0xffffffff, 0x00000000, // 1032
-0x00000000, 0x0000ff00, 0xffff0000, 0x000000ff, // 1023
-
-0x00000000, 0xffffffff, 0x00000000, 0x00000000, // 0321
-0x00ffff00, 0xff000000, 0x00000000, 0x000000ff, // 0213
-0x00000000, 0xff000000, 0x0000ffff, 0x00ff0000, // 0132
-0x00000000, 0xff00ff00, 0x00000000, 0x00ff00ff // 0123
-};
-
-//
-// SEED_TABLE_SIZE must be a power of 2
-//
-#define SEED_TABLE_SIZE 32
-static _G_uint32_t seedTable[SEED_TABLE_SIZE] = {
-0xbdcc47e5, 0x54aea45d, 0xec0df859, 0xda84637b,
-0xc8c6cb4f, 0x35574b01, 0x28260b7d, 0x0d07fdbf,
-0x9faaeeb0, 0x613dd169, 0x5ce2d818, 0x85b9e706,
-0xab2469db, 0xda02b0dc, 0x45c60d6e, 0xffe49d10,
-0x7224fea3, 0xf9684fc9, 0xfc7ee074, 0x326ce92a,
-0x366d13b5, 0x17aaa731, 0xeb83a675, 0x7781cb32,
-0x4ec7c92d, 0x7f187521, 0x2cf346b4, 0xad13310f,
-0xb89cff2b, 0x12164de1, 0xa865168d, 0x32b56cdf
-};
-
-//
-// The LCG used to scramble the ACG
-//
-//
-// LC-parameter selection follows recommendations in
-// "Handbook of Mathematical Functions" by Abramowitz & Stegun 10th, edi.
-//
-// LC_A = 251^2, ~= sqrt(2^32) = 66049
-// LC_C = result of a long trial & error series = 3907864577
-//
-
-static const _G_uint32_t LC_A = 66049;
-static const _G_uint32_t LC_C = 3907864577;
-static inline _G_uint32_t LCG(_G_uint32_t x)
-{
- return( x * LC_A + LC_C );
-}
-
-
-ACG::ACG(_G_uint32_t seed, int size)
-{
- register int l;
- initialSeed = seed;
-
- //
- // Determine the size of the state table
- //
-
- for (l = 0;
- randomStateTable[l][0] != -1 && randomStateTable[l][1] < size;
- l++);
-
- if (randomStateTable[l][1] == -1) {
- l--;
- }
-
- initialTableEntry = l;
-
- stateSize = randomStateTable[ initialTableEntry ][ 1 ];
- auxSize = randomStateTable[ initialTableEntry ][ 2 ];
-
- //
- // Allocate the state table & the auxillary table in a single malloc
- //
-
- state = new _G_uint32_t[stateSize + auxSize];
- auxState = &state[stateSize];
-
- reset();
-}
-
-//
-// Initialize the state
-//
-void
-ACG::reset()
-{
- register _G_uint32_t u;
-
- if (initialSeed < SEED_TABLE_SIZE) {
- u = seedTable[ initialSeed ];
- } else {
- u = initialSeed ^ seedTable[ initialSeed & (SEED_TABLE_SIZE-1) ];
- }
-
-
- j = randomStateTable[ initialTableEntry ][ 0 ] - 1;
- k = randomStateTable[ initialTableEntry ][ 1 ] - 1;
-
- register int i;
- for(i = 0; i < stateSize; i++) {
- state[i] = u = LCG(u);
- }
-
- for (i = 0; i < auxSize; i++) {
- auxState[i] = u = LCG(u);
- }
-
- k = u % stateSize;
- int tailBehind = (stateSize - randomStateTable[ initialTableEntry ][ 0 ]);
- j = k - tailBehind;
- if (j < 0) {
- j += stateSize;
- }
-
- lcgRecurr = u;
-
- assert(sizeof(double) == 2 * sizeof(_G_int32_t));
-}
-
-ACG::~ACG()
-{
- if (state) delete state;
- state = 0;
- // don't delete auxState, it's really an alias for state.
-}
-
-//
-// Returns 32 bits of random information.
-//
-
-_G_uint32_t
-ACG::asLong()
-{
- _G_uint32_t result = state[k] + state[j];
- state[k] = result;
- j = (j <= 0) ? (stateSize-1) : (j-1);
- k = (k <= 0) ? (stateSize-1) : (k-1);
-
- short int auxIndex = (result >> 24) & (auxSize - 1);
- register _G_uint32_t auxACG = auxState[auxIndex];
- auxState[auxIndex] = lcgRecurr = LCG(lcgRecurr);
-
- //
- // 3c is a magic number. We are doing four masks here, so we
- // do not want to run off the end of the permutation table.
- // This insures that we have always got four entries left.
- //
- register _G_uint32_t *perm = & randomPermutations[result & 0x3c];
-
- result = *(perm++) & auxACG;
- result |= *(perm++) & ((auxACG << 24)
- | ((auxACG >> 8)& 0xffffff));
- result |= *(perm++) & ((auxACG << 16)
- | ((auxACG >> 16) & 0xffff));
- result |= *(perm++) & ((auxACG << 8)
- | ((auxACG >> 24) & 0xff));
-
- return(result);
-}
diff --git a/contrib/libg++/libg++/src/ACG.h b/contrib/libg++/libg++/src/ACG.h
deleted file mode 100644
index aa1d25914a83..000000000000
--- a/contrib/libg++/libg++/src/ACG.h
+++ /dev/null
@@ -1,68 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Dirk Grunwald (grunwald@cs.uiuc.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#ifndef _ACG_h
-#define _ACG_h 1
-
-#include <RNG.h>
-#include <math.h>
-#ifdef __GNUG__
-#pragma interface
-#endif
-
-//
-// Additive number generator. This method is presented in Volume II
-// of The Art of Computer Programming by Knuth. I've coded the algorithm
-// and have added the extensions by Andres Nowatzyk of CMU to randomize
-// the result of algorithm M a bit by using an LCG & a spatial
-// permutation table.
-//
-// The version presented uses the same constants for the LCG that Andres
-// uses (chosen by trial & error). The spatial permutation table is
-// the same size (it's based on word size). This is for 32-bit words.
-//
-// The ``auxillary table'' used by the LCG table varies in size, and
-// is chosen to be the the smallest power of two which is larger than
-// twice the size of the state table.
-//
-
-class ACG : public RNG {
-
- _G_uint32_t initialSeed; // used to reset generator
- int initialTableEntry;
-
- _G_uint32_t *state;
- _G_uint32_t *auxState;
- short stateSize;
- short auxSize;
- _G_uint32_t lcgRecurr;
- short j;
- short k;
-
-protected:
-
-public:
- ACG(_G_uint32_t seed = 0, int size = 55);
- virtual ~ACG();
- //
- // Return a long-words word of random bits
- //
- virtual _G_uint32_t asLong();
- virtual void reset();
-};
-
-#endif
diff --git a/contrib/libg++/libg++/src/AllocRing.cc b/contrib/libg++/libg++/src/AllocRing.cc
deleted file mode 100644
index 883288ab0480..000000000000
--- a/contrib/libg++/libg++/src/AllocRing.cc
+++ /dev/null
@@ -1,110 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1989 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <std.h>
-#include <AllocRing.h>
-#include <new.h>
-
-AllocRing::AllocRing(int max)
- :nodes(new AllocQNode[max]), n(max), current(0)
-{
- for (int i = 0; i < n; ++i)
- {
- nodes[i].ptr = 0;
- nodes[i].sz = 0;
- }
-}
-
-int AllocRing::find(void* p)
-{
- if (p == 0) return -1;
-
- for (int i = 0; i < n; ++i)
- if (nodes[i].ptr == p)
- return i;
-
- return -1;
-}
-
-
-void AllocRing::clear()
-{
- for (int i = 0; i < n; ++i)
- {
- if (nodes[i].ptr != 0)
- {
- delete(nodes[i].ptr);
- nodes[i].ptr = 0;
- }
- nodes[i].sz = 0;
- }
- current = 0;
-}
-
-
-void AllocRing::free(void* p)
-{
- int idx = find(p);
- if (idx >= 0)
- {
- delete nodes[idx].ptr;
- nodes[idx].ptr = 0;
- }
-}
-
-AllocRing::~AllocRing()
-{
- clear();
-}
-
-int AllocRing::contains(void* p)
-{
- return find(p) >= 0;
-}
-
-static inline unsigned int good_size(unsigned int s)
-{
- unsigned int req = s + 4;
- unsigned int good = 8;
- while (good < req) good <<= 1;
- return good - 4;
-}
-
-void* AllocRing::alloc(int s)
-{
- unsigned int size = good_size(s);
-
- void* p;
- if (nodes[current].ptr != 0 &&
- nodes[current].sz >= int(size) &&
- nodes[current].sz < int(4 * size))
- p = nodes[current].ptr;
- else
- {
- if (nodes[current].ptr != 0) operator delete (nodes[current].ptr);
- p = operator new (size);
- nodes[current].ptr = p;
- nodes[current].sz = size;
- }
- ++current;
- if (current >= n) current = 0;
- return p;
-}
diff --git a/contrib/libg++/libg++/src/AllocRing.h b/contrib/libg++/libg++/src/AllocRing.h
deleted file mode 100644
index fc8b30c44d55..000000000000
--- a/contrib/libg++/libg++/src/AllocRing.h
+++ /dev/null
@@ -1,62 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1989 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-
-#ifndef _AllocRing_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _AllocRing_h 1
-
-
-/*
- An AllocRing holds the last n malloc'ed strings, reallocating/reusing
- one only when the queue wraps around. It thus guarantees that the
- last n allocations are intact. It is useful for things like I/O
- formatting where reasonable restrictions may be made about the
- number of allowable live allocations before auto-deletion.
-*/
-
-class AllocRing
-{
-
- struct AllocQNode
- {
- void* ptr;
- int sz;
- };
-
- AllocQNode* nodes;
- int n;
- int current;
-
- int find(void* p);
-
-public:
-
- AllocRing(int max);
- ~AllocRing();
-
- void* alloc(int size);
- int contains(void* ptr);
- void clear();
- void free(void* p);
-};
-
-
-#endif
diff --git a/contrib/libg++/libg++/src/Binomial.cc b/contrib/libg++/libg++/src/Binomial.cc
deleted file mode 100644
index 8e2b56d71ab3..000000000000
--- a/contrib/libg++/libg++/src/Binomial.cc
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Dirk Grunwald (grunwald@cs.uiuc.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <builtin.h>
-#include <Random.h>
-#include <Binomial.h>
-
-double Binomial::operator()()
-{
- int s = 0;
- for (int i = 0; i < pN; i++) {
- if (pGenerator -> asDouble() < pU) {
- s++;
- }
- }
- return(double(s));
-}
-
diff --git a/contrib/libg++/libg++/src/Binomial.h b/contrib/libg++/libg++/src/Binomial.h
deleted file mode 100644
index 58afa854caf7..000000000000
--- a/contrib/libg++/libg++/src/Binomial.h
+++ /dev/null
@@ -1,55 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Dirk Grunwald (grunwald@cs.uiuc.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#ifndef _Binomial_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _Binomial_h 1
-
-#include <Random.h>
-
-class Binomial: public Random {
-protected:
- int pN;
- double pU;
-public:
- Binomial(int n, double u, RNG *gen);
-
- int n();
- int n(int xn);
-
- double u();
- double u(double xu);
-
- virtual double operator()();
-
-};
-
-
-inline Binomial::Binomial(int n, double u, RNG *gen)
-: Random(gen){
- pN = n; pU = u;
-}
-
-inline int Binomial::n() { return pN; }
-inline int Binomial::n(int xn) { int tmp = pN; pN = xn; return tmp; }
-
-inline double Binomial::u() { return pU; }
-inline double Binomial::u(double xu) { double tmp = pU; pU = xu; return tmp; }
-
-#endif
diff --git a/contrib/libg++/libg++/src/BitSet.cc b/contrib/libg++/libg++/src/BitSet.cc
deleted file mode 100644
index 15096e2d28be..000000000000
--- a/contrib/libg++/libg++/src/BitSet.cc
+++ /dev/null
@@ -1,1104 +0,0 @@
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-/*
- BitSet class implementation
- */
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <BitSet.h>
-#include <std.h>
-#include <limits.h>
-#include <Obstack.h>
-#include <AllocRing.h>
-#include <new.h>
-#include <builtin.h>
-#include <string.h>
-#include <strstream.h>
-
-#undef OK
-
-void BitSet::error(const char* msg) const
-{
- (*lib_error_handler)("BitSet", msg);
-}
-
-// globals & constants
-
-BitSetRep _nilBitSetRep = { 0, 1, 0, {0} }; // nil BitSets point here
-
-#define ONES ((_BS_word)(~0L))
-#define MASK1(BITNO) ((_BS_word)1 << (BITNO))
-#define MAXBitSetRep_SIZE (((_BS_word)1 << (sizeof(unsigned short)*CHAR_BIT - 1)) - 1)
-#define MINBitSetRep_SIZE (sizeof(_BS_word)*CHAR_BIT)
-
-#ifndef MALLOC_MIN_OVERHEAD
-#define MALLOC_MIN_OVERHEAD 4
-#endif
-
-// break things up into .s indices and positions
-
-
-// mask out bits from left
-
-static inline _BS_word lmask(int p)
-{
- return ONES << p;
-}
-
-// mask out high bits
-
-static inline _BS_word rmask(int p)
-{
- return ONES >> (BITSETBITS - 1 - p);
-}
-
-
-inline static BitSetRep* BSnew(int newlen)
-{
- unsigned int siz = sizeof(BitSetRep) + newlen * sizeof(_BS_word)
- + MALLOC_MIN_OVERHEAD;
- unsigned int allocsiz = MINBitSetRep_SIZE;;
- while (allocsiz < siz) allocsiz <<= 1;
- allocsiz -= MALLOC_MIN_OVERHEAD;
- if (allocsiz >= MAXBitSetRep_SIZE * sizeof(_BS_word))
- (*lib_error_handler)("BitSet", "Requested length out of range");
-
- BitSetRep* rep = new (operator new (allocsiz)) BitSetRep;
- memset(rep, 0, allocsiz);
- rep->sz = (allocsiz - sizeof(BitSetRep) + sizeof(_BS_word)) / sizeof(_BS_word);
- return rep;
-}
-
-BitSetRep* BitSetalloc(BitSetRep* old, const _BS_word* src, int srclen,
- int newvirt, int newlen)
-{
- if (old == &_nilBitSetRep) old = 0;
- BitSetRep* rep;
- if (old == 0 || newlen >= old->sz)
- rep = BSnew(newlen);
- else
- rep = old;
-
- rep->len = newlen;
- rep->virt = newvirt;
-
- if (srclen != 0 && src != rep->s)
- memcpy(rep->s, src, srclen * sizeof(_BS_word));
- // BUG fix: extend virtual bit! 20 Oct 1992 Kevin Karplus
- if (rep->virt)
- memset(&rep->s[srclen], (char)ONES,
- (newlen - srclen) * sizeof(_BS_word));
- if (old != rep && old != 0) delete old;
- return rep;
-}
-
-BitSetRep* BitSetresize(BitSetRep* old, int newlen)
-{
- BitSetRep* rep;
- if (old == 0 || old == &_nilBitSetRep)
- {
- rep = BSnew(newlen);
- rep->virt = 0;
- }
- else if (newlen >= old->sz)
- {
- rep = BSnew(newlen);
- memcpy(rep->s, old->s, old->len * sizeof(_BS_word));
- rep->virt = old->virt;
- // BUG fix: extend virtual bit! 20 Oct 1992 Kevin Karplus
- if (rep->virt)
- memset(&rep->s[old->len], (char)ONES,
- (newlen - old->len) * sizeof(_BS_word));
- delete old;
- }
- else
- {
- rep = old;
- if (rep->len < newlen)
- memset(&rep->s[rep->len],
- rep->virt ? (char)ONES : (char)0,
- (newlen - rep->len) * sizeof(_BS_word));
- }
-
- rep->len = newlen;
-
- return rep;
-}
-
-// same, for straight copy
-
-BitSetRep* BitSetcopy(BitSetRep* old, const BitSetRep* src)
-{
- BitSetRep* rep;
- if (old == &_nilBitSetRep) old = 0;
- if (src == 0 || src == &_nilBitSetRep)
- {
- if (old == 0)
- rep = BSnew(0);
- else
- rep = old;
- rep->len = 0;
- rep->virt = 0;
- }
- else if (old == src)
- return old;
- else
- {
- int newlen = src->len;
- if (old == 0 || newlen > old->sz)
- {
- rep = BSnew(newlen);
- if (old != 0) delete old;
- }
- else
- rep = old;
-
- memcpy(rep->s, src->s, newlen * sizeof(_BS_word));
- rep->len = newlen;
- rep->virt = src->virt;
- }
- return rep;
-}
-
-
-// remove unneeded top bits
-
-inline static void trim(BitSetRep* rep)
-{
- int l = rep->len;
- _BS_word* s = &(rep->s[l - 1]);
-
- if (rep->virt == 0)
- while (l > 0 && *s-- == 0) --l;
- else
- while (l > 0 && *s-- == ONES) --l;
- rep->len = l;
-}
-
-int operator == (const BitSet& x, const BitSet& y)
-{
- if (x.rep->virt != y.rep->virt)
- return 0;
- int xl = x.rep->len;
- int yl = y.rep->len;
-
- const _BS_word* xs = x.rep->s;
- const _BS_word* ys = y.rep->s;
- if (xl < yl) {
- if (memcmp((void*)xs, (void*)ys, xl * sizeof(_BS_word)))
- return 0;
- ys+=xl;
- const _BS_word* topy = &(ys[yl]);
- while (ys<topy)
- if (x.rep->virt?((*ys++)!=ONES):((*ys++)!=0))
- return 0;
- }
- else {
- if (memcmp((void*)xs, (void*)ys, yl * sizeof(_BS_word)))
- return 0;
- if (xl > yl) {
- xs+=yl;
- const _BS_word* topx = &(xs[xl]);
- while (xs<topx)
- if (y.rep->virt?((*xs++)!=ONES):((*xs++)!=0))
- return 0;
- }
- }
- return 1;
-}
-
-int operator <= (const BitSet& x, const BitSet& y)
-{
- if (x.rep->virt > y.rep->virt)
- return 0;
-
- int xl = x.rep->len;
- int yl = y.rep->len;
-
- const _BS_word* xs = x.rep->s;
- const _BS_word* ys = y.rep->s;
- const _BS_word* topx = &(xs[xl]);
- const _BS_word* topy = &(ys[yl]);
-
- while (xs < topx && ys < topy)
- {
- _BS_word a = *xs++;
- _BS_word b = *ys++;
- if ((a | b) != b)
- return 0;
- }
- if (xl < yl) {
- if (x.rep->virt) {
- while (ys<topy)
- if ((*ys++)!=ONES)
- return 0;
- }
- }
- else if (xl > yl) {
- if (!y.rep->virt) {
- while (xs<topx)
- if ((*xs++)!=0)
- return 0;
- }
- }
- return 1;
-}
-
-
-int operator < (const BitSet& x, const BitSet& y)
-{
- if (x.rep->virt > y.rep->virt)
- return 0;
-
- int xl = x.rep->len;
- int yl = y.rep->len;
-
- _BS_word* xs = x.rep->s;
- _BS_word* ys = y.rep->s;
- _BS_word* topx = &(xs[xl]);
- _BS_word* topy = &(ys[yl]);
- int one_diff = 0;
- while (xs < topx && ys < topy)
- {
- _BS_word a = *xs++;
- _BS_word b = *ys++;
- _BS_word c = a | b;
- if (c != b)
- return 0;
- else if (c != a)
- one_diff = 1;
- }
- if (xl < yl) {
- if (x.rep->virt) {
- if (!one_diff)
- return 0;
- while (ys<topy)
- if ((*ys++)!=ONES)
- return 0;
- return 1;
- }
- else {
- if (one_diff || y.rep->virt)
- return 1;
- while (ys<topy)
- if ((*ys++)!=0)
- return 1;
- return 0;
- }
- }
- else if (xl > yl) {
- if (y.rep->virt) {
- if (one_diff || !x.rep->virt)
- return 1;
- while (xs<topx)
- if ((*xs++)!=ONES)
- return 1;
- return 0;
- }
- else {
- if (!one_diff)
- return 0;
- while (xs<topx)
- if ((*xs++)!=0)
- return 0;
- return 1;
- }
- }
- else
- return one_diff || x.rep->virt < y.rep->virt;
-}
-
-int lcompare(const BitSet& x, const BitSet& y)
-{
- int xl = x.rep->len;
- int yl = y.rep->len;
-
- const _BS_word* xs = x.rep->s;
- const _BS_word* ys = y.rep->s;
- const _BS_word* topx = &(xs[xl]);
- const _BS_word* topy = &(ys[yl]);
-
- while (xs < topx && ys < topy)
- {
- _BS_word a = *xs++;
- _BS_word b = *ys++;
- if (a!=b) {
-#if 0
- // Faster but opinable
- return (a<b) ? -1 : 1;
-#else
- _BS_word diff=(a^b); // one's where different
- _BS_word mask=diff&~(diff-1); // first bit different
- return (a&mask)?1:-1;
-#endif
- }
- if (a<b)
- return -1;
- if (a>b)
- return 1;
- }
- if (xl < yl) {
- if (x.rep->virt) {
- while (ys<topy)
- if ((*ys++)!=ONES)
- return 1;
- return 0;
- }
- else {
- while (ys<topy)
- if ((*ys++)!=0)
- return -1;
- return 0;
- }
- }
- else if (xl > yl) {
- if (y.rep->virt) {
- while (xs<topx)
- if ((*xs++)!=ONES)
- return -1;
- return 0;
- }
- else {
- while (xs<topx)
- if ((*xs++)!=0)
- return 1;
- return 0;
- }
- }
- return 0;
-}
-
-int BitSet::empty() const
-{
- if (rep->virt == 1)
- return 0;
-
- _BS_word* bots = rep->s;
- _BS_word* s = &(bots[rep->len - 1]);
- while (s >= bots) if (*s-- != 0) return 0;
- return 1;
-}
-
-
-int BitSet::count(int b) const
-{
- if (b == rep->virt)
- return -1;
- int l = 0;
- _BS_word* s = rep->s;
- _BS_word* tops = &(s[rep->len]);
- if (b == 1)
- {
- while (s < tops)
- {
- _BS_word a = *s++;
- for (int i = 0; i < BITSETBITS && a != 0; ++i)
- {
- if (a & 1)
- ++l;
- a >>= 1;
- }
- }
- }
- else
- {
- _BS_word maxbit = MASK1 (BITSETBITS - 1);
- while (s < tops)
- {
- _BS_word a = *s++;
- for (int i = 0; i < BITSETBITS; ++i)
- {
- if ((a & maxbit) == 0)
- ++l;
- a <<= 1;
- }
- }
- }
- return l;
-}
-
-BitSetRep* BitSetcmpl(const BitSetRep* src, BitSetRep* r)
-{
- r = BitSetcopy(r, src);
- r->virt = !src->virt;
- _BS_word* rs = r->s;
- _BS_word* topr = &(rs[r->len]);
- if (r->len == 0)
- *rs = ONES;
- else
- {
- while (rs < topr)
- {
- _BS_word cmp = ~(*rs);
- *rs++ = cmp;
- }
- }
- trim(r);
- return r;
-}
-
-
-BitSetRep* BitSetop(const BitSetRep* x, const BitSetRep* y,
- BitSetRep* r, char op)
-{
- int xrsame = x == r;
- int yrsame = y == r;
- int xv = x->virt;
- int yv = y->virt;
- int xl = x->len;
- int yl = y->len;
- int rl = (xl >= yl)? xl : yl;
-
- r = BitSetresize(r, rl);
- _BS_word* rs = r->s;
- _BS_word* topr = &(rs[rl]);
-
- int av, bv;
- const _BS_word* as;
- const _BS_word* topa;
- const _BS_word* bs;
- const _BS_word* topb;
-
- if (xl <= yl)
- {
- as = (xrsame)? r->s : x->s;
- av = xv;
- topa = &(as[xl]);
- bs = (yrsame)? r->s : y->s;
- bv = yv;
- topb = &(bs[yl]);
- }
- else
- {
- as = (yrsame)? r->s : y->s;
- av = yv;
- topa = &(as[yl]);
- bs = (xrsame)? r->s : x->s;
- bv = xv;
- topb = &(bs[xl]);
- if (op == '-') // reverse sense of difference
- op = 'D';
- }
-
- switch (op)
- {
- case '&':
- r->virt = av & bv;
- while (as < topa) *rs++ = *as++ & *bs++;
- if (av)
- while (rs < topr) *rs++ = *bs++;
- else
- while (rs < topr) *rs++ = 0;
- break;
- case '|':
- r->virt = av | bv;
- while (as < topa) *rs++ = *as++ | *bs++;
- if (av)
- while (rs < topr) *rs++ = ONES;
- else
- while (rs < topr) *rs++ = *bs++;
- break;
- case '^':
- r->virt = av ^ bv;
- while (as < topa) *rs++ = *as++ ^ *bs++;
- if (av)
- while (rs < topr) *rs++ = ~(*bs++);
- else
- while (rs < topr) *rs++ = *bs++;
- break;
- case '-':
- r->virt = av & ~(bv);
- while (as < topa) *rs++ = *as++ & ~(*bs++);
- if (av)
- while (rs < topr) *rs++ = ~(*bs++);
- else
- while (rs < topr) *rs++ = 0;
- break;
- case 'D':
- r->virt = ~(av) & (bv);
- while (as < topa) *rs++ = ~(*as++) & (*bs++);
- if (av)
- while (rs < topr) *rs++ = 0;
- else
- while (rs < topr) *rs++ = *bs++;
- break;
- }
- trim(r);
- return r;
-}
-
-
-void BitSet::set(int p)
-{
- if (p < 0) error("Illegal bit index");
-
- int index = BitSet_index(p);
- int pos = BitSet_pos(p);
-
- if (index >= rep->len)
- {
- if (rep->virt)
- return;
- else
- rep = BitSetresize(rep, index+1);
- }
-
- rep->s[index] |= MASK1 (pos);
-}
-
-void BitSet::clear()
-{
- if (rep->len > 0) memset(rep->s, 0, rep->sz * sizeof(_BS_word));
- rep->len = rep->virt = 0;
-}
-
-void BitSet::clear(int p)
-{
- if (p < 0) error("Illegal bit index");
- int index = BitSet_index(p);
- if (index >= rep->len)
- {
- if (rep->virt == 0)
- return;
- else
- rep = BitSetresize(rep, index+1);
- }
- rep->s[index] &= ~MASK1(BitSet_pos(p));
-}
-
-void BitSet::invert(int p)
-{
- if (p < 0) error("Illegal bit index");
- int index = BitSet_index(p);
- if (index >= rep->len) rep = BitSetresize(rep, index+1);
- rep->s[index] ^= MASK1(BitSet_pos(p));
-}
-
-void BitSet::set(int from, int to)
-{
- if (from < 0 || from > to) error("Illegal bit index");
-
- int index1 = BitSet_index(from);
- int pos1 = BitSet_pos(from);
-
- if (rep->virt && index1 >= rep->len)
- return;
-
- int index2 = BitSet_index(to);
- int pos2 = BitSet_pos(to);
-
- if (index2 >= rep->len)
- rep = BitSetresize(rep, index2+1);
-
- _BS_word* s = &(rep->s[index1]);
- _BS_word m1 = lmask(pos1);
- _BS_word m2 = rmask(pos2);
- if (index2 == index1)
- *s |= m1 & m2;
- else
- {
- *s++ |= m1;
- _BS_word* top = &(rep->s[index2]);
- *top |= m2;
- while (s < top)
- *s++ = ONES;
- }
-}
-
-void BitSet::clear(int from, int to)
-{
- if (from < 0 || from > to) error("Illegal bit index");
-
- int index1 = BitSet_index(from);
- int pos1 = BitSet_pos(from);
-
- if (!rep->virt && index1 >= rep->len)
- return;
-
- int index2 = BitSet_index(to);
- int pos2 = BitSet_pos(to);
-
- if (index2 >= rep->len)
- rep = BitSetresize(rep, index2+1);
-
- _BS_word* s = &(rep->s[index1]);
- _BS_word m1 = lmask(pos1);
- _BS_word m2 = rmask(pos2);
- if (index2 == index1)
- *s &= ~(m1 & m2);
- else
- {
- *s++ &= ~m1;
- _BS_word* top = &(rep->s[index2]);
- *top &= ~m2;
- while (s < top)
- *s++ = 0;
- }
-}
-
-void BitSet::invert(int from, int to)
-{
- if (from < 0 || from > to) error("Illegal bit index");
-
- int index1 = BitSet_index(from);
- int pos1 = BitSet_pos(from);
- int index2 = BitSet_index(to);
- int pos2 = BitSet_pos(to);
-
- if (index2 >= rep->len)
- rep = BitSetresize(rep, index2+1);
-
- _BS_word* s = &(rep->s[index1]);
- _BS_word m1 = lmask(pos1);
- _BS_word m2 = rmask(pos2);
- if (index2 == index1)
- *s ^= m1 & m2;
- else
- {
- *s++ ^= m1;
- _BS_word* top = &(rep->s[index2]);
- *top ^= m2;
- while (s < top)
- {
- _BS_word cmp = ~(*s);
- *s++ = cmp;
- }
- }
-}
-
-
-int BitSet::test(int from, int to) const
-{
- if (from < 0 || from > to) return 0;
-
- int index1 = BitSet_index(from);
- int pos1 = BitSet_pos(from);
-
- if (index1 >= rep->len)
- return rep->virt;
-
- int index2 = BitSet_index(to);
- int pos2 = BitSet_pos(to);
-
- if (index2 >= rep->len)
- {
- if (rep->virt)
- return 1;
- else
- {
- index2 = rep->len - 1;
- pos2 = BITSETBITS - 1;
- }
- }
-
- _BS_word* s = &(rep->s[index1]);
- _BS_word m1 = lmask(pos1);
- _BS_word m2 = rmask(pos2);
-
- if (index2 == index1)
- return (*s & m1 & m2) != 0;
- else
- {
- if (*s++ & m1)
- return 1;
- _BS_word* top = &(rep->s[index2]);
- if (*top & m2)
- return 1;
- while (s < top)
- if (*s++ != 0)
- return 1;
- return 0;
- }
-}
-
-int BitSet::next(int p, int b) const
-{
- ++p;
- int index = BitSet_index(p);
- int pos = BitSet_pos(p);
-
- int l = rep->len;
-
- if (index >= l)
- {
- if (rep->virt == b)
- return p;
- else
- return -1;
- }
- int j = index;
- _BS_word* s = rep->s;
- _BS_word a = s[j] >> pos;
- int i = pos;
-
- if (b == 1)
- {
- for (; i < BITSETBITS && a != 0; ++i)
- {
- if (a & 1)
- return j * BITSETBITS + i;
- a >>= 1;
- }
- for (++j; j < l; ++j)
- {
- a = s[j];
- for (i = 0; i < BITSETBITS && a != 0; ++i)
- {
- if (a & 1)
- return j * BITSETBITS + i;
- a >>= 1;
- }
- }
- if (rep->virt)
- return j * BITSETBITS;
- else
- return -1;
- }
- else
- {
- for (; i < BITSETBITS; ++i)
- {
- if ((a & 1) == 0)
- return j * BITSETBITS + i;
- a >>= 1;
- }
- for (++j; j < l; ++j)
- {
- a = s[j];
- if (a != ONES)
- {
- for (i = 0; i < BITSETBITS; ++i)
- {
- if ((a & 1) == 0)
- return j * BITSETBITS + i;
- a >>= 1;
- }
- }
- }
- if (!rep->virt)
- return j * BITSETBITS;
- else
- return -1;
- }
-}
-
-int BitSet::prev(int p, int b) const
-{
- if (--p < 0)
- return -1;
-
- int index = BitSet_index(p);
- int pos = BitSet_pos(p);
-
- _BS_word* s = rep->s;
- int l = rep->len;
-
- if (index >= l)
- {
- if (rep->virt == b)
- return p;
- else
- {
- index = l - 1;
- pos = BITSETBITS - 1;
- }
- }
-
- int j = index;
- _BS_word a = s[j];
-
- int i = pos;
- _BS_word maxbit = MASK1(pos);
-
- if (b == 1)
- {
- for (; i >= 0 && a != 0; --i)
- {
- if (a & maxbit)
- return j * BITSETBITS + i;
- a <<= 1;
- }
- maxbit = MASK1(BITSETBITS - 1);
- for (--j; j >= 0; --j)
- {
- a = s[j];
- for (i = BITSETBITS - 1; i >= 0 && a != 0; --i)
- {
- if (a & maxbit)
- return j * BITSETBITS + i;
- a <<= 1;
- }
- }
- return -1;
- }
- else
- {
- if (a != ONES)
- {
- for (; i >= 0; --i)
- {
- if ((a & maxbit) == 0)
- return j * BITSETBITS + i;
- a <<= 1;
- }
- }
- maxbit = MASK1(BITSETBITS - 1);
- for (--j; j >= 0; --j)
- {
- a = s[j];
- if (a != ONES)
- {
- for (i = BITSETBITS - 1; i >= 0; --i)
- {
- if ((a & maxbit) == 0)
- return j * BITSETBITS + i;
- a <<= 1;
- }
- }
- }
- return -1;
- }
-}
-
-int BitSet::last(int b) const
-{
- if (b == rep->virt)
- return -1;
- else
- return prev((rep->len) * BITSETBITS, b);
-}
-
-
-extern AllocRing _libgxx_fmtq;
-
-const char* BitSettoa(const BitSet& x, char f, char t, char star)
-{
- trim(x.rep);
- int wrksiz = (x.rep->len + 1) * BITSETBITS + 2;
- char* fmtbase = (char *) _libgxx_fmtq.alloc(wrksiz);
- ostrstream stream(fmtbase, wrksiz);
-
- x.printon(stream, f, t, star);
- stream << ends;
- return fmtbase;
-}
-
-BitSet shorttoBitSet(unsigned short i)
-{
- BitSet r;
- _BS_word w = i;
- r.rep = BitSetalloc(0, &w, 1, 0, 2); trim(r.rep);
- return r;
-}
-
-BitSet longtoBitSet(unsigned long i)
-{
- BitSet r;
-#if 1
- _BS_word w = i;
- r.rep = BitSetalloc(0, &w, 1, 0, 2);
-#else
- _BS_word u[2];
- u[0] = i & ((_BS_word)(~(0)));
- u[1] = sizeof(long) <= sizeof(_BS_word) ? 0 : i >> BITSETBITS;
- r.rep = BitSetalloc(0, &u[0], 2, 0, 3);
-#endif
- trim(r.rep);
- return r;
-}
-
-#if defined(__GNUG__) && !defined(_G_NO_NRV)
-
-BitSet atoBitSet(const char* s, char f, char t, char star) return r
-{
- int sl = strlen(s);
- if (sl != 0)
- {
- r.rep = BitSetresize(r.rep, sl / BITSETBITS + 1);
- _BS_word* rs = r.rep->s;
- _BS_word a = 0;
- _BS_word m = 1;
- char lastch = 0;
- unsigned int i = 0;
- unsigned int l = 1;
- for(;;)
- {
- char ch = s[i];
- if (ch == t)
- a |= m;
- else if (ch == star)
- {
- if ((r.rep->virt = (lastch == t)))
- *rs = a | ~(m - 1);
- else
- *rs = a;
- break;
- }
- else if (ch != f)
- {
- *rs = a;
- break;
- }
- lastch = ch;
- if (++i == sl)
- {
- *rs = a;
- break;
- }
- else if (i % BITSETBITS == 0)
- {
- *rs++ = a;
- a = 0;
- m = 1;
- ++l;
- }
- else
- m <<= 1;
- }
- r.rep->len = l;
- trim(r.rep);
- }
- return;
-}
-
-#else
-
-BitSet atoBitSet(const char* s, char f, char t, char star)
-{
- BitSet r;
- int sl = strlen(s);
- if (sl != 0)
- {
- r.rep = BitSetresize(r.rep, sl / BITSETBITS + 1);
- _BS_word* rs = r.rep->s;
- _BS_word a = 0;
- _BS_word m = 1;
- char lastch = 0;
- unsigned int i = 0;
- unsigned int l = 1;
- for(;;)
- {
- char ch = s[i];
- if (ch == t)
- a |= m;
- else if (ch == star)
- {
- if (r.rep->virt = lastch == t)
- *rs = a | ~(m - 1);
- else
- *rs = a;
- break;
- }
- else if (ch != f)
- {
- *rs = a;
- break;
- }
- lastch = ch;
- if (++i == sl)
- {
- *rs = a;
- break;
- }
- else if (i % BITSETBITS == 0)
- {
- *rs++ = a;
- a = 0;
- m = 1;
- ++l;
- }
- else
- m <<= 1;
- }
- r.rep->len = l;
- trim(r.rep);
- }
- return r;
-}
-
-#endif
-
-ostream& operator << (ostream& s, const BitSet& x)
-{
- if (s.opfx())
- x.printon(s);
- return s;
-}
-
-void BitSet::printon(ostream& os, char f, char t, char star) const
-// FIXME: Does not respect s.width()!
-{
- trim(rep);
- register streambuf* sb = os.rdbuf();
- const _BS_word* s = rep->s;
- const _BS_word* top = &(s[rep->len - 1]);
-
- while (s < top)
- {
- _BS_word a = *s++;
- for (int j = 0; j < BITSETBITS; ++j)
- {
- sb->sputc((a & 1)? t : f);
- a >>= 1;
- }
- }
-
- if (!rep->virt)
- {
- _BS_word a = *s;
- if (rep->len != 0)
- {
- for (int j = 0; j < BITSETBITS && a != 0; ++j)
- {
- sb->sputc((a & 1)? t : f);
- a >>= 1;
- }
- }
- sb->sputc(f);
- }
- else
- {
- _BS_word a = *s;
- _BS_word mask = ONES;
- _BS_word himask = MASK1(BITSETBITS - 1) - 1;
- if (rep->len != 0)
- {
- for (int j = 0; j < BITSETBITS && a != mask; ++j)
- {
- sb->sputc((a & 1)? t : f);
- a = (a >> 1) & himask;
- mask = (mask >> 1) & himask;
- }
- }
- sb->sputc(t);
- }
-
- sb->sputc(star);
-}
-
-int BitSet::OK() const
-{
- int v = rep != 0; // have a rep
- v &= rep->len <= rep->sz; // within bounds
- v &= rep->virt == 0 || rep->virt == 1; // valid virtual bit
- if (!v) error("invariant failure");
- return v;
-}
-
diff --git a/contrib/libg++/libg++/src/BitSet.h b/contrib/libg++/libg++/src/BitSet.h
deleted file mode 100644
index 3ff982a8ebab..000000000000
--- a/contrib/libg++/libg++/src/BitSet.h
+++ /dev/null
@@ -1,360 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifndef _BitSet_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-
-#define _BitSet_h 1
-
-#include <iostream.h>
-#include <limits.h>
-#include <bitprims.h>
-
-#undef OK
-
-#define BITSETBITS (sizeof(_BS_word) * CHAR_BIT)
-
-struct BitSetRep
-{
- unsigned short len; // number of _BS_word in s
- unsigned short sz; // allocated slots
- unsigned short virt; // virtual 0 or 1
- _BS_word s[1]; // bits start here
-};
-
-extern BitSetRep* BitSetalloc(BitSetRep*, const _BS_word*,
- int, int, int);
-extern BitSetRep* BitSetcopy(BitSetRep*, const BitSetRep*);
-extern BitSetRep* BitSetresize(BitSetRep*, int);
-extern BitSetRep* BitSetop(const BitSetRep*, const BitSetRep*,
- BitSetRep*, char);
-extern BitSetRep* BitSetcmpl(const BitSetRep*, BitSetRep*);
-extern BitSetRep _nilBitSetRep;
-
-class BitSet;
-
-class BitSetBit
-{
-protected:
- BitSet* src;
- unsigned long pos;
-
- public:
- BitSetBit(BitSet* v, int p);
- BitSetBit(const BitSetBit& b);
- ~BitSetBit();
- operator int() const;
- int operator = (int b);
- int operator = (const BitSetBit& b);
-};
-
-class BitSet
-{
-protected:
- BitSetRep* rep;
-
- enum BS_op {
- BS_and = (int) '&',
- BS_or = (int) '|',
- BS_xor = (int) '^',
- BS_diff = (int) '-',
- BS_inv = (int) '~'
- };
- BitSet(const BitSet& x, const BitSet& y, enum BS_op op)
- { rep = BitSetop (x.rep, y.rep, NULL, (char) op); }
- BitSet(const BitSet& x, enum BS_op /* op */)
- { rep = BitSetcmpl (x.rep, NULL); }
-
-public:
-
-// constructors
- BitSet();
- BitSet(const BitSet&);
-
- ~BitSet();
-
- BitSet& operator = (const BitSet& y);
-
-// equality & subset tests
-
- friend int operator == (const BitSet& x, const BitSet& y);
- friend int operator != (const BitSet& x, const BitSet& y);
- friend int operator < (const BitSet& x, const BitSet& y);
- friend int operator <= (const BitSet& x, const BitSet& y);
- friend int operator > (const BitSet& x, const BitSet& y);
- friend int operator >= (const BitSet& x, const BitSet& y);
- friend int lcompare(const BitSet& x, const BitSet& y);
-
-// operations on self
-
- BitSet& operator |= (const BitSet& y);
- BitSet& operator &= (const BitSet& y);
- BitSet& operator -= (const BitSet& y);
- BitSet& operator ^= (const BitSet& y);
-
- void complement();
-
-// functional operators
-
- friend BitSet operator & (const BitSet& x, const BitSet& y);
- friend BitSet operator | (const BitSet& x, const BitSet& y);
- friend BitSet operator ^ (const BitSet& x, const BitSet& y);
- friend BitSet operator - (const BitSet& x, const BitSet& y);
- friend BitSet operator ~ (const BitSet& x);
-
-// individual bit manipulation
-
- void set(int pos);
- void set(int from, int to);
- void set(); // set all
-
- void clear(int pos);
- void clear(int from, int to);
- void clear(); // clear all
-
- void invert(int pos);
- void invert(int from, int to);
-
- int test(int pos) const;
- int test(int from, int to) const;
-
- BitSetBit operator [] (int i);
-
-// iterators
-
- int first(int b = 1) const;
- int last(int b = 1) const;
-
- int next(int pos, int b = 1) const;
- int prev(int pos, int b = 1) const;
- int previous(int pos, int b = 1) const /* Obsolete synonym */
- { return prev(pos, b); }
-
-// status
-
- int empty() const;
- int virtual_bit() const;
- int count(int b = 1) const;
-
-// convertors & IO
-
- friend BitSet atoBitSet(const char* s,
- char f='0', char t='1', char star='*');
- // BitSettoa is deprecated; do not use in new programs.
- friend const char* BitSettoa(const BitSet& x,
- char f='0', char t='1', char star='*');
-
- friend BitSet shorttoBitSet(unsigned short w);
- friend BitSet longtoBitSet(unsigned long w);
-
- friend ostream& operator << (ostream& s, const BitSet& x);
- void printon(ostream& s,
- char f='0', char t='1', char star='*') const;
-
-#ifndef __STRICT_ANSI__
- // procedural versions of operators
-
- // The first three of these are incompatible with ANSI C++ digraphs.
- // In any case, it's not a great interface.
- friend void and(const BitSet& x, const BitSet& y, BitSet& r);
- friend void or(const BitSet& x, const BitSet& y, BitSet& r);
- friend void xor(const BitSet& x, const BitSet& y, BitSet& r);
- friend void diff(const BitSet& x, const BitSet& y, BitSet& r);
- friend void complement(const BitSet& x, BitSet& r);
-#endif
-
-// misc
-
- void error(const char* msg) const;
- int OK() const;
-};
-
-
-typedef BitSet BitSetTmp;
-
-// These are inlined regardless of optimization
-
-inline int BitSet_index(int l)
-{
- return (unsigned)(l) / BITSETBITS;
-}
-
-inline int BitSet_pos(int l)
-{
- return l & (BITSETBITS - 1);
-}
-
-inline BitSet::BitSet() : rep(&_nilBitSetRep) {}
-
-inline BitSet::BitSet(const BitSet& x) :rep(BitSetcopy(0, x.rep)) {}
-
-inline BitSet::~BitSet() { if (rep != &_nilBitSetRep) delete rep; }
-
-inline BitSet& BitSet::operator = (const BitSet& y)
-{
- rep = BitSetcopy(rep, y.rep);
- return *this;
-}
-
-inline int operator != (const BitSet& x, const BitSet& y) { return !(x == y); }
-
-inline int operator > (const BitSet& x, const BitSet& y) { return y < x; }
-
-inline int operator >= (const BitSet& x, const BitSet& y) { return y <= x; }
-
-#ifndef __STRICT_ANSI__
-inline void and(const BitSet& x, const BitSet& y, BitSet& r)
-{
- r.rep = BitSetop(x.rep, y.rep, r.rep, '&');
-}
-
-inline void or(const BitSet& x, const BitSet& y, BitSet& r)
-{
- r.rep = BitSetop(x.rep, y.rep, r.rep, '|');
-}
-
-inline void xor(const BitSet& x, const BitSet& y, BitSet& r)
-{
- r.rep = BitSetop(x.rep, y.rep, r.rep, '^');
-}
-
-inline void diff(const BitSet& x, const BitSet& y, BitSet& r)
-{
- r.rep = BitSetop(x.rep, y.rep, r.rep, '-');
-}
-
-inline void complement(const BitSet& x, BitSet& r)
-{
- r.rep = BitSetcmpl(x.rep, r.rep);
-}
-#endif
-
-inline BitSet operator & (const BitSet& x, const BitSet& y)
-{
- return BitSet::BitSet(x, y, BitSet::BS_and);
-}
-
-inline BitSet operator | (const BitSet& x, const BitSet& y)
-{
- return BitSet::BitSet(x, y, BitSet::BS_or);
-}
-
-inline BitSet operator ^ (const BitSet& x, const BitSet& y)
-{
- return BitSet::BitSet(x, y, BitSet::BS_xor);
-}
-
-inline BitSet operator - (const BitSet& x, const BitSet& y)
-{
- return BitSet::BitSet(x, y, BitSet::BS_diff);
-}
-
-inline BitSet operator ~ (const BitSet& x)
-{
- return BitSet::BitSet(x, BitSet::BS_inv);
-}
-
-inline BitSet& BitSet::operator &= (const BitSet& y)
-{
- rep = BitSetop(rep, y.rep, rep, '&');
- return *this;
-}
-
-inline BitSet& BitSet::operator |= (const BitSet& y)
-{
- rep = BitSetop(rep, y.rep, rep, '|');
- return *this;
-}
-
-inline BitSet& BitSet::operator ^= (const BitSet& y)
-{
- rep = BitSetop(rep, y.rep, rep, '^');
- return *this;
-}
-
-inline BitSet& BitSet::operator -= (const BitSet& y)
-{
- rep = BitSetop(rep, y.rep, rep, '-');
- return *this;
-}
-
-
-inline void BitSet::complement()
-{
- rep = BitSetcmpl(rep, rep);
-}
-
-inline int BitSet::virtual_bit() const
-{
- return rep->virt;
-}
-
-inline int BitSet::first(int b) const
-{
- return next(-1, b);
-}
-
-inline int BitSet::test(int p) const
-{
- if (p < 0) error("Illegal bit index");
- int index = BitSet_index(p);
- return (index >= rep->len)? rep->virt :
- ((rep->s[index] & ((_BS_word)1 << BitSet_pos(p))) != 0);
-}
-
-
-inline void BitSet::set()
-{
- rep = BitSetalloc(rep, 0, 0, 1, 0);
-}
-
-inline BitSetBit::BitSetBit(const BitSetBit& b) :src(b.src), pos(b.pos) {}
-
-inline BitSetBit::BitSetBit(BitSet* v, int p)
-{
- src = v; pos = p;
-}
-
-inline BitSetBit::~BitSetBit() {}
-
-inline BitSetBit::operator int() const
-{
- return src->test(pos);
-}
-
-inline int BitSetBit::operator = (int b)
-{
- if (b) src->set(pos); else src->clear(pos); return b;
-}
-
-inline int BitSetBit::operator = (const BitSetBit& b)
-{
- int i = (int)b;
- *this = i;
- return i;
-}
-
-inline BitSetBit BitSet::operator [] (int i)
-{
- if (i < 0) error("illegal bit index");
- return BitSetBit(this, i);
-}
-
-#endif
diff --git a/contrib/libg++/libg++/src/BitString.cc b/contrib/libg++/libg++/src/BitString.cc
deleted file mode 100644
index 32568fa7ef2d..000000000000
--- a/contrib/libg++/libg++/src/BitString.cc
+++ /dev/null
@@ -1,1608 +0,0 @@
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-/*
- BitString class implementation
- */
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <BitString.h>
-#include <std.h>
-#include <limits.h>
-#include <Obstack.h>
-#include <AllocRing.h>
-#include <new.h>
-#include <builtin.h>
-#include <strstream.h>
-
-#undef OK
-
-void BitString::error(const char* msg) const
-{
- (*lib_error_handler)("BitString", msg);
-}
-
-// globals
-
-BitStrRep _nilBitStrRep = { 0, 1, {0} };
-
-BitString _nil_BitString;
-
-#define MINBitStrRep_SIZE 8
-#define MAXBitStrRep_SIZE ((1 << (sizeof(short)*CHAR_BIT - 1)) - 1)
-
-#ifndef MALLOC_MIN_OVERHEAD
-#define MALLOC_MIN_OVERHEAD 4
-#endif
-
-#define ONES ((_BS_word)(~0L))
-#define MAXBIT (((_BS_word)1) << (BITSTRBITS - 1))
-
-/*
- * bit manipulation utilities
-*/
-
-// break things up into .s indices and positions
-
-inline static int BitStr_len(int l)
-{
- return (unsigned)(l) / BITSTRBITS + 1;
-}
-
-
-// mask out low bits
-
-static inline _BS_word lmask(int p)
-{
- return ONES _BS_RIGHT p;
-}
-
-// mask out high bits
-
-static inline _BS_word rmask(int p)
-{
- int s = BITSTRBITS - 1 - p;
- if (s <= 0)
- return ONES;
- else
- return ONES _BS_LEFT s;
-}
-
-
-// mask out unused bits in last word of rep
-
-inline static void check_last(BitStrRep* r)
-{
- int bit_len_mod = r->len & (BITSTRBITS - 1);
- if (bit_len_mod)
- r->s[r->len / BITSTRBITS] &= ONES _BS_LEFT (BITSTRBITS - bit_len_mod);
-}
-
-// merge bits from next word
-
-static inline _BS_word borrow_hi(const _BS_word a[], int ind,
- int maxind, int p)
-{
- if (p == 0)
- return a[ind];
- else if (ind < maxind)
- return (a[ind] _BS_LEFT p) | (a[ind+1] _BS_RIGHT (BITSTRBITS - p));
- else
- return (a[ind] _BS_LEFT p);
-}
-
-// merge bits from prev word
-
-static inline _BS_word borrow_lo(const _BS_word a[], int ind,
- int minind, int p)
-{
- _BS_word word = a[ind] _BS_RIGHT (BITSTRBITS - 1 - p);
- if (ind > minind)
- word |= (a[ind-1] _BS_LEFT (p + 1));
- return word;
-}
-
-// same with bounds check (for masks shorter than patterns)
-
-static inline _BS_word safe_borrow_hi(const _BS_word a[], int ind,
- int maxind, int p)
-{
- if (ind > maxind)
- return 0;
- else if (p == 0)
- return a[ind];
- else if (ind == maxind)
- return a[ind] _BS_LEFT p;
- else
- return (a[ind] _BS_LEFT p) | (a[ind+1] _BS_RIGHT (BITSTRBITS - p));
-}
-
-
-// allocate a new rep; pad to near a power of two
-
-inline static BitStrRep* BSnew(int newlen)
-{
- unsigned int siz = sizeof(BitStrRep) + BitStr_len(newlen) * sizeof(_BS_word)
- + MALLOC_MIN_OVERHEAD;
- unsigned int allocsiz = MINBitStrRep_SIZE;;
- while (allocsiz < siz) allocsiz <<= 1;
- allocsiz -= MALLOC_MIN_OVERHEAD;
- if (allocsiz >= MAXBitStrRep_SIZE * sizeof(_BS_word))
- (*lib_error_handler)("BitString", "Requested length out of range");
-
- BitStrRep* rep = new (operator new (allocsiz)) BitStrRep;
- memset(rep, 0, allocsiz);
- rep->sz =
- (allocsiz - sizeof(BitStrRep) + sizeof(_BS_word)) / sizeof(_BS_word);
- return rep;
-}
-
-inline void
-copy_bits (_BS_word* pdst, _BS_size_t dstbit,
- const _BS_word* psrc, _BS_size_t srcbit,
- _BS_size_t length)
-{
- _BS_NORMALIZE (pdst, dstbit);
- _BS_NORMALIZE (psrc, srcbit);
- _BS_copy (pdst, dstbit, psrc, srcbit, length);
-}
-
-BitStrRep* BStr_alloc(BitStrRep* old, const _BS_word* src,
- int startpos, int endp, int newlen)
-{
- if (old == &_nilBitStrRep) old = 0;
- if (newlen < 0) newlen = 0;
- int news = BitStr_len(newlen);
- BitStrRep* rep;
- if (old == 0 || news > old->sz)
- rep = BSnew(newlen);
- else
- rep = old;
- rep->len = newlen;
-
- if (src != 0 && endp > 0 && (src != rep->s || startpos > 0))
- copy_bits (rep->s, 0, src, startpos, endp - startpos);
-
- check_last(rep);
-
- if (old != rep && old != 0) delete old;
-
- return rep;
-}
-
-BitStrRep* BStr_resize(BitStrRep* old, int newlen)
-{
- BitStrRep* rep;
- if (newlen < 0) newlen = 0;
- int news = BitStr_len(newlen);
- if (old == 0 || old == &_nilBitStrRep)
- {
- rep = BSnew(newlen);
- }
- else if (news > old->sz)
- {
- rep = BSnew(newlen);
- memcpy(rep->s, old->s, BitStr_len(old->len) * sizeof(_BS_word));
- delete old;
- }
- else
- rep = old;
-
- rep->len = newlen;
- check_last(rep);
- return rep;
-}
-
-BitStrRep* BStr_copy(BitStrRep* old, const BitStrRep* src)
-{
- BitStrRep* rep;
- if (old == src && old != &_nilBitStrRep) return old;
- if (old == &_nilBitStrRep) old = 0;
- if (src == &_nilBitStrRep) src = 0;
- if (src == 0)
- {
- if (old == 0)
- rep = BSnew(0);
- else
- rep = old;
- rep->len = 0;
- }
- else
- {
- int newlen = src->len;
- int news = BitStr_len(newlen);
- if (old == 0 || news > old->sz)
- {
- rep = BSnew(newlen);
- if (old != 0) delete old;
- }
- else
- rep = old;
-
- memcpy(rep->s, src->s, news * sizeof(_BS_word));
- rep->len = newlen;
- }
- check_last(rep);
- return rep;
-}
-
-
-int operator == (const BitString& x, const BitString& y)
-{
- return x.rep->len == y.rep->len &&
- memcmp((void*)x.rep->s, (void*)y.rep->s,
- BitStr_len(x.rep->len) * sizeof(_BS_word)) == 0;
-}
-
-int operator <= (const BitString& x, const BitString& y)
-{
- unsigned int xl = x.rep->len;
- unsigned int yl = y.rep->len;
- if (xl > yl)
- return 0;
-
- const _BS_word* xs = x.rep->s;
- const _BS_word* topx = &(xs[BitStr_len(xl)]);
- const _BS_word* ys = y.rep->s;
-
- while (xs < topx)
- {
- _BS_word a = *xs++;
- _BS_word b = *ys++;
- if ((a | b) != b)
- return 0;
- }
- return 1;
-}
-
-int operator < (const BitString& x, const BitString& y)
-{
- unsigned short xl = x.rep->len;
- unsigned short yl = y.rep->len;
- if (xl > yl)
- return 0;
-
- const _BS_word* xs = x.rep->s;
- const _BS_word* ys = y.rep->s;
- const _BS_word* topx = &(xs[BitStr_len(xl)]);
- const _BS_word* topy = &(ys[BitStr_len(yl)]);
- int one_diff = 0;
- while (xs < topx)
- {
- _BS_word a = *xs++;
- _BS_word b = *ys++;
- _BS_word c = a | b;
- if (c != b)
- return 0;
- else if (c != a)
- one_diff = 1;
- }
- if (one_diff)
- return 1;
- else
- {
- while (ys < topy)
- if (*ys++ != 0)
- return 1;
- return 0;
- }
-}
-
-int lcompare(const BitString& x, const BitString& y)
-{
- return _BS_lcompare_0 (x.rep->s, x.rep->len, y.rep->s, y.rep->len);
-}
-
-int BitString::count(unsigned int b) const
-{
- int count = _BS_count (rep->s, 0, rep->len);
- if (!b)
- count = rep->len - count;
- return count;
-}
-
-
-BitStrRep* cmpl(const BitStrRep* src, BitStrRep* r)
-{
- r = BStr_copy(r, src);
- _BS_word* rs = r->s;
- _BS_word* topr = &(rs[BitStr_len(r->len)]);
- while (rs < topr)
- {
- _BS_word cmp = ~(*rs);
- *rs++ = cmp;
- }
- check_last(r);
- return r;
-}
-
-
-BitStrRep* and(const BitStrRep* x, const BitStrRep* y, BitStrRep* r)
-{
- int xrsame = x == r;
- int yrsame = y == r;
-
- unsigned int xl = x->len;
- unsigned int yl = y->len;
- unsigned int rl = (xl <= yl)? xl : yl;
-
- r = BStr_resize(r, rl);
-
- _BS_word* rs = r->s;
- _BS_word* topr = &(rs[BitStr_len(rl)]);
- const _BS_word* xs = (xrsame)? rs : x->s;
- const _BS_word* ys = (yrsame)? rs : y->s;
-
- while (rs < topr) *rs++ = *xs++ & *ys++;
- check_last(r);
- return r;
-}
-
-BitStrRep* or(const BitStrRep* x, const BitStrRep* y, BitStrRep* r)
-{
- unsigned int xl = x->len;
- unsigned int yl = y->len;
- unsigned int rl = (xl >= yl)? xl : yl;
- int xrsame = x == r;
- int yrsame = y == r;
-
- r = BStr_resize(r, rl);
-
- _BS_word* rs = r->s;
- const _BS_word* xs = (xrsame)? rs : x->s;
- const _BS_word* topx = &(xs[BitStr_len(xl)]);
- const _BS_word* ys = (yrsame)? rs : y->s;
- const _BS_word* topy = &(ys[BitStr_len(yl)]);
-
- if (xl <= yl)
- {
- while (xs < topx) *rs++ = *xs++ | *ys++;
- if (rs != ys) while (ys < topy) *rs++ = *ys++;
- }
- else
- {
- while (ys < topy) *rs++ = *xs++ | *ys++;
- if (rs != xs) while (xs < topx) *rs++ = *xs++;
- }
- check_last(r);
- return r;
-}
-
-
-BitStrRep* xor(const BitStrRep* x, const BitStrRep* y, BitStrRep* r)
-{
- unsigned int xl = x->len;
- unsigned int yl = y->len;
- unsigned int rl = (xl >= yl)? xl : yl;
- int xrsame = x == r;
- int yrsame = y == r;
-
- r = BStr_resize(r, rl);
-
- _BS_word* rs = r->s;
- const _BS_word* xs = (xrsame)? rs : x->s;
- const _BS_word* topx = &(xs[BitStr_len(xl)]);
- const _BS_word* ys = (yrsame)? rs : y->s;
- const _BS_word* topy = &(ys[BitStr_len(yl)]);
-
- if (xl <= yl)
- {
- while (xs < topx) *rs++ = *xs++ ^ *ys++;
- if (rs != ys) while (ys < topy) *rs++ = *ys++;
- }
- else
- {
- while (ys < topy) *rs++ = *xs++ ^ *ys++;
- if (rs != xs) while (xs < topx) *rs++ = *xs++;
- }
- check_last(r);
- return r;
-}
-
-
-BitStrRep* diff(const BitStrRep* x, const BitStrRep* y, BitStrRep* r)
-{
- unsigned int xl = x->len;
- unsigned int yl = y->len;
- int xrsame = x == y;
- int yrsame = y == r;
-
- r = BStr_resize(r, xl);
-
- _BS_word* rs = r->s;
- const _BS_word* xs = (xrsame)? rs : x->s;
- const _BS_word* topx = &(xs[BitStr_len(xl)]);
- const _BS_word* ys = (yrsame)? rs : y->s;
- const _BS_word* topy = &(ys[BitStr_len(yl)]);
-
- if (xl <= yl)
- {
- while (xs < topx) *rs++ = *xs++ & ~(*ys++);
- }
- else
- {
- while (ys < topy) *rs++ = *xs++ & ~(*ys++);
- if (rs != xs) while (xs < topx) *rs++ = *xs++;
- }
- check_last(r);
- return r;
-}
-
-
-BitStrRep* cat(const BitStrRep* x, const BitStrRep* y, BitStrRep* r)
-{
- unsigned int xl = x->len;
- unsigned int yl = y->len;
- unsigned int rl = xl + yl;
- int xrsame = x == r;
- int yrsame = y == r;
-
- if (yrsame)
- {
- if (xrsame)
- {
- r = BStr_resize(r, rl);
- copy_bits (r->s, xl, r->s, 0, yl);
- }
- else
- {
- BitStrRep* tmp = BStr_copy(0, y);
- r = BStr_resize(r, rl);
- _BS_copy_0(r->s, x->s, xl);
- copy_bits (r->s, xl, tmp->s, 0, yl);
- delete tmp;
- }
- }
- else
- {
- r = BStr_resize(r, rl);
- if (!xrsame) _BS_copy_0(r->s, x->s, xl);
- copy_bits (r->s, xl, y->s, 0, yl);
- }
- check_last(r);
- return r;
-}
-
-BitStrRep* cat(const BitStrRep* x, unsigned int bit, BitStrRep* r)
-{
- unsigned int xl = x->len;
- int xrsame = x == r;
- r = BStr_resize(r, xl+1);
- if (!xrsame)
- _BS_copy_0(r->s, x->s, xl);
- if (bit)
- r->s[BitStr_index(xl)] |= _BS_BITMASK(BitStr_pos(xl));
- else
- r->s[BitStr_index(xl)] &= ~(_BS_BITMASK(BitStr_pos(xl)));
- check_last(r);
- return r;
-}
-
-BitStrRep* lshift(const BitStrRep* x, int s, BitStrRep* r)
-{
- int xrsame = x == r;
- int xl = x->len;
- int rl = xl + s;
- if (s == 0)
- r = BStr_copy(r, x);
- else if (rl <= 0)
- {
- r = BStr_resize(r, 0);
- r->len = 0;
- r->s[0] = 0;
- }
- else if (s > 0)
- {
- r = BStr_resize(r, rl);
- const _BS_word* xs = (xrsame)? r->s : x->s;
- copy_bits (r->s, s, xs, 0, xl);
- _BS_clear (r->s, 0, s);
- }
- else if (xrsame)
- {
- r = BStr_resize(r, xl);
- r->len = rl;
- copy_bits (r->s, 0, r->s, -s, xl + s);
- }
- else
- {
- r = BStr_resize(r, rl);
- copy_bits (r->s, 0, x->s, -s, xl + s);
- }
- check_last(r);
- return r;
-}
-
-
-void BitString::set(int p)
-{
- if (p < 0) error("Illegal bit index");
- if ((unsigned)(p) >= rep->len) rep = BStr_resize(rep, p + 1);
- rep->s[BitStr_index(p)] |= _BS_BITMASK(BitStr_pos(p));
-}
-
-void BitString::assign(int p, unsigned int bit)
-{
- if (p < 0) error("Illegal bit index");
- if ((unsigned)(p) >= rep->len) rep = BStr_resize(rep, p + 1);
- if (bit)
- rep->s[BitStr_index(p)] |= _BS_BITMASK(BitStr_pos(p));
- else
- rep->s[BitStr_index(p)] &= ~(_BS_BITMASK(BitStr_pos(p)));
-}
-
-void BitString::clear(int p)
-{
- if (p < 0) error("Illegal bit index");
- if ((unsigned)(p) >= rep->len) rep = BStr_resize(rep, p + 1);
- rep->s[BitStr_index(p)] &= ~(_BS_BITMASK(BitStr_pos(p)));
-}
-
-void BitString::clear()
-{
- if (rep == &_nilBitStrRep) return;
- _BS_clear (rep->s, 0, rep->len);
-}
-
-void BitString::set()
-{
- if (rep == &_nilBitStrRep) return;
- _BS_word* s = rep->s;
- _BS_word* tops = &(s[BitStr_len(rep->len)]);
- while (s < tops) *s++ = ONES;
- check_last(rep);
-}
-
-void BitString::invert(int p)
-{
- if (p < 0) error("Illegal bit index");
- if ((unsigned)(p) >= rep->len) rep = BStr_resize(rep, p + 1);
- rep->s[BitStr_index(p)] ^= _BS_BITMASK(BitStr_pos(p));
-}
-
-void BitString::set(int from, int to)
-{
- if (from < 0 || from > to) error("Illegal bit index");
- if ((unsigned)(to) >= rep->len) rep = BStr_resize(rep, to+1);
-
- _BS_size_t len = to - from + 1;
- _BS_word* xs = rep->s;
- _BS_NORMALIZE (xs, from);
- _BS_invert (xs, from, len);
-}
-
-void BitString::clear(int from, int to)
-{
- if (from < 0 || from > to) error("Illegal bit index");
- if ((unsigned)(to) >= rep->len) rep = BStr_resize(rep, to+1);
-
- _BS_size_t len = to - from + 1;
- _BS_word* xs = rep->s;
- _BS_NORMALIZE (xs, from);
- _BS_clear (xs, from, len);
-}
-
-void BitString::invert(int from, int to)
-{
- if (from < 0 || from > to) error("Illegal bit index");
- if ((unsigned)(to) >= rep->len) rep = BStr_resize(rep, to+1);
- _BS_size_t len = to - from + 1;
- _BS_word* xs = rep->s;
- _BS_NORMALIZE (xs, from);
- _BS_invert (xs, from, len);
-}
-
-
-int BitString::test(int from, int to) const
-{
- if (from < 0 || from > to || (unsigned)(from) >= rep->len) return 0;
-
- _BS_size_t len = to - from + 1;
- _BS_word* xs = rep->s;
- _BS_NORMALIZE (xs, from);
- return _BS_any (xs, from, len);
-}
-
-int BitString::next(int p, unsigned int b) const
-{
- if ((unsigned)(++p) >= rep->len)
- return -1;
-
- int ind = BitStr_index(p);
- int pos = BitStr_pos(p);
- int l = BitStr_len(rep->len);
-
- int j = ind;
- const _BS_word* s = rep->s;
- _BS_word a = s[j] >> pos;
- int i = pos;
-
- if (b != 0)
- {
- for (; i < BITSTRBITS && a != 0; ++i)
- {
- if (a & 1)
- return j * BITSTRBITS + i;
- a >>= 1;
- }
- for (++j; j < l; ++j)
- {
- a = s[j];
- for (i = 0; i < BITSTRBITS && a != 0; ++i)
- {
- if (a & 1)
- return j * BITSTRBITS + i;
- a >>= 1;
- }
- }
- return -1;
- }
- else
- {
- int last = BitStr_pos(rep->len);
- if (j == l - 1)
- {
- for (; i < last; ++i)
- {
- if ((a & 1) == 0)
- return j * BITSTRBITS + i;
- a >>= 1;
- }
- return -1;
- }
-
- for (; i < BITSTRBITS; ++i)
- {
- if ((a & 1) == 0)
- return j * BITSTRBITS + i;
- a >>= 1;
- }
- for (++j; j < l - 1; ++j)
- {
- a = s[j];
- if (a != ONES)
- {
- for (i = 0; i < BITSTRBITS; ++i)
- {
- if ((a & 1) == 0)
- return j * BITSTRBITS + i;
- a >>= 1;
- }
- }
- }
- a = s[j];
- for (i = 0; i < last; ++i)
- {
- if ((a & 1) == 0)
- return j * BITSTRBITS + i;
- a >>= 1;
- }
- return -1;
- }
-}
-
-int BitString::prev(int p, unsigned int b) const
-{
- if (--p < 0)
- return -1;
-
- int ind = BitStr_index(p);
- int pos = BitStr_pos(p);
-
- const _BS_word* s = rep->s;
-
- if ((unsigned)(p) >= rep->len)
- {
- ind = BitStr_index(rep->len - 1);
- pos = BitStr_pos(rep->len - 1);
- }
-
- int j = ind;
- _BS_word a = s[j];
-
- int i = pos;
- _BS_word maxbit = ((_BS_word)1) << pos;
-
- if (b != 0)
- {
- for (; i >= 0 && a != 0; --i)
- {
- if (a & maxbit)
- return j * BITSTRBITS + i;
- a <<= 1;
- }
- maxbit = ((_BS_word)1) << (BITSTRBITS - 1);
- for (--j; j >= 0; --j)
- {
- a = s[j];
- for (i = BITSTRBITS - 1; i >= 0 && a != 0; --i)
- {
- if (a & maxbit)
- return j * BITSTRBITS + i;
- a <<= 1;
- }
- }
- return -1;
- }
- else
- {
- if (a != ONES)
- {
- for (; i >= 0; --i)
- {
- if ((a & maxbit) == 0)
- return j * BITSTRBITS + i;
- a <<= 1;
- }
- }
- maxbit = ((_BS_word)1) << (BITSTRBITS - 1);
- for (--j; j >= 0; --j)
- {
- a = s[j];
- if (a != ONES)
- {
- for (i = BITSTRBITS - 1; i >= 0; --i)
- {
- if ((a & maxbit) == 0)
- return j * BITSTRBITS + i;
- a <<= 1;
- }
- }
- }
- return -1;
- }
-}
-
-
-int BitString::search(int startx, int lengthx,
- const _BS_word* ys, int starty, int lengthy) const
-{
- const _BS_word* xs = rep->s;
- int ylen = lengthy - starty;
- int righty = lengthy - 1;
- int rev = startx < 0;
- if (rev)
- {
- int leftx = 0;
- int rightx = lengthx + startx;
- startx = rightx - ylen + 1;
- if (ylen == 0) return startx;
- if (starty < 0 || righty < 0 || startx < 0 || startx >= lengthx) return -1;
-
- int xind = BitStr_index(startx);
- int xpos = BitStr_pos(startx);
- int yind = BitStr_index(starty);
- int ypos = BitStr_pos(starty);
-
- int rightxind = BitStr_index(rightx);
-
- _BS_word x = borrow_hi(xs, xind, rightxind, xpos);
-
- int rightyind = BitStr_index(righty);
- int rightypos = BitStr_pos(righty);
- _BS_word y = borrow_hi(ys, yind, rightyind, ypos);
- _BS_word ymask;
- if (yind == rightyind)
- ymask = rmask(rightypos);
- else if (yind+1 == rightyind)
- ymask = rmask(BITSTRBITS - ypos + rightypos + 1);
- else
- ymask = ONES;
-
- int p = startx;
- for (;;)
- {
- if ((x & ymask) == y)
- {
- int xi = xind;
- int yi = yind;
- for (;;)
- {
- if (++yi > rightyind || ++xi > rightxind)
- return p;
- _BS_word tx = borrow_hi(xs, xi, rightxind, xpos);
- _BS_word ty = borrow_hi(ys, yi, rightyind, ypos);
- if (yi == rightyind)
- tx &= rmask(rightypos);
- else if (yi+1 == rightyind)
- tx &= rmask(BITSTRBITS - ypos + rightypos + 1);
- if (tx != ty)
- break;
- }
- }
- if (--p < leftx)
- return -1;
- if (--xpos < 0)
- {
- xpos = BITSTRBITS - 1;
- --xind;
- }
- x = borrow_hi(xs, xind, rightxind, xpos);
- }
- }
- else
- {
-
- int rightx = lengthx - 1;
- if (ylen == 0) return startx;
- if (starty < 0 || righty < 0 || startx < 0 || startx >= lengthx) return -1;
-
- int xind = BitStr_index(startx);
- int xpos = BitStr_pos(startx);
- int yind = BitStr_index(starty);
- int ypos = BitStr_pos(starty);
-
- int rightxind = BitStr_index(rightx);
-
- _BS_word x = borrow_hi(xs, xind, rightxind, xpos);
- _BS_word nextx = (xind >= rightxind) ? 0 : (xs[xind+1] >> xpos);
-
- int rightyind = BitStr_index(righty);
- int rightypos = BitStr_pos(righty);
- _BS_word y = borrow_hi(ys, yind, rightyind, ypos);
- _BS_word ymask;
- if (yind == rightyind)
- ymask = rmask(rightypos);
- else if (yind+1 == rightyind)
- ymask = rmask(BITSTRBITS - ypos + rightypos + 1);
- else
- ymask = ONES;
-
- int p = startx;
- for (;;)
- {
- if ((x & ymask) == y)
- {
- int xi = xind;
- int yi = yind;
- for (;;)
- {
- if (++yi > rightyind || ++xi > rightxind)
- return p;
- _BS_word tx = borrow_hi(xs, xi, rightxind, xpos);
- _BS_word ty = borrow_hi(ys, yi, rightyind, ypos);
- if (yi == rightyind)
- tx &= rmask(rightypos);
- else if (yi+1 == rightyind)
- tx &= rmask(BITSTRBITS - ypos + rightypos + 1);
- if (tx != ty)
- break;
- }
- }
- if (++p > rightx)
- return -1;
- if (++xpos == BITSTRBITS)
- {
- xpos = 0;
- x = xs[++xind];
- nextx = (xind >= rightxind) ? 0 : xs[xind+1];
- }
- else
- {
- x >>= 1;
- if (nextx & 1)
- x |= MAXBIT;
- nextx >>= 1;
- }
- }
- }
-}
-
-
-int BitPattern::search(const _BS_word* xs, int startx, int lengthx) const
-{
- const _BS_word* ys = pattern.rep->s;
- const _BS_word* ms = mask.rep->s;
- int righty = pattern.rep->len - 1;
- int rightm = mask.rep->len - 1;
-
- int rev = startx < 0;
- if (rev)
- {
- int leftx = 0;
- int rightx = lengthx + startx;
- startx = rightx - righty;
-
- if (righty < 0) return startx;
- if (startx < 0 || startx >= lengthx) return -1;
-
- int xind = BitStr_index(startx);
- int xpos = BitStr_pos(startx);
-
- int rightxind = BitStr_index(rightx);
-
- int rightmind = BitStr_index(rightm);
- int rightyind = BitStr_index(righty);
-
- _BS_word x = safe_borrow_hi(xs, xind, rightxind, xpos);
- _BS_word m = safe_borrow_hi(ms, 0, rightmind, 0);
- _BS_word y = safe_borrow_hi(ys, 0, rightyind, 0) & m;
-
- int p = startx;
- for (;;)
- {
- if ((x & m) == y)
- {
- int xi = xind;
- int yi = 0;
- for (;;)
- {
- if (++yi > rightyind || ++xi > rightxind)
- return p;
- _BS_word tm = safe_borrow_hi(ms, yi, rightmind, 0);
- _BS_word ty = safe_borrow_hi(ys, yi, rightyind, 0);
- _BS_word tx = safe_borrow_hi(xs, xi, rightxind, xpos);
- if ((tx & tm) != (ty & tm))
- break;
- }
- }
- if (--p < leftx)
- return -1;
- if (--xpos < 0)
- {
- xpos = BITSTRBITS - 1;
- --xind;
- }
- x = safe_borrow_hi(xs, xind, rightxind, xpos);
- }
- }
- else
- {
-
- int rightx = lengthx - 1;
-
- if (righty < 0) return startx;
- if (startx < 0 || startx >= lengthx) return -1;
-
- int xind = BitStr_index(startx);
- int xpos = BitStr_pos(startx);
-
- int rightxind = BitStr_index(rightx);
-
- int rightmind = BitStr_index(rightm);
- int rightyind = BitStr_index(righty);
-
- _BS_word x = safe_borrow_hi(xs, xind, rightxind, xpos);
- _BS_word m = safe_borrow_hi(ms, 0, rightmind, 0);
- _BS_word y = safe_borrow_hi(ys, 0, rightyind, 0) & m;
-
- _BS_word nextx = (xind >= rightxind) ? 0 : (xs[xind+1] >> xpos);
-
- int p = startx;
- for (;;)
- {
- if ((x & m) == y)
- {
- int xi = xind;
- int yi = 0;
- for (;;)
- {
- if (++yi > rightyind || ++xi > rightxind)
- return p;
- _BS_word tm = safe_borrow_hi(ms, yi, rightmind, 0);
- _BS_word ty = safe_borrow_hi(ys, yi, rightyind, 0);
- _BS_word tx = safe_borrow_hi(xs, xi, rightxind, xpos);
- if ((tx & tm) != (ty & tm))
- break;
- }
- }
- if (++p > rightx)
- return -1;
- if (++xpos == BITSTRBITS)
- {
- xpos = 0;
- x = xs[++xind];
- nextx = (xind >= rightxind) ? 0 : xs[xind+1];
- }
- else
- {
- x >>= 1;
- if (nextx & 1)
- x |= MAXBIT;
- nextx >>= 1;
- }
- }
- }
-}
-
-int BitString::match(int startx, int lengthx, int exact,
- const _BS_word* ys, int starty, int yl) const
-{
- const _BS_word* xs = rep->s;
- int ylen = yl - starty;
- int righty = yl - 1;
-
- int rightx;
- int rev = startx < 0;
- if (rev)
- {
- rightx = lengthx + startx;
- startx = rightx - ylen + 1;
- if (exact && startx != 0)
- return 0;
- }
- else
- {
- rightx = lengthx - 1;
- if (exact && rightx - startx != righty)
- return 0;
- }
-
- if (ylen == 0) return 1;
- if (righty < 0 || startx < 0 || startx >= lengthx) return 0;
-
- int xi = BitStr_index(startx);
- int xpos = BitStr_pos(startx);
- int yi = BitStr_index(starty);
- int ypos = BitStr_pos(starty);
-
- int rightxind = BitStr_index(rightx);
- int rightyind = BitStr_index(righty);
- int rightypos = BitStr_pos(righty);
-
- for (;;)
- {
- _BS_word x = borrow_hi(xs, xi, rightxind, xpos);
- _BS_word y = borrow_hi(ys, yi, rightyind, ypos);
- if (yi == rightyind)
- x &= rmask(rightypos);
- else if (yi+1 == rightyind)
- x &= rmask(BITSTRBITS - ypos + rightypos + 1);
- if (x != y)
- return 0;
- else if (++yi > rightyind || ++xi > rightxind)
- return 1;
- }
-}
-
-int BitPattern::match(const _BS_word* xs, int startx,
- int lengthx, int exact) const
-{
- const _BS_word* ys = pattern.rep->s;
- int righty = pattern.rep->len - 1;
- _BS_word* ms = mask.rep->s;
- int rightm = mask.rep->len - 1;
-
- int rightx;
- int rev = startx < 0;
- if (rev)
- {
- rightx = lengthx + startx;
- startx = rightx - righty;
- if (exact && startx != 0)
- return 0;
- }
- else
- {
- rightx = lengthx - 1;
- if (exact && rightx - startx != righty)
- return 0;
- }
-
- if (righty < 0) return 1;
- if (startx < 0 || startx >= lengthx) return 0;
-
- int xind = BitStr_index(startx);
- int xpos = BitStr_pos(startx);
- int yind = 0;
-
- int rightxind = BitStr_index(rightx);
- int rightyind = BitStr_index(righty);
- int rightmind = BitStr_index(rightm);
-
- for(;;)
- {
- _BS_word m = safe_borrow_hi(ms, yind, rightmind, 0);
- _BS_word x = safe_borrow_hi(xs, xind, rightxind, xpos) & m;
- _BS_word y = safe_borrow_hi(ys, yind, rightyind, 0) & m;
- if (x != y)
- return 0;
- else if (++yind > rightyind || ++xind > rightxind)
- return 1;
- }
-}
-
-BitSubString& BitSubString::operator = (const BitString& y)
-{
- if (&S == &_nil_BitString)
- return *this;
- BitStrRep* targ = S.rep;
-
- unsigned int ylen = y.rep->len;
- int sl = targ->len - len + ylen;
-
- if (y.rep == targ || ylen > len)
- {
- BitStrRep* oldtarg = targ;
- targ = BStr_alloc(0, 0, 0, 0, sl);
- _BS_copy (targ->s, 0, oldtarg->s, 0, pos);
- copy_bits (targ->s, pos, y.rep->s, 0, ylen);
- copy_bits (targ->s, pos + ylen, oldtarg->s, pos+len, oldtarg->len-pos-len);
- delete oldtarg;
- }
- else if (len == ylen)
- copy_bits (targ->s, pos, y.rep->s, 0, len);
- else if (ylen < len)
- {
- copy_bits (targ->s, pos, y.rep->s, 0, ylen);
- copy_bits (targ->s, pos + ylen, targ->s, pos + len, targ->len - pos - len);
- targ->len = sl;
- }
- check_last(targ);
- S.rep = targ;
- return *this;
-}
-
-BitSubString& BitSubString::operator = (const BitSubString& y)
-{
- if (&S == &_nil_BitString)
- return *this;
- BitStrRep* targ = S.rep;
-
- if (len == 0 || pos >= targ->len)
- return *this;
-
- int sl = targ->len - len + y.len;
-
- if (y.S.rep == targ || y.len > len)
- {
- BitStrRep* oldtarg = targ;
- targ = BStr_alloc(0, 0, 0, 0, sl);
- _BS_copy_0(targ->s, oldtarg->s, pos);
- copy_bits (targ->s, pos, y.S.rep->s, y.pos, y.len);
- copy_bits (targ->s, pos + y.len, oldtarg->s, pos+len,
- oldtarg->len-pos-len);
- delete oldtarg;
- }
- else if (len == y.len)
- copy_bits (targ->s, pos, y.S.rep->s, y.pos, y.len);
- else if (y.len < len)
- {
- copy_bits (targ->s, pos, y.S.rep->s, y.pos, y.len);
- copy_bits (targ->s, pos + y.len, targ->s, pos + len,
- targ->len - pos - len);
- targ->len = sl;
- }
- check_last(targ);
- S.rep = targ;
- return *this;
-}
-
-BitSubString BitString::at(int first, int len)
-{
- return _substr(first, len);
-}
-
-BitSubString BitString::before(int pos)
-{
- return _substr(0, pos);
-}
-
-BitSubString BitString::after(int pos)
-{
- return _substr(pos + 1, rep->len - (pos + 1));
-}
-
-BitSubString BitString::at(const BitString& y, int startpos)
-{
- int first = search(startpos, rep->len, y.rep->s, 0, y.rep->len);
- return _substr(first, y.rep->len);
-}
-
-BitSubString BitString::before(const BitString& y, int startpos)
-{
- int last = search(startpos, rep->len, y.rep->s, 0, y.rep->len);
- return _substr(0, last);
-}
-
-BitSubString BitString::after(const BitString& y, int startpos)
-{
- int first = search(startpos, rep->len, y.rep->s, 0, y.rep->len);
- if (first >= 0) first += y.rep->len;
- return _substr(first, rep->len - first);
-}
-
-
-BitSubString BitString::at(const BitSubString& y, int startpos)
-{
- int first = search(startpos, rep->len, y.S.rep->s, y.pos, y.len);
- return _substr(first, y.len);
-}
-
-BitSubString BitString::before(const BitSubString& y, int startpos)
-{
- int last = search(startpos, rep->len, y.S.rep->s, y.pos, y.len);
- return _substr(0, last);
-}
-
-BitSubString BitString::after(const BitSubString& y, int startpos)
-{
- int first = search(startpos, rep->len, y.S.rep->s, y.pos, y.len);
- if (first >= 0) first += y.len;
- return _substr(first, rep->len - first);
-}
-
-BitSubString BitString::at(const BitPattern& r, int startpos)
-{
- int first = r.search(rep->s, startpos, rep->len);
- return _substr(first, r.pattern.rep->len);
-}
-
-
-BitSubString BitString::before(const BitPattern& r, int startpos)
-{
- int first = r.search(rep->s, startpos, rep->len);
- return _substr(0, first);
-}
-
-BitSubString BitString::after(const BitPattern& r, int startpos)
-{
- int first = r.search(rep->s, startpos, rep->len);
- if (first >= 0) first += r.pattern.rep->len;
- return _substr(first, rep->len - first);
-}
-
-#if defined(__GNUG__) && !defined(_G_NO_NRV)
-#define RETURN(r) return
-#define RETURNS(r) return r;
-#define RETURN_OBJECT(TYPE, NAME) /* nothing */
-#define USE_UNSIGNED 1 /* probably correct */
-#else /* _G_NO_NRV */
-#define RETURN(r) return r
-#define RETURNS(r) /* nothing */
-#define RETURN_OBJECT(TYPE, NAME) TYPE NAME;
-#define USE_UNSIGNED 0 /* probably old bug */
-#endif
-
-BitString
-common_prefix (const BitString& x, const BitString& y, int startpos)
- RETURNS(r)
-{
- RETURN_OBJECT(BitString, r);
- unsigned int xl = x.rep->len;
- unsigned int yl = y.rep->len;
-
- unsigned int startx, starty;
- if (startpos < 0)
- {
- startx = xl + startpos;
- starty = yl + startpos;
- }
- else
- startx = starty = startpos;
-
- if (startx >= xl || starty >= yl)
- RETURN(r);
-
- const _BS_word* xs = &(x.rep->s[BitStr_index(startx)]);
- _BS_word a = *xs++;
- unsigned int xp = startx;
-
- const _BS_word* ys = &(y.rep->s[BitStr_index(starty)]);
- _BS_word b = *ys++;
- unsigned int yp = starty;
-
- for(; xp < xl && yp < yl; ++xp, ++yp)
- {
- _BS_word xbit = ((_BS_word)1) << (BitStr_pos(xp));
- _BS_word ybit = ((_BS_word)1) << (BitStr_pos(yp));
- if (((a & xbit) == 0) != ((b & ybit) == 0))
- break;
- if (xbit == MAXBIT)
- a = *xs++;
- if (ybit == MAXBIT)
- b = *ys++;
- }
- r.rep = BStr_alloc(0, x.rep->s, startx, xp, xp - startx);
- RETURN(r);
-}
-
-
-BitString
-common_suffix (const BitString& x, const BitString& y, int startpos)
- RETURNS(r)
-{
- RETURN_OBJECT(BitString, r);
- unsigned int xl = x.rep->len;
- unsigned int yl = y.rep->len;
-
- unsigned int startx, starty;
- if (startpos < 0)
- {
- startx = xl + startpos;
- starty = yl + startpos;
- }
- else
- startx = starty = startpos;
-
- if (startx >= xl || starty >= yl)
- RETURN(r);
-
- const _BS_word* xs = &(x.rep->s[BitStr_index(startx)]);
- _BS_word a = *xs--;
- int xp = startx;
-
- const _BS_word* ys = &(y.rep->s[BitStr_index(starty)]);
- _BS_word b = *ys--;
- int yp = starty;
-
- for(; xp >= 0 && yp >= 0; --xp, --yp)
- {
- _BS_word xbit = ((_BS_word)1) << (BitStr_pos(xp));
- _BS_word ybit = ((_BS_word)1) << (BitStr_pos(yp));
- if (((a & xbit) == 0) != ((b & ybit) == 0))
- break;
- if (xbit == 1)
- a = *xs--;
- if (ybit == 1)
- b = *ys--;
- }
- r.rep = BStr_alloc(0, x.rep->s, xp+1, startx+1, startx - xp);
- RETURN(r);
-}
-
-BitString reverse (const BitString& x)
- RETURNS(r)
-{
- RETURN_OBJECT(BitString, r);
- unsigned int yl = x.rep->len;
- BitStrRep* y = BStr_resize(0, yl);
- if (yl > 0)
- {
- const _BS_word* ls = x.rep->s;
- _BS_word lm = 1;
- _BS_word* rs = &(y->s[BitStr_index(yl - 1)]);
- _BS_word rm = ((_BS_word)1) << (BitStr_pos(yl - 1));
- for (unsigned int l = 0; l < yl; ++l)
- {
- if (*ls & lm)
- *rs |= rm;
- if (lm == MAXBIT)
- {
- ++ls;
- lm = 1;
- }
- else
- lm <<= 1;
- if (rm == 1)
- {
- --rs;
- rm = MAXBIT;
- }
- else
- rm >>= 1;
- }
- }
- r.rep = y;
- RETURN(r);
-}
-
-BitString
-atoBitString (const char* s, char f, char t)
- RETURNS(res)
-{
- RETURN_OBJECT(BitString, res);
- int sl = strlen(s);
- BitStrRep* r = BStr_resize(0, sl);
- if (sl != 0)
- {
- unsigned int rl = 0;
- _BS_word* rs = r->s;
- _BS_word a = 0;
- _BS_word m = 1;
- unsigned int i = 0;
- for(;;)
- {
- char ch = s[i];
- if (ch != t && ch != f)
- {
- *rs = a;
- break;
- }
- ++rl;
- if (ch == t)
- a |= m;
- if (++i == sl)
- {
- *rs = a;
- break;
- }
- else if (i % BITSTRBITS == 0)
- {
- *rs++ = a;
- a = 0;
- m = 1;
- }
- else
- m <<= 1;
- }
- r = BStr_resize(r, rl);
- }
- res.rep = r;
- RETURN(res);
-}
-
-BitPattern
-atoBitPattern (const char* s, char f,char t,char x)
- RETURNS(r)
-{
- RETURN_OBJECT(BitPattern, r);
- int sl = strlen(s);
- if (sl != 0)
- {
- unsigned int rl = 0;
- r.pattern.rep = BStr_resize(r.pattern.rep, sl);
- r.mask.rep = BStr_resize(r.mask.rep, sl);
- _BS_word* rs = r.pattern.rep->s;
- _BS_word* ms = r.mask.rep->s;
- _BS_word a = 0;
- _BS_word b = 0;
- _BS_word m = 1;
- unsigned int i = 0;
- for(;;)
- {
- char ch = s[i];
- if (ch != t && ch != f && ch != x)
- {
- *rs = a;
- *ms = b;
- break;
- }
- ++rl;
- if (ch == t)
- {
- a |= m;
- b |= m;
- }
- else if (ch == f)
- {
- b |= m;
- }
- if (++i == sl)
- {
- *rs = a;
- *ms = b;
- break;
- }
- else if (i % BITSTRBITS == 0)
- {
- *rs++ = a;
- *ms++ = b;
- a = 0;
- b = 0;
- m = 1;
- }
- else
- m <<= 1;
- }
- r.pattern.rep = BStr_resize(r.pattern.rep, rl);
- r.mask.rep = BStr_resize(r.mask.rep, rl);
- }
- RETURN(r);
-}
-
-extern AllocRing _libgxx_fmtq;
-
-void BitString::printon (ostream& os, char f, char t) const
-{
- unsigned int xl = rep->len;
- const _BS_word* ptr = rep->s;
- register streambuf *sb = os.rdbuf();
- _BS_word a = 0;
-
- for (unsigned int i = 0; i < xl; ++i)
- {
- if (i % BITSTRBITS == 0)
- a = *ptr++;
- sb->sputc((a & 1)? t : f);
- a >>= 1;
- }
-}
-const char* BitStringtoa(const BitString& x, char f, char t)
-{
- int wrksiz = x.length() + 2;
- char* fmtbase = (char *) _libgxx_fmtq.alloc(wrksiz);
- ostrstream stream(fmtbase, wrksiz);
-
- x.printon(stream, f, t);
- stream << ends;
- return fmtbase;
-}
-
-ostream& operator << (ostream& s, const BitString& x)
-{
- if (s.opfx())
- x.printon(s);
- return s;
-}
-
-const char* BitPatterntoa(const BitPattern& p, char f,char t,char x)
-{
- unsigned int pl = p.pattern.rep->len;
- unsigned int ml = p.mask.rep->len;
- unsigned int l = (pl <= ml)? pl : ml;
-
- int wrksiz = l + 2;
- char* fmtbase = (char *) _libgxx_fmtq.alloc(wrksiz);
- ostrstream stream(fmtbase, wrksiz);
-
- p.printon(stream, f, t, x);
- stream << ends;
- return fmtbase;
-}
-
-void BitPattern::printon(ostream& s, char f,char t,char x) const
-{
- unsigned int pl = pattern.rep->len;
- unsigned int ml = mask.rep->len;
- unsigned int l = (pl <= ml)? pl : ml;
- register streambuf *sb = s.rdbuf();
-
- const _BS_word* ps = pattern.rep->s;
- const _BS_word* ms = mask.rep->s;
- _BS_word a = 0;
- _BS_word m = 0;
-
- for (unsigned int i = 0; i < l; ++i)
- {
- if (i % BITSTRBITS == 0)
- {
- a = *ps++;
- m = *ms++;
- }
- if (m & 1)
- sb->sputc((a & 1)? t : f);
- else
- sb->sputc(x);
- a >>= 1;
- m >>= 1;
- }
-}
-
-ostream& operator << (ostream& s, const BitPattern& x)
-{
- if (s.opfx())
- x.printon(s);
- return s;
-}
-
-
-int BitString::OK() const
-{
- int v = rep != 0; // have a rep;
- v &= BitStr_len(rep->len) <= rep->sz; // within allocated size
- if (!v) error("invariant failure");
- return v;
-}
-
-int BitSubString::OK() const
-{
- int v = S.OK(); // valid BitString
- v &= pos + len <= S.rep->len; // within bounds of targ
- if (!v) S.error("BitSubString invariant failure");
- return v;
-}
-
-int BitPattern::OK() const
-{
- int v = pattern.OK() && mask.OK();
- if (!v) pattern.error("BitPattern invariant failure");
- return v;
-}
-
diff --git a/contrib/libg++/libg++/src/BitString.h b/contrib/libg++/libg++/src/BitString.h
deleted file mode 100644
index f3f2d8c3111c..000000000000
--- a/contrib/libg++/libg++/src/BitString.h
+++ /dev/null
@@ -1,763 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifndef _BitString_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-
-#define _BitString_h 1
-
-#include <stream.h>
-#include <limits.h>
-
-#undef OK
-
-#include <bitprims.h>
-#define BITSTRBITS _BS_BITS_PER_WORD
-
-struct BitStrRep
-{
- unsigned int len; // length in bits
- unsigned short sz; // allocated slots
- _BS_word s[1]; // bits start here
-};
-
-extern BitStrRep* BStr_alloc(BitStrRep*, const _BS_word*, int, int,int);
-extern BitStrRep* BStr_resize(BitStrRep*, int);
-extern BitStrRep* BStr_copy(BitStrRep*, const BitStrRep*);
-extern BitStrRep* cmpl(const BitStrRep*, BitStrRep*);
-extern BitStrRep* and(const BitStrRep*, const BitStrRep*, BitStrRep*);
-extern BitStrRep* or(const BitStrRep*, const BitStrRep*, BitStrRep*);
-extern BitStrRep* xor(const BitStrRep*, const BitStrRep*, BitStrRep*);
-extern BitStrRep* diff(const BitStrRep*, const BitStrRep*, BitStrRep*);
-extern BitStrRep* cat(const BitStrRep*, const BitStrRep*, BitStrRep*);
-extern BitStrRep* cat(const BitStrRep*, unsigned int, BitStrRep*);
-extern BitStrRep* lshift(const BitStrRep*, int, BitStrRep*);
-
-
-class BitString;
-class BitPattern;
-
-class BitStrBit
-{
-protected:
- BitString& src;
- unsigned int pos;
-
- public:
- BitStrBit(BitString& v, int p);
- BitStrBit(const BitStrBit& b);
- ~BitStrBit();
- operator unsigned int() const;
- int operator = (unsigned int b);
-};
-
-class BitSubString
-{
- friend class BitString;
- friend class BitPattern;
-
-protected:
-
- BitString& S;
- unsigned int pos;
- unsigned int len;
-
- BitSubString(BitString& x, int p, int l);
- BitSubString(const BitSubString& x);
-public:
- ~BitSubString();
-
- BitSubString& operator = (const BitString&);
- BitSubString& operator = (const BitSubString&);
-
- int length() const;
- int empty() const;
-
- int OK() const;
-};
-
-class BitString
-{
- friend class BitSubString;
- friend class BitPattern;
-protected:
- BitStrRep* rep;
-
- int search(int, int, const _BS_word*, int, int) const;
- int match(int, int, int, const _BS_word*,int,int) const;
- BitSubString _substr(int first, int l);
-
-public:
-
-// constructors
- BitString();
- BitString(const BitString&);
- BitString(const BitSubString& y);
-
- ~BitString();
-
- BitString& operator = (unsigned int bit);
- BitString& operator = (const BitString& y);
- BitString& operator = (const BitSubString& y);
-
-// equality & subset tests
-
- friend int operator == (const BitString&, const BitString&);
- friend int operator != (const BitString&, const BitString&);
- friend int operator < (const BitString&, const BitString&);
- friend int operator <= (const BitString&, const BitString&);
- friend int operator > (const BitString&, const BitString&);
- friend int operator >= (const BitString&, const BitString&);
-
-// procedural versions of operators
-
-
- friend void and(const BitString&, const BitString&, BitString&);
- friend void or(const BitString&, const BitString&, BitString&);
- friend void xor(const BitString&, const BitString&, BitString&);
- friend void diff(const BitString&, const BitString&, BitString&);
- friend void cat(const BitString&, const BitString&, BitString&);
- friend void cat(const BitString&, unsigned int, BitString&);
- friend void lshift(const BitString&, int, BitString&);
- friend void rshift(const BitString&, int, BitString&);
-
- friend void complement(const BitString&, BitString&);
-
- friend int lcompare(const BitString&, const BitString&);
-
-// assignment-based operators
-// (constuctive versions decalred inline below
-
- BitString& operator |= (const BitString&);
- BitString& operator &= (const BitString&);
- BitString& operator -= (const BitString&);
- BitString& operator ^= (const BitString&);
- BitString& operator += (const BitString&);
- BitString& operator += (unsigned int b);
- BitString& operator <<=(int s);
- BitString& operator >>=(int s);
-
- void complement();
-
-// individual bit manipulation
-
- void set(int pos);
- void set(int from, int to);
- void set();
-
- void clear(int pos);
- void clear(int from, int to);
- void clear();
-
- void invert(int pos);
- void invert(int from, int to);
-
- int test(int pos) const;
- int test(int from, int to) const;
-
- void assign(int p, unsigned int bit);
-
-// indexing
-
- BitStrBit operator [] (int pos);
-
-// iterators
-
- int first(unsigned int bit = 1) const;
- int last(unsigned int b = 1) const;
-
- int next(int pos, unsigned int b = 1) const;
- int prev(int pos, unsigned int b = 1) const;
- int previous(int pos, unsigned int b = 1) const
- { return prev(pos, b); } /* Obsolete synonym */
-
-// searching & matching
-
- int index(unsigned int bit, int startpos = 0) const ;
- int index(const BitString&, int startpos = 0) const;
- int index(const BitSubString&, int startpos = 0) const;
- int index(const BitPattern&, int startpos = 0) const;
-
- int contains(const BitString&) const;
- int contains(const BitSubString&) const;
- int contains(const BitPattern&) const;
-
- int contains(const BitString&, int pos) const;
- int contains(const BitSubString&, int pos) const;
- int contains(const BitPattern&, int pos) const;
-
- int matches(const BitString&, int pos = 0) const;
- int matches(const BitSubString&, int pos = 0) const;
- int matches(const BitPattern&, int pos = 0) const;
-
-// BitSubString extraction
-
- BitSubString at(int pos, int len);
- BitSubString at(const BitString&, int startpos = 0);
- BitSubString at(const BitSubString&, int startpos = 0);
- BitSubString at(const BitPattern&, int startpos = 0);
-
- BitSubString before(int pos);
- BitSubString before(const BitString&, int startpos = 0);
- BitSubString before(const BitSubString&, int startpos = 0);
- BitSubString before(const BitPattern&, int startpos = 0);
-
- BitSubString after(int pos);
- BitSubString after(const BitString&, int startpos = 0);
- BitSubString after(const BitSubString&, int startpos = 0);
- BitSubString after(const BitPattern&, int startpos = 0);
-
-// other friends & utilities
-
- friend BitString common_prefix(const BitString&, const BitString&,
- int pos = 0);
- friend BitString common_suffix(const BitString&, const BitString&,
- int pos = -1);
- friend BitString reverse(const BitString&);
-
- void right_trim(unsigned int bit);
- void left_trim(unsigned int bit);
-
-// status
-
- int empty() const ;
- int count(unsigned int bit = 1) const;
- int length() const;
-
-// convertors & IO
-
- friend BitString atoBitString(const char* s, char f='0', char t='1');
- // BitStringtoa is deprecated; do not use in new programs!
- friend const char* BitStringtoa(const BitString&, char f='0', char t='1');
- void printon(ostream&, char f='0', char t='1') const;
-
- friend BitString shorttoBitString(unsigned short);
- friend BitString longtoBitString(unsigned long);
-
- friend ostream& operator << (ostream& s, const BitString&);
-
-// misc
-
- void error(const char* msg) const;
-
-// indirect friends
-
- friend BitPattern atoBitPattern(const char* s,
- char f='0',char t='1',char x='X');
- friend const char* BitPatterntoa(const BitPattern& p,
- char f='0',char t='1',char x='X');
- int OK() const;
-};
-
-
-class BitPattern
-{
-public:
- BitString pattern;
- BitString mask;
-
- BitPattern();
- BitPattern(const BitPattern&);
- BitPattern(const BitString& p, const BitString& m);
-
- ~BitPattern();
-
- friend const char* BitPatterntoa(const BitPattern& p,
- char f/*='0'*/,char t/*='1'*/,char x/*='X'*/);
- void printon(ostream&, char f='0',char t='1',char x='X') const;
- friend BitPattern atoBitPattern(const char* s, char f,char t, char x);
- friend ostream& operator << (ostream& s, const BitPattern&);
-
- int search(const _BS_word*, int, int) const;
- int match(const _BS_word* xs, int, int, int) const;
-
- int OK() const;
-};
-
-BitString operator & (const BitString& x, const BitString& y);
-BitString operator | (const BitString& x, const BitString& y);
-BitString operator ^ (const BitString& x, const BitString& y);
-BitString operator << (const BitString& x, int y);
-BitString operator >> (const BitString& x, int y);
-BitString operator - (const BitString& x, const BitString& y);
-BitString operator + (const BitString& x, const BitString& y);
-BitString operator + (const BitString& x, unsigned int y);
-BitString operator ~ (const BitString& x);
-int operator != (const BitString& x, const BitString& y);
-int operator>(const BitString& x, const BitString& y);
-int operator>=(const BitString& x, const BitString& y);
-
-extern BitStrRep _nilBitStrRep;
-extern BitString _nil_BitString;
-
-// primitive bit extraction
-
-// These must be inlined regardless of optimization.
-
-inline int BitStr_index(int l) { return (unsigned)(l) / BITSTRBITS; }
-
-inline int BitStr_pos(int l) { return l & (BITSTRBITS - 1); }
-
-
-// constructors & assignment
-
-inline BitString::BitString() :rep(&_nilBitStrRep) {}
-
-inline BitString::BitString(const BitString& x) :rep(BStr_copy(0, x.rep)) {}
-
-inline BitString::BitString(const BitSubString& y)
- :rep (BStr_alloc(0, y.S.rep->s, y.pos, y.pos+y.len, y.len)) {}
-
-inline BitString::~BitString()
-{
- if (rep != &_nilBitStrRep) delete rep;
-}
-
-inline BitString shorttoBitString(unsigned short w)
-{
- BitString r;
- _BS_word ww = w;
-#if _BS_BIGENDIAN
- abort();
-#endif
- r.rep = BStr_alloc(0, &ww, 0, 8 * sizeof(short), 8 * sizeof(short));
- return r;
-}
-
-inline BitString longtoBitString(unsigned long w)
-{
- BitString r;
-#if 1
- _BS_word u = w;
- r.rep = BStr_alloc(0, &u, 0, BITSTRBITS, BITSTRBITS);
-#else
- unsigned short u[2];
- u[0] = w & ((unsigned short)(~(0)));
- u[1] = w >> BITSTRBITS;
- r.rep = BStr_alloc(0, &u[0], 0, 2*BITSTRBITS, 2*BITSTRBITS);
-#endif
- return r;
-}
-
-inline BitString& BitString::operator = (const BitString& y)
-{
- rep = BStr_copy(rep, y.rep);
- return *this;
-}
-
-inline BitString& BitString::operator = (unsigned int b)
-{
- _BS_word bit = b;
- rep = BStr_alloc(rep, &bit, 0, 1, 1);
- return *this;
-}
-
-inline BitString& BitString::operator=(const BitSubString& y)
-{
- rep = BStr_alloc(rep, y.S.rep->s, y.pos, y.pos+y.len, y.len);
- return *this;
-}
-
-inline BitSubString::BitSubString(const BitSubString& x)
- :S(x.S), pos(x.pos), len(x.len) {}
-
-inline BitSubString::BitSubString(BitString& x, int p, int l)
- : S(x), pos(p), len(l) {}
-
-inline BitSubString::~BitSubString() {}
-
-inline BitPattern::BitPattern(const BitString& p, const BitString& m)
- :pattern(p), mask(m) {}
-
-inline BitPattern::BitPattern(const BitPattern& b)
- :pattern(b.pattern), mask(b.mask) {}
-
-inline BitPattern::BitPattern() {}
-inline BitPattern::~BitPattern() {}
-
-
-// procedural versions of operators
-
-inline void and(const BitString& x, const BitString& y, BitString& r)
-{
- r.rep = and(x.rep, y.rep, r.rep);
-}
-
-inline void or(const BitString& x, const BitString& y, BitString& r)
-{
- r.rep = or(x.rep, y.rep, r.rep);
-}
-
-inline void xor(const BitString& x, const BitString& y, BitString& r)
-{
- r.rep = xor(x.rep, y.rep, r.rep);
-}
-
-inline void diff(const BitString& x, const BitString& y, BitString& r)
-{
- r.rep = diff(x.rep, y.rep, r.rep);
-}
-
-inline void cat(const BitString& x, const BitString& y, BitString& r)
-{
- r.rep = cat(x.rep, y.rep, r.rep);
-}
-
-inline void cat(const BitString& x, unsigned int y, BitString& r)
-{
- r.rep = cat(x.rep, y, r.rep);
-}
-
-inline void rshift(const BitString& x, int y, BitString& r)
-{
- r.rep = lshift(x.rep, -y, r.rep);
-}
-
-inline void lshift(const BitString& x, int y, BitString& r)
-{
- r.rep = lshift(x.rep, y, r.rep);
-}
-
-inline void complement(const BitString& x, BitString& r)
-{
- r.rep = cmpl(x.rep, r.rep);
-}
-
-// operators
-
-
-inline BitString& BitString::operator &= (const BitString& y)
-{
- and(*this, y, *this);
- return *this;
-}
-
-
-inline BitString& BitString::operator |= (const BitString& y)
-{
- or(*this, y, *this);
- return *this;
-}
-
-inline BitString& BitString::operator ^= (const BitString& y)
-{
- xor(*this, y, *this);
- return *this;
-}
-
-inline BitString& BitString::operator <<= (int y)
-{
- lshift(*this, y, *this);
- return *this;
-}
-
-inline BitString& BitString::operator >>= (int y)
-{
- rshift(*this, y, *this);
- return *this;
-}
-
-inline BitString& BitString::operator -= (const BitString& y)
-{
- diff(*this, y, *this);
- return *this;
-}
-
-inline BitString& BitString::operator += (const BitString& y)
-{
- cat(*this, y, *this);
- return *this;
-}
-
-inline BitString& BitString::operator += (unsigned int y)
-{
- cat(*this, y, *this);
- return *this;
-}
-
-inline void BitString::complement()
-{
- ::complement(*this, *this);
-}
-
-#if defined(__GNUG__) && !defined(_G_NO_NRV)
-
-inline BitString operator & (const BitString& x, const BitString& y) return r
-{
- and(x, y, r);
-}
-
-inline BitString operator | (const BitString& x, const BitString& y) return r
-{
- or(x, y, r);
-}
-
-inline BitString operator ^ (const BitString& x, const BitString& y) return r
-{
- xor(x, y, r);
-}
-
-inline BitString operator << (const BitString& x, int y) return r
-{
- lshift(x, y, r);
-}
-
-inline BitString operator >> (const BitString& x, int y) return r
-{
- rshift(x, y, r);
-}
-
-inline BitString operator - (const BitString& x, const BitString& y) return r
-{
- diff(x, y, r);
-}
-
-inline BitString operator + (const BitString& x, const BitString& y) return r
-{
- cat(x, y, r);
-}
-
-inline BitString operator + (const BitString& x, unsigned int y) return r
-{
- cat(x, y, r);
-}
-
-inline BitString operator ~ (const BitString& x) return r
-{
- complement(x, r);
-}
-
-#else /* NO_NRV */
-
-inline BitString operator & (const BitString& x, const BitString& y)
-{
- BitString r; and(x, y, r); return r;
-}
-
-inline BitString operator | (const BitString& x, const BitString& y)
-{
- BitString r; or(x, y, r); return r;
-}
-
-inline BitString operator ^ (const BitString& x, const BitString& y)
-{
- BitString r; xor(x, y, r); return r;
-}
-
-inline BitString operator << (const BitString& x, int y)
-{
- BitString r; lshift(x, y, r); return r;
-}
-
-inline BitString operator >> (const BitString& x, int y)
-{
- BitString r; rshift(x, y, r); return r;
-}
-
-inline BitString operator - (const BitString& x, const BitString& y)
-{
- BitString r; diff(x, y, r); return r;
-}
-
-inline BitString operator + (const BitString& x, const BitString& y)
-{
- BitString r; cat(x, y, r); return r;
-}
-
-inline BitString operator + (const BitString& x, unsigned int y)
-{
- BitString r; cat(x, y, r); return r;
-}
-
-inline BitString operator ~ (const BitString& x)
-{
- BitString r; complement(x, r); return r;
-}
-
-#endif
-
-// status, matching
-
-inline int BitString::length() const
-{
- return rep->len;
-}
-
-inline int BitString::empty() const
-{
- return rep->len == 0;
-}
-
-inline int BitString::index(const BitString& y, int startpos) const
-{
- return search(startpos, rep->len, y.rep->s, 0, y.rep->len);
-}
-
-inline int BitString::index(const BitSubString& y, int startpos) const
-{
- return search(startpos, rep->len, y.S.rep->s, y.pos, y.pos+y.len);
-}
-
-inline int BitString::contains(const BitString& y) const
-{
- return search(0, rep->len, y.rep->s, 0, y.rep->len) >= 0;
-}
-
-inline int BitString::contains(const BitSubString& y) const
-{
- return search(0, rep->len, y.S.rep->s, y.pos, y.pos+y.len) >= 0;
-}
-
-inline int BitString::contains(const BitString& y, int p) const
-{
- return match(p, rep->len, 0, y.rep->s, 0, y.rep->len);
-}
-
-inline int BitString::matches(const BitString& y, int p) const
-{
- return match(p, rep->len, 1, y.rep->s, 0, y.rep->len);
-}
-
-inline int BitString::contains(const BitSubString& y, int p) const
-{
- return match(p, rep->len, 0, y.S.rep->s, y.pos, y.pos+y.len);
-}
-
-inline int BitString::matches(const BitSubString& y, int p) const
-{
- return match(p, rep->len, 1, y.S.rep->s, y.pos, y.pos+y.len);
-}
-
-inline int BitString::contains(const BitPattern& r) const
-{
- return r.search(rep->s, 0, rep->len) >= 0;
-}
-
-inline int BitString::contains(const BitPattern& r, int p) const
-{
- return r.match(rep->s, p, rep->len, 0);
-}
-
-inline int BitString::matches(const BitPattern& r, int p) const
-{
- return r.match(rep->s, p, rep->len, 1);
-}
-
-inline int BitString::index(const BitPattern& r, int startpos) const
-{
- return r.search(rep->s, startpos, rep->len);
-}
-
-inline int BitSubString::length() const
-{
- return len;
-}
-
-inline int BitSubString::empty() const
-{
- return len == 0;
-}
-
-inline int operator != (const BitString& x, const BitString& y)
-{
- return !(x == y);
-}
-
-inline int operator>(const BitString& x, const BitString& y)
-{
- return y < x;
-}
-
-inline int operator>=(const BitString& x, const BitString& y)
-{
- return y <= x;
-}
-
-inline int BitString::first(unsigned int b) const
-{
- return next(-1, b);
-}
-
-inline int BitString::last(unsigned int b) const
-{
- return prev(rep->len, b);
-}
-
-inline int BitString::index(unsigned int bit, int startpos) const
-{
- if (startpos >= 0)
- return next(startpos - 1, bit);
- else
- return prev(rep->len + startpos + 1, bit);
-}
-
-inline void BitString::right_trim(unsigned int b)
-{
- int nb = (b == 0)? 1 : 0;
- rep = BStr_resize(rep, prev(rep->len, nb) + 1);
-}
-
-inline void BitString::left_trim(unsigned int b)
-{
- int nb = (b == 0)? 1 : 0;
- int p = next(-1, nb);
- rep = BStr_alloc(rep, rep->s, p, rep->len, rep->len - p);
-}
-
-inline int BitString::test(int i) const
-{
- return ((unsigned)(i) >= rep->len)? 0 :
- ((rep->s[BitStr_index(i)] & (1 << (BitStr_pos(i)))) != 0);
-}
-
-
-// subscripting
-
-inline BitStrBit::BitStrBit(const BitStrBit& b) :src(b.src), pos(b.pos) {}
-
-inline BitStrBit::BitStrBit(BitString& v, int p) :src(v), pos(p) {}
-
-inline BitStrBit::~BitStrBit() {}
-
-inline BitStrBit::operator unsigned int() const
-{
- return src.test(pos);
-}
-
-inline int BitStrBit::operator = (unsigned int b)
-{
- src.assign(pos, b); return b;
-}
-
-inline BitStrBit BitString::operator [] (int i)
-{
- if ((unsigned)(i) >= rep->len) error("illegal bit index");
- return BitStrBit(*this, i);
-}
-
-inline BitSubString BitString::_substr(int first, int l)
-{
- if (first < 0 || l <= 0 || (unsigned)(first + l) > rep->len)
- return BitSubString(_nil_BitString, 0, 0) ;
- else
- return BitSubString(*this, first, l);
-}
-
-#endif
diff --git a/contrib/libg++/libg++/src/ChangeLog b/contrib/libg++/libg++/src/ChangeLog
deleted file mode 100644
index 76693b7f60ce..000000000000
--- a/contrib/libg++/libg++/src/ChangeLog
+++ /dev/null
@@ -1,1213 +0,0 @@
-Tue Jun 18 18:31:28 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * BitSet.h (BitSet): Comment out parameter name 'op' in second
- constructor.
-
-Tue Jun 18 11:07:32 1996 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * AllocRing.cc (AllocRing): Fix order of init of N and CURRENT.
-
-Mon Jun 17 14:15:01 1996 Per Bothner <bothner@deneb.cygnus.com>
-
- * Regex.cc (Regex::~Regex): Fix memory leak.
-
- * BitSet.h: If __STRICT_ANSI__, do not define and, or, xor, diff,
- and complement, since the first 3 conflict with ANSI C++ digraphs.
- Re-implement operator& etc to not use 'and' etc and be more efficient.
- * Integer.h: Likewise, fix for __STRICT_ANSI__.
-
- * BitSet.cc: Add casts in length arguments to memset.
-
- * bitlcomp.c, bitprims.h (_BS_lcompare_0): Add const.
-
-Tue Jun 11 13:42:29 1996 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * AllocRing.cc (AllocRing): Reorder init of NODES and N to match
- declaration order.
-
-Wed May 1 14:48:50 1996 Per Bothner <bothner@andros.cygnus.com>
-
- * malloc.c: New version from Doug Lea.
-
- * gen/Vec.ccP (gsort): Re-do Mar 30 fix.
-
-Wed Apr 24 10:58:05 1996 Doug Evans <dje@blues.cygnus.com>
-
- * depend: Regenerated.
-
-Wed Mar 27 15:06:11 1996 Per Bothner <bothner@kalessin.cygnus.com>
-
- * Binomial.h (Binominal::u): Fix parameter from int to double.
- From John Hasler <uunet!hasler!root>.
-
-Sun Mar 24 21:46:28 1996 Per Bothner <bothner@kalessin.cygnus.com>
-
- * Strings.cc: Subtract chars giving int (not signed char) to avoid
- truncation. From Emmanuel Giguet <giguet@calvin.info.unicaen.fr>.
-
-Mon Feb 5 19:32:49 1996 Per Bothner <bothner@kalessin.cygnus.com>
-
- * gen/VHMap.ccP: Add missing [] in delete.
- From Dirk Bonne <h0444xiv@hppool9.rz.hu-berlin.de>.
-
-Sat Mar 30 15:31:49 1996 Per Bothner <bothner@kalessin.cygnus.com>
-
- * gen/Vec.ccP (gsort): Fix stack/loop fence-post error.
-
-Wed Jan 24 18:26:20 1996 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * Makefile.in (OBJS): Take out CursesW.o.
-
-Fri Dec 22 17:41:20 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * String.cc (common_prefix, common_suffix): Fix Nov 9 bad fix.
-
-Tue Dec 12 19:34:02 1995 Jason Molenda (crash@phydeaux.cygnus.com)
-
- * Makefile.in (OBJS): add sqrt.o not sqrt..o.
-
-Tue Dec 12 17:18:41 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * str.cc, chr.cc, Makefile.in: Moved str() and chr() to libio.
-
-Thu Nov 30 13:21:58 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * BitSet.h, BitSet.cc: Fixed problem on Alpha where 1 was being
- shifted, rather than (_BS_word)1.
- Problem diagnosed by Robin Williams <rjrw@ast.man.ac.uk>.
- * BitSet.cc (MASK1): New macro, to save code duplication.
-
-Wed Nov 22 15:49:01 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * malloc.c (realloc): Old copy if we failed to allocate.
- Also, use memcpy to copy.
- (calloc): Don't zero memory if malloc failed. Also, use memset.
- Fix from Raymond Nijssen <raymond@es.ele.tue.nl>.
-
-Sun Nov 12 16:41:56 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * configure.in (EXTRA_DISTCLEAN): Add rx.h.
-
-Thu Nov 9 17:43:04 1995 Jason Merrill <jason@yorick.cygnus.com>
-
- * String.cc (common_prefix, common_suffix): Fix for scoping for
- non-NRV case.
- * configure.in (MOSTLYCLEAN): Add pic and stamp-picdir.
- From alan@spri.levels.unisa.edu.au (Alan Modra).
-
-Thu Nov 2 21:54:45 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * BitSet.cc (shorttoBitsSet, longtoBitSet): Re-implement for
- new word-length.
-
-Wed Sep 27 10:18:03 1995 Roberto Bagnara <bagnara@di.unipi.it>
-
- * BitSet.cc: several bug fixes, mainly concerning the treatment
- (especially in comparison operators) of non-normalized reps
- (e.g. with trailing zeros).
- * bitlcomp.c (_BS_lcompare_0): was completely wrong, fixed.
- * BitSet.h: added lexical comparison function on BitSets
- int lcompare(const BitSet& x, const BitSet& y).
- * BitSet.h: now makes use of the _BS_* macros of bitprims.h.
-
-Tue Sep 5 23:08:05 1995 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * depend: Updated now that libstdc++ doesn't have a string.h.
-
-Fri Sep 1 13:22:47 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * bitprims.h (_BS_BITMASK): Cast 1 to _BS_word.
- Fix from Curtis A. Snyder <C1S@icf.hrb.com>.
-
-Tue Aug 29 21:53:34 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * builtin.h: Remove 'noreturn' attribute from error handler typedefs.
-
-Tue Aug 22 15:11:46 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * error.cc (default_one_arg_error_handler): Lose uses of
- _VOLATILE_VOID and NoReturnFunc.
- * builtin.h: Replace use of _VOLATILE_VOID with __attribute__
- ((noreturn)).
-
-Mon Aug 21 12:41:20 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * builtin.h: Lose definitions of abs(float), abs(double) and
- abs(long).
-
- * std.h: Use C++ names of standard headers.
-
- * Complex.h: Use complex<double> from libstdc++.
- * Complex.cc: Remove.
- * Makefile.in: Forget about Complex.o.
-
-Wed Aug 2 17:19:12 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * gen/AVLSet.hP. gen/BSTSet.hP, gen/CHMap.hP, gen/CHNode.hP,
- gen/DLList.hP, gen/RAVLMap.hP, gen/SLList.hP, gen/SplayMap.hP,
- gen/SplayNode.hP: Re-order constructor args to avoid -Wall warnings.
- * gen/BSTSet.ccP (T>BSTSet::add): Re-arrange to avoid warning.
- * gen/MPlex.ccP: Make constant unsigned to avoid warning.
- * gen/PHPQ.ccP: Add parentheses to avoid warning from -Wall.
-
-Sun Jun 25 13:58:25 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * gen/CHMap.hP, gen/AVLSet.hP: Re-order constructor args,
- to avoid warnings. Reported by Per Cederqvist <ceder@lysator.liu.se>.
- * RndInt.h: Likewise. Reported by Ralf Stephan <ralf@ark.franken.de>.
-
-Tue Jun 20 20:27:23 1995 Paul Eggert <eggert@twinsun.com>
-
- * CursesW.h (_begx, _begy, _maxx, _maxy):
- Define to be their _-less equivalents
- if __bsdi__, __NetBSD__, or __FreeBSD__ is defined,
- to work around an incompatibility with 4.4 BSD curses.
-
-Tue Jun 20 16:49:36 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * SmplStat.h, gen/*.hP: Declare inline virtuals accordingly in class.
-
-Wed Jun 14 21:45:44 1995 Jason Merrill <jason@python.cygnus.com>
-
- * CursesW.cc (OK): Define if not already defined.
-
-Mon Jun 5 18:42:04 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * Makefile.in (libgxx.list): Depend on stamp-picdir.
-
-Mon May 22 23:46:34 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * bitprims.h: Rewrite __GNUC__ test to work with gcc-1.xx.
-
-Fri May 5 17:25:17 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * timer.c: #include <sys/types.h> also if we have <sys/resource.h>.
-
-Fri May 5 13:04:17 1995 Mike Stump <mrs@cygnus.com>
-
- * Move `for' decl out of `for' statement.
-
-Thu Apr 27 01:03:42 1995 Jason Merrill <jason@python.cygnus.com>
-
- * Fix24.h: Move definition of ~Fix48 up.
- * Fix16.h: Move definition of ~Fix32 up.
-
-Wed Apr 26 13:01:30 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * configure.in (XCINCLUDES): Rename to work with config.shared change.
-
-Mon Apr 17 16:59:17 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * BitSet.h: Remove duplicate (forward) decls of inline functions.
-
-Sun Apr 16 12:47:53 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * CursesW.h: Make return type explicit instead of implicit int.
- Reported by Ulrich Drepper <drepper@ipd.info.uni-karlsruhe.de>.
-
- * SLList.h (BaseSLNode): Force double alignment of derived fields.
-
-Thu Mar 30 18:09:58 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * AllocRing.cc (alloc): Call operator new/delete directly.
- * String.cc (Snew): Use placement new to create the new rep.
- * BitSet.cc (BSnew): Ditto.
- * BitString.cc (BSnew): Ditto.
- * Fix.cc (_new_Fix): Ditto.
- * Obstack.cc (newchunk): Ditto.
- * Integer.cc (Inew): Ditto.
- (printon): Use array delete to match array new.
-
-Fri Feb 17 16:33:39 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * timer.c: If _G_HAVE_SYS_TIMES is 0, define USE_CLOCK. Add
- USE_CLOCK cases where needed which call the ANSI function clock.
-
- * BitSet.h: Add #undef OK after including system header files, to
- avoid problems on VxWorks.
- * BitString.h, DLList.h, Integer.h, Obstack.h: Likewise.
- * Rational.h, Regex.h, SLList.h, String.h: Likewise.
- * BitSet.cc, BitString.cc, Integer.cc, Rational.cc: Likewise.
- * String.cc: Likewise.
-
- * SmplStat.h: Add #undef min and #undef max after including system
- header files.
-
- * timer.c (return_elapsed_time): Fix syntax of #if 0 case.
-
-Mon Feb 6 20:10:35 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * Makefile.in (OBJS): Don't include EH support anymore.
- * except.c: Move code to libstdc++/exception.cc.
-
-Thu Jan 26 13:16:09 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * Fix.h: Add Fix(_G_uint16_t) for targets where _G_uint16_t does
- not promote to int.
-
-Fri Jan 20 01:36:37 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * Makefile.in (OBJS): Remove new.o and math.o.
-
- * std.h: Include std/stddef.h instead of defines.h.
- * complex.h: Remove (replaced by libstdc++ version).
- * defines.h: Remove (replaced by libstdc++ std/stddef.h).
- * new.{cc,h}: Remove (replaced by libstdc++ new.cc and std/new.h).
- * drt0.c, dynamic_lib.c, init.c, init_main.c: Remove (obsolete).
- * math.cc, xyzzy.cc: Remove (obsolete).
- * depend: Update.
-
-Wed Dec 14 18:41:11 1994 Per Bothner <bothner@kalessin.cygnus.com>
-
- * gen/VQueue.ccP (VQueue::resize): Fix thinko. Reported by
- Jocelyn Serot <jserot@alize.univ-bpclermont.fr>.
-
-Tue Dec 13 17:05:02 1994 Per Bothner <bothner@kalessin.cygnus.com>
-
- * gen/AVLMap.hP: Re-order base initializer to avoid warning.
- Patch from Gustavo Chaves <gustavo@cpqd.br>.
-
-Tue Nov 29 12:58:44 1994 Per Bothner <bothner@kalessin.cygnus.com>
-
- * gen/Map.hP (Map::empty, Map::length): Make const.
- Patch from Gustavo Chaves <gustavo@cpqd.br>.
-
-Sat Nov 5 19:13:17 1994 Jason Merrill (jason@phydeaux.cygnus.com)
-
- * configure.in (LIBDIR): Set.
-
-Sat Nov 5 16:23:02 1994 Per Bothner <bothner@kalessin.cygnus.com>
-
- * Makefile.in (REGEX_OBJ): Remove ../../librx/rx.o.
- This is now the responsibility of ../Makefile.in.
-
-Fri Nov 4 21:46:30 1994 Paul Eggert <eggert@twinsun.com>
-
- * bitprims.h (__P): Change argument name spelling from
- `paramlist' to `protos' for compatibility with BSDI 1.1.
-
-Mon Oct 24 16:06:44 1994 Per Bothner <bothner@kalessin.cygnus.com>
-
- * CursesW.h (box): Slightly more complicated "wrapper" to turn
- box macro into inline function, needed for Solaris2
- (which defines box with no arguments as box32).
-
-Fri Oct 14 16:36:56 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * CursesW.h: Wrap #include <curses.h> by extern "C" { ... },
- because even systems with "C++-ready" header files often miss curses.h.
-
- * DLList.cc (BaseDLList::del): Fix memory leak.
- Patch from Mark Stankus <mstankus@oba.ucsd.edu>.
-
-Thu Oct 13 16:57:08 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * gen/List.hP, gen/List.ccP (copy): Take const argument.
- (List::seekK): Make const.
- (const <T>& operator () (Pix p) const): Added.
- * gen/List.hP (operator!=): Add missing inline.
- * gen/List.hP (new): Take const argument.
- * gen/List.ccP (List::del): Defer deleting.
- Patches from Klamer Schutte <schutte@tpd.tno.nl>.
-
-Wed Oct 12 13:49:27 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * String.cc (Sresize): Make static.
- * String.h, String.cc (String::alloc): Don't change length, only size.
- Bug reported by Mark Stankus <mstankus@oba.ucsd.edu>.
- * String.cc (join): Use Sresize, not (changed) String::alloc.
- Also, merge NO_NRV and named return value versions.
-
-Thu Sep 29 03:23:24 1994 Philippe De Muyter (phdm@info.ucl.ac.be)
-
- * timer.c: include <sys/types.h> before <sys/times.h>
-
-Tue Sep 27 13:27:17 1994 Mike Stump (mrs@cygnus.com)
-
- * Makefile.in, depend, except.c: New support routines for EH.
-
-Sun Sep 4 14:22:25 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * String.cc: Remove unneeded #include <regex.h>.
-
-Thu Sep 1 16:34:33 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * error.cc (#define ABORT): Add missing parentheses.
-
- * regex.cc, regex.h: Removed.
-
-Wed Aug 31 10:32:57 1994 Jason Merrill (jason@deneb.cygnus.com)
-
- * SLList.h: Make BaseSLList::{error,owns,OK} const, create const
- SLList::{first,next}.
- * DLList.h: Similarly.
-
-Fri Aug 26 18:44:43 1994 Jason Merrill (jason@deneb.cygnus.com)
-
- * SLList.h: Make SLList::first and SLList::next const, create
- const SLList::operator().
- * DLList.h: Similarly.
-
-Tue Aug 16 11:41:43 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * Regex.cc (Regex::Regex): Add missing 'const'.
-
- * configure.in (rx.h): Add link to ../../librx/rx.h.
-
-Mon Aug 15 16:41:30 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * Regex.cc, Makefile.in: Change to use Tom Lord'd rx library,
- instead of (a very old version of) the regex library.
-
-Fri Aug 12 12:05:39 1994 Brendan Kehoe (brendan@lisa.cygnus.com)
-
- Improve Alpha support a bit more.
-
- * Fix.cc (Fix::shift): Cast Y to _G_int32_t, not long.
- (Fix::printon): Use _G_int32_t, not long.
- * Fix16.h: Declare all methods to take/return _G_{u,}int32_t, not long
- or unsigned long.
- (Fix32_fs, Fix32_msb, Fix32_m_max, Fix32_m_min): Cast to _G_{,u}int32_t
- not long/unsigned long.
- (class Fix32): Make member M _G_int32_t. Declare methods round,
- assign, both mantissa, overflow, and range_error to use _G_int32_t.
- * Fix16.cc: Likewise.
- (operator*, operator/): Declare stuff to be _G_uint32_t, not unsigned
- long.
- * Fix24.h (twolongs): Make them _G_{,u}int32_t, not long/unsigned long.
- (class Fix24): Same as above for Fix32.
- * Fix24.cc: As in Fix16.cc.
-
- * RNG.h (RNG::asLong): Make its return value _G_uint32_t.
- * MLCG.h (MLCG::asLong): Likewise.
- * MLCG.cc (MLCG::asLong): Likewise.
-
- * ACG.h (ACG): Make members initialSeed, state, auxState, and
- lcgRecurr to be _G_uint32_t.
- (ACG::ACG): Declare SEED to be _G_uint32_t.
- (ACG::asLong): Declare return value to be _G_uint32_t.
- * ACG.cc (ACG::reset): Check _G_int32_t, not long, against double.
- Define local variable U to be _G_uint32_t, not unsigned long.
- (randomPermutations): Define as _G_uint32_t, not unsigned long.
- (seedTable): Likewise.
- (LC_A, LC_C, LCG): Likewise.
- (ACG::ACG): Define SEED argument to be _G_uint32_t, not unsigned
- long. Create a _G_uint32_t for STATE, not an unsigned long.
- (ACG::asLong): Declare return to be _G_uint32_t. Make local
- variables RESULT, AUXACG, and PERM also be _G_uint32_t.
-
-Tue Aug 2 00:53:01 1994 Jason Merrill (jason@deneb.cygnus.com)
-
- * defines.h (enum capacity): Define.
-
-Fri Jul 22 17:31:37 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * String.h (String::operator[](int) const): New method,
- added to allow indexing of const Strings. Patch
- from Klamer Schutte <schutte@tpd.tno.nl>.
-
-Thu Jul 21 23:41:36 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * builtin.h: Remove unneeded forward declarations. (Compiling
- with -Wall complains because they are missing "inline".)
- Reported by Michael Haggerty <mhagger@rigel.krl.caltech.edu>.
-
-Wed Jul 20 14:54:50 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * String.h: Add "inline" to friend declarations, and remove
- some unneeded forward references, to avoid complaints from -Wall.
- Patch from Klamer Schutte <schutte@tpd.tno.nl>.
-
-Tue Jul 19 12:35:13 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * Complex.h: Remove unneeded forward declarations. (Compiling
- with -Wall complains because they are missing "inline".)
- Reported by John Eaton <jwe@che.utexas.edu>.
-
-Mon Jul 18 18:15:17 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * String.h, String.cc: Add const to some parameter types,
- to fix to const violations.
-
-Fri Jul 1 11:20:34 1994 Brendan Kehoe (brendan@phydeaux.cygnus.com)
-
- * MLCG.cc (seedTable): Declare to be a _G_int32_t, not a long.
- (MLCG::MLCG): Make its arguments likewise.
- (MLCG::reset): Also make SEED1 and SEED2 _G_int32_t.
- (MLCG::asLong): Likewise for local variables K and Z.
- * MLCG.h (class MLCG): Declare members to be _G_int32_t, not long.
- Make constructor and other mothod args and return type match the
- way we've adjusted them.
-
- * RNG.cc (RNG::RNG): Check against _G_uint32_t, not unsigned long.
- * RNG.h: Include _G_config.h.
- (PrivateRNGSingleType, PrivateRNGDoubleType): Adjust U member the
- same way...use _G_uint32_t, not unsigned long.
-
-Tue Jun 28 03:04:13 1994 Jason Merrill (jason@deneb.cygnus.com)
-
- * gen/List.*: Add some 'const's.
- * gen/Vec.*: Ditto.
-
- * gen/AVec.* (Vec): Add additional vec() method for const AVecs,
- which returns a const pointer. The operand of operator = is a
- const reference.
-
-Mon Jun 27 17:49:25 1994 Jason Merrill (jason@deneb.cygnus.com)
-
- * Fix.*: Add lots of 'const's. Lose _Fix typedef for _Frep*, as
- it caused confusion like thinking that 'const _Fix' was meaningful
- and declaring references to _Fix. Move _Frep inside of Fix and
- rename it to Rep. Move lots of associated functions and variables
- inside Fix. Use _G_int16_t instead of uint16. Put function names
- flush left.
-
- * gen/List.* (operator =): Make parameter a const reference.
-
- * Fix.h (operator =): Make parameter a const reference.
-
-Wed Jun 15 10:50:35 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * String.cc (Scapitalize): Don't consider '\'' a word break.
-
-Tue May 31 09:18:10 1994 Mike Stump (mrs@cygnus.com)
-
- * BitString.cc: Make more portable to machines where sizeof(int)
- != sizeof(long). Cures warnings on Alpha.
-
-Mon May 30 17:31:18 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * bitcount.c: #define inline as empty if compiled
- by a non-GNU C compiler.
- * Makefile.in (install): Install include files.
- (This used to be done by ../Makefile.in.)
-
-Sun May 29 19:07:29 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * bitdo2.h: Fix typo/thinko: srcbit -> dstbit.
-
-Wed May 25 15:45:37 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * SLList.h (SLList<T>::empty): Move up the hierarchy (to become
- BaseSLList::empty), and make const.
- * DLList.h, DLList.cc (BaseDLList::empty, BaseDLList::length):
- Make const.
-
-Sun May 22 17:13:24 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * bitand.c, bitany.c, bitblt.c, bitclear.c, bitcopy.c, bitcount.c,
- bitdo1.h, bitdo2.h, bitinvert.c, bitlcomp.c, bitprims.h, bitset1.c,
- bitxor.c: Preliminary version of language-independent (sub-)library
- for general low-level manipulation of bistrings.
- * BitString.h, BitString.cc, Makefile.in: Partially re-written
- BitString class using the new library.
-
- * sysent.h: New file, provided for compatibility with other C++
- compilers, and so Fresco can compile.
-
-Thu May 19 23:00:26 1994 Jason Merrill (jason@deneb.cygnus.com)
-
- * gen/PHPQ.ccP (<T>PHPQ::OK): Set int variable to INT_MAX, not
- LONG_MAX.
-
-Fri May 13 14:14:47 1994 Mike Stump (mrs@cygnus.com)
-
- * bool.h: Use builtin bool, true, and false, if compiler supports
- them.
-
-Wed May 11 00:31:12 1994 Jason Merrill (jason@deneb.cygnus.com)
-
- Make libg++ build with gcc -ansi -pedantic-errors
- * ?LList.*: Add 'const' as necessary to make conformant.
- * {BitSet,BitString,Integer,Rational,String}.*: Change NO_NRV to
- _G_NO_NRV.
- * {Fix,Integer,Rational}.*: Protect uses of <? and >? with #ifndef
- __STRICT_ANSI__.
- * generic.h: Put /* */ around #endif comment.
- * regex.cc: Remove comma at end of enumerator list.
-
-Fri May 6 14:25:15 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * SLList.h, SLList.cc (BaseSLList::length): Make const.
-
-Thu May 5 14:28:30 1994 Jason Merrill (jason@deneb.cygnus.com)
-
- * defines.h: Avoid multiple definition of wint_t.
-
-Sat Apr 30 14:49:02 1994 Jason Merrill (jason@deneb.cygnus.com)
-
- * defines.h: New file as per 17.3.1 of the WP.
- * new.h: include defines.h instead of std.h.
- (new[]): Add default placement version of opeator new[].
- * std.h: include defines.h instead of stddef.h.
-
-Mon Apr 25 14:05:57 1994 Jason Merrill (jason@deneb.cygnus.com)
-
- * Fix24.h (operator>>): Cast mask to long explicitly, since it
- doesn't fit in a long.
-
-Sun Mar 27 18:45:20 1994 Jason Merrill (jason@deneb.cygnus.com)
-
- * BitSet.h (BitSetBit): operator int() is const.
-
-Mon Mar 14 10:46:26 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * BitSet.h, BitString.{h,cc}, Integer.h, Rational.h, String.h:
- Make operator= and similar operators return a reference to lhs.
- Patches from Martin Pottendorfer <fs_potte@aaf.alcatel.at>.
-
- * Obstack.cc: Re-do int -> char* convertsion (using pointer
- subtraction as in the C version of obstack.h) to avoid problems
- on 64-bits machines like the Alpha.
- * Integer.cc (operator>>): Return stream, not 0.
- * CursesW.h (box, scroll, touchwin): If these are macros (as
- they can be in the SYSV-based nurses.h), convert to inlines.
- * Fix.h (Fix::Fix(int, const _Fix)): Use named constants instead
- of integer literals. Patch from Andreas Schwab
- <schwab@issan.informatik.uni-dortmund.de>.
-
-Thu Feb 10 16:36:37 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * BitSet.cc (BitSetresize): When newlen is greater than the
- old->len (but < old->sz), clear out new words.
-
-Fri Feb 4 12:07:23 1994 Jason Merrill (jason@deneb.cygnus.com)
-
- * new.h: Wrap g++-specific things in #ifdef __GNUG__.
- (NEW): Use parens now.
- (new): Remove definition of realloc-ish new, as it doesn't belong
- in a standard header.
-
-Wed Dec 29 22:52:43 1993 Mike Stump (mrs@cygnus.com)
-
- * BitSet.h (BitSetBit): Add int operator = (const BitSetBit& b),
- because the default op= would have the wrong semantics.
-
-Mon Dec 6 14:14:52 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * math-68881.h: Removed.
-
-Sun Dec 5 19:15:01 1993 Brendan Kehoe (brendan@lisa.cygnus.com)
-
- * Integer.cc (cvtItoa): Delete unused var `gap'.
- * Fix.cc (Fix::printon): Delete unused var `format'.
-
-Thu Nov 18 16:51:49 1993 Jeffrey A. Law (law@snake.cs.utah.edu)
-
- * gen/*: Replace all occurences of <values.h> with <limits.h>.
- Replace MAXLONG with LONG_MAX.
-
-Thu Nov 4 17:00:20 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * gen/List.hP: Re-arrange #includes. Patch submitted
- by chris@lslsun7.epfl.ch (Christian Iseli).
-
- * osfcn.h: #include <sys/time.h> before <sys/resource.h>.
-
-Wed Nov 3 12:56:28 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * Integer.cc: Move functions that convert between Integer and
- double from here to ...
- * Intdouble.cc (new file): Here. Improves modularity, and lessens
- need for linking with libm.a on some systems (e.g. SunOS4).
- * Integer.hP: New file. Integer internals.
- * Integer.h, Makefile.in: Associated changes.
-
-Mon Oct 25 19:16:19 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * timer.c (return_elapsed_time): Make K&R-(not C++-)compatible.
-
- * configure.in: Define CINCLUDES (to get _G_config.h).
- * timer.cc -> timer.c: Convert to reduce some portability
- problems with getrusage.
- * builtin.h (start_timer, return_elapsed_time): Now extern "C".
-
-Sat Oct 23 22:29:16 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * gen/SplaySet.hP (<T>SplaySet::operator =): Added.
- (Many other classes also need operator=. FIXME.)
-
-Sun Oct 10 15:02:22 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * gen/VOHSet.ccP: Patch from Doug Lea <dl@g.oswego.edu>, fixing
- a bug reported by David Einstein <EINSTEIN@pl9000.plh.af.mil>.
-
-Thu Aug 26 18:02:51 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * Integer.cc (operator>>(istream&, Integer&): Fixed some logic
- problems (single "0" dropped when base is unknown) by copying
- algorithm from istream::operator>>(int &).
-
-Wed Aug 18 12:03:52 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * Makefile.in: Add libgxx.list, for use by libg++/Makefile.
- * configure.in: No longer need TOUCH_ON_COMPILE magic.
- * configure.in (MOSTLYCLEAN): Add libgxx.list.
-
- * CursesW.h: Remove re-definition of wattrset from macro to inline.
- Doesn't work under Solaris (wattrset is parameterless), and isn't
- needed (there are no conflicting definitions of wattrset in CursesW.*).
-
-Sat Aug 14 14:01:04 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * malloc.c: New version from Doug Lea.
-
-Thu Jul 29 13:25:31 1993 Per Bothner (bothner@kalessin)
-
- * error.cc (abort prototype): Removed (can conflict with stdlib.h).
- * error.cc (ABORT): New macro, to call abort(), but with a cast
- to avoid g++ warning about volatile function returning.
- * error.cc (default_one_arg_error_handler,
- default_two_arg_error_handler): Use ABORT macro.
-
-Wed Jul 28 15:40:29 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * CursesW.cc, RNG.cc, Rational.cc, Regex.cc:
- Remove unneeded #include <values.h>.
- * DLList.cc, Obstack.cc, SLList.cc: Replace non-standard #include
- <values.h> by ANSI <limits.h>, and macro MAXLONG by LONG_MAX.
- * Makefile.in (OBJS): Remove dtoa.o: It is obsolete and non-portable.
- * std.h: Remove #include of non-standard <memory.h>.
-
-Sat Jul 24 17:57:51 1993 Per Bothner (bothner@kalessin)
-
- * LogNorm.cc (LogNormal::operator()): Call exp (foo) instead
- of pow (M_E, foo), thus avoiding use of non-ANSI M_E macro
- (and probably being more efficient).
- * timer.cc: Don't #include <osfcn.h>.
- Do #include <sys/time.h> before #include <sys/resource.h>.
-
-Mon Jun 28 18:34:41 1993 Per Bothner (bothner@rtl.cygnus.com)
-
- * regex.cc (STORE_NUMBER): Add cast to avoid g++ warning.
- * Fix16.h (Fix32_m_max): Add cast to avoid g++ warning.
-
-Tue Jun 22 14:08:23 1993 Per Bothner (bothner@deneb.cygnus.com)
-
- * Integer.h: Remove Integer::operator long and
- Integer::operator double. They cuase ambiguities, and this
- seems the cleanest fix, though it does break compatibility.
- * regex.h, regex.cc: Remove defs of re_comp and re_exec.
-
-Fri Jun 4 18:06:54 1993 Per Bothner (bothner@cygnus.com)
-
- * Integer.cc (setbit): Do Iresize also when x.rep initially NULL.
- Fixes bug reported by Marco Franzen <cp44@ips.cs.tu-bs.de>.
- * Integer.cc (clearbit): No need to resize to clear bits!
-
-Tue Jun 1 16:06:23 1993 Per Bothner (bothner@rtl.cygnus.com)
-
- * BitSet.h, Complex.h, SmplHist.h: #include <iostream.h>,
- not obsolete <stream.h>.
- * Fix.h (Fix::Fix(double&), Fix::operator=): Take double, not double&.
- * Fix.h, Fix.cc, Fix16.h, Fix16.cc, Fix24.h, Fix24.cc:
- Make operands be const, where appropriate. (Incoplete.)
- * Fix.cc (mantissa, multiply), String.cc (SubString::OK):
- Minor changes to avoid ambiguity complaints from cfront.
- * Fix.cc, Complex.cc, Rational.cc, String.cc, Integer.cc:
- Avoid non-standard iostream operations (ios::set, _fail).
- * Rational.cc (pow): Use Integer::as_long().
- * Rational.cc (ceil, floor, round): Use prefix ++ and --
- instead of (the missing) postfix versions.
- * Rational.h (Rational::Rational): Add some more overloaded
- versions, to avoid cfront ambiguity complaints.
- * Integer.h (Integer::opertor long, Integer::operator double):
- Disable these, unless using g++. These cause lots of
- ambiguities, which g++ tolerates, but shouldn't.
- * Integer.h (Integer::as_long, Integer::as_double):
- Substitues for above conversions.
-
- * gen/MPlex.ccP, gen/RPlex.ccP: ANSIfy bzero->memset, bcopy->memcpy.
-
- * GetOpt.cc, regex.cc: #ifdef sparc, add declaration
- __builtin_alloca; needed when compiling on Solaris2 with cfront.
- * regex.cc (re_match_2): Add extra cast, to make cfront happy.
- * Makefile.in (add-to-targetlib): New rule.
-
-Fri May 28 14:25:47 1993 Per Bothner (bothner@rtl.cygnus.com)
-
- * BitSet.h (BitSetBit::operator==, BitSetBit::operator!=),
- BitString.h (BitStrBit::operator==, BitStrBit::operator!=):
- Remove redundant operators.
- * builtin.h (chr, str): Moved to ../iostream/stream.h.
- * CursesW.cc (CursesWindow::printw, CursesWindow::mvprintw):
- Assume existence of vsprintf. (Will be provided by
- libiberty, at worst.)
- * CursesW.cc (CursesWindow::scanw, CursesWindow::mvscanw):
- Re-do logic for missing vsscanf: Provide an implementation,
- unless we're using GNU iostreams.
-
-Wed May 26 15:09:49 1993 Per Bothner (bothner@cygnus.com)
-
- * CursesW.h: Also "convert" wstandend, wstandout, and wattrset
- from macros to inlines. Needed for Coherent 4.0.
- Patch from Jim West <jwest@jwest.ecen.okstate.edu>.
-
-Thu May 6 15:52:40 1993 Per Bothner (bothner@cygnus.com)
-
- * Rational.cc (Rational::fits_in_float, Rational::fits_in_double):
- Add explicit double->Rational conversion; else cfront complains.
- * SLList.h (SLNode::SLNode), DLList.h (DLNode::DLNode):
- Don't use mem-initializers for members of a base class.
- * DLList.h (DLList::remove_front, DLList::remove_rear), SLList.h
- (SLList::remove_front): Use base class qualifiers to avoid ambiguity.
- * gen/AVLMap.ccP, gen/AVLSet.ccP, gen/RAVLMap.ccP: Cfront
- complains about jumps past initializer (in switch statement).
- Fix by adding block around such statements.
-
-Fri Apr 30 15:03:12 1993 Per Bothner (bothner@cygnus.com)
-
- * BitSet.cc (BitSet::printon): Fix name clash (rename s -> os).
- * dtoa.cc (dtoa): #ifdef out unless __GNUC__, since cfront
- can't compile it (variable-sized array), and it's obsolete anyway.
- * configure.in: Set TOUCH_ON_COMPILE to cause stamp file to
- be touched on every compile.
-
-Mon Apr 19 00:48:10 1993 Per Bothner (bothner@cygnus.com)
-
- * gen/Plex.ccP (Plex::del_chunk): Delete unused local variable.
-
- * Makefile.in, configure.in: Re-vamped configure scheme.
- * CursesW.h: #undef lines to avoid clash on SCO.
-
-Fri Apr 16 15:25:39 1993 Per Bothner (bothner@cygnus.com)
-
- * BitSet.{h,cc}, BitString.{h,cc}: Rename BitSet::previous()
- and BitString::pvreious() to prev() for the sake of consistency
- with other libg++ classes. Keep previous() as a synonym
- for compatibility.
-
-Fri Mar 5 17:25:59 1993 Per Bothner (bothner@rtl.cygnus.com)
-
- * Integer.cc (Icopy_zero): Make sure we don't trash
- a STATIC_IntRep object.
- * Integer.cc: #include <math.h> after <limits.h> and <float.h>
- to avoid some conflict I don't remember.
-
-Tue Jan 5 20:52:29 1993 Brendan Kehoe (brendan@lisa.cygnus.com)
-
- * Rational.cc (floor, ceil, round): Use prefix ++ and --, not
- postfix, since the Integer class only has prefix defined.
-
-Tue Dec 29 13:15:59 1992 Ian Lance Taylor (ian@cygnus.com)
-
- * builtin.h: Check _G_MATH_H_INLINES rather than __hpux.
- * CursesW.h: Undef "lines" to avoid problems on SCO 3.2v4.
-
-Mon Dec 21 18:57:41 1992 Per Bothner (bothner@rtl.cygnus.com)
-
- * SLList.h: Fix typo.
- * osfcn.h: Don't include non-Posix <sys/time.h>.
- * Integer.h, String.h: #include <iostream.h>, not old <stream.h>.
- * Integer.cc, String.cc: Update _fail->ios::failbit,
- _eof->ios::eofbit.
- * CursesW.h: #include <_G_config.h> before testing _H_HAVE_CURSES.
- * gen/{XPBag,OXPBag}.h: Add #undef remove, to avoid conflicts
- with systems where stdio.h defines remove as a macro.
-
-Wed Dec 9 14:36:37 1992 Per Bothner (bothner@cygnus.com)
-
- * gen/Bag.hP, gen/List.hP: #undef remove, in case some
- version of stdio.h defines remove as a macro.
- * gen/MPlex.ccP, gen/RPlex.ccP: Use ANSI memset/memcpy
- instead of bzero/bcopy.
-
-Thu Dec 3 15:37:17 1992 Per Bothner (bothner@cygnus.com)
-
- * BitSet.cc (operator ==): Fixed version from
- karplus@cse.ucsc.edu (Kevin Karplus).
-
- * Integer.cc (compare, operator>>): Two small patches from
- Doug Lea.
- * regex.cc, BitString.cc, Fix.cc, Obstack.cc, GetOpt.cc:
- Replace bcopy/bzero/cmp by ANSI functions memcpy/memset/memcmp.
- * gen/List.ccP: Use <T>EQ macro instead of ==, as appropriate.
- * SLList.h, DLList.h: Fix destructors so that clear() is
- called directly in the SLList<T>/DLList<T> destructor, not
- in the BaseSLList/BaseDLList destructor, since the vtable
- pointer gets reset by the time the latter is called.
-
-Thu Nov 19 17:54:43 1992 Per Bothner (bothner@cygnus.com)
-
- * BitString.cc, BitSet.cc: Use ANSI byte-string functions
- instead of BSD ones: bcmp->memcmp, bzero->memset, bcopy->memcpy.
-
-Tue Nov 17 21:50:09 1992 Per Bothner (bothner@rtl.cygnus.com)
-
- * Complex.cc: Use standard fabs() in preference to inline
- overloaded function abs() defined in builtin.h.
- * DLList.h, SLList.h: Make destructors virtual, to shut up
- a warning.
-
-Thu Oct 29 16:06:38 1992 Per Bothner (bothner@rtl.cygnus.com)
-
- * GetOpt.h (GetOpt): Make GetOpt::ordering be a regular field,
- not a static member. (No reason it should be static.)
- * GetOpt.cc: Remove no-longer-needed dedinition of
- GetOpt::ordering (- which had visibility problems).
-
-Tue Oct 27 14:50:52 1992 Per Bothner (bothner@rtl.cygnus.com)
-
- * Integer.cc, Sample.cc, SmplStat.cc, SmplHist.cc: Replace
- non-ANSI HUGE by standard HUGE_VAL or DBL_MAX as appropriate.
-
-Wed Oct 21 15:22:32 1992 Per Bothner (bothner@cygnus.com)
-
- * BitSet.cc (BitSetalloc, BitSetresize): Merged in a bug fix
- from Kevin Karplus <karplus@cse.ucsc.edu>.
- * BitSet.ccANSI-fy: bcopy -> memcpy, bzero -> memset.
- * Integer.h: Un-optimize non-working operator %=.
-
-Fri Oct 16 15:35:51 1992 Per Bothner (bothner@rtl.cygnus.com)
-
- * Obstack.h: ANSI-fy: bcopy -> memcpy.
- * builtin.h: Supposedly, HPUX defines __hpux, not hpux.
-
-Fri Sep 25 11:13:53 1992 Per Bothner (bothner@rtl.cygnus.com)
-
- * Obstack.cc (Obstack::_free): Use delete [], not plain delete.
-
- * {SLList,DLList}.{h,cc}: New template-based versions derived
- from gen/{SLList,DLList}.{h,cc}P.
- * Makefile.in: Make {SLList,DLList}.o.
-
-Thu Sep 10 22:48:49 1992 Ian Lance Taylor (ian@cygnus.com)
-
- * CursesW.h, CursesW.cc: don't do anything if the new
- configuration flag _G_HAVE_CURSES is zero.
-
-Mon Aug 31 22:52:17 1992 Brendan Kehoe (brendan@rtl.cygnus.com)
-
- * BitString.h (BitPattern::BitPatterntoa): Fix comments around
- default parameters.
-
-Mon Aug 31 15:44:07 1992 Per Bothner (bothner@rtl.cygnus.com)
-
- * gen/Vec.ccP (<T>Vec::index): Use EQ instead of ==.
- * BitString.h (BitPatterntoa friend of BitPattern):
- Comment out default parameters to avoid duplication (that
- cfront -and ANSI- frown on).
- * String.h (SubString::contains) Fix parameter list
- passed to String::search.
- * generic.h: Comment out genericerror() declaration, since
- we don't support it.
-
-Mon Aug 10 15:05:42 1992 Per Bothner (bothner@cygnus.com)
-
- * gen/defs.hP: New macro HASHTABLE_TOO_CROWDED to decide
- when to rehash a hash table (specifically, when 7/8 full).
- * gen/{VHSet.ccP,VHBag.ccP,vHMap.ccP}: Use HASHTABLE_TOO_CROWDED
- to control when hash table needs to grow.
-
- * GetOpt.cc (GetOpt::operator()): Replace index() -> strchr().
- * Integer.{h,cc}: Add Integer::Integer(unsigned long)
- constructor in addition to Integer::Integer(long).
- * Rational.h: Add Rational constructors taking (unsigned long).
- * Makefile.in (XTRAFLAGS): Fix.
-
-Mon Jul 13 06:52:57 1992 Michael Tiemann (tiemann@rtl.cygnus.com)
-
- * Regex.cc (Regex::Regex): Cast malloc calls, since G++ no longer
- freely converts void* to char* (in accordance with dpANSI spec).
-
-Fri Jun 26 11:23:32 1992 Per Bothner (bothner@rtl.cygnus.com)
-
- * BitString.cc: Replace bcopy->memmove;
- add const to cast; remove two unused variables.
- * CursesW.h, builtin.h: Kludges for hpux.
- * Integer.cc: Replace MAXLONG/MINLONG by ANSI standard
- LONG_MAX/LONG_MIN.
- * Integer.h, Integer.cc, builtin.h: Protect setbit function
- name from macro-expansion (on systems that define setbit as
- a macro is sys/param.h) by putting parentheses around it.
- * Obstack.h, regex.cc: Use proper const-ness in casts,
- * std.h: #include <_G_config.h>, since it may not be
- included otherwise if we're not using ../g++-include.
-
-Sat Jun 13 20:05:24 1992 Per Bothner (bothner@rtl.cygnus.com)
-
- * gen/List.ccP: Remove redundant 'inline'.
- * gen/{SLList,DLList}.{hP,ccP}: Make 'copy-ee' arg of copy
- constructors and 2nd arg of operator= be const.
- * CursesW.h: Make more robust wrt const vs. non-const
- formal parameters to support SVR4.
- * EH.cc, EH2.c: Removed (since currently not used).
- * GetOpt.cc: alloca() kludges.
- * {BitSet,BitString}.{cc,h}, Integer.cc, String.cc: Remove
- dependence on non-standard <values.h> in favor of standard
- CHAR_BIT from <limits.h>
- * Makefile.in: Fix *clean stuff.
- * math-68881.h: Updated versions form gcc2.
- * timer.cc: #include <sys/param.h> before <sys/times.h>.
- Use !_G_HAVE_SYS_RESOURCE, not !defined(_G_HAVE_SYS_RESOURCE).
-
-Mon Jun 15 19:57:45 1992 Mike Stump (mrs at cygnus.com)
-
- * regex.cc (re_compile_pattern): Add const to p, p1, pend and p1.
-
-Wed Jun 3 16:49:51 1992 Per Bothner (bothner@rtl.cygnus.com)
-
- * Fix.cc (Fix::printon): Fix fmtflags -> ios::fmtflags.
- * Makefile.in: Hook (for Linux) for not putting regex.o into lib.
- * Regex.cc (Regex::Regex): Replace cast.
- * regex.h (RE_DUP_MAX): Gross hack for AIX.
- * regex.h, regex.cc, Regex.c: Change 2nd arg of
- re_compile_pattern from (char*) to (const char*).
- * timer.cc: Use explicit USE_TIMES to control use of
- times() instead of getrusage(). Supposedly, some systems
- have <sys/resource.h>, but not getrusage().
-
-Fri May 29 11:51:44 1992 Per Bothner (bothner@rtl.cygnus.com)
-
- * Fix.cc (Fix::printon):: Re-write to use operator<< instead
- of the non-standard ostream::form.
- * builtin.h: Removed redundant declarations of min() and max()
- (available in minmax.h).
- * malloc.c, regex.cc: Replace #ifdef USG by #ifdef _G_SYSV.
- * math-68881.h: Update from gcc (should be removed!),
- * minmax.h: Removed redundant 'signed' qualifiers.
- Add (char) versiosn of min and max, and made the (signed
- char) version conditional #ifndef _G_BROKEN_SIGNED_CHAR.
- * regex.cc: Better definitions of SIGN_EXTEND_CHAR.
- * new.cc: Change //-comment to /*comment*/ for old cpp-s.
- * Binomial.h, DiscUnif.h, Erlang.h, Geom.h, HypGeom.h, LogNorm.h,
- NegExp.h, Normal.h, Poisson.h, Uniform.h, Weibull.h,
- gen/{AVLMap.hP,AVec.hP,RAVLMap.hP,SplayMap.hP}: Replace
- anachronistic base constructor syntax :(args) with :Base(args).
- * gen/stdlib.h (_do_treeify): #include <stdlib.h> (for abort()).
- * gen/{CHNode,SplayNode,Vec}.hP: Include <T>.defs.h.
- * gen/{FPlex,RPlex,XPlex}.{h,cc}P: Remove redundant (and
- conflicting - according to cfront) append and prepend methods.
- * gen/SkipBag.ccP (SKipBag::seek): Add cast (for cfront's sake).
- * gen/SkipMap.hP: Fixed visibilty bug.
- * gen/Vec.ccP (operator==): Use EQ macro, instead of !=.
-
-Thu May 14 00:07:29 1992 Per Bothner (bothner@rtl.cygnus.com)
-
- * String.cc (operator>> and readline): Clean up setting
- of ios::flags().
-
- * osfcn.h: Only #include sys/socket.h and sys/resource.h
- if these are available (according to _G_config.h).
- * timer.cc: If HZ is undefined, define it as CLK_TCK (Posix, sort of).
- * gen/Lisp.hP: #include "<T>.defs.h", as done elsewhere.
-
-Sat May 9 12:34:09 1992 Per Bothner (bothner@rtl.cygnus.com)
-
- * std.h: Add strcasecmp().
-
-Wed May 6 01:33:05 1992 Per Bothner (bothner@rtl.cygnus.com)
-
- * gen/SLList.{hP,ccP}: Make argument of copy constructor
- be const.
-
- * CursesW.h: Add more kludges to convert macros into inline
- functions. This is so we can use /usr/include/curses.h.
- * CursesW.h: Replace uses of old cbool typedef by int.
- * bool.h: Add a comment deprecating its use.
-
-Tue May 5 15:19:24 1992 Per Bothner (bothner@rtl.cygnus.com)
-
- * CursesW.h: Fix typo.
- * curses.cc: Removed: No longer needed.
- * Makefile.in: Don't build curses.o.
-
-Sat May 2 16:42:28 1992 Per Bothner (bothner@rtl.cygnus.com)
-
- VMS changes from Eric Youngdale.
- * AllocRing.cc, Obstack.cc: Remove some a VMS hack that
- is no longer needed.
- * CursesW.cc, regex.h: More VMS stuff.
-
-Thu Apr 30 13:52:30 1992 Per Bothner (bothner@rtl.cygnus.com)
-
- * timer.cc: Use the more specific _G_HAVE_SYS_RESOURCE
- instead of the vague _G_SYSV.
- * delete.cc: Redundant with gcc/libgcc.2.c.
- * malloc.c: Remove junk that is now in gcc/libgcc2.c.
-
-Thu Apr 30 09:11:21 1992 K. Richard Pixley (rich@cygnus.com)
-
- * Makefile.in: make CFLAGS work from command line to make.
-
-Mon Apr 20 14:42:34 1992 Per Bothner (bothner@cygnus.com)
-
- * String.cc (String::OK): Re-arrange to avoid
- not-reached warning.
- * Makefile.in: Make 'touch stamp' not print out.
-
-Fri Apr 17 12:01:33 1992 Per Bothner (bothner at PersSony)
-
- * Integer.h, ...: Moved from ../g++-include. The plan
- is that ../g++-include only contains wrappers around
- standard C headers. It would not be needed on systems
- where the C header already support C++ (e.g. SVR4, Linux).
- * gen: Directory moved from ../g++-include.
- * CursesW.h, CursesW.cc: Handle using /usr/include/curses.h.
- * {Integer,Rational}.{h,cc}: Add a convention that an IntRep
- whose sz==0 is staticly allocated and should not be deleted
- when an Integer is destroyed. Define static INtReps for -1, 0,
- and 1, and use those where appropriate (including default
- constructors for Integer and Rational).
- * Integer.cc, Rational.cc, String.cc: Make Integer::OK(),
- Rational::OK() and String::OK() more robust.
- * RNG.cc: Don't give RNG::{single,double}Mantissa initial
- values, since that may be too late if there is a static
- RNG. Instead, initialize them in RNG::RNG.
- * bcopy.cc: Removed (use libiberty version).
- * timer.cc: Include <_G_config.h> to get __G_SYSV definition.
-
-Tue Mar 24 16:15:40 1992 Per Bothner (bothner@rtl.cygnus.com)
-
- * Rational.cc: Added Rational::fits_in_float() and
- fits_in_double() methods. Suggested/requested by
- Wendell Craig Baker <wbaker@ic.berkeley.edu>/
-
-Mon Mar 23 16:34:16 1992 Per Bothner (bothner@rtl.cygnus.com)
-
- * BitSet.cc, BitString.cc, Fix.cc: Add printon() methods,
- and changed operator<< functions to use printon().
- Deprecate use of *toa-style functions that use AllocRing;
- the new printon() methods do not.
- * Integer.cc: Added Integer::printon; fixed up operator<<
- to use opfx() as it's supposed to.
-
-Fri Mar 6 15:25:55 1992 Per Bothner (bothner@cygnus.com)
-
- * gnulib3.c: Removed obsolete file.
-
-Thu Mar 5 16:40:09 1992 Per Bothner (bothner@cygnus.com)
-
- * *.cc: Experiemnted with for each Foo.cc, adding
- '#define _COMPILING_Foo' to control compilation of inlines in
- Foo.h, then undid that change (see discussion in
- ../g_++-include/ChangeLog). Net difference is thus some
- minor tweaking.
-
- * regex.cc: Tweaks to remove warnings.
-
-Tue Mar 3 17:23:57 1992 Per Bothner (bothner@cygnus.com)
-
- * BitSet.cc: Move BitSet::clear() here from BitSet.h,
- and make non-inlined.
-
-Sun Mar 1 16:26:07 1992 Per Bothner (bothner@cygnus.com)
-
- * BitSet.cc, BitString.cc, Integer.cc, Rational.cc, String.cc:
- Make error() methods return void, not volatile void, since
- sometimes these error handlers *do* return.
- * Fix.cc: Fix parenthesization error.
-
-Sat Feb 29 14:07:32 1992 Michael Tiemann (tiemann@cygnus.com)
-
- * regex.cc (re_compile_pattern): Back out source code change that
- was used to workaround a bug in g++.
-
-Wed Feb 26 18:04:40 1992 K. Richard Pixley (rich@cygnus.com)
-
- * Makefile.in, configure.in: removed traces of namesubdir,
- -subdirs, $(subdir), $(unsubdir), some rcs triggers. Forced
- copyrights to '92, changed some from Cygnus to FSF.
-
-Wed Feb 26 12:37:43 1992 Per Bothner (bothner at cygnus.com)
-
- * BitSet.cc, BitString.cc, Integer.cc, Rational.cc,
- String.cc, error.cc: Use new _VOLATILE_VOID macro (from
- builtin.h) (to allow compilation by other C++ compilers).
- * BitSet.cc,regex.cc: #include <string.h>.
-
-Thu Feb 20 21:46:17 1992 Per Bothner (bothner at cygnus.com)
-
- * Regex.cc, regex.cc: Add some needed casts.
-
-Wed Feb 19 23:32:38 1992 Per Bothner (bothner at cygnus.com)
-
- * timer.cc: Include sys/types.h, since it is no
- longer automatically included by time.h.
- * regex.cc: Added a comment about being based on regex.c.
-
-Tue Feb 11 11:24:18 1992 Per Bothner (bothner at cygnus.com)
-
- * String.cc: Only skip ws if appropriate.
- * Complex.cc, Fix.cc, Integer.cc, Rational.cc:
- Apply fix below to other cases of operator>>.
- (And if the format is bad, set failbit, not badbit.)
-
- * String.cc (String::operator>>, readline):
- Use ipfx(0) instead of good() (unless _OLD_STREAMS).
- Thus make sure to set the failbit (to prevent
- infinite loops if eofbit is set without failbit).
-
-Mon Feb 10 11:20:13 1992 Per Bothner (bothner at rtl.cygnus.com)
-
- * String.C (String::operator const char*): Don't
- use the str() function to copy into an AllocRing
- (since we're phasing out use of AllocRings).
-
-Wed Jan 29 12:51:05 1992 Per Bothner (bothner at cygnus.com)
-
- * Sample.cc: Rename #included files to current names.
-
-Fri Jan 24 15:51:50 1992 Per Bothner (bothner at cygnus.com)
-
- * Makefile.in, configure.in: Some common rules moved to Make.defs.
-
- * new.cc, delete.cc: Include stdlib.h instead of obsolete malloc.h.
-
-Fri Jan 17 15:03:28 1992 Per Bothner (bothner at cygnus.com)
-
- Merge in Doug Lea's latest version; other fixes.
- * Most files: Replaced copyright notice (the old
- ones claimed to be part of GNU CC).
- * Makefile.in (depend): Tweak it.
- * ACG.cc, AllocRing.cc, BitSet.cc, BitString.cc, GetOpt.cc,
- RNG.cc, dtoa.cc: Minor improvements.
- * BitString.cc, Fix16.cc, Fix24.cc, String.cc: Change (int)
- to (unsigned int) various places, inspired by gcc-2 warnings.
- * Complex.cc, CursesW.cc, Fix.cc, Integer.cc, Rational.cc,
- String.cc: Various changes to allow use with either the
- old stream facility or the new iostream facility.
- * regex.cc: Use 'new char[]' instead of 'malloc()'.
- * bcopy.cc: Minor changes. Rename bcopy -> libgxx_bcopy.
- * malloc.c: Use size_t consistently.
- * regex.cc: New version from FSF (C++ -ified).
- * minmax.cc: New file.
- * MIN.cc, MAX.cc, std.cc: Removed.
-
-Sat Jan 11 14:44:17 1992 Michael Tiemann (tiemann at cygnus.com)
-
- * CursesW.cc, GetOpt.cc: Don't declare any static class members
- `static' at top-level.
-
-Sun Jan 5 00:12:05 1992 Per Bothner (bothner at cygnus.com)
-
- * Makefile.in, configure.in: Automated 'make depend' support.
- * String.cc: For now, use _bad instead of ios::badbit.
- * File.cc, Filebuf.cc, PlotFile.cc, SFile.cc, filebuf.cc,
- form.cc, istream.cc, itoa.cc, ostream.cc, streambuf.cc:
- Moved to ../old-stream.
- * Makefile.in: Move rules for Making the stream stuff to
- ../old-stream/Makefile.in.
-
-Fri Jan 3 17:00:40 1992 Per Bothner (bothner at cygnus.com)
-
- * Integer.cc, BitSet.cc, BitString.cc, Rational.cc:
- Add #include <builtin.h> as needed. It was included by the
- old stream.h, but not by the new iostream.h.
- * Integer.cc: Merged in Doug Lea's changes to avoid
- signed/unsigned warnings.
- * Fix.cc, String.cc: Fix some portabilty problems that
- depended on the old stream code.
-
-Tue Dec 31 18:19:15 1991 Per Bothner (bothner at cygnus.com)
-
- * Makefile.in: Move common definitions to ../Make.defs.
- * configure.in: Define host_makefile_frag to pull in Make.defs.
-
-Sat Dec 28 16:47:38 1991 Michael Tiemann (tiemann at cygnus.com)
-
- * regex.cc (re_compile_pattern,re_comp,main): Use `malloc' instead
- of `new char[]' since we need to call realloc, and that doesn't
- work with arrays allocated by new.
- * Regex.cc (Regex::Regex): Ditto.
-
diff --git a/contrib/libg++/libg++/src/Complex.h b/contrib/libg++/libg++/src/Complex.h
deleted file mode 100644
index 242f06e16644..000000000000
--- a/contrib/libg++/libg++/src/Complex.h
+++ /dev/null
@@ -1,10 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-
-#ifndef _Complex_h
-#define _Complex_h
-
-// Use the ANSI complex number template.
-#include <complex>
-typedef complex<double> Complex;
-
-#endif
diff --git a/contrib/libg++/libg++/src/CursesW.cc b/contrib/libg++/libg++/src/CursesW.cc
deleted file mode 100644
index c80f33d47da1..000000000000
--- a/contrib/libg++/libg++/src/CursesW.cc
+++ /dev/null
@@ -1,257 +0,0 @@
-/*
-Copyright (C) 1989, 1992 Free Software Foundation
- written by Eric Newton (newton@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <stdio.h>
-#include <stdarg.h>
-#include <builtin.h>
-#ifndef _OLD_STREAMS
-#include <strstream.h>
-#endif
-// Include CurseW.h and/or curses.h *after* iostream includes,
-// because curses.h defines a clear macro that conflicts with iostream. Sigh.
-#include <CursesW.h>
-
-#if _G_HAVE_CURSES
-
-#ifndef OK
-#define OK (1)
-#endif
-
-int CursesWindow::count = 0;
-
-/*
- * C++ interface to curses library.
- *
- */
-
-#if !defined(_IO_MAGIC) && !defined(HAVE_VSCANF) &&!defined vsscanf
-extern "C" int _doscan(FILE *, const char*, va_list args);
-
-static int vsscanf(char *buf, const char * fmt, va_list args)
-{
- FILE b;
-#ifdef _IOSTRG
- b._flag = _IOREAD|_IOSTRG;
-#else
- b._flag = _IOREAD;
-#endif
- b._base = (unsigned char*)buf;
- b._ptr = (unsigned char*)buf;
- b._cnt = BUFSIZ;
- return _doscan(&b, fmt, args);
-}
-#endif
-
-/*
- * varargs functions are handled conservatively:
- * They interface directly into the underlying
- * _doscan, _doprnt and/or vfprintf routines rather than
- * assume that such things are handled compatibly in the curses library
- */
-
-int CursesWindow::scanw(const char * fmt, ...)
-{
- va_list args;
- va_start(args, fmt);
-#ifdef VMS
- int result = wscanw(w , fmt , args);
-#else /* NOT VMS */
- char buf[BUFSIZ];
- int result = wgetstr(w, buf);
- if (result == OK) {
-
-#ifdef _IO_MAGIC /* GNU iostreams */
- strstreambuf ss(buf, BUFSIZ);
- result = ss.vscan(fmt, args);
-#else
- result = vsscanf(buf, fmt, args);
-#endif
- }
-#endif /* !VMS */
- va_end(args);
- return result;
-}
-
-int CursesWindow::mvscanw(int y, int x, const char * fmt, ...)
-{
- va_list args;
- va_start(args, fmt);
- char buf[BUFSIZ];
- int result = wmove(w, y, x);
- if (result == OK)
-#ifdef VMS
- result=wscanw(w , fmt , args);
-#else /* !VMS */
- {
- result = wgetstr(w, buf);
- if (result == OK) {
-#ifdef _IO_MAGIC /* GNU iostreams */
- strstreambuf ss(buf, BUFSIZ);
- result = ss.vscan(fmt, args);
-#else
- result = vsscanf(buf, fmt, args);
-#endif
- }
- }
-#endif /* !VMS */
- va_end(args);
- return result;
-}
-
-int CursesWindow::printw(const char * fmt, ...)
-{
- va_list args;
- va_start(args, fmt);
- char buf[BUFSIZ];
- vsprintf(buf, fmt, args);
- va_end(args);
- return waddstr(w, buf);
-}
-
-
-int CursesWindow::mvprintw(int y, int x, const char * fmt, ...)
-{
- va_list args;
- va_start(args, fmt);
- int result = wmove(w, y, x);
- if (result == OK)
- {
- char buf[BUFSIZ];
- vsprintf(buf, fmt, args);
- result = waddstr(w, buf);
- }
- va_end(args);
- return result;
-}
-
-CursesWindow::CursesWindow(int lines, int cols, int begin_y, int begin_x)
-{
- if (count==0)
- initscr();
-
- w = newwin(lines, cols, begin_y, begin_x);
- if (w == 0)
- {
- (*lib_error_handler)("CursesWindow", "Cannot construct window");
- }
-
- alloced = 1;
- subwins = par = sib = 0;
- count++;
-}
-
-CursesWindow::CursesWindow(WINDOW* &window)
-{
- if (count==0)
- initscr();
-
- w = window;
- alloced = 0;
- subwins = par = sib = 0;
- count++;
-}
-
-CursesWindow::CursesWindow(CursesWindow& win, int l, int c,
- int by, int bx, char absrel)
-{
-
- if (absrel == 'r') // relative origin
- {
- by += win.begy();
- bx += win.begx();
- }
-
- // Even though we treat subwindows as a tree, the standard curses
- // library needs the `subwin' call to link to the root in
- // order to correctly perform refreshes, etc.
-
- CursesWindow* root = &win;
- while (root->par != 0) root = root->par;
-
- w = subwin(root->w, l, c, by, bx);
- if (w == 0)
- {
- (*lib_error_handler)("CursesWindow", "Cannot construct subwindow");
- }
-
- par = &win;
- sib = win.subwins;
- win.subwins = this;
- subwins = 0;
- alloced = 1;
- count++;
-}
-
-
-void CursesWindow::kill_subwindows()
-{
- for (CursesWindow* p = subwins; p != 0; p = p->sib)
- {
- p->kill_subwindows();
- if (p->alloced)
- {
- if (p->w != 0)
- ::delwin(p->w);
- p->alloced = 0;
- }
- p->w = 0; // cause a run-time error if anyone attempts to use...
- }
-}
-
-CursesWindow::~CursesWindow()
-{
- kill_subwindows();
-
- if (par != 0) // Snip us from the parent's list of subwindows.
- {
- CursesWindow * win = par->subwins;
- CursesWindow * trail = 0;
- for (;;)
- {
- if (win == 0)
- break;
- else if (win == this)
- {
- if (trail != 0)
- trail->sib = win->sib;
- else
- par->subwins = win->sib;
- break;
- }
- else
- {
- trail = win;
- win = win->sib;
- }
- }
- }
-
- if (alloced && w != 0)
- delwin(w);
-
- --count;
- if (count == 0)
- endwin();
- else if (count < 0) // cannot happen!
- {
- (*lib_error_handler)("CursesWindow", "Too many windows destroyed");
- }
-}
-
-#endif /* _G_HAVE_CURSES */
diff --git a/contrib/libg++/libg++/src/CursesW.h b/contrib/libg++/libg++/src/CursesW.h
deleted file mode 100644
index 5bff08df2582..000000000000
--- a/contrib/libg++/libg++/src/CursesW.h
+++ /dev/null
@@ -1,603 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-
-/*
-Copyright (C) 1989 Free Software Foundation
- written by Eric Newton (newton@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifndef _CursesWindow_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _CursesWindow_h
-
-#include <_G_config.h>
-
-#if defined(__bsdi__) || defined(__NetBSD__) || defined(__FreeBSD__)
-#define _begx begx
-#define _begy begy
-#define _maxx maxx
-#define _maxy maxy
-#endif
-
-#if _G_HAVE_CURSES
-// Even many system which mostly have C++-ready header files,
-// do not have C++-ready curses.h.
-extern "C" {
-#include <curses.h>
-}
-
-/* SCO 3.2v4 curses.h includes term.h, which defines lines as a macro.
- Undefine it here, because CursesWindow uses lines as a method. */
-#undef lines
-
-// "Convert" macros to inlines, if needed.
-#ifdef addch
-inline int (addch)(char ch) { return addch(ch); }
-#undef addch
-#endif
-#ifdef addstr
-/* The (char*) cast is to hack around missing const's */
-inline int (addstr)(const char * str) { return addstr((char*)str); }
-#undef addstr
-#endif
-#ifdef clear
-inline int (clear)() { return clear(); }
-#undef clear
-#endif
-#ifdef clearok
-inline int (clearok)(WINDOW* win, int bf) { return clearok(win, bf); }
-#undef clearok
-#else
-extern "C" int clearok(WINDOW*, int);
-#endif
-#ifdef clrtobot
-inline int (clrtobot)() { return clrtobot(); }
-#undef clrtobot
-#endif
-#ifdef clrtoeol
-inline int (clrtoeol)() { return clrtoeol(); }
-#undef clrtoeol
-#endif
-#ifdef delch
-inline int (delch)() { return delch(); }
-#undef delch
-#endif
-#ifdef deleteln
-inline int (deleteln)() { return deleteln(); }
-#undef deleteln
-#endif
-#ifdef erase
-inline int (erase)() { return erase(); }
-#undef erase
-#endif
-#ifdef flushok
-inline int (flushok)(WINDOW* _win, int _bf) { return flushok(_win, _bf); }
-#undef flushok
-#else
-#define _no_flushok
-#endif
-#ifdef getch
-inline int (getch)() { return getch(); }
-#undef getch
-#endif
-#ifdef getstr
-inline int (getstr)(char *_str) { return getstr(_str); }
-#undef getstr
-#endif
-#ifdef getyx
-inline void (getyx)(WINDOW* win, int& y, int& x) { getyx(win, y, x); }
-#undef getyx
-#endif
-#ifdef inch
-inline int (inch)() { return inch(); }
-#undef inch
-#endif
-#ifdef insch
-inline int (insch)(char c) { return insch(c); }
-#undef insch
-#endif
-#ifdef insertln
-inline int (insertln)() { return insertln(); }
-#undef insertln
-#endif
-#ifdef leaveok
-inline int (leaveok)(WINDOW* win, int bf) { return leaveok(win, bf); }
-#undef leaveok
-#else
-extern "C" int leaveok(WINDOW* win, int bf);
-#endif
-#ifdef move
-inline int (move)(int x, int y) { return move(x, y); }
-#undef move
-#endif
-#ifdef refresh
-inline int (rfresh)() { return refresh(); }
-#undef refresh
-#endif
-#ifdef scrollok
-inline int (scrollok)(WINDOW* win, int bf) { return scrollok(win, bf); }
-#undef scrollok
-#else
-#ifndef hpux
-extern "C" int scrollok(WINDOW*, int);
-#else
-extern "C" int scrollok(WINDOW*, char);
-#endif
-#endif
-#ifdef standend
-inline int (standend)() { return standend(); }
-#undef standend
-#endif
-#ifdef standout
-inline int (standout)() { return standout(); }
-#undef standout
-#endif
-#ifdef wstandend
-inline int (wstandend)(WINDOW *win) { return wstandend(win); }
-#undef wstandend
-#endif
-#ifdef wstandout
-inline int (wstandout)(WINDOW *win) { return wstandout(win); }
-#undef wstandout
-#endif
-#ifdef winch
-inline int (winch)(WINDOW* win) { return winch(win); }
-#undef winch
-#endif
-
-/* deal with conflicting macros in ncurses.h which is SYSV based*/
-#ifdef box
-inline int _G_box(WINDOW* win, chtype v, chtype h) {return box(win, v, h); }
-#undef box
-inline int box(WINDOW* win, chtype v, chtype h) {return _G_box(win, v, h); }
-#endif
-#ifdef scroll
-inline int (scroll)(WINDOW* win) { return scroll(win); }
-#undef scroll
-#endif
-#ifdef touchwin
-inline int (touchwin)(WINDOW* win) { return touchwin(win); }
-#undef touchwin
-#endif
-
-#ifdef mvwaddch
-inline int (mvwaddch)(WINDOW *win, int y, int x, char ch)
-{ return mvwaddch(win, y, x, ch); }
-#undef mvwaddch
-#endif
-#ifdef mvwaddstr
-inline int (mvwaddstr)(WINDOW *win, int y, int x, const char * str)
-{ return mvwaddstr(win, y, x, (char*)str); }
-#undef mvwaddstr
-#endif
-#ifdef mvwdelch
-inline int (mvwdelch)(WINDOW *win, int y, int x) { return mvwdelch(win, y, x);}
-#undef mvwdelch
-#endif
-#ifdef mvwgetch
-inline int (mvwgetch)(WINDOW *win, int y, int x) { return mvwgetch(win, y, x);}
-#undef mvwgetch
-#endif
-#ifdef mvwgetstr
-inline int (mvwgetstr)(WINDOW *win, int y, int x, char *str)
-{return mvwgetstr(win,y,x, str);}
-#undef mvwgetstr
-#endif
-#ifdef mvwinch
-inline int (mvwinch)(WINDOW *win, int y, int x) { return mvwinch(win, y, x);}
-#undef mvwinch
-#endif
-#ifdef mvwinsch
-inline int (mvwinsch)(WINDOW *win, int y, int x, char c)
-{ return mvwinsch(win, y, x, c); }
-#undef mvwinsch
-#endif
-
-#ifdef mvaddch
-inline int (mvaddch)(int y, int x, char ch)
-{ return mvaddch(y, x, ch); }
-#undef mvaddch
-#endif
-#ifdef mvaddstr
-inline int (mvaddstr)(int y, int x, const char * str)
-{ return mvaddstr(y, x, (char*)str); }
-#undef mvaddstr
-#endif
-#ifdef mvdelch
-inline int (mvdelch)(int y, int x) { return mvdelch(y, x);}
-#undef mvdelch
-#endif
-#ifdef mvgetch
-inline int (mvgetch)(int y, int x) { return mvgetch(y, x);}
-#undef mvgetch
-#endif
-#ifdef mvgetstr
-inline int (mvgetstr)(int y, int x, char *str) {return mvgetstr(y, x, str);}
-#undef mvgetstr
-#endif
-#ifdef mvinch
-inline int (mvinch)(int y, int x) { return mvinch(y, x);}
-#undef mvinch
-#endif
-#ifdef mvinsch
-inline int (mvinsch)(int y, int x, char c)
-{ return mvinsch(y, x, c); }
-#undef mvinsch
-#endif
-
-/*
- *
- * C++ class for windows.
- *
- *
- */
-
-class CursesWindow
-{
-protected:
- static int count; // count of all active windows:
- // We rely on the c++ promise that
- // all otherwise uninitialized
- // static class vars are set to 0
-
- WINDOW * w; // the curses WINDOW
-
- int alloced; // true if we own the WINDOW
-
- CursesWindow* par; // parent, if subwindow
- CursesWindow* subwins; // head of subwindows list
- CursesWindow* sib; // next subwindow of parent
-
- void kill_subwindows(); // disable all subwindows
-
-public:
- CursesWindow(WINDOW* &window); // useful only for stdscr
-
- CursesWindow(int lines, // number of lines
- int cols, // number of columns
- int begin_y, // line origin
- int begin_x); // col origin
-
- CursesWindow(CursesWindow& par, // parent window
- int lines, // number of lines
- int cols, // number of columns
- int by, // absolute or relative
- int bx, // origins:
- char absrel = 'a'); // if `a', by & bx are
- // absolute screen pos,
- // else if `r', they are
- // relative to par origin
- ~CursesWindow();
-
-// terminal status
- int lines(); // number of lines on terminal, *not* window
- int cols(); // number of cols on terminal, *not* window
-
-// window status
- int height(); // number of lines in this window
- int width(); // number of cols in this window
- int begx(); // smallest x coord in window
- int begy(); // smallest y coord in window
- int maxx(); // largest x coord in window
- int maxy(); // largest x coord in window
-
-// window positioning
- int move(int y, int x);
-
-// coordinate positioning
- void getyx(int& y, int& x);
- int mvcur(int sy, int ey, int sx, int ex);
-
-// input
- int getch();
- int getstr(char * str);
- int scanw(const char *, ...);
-
-// input + positioning
- int mvgetch(int y, int x);
- int mvgetstr(int y, int x, char * str);
- int mvscanw(int, int, const char*, ...);
-
-// output
- int addch(const char ch);
- int addstr(const char * str);
- int printw(const char * fmt, ...);
- int inch();
- int insch(char c);
- int insertln();
-
-// output + positioning
- int mvaddch(int y, int x, char ch);
- int mvaddstr(int y, int x, const char * str);
- int mvprintw(int y, int x, const char * fmt, ...);
- int mvinch(int y, int x);
- int mvinsch(int y, int x, char ch);
-
-// borders
- int box(char vert, char hor);
-
-// erasure
- int erase();
- int clear();
- int clearok(int bf);
- int clrtobot();
- int clrtoeol();
- int delch();
- int mvdelch(int y, int x);
- int deleteln();
-
-// screen control
- int scroll();
- int scrollok(int bf);
- int touchwin();
- int refresh();
- int leaveok(int bf);
-#ifndef _no_flushok
- int flushok(int bf);
-#endif
- int standout();
- int standend();
-
-// multiple window control
- int overlay(CursesWindow &win);
- int overwrite(CursesWindow &win);
-
-
-// traversal support
- CursesWindow* child();
- CursesWindow* sibling();
- CursesWindow* parent();
-};
-
-
-inline int CursesWindow::begx()
-{
- return w->_begx;
-}
-
-inline int CursesWindow::begy()
-{
- return w->_begy;
-}
-
-inline int CursesWindow::maxx()
-{
- return w->_maxx;
-}
-
-inline int CursesWindow::maxy()
-{
- return w->_maxy;
-}
-
-inline int CursesWindow::height()
-{
- return maxy() - begy() + 1;
-}
-
-inline int CursesWindow::width()
-{
- return maxx() - begx() + 1;
-}
-
-inline int CursesWindow::box(char vert, char hor)
-{
- return ::box(w, vert, hor);
-}
-
-inline int CursesWindow::overlay(CursesWindow &win)
-{
- return ::overlay(w, win.w);
-}
-
-inline int CursesWindow::overwrite(CursesWindow &win)
-{
- return ::overwrite(w, win.w);
-}
-
-inline int CursesWindow::scroll()
-{
- return ::scroll(w);
-}
-
-
-inline int CursesWindow::touchwin()
-{
- return ::touchwin(w);
-}
-
-inline int CursesWindow::addch(const char ch)
-{
- return ::waddch(w, ch);
-}
-
-inline int CursesWindow::addstr(const char * str)
-{
- // The (char*) cast is to hack around prototypes in curses.h that
- // have const missing in the parameter lists. [E.g. SVR4]
- return ::waddstr(w, (char*)str);
-}
-
-inline int CursesWindow::clear()
-{
- return ::wclear(w);
-}
-
-inline int CursesWindow::clrtobot()
-{
- return ::wclrtobot(w);
-}
-
-inline int CursesWindow::clrtoeol()
-{
- return ::wclrtoeol(w);
-}
-
-inline int CursesWindow::delch()
-{
- return ::wdelch(w);
-}
-
-inline int CursesWindow::deleteln()
-{
- return ::wdeleteln(w);
-}
-
-inline int CursesWindow::erase()
-{
- return ::werase(w);
-}
-
-inline int CursesWindow::getch()
-{
- return ::wgetch(w);
-}
-
-inline int CursesWindow::getstr(char * str)
-{
- return ::wgetstr(w, str);
-}
-
-inline int CursesWindow::inch()
-{
- return winch(w);
-}
-
-inline int CursesWindow::insch(char c)
-{
- return ::winsch(w, c);
-}
-
-inline int CursesWindow::insertln()
-{
- return ::winsertln(w);
-}
-
-inline int CursesWindow::move(int y, int x)
-{
- return ::wmove(w, y, x);
-}
-
-
-inline int CursesWindow::mvcur(int sy, int ey, int sx, int ex)
-{
- return ::mvcur(sy, ey, sx,ex);
-}
-
-inline int CursesWindow::mvaddch(int y, int x, char ch)
-{
- return (::wmove(w, y, x)==ERR) ? ERR : ::waddch(w, ch);
-}
-
-inline int CursesWindow::mvgetch(int y, int x)
-{
- return (::wmove(w, y, x)==ERR) ? ERR : ::wgetch(w);
-}
-
-inline int CursesWindow::mvaddstr(int y, int x, const char * str)
-{
- return (::wmove(w, y, x)==ERR) ? ERR : ::waddstr(w, (char*)str);
-}
-
-inline int CursesWindow::mvgetstr(int y, int x, char * str)
-{
- return (::wmove(w, y, x)==ERR) ? ERR : ::wgetstr(w, str);
-}
-
-inline int CursesWindow::mvinch(int y, int x)
-{
- return (::wmove(w, y, x)==ERR) ? ERR : ::winch(w);
-}
-
-inline int CursesWindow::mvdelch(int y, int x)
-{
- return (::wmove(w, y, x)==ERR) ? ERR : ::wdelch(w);
-}
-
-inline int CursesWindow::mvinsch(int y, int x, char ch)
-{
- return (::wmove(w, y, x)==ERR) ? ERR : ::winsch(w, ch);
-}
-
-inline int CursesWindow::refresh()
-{
- return ::wrefresh(w);
-}
-
-inline int CursesWindow::clearok(int bf)
-{
- return ::clearok(w,bf);
-}
-
-inline int CursesWindow::leaveok(int bf)
-{
- return ::leaveok(w,bf);
-}
-
-inline int CursesWindow::scrollok(int bf)
-{
- return ::scrollok(w,bf);
-}
-
-#ifndef _no_flushok
-inline int CursesWindow::flushok(int bf)
-{
- return ::flushok(w, bf);
-}
-#endif
-
-inline void CursesWindow::getyx(int& y, int& x)
-{
- ::getyx(w, y, x);
-}
-
-inline int CursesWindow::standout()
-{
- return ::wstandout(w);
-}
-
-inline int CursesWindow::standend()
-{
- return ::wstandend(w);
-}
-
-inline int CursesWindow::lines()
-{
- return LINES;
-}
-
-inline int CursesWindow::cols()
-{
- return COLS;
-}
-
-inline CursesWindow* CursesWindow::child()
-{
- return subwins;
-}
-
-inline CursesWindow* CursesWindow::parent()
-{
- return par;
-}
-
-inline CursesWindow* CursesWindow::sibling()
-{
- return sib;
-}
-
-#endif /* _G_HAVE_CURSES */
-#endif
diff --git a/contrib/libg++/libg++/src/DLList.cc b/contrib/libg++/libg++/src/DLList.cc
deleted file mode 100644
index 6e15408d35bb..000000000000
--- a/contrib/libg++/libg++/src/DLList.cc
+++ /dev/null
@@ -1,327 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifndef _G_NO_TEMPLATES
-#ifdef __GNUG__
-//#pragma implementation
-#endif
-#include <limits.h>
-#include <stream.h>
-#include <builtin.h>
-#include "DLList.h"
-
-void BaseDLList::error(const char* msg) const
-{
- (*lib_error_handler)("DLList", msg);
-}
-
-int BaseDLList::length() const
-{
- int l = 0;
- BaseDLNode* t = h;
- if (t != 0) do { ++l; t = t->fd; } while (t != h);
- return l;
-}
-
-// Note: This is an internal method. It does *not* free old contents!
-
-void BaseDLList::copy(const BaseDLList& a)
-{
- if (a.h == 0)
- h = 0;
- else
- {
- BaseDLNode* p = a.h;
- BaseDLNode* t = copy_node(p->item());
- h = t;
- p = p->fd;
- while (p != a.h)
- {
- BaseDLNode* n = copy_node(p->item());
- t->fd = n;
- n->bk = t;
- t = n;
- p = p->fd;
- }
- t->fd = h;
- h->bk = t;
- return;
- }
-}
-
-void BaseDLList::clear()
-{
- if (h == 0)
- return;
-
- BaseDLNode* p = h->fd;
- h->fd = 0;
- h = 0;
-
- while (p != 0)
- {
- BaseDLNode* nxt = p->fd;
- delete_node(p);
- p = nxt;
- }
-}
-
-BaseDLList& BaseDLList::operator = (const BaseDLList& a)
-{
- if (h != a.h)
- {
- clear();
- copy(a);
- }
- return *this;
-}
-
-
-Pix BaseDLList::prepend(const void *datum)
-{
- BaseDLNode* t = copy_node(datum);
- if (h == 0)
- t->fd = t->bk = h = t;
- else
- {
- t->fd = h;
- t->bk = h->bk;
- h->bk->fd = t;
- h->bk = t;
- h = t;
- }
- return Pix(t);
-}
-
-Pix BaseDLList::append(const void *datum)
-{
- BaseDLNode* t = copy_node(datum);
- if (h == 0)
- t->fd = t->bk = h = t;
- else
- {
- t->bk = h->bk;
- t->bk->fd = t;
- t->fd = h;
- h->bk = t;
- }
- return Pix(t);
-}
-
-Pix BaseDLList::ins_after(Pix p, const void *datum)
-{
- if (p == 0) return prepend(datum);
- BaseDLNode* u = (BaseDLNode*) p;
- BaseDLNode* t = copy_node(datum);
- t->bk = u;
- t->fd = u->fd;
- u->fd->bk = t;
- u->fd = t;
- return Pix(t);
-}
-
-Pix BaseDLList::ins_before(Pix p, const void *datum)
-{
- if (p == 0) error("null Pix");
- BaseDLNode* u = (BaseDLNode*) p;
- BaseDLNode* t = copy_node(datum);
- t->bk = u->bk;
- t->fd = u;
- u->bk->fd = t;
- u->bk = t;
- if (u == h) h = t;
- return Pix(t);
-}
-
-void BaseDLList::join(BaseDLList& b)
-{
- BaseDLNode* t = b.h;
- b.h = 0;
- if (h == 0)
- h = t;
- else if (t != 0)
- {
- BaseDLNode* l = t->bk;
- h->bk->fd = t;
- t->bk = h->bk;
- h->bk = l;
- l->fd = h;
- }
-}
-
-int BaseDLList::owns(Pix p) const
-{
- BaseDLNode* t = h;
- if (t != 0 && p != 0)
- {
- do
- {
- if (Pix(t) == p) return 1;
- t = t->fd;
- } while (t != h);
- }
- return 0;
-}
-
-void BaseDLList::del(Pix& p, int dir)
-{
- if (p == 0) error("null Pix");
- BaseDLNode* t = (BaseDLNode*) p;
- if (t->fd == t)
- {
- h = 0;
- p = 0;
- }
- else
- {
- if (dir < 0)
- {
- if (t == h)
- p = 0;
- else
- p = Pix(t->bk);
- }
- else
- {
- if (t == h->bk)
- p = 0;
- else
- p = Pix(t->fd);
- }
- t->bk->fd = t->fd;
- t->fd->bk = t->bk;
- if (t == h) h = t->fd;
- }
- delete_node(t);
-}
-
-void BaseDLList::del_after(Pix& p)
-{
- if (p == 0)
- {
- del_front();
- return;
- }
-
- BaseDLNode* b = (BaseDLNode*) p;
- BaseDLNode* t = b->fd;
-
- if (b == t)
- {
- h = 0;
- p = 0;
- }
- else
- {
- t->bk->fd = t->fd;
- t->fd->bk = t->bk;
- if (t == h) h = t->fd;
- }
- delete_node(t);
-}
-
-void BaseDLList::remove_front(void *dst)
-{
- if (h == 0)
- error("remove_front of empty list");
- else {
- BaseDLNode* t = h;
- copy_item(dst, t->item());
- if (h->fd == h)
- h = 0;
- else
- {
- h->fd->bk = h->bk;
- h->bk->fd = h->fd;
- h = h->fd;
- }
- delete_node(t);
- }
-}
-
-void BaseDLList::del_front()
-{
- if (h == 0)
- error("del_front of empty list");
- BaseDLNode* t = h;
- if (h->fd == h)
- h = 0;
- else
- {
- h->fd->bk = h->bk;
- h->bk->fd = h->fd;
- h = h->fd;
- }
- delete_node(t);
-}
-
-void BaseDLList::remove_rear(void *dst)
-{
- if (h == 0)
- error("remove_rear of empty list");
- else
- {
- BaseDLNode* t = h->bk;
- copy_item(dst, t->item());
- if (h->fd == h)
- h = 0;
- else
- {
- t->fd->bk = t->bk;
- t->bk->fd = t->fd;
- }
- delete_node(t);
- }
-}
-
-void BaseDLList::del_rear()
-{
- if (h == 0)
- error("del_rear of empty list");
- BaseDLNode* t = h->bk;
- if (h->fd == h)
- h = 0;
- else
- {
- t->fd->bk = t->bk;
- t->bk->fd = t->fd;
- }
- delete_node(t);
-}
-
-
-int BaseDLList::OK() const
-{
- int v = 1;
- if (h != 0)
- {
- BaseDLNode* t = h;
- long count = LONG_MAX; // Lots of chances to find h!
- do
- {
- count--;
- v &= t->bk->fd == t;
- v &= t->fd->bk == t;
- t = t->fd;
- } while (v && count > 0 && t != h);
- v &= count > 0;
- }
- if (!v) error("invariant failure");
- return v;
-}
-#endif
diff --git a/contrib/libg++/libg++/src/DLList.h b/contrib/libg++/libg++/src/DLList.h
deleted file mode 100644
index 3723c5c6506d..000000000000
--- a/contrib/libg++/libg++/src/DLList.h
+++ /dev/null
@@ -1,139 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-
-#ifndef _DLList_h
-#ifdef __GNUG__
-//#pragma interface
-#endif
-#define _DLList_h 1
-
-#undef OK
-
-#include <Pix.h>
-
-struct BaseDLNode {
- BaseDLNode *bk;
- BaseDLNode *fd;
- void *item() {return (void*)(this+1);} //Return ((DLNode<T>*)this)->hd
-};
-
-template<class T>
-class DLNode : public BaseDLNode
-{
- public:
- T hd;
- DLNode() { }
- DLNode(const T& h, DLNode* p = 0, DLNode* n = 0)
- : hd(h) { bk = p; fd = n; }
- ~DLNode() { }
-};
-
-class BaseDLList {
- protected:
- BaseDLNode *h;
-
- BaseDLList() { h = 0; }
- void copy(const BaseDLList&);
- BaseDLList& operator= (const BaseDLList& a);
- virtual void delete_node(BaseDLNode*node) = 0;
- virtual BaseDLNode* copy_node(const void* datum) = 0;
- virtual void copy_item(void *dst, void *src) = 0;
- virtual ~BaseDLList() { }
-
- Pix prepend(const void*);
- Pix append(const void*);
- Pix ins_after(Pix p, const void *datum);
- Pix ins_before(Pix p, const void *datum);
- void remove_front(void *dst);
- void remove_rear(void *dst);
- void join(BaseDLList&);
-
- public:
- int empty() const { return h == 0; }
- int length() const;
- void clear();
- void error(const char* msg) const;
- int owns(Pix p) const;
- int OK() const;
- void del(Pix& p, int dir = 1);
- void del_after(Pix& p);
- void del_front();
- void del_rear();
-};
-
-template <class T>
-class DLList : public BaseDLList {
- //friend class <T>DLListTrav;
-
- virtual void delete_node(BaseDLNode *node) { delete (DLNode<T>*)node; }
- virtual BaseDLNode* copy_node(const void *datum)
- { return new DLNode<T>(*(const T*)datum); }
- virtual void copy_item(void *dst, void *src) { *(T*)dst = *(T*)src; }
-
- public:
- DLList() : BaseDLList() { }
- DLList(const DLList<T>& a) : BaseDLList() { copy(a); }
-
- DLList<T>& operator = (const DLList<T>& a)
- { BaseDLList::operator=((const BaseDLList&) a); return *this; }
- virtual ~DLList() { clear(); }
-
- Pix prepend(const T& item) {return BaseDLList::prepend(&item);}
- Pix append(const T& item) {return BaseDLList::append(&item);}
-
- void join(DLList<T>& a) { BaseDLList::join(a); }
-
- T& front() {
- if (h == 0) error("front: empty list");
- return ((DLNode<T>*)h)->hd; }
- T& rear() {
- if (h == 0) error("rear: empty list");
- return ((DLNode<T>*)h->bk)->hd;
- }
- const T& front() const {
- if (h == 0) error("front: empty list");
- return ((DLNode<T>*)h)->hd; }
- const T& rear() const {
- if (h == 0) error("rear: empty list");
- return ((DLNode<T>*)h->bk)->hd;
- }
- T remove_front() { T dst; BaseDLList::remove_front(&dst); return dst; }
- T remove_rear() { T dst; BaseDLList::remove_rear(&dst); return dst; }
-
- T& operator () (Pix p) {
- if (p == 0) error("null Pix");
- return ((DLNode<T>*)p)->hd;
- }
- const T& operator () (Pix p) const {
- if (p == 0) error("null Pix");
- return ((DLNode<T>*)p)->hd;
- }
- Pix first() const { return Pix(h); }
- Pix last() const { return (h == 0) ? 0 : Pix(h->bk); }
- void next(Pix& p) const
- { p = (p == 0 || p == h->bk)? 0 : Pix(((DLNode<T>*)p)->fd); }
- void prev(Pix& p) const
- { p = (p == 0 || p == h)? 0 : Pix(((DLNode<T>*)p)->bk); }
- Pix ins_after(Pix p, const T& item)
- {return BaseDLList::ins_after(p, &item); }
- Pix ins_before(Pix p, const T& item)
- {return BaseDLList::ins_before(p, &item);}
-};
-
-#endif
diff --git a/contrib/libg++/libg++/src/DiscUnif.cc b/contrib/libg++/libg++/src/DiscUnif.cc
deleted file mode 100644
index 950d9f9409e4..000000000000
--- a/contrib/libg++/libg++/src/DiscUnif.cc
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Dirk Grunwald (grunwald@cs.uiuc.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <builtin.h>
-#include <Random.h>
-#include <DiscUnif.h>
-
-double DiscreteUniform::operator()()
-{
- long tmp = long(floor(delta * pGenerator -> asDouble()));
- return( double(pLow + tmp) );
-}
-
diff --git a/contrib/libg++/libg++/src/DiscUnif.h b/contrib/libg++/libg++/src/DiscUnif.h
deleted file mode 100644
index 8633db2c804d..000000000000
--- a/contrib/libg++/libg++/src/DiscUnif.h
+++ /dev/null
@@ -1,72 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Dirk Grunwald (grunwald@cs.uiuc.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#ifndef _DiscreteUniform_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _DiscreteUniform_h 1
-
-#include <Random.h>
-
-//
-// The interval [lo..hi)
-//
-
-class DiscreteUniform: public Random {
- long pLow;
- long pHigh;
- double delta;
-public:
- DiscreteUniform(long low, long high, RNG *gen);
-
- long low();
- long low(long x);
- long high();
- long high(long x);
-
- virtual double operator()();
-};
-
-
-inline DiscreteUniform::DiscreteUniform(long low, long high, RNG *gen)
-: Random(gen)
-{
- pLow = (low < high) ? low : high;
- pHigh = (low < high) ? high : low;
- delta = (pHigh - pLow) + 1;
-}
-
-inline long DiscreteUniform::low() { return pLow; }
-
-inline long DiscreteUniform::low(long x) {
- long tmp = pLow;
- pLow = x;
- delta = (pHigh - pLow) + 1;
- return tmp;
-}
-
-inline long DiscreteUniform::high() { return pHigh; }
-
-inline long DiscreteUniform::high(long x) {
- long tmp = pHigh;
- pHigh = x;
- delta = (pHigh - pLow) + 1;
- return tmp;
-}
-
-#endif
diff --git a/contrib/libg++/libg++/src/Erlang.cc b/contrib/libg++/libg++/src/Erlang.cc
deleted file mode 100644
index 5a73021f10f3..000000000000
--- a/contrib/libg++/libg++/src/Erlang.cc
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Dirk Grunwald (grunwald@cs.uiuc.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <builtin.h>
-#include <Random.h>
-#include <Erlang.h>
-
-double Erlang::operator()()
-{
- double prod = 1.0;
-
- for (int i = 0; i < k; i++) {
- prod *= pGenerator -> asDouble();
- }
- return(-log(prod)/a);
-}
diff --git a/contrib/libg++/libg++/src/Erlang.h b/contrib/libg++/libg++/src/Erlang.h
deleted file mode 100644
index 3f2b3ede71fb..000000000000
--- a/contrib/libg++/libg++/src/Erlang.h
+++ /dev/null
@@ -1,68 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Dirk Grunwald (grunwald@cs.uiuc.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#ifndef _Erlang_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _Erlang_h 1
-
-#include <Random.h>
-
-class Erlang: public Random {
-protected:
- double pMean;
- double pVariance;
- int k;
- double a;
- void setState();
-public:
- Erlang(double mean, double variance, RNG *gen);
-
- double mean();
- double mean(double x);
- double variance();
- double variance(double x);
-
- virtual double operator()();
-
-};
-
-
-inline void Erlang::setState() {
- k = int( (pMean * pMean ) / pVariance + 0.5 );
- k = (k > 0) ? k : 1;
- a = k / pMean;
-}
-
-inline Erlang::Erlang(double mean, double variance, RNG *gen) : Random(gen)
-{
- pMean = mean; pVariance = variance;
- setState();
-}
-
-inline double Erlang::mean() { return pMean; }
-inline double Erlang::mean(double x) {
- double tmp = pMean; pMean = x; setState(); return tmp;
-};
-
-inline double Erlang::variance() { return pVariance; }
-inline double Erlang::variance(double x) {
- double tmp = pVariance; pVariance = x; setState(); return tmp;
-}
-
-#endif
diff --git a/contrib/libg++/libg++/src/Fix.cc b/contrib/libg++/libg++/src/Fix.cc
deleted file mode 100644
index 9f68f826c6cf..000000000000
--- a/contrib/libg++/libg++/src/Fix.cc
+++ /dev/null
@@ -1,670 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1989 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-//
-// Fix.cc : variable length fixed point data type class functions
-//
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <Fix.h>
-#include <std.h>
-#include <Obstack.h>
-#include <AllocRing.h>
-#include <strstream.h>
-#include <new.h>
-
-// member constants
-
-const _G_uint16_t Fix::min_length;
-const _G_uint16_t Fix::max_length;
-const double Fix::min_value;
-const double Fix::max_value;
-
-// default parameters
-
-_G_uint16_t Fix::default_length = 16;
-int Fix::default_print_width = 8;
-
-Fix::PEH Fix::overflow_handler = Fix::overflow_saturate;
-
-Fix::Rep Fix::Rep_0 = { 16, 1, 1, { 0 } };
-Fix::Rep Fix::Rep_m1 = { 16, 1, 1, { 0x8000 } };
-Fix::Rep Fix::Rep_quotient_bump = { 16, 1, 1, { 0x4000 } };
-
-// error handling
-
-void
-Fix::default_error_handler(const char* msg)
-{
- cerr << "Fix: " << msg << "\n";
- abort();
-}
-
-void
-Fix::default_range_error_handler(const char* msg)
-{
- cerr << "Fix: range error in " << msg << "\n";
- //abort();
-}
-
-one_arg_error_handler_t
- Fix::error_handler = Fix::default_error_handler,
- Fix::range_error_handler = Fix::default_range_error_handler;
-
-one_arg_error_handler_t
-Fix::set_error_handler(one_arg_error_handler_t f)
-{
- one_arg_error_handler_t old = error_handler;
- error_handler = f;
- return old;
-}
-
-one_arg_error_handler_t
-Fix::set_range_error_handler(one_arg_error_handler_t f)
-{
- one_arg_error_handler_t old = range_error_handler;
- range_error_handler = f;
- return old;
-}
-
-void
-Fix::error(const char* msg)
-{
- error_handler(msg);
-}
-
-void
-Fix::range_error(const char* msg)
-{
- range_error_handler(msg);
-}
-
-// Fix::Rep allocation and initialization functions
-
-static inline Fix::Rep*
-_new_Fix(_G_uint16_t len)
-{
- int siz = (((_G_uint32_t) len + 15) >> 4);
- if (siz <= 0) siz = 1;
- unsigned int allocsiz = (sizeof(Fix::Rep) + (siz - 1) * sizeof(_G_uint16_t));
- Fix::Rep* z = new (operator new (allocsiz)) Fix::Rep;
- memset(z, 0, allocsiz);
- z->len = len;
- z->siz = siz;
- z->ref = 1;
- return z;
-}
-
-Fix::Rep*
-Fix::new_Fix(_G_uint16_t len)
-{
- return _new_Fix(len);
-}
-
-Fix::Rep*
-Fix::new_Fix(_G_uint16_t len, const Rep* x)
-{
- Rep* z = _new_Fix(len);
- return copy(x,z);
-}
-
-Fix::Rep*
-Fix::new_Fix(_G_uint16_t len, double d)
-{
- Rep* z = _new_Fix(len);
-
- if ( d == max_value )
- {
- z->s[0] = 0x7fff;
- for ( int i=1; i < z->siz; i++ )
- z->s[i] = 0xffff;
- }
- else if ( d < min_value || d > max_value )
- range_error("declaration");
- else
- {
- if (d < 0)
- d += 2.0;
- d *= 32768;
- for ( int i=0; i < z->siz; i++ )
- {
- z->s[i] = (_G_uint16_t )d;
- d -= z->s[i];
- d *= 65536;
- }
- if ( d >= 32768 )
- z->s[z->siz-1]++;
- }
- mask(z);
- return z;
-}
-
-// convert to a double
-
-double
-value(const Fix& x)
-{
- double d = 0.0;
- for ( int i=x.rep->siz-1; i >= 0; i-- )
- {
- d += x.rep->s[i];
- d *= 1./65536.;
- }
- d *= 2.;
- return d < 1. ? d : d - 2.;
-}
-
-// extract mantissa to Integer
-
-Integer
-mantissa(const Fix& x)
-{
- Integer a = 1, b=1;
- for ( int i=0; i < x.rep->siz; i++ )
- {
- a <<= 16;
- a += x.rep->s[i];
- b <<= 16;
- }
- return a-b;
-}
-
-// comparison functions
-
-inline static int
-docmp(const _G_uint16_t* x, const _G_uint16_t* y, int siz)
-{
- int diff = (_G_int16_t )*x - (_G_int16_t )*y;
- while ( --siz && !diff )
- diff = (_G_int32_t )(_G_uint32_t )*++x - (_G_int32_t )(_G_uint32_t )*++y;
- return diff;
-}
-
-inline static int
-docmpz(const _G_uint16_t* x, int siz)
-{
- while ( siz-- )
- if ( *x++ ) return 1;
- return 0;
-}
-
-int
-Fix::compare(const Rep* x, const Rep* y)
-{
- if ( x->siz == y->siz )
- return docmp(x->s, y->s, x->siz);
- else
- {
- int r;
- const Rep* longer, *shorter;
- if ( x->siz > y->siz )
- {
- longer = x;
- shorter = y;
- r = 1;
- }
- else
- {
- longer = y;
- shorter = x;
- r = -1;
- }
- int diff = docmp(x->s, y->s, shorter->siz);
- if ( diff )
- return diff;
- else if ( docmpz(&longer->s[shorter->siz], longer->siz-shorter->siz) )
- return r;
- else
- return 0;
- }
-}
-
-// arithmetic functions
-
-Fix::Rep*
-Fix::add(const Rep* x, const Rep* y, Rep* r)
-{
- _G_uint16_t xsign = x->s[0], ysign = y->s[0];
- const Rep* longer, *shorter;
- if ( x->len >= y->len )
- longer = x, shorter = y;
- else
- longer = y, shorter = x;
- if ( r == NULL )
- r = new_Fix(longer->len);
- int i;
- for ( i=r->siz-1; i >= longer->siz; i-- )
- r->s[i] = 0;
- for ( ; i >= shorter->siz; i-- )
- r->s[i] = longer->s[i];
- _G_uint32_t sum = 0, carry = 0;
- for ( ; i >= 0; i-- )
- {
- sum = carry + (_G_uint32_t )x->s[i] + (_G_uint32_t )y->s[i];
- carry = sum >> 16;
- r->s[i] = sum;
- }
- if ( (xsign ^ sum) & (ysign ^ sum) & 0x8000 )
- overflow_handler(r);
- return r;
-}
-
-Fix::Rep*
-Fix::subtract(const Rep* x, const Rep* y, Rep* r)
-{
- _G_uint16_t xsign = x->s[0], ysign = y->s[0];
- const Rep* longer, *shorter;
- if ( x->len >= y->len )
- longer = x, shorter = y;
- else
- longer = y, shorter = x;
- if ( r == NULL )
- r = new_Fix(longer->len);
- int i;
- for ( i=r->siz-1; i >= longer->siz; i-- )
- r->s[i] = 0;
- for ( ; i >= shorter->siz; i-- )
- r->s[i] = (longer == x ? x->s[i] : -y->s[i]);
- _G_int16_t carry = 0;
- _G_uint32_t sum = 0;
- for ( ; i >= 0; i-- )
- {
- sum = (_G_int32_t )carry + (_G_uint32_t )x->s[i] - (_G_uint32_t )y->s[i];
- carry = sum >> 16;
- r->s[i] = sum;
- }
- if ( (xsign ^ sum) & (~ysign ^ sum) & 0x8000 )
- overflow_handler(r);
- return r;
-}
-
-Fix::Rep*
-Fix::multiply(const Rep* x, const Rep* y, Rep* r)
-{
- if ( r == NULL )
- r = new_Fix(x->len + y->len);
- int xsign = x->s[0] & 0x8000,
- ysign = y->s[0] & 0x8000;
- Fix X(x->len), Y(y->len);
- if ( xsign )
- x = negate(x,X.rep);
- if ( ysign )
- y = negate(y,Y.rep);
- int i;
- for ( i=0; i < r->siz; i++ )
- r->s[i] = 0;
- for ( i=x->siz-1; i >= 0; i-- )
- {
- _G_uint32_t carry = 0;
- for ( int j=y->siz-1; j >= 0; j-- )
- {
- int k = i + j + 1;
- _G_uint32_t a = (_G_uint32_t )x->s[i] * (_G_uint32_t )y->s[j];
- _G_uint32_t b = ((a << 1) & 0xffff) + carry;
- if ( k < r->siz )
- {
- b += r->s[k];
- r->s[k] = b;
- }
- if ( k < (int)r->siz + 1 )
- carry = (a >> 15) + (b >> 16);
- }
- r->s[i] = carry;
- }
- if ( xsign != ysign )
- negate(r,r);
- return r;
-}
-
-Fix::Rep*
-Fix::multiply(const Rep* x, int y, Rep* r)
-{
- if ( y != (_G_int16_t )y )
- range_error("multiply by int -- int too large");
- if ( r == NULL )
- r = new_Fix(x->len);
- int i;
- for ( i=r->siz-1; i >= x->siz; i-- )
- r->s[i] = 0;
- _G_int32_t a, carry = 0;
- for ( ; i > 0; i-- )
- {
- a = (_G_int32_t) (_G_uint32_t )x->s[i] * y + carry;
- r->s[i] = a;
- carry = a >> 16; // assumes arithmetic right shift
- }
- a = (_G_int32_t) (_G_int16_t )x->s[0] * y + carry;
- r->s[0] = a;
- a &= 0xffff8000L;
- if ( a != (_G_int32_t)0xffff8000L && a != (_G_int32_t)0L ) {
- r->s[0] = 0x8000 ^ x->s[0] ^ y;
- overflow_handler(r);
- }
- return r;
-}
-
-Fix::Rep*
-Fix::divide(const Rep* x, const Rep* y, Rep* q, Rep* r)
-{
- int xsign = x->s[0] & 0x8000,
- ysign = y->s[0] & 0x8000;
- if ( q == NULL )
- q = new_Fix(x->len);
- copy(&Rep_0,q);
- if ( r == NULL )
- r = new_Fix(x->len + y->len - 1);
- if ( xsign )
- negate(x,r);
- else
- copy(x,r);
- Fix Y(y->len);
- Rep* y2 = ( ysign ? negate(y,Y.rep) : copy(y,Y.rep) );
- if ( !compare(y2) )
- range_error("division -- division by zero");
- else if ( compare(x,y2) >= 0 )
- if ( compare(x,y2) == 0 && (xsign ^ ysign) != 0 )
- {
- copy(&Rep_m1,q);
- copy(&Rep_0,r);
- }
- else
- range_error("division");
- else
- {
- Rep* t;
- Fix S(r->len),
- W(q->len,&Rep_quotient_bump);
- for ( int i=1; i < q->len; i++ )
- {
- shift(y2,-1,y2);
- subtract(r,y2,S.rep);
- int s_status = compare(S.rep);
- if ( s_status == 0 )
- {
- t = r, r = S.rep, S.rep = t;
- break;
- }
- else if ( s_status > 0 )
- {
- t = r, r = S.rep, S.rep = t;
- add(q,W.rep,q);
- }
- shift(W.rep,-1,W.rep);
- }
- if ( xsign ^ ysign )
- negate(q,q);
- }
- return q;
-}
-
-Fix::Rep*
-Fix::shift(const Rep* x, int y, Rep* r)
-{
- if ( r == NULL )
- r = new_Fix(x->len);
- if ( y == 0 )
- {
- copy (x, r);
- return r;
- }
-
- int ay = abs((_G_int32_t) y),
- ayh = ay >> 4,
- ayl = ay & 0x0f;
- int xl, u, ilow, ihigh;
- _G_uint16_t *rs;
- const _G_uint16_t *xsl, *xsr;
-
- if ( y > 0 )
- {
- rs = r->s;
- xsl = x->s + ayh;
- xsr = xsl + 1;
- xl = ayl;
- u = 1;
- ihigh = x->siz - ayh - 1;
- ilow = 0;
- }
- else
- {
- rs = &r->s[r->siz - 1];
- xsr = &x->s[r->siz - 1] - ayh;
- xsl = xsr - 1;
- xl = 16 - ayl;
- u = -1;
- ihigh = r->siz - ayh - 1;
- ilow = ihigh - x->siz;
- }
-
- int xr = 16 - xl;
- _G_uint16_t xrmask = 0xffffL >> xr;
- int i;
- for ( i=0; i < ilow; i++, rs+=u, xsl+=u, xsr+=u )
- *rs = 0;
- for ( ; i < ihigh; i++, rs+=u, xsl+=u, xsr+=u )
- *rs = (*xsl << xl) + ((*xsr >> xr) & xrmask);
- *rs = (y > 0 ? (*xsl << xl) : ((*xsr >> xr) & xrmask));
- rs += u;
- for ( ; ++i < r->siz; rs+=u )
- *rs = 0;
- return r;
-}
-
-Fix::Rep*
-Fix::negate(const Rep* x, Rep* r)
-{
- if ( r == NULL )
- r = new_Fix(x->len);
- _G_uint32_t carry = 1;
- int i;
- for ( i=r->siz-1; i >= x->siz; i-- )
- r->s[i] = 0;
- for ( ; i >= 0; i-- )
- {
- _G_uint32_t a = (_G_uint16_t )~x->s[i] + carry; // bug work-around
- r->s[i] = a;
- carry = a >> 16;
- }
- return r;
-}
-
-// io functions
-
-Fix
-atoF(const char* a, int len)
-{
- return Fix(len,atof(a));
-}
-
-extern AllocRing _libgxx_fmtq;
-
-void
-Fix::printon(ostream& s, int width) const
-{
- double val = value(*this);
- int old_precision = s.precision(width-3);
- _G_int32_t old_flags = s.setf(ios::fixed, ios::fixed|ios::scientific);
- if (val >= 0)
- s << ' ';
- s.width(width-2);
- s << val;
- s.precision(old_precision);
- s.flags(old_flags);
-}
-
-char*
-Ftoa(Fix& x, int width)
-{
- int wrksiz = width + 2;
- char *fmtbase = (char *) _libgxx_fmtq.alloc(wrksiz);
- ostrstream stream(fmtbase, wrksiz);
-
- x.printon(stream, width);
- stream << ends;
- return fmtbase;
-}
-
-extern Obstack _libgxx_io_ob;
-
-Fix
-Fix::operator %= (int y)
-{
- Fix r((int )rep->len + y, *this); return *this = r;
-}
-
-istream&
-operator >> (istream& s, Fix& y)
-{
- int got_one = 0;
- if (!s.ipfx(0))
- {
- s.clear(ios::failbit|s.rdstate()); // Redundant if using GNU iostreams.
- return s;
- }
-
- char sign = 0, point = 0;
- char ch;
- s >> ws;
- if (!s.good())
- {
- s.clear(ios::failbit|s.rdstate());
- return s;
- }
- while (s.get(ch))
- {
- if (ch == '-')
- {
- if (sign == 0)
- {
- sign = 1;
- _libgxx_io_ob.grow(ch);
- }
- else
- break;
- }
- if (ch == '.')
- {
- if (point == 0)
- {
- point = 1;
- _libgxx_io_ob.grow(ch);
- }
- else
- break;
- }
- else if (ch >= '0' && ch <= '9')
- {
- got_one = 1;
- _libgxx_io_ob.grow(ch);
- }
- else
- break;
- }
- char * p = (char*)(_libgxx_io_ob.finish(0));
- if (s.good())
- s.putback(ch);
- if (!got_one)
- s.clear(ios::failbit|s.rdstate());
- else
- y = atoF(p);
- _libgxx_io_ob.free(p);
- return s;
-}
-
-void
-show(const Fix& x)
-{
- cout << "len = " << x.rep->len << "\n";
- cout << "siz = " << x.rep->siz << "\n";
- cout << "ref = " << x.rep->ref << "\n";
- cout << "man = ";
-#ifdef _OLD_STREAMS
- cout << Itoa(mantissa(x),16,4*x.rep->siz);
-#else
- int old_flags = cout.setf(ios::hex, ios::hex|ios::dec|ios::oct);
- cout.width(4*x.rep->siz);
- cout << mantissa(x);
- cout.setf(old_flags, ios::hex|ios::dec|ios::oct);
-#endif
- cout << "\n";
- cout << "val = " << value(x) << "\n";
-}
-
-// parameter setting operations
-
-Fix::PEH Fix::set_overflow_handler(PEH new_handler)
-{
- PEH old_handler = overflow_handler;
- overflow_handler = new_handler;
- return old_handler;
-}
-
-int
-Fix::set_default_length(int newlen)
-{
- _G_uint16_t oldlen = default_length;
- if ( newlen < min_length || newlen > max_length )
- error("illegal length in Fix::set_default_length");
- default_length = newlen;
- return oldlen;
-}
-
-// overflow handlers
-
-void
-Fix::overflow_saturate(Rep* r)
-{
- if ( (_G_int16_t) r->s[0] > 0 )
- {
- r->s[0] = 0x8000;
- for ( int i=1; i < r->siz; i++ )
- r->s[i] = 0;
- }
- else
- {
- r->s[0] = 0x7fff;
- for ( int i = 1; i < (int)r->siz; i++ )
- r->s[i] = 0xffff;
- mask(r);
- }
-}
-
-void
-Fix::overflow_wrap(Rep*)
-{}
-
-void
-Fix::overflow_warning_saturate(Rep* r)
-{
- overflow_warning(r);
- overflow_saturate(r);
-}
-
-void
-Fix::overflow_warning(Rep*)
-{
- cerr << "Fix: overflow warning\n";
-}
-
-void
-Fix::overflow_error(Rep*)
-{
- cerr << "Fix: overflow error\n";
- abort();
-}
diff --git a/contrib/libg++/libg++/src/Fix.h b/contrib/libg++/libg++/src/Fix.h
deleted file mode 100644
index ae9b9046e7b8..000000000000
--- a/contrib/libg++/libg++/src/Fix.h
+++ /dev/null
@@ -1,523 +0,0 @@
-// -*- C++ -*-
-// Fix.h : variable length fixed point data type
-//
-
-#ifndef _Fix_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _Fix_h 1
-
-#include <stream.h>
-#include <std.h>
-#include <stddef.h>
-#include <Integer.h>
-#include <builtin.h>
-
-class Fix
-{
- struct Rep // internal Fix representation
- {
- _G_uint16_t len; // length in bits
- _G_uint16_t siz; // allocated storage
- _G_int16_t ref; // reference count
- _G_uint16_t s[1]; // start of ushort array represention
- };
-
-public:
-
- typedef void (*PEH)(Rep*);
-
-private:
-
- Rep* rep;
-
- Fix(Rep*);
- Fix(int, const Rep*);
-
- void unique();
-
- static const _G_uint16_t min_length = 1;
- static const _G_uint16_t max_length = 65535;
- static const double min_value = -1.0;
- static const double max_value = 1.0;
-
- static _G_uint16_t default_length;
- static int default_print_width;
- static Rep Rep_0;
- static Rep Rep_m1;
- static Rep Rep_quotient_bump;
-
- // internal class functions
- static void mask(Rep*);
- static int compare(const Rep*, const Rep* = &Rep_0);
-
- static Rep* new_Fix(_G_uint16_t);
- static Rep* new_Fix(_G_uint16_t, const Rep*);
- static Rep* new_Fix(_G_uint16_t, double);
-
- static Rep* copy(const Rep*, Rep*);
- static Rep* negate(const Rep*, Rep* = NULL);
- static Rep* add(const Rep*, const Rep*, Rep* = NULL);
- static Rep* subtract(const Rep*, const Rep*, Rep* = NULL);
- static Rep* multiply(const Rep*, const Rep*, Rep* = NULL);
- static Rep* multiply(const Rep*, int, Rep* = NULL);
- static Rep* divide(const Rep*, const Rep*, Rep* = NULL,
- Rep* = NULL);
- static Rep* shift(const Rep*, int, Rep* = NULL);
-
- static one_arg_error_handler_t error_handler;
- static one_arg_error_handler_t range_error_handler;
-
- static PEH overflow_handler;
-
-public:
- Fix();
- Fix(const Fix&);
- Fix(double);
- Fix(int);
- Fix(_G_uint16_t);
- Fix(int, const Fix&);
- Fix(int, double);
-
- ~Fix();
-
- Fix operator = (const Fix&);
- Fix operator = (double);
-
- friend int operator == (const Fix&, const Fix&);
- friend int operator != (const Fix&, const Fix&);
-
- friend int operator < (const Fix&, const Fix&);
- friend int operator <= (const Fix&, const Fix&);
- friend int operator > (const Fix&, const Fix&);
- friend int operator >= (const Fix&, const Fix&);
-
- Fix& operator + ();
- Fix operator - ();
-
- friend Fix operator + (const Fix&, const Fix&);
- friend Fix operator - (const Fix&, const Fix&);
- friend Fix operator * (const Fix&, const Fix&);
- friend Fix operator / (const Fix&, const Fix&);
-
- friend Fix operator * (const Fix&, int);
- friend Fix operator * (int, const Fix&);
- friend Fix operator % (const Fix&, int);
- friend Fix operator << (const Fix&, int);
- friend Fix operator >> (const Fix&, int);
-
-#if defined (__GNUG__) && ! defined (__STRICT_ANSI__)
- friend Fix operator <? (const Fix&, const Fix&); // min
- friend Fix operator >? (const Fix&, const Fix&); // max
-#endif
-
- Fix operator += (const Fix&);
- Fix operator -= (const Fix&);
- Fix operator *= (const Fix&);
- Fix operator /= (const Fix&);
-
- Fix operator *= (int);
- Fix operator %= (int);
- Fix operator <<=(int);
- Fix operator >>=(int);
-
- friend char* Ftoa(const Fix&, int width = default_print_width);
- void printon(ostream&, int width = default_print_width) const;
- friend Fix atoF(const char*, int len = default_length);
-
- friend istream& operator >> (istream&, Fix&);
- friend ostream& operator << (ostream&, const Fix&);
-
- // built-in functions
- friend Fix abs(Fix); // absolute value
- friend int sgn(const Fix&); // -1, 0, +1
- friend Integer mantissa(const Fix&); // integer representation
- friend double value(const Fix&); // double value
- friend int length(const Fix&); // field length
- friend void show(const Fix&); // show contents
-
- // error handlers
- static void error(const char* msg); // error handler
- static void range_error(const char* msg); // range error handler
-
- static one_arg_error_handler_t set_error_handler(one_arg_error_handler_t f);
- static one_arg_error_handler_t
- set_range_error_handler(one_arg_error_handler_t f);
-
- static void default_error_handler (const char *);
- static void default_range_error_handler (const char *);
-
- // non-operator versions for user
- friend void negate(const Fix& x, Fix& r);
- friend void add(const Fix& x, const Fix& y, Fix& r);
- friend void subtract(const Fix& x, const Fix& y, Fix& r);
- friend void multiply(const Fix& x, const Fix& y, Fix& r);
- friend void divide(const Fix& x, const Fix& y, Fix& q, Fix& r);
- friend void shift(const Fix& x, int y, Fix& r);
-
- // overflow handlers
- static void overflow_saturate(Fix::Rep*);
- static void overflow_wrap(Fix::Rep*);
- static void overflow_warning_saturate(Fix::Rep*);
- static void overflow_warning(Fix::Rep*);
- static void overflow_error(Fix::Rep*);
-
- static PEH set_overflow_handler(PEH);
-
- static int set_default_length(int);
-};
-
-// function definitions
-
-inline void
-Fix::unique()
-{
- if ( rep->ref > 1 )
- {
- rep->ref--;
- rep = new_Fix(rep->len,rep);
- }
-}
-
-inline void
-Fix::mask (Fix::Rep* x)
-{
- int n = x->len & 0x0f;
- if ( n )
- x->s[x->siz - 1] &= 0xffff0000 >> n;
-}
-
-inline Fix::Rep*
-Fix::copy(const Fix::Rep* from, Fix::Rep* to)
-{
- _G_uint16_t *ts = to->s;
- const _G_uint16_t *fs = from->s;
- int ilim = to->siz < from->siz ? to->siz : from->siz;
- int i;
- for ( i=0; i < ilim; i++ )
- *ts++ = *fs++;
- for ( ; i < to->siz; i++ )
- *ts++ = 0;
- mask(to);
- return to;
-}
-
-inline
-Fix::Fix(Rep* f)
-{
- rep = f;
-}
-
-inline
-Fix::Fix()
-{
- rep = new_Fix(default_length);
-}
-
-inline
-Fix::Fix(int len)
-{
- if ( len < min_length || len > max_length )
- error("illegal length in declaration");
- rep = new_Fix((_G_uint16_t) len);
-}
-
-inline
-Fix::Fix(_G_uint16_t len)
-{
- if ( len < min_length || len > max_length )
- error("illegal length in declaration");
- rep = new_Fix(len);
-}
-
-inline
-Fix::Fix(double d)
-{
- rep = new_Fix(default_length,d);
-}
-
-inline
-Fix::Fix(const Fix& y)
-{
- rep = y.rep; rep->ref++;
-}
-
-inline
-Fix::Fix(int len, const Fix& y)
-{
- if ( len < Fix::min_length || len > Fix::max_length )
- error("illegal length in declaration");
- rep = new_Fix((_G_uint16_t) len,y.rep);
-}
-
-inline
-Fix::Fix(int len, const Rep* fr)
-{
- if ( len < Fix::min_length || len > Fix::max_length )
- error("illegal length in declaration");
- rep = new_Fix((_G_uint16_t) len,fr);
-}
-
-inline
-Fix::Fix(int len, double d)
-{
- if ( len < Fix::min_length || len > Fix::max_length )
- error("illegal length in declaration");
- rep = new_Fix((_G_uint16_t) len,d);
-}
-
-inline
-Fix::~Fix()
-{
- if ( --rep->ref <= 0 ) delete rep;
-}
-
-inline Fix
-Fix::operator = (const Fix& y)
-{
- if ( rep->len == y.rep->len ) {
- ++y.rep->ref;
- if ( --rep->ref <= 0 ) delete rep;
- rep = y.rep;
- }
- else {
- unique();
- copy(y.rep,rep);
- }
- return *this;
-}
-
-inline Fix
-Fix::operator = (double d)
-{
- int oldlen = rep->len;
- if ( --rep->ref <= 0 ) delete rep;
- rep = new_Fix(oldlen,d);
- return *this;
-}
-
-inline int
-operator == (const Fix& x, const Fix& y)
-{
- return Fix::compare(x.rep, y.rep) == 0;
-}
-
-inline int
-operator != (const Fix& x, const Fix& y)
-{
- return Fix::compare(x.rep, y.rep) != 0;
-}
-
-inline int
-operator < (const Fix& x, const Fix& y)
-{
- return Fix::compare(x.rep, y.rep) < 0;
-}
-
-inline int
-operator <= (const Fix& x, const Fix& y)
-{
- return Fix::compare(x.rep, y.rep) <= 0;
-}
-
-inline int
-operator > (const Fix& x, const Fix& y)
-{
- return Fix::compare(x.rep, y.rep) > 0;
-}
-
-inline int
-operator >= (const Fix& x, const Fix& y)
-{
- return Fix::compare(x.rep, y.rep) >= 0;
-}
-
-inline Fix&
-Fix::operator + ()
-{
- return *this;
-}
-
-inline Fix
-Fix::operator - ()
-{
- Rep* r = negate(rep); return r;
-}
-
-inline Fix
-operator + (const Fix& x, const Fix& y)
-{
- Fix::Rep* r = Fix::add(x.rep, y.rep); return r;
-}
-
-inline Fix
-operator - (const Fix& x, const Fix& y)
-{
- Fix::Rep* r = Fix::subtract(x.rep, y.rep); return r;
-}
-
-inline Fix
-operator * (const Fix& x, const Fix& y)
-{
- Fix::Rep* r = Fix::multiply(x.rep, y.rep); return r;
-}
-
-inline Fix
-operator * (const Fix& x, int y)
-{
- Fix::Rep* r = Fix::multiply(x.rep, y); return r;
-}
-
-inline Fix
-operator * (int y, const Fix& x)
-{
- Fix::Rep* r = Fix::multiply(x.rep, y); return r;
-}
-
-inline Fix
-operator / (const Fix& x, const Fix& y)
-{
- Fix::Rep* r = Fix::divide(x.rep, y.rep); return r;
-}
-
-inline Fix
-Fix::operator += (const Fix& y)
-{
- unique(); Fix::add(rep, y.rep, rep); return *this;
-}
-
-inline Fix
-Fix::operator -= (const Fix& y)
-{
- unique(); Fix::subtract(rep, y.rep, rep); return *this;
-}
-
-inline Fix
-Fix::operator *= (const Fix& y)
-{
- unique(); Fix::multiply(rep, y.rep, rep); return *this;
-}
-
-inline Fix
-Fix::operator *= (int y)
-{
- unique(); Fix::multiply(rep, y, rep); return *this;
-}
-
-inline Fix
-Fix::operator /= (const Fix& y)
-{
- unique(); Fix::divide(rep, y.rep, rep); return *this;
-}
-
-inline Fix
-operator % (const Fix& x, int y)
-{
- Fix r((int) x.rep->len + y, x); return r;
-}
-
-inline Fix
-operator << (const Fix& x, int y)
-{
- Fix::Rep* rep = Fix::shift(x.rep, y); return rep;
-}
-
-inline Fix
-operator >> (const Fix& x, int y)
-{
- Fix::Rep* rep = Fix::shift(x.rep, -y); return rep;
-}
-
-inline Fix
-Fix::operator <<= (int y)
-{
- unique(); Fix::shift(rep, y, rep); return *this;
-}
-
-inline Fix
-Fix::operator >>= (int y)
-{
- unique(); Fix::shift(rep, -y, rep); return *this;
-}
-
-#if defined (__GNUG__) && ! defined (__STRICT_ANSI__)
-inline Fix
-operator <? (const Fix& x, const Fix& y)
-{
- if ( Fix::compare(x.rep, y.rep) <= 0 ) return x; else return y;
-}
-
-inline Fix
-operator >? (const Fix& x, const Fix& y)
-{
- if ( Fix::compare(x.rep, y.rep) >= 0 ) return x; else return y;
-}
-#endif
-
-inline Fix
-abs(Fix x)
-{
- Fix::Rep* r = (Fix::compare(x.rep) >= 0 ? Fix::new_Fix(x.rep->len,x.rep) :
- Fix::negate(x.rep));
- return r;
-}
-
-inline int
-sgn(const Fix& x)
-{
- int a = Fix::compare(x.rep);
- return a == 0 ? 0 : (a > 0 ? 1 : -1);
-}
-
-inline int
-length(const Fix& x)
-{
- return x.rep->len;
-}
-
-inline ostream&
-operator << (ostream& s, const Fix& y)
-{
- if (s.opfx())
- y.printon(s);
- return s;
-}
-
-inline void
-negate (const Fix& x, Fix& r)
-{
- Fix::negate(x.rep, r.rep);
-}
-
-inline void
-add (const Fix& x, const Fix& y, Fix& r)
-{
- Fix::add(x.rep, y.rep, r.rep);
-}
-
-inline void
-subtract (const Fix& x, const Fix& y, Fix& r)
-{
- Fix::subtract(x.rep, y.rep, r.rep);
-}
-
-inline void
-multiply (const Fix& x, const Fix& y, Fix& r)
-{
- Fix::multiply(x.rep, y.rep, r.rep);
-}
-
-inline void
-divide (const Fix& x, const Fix& y, Fix& q, Fix& r)
-{
- Fix::divide(x.rep, y.rep, q.rep, r.rep);
-}
-
-inline void
-shift (const Fix& x, int y, Fix& r)
-{
- Fix::shift(x.rep, y, r.rep);
-}
-
-#endif
diff --git a/contrib/libg++/libg++/src/Fix16.cc b/contrib/libg++/libg++/src/Fix16.cc
deleted file mode 100644
index dddab2495d3b..000000000000
--- a/contrib/libg++/libg++/src/Fix16.cc
+++ /dev/null
@@ -1,238 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Kurt Baudendistel (gt-eedsp!baud@gatech.edu)
- adapted for libg++ by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-//
-// Fix.cc : fixed precision class support functions
-//
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <Fix16.h>
-
-// basic operators too large to be inline
-
-short Fix16::assign(double d)
-{
- if (d == 1.0)
- return Fix16_m_max;
- else if (d > Fix16_max)
- {
- short i = Fix16_m_max;
- range_error(i);
- return i;
- }
- else if (d < Fix16_min)
- {
- short i = Fix16_m_min;
- range_error(i);
- return i;
- }
- else
- return round(Fix16_mult * d);
-}
-
-_G_int32_t Fix32::assign(double d)
-{
- if (d == 1.0)
- return Fix32_m_max;
- else if (d > Fix32_max)
- {
- _G_int32_t i = Fix32_m_max;
- range_error(i);
- return i;
- }
- else if (d < Fix32_min)
- {
- _G_int32_t i = Fix32_m_min;
- range_error(i);
- return i;
- }
- else
- return round(Fix32_mult * d);
-}
-
-
-Fix32 operator * (const Fix32& a, const Fix32& b)
-{
-// break a and b into lo and hi parts, and do a multiple-precision
-// multiply, with rounding
-
- int apos = (a.m >= 0);
- _G_uint32_t ua = (apos)? a.m : - a.m;
- ua <<= 1; // ua is biased so result will be 31 bit mantissa, not 30:
- _G_uint32_t hi_a = (ua >> 16) & ((1 << 16) - 1);
- _G_uint32_t lo_a = ua & ((1 << 16) - 1);
-
- int bpos = (b.m >= 0);
- _G_uint32_t ub = (bpos)? b.m : -b.m;
- _G_uint32_t hi_b = (ub >> 16) & ((1 << 16) - 1);
- _G_uint32_t lo_b = ub & ((1 << 16) - 1);
-
- _G_uint32_t r = lo_a * lo_b + (1 << 15);
- r = (r >> 16) + hi_a * lo_b + lo_a * hi_b + (1 << 15);
- r = (r >> 16) + hi_a * hi_b;
- _G_int32_t p = (apos != bpos)? -r : r;
- return Fix32(p);
-}
-
-Fix16 operator / (const Fix16& a, const Fix16& b)
-{
- short q;
- int apos = (a.m >= 0);
- _G_int32_t la = (apos)? a.m : -a.m;
- _G_int32_t scaled_a = la << 15;
- int bpos = (b.m >= 0);
- short sb = (bpos)? b.m: -b.m;
- if (la >= sb)
- {
- q = (apos == bpos)? Fix16_m_max: Fix16_m_min;
- a.range_error(q);
- }
- else
- {
- q = scaled_a / sb;
- if ((scaled_a % sb) >= (sb / 2)) ++q;
- if (apos != bpos) q = -q;
- }
- return Fix16(q);
-}
-
-Fix32 operator / (const Fix32& a, const Fix32& b)
-{
- _G_int32_t q;
- int apos = (a.m >= 0);
- _G_uint32_t la = (apos)? a.m : -a.m;
- int bpos = (b.m >= 0);
- _G_uint32_t lb = (bpos)? b.m: -b.m;
- if (la >= lb)
- {
- q = (apos == bpos)? Fix32_m_max: Fix32_m_min;
- a.range_error(q);
- }
- else // standard shift-based division alg
- {
- q = 0;
- _G_int32_t r = la;
-
- for (int i = 32; i > 0; i--)
- {
- if ((unsigned)(r) > lb) {
- q = (q << 1) | 1;
- r -= lb;
- }
- else
- q = (q << 1);
- r <<= 1;
- }
-
- if (apos != bpos) q = -q; // Fix sign
- }
- return Fix32(q);
-}
-
-
-// error handling
-
-void Fix16::overflow(short& i) const
-{
- (*Fix16_overflow_handler)(i);
-}
-
-void Fix32::overflow(_G_int32_t& i) const
-{
- (*Fix32_overflow_handler)(i);
-}
-
-void Fix16::range_error(short& i) const
-{
- (*Fix16_range_error_handler)(i);
-}
-
-void Fix32::range_error(_G_int32_t& i) const
-{
- (*Fix32_range_error_handler)(i);
-}
-
-// data definitions
-
-Fix16_peh Fix16_overflow_handler = Fix16_overflow_saturate;
-Fix32_peh Fix32_overflow_handler = Fix32_overflow_saturate;
-
-Fix16_peh Fix16_range_error_handler = Fix16_warning;
-Fix32_peh Fix32_range_error_handler = Fix32_warning;
-
-//function definitions
-
-Fix16_peh set_Fix16_overflow_handler(Fix16_peh new_handler) {
- Fix16_peh old_handler = Fix16_overflow_handler;
- Fix16_overflow_handler = new_handler;
- return old_handler;
-}
-
-Fix32_peh set_Fix32_overflow_handler(Fix32_peh new_handler) {
- Fix32_peh old_handler = Fix32_overflow_handler;
- Fix32_overflow_handler = new_handler;
- return old_handler;
-}
-
-void set_overflow_handler(Fix16_peh handler16, Fix32_peh handler32) {
- set_Fix16_overflow_handler(handler16);
- set_Fix32_overflow_handler(handler32);
-}
-
-Fix16_peh set_Fix16_range_error_handler(Fix16_peh new_handler) {
- Fix16_peh old_handler = Fix16_range_error_handler;
- Fix16_range_error_handler = new_handler;
- return old_handler;
-}
-
-Fix32_peh set_Fix32_range_error_handler(Fix32_peh new_handler) {
- Fix32_peh old_handler = Fix32_range_error_handler;
- Fix32_range_error_handler = new_handler;
- return old_handler;
-}
-
-void set_range_error_handler(Fix16_peh handler16, Fix32_peh handler32) {
- set_Fix16_range_error_handler(handler16);
- set_Fix32_range_error_handler(handler32);
-}
-
-void Fix16_overflow_saturate(short& i)
- { i = (i > 0 ? Fix16_m_min : Fix16_m_max); }
-void Fix16_ignore(short&) {}
-void Fix16_warning(short&)
- { cerr << "warning: Fix16 result out of range\n"; }
-void Fix16_overflow_warning_saturate(short& i)
- { cerr << "warning: Fix16 result out of range\n";
- Fix16_overflow_saturate(i); }
-void Fix16_abort(short&)
- { cerr << "error: Fix16 result out of range\n"; abort(); }
-
-void Fix32_ignore(_G_int32_t&) {}
-void Fix32_overflow_saturate(_G_int32_t& i)
- { i = (i > 0 ? Fix32_m_min : Fix32_m_max); }
-void Fix32_warning(_G_int32_t&)
- { cerr << "warning: Fix32 result out of range\n"; }
-void Fix32_overflow_warning_saturate(_G_int32_t& i)
- { cerr << "warning: Fix32 result out of range\n";
- Fix32_overflow_saturate(i); }
-void Fix32_abort(_G_int32_t&)
- { cerr << "error: Fix32 result out of range\n"; abort(); }
-
diff --git a/contrib/libg++/libg++/src/Fix16.h b/contrib/libg++/libg++/src/Fix16.h
deleted file mode 100644
index 7f1336b308c8..000000000000
--- a/contrib/libg++/libg++/src/Fix16.h
+++ /dev/null
@@ -1,648 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Kurt Baudendistel (gt-eedsp!baud@gatech.edu)
- adapted for libg++ by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifndef _Fix16_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _Fix16_h 1
-
-#include <stream.h>
-#include <std.h>
-
-// constant definitions
-
-#define Fix16_fs ((double)((unsigned)(1 << 15)))
-
-#define Fix16_msb (1 << 15)
-#define Fix16_m_max ((1 << 15) - 1)
-#define Fix16_m_min ((short)(1 << 15))
-
-#define Fix16_mult Fix16_fs
-#define Fix16_div (1./Fix16_fs)
-#define Fix16_max (1. - .5/Fix16_fs)
-#define Fix16_min (-1.)
-
-
-#define Fix32_fs ((double)((_G_uint32_t)(1 << 31)))
-
-#define Fix32_msb ((_G_uint32_t)(1 << 31))
-#define Fix32_m_max ((_G_int32_t)((1 << 31) - 1))
-#define Fix32_m_min ((_G_int32_t)(1 << 31))
-
-#define Fix32_mult Fix32_fs
-#define Fix32_div (1./Fix32_fs)
-#define Fix32_max (1. - .5/Fix32_fs)
-#define Fix32_min (-1.)
-
-
-//
-// Fix16 class: 16-bit Fixed point data type
-//
-// consists of a 16-bit mantissa (sign bit & 15 data bits).
-//
-
-class Fix16
-{
- friend class Fix32;
-
- short m;
-
- short round(double d);
- short assign(double d);
- Fix16(short i);
- Fix16(int i);
-
- operator double() const;
-
-
-public:
- Fix16();
- Fix16(const Fix16& f);
- Fix16(double d);
- Fix16(const Fix32& f);
-
- ~Fix16();
-
- Fix16& operator=(const Fix16& f);
- Fix16& operator=(double d);
- Fix16& operator=(const Fix32& f);
-
- friend short& mantissa(Fix16& f);
- friend const short& mantissa(const Fix16& f);
- friend double value(const Fix16& f);
-
- Fix16 operator + () const;
- Fix16 operator - () const;
-
- friend Fix16 operator + (const Fix16& f, const Fix16& g);
- friend Fix16 operator - (const Fix16& f, const Fix16& g);
- friend Fix32 operator * (const Fix16& f, const Fix16& g);
- friend Fix16 operator / (const Fix16& f, const Fix16& g);
- friend Fix16 operator << (const Fix16& f, int b);
- friend Fix16 operator >> (const Fix16& f, int b);
-
- Fix16& operator += (const Fix16& f);
- Fix16& operator -= (const Fix16& f);
- Fix16& operator *= (const Fix16& );
- Fix16& operator /= (const Fix16& f);
-
- Fix16& operator <<=(int b);
- Fix16& operator >>=(int b);
-
- friend int operator == (const Fix16& f, const Fix16& g);
- friend int operator != (const Fix16& f, const Fix16& g);
- friend int operator >= (const Fix16& f, const Fix16& g);
- friend int operator <= (const Fix16& f, const Fix16& g);
- friend int operator > (const Fix16& f, const Fix16& g);
- friend int operator < (const Fix16& f, const Fix16& g);
-
- friend istream& operator >> (istream& s, Fix16& f);
- friend ostream& operator << (ostream& s, const Fix16& f);
-
- void overflow(short&) const;
- void range_error(short&) const;
-
- friend Fix16 operator * (const Fix16& f, int g);
- friend Fix16 operator * (int g, const Fix16& f);
- Fix16& operator *= (int g);
-};
-
-
-//
-// Fix32 class: 32-bit Fixed point data type
-//
-// consists of a 32-bit mantissa (sign bit & 31 data bits).
-//
-
-class Fix32
-{
- friend class Fix16;
-
- _G_int32_t m;
-
- _G_int32_t round(double d);
- _G_int32_t assign(double d);
-
- Fix32(_G_int32_t i);
- operator double() const;
-
-
-public:
- Fix32();
- Fix32(const Fix32& f);
- Fix32(const Fix16& f);
- Fix32(double d);
- ~Fix32();
-
- Fix32& operator = (const Fix32& f);
- Fix32& operator = (const Fix16& f);
- Fix32& operator = (double d);
-
- friend _G_int32_t& mantissa(Fix32& f);
- friend const _G_int32_t& mantissa(const Fix32& f);
- friend double value(const Fix32& f);
-
- Fix32 operator + () const;
- Fix32 operator - () const;
-
- friend Fix32 operator + (const Fix32& f, const Fix32& g);
- friend Fix32 operator - (const Fix32& f, const Fix32& g);
- friend Fix32 operator * (const Fix32& f, const Fix32& g);
- friend Fix32 operator / (const Fix32& f, const Fix32& g);
- friend Fix32 operator << (const Fix32& f, int b);
- friend Fix32 operator >> (const Fix32& f, int b);
-
- friend Fix32 operator * (const Fix16& f, const Fix16& g);
-
- Fix32& operator += (const Fix32& f);
- Fix32& operator -= (const Fix32& f);
- Fix32& operator *= (const Fix32& f);
- Fix32& operator /= (const Fix32& f);
- Fix32& operator <<=(int b);
- Fix32& operator >>=(int b);
-
- friend int operator == (const Fix32& f, const Fix32& g);
- friend int operator != (const Fix32& f, const Fix32& g);
- friend int operator >= (const Fix32& f, const Fix32& g);
- friend int operator <= (const Fix32& f, const Fix32& g);
- friend int operator > (const Fix32& f, const Fix32& g);
- friend int operator < (const Fix32& f, const Fix32& g);
-
- friend istream& operator >> (istream& s, Fix32& f);
- friend ostream& operator << (ostream& s, const Fix32& f);
-
- void overflow(_G_int32_t& i) const;
- void range_error(_G_int32_t& i) const;
-
- friend Fix32 operator * (const Fix32& f, int g);
- friend Fix32 operator * (int g, const Fix32& f);
- Fix32& operator *= (int g);
-};
-
-// active error handler declarations
-
-typedef void (*Fix16_peh)(short&);
-typedef void (*Fix32_peh)(_G_int32_t&);
-
-extern Fix16_peh Fix16_overflow_handler;
-extern Fix32_peh Fix32_overflow_handler;
-
-extern Fix16_peh Fix16_range_error_handler;
-extern Fix32_peh Fix32_range_error_handler;
-
-#if defined(SHORT_NAMES) || defined(VMS)
-#define set_overflow_handler sohndl
-#define set_range_error_handler srnghdl
-#endif
-
-
-// error handler declarations
-
-extern Fix16_peh set_Fix16_overflow_handler(Fix16_peh);
-extern Fix32_peh set_Fix32_overflow_handler(Fix32_peh);
-extern void set_overflow_handler(Fix16_peh, Fix32_peh);
-
-extern Fix16_peh set_Fix16_range_error_handler(Fix16_peh);
-extern Fix32_peh set_Fix32_range_error_handler(Fix32_peh);
-extern void set_range_error_handler(Fix16_peh, Fix32_peh);
-
-extern void
- Fix16_ignore(short&),
- Fix16_overflow_saturate(short&),
- Fix16_overflow_warning_saturate(short&),
- Fix16_warning(short&),
- Fix16_abort(short&);
-
-extern void
- Fix32_ignore(_G_int32_t&),
- Fix32_overflow_saturate(_G_int32_t&),
- Fix32_overflow_warning_saturate(_G_int32_t&),
- Fix32_warning(_G_int32_t&),
- Fix32_abort(_G_int32_t&);
-
-
-inline Fix16::~Fix16() {}
-
-inline Fix32::~Fix32() {}
-
-inline short Fix16::round(double d)
-{
- return short( (d >= 0)? d + 0.5 : d - 0.5);
-}
-
-inline Fix16::Fix16(short i)
-{
- m = i;
-}
-
-inline Fix16::Fix16(int i)
-{
- m = i;
-}
-
-inline Fix16::operator double() const
-{
- return Fix16_div * m;
-}
-
-inline Fix16::Fix16()
-{
- m = 0;
-}
-
-inline Fix16::Fix16(const Fix16& f)
-{
- m = f.m;
-}
-
-inline Fix16::Fix16(double d)
-{
- m = assign(d);
-}
-
-
-inline Fix16& Fix16::operator=(const Fix16& f)
-{
- m = f.m;
- return *this;
-}
-
-inline Fix16& Fix16::operator=(double d)
-{
- m = assign(d);
- return *this;
-}
-
-
-inline Fix32::Fix32()
-{
- m = 0;
-}
-
-inline Fix32::Fix32(_G_int32_t i)
-{
- m = i;
-}
-
-inline Fix32:: operator double() const
-{
- return Fix32_div * m;
-}
-
-
-inline Fix32::Fix32(const Fix32& f)
-{
- m = f.m;
-}
-
-inline Fix32::Fix32(const Fix16& f)
-{
- m = _G_int32_t(f.m) << 16;
-}
-
-inline Fix32::Fix32(double d)
-{
- m = assign(d);
-}
-
-inline Fix16::Fix16(const Fix32& f)
-{
- m = f.m >> 16;
-}
-
-
-inline Fix16& Fix16::operator=(const Fix32& f)
-{
- m = f.m >> 16;
- return *this;
-}
-
-inline Fix32& Fix32::operator=(const Fix32& f)
-{
- m = f.m;
- return *this;
-}
-
-inline Fix32& Fix32::operator=(const Fix16& f)
-{
- m = _G_int32_t(f.m) << 16;
- return *this;
-}
-
-inline Fix32& Fix32::operator=(double d)
-{
- m = assign(d);
- return *this;
-}
-
-inline short& mantissa(Fix16& f)
-{
- return f.m;
-}
-
-inline const short& mantissa(const Fix16& f)
-{
- return f.m;
-}
-
-inline double value(const Fix16& f)
-{
- return double(f);
-}
-
-inline Fix16 Fix16::operator+() const
-{
- return m;
-}
-
-inline Fix16 Fix16::operator-() const
-{
- return -m;
-}
-
-inline Fix16 operator+(const Fix16& f, const Fix16& g)
-{
- short sum = f.m + g.m;
- if ( (f.m ^ sum) & (g.m ^ sum) & Fix16_msb )
- f.overflow(sum);
- return sum;
-}
-
-inline Fix16 operator-(const Fix16& f, const Fix16& g)
-{
- short sum = f.m - g.m;
- if ( (f.m ^ sum) & (-g.m ^ sum) & Fix16_msb )
- f.overflow(sum);
- return sum;
-}
-
-inline Fix32 operator*(const Fix16& f, const Fix16& g)
-{
- return Fix32( _G_int32_t( _G_int32_t(f.m) * _G_int32_t(g.m) << 1));
-}
-
-inline Fix16 operator<<(const Fix16& a, int b)
-{
- return a.m << b;
-}
-
-inline Fix16 operator>>(const Fix16& a, int b)
-{
- return a.m >> b;
-}
-
-inline Fix16& Fix16:: operator+=(const Fix16& f)
-{
- return *this = *this + f;
-}
-
-inline Fix16& Fix16:: operator-=(const Fix16& f)
-{
- return *this = *this - f;
-}
-
-inline Fix16& Fix16::operator*=(const Fix16& f)
-{
- return *this = *this * f;
-}
-
-inline Fix16& Fix16:: operator/=(const Fix16& f)
-{
- return *this = *this / f;
-}
-
-inline Fix16& Fix16:: operator<<=(int b)
-{
- return *this = *this << b;
-}
-
-inline Fix16& Fix16:: operator>>=(int b)
-{
- return *this = *this >> b;
-}
-
-inline int operator==(const Fix16& f, const Fix16& g)
-{
- return f.m == g.m;
-}
-
-inline int operator!=(const Fix16& f, const Fix16& g)
-{
- return f.m != g.m;
-}
-
-inline int operator>=(const Fix16& f, const Fix16& g)
-{
- return f.m >= g.m;
-}
-
-inline int operator<=(const Fix16& f, const Fix16& g)
-{
- return f.m <= g.m;
-}
-
-inline int operator>(const Fix16& f, const Fix16& g)
-{
- return f.m > g.m;
-}
-
-inline int operator<(const Fix16& f, const Fix16& g)
-{
- return f.m < g.m;
-}
-
-inline istream& operator>>(istream& s, Fix16& f)
-{
- double d;
- s >> d;
- f = d;
- return s;
-}
-
-inline ostream& operator<<(ostream& s, const Fix16& f)
-{
- return s << double(f);
-}
-
-
-inline Fix16 operator*(const Fix16& f, int g)
-{
- return Fix16(short(f.m * g));
-}
-
-inline Fix16 operator*(int g, const Fix16& f)
-{
- return f * g;
-}
-
-
-inline Fix16& Fix16::operator*=(int g)
-{
- return *this = *this * g;
-}
-
-inline _G_int32_t Fix32::round(double d)
-{
- return _G_int32_t( (d >= 0)? d + 0.5 : d - 0.5);
-}
-
-inline _G_int32_t& mantissa(Fix32& f)
-{
- return f.m;
-}
-
-inline const _G_int32_t& mantissa(const Fix32& f)
-{
- return f.m;
-}
-
-inline double value(const Fix32& f)
-{
- return double(f);
-}
-
-inline Fix32 Fix32::operator+() const
-{
- return m;
-}
-
-inline Fix32 Fix32::operator-() const
-{
- return -m;
-}
-
-inline Fix32 operator+(const Fix32& f, const Fix32& g)
-{
- _G_int32_t sum = f.m + g.m;
- if ( (f.m ^ sum) & (g.m ^ sum) & Fix32_msb )
- f.overflow(sum);
- return sum;
-}
-
-inline Fix32 operator-(const Fix32& f, const Fix32& g)
-{
- _G_int32_t sum = f.m - g.m;
- if ( (f.m ^ sum) & (-g.m ^ sum) & Fix32_msb )
- f.overflow(sum);
- return sum;
-}
-
-inline Fix32 operator<<(const Fix32& a, int b)
-{
- return a.m << b;
-}
-
-inline Fix32 operator>>(const Fix32& a, int b)
-{
- return a.m >> b;
-}
-
-inline Fix32& Fix32::operator+=(const Fix32& f)
-{
- return *this = *this + f;
-}
-
-inline Fix32& Fix32::operator-=(const Fix32& f)
-{
- return *this = *this - f;
-}
-
-inline Fix32& Fix32::operator*=(const Fix32& f)
-{
- return *this = *this * f;
-}
-
-inline Fix32& Fix32::operator/=(const Fix32& f)
-{
- return *this = *this / f;
-}
-
-
-inline Fix32& Fix32::operator<<=(int b)
-{
- return *this = *this << b;
-}
-
-inline Fix32& Fix32::operator>>=(int b)
-{
- return *this = *this >> b;
-}
-
-inline int operator==(const Fix32& f, const Fix32& g)
-{
- return f.m == g.m;
-}
-
-inline int operator!=(const Fix32& f, const Fix32& g)
-{
- return f.m != g.m;
-}
-
-inline int operator>=(const Fix32& f, const Fix32& g)
-{
- return f.m >= g.m;
-}
-
-inline int operator<=(const Fix32& f, const Fix32& g)
-{
- return f.m <= g.m;
-}
-
-inline int operator>(const Fix32& f, const Fix32& g)
-{
- return f.m > g.m;
-}
-
-inline int operator<(const Fix32& f, const Fix32& g)
-{
- return f.m < g.m;
-}
-
-inline istream& operator>>(istream& s, Fix32& f)
-{
- double d;
- s >> d;
- f = d;
- return s;
-}
-
-inline ostream& operator<<(ostream& s, const Fix32& f)
-{
- return s << double(f);
-}
-
-inline Fix32 operator*(const Fix32& f, int g)
-{
- return Fix32(_G_int32_t(f.m * g));
-}
-
-inline Fix32 operator*(int g, const Fix32& f)
-{
- return f * g;
-}
-
-
-
-inline Fix32& Fix32::operator*=(int g)
-{
- return *this = *this * g;
-}
-
-#endif
diff --git a/contrib/libg++/libg++/src/Fix24.cc b/contrib/libg++/libg++/src/Fix24.cc
deleted file mode 100644
index 41878bb7c5e8..000000000000
--- a/contrib/libg++/libg++/src/Fix24.cc
+++ /dev/null
@@ -1,329 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Kurt Baudendistel (gt-eedsp!baud@gatech.edu)
- adapted for libg++ by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-//
-// Fix24.cc : fixed precision class support functions
-//
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <Fix24.h>
-
-// basic operators too large to be inline
-
-_G_int32_t Fix24::assign(double d)
-{
- if (d == 1.0)
- return Fix24_m_max;
- else if (d > Fix24_max)
- {
- _G_int32_t i = Fix24_m_max;
- range_error(i);
- return i;
- }
- else if (d < Fix24_min)
- {
- _G_int32_t i = Fix24_m_min;
- range_error(i);
- return i;
- }
- else {
- // Round to 24 bits
- d = (_G_int32_t) (d * (1 << 24) + ((d >= 0)? 0.5 : -0.5));
- /* Convert to integer format */
- return ((_G_int32_t) d) << (Fix24_shift - 24);
- }
-}
-
-twolongs Fix48::assign(double d)
-{
- if (d == 1.0)
- return Fix48_m_max;
- else if (d > Fix48_max)
- {
- twolongs i = Fix48_m_max;
- range_error(i);
- return i;
- }
- else if (d < Fix48_min)
- {
- twolongs i = Fix48_m_min;
- range_error(i);
- return i;
- }
- else {
- twolongs i;
- int sign = (d < 0);
-
-/* First, convert the absolute value of d to a 48-bit integer format */
- if (d < 0) d = -d;
- i.u = ((_G_int32_t)(d *= Fix24_mult)) & 0xffffff00;
- i.l = ((_G_uint32_t)((d - i.u)* (Fix24_mult / (1 << 7)))) & 0xffffff00;
-
-/* Calculate the two's complement if d was negative */
- if (sign) {
- _G_uint32_t oldlower = i.l;
- i.l = (~i.l + 1) & 0xffffff00;
- i.u = (~i.u + (((oldlower ^ i.l) & Fix24_msb)? 0 : 1)) & ~0xffL;
- }
- return i;
- }
-}
-
-
-Fix48 operator * (const Fix24& a, const Fix24& b)
-{
-// break a and b into lo and hi parts, and do a multiple-precision
-// multiply, with rounding
-
- int apos = (a.m >= 0);
- _G_uint32_t ua = (apos)? a.m : - a.m;
- ua <<= 1; // ua is biased so result will be 47 bit mantissa, not 46:
- _G_uint32_t hi_a = (ua >> 16) & ((1 << 16) - 1);
- _G_uint32_t lo_a = ua & ((1 << 16) - 1);
-
- int bpos = (b.m >= 0);
- _G_uint32_t ub = (bpos)? b.m : -b.m;
- _G_uint32_t hi_b = (ub >> 16) & ((1 << 16) - 1);
- _G_uint32_t lo_b = ub & ((1 << 16) - 1);
-
- _G_uint32_t
- hi_r = hi_a * hi_b,
- mi_r = hi_a * lo_b + lo_a * hi_b,
- lo_r = lo_a * lo_b,
- rl = ((hi_r << 16) & 0x00ffffffL) + (mi_r & 0x00ffffffL) + (lo_r >> 16);
- twolongs r;
- r.u = (hi_r & 0xffffff00L) + ((mi_r >> 16) & 0x0000ff00L)
- + ((rl >> 16) & 0x0000ff00L);
- r.l = rl << 8;
-
- if ( apos != bpos ) {
- _G_uint32_t l = r.l;
- r.l = -r.l;
- r.u = (~r.u + ((l ^ r.l) & Fix24_msb ? 0 : Fix24_lsb)) & 0xffffff00;
- }
- return r;
-}
-
-Fix24 operator / (const Fix24& a, const Fix24& b)
-{
- _G_int32_t q;
- int apos = (a.m >= 0);
- _G_uint32_t la = (apos)? a.m : -a.m;
- int bpos = (b.m >= 0);
- _G_uint32_t lb = (bpos)? b.m: -b.m;
- if (la >= lb)
- {
- q = (apos == bpos)? Fix24_m_max: Fix24_m_min;
- a.range_error(q);
- }
- else // standard shift-based division alg
- {
- q = 0;
- _G_int32_t r = la;
-
- for (int i = 32; i > 0; i--)
- {
- if ((unsigned)(r) > lb) {
- q = (q << 1) | 1;
- r -= lb;
- }
- else
- q = (q << 1);
- r <<= 1;
- }
-
- q += 0x80; // Round result to 24 bits
- if (apos != bpos) q = -q; // Fix sign
- }
- return (q & ~0xff);
-}
-
-
-Fix48 operator + (const Fix48& f, const Fix48& g)
-{
- _G_int32_t lo_r = (f.m.l >> 8) + (g.m.l >> 8);
- twolongs r;
- r.u = f.m.u + g.m.u + (lo_r & 0x01000000L ? 0x00000100L : 0);
- r.l = lo_r << 8;
-
- if ( (f.m.u ^ r.u) & (g.m.u ^ r.u) & Fix24_msb )
- f.overflow(r);
- return r;
-}
-
-Fix48 operator - (const Fix48& f, const Fix48& g)
-{
- unsigned lo_r = (f.m.l >> 8) - (g.m.l >> 8);
- twolongs r;
- r.u = f.m.u - g.m.u - (lo_r & 0x01000000L ? 0x00000100L: 0);
- r.l = lo_r << 8;
-
- if ( ((f.m.u ^ r.u) & (-g.m.u ^ r.u) & Fix24_msb) && g.m.u )
- f.overflow(r);
- return r;
-}
-
-Fix48 operator * (const Fix48& a, int b)
-{
- twolongs r;
- int bpos = (b >= 0);
- unsigned ub = (bpos)? b : -b;
- if ( ub >= 65536L ) {
- r = (bpos)? Fix48_m_max : Fix48_m_min;
- a.range_error(r);
- }
- else {
- _G_uint32_t
- lo_r = (a.m.l & 0xffff) * ub,
- mi_r = ((a.m.l >> 16) & 0xffff) * ub,
- hi_r = a.m.u * ub;
- r.l = lo_r + (mi_r << 16);
- r.u = hi_r + ((mi_r >> 8) & 0x00ffff00L);
- if ( !bpos ) {
- _G_uint32_t l = r.l;
- r.l = -r.l & 0xffffffff;
- r.u = ~r.u + ((l ^ r.l) & Fix24_msb ? 0 : Fix24_lsb);
- }
- }
- return r;
-}
-
-Fix48 operator << (const Fix48& a, int b)
-{
- twolongs r; r.u = 0; r.l = 0;
- if ( b >= 0 )
- if ( b < 24 ) {
- r.u = (a.m.u << b) + ((a.m.l >> (24 - b)) & 0xffffff00L);
- r.l = a.m.l << b;
- }
- else if ( b < 48 ) {
- r.u = a.m.l << (b - 24);
- }
- return r;
-}
-
-Fix48 operator >> (const Fix48& a, int b)
-{
- twolongs r; r.u = 0; r.l = 0;
- if ( b >= 0 )
- if ( b < 24 ) {
- r.l = ((a.m.u << (24 - b)) & 0xffffffffL) + ((a.m.l >> b) & 0xffffff00L);
- r.u = (a.m.u >> b) & ~0xffL;
- }
- else if ( b < 48 ) {
- r.l = (a.m.u >> (b - 24)) & 0xffffff00L;
- r.u = (a.m.u >> 24) & ~0xffL;
- }
- else {
- r.l = (a.m.u >> 24) & ~0xffL;
- r.u = r.l;
- }
- return r;
-}
-
-// error handling
-
-void Fix24::overflow(_G_int32_t& i) const
-{
- (*Fix24_overflow_handler)(i);
-}
-
-void Fix48::overflow(twolongs& i) const
-{
- (*Fix48_overflow_handler)(i);
-}
-
-void Fix24::range_error(_G_int32_t& i) const
-{
- (*Fix24_range_error_handler)(i);
-}
-
-void Fix48::range_error(twolongs& i) const
-{
- (*Fix48_range_error_handler)(i);
-}
-
-// data definitions
-
-Fix24_peh Fix24_overflow_handler = Fix24_overflow_saturate;
-Fix48_peh Fix48_overflow_handler = Fix48_overflow_saturate;
-
-Fix24_peh Fix24_range_error_handler = Fix24_warning;
-Fix48_peh Fix48_range_error_handler = Fix48_warning;
-
-//function definitions
-
-Fix24_peh set_Fix24_overflow_handler(Fix24_peh new_handler) {
- Fix24_peh old_handler = Fix24_overflow_handler;
- Fix24_overflow_handler = new_handler;
- return old_handler;
-}
-
-Fix48_peh set_Fix48_overflow_handler(Fix48_peh new_handler) {
- Fix48_peh old_handler = Fix48_overflow_handler;
- Fix48_overflow_handler = new_handler;
- return old_handler;
-}
-
-void set_overflow_handler(Fix24_peh handler24, Fix48_peh handler48) {
- set_Fix24_overflow_handler(handler24);
- set_Fix48_overflow_handler(handler48);
-}
-
-Fix24_peh set_Fix24_range_error_handler(Fix24_peh new_handler) {
- Fix24_peh old_handler = Fix24_range_error_handler;
- Fix24_range_error_handler = new_handler;
- return old_handler;
-}
-
-Fix48_peh set_Fix48_range_error_handler(Fix48_peh new_handler) {
- Fix48_peh old_handler = Fix48_range_error_handler;
- Fix48_range_error_handler = new_handler;
- return old_handler;
-}
-
-void set_range_error_handler(Fix24_peh handler24, Fix48_peh handler48) {
- set_Fix24_range_error_handler(handler24);
- set_Fix48_range_error_handler(handler48);
-}
-
-void Fix24_overflow_saturate(_G_int32_t& i)
- { i = (i > 0 ? Fix24_m_min : Fix24_m_max); }
-void Fix24_ignore(_G_int32_t&) {}
-void Fix24_warning(_G_int32_t&)
- { cerr << "warning: Fix24 result out of range\n"; }
-void Fix24_overflow_warning_saturate(_G_int32_t& i)
- { cerr << "warning: Fix24 result out of range\n";
- Fix24_overflow_saturate(i); }
-void Fix24_abort(_G_int32_t&)
- { cerr << "error: Fix24 result out of range\n"; abort(); }
-
-void Fix48_ignore(twolongs&) {}
-void Fix48_overflow_saturate(twolongs& i)
- { i = (i.u > 0 ? Fix48_m_min : Fix48_m_max); }
-void Fix48_warning(twolongs&)
- { cerr << "warning: Fix48 result out of range\n"; }
-void Fix48_overflow_warning_saturate(twolongs& i)
- { cerr << "warning: Fix48 result out of range\n";
- Fix48_overflow_saturate(i); }
-void Fix48_abort(twolongs&)
- { cerr << "error: Fix48 result out of range\n"; abort(); }
-
diff --git a/contrib/libg++/libg++/src/Fix24.h b/contrib/libg++/libg++/src/Fix24.h
deleted file mode 100644
index 215ded96af0f..000000000000
--- a/contrib/libg++/libg++/src/Fix24.h
+++ /dev/null
@@ -1,597 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Kurt Baudendistel (gt-eedsp!baud@gatech.edu)
- adapted for libg++ by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifndef _Fix24_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _Fix24_h 1
-
-#include <stream.h>
-#include <std.h>
-
-// extra type definitions
-
-typedef struct {
- _G_int32_t u;
- _G_uint32_t l;
-} twolongs;
-
-// constant definitions
-
-static const int
- Fix24_shift = 31;
-
-static const double
- Fix24_fs = 2147483648., // 2^Fix24_shift
- Fix24_mult = Fix24_fs,
- Fix24_div = 1./Fix24_fs,
- Fix24_max = 1. - .5/Fix24_fs,
- Fix24_min = -1.;
-
-static const _G_uint32_t
- Fix24_msb = 0x80000000L,
- Fix24_lsb = 0x00000100L,
- Fix24_m_max = 0x7fffff00L,
- Fix24_m_min = 0x80000000L;
-
-static const double
- Fix48_fs = 36028797018963968., // 2^(24+Fix24_shift)
- Fix48_max = 1. - .5/Fix48_fs,
- Fix48_min = -1.,
- Fix48_div_u = 1./Fix24_fs,
- Fix48_div_l = 1./Fix48_fs;
-
-static const twolongs
- Fix48_msb = { 0x80000000L, 0L },
- Fix48_lsb = { 0L, 0x00000100L },
- Fix48_m_max = { 0x7fffff00L, 0xffffff00L },
- Fix48_m_min = { 0x80000000L, 0L };
-
-//
-// Fix24 class: 24-bit Fixed point data type
-//
-// consists of a 24-bit mantissa (sign bit & 23 data bits).
-//
-
-class Fix24
-{
- friend class Fix48;
-
- _G_int32_t m;
-
- _G_int32_t assign(double d);
- operator double() const;
- Fix24(long i);
- Fix24(int i);
-
-
-public:
- Fix24();
- Fix24(const Fix24& f);
- Fix24(double d);
- Fix24(const Fix48& f);
-
- ~Fix24();
-
- Fix24& operator=(const Fix24& f);
- Fix24& operator=(double d);
- Fix24& operator=(const Fix48& f);
-
- friend _G_int32_t& mantissa(Fix24& f);
- friend const _G_int32_t& mantissa(const Fix24& f);
- friend double value(const Fix24& f);
-
- Fix24 operator + () const;
- Fix24 operator - () const;
-
- friend Fix24 operator + (const Fix24& f, const Fix24& g);
- friend Fix24 operator - (const Fix24& f, const Fix24& g);
- friend Fix48 operator * (const Fix24& f, const Fix24& g);
- friend Fix24 operator * (const Fix24& f, int g);
- friend Fix24 operator * (int g, const Fix24& f);
- friend Fix24 operator / (const Fix24& f, const Fix24& g);
- friend Fix24 operator << (const Fix24& f, int b);
- friend Fix24 operator >> (const Fix24& f, int b);
-
- Fix24& operator += (const Fix24& f);
- Fix24& operator -= (const Fix24& f);
- Fix24& operator *= (const Fix24& f);
- Fix24& operator *= (int b);
- Fix24& operator /= (const Fix24& f);
-
- Fix24& operator <<=(int b);
- Fix24& operator >>=(int b);
-
- friend int operator == (const Fix24& f, const Fix24& g);
- friend int operator != (const Fix24& f, const Fix24& g);
- friend int operator >= (const Fix24& f, const Fix24& g);
- friend int operator <= (const Fix24& f, const Fix24& g);
- friend int operator > (const Fix24& f, const Fix24& g);
- friend int operator < (const Fix24& f, const Fix24& g);
-
- friend istream& operator >> (istream& s, Fix24& f);
- friend ostream& operator << (ostream& s, const Fix24& f);
-
- void overflow(_G_int32_t&) const;
- void range_error(_G_int32_t&) const;
-};
-
-
-//
-// Fix48 class: 48-bit Fixed point data type
-//
-// consists of a 48-bit mantissa (sign bit & 47 data bits).
-//
-
-class Fix48
-{
- friend class Fix24;
-
- twolongs m;
-
- twolongs assign(double d);
- operator double() const;
- Fix48(twolongs i);
-
-public:
- Fix48();
- Fix48(const Fix48& f);
- Fix48(const Fix24& f);
- Fix48(double d);
- ~Fix48();
-
- Fix48& operator = (const Fix48& f);
- Fix48& operator = (const Fix24& f);
- Fix48& operator = (double d);
-
- friend twolongs& mantissa(Fix48& f);
- friend const twolongs& mantissa(const Fix48& f);
- friend double value(const Fix48& f);
-
- Fix48 operator + () const;
- Fix48 operator - () const;
-
- friend Fix48 operator + (const Fix48& f, const Fix48& g);
- friend Fix48 operator - (const Fix48& f, const Fix48& g);
- friend Fix48 operator * (const Fix48& f, int g);
- friend Fix48 operator * (int g, const Fix48& f);
- friend Fix48 operator << (const Fix48& f, int b);
- friend Fix48 operator >> (const Fix48& f, int b);
-
- friend Fix48 operator * (const Fix24& f, const Fix24& g);
-
- Fix48& operator += (const Fix48& f);
- Fix48& operator -= (const Fix48& f);
- Fix48& operator *= (int b);
- Fix48& operator <<=(int b);
- Fix48& operator >>=(int b);
-
- friend int operator == (const Fix48& f, const Fix48& g);
- friend int operator != (const Fix48& f, const Fix48& g);
- friend int operator >= (const Fix48& f, const Fix48& g);
- friend int operator <= (const Fix48& f, const Fix48& g);
- friend int operator > (const Fix48& f, const Fix48& g);
- friend int operator < (const Fix48& f, const Fix48& g);
-
- friend istream& operator >> (istream& s, Fix48& f);
- friend ostream& operator << (ostream& s, const Fix48& f);
-
- void overflow(twolongs& i) const;
- void range_error(twolongs& i) const;
-};
-
-
-// active error handler declarations
-
-typedef void (*Fix24_peh)(_G_int32_t&);
-typedef void (*Fix48_peh)(twolongs&);
-
-extern Fix24_peh Fix24_overflow_handler;
-extern Fix48_peh Fix48_overflow_handler;
-
-extern Fix24_peh Fix24_range_error_handler;
-extern Fix48_peh Fix48_range_error_handler;
-
-
-// error handler declarations
-
-#if defined(SHORT_NAMES) || defined(VMS)
-#define set_overflow_handler sohndl
-#define set_range_error_handler srnghdl
-#endif
-
-extern Fix24_peh set_Fix24_overflow_handler(Fix24_peh);
-extern Fix48_peh set_Fix48_overflow_handler(Fix48_peh);
-extern void set_overflow_handler(Fix24_peh, Fix48_peh);
-
-extern Fix24_peh set_Fix24_range_error_handler(Fix24_peh);
-extern Fix48_peh set_Fix48_range_error_handler(Fix48_peh);
-extern void set_range_error_handler(Fix24_peh, Fix48_peh);
-
-extern void
- Fix24_ignore(_G_int32_t&),
- Fix24_overflow_saturate(_G_int32_t&),
- Fix24_overflow_warning_saturate(_G_int32_t&),
- Fix24_warning(_G_int32_t&),
- Fix24_abort(_G_int32_t&);
-
-extern void
- Fix48_ignore(twolongs&),
- Fix48_overflow_saturate(twolongs&),
- Fix48_overflow_warning_saturate(twolongs&),
- Fix48_warning(twolongs&),
- Fix48_abort(twolongs&);
-
-
-inline Fix24::~Fix24() {}
-
-inline Fix48::~Fix48() {}
-
-inline Fix24::Fix24(long i)
-{
- m = i;
-}
-
-inline Fix24::Fix24(int i)
-{
- m = i;
-}
-
-inline Fix24::operator double() const
-{
- return Fix24_div * m;
-}
-
-inline Fix24::Fix24()
-{
- m = 0;
-}
-
-inline Fix24::Fix24(const Fix24& f)
-{
- m = f.m;
-}
-
-inline Fix24::Fix24(double d)
-{
- m = assign(d);
-}
-
-inline Fix24::Fix24(const Fix48& f)
-{
- m = f.m.u;
-}
-
-inline Fix24& Fix24::operator=(const Fix24& f)
-{
- m = f.m;
- return *this;
-}
-
-inline Fix24& Fix24::operator=(double d)
-{
- m = assign(d);
- return *this;
-}
-
-inline Fix24& Fix24::operator=(const Fix48& f)
-{
- m = f.m.u;
- return *this;
-}
-
-inline _G_int32_t& mantissa(Fix24& f)
-{
- return f.m;
-}
-
-inline const _G_int32_t& mantissa(const Fix24& f)
-{
- return f.m;
-}
-
-inline double value(const Fix24& f)
-{
- return double(f);
-}
-
-inline Fix24 Fix24::operator+() const
-{
- return m;
-}
-
-inline Fix24 Fix24::operator-() const
-{
- return -m;
-}
-
-inline Fix24 operator+(const Fix24& f, const Fix24& g)
-{
- _G_int32_t sum = f.m + g.m;
- if ( (f.m ^ sum) & (g.m ^ sum) & Fix24_msb )
- f.overflow(sum);
- return sum;
-}
-
-inline Fix24 operator-(const Fix24& f, const Fix24& g)
-{
- _G_int32_t sum = f.m - g.m;
- if ( (f.m ^ sum) & (-g.m ^ sum) & Fix24_msb )
- f.overflow(sum);
- return sum;
-}
-
-inline Fix24 operator*(const Fix24& a, int b)
-{
- return a.m * b;
-}
-
-inline Fix24 operator*(int b, const Fix24& a)
-{
- return a * b;
-}
-
-inline Fix24 operator<<(const Fix24& a, int b)
-{
- return a.m << b;
-}
-
-inline Fix24 operator>>(const Fix24& a, int b)
-{
- return (a.m >> b) & ~0xff;
-}
-
-inline Fix24& Fix24:: operator+=(const Fix24& f)
-{
- return *this = *this + f;
-}
-
-inline Fix24& Fix24:: operator-=(const Fix24& f)
-{
- return *this = *this - f;
-}
-
-inline Fix24& Fix24::operator*=(const Fix24& f)
-{
- return *this = *this * f;
-}
-
-inline Fix24& Fix24:: operator/=(const Fix24& f)
-{
- return *this = *this / f;
-}
-
-inline Fix24& Fix24:: operator<<=(int b)
-{
- return *this = *this << b;
-}
-
-inline Fix24& Fix24:: operator>>=(int b)
-{
- return *this = *this >> b;
-}
-
-inline Fix24& Fix24::operator*=(int b)
-{
- return *this = *this * b;
-}
-
-inline int operator==(const Fix24& f, const Fix24& g)
-{
- return f.m == g.m;
-}
-
-inline int operator!=(const Fix24& f, const Fix24& g)
-{
- return f.m != g.m;
-}
-
-inline int operator>=(const Fix24& f, const Fix24& g)
-{
- return f.m >= g.m;
-}
-
-inline int operator<=(const Fix24& f, const Fix24& g)
-{
- return f.m <= g.m;
-}
-
-inline int operator>(const Fix24& f, const Fix24& g)
-{
- return f.m > g.m;
-}
-
-inline int operator<(const Fix24& f, const Fix24& g)
-{
- return f.m < g.m;
-}
-
-inline istream& operator>>(istream& s, Fix24& f)
-{
- double d;
- s >> d;
- f = d;
- return s;
-}
-
-inline ostream& operator<<(ostream& s, const Fix24& f)
-{
- return s << double(f);
-}
-
-inline Fix48::Fix48(twolongs i)
-{
- m = i;
-}
-
-inline Fix48:: operator double() const
-{
-/*
- * Note: can't simply do Fix48_div_u * m.u + Fix48_div_l * m.l, because
- * m.u is signed and m.l is unsigned.
- */
- return (m.u >= 0)? Fix48_div_u * m.u + Fix48_div_l * m.l :
- (Fix48_div_u * ((_G_uint32_t)(m.u & 0xffffff00))
- + Fix48_div_l * m.l) - 2;
-}
-
-inline Fix48::Fix48()
-{
- m.u = 0;
- m.l = 0;
-}
-
-inline Fix48::Fix48(const Fix48& f)
-{
- m = f.m;
-}
-
-inline Fix48::Fix48(const Fix24& f)
-{
- m.u = f.m;
- m.l = 0;
-}
-
-inline Fix48::Fix48(double d)
-{
- m = assign(d);
-}
-
-inline Fix48& Fix48::operator=(const Fix48& f)
-{
- m = f.m;
- return *this;
-}
-
-inline Fix48& Fix48::operator=(const Fix24& f)
-{
- m.u = f.m;
- m.l = 0;
- return *this;
-}
-
-inline Fix48& Fix48::operator=(double d)
-{
- m = assign(d);
- return *this;
-}
-
-inline twolongs& mantissa(Fix48& f)
-{
- return f.m;
-}
-
-inline const twolongs& mantissa(const Fix48& f)
-{
- return f.m;
-}
-
-inline double value(const Fix48& f)
-{
- return double(f);
-}
-
-inline Fix48 Fix48::operator+() const
-{
- return m;
-}
-
-inline Fix48 Fix48::operator-() const
-{
- twolongs n;
- n.l = -m.l;
- n.u = ~m.u + ((n.l ^ m.l) & Fix24_msb ? 0 : Fix24_lsb);
- return Fix48(n);
-}
-
-inline Fix48 operator*(int b, const Fix48& a)
-{
- return a * b;
-}
-
-inline Fix48& Fix48::operator+=(const Fix48& f)
-{
- return *this = *this + f;
-}
-
-inline Fix48& Fix48::operator-=(const Fix48& f)
-{
- return *this = *this - f;
-}
-
-inline Fix48& Fix48::operator*=(int b)
-{
- return *this = *this * b;
-}
-
-inline Fix48& Fix48::operator<<=(int b)
-{
- return *this = *this << b;
-}
-
-inline Fix48& Fix48::operator>>=(int b)
-{
- return *this = *this >> b;
-}
-
-inline int operator==(const Fix48& f, const Fix48& g)
-{
- return f.m.u == g.m.u && f.m.l == g.m.l;
-}
-
-inline int operator!=(const Fix48& f, const Fix48& g)
-{
- return f.m.u != g.m.u || f.m.l != g.m.l;
-}
-
-inline int operator>=(const Fix48& f, const Fix48& g)
-{
- return f.m.u >= g.m.u || (f.m.u == g.m.u && f.m.l >= g.m.l);
-}
-
-inline int operator<=(const Fix48& f, const Fix48& g)
-{
- return f.m.u <= g.m.u || (f.m.u == g.m.u && f.m.l <= g.m.l);
-}
-
-inline int operator>(const Fix48& f, const Fix48& g)
-{
- return f.m.u > g.m.u || (f.m.u == g.m.u && f.m.l > g.m.l);
-}
-
-inline int operator<(const Fix48& f, const Fix48& g)
-{
- return f.m.u < g.m.u || (f.m.u == g.m.u && f.m.l < g.m.l);
-}
-
-inline istream& operator>>(istream& s, Fix48& f)
-{
- double d;
- s >> d;
- f = d;
- return s;
-}
-
-inline ostream& operator<<(ostream& s, const Fix48& f)
-{
- return s << double(f);
-}
-
-#endif
diff --git a/contrib/libg++/libg++/src/Geom.cc b/contrib/libg++/libg++/src/Geom.cc
deleted file mode 100644
index 3e6372e5978c..000000000000
--- a/contrib/libg++/libg++/src/Geom.cc
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Dirk Grunwald (grunwald@cs.uiuc.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <builtin.h>
-#include <Random.h>
-#include <Geom.h>
-
-double Geometric::operator()()
-{
- int samples;
- for (samples = 1; pGenerator -> asDouble() < pMean; samples++);
- return((double) samples);
-}
-
diff --git a/contrib/libg++/libg++/src/Geom.h b/contrib/libg++/libg++/src/Geom.h
deleted file mode 100644
index 064849ab8e65..000000000000
--- a/contrib/libg++/libg++/src/Geom.h
+++ /dev/null
@@ -1,52 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Dirk Grunwald (grunwald@cs.uiuc.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#ifndef _Geometric_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _Geometric_h
-
-#include <Random.h>
-
-class Geometric: public Random {
-protected:
- double pMean;
-public:
- Geometric(double mean, RNG *gen);
-
- double mean();
- double mean(double x);
-
- virtual double operator()();
-
-};
-
-
-inline Geometric::Geometric(double mean, RNG *gen) : Random(gen)
-{
- pMean = mean;
-}
-
-
-inline double Geometric::mean() { return pMean; }
-inline double Geometric::mean(double x) {
- double tmp = pMean; pMean = x; return tmp;
-}
-
-
-#endif
diff --git a/contrib/libg++/libg++/src/GetOpt.cc b/contrib/libg++/libg++/src/GetOpt.cc
deleted file mode 100644
index 8dc54a1fe607..000000000000
--- a/contrib/libg++/libg++/src/GetOpt.cc
+++ /dev/null
@@ -1,253 +0,0 @@
-/*
-Getopt for GNU.
-Copyright (C) 1987, 1989 Free Software Foundation, Inc.
-
-(Modified by Douglas C. Schmidt for use with GNU G++.)
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-/* AIX requires the alloca decl to be the first thing in the file. */
-#ifdef __GNUC__
-#define alloca __builtin_alloca
-#elif defined(sparc)
-#include <alloca.h>
-extern "C" void *__builtin_alloca(...);
-#elif defined(_AIX)
-#pragma alloca
-#else
-char *alloca ();
-#endif
-#include <GetOpt.h>
-
-char* GetOpt::nextchar = 0;
-int GetOpt::first_nonopt = 0;
-int GetOpt::last_nonopt = 0;
-
-GetOpt::GetOpt (int argc, char **argv, const char *optstring)
- :opterr (1), nargc (argc), nargv (argv), noptstring (optstring)
-{
- /* Initialize the internal data when the first call is made.
- Start processing options with ARGV-element 1 (since ARGV-element 0
- is the program name); the sequence of previously skipped
- non-option ARGV-elements is empty. */
-
- first_nonopt = last_nonopt = optind = 1;
- optarg = nextchar = 0;
-
- /* Determine how to handle the ordering of options and nonoptions. */
-
- if (optstring[0] == '-')
- ordering = RETURN_IN_ORDER;
- else if (getenv ("_POSIX_OPTION_ORDER") != 0)
- ordering = REQUIRE_ORDER;
- else
- ordering = PERMUTE;
-}
-
-void
-GetOpt::exchange (char **argv)
-{
- int nonopts_size
- = (last_nonopt - first_nonopt) * sizeof (char *);
- char **temp = (char **) alloca (nonopts_size);
-
- /* Interchange the two blocks of data in argv. */
-
- memcpy (temp, &argv[first_nonopt], nonopts_size);
- memcpy (&argv[first_nonopt], &argv[last_nonopt],
- (optind - last_nonopt) * sizeof (char *));
- memcpy (&argv[first_nonopt + optind - last_nonopt], temp,
- nonopts_size);
-
- /* Update records for the slots the non-options now occupy. */
-
- first_nonopt += (optind - last_nonopt);
- last_nonopt = optind;
-}
-
-/* Scan elements of ARGV (whose length is ARGC) for option characters
- given in OPTSTRING.
-
- If an element of ARGV starts with '-', and is not exactly "-" or "--",
- then it is an option element. The characters of this element
- (aside from the initial '-') are option characters. If `getopt'
- is called repeatedly, it returns successively each of theoption characters
- from each of the option elements.
-
- If `getopt' finds another option character, it returns that character,
- updating `optind' and `nextchar' so that the next call to `getopt' can
- resume the scan with the following option character or ARGV-element.
-
- If there are no more option characters, `getopt' returns `EOF'.
- Then `optind' is the index in ARGV of the first ARGV-element
- that is not an option. (The ARGV-elements have been permuted
- so that those that are not options now come last.)
-
- OPTSTRING is a string containing the legitimate option characters.
- A colon in OPTSTRING means that the previous character is an option
- that wants an argument. The argument is taken from the rest of the
- current ARGV-element, or from the following ARGV-element,
- and returned in `optarg'.
-
- If an option character is seen that is not listed in OPTSTRING,
- return '?' after printing an error message. If you set `opterr' to
- zero, the error message is suppressed but we still return '?'.
-
- If a char in OPTSTRING is followed by a colon, that means it wants an arg,
- so the following text in the same ARGV-element, or the text of the following
- ARGV-element, is returned in `optarg. Two colons mean an option that
- wants an optional arg; if there is text in the current ARGV-element,
- it is returned in `optarg'.
-
- If OPTSTRING starts with `-', it requests a different method of handling the
- non-option ARGV-elements. See the comments about RETURN_IN_ORDER, above. */
-
-int
-GetOpt::operator () (void)
-{
- if (nextchar == 0 || *nextchar == 0)
- {
- if (ordering == PERMUTE)
- {
- /* If we have just processed some options following some non-options,
- exchange them so that the options come first. */
-
- if (first_nonopt != last_nonopt && last_nonopt != optind)
- exchange (nargv);
- else if (last_nonopt != optind)
- first_nonopt = optind;
-
- /* Now skip any additional non-options
- and extend the range of non-options previously skipped. */
-
- while (optind < nargc
- && (nargv[optind][0] != '-'
- || nargv[optind][1] == 0))
- optind++;
- last_nonopt = optind;
- }
-
- /* Special ARGV-element `--' means premature end of options.
- Skip it like a null option,
- then exchange with previous non-options as if it were an option,
- then skip everything else like a non-option. */
-
- if (optind != nargc && !strcmp (nargv[optind], "--"))
- {
- optind++;
-
- if (first_nonopt != last_nonopt && last_nonopt != optind)
- exchange (nargv);
- else if (first_nonopt == last_nonopt)
- first_nonopt = optind;
- last_nonopt = nargc;
-
- optind = nargc;
- }
-
- /* If we have done all the ARGV-elements, stop the scan
- and back over any non-options that we skipped and permuted. */
-
- if (optind == nargc)
- {
- /* Set the next-arg-index to point at the non-options
- that we previously skipped, so the caller will digest them. */
- if (first_nonopt != last_nonopt)
- optind = first_nonopt;
- return EOF;
- }
-
- /* If we have come to a non-option and did not permute it,
- either stop the scan or describe it to the caller and pass it by. */
-
- if (nargv[optind][0] != '-' || nargv[optind][1] == 0)
- {
- if (ordering == REQUIRE_ORDER)
- return EOF;
- optarg = nargv[optind++];
- return 0;
- }
-
- /* We have found another option-ARGV-element.
- Start decoding its characters. */
-
- nextchar = nargv[optind] + 1;
- }
-
- /* Look at and handle the next option-character. */
-
- {
- char c = *nextchar++;
- char *temp = (char *) strchr (noptstring, c);
-
- /* Increment `optind' when we start to process its last character. */
- if (*nextchar == 0)
- optind++;
-
- if (temp == 0 || c == ':')
- {
- if (opterr != 0)
- {
- if (c < 040 || c >= 0177)
- fprintf (stderr, "%s: unrecognized option, character code 0%o\n",
- nargv[0], c);
- else
- fprintf (stderr, "%s: unrecognized option `-%c'\n",
- nargv[0], c);
- }
- return '?';
- }
- if (temp[1] == ':')
- {
- if (temp[2] == ':')
- {
- /* This is an option that accepts an argument optionally. */
- if (*nextchar != 0)
- {
- optarg = nextchar;
- optind++;
- }
- else
- optarg = 0;
- nextchar = 0;
- }
- else
- {
- /* This is an option that requires an argument. */
- if (*nextchar != 0)
- {
- optarg = nextchar;
- /* If we end this ARGV-element by taking the rest as an arg,
- we must advance to the next element now. */
- optind++;
- }
- else if (optind == nargc)
- {
- if (opterr != 0)
- fprintf (stderr, "%s: no argument for `-%c' option\n",
- nargv[0], c);
- c = '?';
- }
- else
- /* We already incremented `optind' once;
- increment it again when taking next ARGV-elt as argument. */
- optarg = nargv[optind++];
- nextchar = 0;
- }
- }
- return c;
- }
-}
diff --git a/contrib/libg++/libg++/src/GetOpt.h b/contrib/libg++/libg++/src/GetOpt.h
deleted file mode 100644
index c554cac83215..000000000000
--- a/contrib/libg++/libg++/src/GetOpt.h
+++ /dev/null
@@ -1,129 +0,0 @@
-/* Getopt for GNU.
- Copyright (C) 1987, 1989, 1992 Free Software Foundation, Inc.
- (Modified by Douglas C. Schmidt for use with GNU G++.)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-
-/* This version of `getopt' appears to the caller like standard Unix `getopt'
- but it behaves differently for the user, since it allows the user
- to intersperse the options with the other arguments.
-
- As `getopt' works, it permutes the elements of `argv' so that,
- when it is done, all the options precede everything else. Thus
- all application programs are extended to handle flexible argument order.
-
- Setting the environment variable _POSIX_OPTION_ORDER disables permutation.
- Then the behavior is completely standard.
-
- GNU application programs can use a third alternative mode in which
- they can distinguish the relative order of options and other arguments. */
-
-#ifndef GetOpt_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define GetOpt_h 1
-
-#include <std.h>
-#include <stdio.h>
-
-class GetOpt
-{
-private:
- /* The next char to be scanned in the option-element
- in which the last option character we returned was found.
- This allows us to pick up the scan where we left off.
-
- If this is zero, or a null string, it means resume the scan
- by advancing to the next ARGV-element. */
-
- static char *nextchar;
-
-
- /* Describe how to deal with options that follow non-option ARGV-elements.
-
- UNSPECIFIED means the caller did not specify anything;
- the default is then REQUIRE_ORDER if the environment variable
- _OPTIONS_FIRST is defined, PERMUTE otherwise.
-
- REQUIRE_ORDER means don't recognize them as options.
- Stop option processing when the first non-option is seen.
- This is what Unix does.
-
- PERMUTE is the default. We permute the contents of `argv' as we scan,
- so that eventually all the options are at the end. This allows options
- to be given in any order, even with programs that were not written to
- expect this.
-
- RETURN_IN_ORDER is an option available to programs that were written
- to expect options and other ARGV-elements in any order and that care about
- the ordering of the two. We describe each non-option ARGV-element
- as if it were the argument of an option with character code zero.
- Using `-' as the first character of the list of option characters
- requests this mode of operation.
-
- The special argument `--' forces an end of option-scanning regardless
- of the value of `ordering'. In the case of RETURN_IN_ORDER, only
- `--' can cause `getopt' to return EOF with `optind' != ARGC. */
-
- enum OrderingEnum { REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER };
- OrderingEnum ordering;
-
- /* Handle permutation of arguments. */
-
- /* Describe the part of ARGV that contains non-options that have
- been skipped. `first_nonopt' is the index in ARGV of the first of them;
- `last_nonopt' is the index after the last of them. */
-
- static int first_nonopt;
- static int last_nonopt;
-
- void exchange (char **argv);
-public:
- /* For communication from `getopt' to the caller.
- When `getopt' finds an option that takes an argument,
- the argument value is returned here.
- Also, when `ordering' is RETURN_IN_ORDER,
- each non-option ARGV-element is returned here. */
-
- char *optarg;
-
- /* Index in ARGV of the next element to be scanned.
- This is used for communication to and from the caller
- and for communication between successive calls to `getopt'.
- On entry to `getopt', zero means this is the first call; initialize.
-
- When `getopt' returns EOF, this is the index of the first of the
- non-option elements that the caller should itself scan.
-
- Otherwise, `optind' communicates from one call to the next
- how much of ARGV has been scanned so far. */
-
- int optind;
-
- /* Callers store zero here to inhibit the error message
- for unrecognized options. */
-
- int opterr;
-
- int nargc;
- char **nargv;
- const char *noptstring;
-
- GetOpt (int argc, char **argv, const char *optstring);
- int operator () (void);
-};
-
-#endif
diff --git a/contrib/libg++/libg++/src/HypGeom.cc b/contrib/libg++/libg++/src/HypGeom.cc
deleted file mode 100644
index a283caddbc17..000000000000
--- a/contrib/libg++/libg++/src/HypGeom.cc
+++ /dev/null
@@ -1,30 +0,0 @@
-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Dirk Grunwald (grunwald@cs.uiuc.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <builtin.h>
-#include <Random.h>
-#include <HypGeom.h>
-
-double HyperGeometric::operator()()
-{
- double d = (pGenerator -> asDouble() > pP) ? (1.0 - pP) : (pP);
- return(-pMean * log(pGenerator -> asDouble()) / (2.0 * d) );
-}
-
diff --git a/contrib/libg++/libg++/src/HypGeom.h b/contrib/libg++/libg++/src/HypGeom.h
deleted file mode 100644
index 0aeeb7d78ee0..000000000000
--- a/contrib/libg++/libg++/src/HypGeom.h
+++ /dev/null
@@ -1,70 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Dirk Grunwald (grunwald@cs.uiuc.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#ifndef _HyperGeometric_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _HyperGeometric_h
-
-#include <Random.h>
-
-class HyperGeometric: public Random {
-protected:
- double pMean;
- double pVariance;
- double pP;
- void setState();
-
-public:
- HyperGeometric(double mean, double variance, RNG *gen);
-
- double mean();
- double mean(double x);
- double variance();
- double variance(double x);
-
- virtual double operator()();
-};
-
-
-inline void HyperGeometric::setState() {
- double z = pVariance / (pMean * pMean);
- pP = 0.5 * (1.0 - sqrt((z - 1.0) / ( z + 1.0 )));
-}
-
-inline HyperGeometric::HyperGeometric(double mean, double variance, RNG *gen)
-: Random(gen) {
- pMean = mean; pVariance = variance;
- setState();
-}
-
-inline double HyperGeometric::mean() { return pMean; };
-
-inline double HyperGeometric::mean(double x) {
- double t = pMean; pMean = x;
- setState(); return t;
-}
-
-inline double HyperGeometric::variance() { return pVariance; }
-
-inline double HyperGeometric::variance(double x) {
- double t = pVariance; pVariance = x;
- setState(); return t;
-}
-
-#endif
diff --git a/contrib/libg++/libg++/src/Incremental.h b/contrib/libg++/libg++/src/Incremental.h
deleted file mode 100644
index 267970a8cfbc..000000000000
--- a/contrib/libg++/libg++/src/Incremental.h
+++ /dev/null
@@ -1,12 +0,0 @@
-#ifndef Incremental_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define Incremental_h
-#define DECLARE_INIT_FUNCTION(USER_INIT_FUNCTION) \
-static void USER_INIT_FUNCTION (); extern void (*_initfn)(); \
-static struct xyzzy { xyzzy () {_initfn = USER_INIT_FUNCTION;}; \
-~xyzzy () {};} __2xyzzy;
-#else
-#error Incremental.h was not the first file included in this module
-#endif
diff --git a/contrib/libg++/libg++/src/Intdouble.cc b/contrib/libg++/libg++/src/Intdouble.cc
deleted file mode 100644
index 065175b967a3..000000000000
--- a/contrib/libg++/libg++/src/Intdouble.cc
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
-Copyright (C) 1988, 1993 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-// Routines for converting between Integers and doubles.
-// Split up into a separate file to avoid Integer.o's need
-// for libm.a on some systems (including SunOS 4).
-
-#include <Integer.h>
-#include "Integer.hP"
-#include <float.h>
-#include <math.h>
-#include <limits.h>
-
-#ifndef HUGE_VAL
-#ifdef HUGE
-#define HUGE_VAL HUGE
-#else
-#define HUGE_VAL DBL_MAX
-#endif
-#endif
-
-// convert to a double
-
-double Itodouble(const IntRep* rep)
-{
- double d = 0.0;
- double bound = DBL_MAX / 2.0;
- for (int i = rep->len - 1; i >= 0; --i)
- {
- unsigned short a = I_RADIX >> 1;
- while (a != 0)
- {
- if (d >= bound)
- return (rep->sgn == I_NEGATIVE) ? -HUGE_VAL : HUGE_VAL;
- d *= 2.0;
- if (rep->s[i] & a)
- d += 1.0;
- a >>= 1;
- }
- }
- if (rep->sgn == I_NEGATIVE)
- return -d;
- else
- return d;
-}
-
-// see whether op double() will work-
-// have to actually try it in order to find out
-// since otherwise might trigger fp exception
-
-int Iisdouble(const IntRep* rep)
-{
- double d = 0.0;
- double bound = DBL_MAX / 2.0;
- for (int i = rep->len - 1; i >= 0; --i)
- {
- unsigned short a = I_RADIX >> 1;
- while (a != 0)
- {
- if (d > bound || (d == bound && (i > 0 || (rep->s[i] & a))))
- return 0;
- d *= 2.0;
- if (rep->s[i] & a)
- d += 1.0;
- a >>= 1;
- }
- }
- return 1;
-}
-
-// real division of num / den
-
-double ratio(const Integer& num, const Integer& den)
-{
- Integer q, r;
- divide(num, den, q, r);
- double d1 = q.as_double();
-
- if (d1 >= DBL_MAX || d1 <= -DBL_MAX || sign(r) == 0)
- return d1;
- else // use as much precision as available for fractional part
- {
- double d2 = 0.0;
- double d3 = 0.0;
- int cont = 1;
- for (int i = den.rep->len - 1; i >= 0 && cont; --i)
- {
- unsigned short a = I_RADIX >> 1;
- while (a != 0)
- {
- if (d2 + 1.0 == d2) // out of precision when we get here
- {
- cont = 0;
- break;
- }
-
- d2 *= 2.0;
- if (den.rep->s[i] & a)
- d2 += 1.0;
-
- if (i < r.rep->len)
- {
- d3 *= 2.0;
- if (r.rep->s[i] & a)
- d3 += 1.0;
- }
-
- a >>= 1;
- }
- }
-
- if (sign(r) < 0)
- d3 = -d3;
- return d1 + d3 / d2;
- }
-}
-
-double
-Integer::as_double () const
-{
- return Itodouble (rep);
-}
-
-int
-Integer::fits_in_double () const
-{
- return Iisdouble(rep);
-}
diff --git a/contrib/libg++/libg++/src/Integer.cc b/contrib/libg++/libg++/src/Integer.cc
deleted file mode 100644
index 926b28ace683..000000000000
--- a/contrib/libg++/libg++/src/Integer.cc
+++ /dev/null
@@ -1,2282 +0,0 @@
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-/*
- Some of the following algorithms are very loosely based on those from
- MIT C-Scheme bignum.c, which is
- Copyright (c) 1987 Massachusetts Institute of Technology
-
- with other guidance from Knuth, vol. 2
-
- Thanks to the creators of the algorithms.
-*/
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <Integer.h>
-#include <std.h>
-#include <ctype.h>
-#include <limits.h>
-#include <Obstack.h>
-#include <AllocRing.h>
-#include <new.h>
-#include <builtin.h>
-#include "Integer.hP"
-
-#undef OK
-
-IntRep _ZeroRep = {1, 0, 1, {0}};
-IntRep _OneRep = {1, 0, 1, {1}};
-IntRep _MinusOneRep = {1, 0, 0, {1}};
-
-
-// utilities to extract and transfer bits
-
-// get low bits
-
-inline static unsigned short extract(unsigned long x)
-{
- return x & I_MAXNUM;
-}
-
-// transfer high bits to low
-
-inline static unsigned long down(unsigned long x)
-{
- return (x >> I_SHIFT) & I_MAXNUM;
-}
-
-// transfer low bits to high
-
-inline static unsigned long up(unsigned long x)
-{
- return x << I_SHIFT;
-}
-
-// compare two equal-length reps
-
-inline static int docmp(const unsigned short* x, const unsigned short* y, int l)
-{
- int diff = 0;
- const unsigned short* xs = &(x[l]);
- const unsigned short* ys = &(y[l]);
- while (l-- > 0 && (diff = (*--xs) - (*--ys)) == 0);
- return diff;
-}
-
-// figure out max length of result of +, -, etc.
-
-inline static int calc_len(int len1, int len2, int pad)
-{
- return (len1 >= len2)? len1 + pad : len2 + pad;
-}
-
-// ensure len & sgn are correct
-
-inline static void Icheck(IntRep* rep)
-{
- int l = rep->len;
- const unsigned short* p = &(rep->s[l]);
- while (l > 0 && *--p == 0) --l;
- if ((rep->len = l) == 0) rep->sgn = I_POSITIVE;
-}
-
-
-// zero out the end of a rep
-
-inline static void Iclear_from(IntRep* rep, int p)
-{
- unsigned short* cp = &(rep->s[p]);
- const unsigned short* cf = &(rep->s[rep->len]);
- while(cp < cf) *cp++ = 0;
-}
-
-// copy parts of a rep
-
-static inline void scpy(const unsigned short* src, unsigned short* dest,int nb)
-{
- while (--nb >= 0) *dest++ = *src++;
-}
-
-// make sure an argument is valid
-
-static inline void nonnil(const IntRep* rep)
-{
- if (rep == 0)
- (*lib_error_handler)("Integer", "operation on uninitialized Integer");
-}
-
-// allocate a new Irep. Pad to something close to a power of two.
-
-inline static IntRep* Inew(int newlen)
-{
- unsigned int siz = sizeof(IntRep) + newlen * sizeof(short) +
- MALLOC_MIN_OVERHEAD;
- unsigned int allocsiz = MINIntRep_SIZE;
- while (allocsiz < siz) allocsiz <<= 1; // find a power of 2
- allocsiz -= MALLOC_MIN_OVERHEAD;
- if (allocsiz >= MAXIntRep_SIZE * sizeof(short))
- (*lib_error_handler)("Integer", "Requested length out of range");
-
- IntRep* rep = new (operator new (allocsiz)) IntRep;
- rep->sz = (allocsiz - sizeof(IntRep) + sizeof(short)) / sizeof(short);
- return rep;
-}
-
-// allocate: use the bits in src if non-null, clear the rest
-
-IntRep* Ialloc(IntRep* old, const unsigned short* src, int srclen, int newsgn,
- int newlen)
-{
- IntRep* rep;
- if (old == 0 || newlen > old->sz)
- rep = Inew(newlen);
- else
- rep = old;
-
- rep->len = newlen;
- rep->sgn = newsgn;
-
- scpy(src, rep->s, srclen);
- Iclear_from(rep, srclen);
-
- if (old != rep && old != 0 && !STATIC_IntRep(old)) delete old;
- return rep;
-}
-
-// allocate and clear
-
-IntRep* Icalloc(IntRep* old, int newlen)
-{
- IntRep* rep;
- if (old == 0 || newlen > old->sz)
- {
- if (old != 0 && !STATIC_IntRep(old)) delete old;
- rep = Inew(newlen);
- }
- else
- rep = old;
-
- rep->len = newlen;
- rep->sgn = I_POSITIVE;
- Iclear_from(rep, 0);
-
- return rep;
-}
-
-// reallocate
-
-IntRep* Iresize(IntRep* old, int newlen)
-{
- IntRep* rep;
- unsigned short oldlen;
- if (old == 0)
- {
- oldlen = 0;
- rep = Inew(newlen);
- rep->sgn = I_POSITIVE;
- }
- else
- {
- oldlen = old->len;
- if (newlen > old->sz)
- {
- rep = Inew(newlen);
- scpy(old->s, rep->s, oldlen);
- rep->sgn = old->sgn;
- if (!STATIC_IntRep(old)) delete old;
- }
- else
- rep = old;
- }
-
- rep->len = newlen;
- Iclear_from(rep, oldlen);
-
- return rep;
-}
-
-
-// same, for straight copy
-
-IntRep* Icopy(IntRep* old, const IntRep* src)
-{
- if (old == src) return old;
- IntRep* rep;
- if (src == 0)
- {
- if (old == 0)
- rep = Inew(0);
- else
- {
- rep = old;
- Iclear_from(rep, 0);
- }
- rep->len = 0;
- rep->sgn = I_POSITIVE;
- }
- else
- {
- int newlen = src->len;
- if (old == 0 || newlen > old->sz)
- {
- if (old != 0 && !STATIC_IntRep(old)) delete old;
- rep = Inew(newlen);
- }
- else
- rep = old;
-
- rep->len = newlen;
- rep->sgn = src->sgn;
-
- scpy(src->s, rep->s, newlen);
- }
-
- return rep;
-}
-
-// allocate & copy space for a long
-
-IntRep* Icopy_long(IntRep* old, long x)
-{
- int newsgn = (x >= 0);
- IntRep* rep = Icopy_ulong(old, newsgn ? x : -x);
- rep->sgn = newsgn;
- return rep;
-}
-
-IntRep* Icopy_ulong(IntRep* old, unsigned long x)
-{
- unsigned short src[SHORT_PER_LONG];
-
- unsigned short srclen = 0;
- while (x != 0)
- {
- src[srclen++] = extract(x);
- x = down(x);
- }
-
- IntRep* rep;
- if (old == 0 || srclen > old->sz)
- {
- if (old != 0 && !STATIC_IntRep(old)) delete old;
- rep = Inew(srclen);
- }
- else
- rep = old;
-
- rep->len = srclen;
- rep->sgn = I_POSITIVE;
-
- scpy(src, rep->s, srclen);
-
- return rep;
-}
-
-// special case for zero -- it's worth it!
-
-IntRep* Icopy_zero(IntRep* old)
-{
- if (old == 0 || STATIC_IntRep(old))
- return &_ZeroRep;
-
- old->len = 0;
- old->sgn = I_POSITIVE;
-
- return old;
-}
-
-// special case for 1 or -1
-
-IntRep* Icopy_one(IntRep* old, int newsgn)
-{
- if (old == 0 || 1 > old->sz)
- {
- if (old != 0 && !STATIC_IntRep(old)) delete old;
- return newsgn==I_NEGATIVE ? &_MinusOneRep : &_OneRep;
- }
-
- old->sgn = newsgn;
- old->len = 1;
- old->s[0] = 1;
-
- return old;
-}
-
-// convert to a legal two's complement long if possible
-// if too big, return most negative/positive value
-
-long Itolong(const IntRep* rep)
-{
- if ((unsigned)(rep->len) > (unsigned)(SHORT_PER_LONG))
- return (rep->sgn == I_POSITIVE) ? LONG_MAX : LONG_MIN;
- else if (rep->len == 0)
- return 0;
- else if ((unsigned)(rep->len) < (unsigned)(SHORT_PER_LONG))
- {
- unsigned long a = rep->s[rep->len-1];
- if (SHORT_PER_LONG > 2) // normally optimized out
- {
- for (int i = rep->len - 2; i >= 0; --i)
- a = up(a) | rep->s[i];
- }
- return (rep->sgn == I_POSITIVE)? a : -((long)a);
- }
- else
- {
- unsigned long a = rep->s[SHORT_PER_LONG - 1];
- if (a >= I_MINNUM)
- return (rep->sgn == I_POSITIVE) ? LONG_MAX : LONG_MIN;
- else
- {
- a = up(a) | rep->s[SHORT_PER_LONG - 2];
- if (SHORT_PER_LONG > 2)
- {
- for (int i = SHORT_PER_LONG - 3; i >= 0; --i)
- a = up(a) | rep->s[i];
- }
- return (rep->sgn == I_POSITIVE)? a : -((long)a);
- }
- }
-}
-
-// test whether op long() will work.
-// careful about asymmetry between LONG_MIN & LONG_MAX
-
-int Iislong(const IntRep* rep)
-{
- unsigned int l = rep->len;
- if (l < SHORT_PER_LONG)
- return 1;
- else if (l > SHORT_PER_LONG)
- return 0;
- else if ((unsigned)(rep->s[SHORT_PER_LONG - 1]) < (unsigned)(I_MINNUM))
- return 1;
- else if (rep->sgn == I_NEGATIVE && rep->s[SHORT_PER_LONG - 1] == I_MINNUM)
- {
- for (unsigned int i = 0; i < SHORT_PER_LONG - 1; ++i)
- if (rep->s[i] != 0)
- return 0;
- return 1;
- }
- else
- return 0;
-}
-
-// comparison functions
-
-int compare(const IntRep* x, const IntRep* y)
-{
- int diff = x->sgn - y->sgn;
- if (diff == 0)
- {
- diff = x->len - y->len;
- if (diff == 0)
- diff = docmp(x->s, y->s, x->len);
- if (x->sgn == I_NEGATIVE)
- diff = -diff;
- }
- return diff;
-}
-
-int ucompare(const IntRep* x, const IntRep* y)
-{
- int diff = x->len - y->len;
- if (diff == 0)
- {
- int l = x->len;
- const unsigned short* xs = &(x->s[l]);
- const unsigned short* ys = &(y->s[l]);
- while (l-- > 0 && (diff = (*--xs) - (*--ys)) == 0);
- }
- return diff;
-}
-
-int compare(const IntRep* x, long y)
-{
- int xl = x->len;
- int xsgn = x->sgn;
- if (y == 0)
- {
- if (xl == 0)
- return 0;
- else if (xsgn == I_NEGATIVE)
- return -1;
- else
- return 1;
- }
- else
- {
- int ysgn = y >= 0;
- unsigned long uy = (ysgn)? y : -y;
- int diff = xsgn - ysgn;
- if (diff == 0)
- {
- diff = xl - SHORT_PER_LONG;
- if (diff <= 0)
- {
- unsigned short tmp[SHORT_PER_LONG];
- int yl = 0;
- while (uy != 0)
- {
- tmp[yl++] = extract(uy);
- uy = down(uy);
- }
- diff = xl - yl;
- if (diff == 0)
- diff = docmp(x->s, tmp, xl);
- }
- if (xsgn == I_NEGATIVE)
- diff = -diff;
- }
- return diff;
- }
-}
-
-int ucompare(const IntRep* x, long y)
-{
- int xl = x->len;
- if (y == 0)
- return xl;
- else
- {
- unsigned long uy = (y >= 0)? y : -y;
- int diff = xl - SHORT_PER_LONG;
- if (diff <= 0)
- {
- unsigned short tmp[SHORT_PER_LONG];
- int yl = 0;
- while (uy != 0)
- {
- tmp[yl++] = extract(uy);
- uy = down(uy);
- }
- diff = xl - yl;
- if (diff == 0)
- diff = docmp(x->s, tmp, xl);
- }
- return diff;
- }
-}
-
-
-
-// arithmetic functions
-
-IntRep* add(const IntRep* x, int negatex,
- const IntRep* y, int negatey, IntRep* r)
-{
- nonnil(x);
- nonnil(y);
-
- int xl = x->len;
- int yl = y->len;
-
- int xsgn = (negatex && xl != 0) ? !x->sgn : x->sgn;
- int ysgn = (negatey && yl != 0) ? !y->sgn : y->sgn;
-
- int xrsame = x == r;
- int yrsame = y == r;
-
- if (yl == 0)
- r = Ialloc(r, x->s, xl, xsgn, xl);
- else if (xl == 0)
- r = Ialloc(r, y->s, yl, ysgn, yl);
- else if (xsgn == ysgn)
- {
- if (xrsame || yrsame)
- r = Iresize(r, calc_len(xl, yl, 1));
- else
- r = Icalloc(r, calc_len(xl, yl, 1));
- r->sgn = xsgn;
- unsigned short* rs = r->s;
- const unsigned short* as;
- const unsigned short* bs;
- const unsigned short* topa;
- const unsigned short* topb;
- if (xl >= yl)
- {
- as = (xrsame)? r->s : x->s;
- topa = &(as[xl]);
- bs = (yrsame)? r->s : y->s;
- topb = &(bs[yl]);
- }
- else
- {
- bs = (xrsame)? r->s : x->s;
- topb = &(bs[xl]);
- as = (yrsame)? r->s : y->s;
- topa = &(as[yl]);
- }
- unsigned long sum = 0;
- while (bs < topb)
- {
- sum += (unsigned long)(*as++) + (unsigned long)(*bs++);
- *rs++ = extract(sum);
- sum = down(sum);
- }
- while (sum != 0 && as < topa)
- {
- sum += (unsigned long)(*as++);
- *rs++ = extract(sum);
- sum = down(sum);
- }
- if (sum != 0)
- *rs = extract(sum);
- else if (rs != as)
- while (as < topa)
- *rs++ = *as++;
- }
- else
- {
- int comp = ucompare(x, y);
- if (comp == 0)
- r = Icopy_zero(r);
- else
- {
- if (xrsame || yrsame)
- r = Iresize(r, calc_len(xl, yl, 0));
- else
- r = Icalloc(r, calc_len(xl, yl, 0));
- unsigned short* rs = r->s;
- const unsigned short* as;
- const unsigned short* bs;
- const unsigned short* topa;
- const unsigned short* topb;
- if (comp > 0)
- {
- as = (xrsame)? r->s : x->s;
- topa = &(as[xl]);
- bs = (yrsame)? r->s : y->s;
- topb = &(bs[yl]);
- r->sgn = xsgn;
- }
- else
- {
- bs = (xrsame)? r->s : x->s;
- topb = &(bs[xl]);
- as = (yrsame)? r->s : y->s;
- topa = &(as[yl]);
- r->sgn = ysgn;
- }
- unsigned long hi = 1;
- while (bs < topb)
- {
- hi += (unsigned long)(*as++) + I_MAXNUM - (unsigned long)(*bs++);
- *rs++ = extract(hi);
- hi = down(hi);
- }
- while (hi == 0 && as < topa)
- {
- hi = (unsigned long)(*as++) + I_MAXNUM;
- *rs++ = extract(hi);
- hi = down(hi);
- }
- if (rs != as)
- while (as < topa)
- *rs++ = *as++;
- }
- }
- Icheck(r);
- return r;
-}
-
-
-IntRep* add(const IntRep* x, int negatex, long y, IntRep* r)
-{
- nonnil(x);
- int xl = x->len;
- int xsgn = (negatex && xl != 0) ? !x->sgn : x->sgn;
- int xrsame = x == r;
-
- int ysgn = (y >= 0);
- unsigned long uy = (ysgn)? y : -y;
-
- if (y == 0)
- r = Ialloc(r, x->s, xl, xsgn, xl);
- else if (xl == 0)
- r = Icopy_long(r, y);
- else if (xsgn == ysgn)
- {
- if (xrsame)
- r = Iresize(r, calc_len(xl, SHORT_PER_LONG, 1));
- else
- r = Icalloc(r, calc_len(xl, SHORT_PER_LONG, 1));
- r->sgn = xsgn;
- unsigned short* rs = r->s;
- const unsigned short* as = (xrsame)? r->s : x->s;
- const unsigned short* topa = &(as[xl]);
- unsigned long sum = 0;
- while (as < topa && uy != 0)
- {
- unsigned long u = extract(uy);
- uy = down(uy);
- sum += (unsigned long)(*as++) + u;
- *rs++ = extract(sum);
- sum = down(sum);
- }
- while (sum != 0 && as < topa)
- {
- sum += (unsigned long)(*as++);
- *rs++ = extract(sum);
- sum = down(sum);
- }
- if (sum != 0)
- *rs = extract(sum);
- else if (rs != as)
- while (as < topa)
- *rs++ = *as++;
- }
- else
- {
- unsigned short tmp[SHORT_PER_LONG];
- int yl = 0;
- while (uy != 0)
- {
- tmp[yl++] = extract(uy);
- uy = down(uy);
- }
- int comp = xl - yl;
- if (comp == 0)
- comp = docmp(x->s, tmp, yl);
- if (comp == 0)
- r = Icopy_zero(r);
- else
- {
- if (xrsame)
- r = Iresize(r, calc_len(xl, yl, 0));
- else
- r = Icalloc(r, calc_len(xl, yl, 0));
- unsigned short* rs = r->s;
- const unsigned short* as;
- const unsigned short* bs;
- const unsigned short* topa;
- const unsigned short* topb;
- if (comp > 0)
- {
- as = (xrsame)? r->s : x->s;
- topa = &(as[xl]);
- bs = tmp;
- topb = &(bs[yl]);
- r->sgn = xsgn;
- }
- else
- {
- bs = (xrsame)? r->s : x->s;
- topb = &(bs[xl]);
- as = tmp;
- topa = &(as[yl]);
- r->sgn = ysgn;
- }
- unsigned long hi = 1;
- while (bs < topb)
- {
- hi += (unsigned long)(*as++) + I_MAXNUM - (unsigned long)(*bs++);
- *rs++ = extract(hi);
- hi = down(hi);
- }
- while (hi == 0 && as < topa)
- {
- hi = (unsigned long)(*as++) + I_MAXNUM;
- *rs++ = extract(hi);
- hi = down(hi);
- }
- if (rs != as)
- while (as < topa)
- *rs++ = *as++;
- }
- }
- Icheck(r);
- return r;
-}
-
-
-IntRep* multiply(const IntRep* x, const IntRep* y, IntRep* r)
-{
- nonnil(x);
- nonnil(y);
- int xl = x->len;
- int yl = y->len;
- int rl = xl + yl;
- int rsgn = x->sgn == y->sgn;
- int xrsame = x == r;
- int yrsame = y == r;
- int xysame = x == y;
-
- if (xl == 0 || yl == 0)
- r = Icopy_zero(r);
- else if (xl == 1 && x->s[0] == 1)
- r = Icopy(r, y);
- else if (yl == 1 && y->s[0] == 1)
- r = Icopy(r, x);
- else if (!(xysame && xrsame))
- {
- if (xrsame || yrsame)
- r = Iresize(r, rl);
- else
- r = Icalloc(r, rl);
- unsigned short* rs = r->s;
- unsigned short* topr = &(rs[rl]);
-
- // use best inner/outer loop params given constraints
- unsigned short* currentr;
- const unsigned short* bota;
- const unsigned short* as;
- const unsigned short* botb;
- const unsigned short* topb;
- if (xrsame)
- {
- currentr = &(rs[xl-1]);
- bota = rs;
- as = currentr;
- botb = y->s;
- topb = &(botb[yl]);
- }
- else if (yrsame)
- {
- currentr = &(rs[yl-1]);
- bota = rs;
- as = currentr;
- botb = x->s;
- topb = &(botb[xl]);
- }
- else if (xl <= yl)
- {
- currentr = &(rs[xl-1]);
- bota = x->s;
- as = &(bota[xl-1]);
- botb = y->s;
- topb = &(botb[yl]);
- }
- else
- {
- currentr = &(rs[yl-1]);
- bota = y->s;
- as = &(bota[yl-1]);
- botb = x->s;
- topb = &(botb[xl]);
- }
-
- while (as >= bota)
- {
- unsigned long ai = (unsigned long)(*as--);
- unsigned short* rs = currentr--;
- *rs = 0;
- if (ai != 0)
- {
- unsigned long sum = 0;
- const unsigned short* bs = botb;
- while (bs < topb)
- {
- sum += ai * (unsigned long)(*bs++) + (unsigned long)(*rs);
- *rs++ = extract(sum);
- sum = down(sum);
- }
- while (sum != 0 && rs < topr)
- {
- sum += (unsigned long)(*rs);
- *rs++ = extract(sum);
- sum = down(sum);
- }
- }
- }
- }
- else // x, y, and r same; compute over diagonals
- {
- r = Iresize(r, rl);
- unsigned short* botr = r->s;
- unsigned short* topr = &(botr[rl]);
- unsigned short* rs = &(botr[rl - 2]);
-
- const unsigned short* bota = (xrsame)? botr : x->s;
- const unsigned short* loa = &(bota[xl - 1]);
- const unsigned short* hia = loa;
-
- for (; rs >= botr; --rs)
- {
- const unsigned short* h = hia;
- const unsigned short* l = loa;
- unsigned long prod = (unsigned long)(*h) * (unsigned long)(*l);
- *rs = 0;
-
- for(;;)
- {
- unsigned short* rt = rs;
- unsigned long sum = prod + (unsigned long)(*rt);
- *rt++ = extract(sum);
- sum = down(sum);
- while (sum != 0 && rt < topr)
- {
- sum += (unsigned long)(*rt);
- *rt++ = extract(sum);
- sum = down(sum);
- }
- if (h > l)
- {
- rt = rs;
- sum = prod + (unsigned long)(*rt);
- *rt++ = extract(sum);
- sum = down(sum);
- while (sum != 0 && rt < topr)
- {
- sum += (unsigned long)(*rt);
- *rt++ = extract(sum);
- sum = down(sum);
- }
- if (--h >= ++l)
- prod = (unsigned long)(*h) * (unsigned long)(*l);
- else
- break;
- }
- else
- break;
- }
- if (loa > bota)
- --loa;
- else
- --hia;
- }
- }
- r->sgn = rsgn;
- Icheck(r);
- return r;
-}
-
-
-IntRep* multiply(const IntRep* x, long y, IntRep* r)
-{
- nonnil(x);
- int xl = x->len;
-
- if (xl == 0 || y == 0)
- r = Icopy_zero(r);
- else if (y == 1)
- r = Icopy(r, x);
- else
- {
- int ysgn = y >= 0;
- int rsgn = x->sgn == ysgn;
- unsigned long uy = (ysgn)? y : -y;
- unsigned short tmp[SHORT_PER_LONG];
- int yl = 0;
- while (uy != 0)
- {
- tmp[yl++] = extract(uy);
- uy = down(uy);
- }
-
- int rl = xl + yl;
- int xrsame = x == r;
- if (xrsame)
- r = Iresize(r, rl);
- else
- r = Icalloc(r, rl);
-
- unsigned short* rs = r->s;
- unsigned short* topr = &(rs[rl]);
- unsigned short* currentr;
- const unsigned short* bota;
- const unsigned short* as;
- const unsigned short* botb;
- const unsigned short* topb;
-
- if (xrsame)
- {
- currentr = &(rs[xl-1]);
- bota = rs;
- as = currentr;
- botb = tmp;
- topb = &(botb[yl]);
- }
- else if (xl <= yl)
- {
- currentr = &(rs[xl-1]);
- bota = x->s;
- as = &(bota[xl-1]);
- botb = tmp;
- topb = &(botb[yl]);
- }
- else
- {
- currentr = &(rs[yl-1]);
- bota = tmp;
- as = &(bota[yl-1]);
- botb = x->s;
- topb = &(botb[xl]);
- }
-
- while (as >= bota)
- {
- unsigned long ai = (unsigned long)(*as--);
- unsigned short* rs = currentr--;
- *rs = 0;
- if (ai != 0)
- {
- unsigned long sum = 0;
- const unsigned short* bs = botb;
- while (bs < topb)
- {
- sum += ai * (unsigned long)(*bs++) + (unsigned long)(*rs);
- *rs++ = extract(sum);
- sum = down(sum);
- }
- while (sum != 0 && rs < topr)
- {
- sum += (unsigned long)(*rs);
- *rs++ = extract(sum);
- sum = down(sum);
- }
- }
- }
- r->sgn = rsgn;
- }
- Icheck(r);
- return r;
-}
-
-
-// main division routine
-
-static void do_divide(unsigned short* rs,
- const unsigned short* ys, int yl,
- unsigned short* qs, int ql)
-{
- const unsigned short* topy = &(ys[yl]);
- unsigned short d1 = ys[yl - 1];
- unsigned short d2 = ys[yl - 2];
-
- int l = ql - 1;
- int i = l + yl;
-
- for (; l >= 0; --l, --i)
- {
- unsigned short qhat; // guess q
- if (d1 == rs[i])
- qhat = I_MAXNUM;
- else
- {
- unsigned long lr = up((unsigned long)rs[i]) | rs[i-1];
- qhat = lr / d1;
- }
-
- for(;;) // adjust q, use docmp to avoid overflow problems
- {
- unsigned short ts[3];
- unsigned long prod = (unsigned long)d2 * (unsigned long)qhat;
- ts[0] = extract(prod);
- prod = down(prod) + (unsigned long)d1 * (unsigned long)qhat;
- ts[1] = extract(prod);
- ts[2] = extract(down(prod));
- if (docmp(ts, &(rs[i-2]), 3) > 0)
- --qhat;
- else
- break;
- };
-
- // multiply & subtract
-
- const unsigned short* yt = ys;
- unsigned short* rt = &(rs[l]);
- unsigned long prod = 0;
- unsigned long hi = 1;
- while (yt < topy)
- {
- prod = (unsigned long)qhat * (unsigned long)(*yt++) + down(prod);
- hi += (unsigned long)(*rt) + I_MAXNUM - (unsigned long)(extract(prod));
- *rt++ = extract(hi);
- hi = down(hi);
- }
- hi += (unsigned long)(*rt) + I_MAXNUM - (unsigned long)(down(prod));
- *rt = extract(hi);
- hi = down(hi);
-
- // off-by-one, add back
-
- if (hi == 0)
- {
- --qhat;
- yt = ys;
- rt = &(rs[l]);
- hi = 0;
- while (yt < topy)
- {
- hi = (unsigned long)(*rt) + (unsigned long)(*yt++) + down(hi);
- *rt++ = extract(hi);
- }
- *rt = 0;
- }
- if (qs != 0)
- qs[l] = qhat;
- }
-}
-
-// divide by single digit, return remainder
-// if q != 0, then keep the result in q, else just compute rem
-
-static int unscale(const unsigned short* x, int xl, unsigned short y,
- unsigned short* q)
-{
- if (xl == 0 || y == 1)
- return 0;
- else if (q != 0)
- {
- unsigned short* botq = q;
- unsigned short* qs = &(botq[xl - 1]);
- const unsigned short* xs = &(x[xl - 1]);
- unsigned long rem = 0;
- while (qs >= botq)
- {
- rem = up(rem) | *xs--;
- unsigned long u = rem / y;
- *qs-- = extract(u);
- rem -= u * y;
- }
- int r = extract(rem);
- return r;
- }
- else // same loop, a bit faster if just need rem
- {
- const unsigned short* botx = x;
- const unsigned short* xs = &(botx[xl - 1]);
- unsigned long rem = 0;
- while (xs >= botx)
- {
- rem = up(rem) | *xs--;
- unsigned long u = rem / y;
- rem -= u * y;
- }
- int r = extract(rem);
- return r;
- }
-}
-
-
-IntRep* div(const IntRep* x, const IntRep* y, IntRep* q)
-{
- nonnil(x);
- nonnil(y);
- int xl = x->len;
- int yl = y->len;
- if (yl == 0) (*lib_error_handler)("Integer", "attempted division by zero");
-
- int comp = ucompare(x, y);
- int xsgn = x->sgn;
- int ysgn = y->sgn;
-
- int samesign = xsgn == ysgn;
-
- if (comp < 0)
- q = Icopy_zero(q);
- else if (comp == 0)
- q = Icopy_one(q, samesign);
- else if (yl == 1)
- {
- q = Icopy(q, x);
- unscale(q->s, q->len, y->s[0], q->s);
- }
- else
- {
- IntRep* yy = 0;
- IntRep* r = 0;
- unsigned short prescale = (I_RADIX / (1 + y->s[yl - 1]));
- if (prescale != 1 || y == q)
- {
- yy = multiply(y, ((long)prescale & I_MAXNUM), yy);
- r = multiply(x, ((long)prescale & I_MAXNUM), r);
- }
- else
- {
- yy = (IntRep*)y;
- r = Icalloc(r, xl + 1);
- scpy(x->s, r->s, xl);
- }
-
- int ql = xl - yl + 1;
-
- q = Icalloc(q, ql);
- do_divide(r->s, yy->s, yl, q->s, ql);
-
- if (yy != y && !STATIC_IntRep(yy)) delete yy;
- if (!STATIC_IntRep(r)) delete r;
- }
- q->sgn = samesign;
- Icheck(q);
- return q;
-}
-
-IntRep* div(const IntRep* x, long y, IntRep* q)
-{
- nonnil(x);
- int xl = x->len;
- if (y == 0) (*lib_error_handler)("Integer", "attempted division by zero");
-
- unsigned short ys[SHORT_PER_LONG];
- unsigned long u;
- int ysgn = y >= 0;
- if (ysgn)
- u = y;
- else
- u = -y;
- int yl = 0;
- while (u != 0)
- {
- ys[yl++] = extract(u);
- u = down(u);
- }
-
- int comp = xl - yl;
- if (comp == 0) comp = docmp(x->s, ys, xl);
-
- int xsgn = x->sgn;
- int samesign = xsgn == ysgn;
-
- if (comp < 0)
- q = Icopy_zero(q);
- else if (comp == 0)
- {
- q = Icopy_one(q, samesign);
- }
- else if (yl == 1)
- {
- q = Icopy(q, x);
- unscale(q->s, q->len, ys[0], q->s);
- }
- else
- {
- IntRep* r = 0;
- unsigned short prescale = (I_RADIX / (1 + ys[yl - 1]));
- if (prescale != 1)
- {
- unsigned long prod = (unsigned long)prescale * (unsigned long)ys[0];
- ys[0] = extract(prod);
- prod = down(prod) + (unsigned long)prescale * (unsigned long)ys[1];
- ys[1] = extract(prod);
- r = multiply(x, ((long)prescale & I_MAXNUM), r);
- }
- else
- {
- r = Icalloc(r, xl + 1);
- scpy(x->s, r->s, xl);
- }
-
- int ql = xl - yl + 1;
-
- q = Icalloc(q, ql);
- do_divide(r->s, ys, yl, q->s, ql);
-
- if (!STATIC_IntRep(r)) delete r;
- }
- q->sgn = samesign;
- Icheck(q);
- return q;
-}
-
-
-void divide(const Integer& Ix, long y, Integer& Iq, long& rem)
-{
- const IntRep* x = Ix.rep;
- nonnil(x);
- IntRep* q = Iq.rep;
- int xl = x->len;
- if (y == 0) (*lib_error_handler)("Integer", "attempted division by zero");
-
- unsigned short ys[SHORT_PER_LONG];
- unsigned long u;
- int ysgn = y >= 0;
- if (ysgn)
- u = y;
- else
- u = -y;
- int yl = 0;
- while (u != 0)
- {
- ys[yl++] = extract(u);
- u = down(u);
- }
-
- int comp = xl - yl;
- if (comp == 0) comp = docmp(x->s, ys, xl);
-
- int xsgn = x->sgn;
- int samesign = xsgn == ysgn;
-
- if (comp < 0)
- {
- rem = Itolong(x);
- q = Icopy_zero(q);
- }
- else if (comp == 0)
- {
- q = Icopy_one(q, samesign);
- rem = 0;
- }
- else if (yl == 1)
- {
- q = Icopy(q, x);
- rem = unscale(q->s, q->len, ys[0], q->s);
- }
- else
- {
- IntRep* r = 0;
- unsigned short prescale = (I_RADIX / (1 + ys[yl - 1]));
- if (prescale != 1)
- {
- unsigned long prod = (unsigned long)prescale * (unsigned long)ys[0];
- ys[0] = extract(prod);
- prod = down(prod) + (unsigned long)prescale * (unsigned long)ys[1];
- ys[1] = extract(prod);
- r = multiply(x, ((long)prescale & I_MAXNUM), r);
- }
- else
- {
- r = Icalloc(r, xl + 1);
- scpy(x->s, r->s, xl);
- }
-
- int ql = xl - yl + 1;
-
- q = Icalloc(q, ql);
-
- do_divide(r->s, ys, yl, q->s, ql);
-
- if (prescale != 1)
- {
- Icheck(r);
- unscale(r->s, r->len, prescale, r->s);
- }
- Icheck(r);
- rem = Itolong(r);
- if (!STATIC_IntRep(r)) delete r;
- }
- rem = abs(rem);
- if (xsgn == I_NEGATIVE) rem = -rem;
- q->sgn = samesign;
- Icheck(q);
- Iq.rep = q;
-}
-
-
-void divide(const Integer& Ix, const Integer& Iy, Integer& Iq, Integer& Ir)
-{
- const IntRep* x = Ix.rep;
- nonnil(x);
- const IntRep* y = Iy.rep;
- nonnil(y);
- IntRep* q = Iq.rep;
- IntRep* r = Ir.rep;
-
- int xl = x->len;
- int yl = y->len;
- if (yl == 0)
- (*lib_error_handler)("Integer", "attempted division by zero");
-
- int comp = ucompare(x, y);
- int xsgn = x->sgn;
- int ysgn = y->sgn;
-
- int samesign = xsgn == ysgn;
-
- if (comp < 0)
- {
- q = Icopy_zero(q);
- r = Icopy(r, x);
- }
- else if (comp == 0)
- {
- q = Icopy_one(q, samesign);
- r = Icopy_zero(r);
- }
- else if (yl == 1)
- {
- q = Icopy(q, x);
- int rem = unscale(q->s, q->len, y->s[0], q->s);
- r = Icopy_long(r, rem);
- if (rem != 0)
- r->sgn = xsgn;
- }
- else
- {
- IntRep* yy = 0;
- unsigned short prescale = (I_RADIX / (1 + y->s[yl - 1]));
- if (prescale != 1 || y == q || y == r)
- {
- yy = multiply(y, ((long)prescale & I_MAXNUM), yy);
- r = multiply(x, ((long)prescale & I_MAXNUM), r);
- }
- else
- {
- yy = (IntRep*)y;
- r = Icalloc(r, xl + 1);
- scpy(x->s, r->s, xl);
- }
-
- int ql = xl - yl + 1;
-
- q = Icalloc(q, ql);
- do_divide(r->s, yy->s, yl, q->s, ql);
-
- if (yy != y && !STATIC_IntRep(yy)) delete yy;
- if (prescale != 1)
- {
- Icheck(r);
- unscale(r->s, r->len, prescale, r->s);
- }
- }
- q->sgn = samesign;
- Icheck(q);
- Iq.rep = q;
- Icheck(r);
- Ir.rep = r;
-}
-
-IntRep* mod(const IntRep* x, const IntRep* y, IntRep* r)
-{
- nonnil(x);
- nonnil(y);
- int xl = x->len;
- int yl = y->len;
- if (yl == 0) (*lib_error_handler)("Integer", "attempted division by zero");
-
- int comp = ucompare(x, y);
- int xsgn = x->sgn;
-
- if (comp < 0)
- r = Icopy(r, x);
- else if (comp == 0)
- r = Icopy_zero(r);
- else if (yl == 1)
- {
- int rem = unscale(x->s, xl, y->s[0], 0);
- r = Icopy_long(r, rem);
- if (rem != 0)
- r->sgn = xsgn;
- }
- else
- {
- IntRep* yy = 0;
- unsigned short prescale = (I_RADIX / (1 + y->s[yl - 1]));
- if (prescale != 1 || y == r)
- {
- yy = multiply(y, ((long)prescale & I_MAXNUM), yy);
- r = multiply(x, ((long)prescale & I_MAXNUM), r);
- }
- else
- {
- yy = (IntRep*)y;
- r = Icalloc(r, xl + 1);
- scpy(x->s, r->s, xl);
- }
-
- do_divide(r->s, yy->s, yl, 0, xl - yl + 1);
-
- if (yy != y && !STATIC_IntRep(yy)) delete yy;
-
- if (prescale != 1)
- {
- Icheck(r);
- unscale(r->s, r->len, prescale, r->s);
- }
- }
- Icheck(r);
- return r;
-}
-
-IntRep* mod(const IntRep* x, long y, IntRep* r)
-{
- nonnil(x);
- int xl = x->len;
- if (y == 0) (*lib_error_handler)("Integer", "attempted division by zero");
-
- unsigned short ys[SHORT_PER_LONG];
- unsigned long u;
- int ysgn = y >= 0;
- if (ysgn)
- u = y;
- else
- u = -y;
- int yl = 0;
- while (u != 0)
- {
- ys[yl++] = extract(u);
- u = down(u);
- }
-
- int comp = xl - yl;
- if (comp == 0) comp = docmp(x->s, ys, xl);
-
- int xsgn = x->sgn;
-
- if (comp < 0)
- r = Icopy(r, x);
- else if (comp == 0)
- r = Icopy_zero(r);
- else if (yl == 1)
- {
- int rem = unscale(x->s, xl, ys[0], 0);
- r = Icopy_long(r, rem);
- if (rem != 0)
- r->sgn = xsgn;
- }
- else
- {
- unsigned short prescale = (I_RADIX / (1 + ys[yl - 1]));
- if (prescale != 1)
- {
- unsigned long prod = (unsigned long)prescale * (unsigned long)ys[0];
- ys[0] = extract(prod);
- prod = down(prod) + (unsigned long)prescale * (unsigned long)ys[1];
- ys[1] = extract(prod);
- r = multiply(x, ((long)prescale & I_MAXNUM), r);
- }
- else
- {
- r = Icalloc(r, xl + 1);
- scpy(x->s, r->s, xl);
- }
-
- do_divide(r->s, ys, yl, 0, xl - yl + 1);
-
- if (prescale != 1)
- {
- Icheck(r);
- unscale(r->s, r->len, prescale, r->s);
- }
- }
- Icheck(r);
- return r;
-}
-
-IntRep* lshift(const IntRep* x, long y, IntRep* r)
-{
- nonnil(x);
- int xl = x->len;
- if (xl == 0 || y == 0)
- {
- r = Icopy(r, x);
- return r;
- }
-
- int xrsame = x == r;
- int rsgn = x->sgn;
-
- long ay = (y < 0)? -y : y;
- int bw = ay / I_SHIFT;
- int sw = ay % I_SHIFT;
-
- if (y > 0)
- {
- int rl = bw + xl + 1;
- if (xrsame)
- r = Iresize(r, rl);
- else
- r = Icalloc(r, rl);
-
- unsigned short* botr = r->s;
- unsigned short* rs = &(botr[rl - 1]);
- const unsigned short* botx = (xrsame)? botr : x->s;
- const unsigned short* xs = &(botx[xl - 1]);
- unsigned long a = 0;
- while (xs >= botx)
- {
- a = up(a) | ((unsigned long)(*xs--) << sw);
- *rs-- = extract(down(a));
- }
- *rs-- = extract(a);
- while (rs >= botr)
- *rs-- = 0;
- }
- else
- {
- int rl = xl - bw;
- if (rl < 0)
- r = Icopy_zero(r);
- else
- {
- if (xrsame)
- r = Iresize(r, rl);
- else
- r = Icalloc(r, rl);
- int rw = I_SHIFT - sw;
- unsigned short* rs = r->s;
- unsigned short* topr = &(rs[rl]);
- const unsigned short* botx = (xrsame)? rs : x->s;
- const unsigned short* xs = &(botx[bw]);
- const unsigned short* topx = &(botx[xl]);
- unsigned long a = (unsigned long)(*xs++) >> sw;
- while (xs < topx)
- {
- a |= (unsigned long)(*xs++) << rw;
- *rs++ = extract(a);
- a = down(a);
- }
- *rs++ = extract(a);
- if (xrsame) topr = (unsigned short*)topx;
- while (rs < topr)
- *rs++ = 0;
- }
- }
- r->sgn = rsgn;
- Icheck(r);
- return r;
-}
-
-IntRep* lshift(const IntRep* x, const IntRep* yy, int negatey, IntRep* r)
-{
- long y = Itolong(yy);
- if (negatey)
- y = -y;
-
- return lshift(x, y, r);
-}
-
-IntRep* bitop(const IntRep* x, const IntRep* y, IntRep* r, char op)
-{
- nonnil(x);
- nonnil(y);
- int xl = x->len;
- int yl = y->len;
- int xsgn = x->sgn;
- int xrsame = x == r;
- int yrsame = y == r;
- if (xrsame || yrsame)
- r = Iresize(r, calc_len(xl, yl, 0));
- else
- r = Icalloc(r, calc_len(xl, yl, 0));
- r->sgn = xsgn;
- unsigned short* rs = r->s;
- unsigned short* topr = &(rs[r->len]);
- const unsigned short* as;
- const unsigned short* bs;
- const unsigned short* topb;
- if (xl >= yl)
- {
- as = (xrsame)? rs : x->s;
- bs = (yrsame)? rs : y->s;
- topb = &(bs[yl]);
- }
- else
- {
- bs = (xrsame)? rs : x->s;
- topb = &(bs[xl]);
- as = (yrsame)? rs : y->s;
- }
-
- switch (op)
- {
- case '&':
- while (bs < topb) *rs++ = *as++ & *bs++;
- while (rs < topr) *rs++ = 0;
- break;
- case '|':
- while (bs < topb) *rs++ = *as++ | *bs++;
- while (rs < topr) *rs++ = *as++;
- break;
- case '^':
- while (bs < topb) *rs++ = *as++ ^ *bs++;
- while (rs < topr) *rs++ = *as++;
- break;
- }
- Icheck(r);
- return r;
-}
-
-IntRep* bitop(const IntRep* x, long y, IntRep* r, char op)
-{
- nonnil(x);
- unsigned short tmp[SHORT_PER_LONG];
- unsigned long u;
- int newsgn;
- if (newsgn = (y >= 0))
- u = y;
- else
- u = -y;
-
- int l = 0;
- while (u != 0)
- {
- tmp[l++] = extract(u);
- u = down(u);
- }
-
- int xl = x->len;
- int yl = l;
- int xsgn = x->sgn;
- int xrsame = x == r;
- if (xrsame)
- r = Iresize(r, calc_len(xl, yl, 0));
- else
- r = Icalloc(r, calc_len(xl, yl, 0));
- r->sgn = xsgn;
- unsigned short* rs = r->s;
- unsigned short* topr = &(rs[r->len]);
- const unsigned short* as;
- const unsigned short* bs;
- const unsigned short* topb;
- if (xl >= yl)
- {
- as = (xrsame)? rs : x->s;
- bs = tmp;
- topb = &(bs[yl]);
- }
- else
- {
- bs = (xrsame)? rs : x->s;
- topb = &(bs[xl]);
- as = tmp;
- }
-
- switch (op)
- {
- case '&':
- while (bs < topb) *rs++ = *as++ & *bs++;
- while (rs < topr) *rs++ = 0;
- break;
- case '|':
- while (bs < topb) *rs++ = *as++ | *bs++;
- while (rs < topr) *rs++ = *as++;
- break;
- case '^':
- while (bs < topb) *rs++ = *as++ ^ *bs++;
- while (rs < topr) *rs++ = *as++;
- break;
- }
- Icheck(r);
- return r;
-}
-
-
-
-IntRep* compl(const IntRep* src, IntRep* r)
-{
- nonnil(src);
- r = Icopy(r, src);
- unsigned short* s = r->s;
- unsigned short* top = &(s[r->len - 1]);
- while (s < top)
- {
- unsigned short cmp = ~(*s);
- *s++ = cmp;
- }
- unsigned short a = *s;
- unsigned short b = 0;
- while (a != 0)
- {
- b <<= 1;
- if (!(a & 1)) b |= 1;
- a >>= 1;
- }
- *s = b;
- Icheck(r);
- return r;
-}
-
-void (setbit)(Integer& x, long b)
-{
- if (b >= 0)
- {
- int bw = (unsigned long)b / I_SHIFT;
- int sw = (unsigned long)b % I_SHIFT;
- int xl = x.rep ? x.rep->len : 0;
- if (xl <= bw)
- x.rep = Iresize(x.rep, calc_len(xl, bw+1, 0));
- x.rep->s[bw] |= (1 << sw);
- Icheck(x.rep);
- }
-}
-
-void clearbit(Integer& x, long b)
-{
- if (b >= 0)
- {
- if (x.rep == 0)
- x.rep = &_ZeroRep;
- else
- {
- int bw = (unsigned long)b / I_SHIFT;
- int sw = (unsigned long)b % I_SHIFT;
- if (x.rep->len > bw)
- x.rep->s[bw] &= ~(1 << sw);
- }
- Icheck(x.rep);
- }
-}
-
-int testbit(const Integer& x, long b)
-{
- if (x.rep != 0 && b >= 0)
- {
- int bw = (unsigned long)b / I_SHIFT;
- int sw = (unsigned long)b % I_SHIFT;
- return (bw < x.rep->len && (x.rep->s[bw] & (1 << sw)) != 0);
- }
- else
- return 0;
-}
-
-// A version of knuth's algorithm B / ex. 4.5.3.34
-// A better version that doesn't bother shifting all of `t' forthcoming
-
-IntRep* gcd(const IntRep* x, const IntRep* y)
-{
- nonnil(x);
- nonnil(y);
- int ul = x->len;
- int vl = y->len;
-
- if (vl == 0)
- return Ialloc(0, x->s, ul, I_POSITIVE, ul);
- else if (ul == 0)
- return Ialloc(0, y->s, vl, I_POSITIVE, vl);
-
- IntRep* u = Ialloc(0, x->s, ul, I_POSITIVE, ul);
- IntRep* v = Ialloc(0, y->s, vl, I_POSITIVE, vl);
-
-// find shift so that both not even
-
- long k = 0;
- int l = (ul <= vl)? ul : vl;
- int cont = 1;
- for (int i = 0; i < l && cont; ++i)
- {
- unsigned long a = (i < ul)? u->s[i] : 0;
- unsigned long b = (i < vl)? v->s[i] : 0;
- for (int j = 0; j < I_SHIFT; ++j)
- {
- if ((a | b) & 1)
- {
- cont = 0;
- break;
- }
- else
- {
- ++k;
- a >>= 1;
- b >>= 1;
- }
- }
- }
-
- if (k != 0)
- {
- u = lshift(u, -k, u);
- v = lshift(v, -k, v);
- }
-
- IntRep* t;
- if (u->s[0] & 01)
- t = Ialloc(0, v->s, v->len, !v->sgn, v->len);
- else
- t = Ialloc(0, u->s, u->len, u->sgn, u->len);
-
- while (t->len != 0)
- {
- long s = 0; // shift t until odd
- cont = 1;
- int tl = t->len;
- for (int i = 0; i < tl && cont; ++i)
- {
- unsigned long a = t->s[i];
- for (int j = 0; j < I_SHIFT; ++j)
- {
- if (a & 1)
- {
- cont = 0;
- break;
- }
- else
- {
- ++s;
- a >>= 1;
- }
- }
- }
-
- if (s != 0) t = lshift(t, -s, t);
-
- if (t->sgn == I_POSITIVE)
- {
- u = Icopy(u, t);
- t = add(t, 0, v, 1, t);
- }
- else
- {
- v = Ialloc(v, t->s, t->len, !t->sgn, t->len);
- t = add(t, 0, u, 0, t);
- }
- }
- if (!STATIC_IntRep(t)) delete t;
- if (!STATIC_IntRep(v)) delete v;
- if (k != 0) u = lshift(u, k, u);
- return u;
-}
-
-
-
-long lg(const IntRep* x)
-{
- nonnil(x);
- int xl = x->len;
- if (xl == 0)
- return 0;
-
- long l = (xl - 1) * I_SHIFT - 1;
- unsigned short a = x->s[xl-1];
-
- while (a != 0)
- {
- a = a >> 1;
- ++l;
- }
- return l;
-}
-
-IntRep* power(const IntRep* x, long y, IntRep* r)
-{
- nonnil(x);
- int sgn;
- if (x->sgn == I_POSITIVE || (!(y & 1)))
- sgn = I_POSITIVE;
- else
- sgn = I_NEGATIVE;
-
- int xl = x->len;
-
- if (y == 0 || (xl == 1 && x->s[0] == 1))
- r = Icopy_one(r, sgn);
- else if (xl == 0 || y < 0)
- r = Icopy_zero(r);
- else if (y == 1 || y == -1)
- r = Icopy(r, x);
- else
- {
- int maxsize = ((lg(x) + 1) * y) / I_SHIFT + 2; // pre-allocate space
- IntRep* b = Ialloc(0, x->s, xl, I_POSITIVE, maxsize);
- b->len = xl;
- r = Icalloc(r, maxsize);
- r = Icopy_one(r, I_POSITIVE);
- for(;;)
- {
- if (y & 1)
- r = multiply(r, b, r);
- if ((y >>= 1) == 0)
- break;
- else
- b = multiply(b, b, b);
- }
- if (!STATIC_IntRep(b)) delete b;
- }
- r->sgn = sgn;
- Icheck(r);
- return r;
-}
-
-IntRep* abs(const IntRep* src, IntRep* dest)
-{
- nonnil(src);
- if (src != dest)
- dest = Icopy(dest, src);
- dest->sgn = I_POSITIVE;
- return dest;
-}
-
-IntRep* negate(const IntRep* src, IntRep* dest)
-{
- nonnil(src);
- if (src != dest)
- dest = Icopy(dest, src);
- if (dest->len != 0)
- dest->sgn = !dest->sgn;
- return dest;
-}
-
-#if defined(__GNUG__) && !defined(_G_NO_NRV)
-
-Integer sqrt(const Integer& x) return r(x)
-{
- int s = sign(x);
- if (s < 0) x.error("Attempted square root of negative Integer");
- if (s != 0)
- {
- r >>= (lg(x) / 2); // get close
- Integer q;
- div(x, r, q);
- while (q < r)
- {
- r += q;
- r >>= 1;
- div(x, r, q);
- }
- }
- return;
-}
-
-Integer lcm(const Integer& x, const Integer& y) return r
-{
- if (!x.initialized() || !y.initialized())
- x.error("operation on uninitialized Integer");
- Integer g;
- if (sign(x) == 0 || sign(y) == 0)
- g = 1;
- else
- g = gcd(x, y);
- div(x, g, r);
- mul(r, y, r);
-}
-
-#else
-Integer sqrt(const Integer& x)
-{
- Integer r(x);
- int s = sign(x);
- if (s < 0) x.error("Attempted square root of negative Integer");
- if (s != 0)
- {
- r >>= (lg(x) / 2); // get close
- Integer q;
- div(x, r, q);
- while (q < r)
- {
- r += q;
- r >>= 1;
- div(x, r, q);
- }
- }
- return r;
-}
-
-Integer lcm(const Integer& x, const Integer& y)
-{
- Integer r;
- if (!x.initialized() || !y.initialized())
- x.error("operation on uninitialized Integer");
- Integer g;
- if (sign(x) == 0 || sign(y) == 0)
- g = 1;
- else
- g = gcd(x, y);
- div(x, g, r);
- mul(r, y, r);
- return r;
-}
-
-#endif
-
-
-
-IntRep* atoIntRep(const char* s, int base)
-{
- int sl = strlen(s);
- IntRep* r = Icalloc(0, sl * (lg(base) + 1) / I_SHIFT + 1);
- if (s != 0)
- {
- char sgn;
- while (isspace(*s)) ++s;
- if (*s == '-')
- {
- sgn = I_NEGATIVE;
- s++;
- }
- else if (*s == '+')
- {
- sgn = I_POSITIVE;
- s++;
- }
- else
- sgn = I_POSITIVE;
- for (;;)
- {
- long digit;
- if (*s >= '0' && *s <= '9') digit = *s - '0';
- else if (*s >= 'a' && *s <= 'z') digit = *s - 'a' + 10;
- else if (*s >= 'A' && *s <= 'Z') digit = *s - 'A' + 10;
- else break;
- if (digit >= base) break;
- r = multiply(r, base, r);
- r = add(r, 0, digit, r);
- ++s;
- }
- r->sgn = sgn;
- }
- return r;
-}
-
-
-
-extern AllocRing _libgxx_fmtq;
-
-char* Itoa(const IntRep* x, int base, int width)
-{
- int fmtlen = (x->len + 1) * I_SHIFT / lg(base) + 4 + width;
- char* fmtbase = (char *) _libgxx_fmtq.alloc(fmtlen);
- char* f = cvtItoa(x, fmtbase, fmtlen, base, 0, width, 0, ' ', 'X', 0);
- return f;
-}
-
-ostream& operator << (ostream& s, const Integer& y)
-{
-#ifdef _OLD_STREAMS
- return s << Itoa(y.rep);
-#else
- if (s.opfx())
- {
- int base = (s.flags() & ios::oct) ? 8 : (s.flags() & ios::hex) ? 16 : 10;
- int width = s.width();
- y.printon(s, base, width);
- }
- return s;
-#endif
-}
-
-void Integer::printon(ostream& s, int base /* =10 */, int width /* =0 */) const
-{
- int align_right = !(s.flags() & ios::left);
- int showpos = s.flags() & ios::showpos;
- int showbase = s.flags() & ios::showbase;
- char fillchar = s.fill();
- char Xcase = (s.flags() & ios::uppercase)? 'X' : 'x';
- const IntRep* x = rep;
- int fmtlen = (x->len + 1) * I_SHIFT / lg(base) + 4 + width;
- char* fmtbase = new char[fmtlen];
- char* f = cvtItoa(x, fmtbase, fmtlen, base, showbase, width, align_right,
- fillchar, Xcase, showpos);
- s.write(f, fmtlen);
- delete [] fmtbase;
-}
-
-char* cvtItoa(const IntRep* x, char* fmt, int& fmtlen, int base, int showbase,
- int width, int align_right, char fillchar, char Xcase,
- int showpos)
-{
- char* e = fmt + fmtlen - 1;
- char* s = e;
- *--s = 0;
-
- if (x->len == 0)
- *--s = '0';
- else
- {
- IntRep* z = Icopy(0, x);
-
- // split division by base into two parts:
- // first divide by biggest power of base that fits in an unsigned short,
- // then use straight signed div/mods from there.
-
- // find power
- int bpower = 1;
- unsigned short b = base;
- unsigned short maxb = I_MAXNUM / base;
- while (b < maxb)
- {
- b *= base;
- ++bpower;
- }
- for(;;)
- {
- int rem = unscale(z->s, z->len, b, z->s);
- Icheck(z);
- if (z->len == 0)
- {
- while (rem != 0)
- {
- char ch = rem % base;
- rem /= base;
- if (ch >= 10)
- ch += 'a' - 10;
- else
- ch += '0';
- *--s = ch;
- }
- if (!STATIC_IntRep(z)) delete z;
- break;
- }
- else
- {
- for (int i = 0; i < bpower; ++i)
- {
- char ch = rem % base;
- rem /= base;
- if (ch >= 10)
- ch += 'a' - 10;
- else
- ch += '0';
- *--s = ch;
- }
- }
- }
- }
-
- if (base == 8 && showbase)
- *--s = '0';
- else if (base == 16 && showbase)
- {
- *--s = Xcase;
- *--s = '0';
- }
- if (x->sgn == I_NEGATIVE) *--s = '-';
- else if (showpos) *--s = '+';
- int w = e - s - 1;
- if (!align_right || w >= width)
- {
- while (w++ < width)
- *--s = fillchar;
- fmtlen = e - s - 1;
- return s;
- }
- else
- {
- char* p = fmt;
- for (char* t = s; *t != 0; ++t, ++p) *p = *t;
- while (w++ < width) *p++ = fillchar;
- *p = 0;
- fmtlen = p - fmt;
- return fmt;
- }
-}
-
-char* dec(const Integer& x, int width)
-{
- return Itoa(x, 10, width);
-}
-
-char* oct(const Integer& x, int width)
-{
- return Itoa(x, 8, width);
-}
-
-char* hex(const Integer& x, int width)
-{
- return Itoa(x, 16, width);
-}
-
-istream& operator >> (istream& stream, Integer& val)
-{
- if (!stream.ipfx0())
- return stream;
- int sign = ' ';
- register streambuf* sb = stream.rdbuf();
- int base = 10;
- int ndigits = 0;
- register int ch = sb->sbumpc();
- while (ch != EOF && isspace(ch))
- ch = sb->sbumpc();
- if (ch == '+' || ch == '-')
- {
- sign = ch;
- ch = sb->sbumpc();
- while (ch != EOF && isspace(ch))
- ch = sb->sbumpc();
- }
- if (ch == EOF) goto eof_fail;
- if (!(stream.flags() & ios::basefield))
- {
- if (ch == '0')
- {
- ch = sb->sbumpc();
- if (ch == EOF) { }
- else if (ch == 'x' || ch == 'X')
- {
- base = 16;
- ch = sb->sbumpc();
- if (ch == EOF) goto eof_fail;
- }
- else
- {
- sb->sputbackc(ch);
- base = 8;
- ch = '0';
- }
- }
- }
- else if ((stream.flags() & ios::basefield) == ios::hex)
- base = 16;
- else if ((stream.flags() & ios::basefield) == ios::oct)
- base = 8;
-
- val.rep = Icopy_zero(val.rep);
-
- for (;;)
- {
- if (ch == EOF)
- break;
- int digit;
- if (ch >= '0' && ch <= '9')
- digit = ch - '0';
- else if (ch >= 'A' && ch <= 'F')
- digit = ch - 'A' + 10;
- else if (ch >= 'a' && ch <= 'f')
- digit = ch - 'a' + 10;
- else
- digit = 999;
- if (digit >= base)
- {
- sb->sputbackc(ch);
- if (ndigits == 0)
- goto fail;
- else
- goto done;
- }
- ndigits++;
- switch (base)
- {
- case 8:
- val <<= 3;
- break;
- case 16:
- val <<= 4;
- break;
- default:
- val *= base;
- break;
- }
- val += digit;
- ch = sb->sbumpc();
- }
- fail:
- stream.set(ios::failbit);
- done:
- if (sign == '-')
- val.negate();
- return stream;
- eof_fail:
- stream.set(ios::failbit|ios::eofbit);
- return stream;
-}
-
-int Integer::OK() const
-{
- if (rep != 0)
- {
- int l = rep->len;
- int s = rep->sgn;
- int v = l <= rep->sz || STATIC_IntRep(rep); // length within bounds
- v &= s == 0 || s == 1; // legal sign
- Icheck(rep); // and correctly adjusted
- v &= rep->len == l;
- v &= rep->sgn == s;
- if (v)
- return v;
- }
- error("invariant failure");
- return 0;
-}
-
-void Integer::error(const char* msg) const
-{
- (*lib_error_handler)("Integer", msg);
-}
-
diff --git a/contrib/libg++/libg++/src/Integer.h b/contrib/libg++/libg++/src/Integer.h
deleted file mode 100644
index b98a349272c8..000000000000
--- a/contrib/libg++/libg++/src/Integer.h
+++ /dev/null
@@ -1,1134 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifndef _Integer_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _Integer_h 1
-
-#include <iostream.h>
-
-#undef OK
-
-struct IntRep // internal Integer representations
-{
- unsigned short len; // current length
- unsigned short sz; // allocated space (0 means static).
- short sgn; // 1 means >= 0; 0 means < 0
- unsigned short s[1]; // represented as ushort array starting here
-};
-
-// True if REP is staticly (or manually) allocated,
-// and should not be deleted by an Integer destructor.
-#define STATIC_IntRep(rep) ((rep)->sz==0)
-
-extern IntRep* Ialloc(IntRep*, const unsigned short *, int, int, int);
-extern IntRep* Icalloc(IntRep*, int);
-extern IntRep* Icopy_ulong(IntRep*, unsigned long);
-extern IntRep* Icopy_long(IntRep*, long);
-extern IntRep* Icopy(IntRep*, const IntRep*);
-extern IntRep* Iresize(IntRep*, int);
-extern IntRep* add(const IntRep*, int, const IntRep*, int, IntRep*);
-extern IntRep* add(const IntRep*, int, long, IntRep*);
-extern IntRep* multiply(const IntRep*, const IntRep*, IntRep*);
-extern IntRep* multiply(const IntRep*, long, IntRep*);
-extern IntRep* lshift(const IntRep*, long, IntRep*);
-extern IntRep* lshift(const IntRep*, const IntRep*, int, IntRep*);
-extern IntRep* bitop(const IntRep*, const IntRep*, IntRep*, char);
-extern IntRep* bitop(const IntRep*, long, IntRep*, char);
-extern IntRep* power(const IntRep*, long, IntRep*);
-extern IntRep* div(const IntRep*, const IntRep*, IntRep*);
-extern IntRep* mod(const IntRep*, const IntRep*, IntRep*);
-extern IntRep* div(const IntRep*, long, IntRep*);
-extern IntRep* mod(const IntRep*, long, IntRep*);
-extern IntRep* compl(const IntRep*, IntRep*);
-extern IntRep* abs(const IntRep*, IntRep*);
-extern IntRep* negate(const IntRep*, IntRep*);
-extern IntRep* pow(const IntRep*, long);
-extern IntRep* gcd(const IntRep*, const IntRep* y);
-extern int compare(const IntRep*, const IntRep*);
-extern int compare(const IntRep*, long);
-extern int ucompare(const IntRep*, const IntRep*);
-extern int ucompare(const IntRep*, long);
-extern char* Itoa(const IntRep* x, int base = 10, int width = 0);
-extern char* cvtItoa(const IntRep* x, char* fmt, int& fmtlen, int base,
- int showbase, int width, int align_right,
- char fillchar, char Xcase, int showpos);
-extern IntRep* atoIntRep(const char* s, int base = 10);
-extern long Itolong(const IntRep*);
-extern int Iislong(const IntRep*);
-extern long lg(const IntRep*);
-
-extern IntRep _ZeroRep, _OneRep, _MinusOneRep;
-
-class Integer
-{
-protected:
- IntRep* rep;
-public:
- Integer();
- Integer(int);
- Integer(long);
- Integer(unsigned long);
- Integer(IntRep*);
- Integer(const Integer&);
-
- ~Integer();
- Integer& operator = (const Integer&);
- Integer& operator = (long);
-
-// unary operations to self
-
- Integer& operator ++ ();
- Integer& operator -- ();
- void negate(); // negate in-place
- void abs(); // absolute-value in-place
- void complement(); // bitwise complement in-place
-
-// assignment-based operations
-
- Integer& operator += (const Integer&);
- Integer& operator -= (const Integer&);
- Integer& operator *= (const Integer&);
- Integer& operator /= (const Integer&);
- Integer& operator %= (const Integer&);
- Integer& operator <<=(const Integer&);
- Integer& operator >>=(const Integer&);
- Integer& operator &= (const Integer&);
- Integer& operator |= (const Integer&);
- Integer& operator ^= (const Integer&);
-
- Integer& operator += (long);
- Integer& operator -= (long);
- Integer& operator *= (long);
- Integer& operator /= (long);
- Integer& operator %= (long);
- Integer& operator <<=(long);
- Integer& operator >>=(long);
- Integer& operator &= (long);
- Integer& operator |= (long);
- Integer& operator ^= (long);
-
-// (constructive binary operations are inlined below)
-
-#if defined (__GNUG__) && ! defined (__STRICT_ANSI__)
- friend Integer operator <? (const Integer& x, const Integer& y); // min
- friend Integer operator >? (const Integer& x, const Integer& y); // max
-#endif
-
-// builtin Integer functions that must be friends
-
- friend long lg (const Integer&); // floor log base 2 of abs(x)
- friend double ratio(const Integer& x, const Integer& y);
- // return x/y as a double
-
- friend Integer gcd(const Integer&, const Integer&);
- friend int even(const Integer&); // true if even
- friend int odd(const Integer&); // true if odd
- friend int sign(const Integer&); // returns -1, 0, +1
-
- friend void (setbit)(Integer& x, long b); // set b'th bit of x
- friend void clearbit(Integer& x, long b); // clear b'th bit
- friend int testbit(const Integer& x, long b); // return b'th bit
-
-// procedural versions of operators
-
- friend void abs(const Integer& x, Integer& dest);
- friend void negate(const Integer& x, Integer& dest);
- friend void complement(const Integer& x, Integer& dest);
-
- friend int compare(const Integer&, const Integer&);
- friend int ucompare(const Integer&, const Integer&);
- friend void add(const Integer& x, const Integer& y, Integer& dest);
- friend void sub(const Integer& x, const Integer& y, Integer& dest);
- friend void mul(const Integer& x, const Integer& y, Integer& dest);
- friend void div(const Integer& x, const Integer& y, Integer& dest);
- friend void mod(const Integer& x, const Integer& y, Integer& dest);
- friend void divide(const Integer& x, const Integer& y,
- Integer& q, Integer& r);
-#ifndef __STRICT_ANSI__
- friend void and(const Integer& x, const Integer& y, Integer& dest);
- friend void or(const Integer& x, const Integer& y, Integer& dest);
- friend void xor(const Integer& x, const Integer& y, Integer& dest);
-#endif
- friend void lshift(const Integer& x, const Integer& y, Integer& dest);
- friend void rshift(const Integer& x, const Integer& y, Integer& dest);
- friend void pow(const Integer& x, const Integer& y, Integer& dest);
-
- friend int compare(const Integer&, long);
- friend int ucompare(const Integer&, long);
- friend void add(const Integer& x, long y, Integer& dest);
- friend void sub(const Integer& x, long y, Integer& dest);
- friend void mul(const Integer& x, long y, Integer& dest);
- friend void div(const Integer& x, long y, Integer& dest);
- friend void mod(const Integer& x, long y, Integer& dest);
- friend void divide(const Integer& x, long y, Integer& q, long& r);
-#ifndef __STRICT_ANSI__
- friend void and(const Integer& x, long y, Integer& dest);
- friend void or(const Integer& x, long y, Integer& dest);
- friend void xor(const Integer& x, long y, Integer& dest);
-#endif
- friend void lshift(const Integer& x, long y, Integer& dest);
- friend void rshift(const Integer& x, long y, Integer& dest);
- friend void pow(const Integer& x, long y, Integer& dest);
-
- friend int compare(long, const Integer&);
- friend int ucompare(long, const Integer&);
- friend void add(long x, const Integer& y, Integer& dest);
- friend void sub(long x, const Integer& y, Integer& dest);
- friend void mul(long x, const Integer& y, Integer& dest);
-#ifndef __STRICT_ANSI__
- friend void and(long x, const Integer& y, Integer& dest);
- friend void or(long x, const Integer& y, Integer& dest);
- friend void xor(long x, const Integer& y, Integer& dest);
-#endif
-
- friend Integer operator & (const Integer&, const Integer&);
- friend Integer operator & (const Integer&, long);
- friend Integer operator & (long, const Integer&);
- friend Integer operator | (const Integer&, const Integer&);
- friend Integer operator | (const Integer&, long);
- friend Integer operator | (long, const Integer&);
- friend Integer operator ^ (const Integer&, const Integer&);
- friend Integer operator ^ (const Integer&, long);
- friend Integer operator ^ (long, const Integer&);
-
-// coercion & conversion
-
- int fits_in_long() const { return Iislong(rep); }
- int fits_in_double() const;
-
- long as_long() const { return Itolong(rep); }
- double as_double() const;
-
- friend char* Itoa(const Integer& x, int base = 10, int width = 0);
- friend Integer atoI(const char* s, int base = 10);
- void printon(ostream& s, int base = 10, int width = 0) const;
-
- friend istream& operator >> (istream& s, Integer& y);
- friend ostream& operator << (ostream& s, const Integer& y);
-
-// error detection
-
- int initialized() const;
- void error(const char* msg) const;
- int OK() const;
-};
-
-
-// (These are declared inline)
-
- int operator == (const Integer&, const Integer&);
- int operator == (const Integer&, long);
- int operator != (const Integer&, const Integer&);
- int operator != (const Integer&, long);
- int operator < (const Integer&, const Integer&);
- int operator < (const Integer&, long);
- int operator <= (const Integer&, const Integer&);
- int operator <= (const Integer&, long);
- int operator > (const Integer&, const Integer&);
- int operator > (const Integer&, long);
- int operator >= (const Integer&, const Integer&);
- int operator >= (const Integer&, long);
- Integer operator - (const Integer&);
- Integer operator ~ (const Integer&);
- Integer operator + (const Integer&, const Integer&);
- Integer operator + (const Integer&, long);
- Integer operator + (long, const Integer&);
- Integer operator - (const Integer&, const Integer&);
- Integer operator - (const Integer&, long);
- Integer operator - (long, const Integer&);
- Integer operator * (const Integer&, const Integer&);
- Integer operator * (const Integer&, long);
- Integer operator * (long, const Integer&);
- Integer operator / (const Integer&, const Integer&);
- Integer operator / (const Integer&, long);
- Integer operator % (const Integer&, const Integer&);
- Integer operator % (const Integer&, long);
- Integer operator << (const Integer&, const Integer&);
- Integer operator << (const Integer&, long);
- Integer operator >> (const Integer&, const Integer&);
- Integer operator >> (const Integer&, long);
-
- Integer abs(const Integer&); // absolute value
- Integer sqr(const Integer&); // square
-
- Integer pow(const Integer& x, const Integer& y);
- Integer pow(const Integer& x, long y);
- Integer Ipow(long x, long y); // x to the y as Integer
-
-
-extern char* dec(const Integer& x, int width = 0);
-extern char* oct(const Integer& x, int width = 0);
-extern char* hex(const Integer& x, int width = 0);
-extern Integer sqrt(const Integer&); // floor of square root
-extern Integer lcm(const Integer& x, const Integer& y); // least common mult
-
-
-typedef Integer IntTmp; // for backward compatibility
-
-inline Integer::Integer() :rep(&_ZeroRep) {}
-
-inline Integer::Integer(IntRep* r) :rep(r) {}
-
-inline Integer::Integer(int y) :rep(Icopy_long(0, (long)y)) {}
-
-inline Integer::Integer(long y) :rep(Icopy_long(0, y)) {}
-
-inline Integer::Integer(unsigned long y) :rep(Icopy_ulong(0, y)) {}
-
-inline Integer::Integer(const Integer& y) :rep(Icopy(0, y.rep)) {}
-
-inline Integer::~Integer() { if (rep && !STATIC_IntRep(rep)) delete rep; }
-
-inline Integer& Integer::operator = (const Integer& y)
-{
- rep = Icopy(rep, y.rep);
- return *this;
-}
-
-inline Integer& Integer::operator = (long y)
-{
- rep = Icopy_long(rep, y);
- return *this;
-}
-
-inline int Integer::initialized() const
-{
- return rep != 0;
-}
-
-// procedural versions
-
-inline int compare(const Integer& x, const Integer& y)
-{
- return compare(x.rep, y.rep);
-}
-
-inline int ucompare(const Integer& x, const Integer& y)
-{
- return ucompare(x.rep, y.rep);
-}
-
-inline int compare(const Integer& x, long y)
-{
- return compare(x.rep, y);
-}
-
-inline int ucompare(const Integer& x, long y)
-{
- return ucompare(x.rep, y);
-}
-
-inline int compare(long x, const Integer& y)
-{
- return -compare(y.rep, x);
-}
-
-inline int ucompare(long x, const Integer& y)
-{
- return -ucompare(y.rep, x);
-}
-
-inline void add(const Integer& x, const Integer& y, Integer& dest)
-{
- dest.rep = add(x.rep, 0, y.rep, 0, dest.rep);
-}
-
-inline void sub(const Integer& x, const Integer& y, Integer& dest)
-{
- dest.rep = add(x.rep, 0, y.rep, 1, dest.rep);
-}
-
-inline void mul(const Integer& x, const Integer& y, Integer& dest)
-{
- dest.rep = multiply(x.rep, y.rep, dest.rep);
-}
-
-inline void div(const Integer& x, const Integer& y, Integer& dest)
-{
- dest.rep = div(x.rep, y.rep, dest.rep);
-}
-
-inline void mod(const Integer& x, const Integer& y, Integer& dest)
-{
- dest.rep = mod(x.rep, y.rep, dest.rep);
-}
-
-#ifndef __STRICT_ANSI__
-inline void and(const Integer& x, const Integer& y, Integer& dest)
-{
- dest.rep = bitop(x.rep, y.rep, dest.rep, '&');
-}
-
-inline void or(const Integer& x, const Integer& y, Integer& dest)
-{
- dest.rep = bitop(x.rep, y.rep, dest.rep, '|');
-}
-
-inline void xor(const Integer& x, const Integer& y, Integer& dest)
-{
- dest.rep = bitop(x.rep, y.rep, dest.rep, '^');
-}
-#endif
-
-inline void lshift(const Integer& x, const Integer& y, Integer& dest)
-{
- dest.rep = lshift(x.rep, y.rep, 0, dest.rep);
-}
-
-inline void rshift(const Integer& x, const Integer& y, Integer& dest)
-{
- dest.rep = lshift(x.rep, y.rep, 1, dest.rep);
-}
-
-inline void pow(const Integer& x, const Integer& y, Integer& dest)
-{
- dest.rep = power(x.rep, Itolong(y.rep), dest.rep); // not incorrect
-}
-
-inline void add(const Integer& x, long y, Integer& dest)
-{
- dest.rep = add(x.rep, 0, y, dest.rep);
-}
-
-inline void sub(const Integer& x, long y, Integer& dest)
-{
- dest.rep = add(x.rep, 0, -y, dest.rep);
-}
-
-inline void mul(const Integer& x, long y, Integer& dest)
-{
- dest.rep = multiply(x.rep, y, dest.rep);
-}
-
-inline void div(const Integer& x, long y, Integer& dest)
-{
- dest.rep = div(x.rep, y, dest.rep);
-}
-
-inline void mod(const Integer& x, long y, Integer& dest)
-{
- dest.rep = mod(x.rep, y, dest.rep);
-}
-
-#ifndef __STRICT_ANSI__
-inline void and(const Integer& x, long y, Integer& dest)
-{
- dest.rep = bitop(x.rep, y, dest.rep, '&');
-}
-
-inline void or(const Integer& x, long y, Integer& dest)
-{
- dest.rep = bitop(x.rep, y, dest.rep, '|');
-}
-
-inline void xor(const Integer& x, long y, Integer& dest)
-{
- dest.rep = bitop(x.rep, y, dest.rep, '^');
-}
-#endif
-
-inline void lshift(const Integer& x, long y, Integer& dest)
-{
- dest.rep = lshift(x.rep, y, dest.rep);
-}
-
-inline void rshift(const Integer& x, long y, Integer& dest)
-{
- dest.rep = lshift(x.rep, -y, dest.rep);
-}
-
-inline void pow(const Integer& x, long y, Integer& dest)
-{
- dest.rep = power(x.rep, y, dest.rep);
-}
-
-inline void abs(const Integer& x, Integer& dest)
-{
- dest.rep = abs(x.rep, dest.rep);
-}
-
-inline void negate(const Integer& x, Integer& dest)
-{
- dest.rep = negate(x.rep, dest.rep);
-}
-
-inline void complement(const Integer& x, Integer& dest)
-{
- dest.rep = compl(x.rep, dest.rep);
-}
-
-inline void add(long x, const Integer& y, Integer& dest)
-{
- dest.rep = add(y.rep, 0, x, dest.rep);
-}
-
-inline void sub(long x, const Integer& y, Integer& dest)
-{
- dest.rep = add(y.rep, 1, x, dest.rep);
-}
-
-inline void mul(long x, const Integer& y, Integer& dest)
-{
- dest.rep = multiply(y.rep, x, dest.rep);
-}
-
-#ifndef __STRICT_ANSI__
-inline void and(long x, const Integer& y, Integer& dest)
-{
- dest.rep = bitop(y.rep, x, dest.rep, '&');
-}
-
-inline void or(long x, const Integer& y, Integer& dest)
-{
- dest.rep = bitop(y.rep, x, dest.rep, '|');
-}
-
-inline void xor(long x, const Integer& y, Integer& dest)
-{
- dest.rep = bitop(y.rep, x, dest.rep, '^');
-}
-#endif
-
-
-// operator versions
-
-inline int operator == (const Integer& x, const Integer& y)
-{
- return compare(x, y) == 0;
-}
-
-inline int operator == (const Integer& x, long y)
-{
- return compare(x, y) == 0;
-}
-
-inline int operator != (const Integer& x, const Integer& y)
-{
- return compare(x, y) != 0;
-}
-
-inline int operator != (const Integer& x, long y)
-{
- return compare(x, y) != 0;
-}
-
-inline int operator < (const Integer& x, const Integer& y)
-{
- return compare(x, y) < 0;
-}
-
-inline int operator < (const Integer& x, long y)
-{
- return compare(x, y) < 0;
-}
-
-inline int operator <= (const Integer& x, const Integer& y)
-{
- return compare(x, y) <= 0;
-}
-
-inline int operator <= (const Integer& x, long y)
-{
- return compare(x, y) <= 0;
-}
-
-inline int operator > (const Integer& x, const Integer& y)
-{
- return compare(x, y) > 0;
-}
-
-inline int operator > (const Integer& x, long y)
-{
- return compare(x, y) > 0;
-}
-
-inline int operator >= (const Integer& x, const Integer& y)
-{
- return compare(x, y) >= 0;
-}
-
-inline int operator >= (const Integer& x, long y)
-{
- return compare(x, y) >= 0;
-}
-
-
-inline Integer& Integer::operator += (const Integer& y)
-{
- add(*this, y, *this);
- return *this;
-}
-
-inline Integer& Integer::operator += (long y)
-{
- add(*this, y, *this);
- return *this;
-}
-
-inline Integer& Integer::operator ++ ()
-{
- add(*this, 1, *this);
- return *this;
-}
-
-
-inline Integer& Integer::operator -= (const Integer& y)
-{
- sub(*this, y, *this);
- return *this;
-}
-
-inline Integer& Integer::operator -= (long y)
-{
- sub(*this, y, *this);
- return *this;
-}
-
-inline Integer& Integer::operator -- ()
-{
- add(*this, -1, *this);
- return *this;
-}
-
-
-
-inline Integer& Integer::operator *= (const Integer& y)
-{
- mul(*this, y, *this);
- return *this;
-}
-
-inline Integer& Integer::operator *= (long y)
-{
- mul(*this, y, *this);
- return *this;
-}
-
-
-inline Integer& Integer::operator &= (const Integer& y)
-{
- rep = bitop(rep, y.rep, rep, '&');
- return *this;
-}
-
-inline Integer& Integer::operator &= (long y)
-{
- rep = bitop(rep, y, rep, '&');
- return *this;
-}
-
-inline Integer& Integer::operator |= (const Integer& y)
-{
- rep = bitop(rep, y.rep, rep, '|');
- return *this;
-}
-
-inline Integer& Integer::operator |= (long y)
-{
- rep = bitop(rep, y, rep, '|');
- return *this;
-}
-
-
-inline Integer& Integer::operator ^= (const Integer& y)
-{
- rep = bitop(rep, y.rep, rep, '^');
- return *this;
-}
-
-inline Integer& Integer::operator ^= (long y)
-{
- rep = bitop(rep, y, rep, '^');
- return *this;
-}
-
-
-
-inline Integer& Integer::operator /= (const Integer& y)
-{
- div(*this, y, *this);
- return *this;
-}
-
-inline Integer& Integer::operator /= (long y)
-{
- div(*this, y, *this);
- return *this;
-}
-
-
-inline Integer& Integer::operator <<= (const Integer& y)
-{
- lshift(*this, y, *this);
- return *this;
-}
-
-inline Integer& Integer::operator <<= (long y)
-{
- lshift(*this, y, *this);
- return *this;
-}
-
-
-inline Integer& Integer::operator >>= (const Integer& y)
-{
- rshift(*this, y, *this);
- return *this;
-}
-
-inline Integer& Integer::operator >>= (long y)
-{
- rshift(*this, y, *this);
- return *this;
-}
-
-#if defined (__GNUG__) && ! defined (__STRICT_ANSI__)
-inline Integer operator <? (const Integer& x, const Integer& y)
-{
- return (compare(x.rep, y.rep) <= 0) ? x : y;
-}
-
-inline Integer operator >? (const Integer& x, const Integer& y)
-{
- return (compare(x.rep, y.rep) >= 0)? x : y;
-}
-#endif
-
-
-inline void Integer::abs()
-{
- ::abs(*this, *this);
-}
-
-inline void Integer::negate()
-{
- ::negate(*this, *this);
-}
-
-
-inline void Integer::complement()
-{
- ::complement(*this, *this);
-}
-
-
-inline int sign(const Integer& x)
-{
- return (x.rep->len == 0) ? 0 : ( (x.rep->sgn == 1) ? 1 : -1 );
-}
-
-inline int even(const Integer& y)
-{
- return y.rep->len == 0 || !(y.rep->s[0] & 1);
-}
-
-inline int odd(const Integer& y)
-{
- return y.rep->len > 0 && (y.rep->s[0] & 1);
-}
-
-inline char* Itoa(const Integer& y, int base, int width)
-{
- return Itoa(y.rep, base, width);
-}
-
-
-
-inline long lg(const Integer& x)
-{
- return lg(x.rep);
-}
-
-// constructive operations
-
-#if defined(__GNUG__) && !defined(_G_NO_NRV)
-
-inline Integer operator + (const Integer& x, const Integer& y) return r
-{
- add(x, y, r);
-}
-
-inline Integer operator + (const Integer& x, long y) return r
-{
- add(x, y, r);
-}
-
-inline Integer operator + (long x, const Integer& y) return r
-{
- add(x, y, r);
-}
-
-inline Integer operator - (const Integer& x, const Integer& y) return r
-{
- sub(x, y, r);
-}
-
-inline Integer operator - (const Integer& x, long y) return r
-{
- sub(x, y, r);
-}
-
-inline Integer operator - (long x, const Integer& y) return r
-{
- sub(x, y, r);
-}
-
-inline Integer operator * (const Integer& x, const Integer& y) return r
-{
- mul(x, y, r);
-}
-
-inline Integer operator * (const Integer& x, long y) return r
-{
- mul(x, y, r);
-}
-
-inline Integer operator * (long x, const Integer& y) return r
-{
- mul(x, y, r);
-}
-
-inline Integer sqr(const Integer& x) return r
-{
- mul(x, x, r);
-}
-
-inline Integer operator & (const Integer& x, const Integer& y) return r
-{
- r.rep = bitop(x.rep, y.rep, r.rep, '&');
-}
-
-inline Integer operator & (const Integer& x, long y) return r
-{
- r.rep = bitop(x.rep, y, r.rep, '&');
-}
-
-inline Integer operator & (long x, const Integer& y) return r
-{
- r.rep = bitop(y.rep, x, r.rep, '&');
-}
-
-inline Integer operator | (const Integer& x, const Integer& y) return r
-{
- r.rep = bitop(x.rep, y.rep, r.rep, '|');
-}
-
-inline Integer operator | (const Integer& x, long y) return r
-{
- r.rep = bitop(x.rep, y, r.rep, '|');
-}
-
-inline Integer operator | (long x, const Integer& y) return r
-{
- r.rep = bitop(y.rep, x, r.rep, '|');
-}
-
-inline Integer operator ^ (const Integer& x, const Integer& y) return r
-{
- r.rep = bitop(x.rep, y.rep, r.rep, '^');
-}
-
-inline Integer operator ^ (const Integer& x, long y) return r
-{
- r.rep = bitop (x.rep, y, r.rep, '^');
-}
-
-inline Integer operator ^ (long x, const Integer& y) return r
-{
- r.rep = bitop (y.rep, x, r.rep, '^');
-}
-
-inline Integer operator / (const Integer& x, const Integer& y) return r
-{
- div(x, y, r);
-}
-
-inline Integer operator / (const Integer& x, long y) return r
-{
- div(x, y, r);
-}
-
-inline Integer operator % (const Integer& x, const Integer& y) return r
-{
- mod(x, y, r);
-}
-
-inline Integer operator % (const Integer& x, long y) return r
-{
- mod(x, y, r);
-}
-
-inline Integer operator << (const Integer& x, const Integer& y) return r
-{
- lshift(x, y, r);
-}
-
-inline Integer operator << (const Integer& x, long y) return r
-{
- lshift(x, y, r);
-}
-
-inline Integer operator >> (const Integer& x, const Integer& y) return r;
-{
- rshift(x, y, r);
-}
-
-inline Integer operator >> (const Integer& x, long y) return r
-{
- rshift(x, y, r);
-}
-
-inline Integer pow(const Integer& x, long y) return r
-{
- pow(x, y, r);
-}
-
-inline Integer Ipow(long x, long y) return r(x)
-{
- pow(r, y, r);
-}
-
-inline Integer pow(const Integer& x, const Integer& y) return r
-{
- pow(x, y, r);
-}
-
-
-
-inline Integer abs(const Integer& x) return r
-{
- abs(x, r);
-}
-
-inline Integer operator - (const Integer& x) return r
-{
- negate(x, r);
-}
-
-inline Integer operator ~ (const Integer& x) return r
-{
- complement(x, r);
-}
-
-inline Integer atoI(const char* s, int base) return r
-{
- r.rep = atoIntRep(s, base);
-}
-
-inline Integer gcd(const Integer& x, const Integer& y) return r
-{
- r.rep = gcd(x.rep, y.rep);
-}
-
-#else /* NO_NRV */
-
-inline Integer operator + (const Integer& x, const Integer& y)
-{
- Integer r; add(x, y, r); return r;
-}
-
-inline Integer operator + (const Integer& x, long y)
-{
- Integer r; add(x, y, r); return r;
-}
-
-inline Integer operator + (long x, const Integer& y)
-{
- Integer r; add(x, y, r); return r;
-}
-
-inline Integer operator - (const Integer& x, const Integer& y)
-{
- Integer r; sub(x, y, r); return r;
-}
-
-inline Integer operator - (const Integer& x, long y)
-{
- Integer r; sub(x, y, r); return r;
-}
-
-inline Integer operator - (long x, const Integer& y)
-{
- Integer r; sub(x, y, r); return r;
-}
-
-inline Integer operator * (const Integer& x, const Integer& y)
-{
- Integer r; mul(x, y, r); return r;
-}
-
-inline Integer operator * (const Integer& x, long y)
-{
- Integer r; mul(x, y, r); return r;
-}
-
-inline Integer operator * (long x, const Integer& y)
-{
- Integer r; mul(x, y, r); return r;
-}
-
-inline Integer sqr(const Integer& x)
-{
- Integer r; mul(x, x, r); return r;
-}
-
-inline Integer operator & (const Integer& x, const Integer& y)
-{
- Integer r; and(x, y, r); return r;
-}
-
-inline Integer operator & (const Integer& x, long y)
-{
- Integer r; and(x, y, r); return r;
-}
-
-inline Integer operator & (long x, const Integer& y)
-{
- Integer r; and(x, y, r); return r;
-}
-
-inline Integer operator | (const Integer& x, const Integer& y)
-{
- Integer r; or(x, y, r); return r;
-}
-
-inline Integer operator | (const Integer& x, long y)
-{
- Integer r; or(x, y, r); return r;
-}
-
-inline Integer operator | (long x, const Integer& y)
-{
- Integer r; or(x, y, r); return r;
-}
-
-inline Integer operator ^ (const Integer& x, const Integer& y)
-{
- Integer r; r.rep = bitop(x.rep, y.rep, r.rep, '^'); return r;
-}
-
-inline Integer operator ^ (const Integer& x, long y)
-{
- Integer r; r.rep = bitop(x.rep, y, r.rep, '^'); return r;
-}
-
-inline Integer operator ^ (long x, const Integer& y)
-{
- Integer r; r.rep = bitop(y.rep, x, r.rep, '^'); return r;
-}
-
-inline Integer operator / (const Integer& x, const Integer& y)
-{
- Integer r; div(x, y, r); return r;
-}
-
-inline Integer operator / (const Integer& x, long y)
-{
- Integer r; div(x, y, r); return r;
-}
-
-inline Integer operator % (const Integer& x, const Integer& y)
-{
- Integer r; mod(x, y, r); return r;
-}
-
-inline Integer operator % (const Integer& x, long y)
-{
- Integer r; mod(x, y, r); return r;
-}
-
-inline Integer operator << (const Integer& x, const Integer& y)
-{
- Integer r; lshift(x, y, r); return r;
-}
-
-inline Integer operator << (const Integer& x, long y)
-{
- Integer r; lshift(x, y, r); return r;
-}
-
-inline Integer operator >> (const Integer& x, const Integer& y)
-{
- Integer r; rshift(x, y, r); return r;
-}
-
-inline Integer operator >> (const Integer& x, long y)
-{
- Integer r; rshift(x, y, r); return r;
-}
-
-inline Integer pow(const Integer& x, long y)
-{
- Integer r; pow(x, y, r); return r;
-}
-
-inline Integer Ipow(long x, long y)
-{
- Integer r(x); pow(r, y, r); return r;
-}
-
-inline Integer pow(const Integer& x, const Integer& y)
-{
- Integer r; pow(x, y, r); return r;
-}
-
-
-
-inline Integer abs(const Integer& x)
-{
- Integer r; abs(x, r); return r;
-}
-
-inline Integer operator - (const Integer& x)
-{
- Integer r; negate(x, r); return r;
-}
-
-inline Integer operator ~ (const Integer& x)
-{
- Integer r; complement(x, r); return r;
-}
-
-inline Integer atoI(const char* s, int base)
-{
- Integer r; r.rep = atoIntRep(s, base); return r;
-}
-
-inline Integer gcd(const Integer& x, const Integer& y)
-{
- Integer r; r.rep = gcd(x.rep, y.rep); return r;
-}
-
-#endif /* NO_NRV */
-
-inline Integer& Integer::operator %= (const Integer& y)
-{
- *this = *this % y; // mod(*this, y, *this) doesn't work.
- return *this;
-}
-
-inline Integer& Integer::operator %= (long y)
-{
- *this = *this % y; // mod(*this, y, *this) doesn't work.
- return *this;
-}
-#endif /* !_Integer_h */
diff --git a/contrib/libg++/libg++/src/Integer.hP b/contrib/libg++/libg++/src/Integer.hP
deleted file mode 100644
index b8a803942656..000000000000
--- a/contrib/libg++/libg++/src/Integer.hP
+++ /dev/null
@@ -1,30 +0,0 @@
-// Stuff used to implement the Integer class.
-// WARNING: Its internals WILL change!
-
-/*
- Sizes of shifts for multiple-precision arithmetic.
- These should not be changed unless Integer representation
- as unsigned shorts is changed in the implementation files.
-*/
-
-#define I_SHIFT (sizeof(short) * CHAR_BIT)
-#define I_RADIX ((unsigned long)(1L << I_SHIFT))
-#define I_MAXNUM ((unsigned long)((I_RADIX - 1)))
-#define I_MINNUM ((unsigned long)(I_RADIX >> 1))
-#define I_POSITIVE 1
-#define I_NEGATIVE 0
-
-/* All routines assume SHORT_PER_LONG > 1 */
-#define SHORT_PER_LONG ((unsigned)(((sizeof(long) + sizeof(short) - 1) / sizeof(short))))
-#define CHAR_PER_LONG ((unsigned)sizeof(long))
-
-/*
- minimum and maximum sizes for an IntRep
-*/
-
-#define MINIntRep_SIZE 16
-#define MAXIntRep_SIZE I_MAXNUM
-
-#ifndef MALLOC_MIN_OVERHEAD
-#define MALLOC_MIN_OVERHEAD 4
-#endif
diff --git a/contrib/libg++/libg++/src/LogNorm.cc b/contrib/libg++/libg++/src/LogNorm.cc
deleted file mode 100644
index 446a9fe7f84f..000000000000
--- a/contrib/libg++/libg++/src/LogNorm.cc
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Dirk Grunwald (grunwald@cs.uiuc.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <builtin.h>
-#include <Random.h>
-#include <Normal.h>
-
-#include <LogNorm.h>
-
-//
-// See Simulation, Modelling & Analysis by Law & Kelton, pp260
-//
-//
-
-double LogNormal::operator()()
-{
- return exp (this->Normal::operator()() );
-}
-
-
diff --git a/contrib/libg++/libg++/src/LogNorm.h b/contrib/libg++/libg++/src/LogNorm.h
deleted file mode 100644
index 18fc1f11d234..000000000000
--- a/contrib/libg++/libg++/src/LogNorm.h
+++ /dev/null
@@ -1,78 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Dirk Grunwald (grunwald@cs.uiuc.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#ifndef _LogNormal_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _LogNormal_h
-
-#include <Normal.h>
-
-class LogNormal: public Normal {
-protected:
- double logMean;
- double logVariance;
- void setState();
-public:
- LogNormal(double mean, double variance, RNG *gen);
- double mean();
- double mean(double x);
- double variance();
- double variance(double x);
- virtual double operator()();
-};
-
-
-inline void LogNormal::setState()
-{
- double m2 = logMean * logMean;
- pMean = log(m2 / sqrt(logVariance + m2) );
-// from ch@heike.informatik.uni-dortmund.de:
-// (was pVariance = log((sqrt(logVariance + m2)/m2 )); )
- pStdDev = sqrt(log((logVariance + m2)/m2 ));
-}
-
-inline LogNormal::LogNormal(double mean, double variance, RNG *gen)
- : Normal(mean, variance, gen)
-{
- logMean = mean;
- logVariance = variance;
- setState();
-}
-
-inline double LogNormal::mean() {
- return logMean;
-}
-
-inline double LogNormal::mean(double x)
-{
- double t=logMean; logMean = x; setState();
- return t;
-}
-
-inline double LogNormal::variance() {
- return logVariance;
-}
-
-inline double LogNormal::variance(double x)
-{
- double t=logVariance; logVariance = x; setState();
- return t;
-}
-
-#endif
diff --git a/contrib/libg++/libg++/src/MLCG.cc b/contrib/libg++/libg++/src/MLCG.cc
deleted file mode 100644
index 8e624772f34d..000000000000
--- a/contrib/libg++/libg++/src/MLCG.cc
+++ /dev/null
@@ -1,103 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1989 Free Software Foundation
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <MLCG.h>
-//
-// SEED_TABLE_SIZE must be a power of 2
-//
-
-
-#define SEED_TABLE_SIZE 32
-
-static _G_int32_t seedTable[SEED_TABLE_SIZE] = {
-0xbdcc47e5, 0x54aea45d, 0xec0df859, 0xda84637b,
-0xc8c6cb4f, 0x35574b01, 0x28260b7d, 0x0d07fdbf,
-0x9faaeeb0, 0x613dd169, 0x5ce2d818, 0x85b9e706,
-0xab2469db, 0xda02b0dc, 0x45c60d6e, 0xffe49d10,
-0x7224fea3, 0xf9684fc9, 0xfc7ee074, 0x326ce92a,
-0x366d13b5, 0x17aaa731, 0xeb83a675, 0x7781cb32,
-0x4ec7c92d, 0x7f187521, 0x2cf346b4, 0xad13310f,
-0xb89cff2b, 0x12164de1, 0xa865168d, 0x32b56cdf
-};
-
-MLCG::MLCG(_G_int32_t seed1, _G_int32_t seed2)
-{
- initialSeedOne = seed1;
- initialSeedTwo = seed2;
- reset();
-}
-
-void
-MLCG::reset()
-{
- _G_int32_t seed1 = initialSeedOne;
- _G_int32_t seed2 = initialSeedTwo;
-
- //
- // Most people pick stupid seed numbers that do not have enough
- // bits. In this case, if they pick a small seed number, we
- // map that to a specific seed.
- //
- if (seed1 < 0) {
- seed1 = (seed1 + 2147483561);
- seed1 = (seed1 < 0) ? -seed1 : seed1;
- }
-
- if (seed2 < 0) {
- seed2 = (seed2 + 2147483561);
- seed2 = (seed2 < 0) ? -seed2 : seed2;
- }
-
- if (seed1 > -1 && seed1 < SEED_TABLE_SIZE) {
- seedOne = seedTable[seed1];
- } else {
- seedOne = seed1 ^ seedTable[seed1 & (SEED_TABLE_SIZE-1)];
- }
-
- if (seed2 > -1 && seed2 < SEED_TABLE_SIZE) {
- seedTwo = seedTable[seed2];
- } else {
- seedTwo = seed2 ^ seedTable[ seed2 & (SEED_TABLE_SIZE-1) ];
- }
- seedOne = (seedOne % 2147483561) + 1;
- seedTwo = (seedTwo % 2147483397) + 1;
-}
-
-_G_uint32_t MLCG::asLong()
-{
- _G_int32_t k = seedOne % 53668;
-
- seedOne = 40014 * (seedOne-k * 53668) - k * 12211;
- if (seedOne < 0) {
- seedOne += 2147483563;
- }
-
- k = seedTwo % 52774;
- seedTwo = 40692 * (seedTwo - k * 52774) - k * 3791;
- if (seedTwo < 0) {
- seedTwo += 2147483399;
- }
-
- _G_int32_t z = seedOne - seedTwo;
- if (z < 1) {
- z += 2147483562;
- }
- return( (unsigned long) z);
-}
-
diff --git a/contrib/libg++/libg++/src/MLCG.h b/contrib/libg++/libg++/src/MLCG.h
deleted file mode 100644
index 0ae817cd7772..000000000000
--- a/contrib/libg++/libg++/src/MLCG.h
+++ /dev/null
@@ -1,87 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Dirk Grunwald (grunwald@cs.uiuc.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#ifndef _MLCG_h
-#define _MLCG_h 1
-#ifdef __GNUG__
-#pragma interface
-#endif
-
-#include <RNG.h>
-#include <math.h>
-
-//
-// Multiplicative Linear Conguential Generator
-//
-
-class MLCG : public RNG {
- _G_int32_t initialSeedOne;
- _G_int32_t initialSeedTwo;
- _G_int32_t seedOne;
- _G_int32_t seedTwo;
-
-protected:
-
-public:
- MLCG(_G_int32_t seed1 = 0, _G_int32_t seed2 = 1);
- //
- // Return a long-words word of random bits
- //
- virtual _G_uint32_t asLong();
- virtual void reset();
- _G_int32_t seed1();
- void seed1(_G_int32_t);
- _G_int32_t seed2();
- void seed2(_G_int32_t);
- void reseed(_G_int32_t, _G_int32_t);
-};
-
-inline _G_int32_t
-MLCG::seed1()
-{
- return(seedOne);
-}
-
-inline void
-MLCG::seed1(_G_int32_t s)
-{
- initialSeedOne = s;
- reset();
-}
-
-inline _G_int32_t
-MLCG::seed2()
-{
- return(seedTwo);
-}
-
-inline void
-MLCG::seed2(_G_int32_t s)
-{
- initialSeedTwo = s;
- reset();
-}
-
-inline void
-MLCG::reseed(_G_int32_t s1, _G_int32_t s2)
-{
- initialSeedOne = s1;
- initialSeedTwo = s2;
- reset();
-}
-
-#endif
diff --git a/contrib/libg++/libg++/src/Makefile.in b/contrib/libg++/libg++/src/Makefile.in
deleted file mode 100644
index d67506019435..000000000000
--- a/contrib/libg++/libg++/src/Makefile.in
+++ /dev/null
@@ -1,75 +0,0 @@
-# Makefile for libg++.a
-
-# Copyright (C) 1988, 1992, 1993 Free Software Foundation
-# originally written by Doug Lea (dl@rocky.oswego.edu)
-
-# This file is part of libg++, the GNU C++ library.
-
-# GNU CC is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY. No author or distributor
-# accepts responsibility to anyone for the consequences of using it
-# or for whether it serves any particular purpose or works at all,
-# unless he says so in writing. Refer to the GNU CC General Public
-# License for full details.
-
-# Everyone is granted permission to copy, modify and redistribute
-# GNU CC, but only under the conditions described in the
-# GNU CC General Public License. A copy of this license is
-# supposed to have been given to you along with GNU CC so you
-# can know your rights and responsibilities. It should be in a
-# file named COPYING. Among other things, the copyright notice
-# and this notice must be preserved on all copies.
-
-srcdir = .
-
-#
-# declarations from here on should not normally need to be changed
-# in order to compile libg++.a
-#
-
-# library sources
-
-STREAM_OBJS = File.o ostream.o istream.o streambuf.o filebuf.o Filebuf.o \
- PlotFile.o SFile.o
-
-REGEX_OBJ=
-BIT_OBJS = bitand.o bitany.o bitblt.o bitclear.o bitcopy.o bitcount.o\
- bitinvert.o bitlcomp.o bitset1.o bitxor.o
-OBJS = AllocRing.o Obstack.o builtin.o \
- $(REGEX_OBJ) Regex.o String.o Intdouble.o Integer.o Rational.o \
- Random.o BitSet.o BitString.o LogNorm.o SmplHist.o SmplStat.o \
- Normal.o NegExp.o Weibull.o Erlang.o DiscUnif.o \
- Uniform.o Poisson.o HypGeom.o Geom.o Binomial.o \
- RNG.o ACG.o MLCG.o RndInt.o \
- Fix.o Fix16.o Fix24.o GetOpt.o \
- error.o gcd.o hash.o \
- lg.o fmtq.o ioob.o pow.o sqrt.o timer.o \
- compare.o $(BIT_OBJS) \
- SLList.o DLList.o
-
-DEPEND_SOURCES = $(srcdir)/*.cc
-
-#### host, target, and site dependent Makefile fragments come in here.
-##
-
-.PHONY: add-to-targetlib
-# Invoked from other directories, overriding $(TARGETLIB).
-add-to-targetlib:
- $(AR) $(AR_FLAGS) $(TARGETLIB) $(OBJS)
-
-# This is invoked by the top-level libg++ Makefile, to:
-# a) make sure $(OBJS) are up-to-date, and
-# b) make a list of those files that should be added to libg++.a.
-libgxx.list: stamp-picdir $(OBJS)
- @echo "$(OBJS)" >libgxx.list
-
-install:
- if [ -z "$(MULTISUBDIR)" ]; then \
- for FILE in `(cd ${srcdir}; echo *.h gen/*.ccP gen/*.hP)`; do \
- rm -f $(gxx_includedir)/$$FILE ; \
- $(INSTALL_DATA) ${srcdir}/$$FILE $(gxx_includedir)/$$FILE \
- || exit 1; \
- chmod a-x,a+r $(gxx_includedir)/$$FILE ; \
- done ; \
- else true ; \
- fi
diff --git a/contrib/libg++/libg++/src/NegExp.cc b/contrib/libg++/libg++/src/NegExp.cc
deleted file mode 100644
index f07769aff60b..000000000000
--- a/contrib/libg++/libg++/src/NegExp.cc
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Dirk Grunwald (grunwald@cs.uiuc.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <builtin.h>
-#include <Random.h>
-#include <NegExp.h>
-
-double NegativeExpntl::operator()()
-{
- return(-pMean * log(pGenerator -> asDouble()));
-}
-
diff --git a/contrib/libg++/libg++/src/NegExp.h b/contrib/libg++/libg++/src/NegExp.h
deleted file mode 100644
index 08f17afde953..000000000000
--- a/contrib/libg++/libg++/src/NegExp.h
+++ /dev/null
@@ -1,55 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Dirk Grunwald (grunwald@cs.uiuc.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#ifndef _NegativeExpntl_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _NegativeExpntl_h 1
-
-
-//
-// Negative Exponential Random Numbers
-//
-//
-
-#include <Random.h>
-
-class NegativeExpntl: public Random {
-protected:
- double pMean;
-public:
- NegativeExpntl(double xmean, RNG *gen);
- double mean();
- double mean(double x);
-
- virtual double operator()();
-};
-
-
-inline NegativeExpntl::NegativeExpntl(double xmean, RNG *gen)
-: Random(gen) {
- pMean = xmean;
-}
-
-inline double NegativeExpntl::mean() { return pMean; }
-inline double NegativeExpntl::mean(double x) {
- double t = pMean; pMean = x;
- return t;
-}
-
-#endif
diff --git a/contrib/libg++/libg++/src/Normal.cc b/contrib/libg++/libg++/src/Normal.cc
deleted file mode 100644
index 29219b4a7302..000000000000
--- a/contrib/libg++/libg++/src/Normal.cc
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Dirk Grunwald (grunwald@cs.uiuc.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <builtin.h>
-#include <Random.h>
-#include <Normal.h>
-//
-// See Simulation, Modelling & Analysis by Law & Kelton, pp259
-//
-// This is the ``polar'' method.
-//
-
-double Normal::operator()()
-{
-
- if (haveCachedNormal == 1) {
- haveCachedNormal = 0;
- return(cachedNormal * pStdDev + pMean );
- } else {
-
- for(;;) {
- double u1 = pGenerator -> asDouble();
- double u2 = pGenerator -> asDouble();
- double v1 = 2 * u1 - 1;
- double v2 = 2 * u2 - 1;
- double w = (v1 * v1) + (v2 * v2);
-
-//
-// We actually generate two IID normal distribution variables.
-// We cache the one & return the other.
-//
- if (w <= 1) {
- double y = sqrt( (-2 * log(w)) / w);
- double x1 = v1 * y;
- double x2 = v2 * y;
-
- haveCachedNormal = 1;
- cachedNormal = x2;
- return(x1 * pStdDev + pMean);
- }
- }
- }
-}
-
diff --git a/contrib/libg++/libg++/src/Normal.h b/contrib/libg++/libg++/src/Normal.h
deleted file mode 100644
index 5e19f7ae6067..000000000000
--- a/contrib/libg++/libg++/src/Normal.h
+++ /dev/null
@@ -1,66 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Dirk Grunwald (grunwald@cs.uiuc.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#ifndef _Normal_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _Normal_h
-
-#include <Random.h>
-
-class Normal: public Random {
- char haveCachedNormal;
- double cachedNormal;
-
-protected:
- double pMean;
- double pVariance;
- double pStdDev;
-
-public:
- Normal(double xmean, double xvariance, RNG *gen);
- double mean();
- double mean(double x);
- double variance();
- double variance(double x);
- virtual double operator()();
-};
-
-
-inline Normal::Normal(double xmean, double xvariance, RNG *gen)
-: Random(gen) {
- pMean = xmean;
- pVariance = xvariance;
- pStdDev = sqrt(pVariance);
- haveCachedNormal = 0;
-}
-
-inline double Normal::mean() { return pMean; };
-inline double Normal::mean(double x) {
- double t=pMean; pMean = x;
- return t;
-}
-
-inline double Normal::variance() { return pVariance; }
-inline double Normal::variance(double x) {
- double t=pVariance; pVariance = x;
- pStdDev = sqrt(pVariance);
- return t;
-};
-
-#endif
diff --git a/contrib/libg++/libg++/src/Obstack.cc b/contrib/libg++/libg++/src/Obstack.cc
deleted file mode 100644
index abef732979f8..000000000000
--- a/contrib/libg++/libg++/src/Obstack.cc
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <limits.h>
-#include <builtin.h>
-#include <Obstack.h>
-#include <new.h>
-
-/* We use subtraction of (char *)0 instead of casting to int
- because on word-addressable machines a simple cast to int
- may ignore the byte-within-word field of the pointer. */
-
-#ifndef __PTR_TO_INT
-#define __PTR_TO_INT(P) ((P) - (char *)0)
-#endif
-
-#ifndef __INT_TO_PTR
-#define __INT_TO_PTR(P) ((P) + (char *)0)
-#endif
-
-Obstack::Obstack(int size, int alignment)
-{
- alignmentmask = alignment - 1;
- chunksize = size;
- chunk = 0;
- nextfree = objectbase = 0;
- chunklimit = 0;
-}
-
-void Obstack::_free(void* obj)
-{
- _obstack_chunk* lp;
- _obstack_chunk* plp;
-
- lp = chunk;
- while (lp != 0 && ((void*)lp > obj || (void*)(lp)->limit < obj))
- {
- plp = lp -> prev;
- delete [] (char*)lp;
- lp = plp;
- }
- if (lp)
- {
- objectbase = nextfree = (char *)(obj);
- chunklimit = lp->limit;
- chunk = lp;
- }
- else if (obj != 0)
- (*lib_error_handler)("Obstack", "deletion of nonexistent obj");
-}
-
-void Obstack::newchunk(int size)
-{
- _obstack_chunk* old_chunk = chunk;
- _obstack_chunk* new_chunk;
- long new_size;
- int obj_size = nextfree - objectbase;
-
- new_size = (obj_size + size) << 1;
- if (new_size < chunksize)
- new_size = chunksize;
-
- new_chunk = chunk = new (operator new (new_size)) _obstack_chunk;
- new_chunk->prev = old_chunk;
- new_chunk->limit = chunklimit = (char *) new_chunk + new_size;
-
- memcpy((void*)new_chunk->contents, (void*)objectbase, obj_size);
- objectbase = new_chunk->contents;
- nextfree = objectbase + obj_size;
-}
-
-void* Obstack::finish()
-{
- void* value = (void*) objectbase;
- nextfree = __INT_TO_PTR (__PTR_TO_INT (nextfree + alignmentmask)
- & ~alignmentmask);
- if (nextfree - (char*)chunk > chunklimit - (char*)chunk)
- nextfree = chunklimit;
- objectbase = nextfree;
- return value;
-}
-
-int Obstack::contains(void* obj) // true if obj somewhere in Obstack
-{
- _obstack_chunk* ch;
- for (ch = chunk;
- ch != 0 && (obj < (void*)ch || obj >= (void*)(ch->limit));
- ch = ch->prev);
-
- return ch != 0;
-}
-
-int Obstack::OK()
-{
- int v = chunksize > 0; // valid size
- v &= alignmentmask != 0; // and alignment
- v &= chunk != 0;
- v &= objectbase >= chunk->contents;
- v &= nextfree >= objectbase;
- v &= nextfree <= chunklimit;
- v &= chunklimit == chunk->limit;
- _obstack_chunk* p = chunk;
- // allow lots of chances to find bottom!
- long x = LONG_MAX;
- while (p != 0 && x != 0) { --x; p = p->prev; }
- v &= x > 0;
- if (!v)
- (*lib_error_handler)("Obstack", "invariant failure");
- return v;
-}
diff --git a/contrib/libg++/libg++/src/Obstack.h b/contrib/libg++/libg++/src/Obstack.h
deleted file mode 100644
index 8dd9d09c91bc..000000000000
--- a/contrib/libg++/libg++/src/Obstack.h
+++ /dev/null
@@ -1,218 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-
-#ifndef _Obstack_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _Obstack_h 1
-
-#include <std.h>
-
-#undef OK
-
-class Obstack
-{
- struct _obstack_chunk
- {
- char* limit;
- _obstack_chunk* prev;
- char contents[4];
- };
-
-protected:
- long chunksize;
- _obstack_chunk* chunk;
- char* objectbase;
- char* nextfree;
- char* chunklimit;
- int alignmentmask;
-
- void _free(void* obj);
- void newchunk(int size);
-
-public:
- Obstack(int size = 4080, int alignment = 4); // 4080=4096-mallocslop
-
- ~Obstack();
-
- void* base();
- void* next_free();
- int alignment_mask();
- int chunk_size();
- int size();
- int room();
- int contains(void* p); // does Obstack hold pointer p?
-
- void grow(const void* data, int size);
- void grow(const void* data, int size, char terminator);
- void grow(const char* s);
- void grow(char c);
- void grow_fast(char c);
- void blank(int size);
- void blank_fast(int size);
-
- void* finish();
- void* finish(char terminator);
-
- void* copy(const void* data, int size);
- void* copy(const void* data, int size, char terminator);
- void* copy(const char* s);
- void* copy(char c);
- void* alloc(int size);
-
- void free(void* obj);
- void shrink(int size = 1); // suggested by ken@cs.rochester.edu
-
- int OK(); // rep invariant
-};
-
-
-inline Obstack::~Obstack()
-{
- _free(0);
-}
-
-inline void* Obstack::base()
-{
- return objectbase;
-}
-
-inline void* Obstack::next_free()
-{
- return nextfree;
-}
-
-inline int Obstack::alignment_mask()
-{
- return alignmentmask;
-}
-
-inline int Obstack::chunk_size()
-{
- return chunksize;
-}
-
-inline int Obstack::size()
-{
- return nextfree - objectbase;
-}
-
-inline int Obstack::room()
-{
- return chunklimit - nextfree;
-}
-
-inline void Obstack:: grow(const void* data, int size)
-{
- if (nextfree+size > chunklimit)
- newchunk(size);
- memcpy(nextfree, data, size);
- nextfree += size;
-}
-
-inline void Obstack:: grow(const void* data, int size, char terminator)
-{
- if (nextfree+size+1 > chunklimit)
- newchunk(size+1);
- memcpy(nextfree, data, size);
- nextfree += size;
- *(nextfree)++ = terminator;
-}
-
-inline void Obstack:: grow(const char* s)
-{
- grow((const void*)s, strlen(s), 0);
-}
-
-inline void Obstack:: grow(char c)
-{
- if (nextfree+1 > chunklimit)
- newchunk(1);
- *(nextfree)++ = c;
-}
-
-inline void Obstack:: blank(int size)
-{
- if (nextfree+size > chunklimit)
- newchunk(size);
- nextfree += size;
-}
-
-inline void* Obstack::finish(char terminator)
-{
- grow(terminator);
- return finish();
-}
-
-inline void* Obstack::copy(const void* data, int size)
-{
- grow (data, size);
- return finish();
-}
-
-inline void* Obstack::copy(const void* data, int size, char terminator)
-{
- grow(data, size, terminator);
- return finish();
-}
-
-inline void* Obstack::copy(const char* s)
-{
- grow((const void*)s, strlen(s), 0);
- return finish();
-}
-
-inline void* Obstack::copy(char c)
-{
- grow(c);
- return finish();
-}
-
-inline void* Obstack::alloc(int size)
-{
- blank(size);
- return finish();
-}
-
-inline void Obstack:: free(void* obj)
-{
- if (obj >= (void*)chunk && obj<(void*)chunklimit)
- nextfree = objectbase = (char *) obj;
- else
- _free(obj);
-}
-
-inline void Obstack:: grow_fast(char c)
-{
- *(nextfree)++ = c;
-}
-
-inline void Obstack:: blank_fast(int size)
-{
- nextfree += size;
-}
-
-inline void Obstack:: shrink(int size) // from ken@cs.rochester.edu
-{
- if (nextfree >= objectbase + size)
- nextfree -= size;
-}
-
-#endif
diff --git a/contrib/libg++/libg++/src/Pix.h b/contrib/libg++/libg++/src/Pix.h
deleted file mode 100644
index be90525c6313..000000000000
--- a/contrib/libg++/libg++/src/Pix.h
+++ /dev/null
@@ -1,5 +0,0 @@
-
-#ifndef _Pix_h
-#define _Pix_h 1
-typedef void* Pix;
-#endif
diff --git a/contrib/libg++/libg++/src/Poisson.cc b/contrib/libg++/libg++/src/Poisson.cc
deleted file mode 100644
index b7fac8f5ca33..000000000000
--- a/contrib/libg++/libg++/src/Poisson.cc
+++ /dev/null
@@ -1,36 +0,0 @@
-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Dirk Grunwald (grunwald@cs.uiuc.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <builtin.h>
-#include <Random.h>
-#include <Poisson.h>
-
-double Poisson::operator()()
-{
- double bound = exp(-1.0 * pMean);
- int count = 0;
-
- for (double product = 1.0;
- product >= bound;
- product *= pGenerator -> asDouble()) {
- count++;
- }
- return(count - 1);
-}
diff --git a/contrib/libg++/libg++/src/Poisson.h b/contrib/libg++/libg++/src/Poisson.h
deleted file mode 100644
index 2566de5aa507..000000000000
--- a/contrib/libg++/libg++/src/Poisson.h
+++ /dev/null
@@ -1,51 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Dirk Grunwald (grunwald@cs.uiuc.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#ifndef _Poisson_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _Poisson_h
-
-#include <Random.h>
-
-class Poisson: public Random {
-protected:
- double pMean;
-public:
- Poisson(double mean, RNG *gen);
-
- double mean();
- double mean(double x);
-
- virtual double operator()();
-};
-
-
-inline Poisson::Poisson(double mean, RNG *gen)
-: Random(gen) {
- pMean = mean;
-}
-
-inline double Poisson::mean() { return pMean; }
-inline double Poisson::mean(double x) {
- double t = pMean;
- pMean = x;
- return t;
-}
-
-#endif
diff --git a/contrib/libg++/libg++/src/RNG.cc b/contrib/libg++/libg++/src/RNG.cc
deleted file mode 100644
index 81f55a07f8c9..000000000000
--- a/contrib/libg++/libg++/src/RNG.cc
+++ /dev/null
@@ -1,131 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1989 Free Software Foundation
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <assert.h>
-#include <builtin.h>
-#include <RNG.h>
-
-// These two static fields get initialized by RNG::RNG().
-PrivateRNGSingleType RNG::singleMantissa;
-PrivateRNGDoubleType RNG::doubleMantissa;
-
-//
-// The scale constant is 2^-31. It is used to scale a 31 bit
-// long to a double.
-//
-
-//static const double randomDoubleScaleConstant = 4.656612873077392578125e-10;
-//static const float randomFloatScaleConstant = 4.656612873077392578125e-10;
-
-static char initialized = 0;
-
-RNG::RNG()
-{
- if (!initialized)
- {
-
- assert (sizeof(double) == 2 * sizeof(_G_uint32_t));
-
- //
- // The following is a hack that I attribute to
- // Andres Nowatzyk at CMU. The intent of the loop
- // is to form the smallest number 0 <= x < 1.0,
- // which is then used as a mask for two longwords.
- // this gives us a fast way way to produce double
- // precision numbers from longwords.
- //
- // I know that this works for IEEE and VAX floating
- // point representations.
- //
- // A further complication is that gnu C will blow
- // the following loop, unless compiled with -ffloat-store,
- // because it uses extended representations for some of
- // of the comparisons. Thus, we have the following hack.
- // If we could specify #pragma optimize, we wouldn't need this.
- //
-
- PrivateRNGDoubleType t;
- PrivateRNGSingleType s;
-
-#if _IEEE == 1
-
- t.d = 1.5;
- if ( t.u[1] == 0 ) { // sun word order?
- t.u[0] = 0x3fffffff;
- t.u[1] = 0xffffffff;
- }
- else {
- t.u[0] = 0xffffffff; // encore word order?
- t.u[1] = 0x3fffffff;
- }
-
- s.u = 0x3fffffff;
-#else
- volatile double x = 1.0; // volatile needed when fp hardware used,
- // and has greater precision than memory doubles
- double y = 0.5;
- do { // find largest fp-number < 2.0
- t.d = x;
- x += y;
- y *= 0.5;
- } while (x != t.d && x < 2.0);
-
- volatile float xx = 1.0; // volatile needed when fp hardware used,
- // and has greater precision than memory floats
- float yy = 0.5;
- do { // find largest fp-number < 2.0
- s.s = xx;
- xx += yy;
- yy *= 0.5;
- } while (xx != s.s && xx < 2.0);
-#endif
- // set doubleMantissa to 1 for each doubleMantissa bit
- doubleMantissa.d = 1.0;
- doubleMantissa.u[0] ^= t.u[0];
- doubleMantissa.u[1] ^= t.u[1];
-
- // set singleMantissa to 1 for each singleMantissa bit
- singleMantissa.s = 1.0;
- singleMantissa.u ^= s.u;
-
- initialized = 1;
- }
-}
-
-float RNG::asFloat()
-{
- PrivateRNGSingleType result;
- result.s = 1.0;
- result.u |= (asLong() & singleMantissa.u);
- result.s -= 1.0;
- assert( result.s < 1.0 && result.s >= 0);
- return( result.s );
-}
-
-double RNG::asDouble()
-{
- PrivateRNGDoubleType result;
- result.d = 1.0;
- result.u[0] |= (asLong() & doubleMantissa.u[0]);
- result.u[1] |= (asLong() & doubleMantissa.u[1]);
- result.d -= 1.0;
- assert( result.d < 1.0 && result.d >= 0);
- return( result.d );
-}
-
diff --git a/contrib/libg++/libg++/src/RNG.h b/contrib/libg++/libg++/src/RNG.h
deleted file mode 100644
index cb3fbfb17329..000000000000
--- a/contrib/libg++/libg++/src/RNG.h
+++ /dev/null
@@ -1,58 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Dirk Grunwald (grunwald@cs.uiuc.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#ifndef _RNG_h
-#define _RNG_h 1
-#ifdef __GNUG__
-#pragma interface
-#endif
-
-#include <assert.h>
-#include <math.h>
-#include <_G_config.h>
-
-union PrivateRNGSingleType { // used to access floats as unsigneds
- float s;
- _G_uint32_t u;
-};
-
-union PrivateRNGDoubleType { // used to access doubles as unsigneds
- double d;
- _G_uint32_t u[2];
-};
-
-//
-// Base class for Random Number Generators. See ACG and MLCG for instances.
-//
-class RNG {
- static PrivateRNGSingleType singleMantissa; // mantissa bit vector
- static PrivateRNGDoubleType doubleMantissa; // mantissa bit vector
-public:
- RNG();
- //
- // Return a long-words word of random bits
- //
- virtual _G_uint32_t asLong() = 0;
- virtual void reset() = 0;
- //
- // Return random bits converted to either a float or a double
- //
- float asFloat();
- double asDouble();
-};
-
-#endif
diff --git a/contrib/libg++/libg++/src/Random.cc b/contrib/libg++/libg++/src/Random.cc
deleted file mode 100644
index 572a602cf7a1..000000000000
--- a/contrib/libg++/libg++/src/Random.cc
+++ /dev/null
@@ -1,4 +0,0 @@
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <Random.h>
diff --git a/contrib/libg++/libg++/src/Random.h b/contrib/libg++/libg++/src/Random.h
deleted file mode 100644
index 2a6d0ee54a31..000000000000
--- a/contrib/libg++/libg++/src/Random.h
+++ /dev/null
@@ -1,54 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Dirk Grunwald (grunwald@cs.uiuc.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#ifndef _Random_h
-#define _Random_h 1
-#ifdef __GNUG__
-#pragma interface
-#endif
-
-#include <math.h>
-#include <RNG.h>
-
-class Random {
-protected:
- RNG *pGenerator;
-public:
- Random(RNG *generator);
- virtual double operator()() = 0;
-
- RNG *generator();
- void generator(RNG *p);
-};
-
-
-inline Random::Random(RNG *gen)
-{
- pGenerator = gen;
-}
-
-inline RNG *Random::generator()
-{
- return(pGenerator);
-}
-
-inline void Random::generator(RNG *p)
-{
- pGenerator = p;
-}
-
-#endif
diff --git a/contrib/libg++/libg++/src/Rational.cc b/contrib/libg++/libg++/src/Rational.cc
deleted file mode 100644
index 07bcd4f1d17f..000000000000
--- a/contrib/libg++/libg++/src/Rational.cc
+++ /dev/null
@@ -1,416 +0,0 @@
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <Rational.h>
-#include <std.h>
-#include <math.h>
-#include <builtin.h>
-#include <float.h>
-
-#undef OK
-
-void Rational::error(const char* msg) const
-{
- (*lib_error_handler)("Rational", msg);
-}
-
-static const Integer _Int_One(1);
-
-void Rational::normalize()
-{
- int s = sign(den);
- if (s == 0)
- error("Zero denominator.");
- else if (s < 0)
- {
- den.negate();
- num.negate();
- }
-
- Integer g = gcd(num, den);
- if (ucompare(g, _Int_One) != 0)
- {
- num /= g;
- den /= g;
- }
-}
-
-void add(const Rational& x, const Rational& y, Rational& r)
-{
- if (&r != &x && &r != &y)
- {
- mul(x.num, y.den, r.num);
- mul(x.den, y.num, r.den);
- add(r.num, r.den, r.num);
- mul(x.den, y.den, r.den);
- }
- else
- {
- Integer tmp;
- mul(x.den, y.num, tmp);
- mul(x.num, y.den, r.num);
- add(r.num, tmp, r.num);
- mul(x.den, y.den, r.den);
- }
- r.normalize();
-}
-
-void sub(const Rational& x, const Rational& y, Rational& r)
-{
- if (&r != &x && &r != &y)
- {
- mul(x.num, y.den, r.num);
- mul(x.den, y.num, r.den);
- sub(r.num, r.den, r.num);
- mul(x.den, y.den, r.den);
- }
- else
- {
- Integer tmp;
- mul(x.den, y.num, tmp);
- mul(x.num, y.den, r.num);
- sub(r.num, tmp, r.num);
- mul(x.den, y.den, r.den);
- }
- r.normalize();
-}
-
-void mul(const Rational& x, const Rational& y, Rational& r)
-{
- mul(x.num, y.num, r.num);
- mul(x.den, y.den, r.den);
- r.normalize();
-}
-
-void div(const Rational& x, const Rational& y, Rational& r)
-{
- if (&r != &x && &r != &y)
- {
- mul(x.num, y.den, r.num);
- mul(x.den, y.num, r.den);
- }
- else
- {
- Integer tmp;
- mul(x.num, y.den, tmp);
- mul(y.num, x.den, r.den);
- r.num = tmp;
- }
- r.normalize();
-}
-
-
-
-
-void Rational::invert()
-{
- Integer tmp = num;
- num = den;
- den = tmp;
- int s = sign(den);
- if (s == 0)
- error("Zero denominator.");
- else if (s < 0)
- {
- den.negate();
- num.negate();
- }
-}
-
-int compare(const Rational& x, const Rational& y)
-{
- int xsgn = sign(x.num);
- int ysgn = sign(y.num);
- int d = xsgn - ysgn;
- if (d == 0 && xsgn != 0) d = compare(x.num * y.den, x.den * y.num);
- return d;
-}
-
-Rational::Rational(double x)
-{
- num = 0;
- den = 1;
- if (x != 0.0)
- {
- int neg = x < 0;
- if (neg)
- x = -x;
-
- const long shift = 15; // a safe shift per step
- const double width = 32768.0; // = 2^shift
- const int maxiter = 20; // ought not be necessary, but just in case,
- // max 300 bits of precision
- int expt;
- double mantissa = frexp(x, &expt);
- long exponent = expt;
- double intpart;
- int k = 0;
- while (mantissa != 0.0 && k++ < maxiter)
- {
- mantissa *= width;
- mantissa = modf(mantissa, &intpart);
- num <<= shift;
- num += (long)intpart;
- exponent -= shift;
- }
- if (exponent > 0)
- num <<= exponent;
- else if (exponent < 0)
- den <<= -exponent;
- if (neg)
- num.negate();
- }
- normalize();
-}
-
-
-Integer trunc(const Rational& x)
-{
- return x.num / x.den ;
-}
-
-
-Rational pow(const Rational& x, const Integer& y)
-{
- long yy = y.as_long();
- return pow(x, yy);
-}
-
-#if defined(__GNUG__) && !defined(_G_NO_NRV)
-
-Rational operator - (const Rational& x) return r(x)
-{
- r.negate();
-}
-
-Rational abs(const Rational& x) return r(x)
-{
- if (sign(r.num) < 0) r.negate();
-}
-
-
-Rational sqr(const Rational& x) return r
-{
- mul(x.num, x.num, r.num);
- mul(x.den, x.den, r.den);
- r.normalize();
-}
-
-Integer floor(const Rational& x) return q
-{
- Integer r;
- divide(x.num, x.den, q, r);
- if (sign(x.num) < 0 && sign(r) != 0) --q;
-}
-
-Integer ceil(const Rational& x) return q
-{
- Integer r;
- divide(x.num, x.den, q, r);
- if (sign(x.num) >= 0 && sign(r) != 0) ++q;
-}
-
-Integer round(const Rational& x) return q
-{
- Integer r;
- divide(x.num, x.den, q, r);
- r <<= 1;
- if (ucompare(r, x.den) >= 0)
- {
- if (sign(x.num) >= 0)
- ++q;
- else
- --q;
- }
-}
-
-// power: no need to normalize since num & den already relatively prime
-
-Rational pow(const Rational& x, long y) return r
-{
- if (y >= 0)
- {
- pow(x.num, y, r.num);
- pow(x.den, y, r.den);
- }
- else
- {
- y = -y;
- pow(x.num, y, r.den);
- pow(x.den, y, r.num);
- if (sign(r.den) < 0)
- {
- r.num.negate();
- r.den.negate();
- }
- }
-}
-
-#else
-
-Rational operator - (const Rational& x)
-{
- Rational r(x); r.negate(); return r;
-}
-
-Rational abs(const Rational& x)
-{
- Rational r(x);
- if (sign(r.num) < 0) r.negate();
- return r;
-}
-
-
-Rational sqr(const Rational& x)
-{
- Rational r;
- mul(x.num, x.num, r.num);
- mul(x.den, x.den, r.den);
- r.normalize();
- return r;
-}
-
-Integer floor(const Rational& x)
-{
- Integer q;
- Integer r;
- divide(x.num, x.den, q, r);
- if (sign(x.num) < 0 && sign(r) != 0) --q;
- return q;
-}
-
-Integer ceil(const Rational& x)
-{
- Integer q;
- Integer r;
- divide(x.num, x.den, q, r);
- if (sign(x.num) >= 0 && sign(r) != 0) ++q;
- return q;
-}
-
-Integer round(const Rational& x)
-{
- Integer q;
- Integer r;
- divide(x.num, x.den, q, r);
- r <<= 1;
- if (ucompare(r, x.den) >= 0)
- {
- if (sign(x.num) >= 0)
- ++q;
- else
- --q;
- }
- return q;
-}
-
-Rational pow(const Rational& x, long y)
-{
- Rational r;
- if (y >= 0)
- {
- pow(x.num, y, r.num);
- pow(x.den, y, r.den);
- }
- else
- {
- y = -y;
- pow(x.num, y, r.den);
- pow(x.den, y, r.num);
- if (sign(r.den) < 0)
- {
- r.num.negate();
- r.den.negate();
- }
- }
- return r;
-}
-
-#endif
-
-ostream& operator << (ostream& s, const Rational& y)
-{
- if (y.denominator() == 1L)
- s << y.numerator();
- else
- {
- s << y.numerator();
- s << "/";
- s << y.denominator();
- }
- return s;
-}
-
-istream& operator >> (istream& s, Rational& y)
-{
-#ifdef _OLD_STREAMS
- if (!s.good())
- {
- return s;
- }
-#else
- if (!s.ipfx(0))
- {
- s.clear(ios::failbit|s.rdstate()); // Redundant if using GNU iostreams.
- return s;
- }
-#endif
- Integer n = 0;
- Integer d = 1;
- if (s >> n)
- {
- char ch = 0;
- s.get(ch);
- if (ch == '/')
- {
- s >> d;
- }
- else
- {
- s.putback(ch);
- }
- }
- y = Rational(n, d);
- return s;
-}
-
-int Rational::OK() const
-{
- int v = num.OK() && den.OK(); // have valid num and denom
- if (v)
- {
- v &= sign(den) > 0; // denominator positive;
- v &= ucompare(gcd(num, den), _Int_One) == 0; // relatively prime
- }
- if (!v) error("invariant failure");
- return v;
-}
-
-int
-Rational::fits_in_float() const
-{
- return Rational (FLT_MIN) <= *this && *this <= Rational (FLT_MAX);
-}
-
-int
-Rational::fits_in_double() const
-{
- return Rational (DBL_MIN) <= *this && *this <= Rational (DBL_MAX);
-}
diff --git a/contrib/libg++/libg++/src/Rational.h b/contrib/libg++/libg++/src/Rational.h
deleted file mode 100644
index 6542c49f9e4c..000000000000
--- a/contrib/libg++/libg++/src/Rational.h
+++ /dev/null
@@ -1,290 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifndef _Rational_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _Rational_h 1
-
-#include <Integer.h>
-#include <math.h>
-
-#undef OK
-
-class Rational
-{
-protected:
- Integer num;
- Integer den;
-
- void normalize();
-
-public:
- Rational();
- Rational(double);
- Rational(int n);
- Rational(long n);
- Rational(int n, int d);
- Rational(long n, long d);
- Rational(long n, unsigned long d);
- Rational(unsigned long n, long d);
- Rational(unsigned long n, unsigned long d);
- Rational(const Integer& n);
- Rational(const Integer& n, const Integer& d);
- Rational(const Rational&);
-
- ~Rational();
-
- Rational& operator = (const Rational& y);
-
- friend int operator == (const Rational& x, const Rational& y);
- friend int operator != (const Rational& x, const Rational& y);
- friend int operator < (const Rational& x, const Rational& y);
- friend int operator <= (const Rational& x, const Rational& y);
- friend int operator > (const Rational& x, const Rational& y);
- friend int operator >= (const Rational& x, const Rational& y);
-
- friend Rational operator + (const Rational& x, const Rational& y);
- friend Rational operator - (const Rational& x, const Rational& y);
- friend Rational operator * (const Rational& x, const Rational& y);
- friend Rational operator / (const Rational& x, const Rational& y);
-
- Rational& operator += (const Rational& y);
- Rational& operator -= (const Rational& y);
- Rational& operator *= (const Rational& y);
- Rational& operator /= (const Rational& y);
-
-#if defined (__GNUG__) && ! defined (__STRICT_ANSI__)
- friend Rational operator <? (const Rational& x, const Rational& y); // min
- friend Rational operator >? (const Rational& x, const Rational& y); // max
-#endif
-
- friend Rational operator - (const Rational& x);
-
-
-// builtin Rational functions
-
-
- void negate(); // x = -x
- void invert(); // x = 1/x
-
- friend int sign(const Rational& x); // -1, 0, or +1
- friend Rational abs(const Rational& x); // absolute value
- friend Rational sqr(const Rational& x); // square
- friend Rational pow(const Rational& x, long y);
- friend Rational pow(const Rational& x, const Integer& y);
- const Integer& numerator() const;
- const Integer& denominator() const;
-
-// coercion & conversion
-
- operator double() const;
- friend Integer floor(const Rational& x);
- friend Integer ceil(const Rational& x);
- friend Integer trunc(const Rational& x);
- friend Integer round(const Rational& x);
-
- friend istream& operator >> (istream& s, Rational& y);
- friend ostream& operator << (ostream& s, const Rational& y);
-
- int fits_in_float() const;
- int fits_in_double() const;
-
-// procedural versions of operators
-
- friend int compare(const Rational& x, const Rational& y);
- friend void add(const Rational& x, const Rational& y, Rational& dest);
- friend void sub(const Rational& x, const Rational& y, Rational& dest);
- friend void mul(const Rational& x, const Rational& y, Rational& dest);
- friend void div(const Rational& x, const Rational& y, Rational& dest);
-
-// error detection
-
- void error(const char* msg) const;
- int OK() const;
-
-};
-
-typedef Rational RatTmp; // backwards compatibility
-
-inline Rational::Rational() : num(&_ZeroRep), den(&_OneRep) {}
-inline Rational::~Rational() {}
-
-inline Rational::Rational(const Rational& y) :num(y.num), den(y.den) {}
-
-inline Rational::Rational(const Integer& n) :num(n), den(&_OneRep) {}
-
-inline Rational::Rational(const Integer& n, const Integer& d) :num(n),den(d)
-{
- normalize();
-}
-
-inline Rational::Rational(long n) :num(n), den(&_OneRep) { }
-
-inline Rational::Rational(int n) :num(n), den(&_OneRep) { }
-
-inline Rational::Rational(long n, long d) :num(n), den(d) { normalize(); }
-inline Rational::Rational(int n, int d) :num(n), den(d) { normalize(); }
-inline Rational::Rational(long n, unsigned long d) :num(n), den(d)
-{
- normalize();
-}
-inline Rational::Rational(unsigned long n, long d) :num(n), den(d)
-{
- normalize();
-}
-inline Rational::Rational(unsigned long n, unsigned long d) :num(n), den(d)
-{
- normalize();
-}
-
-inline Rational& Rational::operator = (const Rational& y)
-{
- num = y.num; den = y.den;
- return *this;
-}
-
-inline int operator == (const Rational& x, const Rational& y)
-{
- return compare(x.num, y.num) == 0 && compare(x.den, y.den) == 0;
-}
-
-inline int operator != (const Rational& x, const Rational& y)
-{
- return compare(x.num, y.num) != 0 || compare(x.den, y.den) != 0;
-}
-
-inline int operator < (const Rational& x, const Rational& y)
-{
- return compare(x, y) < 0;
-}
-
-inline int operator <= (const Rational& x, const Rational& y)
-{
- return compare(x, y) <= 0;
-}
-
-inline int operator > (const Rational& x, const Rational& y)
-{
- return compare(x, y) > 0;
-}
-
-inline int operator >= (const Rational& x, const Rational& y)
-{
- return compare(x, y) >= 0;
-}
-
-inline int sign(const Rational& x)
-{
- return sign(x.num);
-}
-
-inline void Rational::negate()
-{
- num.negate();
-}
-
-
-inline Rational& Rational::operator += (const Rational& y)
-{
- add(*this, y, *this);
- return *this;
-}
-
-inline Rational& Rational::operator -= (const Rational& y)
-{
- sub(*this, y, *this);
- return *this;
-}
-
-inline Rational& Rational::operator *= (const Rational& y)
-{
- mul(*this, y, *this);
- return *this;
-}
-
-inline Rational& Rational::operator /= (const Rational& y)
-{
- div(*this, y, *this);
- return *this;
-}
-
-inline const Integer& Rational::numerator() const { return num; }
-inline const Integer& Rational::denominator() const { return den; }
-inline Rational::operator double() const { return ratio(num, den); }
-
-#if defined (__GNUG__) && ! defined (__STRICT_ANSI__)
-inline Rational operator <? (const Rational& x, const Rational& y)
-{
- if (compare(x, y) <= 0) return x; else return y;
-}
-
-inline Rational operator >? (const Rational& x, const Rational& y)
-{
- if (compare(x, y) >= 0) return x; else return y;
-}
-#endif
-
-#if defined(__GNUG__) && !defined(_G_NO_NRV)
-
-inline Rational operator + (const Rational& x, const Rational& y) return r
-{
- add(x, y, r);
-}
-
-inline Rational operator - (const Rational& x, const Rational& y) return r
-{
- sub(x, y, r);
-}
-
-inline Rational operator * (const Rational& x, const Rational& y) return r
-{
- mul(x, y, r);
-}
-
-inline Rational operator / (const Rational& x, const Rational& y) return r
-{
- div(x, y, r);
-}
-
-#else /* NO_NRV */
-
-inline Rational operator + (const Rational& x, const Rational& y)
-{
- Rational r; add(x, y, r); return r;
-}
-
-inline Rational operator - (const Rational& x, const Rational& y)
-{
- Rational r; sub(x, y, r); return r;
-}
-
-inline Rational operator * (const Rational& x, const Rational& y)
-{
- Rational r; mul(x, y, r); return r;
-}
-
-inline Rational operator / (const Rational& x, const Rational& y)
-{
- Rational r; div(x, y, r); return r;
-}
-#endif
-
-#endif
diff --git a/contrib/libg++/libg++/src/Regex.cc b/contrib/libg++/libg++/src/Regex.cc
deleted file mode 100644
index 642fd88e245c..000000000000
--- a/contrib/libg++/libg++/src/Regex.cc
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-/*
- Regex class implementation
- */
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <std.h>
-#include <ctype.h>
-#include <new.h>
-#include <builtin.h>
-
-extern "C" {
-#if 1
-#include <rx.h>
-#else
-#include <regex.h>
-#endif
-}
-
-#include <Regex.h>
-
-Regex::~Regex()
-{
- if (buf->buffer) free(buf->buffer);
- if (buf->fastmap) free(buf->fastmap);
- if (buf->translate) free (buf->translate);
-
- if (reg->start)
- free (reg->start);
- if (reg->end)
- free (reg->end);
-
- delete(buf);
- delete(reg);
-}
-
-Regex::Regex(const char* t, int fast, int bufsize,
- const char* transtable)
-{
- int tlen = (t == 0)? 0 : strlen(t);
- buf = new re_pattern_buffer;
- memset (buf, 0, sizeof(re_pattern_buffer));
- reg = new re_registers;
- reg->start = 0;
- reg->end = 0;
- if (fast)
- buf->fastmap = (char*)malloc(256);
- else
- buf->fastmap = 0;
- buf->translate = (unsigned char*)transtable;
- if (tlen > bufsize)
- bufsize = tlen;
- buf->allocated = bufsize;
- buf->buffer = (char *)malloc(buf->allocated);
- const char* msg = re_compile_pattern((const char*)t, tlen, buf);
- if (msg != 0)
- (*lib_error_handler)("Regex", msg);
- else if (fast)
- re_compile_fastmap(buf);
-}
-
-int Regex::match_info(int& start, int& length, int nth) const
-{
- if ((unsigned)(nth) >= RE_NREGS)
- return 0;
- else
- {
- start = reg->start[nth];
- length = reg->end[nth] - start;
- return start >= 0 && length >= 0;
- }
-}
-
-int Regex::search(const char* s, int len, int& matchlen, int startpos) const
-{
- int matchpos, pos, range;
- if (startpos >= 0)
- {
- pos = startpos;
- range = len - startpos;
- }
- else
- {
- pos = len + startpos;
- range = -pos;
- }
- matchpos = re_search_2(buf, 0, 0, (char*)s, len, pos, range, reg, len);
- if (matchpos >= 0)
- matchlen = reg->end[0] - reg->start[0];
- else
- matchlen = 0;
- return matchpos;
-}
-
-int Regex::match(const char*s, int len, int p) const
-{
- if (p < 0)
- {
- p += len;
- if (p > len)
- return -1;
- return re_match_2(buf, 0, 0, (char*)s, p, 0, reg, p);
- }
- else if (p > len)
- return -1;
- else
- return re_match_2(buf, 0, 0, (char*)s, len, p, reg, len);
-}
-
-int Regex::OK() const
-{
-// can't verify much, since we've lost the original string
- int v = buf != 0; // have a regex buf
- v &= buf->buffer != 0; // with a pat
- if (!v) (*lib_error_handler)("Regex", "invariant failure");
- return v;
-}
-
-/*
- some built-in Regular expressions
-*/
-
-const Regex RXwhite("[ \n\t\r\v\f]+", 1);
-const Regex RXint("-?[0-9]+", 1);
-const Regex RXdouble("-?\\(\\([0-9]+\\.[0-9]*\\)\\|\\([0-9]+\\)\\|\\(\\.[0-9]+\\)\\)\\([eE][---+]?[0-9]+\\)?", 1, 200);
-const Regex RXalpha("[A-Za-z]+", 1);
-const Regex RXlowercase("[a-z]+", 1);
-const Regex RXuppercase("[A-Z]+", 1);
-const Regex RXalphanum("[0-9A-Za-z]+", 1);
-const Regex RXidentifier("[A-Za-z_][A-Za-z0-9_]*", 1);
-
diff --git a/contrib/libg++/libg++/src/Regex.h b/contrib/libg++/libg++/src/Regex.h
deleted file mode 100644
index 47f9a853a33d..000000000000
--- a/contrib/libg++/libg++/src/Regex.h
+++ /dev/null
@@ -1,78 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-
-#ifndef _Regex_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _Regex_h 1
-
-#undef OK
-
-#if defined(SHORT_NAMES) || defined(VMS)
-#define re_compile_pattern recmppat
-#define re_pattern_buffer repatbuf
-#define re_registers reregs
-#endif
-
-struct re_pattern_buffer; // defined elsewhere
-struct re_registers;
-
-class Regex
-{
-private:
-
- Regex(const Regex&) {} // no X(X&)
- void operator = (const Regex&) {} // no assignment
-
-protected:
- re_pattern_buffer* buf;
- re_registers* reg;
-
-public:
- Regex(const char* t,
- int fast = 0,
- int bufsize = 40,
- const char* transtable = 0);
-
- ~Regex();
-
- int match(const char* s, int len, int pos = 0) const;
- int search(const char* s, int len,
- int& matchlen, int startpos = 0) const;
- int match_info(int& start, int& length, int nth = 0) const;
-
- int OK() const; // representation invariant
-};
-
-// some built in regular expressions
-
-extern const Regex RXwhite; // = "[ \n\t\r\v\f]+"
-extern const Regex RXint; // = "-?[0-9]+"
-extern const Regex RXdouble; // = "-?\\(\\([0-9]+\\.[0-9]*\\)\\|
- // \\([0-9]+\\)\\|\\(\\.[0-9]+\\)\\)
- // \\([eE][---+]?[0-9]+\\)?"
-extern const Regex RXalpha; // = "[A-Za-z]+"
-extern const Regex RXlowercase; // = "[a-z]+"
-extern const Regex RXuppercase; // = "[A-Z]+"
-extern const Regex RXalphanum; // = "[0-9A-Za-z]+"
-extern const Regex RXidentifier; // = "[A-Za-z_][A-Za-z0-9_]*"
-
-
-#endif
diff --git a/contrib/libg++/libg++/src/RndInt.cc b/contrib/libg++/libg++/src/RndInt.cc
deleted file mode 100644
index c09f1e504d39..000000000000
--- a/contrib/libg++/libg++/src/RndInt.cc
+++ /dev/null
@@ -1,4 +0,0 @@
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <RndInt.h>
diff --git a/contrib/libg++/libg++/src/RndInt.h b/contrib/libg++/libg++/src/RndInt.h
deleted file mode 100644
index 7a73aee1c0be..000000000000
--- a/contrib/libg++/libg++/src/RndInt.h
+++ /dev/null
@@ -1,176 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1990 Free Software Foundation
- adapted from a submission from John Reidl <riedl@cs.purdue.edu>
-
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY. No author or distributor
-accepts responsibility to anyone for the consequences of using it
-or for whether it serves any particular purpose or works at all,
-unless he says so in writing. Refer to the GNU CC General Public
-License for full details.
-
-Everyone is granted permission to copy, modify and redistribute
-GNU CC, but only under the conditions described in the
-GNU CC General Public License. A copy of this license is
-supposed to have been given to you along with GNU CC so you
-can know your rights and responsibilities. It should be in a
-file named COPYING. Among other things, the copyright notice
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifndef _RandomInteger_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _RandomInteger_h 1
-
-// RandomInteger uses a random number generator to generate an integer
-// in a specified range. By default the range is 0..1. Since in my
-// experience random numbers are often needed for a wide variety of
-// ranges in the same program, this generator accepts a new low or high value
-// as an argument to the asLong and operator() methods to temporarily
-// override stored values
-
-#include <math.h>
-#include <RNG.h>
-
-class RandomInteger
-{
- protected:
- RNG *pGenerator;
- long pLow;
- long pHigh;
-
- long _asLong(long, long);
-
- public:
-
- RandomInteger(long low, long high, RNG *gen);
- RandomInteger(long high, RNG *gen);
- RandomInteger(RNG *gen);
-
-// read params
-
- long low() const;
- long high() const;
- RNG* generator() const;
-
-// change params
-
- long low(long x);
- long high(long x);
- RNG* generator(RNG *gen);
-
-// get a random number
-
- long asLong();
- long operator()(); // synonym for asLong
- int asInt(); // (possibly) truncate as int
-
-// override params for one shot
-
- long asLong(long high);
- long asLong(long low, long high);
-
- long operator () (long high); // synonyms
- long operator () (long low, long high);
-
-};
-
-
-inline RandomInteger::RandomInteger(long low, long high, RNG *gen)
- : pGenerator(gen),
- pLow((low < high) ? low : high),
- pHigh((low < high) ? high : low)
-
-{}
-
-inline RandomInteger::RandomInteger(long high, RNG *gen)
- : pGenerator(gen),
- pLow((0 < high) ? 0 : high),
- pHigh((0 < high) ? high : 0)
-{}
-
-
-inline RandomInteger::RandomInteger(RNG *gen)
- : pGenerator(gen),
- pLow(0),
- pHigh(1)
-{}
-
-inline RNG* RandomInteger::generator() const { return pGenerator;}
-inline long RandomInteger::low() const { return pLow; }
-inline long RandomInteger::high() const { return pHigh; }
-
-inline RNG* RandomInteger::generator(RNG *gen)
-{
- RNG *tmp = pGenerator; pGenerator = gen; return tmp;
-}
-
-inline long RandomInteger::low(long x)
-{
- long tmp = pLow; pLow = x; return tmp;
-}
-
-inline long RandomInteger:: high(long x)
-{
- long tmp = pHigh; pHigh = x; return tmp;
-}
-
-inline long RandomInteger:: _asLong(long low, long high)
-{
- return (pGenerator->asLong() % (high-low+1)) + low;
-}
-
-
-inline long RandomInteger:: asLong()
-{
- return _asLong(pLow, pHigh);
-}
-
-inline long RandomInteger:: asLong(long high)
-{
- return _asLong(pLow, high);
-}
-
-inline long RandomInteger:: asLong(long low, long high)
-{
- return _asLong(low, high);
-}
-
-inline long RandomInteger:: operator () ()
-{
- return _asLong(pLow, pHigh);
-}
-
-inline long RandomInteger:: operator () (long high)
-{
- return _asLong(pLow, high);
-}
-
-inline long RandomInteger:: operator () (long low, long high)
-{
- return _asLong(low, high);
-}
-
-
-
-
-inline int RandomInteger:: asInt()
-{
- return int(asLong());
-}
-
-#endif
diff --git a/contrib/libg++/libg++/src/SLList.cc b/contrib/libg++/libg++/src/SLList.cc
deleted file mode 100644
index 564e5997bdec..000000000000
--- a/contrib/libg++/libg++/src/SLList.cc
+++ /dev/null
@@ -1,247 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988, 1992 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifndef _G_NO_TEMPLATES
-#ifdef __GNUG__
-//#pragma implementation
-#endif
-#include <limits.h>
-#include <stream.h>
-#include <builtin.h>
-#include "SLList.h"
-
-void BaseSLList::error(const char* msg) const
-{
- (*lib_error_handler)("SLList", msg);
-}
-
-int BaseSLList::length() const
-{
- int l = 0;
- BaseSLNode* t = last;
- if (t != 0) do { ++l; t = t->tl; } while (t != last);
- return l;
-}
-
-void BaseSLList::clear()
-{
- if (last == 0)
- return;
-
- BaseSLNode* p = last->tl;
- last->tl = 0;
- last = 0;
-
- while (p != 0)
- {
- BaseSLNode* nxt = p->tl;
- delete_node(p);
- p = nxt;
- }
-}
-
-
-// Note: This is an internal method. It does *not* free old contents!
-
-void BaseSLList::copy(const BaseSLList& a)
-{
- if (a.last == 0)
- last = 0;
- else
- {
- BaseSLNode* p = a.last->tl;
- BaseSLNode* h = copy_node(p->item());
- last = h;
- for (;;)
- {
- if (p == a.last)
- {
- last->tl = h;
- return;
- }
- p = p->tl;
- BaseSLNode* n = copy_node(p->item());
- last->tl = n;
- last = n;
- }
- }
-}
-
-BaseSLList& BaseSLList::operator = (const BaseSLList& a)
-{
- if (last != a.last)
- {
- clear();
- copy(a);
- }
- return *this;
-}
-
-Pix BaseSLList::prepend(const void *datum)
-{
- return prepend(copy_node(datum));
-}
-
-
-Pix BaseSLList::prepend(BaseSLNode* t)
-{
- if (t == 0) return 0;
- if (last == 0)
- t->tl = last = t;
- else
- {
- t->tl = last->tl;
- last->tl = t;
- }
- return Pix(t);
-}
-
-
-Pix BaseSLList::append(const void *datum)
-{
- return append(copy_node(datum));
-}
-
-Pix BaseSLList::append(BaseSLNode* t)
-{
- if (t == 0) return 0;
- if (last == 0)
- t->tl = last = t;
- else
- {
- t->tl = last->tl;
- last->tl = t;
- last = t;
- }
- return Pix(t);
-}
-
-void BaseSLList::join(BaseSLList& b)
-{
- BaseSLNode* t = b.last;
- b.last = 0;
- if (last == 0)
- last = t;
- else if (t != 0)
- {
- BaseSLNode* f = last->tl;
- last->tl = t->tl;
- t->tl = f;
- last = t;
- }
-}
-
-Pix BaseSLList::ins_after(Pix p, const void *datum)
-{
- BaseSLNode* u = (BaseSLNode*)p;
- BaseSLNode* t = copy_node(datum);
- if (last == 0)
- t->tl = last = t;
- else if (u == 0) // ins_after 0 means prepend
- {
- t->tl = last->tl;
- last->tl = t;
- }
- else
- {
- t->tl = u->tl;
- u->tl = t;
- if (u == last)
- last = t;
- }
- return Pix(t);
-}
-
-void BaseSLList::del_after(Pix p)
-{
- BaseSLNode* u = (BaseSLNode*)p;
- if (last == 0 || u == last) error("cannot del_after last");
- if (u == 0) u = last; // del_after 0 means delete first
- BaseSLNode* t = u->tl;
- if (u == t)
- last = 0;
- else
- {
- u->tl = t->tl;
- if (last == t)
- last = u;
- }
- delete_node(t);
-}
-
-int BaseSLList::owns(Pix p) const
-{
- BaseSLNode* t = last;
- if (t != 0 && p != 0)
- {
- do
- {
- if (Pix(t) == p) return 1;
- t = t->tl;
- } while (t != last);
- }
- return 0;
-}
-
-int BaseSLList::remove_front(void *dst, int signal_error)
-{
- if (last)
- {
- BaseSLNode* t = last->tl;
- copy_item(dst, t->item());
- if (t == last)
- last = 0;
- else
- last->tl = t->tl;
- delete_node(t);
- return 1;
- }
- if (signal_error)
- error("remove_front of empty list");
- return 0;
-}
-
-void BaseSLList::del_front()
-{
- if (last == 0) error("del_front of empty list");
- BaseSLNode* t = last->tl;
- if (t == last)
- last = 0;
- else
- last->tl = t->tl;
- delete_node(t);
-}
-
-int BaseSLList::OK() const
-{
- int v = 1;
- if (last != 0)
- {
- BaseSLNode* t = last;
- long count = LONG_MAX; // Lots of chances to find last!
- do
- {
- count--;
- t = t->tl;
- } while (count > 0 && t != last);
- v &= count > 0;
- }
- if (!v) error("invariant failure");
- return v;
-}
-#endif /*!_G_NO_TEMPLATES*/
diff --git a/contrib/libg++/libg++/src/SLList.h b/contrib/libg++/libg++/src/SLList.h
deleted file mode 100644
index 072f249fe1db..000000000000
--- a/contrib/libg++/libg++/src/SLList.h
+++ /dev/null
@@ -1,129 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988, 1992 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifndef _SLList_h
-#ifdef __GNUG__
-//#pragma interface
-#endif
-#define _SLList_h 1
-
-#undef OK
-
-#include <Pix.h>
-
-struct BaseSLNode
-{
- union {
- struct BaseSLNode *tl;
- double dummy; /* To force correct alignment */
- };
- void *item() {return (void*)(this+1);} // Return ((SLNode<T>*)this)->hd
-};
-
-template<class T>
-class SLNode : public BaseSLNode
-{
- public:
- T hd; // Data part of node
- SLNode() { }
- SLNode(const T& h, SLNode* t = 0)
- : hd(h) { tl = t; }
- ~SLNode() { }
-};
-
-extern int __SLListLength(BaseSLNode *ptr);
-
-class BaseSLList {
- protected:
- BaseSLNode *last;
- virtual void delete_node(BaseSLNode*node) = 0;
- virtual BaseSLNode* copy_node(const void* datum) = 0;
- virtual void copy_item(void *dst, void *src) = 0;
- virtual ~BaseSLList() { }
- BaseSLList() { last = 0; }
- void copy(const BaseSLList&);
- BaseSLList& operator = (const BaseSLList& a);
- Pix ins_after(Pix p, const void *datum);
- Pix prepend(const void *datum);
- Pix append(const void *datum);
- int remove_front(void *dst, int signal_error = 0);
- void join(BaseSLList&);
- public:
- int length() const;
- int empty() const { return last == 0; }
- void clear();
- Pix prepend(BaseSLNode*);
- Pix append(BaseSLNode*);
- int OK() const;
- void error(const char* msg) const;
- void del_after(Pix p);
- int owns(Pix p) const;
- void del_front();
-};
-
-template <class T>
-class SLList : public BaseSLList
-{
- private:
- virtual void delete_node(BaseSLNode *node) { delete (SLNode<T>*)node; }
- virtual BaseSLNode* copy_node(const void *datum)
- { return new SLNode<T>(*(const T*)datum); }
- virtual void copy_item(void *dst, void *src) { *(T*)dst = *(T*)src; }
-
-public:
- SLList() : BaseSLList() { }
- SLList(const SLList<T>& a) : BaseSLList() { copy(a); }
- SLList<T>& operator = (const SLList<T>& a)
- { BaseSLList::operator=((const BaseSLList&) a); return *this; }
- virtual ~SLList() { clear(); }
-
- Pix prepend(const T& item) {return BaseSLList::prepend(&item);}
- Pix append(const T& item) {return BaseSLList::append(&item);}
- Pix prepend(SLNode<T>* node) {return BaseSLList::prepend(node);}
- Pix append(SLNode<T>* node) {return BaseSLList::append(node);}
-
- T& operator () (Pix p) {
- if (p == 0) error("null Pix");
- return ((SLNode<T>*)(p))->hd; }
- const T& operator () (Pix p) const {
- if (p == 0) error("null Pix");
- return ((SLNode<T>*)(p))->hd; }
- inline Pix first() const { return (last == 0) ? 0 : Pix(last->tl); }
- void next(Pix& p) const
- { p = (p == 0 || p == last) ? 0 : Pix(((SLNode<T>*)(p))->tl); }
- Pix ins_after(Pix p, const T& item)
- { return BaseSLList::ins_after(p, &item); }
- void join(SLList<T>& a) { BaseSLList::join(a); }
-
- T& front() {
- if (last == 0) error("front: empty list");
- return ((SLNode<T>*)last->tl)->hd; }
- T& rear() {
- if (last == 0) error("rear: empty list");
- return ((SLNode<T>*)last)->hd; }
- const T& front() const {
- if (last == 0) error("front: empty list");
- return ((SLNode<T>*)last->tl)->hd; }
- const T& rear() const {
- if (last == 0) error("rear: empty list");
- return ((SLNode<T>*)last)->hd; }
- int remove_front(T& x) { return BaseSLList::remove_front(&x); }
- T remove_front() { T dst; BaseSLList::remove_front(&dst, 1); return dst; }
-};
-
-#endif
diff --git a/contrib/libg++/libg++/src/Sample.cc b/contrib/libg++/libg++/src/Sample.cc
deleted file mode 100644
index 7ac3b1ca589a..000000000000
--- a/contrib/libg++/libg++/src/Sample.cc
+++ /dev/null
@@ -1,241 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Dirk Grunwald (grunwald@cs.uiuc.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <stream.h>
-#include <SmplStat.h>
-#include <math.h>
-#include <float.h>
-
-#ifndef HUGE_VAL
-#ifdef HUGE
-#define HUGE_VAL HUGE
-#else
-#define HUGE_VAL DBL_MAX
-#endif
-#endif
-
-// error handling
-
-void default_SampleStatistic_error_handler(const char* msg)
-{
- cerr << "Fatal SampleStatistic error. " << msg << "\n";
- exit(1);
-}
-
-one_arg_error_handler_t SampleStatistic_error_handler = default_SampleStatistic_error_handler;
-
-one_arg_error_handler_t set_SampleStatistic_error_handler(one_arg_error_handler_t f)
-{
- one_arg_error_handler_t old = SampleStatistic_error_handler;
- SampleStatistic_error_handler = f;
- return old;
-}
-
-void SampleStatistic::error(const char* msg)
-{
- (*SampleStatistic_error_handler)(msg);
-}
-
-// t-distribution: given p-value and degrees of freedom, return t-value
-// adapted from Peizer & Pratt JASA, vol63, p1416
-
-double tval(double p, int df)
-{
- double t;
- int positive = p >= 0.5;
- p = (positive)? 1.0 - p : p;
- if (p <= 0.0 || df <= 0)
- t = HUGE_VAL;
- else if (p == 0.5)
- t = 0.0;
- else if (df == 1)
- t = 1.0 / tan((p + p) * 1.57079633);
- else if (df == 2)
- t = sqrt(1.0 / ((p + p) * (1.0 - p)) - 2.0);
- else
- {
- double ddf = df;
- double a = sqrt(log(1.0 / (p * p)));
- double aa = a * a;
- a = a - ((2.515517 + (0.802853 * a) + (0.010328 * aa)) /
- (1.0 + (1.432788 * a) + (0.189269 * aa) +
- (0.001308 * aa * a)));
- t = ddf - 0.666666667 + 1.0 / (10.0 * ddf);
- t = sqrt(ddf * (exp(a * a * (ddf - 0.833333333) / (t * t)) - 1.0));
- }
- return (positive)? t : -t;
-}
-
-void
-SampleStatistic::reset()
-{
- n = 0; x = x2 = 0.0;
- maxValue = -HUGE_VAL;
- minValue = HUGE_VAL;
-}
-
-void
-SampleStatistic::operator+=(double value)
-{
- n += 1;
- x += value;
- x2 += (value * value);
- if ( minValue > value) minValue = value;
- if ( maxValue < value) maxValue = value;
-}
-
-double
-SampleStatistic::mean()
-{
- if ( n > 0) {
- return (x / n);
- }
- else {
- return ( 0.0 );
- }
-}
-
-double
-SampleStatistic::var()
-{
- if ( n > 1) {
- return(( x2 - ((x * x) / n)) / ( n - 1));
- }
- else {
- return ( 0.0 );
- }
-}
-
-double
-SampleStatistic::stdDev()
-{
- if ( n <= 0 || this -> var() <= 0) {
- return(0);
- } else {
- return( (double) sqrt( var() ) );
- }
-}
-
-double
-SampleStatistic::confidence(int interval)
-{
- int df = n - 1;
- if (df <= 0) return HUGE_VAL;
- double t = tval(double(100 + interval) * 0.005, df);
- if (t == HUGE_VAL)
- return t;
- else
- return (t * stdDev()) / sqrt(double(n));
-}
-
-double
-SampleStatistic::confidence(double p_value)
-{
- int df = n - 1;
- if (df <= 0) return HUGE_VAL;
- double t = tval((1.0 + p_value) * 0.5, df);
- if (t == HUGE_VAL)
- return t;
- else
- return (t * stdDev()) / sqrt(double(n));
-}
-
-
-#include <SmplHist.h>
-
-const int SampleHistogramMinimum = -2;
-const int SampleHistogramMaximum = -1;
-
-SampleHistogram::SampleHistogram(double low, double high, double width)
-{
- if (high < low) {
- double t = high;
- high = low;
- low = t;
- }
-
- if (width == -1) {
- width = (high - low) / 10;
- }
-
- howManyBuckets = int((high - low) / width) + 2;
- bucketCount = new int[howManyBuckets];
- bucketLimit = new double[howManyBuckets];
- double lim = low;
- for (int i = 0; i < howManyBuckets; i++) {
- bucketCount[i] = 0;
- bucketLimit[i] = lim;
- lim += width;
- }
- bucketLimit[howManyBuckets-1] = HUGE_VAL; /* from math.h */
-}
-
-SampleHistogram::~SampleHistogram()
-{
- if (howManyBuckets > 0) {
- delete bucketCount;
- delete bucketLimit;
- }
-}
-
-void
-SampleHistogram::operator+=(double value)
-{
- int i;
- for (i = 0; i < howManyBuckets; i++) {
- if (value < bucketLimit[i]) break;
- }
- bucketCount[i]++;
- this->SampleStatistic::operator+=(value);
-}
-
-int
-SampleHistogram::similarSamples(double d)
-{
- int i;
- for (i = 0; i < howManyBuckets; i++) {
- if (d < bucketLimit[i]) return(bucketCount[i]);
- }
- return(0);
-}
-
-void
-SampleHistogram::printBuckets(ostream& s)
-{
- for(int i = 0; i < howManyBuckets; i++) {
- if (bucketLimit[i] >= HUGE_VAL) {
- s << "< max : " << bucketCount[i] << "\n";
- } else {
- s << "< " << bucketLimit[i] << " : " << bucketCount[i] << "\n";
- }
- }
-}
-
-void
-SampleHistogram::reset()
-{
- this->SampleStatistic::reset();
- if (howManyBuckets > 0) {
- for (register int i = 0; i < howManyBuckets; i++) {
- bucketCount[i] = 0;
- }
- }
-}
-
diff --git a/contrib/libg++/libg++/src/SmplHist.cc b/contrib/libg++/libg++/src/SmplHist.cc
deleted file mode 100644
index 5dbe2c793279..000000000000
--- a/contrib/libg++/libg++/src/SmplHist.cc
+++ /dev/null
@@ -1,112 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Dirk Grunwald (grunwald@cs.uiuc.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <stream.h>
-#include <SmplHist.h>
-#include <math.h>
-
-#ifndef HUGE_VAL
-#ifdef HUGE
-#define HUGE_VAL HUGE
-#else
-#include <float.h>
-#define HUGE_VAL DBL_MAX
-#endif
-#endif
-
-const int SampleHistogramMinimum = -2;
-const int SampleHistogramMaximum = -1;
-
-SampleHistogram::SampleHistogram(double low, double high, double width)
-{
- if (high < low) {
- double t = high;
- high = low;
- low = t;
- }
-
- if (width == -1) {
- width = (high - low) / 10;
- }
-
- howManyBuckets = int((high - low) / width) + 2;
- bucketCount = new int[howManyBuckets];
- bucketLimit = new double[howManyBuckets];
- double lim = low;
- for (int i = 0; i < howManyBuckets; i++) {
- bucketCount[i] = 0;
- bucketLimit[i] = lim;
- lim += width;
- }
- bucketLimit[howManyBuckets-1] = HUGE_VAL; /* from math.h */
-}
-
-SampleHistogram::~SampleHistogram()
-{
- if (howManyBuckets > 0) {
- delete bucketCount;
- delete bucketLimit;
- }
-}
-
-void
-SampleHistogram::operator+=(double value)
-{
- int i;
- for (i = 0; i < howManyBuckets; i++) {
- if (value < bucketLimit[i]) break;
- }
- bucketCount[i]++;
- this->SampleStatistic::operator+=(value);
-}
-
-int
-SampleHistogram::similarSamples(double d)
-{
- int i;
- for (i = 0; i < howManyBuckets; i++) {
- if (d < bucketLimit[i]) return(bucketCount[i]);
- }
- return(0);
-}
-
-void
-SampleHistogram::printBuckets(ostream& s)
-{
- for(int i = 0; i < howManyBuckets; i++) {
- if (bucketLimit[i] >= HUGE_VAL) {
- s << "< max : " << bucketCount[i] << "\n";
- } else {
- s << "< " << bucketLimit[i] << " : " << bucketCount[i] << "\n";
- }
- }
-}
-
-void
-SampleHistogram::reset()
-{
- this->SampleStatistic::reset();
- if (howManyBuckets > 0) {
- for (register int i = 0; i < howManyBuckets; i++) {
- bucketCount[i] = 0;
- }
- }
-}
-
diff --git a/contrib/libg++/libg++/src/SmplHist.h b/contrib/libg++/libg++/src/SmplHist.h
deleted file mode 100644
index 959d6d4bc7a9..000000000000
--- a/contrib/libg++/libg++/src/SmplHist.h
+++ /dev/null
@@ -1,72 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Dirk Grunwald (grunwald@cs.uiuc.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifndef SampleHistogram_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define SampleHistogram_h 1
-
-#include <iostream.h>
-#include <SmplStat.h>
-
-extern const int SampleHistogramMinimum;
-extern const int SampleHistogramMaximum;
-
-class SampleHistogram : public SampleStatistic
-{
-protected:
- short howManyBuckets;
- int *bucketCount;
- double *bucketLimit;
-
-public:
-
- SampleHistogram(double low, double hi, double bucketWidth = -1.0);
-
- ~SampleHistogram();
-
- virtual void reset();
- virtual void operator+=(double);
-
- int similarSamples(double);
-
- int buckets();
-
- double bucketThreshold(int i);
- int inBucket(int i);
- void printBuckets(ostream&);
-
-};
-
-
-inline int SampleHistogram:: buckets() { return(howManyBuckets); };
-
-inline double SampleHistogram:: bucketThreshold(int i) {
- if (i < 0 || i >= howManyBuckets)
- error("invalid bucket access");
- return(bucketLimit[i]);
-}
-
-inline int SampleHistogram:: inBucket(int i) {
- if (i < 0 || i >= howManyBuckets)
- error("invalid bucket access");
- return(bucketCount[i]);
-}
-
-#endif
diff --git a/contrib/libg++/libg++/src/SmplStat.cc b/contrib/libg++/libg++/src/SmplStat.cc
deleted file mode 100644
index 9db3caa845d2..000000000000
--- a/contrib/libg++/libg++/src/SmplStat.cc
+++ /dev/null
@@ -1,160 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Dirk Grunwald (grunwald@cs.uiuc.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <stream.h>
-#include <SmplStat.h>
-#include <math.h>
-
-#ifndef HUGE_VAL
-#ifdef HUGE
-#define HUGE_VAL HUGE
-#else
-#include <float.h>
-#define HUGE_VAL DBL_MAX
-#endif
-#endif
-
-// error handling
-
-void default_SampleStatistic_error_handler(const char* msg)
-{
- cerr << "Fatal SampleStatistic error. " << msg << "\n";
- exit(1);
-}
-
-one_arg_error_handler_t SampleStatistic_error_handler = default_SampleStatistic_error_handler;
-
-one_arg_error_handler_t set_SampleStatistic_error_handler(one_arg_error_handler_t f)
-{
- one_arg_error_handler_t old = SampleStatistic_error_handler;
- SampleStatistic_error_handler = f;
- return old;
-}
-
-void SampleStatistic::error(const char* msg)
-{
- (*SampleStatistic_error_handler)(msg);
-}
-
-// t-distribution: given p-value and degrees of freedom, return t-value
-// adapted from Peizer & Pratt JASA, vol63, p1416
-
-double tval(double p, int df)
-{
- double t;
- int positive = p >= 0.5;
- p = (positive)? 1.0 - p : p;
- if (p <= 0.0 || df <= 0)
- t = HUGE_VAL;
- else if (p == 0.5)
- t = 0.0;
- else if (df == 1)
- t = 1.0 / tan((p + p) * 1.57079633);
- else if (df == 2)
- t = sqrt(1.0 / ((p + p) * (1.0 - p)) - 2.0);
- else
- {
- double ddf = df;
- double a = sqrt(log(1.0 / (p * p)));
- double aa = a * a;
- a = a - ((2.515517 + (0.802853 * a) + (0.010328 * aa)) /
- (1.0 + (1.432788 * a) + (0.189269 * aa) +
- (0.001308 * aa * a)));
- t = ddf - 0.666666667 + 1.0 / (10.0 * ddf);
- t = sqrt(ddf * (exp(a * a * (ddf - 0.833333333) / (t * t)) - 1.0));
- }
- return (positive)? t : -t;
-}
-
-void
-SampleStatistic::reset()
-{
- n = 0; x = x2 = 0.0;
- maxValue = -HUGE_VAL;
- minValue = HUGE_VAL;
-}
-
-void
-SampleStatistic::operator+=(double value)
-{
- n += 1;
- x += value;
- x2 += (value * value);
- if ( minValue > value) minValue = value;
- if ( maxValue < value) maxValue = value;
-}
-
-double
-SampleStatistic::mean()
-{
- if ( n > 0) {
- return (x / n);
- }
- else {
- return ( 0.0 );
- }
-}
-
-double
-SampleStatistic::var()
-{
- if ( n > 1) {
- return(( x2 - ((x * x) / n)) / ( n - 1));
- }
- else {
- return ( 0.0 );
- }
-}
-
-double
-SampleStatistic::stdDev()
-{
- if ( n <= 0 || this -> var() <= 0) {
- return(0);
- } else {
- return( (double) sqrt( var() ) );
- }
-}
-
-double
-SampleStatistic::confidence(int interval)
-{
- int df = n - 1;
- if (df <= 0) return HUGE_VAL;
- double t = tval(double(100 + interval) * 0.005, df);
- if (t == HUGE_VAL)
- return t;
- else
- return (t * stdDev()) / sqrt(double(n));
-}
-
-double
-SampleStatistic::confidence(double p_value)
-{
- int df = n - 1;
- if (df <= 0) return HUGE_VAL;
- double t = tval((1.0 + p_value) * 0.5, df);
- if (t == HUGE_VAL)
- return t;
- else
- return (t * stdDev()) / sqrt(double(n));
-}
-
-
diff --git a/contrib/libg++/libg++/src/SmplStat.h b/contrib/libg++/libg++/src/SmplStat.h
deleted file mode 100644
index 441692f8c7be..000000000000
--- a/contrib/libg++/libg++/src/SmplStat.h
+++ /dev/null
@@ -1,69 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Dirk Grunwald (grunwald@cs.uiuc.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#ifndef SampleStatistic_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define SampleStatistic_h 1
-
-#include <builtin.h>
-
-#undef min
-#undef max
-
-class SampleStatistic {
-protected:
- int n;
- double x;
- double x2;
- double minValue, maxValue;
-
- public :
-
- SampleStatistic();
- inline virtual ~SampleStatistic();
- virtual void reset();
-
- virtual void operator+=(double);
- int samples();
- double mean();
- double stdDev();
- double var();
- double min();
- double max();
- double confidence(int p_percentage);
- double confidence(double p_value);
-
- void error(const char* msg);
-};
-
-// error handlers
-
-extern void default_SampleStatistic_error_handler(const char*);
-extern one_arg_error_handler_t SampleStatistic_error_handler;
-
-extern one_arg_error_handler_t
- set_SampleStatistic_error_handler(one_arg_error_handler_t f);
-
-inline SampleStatistic:: SampleStatistic(){ reset();}
-inline int SampleStatistic:: samples() {return(n);}
-inline double SampleStatistic:: min() {return(minValue);}
-inline double SampleStatistic:: max() {return(maxValue);}
-inline SampleStatistic::~SampleStatistic() {}
-
-#endif
diff --git a/contrib/libg++/libg++/src/String.cc b/contrib/libg++/libg++/src/String.cc
deleted file mode 100644
index cda827317916..000000000000
--- a/contrib/libg++/libg++/src/String.cc
+++ /dev/null
@@ -1,1307 +0,0 @@
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-/*
- String class implementation
- */
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <String.h>
-#include <std.h>
-#include <ctype.h>
-#include <limits.h>
-#include <new.h>
-#include <builtin.h>
-
-#undef OK
-
-void String::error(const char* msg) const
-{
- (*lib_error_handler)("String", msg);
-}
-
-String::operator const char*() const
-{
- return (const char*)chars();
-}
-
-// globals
-
-StrRep _nilStrRep = { 0, 1, { 0 } }; // nil strings point here
-String _nilString; // nil SubStrings point here
-
-
-
-
-/*
- the following inline fcts are specially designed to work
- in support of String classes, and are not meant as generic replacements
- for libc "str" functions.
-
- inline copy fcts - I like left-to-right from->to arguments.
- all versions assume that `to' argument is non-null
-
- These are worth doing inline, rather than through calls because,
- via procedural integration, adjacent copy calls can be smushed
- together by the optimizer.
-*/
-
-// copy n bytes
-inline static void ncopy(const char* from, char* to, int n)
-{
- if (from != to) while (--n >= 0) *to++ = *from++;
-}
-
-// copy n bytes, null-terminate
-inline static void ncopy0(const char* from, char* to, int n)
-{
- if (from != to)
- {
- while (--n >= 0) *to++ = *from++;
- *to = 0;
- }
- else
- to[n] = 0;
-}
-
-// copy until null
-inline static void scopy(const char* from, char* to)
-{
- if (from != 0) while((*to++ = *from++) != 0);
-}
-
-// copy right-to-left
-inline static void revcopy(const char* from, char* to, short n)
-{
- if (from != 0) while (--n >= 0) *to-- = *from--;
-}
-
-
-inline static int slen(const char* t) // inline strlen
-{
- if (t == 0)
- return 0;
- else
- {
- const char* a = t;
- while (*a++ != 0);
- return a - 1 - t;
- }
-}
-
-// minimum & maximum representable rep size
-
-#define MAXStrRep_SIZE ((1 << (sizeof(short) * CHAR_BIT - 1)) - 1)
-#define MINStrRep_SIZE 16
-
-#ifndef MALLOC_MIN_OVERHEAD
-#define MALLOC_MIN_OVERHEAD 4
-#endif
-
-// The basic allocation primitive:
-// Always round request to something close to a power of two.
-// This ensures a bit of padding, which often means that
-// concatenations don't have to realloc. Plus it tends to
-// be faster when lots of Strings are created and discarded,
-// since just about any version of malloc (op new()) will
-// be faster when it can reuse identically-sized chunks
-
-inline static StrRep* Snew(int newsiz)
-{
- unsigned int siz = sizeof(StrRep) + newsiz + MALLOC_MIN_OVERHEAD;
- unsigned int allocsiz = MINStrRep_SIZE;
- while (allocsiz < siz) allocsiz <<= 1;
- allocsiz -= MALLOC_MIN_OVERHEAD;
- if (allocsiz >= MAXStrRep_SIZE)
- (*lib_error_handler)("String", "Requested length out of range");
-
- StrRep* rep = new (operator new (allocsiz)) StrRep;
- rep->sz = allocsiz - sizeof(StrRep);
- return rep;
-}
-
-// Do-something-while-allocating routines.
-
-// We live with two ways to signify empty Sreps: either the
-// null pointer (0) or a pointer to the nilStrRep.
-
-// We always signify unknown source lengths (usually when fed a char*)
-// via len == -1, in which case it is computed.
-
-// allocate, copying src if nonull
-
-StrRep* Salloc(StrRep* old, const char* src, int srclen, int newlen)
-{
- if (old == &_nilStrRep) old = 0;
- if (srclen < 0) srclen = slen(src);
- if (newlen < srclen) newlen = srclen;
- StrRep* rep;
- if (old == 0 || newlen > old->sz)
- rep = Snew(newlen);
- else
- rep = old;
-
- rep->len = newlen;
- ncopy0(src, rep->s, srclen);
-
- if (old != rep && old != 0) delete old;
-
- return rep;
-}
-
-// reallocate: Given the initial allocation scheme, it will
-// generally be faster in the long run to get new space & copy
-// than to call realloc
-
-static StrRep*
-Sresize(StrRep* old, int newlen)
-{
- if (old == &_nilStrRep) old = 0;
- StrRep* rep;
- if (old == 0)
- rep = Snew(newlen);
- else if (newlen > old->sz)
- {
- rep = Snew(newlen);
- ncopy0(old->s, rep->s, old->len);
- delete old;
- }
- else
- rep = old;
-
- rep->len = newlen;
-
- return rep;
-}
-
-void
-String::alloc (int newsize)
-{
- unsigned short old_len = rep->len;
- rep = Sresize(rep, newsize);
- rep->len = old_len;
-}
-
-// like allocate, but we know that src is a StrRep
-
-StrRep* Scopy(StrRep* old, const StrRep* s)
-{
- if (old == &_nilStrRep) old = 0;
- if (s == &_nilStrRep) s = 0;
- if (old == s)
- return (old == 0)? &_nilStrRep : old;
- else if (s == 0)
- {
- old->s[0] = 0;
- old->len = 0;
- return old;
- }
- else
- {
- StrRep* rep;
- int newlen = s->len;
- if (old == 0 || newlen > old->sz)
- {
- if (old != 0) delete old;
- rep = Snew(newlen);
- }
- else
- rep = old;
- rep->len = newlen;
- ncopy0(s->s, rep->s, newlen);
- return rep;
- }
-}
-
-// allocate & concatenate
-
-StrRep* Scat(StrRep* old, const char* s, int srclen, const char* t, int tlen)
-{
- if (old == &_nilStrRep) old = 0;
- if (srclen < 0) srclen = slen(s);
- if (tlen < 0) tlen = slen(t);
- int newlen = srclen + tlen;
- StrRep* rep;
-
- if (old == 0 || newlen > old->sz ||
- (t >= old->s && t < &(old->s[old->len]))) // beware of aliasing
- rep = Snew(newlen);
- else
- rep = old;
-
- rep->len = newlen;
-
- ncopy(s, rep->s, srclen);
- ncopy0(t, &(rep->s[srclen]), tlen);
-
- if (old != rep && old != 0) delete old;
-
- return rep;
-}
-
-// double-concatenate
-
-StrRep* Scat(StrRep* old, const char* s, int srclen, const char* t, int tlen,
- const char* u, int ulen)
-{
- if (old == &_nilStrRep) old = 0;
- if (srclen < 0) srclen = slen(s);
- if (tlen < 0) tlen = slen(t);
- if (ulen < 0) ulen = slen(u);
- int newlen = srclen + tlen + ulen;
- StrRep* rep;
- if (old == 0 || newlen > old->sz ||
- (t >= old->s && t < &(old->s[old->len])) ||
- (u >= old->s && u < &(old->s[old->len])))
- rep = Snew(newlen);
- else
- rep = old;
-
- rep->len = newlen;
-
- ncopy(s, rep->s, srclen);
- ncopy(t, &(rep->s[srclen]), tlen);
- ncopy0(u, &(rep->s[srclen+tlen]), ulen);
-
- if (old != rep && old != 0) delete old;
-
- return rep;
-}
-
-// like cat, but we know that new stuff goes in the front of existing rep
-
-StrRep* Sprepend(StrRep* old, const char* t, int tlen)
-{
- char* s;
- int srclen;
- if (old == &_nilStrRep || old == 0)
- {
- s = 0; old = 0; srclen = 0;
- }
- else
- {
- s = old->s; srclen = old->len;
- }
- if (tlen < 0) tlen = slen(t);
- int newlen = srclen + tlen;
- StrRep* rep;
- if (old == 0 || newlen > old->sz ||
- (t >= old->s && t < &(old->s[old->len])))
- rep = Snew(newlen);
- else
- rep = old;
-
- rep->len = newlen;
-
- revcopy(&(s[srclen]), &(rep->s[newlen]), srclen+1);
- ncopy(t, rep->s, tlen);
-
- if (old != rep && old != 0) delete old;
-
- return rep;
-}
-
-
-// string compare: first argument is known to be non-null
-
-inline static int scmp(const char* a, const char* b)
-{
- if (b == 0)
- return *a != 0;
- else
- {
- int diff = 0;
- while ((diff = *a - *b++) == 0 && *a++ != 0);
- return diff;
- }
-}
-
-
-inline static int ncmp(const char* a, int al, const char* b, int bl)
-{
- int n = (al <= bl)? al : bl;
- int diff;
- while (n-- > 0) if ((diff = *a++ - *b++) != 0) return diff;
- return al - bl;
-}
-
-int fcompare(const String& x, const String& y)
-{
- const char* a = x.chars();
- const char* b = y.chars();
- int al = x.length();
- int bl = y.length();
- int n = (al <= bl)? al : bl;
- int diff = 0;
- while (n-- > 0)
- {
- char ac = *a++;
- char bc = *b++;
- if ((diff = ac - bc) != 0)
- {
- if (ac >= 'a' && ac <= 'z')
- ac = ac - 'a' + 'A';
- if (bc >= 'a' && bc <= 'z')
- bc = bc - 'a' + 'A';
- if ((diff = ac - bc) != 0)
- return diff;
- }
- }
- return al - bl;
-}
-
-// these are not inline, but pull in the above inlines, so are
-// pretty fast
-
-int compare(const String& x, const char* b)
-{
- return scmp(x.chars(), b);
-}
-
-int compare(const String& x, const String& y)
-{
- return scmp(x.chars(), y.chars());
-}
-
-int compare(const String& x, const SubString& y)
-{
- return ncmp(x.chars(), x.length(), y.chars(), y.length());
-}
-
-int compare(const SubString& x, const String& y)
-{
- return ncmp(x.chars(), x.length(), y.chars(), y.length());
-}
-
-int compare(const SubString& x, const SubString& y)
-{
- return ncmp(x.chars(), x.length(), y.chars(), y.length());
-}
-
-int compare(const SubString& x, const char* b)
-{
- if (b == 0)
- return x.length();
- else
- {
- const char* a = x.chars();
- int n = x.length();
- int diff;
- while (n-- > 0) if ((diff = *a++ - *b++) != 0) return diff;
- return (*b == 0) ? 0 : -1;
- }
-}
-
-/*
- index fcts
-*/
-
-int String::search(int start, int sl, char c) const
-{
- const char* s = chars();
- if (sl > 0)
- {
- if (start >= 0)
- {
- const char* a = &(s[start]);
- const char* lasta = &(s[sl]);
- while (a < lasta) if (*a++ == c) return --a - s;
- }
- else
- {
- const char* a = &(s[sl + start + 1]);
- while (--a >= s) if (*a == c) return a - s;
- }
- }
- return -1;
-}
-
-int String::search(int start, int sl, const char* t, int tl) const
-{
- const char* s = chars();
- if (tl < 0) tl = slen(t);
- if (sl > 0 && tl > 0)
- {
- if (start >= 0)
- {
- const char* lasts = &(s[sl - tl]);
- const char* lastt = &(t[tl]);
- const char* p = &(s[start]);
-
- while (p <= lasts)
- {
- const char* x = p++;
- const char* y = t;
- while (*x++ == *y++) if (y >= lastt) return --p - s;
- }
- }
- else
- {
- const char* firsts = &(s[tl - 1]);
- const char* lastt = &(t[tl - 1]);
- const char* p = &(s[sl + start + 1]);
-
- while (--p >= firsts)
- {
- const char* x = p;
- const char* y = lastt;
- while (*x-- == *y--) if (y < t) return ++x - s;
- }
- }
- }
- return -1;
-}
-
-int String::match(int start, int sl, int exact, const char* t, int tl) const
-{
- if (tl < 0) tl = slen(t);
-
- if (start < 0)
- {
- start = sl + start - tl + 1;
- if (start < 0 || (exact && start != 0))
- return -1;
- }
- else if (exact && sl - start != tl)
- return -1;
-
- if (sl == 0 || tl == 0 || sl - start < tl || start >= sl)
- return -1;
-
- int n = tl;
- const char* s = &(rep->s[start]);
- while (--n >= 0) if (*s++ != *t++) return -1;
- return tl;
-}
-
-void SubString::assign(const StrRep* ysrc, const char* ys, int ylen)
-{
- if (&S == &_nilString) return;
-
- if (ylen < 0) ylen = slen(ys);
- StrRep* targ = S.rep;
- int sl = targ->len - len + ylen;
-
- if (ysrc == targ || sl >= targ->sz)
- {
- StrRep* oldtarg = targ;
- targ = Sresize(0, sl);
- ncopy(oldtarg->s, targ->s, pos);
- ncopy(ys, &(targ->s[pos]), ylen);
- scopy(&(oldtarg->s[pos + len]), &(targ->s[pos + ylen]));
- delete oldtarg;
- }
- else if (len == ylen)
- ncopy(ys, &(targ->s[pos]), len);
- else if (ylen < len)
- {
- ncopy(ys, &(targ->s[pos]), ylen);
- scopy(&(targ->s[pos + len]), &(targ->s[pos + ylen]));
- }
- else
- {
- revcopy(&(targ->s[targ->len]), &(targ->s[sl]), targ->len-pos-len +1);
- ncopy(ys, &(targ->s[pos]), ylen);
- }
- targ->len = sl;
- S.rep = targ;
-}
-
-
-
-/*
- * substitution
- */
-
-
-int String::_gsub(const char* pat, int pl, const char* r, int rl)
-{
- int nmatches = 0;
- if (pl < 0) pl = slen(pat);
- if (rl < 0) rl = slen(r);
- int sl = length();
- if (sl <= 0 || pl <= 0 || sl < pl)
- return nmatches;
-
- const char* s = chars();
-
- // prepare to make new rep
- StrRep* nrep = 0;
- int nsz = 0;
- char* x = 0;
-
- int si = 0;
- int xi = 0;
- int remaining = sl;
-
- while (remaining >= pl)
- {
- int pos = search(si, sl, pat, pl);
- if (pos < 0)
- break;
- else
- {
- ++nmatches;
- int mustfit = xi + remaining + rl - pl;
- if (mustfit >= nsz)
- {
- if (nrep != 0) nrep->len = xi;
- nrep = Sresize(nrep, mustfit);
- nsz = nrep->sz;
- x = nrep->s;
- }
- pos -= si;
- ncopy(&(s[si]), &(x[xi]), pos);
- ncopy(r, &(x[xi + pos]), rl);
- si += pos + pl;
- remaining -= pos + pl;
- xi += pos + rl;
- }
- }
-
- if (nrep == 0)
- {
- if (nmatches == 0)
- return nmatches;
- else
- nrep = Sresize(nrep, xi+remaining);
- }
-
- ncopy0(&(s[si]), &(x[xi]), remaining);
- nrep->len = xi + remaining;
-
- if (nrep->len <= rep->sz) // fit back in if possible
- {
- rep->len = nrep->len;
- ncopy0(nrep->s, rep->s, rep->len);
- delete(nrep);
- }
- else
- {
- delete(rep);
- rep = nrep;
- }
- return nmatches;
-}
-
-int String::_gsub(const Regex& pat, const char* r, int rl)
-{
- int nmatches = 0;
- int sl = length();
- if (sl <= 0)
- return nmatches;
-
- if (rl < 0) rl = slen(r);
-
- const char* s = chars();
-
- StrRep* nrep = 0;
- int nsz = 0;
-
- char* x = 0;
-
- int si = 0;
- int xi = 0;
- int remaining = sl;
- int pos, pl = 0; // how long is a regular expression?
-
- while (remaining > 0)
- {
- pos = pat.search(s, sl, pl, si); // unlike string search, the pos returned here is absolute
- if (pos < 0 || pl <= 0)
- break;
- else
- {
- ++nmatches;
- int mustfit = xi + remaining + rl - pl;
- if (mustfit >= nsz)
- {
- if (nrep != 0) nrep->len = xi;
- nrep = Sresize(nrep, mustfit);
- x = nrep->s;
- nsz = nrep->sz;
- }
- pos -= si;
- ncopy(&(s[si]), &(x[xi]), pos);
- ncopy(r, &(x[xi + pos]), rl);
- si += pos + pl;
- remaining -= pos + pl;
- xi += pos + rl;
- }
- }
-
- if (nrep == 0)
- {
- if (nmatches == 0)
- return nmatches;
- else
- nrep = Sresize(nrep, xi+remaining);
- }
-
- ncopy0(&(s[si]), &(x[xi]), remaining);
- nrep->len = xi + remaining;
-
- if (nrep->len <= rep->sz) // fit back in if possible
- {
- rep->len = nrep->len;
- ncopy0(nrep->s, rep->s, rep->len);
- delete(nrep);
- }
- else
- {
- delete(rep);
- rep = nrep;
- }
- return nmatches;
-}
-
-
-/*
- * deletion
- */
-
-void String::del(int pos, int len)
-{
- if (pos < 0 || len <= 0 || (unsigned)(pos + len) > length()) return;
- int nlen = length() - len;
- int first = pos + len;
- ncopy0(&(rep->s[first]), &(rep->s[pos]), length() - first);
- rep->len = nlen;
-}
-
-void String::del(const Regex& r, int startpos)
-{
- int mlen;
- int first = r.search(chars(), length(), mlen, startpos);
- del(first, mlen);
-}
-
-void String::del(const char* t, int startpos)
-{
- int tlen = slen(t);
- int p = search(startpos, length(), t, tlen);
- del(p, tlen);
-}
-
-void String::del(const String& y, int startpos)
-{
- del(search(startpos, length(), y.chars(), y.length()), y.length());
-}
-
-void String::del(const SubString& y, int startpos)
-{
- del(search(startpos, length(), y.chars(), y.length()), y.length());
-}
-
-void String::del(char c, int startpos)
-{
- del(search(startpos, length(), c), 1);
-}
-
-/*
- * substring extraction
- */
-
-
-SubString String::at(int first, int len)
-{
- return _substr(first, len);
-}
-
-SubString String::operator() (int first, int len)
-{
- return _substr(first, len);
-}
-
-SubString String::before(int pos)
-{
- return _substr(0, pos);
-}
-
-SubString String::through(int pos)
-{
- return _substr(0, pos+1);
-}
-
-SubString String::after(int pos)
-{
- return _substr(pos + 1, length() - (pos + 1));
-}
-
-SubString String::from(int pos)
-{
- return _substr(pos, length() - pos);
-}
-
-SubString String::at(const String& y, int startpos)
-{
- int first = search(startpos, length(), y.chars(), y.length());
- return _substr(first, y.length());
-}
-
-SubString String::at(const SubString& y, int startpos)
-{
- int first = search(startpos, length(), y.chars(), y.length());
- return _substr(first, y.length());
-}
-
-SubString String::at(const Regex& r, int startpos)
-{
- int mlen;
- int first = r.search(chars(), length(), mlen, startpos);
- return _substr(first, mlen);
-}
-
-SubString String::at(const char* t, int startpos)
-{
- int tlen = slen(t);
- int first = search(startpos, length(), t, tlen);
- return _substr(first, tlen);
-}
-
-SubString String::at(char c, int startpos)
-{
- int first = search(startpos, length(), c);
- return _substr(first, 1);
-}
-
-SubString String::before(const String& y, int startpos)
-{
- int last = search(startpos, length(), y.chars(), y.length());
- return _substr(0, last);
-}
-
-SubString String::before(const SubString& y, int startpos)
-{
- int last = search(startpos, length(), y.chars(), y.length());
- return _substr(0, last);
-}
-
-SubString String::before(const Regex& r, int startpos)
-{
- int mlen;
- int first = r.search(chars(), length(), mlen, startpos);
- return _substr(0, first);
-}
-
-SubString String::before(char c, int startpos)
-{
- int last = search(startpos, length(), c);
- return _substr(0, last);
-}
-
-SubString String::before(const char* t, int startpos)
-{
- int tlen = slen(t);
- int last = search(startpos, length(), t, tlen);
- return _substr(0, last);
-}
-
-SubString String::through(const String& y, int startpos)
-{
- int last = search(startpos, length(), y.chars(), y.length());
- if (last >= 0) last += y.length();
- return _substr(0, last);
-}
-
-SubString String::through(const SubString& y, int startpos)
-{
- int last = search(startpos, length(), y.chars(), y.length());
- if (last >= 0) last += y.length();
- return _substr(0, last);
-}
-
-SubString String::through(const Regex& r, int startpos)
-{
- int mlen;
- int first = r.search(chars(), length(), mlen, startpos);
- if (first >= 0) first += mlen;
- return _substr(0, first);
-}
-
-SubString String::through(char c, int startpos)
-{
- int last = search(startpos, length(), c);
- if (last >= 0) last += 1;
- return _substr(0, last);
-}
-
-SubString String::through(const char* t, int startpos)
-{
- int tlen = slen(t);
- int last = search(startpos, length(), t, tlen);
- if (last >= 0) last += tlen;
- return _substr(0, last);
-}
-
-SubString String::after(const String& y, int startpos)
-{
- int first = search(startpos, length(), y.chars(), y.length());
- if (first >= 0) first += y.length();
- return _substr(first, length() - first);
-}
-
-SubString String::after(const SubString& y, int startpos)
-{
- int first = search(startpos, length(), y.chars(), y.length());
- if (first >= 0) first += y.length();
- return _substr(first, length() - first);
-}
-
-SubString String::after(char c, int startpos)
-{
- int first = search(startpos, length(), c);
- if (first >= 0) first += 1;
- return _substr(first, length() - first);
-}
-
-SubString String::after(const Regex& r, int startpos)
-{
- int mlen;
- int first = r.search(chars(), length(), mlen, startpos);
- if (first >= 0) first += mlen;
- return _substr(first, length() - first);
-}
-
-SubString String::after(const char* t, int startpos)
-{
- int tlen = slen(t);
- int first = search(startpos, length(), t, tlen);
- if (first >= 0) first += tlen;
- return _substr(first, length() - first);
-}
-
-SubString String::from(const String& y, int startpos)
-{
- int first = search(startpos, length(), y.chars(), y.length());
- return _substr(first, length() - first);
-}
-
-SubString String::from(const SubString& y, int startpos)
-{
- int first = search(startpos, length(), y.chars(), y.length());
- return _substr(first, length() - first);
-}
-
-SubString String::from(const Regex& r, int startpos)
-{
- int mlen;
- int first = r.search(chars(), length(), mlen, startpos);
- return _substr(first, length() - first);
-}
-
-SubString String::from(char c, int startpos)
-{
- int first = search(startpos, length(), c);
- return _substr(first, length() - first);
-}
-
-SubString String::from(const char* t, int startpos)
-{
- int tlen = slen(t);
- int first = search(startpos, length(), t, tlen);
- return _substr(first, length() - first);
-}
-
-
-
-/*
- * split/join
- */
-
-
-int split(const String& src, String results[], int n, const String& sep)
-{
- String x = src;
- const char* s = x.chars();
- int sl = x.length();
- int i = 0;
- int pos = 0;
- while (i < n && pos < sl)
- {
- int p = x.search(pos, sl, sep.chars(), sep.length());
- if (p < 0)
- p = sl;
- results[i].rep = Salloc(results[i].rep, &(s[pos]), p - pos, p - pos);
- i++;
- pos = p + sep.length();
- }
- return i;
-}
-
-int split(const String& src, String results[], int n, const Regex& r)
-{
- String x = src;
- const char* s = x.chars();
- int sl = x.length();
- int i = 0;
- int pos = 0;
- int p, matchlen;
- while (i < n && pos < sl)
- {
- p = r.search(s, sl, matchlen, pos);
- if (p < 0)
- p = sl;
- results[i].rep = Salloc(results[i].rep, &(s[pos]), p - pos, p - pos);
- i++;
- pos = p + matchlen;
- }
- return i;
-}
-
-
-#if defined(__GNUG__) && !defined(_G_NO_NRV)
-#define RETURN(r) return
-#define RETURNS(r) return r;
-#define RETURN_OBJECT(TYPE, NAME) /* nothing */
-#else /* _G_NO_NRV */
-#define RETURN(r) return r
-#define RETURNS(r) /* nothing */
-#define RETURN_OBJECT(TYPE, NAME) TYPE NAME;
-#endif
-
-String join(String src[], int n, const String& separator) RETURNS(x)
-{
- RETURN_OBJECT(String,x)
- String sep = separator;
- int xlen = 0;
- int i;
- for (i = 0; i < n; ++i)
- xlen += src[i].length();
- xlen += (n - 1) * sep.length();
-
- x.rep = Sresize (x.rep, xlen);
-
- int j = 0;
-
- for (i = 0; i < n - 1; ++i)
- {
- ncopy(src[i].chars(), &(x.rep->s[j]), src[i].length());
- j += src[i].length();
- ncopy(sep.chars(), &(x.rep->s[j]), sep.length());
- j += sep.length();
- }
- ncopy0(src[i].chars(), &(x.rep->s[j]), src[i].length());
- RETURN(x);
-}
-
-/*
- misc
-*/
-
-
-StrRep* Sreverse(const StrRep* src, StrRep* dest)
-{
- int n = src->len;
- if (src != dest)
- dest = Salloc(dest, src->s, n, n);
- if (n > 0)
- {
- char* a = dest->s;
- char* b = &(a[n - 1]);
- while (a < b)
- {
- char t = *a;
- *a++ = *b;
- *b-- = t;
- }
- }
- return dest;
-}
-
-
-StrRep* Supcase(const StrRep* src, StrRep* dest)
-{
- int n = src->len;
- if (src != dest) dest = Salloc(dest, src->s, n, n);
- char* p = dest->s;
- char* e = &(p[n]);
- for (; p < e; ++p) if (islower(*p)) *p = toupper(*p);
- return dest;
-}
-
-StrRep* Sdowncase(const StrRep* src, StrRep* dest)
-{
- int n = src->len;
- if (src != dest) dest = Salloc(dest, src->s, n, n);
- char* p = dest->s;
- char* e = &(p[n]);
- for (; p < e; ++p) if (isupper(*p)) *p = tolower(*p);
- return dest;
-}
-
-StrRep* Scapitalize(const StrRep* src, StrRep* dest)
-{
- int n = src->len;
- if (src != dest) dest = Salloc(dest, src->s, n, n);
-
- char* p = dest->s;
- char* e = &(p[n]);
- for (; p < e; ++p)
- {
- int at_word;
- if (at_word = islower(*p))
- *p = toupper(*p);
- else
- at_word = isupper(*p) || isdigit(*p);
-
- if (at_word)
- {
- while (++p < e)
- {
- if (isupper(*p))
- *p = tolower(*p);
- /* A '\'' does not break a word, so that "Nathan's" stays
- "Nathan's" rather than turning into "Nathan'S". */
- else if (!islower(*p) && !isdigit(*p) && (*p != '\''))
- break;
- }
- }
- }
- return dest;
-}
-
-#if defined(__GNUG__) && !defined(_G_NO_NRV)
-
-String replicate(char c, int n) return w;
-{
- w.rep = Sresize(w.rep, n);
- char* p = w.rep->s;
- while (n-- > 0) *p++ = c;
- *p = 0;
-}
-
-String replicate(const String& y, int n) return w
-{
- int len = y.length();
- w.rep = Sresize(w.rep, n * len);
- char* p = w.rep->s;
- while (n-- > 0)
- {
- ncopy(y.chars(), p, len);
- p += len;
- }
- *p = 0;
-}
-
-String common_prefix(const String& x, const String& y, int startpos) return r;
-{
- const char* xchars = x.chars();
- const char* ychars = y.chars();
- const char* xs = &(xchars[startpos]);
- const char* ss = xs;
- const char* topx = &(xchars[x.length()]);
- const char* ys = &(ychars[startpos]);
- const char* topy = &(ychars[y.length()]);
- int l;
- for (l = 0; xs < topx && ys < topy && *xs++ == *ys++; ++l);
- r.rep = Salloc(r.rep, ss, l, l);
-}
-
-String common_suffix(const String& x, const String& y, int startpos) return r;
-{
- const char* xchars = x.chars();
- const char* ychars = y.chars();
- const char* xs = &(xchars[x.length() + startpos]);
- const char* botx = xchars;
- const char* ys = &(ychars[y.length() + startpos]);
- const char* boty = ychars;
- int l;
- for (l = 0; xs >= botx && ys >= boty && *xs == *ys ; --xs, --ys, ++l);
- r.rep = Salloc(r.rep, ++xs, l, l);
-}
-
-#else
-
-String replicate(char c, int n)
-{
- String w;
- w.rep = Sresize(w.rep, n);
- char* p = w.rep->s;
- while (n-- > 0) *p++ = c;
- *p = 0;
- return w;
-}
-
-String replicate(const String& y, int n)
-{
- String w;
- int len = y.length();
- w.rep = Sresize(w.rep, n * len);
- char* p = w.rep->s;
- while (n-- > 0)
- {
- ncopy(y.chars(), p, len);
- p += len;
- }
- *p = 0;
- return w;
-}
-
-String common_prefix(const String& x, const String& y, int startpos)
-{
- String r;
- const char* xchars = x.chars();
- const char* ychars = y.chars();
- const char* xs = &(xchars[startpos]);
- const char* ss = xs;
- const char* topx = &(xchars[x.length()]);
- const char* ys = &(ychars[startpos]);
- const char* topy = &(ychars[y.length()]);
- int l;
- for (l = 0; xs < topx && ys < topy && *xs++ == *ys++; ++l);
- r.rep = Salloc(r.rep, ss, l, l);
- return r;
-}
-
-String common_suffix(const String& x, const String& y, int startpos)
-{
- String r;
- const char* xchars = x.chars();
- const char* ychars = y.chars();
- const char* xs = &(xchars[x.length() + startpos]);
- const char* botx = xchars;
- const char* ys = &(ychars[y.length() + startpos]);
- const char* boty = ychars;
- int l;
- for (l = 0; xs >= botx && ys >= boty && *xs == *ys ; --xs, --ys, ++l);
- r.rep = Salloc(r.rep, ++xs, l, l);
- return r;
-}
-
-#endif
-
-// IO
-
-istream& operator>>(istream& s, String& x)
-{
- if (!s.ipfx(0) || (!(s.flags() & ios::skipws) && !ws(s)))
- {
- s.clear(ios::failbit|s.rdstate()); // Redundant if using GNU iostreams.
- return s;
- }
- int ch;
- int i = 0;
- x.rep = Sresize(x.rep, 20);
- register streambuf *sb = s.rdbuf();
- while ((ch = sb->sbumpc()) != EOF)
- {
- if (isspace(ch))
- break;
- if (i >= x.rep->sz - 1)
- x.rep = Sresize(x.rep, i+1);
- x.rep->s[i++] = ch;
- }
- x.rep->s[i] = 0;
- x.rep->len = i;
- int new_state = s.rdstate();
- if (i == 0) new_state |= ios::failbit;
- if (ch == EOF) new_state |= ios::eofbit;
- s.clear(new_state);
- return s;
-}
-
-int readline(istream& s, String& x, char terminator, int discard)
-{
- if (!s.ipfx(0))
- return 0;
- int ch;
- int i = 0;
- x.rep = Sresize(x.rep, 80);
- register streambuf *sb = s.rdbuf();
- while ((ch = sb->sbumpc()) != EOF)
- {
- if (ch != terminator || !discard)
- {
- if (i >= x.rep->sz - 1)
- x.rep = Sresize(x.rep, i+1);
- x.rep->s[i++] = ch;
- }
- if (ch == terminator)
- break;
- }
- x.rep->s[i] = 0;
- x.rep->len = i;
- if (ch == EOF) s.clear(ios::eofbit|s.rdstate());
- return i;
-}
-
-
-ostream& operator<<(ostream& s, const SubString& x)
-{
- const char* a = x.chars();
- const char* lasta = &(a[x.length()]);
- while (a < lasta)
- s.put(*a++);
- return(s);
-}
-
-// from John.Willis@FAS.RI.CMU.EDU
-
-int String::freq(const SubString& y) const
-{
- int found = 0;
- for (unsigned int i = 0; i < length(); i++)
- if (match(i,length(),0,y.chars(), y.length())>= 0) found++;
- return(found);
-}
-
-int String::freq(const String& y) const
-{
- int found = 0;
- for (unsigned int i = 0; i < length(); i++)
- if (match(i,length(),0,y.chars(),y.length()) >= 0) found++;
- return(found);
-}
-
-int String::freq(const char* t) const
-{
- int found = 0;
- for (unsigned int i = 0; i < length(); i++)
- if (match(i,length(),0,t) >= 0) found++;
- return(found);
-}
-
-int String::freq(char c) const
-{
- int found = 0;
- for (unsigned int i = 0; i < length(); i++)
- if (match(i,length(),0,&c,1) >= 0) found++;
- return(found);
-}
-
-
-int String::OK() const
-{
- if (rep == 0 // don't have a rep
- || rep->len > rep->sz // string oustide bounds
- || rep->s[rep->len] != 0) // not null-terminated
- error("invariant failure");
- return 1;
-}
-
-int SubString::OK() const
-{
- int v = S != (const char*)0; // have a String;
- v &= S.OK(); // that is legal
- v &= pos + len >= S.rep->len;// pos and len within bounds
- if (!v) S.error("SubString invariant failure");
- return v;
-}
-
diff --git a/contrib/libg++/libg++/src/String.h b/contrib/libg++/libg++/src/String.h
deleted file mode 100644
index b3bfd707cf3c..000000000000
--- a/contrib/libg++/libg++/src/String.h
+++ /dev/null
@@ -1,1284 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-
-#ifndef _String_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _String_h 1
-
-#include <iostream.h>
-#include <Regex.h>
-
-#undef OK
-
-struct StrRep // internal String representations
-{
- unsigned short len; // string length
- unsigned short sz; // allocated space
- char s[1]; // the string starts here
- // (at least 1 char for trailing null)
- // allocated & expanded via non-public fcts
-};
-
-// primitive ops on StrReps -- nearly all String fns go through these.
-
-StrRep* Salloc(StrRep*, const char*, int, int);
-StrRep* Scopy(StrRep*, const StrRep*);
-StrRep* Scat(StrRep*, const char*, int, const char*, int);
-StrRep* Scat(StrRep*, const char*, int,const char*,int, const char*,int);
-StrRep* Sprepend(StrRep*, const char*, int);
-StrRep* Sreverse(const StrRep*, StrRep*);
-StrRep* Supcase(const StrRep*, StrRep*);
-StrRep* Sdowncase(const StrRep*, StrRep*);
-StrRep* Scapitalize(const StrRep*, StrRep*);
-
-// These classes need to be defined in the order given
-
-class String;
-class SubString;
-
-class SubString
-{
- friend class String;
-protected:
-
- String& S; // The String I'm a substring of
- unsigned short pos; // starting position in S's rep
- unsigned short len; // length of substring
-
- void assign(const StrRep*, const char*, int = -1);
- SubString(String& x, int p, int l);
- SubString(const SubString& x);
-
-public:
-
-// Note there are no public constructors. SubStrings are always
-// created via String operations
-
- ~SubString();
-
- SubString& operator = (const String& y);
- SubString& operator = (const SubString& y);
- SubString& operator = (const char* t);
- SubString& operator = (char c);
-
-// return 1 if target appears anywhere in SubString; else 0
-
- int contains(char c) const;
- int contains(const String& y) const;
- int contains(const SubString& y) const;
- int contains(const char* t) const;
- int contains(const Regex& r) const;
-
-// return 1 if target matches entire SubString
-
- int matches(const Regex& r) const;
-
-// IO
-
- friend ostream& operator<<(ostream& s, const SubString& x);
-
-// status
-
- unsigned int length() const;
- int empty() const;
- const char* chars() const;
-
- int OK() const;
-
-};
-
-
-class String
-{
- friend class SubString;
-
-protected:
- StrRep* rep; // Strings are pointers to their representations
-
-// some helper functions
-
- int search(int, int, const char*, int = -1) const;
- int search(int, int, char) const;
- int match(int, int, int, const char*, int = -1) const;
- int _gsub(const char*, int, const char* ,int);
- int _gsub(const Regex&, const char*, int);
- SubString _substr(int, int);
-
-public:
-
-// constructors & assignment
-
- String();
- String(const String& x);
- String(const SubString& x);
- String(const char* t);
- String(const char* t, int len);
- String(char c);
-
- ~String();
-
- String& operator = (const String& y);
- String& operator = (const char* y);
- String& operator = (char c);
- String& operator = (const SubString& y);
-
-// concatenation
-
- String& operator += (const String& y);
- String& operator += (const SubString& y);
- String& operator += (const char* t);
- String& operator += (char c);
-
- void prepend(const String& y);
- void prepend(const SubString& y);
- void prepend(const char* t);
- void prepend(char c);
-
-
-// procedural versions:
-// concatenate first 2 args, store result in last arg
-
- friend inline void cat(const String&, const String&, String&);
- friend inline void cat(const String&, const SubString&, String&);
- friend inline void cat(const String&, const char*, String&);
- friend inline void cat(const String&, char, String&);
-
- friend inline void cat(const SubString&, const String&, String&);
- friend inline void cat(const SubString&, const SubString&, String&);
- friend inline void cat(const SubString&, const char*, String&);
- friend inline void cat(const SubString&, char, String&);
-
- friend inline void cat(const char*, const String&, String&);
- friend inline void cat(const char*, const SubString&, String&);
- friend inline void cat(const char*, const char*, String&);
- friend inline void cat(const char*, char, String&);
-
-// double concatenation, by request. (yes, there are too many versions,
-// but if one is supported, then the others should be too...)
-// Concatenate first 3 args, store in last arg
-
- friend inline void cat(const String&,const String&, const String&,String&);
- friend inline void cat(const String&,const String&,const SubString&,String&);
- friend inline void cat(const String&,const String&, const char*, String&);
- friend inline void cat(const String&,const String&, char, String&);
- friend inline void cat(const String&,const SubString&,const String&,String&);
- inline friend void cat(const String&,const SubString&,const SubString&,String&);
- friend inline void cat(const String&,const SubString&, const char*, String&);
- friend inline void cat(const String&,const SubString&, char, String&);
- friend inline void cat(const String&,const char*, const String&, String&);
- friend inline void cat(const String&,const char*, const SubString&, String&);
- friend inline void cat(const String&,const char*, const char*, String&);
- friend inline void cat(const String&,const char*, char, String&);
-
- friend inline void cat(const char*, const String&, const String&,String&);
- friend inline void cat(const char*,const String&,const SubString&,String&);
- friend inline void cat(const char*,const String&, const char*, String&);
- friend inline void cat(const char*,const String&, char, String&);
- friend inline void cat(const char*,const SubString&,const String&,String&);
- friend inline void cat(const char*,const SubString&,const SubString&,String&);
- friend inline void cat(const char*,const SubString&, const char*, String&);
- friend inline void cat(const char*,const SubString&, char, String&);
- friend inline void cat(const char*,const char*, const String&, String&);
- friend inline void cat(const char*,const char*, const SubString&, String&);
- friend inline void cat(const char*,const char*, const char*, String&);
- friend inline void cat(const char*,const char*, char, String&);
-
-
-// searching & matching
-
-// return position of target in string or -1 for failure
-
- int index(char c, int startpos = 0) const;
- int index(const String& y, int startpos = 0) const;
- int index(const SubString& y, int startpos = 0) const;
- int index(const char* t, int startpos = 0) const;
- int index(const Regex& r, int startpos = 0) const;
-
-// return 1 if target appears anyhere in String; else 0
-
- int contains(char c) const;
- int contains(const String& y) const;
- int contains(const SubString& y) const;
- int contains(const char* t) const;
- int contains(const Regex& r) const;
-
-// return 1 if target appears anywhere after position pos
-// (or before, if pos is negative) in String; else 0
-
- int contains(char c, int pos) const;
- int contains(const String& y, int pos) const;
- int contains(const SubString& y, int pos) const;
- int contains(const char* t, int pos) const;
- int contains(const Regex& r, int pos) const;
-
-// return 1 if target appears at position pos in String; else 0
-
- int matches(char c, int pos = 0) const;
- int matches(const String& y, int pos = 0) const;
- int matches(const SubString& y, int pos = 0) const;
- int matches(const char* t, int pos = 0) const;
- int matches(const Regex& r, int pos = 0) const;
-
-// return number of occurences of target in String
-
- int freq(char c) const;
- int freq(const String& y) const;
- int freq(const SubString& y) const;
- int freq(const char* t) const;
-
-// SubString extraction
-
-// Note that you can't take a substring of a const String, since
-// this leaves open the possiblility of indirectly modifying the
-// String through the SubString
-
- SubString at(int pos, int len);
- SubString operator () (int pos, int len); // synonym for at
-
- SubString at(const String& x, int startpos = 0);
- SubString at(const SubString& x, int startpos = 0);
- SubString at(const char* t, int startpos = 0);
- SubString at(char c, int startpos = 0);
- SubString at(const Regex& r, int startpos = 0);
-
- SubString before(int pos);
- SubString before(const String& x, int startpos = 0);
- SubString before(const SubString& x, int startpos = 0);
- SubString before(const char* t, int startpos = 0);
- SubString before(char c, int startpos = 0);
- SubString before(const Regex& r, int startpos = 0);
-
- SubString through(int pos);
- SubString through(const String& x, int startpos = 0);
- SubString through(const SubString& x, int startpos = 0);
- SubString through(const char* t, int startpos = 0);
- SubString through(char c, int startpos = 0);
- SubString through(const Regex& r, int startpos = 0);
-
- SubString from(int pos);
- SubString from(const String& x, int startpos = 0);
- SubString from(const SubString& x, int startpos = 0);
- SubString from(const char* t, int startpos = 0);
- SubString from(char c, int startpos = 0);
- SubString from(const Regex& r, int startpos = 0);
-
- SubString after(int pos);
- SubString after(const String& x, int startpos = 0);
- SubString after(const SubString& x, int startpos = 0);
- SubString after(const char* t, int startpos = 0);
- SubString after(char c, int startpos = 0);
- SubString after(const Regex& r, int startpos = 0);
-
-
-// deletion
-
-// delete len chars starting at pos
- void del(int pos, int len);
-
-// delete the first occurrence of target after startpos
-
- void del(const String& y, int startpos = 0);
- void del(const SubString& y, int startpos = 0);
- void del(const char* t, int startpos = 0);
- void del(char c, int startpos = 0);
- void del(const Regex& r, int startpos = 0);
-
-// global substitution: substitute all occurrences of pat with repl
-
- int gsub(const String& pat, const String& repl);
- int gsub(const SubString& pat, const String& repl);
- int gsub(const char* pat, const String& repl);
- int gsub(const char* pat, const char* repl);
- int gsub(const Regex& pat, const String& repl);
-
-// friends & utilities
-
-// split string into array res at separators; return number of elements
-
- friend int split(const String& x, String res[], int maxn,
- const String& sep);
- friend int split(const String& x, String res[], int maxn,
- const Regex& sep);
-
- friend String common_prefix(const String& x, const String& y,
- int startpos = 0);
- friend String common_suffix(const String& x, const String& y,
- int startpos = -1);
- friend String replicate(char c, int n);
- friend String replicate(const String& y, int n);
- friend String join(String src[], int n, const String& sep);
-
-// simple builtin transformations
-
- friend inline String reverse(const String& x);
- friend inline String upcase(const String& x);
- friend inline String downcase(const String& x);
- friend inline String capitalize(const String& x);
-
-// in-place versions of above
-
- void reverse();
- void upcase();
- void downcase();
- void capitalize();
-
-// element extraction
-
- char& operator [] (int i);
- const char& operator [] (int i) const;
- char elem(int i) const;
- char firstchar() const;
- char lastchar() const;
-
-// conversion
-
- operator const char*() const;
- const char* chars() const;
-
-
-// IO
-
- friend inline ostream& operator<<(ostream& s, const String& x);
- friend ostream& operator<<(ostream& s, const SubString& x);
- friend istream& operator>>(istream& s, String& x);
-
- friend int readline(istream& s, String& x,
- char terminator = '\n',
- int discard_terminator = 1);
-
-// status
-
- unsigned int length() const;
- int empty() const;
-
-// preallocate some space for String
- void alloc(int newsize);
-
-// report current allocation (not length!)
-
- int allocation() const;
-
-
- void error(const char* msg) const;
-
- int OK() const;
-};
-
-typedef String StrTmp; // for backward compatibility
-
-// other externs
-
-int compare(const String& x, const String& y);
-int compare(const String& x, const SubString& y);
-int compare(const String& x, const char* y);
-int compare(const SubString& x, const String& y);
-int compare(const SubString& x, const SubString& y);
-int compare(const SubString& x, const char* y);
-int fcompare(const String& x, const String& y); // ignore case
-
-extern StrRep _nilStrRep;
-extern String _nilString;
-
-// status reports, needed before defining other things
-
-inline unsigned int String::length() const { return rep->len; }
-inline int String::empty() const { return rep->len == 0; }
-inline const char* String::chars() const { return &(rep->s[0]); }
-inline int String::allocation() const { return rep->sz; }
-
-inline unsigned int SubString::length() const { return len; }
-inline int SubString::empty() const { return len == 0; }
-inline const char* SubString::chars() const { return &(S.rep->s[pos]); }
-
-
-// constructors
-
-inline String::String()
- : rep(&_nilStrRep) {}
-inline String::String(const String& x)
- : rep(Scopy(0, x.rep)) {}
-inline String::String(const char* t)
- : rep(Salloc(0, t, -1, -1)) {}
-inline String::String(const char* t, int tlen)
- : rep(Salloc(0, t, tlen, tlen)) {}
-inline String::String(const SubString& y)
- : rep(Salloc(0, y.chars(), y.length(), y.length())) {}
-inline String::String(char c)
- : rep(Salloc(0, &c, 1, 1)) {}
-
-inline String::~String() { if (rep != &_nilStrRep) delete rep; }
-
-inline SubString::SubString(const SubString& x)
- :S(x.S), pos(x.pos), len(x.len) {}
-inline SubString::SubString(String& x, int first, int l)
- :S(x), pos(first), len(l) {}
-
-inline SubString::~SubString() {}
-
-// assignment
-
-inline String& String::operator = (const String& y)
-{
- rep = Scopy(rep, y.rep);
- return *this;
-}
-
-inline String& String::operator=(const char* t)
-{
- rep = Salloc(rep, t, -1, -1);
- return *this;
-}
-
-inline String& String::operator=(const SubString& y)
-{
- rep = Salloc(rep, y.chars(), y.length(), y.length());
- return *this;
-}
-
-inline String& String::operator=(char c)
-{
- rep = Salloc(rep, &c, 1, 1);
- return *this;
-}
-
-
-inline SubString& SubString::operator = (const char* ys)
-{
- assign(0, ys);
- return *this;
-}
-
-inline SubString& SubString::operator = (char ch)
-{
- assign(0, &ch, 1);
- return *this;
-}
-
-inline SubString& SubString::operator = (const String& y)
-{
- assign(y.rep, y.chars(), y.length());
- return *this;
-}
-
-inline SubString& SubString::operator = (const SubString& y)
-{
- assign(y.S.rep, y.chars(), y.length());
- return *this;
-}
-
-// Zillions of cats...
-
-inline void cat(const String& x, const String& y, String& r)
-{
- r.rep = Scat(r.rep, x.chars(), x.length(), y.chars(), y.length());
-}
-
-inline void cat(const String& x, const SubString& y, String& r)
-{
- r.rep = Scat(r.rep, x.chars(), x.length(), y.chars(), y.length());
-}
-
-inline void cat(const String& x, const char* y, String& r)
-{
- r.rep = Scat(r.rep, x.chars(), x.length(), y, -1);
-}
-
-inline void cat(const String& x, char y, String& r)
-{
- r.rep = Scat(r.rep, x.chars(), x.length(), &y, 1);
-}
-
-inline void cat(const SubString& x, const String& y, String& r)
-{
- r.rep = Scat(r.rep, x.chars(), x.length(), y.chars(), y.length());
-}
-
-inline void cat(const SubString& x, const SubString& y, String& r)
-{
- r.rep = Scat(r.rep, x.chars(), x.length(), y.chars(), y.length());
-}
-
-inline void cat(const SubString& x, const char* y, String& r)
-{
- r.rep = Scat(r.rep, x.chars(), x.length(), y, -1);
-}
-
-inline void cat(const SubString& x, char y, String& r)
-{
- r.rep = Scat(r.rep, x.chars(), x.length(), &y, 1);
-}
-
-inline void cat(const char* x, const String& y, String& r)
-{
- r.rep = Scat(r.rep, x, -1, y.chars(), y.length());
-}
-
-inline void cat(const char* x, const SubString& y, String& r)
-{
- r.rep = Scat(r.rep, x, -1, y.chars(), y.length());
-}
-
-inline void cat(const char* x, const char* y, String& r)
-{
- r.rep = Scat(r.rep, x, -1, y, -1);
-}
-
-inline void cat(const char* x, char y, String& r)
-{
- r.rep = Scat(r.rep, x, -1, &y, 1);
-}
-
-inline void cat(const String& a, const String& x, const String& y, String& r)
-{
- r.rep = Scat(r.rep, a.chars(), a.length(), x.chars(), x.length(), y.chars(), y.length());
-}
-
-inline void cat(const String& a, const String& x, const SubString& y, String& r)
-{
- r.rep = Scat(r.rep, a.chars(), a.length(), x.chars(), x.length(), y.chars(), y.length());
-}
-
-inline void cat(const String& a, const String& x, const char* y, String& r)
-{
- r.rep = Scat(r.rep, a.chars(), a.length(), x.chars(), x.length(), y, -1);
-}
-
-inline void cat(const String& a, const String& x, char y, String& r)
-{
- r.rep = Scat(r.rep, a.chars(), a.length(), x.chars(), x.length(), &y, 1);
-}
-
-inline void cat(const String& a, const SubString& x, const String& y, String& r)
-{
- r.rep = Scat(r.rep, a.chars(), a.length(), x.chars(), x.length(), y.chars(), y.length());
-}
-
-inline void cat(const String& a, const SubString& x, const SubString& y, String& r)
-{
- r.rep = Scat(r.rep, a.chars(), a.length(), x.chars(), x.length(), y.chars(), y.length());
-}
-
-inline void cat(const String& a, const SubString& x, const char* y, String& r)
-{
- r.rep = Scat(r.rep, a.chars(), a.length(), x.chars(), x.length(), y, -1);
-}
-
-inline void cat(const String& a, const SubString& x, char y, String& r)
-{
- r.rep = Scat(r.rep, a.chars(), a.length(), x.chars(), x.length(), &y, 1);
-}
-
-inline void cat(const String& a, const char* x, const String& y, String& r)
-{
- r.rep = Scat(r.rep, a.chars(), a.length(), x, -1, y.chars(), y.length());
-}
-
-inline void cat(const String& a, const char* x, const SubString& y, String& r)
-{
- r.rep = Scat(r.rep, a.chars(), a.length(), x, -1, y.chars(), y.length());
-}
-
-inline void cat(const String& a, const char* x, const char* y, String& r)
-{
- r.rep = Scat(r.rep, a.chars(), a.length(), x, -1, y, -1);
-}
-
-inline void cat(const String& a, const char* x, char y, String& r)
-{
- r.rep = Scat(r.rep, a.chars(), a.length(), x, -1, &y, 1);
-}
-
-
-inline void cat(const char* a, const String& x, const String& y, String& r)
-{
- r.rep = Scat(r.rep, a, -1, x.chars(), x.length(), y.chars(), y.length());
-}
-
-inline void cat(const char* a, const String& x, const SubString& y, String& r)
-{
- r.rep = Scat(r.rep, a, -1, x.chars(), x.length(), y.chars(), y.length());
-}
-
-inline void cat(const char* a, const String& x, const char* y, String& r)
-{
- r.rep = Scat(r.rep, a, -1, x.chars(), x.length(), y, -1);
-}
-
-inline void cat(const char* a, const String& x, char y, String& r)
-{
- r.rep = Scat(r.rep, a, -1, x.chars(), x.length(), &y, 1);
-}
-
-inline void cat(const char* a, const SubString& x, const String& y, String& r)
-{
- r.rep = Scat(r.rep, a, -1, x.chars(), x.length(), y.chars(), y.length());
-}
-
-inline void cat(const char* a, const SubString& x, const SubString& y, String& r)
-{
- r.rep = Scat(r.rep, a, -1, x.chars(), x.length(), y.chars(), y.length());
-}
-
-inline void cat(const char* a, const SubString& x, const char* y, String& r)
-{
- r.rep = Scat(r.rep, a, -1, x.chars(), x.length(), y, -1);
-}
-
-inline void cat(const char* a, const SubString& x, char y, String& r)
-{
- r.rep = Scat(r.rep, a, -1, x.chars(), x.length(), &y, 1);
-}
-
-inline void cat(const char* a, const char* x, const String& y, String& r)
-{
- r.rep = Scat(r.rep, a, -1, x, -1, y.chars(), y.length());
-}
-
-inline void cat(const char* a, const char* x, const SubString& y, String& r)
-{
- r.rep = Scat(r.rep, a, -1, x, -1, y.chars(), y.length());
-}
-
-inline void cat(const char* a, const char* x, const char* y, String& r)
-{
- r.rep = Scat(r.rep, a, -1, x, -1, y, -1);
-}
-
-inline void cat(const char* a, const char* x, char y, String& r)
-{
- r.rep = Scat(r.rep, a, -1, x, -1, &y, 1);
-}
-
-
-// operator versions
-
-inline String& String::operator +=(const String& y)
-{
- cat(*this, y, *this);
- return *this;
-}
-
-inline String& String::operator +=(const SubString& y)
-{
- cat(*this, y, *this);
- return *this;
-}
-
-inline String& String::operator += (const char* y)
-{
- cat(*this, y, *this);
- return *this;
-}
-
-inline String& String:: operator +=(char y)
-{
- cat(*this, y, *this);
- return *this;
-}
-
-// constructive concatenation
-
-#if defined(__GNUG__) && !defined(_G_NO_NRV)
-
-inline String operator + (const String& x, const String& y) return r;
-{
- cat(x, y, r);
-}
-
-inline String operator + (const String& x, const SubString& y) return r;
-{
- cat(x, y, r);
-}
-
-inline String operator + (const String& x, const char* y) return r;
-{
- cat(x, y, r);
-}
-
-inline String operator + (const String& x, char y) return r;
-{
- cat(x, y, r);
-}
-
-inline String operator + (const SubString& x, const String& y) return r;
-{
- cat(x, y, r);
-}
-
-inline String operator + (const SubString& x, const SubString& y) return r;
-{
- cat(x, y, r);
-}
-
-inline String operator + (const SubString& x, const char* y) return r;
-{
- cat(x, y, r);
-}
-
-inline String operator + (const SubString& x, char y) return r;
-{
- cat(x, y, r);
-}
-
-inline String operator + (const char* x, const String& y) return r;
-{
- cat(x, y, r);
-}
-
-inline String operator + (const char* x, const SubString& y) return r;
-{
- cat(x, y, r);
-}
-
-inline String reverse(const String& x) return r;
-{
- r.rep = Sreverse(x.rep, r.rep);
-}
-
-inline String upcase(const String& x) return r;
-{
- r.rep = Supcase(x.rep, r.rep);
-}
-
-inline String downcase(const String& x) return r;
-{
- r.rep = Sdowncase(x.rep, r.rep);
-}
-
-inline String capitalize(const String& x) return r;
-{
- r.rep = Scapitalize(x.rep, r.rep);
-}
-
-#else /* NO_NRV */
-
-inline String operator + (const String& x, const String& y)
-{
- String r; cat(x, y, r); return r;
-}
-
-inline String operator + (const String& x, const SubString& y)
-{
- String r; cat(x, y, r); return r;
-}
-
-inline String operator + (const String& x, const char* y)
-{
- String r; cat(x, y, r); return r;
-}
-
-inline String operator + (const String& x, char y)
-{
- String r; cat(x, y, r); return r;
-}
-
-inline String operator + (const SubString& x, const String& y)
-{
- String r; cat(x, y, r); return r;
-}
-
-inline String operator + (const SubString& x, const SubString& y)
-{
- String r; cat(x, y, r); return r;
-}
-
-inline String operator + (const SubString& x, const char* y)
-{
- String r; cat(x, y, r); return r;
-}
-
-inline String operator + (const SubString& x, char y)
-{
- String r; cat(x, y, r); return r;
-}
-
-inline String operator + (const char* x, const String& y)
-{
- String r; cat(x, y, r); return r;
-}
-
-inline String operator + (const char* x, const SubString& y)
-{
- String r; cat(x, y, r); return r;
-}
-
-inline String reverse(const String& x)
-{
- String r; r.rep = Sreverse(x.rep, r.rep); return r;
-}
-
-inline String upcase(const String& x)
-{
- String r; r.rep = Supcase(x.rep, r.rep); return r;
-}
-
-inline String downcase(const String& x)
-{
- String r; r.rep = Sdowncase(x.rep, r.rep); return r;
-}
-
-inline String capitalize(const String& x)
-{
- String r; r.rep = Scapitalize(x.rep, r.rep); return r;
-}
-
-#endif
-
-// prepend
-
-inline void String::prepend(const String& y)
-{
- rep = Sprepend(rep, y.chars(), y.length());
-}
-
-inline void String::prepend(const char* y)
-{
- rep = Sprepend(rep, y, -1);
-}
-
-inline void String::prepend(char y)
-{
- rep = Sprepend(rep, &y, 1);
-}
-
-inline void String::prepend(const SubString& y)
-{
- rep = Sprepend(rep, y.chars(), y.length());
-}
-
-// misc transformations
-
-
-inline void String::reverse()
-{
- rep = Sreverse(rep, rep);
-}
-
-
-inline void String::upcase()
-{
- rep = Supcase(rep, rep);
-}
-
-
-inline void String::downcase()
-{
- rep = Sdowncase(rep, rep);
-}
-
-
-inline void String::capitalize()
-{
- rep = Scapitalize(rep, rep);
-}
-
-// element extraction
-
-inline char& String::operator [] (int i)
-{
- if (((unsigned)i) >= length()) error("invalid index");
- return rep->s[i];
-}
-
-inline const char& String::operator [] (int i) const
-{
- if (((unsigned)i) >= length()) error("invalid index");
- return rep->s[i];
-}
-
-inline char String::elem (int i) const
-{
- if (((unsigned)i) >= length()) error("invalid index");
- return rep->s[i];
-}
-
-inline char String::firstchar() const
-{
- return elem(0);
-}
-
-inline char String::lastchar() const
-{
- return elem(length() - 1);
-}
-
-// searching
-
-inline int String::index(char c, int startpos) const
-{
- return search(startpos, length(), c);
-}
-
-inline int String::index(const char* t, int startpos) const
-{
- return search(startpos, length(), t);
-}
-
-inline int String::index(const String& y, int startpos) const
-{
- return search(startpos, length(), y.chars(), y.length());
-}
-
-inline int String::index(const SubString& y, int startpos) const
-{
- return search(startpos, length(), y.chars(), y.length());
-}
-
-inline int String::index(const Regex& r, int startpos) const
-{
- int unused; return r.search(chars(), length(), unused, startpos);
-}
-
-inline int String::contains(char c) const
-{
- return search(0, length(), c) >= 0;
-}
-
-inline int String::contains(const char* t) const
-{
- return search(0, length(), t) >= 0;
-}
-
-inline int String::contains(const String& y) const
-{
- return search(0, length(), y.chars(), y.length()) >= 0;
-}
-
-inline int String::contains(const SubString& y) const
-{
- return search(0, length(), y.chars(), y.length()) >= 0;
-}
-
-inline int String::contains(char c, int p) const
-{
- return match(p, length(), 0, &c, 1) >= 0;
-}
-
-inline int String::contains(const char* t, int p) const
-{
- return match(p, length(), 0, t) >= 0;
-}
-
-inline int String::contains(const String& y, int p) const
-{
- return match(p, length(), 0, y.chars(), y.length()) >= 0;
-}
-
-inline int String::contains(const SubString& y, int p) const
-{
- return match(p, length(), 0, y.chars(), y.length()) >= 0;
-}
-
-inline int String::contains(const Regex& r) const
-{
- int unused; return r.search(chars(), length(), unused, 0) >= 0;
-}
-
-inline int String::contains(const Regex& r, int p) const
-{
- return r.match(chars(), length(), p) >= 0;
-}
-
-
-inline int String::matches(const SubString& y, int p) const
-{
- return match(p, length(), 1, y.chars(), y.length()) >= 0;
-}
-
-inline int String::matches(const String& y, int p) const
-{
- return match(p, length(), 1, y.chars(), y.length()) >= 0;
-}
-
-inline int String::matches(const char* t, int p) const
-{
- return match(p, length(), 1, t) >= 0;
-}
-
-inline int String::matches(char c, int p) const
-{
- return match(p, length(), 1, &c, 1) >= 0;
-}
-
-inline int String::matches(const Regex& r, int p) const
-{
- int l = (p < 0)? -p : length() - p;
- return r.match(chars(), length(), p) == l;
-}
-
-
-inline int SubString::contains(const char* t) const
-{
- return S.search(pos, pos+len, t) >= 0;
-}
-
-inline int SubString::contains(const String& y) const
-{
- return S.search(pos, pos+len, y.chars(), y.length()) >= 0;
-}
-
-inline int SubString::contains(const SubString& y) const
-{
- return S.search(pos, pos+len, y.chars(), y.length()) >= 0;
-}
-
-inline int SubString::contains(char c) const
-{
- return S.search(pos, pos+len, c) >= 0;
-}
-
-inline int SubString::contains(const Regex& r) const
-{
- int unused; return r.search(chars(), len, unused, 0) >= 0;
-}
-
-inline int SubString::matches(const Regex& r) const
-{
- return r.match(chars(), len, 0) == len;
-}
-
-
-inline int String::gsub(const String& pat, const String& r)
-{
- return _gsub(pat.chars(), pat.length(), r.chars(), r.length());
-}
-
-inline int String::gsub(const SubString& pat, const String& r)
-{
- return _gsub(pat.chars(), pat.length(), r.chars(), r.length());
-}
-
-inline int String::gsub(const Regex& pat, const String& r)
-{
- return _gsub(pat, r.chars(), r.length());
-}
-
-inline int String::gsub(const char* pat, const String& r)
-{
- return _gsub(pat, -1, r.chars(), r.length());
-}
-
-inline int String::gsub(const char* pat, const char* r)
-{
- return _gsub(pat, -1, r, -1);
-}
-
-
-
-inline ostream& operator<<(ostream& s, const String& x)
-{
- s << x.chars(); return s;
-}
-
-// a zillion comparison operators
-
-inline int operator==(const String& x, const String& y)
-{
- return compare(x, y) == 0;
-}
-
-inline int operator!=(const String& x, const String& y)
-{
- return compare(x, y) != 0;
-}
-
-inline int operator>(const String& x, const String& y)
-{
- return compare(x, y) > 0;
-}
-
-inline int operator>=(const String& x, const String& y)
-{
- return compare(x, y) >= 0;
-}
-
-inline int operator<(const String& x, const String& y)
-{
- return compare(x, y) < 0;
-}
-
-inline int operator<=(const String& x, const String& y)
-{
- return compare(x, y) <= 0;
-}
-
-inline int operator==(const String& x, const SubString& y)
-{
- return compare(x, y) == 0;
-}
-
-inline int operator!=(const String& x, const SubString& y)
-{
- return compare(x, y) != 0;
-}
-
-inline int operator>(const String& x, const SubString& y)
-{
- return compare(x, y) > 0;
-}
-
-inline int operator>=(const String& x, const SubString& y)
-{
- return compare(x, y) >= 0;
-}
-
-inline int operator<(const String& x, const SubString& y)
-{
- return compare(x, y) < 0;
-}
-
-inline int operator<=(const String& x, const SubString& y)
-{
- return compare(x, y) <= 0;
-}
-
-inline int operator==(const String& x, const char* t)
-{
- return compare(x, t) == 0;
-}
-
-inline int operator!=(const String& x, const char* t)
-{
- return compare(x, t) != 0;
-}
-
-inline int operator>(const String& x, const char* t)
-{
- return compare(x, t) > 0;
-}
-
-inline int operator>=(const String& x, const char* t)
-{
- return compare(x, t) >= 0;
-}
-
-inline int operator<(const String& x, const char* t)
-{
- return compare(x, t) < 0;
-}
-
-inline int operator<=(const String& x, const char* t)
-{
- return compare(x, t) <= 0;
-}
-
-inline int operator==(const SubString& x, const String& y)
-{
- return compare(y, x) == 0;
-}
-
-inline int operator!=(const SubString& x, const String& y)
-{
- return compare(y, x) != 0;
-}
-
-inline int operator>(const SubString& x, const String& y)
-{
- return compare(y, x) < 0;
-}
-
-inline int operator>=(const SubString& x, const String& y)
-{
- return compare(y, x) <= 0;
-}
-
-inline int operator<(const SubString& x, const String& y)
-{
- return compare(y, x) > 0;
-}
-
-inline int operator<=(const SubString& x, const String& y)
-{
- return compare(y, x) >= 0;
-}
-
-inline int operator==(const SubString& x, const SubString& y)
-{
- return compare(x, y) == 0;
-}
-
-inline int operator!=(const SubString& x, const SubString& y)
-{
- return compare(x, y) != 0;
-}
-
-inline int operator>(const SubString& x, const SubString& y)
-{
- return compare(x, y) > 0;
-}
-
-inline int operator>=(const SubString& x, const SubString& y)
-{
- return compare(x, y) >= 0;
-}
-
-inline int operator<(const SubString& x, const SubString& y)
-{
- return compare(x, y) < 0;
-}
-
-inline int operator<=(const SubString& x, const SubString& y)
-{
- return compare(x, y) <= 0;
-}
-
-inline int operator==(const SubString& x, const char* t)
-{
- return compare(x, t) == 0;
-}
-
-inline int operator!=(const SubString& x, const char* t)
-{
- return compare(x, t) != 0;
-}
-
-inline int operator>(const SubString& x, const char* t)
-{
- return compare(x, t) > 0;
-}
-
-inline int operator>=(const SubString& x, const char* t)
-{
- return compare(x, t) >= 0;
-}
-
-inline int operator<(const SubString& x, const char* t)
-{
- return compare(x, t) < 0;
-}
-
-inline int operator<=(const SubString& x, const char* t)
-{
- return compare(x, t) <= 0;
-}
-
-
-// a helper needed by at, before, etc.
-
-inline SubString String::_substr(int first, int l)
-{
- if (first < 0 || (unsigned)(first + l) > length() )
- return SubString(_nilString, 0, 0) ;
- else
- return SubString(*this, first, l);
-}
-
-#endif
diff --git a/contrib/libg++/libg++/src/Uniform.cc b/contrib/libg++/libg++/src/Uniform.cc
deleted file mode 100644
index 0592b6d97812..000000000000
--- a/contrib/libg++/libg++/src/Uniform.cc
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Dirk Grunwald (grunwald@cs.uiuc.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <builtin.h>
-#include <Random.h>
-#include <Uniform.h>
-
-double Uniform::operator()()
-{
- return( pLow + delta * pGenerator -> asDouble() );
-}
diff --git a/contrib/libg++/libg++/src/Uniform.h b/contrib/libg++/libg++/src/Uniform.h
deleted file mode 100644
index 1a365b9a7745..000000000000
--- a/contrib/libg++/libg++/src/Uniform.h
+++ /dev/null
@@ -1,71 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Dirk Grunwald (grunwald@cs.uiuc.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#ifndef _Uniform_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _Uniform_h 1
-
-#include <Random.h>
-
-//
-// The interval [lo..hi]
-//
-
-class Uniform: public Random {
- double pLow;
- double pHigh;
- double delta;
-public:
- Uniform(double low, double high, RNG *gen);
-
- double low();
- double low(double x);
- double high();
- double high(double x);
-
- virtual double operator()();
-};
-
-
-inline Uniform::Uniform(double low, double high, RNG *gen) : Random(gen)
-{
- pLow = (low < high) ? low : high;
- pHigh = (low < high) ? high : low;
- delta = pHigh - pLow;
-}
-
-inline double Uniform::low() { return pLow; }
-
-inline double Uniform::low(double x) {
- double tmp = pLow;
- pLow = x;
- delta = pHigh - pLow;
- return tmp;
-}
-
-inline double Uniform::high() { return pHigh; }
-
-inline double Uniform::high(double x) {
- double tmp = pHigh;
- pHigh = x;
- delta = pHigh - pLow;
- return tmp;
-}
-
-#endif
diff --git a/contrib/libg++/libg++/src/Weibull.cc b/contrib/libg++/libg++/src/Weibull.cc
deleted file mode 100644
index d7987f5ece0b..000000000000
--- a/contrib/libg++/libg++/src/Weibull.cc
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Dirk Grunwald (grunwald@cs.uiuc.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <builtin.h>
-#include <Random.h>
-#include <Weibull.h>
-
-//
-// See Simulation, Modelling & Analysis by Law & Kelton, pp259
-//
-// This is the ``polar'' method.
-//
-
-double Weibull::operator()()
-{
- return( pow(pBeta * ( - log(1 - pGenerator -> asDouble()) ), pInvAlpha) );
-}
diff --git a/contrib/libg++/libg++/src/Weibull.h b/contrib/libg++/libg++/src/Weibull.h
deleted file mode 100644
index fd064d5e619b..000000000000
--- a/contrib/libg++/libg++/src/Weibull.h
+++ /dev/null
@@ -1,74 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Dirk Grunwald (grunwald@cs.uiuc.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#ifndef _Weibull_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _Weibull_h
-
-#include <Random.h>
-
-class Weibull: public Random {
-protected:
- double pAlpha;
- double pInvAlpha;
- double pBeta;
-
- void setState();
-
-public:
- Weibull(double alpha, double beta, RNG *gen);
-
- double alpha();
- double alpha(double x);
-
- double beta();
- double beta(double x);
-
- virtual double operator()();
-};
-
-
-inline void Weibull::setState() {
- pInvAlpha = 1.0 / pAlpha;
-}
-
-inline Weibull::Weibull(double alpha, double beta, RNG *gen) : Random(gen)
-{
- pAlpha = alpha;
- pBeta = beta;
- setState();
-}
-
-inline double Weibull::alpha() { return pAlpha; }
-
-inline double Weibull::alpha(double x) {
- double tmp = pAlpha;
- pAlpha = x;
- setState();
- return tmp;
-}
-
-inline double Weibull::beta() { return pBeta; };
-inline double Weibull::beta(double x) {
- double tmp = pBeta;
- pBeta = x;
- return tmp;
-};
-
-#endif
diff --git a/contrib/libg++/libg++/src/bitand.c b/contrib/libg++/libg++/src/bitand.c
deleted file mode 100644
index 149a8ab73866..000000000000
--- a/contrib/libg++/libg++/src/bitand.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/* Copyright (C) 1994 Free Software Foundation
-
-This file is part of the GNU BitString 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. */
-
-/* Written by Per Bothner (bothner@cygnus.com). */
-
-#include "bitprims.h"
-
-/* Copy LENGTH bits from (starting at SRCBIT) into pdst starting at DSTBIT.
- This will work even if psrc & pdst overlap. */
-
-void
-_BS_and (pdst, dstbit, psrc, srcbit, length)
- register _BS_word* pdst;
- int dstbit;
- register const _BS_word* psrc;
- int srcbit;
- _BS_size_t length;
-{
-#define COMBINE(dst, src) (dst) & (src)
-#include "bitdo2.h"
-}
diff --git a/contrib/libg++/libg++/src/bitany.c b/contrib/libg++/libg++/src/bitany.c
deleted file mode 100644
index 5a978d030d92..000000000000
--- a/contrib/libg++/libg++/src/bitany.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Copyright (C) 1994 Free Software Foundation
-
-This file is part of the GNU BitString 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. */
-
-/* Written by Per Bothner (bothner@cygnus.com) */
-
-#include "bitprims.h"
-
-int
-_BS_any (ptr, offset, length)
- register const _BS_word *ptr;
- int offset;
- _BS_size_t length;
-{
-#undef DOIT
-#define DOIT(WORD, MASK) if ((WORD) & (MASK)) return 1;
-#include "bitdo1.h"
- return 0;
-}
diff --git a/contrib/libg++/libg++/src/bitblt.c b/contrib/libg++/libg++/src/bitblt.c
deleted file mode 100644
index b38fd3d9eb1e..000000000000
--- a/contrib/libg++/libg++/src/bitblt.c
+++ /dev/null
@@ -1,97 +0,0 @@
-/* Copyright (C) 1994 Free Software Foundation
-
-This file is part of the GNU BitString 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. */
-
-/* Written by Per Bothner (bothner@cygnus.com).
- Based on ideas in the X11 MFB server. */
-
-#include "bitprims.h"
-#define ONES ((_BS_word)(~0))
-
-/* Copy LENGTH bits from (starting at SRCBIT) into pdst starting at DSTBIT.
- This will work even if psrc & pdst overlap. */
-
-void
-_BS_blt (op, pdst, dstbit, psrc, srcbit, length)
- enum _BS_alu op;
- register _BS_word* pdst;
- int dstbit;
- register const _BS_word* psrc;
- int srcbit;
- _BS_size_t length;
-{
- _BS_word ca1, cx1, ca2, cx2;
- switch (op)
- {
- case _BS_alu_clear:
- _BS_clear (pdst, dstbit, length);
- return;
- case _BS_alu_and:
- _BS_and (pdst, dstbit, psrc, srcbit, length);
- return;
- case _BS_alu_andReverse:
- ca1 = ONES; cx1 = 0; ca2 = ONES; cx2 = 0;
- break;
- case _BS_alu_copy:
- _BS_copy (pdst, dstbit, psrc, srcbit, length);
- return;
- case _BS_alu_andInverted:
- ca1 = ONES; cx1 = ONES; ca2 = 0; cx2 = 0;
- break;
- case _BS_alu_noop:
- return;
- case _BS_alu_xor:
- _BS_xor (pdst, dstbit, psrc, srcbit, length);
- return;
- case _BS_alu_or:
- ca1 = ONES; cx1 = ONES; ca2 = ONES; cx2 = 0;
- break;
- case _BS_alu_nor:
- ca1 = ONES; cx1 = ONES; ca2 = ONES; cx2 = ONES;
- break;
- case_BS_alu_equiv:
- ca1 = 0; cx1 = ONES; ca2 = ONES; cx2 = ONES;
- break;
- case _BS_alu_invert:
- _BS_invert (pdst, dstbit, length);
- return;
- case _BS_alu_orReverse:
- ca1 = ONES; cx1 = ONES; ca2 = 0; cx2 = ONES;
- break;
- case _BS_alu_copyInverted:
- ca1 = 0; cx1 = 0; ca2 = ONES; cx2 = ONES;
- break;
- case _BS_alu_orInverted:
- ca1 = ONES; cx1 = 0; ca2 = ONES; cx2 = ONES;
- break;
- case _BS_alu_nand:
- ca1 = ONES; cx1 = 0; ca2 = 0; cx2 = ONES;
- break;
- case _BS_alu_set:
- _BS_set (pdst, dstbit, length);
- return;
- }
- {
-#define COMBINE(dst, src) ((dst) & ((src) & ca1 ^ cx1) ^ ((src) & ca2 ^ cx2))
-#include "bitdo2.h"
- }
-}
diff --git a/contrib/libg++/libg++/src/bitclear.c b/contrib/libg++/libg++/src/bitclear.c
deleted file mode 100644
index 6dd94059ad68..000000000000
--- a/contrib/libg++/libg++/src/bitclear.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Copyright (C) 1994 Free Software Foundation
-
-This file is part of the GNU BitString 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. */
-
-/* Written by Per Bothner (bothner@cygnus.com) */
-
-#include "bitprims.h"
-
-void
-_BS_clear (ptr, offset, length)
- register _BS_word *ptr;
- int offset;
- _BS_size_t length;
-{
-#undef DOIT
-#define DOIT(WORD, MASK) ((WORD) &= ~(MASK))
-#include "bitdo1.h"
-}
diff --git a/contrib/libg++/libg++/src/bitcopy.c b/contrib/libg++/libg++/src/bitcopy.c
deleted file mode 100644
index aa48730e8d6e..000000000000
--- a/contrib/libg++/libg++/src/bitcopy.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/* Copyright (C) 1994 Free Software Foundation
-
-This file is part of the GNU BitString 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. */
-
-/* Written by Per Bothner (bothner@cygnus.com). */
-
-#include "bitprims.h"
-
-/* Copy LENGTH bits from (starting at SRCBIT) into pdst starting at DSTBIT.
- This will work even if psrc & pdst overlap. */
-
-void
-_BS_copy (pdst, dstbit, psrc, srcbit, length)
- register _BS_word* pdst;
- int dstbit;
- register const _BS_word* psrc;
- int srcbit;
- _BS_size_t length;
-{
-#define COMBINE(dst, src) (src)
-#include "bitdo2.h"
-}
diff --git a/contrib/libg++/libg++/src/bitcount.c b/contrib/libg++/libg++/src/bitcount.c
deleted file mode 100644
index 9583a827e4a3..000000000000
--- a/contrib/libg++/libg++/src/bitcount.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/* Copyright (C) 1994 Free Software Foundation
-
-This file is part of the GNU BitString 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. */
-
-/* Written by Per Bothner (bothner@cygnus.com) */
-
-#include "bitprims.h"
-
-/* bit_count[I] is number of '1' bits in I. */
-static const unsigned char
-four_bit_count[16] = {
- 0, 1, 1, 2,
- 1, 2, 2, 3,
- 1, 2, 2, 3,
- 2, 3, 3, 4};
-
-#if !defined(inline) && !defined(__GNUC__) && !defined(__cplusplus)
-#define inline
-#endif
-
-static inline int
-_BS_count_word (word)
- register _BS_word word;
-{
- register int count = 0;
- while (word > 0)
- {
- count += four_bit_count[word & 15];
- word >>= 4;
- }
- return count;
-}
-
-int
-_BS_count (ptr, offset, length)
- register const _BS_word *ptr;
- int offset;
- _BS_size_t length;
-{
- register int count = 0;
-#undef DOIT
-#define DOIT(WORD, MASK) count += _BS_count_word ((WORD) & (MASK));
-#include "bitdo1.h"
- return count;
-}
diff --git a/contrib/libg++/libg++/src/bitdo1.h b/contrib/libg++/libg++/src/bitdo1.h
deleted file mode 100644
index c234d41d4069..000000000000
--- a/contrib/libg++/libg++/src/bitdo1.h
+++ /dev/null
@@ -1,32 +0,0 @@
-#ifndef ONES
-#define ONES ((_BS_word)(~0L))
-#endif
- register int nwords;
- register _BS_word mask;
- if (offset == 0)
- ;
- else if (offset + length >= _BS_BITS_PER_WORD)
- {
- mask = ONES _BS_RIGHT offset;
- DOIT(*ptr++, mask);
- length -= _BS_BITS_PER_WORD - offset;
- }
- else
- {
- mask = (ONES _BS_RIGHT (_BS_BITS_PER_WORD - length))
- _BS_LEFT (_BS_BITS_PER_WORD - length - offset);
- DOIT(*ptr, mask);
- goto done;
- }
- nwords = _BS_INDEX(length);
- while (--nwords >= 0)
- {
- DOIT(*ptr++, ONES);
- }
- length = _BS_POS (length);
- if (length)
- {
- mask = ONES _BS_LEFT (_BS_BITS_PER_WORD - length);
- DOIT(*ptr, mask);
- }
- done: ;
diff --git a/contrib/libg++/libg++/src/bitdo2.h b/contrib/libg++/libg++/src/bitdo2.h
deleted file mode 100644
index 6e9952353721..000000000000
--- a/contrib/libg++/libg++/src/bitdo2.h
+++ /dev/null
@@ -1,184 +0,0 @@
-#ifndef ONES
-#define ONES ((_BS_word)(~0L))
-#endif
-
-#ifndef DOIT_SOLID
-#ifdef DOIT
-#define DOIT_SOLID(dst, src) DOIT(dst, src, (_BS_word)(~0))
-#else
-#define DOIT_SOLID(dst, src) (dst) = (COMBINE(dst, src))
-#endif
-#endif
-
-#ifndef DOIT
-#define DOIT(dst, src, mask) \
- (dst) = ((COMBINE(dst, src)) & (mask)) | ((dst) & ~(mask))
-#endif
-
- _BS_word word0, mask;
- int shift0, shift1;
-
- if (length == 0)
- goto done;
-
- shift0 = srcbit - dstbit;
-
- /* First handle the case that only one destination word is touched. */
- if (length + dstbit <= _BS_BITS_PER_WORD)
- {
- _BS_word mask
- = (ONES _BS_LEFT (_BS_BITS_PER_WORD - length)) _BS_RIGHT dstbit;
- _BS_word word0 = *psrc++;
- if (shift0 <= 0) /* dstbit >= srcbit */
- {
- word0 = word0 _BS_RIGHT (-shift0);
- }
- else
- {
- word0 = word0 _BS_LEFT shift0;
- if (length + srcbit > _BS_BITS_PER_WORD)
- word0 = word0 | (*psrc _BS_RIGHT (_BS_BITS_PER_WORD - shift0));
- }
- DOIT(*pdst, word0, mask);
- goto done;
- }
-
- /* Next optimize the case that the source and destination are aligned. */
- if (shift0 == 0)
- {
- _BS_word mask;
- if (psrc > pdst)
- {
- if (srcbit)
- {
- mask = ONES _BS_RIGHT srcbit;
- DOIT(*pdst, *psrc, mask);
- pdst++; psrc++;
- length -= _BS_BITS_PER_WORD - srcbit;
- }
- for (; length >= _BS_BITS_PER_WORD; length -= _BS_BITS_PER_WORD)
- {
- DOIT_SOLID(*pdst, *psrc);
- pdst++; psrc++;
- }
- if (length)
- {
- mask = ONES _BS_LEFT (_BS_BITS_PER_WORD - length);
- DOIT(*pdst, *psrc, mask);
- }
- }
- else if (psrc < pdst)
- {
- _BS_size_t span = srcbit + length;
- pdst += span / (_BS_size_t)_BS_BITS_PER_WORD;
- psrc += span / (_BS_size_t)_BS_BITS_PER_WORD;
- span %= (_BS_size_t)_BS_BITS_PER_WORD;
- if (span)
- {
- mask = ONES _BS_LEFT (_BS_BITS_PER_WORD - span);
- DOIT(*pdst, *psrc, mask);
- length -= span;
- }
- pdst--; psrc--;
- for (; length >= _BS_BITS_PER_WORD; length -= _BS_BITS_PER_WORD)
- {
- DOIT_SOLID(*pdst, *psrc);
- pdst--; psrc--;
- }
- if (srcbit)
- {
- mask = ONES _BS_RIGHT srcbit;
- DOIT(*pdst, *psrc, mask);
- }
- }
- /* else if (psrc == pdst) --nothing to do--; */
- goto done;
- }
-
- /* Now we assume shift!=0, and more than on destination word is changed. */
- if (psrc >= pdst) /* Do the updates in forward direction. */
- {
- _BS_word word0 = *psrc++;
- _BS_word mask = ONES _BS_RIGHT dstbit;
- if (shift0 > 0)
- {
- _BS_word word1 = *psrc++;
- shift1 = _BS_BITS_PER_WORD - shift0;
- DOIT(*pdst, (word0 _BS_LEFT shift0) | (word1 _BS_RIGHT shift1), mask);
- word0 = word1;
- }
- else /* dstbit > srcbit */
- {
- shift1 = -shift0;
- shift0 += _BS_BITS_PER_WORD;
- DOIT(*pdst, word0 _BS_RIGHT shift1, mask);
- }
- pdst++;
- length -= _BS_BITS_PER_WORD - dstbit;
-
- for ( ; length >= _BS_BITS_PER_WORD; length -= _BS_BITS_PER_WORD)
- {
- register _BS_word word1 = *psrc++;
- DOIT_SOLID(*pdst,
- (word0 _BS_LEFT shift0) | (word1 _BS_RIGHT shift1));
- pdst++;
- word0 = word1;
- }
- if (length > 0)
- {
- _BS_size_t mask = ONES _BS_LEFT (_BS_BITS_PER_WORD - length);
- word0 = word0 _BS_LEFT shift0;
- if (length > shift1)
- word0 = word0 | (*psrc _BS_RIGHT shift1) ;
- DOIT (*pdst, word0, mask);
- }
- }
- else /* Do the updates in backward direction. */
- {
- _BS_word word0;
-
- /* Make (psrc, srcbit) and (pdst, dstbit) point to *last* bit. */
- psrc += (srcbit + length - 1) / _BS_BITS_PER_WORD;
- srcbit = (srcbit + length - 1) % _BS_BITS_PER_WORD;
- pdst += (dstbit + length - 1) / _BS_BITS_PER_WORD;
- dstbit = (dstbit + length - 1) % _BS_BITS_PER_WORD;
-
- shift0 = srcbit - dstbit;
-
- word0 = *psrc--;
- mask = ONES _BS_LEFT (_BS_BITS_PER_WORD - 1 - dstbit);
- if (shift0 < 0)
- {
- _BS_word word1 = *psrc--;
- shift1 = -shift0;
- shift0 += _BS_BITS_PER_WORD;
- DOIT (*pdst, (word0 _BS_RIGHT shift1) | (word1 _BS_LEFT shift0),
- mask);
- word0 = word1;
- }
- else
- {
- shift1 = _BS_BITS_PER_WORD - shift0;
- DOIT(*pdst, word0 _BS_LEFT shift0, mask);
- }
- pdst--;
- length -= dstbit + 1;
-
- for ( ; length >= _BS_BITS_PER_WORD; length -= _BS_BITS_PER_WORD)
- {
- register _BS_word word1 = *psrc--;
- DOIT_SOLID(*pdst,
- (word0 _BS_RIGHT shift1) | (word1 _BS_LEFT shift0));
- pdst--;
- word0 = word1;
- }
- if (length > 0)
- {
- _BS_size_t mask = ONES _BS_RIGHT (_BS_BITS_PER_WORD - length);
- word0 = word0 _BS_RIGHT shift1;
- if (length > shift0)
- word0 = word0 | (*psrc _BS_LEFT shift0) ;
- DOIT (*pdst, word0, mask);
- }
- }
- done: ;
diff --git a/contrib/libg++/libg++/src/bitinvert.c b/contrib/libg++/libg++/src/bitinvert.c
deleted file mode 100644
index 558c397838c0..000000000000
--- a/contrib/libg++/libg++/src/bitinvert.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Copyright (C) 1994 Free Software Foundation
-
-This file is part of the GNU BitString 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. */
-
-/* Written by Per Bothner (bothner@cygnus.com) */
-
-#include "bitprims.h"
-
-void
-_BS_invert (ptr, offset, length)
- register _BS_word *ptr;
- int offset;
- _BS_size_t length;
-{
-#undef DOIT
-#define DOIT(WORD, MASK) ((WORD) ^= (MASK))
-#include "bitdo1.h"
-}
diff --git a/contrib/libg++/libg++/src/bitlcomp.c b/contrib/libg++/libg++/src/bitlcomp.c
deleted file mode 100644
index 3fbfdb72c83b..000000000000
--- a/contrib/libg++/libg++/src/bitlcomp.c
+++ /dev/null
@@ -1,81 +0,0 @@
-/* Copyright (C) 1994 Free Software Foundation
-
-This file is part of the GNU BitString 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. */
-
-/* Written by Per Bothner (bothner@cygnus.com) */
-
-#include "bitprims.h"
-#include <stdlib.h>
-
-/* Return -1, 0, 1 depending on whether (ptr0, len0) is
- lexicographically less than, equal, or greater than (ptr1, len1).
- Both bitstrings must be left-aligned. */
-
-int
-_BS_lcompare_0 (ptr0, len0, ptr1, len1)
- register const _BS_word *ptr0;
- _BS_size_t len0;
- register const _BS_word *ptr1;
- _BS_size_t len1;
-{
- _BS_size_t nwords0 = len0 / _BS_BITS_PER_WORD;
- _BS_size_t nwords1 = len1 / _BS_BITS_PER_WORD;
- register _BS_word word0, word1;
- _BS_size_t nwords = nwords0 > nwords1 ? nwords1 : nwords0;
- for (; nwords != 0; nwords--)
- {
- word0 = *ptr0++;
- word1 = *ptr1++;
- if (word0 != word1)
- {
-#if _BS_BIGENDIAN
- return (word0 < word1) ? -1 : 1;
-#else
- {
- _BS_word diff=(word0^word1); /* one's where different */
- _BS_word mask=diff&~(diff-1); /* first bit different */
- return (word0&mask)?1:-1;
- }
-#endif
- }
- }
- len0 -= nwords0 * _BS_BITS_PER_WORD;
- len1 -= nwords1 * _BS_BITS_PER_WORD;
- if (len0 == 0 || len1 == 0)
- return (len1 == 0) - (len0 == 0);
- len0 &= _BS_BITS_PER_WORD - 1;
- len1 &= _BS_BITS_PER_WORD - 1;
- word0 = *ptr0++ & ~((_BS_word)(~0) _BS_RIGHT len0);
- word1 = *ptr1++ & ~((_BS_word)(~0) _BS_RIGHT len1);
- if (word0 == word1)
- return len0 == len1 ? 0 : len0 < len1 ? -1 : 1;
-#if _BS_BIGENDIAN
- return (word0 < word1) ? -1 : 1;
-#else
- {
- _BS_word diff=(word0^word1); /* one's where different */
- _BS_word mask=diff&~(diff-1); /* first bit different */
- return (word0&mask)?1:-1;
- }
-#endif
-}
-
diff --git a/contrib/libg++/libg++/src/bitprims.h b/contrib/libg++/libg++/src/bitprims.h
deleted file mode 100644
index 25b809b68952..000000000000
--- a/contrib/libg++/libg++/src/bitprims.h
+++ /dev/null
@@ -1,125 +0,0 @@
-#ifndef _BS_PRIMS
-#define _BS_PRIMS
-
-/* A bitstring is an array of _BS_word. */
-typedef unsigned long _BS_word;
-
-#define _BS_CHAR_BIT 8
-#define _BS_BITS_PER_WORD (_BS_CHAR_BIT*sizeof(_BS_word))
-#define _BS_WORDS_NEEDED(NBITS) ((NBITS+_BS_BITS_PER_WORD-1)/_BS_BITS_PER_WORD)
-
-/* For now, we number the bits in a _BS_word in little-endian order.
- Later, might use machine order. */
-#ifdef CHILL_LIB
-#ifndef BITS_BIG_ENDIAN
-#include "config.h"
-#endif
-#define _BS_BIGENDIAN BITS_BIG_ENDIAN
-#else
-#define _BS_BIGENDIAN 0
-#endif
-
-/* By "left" we mean where bit number 0 is.
- Hence, so left shift is << if we're numbering the bits in big-endian oder,
- and >> if we're numbering the bits in little-endian order.
- Currently, we always use little-endian order.
- Later, we might use machine-endian order. */
-#if _BS_BIGENDIAN
-#define _BS_LEFT <<
-#define _BS_RIGHT >>
-#else
-#define _BS_LEFT >>
-#define _BS_RIGHT <<
-#endif
-
-#if _BS_BIGENDIAN
-#define _BS_BITMASK(BITNO) ((_BS_word)1 << (_BS_BITS_PER_WORD - 1 - (BITNO)))
-#else
-#define _BS_BITMASK(BITNO) ((_BS_word)1 << (BITNO))
-#endif
-
-/* Given a PTR which may not be aligned on a _BS_word boundary,
- set NEW_PTR to point to (the beginning of) the corresponding _BS_word.
- Adjust the bit-offset OFFSET to compensate for the difference. */
-#define _BS_ADJUST_ALIGNED(NEW_PTR, PTR, OFFSET) \
- ( (NEW_PTR) = (_BS_word*)(((char*)(PTR)-(char*)0) & ~(sizeof(_BS_word)-1)), \
- (OFFSET) += (char*)(PTR) - (char*)(NEW_PTR) )
-
-/* Given a bit pointer (PTR, OFFSET) normalize it so that
- OFFSET < _BS_BITS_PER_WORD. */
-#define _BS_NORMALIZE(PTR, OFFSET) \
-{ _BS_size_t __tmp_ind = _BS_INDEX (OFFSET); \
- (PTR) += __tmp_ind; \
- (OFFSET) -= __tmp_ind * _BS_BITS_PER_WORD; }
-
-#define _BS_INDEX(I) ((unsigned)(I) / _BS_BITS_PER_WORD)
-#define _BS_POS(I) ((I) & (_BS_BITS_PER_WORD -1 ))
-
-#ifndef _BS_size_t
-#if __GNUC__ > 1
-#define _BS_size_t __SIZE_TYPE__
-#else
-#define _BS_size_t unsigned long
-#endif
-#endif
-
-#ifndef __P
-#ifdef __STDC__
-#define __P(protos) protos
-#else
-#define __P(protos) ()
-#endif
-#endif /*!__P*/
-#if !defined(__STDC__) && !defined(const)
-#define const
-#endif
-#if !defined(__STDC__) && !defined(void)
-#define void int
-#endif
-
-/* The 16 2-operand raster-ops:
- These match the correspodning GX codes in X11. */
-enum _BS_alu {
- _BS_alu_clear = 0 /* 0 */,
- _BS_alu_and = 1 /* src & dst */,
- _BS_alu_andReverse = 2 /* src & ~dst */,
- _BS_alu_copy = 3 /* src */,
- _BS_alu_andInverted = 4 /* ~src & dst */,
- _BS_alu_noop = 5 /* dst */,
- _BS_alu_xor = 6 /* src ^ dst */,
- _BS_alu_or = 7 /* src | dst */,
- _BS_alu_nor = 8 /* ~src & ~dst */,
- _BS_alu_equiv = 9 /* ~(src ^ dst) */,
- _BS_alu_invert = 10 /* ~dst */,
- _BS_alu_orReverse = 11 /* src | ~dst */,
- _BS_alu_copyInverted = 12 /* ~src */,
- _BS_alu_orInverted = 13 /* ~src | dst */,
- _BS_alu_nand = 14 /* ~src | d~st */,
- _BS_alu_set = 15 /* ~src | dst */
-};
-#define _BS
-#define _BS
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern void _BS_and __P((_BS_word*,int, const _BS_word*, int, _BS_size_t));
-extern void _BS_blt __P((enum _BS_alu,
- _BS_word*,int, const _BS_word*,int, _BS_size_t));
-extern void _BS_copy __P((_BS_word*,int, const _BS_word*,int, _BS_size_t));
-#define _BS_copy_0(DS, SS, LENGTH) _BS_copy(DS, 0, SS, 0, LENGTH)
-extern int _BS_count __P((const _BS_word*, int, _BS_size_t));
-extern int _BS_any __P((const _BS_word*, int, _BS_size_t));
-extern void _BS_clear __P((_BS_word*, int, _BS_size_t));
-extern void _BS_set __P((_BS_word*, int, _BS_size_t));
-extern void _BS_invert __P((_BS_word*, int, _BS_size_t));
-int _BS_lcompare_0 __P((const _BS_word*, _BS_size_t,
- const _BS_word*, _BS_size_t));
-extern void _BS_xor __P((_BS_word*,int, const _BS_word*,int, _BS_size_t));
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* !_BS_PRIMS */
diff --git a/contrib/libg++/libg++/src/bitset1.c b/contrib/libg++/libg++/src/bitset1.c
deleted file mode 100644
index bf0dd8de1e11..000000000000
--- a/contrib/libg++/libg++/src/bitset1.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Copyright (C) 1994 Free Software Foundation
-
-This file is part of the GNU BitString 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. */
-
-/* Written by Per Bothner (bothner@cygnus.com) */
-
-#include "bitprims.h"
-
-void
-_BS_set (ptr, offset, length)
- register _BS_word *ptr;
- int offset;
- _BS_size_t length;
-{
-#undef DOIT
-#define DOIT(WORD, MASK) ((WORD) |= (MASK))
-#include "bitdo1.h"
-}
diff --git a/contrib/libg++/libg++/src/bitxor.c b/contrib/libg++/libg++/src/bitxor.c
deleted file mode 100644
index 7690419036ef..000000000000
--- a/contrib/libg++/libg++/src/bitxor.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/* Copyright (C) 1994 Free Software Foundation
-
-This file is part of the GNU BitString 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. */
-
-/* Written by Per Bothner (bothner@cygnus.com). */
-
-#include "bitprims.h"
-
-/* Copy LENGTH bits from (starting at SRCBIT) into pdst starting at DSTBIT.
- This will work even if psrc & pdst overlap. */
-
-void
-_BS_xor (pdst, dstbit, psrc, srcbit, length)
- register _BS_word* pdst;
- int dstbit;
- register const _BS_word* psrc;
- int srcbit;
- _BS_size_t length;
-{
-#define COMBINE(dst, src) (dst) ^ (src)
-#include "bitdo2.h"
-}
diff --git a/contrib/libg++/libg++/src/bool.h b/contrib/libg++/libg++/src/bool.h
deleted file mode 100644
index 40a2956e6e59..000000000000
--- a/contrib/libg++/libg++/src/bool.h
+++ /dev/null
@@ -1,24 +0,0 @@
-// Defining TRUE and FALSE is usually a Bad Idea,
-// because you will probably be inconsistent with anyone
-// else who had the same clever idea.
-// Therefore: DON'T USE THIS FILE.
-
-#ifndef _bool_h
-#define _bool_h 1
-
-#include <_G_config.h>
-
-#if _G_HAVE_BOOL
-#undef TRUE
-#undef FALSE
-#define TRUE true
-#define FALSE false
-#else
-#undef FALSE
-#undef TRUE
-#undef true
-#undef false
-enum bool { FALSE = 0, false = 0, TRUE = 1, true = 1 };
-#endif
-
-#endif
diff --git a/contrib/libg++/libg++/src/builtin.cc b/contrib/libg++/libg++/src/builtin.cc
deleted file mode 100644
index 6b9abe5380c5..000000000000
--- a/contrib/libg++/libg++/src/builtin.cc
+++ /dev/null
@@ -1,4 +0,0 @@
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <builtin.h>
diff --git a/contrib/libg++/libg++/src/builtin.h b/contrib/libg++/libg++/src/builtin.h
deleted file mode 100644
index 8d380828d771..000000000000
--- a/contrib/libg++/libg++/src/builtin.h
+++ /dev/null
@@ -1,125 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-
-/*
-Copyright (C) 1988, 1992 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-/*
- arithmetic, etc. functions on built in types
-*/
-
-
-#ifndef _builtin_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _builtin_h 1
-
-#include <stddef.h>
-#include <std.h>
-#include <cmath>
-
-#ifndef __GNUC__
-#define __attribute__(x)
-#endif
-
-typedef void (*one_arg_error_handler_t)(const char*);
-typedef void (*two_arg_error_handler_t)(const char*, const char*);
-
-long gcd(long, long);
-long lg(unsigned long);
-double pow(double, long);
-long pow(long, long);
-
-extern "C" double start_timer();
-extern "C" double return_elapsed_time(double last_time = 0.0);
-
-char* dtoa(double x, char cvt = 'g', int width = 0, int prec = 6);
-
-unsigned int hashpjw(const char*);
-unsigned int multiplicativehash(int);
-unsigned int foldhash(double);
-
-extern void default_one_arg_error_handler(const char*) __attribute__ ((noreturn));
-extern void default_two_arg_error_handler(const char*, const char*) __attribute__ ((noreturn));
-
-extern two_arg_error_handler_t lib_error_handler;
-
-extern two_arg_error_handler_t
- set_lib_error_handler(two_arg_error_handler_t f);
-
-
-#if !defined(IV)
-
-inline short abs(short arg)
-{
- return (arg < 0)? -arg : arg;
-}
-
-inline int sign(long arg)
-{
- return (arg == 0) ? 0 : ( (arg > 0) ? 1 : -1 );
-}
-
-inline int sign(double arg)
-{
- return (arg == 0.0) ? 0 : ( (arg > 0.0) ? 1 : -1 );
-}
-
-inline long sqr(long arg)
-{
- return arg * arg;
-}
-
-#if ! _G_MATH_H_INLINES /* hpux and SCO define this in math.h */
-inline double sqr(double arg)
-{
- return arg * arg;
-}
-#endif
-
-inline int even(long arg)
-{
- return !(arg & 1);
-}
-
-inline int odd(long arg)
-{
- return (arg & 1);
-}
-
-inline long lcm(long x, long y)
-{
- return x / gcd(x, y) * y;
-}
-
-inline void (setbit)(long& x, long b)
-{
- x |= (1 << b);
-}
-
-inline void clearbit(long& x, long b)
-{
- x &= ~(1 << b);
-}
-
-inline int testbit(long x, long b)
-{
- return ((x & (1 << b)) != 0);
-}
-
-#endif
-#endif
diff --git a/contrib/libg++/libg++/src/compare.cc b/contrib/libg++/libg++/src/compare.cc
deleted file mode 100644
index aae8409a2aa5..000000000000
--- a/contrib/libg++/libg++/src/compare.cc
+++ /dev/null
@@ -1,4 +0,0 @@
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <compare.h>
diff --git a/contrib/libg++/libg++/src/compare.h b/contrib/libg++/libg++/src/compare.h
deleted file mode 100644
index fb720749873f..000000000000
--- a/contrib/libg++/libg++/src/compare.h
+++ /dev/null
@@ -1,91 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifndef _compare_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _compare_h 1
-
-#include <builtin.h>
-
-int compare(int a, int b);
-int compare(short a, short b);
-int compare(unsigned long a, unsigned long b);
-int compare(unsigned int a, unsigned int b);
-int compare(unsigned short a, unsigned short b);
-int compare(unsigned char a, unsigned char b);
-int compare(signed char a, signed char b);
-int compare(float a, float b);
-int compare(double a, double b);
-int compare(const char* a, const char* b);
-
-
-inline int compare(int a, int b)
-{
- return a - b;
-}
-
-inline int compare(short a, short b)
-{
- return a - b;
-}
-
-
-inline int compare(signed char a, signed char b)
-{
- return a - b;
-}
-
-inline int compare(unsigned long a, unsigned long b)
-{
- return (a < b)? -1 : (a > b)? 1 : 0;
-}
-
-inline int compare(unsigned int a, unsigned int b)
-{
- return (a < b)? -1 : (a > b)? 1 : 0;
-}
-
-inline int compare(unsigned short a, unsigned short b)
-{
- return (a < b)? -1 : (a > b)? 1 : 0;
-}
-
-inline int compare(unsigned char a, unsigned char b)
-{
- return (a < b)? -1 : (a > b)? 1 : 0;
-}
-
-inline int compare(float a, float b)
-{
- return (a < b)? -1 : (a > b)? 1 : 0;
-}
-
-inline int compare(double a, double b)
-{
- return (a < b)? -1 : (a > b)? 1 : 0;
-}
-
-inline int compare(const char* a, const char* b)
-{
- return strcmp(a,b);
-}
-
-#endif
diff --git a/contrib/libg++/libg++/src/configure.in b/contrib/libg++/libg++/src/configure.in
deleted file mode 100644
index 7b1abbf85749..000000000000
--- a/contrib/libg++/libg++/src/configure.in
+++ /dev/null
@@ -1,45 +0,0 @@
-# This file is a shell script fragment that supplies the information
-# necessary to tailor a template configure script into the configure
-# script appropriate for this directory. For more information, check
-# any existing configure script.
-
-configdirs=""
-srctrigger=Integer.cc
-srcname="main libio sources files"
-
-target_makefile_frag=../target-mkfrag
-package_makefile_frag=Make.pack
-
-# per-host:
-
-# per-target:
-
-LIBDIR=yes
-TOLIBGXX=../
-ALL='$(OBJS)'
-EXTRA_DISTCLEAN=rx.h
-MOSTLYCLEAN='*.o pic stamp-picdir core libgxx.list'
-XCINCLUDES='-I../../libio'
-
-(. ${srcdir}/../config.shared) >${package_makefile_frag}
-
-files=../../librx/rx.h
-links=rx.h
-
-# post-target:
-
-rm -f ${package_makefile_frag}
-
-# We need multilib support.
-case ${srcdir} in
-.)
- if [ "${with_target_subdir}" != "." ] ; then
- . ${srcdir}/${with_multisrctop}../../../config-ml.in
- else
- . ${srcdir}/${with_multisrctop}../../config-ml.in
- fi
- ;;
-*)
- . ${srcdir}/../../config-ml.in
- ;;
-esac
diff --git a/contrib/libg++/libg++/src/depend b/contrib/libg++/libg++/src/depend
deleted file mode 100644
index 6934ef42feff..000000000000
--- a/contrib/libg++/libg++/src/depend
+++ /dev/null
@@ -1,849 +0,0 @@
-# AUTOMATICALLY GENERATED BY 'make depend' - DO NOT EDIT
-
-ACG.o: ACG.cc \
- $(srcdir)/ACG.h $(srcdir)/RNG.h \
- ../../libio/_G_config.h
-AllocRing.o: AllocRing.cc \
- $(srcdir)/std.h ../../libio/_G_config.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/stddef \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/stddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdlib \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdlib.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstring \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstring.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdio \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdio.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cerrno \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cerrno.h \
- $(srcdir)/AllocRing.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/new.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/new.h
-Binomial.o: Binomial.cc \
- $(srcdir)/builtin.h \
- $(srcdir)/std.h ../../libio/_G_config.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/stddef \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/stddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdlib \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdlib.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstring \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstring.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdio \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdio.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cerrno \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cerrno.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cmath \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cmath.h \
- $(srcdir)/Random.h \
- $(srcdir)/RNG.h \
- $(srcdir)/Binomial.h
-BitSet.o: BitSet.cc \
- $(srcdir)/BitSet.h \
- $(srcdir)/$(MULTISRCTOP)../../libio/iostream.h \
- $(srcdir)/$(MULTISRCTOP)../../libio/streambuf.h \
- $(srcdir)/$(MULTISRCTOP)../../libio/libio.h \
- ../../libio/_G_config.h \
- $(srcdir)/bitprims.h \
- $(srcdir)/std.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/stddef \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/stddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdlib \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdlib.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstring \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstring.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdio \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdio.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cerrno \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cerrno.h \
- $(srcdir)/Obstack.h \
- $(srcdir)/AllocRing.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/new.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/new.h \
- $(srcdir)/builtin.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cmath \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cmath.h \
- $(srcdir)/$(MULTISRCTOP)../../libio/strstream.h \
- $(srcdir)/$(MULTISRCTOP)../../libio/strfile.h
-BitString.o: BitString.cc \
- $(srcdir)/BitString.h \
- $(srcdir)/$(MULTISRCTOP)../../libio/stream.h \
- $(srcdir)/$(MULTISRCTOP)../../libio/iostream.h \
- $(srcdir)/$(MULTISRCTOP)../../libio/streambuf.h \
- $(srcdir)/$(MULTISRCTOP)../../libio/libio.h \
- ../../libio/_G_config.h \
- $(srcdir)/bitprims.h \
- $(srcdir)/std.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/stddef \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/stddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdlib \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdlib.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstring \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstring.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdio \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdio.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cerrno \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cerrno.h \
- $(srcdir)/Obstack.h \
- $(srcdir)/AllocRing.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/new.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/new.h \
- $(srcdir)/builtin.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cmath \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cmath.h \
- $(srcdir)/$(MULTISRCTOP)../../libio/strstream.h \
- $(srcdir)/$(MULTISRCTOP)../../libio/strfile.h
-CursesW.o: CursesW.cc \
- $(srcdir)/builtin.h \
- $(srcdir)/std.h ../../libio/_G_config.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/stddef \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/stddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdlib \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdlib.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstring \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstring.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdio \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdio.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cerrno \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cerrno.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cmath \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cmath.h \
- $(srcdir)/$(MULTISRCTOP)../../libio/strstream.h \
- $(srcdir)/$(MULTISRCTOP)../../libio/iostream.h \
- $(srcdir)/$(MULTISRCTOP)../../libio/streambuf.h \
- $(srcdir)/$(MULTISRCTOP)../../libio/libio.h \
- $(srcdir)/$(MULTISRCTOP)../../libio/strfile.h \
- $(srcdir)/CursesW.h
-DLList.o: DLList.cc \
- $(srcdir)/$(MULTISRCTOP)../../libio/stream.h \
- $(srcdir)/$(MULTISRCTOP)../../libio/iostream.h \
- $(srcdir)/$(MULTISRCTOP)../../libio/streambuf.h \
- $(srcdir)/$(MULTISRCTOP)../../libio/libio.h \
- ../../libio/_G_config.h $(srcdir)/builtin.h \
- $(srcdir)/std.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/stddef \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/stddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdlib \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdlib.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstring \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstring.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdio \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdio.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cerrno \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cerrno.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cmath \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cmath.h \
- $(srcdir)/DLList.h \
- $(srcdir)/Pix.h
-DiscUnif.o: DiscUnif.cc \
- $(srcdir)/builtin.h \
- $(srcdir)/std.h ../../libio/_G_config.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/stddef \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/stddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdlib \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdlib.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstring \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstring.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdio \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdio.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cerrno \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cerrno.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cmath \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cmath.h \
- $(srcdir)/Random.h \
- $(srcdir)/RNG.h \
- $(srcdir)/DiscUnif.h
-Erlang.o: Erlang.cc \
- $(srcdir)/builtin.h \
- $(srcdir)/std.h ../../libio/_G_config.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/stddef \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/stddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdlib \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdlib.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstring \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstring.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdio \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdio.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cerrno \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cerrno.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cmath \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cmath.h \
- $(srcdir)/Random.h \
- $(srcdir)/RNG.h \
- $(srcdir)/Erlang.h
-Fix.o: Fix.cc \
- $(srcdir)/Fix.h \
- $(srcdir)/$(MULTISRCTOP)../../libio/stream.h \
- $(srcdir)/$(MULTISRCTOP)../../libio/iostream.h \
- $(srcdir)/$(MULTISRCTOP)../../libio/streambuf.h \
- $(srcdir)/$(MULTISRCTOP)../../libio/libio.h \
- ../../libio/_G_config.h $(srcdir)/std.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/stddef \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/stddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdlib \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdlib.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstring \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstring.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdio \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdio.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cerrno \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cerrno.h \
- $(srcdir)/Integer.h \
- $(srcdir)/builtin.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cmath \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cmath.h \
- $(srcdir)/Obstack.h \
- $(srcdir)/AllocRing.h \
- $(srcdir)/$(MULTISRCTOP)../../libio/strstream.h \
- $(srcdir)/$(MULTISRCTOP)../../libio/strfile.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/new.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/new.h
-Fix16.o: Fix16.cc \
- $(srcdir)/Fix16.h \
- $(srcdir)/$(MULTISRCTOP)../../libio/stream.h \
- $(srcdir)/$(MULTISRCTOP)../../libio/iostream.h \
- $(srcdir)/$(MULTISRCTOP)../../libio/streambuf.h \
- $(srcdir)/$(MULTISRCTOP)../../libio/libio.h \
- ../../libio/_G_config.h $(srcdir)/std.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/stddef \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/stddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdlib \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdlib.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstring \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstring.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdio \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdio.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cerrno \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cerrno.h
-Fix24.o: Fix24.cc \
- $(srcdir)/Fix24.h \
- $(srcdir)/$(MULTISRCTOP)../../libio/stream.h \
- $(srcdir)/$(MULTISRCTOP)../../libio/iostream.h \
- $(srcdir)/$(MULTISRCTOP)../../libio/streambuf.h \
- $(srcdir)/$(MULTISRCTOP)../../libio/libio.h \
- ../../libio/_G_config.h $(srcdir)/std.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/stddef \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/stddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdlib \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdlib.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstring \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstring.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdio \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdio.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cerrno \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cerrno.h
-Geom.o: Geom.cc \
- $(srcdir)/builtin.h \
- $(srcdir)/std.h ../../libio/_G_config.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/stddef \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/stddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdlib \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdlib.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstring \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstring.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdio \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdio.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cerrno \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cerrno.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cmath \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cmath.h \
- $(srcdir)/Random.h \
- $(srcdir)/RNG.h \
- $(srcdir)/Geom.h
-GetOpt.o: GetOpt.cc \
- $(srcdir)/GetOpt.h \
- $(srcdir)/std.h ../../libio/_G_config.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/stddef \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/stddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdlib \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdlib.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstring \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstring.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdio \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdio.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cerrno \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cerrno.h
-HypGeom.o: HypGeom.cc \
- $(srcdir)/builtin.h \
- $(srcdir)/std.h ../../libio/_G_config.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/stddef \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/stddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdlib \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdlib.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstring \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstring.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdio \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdio.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cerrno \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cerrno.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cmath \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cmath.h \
- $(srcdir)/Random.h \
- $(srcdir)/RNG.h \
- $(srcdir)/HypGeom.h
-Intdouble.o: Intdouble.cc \
- $(srcdir)/Integer.h \
- $(srcdir)/$(MULTISRCTOP)../../libio/iostream.h \
- $(srcdir)/$(MULTISRCTOP)../../libio/streambuf.h \
- $(srcdir)/$(MULTISRCTOP)../../libio/libio.h \
- ../../libio/_G_config.h $(srcdir)/Integer.hP
-Integer.o: Integer.cc \
- $(srcdir)/Integer.h \
- $(srcdir)/$(MULTISRCTOP)../../libio/iostream.h \
- $(srcdir)/$(MULTISRCTOP)../../libio/streambuf.h \
- $(srcdir)/$(MULTISRCTOP)../../libio/libio.h \
- ../../libio/_G_config.h $(srcdir)/std.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/stddef \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/stddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdlib \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdlib.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstring \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstring.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdio \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdio.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cerrno \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cerrno.h \
- $(srcdir)/Obstack.h \
- $(srcdir)/AllocRing.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/new.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/new.h \
- $(srcdir)/builtin.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cmath \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cmath.h \
- $(srcdir)/Integer.hP
-LogNorm.o: LogNorm.cc \
- $(srcdir)/builtin.h \
- $(srcdir)/std.h ../../libio/_G_config.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/stddef \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/stddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdlib \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdlib.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstring \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstring.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdio \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdio.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cerrno \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cerrno.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cmath \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cmath.h \
- $(srcdir)/Random.h \
- $(srcdir)/RNG.h \
- $(srcdir)/Normal.h \
- $(srcdir)/LogNorm.h
-MLCG.o: MLCG.cc \
- $(srcdir)/MLCG.h $(srcdir)/RNG.h \
- ../../libio/_G_config.h
-NegExp.o: NegExp.cc \
- $(srcdir)/builtin.h \
- $(srcdir)/std.h ../../libio/_G_config.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/stddef \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/stddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdlib \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdlib.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstring \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstring.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdio \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdio.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cerrno \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cerrno.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cmath \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cmath.h \
- $(srcdir)/Random.h \
- $(srcdir)/RNG.h \
- $(srcdir)/NegExp.h
-Normal.o: Normal.cc \
- $(srcdir)/builtin.h \
- $(srcdir)/std.h ../../libio/_G_config.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/stddef \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/stddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdlib \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdlib.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstring \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstring.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdio \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdio.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cerrno \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cerrno.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cmath \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cmath.h \
- $(srcdir)/Random.h \
- $(srcdir)/RNG.h \
- $(srcdir)/Normal.h
-Obstack.o: Obstack.cc \
- $(srcdir)/builtin.h \
- $(srcdir)/std.h ../../libio/_G_config.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/stddef \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/stddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdlib \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdlib.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstring \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstring.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdio \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdio.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cerrno \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cerrno.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cmath \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cmath.h \
- $(srcdir)/Obstack.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/new.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/new.h
-Poisson.o: Poisson.cc \
- $(srcdir)/builtin.h \
- $(srcdir)/std.h ../../libio/_G_config.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/stddef \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/stddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdlib \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdlib.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstring \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstring.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdio \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdio.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cerrno \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cerrno.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cmath \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cmath.h \
- $(srcdir)/Random.h \
- $(srcdir)/RNG.h \
- $(srcdir)/Poisson.h
-RNG.o: RNG.cc \
- $(srcdir)/builtin.h \
- $(srcdir)/std.h ../../libio/_G_config.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/stddef \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/stddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdlib \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdlib.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstring \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstring.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdio \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdio.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cerrno \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cerrno.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cmath \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cmath.h \
- $(srcdir)/RNG.h
-Random.o: Random.cc \
- $(srcdir)/Random.h \
- $(srcdir)/RNG.h \
- ../../libio/_G_config.h
-Rational.o: Rational.cc \
- $(srcdir)/Rational.h \
- $(srcdir)/Integer.h \
- $(srcdir)/$(MULTISRCTOP)../../libio/iostream.h \
- $(srcdir)/$(MULTISRCTOP)../../libio/streambuf.h \
- $(srcdir)/$(MULTISRCTOP)../../libio/libio.h \
- ../../libio/_G_config.h \
- $(srcdir)/std.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/stddef \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/stddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdlib \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdlib.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstring \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstring.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdio \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdio.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cerrno \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cerrno.h \
- $(srcdir)/builtin.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cmath \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cmath.h
-Regex.o: Regex.cc \
- $(srcdir)/std.h ../../libio/_G_config.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/stddef \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/stddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdlib \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdlib.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstring \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstring.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdio \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdio.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cerrno \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cerrno.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/new.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/new.h \
- $(srcdir)/builtin.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cmath \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cmath.h \
- rx.h $(srcdir)/Regex.h
-RndInt.o: RndInt.cc \
- $(srcdir)/RndInt.h \
- $(srcdir)/RNG.h \
- ../../libio/_G_config.h
-SLList.o: SLList.cc \
- $(srcdir)/$(MULTISRCTOP)../../libio/stream.h \
- $(srcdir)/$(MULTISRCTOP)../../libio/iostream.h \
- $(srcdir)/$(MULTISRCTOP)../../libio/streambuf.h \
- $(srcdir)/$(MULTISRCTOP)../../libio/libio.h \
- ../../libio/_G_config.h $(srcdir)/builtin.h \
- $(srcdir)/std.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/stddef \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/stddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdlib \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdlib.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstring \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstring.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdio \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdio.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cerrno \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cerrno.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cmath \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cmath.h \
- $(srcdir)/SLList.h \
- $(srcdir)/Pix.h
-Sample.o: Sample.cc \
- $(srcdir)/$(MULTISRCTOP)../../libio/stream.h \
- $(srcdir)/$(MULTISRCTOP)../../libio/iostream.h \
- $(srcdir)/$(MULTISRCTOP)../../libio/streambuf.h \
- $(srcdir)/$(MULTISRCTOP)../../libio/libio.h \
- ../../libio/_G_config.h $(srcdir)/SmplStat.h \
- $(srcdir)/builtin.h \
- $(srcdir)/std.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/stddef \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/stddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdlib \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdlib.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstring \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstring.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdio \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdio.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cerrno \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cerrno.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cmath \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cmath.h \
- $(srcdir)/SmplHist.h
-SmplHist.o: SmplHist.cc \
- $(srcdir)/$(MULTISRCTOP)../../libio/stream.h \
- $(srcdir)/$(MULTISRCTOP)../../libio/iostream.h \
- $(srcdir)/$(MULTISRCTOP)../../libio/streambuf.h \
- $(srcdir)/$(MULTISRCTOP)../../libio/libio.h \
- ../../libio/_G_config.h $(srcdir)/SmplHist.h \
- $(srcdir)/SmplStat.h \
- $(srcdir)/builtin.h \
- $(srcdir)/std.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/stddef \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/stddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdlib \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdlib.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstring \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstring.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdio \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdio.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cerrno \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cerrno.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cmath \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cmath.h
-SmplStat.o: SmplStat.cc \
- $(srcdir)/$(MULTISRCTOP)../../libio/stream.h \
- $(srcdir)/$(MULTISRCTOP)../../libio/iostream.h \
- $(srcdir)/$(MULTISRCTOP)../../libio/streambuf.h \
- $(srcdir)/$(MULTISRCTOP)../../libio/libio.h \
- ../../libio/_G_config.h $(srcdir)/SmplStat.h \
- $(srcdir)/builtin.h \
- $(srcdir)/std.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/stddef \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/stddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdlib \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdlib.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstring \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstring.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdio \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdio.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cerrno \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cerrno.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cmath \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cmath.h
-String.o: String.cc \
- $(srcdir)/String.h \
- $(srcdir)/$(MULTISRCTOP)../../libio/iostream.h \
- $(srcdir)/$(MULTISRCTOP)../../libio/streambuf.h \
- $(srcdir)/$(MULTISRCTOP)../../libio/libio.h \
- ../../libio/_G_config.h $(srcdir)/Regex.h \
- $(srcdir)/std.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/stddef \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/stddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdlib \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdlib.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstring \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstring.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdio \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdio.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cerrno \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cerrno.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/new.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/new.h \
- $(srcdir)/builtin.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cmath \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cmath.h
-Uniform.o: Uniform.cc \
- $(srcdir)/builtin.h \
- $(srcdir)/std.h ../../libio/_G_config.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/stddef \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/stddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdlib \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdlib.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstring \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstring.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdio \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdio.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cerrno \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cerrno.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cmath \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cmath.h \
- $(srcdir)/Random.h \
- $(srcdir)/RNG.h \
- $(srcdir)/Uniform.h
-Weibull.o: Weibull.cc \
- $(srcdir)/builtin.h \
- $(srcdir)/std.h ../../libio/_G_config.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/stddef \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/stddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdlib \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdlib.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstring \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstring.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdio \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdio.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cerrno \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cerrno.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cmath \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cmath.h \
- $(srcdir)/Random.h \
- $(srcdir)/RNG.h \
- $(srcdir)/Weibull.h
-builtin.o: builtin.cc \
- $(srcdir)/builtin.h \
- $(srcdir)/std.h ../../libio/_G_config.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/stddef \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/stddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdlib \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdlib.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstring \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstring.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdio \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdio.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cerrno \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cerrno.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cmath \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cmath.h
-compare.o: compare.cc \
- $(srcdir)/compare.h \
- $(srcdir)/builtin.h \
- $(srcdir)/std.h ../../libio/_G_config.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/stddef \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/stddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdlib \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdlib.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstring \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstring.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdio \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdio.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cerrno \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cerrno.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cmath \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cmath.h
-dtoa.o: dtoa.cc \
- $(srcdir)/builtin.h \
- $(srcdir)/std.h ../../libio/_G_config.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/stddef \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/stddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdlib \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdlib.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstring \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstring.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdio \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdio.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cerrno \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cerrno.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cmath \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cmath.h \
- $(srcdir)/AllocRing.h
-error.o: error.cc \
- $(srcdir)/builtin.h \
- $(srcdir)/std.h ../../libio/_G_config.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/stddef \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/stddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdlib \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdlib.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstring \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstring.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdio \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdio.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cerrno \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cerrno.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cmath \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cmath.h
-fmtq.o: fmtq.cc \
- $(srcdir)/builtin.h \
- $(srcdir)/std.h ../../libio/_G_config.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/stddef \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/stddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdlib \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdlib.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstring \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstring.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdio \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdio.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cerrno \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cerrno.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cmath \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cmath.h \
- $(srcdir)/AllocRing.h
-gcd.o: gcd.cc \
- $(srcdir)/builtin.h \
- $(srcdir)/std.h ../../libio/_G_config.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/stddef \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/stddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdlib \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdlib.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstring \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstring.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdio \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdio.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cerrno \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cerrno.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cmath \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cmath.h
-hash.o: hash.cc \
- $(srcdir)/builtin.h \
- $(srcdir)/std.h ../../libio/_G_config.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/stddef \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/stddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdlib \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdlib.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstring \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstring.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdio \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdio.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cerrno \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cerrno.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cmath \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cmath.h
-ioob.o: ioob.cc \
- $(srcdir)/Obstack.h \
- $(srcdir)/std.h ../../libio/_G_config.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/stddef \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/stddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdlib \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdlib.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstring \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstring.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdio \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdio.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cerrno \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cerrno.h
-lg.o: lg.cc \
- $(srcdir)/builtin.h \
- $(srcdir)/std.h ../../libio/_G_config.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/stddef \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/stddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdlib \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdlib.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstring \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstring.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdio \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdio.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cerrno \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cerrno.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cmath \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cmath.h
-minmax.o: minmax.cc \
- $(srcdir)/minmax.h ../../libio/_G_config.h
-pow.o: pow.cc \
- $(srcdir)/builtin.h \
- $(srcdir)/std.h ../../libio/_G_config.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/stddef \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/stddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdlib \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdlib.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstring \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstring.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdio \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdio.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cerrno \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cerrno.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cmath \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cmath.h
-sqrt.o: sqrt.cc \
- $(srcdir)/builtin.h \
- $(srcdir)/std.h ../../libio/_G_config.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/stddef \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/stddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstddef.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdlib \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdlib.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstring \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstring.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cstdio \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cstdio.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cerrno \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cerrno.h \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/cmath \
- $(srcdir)/$(MULTISRCTOP)../../libstdc++/std/cmath.h
-bitand.o: bitand.c \
- $(srcdir)/bitprims.h \
- $(srcdir)/bitdo2.h
-bitany.o: bitany.c \
- $(srcdir)/bitprims.h \
- $(srcdir)/bitdo1.h
-bitblt.o: bitblt.c \
- $(srcdir)/bitprims.h \
- $(srcdir)/bitdo2.h
-bitclear.o: bitclear.c \
- $(srcdir)/bitprims.h \
- $(srcdir)/bitdo1.h
-bitcopy.o: bitcopy.c \
- $(srcdir)/bitprims.h \
- $(srcdir)/bitdo2.h
-bitcount.o: bitcount.c \
- $(srcdir)/bitprims.h \
- $(srcdir)/bitdo1.h
-bitinvert.o: bitinvert.c \
- $(srcdir)/bitprims.h \
- $(srcdir)/bitdo1.h
-bitlcomp.o: bitlcomp.c \
- $(srcdir)/bitprims.h
-bitset1.o: bitset1.c \
- $(srcdir)/bitprims.h \
- $(srcdir)/bitdo1.h
-bitxor.o: bitxor.c \
- $(srcdir)/bitprims.h \
- $(srcdir)/bitdo2.h
-malloc.o: malloc.c
-timer.o: timer.c ../../libio/_G_config.h
diff --git a/contrib/libg++/libg++/src/dtoa.cc b/contrib/libg++/libg++/src/dtoa.cc
deleted file mode 100644
index cdc69200e8a1..000000000000
--- a/contrib/libg++/libg++/src/dtoa.cc
+++ /dev/null
@@ -1,335 +0,0 @@
-/*
-Copyright (C) 1990 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <builtin.h>
-#include <math.h>
-#include <values.h>
-#include <AllocRing.h>
-
-extern AllocRing _libgxx_fmtq;
-
-#ifdef __GNUC__ /* cfront cannot compile this routine */
-// OBSOLETE ROUTINE!
-
-char* dtoa(double fpnum, char cvt, int width, int prec)
-{
- // set up workspace
-
- // max possible digits <= those need to show all of prec + exp
- // <= ceil(log10(HUGE)) plus space for null, etc.
-
- const int worksiz = int((M_LN2 / M_LN10) * DMAXEXP) + 8;
-
- // for fractional part
- char fwork[worksiz];
- char* fw = fwork;
-
- // for integer part
- char iwork[worksiz];
- char* iworkend = &iwork[sizeof(iwork) - 1];
- char* iw = iworkend;
- *iw = 0;
-
- // for exponent part
-
- const int eworksiz = int(M_LN2 * _DEXPLEN) + 8;
- char ework[eworksiz];
- char* eworkend = &ework[sizeof(ework) - 1];
- char* ew = eworkend;
- *ew = 0;
-
-#if (_IEEE != 0)
- if (isinf(fpnum))
- {
- char* inffmt = (char *) _libgxx_fmtq.alloc(5);
- char* inffmtp = inffmt;
- if (fpnum < 0)
- *inffmtp++ = '-';
- strcpy(inffmtp, "Inf");
- return inffmt;
- }
-
- if (isnan(fpnum))
- {
- char* nanfmt = (char *) _libgxx_fmtq.alloc(4);
- strcpy(nanfmt, "NaN");
- return nanfmt;
- }
-#endif
-
- // grab sign & make non-negative
- int is_neg = fpnum < 0;
- if (is_neg) fpnum = -fpnum;
-
- // precision matters
-
- if (prec > worksiz - 2) // can't have more prec than supported
- prec = worksiz - 2;
-
- double powprec;
- if (prec == 6)
- powprec = 1.0e6;
- else
- powprec = pow(10.0, (long) prec);
-
- double rounder = 0.5 / powprec;
-
- int f_fmt = cvt == 'f' ||
- ((cvt == 'g') && (fpnum == 0.0 || (fpnum >= 1e-4 && fpnum < powprec)));
-
- int iwidth = 0;
- int fwidth = 0;
- int ewidth = 0;
-
- if (f_fmt) // fixed format
- {
- double ipart;
- double fpart = modf(fpnum, &ipart);
-
- // convert fractional part
-
- if (fpart >= rounder || cvt != 'g')
- {
- fpart += rounder;
- if (fpart >= 1.0)
- {
- ipart += 1.0;
- fpart -= 1.0;
- }
- double ffpart = fpart;
- double ifpart;
- for (int i = 0; i < prec; ++i)
- {
- ffpart = modf(ffpart * 10.0, &ifpart);
- *fw++ = '0' + int(ifpart);
- ++fwidth;
- }
- if (cvt == 'g') // inhibit trailing zeroes if g-fmt
- {
- for (char* p = fw - 1; p >= fwork && *p == '0'; --p)
- {
- *p = 0;
- --fwidth;
- }
- }
- }
-
- // convert integer part
- if (ipart == 0.0)
- {
- if (cvt != 'g' || fwidth < prec || fwidth < width)
- {
- *--iw = '0'; ++iwidth;
- }
- }
- else if (ipart <= double(MAXLONG)) // a useful speedup
- {
- long li = long(ipart);
- while (li != 0)
- {
- *--iw = '0' + (li % 10);
- li = li / 10;
- ++iwidth;
- }
- }
- else // the slow way
- {
- while (ipart > 0.5)
- {
- double ff = modf(ipart / 10.0, &ipart);
- ff = (ff + 0.05) * 10.0;
- *--iw = '0' + int(ff);
- ++iwidth;
- }
- }
-
- // g-fmt: kill part of frac if prec/width exceeded
- if (cvt == 'g')
- {
- int m = prec;
- if (m < width)
- m = width;
- int adj = iwidth + fwidth - m;
- if (adj > fwidth)
- adj = fwidth;
- if (adj > 0)
- {
- for (char* f = &fwork[fwidth-1]; f >= fwork && adj > 0; --adj, --f)
- {
- --fwidth;
- char ch = *f;
- *f = 0;
- if (ch > '5') // properly round: unavoidable propagation
- {
- int carry = 1;
- for (char* p = f - 1; p >= fwork && carry; --p)
- {
- ++*p;
- if (*p > '9')
- *p = '0';
- else
- carry = 0;
- }
- if (carry)
- {
- for (p = iworkend - 1; p >= iw && carry; --p)
- {
- ++*p;
- if (*p > '9')
- *p = '0';
- else
- carry = 0;
- }
- if (carry)
- {
- *--iw = '1';
- ++iwidth;
- --adj;
- }
- }
- }
- }
- }
- }
-
- }
- else // e-fmt
- {
-
- // normalize
- int exp = 0;
- while (fpnum >= 10.0)
- {
- fpnum *= 0.1;
- ++exp;
- }
- double almost_one = 1.0 - rounder;
- while (fpnum > 0.0 && fpnum < almost_one)
- {
- fpnum *= 10.0;
- --exp;
- }
-
- double ipart;
- double fpart = modf(fpnum, &ipart);
-
-
- if (cvt == 'g') // used up one digit for int part...
- {
- --prec;
- powprec /= 10.0;
- rounder = 0.5 / powprec;
- }
-
- // convert fractional part -- almost same as above
- if (fpart >= rounder || cvt != 'g')
- {
- fpart += rounder;
- if (fpart >= 1.0)
- {
- fpart -= 1.0;
- ipart += 1.0;
- if (ipart >= 10.0)
- {
- ++exp;
- ipart /= 10.0;
- fpart /= 10.0;
- }
- }
- double ffpart = fpart;
- double ifpart;
- for (int i = 0; i < prec; ++i)
- {
- ffpart = modf(ffpart * 10.0, &ifpart);
- *fw++ = '0' + int(ifpart);
- ++fwidth;
- }
- if (cvt == 'g') // inhibit trailing zeroes if g-fmt
- {
- for (char* p = fw - 1; p >= fwork && *p == '0'; --p)
- {
- *p = 0;
- --fwidth;
- }
- }
- }
-
-
- // convert exponent
-
- char eneg = exp < 0;
- if (eneg) exp = - exp;
-
- while (exp > 0)
- {
- *--ew = '0' + (exp % 10);
- exp /= 10;
- ++ewidth;
- }
-
- while (ewidth < 2) // ensure at least 2 zeroes
- {
- *--ew = '0';
- ++ewidth;
- }
-
- *--ew = eneg ? '-' : '+';
- *--ew = 'e';
-
- ewidth += 2;
-
- // convert the one-digit integer part
- *--iw = '0' + int(ipart);
- ++iwidth;
-
- }
-
- // arrange everything in returned string
-
- int showdot = cvt != 'g' || fwidth > 0;
-
- int fmtwidth = is_neg + iwidth + showdot + fwidth + ewidth;
-
- int pad = width - fmtwidth;
- if (pad < 0) pad = 0;
-
- char* fmtbase = (char *) _libgxx_fmtq.alloc(fmtwidth + pad + 1);
- char* fmt = fmtbase;
-
- for (int i = 0; i < pad; ++i) *fmt++ = ' ';
-
- if (is_neg) *fmt++ = '-';
-
- for (i = 0; i < iwidth; ++i) *fmt++ = *iw++;
-
- if (showdot)
- {
- *fmt++ = '.';
- fw = fwork;
- for (i = 0; i < fwidth; ++i) *fmt++ = *fw++;
- }
-
- for (i = 0; i < ewidth; ++i) *fmt++ = *ew++;
-
- *fmt = 0;
-
- return fmtbase;
-}
-#endif
diff --git a/contrib/libg++/libg++/src/error.cc b/contrib/libg++/libg++/src/error.cc
deleted file mode 100644
index 7d163d67631e..000000000000
--- a/contrib/libg++/libg++/src/error.cc
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
-Copyright (C) 1990 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <builtin.h>
-
-void default_one_arg_error_handler(const char* msg)
-{
- fputs("Error: ", stderr);
- fputs(msg, stderr);
- fputs("\n", stderr);
- abort();
-}
-
-
-void default_two_arg_error_handler(const char* kind, const char* msg)
-{
- fputs(kind, stderr);
- fputs(" Error: ", stderr);
- fputs(msg, stderr);
- fputs("\n", stderr);
- abort();
-}
-
-two_arg_error_handler_t lib_error_handler = default_two_arg_error_handler;
-
-two_arg_error_handler_t set_lib_error_handler(two_arg_error_handler_t f)
-{
- two_arg_error_handler_t old = lib_error_handler;
- lib_error_handler = f;
- return old;
-}
-
diff --git a/contrib/libg++/libg++/src/fmtq.cc b/contrib/libg++/libg++/src/fmtq.cc
deleted file mode 100644
index 2a01073699be..000000000000
--- a/contrib/libg++/libg++/src/fmtq.cc
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
-Copyright (C) 1990 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <builtin.h>
-#include <AllocRing.h>
-
-// AllocRings are used for output operations
-// We guaranteee that the last _libgxx_maxfmt formats
-// will be intact
-
-static const int _libgxx_maxfmt = 20;
-AllocRing _libgxx_fmtq(_libgxx_maxfmt);
diff --git a/contrib/libg++/libg++/src/gcd.cc b/contrib/libg++/libg++/src/gcd.cc
deleted file mode 100644
index 602b55f87969..000000000000
--- a/contrib/libg++/libg++/src/gcd.cc
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
-Copyright (C) 1990 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <builtin.h>
-
-
-/*
- common functions on built-in types
-*/
-
-long gcd(long x, long y) // euclid's algorithm
-{
- long a = abs(x);
- long b = abs(y);
-
- long tmp;
-
- if (b > a)
- {
- tmp = a; a = b; b = tmp;
- }
- for(;;)
- {
- if (b == 0)
- return a;
- else if (b == 1)
- return b;
- else
- {
- tmp = b;
- b = a % b;
- a = tmp;
- }
- }
-}
diff --git a/contrib/libg++/libg++/src/gen/AVLMap.ccP b/contrib/libg++/libg++/src/gen/AVLMap.ccP
deleted file mode 100644
index 0e2c63542ad6..000000000000
--- a/contrib/libg++/libg++/src/gen/AVLMap.ccP
+++ /dev/null
@@ -1,614 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <stream.h>
-#include "<T>.<C>.AVLMap.h"
-
-
-/*
- constants & inlines for maintaining balance & thread status in tree nodes
-*/
-
-#define AVLBALANCEMASK 3
-#define AVLBALANCED 0
-#define AVLLEFTHEAVY 1
-#define AVLRIGHTHEAVY 2
-
-#define LTHREADBIT 4
-#define RTHREADBIT 8
-
-
-static inline int bf(<T><C>AVLNode* t)
-{
- return t->stat & AVLBALANCEMASK;
-}
-
-static inline void set_bf(<T><C>AVLNode* t, int b)
-{
- t->stat = (t->stat & ~AVLBALANCEMASK) | (b & AVLBALANCEMASK);
-}
-
-
-static inline int rthread(<T><C>AVLNode* t)
-{
- return t->stat & RTHREADBIT;
-}
-
-static inline void set_rthread(<T><C>AVLNode* t, int b)
-{
- if (b)
- t->stat |= RTHREADBIT;
- else
- t->stat &= ~RTHREADBIT;
-}
-
-static inline int lthread(<T><C>AVLNode* t)
-{
- return t->stat & LTHREADBIT;
-}
-
-static inline void set_lthread(<T><C>AVLNode* t, int b)
-{
- if (b)
- t->stat |= LTHREADBIT;
- else
- t->stat &= ~LTHREADBIT;
-}
-
-/*
- traversal primitives
-*/
-
-
-<T><C>AVLNode* <T><C>AVLMap::leftmost()
-{
- <T><C>AVLNode* t = root;
- if (t != 0) while (t->lt != 0) t = t->lt;
- return t;
-}
-
-<T><C>AVLNode* <T><C>AVLMap::rightmost()
-{
- <T><C>AVLNode* t = root;
- if (t != 0) while (t->rt != 0) t = t->rt;
- return t;
-}
-
-<T><C>AVLNode* <T><C>AVLMap::succ(<T><C>AVLNode* t)
-{
- <T><C>AVLNode* r = t->rt;
- if (!rthread(t)) while (!lthread(r)) r = r->lt;
- return r;
-}
-
-<T><C>AVLNode* <T><C>AVLMap::pred(<T><C>AVLNode* t)
-{
- <T><C>AVLNode* l = t->lt;
- if (!lthread(t)) while (!rthread(l)) l = l->rt;
- return l;
-}
-
-
-Pix <T><C>AVLMap::seek(<T&> key)
-{
- <T><C>AVLNode* t = root;
- if (t == 0)
- return 0;
- for (;;)
- {
- int cmp = <T>CMP(key, t->item);
- if (cmp == 0)
- return Pix(t);
- else if (cmp < 0)
- {
- if (lthread(t))
- return 0;
- else
- t = t->lt;
- }
- else if (rthread(t))
- return 0;
- else
- t = t->rt;
- }
-}
-
-
-/*
- The combination of threads and AVL bits make adding & deleting
- interesting, but very awkward.
-
- We use the following statics to avoid passing them around recursively
-*/
-
-static int _need_rebalancing; // to send back balance info from rec. calls
-static <T>* _target_item; // add/del_item target
-static <T><C>AVLNode* _found_node; // returned added/deleted node
-static int _already_found; // for deletion subcases
-
-
-void <T><C>AVLMap:: _add(<T><C>AVLNode*& t)
-{
- int cmp = <T>CMP(*_target_item, t->item);
- if (cmp == 0)
- {
- _found_node = t;
- return;
- }
- else if (cmp < 0)
- {
- if (lthread(t))
- {
- ++count;
- _found_node = new <T><C>AVLNode(*_target_item, def);
- set_lthread(_found_node, 1);
- set_rthread(_found_node, 1);
- _found_node->lt = t->lt;
- _found_node->rt = t;
- t->lt = _found_node;
- set_lthread(t, 0);
- _need_rebalancing = 1;
- }
- else
- _add(t->lt);
- if (_need_rebalancing)
- {
- switch(bf(t))
- {
- case AVLRIGHTHEAVY:
- set_bf(t, AVLBALANCED);
- _need_rebalancing = 0;
- return;
- case AVLBALANCED:
- set_bf(t, AVLLEFTHEAVY);
- return;
- case AVLLEFTHEAVY:
- {
- <T><C>AVLNode* l = t->lt;
- if (bf(l) == AVLLEFTHEAVY)
- {
- if (rthread(l))
- t->lt = l;
- else
- t->lt = l->rt;
- set_lthread(t, rthread(l));
- l->rt = t;
- set_rthread(l, 0);
- set_bf(t, AVLBALANCED);
- set_bf(l, AVLBALANCED);
- t = l;
- _need_rebalancing = 0;
- }
- else
- {
- <T><C>AVLNode* r = l->rt;
- set_rthread(l, lthread(r));
- if (lthread(r))
- l->rt = r;
- else
- l->rt = r->lt;
- r->lt = l;
- set_lthread(r, 0);
- set_lthread(t, rthread(r));
- if (rthread(r))
- t->lt = r;
- else
- t->lt = r->rt;
- r->rt = t;
- set_rthread(r, 0);
- if (bf(r) == AVLLEFTHEAVY)
- set_bf(t, AVLRIGHTHEAVY);
- else
- set_bf(t, AVLBALANCED);
- if (bf(r) == AVLRIGHTHEAVY)
- set_bf(l, AVLLEFTHEAVY);
- else
- set_bf(l, AVLBALANCED);
- set_bf(r, AVLBALANCED);
- t = r;
- _need_rebalancing = 0;
- return;
- }
- }
- }
- }
- }
- else
- {
- if (rthread(t))
- {
- ++count;
- _found_node = new <T><C>AVLNode(*_target_item, def);
- set_rthread(t, 0);
- set_lthread(_found_node, 1);
- set_rthread(_found_node, 1);
- _found_node->lt = t;
- _found_node->rt = t->rt;
- t->rt = _found_node;
- _need_rebalancing = 1;
- }
- else
- _add(t->rt);
- if (_need_rebalancing)
- {
- switch(bf(t))
- {
- case AVLLEFTHEAVY:
- set_bf(t, AVLBALANCED);
- _need_rebalancing = 0;
- return;
- case AVLBALANCED:
- set_bf(t, AVLRIGHTHEAVY);
- return;
- case AVLRIGHTHEAVY:
- {
- <T><C>AVLNode* r = t->rt;
- if (bf(r) == AVLRIGHTHEAVY)
- {
- if (lthread(r))
- t->rt = r;
- else
- t->rt = r->lt;
- set_rthread(t, lthread(r));
- r->lt = t;
- set_lthread(r, 0);
- set_bf(t, AVLBALANCED);
- set_bf(r, AVLBALANCED);
- t = r;
- _need_rebalancing = 0;
- }
- else
- {
- <T><C>AVLNode* l = r->lt;
- set_lthread(r, rthread(l));
- if (rthread(l))
- r->lt = l;
- else
- r->lt = l->rt;
- l->rt = r;
- set_rthread(l, 0);
- set_rthread(t, lthread(l));
- if (lthread(l))
- t->rt = l;
- else
- t->rt = l->lt;
- l->lt = t;
- set_lthread(l, 0);
- if (bf(l) == AVLRIGHTHEAVY)
- set_bf(t, AVLLEFTHEAVY);
- else
- set_bf(t, AVLBALANCED);
- if (bf(l) == AVLLEFTHEAVY)
- set_bf(r, AVLRIGHTHEAVY);
- else
- set_bf(r, AVLBALANCED);
- set_bf(l, AVLBALANCED);
- t = l;
- _need_rebalancing = 0;
- return;
- }
- }
- }
- }
- }
-}
-
-
-<C>& <T><C>AVLMap::operator [] (<T&> item)
-{
- if (root == 0)
- {
- ++count;
- root = new <T><C>AVLNode(item, def);
- set_rthread(root, 1);
- set_lthread(root, 1);
- return root->cont;
- }
- else
- {
- _target_item = &item;
- _need_rebalancing = 0;
- _add(root);
- return _found_node->cont;
- }
-}
-
-
-void <T><C>AVLMap::_del(<T><C>AVLNode* par, <T><C>AVLNode*& t)
-{
- int comp;
- if (_already_found)
- {
- if (rthread(t))
- comp = 0;
- else
- comp = 1;
- }
- else
- comp = <T>CMP(*_target_item, t->item);
- if (comp == 0)
- {
- if (lthread(t) && rthread(t))
- {
- _found_node = t;
- if (t == par->lt)
- {
- set_lthread(par, 1);
- par->lt = t->lt;
- }
- else
- {
- set_rthread(par, 1);
- par->rt = t->rt;
- }
- _need_rebalancing = 1;
- return;
- }
- else if (lthread(t))
- {
- _found_node = t;
- <T><C>AVLNode* s = succ(t);
- if (s != 0 && lthread(s))
- s->lt = t->lt;
- t = t->rt;
- _need_rebalancing = 1;
- return;
- }
- else if (rthread(t))
- {
- _found_node = t;
- <T><C>AVLNode* p = pred(t);
- if (p != 0 && rthread(p))
- p->rt = t->rt;
- t = t->lt;
- _need_rebalancing = 1;
- return;
- }
- else // replace item & find someone deletable
- {
- <T><C>AVLNode* p = pred(t);
- t->item = p->item;
- t->cont = p->cont;
- _already_found = 1;
- comp = -1; // fall through below to left
- }
- }
-
- if (comp < 0)
- {
- if (lthread(t))
- return;
- _del(t, t->lt);
- if (!_need_rebalancing)
- return;
- switch (bf(t))
- {
- case AVLLEFTHEAVY:
- set_bf(t, AVLBALANCED);
- return;
- case AVLBALANCED:
- set_bf(t, AVLRIGHTHEAVY);
- _need_rebalancing = 0;
- return;
- case AVLRIGHTHEAVY:
- {
- <T><C>AVLNode* r = t->rt;
- switch (bf(r))
- {
- case AVLBALANCED:
- if (lthread(r))
- t->rt = r;
- else
- t->rt = r->lt;
- set_rthread(t, lthread(r));
- r->lt = t;
- set_lthread(r, 0);
- set_bf(t, AVLRIGHTHEAVY);
- set_bf(r, AVLLEFTHEAVY);
- _need_rebalancing = 0;
- t = r;
- return;
- case AVLRIGHTHEAVY:
- if (lthread(r))
- t->rt = r;
- else
- t->rt = r->lt;
- set_rthread(t, lthread(r));
- r->lt = t;
- set_lthread(r, 0);
- set_bf(t, AVLBALANCED);
- set_bf(r, AVLBALANCED);
- t = r;
- return;
- case AVLLEFTHEAVY:
- {
- <T><C>AVLNode* l = r->lt;
- set_lthread(r, rthread(l));
- if (rthread(l))
- r->lt = l;
- else
- r->lt = l->rt;
- l->rt = r;
- set_rthread(l, 0);
- set_rthread(t, lthread(l));
- if (lthread(l))
- t->rt = l;
- else
- t->rt = l->lt;
- l->lt = t;
- set_lthread(l, 0);
- if (bf(l) == AVLRIGHTHEAVY)
- set_bf(t, AVLLEFTHEAVY);
- else
- set_bf(t, AVLBALANCED);
- if (bf(l) == AVLLEFTHEAVY)
- set_bf(r, AVLRIGHTHEAVY);
- else
- set_bf(r, AVLBALANCED);
- set_bf(l, AVLBALANCED);
- t = l;
- return;
- }
- }
- }
- }
- }
- else
- {
- if (rthread(t))
- return;
- _del(t, t->rt);
- if (!_need_rebalancing)
- return;
- switch (bf(t))
- {
- case AVLRIGHTHEAVY:
- set_bf(t, AVLBALANCED);
- return;
- case AVLBALANCED:
- set_bf(t, AVLLEFTHEAVY);
- _need_rebalancing = 0;
- return;
- case AVLLEFTHEAVY:
- {
- <T><C>AVLNode* l = t->lt;
- switch (bf(l))
- {
- case AVLBALANCED:
- if (rthread(l))
- t->lt = l;
- else
- t->lt = l->rt;
- set_lthread(t, rthread(l));
- l->rt = t;
- set_rthread(l, 0);
- set_bf(t, AVLLEFTHEAVY);
- set_bf(l, AVLRIGHTHEAVY);
- _need_rebalancing = 0;
- t = l;
- return;
- case AVLLEFTHEAVY:
- if (rthread(l))
- t->lt = l;
- else
- t->lt = l->rt;
- set_lthread(t, rthread(l));
- l->rt = t;
- set_rthread(l, 0);
- set_bf(t, AVLBALANCED);
- set_bf(l, AVLBALANCED);
- t = l;
- return;
- case AVLRIGHTHEAVY:
- {
- <T><C>AVLNode* r = l->rt;
- set_rthread(l, lthread(r));
- if (lthread(r))
- l->rt = r;
- else
- l->rt = r->lt;
- r->lt = l;
- set_lthread(r, 0);
- set_lthread(t, rthread(r));
- if (rthread(r))
- t->lt = r;
- else
- t->lt = r->rt;
- r->rt = t;
- set_rthread(r, 0);
- if (bf(r) == AVLLEFTHEAVY)
- set_bf(t, AVLRIGHTHEAVY);
- else
- set_bf(t, AVLBALANCED);
- if (bf(r) == AVLRIGHTHEAVY)
- set_bf(l, AVLLEFTHEAVY);
- else
- set_bf(l, AVLBALANCED);
- set_bf(r, AVLBALANCED);
- t = r;
- return;
- }
- }
- }
- }
- }
-}
-
-
-
-void <T><C>AVLMap::del(<T&> item)
-{
- if (root == 0) return;
- _need_rebalancing = 0;
- _already_found = 0;
- _found_node = 0;
- _target_item = &item;
- _del(root, root);
- if (_found_node)
- {
- delete(_found_node);
- if (--count == 0)
- root = 0;
- }
-}
-
-void <T><C>AVLMap::_kill(<T><C>AVLNode* t)
-{
- if (t != 0)
- {
- if (!lthread(t)) _kill(t->lt);
- if (!rthread(t)) _kill(t->rt);
- delete t;
- }
-}
-
-
-<T><C>AVLMap::<T><C>AVLMap(<T><C>AVLMap& b) :<T><C>Map(b.def)
-{
- root = 0;
- count = 0;
- for (Pix i = b.first(); i != 0; b.next(i))
- (*this)[b.key(i)] = b.contents(i);
-}
-
-
-int <T><C>AVLMap::OK()
-{
- int v = 1;
- if (root == 0)
- v = count == 0;
- else
- {
- int n = 1;
- <T><C>AVLNode* trail = leftmost();
- <T><C>AVLNode* t = succ(trail);
- while (t != 0)
- {
- ++n;
- v &= <T>CMP(trail->item, t->item) < 0;
- trail = t;
- t = succ(t);
- }
- v &= n == count;
- }
- if (!v) error("invariant failure");
- return v;
-}
diff --git a/contrib/libg++/libg++/src/gen/AVLMap.hP b/contrib/libg++/libg++/src/gen/AVLMap.hP
deleted file mode 100644
index a5c0884be0dc..000000000000
--- a/contrib/libg++/libg++/src/gen/AVLMap.hP
+++ /dev/null
@@ -1,141 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-
-#ifndef _<T><C>AVLMap_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _<T><C>AVLMap_h 1
-
-#include "<T>.<C>.Map.h"
-
-struct <T><C>AVLNode
-{
- <T><C>AVLNode* lt;
- <T><C>AVLNode* rt;
- <T> item;
- <C> cont;
- char stat;
- <T><C>AVLNode(<T&> h, <C&> c,
- <T><C>AVLNode* l=0, <T><C>AVLNode* r=0);
- ~<T><C>AVLNode();
-};
-
-inline <T><C>AVLNode::<T><C>AVLNode(<T&> h, <C&> c,
- <T><C>AVLNode* l, <T><C>AVLNode* r)
- :lt(l), rt(r), item(h), cont(c), stat(0) {}
-
-inline <T><C>AVLNode::~<T><C>AVLNode() {}
-
-typedef <T><C>AVLNode* <T><C>AVLNodePtr;
-
-
-class <T><C>AVLMap : public <T><C>Map
-{
-protected:
- <T><C>AVLNode* root;
-
- <T><C>AVLNode* leftmost();
- <T><C>AVLNode* rightmost();
- <T><C>AVLNode* pred(<T><C>AVLNode* t);
- <T><C>AVLNode* succ(<T><C>AVLNode* t);
- void _kill(<T><C>AVLNode* t);
- void _add(<T><C>AVLNode*& t);
- void _del(<T><C>AVLNode* p, <T><C>AVLNode*& t);
-
-public:
- <T><C>AVLMap(<C&> dflt);
- <T><C>AVLMap(<T><C>AVLMap& a);
- inline ~<T><C>AVLMap();
-
- <C>& operator [] (<T&> key);
-
- void del(<T&> key);
-
- inline Pix first();
- inline void next(Pix& i);
- inline <T>& key(Pix i);
- inline <C>& contents(Pix i);
-
- Pix seek(<T&> key);
- inline int contains(<T&> key);
-
- inline void clear();
-
- Pix last();
- void prev(Pix& i);
-
- int OK();
-};
-
-inline <T><C>AVLMap::~<T><C>AVLMap()
-{
- _kill(root);
-}
-
-inline <T><C>AVLMap::<T><C>AVLMap(<C&> dflt) :<T><C>Map(dflt)
-{
- root = 0;
-}
-
-inline Pix <T><C>AVLMap::first()
-{
- return Pix(leftmost());
-}
-
-inline Pix <T><C>AVLMap::last()
-{
- return Pix(rightmost());
-}
-
-inline void <T><C>AVLMap::next(Pix& i)
-{
- if (i != 0) i = Pix(succ((<T><C>AVLNode*)i));
-}
-
-inline void <T><C>AVLMap::prev(Pix& i)
-{
- if (i != 0) i = Pix(pred((<T><C>AVLNode*)i));
-}
-
-inline <T>& <T><C>AVLMap::key(Pix i)
-{
- if (i == 0) error("null Pix");
- return ((<T><C>AVLNode*)i)->item;
-}
-
-inline <C>& <T><C>AVLMap::contents(Pix i)
-{
- if (i == 0) error("null Pix");
- return ((<T><C>AVLNode*)i)->cont;
-}
-
-inline void <T><C>AVLMap::clear()
-{
- _kill(root);
- count = 0;
- root = 0;
-}
-
-inline int <T><C>AVLMap::contains(<T&> key)
-{
- return seek(key) != 0;
-}
-
-#endif
diff --git a/contrib/libg++/libg++/src/gen/AVLSet.ccP b/contrib/libg++/libg++/src/gen/AVLSet.ccP
deleted file mode 100644
index 98c07d189149..000000000000
--- a/contrib/libg++/libg++/src/gen/AVLSet.ccP
+++ /dev/null
@@ -1,892 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <stream.h>
-#include "<T>.AVLSet.h"
-#include <stdlib.h>
-
-
-/*
- constants & inlines for maintaining balance & thread status in tree nodes
-*/
-
-#define AVLBALANCEMASK 3
-#define AVLBALANCED 0
-#define AVLLEFTHEAVY 1
-#define AVLRIGHTHEAVY 2
-
-#define LTHREADBIT 4
-#define RTHREADBIT 8
-
-
-static inline int bf(<T>AVLNode* t)
-{
- return t->stat & AVLBALANCEMASK;
-}
-
-static inline void set_bf(<T>AVLNode* t, int b)
-{
- t->stat = (t->stat & ~AVLBALANCEMASK) | (b & AVLBALANCEMASK);
-}
-
-
-static inline int rthread(<T>AVLNode* t)
-{
- return t->stat & RTHREADBIT;
-}
-
-static inline void set_rthread(<T>AVLNode* t, int b)
-{
- if (b)
- t->stat |= RTHREADBIT;
- else
- t->stat &= ~RTHREADBIT;
-}
-
-static inline int lthread(<T>AVLNode* t)
-{
- return t->stat & LTHREADBIT;
-}
-
-static inline void set_lthread(<T>AVLNode* t, int b)
-{
- if (b)
- t->stat |= LTHREADBIT;
- else
- t->stat &= ~LTHREADBIT;
-}
-
-/*
- traversal primitives
-*/
-
-
-<T>AVLNode* <T>AVLSet::leftmost()
-{
- <T>AVLNode* t = root;
- if (t != 0) while (t->lt != 0) t = t->lt;
- return t;
-}
-
-<T>AVLNode* <T>AVLSet::rightmost()
-{
- <T>AVLNode* t = root;
- if (t != 0) while (t->rt != 0) t = t->rt;
- return t;
-}
-
-<T>AVLNode* <T>AVLSet::succ(<T>AVLNode* t)
-{
- <T>AVLNode* r = t->rt;
- if (!rthread(t)) while (!lthread(r)) r = r->lt;
- return r;
-}
-
-<T>AVLNode* <T>AVLSet::pred(<T>AVLNode* t)
-{
- <T>AVLNode* l = t->lt;
- if (!lthread(t)) while (!rthread(l)) l = l->rt;
- return l;
-}
-
-
-Pix <T>AVLSet::seek(<T&> key)
-{
- <T>AVLNode* t = root;
- if (t == 0)
- return 0;
- for (;;)
- {
- int cmp = <T>CMP(key, t->item);
- if (cmp == 0)
- return Pix(t);
- else if (cmp < 0)
- {
- if (lthread(t))
- return 0;
- else
- t = t->lt;
- }
- else if (rthread(t))
- return 0;
- else
- t = t->rt;
- }
-}
-
-
-/*
- The combination of threads and AVL bits make adding & deleting
- interesting, but very awkward.
-
- We use the following statics to avoid passing them around recursively
-*/
-
-static int _need_rebalancing; // to send back balance info from rec. calls
-static <T>* _target_item; // add/del_item target
-static <T>AVLNode* _found_node; // returned added/deleted node
-static int _already_found; // for deletion subcases
-
-static <T>AVLNode** _hold_nodes; // used for rebuilding trees
-static int _max_hold_index; // # elements-1 in _hold_nodes
-
-
-void <T>AVLSet:: _add(<T>AVLNode*& t)
-{
- int cmp = <T>CMP(*_target_item, t->item);
- if (cmp == 0)
- {
- _found_node = t;
- return;
- }
- else if (cmp < 0)
- {
- if (lthread(t))
- {
- ++count;
- _found_node = new <T>AVLNode(*_target_item);
- set_lthread(_found_node, 1);
- set_rthread(_found_node, 1);
- _found_node->lt = t->lt;
- _found_node->rt = t;
- t->lt = _found_node;
- set_lthread(t, 0);
- _need_rebalancing = 1;
- }
- else
- _add(t->lt);
- if (_need_rebalancing)
- {
- switch(bf(t))
- {
- case AVLRIGHTHEAVY:
- set_bf(t, AVLBALANCED);
- _need_rebalancing = 0;
- return;
- case AVLBALANCED:
- set_bf(t, AVLLEFTHEAVY);
- return;
- case AVLLEFTHEAVY:
- {
- <T>AVLNode* l = t->lt;
- if (bf(l) == AVLLEFTHEAVY)
- {
- if (rthread(l))
- t->lt = l;
- else
- t->lt = l->rt;
- set_lthread(t, rthread(l));
- l->rt = t;
- set_rthread(l, 0);
- set_bf(t, AVLBALANCED);
- set_bf(l, AVLBALANCED);
- t = l;
- _need_rebalancing = 0;
- }
- else
- {
- <T>AVLNode* r = l->rt;
- set_rthread(l, lthread(r));
- if (lthread(r))
- l->rt = r;
- else
- l->rt = r->lt;
- r->lt = l;
- set_lthread(r, 0);
- set_lthread(t, rthread(r));
- if (rthread(r))
- t->lt = r;
- else
- t->lt = r->rt;
- r->rt = t;
- set_rthread(r, 0);
- if (bf(r) == AVLLEFTHEAVY)
- set_bf(t, AVLRIGHTHEAVY);
- else
- set_bf(t, AVLBALANCED);
- if (bf(r) == AVLRIGHTHEAVY)
- set_bf(l, AVLLEFTHEAVY);
- else
- set_bf(l, AVLBALANCED);
- set_bf(r, AVLBALANCED);
- t = r;
- _need_rebalancing = 0;
- return;
- }
- }
- }
- }
- }
- else
- {
- if (rthread(t))
- {
- ++count;
- _found_node = new <T>AVLNode(*_target_item);
- set_rthread(t, 0);
- set_lthread(_found_node, 1);
- set_rthread(_found_node, 1);
- _found_node->lt = t;
- _found_node->rt = t->rt;
- t->rt = _found_node;
- _need_rebalancing = 1;
- }
- else
- _add(t->rt);
- if (_need_rebalancing)
- {
- switch(bf(t))
- {
- case AVLLEFTHEAVY:
- set_bf(t, AVLBALANCED);
- _need_rebalancing = 0;
- return;
- case AVLBALANCED:
- set_bf(t, AVLRIGHTHEAVY);
- return;
- case AVLRIGHTHEAVY:
- {
- <T>AVLNode* r = t->rt;
- if (bf(r) == AVLRIGHTHEAVY)
- {
- if (lthread(r))
- t->rt = r;
- else
- t->rt = r->lt;
- set_rthread(t, lthread(r));
- r->lt = t;
- set_lthread(r, 0);
- set_bf(t, AVLBALANCED);
- set_bf(r, AVLBALANCED);
- t = r;
- _need_rebalancing = 0;
- }
- else
- {
- <T>AVLNode* l = r->lt;
- set_lthread(r, rthread(l));
- if (rthread(l))
- r->lt = l;
- else
- r->lt = l->rt;
- l->rt = r;
- set_rthread(l, 0);
- set_rthread(t, lthread(l));
- if (lthread(l))
- t->rt = l;
- else
- t->rt = l->lt;
- l->lt = t;
- set_lthread(l, 0);
- if (bf(l) == AVLRIGHTHEAVY)
- set_bf(t, AVLLEFTHEAVY);
- else
- set_bf(t, AVLBALANCED);
- if (bf(l) == AVLLEFTHEAVY)
- set_bf(r, AVLRIGHTHEAVY);
- else
- set_bf(r, AVLBALANCED);
- set_bf(l, AVLBALANCED);
- t = l;
- _need_rebalancing = 0;
- return;
- }
- }
- }
- }
- }
-}
-
-
-Pix <T>AVLSet::add(<T&> item)
-{
- if (root == 0)
- {
- ++count;
- root = new <T>AVLNode(item);
- set_rthread(root, 1);
- set_lthread(root, 1);
- return Pix(root);
- }
- else
- {
- _target_item = &item;
- _need_rebalancing = 0;
- _add(root);
- return Pix(_found_node);
- }
-}
-
-
-void <T>AVLSet::_del(<T>AVLNode* par, <T>AVLNode*& t)
-{
- int comp;
- if (_already_found)
- {
- if (rthread(t))
- comp = 0;
- else
- comp = 1;
- }
- else
- comp = <T>CMP(*_target_item, t->item);
- if (comp == 0)
- {
- if (lthread(t) && rthread(t))
- {
- _found_node = t;
- if (t == par->lt)
- {
- set_lthread(par, 1);
- par->lt = t->lt;
- }
- else
- {
- set_rthread(par, 1);
- par->rt = t->rt;
- }
- _need_rebalancing = 1;
- return;
- }
- else if (lthread(t))
- {
- _found_node = t;
- <T>AVLNode* s = succ(t);
- if (s != 0 && lthread(s))
- s->lt = t->lt;
- t = t->rt;
- _need_rebalancing = 1;
- return;
- }
- else if (rthread(t))
- {
- _found_node = t;
- <T>AVLNode* p = pred(t);
- if (p != 0 && rthread(p))
- p->rt = t->rt;
- t = t->lt;
- _need_rebalancing = 1;
- return;
- }
- else // replace item & find someone deletable
- {
- <T>AVLNode* p = pred(t);
- t->item = p->item;
- _already_found = 1;
- comp = -1; // fall through below to left
- }
- }
-
- if (comp < 0)
- {
- if (lthread(t))
- return;
- _del(t, t->lt);
- if (!_need_rebalancing)
- return;
- switch (bf(t))
- {
- case AVLLEFTHEAVY:
- set_bf(t, AVLBALANCED);
- return;
- case AVLBALANCED:
- set_bf(t, AVLRIGHTHEAVY);
- _need_rebalancing = 0;
- return;
- case AVLRIGHTHEAVY:
- {
- <T>AVLNode* r = t->rt;
- switch (bf(r))
- {
- case AVLBALANCED:
- if (lthread(r))
- t->rt = r;
- else
- t->rt = r->lt;
- set_rthread(t, lthread(r));
- r->lt = t;
- set_lthread(r, 0);
- set_bf(t, AVLRIGHTHEAVY);
- set_bf(r, AVLLEFTHEAVY);
- _need_rebalancing = 0;
- t = r;
- return;
- case AVLRIGHTHEAVY:
- if (lthread(r))
- t->rt = r;
- else
- t->rt = r->lt;
- set_rthread(t, lthread(r));
- r->lt = t;
- set_lthread(r, 0);
- set_bf(t, AVLBALANCED);
- set_bf(r, AVLBALANCED);
- t = r;
- return;
- case AVLLEFTHEAVY:
- {
- <T>AVLNode* l = r->lt;
- set_lthread(r, rthread(l));
- if (rthread(l))
- r->lt = l;
- else
- r->lt = l->rt;
- l->rt = r;
- set_rthread(l, 0);
- set_rthread(t, lthread(l));
- if (lthread(l))
- t->rt = l;
- else
- t->rt = l->lt;
- l->lt = t;
- set_lthread(l, 0);
- if (bf(l) == AVLRIGHTHEAVY)
- set_bf(t, AVLLEFTHEAVY);
- else
- set_bf(t, AVLBALANCED);
- if (bf(l) == AVLLEFTHEAVY)
- set_bf(r, AVLRIGHTHEAVY);
- else
- set_bf(r, AVLBALANCED);
- set_bf(l, AVLBALANCED);
- t = l;
- return;
- }
- }
- }
- }
- }
- else
- {
- if (rthread(t))
- return;
- _del(t, t->rt);
- if (!_need_rebalancing)
- return;
- switch (bf(t))
- {
- case AVLRIGHTHEAVY:
- set_bf(t, AVLBALANCED);
- return;
- case AVLBALANCED:
- set_bf(t, AVLLEFTHEAVY);
- _need_rebalancing = 0;
- return;
- case AVLLEFTHEAVY:
- {
- <T>AVLNode* l = t->lt;
- switch (bf(l))
- {
- case AVLBALANCED:
- if (rthread(l))
- t->lt = l;
- else
- t->lt = l->rt;
- set_lthread(t, rthread(l));
- l->rt = t;
- set_rthread(l, 0);
- set_bf(t, AVLLEFTHEAVY);
- set_bf(l, AVLRIGHTHEAVY);
- _need_rebalancing = 0;
- t = l;
- return;
- case AVLLEFTHEAVY:
- if (rthread(l))
- t->lt = l;
- else
- t->lt = l->rt;
- set_lthread(t, rthread(l));
- l->rt = t;
- set_rthread(l, 0);
- set_bf(t, AVLBALANCED);
- set_bf(l, AVLBALANCED);
- t = l;
- return;
- case AVLRIGHTHEAVY:
- {
- <T>AVLNode* r = l->rt;
- set_rthread(l, lthread(r));
- if (lthread(r))
- l->rt = r;
- else
- l->rt = r->lt;
- r->lt = l;
- set_lthread(r, 0);
- set_lthread(t, rthread(r));
- if (rthread(r))
- t->lt = r;
- else
- t->lt = r->rt;
- r->rt = t;
- set_rthread(r, 0);
- if (bf(r) == AVLLEFTHEAVY)
- set_bf(t, AVLRIGHTHEAVY);
- else
- set_bf(t, AVLBALANCED);
- if (bf(r) == AVLRIGHTHEAVY)
- set_bf(l, AVLLEFTHEAVY);
- else
- set_bf(l, AVLBALANCED);
- set_bf(r, AVLBALANCED);
- t = r;
- return;
- }
- }
- }
- }
- }
-}
-
-
-
-void <T>AVLSet::del(<T&> item)
-{
- if (root == 0) return;
- _need_rebalancing = 0;
- _already_found = 0;
- _found_node = 0;
- _target_item = &item;
- _del(root, root);
- if (_found_node)
- {
- delete(_found_node);
- if (--count == 0)
- root = 0;
- }
-}
-
-// build an ordered array of pointers to tree nodes back into a tree
-// we know that at least one element exists
-
-static <T>AVLNode* _do_treeify(int lo, int hi, int& h)
-{
- int lh, rh;
- int mid = (lo + hi) / 2;
- <T>AVLNode* t = _hold_nodes[mid];
- if (lo > mid - 1)
- {
- set_lthread(t, 1);
- if (mid == 0)
- t->lt = 0;
- else
- t->lt = _hold_nodes[mid-1];
- lh = 0;
- }
- else
- {
- set_lthread(t, 0);
- t->lt = _do_treeify(lo, mid-1, lh);
- }
- if (hi < mid + 1)
- {
- set_rthread(t, 1);
- if (mid == _max_hold_index)
- t->rt = 0;
- else
- t->rt = _hold_nodes[mid+1];
- rh = 0;
- }
- else
- {
- set_rthread(t, 0);
- t->rt = _do_treeify(mid+1, hi, rh);
- }
- if (lh == rh)
- {
- set_bf(t, AVLBALANCED);
- h = lh + 1;
- }
- else if (lh == rh - 1)
- {
- set_bf(t, AVLRIGHTHEAVY);
- h = rh + 1;
- }
- else if (rh == lh - 1)
- {
- set_bf(t, AVLLEFTHEAVY);
- h = lh + 1;
- }
- else // can't happen
- abort();
-
- return t;
-}
-
-static <T>AVLNode* _treeify(int n)
-{
- <T>AVLNode* t;
- if (n == 0)
- t = 0;
- else
- {
- int b;
- _max_hold_index = n-1;
- t = _do_treeify(0, _max_hold_index, b);
- }
- delete _hold_nodes;
- return t;
-}
-
-
-void <T>AVLSet::_kill(<T>AVLNode* t)
-{
- if (t != 0)
- {
- if (!lthread(t)) _kill(t->lt);
- if (!rthread(t)) _kill(t->rt);
- delete t;
- }
-}
-
-
-<T>AVLSet::<T>AVLSet(<T>AVLSet& b)
-{
- if ((count = b.count) == 0)
- {
- root = 0;
- }
- else
- {
- _hold_nodes = new <T>AVLNodePtr [count];
- <T>AVLNode* t = b.leftmost();
- int i = 0;
- while (t != 0)
- {
- _hold_nodes[i++] = new <T>AVLNode(t->item);
- t = b.succ(t);
- }
- root = _treeify(count);
- }
-}
-
-
-int <T>AVLSet::operator == (<T>AVLSet& y)
-{
- if (count != y.count)
- return 0;
- else
- {
- <T>AVLNode* t = leftmost();
- <T>AVLNode* u = y.leftmost();
- for (;;)
- {
- if (t == 0)
- return 1;
- else if (!(<T>EQ(t->item, u->item)))
- return 0;
- else
- {
- t = succ(t);
- u = y.succ(u);
- }
- }
- }
-}
-
-int <T>AVLSet::operator <= (<T>AVLSet& y)
-{
- if (count > y.count)
- return 0;
- else
- {
- <T>AVLNode* t = leftmost();
- <T>AVLNode* u = y.leftmost();
- for (;;)
- {
- if (t == 0)
- return 1;
- else if (u == 0)
- return 0;
- int cmp = <T>CMP(t->item, u->item);
- if (cmp == 0)
- {
- t = succ(t);
- u = y.succ(u);
- }
- else if (cmp < 0)
- return 0;
- else
- u = y.succ(u);
- }
- }
-}
-
-void <T>AVLSet::operator |=(<T>AVLSet& y)
-{
- <T>AVLNode* t = leftmost();
- <T>AVLNode* u = y.leftmost();
- int rsize = count + y.count;
- _hold_nodes = new <T>AVLNodePtr [rsize];
- int k = 0;
- for (;;)
- {
- if (t == 0)
- {
- while (u != 0)
- {
- _hold_nodes[k++] = new <T>AVLNode(u->item);
- u = y.succ(u);
- }
- break;
- }
- else if (u == 0)
- {
- while (t != 0)
- {
- _hold_nodes[k++] = t;
- t = succ(t);
- }
- break;
- }
- int cmp = <T>CMP(t->item, u->item);
- if (cmp == 0)
- {
- _hold_nodes[k++] = t;
- t = succ(t);
- u = y.succ(u);
- }
- else if (cmp < 0)
- {
- _hold_nodes[k++] = t;
- t = succ(t);
- }
- else
- {
- _hold_nodes[k++] = new <T>AVLNode(u->item);
- u = y.succ(u);
- }
- }
- root = _treeify(k);
- count = k;
-}
-
-void <T>AVLSet::operator &= (<T>AVLSet& y)
-{
- <T>AVLNode* t = leftmost();
- <T>AVLNode* u = y.leftmost();
- int rsize = (count < y.count)? count : y.count;
- _hold_nodes = new <T>AVLNodePtr [rsize];
- int k = 0;
- for (;;)
- {
- if (t == 0)
- break;
- if (u == 0)
- {
- while (t != 0)
- {
- <T>AVLNode* tmp = succ(t);
- delete t;
- t = tmp;
- }
- break;
- }
- int cmp = <T>CMP(t->item, u->item);
- if (cmp == 0)
- {
- _hold_nodes[k++] = t;
- t = succ(t);
- u = y.succ(u);
- }
- else if (cmp < 0)
- {
- <T>AVLNode* tmp = succ(t);
- delete t;
- t = tmp;
- }
- else
- u = y.succ(u);
- }
- root = _treeify(k);
- count = k;
-}
-
-
-void <T>AVLSet::operator -=(<T>AVLSet& y)
-{
- <T>AVLNode* t = leftmost();
- <T>AVLNode* u = y.leftmost();
- int rsize = count;
- _hold_nodes = new <T>AVLNodePtr [rsize];
- int k = 0;
- for (;;)
- {
- if (t == 0)
- break;
- else if (u == 0)
- {
- while (t != 0)
- {
- _hold_nodes[k++] = t;
- t = succ(t);
- }
- break;
- }
- int cmp = <T>CMP(t->item, u->item);
- if (cmp == 0)
- {
- <T>AVLNode* tmp = succ(t);
- delete t;
- t = tmp;
- u = y.succ(u);
- }
- else if (cmp < 0)
- {
- _hold_nodes[k++] = t;
- t = succ(t);
- }
- else
- u = y.succ(u);
- }
- root = _treeify(k);
- count = k;
-}
-
-int <T>AVLSet::owns(Pix i)
-{
- if (i == 0) return 0;
- for (<T>AVLNode* t = leftmost(); t != 0; t = succ(t))
- if (Pix(t) == i) return 1;
- return 0;
-}
-
-int <T>AVLSet::OK()
-{
- int v = 1;
- if (root == 0)
- v = count == 0;
- else
- {
- int n = 1;
- <T>AVLNode* trail = leftmost();
- <T>AVLNode* t = succ(trail);
- while (t != 0)
- {
- ++n;
- v &= <T>CMP(trail->item, t->item) < 0;
- trail = t;
- t = succ(t);
- }
- v &= n == count;
- }
- if (!v) error("invariant failure");
- return v;
-}
diff --git a/contrib/libg++/libg++/src/gen/AVLSet.hP b/contrib/libg++/libg++/src/gen/AVLSet.hP
deleted file mode 100644
index c1aa8fad6ac2..000000000000
--- a/contrib/libg++/libg++/src/gen/AVLSet.hP
+++ /dev/null
@@ -1,152 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-
-#ifndef _<T>AVL_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _<T>AVL_h 1
-
-#include "<T>.Set.h"
-
-struct <T>AVLNode
-{
- <T>AVLNode* lt;
- <T>AVLNode* rt;
- <T> item;
- char stat;
- <T>AVLNode(<T&> h, <T>AVLNode* l=0, <T>AVLNode* r=0);
- ~<T>AVLNode();
-};
-
-inline <T>AVLNode::<T>AVLNode(<T&> h, <T>AVLNode* l, <T>AVLNode* r)
-:lt(l), rt(r), item(h), stat(0) {}
-
-inline <T>AVLNode::~<T>AVLNode() {}
-
-typedef <T>AVLNode* <T>AVLNodePtr;
-
-
-class <T>AVLSet : public <T>Set
-{
-protected:
- <T>AVLNode* root;
-
- <T>AVLSet(<T>AVLNode* p, int l);
-
- <T>AVLNode* leftmost();
- <T>AVLNode* rightmost();
- <T>AVLNode* pred(<T>AVLNode* t);
- <T>AVLNode* succ(<T>AVLNode* t);
- void _kill(<T>AVLNode* t);
- void _add(<T>AVLNode*& t);
- void _del(<T>AVLNode* p, <T>AVLNode*& t);
-
-public:
- <T>AVLSet();
- <T>AVLSet(<T>AVLSet& a);
- inline ~<T>AVLSet();
-
- Pix add(<T&> item);
- void del(<T&> item);
- inline int contains(<T&> item);
-
- inline void clear();
-
- inline Pix first();
- inline void next(Pix& i);
- inline <T>& operator () (Pix i);
- int owns(Pix i);
- Pix seek(<T&> item);
-
- Pix last();
- void prev(Pix& i);
-
- void operator |= (<T>AVLSet& b);
- void operator -= (<T>AVLSet& b);
- void operator &= (<T>AVLSet& b);
-
- int operator == (<T>AVLSet& b);
- int operator != (<T>AVLSet& b);
- int operator <= (<T>AVLSet& b);
-
- int OK();
-};
-
-inline <T>AVLSet::~<T>AVLSet()
-{
- _kill(root);
-}
-
-inline <T>AVLSet::<T>AVLSet()
-{
- root = 0;
- count = 0;
-}
-
-inline <T>AVLSet::<T>AVLSet(<T>AVLNode* p, int l)
-{
- root = p;
- count = l;
-}
-
-inline int <T>AVLSet::operator != (<T>AVLSet& b)
-{
- return ! ((*this) == b);
-}
-
-inline Pix <T>AVLSet::first()
-{
- return Pix(leftmost());
-}
-
-inline Pix <T>AVLSet::last()
-{
- return Pix(rightmost());
-}
-
-inline void <T>AVLSet::next(Pix& i)
-{
- if (i != 0) i = Pix(succ((<T>AVLNode*)i));
-}
-
-inline void <T>AVLSet::prev(Pix& i)
-{
- if (i != 0) i = Pix(pred((<T>AVLNode*)i));
-}
-
-inline <T>& <T>AVLSet::operator () (Pix i)
-{
- if (i == 0) error("null Pix");
- return ((<T>AVLNode*)i)->item;
-}
-
-inline void <T>AVLSet::clear()
-{
- _kill(root);
- count = 0;
- root = 0;
-}
-
-inline int <T>AVLSet::contains(<T&> key)
-{
- return seek(key) != 0;
-}
-
-#endif
diff --git a/contrib/libg++/libg++/src/gen/AVec.ccP b/contrib/libg++/libg++/src/gen/AVec.ccP
deleted file mode 100644
index 57a92708d9f2..000000000000
--- a/contrib/libg++/libg++/src/gen/AVec.ccP
+++ /dev/null
@@ -1,397 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <stream.h>
-#include <builtin.h>
-#include "<T>.AVec.h"
-
-/*
- The following brought to you by the department of redundancy department
-*/
-
-<T>AVec& <T>AVec::operator = (const <T>AVec& v)
-{
- if (len != 0 && len != v.capacity())
- error("nonconformant vectors.");
- if (len == 0)
- s = new <T> [len = v.capacity()];
- if (s != v.vec())
- {
- for (int i = 0; i < len; ++i)
- s[i] = v.vec()[i];
- }
- return *this;
-}
-
-<T>AVec& <T>AVec::operator = (<T&> f)
-{
- for (int i = 0; i < len; ++i) s[i] = f;
- return *this;
-}
-
-
-<T>AVec concat(<T>AVec & a, <T>AVec & b)
-{
- int newl = a.capacity() + b.capacity();
- <T>* news = new <T> [newl];
- <T>* p = news;
- <T>* top = &(a.vec()[a.capacity()]);
- <T>* t = a.vec();
- while (t < top) *p++ = *t++;
- top = &(b.vec()[b.capacity()]);
- t = b.vec();
- while (t < top) *p++ = *t++;
- return <T>AVec(newl, news);
-}
-
-
-<T>AVec combine(<T>Combiner f, <T>AVec& a, <T>AVec& b)
-{
- int newl = (a.capacity() < b.capacity())? a.capacity() : b.capacity();
- <T>* news = new <T> [newl];
- <T>* p = news;
- <T>* top = &(a.vec()[newl]);
- <T>* t = a.vec();
- <T>* u = b.vec();
- while (t < top) *p++ = (*f)(*t++, *u++);
- return <T>AVec(newl, news);
-}
-
-<T>AVec reverse(<T>AVec& a)
-{
- <T>* news = new <T> [a.capacity()];
- if (a.capacity() != 0)
- {
- <T>* lo = news;
- <T>* hi = &(news[a.capacity() - 1]);
- while (lo < hi)
- {
- <T> tmp = *lo;
- *lo++ = *hi;
- *hi-- = tmp;
- }
- }
- return <T>AVec(a.capacity(), news);
-}
-
-<T>AVec map(<T>Mapper f, <T>AVec& a)
-{
- <T>* news = new <T> [a.capacity()];
- <T>* p = news;
- <T>* top = &(a.vec()[a.capacity()]);
- <T>* t = a.vec();
- while(t < top) *p++ = (*f)(*t++);
- return <T>AVec(a.capacity(), news);
-}
-
-<T>AVec <T>AVec::at(int from, int n)
-{
- int to;
- if (n < 0)
- {
- n = len - from;
- to = len - 1;
- }
- else
- to = from + n - 1;
- if ((unsigned)from > (unsigned)to)
- range_error();
- <T>* news = new <T> [n];
- <T>* p = news;
- <T>* t = &(s[from]);
- <T>* top = &(s[to]);
- while (t <= top) *p++ = *t++;
- return <T>AVec(n, news);
-}
-
-<T>AVec merge(<T>AVec & a, <T>AVec & b, <T>Comparator f)
-{
- int newl = a.capacity() + b.capacity();
- <T>* news = new <T> [newl];
- <T>* p = news;
- <T>* topa = &(a.vec()[a.capacity()]);
- <T>* as = a.vec();
- <T>* topb = &(b.vec()[b.capacity()]);
- <T>* bs = b.vec();
-
- for (;;)
- {
- if (as >= topa)
- {
- while (bs < topb) *p++ = *bs++;
- break;
- }
- else if (bs >= topb)
- {
- while (as < topa) *p++ = *as++;
- break;
- }
- else if ((*f)(*as, *bs) <= 0)
- *p++ = *as++;
- else
- *p++ = *bs++;
- }
- return <T>AVec(newl, news);
-}
-
-<T>AVec operator + (<T>AVec& a, <T>AVec& b)
-{
- a.check_len(b.capacity());
- <T>* news = new <T> [a.capacity()];
- <T>* p = news;
- <T>* top = &(a.vec()[a.capacity()]);
- <T>* t = a.vec();
- <T>* u = b.vec();
- while (t < top) *p++ = *t++ + *u++;
- return <T>AVec(a.capacity(), news);
-}
-
-<T>AVec operator - (<T>AVec& a, <T>AVec& b)
-{
- a.check_len(b.capacity());
- <T>* news = new <T> [a.capacity()];
- <T>* p = news;
- <T>* top = &(a.vec()[a.capacity()]);
- <T>* t = a.vec();
- <T>* u = b.vec();
- while (t < top) *p++ = *t++ - *u++;
- return <T>AVec(a.capacity(), news);
-}
-
-<T>AVec product (<T>AVec& a, <T>AVec& b)
-{
- a.check_len(b.capacity());
- <T>* news = new <T> [a.capacity()];
- <T>* p = news;
- <T>* top = &(a.vec()[a.capacity()]);
- <T>* t = a.vec();
- <T>* u = b.vec();
- while (t < top) *p++ = *t++ * *u++;
- return <T>AVec(a.capacity(), news);
-}
-
-<T>AVec quotient(<T>AVec& a, <T>AVec& b)
-{
- a.check_len(b.capacity());
- <T>* news = new <T> [a.capacity()];
- <T>* p = news;
- <T>* top = &(a.vec()[a.capacity()]);
- <T>* t = a.vec();
- <T>* u = b.vec();
- while (t < top) *p++ = *t++ / *u++;
- return <T>AVec(a.capacity(), news);
-}
-
-<T>AVec operator + (<T>AVec& a, <T&> b)
-{
- <T>* news = new <T> [a.capacity()];
- <T>* p = news;
- <T>* top = &(a.vec()[a.capacity()]);
- <T>* t = a.vec();
- while (t < top) *p++ = *t++ + b;
- return <T>AVec(a.capacity(), news);
-}
-
-<T>AVec operator - (<T>AVec& a, <T&> b)
-{
- <T>* news = new <T> [a.capacity()];
- <T>* p = news;
- <T>* top = &(a.vec()[a.capacity()]);
- <T>* t = a.vec();
- while (t < top) *p++ = *t++ - b;
- return <T>AVec(a.capacity(), news);
-}
-
-<T>AVec operator * (<T>AVec& a, <T&> b)
-{
- <T>* news = new <T> [a.capacity()];
- <T>* p = news;
- <T>* top = &(a.vec()[a.capacity()]);
- <T>* t = a.vec();
- while (t < top) *p++ = *t++ * b;
- return <T>AVec(a.capacity(), news);
-}
-
-<T>AVec operator / (<T>AVec& a, <T&> b)
-{
- <T>* news = new <T> [a.capacity()];
- <T>* p = news;
- <T>* top = &(a.vec()[a.capacity()]);
- <T>* t = a.vec();
- while (t < top) *p++ = *t++ / b;
- return <T>AVec(a.capacity(), news);
-}
-
-<T>AVec <T>AVec::operator - ()
-{
- <T>* news = new <T> [len];
- <T>* p = news;
- <T>* top = &(s[len]);
- <T>* t = s;
- while (t < top) *p++ = -(*t++);
- return <T>AVec(len, news);
-}
-
-<T>AVec& <T>AVec::operator += (<T>AVec& b)
-{
- check_len(b.capacity());
- <T>* u = b.vec();
- <T>* top = &(s[len]);
- <T>* t = s;
- while (t < top) *t++ += *u++;
- return *this;
-}
-
-<T>AVec& <T>AVec::operator -= (<T>AVec& b)
-{
- check_len(b.capacity());
- <T>* u = b.vec();
- <T>* top = &(s[len]);
- <T>* t = s;
- while (t < top) *t++ -= *u++;
- return *this;
-}
-
-<T>AVec& <T>AVec::product(<T>AVec& b)
-{
- check_len(b.capacity());
- <T>* u = b.vec();
- <T>* top = &(s[len]);
- <T>* t = s;
- while (t < top) *t++ *= *u++;
- return *this;
-}
-
-<T>AVec& <T>AVec::quotient(<T>AVec& b)
-{
- check_len(b.capacity());
- <T>* u = b.vec();
- <T>* top = &(s[len]);
- <T>* t = s;
- while (t < top) *t++ /= *u++;
- return *this;
-}
-
-<T>AVec& <T>AVec::operator += (<T&> b)
-{
- <T>* top = &(s[len]);
- <T>* t = s;
- while (t < top) *t++ += b;
- return *this;
-}
-
-<T>AVec& <T>AVec::operator -= (<T&> b)
-{
- <T>* top = &(s[len]);
- <T>* t = s;
- while (t < top) *t++ -= b;
- return *this;
-}
-
-<T>AVec& <T>AVec::operator *= (<T&> b)
-{
- <T>* top = &(s[len]);
- <T>* t = s;
- while (t < top) *t++ *= b;
- return *this;
-}
-
-<T>AVec& <T>AVec::operator /= (<T&> b)
-{
- <T>* top = &(s[len]);
- <T>* t = s;
- while (t < top) *t++ /= b;
- return *this;
-}
-
-<T> <T>AVec::max()
-{
- if (len == 0)
- return 0;
- <T>* top = &(s[len]);
- <T>* t = s;
- <T> res = *t++;
- for (; t < top; ++t) if (*t > res) res = *t;
- return res;
-}
-
-int <T>AVec::max_index()
-{
- if (len == 0)
- return -1;
- int ind = 0;
- for (int i = 1; i < len; ++i)
- if (s[i] > s[ind])
- ind = i;
- return ind;
-}
-
-<T> <T>AVec::min()
-{
- if (len == 0)
- return 0;
- <T>* top = &(s[len]);
- <T>* t = s;
- <T> res = *t++;
- for (; t < top; ++t) if (*t < res) res = *t;
- return res;
-}
-
-int <T>AVec::min_index()
-{
- if (len == 0)
- return -1;
- int ind = 0;
- for (int i = 1; i < len; ++i)
- if (s[i] < s[ind])
- ind = i;
- return ind;
-}
-
-<T> <T>AVec::sum()
-{
- <T> res = 0;
- <T>* top = &(s[len]);
- <T>* t = s;
- while (t < top) res += *t++;
- return res;
-}
-
-
-<T> <T>AVec::sumsq()
-{
- <T> res = 0;
- <T>* top = &(s[len]);
- <T>* t = s;
- for (; t < top; ++t) res += *t * *t;
- return res;
-}
-
-<T> operator * (<T>AVec& a, <T>AVec& b)
-{
- a.check_len(b.capacity());
- <T>* top = &(a.vec()[a.capacity()]);
- <T>* t = a.vec();
- <T>* u = b.vec();
- <T> res = 0;
- while (t < top) res += *t++ * *u++;
- return res;
-}
diff --git a/contrib/libg++/libg++/src/gen/AVec.hP b/contrib/libg++/libg++/src/gen/AVec.hP
deleted file mode 100644
index c59720e93cc1..000000000000
--- a/contrib/libg++/libg++/src/gen/AVec.hP
+++ /dev/null
@@ -1,118 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-
-#ifndef _<T>AVec_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _<T>AVec_h 1
-
-#include "<T>.Vec.h"
-
-class <T>AVec : public <T>Vec
-{
-protected:
- void check_len(int l);
- <T>* vec();
- const <T>* vec() const;
- <T>AVec(int l, <T>* d);
- public:
- <T>AVec ();
- <T>AVec (int l);
- <T>AVec (int l, <T&> fill_value);
- <T>AVec (<T>AVec&);
- ~<T>AVec ();
-
- <T>AVec& operator = (const <T>AVec& a);
- <T>AVec& operator = (<T&> fill_value);
-
-// vector by scalar -> vector operations
-
- friend <T>AVec operator + (<T>AVec& a, <T&> b);
- friend <T>AVec operator - (<T>AVec& a, <T&> b);
- friend <T>AVec operator * (<T>AVec& a, <T&> b);
- friend <T>AVec operator / (<T>AVec& a, <T&> b);
-
- <T>AVec& operator += (<T&> b);
- <T>AVec& operator -= (<T&> b);
- <T>AVec& operator *= (<T&> b);
- <T>AVec& operator /= (<T&> b);
-
-// vector by vector -> vector operations
-
- friend <T>AVec operator + (<T>AVec& a, <T>AVec& b);
- friend <T>AVec operator - (<T>AVec& a, <T>AVec& b);
- <T>AVec& operator += (<T>AVec& b);
- <T>AVec& operator -= (<T>AVec& b);
-
- <T>AVec operator - ();
-
- friend <T>AVec product(<T>AVec& a, <T>AVec& b);
- <T>AVec& product(<T>AVec& b);
- friend <T>AVec quotient(<T>AVec& a, <T>AVec& b);
- <T>AVec& quotient(<T>AVec& b);
-
-// vector -> scalar operations
-
- friend <T> operator * (<T>AVec& a, <T>AVec& b);
-
- <T> sum();
- <T> min();
- <T> max();
- <T> sumsq();
-
-// indexing
-
- int min_index();
- int max_index();
-
-// redundant but necesssary
- friend <T>AVec concat(<T>AVec& a, <T>AVec& b);
- friend <T>AVec map(<T>Mapper f, <T>AVec& a);
- friend <T>AVec merge(<T>AVec& a, <T>AVec& b, <T>Comparator f);
- friend <T>AVec combine(<T>Combiner f, <T>AVec& a, <T>AVec& b);
- friend <T>AVec reverse(<T>AVec& a);
- <T>AVec at(int from = 0, int n = -1);
-};
-
-inline <T>AVec::<T>AVec() {}
-inline <T>AVec::<T>AVec(int l) :<T>Vec(l) {}
-inline <T>AVec::<T>AVec(int l, <T&> fill_value) : <T>Vec (l, fill_value) {}
-inline <T>AVec::<T>AVec(<T>AVec& v) :<T>Vec(v) {}
-inline <T>AVec::<T>AVec(int l, <T>* d) :<T>Vec(l, d) {}
-inline <T>AVec::~<T>AVec() {}
-
-
-inline <T>* <T>AVec::vec()
-{
- return s;
-}
-
-inline const <T>* <T>AVec::vec() const
-{
- return s;
-}
-
-inline void <T>AVec::check_len(int l)
-{
- if (l != len)
- error("nonconformant vectors.");
-}
-
-#endif
diff --git a/contrib/libg++/libg++/src/gen/BSTSet.ccP b/contrib/libg++/libg++/src/gen/BSTSet.ccP
deleted file mode 100644
index da7d73a3a032..000000000000
--- a/contrib/libg++/libg++/src/gen/BSTSet.ccP
+++ /dev/null
@@ -1,377 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <stream.h>
-#include "<T>.BSTSet.h"
-
-
-/*
- traversal primitives
-*/
-
-
-<T>BSTNode* <T>BSTSet::leftmost()
-{
- <T>BSTNode* t = root;
- if (t != 0) while (t->lt != 0) t = t->lt;
- return t;
-}
-
-<T>BSTNode* <T>BSTSet::rightmost()
-{
- <T>BSTNode* t = root;
- if (t != 0) while (t->rt != 0) t = t->rt;
- return t;
-}
-
-<T>BSTNode* <T>BSTSet::succ(<T>BSTNode* t)
-{
- if (t == 0)
- return 0;
- if (t->rt != 0)
- {
- t = t->rt;
- while (t->lt != 0) t = t->lt;
- return t;
- }
- else
- {
- for (;;)
- {
- if (t->par == 0 || t == t->par->lt)
- return t->par;
- else
- t = t->par;
- }
- }
-}
-
-<T>BSTNode* <T>BSTSet::pred(<T>BSTNode* t)
-{
- if (t == 0)
- return 0;
- else if (t->lt != 0)
- {
- t = t->lt;
- while (t->rt != 0) t = t->rt;
- return t;
- }
- else
- {
- for (;;)
- {
- if (t->par == 0 || t == t->par->rt)
- return t->par;
- else
- t = t->par;
- }
- }
-}
-
-
-Pix <T>BSTSet::seek(<T&> key)
-{
- <T>BSTNode* t = root;
- for (;;)
- {
- if (t == 0)
- return 0;
- int comp = <T>CMP(key, t->item);
- if (comp == 0)
- return Pix(t);
- else if (comp < 0)
- t = t->lt;
- else
- t = t->rt;
- }
-}
-
-
-Pix <T>BSTSet::add(<T&> item)
-{
- if (root == 0)
- {
- ++count;
- root = new <T>BSTNode(item);
- return Pix(root);
- }
-
- <T>BSTNode* t = root;
- <T>BSTNode* p = root;
- for (;;)
- {
- int comp = <T>CMP(t->item, item);
- if (comp == 0)
- return Pix(t);
- else if (comp > 0)
- t = t->lt;
- else
- t = t->rt;
- if (t == 0)
- {
- ++count;
- t = new <T>BSTNode(item);
- if (comp > 0)
- p->lt = t;
- else
- p->rt = t;
- t->par = p;
- return Pix(t);
- }
- p = t;
- }
-}
-
-
-void <T>BSTSet::del(<T&> key)
-{
- <T>BSTNode* t = root;
- <T>BSTNode* p = root;
- int comp;
- for (;;)
- {
- if (t == 0)
- return;
- comp = <T>CMP(key, t->item);
- if (comp == 0)
- {
- --count;
- <T>BSTNode* repl;
- if (t->lt == 0)
- repl = t->rt;
- else if (t->rt == 0)
- repl = t->lt;
- else
- {
- <T>BSTNode* prepl = t;
- repl = t->lt;
- while (repl->rt != 0)
- {
- prepl = repl;
- repl = repl->rt;
- }
- if (prepl != t)
- {
- prepl->rt = repl->lt;
- if (prepl->rt != 0) prepl->rt->par = prepl;
- repl->lt = t->lt;
- if (repl->lt != 0) repl->lt->par = repl;
- }
- repl->rt = t->rt;
- if (repl->rt != 0) repl->rt->par = repl;
- }
- if (t == root)
- {
- root = repl;
- if (repl != 0) repl->par = 0;
- }
- else
- {
- if (t == p->lt)
- p->lt = repl;
- else
- p->rt = repl;
- if (repl != 0) repl->par = p;
- }
- delete t;
- return;
- }
- p = t;
- if (comp < 0)
- t = t->lt;
- else
- t = t->rt;
- }
-}
-
-
-void <T>BSTSet::_kill(<T>BSTNode* t)
-{
- if (t != 0)
- {
- _kill(t->lt);
- _kill(t->rt);
- delete t;
- }
-}
-
-<T>BSTNode* <T>BSTSet::_copy(<T>BSTNode* t)
-{
- if (t == 0)
- return 0;
- else
- {
- <T>BSTNode* u = new <T>BSTNode(t->item, _copy(t->lt), _copy(t->rt));
- if (u->lt != 0) u->lt->par = u;
- if (u->rt != 0) u->rt->par = u;
- return u;
- }
-}
-
-
-int <T>BSTSet::operator == (<T>BSTSet& y)
-{
- if (count != y.count)
- return 0;
- else
- {
- <T>BSTNode* t = leftmost();
- <T>BSTNode* u = y.leftmost();
- for (;;)
- {
- if (t == 0)
- return 1;
- else if (!<T>EQ(t->item, u->item))
- return 0;
- else
- {
- t = succ(t);
- u = y.succ(u);
- }
- }
- }
-}
-
-int <T>BSTSet::operator <= (<T>BSTSet& y)
-{
- if (count > y.count)
- return 0;
- else
- {
- <T>BSTNode* t = leftmost();
- <T>BSTNode* u = y.leftmost();
- for (;;)
- {
- if (t == 0)
- return 1;
- else if (u == 0)
- return 0;
- int cmp = <T>CMP(t->item, u->item);
- if (cmp == 0)
- {
- t = succ(t);
- u = y.succ(u);
- }
- else if (cmp < 0)
- return 0;
- else
- u = y.succ(u);
- }
- }
-}
-
-
-// linear-time, zero space overhead binary tree rebalancing from
-// Stout & Warren, ``Tree rebalancing in linear space and time''
-// CACM, Sept, 1986, p902.
-
-
-void <T>BSTSet::balance()
-{
- if (count <= 2) return; // don't bother --
- // also we assume non-null root, below
-
- // make re-attaching the root easy via trickery
-
- struct _fake_node { _fake_node *lt, *rt, *par; } fake_root;
-
- fake_root.rt = (_fake_node*)root;
- fake_root.par = 0;
- <T>BSTNode* pseudo_root = (<T>BSTNode*)&fake_root;
-
- // phase 1: tree-to-vine
-
- <T>BSTNode* vine_tail = pseudo_root;
- <T>BSTNode* remainder = root;
-
- while (remainder != 0)
- {
- if (remainder->lt == 0)
- {
- vine_tail = remainder;
- remainder = remainder->rt;
- }
- else
- {
- <T>BSTNode* tmp = remainder->lt;
- remainder->lt = tmp->rt;
- if (remainder->lt != 0) remainder->lt->par = remainder;
- tmp->rt = remainder;
- remainder->par = tmp;
- vine_tail->rt = remainder = tmp;
- }
- }
-
- // phase 2: vine-to-tree
-
- // Uses the slightly simpler version adapted from
- // Day ``Balancing a binary tree'' Computer Journal, Nov. 1976,
- // since it's not generally important whether the `stray' leaves are
- // on the left or on the right.
-
- unsigned int spines = count - 1;
- while (spines > 1)
- {
- int compressions = spines >> 1; // compress every other node
- spines -= compressions + 1; // halve for next time
-
- <T>BSTNode* scanner = pseudo_root;
- while (compressions-- > 0)
- {
- <T>BSTNode* child = scanner->rt;
- <T>BSTNode* grandchild = child->rt;
- scanner->rt = grandchild;
- grandchild->par = scanner;
- child->rt = grandchild->lt;
- if (child->rt != 0) child->rt->par = child;
- grandchild->lt = child;
- child->par = grandchild;
- scanner = grandchild;
- }
- }
-
- root = pseudo_root->rt;
- root->par = 0;
-}
-
-
-int <T>BSTSet::OK()
-{
- int v = 1;
- if (root == 0)
- v = count == 0;
- else
- {
- int n = 1;
- <T>BSTNode* trail = leftmost();
- <T>BSTNode* t = succ(trail);
- while (t != 0)
- {
- ++n;
- v &= <T>CMP(trail->item, t->item) < 0;
- trail = t;
- t = succ(t);
- }
- v &= n == count;
- }
- if (!v) error("invariant failure");
- return v;
-}
diff --git a/contrib/libg++/libg++/src/gen/BSTSet.hP b/contrib/libg++/libg++/src/gen/BSTSet.hP
deleted file mode 100644
index 79a3dd36edfa..000000000000
--- a/contrib/libg++/libg++/src/gen/BSTSet.hP
+++ /dev/null
@@ -1,152 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-
-#ifndef _<T>BSTSet_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _<T>BSTSet_h 1
-
-#include "<T>.Set.h"
-
-#ifndef _<T>BSTNode
-#define _<T>BSTNode 1
-
-struct <T>BSTNode
-{
- <T>BSTNode* lt;
- <T>BSTNode* rt;
- <T>BSTNode* par;
- <T> item;
- <T>BSTNode(<T&> h, <T>BSTNode* l=0, <T>BSTNode* r=0,
- <T>BSTNode* p = 0);
- ~<T>BSTNode();
-};
-
-inline <T>BSTNode::<T>BSTNode(<T&> h, <T>BSTNode* l, <T>BSTNode* r,
- <T>BSTNode* p)
-:lt(l), rt(r), par(p), item(h) {}
-
-inline <T>BSTNode::~<T>BSTNode() {}
-
-typedef <T>BSTNode* <T>BSTNodePtr;
-
-#endif
-
-class <T>BSTSet : public <T>Set
-{
-protected:
- <T>BSTNode* root;
-
- <T>BSTNode* leftmost();
- <T>BSTNode* rightmost();
- <T>BSTNode* pred(<T>BSTNode* t);
- <T>BSTNode* succ(<T>BSTNode* t);
- void _kill(<T>BSTNode* t);
- <T>BSTNode* _copy(<T>BSTNode* t);
-
-public:
- <T>BSTSet();
- <T>BSTSet(<T>BSTSet& a);
- inline ~<T>BSTSet();
-
- Pix add(<T&> item);
- void del(<T&> item);
- inline int contains(<T&> item);
-
- inline void clear();
-
- inline Pix first();
- inline void next(Pix& i);
- inline <T>& operator () (Pix i);
- Pix seek(<T&> item);
-
- Pix last();
- void prev(Pix& i);
-
- int operator == (<T>BSTSet& b);
- int operator != (<T>BSTSet& b);
- int operator <= (<T>BSTSet& b);
-
- void balance();
- int OK();
-};
-
-inline <T>BSTSet::~<T>BSTSet()
-{
- _kill(root);
-}
-
-inline <T>BSTSet::<T>BSTSet()
-{
- root = 0;
- count = 0;
-}
-
-
-inline <T>BSTSet::<T>BSTSet(<T>BSTSet& a)
-{
- count = a.count;
- root = _copy(a.root);
-}
-
-inline int <T>BSTSet::operator != (<T>BSTSet& b)
-{
- return ! (*this == b);
-}
-
-inline Pix <T>BSTSet::first()
-{
- return Pix(leftmost());
-}
-
-inline Pix <T>BSTSet::last()
-{
- return Pix(rightmost());
-}
-
-inline void <T>BSTSet::next(Pix& i)
-{
- if (i != 0) i = Pix(succ((<T>BSTNode*)i));
-}
-
-inline void <T>BSTSet::prev(Pix& i)
-{
- if (i != 0) i = Pix(pred((<T>BSTNode*)i));
-}
-
-inline <T>& <T>BSTSet::operator () (Pix i)
-{
- if (i == 0) error("null Pix");
- return ((<T>BSTNode*)i)->item;
-}
-
-inline void <T>BSTSet::clear()
-{
- _kill(root);
- count = 0;
- root = 0;
-}
-
-inline int <T>BSTSet::contains(<T&> key)
-{
- return seek(key) != 0;
-}
-
-#endif
diff --git a/contrib/libg++/libg++/src/gen/Bag.ccP b/contrib/libg++/libg++/src/gen/Bag.ccP
deleted file mode 100644
index 3f9f06c00bc7..000000000000
--- a/contrib/libg++/libg++/src/gen/Bag.ccP
+++ /dev/null
@@ -1,74 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <builtin.h>
-#include "<T>.Bag.h"
-
-// error handling
-
-void <T>Bag::error(const char* msg)
-{
- (*lib_error_handler)("Bag", msg);
-}
-
-
-Pix <T>Bag::seek(<T&> item, Pix i)
-{
- if (i == 0)
- i = first();
- else
- next(i);
- for (;i != 0 && (!(<T>EQ((*this)(i), item))); next(i));
- return i;
-}
-
-int <T>Bag::owns(Pix p)
-{
- if (p == 0) return 0;
- for (Pix i = first(); i != 0; next(i)) if (i == p) return 1;
- return 0;
-}
-
-void <T>Bag::remove(<T&> item)
-{
- int i = nof(item);
- while (i-- > 0) del(item);
-}
-
-
-int <T>Bag::nof(<T&> item)
-{
- int n = 0;
- for (Pix p = first(); p; next(p)) if (<T>EQ((*this)(p), item)) ++n;
- return n;
-}
-
-void <T>Bag::clear()
-{
- Pix i = first();
- while (i != 0)
- {
- del((*this)(i));
- i = first();
- }
-}
-
-
diff --git a/contrib/libg++/libg++/src/gen/Bag.hP b/contrib/libg++/libg++/src/gen/Bag.hP
deleted file mode 100644
index de6dc5c4ca01..000000000000
--- a/contrib/libg++/libg++/src/gen/Bag.hP
+++ /dev/null
@@ -1,79 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-
-#ifndef _<T>Bag_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _<T>Bag_h 1
-
-#include <Pix.h>
-#include "<T>.defs.h"
-
-class <T>Bag
-{
-protected:
- int count;
-
-public:
- inline virtual ~<T>Bag();
-
- int length(); // current number of items
- int empty();
-
- virtual Pix add(<T&> item) = 0; // add item; return Pix
-
- virtual void del(<T&> item) = 0; // delete 1 occurrence of item
-#undef remove
- virtual void remove(<T&> item); // delete all occurrences
- virtual void clear(); // delete all items
-
- inline virtual int contains(<T&> item); // is item in Bag?
- virtual int nof(<T&> item); // how many in Bag?
-
- virtual Pix first() = 0; // Pix of first item or 0
- virtual void next(Pix& i) = 0; // advance to next or 0
-
- virtual <T>& operator () (Pix i) = 0; // access item at i
-
- virtual Pix seek(<T&> item, Pix from=0); // Pix of next occurrence
- virtual int owns(Pix i); // is i a valid Pix ?
-
- void error(const char* msg);
- virtual int OK() = 0; // rep invariant
-};
-
-inline <T>Bag::~<T>Bag() {}
-
-inline int <T>Bag::length()
-{
- return count;
-}
-
-inline int <T>Bag::empty()
-{
- return count == 0;
-}
-
-inline int <T>Bag::contains(<T&> item)
-{
- return seek(item) != 0;
-}
-
-#endif
diff --git a/contrib/libg++/libg++/src/gen/CHBag.ccP b/contrib/libg++/libg++/src/gen/CHBag.ccP
deleted file mode 100644
index 22c9d707a59e..000000000000
--- a/contrib/libg++/libg++/src/gen/CHBag.ccP
+++ /dev/null
@@ -1,210 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include "<T>.CHBag.h"
-
-// The nodes are linked together serially via a version
-// of a trick used in some vtables: odd pointers are
-// actually links to the next table entry.
-// Not terrible, but not wonderful either
-
-static inline int goodCHptr(<T>CHNode* t)
-{
- return ((((unsigned)t) & 1) == 0);
-}
-
-static inline <T>CHNode* index_to_CHptr(int i)
-{
- return (<T>CHNode*)((i << 1) + 1);
-}
-
-static inline int CHptr_to_index(<T>CHNode* t)
-{
- return ( ((unsigned) t) >> 1);
-}
-
-<T>CHBag::<T>CHBag(unsigned int sz)
-{
- tab = (<T>CHNode**)(new <T>CHNodePtr[size = sz]);
- for (unsigned int i = 0; i < size; ++i) tab[i] = index_to_CHptr(i+1);
- count = 0;
-}
-
-<T>CHBag::<T>CHBag(<T>CHBag& a)
-{
- tab = (<T>CHNode**)(new <T>CHNodePtr[size = a.size]);
- for (unsigned int i = 0; i < size; ++i) tab[i] = index_to_CHptr(i+1);
- count = 0;
- for (Pix p = a.first(); p; a.next(p)) add(a(p));
-}
-
-
-Pix <T>CHBag::seek(<T&> key, Pix i)
-{
- <T>CHNode* p = (<T>CHNode*)i;
- if (p == 0 || !<T>EQ(p->hd, key))
- {
- unsigned int h = <T>HASH(key) % size;
- for (<T>CHNode* t = tab[h]; goodCHptr(t); t = t->tl)
- if (<T>EQ(key, t->hd))
- return Pix(t);
- }
- else
- {
- for (p = p->tl; goodCHptr(p); p = p->tl)
- if (<T>EQ(p->hd, key))
- return Pix(p);
- }
- return 0;
-}
-
-int <T>CHBag::nof(<T&> key)
-{
- int n = 0;
- unsigned int h = <T>HASH(key) % size;
- for (<T>CHNode* t = tab[h]; goodCHptr(t); t = t->tl)
- if (<T>EQ(key, t->hd)) ++n;
- return n;
-}
-
-
-Pix <T>CHBag::add(<T&> item)
-{
- unsigned int h = <T>HASH(item) % size;
- <T>CHNode* t = new <T>CHNode(item);
- t->tl = tab[h];
- tab[h] = t;
- ++count;
- return Pix(t);
-}
-
-void <T>CHBag::del(<T&> key)
-{
- unsigned int h = <T>HASH(key) % size;
-
- <T>CHNode* t = tab[h];
- <T>CHNode* trail = t;
- while (goodCHptr(t))
- {
- if (<T>EQ(key, t->hd))
- {
- if (trail == t)
- tab[h] = t->tl;
- else
- trail->tl = t->tl;
- delete t;
- --count;
- return;
- }
- trail = t;
- t = t->tl;
- }
-}
-
-void <T>CHBag::remove(<T&> key)
-{
- unsigned int h = <T>HASH(key) % size;
-
- <T>CHNode* t = tab[h];
- <T>CHNode* trail = t;
- while (goodCHptr(t))
- {
- if (<T>EQ(key, t->hd))
- {
- --count;
- if (trail == t)
- {
- tab[h] = t->tl;
- delete t;
- t = trail = tab[h];
- }
- else
- {
- trail->tl = t->tl;
- delete t;
- t = trail->tl;
- }
- }
- else
- {
- trail = t;
- t = t->tl;
- }
- }
-}
-
-
-void <T>CHBag::clear()
-{
- for (unsigned int i = 0; i < size; ++i)
- {
- <T>CHNode* p = tab[i];
- tab[i] = index_to_CHptr(i+1);
- while (goodCHptr(p))
- {
- <T>CHNode* nxt = p->tl;
- delete(p);
- p = nxt;
- }
- }
- count = 0;
-}
-
-Pix <T>CHBag::first()
-{
- for (unsigned int i = 0; i < size; ++i) if (goodCHptr(tab[i])) return Pix(tab[i]);
- return 0;
-}
-
-void <T>CHBag::next(Pix& p)
-{
- if (p == 0) return;
- <T>CHNode* t = ((<T>CHNode*)p)->tl;
- if (goodCHptr(t))
- p = Pix(t);
- else
- {
- for (unsigned int i = CHptr_to_index(t); i < size; ++i)
- {
- if (goodCHptr(tab[i]))
- {
- p = Pix(tab[i]);
- return;
- }
- }
- p = 0;
- }
-}
-
-int <T>CHBag::OK()
-{
- int v = tab != 0;
- int n = 0;
- for (unsigned int i = 0; i < size; ++i)
- {
- <T>CHNode* p;
- for (p = tab[i]; goodCHptr(p); p = p->tl) ++n;
- v &= CHptr_to_index(p) == i + 1;
- }
- v &= count == n;
- if (!v) error("invariant failure");
- return v;
-}
diff --git a/contrib/libg++/libg++/src/gen/CHBag.hP b/contrib/libg++/libg++/src/gen/CHBag.hP
deleted file mode 100644
index b2fe61f67078..000000000000
--- a/contrib/libg++/libg++/src/gen/CHBag.hP
+++ /dev/null
@@ -1,76 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-
-#ifndef _<T>CHBag_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _<T>CHBag_h 1
-
-#include "<T>.Bag.h"
-
-
-#include "<T>.CHNode.h"
-
-class <T>CHBag : public <T>Bag
-{
-protected:
- <T>CHNode** tab;
- unsigned int size;
-
-public:
- <T>CHBag(unsigned int sz = DEFAULT_INITIAL_CAPACITY);
- <T>CHBag(<T>CHBag& a);
- inline ~<T>CHBag();
-
- Pix add(<T&> item);
- void del(<T&> item);
- void remove(<T&>item);
- int nof(<T&> item);
- inline int contains(<T&> item);
-
- void clear();
-
- Pix first();
- void next(Pix& i);
- inline <T>& operator () (Pix i);
- Pix seek(<T&> item, Pix from = 0);
-
- int OK();
-};
-
-
-inline <T>CHBag::~<T>CHBag()
-{
- clear();
- delete tab;
-}
-
-inline int <T>CHBag::contains(<T&> key)
-{
- return seek(key) != 0;
-}
-
-inline <T>& <T>CHBag::operator () (Pix i)
-{
- if (i == 0) error("null Pix");
- return ((<T>CHNode*)i)->hd;
-}
-
-#endif
diff --git a/contrib/libg++/libg++/src/gen/CHMap.ccP b/contrib/libg++/libg++/src/gen/CHMap.ccP
deleted file mode 100644
index af28fc305a86..000000000000
--- a/contrib/libg++/libg++/src/gen/CHMap.ccP
+++ /dev/null
@@ -1,168 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include "<T>.<C>.CHMap.h"
-
-// The nodes are linked together serially via a version
-// of a trick used in some vtables: odd pointers are
-// actually links to the next table entry.
-// Not terrible, but not wonderful either
-
-static inline int goodCHptr(<T><C>CHNode* t)
-{
- return ((((unsigned)t) & 1) == 0);
-}
-
-static inline <T><C>CHNode* index_to_CHptr(int i)
-{
- return (<T><C>CHNode*)((i << 1) + 1);
-}
-
-static inline int CHptr_to_index(<T><C>CHNode* t)
-{
- return ( ((unsigned) t) >> 1);
-}
-
-<T><C>CHMap::<T><C>CHMap(<C&> dflt, unsigned int sz)
- :<T><C>Map(dflt)
-{
- tab = (<T><C>CHNode**)(new <T><C>CHNodePtr[size = sz]);
- for (unsigned int i = 0; i < size; ++i) tab[i] = index_to_CHptr(i+1);
- count = 0;
-}
-
-<T><C>CHMap::<T><C>CHMap(<T><C>CHMap& a) :<T><C>Map(a.def)
-{
- tab = (<T><C>CHNode**)(new <T><C>CHNodePtr[size = a.size]);
- for (unsigned int i = 0; i < size; ++i) tab[i] = index_to_CHptr(i+1);
- count = 0;
- for (Pix p = a.first(); p; a.next(p)) (*this)[a.key(p)] = a.contents(p);
-}
-
-
-Pix <T><C>CHMap::seek(<T&> key)
-{
- unsigned int h = <T>HASH(key) % size;
-
- for (<T><C>CHNode* t = tab[h]; goodCHptr(t); t = t->tl)
- if (<T>EQ(key, t->hd))
- return Pix(t);
-
- return 0;
-}
-
-
-<C>& <T><C>CHMap::operator [](<T&> item)
-{
- unsigned int h = <T>HASH(item) % size;
- <T><C>CHNode* t;
-
- for (t = tab[h]; goodCHptr(t); t = t->tl)
- if (<T>EQ(item, t->hd))
- return t->cont;
-
- t = new <T><C>CHNode(item, def, tab[h]);
- tab[h] = t;
- ++count;
- return t->cont;
-}
-
-
-void <T><C>CHMap::del(<T&> key)
-{
- unsigned int h = <T>HASH(key) % size;
-
- <T><C>CHNode* t = tab[h];
- <T><C>CHNode* trail = t;
- while (goodCHptr(t))
- {
- if (<T>EQ(key, t->hd))
- {
- if (trail == t)
- tab[h] = t->tl;
- else
- trail->tl = t->tl;
- delete t;
- --count;
- return;
- }
- trail = t;
- t = t->tl;
- }
-}
-
-
-void <T><C>CHMap::clear()
-{
- for (unsigned int i = 0; i < size; ++i)
- {
- <T><C>CHNode* p = tab[i];
- tab[i] = index_to_CHptr(i+1);
- while (goodCHptr(p))
- {
- <T><C>CHNode* nxt = p->tl;
- delete(p);
- p = nxt;
- }
- }
- count = 0;
-}
-
-Pix <T><C>CHMap::first()
-{
- for (unsigned int i = 0; i < size; ++i) if (goodCHptr(tab[i])) return Pix(tab[i]);
- return 0;
-}
-
-void <T><C>CHMap::next(Pix& p)
-{
- <T><C>CHNode* t = ((<T><C>CHNode*)p)->tl;
- if (goodCHptr(t))
- p = Pix(t);
- else
- {
- for (unsigned int i = CHptr_to_index(t); i < size; ++i)
- {
- if (goodCHptr(tab[i]))
- {
- p = Pix(tab[i]);
- return;
- }
- }
- p = 0;
- }
-}
-
-
-int <T><C>CHMap::OK()
-{
- int v = tab != 0;
- int n = 0;
- for (unsigned int i = 0; i < size; ++i)
- {
- <T><C>CHNode* p;
- for (p = tab[i]; goodCHptr(p); p = p->tl) ++n;
- v &= CHptr_to_index(p) == i + 1;
- }
- v &= count == n;
- if (!v) error("invariant failure");
- return v;
-}
diff --git a/contrib/libg++/libg++/src/gen/CHMap.hP b/contrib/libg++/libg++/src/gen/CHMap.hP
deleted file mode 100644
index 2b4e25a284b8..000000000000
--- a/contrib/libg++/libg++/src/gen/CHMap.hP
+++ /dev/null
@@ -1,104 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-
-#ifndef _<T><C>CHMap_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _<T><C>CHMap_h 1
-
-#include "<T>.<C>.Map.h"
-
-#ifndef _<T><C>CHNode_h
-#define _<T><C>CHNode_h 1
-
-struct <T><C>CHNode
-{
- <T><C>CHNode* tl;
- <T> hd;
- <C> cont;
- <T><C>CHNode();
- <T><C>CHNode(<T&> h, <C&> c, <T><C>CHNode* t = 0);
- ~<T><C>CHNode();
-};
-
-inline <T><C>CHNode::<T><C>CHNode() {}
-
-inline <T><C>CHNode::<T><C>CHNode(<T&> h, <C&> c, <T><C>CHNode* t)
- : tl(t), hd(h), cont(c) {}
-
-inline <T><C>CHNode::~<T><C>CHNode() {}
-
-typedef <T><C>CHNode* <T><C>CHNodePtr;
-
-#endif
-
-
-class <T><C>CHMap : public <T><C>Map
-{
-protected:
- <T><C>CHNode** tab;
- unsigned int size;
-
-public:
- <T><C>CHMap(<C&> dflt,unsigned int sz=DEFAULT_INITIAL_CAPACITY);
- <T><C>CHMap(<T><C>CHMap& a);
- inline ~<T><C>CHMap();
-
- <C>& operator [] (<T&> key);
-
- void del(<T&> key);
-
- Pix first();
- void next(Pix& i);
- inline <T>& key(Pix i);
- inline <C>& contents(Pix i);
-
- Pix seek(<T&> key);
- inline int contains(<T&> key);
-
- void clear();
- int OK();
-};
-
-
-inline <T><C>CHMap::~<T><C>CHMap()
-{
- clear();
- delete tab;
-}
-
-inline int <T><C>CHMap::contains(<T&> key)
-{
- return seek(key) != 0;
-}
-
-inline <T>& <T><C>CHMap::key(Pix p)
-{
- if (p == 0) error("null Pix");
- return ((<T><C>CHNode*)p)->hd;
-}
-
-inline <C>& <T><C>CHMap::contents(Pix p)
-{
- if (p == 0) error("null Pix");
- return ((<T><C>CHNode*)p)->cont;
-}
-
-#endif
diff --git a/contrib/libg++/libg++/src/gen/CHNode.ccP b/contrib/libg++/libg++/src/gen/CHNode.ccP
deleted file mode 100644
index b9a1e176ef43..000000000000
--- a/contrib/libg++/libg++/src/gen/CHNode.ccP
+++ /dev/null
@@ -1,21 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1992 Free Software Foundation
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include "<T>.CHNode.h"
diff --git a/contrib/libg++/libg++/src/gen/CHNode.hP b/contrib/libg++/libg++/src/gen/CHNode.hP
deleted file mode 100644
index af3acd1557c5..000000000000
--- a/contrib/libg++/libg++/src/gen/CHNode.hP
+++ /dev/null
@@ -1,43 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988, 1982 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifndef _<T>CHNode_h
-#define _<T>CHNode_h 1
-#ifdef __GNUG__
-#pragma interface
-#endif
-#include "<T>.defs.h"
-
-struct <T>CHNode
-{
- <T>CHNode* tl;
- <T> hd;
- <T>CHNode();
- <T>CHNode(<T&> h, <T>CHNode* t = 0);
- ~<T>CHNode();
-};
-
-inline <T>CHNode::<T>CHNode() {}
-
-inline <T>CHNode::<T>CHNode(<T&> h, <T>CHNode* t) :tl(t), hd(h) {}
-
-inline <T>CHNode::~<T>CHNode() {}
-
-typedef <T>CHNode* <T>CHNodePtr;
-
-#endif
diff --git a/contrib/libg++/libg++/src/gen/CHSet.ccP b/contrib/libg++/libg++/src/gen/CHSet.ccP
deleted file mode 100644
index 5a3727b79702..000000000000
--- a/contrib/libg++/libg++/src/gen/CHSet.ccP
+++ /dev/null
@@ -1,273 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include "<T>.CHSet.h"
-
-// A CHSet is implemented as an array (tab) of buckets, each of which
-// contains a pointer to a list of <T>CHNodes. Each node contains a
-// pointer to the next node in the list, and a pointer to the <T>.
-// The end of the list is marked by a next node pointer which is odd
-// when considered as an integer (least significant bit = 1). The
-// assumption is that CHNodes will all begin on even addresses. If
-// the odd pointer is right-shifted by one bit, it becomes the index
-// within the tab array of the next bucket (that is, bucket i has
-// next bucket pointer 2*(i+1)+1).
-
-// The bucket pointers are initialized by the constructor and
-// used to support the next(Pix&) method.
-
-// This implementation is not portable to machines with different
-// pointer and integer sizes, or on which CHNodes might be aligned on
-// odd byte boundaries, but allows the same pointer to be used for
-// chaining within a bucket and to the next bucket.
-
-
-static inline int goodCHptr(<T>CHNode* t)
-{
- return ((((unsigned)t) & 1) == 0);
-}
-
-static inline <T>CHNode* index_to_CHptr(int i)
-{
- return (<T>CHNode*)((i << 1) + 1);
-}
-
-static inline int CHptr_to_index(<T>CHNode* t)
-{
- return ( ((unsigned) t) >> 1);
-}
-
-<T>CHSet::<T>CHSet(unsigned int sz)
-{
- tab = (<T>CHNode**)(new <T>CHNodePtr[size = sz]);
- for (unsigned int i = 0; i < size; ++i) tab[i] = index_to_CHptr(i+1);
- count = 0;
-}
-
-<T>CHSet::<T>CHSet(<T>CHSet& a)
-{
- tab = (<T>CHNode**)(new <T>CHNodePtr[size = a.size]);
- for (unsigned int i = 0; i < size; ++i) tab[i] = index_to_CHptr(i+1);
- count = 0;
- for (Pix p = a.first(); p; a.next(p)) add(a(p));
-}
-
-
-Pix <T>CHSet::seek(<T&> key)
-{
- unsigned int h = <T>HASH(key) % size;
-
- for (<T>CHNode* t = tab[h]; goodCHptr(t); t = t->tl)
- if (<T>EQ(key, t->hd))
- return Pix(t);
-
- return 0;
-}
-
-
-Pix <T>CHSet::add(<T&> item)
-{
- unsigned int h = <T>HASH(item) % size;
- <T>CHNode* t;
-
- for (t = tab[h]; goodCHptr(t); t = t->tl)
- if (<T>EQ(item, t->hd))
- return Pix(t);
-
- ++count;
- t = new <T>CHNode(item, tab[h]);
- tab[h] = t;
- return Pix(t);
-}
-
-
-void <T>CHSet::del(<T&> key)
-{
- unsigned int h = <T>HASH(key) % size;
-
- <T>CHNode* t = tab[h];
- <T>CHNode* trail = t;
- while (goodCHptr(t))
- {
- if (<T>EQ(key, t->hd))
- {
- if (trail == t)
- tab[h] = t->tl;
- else
- trail->tl = t->tl;
- delete t;
- --count;
- return;
- }
- trail = t;
- t = t->tl;
- }
-}
-
-
-void <T>CHSet::clear()
-{
- for (unsigned int i = 0; i < size; ++i)
- {
- <T>CHNode* p = tab[i];
- tab[i] = index_to_CHptr(i+1);
- while (goodCHptr(p))
- {
- <T>CHNode* nxt = p->tl;
- delete(p);
- p = nxt;
- }
- }
- count = 0;
-}
-
-Pix <T>CHSet::first()
-{
- for (unsigned int i = 0; i < size; ++i) if (goodCHptr(tab[i])) return Pix(tab[i]);
- return 0;
-}
-
-void <T>CHSet::next(Pix& p)
-{
- if (p == 0) return;
- <T>CHNode* t = ((<T>CHNode*)p)->tl;
- if (goodCHptr(t))
- p = Pix(t);
- else
- {
- for (unsigned int i = CHptr_to_index(t); i < size; ++i)
- {
- if (goodCHptr(tab[i]))
- {
- p = Pix(tab[i]);
- return;
- }
- }
- p = 0;
- }
-}
-
-int <T>CHSet::operator == (<T>CHSet& b)
-{
- if (count != b.count)
- return 0;
- else
- {
- <T>CHNode* p;
- for (unsigned int i = 0; i < size; ++i)
- for (p = tab[i]; goodCHptr(p); p = p->tl)
- if (b.seek(p->hd) == 0)
- return 0;
- for (unsigned int i = 0; i < b.size; ++i)
- for (p = b.tab[i]; goodCHptr(p); p = p->tl)
- if (seek(p->hd) == 0)
- return 0;
- return 1;
- }
-}
-
-int <T>CHSet::operator <= (<T>CHSet& b)
-{
- if (count > b.count)
- return 0;
- else
- {
- for (unsigned int i = 0; i < size; ++i)
- for (<T>CHNode* p = tab[i]; goodCHptr(p); p = p->tl)
- if (b.seek(p->hd) == 0)
- return 0;
- return 1;
- }
-}
-
-void <T>CHSet::operator |= (<T>CHSet& b)
-{
- if (&b == this || b.count == 0)
- return;
- for (unsigned int i = 0; i < b.size; ++i)
- for (<T>CHNode* p = b.tab[i]; goodCHptr(p); p = p->tl)
- add(p->hd);
-}
-
-void <T>CHSet::operator &= (<T>CHSet& b)
-{
- for (unsigned int i = 0; i < size; ++i)
- {
- <T>CHNode* t = tab[i];
- <T>CHNode* trail = t;
- while (goodCHptr(t))
- {
- <T>CHNode* nxt = t->tl;
- if (b.seek(t->hd) == 0)
- {
- if (trail == tab[i])
- trail = tab[i] = nxt;
- else
- trail->tl = nxt;
- delete t;
- --count;
- }
- else
- trail = t;
- t = nxt;
- }
- }
-}
-
-void <T>CHSet::operator -= (<T>CHSet& b)
-{
- for (unsigned int i = 0; i < size; ++i)
- {
- <T>CHNode* t = tab[i];
- <T>CHNode* trail = t;
- while (goodCHptr(t))
- {
- <T>CHNode* nxt = t->tl;
- if (b.seek(t->hd) != 0)
- {
- if (trail == tab[i])
- trail = tab[i] = nxt;
- else
- trail->tl = nxt;
- delete t;
- --count;
- }
- else
- trail = t;
- t = nxt;
- }
- }
-}
-
-int <T>CHSet::OK()
-{
- int v = tab != 0;
- int n = 0;
- for (unsigned int i = 0; i < size; ++i)
- {
- <T>CHNode* p;
- for (p = tab[i]; goodCHptr(p); p = p->tl) ++n;
- v &= CHptr_to_index(p) == i + 1;
- }
- v &= count == n;
- if (!v) error("invariant failure");
- return v;
-}
diff --git a/contrib/libg++/libg++/src/gen/CHSet.hP b/contrib/libg++/libg++/src/gen/CHSet.hP
deleted file mode 100644
index 1fc2c8e994fc..000000000000
--- a/contrib/libg++/libg++/src/gen/CHSet.hP
+++ /dev/null
@@ -1,84 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-
-#ifndef _<T>CHSet_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _<T>CHSet_h 1
-
-#include "<T>.Set.h"
-#include "<T>.CHNode.h"
-
-class <T>CHSet : public <T>Set
-{
-protected:
- <T>CHNode** tab;
- unsigned int size;
-
-public:
- <T>CHSet(unsigned int sz = DEFAULT_INITIAL_CAPACITY);
- <T>CHSet(<T>CHSet& a);
- inline ~<T>CHSet();
-
- Pix add(<T&> item);
- void del(<T&> item);
- inline int contains(<T&> item);
-
- void clear();
-
- Pix first();
- void next(Pix& i);
- inline <T>& operator () (Pix i);
- Pix seek(<T&> item);
-
- void operator |= (<T>CHSet& b);
- void operator -= (<T>CHSet& b);
- void operator &= (<T>CHSet& b);
-
- int operator == (<T>CHSet& b);
- int operator != (<T>CHSet& b);
- int operator <= (<T>CHSet& b);
-
- int OK();
-};
-
-inline <T>CHSet::~<T>CHSet()
-{
- clear();
- delete tab;
-}
-
-inline int <T>CHSet::contains(<T&> key)
-{
- return seek(key) != 0;
-}
-
-inline <T>& <T>CHSet::operator () (Pix i)
-{
- if (i == 0) error("null Pix");
- return ((<T>CHNode*)i)->hd;
-}
-
-inline int <T>CHSet::operator != (<T>CHSet& b)
-{
- return ! ((*this) == b);
-}
-
-#endif
diff --git a/contrib/libg++/libg++/src/gen/DLDeque.ccP b/contrib/libg++/libg++/src/gen/DLDeque.ccP
deleted file mode 100644
index d5a0db7f910a..000000000000
--- a/contrib/libg++/libg++/src/gen/DLDeque.ccP
+++ /dev/null
@@ -1,4 +0,0 @@
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include "<T>.DLDeque.h"
diff --git a/contrib/libg++/libg++/src/gen/DLDeque.hP b/contrib/libg++/libg++/src/gen/DLDeque.hP
deleted file mode 100644
index 6d8cc70fd98a..000000000000
--- a/contrib/libg++/libg++/src/gen/DLDeque.hP
+++ /dev/null
@@ -1,130 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-
-#ifndef _<T>DLDeque_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _<T>DLDeque_h
-
-#include "<T>.DLList.h"
-#include "<T>.Deque.h"
-
-class <T>DLDeque : public <T>Deque
-{
- <T>DLList p;
-
-public:
- <T>DLDeque();
- <T>DLDeque(const <T>DLDeque& d);
- inline ~<T>DLDeque();
-
- void operator = (const <T>DLDeque&);
-
- inline void push(<T&> item); // insert at front
- inline void enq(<T&> item); // insert at rear
-
- inline <T>& front();
- inline <T>& rear();
-
- inline <T> deq();
- inline void del_front();
- inline void del_rear();
-
- inline void clear();
- inline int empty();
- inline int full();
- inline int length();
-
- inline int OK();
-};
-
-
-inline <T>DLDeque::<T>DLDeque() : p() {}
-inline <T>DLDeque::<T>DLDeque(const <T>DLDeque& d) : p(d.p) {}
-
-inline <T>DLDeque::~<T>DLDeque() {}
-
-inline void <T>DLDeque::push(<T&>item)
-{
- p.prepend(item);
-}
-
-inline void <T>DLDeque::enq(<T&>item)
-{
- p.append(item);
-}
-
-inline <T> <T>DLDeque::deq()
-{
- return p.remove_front();
-}
-
-inline <T>& <T>DLDeque::front()
-{
- return p.front();
-}
-
-inline <T>& <T>DLDeque::rear()
-{
- return p.rear();
-}
-
-inline void <T>DLDeque::del_front()
-{
- p.del_front();
-}
-
-inline void <T>DLDeque::del_rear()
-{
- p.del_rear();
-}
-
-inline void <T>DLDeque::operator =(const <T>DLDeque& s)
-{
- p.operator = (s.p);
-}
-
-
-inline int <T>DLDeque::empty()
-{
- return p.empty();
-}
-
-inline int <T>DLDeque::full()
-{
- return 0;
-}
-
-inline int <T>DLDeque::length()
-{
- return p.length();
-}
-
-inline int <T>DLDeque::OK()
-{
- return p.OK();
-}
-
-inline void <T>DLDeque::clear()
-{
- p.clear();
-}
-
-#endif
diff --git a/contrib/libg++/libg++/src/gen/DLList.ccP b/contrib/libg++/libg++/src/gen/DLList.ccP
deleted file mode 100644
index c870dc185952..000000000000
--- a/contrib/libg++/libg++/src/gen/DLList.ccP
+++ /dev/null
@@ -1,339 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-// WARNING: This file is obsolete. Use ../DLList.cc, if you can.
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <limits.h>
-#include <stream.h>
-#include <builtin.h>
-#include "<T>.DLList.h"
-
-// error handling
-
-
-
-void <T>DLList::error(const char* msg)
-{
- (*lib_error_handler)("DLList", msg);
-}
-
-int <T>DLList::length()
-{
- int l = 0;
- <T>DLListNode* t = h;
- if (t != 0) do { ++l; t = t->fd; } while (t != h);
- return l;
-}
-
-<T>DLList::<T>DLList(const <T>DLList& a)
-{
- if (a.h == 0)
- h = 0;
- else
- {
- <T>DLListNode* p = a.h;
- <T>DLListNode* t = new <T>DLListNode(p->hd);
- h = t;
- p = p->fd;
- while (p != a.h)
- {
- <T>DLListNode* n = new <T>DLListNode(p->hd);
- t->fd = n;
- n->bk = t;
- t = n;
- p = p->fd;
- }
- t->fd = h;
- h->bk = t;
- return;
- }
-}
-
-<T>DLList& <T>DLList::operator = (const <T>DLList& a)
-{
- if (h != a.h)
- {
- clear();
- if (a.h != 0)
- {
- <T>DLListNode* p = a.h;
- <T>DLListNode* t = new <T>DLListNode(p->hd);
- h = t;
- p = p->fd;
- while (p != a.h)
- {
- <T>DLListNode* n = new <T>DLListNode(p->hd);
- t->fd = n;
- n->bk = t;
- t = n;
- p = p->fd;
- }
- t->fd = h;
- h->bk = t;
- }
- }
- return *this;
-}
-
-void <T>DLList::clear()
-{
- if (h == 0)
- return;
-
- <T>DLListNode* p = h->fd;
- h->fd = 0;
- h = 0;
-
- while (p != 0)
- {
- <T>DLListNode* nxt = p->fd;
- delete(p);
- p = nxt;
- }
-}
-
-
-Pix <T>DLList::prepend(<T&> item)
-{
- <T>DLListNode* t = new <T>DLListNode(item);
- if (h == 0)
- t->fd = t->bk = h = t;
- else
- {
- t->fd = h;
- t->bk = h->bk;
- h->bk->fd = t;
- h->bk = t;
- h = t;
- }
- return Pix(t);
-}
-
-Pix <T>DLList::append(<T&> item)
-{
- <T>DLListNode* t = new <T>DLListNode(item);
- if (h == 0)
- t->fd = t->bk = h = t;
- else
- {
- t->bk = h->bk;
- t->bk->fd = t;
- t->fd = h;
- h->bk = t;
- }
- return Pix(t);
-}
-
-Pix <T>DLList::ins_after(Pix p, <T&> item)
-{
- if (p == 0) return prepend(item);
- <T>DLListNode* u = (<T>DLListNode*) p;
- <T>DLListNode* t = new <T>DLListNode(item, u, u->fd);
- u->fd->bk = t;
- u->fd = t;
- return Pix(t);
-}
-
-Pix <T>DLList::ins_before(Pix p, <T&> item)
-{
- if (p == 0) error("null Pix");
- <T>DLListNode* u = (<T>DLListNode*) p;
- <T>DLListNode* t = new <T>DLListNode(item, u->bk, u);
- u->bk->fd = t;
- u->bk = t;
- if (u == h) h = t;
- return Pix(t);
-}
-
-void <T>DLList::join(<T>DLList& b)
-{
- <T>DLListNode* t = b.h;
- b.h = 0;
- if (h == 0)
- h = t;
- else if (t != 0)
- {
- <T>DLListNode* l = t->bk;
- h->bk->fd = t;
- t->bk = h->bk;
- h->bk = l;
- l->fd = h;
- }
-}
-
-int <T>DLList::owns(Pix p)
-{
- <T>DLListNode* t = h;
- if (t != 0 && p != 0)
- {
- do
- {
- if (Pix(t) == p) return 1;
- t = t->fd;
- } while (t != h);
- }
- return 0;
-}
-
-void <T>DLList::del(Pix& p, int dir)
-{
- if (p == 0) error("null Pix");
- <T>DLListNode* t = (<T>DLListNode*) p;
- if (t->fd == t)
- {
- h = 0;
- p = 0;
- }
- else
- {
- if (dir < 0)
- {
- if (t == h)
- p = 0;
- else
- p = Pix(t->bk);
- }
- else
- {
- if (t == h->bk)
- p = 0;
- else
- p = Pix(t->fd);
- }
- t->bk->fd = t->fd;
- t->fd->bk = t->bk;
- if (t == h) h = t->fd;
- }
- delete t;
-}
-
-void <T>DLList::del_after(Pix& p)
-{
- if (p == 0)
- {
- del_front();
- return;
- }
-
- <T>DLListNode* b = (<T>DLListNode*) p;
- <T>DLListNode* t = b->fd;
-
- if (b == t)
- {
- h = 0;
- p = 0;
- }
- else
- {
- t->bk->fd = t->fd;
- t->fd->bk = t->bk;
- if (t == h) h = t->fd;
- }
- delete t;
-}
-
-<T> <T>DLList::remove_front()
-{
- if (h == 0)
- error("remove_front of empty list");
- <T>DLListNode* t = h;
- <T> res = t->hd;
- if (h->fd == h)
- h = 0;
- else
- {
- h->fd->bk = h->bk;
- h->bk->fd = h->fd;
- h = h->fd;
- }
- delete t;
- return res;
-}
-
-
-void <T>DLList::del_front()
-{
- if (h == 0)
- error("del_front of empty list");
- <T>DLListNode* t = h;
- if (h->fd == h)
- h = 0;
- else
- {
- h->fd->bk = h->bk;
- h->bk->fd = h->fd;
- h = h->fd;
- }
- delete t;
-}
-
-<T> <T>DLList::remove_rear()
-{
- if (h == 0)
- error("remove_rear of empty list");
- <T>DLListNode* t = h->bk;
- <T> res = t->hd;
- if (h->fd == h)
- h = 0;
- else
- {
- t->fd->bk = t->bk;
- t->bk->fd = t->fd;
- }
- delete t;
- return res;
-}
-
-
-void <T>DLList::del_rear()
-{
- if (h == 0)
- error("del_rear of empty list");
- <T>DLListNode* t = h->bk;
- if (h->fd == h)
- h = 0;
- else
- {
- t->fd->bk = t->bk;
- t->bk->fd = t->fd;
- }
- delete t;
-}
-
-
-int <T>DLList::OK()
-{
- int v = 1;
- if (h != 0)
- {
- <T>DLListNode* t = h;
- long count = LONG_MAX; // Lots of chances to find h!
- do
- {
- count--;
- v &= t->bk->fd == t;
- v &= t->fd->bk == t;
- t = t->fd;
- } while (v && count > 0 && t != h);
- v &= count > 0;
- }
- if (!v) error("invariant failure");
- return v;
-}
diff --git a/contrib/libg++/libg++/src/gen/DLList.hP b/contrib/libg++/libg++/src/gen/DLList.hP
deleted file mode 100644
index 8d1a3f45d7b3..000000000000
--- a/contrib/libg++/libg++/src/gen/DLList.hP
+++ /dev/null
@@ -1,157 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-// WARNING: This file is obsolete. Use ../DLList.h, if you can.
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-
-#ifndef _<T>DLList_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _<T>DLList_h 1
-
-#include <Pix.h>
-#include "<T>.defs.h"
-
-#ifndef _<T>DLListNode_h
-#define _<T>DLListNode_h 1
-
-struct <T>DLListNode
-{
- <T>DLListNode* bk;
- <T>DLListNode* fd;
- <T> hd;
- <T>DLListNode();
- <T>DLListNode(const <T&> h,
- <T>DLListNode* p = 0,
- <T>DLListNode* n = 0);
- ~<T>DLListNode();
-};
-
-inline <T>DLListNode::<T>DLListNode() {}
-
-inline <T>DLListNode::<T>DLListNode(const <T&> h, <T>DLListNode* p,
- <T>DLListNode* n)
- :bk(p), fd(n), hd(h) {}
-
-inline <T>DLListNode::~<T>DLListNode() {}
-
-typedef <T>DLListNode* <T>DLListNodePtr;
-
-#endif
-
-class <T>DLList
-{
- friend class <T>DLListTrav;
-
- <T>DLListNode* h;
-
-public:
- <T>DLList();
- <T>DLList(const <T>DLList& a);
- ~<T>DLList();
-
- <T>DLList& operator = (const <T>DLList& a);
-
- int empty();
- int length();
-
- void clear();
-
- Pix prepend(<T&> item);
- Pix append(<T&> item);
- void join(<T>DLList&);
-
- <T>& front();
- <T> remove_front();
- void del_front();
-
- <T>& rear();
- <T> remove_rear();
- void del_rear();
-
- <T>& operator () (Pix p);
- Pix first();
- Pix last();
- void next(Pix& p);
- void prev(Pix& p);
- int owns(Pix p);
- Pix ins_after(Pix p, <T&> item);
- Pix ins_before(Pix p, <T&> item);
- void del(Pix& p, int dir = 1);
- void del_after(Pix& p);
-
- void error(const char* msg);
- int OK();
-};
-
-
-inline <T>DLList::~<T>DLList()
-{
- clear();
-}
-
-inline <T>DLList::<T>DLList()
-{
- h = 0;
-}
-
-inline int <T>DLList::empty()
-{
- return h == 0;
-}
-
-
-inline void <T>DLList::next(Pix& p)
-{
- p = (p == 0 || p == h->bk)? 0 : Pix(((<T>DLListNode*)p)->fd);
-}
-
-inline void <T>DLList::prev(Pix& p)
-{
- p = (p == 0 || p == h)? 0 : Pix(((<T>DLListNode*)p)->bk);
-}
-
-inline Pix <T>DLList::first()
-{
- return Pix(h);
-}
-
-inline Pix <T>DLList::last()
-{
- return (h == 0)? 0 : Pix(h->bk);
-}
-
-inline <T>& <T>DLList::operator () (Pix p)
-{
- if (p == 0) error("null Pix");
- return ((<T>DLListNode*)p)->hd;
-}
-
-inline <T>& <T>DLList::front()
-{
- if (h == 0) error("front: empty list");
- return h->hd;
-}
-
-inline <T>& <T>DLList::rear()
-{
- if (h == 0) error("rear: empty list");
- return h->bk->hd;
-}
-
-#endif
diff --git a/contrib/libg++/libg++/src/gen/Deque.ccP b/contrib/libg++/libg++/src/gen/Deque.ccP
deleted file mode 100644
index 79a9b72c875c..000000000000
--- a/contrib/libg++/libg++/src/gen/Deque.ccP
+++ /dev/null
@@ -1,11 +0,0 @@
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include "<T>.Deque.h"
-
-<T>Deque::~<T>Deque() {}
-
-void <T>Deque::error(const char* msg)
-{
- (*lib_error_handler)("Deque", msg);
-}
diff --git a/contrib/libg++/libg++/src/gen/Deque.hP b/contrib/libg++/libg++/src/gen/Deque.hP
deleted file mode 100644
index 35764321f35d..000000000000
--- a/contrib/libg++/libg++/src/gen/Deque.hP
+++ /dev/null
@@ -1,57 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
- based on code by Marc Shapiro (shapiro@sor.inria.fr)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-
-#ifndef _<T>Deque_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _<T>Deque_h
-
-#include <builtin.h>
-
-#include "<T>.defs.h"
-
-class <T>Deque
-{
-public:
- <T>Deque() { }
- virtual ~<T>Deque();
-
- virtual void push(<T&> item) = 0; // insert at front
- virtual void enq(<T&> item) = 0; // insert at rear
-
- virtual <T>& front() = 0;
- virtual <T>& rear() = 0;
-
- virtual <T> deq() = 0;
- virtual void del_front() = 0;
- virtual void del_rear() = 0;
-
- virtual int empty() = 0;
- virtual int full() = 0;
- virtual int length() = 0;
- virtual void clear() = 0;
-
- virtual int OK() = 0;
-
- void error(const char*);
-};
-
-#endif
diff --git a/contrib/libg++/libg++/src/gen/FPQueue.ccP b/contrib/libg++/libg++/src/gen/FPQueue.ccP
deleted file mode 100644
index a358cacb60ee..000000000000
--- a/contrib/libg++/libg++/src/gen/FPQueue.ccP
+++ /dev/null
@@ -1,4 +0,0 @@
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include "<T>.FPQueue.h"
diff --git a/contrib/libg++/libg++/src/gen/FPQueue.hP b/contrib/libg++/libg++/src/gen/FPQueue.hP
deleted file mode 100644
index adf7e8d3159d..000000000000
--- a/contrib/libg++/libg++/src/gen/FPQueue.hP
+++ /dev/null
@@ -1,112 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
- based on code by Marc Shapiro (shapiro@sor.inria.fr)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-
-#ifndef _<T>FPQueue_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _<T>FPQueue_h
-
-#include "<T>.FPlex.h"
-#include "<T>.Queue.h"
-
-class <T>FPQueue : public <T>Queue
-{
- <T>FPlex p;
-
-public:
- <T>FPQueue(int chunksize = DEFAULT_INITIAL_CAPACITY);
- <T>FPQueue(const <T>FPQueue& q);
- ~<T>FPQueue();
-
- void operator = (const <T>FPQueue&);
-
- void enq(<T&> item);
- <T> deq();
- <T>& front();
- void del_front();
-
- void clear();
- int empty();
- int full();
- int length();
-
- int OK();
-};
-
-inline <T>FPQueue::<T>FPQueue(int chunksize) : p(chunksize) {}
-inline <T>FPQueue::<T>FPQueue(const <T>FPQueue& q) : p(q.p) {}
-
-inline <T>FPQueue::~<T>FPQueue() {}
-
-inline void <T>FPQueue::enq(<T&>item)
-{
- p.add_high(item);
-}
-
-inline <T> <T>FPQueue::deq()
-{
- <T> res = p.low_element();
- p.del_low();
- return res;
-}
-
-inline <T>& <T>FPQueue::front()
-{
- return p.low_element();
-}
-
-
-inline void <T>FPQueue::del_front()
-{
- p.del_low();
-}
-
-inline void <T>FPQueue::operator =(const <T>FPQueue& s)
-{
- p = s.p;
-}
-
-inline int <T>FPQueue::empty()
-{
- return p.empty();
-}
-
-inline int <T>FPQueue::full()
-{
- return p.full();
-}
-
-inline int <T>FPQueue::length()
-{
- return p.length();
-}
-
-inline int <T>FPQueue::OK()
-{
- return p.OK();
-}
-
-inline void <T>FPQueue::clear()
-{
- p.clear();
-}
-
-#endif
diff --git a/contrib/libg++/libg++/src/gen/FPStack.ccP b/contrib/libg++/libg++/src/gen/FPStack.ccP
deleted file mode 100644
index 954991193b7a..000000000000
--- a/contrib/libg++/libg++/src/gen/FPStack.ccP
+++ /dev/null
@@ -1,4 +0,0 @@
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include "<T>.FPStack.h"
diff --git a/contrib/libg++/libg++/src/gen/FPStack.hP b/contrib/libg++/libg++/src/gen/FPStack.hP
deleted file mode 100644
index de1310465f96..000000000000
--- a/contrib/libg++/libg++/src/gen/FPStack.hP
+++ /dev/null
@@ -1,114 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
- based on code by Marc Shapiro (shapiro@sor.inria.fr)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-
-#ifndef _<T>FPStack_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _<T>FPStack_h
-
-#include "<T>.FPlex.h"
-#include "<T>.Stack.h"
-
-class <T>FPStack : public <T>Stack
-{
- <T>FPlex p;
-
-public:
- <T>FPStack(int chunksize = DEFAULT_INITIAL_CAPACITY);
- <T>FPStack(const <T>FPStack& s);
- ~<T>FPStack();
-
- void operator = (const <T>FPStack&);
-
- void push(<T&> item);
- <T> pop();
- <T>& top();
- void del_top();
-
- int empty();
- int full();
- int length();
-
- void clear();
-
- int OK();
-
-};
-
-
-inline <T>FPStack::<T>FPStack(int chunksize) : p(chunksize) {}
-inline <T>FPStack::<T>FPStack(const <T>FPStack& s) : p(s.p) {}
-
-inline <T>FPStack::~<T>FPStack() {}
-
-inline void <T>FPStack::push(<T&>item)
-{
- p.add_high(item);
-}
-
-inline <T> <T>FPStack::pop()
-{
- <T> res = p.high_element();
- p.del_high();
- return res;
-}
-
-inline <T>& <T>FPStack::top()
-{
- return p.high_element();
-}
-
-inline void <T>FPStack::del_top()
-{
- p.del_high();
-}
-
-inline void <T>FPStack::operator =(const <T>FPStack& s)
-{
- p = s.p;
-}
-
-inline int <T>FPStack::empty()
-{
- return p.empty();
-}
-
-inline int <T>FPStack::full()
-{
- return p.full();
-}
-
-inline int <T>FPStack::length()
-{
- return p.length();
-}
-
-inline int <T>FPStack::OK()
-{
- return p.OK();
-}
-
-inline void <T>FPStack::clear()
-{
- p.clear();
-}
-
-#endif
diff --git a/contrib/libg++/libg++/src/gen/FPlex.ccP b/contrib/libg++/libg++/src/gen/FPlex.ccP
deleted file mode 100644
index 980870d86755..000000000000
--- a/contrib/libg++/libg++/src/gen/FPlex.ccP
+++ /dev/null
@@ -1,167 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
- based on code by Marc Shapiro (shapiro@sor.inria.fr)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include "<T>.FPlex.h"
-
-
-<T>FPlex:: <T>FPlex()
-{
- lo = fnc = 0;
- csize = DEFAULT_INITIAL_CAPACITY;
- <T>* data = new <T>[csize];
- hd = new <T>IChunk(data, lo, lo, fnc, csize);
-}
-
-<T>FPlex:: <T>FPlex(int maxsize)
-{
- if (maxsize == 0) error("invalid constructor specification");
- lo = fnc = 0;
- if (maxsize > 0)
- {
- csize = maxsize;
- <T>* data = new <T>[csize];
- hd = new <T>IChunk(data, lo, lo, fnc, csize);
- }
- else
- {
- csize = -maxsize;
- <T>* data = new <T>[csize];
- hd = new <T>IChunk(data, maxsize, lo, fnc, fnc);
- }
-}
-
-
-<T>FPlex:: <T>FPlex(int l, int maxsize)
-{
- if (maxsize == 0) error("invalid constructor specification");
- lo = fnc = l;
- if (maxsize > 0)
- {
- csize = maxsize;
- <T>* data = new <T>[csize];
- hd = new <T>IChunk(data, lo, lo, fnc, csize+lo);
- }
- else
- {
- csize = -maxsize;
- <T>* data = new <T>[csize];
- hd = new <T>IChunk(data, maxsize+lo, lo, fnc, fnc);
- }
-}
-
-<T>FPlex:: <T>FPlex(int l, int hi, const <T&> initval, int maxsize)
-{
- lo = l;
- fnc = hi + 1;
- if (maxsize >= 0)
- {
- csize = maxsize;
- if (csize < fnc - lo)
- csize = fnc - lo;
- <T>* data = new <T>[csize];
- hd = new <T>IChunk(data, lo, lo, fnc, csize);
- }
- else
- {
- csize = -maxsize;
- if (csize < fnc - lo)
- csize = fnc - lo;
- <T>* data = new <T>[csize];
- hd = new <T>IChunk(data, -csize, lo, fnc, fnc);
- }
- fill(initval);
-}
-
-<T>FPlex::<T>FPlex(const <T>FPlex& a)
-{
- lo = a.lo;
- fnc = a.fnc;
- csize = fnc - lo;
- if (csize < a.csize) csize = a.csize;
- <T>* data = new <T> [csize];
- hd = new <T>IChunk(data, lo, lo, fnc, lo+csize);
- for (int i = a.low(); i < a.fence(); a.next(i)) (*this)[i] = a[i];
-}
-
-void <T>FPlex::operator= (const <T>FPlex& a)
-{
- if (&a != this)
- {
- del_chunk(hd);
- lo = a.lo;
- fnc = a.fnc;
- csize = fnc - lo;
- if (csize < a.csize) csize = a.csize;
- <T>* data = new <T> [csize];
- hd = new <T>IChunk(data, lo, lo, fnc, lo+csize);
- for (int i = a.low(); i < a.fence(); a.next(i)) (*this)[i] = a[i];
- }
-}
-
-
-void <T>FPlex::reverse()
-{
- <T> tmp;
- int l = lo;
- int h = fnc - 1;
- while (l < h)
- {
- tmp = (*this)[l];
- (*this)[l] = (*this)[h];
- (*this)[h] = tmp;
- next(l);
- prev(h);
- }
-}
-
-void <T>FPlex::fill(const <T&> x)
-{
- for (int i = lo; i < fnc; ++i) (*this)[i] = x;
-}
-
-void <T>FPlex::fill(const <T&> x, int lo, int hi)
-{
- for (int i = lo; i <= hi; ++i) (*this)[i] = x;
-}
-
-void <T>FPlex::clear()
-{
- if (fnc != lo)
- {
- hd->clear(lo);
- fnc = lo;
- }
-}
-
-int <T>FPlex::OK () const
-{
- int v = hd != 0; // hd exists
- v &= hd-><T>IChunk::OK(); // and is OK
- v &= fnc - lo <= hd->size(); // and has enough space
- v &= lo <= fnc; // plex indices consistent
- v &= lo == hd->low_index(); // and match those
- v &= fnc == hd->fence_index(); // of chunk
- v &= one_chunk(); // and only one chunk
- if (!v) error("invariant failure");
- return v;
-}
-
diff --git a/contrib/libg++/libg++/src/gen/FPlex.hP b/contrib/libg++/libg++/src/gen/FPlex.hP
deleted file mode 100644
index 03cf96d20ba7..000000000000
--- a/contrib/libg++/libg++/src/gen/FPlex.hP
+++ /dev/null
@@ -1,253 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
- based on code by Marc Shapiro (shapiro@sor.inria.fr)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifndef _<T>FPlex_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _<T>FPlex_h 1
-
-#include "<T>.Plex.h"
-
-class <T>FPlex : public <T>Plex
-{
-public:
- <T>FPlex(); // set low = 0;
- // fence = 0;
- // csize = default
-
- <T>FPlex(int maxsize); // low = 0;
- // fence = 0;
- // csize = maxsize
-
- <T>FPlex(int lo, // low = lo;
- int maxsize); // fence=lo
- // csize = maxsize
-
- <T>FPlex(int lo, // low = lo
- int hi, // fence = hi+1
- const <T&> initval,// fill with initval,
- int maxsize = 0); // csize = maxsize
- // or fence - lo if 0
-
- <T>FPlex(const <T>FPlex&); // X(X&)
-
- inline ~<T>FPlex();
-
- void operator= (const <T>FPlex&);
-
-// virtuals
-
- inline <T>& high_element ();
- inline <T>& low_element ();
-
- inline const <T>& high_element () const;
- inline const <T>& low_element () const;
-
- inline Pix first() const;
- inline Pix last() const;
- inline void prev(Pix& ptr) const;
- inline void next(Pix& ptr) const;
- inline int owns(Pix p) const;
- inline <T>& operator () (Pix p);
- inline const <T>& operator () (Pix p) const;
-
- inline int low() const;
- inline int high() const;
- inline int valid(int idx) const;
- inline void prev(int& idx) const;
- inline void next(int& x) const;
- inline <T>& operator [] (int index);
- inline const <T>& operator [] (int index) const;
-
- inline int Pix_to_index(Pix p) const;
- inline Pix index_to_Pix(int idx) const;
-
- inline int can_add_high() const;
- inline int can_add_low() const;
- inline int full() const;
-
- inline int add_high(const <T&> elem);
- inline int del_high ();
- inline int add_low (const <T&> elem);
- inline int del_low ();
-
- void fill(const <T&> x);
- void fill(const <T&> x, int from, int to);
- void clear();
- void reverse();
-
- int OK () const;
-};
-
-
-inline int <T>FPlex::valid (int idx) const
-{
- return idx >= lo && idx < fnc;
-}
-
-inline int <T>FPlex::low() const
-{
- return lo;
-}
-
-inline int <T>FPlex::high() const
-{
- return fnc - 1;
-}
-
-inline Pix <T>FPlex::first() const
-{
- return (Pix)(hd-><T>IChunk::first_pointer());
-}
-
-inline void <T>FPlex::prev(Pix& p) const
-{
- p = Pix(hd-><T>IChunk::pred((<T>*) p));
-}
-
-inline void <T>FPlex::next(Pix& p) const
-{
- p = Pix(hd-><T>IChunk::succ((<T>*) p));
-}
-
-inline Pix <T>FPlex::last() const
-{
- return Pix(hd-><T>IChunk::last_pointer());
-}
-
-inline int <T>FPlex::full () const
-{
- return fnc - lo == csize;
-}
-
-inline void <T>FPlex::prev(int& idx) const
-{
- --idx;
-}
-
-inline void <T>FPlex::next(int& idx) const
-{
- ++idx;
-}
-
-inline <T>& <T>FPlex:: operator [] (int idx)
-{
- if (idx < lo || idx >= fnc) index_error();
- return *(hd->pointer_to(idx));
-}
-
-inline <T>& <T>FPlex:: operator () (Pix p)
-{
- return *((<T>*)p);
-}
-
-inline <T>& <T>FPlex::low_element ()
-{
- if (empty()) index_error();
- return *(hd->pointer_to(lo));
-}
-
-inline <T>& <T>FPlex::high_element ()
-{
- if (empty()) index_error();
- return *(hd->pointer_to(fnc - 1));
-}
-
-inline const <T>& <T>FPlex:: operator [] (int idx) const
-{
- if (idx < lo || idx >= fnc) index_error();
- return *(hd->pointer_to(idx));
-}
-
-inline const <T>& <T>FPlex:: operator () (Pix p) const
-{
- return *((const <T>*)p);
-}
-
-inline const <T>& <T>FPlex::low_element () const
-{
- if (empty()) index_error();
- return *(hd->pointer_to(lo));
-}
-
-inline const <T>& <T>FPlex::high_element () const
-{
- if (empty()) index_error();
- return *(hd->pointer_to(fnc - 1));
-}
-
-inline int <T>FPlex::can_add_high() const
-{
- return hd->can_grow_high();
-}
-
-inline int <T>FPlex::can_add_low() const
-{
- return hd->can_grow_low();
-}
-
-inline int <T>FPlex::add_high(const <T&> elem)
-{
- if (!can_add_high()) full_error();
- *((hd-><T>IChunk::grow_high())) = elem;
- return fnc++;
-}
-
-inline int <T>FPlex::del_high ()
-{
- if (empty()) empty_error();
- hd-><T>IChunk::shrink_high();
- return --fnc - 1;
-}
-
-inline int <T>FPlex::add_low (const <T&> elem)
-{
- if (!can_add_low()) full_error();
- *((hd-><T>IChunk::grow_low())) = elem;
- return --lo;
-}
-
-inline int <T>FPlex::del_low ()
-{
- if (empty()) empty_error();
- hd-><T>IChunk::shrink_low();
- return ++lo;
-}
-
-inline int <T>FPlex::owns (Pix p) const
-{
- return hd->actual_pointer((<T>*)p);
-}
-
-inline int <T>FPlex::Pix_to_index(Pix p) const
-{
- if (!hd->actual_pointer((const <T>*)p)) index_error();
- return hd->index_of((const <T>*)p);
-}
-
-inline Pix <T>FPlex::index_to_Pix(int idx) const
-{
- if (idx < lo || idx >= fnc) index_error();
- return Pix(hd->pointer_to(idx));
-}
-
-inline <T>FPlex::~<T>FPlex() {}
-
-#endif
diff --git a/contrib/libg++/libg++/src/gen/List.ccP b/contrib/libg++/libg++/src/gen/List.ccP
deleted file mode 100644
index f672cf2db637..000000000000
--- a/contrib/libg++/libg++/src/gen/List.ccP
+++ /dev/null
@@ -1,972 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <builtin.h>
-#include "<T>.List.h"
-
-<T>ListNode Nil<T>ListNode;
-
-class init_Nil<T>ListNode
-{
-public:
- init_Nil<T>ListNode()
- {
- Nil<T>ListNode.tl = &Nil<T>ListNode;
- Nil<T>ListNode.ref = -1;
- }
-};
-
-static init_Nil<T>ListNode Nil<T>ListNode_initializer;
-
-<T>List& <T>List::operator = (const <T>List& a)
-{
- reference(a.P);
- dereference(P);
- P = a.P;
- return *this;
-}
-
-<T> <T>List::pop()
-{
- <T> res = P->hd;
- <T>ListNode* tail = P->tl;
- reference(tail);
- dereference(P);
- P = tail;
- return res;
-}
-
-void <T>List::set_tail(<T>List& a)
-{
- reference(a.P);
- dereference(P->tl);
- P->tl = a.P;
-}
-
-<T>List <T>List::nth(int n)
-{
- <T>ListNode* p;
- for ( p = P; n-- > 0; p = p->tl);
- reference(p);
- return <T>List(p);
-}
-
-<T>List <T>List::last()
-{
- <T>ListNode* p = P;
- if (p != &Nil<T>ListNode) while (p->tl != &Nil<T>ListNode) p = p->tl;
- reference(p);
- return <T>List(p);
-}
-
-void <T>List::append(<T>List& l)
-{
- <T>ListNode* p = P;
- <T>ListNode* a = l.P;
- reference(a);
- if (p != &Nil<T>ListNode)
- {
- while (p->tl != &Nil<T>ListNode) p = p->tl;
- p->tl = a;
- }
- else
- P = a;
-}
-
-int <T>List::length()
-{
- int l = 0;
- for (<T>ListNode* p = P; p != &Nil<T>ListNode; p = p->tl) ++l;
- return l;
-}
-
-<T>& <T>List::operator [] (int n)
-{
- <T>ListNode* p;
- for ( p = P; n-- > 0; p = p->tl);
- return (p->hd);
-}
-
-int operator == (const <T>List& x, const <T>List& y)
-{
- <T>ListNode* a = x.P;
- <T>ListNode* b = y.P;
-
- for (;;)
- {
- if (a == &Nil<T>ListNode)
- return b == &Nil<T>ListNode;
- else if (b == &Nil<T>ListNode)
- return 0;
- else if (<T>EQ(a->hd, b->hd))
- {
- a = a->tl;
- b = b->tl;
- }
- else
- return 0;
- }
-}
-
-
-void <T>List::apply(<T>Procedure f)
-{
- for(<T>ListNode* p = P; p != &Nil<T>ListNode; p = p->tl)
- (*f)((p->hd));
-}
-
-void <T>List::subst(<T&> old, <T&> repl)
-{
- for(<T>ListNode* p = P; p != &Nil<T>ListNode; p = p->tl)
- if (<T>EQ(p->hd, old))
- p->hd = repl;
-}
-
-<T> <T>List::reduce(<T>Combiner f, <T&> base)
-{
- <T> r = base;
- for(<T>ListNode* p = P; p != &Nil<T>ListNode; p = p->tl)
- r = (*f)(r, (p->hd));
- return r;
-}
-
-int <T>List::position(<T&> targ)
-{
- int l = 0;
- <T>ListNode* p = P;
- for (;;)
- {
- if (p == &Nil<T>ListNode)
- return -1;
- else if (<T>EQ(p->hd, targ))
- return l;
- else
- {
- ++l;
- p = p->tl;
- }
- }
-}
-
-int <T>List::contains(<T&> targ)
-{
- <T>ListNode* p = P;
- for (;;)
- {
- if (p == &Nil<T>ListNode)
- return 0;
- else if (<T>EQ(p->hd, targ))
- return 1;
- else
- p = p->tl;
- }
-}
-
-<T>List <T>List::find(<T&> targ)
-{
- <T>ListNode* p = P;
- while (p != &Nil<T>ListNode && !<T>EQ(p->hd, targ))
- p=p->tl;
- reference(p);
- return <T>List(p);
-}
-
-Pix <T>List::seek(<T&> targ) const
-{
- const <T>ListNode* p = P;
- for (;;)
- {
- if (p == &Nil<T>ListNode)
- return 0;
- else if (<T>EQ(p->hd, targ))
- return Pix(p);
- else
- p = p->tl;
- }
-}
-
-int <T>List::owns(Pix i)
-{
- <T>ListNode* p = P;
- for (;;)
- {
- if (p == &Nil<T>ListNode)
- return 0;
- else if (Pix(p) == i)
- return 1;
- else
- p = p->tl;
- }
-}
-
-<T>List <T>List::find(<T>List& target)
-{
- <T>ListNode* targ = target.P;
- if (targ == &Nil<T>ListNode)
- return <T>List(targ);
-
- <T>ListNode* p = P;
- while (p != &Nil<T>ListNode)
- {
- if (<T>EQ(p->hd, targ->hd))
- {
- <T>ListNode* a = p->tl;
- <T>ListNode* t = targ->tl;
- for(;;)
- {
- if (t == &Nil<T>ListNode)
- {
- reference(p);
- return <T>List(p);
- }
- else if (a == &Nil<T>ListNode || !<T>EQ(a->hd, t->hd))
- break;
- else
- {
- a = a->tl;
- t = t->tl;
- }
- }
- }
- p = p->tl;
- }
- return <T>List(&Nil<T>ListNode);
-}
-
-int <T>List::contains(<T>List& target)
-{
- <T>ListNode* targ = target.P;
- if (targ == &Nil<T>ListNode)
- return 0;
-
- <T>ListNode* p = P;
- while (p != &Nil<T>ListNode)
- {
- if (<T>EQ(p->hd, targ->hd))
- {
- <T>ListNode* a = p->tl;
- <T>ListNode* t = targ->tl;
- for(;;)
- {
- if (t == &Nil<T>ListNode)
- return 1;
- else if (a == &Nil<T>ListNode || !<T>EQ(a->hd, t->hd))
- break;
- else
- {
- a = a->tl;
- t = t->tl;
- }
- }
- }
- p = p->tl;
- }
- return 0;
-}
-
-void <T>List::del(<T&> targ)
-{
- <T>ListNode* h = P;
- // Former bug: targ can be a reference to a element in this list
- // So do not dereference a element if targ is the element,
- // until targ is no longer needed, as dereferencing it may destroy it.
- <T>ListNode* to_be_dereferenced = 0;
-
- for (;;)
- {
- if (h == &Nil<T>ListNode)
- {
- P = h;
- if (to_be_dereferenced)
- dereference(to_be_dereferenced);
- return;
- }
- else if (<T>EQ(h->hd, targ))
- {
- <T>ListNode* nxt = h->tl;
- reference(nxt);
- if ((&targ == &h->hd) && (to_be_dereferenced == 0))
- to_be_dereferenced = h;
- else
- dereference(h);
- h = nxt;
- }
- else
- break;
- }
-
- <T>ListNode* trail = h;
- <T>ListNode* p = h->tl;
- while (p != &Nil<T>ListNode)
- {
- if (<T>EQ(p->hd, targ))
- {
- <T>ListNode* nxt = p->tl;
- reference(nxt);
- if ((&targ == &p->hd) && (to_be_dereferenced == 0))
- to_be_dereferenced = p;
- else
- dereference(p);
- trail->tl = nxt;
- p = nxt;
- }
- else
- {
- trail = p;
- p = p->tl;
- }
- }
- P = h;
- if (to_be_dereferenced)
- dereference(to_be_dereferenced);
-}
-
-void <T>List::del(<T>Predicate f)
-{
- <T>ListNode* h = P;
- for (;;)
- {
- if (h == &Nil<T>ListNode)
- {
- P = h;
- return;
- }
- else if ((*f)(h->hd))
- {
- <T>ListNode* nxt = h->tl;
- reference(nxt);
- dereference(h);
- h = nxt;
- }
- else
- break;
- }
-
- <T>ListNode* trail = h;
- <T>ListNode* p = h->tl;
- while (p != &Nil<T>ListNode)
- {
- if ((*f)(p->hd))
- {
- <T>ListNode* nxt = p->tl;
- reference(nxt);
- dereference(p);
- trail->tl = nxt;
- p = nxt;
- }
- else
- {
- trail = p;
- p = p->tl;
- }
- }
- P = h;
-}
-
-void <T>List::select(<T>Predicate f)
-{
- <T>ListNode* h = P;
- for (;;)
- {
- if (h == &Nil<T>ListNode)
- {
- P = h;
- return;
- }
- else if (!(*f)(h->hd))
- {
- <T>ListNode* nxt = h->tl;
- reference(nxt);
- dereference(h);
- h = nxt;
- }
- else
- break;
- }
- <T>ListNode* trail = h;
- <T>ListNode* p = h->tl;
- while (p != &Nil<T>ListNode)
- {
- if (!(*f)(p->hd))
- {
- <T>ListNode* nxt = p->tl;
- reference(nxt);
- dereference(p);
- trail->tl = nxt;
- p = nxt;
- }
- else
- {
- trail = p;
- p = p->tl;
- }
- }
- P = h;
-}
-
-void <T>List::reverse()
-{
- <T>ListNode* l = &Nil<T>ListNode;
- <T>ListNode* p = P;
- while (p != &Nil<T>ListNode)
- {
- <T>ListNode* nxt = p->tl;
- p->tl = l;
- l = p;
- p = nxt;
- }
- P = l;
-}
-
-
-<T>List copy(const <T>List& x)
-{
- const <T>ListNode* a = x.P;
- if (a == &Nil<T>ListNode)
- return <T>List(&Nil<T>ListNode);
- else
- {
- <T>ListNode* h = new<T>ListNode(a->hd);
- <T>ListNode* trail = h;
- for(a = a->tl; a != &Nil<T>ListNode; a = a->tl)
- {
- <T>ListNode* n = new<T>ListNode(a->hd);
- trail->tl = n;
- trail = n;
- }
- trail->tl = &Nil<T>ListNode;
- return <T>List(h);
- }
-}
-
-
-<T>List subst(<T&> old, <T&> repl, <T>List& x)
-{
- <T>ListNode* a = x.P;
- if (a == &Nil<T>ListNode)
- return <T>List(a);
- else
- {
- <T>ListNode* h = new <T>ListNode;
- h->ref = 1;
- if (<T>EQ(a->hd, old))
- h->hd = repl;
- else
- h->hd = a->hd;
- <T>ListNode* trail = h;
- for(a = a->tl; a != &Nil<T>ListNode; a = a->tl)
- {
- <T>ListNode* n = new <T>ListNode;
- n->ref = 1;
- if (<T>EQ(a->hd, old))
- n->hd = repl;
- else
- n->hd = a->hd;
- trail->tl = n;
- trail = n;
- }
- trail->tl = &Nil<T>ListNode;
- return <T>List(h);
- }
-}
-
-<T>List combine(<T>Combiner f, <T>List& x, <T>List& y)
-{
- <T>ListNode* a = x.P;
- <T>ListNode* b = y.P;
- if (a == &Nil<T>ListNode || b == &Nil<T>ListNode)
- return <T>List(&Nil<T>ListNode);
- else
- {
- <T>ListNode* h = new<T>ListNode((*f)(a->hd, b->hd));
- <T>ListNode* trail = h;
- a = a->tl;
- b = b->tl;
- while (a != &Nil<T>ListNode && b != &Nil<T>ListNode)
- {
- <T>ListNode* n = new<T>ListNode((*f)(a->hd, b->hd));
- trail->tl = n;
- trail = n;
- a = a->tl;
- b = b->tl;
- }
- trail->tl = &Nil<T>ListNode;
- return <T>List(h);
- }
-}
-
-<T>List reverse(<T>List& x)
-{
- <T>ListNode* a = x.P;
- if (a == &Nil<T>ListNode)
- return <T>List(a);
- else
- {
- <T>ListNode* l = new<T>ListNode(a->hd);
- l->tl = &Nil<T>ListNode;
- for(a = a->tl; a != &Nil<T>ListNode; a = a->tl)
- {
- <T>ListNode* n = new<T>ListNode(a->hd);
- n->tl = l;
- l = n;
- }
- return <T>List(l);
- }
-}
-
-<T>List append(<T>List& x, <T>List& y)
-{
- <T>ListNode* a = x.P;
- <T>ListNode* b = y.P;
- reference(b);
- if (a != &Nil<T>ListNode)
- {
- <T>ListNode* h = new<T>ListNode(a->hd);
- <T>ListNode* trail = h;
- for(a = a->tl; a != &Nil<T>ListNode; a = a->tl)
- {
- <T>ListNode* n = new<T>ListNode(a->hd);
- trail->tl = n;
- trail = n;
- }
- trail->tl = b;
- return <T>List(h);
- }
- else
- return <T>List(b);
-}
-
-void <T>List::prepend(<T>List& y)
-{
- <T>ListNode* b = y.P;
- if (b != &Nil<T>ListNode)
- {
- <T>ListNode* h = new<T>ListNode(b->hd);
- <T>ListNode* trail = h;
- for(b = b->tl; b != &Nil<T>ListNode; b = b->tl)
- {
- <T>ListNode* n = new<T>ListNode(b->hd);
- trail->tl = n;
- trail = n;
- }
- trail->tl = P;
- P = h;
- }
-}
-
-<T>List concat(<T>List& x, <T>List& y)
-{
- <T>ListNode* a = x.P;
- <T>ListNode* b = y.P;
- if (a != &Nil<T>ListNode)
- {
- <T>ListNode* h = new<T>ListNode(a->hd);
- <T>ListNode* trail = h;
- for(a = a->tl; a != &Nil<T>ListNode; a = a->tl)
- {
- <T>ListNode* n = new<T>ListNode(a->hd);
- trail->tl = n;
- trail = n;
- };
- for(;b != &Nil<T>ListNode; b = b->tl)
- {
- <T>ListNode* n = new<T>ListNode(b->hd);
- trail->tl = n;
- trail = n;
- }
- trail->tl = &Nil<T>ListNode;
- return <T>List(h);
- }
- else if (b != &Nil<T>ListNode)
- {
- <T>ListNode* h = new<T>ListNode(b->hd);
- <T>ListNode* trail = h;
- for(b = b->tl; b != &Nil<T>ListNode; b = b->tl)
- {
- <T>ListNode* n = new<T>ListNode(b->hd);
- trail->tl = n;
- trail = n;
- }
- trail->tl = &Nil<T>ListNode;
- return <T>List(h);
- }
- else
- return <T>List(&Nil<T>ListNode);
-}
-
-<T>List select(<T>Predicate f, <T>List& x)
-{
- <T>ListNode* a = x.P;
- <T>ListNode* h = &Nil<T>ListNode;
- while (a != &Nil<T>ListNode)
- {
- if ((*f)(a->hd))
- {
- h = new<T>ListNode(a->hd);
- <T>ListNode* trail = h;
- for(a = a->tl; a != &Nil<T>ListNode; a = a->tl)
- {
- if ((*f)(a->hd))
- {
- <T>ListNode* n = new<T>ListNode(a->hd);
- trail->tl = n;
- trail = n;
- }
- }
- trail->tl = &Nil<T>ListNode;
- break;
- }
- else
- a = a->tl;
- }
- return <T>List(h);
-}
-
-<T>List remove(<T>Predicate f, <T>List& x)
-{
- <T>ListNode* a = x.P;
- <T>ListNode* h = &Nil<T>ListNode;
- while (a != &Nil<T>ListNode)
- {
- if (!(*f)(a->hd))
- {
- h = new<T>ListNode(a->hd);
- <T>ListNode* trail = h;
- for(a = a->tl; a != &Nil<T>ListNode; a = a->tl)
- {
- if (!(*f)(a->hd))
- {
- <T>ListNode* n = new<T>ListNode(a->hd);
- trail->tl = n;
- trail = n;
- }
- }
- trail->tl = &Nil<T>ListNode;
- break;
- }
- else
- a = a->tl;
- }
- return <T>List(h);
-}
-
-<T>List remove(<T&> targ, <T>List& x)
-{
- <T>ListNode* a = x.P;
- <T>ListNode* h = &Nil<T>ListNode;
- while (a != &Nil<T>ListNode)
- {
- if (!(<T>EQ(a->hd, targ)))
- {
- h = new<T>ListNode(a->hd);
- <T>ListNode* trail = h;
- for(a = a->tl; a != &Nil<T>ListNode; a = a->tl)
- {
- if (!<T>EQ(a->hd, targ))
- {
- <T>ListNode* n = new<T>ListNode(a->hd);
- trail->tl = n;
- trail = n;
- }
- }
- trail->tl = &Nil<T>ListNode;
- break;
- }
- else
- a = a->tl;
- }
- return <T>List(h);
-}
-
-<T>List map(<T>Mapper f, <T>List& x)
-{
- <T>ListNode* a = x.P;
- <T>ListNode* h = &Nil<T>ListNode;
- if (a != &Nil<T>ListNode)
- {
- h = new<T>ListNode((*f)(a->hd));
- <T>ListNode* trail = h;
- for(a = a->tl; a != &Nil<T>ListNode; a = a->tl)
- {
- <T>ListNode* n = new<T>ListNode((*f)(a->hd));
- trail->tl = n;
- trail = n;
- }
- trail->tl = &Nil<T>ListNode;
- }
- return <T>List(h);
-}
-
-
-<T>List merge(<T>List& x, <T>List& y, <T>Comparator f)
-{
- <T>ListNode* a = x.P;
- <T>ListNode* b = y.P;
-
- if (a == &Nil<T>ListNode)
- {
- if (b == &Nil<T>ListNode)
- return <T>List(&Nil<T>ListNode);
- else
- return copy(y);
- }
- else if (b == &Nil<T>ListNode)
- return copy(x);
-
- <T>ListNode* h = new <T>ListNode;
- h->ref = 1;
- if ((*f)(a->hd, b->hd) <= 0)
- {
- h->hd = a->hd;
- a = a->tl;
- }
- else
- {
- h->hd = b->hd;
- b = b->tl;
- }
-
- <T>ListNode* r = h;
-
- for(;;)
- {
- if (a == &Nil<T>ListNode)
- {
- while (b != &Nil<T>ListNode)
- {
- <T>ListNode* n = new <T>ListNode;
- n->ref = 1;
- n->hd = b->hd;
- r->tl = n;
- r = n;
- b = b->tl;
- }
- r->tl = &Nil<T>ListNode;
- return <T>List(h);
- }
- else if (b == &Nil<T>ListNode)
- {
- while (a != &Nil<T>ListNode)
- {
- <T>ListNode* n = new <T>ListNode;
- n->ref = 1;
- n->hd = a->hd;
- r->tl = n;
- r = n;
- a = a->tl;
- }
- r->tl = &Nil<T>ListNode;
- return <T>List(h);
- }
- else if ((*f)(a->hd, b->hd) <= 0)
- {
- <T>ListNode* n = new <T>ListNode;
- n->ref = 1;
- n->hd = a->hd;
- r->tl = n;
- r = n;
- a = a->tl;
- }
- else
- {
- <T>ListNode* n = new <T>ListNode;
- n->ref = 1;
- n->hd = b->hd;
- r->tl = n;
- r = n;
- b = b->tl;
- }
- }
-}
-
-void <T>List::sort(<T>Comparator f)
-{
- // strategy: place runs in queue, merge runs until done
- // This is often very fast
-
- if (P == &Nil<T>ListNode || P->tl == &Nil<T>ListNode)
- return;
-
- int qlen = 250; // guess a good queue size, realloc if necessary
-
- <T>ListNode** queue = (<T>ListNode**)malloc(qlen * sizeof(<T>ListNode*));
-
- <T>ListNode* h = P;
- <T>ListNode* a = h;
- <T>ListNode* b = a->tl;
- int qin = 0;
-
- while (b != &Nil<T>ListNode)
- {
- if ((*f)(a->hd, b->hd) > 0)
- {
- if (h == a) // minor optimization: ensure runlen >= 2
- {
- h = b;
- a->tl = b->tl;
- b->tl = a;
- b = a->tl;
- }
- else
- {
- if (qin >= qlen)
- {
- qlen *= 2;
- queue = (<T>ListNode**)realloc(queue, qlen * sizeof(<T>ListNode*));
- }
- queue[qin++] = h;
- a->tl = &Nil<T>ListNode;
- h = a = b;
- b = b->tl;
- }
- }
- else
- {
- a = b;
- b = b->tl;
- }
- }
-
- int count = qin;
- queue[qin] = h;
- if (++qin >= qlen) qin = 0;
- int qout = 0;
-
- while (count-- > 0)
- {
- a = queue[qout];
- if (++qout >= qlen) qout = 0;
- b = queue[qout];
- if (++qout >= qlen) qout = 0;
-
- if ((*f)(a->hd, b->hd) <= 0)
- {
- h = a;
- a = a->tl;
- }
- else
- {
- h = b;
- b = b->tl;
- }
- queue[qin] = h;
- if (++qin >= qlen) qin = 0;
-
- for (;;)
- {
- if (a == &Nil<T>ListNode)
- {
- h->tl = b;
- break;
- }
- else if (b == &Nil<T>ListNode)
- {
- h->tl = a;
- break;
- }
- else if ((*f)(a->hd, b->hd) <= 0)
- {
- h->tl = a;
- h = a;
- a = a->tl;
- }
- else
- {
- h->tl = b;
- h = b;
- b = b->tl;
- }
- }
- }
- P = queue[qout];
- free(queue);
-}
-
-int <T>List::list_length()
-{
- <T>ListNode* fast = P;
- if (fast == &Nil<T>ListNode)
- return 0;
-
- <T>ListNode* slow = fast->tl;
- if (slow == &Nil<T>ListNode)
- return 1;
-
- fast = slow->tl;
- int n = 2;
-
- for (;;)
- {
- if (fast == &Nil<T>ListNode)
- return n;
- else if (fast->tl == &Nil<T>ListNode)
- return n+1;
- else if (fast == slow)
- return -1;
- else
- {
- n += 2;
- fast = fast->tl->tl;
- slow = slow->tl;
- }
- }
-}
-
-void <T>List::error(const char* msg)
-{
- (*lib_error_handler)("List", msg);
-}
-
-int <T>List::OK()
-{
- int v = P != 0; // have a node
- // check that all nodes OK, even if circular:
-
- <T>ListNode* fast = P;
- if (fast != &Nil<T>ListNode)
- {
- v &= fast->ref != 0;
- <T>ListNode* slow = fast->tl;
- v &= slow->ref != 0;
- if (v && slow != &Nil<T>ListNode)
- {
- fast = slow->tl;
- v &= fast->ref != 0;
- while (v)
- {
- if (fast == &Nil<T>ListNode)
- break;
- else if (fast->tl == &Nil<T>ListNode)
- break;
- else if (fast == slow)
- break;
- else
- {
- v &= fast->ref != 0 && slow->ref != 0;
- fast = fast->tl->tl;
- slow = slow->tl;
- }
- }
- }
- }
- if (!v) error ("invariant failure");
- return v;
-}
diff --git a/contrib/libg++/libg++/src/gen/List.hP b/contrib/libg++/libg++/src/gen/List.hP
deleted file mode 100644
index 4551e3e47ef2..000000000000
--- a/contrib/libg++/libg++/src/gen/List.hP
+++ /dev/null
@@ -1,279 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-
-#ifndef _<T>List_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _<T>List_h 1
-
-#include <Pix.h>
-#include "<T>.defs.h"
-
-#ifndef _<T>_typedefs
-#define _<T>_typedefs 1
-typedef void (*<T>Procedure)(<T&>);
-typedef <T> (*<T>Mapper)(<T&>);
-typedef <T> (*<T>Combiner)(<T&>, <T&>);
-typedef int (*<T>Predicate)(<T&>);
-typedef int (*<T>Comparator)(<T&>, <T&>);
-#endif
-
-struct <T>ListNode
-{
- <T>ListNode* tl;
- short ref;
- <T> hd;
-};
-
-extern <T>ListNode Nil<T>ListNode;
-
-class <T>List
-{
-protected:
- <T>ListNode* P;
-
- <T>List(<T>ListNode* p);
-public:
- <T>List();
- <T>List(<T&> head);
- <T>List(<T&> head, const <T>List& tl);
- <T>List(<T>List& a);
- <T>List(Pix p);
- ~<T>List();
-
- <T>List& operator = (const <T>List& a);
-
- int null();
- int valid();
- operator const void* ();
- int operator ! ();
-
- int length();
- int list_length();
-
- <T>& get();
- <T>& head();
- <T>& operator [] (int n);
-
- <T>List nth(int n);
- <T>List tail();
- <T>List last();
-
- <T>List find(<T&> targ);
- <T>List find(<T>List& targ);
- int contains(<T&> targ);
- int contains(<T>List& targ);
- int position(<T&> targ);
-
- friend <T>List copy(const <T>List& a);
- friend <T>List concat(<T>List& a, <T>List& b);
- friend <T>List append(<T>List& a, <T>List& b);
- friend <T>List map(<T>Mapper f, <T>List& a);
- friend <T>List merge(<T>List& a, <T>List& b, <T>Comparator f);
- friend <T>List combine(<T>Combiner f, <T>List& a, <T>List& b);
- friend <T>List reverse(<T>List& a);
- friend <T>List select(<T>Predicate f, <T>List& a);
-#undef remove
- friend <T>List remove(<T&> targ, <T>List& a);
- friend <T>List remove(<T>Predicate f, <T>List& a);
- friend <T>List subst(<T&> old, <T&> repl, <T>List& a);
-
- void push(<T&> x);
- <T> pop();
-
- void set_tail(<T>List& p);
- void append(<T>List& p);
- void prepend(<T>List& p);
- void del(<T&> targ);
- void del(<T>Predicate f);
- void select(<T>Predicate f);
- void subst(<T&> old, <T&> repl);
- void reverse();
- void sort(<T>Comparator f);
-
- void apply(<T>Procedure f);
- <T> reduce(<T>Combiner f, <T&> base);
-
- friend int operator == (const <T>List& a, const <T>List& b);
- friend inline int operator != (const <T>List& a, const <T>List& b);
-
- Pix first();
- void next(Pix& p);
- Pix seek(<T&> item) const;
- <T>& operator () (Pix p);
- const <T>& operator () (Pix p) const;
- int owns(Pix p);
-
- void error(const char*);
- int OK();
-};
-
-
-inline void reference(<T>ListNode* p)
-{
- if (p->ref >= 0) ++p->ref;
-}
-
-inline void dereference(<T>ListNode* p)
-{
- while (p->ref > 0 && --p->ref == 0)
- {
- <T>ListNode* n = p->tl;
- delete(p);
- p = n;
- }
-}
-
-
-inline <T>ListNode* new<T>ListNode(const <T&> h)
-{
- <T>ListNode* p = new <T>ListNode;
- p->ref = 1;
- p->hd = h;
- return p;
-}
-
-inline <T>ListNode* new<T>ListNode(<T&> h, <T>ListNode* t)
-{
- <T>ListNode* p = new <T>ListNode;
- p->ref = 1;
- p->hd = h;
- p->tl = t;
- return p;
-}
-
-
-inline <T>List::~<T>List()
-{
- dereference(P);
-}
-
-inline <T>List::<T>List()
-{
- P = &Nil<T>ListNode;
-}
-
-inline <T>List::<T>List(<T>ListNode* p)
-{
- P = p;
-}
-
-inline <T>List::<T>List(<T&> head)
-{
- P = new<T>ListNode(head);
- P->tl = &Nil<T>ListNode;
-}
-
-inline <T>List::<T>List(<T&> head, const <T>List& tl)
-{
- P = new<T>ListNode(head, tl.P);
- reference(P->tl);
-}
-
-inline <T>List::<T>List(<T>List& a)
-{
- reference(a.P);
- P = a.P;
-}
-
-
-inline <T>& <T>List::get()
-{
- return P->hd;
-}
-
-inline <T>& <T>List::head()
-{
- return P->hd;
-}
-
-
-inline <T>List <T>List::tail()
-{
- reference(P->tl);
- return <T>List(P->tl);
-}
-
-
-
-inline int <T>List::null()
-{
- return P == &Nil<T>ListNode;
-}
-
-inline int <T>List::valid()
-{
- return P != &Nil<T>ListNode;
-}
-
-inline <T>List::operator const void* ()
-{
- return (P == &Nil<T>ListNode)? 0 : this;
-}
-
-inline int <T>List::operator ! ()
-{
- return (P == &Nil<T>ListNode);
-}
-
-
-inline void <T>List::push(<T&> head)
-{
- <T>ListNode* oldp = P;
- P = new<T>ListNode(head, oldp);
-}
-
-
-inline int operator != (const <T>List& x, const <T>List& y)
-{
- return !(x == y);
-}
-
-inline Pix <T>List::first()
-{
- return (P == &Nil<T>ListNode)? 0 : Pix(P);
-}
-
-inline <T>& <T>List::operator () (Pix p)
-{
- return ((<T>ListNode*)p)->hd;
-}
-
-inline const <T>& <T>List::operator () (Pix p) const
-{
- return ((const <T>ListNode*)p)->hd;
-}
-
-inline void <T>List::next(Pix& p)
-{
- if (p != 0)
- {
- p = Pix(((<T>ListNode*)p)->tl);
- if (p == &Nil<T>ListNode) p = 0;
- }
-}
-
-inline <T>List::<T>List(Pix p)
-{
- P = (<T>ListNode*)p;
- reference(P);
-}
-
-#endif
diff --git a/contrib/libg++/libg++/src/gen/MPlex.ccP b/contrib/libg++/libg++/src/gen/MPlex.ccP
deleted file mode 100644
index 8c306b5e8a65..000000000000
--- a/contrib/libg++/libg++/src/gen/MPlex.ccP
+++ /dev/null
@@ -1,848 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
- based on code by Marc Shapiro (shapiro@sor.inria.fr)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include "<T>.MPlex.h"
-
-// <T>MChunk support
-
-
-<T>MChunk::<T>MChunk(<T>* d,
- int baseidx,
- int lowidx,
- int fenceidx,
- int topidx)
- : <T>IChunk(d, baseidx, lowidx, fenceidx, topidx)
-{
- unused = fence - low;
- unsigned msize = (top - base)/_MAP_BITS + 1;
- map = (unsigned long *) (new long[msize]);
- memset((void*)map, 0, msize * sizeof(long));
-}
-
-void <T>MChunk:: shrink_high ()
-{
- if (fence <= low) empty_error();
- --fence;
- if (!valid(fence))
- --unused;
- else
- free(fence);
- reset_high();
-}
-
-void <T>MChunk:: shrink_low ()
-{
- if (fence <= low) empty_error();
- if (!valid(low))
- --unused;
- else
- free(low);
- ++low;
- reset_low();
-}
-
-void <T>MChunk::clear(int lo)
-{
- int s = top - base;
- low = base = fence = lo;
- top = base + s;
- unused = 0;
- memset((void*)map, 0, ((top - base)/_MAP_BITS + 1) * sizeof(long));
-}
-
-void <T>MChunk::cleardown(int hi)
-{
- int s = top - base;
- low = top = fence = hi;
- base = top - s;
- unused = 0;
- memset((void*)map, 0, ((top - base)/_MAP_BITS + 1) * sizeof(long));
-}
-
-int <T>MChunk::del(int idx)
-{
- if (idx < low || idx >= fence) index_error();
- int v = valid(idx);
- if (v)
- {
- free(idx);
- ++unused;
- }
- return v;
-}
-
-
-int <T>MChunk::undel(int idx)
-{
- if (idx < low || idx >= fence) index_error();
- int v = valid(idx);
- if (!v)
- {
- mark(idx);
- --unused;
- }
- return v;
-}
-
-int <T>MChunk::unused_index() const
-{
- if (unused_indices() == 0) index_error();
- int slot;
- if (low == base) // can traverse 32 slots at a time
- {
- int blk = 0;
- while (map[blk] == ~0UL) ++blk;
- slot = blk * _MAP_BITS + base;
- }
- else
- slot = low;
-
- while(valid(slot)) ++slot;
- return slot;
-}
-
-int <T>MChunk::first_index() const
-{
- if (empty()) return fence;
- int slot;
- if (low == base)
- {
- int blk = 0;
- while (map[blk] == 0) ++blk;
- slot = blk * _MAP_BITS + base;
- }
- else
- slot = low;
-
- while(!valid(slot)) ++slot;
- return slot;
-}
-
-int <T>MChunk::last_index() const
-{
- if (empty()) return low - 1;
- int slot;
- if (top == fence)
- {
- int blk = (top - base) / _MAP_BITS;
- while (map[blk] == 0) --blk;
- slot = blk * _MAP_BITS + base + _MAP_BITS - 1;
- }
- else
- slot = fence - 1;
-
- while(!valid(slot)) --slot;
- return slot;
-}
-
-
-int <T>MChunk:: OK() const
-{
- int v = data != 0; // have some data
- v &= map != 0; // and a map
- v &= base <= low; // ok, index-wise
- v &= low <= fence;
- v &= fence <= top;
-
- v &= ((<T>MChunk*)(nxt->prev())) == this; // and links are OK
- v &= ((<T>MChunk*)(prv->next())) == this;
-
- int bitcount = 0; // and unused count correct
- for (int i = low; i < fence; ++i) if (!valid(i)) ++bitcount;
- v &= unused == bitcount;
-
- if (!v) error("invariant failure");
- return(v);
-}
-
-<T>* <T>MChunk::succ(<T>* p) const
-{
- int i = ((int) p - (int) data) / sizeof(<T>) + base + 1;
- if (p == 0 || i < low) return 0;
- while (i < fence && !valid(i)) ++i;
- if (i >= fence) return 0;
- return pointer_to(i);
-}
-
-<T>* <T>MChunk::pred(<T>* p) const
-{
- int i = ((int) p - (int) data) / sizeof(<T>) + base - 1;
- if (p == 0 || i >= fence) return 0;
- while (i >= low && !valid(i)) --i;
- if (i < low) return 0;
- return pointer_to(i);
-}
-
-<T>* <T>MChunk::first_pointer() const
-{
- if (empty()) return 0;
- int slot;
- if (low == base)
- {
- int blk = 0;
- while (map[blk] == 0) ++blk;
- slot = blk * _MAP_BITS + base;
- }
- else
- slot = low;
-
- while(!valid(slot)) ++slot;
- return pointer_to(slot);
-}
-
-<T>* <T>MChunk::last_pointer() const
-{
- if (empty()) return 0;
- int slot;
- if (top == fence)
- {
- int blk = (top - base) / _MAP_BITS;
- while (map[blk] == 0) --blk;
- slot = blk * _MAP_BITS + base + _MAP_BITS - 1;
- }
- else
- slot = fence - 1;
-
- while(!valid(slot)) --slot;
- return pointer_to(slot);
-}
-
-<T>MPlex:: <T>MPlex()
-{
- unused = 0;
- lo = fnc = 0;
- csize = DEFAULT_INITIAL_CAPACITY;
- <T>* data = new <T>[csize];
- hd = ch = new <T>MChunk(data, lo, lo, fnc, lo+csize);
-}
-
-<T>MPlex:: <T>MPlex(int chunksize)
-{
- if (chunksize == 0) error("invalid constructor specification");
- unused = 0;
- lo = fnc = 0;
- if (chunksize > 0)
- {
- csize = chunksize;
- <T>* data = new <T>[csize];
- hd = ch = new <T>MChunk(data, lo, lo, fnc, csize);
- }
- else
- {
- csize = -chunksize;
- <T>* data = new <T>[csize];
- hd = ch = new <T>MChunk(data, chunksize, lo, fnc, fnc);
- }
-}
-
-
-<T>MPlex:: <T>MPlex(int l, int chunksize)
-{
- if (chunksize == 0) error("invalid constructor specification");
- unused = 0;
- lo = fnc = l;
- if (chunksize > 0)
- {
- csize = chunksize;
- <T>* data = new <T>[csize];
- hd = ch = new <T>MChunk(data, lo, lo, fnc, csize+lo);
- }
- else
- {
- csize = -chunksize;
- <T>* data = new <T>[csize];
- hd = ch = new <T>MChunk(data, chunksize+lo, lo, fnc, fnc);
- }
-}
-
-
-void <T>MPlex::make_initial_chunks(int up)
-{
- int need = fnc - lo;
- hd = 0;
- if (up)
- {
- int l = lo;
- do
- {
- int sz;
- if (need >= csize)
- sz = csize;
- else
- sz = need;
- <T>* data = new <T> [csize];
- <T>MChunk* h = new <T>MChunk(data, l, l, l+sz, l+csize);
- if (hd != 0)
- h->link_to_next(hd);
- else
- hd = h;
- l += sz;
- need -= sz;
- } while (need > 0);
- }
- else
- {
- int hi = fnc;
- do
- {
- int sz;
- if (need >= csize)
- sz = csize;
- else
- sz = need;
- <T>* data = new <T> [csize];
- <T>MChunk* h = new <T>MChunk(data, hi-csize, hi-sz, hi, hi);
- if (hd != 0)
- h->link_to_next(hd);
- hd = h;
- hi -= sz;
- need -= sz;
- } while (need > 0);
- }
- ch = (<T>MChunk*) hd;
-}
-
-<T>MPlex:: <T>MPlex(int l, int hi, const <T&> initval, int chunksize)
-{
- lo = l;
- fnc = hi + 1;
- if (chunksize == 0)
- {
- csize = fnc - l;
- make_initial_chunks(1);
- }
- else if (chunksize < 0)
- {
- csize = -chunksize;
- make_initial_chunks(0);
- }
- else
- {
- csize = chunksize;
- make_initial_chunks(1);
- }
- unused = fnc - lo;
- for (int i=lo; i<fnc; ++i)
- undel_index(i);
- fill(initval);
-}
-
-<T>MPlex::<T>MPlex(const <T>MPlex& a)
-{
- lo = a.lo;
- fnc = a.fnc;
- csize = a.csize;
- unused = fnc - lo;
- hd = 0;
- const <T>IChunk* p = a.hd;
- do
- {
- <T>* data = new <T> [p->size()];
- <T>MChunk* h = new <T>MChunk(data, p->base_index(),
- p->low_index(), p->fence_index(), p->top_index());
- if (hd != 0)
- h->link_to_next(hd);
- else
- hd = h;
- p = p->next();
- } while (p != a.hd);
- ch = (<T>MChunk*) hd;
- for (int i = a.low(); i < a.fence(); a.next(i))
- {
- undel_index(i);
- (*this)[i] = a[i];
- }
-}
-
-void <T>MPlex::operator= (const <T>MPlex& a)
-{
- if (&a != this)
- {
- invalidate();
- lo = a.lo;
- fnc = a.fnc;
- csize = a.csize;
- unused = fnc - lo;
- hd = 0;
- const <T>IChunk* p = a.hd;
- do
- {
- <T>* data = new <T> [p->size()];
- <T>MChunk* h = new <T>MChunk(data, p->base_index(),
- p->low_index(), p->fence_index(),
- p->top_index());
- if (hd != 0)
- h->link_to_next(hd);
- else
- hd = h;
- p = p->next();
- } while (p != a.hd);
- ch = (<T>MChunk*) hd;
- for (int i = a.low(); i < a.fence(); a.next(i))
- {
- undel_index(i);
- (*this)[i] = a[i];
- }
- }
-}
-
-int <T>MPlex::valid(int idx) const
-{
- const <T>MChunk* tail = (<T>MChunk*)tl();
- const <T>MChunk* t = ch;
- while (idx >= t->fence_index())
- {
- if (t == tail) return 0;
- t = ((<T>MChunk*)(t->next()));
- }
- while (idx < t->low_index())
- {
- if (t == (<T>MChunk*)(hd)) return 0;
- t = ((<T>MChunk*)(t->prev()));
- }
- set_cache(t);
- return t-><T>MChunk::valid_index(idx);
-}
-
-void <T>MPlex::cache(int idx) const
-{
- const <T>MChunk* tail = (<T>MChunk*)tl();
- const <T>MChunk* t = ch;
- while (idx >= t->fence_index())
- {
- if (t == tail) index_error();
- t = ((<T>MChunk*)(t->next()));
- }
- while (idx < t->low_index())
- {
- if (t == (<T>MChunk*)hd) index_error();
- t = ((<T>MChunk*)(t->prev()));
- }
- if (!t-><T>MChunk::valid_index(idx)) index_error();
- set_cache(t);
-}
-
-void <T>MPlex::cache(const <T>* p) const
-{
- const <T>MChunk* old = ch;
- const <T>MChunk* t = ch;
- while (!t->actual_pointer(p))
- {
- t = ((<T>MChunk*)(t->next()));
- if (t == old) index_error();
- }
- if (!t-><T>MChunk::valid_pointer(p)) index_error();
- set_cache(t);
-}
-
-int <T>MPlex::owns(Pix px) const
-{
- <T>* p = (<T>*)px;
- const <T>MChunk* old = ch;
- const <T>MChunk* t = ch;
- while (!t->actual_pointer(p))
- {
- t = ((<T>MChunk*)(t->next()));
- if (t == old) return 0;
- }
- set_cache(t);
- return t-><T>MChunk::valid_pointer(p);
-}
-
-int <T>MPlex::add_high(const <T&> elem)
-{
- <T>MChunk* t = ((<T>MChunk*) tl());
-
- if (!t->can_grow_high())
- {
- <T>* data = new <T> [csize];
- t = (new <T>MChunk(data, fnc,fnc,fnc,fnc+csize));
- t->link_to_prev(tl());
- }
-
- *((t-><T>MChunk::grow_high())) = elem;
- set_cache(t);
- return fnc++;
-}
-
-int <T>MPlex::add_low (const <T&> elem)
-{
- <T>MChunk* t = ((<T>MChunk*) hd);
- if (!t->can_grow_low())
- {
- <T>* data = new <T> [csize];
- hd = new <T>MChunk(data, lo-csize, lo, lo, lo);
- hd->link_to_next(t);
- t = ((<T>MChunk*) hd);
- }
-
- *((t-><T>MChunk::grow_low())) = elem;
- set_cache(t);
- return --lo;
-}
-
-void <T>MPlex::adjust_bounds()
-{
- <T>MChunk* t = ((<T>MChunk*) tl());
-
- // clean up tail
-
- t->reset_high();
- while (t-><T>MChunk::empty() && !one_chunk())
- {
- <T>MChunk* pred = (<T>MChunk*)(t->prev());
- del_chunk(t);
- pred->reset_high();
- t = (pred);
- }
- if (one_chunk())
- t->reset_high();
-
- int oldfnc = fnc;
- fnc = t->fence_index();
- unused -= oldfnc - fnc;
-
- // and head..
- t = ((<T>MChunk*) hd);
- t->reset_low();
- while (t-><T>MChunk::empty() && !one_chunk())
- {
- hd = (<T>MChunk*)(t->next());
- del_chunk(t);
- t = ((<T>MChunk*) hd);
- t->reset_low();
- }
-
- int oldlo = lo;
- lo = t->low_index();
- unused -= lo - oldlo;
-
-
- set_cache(t);
-}
-
-int <T>MPlex::del_high ()
-{
- if (empty()) empty_error();
- <T>MChunk* t = ((<T>MChunk*) tl());
- while (t-><T>MChunk::empty() && !one_chunk()) // possible stragglers
- {
- <T>MChunk* pred = (<T>MChunk*)(t->prev());
- del_chunk(t);
- pred->reset_high();
- t = (pred);
- }
- t-><T>MChunk::shrink_high();
- while (t-><T>MChunk::empty() && !one_chunk())
- {
- <T>MChunk* pred = (<T>MChunk*)(t->prev());
- del_chunk(t);
- pred->reset_high();
- t = (pred);
- }
- int oldfnc = fnc;
- fnc = t->fence_index();
- unused -= oldfnc - fnc - 1;
- set_cache(t);
- return fnc - 1;
-}
-
-int <T>MPlex::del_low ()
-{
- if (empty()) empty_error();
- <T>MChunk* t = ((<T>MChunk*) hd);
- while (t-><T>MChunk::empty() && !one_chunk())
- {
- hd = (<T>MChunk*)(t->next());
- del_chunk(t);
- t = ((<T>MChunk*) hd);
- t->reset_low();
- }
- t-><T>MChunk::shrink_low();
- while (t-><T>MChunk::empty() && !one_chunk())
- {
- hd = (<T>MChunk*)(t->next());
- del_chunk(t);
- t = ((<T>MChunk*) hd);
- t->reset_low();
- }
- int oldlo = lo;
- lo = t->low_index();
- unused -= lo - oldlo - 1;
- set_cache(t);
- return lo;
-}
-
-int <T>MPlex::add(const <T&> elem)
-{
- if (unused == 0)
- return add_high(elem);
-
- <T>MChunk* t;
- for (t = ch;
- t->unused_indices() == 0;
- t = (<T>MChunk*)(t->prev()))
- ;
-
- int i = t->unused_index();
- set_cache(t);
- undel_index(i);
- (*this)[i] = elem;
- return i;
-}
-
-int <T>MPlex::unused_index() const
-{
- if (unused == 0) index_error();
-
- <T>MChunk* t;
- for (t = ch;
- t->unused_indices() == 0;
- t = (<T>MChunk*)(t->prev()))
- ;
-
- set_cache(t);
- return t->unused_index();
-}
-
-Pix <T>MPlex::unused_Pix() const
-{
- if (unused == 0) return 0;
-
- <T>MChunk* t;
- for (t = ch;
- t->unused_indices() == 0;
- t = (<T>MChunk*)(t->prev()))
- ;
-
- set_cache(t);
- return t->pointer_to(t->unused_index());
-}
-
-int <T>MPlex::del_index(int idx)
-{
- if (idx < lo || idx >= fnc) index_error();
- if (<T>MPlex::valid(idx))
- {
- ++unused;
- ch-><T>MChunk::del(idx);
- return 1;
- }
- else
- return 0;
-}
-
-int <T>MPlex::dopred(int idx) const
-{
-
- if (idx >= fnc) idx = fnc;
- if (idx <= lo) return lo - 1;
-
- const <T>MChunk* t = ch;
-
- while (idx > t->fence_index())
- {
- t = ((<T>MChunk*)(t->next()));
- }
- while (idx <= t->low_index())
- {
- t = ((<T>MChunk*)(t->prev()));
- }
- int i = t-><T>MChunk::pred(idx);
- while (i < t->low_index() && i >= lo)
- {
- t = ((<T>MChunk*)(t->prev()));
- i = t-><T>MChunk::last_index();
- }
- set_cache(t);
- return i;
-}
-
-
-int <T>MPlex::dosucc(int idx) const
-{
- if (idx < lo) idx = lo;
- if (idx >= fnc - 1) return fnc;
-
- const <T>MChunk* t = ch;
- while (idx >= t->fence_index())
- {
- t = ((<T>MChunk*)(t->next()));
- }
- while (idx < t->low_index())
- {
- t = ((<T>MChunk*)(t->prev()));
- }
- int i = t-><T>MChunk::succ(idx);
- while (i >= t->fence_index() && i < fnc)
- {
- t = (<T>MChunk*)(t->next());
- i = t-><T>MChunk::first_index();
- }
- set_cache(t);
- return i;
-}
-
-void <T>MPlex::prev(Pix& i) const
-{
- if (i == 0) return;
-
- <T>* p = (<T>*) i;
- const <T>MChunk* old = ch;
- const <T>MChunk* t = ch;
-
- while (!t->actual_pointer(p))
- {
- t = ((<T>MChunk*)(t->prev()));
- if (t == old)
- {
- i = 0;
- return;
- }
- }
- <T>* q = t-><T>MChunk::pred(p);
- while (q == 0 && t != (<T>MChunk*)hd)
- {
- t = ((<T>MChunk*)(t->prev()));
- q = t-><T>MChunk::last_pointer();
- }
-
- i = Pix(q);
- set_cache(t);
- return;
-}
-
-void <T>MPlex::next(Pix& i) const
-{
- if (i == 0) return;
-
- <T>* p = (<T>*) i;
- const <T>MChunk* tail = (<T>MChunk*)(tl());
- const <T>MChunk* old = ch;
- const <T>MChunk* t = ch;
-
- while (!t->actual_pointer(p))
- {
- t = ((<T>MChunk*)(t->next()));
- if (t == old)
- {
- i = 0;
- return;
- }
- }
- <T>* q = t-><T>MChunk::succ(p);
- while (q == 0 && t != tail)
- {
- t = ((<T>MChunk*)(t->next()));
- q = t-><T>MChunk::first_pointer();
- }
-
- i = Pix(q);
- set_cache(t);
- return;
-}
-
-
-void <T>MPlex::undel_index(int idx)
-{
- if (idx < lo || idx >= fnc) index_error();
-
- <T>MChunk* t = ch;
- while (idx >= t->fence_index())
- {
- t = ((<T>MChunk*)(t->next()));
- }
- while (idx < t->low_index())
- {
- t = ((<T>MChunk*)(t->prev()));
- }
- int was_present = t-><T>MChunk::undel(idx);
- if (!was_present)
- {
- --unused;
- }
- set_cache(t);
- return;
-}
-
-void <T>MPlex::clear()
-{
- if (fnc != lo)
- {
- <T>MChunk* t = ((<T>MChunk*)tl());
- while (t != hd)
- {
- <T>MChunk* prv = (<T>MChunk*)(t->prev());
- del_chunk(t);
- t = prv;
- }
- t-><T>MChunk::clear(lo);
- set_cache(t);
- fnc = lo;
- unused = 0;
- }
-}
-
-int <T>MPlex::OK () const
-{
- int v = hd != 0; // at least one chunk
-
- int found_ch = 0; // to make sure ch is in list;
-
- int count = 0; // to count unused slots
-
- const <T>MChunk* t = (<T>MChunk*)(hd);
-
- int gap = t->low_index() - lo;
- v &= gap == 0; // hd lo not less than lo.
- count += gap;
-
- for (;;)
- {
- if (t == ch) ++found_ch;
- v &= t-><T>MChunk::OK(); // each chunk is OK
- count += t->unused_indices();
- if (t == (<T>MChunk*)(tl()))
- break;
- else // and has indices less than succ
- {
- gap = t->next()->base_index() - t->top_index();
- v &= gap == 0;
- count += gap;
-
- if (t != (<T>MChunk*)hd) // internal chunks can't grow
- v &= !t->can_grow_low() && !t->can_grow_high();
-
- t = (const <T>MChunk*)(t->next());
- }
- }
- gap = fnc - t->fence_index();
- v &= gap == 0;
- count += gap;
-
- v &= count == unused; // chunk counts agree with plex
-
- v &= found_ch == 1;
- if (!v) error("invariant failure");
- return v;
-}
-
diff --git a/contrib/libg++/libg++/src/gen/MPlex.hP b/contrib/libg++/libg++/src/gen/MPlex.hP
deleted file mode 100644
index c257f43de5a5..000000000000
--- a/contrib/libg++/libg++/src/gen/MPlex.hP
+++ /dev/null
@@ -1,414 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
- based on code by Marc Shapiro (shapiro@sor.inria.fr)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifndef _<T>MPlex_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _<T>MPlex_h 1
-
-
-#include "<T>.Plex.h"
-
-
-// Number of bits per long, used in MChunk bit map operations
-
-#define _MAP_BITS 32
-
-
-class <T>MChunk : public <T>IChunk
-{
-protected:
-
- unsigned long* map; // bitmap of slots
- int unused; // number of unused internal slots
-
- inline void mark(int); // bitmap operations
- inline void free(int);
- inline int valid(int) const;
-
-public:
-
- <T>MChunk(<T>* d, // ptr to array of elements
- int base_idx, // initial indices
- int low_idx, // & initially clear map
- int fence_idx,
- int top_idx);
-
- inline ~<T>MChunk();
-
-// virtuals
-
- int first_index() const;
- int last_index() const;
- inline int succ(int idx) const;
- inline int pred(int idx) const;
- <T>* first_pointer() const;
- <T>* last_pointer() const;
- <T>* succ(<T>*) const;
- <T>* pred(<T>*) const;
- inline int empty() const;
- inline int full() const;
- inline int valid_index(int i) const;
- inline int valid_pointer(const <T>* p) const;
- inline <T>* grow_high ();
- inline <T>* grow_low ();
- void shrink_high ();
- void shrink_low ();
- void clear(int);
- void cleardown(int);
- int OK() const;
-
-// extensions
-
- int unused_indices() const; // how many free slot in low..fence?
-
- int unused_index() const; // return index of free slot
-
- int del(int i); // delete data indexed by i
- // return true if was present
- int undel(int idx); // un-delete data indexed by i
- // return true if already present
-
- void reset_low(); // reset low = lowest valid index;
- void reset_high(); // same for high
-
-};
-
-
-class <T>MPlex: public <T>Plex
-{
- <T>MChunk* ch; // cached chunk
- int unused; // # of free slots between low & fence
-
- void make_initial_chunks(int up = 1);
- void cache(int idx) const;
- void cache(const <T>* p) const;
- int dopred(int) const;
- int dosucc(int) const;
-
- void set_cache(const <T>MChunk* t) const; // logically,
- // not physically const
-
-public:
- <T>MPlex(); // set low = 0;
- // fence = 0;
- // csize = default
-
- <T>MPlex(int ch_size); // low = 0;
- // fence = 0;
- // csize = ch_size
-
- <T>MPlex(int lo, // low = lo;
- int ch_size); // fence=lo
- // csize = ch_size
-
- <T>MPlex(int lo, // low = lo
- int hi, // fence = hi+1
- const <T&> initval,// fill with initval,
- int ch_size = 0); // csize= ch_size
- // or fence-lo if 0
-
- <T>MPlex(const <T>MPlex&);
-
- void operator= (const <T>MPlex&);
-
-// virtuals
-
- inline <T>& high_element ();
- inline <T>& low_element ();
- inline const <T>& high_element () const;
- inline const <T>& low_element () const;
-
- inline Pix first() const;
- inline Pix last() const ;
- void prev(Pix& ptr) const;
- void next(Pix& ptr) const;
- int owns(Pix p) const;
- inline <T>& operator () (Pix p);
- inline const <T>& operator () (Pix p) const;
-
- inline int low() const;
- inline int high() const;
- int valid(int idx) const;
- inline void prev(int& idx) const;
- inline void next(int& x) const;
- inline <T>& operator [] (int index);
- inline const <T>& operator [] (int index) const;
-
- inline int Pix_to_index(Pix p) const;
- inline Pix index_to_Pix(int idx) const;
-
- inline int can_add_high() const;
- inline int can_add_low() const;
- inline int full() const;
-
- int add_high(const <T&> elem);
- int del_high ();
- int add_low (const <T&> elem);
- int del_low ();
- void clear();
-
- int OK () const;
-
-// extensions
-
- int count() const; // # valid elements
- int available() const; // # deleted elements
-
- int unused_index()const; // return index of a deleted elem
- Pix unused_Pix() const; // return Pix of a deleted elem
-
- int del_index(int idx); // logically delete at idx;
- // return true if was present
- int del_Pix(Pix p); // delete at p
-
- void undel_index(int idx); // undelete at idx;
- void undel_Pix(Pix p); // undelete at p;
-
- void adjust_bounds(); // reset lo, hi to lowest &
- // highest valid indices
-
- int add(const <T&> elem); // add anywhere
-};
-
-
-inline <T>MChunk:: ~<T>MChunk()
-{
- delete map;
-}
-
-inline void <T>MChunk::mark(int idx)
-{
- unsigned int i = idx - base;
- map[i / _MAP_BITS] |= 1 << (i & (_MAP_BITS - 1));
-}
-
-inline void <T>MChunk::free(int idx)
-{
- unsigned int i = idx - base;
- map[i / _MAP_BITS] &= ~(1 << (i & (_MAP_BITS - 1)));
-}
-
-inline int <T>MChunk::valid(int idx) const
-{
- unsigned int i = idx - base;
- return map[i / _MAP_BITS] & (1 << (i & (_MAP_BITS - 1)));
-}
-
-inline int <T>MChunk:: valid_index(int i) const
-{
- return i >= low && i < fence && valid(i);
-}
-
-inline int <T>MChunk:: valid_pointer(const <T>* p) const
-{
- int i = ((int)p - (int)data) / sizeof(<T>);
- return i >= 0 && i < (fence - base) &&
- (map[(unsigned)i / _MAP_BITS] & (1 << (i & (_MAP_BITS - 1))));
-}
-
-inline int <T>MChunk::empty() const
-{
- return fence - low - unused == 0;
-}
-
-inline int <T>MChunk::full() const
-{
- return unused + (top - fence) + (low - base) == 0;
-}
-
-inline int <T>MChunk::succ(int idx) const
-{
- int i = (idx < low)? low : idx + 1;
- while (i < fence && !valid(i)) ++i;
- return i;
-}
-
-inline int <T>MChunk::pred(int idx) const
-{
- int i = (idx > fence)? (fence - 1) : idx - 1;
- while (i >= low && !valid(i)) --i;
- return i;
-}
-
-inline int <T>MChunk::unused_indices() const
-{
- return unused;
-}
-
-inline <T>* <T>MChunk:: grow_high ()
-{
- if (!can_grow_high()) full_error();
- mark(fence);
- return &(data[fence++ - base]);
-}
-
-inline <T>* <T>MChunk:: grow_low ()
-{
- if (!can_grow_low()) full_error();
- mark(--low);
- return &(data[low - base]);
-}
-
-inline void <T>MChunk::reset_low()
-{
- while (low < fence && !valid(low))
- {
- --unused;
- ++low;
- }
-}
-
-inline void <T>MChunk::reset_high()
-{
- while (fence > low && !valid(fence - 1))
- {
- --unused;
- --fence;
- }
-}
-
-inline int <T>MPlex::full () const
-{
- return 0;
-}
-
-inline int <T>MPlex::can_add_high() const
-{
- return 1;
-}
-
-inline int <T>MPlex::can_add_low() const
-{
- return 1;
-}
-
-inline int <T>MPlex::available() const
-{
- return unused;
-}
-
-inline int <T>MPlex::count() const
-{
- return fnc - lo - unused;
-}
-
-inline void <T>MPlex::set_cache(const <T>MChunk* t) const
-{
- ((<T>MPlex*)(this))->ch = (<T>MChunk*)t;
-}
-
-inline <T>& <T>MPlex:: operator [] (int idx)
-{
- if (!ch-><T>MChunk::valid_index(idx)) cache(idx);
- return * (ch->pointer_to(idx));
-}
-
-inline const <T>& <T>MPlex:: operator [] (int idx) const
-{
- if (!ch-><T>MChunk::valid_index(idx)) cache(idx);
- return * ((const <T>*)(ch->pointer_to(idx)));
-}
-
-inline int <T>MPlex::Pix_to_index(Pix p) const
-{
- if (!ch-><T>MChunk::valid_pointer((<T>*)p)) cache((<T>*)p);
- return ch->index_of((<T>*)p);
-}
-
-inline int <T>MPlex::high() const
-{
- return (((const <T>MChunk*)tl())-><T>MChunk::valid_index(fnc-1)) ?
- fnc-1 : dopred(fnc-1);
-}
-
-inline int <T>MPlex::low() const
-{
- return (((const <T>MChunk*)hd)-><T>MChunk::valid_index(lo))? lo : dosucc(lo);
-}
-
-inline <T>& <T>MPlex::low_element ()
-{
- return (*this)[low()];
-}
-
-inline const <T>& <T>MPlex::low_element () const
-{
- return (*this)[low()];
-}
-
-inline <T>& <T>MPlex::high_element ()
-{
- return (*this)[high()];
-}
-
-inline const <T>& <T>MPlex::high_element () const
-{
- return (*this)[high()];
-}
-
-inline Pix <T>MPlex::index_to_Pix(int idx) const
-{
- if (!ch-><T>MChunk::valid_index(idx)) cache(idx);
- return Pix(ch->pointer_to(idx));
-}
-
-inline void <T>MPlex::next(int& idx) const
-{
- idx = (ch-><T>MChunk::valid_index(idx+1))? idx+1 : dosucc(idx);
-}
-
-inline void <T>MPlex::prev(int& idx) const
-{
- idx = (ch-><T>MChunk::valid_index(idx-1))? idx-1 : dopred(idx);
-}
-
-inline Pix <T>MPlex::first() const
-{
- return index_to_Pix(low());
-}
-
-inline Pix <T>MPlex::last() const
-{
- return index_to_Pix(high());
-}
-
-
-inline void <T>MPlex::undel_Pix(Pix p)
-{
- undel_index(Pix_to_index(p));
-}
-
-inline int <T>MPlex::del_Pix(Pix p)
-{
- return del_index(Pix_to_index(p));
-}
-
-inline <T>& <T>MPlex:: operator () (Pix p)
-{
- return *((<T>*)p);
-}
-
-inline const <T>& <T>MPlex:: operator () (Pix p) const
-{
- return *((const <T>*)p);
-}
-
-#endif
diff --git a/contrib/libg++/libg++/src/gen/Map.ccP b/contrib/libg++/libg++/src/gen/Map.ccP
deleted file mode 100644
index 146a2d2b2a90..000000000000
--- a/contrib/libg++/libg++/src/gen/Map.ccP
+++ /dev/null
@@ -1,59 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <builtin.h>
-#include "<T>.<C>.Map.h"
-
-
-Pix <T><C>Map::seek(<T&> item)
-{
- Pix i;
- for (i = first(); i != 0 && !(<T>EQ(key(i), item)); next(i));
- return i;
-}
-
-int <T><C>Map::owns(Pix idx)
-{
- if (idx == 0) return 0;
- for (Pix i = first(); i; next(i)) if (i == idx) return 1;
- return 0;
-}
-
-void <T><C>Map::clear()
-{
- Pix i = first();
- while (i != 0)
- {
- del(key(i));
- i = first();
- }
-}
-
-int <T><C>Map::contains (<T&> item)
-{
- return seek(item) != 0;
-}
-
-
-void <T><C>Map::error(const char* msg)
-{
- (*lib_error_handler)("Map", msg);
-}
diff --git a/contrib/libg++/libg++/src/gen/Map.hP b/contrib/libg++/libg++/src/gen/Map.hP
deleted file mode 100644
index 13a3fb14518a..000000000000
--- a/contrib/libg++/libg++/src/gen/Map.hP
+++ /dev/null
@@ -1,87 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-
-#ifndef _<T><C>Map_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _<T><C>Map_h 1
-
-#include <Pix.h>
-#include "<T>.defs.h"
-
-class <T><C>Map
-{
-protected:
- int count;
- <C> def;
-
-public:
- <T><C>Map(<C&> dflt);
- inline virtual ~<T><C>Map();
-
- int length() const; // current number of items
- int empty() const;
-
- virtual int contains(<T&> key); // is key mapped?
-
- virtual void clear(); // delete all items
-
- virtual <C>& operator [] (<T&> key) = 0; // access contents by key
-
- virtual void del(<T&> key) = 0; // delete entry
-
- virtual Pix first() = 0; // Pix of first item or 0
- virtual void next(Pix& i) = 0; // advance to next or 0
- virtual <T>& key(Pix i) = 0; // access key at i
- virtual <C>& contents(Pix i) = 0; // access contents at i
-
- virtual int owns(Pix i); // is i a valid Pix ?
- virtual Pix seek(<T&> key); // Pix of key
-
- <C>& dflt(); // access default val
-
- void error(const char* msg);
- virtual int OK() = 0; // rep invariant
-};
-
-
-inline <T><C>Map::~<T><C>Map() {}
-
-inline int <T><C>Map::length() const
-{
- return count;
-}
-
-inline int <T><C>Map::empty() const
-{
- return count == 0;
-}
-
-inline <C>& <T><C>Map::dflt()
-{
- return def;
-}
-
-inline <T><C>Map::<T><C>Map(<C&> dflt) :def(dflt)
-{
- count = 0;
-}
-
-#endif
diff --git a/contrib/libg++/libg++/src/gen/OSLBag.ccP b/contrib/libg++/libg++/src/gen/OSLBag.ccP
deleted file mode 100644
index 285c2cfd000c..000000000000
--- a/contrib/libg++/libg++/src/gen/OSLBag.ccP
+++ /dev/null
@@ -1,196 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include "<T>.OSLBag.h"
-
-
-Pix <T>OSLBag::seek(<T&> item, Pix i)
-{
- if (i == 0) i = p.first(); else next(i);
- for (; i != 0; p.next(i))
- {
- int cmp = <T>CMP(item, p(i));
- if (cmp == 0)
- return i;
- else if (cmp < 0)
- return 0;
- }
- return 0;
-}
-
-int <T>OSLBag::nof(<T&> item)
-{
- int n = 0;
- for (Pix i = p.first(); i != 0; p.next(i))
- {
- int cmp = <T>CMP(item, p(i));
- if (cmp == 0)
- ++n;
- else if (cmp < 0)
- break;
- }
- return n;
-}
-
-Pix <T>OSLBag::add(<T&> item)
-{
- Pix i = p.first();
- if (i == 0)
- {
- ++count;
- return p.prepend(item);
- }
- int cmp = <T>CMP(item, p(i));
- if (cmp <= 0)
- {
- ++count;
- return p.prepend(item);
- }
- else
- {
- Pix trail = i;
- p.next(i);
- for (;;)
- {
- if (i == 0)
- {
- ++count;
- return p.append(item);
- }
- cmp = <T>CMP(item, p(i));
- if (cmp <= 0)
- {
- ++count;
- return p.ins_after(trail, item);
- }
- else
- {
- trail = i;
- p.next(i);
- }
- }
- }
-}
-
-void <T>OSLBag::del(<T&> item)
-{
- Pix i = p.first();
- if (i == 0)
- return;
- int cmp = <T>CMP(item, p(i));
- if (cmp < 0)
- return;
- else if (cmp == 0)
- {
- --count;
- p.del_front();
- }
- else
- {
- Pix trail = i;
- p.next(i);
- while (i != 0)
- {
- cmp = <T>CMP(item, p(i));
- if (cmp < 0)
- return;
- else if (cmp == 0)
- {
- --count;
- p.del_after(trail);
- return;
- }
- else
- {
- trail = i;
- p.next(i);
- }
- }
- }
-}
-
-void <T>OSLBag::remove(<T&> item)
-{
- Pix i = p.first();
- if (i == 0)
- return;
- int cmp = <T>CMP(item, p(i));
- if (cmp < 0)
- return;
- else if (cmp == 0)
- {
- do
- {
- --count;
- p.del_front();
- i = p.first();
- } while (i != 0 && <T>EQ(item, p(i)));
- }
- else
- {
- Pix trail = i;
- p.next(i);
- while (i != 0)
- {
- cmp = <T>CMP(item, p(i));
- if (cmp < 0)
- return;
- else if (cmp == 0)
- {
- do
- {
- --count;
- p.del_after(trail);
- i = trail;
- next(i);
- } while (i != 0 && <T>EQ(item, p(i)));
- return;
- }
- else
- {
- trail = i;
- p.next(i);
- }
- }
- }
-}
-
-int <T>OSLBag::OK()
-{
- int v = p.OK();
- v &= count == p.length();
- Pix trail = p.first();
- if (trail == 0)
- v &= count == 0;
- else
- {
- Pix i = trail; next(i);
- while (i != 0)
- {
- v &= <T>CMP(p(trail), p(i)) <= 0;
- trail = i;
- next(i);
- }
- }
- if (!v) error("invariant failure");
- return v;
-}
-
diff --git a/contrib/libg++/libg++/src/gen/OSLBag.hP b/contrib/libg++/libg++/src/gen/OSLBag.hP
deleted file mode 100644
index 5a657f0f3a15..000000000000
--- a/contrib/libg++/libg++/src/gen/OSLBag.hP
+++ /dev/null
@@ -1,91 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-
-#ifndef _<T>OSLBag_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _<T>OSLBag_h 1
-
-#include "<T>.Bag.h"
-#include "<T>.SLList.h"
-
-class <T>OSLBag : public <T>Bag
-{
-protected:
- <T>SLList p;
-
-public:
- <T>OSLBag();
- <T>OSLBag(const <T>OSLBag&);
-
- Pix add(<T&> item);
- void del(<T&> item);
- void remove(<T&>item);
-
- inline int contains(<T&> item);
- int nof(<T&> item);
-
- inline void clear();
-
- inline Pix first();
- inline void next(Pix& i);
- inline <T>& operator () (Pix i);
- inline int owns(Pix i);
- Pix seek(<T&> item, Pix from = 0);
-
- int OK();
-};
-
-
-inline <T>OSLBag::<T>OSLBag() : p() { count = 0; }
-
-inline <T>OSLBag::<T>OSLBag(const <T>OSLBag& s) : p(s.p) { count = s.count; }
-
-inline Pix <T>OSLBag::first()
-{
- return p.first();
-}
-
-inline void <T>OSLBag::next(Pix & idx)
-{
- p.next(idx);
-}
-
-inline <T>& <T>OSLBag::operator ()(Pix idx)
-{
- return p(idx);
-}
-
-inline void <T>OSLBag::clear()
-{
- count = 0; p.clear();
-}
-
-inline int <T>OSLBag::owns (Pix idx)
-{
- return p.owns(idx);
-}
-
-inline int <T>OSLBag::contains(<T&> item)
-{
- return seek(item) != 0;
-}
-
-#endif
diff --git a/contrib/libg++/libg++/src/gen/OSLSet.ccP b/contrib/libg++/libg++/src/gen/OSLSet.ccP
deleted file mode 100644
index 937d915a96b1..000000000000
--- a/contrib/libg++/libg++/src/gen/OSLSet.ccP
+++ /dev/null
@@ -1,321 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include "<T>.OSLSet.h"
-
-
-Pix <T>OSLSet::seek(<T&> item)
-{
- for (Pix i = p.first(); i != 0; p.next(i))
- {
- int cmp = <T>CMP(item, p(i));
- if (cmp == 0)
- return i;
- else if (cmp < 0)
- return 0;
- }
- return 0;
-}
-
-Pix <T>OSLSet::add(<T&> item)
-{
- Pix i = p.first();
- if (i == 0)
- {
- ++count;
- return p.prepend(item);
- }
- int cmp = <T>CMP(item, p(i));
- if (cmp == 0)
- return i;
- else if (cmp < 0)
- {
- ++count;
- return p.prepend(item);
- }
- else
- {
- Pix trail = i;
- p.next(i);
- for (;;)
- {
- if (i == 0)
- {
- ++count;
- return p.append(item);
- }
- cmp = <T>CMP(item, p(i));
- if (cmp == 0)
- return i;
- else if (cmp < 0)
- {
- ++count;
- return p.ins_after(trail, item);
- }
- else
- {
- trail = i;
- p.next(i);
- }
- }
- }
-}
-
-void <T>OSLSet::del(<T&> item)
-{
- Pix i = p.first();
- if (i == 0)
- return;
- int cmp = <T>CMP(item, p(i));
- if (cmp < 0)
- return;
- else if (cmp == 0)
- {
- --count;
- p.del_front();
- }
- else
- {
- Pix trail = i;
- p.next(i);
- while (i != 0)
- {
- cmp = <T>CMP(item, p(i));
- if (cmp < 0)
- return;
- else if (cmp == 0)
- {
- --count;
- p.del_after(trail);
- return;
- }
- else
- {
- trail = i;
- p.next(i);
- }
- }
- }
-}
-
-
-int <T>OSLSet::operator <= (<T>OSLSet& b)
-{
- if (count > b.count) return 0;
- Pix i = first();
- Pix j = b.first();
- for (;;)
- {
- if (i == 0)
- return 1;
- else if (j == 0)
- return 0;
- int cmp = <T>CMP(p(i), b.p(j));
- if (cmp == 0)
- {
- next(i); b.next(j);
- }
- else if (cmp < 0)
- return 0;
- else
- b.next(j);
- }
-}
-
-int <T>OSLSet::operator == (<T>OSLSet& b)
-{
- if (count != b.count) return 0;
- if (count == 0) return 1;
- Pix i = p.first();
- Pix j = b.p.first();
- while (i != 0)
- {
- if (!<T>EQ(p(i),b.p(j))) return 0;
- next(i);
- b.next(j);
- }
- return 1;
-}
-
-
-void <T>OSLSet::operator |= (<T>OSLSet& b)
-{
- if (&b == this || b.count == 0)
- return;
- else
- {
- Pix j = b.p.first();
- Pix i = p.first();
- Pix trail = 0;
- for (;;)
- {
- if (j == 0)
- return;
- else if (i == 0)
- {
- for (; j != 0; b.next(j))
- {
- ++count;
- p.append(b.p(j));
- }
- return;
- }
- int cmp = <T>CMP(p(i), b.p(j));
- if (cmp <= 0)
- {
- if (cmp == 0) b.next(j);
- trail = i;
- next(i);
- }
- else
- {
- ++count;
- if (trail == 0)
- trail = p.prepend(b.p(j));
- else
- trail = p.ins_after(trail, b.p(j));
- b.next(j);
- }
- }
- }
-}
-
-
-void <T>OSLSet::operator -= (<T>OSLSet& b)
-{
- if (&b == this)
- clear();
- else if (count != 0 && b.count != 0)
- {
- Pix i = p.first();
- Pix j = b.p.first();
- Pix trail = 0;
- for (;;)
- {
- if (j == 0 || i == 0)
- return;
- int cmp = <T>CMP(p(i), b.p(j));
- if (cmp == 0)
- {
- --count;
- b.next(j);
- if (trail == 0)
- {
- p.del_front();
- i = p.first();
- }
- else
- {
- next(i);
- p.del_after(trail);
- }
- }
- else if (cmp < 0)
- {
- trail = i;
- next(i);
- }
- else
- b.next(j);
- }
- }
-}
-
-void <T>OSLSet::operator &= (<T>OSLSet& b)
-{
- if (b.count == 0)
- clear();
- else if (&b != this && count != 0)
- {
- Pix i = p.first();
- Pix j = b.p.first();
- Pix trail = 0;
- for (;;)
- {
- if (i == 0)
- return;
- else if (j == 0)
- {
- if (trail == 0)
- {
- p.clear();
- count = 0;
- }
- else
- {
- while (i != 0)
- {
- --count;
- next(i);
- p.del_after(trail);
- }
- }
- return;
- }
- int cmp = <T>CMP(p(i), b.p(j));
-
- if (cmp == 0)
- {
- trail = i;
- next(i);
- b.next(j);
- }
- else if (cmp < 0)
- {
- --count;
- if (trail == 0)
- {
- p.del_front();
- i = p.first();
- }
- else
- {
- next(i);
- p.del_after(trail);
- }
- }
- else
- b.next(j);
- }
- }
-}
-
-
-int <T>OSLSet::OK()
-{
- int v = p.OK();
- v &= count == p.length();
- Pix trail = p.first();
- if (trail == 0)
- v &= count == 0;
- else
- {
- Pix i = trail; next(i);
- while (i != 0)
- {
- v &= <T>CMP(p(trail), p(i)) < 0;
- trail = i;
- next(i);
- }
- }
- if (!v) error("invariant failure");
- return v;
-}
diff --git a/contrib/libg++/libg++/src/gen/OSLSet.hP b/contrib/libg++/libg++/src/gen/OSLSet.hP
deleted file mode 100644
index 02ace589cba7..000000000000
--- a/contrib/libg++/libg++/src/gen/OSLSet.hP
+++ /dev/null
@@ -1,101 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-
-#ifndef _<T>OSLSet_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _<T>OSLSet_h 1
-
-#include "<T>.Set.h"
-#include "<T>.SLList.h"
-
-class <T>OSLSet : public <T>Set
-{
-protected:
- <T>SLList p;
-
-public:
- <T>OSLSet();
- <T>OSLSet(const <T>OSLSet&);
-
- Pix add(<T&> item);
- void del(<T&> item);
- inline int contains(<T&> item);
-
- inline void clear();
-
- inline Pix first();
- inline void next(Pix& i);
- inline <T>& operator () (Pix i);
- inline int owns(Pix i);
- Pix seek(<T&> item);
-
- void operator |= (<T>OSLSet& b);
- void operator -= (<T>OSLSet& b);
- void operator &= (<T>OSLSet& b);
-
- int operator == (<T>OSLSet& b);
- int operator != (<T>OSLSet& b);
- int operator <= (<T>OSLSet& b);
-
- int OK();
-};
-
-
-inline <T>OSLSet::<T>OSLSet() : p() { count = 0; }
-
-inline <T>OSLSet::<T>OSLSet(const <T>OSLSet& s) : p(s.p) { count = s.count; }
-
-inline Pix <T>OSLSet::first()
-{
- return p.first();
-}
-
-inline void <T>OSLSet::next(Pix & idx)
-{
- p.next(idx);
-}
-
-inline <T>& <T>OSLSet::operator ()(Pix idx)
-{
- return p(idx);
-}
-
-inline void <T>OSLSet::clear()
-{
- count = 0; p.clear();
-}
-
-inline int <T>OSLSet::contains (<T&> item)
-{
- return seek(item) != 0;
-}
-
-inline int <T>OSLSet::owns (Pix idx)
-{
- return p.owns(idx);
-}
-
-inline int <T>OSLSet::operator != (<T>OSLSet& b)
-{
- return !(*this == b);
-}
-
-#endif
diff --git a/contrib/libg++/libg++/src/gen/OXPBag.ccP b/contrib/libg++/libg++/src/gen/OXPBag.ccP
deleted file mode 100644
index b81c3a0a3738..000000000000
--- a/contrib/libg++/libg++/src/gen/OXPBag.ccP
+++ /dev/null
@@ -1,221 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include "<T>.OXPBag.h"
-
-
-Pix <T>OXPBag::seek(<T&> item, Pix i)
-{
- if (i == 0)
- {
- int l = p.low();
- int h = p.high();
- while (l <= h)
- {
- int mid = (l + h) / 2;
- int cmp = <T>CMP(item, p[mid]);
- if (cmp == 0)
- {
- while (mid > p.low() && <T>EQ(item, p[mid - 1])) --mid;
- return p.index_to_Pix(mid);
- }
- else if (cmp < 0)
- h = mid - 1;
- else
- l = mid + 1;
- }
- return 0;
- }
- int cmp = <T>CMP(item, p(i));
- if (cmp == 0)
- {
- next(i);
- return (<T>EQ(item, p(i)))? i : 0;
- }
- else if (cmp < 0)
- {
- int ind = p.Pix_to_index(i);
- int l = ind;
- int h = p.high();
- while (l <= h)
- {
- int mid = (l + h) / 2;
- cmp = <T>CMP(item, p[mid]);
- if (cmp == 0)
- {
- while (mid > ind && <T>EQ(item, p[mid - 1])) --mid;
- return p.index_to_Pix(mid);
- }
- else if (cmp < 0)
- h = mid - 1;
- else
- l = mid + 1;
- }
- return 0;
- }
- else
- return 0;
-}
-
-int <T>OXPBag::nof(<T&> item)
-{
- int l = p.low();
- int h = p.high();
- while (l <= h)
- {
- int mid = (l + h) / 2;
- int cmp = <T>CMP(item, p[mid]);
- if (cmp == 0)
- {
- l = h = mid;
- while (l > p.low() && <T>EQ(item, p[l - 1])) --l;
- while (h < p.high() && <T>EQ(item, p[h + 1])) ++h;
- return h - l + 1;
- }
- else if (cmp < 0)
- h = mid - 1;
- else
- l = mid + 1;
- }
- return 0;
-}
-
-Pix <T>OXPBag::add(<T&> item)
-{
- if (count == 0)
- {
- ++count;
- return p.index_to_Pix(p.add_high(item));
- }
- int l = p.low();
- int h = p.high();
- while (l <= h)
- {
- int mid = (l + h) / 2;
- int cmp = <T>CMP(item, p[mid]);
- if (cmp == 0)
- {
- l = mid;
- break;
- }
- else if (cmp < 0)
- h = mid - 1;
- else
- l = mid + 1;
- }
- // add on whichever side is shortest
- ++count;
- if (l == p.fence())
- return p.index_to_Pix(p.add_high(item));
- else if (l == p.low())
- return p.index_to_Pix(p.add_low(item));
- else
- {
- if (p.high() - l < l - p.low())
- {
- h = p.add_high(p.high_element());
- for (int i = h - 1; i > l; --i) p[i] = p[i-1];
- }
- else
- {
- --l;
- h = p.add_low(p.low_element());
- for (int i = h + 1; i < l; ++i) p[i] = p[i+1];
- }
- p[l] = item;
- return p.index_to_Pix(l);
- }
-}
-
-void <T>OXPBag::del(<T&> item)
-{
- int l = p.low();
- int h = p.high();
- while (l <= h)
- {
- int mid = (l + h) / 2;
- int cmp = <T>CMP(item, p[mid]);
- if (cmp == 0)
- {
- --count;
- if (p.high() - mid < mid - p.low())
- {
- for (int i = mid; i < p.high(); ++i) p[i] = p[i+1];
- p.del_high();
- }
- else
- {
- for (int i = mid; i > p.low(); --i) p[i] = p[i-1];
- p.del_low();
- }
- return;
- }
- else if (cmp < 0)
- h = mid - 1;
- else
- l = mid + 1;
- }
-}
-
-void <T>OXPBag::remove(<T&> item)
-{
- int l = p.low();
- int h = p.high();
- while (l <= h)
- {
- int mid = (l + h) / 2;
- int cmp = <T>CMP(item, p[mid]);
- if (cmp == 0)
- {
- l = h = mid;
- while (l > p.low() && <T>EQ(item, p[l - 1])) --l;
- while (h < p.high() && <T>EQ(item, p[h + 1])) ++h;
- int n = h - l + 1;
- count -= n;
- if (p.high() - h < l - p.low())
- {
- h = p.high() - n;
- for (int i = l; i <= h; ++i) p[i] = p[i+n];
- while (n-- > 0) p.del_high();
- }
- else
- {
- l = p.low() + n;
- for (int i = h; i >= l; --i) p[i] = p[i-n];
- while (n-- > 0) p.del_low();
- }
- return;
- }
- else if (cmp < 0)
- h = mid - 1;
- else
- l = mid + 1;
- }
-}
-
-int <T>OXPBag::OK()
-{
- int v = p.OK();
- v &= count == p.length();
- for (int i = p.low(); i < p.high(); ++i) v &= <T>CMP(p[i], p[i+1]) <= 0;
- if (!v) error("invariant failure");
- return v;
-}
diff --git a/contrib/libg++/libg++/src/gen/OXPBag.hP b/contrib/libg++/libg++/src/gen/OXPBag.hP
deleted file mode 100644
index c7a251414153..000000000000
--- a/contrib/libg++/libg++/src/gen/OXPBag.hP
+++ /dev/null
@@ -1,73 +0,0 @@
-#ifndef _<T>OXPBag_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _<T>OXPBag_h 1
-
-#include "<T>.Bag.h"
-#include "<T>.XPlex.h"
-
-class <T>OXPBag : public <T>Bag
-{
-protected:
- <T>XPlex p;
-
-public:
- <T>OXPBag(int chunksize = DEFAULT_INITIAL_CAPACITY);
- <T>OXPBag(const <T>OXPBag&);
-
- Pix add(<T&> item);
- void del(<T&> item);
-#undef remove
- void remove(<T&>item);
- int nof(<T&> item);
- inline int contains(<T&> item);
-
- inline void clear();
-
- inline Pix first();
- inline void next(Pix& i);
- inline <T>& operator () (Pix i);
- inline int owns(Pix i);
- Pix seek(<T&> item, Pix from = 0);
-
- int OK();
-};
-
-
-inline <T>OXPBag::<T>OXPBag(int chunksize)
- : p(chunksize) { count = 0; }
-
-inline <T>OXPBag::<T>OXPBag(const <T>OXPBag& s) : p(s.p) { count = s.count; }
-
-inline Pix <T>OXPBag::first()
-{
- return p.first();
-}
-
-inline void <T>OXPBag::next(Pix & idx)
-{
- p.next(idx);
-}
-
-inline <T>& <T>OXPBag::operator ()(Pix idx)
-{
- return p(idx);
-}
-
-inline void <T>OXPBag::clear()
-{
- count = 0; p.clear();
-}
-
-inline int <T>OXPBag::owns (Pix idx)
-{
- return p.owns(idx);
-}
-
-inline int <T>OXPBag::contains(<T&> item)
-{
- return seek(item) != 0;
-}
-
-#endif
diff --git a/contrib/libg++/libg++/src/gen/OXPSet.ccP b/contrib/libg++/libg++/src/gen/OXPSet.ccP
deleted file mode 100644
index 397c2c986a27..000000000000
--- a/contrib/libg++/libg++/src/gen/OXPSet.ccP
+++ /dev/null
@@ -1,280 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include "<T>.OXPSet.h"
-
-
-Pix <T>OXPSet::seek(<T&> item)
-{
- int l = p.low();
- int h = p.high();
- while (l <= h)
- {
- int mid = (l + h) / 2;
- int cmp = <T>CMP(item, p[mid]);
- if (cmp == 0)
- return p.index_to_Pix(mid);
- else if (cmp < 0)
- h = mid - 1;
- else
- l = mid + 1;
- }
- return 0;
-}
-
-Pix <T>OXPSet::add(<T&> item)
-{
- if (count == 0)
- {
- ++count;
- return p.index_to_Pix(p.add_high(item));
- }
- int l = p.low();
- int h = p.high();
- while (l <= h)
- {
- int mid = (l + h) / 2;
- int cmp = <T>CMP(item, p[mid]);
- if (cmp == 0)
- return p.index_to_Pix(mid);
- else if (cmp < 0)
- h = mid - 1;
- else
- l = mid + 1;
- }
- // add on whichever side is shortest
- ++count;
- if (l == p.fence())
- return p.index_to_Pix(p.add_high(item));
- else if (l == p.low())
- return p.index_to_Pix(p.add_low(item));
- else
- {
- if (p.fence() - l < l - p.low())
- {
- h = p.add_high(p.high_element());
- for (int i = h - 1; i > l; --i) p[i] = p[i-1];
- }
- else
- {
- --l;
- h = p.add_low(p.low_element());
- for (int i = h + 1; i < l; ++i) p[i] = p[i+1];
- }
- p[l] = item;
- return p.index_to_Pix(l);
- }
-}
-
-void <T>OXPSet::del(<T&> item)
-{
- int l = p.low();
- int h = p.high();
- while (l <= h)
- {
- int mid = (l + h) / 2;
- int cmp = <T>CMP(item, p[mid]);
- if (cmp == 0)
- {
- --count;
- if (p.high() - mid < mid - p.low())
- {
- for (int i = mid; i < p.high(); ++i) p[i] = p[i+1];
- p.del_high();
- }
- else
- {
- for (int i = mid; i > p.low(); --i) p[i] = p[i-1];
- p.del_low();
- }
- return;
- }
- else if (cmp < 0)
- h = mid - 1;
- else
- l = mid + 1;
- }
-}
-
-int <T>OXPSet::operator <= (<T>OXPSet& b)
-{
- if (count > b.count) return 0;
- int i = p.low();
- int j = b.p.low();
- for (;;)
- {
- if (i >= p.fence())
- return 1;
- else if (j >= b.p.fence())
- return 0;
- int cmp = <T>CMP(p[i], b.p[j]);
- if (cmp == 0)
- {
- ++i; ++j;
- }
- else if (cmp < 0)
- return 0;
- else
- ++j;
- }
-}
-
-int <T>OXPSet::operator == (<T>OXPSet& b)
-{
- int n = count;
- if (n != b.count) return 0;
- if (n == 0) return 1;
- int i = p.low();
- int j = b.p.low();
- while (n-- > 0) if (!<T>EQ(p[i++], b.p[j++])) return 0;
- return 1;
-}
-
-
-void <T>OXPSet::operator |= (<T>OXPSet& b)
-{
- if (&b == this || b.count == 0)
- return;
- else if (b.count <= 2) // small b -- just add
- for (Pix i = b.first(); i; b.next(i)) add(b(i));
- else
- {
- // strategy: merge into top of p, simultaneously killing old bottom
- int oldfence = p.fence();
- int i = p.low();
- int j = b.p.low();
- for (;;)
- {
- if (i == oldfence)
- {
- while (j < b.p.fence()) p.add_high(b.p[j++]);
- break;
- }
- else if (j == b.p.fence())
- {
- while (i++ < oldfence)
- {
- p.add_high(p.low_element());
- p.del_low();
- }
- break;
- }
- int cmp = <T>CMP(p[i], b.p[j]);
- if (cmp <= 0)
- {
- ++i;
- if (cmp == 0) ++j;
- p.add_high(p.low_element());
- p.del_low();
- }
- else
- p.add_high(b.p[j++]);
- }
- count = p.length();
- }
-}
-
-
-
-void <T>OXPSet::operator -= (<T>OXPSet& b)
-{
- if (&b == this)
- clear();
- else if (count != 0 && b.count != 0)
- {
- int i = p.low();
- int k = i;
- int j = b.p.low();
- int oldfence = p.fence();
- for (;;)
- {
- if (i >= oldfence)
- break;
- else if (j >= b.p.fence())
- {
- if (k != i)
- while (i < oldfence) p[k++] = p[i++];
- else
- k = oldfence;
- break;
- }
- int cmp = <T>CMP(p[i], b.p[j]);
- if (cmp == 0)
- {
- ++i; ++j;
- }
- else if (cmp < 0)
- {
- if (k != i) p[k] = p[i];
- ++i; ++k;
- }
- else
- j++;
- }
- while (k++ < oldfence)
- {
- --count;
- p.del_high();
- }
- }
-}
-
-void <T>OXPSet::operator &= (<T>OXPSet& b)
-{
- if (b.count == 0)
- clear();
- else if (&b != this && count != 0)
- {
- int i = p.low();
- int k = i;
- int j = b.p.low();
- int oldfence = p.fence();
- for (;;)
- {
- if (i >= oldfence || j >= b.p.fence())
- break;
- int cmp = <T>CMP(p[i], b.p[j]);
- if (cmp == 0)
- {
- if (k != i) p[k] = p[i];
- ++i; ++k; ++j;
- }
- else if (cmp < 0)
- ++i;
- else
- ++j;
- }
- while (k++ < oldfence)
- {
- --count;
- p.del_high();
- }
- }
-}
-
-int <T>OXPSet::OK()
-{
- int v = p.OK();
- v &= count == p.length();
- for (int i = p.low(); i < p.high(); ++i) v &= <T>CMP(p[i], p[i+1]) < 0;
- if (!v) error("invariant failure");
- return v;
-}
diff --git a/contrib/libg++/libg++/src/gen/OXPSet.hP b/contrib/libg++/libg++/src/gen/OXPSet.hP
deleted file mode 100644
index cfa0f156fb92..000000000000
--- a/contrib/libg++/libg++/src/gen/OXPSet.hP
+++ /dev/null
@@ -1,102 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-
-#ifndef _<T>OXPSet_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _<T>OXPSet_h 1
-
-#include "<T>.Set.h"
-#include "<T>.XPlex.h"
-
-class <T>OXPSet : public <T>Set
-{
-protected:
- <T>XPlex p;
-
-public:
- <T>OXPSet(int chunksize = DEFAULT_INITIAL_CAPACITY);
- <T>OXPSet(const <T>OXPSet&);
-
- Pix add(<T&> item);
- void del(<T&> item);
- inline int contains(<T&> item);
-
- inline void clear();
-
- inline Pix first();
- inline void next(Pix& i);
- inline <T>& operator () (Pix i);
- inline int owns(Pix i);
- Pix seek(<T&> item);
-
- void operator |= (<T>OXPSet& b);
- void operator -= (<T>OXPSet& b);
- void operator &= (<T>OXPSet& b);
-
- int operator == (<T>OXPSet& b);
- int operator != (<T>OXPSet& b);
- int operator <= (<T>OXPSet& b);
-
- int OK();
-};
-
-
-inline <T>OXPSet::<T>OXPSet(int chunksize)
- : p(chunksize) { count = 0; }
-
-inline <T>OXPSet::<T>OXPSet(const <T>OXPSet& s) : p(s.p) { count = s.count; }
-
-inline Pix <T>OXPSet::first()
-{
- return p.first();
-}
-
-inline void <T>OXPSet::next(Pix & idx)
-{
- p.next(idx);
-}
-
-inline <T>& <T>OXPSet::operator ()(Pix idx)
-{
- return p(idx);
-}
-
-inline void <T>OXPSet::clear()
-{
- count = 0; p.clear();
-}
-
-inline int <T>OXPSet::contains (<T&> item)
-{
- return seek(item) != 0;
-}
-
-inline int <T>OXPSet::owns (Pix idx)
-{
- return p.owns(idx);
-}
-
-inline int <T>OXPSet::operator != (<T>OXPSet& b)
-{
- return !(*this == b);
-}
-
-#endif
diff --git a/contrib/libg++/libg++/src/gen/PHPQ.ccP b/contrib/libg++/libg++/src/gen/PHPQ.ccP
deleted file mode 100644
index ae8cde6cd075..000000000000
--- a/contrib/libg++/libg++/src/gen/PHPQ.ccP
+++ /dev/null
@@ -1,339 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Dirk Grunwald (grunwald@cs.uiuc.edu)
- adapted for libg++ by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <limits.h>
-#include "<T>.PHPQ.h"
-
-//
-// This defines a Pairing Heap structure
-//
-// See ``The Pairing Heap: A New Form of Self-Adjusting Heap''
-// Fredman, Segdewick et al,
-// Algorithmica (1986) 1:111-129
-//
-// In particular, this implements the pairing heap using the circular
-// list.
-//
-//
-
-<T>PHPQ::<T>PHPQ(int sz)
-{
- storage = 0;
- root = 0;
- count = 0;
- size = 0;
- prealloc(sz);
-}
-
-<T>PHPQ::<T>PHPQ(<T>PHPQ& a)
-{
- storage = 0;
- root = 0;
- count = 0;
- size = 0;
- prealloc(a.size);
- for (Pix i = a.first(); i != 0; a.next(i)) enq(a(i));
-}
-
-
-void <T>PHPQ::prealloc(int newsize)
-{
- ++newsize; // leave a spot for freelist
- if (size != 0)
- {
- int news = size;
- while (news <= newsize) news = (news * 3) / 2;
- newsize = news;
- }
- // see if indices are OK
- <T>PHPQNode test;
- test.sibling = 0;
- test.sibling = ~test.sibling;
- if ((unsigned long)newsize > (unsigned long)(test.sibling))
- error("storage size exceeds index range");
-
- if (storage == 0)
- {
- storage = new <T>PHPQNode[size = newsize];
- for (int i = 0; i < size; ++i)
- {
- storage[i].sibling = i + 1;
- storage[i].valid = 0;
- }
- storage[size-1].sibling = 0;
- }
- else
- {
- <T>PHPQNode* newstor = new <T>PHPQNode[newsize];
- for (int i = 1; i < size; ++i)
- newstor[i] = storage[i];
- delete [] storage;
- storage = newstor;
- for (int i = size; i < newsize; ++i)
- {
- storage[i].sibling = i + 1;
- storage[i].valid = 0;
- }
- storage[newsize-1].sibling = 0;
- storage[0].sibling = size;
- size = newsize;
- }
-}
-
-
-void <T>PHPQ::clear()
-{
- for (int i = 0; i < size; ++i)
- {
- storage[i].sibling = i + 1;
- storage[i].valid = 0;
- }
- storage[size-1].sibling = 0;
- root = 0;
- count = 0;
-}
-
-Pix <T>PHPQ::enq(<T&> item)
-{
- ++count;
- if (storage[0].sibling == 0)
- prealloc(count);
-
- int cell = storage[0].sibling;
- storage[0].sibling = storage[cell].sibling;
- storage[cell].sibling = 0;
- storage[cell].children = 0;
- storage[cell].item = item;
- storage[cell].valid = 1;
-
- if (root == 0)
- {
- root = cell;
- return Pix(root);
- }
- else
- {
- int parent;
- int child;
-
- if (<T>LE(storage[root].item, storage[cell].item))
- {
- parent = root; child = cell;
- }
- else
- {
- parent = cell; child = root;
- }
- int popsKid = storage[parent].children;
-
- if (popsKid == 0)
- {
- storage[parent].children = child;
- storage[child].sibling = child;
- }
- else
- {
- int temp = storage[popsKid].sibling;
- storage[popsKid].sibling = child;
- storage[child].sibling = temp;
- storage[parent].children = child;
- }
- root = parent;
- return Pix(cell);
- }
-}
-
-//
-// Item removal is the most complicated routine.
-//
-// We remove the root (should there be one) and then select a new
-// root. The siblings of the root are in a circular list. We continue
-// to pair elements in this list until there is a single element.
-// This element will be the new root.
-
-void <T>PHPQ::del_front()
-{
- int valid = 0;
- do
- {
- if (root == 0) return;
- if ((valid = storage[root].valid))
- --count;
- storage[root].valid = 0;
- int child = storage[root].children;
- storage[root].sibling = storage[0].sibling;
- storage[0].sibling = root;
-
- if (child == 0)
- {
- root = 0;
- return;
- }
- else
- {
- while(storage[child].sibling != child)
- {
- // We have at least two kids, but we may only have
- // two kids. So, oneChild != child, but it is possible
- // that twoChild == child.
-
- int oneChild = storage[child].sibling;
- int twoChild = storage[oneChild].sibling;
-
- // Remove the two from the sibling list
-
- storage[child].sibling = storage[twoChild].sibling;
- storage[oneChild].sibling = 0;
- storage[twoChild].sibling = 0;
-
- int bestChild;
- int worstChild;
-
- if (<T>LE(storage[oneChild].item, storage[twoChild].item))
- {
- bestChild = oneChild; worstChild = twoChild;
- }
- else
- {
- bestChild = twoChild; worstChild = oneChild;
- }
- int popsKid = storage[bestChild].children;
-
- if (popsKid == 0)
- {
- storage[bestChild].children = worstChild;
- storage[worstChild].sibling = worstChild;
- }
- else
- {
- int temp = storage[popsKid].sibling;
- storage[popsKid].sibling = worstChild;
- storage[worstChild].sibling = temp;
- storage[bestChild].children = worstChild;
- }
- if (twoChild == child)
- {
- // We have reduced the two to one, so we'll be exiting.
- child = bestChild;
- storage[child].sibling = child;
- }
- else
- {
- // We've removed two siblings, now we need to insert
- // the better of the two
- storage[bestChild].sibling = storage[child].sibling;
- storage[child].sibling = bestChild;
- child = storage[bestChild].sibling;
- }
- }
- root = child;
- }
- } while ( !valid );
-}
-
-void <T>PHPQ::del(Pix p)
-{
- if (p == 0) error("null Pix");
- int i = int(p);
- if (storage[i].valid)
- {
- if (i == root)
- del_front();
- else
- {
- storage[i].valid = 0;
- --count;
- }
- }
-}
-
-
-Pix <T>PHPQ::seek(<T&> key)
-{
- for (int i = 1; i < size; ++i)
- if (storage[i].valid && <T>EQ(storage[i].item, key))
- return Pix(i);
- return 0;
-}
-
-Pix <T>PHPQ::first()
-{
- for (int i = 1; i < size; ++i)
- if (storage[i].valid)
- return Pix(i);
- return 0;
-}
-
-
-void <T>PHPQ::next(Pix& p)
-{
- if (p == 0) return;
- for (int i = int(p)+1; i < size; ++i)
- if (storage[i].valid)
- {
- p = Pix(i);
- return;
- }
- p = 0;
-}
-
-int <T>PHPQ::OK()
-{
- int v = storage != 0;
- int n = 0;
- for (int i = 0; i < size; ++i) if (storage[i].valid) ++n;
- v &= n == count;
- v &= check_sibling_list(root);
- int ct = INT_MAX;
- n = 0;
- int f = storage[0].sibling;
- while (f != 0 && ct-- > 0)
- {
- f = storage[f].sibling;
- ++n;
- }
- v &= ct > 0;
- v &= n <= size - count;
- if (!v) error("invariant failure");
- return v;
-}
-
-
-int <T>PHPQ::check_sibling_list(int t)
-{
- if (t != 0)
- {
- int s = t;
- long ct = LONG_MAX; // Lots of chances to find self!
- do
- {
- if (storage[s].valid && !check_sibling_list(storage[s].children))
- return 0;
- s = storage[s].sibling;
- } while (ct-- > 0 && s != t && s != 0);
- if (ct <= 0) return 0;
- }
- return 1;
-}
-
-
diff --git a/contrib/libg++/libg++/src/gen/PHPQ.hP b/contrib/libg++/libg++/src/gen/PHPQ.hP
deleted file mode 100644
index 1964ba40dc3f..000000000000
--- a/contrib/libg++/libg++/src/gen/PHPQ.hP
+++ /dev/null
@@ -1,108 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Dirk Grunwald (grunwald@cs.uiuc.edu)
- adapted for libg++ by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifndef <T>PHPQ_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define <T>PHPQ_h 1
-
-#include "<T>.PQ.h"
-
-#ifndef <T>PHPQIndex
-#define <T>PHPQIndex unsigned short
-#endif
-
-struct <T>PHPQNode
-{
- <T>PHPQIndex sibling;
- <T>PHPQIndex children;
- <T> item;
- char valid;
-};
-
-
-class <T>PHPQ : public <T>PQ
-{
- <T>PHPQNode* storage; // table -- freelist in storage[0].sibling
- int root;
- int size;
-
- void prealloc(int);
- int check_sibling_list(int);
-
-public:
-
- <T>PHPQ(int sz = DEFAULT_INITIAL_CAPACITY);
- <T>PHPQ(<T>PHPQ&);
- inline ~<T>PHPQ();
-
- Pix enq(<T&> item);
- inline <T> deq();
-
- inline <T>& front();
- void del_front();
-
- inline int contains(<T&> item);
-
- void clear();
-
- Pix first();
- void next(Pix& i);
- inline <T>& operator () (Pix i);
- void del(Pix i);
- Pix seek(<T&> item);
-
- int OK(); // rep invariant
-};
-
-
-inline <T>PHPQ::~<T>PHPQ()
-{
- delete [] storage;
-}
-
-
-inline <T> <T>PHPQ::deq()
-{
- if (count == 0) error("deq of empty PQ");
- <T> x = storage[root].item;
- del_front();
- return x;
-}
-
-
-inline <T>& <T>PHPQ::front()
-{
- if (count == 0) error("front of empty PQ");
- return storage[root].item;
-}
-
-inline int <T>PHPQ::contains(<T&> item)
-{
- return seek(item) != 0;
-}
-
-inline <T>& <T>PHPQ::operator() (Pix p)
-{
- if (p == 0) error("null Pix");
- return storage[int(p)].item;
-}
-
-#endif
diff --git a/contrib/libg++/libg++/src/gen/PQ.ccP b/contrib/libg++/libg++/src/gen/PQ.ccP
deleted file mode 100644
index ec3bd06210c9..000000000000
--- a/contrib/libg++/libg++/src/gen/PQ.ccP
+++ /dev/null
@@ -1,63 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <builtin.h>
-#include "<T>.PQ.h"
-
-
-
-<T> <T>PQ::deq()
-{
- <T> x = front();
- del_front();
- return x;
-}
-
-Pix <T>PQ::seek(<T&> item)
-{
- Pix i;
- for (i = first(); i != 0 && !(<T>EQ((*this)(i), item)); next(i));
- return i;
-}
-
-int <T>PQ::owns(Pix idx)
-{
- if (idx == 0) return 0;
- for (Pix i = first(); i; next(i)) if (i == idx) return 1;
- return 0;
-}
-
-void <T>PQ::clear()
-{
- while (count != 0) del_front();
-}
-
-int <T>PQ::contains (<T&> item)
-{
- return seek(item) != 0;
-}
-
-
-void <T>PQ::error(const char* msg)
-{
- (*lib_error_handler)("PQ", msg);
-}
-
diff --git a/contrib/libg++/libg++/src/gen/PQ.hP b/contrib/libg++/libg++/src/gen/PQ.hP
deleted file mode 100644
index efe18f87e7fe..000000000000
--- a/contrib/libg++/libg++/src/gen/PQ.hP
+++ /dev/null
@@ -1,78 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-
-#ifndef _<T>PQ_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _<T>PQ_h 1
-
-#include <Pix.h>
-#include "<T>.defs.h"
-
-class <T>PQ
-{
-protected:
-
- int count;
-
-public:
- <T>PQ();
- inline virtual ~<T>PQ();
-
- int length(); // current number of items
- int empty();
-
- virtual Pix enq(<T&> item) = 0; // add item; return Pix
- virtual <T> deq(); // return & remove min
-
- virtual <T>& front() = 0; // access min item
- virtual void del_front() = 0; // delete min item
-
- virtual int contains(<T&> item); // is item in PQ?
-
- virtual void clear(); // delete all items
-
- virtual Pix first() = 0; // Pix of first item or 0
- virtual void next(Pix& i) = 0; // advance to next or 0
- virtual <T>& operator () (Pix i) = 0; // access item at i
- virtual void del(Pix i) = 0; // delete item at i
- virtual int owns(Pix i); // is i a valid Pix ?
- virtual Pix seek(<T&> item); // Pix of item
-
- void error(const char* msg);
- virtual int OK() = 0; // rep invariant
-};
-
-
-inline <T>PQ::<T>PQ() :count(0) {}
-
-inline <T>PQ::~<T>PQ() {}
-
-inline int <T>PQ::length()
-{
- return count;
-}
-
-inline int <T>PQ::empty()
-{
- return count == 0;
-}
-
-#endif
diff --git a/contrib/libg++/libg++/src/gen/PSList.hP b/contrib/libg++/libg++/src/gen/PSList.hP
deleted file mode 100644
index eacb34dbe354..000000000000
--- a/contrib/libg++/libg++/src/gen/PSList.hP
+++ /dev/null
@@ -1,32 +0,0 @@
-/* : Light weight list: This will simply reuse code from a VoidP List, which
-was genclassed from the SLList libg++ class. The classes generated from this file
-will all be derived classes from class VoidSLList or intSLList. Note that class SLList does not
-offer all the functionality of List classes, such as sharing of sub-lists.
-However, no additional code is needed at all and no .cc file is generated. So it costs nothing
-to use these type-safe lists. Only member functions needing type casting are re-defined */
-
-
-#ifndef _<T>SList_h
-#define _<T>SList_h 1
-
-#include "VoidP.SLList.h"
-#include "<T>.defs.h"
-
-class <T>SList : public VoidPSLList
-{
-public:
- <T>SList() {}
- <T>SList(<T>SList& a) : (a) {}
- ~<T>SList() {}
-
- <T>SList& operator = (<T>SList& a) {
- return (<T>SList&) VoidPSLList::operator= (a); }
-
- <T>& operator () (Pix p) { return (<T>&) (VoidPSLList::operator() (p)); }
- <T>& front() { return (<T>&) VoidPSLList::front(); }
- <T>& rear() { return (<T>&) VoidPSLList::rear(); }
- <T> remove_front() { return (<T>) VoidPSLList::remove_front(); }
-
-};
-
-#endif /* conditional include */
diff --git a/contrib/libg++/libg++/src/gen/PVec.hP b/contrib/libg++/libg++/src/gen/PVec.hP
deleted file mode 100644
index de32482610b4..000000000000
--- a/contrib/libg++/libg++/src/gen/PVec.hP
+++ /dev/null
@@ -1,79 +0,0 @@
-/* : light weight Vector: This will simply reuse code from */
-/* a VoidP Vec, which was genclassed from the Vec libg++ class. */
-/* The classes generated from this file will all be derived classes */
-/* from class VoidVec or intVec. No .cc file is generated. So */
-/* it costs nothing to use these type-safe Vectors. Only member */
-/* functions needing type casting are re-defined. */
-/* */
-
-#ifndef _<T>Vec_h
-#define _<T>Vec_h 1
-
-#include "VoidP.Vec.h"
-#include "<T>.defs.h"
-
-
-#ifndef _<T>_typedefs
-#define _<T>_typedefs 1
-typedef void (*<T>Procedure)(<T> );
-typedef <T> (*<T>Mapper)(<T> );
-typedef <T> (*<T>Combiner)(<T> , <T> );
-typedef int (*<T>Predicate)(<T> );
-typedef int (*<T>Comparator)(<T> , <T> );
-#endif
-
-class <T>Vec : public VoidPVec
-{
-protected:
- <T>Vec(int l, <T>* d) : (l, (VoidP*) d) {};
-public:
- <T>Vec() {};
- <T>Vec(int l) : (l) {};
- <T>Vec(int l, <T&> fill_value) : (l, fill_value) {};
- <T>Vec(<T>Vec& v) : (v) {};
- <T>Vec(VoidPVec& v) {fake_copy(v, s, len);}
- ~<T>Vec() {};
-
- <T>Vec& operator = (<T>Vec& a)
- {return (<T>Vec&) VoidPVec::operator= (a);}
- <T>Vec at(int from, int n) {return (<T>Vec) VoidPVec::at(from, n);}
-
- <T>& operator [] (int n) {return (<T>&)VoidPVec::operator[] (n);}
- <T>& elem(int n) {return (<T>&)VoidPVec::elem(n);}
-
- friend <T>Vec concat(<T>Vec& a, <T>Vec& b);
- friend <T>Vec map(<T>Mapper f, <T>Vec & a);
- friend <T>Vec merge(<T>Vec & a, <T>Vec & b, <T>Comparator f);
- friend <T>Vec combine(<T>Combiner f, <T>Vec & a, <T>Vec & b);
- friend <T>Vec reverse(<T>Vec& a);
-
- void sort(<T>Comparator f);
- void apply(<T>Procedure f);
- <T> reduce(<T>Combiner f, <T> base);
-};
-
-inline <T>Vec concat(<T>Vec& a, <T>Vec& b)
-{return (<T>Vec)concat((VoidPVec&)a, (VoidPVec&)b);}
-
-inline <T>Vec map(<T>Mapper f, <T>Vec & a) {
- return (<T>Vec)map((VoidPMapper)f, (VoidPVec&)a); }
-
-inline <T>Vec merge(<T>Vec & a, <T>Vec & b, <T>Comparator f) {
- return (<T>Vec)merge((VoidPVec&)a, (VoidPVec&)b, (VoidPComparator)f); }
-
-inline <T>Vec combine(<T>Combiner f, <T>Vec & a, <T>Vec & b) {
- return (<T>Vec)combine((VoidPCombiner)f, (VoidPVec&)a, (VoidPVec&)b); }
-
-inline <T>Vec reverse(<T>Vec& a) {
- return (<T>Vec)reverse((VoidPVec&)a);}
-
-inline void <T>Vec::sort(<T>Comparator f) {
- VoidPVec::sort((VoidPComparator) f); }
-
-inline void <T>Vec::apply(<T>Procedure f) {
- VoidPVec::apply((VoidPProcedure) f); }
-
-inline <T> <T>Vec::reduce(<T>Combiner f, <T> base) {
- return (<T>)VoidPVec::reduce((VoidPCombiner)f, base);}
-
-#endif /* conditional include */
diff --git a/contrib/libg++/libg++/src/gen/Plex.ccP b/contrib/libg++/libg++/src/gen/Plex.ccP
deleted file mode 100644
index 9a62571aca00..000000000000
--- a/contrib/libg++/libg++/src/gen/Plex.ccP
+++ /dev/null
@@ -1,222 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
- based on code by Marc Shapiro (shapiro@sor.inria.fr)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <stream.h>
-#include <builtin.h>
-#include "<T>.Plex.h"
-
-// IChunk support
-
-void <T>IChunk::error(const char* msg) const
-{
- (*lib_error_handler)("<T>IChunk", msg);
-}
-
-void <T>IChunk::index_error() const
-{
- error("attempt to use invalid index");
-}
-
-void <T>IChunk::empty_error() const
-{
- error("invalid use of empty chunk");
-}
-
-void <T>IChunk::full_error() const
-{
- error("attempt to extend chunk beyond bounds");
-}
-
-<T>IChunk:: ~<T>IChunk() {}
-
-<T>IChunk::<T>IChunk(<T>* d,
- int baseidx,
- int lowidx,
- int fenceidx,
- int topidx)
-{
- if (d == 0 || baseidx > lowidx || lowidx > fenceidx || fenceidx > topidx)
- error("inconsistent specification");
- data = d;
- base = baseidx;
- low = lowidx;
- fence = fenceidx;
- top = topidx;
- nxt = prv = this;
-}
-
-void <T>IChunk:: re_index(int lo)
-{
- int delta = lo - low;
- base += delta;
- low += delta;
- fence += delta;
- top += delta;
-}
-
-
-void <T>IChunk::clear(int lo)
-{
- int s = top - base;
- low = base = fence = lo;
- top = base + s;
-}
-
-void <T>IChunk::cleardown(int hi)
-{
- int s = top - base;
- low = top = fence = hi;
- base = top - s;
-}
-
-int <T>IChunk:: OK() const
-{
- int v = data != 0; // have some data
- v &= base <= low; // ok, index-wise
- v &= low <= fence;
- v &= fence <= top;
-
- v &= nxt->prv == this; // and links are OK
- v &= prv->nxt == this;
- if (!v) error("invariant failure");
- return(v);
-}
-
-
-// error handling
-
-
-void <T>Plex::error(const char* msg) const
-{
- (*lib_error_handler)("Plex", msg);
-}
-
-void <T>Plex::index_error() const
-{
- error("attempt to access invalid index");
-}
-
-void <T>Plex::empty_error() const
-{
- error("attempted operation on empty plex");
-}
-
-void <T>Plex::full_error() const
-{
- error("attempt to increase size of plex past limit");
-}
-
-// generic plex ops
-
-<T>Plex:: ~<T>Plex()
-{
- invalidate();
-}
-
-
-void <T>Plex::append (const <T>Plex& a)
-{
- for (int i = a.low(); i < a.fence(); a.next(i)) add_high(a[i]);
-}
-
-void <T>Plex::prepend (const <T>Plex& a)
-{
- for (int i = a.high(); i > a.ecnef(); a.prev(i)) add_low(a[i]);
-}
-
-void <T>Plex::reverse()
-{
- <T> tmp;
- int l = low();
- int h = high();
- while (l < h)
- {
- tmp = (*this)[l];
- (*this)[l] = (*this)[h];
- (*this)[h] = tmp;
- next(l);
- prev(h);
- }
-}
-
-
-void <T>Plex::fill(const <T&> x)
-{
- for (int i = lo; i < fnc; ++i) (*this)[i] = x;
-}
-
-void <T>Plex::fill(const <T&> x, int lo, int hi)
-{
- for (int i = lo; i <= hi; ++i) (*this)[i] = x;
-}
-
-
-void <T>Plex::del_chunk(<T>IChunk* x)
-{
- if (x != 0)
- {
- x->unlink();
- <T>* data = (<T>*)(x->invalidate());
- delete [] data;
- delete x;
- }
-}
-
-
-void <T>Plex::invalidate()
-{
- <T>IChunk* t = hd;
- if (t != 0)
- {
- <T>IChunk* tail = tl();
- while (t != tail)
- {
- <T>IChunk* nxt = t->next();
- del_chunk(t);
- t = nxt;
- }
- del_chunk(t);
- hd = 0;
- }
-}
-
-int <T>Plex::reset_low(int l)
-{
- int old = lo;
- int diff = l - lo;
- if (diff != 0)
- {
- lo += diff;
- fnc += diff;
- <T>IChunk* t = hd;
- do
- {
- t->re_index(t->low_index() + diff);
- t = t->next();
- } while (t != hd);
- }
- return old;
-}
-
-
-
-
diff --git a/contrib/libg++/libg++/src/gen/Plex.hP b/contrib/libg++/libg++/src/gen/Plex.hP
deleted file mode 100644
index d756167b15a4..000000000000
--- a/contrib/libg++/libg++/src/gen/Plex.hP
+++ /dev/null
@@ -1,494 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
- based on code by Marc Shapiro (shapiro@sor.inria.fr)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifndef _<T>Plex_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _<T>Plex_h 1
-
-#include <std.h>
-#include <Pix.h>
-#include "<T>.defs.h"
-
-// Plexes are made out of <T>IChunks
-
-#include <stddef.h>
-
-class <T>IChunk
-{
-//public: // kludge until C++ `protected' policies settled
-protected:
-
- <T>* data; // data, from client
-
- int base; // lowest possible index
- int low; // lowest valid index
- int fence; // highest valid index + 1
- int top; // highest possible index + 1
-
- <T>IChunk* nxt; // circular links
- <T>IChunk* prv;
-
-public:
-
-// constructors
-
- <T>IChunk(<T>* d, // ptr to array of elements
- int base_idx, // initial indices
- int low_idx,
- int fence_idx,
- int top_idx);
-
- virtual ~<T>IChunk();
-
-// status reports
-
- int size() const; // number of slots
-
- inline virtual int empty() const ;
- inline virtual int full() const ;
-
- int can_grow_high () const ; // there is space to add data
- int can_grow_low () const;
-
- int base_index() const; // lowest possible index;
- int low_index() const; // lowest actual index;
- inline virtual int first_index() const; // lowest valid index or fence if none
- inline virtual int last_index() const; // highest valid index or low-1 if none
- int fence_index() const; // highest actual index + 1
- int top_index() const; // highest possible index + 1
-
-// indexing conversion
-
- int possible_index(int i) const; // i between base and top
- int actual_index(int i) const; // i between low and fence
- inline virtual int valid_index(int i) const; // i not deleted (mainly for mchunks)
-
- int possible_pointer(const <T>* p) const; // same for ptr
- int actual_pointer(const <T>* p) const;
- inline virtual int valid_pointer(const <T>* p) const;
-
- <T>* pointer_to(int i) const ; // pointer to data indexed by i
- // caution: i is not checked for validity
- int index_of(const <T>* p) const; // index of data pointed to by p
- // caution: p is not checked for validity
-
- inline virtual int succ(int idx) const; // next valid index or fence if none
- inline virtual int pred(int idx) const; // previous index or low - 1 if none
-
- inline virtual <T>* first_pointer() const; // pointer to first valid pos or 0
- inline virtual <T>* last_pointer() const; // pointer to first valid pos or 0
- inline virtual <T>* succ(<T>* p) const; // next pointer or 0
- inline virtual <T>* pred(<T>* p) const; // previous pointer or 0
-
-// modification
-
- inline virtual <T>* grow_high (); // return spot to add an element
- inline virtual <T>* grow_low ();
-
- inline virtual void shrink_high (); // logically delete top index
- inline virtual void shrink_low ();
-
- virtual void clear(int lo); // reset to empty ch with base = lo
- virtual void cleardown(int hi); // reset to empty ch with top = hi
- void re_index(int lo); // re-index so lo is new low
-
-// chunk traversal
-
- <T>IChunk* next() const;
- <T>IChunk* prev() const;
-
- void link_to_prev(<T>IChunk* prev);
- void link_to_next(<T>IChunk* next);
- void unlink();
-
-// state checks
-
- <T>* invalidate(); // mark self as invalid; return data
- // for possible deletion
-
- virtual int OK() const; // representation invariant
-
- void error(const char*) const;
- void empty_error() const;
- void full_error() const;
- void index_error() const;
-};
-
-// <T>Plex is a partly `abstract' class: few of the virtuals
-// are implemented at the Plex level, only in the subclasses
-
-class <T>Plex
-{
-protected:
-
- <T>IChunk* hd; // a chunk holding the data
- int lo; // lowest index
- int fnc; // highest index + 1
- int csize; // size of the chunk
-
- void invalidate(); // mark so OK() is false
- void del_chunk(<T>IChunk*); // delete a chunk
-
- <T>IChunk* tl() const; // last chunk;
- int one_chunk() const; // true if hd == tl()
-
-public:
-
-// constructors, etc.
-
- <T>Plex(); // no-op
-
- virtual ~<T>Plex();
-
-
-// Access functions
-
- virtual <T>& operator [] (int idx) = 0; // access by index;
- virtual <T>& operator () (Pix p) = 0; // access by Pix;
-
- virtual <T>& high_element () = 0; // access high element
- virtual <T>& low_element () = 0; // access low element
-
-// read-only versions for const Plexes
-
- virtual const <T>& operator [] (int idx) const = 0; // access by index;
- virtual const <T>& operator () (Pix p) const = 0; // access by Pix;
-
- virtual const <T>& high_element () const = 0; // access high element
- virtual const <T>& low_element () const = 0; // access low element
-
-
-// Index functions
-
- virtual int valid (int idx) const = 0; // idx is an OK index
-
- virtual int low() const = 0; // lowest index or fence if none
- virtual int high() const = 0; // highest index or low-1 if none
-
- int ecnef() const; // low limit index (low-1)
- int fence() const; // high limit index (high+1)
-
- virtual void prev(int& idx) const= 0; // set idx to preceding index
- // caution: pred may be out of bounds
-
- virtual void next(int& idx) const = 0; // set to next index
- // caution: succ may be out of bounds
-
- virtual Pix first() const = 0; // Pix to low element or 0
- virtual Pix last() const = 0; // Pix to high element or 0
- virtual void prev(Pix& pix) const = 0; // preceding pix or 0
- virtual void next(Pix& pix) const = 0; // next pix or 0
- virtual int owns(Pix p) const = 0; // p is an OK Pix
-
-// index<->Pix
-
- virtual int Pix_to_index(Pix p) const = 0; // get index via Pix
- virtual Pix index_to_Pix(int idx) const = 0; // Pix via index
-
-// Growth
-
- virtual int add_high(const <T&> elem) =0;// add new element at high end
- // return new high
-
- virtual int add_low(const <T&> elem) = 0; // add new low element,
- // return new low
-
-// Shrinkage
-
- virtual int del_high() = 0; // remove the element at high end
- // return new high
- virtual int del_low() = 0; // delete low element, return new lo
-
- // caution: del_low/high
- // does not necessarily
- // immediately call <T>::~<T>
-
-
-// operations on multiple elements
-
- virtual void fill(const <T&> x); // set all elements = x
- virtual void fill(const <T&> x, int from, int to); // fill from to to
- virtual void clear() = 0; // reset to zero-sized Plex
- virtual int reset_low(int newlow); // change low index,return old
- virtual void reverse(); // reverse in-place
- virtual void append(const <T>Plex& a); // concatenate a copy
- virtual void prepend(const <T>Plex& a); // prepend a copy
-
-// status
-
- virtual int can_add_high() const = 0;
- virtual int can_add_low() const = 0;
-
- int length () const; // number of slots
-
- int empty () const; // is the plex empty?
- virtual int full() const = 0; // it it full?
-
- int chunk_size() const; // report chunk size;
-
- virtual int OK() const = 0; // representation invariant
-
- void error(const char* msg) const;
- void index_error() const;
- void empty_error() const;
- void full_error() const;
-};
-
-
-// <T>IChunk ops
-
-inline int <T>IChunk:: size() const
-{
- return top - base;
-}
-
-
-inline int <T>IChunk:: base_index() const
-{
- return base;
-}
-
-inline int <T>IChunk:: low_index() const
-{
- return low;
-}
-
-inline int <T>IChunk:: fence_index() const
-{
- return fence;
-}
-
-inline int <T>IChunk:: top_index() const
-{
- return top;
-}
-
-inline <T>* <T>IChunk:: pointer_to(int i) const
-{
- return &(data[i-base]);
-}
-
-inline int <T>IChunk:: index_of(const <T>* p) const
-{
- return ((int)p - (int)data) / sizeof(<T>) + base;
-}
-
-inline int <T>IChunk:: possible_index(int i) const
-{
- return i >= base && i < top;
-}
-
-inline int <T>IChunk:: possible_pointer(const <T>* p) const
-{
- return p >= data && p < &(data[top-base]);
-}
-
-inline int <T>IChunk:: actual_index(int i) const
-{
- return i >= low && i < fence;
-}
-
-inline int <T>IChunk:: actual_pointer(const <T>* p) const
-{
- return p >= data && p < &(data[fence-base]);
-}
-
-inline int <T>IChunk:: can_grow_high () const
-{
- return fence < top;
-}
-
-inline int <T>IChunk:: can_grow_low () const
-{
- return base < low;
-}
-
-inline <T>* <T>IChunk:: invalidate()
-{
- <T>* p = data;
- data = 0;
- return p;
-}
-
-
-inline <T>IChunk* <T>IChunk::prev() const
-{
- return prv;
-}
-
-inline <T>IChunk* <T>IChunk::next() const
-{
- return nxt;
-}
-
-inline void <T>IChunk::link_to_prev(<T>IChunk* prev)
-{
- nxt = prev->nxt;
- prv = prev;
- nxt->prv = this;
- prv->nxt = this;
-}
-
-inline void <T>IChunk::link_to_next(<T>IChunk* next)
-{
- prv = next->prv;
- nxt = next;
- nxt->prv = this;
- prv->nxt = this;
-}
-
-inline void <T>IChunk::unlink()
-{
- <T>IChunk* n = nxt;
- <T>IChunk* p = prv;
- n->prv = p;
- p->nxt = n;
- prv = nxt = this;
-}
-
-inline int <T>IChunk:: empty() const
-{
- return low == fence;
-}
-
-inline int <T>IChunk:: full() const
-{
- return top - base == fence - low;
-}
-
-inline int <T>IChunk:: first_index() const
-{
- return (low == fence)? fence : low;
-}
-
-inline int <T>IChunk:: last_index() const
-{
- return (low == fence)? low - 1 : fence - 1;
-}
-
-inline int <T>IChunk:: succ(int i) const
-{
- return (i < low) ? low : i + 1;
-}
-
-inline int <T>IChunk:: pred(int i) const
-{
- return (i > fence) ? (fence - 1) : i - 1;
-}
-
-inline int <T>IChunk:: valid_index(int i) const
-{
- return i >= low && i < fence;
-}
-
-inline int <T>IChunk:: valid_pointer(const <T>* p) const
-{
- return p >= &(data[low - base]) && p < &(data[fence - base]);
-}
-
-inline <T>* <T>IChunk:: grow_high ()
-{
- if (!can_grow_high()) full_error();
- return &(data[fence++ - base]);
-}
-
-inline <T>* <T>IChunk:: grow_low ()
-{
- if (!can_grow_low()) full_error();
- return &(data[--low - base]);
-}
-
-inline void <T>IChunk:: shrink_high ()
-{
- if (empty()) empty_error();
- --fence;
-}
-
-inline void <T>IChunk:: shrink_low ()
-{
- if (empty()) empty_error();
- ++low;
-}
-
-inline <T>* <T>IChunk::first_pointer() const
-{
- return (low == fence)? 0 : &(data[low - base]);
-}
-
-inline <T>* <T>IChunk::last_pointer() const
-{
- return (low == fence)? 0 : &(data[fence - base - 1]);
-}
-
-inline <T>* <T>IChunk::succ(<T>* p) const
-{
- return ((p+1) < &(data[low - base]) || (p+1) >= &(data[fence - base])) ?
- 0 : (p+1);
-}
-
-inline <T>* <T>IChunk::pred(<T>* p) const
-{
- return ((p-1) < &(data[low - base]) || (p-1) >= &(data[fence - base])) ?
- 0 : (p-1);
-}
-
-
-// generic Plex operations
-
-inline <T>Plex::<T>Plex() {}
-
-inline int <T>Plex::chunk_size() const
-{
- return csize;
-}
-
-inline int <T>Plex::ecnef () const
-{
- return lo - 1;
-}
-
-
-inline int <T>Plex::fence () const
-{
- return fnc;
-}
-
-inline int <T>Plex::length () const
-{
- return fnc - lo;
-}
-
-inline int <T>Plex::empty () const
-{
- return fnc == lo;
-}
-
-inline <T>IChunk* <T>Plex::tl() const
-{
- return hd->prev();
-}
-
-inline int <T>Plex::one_chunk() const
-{
- return hd == hd->prev();
-}
-
-#endif
diff --git a/contrib/libg++/libg++/src/gen/Queue.ccP b/contrib/libg++/libg++/src/gen/Queue.ccP
deleted file mode 100644
index fb48d952ff71..000000000000
--- a/contrib/libg++/libg++/src/gen/Queue.ccP
+++ /dev/null
@@ -1,14 +0,0 @@
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include "<T>.Queue.h"
-
-<T>Queue::~<T>Queue() {}
-
-
-// error handling
-
-void <T>Queue::error(const char* msg)
-{
- (*lib_error_handler)("Queue", msg);
-}
diff --git a/contrib/libg++/libg++/src/gen/Queue.hP b/contrib/libg++/libg++/src/gen/Queue.hP
deleted file mode 100644
index c7e05ac6124f..000000000000
--- a/contrib/libg++/libg++/src/gen/Queue.hP
+++ /dev/null
@@ -1,51 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-
-#ifndef _<T>Queue_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _<T>Queue_h
-
-#include <builtin.h>
-
-#include "<T>.defs.h"
-
-class <T>Queue
-{
-public:
- <T>Queue() { }
- virtual ~<T>Queue();
-
- virtual void enq(<T&> item) = 0;
- virtual <T> deq() = 0;
- virtual <T>& front() = 0;
- virtual void del_front() = 0;
-
- virtual void clear() = 0;
- virtual int empty() = 0;
- virtual int full() = 0;
- virtual int length() = 0;
-
- void error(const char*);
-
- virtual int OK() = 0;
-};
-
-#endif
diff --git a/contrib/libg++/libg++/src/gen/RAVLMap.ccP b/contrib/libg++/libg++/src/gen/RAVLMap.ccP
deleted file mode 100644
index 9477250a6e60..000000000000
--- a/contrib/libg++/libg++/src/gen/RAVLMap.ccP
+++ /dev/null
@@ -1,690 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <stream.h>
-#include "<T>.<C>.RAVLMap.h"
-
-
-/*
- constants & inlines for maintaining balance & thread status in tree nodes
-*/
-
-#define AVLBALANCEMASK 3
-#define AVLBALANCED 0
-#define AVLLEFTHEAVY 1
-#define AVLRIGHTHEAVY 2
-
-#define LTHREADBIT 4
-#define RTHREADBIT 8
-
-
-static inline int bf(<T><C>RAVLNode* t)
-{
- return t->stat & AVLBALANCEMASK;
-}
-
-static inline void set_bf(<T><C>RAVLNode* t, int b)
-{
- t->stat = (t->stat & ~AVLBALANCEMASK) | (b & AVLBALANCEMASK);
-}
-
-
-static inline int rthread(<T><C>RAVLNode* t)
-{
- return t->stat & RTHREADBIT;
-}
-
-static inline void set_rthread(<T><C>RAVLNode* t, int b)
-{
- if (b)
- t->stat |= RTHREADBIT;
- else
- t->stat &= ~RTHREADBIT;
-}
-
-static inline int lthread(<T><C>RAVLNode* t)
-{
- return t->stat & LTHREADBIT;
-}
-
-static inline void set_lthread(<T><C>RAVLNode* t, int b)
-{
- if (b)
- t->stat |= LTHREADBIT;
- else
- t->stat &= ~LTHREADBIT;
-}
-
-/*
- traversal primitives
-*/
-
-
-<T><C>RAVLNode* <T><C>RAVLMap::leftmost()
-{
- <T><C>RAVLNode* t = root;
- if (t != 0) while (t->lt != 0) t = t->lt;
- return t;
-}
-
-<T><C>RAVLNode* <T><C>RAVLMap::rightmost()
-{
- <T><C>RAVLNode* t = root;
- if (t != 0) while (t->rt != 0) t = t->rt;
- return t;
-}
-
-<T><C>RAVLNode* <T><C>RAVLMap::succ(<T><C>RAVLNode* t)
-{
- <T><C>RAVLNode* r = t->rt;
- if (!rthread(t)) while (!lthread(r)) r = r->lt;
- return r;
-}
-
-<T><C>RAVLNode* <T><C>RAVLMap::pred(<T><C>RAVLNode* t)
-{
- <T><C>RAVLNode* l = t->lt;
- if (!lthread(t)) while (!rthread(l)) l = l->rt;
- return l;
-}
-
-
-Pix <T><C>RAVLMap::seek(<T&> key)
-{
- <T><C>RAVLNode* t = root;
- if (t == 0)
- return 0;
- for (;;)
- {
- int cmp = <T>CMP(key, t->item);
- if (cmp == 0)
- return Pix(t);
- else if (cmp < 0)
- {
- if (lthread(t))
- return 0;
- else
- t = t->lt;
- }
- else if (rthread(t))
- return 0;
- else
- t = t->rt;
- }
-}
-
-
-int <T><C>RAVLMap::rankof(<T&> key)
-{
- int r;
- <T><C>RAVLNode* t = root;
- if (t == 0)
- return 0;
- for (r=t->rank; t != 0; r+=t->rank)
- {
- int cmp = <T>CMP(key, t->item);
- if (cmp == 0)
- return r;
- else if (cmp < 0)
- {
- if (lthread(t))
- return 0;
- else
- {
- r -= t->rank;
- t = t->lt;
- }
- }
- else if (rthread(t))
- return 0;
- else
- {
- t = t->rt;
- }
- }
- return 0;
-}
-
-Pix <T><C>RAVLMap::ranktoPix(int i)
-{
- int r;
- <T><C>RAVLNode* t = root;
-
- if ((i<1)||(i>count))
- return 0;
- for (r=t->rank; r!=i; r+=t->rank)
- {
- if (r>i)
- {
- r -= t->rank;
- t = t->lt;
- }
- else
- t = t->rt;
- }
- return Pix(t);
-}
-
-/*
- The combination of threads and AVL bits make adding & deleting
- interesting, but very awkward.
-
- We use the following statics to avoid passing them around recursively
-*/
-
-static int _need_rebalancing; // to send back balance info from rec. calls
-static <T>* _target_item; // add/del_item target
-static <T><C>RAVLNode* _found_node; // returned added/deleted node
-static int _already_found; // for deletion subcases
-static int _rank_changed; // for rank computation
-
-
-void <T><C>RAVLMap:: _add(<T><C>RAVLNode*& t)
-{
- int cmp = <T>CMP(*_target_item, t->item);
- if (cmp == 0)
- {
- _found_node = t;
- return;
- }
- else if (cmp < 0)
- {
- if (lthread(t))
- {
- ++count;
- _found_node = new <T><C>RAVLNode(*_target_item, def);
- set_lthread(_found_node, 1);
- set_rthread(_found_node, 1);
- _found_node->lt = t->lt;
- _found_node->rt = t;
- t->lt = _found_node;
- set_lthread(t, 0);
- _need_rebalancing = 1;
- _rank_changed = 1;
- }
- else
- _add(t->lt);
- if (_rank_changed) ++t->rank;
- if (_need_rebalancing)
- {
- switch(bf(t))
- {
- case AVLRIGHTHEAVY:
- set_bf(t, AVLBALANCED);
- _need_rebalancing = 0;
- return;
- case AVLBALANCED:
- set_bf(t, AVLLEFTHEAVY);
- return;
- case AVLLEFTHEAVY:
- {
- <T><C>RAVLNode* l = t->lt;
- if (bf(l) == AVLLEFTHEAVY)
- {
- t->rank -= l->rank;
- if (rthread(l))
- t->lt = l;
- else
- t->lt = l->rt;
- set_lthread(t, rthread(l));
- l->rt = t;
- set_rthread(l, 0);
- set_bf(t, AVLBALANCED);
- set_bf(l, AVLBALANCED);
- t = l;
- _need_rebalancing = 0;
- }
- else
- {
- <T><C>RAVLNode* r = l->rt;
- r->rank += l->rank;
- t->rank -= r->rank;
- set_rthread(l, lthread(r));
- if (lthread(r))
- l->rt = r;
- else
- l->rt = r->lt;
- r->lt = l;
- set_lthread(r, 0);
- set_lthread(t, rthread(r));
- if (rthread(r))
- t->lt = r;
- else
- t->lt = r->rt;
- r->rt = t;
- set_rthread(r, 0);
- if (bf(r) == AVLLEFTHEAVY)
- set_bf(t, AVLRIGHTHEAVY);
- else
- set_bf(t, AVLBALANCED);
- if (bf(r) == AVLRIGHTHEAVY)
- set_bf(l, AVLLEFTHEAVY);
- else
- set_bf(l, AVLBALANCED);
- set_bf(r, AVLBALANCED);
- t = r;
- _need_rebalancing = 0;
- return;
- }
- }
- }
- }
- }
- else
- {
- if (rthread(t))
- {
- ++count;
- _found_node = new <T><C>RAVLNode(*_target_item, def);
- set_rthread(t, 0);
- set_lthread(_found_node, 1);
- set_rthread(_found_node, 1);
- _found_node->lt = t;
- _found_node->rt = t->rt;
- t->rt = _found_node;
- _need_rebalancing = 1;
- _rank_changed = 1;
- }
- else
- _add(t->rt);
- if (_need_rebalancing)
- {
- switch(bf(t))
- {
- case AVLLEFTHEAVY:
- set_bf(t, AVLBALANCED);
- _need_rebalancing = 0;
- return;
- case AVLBALANCED:
- set_bf(t, AVLRIGHTHEAVY);
- return;
- case AVLRIGHTHEAVY:
- {
- <T><C>RAVLNode* r = t->rt;
- if (bf(r) == AVLRIGHTHEAVY)
- {
- r->rank += t->rank;
- if (lthread(r))
- t->rt = r;
- else
- t->rt = r->lt;
- set_rthread(t, lthread(r));
- r->lt = t;
- set_lthread(r, 0);
- set_bf(t, AVLBALANCED);
- set_bf(r, AVLBALANCED);
- t = r;
- _need_rebalancing = 0;
- }
- else
- {
- <T><C>RAVLNode* l = r->lt;
- r->rank -= l->rank;
- l->rank += t->rank;
- set_lthread(r, rthread(l));
- if (rthread(l))
- r->lt = l;
- else
- r->lt = l->rt;
- l->rt = r;
- set_rthread(l, 0);
- set_rthread(t, lthread(l));
- if (lthread(l))
- t->rt = l;
- else
- t->rt = l->lt;
- l->lt = t;
- set_lthread(l, 0);
- if (bf(l) == AVLRIGHTHEAVY)
- set_bf(t, AVLLEFTHEAVY);
- else
- set_bf(t, AVLBALANCED);
- if (bf(l) == AVLLEFTHEAVY)
- set_bf(r, AVLRIGHTHEAVY);
- else
- set_bf(r, AVLBALANCED);
- set_bf(l, AVLBALANCED);
- t = l;
- _need_rebalancing = 0;
- return;
- }
- }
- }
- }
- }
-}
-
-
-<C>& <T><C>RAVLMap::operator [] (<T&> item)
-{
- if (root == 0)
- {
- ++count;
- root = new <T><C>RAVLNode(item, def);
- set_rthread(root, 1);
- set_lthread(root, 1);
- return root->cont;
- }
- else
- {
- _target_item = &item;
- _need_rebalancing = 0;
- _rank_changed = 0;
- _add(root);
- return _found_node->cont;
- }
-}
-
-
-void <T><C>RAVLMap::_del(<T><C>RAVLNode* par, <T><C>RAVLNode*& t)
-{
- int comp;
- if (_already_found)
- {
- if (rthread(t))
- comp = 0;
- else
- comp = 1;
- }
- else
- comp = <T>CMP(*_target_item, t->item);
- if (comp == 0)
- {
- if (lthread(t) && rthread(t))
- {
- _found_node = t;
- if (t == par->lt)
- {
- set_lthread(par, 1);
- par->lt = t->lt;
- }
- else
- {
- set_rthread(par, 1);
- par->rt = t->rt;
- }
- _need_rebalancing = 1;
- _rank_changed = 1;
- return;
- }
- else if (lthread(t))
- {
- _found_node = t;
- <T><C>RAVLNode* s = succ(t);
- if (s != 0 && lthread(s))
- s->lt = t->lt;
- t = t->rt;
- _need_rebalancing = 1;
- _rank_changed = 1;
- return;
- }
- else if (rthread(t))
- {
- _found_node = t;
- <T><C>RAVLNode* p = pred(t);
- if (p != 0 && rthread(p))
- p->rt = t->rt;
- t = t->lt;
- _need_rebalancing = 1;
- _rank_changed = 1;
- return;
- }
- else // replace item & find someone deletable
- {
- <T><C>RAVLNode* p = pred(t);
- t->item = p->item;
- t->cont = p->cont;
- _already_found = 1;
- comp = -1; // fall through below to left
- }
- }
-
- if (comp < 0)
- {
- if (lthread(t))
- return;
- _del(t, t->lt);
- if (_rank_changed) --t->rank;
- if (!_need_rebalancing)
- return;
- switch (bf(t))
- {
- case AVLLEFTHEAVY:
- set_bf(t, AVLBALANCED);
- return;
- case AVLBALANCED:
- set_bf(t, AVLRIGHTHEAVY);
- _need_rebalancing = 0;
- return;
- case AVLRIGHTHEAVY:
- {
- <T><C>RAVLNode* r = t->rt;
- switch (bf(r))
- {
- case AVLBALANCED:
- r->rank += t->rank;
- if (lthread(r))
- t->rt = r;
- else
- t->rt = r->lt;
- set_rthread(t, lthread(r));
- r->lt = t;
- set_lthread(r, 0);
- set_bf(t, AVLRIGHTHEAVY);
- set_bf(r, AVLLEFTHEAVY);
- _need_rebalancing = 0;
- t = r;
- return;
- case AVLRIGHTHEAVY:
- r->rank += t->rank;
- if (lthread(r))
- t->rt = r;
- else
- t->rt = r->lt;
- set_rthread(t, lthread(r));
- r->lt = t;
- set_lthread(r, 0);
- set_bf(t, AVLBALANCED);
- set_bf(r, AVLBALANCED);
- t = r;
- return;
- case AVLLEFTHEAVY:
- {
- <T><C>RAVLNode* l = r->lt;
- r->rank -= l->rank;
- l->rank += t->rank;
- set_lthread(r, rthread(l));
- if (rthread(l))
- r->lt = l;
- else
- r->lt = l->rt;
- l->rt = r;
- set_rthread(l, 0);
- set_rthread(t, lthread(l));
- if (lthread(l))
- t->rt = l;
- else
- t->rt = l->lt;
- l->lt = t;
- set_lthread(l, 0);
- if (bf(l) == AVLRIGHTHEAVY)
- set_bf(t, AVLLEFTHEAVY);
- else
- set_bf(t, AVLBALANCED);
- if (bf(l) == AVLLEFTHEAVY)
- set_bf(r, AVLRIGHTHEAVY);
- else
- set_bf(r, AVLBALANCED);
- set_bf(l, AVLBALANCED);
- t = l;
- return;
- }
- }
- }
- }
- }
- else
- {
- if (rthread(t))
- return;
- _del(t, t->rt);
- if (!_need_rebalancing)
- return;
- switch (bf(t))
- {
- case AVLRIGHTHEAVY:
- set_bf(t, AVLBALANCED);
- return;
- case AVLBALANCED:
- set_bf(t, AVLLEFTHEAVY);
- _need_rebalancing = 0;
- return;
- case AVLLEFTHEAVY:
- {
- <T><C>RAVLNode* l = t->lt;
- switch (bf(l))
- {
- case AVLBALANCED:
- t->rank -= l->rank;
- if (rthread(l))
- t->lt = l;
- else
- t->lt = l->rt;
- set_lthread(t, rthread(l));
- l->rt = t;
- set_rthread(l, 0);
- set_bf(t, AVLLEFTHEAVY);
- set_bf(l, AVLRIGHTHEAVY);
- _need_rebalancing = 0;
- t = l;
- return;
- case AVLLEFTHEAVY:
- t->rank -= l->rank;
- if (rthread(l))
- t->lt = l;
- else
- t->lt = l->rt;
- set_lthread(t, rthread(l));
- l->rt = t;
- set_rthread(l, 0);
- set_bf(t, AVLBALANCED);
- set_bf(l, AVLBALANCED);
- t = l;
- return;
- case AVLRIGHTHEAVY:
- {
- <T><C>RAVLNode* r = l->rt;
- r->rank += l->rank;
- t->rank -= r->rank;
- set_rthread(l, lthread(r));
- if (lthread(r))
- l->rt = r;
- else
- l->rt = r->lt;
- r->lt = l;
- set_lthread(r, 0);
- set_lthread(t, rthread(r));
- if (rthread(r))
- t->lt = r;
- else
- t->lt = r->rt;
- r->rt = t;
- set_rthread(r, 0);
- if (bf(r) == AVLLEFTHEAVY)
- set_bf(t, AVLRIGHTHEAVY);
- else
- set_bf(t, AVLBALANCED);
- if (bf(r) == AVLRIGHTHEAVY)
- set_bf(l, AVLLEFTHEAVY);
- else
- set_bf(l, AVLBALANCED);
- set_bf(r, AVLBALANCED);
- t = r;
- return;
- }
- }
- }
- }
- }
-}
-
-
-void <T><C>RAVLMap::del(<T&> item)
-{
- if (root == 0) return;
- _need_rebalancing = 0;
- _already_found = 0;
- _found_node = 0;
- _rank_changed = 0;
- _target_item = &item;
- _del(root, root);
- if (_found_node)
- {
- delete(_found_node);
- if (--count == 0)
- root = 0;
- }
-}
-
-void <T><C>RAVLMap::_kill(<T><C>RAVLNode* t)
-{
- if (t != 0)
- {
- if (!lthread(t)) _kill(t->lt);
- if (!rthread(t)) _kill(t->rt);
- delete t;
- }
-}
-
-
-<T><C>RAVLMap::<T><C>RAVLMap(<T><C>RAVLMap& b) :<T><C>Map(b.def)
-{
- root = 0;
- count = 0;
- for (Pix i = b.first(); i != 0; b.next(i))
- (*this)[b.key(i)] = b.contents(i);
-}
-
-
-int <T><C>RAVLMap::OK()
-{
- int v = 1;
- if (root == 0)
- v = count == 0;
- else
- {
- int n = 1;
- <T><C>RAVLNode* trail = leftmost();
- v &= rankof(trail->item) == n;
- <T><C>RAVLNode* t = succ(trail);
- while (t != 0)
- {
- ++n;
- v &= <T>CMP(trail->item, t->item) < 0;
- v &= rankof(t->item) == n;
- trail = t;
- t = succ(t);
- }
- v &= n == count;
- }
- if (!v) error("invariant failure");
- return v;
-}
diff --git a/contrib/libg++/libg++/src/gen/RAVLMap.hP b/contrib/libg++/libg++/src/gen/RAVLMap.hP
deleted file mode 100644
index 1009ef1a9a57..000000000000
--- a/contrib/libg++/libg++/src/gen/RAVLMap.hP
+++ /dev/null
@@ -1,147 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
- ranking code from Paul Anderson (paul%lfcs.ed.ac.uk)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-
-#ifndef _<T><C>RAVLMap_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _<T><C>RAVLMap_h 1
-
-#include "<T>.<C>.Map.h"
-
-struct <T><C>RAVLNode
-{
- <T><C>RAVLNode* lt;
- <T><C>RAVLNode* rt;
- <T> item;
- <C> cont;
- int rank;
- char stat;
- <T><C>RAVLNode(<T&> h, <C&> c,
- <T><C>RAVLNode* l=0, <T><C>RAVLNode* r=0, int k=1);
- ~<T><C>RAVLNode();
-};
-
-inline <T><C>RAVLNode::<T><C>RAVLNode(<T&> h, <C&> c,
- <T><C>RAVLNode* l, <T><C>RAVLNode* r, int k)
- :lt(l), rt(r), item(h), cont(c), rank(k), stat(0) {}
-
-inline <T><C>RAVLNode::~<T><C>RAVLNode() {}
-
-typedef <T><C>RAVLNode* <T><C>RAVLNodePtr;
-
-
-class <T><C>RAVLMap : public <T><C>Map
-{
-protected:
- <T><C>RAVLNode* root;
-
- <T><C>RAVLNode* leftmost();
- <T><C>RAVLNode* rightmost();
- <T><C>RAVLNode* pred(<T><C>RAVLNode* t);
- <T><C>RAVLNode* succ(<T><C>RAVLNode* t);
- void _kill(<T><C>RAVLNode* t);
- void _add(<T><C>RAVLNode*& t);
- void _del(<T><C>RAVLNode* p, <T><C>RAVLNode*& t);
-
-public:
- <T><C>RAVLMap(<C&> dflt);
- <T><C>RAVLMap(<T><C>RAVLMap& a);
- inline ~<T><C>RAVLMap();
-
- <C>& operator [] (<T&> key);
-
- void del(<T&> key);
-
- inline Pix first();
- inline void next(Pix& i);
- inline <T>& key(Pix i);
- inline <C>& contents(Pix i);
-
- Pix seek(<T&> key);
- inline int contains(<T&> key);
-
- Pix ranktoPix(int i);
- int rankof(<T&> key);
-
- inline void clear();
-
- Pix last();
- void prev(Pix& i);
-
- int OK();
-};
-
-inline <T><C>RAVLMap::~<T><C>RAVLMap()
-{
- _kill(root);
-}
-
-inline <T><C>RAVLMap::<T><C>RAVLMap(<C&> dflt) :<T><C>Map(dflt)
-{
- root = 0;
-}
-
-
-inline Pix <T><C>RAVLMap::first()
-{
- return Pix(leftmost());
-}
-
-inline Pix <T><C>RAVLMap::last()
-{
- return Pix(rightmost());
-}
-
-inline void <T><C>RAVLMap::next(Pix& i)
-{
- if (i != 0) i = Pix(succ((<T><C>RAVLNode*)i));
-}
-
-inline void <T><C>RAVLMap::prev(Pix& i)
-{
- if (i != 0) i = Pix(pred((<T><C>RAVLNode*)i));
-}
-
-inline <T>& <T><C>RAVLMap::key(Pix i)
-{
- if (i == 0) error("null Pix");
- return ((<T><C>RAVLNode*)i)->item;
-}
-
-inline <C>& <T><C>RAVLMap::contents(Pix i)
-{
- if (i == 0) error("null Pix");
- return ((<T><C>RAVLNode*)i)->cont;
-}
-
-inline void <T><C>RAVLMap::clear()
-{
- _kill(root);
- count = 0;
- root = 0;
-}
-
-inline int <T><C>RAVLMap::contains(<T&> key)
-{
- return seek(key) != 0;
-}
-
-#endif
diff --git a/contrib/libg++/libg++/src/gen/RPlex.ccP b/contrib/libg++/libg++/src/gen/RPlex.ccP
deleted file mode 100644
index 1707b5d0ab2a..000000000000
--- a/contrib/libg++/libg++/src/gen/RPlex.ccP
+++ /dev/null
@@ -1,477 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
- based on code by Marc Shapiro (shapiro@sor.inria.fr)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include "<T>.RPlex.h"
-
-typedef <T>IChunk* _<T>IChunk_ptr;
-
-<T>RPlex:: <T>RPlex()
-{
- lo = fnc = 0;
- csize = DEFAULT_INITIAL_CAPACITY;
- <T>* data = new <T>[csize];
- set_cache(new <T>IChunk(data, lo, lo, fnc, lo+csize));
- hd = ch;
- maxch = MIN_NCHUNKS;
- lch = maxch / 2;
- fch = lch + 1;
- base = ch->base_index() - lch * csize;
- chunks = new _<T>IChunk_ptr[maxch];
- chunks[lch] = ch;
-}
-
-<T>RPlex:: <T>RPlex(int chunksize)
-{
- if (chunksize == 0) error("invalid constructor specification");
- lo = fnc = 0;
- if (chunksize > 0)
- {
- csize = chunksize;
- <T>* data = new <T>[csize];
- set_cache(new <T>IChunk(data, lo, lo, fnc, csize+lo));
- hd = ch;
- }
- else
- {
- csize = -chunksize;
- <T>* data = new <T>[csize];
- set_cache(new <T>IChunk(data, chunksize+lo, lo, fnc, fnc));
- hd = ch;
- }
- maxch = MIN_NCHUNKS;
- lch = maxch / 2;
- fch = lch + 1;
- base = ch->base_index() - lch * csize;
- chunks = new _<T>IChunk_ptr[maxch];
- chunks[lch] = ch;
-}
-
-
-<T>RPlex:: <T>RPlex(int l, int chunksize)
-{
- if (chunksize == 0) error("invalid constructor specification");
- lo = fnc = l;
- if (chunksize > 0)
- {
- csize = chunksize;
- <T>* data = new <T>[csize];
- set_cache(new <T>IChunk(data, lo, lo, fnc, lo+csize));
- hd = ch;
- }
- else
- {
- csize = -chunksize;
- <T>* data = new <T>[csize];
- set_cache(new <T>IChunk(data, chunksize+lo, lo, fnc, fnc));
- hd = ch;
- }
- maxch = MIN_NCHUNKS;
- lch = maxch / 2;
- fch = lch + 1;
- base = ch->base_index() - lch * csize;
- chunks = new _<T>IChunk_ptr[maxch];
- chunks[lch] = ch;
-}
-
-void <T>RPlex::make_initial_chunks(int up)
-{
- int count = 0;
- int need = fnc - lo;
- hd = 0;
- if (up)
- {
- int l = lo;
- do
- {
- ++count;
- int sz;
- if (need >= csize)
- sz = csize;
- else
- sz = need;
- <T>* data = new <T> [csize];
- <T>IChunk* h = new <T>IChunk(data, l, l, l+sz, l+csize);
- if (hd != 0)
- h->link_to_next(hd);
- else
- hd = h;
- l += sz;
- need -= sz;
- } while (need > 0);
- }
- else
- {
- int hi = fnc;
- do
- {
- ++count;
- int sz;
- if (need >= csize)
- sz = csize;
- else
- sz = need;
- <T>* data = new <T> [csize];
- <T>IChunk* h = new <T>IChunk(data, hi-csize, hi-sz, hi, hi);
- if (hd != 0)
- h->link_to_next(hd);
- hd = h;
- hi -= sz;
- need -= sz;
- } while (need > 0);
- }
- set_cache((<T>IChunk*)hd);
-
- maxch = MIN_NCHUNKS;
- if (maxch < count * 2)
- maxch = count * 2;
- chunks = new _<T>IChunk_ptr[maxch];
- lch = maxch / 3;
- fch = lch + count;
- base = ch->base_index() - csize * lch;
- int k = lch;
- do
- {
- chunks[k++] = ch;
- set_cache(ch->next());
- } while (ch != hd);
-}
-
-<T>RPlex:: <T>RPlex(int l, int hi, const <T&> initval, int chunksize)
-{
- lo = l;
- fnc = hi + 1;
- if (chunksize == 0)
- {
- csize = fnc - l;
- make_initial_chunks(1);
- }
- else if (chunksize < 0)
- {
- csize = -chunksize;
- make_initial_chunks(0);
- }
- else
- {
- csize = chunksize;
- make_initial_chunks(1);
- }
- fill(initval);
-}
-
-<T>RPlex::<T>RPlex(const <T>RPlex& a)
-{
- lo = a.lo;
- fnc = a.fnc;
- csize = a.csize;
- make_initial_chunks();
- for (int i = a.low(); i < a.fence(); a.next(i)) (*this)[i] = a[i];
-}
-
-void <T>RPlex::operator= (const <T>RPlex& a)
-{
- if (&a != this)
- {
- invalidate();
- lo = a.lo;
- fnc = a.fnc;
- csize = a.csize;
- make_initial_chunks();
- for (int i = a.low(); i < a.fence(); a.next(i)) (*this)[i] = a[i];
- }
-}
-
-
-void <T>RPlex::cache(const <T>* p) const
-{
- const <T>IChunk* old = ch;
- const <T>IChunk* t = ch;
- while (!t->actual_pointer(p))
- {
- t = (t->next());
- if (t == old) index_error();
- }
- set_cache(t);
-}
-
-int <T>RPlex::owns(Pix px) const
-{
- <T>* p = (<T>*)px;
- const <T>IChunk* old = ch;
- const <T>IChunk* t = ch;
- while (!t->actual_pointer(p))
- {
- t = (t->next());
- if (t == old) return 0;
- }
- set_cache(t);
- return 1;
-}
-
-
-<T>* <T>RPlex::dosucc(const <T>* p) const
-{
- if (p == 0) return 0;
- const <T>IChunk* old = ch;
- const <T>IChunk* t = ch;
- while (!t->actual_pointer(p))
- {
- t = (t->next());
- if (t == old) return 0;
- }
- int i = t->index_of(p) + 1;
- if (i >= fnc) return 0;
- if (i >= t->fence_index()) t = (t->next());
- set_cache(t);
- return t->pointer_to(i);
-}
-
-<T>* <T>RPlex::dopred(const <T>* p) const
-{
- if (p == 0) return 0;
- const <T>IChunk* old = ch;
- const <T>IChunk* t = ch;
- while (!t->actual_pointer(p))
- {
- t = (t->prev());
- if (t == old) return 0;
- }
- int i = t->index_of(p) - 1;
- if (i < lo) return 0;
- if (i < t->low_index()) t = (t->prev());
- set_cache(t);
- return (t->pointer_to(i));
-}
-
-int <T>RPlex::add_high(const <T&> elem)
-{
- <T>IChunk* t = tl();
- if (!t->can_grow_high())
- {
- if (t-><T>IChunk::empty() && one_chunk())
- {
- t->clear(fnc);
- base = t->base_index() - lch * csize;
- }
- else
- {
- <T>* data = new <T> [csize];
- t = (new <T>IChunk(data, fnc, fnc, fnc,fnc+csize));
- t->link_to_prev(tl());
- if (fch == maxch)
- {
- maxch *= 2;
- <T>IChunk** newch = new _<T>IChunk_ptr [maxch];
- memcpy(newch, chunks, fch * sizeof(_<T>IChunk_ptr));
- delete chunks;
- chunks = newch;
- }
- chunks[fch++] = t;
- }
- }
- *((t-><T>IChunk::grow_high())) = elem;
- set_cache(t);
- return fnc++;
-}
-
-int <T>RPlex::del_high ()
-{
- if (empty()) empty_error();
- <T>IChunk* t = tl();
- if (t-><T>IChunk::empty()) // kill straggler first
- {
- <T>IChunk* pred = t->prev();
- del_chunk(t);
- t = (pred);
- --fch;
- }
- t-><T>IChunk::shrink_high();
- if (t-><T>IChunk::empty() && !one_chunk())
- {
- <T>IChunk* pred = t->prev();
- del_chunk(t);
- t = (pred);
- --fch;
- }
- set_cache(t);
- return --fnc - 1;
-}
-
-int <T>RPlex::add_low (const <T&> elem)
-{
- <T>IChunk* t = hd;
- if (!t->can_grow_low())
- {
- if (t-><T>IChunk::empty() && one_chunk())
- {
- t->cleardown(lo);
- base = t->base_index() - lch * csize;
- }
- else
- {
- <T>* data = new <T> [csize];
- hd = new <T>IChunk(data, lo-csize, lo, lo, lo);
- hd->link_to_next(t);
- t = ( hd);
- if (lch == 0)
- {
- lch = maxch;
- fch += maxch;
- maxch *= 2;
- <T>IChunk** newch = new _<T>IChunk_ptr [maxch];
- memcpy(&(newch[lch]), chunks, lch * sizeof(_<T>IChunk_ptr));
- delete chunks;
- chunks = newch;
- base = t->base_index() - (lch - 1) * csize;
- }
- chunks[--lch] = t;
- }
- }
- *((t-><T>IChunk::grow_low())) = elem;
- set_cache(t);
- return --lo;
-}
-
-
-int <T>RPlex::del_low ()
-{
- if (empty()) empty_error();
- <T>IChunk* t = hd;
- if (t-><T>IChunk::empty())
- {
- hd = t->next();
- del_chunk(t);
- t = hd;
- ++lch;
- }
- t-><T>IChunk::shrink_low();
- if (t-><T>IChunk::empty() && !one_chunk())
- {
- hd = t->next();
- del_chunk(t);
- t = hd;
- ++lch;
- }
- set_cache(t);
- return ++lo;
-}
-
-void <T>RPlex::reverse()
-{
- <T> tmp;
- int l = lo;
- int h = fnc - 1;
- <T>IChunk* loch = hd;
- <T>IChunk* hich = tl();
- while (l < h)
- {
- <T>* lptr = loch->pointer_to(l);
- <T>* hptr = hich->pointer_to(h);
- tmp = *lptr;
- *lptr = *hptr;
- *hptr = tmp;
- if (++l >= loch->fence_index()) loch = loch->next();
- if (--h < hich->low_index()) hich = hich->prev();
- }
-}
-
-void <T>RPlex::fill(const <T&> x)
-{
- for (int i = lo; i < fnc; ++i) (*this)[i] = x;
-}
-
-void <T>RPlex::fill(const <T&> x, int lo, int hi)
-{
- for (int i = lo; i <= hi; ++i) (*this)[i] = x;
-}
-
-
-void <T>RPlex::clear()
-{
- for (int i = lch + 1; i < fch; ++i)
- del_chunk(chunks[i]);
- fch = lch + 1;
- set_cache(chunks[lch]);
- ch-><T>IChunk::clear(lo);
- fnc = lo;
-}
-
-int <T>RPlex::reset_low(int l)
-{
- int old = lo;
- int diff = l - lo;
- if (diff != 0)
- {
- lo += diff;
- fnc += diff;
- <T>IChunk* t = hd;
- do
- {
- t->re_index(t->low_index() + diff);
- t = t->next();
- } while (t != hd);
- }
- base = hd->base_index() - lch * csize;
- return old;
-}
-
-
-int <T>RPlex::OK () const
-{
- int v = hd != 0 && ch != 0; // at least one chunk
-
- v &= fnc == tl()->fence_index(); // last chunk fnc == plex fnc
- v &= lo == hd-><T>IChunk::low_index(); // first lo == plex lo
-
- v &= base == hd->base_index() - lch * csize; // base is correct;
- v &= lch < fch;
- v &= fch <= maxch; // within allocation;
-
-// loop for others:
-
- int k = lch; // to cross-check nch
-
- int found_ch = 0; // to make sure ch is in list;
- const <T>IChunk* t = (hd);
- for (;;)
- {
- v &= chunks[k++] == t; // each chunk is at proper index
- if (t == ch) ++found_ch;
- v &= t-><T>IChunk::OK(); // each chunk is OK
- if (t == tl())
- break;
- else // and has indices contiguous to succ
- {
- v &= t->top_index() == t->next()->base_index();
- if (t != hd) // internal chunks full
- {
- v &= !t->empty();
- v &= !t->can_grow_low();
- v &= !t->can_grow_high();
- }
- t = t->next();
- }
- }
- v &= found_ch == 1;
- v &= fch == k;
- if (!v) error("invariant failure");
- return v;
-}
diff --git a/contrib/libg++/libg++/src/gen/RPlex.hP b/contrib/libg++/libg++/src/gen/RPlex.hP
deleted file mode 100644
index 546adaa3c5dc..000000000000
--- a/contrib/libg++/libg++/src/gen/RPlex.hP
+++ /dev/null
@@ -1,257 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
- based on code by Marc Shapiro (shapiro@sor.inria.fr)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifndef _<T>RPlex_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _<T>RPlex_h 1
-
-#include "<T>.Plex.h"
-
-// minimum number of chunks to index
-
-#ifndef MIN_NCHUNKS
-#define MIN_NCHUNKS 16
-#endif
-
-class <T>RPlex: public <T>Plex
-{
- int base; // base index of lowest chunk
- int lch; // index of lowest used chunk
- int fch; // 1 + index of highest used chunk
- int maxch; // max chunks in array
- <T>IChunk** chunks; // array of chunks
- <T>IChunk* ch; // cached chunk
-
- void make_initial_chunks(int up = 1);
-
- void cache(int idx) const;
- void cache(const <T>* p) const;
- <T>* dopred(const <T>* p) const;
- <T>* dosucc(const <T>* p) const;
-
- inline void set_cache(const <T>IChunk* t) const; // logically,
- // not physically const
-
-public:
- <T>RPlex(); // set low = 0;
- // fence = 0;
- // csize = default
-
- <T>RPlex(int ch_size); // low = 0;
- // fence = 0;
- // csize = ch_size
-
- <T>RPlex(int lo, // low = lo;
- int ch_size); // fence=lo
- // csize = ch_size
-
- <T>RPlex(int lo, // low = lo
- int hi, // fence = hi+1
- const <T&> initval,// fill with initval,
- int ch_size = 0); // csize= ch_size
- // or fence-lo if 0
-
- <T>RPlex(const <T>RPlex&);
-
- inline ~<T>RPlex();
-
- void operator= (const <T>RPlex&);
-
-// virtuals
-
- inline <T>& high_element ();
- inline <T>& low_element ();
-
- inline const <T>& high_element () const;
- inline const <T>& low_element () const;
-
- inline Pix first() const;
- inline Pix last() const;
- inline void prev(Pix& ptr) const;
- inline void next(Pix& ptr) const;
- int owns(Pix p) const;
- inline <T>& operator () (Pix p);
- inline const <T>& operator () (Pix p) const;
-
- inline int low() const;
- inline int high() const;
- inline int valid(int idx) const;
- inline void prev(int& idx) const;
- inline void next(int& x) const;
- inline <T>& operator [] (int index);
- inline const <T>& operator [] (int index) const;
-
- inline int Pix_to_index(Pix p) const;
- inline Pix index_to_Pix(int idx) const;
-
- inline int can_add_high() const;
- inline int can_add_low() const;
- inline int full() const;
-
- int add_high(const <T&> elem);
- int del_high ();
- int add_low (const <T&> elem);
- int del_low ();
-
- void fill(const <T&> x);
- void fill(const <T&> x, int from, int to);
- void clear();
- void reverse();
-
- int reset_low(int newlow);
-
- int OK () const;
-};
-
-
-inline void <T>RPlex::prev(int& idx) const
-{
- --idx;
-}
-
-inline void <T>RPlex::next(int& idx) const
-{
- ++idx;
-}
-
-inline int <T>RPlex::full () const
-{
- return 0;
-}
-
-inline int <T>RPlex::can_add_high() const
-{
- return 1;
-}
-
-inline int <T>RPlex::can_add_low() const
-{
- return 1;
-}
-
-inline int <T>RPlex::valid (int idx) const
-{
- return idx >= lo && idx < fnc;
-}
-
-inline int <T>RPlex::low() const
-{
- return lo;
-}
-
-inline int <T>RPlex::high() const
-{
- return fnc - 1;
-}
-
-inline void <T>RPlex::set_cache(const <T>IChunk* t) const
-{
- ((<T>RPlex*)(this))->ch = (<T>IChunk*)t;
-}
-
-inline void <T>RPlex::cache(int idx) const
-{
- if (idx < lo || idx >= fnc) index_error();
- set_cache(chunks[(idx - base) / csize]);
-}
-
-inline <T>& <T>RPlex::low_element ()
-{
- cache(lo); return *(ch->pointer_to(lo));
-}
-
-inline <T>& <T>RPlex::high_element ()
-{
- cache(fnc-1); return *(ch->pointer_to(fnc - 1));
-}
-
-inline const <T>& <T>RPlex::low_element () const
-{
- cache(lo); return *((const <T>*)(ch->pointer_to(lo)));
-}
-
-inline const <T>& <T>RPlex::high_element () const
-{
- cache(fnc-1); return *((const <T>*)(ch->pointer_to(fnc - 1)));
-}
-
-inline int <T>RPlex::Pix_to_index(Pix px) const
-{
- <T>* p = (<T>*)px;
- if (!ch->actual_pointer(p)) cache(p);
- return ch->index_of(p);
-}
-
-inline Pix <T>RPlex::index_to_Pix(int idx) const
-{
- if (!ch->actual_index(idx)) cache(idx);
- return (Pix)(ch->pointer_to(idx));
-}
-
-inline Pix <T>RPlex::first() const
-{
- return Pix(hd-><T>IChunk::first_pointer());
-}
-
-inline Pix <T>RPlex::last() const
-{
- return Pix(tl()-><T>IChunk::last_pointer());
-}
-
-inline void <T>RPlex::prev(Pix& p) const
-{
- Pix q = Pix(ch-><T>IChunk::pred((<T>*)p));
- p = (q == 0)? Pix(dopred((<T>*)p)) : q;
-}
-
-inline void <T>RPlex::next(Pix& p) const
-{
- Pix q = Pix(ch-><T>IChunk::succ((<T>*)p));
- p = (q == 0)? Pix(dosucc((<T>*)p)) : q;
-}
-
-inline <T>& <T>RPlex:: operator () (Pix p)
-{
- return *((<T>*)p);
-}
-
-
-inline <T>& <T>RPlex:: operator [] (int idx)
-{
- cache(idx); return *(ch->pointer_to(idx));
-}
-
-inline const <T>& <T>RPlex:: operator () (Pix p) const
-{
- return *((const <T>*)p);
-}
-
-inline const <T>& <T>RPlex:: operator [] (int idx) const
-{
- cache(idx); return *((const <T>*)(ch->pointer_to(idx)));
-}
-
-inline <T>RPlex::~<T>RPlex()
-{
- delete chunks;
-}
-
-#endif
diff --git a/contrib/libg++/libg++/src/gen/SLBag.ccP b/contrib/libg++/libg++/src/gen/SLBag.ccP
deleted file mode 100644
index 6b7c0faca5c8..000000000000
--- a/contrib/libg++/libg++/src/gen/SLBag.ccP
+++ /dev/null
@@ -1,105 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include "<T>.SLBag.h"
-
-int <T>SLBag::OK()
-{
- int v = p.OK();
- v &= count == p.length();
- if (!v) error("invariant failure");
- return v;
-}
-
-Pix <T>SLBag::seek(<T&> item, Pix i)
-{
- if (i == 0) i = first(); else next(i);
- for (; i != 0 && (!(<T>EQ(p(i), item))); p.next(i));
- return i;
-}
-
-int <T>SLBag::nof(<T&> item)
-{
- int n = 0;
- for (Pix p = first(); p; next(p)) if (<T>EQ((*this)(p), item)) ++n;
- return n;
-}
-
-
-void <T>SLBag::del(<T&> item)
-{
- Pix i = p.first();
- if (i == 0)
- return;
- else if (<T>EQ(p(i), item))
- {
- --count;
- p.del_front();
- }
- else
- {
- Pix trail = i;
- p.next(i);
- while (i != 0)
- {
- if (<T>EQ(p(i), item))
- {
- --count;
- p.del_after(trail);
- return;
- }
- trail = i;
- p.next(i);
- }
- }
-}
-
-void <T>SLBag::remove(<T&> item)
-{
- Pix i = p.first();
- while (i != 0 && <T>EQ(p(i), item))
- {
- --count;
- p.del_front();
- i = p.first();
- }
- if (i != 0)
- {
- Pix trail = i;
- p.next(i);
- while (i != 0)
- {
- if (<T>EQ(p(i), item))
- {
- --count;
- p.del_after(trail);
- i = trail;
- p.next(i);
- }
- else
- {
- trail = i;
- p.next(i);
- }
- }
- }
-}
-
diff --git a/contrib/libg++/libg++/src/gen/SLBag.hP b/contrib/libg++/libg++/src/gen/SLBag.hP
deleted file mode 100644
index 2bab7db64a92..000000000000
--- a/contrib/libg++/libg++/src/gen/SLBag.hP
+++ /dev/null
@@ -1,96 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-
-#ifndef _<T>SLBag_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _<T>SLBag_h 1
-
-#include "<T>.Bag.h"
-#include "<T>.SLList.h"
-
-class <T>SLBag : public <T>Bag
-{
-protected:
- <T>SLList p;
-
-public:
- <T>SLBag();
- <T>SLBag(const <T>SLBag&);
-
- inline Pix add(<T&> item);
- void del(<T&> item);
- void remove(<T&>item);
- inline int contains(<T&> item);
- int nof(<T&> item);
-
- inline void clear();
-
- inline Pix first();
- inline void next(Pix& i);
- inline <T>& operator () (Pix i);
- inline int owns(Pix i);
- Pix seek(<T&> item, Pix from = 0);
-
- int OK();
-};
-
-
-inline <T>SLBag::<T>SLBag() : p() { count = 0; }
-
-inline <T>SLBag::<T>SLBag(const <T>SLBag& s) : p(s.p) { count = s.count; }
-
-inline Pix <T>SLBag::first()
-{
- return p.first();
-}
-
-inline void <T>SLBag::next(Pix & idx)
-{
- p.next(idx);
-}
-
-inline <T>& <T>SLBag::operator ()(Pix idx)
-{
- return p(idx);
-}
-
-inline void <T>SLBag::clear()
-{
- count = 0; p.clear();
-}
-
-inline int <T>SLBag::owns (Pix idx)
-{
- return p.owns(idx);
-}
-
-inline Pix <T>SLBag::add(<T&> item)
-{
- ++count;
- return p.append(item);
-}
-
-inline int <T>SLBag::contains(<T&> item)
-{
- return seek(item) != 0;
-}
-
-#endif
diff --git a/contrib/libg++/libg++/src/gen/SLList.ccP b/contrib/libg++/libg++/src/gen/SLList.ccP
deleted file mode 100644
index 3dbe22f3d388..000000000000
--- a/contrib/libg++/libg++/src/gen/SLList.ccP
+++ /dev/null
@@ -1,292 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-// WARNING: This file is obsolete. Use ../SLList.cc, if you can.
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <limits.h>
-#include <stream.h>
-#include <builtin.h>
-#include "<T>.SLList.h"
-
-void <T>SLList::error(const char* msg)
-{
- (*lib_error_handler)("SLList", msg);
-}
-
-int <T>SLList::length()
-{
- int l = 0;
- <T>SLListNode* t = last;
- if (t != 0) do { ++l; t = t->tl; } while (t != last);
- return l;
-}
-
-<T>SLList::<T>SLList(const <T>SLList& a)
-{
- if (a.last == 0)
- last = 0;
- else
- {
- <T>SLListNode* p = a.last->tl;
- <T>SLListNode* h = new <T>SLListNode(p->hd);
- last = h;
- for (;;)
- {
- if (p == a.last)
- {
- last->tl = h;
- return;
- }
- p = p->tl;
- <T>SLListNode* n = new <T>SLListNode(p->hd);
- last->tl = n;
- last = n;
- }
- }
-}
-
-<T>SLList& <T>SLList::operator = (const <T>SLList& a)
-{
- if (last != a.last)
- {
- clear();
- if (a.last != 0)
- {
- <T>SLListNode* p = a.last->tl;
- <T>SLListNode* h = new <T>SLListNode(p->hd);
- last = h;
- for (;;)
- {
- if (p == a.last)
- {
- last->tl = h;
- break;
- }
- p = p->tl;
- <T>SLListNode* n = new <T>SLListNode(p->hd);
- last->tl = n;
- last = n;
- }
- }
- }
- return *this;
-}
-
-void <T>SLList::clear()
-{
- if (last == 0)
- return;
-
- <T>SLListNode* p = last->tl;
- last->tl = 0;
- last = 0;
-
- while (p != 0)
- {
- <T>SLListNode* nxt = p->tl;
- delete(p);
- p = nxt;
- }
-}
-
-
-Pix <T>SLList::prepend(<T&> item)
-{
- <T>SLListNode* t = new <T>SLListNode(item);
- if (last == 0)
- t->tl = last = t;
- else
- {
- t->tl = last->tl;
- last->tl = t;
- }
- return Pix(t);
-}
-
-
-Pix <T>SLList::prepend(<T>SLListNode* t)
-{
- if (t == 0) return 0;
- if (last == 0)
- t->tl = last = t;
- else
- {
- t->tl = last->tl;
- last->tl = t;
- }
- return Pix(t);
-}
-
-
-Pix <T>SLList::append(<T&> item)
-{
- <T>SLListNode* t = new <T>SLListNode(item);
- if (last == 0)
- t->tl = last = t;
- else
- {
- t->tl = last->tl;
- last->tl = t;
- last = t;
- }
- return Pix(t);
-}
-
-Pix <T>SLList::append(<T>SLListNode* t)
-{
- if (t == 0) return 0;
- if (last == 0)
- t->tl = last = t;
- else
- {
- t->tl = last->tl;
- last->tl = t;
- last = t;
- }
- return Pix(t);
-}
-
-void <T>SLList::join(<T>SLList& b)
-{
- <T>SLListNode* t = b.last;
- b.last = 0;
- if (last == 0)
- last = t;
- else if (t != 0)
- {
- <T>SLListNode* f = last->tl;
- last->tl = t->tl;
- t->tl = f;
- last = t;
- }
-}
-
-Pix <T>SLList::ins_after(Pix p, <T&> item)
-{
- <T>SLListNode* u = (<T>SLListNode*)p;
- <T>SLListNode* t = new <T>SLListNode(item);
- if (last == 0)
- t->tl = last = t;
- else if (u == 0) // ins_after 0 means prepend
- {
- t->tl = last->tl;
- last->tl = t;
- }
- else
- {
- t->tl = u->tl;
- u->tl = t;
- if (u == last)
- last = t;
- }
- return Pix(t);
-}
-
-
-void <T>SLList::del_after(Pix p)
-{
- <T>SLListNode* u = (<T>SLListNode*)p;
- if (last == 0 || u == last) error("cannot del_after last");
- if (u == 0) u = last; // del_after 0 means delete first
- <T>SLListNode* t = u->tl;
- if (u == t)
- last = 0;
- else
- {
- u->tl = t->tl;
- if (last == t)
- last = u;
- }
- delete t;
-}
-
-int <T>SLList::owns(Pix p)
-{
- <T>SLListNode* t = last;
- if (t != 0 && p != 0)
- {
- do
- {
- if (Pix(t) == p) return 1;
- t = t->tl;
- } while (t != last);
- }
- return 0;
-}
-
-<T> <T>SLList::remove_front()
-{
- if (last == 0) error("remove_front of empty list");
- <T>SLListNode* t = last->tl;
- <T> res = t->hd;
- if (t == last)
- last = 0;
- else
- last->tl = t->tl;
- delete t;
- return res;
-}
-
-int <T>SLList::remove_front(<T>& x)
-{
- if (last == 0)
- return 0;
- else
- {
- <T>SLListNode* t = last->tl;
- x = t->hd;
- if (t == last)
- last = 0;
- else
- last->tl = t->tl;
- delete t;
- return 1;
- }
-}
-
-
-void <T>SLList::del_front()
-{
- if (last == 0) error("del_front of empty list");
- <T>SLListNode* t = last->tl;
- if (t == last)
- last = 0;
- else
- last->tl = t->tl;
- delete t;
-}
-
-int <T>SLList::OK()
-{
- int v = 1;
- if (last != 0)
- {
- <T>SLListNode* t = last;
- long count = LONG_MAX; // Lots of chances to find last!
- do
- {
- count--;
- t = t->tl;
- } while (count > 0 && t != last);
- v &= count > 0;
- }
- if (!v) error("invariant failure");
- return v;
-}
diff --git a/contrib/libg++/libg++/src/gen/SLList.hP b/contrib/libg++/libg++/src/gen/SLList.hP
deleted file mode 100644
index cd89dee33094..000000000000
--- a/contrib/libg++/libg++/src/gen/SLList.hP
+++ /dev/null
@@ -1,137 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-// WARNING: This file is obsolete. Use ../SLList.h, if you can.
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-
-#ifndef _<T>SLList_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _<T>SLList_h 1
-
-#include <Pix.h>
-#include "<T>.defs.h"
-
-#ifndef _<T>SLListNode_h
-#define _<T>SLListNode_h 1
-
-struct <T>SLListNode
-{
- <T>SLListNode* tl;
- <T> hd;
- <T>SLListNode() { }
- <T>SLListNode(const <T&> h, <T>SLListNode* t = 0);
- ~<T>SLListNode() { }
-};
-
-
-inline <T>SLListNode::<T>SLListNode(const <T&> h, <T>SLListNode* t)
-:tl(t), hd(h) {}
-
-typedef <T>SLListNode* <T>SLListNodePtr;
-
-#endif
-
-
-class <T>SLList
-{
-protected:
- <T>SLListNode* last;
-
-public:
- <T>SLList();
- <T>SLList(const <T>SLList& a);
- ~<T>SLList();
-
- <T>SLList& operator = (const <T>SLList& a);
-
- int empty();
- int length();
-
- void clear();
-
- Pix prepend(<T&> item);
- Pix append(<T&> item);
-
- void join(<T>SLList&);
-
- Pix prepend(<T>SLListNode*);
- Pix append(<T>SLListNode*);
-
- <T>& operator () (Pix p);
- Pix first();
- void next(Pix& p);
- int owns(Pix p);
- Pix ins_after(Pix p, <T&> item);
- void del_after(Pix p);
-
- <T>& front();
- <T>& rear();
- <T> remove_front();
- int remove_front(<T>& x);
- void del_front();
-
- void error(const char* msg);
- int OK();
-};
-
-inline <T>SLList::~<T>SLList()
-{
- clear();
-}
-
-inline <T>SLList::<T>SLList()
-{
- last = 0;
-}
-
-inline int <T>SLList::empty()
-{
- return last == 0;
-}
-
-
-inline Pix <T>SLList::first()
-{
- return (last == 0)? 0 : Pix(last->tl);
-}
-
-inline void <T>SLList::next(Pix& p)
-{
- p = (p == 0 || p == last)? 0 : Pix(((<T>SLListNode*)(p))->tl);
-}
-
-inline <T>& <T>SLList::operator () (Pix p)
-{
- if (p == 0) error("null Pix");
- return ((<T>SLListNode*)(p))->hd;
-}
-
-inline <T>& <T>SLList::front()
-{
- if (last == 0) error("front: empty list");
- return last->tl->hd;
-}
-
-inline <T>& <T>SLList::rear()
-{
- if (last == 0) error("rear: empty list");
- return last->hd;
-}
-
-#endif
diff --git a/contrib/libg++/libg++/src/gen/SLQueue.ccP b/contrib/libg++/libg++/src/gen/SLQueue.ccP
deleted file mode 100644
index 8a5935b77570..000000000000
--- a/contrib/libg++/libg++/src/gen/SLQueue.ccP
+++ /dev/null
@@ -1,4 +0,0 @@
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include "<T>.SLQueue.h"
diff --git a/contrib/libg++/libg++/src/gen/SLQueue.hP b/contrib/libg++/libg++/src/gen/SLQueue.hP
deleted file mode 100644
index 84683b85a2c2..000000000000
--- a/contrib/libg++/libg++/src/gen/SLQueue.hP
+++ /dev/null
@@ -1,108 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifndef _<T>SLQueue_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _<T>SLQueue_h
-
-#include "<T>.SLList.h"
-#include "<T>.Queue.h"
-
-class <T>SLQueue : public <T>Queue
-{
- <T>SLList p;
-
-public:
- <T>SLQueue();
- <T>SLQueue(const <T>SLQueue& q);
- inline ~<T>SLQueue();
-
- void operator = (const <T>SLQueue&);
-
- inline void enq(<T&> item);
- inline <T> deq();
- inline <T>& front();
- inline void del_front();
-
- inline void clear();
- inline int empty();
- inline int full();
- inline int length();
-
- inline int OK();
-};
-
-inline <T>SLQueue::<T>SLQueue() :p() {}
-inline <T>SLQueue::<T>SLQueue(const <T>SLQueue& q) : p(q.p) {}
-
-inline <T>SLQueue::~<T>SLQueue() {}
-
-inline void <T>SLQueue::enq(<T&>item)
-{
- p.append(item);
-}
-
-inline <T> <T>SLQueue::deq()
-{
- return p.remove_front();
-}
-
-inline <T>& <T>SLQueue::front()
-{
- return p.front();
-}
-
-
-inline void <T>SLQueue::del_front()
-{
- p.del_front();
-}
-
-inline void <T>SLQueue::operator =(const <T>SLQueue& s)
-{
- p = s.p;
-}
-
-inline int <T>SLQueue::empty()
-{
- return p.empty();
-}
-
-inline int <T>SLQueue::full()
-{
- return 0;
-}
-
-inline int <T>SLQueue::length()
-{
- return p.length();
-}
-
-inline int <T>SLQueue::OK()
-{
- return p.OK();
-}
-
-inline void <T>SLQueue::clear()
-{
- p.clear();
-}
-
-#endif
diff --git a/contrib/libg++/libg++/src/gen/SLSet.ccP b/contrib/libg++/libg++/src/gen/SLSet.ccP
deleted file mode 100644
index 7d2ac58d087f..000000000000
--- a/contrib/libg++/libg++/src/gen/SLSet.ccP
+++ /dev/null
@@ -1,77 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include "<T>.SLSet.h"
-
-int <T>SLSet::OK()
-{
- int v = p.OK();
- v &= count == p.length();
- if (!v) error("invariant failure");
- return v;
-}
-
-Pix <T>SLSet::seek(<T&> item)
-{
- Pix i;
- for (i = p.first(); i != 0 && !<T>EQ(p(i),item); p.next(i));
- return i;
-}
-
-Pix <T>SLSet::add(<T&> item)
-{
- Pix i = seek(item);
- if (i == 0)
- {
- ++count;
- i = p.append(item);
- }
- return i;
-}
-
-void <T>SLSet::del(<T&> item)
-{
- Pix i = p.first();
- if (i == 0)
- return;
- else if (<T>EQ(p(i), item))
- {
- --count;
- p.del_front();
- }
- else
- {
- Pix trail = i;
- p.next(i);
- while (i != 0)
- {
- if (<T>EQ(p(i), item))
- {
- --count;
- p.del_after(trail);
- return;
- }
- trail = i;
- p.next(i);
- }
- }
-}
-
diff --git a/contrib/libg++/libg++/src/gen/SLSet.hP b/contrib/libg++/libg++/src/gen/SLSet.hP
deleted file mode 100644
index fa94bb891bac..000000000000
--- a/contrib/libg++/libg++/src/gen/SLSet.hP
+++ /dev/null
@@ -1,87 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-
-#ifndef _<T>SLSet_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _<T>SLSet_h 1
-
-#include "<T>.Set.h"
-#include "<T>.SLList.h"
-
-class <T>SLSet : public <T>Set
-{
-protected:
- <T>SLList p;
-
-public:
- <T>SLSet();
- <T>SLSet(const <T>SLSet&);
-
- Pix add(<T&> item);
- void del(<T&> item);
- inline int contains(<T&> item);
-
- inline void clear();
-
- inline Pix first();
- inline void next(Pix& i);
- inline <T>& operator () (Pix i);
- inline int owns(Pix i);
- Pix seek(<T&> item);
-
- int OK();
-};
-
-inline <T>SLSet::<T>SLSet() : p() { count = 0; }
-
-inline <T>SLSet::<T>SLSet(const <T>SLSet& s) : p(s.p) { count = s.count; }
-
-inline Pix <T>SLSet::first()
-{
- return p.first();
-}
-
-inline void <T>SLSet::next(Pix & idx)
-{
- p.next(idx);
-}
-
-inline <T>& <T>SLSet::operator ()(Pix idx)
-{
- return p(idx);
-}
-
-inline void <T>SLSet::clear()
-{
- count = 0; p.clear();
-}
-
-inline int <T>SLSet::contains (<T&> item)
-{
- return seek(item) != 0;
-}
-
-inline int <T>SLSet::owns (Pix idx)
-{
- return p.owns(idx);
-}
-
-#endif
diff --git a/contrib/libg++/libg++/src/gen/SLStack.ccP b/contrib/libg++/libg++/src/gen/SLStack.ccP
deleted file mode 100644
index 3996b41fac55..000000000000
--- a/contrib/libg++/libg++/src/gen/SLStack.ccP
+++ /dev/null
@@ -1,4 +0,0 @@
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include "<T>.SLStack.h"
diff --git a/contrib/libg++/libg++/src/gen/SLStack.hP b/contrib/libg++/libg++/src/gen/SLStack.hP
deleted file mode 100644
index 466cfee53b49..000000000000
--- a/contrib/libg++/libg++/src/gen/SLStack.hP
+++ /dev/null
@@ -1,109 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-
-#ifndef _<T>SLStack_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _<T>SLStack_h 1
-
-#include "<T>.SLList.h"
-#include "<T>.Stack.h"
-
-class <T>SLStack : public <T>Stack
-{
- <T>SLList p;
-
-public:
- <T>SLStack();
- <T>SLStack(const <T>SLStack& s);
- inline ~<T>SLStack();
-
- void operator = (const <T>SLStack&);
-
- inline void push(<T&> item);
- inline <T> pop();
- inline <T>& top();
- inline void del_top();
-
- inline int empty();
- inline int full();
- inline int length();
-
- inline void clear();
-
- inline int OK();
-
-};
-
-inline <T>SLStack::<T>SLStack() :p() {}
-inline <T>SLStack::<T>SLStack(const <T>SLStack& a) : p(a.p) {}
-inline <T>SLStack::~<T>SLStack() {}
-
-inline void <T>SLStack::push(<T&> item)
-{
- p.prepend(item);
-}
-
-inline <T> <T>SLStack::pop()
-{
- return p.remove_front();
-}
-
-inline <T>& <T>SLStack::top()
-{
- return p.front();
-}
-
-inline void <T>SLStack::del_top()
-{
- p.del_front();
-}
-
-inline void <T>SLStack::operator =(const <T>SLStack& s)
-{
- p = s.p;
-}
-
-inline int <T>SLStack::empty()
-{
- return p.empty();
-}
-
-inline int <T>SLStack::full()
-{
- return 0;
-}
-
-inline int <T>SLStack::length()
-{
- return p.length();
-}
-
-inline int <T>SLStack::OK()
-{
- return p.OK();
-}
-
-inline void <T>SLStack::clear()
-{
- p.clear();
-}
-
-#endif
diff --git a/contrib/libg++/libg++/src/gen/Set.ccP b/contrib/libg++/libg++/src/gen/Set.ccP
deleted file mode 100644
index b072339158de..000000000000
--- a/contrib/libg++/libg++/src/gen/Set.ccP
+++ /dev/null
@@ -1,117 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <builtin.h>
-#include "<T>.Set.h"
-
-
-Pix <T>Set::seek(<T&> item)
-{
- Pix i;
- for (i = first(); i != 0 && !(<T>EQ((*this)(i), item)); next(i));
- return i;
-}
-
-int <T>Set::owns(Pix idx)
-{
- if (idx == 0) return 0;
- for (Pix i = first(); i; next(i)) if (i == idx) return 1;
- return 0;
-}
-
-void <T>Set::clear()
-{
- Pix i = first();
- while (i != 0)
- {
- del((*this)(i));
- i = first();
- }
-}
-
-int <T>Set::contains (<T&> item)
-{
- return seek(item) != 0;
-}
-
-int <T>Set::operator <= (<T>Set& b)
-{
- if (count > b.count) return 0;
- if (count == 0) return 1;
- for (Pix i = first(); i; next(i)) if (b.seek((*this)(i)) == 0) return 0;
- return 1;
-}
-
-int <T>Set::operator == (<T>Set& b)
-{
- int n = count;
- if (n != b.count) return 0;
- if (n == 0) return 1;
- Pix i = first();
- Pix j = b.first();
- while (n-- > 0)
- {
- if ((b.seek((*this)(i)) == 0) || (seek(b(j)) == 0)) return 0;
- next(i);
- b.next(j);
- }
- return 1;
-}
-
-int <T>Set::operator != (<T>Set& b)
-{
- return !(*this == b);
-}
-
-void <T>Set::operator |= (<T>Set& b)
-{
- if (&b != this)
- for (Pix i = b.first(); i; b.next(i)) add(b(i));
-}
-
-void <T>Set::operator -= (<T>Set& b)
-{
- if (&b == this)
- clear();
- else
- for (Pix i = b.first(); i; b.next(i)) del(b(i));
-}
-
-
-void <T>Set::operator &= (<T>Set& b)
-{
- if (&b != this)
- {
- Pix i = first();
- Pix n = i;
- while (i != 0)
- {
- next(n);
- if (b.seek((*this)(i)) == 0) del((*this)(i));
- i = n;
- }
- }
-}
-
-void <T>Set::error(const char* msg)
-{
- (*lib_error_handler)("Set", msg);
-}
diff --git a/contrib/libg++/libg++/src/gen/Set.hP b/contrib/libg++/libg++/src/gen/Set.hP
deleted file mode 100644
index 8dd99e574ca6..000000000000
--- a/contrib/libg++/libg++/src/gen/Set.hP
+++ /dev/null
@@ -1,78 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-
-#ifndef _<T>Set_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _<T>Set_h 1
-
-#include <Pix.h>
-#include "<T>.defs.h"
-
-class <T>Set
-{
-protected:
-
- int count;
-
-public:
- inline virtual ~<T>Set();
-
- int length(); // current number of items
- int empty();
-
- virtual Pix add(<T&> item) = 0; // add item; return Pix
- virtual void del(<T&> item) = 0; // delete item
- virtual int contains(<T&> item); // is item in set?
-
- virtual void clear(); // delete all items
-
- virtual Pix first() = 0; // Pix of first item or 0
- virtual void next(Pix& i) = 0; // advance to next or 0
- virtual <T>& operator () (Pix i) = 0; // access item at i
-
- virtual int owns(Pix i); // is i a valid Pix ?
- virtual Pix seek(<T&> item); // Pix of item
-
- void operator |= (<T>Set& b); // add all items in b
- void operator -= (<T>Set& b); // delete items also in b
- void operator &= (<T>Set& b); // delete items not in b
-
- int operator == (<T>Set& b);
- int operator != (<T>Set& b);
- int operator <= (<T>Set& b);
-
- void error(const char* msg);
- virtual int OK() = 0; // rep invariant
-};
-
-inline <T>Set::~<T>Set() {}
-
-inline int <T>Set::length()
-{
- return count;
-}
-
-inline int <T>Set::empty()
-{
- return count == 0;
-}
-
-#endif
diff --git a/contrib/libg++/libg++/src/gen/SkipBag.ccP b/contrib/libg++/libg++/src/gen/SkipBag.ccP
deleted file mode 100644
index 9711d85c0951..000000000000
--- a/contrib/libg++/libg++/src/gen/SkipBag.ccP
+++ /dev/null
@@ -1,322 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-
-/*
-Copyright (C) 1991 Free Software Foundation
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-/*
- * Bags implemented via William Pugh SkipList algorithms.
- * CACM, June 1990, p 668-676.
- *
- */
-
-#include <stream.h>
-#include <time.h>
-#include "<T>.SkipBag.h"
-
-MLCG* <T>SkipBag::gen = 0;
-int <T>SkipBaginit::count = 0;
-
-static int countbits(long bits)
-{
- int n = 0;
- while(bits>>=1L) n++;
- return n;
-}
-
-<T>SkipBag::<T>SkipBag(long size)
-: level(0),
- header(new <T>SkipBagNode (countbits(size)+1)),
- max_levels (countbits(size)+1),
- random_bits(gen->asLong()),
- randoms_left(BITS_IN_RANDOM / 2)
-{
- <T>SkipBagNodePtr *buffer_start = header->forward;
- <T>SkipBagNodePtr *trav = &header->forward[max_levels];
-
- count = 0;
- while (trav > buffer_start)
- *--trav = (<T>SkipBagNodePtr) header;
-}
-
-<T>SkipBag::<T>SkipBag(<T>SkipBag& b)
-: level (0),
- header (new <T>SkipBagNode (b.max_levels)),
- max_levels (b.max_levels),
- random_bits (gen->asLong()),
- randoms_left (BITS_IN_RANDOM / 2)
-{
- <T>SkipBagNodePtr *buffer_start = header->forward;
- <T>SkipBagNodePtr *trav = &header->forward[max_levels];
-
- count = 0;
-
- while (trav > buffer_start)
- *--trav = (<T>SkipBagNodePtr)header;
-
- for (<T>SkipBagNodePtr t = b.leftmost(); t; t = b.succ(t))
- add(t->item);
-}
-
-Pix <T>SkipBag::add (<T&> item)
-{
- <T>SkipBagNodePtr *update = new <T>SkipBagNodePtr[max_levels+1];
- <T>SkipBagNodePtr curr = (<T>SkipBagNodePtr) this->header;
- int l = level;
- <T>SkipBagNodePtr temp;
-
- do
- {
- while ((temp = curr->forward[l])!=header &&
- <T>CMP(temp->item, item) < 0)
- curr = temp;
- update[l] = curr;
- }
- while (--l >= 0);
-
- if ((l = random_level ()) > level)
- {
- l = ++level;
- update[l] = (<T>SkipBagNodePtr)header;
- };
-
- temp = new <T>RealSkipBagNode (item, l);
- <T>SkipBagNodePtr *temp_forward = temp->forward;
-
- do
- {
- <T>SkipBagNodePtr *curr_forward = update[l]->forward;
-
- temp_forward[l] = curr_forward[l];
- curr_forward[l] = temp;
- }
- while (--l >= 0);
-
- count++;
- delete update;
- return Pix(temp);
-}
-
-void <T>SkipBag::del(<T&> key)
-{
-
- int l = level;
- int curr_level = level;
- <T>SkipBagNodePtr *update = new <T>SkipBagNodePtr[max_levels+1];
- <T>SkipBagNodePtr curr = (<T>SkipBagNodePtr)header;
- <T>SkipBagNodePtr temp;
-
- do
- {
- while ((temp = curr->forward[l])!=header
- && <T>CMP(temp->item,key) < 0)
- curr = temp;
- update[l] = curr;
- }
- while (--l >= 0);
-
- if (<T>CMP(temp->item,key)==0)
- {
- <T>SkipBagNodePtr *temp_forward = temp->forward;
-
- for (l = 0;
- l <= curr_level && (curr = update[l])->forward[l] == temp;
- l++)
- curr->forward[l] = temp_forward[l];
-
- delete temp;
-
- <T>SkipBagNodePtr *forward = header->forward;
-
- while (forward[curr_level]==header && curr_level > 0)
- curr_level--;
-
- level = curr_level;
- count--;
- delete update;
- return;
- }
-}
-
-<T>SkipBagNodePtr <T>SkipBag::rightmost()
-{
- <T>SkipBagNodePtr temp;
- <T>SkipBagNode* curr = header;
- int l = level;
-
- do
- while ((temp = curr->forward[l])!=header)
- curr = temp;
- while (--l >= 0);
-
- return temp==header ? 0 : temp;
-}
-
-<T>SkipBagNodePtr <T>SkipBag::pred(<T>SkipBagNodePtr t)
-{
- <T>SkipBagNodePtr temp, curr = (<T>SkipBagNodePtr) header;
- int l = level;
-
- do
- while ((temp = curr->forward[l])!=t)
- curr = temp;
- while (--l >= 0);
-
- return curr == header ? 0 : curr;
-}
-
-void <T>SkipBag::_kill()
-{
- <T>SkipBagNode *p = this->header->forward[0];
-
- while (p != header)
- {
- <T>SkipBagNodePtr q = p->forward[0];
- delete p;
- p = q;
- }
-}
-
-void <T>SkipBag::clear()
-{
- <T>SkipBagNodePtr *buffer_start = header->forward;
- <T>SkipBagNodePtr *trav = &header->forward[level+1];
- _kill();
- count = 0;
-
- while (trav > buffer_start)
- *--trav = (<T>SkipBagNodePtr)header;
-}
-
-Pix <T>SkipBag::seek(<T&> key, Pix i)
-{
- <T>SkipBagNodePtr temp;
- <T>SkipBagNode *curr = header;
- int l = level;
- if (i)
- curr = (<T>SkipBagNode *)i;
-
- do
- {
- while ((temp = curr->forward[l])!=header &&
- <T>CMP(temp->item, key) < 0)
- curr = temp;
- }
- while (--l >= 0);
-
- if (<T>CMP(temp->item, key) != 0)
- return 0;
- else
- {
- return Pix(temp);
- }
-}
-
-
-int <T>SkipBag::nof(<T&> item)
-{
- int n = 0;
- <T>SkipBagNodePtr t = (<T>SkipBagNodePtr)(seek(item));
- if (t != 0)
- {
- do
- {
- ++n;
- t = succ(t);
- } while (t != 0 && <T>EQ(item, t->item));
- }
- return n;
-}
-
-void <T>SkipBag::remove(<T&> key)
-{
- Pix t = seek(key);
- while (t != 0)
- {
- del(key);
- t = seek(key);
- }
-}
-
-
-/*
- * random function for probabilistic balancing
- *
- * Hardwired for p = .25. Not too flexible,
- * but fast. Changing this would require a constructor
- * that would accept a different value for p, etc.
- * Perhaps someone else would like to implement this?
- *
- */
-int <T>SkipBag::random_level (void)
-{
- int rlevel = 0;
- int b;
-
- do
- {
- b = random_bits & 3L;
- if (!b)
- rlevel++;
- random_bits >>= 2;
- if (--randoms_left == 0)
- {
- random_bits = gen->asLong();
- randoms_left = BITS_IN_RANDOM / 2;
- };
- }
- while (!b);
-
- return rlevel > max_levels ? max_levels : rlevel;
-}
-
-int <T>SkipBag::OK()
-{
- int v = 1;
- if (header == 0)
- v = 0;
- else
- {
- int n = 0;
- <T>SkipBagNodePtr trail = leftmost();
- <T>SkipBagNodePtr t = 0;
- if (trail) t = succ(trail);
- if (t) n++;
- while (t != 0)
- {
- ++n;
- v &= <T>CMP(trail->item, t->item) < 0;
- trail = t;
- t = succ(t);
- }
- v &= n == count;
- }
- if (!v) error("invariant failure");
- return v;
-}
-
-<T>SkipBaginit::<T>SkipBaginit()
-{
- if (!count)
- <T>SkipBag::gen = new MLCG(time(0));
- count++;
-}
-
-<T>SkipBaginit::~<T>SkipBaginit()
-{
- count--;
- if (!count)
- delete <T>SkipBag::gen;
-}
diff --git a/contrib/libg++/libg++/src/gen/SkipBag.hP b/contrib/libg++/libg++/src/gen/SkipBag.hP
deleted file mode 100644
index 647711de3730..000000000000
--- a/contrib/libg++/libg++/src/gen/SkipBag.hP
+++ /dev/null
@@ -1,171 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1991 Free Software Foundation
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-/*
- * Bags implemented via William Pugh SkipList algorithms.
- * CACM, June 1990, p 668-676.
- *
- */
-
-#ifndef _<T>SkipBag_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _<T>SkipBag_h 1
-
-#include "<T>.Bag.h"
-
-#include <limits.h>
-#include <MLCG.h>
-
-class <T>SkipBag;
-class <T>RealSkipBagNode;
-
-class <T>SkipBagNode
-{
-friend class <T>SkipBag;
- private:
- <T>RealSkipBagNode * * forward;
- <T>SkipBagNode(int size);
-};
-
-class <T>RealSkipBagNode : public <T>SkipBagNode
-{
-friend class <T>SkipBag;
- private:
- <T> item;
- <T>RealSkipBagNode(<T&> h, int size);
-};
-
-typedef <T>RealSkipBagNode* <T>SkipBagNodePtr;
-
-inline <T>SkipBagNode::<T>SkipBagNode(int size)
-: forward(new <T>SkipBagNodePtr[size+1])
-{
-}
-
-inline <T>RealSkipBagNode::<T>RealSkipBagNode(<T&> h, int size)
-: item(h),
- <T>SkipBagNode(size)
-{
-}
-
-class <T>SkipBag : public <T>Bag
-{
-friend class <T>SkipBaginit;
- protected:
- <T>SkipBagNode* header;
- int level;
- int max_levels;
- int randoms_left;
- long random_bits;
-
- static MLCG* gen;
- int random_level(void);
-
- <T>SkipBagNodePtr leftmost(void);
- <T>SkipBagNodePtr rightmost(void);
- <T>SkipBagNodePtr pred(<T>SkipBagNodePtr t);
- <T>SkipBagNodePtr succ(<T>SkipBagNodePtr t);
- void _kill(void);
-
- private:
- enum { BITS_IN_RANDOM = LONGBITS-1 };
-
- public:
- <T>SkipBag(long size=DEFAULT_INITIAL_CAPACITY);
- <T>SkipBag(<T>SkipBag& a);
- ~<T>SkipBag(void);
-
- Pix add(<T&> i);
- void del(<T&> i);
- void remove(<T&>i);
- int nof(<T&> i);
- int contains(<T&> i);
-
- void clear(void);
-
- Pix first(void);
- void next(Pix& i);
- <T>& operator () (Pix i);
- Pix seek(<T&> i, Pix from = 0);
-
- Pix last(void);
- void prev(Pix& i);
-
- int OK(void);
-};
-
-inline <T>SkipBagNodePtr <T>SkipBag::leftmost(void)
-{
- return header->forward[0];
-}
-
-inline <T>SkipBagNodePtr <T>SkipBag::succ(<T>SkipBagNodePtr t)
-{
- <T>SkipBagNodePtr result = 0;
- if (t->forward[0]!=header) result = t->forward[0];
- return result;
-}
-
-inline Pix <T>SkipBag::first(void)
-{
- return Pix(leftmost());
-}
-
-inline Pix <T>SkipBag::last(void)
-{
- return Pix(rightmost());
-}
-
-inline void <T>SkipBag::next(Pix& i)
-{
- if (i != 0) i = Pix(succ((<T>SkipBagNodePtr)i));
-}
-
-inline <T>& <T>SkipBag::operator () (Pix i)
-{
- if (i == 0) error("null Pix");
- return ((<T>SkipBagNodePtr)i)->item;
-}
-
-inline void <T>SkipBag::prev(Pix& i)
-{
- if (i != 0) i = Pix(pred((<T>SkipBagNodePtr)i));
-}
-
-inline int <T>SkipBag::contains(<T&> key)
-{
- return seek(key) != 0;
-}
-
-inline <T>SkipBag::~<T>SkipBag()
-{
- _kill();
- delete header;
-}
-
-static class <T>SkipBaginit
-{
- public:
- <T>SkipBaginit();
- ~<T>SkipBaginit();
- private:
- static int count;
-} <T>skipBaginit;
-
-#endif
diff --git a/contrib/libg++/libg++/src/gen/SkipMap.ccP b/contrib/libg++/libg++/src/gen/SkipMap.ccP
deleted file mode 100644
index 1d86ad4e3034..000000000000
--- a/contrib/libg++/libg++/src/gen/SkipMap.ccP
+++ /dev/null
@@ -1,307 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1991 Free Software Foundation
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-
-#include <stream.h>
-#include <time.h>
-#include "<T>.<C>.SkipMap.h"
-
-/*
- * Bags implemented via William Pugh SkipList algorithms.
- * CACM, June 1990, p 668-676.
- *
- */
-
-MLCG* <T><C>SkipMap::gen = 0;
-int <T><C>SkipMapinit::count = 0;
-
-static int countbits(long bits)
-{
- int n = 0;
- while(bits>>=1) n++;
- return n;
-}
-
-<T><C>SkipMap::<T><C>SkipMap(<C&> dflt, long size)
-: <T><C>Map(dflt),
- level(0),
- header(new <T><C>SkipMapNode (countbits(size)+1)),
- max_levels (countbits(size)+1),
- random_bits(gen->asLong()),
- randoms_left(BITS_IN_RANDOM / 2)
-{
- <T><C>SkipMapNodePtr *buffer_start = header->forward;
- <T><C>SkipMapNodePtr *trav = &header->forward[max_levels];
-
- count = 0;
- while (trav > buffer_start)
- *--trav = (<T><C>SkipMapNodePtr) header;
-}
-
-<T><C>SkipMap::<T><C>SkipMap(<T><C>SkipMap& b)
-: <T><C>Map(b.def),
- level (0),
- header (new <T><C>SkipMapNode (b.max_levels)),
- max_levels (b.max_levels),
- random_bits (gen->asLong()),
- randoms_left (BITS_IN_RANDOM / 2)
-{
- <T><C>SkipMapNodePtr *buffer_start = header->forward;
- <T><C>SkipMapNodePtr *trav = &header->forward[max_levels];
-
- count = 0;
-
- while (trav > buffer_start)
- *--trav = (<T><C>SkipMapNodePtr)header;
-
- for (<T><C>SkipMapNodePtr t = b.leftmost(); t; t = b.succ(t))
- (*this)[t->item] = t->cont;
-}
-
-<C>& <T><C>SkipMap::operator [] (<T&> item)
-{
- <T><C>SkipMapNodePtr *update = new <T><C>SkipMapNodePtr[max_levels+1];
- <T><C>SkipMapNodePtr curr =
- (<T><C>SkipMapNodePtr) this->header;
- int l = level;
- <T><C>SkipMapNodePtr temp;
-
- do
- {
- while ((temp = curr->forward[l])!=header &&
- <T>CMP(temp->item, item) < 0)
- curr = temp;
- update[l] = curr;
- }
- while (--l >= 0);
-
- if (temp != header && <T>CMP(temp->item, item) == 0)
- {
- delete update;
- return temp->cont;
- }
-
- if ((l = random_level ()) > level)
- {
- l = ++level;
- update[l] = (<T><C>SkipMapNodePtr)header;
- };
-
- temp = new <T><C>RealSkipMapNode (item, def, l);
- <T><C>SkipMapNodePtr *temp_forward = temp->forward;
-
- do
- {
- <T><C>SkipMapNodePtr *curr_forward = update[l]->forward;
-
- temp_forward[l] = curr_forward[l];
- curr_forward[l] = temp;
- }
- while (--l >= 0);
-
- count++;
- delete update;
- return temp->cont;
-}
-
-void <T><C>SkipMap::del(<T&> key)
-{
-
- int l = level;
- int curr_level = level;
- <T><C>SkipMapNodePtr *update = new <T><C>SkipMapNodePtr[max_levels+1];
- <T><C>SkipMapNodePtr curr = (<T><C>SkipMapNodePtr)header;
- <T><C>SkipMapNodePtr temp;
-
- do
- {
- while ((temp = curr->forward[l])!=header
- && <T>CMP(temp->item,key) < 0)
- curr = temp;
- update[l] = curr;
- }
- while (--l >= 0);
-
- if (<T>CMP(temp->item,key)==0)
- {
- <T><C>SkipMapNodePtr *temp_forward = temp->forward;
-
- for (l = 0;
- l <= curr_level && (curr = update[l])->forward[l] == temp;
- l++)
- curr->forward[l] = temp_forward[l];
-
- delete temp;
-
- <T><C>SkipMapNodePtr *forward = header->forward;
-
- while (forward[curr_level]==header && curr_level > 0)
- curr_level--;
-
- level = curr_level;
- count--;
- delete update;
- return;
- }
-}
-
-<T><C>SkipMapNodePtr <T><C>SkipMap::rightmost()
-{
- <T><C>SkipMapNodePtr temp;
- <T><C>SkipMapNode* curr = header;
- int l = level;
-
- do
- while ((temp = curr->forward[l])!=header)
- curr = temp;
- while (--l >= 0);
-
- return temp==header ? 0 : temp;
-}
-
-<T><C>SkipMapNodePtr <T><C>SkipMap::pred(<T><C>SkipMapNodePtr t)
-{
- <T><C>SkipMapNodePtr temp, curr = (<T><C>SkipMapNodePtr) header;
- int l = level;
-
- do
- while ((temp = curr->forward[l])!=t)
- curr = temp;
- while (--l >= 0);
-
- return curr == header ? 0 : curr;
-}
-
-void <T><C>SkipMap::_kill()
-{
- <T><C>SkipMapNode *p = this->header->forward[0];
-
- while (p != header)
- {
- <T><C>SkipMapNodePtr q = p->forward[0];
- delete p;
- p = q;
- }
-}
-
-void <T><C>SkipMap::clear()
-{
- <T><C>SkipMapNodePtr *buffer_start = header->forward;
- <T><C>SkipMapNodePtr *trav = &header->forward[level+1];
- _kill();
- count = 0;
-
- while (trav > buffer_start)
- *--trav = (<T><C>SkipMapNodePtr)header;
-}
-
-Pix <T><C>SkipMap::seek(<T&> key)
-{
- <T><C>SkipMapNodePtr temp;
- <T><C>SkipMapNode *curr = header;
- int l = level;
-
- do
- {
- while ((temp = curr->forward[l])!=header &&
- <T>CMP(temp->item, key) < 0)
- curr = temp;
- }
- while (--l >= 0);
-
- if (<T>CMP(temp->item, key) != 0)
- return 0;
- else
- {
- return Pix(temp);
- }
-}
-
-/*
- * random function for probabilistic balancing
- *
- * Hardwired for p = .25. Not too flexible,
- * but fast. Changing this would require a constructor
- * that would accept a different value for p, etc.
- * Perhaps someone else would like to implement this?
- *
- */
-int <T><C>SkipMap::random_level (void)
-{
- int rlevel = 0;
- int b;
-
- do
- {
- b = random_bits & 3L;
- if (!b)
- rlevel++;
- random_bits >>= 2;
- if (--randoms_left == 0)
- {
- random_bits = gen->asLong();
- randoms_left = BITS_IN_RANDOM / 2;
- };
- }
- while (!b);
-
- return rlevel > max_levels ? max_levels : rlevel;
-}
-
-int <T><C>SkipMap::OK()
-{
- int v = 1;
- if (header == 0)
- v = 0;
- else
- {
- int n = 0;
- <T><C>SkipMapNodePtr trail = leftmost();
- <T><C>SkipMapNodePtr t = 0;
- if (trail) t = succ(trail);
- if (t) n++;
- while (t != 0)
- {
- ++n;
- v &= <T>CMP(trail->item, t->item) < 0;
- trail = t;
- t = succ(t);
- }
- v &= n == count;
- }
- if (!v) error("invariant failure");
- return v;
-}
-
-<T><C>SkipMapinit::<T><C>SkipMapinit()
-{
- if (!count)
- <T><C>SkipMap::gen = new MLCG(time(0));
- count++;
-}
-
-<T><C>SkipMapinit::~<T><C>SkipMapinit()
-{
- count--;
- if (!count)
- delete <T><C>SkipMap::gen;
-}
-
-
diff --git a/contrib/libg++/libg++/src/gen/SkipMap.hP b/contrib/libg++/libg++/src/gen/SkipMap.hP
deleted file mode 100644
index 8b48cf9da851..000000000000
--- a/contrib/libg++/libg++/src/gen/SkipMap.hP
+++ /dev/null
@@ -1,176 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1991 Free Software Foundation
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-/*
- * Bags implemented via William Pugh SkipList algorithms.
- * CACM, June 1990, p 668-676.
- *
- */
-
-#ifndef _<T><C>SkipMap_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _<T><C>SkipMap_h 1
-
-#include "<T>.<C>.Map.h"
-
-#include <limits.h>
-#include <MLCG.h>
-
-class <T><C>SkipMap;
-class <T><C>RealSkipMapNode;
-
-class <T><C>SkipMapNode
-{
-friend class <T><C>SkipMap;
- private:
- <T><C>RealSkipMapNode * * forward;
- protected:
- <T><C>SkipMapNode(int size);
-};
-
-class <T><C>RealSkipMapNode : public <T><C>SkipMapNode
-{
-friend class <T><C>SkipMap;
- private:
- <T> item;
- <C> cont;
- <T><C>RealSkipMapNode(<T&> h, <C&> i, int size);
-};
-
-typedef <T><C>RealSkipMapNode* <T><C>SkipMapNodePtr;
-
-inline <T><C>SkipMapNode::<T><C>SkipMapNode(int size)
-: forward(new <T><C>SkipMapNodePtr[size+1])
-{
-}
-
-inline <T><C>RealSkipMapNode::<T><C>RealSkipMapNode(<T&> h, <C&> i, int size)
-: item(h), cont(i),
- <T><C>SkipMapNode(size)
-{
-}
-
-class <T><C>SkipMap : public <T><C>Map
-{
-friend class <T><C>SkipMapinit;
- protected:
- <T><C>SkipMapNode* header;
- int level;
- int max_levels;
- int randoms_left;
- long random_bits;
-
- static MLCG* gen;
- int random_level(void);
-
- <T><C>SkipMapNodePtr leftmost();
- <T><C>SkipMapNodePtr rightmost();
- <T><C>SkipMapNodePtr pred(<T><C>SkipMapNodePtr t);
- <T><C>SkipMapNodePtr succ(<T><C>SkipMapNodePtr t);
- void _kill();
- private:
- enum { BITS_IN_RANDOM = LONGBITS-1 };
-
- public:
- <T><C>SkipMap( <C&> dflt, long size=DEFAULT_INITIAL_CAPACITY);
- <T><C>SkipMap(<T><C>SkipMap& a);
- ~<T><C>SkipMap();
-
- <C>& operator [] (<T&> key);
-
- void del(<T&> key);
-
- Pix first();
- void next(Pix& i);
- <T>& key(Pix i);
- <C>& contents(Pix i);
-
- Pix seek(<T&> key);
- int contains(<T&> key);
- void clear();
-
- Pix last();
- void prev(Pix& i);
-
- int OK();
-};
-
-inline <T><C>SkipMap::~<T><C>SkipMap()
-{
- _kill();
- delete header;
-}
-
-inline <T><C>SkipMapNodePtr <T><C>SkipMap::leftmost()
-{
- return header->forward[0]==header ? 0 : header->forward[0];
-}
-
-inline Pix <T><C>SkipMap::first()
-{
- return Pix(leftmost());
-}
-
-inline Pix <T><C>SkipMap::last()
-{
- return Pix(rightmost());
-}
-
-inline <T><C>SkipMapNodePtr <T><C>SkipMap::succ(<T><C>SkipMapNodePtr t)
-{
- return t->forward[0]==header ? 0 : t->forward[0];
-}
-
-inline void <T><C>SkipMap::next(Pix& i)
-{
- if (i != 0) i = Pix(succ((<T><C>SkipMapNodePtr)i));
-}
-
-inline void <T><C>SkipMap::prev(Pix& i)
-{
- if (i != 0) i = Pix(pred((<T><C>SkipMapNodePtr)i));
-}
-
-inline <T>& <T><C>SkipMap::key (Pix i)
-{
- if (i == 0) error("null Pix");
- return ((<T><C>SkipMapNodePtr)i)->item;
-}
-
-inline <C>& <T><C>SkipMap::contents (Pix i)
-{
- if (i == 0) error("null Pix");
- return ((<T><C>SkipMapNodePtr)i)->cont;
-}
-
-inline int <T><C>SkipMap::contains(<T&> key)
-{
- return seek(key) != 0;
-}
-
-static class <T><C>SkipMapinit
-{
- public:
- <T><C>SkipMapinit();
- ~<T><C>SkipMapinit();
- private:
- static int count;
-} <T><C>skipMapinit;
-
-#endif
diff --git a/contrib/libg++/libg++/src/gen/SkipSet.ccP b/contrib/libg++/libg++/src/gen/SkipSet.ccP
deleted file mode 100644
index 97525be8830d..000000000000
--- a/contrib/libg++/libg++/src/gen/SkipSet.ccP
+++ /dev/null
@@ -1,395 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1991 Free Software Foundation
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-/*
- * Sets implemented via William Pugh SkipList algorithms.
- * CACM, June 1990, p 668-676.
- *
- */
-
-#include <stream.h>
-#include <time.h>
-
-#include "<T>.SkipSet.h"
-
-MLCG* <T>SkipSet::gen = 0;
-int <T>SkipSetinit::count = 0;
-
-static int countbits(long bits)
-{
- int n = 0;
- while(bits>>=1L) n++;
- return n;
-}
-
-<T>SkipSet::<T>SkipSet(long size)
-: level(0),
- header(new <T>SkipSetNode (countbits(size)+1)),
- max_levels (countbits(size)+1),
- random_bits(gen->asLong()),
- randoms_left(BITS_IN_RANDOM / 2)
-{
- <T>SkipSetNodePtr *buffer_start = header->forward;
- <T>SkipSetNodePtr *trav = &header->forward[max_levels];
-
- count = 0;
- while (trav > buffer_start)
- *--trav = (<T>SkipSetNodePtr) header;
-}
-
-<T>SkipSet::<T>SkipSet(<T>SkipSet& b)
-: level (0),
- header (new <T>SkipSetNode (b.max_levels)),
- max_levels (b.max_levels),
- random_bits (gen->asLong()),
- randoms_left (BITS_IN_RANDOM / 2)
-{
- <T>SkipSetNodePtr *buffer_start = header->forward;
- <T>SkipSetNodePtr *trav = &header->forward[max_levels];
-
- count = 0;
-
- while (trav > buffer_start)
- *--trav = (<T>SkipSetNodePtr)header;
-
- for (<T>SkipSetNodePtr t = b.leftmost(); t; t = b.succ(t))
- add(t->item);
-}
-
-/* relationals */
-
-int <T>SkipSet::operator == (<T>SkipSet& y)
-{
- if (count != y.count)
- return 0;
- else
- {
- <T>SkipSetNodePtr t = leftmost();
- <T>SkipSetNodePtr u = y.leftmost();
- for (;;)
- {
- if (t == 0)
- return 1;
- else if (!<T>EQ(t->item, u->item))
- return 0;
- else
- {
- t = succ(t);
- u = y.succ(u);
- }
- }
- }
-}
-
-int <T>SkipSet::operator <= (<T>SkipSet& y)
-{
- if (count > y.count)
- return 0;
- else
- {
- <T>SkipSetNodePtr t = leftmost();
- <T>SkipSetNodePtr u = y.leftmost();
- for (;;)
- {
- if (t == 0)
- return 1;
- else if (u == 0)
- return 0;
- int cmp = <T>CMP(t->item, u->item);
- if (cmp == 0)
- {
- t = succ(t);
- u = y.succ(u);
- }
- else if (cmp < 0)
- return 0;
- else
- u = y.succ(u);
- }
- }
-}
-
-
-void <T>SkipSet::operator |=(<T>SkipSet& y)
-{
- if (&y == this) return;
- <T>SkipSetNodePtr u = y.leftmost();
- while (u != 0)
- {
- add(u->item);
- u = y.succ(u);
- }
-}
-
-void <T>SkipSet::operator &= (<T>SkipSet& y)
-{
- if (y.count == 0)
- clear();
- else if (&y != this && count != 0)
- {
- <T>SkipSetNodePtr t = leftmost();
- while (t != 0)
- {
- <T>SkipSetNodePtr s = succ(t);
- if (y.seek(t->item) == 0) del(t->item);
- t = s;
- }
- }
-}
-
-
-void <T>SkipSet::operator -=(<T>SkipSet& y)
-{
- if (&y == this)
- clear();
- else if (y.count != 0)
- {
- <T>SkipSetNodePtr t = leftmost();
- while (t != 0)
- {
- <T>SkipSetNodePtr s = succ(t);
- if (y.seek(t->item) != 0) del(t->item);
- t = s;
- }
- }
-}
-
-Pix <T>SkipSet::add (<T&> i)
-{
- <T>SkipSetNodePtr *update = new <T>SkipSetNodePtr[max_levels+1];
- <T>SkipSetNodePtr curr = (<T>SkipSetNodePtr) this->header;
- int l = level;
- <T>SkipSetNodePtr temp;
-
- do
- {
- while ((temp = curr->forward[l])!=header &&
- <T>CMP(temp->item, i) < 0)
- curr = temp;
- update[l] = curr;
- }
- while (--l >= 0);
-
- if (temp != header && <T>CMP(temp->item, i) == 0)
- return Pix(temp);
-
- if ((l = random_level ()) > level)
- {
- l = ++level;
- update[l] = (<T>SkipSetNodePtr)header;
- };
-
- temp = new <T>RealSkipSetNode (i, l);
- <T>SkipSetNodePtr *temp_forward = temp->forward;
-
- do
- {
- <T>SkipSetNodePtr *curr_forward = update[l]->forward;
-
- temp_forward[l] = curr_forward[l];
- curr_forward[l] = temp;
- }
- while (--l >= 0);
-
- count++;
- delete update;
- return Pix(temp);
-}
-
-void <T>SkipSet::del(<T&> key)
-{
-
- int l = level;
- int curr_level = level;
- <T>SkipSetNodePtr *update = new <T>SkipSetNodePtr[max_levels+1];
- <T>SkipSetNodePtr curr = (<T>SkipSetNodePtr)header;
- <T>SkipSetNodePtr temp;
-
- do
- {
- while ((temp = curr->forward[l])!=header
- && <T>CMP(temp->item,key) < 0)
- curr = temp;
- update[l] = curr;
- }
- while (--l >= 0);
-
- if (<T>CMP(temp->item,key)==0)
- {
- <T>SkipSetNodePtr *temp_forward = temp->forward;
-
- for (l = 0;
- l <= curr_level && (curr = update[l])->forward[l] == temp;
- l++)
- curr->forward[l] = temp_forward[l];
-
- delete temp;
-
- <T>SkipSetNodePtr *forward = header->forward;
-
- while (forward[curr_level]==header && curr_level > 0)
- curr_level--;
-
- level = curr_level;
- count--;
- delete update;
- return;
- }
-}
-
-<T>SkipSetNodePtr <T>SkipSet::rightmost()
-{
- <T>SkipSetNodePtr temp;
- <T>SkipSetNode* curr = header;
- int l = level;
-
- do
- while ((temp = curr->forward[l])!=header)
- curr = temp;
- while (--l >= 0);
-
- return temp==header ? 0 : temp;
-}
-
-<T>SkipSetNodePtr <T>SkipSet::pred(<T>SkipSetNodePtr t)
-{
- <T>SkipSetNodePtr temp, curr = (<T>SkipSetNodePtr) header;
- int l = level;
-
- do
- while ((temp = curr->forward[l])!=t)
- curr = temp;
- while (--l >= 0);
-
- return curr == header ? 0 : curr;
-}
-
-void <T>SkipSet::_kill()
-{
- <T>SkipSetNode *p = this->header->forward[0];
-
- while (p != header)
- {
- <T>SkipSetNodePtr q = p->forward[0];
- delete p;
- p = q;
- }
-}
-
-void <T>SkipSet::clear()
-{
- <T>SkipSetNodePtr *buffer_start = header->forward;
- <T>SkipSetNodePtr *trav = &header->forward[level+1];
- _kill();
- count = 0;
-
- while (trav > buffer_start)
- *--trav = (<T>SkipSetNodePtr)header;
-}
-
-Pix <T>SkipSet::seek(<T&> key)
-{
- <T>SkipSetNodePtr temp;
- <T>SkipSetNode *curr = header;
- int l = level;
-
- do
- {
- while ((temp = curr->forward[l])!=header &&
- <T>CMP(temp->item, key) < 0)
- curr = temp;
- }
- while (--l >= 0);
-
- if (<T>CMP(temp->item, key) != 0)
- return 0;
- else
- {
- return Pix(temp);
- }
-}
-
-
-/*
- * random function for probabilistic balancing
- *
- * Hardwired for p = .25. Not too flexible,
- * but fast. Changing this would require a constructor
- * that would accept a different value for p, etc.
- * Perhaps someone else would like to implement this?
- *
- */
-int <T>SkipSet::random_level (void)
-{
- int rlevel = 0;
- int b;
-
- do
- {
- b = random_bits & 3L;
- if (!b)
- rlevel++;
- random_bits >>= 2;
- if (--randoms_left == 0)
- {
- random_bits = gen->asLong();
- randoms_left = BITS_IN_RANDOM / 2;
- };
- }
- while (!b);
-
- return rlevel > max_levels ? max_levels : rlevel;
-}
-
-int <T>SkipSet::OK()
-{
- int v = 1;
- if (header == 0)
- v = 0;
- else
- {
- int n = 0;
- <T>SkipSetNodePtr trail = leftmost();
- <T>SkipSetNodePtr t = 0;
- if (trail) t = succ(trail);
- if (t) n++;
- while (t != 0)
- {
- ++n;
- v &= <T>CMP(trail->item, t->item) < 0;
- trail = t;
- t = succ(t);
- }
- v &= n == count;
- }
- if (!v) error("invariant failure");
- return v;
-}
-
-<T>SkipSetinit::<T>SkipSetinit()
-{
- if (!count)
- <T>SkipSet::gen = new MLCG(time(0));
- count++;
-}
-
-<T>SkipSetinit::~<T>SkipSetinit()
-{
- count--;
- if (!count)
- delete <T>SkipSet::gen;
-}
diff --git a/contrib/libg++/libg++/src/gen/SkipSet.hP b/contrib/libg++/libg++/src/gen/SkipSet.hP
deleted file mode 100644
index d4b782bbadf4..000000000000
--- a/contrib/libg++/libg++/src/gen/SkipSet.hP
+++ /dev/null
@@ -1,187 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1991 Free Software Foundation
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-/*
- * Sets implemented via William Pugh SkipList algorithms.
- * CACM, June 1990, p 668-676.
- *
- */
-
-#ifndef _<T>SkipSet_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _<T>SkipSet_h 1
-
-#include "<T>.Set.h"
-
-#include <limits.h>
-#include <MLCG.h>
-
-class <T>SkipSet;
-class <T>RealSkipSetNode;
-
-class <T>SkipSetNode
-{
-friend class <T>SkipSet;
- private:
- <T>RealSkipSetNode * * forward;
- <T>SkipSetNode(int size);
-};
-
-class <T>RealSkipSetNode : public <T>SkipSetNode
-{
-friend class <T>SkipSet;
- private:
- <T> item;
- <T>RealSkipSetNode(<T&> h, int size);
-};
-
-typedef <T>RealSkipSetNode* <T>SkipSetNodePtr;
-
-inline <T>SkipSetNode::<T>SkipSetNode(int size)
-: forward(new <T>SkipSetNodePtr[size+1])
-{
-}
-
-inline <T>RealSkipSetNode::<T>RealSkipSetNode(<T&> h, int size)
-: item(h),
- <T>SkipSetNode(size)
-{
-}
-
-class <T>SkipSet : public <T>Set
-{
-friend class <T>SkipSetinit;
- protected:
- <T>SkipSetNode* header;
- int level;
- int max_levels;
- int randoms_left;
- long random_bits;
-
- static MLCG* gen;
- int random_level(void);
-
- <T>SkipSetNodePtr leftmost(void);
- <T>SkipSetNodePtr rightmost(void);
- <T>SkipSetNodePtr pred(<T>SkipSetNodePtr t);
- <T>SkipSetNodePtr succ(<T>SkipSetNodePtr t);
- void _kill(void);
-
- private:
- enum { BITS_IN_RANDOM = LONGBITS-1 };
- public:
- <T>SkipSet(long size=DEFAULT_INITIAL_CAPACITY);
- <T>SkipSet(<T>SkipSet& a);
- ~<T>SkipSet();
-
- Pix add(<T&> i);
- void del(<T&> i);
- int contains(<T&> i);
-
- void clear(void);
-
- Pix first(void);
- void next(Pix& i);
- <T>& operator () (Pix i);
- Pix seek(<T&> i);
-
- Pix last(void);
- void prev(Pix& i);
-
- void operator |= (<T>SkipSet& b);
- void operator -= (<T>SkipSet& b);
- void operator &= (<T>SkipSet& b);
-
- int operator == (<T>SkipSet& b);
- int operator != (<T>SkipSet& b);
- int operator <= (<T>SkipSet& b);
-
- int OK(void);
-};
-
-/*
- * A little overkill on the inlines.
- *
- */
-
-inline <T>SkipSet::~<T>SkipSet(void)
-{
- _kill();
- delete header;
-}
-
-inline int <T>SkipSet::operator != (<T>SkipSet& b)
-{
- return ! (*this == b);
-}
-
-inline <T>SkipSetNodePtr <T>SkipSet::leftmost(void)
-{
- return header->forward[0];
-}
-
-inline <T>SkipSetNodePtr <T>SkipSet::succ(<T>SkipSetNodePtr t)
-{
- <T>SkipSetNodePtr result = 0;
- if (t->forward[0]!=header) result = t->forward[0];
- return result;
-}
-
-inline Pix <T>SkipSet::first(void)
-{
- return Pix(leftmost());
-}
-
-inline Pix <T>SkipSet::last(void)
-{
- return Pix(rightmost());
-}
-
-inline void <T>SkipSet::next(Pix& i)
-{
- if (i != 0) i = Pix(succ((<T>SkipSetNodePtr)i));
-}
-
-inline void <T>SkipSet::prev(Pix& i)
-{
- if (i != 0) i = Pix(pred((<T>SkipSetNodePtr)i));
-}
-
-inline <T>& <T>SkipSet::operator () (Pix i)
-{
- if (i == 0) error("null Pix");
- return ((<T>SkipSetNodePtr)i)->item;
-}
-
-
-inline int <T>SkipSet::contains(<T&> key)
-{
- return seek(key) != 0;
-}
-
-static class <T>SkipSetinit
-{
- public:
- <T>SkipSetinit();
- ~<T>SkipSetinit();
- private:
- static int count;
-} <T>skipSetinit;
-
-#endif
diff --git a/contrib/libg++/libg++/src/gen/SplayBag.ccP b/contrib/libg++/libg++/src/gen/SplayBag.ccP
deleted file mode 100644
index 1ff1421db4d3..000000000000
--- a/contrib/libg++/libg++/src/gen/SplayBag.ccP
+++ /dev/null
@@ -1,445 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <stream.h>
-#include "<T>.SplayBag.h"
-
-
-/*
-
- struct to simulate the special `null' node in the Sleater & Tarjan JACM 1985
- splay tree algorithms
-
- All routines use a version of their `simple top-down' splay alg. (p 669)
-
-*/
-
-struct _dummySplayNode
-{
- <T>SplayNode* lt;
- <T>SplayNode* rt;
- <T>SplayNode* par;
-} _dummy_null;
-
-
-/*
- traversal primitives
-*/
-
-
-<T>SplayNode* <T>SplayBag::leftmost()
-{
- <T>SplayNode* t = root;
- if (t != 0) while (t->lt != 0) t = t->lt;
- return t;
-}
-
-<T>SplayNode* <T>SplayBag::rightmost()
-{
- <T>SplayNode* t = root;
- if (t != 0) while (t->rt != 0) t = t->rt;
- return t;
-}
-
-<T>SplayNode* <T>SplayBag::succ(<T>SplayNode* t)
-{
- if (t == 0)
- return 0;
- if (t->rt != 0)
- {
- t = t->rt;
- while (t->lt != 0) t = t->lt;
- return t;
- }
- else
- {
- for (;;)
- {
- if (t->par == 0 || t == t->par->lt)
- return t->par;
- else
- t = t->par;
- }
- }
-}
-
-<T>SplayNode* <T>SplayBag::pred(<T>SplayNode* t)
-{
- if (t == 0)
- return 0;
- else if (t->lt != 0)
- {
- t = t->lt;
- while (t->rt != 0) t = t->rt;
- return t;
- }
- else
- {
- for (;;)
- {
- if (t->par == 0 || t == t->par->rt)
- return t->par;
- else
- t = t->par;
- }
- }
-}
-
-
-
-Pix <T>SplayBag::seek(<T&> key, Pix i)
-{
- if (root == 0) return 0;
-
- <T>SplayNode* t = (<T>SplayNode*) i;
- if (t != 0)
- {
- int cmp = <T>CMP(key, t->item);
- if (cmp == 0)
- {
- t = succ(t);
- if (t != 0 && <T>EQ(key, t->item))
- return Pix(t);
- else
- return 0;
- }
- else if (cmp < 0)
- return 0;
- }
-
- t = root;
- int comp = <T>CMP(key, t->item);
- if (comp == 0)
- return Pix(t);
-
- <T>SplayNode* dummy = (<T>SplayNode*)(&_dummy_null);
- <T>SplayNode* l = dummy;
- <T>SplayNode* r = dummy;
- dummy->rt = dummy->lt = dummy->par = 0;
-
- while (comp != 0)
- {
- if (comp > 0)
- {
- <T>SplayNode* tr = t->rt;
- if (tr == 0)
- break;
- else
- {
- comp = <T>CMP(key, tr->item);
- if (comp <= 0 || tr->rt == 0)
- {
- l->rt = t; t->par = l;
- l = t;
- t = tr;
- if (comp >= 0)
- break;
- }
- else
- {
- if ((t->rt = tr->lt) != 0) t->rt->par = t;
- tr->lt = t; t->par = tr;
- l->rt = tr; tr->par = l;
- l = tr;
- t = tr->rt;
- comp = <T>CMP(key, t->item);
- }
- }
- }
- else
- {
- <T>SplayNode* tl = t->lt;
- if (tl == 0)
- break;
- else
- {
- comp = <T>CMP(key, tl->item);
- if (comp >= 0 || tl->lt == 0)
- {
- r->lt = t; t->par = r;
- r = t;
- t = tl;
- if (comp <= 0)
- break;
- }
- else
- {
- if ((t->lt = tl->rt) != 0) t->lt->par = t;
- tl->rt = t; t->par = tl;
- r->lt = tl; tl->par = r;
- r = tl;
- t = tl->lt;
- comp = <T>CMP(key, t->item);
- }
- }
- }
- }
- if ((r->lt = t->rt) != 0) r->lt->par = r;
- if ((l->rt = t->lt) != 0) l->rt->par = l;
- if ((t->lt = dummy->rt) != 0) t->lt->par = t;
- if ((t->rt = dummy->lt) != 0) t->rt->par = t;
- t->par = 0;
- root = t;
- if (comp != 0)
- return 0;
- else
- {
- l = pred(t);
- while (l != 0 && <T>EQ(l->item, key)) { t = l; l = pred(l); }
- return Pix(t);
- }
-}
-
-int <T>SplayBag::nof(<T&> item)
-{
- int n = 0;
- <T>SplayNode* t = (<T>SplayNode*)(seek(item));
- if (t != 0)
- {
- do
- {
- ++n;
- t = succ(t);
- } while (t != 0 && <T>EQ(item, t->item));
- }
- return n;
-}
-
-Pix <T>SplayBag::add(<T&> item)
-{
- ++count;
- <T>SplayNode* newnode = new <T>SplayNode(item);
- <T>SplayNode* t = root;
- if (t == 0)
- {
- root = newnode;
- return Pix(root);
- }
-
- int comp = <T>CMP(item, t->item);
-
- <T>SplayNode* dummy = (<T>SplayNode*)(&_dummy_null);
- <T>SplayNode* l = dummy;
- <T>SplayNode* r = dummy;
- dummy->rt = dummy->lt = dummy->par = 0;
-
- int done = 0;
- while (!done)
- {
- if (comp >= 0)
- {
- <T>SplayNode* tr = t->rt;
- if (tr == 0)
- {
- tr = newnode;
- comp = 0; done = 1;
- }
- else
- comp = <T>CMP(item, tr->item);
-
- if (comp <= 0)
- {
- l->rt = t; t->par = l;
- l = t;
- t = tr;
- }
- else
- {
- <T>SplayNode* trr = tr->rt;
- if (trr == 0)
- {
- trr = newnode;
- comp = 0; done = 1;
- }
- else
- comp = <T>CMP(item, trr->item);
-
- if ((t->rt = tr->lt) != 0) t->rt->par = t;
- tr->lt = t; t->par = tr;
- l->rt = tr; tr->par = l;
- l = tr;
- t = trr;
- }
- }
- else
- {
- <T>SplayNode* tl = t->lt;
- if (tl == 0)
- {
- tl = newnode;
- comp = 0; done = 1;
- }
- else
- comp = <T>CMP(item, tl->item);
-
- if (comp >= 0)
- {
- r->lt = t; t->par = r;
- r = t;
- t = tl;
- }
- else
- {
- <T>SplayNode* tll = tl->lt;
- if (tll == 0)
- {
- tll = newnode;
- comp = 0; done = 1;
- }
- else
- comp = <T>CMP(item, tll->item);
-
- if ((t->lt = tl->rt) != 0) t->lt->par = t;
- tl->rt = t; t->par = tl;
- r->lt = tl; tl->par = r;
- r = tl;
- t = tll;
- }
- }
- }
- if ((r->lt = t->rt) != 0) r->lt->par = r;
- if ((l->rt = t->lt) != 0) l->rt->par = l;
- if ((t->lt = dummy->rt) != 0) t->lt->par = t;
- if ((t->rt = dummy->lt) != 0) t->rt->par = t;
- t->par = 0;
- root = t;
- return Pix(root);
-}
-
-void <T>SplayBag::_del(<T>SplayNode* t)
-{
- if (t == 0) return;
-
- <T>SplayNode* p = t->par;
-
- --count;
- if (t->rt == 0)
- {
- if (t == root)
- {
- if ((root = t->lt) != 0) root->par = 0;
- }
- else if (t == p->lt)
- {
- if ((p->lt = t->lt) != 0) p->lt->par = p;
- }
- else
- if ((p->rt = t->lt) != 0) p->rt->par = p;
- }
- else
- {
- <T>SplayNode* r = t->rt;
- <T>SplayNode* l = r->lt;
- for(;;)
- {
- if (l == 0)
- {
- if (t == root)
- {
- root = r;
- r->par = 0;
- }
- else if (t == p->lt)
- {
- p->lt = r;
- r->par = p;
- }
- else
- {
- p->rt = r;
- r->par = p;
- }
- if ((r->lt = t->lt) != 0) r->lt->par = r;
- break;
- }
- else
- {
- if ((r->lt = l->rt) != 0) r->lt->par = r;
- l->rt = r; r->par = l;
- r = l;
- l = l->lt;
- }
- }
- }
- delete t;
-}
-
-
-void <T>SplayBag::remove(<T&> key)
-{
- <T>SplayNode* t = (<T>SplayNode*)(seek(key));
- while (t != 0)
- {
- _del(t);
- t = (<T>SplayNode*)(seek(key));
- }
-}
-
-
-void <T>SplayBag::_kill(<T>SplayNode* t)
-{
- if (t != 0)
- {
- _kill(t->lt);
- _kill(t->rt);
- delete t;
- }
-}
-
-
-<T>SplayNode* <T>SplayBag::_copy(<T>SplayNode* t)
-{
- if (t != 0)
- {
- <T>SplayNode* l = _copy(t->lt);
- <T>SplayNode* r = _copy(t->rt);
- <T>SplayNode* x = new <T>SplayNode(t->item, l, r);
- if (l != 0) l->par = x;
- if (r != 0) r->par = x;
- return x;
- }
- else
- return 0;
-}
-
-int <T>SplayBag::OK()
-{
- int v = 1;
- if (root == 0)
- v = count == 0;
- else
- {
- int n = 1;
- <T>SplayNode* trail = leftmost();
- <T>SplayNode* t = succ(trail);
- while (t != 0)
- {
- ++n;
- v &= <T>CMP(trail->item, t->item) <= 0;
- trail = t;
- t = succ(t);
- }
- v &= n == count;
- }
- if (!v) error("invariant failure");
- return v;
-}
-
diff --git a/contrib/libg++/libg++/src/gen/SplayBag.hP b/contrib/libg++/libg++/src/gen/SplayBag.hP
deleted file mode 100644
index 9059d453df50..000000000000
--- a/contrib/libg++/libg++/src/gen/SplayBag.hP
+++ /dev/null
@@ -1,126 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988, 1982 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifndef _<T>SplayBag_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _<T>SplayBag_h 1
-
-#include "<T>.Bag.h"
-#include "<T>.SplayNode.h"
-
-class <T>SplayBag : public <T>Bag
-{
-protected:
- <T>SplayNode* root;
-
- <T>SplayNode* leftmost();
- <T>SplayNode* rightmost();
- <T>SplayNode* pred(<T>SplayNode* t);
- <T>SplayNode* succ(<T>SplayNode* t);
- void _kill(<T>SplayNode* t);
- <T>SplayNode* _copy(<T>SplayNode* t);
- void _del(<T>SplayNode* t);
-
-public:
- <T>SplayBag();
- <T>SplayBag(<T>SplayBag& a);
- inline ~<T>SplayBag();
-
- Pix add(<T&> item);
- inline void del(<T&> item);
- void remove(<T&>item);
- int nof(<T&> item);
- inline int contains(<T&> item);
-
- inline void clear();
-
- inline Pix first();
- inline void next(Pix& i);
- inline <T>& operator () (Pix i);
- Pix seek(<T&> item, Pix from = 0);
-
- Pix last();
- void prev(Pix& i);
-
- int OK();
-};
-
-
-inline <T>SplayBag::~<T>SplayBag()
-{
- _kill(root);
-}
-
-inline <T>SplayBag::<T>SplayBag()
-{
- root = 0;
- count = 0;
-}
-
-inline <T>SplayBag::<T>SplayBag(<T>SplayBag& b)
-{
- count = b.count;
- root = _copy(b.root);
-}
-
-inline Pix <T>SplayBag::first()
-{
- return Pix(leftmost());
-}
-
-inline Pix <T>SplayBag::last()
-{
- return Pix(rightmost());
-}
-
-inline void <T>SplayBag::next(Pix& i)
-{
- if (i != 0) i = Pix(succ((<T>SplayNode*)i));
-}
-
-inline void <T>SplayBag::prev(Pix& i)
-{
- if (i != 0) i = Pix(pred((<T>SplayNode*)i));
-}
-
-inline <T>& <T>SplayBag::operator () (Pix i)
-{
- if (i == 0) error("null Pix");
- return ((<T>SplayNode*)i)->item;
-}
-
-inline void <T>SplayBag::clear()
-{
- _kill(root);
- count = 0;
- root = 0;
-}
-
-inline int <T>SplayBag::contains(<T&> key)
-{
- return seek(key) != 0;
-}
-
-inline void <T>SplayBag::del(<T&> key)
-{
- _del((<T>SplayNode*)(seek(key)));
-}
-
-#endif
diff --git a/contrib/libg++/libg++/src/gen/SplayMap.ccP b/contrib/libg++/libg++/src/gen/SplayMap.ccP
deleted file mode 100644
index 5b9ffe96a961..000000000000
--- a/contrib/libg++/libg++/src/gen/SplayMap.ccP
+++ /dev/null
@@ -1,401 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <stream.h>
-#include "<T>.<C>.SplayMap.h"
-
-
-/*
-
- struct to simulate the special `null' node in the Sleater & Tarjan JACM 1985
- splay tree algorithms
-
- All routines use a version of their `simple top-down' splay alg. (p 669)
-
-*/
-
-struct _dummySplayNode
-{
- <T><C>SplayNode* lt;
- <T><C>SplayNode* rt;
- <T><C>SplayNode* par;
-} _dummy_null;
-
-
-/*
- traversal primitives
-*/
-
-
-<T><C>SplayNode* <T><C>SplayMap::leftmost()
-{
- <T><C>SplayNode* t = root;
- if (t != 0) while (t->lt != 0) t = t->lt;
- return t;
-}
-
-<T><C>SplayNode* <T><C>SplayMap::rightmost()
-{
- <T><C>SplayNode* t = root;
- if (t != 0) while (t->rt != 0) t = t->rt;
- return t;
-}
-
-<T><C>SplayNode* <T><C>SplayMap::succ(<T><C>SplayNode* t)
-{
- if (t == 0)
- return 0;
- if (t->rt != 0)
- {
- t = t->rt;
- while (t->lt != 0) t = t->lt;
- return t;
- }
- else
- {
- for (;;)
- {
- if (t->par == 0 || t == t->par->lt)
- return t->par;
- else
- t = t->par;
- }
- }
-}
-
-<T><C>SplayNode* <T><C>SplayMap::pred(<T><C>SplayNode* t)
-{
- if (t == 0)
- return 0;
- else if (t->lt != 0)
- {
- t = t->lt;
- while (t->rt != 0) t = t->rt;
- return t;
- }
- else
- {
- for (;;)
- {
- if (t->par == 0 || t == t->par->rt)
- return t->par;
- else
- t = t->par;
- }
- }
-}
-
-
-Pix <T><C>SplayMap::seek(<T&> key)
-{
- <T><C>SplayNode* t = root;
- if (t == 0)
- return 0;
-
- int comp = <T>CMP(key, t->item);
- if (comp == 0)
- return Pix(t);
-
- <T><C>SplayNode* dummy = (<T><C>SplayNode*)(&_dummy_null);
- <T><C>SplayNode* l = dummy;
- <T><C>SplayNode* r = dummy;
- dummy->rt = dummy->lt = dummy->par = 0;
-
- while (comp != 0)
- {
- if (comp > 0)
- {
- <T><C>SplayNode* tr = t->rt;
- if (tr == 0)
- break;
- else
- {
- comp = <T>CMP(key, tr->item);
- if (comp <= 0 || tr->rt == 0)
- {
- l->rt = t; t->par = l;
- l = t;
- t = tr;
- if (comp >= 0)
- break;
- }
- else
- {
- if ((t->rt = tr->lt) != 0) t->rt->par = t;
- tr->lt = t; t->par = tr;
- l->rt = tr; tr->par = l;
- l = tr;
- t = tr->rt;
- comp = <T>CMP(key, t->item);
- }
- }
- }
- else
- {
- <T><C>SplayNode* tl = t->lt;
- if (tl == 0)
- break;
- else
- {
- comp = <T>CMP(key, tl->item);
- if (comp >= 0 || tl->lt == 0)
- {
- r->lt = t; t->par = r;
- r = t;
- t = tl;
- if (comp <= 0)
- break;
- }
- else
- {
- if ((t->lt = tl->rt) != 0) t->lt->par = t;
- tl->rt = t; t->par = tl;
- r->lt = tl; tl->par = r;
- r = tl;
- t = tl->lt;
- comp = <T>CMP(key, t->item);
- }
- }
- }
- }
- if ((r->lt = t->rt) != 0) r->lt->par = r;
- if ((l->rt = t->lt) != 0) l->rt->par = l;
- if ((t->lt = dummy->rt) != 0) t->lt->par = t;
- if ((t->rt = dummy->lt) != 0) t->rt->par = t;
- t->par = 0;
- root = t;
- return (comp == 0) ? Pix(t) : 0;
-}
-
-
-<C>& <T><C>SplayMap::operator [] (<T&> item)
-{
- <T><C>SplayNode* t = root;
- if (t == 0)
- {
- ++count;
- root = new <T><C>SplayNode(item, def);
- return root->cont;
- }
- int comp = <T>CMP(item, t->item);
- if (comp == 0)
- return t->cont;
-
- <T><C>SplayNode* dummy = (<T><C>SplayNode*)(&_dummy_null);
- <T><C>SplayNode* l = dummy;
- <T><C>SplayNode* r = dummy;
- dummy->rt = dummy->lt = dummy->par = 0;
-
- while (comp != 0)
- {
- if (comp > 0)
- {
- <T><C>SplayNode* tr = t->rt;
- if (tr == 0)
- {
- ++count;
- tr = new <T><C>SplayNode(item, def);
- comp = 0;
- }
- else
- comp = <T>CMP(item, tr->item);
-
- if (comp <= 0)
- {
- l->rt = t; t->par = l;
- l = t;
- t = tr;
- }
- else
- {
- <T><C>SplayNode* trr = tr->rt;
- if (trr == 0)
- {
- ++count;
- trr = new <T><C>SplayNode(item, def);
- comp = 0;
- }
- else
- comp = <T>CMP(item, trr->item);
-
- if ((t->rt = tr->lt) != 0) t->rt->par = t;
- tr->lt = t; t->par = tr;
- l->rt = tr; tr->par = l;
- l = tr;
- t = trr;
- }
- }
- else
- {
- <T><C>SplayNode* tl = t->lt;
- if (tl == 0)
- {
- ++count;
- tl = new <T><C>SplayNode(item, def);
- comp = 0;
- }
- else
- comp = <T>CMP(item, tl->item);
-
- if (comp >= 0)
- {
- r->lt = t; t->par = r;
- r = t;
- t = tl;
- }
- else
- {
- <T><C>SplayNode* tll = tl->lt;
- if (tll == 0)
- {
- ++count;
- tll = new <T><C>SplayNode(item, def);
- comp = 0;
- }
- else
- comp = <T>CMP(item, tll->item);
-
- if ((t->lt = tl->rt) != 0) t->lt->par = t;
- tl->rt = t; t->par = tl;
- r->lt = tl; tl->par = r;
- r = tl;
- t = tll;
- }
- }
- }
- if ((r->lt = t->rt) != 0) r->lt->par = r;
- if ((l->rt = t->lt) != 0) l->rt->par = l;
- if ((t->lt = dummy->rt) != 0) t->lt->par = t;
- if ((t->rt = dummy->lt) != 0) t->rt->par = t;
- t->par = 0;
- root = t;
- return root->cont;
-}
-
-void <T><C>SplayMap::del(<T&> key)
-{
- <T><C>SplayNode* t = (<T><C>SplayNode*)(seek(key));
- if (t == 0) return;
-
- <T><C>SplayNode* p = t->par;
-
- --count;
- if (t->rt == 0)
- {
- if (t == root)
- {
- if ((root = t->lt) != 0) root->par = 0;
- }
- else if (t == p->lt)
- {
- if ((p->lt = t->lt) != 0) p->lt->par = p;
- }
- else
- if ((p->rt = t->lt) != 0) p->rt->par = p;
- }
- else
- {
- <T><C>SplayNode* r = t->rt;
- <T><C>SplayNode* l = r->lt;
- for(;;)
- {
- if (l == 0)
- {
- if (t == root)
- {
- root = r;
- r->par = 0;
- }
- else if (t == p->lt)
- {
- p->lt = r;
- r->par = p;
- }
- else
- {
- p->rt = r;
- r->par = p;
- }
- if ((r->lt = t->lt) != 0) r->lt->par = r;
- break;
- }
- else
- {
- if ((r->lt = l->rt) != 0) r->lt->par = r;
- l->rt = r; r->par = l;
- r = l;
- l = l->lt;
- }
- }
- }
- delete t;
-}
-
-
-void <T><C>SplayMap::_kill(<T><C>SplayNode* t)
-{
- if (t != 0)
- {
- _kill(t->lt);
- _kill(t->rt);
- delete t;
- }
-}
-
-
-<T><C>SplayNode* <T><C>SplayMap::_copy(<T><C>SplayNode* t)
-{
- if (t != 0)
- {
- <T><C>SplayNode* l = _copy(t->lt);
- <T><C>SplayNode* r = _copy(t->rt);
- <T><C>SplayNode* x = new <T><C>SplayNode(t->item, t->cont, l, r);
- if (l != 0) l->par = x;
- if (r != 0) r->par = x;
- return x;
- }
- else
- return 0;
-}
-
-
-int <T><C>SplayMap::OK()
-{
- int v = 1;
- if (root == 0)
- v = count == 0;
- else
- {
- int n = 1;
- <T><C>SplayNode* trail = leftmost();
- <T><C>SplayNode* t = succ(trail);
- while (t != 0)
- {
- ++n;
- v &= <T>CMP(trail->item, t->item) < 0;
- trail = t;
- t = succ(t);
- }
- v &= n == count;
- }
- if (!v) error("invariant failure");
- return v;
-}
diff --git a/contrib/libg++/libg++/src/gen/SplayMap.hP b/contrib/libg++/libg++/src/gen/SplayMap.hP
deleted file mode 100644
index 3acb1d4b14d1..000000000000
--- a/contrib/libg++/libg++/src/gen/SplayMap.hP
+++ /dev/null
@@ -1,154 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-
-#ifndef _<T><C>SplayMap_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _<T><C>SplayMap_h 1
-
-#include "<T>.<C>.Map.h"
-
-#ifndef _<T><C>SplayNode
-#define _<T><C>SplayNode 1
-
-struct <T><C>SplayNode
-{
- <T><C>SplayNode* lt;
- <T><C>SplayNode* rt;
- <T><C>SplayNode* par;
- <T> item;
- <C> cont;
- <T><C>SplayNode(<T&> h, <C&> c,
- <T><C>SplayNode* l=0,
- <T><C>SplayNode* r=0);
- ~<T><C>SplayNode();
-};
-
-
-inline <T><C>SplayNode::<T><C>SplayNode(<T&> h, <C&> c,
- <T><C>SplayNode* l,
- <T><C>SplayNode* r)
- :lt(l), rt(r), par(0), item(h), cont(c) {}
-
-inline <T><C>SplayNode::~<T><C>SplayNode() {}
-
-typedef <T><C>SplayNode* <T><C>SplayNodePtr;
-
-#endif
-
-class <T><C>SplayMap : public <T><C>Map
-{
-protected:
- <T><C>SplayNode* root;
-
- <T><C>SplayNode* leftmost();
- <T><C>SplayNode* rightmost();
- <T><C>SplayNode* pred(<T><C>SplayNode* t);
- <T><C>SplayNode* succ(<T><C>SplayNode* t);
- void _kill(<T><C>SplayNode* t);
- <T><C>SplayNode* _copy(<T><C>SplayNode* t);
-
-public:
- <T><C>SplayMap(<C&> dflt);
- <T><C>SplayMap(<T><C>SplayMap& a);
- inline ~<T><C>SplayMap();
-
- <C>& operator [] (<T&> key);
-
- void del(<T&> key);
-
- inline Pix first();
- inline void next(Pix& i);
- inline <T>& key(Pix i);
- inline <C>& contents(Pix i);
-
- Pix seek(<T&> key);
- inline int contains(<T&> key);
-
- inline void clear();
-
- Pix last();
- void prev(Pix& i);
-
- int OK();
-};
-
-
-inline <T><C>SplayMap::~<T><C>SplayMap()
-{
- _kill(root);
-}
-
-inline <T><C>SplayMap::<T><C>SplayMap(<C&> dflt) :<T><C>Map(dflt)
-{
- root = 0;
-}
-
-inline <T><C>SplayMap::<T><C>SplayMap(<T><C>SplayMap& b) :<T><C>Map(b.def)
-{
- count = b.count;
- root = _copy(b.root);
-}
-
-inline Pix <T><C>SplayMap::first()
-{
- return Pix(leftmost());
-}
-
-inline Pix <T><C>SplayMap::last()
-{
- return Pix(rightmost());
-}
-
-inline void <T><C>SplayMap::next(Pix& i)
-{
- if (i != 0) i = Pix(succ((<T><C>SplayNode*)i));
-}
-
-inline void <T><C>SplayMap::prev(Pix& i)
-{
- if (i != 0) i = Pix(pred((<T><C>SplayNode*)i));
-}
-
-inline <T>& <T><C>SplayMap::key (Pix i)
-{
- if (i == 0) error("null Pix");
- return ((<T><C>SplayNode*)i)->item;
-}
-
-inline <C>& <T><C>SplayMap::contents (Pix i)
-{
- if (i == 0) error("null Pix");
- return ((<T><C>SplayNode*)i)->cont;
-}
-
-inline void <T><C>SplayMap::clear()
-{
- _kill(root);
- count = 0;
- root = 0;
-}
-
-inline int <T><C>SplayMap::contains(<T&> key)
-{
- return seek(key) != 0;
-}
-
-#endif
diff --git a/contrib/libg++/libg++/src/gen/SplayNode.ccP b/contrib/libg++/libg++/src/gen/SplayNode.ccP
deleted file mode 100644
index 74f071140fe3..000000000000
--- a/contrib/libg++/libg++/src/gen/SplayNode.ccP
+++ /dev/null
@@ -1,21 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1992 Free Software Foundation
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include "<T>.SplayNode.h"
diff --git a/contrib/libg++/libg++/src/gen/SplayNode.hP b/contrib/libg++/libg++/src/gen/SplayNode.hP
deleted file mode 100644
index e50ced51dcfb..000000000000
--- a/contrib/libg++/libg++/src/gen/SplayNode.hP
+++ /dev/null
@@ -1,44 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988, 1982 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifndef _<T>SplayNode
-#define _<T>SplayNode 1
-#ifdef __GNUG__
-#pragma interface
-#endif
-#include "<T>.defs.h"
-
-struct <T>SplayNode
-{
- <T>SplayNode* lt;
- <T>SplayNode* rt;
- <T>SplayNode* par;
- <T> item;
- <T>SplayNode(<T&> h, <T>SplayNode* l=0, <T>SplayNode* r=0);
- ~<T>SplayNode();
-};
-
-
-inline <T>SplayNode::<T>SplayNode(<T&> h, <T>SplayNode* l, <T>SplayNode* r)
-:lt(l), rt(r), par(0), item(h) {}
-
-inline <T>SplayNode::~<T>SplayNode() {}
-
-typedef <T>SplayNode* <T>SplayNodePtr;
-
-#endif
diff --git a/contrib/libg++/libg++/src/gen/SplayPQ.ccP b/contrib/libg++/libg++/src/gen/SplayPQ.ccP
deleted file mode 100644
index 890b9585e3a0..000000000000
--- a/contrib/libg++/libg++/src/gen/SplayPQ.ccP
+++ /dev/null
@@ -1,523 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <stream.h>
-#include "<T>.SplayPQ.h"
-
-
-/*
-
- struct to simulate the special `null' node in the Sleater & Tarjan JACM 1985
- splay tree algorithms
-
- All routines use a version of their `simple top-down' splay alg. (p 669)
-
-*/
-
-struct _dummySplayNode
-{
- <T>SplayNode* lt;
- <T>SplayNode* rt;
- <T>SplayNode* par;
-} _dummy_null;
-
-
-/*
- traversal primitives
-*/
-
-
-<T>SplayNode* <T>SplayPQ::leftmost()
-{
- <T>SplayNode* t = root;
- if (t != 0) while (t->lt != 0) t = t->lt;
- return t;
-}
-
-<T>SplayNode* <T>SplayPQ::rightmost()
-{
- <T>SplayNode* t = root;
- if (t != 0) while (t->rt != 0) t = t->rt;
- return t;
-}
-
-<T>SplayNode* <T>SplayPQ::succ(<T>SplayNode* t)
-{
- if (t == 0)
- return 0;
- if (t->rt != 0)
- {
- t = t->rt;
- while (t->lt != 0) t = t->lt;
- return t;
- }
- else
- {
- for (;;)
- {
- if (t->par == 0 || t == t->par->lt)
- return t->par;
- else
- t = t->par;
- }
- }
-}
-
-<T>SplayNode* <T>SplayPQ::pred(<T>SplayNode* t)
-{
- if (t == 0)
- return 0;
- else if (t->lt != 0)
- {
- t = t->lt;
- while (t->rt != 0) t = t->rt;
- return t;
- }
- else
- {
- for (;;)
- {
- if (t->par == 0 || t == t->par->rt)
- return t->par;
- else
- t = t->par;
- }
- }
-}
-
-
-Pix <T>SplayPQ::seek(<T&> key)
-{
- <T>SplayNode* t = root;
- if (t == 0)
- return 0;
-
- int comp = <T>CMP(key, t->item);
- if (comp == 0)
- return Pix(t);
-
- <T>SplayNode* dummy = (<T>SplayNode*)(&_dummy_null);
- <T>SplayNode* l = dummy;
- <T>SplayNode* r = dummy;
- dummy->rt = dummy->lt = dummy->par = 0;
-
- while (comp != 0)
- {
- if (comp > 0)
- {
- <T>SplayNode* tr = t->rt;
- if (tr == 0)
- break;
- else
- {
- comp = <T>CMP(key, tr->item);
- if (comp <= 0 || tr->rt == 0)
- {
- l->rt = t; t->par = l;
- l = t;
- t = tr;
- if (comp >= 0)
- break;
- }
- else
- {
- if ((t->rt = tr->lt) != 0) t->rt->par = t;
- tr->lt = t; t->par = tr;
- l->rt = tr; tr->par = l;
- l = tr;
- t = tr->rt;
- comp = <T>CMP(key, t->item);
- }
- }
- }
- else
- {
- <T>SplayNode* tl = t->lt;
- if (tl == 0)
- break;
- else
- {
- comp = <T>CMP(key, tl->item);
- if (comp >= 0 || tl->lt == 0)
- {
- r->lt = t; t->par = r;
- r = t;
- t = tl;
- if (comp <= 0)
- break;
- }
- else
- {
- if ((t->lt = tl->rt) != 0) t->lt->par = t;
- tl->rt = t; t->par = tl;
- r->lt = tl; tl->par = r;
- r = tl;
- t = tl->lt;
- comp = <T>CMP(key, t->item);
- }
- }
- }
- }
- if ((r->lt = t->rt) != 0) r->lt->par = r;
- if ((l->rt = t->lt) != 0) l->rt->par = l;
- if ((t->lt = dummy->rt) != 0) t->lt->par = t;
- if ((t->rt = dummy->lt) != 0) t->rt->par = t;
- t->par = 0;
- root = t;
- return (comp == 0) ? Pix(t) : 0;
-}
-
-
-Pix <T>SplayPQ::enq(<T&> item)
-{
- ++count;
- <T>SplayNode* newnode = new <T>SplayNode(item);
- <T>SplayNode* t = root;
- if (t == 0)
- {
- root = newnode;
- return Pix(root);
- }
-
- int comp = <T>CMP(item, t->item);
-
- <T>SplayNode* dummy = (<T>SplayNode*)(&_dummy_null);
- <T>SplayNode* l = dummy;
- <T>SplayNode* r = dummy;
- dummy->rt = dummy->lt = dummy->par = 0;
-
- int done = 0;
- while (!done)
- {
- if (comp >= 0)
- {
- <T>SplayNode* tr = t->rt;
- if (tr == 0)
- {
- tr = newnode;
- comp = 0; done = 1;
- }
- else
- comp = <T>CMP(item, tr->item);
-
- if (comp <= 0)
- {
- l->rt = t; t->par = l;
- l = t;
- t = tr;
- }
- else
- {
- <T>SplayNode* trr = tr->rt;
- if (trr == 0)
- {
- trr = newnode;
- comp = 0; done = 1;
- }
- else
- comp = <T>CMP(item, trr->item);
-
- if ((t->rt = tr->lt) != 0) t->rt->par = t;
- tr->lt = t; t->par = tr;
- l->rt = tr; tr->par = l;
- l = tr;
- t = trr;
- }
- }
- else
- {
- <T>SplayNode* tl = t->lt;
- if (tl == 0)
- {
- tl = newnode;
- comp = 0; done = 1;
- }
- else
- comp = <T>CMP(item, tl->item);
-
- if (comp >= 0)
- {
- r->lt = t; t->par = r;
- r = t;
- t = tl;
- }
- else
- {
- <T>SplayNode* tll = tl->lt;
- if (tll == 0)
- {
- tll = newnode;
- comp = 0; done = 1;
- }
- else
- comp = <T>CMP(item, tll->item);
-
- if ((t->lt = tl->rt) != 0) t->lt->par = t;
- tl->rt = t; t->par = tl;
- r->lt = tl; tl->par = r;
- r = tl;
- t = tll;
- }
- }
- }
- if ((r->lt = t->rt) != 0) r->lt->par = r;
- if ((l->rt = t->lt) != 0) l->rt->par = l;
- if ((t->lt = dummy->rt) != 0) t->lt->par = t;
- if ((t->rt = dummy->lt) != 0) t->rt->par = t;
- t->par = 0;
- root = t;
- return Pix(root);
-}
-
-
-void <T>SplayPQ::del(Pix pix)
-{
- <T>SplayNode* t = (<T>SplayNode*)pix;
- if (t == 0) return;
-
- <T>SplayNode* p = t->par;
-
- --count;
- if (t->rt == 0)
- {
- if (t == root)
- {
- if ((root = t->lt) != 0) root->par = 0;
- }
- else if (t == p->lt)
- {
- if ((p->lt = t->lt) != 0) p->lt->par = p;
- }
- else
- if ((p->rt = t->lt) != 0) p->rt->par = p;
- }
- else
- {
- <T>SplayNode* r = t->rt;
- <T>SplayNode* l = r->lt;
- for(;;)
- {
- if (l == 0)
- {
- if (t == root)
- {
- root = r;
- r->par = 0;
- }
- else if (t == p->lt)
- {
- p->lt = r;
- r->par = p;
- }
- else
- {
- p->rt = r;
- r->par = p;
- }
- if ((r->lt = t->lt) != 0) r->lt->par = r;
- break;
- }
- else
- {
- if ((r->lt = l->rt) != 0) r->lt->par = r;
- l->rt = r; r->par = l;
- r = l;
- l = l->lt;
- }
- }
- }
- delete t;
-}
-
-<T>& <T>SplayPQ::front()
-{
- if (root == 0)
- error ("min: empty tree\n");
-// else
- {
- <T>SplayNode* t = root;
- <T>SplayNode* l = root->lt;
- for(;;)
- {
- if (l == 0)
- {
- root = t;
- root->par = 0;
- return root->item;
- }
- else
- {
- if ((t->lt = l->rt) != 0) t->lt->par = t;
- l->rt = t; t->par = l;
- t = l;
- l = l->lt;
- }
- }
- }
-}
-
-void <T>SplayPQ::del_front()
-{
- if (root != 0)
- {
- --count;
- <T>SplayNode* t = root;
- <T>SplayNode* l = root->lt;
- if (l == 0)
- {
- if ((root = t->rt) != 0) root->par = 0;
- delete t;
- }
- else
- {
- for(;;)
- {
- <T>SplayNode* ll = l->lt;
- if (ll == 0)
- {
- if ((t->lt = l->rt) != 0) t->lt->par = t;
- delete l;
- break;
- }
- else
- {
- <T>SplayNode* lll = ll->lt;
- if (lll == 0)
- {
- if ((l->lt = ll->rt) != 0) l->lt->par = l;
- delete ll;
- break;
- }
- else
- {
- t->lt = ll; ll->par = t;
- if ((l->lt = ll->rt) != 0) l->lt->par = l;
- ll->rt = l; l->par = ll;
- t = ll;
- l = lll;
- }
- }
- }
- }
- }
-}
-
-<T> <T>SplayPQ::deq()
-{
- if (root == 0)
- error("deq: empty tree");
-// else
- {
- --count;
- <T>SplayNode* t = root;
- <T>SplayNode* l = root->lt;
- if (l == 0)
- {
- if ((root = t->rt) != 0) root->par = 0;
- <T> res = t->item;
- delete t;
- return res;
- }
- else
- {
- for(;;)
- {
- <T>SplayNode* ll = l->lt;
- if (ll == 0)
- {
- if ((t->lt = l->rt) != 0) t->lt->par = t;
- <T> res = l->item;
- delete l;
- return res;
- }
- else
- {
- <T>SplayNode* lll = ll->lt;
- if (lll == 0)
- {
- if ((l->lt = ll->rt) != 0) l->lt->par = l;
- <T> res = ll->item;
- delete ll;
- return res;
- }
- else
- {
- t->lt = ll; ll->par = t;
- if ((l->lt = ll->rt) != 0) l->lt->par = l;
- ll->rt = l; l->par = ll;
- t = ll;
- l = lll;
- }
- }
- }
- }
- }
-}
-
-
-void <T>SplayPQ::_kill(<T>SplayNode* t)
-{
- if (t != 0)
- {
- _kill(t->lt);
- _kill(t->rt);
- delete t;
- }
-}
-
-
-<T>SplayNode* <T>SplayPQ::_copy(<T>SplayNode* t)
-{
- if (t != 0)
- {
- <T>SplayNode* l = _copy(t->lt);
- <T>SplayNode* r = _copy(t->rt);
- <T>SplayNode* x = new <T>SplayNode(t->item, l, r);
- if (l != 0) l->par = x;
- if (r != 0) r->par = x;
- return x;
- }
- else
- return 0;
-}
-
-int <T>SplayPQ::OK()
-{
- int v = 1;
- if (root == 0)
- v = count == 0;
- else
- {
- int n = 1;
- <T>SplayNode* trail = leftmost();
- <T>SplayNode* t = succ(trail);
- while (t != 0)
- {
- ++n;
- v &= <T>CMP(trail->item, t->item) < 0;
- trail = t;
- t = succ(t);
- }
- v &= n == count;
- }
- if (!v) error("invariant failure");
- return v;
-}
diff --git a/contrib/libg++/libg++/src/gen/SplayPQ.hP b/contrib/libg++/libg++/src/gen/SplayPQ.hP
deleted file mode 100644
index 1084892fc8f3..000000000000
--- a/contrib/libg++/libg++/src/gen/SplayPQ.hP
+++ /dev/null
@@ -1,123 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-
-#ifndef _<T>SplayPQ_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _<T>SplayPQ_h 1
-
-#include "<T>.PQ.h"
-#include "<T>.SplayNode.h"
-
-class <T>SplayPQ : public <T>PQ
-{
-protected:
- <T>SplayNode* root;
-
- <T>SplayNode* leftmost();
- <T>SplayNode* rightmost();
- <T>SplayNode* pred(<T>SplayNode* t);
- <T>SplayNode* succ(<T>SplayNode* t);
- void _kill(<T>SplayNode* t);
- <T>SplayNode* _copy(<T>SplayNode* t);
-
-public:
- <T>SplayPQ();
- <T>SplayPQ(<T>SplayPQ& a);
- inline virtual ~<T>SplayPQ();
-
- Pix enq(<T&> item);
- <T> deq();
-
- <T>& front();
- void del_front();
-
- inline int contains(<T&> item);
-
- inline void clear();
-
- inline Pix first();
- Pix last();
- inline void next(Pix& i);
- void prev(Pix& i);
- inline <T>& operator () (Pix i);
- void del(Pix i);
- Pix seek(<T&> item);
-
- int OK(); // rep invariant
-};
-
-
-inline <T>SplayPQ::~<T>SplayPQ()
-{
- _kill(root);
-}
-
-inline <T>SplayPQ::<T>SplayPQ()
-{
- root = 0;
- count = 0;
-}
-
-inline <T>SplayPQ::<T>SplayPQ(<T>SplayPQ& b)
-{
- count = b.count;
- root = _copy(b.root);
-}
-
-inline Pix <T>SplayPQ::first()
-{
- return Pix(leftmost());
-}
-
-inline Pix <T>SplayPQ::last()
-{
- return Pix(rightmost());
-}
-
-inline void <T>SplayPQ::next(Pix& i)
-{
- if (i != 0) i = Pix(succ((<T>SplayNode*)i));
-}
-
-inline void <T>SplayPQ::prev(Pix& i)
-{
- if (i != 0) i = Pix(pred((<T>SplayNode*)i));
-}
-
-inline <T>& <T>SplayPQ::operator () (Pix i)
-{
- if (i == 0) error("null Pix");
- return ((<T>SplayNode*)i)->item;
-}
-
-inline void <T>SplayPQ::clear()
-{
- _kill(root);
- count = 0;
- root = 0;
-}
-
-inline int <T>SplayPQ::contains(<T&> key)
-{
- return seek(key) != 0;
-}
-
-#endif
diff --git a/contrib/libg++/libg++/src/gen/SplaySet.ccP b/contrib/libg++/libg++/src/gen/SplaySet.ccP
deleted file mode 100644
index ebee425dbe4b..000000000000
--- a/contrib/libg++/libg++/src/gen/SplaySet.ccP
+++ /dev/null
@@ -1,499 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <stream.h>
-#include "<T>.SplaySet.h"
-
-
-/*
-
- struct to simulate the special `null' node in the Sleater & Tarjan JACM 1985
- splay tree algorithms
-
- All routines use a version of their `simple top-down' splay alg. (p 669)
-
-*/
-
-struct _dummySplayNode
-{
- <T>SplayNode* lt;
- <T>SplayNode* rt;
- <T>SplayNode* par;
-} _dummy_null;
-
-
-/*
- traversal primitives
-*/
-
-
-<T>SplayNode* <T>SplaySet::leftmost()
-{
- <T>SplayNode* t = root;
- if (t != 0) while (t->lt != 0) t = t->lt;
- return t;
-}
-
-<T>SplayNode* <T>SplaySet::rightmost()
-{
- <T>SplayNode* t = root;
- if (t != 0) while (t->rt != 0) t = t->rt;
- return t;
-}
-
-<T>SplayNode* <T>SplaySet::succ(<T>SplayNode* t)
-{
- if (t == 0)
- return 0;
- if (t->rt != 0)
- {
- t = t->rt;
- while (t->lt != 0) t = t->lt;
- return t;
- }
- else
- {
- for (;;)
- {
- if (t->par == 0 || t == t->par->lt)
- return t->par;
- else
- t = t->par;
- }
- }
-}
-
-<T>SplayNode* <T>SplaySet::pred(<T>SplayNode* t)
-{
- if (t == 0)
- return 0;
- else if (t->lt != 0)
- {
- t = t->lt;
- while (t->rt != 0) t = t->rt;
- return t;
- }
- else
- {
- for (;;)
- {
- if (t->par == 0 || t == t->par->rt)
- return t->par;
- else
- t = t->par;
- }
- }
-}
-
-
-Pix <T>SplaySet::seek(<T&> key)
-{
- <T>SplayNode* t = root;
- if (t == 0)
- return 0;
-
- int comp = <T>CMP(key, t->item);
- if (comp == 0)
- return Pix(t);
-
- <T>SplayNode* dummy = (<T>SplayNode*)(&_dummy_null);
- <T>SplayNode* l = dummy;
- <T>SplayNode* r = dummy;
- dummy->rt = dummy->lt = dummy->par = 0;
-
- while (comp != 0)
- {
- if (comp > 0)
- {
- <T>SplayNode* tr = t->rt;
- if (tr == 0)
- break;
- else
- {
- comp = <T>CMP(key, tr->item);
- if (comp <= 0 || tr->rt == 0)
- {
- l->rt = t; t->par = l;
- l = t;
- t = tr;
- if (comp >= 0)
- break;
- }
- else
- {
- if ((t->rt = tr->lt) != 0) t->rt->par = t;
- tr->lt = t; t->par = tr;
- l->rt = tr; tr->par = l;
- l = tr;
- t = tr->rt;
- comp = <T>CMP(key, t->item);
- }
- }
- }
- else
- {
- <T>SplayNode* tl = t->lt;
- if (tl == 0)
- break;
- else
- {
- comp = <T>CMP(key, tl->item);
- if (comp >= 0 || tl->lt == 0)
- {
- r->lt = t; t->par = r;
- r = t;
- t = tl;
- if (comp <= 0)
- break;
- }
- else
- {
- if ((t->lt = tl->rt) != 0) t->lt->par = t;
- tl->rt = t; t->par = tl;
- r->lt = tl; tl->par = r;
- r = tl;
- t = tl->lt;
- comp = <T>CMP(key, t->item);
- }
- }
- }
- }
- if ((r->lt = t->rt) != 0) r->lt->par = r;
- if ((l->rt = t->lt) != 0) l->rt->par = l;
- if ((t->lt = dummy->rt) != 0) t->lt->par = t;
- if ((t->rt = dummy->lt) != 0) t->rt->par = t;
- t->par = 0;
- root = t;
- return (comp == 0) ? Pix(t) : 0;
-}
-
-
-
-Pix <T>SplaySet::add(<T&> item)
-{
- <T>SplayNode* t = root;
- if (t == 0)
- {
- ++count;
- root = new <T>SplayNode(item);
- return Pix(root);
- }
- int comp = <T>CMP(item, t->item);
- if (comp == 0)
- return Pix(t);
-
- <T>SplayNode* dummy = (<T>SplayNode*)(&_dummy_null);
- <T>SplayNode* l = dummy;
- <T>SplayNode* r = dummy;
- dummy->rt = dummy->lt = dummy->par = 0;
-
- while (comp != 0)
- {
- if (comp > 0)
- {
- <T>SplayNode* tr = t->rt;
- if (tr == 0)
- {
- ++count;
- tr = new <T>SplayNode(item);
- comp = 0;
- }
- else
- comp = <T>CMP(item, tr->item);
-
- if (comp <= 0)
- {
- l->rt = t; t->par = l;
- l = t;
- t = tr;
- }
- else
- {
- <T>SplayNode* trr = tr->rt;
- if (trr == 0)
- {
- ++count;
- trr = new <T>SplayNode(item);
- comp = 0;
- }
- else
- comp = <T>CMP(item, trr->item);
-
- if ((t->rt = tr->lt) != 0) t->rt->par = t;
- tr->lt = t; t->par = tr;
- l->rt = tr; tr->par = l;
- l = tr;
- t = trr;
- }
- }
- else
- {
- <T>SplayNode* tl = t->lt;
- if (tl == 0)
- {
- ++count;
- tl = new <T>SplayNode(item);
- comp = 0;
- }
- else
- comp = <T>CMP(item, tl->item);
-
- if (comp >= 0)
- {
- r->lt = t; t->par = r;
- r = t;
- t = tl;
- }
- else
- {
- <T>SplayNode* tll = tl->lt;
- if (tll == 0)
- {
- ++count;
- tll = new <T>SplayNode(item);
- comp = 0;
- }
- else
- comp = <T>CMP(item, tll->item);
-
- if ((t->lt = tl->rt) != 0) t->lt->par = t;
- tl->rt = t; t->par = tl;
- r->lt = tl; tl->par = r;
- r = tl;
- t = tll;
- }
- }
- }
- if ((r->lt = t->rt) != 0) r->lt->par = r;
- if ((l->rt = t->lt) != 0) l->rt->par = l;
- if ((t->lt = dummy->rt) != 0) t->lt->par = t;
- if ((t->rt = dummy->lt) != 0) t->rt->par = t;
- t->par = 0;
- root = t;
- return Pix(root);
-}
-
-void <T>SplaySet::del(<T&> key)
-{
- <T>SplayNode* t = (<T>SplayNode*)(seek(key));
- if (t == 0) return;
-
- <T>SplayNode* p = t->par;
-
- --count;
- if (t->rt == 0)
- {
- if (t == root)
- {
- if ((root = t->lt) != 0) root->par = 0;
- }
- else if (t == p->lt)
- {
- if ((p->lt = t->lt) != 0) p->lt->par = p;
- }
- else
- if ((p->rt = t->lt) != 0) p->rt->par = p;
- }
- else
- {
- <T>SplayNode* r = t->rt;
- <T>SplayNode* l = r->lt;
- for(;;)
- {
- if (l == 0)
- {
- if (t == root)
- {
- root = r;
- r->par = 0;
- }
- else if (t == p->lt)
- {
- p->lt = r;
- r->par = p;
- }
- else
- {
- p->rt = r;
- r->par = p;
- }
- if ((r->lt = t->lt) != 0) r->lt->par = r;
- break;
- }
- else
- {
- if ((r->lt = l->rt) != 0) r->lt->par = r;
- l->rt = r; r->par = l;
- r = l;
- l = l->lt;
- }
- }
- }
- delete t;
-}
-
-
-void <T>SplaySet::_kill(<T>SplayNode* t)
-{
- if (t != 0)
- {
- _kill(t->lt);
- _kill(t->rt);
- delete t;
- }
-}
-
-
-<T>SplayNode* <T>SplaySet::_copy(<T>SplayNode* t)
-{
- if (t != 0)
- {
- <T>SplayNode* l = _copy(t->lt);
- <T>SplayNode* r = _copy(t->rt);
- <T>SplayNode* x = new <T>SplayNode(t->item, l, r);
- if (l != 0) l->par = x;
- if (r != 0) r->par = x;
- return x;
- }
- else
- return 0;
-}
-
-/* relationals */
-
-int <T>SplaySet::operator == (<T>SplaySet& y)
-{
- if (count != y.count)
- return 0;
- else
- {
- <T>SplayNode* t = leftmost();
- <T>SplayNode* u = y.leftmost();
- for (;;)
- {
- if (t == 0)
- return 1;
- else if (!<T>EQ(t->item, u->item))
- return 0;
- else
- {
- t = succ(t);
- u = y.succ(u);
- }
- }
- }
-}
-
-int <T>SplaySet::operator <= (<T>SplaySet& y)
-{
- if (count > y.count)
- return 0;
- else
- {
- <T>SplayNode* t = leftmost();
- <T>SplayNode* u = y.leftmost();
- for (;;)
- {
- if (t == 0)
- return 1;
- else if (u == 0)
- return 0;
- int cmp = <T>CMP(t->item, u->item);
- if (cmp == 0)
- {
- t = succ(t);
- u = y.succ(u);
- }
- else if (cmp < 0)
- return 0;
- else
- u = y.succ(u);
- }
- }
-}
-
-
-void <T>SplaySet::operator |=(<T>SplaySet& y)
-{
- if (&y == this) return;
- <T>SplayNode* u = y.leftmost();
- while (u != 0)
- {
- add(u->item);
- u = y.succ(u);
- }
-}
-
-void <T>SplaySet::operator &= (<T>SplaySet& y)
-{
- if (y.count == 0)
- clear();
- else if (&y != this && count != 0)
- {
- <T>SplayNode* t = leftmost();
- while (t != 0)
- {
- <T>SplayNode* s = succ(t);
- if (y.seek(t->item) == 0) del(t->item);
- t = s;
- }
- }
-}
-
-
-void <T>SplaySet::operator -=(<T>SplaySet& y)
-{
- if (&y == this)
- clear();
- else if (y.count != 0)
- {
- <T>SplayNode* t = leftmost();
- while (t != 0)
- {
- <T>SplayNode* s = succ(t);
- if (y.seek(t->item) != 0) del(t->item);
- t = s;
- }
- }
-}
-
-int <T>SplaySet::OK()
-{
- int v = 1;
- if (root == 0)
- v = count == 0;
- else
- {
- int n = 1;
- <T>SplayNode* trail = leftmost();
- <T>SplayNode* t = succ(trail);
- while (t != 0)
- {
- ++n;
- v &= <T>CMP(trail->item, t->item) < 0;
- trail = t;
- t = succ(t);
- }
- v &= n == count;
- }
- if (!v) error("invariant failure");
- return v;
-}
diff --git a/contrib/libg++/libg++/src/gen/SplaySet.hP b/contrib/libg++/libg++/src/gen/SplaySet.hP
deleted file mode 100644
index e69358334818..000000000000
--- a/contrib/libg++/libg++/src/gen/SplaySet.hP
+++ /dev/null
@@ -1,145 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-
-#ifndef _<T>SplaySet_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _<T>SplaySet_h 1
-
-#include "<T>.Set.h"
-#include "<T>.SplayNode.h"
-
-class <T>SplaySet : public <T>Set
-{
-protected:
- <T>SplayNode* root;
-
- <T>SplayNode* leftmost();
- <T>SplayNode* rightmost();
- <T>SplayNode* pred(<T>SplayNode* t);
- <T>SplayNode* succ(<T>SplayNode* t);
- void _kill(<T>SplayNode* t);
- <T>SplayNode* _copy(<T>SplayNode* t);
-
-public:
- <T>SplaySet();
- <T>SplaySet(<T>SplaySet& a);
- inline ~<T>SplaySet();
-
- Pix add(<T&> item);
- void del(<T&> item);
- inline int contains(<T&> item);
-
- inline void clear();
-
- inline Pix first();
- inline void next(Pix& i);
- inline <T>& operator () (Pix i);
- Pix seek(<T&> item);
-
- Pix last();
- void prev(Pix& i);
-
- <T>SplaySet& operator = (const <T>SplaySet& b);
- void operator |= (<T>SplaySet& b);
- void operator -= (<T>SplaySet& b);
- void operator &= (<T>SplaySet& b);
-
- int operator == (<T>SplaySet& b);
- int operator != (<T>SplaySet& b);
- int operator <= (<T>SplaySet& b);
-
- int OK();
-};
-
-
-inline <T>SplaySet::~<T>SplaySet()
-{
- _kill(root);
-}
-
-inline <T>SplaySet::<T>SplaySet()
-{
- root = 0;
- count = 0;
-}
-
-inline <T>SplaySet::<T>SplaySet(<T>SplaySet& b)
-{
- count = b.count;
- root = _copy(b.root);
-}
-
-
-inline <T>SplaySet& <T>SplaySet::operator = (const <T>SplaySet& b)
-{
- if (this != &b)
- {
- _kill (root);
- count = b.count;
- root = _copy (b.root);
- }
- return *this;
-}
-
-inline int <T>SplaySet::operator != (<T>SplaySet& b)
-{
- return ! (*this == b);
-}
-
-inline Pix <T>SplaySet::first()
-{
- return Pix(leftmost());
-}
-
-inline Pix <T>SplaySet::last()
-{
- return Pix(rightmost());
-}
-
-inline void <T>SplaySet::next(Pix& i)
-{
- if (i != 0) i = Pix(succ((<T>SplayNode*)i));
-}
-
-inline void <T>SplaySet::prev(Pix& i)
-{
- if (i != 0) i = Pix(pred((<T>SplayNode*)i));
-}
-
-inline <T>& <T>SplaySet::operator () (Pix i)
-{
- if (i == 0) error("null Pix");
- return ((<T>SplayNode*)i)->item;
-}
-
-inline void <T>SplaySet::clear()
-{
- _kill(root);
- count = 0;
- root = 0;
-}
-
-inline int <T>SplaySet::contains(<T&> key)
-{
- return seek(key) != 0;
-}
-
-#endif
diff --git a/contrib/libg++/libg++/src/gen/Stack.ccP b/contrib/libg++/libg++/src/gen/Stack.ccP
deleted file mode 100644
index efb6b8edbde5..000000000000
--- a/contrib/libg++/libg++/src/gen/Stack.ccP
+++ /dev/null
@@ -1,11 +0,0 @@
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include "<T>.Stack.h"
-
-<T>Stack::~<T>Stack() {}
-
-void <T>Stack::error(const char* msg)
-{
- (*lib_error_handler)("Stack", msg);
-}
diff --git a/contrib/libg++/libg++/src/gen/Stack.hP b/contrib/libg++/libg++/src/gen/Stack.hP
deleted file mode 100644
index 094676880fce..000000000000
--- a/contrib/libg++/libg++/src/gen/Stack.hP
+++ /dev/null
@@ -1,51 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-
-#ifndef _<T>Stack_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _<T>Stack_h
-
-#include <builtin.h>
-
-#include "<T>.defs.h"
-
-class <T>Stack
-{
-public:
- <T>Stack() { }
- virtual ~<T>Stack();
-
- virtual void push(<T&> item) = 0;
- virtual <T> pop() = 0;
- virtual <T>& top() = 0;
- virtual void del_top() = 0;
-
- virtual int empty() = 0;
- virtual int full() = 0;
- virtual int length() = 0;
-
- virtual void clear() = 0;
-
- void error(const char*);
- virtual int OK() = 0;
-};
-
-#endif
diff --git a/contrib/libg++/libg++/src/gen/VHBag.ccP b/contrib/libg++/libg++/src/gen/VHBag.ccP
deleted file mode 100644
index daa8313beae6..000000000000
--- a/contrib/libg++/libg++/src/gen/VHBag.ccP
+++ /dev/null
@@ -1,264 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include "<T>.VHBag.h"
-
-/* codes for status fields */
-
-#define EMPTYCELL 0
-#define VALIDCELL 1
-#define DELETEDCELL 2
-
-
-<T>VHBag::<T>VHBag(unsigned int sz)
-{
- tab = new <T>[size = sz];
- status = new char[size];
- for (unsigned int i = 0; i < size; ++i) status[i] = EMPTYCELL;
- count = 0;
-}
-
-<T>VHBag::<T>VHBag(<T>VHBag& a)
-{
- tab = new <T>[size = a.size];
- status = new char[size];
- for (unsigned int i = 0; i < size; ++i) status[i] = EMPTYCELL;
- count = 0;
- for (Pix p = a.first(); p; a.next(p)) add(a(p));
-}
-
-
-/*
- * hashing method: double hash based on high bits of hash fct,
- * followed by linear probe. Can't do too much better if table
- * sizes not constrained to be prime.
-*/
-
-
-static inline unsigned int doublehashinc(unsigned int h, unsigned int s)
-{
- unsigned int dh = ((h / s) % s);
- return (dh > 1)? dh : 1;
-}
-
-Pix <T>VHBag::seek(<T&> key, Pix p)
-{
- <T>* t = (<T>*) p;
- if (t == 0 || !<T>EQ(*t, key))
- {
- unsigned int hashval = <T>HASH(key);
- unsigned int h = hashval % size;
- for (unsigned int i = 0; i <= size; ++i)
- {
- if (status[h] == EMPTYCELL)
- return 0;
- else if (status[h] == VALIDCELL && <T>EQ(key, tab[h]))
- return Pix(&tab[h]);
- if (i == 0)
- h = (h + doublehashinc(hashval, size)) % size;
- else if (++h >= size)
- h -= size;
- }
- return 0;
- }
- else
- {
- int seent = 0;
- unsigned int hashval = <T>HASH(key);
- unsigned int h = hashval % size;
- for (unsigned int i = 0; i <= size; ++i)
- {
- if (status[h] == EMPTYCELL)
- return 0;
- else if (&tab[h] == t)
- seent = 1;
- else if (seent && status[h] == VALIDCELL && <T>EQ(key, tab[h]))
- return Pix(&tab[h]);
- if (i == 0)
- h = (h + doublehashinc(hashval, size)) % size;
- else if (++h >= size)
- h -= size;
- }
- return 0;
- }
-}
-
-int <T>VHBag::nof(<T&> item)
-{
- int n = 0;
- unsigned int hashval = <T>HASH(item);
- unsigned int h = hashval % size;
- unsigned int firsth = size;
- for (unsigned int i = 0; i <= size; ++i)
- {
- if (status[h] == EMPTYCELL)
- return n;
- else if (h != firsth && status[h] == VALIDCELL && <T>EQ(item, tab[h]))
- {
- ++n;
- if (firsth >= size)
- firsth = h;
- }
- if (i == 0)
- h = (h + doublehashinc(hashval, size)) % size;
- else if (++h >= size)
- h -= size;
- }
- return n;
-}
-
-
-Pix <T>VHBag::add(<T&> item)
-{
- if (HASHTABLE_TOO_CROWDED(count, size))
- resize();
- unsigned int bestspot = size;
- unsigned int hashval = <T>HASH(item);
- unsigned int h = hashval % size;
- for (unsigned int i = 0; i <= size; ++i)
- {
- if (status[h] == EMPTYCELL)
- {
- if (bestspot >= size) bestspot = h;
- tab[bestspot] = item;
- status[bestspot] = VALIDCELL;
- ++count;
- return Pix(&tab[bestspot]);
- }
- else if (status[h] == DELETEDCELL)
- {
- if (bestspot >= size) bestspot = h;
- }
-
- if (i == 0)
- h = (h + doublehashinc(hashval, size)) % size;
- else if (++h >= size)
- h -= size;
- }
- tab[bestspot] = item;
- status[bestspot] = VALIDCELL;
- ++count;
- return Pix(&tab[bestspot]);
-}
-
-
-void <T>VHBag::del(<T&> key)
-{
- unsigned int hashval = <T>HASH(key);
- unsigned int h = hashval % size;
- for (unsigned int i = 0; i <= size; ++i)
- {
- if (status[h] == EMPTYCELL)
- return;
- else if (status[h] == VALIDCELL && <T>EQ(key, tab[h]))
- {
- status[h] = DELETEDCELL;
- --count;
- return;
- }
- if (i == 0)
- h = (h + doublehashinc(hashval, size)) % size;
- else if (++h >= size)
- h -= size;
- }
-}
-
-void <T>VHBag::remove(<T&> key)
-{
- unsigned int hashval = <T>HASH(key);
- unsigned int h = hashval % size;
- for (unsigned int i = 0; i <= size; ++i)
- {
- if (status[h] == EMPTYCELL)
- return;
- else if (status[h] == VALIDCELL && <T>EQ(key, tab[h]))
- {
- status[h] = DELETEDCELL;
- --count;
- }
- if (i == 0)
- h = (h + doublehashinc(hashval, size)) % size;
- else if (++h >= size)
- h -= size;
- }
-}
-
-void <T>VHBag::clear()
-{
- for (unsigned int i = 0; i < size; ++i) status[i] = EMPTYCELL;
- count = 0;
-}
-
-void <T>VHBag::resize(unsigned int newsize)
-{
- if (newsize <= count)
- {
- newsize = DEFAULT_INITIAL_CAPACITY;
- while (HASHTABLE_TOO_CROWDED(count, newsize)) newsize <<= 1;
- }
- <T>* oldtab = tab;
- char* oldstatus = status;
- unsigned int oldsize = size;
- tab = new <T>[size = newsize];
- status = new char[size];
- for (unsigned int i = 0; i < size; ++i) status[i] = EMPTYCELL;
- count = 0;
- for (unsigned int i = 0; i < oldsize; ++i) if (oldstatus[i] == VALIDCELL) add(oldtab[i]);
- delete [] oldtab;
- delete oldstatus;
-}
-
-Pix <T>VHBag::first()
-{
- for (unsigned int pos = 0; pos < size; ++pos)
- if (status[pos] == VALIDCELL) return Pix(&tab[pos]);
- return 0;
-}
-
-void <T>VHBag::next(Pix& i)
-{
- if (i == 0) return;
- unsigned int pos = ((unsigned)i - (unsigned)tab) / sizeof(<T>) + 1;
- for (; pos < size; ++pos)
- if (status[pos] == VALIDCELL)
- {
- i = Pix(&tab[pos]);
- return;
- }
- i = 0;
-}
-
-
-int <T>VHBag::OK()
-{
- int v = tab != 0;
- v &= status != 0;
- int n = 0;
- for (unsigned int i = 0; i < size; ++i)
- {
- if (status[i] == VALIDCELL) ++n;
- else if (status[i] != DELETEDCELL && status[i] != EMPTYCELL)
- v = 0;
- }
- v &= n == count;
- if (!v) error("invariant failure");
- return v;
-}
diff --git a/contrib/libg++/libg++/src/gen/VHBag.hP b/contrib/libg++/libg++/src/gen/VHBag.hP
deleted file mode 100644
index 7a7cc32e4684..000000000000
--- a/contrib/libg++/libg++/src/gen/VHBag.hP
+++ /dev/null
@@ -1,84 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-
-#ifndef _<T>VHBag_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _<T>VHBag_h 1
-
-#include "<T>.Bag.h"
-
-
-class <T>VHBag : public <T>Bag
-{
-protected:
- <T>* tab;
- char* status;
- unsigned int size;
-
-public:
- <T>VHBag(unsigned int sz = DEFAULT_INITIAL_CAPACITY);
- <T>VHBag(<T>VHBag& a);
- inline ~<T>VHBag();
-
- Pix add(<T&> item);
- void del(<T&> item);
- void remove(<T&>item);
- int nof(<T&> item);
- inline int contains(<T&> item);
-
- void clear();
-
- Pix first();
- void next(Pix& i);
- inline <T>& operator () (Pix i);
- Pix seek(<T&> item, Pix from = 0);
-
- int capacity();
- void resize(unsigned int newsize = 0);
-
- int OK();
-};
-
-
-inline <T>VHBag::~<T>VHBag()
-{
- delete [] tab;
- delete status;
-}
-
-
-inline int <T>VHBag::capacity()
-{
- return size;
-}
-
-inline int <T>VHBag::contains(<T&> key)
-{
- return seek(key) != 0;
-}
-
-inline <T>& <T>VHBag::operator () (Pix i)
-{
- if (i == 0) error("null Pix");
- return *((<T>*)i);
-}
-
-#endif
diff --git a/contrib/libg++/libg++/src/gen/VHMap.ccP b/contrib/libg++/libg++/src/gen/VHMap.ccP
deleted file mode 100644
index a24be1e5bfa0..000000000000
--- a/contrib/libg++/libg++/src/gen/VHMap.ccP
+++ /dev/null
@@ -1,210 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include "<T>.<C>.VHMap.h"
-
-/* codes for status fields */
-
-#define EMPTYCELL 0
-#define VALIDCELL 1
-#define DELETEDCELL 2
-
-
-<T><C>VHMap::<T><C>VHMap(<C&> dflt, unsigned int sz)
- :<T><C>Map(dflt)
-{
- tab = new <T>[size = sz];
- cont = new <C>[size];
- status = new char[size];
- for (unsigned int i = 0; i < size; ++i) status[i] = EMPTYCELL;
-}
-
-<T><C>VHMap::<T><C>VHMap(<T><C>VHMap& a) : <T><C>Map(a.def)
-{
- tab = new <T>[size = a.size];
- cont = new <C>[size];
- status = new char[size];
- for (unsigned int i = 0; i < size; ++i) status[i] = EMPTYCELL;
- count = 0;
- for (Pix p = a.first(); p; a.next(p)) (*this)[a.key(p)] = a.contents(p);
-}
-
-
-/*
- * hashing method: double hash based on high bits of hash fct,
- * followed by linear probe. Can't do too much better if table
- * sizes not constrained to be prime.
-*/
-
-
-static inline unsigned int doublehashinc(unsigned int h, unsigned int s)
-{
- unsigned int dh = ((h / s) % s);
- return (dh > 1)? dh : 1;
-}
-
-Pix <T><C>VHMap::seek(<T&> key)
-{
- unsigned int hashval = <T>HASH(key);
- unsigned int h = hashval % size;
- for (unsigned int i = 0; i <= size; ++i)
- {
- if (status[h] == EMPTYCELL)
- return 0;
- else if (status[h] == VALIDCELL && <T>EQ(key, tab[h]))
- return Pix(&tab[h]);
- if (i == 0)
- h = (h + doublehashinc(hashval, size)) % size;
- else if (++h >= size)
- h -= size;
- }
- return 0;
-}
-
-
-<C>& <T><C>VHMap::operator [](<T&> item)
-{
- if (HASHTABLE_TOO_CROWDED(count, size))
- resize();
-
- unsigned int bestspot = size;
- unsigned int hashval = <T>HASH(item);
- unsigned int h = hashval % size;
- for (unsigned int i = 0; i <= size; ++i)
- {
- if (status[h] == EMPTYCELL)
- {
- ++count;
- if (bestspot >= size) bestspot = h;
- tab[bestspot] = item;
- status[bestspot] = VALIDCELL;
- cont[bestspot] = def;
- return cont[bestspot];
- }
- else if (status[h] == DELETEDCELL)
- {
- if (bestspot >= size) bestspot = h;
- }
- else if (<T>EQ(tab[h],item))
- return cont[h];
-
- if (i == 0)
- h = (h + doublehashinc(hashval, size)) % size;
- else if (++h >= size)
- h -= size;
- }
-
- ++count;
- status[bestspot] = VALIDCELL;
- tab[bestspot] = item;
- cont[bestspot] = def;
- return cont[bestspot];
-}
-
-
-void <T><C>VHMap::del(<T&> key)
-{
- unsigned int hashval = <T>HASH(key);
- unsigned int h = hashval % size;
- for (unsigned int i = 0; i <= size; ++i)
- {
- if (status[h] == EMPTYCELL)
- return;
- else if (status[h] == VALIDCELL && <T>EQ(key, tab[h]))
- {
- status[h] = DELETEDCELL;
- --count;
- return;
- }
- if (i == 0)
- h = (h + doublehashinc(hashval, size)) % size;
- else if (++h >= size)
- h -= size;
- }
-}
-
-
-void <T><C>VHMap::clear()
-{
- for (unsigned int i = 0; i < size; ++i) status[i] = EMPTYCELL;
- count = 0;
-}
-
-void <T><C>VHMap::resize(unsigned int newsize)
-{
- if (newsize <= count)
- {
- newsize = DEFAULT_INITIAL_CAPACITY;
- while (HASHTABLE_TOO_CROWDED(count, newsize)) newsize <<= 1;
- }
- <T>* oldtab = tab;
- <C>* oldcont = cont;
- char* oldstatus = status;
- unsigned int oldsize = size;
- tab = new <T>[size = newsize];
- cont = new <C>[size];
- status = new char[size];
- for (unsigned int i = 0; i < size; ++i) status[i] = EMPTYCELL;
- count = 0;
- for (unsigned int i = 0; i < oldsize; ++i)
- if (oldstatus[i] == VALIDCELL)
- (*this)[oldtab[i]] = oldcont[i];
- delete [] oldtab;
- delete [] oldcont;
- delete [] oldstatus;
-}
-
-Pix <T><C>VHMap::first()
-{
- for (unsigned int pos = 0; pos < size; ++pos)
- if (status[pos] == VALIDCELL) return Pix(&tab[pos]);
- return 0;
-}
-
-void <T><C>VHMap::next(Pix& i)
-{
- if (i == 0) return;
- unsigned int pos = ((unsigned)i - (unsigned)tab) / sizeof(<T>) + 1;
- for (; pos < size; ++pos)
- if (status[pos] == VALIDCELL)
- {
- i = Pix(&tab[pos]);
- return;
- }
- i = 0;
-}
-
-
-int <T><C>VHMap::OK()
-{
- int v = tab != 0;
- v &= status != 0;
- int n = 0;
- for (unsigned int i = 0; i < size; ++i)
- {
- if (status[i] == VALIDCELL) ++n;
- else if (status[i] != DELETEDCELL && status[i] != EMPTYCELL)
- v = 0;
- }
- v &= n == count;
- if (!v) error("invariant failure");
- return v;
-}
diff --git a/contrib/libg++/libg++/src/gen/VHMap.hP b/contrib/libg++/libg++/src/gen/VHMap.hP
deleted file mode 100644
index ccc9328bcbae..000000000000
--- a/contrib/libg++/libg++/src/gen/VHMap.hP
+++ /dev/null
@@ -1,84 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-
-#ifndef _<T><C>VHMap_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _<T><C>VHMap_h 1
-
-#include "<T>.<C>.Map.h"
-
-
-class <T><C>VHMap : public <T><C>Map
-{
-protected:
- <T>* tab;
- <C>* cont;
- char* status;
- unsigned int size;
-
-public:
- <T><C>VHMap(<C&> dflt,unsigned int sz=DEFAULT_INITIAL_CAPACITY);
- <T><C>VHMap(<T><C>VHMap& a);
- inline ~<T><C>VHMap();
-
- <C>& operator [] (<T&> key);
-
- void del(<T&> key);
-
- Pix first();
- void next(Pix& i);
- inline <T>& key(Pix i);
- inline <C>& contents(Pix i);
-
- Pix seek(<T&> key);
- inline int contains(<T&> key);
-
- void clear();
- void resize(unsigned int newsize = 0);
-
- int OK();
-};
-
-inline <T><C>VHMap::~<T><C>VHMap()
-{
- delete [] tab;
- delete [] cont;
- delete [] status;
-}
-
-inline int <T><C>VHMap::contains(<T&> key)
-{
- return seek(key) != 0;
-}
-
-inline <T>& <T><C>VHMap::key(Pix i)
-{
- if (i == 0) error("null Pix");
- return *((<T>*)i);
-}
-
-inline <C>& <T><C>VHMap::contents(Pix i)
-{
- if (i == 0) error("null Pix");
- return cont[((unsigned)(i) - (unsigned)(tab)) / sizeof(<T>)];
-}
-
-#endif
diff --git a/contrib/libg++/libg++/src/gen/VHSet.ccP b/contrib/libg++/libg++/src/gen/VHSet.ccP
deleted file mode 100644
index 414a7288207f..000000000000
--- a/contrib/libg++/libg++/src/gen/VHSet.ccP
+++ /dev/null
@@ -1,263 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include "<T>.VHSet.h"
-
-/* codes for status fields */
-
-#define EMPTYCELL 0
-#define VALIDCELL 1
-#define DELETEDCELL 2
-
-
-<T>VHSet::<T>VHSet(unsigned int sz)
-{
- tab = new <T>[size = sz];
- status = new char[size];
- for (unsigned int i = 0; i < size; ++i) status[i] = EMPTYCELL;
- count = 0;
-}
-
-<T>VHSet::<T>VHSet(<T>VHSet& a)
-{
- tab = new <T>[size = a.size];
- status = new char[size];
- for (unsigned int i = 0; i < size; ++i) status[i] = EMPTYCELL;
- count = 0;
- for (Pix p = a.first(); p; a.next(p)) add(a(p));
-}
-
-
-/*
- * hashing method: double hash based on high bits of hash fct,
- * followed by linear probe. Can't do too much better if table
- * sizes not constrained to be prime.
-*/
-
-
-static inline unsigned int doublehashinc(unsigned int h, unsigned int s)
-{
- unsigned int dh = ((h / s) % s);
- return (dh > 1)? dh : 1;
-}
-
-Pix <T>VHSet::seek(<T&> key)
-{
- unsigned int hashval = <T>HASH(key);
- unsigned int h = hashval % size;
- for (unsigned int i = 0; i <= size; ++i)
- {
- if (status[h] == EMPTYCELL)
- return 0;
- else if (status[h] == VALIDCELL && <T>EQ(key, tab[h]))
- return Pix(&tab[h]);
- if (i == 0)
- h = (h + doublehashinc(hashval, size)) % size;
- else if (++h >= size)
- h -= size;
- }
- return 0;
-}
-
-
-Pix <T>VHSet::add(<T&> item)
-{
- if (HASHTABLE_TOO_CROWDED(count, size))
- resize();
-
- unsigned int bestspot = size;
- unsigned int hashval = <T>HASH(item);
- unsigned int h = hashval % size;
- for (unsigned int i = 0; i <= size; ++i)
- {
- if (status[h] == EMPTYCELL)
- {
- if (bestspot >= size) bestspot = h;
- tab[bestspot] = item;
- status[bestspot] = VALIDCELL;
- ++count;
- return Pix(&tab[bestspot]);
- }
- else if (status[h] == DELETEDCELL)
- {
- if (bestspot >= size) bestspot = h;
- }
- else if (<T>EQ(tab[h],item))
- return Pix(&tab[h]);
-
- if (i == 0)
- h = (h + doublehashinc(hashval, size)) % size;
- else if (++h >= size)
- h -= size;
- }
- tab[bestspot] = item;
- status[bestspot] = VALIDCELL;
- ++count;
- return Pix(&tab[bestspot]);
-
-}
-
-
-void <T>VHSet::del(<T&> key)
-{
- unsigned int hashval = <T>HASH(key);
- unsigned int h = hashval % size;
- for (unsigned int i = 0; i <= size; ++i)
- {
- if (status[h] == EMPTYCELL)
- return;
- else if (status[h] == VALIDCELL && <T>EQ(key, tab[h]))
- {
- status[h] = DELETEDCELL;
- --count;
- return;
- }
- if (i == 0)
- h = (h + doublehashinc(hashval, size)) % size;
- else if (++h >= size)
- h -= size;
- }
-}
-
-
-void <T>VHSet::clear()
-{
- for (unsigned int i = 0; i < size; ++i) status[i] = EMPTYCELL;
- count = 0;
-}
-
-void <T>VHSet::resize(unsigned int newsize)
-{
- if (newsize <= count)
- {
- newsize = DEFAULT_INITIAL_CAPACITY;
- while (HASHTABLE_TOO_CROWDED(count, newsize)) newsize <<= 1;
- }
- <T>* oldtab = tab;
- char* oldstatus = status;
- unsigned int oldsize = size;
- tab = new <T>[size = newsize];
- status = new char[size];
- for (unsigned int i = 0; i < size; ++i) status[i] = EMPTYCELL;
- count = 0;
- for (unsigned int i = 0; i < oldsize; ++i) if (oldstatus[i] == VALIDCELL) add(oldtab[i]);
- delete [] oldtab;
- delete oldstatus;
-}
-
-Pix <T>VHSet::first()
-{
- for (unsigned int pos = 0; pos < size; ++pos)
- if (status[pos] == VALIDCELL) return Pix(&tab[pos]);
- return 0;
-}
-
-void <T>VHSet::next(Pix& i)
-{
- if (i == 0) return;
- unsigned int pos = ((unsigned)i - (unsigned)tab) / sizeof(<T>) + 1;
- for (; pos < size; ++pos)
- if (status[pos] == VALIDCELL)
- {
- i = Pix(&tab[pos]);
- return;
- }
- i = 0;
-}
-
-int <T>VHSet:: operator == (<T>VHSet& b)
-{
- if (count != b.count)
- return 0;
- else
- {
- for (unsigned int i = 0; i < size; ++i)
- if (status[i] == VALIDCELL && b.seek(tab[i]) == 0)
- return 0;
- for (unsigned int i = 0; i < b.size; ++i)
- if (b.status[i] == VALIDCELL && seek(b.tab[i]) == 0)
- return 0;
- return 1;
- }
-}
-
-int <T>VHSet::operator <= (<T>VHSet& b)
-{
- if (count > b.count)
- return 0;
- else
- {
- for (unsigned int i = 0; i < size; ++i)
- if (status[i] == VALIDCELL && b.seek(tab[i]) == 0)
- return 0;
- return 1;
- }
-}
-
-void <T>VHSet::operator |= (<T>VHSet& b)
-{
- if (&b == this || b.count == 0)
- return;
- for (unsigned int i = 0; i < b.size; ++i)
- if (b.status[i] == VALIDCELL) add(b.tab[i]);
-}
-
-void <T>VHSet::operator &= (<T>VHSet& b)
-{
- if (&b == this || count == 0)
- return;
- for (unsigned int i = 0; i < size; ++i)
- {
- if (status[i] == VALIDCELL && b.seek(tab[i]) == 0)
- {
- status[i] = DELETEDCELL;
- --count;
- }
- }
-}
-
-void <T>VHSet::operator -= (<T>VHSet& b)
-{
- for (unsigned int i = 0; i < size; ++i)
- {
- if (status[i] == VALIDCELL && b.seek(tab[i]) != 0)
- {
- status[i] = DELETEDCELL;
- --count;
- }
- }
-}
-
-int <T>VHSet::OK()
-{
- int v = tab != 0;
- v &= status != 0;
- int n = 0;
- for (unsigned int i = 0; i < size; ++i)
- {
- if (status[i] == VALIDCELL) ++n;
- else if (status[i] != DELETEDCELL && status[i] != EMPTYCELL)
- v = 0;
- }
- v &= n == count;
- if (!v) error("invariant failure");
- return v;
-}
diff --git a/contrib/libg++/libg++/src/gen/VHSet.hP b/contrib/libg++/libg++/src/gen/VHSet.hP
deleted file mode 100644
index e7180b320203..000000000000
--- a/contrib/libg++/libg++/src/gen/VHSet.hP
+++ /dev/null
@@ -1,96 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-
-#ifndef _<T>VHSet_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _<T>VHSet_h 1
-
-#include "<T>.Set.h"
-
-
-
-class <T>VHSet : public <T>Set
-{
-protected:
- <T>* tab;
- char* status;
- unsigned int size;
-
-public:
- <T>VHSet(unsigned int sz = DEFAULT_INITIAL_CAPACITY);
- <T>VHSet(<T>VHSet& a);
- inline ~<T>VHSet();
-
- Pix add(<T&> item);
- void del(<T&> item);
- inline int contains(<T&> item);
-
- void clear();
-
- Pix first();
- void next(Pix& i);
- inline <T>& operator () (Pix i);
- Pix seek(<T&> item);
-
- void operator |= (<T>VHSet& b);
- void operator -= (<T>VHSet& b);
- void operator &= (<T>VHSet& b);
-
- int operator == (<T>VHSet& b);
- int operator != (<T>VHSet& b);
- int operator <= (<T>VHSet& b);
-
- int capacity();
- void resize(unsigned int newsize = 0);
-
- int OK();
-};
-
-
-inline <T>VHSet::~<T>VHSet()
-{
- delete [] tab;
- delete status;
-}
-
-
-inline int <T>VHSet::capacity()
-{
- return size;
-}
-
-inline int <T>VHSet::contains(<T&> key)
-{
- return seek(key) != 0;
-}
-
-inline <T>& <T>VHSet::operator () (Pix i)
-{
- if (i == 0) error("null Pix");
- return *((<T>*)i);
-}
-
-inline int <T>VHSet::operator != (<T>VHSet& b)
-{
- return ! ((*this) == b);
-}
-
-#endif
diff --git a/contrib/libg++/libg++/src/gen/VOHSet.ccP b/contrib/libg++/libg++/src/gen/VOHSet.ccP
deleted file mode 100644
index 252fdcb4c5bd..000000000000
--- a/contrib/libg++/libg++/src/gen/VOHSet.ccP
+++ /dev/null
@@ -1,305 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
- based on code by Doug Schmidt
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <stream.h>
-#include "<T>.VOHSet.h"
-
-
-/* codes for status fields */
-#define EMPTYCELL 0
-#define VALIDCELL 1
-#define DELETEDCELL 2
-
-
-<T>VOHSet::<T>VOHSet(int sz)
-{
-// The size of the hash table is always the smallest power of 2 >= the size
-// indicated by the user. This allows several optimizations, including
-// the use of actual double hashing and elimination of the mod instruction.
-
- size = 1;
- while (size < sz) size <<= 1;
- tab = new <T>[size];
- status = new char[size];
- for (int i = 0; i < size; ++i) status[i] = EMPTYCELL;
- count = cnt = 0;
-}
-
-<T>VOHSet::<T>VOHSet(<T>VOHSet& a)
-{
- tab = new <T>[size = a.size];
- status = new char[size];
- for (int i = 0; i < size; ++i) status[i] = EMPTYCELL;
- count = cnt = 0;
- for (Pix p = a.first(); p; a.next(p)) add(a(p));
-}
-
-Pix <T>VOHSet::seek(<T&> key)
-{
-// Uses ordered double hashing to perform a search of the table.
-// This greatly speeds up the average-case time for an unsuccessful search.
-
- unsigned hashval = <T>HASH(key);
-
- // We can avoid the mod operation since size is a power of 2.
- unsigned h = hashval & (size - 1);
-
- // The increment must be odd, since all odd numbers are relatively
- // prime to a power of 2!!
- unsigned inc = ((((hashval / size) << 1) + 1) & (size - 1));
-
- // There is always at least 1 empty cell, so this loop is guaranteed to halt!
- while (status[h] != EMPTYCELL)
- {
- int cmp = <T>CMP (key, tab[h]);
- if (cmp == 0)
- {
- if (status[h] == VALIDCELL)
- return Pix(&tab[h]);
- else
- return 0;
- }
- else if (cmp < 0)
- return 0;
- else
- h = ((h + inc) & (size - 1));
- }
- return 0;
-}
-
-// This adds an item if it doesn't already exist. By performing the initial
-// comparison we assure that the table always contains at least 1 empty
-// spot. This speeds up later searching by a constant factor.
-// The insertion algorithm uses ordered double hashing. See Standish's
-// 1980 ``Data Structure's Techniques'' book for details.
-
-Pix <T>VOHSet::add(<T&> x)
-{
- if (size <= cnt+1)
- resize();
-
- unsigned hashval = <T>HASH(x);
- unsigned h = hashval & (size - 1);
-
- if (status[h] != VALIDCELL) // save some work if possible
- {
- if (status[h] == EMPTYCELL)
- cnt++;
- count++;
- tab[h] = x;
- status[h] = VALIDCELL;
- return Pix(&tab[h]);
- }
-
- <T> item = x;
- Pix mypix = 0;
- unsigned inc = ((((hashval / size) << 1) + 1) & (size - 1));
-
- for (;;)
- {
- if (status[h] != VALIDCELL)
- {
- if (status[h] == EMPTYCELL)
- cnt++;
- count++;
- tab[h] = item;
- status[h] = VALIDCELL;
- return (mypix == 0)? Pix(&tab[h]) : mypix;
- }
- int cmp = <T>CMP(item, tab[h]);
- if (cmp == 0)
- return (mypix == 0)? Pix(&tab[h]) : mypix;
- else if (cmp < 0)
- {
- <T> temp = tab[h];
- tab[h] = item;
- item = temp;
- if (mypix == 0) mypix = Pix(&tab[h]);
- hashval = <T>HASH(item);
- h = hashval & (size - 1);
- inc = ((((hashval / size) << 1) + 1) & (size - 1));
- }
- else
- h = ((h + inc) & (size - 1));
- }
-}
-
-
-void <T>VOHSet::del(<T&> key)
-{
-// This performs a deletion by marking the item's status field.
-// Note that we only decrease the count, *not* the cnt, since this
-// would cause trouble for subsequent steps in the algorithm. See
-// Reingold and Hanson's ``Data Structure's'' book for a justification
-// of this approach.
-
- unsigned hashval = <T>HASH(key);
- unsigned h = hashval & (size - 1);
- unsigned inc = ((((hashval / size) << 1) + 1) & (size - 1));
-
- while (status[h] != EMPTYCELL)
- {
- int cmp = <T>CMP(key, tab[h]);
- if (cmp > 0)
- h = ((h + inc) & (size - 1));
- else if (status[h] == VALIDCELL && cmp == 0)
- {
- status[h] = DELETEDCELL;
- count--;
- return;
- }
- else
- return;
- }
-}
-
-void <T>VOHSet::clear()
-{
- for (int i = 0; i < size; ++i) status[i] = EMPTYCELL;
- count = cnt = 0;
-}
-
-void <T>VOHSet::resize(int newsize)
-{
- if (newsize <= count)
- newsize = count;
- int s = 1;
- while (s <= newsize) s <<= 1;
- newsize = s;
-
- <T>* oldtab = tab;
- char* oldstatus = status;
- int oldsize = size;
- tab = new <T>[size = newsize];
- status = new char[size];
- for (int i = 0; i < size; ++i) status[i] = EMPTYCELL;
- count = cnt = 0;
-
- for (int i = 0; i < oldsize; ++i) if (oldstatus[i] == VALIDCELL) add(oldtab[i]);
- delete [] oldtab;
- delete oldstatus;
-}
-
-Pix <T>VOHSet::first()
-{
- for (int pos = 0; pos < size; ++pos)
- if (status[pos] == VALIDCELL) return Pix(&tab[pos]);
- return 0;
-}
-
-void <T>VOHSet::next(Pix& i)
-{
- if (i == 0) return;
- int pos = ((unsigned)i - (unsigned)tab) / sizeof(<T>) + 1;
- for (; pos < size; ++pos)
- if (status[pos] == VALIDCELL)
- {
- i = Pix(&tab[pos]);
- return;
- }
- i = 0;
-}
-
-
-int <T>VOHSet:: operator == (<T>VOHSet& b)
-{
- if (count != b.count)
- return 0;
- else
- {
- for (int i = 0; i < size; ++i)
- if (status[i] == VALIDCELL && b.seek(tab[i]) == 0)
- return 0;
- for (int i = 0; i < b.size; ++i)
- if (b.status[i] == VALIDCELL && seek(b.tab[i]) == 0)
- return 0;
- return 1;
- }
-}
-
-int <T>VOHSet:: operator != (<T>VOHSet& b)
-{
- return !(*this == b);
-}
-
-int <T>VOHSet::operator <= (<T>VOHSet& b)
-{
- if (count > b.count)
- return 0;
- else
- {
- for (int i = 0; i < size; ++i)
- if (status[i] == VALIDCELL && b.seek(tab[i]) == 0)
- return 0;
- return 1;
- }
-}
-
-void <T>VOHSet::operator |= (<T>VOHSet& b)
-{
- if (&b == this || b.count == 0)
- return;
- for (int i = 0; i < b.size; ++i)
- if (b.status[i] == VALIDCELL) add(b.tab[i]);
-}
-
-void <T>VOHSet::operator &= (<T>VOHSet& b)
-{
- if (&b == this || count == 0)
- return;
- for (int i = 0; i < size; ++i)
- {
- if (status[i] == VALIDCELL && b.seek(tab[i]) == 0)
- {
- status[i] = DELETEDCELL;
- --count;
- }
- }
-}
-
-void <T>VOHSet::operator -= (<T>VOHSet& b)
-{
- for (int i = 0; i < size; ++i)
- {
- if (status[i] == VALIDCELL && b.seek(tab[i]) != 0)
- {
- status[i] = DELETEDCELL;
- --count;
- }
- }
-}
-
-int <T>VOHSet::OK()
-{
- int v = tab != 0;
- v &= status != 0;
- int n = 0;
- for (int i = 0; i < size; ++i)
- {
- if (status[i] == VALIDCELL) ++n;
- else if (status[i] != DELETEDCELL && status[i] != EMPTYCELL)
- v = 0;
- }
- v &= n == count;
- if (!v) error("invariant failure");
- return v;
-}
diff --git a/contrib/libg++/libg++/src/gen/VOHSet.hP b/contrib/libg++/libg++/src/gen/VOHSet.hP
deleted file mode 100644
index a3ff2c814824..000000000000
--- a/contrib/libg++/libg++/src/gen/VOHSet.hP
+++ /dev/null
@@ -1,88 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
- based on code by Doug Schmidt
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-
-#ifndef _<T>VOHSet_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _<T>VOHSet_h 1
-
-#include "<T>.Set.h"
-
-
-
-class <T>VOHSet : public <T>Set
-{
- <T>* tab;
- char* status;
- int size;
- int cnt; // keeps track of VALIDCELLs and DELETEDCELLs
-
-public:
- <T>VOHSet(int sz = DEFAULT_INITIAL_CAPACITY);
- <T>VOHSet(<T>VOHSet&);
- inline ~<T>VOHSet();
-
- Pix add(<T&> item);
- void del(<T&> item);
- inline int contains(<T&> item);
-
- void clear();
-
- Pix first();
- void next(Pix& i);
- inline <T>& operator () (Pix i);
- Pix seek(<T&> item);
-
- void operator |= (<T>VOHSet& b);
- void operator -= (<T>VOHSet& b);
- void operator &= (<T>VOHSet& b);
-
- int operator == (<T>VOHSet& b);
- int operator != (<T>VOHSet& b);
- int operator <= (<T>VOHSet& b);
-
- int capacity();
- void resize(int newsize = 0);
-
- int OK();
-};
-
-
-inline <T>VOHSet::~<T>VOHSet()
-{
- delete [] tab;
- delete status;
-}
-
-
-inline int <T>VOHSet::contains(<T&> key)
-{
- return seek(key) != 0;
-}
-
-
-inline <T>& <T>VOHSet::operator () (Pix p)
-{
- if (p == 0) error("null Pix");
- return *((<T>*)p);
-}
-
-#endif
diff --git a/contrib/libg++/libg++/src/gen/VQueue.ccP b/contrib/libg++/libg++/src/gen/VQueue.ccP
deleted file mode 100644
index 8eca22d17142..000000000000
--- a/contrib/libg++/libg++/src/gen/VQueue.ccP
+++ /dev/null
@@ -1,83 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <stream.h>
-#include "<T>.VQueue.h"
-
-<T>VQueue::<T>VQueue(<T>VQueue& b)
-:size(b.size), cnt(b.cnt), inp(b.inp), outp(b.outp), s(new <T> [b.size])
-{
- int j = outp;
- for (int i = 0; i < cnt; ++i)
- {
- s[j] = b.s[j];
- if (++j == size) j = 0;
- }
-}
-
-void <T>VQueue::operator = (<T>VQueue& b)
-{
- if (&b == this) return;
- if (size != b.size)
- {
- delete [] s;
- s = new <T> [b.size];
- size = b.size;
- }
- inp = b.inp; outp = b.outp; cnt = b.cnt;
- int j = outp;
- for (int i = 0; i < cnt; ++i)
- {
- s[j] = b.s[j];
- if (++j == size) j = 0;
- }
-}
-
-
-void <T>VQueue::resize(int newsz)
-{
- if (newsz < cnt)
- error("resize: new size too small");
- <T>* news = new <T> [newsz];
- int j = outp;
- for (int i = 0; i < cnt; ++i)
- {
- news[i] = s[j];
- if (++j == size) j = 0;
- }
- inp = cnt;
- outp = 0;
- delete [] s;
- s = news;
- size = newsz;
-}
-
-int <T>VQueue::OK()
-{
- int v = s != 0; // have space
- v &= size >= 0; // a legal size
- v &= inp >= 0 && inp <= size; // pointers with bounds
- v &= outp >= 0 && outp <= size;
- int c = (size + inp - outp) % size;
- v &= cnt == size || cnt == c; // correct count
- if (!v) error("invariant failure");
- return v;
-}
diff --git a/contrib/libg++/libg++/src/gen/VQueue.hP b/contrib/libg++/libg++/src/gen/VQueue.hP
deleted file mode 100644
index 287a78187a13..000000000000
--- a/contrib/libg++/libg++/src/gen/VQueue.hP
+++ /dev/null
@@ -1,130 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-
-#ifndef _<T>VQueue_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _<T>VQueue_h 1
-
-#include "<T>.Queue.h"
-
-class <T>VQueue : public <T>Queue
-{
-protected:
- int size;
- int cnt;
- int inp;
- int outp;
- <T>* s;
-
-public:
-
- <T>VQueue(int sz = DEFAULT_INITIAL_CAPACITY);
- <T>VQueue(<T>VQueue&);
- inline ~<T>VQueue();
-
- void operator = (<T>VQueue&);
-
- inline void enq(<T&> item);
- inline <T> deq();
- inline <T>& front();
- inline void del_front();
-
- inline int length();
- inline int empty();
- inline int full();
-
- int capacity();
- void resize(int sz);
- inline void clear();
-
- int OK();
-};
-
-
-inline <T>VQueue::<T>VQueue(int sz)
-{
- s = new <T> [size = sz];
- cnt = inp = outp = 0;
-}
-
-inline <T>VQueue::~<T>VQueue()
-{
- delete [] s;
-}
-
-inline void <T>VQueue::clear()
-{
- inp = outp = 0;
- cnt = 0;
-}
-
-inline int <T>VQueue::empty()
-{
- return cnt <= 0;
-}
-
-inline int <T>VQueue::capacity()
-{
- return size;
-}
-
-inline int <T>VQueue::full()
-{
- return cnt >= size;
-}
-
-inline int <T>VQueue::length()
-{
- return cnt;
-}
-
-inline void <T>VQueue::enq(<T&> item)
-{
- if (cnt >= size) error("enq to full Queue.");
- ++cnt;
- s[inp] = item;
- if (++inp == size) inp = 0;
-}
-
-inline <T> <T>VQueue::deq()
-{
- if (cnt <= 0) error("deq from empty Queue.");
- --cnt;
- int i = outp;
- if (++outp == size) outp = 0;
- return s[i];
-}
-
-
-inline void <T>VQueue::del_front()
-{
- if (cnt <= 0) error("delete from empty Queue.");
- --cnt;
- if (++outp == size) outp = 0;
-}
-
-inline <T>& <T>VQueue::front()
-{
- if (empty()) error("top from empty Queue.");
- return s[outp];
-}
-
-#endif
diff --git a/contrib/libg++/libg++/src/gen/VStack.ccP b/contrib/libg++/libg++/src/gen/VStack.ccP
deleted file mode 100644
index a5e8292fabfa..000000000000
--- a/contrib/libg++/libg++/src/gen/VStack.ccP
+++ /dev/null
@@ -1,66 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <stream.h>
-#include "<T>.VStack.h"
-
-// error handling
-
-
-<T>VStack::<T>VStack(<T>VStack& b)
-:size(b.size), ptr(b.ptr), s(new <T> [b.size])
-{
- for (int i = 0; i < ptr; ++i) s[i] = b.s[i];
-}
-
-void <T>VStack::operator = (<T>VStack& b)
-{
- if (&b == this) return;
- if (size < b.ptr)
- {
- delete [] s;
- s = new <T> [b.size];
- size = b.size;
- }
- ptr = b.ptr;
- for (int i = 0; i < ptr; ++i) s[i] = b.s[i];
-}
-
-
-void <T>VStack::resize(int newsz)
-{
- if (newsz < ptr) error("resize: new size too small");
- <T>* news = new <T> [newsz];
- for (int i = 0; i < ptr; ++i) news[i] = s[i];
- delete [] s;
- s = news;
- size = newsz;
-}
-
-int <T>VStack::OK()
-{
- int v = s != 0; // have space
- v &= size >= 0; // a legal size
- v &= ptr <= size; // ptr within bounds
- v &= ptr >= 0;
- if (!v) error("invariant failure");
- return v;
-}
diff --git a/contrib/libg++/libg++/src/gen/VStack.hP b/contrib/libg++/libg++/src/gen/VStack.hP
deleted file mode 100644
index c7f7631a4cc9..000000000000
--- a/contrib/libg++/libg++/src/gen/VStack.hP
+++ /dev/null
@@ -1,120 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-
-#ifndef _<T>VStack_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _<T>VStack_h 1
-
-#include "<T>.Stack.h"
-
-class <T>VStack : public <T>Stack
-{
-protected:
- int size;
- int ptr;
- <T>* s;
-
-public:
-
- <T>VStack(int sz = DEFAULT_INITIAL_CAPACITY);
- <T>VStack(<T>VStack&);
- inline ~<T>VStack();
-
- void operator = (<T>VStack&);
- inline void push(<T&> item);
- inline <T> pop();
- inline <T>& top();
- inline void del_top();
-
- inline int length();
- inline int empty();
- inline int full();
- inline void clear();
-
- void resize(int sz);
- int capacity();
-
- int OK();
-};
-
-
-inline <T>VStack::<T>VStack(int sz)
-{
- s = new <T> [size = sz];
- ptr = 0;
-}
-
-inline <T>VStack::~<T>VStack()
-{
- delete [] s;
-}
-
-inline void <T>VStack::clear()
-{
- ptr = 0;
-}
-
-inline int <T>VStack::capacity()
-{
- return size;
-}
-
-inline int <T>VStack::empty()
-{
- return ptr == 0;
-}
-
-inline int <T>VStack::full()
-{
- return ptr == size;
-}
-
-inline int <T>VStack::length()
-{
- return ptr;
-}
-
-inline void <T>VStack::push(<T&> item)
-{
- if (full()) error("push to full stack.");
- s[ptr++] = item;
-}
-
-inline <T> <T>VStack::pop()
-{
- if (empty()) error("pop from empty stack.");
- return s[--ptr];
-}
-
-
-inline void <T>VStack::del_top()
-{
- if (empty()) error("del_top from empty stack.");
- --ptr;
-}
-
-inline <T>& <T>VStack::top()
-{
- if (empty()) error("top from empty stack.");
- return s[ptr-1];
-}
-
-#endif
diff --git a/contrib/libg++/libg++/src/gen/Vec.ccP b/contrib/libg++/libg++/src/gen/Vec.ccP
deleted file mode 100644
index d03e0bba4c4b..000000000000
--- a/contrib/libg++/libg++/src/gen/Vec.ccP
+++ /dev/null
@@ -1,478 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <stream.h>
-#include <builtin.h>
-#include "<T>.Vec.h"
-
-// error handling
-
-
-void default_<T>Vec_error_handler(const char* msg)
-{
- cerr << "Fatal <T>Vec error. " << msg << "\n";
- exit(1);
-}
-
-one_arg_error_handler_t <T>Vec_error_handler = default_<T>Vec_error_handler;
-
-one_arg_error_handler_t set_<T>Vec_error_handler(one_arg_error_handler_t f)
-{
- one_arg_error_handler_t old = <T>Vec_error_handler;
- <T>Vec_error_handler = f;
- return old;
-}
-
-void <T>Vec::error(const char* msg)
-{
- (*<T>Vec_error_handler)(msg);
-}
-
-void <T>Vec::range_error()
-{
- (*<T>Vec_error_handler)("Index out of range.");
-}
-
-<T>Vec::<T>Vec(const <T>Vec& v)
-{
- s = new <T> [len = v.len];
- <T>* top = &(s[len]);
- <T>* t = s;
- const <T>* u = v.s;
- while (t < top) *t++ = *u++;
-}
-
-<T>Vec::<T>Vec(int l, <T&> fill_value)
-{
- s = new <T> [len = l];
- <T>* top = &(s[len]);
- <T>* t = s;
- while (t < top) *t++ = fill_value;
-}
-
-
-<T>Vec& <T>Vec::operator = (const <T>Vec& v)
-{
- if (this != &v)
- {
- delete [] s;
- s = new <T> [len = v.len];
- <T>* top = &(s[len]);
- <T>* t = s;
- const <T>* u = v.s;
- while (t < top) *t++ = *u++;
- }
- return *this;
-}
-
-void <T>Vec::apply(<T>Procedure f)
-{
- <T>* top = &(s[len]);
- <T>* t = s;
- while (t < top) (*f)(*t++);
-}
-
-// can't just realloc since there may be need for constructors/destructors
-void <T>Vec::resize(int newl)
-{
- <T>* news = new <T> [newl];
- <T>* p = news;
- int minl = (len < newl)? len : newl;
- <T>* top = &(s[minl]);
- <T>* t = s;
- while (t < top) *p++ = *t++;
- delete [] s;
- s = news;
- len = newl;
-}
-
-<T>Vec concat(<T>Vec & a, <T>Vec & b)
-{
- int newl = a.len + b.len;
- <T>* news = new <T> [newl];
- <T>* p = news;
- <T>* top = &(a.s[a.len]);
- <T>* t = a.s;
- while (t < top) *p++ = *t++;
- top = &(b.s[b.len]);
- t = b.s;
- while (t < top) *p++ = *t++;
- return <T>Vec(newl, news);
-}
-
-
-<T>Vec combine(<T>Combiner f, <T>Vec& a, <T>Vec& b)
-{
- int newl = (a.len < b.len)? a.len : b.len;
- <T>* news = new <T> [newl];
- <T>* p = news;
- <T>* top = &(a.s[newl]);
- <T>* t = a.s;
- <T>* u = b.s;
- while (t < top) *p++ = (*f)(*t++, *u++);
- return <T>Vec(newl, news);
-}
-
-<T> <T>Vec::reduce(<T>Combiner f, <T&> base)
-{
- <T> r = base;
- <T>* top = &(s[len]);
- <T>* t = s;
- while (t < top) r = (*f)(r, *t++);
- return r;
-}
-
-<T>Vec reverse(<T>Vec& a)
-{
- <T>* news = new <T> [a.len];
- if (a.len != 0)
- {
- <T>* lo = news;
- <T>* hi = &(news[a.len - 1]);
- while (lo < hi)
- {
- <T> tmp = *lo;
- *lo++ = *hi;
- *hi-- = tmp;
- }
- }
- return <T>Vec(a.len, news);
-}
-
-void <T>Vec::reverse()
-{
- if (len != 0)
- {
- <T>* lo = s;
- <T>* hi = &(s[len - 1]);
- while (lo < hi)
- {
- <T> tmp = *lo;
- *lo++ = *hi;
- *hi-- = tmp;
- }
- }
-}
-
-int <T>Vec::index(<T&> targ)
-{
- for (int i = 0; i < len; ++i) if (<T>EQ(targ, s[i])) return i;
- return -1;
-}
-
-<T>Vec map(<T>Mapper f, <T>Vec& a)
-{
- <T>* news = new <T> [a.len];
- <T>* p = news;
- <T>* top = &(a.s[a.len]);
- <T>* t = a.s;
- while(t < top) *p++ = (*f)(*t++);
- return <T>Vec(a.len, news);
-}
-
-int operator == (<T>Vec& a, <T>Vec& b)
-{
- if (a.len != b.len)
- return 0;
- <T>* top = &(a.s[a.len]);
- <T>* t = a.s;
- <T>* u = b.s;
- while (t < top) if (!(<T>EQ(*t++, *u++))) return 0;
- return 1;
-}
-
-void <T>Vec::fill(<T&> val, int from, int n)
-{
- int to;
- if (n < 0)
- to = len - 1;
- else
- to = from + n - 1;
- if ((unsigned)from > (unsigned)to)
- range_error();
- <T>* t = &(s[from]);
- <T>* top = &(s[to]);
- while (t <= top) *t++ = val;
-}
-
-<T>Vec <T>Vec::at(int from, int n)
-{
- int to;
- if (n < 0)
- {
- n = len - from;
- to = len - 1;
- }
- else
- to = from + n - 1;
- if ((unsigned)from > (unsigned)to)
- range_error();
- <T>* news = new <T> [n];
- <T>* p = news;
- <T>* t = &(s[from]);
- <T>* top = &(s[to]);
- while (t <= top) *p++ = *t++;
- return <T>Vec(n, news);
-}
-
-<T>Vec merge(<T>Vec & a, <T>Vec & b, <T>Comparator f)
-{
- int newl = a.len + b.len;
- <T>* news = new <T> [newl];
- <T>* p = news;
- <T>* topa = &(a.s[a.len]);
- <T>* as = a.s;
- <T>* topb = &(b.s[b.len]);
- <T>* bs = b.s;
-
- for (;;)
- {
- if (as >= topa)
- {
- while (bs < topb) *p++ = *bs++;
- break;
- }
- else if (bs >= topb)
- {
- while (as < topa) *p++ = *as++;
- break;
- }
- else if ((*f)(*as, *bs) <= 0)
- *p++ = *as++;
- else
- *p++ = *bs++;
- }
- return <T>Vec(newl, news);
-}
-
-static int gsort(<T>*, int, <T>Comparator);
-
-void <T>Vec::sort (<T>Comparator compar)
-{
- gsort(s, len, compar);
-}
-
-
-// An adaptation of Schmidt's new quicksort
-
-static inline void SWAP(<T>* A, <T>* B)
-{
- <T> tmp = *A; *A = *B; *B = tmp;
-}
-
-/* This should be replaced by a standard ANSI macro. */
-#define BYTES_PER_WORD 8
-#define BYTES_PER_LONG 4
-
-/* The next 4 #defines implement a very fast in-line stack abstraction. */
-
-#define STACK_SIZE (BYTES_PER_WORD * BYTES_PER_LONG)
-#define PUSH(LOW,HIGH) do {top->lo = LOW;top++->hi = HIGH;} while (0)
-#define POP(LOW,HIGH) do {LOW = (--top)->lo;HIGH = top->hi;} while (0)
-#define STACK_NOT_EMPTY (stack < top)
-
-/* Discontinue quicksort algorithm when partition gets below this size.
- This particular magic number was chosen to work best on a Sun 4/260. */
-#define MAX_THRESH 4
-
-
-/* Order size using quicksort. This implementation incorporates
- four optimizations discussed in Sedgewick:
-
- 1. Non-recursive, using an explicit stack of pointer that
- store the next array partition to sort. To save time, this
- maximum amount of space required to store an array of
- MAX_INT is allocated on the stack. Assuming a 32-bit integer,
- this needs only 32 * sizeof (stack_node) == 136 bits. Pretty
- cheap, actually.
-
- 2. Chose the pivot element using a median-of-three decision tree.
- This reduces the probability of selecting a bad pivot value and
- eliminates certain extraneous comparisons.
-
- 3. Only quicksorts TOTAL_ELEMS / MAX_THRESH partitions, leaving
- insertion sort to order the MAX_THRESH items within each partition.
- This is a big win, since insertion sort is faster for small, mostly
- sorted array segements.
-
- 4. The larger of the two sub-partitions is always pushed onto the
- stack first, with the algorithm then concentrating on the
- smaller partition. This *guarantees* no more than log (n)
- stack size is needed! */
-
-static int gsort (<T> *base_ptr, int total_elems, <T>Comparator cmp)
-{
-/* Stack node declarations used to store unfulfilled partition obligations. */
- struct stack_node { <T> *lo; <T> *hi; };
- <T> pivot_buffer;
- int max_thresh = MAX_THRESH;
-
- if (total_elems > MAX_THRESH)
- {
- <T> *lo = base_ptr;
- <T> *hi = lo + (total_elems - 1);
- <T> *left_ptr;
- <T> *right_ptr;
- stack_node stack[STACK_SIZE]; /* Largest size needed for 32-bit int!!! */
- stack_node *top = stack;
-
- for (;;)
- {
- {
- <T> *pivot = &pivot_buffer;
- {
- /* Select median value from among LO, MID, and HI. Rearrange
- LO and HI so the three values are sorted. This lowers the
- probability of picking a pathological pivot value and
- skips a comparison for both the LEFT_PTR and RIGHT_PTR. */
-
- <T> *mid = lo + ((hi - lo) >> 1);
-
- if ((*cmp) (*mid, *lo) < 0)
- SWAP (mid, lo);
- if ((*cmp) (*hi, *mid) < 0)
- {
- SWAP (mid, hi);
- if ((*cmp) (*mid, *lo) < 0)
- SWAP (mid, lo);
- }
- *pivot = *mid;
- pivot = &pivot_buffer;
- }
- left_ptr = lo + 1;
- right_ptr = hi - 1;
-
- /* Here's the famous ``collapse the walls'' section of quicksort.
- Gotta like those tight inner loops! They are the main reason
- that this algorithm runs much faster than others.
-
- [Yeah, but there is a function call in the inner loop,
- which makes the speed claim rather dubious. --Per Bothner] */
- do
- {
- while ((*cmp) (*left_ptr, *pivot) < 0)
- left_ptr += 1;
-
- while ((*cmp) (*pivot, *right_ptr) < 0)
- right_ptr -= 1;
-
- if (left_ptr < right_ptr)
- {
- SWAP (left_ptr, right_ptr);
- left_ptr += 1;
- right_ptr -= 1;
- }
- else if (left_ptr == right_ptr)
- {
- left_ptr += 1;
- right_ptr -= 1;
- break;
- }
- }
- while (left_ptr <= right_ptr);
-
- }
-
- /* Set up pointers for next iteration. First determine whether
- left and right partitions are below the threshold size. If so,
- ignore one or both. Otherwise, push the larger partition's
- bounds on the stack and continue sorting the smaller one. */
-
- if ((right_ptr - lo) <= max_thresh)
- {
- if ((hi - left_ptr) <= max_thresh)
- { /* Ignore both small partitions. */
- if (STACK_NOT_EMPTY)
- POP (lo, hi);
- else
- break; /* No pending partitions - we're done. */
- }
- else /* Ignore small left partition. */
- lo = left_ptr;
- }
- else if ((hi - left_ptr) <= max_thresh) /* Ignore small right partition. */
- hi = right_ptr;
- else if ((right_ptr - lo) > (hi - left_ptr)) /* Push larger left partition indices. */
- {
- PUSH (lo, right_ptr);
- lo = left_ptr;
- }
- else /* Push larger right partition indices. */
- {
- PUSH (left_ptr, hi);
- hi = right_ptr;
- }
- }
- }
-
- /* Once the BASE_PTR array is partially sorted by quicksort the rest
- is completely sorted using insertion sort, since this is efficient
- for partitions below MAX_THRESH size. BASE_PTR points to the beginning
- of the array to sort, and END_PTR points at the very last element in
- the array (*not* one beyond it!). */
-
-
- {
- <T> *end_ptr = base_ptr + 1 * (total_elems - 1);
- <T> *run_ptr;
- <T> *tmp_ptr = base_ptr;
- <T> *thresh = (end_ptr < (base_ptr + max_thresh))?
- end_ptr : (base_ptr + max_thresh);
-
- /* Find smallest element in first threshold and place it at the
- array's beginning. This is the smallest array element,
- and the operation speeds up insertion sort's inner loop. */
-
- for (run_ptr = tmp_ptr + 1; run_ptr <= thresh; run_ptr += 1)
- if ((*cmp) (*run_ptr, *tmp_ptr) < 0)
- tmp_ptr = run_ptr;
-
- if (tmp_ptr != base_ptr)
- SWAP (tmp_ptr, base_ptr);
-
- /* Insertion sort, running from left-hand-side up to `right-hand-side.'
- Pretty much straight out of the original GNU qsort routine. */
-
- for (run_ptr = base_ptr + 1; (tmp_ptr = run_ptr += 1) <= end_ptr; )
- {
-
- while ((*cmp) (*run_ptr, *(tmp_ptr -= 1)) < 0)
- ;
-
- if ((tmp_ptr += 1) != run_ptr)
- {
- <T> *trav;
-
- for (trav = run_ptr + 1; --trav >= run_ptr;)
- {
- <T> c = *trav;
- <T> *hi, *lo;
-
- for (hi = lo = trav; (lo -= 1) >= tmp_ptr; hi = lo)
- *hi = *lo;
- *hi = c;
- }
- }
-
- }
- }
- return 1;
-}
diff --git a/contrib/libg++/libg++/src/gen/Vec.hP b/contrib/libg++/libg++/src/gen/Vec.hP
deleted file mode 100644
index 91993d1c4f13..000000000000
--- a/contrib/libg++/libg++/src/gen/Vec.hP
+++ /dev/null
@@ -1,135 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-
-#ifndef _<T>Vec_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _<T>Vec_h 1
-
-#include <builtin.h>
-#include "<T>.defs.h"
-
-#ifndef _<T>_typedefs
-#define _<T>_typedefs 1
-typedef void (*<T>Procedure)(<T&>);
-typedef <T> (*<T>Mapper)(<T&>);
-typedef <T> (*<T>Combiner)(<T&>, <T&>);
-typedef int (*<T>Predicate)(<T&>);
-typedef int (*<T>Comparator)(<T&>, <T&>);
-#endif
-
-
-class <T>Vec
-{
-protected:
- int len;
- <T> *s;
-
- <T>Vec(int l, <T>* d);
-public:
- <T>Vec ();
- <T>Vec (int l);
- <T>Vec (int l, <T&> fill_value);
- <T>Vec (const <T>Vec&);
- ~<T>Vec ();
-
- <T>Vec & operator = (const <T>Vec & a);
- <T>Vec at(int from = 0, int n = -1);
-
- int capacity() const;
- void resize(int newlen);
-
- <T>& operator [] (int n);
- <T>& elem(int n);
-
- friend <T>Vec concat(<T>Vec & a, <T>Vec & b);
- friend <T>Vec map(<T>Mapper f, <T>Vec & a);
- friend <T>Vec merge(<T>Vec & a, <T>Vec & b, <T>Comparator f);
- friend <T>Vec combine(<T>Combiner f, <T>Vec & a, <T>Vec & b);
- friend <T>Vec reverse(<T>Vec & a);
-
- void reverse();
- void sort(<T>Comparator f);
- void fill(<T&> val, int from = 0, int n = -1);
-
- void apply(<T>Procedure f);
- <T> reduce(<T>Combiner f, <T&> base);
- int index(<T&> targ);
-
- friend int operator == (<T>Vec& a, <T>Vec& b);
- friend int operator != (<T>Vec& a, <T>Vec& b);
-
- void error(const char* msg);
- void range_error();
-};
-
-extern void default_<T>Vec_error_handler(const char*);
-extern one_arg_error_handler_t <T>Vec_error_handler;
-
-extern one_arg_error_handler_t
- set_<T>Vec_error_handler(one_arg_error_handler_t f);
-
-
-inline <T>Vec::<T>Vec()
-{
- len = 0; s = 0;
-}
-
-inline <T>Vec::<T>Vec(int l)
-{
- s = new <T> [len = l];
-}
-
-
-inline <T>Vec::<T>Vec(int l, <T>* d) :len(l), s(d) {}
-
-
-inline <T>Vec::~<T>Vec()
-{
- delete [] s;
-}
-
-
-inline <T>& <T>Vec::operator [] (int n)
-{
- if ((unsigned)n >= (unsigned)len)
- range_error();
- return s[n];
-}
-
-inline <T>& <T>Vec::elem(int n)
-{
- return s[n];
-}
-
-
-inline int <T>Vec::capacity() const
-{
- return len;
-}
-
-
-
-inline int operator != (<T>Vec& a, <T>Vec& b)
-{
- return !(a == b);
-}
-
-#endif
diff --git a/contrib/libg++/libg++/src/gen/XPBag.ccP b/contrib/libg++/libg++/src/gen/XPBag.ccP
deleted file mode 100644
index e2a7834077bc..000000000000
--- a/contrib/libg++/libg++/src/gen/XPBag.ccP
+++ /dev/null
@@ -1,72 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include "<T>.XPBag.h"
-
-int <T>XPBag::OK()
-{
- int v = p.OK();
- v &= count == p.length();
- if (!v) error("invariant failure");
- return v;
-}
-
-Pix <T>XPBag::seek(<T&> item, Pix i)
-{
- if (i == 0) i = p.first(); else next(i);
- for (; i != 0; p.next(i)) if (<T>EQ(p(i), item)) return i;
- return 0;
-}
-
-int <T>XPBag::nof(<T&> item)
-{
- int n = 0;
- for (int i = p.low(); i < p.fence(); p.next(i)) if (<T>EQ(p[i], item)) ++n;
- return n;
-}
-
-void <T>XPBag::del(<T&> item)
-{
- for (int i = p.low(); i < p.fence(); p.next(i))
- {
- if (<T>EQ(p[i], item))
- {
- --count;
- p[i] = p.low_element();
- p.del_low();
- return;
- }
- }
-}
-
-void <T>XPBag::remove(<T&> item)
-{
- for (int i = p.low(); i < p.fence(); p.next(i))
- {
- if (<T>EQ(p[i], item))
- {
- --count;
- p[i] = p.low_element();
- p.del_low();
- }
- }
-}
-
diff --git a/contrib/libg++/libg++/src/gen/XPBag.hP b/contrib/libg++/libg++/src/gen/XPBag.hP
deleted file mode 100644
index da8c199e2125..000000000000
--- a/contrib/libg++/libg++/src/gen/XPBag.hP
+++ /dev/null
@@ -1,98 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-
-#ifndef _<T>XPBag_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _<T>XPBag_h 1
-
-#include "<T>.Bag.h"
-#include "<T>.XPlex.h"
-
-class <T>XPBag : public <T>Bag
-{
-protected:
- <T>XPlex p;
-
-public:
- <T>XPBag(int chunksize = DEFAULT_INITIAL_CAPACITY);
- <T>XPBag(const <T>XPBag&);
-
- inline Pix add(<T&> item);
- void del(<T&> item);
-#undef remove
- void remove(<T&>item);
- int nof(<T&> item);
- inline int contains(<T&> item);
-
- inline void clear();
-
- inline Pix first();
- inline void next(Pix& i);
- inline <T>& operator () (Pix i);
- inline int owns(Pix i);
- Pix seek(<T&> item, Pix from = 0);
-
- int OK();
-};
-
-
-inline <T>XPBag::<T>XPBag(int chunksize)
- : p(chunksize) { count = 0; }
-
-inline <T>XPBag::<T>XPBag(const <T>XPBag& s) : p(s.p) { count = s.count; }
-
-inline Pix <T>XPBag::first()
-{
- return p.first();
-}
-
-inline void <T>XPBag::next(Pix & idx)
-{
- p.next(idx);
-}
-
-inline <T>& <T>XPBag::operator ()(Pix idx)
-{
- return p(idx);
-}
-
-inline void <T>XPBag::clear()
-{
- count = 0; p.clear();
-}
-
-inline int <T>XPBag::owns (Pix idx)
-{
- return p.owns(idx);
-}
-
-inline Pix <T>XPBag::add(<T&> item)
-{
- ++count;
- return p.index_to_Pix(p.add_high(item));
-}
-
-inline int <T>XPBag::contains(<T&> item)
-{
- return seek(item) != 0;
-}
-
-#endif
diff --git a/contrib/libg++/libg++/src/gen/XPDeque.ccP b/contrib/libg++/libg++/src/gen/XPDeque.ccP
deleted file mode 100644
index 6b363d9bdc4e..000000000000
--- a/contrib/libg++/libg++/src/gen/XPDeque.ccP
+++ /dev/null
@@ -1,4 +0,0 @@
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include "<T>.XPDeque.h"
diff --git a/contrib/libg++/libg++/src/gen/XPDeque.hP b/contrib/libg++/libg++/src/gen/XPDeque.hP
deleted file mode 100644
index a73d8fdada8c..000000000000
--- a/contrib/libg++/libg++/src/gen/XPDeque.hP
+++ /dev/null
@@ -1,133 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
- based on code by Marc Shapiro (shapiro@sor.inria.fr)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-
-#ifndef _<T>XPDeque_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _<T>XPDeque_h
-
-#include "<T>.XPlex.h"
-#include "<T>.Deque.h"
-
-class <T>XPDeque : public <T>Deque
-{
- <T>XPlex p;
-
-public:
- <T>XPDeque(int chunksize = DEFAULT_INITIAL_CAPACITY);
- <T>XPDeque(const <T>XPDeque& d);
- inline ~<T>XPDeque();
-
- void operator = (const <T>XPDeque&);
-
- inline void push(<T&> item); // insert at front
- inline void enq(<T&> item); // insert at rear
-
- inline <T>& front();
- inline <T>& rear();
-
- inline <T> deq();
- inline void del_front();
- inline void del_rear();
-
- inline void clear();
- inline int empty();
- inline int full();
- inline int length();
-
- inline int OK();
-};
-
-inline <T>XPDeque::<T>XPDeque(int chunksize)
- : p(chunksize) {}
-inline <T>XPDeque::<T>XPDeque(const <T>XPDeque& d) : p(d.p) {}
-
-inline <T>XPDeque::~<T>XPDeque() {}
-
-inline void <T>XPDeque::push(<T&>item)
-{
- p.add_low(item);
-}
-
-inline void <T>XPDeque::enq(<T&>item)
-{
- p.add_high(item);
-}
-
-inline <T> <T>XPDeque::deq()
-{
- <T> res = p.low_element();
- p.del_low();
- return res;
-}
-
-inline <T>& <T>XPDeque::front()
-{
- return p.low_element();
-}
-
-inline <T>& <T>XPDeque::rear()
-{
- return p.high_element();
-}
-
-inline void <T>XPDeque::del_front()
-{
- p.del_low();
-}
-
-inline void <T>XPDeque::del_rear()
-{
- p.del_high();
-}
-
-inline void <T>XPDeque::operator =(const <T>XPDeque& s)
-{
- p.operator = (s.p);
-}
-
-
-inline int <T>XPDeque::empty()
-{
- return p.empty();
-}
-
-inline int <T>XPDeque::full()
-{
- return p.full();
-}
-
-inline int <T>XPDeque::length()
-{
- return p.length();
-}
-
-inline int <T>XPDeque::OK()
-{
- return p.OK();
-}
-
-inline void <T>XPDeque::clear()
-{
- p.clear();
-}
-
-#endif
diff --git a/contrib/libg++/libg++/src/gen/XPPQ.ccP b/contrib/libg++/libg++/src/gen/XPPQ.ccP
deleted file mode 100644
index 4d7a8644b126..000000000000
--- a/contrib/libg++/libg++/src/gen/XPPQ.ccP
+++ /dev/null
@@ -1,143 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include "<T>.XPPQ.h"
-
-int <T>XPPQ::OK()
-{
- int v = p.OK();
- v &= p.low() == 1;
- v &= count == p.length();
- if (!v) error("invariant failure");
- return v;
-}
-
-Pix <T>XPPQ::seek(<T&> item)
-{
- for (int i = p.low(); i < p.fence(); p.next(i))
- if (<T>EQ(p[i],item)) return p.index_to_Pix(i);
- return 0;
-}
-
-// standard 2-ary heap ops
-// pointers are used a lot to avoid thrashing across chunks with plexes
-
-Pix <T>XPPQ::enq(<T&> item)
-{
- p.add_high(item);
- <T>* pk = &(p.high_element());
- int par = ++count >> 1;
- while (par != 0)
- {
- <T>* ppar = &(p[par]);
- if (!(<T>LE(*ppar, item)))
- {
- *pk = *ppar;
- pk = ppar;
- par >>= 1;
- }
- else
- break;
- }
- *pk = item;
- return Pix(pk);
-}
-
-void <T>XPPQ::del_front()
-{
- if (count == 0) error("empty PQ");
- --count;
- <T>* pk = &(p.low_element());
- <T>* ph = &(p.high_element());
- int child = 2;
- while (child <= count)
- {
- <T>* pchild = &(p[child]);
- if (child < count)
- {
- <T>* prchild = &(p[child+1]);
- if (!(<T>LE(*pchild, *prchild)))
- {
- pchild = prchild;
- ++child;
- }
- }
- if (!(<T>LE(*ph, *pchild)))
- {
- *pk = *pchild;
- pk = pchild;
- child <<= 1;
- }
- else
- break;
- }
- *pk = *ph;
- p.del_high();
-}
-
-
-void <T>XPPQ::del(Pix i)
-{
- if (i == 0) error("null Pix");
- --count;
- int k = p.Pix_to_index(i);
- <T>* pk = &(p[k]);
- <T>* ph = &(p.high_element());
- int child = k << 1;
- while (child <= count)
- {
- <T>* pchild = &(p[child]);
- if (child < count)
- {
- <T>* prchild = &(p[child+1]);
- if (!(<T>LE(*pchild, *prchild)))
- {
- pchild = prchild;
- ++child;
- }
- }
- if (!(<T>LE(*ph, *pchild)))
- {
- *pk = *pchild;
- pk = pchild;
- child <<= 1;
- }
- else
- break;
- }
- int par = child >> 2;
- while (par != 0)
- {
- <T>* ppar = &(p[par]);
- if (!(<T>LE(*ppar, *ph)))
- {
- *pk = *ppar;
- pk = ppar;
- par >>= 1;
- }
- else
- break;
- }
- *pk = *ph;
- p.del_high();
-}
-
-
diff --git a/contrib/libg++/libg++/src/gen/XPPQ.hP b/contrib/libg++/libg++/src/gen/XPPQ.hP
deleted file mode 100644
index 472670009d72..000000000000
--- a/contrib/libg++/libg++/src/gen/XPPQ.hP
+++ /dev/null
@@ -1,105 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-
-#ifndef _<T>XPPQ_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _<T>XPPQ_h 1
-
-#include "<T>.PQ.h"
-#include "<T>.XPlex.h"
-
-class <T>XPPQ : public <T>PQ
-{
-protected:
- <T>XPlex p;
-
-public:
- <T>XPPQ(int chunksize = DEFAULT_INITIAL_CAPACITY);
- <T>XPPQ(const <T>XPPQ&);
-
- Pix enq(<T&> item);
- inline <T> deq();
-
- inline <T>& front();
- void del_front();
-
- inline int contains(<T&> item);
-
- inline void clear();
-
- inline Pix first();
- inline void next(Pix& i);
- inline <T>& operator () (Pix i);
- void del(Pix i);
- inline int owns(Pix i);
- Pix seek(<T&> item);
-
- int OK(); // rep invariant
-};
-
-inline <T>XPPQ::<T>XPPQ(int chunksize)
- : p(1, chunksize) { count = 0; }
-
-inline <T>XPPQ::<T>XPPQ(const <T>XPPQ& s) : p(s.p) { count = s.count; }
-
-inline Pix <T>XPPQ::first()
-{
- return p.first();
-}
-
-inline void <T>XPPQ::next(Pix & idx)
-{
- p.next(idx);
-}
-
-inline <T>& <T>XPPQ::operator ()(Pix idx)
-{
- return p(idx);
-}
-
-inline <T>& <T>XPPQ::front ()
-{
- return p.low_element();
-}
-
-inline <T> <T>XPPQ::deq ()
-{
- <T> x = p.low_element();
- del_front();
- return x;
-}
-
-inline void <T>XPPQ::clear()
-{
- count = 0; p.clear();
-}
-
-inline int <T>XPPQ::contains (<T&> item)
-{
- return seek(item) != 0;
-}
-
-inline int <T>XPPQ::owns (Pix idx)
-{
- return p.owns(idx);
-}
-
-#endif
diff --git a/contrib/libg++/libg++/src/gen/XPQueue.ccP b/contrib/libg++/libg++/src/gen/XPQueue.ccP
deleted file mode 100644
index 77bfd1c7a957..000000000000
--- a/contrib/libg++/libg++/src/gen/XPQueue.ccP
+++ /dev/null
@@ -1,4 +0,0 @@
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include "<T>.XPQueue.h"
diff --git a/contrib/libg++/libg++/src/gen/XPQueue.hP b/contrib/libg++/libg++/src/gen/XPQueue.hP
deleted file mode 100644
index a5baf7bd68e3..000000000000
--- a/contrib/libg++/libg++/src/gen/XPQueue.hP
+++ /dev/null
@@ -1,114 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
- based on code by Marc Shapiro (shapiro@sor.inria.fr)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-
-#ifndef _<T>XPQueue_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _<T>XPQueue_h
-
-#include "<T>.XPlex.h"
-#include "<T>.Queue.h"
-
-class <T>XPQueue : public <T>Queue
-{
-protected:
- <T>XPlex p;
-
-public:
- <T>XPQueue(int chunksize = DEFAULT_INITIAL_CAPACITY);
- <T>XPQueue(const <T>XPQueue& q);
- inline ~<T>XPQueue();
-
- void operator = (const <T>XPQueue&);
-
- inline void enq(<T&> item);
- inline <T> deq();
- inline <T>& front();
- inline void del_front();
-
- inline void clear();
- inline int empty();
- inline int full();
- inline int length();
-
- inline int OK();
-};
-
-inline <T>XPQueue::<T>XPQueue(int chunksize)
- : p(chunksize) {}
-inline <T>XPQueue::<T>XPQueue(const <T>XPQueue& q) : p(q.p) {}
-
-inline <T>XPQueue::~<T>XPQueue() {}
-
-inline void <T>XPQueue::enq(<T&>item)
-{
- p.add_high(item);
-}
-
-inline <T> <T>XPQueue::deq()
-{
- <T> res = p.low_element();
- p.del_low();
- return res;
-}
-
-inline <T>& <T>XPQueue::front()
-{
- return p.low_element();
-}
-
-
-inline void <T>XPQueue::del_front()
-{
- p.del_low();
-}
-
-inline void <T>XPQueue::operator =(const <T>XPQueue& s)
-{
- p.operator = (s.p);
-}
-
-inline int <T>XPQueue::empty()
-{
- return p.empty();
-}
-
-inline int <T>XPQueue::full()
-{
- return p.full();
-}
-
-inline int <T>XPQueue::length()
-{
- return p.length();
-}
-
-inline int <T>XPQueue::OK()
-{
- return p.OK();
-}
-
-inline void <T>XPQueue::clear()
-{
- p.clear();
-}
-
-#endif
diff --git a/contrib/libg++/libg++/src/gen/XPSet.ccP b/contrib/libg++/libg++/src/gen/XPSet.ccP
deleted file mode 100644
index 596fa8847ad8..000000000000
--- a/contrib/libg++/libg++/src/gen/XPSet.ccP
+++ /dev/null
@@ -1,63 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include "<T>.XPSet.h"
-
-int <T>XPSet::OK()
-{
- int v = p.OK();
- v &= count == p.length();
- if (!v) error("invariant failure");
- return v;
-}
-
-Pix <T>XPSet::seek(<T&> item)
-{
- for (int i = p.low(); i < p.fence(); p.next(i))
- if (<T>EQ(p[i],item)) return p.index_to_Pix(i);
- return 0;
-}
-
-Pix <T>XPSet::add(<T&> item)
-{
- Pix i = seek(item);
- if (i == 0)
- {
- ++count;
- i = p.index_to_Pix(p.add_high(item));
- }
- return i;
-}
-
-void <T>XPSet::del(<T&> item)
-{
- for (int i = p.low(); i < p.fence(); p.next(i))
- {
- if (<T>EQ(p[i], item))
- {
- --count;
- p[i] = p.low_element();
- p.del_low();
- return;
- }
- }
-}
-
diff --git a/contrib/libg++/libg++/src/gen/XPSet.hP b/contrib/libg++/libg++/src/gen/XPSet.hP
deleted file mode 100644
index a87d8eb0b554..000000000000
--- a/contrib/libg++/libg++/src/gen/XPSet.hP
+++ /dev/null
@@ -1,89 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-
-#ifndef _<T>XPSet_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _<T>XPSet_h 1
-
-#include "<T>.Set.h"
-#include "<T>.XPlex.h"
-
-class <T>XPSet : public <T>Set
-{
-protected:
- <T>XPlex p;
-
-public:
- <T>XPSet(int chunksize = DEFAULT_INITIAL_CAPACITY);
- <T>XPSet(const <T>XPSet&);
-
- Pix add(<T&> item);
- void del(<T&> item);
- inline int contains(<T&> item);
-
- inline void clear();
-
- inline Pix first();
- inline void next(Pix& i);
- inline <T>& operator () (Pix i);
- inline int owns(Pix i);
- Pix seek(<T&> item);
-
- int OK();
-};
-
-
-inline <T>XPSet::<T>XPSet(int chunksize)
- : p(chunksize) { count = 0; }
-
-inline <T>XPSet::<T>XPSet(const <T>XPSet& s) : p(s.p) { count = s.count; }
-
-inline Pix <T>XPSet::first()
-{
- return p.first();
-}
-
-inline void <T>XPSet::next(Pix & idx)
-{
- p.next(idx);
-}
-
-inline <T>& <T>XPSet::operator ()(Pix idx)
-{
- return p(idx);
-}
-
-inline void <T>XPSet::clear()
-{
- count = 0; p.clear();
-}
-
-inline int <T>XPSet::contains (<T&> item)
-{
- return seek(item) != 0;
-}
-
-inline int <T>XPSet::owns (Pix idx)
-{
- return p.owns(idx);
-}
-
-#endif
diff --git a/contrib/libg++/libg++/src/gen/XPStack.ccP b/contrib/libg++/libg++/src/gen/XPStack.ccP
deleted file mode 100644
index fe24f0f044a1..000000000000
--- a/contrib/libg++/libg++/src/gen/XPStack.ccP
+++ /dev/null
@@ -1,4 +0,0 @@
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include "<T>.XPStack.h"
diff --git a/contrib/libg++/libg++/src/gen/XPStack.hP b/contrib/libg++/libg++/src/gen/XPStack.hP
deleted file mode 100644
index 41f78adf5ce3..000000000000
--- a/contrib/libg++/libg++/src/gen/XPStack.hP
+++ /dev/null
@@ -1,115 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
- based on code by Marc Shapiro (shapiro@sor.inria.fr)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-
-#ifndef _<T>XPStack_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _<T>XPStack_h
-
-#include "<T>.XPlex.h"
-#include "<T>.Stack.h"
-
-class <T>XPStack : public <T>Stack
-{
- <T>XPlex p;
-
-public:
- <T>XPStack(int chunksize = DEFAULT_INITIAL_CAPACITY);
- <T>XPStack(const <T>XPStack& s);
- inline ~<T>XPStack();
-
- void operator = (const <T>XPStack&);
-
- inline void push(<T&> item);
- inline <T> pop();
- inline <T>& top();
- inline void del_top();
-
- inline int empty();
- inline int full();
- inline int length();
-
- inline void clear();
-
- inline int OK();
-
-};
-
-
-inline <T>XPStack::<T>XPStack(int chunksize)
- : p(chunksize) {}
-inline <T>XPStack::<T>XPStack(const <T>XPStack& s) : p(s.p) {}
-
-inline <T>XPStack::~<T>XPStack() {}
-
-inline void <T>XPStack::push(<T&>item)
-{
- p.add_high(item);
-}
-
-inline <T> <T>XPStack::pop()
-{
- <T> res = p.high_element();
- p.del_high();
- return res;
-}
-
-inline <T>& <T>XPStack::top()
-{
- return p.high_element();
-}
-
-inline void <T>XPStack::del_top()
-{
- p.del_high();
-}
-
-inline void <T>XPStack::operator =(const <T>XPStack& s)
-{
- p.operator = (s.p);
-}
-
-inline int <T>XPStack::empty()
-{
- return p.empty();
-}
-
-inline int <T>XPStack::full()
-{
- return p.full();
-}
-
-inline int <T>XPStack::length()
-{
- return p.length();
-}
-
-inline int <T>XPStack::OK()
-{
- return p.OK();
-}
-
-inline void <T>XPStack::clear()
-{
- p.clear();
-}
-
-#endif
diff --git a/contrib/libg++/libg++/src/gen/XPlex.ccP b/contrib/libg++/libg++/src/gen/XPlex.ccP
deleted file mode 100644
index f5304222993a..000000000000
--- a/contrib/libg++/libg++/src/gen/XPlex.ccP
+++ /dev/null
@@ -1,397 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
- based on code by Marc Shapiro (shapiro@sor.inria.fr)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include "<T>.XPlex.h"
-
-
-<T>XPlex:: <T>XPlex()
-{
- lo = fnc = 0;
- csize = DEFAULT_INITIAL_CAPACITY;
- <T>* data = new <T>[csize];
- set_cache(new <T>IChunk(data, lo, lo, fnc, lo+csize));
- hd = ch;
-}
-
-<T>XPlex:: <T>XPlex(int chunksize)
-{
- if (chunksize == 0) error("invalid constructor specification");
- lo = fnc = 0;
- if (chunksize > 0)
- {
- csize = chunksize;
- <T>* data = new <T>[csize];
- set_cache(new <T>IChunk(data, lo, lo, fnc, csize));
- hd = ch;
- }
- else
- {
- csize = -chunksize;
- <T>* data = new <T>[csize];
- set_cache(new <T>IChunk(data, chunksize, lo, fnc, fnc));
- hd = ch;
- }
-}
-
-
-<T>XPlex:: <T>XPlex(int l, int chunksize)
-{
- if (chunksize == 0) error("invalid constructor specification");
- lo = fnc = l;
- if (chunksize > 0)
- {
- csize = chunksize;
- <T>* data = new <T>[csize];
- set_cache(new <T>IChunk(data, lo, lo, fnc, csize+lo));
- hd = ch;
- }
- else
- {
- csize = -chunksize;
- <T>* data = new <T>[csize];
- set_cache(new <T>IChunk(data, chunksize+lo, lo, fnc, fnc));
- hd = ch;
- }
-}
-
-void <T>XPlex::make_initial_chunks(int up)
-{
- int need = fnc - lo;
- hd = 0;
- if (up)
- {
- int l = lo;
- do
- {
- int sz;
- if (need >= csize)
- sz = csize;
- else
- sz = need;
- <T>* data = new <T> [csize];
- <T>IChunk* h = new <T>IChunk(data, l, l, l+sz, l+csize);
- if (hd != 0)
- h->link_to_next(hd);
- else
- hd = h;
- l += sz;
- need -= sz;
- } while (need > 0);
- }
- else
- {
- int hi = fnc;
- do
- {
- int sz;
- if (need >= csize)
- sz = csize;
- else
- sz = need;
- <T>* data = new <T> [csize];
- <T>IChunk* h = new <T>IChunk(data, hi-csize, hi-sz, hi, hi);
- if (hd != 0)
- h->link_to_next(hd);
- hd = h;
- hi -= sz;
- need -= sz;
- } while (need > 0);
- }
- set_cache(hd);
-}
-
-<T>XPlex:: <T>XPlex(int l, int hi, const <T&> initval, int chunksize)
-{
- lo = l;
- fnc = hi + 1;
- if (chunksize == 0)
- {
- csize = fnc - l;
- make_initial_chunks(1);
- }
- else if (chunksize < 0)
- {
- csize = -chunksize;
- make_initial_chunks(0);
- }
- else
- {
- csize = chunksize;
- make_initial_chunks(1);
- }
- fill(initval);
-}
-
-<T>XPlex::<T>XPlex(const <T>XPlex& a)
-{
- lo = a.lo;
- fnc = a.fnc;
- csize = a.csize;
- make_initial_chunks();
- for (int i = a.low(); i < a.fence(); a.next(i)) (*this)[i] = a[i];
-}
-
-void <T>XPlex::operator= (const <T>XPlex& a)
-{
- if (&a != this)
- {
- invalidate();
- lo = a.lo;
- fnc = a.fnc;
- csize = a.csize;
- make_initial_chunks();
- for (int i = a.low(); i < a.fence(); a.next(i)) (*this)[i] = a[i];
- }
-}
-
-
-void <T>XPlex::cache(int idx) const
-{
- const <T>IChunk* tail = tl();
- const <T>IChunk* t = ch;
- while (idx >= t->fence_index())
- {
- if (t == tail) index_error();
- t = (t->next());
- }
- while (idx < t->low_index())
- {
- if (t == hd) index_error();
- t = (t->prev());
- }
- set_cache(t);
-}
-
-
-void <T>XPlex::cache(const <T>* p) const
-{
- const <T>IChunk* old = ch;
- const <T>IChunk* t = ch;
- while (!t->actual_pointer(p))
- {
- t = (t->next());
- if (t == old) index_error();
- }
- set_cache(t);
-}
-
-int <T>XPlex::owns(Pix px) const
-{
- <T>* p = (<T>*)px;
- const <T>IChunk* old = ch;
- const <T>IChunk* t = ch;
- while (!t->actual_pointer(p))
- {
- t = (t->next());
- if (t == old) { set_cache(t); return 0; }
- }
- set_cache(t);
- return 1;
-}
-
-
-<T>* <T>XPlex::dosucc(const <T>* p) const
-{
- if (p == 0) return 0;
- const <T>IChunk* old = ch;
- const <T>IChunk* t = ch;
-
- while (!t->actual_pointer(p))
- {
- t = (t->next());
- if (t == old) return 0;
- }
- int i = t->index_of(p) + 1;
- if (i >= fnc) return 0;
- if (i >= t->fence_index()) t = (t->next());
- set_cache(t);
- return (t->pointer_to(i));
-}
-
-<T>* <T>XPlex::dopred(const <T>* p) const
-{
- if (p == 0) return 0;
- const <T>IChunk* old = ch;
- const <T>IChunk* t = ch;
- while (!t->actual_pointer(p))
- {
- t = (t->prev());
- if (t == old) return 0;
- }
- int i = t->index_of(p) - 1;
- if (i < lo) return 0;
- if (i < t->low_index()) t = (t->prev());
- set_cache(t);
- return (t->pointer_to(i));
-}
-
-
-int <T>XPlex::add_high(const <T&> elem)
-{
- <T>IChunk* t = tl();
- if (!t->can_grow_high())
- {
- if (t-><T>IChunk::empty() && one_chunk())
- t->clear(fnc);
- else
- {
- <T>* data = new <T> [csize];
- t = (new <T>IChunk(data, fnc, fnc, fnc,fnc+csize));
- t->link_to_prev(tl());
- }
- }
- *((t-><T>IChunk::grow_high())) = elem;
- set_cache(t);
- return fnc++;
-}
-
-int <T>XPlex::del_high ()
-{
- if (empty()) empty_error();
- <T>IChunk* t = tl();
- t-><T>IChunk::shrink_high();
- if (t-><T>IChunk::empty() && !one_chunk())
- {
- <T>IChunk* pred = t->prev();
- del_chunk(t);
- t = pred;
- }
- set_cache(t);
- return --fnc - 1;
-}
-
-int <T>XPlex::add_low (const <T&> elem)
-{
- <T>IChunk* t = hd;
- if (!t->can_grow_low())
- {
- if (t-><T>IChunk::empty() && one_chunk())
- t->cleardown(lo);
- else
- {
- <T>* data = new <T> [csize];
- hd = new <T>IChunk(data, lo-csize, lo, lo, lo);
- hd->link_to_next(t);
- t = hd;
- }
- }
- *((t-><T>IChunk::grow_low())) = elem;
- set_cache(t);
- return --lo;
-}
-
-
-int <T>XPlex::del_low ()
-{
- if (empty()) empty_error();
- <T>IChunk* t = hd;
- t-><T>IChunk::shrink_low();
- if (t-><T>IChunk::empty() && !one_chunk())
- {
- hd = t->next();
- del_chunk(t);
- t = hd;
- }
- set_cache(t);
- return ++lo;
-}
-
-void <T>XPlex::reverse()
-{
- <T> tmp;
- int l = lo;
- int h = fnc - 1;
- <T>IChunk* loch = hd;
- <T>IChunk* hich = tl();
- while (l < h)
- {
- <T>* lptr = loch->pointer_to(l);
- <T>* hptr = hich->pointer_to(h);
- tmp = *lptr;
- *lptr = *hptr;
- *hptr = tmp;
- if (++l >= loch->fence_index()) loch = loch->next();
- if (--h < hich->low_index()) hich = hich->prev();
- }
-}
-
-void <T>XPlex::fill(const <T&> x)
-{
- for (int i = lo; i < fnc; ++i) (*this)[i] = x;
-}
-
-void <T>XPlex::fill(const <T&> x, int l, int hi)
-{
- for (int i = l; i <= hi; ++i) (*this)[i] = x;
-}
-
-
-void <T>XPlex::clear()
-{
- if (fnc != lo)
- {
- <T>IChunk* t = tl();
- while (t != hd)
- {
- <T>IChunk* prv = t->prev();
- del_chunk(t);
- t = prv;
- }
- t-><T>IChunk::clear(lo);
- set_cache(t);
- fnc = lo;
- }
-}
-
-
-int <T>XPlex::OK () const
-{
- int v = hd != 0 && ch != 0; // at least one chunk
-
- v &= fnc == tl()->fence_index();// last chunk fence == plex fence
- v &= lo == ((hd))-><T>IChunk::low_index(); // first lo == plex lo
-
-// loop for others:
- int found_ch = 0; // to make sure ch is in list;
- const <T>IChunk* t = (hd);
- for (;;)
- {
- if (t == ch) ++found_ch;
- v &= t-><T>IChunk::OK(); // each chunk is OK
- if (t == tl())
- break;
- else // and has indices contiguous to succ
- {
- v &= t->top_index() == t->next()->base_index();
- if (t != hd) // internal chunks full
- {
- v &= !t->empty();
- v &= !t->can_grow_low();
- v &= !t->can_grow_high();
- }
- t = t->next();
- }
- }
- v &= found_ch == 1;
- if (!v) error("invariant failure");
- return v;
-}
diff --git a/contrib/libg++/libg++/src/gen/XPlex.hP b/contrib/libg++/libg++/src/gen/XPlex.hP
deleted file mode 100644
index 82445b308748..000000000000
--- a/contrib/libg++/libg++/src/gen/XPlex.hP
+++ /dev/null
@@ -1,238 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
- based on code by Marc Shapiro (shapiro@sor.inria.fr)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifndef _<T>XPlex_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _<T>XPlex_h 1
-
-#include "<T>.Plex.h"
-
-class <T>XPlex: public <T>Plex
-{
- <T>IChunk* ch; // cached chunk
-
- void make_initial_chunks(int up = 1);
-
- void cache(int idx) const;
- void cache(const <T>* p) const;
-
- <T>* dopred(const <T>* p) const;
- <T>* dosucc(const <T>* p) const;
-
- inline void set_cache(const <T>IChunk* t) const; // logically,
- // not physically const
-public:
- <T>XPlex(); // set low = 0;
- // fence = 0;
- // csize = default
-
- <T>XPlex(int ch_size); // low = 0;
- // fence = 0;
- // csize = ch_size
-
- <T>XPlex(int lo, // low = lo;
- int ch_size); // fence=lo
- // csize = ch_size
-
- <T>XPlex(int lo, // low = lo
- int hi, // fence = hi+1
- const <T&> initval,// fill with initval,
- int ch_size = 0); // csize= ch_size
- // or fence-lo if 0
-
- <T>XPlex(const <T>XPlex&);
-
- void operator= (const <T>XPlex&);
-
-// virtuals
-
-
- inline <T>& high_element ();
- inline <T>& low_element ();
-
- inline const <T>& high_element () const;
- inline const <T>& low_element () const;
-
- inline Pix first() const;
- inline Pix last() const;
- inline void prev(Pix& ptr) const;
- inline void next(Pix& ptr) const;
- int owns(Pix p) const;
- inline <T>& operator () (Pix p);
- inline const <T>& operator () (Pix p) const;
-
- inline int low() const;
- inline int high() const;
- inline int valid(int idx) const;
- inline void prev(int& idx) const;
- inline void next(int& x) const;
- inline <T>& operator [] (int index);
- inline const <T>& operator [] (int index) const;
-
- inline int Pix_to_index(Pix p) const;
- inline Pix index_to_Pix(int idx) const;
-
- inline int can_add_high() const;
- inline int can_add_low() const;
- inline int full() const;
-
- int add_high(const <T&> elem);
- int del_high ();
- int add_low (const <T&> elem);
- int del_low ();
-
- void fill(const <T&> x);
- void fill(const <T&> x, int from, int to);
- void clear();
- void reverse();
-
- int OK () const;
-
-};
-
-
-inline void <T>XPlex::prev(int& idx) const
-{
- --idx;
-}
-
-inline void <T>XPlex::next(int& idx) const
-{
- ++idx;
-}
-
-inline int <T>XPlex::full () const
-{
- return 0;
-}
-
-inline int <T>XPlex::can_add_high() const
-{
- return 1;
-}
-
-inline int <T>XPlex::can_add_low() const
-{
- return 1;
-}
-
-inline int <T>XPlex::valid (int idx) const
-{
- return idx >= lo && idx < fnc;
-}
-
-inline int <T>XPlex::low() const
-{
- return lo;
-}
-
-inline int <T>XPlex::high() const
-{
- return fnc - 1;
-}
-
-inline <T>& <T>XPlex:: operator [] (int idx)
-{
- if (!ch->actual_index(idx)) cache(idx);
- return *(ch->pointer_to(idx));
-}
-
-inline const <T>& <T>XPlex:: operator [] (int idx) const
-{
- if (!ch->actual_index(idx)) cache(idx);
- return *((const <T>*)(ch->pointer_to(idx)));
-}
-
-inline <T>& <T>XPlex::low_element ()
-{
- if (empty()) index_error();
- return *(hd->pointer_to(lo));
-}
-
-inline const <T>& <T>XPlex::low_element () const
-{
- if (empty()) index_error();
- return *((const <T>*)(hd->pointer_to(lo)));
-}
-
-inline <T>& <T>XPlex::high_element ()
-{
- if (empty()) index_error();
- return *(tl()->pointer_to(fnc - 1));
-}
-
-inline const <T>& <T>XPlex::high_element () const
-{
- if (empty()) index_error();
- return *((const <T>*)(tl()->pointer_to(fnc - 1)));
-}
-
-inline int <T>XPlex::Pix_to_index(Pix px) const
-{
- <T>* p = (<T>*)px;
- if (!ch->actual_pointer(p)) cache(p);
- return ch->index_of(p);
-}
-
-inline Pix <T>XPlex::index_to_Pix(int idx) const
-{
- if (!ch->actual_index(idx)) cache(idx);
- return (Pix)(ch->pointer_to(idx));
-}
-
-inline Pix <T>XPlex::first() const
-{
- return Pix(hd-><T>IChunk::first_pointer());
-}
-
-inline Pix <T>XPlex::last() const
-{
- return Pix(tl()-><T>IChunk::last_pointer());
-}
-
-inline void <T>XPlex::prev(Pix& p) const
-{
- Pix q = Pix(ch-><T>IChunk::pred((<T>*) p));
- p = (q == 0)? Pix(dopred((const <T>*) p)) : q;
-}
-
-inline void <T>XPlex::next(Pix& p) const
-{
- Pix q = Pix(ch-><T>IChunk::succ((<T>*) p));
- p = (q == 0)? Pix(dosucc((const <T>*)p)) : q;
-}
-
-inline <T>& <T>XPlex:: operator () (Pix p)
-{
- return *((<T>*)p);
-}
-
-inline const <T>& <T>XPlex:: operator () (Pix p) const
-{
- return *((const <T>*)p);
-}
-
-inline void <T>XPlex::set_cache(const <T>IChunk* t) const
-{
- ((<T>XPlex*)(this))->ch = (<T>IChunk*)t;
-}
-
-#endif
diff --git a/contrib/libg++/libg++/src/gen/defs.hP b/contrib/libg++/libg++/src/gen/defs.hP
deleted file mode 100644
index f03617594fe1..000000000000
--- a/contrib/libg++/libg++/src/gen/defs.hP
+++ /dev/null
@@ -1,57 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-
-#ifndef _<T>defs_h
-#define _<T>defs_h 1
-
-
-// equality operator
-#ifndef <T>EQ
-#define <T>EQ(a, b) ((a) == (b))
-#endif
-
-// less-than-or-equal
-#ifndef <T>LE
-#define <T>LE(a, b) ((a) <= (b))
-#endif
-
-// comparison : less-than -> < 0; equal -> 0; greater-than -> > 0
-#ifndef <T>CMP
-#define <T>CMP(a, b) ( ((a) <= (b))? (((a) == (b))? 0 : -1) : 1 )
-#endif
-
-// hash function
-#ifndef <T>HASH
-extern unsigned int hash(<T&>);
-#define <T>HASH(x) hash(x)
-#endif
-
-// initial capacity for structures requiring one
-
-#ifndef DEFAULT_INITIAL_CAPACITY
-#define DEFAULT_INITIAL_CAPACITY 100
-#endif
-
-// HASHTABLE_TOO_CROWDED(COUNT, SIZE) is true iff a hash table with COUNT
-// elements and SIZE slots is too full, and should be resized.
-// This is so if available space is less than 1/8.
-
-#define HASHTABLE_TOO_CROWDED(COUNT, SIZE) ((SIZE) - ((SIZE) >> 3) <= (COUNT))
-
-#endif
diff --git a/contrib/libg++/libg++/src/gen/intSList.hP b/contrib/libg++/libg++/src/gen/intSList.hP
deleted file mode 100644
index 24aa3b6a685b..000000000000
--- a/contrib/libg++/libg++/src/gen/intSList.hP
+++ /dev/null
@@ -1,33 +0,0 @@
-/* : Light weight List: This will simply reuse code from a int List, which
-was genclassed from the SLList libg++ class. The classes generated from this file
-will all be derived classes from class VoidSLList or intSLList. Note that class SLList does not
-offer all the functionality of List classes, such as sharing of sub-Lists.
-However, no additional code is needed at all and no .cc file is generated. So it costs nothing
-to use these type-safe Lists. Only member functions needing type casting are re-defined */
-
-
-#ifndef _<T>SList_h
-#define _<T>SList_h 1
-
-#include "int.SLList.h"
-#include "<T>.defs.h"
-
-class <T>SList : public intSLList
-{
-public:
- <T>SList() {}
- <T>SList(<T>SList& a) : (a) {}
- ~<T>SList() {}
-
- <T>SList& operator = (<T>SList& a) {
- return (<T>SList&) intSLList::operator= (a); }
-
- <T>& operator () (Pix p) { return (<T>&) (intSLList::operator() (p)); }
- <T>& front() { return (<T>&) intSLList::front(); }
- <T>& rear() { return (<T>&) intSLList::rear(); }
- <T> remove_front() { return (<T>) intSLList::remove_front(); }
-
-};
-
-#endif /* conditional include */
-
diff --git a/contrib/libg++/libg++/src/gen/intVec.hP b/contrib/libg++/libg++/src/gen/intVec.hP
deleted file mode 100644
index e3838700251d..000000000000
--- a/contrib/libg++/libg++/src/gen/intVec.hP
+++ /dev/null
@@ -1,80 +0,0 @@
-/* : light weight Vector: This will simply reuse code from */
-/* a int Vec, which was genclassed from the Vec libg++ class. */
-/* The classes generated from this file will all be derived classes */
-/* from class VoidVec or intVec. No .cc file is generated. So */
-/* it costs nothing to use these type-safe Vectors. Only member */
-/* functions needing type casting are re-defined. */
-/* */
-
-#ifndef _<T>Vec_h
-#define _<T>Vec_h 1
-
-#include "int.Vec.h"
-#include "<T>.defs.h"
-
-
-#ifndef _<T>_typedefs
-#define _<T>_typedefs 1
-typedef void (*<T>Procedure)(<T> );
-typedef <T> (*<T>Mapper)(<T> );
-typedef <T> (*<T>Combiner)(<T> , <T> );
-typedef int (*<T>Predicate)(<T> );
-typedef int (*<T>Comparator)(<T> , <T> );
-#endif
-
-class <T>Vec : public intVec
-{
-protected:
- <T>Vec(int l, <T>* d) : (l, (int*) d) {};
-public:
- <T>Vec() {};
- <T>Vec(int l) : (l) {};
- <T>Vec(int l, <T&> fill_value) : (l, fill_value) {};
- <T>Vec(<T>Vec& v) : (v) {};
- <T>Vec(intVec& v) {fake_copy(v, s, len);}
- ~<T>Vec() {};
-
- <T>Vec& operator = (<T>Vec& a)
- {return (<T>Vec&) intVec::operator= (a);}
- <T>Vec at(int from, int n) {return (<T>Vec) intVec::at(from, n);}
-
- <T>& operator [] (int n) {return (<T>&)intVec::operator[] (n);}
- <T>& elem(int n) {return (<T>&)intVec::elem(n);}
-
- friend <T>Vec concat(<T>Vec& a, <T>Vec& b);
- friend <T>Vec map(<T>Mapper f, <T>Vec & a);
- friend <T>Vec merge(<T>Vec & a, <T>Vec & b, <T>Comparator f);
- friend <T>Vec combine(<T>Combiner f, <T>Vec & a, <T>Vec & b);
- friend <T>Vec reverse(<T>Vec& a);
-
- void sort(<T>Comparator f);
- void apply(<T>Procedure f);
- <T> reduce(<T>Combiner f, <T> base);
-};
-
-inline <T>Vec concat(<T>Vec& a, <T>Vec& b)
-{return (<T>Vec)concat((intVec&)a, (intVec&)b);}
-
-inline <T>Vec map(<T>Mapper f, <T>Vec & a) {
- return (<T>Vec)map((intMapper)f, (intVec&)a); }
-
-inline <T>Vec merge(<T>Vec & a, <T>Vec & b, <T>Comparator f) {
- return (<T>Vec)merge((intVec&)a, (intVec&)b, (intComparator)f); }
-
-inline <T>Vec combine(<T>Combiner f, <T>Vec & a, <T>Vec & b) {
- return (<T>Vec)combine((intCombiner)f, (intVec&)a, (intVec&)b); }
-
-inline <T>Vec reverse(<T>Vec& a) {
- return (<T>Vec)reverse((intVec&)a);}
-
-inline void <T>Vec::sort(<T>Comparator f) {
- intVec::sort((intComparator) f); }
-
-inline void <T>Vec::apply(<T>Procedure f) {
- intVec::apply((intProcedure) f); }
-
-inline <T> <T>Vec::reduce(<T>Combiner f, <T> base) {
- return (<T>)intVec::reduce((intCombiner)f, base);}
-
-#endif /* conditional include */
-
diff --git a/contrib/libg++/libg++/src/generic.h b/contrib/libg++/libg++/src/generic.h
deleted file mode 100644
index d49a924afd12..000000000000
--- a/contrib/libg++/libg++/src/generic.h
+++ /dev/null
@@ -1,54 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifndef generic_h
-#define generic_h 1
-
-/*
- * See the CPP manual, argument prescan section for explanation
- */
-
-#define name2(a,b) gEnErIc2(a,b)
-#define gEnErIc2(a,b) a ## b
-
-#define name3(a,b,c) gEnErIc3(a,b,c)
-#define gEnErIc3(a,b,c) a ## b ## c
-
-#define name4(a,b,c,d) gEnErIc4(a,b,c,d)
-#define gEnErIc4(a,b,c,d) a ## b ## c ## d
-
-#define GENERIC_STRING(a) gEnErIcStRiNg(a)
-#define gEnErIcStRiNg(a) #a
-
-#define declare(clas,t) name2(clas,declare)(t)
-#define declare2(clas,t1,t2) name2(clas,declare2)(t1,t2)
-
-#define implement(clas,t) name2(clas,implement)(t)
-#define implement2(clas,t1,t2) name2(clas,implement2)(t1,t2)
-
-//extern genericerror(int,char*);
-typedef int (*GPT)(int,char*);
-
-#define set_handler(gen,type,x) name4(set_,type,gen,_handler)(x)
-
-#define errorhandler(gen,type) name3(type,gen,handler)
-
-#define callerror(gen,type,a,b) (*errorhandler(gen,type))(a,b)
-
-
-#endif /* generic_h */
diff --git a/contrib/libg++/libg++/src/getpagesize.h b/contrib/libg++/libg++/src/getpagesize.h
deleted file mode 100644
index 17d84316bd57..000000000000
--- a/contrib/libg++/libg++/src/getpagesize.h
+++ /dev/null
@@ -1,27 +0,0 @@
-#if defined(BSD) || defined(DGUX)
-#ifndef BSD4_1
-#define HAVE_GETPAGESIZE
-#endif
-#endif
-
-#ifndef HAVE_GETPAGESIZE
-
-#include <sys/param.h>
-
-#ifdef EXEC_PAGESIZE
-#define getpagesize() EXEC_PAGESIZE
-#else
-#ifdef NBPG
-#define getpagesize() NBPG * CLSIZE
-#ifndef CLSIZE
-#define CLSIZE 1
-#endif /* no CLSIZE */
-#else /* no NBPG */
-#ifdef NBPC
-#define getpagesize() NBPC
-#endif /* NBPC */
-#endif /* no NBPG */
-#endif /* no EXEC_PAGESIZE */
-
-#endif /* not HAVE_GETPAGESIZE */
-
diff --git a/contrib/libg++/libg++/src/hash.cc b/contrib/libg++/libg++/src/hash.cc
deleted file mode 100644
index 670e53f2bda5..000000000000
--- a/contrib/libg++/libg++/src/hash.cc
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
-Copyright (C) 1990 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <builtin.h>
-
-/*
- some useful hash functions
-*/
-
-unsigned int hashpjw(const char* x) // From Dragon book, p436
-{
- unsigned int h = 0;
- unsigned int g;
-
- while (*x != 0)
- {
- h = (h << 4) + *x++;
- if ((g = h & 0xf0000000) != 0)
- h = (h ^ (g >> 24)) ^ g;
- }
- return h;
-}
-
-unsigned int multiplicativehash(int x)
-{
- // uses a const close to golden ratio * pow(2,32)
- return ((unsigned)x) * 2654435767;
-}
-
-
-unsigned int foldhash(double x)
-{
- union { unsigned int i[2]; double d; } u;
- u.d = x;
- unsigned int u0 = u.i[0];
- unsigned int u1 = u.i[1];
- return u0 ^ u1;
-}
-
diff --git a/contrib/libg++/libg++/src/ioob.cc b/contrib/libg++/libg++/src/ioob.cc
deleted file mode 100644
index 08409a5d292d..000000000000
--- a/contrib/libg++/libg++/src/ioob.cc
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
-Copyright (C) 1990 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of GNU CC.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY. No author or distributor
-accepts responsibility to anyone for the consequences of using it
-or for whether it serves any particular purpose or works at all,
-unless he says so in writing. Refer to the GNU CC General Public
-License for full details.
-
-Everyone is granted permission to copy, modify and redistribute
-GNU CC, but only under the conditions described in the
-GNU CC General Public License. A copy of this license is
-supposed to have been given to you along with GNU CC so you
-can know your rights and responsibilities. It should be in a
-file named COPYING. Among other things, the copyright notice
-and this notice must be preserved on all copies.
-*/
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <Obstack.h>
-
-// Obstacks are used as an easy way to allocate enough space
-// for various builtin input operations
-
-
-Obstack _libgxx_io_ob;
diff --git a/contrib/libg++/libg++/src/lg.cc b/contrib/libg++/libg++/src/lg.cc
deleted file mode 100644
index 0397dd43f010..000000000000
--- a/contrib/libg++/libg++/src/lg.cc
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
-Copyright (C) 1990 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <builtin.h>
-
-long lg(unsigned long x)
-{
- long l = 0;
- while (x > 1)
- {
- x = x >> 1;
- ++l;
- }
- return l;
-}
diff --git a/contrib/libg++/libg++/src/libc.h b/contrib/libg++/libg++/src/libc.h
deleted file mode 100644
index c8b49f26d172..000000000000
--- a/contrib/libg++/libg++/src/libc.h
+++ /dev/null
@@ -1 +0,0 @@
-#include <stdlib.h>
diff --git a/contrib/libg++/libg++/src/malloc.c b/contrib/libg++/libg++/src/malloc.c
deleted file mode 100644
index ff570968084f..000000000000
--- a/contrib/libg++/libg++/src/malloc.c
+++ /dev/null
@@ -1,2690 +0,0 @@
-/* ---------- To make a malloc.h, start cutting here ------------ */
-
-/*
- A version of malloc/free/realloc written by Doug Lea and released to the
- public domain. Send questions/comments/complaints/performance data
- to dl@cs.oswego.edu
-
-* preliminary VERSION 2.6.2q Mon Jan 8 10:28:33 1996 Doug Lea (dl at gee)
-
- Note: There may be an updated version of this malloc obtainable at
- ftp://g.oswego.edu/pub/misc/malloc.c
- Check before installing!
-
-* Synopsis of public routines
-
- (Much fuller descriptions are contained in the program documentation below.)
-
- malloc(size_t n);
- Return a pointer to a newly allocated chunk of at least n bytes, or null
- if no space is available.
- free(Void_t* p);
- Release the chunk of memory pointed to by p, or no effect if p is null.
- realloc(Void_t* p, size_t n);
- Return a pointer to a chunk of size n that contains the same data
- as does chunk p up to the minimum of (n, p's size) bytes, or null
- if no space is available. The returned pointer may or may not be
- the same as p. If p is null, equivalent to malloc. Unless the
- #define REALLOC_ZERO_BYTES_FREES below is set, realloc with a
- size argument of zero (re)allocates a minimum-sized chunk.
- memalign(size_t alignment, size_t n);
- Return a pointer to a newly allocated chunk of n bytes, aligned
- in accord with the alignment argument, which must be a power of
- two.
- valloc(size_t n);
- Equivalent to memalign(pagesize, n), where pagesize is the page
- size of the system (or as near to this as can be figured out from
- all the includes/defines below.)
- calloc(size_t unit, size_t quantity);
- Returns a pointer to quantity * unit bytes, with all locations
- set to zero.
- cfree(Void_t* p);
- Equivalent to free(p).
- malloc_trim(size_t pad);
- Release all but pad bytes of freed top-most memory back
- to the system. Return 1 if successful, else 0.
- malloc_usable_size(Void_t* p);
- Report the number usable allocated bytes associated with allocated
- chunk p. This may or may not report more bytes than were requested,
- due to alignment and minimum size constraints.
- malloc_stats();
- Prints brief summary statistics on stderr.
- mallinfo()
- Returns (by copy) a struct containing various summary statistics.
- mallopt(int parameter_number, int parameter_value)
- Changes one of the tunable parameters described below. Returns
- 1 if successful in changing the parameter, else 0.
-
-* Vital statistics:
-
- Alignment: 8-byte
-
- 8 byte alignment is currently hardwired into the design. This
- seems to suffice for all current machines and C compilers.
-
- Assumed pointer representation: 4 bytes
- Assumed size_t representation: 4 bytes
- Minimum overhead per allocated chunk: 4 bytes
-
- Each malloced chunk has a hidden overhead of 4 bytes holding size
- and status information.
-
- Minimum allocated size: 16 bytes (12 bytes usable, 4 overhead)
-
- When a chunk is freed, 12 additional bytes are needed; 4 for a
- trailing size field and 8 bytes for free list pointers. Thus,
- the minimum allocatable size is 16 bytes, of which 12 bytes are
- usable. Even a request for zero bytes (i.e., malloc(0)) returns
- a pointer to something of the minimum allocatable size.
-
- Maximum allocated size: 2147483640 (2^31 - 8) bytes
-
- It is assumed that (possibly signed) 32 bit values suffice to
- represent chunk sizes. `Possibly signed' is due to the fact
- that `size_t' may be defined on a system as either a signed or
- an unsigned type. To be conservative, values that would appear
- as negative numbers are avoided. The maximum size chunk is
- 2^31 - 8 bytes. Requests for negative sizes (when size_t is
- signed) or those greater than (2^31 - 8) bytes will return a
- minimum-sized chunk.
-
- Maximum overhead wastage per allocated chunk: normally 15 bytes
-
- Alignnment demands, plus the minimum allocatable size restriction
- make the normal worst-case wastage 15 bytes (i.e., up to 15
- more bytes will be allocated than were requested in malloc), with
- two exceptions:
- 1. Because requests for zero bytes allocate non-zero space,
- the worst case wastage for a request of zero bytes is 24 bytes.
- 2. For requests >= mmap_threshold that are serviced via
- mmap(), the worst case wastage is 8 bytes plus the remainder
- from a system page (the minimal mmap unit); typically 4096 bytes.
-
-
-* Synopsis of compile-time options:
-
- People have reported using previous versions of this malloc on all
- versions of Unix, sometimes by tweaking some of the defines
- below. It has been tested most extensively on Solaris and
- Linux. People have also reported adapting this malloc for use in
- stand-alone embedded systems.
-
- The implementation is in straight, hand-tuned ANSI C. Among other
- consequences, it uses a lot of macros. Because of this, to be at
- all usable, this code should be compiled using an optimizing compiler
- (for example gcc -O2) that can simplify expressions and control
- paths.
-
- __STD_C (default: derived from C compiler defines)
- Nonzero if using ANSI-standard C compiler, a C++ compiler, or
- a C compiler sufficiently close to ANSI to get away with it.
- DEBUG (default: NOT defined)
- Define to enable debugging. Adds fairly extensive assertion-based
- checking to help track down memory errors, but noticeably slows down
- execution.
- REALLOC_ZERO_BYTES_FREES (default: NOT defined)
- Define this if you think that realloc(p, 0) should be equivalent
- to free(p). Otherwise, since malloc returns a unique pointer for
- malloc(0), so does realloc(p, 0).
- HAVE_MEMCPY (default: defined)
- Define if you are not otherwise using ANSI STD C, but still
- have memcpy and memset in your C library and want to use them.
- Otherwise, simple internal versions are supplied.
- HAVE_MMAP (default: defined as 1)
- Define to non-zero to optionally make malloc() use mmap() to
- allocate very large blocks.
- malloc_getpagesize (default: derived from system #includes)
- Either a constant or routine call returning the system page size.
- HAVE_USR_INCLUDE_MALLOC_H (default: NOT defined)
- Optionally define if you are on a system with a /usr/include/malloc.h
- that declares struct mallinfo. It is not at all necessary to
- define this even if you do, but will ensure consistency.
- INTERNAL_LINUX_C_LIB (default: NOT defined)
- Defined only when compiled as part of Linux libc.
- Also note that there is some odd internal name-magling via defines
- (for example, internally, `malloc' is named `mALLOc') needed
- when compiling in this case. These look funny but don't otherwise
- affect anything.
- MORECORE (default: sbrk)
- The name of the routine to call to obtain more memory from the system.
- MORECORE_FAILURE (default: -1)
- The value returned upon failure of MORECORE.
- DEFAULT_TRIM_THRESHOLD
- DEFAULT_TOP_PAD
- DEFAULT_MMAP_THRESHOLD
- DEFAULT_MMAP_MAX
- Default values of tunable parameters (described in detail below)
- controlling interaction with host system routines (sbrk, mmap, etc).
- These values may also be changed dynamically via mallopt(). The
- preset defaults are those that give best performance for typical
- programs/systems.
-
-
-*/
-
-
-
-
-/* Preliminaries */
-
-#ifndef __STD_C
-#ifdef __STDC__
-#define __STD_C 1
-#else
-#if __cplusplus
-#define __STD_C 1
-#else
-#define __STD_C 0
-#endif /*__cplusplus*/
-#endif /*__STDC__*/
-#endif /*__STD_C*/
-
-#ifndef Void_t
-#if __STD_C
-#define Void_t void
-#else
-#define Void_t char
-#endif
-#endif /*Void_t*/
-
-#if __STD_C
-#include <stddef.h> /* for size_t */
-#else
-#include <sys/types.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <stdio.h> /* needed for malloc_stats */
-
-
-/*
- Compile-time options
-*/
-
-
-/*
- Debugging:
-
- Because freed chunks may be overwritten with link fields, this
- malloc will often die when freed memory is overwritten by user
- programs. This can be very effective (albeit in an annoying way)
- in helping track down dangling pointers.
-
- If you compile with -DDEBUG, a number of assertion checks are
- enabled that will catch more memory errors. You probably won't be
- able to make much sense of the actual assertion errors, but they
- should help you locate incorrectly overwritten memory. The
- checking is fairly extensive, and will slow down execution
- noticeably. Calling malloc_stats or mallinfo with DEBUG set will
- attempt to check every non-mmapped allocated and free chunk in the
- course of computing the summmaries. (By nature, mmapped regions
- cannot be checked very much automatically.)
-
- Setting DEBUG may also be helpful if you are trying to modify
- this code. The assertions in the check routines spell out in more
- detail the assumptions and invariants underlying the algorithms.
-
-*/
-
-#if DEBUG
-#include <assert.h>
-#else
-#define assert(x) ((void)0)
-#endif
-
-
-
-/*
- REALLOC_ZERO_BYTES_FREES should be set if a call to
- realloc with zero bytes should be the same as a call to free.
- Some people think it should. Otherwise, since this malloc
- returns a unique pointer for malloc(0), so does realloc(p, 0).
-*/
-
-
-/* #define REALLOC_ZERO_BYTES_FREES */
-
-
-/*
- HAVE_MEMCPY should be defined if you are not otherwise using
- ANSI STD C, but still have memcpy and memset in your C library
- and want to use them in calloc and realloc. Otherwise simple
- macro versions are defined here.
-*/
-
-#define HAVE_MEMCPY
-
-#if __STD_C || defined(HAVE_MEMCPY)
-
-void* memset(void*, int, size_t);
-void* memcpy(void*, const void*, size_t);
-
-#define MALLOC_ZERO(charp, nbytes) memset(charp, 0, nbytes)
-#define MALLOC_COPY(dest,src,nbytes) memcpy((dest), (src), (nbytes))
-
-#else
-
-/* We only invoke with multiples of size_t units, with size_t alignment */
-
-#define MALLOC_ZERO(charp, nbytes) \
-{ \
- size_t* mzp = (size_t*)(charp); \
- size_t mzn = (nbytes) / sizeof(size_t); \
- while (mzn-- > 0) *mzp++ = 0; \
-}
-
-#define MALLOC_COPY(dest,src,nbytes) \
-{ \
- size_t* mcsrc = (size_t*) src; \
- size_t* mcdst = (size_t*) dest; \
- long mcn = (nbytes) / sizeof(size_t); \
- while (mcn-- > 0) *mcdst++ = *mcsrc++; \
-}
-
-#endif
-
-/*
- Define HAVE_MMAP to optionally make malloc() use mmap() to
- allocate very large blocks. These will be returned to the
- operating system immediately after a free().
-*/
-
-#ifndef HAVE_MMAP
-#define HAVE_MMAP 1
-#endif
-
-#if HAVE_MMAP
-
-#include <unistd.h>
-#include <fcntl.h>
-#include <sys/mman.h>
-
-#if !defined(MAP_ANONYMOUS) && defined(MAP_ANON)
-#define MAP_ANONYMOUS MAP_ANON
-#endif
-
-#endif /* HAVE_MMAP */
-
-/*
- Access to system page size. To the extent possible, this malloc
- manages memory from the system in page-size units.
-
- The following mechanics for getpagesize were adapted from
- bsd/gnu getpagesize.h
-*/
-
-#ifndef malloc_getpagesize
-#if defined(BSD) || defined(DGUX) || defined(HAVE_GETPAGESIZE)
- extern size_t getpagesize();
-# define malloc_getpagesize getpagesize()
-#else
-# include <sys/param.h>
-# ifdef EXEC_PAGESIZE
-# define malloc_getpagesize EXEC_PAGESIZE
-# else
-# ifdef NBPG
-# ifndef CLSIZE
-# define malloc_getpagesize NBPG
-# else
-# define malloc_getpagesize (NBPG * CLSIZE)
-# endif
-# else
-# ifdef NBPC
-# define malloc_getpagesize NBPC
-# else
-# ifdef PAGESIZE
-# define malloc_getpagesize PAGESIZE
-# else
-# define malloc_getpagesize (4096) /* just guess */
-# endif
-# endif
-# endif
-# endif
-#endif
-#endif
-
-/*
-
- This version of malloc supports the standard SVID/XPG mallinfo
- routine that returns a struct containing the same kind of
- information you can get from malloc_stats. It should work on
- any SVID/XPG compliant system that has a /usr/include/malloc.h
- defining struct mallinfo. (If you'd like to install such a thing
- yourself, cut out the preliminary declarations as described above
- and below and save them in a malloc.h file. But there's no
- compelling reason to bother to do this.)
-
- The main declaration needed is the mallinfo struct that is returned
- (by-copy) by mallinfo(). The SVID/XPG malloinfo struct contains a
- bunch of fields, most of which are not even meaningful in this
- version of malloc. Some of these fields are are instead filled by
- mallinfo() with other numbers that might possibly be of interest.
-
- HAVE_USR_INCLUDE_MALLOC_H should be set if you have a
- /usr/include/malloc.h file that includes a declaration of struct
- mallinfo. If so, it is included; else an SVID2/XPG2 compliant
- version is declared below. These must be precisely the same for
- mallinfo() to work.
-
-*/
-
-/* #define HAVE_USR_INCLUDE_MALLOC_H */
-
-#if HAVE_USR_INCLUDE_MALLOC_H
-#include "/usr/include/malloc.h"
-#else
-
-/* SVID2/XPG mallinfo structure */
-
-struct mallinfo {
- int arena; /* total space allocated from system */
- int ordblks; /* number of non-inuse chunks */
- int smblks; /* unused -- always zero */
- int hblks; /* number of mmapped regions */
- int hblkhd; /* total space in mmapped regions */
- int usmblks; /* unused -- always zero */
- int fsmblks; /* unused -- always zero */
- int uordblks; /* total allocated space */
- int fordblks; /* total non-inuse space */
- int keepcost; /* top-most, releasable (via malloc_trim) space */
-};
-
-/* SVID2/XPG mallopt options */
-
-#define M_MXFAST 1 /* UNUSED in this malloc */
-#define M_NLBLKS 2 /* UNUSED in this malloc */
-#define M_GRAIN 3 /* UNUSED in this malloc */
-#define M_KEEP 4 /* UNUSED in this malloc */
-
-#endif
-
-/* mallopt options that actually do something */
-
-#define M_TRIM_THRESHOLD -1
-#define M_TOP_PAD -2
-#define M_MMAP_THRESHOLD -3
-#define M_MMAP_MAX -4
-
-
-
-#ifndef DEFAULT_TRIM_THRESHOLD
-#define DEFAULT_TRIM_THRESHOLD (1024 * 1024)
-#endif
-
-/*
- M_TRIM_THRESHOLD is the maximum amount of unused top-most memory
- to keep before releasing via malloc_trim in free().
-
- Automatic trimming is mainly useful in long-lived programs.
- Because trimming via sbrk can be slow on some systems, and can
- sometimes be wasteful (in cases where programs immediately
- afterward allocate more large chunks) the value should be high
- enough so that your overall system performance would improve by
- releasing.
-
- The trim threshold and the mmap control parameters (see below)
- can be traded off with one another. Trimming and mmapping are
- two different ways of releasing unused memory back to the
- system. Between these two, it is often possible to keep
- system-level demands of a long-lived program down to a bare
- minimum. For example, in one test suite of sessions measuring
- the XF86 X server on Linux, using a trim threshold of 128K and a
- mmap threshold of 192K led to near-minimal long term resource
- consumption.
-
- If you are using this malloc in a long-lived program, it should
- pay to experiment with these values. As a rough guide, you
- might set to a value close to the average size of a process
- (program) running on your system. Releasing this much memory
- would allow such a process to run in memory. Generally, it's
- worth it to tune for trimming rather tham memory mapping when a
- program undergoes phases where several large chunks are
- allocated and released in ways that can reuse each other's
- storage, perhaps mixed with phases where there are no such
- chunks at all. And in well-behaved long-lived programs,
- controlling release of large blocks via trimming versus mapping
- is usually faster.
-
- However, in most programs, these parameters serve mainly as
- protection against the system-level effects of carrying around
- massive amounts of unneeded memory. Since frequent calls to
- sbrk, mmap, and munmap otherwise degrade performance, the default
- parameters are set to relatively high values that serve only as
- safeguards.
-
- The default trim value is high enough to cause trimming only in
- fairly extreme (by current memory consumption standards) cases.
- It must be greater than page size to have any useful effect. To
- disable trimming completely, you can set to (unsigned long)(-1);
-
-
-*/
-
-
-#ifndef DEFAULT_TOP_PAD
-#define DEFAULT_TOP_PAD (0)
-#endif
-
-/*
- M_TOP_PAD is the amount of extra `padding' space to allocate or
- retain whenever sbrk is called. It is used in two ways internally:
-
- * When sbrk is called to extend the top of the arena to satisfy
- a new malloc request, this much padding is added to the sbrk
- request.
-
- * When malloc_trim is called automatically from free(),
- it is used as the `pad' argument.
-
- In both cases, the actual amount of padding is rounded
- so that the end of the arena is always a system page boundary.
-
- The main reason for using padding is to avoid calling sbrk so
- often. Having even a small pad greatly reduces the likelihood
- that nearly every malloc request during program start-up (or
- after trimming) will invoke sbrk, which needlessly wastes
- time.
-
- Automatic rounding-up to page-size units is normally sufficient
- to avoid measurable overhead, so the default is 0. However, in
- systems where sbrk is relatively slow, it can pay to increase
- this value, at the expense of carrying around more memory than
- the program needs.
-
-*/
-
-
-#ifndef DEFAULT_MMAP_THRESHOLD
-#define DEFAULT_MMAP_THRESHOLD (128 * 1024)
-#endif
-
-/*
-
- M_MMAP_THRESHOLD is the request size threshold for using mmap()
- to service a request. Requests of at least this size that cannot
- be allocated using already-existing space will be serviced via mmap.
- (If enough normal freed space already exists it is used instead.)
-
- Using mmap segregates relatively large chunks of memory so that
- they can be individually obtained and released from the host
- system. A request serviced through mmap is never reused by any
- other request (at least not directly; the system may just so
- happen to remap successive requests to the same locations).
-
- Segregating space in this way has the benefit that mmapped space
- can ALWAYS be individually released back to the system, which
- helps keep the system level memory demands of a long-lived
- program low. Mapped memory can never become `locked' between
- other chunks, as can happen with normally allocated chunks, which
- menas that even trimming via malloc_trim would not release them.
-
- However, it has the disadvantages that:
-
- 1. The space cannot be reclaimed, consolidated, and then
- used to service later requests, as happens with normal chunks.
- 2. It can lead to more wastage because of mmap page alignment
- requirements
- 3. It causes malloc performance to be more dependent on host
- system memory management support routines which may vary in
- implementation quality and may impose arbitrary
- limitations. Generally, servicing a request via normal
- malloc steps is faster than going through a system's mmap.
-
- All together, these considerations should lead you to use mmap
- only for relatively large requests.
-
-
-*/
-
-
-
-#ifndef DEFAULT_MMAP_MAX
-#if HAVE_MMAP
-#define DEFAULT_MMAP_MAX (8)
-#else
-#define DEFAULT_MMAP_MAX (0)
-#endif
-#endif
-
-/*
- M_MMAP_MAX is the maximum number of requests to simultaneously
- service using mmap. This parameter exists because:
-
- 1. Some systems have a limited number of internal tables for
- use by mmap.
- 2. In most systems, overreliance on mmap can degrade overall
- performance.
- 3. If a program allocates many large regions, it is probably
- better off using normal sbrk-based allocation routines that
- can reclaim and reallocate normal heap memory. Using a
- small value allows transition into this mode after the
- first few allocations.
-
- Setting to 0 disables all use of mmap. If HAVE_MMAP is not set,
- the default value is 0, and attempts to set it to non-zero values
- in mallopt will fail.
-*/
-
-
-
-/*
-
- Special defines for linux libc
-
- Except when compiled using these special defines for Linux libc
- using weak aliases, this malloc is NOT designed to work in
- multithreaded applications. No semaphores or other concurrency
- control are provided to ensure that multiple malloc or free calls
- don't run at the same time, which could be disasterous. A single
- semaphore could be used across malloc, realloc, and free (which is
- essentially the effect of the linux weak alias approach). It would
- be hard to obtain finer granularity.
-
-*/
-
-
-#ifdef INTERNAL_LINUX_C_LIB
-
-#if __STD_C
-
-Void_t * __default_morecore_init (ptrdiff_t);
-Void_t *(*__morecore)(ptrdiff_t) = __default_morecore_init;
-
-#else
-
-Void_t * __default_morecore_init ();
-Void_t *(*__morecore)() = __default_morecore_init;
-
-#endif
-
-#define MORECORE (*__morecore)
-#define MORECORE_FAILURE 0
-
-#else /* INTERNAL_LINUX_C_LIB */
-
-#if __STD_C
-extern Void_t* sbrk(ptrdiff_t);
-#else
-extern Void_t* sbrk();
-#endif
-
-#ifndef MORECORE
-#define MORECORE sbrk
-#endif
-
-#ifndef MORECORE_FAILURE
-#define MORECORE_FAILURE -1
-#endif
-
-#endif /* INTERNAL_LINUX_C_LIB */
-
-#if defined(INTERNAL_LINUX_C_LIB) && defined(__ELF__)
-
-#define cALLOc __libc_calloc
-#define fREe __libc_free
-#define mALLOc __libc_malloc
-#define mEMALIGn __libc_memalign
-#define rEALLOc __libc_realloc
-#define vALLOc __libc_valloc
-#define mALLINFo __libc_mallinfo
-#define mALLOPt __libc_mallopt
-
-#pragma weak calloc = __libc_calloc
-#pragma weak free = __libc_free
-#pragma weak cfree = __libc_free
-#pragma weak malloc = __libc_malloc
-#pragma weak memalign = __libc_memalign
-#pragma weak realloc = __libc_realloc
-#pragma weak valloc = __libc_valloc
-#pragma weak mallinfo = __libc_mallinfo
-#pragma weak mallopt = __libc_mallopt
-
-#else
-
-#define cALLOc calloc
-#define fREe free
-#define mALLOc malloc
-#define mEMALIGn memalign
-#define rEALLOc realloc
-#define vALLOc valloc
-#define mALLINFo mallinfo
-#define mALLOPt mallopt
-
-#endif
-
-/* Public routines */
-
-#if __STD_C
-
-Void_t* mALLOc(size_t);
-void fREe(Void_t*);
-Void_t* rEALLOc(Void_t*, size_t);
-Void_t* mEMALIGn(size_t, size_t);
-Void_t* vALLOc(size_t);
-Void_t* cALLOc(size_t, size_t);
-void cfree(Void_t*);
-int malloc_trim(size_t);
-size_t malloc_usable_size(Void_t*);
-void malloc_stats();
-int mALLOPt(int, int);
-struct mallinfo mALLINFo(void);
-#else
-Void_t* mALLOc();
-void fREe();
-Void_t* rEALLOc();
-Void_t* mEMALIGn();
-Void_t* vALLOc();
-Void_t* cALLOc();
-void cfree();
-int malloc_trim();
-size_t malloc_usable_size();
-void malloc_stats();
-int mALLOPt();
-struct mallinfo mALLINFo();
-#endif
-
-
-#ifdef __cplusplus
-}; /* end of extern "C" */
-#endif
-
-/* ---------- To make a malloc.h, end cutting here ------------ */
-
-
-
-
-/*
- Type declarations
-*/
-
-
-struct malloc_chunk
-{
- size_t size; /* Size in bytes, including overhead. */
- struct malloc_chunk* fd; /* double links -- used only if free. */
- struct malloc_chunk* bk;
- size_t unused; /* to pad decl to min chunk size */
-};
-
-typedef struct malloc_chunk* mchunkptr;
-
-/*
-
- malloc_chunk details:
-
- (The following includes lightly edited explanations by Colin Plumb.)
-
- Chunks of memory are maintained using a `boundary tag' method as
- described in e.g., Knuth or Standish. (See the paper by Paul
- Wilson ftp://ftp.cs.utexas.edu/pub/garbage/allocsrv.ps for a
- survey of such techniques.) Sizes of free chunks are stored both
- in the front of each chunk and at the end. This makes
- consolidating fragmented chunks into bigger chunks very fast. The
- size fields also hold bits representing whether chunks are free or
- in use.
-
- An allocated chunk looks like this:
-
-
- chunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | Size of chunk, in bytes |P|
- mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | User data starts here... .
- . .
- . (malloc_usable_space() bytes) .
- . |
-nextchunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | Size of next chunk |1|
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-
-
- Where "chunk" is the front of the chunk for the purpose of most of
- the malloc code, but "mem" is the pointer that is returned to the
- user. "Nextchunk" is the beginning of the next contiguous chunk.
-
- Chunks always begin on odd-word boundries, so the mem portion
- (which is returned to the user) is on an even word boundary, and
- thus double-word aligned.
-
- Free chunks are stored in circular doubly-linked lists, and look like this:
-
- chunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- `head:' | Size of chunk, in bytes |P|
- mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | Forward pointer to next chunk in list |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | Back pointer to previous chunk in list |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | Unused space (may be 0 bytes long) .
- . .
- . |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- `foot:' | Size of chunk, in bytes |
-nextchunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | Size of next chunk |0|
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-
- The P (PREV_INUSE) bit, stored in the unused low-order bit of the
- chunk size (which is always a multiple of two words), is an in-use
- bit for the *previous* chunk. If that bit is *clear*, then the
- word before the current chunk size contains the previous chunk
- size, and can be used to find the front of the previous chunk.
- (The very first chunk allocated always has this bit set,
- preventing access to non-existent (or non-owned) memory.)
-
- The two exceptions to all this are
-
- 1. The special chunk `top', which doesn't bother using the
- trailing size field since there is no
- next contiguous chunk that would have to index off it. (After
- initialization, `top' is forced to always exist. If it would
- become less than MINSIZE bytes long, it is replenished via
- malloc_extend_top.)
-
- 2. Chunks allocated via mmap, which have the second-lowest-order
- bit (IS_MMAPPED) set in their size fields. Because they are
- never merged or traversed from any other chunk, they have no
- foot size or inuse information.
-
- Available chunks are kept in any of several places (all declared below):
-
- * `av': An array of chunks serving as bin headers for consolidated
- chunks. Each bin is doubly linked. The bins are approximately
- proportionally (log) spaced. There are a lot of these bins
- (128). This may look excessive, but works very well in
- practice. All procedures maintain the invariant that no
- consolidated chunk physically borders another one. Chunks in
- bins are kept in size order, with ties going to the
- approximately least recently used chunk.
-
- The chunks in each bin are maintained in decreasing sorted order by
- size. This is irrelevant for the small bins, which all contain
- the same-sized chunks, but facilitates best-fit allocation for
- larger chunks. (These lists are just sequential. Keeping them in
- order almost never requires enough traversal to warrant using
- fancier ordered data structures.) Chunks of the same size are
- linked with the most recently freed at the front, and allocations
- are taken from the back. This results in LRU or FIFO allocation
- order, which tends to give each chunk an equal opportunity to be
- consolidated with adjacent freed chunks, resulting in larger free
- chunks and less fragmentation.
-
- * `top': The top-most available chunk (i.e., the one bordering the
- end of available memory) is treated specially. It is never
- included in any bin, is used only if no other chunk is
- available, and is released back to the system if it is very
- large (see M_TRIM_THRESHOLD).
-
- * `last_remainder': A bin holding only the remainder of the
- most recently split (non-top) chunk. This bin is checked
- before other non-fitting chunks, so as to provide better
- locality for runs of sequentially allocated chunks.
-
- * Implicitly, through the host system's memory mapping tables.
- If supported, requests greater than a threshold are usually
- serviced via calls to mmap, and then later released via munmap.
-
-*/
-
-
-
-
-
-
-/* sizes, alignments */
-
-#define SIZE_SZ (sizeof(size_t))
-#define MALLOC_ALIGNMENT (SIZE_SZ + SIZE_SZ)
-#define MALLOC_ALIGN_MASK (MALLOC_ALIGNMENT - 1)
-#define MINSIZE (sizeof(struct malloc_chunk))
-
-/* conversion from malloc headers to user pointers, and back */
-
-#define chunk2mem(p) ((Void_t*)((char*)(p) + SIZE_SZ))
-#define mem2chunk(mem) ((mchunkptr)((char*)(mem) - SIZE_SZ))
-
-/* pad request bytes into a usable size */
-
-#define request2size(req) \
- (((long)(req) < (long)(MINSIZE - SIZE_SZ)) ? MINSIZE : \
- (((req) + SIZE_SZ + MALLOC_ALIGN_MASK) & ~(MALLOC_ALIGN_MASK)))
-
-
-/* Check if m has acceptable alignment */
-
-#define aligned_OK(m) (((size_t)((m)) & (MALLOC_ALIGN_MASK)) == 0)
-
-
-
-
-/*
- Physical chunk operations
-*/
-
-
-/* size field is or'ed with PREV_INUSE when previous adjacent chunk in use */
-
-#define PREV_INUSE 0x1
-
-/* size field is or'ed with IS_MMAPPED if the chunk was obtained with mmap() */
-
-#define IS_MMAPPED 0x2
-
-/* Bits to mask off when extracting size */
-
-#define SIZE_BITS (PREV_INUSE|IS_MMAPPED)
-
-
-/* Ptr to next physical malloc_chunk. */
-
-#define next_chunk(p) ((mchunkptr)( ((char*)(p)) + ((p)->size & ~PREV_INUSE) ))
-
-/* Ptr to previous physical malloc_chunk */
-
-#define prev_chunk(p)\
- ((mchunkptr)( ((char*)(p)) - *((size_t*)((char*)(p) - SIZE_SZ))))
-
-
-/* Treat space at ptr + offset as a chunk */
-
-#define chunk_at_offset(p, s) ((mchunkptr)(((char*)(p)) + (s)))
-
-
-
-
-/*
- Dealing with use bits
-*/
-
-/* extract p's inuse bit */
-
-#define inuse(p)\
-((((mchunkptr)(((char*)(p))+((p)->size & ~PREV_INUSE)))->size) & PREV_INUSE)
-
-/* extract inuse bit of previous chunk */
-
-#define prev_inuse(p) ((p)->size & PREV_INUSE)
-
-/* check for mmap()'ed chunk */
-
-#define chunk_is_mmapped(p) ((p)->size & IS_MMAPPED)
-
-/* set/clear chunk as in use without otherwise disturbing */
-
-#define set_inuse(p)\
-((mchunkptr)(((char*)(p)) + ((p)->size & ~PREV_INUSE)))->size |= PREV_INUSE
-
-#define clear_inuse(p)\
-((mchunkptr)(((char*)(p)) + ((p)->size & ~PREV_INUSE)))->size &= ~(PREV_INUSE)
-
-/* check/set/clear inuse bits in known places */
-
-#define inuse_bit_at_offset(p, s)\
- (((mchunkptr)(((char*)(p)) + (s)))->size & PREV_INUSE)
-
-#define set_inuse_bit_at_offset(p, s)\
- (((mchunkptr)(((char*)(p)) + (s)))->size |= PREV_INUSE)
-
-#define clear_inuse_bit_at_offset(p, s)\
- (((mchunkptr)(((char*)(p)) + (s)))->size &= ~(PREV_INUSE))
-
-
-
-
-/*
- Dealing with size fields
-*/
-
-/* Get size, ignoring use bits */
-
-#define chunksize(p) ((p)->size & ~(SIZE_BITS))
-
-/* Set size at head, without disturbing its use bit */
-
-#define set_head_size(p, s) ((p)->size = (((p)->size & PREV_INUSE) | (s)))
-
-/* Set size/use ignoring previous bits in header */
-
-#define set_head(p, s) ((p)->size = (s))
-
-/* Set size at footer (only when chunk is not in use) */
-
-#define set_foot(p, s) (*((size_t*)((char*)(p) + (s) - SIZE_SZ)) = (s))
-
-/* Get size of previous (but not inuse) chunk */
-
-#define prev_size(p) (*((size_t*)((char*)(p) - SIZE_SZ)))
-
-
-
-
-
-/*
- Bins
-
- The bins, `av_' are an array of pairs of pointers serving as the
- heads of (initially empty) doubly-linked lists of chunks, laid out
- in a way so that each pair can be treated as if it were in a
- malloc_chunk. (This way, the fd/bk offsets for linking bin heads
- and chunks are the same).
-
- Bins for sizes < 512 bytes contain chunks of all the same size, spaced
- 8 bytes apart. Larger bins are approximately logarithmically
- spaced. (See the table below.) The `av_' array is never mentioned
- directly in the code, but instead via bin access macros.
-
- Bin layout:
-
- 64 bins of size 8
- 32 bins of size 64
- 16 bins of size 512
- 8 bins of size 4096
- 4 bins of size 32768
- 2 bins of size 262144
- 1 bin of size what's left
-
- There is actually a little bit of slop in the numbers in bin_index
- for the sake of speed. This makes no difference elsewhere.
-
- The special chunks `top' and `last_remainder' get their own bins,
- (this is implemented via yet more trickery with the av_ array),
- although `top' is never properly linked to its bin since it is
- always handled specially.
-
-*/
-
-#define NAV 128 /* number of bins */
-
-typedef struct malloc_chunk* mbinptr;
-
-/* access macros */
-
-#define bin_at(i) ((mbinptr)(&(av_[2 * (i)])))
-#define next_bin(b) ((mbinptr)((char*)(b) + 2 * sizeof(mbinptr)))
-
-/*
- The first 2 bins are never indexed. The corresponding av_ cells are instead
- used for bookkeeping. This is not to save space, but to simplify
- indexing, maintain locality, and avoid some initialization tests.
-*/
-
-#define top (bin_at(0)->fd) /* The topmost chunk */
-#define last_remainder (bin_at(1)) /* remainder from last split */
-
-
-/*
- Because top initially points to its own bin with initial
- zero size, thus forcing extension on the first malloc request,
- we avoid having any special code in malloc to check whether
- it even exists yet. But we still need to in malloc_extend_top.
-*/
-
-#define initial_top ((mchunkptr)(av_))
-
-/* Helper macro to initialize bins */
-
-#define IAV(i) (mbinptr)(av_ + 2 * i), (mbinptr)(av_ + 2 * i)
-
-static mbinptr av_[NAV * 2 + 2] = {
- 0,
- IAV(0), IAV(1), IAV(2), IAV(3), IAV(4), IAV(5), IAV(6), IAV(7),
- IAV(8), IAV(9), IAV(10), IAV(11), IAV(12), IAV(13), IAV(14), IAV(15),
- IAV(16), IAV(17), IAV(18), IAV(19), IAV(20), IAV(21), IAV(22), IAV(23),
- IAV(24), IAV(25), IAV(26), IAV(27), IAV(28), IAV(29), IAV(30), IAV(31),
- IAV(32), IAV(33), IAV(34), IAV(35), IAV(36), IAV(37), IAV(38), IAV(39),
- IAV(40), IAV(41), IAV(42), IAV(43), IAV(44), IAV(45), IAV(46), IAV(47),
- IAV(48), IAV(49), IAV(50), IAV(51), IAV(52), IAV(53), IAV(54), IAV(55),
- IAV(56), IAV(57), IAV(58), IAV(59), IAV(60), IAV(61), IAV(62), IAV(63),
- IAV(64), IAV(65), IAV(66), IAV(67), IAV(68), IAV(69), IAV(70), IAV(71),
- IAV(72), IAV(73), IAV(74), IAV(75), IAV(76), IAV(77), IAV(78), IAV(79),
- IAV(80), IAV(81), IAV(82), IAV(83), IAV(84), IAV(85), IAV(86), IAV(87),
- IAV(88), IAV(89), IAV(90), IAV(91), IAV(92), IAV(93), IAV(94), IAV(95),
- IAV(96), IAV(97), IAV(98), IAV(99), IAV(100), IAV(101), IAV(102), IAV(103),
- IAV(104), IAV(105), IAV(106), IAV(107), IAV(108), IAV(109), IAV(110), IAV(111),
- IAV(112), IAV(113), IAV(114), IAV(115), IAV(116), IAV(117), IAV(118), IAV(119),
- IAV(120), IAV(121), IAV(122), IAV(123), IAV(124), IAV(125), IAV(126), IAV(127),
- 0
-};
-
-
-
-/* field-extraction macros */
-
-#define first(b) ((b)->fd)
-#define last(b) ((b)->bk)
-
-/*
- Indexing into bins
-*/
-
-#define bin_index(sz) \
-(((((unsigned long)(sz)) >> 9) == 0) ? (((unsigned long)(sz)) >> 3): \
- ((((unsigned long)(sz)) >> 9) <= 4) ? 56 + (((unsigned long)(sz)) >> 6): \
- ((((unsigned long)(sz)) >> 9) <= 20) ? 91 + (((unsigned long)(sz)) >> 9): \
- ((((unsigned long)(sz)) >> 9) <= 84) ? 110 + (((unsigned long)(sz)) >> 12): \
- ((((unsigned long)(sz)) >> 9) <= 340) ? 119 + (((unsigned long)(sz)) >> 15): \
- ((((unsigned long)(sz)) >> 9) <= 1364) ? 124 + (((unsigned long)(sz)) >> 18): \
- 126)
-/*
- bins for chunks < 512 are all spaced 8 bytes apart, and hold
- identically sized chunks. This is exploited in malloc.
-*/
-
-#define MAX_SMALLBIN 63
-#define MAX_SMALLBIN_SIZE 512
-#define SMALLBIN_WIDTH 8
-
-#define smallbin_index(sz) (((unsigned long)(sz)) >> 3)
-
-/*
- Requests are `small' if both the corresponding and the next bin are small
-*/
-
-#define is_small_request(nb) (nb < MAX_SMALLBIN_SIZE - SMALLBIN_WIDTH)
-
-
-
-/*
- To help compensate for the large number of bins, a one-level index
- structure is used for bin-by-bin searching. `binblocks' is a
- one-word bitvector recording whether groups of BINBLOCKWIDTH bins
- have any (possibly) non-empty bins, so they can be skipped over
- all at once during during traversals. The bits are NOT always
- cleared as soon as all bins in a block are empty, but instead only
- when all are noticed to be empty during traversal in malloc.
-*/
-
-#define BINBLOCKWIDTH 4 /* bins per block */
-
-#define binblocks (bin_at(0)->size) /* bitvector of nonempty blocks */
-
-/* bin<->block macros */
-
-#define idx2binblock(ix) (1 << (ix / BINBLOCKWIDTH))
-#define mark_binblock(ii) (binblocks |= idx2binblock(ii))
-#define clear_binblock(ii) (binblocks &= ~(idx2binblock(ii)))
-
-
-
-
-/* Other static bookkeeping data */
-
-/* variables holding tunable values */
-
-static unsigned long trim_threshold = DEFAULT_TRIM_THRESHOLD;
-static unsigned long top_pad = DEFAULT_TOP_PAD;
-static unsigned int n_mmaps_max = DEFAULT_MMAP_MAX;
-static unsigned long mmap_threshold = DEFAULT_MMAP_THRESHOLD;
-
-/* The first value returned from sbrk */
-static char* sbrk_base = (char*)(-1);
-
-/* The maximum memory obtained from system via sbrk */
-static unsigned long max_sbrked_mem = 0;
-
-/* The maximum via either sbrk or mmap */
-static unsigned long max_total_mem = 0;
-
-/* internal working copy of mallinfo */
-static struct mallinfo current_mallinfo = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
-
-/* The total memory obtained from system via sbrk */
-#define sbrked_mem (current_mallinfo.arena)
-
-/* Tracking mmaps */
-
-static unsigned int n_mmaps = 0;
-static unsigned int max_n_mmaps = 0;
-static unsigned long mmapped_mem = 0;
-static unsigned long max_mmapped_mem = 0;
-
-
-
-/*
- Debugging support
-*/
-
-#if DEBUG
-
-
-/*
- These routines make a number of assertions about the states
- of data structures that should be true at all times. If any
- are not true, it's very likely that a user program has somehow
- trashed memory. (It's also possible that there is a coding error
- in malloc. In which case, please report it!)
-*/
-
-#if __STD_C
-static void do_check_chunk(mchunkptr p)
-#else
-static void do_check_chunk(p) mchunkptr p;
-#endif
-{
- size_t sz = p->size & ~PREV_INUSE;
-
- /* No checkable chunk is mmapped */
- assert(!chunk_is_mmapped(p));
-
- /* Check for legal address ... */
- assert((char*)p >= sbrk_base);
- if (p != top)
- assert((char*)p + sz <= (char*)top);
- else
- assert((char*)p + sz <= sbrk_base + sbrked_mem);
-
-}
-
-
-#if __STD_C
-static void do_check_free_chunk(mchunkptr p)
-#else
-static void do_check_free_chunk(p) mchunkptr p;
-#endif
-{
- size_t sz = p->size & ~PREV_INUSE;
- mchunkptr next = chunk_at_offset(p, sz);
-
- do_check_chunk(p);
-
- /* Check whether it claims to be free ... */
- assert(!inuse(p));
-
- /* Unless a special marker, must have OK fields */
- if ((long)sz >= (long)MINSIZE)
- {
- assert((sz & MALLOC_ALIGN_MASK) == 0);
- assert((((size_t)((char*)(p) + SIZE_SZ)) & MALLOC_ALIGN_MASK) == 0);
- /* ... matching footer field */
- assert(*((size_t*)((char*)(p) + sz - SIZE_SZ)) == sz);
- /* ... and is fully consolidated */
- assert(prev_inuse(p));
- assert (next == top || inuse(next));
-
- /* ... and has minimally sane links */
- assert(p->fd->bk == p);
- assert(p->bk->fd == p);
- }
- else /* markers are always of size SIZE_SZ */
- assert(sz == SIZE_SZ);
-}
-
-#if __STD_C
-static void do_check_inuse_chunk(mchunkptr p)
-#else
-static void do_check_inuse_chunk(p) mchunkptr p;
-#endif
-{
- mchunkptr next = next_chunk(p);
- do_check_chunk(p);
-
- /* Check whether it claims to be in use ... */
- assert(inuse(p));
-
- /* ... and is surrounded by OK chunks.
- Since more things can be checked with free chunks than inuse ones,
- if an inuse chunk borders them and debug is on, it's worth doing them.
- */
- if (!prev_inuse(p))
- {
- mchunkptr prv = prev_chunk(p);
- assert(next_chunk(prv) == p);
- do_check_free_chunk(prv);
- }
- if (next == top)
- assert(prev_inuse(next));
- else if (!inuse(next))
- do_check_free_chunk(next);
-
-}
-
-#if __STD_C
-static void do_check_malloced_chunk(mchunkptr p, size_t s)
-#else
-static void do_check_malloced_chunk(p, s) mchunkptr p; size_t s;
-#endif
-{
- size_t sz = p->size & ~PREV_INUSE;
- long room = sz - s;
-
- do_check_inuse_chunk(p);
-
- /* Legal size ... */
- assert((long)sz >= (long)MINSIZE);
- assert((sz & MALLOC_ALIGN_MASK) == 0);
- assert(room >= 0);
- assert(room < (long)MINSIZE);
-
- /* ... and alignment */
- assert((((size_t)((char*)(p) + SIZE_SZ)) & MALLOC_ALIGN_MASK) == 0);
-
-
- /* ... and was allocated at front of an available chunk */
- assert(prev_inuse(p));
-
-}
-
-
-#define check_free_chunk(P) do_check_free_chunk(P)
-#define check_inuse_chunk(P) do_check_inuse_chunk(P)
-#define check_chunk(P) do_check_chunk(P)
-#define check_malloced_chunk(P,N) do_check_malloced_chunk(P,N)
-#else
-#define check_free_chunk(P)
-#define check_inuse_chunk(P)
-#define check_chunk(P)
-#define check_malloced_chunk(P,N)
-#endif
-
-
-
-/*
- Macro-based internal utilities
-*/
-
-
-/*
- Linking chunks in bin lists.
- Call these only with variables, not arbitrary expressions, as arguments.
-*/
-
-/*
- Place chunk p of size s in its bin, in size order,
- putting it ahead of others of same size.
-*/
-
-
-#define frontlink(P, S, IDX, BK, FD) \
-{ \
- if (S < MAX_SMALLBIN_SIZE) \
- { \
- IDX = smallbin_index(S); \
- mark_binblock(IDX); \
- BK = bin_at(IDX); \
- FD = BK->fd; \
- P->bk = BK; \
- P->fd = FD; \
- FD->bk = BK->fd = P; \
- } \
- else \
- { \
- IDX = bin_index(S); \
- BK = bin_at(IDX); \
- FD = BK->fd; \
- if (FD == BK) mark_binblock(IDX); \
- else \
- { \
- while (FD != BK && S < chunksize(FD)) FD = FD->fd; \
- BK = FD->bk; \
- } \
- P->bk = BK; \
- P->fd = FD; \
- FD->bk = BK->fd = P; \
- } \
-}
-
-
-/* take a chunk off a list */
-
-#define unlink(P, BK, FD) \
-{ \
- BK = P->bk; \
- FD = P->fd; \
- FD->bk = BK; \
- BK->fd = FD; \
-} \
-
-/* Place p as the last remainder */
-
-#define link_last_remainder(P) \
-{ \
- last_remainder->fd = last_remainder->bk = P; \
- P->fd = P->bk = last_remainder; \
-}
-
-/* Clear the last_remainder bin */
-
-#define clear_last_remainder \
- (last_remainder->fd = last_remainder->bk = last_remainder)
-
-
-
-
-
-
-/* Routines dealing with mmap(). */
-
-#if HAVE_MMAP
-
-#if __STD_C
-static mchunkptr mmap_chunk(size_t size)
-#else
-static mchunkptr mmap_chunk(size) size_t size;
-#endif
-{
- size_t offset = (MALLOC_ALIGNMENT) - SIZE_SZ;
- size_t page_mask = malloc_getpagesize - 1;
- char *cp;
- mchunkptr p;
-
-#ifndef MAP_ANONYMOUS
- static int fd = -1;
-#endif
-
- if(n_mmaps >= n_mmaps_max) return 0; /* too many regions */
-
- /* The offset to the start of the mmapped region is stored
- * in a size_t field immediately before the chunk.
- */
- size = (size + offset + page_mask) & ~page_mask;
-
-#ifdef MAP_ANONYMOUS
- cp = (char *)mmap(0, size, PROT_READ|PROT_WRITE,
- MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
-#else /* !MAP_ANONYMOUS */
- if (fd < 0)
- {
- fd = open("/dev/zero", O_RDWR);
- if(fd < 0) return 0;
- }
- cp = (char *)mmap(0, size, PROT_READ|PROT_WRITE, MAP_PRIVATE, fd, 0);
-#endif
-
- if(cp == (char *)-1) return 0;
-
- n_mmaps++;
- if (n_mmaps > max_n_mmaps) max_n_mmaps = n_mmaps;
-
- p = (mchunkptr)(cp + offset);
-
- /* We demand that eight bytes into a page must be 8-byte aligned. */
- assert(aligned_OK(chunk2mem(p)));
-
- *((size_t *)p - 1) = offset;
- set_head(p, (size - offset)|IS_MMAPPED);
-
- mmapped_mem += size;
- if ((unsigned long)mmapped_mem > (unsigned long)max_mmapped_mem)
- max_mmapped_mem = mmapped_mem;
- if ((unsigned long)(mmapped_mem + sbrked_mem) > (unsigned long)max_total_mem)
- max_total_mem = mmapped_mem + sbrked_mem;
- return p;
-}
-
-#if __STD_C
-static void munmap_chunk(mchunkptr p)
-#else
-static void munmap_chunk(p) mchunkptr p;
-#endif
-{
- size_t offset = *((size_t *)p - 1);
- size_t size = chunksize(p);
- int ret;
-
- assert (chunk_is_mmapped(p));
- assert(! ((char*)p >= sbrk_base && (char*)p < sbrk_base + sbrked_mem));
- assert((n_mmaps > 0));
- assert(((size + offset) & (malloc_getpagesize-1)) == 0);
-
- ret = munmap((char *)p - offset, size + offset);
-
- /* munmap returns non-zero on failure */
- assert(ret == 0);
-
- n_mmaps--;
- mmapped_mem -= (size + offset);
-}
-
-#endif /* HAVE_MMAP */
-
-
-
-
-/*
- Extend the top-most chunk by obtaining memory from system.
- Main interface to sbrk (but see also malloc_trim).
-*/
-
-#if __STD_C
-static void malloc_extend_top(size_t nb)
-#else
-static void malloc_extend_top(nb) size_t nb;
-#endif
-{
- char* brk; /* return value from sbrk */
- size_t front_misalign; /* unusable bytes at front of sbrked space */
- size_t correction; /* bytes for 2nd sbrk call */
- char* new_brk; /* return of 2nd sbrk call */
- size_t top_size; /* new size of top chunk */
-
- mchunkptr old_top = top; /* Record state of old top */
- size_t old_top_size = chunksize(old_top);
- char* old_end = (char*)(chunk_at_offset(old_top, old_top_size));
-
- /* Pad request with top_pad plus minimal overhead */
-
- size_t sbrk_size = nb + top_pad + MINSIZE;
- unsigned long pagesz = malloc_getpagesize;
-
- /* If not the first time through, round to preserve page boundary */
- /* Otherwise, we need to correct to a page size below anyway. */
- /* (We also correct below if an intervening foreign sbrk call.) */
-
- if (sbrk_base != (char*)(-1))
- sbrk_size = (sbrk_size + (pagesz - 1)) & ~(pagesz - 1);
-
- brk = (char*)(MORECORE (sbrk_size));
-
- /* Fail if sbrk failed or if a foreign sbrk call killed our space */
- if (brk == (char*)(MORECORE_FAILURE) ||
- (brk < old_end && old_top != initial_top))
- return;
-
- sbrked_mem += sbrk_size;
-
- if (brk == old_end) /* can just add bytes to current top */
- {
- top_size = sbrk_size + old_top_size;
- set_head(top, top_size | PREV_INUSE);
- }
- else
- {
- if (sbrk_base == (char*)(-1)) /* First time through. Record base */
- sbrk_base = brk;
- else /* Someone else called sbrk(). Count those bytes as sbrked_mem. */
- sbrked_mem += brk - (char*)old_end;
-
- /* Guarantee alignment of first new chunk made from this space */
- front_misalign = (size_t)chunk2mem(brk) & MALLOC_ALIGN_MASK;
- if (front_misalign > 0)
- {
- correction = (MALLOC_ALIGNMENT) - front_misalign;
- brk += correction;
- }
- else
- correction = 0;
-
- /* Guarantee the next brk will be at a page boundary */
- correction += pagesz - ((size_t)(brk + sbrk_size) & (pagesz - 1));
-
- /* Allocate correction */
- new_brk = (char*)(MORECORE (correction));
- if (new_brk == (char*)(MORECORE_FAILURE)) return;
-
- sbrked_mem += correction;
-
- top = (mchunkptr)brk;
- top_size = new_brk - brk + correction;
- set_head(top, top_size | PREV_INUSE);
-
- if (old_top != initial_top)
- {
- /* There must have been an intervening foreign sbrk call. */
- /* A double fencepost is necessary to prevent consolidation */
- chunk_at_offset(old_top, old_top_size - 2*SIZE_SZ)->size =
- SIZE_SZ|PREV_INUSE;
- chunk_at_offset(old_top, old_top_size - SIZE_SZ)->size =
- SIZE_SZ|PREV_INUSE;
-
- /* Also keep size a multiple of MINSIZE */
- old_top_size = (old_top_size - 2*SIZE_SZ) & MALLOC_ALIGN_MASK;
- chunk_at_offset(old_top, old_top_size )->size =
- SIZE_SZ|PREV_INUSE;
- chunk_at_offset(old_top, old_top_size + SIZE_SZ)->size =
- SIZE_SZ|PREV_INUSE;
- set_head_size(old_top, old_top_size);
- /* If possible, release the rest. */
- if (old_top_size >= MINSIZE)
- fREe(chunk2mem(old_top));
- }
- }
-
- if ((unsigned long)sbrked_mem > (unsigned long)max_sbrked_mem)
- max_sbrked_mem = sbrked_mem;
- if ((unsigned long)(mmapped_mem + sbrked_mem) > (unsigned long)max_total_mem)
- max_total_mem = mmapped_mem + sbrked_mem;
-
- /* We always land on a page boundary */
- assert(((size_t)((char*)top + top_size) & (pagesz - 1)) == 0);
-}
-
-
-
-
-/* Main public routines */
-
-
-/*
- Malloc Algorthim:
-
- The requested size is first converted into a usable form, `nb'.
- This currently means to add 4 bytes overhead plus possibly more to
- obtain 8-byte alignment and/or to obtain a size of at least
- MINSIZE (currently 16 bytes), the smallest allocatable size.
- (All fits are considered `exact' if they are within MINSIZE bytes.)
-
- From there, the first successful of the following steps is taken:
-
- 1. The bin corresponding to the request size is scanned, and if
- a chunk of exactly the right size is found, it is taken.
-
- 2. The most recently remaindered chunk is used if it is big
- enough. This is a form of (roving) first fit, used only in
- the absence of exact fits. Runs of consecutive requests use
- the remainder of the chunk used for the previous such request
- whenever possible. This limited use of a first-fit style
- allocation strategy tends to give contiguous chunks
- coextensive lifetimes, which improves locality and can reduce
- fragmentation in the long run.
-
- 3. Other bins are scanned in increasing size order, using a
- chunk big enough to fulfill the request, and splitting off
- any remainder. This search is strictly by best-fit; i.e.,
- the smallest (with ties going to approximately the least
- recently used) chunk that fits is selected.
-
- 4. If large enough, the chunk bordering the end of memory
- (`top') is split off. (This use of `top' is in accord with
- the best-fit search rule. In effect, `top' is treated as
- larger (and thus less well fitting) than any other available
- chunk since it can be extended to be as large as necessary
- (up to system limitations).
-
- 5. If the request size meets the mmap threshold and the
- system supports mmap, and there are few enough currently
- allocated mmapped regions, and a call to mmap succeeds,
- the request is allocated via direct memory mapping.
-
- 6. Otherwise, the top of memory is extended by
- obtaining more space from the system (normally using sbrk,
- but definable to anything else via the MORECORE macro).
- Memory is gathered from the system (in system page-sized
- units) in a way that allows chunks obtained across different
- sbrk calls to be consolidated, but does not require
- contiguous memory. Thus, it should be safe to intersperse
- mallocs with other sbrk calls.
-
-
- All allocations are made from the the `lowest' part of any found
- chunk. (The implementation invariant is that prev_inuse is
- always true of any allocated chunk; i.e., that each allocated
- chunk borders either a previously allocated and still in-use chunk,
- or the base of its memory arena.)
-
-*/
-
-#if __STD_C
-Void_t* mALLOc(size_t bytes)
-#else
-Void_t* mALLOc(bytes) size_t bytes;
-#endif
-{
- mchunkptr victim; /* inspected/selected chunk */
- size_t victim_size; /* its size */
- int idx; /* index for bin traversal */
- mbinptr bin; /* associated bin */
- mchunkptr remainder; /* remainder from a split */
- long remainder_size; /* its size */
- int remainder_index; /* its bin index */
- unsigned long block; /* block traverser bit */
- int startidx; /* first bin of a traversed block */
- mchunkptr fwd; /* misc temp for linking */
- mchunkptr bck; /* misc temp for linking */
-
- size_t nb = request2size(bytes); /* padded request size; */
-
- /* Check for exact match in a bin */
-
- if (is_small_request(nb)) /* Faster version for small requests */
- {
- idx = smallbin_index(nb);
-
- /* No traversal or size check necessary for small bins. */
- /* Also scan the next one, since it would have a remainder < MINSIZE */
-
- if ( ((victim = last(bin_at(idx))) != bin_at(idx)) ||
- ((victim = last(bin_at(idx+1))) != bin_at(idx+1)))
- {
- victim_size = chunksize(victim);
- unlink(victim, bck, fwd);
- set_inuse_bit_at_offset(victim, victim_size);
- check_malloced_chunk(victim, nb);
- return chunk2mem(victim);
- }
-
- idx += 2; /* Set for bin scan below. We've already scanned 2 bins. */
-
- }
- else
- {
- idx = bin_index(nb);
- bin = bin_at(idx);
-
- for (victim = last(bin); victim != bin; victim = victim->bk)
- {
- victim_size = chunksize(victim);
- remainder_size = victim_size - nb;
-
- if (remainder_size >= (long)MINSIZE) /* too big */
- {
- --idx; /* adjust to rescan below after checking last remainder */
- break;
- }
-
- else if (remainder_size >= 0) /* exact fit */
- {
- unlink(victim, bck, fwd);
- set_inuse_bit_at_offset(victim, victim_size);
- check_malloced_chunk(victim, nb);
- return chunk2mem(victim);
- }
- }
-
- ++idx;
-
- }
-
- /* Try to use the last split-off remainder */
-
- if ( (victim = last_remainder->fd) != last_remainder)
- {
- victim_size = chunksize(victim);
- remainder_size = victim_size - nb;
-
- if (remainder_size >= (long)MINSIZE) /* re-split */
- {
- remainder = chunk_at_offset(victim, nb);
- set_head(victim, nb | PREV_INUSE);
- link_last_remainder(remainder);
- set_head(remainder, remainder_size | PREV_INUSE);
- set_foot(remainder, remainder_size);
- check_malloced_chunk(victim, nb);
- return chunk2mem(victim);
- }
-
- clear_last_remainder;
-
- if (remainder_size >= 0) /* exhaust */
- {
- set_inuse_bit_at_offset(victim, victim_size);
- check_malloced_chunk(victim, nb);
- return chunk2mem(victim);
- }
-
- /* Else place in bin */
-
- frontlink(victim, victim_size, remainder_index, bck, fwd);
- }
-
- /*
- If there are any possibly nonempty big-enough blocks,
- search for best fitting chunk by scanning bins in blockwidth units.
- */
-
- if ( (block = idx2binblock(idx)) <= binblocks)
- {
-
- /* Get to the first marked block */
-
- if ( (block & binblocks) == 0)
- {
- /* force to an even block boundary */
- idx = (idx & ~(BINBLOCKWIDTH - 1)) + BINBLOCKWIDTH;
- block <<= 1;
- while ((block & binblocks) == 0)
- {
- idx += BINBLOCKWIDTH;
- block <<= 1;
- }
- }
-
- /* For each possibly nonempty block ... */
- for (;;)
- {
- startidx = idx; /* (track incomplete blocks) */
-
- /* For each bin in this block ... */
- do
- {
- bin = bin_at(idx);
-
- /* Find and use first big enough chunk ... */
-
- for (victim = last(bin); victim != bin; victim = victim->bk)
- {
- victim_size = chunksize(victim);
- remainder_size = victim_size - nb;
-
- if (remainder_size >= (long)MINSIZE) /* split */
- {
- remainder = chunk_at_offset(victim, nb);
- set_head(victim, nb | PREV_INUSE);
- unlink(victim, bck, fwd);
- link_last_remainder(remainder);
- set_head(remainder, remainder_size | PREV_INUSE);
- set_foot(remainder, remainder_size);
- check_malloced_chunk(victim, nb);
- return chunk2mem(victim);
- }
-
- else if (remainder_size >= 0) /* take */
- {
- set_inuse_bit_at_offset(victim, victim_size);
- unlink(victim, bck, fwd);
- check_malloced_chunk(victim, nb);
- return chunk2mem(victim);
- }
-
- }
-
- } while ((++idx & (BINBLOCKWIDTH - 1)) != 0);
-
- /* Clear out the block bit. */
-
- do /* Possibly backtrack to try to clear a partial block */
- {
- if ((startidx & (BINBLOCKWIDTH - 1)) == 0)
- {
- binblocks &= ~block;
- break;
- }
- --startidx;
- } while (first(bin_at(startidx)) == bin_at(startidx));
-
- /* Get to the next possibly nonempty block */
-
- if ( (block <<= 1) <= binblocks && (block != 0) )
- {
- while ((block & binblocks) == 0)
- {
- idx += BINBLOCKWIDTH;
- block <<= 1;
- }
- }
- else
- break;
- }
- }
-
-
- /* Try to use top chunk */
-
- /* Require that there be a remainder, ensuring top always exists */
- if ( (remainder_size = chunksize(top) - nb) < (long)MINSIZE)
- {
-
-#if HAVE_MMAP
- /* If big and would otherwise need to extend, try to use mmap instead */
- if ((unsigned long)nb >= (unsigned long)mmap_threshold &&
- (victim = mmap_chunk(nb)) != 0)
- return chunk2mem(victim);
-#endif
-
- /* Try to extend */
- malloc_extend_top(nb);
- if ( (remainder_size = chunksize(top) - nb) < (long)MINSIZE)
- return 0; /* propagate failure */
- }
-
- victim = top;
- set_head(victim, nb | PREV_INUSE);
- top = chunk_at_offset(victim, nb);
- set_head(top, remainder_size | PREV_INUSE);
- check_malloced_chunk(victim, nb);
- return chunk2mem(victim);
-
-}
-
-
-
-
-/*
-
- free() algorithm :
-
- cases:
-
- 1. free(0) has no effect.
-
- 2. If the chunk was allocated via mmap, it is release via munmap().
-
- 3. If a returned chunk borders the current high end of memory,
- it is consolidated into the top, and if the total unused
- topmost memory exceeds the trim threshold, malloc_trim is
- called.
-
- 4. Other chunks are consolidated as they arrive, and
- placed in corresponding bins. (This includes the case of
- consolidating with the current `last_remainder').
-
-*/
-
-
-#if __STD_C
-void fREe(Void_t* mem)
-#else
-void fREe(mem) Void_t* mem;
-#endif
-{
- mchunkptr p; /* chunk corresponding to mem */
- size_t hd; /* its head field */
- size_t sz; /* its size */
- int idx; /* its bin index */
- mchunkptr next; /* next contiguous chunk */
- size_t nextsz; /* its size */
- size_t prevsz; /* size of previous contiguous chunk */
- mchunkptr bck; /* misc temp for linking */
- mchunkptr fwd; /* misc temp for linking */
- int islr; /* track whther merging with last_remainder */
-
- if (mem == 0) /* free(0) has no effect */
- return;
-
- p = mem2chunk(mem);
- hd = p->size;
-
-#if HAVE_MMAP
- if (hd & IS_MMAPPED) /* release mmapped memory. */
- {
- munmap_chunk(p);
- return;
- }
-#endif
-
- check_inuse_chunk(p);
-
- sz = hd & ~PREV_INUSE;
- next = chunk_at_offset(p, sz);
- nextsz = chunksize(next);
-
- if (next == top) /* merge with top */
- {
- sz += nextsz;
-
- if (!(hd & PREV_INUSE)) /* consolidate backward */
- {
- prevsz = prev_size(p);
- p = chunk_at_offset(p, -prevsz);
- sz += prevsz;
- unlink(p, bck, fwd);
- }
-
- set_head(p, sz | PREV_INUSE);
- top = p;
- if ((unsigned long)(sz) >= (unsigned long)trim_threshold)
- malloc_trim(top_pad);
- return;
- }
-
- set_head(next, nextsz); /* clear inuse bit */
-
- islr = 0;
-
- if (!(hd & PREV_INUSE)) /* consolidate backward */
- {
- prevsz = prev_size(p);
- p = chunk_at_offset(p, -prevsz);
- sz += prevsz;
-
- if (p->fd == last_remainder) /* keep as last_remainder */
- islr = 1;
- else
- unlink(p, bck, fwd);
- }
-
- if (!(inuse_bit_at_offset(next, nextsz))) /* consolidate forward */
- {
- sz += nextsz;
-
- if (!islr && next->fd == last_remainder) /* re-insert last_remainder */
- {
- islr = 1;
- link_last_remainder(p);
- }
- else
- unlink(next, bck, fwd);
- }
-
-
- set_head(p, sz | PREV_INUSE);
- set_foot(p, sz);
- if (!islr)
- frontlink(p, sz, idx, bck, fwd);
-}
-
-
-
-
-
-/*
-
- Realloc algorithm:
-
- If the reallocation is for additional space, and the chunk can be
- extended, it is, else a malloc-copy-free sequence is taken. There
- are several different ways that a chunk could be extended. All are
- tried:
-
- * Extending forward into following adjacent free chunk.
- * Shifting backwards, joining preceding adjacent space
- * Both shifting backwards and extending forward.
- * Extending into newly sbrked space
-
-
- If the reallocation is for less space, the trailing space is
- lopped off and freed. Unless the #define REALLOC_ZERO_BYTES_FREES
- is set, realloc with a size argument of zero (re)allocates a
- minimum-sized chunk.
-
- Chunks that were obtained via mmap cannot be extended or shrunk.
- If their reallocation is for additional space, they are copied.
- If for less, they are just left alone.
-
- The old unix realloc convention of allowing the last-free'd chunk
- to be used as an argument to realloc is no longer supported.
- I don't know of any programs still relying on this feature,
- and allowing it would also allow too many other incorrect
- usages of realloc to be sensible.
-
-
-*/
-
-
-#if __STD_C
-Void_t* rEALLOc(Void_t* oldmem, size_t bytes)
-#else
-Void_t* rEALLOc(oldmem, bytes) Void_t* oldmem; size_t bytes;
-#endif
-{
- size_t nb; /* padded request size */
-
- mchunkptr oldp; /* chunk corresponding to oldmem */
- size_t oldsize; /* its size */
-
- mchunkptr newp; /* chunk to return */
- size_t newsize; /* its size */
- Void_t* newmem; /* corresponding user mem */
-
- mchunkptr next; /* next contiguous chunk after oldp */
- size_t nextsize; /* its size */
-
- mchunkptr prev; /* previous contiguous chunk before oldp */
- size_t prevsize; /* its size */
-
- mchunkptr remainder; /* holds split off extra space from newp */
- size_t remainder_size; /* its size */
-
- mchunkptr bck; /* misc temp for linking */
- mchunkptr fwd; /* misc temp for linking */
-
-#ifdef REALLOC_ZERO_BYTES_FREES
- if (bytes == 0) { fREe(oldmem); return 0; }
-#endif
-
-
- /* realloc of null is supposed to be same as malloc */
- if (oldmem == 0) return mALLOc(bytes);
-
- newp = oldp = mem2chunk(oldmem);
- newsize = oldsize = chunksize(oldp);
-
-
- nb = request2size(bytes);
-
-#if HAVE_MMAP
- if (chunk_is_mmapped(oldp))
- {
- if(oldsize >= nb) return oldmem; /* do nothing */
- /* Must alloc, copy, free. */
- newmem = mALLOc(bytes);
- if (newmem == 0) return 0; /* propagate failure */
- MALLOC_COPY(newmem, oldmem, oldsize - SIZE_SZ);
- munmap_chunk(oldp);
- return newmem;
- }
-#endif
-
- check_inuse_chunk(oldp);
-
- if ((long)(oldsize) < (long)(nb))
- {
-
- /* Try expanding forward */
-
- next = chunk_at_offset(oldp, oldsize);
- if (next == top || !inuse(next))
- {
- nextsize = chunksize(next);
-
- /* Forward into top only if a remainder */
- if (next == top)
- {
- if ((long)(nextsize + newsize) >= (long)(nb + MINSIZE))
- {
- newsize += nextsize;
- top = chunk_at_offset(oldp, nb);
- set_head(top, (newsize - nb) | PREV_INUSE);
- set_head_size(oldp, nb);
- return chunk2mem(oldp);
- }
- }
-
- /* Forward into next chunk */
- else if (((long)(nextsize + newsize) >= (long)(nb)))
- {
- unlink(next, bck, fwd);
- newsize += nextsize;
- goto split;
- }
- }
- else
- {
- next = 0;
- nextsize = 0;
- }
-
- /* Try shifting backwards. */
-
- if (!prev_inuse(oldp))
- {
- prev = prev_chunk(oldp);
- prevsize = chunksize(prev);
-
- /* try forward + backward first to save a later consolidation */
-
- if (next != 0)
- {
- /* into top */
- if (next == top)
- {
- if ((long)(nextsize + prevsize + newsize) >= (long)(nb + MINSIZE))
- {
- unlink(prev, bck, fwd);
- newp = prev;
- newsize += prevsize + nextsize;
- newmem = chunk2mem(newp);
- MALLOC_COPY(newmem, oldmem, oldsize - SIZE_SZ);
- top = chunk_at_offset(newp, nb);
- set_head(top, (newsize - nb) | PREV_INUSE);
- set_head_size(newp, nb);
- return chunk2mem(newp);
- }
- }
-
- /* into next chunk */
- else if (((long)(nextsize + prevsize + newsize) >= (long)(nb)))
- {
- unlink(next, bck, fwd);
- unlink(prev, bck, fwd);
- newp = prev;
- newsize += nextsize + prevsize;
- newmem = chunk2mem(newp);
- MALLOC_COPY(newmem, oldmem, oldsize - SIZE_SZ);
- goto split;
- }
- }
-
- /* backward only */
- if (prev != 0 && (long)(prevsize + newsize) >= (long)nb)
- {
- unlink(prev, bck, fwd);
- newp = prev;
- newsize += prevsize;
- newmem = chunk2mem(newp);
- MALLOC_COPY(newmem, oldmem, oldsize - SIZE_SZ);
- goto split;
- }
- }
-
- /* Must allocate */
-
- newmem = mALLOc (bytes);
-
- if (newmem == 0) /* propagate failure */
- return 0;
-
- /* Avoid copy if newp is next chunk after oldp. */
- /* (This can only happen when new chunk is sbrk'ed.) */
-
- if ( (newp = mem2chunk(newmem)) == next_chunk(oldp))
- {
- newsize += chunksize(newp);
- newp = oldp;
- goto split;
- }
-
- /* Otherwise copy, free, and exit */
- MALLOC_COPY(newmem, oldmem, oldsize - SIZE_SZ);
- fREe(oldmem);
- return newmem;
- }
-
- split: /* split off extra room in old or expanded chunk */
-
- if (newsize - nb >= MINSIZE) /* split off remainder */
- {
- remainder = chunk_at_offset(newp, nb);
- remainder_size = newsize - nb;
- set_head_size(newp, nb);
- set_head(remainder, remainder_size | PREV_INUSE);
- set_inuse_bit_at_offset(remainder, remainder_size);
- fREe(chunk2mem(remainder)); /* let free() deal with it */
- }
- else
- {
- set_head_size(newp, newsize);
- set_inuse_bit_at_offset(newp, newsize);
- }
-
- check_inuse_chunk(newp);
- return chunk2mem(newp);
-}
-
-
-
-
-/*
-
- memalign algorithm:
-
- memalign requests more than enough space from malloc, finds a spot
- within that chunk that meets the alignment request, and then
- possibly frees the leading and trailing space.
-
- The alignment argument must be a power of two. This property is not
- checked by memalign, so misuse may result in random runtime errors.
-
- 8-byte alignment is guaranteed by normal malloc calls, so don't
- bother calling memalign with an argument of 8 or less.
-
- Overreliance on memalign is a sure way to fragment space.
-
-*/
-
-
-#if __STD_C
-Void_t* mEMALIGn(size_t alignment, size_t bytes)
-#else
-Void_t* mEMALIGn(alignment, bytes) size_t alignment; size_t bytes;
-#endif
-{
- size_t nb; /* padded request size */
- char* m; /* memory returned by malloc call */
- mchunkptr p; /* corresponding chunk */
- char* brk; /* alignment point within p */
- mchunkptr newp; /* chunk to return */
- size_t newsize; /* its size */
- size_t leadsize; /* leading space befor alignment point */
- mchunkptr remainder; /* spare room at end to split off */
- long remainder_size; /* its size */
-
- /* If need less alignment than we give anyway, just relay to malloc */
-
- if (alignment <= MALLOC_ALIGNMENT) return mALLOc(bytes);
-
- /* Otherwise, ensure that it is at least a minimum chunk size */
-
- if (alignment < MINSIZE) alignment = MINSIZE;
-
- /* Call malloc with worst case padding to hit alignment. */
-
- nb = request2size(bytes);
- m = (char*)(mALLOc(nb + alignment + MINSIZE));
-
- if (m == 0) return 0; /* propagate failure */
-
- p = mem2chunk(m);
-
- if ((((size_t)(m)) % alignment) == 0) /* aligned */
- {
-#if HAVE_MMAP
- if(chunk_is_mmapped(p))
- return chunk2mem(p); /* nothing more to do */
-#endif
- }
- else /* misaligned */
- {
- /*
- Find an aligned spot inside chunk.
- Since we need to give back leading space in a chunk of at
- least MINSIZE, if the first calculation places us at
- a spot with less than MINSIZE leader, we can move to the
- next aligned spot -- we've allocated enough total room so that
- this is always possible.
- */
-
- brk = (char*) ( (((size_t)(m + alignment - 1)) & -alignment) - SIZE_SZ );
- if ((long)(brk - (char*)(p)) < MINSIZE) brk = brk + alignment;
-
- newp = (mchunkptr)brk;
- leadsize = brk - (char*)(p);
- newsize = chunksize(p) - leadsize;
-
-#if HAVE_MMAP
- if(chunk_is_mmapped(p))
- {
- *((size_t *)newp - 1) = *((size_t *)p - 1) + leadsize;
- set_head(newp, newsize|IS_MMAPPED);
- return chunk2mem(newp);
- }
-#endif
-
- /* give back leader, use the rest */
-
- set_head(newp, newsize | PREV_INUSE);
- set_inuse_bit_at_offset(newp, newsize);
- set_head_size(p, leadsize);
- fREe(chunk2mem(p));
- p = newp;
- }
-
- /* Also give back spare room at the end */
-
- remainder_size = chunksize(p) - nb;
-
- if (remainder_size >= (long)MINSIZE)
- {
- remainder = chunk_at_offset(p, nb);
- set_head(remainder, remainder_size | PREV_INUSE);
- set_head_size(p, nb);
- fREe(chunk2mem(remainder));
- }
-
- check_inuse_chunk(p);
- return chunk2mem(p);
-
-}
-
-
-
-
-/*
- valloc just invokes memalign with alignment argument equal
- to the page size of the system (or as near to this as can
- be figured out from all the includes/defines above.)
-*/
-
-#if __STD_C
-Void_t* vALLOc(size_t bytes)
-#else
-Void_t* vALLOc(bytes) size_t bytes;
-#endif
-{
- return mEMALIGn (malloc_getpagesize, bytes);
-}
-
-
-/*
-
- calloc calls malloc, then zeroes out the allocated chunk.
-
-*/
-
-#if __STD_C
-Void_t* cALLOc(size_t n, size_t elem_size)
-#else
-Void_t* cALLOc(n, elem_size) size_t n; size_t elem_size;
-#endif
-{
- mchunkptr p;
- size_t csz;
-
- size_t sz = n * elem_size;
- Void_t* mem = mALLOc (sz);
-
- if (mem == 0)
- return 0;
- else
- {
- p = mem2chunk(mem);
-
- if(chunk_is_mmapped(p)) /* no clearing is necessary */
- return mem;
-
- csz = chunksize(p);
- MALLOC_ZERO(mem, csz - SIZE_SZ);
- return mem;
- }
-}
-
-/*
-
- cfree just calls free. It is needed/defined on some systems
- that pair it with calloc, presumably for odd historical reasons.
-
-*/
-
-#if !defined(INTERNAL_LINUX_C_LIB) || !defined(__ELF__)
-#if __STD_C
-void cfree(Void_t *mem)
-#else
-void cfree(mem) Void_t *mem;
-#endif
-{
- free(mem);
-}
-#endif
-
-
-
-/*
-
- Malloc_trim gives memory back to the system (via negative
- arguments to sbrk) if there is unused memory at the `high' end of
- the malloc pool. You can call this after freeing large blocks of
- memory to potentially reduce the system-level memory requirements
- of a program. However, it cannot guarantee to reduce memory. Under
- some allocation patterns, some large free blocks of memory will be
- locked between two used chunks, so they cannot be given back to
- the system.
-
- The `pad' argument to malloc_trim represents the amount of free
- trailing space to leave untrimmed. If this argument is zero,
- only the minimum amount of memory to maintain internal data
- structures will be left (one page or less). Non-zero arguments
- can be supplied to maintain enough trailing space to service
- future expected allocations without having to re-obtain memory
- from the system.
-
- Malloc_trim returns 1 if it actually released any memory, else 0.
-
-*/
-
-#if __STD_C
-int malloc_trim(size_t pad)
-#else
-int malloc_trim(pad) size_t pad;
-#endif
-{
- long top_size; /* Amount of top-most memory */
- long extra; /* Amount to release */
- char* current_brk; /* address returned by pre-check sbrk call */
- char* new_brk; /* address returned by negative sbrk call */
-
- unsigned long pagesz = malloc_getpagesize;
-
- top_size = chunksize(top);
- extra = ((top_size - pad - MINSIZE + (pagesz-1)) / pagesz - 1) * pagesz;
-
- if (extra < (long)pagesz) /* Not enough memory to release */
- return 0;
-
- else
- {
- /* Test to make sure no one else called sbrk */
- current_brk = (char*)(MORECORE (0));
- if (current_brk != (char*)(top) + top_size)
- return 0; /* Apparently we don't own memory; must fail */
-
- else
- {
- new_brk = (char*)(MORECORE (-extra));
-
- if (new_brk == (char*)(MORECORE_FAILURE)) /* sbrk failed? */
- {
- /* Try to figure out what we have */
- current_brk = (char*)(MORECORE (0));
- top_size = current_brk - (char*)top;
- if (top_size >= (long)MINSIZE) /* if not, we are very very dead! */
- {
- sbrked_mem = current_brk - sbrk_base;
- set_head(top, top_size | PREV_INUSE);
- }
- check_chunk(top);
- return 0;
- }
-
- else
- {
- /* Success. Adjust top accordingly. */
- set_head(top, (top_size - extra) | PREV_INUSE);
- sbrked_mem -= extra;
- check_chunk(top);
- return 1;
- }
- }
- }
-}
-
-
-
-/*
- malloc_usable_size:
-
- This routine tells you how many bytes you can actually use in an
- allocated chunk, which may be more than you requested (although
- often not). You can use this many bytes without worrying about
- overwriting other allocated objects. Not a particularly great
- programming practice, but still sometimes useful.
-
-*/
-
-#if __STD_C
-size_t malloc_usable_size(Void_t* mem)
-#else
-size_t malloc_usable_size(mem) Void_t* mem;
-#endif
-{
- mchunkptr p;
- if (mem == 0)
- return 0;
- else
- {
- p = mem2chunk(mem);
- if(!chunk_is_mmapped(p))
- {
- if (!inuse(p)) return 0;
- check_inuse_chunk(p);
- }
- return chunksize(p) - SIZE_SZ;
- }
-}
-
-
-
-
-/* Utility to update current_mallinfo for malloc_stats and mallinfo() */
-
-static void malloc_update_mallinfo()
-{
- int i;
- mbinptr b;
- mchunkptr p;
-#if DEBUG
- mchunkptr q;
-#endif
-
- size_t avail = chunksize(top);
- int navail = ((long)(avail) >= (long)MINSIZE)? 1 : 0;
-
- for (i = 1; i < NAV; ++i)
- {
- b = bin_at(i);
- for (p = last(b); p != b; p = p->bk)
- {
-#if DEBUG
- check_free_chunk(p);
- for (q = next_chunk(p);
- q < top && inuse(q) && (long)(chunksize(q)) >= (long)MINSIZE;
- q = next_chunk(q))
- check_inuse_chunk(q);
-#endif
- avail += chunksize(p);
- navail++;
- }
- }
-
- current_mallinfo.ordblks = navail;
- current_mallinfo.uordblks = sbrked_mem - avail;
- current_mallinfo.fordblks = avail;
- current_mallinfo.hblks = n_mmaps;
- current_mallinfo.hblkhd = mmapped_mem;
- current_mallinfo.keepcost = chunksize(top);
-
-}
-
-
-
-/*
-
- malloc_stats:
-
- Prints on stderr the amount of space obtain from the system (both
- via sbrk and mmap), the maximum amount (which may be more than
- current if malloc_trim and/or munmap got called), the maximum
- number of simultaneous mmap regions used, and the current number
- of bytes allocated via malloc (or realloc, etc) but not yet
- freed. (Note that this is the number of bytes allocated, not the
- number requested. It will be larger than the number requested
- because of alignment and bookkeeping overhead.)
-
-*/
-
-void malloc_stats()
-{
- malloc_update_mallinfo();
- fprintf(stderr, "max system bytes = %10u\n",
- (unsigned int)(max_total_mem));
- fprintf(stderr, "system bytes = %10u\n",
- (unsigned int)(sbrked_mem + mmapped_mem));
- fprintf(stderr, "in use bytes = %10u\n",
- (unsigned int)(current_mallinfo.uordblks + mmapped_mem));
-#if HAVE_MMAP
- fprintf(stderr, "max mmap regions = %10u\n",
- (unsigned int)max_n_mmaps);
-#endif
-}
-
-/*
- mallinfo returns a copy of updated current mallinfo.
-*/
-
-struct mallinfo mALLINFo()
-{
- malloc_update_mallinfo();
- return current_mallinfo;
-}
-
-
-
-
-/*
- mallopt:
-
- mallopt is the general SVID/XPG interface to tunable parameters.
- The format is to provide a (parameter-number, parameter-value) pair.
- mallopt then sets the corresponding parameter to the argument
- value if it can (i.e., so long as the value is meaningful),
- and returns 1 if successful else 0.
-
- See descriptions of tunable parameters above.
-
-*/
-
-#if __STD_C
-int mALLOPt(int param_number, int value)
-#else
-int mALLOPt(param_number, value) int param_number; int value;
-#endif
-{
- switch(param_number)
- {
- case M_TRIM_THRESHOLD:
- trim_threshold = value; return 1;
- case M_TOP_PAD:
- top_pad = value; return 1;
- case M_MMAP_THRESHOLD:
- mmap_threshold = value; return 1;
- case M_MMAP_MAX:
-#if HAVE_MMAP
- n_mmaps_max = value; return 1;
-#else
- if (value != 0) return 0; else n_mmaps_max = value; return 1;
-#endif
-
- default:
- return 0;
- }
-}
-
-/*
-
-History:
-
- V2.6.2 Tue Dec 5 06:52:55 1995 Doug Lea (dl at gee)
- * Integrated most documentation with the code.
- * Add support for mmap, with help from
- Wolfram Gloger (Gloger@lrz.uni-muenchen.de).
- * Use last_remainder in more cases.
- * Pack bins using idea from colin@nyx10.cs.du.edu
- * Use ordered bins instead of best-fit threshhold
- * Eliminate block-local decls to simplify tracing and debugging.
- * Support another case of realloc via move into top
- * Fix error occuring when initial sbrk_base not word-aligned.
- * Rely on page size for units instead of SBRK_UNIT to
- avoid surprises about sbrk alignment conventions.
- * Add mallinfo, mallopt. Thanks to Raymond Nijssen
- (raymond@es.ele.tue.nl) for the suggestion.
- * Add `pad' argument to malloc_trim and top_pad mallopt parameter.
- * More precautions for cases where other routines call sbrk,
- courtesy of Wolfram Gloger (Gloger@lrz.uni-muenchen.de).
- * Added macros etc., allowing use in linux libc from
- H.J. Lu (hjl@gnu.ai.mit.edu)
- * Inverted this history list
-
- V2.6.1 Sat Dec 2 14:10:57 1995 Doug Lea (dl at gee)
- * Re-tuned and fixed to behave more nicely with V2.6.0 changes.
- * Removed all preallocation code since under current scheme
- the work required to undo bad preallocations exceeds
- the work saved in good cases for most test programs.
- * No longer use return list or unconsolidated bins since
- no scheme using them consistently outperforms those that don't
- given above changes.
- * Use best fit for very large chunks to prevent some worst-cases.
- * Added some support for debugging
-
- V2.6.0 Sat Nov 4 07:05:23 1995 Doug Lea (dl at gee)
- * Removed footers when chunks are in use. Thanks to
- Paul Wilson (wilson@cs.texas.edu) for the suggestion.
-
- V2.5.4 Wed Nov 1 07:54:51 1995 Doug Lea (dl at gee)
- * Added malloc_trim, with help from Wolfram Gloger
- (wmglo@Dent.MED.Uni-Muenchen.DE).
-
- V2.5.3 Tue Apr 26 10:16:01 1994 Doug Lea (dl at g)
-
- V2.5.2 Tue Apr 5 16:20:40 1994 Doug Lea (dl at g)
- * realloc: try to expand in both directions
- * malloc: swap order of clean-bin strategy;
- * realloc: only conditionally expand backwards
- * Try not to scavenge used bins
- * Use bin counts as a guide to preallocation
- * Occasionally bin return list chunks in first scan
- * Add a few optimizations from colin@nyx10.cs.du.edu
-
- V2.5.1 Sat Aug 14 15:40:43 1993 Doug Lea (dl at g)
- * faster bin computation & slightly different binning
- * merged all consolidations to one part of malloc proper
- (eliminating old malloc_find_space & malloc_clean_bin)
- * Scan 2 returns chunks (not just 1)
- * Propagate failure in realloc if malloc returns 0
- * Add stuff to allow compilation on non-ANSI compilers
- from kpv@research.att.com
-
- V2.5 Sat Aug 7 07:41:59 1993 Doug Lea (dl at g.oswego.edu)
- * removed potential for odd address access in prev_chunk
- * removed dependency on getpagesize.h
- * misc cosmetics and a bit more internal documentation
- * anticosmetics: mangled names in macros to evade debugger strangeness
- * tested on sparc, hp-700, dec-mips, rs6000
- with gcc & native cc (hp, dec only) allowing
- Detlefs & Zorn comparison study (in SIGPLAN Notices.)
-
- Trial version Fri Aug 28 13:14:29 1992 Doug Lea (dl at g.oswego.edu)
- * Based loosely on libg++-1.2X malloc. (It retains some of the overall
- structure of old version, but most details differ.)
-
-*/
diff --git a/contrib/libg++/libg++/src/minmax.cc b/contrib/libg++/libg++/src/minmax.cc
deleted file mode 100644
index 3cbc7e48c010..000000000000
--- a/contrib/libg++/libg++/src/minmax.cc
+++ /dev/null
@@ -1,5 +0,0 @@
-#ifdef _GNUG_
-#pragma implementation
-#endif
-
-#include <minmax.h>
diff --git a/contrib/libg++/libg++/src/minmax.h b/contrib/libg++/libg++/src/minmax.h
deleted file mode 100644
index ec2bfa335a7c..000000000000
--- a/contrib/libg++/libg++/src/minmax.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
-Copyright (C) 1992 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifndef _minmax_h
-#ifdef _GNUG_
-#pragma interface
-#endif
-#define _minmax_h 1
-
-#include <_G_config.h>
-
-inline char min(char a, char b) { return (a < b)?a:b;}
-#ifndef _G_BROKEN_SIGNED_CHAR
-inline signed char min(signed char a, signed char b) { return (a < b)?a:b;}
-#endif
-inline unsigned char min(unsigned char a, unsigned char b) {return (a<b)?a:b;}
-
-inline short min(short a, short b) {return (a < b) ?a:b;}
-inline unsigned short min(unsigned short a, unsigned short b) {return (a < b)?a:b;}
-
-inline int min(int a, int b) {return (a < b)?a:b;}
-inline unsigned int min(unsigned int a, unsigned int b) {return (a < b)?a:b;}
-
-inline long min(long a, long b) {return (a < b)?a:b;}
-inline unsigned long min(unsigned long a, unsigned long b) {return (a<b)?a:b;}
-
-inline float min(float a, float b) {return (a < b)?a:b;}
-
-inline double min(double a, double b) {return (a < b)?a:b;}
-
-inline char max(char a, char b) { return (a > b)?a:b;}
-#ifndef _G_BROKEN_SIGNED_CHAR
-inline signed char max(signed char a, signed char b) {return (a > b)?a:b;}
-#endif
-inline unsigned char max(unsigned char a, unsigned char b) {return (a>b)?a:b;}
-
-inline short max(short a, short b) {return (a > b) ?a:b;}
-inline unsigned short max(unsigned short a, unsigned short b) {return (a > b)?a:b;}
-
-inline int max(int a, int b) {return (a > b)?a:b;}
-inline unsigned int max(unsigned int a, unsigned int b) {return (a > b)?a:b;}
-
-inline long max(long a, long b) {return (a > b)?a:b;}
-inline unsigned long max(unsigned long a, unsigned long b) {return (a>b)?a:b;}
-
-inline float max(float a, float b) {return (a > b)?a:b;}
-
-inline double max(double a, double b) {return (a > b)?a:b;}
-
-#endif
-
diff --git a/contrib/libg++/libg++/src/osfcn.h b/contrib/libg++/libg++/src/osfcn.h
deleted file mode 100644
index 023b5c5b65d6..000000000000
--- a/contrib/libg++/libg++/src/osfcn.h
+++ /dev/null
@@ -1,17 +0,0 @@
-
-#ifndef OSFCN_H
-#define OSFCN_H 1
-
-#include <std.h>
-#include <time.h>
-#include <sys/types.h>
-#if _G_HAVE_SYS_SOCKET
-#include <sys/socket.h>
-#endif
-#if _G_HAVE_SYS_RESOURCE
-#include <sys/time.h>
-#include <sys/resource.h>
-#endif
-
-
-#endif
diff --git a/contrib/libg++/libg++/src/pow.cc b/contrib/libg++/libg++/src/pow.cc
deleted file mode 100644
index 497cb5b8b70c..000000000000
--- a/contrib/libg++/libg++/src/pow.cc
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
-Copyright (C) 1990 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <builtin.h>
-#include <math.h>
-
-double pow(double x, long p)
-{
- if (p == 0)
- return 1.0;
- else if (x == 0.0)
- return 0.0;
- else
- {
- if (p < 0)
- {
- p = -p;
- x = 1.0 / x;
- }
-
- double r = 1.0;
- for(;;)
- {
- if (p & 1)
- r *= x;
- if ((p >>= 1) == 0)
- return r;
- else
- x *= x;
- }
- }
-}
-
-long pow(long x, long p)
-{
- if (p == 0)
- return 1;
- else if (p < 0 || x == 0)
- return 0;
- else
- {
- long r = 1;
- for(;;)
- {
- if (p & 1)
- r *= x;
- if ((p >>= 1) == 0)
- return r;
- else
- x *= x;
- }
- }
-}
diff --git a/contrib/libg++/libg++/src/sqrt.cc b/contrib/libg++/libg++/src/sqrt.cc
deleted file mode 100644
index 622895eed45f..000000000000
--- a/contrib/libg++/libg++/src/sqrt.cc
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
-Copyright (C) 1990 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <builtin.h>
-#include <math.h>
-
-long sqrt(long x)
-{
- if (x <= 0)
- return 0; // no int error handler, so ...
- else if (x == 1)
- return 1;
- else
- {
- long r = x >> 1;
- long q;
- for(;;)
- {
- q = x / r;
- if (q >= r)
- return r;
- else
- r = (r + q) >> 1;
- }
- }
-}
diff --git a/contrib/libg++/libg++/src/std.h b/contrib/libg++/libg++/src/std.h
deleted file mode 100644
index 2cd73f243862..000000000000
--- a/contrib/libg++/libg++/src/std.h
+++ /dev/null
@@ -1,35 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988, 1992 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifndef _std_h
-#define _std_h 1
-
-#include <_G_config.h>
-#include <stddef>
-#include <cstdlib>
-#include <cstring>
-#include <unistd.h>
-#include <cstdio>
-#include <cerrno>
-#include <fcntl.h>
-
-extern "C" {
-int strcasecmp _G_ARGS((const char*, const char*));
-}
-
-#endif
diff --git a/contrib/libg++/libg++/src/strclass.h b/contrib/libg++/libg++/src/strclass.h
deleted file mode 100644
index 57dbcc8cf90a..000000000000
--- a/contrib/libg++/libg++/src/strclass.h
+++ /dev/null
@@ -1,5 +0,0 @@
-#ifndef _strclass_h
-#define _strclass_h
-#include <String.h>
-typedef class String string;
-#endif
diff --git a/contrib/libg++/libg++/src/swap.h b/contrib/libg++/libg++/src/swap.h
deleted file mode 100644
index 005cb0e46482..000000000000
--- a/contrib/libg++/libg++/src/swap.h
+++ /dev/null
@@ -1,3 +0,0 @@
-/* From Ron Guillmette; apparently needed for Hansen's code */
-
-#define swap(a,b) ({ typeof(a) temp = (a); (a) = (b); (b) = temp; })
diff --git a/contrib/libg++/libg++/src/sysent.h b/contrib/libg++/libg++/src/sysent.h
deleted file mode 100644
index 0535f38e934d..000000000000
--- a/contrib/libg++/libg++/src/sysent.h
+++ /dev/null
@@ -1,2 +0,0 @@
-/* Provided for compatibity with other C++ compilers ONLY! */
-#include <std.h>
diff --git a/contrib/libg++/libg++/src/timer.c b/contrib/libg++/libg++/src/timer.c
deleted file mode 100644
index a7e2242d5290..000000000000
--- a/contrib/libg++/libg++/src/timer.c
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
-Copyright (C) 1990, 1992, 1995 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-
-/* Timing functions from Doug Schmidt... */
-
-/* no such thing as "negative time"! */
-#define TIMER_ERROR_VALUE -1.0
-
-/* If this does not work on your system, change this to #if 0, and
- report the problem. */
-
-#if 1
-
-#include <_G_config.h>
-#include <sys/types.h>
-#if _G_HAVE_SYS_RESOURCE
-#include <sys/time.h>
-#include <sys/resource.h>
-#endif
-#if !_G_HAVE_SYS_RESOURCE || !defined(RUSAGE_SELF)
-#if _G_HAVE_SYS_TIMES
-#define USE_TIMES
-#include <sys/param.h>
-#include <sys/times.h>
-#if !defined (HZ) && defined(CLK_TCK)
-#define HZ CLK_TCK
-#endif
-static struct tms Old_Time;
-static struct tms New_Time;
-#else /* ! _G_HAVE_SYS_TIMES */
-#define USE_CLOCK
-#include <time.h>
-#ifndef CLOCKS_PER_SEC
-#define CLOCKS_PER_SEC 1
-#endif
-clock_t Old_Time;
-clock_t New_Time;
-#endif /* ! _G_HAVE_SYS_TIMES */
-#else /* _G_HAVE_SYS_RESOURCE && defined(RUSAGE_SELF) */
-static struct rusage Old_Time;
-static struct rusage New_Time;
-#endif
-static int Timer_Set = 0;
-
-double
-start_timer()
-{
- Timer_Set = 1;
-#ifdef USE_CLOCK
- Old_Time = clock() / CLOCKS_PER_SEC;
- return((double) Old_Time);
-#else
-#ifdef USE_TIMES
- times(&Old_Time);
- return((double) Old_Time.tms_utime / HZ);
-#else
- getrusage(RUSAGE_SELF,&Old_Time); /* set starting process time */
- return(Old_Time.ru_utime.tv_sec + (Old_Time.ru_utime.tv_usec / 1000000.0));
-#endif
-#endif
-}
-
-/* Returns process time since Last_Time.
- If parameter is 0.0, returns time since the Old_Time was set.
- Returns TIMER_ERROR_VALUE if `start_timer' is not called first. */
-
-double
-return_elapsed_time(Last_Time)
- double Last_Time;
-{
- if (!Timer_Set) {
- return(TIMER_ERROR_VALUE);
- }
- else {
- /* get process time */
-#ifdef USE_CLOCK
- New_Time = clock();
-#else
-#ifdef USE_TIMES
- times(&New_Time);
-#else
- getrusage(RUSAGE_SELF,&New_Time);
-#endif
-#endif
- if (Last_Time == 0.0) {
-#ifdef USE_CLOCK
- return((double) (New_Time - Old_Time) / CLOCKS_PER_SEC);
-#else
-#ifdef USE_TIMES
- return((double) (New_Time.tms_utime - Old_Time.tms_utime) / HZ);
-#else
- return((New_Time.ru_utime.tv_sec - Old_Time.ru_utime.tv_sec) +
- ((New_Time.ru_utime.tv_usec - Old_Time.ru_utime.tv_usec)
- / 1000000.0));
-#endif
-#endif
- }
- else {
-#ifdef USE_CLOCK
- return((double) New_Time / CLOCKS_PER_SEC - Last_Time);
-#else
-#ifdef USE_TIMES
- return((double) New_Time.tms_utime / HZ - Last_Time);
-#else
- return((New_Time.ru_utime.tv_sec +
- (New_Time.ru_utime.tv_usec / 1000000.0)) - Last_Time);
-#endif
-#endif
- }
- }
-}
-
-#ifdef VMS
-void sys$gettim(unsigned int*) asm("sys$gettim");
-
-getrusage(int dummy,struct rusage* time){
- double rtime;
- unsigned int systime[2];
- int i;
- sys$gettim(&systime[0]);
- rtime=systime[1];
- for(i=0;i<4;i++) rtime *= 256;
- rtime+= systime[0];
-/* we subtract an offset to make sure that the number fits in a long int*/
- rtime=rtime/1.0e+7-4.144e+9;
- time->ru_utime.tv_sec= rtime;
- rtime=(rtime-time->ru_utime.tv_sec)*1.0e6;
- time->ru_utime.tv_usec= rtime;
-}
-#endif
-#else /* dummy them out */
-
-double start_timer()
-{
- return TIMER_ERROR_VALUE;
-}
-
-double
-return_elapsed_time(Last_Time)
- double Last_Time;
-{
- return TIMER_ERROR_VALUE;
-}
-
-#endif /* timing stuff */
-
-
diff --git a/contrib/libg++/libg++/src/typemacros.h b/contrib/libg++/libg++/src/typemacros.h
deleted file mode 100644
index f2bd7877e362..000000000000
--- a/contrib/libg++/libg++/src/typemacros.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#define _T(type) typeof(type)
-#define pointer_to(type) _T(_T(type)*)
-#define member_of(cls,type) _T(_T(type) cls::)
-#define function(res, args) _T(_T(res) args)
-
-#define _xq_yq(x,y) x ## _ ## y
-#define _x_y(x,y) _xq_yq(x,y)
-#define _gensym(stem) _x_y(stem, __LINE__)
diff --git a/contrib/libg++/libg++/test-install/ChangeLog b/contrib/libg++/libg++/test-install/ChangeLog
deleted file mode 100644
index 45208ea6dd91..000000000000
--- a/contrib/libg++/libg++/test-install/ChangeLog
+++ /dev/null
@@ -1,74 +0,0 @@
-Thu Oct 19 21:39:12 1995 Fred Fish <fnf@fishfood.amigalib.com>
-
- * Makefile.in: Remove extraneous tabs from otherwise empty
- line. This confuses older non-GNU versions of "make".
-
-Fri Apr 15 13:25:09 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * Makefile.in (COMPILE_FLAGS): Remove obsolete XTRAFLAGS.
-
-Tue Jun 1 16:54:46 1993 Per Bothner (bothner@rtl.cygnus.com)
-
- * Makefile.in (do_main.diff): Prefix commands by '@' to avoid
- unnecessarily alarming users with what looks like error messages.
-
-Mon Apr 19 00:25:36 1993 Per Bothner (bothner@cygnus.com)
-
- * Makefile.in, configure.in: Re-vamped configure scheme.
- * Makefile.in (foo_main.diff): Print more expressive
- error message, and refer to libg++/README.
-
-Tue Nov 17 22:20:02 1992 Per Bothner (bothner@rtl.cygnus.com)
-
- * bf.cc: Use different styles of initialization.
- * bm.cc: $#include <stdlib.h> (for exit()).
-
-Wed Aug 12 00:37:34 1992 Per Bothner (bothner@cygnus.com)
-
- * Makefile.in: da should be libked with libg++.a, but
- foo_main.run should not be (since it tests that
- constructors work *without* needing libg++.a).
-
-Thu May 14 15:13:31 1992 Per Bothner (bothner@rtl.cygnus.com)
-
- * foo_main.cc, foo_diff.cc: Change the strings naming the
- two static static_foo variables to be the same, because
- the language does not specify construction order.
- * expected.out: Update accordingly.
- * Makefile.in: Simplify, clean up. Now, if you 'make test-90S',
- it will test using ../libg++.a and local include files.
- But ../Makefile.in when testing installation, overrides
- variables so as to use installed versions. Thus things
- are more consistent and more flexible - and you can
- do the test before installing, if you want to.
-
-Sat Mar 7 19:19:49 1992 K. Richard Pixley (rich@cygnus.com)
-
- * Makefile.in: make test work when "." is not in PATH.
-
-Wed Feb 26 18:04:40 1992 K. Richard Pixley (rich@cygnus.com)
-
- * Makefile.in, configure.in: removed traces of namesubdir,
- -subdirs, $(subdir), $(unsubdir), some rcs triggers. Forced
- copyrights to '92, changed some from Cygnus to FSF.
-
-Mon Jan 6 00:39:54 1992 John Gilmore (gnu at cygnus.com)
-
- * foo_main.cc: Reverse previous change. foo_main.cc should
- never see SunOS assert.h; it should get gcc's assert.h. When
- the compile fails, it means the wrong include files are in use!
-
-Mon Jan 6 00:21:13 1992 Per Bothner (bothner at cygnus.com)
-
- * foo_main.cc: Include <stdio.h>, needed by broken SunOS assert.h.
-
-Fri Jan 3 09:17:17 1992 John Gilmore (gnu at cygnus.com)
-
- * Makefile.in: Cope with broken Sun Make VPATH.
- * Foo.cc: Expect that Foo:init_foo() will *not* be called.
- * foo_main.cc: Add comment about __init_start lossage.
- * expected.out: Remove ``expected'' __init_start call.
-
-Sat Dec 28 16:46:25 1991 Michael Tiemann (tiemann at cygnus.com)
-
- * Makefile.in (CPP_FLAGS): Add $(srcdir).
diff --git a/contrib/libg++/libg++/test-install/Foo.cc b/contrib/libg++/libg++/test-install/Foo.cc
deleted file mode 100644
index 313347652f4f..000000000000
--- a/contrib/libg++/libg++/test-install/Foo.cc
+++ /dev/null
@@ -1,89 +0,0 @@
-// Class Foo
-//#pragma implementation
-
-
-// We don't use header files, since we only want to see, whether the
-// compiler is installed properly.
-//
-#if (__GNUG__ == 2)
-typedef __SIZE_TYPE__ size_t;
-#else
-typedef unsigned int size_t;
-#endif
-
-extern "C" {
- char *strncpy (char* dest, const char* dest, size_t len);
- int printf (const char*, ...);
-};
-
-#include "Foo.h"
-
-int Foo::foos = 0;
-
-void Foo::init_foo ()
-{
- printf ("BROKENLY calling Foo::init_foo from __init_start; size_of(Foo) = %d\n", sizeof(Foo));
- foos = FOOLISH_NUMBER;
-}
-
-
-Foo::Foo ()
-{
- i = ++foos;
- strncpy (message, "default-foo", len);
-#ifdef WITH_ADDR
- printf ("Constructing Foo(%d) \"default-foo\" at %08x\n", i, this);
-#else
- printf ("Constructing Foo(%d) \"default-foo\"\n", i);
-#endif
-}
-
-Foo::Foo (char* msg)
-{
- i = ++foos;
- strncpy( message, msg, len);
-#ifdef WITH_ADDR
- printf ( "Constructing Foo(%d) \"%s\" at %08x\n", i, message, this);
-#else
- printf ( "Constructing Foo(%d) \"%s\"\n", i, message);
-#endif
-}
-
-
-Foo::Foo (const Foo& foo)
-{
- i = ++foos;
-#ifdef WITH_ADDR
- printf ("Initializing Foo(%d) \"%s\" at %08x with Foo(%d) %08x\n",
- i, foo.message, this, foo.i, &foo);
-#else
- printf ("Initializing Foo(%d) \"%s\" with Foo(%d)\n",i, foo.message, foo.i);
-#endif
- for ( int k = 0; k < FOO_MSG_LEN; k++) message[k] = foo.message[k];
-}
-
-
-Foo& Foo::operator= (const Foo& foo)
-{
-#ifdef WITH_ADDR
- printf ("Copying Foo(%d) \"%s\" at %08x to Foo(%d) %08x\n",
- foo.i, foo.message, &foo, i, this);
-#else
- printf ("Copying Foo(%d) \"%s\" to Foo(%d)\n", foo.i, foo.message, i);
-#endif
- for ( int k = 0; k < FOO_MSG_LEN; k++) message[k] = foo.message[k];
- return *this;
-}
-
-
-Foo::~Foo ()
-{
- foos--;
-#ifdef WITH_ADDR
- printf ("Destructing Foo(%d) \"%s\" at %08x (remaining foos: %d)\n",
- i, message, this, foos);
-#else
- printf ("Destructing Foo(%d) \"%s\" (remaining foos: %d)\n",
- i, message, foos);
-#endif
-}
diff --git a/contrib/libg++/libg++/test-install/Foo.h b/contrib/libg++/libg++/test-install/Foo.h
deleted file mode 100644
index 0ba2d37b2725..000000000000
--- a/contrib/libg++/libg++/test-install/Foo.h
+++ /dev/null
@@ -1,24 +0,0 @@
-// Class Foo
-
-#pragma interface
-
-#define FOOLISH_NUMBER -4711
-
-#ifndef FOO_MSG_LEN
-#define FOO_MSG_LEN 80
-#endif
-
-class Foo {
- static int foos;
- int i;
- const len = FOO_MSG_LEN;
- char message[len];
-public:
- static void init_foo ();
- static int nb_foos() { return foos; }
- Foo();
- Foo( char* message);
- Foo(const Foo&);
- Foo & operator= (const Foo&);
- ~Foo ();
-};
diff --git a/contrib/libg++/libg++/test-install/Makefile.in b/contrib/libg++/libg++/test-install/Makefile.in
deleted file mode 100644
index 32befa21a066..000000000000
--- a/contrib/libg++/libg++/test-install/Makefile.in
+++ /dev/null
@@ -1,170 +0,0 @@
-###*#######################################################################
-#
-# Makefile to test the installation of g++ and libg++
-# (by hgs@cygnus.com)
-#
-# Usage: make foo_main test-90S test-90D PREFIX=prefix [other macros]
-
-srcdir = .
-
-
-#
-# Compilation macros
-#
-PREFIX = $(prefix)
-
-CFLAGS =
-CXXFLAGS =
-CPP_FLAGS = #-I$(srcdir)/../g++-include
-OPTIMIZE_FLAGS = -O
-DEBUG_FLAGS = -g -v #-Wall
-COMPILE_FLAGS=$(NOSTDINC) -I.. -I$(srcdir) -I$(srcdir)/../src -I$(srcdir)/../$(IO_DIR) $(WRAP_C_INCLUDES)
-
-DEPEND_SOURCES = $(srcdir)/*.cc
-
-
-T90 = $(T90S) $(T90D)
-T90D = # dex_bar
-
-FLAGS_90 = \
- GXX="$(GXX)"\
- CPP_FLAGS="$(CPP_FLAGS)"\
- OPTIMIZE_FLAGS="$(OPTIMIZE_FLAGS)"\
- DEBUG_FLAGS="$(DEBUG_FLAGS)"\
- GXXLDFLAGS="$(GXXLDFLAGS)"
-
-#### package, host, target, and site dependent Makefile fragments come in here.
-##
-
-
-TEMP_FILES = *.o foo_main a b *foo_main.out *foo_main.diff *foo_main.run
-
-help:
- @echo Usage: make foo_main test-40 test-90S test-90D PREFIX=prefix [other macros]
-
-
-test-90S: foo_main a b
-
-test-90S-then-clean: test-90S
- rm -f ${TEMP_FILES}
-
-test-90D: dfoo_main da db
-
-test-90D-then-clean: test-90D
- rm -f ${TEMP_FILES}
-
-test: $(TEST)
- for P in $(TEST) ; do if [ $$P != foo_main ]; then eval ./$$P; fi; done
-
-a : a.o
- $(CXX) -o a a.o $(LIBS)
-da : a.o
- $(CXX) -o da -dynamic a.o $(LIBS)
-
-
-b : bf.o bm.o
- $(CXX) -o b bm.o bf.o $(LIBS)
-
-db : bf.o bm.o
- $(CXX) -o db -dynamic bm.o bf.o $(LIBS)
-
-
-foo_main: foo_main.diff
- @true
-
-dfoo_main: dfoo_main.diff
- @true
-
-foo_main.run: foo_main.o foo_func.o Foo.o expected.out
- $(CXX) $(DEBUG_FLAGS) -o $@ foo_main.o foo_func.o Foo.o
-
-foo_main.out: foo_main.run
- ./foo_main.run > foo_main.out
-
-foo_main.diff: foo_main.out $(srcdir)/expected.out
- @echo "diff $(srcdir)/expected.out foo_main.out >foo_main.diff"
- @diff $(srcdir)/expected.out foo_main.out >foo_main.diff \
- || (echo "Static constructor test failed - see libg++/README"; false)
-
-dfoo_main.run: foo_main.o foo_func.o Foo.o
- $(CXX) $(DEBUG_FLAGS) -o $@ -dynamic foo_main.o foo_func.o Foo.o $(LIBS)
-
-dfoo_main.out: dfoo_main.run
- ./dfoo_main.run > dfoo_main.out
-
-dfoo_main.diff: dfoo_main.out $(srcdir)/expected.out
- diff $(srcdir)/expected.out dfoo_main.out
-
-ex_bar.o: ex_bar.cc
- $(CXX) -fhandle-exceptions ex_bar.cc
-
-ex_bar: ex_bar.o
- $(CXX) $(DEBUG_FLAGS) -o $@ ex_bar.o
-
-dex_bar: ex_bar.o
- $(CXX) $(DEBUG_FLAGS) -o $@ -dynamic ex_bar.o
-
-# --- Generate depend rules ---
-
-SRCDIR=$(srcdir)/..
-
-# The sed script below attempts to make the depend output portable by
-# making the output use the same macros used elsewhere in the Makefile:
-# - It replaces double // by a single /.
-# - It replaces include files that match part of the GXX_INCLUDE_DIRS
-# by names defined in terms of the macros used to define GXX_INCLUDE_DIRS.
-# - It removes any absolute include file names that remain.
-# - then remove lines, which contain only `\'
-#
-depend: depend.tmp
- if [ "x$(DEPEND_SOURCES)" != "x" ] ; then \
- sed < depend.tmp \
- -e 's|//|/|g' \
- -e 's|$(srcdir)|$$(srcdir)|g' \
- -e 's| /[^ ]*[.]h||g' \
- -e 's|: *\$$(srcdir)/\(.*\.[cC]*\)|: \1|' \
- -e '/^[ ]*\\$$/d' -e 's/^[ ]*$$//' \
- | awk 'BEGIN { prev = "" } \
- /^( )*$$/ { if (prev ~ /\\$$/) \
- { prev = substr(prev,1,length(prev)-1); next } \
- } \
- { print prev; prev = $$0 } \
- END { if (prev !~ /^( )*$$/) print prev }' \
- > $(srcdir)/depend ;\
- fi
-
-depend.tmp: $(DEPEND_SOURCES)
- if [ "x$(DEPEND_SOURCES)" = "x" ] ; then \
- echo "" > $(srcdir)/depend ;\
- else \
- echo "" >depend.tmp ; \
- $(SRCDIR)/utils/g++dep.sh -f depend.tmp $(GXX_INCLUDE_DIRS) \
- $(DEPEND_SOURCES) ;\
- fi
-
-do_depend: depend
- if [ "$(SUBDIRS)" != "" ] ; then \
- for D in $(SUBDIRS) x ; do \
- if [ -d $$D ] ; then \
- echo "cd $$D; $(MAKE) do_depend" ; \
- (cd $$D ; $(MAKE) do_depend ); \
- fi ; \
- done ;\
- fi
-
-# DO NOT DELETE THIS LINE -- g++dep uses it.
-# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
-
-Foo.o : Foo.cc \
- $(srcdir)/Foo.h
-a.o : a.cc
-bf.o : bf.cc
-bm.o : bm.cc
-ex_bar.o : ex_bar.cc \
- $(srcdir)/ex_bar.cc
-foo_func.o : foo_func.cc \
- $(srcdir)/Foo.h
-foo_main.o : foo_main.cc \
- $(srcdir)/Foo.h
-
-# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
diff --git a/contrib/libg++/libg++/test-install/a.cc b/contrib/libg++/libg++/test-install/a.cc
deleted file mode 100644
index b704ee07adaf..000000000000
--- a/contrib/libg++/libg++/test-install/a.cc
+++ /dev/null
@@ -1,10 +0,0 @@
-#include <stream.h>
-#include <String.h>
-
-String s1 = "Hello";
-String s2 = " world!\n";
-
-main()
-{
- cout << s1 << s2 ;
-}
diff --git a/contrib/libg++/libg++/test-install/bf.cc b/contrib/libg++/libg++/test-install/bf.cc
deleted file mode 100644
index 0a32b4c85c56..000000000000
--- a/contrib/libg++/libg++/test-install/bf.cc
+++ /dev/null
@@ -1,18 +0,0 @@
-#include <stream.h>
-#include <String.h>
-
-// gcc-2.3.2 is buggy, and can't deal with the following.
-// Take the wimpy way out for now until 2.3.3 is released.
-#if 0
-String s1 = String("Hello ");
-#else
-String s1("Hello ");
-#endif
-String s2(" world!\n");
-
-int f()
-{
- cout << s1 + s2;
- return cout.good();
-}
-
diff --git a/contrib/libg++/libg++/test-install/bm.cc b/contrib/libg++/libg++/test-install/bm.cc
deleted file mode 100644
index bbca52a27fdb..000000000000
--- a/contrib/libg++/libg++/test-install/bm.cc
+++ /dev/null
@@ -1,14 +0,0 @@
-#include <errno.h>
-#include <stdlib.h>
-#include <stdio.h>
-
-extern int f();
-
-int main()
-{
- // We (mis-)use errno supposedly to check that we got a good errno.h
- // and libc. I don't quite buy it, but what the hell ... --Per
- errno = f();
- fprintf(stderr, "Return-code: %d (should be 1)\n", errno);
- exit(0);
-}
diff --git a/contrib/libg++/libg++/test-install/configure.in b/contrib/libg++/libg++/test-install/configure.in
deleted file mode 100644
index ec8c85117aad..000000000000
--- a/contrib/libg++/libg++/test-install/configure.in
+++ /dev/null
@@ -1,25 +0,0 @@
-# This file is a shell script fragment that supplies the information
-# necessary to tailor a template configure script into the configure
-# script appropriate for this directory. For more information, check
-# any existing configure script.
-
-configdirs=""
-srctrigger=Foo.h
-srcname="libg++ sanity checks"
-
-target_makefile_frag=../target-mkfrag
-package_makefile_frag=Make.pack
-
-# per-host:
-
-# per-target:
-
-TOLIBGXX=../
-MOSTLYCLEAN='${TEMP_FILES} dfoo_main da db core '
-ALL='$(NOTHING)'
-
-(. ${srcdir}/../config.shared) >${package_makefile_frag}
-
-# post-target:
-
-rm -f ${package_makefile_frag}
diff --git a/contrib/libg++/libg++/test-install/ex_bar.cc b/contrib/libg++/libg++/test-install/ex_bar.cc
deleted file mode 100644
index 29f58903e5cb..000000000000
--- a/contrib/libg++/libg++/test-install/ex_bar.cc
+++ /dev/null
@@ -1,123 +0,0 @@
-// bar.cc - test the runtime support for GNU C++ exception handling.
-// inspired by a PROLOG toplevel loop by Heinz Seidl (hgs@cygnus.com)
-
-#define S(s) SS(s)
-#define SS(s) # s
-
-extern "C" {
- int printf (const char*, ...);
- void abort ();
- int exit (int);
-};
-
-enum TERM { ATOM, INTEGER, DOUBLE, STRUCTURE, LIST, REF, EOF };
-
-exception {
- int number;
- char * message;
-} EX_IMPL;
-
-exception {
- TERM Term;
- char * message;
-} EX_CALL;
-
-exception {} EX_EOF;
-
-
-void pread (TERM & Term)
-{
- // simulate an input buffer
- //
- static int p = 0;
- TERM buffer[] =
- { REF,
- LIST,
- STRUCTURE,
- DOUBLE,
- INTEGER,
- ATOM
- };
- const int blen = sizeof (buffer) / sizeof (TERM);
-
- if ( p < blen)
- Term = buffer[p++];
- else
- Term = EOF;
-}
-
-void call (const TERM & Term) raises EX_CALL, EX_EOF, EX_IMPL
-{
- switch (Term)
- {
- case REF:
- raise EX_CALL (REF,
- "Sorry - dereferencing not implemented (REF).");
- break;
- case LIST:
- raise EX_CALL (LIST,
- "LISTs are not callable (LIST).");
- break;
- case STRUCTURE:
- raise EX_CALL (STRUCTURE,
- "Undefined predicate (STRUCTURE).");
- break;
- case DOUBLE:
- raise EX_CALL (DOUBLE,
- "DOUBLEs are not callable (DOUBLE).");
- break;
- case INTEGER:
- raise EX_CALL (INTEGER,
- "INTEGERs are not callable (INTEGER).");
- case ATOM:
- raise EX_CALL (ATOM,
- "Undefined predicate (ATOM).");
- break;
- case EOF:
- raise EX_EOF ();
- break;
- default:
- raise EX_IMPL ( Term,
- "Implementation error in file " __FILE__
- " at line " S(__LINE__) " .");
- }
-}
-
-void main()
-{
- try {
- while (1) {
- try {
- while (1)
- {
- TERM Term;
- pread (Term);
- call (Term);
- }
- } except ep {
- EX_CALL {
- printf ("EXCEPTION(%d) : %s\n", ep.Term, ep.message);
- }
- EX_EOF {
- printf ("EOF encountered.\n");
- raise ep;
- }
- default {
- raise ep;
- }
- }
- }
- } except ep {
- EX_IMPL {
- printf ("FATAL(%d): %s\n", ep.number, ep.message);
- abort();
- }
- EX_EOF {
- printf ("Good bye.\n");
- }
- default {
- raise ep;
- }
- }
- return 0;
-}
diff --git a/contrib/libg++/libg++/test-install/expected.out b/contrib/libg++/libg++/test-install/expected.out
deleted file mode 100644
index 39be0dbc2c7c..000000000000
--- a/contrib/libg++/libg++/test-install/expected.out
+++ /dev/null
@@ -1,15 +0,0 @@
-Constructing Foo(1) "static_foo"
-Constructing Foo(2) "static_foo"
-Constructing Foo(3) "automatic_foo"
-Constructing Foo(4) "default-foo"
-Initializing Foo(5) "default-foo" with Foo(4)
-Destructing Foo(4) "default-foo" (remaining foos: 4)
-Constructing Foo(5) "other_foo1"
-Constructing Foo(6) "other_foo2"
-Copying Foo(5) "other_foo1" to Foo(6)
-Destructing Foo(6) "other_foo1" (remaining foos: 5)
-Destructing Foo(5) "other_foo1" (remaining foos: 4)
-Destructing Foo(5) "default-foo" (remaining foos: 3)
-Destructing Foo(3) "automatic_foo" (remaining foos: 2)
-Destructing Foo(2) "static_foo" (remaining foos: 1)
-Destructing Foo(1) "static_foo" (remaining foos: 0)
diff --git a/contrib/libg++/libg++/test-install/foo_func.cc b/contrib/libg++/libg++/test-install/foo_func.cc
deleted file mode 100644
index ef941fbf18a2..000000000000
--- a/contrib/libg++/libg++/test-install/foo_func.cc
+++ /dev/null
@@ -1,17 +0,0 @@
-// test program for Class Foo
-
-#include "Foo.h"
-
-static Foo static_foo( "static_foo");
-
-Foo f()
-{
- Foo x;
- return x;
-}
-
-void g()
-{
- Foo other_foo1 = Foo( "other_foo1"), other_foo2 = Foo( "other_foo2");
- other_foo2 = other_foo1;
-}
diff --git a/contrib/libg++/libg++/test-install/foo_main.cc b/contrib/libg++/libg++/test-install/foo_main.cc
deleted file mode 100644
index bd235408ae51..000000000000
--- a/contrib/libg++/libg++/test-install/foo_main.cc
+++ /dev/null
@@ -1,40 +0,0 @@
-// main program for Class Foo
-
-extern "C" {
-// Some <assert.h> implementations (e.g. SUNOS 4.1) are broken,
-// in that they require <stdio.h>. But, if gcc/g++ is installed
-// correctly, you should get gcc's assert.h.
-// If the compile fails, it means the wrong include files are in use!
-#include <assert.h>
-};
-#include "Foo.h"
-
-extern "C" void __init_start();
-
-extern Foo f(void);
-extern void g(void);
-
-/* This function should *not* be called by the environment. There is
- no way in C++ to ``run something after the initializers but before main()''.
- The library that depends on this (NIHCL) is broken. -- John Gilmore
- We leave this here to test that future changes to the compiler
- do not re-introduce this losing ``feature''. */
-void
-__init_start()
-{
- Foo::init_foo();
-}
-
-static Foo static_foo( "static_foo");
-
-main()
-{
- assert (Foo::nb_foos() == 2);
- Foo automatic_foo( "automatic_foo");
- Foo bla_foo = f();
- assert (Foo::nb_foos() == 4);
- g();
- assert (Foo::nb_foos() == 4);
- // `automatic_foo' and `bla_foo' are destructed here
-}
-
diff --git a/contrib/libg++/libg++/tests/ChangeLog b/contrib/libg++/libg++/tests/ChangeLog
deleted file mode 100644
index de6d9d79821c..000000000000
--- a/contrib/libg++/libg++/tests/ChangeLog
+++ /dev/null
@@ -1,346 +0,0 @@
-Wed Feb 28 13:42:46 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * Makefile.sh: Remove tCurses rules.
-
-Wed Jan 24 18:27:16 1996 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * Makefile.sh (TSRCS): Take out tCurses.cc.
- (TOUTS): Remove tCurses.
- (tests): Take off tCurses and the message about running tCurses.
-
-Wed Nov 15 20:27:22 1995 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * Makefile.sh (tCurses): New rule to only link dynamically if we
- have a shared curses library.
- (LIB_FOR_tCurses): Delete. Take tCurses out of the for loop.
-
-Fri Sep 1 16:56:27 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * tBitString.cc, tBitString.exp: Added test for operator +=,
- from Curtis A. Snyder <C1S@icf.hrb.com>.
-
-Mon Aug 21 11:45:25 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * configure.in (srctrigger): Use tObstack.cc instead of tComplex.cc.
-
- * Makefile.sh: Forget tComplex.
- * tComplex.*: Remove.
-
-Sun Jun 11 12:22:21 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * test_h.cc: Don't include <memory.h>.
-
-Fri May 5 13:04:17 1995 Mike Stump <mrs@cygnus.com>
-
- * Move `for' decl out of `for' statement.
-
-Fri Jan 20 00:19:57 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * test_h.cc: No longer include complex.h.
-
-Wed Dec 14 18:49:12 1994 Per Bothner <bothner@kalessin.cygnus.com>
-
- * tQueue.cc (test_resize), tQueue.inp: New test case from
- Jocelyn Serot <jserot@alize.univ-bpclermont.fr>.
-
-Tue Dec 13 15:47:36 1994 Per Bothner <bothner@kalessin.cygnus.com>
-
- * tiLList.cc (main): Add explicit variable to avoid warning
- on passing non-lvalue by reference.
-
-Sat Nov 5 19:13:38 1994 Jason Merrill (jason@phydeaux.cygnus.com)
-
- * Makefile.sh: Don't display the 'echo' command.
-
- * Makefile.in (LIBS): Remove.
-
-Sat Nov 5 14:29:00 1994 Per Bothner <bothner@kalessin.cygnus.com>
-
- * tRational.cc (M_PI): #define it if it isn't defined.
-
- * tiLList.cc: Added new test from Magnus Nordborg.
- * tiLList.exp: New file.
- * Makefile.sh (check-tiLList): Merge with check-${TEST}.
-
-Mon Oct 24 16:03:14 1994 Per Bothner <bothner@kalessin.cygnus.com>
-
- * Makefile.sh: Re-arrange so tFix* tCurses etc don't need LIBTEST.
-
-Thu Sep 29 03:23:24 1994 Philippe De Muyter (phdm@info.ucl.ac.be)
-
- * test_h.cc: do not include 3 times <fcntl.h>, some systems
- do not like that. Include <sys/wait.h> only if _G_HAVE_SYS_WAIT
-
-Mon Sep 5 13:07:01 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * test_h.cc: Remove #include <regex.h>.
-
-Thu Sep 1 17:35:33 1994 Jason Merrill (jason@deneb.cygnus.com)
-
- * tObstack.cc (main): Make output independent of size of pointers.
- * tObstack.exp: Update accordingly.
-
-Fri Aug 12 17:36:44 1994 Brendan Kehoe (brendan@lisa.cygnus.com)
-
- * tFix24.cc (check): Add unsigned int version.
-
-Tue Jun 28 03:07:03 1994 Jason Merrill (jason@deneb.cygnus.com)
-
- * tFix.cc: Adjust to new organization of Fix class (overflow
- handlers are now static members).
-
-Mon Jun 27 18:37:05 1994 Jason Merrill (jason@deneb.cygnus.com)
-
- * tVec.cc (print): Take parm by value.
-
- * tBitString.cc (accumtest): Make parms const refs.
-
-Wed Jun 15 11:04:47 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * tString.cc (utiltest), tString.exp: Add a test to capitalize
- a string with a bunch of apostrophes and single quotes.
-
-Wed Jun 1 13:59:53 1994 Jason Merrill (jason@deneb.cygnus.com)
-
- * tiLList.cc: Explicitly instantiate [SD]L{Node,List}<int>.
-
-Wed May 25 15:42:21 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * Makefile.sh: Fixes so that you don't need to build libtest.a
- for tests that don't need it.
-
-Fri May 13 16:49:13 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * tCurses.cc: Check _G_HAVE_CURSES, so we can compile
- (though not do anything useful) if curses.h is missing.
-
-Wed May 11 00:40:43 1994 Jason Merrill (jason@deneb.cygnus.com)
-
- Make libg++ build with gcc -ansi -pedantic-errors
- * tRational.cc: Wrap use of <? and >? in #ifndef __STRICT_ANSI__
- * tBitSet.cc: Returns void.
-
-Thu Feb 10 16:44:04 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * tBitSet.cc (test4), tBitSet.exp: Add a new test.
-
-Sat Dec 4 16:14:38 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * test_h.cc: Remove #include <sys/socket.h> and <sys/resource.h>.
- They're included by <osfcn.h>, and the multiple inclusion
- loses on some systems (e.g. Ultrix). Also, don't #include
- <sys/param.h>, as it's non-Posix.
-
-Wed Nov 24 12:41:07 1993 Jeffrey A. Law (law@snake.cs.utah.edu)
-
- * test_h.cc: Include limits.h rather than values.h.
-
-Mon Oct 11 15:16:52 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * tSet.exp: Change VOHSet output to match new code.
-
-Wed Sep 15 14:46:40 1993 Mike Stump (mrs@cygnus.com)
-
- * Makefile.sh (LIB_FOR_tInteger): Add -lm for tInteger.
-
-Thu Aug 26 18:05:20 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * tInteger.cc (iotest), tInteger.inp, tInteger.exp:
- Test a couple of more things.
-
-Thu Aug 19 21:41:40 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * configure.in (CXXINCLUDES): Remove line - not needed.
-
-Thu Aug 19 12:44:14 1993 Mike Stump (mrs@cygnus.com)
-
- * configure.in (CXXINCLUDES): Add -I../../libio so that make check
- works when srcdir != objdir.
-
-Sat Jul 24 17:50:52 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * tComplex.cc: Add #include <builtin.h>, for abs(double).
-
-Tue Jun 1 17:02:12 1993 Per Bothner (bothner@rtl.cygnus.com)
-
- * Makefile.sh: Take out tFile, since it depends on GNU iostream.
- * tInteger.cc (main), tInteger.exp: Add test for setbit/clearbit.
- * tRational.cc (pitest): Only test >? and <? if g++.
- * tRational.cc (simpletest), tRational.exp: New test.
- * tString.cc (splittest): Cast 0 to (char*), to avoid ambiguity.
- * tFix.cc (checkb), tFix16.cc (check), tFix24.cc (check):
- New overloaded functions, to avoid ambiguities.
- * tFix.cc (main): Explicitly call Integer::as_double().
- * tBag.cc, tBitSet.cc, tBitString.cc, tDeque.cc, tFix.cc, tFix16.cc,
- tFix24.cc, tInteger.cc, tMap.cc, tObstack.cc, tPQ.cc, tQueue.cc,
- tRational.cc, tSet.cc, tStack.cc, tVec.cc: Make sure main() return 0.
- * test_h.cc: Don't include GNU-iostream specific files unless
- we're using GNU iostream.
-
-Fri May 21 12:57:37 1993 Per Bothner (bothner@deneb.cygnus.com)
-
- * configure.in: Define TOLIBGXX.
- * tiLList.cc, tList.cc: #include <iostream.h>, not old <stream.h>.
-
-Tue Apr 27 13:53:46 1993 Per Bothner (bothner@cygnus.com)
-
- * Makefile.in: Removed bogus re-definition of WRAP_C_INCLUDES/
- * tString.cc, tFile.cc, tComplex, tRandom.cc (main): Return 0.
-
-Mon Apr 19 01:30:01 1993 Per Bothner (bothner@cygnus.com)
-
- * Makefile.in, configure.in: Re-vamped configure scheme.
- * Makefile.sh: New shell scipt, used at configure time.
- This generates the repetitive rules of the Makefile.
- * tBitSet.cc, tBitString.cc: Prefer new "standardized"
- method names prev() instead of previous().
-
-Thu Jan 21 18:27:27 1993 Per Bothner (bothner@cygnus.com)
-
- * tFix.cc: Remove obsolete 'overload' declarations.
-
-Mon Jan 18 16:49:19 1993 Brendan Kehoe (brendan@lisa.cygnus.com)
-
- * tString.cc: Include stream.h for dec(int) support.
-
-Sun Nov 1 14:44:13 1992 Per Bothner (bothner@cygnus.com)
-
- * tInteger.cc (modtest): New function, from a bug report.
- * tInteger.exp: New output.
-
-Fri Oct 16 15:33:11 1992 Per Bothner (bothner@rtl.cygnus.com)
-
- * Makefile.in: Remove some obsolete junk.
-
-Fri Sep 25 11:32:47 1992 Per Bothner (bothner@rtl.cygnus.com)
-
- * tiLList.cc: New files (derived from tList.cc) to
- check template-based versions of SLList and DLList.
- * Makefile.in: Use tiLList.cc.
-
-Mon Aug 10 15:11:42 1992 Per Bothner (bothner@cygnus.com)
-
- * Makefile.in (make-tests): New rule to build all the
- tests without running them (useful when ross-compiling.)
- * tSet.cc (main): Rename argc <-> argv.
- * tSet.exp, tBag.exp, tMap.exp: Update to handle new hashing
- policy for <int>VH{Set,Bag,Map} classes.
-
-Mon Jul 20 15:45:29 1992 Mike Stump (mrs@cygnus.com)
-
- * tObstack.cc (main): Add cast from void * to char since it is
- not a standard conversion.
-
-Fri Jun 26 11:46:53 1992 Per Bothner (bothner@rtl.cygnus.com)
-
- * tRational.cc: Use the slightly more standard M_PI
- instead of plain PI.
-
-Wed Jun 17 16:50:45 1992 Per Bothner (bothner@rtl.cygnus.com)
-
- * Makefile.in: Fix *clean rules. Add $(LDFLAGS) when linking.
- Remove the '-' error suppressing prefix so that failing
- checks cause the make to fail.
- Clean out the remnants of the obsolete runtests rule.
- * out.iostream, out.old-stream: Removed - no longer used.
- * test_h.cc: Don't #include <bstring.h> - it is non-standard.
-
-Thu May 14 15:08:37 1992 Per Bothner (bothner@rtl.cygnus.com)
-
- * test_h.cc: Only #include sys/socket.h and sys/resource.h
- if these are available (according to _G_config.h).
-
-Fri May 8 15:41:12 1992 Per Bothner (bothner@rtl.cygnus.com)
-
- * Makefile.in: Pass $(NOSTDINC) to compiler.
-
-Thu May 7 00:48:11 1992 Per Bothner (bothner@rtl.cygnus.com)
-
- * tList.cc (randseq): Evaluate 1st parameter of recursive
- call to randeq() first (separately). (Unspecified order of
- parameter evaluation was why the sun3 and sun4 versions
- gave different results.)
-
-Wed May 6 01:10:58 1992 Per Bothner (bothner@rtl.cygnus.com)
-
- * tList.cc: For randseq(), use a dumb but portable
- "random" number generator. (For unknown reason, the
- old code gave different result on sun3 and sun4.)
- * tList.exp: New output.
- * Makefile.in: Don't run 'check-tRandom' as part of
- 'check', because it isn't portable (byte-order problems?).
-
- * iostream.out: Split into multiple files, moving the
- tFile output into tFile.exp, etc.
- * Makefile.in: Add lots of new rules for check-tFile,
- check-tObstack etc. THese run an individual test,
- and compare the output to the matching *.exp file.
- This makes it easier to track down problems, and
- adds flexibility by making it easier to add or remove tests.
- * test_h.cc: Don't include bool.h, which is deprecated
- because it is likely to conflict with other header files.
-
-Fri Apr 17 14:48:26 1992 Per Bothner (bothner@cygnus.com)
-
- * tPQ.cc: Update delete of array to modern syntax.
- * test_h.cc: #include _G_config.h.
- Only #include <sys/resource.h> if not SYSV.
-
-Tue Mar 10 18:16:28 1992 Per Bothner (bothner@cygnus.com)
-
- * tests_h.cc: Include sys/time.h before sys/resource.h,
- according to traditional requirement.
-
-Fri Mar 6 15:11:36 1992 Per Bothner (bothner@cygnus.com)
-
- * tests_h.cc: Don't include malloc.h, since it is
- not a standard include file.
-
-Wed Feb 26 18:04:40 1992 K. Richard Pixley (rich@cygnus.com)
-
- * Makefile.in, configure.in: removed traces of namesubdir,
- -subdirs, $(subdir), $(unsubdir), some rcs triggers. Forced
- copyrights to '92, changed some from Cygnus to FSF.
-
-Fri Jan 31 17:07:30 1992 Per Bothner (bothner at cygnus.com)
-
- * Makefile.in: Add $(LSRCS) (the generated source files)
- to DEPEND_SOURCES. (Otherwise, make fails to generate
- some of the i*.h include files.)
-
- * Makefile.in: Add i{CH,Splay}Node.{cc,h,o} (because
- CHNode and SplayNode have been moved into their own
- include files).
- * out.iostream: Change to match real output (now that
- all discrepancies from old output are explained).
-
-Sat Jan 25 00:32:45 1992 Per Bothner (bothner at cygnus.com)
-
- * Makefile.in: Replace libtest.a by LIBTEST macro.
- * out.iostream: "Fix".
- * tFile.cc: New iostream class and classes derived from
- it allow us to support much more of the fucntionality
- of the old library.
-
-Thu Jan 16 18:00:04 1992 Per Bothner (bothner at cygnus.com)
-
- * expected.out, out_iostream, out.old_stream, Makefile.in:
- Replace expected.out by two versions: One when using new
- iostreams, and one for old streams.
- * Makefile.in: Some tweaks to 'make depend.'
- * tFix16.cc, tFix24.cc: Replace check macro by overloaded
- inline functions. This forces side effects (including
- error messages) when evaluating the operands to happen
- before printing.
- * tFile.cc: Comditionally compile depending on
- _OLD_STREAMS macro (defined by stream.h) so that most
- tests work for both new iostreams as well as old streams.
- * test_h.cc: Remove obsolete include files.
-
-Sun Jan 5 00:03:06 1992 Per Bothner (bothner at cygnus.com)
-
- * Makefile.in, configure.in: Add 'make depend' support.
- * tBag.cc, tMap.cc, tPQ.cc, tSet.cc: #include <builtin.h>,
- because new iostream library doesn't automatically include it.
- * tFile.cc, test_h.cc: #ifdef out code that won't work with new
- iostream library. Other tweaks for new library.
diff --git a/contrib/libg++/libg++/tests/Makefile.in b/contrib/libg++/libg++/tests/Makefile.in
deleted file mode 100644
index 8faf11284a4d..000000000000
--- a/contrib/libg++/libg++/tests/Makefile.in
+++ /dev/null
@@ -1,22 +0,0 @@
-srcdir = .
-
-#### package, host, target, and site dependent Makefile fragments come in here.
-##
-
-GENCLASS = ../genclass/genclass
-PROTODIR = $(srcdir)/../src/gen
-
-# compilation notes:
-# The following g++ warnings are expected to appear:
-#
-# 2. Several warnings from genclass about classes with only .h, no .cc files
-#
-# 3. A few harmless reminder warnings that some classes have no data members.
-#
-# 4. Many harmless warnings that arguments to vector-delete are unnecessary
-# when deleting arrays of builtin types.
-
-#--- NOTE: Lots of stuff gets added by ${srcdir}/Makefile.sh
-
-Makefile: $(srcdir)/Makefile.sh
-
diff --git a/contrib/libg++/libg++/tests/Makefile.sh b/contrib/libg++/libg++/tests/Makefile.sh
deleted file mode 100755
index 427ad0182827..000000000000
--- a/contrib/libg++/libg++/tests/Makefile.sh
+++ /dev/null
@@ -1,174 +0,0 @@
-cat <<'EOF'
-# test files
-TSRCS = tObstack.cc tString.cc tInteger.cc tRational.cc \
- tBitSet.cc tBitString.cc tRandom.cc tList.cc tPlex.cc \
- tLList.cc tVec.cc tStack.cc tQueue.cc tDeque.cc tPQ.cc tSet.cc tBag.cc \
- tMap.cc tFix.cc tFix16.cc tFix24.cc \
- tGetOpt.cc \
- tiLList.cc
-EOF
-
-TESTS0="tObstack tString tInteger tRational tBitSet"\
-" tBitString tFix tFix16 tFix24 tRandom"
-TESTS1="tStack tQueue tDeque tPQ tSet tBag tMap tList tPlex tLList tVec"
-
-cat <<EOF
-# executables
-TOUTS = test_h ${TESTS0} ${TESTS1} tiLList tGetOpt
-
-EOF
-
-cat <<'EOF'
-# files for archived prototype classes
-LOBJS = \
- iList.o iSLList.o iDLList.o iVec.o iAVec.o \
- iPlex.o iFPlex.o iXPlex.o iRPlex.o iMPlex.o \
- iSet.o iBag.o iMap.o iPQ.o \
- iXPSet.o iOXPSet.o iSLSet.o iOSLSet.o iBSTSet.o iCHNode.o \
- iAVLSet.o iSplayNode.o iSplaySet.o iVHSet.o iVOHSet.o iCHSet.o \
- iXPBag.o iOXPBag.o iSLBag.o iOSLBag.o iSplayBag.o iVHBag.o iCHBag.o \
- iVHMap.o iCHMap.o iSplayMap.o iAVLMap.o iRAVLMap.o \
- iSplayPQ.o iPHPQ.o iXPPQ.o \
- iVStack.o iVQueue.o iStack.o iQueue.o iDeque.o \
- iXPStack.o iSLStack.o iXPQueue.o iSLQueue.o iXPDeque.o iDLDeque.o
-
-LSRCS = \
- iList.cc iSLList.cc iDLList.cc iVec.cc iAVec.cc \
- iPlex.cc iFPlex.cc iXPlex.cc iRPlex.cc iMPlex.cc \
- iSet.cc iBag.cc iMap.cc iPQ.cc \
- iXPSet.cc iOXPSet.cc iSLSet.cc iOSLSet.cc iBSTSet.cc iCHNode.cc \
- iAVLSet.cc iSplayNode.cc iSplaySet.cc iVHSet.cc iVOHSet.cc iCHSet.cc \
- iXPBag.cc iOXPBag.cc iSLBag.cc iOSLBag.cc iSplayBag.cc iVHBag.cc iCHBag.cc \
- iVHMap.cc iCHMap.cc iSplayMap.cc iAVLMap.cc iRAVLMap.cc \
- iSplayPQ.cc iPHPQ.cc iXPPQ.cc \
- iVStack.cc iVQueue.cc iStack.cc iQueue.cc iDeque.cc \
- iXPStack.cc iSLStack.cc iXPQueue.cc iSLQueue.cc iXPDeque.cc iDLDeque.cc
-
-DEPEND_SOURCES = $(srcdir)/*.cc $(LSRCS)
-
-LHDRS = idefs.h
-
-.PHONY: all
-all:
-
-.PHONY: info
-info:
-.PHONY: install-info
-install-info:
-.PHONY: clean-info
-clean-info:
-
-.PHONY: check
-check: tests
-
-.PHONY: check-tGetOpt
-EOF
-
-for TEST in ${TESTS0} ${TESTS1} tiLList ; do
- echo ".PHONY: check-${TEST}"
- if [ -f ${srcdir}/${TEST}.inp ] ; then
- echo "check-${TEST}: ${TEST}" '$(srcdir)'"/${TEST}.inp"
- echo " ./${TEST} < "'$(srcdir)'"/${TEST}.inp > ${TEST}.out 2>&1"
- else
- echo "check-${TEST}: ${TEST}"
- echo " ./${TEST} > ${TEST}.out 2>&1"
- fi
- echo ' diff -b $(srcdir)/'"${TEST}.exp ${TEST}.out"
-done
-
-cat <<'EOF'
-
-check-tGetOpt: tGetOpt $(srcdir)/tGetOpt.inp
- ./tGetOpt -abc -de10 -2000 -h3i \
- <$(srcdir)/tGetOpt.inp >tGetOpt.out 2>&1
- diff -b $(srcdir)/tGetOpt.exp tGetOpt.out
-
-$(TOUTS): $(LIBGXX)
-
-LIBTEST=libtest.a
-
-# We don't do check-tRandom, because it is not portable.
-
-# Comment this out if your compiler doesn't handle templates:
-CHECK_TEMPLATES=check-templates
-
-tests checktests: clean_tests test_h \
- check-tObstack check-tString check-tInteger \
- check-tRational check-tBitSet check-tBitString \
- check-tFix check-tFix16 check-tFix24 check-tGetOpt \
- check-tList check-tPlex check-tLList check-tVec \
- check-tStack check-tQueue check-tDeque check-tPQ \
- check-tSet check-tBag check-tMap $(CHECK_TEMPLATES)
- ./test_h
-
-check-templates: check-tiLList
-
-# Build all the tests, but don't run them. (Useful when cross-compiling.)
-
-EOF
-
-cat <<'EOF'
-make-tests: $(TOUTS)
-
-test_h: test_h.o
- $(CXX) $(LDFLAGS) test_h.o -o $@ $(LIBS) -lm
-
-$(LIBTEST): $(LHDRS) $(LOBJS)
- rm -f $(LIBTEST)
- $(AR) r $(LIBTEST) $(LOBJS)
- $(RANLIB) $(LIBTEST)
-
-#
-# other tests
-#
-EOF
-
-LIB_FOR_tRational=-lm
-LIB_FOR_tInteger=-lm
-LIB_FOR_tRandom=-lm
-LIB_FOR_tFix=-lm
-LIB_FOR_tFix16=-lm
-LIB_FOR_tFix24=-lm
-
-for TEST in $TESTS0 tiLList tGetOpt; do
- echo "${TEST}: ${TEST}.o"
- echo ' $(CXX) $(LDFLAGS)' "${TEST}.o" '-o $@ $(LIBS)' \
- `eval echo '$LIB_FOR_'$TEST`
- echo ""
-done
-for TEST in twrapper tgwrapper $TESTS1; do
- echo "${TEST}: " '$(LIBTEST)' " ${TEST}.o"
- echo ' $(CXX) $(LDFLAGS)' "${TEST}.o" '-o $@ $(LIBTEST) $(LIBS)'
- echo ""
-done
-
-cat <<'EOF'
-idefs.h:
- PROTODIR=$(PROTODIR); export PROTODIR; $(GENCLASS) int val defs i
-EOF
-
-for TEST in Set XPSet OXPSet SLSet OSLSet BSTSet AVLSet SplayNode SplaySet VHSet VOHSet CHSet CHNode Bag XPBag OXPBag SLBag OSLBag SplayBag VHBag CHBag PQ PHPQ SplayPQ XPPQ Stack Queue Deque SLStack SLQueue DLDeque List Plex FPlex XPlex MPlex RPlex FPStack XPStack FPQueue XPQueue XPDeque SLList DLList Vec AVec; do
- echo "i$TEST.h i$TEST.cc:"
- echo ' PROTODIR=$(PROTODIR); export PROTODIR; $(GENCLASS) int val' $TEST i
-done
-
-for TEST in Map VHMap CHMap SplayMap AVLMap RAVLMap; do
- echo "i${TEST}.h i$TEST.cc:"
- echo ' PROTODIR=$(PROTODIR); export PROTODIR; $(GENCLASS) -2 int val int val' $TEST i
-done
-
-cat <<'EOF'
-iVStack.h iVStack.cc: iStack.h
- PROTODIR=$(PROTODIR); export PROTODIR; $(GENCLASS) int val VStack i
-iVQueue.h iVQueue.cc: iQueue.h
- PROTODIR=$(PROTODIR); export PROTODIR; $(GENCLASS) int val VQueue i
-
-relink: force
- rm -f $(TOUTS)
-
-.PHONY: clean_tests
-clean_tests: force
- rm -f *.out
-
-force:
-EOF
diff --git a/contrib/libg++/libg++/tests/configure.in b/contrib/libg++/libg++/tests/configure.in
deleted file mode 100644
index 5608fb750be4..000000000000
--- a/contrib/libg++/libg++/tests/configure.in
+++ /dev/null
@@ -1,27 +0,0 @@
-# This file is a shell script fragment that supplies the information
-# necessary to tailor a template configure script into the configure
-# script appropriate for this directory. For more information, check
-# any existing configure script.
-
-configdirs=
-srctrigger=tObstack.cc
-srcname="tests for libg++"
-
-target_makefile_frag=../target-mkfrag
-package_makefile_frag=Make.pack
-
-# per-host:
-
-# per-target:
-
-TOLIBGXX=../
-ALL=force
-MOSTLYCLEAN='*.out *.o \#* core trie-gen ffile streamfile i*.cc i*.h CXX.hack* test.bye test.bye2 test.shell $(LIBTEST) $(TOUTS)'
-CLEAN=
-
-(. ${srcdir}/../config.shared) >${package_makefile_frag}
-
-# post-target:
-
-(. ${srcdir}/Makefile.sh) >>Makefile
-rm -f ${package_makefile_frag}
diff --git a/contrib/libg++/libg++/tests/depend b/contrib/libg++/libg++/tests/depend
deleted file mode 100644
index dbd33e1774c7..000000000000
--- a/contrib/libg++/libg++/tests/depend
+++ /dev/null
@@ -1,161 +0,0 @@
-
-
-# DO NOT DELETE THIS LINE -- g++dep uses it.
-# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
-
-tBag.o : tBag.cc \
- $(srcdir)/../$(IO_DIR)/stream.h \
- $(srcdir)/../$(IO_DIR)/iostream.h \
- $(srcdir)/../$(IO_DIR)/streambuf.h \
- iBag.h \
- iXPBag.h \
- iSLBag.h \
- iVHBag.h \
- iCHBag.h \
- iOXPBag.h \
- iOSLBag.h \
- iSplayBag.h
-tBitSet.o : tBitSet.cc \
- $(srcdir)/../$(IO_DIR)/stream.h \
- $(srcdir)/../$(IO_DIR)/iostream.h \
- $(srcdir)/../$(IO_DIR)/streambuf.h
-tBitString.o : tBitString.cc \
- $(srcdir)/../$(IO_DIR)/stream.h \
- $(srcdir)/../$(IO_DIR)/iostream.h \
- $(srcdir)/../$(IO_DIR)/streambuf.h
-tComplex.o : tComplex.cc \
- $(srcdir)/../$(IO_DIR)/stream.h \
- $(srcdir)/../$(IO_DIR)/iostream.h \
- $(srcdir)/../$(IO_DIR)/streambuf.h
-tCurses.o : tCurses.cc
-tDeque.o : tDeque.cc \
- $(srcdir)/../$(IO_DIR)/stream.h \
- $(srcdir)/../$(IO_DIR)/iostream.h \
- $(srcdir)/../$(IO_DIR)/streambuf.h \
- iDeque.h \
- iXPDeque.h \
- iDLDeque.h
-tFile.o : tFile.cc \
- $(srcdir)/../$(IO_DIR)/stream.h \
- $(srcdir)/../$(IO_DIR)/iostream.h \
- $(srcdir)/../$(IO_DIR)/streambuf.h \
- $(srcdir)/../$(IO_DIR)/strstream.h \
- $(srcdir)/../$(IO_DIR)/SFile.h \
- $(srcdir)/../$(IO_DIR)/fstream.h \
- $(srcdir)/../$(IO_DIR)/PlotFile.h
-tFix.o : tFix.cc \
- $(srcdir)/../$(IO_DIR)/stream.h \
- $(srcdir)/../$(IO_DIR)/iostream.h \
- $(srcdir)/../$(IO_DIR)/streambuf.h
-tFix16.o : tFix16.cc \
- $(srcdir)/../$(IO_DIR)/stream.h \
- $(srcdir)/../$(IO_DIR)/iostream.h \
- $(srcdir)/../$(IO_DIR)/streambuf.h
-tFix24.o : tFix24.cc \
- $(srcdir)/../$(IO_DIR)/stream.h \
- $(srcdir)/../$(IO_DIR)/iostream.h \
- $(srcdir)/../$(IO_DIR)/streambuf.h
-tGetOpt.o : tGetOpt.cc
-tInteger.o : tInteger.cc \
- $(srcdir)/../$(IO_DIR)/stream.h \
- $(srcdir)/../$(IO_DIR)/iostream.h \
- $(srcdir)/../$(IO_DIR)/streambuf.h
-tLList.o : tLList.cc \
- $(srcdir)/../$(IO_DIR)/stream.h \
- $(srcdir)/../$(IO_DIR)/iostream.h \
- $(srcdir)/../$(IO_DIR)/streambuf.h \
- iSLList.h \
- iDLList.h
-tList.o : tList.cc \
- $(srcdir)/../$(IO_DIR)/stream.h \
- $(srcdir)/../$(IO_DIR)/iostream.h \
- $(srcdir)/../$(IO_DIR)/streambuf.h \
- iList.h
-tMap.o : tMap.cc \
- $(srcdir)/../$(IO_DIR)/stream.h \
- $(srcdir)/../$(IO_DIR)/iostream.h \
- $(srcdir)/../$(IO_DIR)/streambuf.h \
- iMap.h \
- iSplayMap.h \
- iVHMap.h \
- iCHMap.h \
- iAVLMap.h \
- iRAVLMap.h
-tObstack.o : tObstack.cc \
- $(srcdir)/../$(IO_DIR)/stream.h \
- $(srcdir)/../$(IO_DIR)/iostream.h \
- $(srcdir)/../$(IO_DIR)/streambuf.h
-tPQ.o : tPQ.cc \
- $(srcdir)/../$(IO_DIR)/stream.h \
- $(srcdir)/../$(IO_DIR)/iostream.h \
- $(srcdir)/../$(IO_DIR)/streambuf.h \
- iPQ.h \
- iXPPQ.h \
- iPHPQ.h \
- iSplayPQ.h
-tPlex.o : tPlex.cc \
- $(srcdir)/../$(IO_DIR)/stream.h \
- $(srcdir)/../$(IO_DIR)/iostream.h \
- $(srcdir)/../$(IO_DIR)/streambuf.h \
- iPlex.h \
- iFPlex.h \
- iXPlex.h \
- iMPlex.h \
- iRPlex.h
-tQueue.o : tQueue.cc \
- $(srcdir)/../$(IO_DIR)/stream.h \
- $(srcdir)/../$(IO_DIR)/iostream.h \
- $(srcdir)/../$(IO_DIR)/streambuf.h \
- iQueue.h \
- iXPQueue.h \
- iVQueue.h \
- iSLQueue.h
-tRandom.o : tRandom.cc \
- $(srcdir)/../$(IO_DIR)/stream.h \
- $(srcdir)/../$(IO_DIR)/iostream.h \
- $(srcdir)/../$(IO_DIR)/streambuf.h
-tRational.o : tRational.cc \
- $(srcdir)/../$(IO_DIR)/stream.h \
- $(srcdir)/../$(IO_DIR)/iostream.h \
- $(srcdir)/../$(IO_DIR)/streambuf.h
-tSet.o : tSet.cc \
- $(srcdir)/../$(IO_DIR)/stream.h \
- $(srcdir)/../$(IO_DIR)/iostream.h \
- $(srcdir)/../$(IO_DIR)/streambuf.h \
- iSet.h \
- iXPSet.h \
- iSLSet.h \
- iVHSet.h \
- iVOHSet.h \
- iCHSet.h \
- iOXPSet.h \
- iOSLSet.h \
- iBSTSet.h \
- iAVLSet.h \
- iSplaySet.h
-tStack.o : tStack.cc \
- $(srcdir)/../$(IO_DIR)/stream.h \
- $(srcdir)/../$(IO_DIR)/iostream.h \
- $(srcdir)/../$(IO_DIR)/streambuf.h \
- iStack.h \
- iXPStack.h \
- iVStack.h \
- iSLStack.h
-tString.o : tString.cc \
- $(srcdir)/../$(IO_DIR)/stream.h \
- $(srcdir)/../$(IO_DIR)/iostream.h \
- $(srcdir)/../$(IO_DIR)/streambuf.h
-tVec.o : tVec.cc \
- $(srcdir)/../$(IO_DIR)/stream.h \
- $(srcdir)/../$(IO_DIR)/iostream.h \
- $(srcdir)/../$(IO_DIR)/streambuf.h \
- iVec.h \
- iAVec.h
-test_h.o : test_h.cc \
- $(srcdir)/../$(IO_DIR)/stream.h \
- $(srcdir)/../$(IO_DIR)/iostream.h \
- $(srcdir)/../$(IO_DIR)/streambuf.h \
- $(srcdir)/../$(IO_DIR)/istream.h \
- $(srcdir)/../$(IO_DIR)/ostream.h
-
-# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
diff --git a/contrib/libg++/libg++/tests/tBag.cc b/contrib/libg++/libg++/tests/tBag.cc
deleted file mode 100644
index aa99ec13901d..000000000000
--- a/contrib/libg++/libg++/tests/tBag.cc
+++ /dev/null
@@ -1,540 +0,0 @@
-/*
- a test file for Bags
-*/
-
-
-#ifdef PTIMES
-const int ptimes = 1;
-#else
-const int ptimes = 0;
-#endif
-
-#include <stream.h>
-#include <assert.h>
-#include <builtin.h>
-
-#define tassert(ex) { cerr << #ex; \
- if ((ex)) cerr << " OK\n"; \
- else cerr << " Fail\n"; }
-
-#include "iBag.h"
-
-unsigned int hash(int x) { return multiplicativehash(x) ; }
-
-int SIZE;
-
-int *nums;
-int *odds;
-int *dups;
-
-void add(int x[], intBag& a)
-{
- for (int i = 0; i < SIZE; ++i) a.add(x[i]);
-}
-
-
-#include <MLCG.h>
-
-MLCG randgen;
-
-void permute(int x[])
-{
- for (int i = 1; i < SIZE; ++i)
- {
- int j = randgen.asLong() % (i + 1);
- int tmp = x[i]; x[i] = x[j]; x[j] = tmp;
- }
-}
-
-void makenums()
-{
- for (int i = 0; i < SIZE; ++i) nums[i] = i + 1;
-}
-
-void makeodds()
-{
- for (int i = 0; i < SIZE; ++i) odds[i] = 2 * i + 1;
- permute(odds);
-}
-
-void makedups()
-{
- for (int i = 0; i < SIZE; i += 2) dups[i] = dups[i+1] = i/2 + 1;
- permute(dups);
-}
-
-void printBag(intBag& a)
-{
- int maxprint = 20;
- cout << "[";
- int k = 0;
- Pix i;
- for (i = a.first(); i != 0 && k < maxprint; a.next(i),++k)
- cout << a(i) << " ";
- if (i != 0) cout << "...]\n";
- else cout << "]\n";
-}
-
-
-void generictest(intBag& a, intBag& b, intBag& c)
-{
- c.clear();
- assert(c.empty());
- Pix k;
- for (k = a.first(); k != 0; a.next(k)) c.add(a(k));
- for (k = a.first(); k != 0; a.next(k)) assert(c.contains(a(k)));
- c.del(a(a.first()));
- Pix i = a.first();
- assert(!c.contains(a(i)));
- for (a.next(i); i != 0; a.next(i)) assert(c.contains(a(i)));
- c.add(a(a.first()));
- for (i = a.first(); i != 0; a.next(i)) assert(c.contains(a(i)));
- for (k = b.first(); k != 0; b.next(k)) c.add(b(k));
- for (i = b.first(); i != 0; b.next(i)) assert(c.contains(b(i)));
- for (i = a.first(); i != 0; a.next(i)) assert(c.contains(a(i)));
- for (k = a.first(); k != 0; a.next(k)) c.remove(a(k));
- for (i = a.first(); i != 0; a.next(i)) assert(!c.contains(a(i)));
- for (i = b.first(); i != 0; b.next(i)) c.del(b(i));
- assert(c.empty());
- assert(a.OK());
- assert(b.OK());
- assert(c.OK());
-}
-
-#include "iXPBag.h"
-
-void XPtest()
-{
- intXPBag a(SIZE);
- add(nums, a);
- assert(a.length() == SIZE);
- for (int j = 1; j <= SIZE; ++j) assert(a.contains(j));
- intXPBag b(SIZE);
- add(odds, b);
- assert(b.length() == SIZE);
- intXPBag c(SIZE);
- add(dups, c);
- assert(c.length() == SIZE);
- intXPBag d(a);
- add(nums, d);
- assert(d.length() == SIZE*2);
- cout << "a: "; printBag(a);
- cout << "b: "; printBag(b);
- cout << "c: "; printBag(c);
- cout << "d: "; printBag(d);
- for (int j = 1; j <= SIZE; ++j) assert(d.nof(j) == 2);
- d.del(1);
- assert(d.nof(1) == 1);
- d.del(1);
- assert(d.nof(1) == 0);
- d.remove(2);
- assert(!d.contains(2));
- for (Pix l = c.first(); l; c.next(l)) d.remove(c(l));
- assert(d.length() == SIZE);
-
- c.clear();
- assert(c.empty());
- for (Pix k = a.first(); k != 0; a.next(k)) c.add(a(k));
- for (Pix k = a.first(); k != 0; a.next(k)) assert(c.contains(a(k)));
- c.del(a(a.first()));
- Pix i = a.first();
- assert(!c.contains(a(i)));
- for (a.next(i); i != 0; a.next(i)) assert(c.contains(a(i)));
- c.add(a(a.first()));
- for (i = a.first(); i != 0; a.next(i)) assert(c.contains(a(i)));
- for (Pix k = b.first(); k != 0; b.next(k)) c.add(b(k));
- for (i = b.first(); i != 0; b.next(i)) assert(c.contains(b(i)));
- for (i = a.first(); i != 0; a.next(i)) assert(c.contains(a(i)));
- for (Pix k = a.first(); k != 0; a.next(k)) c.remove(a(k));
- for (i = a.first(); i != 0; a.next(i)) assert(!c.contains(a(i)));
- for (i = b.first(); i != 0; b.next(i)) c.del(b(i));
- assert(c.empty());
- assert(a.OK());
- assert(b.OK());
- assert(c.OK());
-
- generictest(a, b, c);
-}
-
-
-#include "iSLBag.h"
-
-void SLtest()
-{
- intSLBag a;
- add(nums, a);
- assert(a.length() == SIZE);
- int j;
- for (j = 1; j <= SIZE; ++j) assert(a.contains(j));
- intSLBag b;
- add(odds, b);
- assert(b.length() == SIZE);
- intSLBag c;
- add(dups, c);
- assert(c.length() == SIZE);
- intSLBag d(a);
- add(nums, d);
- assert(d.length() == SIZE*2);
- cout << "a: "; printBag(a);
- cout << "b: "; printBag(b);
- cout << "c: "; printBag(c);
- cout << "d: "; printBag(d);
- for (j = 1; j <= SIZE; ++j) assert(d.nof(j) == 2);
- d.del(1);
- assert(d.nof(1) == 1);
- d.del(1);
- assert(d.nof(1) == 0);
- d.remove(2);
- assert(!d.contains(2));
- for (Pix l = c.first(); l; c.next(l)) d.remove(c(l));
- assert(d.length() == SIZE);
-
- c.clear();
- assert(c.empty());
- for (Pix k = a.first(); k != 0; a.next(k)) c.add(a(k));
- for (Pix k = a.first(); k != 0; a.next(k)) assert(c.contains(a(k)));
- c.del(a(a.first()));
- Pix i = a.first();
- assert(!c.contains(a(i)));
- for (a.next(i); i != 0; a.next(i)) assert(c.contains(a(i)));
- c.add(a(a.first()));
- for (i = a.first(); i != 0; a.next(i)) assert(c.contains(a(i)));
- for (Pix k = b.first(); k != 0; b.next(k)) c.add(b(k));
- for (i = b.first(); i != 0; b.next(i)) assert(c.contains(b(i)));
- for (i = a.first(); i != 0; a.next(i)) assert(c.contains(a(i)));
- for (Pix k = a.first(); k != 0; a.next(k)) c.remove(a(k));
- for (i = a.first(); i != 0; a.next(i)) assert(!c.contains(a(i)));
- for (i = b.first(); i != 0; b.next(i)) c.del(b(i));
- assert(c.empty());
- assert(a.OK());
- assert(b.OK());
- assert(c.OK());
-
- generictest(a, b, c);
-}
-
-
-#include "iVHBag.h"
-
-void VHtest()
-{
- intVHBag a(SIZE);
- add(nums, a);
- assert(a.length() == SIZE);
- int j;
- for (j = 1; j <= SIZE; ++j) assert(a.contains(j));
- intVHBag b(SIZE);
- add(odds, b);
- assert(b.length() == SIZE);
- intVHBag c(SIZE);
- add(dups, c);
- assert(c.length() == SIZE);
- intVHBag d(a);
- add(nums, d);
- assert(d.length() == SIZE*2);
- cout << "a: "; printBag(a);
- cout << "b: "; printBag(b);
- cout << "c: "; printBag(c);
- cout << "d: "; printBag(d);
- for (j = 1; j <= SIZE; ++j) assert(d.nof(j) == 2);
- d.del(1);
- assert(d.nof(1) == 1);
- d.del(1);
- assert(d.nof(1) == 0);
- d.remove(2);
- assert(!d.contains(2));
- for (Pix l = c.first(); l; c.next(l)) d.remove(c(l));
- assert(d.length() == SIZE);
-
- c.clear();
- assert(c.empty());
- for (Pix k = a.first(); k != 0; a.next(k)) c.add(a(k));
- for (Pix k = a.first(); k != 0; a.next(k)) assert(c.contains(a(k)));
- c.del(a(a.first()));
- Pix i = a.first();
- assert(!c.contains(a(i)));
- for (a.next(i); i != 0; a.next(i)) assert(c.contains(a(i)));
- c.add(a(a.first()));
- for (i = a.first(); i != 0; a.next(i)) assert(c.contains(a(i)));
- for (Pix k = b.first(); k != 0; b.next(k)) c.add(b(k));
- for (i = b.first(); i != 0; b.next(i)) assert(c.contains(b(i)));
- for (i = a.first(); i != 0; a.next(i)) assert(c.contains(a(i)));
- for (Pix k = a.first(); k != 0; a.next(k)) c.remove(a(k));
- for (i = a.first(); i != 0; a.next(i)) assert(!c.contains(a(i)));
- for (i = b.first(); i != 0; b.next(i)) c.del(b(i));
- assert(c.empty());
- assert(a.OK());
- assert(b.OK());
- assert(c.OK());
-
- generictest(a, b, c);
-}
-
-#include "iCHBag.h"
-
-void CHtest()
-{
- intCHBag a(SIZE);
- add(nums, a);
- assert(a.length() == SIZE);
- int j;
- for (j = 1; j <= SIZE; ++j) assert(a.contains(j));
- intCHBag b(SIZE);
- add(odds, b);
- assert(b.length() == SIZE);
- intCHBag c(SIZE);
- add(dups, c);
- assert(c.length() == SIZE);
- intCHBag d(a);
- add(nums, d);
- assert(d.length() == SIZE*2);
- cout << "a: "; printBag(a);
- cout << "b: "; printBag(b);
- cout << "c: "; printBag(c);
- cout << "d: "; printBag(d);
- for (j = 1; j <= SIZE; ++j) assert(d.nof(j) == 2);
- d.del(1);
- assert(d.nof(1) == 1);
- d.del(1);
- assert(d.nof(1) == 0);
- d.remove(2);
- assert(!d.contains(2));
- for (Pix l = c.first(); l; c.next(l)) d.remove(c(l));
- assert(d.length() == SIZE);
-
- c.clear();
- assert(c.empty());
- for (Pix k = a.first(); k != 0; a.next(k)) c.add(a(k));
- for (Pix k = a.first(); k != 0; a.next(k)) assert(c.contains(a(k)));
- c.del(a(a.first()));
- Pix i = a.first();
- assert(!c.contains(a(i)));
- for (a.next(i); i != 0; a.next(i)) assert(c.contains(a(i)));
- c.add(a(a.first()));
- for (i = a.first(); i != 0; a.next(i)) assert(c.contains(a(i)));
- for (Pix k = b.first(); k != 0; b.next(k)) c.add(b(k));
- for (i = b.first(); i != 0; b.next(i)) assert(c.contains(b(i)));
- for (i = a.first(); i != 0; a.next(i)) assert(c.contains(a(i)));
- for (Pix k = a.first(); k != 0; a.next(k)) c.remove(a(k));
- for (i = a.first(); i != 0; a.next(i)) assert(!c.contains(a(i)));
- for (i = b.first(); i != 0; b.next(i)) c.del(b(i));
- assert(c.empty());
- assert(a.OK());
- assert(b.OK());
- assert(c.OK());
-
- generictest(a, b, c);
-}
-
-#include "iOXPBag.h"
-
-void OXPtest()
-{
- intOXPBag a(SIZE);
- add(nums, a);
- assert(a.length() == SIZE);
- int j;
- for (j = 1; j <= SIZE; ++j) assert(a.contains(j));
- intOXPBag b(SIZE);
- add(odds, b);
- assert(b.length() == SIZE);
- intOXPBag c(SIZE);
- add(dups, c);
- assert(c.length() == SIZE);
- intOXPBag d(a);
- add(nums, d);
- assert(d.length() == SIZE*2);
- cout << "a: "; printBag(a);
- cout << "b: "; printBag(b);
- cout << "c: "; printBag(c);
- cout << "d: "; printBag(d);
- for (j = 1; j <= SIZE; ++j) assert(d.nof(j) == 2);
- d.del(1);
- assert(d.nof(1) == 1);
- d.del(1);
- assert(d.nof(1) == 0);
- d.remove(2);
- assert(!d.contains(2));
- for (Pix l = c.first(); l; c.next(l)) d.remove(c(l));
- assert(d.length() == SIZE);
-
- c.clear();
- assert(c.empty());
- for (Pix k = a.first(); k != 0; a.next(k)) c.add(a(k));
- for (Pix k = a.first(); k != 0; a.next(k)) assert(c.contains(a(k)));
- c.del(a(a.first()));
- Pix i = a.first();
- assert(!c.contains(a(i)));
- for (a.next(i); i != 0; a.next(i)) assert(c.contains(a(i)));
- c.add(a(a.first()));
- for (i = a.first(); i != 0; a.next(i)) assert(c.contains(a(i)));
- for (Pix k = b.first(); k != 0; b.next(k)) c.add(b(k));
- for (i = b.first(); i != 0; b.next(i)) assert(c.contains(b(i)));
- for (i = a.first(); i != 0; a.next(i)) assert(c.contains(a(i)));
- for (Pix k = a.first(); k != 0; a.next(k)) c.remove(a(k));
- for (i = a.first(); i != 0; a.next(i)) assert(!c.contains(a(i)));
- for (i = b.first(); i != 0; b.next(i)) c.del(b(i));
- assert(c.empty());
- assert(a.OK());
- assert(b.OK());
- assert(c.OK());
-
- generictest(a, b, c);
-}
-
-
-#include "iOSLBag.h"
-
-void OSLtest()
-{
- intOSLBag a;
- add(nums, a);
- assert(a.length() == SIZE);
- int j;
- for (j = 1; j <= SIZE; ++j) assert(a.contains(j));
- intOSLBag b;
- add(odds, b);
- assert(b.length() == SIZE);
- intOSLBag c;
- add(dups, c);
- assert(c.length() == SIZE);
- intOSLBag d(a);
- add(nums, d);
- assert(d.length() == SIZE*2);
- cout << "a: "; printBag(a);
- cout << "b: "; printBag(b);
- cout << "c: "; printBag(c);
- cout << "d: "; printBag(d);
- for (j = 1; j <= SIZE; ++j) assert(d.nof(j) == 2);
- d.del(1);
- assert(d.nof(1) == 1);
- d.del(1);
- assert(d.nof(1) == 0);
- d.remove(2);
- assert(!d.contains(2));
- for (Pix l = c.first(); l; c.next(l)) d.remove(c(l));
- assert(d.length() == SIZE);
-
- c.clear();
- assert(c.empty());
- for (Pix k = a.first(); k != 0; a.next(k)) c.add(a(k));
- for (Pix k = a.first(); k != 0; a.next(k)) assert(c.contains(a(k)));
- c.del(a(a.first()));
- Pix i = a.first();
- assert(!c.contains(a(i)));
- for (a.next(i); i != 0; a.next(i)) assert(c.contains(a(i)));
- c.add(a(a.first()));
- for (i = a.first(); i != 0; a.next(i)) assert(c.contains(a(i)));
- for (Pix k = b.first(); k != 0; b.next(k)) c.add(b(k));
- for (i = b.first(); i != 0; b.next(i)) assert(c.contains(b(i)));
- for (i = a.first(); i != 0; a.next(i)) assert(c.contains(a(i)));
- for (Pix k = a.first(); k != 0; a.next(k)) c.remove(a(k));
- for (i = a.first(); i != 0; a.next(i)) assert(!c.contains(a(i)));
- for (i = b.first(); i != 0; b.next(i)) c.del(b(i));
- assert(c.empty());
- assert(a.OK());
- assert(b.OK());
- assert(c.OK());
-
- generictest(a, b, c);
-}
-
-#include "iSplayBag.h"
-
-void Splaytest()
-{
- intSplayBag a;
- add(nums, a);
- assert(a.length() == SIZE);
- int j;
- for (j = 1; j <= SIZE; ++j) assert(a.contains(j));
- intSplayBag b;
- add(odds, b);
- assert(b.length() == SIZE);
- intSplayBag c;
- add(dups, c);
- assert(c.length() == SIZE);
- intSplayBag d(a);
- add(nums, d);
- assert(d.length() == SIZE*2);
- cout << "a: "; printBag(a);
- cout << "b: "; printBag(b);
- cout << "c: "; printBag(c);
- cout << "d: "; printBag(d);
- for (j = 1; j <= SIZE; ++j) assert(d.nof(j) == 2);
- d.del(1);
- assert(d.nof(1) == 1);
- d.del(1);
- assert(d.nof(1) == 0);
- d.remove(2);
- assert(!d.contains(2));
- for (Pix l = c.first(); l; c.next(l)) d.remove(c(l));
- assert(d.length() == SIZE);
-
- c.clear();
- assert(c.empty());
- for (Pix k = a.first(); k != 0; a.next(k)) c.add(a(k));
- for (Pix k = a.first(); k != 0; a.next(k)) assert(c.contains(a(k)));
- c.del(a(a.first()));
- Pix i = a.first();
- assert(!c.contains(a(i)));
- for (a.next(i); i != 0; a.next(i)) assert(c.contains(a(i)));
- c.add(a(a.first()));
- for (i = a.first(); i != 0; a.next(i)) assert(c.contains(a(i)));
- for (Pix k = b.first(); k != 0; b.next(k)) c.add(b(k));
- for (i = b.first(); i != 0; b.next(i)) assert(c.contains(b(i)));
- for (i = a.first(); i != 0; a.next(i)) assert(c.contains(a(i)));
- for (Pix k = a.first(); k != 0; a.next(k)) c.remove(a(k));
- for (i = a.first(); i != 0; a.next(i)) assert(!c.contains(a(i)));
- for (i = b.first(); i != 0; b.next(i)) c.del(b(i));
- assert(c.empty());
- assert(a.OK());
- assert(b.OK());
- assert(c.OK());
-
- generictest(a, b, c);
-}
-
-
-double return_elapsed_time ( double );
-double start_timer ( void );
-
-int main(int argv, char** argc)
-{
- if (argv > 1)
- {
- SIZE = abs(atoi(argc[1]));
- SIZE &= ~1;
- }
- else
- SIZE = 100;
- nums = new int[SIZE];
- odds = new int[SIZE];
- dups = new int[SIZE];
- makenums();
- makeodds();
- makedups();
- start_timer();
- cout << "VHtest\n"; VHtest();
- if (ptimes) cout << "\ntime = " << return_elapsed_time(0.0) << "\n";
- start_timer();
- cout << "CHtest\n"; CHtest();
- if (ptimes) cout << "\ntime = " << return_elapsed_time(0.0) << "\n";
- start_timer();
- cout << "SLtest\n"; SLtest();
- if (ptimes) cout << "\ntime = " << return_elapsed_time(0.0) << "\n";
- start_timer();
- cout << "XPtest\n"; XPtest();
- if (ptimes) cout << "\ntime = " << return_elapsed_time(0.0) << "\n";
- start_timer();
- cout << "Splaytest\n"; Splaytest();
- if (ptimes) cout << "\ntime = " << return_elapsed_time(0.0) << "\n";
- start_timer();
- cout << "OSLtest\n"; OSLtest();
- if (ptimes) cout << "\ntime = " << return_elapsed_time(0.0) << "\n";
- start_timer();
- cout << "OXPtest\n"; OXPtest();
- if (ptimes) cout << "\ntime = " << return_elapsed_time(0.0) << "\n";
-
- return 0;
-}
diff --git a/contrib/libg++/libg++/tests/tBag.exp b/contrib/libg++/libg++/tests/tBag.exp
deleted file mode 100644
index d86cf3461e6a..000000000000
--- a/contrib/libg++/libg++/tests/tBag.exp
+++ /dev/null
@@ -1,35 +0,0 @@
-VHtest
-a: [72 77 13 3 26 16 39 29 52 42 65 55 78 91 9 22 35 48 61 74 ...]
-b: [167 77 13 3 193 39 139 29 93 47 65 55 155 109 91 9 117 171 35 143 ...]
-c: [13 31 3 26 16 39 11 29 47 42 42 27 12 9 22 43 35 28 48 8 ...]
-d: [85 3 26 29 52 21 61 17 55 78 13 57 22 48 74 70 30 74 26 15 ...]
-CHtest
-a: [72 36 85 49 13 3 98 62 26 16 75 39 29 88 52 42 6 65 55 19 ...]
-b: [167 49 85 121 13 3 157 193 111 39 75 147 29 183 137 65 101 173 55 19 ...]
-c: [36 36 49 13 13 49 3 3 26 26 16 16 39 39 29 29 6 42 6 42 ...]
-d: [72 36 36 72 85 49 13 13 49 85 3 3 98 62 26 26 62 98 16 16 ...]
-SLtest
-a: [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ...]
-b: [3 197 151 161 81 69 27 37 189 147 13 75 181 117 173 11 191 185 101 105 ...]
-c: [33 2 48 18 37 5 35 49 1 12 50 9 31 26 10 42 37 17 13 11 ...]
-d: [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ...]
-XPtest
-a: [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ...]
-b: [3 197 151 161 81 69 27 37 189 147 13 75 181 117 173 11 191 185 101 105 ...]
-c: [33 2 48 18 37 5 35 49 1 12 50 9 31 26 10 42 37 17 13 11 ...]
-d: [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ...]
-Splaytest
-a: [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ...]
-b: [1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 ...]
-c: [1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 ...]
-d: [1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 ...]
-OSLtest
-a: [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ...]
-b: [1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 ...]
-c: [1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 ...]
-d: [1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 ...]
-OXPtest
-a: [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ...]
-b: [1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 ...]
-c: [1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 ...]
-d: [1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 ...]
diff --git a/contrib/libg++/libg++/tests/tBag.inp b/contrib/libg++/libg++/tests/tBag.inp
deleted file mode 100644
index e69de29bb2d1..000000000000
--- a/contrib/libg++/libg++/tests/tBag.inp
+++ /dev/null
diff --git a/contrib/libg++/libg++/tests/tBitSet.cc b/contrib/libg++/libg++/tests/tBitSet.cc
deleted file mode 100644
index d98d3d453dcd..000000000000
--- a/contrib/libg++/libg++/tests/tBitSet.cc
+++ /dev/null
@@ -1,220 +0,0 @@
-/*
- a test/demo of BitSets
-*/
-
-#include <assert.h>
-
-#define tassert(ex) { cerr << #ex; \
- if ((ex)) cerr << "OK\n"; \
- else cerr << "Fail\n"; }
-
-
-
-#include <BitSet.h>
-
-
-void test3S(BitSet a, BitSet b, BitSet c)
-{
-// neg
- assert(~(~a) == a);
-// commutative
- assert((a | b) == (b | a));
- assert((a & b) == (b & a));
-// associative
- assert((a | (b | c)) == ((a | b) | c));
- assert((a & (b & c)) == ((a & b) & c));
-// distrib
- assert((a & (b | c)) == ((a & b) | (a & c)));
- assert((a | (b & c)) == ((a | b) & (a | c)));
-// absorption
- assert((a & (a | b)) == a);
- assert((a | (a & b)) == a);
-// demorgan
- assert((a | b) == ~(~a & ~b));
- assert((a & b) == ~(~a | ~b));
-// def of -
- assert((a - b) == (a & ~b));
- assert(((a - b) | b) == (a | b));
-// def of disjoint union
- assert((a ^ b) == ((a | b) & ~(a & b)));
- assert((a ^ b) == ((a - b) | (b - a)));
-
- BitSet x = a;
- x &= b;
- assert(x == (a & b));
- x |= c;
- assert(x == ((a & b) | c));
- x -= a;
- assert(x == (((a & b) | c) - a));
- x ^= b;
- assert(x == ((((a & b) | c) - a) ^ b));
- assert(x.OK());
-}
-
-/* This regression test found a bug in BitSetresize.
- Based on a bug report from Joaquim Jorge <jorgej@avs.cs.rpi.edu>.*/
-
-void
-test4()
-{
- BitSet a; cout << "a: " << a << endl;
- a.set(1, 2); cout << "after set(1,2): " << a << endl;
- a = BitSet();cout << "after copy: " << a << endl;
- a.set(1); cout << "after set(1): " << a << endl;
-}
-
-int main()
-{
- cout << "BitSet tests:\n";
-
- BitSet a;
- cout << "a = " << a << "\n";
- assert(a.OK());
-
- BitSet b = longtoBitSet(1024);
- cout << "b = " << b << "\n";
- assert(b.OK());
- assert(b[10] == 1);
- assert(b.count() == 1);
- b[0] = b[10];
- assert(b[0] == 1);
- assert(b.count() == 2);
-
- BitSet c = atoBitSet("1010101010101010101010101010101010101010");
- cout << "c = " << c << "\n";
- assert(c.OK());
- assert(c.count() == 20);
- for (int i = 0; i < 40; i += 2)
- {
- assert(c[i] == 1);
- assert(c[i+1] == 0);
- }
- for (int p = 0; p < 5; ++p)
- cout << "c[" << p << "] =" << int(c[p]) << "\n";
-
- BitSet d = atoBitSet("0011001100110011001100110011001100110011");
- cout << "d = " << d << "\n";
- assert(d.OK());
- assert(d.count() == 20);
- assert(d.count(0) == -1);
-
- BitSet e = atoBitSet("1111000011110000111100001111000011110000");
- cout << "e = " << e << "\n";
- assert(e.OK());
- assert(e.count() == 20);
-
- BitSet u = ~a;
- cout << "u = ~a = " << u << "\n";
- assert(a == ~u);
-
- BitSet g = ~e;
- cout << "g = ~e = " << g << "\n";
-
- cout << "~c = " << (~c) << "\n";
- cout << "c & d = " << (c & d) << "\n";
- cout << "c | d = " << (c | d) << "\n";
- cout << "c - d = " << (c - d) << "\n";
- cout << "c ^ d = " << (c ^ d) << "\n";
-
- test3S(b, c, d);
- test3S(a, a, a);
- test3S(a, b, c);
- test3S(a, c, b);
- test3S(c, b, a);
- test3S(c, c, c);
- test3S(c, d, e);
- test3S(e, d, c);
-
- BitSet f = b;
- cout << "f = b = " << f << "\n";
- f &= c;
- cout << "f &= c = " << f << "\n";
- f |= d;
- cout << "f |= d = " << f << "\n";
- f -= e;
- cout << "f -= e = " << f << "\n";
- f ^= u;
- cout << "f ^= u = " << f << "\n";
- assert(f.OK());
-
- assert(c != d);
- assert(!(c == d));
- assert(!(c < d));
- assert(!(c > d));
- assert(!(c <= d));
- assert(!(c >= d));
-
-
- BitSet h = d;
- cout << "h = d\n:" << h << "\n";
-
- assert(d == h);
- assert(d <= h);
- assert(d >= h);
- assert(!(d != h));
- assert(!(d > h));
- assert(!(d < h));
-
- h.set(0);
- cout << "h.set(0):\n" << h << "\n";
-
- assert(!(d == h));
- assert(!(d >= h));
- assert(!(d > h));
- assert((d != h));
- assert(d <= h);
- assert((d < h));
-
- h.set(65);
- cout << "h.set(65):\n" << h << "\n";
- assert(h[65] == 1);
- assert(h[64] == 0);
- assert(h[66] == 0);
- h.clear(2);
- cout << "h.clear(2):\n" << h << "\n";
- assert(h[2] == 0);
- assert(h[3] == 1);
- assert(h[11] == 1);
- h.invert(11,20);
- cout << "h.invert(11,20):\n" << h << "\n";
- assert(h[11] == 0);
- h.set(21,30);
- cout << "h.set(21,30):\n" << h << "\n";
- assert(h[21] == 1);
- h.clear(31,40);
- cout << "h.clear(31, 40):\n" << h << "\n";
- assert(h[33] == 0);
- cout << "h.test(0,5) = " << h.test(0, 5) << "\n";
- cout << "h.test(31,40) = " << h.test(31, 40) << "\n";
-
- cout << "set bits in e:\n";
- for (int p = e.first(); p >= 0; p = e.next(p))
- {
- assert(e[p] == 1);
- cout << p << " ";
- }
- cout << "\n";
-
- cout << "clear bits in g (reverse order):\n";
- for (int p = g.last(0); p >= 0; p = g.prev(p, 0))
- {
- assert(g[p] == 0);
- cout << p << " ";
- }
- cout << "\n";
-
- assert(a.OK());
- assert(b.OK());
- assert(c.OK());
- assert(d.OK());
- assert(e.OK());
- assert(f.OK());
- assert(g.OK());
- assert(h.OK());
-
- test4();
-
- cout << "\nEnd of test.\n";
- return 0;
-}
-
diff --git a/contrib/libg++/libg++/tests/tBitSet.exp b/contrib/libg++/libg++/tests/tBitSet.exp
deleted file mode 100644
index 689874d00b35..000000000000
--- a/contrib/libg++/libg++/tests/tBitSet.exp
+++ /dev/null
@@ -1,49 +0,0 @@
-BitSet tests:
-a = 0*
-b = 000000000010*
-c = 1010101010101010101010101010101010101010*
-c[0] =1
-c[1] =0
-c[2] =1
-c[3] =0
-c[4] =1
-d = 00110011001100110011001100110011001100110*
-e = 1111000011110000111100001111000011110*
-u = ~a = 1*
-g = ~e = 0000111100001111000011110000111100001*
-~c = 0101010101010101010101010101010101010101*
-c & d = 0010001000100010001000100010001000100010*
-c | d = 10111011101110111011101110111011101110110*
-c - d = 10001000100010001000100010001000100010*
-c ^ d = 10011001100110011001100110011001100110010*
-f = b = 100000000010*
-f &= c = 100000000010*
-f |= d = 10110011001100110011001100110011001100110*
-f -= e = 00000011000000110000001100000011000000110*
-f ^= u = 11111100111111001111110011111100111111001*
-h = d
-:00110011001100110011001100110011001100110*
-h.set(0):
-10110011001100110011001100110011001100110*
-h.set(65):
-1011001100110011001100110011001100110011000000000000000000000000010*
-h.clear(2):
-1001001100110011001100110011001100110011000000000000000000000000010*
-h.invert(11,20):
-1001001100101100110010110011001100110011000000000000000000000000010*
-h.set(21,30):
-1001001100101100110011111111111100110011000000000000000000000000010*
-h.clear(31, 40):
-1001001100101100110011111111111000000000000000000000000000000000010*
-h.test(0,5) = 1
-h.test(31,40) = 0
-set bits in e:
-0 1 2 3 8 9 10 11 16 17 18 19 24 25 26 27 32 33 34 35
-clear bits in g (reverse order):
-35 34 33 32 27 26 25 24 19 18 17 16 11 10 9 8 3 2 1 0
-a: 0*
-after set(1,2): 0110*
-after copy: 0*
-after set(1): 010*
-
-End of test.
diff --git a/contrib/libg++/libg++/tests/tBitSet.inp b/contrib/libg++/libg++/tests/tBitSet.inp
deleted file mode 100644
index e69de29bb2d1..000000000000
--- a/contrib/libg++/libg++/tests/tBitSet.inp
+++ /dev/null
diff --git a/contrib/libg++/libg++/tests/tBitString.cc b/contrib/libg++/libg++/tests/tBitString.cc
deleted file mode 100644
index f397a2136dc6..000000000000
--- a/contrib/libg++/libg++/tests/tBitString.cc
+++ /dev/null
@@ -1,327 +0,0 @@
-/*
- a test/demo of BitStrings
-*/
-
-#include <assert.h>
-#define tassert(ex) { cerr << #ex; \
- if ((ex)) cerr << " OK\n"; \
- else cerr << " Fail\n"; }
-
-
-#include <BitString.h>
-
-void doubletest(BitString a)
-{
- BitString x;
- BitString y;
- x = a + reverse(a);
- for (int i = 0; i < 7; ++i)
- {
- y = x;
- x += x;
- assert(x == reverse(x));
- assert(x.index(y) == 0);
- assert(x.index(y, -1) == x.length() / 2);
- assert(x.OK());
- }
-}
-
-// identities for equal-length args
-
-void identitytest(BitString a, BitString b, BitString c)
-{
-// neg
- assert(~(~a) == a);
-// commutative
- assert((a | b) == (b | a));
- assert((a & b) == (b & a));
-// associative
- assert((a | (b | c)) == ((a | b) | c));
- assert((a & (b & c)) == ((a & b) & c));
-// distrib
- assert((a & (b | c)) == ((a & b) | (a & c)));
- assert((a | (b & c)) == ((a | b) & (a | c)));
-// absorption
- assert((a & (a | b)) == a);
- assert((a | (a & b)) == a);
-// demorgan
- assert((a | b) == ~(~a & ~b));
- assert((a & b) == ~(~a | ~b));
-// def of -
- assert((a - b) == (a & ~b));
- assert(((a - b) | b) == (a | b));
-// def of disjoint union
- assert((a ^ b) == ((a | b) & ~(a & b)));
- assert((a ^ b) == ((a - b) | (b - a)));
-// shift
- assert(((a << 1) >> 1) == a);
-// concat
- assert((a + (b + c)) == ((a + b) + c));
-
- BitString x;
- x = a + b;
- assert(x.after(a) == b);
- assert(x.before(b, -1) == a);
-
- x = a;
- int l = x.length();
- x.set(l);
- assert(x == (a + 1));
- x.clear(l);
- assert(x == (a + 0));
-}
-
-void accumtest(const BitString& a, const BitString& b, const BitString& c)
-{
- BitString x = a;
- x &= b;
- assert(x == (a & b));
- x |= c;
- assert(x == ((a & b) | c));
- x -= a;
- assert(x == (((a & b) | c) - a));
- x ^= b;
- assert(x == ((((a & b) | c) - a) ^ b));
- x += c;
- assert(x == (((((a & b) | c) - a) ^ b) + c));
- x <<= 7;
- assert(x == ((((((a & b) | c) - a) ^ b) + c) << 7));
- x >>= 5;
- assert(x == (((((((a & b) | c) - a) ^ b) + c) << 7) >> 5));
- x += 0;
- assert(x == ((((((((a & b) | c) - a) ^ b) + c) << 7) >> 5) + 0));
-
- assert(x.OK());
-}
-
-
-void cmptest(BitString& x)
-{
- BitString a = x;
- a[0] = 0;
- BitString b = a;
-
- assert(a == b);
- assert(a <= b);
- assert(a >= b);
- assert(!(a != b));
- assert(!(a > b));
- assert(!(a < b));
- assert(lcompare(a, b) == 0);
- assert(a.matches(b));
- assert(a.contains(b));
-
- b[0] = 1;
- cout << "b.set(0) :" << b << "\n";
-
- assert(!(a == b));
- assert(!(a >= b));
- assert(!(a > b));
- assert((a != b));
- assert(a <= b);
- assert((a < b));
- assert(lcompare(a, b) < 0);
- assert(!a.matches(b));
- assert(!a.contains(b));
- assert(a.after(0) == b.after(0));
-
- b.set(65);
- cout << "b.set(65):\n" << b << "\n";
- assert(b[65] == 1);
- assert(b[64] == 0);
- assert(b.length() == 66);
- b.clear(2);
- cout << "b.clear(2):\n" << b << "\n";
- assert(b[2] == 0);
- b.set(11);
- b.invert(11,20);
- cout << "b.invert(11,20):\n" << b << "\n";
- assert(b[11] == 0);
- b.set(21,30);
- cout << "b.set(21,30):\n" << b << "\n";
- assert(b[21] == 1);
- b.clear(31,40);
- cout << "b.clear(31, 40):\n" << b << "\n";
- assert(b.test(33, 38) == 0);
-}
-
-void subtest(BitString c)
-{
- BitString k = c.at(1, 4);
- cout << "k = " << k << "\n";
- assert(c.index(k) == 1);
- assert(c.index(k, -1) != -1);
-
- cout << "c.before(k) = " << c.before(k) << "\n";
- assert(c.before(k) == c.before(1));
- cout << "c.at(k) = " << c.at(k) << "\n";
- assert(c.at(k) == k);
- cout << "c.after(k) = " << c.after(k) << "\n";
- assert(c.after(k) == c.after(4));
- c.after(k) = k;
- cout << "c.after(k)=k :" << c << "\n";
- assert(c.after(4) == k);
- c.before(k) = k;
- cout << "c.before(k)=k:" << c << "\n";
- assert(c.after(c.after(k)) == k);
-
- assert(c.contains(k, 0));
- assert(common_prefix(c, k) == k);
- assert(common_suffix(c, k) == k);
- cout << "reverse(k) = " << reverse(k) << "\n";
- k.left_trim(0);
- assert(k[0] == 1);
- cout << "k.left_trim(0) : " << k << "\n";
- k.right_trim(1);
- assert(k[k.length() - 1] == 0);
- cout << "k.right_trim(1) : " << k << "\n";
-}
-
-int main()
-{
- BitString a;
- BitString b = atoBitString("1000000001");
- BitString c = atoBitString("10101010101010101010");
- BitString d = atoBitString("00110011001100110011");
- BitString e = atoBitString("11110000111100001111");
- BitString f = b;
- BitString g = ~e;
- BitString h = d;
- BitString zz;
-
- assert(a.OK());
- assert(a.empty());
- assert(b.OK());
- assert(!b.empty());
- assert(c.OK());
- assert(c.count(1) == 10);
- assert(c.count(0) == 10);
- assert(d.OK());
- assert(c.count(1) == 10);
- assert(c.count(0) == 10);
- assert(e.OK());
- assert(e.count(1) == 12);
- assert(e.count(0) == 8);
- assert(f == b);
- assert(h == d);
- assert(g == ~e);
- assert(~g == e);
- assert(f.OK());
- assert(g.OK());
- assert(h.OK());
-
- cout << "a = " << a << "\n";
- cout << "b = " << b << "\n";
- cout << "c = " << c << "\n";
- cout << "d = " << d << "\n";
- cout << "e = " << e << "\n";
- cout << "f = b = " << f << "\n";
- cout << "g = ~e = " << g << "\n";
- cout << "h = d = " << h << "\n";
-
- for (int i = 0; i < 20; ++i)
- {
- assert(h[i] == d[i]);
- assert(g[i] != e[i]);
- assert(c[i] == !(i % 2));
- }
-
- cout << "bits in e:\n";
- for (int p = e.first(); p >= 0; p = e.next(p))
- {
- assert(e[p] == 1);
- cout << p << " ";
- }
- cout << "\n";
-
- cout << "clear bits in g (reverse order):\n";
- for (int p = g.last(0); p >= 0; p = g.prev(p, 0))
- {
- assert(g[p] == 0);
- cout << p << " ";
- }
- cout << "\n";
-
- cout << "~c = " << (~c) << "\n";
- cout << "c & d = " << (c & d) << "\n";
- cout << "c | d = " << (c | d) << "\n";
- cout << "c - d = " << (c - d) << "\n";
- cout << "c ^ d = " << (c ^ d) << "\n";
- cout << "c + d = " << (c + d) << "\n";
- cout << "c <<2 = " << (c << 2) << "\n";
- cout << "c >>2 = " << (c >> 2) << "\n";
-
- f &= c;
- cout << "f &= c = " << f << "\n";
- f |= d;
- cout << "f |= d = " << f << "\n";
- f -= d;
- cout << "f -= e = " << f << "\n";
- f ^= c;
- cout << "f ^= c = " << f << "\n";
- f += b;
- cout << "f += b = " << f << "\n";
- f <<= 5;
- cout << "f <<=5 = " << f << "\n";
- f >>= 10;
- cout << "f >>=10= " << f << "\n";
-
- assert(c != d);
- assert(!(c == d));
- assert(!(c < d));
- assert(!(c > d));
- assert(!(c <= d));
- assert(!(c >= d));
- assert(lcompare(c, d) > 0);
-
-
- BitString l = c + d + c;
- cout << "l = " << l << "\n";
- BitPattern pat(d, e);
- assert(pat.OK());
- cout << "BitPattern pat = " << pat << "\n";
- cout << "pat.pattern = " << pat.pattern << "\n";
- cout << "pat.mask = " << pat.mask << "\n";
- assert(d.matches(pat));
- cout << "l.index(pat) = " << l.index(pat) << "\n";
- cout << "l.index(pat,-1)= " << l.index(pat, -1) << "\n";
- cout << "l.before(pat) = " << l.before(pat) << "\n";
- cout << "l.at(pat) = " << l.at(pat) << "\n";
- cout << "l.after(pat) = " << l.after(pat) << "\n";
- int eind = l.index(pat);
- l.at(pat) = e;
- assert(l.index(e) == eind);
-
- identitytest(d, g, h);
- identitytest(a, a, a);
- identitytest(c, d, e);
- identitytest(e, d, c);
- identitytest(longtoBitString(0), longtoBitString((unsigned)(~(0L))),
- shorttoBitString(1025));
- identitytest(a+b+c+d+e+f+g+h, h+g+f+e+d+c+b+a, a+c+e+g+b+d+f+h);
-
- accumtest(d, g, h);
- accumtest(a, b, c);
- accumtest(c, d, e);
- accumtest(e, d, c);
- accumtest(a+b+c+d+e+f+g+h+l, f+e+d+c+b+a+pat.mask, e+g+b+d+f+h+pat.pattern);
-
- doubletest(a);
- doubletest(b);
- doubletest(c);
- doubletest(a+b+c+d+e+f+g+h);
-
- cmptest(b);
- cmptest(d);
-
- subtest(c);
- subtest(d);
-
- for (int i=0; i<64; i++) {
- zz += 1;
- }
- cout << "zz = " << zz << "\n";
-
- cout << "\nEnd of test.\n";
- return 0;
-}
diff --git a/contrib/libg++/libg++/tests/tBitString.exp b/contrib/libg++/libg++/tests/tBitString.exp
deleted file mode 100644
index 142187aa0d50..000000000000
--- a/contrib/libg++/libg++/tests/tBitString.exp
+++ /dev/null
@@ -1,79 +0,0 @@
-a =
-b = 1000000001
-c = 10101010101010101010
-d = 00110011001100110011
-e = 11110000111100001111
-f = b = 1000000001
-g = ~e = 00001111000011110000
-h = d = 00110011001100110011
-bits in e:
-0 1 2 3 8 9 10 11 16 17 18 19
-clear bits in g (reverse order):
-19 18 17 16 11 10 9 8 3 2 1 0
-~c = 01010101010101010101
-c & d = 00100010001000100010
-c | d = 10111011101110111011
-c - d = 10001000100010001000
-c ^ d = 10011001100110011001
-c + d = 1010101010101010101000110011001100110011
-c <<2 = 0010101010101010101010
-c >>2 = 101010101010101010
-f &= c = 1000000000
-f |= d = 10110011001100110011
-f -= e = 10000000000000000000
-f ^= c = 00101010101010101010
-f += b = 001010101010101010101000000001
-f <<=5 = 00000001010101010101010101000000001
-f >>=10= 0101010101010101000000001
-l = 101010101010101010100011001100110011001110101010101010101010
-BitPattern pat = 0011XXXX0011XXXX0011
-pat.pattern = 00110011001100110011
-pat.mask = 11110000111100001111
-l.index(pat) = 20
-l.index(pat,-1)= 20
-l.before(pat) = 10101010101010101010
-l.at(pat) = 00110011001100110011
-l.after(pat) = 10101010101010101010
-b.set(0) :1000000001
-b.set(65):
-100000000100000000000000000000000000000000000000000000000000000001
-b.clear(2):
-100000000100000000000000000000000000000000000000000000000000000001
-b.invert(11,20):
-100000000100111111111000000000000000000000000000000000000000000001
-b.set(21,30):
-100000000100111111111111111111100000000000000000000000000000000001
-b.clear(31, 40):
-100000000100111111111111111111100000000000000000000000000000000001
-b.set(0) :10110011001100110011
-b.set(65):
-101100110011001100110000000000000000000000000000000000000000000001
-b.clear(2):
-100100110011001100110000000000000000000000000000000000000000000001
-b.invert(11,20):
-100100110010110011001000000000000000000000000000000000000000000001
-b.set(21,30):
-100100110010110011001111111111100000000000000000000000000000000001
-b.clear(31, 40):
-100100110010110011001111111111100000000000000000000000000000000001
-k = 0101
-c.before(k) = 1
-c.at(k) = 0101
-c.after(k) = 010101010101010
-c.after(k)=k :101010101
-c.before(k)=k:010101010101
-reverse(k) = 1010
-k.left_trim(0) : 101
-k.right_trim(1) : 10
-k = 0110
-c.before(k) = 0
-c.at(k) = 0110
-c.after(k) = 011001100110011
-c.after(k)=k :001100110
-c.before(k)=k:011001100110
-reverse(k) = 0110
-k.left_trim(0) : 110
-k.right_trim(1) : 110
-zz = 1111111111111111111111111111111111111111111111111111111111111111
-
-End of test.
diff --git a/contrib/libg++/libg++/tests/tBitString.inp b/contrib/libg++/libg++/tests/tBitString.inp
deleted file mode 100644
index e69de29bb2d1..000000000000
--- a/contrib/libg++/libg++/tests/tBitString.inp
+++ /dev/null
diff --git a/contrib/libg++/libg++/tests/tCurses.cc b/contrib/libg++/libg++/tests/tCurses.cc
deleted file mode 100644
index ae635dd31459..000000000000
--- a/contrib/libg++/libg++/tests/tCurses.cc
+++ /dev/null
@@ -1,80 +0,0 @@
-#include <_G_config.h>
-#if !_G_HAVE_CURSES
-
-#include <iostream.h>
-int main ()
-{
- cerr << "(CursesWindow is not supported on this system)";
-}
-#else /* _G_HAVE_CURSES */
-
-#include <CursesW.h>
-
-// a simple test/demo for CursesWindow
-
-int main()
-{
- CursesWindow big(23, 79, 0, 0);
- CursesWindow corner(10, 10, 0, 0);
- CursesWindow small(10, 10, 5, 5);
- CursesWindow sub(big, 10, 10, (big.height()>>1)-5, (big.width()>>1)-5);
- CursesWindow sub2(big, 5, 5, big.height()-6, big.width()-6);
- CursesWindow subsub(sub, 5, 5, 1, 1, 'r');
-
- int i;
- char c='A';
-
- big.box('B','B');
-
- sub.box('|','-');
- for (i=1;i<10;++i)
- sub.mvaddch(i, i, '*');
- for (i=1;i<10;++i)
- sub.mvaddch(10-i, i, '*');
-
- big.refresh();
-
- big.mvprintw(0,0,"begx=%d,maxx=%d,begy=%d,maxy=%d,height=%d,width=%d",
- big.begx(), big.maxx(), big.begy(), big.maxy(),
- big.height(), big.width());
- big.refresh();
-
- sub2.box('2', '2');
- subsub.box('s', 's');
-
- big.refresh();
-
- i=13;
- const char * cptr = "Cstar";
-
- long l = 0xffffffff;
- double d= 3.1415926;
- float f= 10.0/d;
-
- big.mvprintw(2,2,"printw test:%d, %c, %s, %ld, %lf, %f\n",i,c,cptr,l,d,f);
- big.refresh();
-
- corner.box('c','c');
- big.mvprintw(5,20,"enter an int:");
- big.refresh();
- big.scanw("%d",&i);
- big.move(6,20);
- big.printw("number = %d\n",i);
- big.refresh();
- corner.refresh();
-
- small.box('S','S'); small.refresh();
- big.mvprintw(20,20,"enter a char:");
- big.refresh();
- big.scanw("%c",&c);
- big.move(21,20);
- big.printw("char = %c\n",c);
- small.box(c, c);
- big.refresh();
- small.refresh();
- corner.overlay(small);
- big.overwrite(corner);
- corner.refresh();
-}
-#endif /* _G_HAVE_CURSES */
-
diff --git a/contrib/libg++/libg++/tests/tCurses.inp b/contrib/libg++/libg++/tests/tCurses.inp
deleted file mode 100644
index 362478916720..000000000000
--- a/contrib/libg++/libg++/tests/tCurses.inp
+++ /dev/null
@@ -1,2 +0,0 @@
-123
-a
diff --git a/contrib/libg++/libg++/tests/tDeque.cc b/contrib/libg++/libg++/tests/tDeque.cc
deleted file mode 100644
index 0c1f561256cb..000000000000
--- a/contrib/libg++/libg++/tests/tDeque.cc
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- test of Deques
-*/
-
-#ifdef PTIMES
-const int ptimes = 1;
-#else
-const int ptimes = 0;
-#endif
-
-#include <stream.h>
-#include <assert.h>
-
-#include "iDeque.h"
-
-#define tassert(ex) {if ((ex)) cerr << #ex << "\n"; \
- else _assert(#ex, __FILE__,__LINE__); }
-
-
-int SIZE;
-
-void print(intDeque& a)
-{
- int maxprint = 20;
- cout << "[";
- int k = 0;
- while (!a.empty() && k++ < maxprint)
- cout << a.deq() << " ";
- if (k == maxprint)
- cout << "]\n";
- else
- {
- while (!a.empty()) a.del_front();
- cout << "...]\n";
- }
- assert(a.empty());
-}
-
-#include "iXPDeque.h"
-
-void XPtest ()
-{
- intXPDeque d(SIZE);
- assert(d.OK());
- for (int i = 0; i < SIZE; ++i)
- {
- if (i % 2 == 0)
- d.enq(i);
- else
- d.push(i);
- }
- assert(d.length() == SIZE);
- assert(d.front() == (SIZE-1));
- assert(d.rear() == (SIZE-2));
- assert(!d.full());
- intXPDeque d1(SIZE/2);
- for (int i = (SIZE-1); i >= 0; --i)
- {
- int x;
- if (i % 2 == 0)
- {
- x = d.rear();
- d.del_rear();
- }
- else
- {
- x = d.front();
- d.del_front();
- }
- d1.enq(x);
- }
- assert(d.empty());
- assert(d1.length() == SIZE);
- assert(d1.front() == (SIZE-1));
- assert(d1.rear() == 0);
- assert(d.OK());
- assert(d1.OK());
- intXPDeque d2 (d1);
- assert(d2.length() == SIZE);
- assert(d2.front() == (SIZE-1));
- assert(d2.OK());
- d1.clear();
- assert(d1.empty());
- d1 = d2;
- assert(d1.length() == SIZE);
- assert(d1.front() == (SIZE-1));
- cout << "d1:"; print(d1);
- assert(d.OK());
- assert(d1.OK());
- assert(d2.OK());
-}
-
-
-#include "iDLDeque.h"
-
-void DLtest ()
-{
- intDLDeque d;
- assert(d.OK());
- for (int i = 0; i < SIZE; ++i)
- {
- if (i % 2 == 0)
- d.enq(i);
- else
- d.push(i);
- }
- assert(d.length() == SIZE);
- assert(d.front() == (SIZE-1));
- assert(d.rear() == (SIZE-2));
- assert(!d.full());
- intDLDeque d1;
- for (int i = (SIZE-1); i >= 0; --i)
- {
- int x;
- if (i % 2 == 0)
- {
- x = d.rear();
- d.del_rear();
- }
- else
- {
- x = d.front();
- d.del_front();
- }
- d1.enq(x);
- }
- assert(d.empty());
- assert(d1.length() == SIZE);
- assert(d1.front() == (SIZE-1));
- assert(d1.rear() == 0);
- assert(d.OK());
- assert(d1.OK());
- intDLDeque d2 (d1);
- assert(d2.length() == SIZE);
- assert(d2.front() == (SIZE-1));
- assert(d2.OK());
- d1.clear();
- assert(d1.empty());
- d1 = d2;
- assert(d1.length() == SIZE);
- assert(d1.front() == (SIZE-1));
- cout << "d1:"; print(d1);
-
- assert(d.OK());
- assert(d1.OK());
- assert(d2.OK());
-}
-
-
-int main(int argv, char** argc)
-{
- if (argv > 1)
- {
- SIZE = abs(atoi(argc[1]));
- SIZE &= ~1;
- }
- else
- SIZE = 100;
-
- start_timer();
- cout << "XP deques:\n"; XPtest();
- if (ptimes) cout << "\ntime = " << return_elapsed_time(0.0) << "\n";
- start_timer();
- cout << "DL deques:\n"; DLtest();
- if (ptimes) cout << "\ntime = " << return_elapsed_time(0.0) << "\n";
- cout << "\nEnd of test\n";
- return 0;
-}
diff --git a/contrib/libg++/libg++/tests/tDeque.exp b/contrib/libg++/libg++/tests/tDeque.exp
deleted file mode 100644
index 2d60c350b75b..000000000000
--- a/contrib/libg++/libg++/tests/tDeque.exp
+++ /dev/null
@@ -1,6 +0,0 @@
-XP deques:
-d1:[99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 ...]
-DL deques:
-d1:[99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 ...]
-
-End of test
diff --git a/contrib/libg++/libg++/tests/tDeque.inp b/contrib/libg++/libg++/tests/tDeque.inp
deleted file mode 100644
index e69de29bb2d1..000000000000
--- a/contrib/libg++/libg++/tests/tDeque.inp
+++ /dev/null
diff --git a/contrib/libg++/libg++/tests/tFile.cc b/contrib/libg++/libg++/tests/tFile.cc
deleted file mode 100644
index d846f877df1c..000000000000
--- a/contrib/libg++/libg++/tests/tFile.cc
+++ /dev/null
@@ -1,371 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-
-/*
- * a few tests for streams
- *
- */
-
-#include <stream.h>
-#ifndef _OLD_STREAMS
-#include <strstream.h>
-#include "unistd.h"
-#endif
-#include <SFile.h>
-#include <PlotFile.h>
-
-#include <std.h>
-#include <assert.h>
-
-class record
-{
-public:
- char c; int i; double d;
-};
-
-ostream& operator<<(ostream& s, record& r)
-{
- return(s << "(i = " << r.i << " c = " << r.c << " d = " << r.d << ")");
-}
-
-void t1()
-{
- char ch;
-
- assert(cout.good());
- assert(cout.writable());
- assert(cout.is_open());
- cout << "Hello, world via cout\n";
- assert(cerr.good());
- assert(cerr.writable());
- assert(cerr.is_open());
- cerr << "Hello, world via cerr\n";
-
- assert(cin.good());
- assert(cin.readable());
- assert(cin.is_open());
-
- cout << "enter a char:"; cin >> ch;
- cout.put('c'); cout.put(' '); cout.put('='); cout.put(' ');
- cout.put('"'); cout.put(ch); cout << '"'; cout << char('\n');
- assert(cin.good());
- assert(cout.good());
-}
-
-void t2()
-{
- int i;
- short h;
- long l;
- float f;
- double d;
- char s[100];
-
- cout << "enter three integers (short, int, long):";
- cin >> h; cin >> i;
- // cin.scan("%ld", &l);
- cin >> l;
- cout << "first = " << h << " via dec = " << dec(h, 8) << "\n";
- cout << "second = " << i << form(" via form = %d = 0%o", i, i);
- cout.form(" via cout.form = %d = 0x%x\n", i, i);
- cout << "third = " << l << " via hex = " << hex(l) << "\n";
- assert(cin.good());
- assert(cout.good());
-
- cout << "enter a float then a double:"; cin >> f; cin >> d;
- cout << "first = " << f << "\n";
- cout << "second = " << d << "\n";
- assert(cin.good());
- assert(cout.good());
-
- cout << "enter 5 characters separated with spaces:"; cin >> s;
- cout << "first = " << s << "\n";
- cin.get(s, 100);
- cout << "rest = " << s << "\n";
-
- assert(cin.good());
- assert(cout.good());
-
-}
-
-void t3()
-{
- char ch;
- cout << "\nMaking streams sout and sin...";
-#ifdef _OLD_STREAMS
- ostream sout("streamfile", io_writeonly, a_create);
-#else
- ofstream sout("streamfile");
-#endif
- assert(sout.good());
- assert(sout.is_open());
- assert(sout.writable());
- assert(!sout.readable());
- sout << "This file has one line testing output streams.\n";
- sout.close();
- assert(!sout.is_open());
-#ifdef _OLD_STREAMS
- istream sin("streamfile", io_readonly, a_useonly);
-#else
- ifstream sin("streamfile");
-#endif
- assert(sin.good());
- assert(sin.is_open());
- assert(!sin.writable());
- assert(sin.readable());
- cout << "contents of file:\n";
- while(sin >> ch) cout << ch;
- sin.close();
- assert(!sin.is_open());
-}
-
-
-void t4()
-{
- char s[100];
- char ch;
- int i;
-
- cout << "\nMaking File tf ... ";
-#ifdef _OLD_STREAMS
- File tf("tempfile", io_readwrite, a_create);
-#else
- fstream tf("tempfile", ios::in|ios::out|ios::trunc);
-#endif
- assert(tf.good());
- assert(tf.is_open());
- assert(tf.writable());
- assert(tf.readable());
- strcpy(s, "This is the first and only line of this file.\n");
-#ifdef _OLD_STREAMS
- tf.put(s);
- tf.seek(0);
-#else
- tf << s;
- tf.rdbuf()->seekoff(0, ios::beg);
-#endif
- tf.get(s, 100);
- assert(tf.good());
- cout << "first line of file:\n" << s << "\n";
- cout << "next char = ";
- tf.get(ch);
- cout << (int)ch;
- cout.put('\n');
- assert(ch == 10);
- strcpy(s, "Now there is a second line.\n");
- cout << "reopening tempfile, appending: " << s;
-#ifdef _OLD_STREAMS
- tf.open(tf.name(), io_appendonly, a_use);
-#else
- tf.close();
- tf.open("tempfile", ios::app);
-#endif
- assert(tf.good());
- assert(tf.is_open());
- assert(tf.writable());
- assert(!tf.readable());
-#ifdef _OLD_STREAMS
- tf.put(s);
- assert(tf.good());
- tf.open(tf.name(), io_readonly, a_use);
-#else
- tf << s;
- assert(tf.good());
- tf.close();
- tf.open("tempfile", ios::in);
-#endif
- tf.raw();
- assert(tf.good());
- assert(tf.is_open());
- assert(!tf.writable());
- assert(tf.readable());
- cout << "First 10 chars via raw system read after reopen for input:\n";
- read(tf.filedesc(), s, 10);
- assert(tf.good());
- for (i = 0; i < 10; ++ i)
- cout.put(s[i]);
- lseek(tf.filedesc(), 5, 0);
- cout << "\nContents after raw lseek to pos 5:\n";
- while ( (tf.get(ch)) && (cout.put(ch)) );
-#ifdef _OLD_STREAMS
- tf.remove();
-#else
- tf.close();
- unlink("tempfile");
-#endif
- assert(!tf.is_open());
-}
-
-void t5()
-{
- record r;
- int i;
- cout << "\nMaking SFile rf...";
-#ifdef _OLD_STREAMS
- SFile rf("recfile", sizeof(record), io_readwrite, a_create);
-#else
- SFile rf("recfile", sizeof(record), ios::in|ios::out|ios::trunc);
-#endif
- assert(rf.good());
- assert(rf.is_open());
- assert(rf.writable());
- assert(rf.readable());
- for (i = 0; i < 10; ++i)
- {
- r.c = i + 'a';
- r.i = i;
- r.d = (double)(i) / 1000.0;
- rf.put(&r);
- }
- assert(rf.good());
- cout << "odd elements of file in reverse order:\n";
- for (i = 9; i >= 0; i -= 2)
- {
- rf[i].get(&r);
- assert(r.c == i + 'a');
- assert(r.i == i);
- cout << r << "\n";
- }
- assert(rf.good());
-#ifdef _OLD_STREAMS
- rf.remove();
-#else
- rf.close();
- unlink("recfile");
-#endif
- assert(!rf.is_open());
-}
-
-void t6()
-{
- cout << "\nMaking PlotFile pf ...";
- static const char plot_name[] = "plot.out";
- PlotFile pf(plot_name);
- assert(pf.good());
- assert(pf.is_open());
- assert(pf.writable());
- assert(!pf.readable());
- pf.move(10,10);
- pf.label("Test");
- pf.circle(300,300,200);
- pf.line(100, 100, 500, 500);
- assert(pf.good());
-#ifdef _OLD_STREAMS
- cout << "(You may delete or attempt to plot " << pf.name() << ")\n";
-#else
- cout << "(You may delete or attempt to plot " << plot_name << ")\n";
-#endif
-}
-
-void t7()
-{
- char ch;
- char mybuf[1000];
-#ifdef _OLD_STREAMS
- cout << "creating string-based ostream...\n";
- ostream strout(1000, mybuf);
-#else
- cout << "creating ostrstream...\n";
- ostrstream strout(mybuf, 1000);
-#endif
- assert(strout.good());
- assert(strout.writable());
- strout << "This is a string-based stream.\n";
- strout << "With two lines.\n";
- strout.put(char(0));
- assert(strout.good());
- cout << "with contents:\n";
- cout << mybuf;
-#ifdef _OLD_STREAMS
- cout << "using it to create string-based istream...\n";
- istream strin(strlen(mybuf), mybuf);
-#else
- cout << "using it to create istrstream...\n";
- istrstream strin(mybuf, strlen(mybuf));
-#endif
- assert(strin.good());
- assert(strin.readable());
- cout << "with contents:\n";
- while (strin.get(ch)) cout.put(ch);
-}
-
-void t8()
-{
-#ifdef _OLD_STREAMS
- cout << "\nThe following file open should generate error message:";
- cout.flush();
- File ef("shouldnotexist", io_readonly, a_useonly);
-#else
- ifstream ef("shouldnotexist");
-#endif
- assert(!ef.good());
- assert(!ef.is_open());
-}
-
-void t9()
-{
- char ch;
- static char ffile_name[] = "ffile";
- {
- cout << "\nMaking filebuf streams fout and fin...";
- filebuf foutbuf;
-#ifdef _OLD_STREAMS
- foutbuf.open(ffile_name, output);
-#else
- foutbuf.open(ffile_name, ios::out);
-#endif
- ostream fout(&foutbuf);
- assert(fout.good());
- assert(fout.is_open());
- assert(fout.writable());
- assert(!fout.readable());
- fout << "This file has one line testing output streams.\n";
-#ifdef _OLD_STREAMS
- fout.close();
- assert(!fout.is_open());
-#endif
- }
- filebuf finbuf;
-#ifdef _OLD_STREAMS
- finbuf.open(ffile_name, input);
-#else
- finbuf.open(ffile_name, ios::in);
-#endif
- istream fin(&finbuf);
- assert(fin.good());
- assert(fin.is_open());
- assert(!fin.writable());
- assert(fin.readable());
- cout << "contents of file:\n";
- while(fin >> ch) cout << ch;
-#ifndef _OLD_STREAMS
- cout << '\n';
-#endif
- fin.close();
- assert(!fin.is_open());
-}
-
-main()
-{
- t1();
- t2();
- t3();
- t4();
- t5();
- t6();
- t7();
- t9();
- t8();
-
- cout << "\nFinal names & states:\n";
-#ifdef _OLD_STREAMS
- cout << "cin: " << cin.name() << "\t" << cin.rdstate() << "\n";
- cout << "cout: " << cout.name() << "\t" << cout.rdstate() << "\n";
- cout << "cerr: " << cerr.name() << "\t" << cerr.rdstate() << "\n";
-#else
- cout << "cin: " << "(stdin)" << "\t" << cin.rdstate() << "\n";
- cout << "cout: " << "(stdout)" << "\t" << cout.rdstate() << "\n";
- cout << "cerr: " << "(stderr)" << "\t" << cerr.rdstate() << "\n";
-#endif
- cout << "\nend of test.\n";
- return 0;
-}
diff --git a/contrib/libg++/libg++/tests/tFile.exp b/contrib/libg++/libg++/tests/tFile.exp
deleted file mode 100644
index 6827c5cf191c..000000000000
--- a/contrib/libg++/libg++/tests/tFile.exp
+++ /dev/null
@@ -1,49 +0,0 @@
-Hello, world via cout
-Hello, world via cerr
-enter a char:c = "a"
-enter three integers (short, int, long):first = 123 via dec = 123
-second = 4567 via form = 4567 = 010727 via cout.form = 4567 = 0x11d7
-third = 89012 via hex = 15bb4
-enter a float then a double:first = 123.456
-second = -0.012
-enter 5 characters separated with spaces:first = 1
-rest = 2 3 4 5
-
-Making streams sout and sin...contents of file:
-Thisfilehasonelinetestingoutputstreams.
-Making File tf ... first line of file:
-This is the first and only line of this file.
-next char = 10
-reopening tempfile, appending: Now there is a second line.
-First 10 chars via raw system read after reopen for input:
-This is th
-Contents after raw lseek to pos 5:
-is the first and only line of this file.
-Now there is a second line.
-
-Making SFile rf...odd elements of file in reverse order:
-(i = 9 c = j d = 0.009)
-(i = 7 c = h d = 0.007)
-(i = 5 c = f d = 0.005)
-(i = 3 c = d d = 0.003)
-(i = 1 c = b d = 0.001)
-
-Making PlotFile pf ...(You may delete or attempt to plot plot.out)
-creating ostrstream...
-with contents:
-This is a string-based stream.
-With two lines.
-using it to create istrstream...
-with contents:
-This is a string-based stream.
-With two lines.
-
-Making filebuf streams fout and fin...contents of file:
-Thisfilehasonelinetestingoutputstreams.
-
-Final names & states:
-cin: (stdin) 0
-cout: (stdout) 0
-cerr: (stderr) 0
-
-end of test.
diff --git a/contrib/libg++/libg++/tests/tFile.inp b/contrib/libg++/libg++/tests/tFile.inp
deleted file mode 100644
index 436a5212c8dc..000000000000
--- a/contrib/libg++/libg++/tests/tFile.inp
+++ /dev/null
@@ -1,4 +0,0 @@
-a
-123 4567 89012
-123.456 -1.2e-2
-1 2 3 4 5
diff --git a/contrib/libg++/libg++/tests/tFix.cc b/contrib/libg++/libg++/tests/tFix.cc
deleted file mode 100644
index 96256f466dd9..000000000000
--- a/contrib/libg++/libg++/tests/tFix.cc
+++ /dev/null
@@ -1,101 +0,0 @@
-//
-// testFix.cc : test Fix (variable length) classes
-//
-
-#include <Fix.h>
-
-void check(const char* x, Fix y) { cout << x << " = " << (y) << "\n"; }
-
-void check(const char* x, int y) { cout << x << " = " << (y) << "\n"; }
-
-void check(const char* x, long y) { cout << x << " = " << (y) << "\n"; }
-
-void check(const char* x, double y) { cout << x << " = " << (y) << "\n"; }
-
-void checkb(const char* x, const Fix y)
-{
- cout << x << " = " << (y) << " [" << length(y) << "]"<< "\n";
-}
-
-
-
-int main() {
- cout << "Fix: identities should be displayed\n"
- << "[X] displays the precision of a given value\n"
- << "[*] indicates that the full precision is not used for coding reasons\n";
-
- Fix a; checkb("0 [16]",a);
- Fix b = .5; checkb(".5 [16]",b);
- Fix c(17,-.5); checkb("-.5 [17]",c);
- Fix d(33,.1); checkb(".1 [33]",d);
- Fix e = c; checkb("-.5 [17]",e);
-
- checkb(".3 [16]",a = .3);
- checkb(".5 [16]",a = b);
- checkb(".1 [16]",a = d);
- checkb(".1 [33*]",d = a);
- checkb("-.2 [17]",c = -.2);
- checkb("-.5 [17]",e);
-
- check(".1 [16] == .1 [33*]",a == d);
- d = .1;
- check(".1 [16] == .1 [33]",a == d);
- check(".1 [33] != .5 [16]",d != b);
- check(".1 [33] > .5 [16]",d > b);
- check(".1 [33] <= -.2 [17]",d <= c);
-
- e = .5;
- check("1073741824",mantissa(e).as_double());
- check(".5",value(e));
-
- checkb(".5 [17]",+e);
- checkb("-.5 [17]",-e);
-
- checkb(".1 [33] + .5 [16]",d+b);
- checkb(".1 [33] - .5 [16]",d-b);
- checkb(".1 [33] * .5 [16]",d*b);
- checkb(".1 [33] * 3",d*3);
- checkb(".1 [33] * -3",d*-3);
- checkb("-.1 [33] * 3",(-d)*3);
- checkb("-.1 [33] * -3",(-d)*-3);
- checkb(".5 [17] * -2",e*-2);
- checkb(".1 [33] % 25",d%25);
- checkb(".1 [33] % -25",d%-25);
- checkb(".1 [33] / .5 [16]",d/b);
- checkb(".1 [33] << 1",d<<1);
- checkb("-.1 [33] >> 2",(-d)>>2);
-
- checkb("abs(-.2)",abs(c));
- checkb("abs(.2)",abs(-c));
- check("sgn(-.2)",sgn(c));
- check("sgn(.2)",sgn(-c));
-
- cout << "\nshow .1 [33]\n";
- show(d);
-
- Fix g = .95;
-
- cout << "\nFix: range errors warned\n";
-
- Fix f = 1.1; checkb("1.1 [16]",f);
-
- checkb(".5 [16] / .1 [33]",b/d);
- checkb(".5 [16] / 0. [16]",b/Fix(0.));
- checkb(".5 [17] * 32768",e*32768);
-
- cout << "\nFix: overflows saturated\n";
- Fix::set_overflow_handler(Fix::overflow_saturate);
-
- checkb(".95 [16] + .1 [33]",g+d);
- checkb("-.1 [33] - .95 [16]",-d-g);
- checkb(".5 [17] * 2",e*2);
-
- cout << "\nFix: overflows generate warnings\n";
- Fix::set_overflow_handler(Fix::overflow_warning);
-
- checkb(".95 [16] + .1 [33]",g+d);
- checkb("-.1 [33] - .95 [16]",-d-g);
- checkb(".5 [17] * 2",e*2);
-
- return 0;
-}
diff --git a/contrib/libg++/libg++/tests/tFix.exp b/contrib/libg++/libg++/tests/tFix.exp
deleted file mode 100644
index 3ab0051aab2f..000000000000
--- a/contrib/libg++/libg++/tests/tFix.exp
+++ /dev/null
@@ -1,70 +0,0 @@
-Fix: identities should be displayed
-[X] displays the precision of a given value
-[*] indicates that the full precision is not used for coding reasons
-0 [16] = 0.00000 [16]
-.5 [16] = 0.50000 [16]
--.5 [17] = -0.50000 [17]
-.1 [33] = 0.10000 [33]
--.5 [17] = -0.50000 [17]
-.3 [16] = 0.29999 [16]
-.5 [16] = 0.50000 [16]
-.1 [16] = 0.09998 [16]
-.1 [33*] = 0.09998 [33]
--.2 [17] = -0.20001 [17]
--.5 [17] = -0.50000 [17]
-.1 [16] == .1 [33*] = 1
-.1 [16] == .1 [33] = 0
-.1 [33] != .5 [16] = 1
-.1 [33] > .5 [16] = 0
-.1 [33] <= -.2 [17] = 0
-1073741824 = 1.07374e+09
-.5 = 0.5
-.5 [17] = 0.50000 [17]
--.5 [17] = -0.50000 [17]
-.1 [33] + .5 [16] = 0.60000 [33]
-.1 [33] - .5 [16] = -0.40000 [33]
-.1 [33] * .5 [16] = 0.05000 [49]
-.1 [33] * 3 = 0.30000 [33]
-.1 [33] * -3 = -0.30000 [33]
--.1 [33] * 3 = -0.30000 [33]
--.1 [33] * -3 = 0.30000 [33]
-.5 [17] * -2 = -1.00000 [17]
-.1 [33] % 25 = 0.10000 [58]
-.1 [33] % -25 = 0.09375 [8]
-.1 [33] / .5 [16] = 0.20001 [33]
-.1 [33] << 1 = 0.20000 [33]
--.1 [33] >> 2 = 0.47500 [33]
-abs(-.2) = 0.20001 [17]
-abs(.2) = 0.20001 [17]
-sgn(-.2) = -1
-sgn(.2) = 1
-
-show .1 [33]
-len = 33
-siz = 3
-ref = 1
-man = ccccccc8000
-val = 0.1
-
-Fix: range errors warned
-Fix: range error in declaration
-1.1 [16] = 0.00000 [16]
-Fix: range error in division
-.5 [16] / .1 [33] = 0.00000 [16]
-Fix: range error in division -- division by zero
-.5 [16] / 0. [16] = 0.00000 [16]
-Fix: range error in multiply by int -- int too large
-.5 [17] * 32768 = -1.00000 [17]
-
-Fix: overflows saturated
-.95 [16] + .1 [33] = 1.00000 [33]
--.1 [33] - .95 [16] = -1.00000 [33]
-.5 [17] * 2 = 0.99998 [17]
-
-Fix: overflows generate warnings
-Fix: overflow warning
-.95 [16] + .1 [33] = -0.94999 [33]
-Fix: overflow warning
--.1 [33] - .95 [16] = 0.94999 [33]
-Fix: overflow warning
-.5 [17] * 2 = -0.49994 [17]
diff --git a/contrib/libg++/libg++/tests/tFix.inp b/contrib/libg++/libg++/tests/tFix.inp
deleted file mode 100644
index e69de29bb2d1..000000000000
--- a/contrib/libg++/libg++/tests/tFix.inp
+++ /dev/null
diff --git a/contrib/libg++/libg++/tests/tFix16.cc b/contrib/libg++/libg++/tests/tFix16.cc
deleted file mode 100644
index beedc463fafc..000000000000
--- a/contrib/libg++/libg++/tests/tFix16.cc
+++ /dev/null
@@ -1,110 +0,0 @@
-//
-// testFix16.cc : test Fix16/32 classes
-//
-
-#include <Fix16.h>
-
-// This set of inlines (instead of a macro) is to force the side effects
-// of evaluating y to happen before x is printed.
-
-inline void check(char *x, int y) { cout << x << " = " << (y) << "\n"; }
-inline void check(char *x, long y) { cout << x << " = " << (y) << "\n"; }
-inline void check(char *x, double y) { cout << x << " = " << (y) << "\n"; }
-inline void check(char *x, Fix16 y) { cout << x << " = " << (y) << "\n"; }
-inline void check(char *x, Fix32 y) { cout << x << " = " << (y) << "\n"; }
-
-void test16() {
- cout << "Fix16: identities should be displayed\n";
-
- Fix16 a; check("0",a);
- Fix16 b = .5; check(".5",b);
- Fix16 c = -.5; check("-.5",c);
- Fix16 d = .1; check(".1",d);
- Fix16 e = b; check(".5",e);
-
- check(".5",a = b);
- check(".25",a = .25);
- check("8192",mantissa(a));
- mantissa(a)=8192;
- check(".25",a);
- check(".25",value(a));
-
- check(".25",+a);
- check("-.25",-a);
-
- check(".1 + .5",d+b);
- check(".1 - .5",d-b);
- check(".1 * .5",d*b);
- check(".1 * 3",d*3);
- check(".1 * -3",d*-3);
- check(".1 / .5",d/b);
- check(".1 << 1",d<<1);
- check("-.5 >> 2",c>>2);
-
- check(".1 == .5",d == b);
- check(".1 != .5",d != b);
- check(".1 > .5",d > b);
- check(".5 <= -.5",b <= c);
-
- cout << "Fix16: range errors ignored and overflows saturated\n";
- set_Fix16_overflow_handler(Fix16_overflow_saturate);
- set_Fix16_range_error_handler(Fix16_ignore);
-
- Fix16 f = 1.1; check("1.1",f);
-
- Fix16 g = .7;
- check(".7 + .5",g+b);
- check("-.5 - .7",c-g);
- check(".5 / .1",b/d);
-}
-
-void test32() {
- cout << "Fix32: identities should be displayed\n";
-
- Fix32 a; check("0",a);
- Fix32 b = .5; check(".5",b);
- Fix32 c = -.5; check("-.5",c);
- Fix32 d = .1; check(".1",d);
- Fix32 e = b; check(".5",e);
-
- check(".5",a = b);
- check(".25",a = .25);
- check("536870912",mantissa(a));
- mantissa(a)=536870912;
- check(".25",a);
- check(".25",value(a));
-
- check(".25",+a);
- check("-.25",-a);
-
- check(".1 + .5",d+b);
- check(".1 - .5",d-b);
- check(".1 * .5",d*b);
- check(".1 * 3",d*3);
- check(".1 * -3",d*-3);
- check(".1 / .5",d/b);
- check(".1 << 1",d<<1);
- check("-.5 >> 2",c>>2);
-
- check(".1 == .5",d == b);
- check(".1 != .5",d != b);
- check(".1 > .5",d > b);
- check(".5 <= -.5",b <= c);
-
- cout << "Fix32: range errors reported and overflows reported\n";
- set_Fix32_overflow_handler(Fix32_warning);
- set_Fix32_range_error_handler(Fix32_warning);
-
- Fix32 f = 1.1; check("1.1",f);
-
- Fix32 g = .7;
- check(".7 + .5",g+b);
- check("-.5 - .7",c-g);
- check(".5 / .1",b/d);
-}
-
-int main() {
- test16();
- test32();
- return 0;
-}
diff --git a/contrib/libg++/libg++/tests/tFix16.exp b/contrib/libg++/libg++/tests/tFix16.exp
deleted file mode 100644
index be40a2aae382..000000000000
--- a/contrib/libg++/libg++/tests/tFix16.exp
+++ /dev/null
@@ -1,64 +0,0 @@
-Fix16: identities should be displayed
-0 = 0
-.5 = 0.5
--.5 = -0.5
-.1 = 0.100006
-.5 = 0.5
-.5 = 0.5
-.25 = 0.25
-8192 = 8192
-.25 = 0.25
-.25 = 0.25
-.25 = 0.25
--.25 = -0.25
-.1 + .5 = 0.600006
-.1 - .5 = -0.399994
-.1 * .5 = 0.0500031
-.1 * 3 = 0.300018
-.1 * -3 = -0.300018
-.1 / .5 = 0.200012
-.1 << 1 = 0.200012
--.5 >> 2 = -0.125
-.1 == .5 = 0
-.1 != .5 = 1
-.1 > .5 = 0
-.5 <= -.5 = 0
-Fix16: range errors ignored and overflows saturated
-1.1 = 0.999969
-.7 + .5 = 0.999969
--.5 - .7 = -1
-.5 / .1 = 0.999969
-Fix32: identities should be displayed
-0 = 0
-.5 = 0.5
--.5 = -0.5
-.1 = 0.1
-.5 = 0.5
-.5 = 0.5
-.25 = 0.25
-536870912 = 536870912
-.25 = 0.25
-.25 = 0.25
-.25 = 0.25
--.25 = -0.25
-.1 + .5 = 0.6
-.1 - .5 = -0.4
-.1 * .5 = 0.05
-.1 * 3 = 0.3
-.1 * -3 = -0.3
-.1 / .5 = 0.2
-.1 << 1 = 0.2
--.5 >> 2 = -0.125
-.1 == .5 = 0
-.1 != .5 = 1
-.1 > .5 = 0
-.5 <= -.5 = 0
-Fix32: range errors reported and overflows reported
-warning: Fix32 result out of range
-1.1 = 1
-warning: Fix32 result out of range
-.7 + .5 = -0.8
-warning: Fix32 result out of range
--.5 - .7 = 0.8
-warning: Fix32 result out of range
-.5 / .1 = 1
diff --git a/contrib/libg++/libg++/tests/tFix16.inp b/contrib/libg++/libg++/tests/tFix16.inp
deleted file mode 100644
index e69de29bb2d1..000000000000
--- a/contrib/libg++/libg++/tests/tFix16.inp
+++ /dev/null
diff --git a/contrib/libg++/libg++/tests/tFix24.cc b/contrib/libg++/libg++/tests/tFix24.cc
deleted file mode 100644
index 08bd00994cbd..000000000000
--- a/contrib/libg++/libg++/tests/tFix24.cc
+++ /dev/null
@@ -1,113 +0,0 @@
-//
-// testFix24.cc : test Fix24/48 classes
-//
-
-#include <Fix24.h>
-
-// This a set of inlines instead of a macro to force the side effects
-// of evaluating y to happen before x is printed.
-
-inline void check(char *x, int y) { cout << x << " = " << (y) << "\n"; }
-inline void check(char *x, unsigned int y) { cout << x << " = " << (y) << "\n"; }
-inline void check(char *x, long y) { cout << x << " = " << (y) << "\n"; }
-inline void check(char *x, unsigned long y) { cout << x << " = " << (y) << "\n"; }
-inline void check(char *x, double y) { cout << x << " = " << (y) << "\n"; }
-inline void check(char *x, Fix24 y) { cout << x << " = " << (y) << "\n"; }
-inline void check(char *x, Fix48 y) { cout << x << " = " << (y) << "\n"; }
-
-void test24() {
- cout << "Fix24: identities should be displayed\n";
-
- Fix24 a; check("0",a);
- Fix24 b = .5; check(".5",b);
- Fix24 c = -.5; check("-.5",c);
- Fix24 d = .1; check(".1",d);
- Fix24 e = b; check(".5",e);
-
- check(".5",a = b);
- check(".25",a = .25);
- check("536870912",mantissa(a));
- mantissa(a)=536870912;
- check(".25",a);
- check(".25",value(a));
-
- check(".25",+a);
- check("-.25",-a);
-
- check(".1 + .5",d+b);
- check(".1 - .5",d-b);
- check(".1 * .5",d*b);
- check(".1 * 3",d*3);
- check(".1 * -3",d*-3);
- check(".1 / .5",d/b);
- check(".1 << 1",d<<1);
- check("-.5 >> 2",c>>2);
-
- check(".1 == .5",d == b);
- check(".1 != .5",d != b);
- check(".1 > .5",d > b);
- check(".5 <= -.5",b <= c);
-
- cout << "Fix24: range errors ignored and overflows saturated\n";
- set_Fix24_overflow_handler(Fix24_overflow_saturate);
- set_Fix24_range_error_handler(Fix24_ignore);
-
- Fix24 f = 1.1; check("1.1",f);
-
- Fix24 g = .7;
- check(".7 + .5",g+b);
- check("-.5 - .7",c-g);
- check(".5 / .1",b/d);
-}
-
-void test48() {
- cout << "Fix48: identities should be displayed\n";
-
- Fix48 a; check("0",a);
- Fix48 b = .5; check(".5",b);
- Fix48 c = -.5; check("-.5",c);
- Fix48 d = .1; check(".1",d);
- Fix48 e = b; check(".5",e);
-
- check(".5",a = b);
- check(".25",a = .25);
- twolongs t;
- t = mantissa(a);
- check("536870912",t.u);
- check("0",t.l);
- mantissa(a)=t;
- check(".25",a);
- check(".25",value(a));
-
- check(".25",+a);
- check("-.25",-a);
-
- check(".1 + .5",d+b);
- check(".1 - .5",d-b);
- check(".1 * 3",d*3);
- check(".1 * -3",d*-3);
- check(".1 << 1",d<<1);
- check("-.5 >> 2",c>>2);
-
- check(".1 == .5",d == b);
- check(".1 != .5",d != b);
- check(".1 > .5",d > b);
- check(".5 <= -.5",b <= c);
-
- cout << "Fix48: range errors reported and overflows reported\n";
- set_Fix48_overflow_handler(Fix48_warning);
- set_Fix48_range_error_handler(Fix48_warning);
-
- Fix48 f = 1.1; check("1.1",f);
-
- Fix48 g = .7;
- check(".7 + .5",g+b);
- check("-.5 - .7",c-g);
-}
-
-int main() {
- test24();
- test48();
- return 0;
-}
-
diff --git a/contrib/libg++/libg++/tests/tFix24.exp b/contrib/libg++/libg++/tests/tFix24.exp
deleted file mode 100644
index 598f8054e699..000000000000
--- a/contrib/libg++/libg++/tests/tFix24.exp
+++ /dev/null
@@ -1,61 +0,0 @@
-Fix24: identities should be displayed
-0 = 0
-.5 = 0.5
--.5 = -0.5
-.1 = 0.1
-.5 = 0.5
-.5 = 0.5
-.25 = 0.25
-536870912 = 536870912
-.25 = 0.25
-.25 = 0.25
-.25 = 0.25
--.25 = -0.25
-.1 + .5 = 0.6
-.1 - .5 = -0.4
-.1 * .5 = 0.05
-.1 * 3 = 0.3
-.1 * -3 = -0.3
-.1 / .5 = 0.2
-.1 << 1 = 0.2
--.5 >> 2 = -0.125
-.1 == .5 = 0
-.1 != .5 = 1
-.1 > .5 = 0
-.5 <= -.5 = 0
-Fix24: range errors ignored and overflows saturated
-1.1 = 1
-.7 + .5 = 1
--.5 - .7 = -1
-.5 / .1 = 1
-Fix48: identities should be displayed
-0 = 0
-.5 = 0.5
--.5 = -0.5
-.1 = 0.1
-.5 = 0.5
-.5 = 0.5
-.25 = 0.25
-536870912 = 536870912
-0 = 0
-.25 = 0.25
-.25 = 0.25
-.25 = 0.25
--.25 = -0.25
-.1 + .5 = 0.6
-.1 - .5 = -0.4
-.1 * 3 = 0.3
-.1 * -3 = -0.3
-.1 << 1 = 0.2
--.5 >> 2 = -0.125
-.1 == .5 = 0
-.1 != .5 = 1
-.1 > .5 = 0
-.5 <= -.5 = 0
-Fix48: range errors reported and overflows reported
-warning: Fix48 result out of range
-1.1 = 1
-warning: Fix48 result out of range
-.7 + .5 = -0.8
-warning: Fix48 result out of range
--.5 - .7 = 0.8
diff --git a/contrib/libg++/libg++/tests/tFix24.inp b/contrib/libg++/libg++/tests/tFix24.inp
deleted file mode 100644
index e69de29bb2d1..000000000000
--- a/contrib/libg++/libg++/tests/tFix24.inp
+++ /dev/null
diff --git a/contrib/libg++/libg++/tests/tGetOpt.cc b/contrib/libg++/libg++/tests/tGetOpt.cc
deleted file mode 100644
index c9eb7e7d1ce2..000000000000
--- a/contrib/libg++/libg++/tests/tGetOpt.cc
+++ /dev/null
@@ -1,65 +0,0 @@
-
-#include <GetOpt.h>
-
-int
-main (int argc, char **argv)
-{
- int digit_optind = 0;
- GetOpt getopt (argc, argv, "abc:d:0123456789");
-
- while (1)
- {
- int this_option_optind = getopt.optind;
- int ch;
- if ((ch = getopt ()) == EOF)
- break;
- char c = char(ch);
- switch (c)
- {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- if (digit_optind != 0 && digit_optind != this_option_optind)
- printf ("digits occur in two different argv-elements.\n");
- digit_optind = this_option_optind;
- printf ("option %c\n", c);
- break;
-
- case 'a':
- printf ("option a\n");
- break;
-
- case 'b':
- printf ("option b\n");
- break;
-
- case 'c':
- printf ("option c with value `%s'\n", getopt.optarg);
- break;
-
- case '?':
- break;
-
- default:
- printf ("?? getopt returned character code 0%o ??\n", c);
- }
- }
-
- if (getopt.optind < argc)
- {
- printf ("non-option ARGV-elements: ");
- while (getopt.optind < argc)
- printf ("%s ", argv[getopt.optind++]);
- printf ("\n");
- }
-
- return 0;
-}
-
diff --git a/contrib/libg++/libg++/tests/tGetOpt.exp b/contrib/libg++/libg++/tests/tGetOpt.exp
deleted file mode 100644
index 827bb56abc28..000000000000
--- a/contrib/libg++/libg++/tests/tGetOpt.exp
+++ /dev/null
@@ -1,11 +0,0 @@
-./tGetOpt: unrecognized option `-h'
-./tGetOpt: unrecognized option `-i'
-option a
-option b
-option c with value `-de10'
-option 2
-option 0
-option 0
-option 0
-digits occur in two different argv-elements.
-option 3
diff --git a/contrib/libg++/libg++/tests/tGetOpt.inp b/contrib/libg++/libg++/tests/tGetOpt.inp
deleted file mode 100644
index e69de29bb2d1..000000000000
--- a/contrib/libg++/libg++/tests/tGetOpt.inp
+++ /dev/null
diff --git a/contrib/libg++/libg++/tests/tInteger.cc b/contrib/libg++/libg++/tests/tInteger.cc
deleted file mode 100644
index f0c335e5ac3a..000000000000
--- a/contrib/libg++/libg++/tests/tInteger.cc
+++ /dev/null
@@ -1,437 +0,0 @@
-/*
- a test file for Integer class
- */
-
-#include <Integer.h>
-#include <assert.h>
-
-#define tassert(ex) { cerr << #ex; \
- if ((ex)) cerr << " OK\n"; \
- else cerr << " Fail\n"; }
-
-
-Integer factorial(Integer n)
-{
- Integer f;
- if (n < 0)
- f = 0;
- else
- {
- f = 1;
- while (n > 0)
- {
- f *= n;
- --n;
- }
- }
- return f;
-}
-
-Integer fibonacci(long n)
-{
- Integer f;
- if (n <= 0)
- f = 0;
- else
- {
- f = 1;
- Integer prev = 0;
- Integer tmp;
- while (n > 1)
- {
- tmp = f;
- f += prev;
- prev = tmp;
- --n;
- }
- }
- return f;
-}
-
-
-void identitytest(Integer& a, Integer& b, Integer& c)
-{
- assert( -(-a) == a);
- assert( (a + b) == (b + a));
- assert( (a + (-b)) == (a - b));
- assert( (a * b) == (b * a));
- assert( (a * (-b)) == -(a * b));
- assert( (a / (-b)) == -(a / b));
- assert( (a - b) == -(b - a));
- assert( (a + (b + c)) == ((a + b) + c));
- assert( (a * (b * c)) == ((a * b) * c));
- assert( (a * (b + c)) == ((a * b) + (a * c)));
- assert( ((a - b) + b) == a);
- assert( ((a + b) - b) == a);
- assert( ((a * b) / b) == a);
- assert( ((a * b) % b) == 0);
- assert( (b * (a / b) + (a % b)) == a);
- assert( ((a + b) % c) == ((a % c) + (b % c)) % c);
-}
-
-void utiltest(Integer& a)
-{
- assert(sqrt(sqr(a)) == a);
- assert(sqr(sqrt(a)) <= a);
-
- Integer x = 1;
- for (int i = 0; i < 10; ++i)
- {
- assert(pow(a, i) == x);
- x *= a;
- }
- setbit(x, 0);
- assert(testbit(x, 0));
- assert(odd(x));
- assert(!even(x));
- clearbit(x, 0);
- clearbit(x, 1);
- assert(even(x));
- assert(!odd(x));
- assert(x % 4 == 0);
-
-}
-
-void bittest(Integer& a, Integer& b, Integer& c)
-{
- assert( (a | b) == (b | a));
- assert( (a & b) == (b & a));
- assert( (a ^ b) == (b ^ a));
- assert( (a | (b | c)) == ((a | b) | c));
- assert( (a & (b & c)) == ((a & b) & c));
- assert( (a & (b | c)) == ((a & b) | (a & c)));
- assert( (a | (b & c)) == ((a | b) & (a | c)));
- assert( (a & (a | b)) == a);
- assert( (a | (a & b)) == a);
-}
-
-void accumtest(Integer& a, Integer& b, Integer& c)
-{
- Integer x = a;
- x *= b;
- assert(x == (a * b));
- x += c;
- assert(x == ((a * b) + c));
- x -= a;
- assert(x == (((a * b) + c) - a));
- x /= b;
- assert(x == ((((a * b) + c) - a) / b));
- x %= c;
- assert(x == (((((a * b) + c) - a) / b) % c));
- x &= a;
- assert(x == ((((((a * b) + c) - a) / b) % c) & a));
- x |= b;
- assert(x == (((((((a * b) + c) - a) / b) % c) & a) | b));
- x ^= c;
- assert(x == ((((((((a * b) + c) - a) / b) % c) & a) | b) ^ c));
-
- assert(x.OK());
-}
-
-void longidentitytest(Integer& a, long b, long c)
-{
- assert( (a + b) == (b + a));
- assert( (a + (-b)) == (a - b));
- assert( (a * b) == (b * a));
- assert( (a * (-b)) == -(a * b));
- assert( (a / (-b)) == -(a / b));
- assert( (a - b) == -(b - a));
- assert( (a + (b + c)) == ((a + b) + c));
- assert( (a * (b * c)) == ((a * b) * c));
- assert( (a * (b + c)) == ((a * b) + (a * c)));
- assert( ((a - b) + b) == a);
- assert( ((a + b) - b) == a);
- assert( ((a * b) / b) == a);
- assert( ((a * b) % b) == 0);
- assert( (b * (a / b) + (a % b)) == a);
- assert( ((a + b) % c) == ((a % c) + (b % c)) % c);
-}
-
-void longbittest(Integer& a, long b, long c)
-{
- assert( (a | b) == (b | a));
- assert( (a & b) == (b & a));
- assert( (a ^ b) == (b ^ a));
- assert( (a | (b | c)) == ((a | b) | c));
- assert( (a & (b & c)) == ((a & b) & c));
- assert( (a & (b | c)) == ((a & b) | (a & c)));
- assert( (a | (b & c)) == ((a | b) & (a | c)));
- assert( (a & (a | b)) == a);
- assert( (a | (a & b)) == a);
-}
-
-void longaccumtest(Integer& a, long b, long c)
-{
- Integer x = a;
- x *= b;
- assert(x == (a * b));
- x += c;
- assert(x == ((a * b) + c));
- x -= a;
- assert(x == (((a * b) + c) - a));
- x /= b;
- assert(x == ((((a * b) + c) - a) / b));
- x %= c;
- assert(x == (((((a * b) + c) - a) / b) % c));
- x &= a;
- assert(x == ((((((a * b) + c) - a) / b) % c) & a));
- x |= b;
- assert(x == (((((((a * b) + c) - a) / b) % c) & a) | b));
- x ^= c;
- assert(x == ((((((((a * b) + c) - a) / b) % c) & a) | b) ^ c));
-
- assert(x.OK());
-}
-
-void anothertest()
-{
- Integer pow64 = Ipow(2, 64);
- cout << "pow64 = Ipow(2, 64) = " << pow64 << "\n";
- assert(pow64.OK());
- cout << "lg(pow64) = " << lg(pow64) << "\n";
- assert(lg(pow64) == 64);
- int k;
- for (k = 0; k < 64; ++k) assert(testbit(pow64, k) == 0);
- assert(testbit(pow64, k) != 0);
-
- Integer s64 = 1;
- s64 <<= 64;
- cout << "s64 = 1 << 64 = " << s64 << "\n";
- assert(s64.OK());
-
- assert(s64 == pow64);
- assert(s64 >= pow64);
- assert(s64 <= pow64);
- assert(!(s64 != pow64));
- assert(!(s64 > pow64));
- assert(!(s64 < pow64));
-
- Integer s32 = s64 >> 32;
- cout << "s32 = s64 >> 32 = " << s32 << "\n";
- assert(s32.OK());
- assert(lg(s32) == 32);
- assert(!(pow64 == s32));
- assert(!(pow64 < s32));
- assert(!(pow64 <= s32));
- assert(pow64 != s32);
- assert(pow64 >= s32);
- assert(pow64 > s32);
-
- Integer comps64 = ~s64;
- cout << "comps64 = ~s64 = " << comps64 << "\n";
- for (k = 0; k < 64; ++k) assert(testbit(comps64, k) == !testbit(s64, k));
- Integer result = (comps64 & s32);
- cout << "comps64 & s32 = " << result << "\n";
- assert(result.OK());
- result = (comps64 | s32);
- cout << "comps64 | s32 = " << result << "\n";
- assert(result.OK());
- result = (comps64 ^ s32);
- cout << "comps64 ^ s32 = " << result << "\n";
- assert(result.OK());
-
- identitytest(s64, s32, comps64);
- bittest(s32, s64, comps64);
- accumtest(comps64, s32, pow64);
- utiltest(s32);
- longidentitytest(s64, 1000, 50);
- longbittest(s64, 12345, 67890);
- longaccumtest(s32, 100000, 1);
-
-}
-
-void iotest()
-{
- Integer result;
-
- cout << "\nenter an Integer: ";
- cin.setf(0, ios::basefield);
- cin >> result;
- cout << "number = " << hex << result << dec << "\n";
- assert(result.OK());
-
- cout << "enter another Integer: ";
- cin >> result;
- cout << "number = " << result << "\n";
- assert(result.OK());
-
- cout << "enter another Integer: ";
- cin >> dec >> result;
- cout << "number = " << result << "\n";
- assert(result.OK());
-
-}
-
-void fibtest()
-{
- Integer fib50 = fibonacci(50);
- cout << "fib50 = fibonacci(50) = " << fib50 << "\n";
- assert(fib50.OK());
- Integer fib48 = fibonacci(48);
- cout << "fib48 = fibonacci(48) = " << fib48 << "\n";
- assert(fib48.OK());
-
- Integer result = fib48 + fib50;
- cout << "fib48 + fib50 = " << result << "\n";
- result = fib48 - fib50;
- cout << "fib48 - fib50 = " << result << "\n";
- result = fib48 * fib50;
- cout << "fib48 * fib50 = " << result << "\n";
- result = fib48 / fib50;
- cout << "fib48 / fib50 = " << result << "\n";
- result = fib48 % fib50;
- cout << "fib48 % fib50 = " << result << "\n";
- result = gcd(fib50, fib48);
- cout << "gcd(fib50, fib48) = " << result << "\n";
- result = sqrt(fib50);
- cout << "sqrt(fib50) = " << result << "\n";
-
- identitytest(result, fib50, fib48);
- bittest(result, fib50, fib48);
- accumtest(result, fib50, fib48);
- utiltest(fib48);
- longidentitytest(fib50, 1000, 50);
- longaccumtest(fib48, 100000, 1);
-}
-
-
-void facttest(Integer& one, Integer& two)
-{
- Integer fact30(factorial(30));
- cout << "fact30 = factorial(30) = " << fact30 << "\n";
- assert(fact30.OK());
-
- Integer fact28(factorial(28));
- cout << "fact28 = factorial(28) = " << fact28 << "\n";
- assert(fact28.OK());
- assert(fact30 == fact28 * 870);
-
- Integer result = fact30 + fact28;
- cout << "fact30 + fact28 = " << result << "\n";
- result = fact30 - fact28;
- cout << "fact30 - fact28 = " << result << "\n";
- result = fact30 * fact28;
- cout << "fact30 * fact28 = " << result << "\n";
- result = fact30 / fact28;
- cout << "fact30 / fact28 = " << result << "\n";
- result = fact30 % fact28;
- cout << "fact30 % fact28 = " << result << "\n";
-
- result = -fact30;
- cout << "-fact30 = " << result << "\n";
- assert(abs(result) == fact30);
-
- cout << "lg(fact30) = " << lg(fact30) << "\n";
- assert(lg(fact30) == 107);
-
- result = gcd(fact30, fact28);
- cout << "gcd(fact30, fact28) = " << result << "\n";
- assert(result == fact28);
-
- result = sqrt(fact30);
- cout << "sqrt(fact30) = " << result << "\n";
-
- Integer negfact31 = fact30 * -31;
- Integer posfact31 = abs(negfact31);
- assert(negfact31.OK());
- assert(posfact31.OK());
- cout << "negfact31 = " << negfact31 << "\n";
- result = fact30 + negfact31;
- cout << "fact30 + negfact31 = " << result << "\n";
- result = fact30 - negfact31;
- cout << "fact30 - negfact31 = " << result << "\n";
- result = fact30 * negfact31;
- cout << "fact30 * negfact31 = " << result << "\n";
- result = fact30 / negfact31;
- cout << "fact30 / negfact31 = " << result << "\n";
- result = fact30 % negfact31;
- cout << "fact30 % negfact31 = " << result << "\n";
- result = gcd(fact30, negfact31);
- cout << "gcd(fact30, negfact31) = " << result << "\n";
- assert(result == fact30);
-
- identitytest(one, one, one);
- identitytest(one, one, one);
- identitytest(one, two, fact30);
- identitytest(fact30, posfact31, fact28);
- identitytest(fact30, negfact31, fact28);
- identitytest(negfact31, posfact31, fact28);
-
- bittest(one, one, one);
- bittest(one, one, one);
- bittest(one, two, fact30);
- bittest(fact30, posfact31, fact28);
-
- accumtest(one, one, one);
- accumtest(one, one, one);
- accumtest(one, two, fact30);
- accumtest(fact30, posfact31, fact28);
-
- utiltest(one);
- utiltest(fact30);
- utiltest(posfact31);
-
- longidentitytest(one, 1, 1);
- longidentitytest(one, 2, 3);
- longidentitytest(fact30, 3, -20);
- longidentitytest(fact30, 4, 20000);
- longidentitytest(negfact31, -100, 20000);
-
- longbittest(one, 1, 1);
- longbittest(one, 2, 3);
- longbittest(fact30, 4, 20000);
- longbittest(fact28, 1000, 50);
-
- longaccumtest(one, 1, 1);
- longaccumtest(one, 2, 3);
- longaccumtest(fact30, 4, 20000);
- longaccumtest(fact30, 1000, 50);
- longaccumtest(fact28, 10000000, 100000000);
-}
-
-void modtest()
-{
- Integer b, e, m;
-
- m = 1; m <<= 32;
- b = m + 1;
-
- e = Ipow( 2, 32 );
- b = Ipow( 2, 32 ); // use b as a comparison
- cout << "2^32 = " << e << "\n";
-
- e %= (e-1); // do same op two ways...
- b = b % (b - 1);
-
- cout << "2^32 % (2^32-1) = " << e << "\n"; // e is incorrect here
- cout << "2^32 % (2^32-1) = " << b << "\n"; // but b is ok
-}
-
-int main()
-{
- Integer one = 1;
- cout << "one = " << one << "\n";
- assert(one.OK());
- assert(one == 1);
- cout << "one + 1 = " << (one + 1) << "\n";
-
- Integer two = 2;
- cout << "two = " << two << "\n";
- assert(two.OK());
- assert(two == 2);
-
-/* inbox/1782 */
- Integer n (0);
- setbit (n, 8);
- clearbit (n, 16);
- cout << "twofiftysix = " << n << '\n';
-
- facttest(one, two);
- fibtest();
- anothertest();
- iotest();
- modtest();
-
- cout << "\nEnd of test\n";
- return 0;
-}
diff --git a/contrib/libg++/libg++/tests/tInteger.exp b/contrib/libg++/libg++/tests/tInteger.exp
deleted file mode 100644
index 6a0d7e61fb80..000000000000
--- a/contrib/libg++/libg++/tests/tInteger.exp
+++ /dev/null
@@ -1,48 +0,0 @@
-one = 1
-one + 1 = 2
-two = 2
-twofiftysix = 256
-fact30 = factorial(30) = 265252859812191058636308480000000
-fact28 = factorial(28) = 304888344611713860501504000000
-fact30 + fact28 = 265557748156802772496809984000000
-fact30 - fact28 = 264947971467579344775806976000000
-fact30 * fact28 = 80872505331661933764010628483512781121876047953920000000000000
-fact30 / fact28 = 870
-fact30 % fact28 = 0
--fact30 = -265252859812191058636308480000000
-lg(fact30) = 107
-gcd(fact30, fact28) = 304888344611713860501504000000
-sqrt(fact30) = 16286585271694955
-negfact31 = -8222838654177922817725562880000000
-fact30 + negfact31 = -7957585794365731759089254400000000
-fact30 - negfact31 = 8488091513990113876361871360000000
-fact30 * negfact31 = -2181131468794922353615366650200339706856997013317222400000000000000
-fact30 / negfact31 = 0
-fact30 % negfact31 = 265252859812191058636308480000000
-gcd(fact30, negfact31) = 265252859812191058636308480000000
-fib50 = fibonacci(50) = 12586269025
-fib48 = fibonacci(48) = 4807526976
-fib48 + fib50 = 17393796001
-fib48 - fib50 = -7778742049
-fib48 * fib50 = 60508827864880718400
-fib48 / fib50 = 0
-fib48 % fib50 = 4807526976
-gcd(fib50, fib48) = 1
-sqrt(fib50) = 112188
-pow64 = Ipow(2, 64) = 18446744073709551616
-lg(pow64) = 64
-s64 = 1 << 64 = 18446744073709551616
-s32 = s64 >> 32 = 4294967296
-comps64 = ~s64 = 18446744073709551615
-comps64 & s32 = 4294967296
-comps64 | s32 = 18446744073709551615
-comps64 ^ s32 = 18446744069414584319
-
-enter an Integer: number = 1234abdecf99fed123
-enter another Integer: number = 0
-enter another Integer: number = -12345678901234567890
-2^32 = 4294967296
-2^32 % (2^32-1) = 1
-2^32 % (2^32-1) = 1
-
-End of test
diff --git a/contrib/libg++/libg++/tests/tInteger.inp b/contrib/libg++/libg++/tests/tInteger.inp
deleted file mode 100644
index 3dee0b82c9aa..000000000000
--- a/contrib/libg++/libg++/tests/tInteger.inp
+++ /dev/null
@@ -1,3 +0,0 @@
-0x1234abdecf99FED123
-0
--012345678901234567890
diff --git a/contrib/libg++/libg++/tests/tLList.cc b/contrib/libg++/libg++/tests/tLList.cc
deleted file mode 100644
index b491438a2645..000000000000
--- a/contrib/libg++/libg++/tests/tLList.cc
+++ /dev/null
@@ -1,236 +0,0 @@
-/*
- test/demo of linked structures
-*/
-
-
-#include <assert.h>
-
-#define tassert(ex) {if ((ex)) cerr << #ex << "\n"; \
- else _assert(#ex, __FILE__,__LINE__); }
-
-#include <stream.h>
-#include "iSLList.h"
-
-
-void printlist(intSLList& l)
-{
- for (Pix p = l.first(); p != 0; l.next(p)) cout << l(p) << " ";
- cout << "\n";
-}
-
-
-void SLtest()
-{
- int i;
- intSLList a;
- assert(a.OK());
- assert(a.empty());
- cout << "prepending...\n";
- for (i = 0; i < 10; ++i)
- {
- assert(a.length() == i);
- a.prepend(i);
- assert(a.front() == i);
- }
- cout << "a: "; printlist(a);
- cout << "appending...\n";
- for (i = 0; i < 10; ++i)
- {
- assert(a.length() == 10 + i);
- a.append(i);
- assert(a.rear() == i);
- }
- cout << "a: "; printlist(a);
- intSLList b = a;
- cout << "b = a: " << "\n"; printlist(b);
- assert(b.OK());
- assert(b.length() == a.length());
- assert(b.front() == a.front());
- assert(b.rear() == a.rear());
- cout << "remove_front of first 10 elements:\n";
- for (i = 0; i < 10; ++i)
- {
- assert(b.length() == 20 - i);
- assert(b.front() == 9 - i);
- b.remove_front();
- }
- assert(b.length() == 10);
- cout << "b: "; printlist(b);
-
- cout << "inserting 100 after sixth element...\n";
- Pix bp = b.first();
- for (i = 0; i < 5; ++i) b.next(bp);
- b.ins_after(bp, 100);
- assert(b.length() == 11);
- cout << "b: "; printlist(b);
- a.join(b);
- cout << "after a.join(b)\n"; printlist(a);
- assert(b.empty());
- assert(a.length() == 31);
- cout << "b: " << "\n"; printlist(b);
- b.prepend(999);
- cout << "b: " << "\n"; printlist(b);
- assert(b.length() == 1);
- assert(b.front() == 999);
- assert(b.rear() == 999);
- assert(b.OK());
- intSLList bb = b;
- cout << "bb: " << "\n"; printlist(bb);
- assert(bb.OK());
- assert(bb.length() == 1);
- assert(bb.front() == 999);
- assert(bb.rear() == 999);
- assert(bb.remove_front() == 999);
- b.prepend(1234);
- assert(b.length() == 2);
- b.del_after(b.first());
- assert(b.rear() == 1234);
- assert(b.length() == 1);
- b.del_after(0);
- assert(b.length() == 0);
-
- assert(a.OK());
- assert(b.OK());
- assert(bb.OK());
-}
-
-#include "iDLList.h"
-
-void printDlist(intDLList& l)
-{
- for (Pix p = l.first(); p != 0; l.next(p)) cout << l(p) << " ";
- cout << "\n";
-}
-
-void DLtest()
-{
- int i;
- intDLList a;
- assert(a.OK());
- assert(a.empty());
- assert(a.length() == 0);
- cout << "prepending...\n";
- for (i = 0; i < 10; ++i)
- {
- assert(a.length() == i);
- a.prepend(i);
- assert(a.front() == i);
- }
- cout << "a: " << "\n"; printDlist(a);
- cout << "appending...\n";
- for (i = 0; i < 10; ++i)
- {
- assert(a.length() == 10 + i);
- a.append(i);
- assert(a.rear() == i);
- }
- cout << "a: "; printDlist(a);
- intDLList b = a;
- assert(b.OK());
- assert(b.length() == a.length());
- assert(b.front() == a.front());
- assert(b.rear() == a.rear());
- cout << "b = a: "; printDlist(b);
- cout << "remove_front of first 10 elements:\n";
- for (i = 0; i < 10; ++i)
- {
- assert(b.length() == 20 - i);
- assert(b.front() == 9 - i);
- b.remove_front();
- }
- assert(b.length() == 10);
- cout << "b: "; printDlist(b);
-
- cout << "inserting 100 after sixth element...\n";
- Pix bp = b.first();
- for (i = 0; i < 5; ++i) b.next(bp);
- b.ins_after(bp, 100);
- assert(b.length() == 11);
- cout << "b: "; printDlist(b);
- intDLList aa = a;
- aa.join(b);
- cout << "after aa = a; aa.join(b)\n"; printDlist(aa);
- assert(aa.length() == 31);
- assert(b.empty());
- cout << "b: " << "\n"; printDlist(b);
- b.prepend(999);
- cout << "b: " << "\n"; printDlist(b);
- assert(b.length() == 1);
- assert(b.front() == 999);
- assert(b.rear() == 999);
- assert(b.OK());
- intDLList bb = b;
- cout << "bb: " << "\n"; printDlist(bb);
- assert(bb.OK());
- assert(bb.length() == 1);
- assert(bb.front() == 999);
- assert(bb.rear() == 999);
- assert(bb.remove_front() == 999);
- assert(bb.OK());
- b.prepend(1234);
- assert(b.length() == 2);
- bp = b.first();
- b.next(bp);
- b.del(bp, -1);
- assert(b.rear() == 1234);
- assert(b.length() == 1);
- b.del(bp);
- assert(b.length() == 0);
-
- intDLList z = a;
- cout << "z = a: "; printDlist(z);
- assert(z.OK());
- assert(z.length() == 20);
- cout << "remove_rear of last 10 elements:\n";
- for (i = 0; i < 10; ++i)
- {
- assert(z.length() == 20 - i);
- assert(z.rear() == 9 - i);
- z.remove_rear();
- }
- assert(z.length() == 10);
-
- cout << "z: "; printDlist(z);
-
- cout << "inserting 100 before alternate elements...\n";
- Pix zp;
- for (zp = z.first(); zp; z.next(zp))
- {
- z.ins_before(zp, 100);
- }
- assert(z.length() == 20);
- cout << "z: "; printDlist(z);
-
- cout << "inserting 200 after sixth element...\n";
- zp = z.first();
- for (i = 0; i < 5; ++i) z.next(zp);
- z.ins_after(zp, 200);
- assert(z.length() == 21);
- cout << "z: "; printDlist(z);
-
- cout << "deleting alternate elements of z...";
- for (zp = z.first(); zp; z.next(zp))
- {
- cout << z(zp) << " ";
- z.del(zp);
- }
- cout << "\n";
- assert(z.length() == 10);
- cout << "z: "; printDlist(z);
-
- cout << "z in reverse order:\n";
- for (zp = z.last(); zp; z.prev(zp)) cout << z(zp) << " ";
- cout << "\n";
- z.clear();
- assert(z.OK());
- assert(z.empty());
- assert(a.OK());
- assert(b.OK());
-}
-
-main()
-{
- SLtest();
- DLtest();
- cout << "\nEnd of test\n";
-}
diff --git a/contrib/libg++/libg++/tests/tLList.exp b/contrib/libg++/libg++/tests/tLList.exp
deleted file mode 100644
index 727f9b538c75..000000000000
--- a/contrib/libg++/libg++/tests/tLList.exp
+++ /dev/null
@@ -1,49 +0,0 @@
-prepending...
-a: 9 8 7 6 5 4 3 2 1 0
-appending...
-a: 9 8 7 6 5 4 3 2 1 0 0 1 2 3 4 5 6 7 8 9
-b = a:
-9 8 7 6 5 4 3 2 1 0 0 1 2 3 4 5 6 7 8 9
-remove_front of first 10 elements:
-b: 0 1 2 3 4 5 6 7 8 9
-inserting 100 after sixth element...
-b: 0 1 2 3 4 5 100 6 7 8 9
-after a.join(b)
-9 8 7 6 5 4 3 2 1 0 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 100 6 7 8 9
-b:
-
-b:
-999
-bb:
-999
-prepending...
-a:
-9 8 7 6 5 4 3 2 1 0
-appending...
-a: 9 8 7 6 5 4 3 2 1 0 0 1 2 3 4 5 6 7 8 9
-b = a: 9 8 7 6 5 4 3 2 1 0 0 1 2 3 4 5 6 7 8 9
-remove_front of first 10 elements:
-b: 0 1 2 3 4 5 6 7 8 9
-inserting 100 after sixth element...
-b: 0 1 2 3 4 5 100 6 7 8 9
-after aa = a; aa.join(b)
-9 8 7 6 5 4 3 2 1 0 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 100 6 7 8 9
-b:
-
-b:
-999
-bb:
-999
-z = a: 9 8 7 6 5 4 3 2 1 0 0 1 2 3 4 5 6 7 8 9
-remove_rear of last 10 elements:
-z: 9 8 7 6 5 4 3 2 1 0
-inserting 100 before alternate elements...
-z: 100 9 100 8 100 7 100 6 100 5 100 4 100 3 100 2 100 1 100 0
-inserting 200 after sixth element...
-z: 100 9 100 8 100 7 200 100 6 100 5 100 4 100 3 100 2 100 1 100 0
-deleting alternate elements of z...100 100 100 200 6 5 4 3 2 1 0
-z: 9 8 7 100 100 100 100 100 100 100
-z in reverse order:
-100 100 100 100 100 100 100 7 8 9
-
-End of test
diff --git a/contrib/libg++/libg++/tests/tLList.inp b/contrib/libg++/libg++/tests/tLList.inp
deleted file mode 100644
index e69de29bb2d1..000000000000
--- a/contrib/libg++/libg++/tests/tLList.inp
+++ /dev/null
diff --git a/contrib/libg++/libg++/tests/tList.cc b/contrib/libg++/libg++/tests/tList.cc
deleted file mode 100644
index b508b5526d90..000000000000
--- a/contrib/libg++/libg++/tests/tList.cc
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- test/demo of generic lists
-*/
-
-#include <assert.h>
-
-#define tassert(ex) {if ((ex)) cerr << #ex << "\n"; \
- else _assert(#ex, __FILE__,__LINE__); }
-
-#include <iostream.h>
-#include "iList.h"
-
-int int_compare(int a, int b)
-{
- return a - b;
-}
-
-int inc(int x)
-{
- return x + 1;
-}
-
-int plus(int x, int y)
-{
- return x + y;
-}
-
-void printint(int x)
-{
- cout << x << " ";
-}
-
-void print(intList& l)
-{
- l.apply(printint);
- cout << "\n";
-}
-
-int is_odd(int x)
-{
- return x & 1;
-}
-
-int is_even(int x)
-{
- return (x & 1) == 0;
-}
-
-intList sequence(int lo, int hi)
-{
- if (lo > hi)
- return intList();
- else
- return intList(lo, sequence(lo+1, hi));
-}
-
-int old_rand = 9999;
-
-int get_rand()
-{
- old_rand = ((long)old_rand * (long)1243) % (long)971;
- return old_rand;
-}
-
-intList randseq(int n)
-{
- if (n <= 0)
- return intList();
- int value = get_rand() % 50;
- return intList(value, randseq(--n));
-}
-
-main()
-{
- intList a = sequence(1, 20);
- cout << "\nintList a = sequence(1, 20);\n"; print(a);
- assert(a.OK());
- for (int i = 0; i < 20; ++i) assert(a[i] == i + 1);
- assert(a.position(2) == 1);
- intList b = randseq(20);
- cout << "\nintList b = randseq(20);\n"; print(b);
- intList c = concat(a, b);
- cout << "\nintList c = concat(a, b);\n"; print(c);
- assert(c.contains(a));
- assert(c.contains(b));
- assert(!(c.find(a).null()));
- assert(c.find(b) == b);
- intList d = map(inc, a);
- for (int i = 0; i < 20; ++i) assert(d[i] == a[i] + 1);
- cout << "\nintList d = map(inc, a);\n"; print(d);
- intList e = reverse(a);
- cout << "\nintList e = reverse(a);\n"; print(e);
- for (int i = 0; i < 20; ++i) assert(e[i] == a[19 - i]);
- intList f = select(is_odd, a);
- cout << "\nintList f = select(is_odd, a);\n"; print(f);
- intList ff = select(is_even, f);
- assert(ff.null());
- int red = a.reduce(plus, 0);
- cout << "\nint red = a.reduce(plus, 0);\n"; cout << red;
- int second = a[2];
- cout << "\nint second = a[2];\n"; cout << second;
- intList g = combine(plus, a, b);
- cout << "\nintList g = combine(plus, a, b);\n"; print(g);
- for (int i = 0; i < 20; ++i) assert(g[i] == a[i] + b[i]);
- g.del((intPredicate)is_odd);
- cout << "\ng.del(is_odd);\n"; print(g);
- ff = select(is_odd, g);
- assert(ff.null());
- b.sort(int_compare);
- for (int i = 1; i < 20; ++i) assert(b[i] >= b[i-1]);
- cout << "\nb.sort(int_compare);\n"; print(b);
- intList h = merge(a, b, int_compare);
- cout << "\nintList h = merge(a, b, int_compare);\n"; print(h);
- for (int i = 1; i < 40; ++i) assert(h[i] >= h[i-1]);
- for (Pix p = a.first(); p; a.next(p)) assert(h.contains(a(p)));
- for (Pix p = b.first(); p; b.next(p)) assert(h.contains(b(p)));
- cout << "\nh via Pix:\n";
- for (Pix p = h.first(); p; h.next(p)) cout << h(p) << ", ";
- cout << "\n";
- assert(a.OK());
- assert(b.OK());
- assert(c.OK());
- assert(d.OK());
- assert(e.OK());
- assert(f.OK());
- assert(g.OK());
- assert(h.OK());
- cout << "\ndone\n";
-}
diff --git a/contrib/libg++/libg++/tests/tList.exp b/contrib/libg++/libg++/tests/tList.exp
deleted file mode 100644
index 989137f1b92e..000000000000
--- a/contrib/libg++/libg++/tests/tList.exp
+++ /dev/null
@@ -1,39 +0,0 @@
-
-intList a = sequence(1, 20);
-1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
-
-intList b = randseq(20);
-28 27 5 17 44 6 9 40 15 26 49 35 15 48 13 27 25 25 9 6
-
-intList c = concat(a, b);
-1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 28 27 5 17 44 6 9 40 15 26 49 35 15 48 13 27 25 25 9 6
-
-intList d = map(inc, a);
-2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
-
-intList e = reverse(a);
-20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1
-
-intList f = select(is_odd, a);
-1 3 5 7 9 11 13 15 17 19
-
-int red = a.reduce(plus, 0);
-210
-int second = a[2];
-3
-intList g = combine(plus, a, b);
-29 29 8 21 49 12 16 48 24 36 60 47 28 62 28 43 42 43 28 26
-
-g.del(is_odd);
-8 12 16 48 24 36 60 28 62 28 42 28 26
-
-b.sort(int_compare);
-5 6 6 9 9 13 15 15 17 25 25 26 27 27 28 35 40 44 48 49
-
-intList h = merge(a, b, int_compare);
-1 2 3 4 5 5 6 6 6 7 8 9 9 9 10 11 12 13 13 14 15 15 15 16 17 17 18 19 20 25 25 26 27 27 28 35 40 44 48 49
-
-h via Pix:
-1, 2, 3, 4, 5, 5, 6, 6, 6, 7, 8, 9, 9, 9, 10, 11, 12, 13, 13, 14, 15, 15, 15, 16, 17, 17, 18, 19, 20, 25, 25, 26, 27, 27, 28, 35, 40, 44, 48, 49,
-
-done
diff --git a/contrib/libg++/libg++/tests/tList.inp b/contrib/libg++/libg++/tests/tList.inp
deleted file mode 100644
index e69de29bb2d1..000000000000
--- a/contrib/libg++/libg++/tests/tList.inp
+++ /dev/null
diff --git a/contrib/libg++/libg++/tests/tMap.cc b/contrib/libg++/libg++/tests/tMap.cc
deleted file mode 100644
index ad03d4a1b1d4..000000000000
--- a/contrib/libg++/libg++/tests/tMap.cc
+++ /dev/null
@@ -1,339 +0,0 @@
-/*
- a test file for Maps
-*/
-
-#ifdef PTIMES
-const int ptimes = 1;
-#else
-const int ptimes = 0;
-#endif
-
-#include <stream.h>
-#include <assert.h>
-#include <builtin.h>
-
-
-#define tassert(ex) { cerr << #ex; \
- if ((ex)) cerr << " OK\n"; \
- else cerr << " Fail\n"; }
-
-#include "iMap.h"
-
-unsigned int hash(int x) { return multiplicativehash(x) ; }
-
-int SIZE;
-
-int *nums;
-int *odds;
-int *perm;
-
-void add(int x[], int y[], intintMap& a)
-{
- for (int i = 0; i < SIZE; ++i) a[x[i]] = y[i];
-}
-
-#include <MLCG.h>
-
-MLCG randgen;
-
-void permute(int x[])
-{
- for (int i = 1; i < SIZE; ++i)
- {
- int j = randgen.asLong() % (i + 1);
- int tmp = x[i]; x[i] = x[j]; x[j] = tmp;
- }
-}
-
-void makenums()
-{
- for (int i = 0; i < SIZE; ++i) nums[i] = i + 1;
-}
-
-void makeodds()
-{
- for (int i = 0; i < SIZE; ++i) odds[i] = 2 * i + 1;
- permute(odds);
-}
-
-void makeperm()
-{
- for (int i = 0; i < SIZE; ++i) perm[i] = i + 1;
- permute(perm);
-}
-
-void printMap(intintMap& a)
-{
- int maxprint = 20;
- cout << "[";
- int k = 0;
- Pix i;
- for (i = a.first(); i != 0 && k < maxprint; a.next(i),++k)
- cout << "(" << a.key(i) << ", " << a.contents(i) << ") ";
- if (i != 0) cout << "...]\n";
- else cout << "]\n";
-}
-
-#include "iSplayMap.h"
-
-void Splaytest()
-{
- intintSplayMap a(-1);
- add(nums, perm, a);
- intintSplayMap b(-1);
- add(perm, nums, b);
- intintSplayMap c(-1);
- add(perm, odds, c);
- intintSplayMap d(a);
- add(nums, nums, d);
- cout << "a: "; printMap(a);
- cout << "b: "; printMap(b);
- cout << "c: "; printMap(c);
- cout << "d: "; printMap(d);
- assert(a.length() == SIZE);
- assert(b.length() == SIZE);
- assert(c.length() == SIZE);
- assert(d.length() == SIZE);
- int j;
- for (j = 1; j <= SIZE; ++j) assert(a.contains(j));
- assert(a[SIZE+1] = -1);
-
- for (j = 1; j <= SIZE; ++j) assert(b.contains(j));
-
- for (j = 1; j <= SIZE; ++j) assert(b[a[j]] == j);
- for (j = 1; j <= SIZE; ++j) assert(a[b[j]] == j);
-
- for (j = 1; j <= SIZE; ++j) assert((c[j] & 1) != 0);
-
- for (j = 1; j <= SIZE; ++j) assert(d[j] == j);
-
- d.del(1);
- assert(!d.contains(1));
- for (j = 1; j <= SIZE; ++j) d.del(j);
- assert(d.empty());
-
- assert(a.OK());
- assert(b.OK());
- assert(c.OK());
- assert(d.OK());
-
-}
-
-#include "iVHMap.h"
-
-void VHtest()
-{
- intintVHMap a(-1, SIZE);
- add(nums, perm, a);
- intintVHMap b(-1, SIZE);
- add(perm, nums, b);
- intintVHMap c(-1, SIZE);
- add(perm, odds, c);
- intintVHMap d(a);
- add(nums, nums, d);
- cout << "a: "; printMap(a);
- cout << "b: "; printMap(b);
- cout << "c: "; printMap(c);
- cout << "d: "; printMap(d);
- assert(a.length() == SIZE);
- assert(b.length() == SIZE);
- assert(c.length() == SIZE);
- assert(d.length() == SIZE);
- int j;
- for (j = 1; j <= SIZE; ++j) assert(a.contains(j));
- assert(a[SIZE+1] = -1);
-
- for (j = 1; j <= SIZE; ++j) assert(b.contains(j));
-
- for (j = 1; j <= SIZE; ++j) assert(b[a[j]] == j);
- for (j = 1; j <= SIZE; ++j) assert(a[b[j]] == j);
-
- for (j = 1; j <= SIZE; ++j) assert((c[j] & 1) != 0);
-
- for (j = 1; j <= SIZE; ++j) assert(d[j] == j);
-
- d.del(1);
- assert(!d.contains(1));
- for (j = 1; j <= SIZE; ++j) d.del(j);
- assert(d.empty());
-
- assert(a.OK());
- assert(b.OK());
- assert(c.OK());
- assert(d.OK());
-
-}
-
-#include "iCHMap.h"
-
-void CHtest()
-{
- intintCHMap a(-1, SIZE);
- add(nums, perm, a);
- intintCHMap b(-1, SIZE);
- add(perm, nums, b);
- intintCHMap c(-1, SIZE);
- add(perm, odds, c);
- intintCHMap d(a);
- add(nums, nums, d);
- cout << "a: "; printMap(a);
- cout << "b: "; printMap(b);
- cout << "c: "; printMap(c);
- cout << "d: "; printMap(d);
- assert(a.length() == SIZE);
- assert(b.length() == SIZE);
- assert(c.length() == SIZE);
- assert(d.length() == SIZE);
- int j;
- for (j = 1; j <= SIZE; ++j) assert(a.contains(j));
- assert(a[SIZE+1] = -1);
-
- for (j = 1; j <= SIZE; ++j) assert(b.contains(j));
-
- for (j = 1; j <= SIZE; ++j) assert(b[a[j]] == j);
- for (j = 1; j <= SIZE; ++j) assert(a[b[j]] == j);
-
- for (j = 1; j <= SIZE; ++j) assert((c[j] & 1) != 0);
-
- for (j = 1; j <= SIZE; ++j) assert(d[j] == j);
-
- d.del(1);
- assert(!d.contains(1));
- for (j = 1; j <= SIZE; ++j) d.del(j);
- assert(d.empty());
-
- assert(a.OK());
- assert(b.OK());
- assert(c.OK());
- assert(d.OK());
-
-}
-
-#include "iAVLMap.h"
-
-void AVLtest()
-{
- intintAVLMap a(-1);
- add(nums, perm, a);
- intintAVLMap b(-1);
- add(perm, nums, b);
- intintAVLMap c(-1);
- add(perm, odds, c);
- intintAVLMap d(a);
- add(nums, nums, d);
- cout << "a: "; printMap(a);
- cout << "b: "; printMap(b);
- cout << "c: "; printMap(c);
- cout << "d: "; printMap(d);
- assert(a.length() == SIZE);
- assert(b.length() == SIZE);
- assert(c.length() == SIZE);
- assert(d.length() == SIZE);
- int j;
- for (j = 1; j <= SIZE; ++j) assert(a.contains(j));
- assert(a[SIZE+1] = -1);
-
- for (j = 1; j <= SIZE; ++j) assert(b.contains(j));
-
- for (j = 1; j <= SIZE; ++j) assert(b[a[j]] == j);
- for (j = 1; j <= SIZE; ++j) assert(a[b[j]] == j);
-
- for (j = 1; j <= SIZE; ++j) assert((c[j] & 1) != 0);
-
- for (j = 1; j <= SIZE; ++j) assert(d[j] == j);
-
- d.del(1);
- assert(!d.contains(1));
- for (j = 1; j <= SIZE; ++j) d.del(j);
- assert(d.empty());
-
- assert(a.OK());
- assert(b.OK());
- assert(c.OK());
- assert(d.OK());
-
-}
-
-#include "iRAVLMap.h"
-
-void RAVLtest()
-{
- intintRAVLMap a(-1);
- add(nums, perm, a);
- intintRAVLMap b(-1);
- add(perm, nums, b);
- intintRAVLMap c(-1);
- add(perm, odds, c);
- intintRAVLMap d(a);
- add(nums, nums, d);
- cout << "a: "; printMap(a);
- cout << "b: "; printMap(b);
- cout << "c: "; printMap(c);
- cout << "d: "; printMap(d);
- assert(a.length() == SIZE);
- assert(b.length() == SIZE);
- assert(c.length() == SIZE);
- assert(d.length() == SIZE);
- int j;
- for (j = 1; j <= SIZE; ++j) assert(a.contains(j));
- for (j = 1; j <= a.length(); ++j) assert(a.rankof(j) == j);
- for (j = 1; j <= a.length(); ++j) assert(a.key(a.ranktoPix(j)) == j);
- assert(a[SIZE+1] = -1);
-
- for (j = 1; j <= SIZE; ++j) assert(b.contains(j));
-
- for (j = 1; j <= SIZE; ++j) assert(b[a[j]] == j);
- for (j = 1; j <= SIZE; ++j) assert(a[b[j]] == j);
-
- for (j = 1; j <= SIZE; ++j) assert((c[j] & 1) != 0);
-
- for (j = 1; j <= SIZE; ++j) assert(d[j] == j);
-
- d.del(1);
- assert(!d.contains(1));
- for (j = 1; j <= SIZE; ++j) d.del(j);
- assert(d.empty());
-
- assert(a.OK());
- assert(b.OK());
- assert(c.OK());
- assert(d.OK());
-
-}
-
-double return_elapsed_time ( double );
-double start_timer ( );
-
-int main(int argv, char** argc)
-{
- if (argv > 1)
- {
- SIZE = abs(atoi(argc[1]));
- SIZE &= ~1;
- }
- else
- SIZE = 100;
- nums = new int[SIZE];
- odds = new int[SIZE];
- perm = new int[SIZE];
- makenums();
- makeodds();
- makeperm();
- start_timer();
- cout << "Splaytest\n"; Splaytest();
- if (ptimes) cout << "\ntime = " << return_elapsed_time(0.0) << "\n";
- start_timer();
- cout << "VHtest\n"; VHtest();
- if (ptimes) cout << "\ntime = " << return_elapsed_time(0.0) << "\n";
- start_timer();
- cout << "CHtest\n"; CHtest();
- if (ptimes) cout << "\ntime = " << return_elapsed_time(0.0) << "\n";
- start_timer();
- cout << "AVLtest\n"; AVLtest();
- if (ptimes) cout << "\ntime = " << return_elapsed_time(0.0) << "\n";
- start_timer();
- cout << "RAVLtest\n"; RAVLtest();
- if (ptimes) cout << "\ntime = " << return_elapsed_time(0.0) << "\n";
-
- return 0;
-}
diff --git a/contrib/libg++/libg++/tests/tMap.exp b/contrib/libg++/libg++/tests/tMap.exp
deleted file mode 100644
index 2d745ee0fa3e..000000000000
--- a/contrib/libg++/libg++/tests/tMap.exp
+++ /dev/null
@@ -1,25 +0,0 @@
-Splaytest
-a: [(1, 65) (2, 3) (3, 96) (4, 36) (5, 74) (6, 9) (7, 70) (8, 97) (9, 1) (10, 24) (11, 100) (12, 17) (13, 61) (14, 52) (15, 19) (16, 84) (17, 73) (18, 34) (19, 26) (20, 22) ...]
-b: [(1, 9) (2, 31) (3, 2) (4, 32) (5, 62) (6, 30) (7, 87) (8, 98) (9, 6) (10, 49) (11, 44) (12, 47) (13, 50) (14, 76) (15, 56) (16, 57) (17, 12) (18, 54) (19, 15) (20, 83) ...]
-c: [(1, 189) (2, 195) (3, 197) (4, 57) (5, 125) (6, 135) (7, 149) (8, 129) (9, 69) (10, 9) (11, 163) (12, 59) (13, 171) (14, 137) (15, 141) (16, 35) (17, 75) (18, 49) (19, 173) (20, 93) ...]
-d: [(1, 1) (2, 2) (3, 3) (4, 4) (5, 5) (6, 6) (7, 7) (8, 8) (9, 9) (10, 10) (11, 11) (12, 12) (13, 13) (14, 14) (15, 15) (16, 16) (17, 17) (18, 18) (19, 19) (20, 20) ...]
-VHtest
-a: [(72, 66) (77, 99) (13, 61) (3, 96) (26, 63) (16, 84) (39, 54) (29, 50) (52, 32) (42, 94) (65, 47) (55, 45) (78, 91) (91, 55) (9, 1) (22, 57) (35, 90) (48, 67) (61, 71) (74, 89) ...]
-b: [(72, 41) (77, 43) (85, 38) (3, 2) (26, 19) (16, 57) (39, 23) (29, 53) (52, 14) (42, 21) (65, 1) (55, 91) (78, 95) (91, 78) (9, 6) (22, 20) (35, 27) (48, 33) (61, 13) (13, 50) ...]
-c: [(72, 53) (77, 133) (85, 45) (3, 197) (26, 101) (16, 35) (39, 77) (29, 83) (52, 117) (42, 121) (65, 3) (55, 89) (78, 97) (91, 31) (9, 69) (22, 105) (35, 63) (48, 167) (61, 181) (13, 171) ...]
-d: [(72, 72) (13, 13) (3, 3) (26, 26) (16, 16) (39, 39) (29, 29) (52, 52) (42, 42) (65, 65) (55, 55) (78, 78) (91, 91) (12, 12) (9, 9) (22, 22) (35, 35) (48, 48) (61, 61) (74, 74) ...]
-CHtest
-a: [(72, 66) (36, 25) (85, 92) (49, 10) (13, 61) (3, 96) (98, 8) (62, 5) (26, 63) (16, 84) (75, 51) (39, 54) (29, 50) (88, 81) (52, 32) (42, 94) (6, 9) (65, 47) (55, 45) (19, 26) ...]
-b: [(72, 41) (36, 4) (49, 64) (13, 50) (85, 38) (3, 2) (62, 90) (98, 82) (26, 19) (16, 57) (75, 80) (39, 23) (29, 53) (88, 100) (52, 14) (6, 30) (42, 21) (65, 1) (55, 91) (19, 15) ...]
-c: [(72, 53) (36, 161) (49, 67) (13, 171) (85, 45) (3, 197) (62, 177) (98, 95) (26, 101) (16, 35) (75, 25) (39, 77) (29, 83) (88, 47) (52, 117) (6, 135) (42, 121) (65, 3) (55, 89) (19, 173) ...]
-d: [(36, 36) (72, 72) (13, 13) (49, 49) (85, 85) (3, 3) (26, 26) (62, 62) (98, 98) (16, 16) (39, 39) (75, 75) (29, 29) (52, 52) (88, 88) (6, 6) (42, 42) (65, 65) (19, 19) (55, 55) ...]
-AVLtest
-a: [(1, 65) (2, 3) (3, 96) (4, 36) (5, 74) (6, 9) (7, 70) (8, 97) (9, 1) (10, 24) (11, 100) (12, 17) (13, 61) (14, 52) (15, 19) (16, 84) (17, 73) (18, 34) (19, 26) (20, 22) ...]
-b: [(1, 9) (2, 31) (3, 2) (4, 32) (5, 62) (6, 30) (7, 87) (8, 98) (9, 6) (10, 49) (11, 44) (12, 47) (13, 50) (14, 76) (15, 56) (16, 57) (17, 12) (18, 54) (19, 15) (20, 83) ...]
-c: [(1, 189) (2, 195) (3, 197) (4, 57) (5, 125) (6, 135) (7, 149) (8, 129) (9, 69) (10, 9) (11, 163) (12, 59) (13, 171) (14, 137) (15, 141) (16, 35) (17, 75) (18, 49) (19, 173) (20, 93) ...]
-d: [(1, 1) (2, 2) (3, 3) (4, 4) (5, 5) (6, 6) (7, 7) (8, 8) (9, 9) (10, 10) (11, 11) (12, 12) (13, 13) (14, 14) (15, 15) (16, 16) (17, 17) (18, 18) (19, 19) (20, 20) ...]
-RAVLtest
-a: [(1, 65) (2, 3) (3, 96) (4, 36) (5, 74) (6, 9) (7, 70) (8, 97) (9, 1) (10, 24) (11, 100) (12, 17) (13, 61) (14, 52) (15, 19) (16, 84) (17, 73) (18, 34) (19, 26) (20, 22) ...]
-b: [(1, 9) (2, 31) (3, 2) (4, 32) (5, 62) (6, 30) (7, 87) (8, 98) (9, 6) (10, 49) (11, 44) (12, 47) (13, 50) (14, 76) (15, 56) (16, 57) (17, 12) (18, 54) (19, 15) (20, 83) ...]
-c: [(1, 189) (2, 195) (3, 197) (4, 57) (5, 125) (6, 135) (7, 149) (8, 129) (9, 69) (10, 9) (11, 163) (12, 59) (13, 171) (14, 137) (15, 141) (16, 35) (17, 75) (18, 49) (19, 173) (20, 93) ...]
-d: [(1, 1) (2, 2) (3, 3) (4, 4) (5, 5) (6, 6) (7, 7) (8, 8) (9, 9) (10, 10) (11, 11) (12, 12) (13, 13) (14, 14) (15, 15) (16, 16) (17, 17) (18, 18) (19, 19) (20, 20) ...]
diff --git a/contrib/libg++/libg++/tests/tMap.inp b/contrib/libg++/libg++/tests/tMap.inp
deleted file mode 100644
index e69de29bb2d1..000000000000
--- a/contrib/libg++/libg++/tests/tMap.inp
+++ /dev/null
diff --git a/contrib/libg++/libg++/tests/tObstack.cc b/contrib/libg++/libg++/tests/tObstack.cc
deleted file mode 100644
index f1914021404d..000000000000
--- a/contrib/libg++/libg++/tests/tObstack.cc
+++ /dev/null
@@ -1,80 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-
-/*
- a little test of Obstacks
- Thu Feb 18 11:16:28 1988 Doug Lea (dl at rocky.oswego.edu)
-*/
-
-#include <assert.h>
-
-#define tassert(ex) {if ((ex)) cerr << #ex << "\n"; \
- else _assert(#ex, __FILE__,__LINE__); }
-
-#include <stream.h>
-#include <Obstack.h>
-#include <stddef.h>
-#include <ctype.h>
-
-int
-main()
-{
- char* s[10000];
- int n = 0;
- int got_one = 0;
- Obstack os;
- char c;
-
- s[n++] = (char *)os.copy("\nunique words:");
- assert(os.OK());
- assert(os.contains(s[0]));
-
- cout << "enter anything at all, end with an EOF(^D)\n";
-
- while (cin.good() && n < 10000)
- {
- if (cin.get(c) && isalnum(c))
- {
- got_one = 1;
- os.grow(c);
- }
- else if (got_one)
- {
- char* current = (char *)os.finish(0);
- for (int i = 0; i < n; ++i) // stupid, but this is only a test.
- {
- if (strcmp(s[i], current) == 0)
- {
- os.free(current);
- current = 0;
- break;
- }
- }
- if (current != 0)
- s[n++] = current;
- got_one = 0;
- }
- }
- assert(os.OK());
-
- cout << s[0] << "\n";
-
- for (int i = n - 1; i > 0; -- i)
- {
- assert(os.contains(s[i]));
- cout << s[i] << "\n";
- os.free(s[i]);
- }
-
- assert(os.OK());
- assert(os.contains(s[0]));
-
- cout << "\n\nObstack vars:\n";
- cout << "alignment_mask = " << os.alignment_mask() << "\n";
- cout << "chunk_size = " << os.chunk_size() << "\n";
- cout << "size = " << os.size() << "\n";
- cout << "room + chunk overhead = " << os.room() + 2*sizeof (char*) << "\n";
-
- cout << "\nend of test\n";
-
- return 0;
-}
diff --git a/contrib/libg++/libg++/tests/tObstack.exp b/contrib/libg++/libg++/tests/tObstack.exp
deleted file mode 100644
index 32114e82b74f..000000000000
--- a/contrib/libg++/libg++/tests/tObstack.exp
+++ /dev/null
@@ -1,32 +0,0 @@
-enter anything at all, end with an EOF(^D)
-
-unique words:
-deleted
-redundant
-with
-this
-in
-words
-the
-list
-simply
-should
-program
-The
-Obstacks
-for
-file
-test
-simple
-a
-is
-This
-
-
-Obstack vars:
-alignment_mask = 3
-chunk_size = 4080
-size = 0
-room + chunk overhead = 4064
-
-end of test
diff --git a/contrib/libg++/libg++/tests/tObstack.inp b/contrib/libg++/libg++/tests/tObstack.inp
deleted file mode 100644
index 32dea332140c..000000000000
--- a/contrib/libg++/libg++/tests/tObstack.inp
+++ /dev/null
@@ -1,5 +0,0 @@
-This is a simple test file for Obstacks The test program should
-simply list the words in this file with redundant words deleted
-This is a simple test file for Obstacks The test program should
-simply list the words in this file with redundant words deleted
-
diff --git a/contrib/libg++/libg++/tests/tPQ.cc b/contrib/libg++/libg++/tests/tPQ.cc
deleted file mode 100644
index 4cd144136ea4..000000000000
--- a/contrib/libg++/libg++/tests/tPQ.cc
+++ /dev/null
@@ -1,275 +0,0 @@
-/*
- a test file for PQs
-*/
-
-#ifdef PTIMES
-const int ptimes = 1;
-#else
-const int ptimes = 0;
-#endif
-
-#include <stream.h>
-#include <assert.h>
-#include <builtin.h>
-
-#define tassert(ex) { cerr << #ex; \
- if ((ex)) cerr << " OK\n"; \
- else cerr << " Fail\n"; }
-
-#include "iPQ.h"
-
-
-int SIZE;
-
-int *nums;
-int *odds;
-int *dups;
-
-void add(int x[], intPQ& a)
-{
- for (int i = 0; i < SIZE; ++i) a.enq(x[i]);
-}
-
-#include <MLCG.h>
-
-MLCG randgen;
-
-void permute(int x[])
-{
- for (int i = 1; i < SIZE; ++i)
- {
- int j = randgen.asLong() % (i + 1);
- int tmp = x[i]; x[i] = x[j]; x[j] = tmp;
- }
-}
-
-void makenums()
-{
- for (int i = 0; i < SIZE; ++i) nums[i] = i + 1;
- permute(nums);
-}
-
-void makeodds()
-{
- for (int i = 0; i < SIZE; ++i) odds[i] = 2 * i + 1;
- permute(odds);
-}
-
-void makedups()
-{
- for (int i = 0; i < SIZE; i += 2) dups[i] = dups[i+1] = i/2 + 1;
- permute(dups);
-}
-
-void printPQ(intPQ& a)
-{
- int maxprint = 20;
- cout << "[";
- int k = 0;
- Pix i;
- for (i = a.first(); i != 0 && k < maxprint; a.next(i),++k)
- cout << a(i) << " ";
- if (i != 0) cout << "...]\n";
- else cout << "]\n";
-}
-
-#include "iXPPQ.h"
-
-void XPtest()
-{
- intXPPQ a(SIZE);
- add(nums, a);
- intXPPQ b(SIZE);
- add(odds, b);
- intXPPQ c(SIZE);
- add(dups, c);
- intXPPQ d(a);
- add(nums, d);
- cout << "a: "; printPQ(a);
- cout << "b: "; printPQ(b);
- cout << "c: "; printPQ(c);
- cout << "d: "; printPQ(d);
- assert(a.length() == SIZE);
- assert(b.length() == SIZE);
- assert(c.length() == SIZE);
- assert(d.length() == SIZE*2);
- assert(a.front() == 1);
- assert(b.front() == 1);
- assert(c.front() == 1);
- assert(d.front() == 1);
- int j;
- for (j = 1; j <= SIZE; ++j) assert(a.contains(j));
- d.del_front();
- assert(d.front() == 1);
- for (j = 1; j <= SIZE; ++j) assert(a.deq() == j);
- assert(a.empty());
- for (j = 1; j <= SIZE*2; j+=2) assert(b.deq() == j);
- assert(b.empty());
- Pix* indices = new Pix [SIZE];
- int m = 0;
- for (Pix i = c.first(); i != 0; c.next(i), c.next(i)) indices[m++] = i;
- assert(m == SIZE/2);
- while (--m >= 0) c.del(indices[m]);
- assert(c.length() == SIZE/2);
- int last = -1;
- j = 0;
- while (!c.empty())
- {
- int current = c.deq();
- assert(last <= current);
- last = current;
- ++j;
- }
- assert(j == SIZE/2);
-
- delete [] indices;
- d.clear();
- assert(d.empty());
- assert(a.OK());
- assert(b.OK());
- assert(c.OK());
- assert(d.OK());
-}
-
-#include "iPHPQ.h"
-
-void PHtest()
-{
- intPHPQ a(SIZE);
- add(nums, a);
- intPHPQ b(SIZE);
- add(odds, b);
- intPHPQ c(SIZE);
- add(dups, c);
- intPHPQ d(a);
- add(nums, d);
- cout << "a: "; printPQ(a);
- cout << "b: "; printPQ(b);
- cout << "c: "; printPQ(c);
- cout << "d: "; printPQ(d);
- assert(a.length() == SIZE);
- assert(b.length() == SIZE);
- assert(c.length() == SIZE);
- assert(d.length() == SIZE*2);
- assert(a.front() == 1);
- assert(b.front() == 1);
- assert(c.front() == 1);
- assert(d.front() == 1);
- int j;
- for (j = 1; j <= SIZE; ++j) assert(a.contains(j));
- d.del_front();
- assert(d.front() == 1);
- for (j = 1; j <= SIZE; ++j) assert(a.deq() == j);
- assert(a.empty());
- for (j = 1; j <= SIZE*2; j+=2) assert(b.deq() == j);
- assert(b.empty());
- Pix* indices = new Pix [SIZE];
- int m = 0;
- for (Pix i = c.first(); i != 0; c.next(i), c.next(i)) indices[m++] = i;
- assert(m == SIZE/2);
- while (--m >= 0) c.del(indices[m]);
- assert(c.length() == SIZE/2);
- int last = -1;
- j = 0;
- while (!c.empty())
- {
- int current = c.deq();
- assert(last <= current);
- last = current;
- ++j;
- }
- assert(j == SIZE/2);
- delete [] indices;
- d.clear();
- assert(d.empty());
- assert(a.OK());
- assert(b.OK());
- assert(c.OK());
- assert(d.OK());
-}
-
-#include "iSplayPQ.h"
-
-void Splaytest()
-{
- intSplayPQ a;
- add(nums, a);
- intSplayPQ b;
- add(odds, b);
- intSplayPQ c;
- add(dups, c);
- intSplayPQ d(a);
- add(nums, d);
- cout << "a: "; printPQ(a);
- cout << "b: "; printPQ(b);
- cout << "c: "; printPQ(c);
- cout << "d: "; printPQ(d);
- assert(a.length() == SIZE);
- assert(b.length() == SIZE);
- assert(c.length() == SIZE);
- assert(d.length() == SIZE*2);
- assert(a.front() == 1);
- assert(b.front() == 1);
- assert(c.front() == 1);
- assert(d.front() == 1);
- int j;
- for (j = 1; j <= SIZE; ++j) assert(a.contains(j));
- d.del_front();
- assert(d.front() == 1);
- for (j = 1; j <= SIZE; ++j) assert(a.deq() == j);
- assert(a.empty());
- for (j = 1; j <= SIZE*2; j+=2) assert(b.deq() == j);
- assert(b.empty());
- Pix* indices = new Pix[SIZE];
- int m = 0;
- for (Pix i = c.first(); i != 0; c.next(i), c.next(i)) indices[m++] = i;
- assert(m == SIZE/2);
- while (--m >= 0) c.del(indices[m]);
- assert(c.length() == SIZE/2);
- int last = -1;
- j = 0;
- while (!c.empty())
- {
- int current = c.deq();
- assert(last <= current);
- last = current;
- ++j;
- }
- assert(j == SIZE/2);
- delete [] indices;
- d.clear();
- assert(d.empty());
- assert(a.OK());
- assert(b.OK());
- assert(c.OK());
- assert(d.OK());
-}
-
-
-
-int main(int argv, char** argc)
-{
- if (argv > 1)
- {
- SIZE = abs(atoi(argc[1]));
- SIZE &= ~1;
- }
- else
- SIZE = 100;
- nums = new int[SIZE];
- odds = new int[SIZE];
- dups = new int[SIZE];
- makenums();
- makeodds();
- makedups();
- start_timer();
- cout << "Splaytest\n"; Splaytest();
- if (ptimes) cout << "\ntime = " << return_elapsed_time(0.0) << "\n";
- start_timer();
- cout << "PHtest\n"; PHtest();
- if (ptimes) cout << "\ntime = " << return_elapsed_time(0.0) << "\n";
- start_timer();
- cout << "XPtest\n"; XPtest();
- if (ptimes) cout << "\ntime = " << return_elapsed_time(0.0) << "\n";
- return 0;
-}
diff --git a/contrib/libg++/libg++/tests/tPQ.exp b/contrib/libg++/libg++/tests/tPQ.exp
deleted file mode 100644
index f2d8e1156e00..000000000000
--- a/contrib/libg++/libg++/tests/tPQ.exp
+++ /dev/null
@@ -1,15 +0,0 @@
-Splaytest
-a: [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ...]
-b: [1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 ...]
-c: [1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 ...]
-d: [1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 ...]
-PHtest
-a: [2 99 76 81 41 35 14 19 95 74 7 38 91 59 87 6 96 93 51 53 ...]
-b: [129 5 191 71 147 17 139 193 1 47 199 33 121 103 37 167 145 67 51 43 ...]
-c: [47 27 20 28 31 15 50 46 39 29 1 1 4 43 11 8 2 7 9 26 ...]
-d: [2 99 76 81 41 35 14 19 95 74 7 38 91 59 87 6 96 93 51 53 ...]
-XPtest
-a: [1 3 2 7 4 5 18 29 12 6 10 8 17 21 26 34 36 15 16 19 ...]
-b: [1 5 3 7 13 15 9 41 27 21 23 19 35 29 11 85 51 65 49 47 ...]
-c: [1 2 1 3 5 2 8 4 5 6 14 3 9 11 10 7 15 12 6 28 ...]
-d: [1 1 2 3 3 2 6 9 5 6 4 5 7 18 8 29 15 7 16 19 ...]
diff --git a/contrib/libg++/libg++/tests/tPQ.inp b/contrib/libg++/libg++/tests/tPQ.inp
deleted file mode 100644
index e69de29bb2d1..000000000000
--- a/contrib/libg++/libg++/tests/tPQ.inp
+++ /dev/null
diff --git a/contrib/libg++/libg++/tests/tPlex.cc b/contrib/libg++/libg++/tests/tPlex.cc
deleted file mode 100644
index cd3f90ad6843..000000000000
--- a/contrib/libg++/libg++/tests/tPlex.cc
+++ /dev/null
@@ -1,719 +0,0 @@
-/*
- test of Plexes
-*/
-
-#include <stream.h>
-#include <assert.h>
-#include "iPlex.h"
-
-#define tassert(ex) {if ((ex)) cerr << #ex << "\n"; \
- else _assert(#ex, __FILE__,__LINE__); }
-
-
-void printplex(intPlex& a)
-{
- cout << "[";
- int maxprint = 20;
- int k = 0;
- int i;
- for (i = a.low(); i < a.fence() && k < maxprint; ++i, ++k)
- cout << a[i] << " ";
- if (i < a.fence()) cout << "]\n";
- else cout << "...]\n";
-}
-
-#include "iFPlex.h"
-
-void FPtest ()
-{
- intFPlex p(50);
- assert(p.OK());
- assert (p.empty());
-
- p.add_high (1000);
- Pix px = p.index_to_Pix(0);
- assert (p.length() == 1);
- assert(p.owns(px));
- assert(p(px) == 1000);
- assert(p.Pix_to_index(px) == 0);
-
- p.reset_low (10);
- assert (p.length() == 1);
- assert (p.low() == 10);
- assert (p[10] == 1000);
- assert(p(px) == 1000);
- assert(p.Pix_to_index(px) == 10);
- assert(p.index_to_Pix(10) == px);
- assert(p.OK());
-
- int h = p.high_element();
- int l = p.low_element();
- assert ( (h==l) && (h==1000));
- p.fill(222);
- assert(p(px) == 222);
-
- p.del_high();
- assert(p.empty());
- assert(!p.owns(px));
-
- intFPlex q(10, -50);
- q.add_low (-1000);
- assert (q[9] == -1000);
- q[9] = 21;
- assert(!q.valid(10));
- assert(q.OK());
-
- q.del_low();
- assert (q.empty());
-
- p.reset_low (0);
- q.reset_low (0);
-
- int i;
- for (i = 0; i < 50; i++)
- {
- if (i % 2 == 0)
- {
- p.add_high (i);
- assert (p.high() == i/2);
- p[i/2] = p[i/4];
- assert (p.high_element() == i/4);
- p[i/2] = i/2;
- }
- else
- {
- q.add_low (-i);
- int ii = - (i/2) -1;
- assert (q.low() == ii);
- q.low_element() = ii;
- assert (q[ii] == ii);
- }
- }
-
- cout << "q:"; printplex(q);
- assert (p.length() == 25);
- assert (q.length() == 25);
-
- assert(p.valid(0));
- assert(p.owns(px));
-
- px = p.first();
- i = 0;
- for (int it1 = p.low(); it1 < p.fence(); p.next(it1))
- {
- assert (p[it1] == it1);
- assert(p(px) == p[it1]);
- p.next(px);
- ++i;
- }
- assert(px == 0);
- px = q.last();
- for (int it1 = q.high(); it1 > q.ecnef(); q.prev(it1))
- {
- assert (q[it1] == it1);
- assert(p(px) == q[it1]);
- q.prev(px);
- ++i;
- }
- assert(i == 50);
- q.reset_low (0);
- assert (p.high() == q.high());
- assert(p.low() == 0);
-
- intFPlex p1 = p;
- intFPlex p2 (p);
- intFPlex p3 = p2;
- assert (p1.length() == 25);
- assert (p1.high() == 24);
- assert(p1.low() == 0);
- assert(p.OK());
- assert(p1.OK());
- assert(p2.OK());
- assert(p3.OK());
-
- i = 0;
- for (int it5 = p.low(); it5 < p.fence(); p.next(it5))
- {
- assert(p1.low() == it5);
- p1.del_low();
- assert(!p1.valid(it5));
- p2.del_high ();
- p3 [it5] = -it5;
- ++i;
- }
- assert(i == 25);
-
- assert(p.OK());
- assert(p1.OK());
- assert(p2.OK());
- assert(p3.OK());
- assert (p1.empty());
- assert (p2.empty());
-
- p3.append (p);
- assert(p3.OK());
-
- p1.prepend (p);
- p2.append (p);
- assert(p1.length() == p.length());
- assert(p1.length() == p2.length());
- assert(p1.OK());
- assert(p2.OK());
-
- p2.clear();
- assert(p2.OK());
- assert(p2.empty());
- p2 = p1;
- assert(p2.OK());
-
- p1 = p;
- assert(p1.OK());
- p1.reset_low (p1.low_element());
- for (int it6 = p1.low(); it6 < p1.fence(); it6++)
- {
- assert (p1[it6] == it6);
- }
- p1[13] = 1313;
- p1[7] = -7777;
- p1[24] = 24242424;
- assert(!p1.valid(25));
- assert(!p1.valid(-1));
- assert(p1.OK());
-
-}
-
-#include "iXPlex.h"
-
-void XPtest ()
-{
- intXPlex p(3);
- assert(p.OK());
- assert (p.empty());
-
- p.add_high (1000);
- Pix px = p.index_to_Pix(0);
- assert(p.Pix_to_index(px) == 0);
- assert (p.length() == 1);
- assert(p.owns(px));
- assert(p(px) == 1000);
-
- p.reset_low(10);
- assert (p.length() == 1);
- assert (p.low() == 10);
- assert (p[10] == 1000);
- assert(p(px) == 1000);
- assert(p.Pix_to_index(px) == 10);
- assert(p.index_to_Pix(10) == px);
- assert(p.OK());
-
- int h = p.high_element();
- int l = p.low_element();
- assert ( (h==l) && (h==1000));
- p.fill(222);
- assert(p(px) == 222);
-
- p.del_high();
- assert(p.empty());
- assert(!p.owns(px));
-
- p.add_low(-1000);
- assert (p[9] == -1000);
- p[9] = 21;
- assert(!p.valid(10));
- assert(p.OK());
-
- p.del_low();
- assert (p.empty());
- p.reset_low (0);
-
- int i;
- for (i = 0; i < 50; i++)
- {
- if (i % 2 == 0)
- {
- p.add_high (i);
- assert (p.high() == i/2);
- p[i/2] = p[i/4];
- assert (p.high_element() == i/4);
- p[i/2] = i/2;
- }
- else
- {
- p.add_low (-i);
- int ii = - (i/2) -1;
- assert (p.low() == ii);
- p.low_element() = ii;
- assert (p[ii] == ii);
- }
- }
-
- assert (p.length() == 50);
- cout << "p:"; printplex(p);
-
- assert(p.valid(0));
- assert(p.owns(px));
-
- px = p.first();
- i = 0;
- for (int it1 = p.low(); it1 < p.fence(); p.next(it1))
- {
- assert (p[it1] == it1);
- assert(p(px) == p[it1]);
- p.next(px);
- ++i;
- }
- assert(i == 50);
- assert(px == 0);
- p.reset_low (0);
- assert (p.high() == 49);
- assert(p.low() == 0);
-
- i = 0;
- for (int it2 = p.high(); it2 > p.ecnef(); p.prev(it2))
- {
- assert ( p[it2] == it2-25 );
- ++i;
- }
- assert(i == 50);
- assert(p.OK());
-
- intXPlex p1 = p;
- intXPlex p2 (p);
- intXPlex p3 = p2;
- assert (p1.length() == 50);
- assert (p1.high() == 49);
- assert(p1.low() == 0);
- assert(p.OK());
- assert(p1.OK());
- assert(p2.OK());
- assert(p3.OK());
-
- i = 0;
- for (int it5 = p.low(); it5 < p.fence(); p.next(it5))
- {
- assert(p1.low() == it5);
- p1.del_low();
- assert(!p1.valid(it5));
- p2.del_high ();
- p3 [it5] = -it5;
- ++i;
- }
- assert(i == 50);
-
- assert(p.OK());
- assert(p1.OK());
- assert(p2.OK());
- assert(p3.OK());
- assert (p1.empty());
- assert (p2.empty());
-
- p3.append (p);
- assert(p3.OK());
-
- p1.prepend (p);
- p2.append (p);
- assert(p1.length() == p.length());
- assert(p1.length() == p2.length());
- assert(p1.OK());
- assert(p2.OK());
-
- p2.clear();
- assert(p2.OK());
- assert(p2.empty());
- p2 = p1;
- assert(p2.OK());
-
-
- p1 = p;
- assert(p1.OK());
- p1.reset_low(p1.low_element());
- p1 [13] = 1313;
- p1 [-7] = -7777;
- p1 [-25] = -252525;
- p1 [24] = 24242424;
- assert(!p1.valid(25));
- assert(!p1.valid(-26));
- assert(p1.OK());
-
- p1 = p;
- p1.reset_low (p1.low_element());
- for (int it6 = p1.low(); it6 < p1.fence(); it6++)
- {
- assert (p1[it6] == it6);
- }
- p1.reverse();
- i = p1.high();
- for (int it6 = p1.low(); it6 < p1.fence(); it6++)
- {
- assert (p1[it6] == i);
- --i;
- }
- assert(p1.OK());
-
-}
-
-#include "iMPlex.h"
-
-void MPtest ()
-{
- intMPlex p(3);
- assert(p.OK());
- assert (p.empty());
-
- p.add_high (1000);
- Pix px = p.index_to_Pix(0);
- assert (p.length() == 1);
- assert(p.owns(px));
- assert(p(px) == 1000);
- assert(p.Pix_to_index(px) == 0);
-
- p.reset_low (10);
- assert (p.length() == 1);
- assert (p.low() == 10);
- assert (p[10] == 1000);
- assert(p(px) == 1000);
- assert(p.Pix_to_index(px) == 10);
- assert(p.index_to_Pix(10) == px);
- assert(p.OK());
-
- int h = p.high_element();
- int l = p.low_element();
- assert ( (h==l) && (h==1000));
- p.fill(222);
- assert(p(px) == 222);
-
- p.del_high();
- assert(p.empty());
- assert(!p.owns(px));
-
- p.add_low (-1000);
- assert (p[9] == -1000);
- p[9] = 21;
- assert(!p.valid(10));
- assert(p.OK());
-
- p.del_low();
- assert (p.empty());
- p.reset_low (0);
-
- int i;
- for (i = 0; i < 50; i++)
- {
- if (i % 2 == 0)
- {
- p.add_high (i);
- assert (p.high() == i/2);
- p[i/2] = p[i/4];
- assert (p.high_element() == i/4);
- p[i/2] = i/2;
- }
- else
- {
- p.add_low (-i);
- int ii = - (i/2) -1;
- assert (p.low() == ii);
- p.low_element() = ii;
- assert (p[ii] == ii);
- }
- }
-
- cout << "p:"; printplex(p);
- assert (p.length() == 50);
- assert (p.count() == 50);
-
- assert(p.available() == 0);
- assert(p.valid(0));
- px = &p[0];
- assert(p.owns(px));
- p.del_index(0);
- assert(p.count() == 49);
- assert(p.available() == 1);
- assert(p.unused_index() == 0);
- assert(!p.valid(0));
- assert(!p.owns(px));
- p.undel_index(0);
- p[0] = 0;
- assert(p.count() == 50);
- assert(p.available() == 0);
- assert(p.valid(0));
- assert(p.owns(px));
- assert(p.OK());
-
- p.del_index(0);
-
- px = p.first();
- i = 0;
- for (int it1 = p.low(); it1 < p.fence(); p.next(it1))
- {
- assert (p[it1] == it1);
- assert(p(px) == p[it1]);
- p.next(px);
- ++i;
- }
- assert(i == 49);
- assert(px == 0);
- p.reset_low (0);
- assert (p.high() == 49);
- assert(p.low() == 0);
-
- i = 0;
- for (int it2 = p.high(); it2 > p.ecnef(); p.prev(it2))
- {
- assert ( p[it2] == it2-25 );
- assert(px != &p[it2]);
- ++i;
- }
- assert(i == 49);
- assert(p.OK());
-
- p.del_index(1);
- p.del_index(2);
- assert (p.OK());
- assert (p.count() == 47);
-
- intMPlex p1 = p;
- intMPlex p2 (p);
- intMPlex p3 = p2;
- assert (p1.length() == 50);
- assert (p1.count() == 47);
- assert (p1.high() == 49);
- assert(p1.low() == 0);
- assert(p.OK());
- assert(p1.OK());
- assert(p2.OK());
- assert(p3.OK());
-
- i = 0;
- for (int it5 = p.low(); it5 < p.fence(); p.next(it5))
- {
- assert(p1.low() == it5);
- p1.del_low();
- assert(!p1.valid(it5));
- p2.del_high ();
- p3 [it5] = -it5;
- ++i;
- }
- assert(i == 47);
-
- assert(p.OK());
- assert(p1.OK());
- assert(p2.OK());
- assert(p3.OK());
- assert (p1.empty());
- assert (p2.empty());
-
- p3.append (p);
- assert(p3.OK());
-
- p1.prepend (p);
- p2.append (p);
- assert(p1.count() == p.count());
- assert(p1.count() == p2.count());
- assert(p1.OK());
- assert(p2.OK());
-
- p2.clear();
- assert(p2.OK());
- assert(p2.empty());
- p2 = p1;
- assert(p2.OK());
-
- p1 = p;
- p1.del_index(3);
- p1.del_index(4);
- p1.del_index(5);
- p1.del_index(6);
- p1.del_index(7);
- p1.del_index(8);
- p1.undel_index(6);
- p1[6] = 6666;
- p1[9] = 9999;
- p1[0] = 0;
- assert(p1[6] == 6666);
- assert(!p1.valid(5));
- assert(!p1.valid(7));
- p1.del_low();
- assert(p1.low() == 6);
- assert(p1.OK());
-
-}
-
-#include "iRPlex.h"
-
-void RPtest ()
-{
- intRPlex p(3);
- assert(p.OK());
- assert (p.empty());
-
- p.add_high (1000);
- Pix px = p.index_to_Pix(0);
- assert(p.Pix_to_index(px) == 0);
- assert (p.length() == 1);
- assert(p.owns(px));
- assert(p(px) == 1000);
-
- p.reset_low(10);
- assert (p.length() == 1);
- assert (p.low() == 10);
- assert (p[10] == 1000);
- assert(p(px) == 1000);
- assert(p.Pix_to_index(px) == 10);
- assert(p.index_to_Pix(10) == px);
- assert(p.OK());
-
- int h = p.high_element();
- int l = p.low_element();
- assert ( (h==l) && (h==1000));
- p.fill(222);
- assert(p(px) == 222);
-
- p.del_high();
- assert(p.empty());
- assert(!p.owns(px));
-
- p.add_low(-1000);
- assert (p[9] == -1000);
- p[9] = 21;
- assert(!p.valid(10));
- assert(p.OK());
-
- p.del_low();
- assert (p.empty());
- p.reset_low (0);
-
- int i;
- for (i = 0; i < 50; i++)
- {
- if (i % 2 == 0)
- {
- p.add_high (i);
- assert (p.high() == i/2);
- p[i/2] = p[i/4];
- assert (p.high_element() == i/4);
- p[i/2] = i/2;
- }
- else
- {
- p.add_low (-i);
- int ii = - (i/2) -1;
- assert (p.low() == ii);
- p.low_element() = ii;
- assert (p[ii] == ii);
- }
- }
-
- assert (p.length() == 50);
- cout << "p:"; printplex(p);
-
- assert(p.valid(0));
- assert(p.owns(px));
-
- px = p.first();
- i = 0;
- for (int it1 = p.low(); it1 < p.fence(); p.next(it1))
- {
- assert (p[it1] == it1);
- assert(p(px) == p[it1]);
- p.next(px);
- ++i;
- }
- assert(i == 50);
- assert(px == 0);
- p.reset_low (0);
- assert (p.high() == 49);
- assert(p.low() == 0);
-
- i = 0;
- for (int it2 = p.high(); it2 > p.ecnef(); p.prev(it2))
- {
- assert ( p[it2] == it2-25 );
- ++i;
- }
- assert(i == 50);
- assert(p.OK());
-
- intRPlex p1 = p;
- intRPlex p2 (p);
- intRPlex p3 = p2;
- assert (p1.length() == 50);
- assert (p1.high() == 49);
- assert(p1.low() == 0);
- assert(p.OK());
- assert(p1.OK());
- assert(p2.OK());
- assert(p3.OK());
-
- i = 0;
- for (int it5 = p.low(); it5 < p.fence(); p.next(it5))
- {
- assert(p1.low() == it5);
- p1.del_low();
- assert(!p1.valid(it5));
- p2.del_high ();
- p3 [it5] = -it5;
- ++i;
- }
- assert(i == 50);
-
- assert(p.OK());
- assert(p1.OK());
- assert(p2.OK());
- assert(p3.OK());
- assert (p1.empty());
- assert (p2.empty());
-
- p3.append (p);
- assert(p3.OK());
-
- p1.prepend (p);
- p2.append (p);
- assert(p1.length() == p.length());
- assert(p1.length() == p2.length());
- assert(p1.OK());
- assert(p2.OK());
-
- p2.clear();
- assert(p2.OK());
- assert(p2.empty());
- p2 = p1;
- assert(p2.OK());
-
-
- p1 = p;
- assert(p1.OK());
- p1.reset_low(p1.low_element());
- p1 [13] = 1313;
- p1 [-7] = -7777;
- p1 [-25] = -252525;
- p1 [24] = 24242424;
- assert(!p1.valid(25));
- assert(!p1.valid(-26));
- assert(p1.OK());
-
- p1 = p;
- p1.reset_low (p1.low_element());
- for (int it6 = p1.low(); it6 < p1.fence(); it6++)
- {
- assert (p1[it6] == it6);
- }
- p1.reverse();
- i = p1.high();
- for (int it6 = p1.low(); it6 < p1.fence(); it6++)
- {
- assert (p1[it6] == i);
- --i;
- }
- assert(p1.OK());
-
-}
-
-
-main()
-{
- cout << "FPtest\n"; FPtest();
- cout << "XPtest\n"; XPtest();
- cout << "MPtest\n"; MPtest();
- cout << "RPtest\n"; RPtest();
- cout << "\nend of tests\n";
-}
diff --git a/contrib/libg++/libg++/tests/tPlex.exp b/contrib/libg++/libg++/tests/tPlex.exp
deleted file mode 100644
index 42f939f94208..000000000000
--- a/contrib/libg++/libg++/tests/tPlex.exp
+++ /dev/null
@@ -1,10 +0,0 @@
-FPtest
-q:[-25 -24 -23 -22 -21 -20 -19 -18 -17 -16 -15 -14 -13 -12 -11 -10 -9 -8 -7 -6 ]
-XPtest
-p:[-25 -24 -23 -22 -21 -20 -19 -18 -17 -16 -15 -14 -13 -12 -11 -10 -9 -8 -7 -6 ]
-MPtest
-p:[-25 -24 -23 -22 -21 -20 -19 -18 -17 -16 -15 -14 -13 -12 -11 -10 -9 -8 -7 -6 ]
-RPtest
-p:[-25 -24 -23 -22 -21 -20 -19 -18 -17 -16 -15 -14 -13 -12 -11 -10 -9 -8 -7 -6 ]
-
-end of tests
diff --git a/contrib/libg++/libg++/tests/tPlex.inp b/contrib/libg++/libg++/tests/tPlex.inp
deleted file mode 100644
index e69de29bb2d1..000000000000
--- a/contrib/libg++/libg++/tests/tPlex.inp
+++ /dev/null
diff --git a/contrib/libg++/libg++/tests/tQueue.cc b/contrib/libg++/libg++/tests/tQueue.cc
deleted file mode 100644
index 51615da020f7..000000000000
--- a/contrib/libg++/libg++/tests/tQueue.cc
+++ /dev/null
@@ -1,209 +0,0 @@
-/*
- test of Queues
-*/
-
-#ifdef PTIMES
-const int ptimes = 1;
-#else
-const int ptimes = 0;
-#endif
-
-#include <stream.h>
-#include <assert.h>
-#include "iQueue.h"
-
-#define tassert(ex) {if ((ex)) cerr << #ex << "\n"; \
- else _assert(#ex, __FILE__,__LINE__); }
-
-
-int SIZE;
-
-void print(intQueue& a)
-{
- int maxprint = 20;
- cout << "[";
- int k = 0;
- while (!a.empty() && k++ < maxprint)
- cout << a.deq() << " ";
- if (k == maxprint)
- cout << "]\n";
- else
- {
- while (!a.empty()) a.del_front();
- cout << "...]\n";
- }
- assert(a.empty());
-}
-
-#include "iXPQueue.h"
-
-void XPtest ()
-{
- intXPQueue q(SIZE/2);
- assert(q.OK());
- for (int i = 0; i < SIZE; ++i)
- q.enq(i);
- assert(q.length() == SIZE);
- assert(q.front() == 0);
- assert(!q.full());
- intXPQueue q1(SIZE*2);
- for (int i = 0; i < SIZE; ++i)
- {
- int x = q.deq();
- assert(x == i);
- q1.enq(x);
- }
- assert(q.empty());
- assert(q1.length() == SIZE);
- assert(q1.front() == 0);
- assert(q.OK());
- assert(q1.OK());
- intXPQueue q2 (q1);
- assert(q2.length() == SIZE);
- assert(q2.front() == 0);
- assert(q2.OK());
- q1.clear();
- assert(q1.empty());
- q1 = q2;
- assert(q1.length() == SIZE);
- assert(q1.front() == 0);
- assert(q1.OK());
- q1.del_front();
- assert(q1.length() == (SIZE-1));
- assert(q1.front() == 1);
- cout << "q1:"; print(q1);
- assert(q.OK());
- assert(q1.OK());
- assert(q2.OK());
-}
-
-#include "iVQueue.h"
-
-void Vtest ()
-{
- intVQueue q(SIZE);
- assert(q.OK());
- for (int i = 0; i < SIZE; ++i)
- q.enq(i);
- assert(q.length() == SIZE);
- assert(q.front() == 0);
- assert(q.full());
- intVQueue q1(SIZE);
- for (int i = 0; i < SIZE; ++i)
- {
- int x = q.deq();
- assert(x == i);
- q1.enq(x);
- }
- assert(q.empty());
- assert(q1.length() == SIZE);
- assert(q1.front() == 0);
- assert(q.OK());
- assert(q1.OK());
- intVQueue q2 (q1);
- assert(q2.length() == SIZE);
- assert(q2.front() == 0);
- assert(q2.OK());
- q1.clear();
- assert(q1.empty());
- q1 = q2;
- assert(q1.length() == SIZE);
- assert(q1.front() == 0);
- assert(q1.OK());
- q1.del_front();
- assert(q1.length() == (SIZE-1));
- assert(q1.front() == 1);
- cout << "q1:"; print(q1);
- assert(q.OK());
- assert(q1.OK());
- assert(q2.OK());
-}
-
-#include "iSLQueue.h"
-
-void SLtest ()
-{
- intXPQueue q;
- assert(q.OK());
- for (int i = 0; i < SIZE; ++i)
- q.enq(i);
- assert(q.length() == SIZE);
- assert(q.front() == 0);
- assert(!q.full());
- intXPQueue q1;
- for (int i = 0; i < SIZE; ++i)
- {
- int x = q.deq();
- assert(x == i);
- q1.enq(x);
- }
- assert(q.empty());
- assert(q1.length() == SIZE);
- assert(q1.front() == 0);
- assert(q.OK());
- assert(q1.OK());
- intXPQueue q2 (q1);
- assert(q2.length() == SIZE);
- assert(q2.front() == 0);
- assert(q2.OK());
- q1.clear();
- assert(q1.empty());
- q1 = q2;
- assert(q1.length() == SIZE);
- assert(q1.front() == 0);
- assert(q1.OK());
- q1.del_front();
- assert(q1.length() == (SIZE-1));
- assert(q1.front() == 1);
- cout << "q1:"; print(q1);
- assert(q.OK());
- assert(q1.OK());
- assert(q2.OK());
-}
-
-/* Test case from Jocelyn Serot <jserot@alize.univ-bpclermont.fr> */
-void
-test_resize ()
-{
- intVQueue Q(4);
- Q.enq(1);
- Q.enq(2);
- cout << Q.deq() << endl;
- Q.enq(3);
- Q.enq(4);
- cout << Q.deq() << endl;
- Q.enq(5);
- Q.enq(6);
- cout << Q.deq() << endl;
- Q.enq(7); // Q is now full
- Q.resize(8); // Lets grow it
- Q.enq(8); // *** bug manifest at this point
- cout << Q.deq() << endl;
- cout << Q.deq() << endl;
- cout << Q.deq() << endl;
- cout << Q.deq() << endl; // Q is now empty
-}
-
-int main(int argv, char** argc)
-{
- if (argv > 1)
- {
- SIZE = abs(atoi(argc[1]));
- SIZE &= ~1;
- }
- else
- SIZE = 100;
- start_timer();
- cout << "XP queues:\n"; XPtest();
- if (ptimes) cout << "\ntime = " << return_elapsed_time(0.0) << "\n";
- start_timer();
- cout << "V queues:\n"; Vtest();
- if (ptimes) cout << "\ntime = " << return_elapsed_time(0.0) << "\n";
- start_timer();
- cout << "SL queues:\n"; SLtest();
- if (ptimes) cout << "\ntime = " << return_elapsed_time(0.0) << "\n";
-
- test_resize ();
- cout << "\nEnd of test\n";
- return 0;
-}
diff --git a/contrib/libg++/libg++/tests/tQueue.exp b/contrib/libg++/libg++/tests/tQueue.exp
deleted file mode 100644
index 5571e7580a2a..000000000000
--- a/contrib/libg++/libg++/tests/tQueue.exp
+++ /dev/null
@@ -1,15 +0,0 @@
-XP queues:
-q1:[1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ...]
-V queues:
-q1:[1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ...]
-SL queues:
-q1:[1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ...]
-1
-2
-3
-4
-5
-6
-7
-
-End of test
diff --git a/contrib/libg++/libg++/tests/tQueue.inp b/contrib/libg++/libg++/tests/tQueue.inp
deleted file mode 100644
index e69de29bb2d1..000000000000
--- a/contrib/libg++/libg++/tests/tQueue.inp
+++ /dev/null
diff --git a/contrib/libg++/libg++/tests/tRandom.cc b/contrib/libg++/libg++/tests/tRandom.cc
deleted file mode 100644
index e41e4bf4df64..000000000000
--- a/contrib/libg++/libg++/tests/tRandom.cc
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- a test file for Random classes
-*/
-
-#include <assert.h>
-#include <ACG.h>
-#include <MLCG.h>
-#include <SmplStat.h>
-#include <SmplHist.h>
-#include <Binomial.h>
-#include <Erlang.h>
-#include <Geom.h>
-#include <HypGeom.h>
-#include <NegExp.h>
-#include <Normal.h>
-#include <LogNorm.h>
-#include <Poisson.h>
-#include <Uniform.h>
-#include <DiscUnif.h>
-#include <Weibull.h>
-
-void demo(Random& r)
-{
- SampleStatistic s;
- cout << "five samples:\n";
- for (int i = 0; i < 5; ++i)
- {
- double x = r();
- cout << x << " ";
- s += x;
- }
- cout << "\nStatistics for 100 samples:\n";
- for (; i < 100; ++i)
- {
- double x = r();
- s += x;
- }
- cout << "samples: " << s.samples() << " ";
- cout << "min: " << s.min() << " ";
- cout << "max: " << s.max() << "\n";
- cout << "mean: " << s.mean() << " ";
- cout << "stdDev: " << s.stdDev() << " ";
- cout << "var: " << s.var() << " ";
- cout << "confidence(95): " << s.confidence(95) << "\n";
-}
-
-main()
-{
- int i;
- ACG gen1;
- cout << "five random ACG integers:\n";
- for (i = 0; i < 5; ++i)
- cout << gen1.asLong() << " ";
- cout << "\n";
-
- MLCG gen2;
- cout << "five random MLCG integers:\n";
- for (i = 0; i < 5; ++i)
- cout << gen2.asLong() << " ";
- cout << "\n";
-
- Binomial r1( 100, 0.5, &gen1);
- cout << "Binomial r1( 100, 0.50, &gen1) ...\n";
- demo(r1);
- Erlang r2( 2.0, 0.5, &gen1);
- cout << "Erlang r2( 2.0, 0.5, &gen1) ...\n";
- demo(r2);
- Geometric r3( 0.5, &gen1);
- cout << "Geometric r3(&gen1, 0.5)...\n";
- demo(r3);
- HyperGeometric r4( 10.0, 150.0, &gen1);
- cout << "HyperGeometric r4( 10.0, 150.0, &gen1)...\n";
- demo(r4);
- NegativeExpntl r5( 1.0, &gen1);
- cout << "NegativeExpntl r5( 1.0, &gen1)...\n";
- demo(r5);
- Normal r6( 0.0, 1.0, &gen1);
- cout << "Normal r6( 0.0, 1.0, &gen1)...\n";
- demo(r6);
- LogNormal r7( 1.0, 1.0, &gen1);
- cout << "LogNormal r7( 1.0, 1.0, &gen1)...\n";
- demo(r7);
- Poisson r8( 2.0, &gen1);
- cout << "Poisson r8( 2.0, &gen1)...\n";
- demo(r8);
- DiscreteUniform r9( 0, 1, &gen1);
- cout << "DiscreteUniform r9( 0.0, 1.0, &gen1)...\n";
- demo(r9);
- Uniform r10( 0.0, 1.0, &gen1);
- cout << "Uniform r10( 0.0, 1.0, &gen1)...\n";
- demo(r10);
- Weibull r11( 0.5, 1.0, &gen1);
- cout << "Weibull r11( 0.5, 1.0, &gen1)...\n";
- demo(r11);
-
- cout << "SampleHistogram for 100 Normal samples\n";
- SampleHistogram h(-4.0, 4.0);
- for (i = 0; i < 100; ++i)
- h += r6();
- h.printBuckets(cout);
- cout << "\nEnd of test\n";
- return 0;
-}
diff --git a/contrib/libg++/libg++/tests/tRandom.exp b/contrib/libg++/libg++/tests/tRandom.exp
deleted file mode 100644
index 9906721b030f..000000000000
--- a/contrib/libg++/libg++/tests/tRandom.exp
+++ /dev/null
@@ -1,85 +0,0 @@
-five random ACG integers:
-1525072166 1954057046 3406008937 226879594 4107049426
-five random MLCG integers:
-1341853672 83475514 936613571 888739672 2097844081
-Binomial r1( 100, 0.50, &gen1) ...
-five samples:
-45 52 59 49 60
-Statistics for 100 samples:
-samples: 100 min: 40 max: 64
-mean: 50.78 stdDev: 4.42577 var: 19.5875 confidence(95): 0.878369
-Erlang r2( 2.0, 0.5, &gen1) ...
-five samples:
-1.79909 1.92989 2.50816 2.31409 1.48158
-Statistics for 100 samples:
-samples: 100 min: 0.592645 max: 3.81874
-mean: 1.96664 stdDev: 0.696406 var: 0.484981 confidence(95): 0.138213
-Geometric r3(&gen1, 0.5)...
-five samples:
-3 2 2 2 3
-Statistics for 100 samples:
-samples: 100 min: 1 max: 7
-mean: 1.9 stdDev: 1.28315 var: 1.64646 confidence(95): 0.254662
-HyperGeometric r4( 10.0, 150.0, &gen1)...
-five samples:
-15.0752 5.25802 7.82211 20.4995 7.08199
-Statistics for 100 samples:
-samples: 100 min: 0.0446068 max: 131.508
-mean: 12.6763 stdDev: 16.7567 var: 280.786 confidence(95): 3.32564
-NegativeExpntl r5( 1.0, &gen1)...
-five samples:
-1.90665 0.0921974 0.219318 1.79202 0.566202
-Statistics for 100 samples:
-samples: 100 min: 0.00794624 max: 4.23124
-mean: 0.927343 stdDev: 0.8869 var: 0.786592 confidence(95): 0.17602
-Normal r6( 0.0, 1.0, &gen1)...
-five samples:
--0.174892 0.148871 -0.479753 0.65432 -0.92688
-Statistics for 100 samples:
-samples: 100 min: -2.22325 max: 2.61771
-mean: 0.141292 stdDev: 0.972041 var: 0.944864 confidence(95): 0.192918
-LogNormal r7( 1.0, 1.0, &gen1)...
-five samples:
-2.15572 0.985688 0.340019 0.959144 1.06052
-Statistics for 100 samples:
-samples: 100 min: 0.0393323 max: 6.16358
-mean: 1.03547 stdDev: 0.963892 var: 0.929088 confidence(95): 0.191301
-Poisson r8( 2.0, &gen1)...
-five samples:
-0 2 1 2 1
-Statistics for 100 samples:
-samples: 100 min: 0 max: 5
-mean: 2 stdDev: 1.31041 var: 1.71717 confidence(95): 0.260073
-DiscreteUniform r9( 0.0, 1.0, &gen1)...
-five samples:
-1 1 0 0 0
-Statistics for 100 samples:
-samples: 100 min: 0 max: 1
-mean: 0.45 stdDev: 0.5 var: 0.25 confidence(95): 0.0992334
-Uniform r10( 0.0, 1.0, &gen1)...
-five samples:
-0.557314 0.529968 0.997197 0.25163 0.947497
-Statistics for 100 samples:
-samples: 100 min: 0.00205286 max: 0.997197
-mean: 0.518789 stdDev: 0.321429 var: 0.103317 confidence(95): 0.0637931
-Weibull r11( 0.5, 1.0, &gen1)...
-five samples:
-10.4918 0.295112 0.184577 2.14799 0.10053
-Statistics for 100 samples:
-samples: 100 min: 0.000236481 max: 15.4934
-mean: 1.96369 stdDev: 2.97642 var: 8.85906 confidence(95): 0.59072
-SampleHistogram for 100 Normal samples
-< -4 : 0
-< -3.2 : 0
-< -2.4 : 0
-< -1.6 : 7
-< -0.8 : 15
-< -2.22045e-16 : 36
-< 0.8 : 15
-< 1.6 : 19
-< 2.4 : 7
-< 3.2 : 1
-< 4 : 0
-< max : 0
-
-End of test
diff --git a/contrib/libg++/libg++/tests/tRandom.inp b/contrib/libg++/libg++/tests/tRandom.inp
deleted file mode 100644
index e69de29bb2d1..000000000000
--- a/contrib/libg++/libg++/tests/tRandom.inp
+++ /dev/null
diff --git a/contrib/libg++/libg++/tests/tRational.cc b/contrib/libg++/libg++/tests/tRational.cc
deleted file mode 100644
index 2c49a814dea2..000000000000
--- a/contrib/libg++/libg++/tests/tRational.cc
+++ /dev/null
@@ -1,194 +0,0 @@
-/*
- a test file for Rational class
- */
-
-#include <Rational.h>
-
-#include <assert.h>
-
-#define tassert(ex) {if ((ex)) cerr << #ex << "\n"; \
- else _assert(#ex, __FILE__,__LINE__); }
-
-
-void identtest(Rational& a, Rational& b, Rational& c)
-{
- Rational one(1, 1);
-
- assert(-(-a) == a);
- assert((a + b) == (b + a));
- assert((a + (-b)) == (a - b));
- assert((a * b) == (b * a));
- assert((a * (-b)) == -(a * b));
- assert((a / (-b)) == -(a / b));
- assert((a / b) == (a * (one / b)));
- assert((a / b) == (one / (b / a)));
- assert((a - b) == -(b - a));
- assert((a + (b + c)) == ((a + b) + c));
- assert((a * (b * c)) == ((a * b) * c));
- assert((a * (b + c)) == ((a * b) + (a * c)));
- assert(((a - b) + b) == a);
- assert(((a + b) - b) == a);
- assert(((a * b) / b) == a);
- assert(((a / b) * b) == a);
-
- Rational x = a;
- x *= b;
- assert(x == (a * b));
- x += c;
- assert(x == ((a * b) + c));
- x -= a;
- assert(x == (((a * b) + c) - a));
- x /= b;
- assert(x == ((((a * b) + c) - a) / b));
-
- assert(x.OK());
-}
-
-
-
-void simpletest()
-{
- Rational one = 1;
- assert(one.OK());
- Rational third(1, 3);
- assert(third.OK());
- Rational half(1, 2);
- assert(half.OK());
-
- Rational two(2);
- Rational zero(0);
- Rational r;
- r = two+zero;
-
- cout << "one = " << one << "\n";
- cout << "two = " << r << "\n";
- cout << "third = " << third << "\n";
- cout << "half = " << half << "\n";
-
- cout << "third + half = " << third + half << "\n";
- cout << "third - half = " << third - half << "\n";
- cout << "third * half = " << third * half << "\n";
- cout << "third / half = " << third / half << "\n";
-
- Rational onePointTwo = 1.2;
- cout << "onePointTwo = " << onePointTwo << "\n";
- cout << "double(onePointTwo) = " << double(onePointTwo) << "\n";
-
- Rational a = one;
- cout << "a = " << a << "\n";
- assert(a.OK());
- a += half;
- cout << "a += half = " << a << "\n";
- assert(a == Rational(3, 2));
- a -= half;
- cout << "a -= half = " << a << "\n";
- assert(a == Rational(1));
- a *= half;
- cout << "a *= half = " << a << "\n";
- assert(a == half);
- a /= half;
- cout << "a /= half = " << a << "\n";
- assert(a == Rational(1));
- assert(a.OK());
-
- identtest(one, one, one);
- identtest(one, third, half);
- identtest(third, half, one);
- identtest(onePointTwo, half, a);
-}
-
-void pitest()
-{
- Rational half(1, 2);
- Rational approxpi(355, 113);
- assert(approxpi.OK());
- cout << "approxpi = " << approxpi << "\n";
- cout << "double(approxpi) = " << double(approxpi) << "\n";
-
-#ifndef M_PI
-#define M_PI 3.14159265358979323846
-#endif
- Rational rpi = Rational(M_PI);
- cout << "rpi = Rational(PI) = " << rpi << "\n";
- assert(rpi.OK());
- cout << "double(rpi) = " << double(rpi) << "\n";
-
- cout << "approxpi + rpi = " << approxpi + rpi << "\n";
- cout << "approxpi - rpi = " << approxpi - rpi << "\n";
- cout << "approxpi * rpi = " << approxpi * rpi << "\n";
- cout << "approxpi / rpi = " << approxpi / rpi << "\n";
-
- Rational negapproxpi = -approxpi;
-
- cout << "-approxpi = " << negapproxpi << "\n";
- assert(sign(negapproxpi) < 0);
- cout << "abs(negapproxpi) = " << abs(negapproxpi) << "\n";
- assert(abs(negapproxpi) == approxpi);
-
- assert(approxpi != rpi);
- assert(approxpi >= rpi);
- assert(approxpi > rpi);
- assert(!(approxpi == rpi));
- assert(!(approxpi <= rpi));
- assert(!(approxpi < rpi));
-#if defined (__GNUC__) && ! defined (__STRICT_ANSI__)
- assert((approxpi >? rpi) == approxpi);
- assert((approxpi <? rpi) == rpi);
-#endif
-
- assert(floor(approxpi) == 3);
- assert(ceil(approxpi) == 4);
- assert(trunc(approxpi) == 3);
- assert(round(approxpi) == 3);
-
- assert(floor(negapproxpi + half) == -3);
- assert(ceil(negapproxpi + half) == -2);
- assert(trunc(negapproxpi + half) == -2);
- assert(round(negapproxpi + half) == -3);
-
- identtest(approxpi, rpi, negapproxpi);
- identtest(rpi, approxpi, rpi);
- identtest(negapproxpi, half, rpi);
-}
-
-
-
-void IOtest()
-{
- Rational a;
- cout << "\nenter a Rational in form a/b or a: ";
- cin >> a;
- cout << "number = " << a << "\n";
- assert(a.OK());
-}
-
-// as a fct just to test Rational fcts
-Rational estimate_e(long n)
-{
- Rational x = Rational(n + 1, n);
- Rational e = pow(x, n);
- return e;
-}
-
-void etest(long n)
-{
- cout << "approximating e as pow(1+1/n),n) for n =" << n << "\n";
- Rational approxe = estimate_e(n);
- assert(approxe.OK());
- cout << "double(approxe) = " << double(approxe) << "\n";
- cout << "log(approxe) = " << log(approxe) << "\n";
- assert(log(approxe) <= 1.0);
- cout << "approxe = " << approxe << "\n";
-}
-
-int main()
-{
- simpletest();
- pitest();
- IOtest();
- etest(10);
- etest(100);
- etest(1000);
- cout << "\nEnd of test\n";
- return 0;
-}
diff --git a/contrib/libg++/libg++/tests/tRational.exp b/contrib/libg++/libg++/tests/tRational.exp
deleted file mode 100644
index 743aadd88627..000000000000
--- a/contrib/libg++/libg++/tests/tRational.exp
+++ /dev/null
@@ -1,41 +0,0 @@
-one = 1
-two = 2
-third = 1/3
-half = 1/2
-third + half = 5/6
-third - half = -1/6
-third * half = 1/6
-third / half = 2/3
-onePointTwo = 5404319552844595/4503599627370496
-double(onePointTwo) = 1.2
-a = 1
-a += half = 3/2
-a -= half = 1
-a *= half = 1/2
-a /= half = 1
-approxpi = 355/113
-double(approxpi) = 3.14159
-rpi = Rational(PI) = 884279719003555/281474976710656
-double(rpi) = 3.14159
-approxpi + rpi = 199847224979684595/31806672368304128
-approxpi - rpi = 8484881165/31806672368304128
-approxpi * rpi = 313919300246262025/31806672368304128
-approxpi / rpi = 19984723346456576/19984721649480343
--approxpi = -355/113
-abs(negapproxpi) = 355/113
-
-enter a Rational in form a/b or a: number = 61727839/49382716
-approximating e as pow(1+1/n),n) for n =10
-double(approxe) = 2.59374
-log(approxe) = 0.953102
-approxe = 25937424601/10000000000
-approximating e as pow(1+1/n),n) for n =100
-double(approxe) = 2.70481
-log(approxe) = 0.995033
-approxe = 270481382942152609326719471080753083367793838278100277689020104911710151430673927943945601434674459097335651375483564268312519281766832427980496322329650055217977882315938008175933291885667484249510001/100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
-approximating e as pow(1+1/n),n) for n =1000
-double(approxe) = 2.71692
-log(approxe) = 0.9995
-approxe = 2716923932235892457383088121947577188964315018836572803722354774868894945523768158997885697298661429053421034015406256924859461187617653889457753593083386399572063538500432650176144488046171044844121805479607648086607018742077798375087855857012278053105042704758822511824867218226931719410407150364389665913091822576819072281835735365786202176167228686198158460724641052407506305826211156964723064441295969498221919251479211700941935114755531972677360157561485144237786816579422141378066423317811515462669946309306263409027388915931082226854264858661420878279983534424128672461206356847463821364630504359665171573635397346037274752410368174877433941234543153511100471651472869116068528478976916600585383497180172395573924789047989563714318957536493108041591460911612078698461739084741934442448701416575483263891529095158013233115648534154086009312190489168546024398834243847135102411661996020129557921444666343641039137906807591342742464200991933722791531063202677650581946360422027765645970182463780273161113009717582155489902677095053354207944772439271656447869921825959042801322775729022491402012084605367784456090892987682547811360481731795980637847551788259384243997341190753089343387201753821360405430310320564488741142120089460368986590136324737459372963666586532443570474179352656517635333744783401695951969936296323256525034685525470426185224036844803487442831639483152362831735350269624668701702424450940840884555271325190876102665277858154695092765613639718577127438538649414492678358762110235621776218781360881010654696273264706319088453035858355052988808507775439561385232652305316287705653436727647681405618323757201022946801118770148072424021385261829594248369890171583993147934044232792517118743393217276416179842097554494269012251329134783596037733973478306188255291484352384699871420472711423079586319041837563678498472779422282261024744394844558738378027105699691260086532632930941478779680554645850778168703661423819000515895232903243738763481571999080702098369316199601942246247887808385073821861517636839926907458184604648942036355256683219218129910422822177336785268627274482037476294341444562207197209503659518266210432791078248321015453218019586608696207295299183111963158564162419152742807437346241667671688466998244424726765837682151606230638111654756595917019206453978024157097042546937345673337179165242325399648121877178987723999503839197328183925340949191821443698275476295245249466361817367207248089144718808572152781037112209285944844021186534832159964297181970584453756163204297111185823467744743465840230098261424789313315093951766314459027947176701489215746884363426961577348384651887153140609616362927338107686794499974902581579897076172716541504294334300741444106749994715713419630688719451362658288812132056854807330827050505064714442618243101018812153563795539024370219967801515099970721926240625418512417940854760415566229746248973756297569452302821563467574313259066016089521122779204844875998864114930516063910324359331903843040069467324167490917499501000001/1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
-
-End of test
diff --git a/contrib/libg++/libg++/tests/tRational.inp b/contrib/libg++/libg++/tests/tRational.inp
deleted file mode 100644
index c6aff5c42011..000000000000
--- a/contrib/libg++/libg++/tests/tRational.inp
+++ /dev/null
@@ -1 +0,0 @@
-123455678/98765432
diff --git a/contrib/libg++/libg++/tests/tSet.cc b/contrib/libg++/libg++/tests/tSet.cc
deleted file mode 100644
index f05ca34086a7..000000000000
--- a/contrib/libg++/libg++/tests/tSet.cc
+++ /dev/null
@@ -1,744 +0,0 @@
-/*
- a test file for sets
-*/
-
-#ifdef PTIMES
-const int ptimes = 1;
-#else
-const int ptimes = 0;
-#endif
-
-#include <stream.h>
-#include <assert.h>
-#include <builtin.h>
-
-#define tassert(ex) { cerr << #ex; \
- if ((ex)) cerr << " OK\n"; \
- else cerr << " Fail\n"; }
-
-unsigned int hash(int x) { return multiplicativehash(x) ; }
-
-#include "iSet.h"
-
-int SIZE;
-
-int *nums;
-int *odds;
-int *dups;
-
-void printset(intSet& a)
-{
- int maxprint = 20;
- cout << "[";
- int k = 0;
- Pix i;
- for (i = a.first(); i != 0 && k < maxprint; a.next(i),++k)
- cout << a(i) << " ";
- if (i != 0) cout << "...]\n";
- else cout << "]\n";
-}
-
-void add(int x[], intSet& a)
-{
- for (int i = 0; i < SIZE; ++i) a.add(x[i]);
-}
-
-#include <MLCG.h>
-
-MLCG randgen;
-
-void permute(int x[])
-{
- for (int i = 1; i < SIZE; ++i)
- {
- int j = randgen.asLong() % (i + 1);
- int tmp = x[i]; x[i] = x[j]; x[j] = tmp;
- }
-}
-
-
-void makenums()
-{
- for (int i = 0; i < SIZE; ++i) nums[i] = i + 1;
-}
-
-void makeodds()
-{
- for (int i = 0; i < SIZE; ++i) odds[i] = 2 * i + 1;
- permute(odds);
-}
-
-void makedups()
-{
- for (int i = 0; i < SIZE; i += 2) dups[i] = dups[i+1] = i/2 + 1;
- permute(dups);
-}
-
-
-void generictest(intSet& a, intSet& b, intSet& c)
-{
- c.clear();
- assert(c.empty());
- c |= a;
- assert(c == a);
- assert(c <= a);
- c.del(a(a.first()));
- assert(c <= a);
- assert(c != a);
- Pix i = a.first();
- assert(!c.contains(a(i)));
- for (a.next(i); i != 0; a.next(i)) assert(c.contains(a(i)));
- c.add(a(a.first()));
- for (i = a.first(); i != 0; a.next(i)) assert(c.contains(a(i)));
- c |= b;
- assert(b <= c);
- for (i = b.first(); i != 0; b.next(i)) assert(c.contains(b(i)));
- for (i = a.first(); i != 0; a.next(i)) assert(c.contains(a(i)));
- c &= a;
- for (i = a.first(); i != 0; a.next(i)) assert(c.contains(a(i)));
- c -= a;
- assert(!(a <= c));
- for (i = a.first(); i != 0; a.next(i)) assert(!c.contains(a(i)));
- for (i = b.first(); i != 0; b.next(i)) c.del(b(i));
- assert(c.empty());
- assert(a.OK());
- assert(b.OK());
- assert(c.OK());
-}
-
-#include "iXPSet.h"
-
-void XPtest()
-{
- intXPSet a(SIZE);
- add(nums, a);
- assert(a.length() == SIZE);
- for (int j = 1; j <= SIZE; ++j) assert(a.contains(j));
- intXPSet b(SIZE);
- add(odds, b);
- assert(b.length() == SIZE);
- intXPSet c(SIZE);
- add(dups, c);
- assert(c.length() == SIZE/2);
- assert(c <= a);
- intXPSet d(a);
- d &= b;
- cout << "a: "; printset(a);
- cout << "b: "; printset(b);
- cout << "c: "; printset(c);
- cout << "d: "; printset(d);
- assert(d.length() == SIZE/2);
- for (Pix p = d.first(); p; d.next(p)) assert((d(p) & 1) != 0);
- a.del(1);
- assert(a.length() == SIZE-1);
- assert(!a.contains(1));
-
- c.clear();
- assert(c.empty());
- c |= a;
- assert(c == a);
- assert(c <= a);
- c.del(a(a.first()));
- assert(c <= a);
- assert(c != a);
- Pix i = a.first();
- assert(!c.contains(a(i)));
- for (a.next(i); i != 0; a.next(i)) assert(c.contains(a(i)));
- c.add(a(a.first()));
- for (i = a.first(); i != 0; a.next(i)) assert(c.contains(a(i)));
- c |= b;
- assert(b <= c);
- for (i = b.first(); i != 0; b.next(i)) assert(c.contains(b(i)));
- for (i = a.first(); i != 0; a.next(i)) assert(c.contains(a(i)));
- c &= a;
- for (i = a.first(); i != 0; a.next(i)) assert(c.contains(a(i)));
- c -= a;
- assert(!(a <= c));
- for (i = a.first(); i != 0; a.next(i)) assert(!c.contains(a(i)));
- for (i = b.first(); i != 0; b.next(i)) c.del(b(i));
- assert(c.empty());
- assert(a.OK());
- assert(b.OK());
- assert(c.OK());
-
- generictest(a, b, c);
-}
-
-
-#include "iSLSet.h"
-
-void SLtest()
-{
- intSLSet a;
- add(nums, a);
- assert(a.length() == SIZE);
- for (int j = 1; j <= SIZE; ++j) assert(a.contains(j));
- intSLSet b;
- add(odds, b);
- assert(b.length() == SIZE);
- intSLSet c;
- add(dups, c);
- assert(c.length() == SIZE/2);
- assert(c <= a);
- intSLSet d(a);
- d &= b;
- cout << "a: "; printset(a);
- cout << "b: "; printset(b);
- cout << "c: "; printset(c);
- cout << "d: "; printset(d);
- assert(d.length() == SIZE/2);
- for (Pix p = d.first(); p; d.next(p)) assert((d(p) & 1) != 0);
- a.del(1);
- assert(a.length() == SIZE-1);
- assert(!a.contains(1));
-
- c.clear();
- assert(c.empty());
- c |= a;
- assert(c == a);
- assert(c <= a);
- c.del(a(a.first()));
- assert(c <= a);
- assert(c != a);
- Pix i = a.first();
- assert(!c.contains(a(i)));
- for (a.next(i); i != 0; a.next(i)) assert(c.contains(a(i)));
- c.add(a(a.first()));
- for (i = a.first(); i != 0; a.next(i)) assert(c.contains(a(i)));
- c |= b;
- assert(b <= c);
- for (i = b.first(); i != 0; b.next(i)) assert(c.contains(b(i)));
- for (i = a.first(); i != 0; a.next(i)) assert(c.contains(a(i)));
- c &= a;
- for (i = a.first(); i != 0; a.next(i)) assert(c.contains(a(i)));
- c -= a;
- assert(!(a <= c));
- for (i = a.first(); i != 0; a.next(i)) assert(!c.contains(a(i)));
- for (i = b.first(); i != 0; b.next(i)) c.del(b(i));
- assert(c.empty());
- assert(a.OK());
- assert(b.OK());
- assert(c.OK());
-
- generictest(a, b, c);
-}
-
-
-#include "iVHSet.h"
-
-void VHtest()
-{
- intVHSet a(SIZE);
- add(nums, a);
- assert(a.length() == SIZE);
- for (int j = 1; j <= SIZE; ++j) assert(a.contains(j));
- intVHSet b(SIZE);
- add(odds, b);
- assert(b.length() == SIZE);
- intVHSet c(SIZE);
- add(dups, c);
- assert(c.length() == SIZE/2);
- assert(c <= a);
- intVHSet d(a);
- d &= b;
- cout << "a: "; printset(a);
- cout << "b: "; printset(b);
- cout << "c: "; printset(c);
- cout << "d: "; printset(d);
- assert(d.length() == SIZE/2);
- for (Pix p = d.first(); p; d.next(p)) assert((d(p) & 1) != 0);
- a.del(1);
- assert(a.length() == SIZE-1);
- assert(!a.contains(1));
-
- c.clear();
- assert(c.empty());
- c |= a;
- assert(c == a);
- assert(c <= a);
- c.del(a(a.first()));
- assert(c <= a);
- assert(c != a);
- Pix i = a.first();
- assert(!c.contains(a(i)));
- for (a.next(i); i != 0; a.next(i)) assert(c.contains(a(i)));
- c.add(a(a.first()));
- for (i = a.first(); i != 0; a.next(i)) assert(c.contains(a(i)));
- c |= b;
- assert(b <= c);
- for (i = b.first(); i != 0; b.next(i)) assert(c.contains(b(i)));
- for (i = a.first(); i != 0; a.next(i)) assert(c.contains(a(i)));
- c &= a;
- for (i = a.first(); i != 0; a.next(i)) assert(c.contains(a(i)));
- c -= a;
- assert(!(a <= c));
- for (i = a.first(); i != 0; a.next(i)) assert(!c.contains(a(i)));
- for (i = b.first(); i != 0; b.next(i)) c.del(b(i));
- assert(c.empty());
- assert(a.OK());
- assert(b.OK());
- assert(c.OK());
-
- generictest(a, b, c);
-}
-
-#include "iVOHSet.h"
-
-void VOHtest()
-{
- intVOHSet a(SIZE);
- add(nums, a);
- assert(a.length() == SIZE);
- for (int j = 1; j <= SIZE; ++j) assert(a.contains(j));
- intVOHSet b(SIZE);
- add(odds, b);
- assert(b.length() == SIZE);
- intVOHSet c(SIZE);
- add(dups, c);
- assert(c.length() == SIZE/2);
- assert(c <= a);
- intVOHSet d(a);
- d &= b;
- cout << "a: "; printset(a);
- cout << "b: "; printset(b);
- cout << "c: "; printset(c);
- cout << "d: "; printset(d);
- assert(d.length() == SIZE/2);
- for (Pix p = d.first(); p; d.next(p)) assert((d(p) & 1) != 0);
- a.del(1);
- assert(a.length() == SIZE-1);
- assert(!a.contains(1));
-
- c.clear();
- assert(c.empty());
- c |= a;
- assert(c == a);
- assert(c <= a);
- c.del(a(a.first()));
- assert(c <= a);
- assert(c != a);
- Pix i = a.first();
- assert(!c.contains(a(i)));
- for (a.next(i); i != 0; a.next(i)) assert(c.contains(a(i)));
- c.add(a(a.first()));
- for (i = a.first(); i != 0; a.next(i)) assert(c.contains(a(i)));
- c |= b;
- assert(b <= c);
- for (i = b.first(); i != 0; b.next(i)) assert(c.contains(b(i)));
- for (i = a.first(); i != 0; a.next(i)) assert(c.contains(a(i)));
- c &= a;
- for (i = a.first(); i != 0; a.next(i)) assert(c.contains(a(i)));
- c -= a;
- assert(!(a <= c));
- for (i = a.first(); i != 0; a.next(i)) assert(!c.contains(a(i)));
- for (i = b.first(); i != 0; b.next(i)) c.del(b(i));
- assert(c.empty());
- assert(a.OK());
- assert(b.OK());
- assert(c.OK());
-
- generictest(a, b, c);
-}
-
-#include "iCHSet.h"
-
-void CHtest()
-{
- intCHSet a(SIZE);
- add(nums, a);
- assert(a.length() == SIZE);
- for (int j = 1; j <= SIZE; ++j) assert(a.contains(j));
- intCHSet b(SIZE);
- add(odds, b);
- assert(b.length() == SIZE);
- intCHSet c(SIZE);
- add(dups, c);
- assert(c.length() == SIZE/2);
- assert(c <= a);
- intCHSet d(a);
- d &= b;
- cout << "a: "; printset(a);
- cout << "b: "; printset(b);
- cout << "c: "; printset(c);
- cout << "d: "; printset(d);
- assert(d.length() == SIZE/2);
- for (Pix p = d.first(); p; d.next(p)) assert((d(p) & 1) != 0);
- a.del(1);
- assert(a.length() == SIZE-1);
- assert(!a.contains(1));
-
- c.clear();
- assert(c.empty());
- c |= a;
- assert(c == a);
- assert(c <= a);
- c.del(a(a.first()));
- assert(c <= a);
- assert(c != a);
- Pix i = a.first();
- assert(!c.contains(a(i)));
- for (a.next(i); i != 0; a.next(i)) assert(c.contains(a(i)));
- c.add(a(a.first()));
- for (i = a.first(); i != 0; a.next(i)) assert(c.contains(a(i)));
- c |= b;
- assert(b <= c);
- for (i = b.first(); i != 0; b.next(i)) assert(c.contains(b(i)));
- for (i = a.first(); i != 0; a.next(i)) assert(c.contains(a(i)));
- c &= a;
- for (i = a.first(); i != 0; a.next(i)) assert(c.contains(a(i)));
- c -= a;
- assert(!(a <= c));
- for (i = a.first(); i != 0; a.next(i)) assert(!c.contains(a(i)));
- for (i = b.first(); i != 0; b.next(i)) c.del(b(i));
- assert(c.empty());
- assert(a.OK());
- assert(b.OK());
- assert(c.OK());
-
- generictest(a, b, c);
-}
-
-#include "iOXPSet.h"
-
-void OXPtest()
-{
- intOXPSet a(SIZE);
- add(nums, a);
- assert(a.length() == SIZE);
- for (int j = 1; j <= SIZE; ++j) assert(a.contains(j));
- intOXPSet b(SIZE);
- add(odds, b);
- assert(b.length() == SIZE);
- intOXPSet c(SIZE);
- add(dups, c);
- assert(c.length() == SIZE/2);
- assert(c <= a);
- intOXPSet d(a);
- d &= b;
- cout << "a: "; printset(a);
- cout << "b: "; printset(b);
- cout << "c: "; printset(c);
- cout << "d: "; printset(d);
- assert(d.length() == SIZE/2);
- for (Pix p = d.first(); p; d.next(p)) assert((d(p) & 1) != 0);
- a.del(1);
- assert(a.length() == SIZE-1);
- assert(!a.contains(1));
-
- c.clear();
- assert(c.empty());
- c |= a;
- assert(c == a);
- assert(c <= a);
- c.del(a(a.first()));
- assert(c <= a);
- assert(c != a);
- Pix i = a.first();
- assert(!c.contains(a(i)));
- for (a.next(i); i != 0; a.next(i)) assert(c.contains(a(i)));
- c.add(a(a.first()));
- for (i = a.first(); i != 0; a.next(i)) assert(c.contains(a(i)));
- c |= b;
- assert(b <= c);
- for (i = b.first(); i != 0; b.next(i)) assert(c.contains(b(i)));
- for (i = a.first(); i != 0; a.next(i)) assert(c.contains(a(i)));
- c &= a;
- for (i = a.first(); i != 0; a.next(i)) assert(c.contains(a(i)));
- c -= a;
- assert(!(a <= c));
- for (i = a.first(); i != 0; a.next(i)) assert(!c.contains(a(i)));
- for (i = b.first(); i != 0; b.next(i)) c.del(b(i));
- assert(c.empty());
- assert(a.OK());
- assert(b.OK());
- assert(c.OK());
-
- generictest(a, b, c);
-}
-
-
-
-#include "iOSLSet.h"
-
-void OSLtest()
-{
- intOSLSet a;
- add(nums, a);
- assert(a.length() == SIZE);
- for (int j = 1; j <= SIZE; ++j) assert(a.contains(j));
- intOSLSet b;
- add(odds, b);
- assert(b.length() == SIZE);
- intOSLSet c;
- add(dups, c);
- assert(c.length() == SIZE/2);
- assert(c <= a);
- intOSLSet d(a);
- d &= b;
- cout << "a: "; printset(a);
- cout << "b: "; printset(b);
- cout << "c: "; printset(c);
- cout << "d: "; printset(d);
- assert(d.length() == SIZE/2);
- for (Pix p = d.first(); p; d.next(p)) assert((d(p) & 1) != 0);
- a.del(1);
- assert(a.length() == SIZE-1);
- assert(!a.contains(1));
-
- c.clear();
- assert(c.empty());
- c |= a;
- assert(c == a);
- assert(c <= a);
- c.del(a(a.first()));
- assert(c <= a);
- assert(c != a);
- Pix i = a.first();
- assert(!c.contains(a(i)));
- for (a.next(i); i != 0; a.next(i)) assert(c.contains(a(i)));
- c.add(a(a.first()));
- for (i = a.first(); i != 0; a.next(i)) assert(c.contains(a(i)));
- c |= b;
- assert(b <= c);
- for (i = b.first(); i != 0; b.next(i)) assert(c.contains(b(i)));
- for (i = a.first(); i != 0; a.next(i)) assert(c.contains(a(i)));
- c &= a;
- for (i = a.first(); i != 0; a.next(i)) assert(c.contains(a(i)));
- c -= a;
- assert(!(a <= c));
- for (i = a.first(); i != 0; a.next(i)) assert(!c.contains(a(i)));
- for (i = b.first(); i != 0; b.next(i)) c.del(b(i));
- assert(c.empty());
- assert(a.OK());
- assert(b.OK());
- assert(c.OK());
-
- generictest(a, b, c);
-}
-
-#include "iBSTSet.h"
-
-void BSTtest()
-{
- intBSTSet a;
- add(nums, a);
- assert(a.length() == SIZE);
- for (int j = 1; j <= SIZE; ++j) assert(a.contains(j));
- a.balance();
- assert(a.OK());
- for (int j = 1; j <= SIZE; ++j) assert(a.contains(j));
- intBSTSet b;
- add(odds, b);
- assert(b.length() == SIZE);
- intBSTSet c;
- add(dups, c);
- assert(c.length() == SIZE/2);
- assert(c <= a);
- intBSTSet d(a);
- d &= b;
- cout << "a: "; printset(a);
- cout << "b: "; printset(b);
- cout << "c: "; printset(c);
- cout << "d: "; printset(d);
- assert(d.length() == SIZE/2);
- for (Pix p = d.first(); p; d.next(p)) assert((d(p) & 1) != 0);
- a.del(1);
- assert(a.length() == SIZE-1);
- assert(!a.contains(1));
-
- c.clear();
- assert(c.empty());
- c |= a;
- assert(c == a);
- assert(c <= a);
- c.del(a(a.first()));
- assert(c <= a);
- assert(c != a);
- Pix i = a.first();
- assert(!c.contains(a(i)));
- for (a.next(i); i != 0; a.next(i)) assert(c.contains(a(i)));
- c.add(a(a.first()));
- for (i = a.first(); i != 0; a.next(i)) assert(c.contains(a(i)));
- c |= b;
- assert(b <= c);
- for (i = b.first(); i != 0; b.next(i)) assert(c.contains(b(i)));
- for (i = a.first(); i != 0; a.next(i)) assert(c.contains(a(i)));
- c &= a;
- for (i = a.first(); i != 0; a.next(i)) assert(c.contains(a(i)));
- c -= a;
- assert(!(a <= c));
- for (i = a.first(); i != 0; a.next(i)) assert(!c.contains(a(i)));
- for (i = b.first(); i != 0; b.next(i)) c.del(b(i));
- assert(c.empty());
- assert(a.OK());
- assert(b.OK());
- assert(c.OK());
-
- generictest(a, b, c);
-}
-
-#include "iAVLSet.h"
-
-void AVLtest()
-{
- intAVLSet a;
- add(nums, a);
- assert(a.length() == SIZE);
- for (int j = 1; j <= SIZE; ++j) assert(a.contains(j));
- intAVLSet b;
- add(odds, b);
- assert(b.length() == SIZE);
- intAVLSet c;
- add(dups, c);
- assert(c.length() == SIZE/2);
- assert(c <= a);
- intAVLSet d(a);
- d &= b;
- cout << "a: "; printset(a);
- cout << "b: "; printset(b);
- cout << "c: "; printset(c);
- cout << "d: "; printset(d);
- assert(d.length() == SIZE/2);
- for (Pix p = d.first(); p; d.next(p)) assert((d(p) & 1) != 0);
- a.del(1);
- assert(a.length() == SIZE-1);
- assert(!a.contains(1));
-
- c.clear();
- assert(c.empty());
- c |= a;
- assert(c == a);
- assert(c <= a);
- c.del(a(a.first()));
- assert(c <= a);
- assert(c != a);
- Pix i = a.first();
- assert(!c.contains(a(i)));
- for (a.next(i); i != 0; a.next(i)) assert(c.contains(a(i)));
- c.add(a(a.first()));
- for (i = a.first(); i != 0; a.next(i)) assert(c.contains(a(i)));
- c |= b;
- assert(b <= c);
- for (i = b.first(); i != 0; b.next(i)) assert(c.contains(b(i)));
- for (i = a.first(); i != 0; a.next(i)) assert(c.contains(a(i)));
- c &= a;
- for (i = a.first(); i != 0; a.next(i)) assert(c.contains(a(i)));
- c -= a;
- assert(!(a <= c));
- for (i = a.first(); i != 0; a.next(i)) assert(!c.contains(a(i)));
- for (i = b.first(); i != 0; b.next(i)) c.del(b(i));
- assert(c.empty());
- assert(a.OK());
- assert(b.OK());
- assert(c.OK());
-
- generictest(a, b, c);
-}
-
-#include "iSplaySet.h"
-
-void Splaytest()
-{
- intSplaySet a;
- add(nums, a);
- assert(a.length() == SIZE);
- for (int j = 1; j <= SIZE; ++j) assert(a.contains(j));
- intSplaySet b;
- add(odds, b);
- assert(b.length() == SIZE);
- intSplaySet c;
- add(dups, c);
- assert(c.length() == SIZE/2);
- assert(c <= a);
- intSplaySet d(a);
- d &= b;
- cout << "a: "; printset(a);
- cout << "b: "; printset(b);
- cout << "c: "; printset(c);
- cout << "d: "; printset(d);
- assert(d.length() == SIZE/2);
- for (Pix p = d.first(); p; d.next(p)) assert((d(p) & 1) != 0);
- a.del(1);
- assert(a.length() == SIZE-1);
- assert(!a.contains(1));
-
- c.clear();
- assert(c.empty());
- c |= a;
- assert(c == a);
- assert(c <= a);
- c.del(a(a.first()));
- assert(c <= a);
- assert(c != a);
- Pix i = a.first();
- assert(!c.contains(a(i)));
- for (a.next(i); i != 0; a.next(i)) assert(c.contains(a(i)));
- c.add(a(a.first()));
- for (i = a.first(); i != 0; a.next(i)) assert(c.contains(a(i)));
- c |= b;
- assert(b <= c);
- for (i = b.first(); i != 0; b.next(i)) assert(c.contains(b(i)));
- for (i = a.first(); i != 0; a.next(i)) assert(c.contains(a(i)));
- c &= a;
- for (i = a.first(); i != 0; a.next(i)) assert(c.contains(a(i)));
- c -= a;
- assert(!(a <= c));
- for (i = a.first(); i != 0; a.next(i)) assert(!c.contains(a(i)));
- for (i = b.first(); i != 0; b.next(i)) c.del(b(i));
- assert(c.empty());
- assert(a.OK());
- assert(b.OK());
- assert(c.OK());
-
- generictest(a, b, c);
-}
-
-
-int main(int argc, char** argv)
-{
- if (argc > 1)
- {
- SIZE = abs(atoi(argv[1]));
- SIZE &= ~1;
- }
- else
- SIZE = 100;
- nums = new int[SIZE];
- odds = new int[SIZE];
- dups = new int[SIZE];
- makenums();
- makeodds();
- makedups();
- start_timer();
- cout << "VHtest\n"; VHtest();
- if (ptimes) cout << "\ntime = " << return_elapsed_time(0.0) << "\n";
- start_timer();
- cout << "VOHtest\n"; VOHtest();
- if (ptimes) cout << "\ntime = " << return_elapsed_time(0.0) << "\n";
- start_timer();
- cout << "CHtest\n"; CHtest();
- if (ptimes) cout << "\ntime = " << return_elapsed_time(0.0) << "\n";
- start_timer();
- cout << "SLtest\n"; SLtest();
- if (ptimes) cout << "\ntime = " << return_elapsed_time(0.0) << "\n";
- start_timer();
- cout << "XPtest\n"; XPtest();
- if (ptimes) cout << "\ntime = " << return_elapsed_time(0.0) << "\n";
- start_timer();
- cout << "OXPtest\n"; OXPtest();
- if (ptimes) cout << "\ntime = " << return_elapsed_time(0.0) << "\n";
- start_timer();
- cout << "OSLtest\n"; OSLtest();
- if (ptimes) cout << "\ntime = " << return_elapsed_time(0.0) << "\n";
- start_timer();
- cout << "BSTtest\n"; BSTtest();
- if (ptimes) cout << "\ntime = " << return_elapsed_time(0.0) << "\n";
- start_timer();
- cout << "AVLtest\n"; AVLtest();
- if (ptimes) cout << "\ntime = " << return_elapsed_time(0.0) << "\n";
- start_timer();
- cout << "Splaytest\n"; Splaytest();
- if (ptimes) cout << "\ntime = " << return_elapsed_time(0.0) << "\n";
-
- return 0;
-}
diff --git a/contrib/libg++/libg++/tests/tSet.exp b/contrib/libg++/libg++/tests/tSet.exp
deleted file mode 100644
index f014df48ec6e..000000000000
--- a/contrib/libg++/libg++/tests/tSet.exp
+++ /dev/null
@@ -1,50 +0,0 @@
-VHtest
-a: [72 77 13 3 26 16 39 29 52 42 65 55 78 91 9 22 35 48 61 74 ...]
-b: [167 77 13 3 193 39 139 29 93 47 65 55 155 109 91 9 117 171 35 143 ...]
-c: [36 49 46 3 26 16 39 29 12 42 19 32 9 1 22 35 48 25 2 15 ...]
-d: [13 3 39 29 65 55 91 9 35 61 15 41 67 25 93 11 47 87 37 73 ...]
-VOHtest
-a: [7 14 21 28 35 42 49 56 63 70 77 84 91 98 5 12 19 26 33 40 ...]
-b: [7 163 21 133 35 49 63 199 77 129 91 181 105 119 5 155 19 187 33 193 ...]
-c: [7 14 21 28 35 42 49 5 12 19 26 33 40 47 3 10 17 24 31 38 ...]
-d: [7 21 35 49 63 77 91 5 19 33 47 61 75 89 3 17 31 45 59 73 ...]
-CHtest
-a: [72 36 85 49 13 3 98 62 26 16 75 39 29 88 52 42 6 65 55 19 ...]
-b: [167 49 85 121 13 3 157 193 111 39 75 147 29 183 137 65 101 173 55 19 ...]
-c: [36 13 49 3 26 16 39 29 6 42 19 32 45 9 22 35 12 48 25 38 ...]
-d: [13 49 85 3 39 75 29 65 19 55 91 9 45 81 35 71 25 61 97 15 ...]
-SLtest
-a: [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ...]
-b: [3 197 151 161 81 69 27 37 189 147 13 75 181 117 173 11 191 185 101 105 ...]
-c: [33 2 48 18 37 5 35 49 1 12 50 9 31 26 10 42 17 13 11 21 ...]
-d: [1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 ...]
-XPtest
-a: [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ...]
-b: [3 197 151 161 81 69 27 37 189 147 13 75 181 117 173 11 191 185 101 105 ...]
-c: [33 2 48 18 37 5 35 49 1 12 50 9 31 26 10 42 17 13 11 21 ...]
-d: [51 13 53 27 55 7 57 29 59 15 61 31 63 1 65 33 67 17 69 35 ...]
-OXPtest
-a: [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ...]
-b: [1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 ...]
-c: [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ...]
-d: [1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 ...]
-OSLtest
-a: [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ...]
-b: [1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 ...]
-c: [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ...]
-d: [1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 ...]
-BSTtest
-a: [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ...]
-b: [1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 ...]
-c: [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ...]
-d: [1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 ...]
-AVLtest
-a: [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ...]
-b: [1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 ...]
-c: [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ...]
-d: [1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 ...]
-Splaytest
-a: [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ...]
-b: [1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 ...]
-c: [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ...]
-d: [1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 ...]
diff --git a/contrib/libg++/libg++/tests/tSet.inp b/contrib/libg++/libg++/tests/tSet.inp
deleted file mode 100644
index e69de29bb2d1..000000000000
--- a/contrib/libg++/libg++/tests/tSet.inp
+++ /dev/null
diff --git a/contrib/libg++/libg++/tests/tStack.cc b/contrib/libg++/libg++/tests/tStack.cc
deleted file mode 100644
index 7435ec1d0ff6..000000000000
--- a/contrib/libg++/libg++/tests/tStack.cc
+++ /dev/null
@@ -1,188 +0,0 @@
-/*
- test of stacks
-*/
-
-#ifdef PTIMES
-const int ptimes = 1;
-#else
-const int ptimes = 0;
-#endif
-
-#include <stream.h>
-#include <assert.h>
-#include "iStack.h"
-
-#define tassert(ex) {if ((ex)) cerr << #ex << "\n"; \
- else _assert(#ex, __FILE__,__LINE__); }
-
-
-int SIZE;
-
-void print(intStack& a)
-{
- int maxprint = 20;
- cout << "[";
- int k = 0;
- while (!a.empty() && k++ < maxprint)
- cout << a.pop() << " ";
- if (k == maxprint)
- cout << "]\n";
- else
- {
- while (!a.empty()) a.del_top();
- cout << "...]\n";
- }
- assert(a.empty());
-}
-
-#include "iXPStack.h"
-
-void XPtest ()
-{
- intXPStack s(SIZE/2);
- assert(s.OK());
- for (int i = 0; i < SIZE; ++i)
- s.push(i);
- assert(s.length() == SIZE);
- assert(s.top() == (SIZE-1));
- assert(!s.full());
- intXPStack s1(SIZE*2);
- for (int i = 0; i < SIZE; ++i)
- {
- int x = s.pop();
- assert(x == (SIZE-1) - i);
- s1.push(x);
- }
- assert(s.empty());
- assert(s1.length() == SIZE);
- assert(s1.top() == 0);
- assert(s.OK());
- assert(s1.OK());
- intXPStack s2 (s1);
- assert(s2.length() == SIZE);
- assert(s2.top() == 0);
- assert(s2.OK());
- s1.clear();
- assert(s1.empty());
- s1 = s2;
- assert(s1.length() == SIZE);
- assert(s1.top() == 0);
- assert(s1.OK());
- s1.del_top();
- assert(s1.length() == (SIZE-1));
- assert(s1.top() == 1);
- cout << "s1:"; print(s1);
- assert(s.OK());
- assert(s1.OK());
- assert(s2.OK());
-}
-
-#include "iVStack.h"
-
-
-void Vtest ()
-{
- intVStack s(SIZE);
- assert(s.OK());
- for (int i = 0; i < SIZE; ++i)
- s.push(i);
- assert(s.length() == SIZE);
- assert(s.top() == (SIZE-1));
- assert(s.full());
- intVStack s1(SIZE);
- for (int i = 0; i < SIZE; ++i)
- {
- int x = s.pop();
- assert(x == (SIZE-1) - i);
- s1.push(x);
- }
- assert(s.empty());
- assert(s1.length() == SIZE);
- assert(s1.top() == 0);
- assert(s.OK());
- assert(s1.OK());
- intVStack s2 (s1);
- assert(s2.length() == SIZE);
- assert(s2.top() == 0);
- assert(s2.OK());
- s1.clear();
- assert(s1.empty());
- s1 = s2;
- assert(s1.length() == SIZE);
- assert(s1.top() == 0);
- assert(s1.OK());
- s1.del_top();
- assert(s1.length() == (SIZE-1));
- assert(s1.top() == 1);
- cout << "s1:"; print(s1);
-
- assert(s.OK());
- assert(s1.OK());
- assert(s2.OK());
-}
-
-#include "iSLStack.h"
-
-void SLtest ()
-{
- intSLStack s;
- assert(s.OK());
- for (int i = 0; i < SIZE; ++i)
- s.push(i);
- assert(s.length() == SIZE);
- assert(s.top() == (SIZE-1));
- assert(!s.full());
- intSLStack s1;
- for (int i = 0; i < SIZE; ++i)
- {
- int x = s.pop();
- assert(x == (SIZE-1) - i);
- s1.push(x);
- }
- assert(s.empty());
- assert(s1.length() == SIZE);
- assert(s1.top() == 0);
- assert(s.OK());
- assert(s1.OK());
- intSLStack s2 (s1);
- assert(s2.length() == SIZE);
- assert(s2.top() == 0);
- assert(s2.OK());
- s1.clear();
- assert(s1.empty());
- s1 = s2;
- assert(s1.length() == SIZE);
- assert(s1.top() == 0);
- assert(s1.OK());
- s1.del_top();
- assert(s1.length() == (SIZE-1));
- assert(s1.top() == 1);
-
- cout << "s1:"; print(s1);
- assert(s.OK());
- assert(s1.OK());
- assert(s2.OK());
-}
-
-
-int main(int argv, char** argc)
-{
- if (argv > 1)
- {
- SIZE = abs(atoi(argc[1]));
- SIZE &= ~1;
- }
- else
- SIZE = 100;
- start_timer();
- cout << "XP stacks:\n"; XPtest();
- if (ptimes) cout << "\ntime = " << return_elapsed_time(0.0) << "\n";
- start_timer();
- cout << "V stacks:\n"; Vtest();
- if (ptimes) cout << "\ntime = " << return_elapsed_time(0.0) << "\n";
- start_timer();
- cout << "SL stacks:\n"; SLtest();
- if (ptimes) cout << "\ntime = " << return_elapsed_time(0.0) << "\n";
- cout << "\nEnd of test\n";
- return 0;
-}
diff --git a/contrib/libg++/libg++/tests/tStack.exp b/contrib/libg++/libg++/tests/tStack.exp
deleted file mode 100644
index a7a937abe850..000000000000
--- a/contrib/libg++/libg++/tests/tStack.exp
+++ /dev/null
@@ -1,8 +0,0 @@
-XP stacks:
-s1:[1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ...]
-V stacks:
-s1:[1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ...]
-SL stacks:
-s1:[1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ...]
-
-End of test
diff --git a/contrib/libg++/libg++/tests/tStack.inp b/contrib/libg++/libg++/tests/tStack.inp
deleted file mode 100644
index e69de29bb2d1..000000000000
--- a/contrib/libg++/libg++/tests/tStack.inp
+++ /dev/null
diff --git a/contrib/libg++/libg++/tests/tString.cc b/contrib/libg++/libg++/tests/tString.cc
deleted file mode 100644
index e3499bf39c7b..000000000000
--- a/contrib/libg++/libg++/tests/tString.cc
+++ /dev/null
@@ -1,416 +0,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-
-/*
- A test file for Strings
-*/
-
-#include <String.h>
-#include <stream.h> // see note below on `dec(20)' about why this will go away
-#include <std.h>
-#include <assert.h>
-
-// can't nicely echo assertions because they contain quotes
-
-#define tassert(ex) {if (!(ex)) \
- { cerr << "failed assertion at " << __LINE__ << "\n"; \
- abort(); } }
-
- String X = "Hello";
- String Y = "world";
- String N = "123";
- String c;
- char* s = ",";
- Regex r = "e[a-z]*o";
-
-void decltest()
-{
- String x;
- cout << "an empty String:" << x << "\n";
- assert(x.OK());
- assert(x == "");
-
- String y = "Hello";
- cout << "A string initialized to Hello:" << y << "\n";
- assert(y.OK());
- assert(y == "Hello");
-
- if (y[y.length()-1] == 'o')
- y = y + '\n';
- assert(y == "Hello\n");
- y = "Hello";
-
- String a = y;
- cout << "A string initialized to previous string:" << a << "\n";
- assert(a.OK());
- assert(a == "Hello");
- assert(a == y);
-
- String b (a.at(1, 2));
- cout << "A string initialized to previous string.at(1, 2):" << b << "\n";
- assert(b.OK());
- assert(b == "el");
-
- char ch = '@';
- String z(ch);
- cout << "A string initialized to @:" << z << "\n";
- assert(z.OK());
- assert(z == "@");
-
- // XXX: `dec' is obsolete. Since String.h includes iostream.h, and not
- // stream.h, we include stream.h in this file for the time being. This
- // test will be rewritten to be done the "right" way, but for now, let's
- // save some time and go the easy route.
- String n = dec(20);
- cout << "A string initialized to dec(20):" << n << "\n";
- assert(n.OK());
- assert(n == "20");
-
- int i = atoi(n);
- double f = atof(n);
- cout << "n = " << n << " atoi(n) = " << i << " atof(n) = " << f << "\n";
- assert(i == 20);
- assert(f == 20);
-
- assert(X.OK());
- assert(Y.OK());
- assert(x.OK());
- assert(y.OK());
- assert(z.OK());
- assert(n.OK());
- assert(r.OK());
-}
-
-void cattest()
-{
- String x = X;
- String y = Y;
- String z = x + y;
- cout << "z = x + y = " << z << "\n";
- assert(x.OK());
- assert(y.OK());
- assert(z.OK());
- assert(z == "Helloworld");
-
- x += y;
- cout << "x += y; x = " << x << "\n";
- assert(x.OK());
- assert(y.OK());
- assert(x == "Helloworld");
-
- y = Y;
- x = X;
- y.prepend(x);
- cout << "y.prepend(x); y = " << y << "\n";
- assert(y == "Helloworld");
-
- y = Y;
- x = X;
- cat(x, y, x, x);
- cout << "cat(x, y, x, x); x = " << x << "\n";
- assert(x == "HelloworldHello");
-
- y = Y;
- x = X;
- cat(y, x, x, x);
- cout << "cat(y, x, x, x); x = " << x << "\n";
- assert(x == "worldHelloHello");
-
- x = X;
- y = Y;
- z = x + s + ' ' + y.at("w") + y.after("w") + ".";
- cout << "z = x + s + + y.at(w) + y.after(w) + . = " << z << "\n";
- assert(z.OK());
- assert(z == "Hello, world.");
-
-}
-
-void comparetest()
-{
- String x = X;
- String y = Y;
- String n = N;
- String z = x + y;
-
- assert(x != y);
- assert(x == "Hello");
- assert(x != z.at(0, 4));
- assert (x < y);
- assert(!(x >= z.at(0, 6)));
- assert(x.contains("He"));
- assert (z.contains(x));
- assert(x.contains(r));
-
- assert(!(x.matches(r)));
- assert(x.matches(RXalpha));
- assert(!(n.matches(RXalpha)));
- assert(n.matches(RXint));
- assert(n.matches(RXdouble));
-
- assert(x.index("lo") == 3);
- assert(x.index("l", 2) == 2);
- assert(x.index("l", -1) == 3);
- assert(x.index(r) == 1);
- assert(x.index(r, -2) == 1);
-
- assert(x.contains("el", 1));
- assert(x.contains("el"));
-
- assert(common_prefix(x, "Help") == "Hel");
- assert(common_suffix(x, "to") == "o");
-
- assert(fcompare(x, "hELlo") == 0);
- assert(fcompare(x, "hElp") < 0);
-}
-
-void substrtest()
-{
- String x = X;
-
- char ch = x[0];
- cout << "ch = x[0] = " << ch << "\n";
- assert(ch == 'H');
-
- String z = x.at(2, 3);
- cout << "z = x.at(2, 3) = " << z << "\n";
- assert(z.OK());
- assert(z == "llo");
-
- x.at(2, 2) = "r";
- cout << "x.at(2, 2) = r; x = " << x << "\n";
- assert(x.OK());
- assert(x.at(2,2).OK());
- assert(x == "Hero");
-
- x = X;
- x.at(0, 1) = "j";
- cout << "x.at(0, 1) = j; x = " << x << "\n";
- assert(x.OK());
- assert(x == "jello");
-
- x = X;
- x.at("He") = "je";
- cout << "x.at(He) = je; x = " << x << "\n";
- assert(x.OK());
- assert(x == "jello");
-
- x = X;
- x.at("l", -1) = "i";
- cout << "x.at(l, -1) = i; x = " << x << "\n";
- assert(x.OK());
- assert(x == "Helio");
-
- x = X;
- z = x.at(r);
- cout << "z = x.at(r) = " << z << "\n";
- assert(z.OK());
- assert(z == "ello");
-
- z = x.before("o");
- cout << "z = x.before(o) = " << z << "\n";
- assert(z.OK());
- assert(z == "Hell");
-
- x.before("ll") = "Bri";
- cout << "x.before(ll) = Bri; x = " << x << "\n";
- assert(x.OK());
- assert(x == "Brillo");
-
- x = X;
- z = x.before(2);
- cout << "z = x.before(2) = " << z << "\n";
- assert(z.OK());
- assert(z == "He");
-
- z = x.after("Hel");
- cout << "z = x.after(Hel) = " << z << "\n";
- assert(z.OK());
- assert(z == "lo");
-
- x.after("Hel") = "p";
- cout << "x.after(Hel) = p; x = " << x << "\n";
- assert(x.OK());
- assert(x == "Help");
-
- x = X;
- z = x.after(3);
- cout << "z = x.after(3) = " << z << "\n";
- assert(z.OK());
- assert(z == "o");
-
- z = " a bc";
- z = z.after(RXwhite);
- cout << "z = a bc; z = z.after(RXwhite); z =" << z << "\n";
- assert(z.OK());
- assert(z == "a bc");
-}
-
-
-void utiltest()
-{
- String x = X;
- int matches = x.gsub("l", "ll");
- cout << "x.gsub(l, ll); x = " << x << "\n";
- assert(x.OK());
- assert(matches == 2);
- assert(x == "Hellllo");
-
- x = X;
- assert(x.OK());
- matches = x.gsub(r, "ello should have been replaced by this string");
- assert(x.OK());
- cout << "x.gsub(r, ...); x = " << x << "\n";
- assert(x.OK());
- assert(matches == 1);
- assert(x == "Hello should have been replaced by this string");
-
- matches = x.gsub(RXwhite, "#");
- cout << "x.gsub(RXwhite, #); x = " << x << "\n";
- assert(matches == 7);
- assert(x.OK());
-
- String z = X + Y;
- z.del("loworl");
- cout << "z = x+y; z.del(loworl); z = " << z << "\n";
- assert(z.OK());
- assert(z == "Held");
-
- x = X;
- z = reverse(x);
- cout << "reverse(x) = " << z << "\n";
- assert(z.OK());
- assert(z == "olleH");
-
- x.reverse();
- cout << "x.reverse() = " << x << "\n";
- assert(x.OK());
- assert(x == z);
-
- x = X;
- z = upcase(x);
- cout << "upcase(x) = " << z << "\n";
- assert(z.OK());
- assert(z == "HELLO");
-
- z = downcase(x);
- cout << "downcase(x) = " << z << "\n";
- assert(z.OK());
- assert(z == "hello");
-
- z = capitalize(x);
- cout << "capitalize(x) = " << z << "\n";
- assert(z.OK());
- assert(z == "Hello");
-
- /* Let's see how apostrophe is handled. */
- z = "he asked:'this is nathan's book?'. 'no, it's not',i said.";
- cout << "capitalize(z) = " << capitalize (z) << "\n";
-
- z = replicate('*', 10);
- cout << "z = replicate(*, 10) = " << z << "\n";
- assert(z.OK());
- assert(z == "**********");
- assert(z.length() == 10);
-}
-
-void splittest()
-{
- String z = "This string\thas\nfive words";
- cout << "z = " << z << "\n";
- String w[10];
- int nw = split(z, w, 10, RXwhite);
- assert(nw == 5);
- cout << "from split(z, RXwhite, w, 10), n words = " << nw << ":\n";
- for (int i = 0; i < nw; ++i)
- {
- assert(w[i].OK());
- cout << w[i] << "\n";
- }
- assert(w[0] == "This");
- assert(w[1] == "string");
- assert(w[2] == "has");
- assert(w[3] == "five");
- assert(w[4] == "words");
- assert(w[5] == (char*)0);
-
- z = join(w, nw, "/");
- cout << "z = join(w, nw, /); z =" << z << "\n";
- assert(z.OK());
- assert(z == "This/string/has/five/words");
-}
-
-
-void iotest()
-{
- String z;
- cout << "enter a word:";
- cin >> z;
- cout << "word =" << z << " ";
- cout << "length = " << z.length() << "\n";
-}
-
-void identitytest(String a, String b)
-{
- String x = a;
- String y = b;
- x += b;
- y.prepend(a);
- assert((a + b) == x);
- assert((a + b) == y);
- assert(x == y);
- assert(x.after(a) == b);
- assert(x.before(b, -1) == a);
- assert(x.from(a) == x);
- assert(x.through(b, -1) == x);
- assert(x.at(a) == a);
- assert(x.at(b) == b);
-
- assert(reverse(x) == reverse(b) + reverse(a));
-
- assert((a + b + a) == (a + (b + a)));
-
- x.del(b, -1);
- assert(x == a);
-
- y.before(b, -1) = b;
- assert(y == (b + b));
- y.at(b) = a;
- assert(y == (a + b));
-
- x = a + reverse(a);
- for (int i = 0; i < 7; ++i)
- {
- y = x;
- x += x;
- assert(x.OK());
- assert(x == reverse(x));
- assert(x.index(y) == 0);
- assert(x.index(y, -1) == x.length() / 2);
- }
-}
-
-void freqtest()
-{
- String x = "Hello World";
- SubString y = x.at(0,5);
- assert(x.freq('l') == 3); // char
- assert(x.freq("lo") == 1); // char*
- assert(x.freq(x) == 1); // String
- assert(x.freq(y) == 1); // SubString
-}
-
-int main()
-{
- decltest();
- cattest();
- comparetest();
- substrtest();
- utiltest();
- splittest();
- freqtest();
- identitytest(X, X);
- identitytest(X, Y);
- identitytest(X+Y+N+X+Y+N, "A string that will be used in identitytest but is otherwise just another useless string.");
- iotest();
- cout << "\nEnd of test\n";
- return 0;
-}
diff --git a/contrib/libg++/libg++/tests/tString.exp b/contrib/libg++/libg++/tests/tString.exp
deleted file mode 100644
index 4f06ffacb667..000000000000
--- a/contrib/libg++/libg++/tests/tString.exp
+++ /dev/null
@@ -1,50 +0,0 @@
-an empty String:
-A string initialized to Hello:Hello
-A string initialized to previous string:Hello
-A string initialized to previous string.at(1, 2):el
-A string initialized to @:@
-A string initialized to dec(20):20
-n = 20 atoi(n) = 20 atof(n) = 20
-z = x + y = Helloworld
-x += y; x = Helloworld
-y.prepend(x); y = Helloworld
-cat(x, y, x, x); x = HelloworldHello
-cat(y, x, x, x); x = worldHelloHello
-z = x + s + + y.at(w) + y.after(w) + . = Hello, world.
-ch = x[0] = H
-z = x.at(2, 3) = llo
-x.at(2, 2) = r; x = Hero
-x.at(0, 1) = j; x = jello
-x.at(He) = je; x = jello
-x.at(l, -1) = i; x = Helio
-z = x.at(r) = ello
-z = x.before(o) = Hell
-x.before(ll) = Bri; x = Brillo
-z = x.before(2) = He
-z = x.after(Hel) = lo
-x.after(Hel) = p; x = Help
-z = x.after(3) = o
-z = a bc; z = z.after(RXwhite); z =a bc
-x.gsub(l, ll); x = Hellllo
-x.gsub(r, ...); x = Hello should have been replaced by this string
-x.gsub(RXwhite, #); x = Hello#should#have#been#replaced#by#this#string
-z = x+y; z.del(loworl); z = Held
-reverse(x) = olleH
-x.reverse() = olleH
-upcase(x) = HELLO
-downcase(x) = hello
-capitalize(x) = Hello
-capitalize(z) = He Asked:'This Is Nathan's Book?'. 'No, It's Not',I Said.
-z = replicate(*, 10) = **********
-z = This string has
-five words
-from split(z, RXwhite, w, 10), n words = 5:
-This
-string
-has
-five
-words
-z = join(w, nw, /); z =This/string/has/five/words
-enter a word:word =abcdefghijklmnopqrstuvwxyz length = 26
-
-End of test
diff --git a/contrib/libg++/libg++/tests/tString.inp b/contrib/libg++/libg++/tests/tString.inp
deleted file mode 100644
index b0883f382e1a..000000000000
--- a/contrib/libg++/libg++/tests/tString.inp
+++ /dev/null
@@ -1 +0,0 @@
-abcdefghijklmnopqrstuvwxyz
diff --git a/contrib/libg++/libg++/tests/tVec.cc b/contrib/libg++/libg++/tests/tVec.cc
deleted file mode 100644
index 54b27564a91b..000000000000
--- a/contrib/libg++/libg++/tests/tVec.cc
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- test/demo of Vecs, AVecs
-*/
-
-#include <stream.h>
-#include "iVec.h"
-#include "iAVec.h"
-
-int int_compare(int a, int b)
-{
- return a - b;
-}
-
-int plus(int a, int b)
-{
- return a + b;
-}
-
-int inc(int a)
-{
- return a + 1;
-}
-
-void printint(int a)
-{
- cout << a << " ";
-}
-
-void print(intVec a)
-{
- a.apply(printint);
- cout << "\n";
-}
-
-#include <MLCG.h>
-
-MLCG randgen;
-
-int main()
-{
- intVec a(20);
- int i;
- for (i = 0; i < a.capacity(); ++i) a[i] = randgen.asLong() % 100;
- cout << "a: "; print(a);
- a.sort(int_compare);
- cout << "a.sort():"; print(a);
- intVec b = map(inc, a);
- cout << "b = map(inc, a): "; print(b);
- intVec c = merge(a, b, int_compare);
- cout << "c = merge(a, b): "; print(c);
- intVec d = concat(a, b);
- cout << "d = concat(a, b): "; print(d);
- d.resize(10);
- cout << "d.resize(10): "; print(d);
- d.reverse();
- cout << "d.reverse(): "; print(d);
- d.fill(0, 4, 4);
- cout << "d.fill(0, 4, 4): "; print(d);
- cout << "d.reduce(plus, 0) = " << d.reduce(plus, 0) << "\n";
- intVec e = d.at(2, 5);
- cout << "e = d.at(2, 5): "; print(e);
-
- intAVec x(20);
- for (i = 0; i < x.capacity(); ++i) x[i] = i;
- cout << "x: "; print(x);
- intAVec y(20);
- for (i = 0; i < y.capacity(); ++i) y[i] = randgen.asLong() % 100 + 1;
- cout << "y: "; print(y);
-
- cout << "x + y: "; print(x + y);
- cout << "x - y: "; print(x - y);
- cout << "product(x, y): "; print(product(x,y));
- cout << "quotient(x, y): "; print(quotient(x,y));
- cout << "x * y: " << (x * y) << "\n";
-
- cout << "x + 2: "; print(x + 2);
- cout << "x - 2: "; print(x - 2);
- cout << "x * 2: "; print(x * 2);
- cout << "x / 2: "; print(x / 2);
-
- intAVec z(20, 1);
- cout << "z(20, 1): "; print(z);
- cout << "z = -z: "; print(z = -z);
- cout << "z += x: "; print(z += x);
- cout << "z -= x: "; print(z -= x);
-
- cout << "x.sum(): " << x.sum() << "\n";
- cout << "x.sumsq(): " << x.sumsq() << "\n";
- cout << "x.min(): " << x.min() << "\n";
- cout << "x.max(): " << x.max() << "\n";
- cout << "x.min_index(): " << x.min_index() << "\n";
- cout << "x.max_index(): " << x.max_index() << "\n";
-
- cout << "\nEnd of test\n";
- return 0;
-}
diff --git a/contrib/libg++/libg++/tests/tVec.exp b/contrib/libg++/libg++/tests/tVec.exp
deleted file mode 100644
index 9a65566e9537..000000000000
--- a/contrib/libg++/libg++/tests/tVec.exp
+++ /dev/null
@@ -1,33 +0,0 @@
-a: 72 14 71 72 81 29 86 49 59 84 69 10 94 41 69 95 57 78 62 82
-a.sort():10 14 29 41 49 57 59 62 69 69 71 72 72 78 81 82 84 86 94 95
-b = map(inc, a): 11 15 30 42 50 58 60 63 70 70 72 73 73 79 82 83 85 87 95 96
-c = merge(a, b): 10 11 14 15 29 30 41 42 49 50 57 58 59 60 62 63 69 69 70 70 71 72 72 72 73 73 78 79 81 82 82 83 84 85 86 87 94 95 95 96
-d = concat(a, b): 10 14 29 41 49 57 59 62 69 69 71 72 72 78 81 82 84 86 94 95 11 15 30 42 50 58 60 63 70 70 72 73 73 79 82 83 85 87 95 96
-d.resize(10): 10 14 29 41 49 57 59 62 69 69
-d.reverse(): 69 69 62 59 57 49 41 29 14 10
-d.fill(0, 4, 4): 69 69 62 59 0 0 0 0 14 10
-d.reduce(plus, 0) = 283
-e = d.at(2, 5): 62 59 0 0 0
-x: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
-y: 93 96 14 74 87 41 65 6 38 17 63 37 73 46 34 50 38 55 15 76
-x + y: 93 97 16 77 91 46 71 13 46 26 73 48 85 59 48 65 54 72 33 95
-x - y: -93 -95 -12 -71 -83 -36 -59 1 -30 -8 -53 -26 -61 -33 -20 -35 -22 -38 3 -57
-product(x, y): 0 96 28 222 348 205 390 42 304 153 630 407 876 598 476 750 608 935 270 1444
-quotient(x, y): 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0
-x * y: 8782
-x + 2: 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
-x - 2: -2 -1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
-x * 2: 0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38
-x / 2: 0 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9
-z(20, 1): 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
-z = -z: -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-z += x: -1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
-z -= x: -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-x.sum(): 190
-x.sumsq(): 2470
-x.min(): 0
-x.max(): 19
-x.min_index(): 0
-x.max_index(): 19
-
-End of test
diff --git a/contrib/libg++/libg++/tests/tVec.inp b/contrib/libg++/libg++/tests/tVec.inp
deleted file mode 100644
index e69de29bb2d1..000000000000
--- a/contrib/libg++/libg++/tests/tVec.inp
+++ /dev/null
diff --git a/contrib/libg++/libg++/tests/test_h.cc b/contrib/libg++/libg++/tests/test_h.cc
deleted file mode 100644
index 10cac9b90900..000000000000
--- a/contrib/libg++/libg++/tests/test_h.cc
+++ /dev/null
@@ -1,102 +0,0 @@
-// Use all the g++ headerfiles
-
-// $Author: jason $
-// $Revision: 1.17 $
-// $Date: 1995/06/11 19:23:13 $
-
-#include <_G_config.h>
-// If we have the old iostream library, it defines _OLD_STREAMS
-#include <stream.h>
-
-#include <std.h>
-
-#include <sys/types.h>
-#include <sys/time.h>
-#include <sys/file.h>
-#if _G_HAVE_SYS_WAIT
-#include <sys/wait.h>
-#endif
-#include <sys/signal.h>
-#include <sys/stat.h>
-#include <sys/times.h>
-
-#ifdef _OLD_STREAMS
-#include <PlotFile.h>
-#include <File.h>
-#include <Filebuf.h>
-#include <Fmodes.h>
-#include <filebuf.h>
-#include <SFile.h>
-#endif
-
-#include <ACG.h>
-#include <Fix.h>
-#include <MLCG.h>
-#include <AllocRing.h>
-#include <Binomial.h>
-#include <BitSet.h>
-#include <BitString.h>
-#include <Complex.h>
-#include <DiscUnif.h>
-#include <Erlang.h>
-#include <GetOpt.h>
-#include <Fix16.h>
-#include <Fix24.h>
-#include <Geom.h>
-#include <Rational.h>
-#include <HypGeom.h>
-#include <Integer.h>
-#include <Incremental.h>
-#include <LogNorm.h>
-#include <NegExp.h>
-#include <Normal.h>
-#include <Obstack.h>
-#include <Pix.h>
-#include <SmplHist.h>
-#include <Poisson.h>
-#include <RNG.h>
-#include <Random.h>
-#include <SmplStat.h>
-#include <Regex.h>
-#include <RndInt.h>
-#include <builtin.h>
-#include <String.h>
-#include <Uniform.h>
-#include <Weibull.h>
-
-#include <assert.h>
-#include <libc.h>
-#include <compare.h>
-#include <ctype.h>
-#include <errno.h>
-#include <generic.h>
-#include <grp.h>
-#include <getpagesize.h>
-#include <time.h>
-#include <math.h>
-#include <minmax.h>
-#include <new.h>
-#include <osfcn.h>
-#include <pwd.h>
-#include <setjmp.h>
-#include <signal.h>
-#include <stdarg.h>
-#include <stddef.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <strclass.h>
-#include <string.h>
-#include <swap.h>
-#include <unistd.h>
-#include <limits.h>
-#ifdef _IO_MAGIC
-#include <istream.h>
-#include <streambuf.h>
-#include <ostream.h>
-#endif
-
-main()
-{
- cout << "Could include all g++-include files\n";
- exit (0);
-}
diff --git a/contrib/libg++/libg++/tests/tiLList.cc b/contrib/libg++/libg++/tests/tiLList.cc
deleted file mode 100644
index d9f43ca7e81d..000000000000
--- a/contrib/libg++/libg++/tests/tiLList.cc
+++ /dev/null
@@ -1,271 +0,0 @@
-#include <_G_config.h>
-
-#ifdef _G_NO_TEMPLATESS
-
-main()
-{
- fprintf(stderr, "(template-based classes not available)\n");
- return 0;
-}
-#else
-
-/*
- test/demo of linked structures
-*/
-
-
-#include <assert.h>
-
-#define tassert(ex) {if ((ex)) cerr << #ex << "\n"; \
- else _assert(#ex, __FILE__,__LINE__); }
-
-#include <iostream.h>
-#include "SLList.h"
-#include "DLList.h"
-
-void printlist(SLList<int>& l)
-{
- for (Pix p = l.first(); p != 0; l.next(p)) cout << l(p) << " ";
- cout << "\n";
-}
-
-
-void SLtest()
-{
- int i;
- SLList<int> a;
- assert(a.OK());
- assert(a.empty());
- cout << "prepending...\n";
- for (i = 0; i < 10; ++i)
- {
- assert(a.length() == i);
- a.prepend(i);
- assert(a.front() == i);
- }
- cout << "a: "; printlist(a);
- cout << "appending...\n";
- for (i = 0; i < 10; ++i)
- {
- assert(a.length() == 10 + i);
- a.append(i);
- assert(a.rear() == i);
- }
- cout << "a: "; printlist(a);
- SLList<int> b = a;
- cout << "b = a: " << "\n"; printlist(b);
- assert(b.OK());
- assert(b.length() == a.length());
- assert(b.front() == a.front());
- assert(b.rear() == a.rear());
- cout << "remove_front of first 10 elements:\n";
- for (i = 0; i < 10; ++i)
- {
- assert(b.length() == 20 - i);
- assert(b.front() == 9 - i);
- b.remove_front();
- }
- assert(b.length() == 10);
- cout << "b: "; printlist(b);
-
- cout << "inserting 100 after sixth element...\n";
- Pix bp = b.first();
- for (i = 0; i < 5; ++i) b.next(bp);
- b.ins_after(bp, 100);
- assert(b.length() == 11);
- cout << "b: "; printlist(b);
- a.join(b);
- cout << "after a.join(b)\n"; printlist(a);
- assert(b.empty());
- assert(a.length() == 31);
- cout << "b: " << "\n"; printlist(b);
- b.prepend(999);
- cout << "b: " << "\n"; printlist(b);
- assert(b.length() == 1);
- assert(b.front() == 999);
- assert(b.rear() == 999);
- assert(b.OK());
- SLList<int> bb = b;
- cout << "bb: " << "\n"; printlist(bb);
- assert(bb.OK());
- assert(bb.length() == 1);
- assert(bb.front() == 999);
- assert(bb.rear() == 999);
- assert(bb.remove_front() == 999);
- b.prepend(1234);
- assert(b.length() == 2);
- b.del_after(b.first());
- assert(b.rear() == 1234);
- assert(b.length() == 1);
- b.del_after(0);
- assert(b.length() == 0);
-
- assert(a.OK());
- assert(b.OK());
- assert(bb.OK());
-}
-
-void printDlist(DLList<int>& l)
-{
- for (Pix p = l.first(); p != 0; l.next(p)) cout << l(p) << " ";
- cout << "\n";
-}
-
-void DLtest()
-{
- int i;
- DLList<int> a;
- assert(a.OK());
- assert(a.empty());
- assert(a.length() == 0);
- cout << "prepending...\n";
- for (i = 0; i < 10; ++i)
- {
- assert(a.length() == i);
- a.prepend(i);
- assert(a.front() == i);
- }
- cout << "a: " << "\n"; printDlist(a);
- cout << "appending...\n";
- for (i = 0; i < 10; ++i)
- {
- assert(a.length() == 10 + i);
- a.append(i);
- assert(a.rear() == i);
- }
- cout << "a: "; printDlist(a);
- DLList<int> b = a;
- assert(b.OK());
- assert(b.length() == a.length());
- assert(b.front() == a.front());
- assert(b.rear() == a.rear());
- cout << "b = a: "; printDlist(b);
- cout << "remove_front of first 10 elements:\n";
- for (i = 0; i < 10; ++i)
- {
- assert(b.length() == 20 - i);
- assert(b.front() == 9 - i);
- b.remove_front();
- }
- assert(b.length() == 10);
- cout << "b: "; printDlist(b);
-
- cout << "inserting 100 after sixth element...\n";
- Pix bp = b.first();
- for (i = 0; i < 5; ++i) b.next(bp);
- b.ins_after(bp, 100);
- assert(b.length() == 11);
- cout << "b: "; printDlist(b);
- DLList<int> aa = a;
- aa.join(b);
- cout << "after aa = a; aa.join(b)\n"; printDlist(aa);
- assert(aa.length() == 31);
- assert(b.empty());
- cout << "b: " << "\n"; printDlist(b);
- b.prepend(999);
- cout << "b: " << "\n"; printDlist(b);
- assert(b.length() == 1);
- assert(b.front() == 999);
- assert(b.rear() == 999);
- assert(b.OK());
- DLList<int> bb = b;
- cout << "bb: " << "\n"; printDlist(bb);
- assert(bb.OK());
- assert(bb.length() == 1);
- assert(bb.front() == 999);
- assert(bb.rear() == 999);
- assert(bb.remove_front() == 999);
- assert(bb.OK());
- b.prepend(1234);
- assert(b.length() == 2);
- bp = b.first();
- b.next(bp);
- b.del(bp, -1);
- assert(b.rear() == 1234);
- assert(b.length() == 1);
- b.del(bp);
- assert(b.length() == 0);
-
- DLList<int> z = a;
- cout << "z = a: "; printDlist(z);
- assert(z.OK());
- assert(z.length() == 20);
- cout << "remove_rear of last 10 elements:\n";
- for (i = 0; i < 10; ++i)
- {
- assert(z.length() == 20 - i);
- assert(z.rear() == 9 - i);
- z.remove_rear();
- }
- assert(z.length() == 10);
-
- cout << "z: "; printDlist(z);
-
- cout << "inserting 100 before alternate elements...\n";
- Pix zp;
- for (zp = z.first(); zp; z.next(zp))
- {
- z.ins_before(zp, 100);
- }
- assert(z.length() == 20);
- cout << "z: "; printDlist(z);
-
- cout << "inserting 200 after sixth element...\n";
- zp = z.first();
- for (i = 0; i < 5; ++i) z.next(zp);
- z.ins_after(zp, 200);
- assert(z.length() == 21);
- cout << "z: "; printDlist(z);
-
- cout << "deleting alternate elements of z...";
- for (zp = z.first(); zp; z.next(zp))
- {
- cout << z(zp) << " ";
- z.del(zp);
- }
- cout << "\n";
- assert(z.length() == 10);
- cout << "z: "; printDlist(z);
-
- cout << "z in reverse order:\n";
- for (zp = z.last(); zp; z.prev(zp)) cout << z(zp) << " ";
- cout << "\n";
- z.clear();
- assert(z.OK());
- assert(z.empty());
- assert(a.OK());
- assert(b.OK());
-}
-
-class X
-{
-public:
- X() { cout << "default ctor called\n"; }
- X(const X&) { cout << "copy ctor called\n"; }
- ~X() { cout << "dtor called\n"; }
-};
-
-main()
-{
- SLtest();
- DLtest();
-
- cout << "\n";
- /* Test case from Magnus Nordborg <magnus@mimer.cap.ed.ac.uk> */
- DLList<X> l;
- l.append(X());
- Pix f = l.first();
- l.del(f);
-
- cout << "\nEnd of test\n";
- return 0;
-}
-
-template class SLNode<int>;
-template class SLList<int>;
-template class DLNode<int>;
-template class DLList<int>;
-
-template class DLNode<X>;
-template class DLList<X>;
-#endif
diff --git a/contrib/libg++/libg++/tests/tiLList.exp b/contrib/libg++/libg++/tests/tiLList.exp
deleted file mode 100644
index 2e7646e5c04b..000000000000
--- a/contrib/libg++/libg++/tests/tiLList.exp
+++ /dev/null
@@ -1,54 +0,0 @@
-prepending...
-a: 9 8 7 6 5 4 3 2 1 0
-appending...
-a: 9 8 7 6 5 4 3 2 1 0 0 1 2 3 4 5 6 7 8 9
-b = a:
-9 8 7 6 5 4 3 2 1 0 0 1 2 3 4 5 6 7 8 9
-remove_front of first 10 elements:
-b: 0 1 2 3 4 5 6 7 8 9
-inserting 100 after sixth element...
-b: 0 1 2 3 4 5 100 6 7 8 9
-after a.join(b)
-9 8 7 6 5 4 3 2 1 0 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 100 6 7 8 9
-b:
-
-b:
-999
-bb:
-999
-prepending...
-a:
-9 8 7 6 5 4 3 2 1 0
-appending...
-a: 9 8 7 6 5 4 3 2 1 0 0 1 2 3 4 5 6 7 8 9
-b = a: 9 8 7 6 5 4 3 2 1 0 0 1 2 3 4 5 6 7 8 9
-remove_front of first 10 elements:
-b: 0 1 2 3 4 5 6 7 8 9
-inserting 100 after sixth element...
-b: 0 1 2 3 4 5 100 6 7 8 9
-after aa = a; aa.join(b)
-9 8 7 6 5 4 3 2 1 0 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 100 6 7 8 9
-b:
-
-b:
-999
-bb:
-999
-z = a: 9 8 7 6 5 4 3 2 1 0 0 1 2 3 4 5 6 7 8 9
-remove_rear of last 10 elements:
-z: 9 8 7 6 5 4 3 2 1 0
-inserting 100 before alternate elements...
-z: 100 9 100 8 100 7 100 6 100 5 100 4 100 3 100 2 100 1 100 0
-inserting 200 after sixth element...
-z: 100 9 100 8 100 7 200 100 6 100 5 100 4 100 3 100 2 100 1 100 0
-deleting alternate elements of z...100 100 100 200 6 5 4 3 2 1 0
-z: 9 8 7 100 100 100 100 100 100 100
-z in reverse order:
-100 100 100 100 100 100 100 7 8 9
-
-default ctor called
-copy ctor called
-dtor called
-dtor called
-
-End of test
diff --git a/contrib/libg++/libiberty/ChangeLog b/contrib/libg++/libiberty/ChangeLog
deleted file mode 100644
index ec5098021bca..000000000000
--- a/contrib/libg++/libiberty/ChangeLog
+++ /dev/null
@@ -1,1872 +0,0 @@
-Mon Jun 10 13:17:17 1996 Doug Evans <dje@canuck.cygnus.com>
-
- * pexecute.c: New file.
-
-Wed Jun 5 16:57:45 1996 Richard Henderson <rth@tamu.edu>
-
- * xmalloc.c: Declare sbrk.
-
-Sat May 4 05:08:45 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
-
- * alloca-norm.h: Add SPARCworks cc compatible __builtin_alloca
- declaration.
-
-Mon Apr 22 18:41:49 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * xstrerror.c: Include <stdio.h>.
-
-Sun Apr 21 11:55:12 1996 Doug Evans <dje@canuck.cygnus.com>
-
- * Makefile.in (CFILES): Add atexit.c.
-
-Sun Apr 21 09:50:09 1996 Stephen L Moshier (moshier@world.std.com)
-
- * choose-temp.c: Include sys/types.h before sys/file.h for sco3.2v5.
-
-Wed Apr 17 11:17:55 1996 Doug Evans <dje@canuck.cygnus.com>
-
- * choose-temp.c: Don't #include sys/file.h ifdef NO_SYS_FILE_H.
- #include <stdio.h>
- * config/mt-vxworks5 (HDEFINES): Define NO_SYS_FILE_H.
-
-Tue Apr 16 11:27:16 1996 Jeffrey A Law (law@cygnus.com)
-
- * Makefile.in (lneeded-list): If alloca.o is needed, so is xmalloc.o.
- Reverts Feb 8, 1995 change.
-
-Mon Apr 15 12:53:26 1996 Doug Evans <dje@canuck.cygnus.com>
-
- * choose-temp.c: New file.
- * Makefile.in (CFILES): Add choose-temp.c.
- (REQUIRED_OFILES): Add choose-temp.o.
-
-Sat Apr 13 14:19:30 1996 Stu Grossman (grossman@critters.cygnus.com)
-
- * floatformat.c (floatformat_to_double): Don't bias exponent when
- handling zero's, denorms or NaNs.
-
-Thu Apr 11 13:36:56 1996 Stu Grossman (grossman@critters.cygnus.com)
-
- * floatformat.c (floatformat_to_double): Fix bugs with handling
- numbers with fractions < 32 bits.
-
-Mon Apr 8 14:48:34 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * config.table: Permit --enable-shared to specify a list of
- directories.
-
-Tue Mar 19 22:02:07 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * cplus-dem.c (demangle_template): Fix for non-mangled pointer
- arguments.
-
-Fri Mar 8 17:24:18 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * configure.in: If srcdir is `.' and with_target_subdir is not
- `.', then set MULTISRCTOP before calling config-ml.in.
-
-Thu Mar 7 13:37:10 1996 Stan Shebs <shebs@andros.cygnus.com>
-
- * mpw.c (mpw_open): Add debugging output option.
-
-Wed Mar 6 17:36:03 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * cplus-dem.c (demangle_template): Fix for address-of-extern arguments.
-
-Tue Feb 27 12:00:50 1996 Raymond Jou <rjou@mexican.cygnus.com>
-
- * mpw.c (mpwify_filename): Change 6 to 5 in
- strncmp (unixname, "/tmp/", 5).
-
-Tue Feb 20 10:55:53 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * cplus-dem.c (demangle_template): Initialize is_bool. Correctly
- handle 0 as a pointer value parameter.
-
-Mon Feb 5 16:41:44 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * Makefile.in (all): Depend upon required-list.
- (required-list): New target.
- (clean): Remove required-list.
-
-Wed Jan 31 10:19:41 1996 Steve Chamberlain <sac@slash.cygnus.com>
-
- * win32.c: Deleted.
- * config.table (i386-*-win32): Deleted.
- * config/mh-i386win32: Deleted.
-
-Thu Jan 18 11:34:17 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * cplus-dem.c (cplus_demangle_opname): Change opname parameter to
- const char *.
- (cplus_mangle_opname): Change return type and opname parameter to
- const char *. Don't cast return value.
-
-Tue Jan 16 12:13:11 1996 Stan Shebs <shebs@andros.cygnus.com>
-
- * mpw.c: Include Timer.h, in order to get m68k Microseconds trap
- definition.
-
-Wed Jan 3 13:15:04 1996 Fred Fish <fnf@cygnus.com>
-
- * obstack.c: Update copyright to 1996.
- (_obstack_memory_used): Define new function. Called via
- obstack_memory_used macro.
-
-Thu Dec 28 11:39:40 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * xstrdup.c: New file.
- * Makefile.in (CFILES): Add xstrdup.c.
- (REQUIRED_OFILES): Add xstrdup.o.
- (xstrdup.o): New target.
-
-Mon Dec 11 18:18:52 1995 Mike Stump <mrs@cygnus.com>
-
- * atexit.c: New stub to provide atexit on systems that have
- on_exit, like SunOS 4.1.x systems.
- * functions.def (on_exit, atexit): Ditto.
-
-Mon Dec 11 15:42:14 1995 Stan Shebs <shebs@andros.cygnus.com>
-
- * mpw.c (mpw_abort): Remove decl.
- (mpw_access): Move debugging printf.
-
-Sat Dec 2 01:25:23 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * config.table: Consistently use ${host} rather than ${xhost} or
- ${target}.
- * configure.in: Don't bother to set ${xhost} before calling
- config.table.
-
-Tue Nov 28 14:16:57 1995 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * Makefile.in (.c.o): Use test instead of the left bracket, to
- avoid problems with some versions of make.
-
-Tue Nov 28 11:45:17 1995 Stan Shebs <shebs@andros.cygnus.com>
-
- * mpw-make.sed: Fix INCDIR edit to work with Nov 14 change.
-
-Tue Nov 21 11:26:34 1995 Fred Fish <fnf@rtl.cygnus.com>
-
- * config/mh-hpux: Remove. It was only used to define EXTRA_OFILES,
- which was set to just alloca.o, which is now automatically marked
- as needed by the autoconfiguration process.
-
-Tue Nov 21 14:15:06 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * config.table: Check ${with_cross_host} rather than comparing
- ${host} and ${target}.
-
-Thu Nov 16 14:34:42 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * configure.in: If with_target_subdir is empty, set xhost to
- ${host} rather than ${target} before calling config.table.
-
-Tue Nov 14 01:38:30 1995 Doug Evans <dje@canuck.cygnus.com>
-
- * Makefile.in (MULTITOP): Deleted.
- (MULTISRCTOP, MULTIBUILDTOP): New.
- (FLAGS_TO_PASS): Delete INCDIR.
- (INCDIR): Add $(MULTISRCTOP).
- (install_to_libdir): Add $(MULTISUBDIR). Call $(MULTIDO).
- * configure.in: Delete call to cfg-ml-com.in. Call config-ml.in
- instead of cfg-ml-pos.in.
- (cross-compile check): Change to test for with_target_subdir.
- (EXTRA_LINKS): Delete.
-
-Sun Nov 12 12:13:04 1995 Stan Shebs <shebs@andros.cygnus.com>
-
- * mpw-make.sed: Add getpagesize.c.o to needed-list.
- * mpw.c [USE_MW_HEADERS]: Conditionalize compiling of
- functions that are supplied by Metrowerks libraries.
- (fstat): Clean up descriptor->pointer conversion code.
- (InstallConsole, etc): Empty definitions, for when linking
- with SIOUX.
-
-Sun Nov 5 19:25:27 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * Makefile.in (FLAGS_TO_PASS): Also pass PICFLAGS.
- (.c.o): Stylistic change.
-
-Thu Nov 2 12:06:29 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * strtol.c, strtoul.c: Don't include <stdlib.h>. From
- phdm@info.ucl.ac.be (Philippe De Muyter).
-
-Wed Nov 1 11:59:36 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * configure.in: Correct sed call.
-
-Mon Oct 30 13:03:45 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * configure.in: Clean up / simplify for native.
-
- * configure.in: Merge in stuff from ../xiberty/configure.in.
- * Makefile.in (CC): Add definition (so it can be overrridden
- by ../configure).
-
-Tue Oct 24 17:57:27 1995 Stan Shebs <shebs@andros.cygnus.com>
-
- * mpw-make.sed: Leave strerror.c.o in standard list of functions.
- * mpw.c (R_OK, ENOENT, EACCESS, ENOSYS): Remove.
- (link): Remove useless definition with error return.
- (last_microseconds, warn_if_spin_delay, record_for_spin_delay):
- Use UnsignedWide type for microsecond counts.
-
-Thu Oct 19 10:52:07 1995 Michael Meissner <meissner@wogglebug.tiac.net>
-
- * memcmp.c (memcmp): Argument types are const void *, not void
- *const.
-
- * strncasecmp.c (strncasecmp): Include ansidecl.h/stdarg.h, not
- sys/types.h.
- * strcasecmp.c (strcasecmp): Ditto.
-
-Tue Oct 10 11:03:24 1995 Fred Fish <fnf@cygnus.com>
-
- * Makefile.in (BISON): Remove macro.
-
-Tue Sep 26 15:06:46 1995 Stan Shebs <shebs@andros.cygnus.com>
-
- * Makefile.in (HFILES): Add default empty definition.
- * mpw-config.in (config.h): Only update if changed.
- * mpw-make.in: Remove.
- * mpw-make.sed: New file, edits Makefile.in into MPW makefile.
- * mpw.c: Remove semi-clone of strerror code.
- (sys_nerr, sys_errlist): Define here.
- (Microseconds): Only define as A-line trap if m68k Mac.
-
-Wed Sep 20 12:53:32 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * Makefile.in (maintainer-clean): New synonym for distclean.
-
-Mon Aug 28 19:47:52 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * config.table: For host, generalize rs6000-ibm-aix*
- to *-ibm-aix* so we also include powerpc.
-
-Tue Aug 22 03:18:05 1995 Ken Raeburn <raeburn@kr-laptop.cygnus.com>
-
- Fri Jun 16 18:35:40 1995 Pat Rankin (rankin@eql.caltech.edu)
-
- * xstrerror.c: New file.
- * Makefile.in, vmsbuild.com: Compile it.
-
-Mon Jul 31 12:16:32 1995 steve chamberlain <sac@slash.cygnus.com>
-
- * config.table (i386-*-win32): New.
-
-Fri Jul 21 11:35:52 1995 Doug Evans <dje@canuck.cygnus.com>
-
- * Makefile.in (MULTITOP): New variable.
- (MULTIDIRS, MULTISUBDIR, MULTIDO, MULTICLEAN): Likewise.
- (all): Add multilib support.
- (install_to_tooldir, *clean): Likewise.
-
-Mon Jul 10 11:47:27 1995 Ken Raeburn <raeburn@cygnus.com>
-
- * makefile.dos (OBJS): Add hex.o. From DJ Delorie.
-
-Fri Jun 30 17:28:59 1995 Pat Rankin (rankin@eql.caltech.edu)
-
- * vmsbuild.com: create "new-lib.olb", build libiberty under that
- name, and then make it become "liberty.olb" when done, so that an
- incomplete build attempt never leaves behind something which looks
- like a complete library.
-
-Thu Jun 29 00:22:02 1995 Steve Chamberlain <sac@slash.cygnus.com>
-
- * config/mh-i386pe: New file for PE hosts.
- * config.table: Understand PE hosts.
-
-Wed Jun 28 19:13:23 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * cplus-dem.c: Update from gcc.
-
- * argv.c, dummy.c: If __STDC__, #include "alloca-conf.h" after
- <stddef.h>.
- * alloca-norm.h: If __STDC__, declare alloca with its parameter.
-
-Thu Jun 22 18:57:47 1995 Stan Shebs <shebs@andros.cygnus.com>
-
- * mpw-make.in (ALL_CFLAGS): Define NEED_basename.
- * mpw.c: Only test DebugPI once whenever printing debug info.
- (mpwify_filename): If filename is /tmp/foo, change it into :_foo,
- also fix to not write on input filename buffer.
- (mpw_access): Use stat() instead of open(), works for directories
- as well as files.
-
-Mon Jun 19 00:33:22 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * Makefile.in: Massage broken shells that require 'else true'.
-
-Sat Jun 17 23:21:58 1995 Fred Fish <fnf@cygnus.com>
-
- * alloca-norm.h: Declare alloca as type "PTR" to match functions.def.
- Declare __builtin_alloca in the sparc case, as argv.c did.
- * argv.c: Replace inline version of alloca-norm.h at start of file with
- a #include of alloca-conf.h. Precede it with an include of ansidecl.h
- because alloca-norm.h needs to declare alloca as "PTR".
-
-Mon Jun 12 14:24:26 1995 Steve Chamberlain <sac@slash.cygnus.com>
-
- * win32.c: New file.
-
-Fri Jun 9 15:16:14 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * dummy.c: #include "alloca-conf.h".
-
-Wed Jun 7 11:46:23 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * Makefile.in (mostlyclean): Remove stamp-picdir.
- (clean): Don't.
-
-Mon Jun 5 18:46:06 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * config.table (frags): Use toplevel pic frags.
-
- * Makefile.in (PICFLAG): New macro.
- (all): Depend on stamp-picdir.
- (needed-list): Ditto.
- (.c.o): Also build pic object.
- (stamp-picdir): New rule.
- (mostlyclean): Remove pic.
- (clean): Remove stamp-picdir.
-
-Fri Mar 24 16:55:48 1995 Pat Rankin (rankin@eql.caltech.edu)
-
- * vmsbuild.com (config.h): Add `#define NEED_basename'.
-
-Tue May 23 10:12:46 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * clock.c, getopt.c, strtod.c, vsprintf.c: Change from using LGPL
- to libio-style copyright.
- * getpagesize.c: Remove FSF copyright.
-
-Sat May 20 12:30:23 1995 Ken Raeburn <raeburn@kr-laptop.cygnus.com>
-
- Added improved VMS support from Pat Rankin:
-
- Fri Mar 17 18:40:36 1995 Pat Rankin (rankin@eql.caltech.edu)
-
- * vmsbuild.com: new file.
-
- * getpagesize.c (getpagesize): implement for VMS;
- * strerror.c (strerror, strerrno, strtoerrno): add rudimentary
- support for EVMSERR.
-
-Thu May 18 17:01:42 1995 Ken Raeburn <raeburn@kr-laptop.cygnus.com>
-
- Wed May 10 14:28:16 1995 Richard Earnshaw (rearnsha@armltd.co.uk)
-
- * floatformat.c (floatformat_arm_ext): Define.
-
-Tue May 16 13:30:59 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * basename.c, bcmp.c, getcwd.c, insque.c, rename.c, sigsetmask.c,
- strerror.c, strsignal.c: Remove FSF copyright.
- * sigsetmask.c: #include <sys/types.h> - seems to be needed by ISC.
-
-Mon May 15 19:53:17 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * bcopy.c, bzero.c, memcmp.c, memcpy.c, memset.c, strchr.c,
- strrchr.c, strstr.c, vfork.c: Remove FSF Copyright, because this
- might contaminate libstdc++ with the LGPL. (OK'd by RMS 11 Oct 94.)
- * strchr.c, strrchr.c: Add cast to suppress const warning.
-
-Thu May 4 14:36:42 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * cplus-dem.c: Use const instead of CONST. Don't include
- ansidecl.h directly.
-
-Wed Apr 19 01:30:27 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * cplus-dem.c: Don't include libiberty.h. Do declare xmalloc and
- xrealloc.
- (-DMAIN): Don't rely on an externally-defined version number;
- instead, require the version number to be defined as a
- preprocessor macro. Handle the RS/6000 leading dot. Define
- xmalloc, xrealloc and fatal. Don't strip a leading underscore
- if we couldn't demangle the word.
-
-Tue Apr 4 13:03:51 1995 Stan Shebs <shebs@andros.cygnus.com>
-
- (Old mpw.c change descriptions retained for informational value.)
- * mpw.c (warning_threshold): Default to .4 sec.
- (overflow_count, current_progress): New globals.
- (warn_if_spin_delay): Include current progress type,
- such as program name, in message.
- (mpw_start_progress): Set current_progress variable from arg.
- (mpw_end_progress): Report spin delays by power-of-two-size
- buckets instead of constant-size buckets.
-
- * mpw.c: Clean up formatting, types, returns, etc.
- (ENOSYS): Define.
- (mpw_fread, mpw_fwrite): Define.
- (sleep): Define correctly.
-
- * mpw.c: New code to implement cursor spinning support.
- (umask): New function.
- (mpw_fopen, mpw_fseek, stat, fstat): Call PROGRESS.
-
- * mpw.c (mpw_basename, mpw_mixed_basename): New functions, find
- basenames for MPW and MPW/Unix filenames.
- (mpw_special_init): New function, calls Macsbug if desired.
-
- * mpw.c: Add GPL notice.
- (mpwify_filename): Add more transformations.
- (mpw_fopen): Call mpwify_filename on file names.
- (rename): Remove.
- (chdir, getcwd): Add simple definitions.
-
- * mpw.c: Random cleanups, remove unused code bits.
- Added copy of strerror.c for gcc's use.
- (stat, fstat, _stat): New versions based on Guido van Rossum code.
-
- * mpw.c (mpw_fseek): Make it work correctly when doing SEEK_CUR.
-
- * mpw.c (stat): Remove hack definition, get from sys/stat.h.
- (fork, vfork, etc): Print error messages if called.
- (getrusage, sbrk, environ, isatty, link, utime, mkdir, rmdir,
- rename, chown): Define.
-
- * mpw-config.in: New file, MPW version of configure.in.
- * mpw-make.in: New file, MPW version of Makefile.in.
- * mpw.c: New file, MPW compatibility routines.
-
-Fri Mar 24 14:10:30 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
-
- * basename.c: Include config.h before checking for NEED_basename.
-
-Thu Mar 23 19:09:54 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * functions.def: Add DEFFUNC for basename.
-
- * basename.c: Only define basename if NEED_basename.
-
-Thu Mar 16 13:36:05 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * config.table: Fix --enable-shared logic for native builds.
-
-Mon Mar 13 11:05:11 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * cplus-dem.c (demangle_template): Demangle bool literals properly.
-
-Mon Mar 6 23:57:28 1995 Stu Grossman (grossman@cygnus.com)
-
- * strtol.c strtoul.c: Replace these with less buggy versions from
- NetBSD. (strtoul in particular couldn't handle base 16.)
-
-Wed Mar 1 15:59:01 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * config/mt-vxworks5 (HDEFINES): Define NO_SYS_PARAM_H.
-
- * clock.c: If NO_SYS_PARAM_H is defined, don't include
- <sys/param.h>.
- * getcwd.c, getpagesize.c, getruntime.c: Likewise.
-
-Fri Feb 17 15:40:55 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * getruntime.c (get_run_time): Don't assume that CLOCKS_PER_SEC is
- a number; ANSI appears to permit any expression, including a
- function call.
-
- * config.table (*-*-vxworks5*): Use mt-vxworks5 when configuring
- xiberty.
- * config/mt-vxworks5: New file.
-
-Thu Feb 9 14:19:45 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * basename.c (basename): Change argument to be const.
-
-Wed Feb 8 18:06:52 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * Makefile.in (lneeded-list): Don't worry about xmalloc.
-
-Sun Jan 15 00:40:36 1995 Jeff Law (law@snake.cs.utah.edu)
-
- * Makefile.in (distclean): Delete xhost-mkfrag.
-
-Thu Jan 12 16:54:18 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * Makefile.in (lneeded-list): If alloca.o is needed, so is xmalloc.o.
-
-Wed Jan 11 22:39:56 1995 Ken Raeburn <raeburn@cujo.cygnus.com>
-
- * hex.c: New file.
- * Makefile.in (REQUIRED_OFILES, CFILES): List it.
- (hex.o): Add dependencies.
-
- * cplus-dem.c (demangle_prefix): For GNU style constructor and
- destructor names, try demangling the remainder of the string.
-
-Wed Dec 28 00:49:15 1994 Ian Lance Taylor <ian@tweedledumb.cygnus.com>
-
- * vasprintf.c (int_vasprintf): New static function.
- (vasprintf): Use int_vasprintf. Removes assumption that va_list
- is assignment compatible.
-
-Sat Nov 5 19:29:12 1994 Jason Merrill (jason@phydeaux.cygnus.com)
-
- * Makefile.in (LIBCFLAGS): New variable.
- (FLAGS_TO_PASS): Pass it.
- (.c.o): Use it.
-
-Thu Nov 3 19:09:47 1994 Ken Raeburn <raeburn@cujo.cygnus.com>
-
- * getopt.c, getopt1.c: Do compile these functions under Linux,
- since many native versions are based on glibc but are buggy.
-
-Mon Oct 24 15:16:46 1994 Per Bothner <bothner@kalessin.cygnus.com>
-
- * vasprintf.c: Make 'format' arg be const, to avoid a mismatch
- with prototype in GNU libc. Support stdarg.h as well as varargs.h.
-
-Tue Oct 11 17:48:27 1994 Jason Merrill (jason@phydeaux.cygnus.com)
-
- * Makefile.in (REQUIRED_OFILES): Add vasprintf.o.
- * functions.def: Remove vasprintf.
-
-Wed Sep 14 17:04:55 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
-
- * xmalloc.c (first_break): New static variable.
- (xmalloc_set_program_name): Record sbrk (0) in first_break.
- (xmalloc): If memory allocation fails, try to report how much
- memory was allocated by the program up to this point.
- (xrealloc): Likewise.
-
-Sun Sep 04 17:58:10 1994 Richard Earnshaw (rwe@pegasus.esprit.ec.org)
-
- * Makefile.in (ERRORS_CC): New variable, defaulted to $(CC). Use it
- when linking dummy.
- * config.table: Add host RISCiX Makefile frag.
- * config/mh-riscix: New file.
-
-Thu Aug 25 17:29:44 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
-
- * Makefile.in (FLAGS_TO_PASS): Define.
- ($(RULE1)): Use $(FLAGS_TO_PASS).
-
-Wed Aug 24 17:08:47 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
-
- * vasprintf.c: Include <string.h>.
- (vasprintf): Add casts to void for va_arg to avoid gcc warnings.
- * xatexit.c: Declare malloc.
-
-Fri Aug 19 15:29:12 1994 Kung Hsu (kung@mexican.cygnus.com)
-
- * cplus-dem.c (demangle_args): Fix a bug in previous patch (the
- one below).
-
-Thu Aug 18 14:37:14 1994 Kung Hsu (kung@mexican.cygnus.com)
-
- * cplus-dem.c (demangle args): Handle ARM repeat encoding where
- the type index is greater than 9.
-
-Wed Aug 17 16:13:49 1994 Kung Hsu (kung@mexican.cygnus.com)
-
- * cplus-dem.c (demangle_qualified): accept optional '_' between
- qualified name. This is baecause the template name may end with
- numeric and can mixed up with the length of next qualified name.
-
-Wed Aug 3 05:52:14 1994 D. V. Henkel-Wallace (gumby@cygnus.com)
-
- * config/mt-sunos4: Use our standard location for cross-includes
- and cross-libs when the target is also a "host" environment (ie no
- newlib; includes and such don't belong to us). This is specific
- to the Cygnus Support environment.
-
-Tue Aug 2 15:25:12 1994 Kung Hsu (kung@mexican.cygnus.com)
-
- * cplus-dem.c (demangle_template): demangle as xxx<'Q'> not
- xxx<ch=81>.
-
-Mon Aug 1 17:02:48 1994 Kung Hsu (kung@mexican.cygnus.com)
-
- * cplus-dem.c (main): flush stdout to make pipe work.
-
-Sat Jul 16 12:56:32 1994 Stan Shebs (shebs@andros.cygnus.com)
-
- * config.table (*-*-cxux7*): Recognize.
- * floatformat.c (floatformat_m88110_ext) [HARRIS_FLOAT_FORMAT]:
- Harris-specific float format.
- * config/mh-cxux7: New file.
-
-Wed Jun 29 00:26:17 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
-
- * cplus-dem.c (demangle_template): Make sure that the result of
- consume_count doesn't index beyond the end of the string.
-
-Mon Jun 20 23:54:37 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
-
- * cplus-dem.c (gnu_special): Handle vtable mangling of gcc-2.4.5 and
- earlier. Improve test for new vtable mangling. Change output back
- to `virtual table'.
-
-Mon Jun 20 11:37:30 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
-
- * obstack.c: Always compile this code, even if using the GNU
- library. Avoids problems with relatively recent binary
- incompatibility.
-
-Thu Jun 16 17:54:01 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
-
- * cplus-dem.c: Include libiberty.h.
- (xmalloc, xrealloc, free): Don't declare.
- (strstr): Don't declare parameters.
- (xmalloc, xrealloc): Don't define.
- (long_options): Add no-strip-underscores.
- (main): Call xmalloc_set_program_name. Pass n in short options to
- getopt_long. Handle option 'n' to not strip underscores.
- (usage): Mention -n and --no-strip-underscores.
-
-Sun Jun 12 01:37:09 1994 Jason Merrill (jason@deneb.cygnus.com)
-
- * cplus-dem.c (demangle_template): Separate consecutive >'s with a
- space.
- (gnu_special): Demangle template and qualified names in a vtable name.
-
-Fri May 27 12:27:52 1994 Ken Raeburn (raeburn@cujo.cygnus.com)
-
- From gas-2.3 and binutils-2.4 net releases:
-
- Wed May 11 22:32:00 1994 DJ Delorie (dj@ctron.com)
-
- * makefile.dos: [new] Makefile for dos/go32
- * configure.bat: update for latest files
- * msdos.c: remove some functions now in libc.a
-
-Fri May 20 18:53:32 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * cplus-dem.c (gnu_special): Recognize thunks, as well as
- the new naming style for vtables (when -fvtable-thunks).
-
-Wed May 18 13:34:06 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
-
- * Makefile.in (XTRAFLAGS): Don't define.
- (.c.o, dummy.o): Don't use XTRAFLAGS.
- ($(RULE1)): Don't pass XTRAFLAGS down in recursive call.
-
-Fri May 13 16:02:12 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
-
- * vasprintf.c: New file.
- * Makefile.in, functions.def: Add it.
-
-Fri May 13 16:20:28 1994 Jason Merrill (jason@deneb.cygnus.com)
-
- * cplus-dem.c (demangle_fund_type): Grok bool.
-
-Fri May 6 14:44:21 1994 Steve Chamberlain (sac@cygnus.com)
-
- * config.table: Add go32
- * config/mh-go32: New template.
-
-Fri May 6 11:01:59 1994 D. V. Henkel-Wallace (gumby@rtl.cygnus.com)
-
- * config.table, config/mt-sunos4: config for when sun4 is cross target.
-
-Mon Apr 11 00:54:33 1994 Richard Stallman (rms@mole.gnu.ai.mit.edu)
-
- * getopt.c [not __GNU_LIBRARY__] [__GCC__] [not __STDC__]:
- Declare strlen to return int. Don't include stddef.h.
-
-Fri Apr 1 00:38:17 1994 Jim Wilson (wilson@mole.gnu.ai.mit.edu)
-
- * getopt.c: Delete use of IN_GCC to control whether
- stddef.h or gstddef.h is included.
-
-Thu Apr 14 14:00:56 1994 Kung Hsu (kung@mexican.cygnus.com)
-
- * cplus-dem.c (demangle_signature): Fix a bug in template function
- type numbering.
-
-Wed Apr 13 17:23:03 1994 Kung Hsu (kung@mexican.cygnus.com)
-
- * cplus-dem.c (demangle_signature): Fix template function with arm
- style argument type number, Tn.
-
-Wed Apr 13 17:11:15 1994 Jason Merrill (jason@deneb.cygnus.com)
-
- * cplus-dem.c (optable): Add new[] and delete[].
-
-Fri Apr 8 11:21:42 1994 Jim Kingdon (kingdon@deneb.cygnus.com)
-
- * argv.c (buildargv): Don't produce empty argument just because
- there is trailing whitespace.
-
-Wed Apr 6 11:42:14 1994 Kung Hsu (kung@mexican.cygnus.com)
-
- * cplus-dem.c (demangle_template): fix 'Q' qualified name bug.
- Handle 'p' same as 'P'.
- * cplus-dem.c (do_type): Handle 'p' same as 'P'.
-
-Sat Mar 26 12:00:13 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
-
- * floatformat.c (get_field, put_field): Fix off by one error in
- little endian case.
-
-Thu Mar 24 10:40:19 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
-
- * floatformat.c (floatformat_from_double): Pass unsigned char *,
- not char *, to put_field.
-
-Fri Mar 18 12:34:33 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * memmove.c: Re-wrote; placed in public domain.
-
-Wed Mar 16 10:33:07 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
-
- * cplus-dem.c (demangle_prefix): If ARM demangling, don't treat
- __Q* as a constructor.
-
-Mon Mar 14 12:26:02 1994 Ian Lance Taylor (ian@cygnus.com)
-
- * ieee-float.c: Removed; no longer used.
- * Makefile.in: Changed accordingly.
-
-Mon Mar 7 12:28:17 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
-
- * floatformat.c (get_field): Removed unused local variable i.
- (put_field): Removed unused local variable i.
-
-Sun Feb 27 21:50:11 1994 Jim Kingdon (kingdon@deneb.cygnus.com)
-
- * floatformat.c: New file, intended to replace ieee-float.c.
- * Makefile.in: Change accordingly.
-
-Thu Feb 24 11:51:12 1994 David J. Mackenzie (djm@rtl.cygnus.com)
-
- * getopt.c: Remove #ifdef GETOPT_COMPAT and #if 0 code.
- (_getopt_initialize): New function, broken out of _getopt_internal.
- (_getopt_internal):
- If long_only and the ARGV-element has the form "-f", where f is
- a valid short option, don't consider it an abbreviated form of
- a long option that starts with f. Otherwise there would be no
- way to give the -f short option.
-
-Thu Feb 10 14:44:16 1994 Richard Stallman (rms@mole.gnu.ai.mit.edu)
-
- * getopt.c [not __GNU_LIBRARY__] [__GNUC__] [not IN_GCC]:
- Test just __STDC__, not emacs.
-
-Wed Feb 9 00:14:00 1994 Richard Stallman (rms@mole.gnu.ai.mit.edu)
-
- * getopt.c [not __GNU_LIBRARY__] [__GNUC__] [not IN_GCC]
- [emacs] [not __STDC__]: Don't include stddef.h. Don't declare strlen.
-
-Fri Dec 24 19:43:00 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu)
-
- * getopt.c (_NO_PROTO): Define before config.h is included.
-
-Mon Sep 20 15:59:03 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
-
- * getopt.c, getopt1.c [emacs || CONFIG_BROKETS]: Include
- <config.h> only under these, else "config.h".
-
-Thu Aug 12 18:16:49 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
-
- * getopt.c, getopt1.c [HAVE_CONFIG_H]: Include
- <config.h> instead of "config.h".
-
-Sun Feb 20 17:17:01 1994 Ian Lance Taylor (ian@lisa.cygnus.com)
-
- * concat.c: Check ANSI_PROTOTYPES rather than __STDC__ to decide
- whether to use prototypes or not.
- * strerror.c (const): Never undefine; let ansidecl.h handle it.
- * strsignal.c (const): Likewise.
-
-Thu Feb 17 13:27:35 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
-
- * xatexit.c (_xexit_cleanup): Declare as extern; don't initialize.
- Merging common and initialized variables need not be supported by
- ANSI C compilers.
- (xatexit): Initialize _xexit_cleanup if not already set.
- * xexit.c: Comment fix.
-
-Wed Feb 16 01:15:36 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
-
- * xmalloc.c: Don't declare xexit; it's declared in libiberty.h.
- (xrealloc): If oldmem is NULL, allocate with malloc, rather than
- assuming that realloc works correctly.
-
-Tue Feb 15 09:26:16 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
-
- * concat.c, ieee-float.c: Replace inclusion of <string.h>
- with explicit function declarations, as recommended by Ian Taylor.
-
-Sat Feb 12 10:31:11 1994 David J. Mackenzie (djm@rtl.cygnus.com)
-
- * xmalloc.c (xmalloc, xrealloc): Use PTR and size_t throughout.
- (malloc, realloc): Declare.
-
-Thu Feb 10 17:08:19 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
-
- * argv.c, basename.c: Include ansidecl.h and libiberty.h.
- * concat.c, fdmatch.c, getruntime.c, spaces.c: Likewise.
- * strerror.c, strsignal.c, xatexit.c, xexit.c: Likewise.
- * xmalloc.c: Likewise.
- * concat.c: Don't declare xmalloc. If __STDC__, use <stdarg.h>
- macros, not <varargs.h> macros.
- * spaces.c (spaces): Make return type const. Don't crash if
- malloc returns NULL.
- * strerror.c (struct error_info): Make name and msg fields const.
- (error_names): Make const.
- (strerrno): Make const.
- (strtoerrno): Make argument const.
- * strsignal.c (struct signal_info): Make name and msg fields
- const.
- (signal_names, sys_siglist): Make const.
- (strsignal, strsigno): Make const.
- (strtosigno): Make argument const.
- * xatexit.c: Declare parameter types.
- * xmalloc.c (name): Make const.
- (xmalloc_set_program_name): Make argument const.
- * Makefile.in (INCDIR): Define.
- (.c.o): Use $(INCDIR).
- (dummy.o): Likewise.
- (argv.o, basename.o): New targets; depend on libiberty.h.
- (concat.o, fdmatch.o, getruntime.o, spaces.o): Likewise.
- (strerror.o, strsignal.o, xatexit.o, xexit.o): Likewise.
- (xmalloc.o): Likewise.
- (cplus-dem.o): New target; depend on demangle.h.
- (getopt.o, getopt1.o): New targets; depend on getopt.h.
- (ieee-float.o): New target; depend on ieee-float.h.
- (obstack.o): New target; depend on obstack.h.
-
-Tue Feb 8 05:29:08 1994 David J. Mackenzie (djm@thepub.cygnus.com)
-
- Handle obstack_chunk_alloc returning NULL. This allows
- obstacks to be used by libraries, without forcing them
- to call exit or longjmp.
- * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk):
- If CALL_CHUNKFUN returns NULL, set alloc_failed, else clear it.
- (_obstack_begin, _obstack_begin_1): Return 1 if successful, 0 if not.
-
-Tue Feb 8 00:32:28 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
-
- * concat.c, ieee-float.c: Include <string.h>.
-
-Sun Feb 6 21:28:46 1994 David J. Mackenzie (djm@thepub.cygnus.com)
-
- * xmalloc.c (xmalloc_set_program_name): New function.
- (xmalloc, xrealloc): Include the name in the error message, if set.
-
- * Replace atexit.c with xatexit.c.
- * Makefile.in (CFILES), functions.def: Change references.
-
-Sat Feb 5 14:02:32 1994 Stan Shebs (shebs@andros.cygnus.com)
-
- * getruntime.c (get_run_time): Use getrusage or times if
- HAVE_GETRUSAGE or HAVE_TIMES are defined.
-
-Fri Feb 4 15:49:38 1994 David J. Mackenzie (djm@thepub.cygnus.com)
-
- * atexit.c: New file.
- * Makefile.in (CFILES), functions.def: Add it.
- * xexit.c: New file.
- * Makefile.in (CFILES, REQUIRED_OFILES): Add it.
- * xmalloc.c (xmalloc, xrealloc): Call xexit instead of exit.
- Change request for 0 bytes into request for 1 byte.
-
-Wed Feb 2 11:36:49 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
-
- * xmalloc.c (xmalloc, xrealloc): Print size using %lu, and cast to
- unsigned long, to avoid warnings.
-
-Fri Jan 28 17:49:06 1994 Ken Raeburn (raeburn@cujo.cygnus.com)
-
- * dummy.c: Don't include time.h ever; always define clock_t as
- "unsigned long". Until gcc/fixincludes ensures that clock_t
- exists, __STDC__ isn't a sufficient test. And if clock() doesn't
- exist, clock_t probably doesn't either.
-
-Mon Jan 24 11:52:31 1994 Stan Shebs (shebs@andros.cygnus.com)
-
- * clock.c, getruntime.c: New files.
- * Makefile.in: Add to file lists.
- * functions.def (clock): Add to list.
- * dummy.c (time.h): Add if __STDC__.
- (clock_t): #define as "unsigned long" if not __STDC__.
-
-Tue Jan 11 11:27:44 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
-
- * strtod.c: Declare atof. From edler@jan.ultra.nyu.edu (Jan
- Edler).
-
-Tue Dec 28 14:17:30 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
-
- * Makefile.in (errors): Use CFLAGS as well as LDFLAGS when
- linking.
-
-Fri Dec 17 12:26:07 1993 Kung Hsu (kung@cirdan.cygnus.com)
-
- * cplus-dem.c (demangle_arm_pt): New function. Common code
- for ARM template demangling.
- * cplus-dem.c (demangle_class_name): Use demangle_arm_pt.
- * cplus-dem.c (demangle_prefix): Likewise.
-
-Tue Nov 30 15:47:48 1993 Jason Merrill (jason@deneb.cygnus.com)
-
- * cplus-dem.c (cplus_demangle_opname): Add CONST to please gcc.
-
-Sat Nov 27 11:05:50 1993 Fred Fish (fnf@cygnus.com)
-
- Merge changes from tom@basil.icce.rug.nl (Tom R.Hageman)
- * strerror.c, strsignal.c: As a small space optimization, don't
- include messages when they aren't actually used.
-
- Merge changes from takefive.co.at!joe (Josef Leherbauer)
- * cplus-dem.c (demangle_prefix, demangle_function_name,
- cplus_demangle_opname): Fixes for systems where cplus_marker
- is something other than '$'.
-
-Fri Nov 26 13:51:11 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * waitpid.c: Simple-minded approcimation to waitpid
- using vanilla wait.
- * functions.def, Makefile.in: Update accordingly,
-
-Thu Nov 18 18:01:15 1993 Kung Hsu (kung@cirdan.cygnus.com)
-
- * cplus-dem.c(demangle_template): fix bug template instantiation
- with value of user defined type.
-
-Wed Nov 17 18:30:21 1993 Kung Hsu (kung@cirdan.cygnus.com)
-
- * cplus-dem.c(cplus_demangle_opname): add the subject new function
- to support unified search of operator in class.
-
-Wed Nov 10 09:47:22 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
-
- gcc -Wall lint:
- * strtoul.c (strtoul): use "(digit = *s) != '\0'" not just
- "digit = *s" as condition in while loop.
-
-Tue Nov 9 15:52:22 1993 Mark Eichin (eichin@cygnus.com)
-
- * Makefile.in: pass SHELL to recursive make
-
-Thu Nov 4 12:09:26 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * vfprintf.c, vprintf.c, vsprintf.c: Make format arg
- be (const char*), for ANSI (and gcc w/fixproto) consistency.
-
-Thu Nov 4 08:29:04 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
-
- * config.table: Make *-*-hiux* use mh-hpux.
-
-Fri Oct 22 07:53:15 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
-
- * config.table: Add * to end of all OS names.
-
-Tue Oct 19 17:12:01 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com)
-
- * Makefile.in (lneeded-list): ensure that object file names are
- not duplicated, as multiple instances of the same object file in
- a library causes problems on some machines
-
-Mon Oct 18 21:59:28 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
-
- * strcasecmp.c, strncasecmp.c: Change u_char to unsigned char.
-
-Fri Oct 15 22:17:11 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com)
-
- * strncasecmp.c: new file, implements strncasecmp
- * strcasecmp.c: new file, implement strcasecmp
-
- * Makefile.in (CFILES): list these two new source files
-
- * functions.def: add strcasecmp and strncasecmp entries
-
-Fri Oct 15 14:53:05 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
-
- * strtoul.c (strtoul), strtol.c (strtol): Handle overflow
- according to ANSI C.
-
-Thu Oct 14 16:34:19 1993 Kung Hsu (kung@cirdan.cygnus.com)
-
- * cplus-dem.c: add support of ARM global constructor/destructor,
- and 'G' for passing record or union in parameter.
-
-Wed Oct 13 13:36:19 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
-
- * Makefile.in: Fix comment to clarify that stuff in REQUIRED_OFILES
- should not be in functions.def.
-
-Wed Oct 13 13:13:38 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
-
- * functions.def: Removed xmalloc. Stuff in REQUIRED_OFILES should
- not be in functions.def.
-
-Mon Oct 4 18:26:39 1993 Kung Hsu (kung@cirdan.cygnus.com)
-
- * cplus-dem.c: change globl constructor/destructor to proper name
-
-Tue Sep 28 18:11:07 1993 Kung Hsu (kung@cirdan.cygnus.com)
-
- * cplus-dem.c: fix bug in constructor/destructor
-
-Tue Sep 28 16:20:49 1993 Kung Hsu (kung@cirdan.cygnus.com)
-
- * cplus-dem.c: support both old and new _vt$... vtbl mangled names
-
-Fri Sep 24 19:07:16 1993 Jason Merrill (jason@deneb.cygnus.com)
-
- * cplus-dem.c: Fix demangle_template prototype
-
-Fri Sep 24 17:32:55 1993 Kung Hsu (kung@cirdan.cygnus.com)
-
- * cplus-dem.c: fix template demangling
- * cplus-dem.c: fix const type demangling
- * cplus-dem.c: fix constructor/destructor, virtual table,
- qualifier, global constructor/destructor demangling
-
-Wed Sep 1 23:13:11 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
-
- * strsignal.c, strerror.c: Use fully-bracketed initializer to
- keep gcc -Wall happy.
-
-Fri Aug 27 10:30:09 1993 Jason Merrill (jason@deneb.cygnus.com)
-
- * cplus-dem.c (do_type): Add CONSTS to make gcc happy with last
- patch.
-
-Fri Aug 27 11:24:54 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
-
- Patch from Paul Flinders:
- * cplus-dem.c (do_type): Deal with arrays.
-
-Tue Aug 24 14:23:50 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
-
- * cplus-dem.c (demangle_qualified: Deal with GNU format for more
- than 9 classes.
-
-Wed Aug 18 19:50:29 1993 Jason Merrill (jason@deneb.cygnus.com)
-
- * Makefile.in (dummy.o): Redirect to /dev/null to avoid "variable
- not initialized" warnings under HP/UX
-
-Sun Aug 15 20:42:40 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
-
- * strerror.c: Move include of stdio.h after sys_errlist #define.
- Also remove NULL definition (stdio.h always defines NULL, so it
- never did anything but clutter up the code).
-
-Sat Aug 14 14:21:49 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com)
-
- * Makefile.in, functions.def: handle xmalloc.c
-
- * xmalloc.c: provide xmalloc and xrealloc functions
-
-Thu Aug 12 17:38:57 1993 David J. Mackenzie (djm@thepub.cygnus.com)
-
- * cplus-dem.c: Fix a comment.
-
-Sat Aug 7 13:56:35 1993 David J. Mackenzie (djm@thepub.cygnus.com)
-
- * getopt1.c: Declare const the way getopt.c does.
-
-Fri Aug 6 17:03:13 1993 David J. Mackenzie (djm@thepub.cygnus.com)
-
- * obstack.c, alloca.c: Update from FSF.
- * getopt.c, getopt1.c: Update to current FSF version, which
- doesn't use alloca.
-
-Tue Jul 27 14:03:57 1993 Brendan Kehoe (brendan@lisa.cygnus.com)
-
- * Makefile.in (demangle): Add the target with a message saying
- where demangle went.
-
-Mon Jul 26 15:49:54 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
-
- * Makefile.in: Remove obsolete `demangle' target.
-
-Thu Jul 22 08:31:01 1993 Fred Fish (fnf@deneb.cygnus.com)
-
- * cplus-dem.c (arm_special): Apply patch from arg@lucid.com to
- avoid infinite loop on vtbl symbols with disambiguating "junk"
- tacked on the end.
-
-Mon Jul 19 14:10:37 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com)
-
- * strsignal.c: work around some systems losing definitions of
- sys_siglist
-
- * config/mh-lynxos: this system has a losing definition of
- sys_siglist
-
- * config.table: use mh-lynxos for *-*-lynxos
-
-Mon Jul 19 17:08:52 1993 Ken Raeburn (raeburn@rtl.cygnus.com)
-
- * config.table: Add support for HPPA BSD hosts.
-
- * config/mh-hpbsd: New file.
-
-Mon Jul 12 18:00:40 1993 K. Richard Pixley (rich@cygnus.com)
-
- * Makefile.in (TAGS): make work when srcdir != objdir.
-
-Sun Jun 27 15:35:31 1993 David J. Mackenzie (djm@thepub.cygnus.com)
-
- * cplus-dem.c (main): Add long options, including --help and
- --version.
- (usage): New function from code in main.
-
-Tue Jun 22 11:37:38 1993 Per Bothner (bothner@deneb.cygnus.com)
-
- * config.table: New shell scipt, sourced by both ./configure,in
- and ../xiberty/configure.in, to avoid maintainance lossages.
- * configure.in and ../xiberty/configure.in: Use config.table.
-
- * configure.in: Don't use mh-aix for AIX 3.2, only for 3.1.
- * configure.in: Map *-*-irix* (except irix4) to mh-sysv.
- * ../xiberty/configure.in: Update from ./configure.in.
-
-Tue Jun 15 17:05:31 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
-
- * Makefile.in: remove parentdir support
-
-Wed May 26 12:59:09 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
-
- * cplus-dem.c (xrealloc): Match definition with prototype.
-
-Tue May 25 14:27:51 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
-
- * cplus-dem.c (demangle_prefix): Demangle cfront
- local variables as an extension to ARM demangling.
-
-Fri May 21 09:53:57 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
-
- * ieee-float.c: Don't require pointers to double to be aligned.
-
-Tue May 18 17:12:10 1993 Fred Fish (fnf@cygnus.com)
-
- (merge changes from dlong@cse.ucsc.edu)
- * cplus-dem.c (consume_count): Simplify.
- * cplus-dem.c (arm_pt, demangle_class_name): New functions.
- * cplus-dem.c (various): Calls to arm_pt, demangle_class_name.
-
- * cplus-dem.c (xmalloc, xrealloc, strstr): Make extern decls into
- full prototypes.
- * cplus-dem.c (free): Add prototype.
- * cplus-dem.c (optable): Fully bracketize initializer.
-
-Fri May 14 17:13:05 1993 Per Bothner (bothner@cygnus.com)
-
- * cplus-dem.c: Whether initial underscores are stripped
- depends on the external variable prepends_underscore
- (which is generated by the binutils Makefile).
-
-Fri May 14 07:32:20 1993 Ken Raeburn (raeburn@deneb.cygnus.com)
-
- * cplus-dem.c (mop_up, arm_special): Remove some unused variables.
-
-Tue May 4 20:31:59 1993 Fred Fish (fnf@cygnus.com)
-
- * cplus-dem.c (consume_count): Return zero if arg does not
- start with digit, and don't consume any input.
-
-Tue May 4 08:10:28 1993 Jim Kingdon (kingdon@cygnus.com)
-
- * Makefile.in (demangle): Use ${srcdir} not $^.
-
- * strtod.c: New file, needed at least for BSD 4.3.
-
-Sun May 2 11:30:42 1993 Fred Fish (fnf@cygnus.com)
-
- * strsignal.c (sys_siglist): For ANSI compilations, type is
- "const char *const". Also remove conditionalization on __STDC__
- since const is defined away for non-ANSI.
-
-Wed Apr 28 19:29:55 1993 Ken Raeburn (raeburn@deneb.cygnus.com)
-
- * configure.in: Recognize *-*-hpux.
- * config/mh-hpux: New file.
-
-Tue Apr 27 15:22:19 1993 Per Bothner (bothner@cygnus.com)
-
- * tmpnam.c: Added ANSI tmpnam() function.
- * functions.def, Makefile.in: Update accordingly.
-
-Tue Apr 27 13:38:38 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
-
- * cplus-dem.c (demangle_function_name): Get the demangling of
- stop__1A right.
-
-Fri Apr 16 23:48:24 1993 Jim Kingdon (kingdon at calvin)
-
- * cplus-dem.c: Declare strstr return type.
-
-Fri Mar 26 12:01:26 1993 Jim Kingdon (kingdon@cygnus.com)
-
- * strsignal.c: Add some AIX signals.
-
-Thu Mar 25 15:17:23 1993 Ian Lance Taylor (ian@cygnus.com)
-
- * Makefile.in (MAKEOVERRIDES): Define to be empty.
-
-Wed Mar 24 01:59:25 1993 david d `zoo' zuhn (zoo at poseidon.cygnus.com)
-
- * Makefile.in: add installcheck & dvi targets
-
-Thu Mar 18 14:05:44 1993 Per Bothner (bothner@rtl.cygnus.com)
-
- * ieee-float.c: New file, moved from ../gdb (since it is
- needed by ../opcode/m68k-dis.c).
-
-Tue Mar 2 17:47:31 1993 Fred Fish (fnf@cygnus.com)
-
- * cplus-dem.c: Replace all references to cfront with ARM.
-
-Fri Feb 26 00:17:07 1993 Per Bothner (bothner@rtl.cygnus.com)
-
- * cplus-dem.c: Fix main program (when compiled with -DMAIN)
- to be more useful as a filter.
-
-Sat Feb 20 21:41:39 1993 Brendan Kehoe (brendan@lisa.cygnus.com)
-
- * Makefile.in (install_to_libdir, install_to_tooldir): Go into the
- destination directory before running $(RANLIB), in case that
- program tries to create a file in the current directory as part of
- its work.
-
-Thu Feb 18 23:00:19 1993 John Gilmore (gnu@cygnus.com)
-
- * strsignal.c (sys_siglist): Remove yet another *%^&%&$# "const"
- because BSD 4.4 lacks one. Isn't this fun?
-
-Thu Feb 18 11:24:25 1993 Fred Fish (fnf@cygnus.com)
-
- * cplus-dem.c (demangle_signature): Set func_done after
- demangling a template.
- * cplus-dem.c (demangle_template): Fix several small bugs
- in demangling GNU style templates.
- * cplus-dem.c (demangle_prefix): Fix for templates in GNU
- style constructors.
- * cplus-dem.c (gnu_special): Fix for templates in GNU style
- static data members.
-
-Tue Feb 16 17:28:35 1993 Fred Fish (fnf@cygnus.com)
-
- * cplus-dem.c (demangle_signature): Modify to include type
- modifiers like static and const in remembered types.
-
-Thu Feb 11 22:20:47 1993 Fred Fish (fnf@cygnus.com)
-
- * cplus-dem.c (demangled_qualified): Add new parameter that tells
- whether to prepend or append the qualifiers.
- * cplus-dem.c (string_prepends): Used now, remove #if 0.
- * cplus-dem.c (demangle_signature): Call demangle_qualified
- with prepending.
- * cplus_dem.c (gnu_special): Recognize static data members that
- use qualified names.
- * cplus-dem.c (demangle_qualified): Accumulate qualifiers in a
- temporary buffer and the prepend or append them to the result,
- as specified by the new "append" flag.
- * cplus-dem.c (do_type): Call demangled_qualified with
- appending.
-
-Mon Dec 28 10:47:19 1992 Ken Raeburn (raeburn@cygnus.com)
-
- * strsignal.c (signal_table): Now const.
- (init_signal_tables): Variable eip now points to const.
-
- * strerror.c (error_table): Now const.
- (init_error_tables): Variable eip now points to const.
-
-Tue Dec 15 15:36:50 1992 Per Bothner (bothner@cygnus.com)
-
- * memchr.c (memchr): New (ANSI standard) function.
- * Makefile.in, functions.def: Added memchr.
- * Makefile.in (AR_FLAGS): Use rc instad of non-standard cq.
-
-Wed Dec 2 22:49:10 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
-
- * getopt.c: remove use of USG around <alloca.h>, which never meant
- anything anyway
-
- * config/mh-{aix,apollo68,ncr3000,sysv,sysv4}: removed definitions
- of USG and USGr4
-
-Thu Nov 19 03:09:33 1992 Brendan Kehoe (brendan@lisa.cygnus.com)
-
- * cplus-dem.c (demangle_fund_type): Recognize `w', a wide character;
- it's now a type according to the ANSI X3J16 working paper; output
- "wchar_t" for it.
- (demangle_template): Accept `w' as an integral type.
- (xmalloc, xrealloc): Use `char *', not `PTR'. Cast calls to their
- counterparts malloc and realloc to `char *'.
- (main): Exit with a 0 status.
- * Makefile.in (demangle): Don't expect the user to define
- DEMANGLE, instead force to be cplus-dem.c. Look in $(srcdir)/../include
- for demangle.h. Pass it any HDEFINES or XTRAFLAGS.
-
-Wed Nov 18 18:56:20 1992 John Gilmore (gnu@cygnus.com)
-
- * Makefile.in (AR_FLAGS): Avoid verbosity.
- * config/mh-sysv4: Remove AR_FLAGS override, use INSTALL=cp,
- replace USGr4 with HAVE_SYSCONF.
- * config/mh-solaris: Remove; mh-sysv4 works now.
- * getpagesize.c: Replace USGr4 with HAVE_SYSCONF.
- * configure.in: Simplify host matching table, remove separate
- solaris config file.
-
-Sun Nov 15 09:35:16 1992 Fred Fish (fnf@cygnus.com)
-
- * configure.in (i[34]86-*-solaris2*): Add, use mh-sysv4.
-
-Tue Nov 3 21:27:03 1992 Brendan Kehoe (brendan@cygnus.com)
-
- * cplus-dem.c (xmalloc, xrealloc): Add decls.
- (remember_type): Don't cast xmalloc.
- (string_need): Likewise; don't cast xrealloc either.
-
-Fri Oct 23 08:52:01 1992 Ian Lance Taylor (ian@cygnus.com)
-
- * Makefile.in, functions.defs, rename.c: added simple
- implementation of rename, since some binutils programs use it.
-
-Thu Oct 15 15:18:22 1992 Per Bothner (bothner@cygnus.com)
-
- * strsignal.c: Add appropriate 'const' to sys_siglist
- extern declaration (if __STDC__). (Needed for Linux.)
- * strsignal.c (strsignal): Add cast to remove const-ness.
-
-Fri Oct 9 03:22:55 1992 John Gilmore (gnu@cygnus.com)
-
- * Makefile.in (needed.awk, needed2.awk): Remove erroneous \'s
- before "'s, diagnosed by BSD 4.4 awk.
-
-Thu Oct 8 15:25:12 1992 Ian Lance Taylor (ian@cygnus.com)
-
- * Makefile.in: create config.h and needed-list through $(CONFIG_H)
- and $(NEEDED_LIST), to give some hooks for xiberty.
-
-Thu Oct 1 23:31:42 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
-
- * configure.in: use cpu-vendor-triple instead of nested cases
-
-Wed Sep 30 11:26:59 1992 Per Bothner (bothner@rtl.cygnus.com)
-
- * Makefile.in, argv.c, basename.c, bcmp.c, bcopy.c, bzero.c,
- concat.c, cplus-dem.c, fdmatch.c, getcwd.c, getopt.c, getopt1.c,
- getpagesize.c, insque.c, memcmp.c, memcpy.c, memmove.c, memset.c,
- obstack.c, sigsetmask.c, spaces.c, strchr.c, strerror.c,
- strrchr.c, strsignal.c, strstr.c, vfork.c, vsprintf.c:
- Convert from using GPL to LGPL.
-
-Sat Sep 26 04:01:30 1992 John Gilmore (gnu@cygnus.com)
-
- * Makefile.in (errors): Leave dummy.o and dummy around so that
- we can see how the needed list was generated (it's sometimes wrong).
- (mostlyclean): Remove them.
-
-Mon Sep 21 14:50:42 1992 Ian Lance Taylor (ian@cygnus.com)
-
- * getcwd.c: supply a default if MAXPATHLEN is not defined.
-
- * config/mh-irix4: set EXTRA_OFILES to alloca.o, from WRS.
-
-Wed Sep 9 12:41:48 1992 Ian Lance Taylor (ian@cygnus.com)
-
- * Makefile.in: Use XTRAFLAGS when compiling, so that xiberty works
- when cross-compiling.
-
-Thu Sep 3 13:29:39 1992 K. Richard Pixley (rich@sendai.cygnus.com)
-
- * cplus-dem.c: (demangle_prefix): reduction in strength of strstr
- as a time optimization.
-
- * cplus-dem.c (cplus_demangle): remove strpbrk test. Appears to
- be more expensive than simply demangling.
-
- * cplus-dem.c (cplus_match): new function.
-
-Tue Sep 1 15:24:04 1992 Per Bothner (bothner@rtl.cygnus.com)
-
- * cplus-dem.c: #include <stdio.h>, to define NULL.
- Define current_demangling_style.
-
-Sun Aug 30 17:58:19 1992 Per Bothner (bothner@rtl.cygnus.com)
-
- * cplus-dem.c: New file, moved from ../gdb.
- * cplus-dem.c (set_cplus_marker_for_demangling): New exported
- function, to avoid compiling in target-dependency for CPLUS_MARKER.
- * cplus-dem.c (cplus_demangle): Allow demangling style option
- to be passed as a parameter, but using the global variable
- current_demangling_style as a default.
- * Makefile.in: Update for cplus-dem.c
-
-Sat Aug 29 10:44:09 1992 Fred Fish (fnf@cygnus.com)
-
- * obstack.c: Merge in comment changes from FSF version. Now
- matches the FSF version exactly.
-
-Fri Aug 28 18:39:08 1992 John Gilmore (gnu@cygnus.com)
-
- * obstack.c (CALL_FREEFUN): Can't use ?: with void values (at
- least on losing DECstations!); use if-then-else instead.
-
-Wed Aug 19 14:40:34 1992 Ian Lance Taylor (ian@cygnus.com)
-
- * Makefile.in: always create installation directories.
-
-Mon Aug 10 17:33:40 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
-
- * Makefile.in: clean up definition of CFILES, more comments
-
-Sat Aug 8 23:10:59 1992 Fred Fish (fnf@cygnus.com)
-
- * getopt.c (my_index): Make first arg const to match strchr,
- which it sometimes is remapped to.
-
-Sat Aug 1 13:48:50 1992 Fred Fish (fnf@cygnus.com)
-
- * obstack.c (DEFAULT_ALIGNMENT): Update to match FSF version.
- * obstack.c (_obstack_begin): Initialize use_extra_arg.
- * obstack.c (_obstack_begin_1): New, from FSF version.
-
-Mon Jul 20 21:07:58 1992 Fred Fish (fnf@cygnus.com)
-
- * obstack.c (CALL_CHECKFUN, CALL_FREEFUN): Use use_extra_arg and
- extra_arg.
- * obstack.c (_obstack_begin): Remove area_id and flags arguments
- (previously added for mmalloc support, interface has changed).
- Also convert flags usage to use use_extra_arg and maybe_empty_object.
-
-Fri Jul 10 00:41:53 1992 Fred Fish (fnf@cygnus.com)
-
- * argv.c: Move expandargv inline and eliminate static variables.
- Rewrite to always allocate in powers of two. Fix to return an
- argv with a single null string arg if passed a null string.
-
-Fri Jul 3 20:27:29 1992 Fred Fish (fnf@cygnus.com)
-
- * random.c, sigsetmask.c, strerror.c, strsignal.c: Remove
- "(void)" casts from function calls where the return value is
- ignored, in accordance with GNU coding standards.
-
-Mon Jun 29 10:54:19 1992 Fred Fish (fnf at cygnus.com)
-
- * bcopy.c, strerror.c, strsignal.c: Lint.
-
-Thu Jun 25 09:18:41 1992 K. Richard Pixley (rich@rtl.cygnus.com)
-
- * getopt.c: merge changes from make.
-
-Thu Jun 25 04:43:22 1992 John Gilmore (gnu at cygnus.com)
-
- * alloca.c: Incorporate fixes from gdb/alloca.c.
- FIXME: Eventually move gdb's alloca configuration files here,
- and remove gdb/alloca.c and its Makefile.in support.
-
-Tue Jun 23 21:56:30 1992 Fred Fish (fnf@cygnus.com)
-
- * dummy.c: Define NOTHING to /*nothing*/, change return type
- of main to int and return zero.
- * functions.def: Supply NOTHING as the fourth arg to macros
- that don't have an explicit arg, to satisfy picky preprocessors.
-
-Wed Jun 17 18:13:58 1992 Per Bothner (bothner@rtl.cygnus.com)
-
- * Makefile.in: Clean up *clean rules, as per standards.texi.
-
-Tue Jun 16 16:11:59 1992 K. Richard Pixley (rich@rtl.cygnus.com)
-
- * getopt.c, getopt1.c: merged largely gratuitous, mostly
- whitespace diffs from other prep distributions.
-
-Mon Jun 15 12:25:46 1992 Fred Fish (fnf@cygnus.com)
-
- * config/mh-ncr3000 (INSTALL): Don't use /usr/ucb/install,
- it is broken on ncr 3000's.
-
-Mon Jun 15 01:03:26 1992 John Gilmore (gnu at cygnus.com)
-
- * sigsetmask.c: Rewrite. Old one was very confused about its
- arguments and result. New one can't do much, but at least knows
- what it can't do, and it's good enough for GDB's use.
-
-Sun Jun 14 15:17:40 1992 Stu Grossman (grossman at cygnus.com)
-
- * functions.def: Use proper prototype for strtoul.
-
-Fri Jun 12 19:22:40 1992 John Gilmore (gnu at cygnus.com)
-
- * Makefile.in: Add random.c.
- * config/mh-*: Use "true" rather than "echo >/dev/null" for ranlib.
- * configure.in: update solaris2 config.
-
-Wed Jun 10 16:31:29 1992 Fred Fish (fnf@cygnus.com)
-
- * random.c: Add for random() and srandom().
- * functions.def: Add random
-
-Tue Jun 9 17:27:18 1992 Fred Fish (fnf@cygnus.com)
-
- * config/{mh-ncr3000, mh-sysv4}: Add definition for INSTALL
- using /usr/ucb/install.
-
-Mon Jun 1 13:20:17 1992 Per Bothner (bothner@rtl.cygnus.com)
-
- * strerror.c: Kludge to guard against a conflict with
- possible declaration of sys_errlist in errno.h.
-
-Sun May 31 15:07:47 1992 Mark Eichin (eichin at cygnus.com)
-
- * configure.in, config/mh-solaris: add solaris2 config support.
-
-Fri May 29 17:23:23 1992 Per Bothner (bothner@rtl.cygnus.com)
-
- * sigsetmask.c: #ifdef out sigsetmask if SIG_SETMASK
- is not defined (should be defined in signal.h, says Posix.).
-
-Mon May 18 17:35:04 1992 K. Richard Pixley (rich@cygnus.com)
-
- * getopt.c: merged changes from make-3.62.11.
-
-Fri May 8 14:53:07 1992 K. Richard Pixley (rich@cygnus.com)
-
- * getopt.c: merged changes from bison-1.18.
-
-Tue May 5 11:51:40 1992 Per Bothner (bothner@rtl.cygnus.com)
-
- * Makefile.in: Don't have $(EXTRA_OFILES) depend on config.h,
- since that introduces a circular dependency.
- ($(EXTRA_OFILES) are used to build config.h.)
-
- * strtoul.c: Fixes to handle non-decimal bases better.
-
-Wed Apr 22 09:27:51 1992 Fred Fish (fnf@cygnus.com)
-
- * config/mh-ncr3000: Replace MINUS_G with CFLAGS.
- * Makefile.dos: Finish MINUS_G eradication.
- * Makefile.in (CFILES): Add strsignal.c.
- * Makefile.in (REQUIRED_OFILES): Add strerror.o strsignal.o
- * Makefile.in (needed-list): Split creation of errors file to
- separate make target.
- * Makefile.in (config.h, needed2.awk, errors): New targets.
- * Makefile.in (clean): Split to multiple lines, add needed2.awk
- and config.h.
- * dummy.c (DEFFUNC, DEFVAR): Add defines and undefs.
- * functions.def (strerror): Remove from optional list.
- * functions.def (sys_nerr, sys_errlist, sys_siglist): DEFVAR's
- * functions.def (strerror, psignal): DEFFUNC's
- * strerror.c: Rewrite from scratch to use sys_errlist only if
- available, add errno_max(), add strerrno(), add strtoerrno(),
- add test driver.
- * strsignal.c: New file, signal equivalent to strerror.c.
- Uses sys_siglist if available, defines signo_max(), strsignal(),
- strsigno(), strtosigno(), psignal(), and test driver.
-
-Mon Apr 20 20:49:32 1992 K. Richard Pixley (rich@cygnus.com)
-
- * Makefile.in: do not print recursion line.
-
- * Makefile.in: allow CFLAGS to be passed in from command line.
- Removed MINUS_G. Default CFLAGS to -g.
-
-Mon Apr 20 12:57:46 1992 Per Bothner (bothner@rtl.cygnus.com)
-
- * config/mh-aix: New. EXTRA_OFILES lists copysign.o,
- so libg++ users don't have to be inconvenienced by a
- libc.a bug (libc.a needs copysign, but doesn't define it!).
- * configure.in: Use config/mh-aix.
- * strtoul.c: Handle '-' as required by ANSI.
- Clean up radix handling.
- * strstr.c: Fix buggy algorithm.
- * Makefile.in: Change so that ${EXTRA_OFILES} is
- appended to needed-list (which is used by libg++).
-
-Fri Apr 10 22:51:41 1992 Fred Fish (fnf@cygnus.com)
-
- * configure.in: Recognize new ncr3000 config.
- * config/mh-ncr3000: New config file.
-
-Wed Apr 1 23:31:43 1992 John Gilmore (gnu at cygnus.com)
-
- * argv.c, dummy.c: Lint.
-
-Tue Mar 31 18:46:44 1992 Fred Fish (fnf@cygnus.com)
-
- * config/mh-sysv4: New config file.
- * configure.in (host_makefile_frag): Set to config/mh-sysv4 for
- host_os == sysv4.
- * getpagesize.c: For SVR4, use sysconf(_SC_PAGESIZE) to get
- pagesize.
-
-Sun Mar 29 12:26:42 1992 John Gilmore (gnu at cygnus.com)
-
- * getopt.c: Lint.
-
-Fri Mar 27 08:32:55 1992 Fred Fish (fnf@cygnus.com)
-
- * functions.def (alloca): Fix return type and args to avoid
- type clash with gcc's builtin alloca.
-
-Tue Mar 24 23:33:42 1992 K. Richard Pixley (rich@cygnus.com)
-
- * configure.in, config/mh-irix4: irix4 support.
-
- * Makefile.in, functions.def, alloca.c: added alloca.
-
-Tue Mar 24 17:34:46 1992 Stu Grossman (grossman at cygnus.com)
-
- * obstack.c (CALL_FREEFUN): Make it compile on DECstations.
-
-Thu Mar 19 13:57:42 1992 Fred Fish (fnf@cygnus.com)
-
- * argv.c: Fix various external function definitions to be
- correct in an ANSI compilation environment.
-
-Sat Mar 14 17:28:17 1992 Fred Fish (fnf@cygnus.com)
-
- * obstack.c: Changes to support calling mmalloc functions,
- which take an additional argument over malloc functions.
-
-Fri Mar 6 22:01:10 1992 K. Richard Pixley (rich@cygnus.com)
-
- * added check target.
-
-Thu Feb 27 22:19:39 1992 Per Bothner (bothner@cygnus.com)
-
- * argv.c: #include alloca-conf.h (needed by AIX).
-
-Wed Feb 26 18:04:40 1992 K. Richard Pixley (rich@cygnus.com)
-
- * Makefile.in, configure.in: removed traces of namesubdir,
- -subdirs, $(subdir), $(unsubdir), some rcs triggers. Forced
- copyrights to '92, changed some from Cygnus to FSF.
-
-Sat Feb 22 01:09:21 1992 Stu Grossman (grossman at cygnus.com)
-
- * argv.c: Check in Fred's version which fixes problems with
- alloca().
-
-Fri Feb 7 21:46:08 1992 Stu Grossman (grossman at cygnus.com)
-
- * makefile.dos: Remove NUL to keep patch from failing.
-
-Thu Jan 30 22:48:41 1992 Stu Grossman (grossman at cygnus.com)
-
- * getopt.c (_getopt_internal): Fix usage of enum has_arg.
-
-Mon Jan 20 18:53:23 1992 Stu Grossman (grossman at cygnus.com)
-
- * getopt.c, getopt1.c, ../include/getopt.h: Get latest versions.
-
-Sat Jan 18 16:53:01 1992 Fred Fish (fnf at cygnus.com)
-
- * argv.c: New file to build and destroy standard argument
- vectors from a command string.
-
- * Makefile.in: Add argv.c and argv.o to appropriate macros.
-
-Fri Dec 20 12:12:57 1991 Fred Fish (fnf at cygnus.com)
-
- * configure.in: Change svr4 references to sysv4.
-
- * rindex.c: Declare return type of externally used function
- strrchr().
-
-Thu Dec 19 18:35:03 1991 John Gilmore (gnu at cygnus.com)
-
- * Makefile.in: Remove "***" in normal output, since Make produces
- this on errors, and it's convenient to search for.
-
-Tue Dec 17 23:21:30 1991 Per Bothner (bothner at cygnus.com)
-
- * memcmp.c, memcpy.c, memmove.c, memset.c, strchr.c, strrchr.c:
- New ANSI functions. The old non-ANSI functions (such as bcopy)
- should be avoided.
- * bcopy.c: Fix to correctly handle overlapping regions.
- * index.c, rindex.c: Re-write in terms of strchr() and strrchr().
- * functions.def: Add the new functions.
- * functions.def: Add 4th parameter to DEF macro,
- an ansidecl.h-style prototype.
- * dummy.c: Use expanded DEF macro to create a dummy function
- call, with correct parameter types. (This avoids some
- complaints from gcc about predefined builtins.)
-
- Move the functionality of config/mh-default into Makefile.in.
- This avoid duplication, and simplifies things slightly.
- * Makefile.in: Tweak so we don't need config/mh-default.
- * README: Update.
- * configure.in: No longer need config/mh-default.
- * config/mh-default: Deleted.
- * config/mh-sysv: Remove lines copied from old mh-default.
-
-Tue Dec 17 05:46:46 1991 John Gilmore (gnu at cygnus.com)
-
- * fdmatch.c (fdmatch): Don't compare st_rdev, which is for
- 'mknod' device numbers.
-
-Mon Dec 16 12:25:34 1991 Fred Fish (fnf at cygnus.com)
-
- * fdmatch.c, Makefile.in: Add new function that takes two
- open file descriptors and returns nonzero if they refer to
- the same file, zero otherwise. (used in gdb)
-
-Wed Dec 11 17:40:39 1991 Steve Chamberlain (sac at rtl.cygnus.com)
- From DJ:
- * msdos.c: stub functions for dos.
- * makefile.dos, configdj.bat: new.
- * getopt.c: Don't include alloca-conf.h in a GO32 world.
-
-
-Tue Dec 10 04:14:49 1991 K. Richard Pixley (rich at rtl.cygnus.com)
-
- * Makefile.in: infodir belongs in datadir.
-
-Fri Dec 6 23:26:45 1991 K. Richard Pixley (rich at rtl.cygnus.com)
-
- * Makefile.in: remove spaces following hyphens because bsd make
- can't cope. added standards.text support. install using
- INSTALL_DATA.
-
- * configure.in: remove commontargets as it is no longer a
- recognized hook.
-
-Thu Dec 5 22:46:46 1991 K. Richard Pixley (rich at rtl.cygnus.com)
-
- * Makefile.in: idestdir and ddestdir go away. Added copyrights
- and shift gpl to v2. Added ChangeLog if it didn't exist. docdir
- and mandir now keyed off datadir by default.
-
-Fri Nov 22 19:15:29 1991 John Gilmore (gnu at cygnus.com)
-
- * Makefile.in: find-needed.awk does not fit in 14 chars.
-
- * Makefile.in: Suppress error checking when compiling the test
- program, because Ultrix make/sh aborts there due to a bug.
-
-Fri Nov 22 12:23:17 1991 Per Bothner (bothner at cygnus.com)
-
- * Makefile.in: Re-did how EXTRA_OFILES is used to be more useful.
- * README: Explained how the auto-configuration works,
- and how to add new files and/or configurations.
-
-Fri Nov 22 09:45:23 1991 John Gilmore (gnu at cygnus.com)
-
- * strtoul.c: Avoid defining ULONG_MAX if already defined;
- cast a const char * to char * for pedants.
-
- * getopt.c: Only define "const" after local include files get to,
- and only if they haven't defined it.
-
-Thu Nov 21 16:58:53 1991 John Gilmore (gnu at cygnus.com)
-
- * getcwd.c (remove getwd.c): GNU code should call getcwd(). We
- emulate it with getwd() if available. This avoids callers having
- to find a MAXPATHLEN or PATH_MAX value from somewhere.
- * Makefile.in, functions.def: getwd->getcwd.
- * configure.in: Use generic case for every system.
- * config/mh-{delta88,mach,rs6000,svr4}: Remove.
- * config/mh-sysv: Use default handling, just add -DUSG.
-
-Thu Nov 14 10:58:05 1991 Per Bothner (bothner at cygnus.com)
-
- * Makefile.in, config/mh-default: Re-do make magic
- so that for the default ("automatic") mode we only
- compile the files we actually need. Do this using
- a recursive make: The top-level generates the list
- of needed files (loosely, the ones missing in libc),
- and then passes that list to the recursive make.
- * config/mh-mach: Remove obsolete STRERROR-{C,O} macros.
-
-Tue Nov 12 19:10:57 1991 John Gilmore (gnu at cygnus.com)
-
- RS/6000 host support (grumble).
-
- * configure.in: Build alloca-conf.h file from alloca-norm.h
- (everything else) or alloca-botch.h (rs/6000).
- * Makefile.in: Include . on the include path.
- * getopt.c: Use alloca-conf.h.
- * alloca-norm.h: How to declare alloca on reasonable machines.
- * alloca-botch.h: How to declare alloca on braindead machines.
-
-Tue Nov 12 09:21:48 1991 Fred Fish (fnf at cygnus.com)
-
- * concat.c : New file, like concat() in gdb but can take a
- variable number of arguments rather than fixed at 3 args. For
- now, client applications must supply an xmalloc(), which is a
- front end function to malloc() that deals with out-of-memory
- conditions.
-
- * Makefile.in: Add concat.c and concat.o to appropriate macros.
-
-Sat Nov 9 13:29:59 1991 Fred Fish (fnf at cygnus.com)
-
- * config/mh-svr4: Add sigsetmask to list of required functions.
-
-Sun Nov 3 11:57:56 1991 Per Bothner (bothner at cygnus.com)
-
- * vsprintf.c: New file.
- * functions.def, Makefile.in: Add vsprintf.
-
-Sun Oct 27 16:31:22 1991 John Gilmore (gnu at cygnus.com)
-
- * configure.in, config/mh-rs6000: Add rs/6000 host support.
- * Makefile.in: Compile with debug info.
-
-Fri Oct 25 17:01:12 1991 Per Bothner (bothner at cygnus.com)
-
- * Makefile.in, configure.in, and new files: dummy.c, functions.def,
- config/mf-default: Added a default configuration mode,
- which includes into libiberty.a functions that are "missing" in libc.
- * strdup.c, vprintf.c, vfprintf.c: New files.
-
-Thu Oct 24 02:29:26 1991 Fred Fish (fnf at cygnus.com)
-
- * config/hmake-svr4: New file.
-
- * config/hmake-sysv: Add HOST_CFILES and HOST_OFILES.
-
- * basename.c, bcmp.c, bcopy.c, bzero.c, getpagesize.c getwd.c,
- index.c, insque.c, rindex.c, spaces.c, strstr.c, vfork.c: New
- files containing either portable C versions or emulations using
- native library calls.
-
- * strerror.c: Add copyright, internal documentation, etc.
-
- * strtol.c: Replace hardwired hex constants with some more
- portable macros. Remove illegal (according to gcc) cast.
-
- * strtoul.c: Replace hardwired hex constant with more portable
- macro.
-
- * Makefile.in: Move TARGETLIB and CFLAGS where makefile fragments
- can override them. Add new source and object file names to CFILES
- and OFILES respectively.
-
- * configure.in: Add support for SVR4 makefile fragments.
-
-Tue Oct 22 19:00:23 1991 Steve Chamberlain (steve at cygnus.com)
-
- * Makefile.in: Move RANLIB, AR and AR_FLAGS to where they can be
- over-ridden by config/hmake-*
- * configure.in: added m88kcvs to sysv list
-
-Fri Oct 4 01:29:08 1991 John Gilmore (gnu at cygnus.com)
-
- * Makefile.in: Most hosts need strerror, but one or two don't,
- and they override these definitions in the host-dependent makefile
- fragment.
- * config/hmake-mach: The odd man out on strerror -- it's supplied.
- * strerror.c: New file.
-
- * strtol.c, strtoul.c: Add strtol to libiberty, since Mach lacks
- it and bfd uses it.
- * configure.in, Makefile.in, config/hmake-mach: Only configure
- strtol & strotoul in on Mach.
-
-Tue Sep 3 06:36:23 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- * obstack.c: Merge with latest FSF version.
-
-
-Local Variables:
-version-control: never
-End:
diff --git a/contrib/libg++/libiberty/insque.c b/contrib/libg++/libiberty/insque.c
deleted file mode 100644
index 775019f8fffc..000000000000
--- a/contrib/libg++/libiberty/insque.c
+++ /dev/null
@@ -1,50 +0,0 @@
-/* insque(3C) routines
- This file is in the public domain. */
-
-/*
-NAME
- insque, remque -- insert, remove an element from a queue
-
-SYNOPSIS
- struct qelem {
- struct qelem *q_forw;
- struct qelem *q_back;
- char q_data[];
- };
-
- void insque (struct qelem *elem, struct qelem *pred)
-
- void remque (struct qelem *elem)
-
-DESCRIPTION
- Routines to manipulate queues built from doubly linked lists.
- The insque routine inserts ELEM in the queue immediately after
- PRED. The remque routine removes ELEM from its containing queue.
-*/
-
-
-struct qelem {
- struct qelem *q_forw;
- struct qelem *q_back;
-};
-
-
-void
-insque (elem, pred)
- struct qelem *elem;
- struct qelem *pred;
-{
- elem -> q_forw = pred -> q_forw;
- pred -> q_forw -> q_back = elem;
- elem -> q_back = pred;
- pred -> q_forw = elem;
-}
-
-
-void
-remque (elem)
- struct qelem *elem;
-{
- elem -> q_forw -> q_back = elem -> q_back;
- elem -> q_back -> q_forw = elem -> q_forw;
-}
diff --git a/contrib/libg++/libiberty/strerror.c b/contrib/libg++/libiberty/strerror.c
deleted file mode 100644
index 9f3f92b3d1a7..000000000000
--- a/contrib/libg++/libiberty/strerror.c
+++ /dev/null
@@ -1,829 +0,0 @@
-/* Extended support for using errno values.
- Written by Fred Fish. fnf@cygnus.com
- This file is in the public domain. --Per Bothner. */
-
-#include "ansidecl.h"
-#include "libiberty.h"
-
-#include "config.h"
-
-#ifndef NEED_sys_errlist
-/* Note that errno.h (not sure what OS) or stdio.h (BSD 4.4, at least)
- might declare sys_errlist in a way that the compiler might consider
- incompatible with our later declaration, perhaps by using const
- attributes. So we hide the declaration in errno.h (if any) using a
- macro. */
-#define sys_errlist sys_errlist__
-#endif
-
-#include <stdio.h>
-#include <errno.h>
-
-#ifndef NEED_sys_errlist
-#undef sys_errlist
-#endif
-
-/* Routines imported from standard C runtime libraries. */
-
-#ifdef __STDC__
-#include <stddef.h>
-extern void *malloc (size_t size); /* 4.10.3.3 */
-extern void *memset (void *s, int c, size_t n); /* 4.11.6.1 */
-#else /* !__STDC__ */
-extern char *malloc (); /* Standard memory allocater */
-extern char *memset ();
-#endif /* __STDC__ */
-
-#ifndef MAX
-# define MAX(a,b) ((a) > (b) ? (a) : (b))
-#endif
-
-/* Translation table for errno values. See intro(2) in most UNIX systems
- Programmers Reference Manuals.
-
- Note that this table is generally only accessed when it is used at runtime
- to initialize errno name and message tables that are indexed by errno
- value.
-
- Not all of these errnos will exist on all systems. This table is the only
- thing that should have to be updated as new error numbers are introduced.
- It's sort of ugly, but at least its portable. */
-
-struct error_info
-{
- int value; /* The numeric value from <errno.h> */
- const char *name; /* The equivalent symbolic value */
-#ifdef NEED_sys_errlist
- const char *msg; /* Short message about this value */
-#endif
-};
-
-#ifdef NEED_sys_errlist
-# define ENTRY(value, name, msg) {value, name, msg}
-#else
-# define ENTRY(value, name, msg) {value, name}
-#endif
-
-static const struct error_info error_table[] =
-{
-#if defined (EPERM)
- ENTRY(EPERM, "EPERM", "Not owner"),
-#endif
-#if defined (ENOENT)
- ENTRY(ENOENT, "ENOENT", "No such file or directory"),
-#endif
-#if defined (ESRCH)
- ENTRY(ESRCH, "ESRCH", "No such process"),
-#endif
-#if defined (EINTR)
- ENTRY(EINTR, "EINTR", "Interrupted system call"),
-#endif
-#if defined (EIO)
- ENTRY(EIO, "EIO", "I/O error"),
-#endif
-#if defined (ENXIO)
- ENTRY(ENXIO, "ENXIO", "No such device or address"),
-#endif
-#if defined (E2BIG)
- ENTRY(E2BIG, "E2BIG", "Arg list too long"),
-#endif
-#if defined (ENOEXEC)
- ENTRY(ENOEXEC, "ENOEXEC", "Exec format error"),
-#endif
-#if defined (EBADF)
- ENTRY(EBADF, "EBADF", "Bad file number"),
-#endif
-#if defined (ECHILD)
- ENTRY(ECHILD, "ECHILD", "No child processes"),
-#endif
-#if defined (EWOULDBLOCK) /* Put before EAGAIN, sometimes aliased */
- ENTRY(EWOULDBLOCK, "EWOULDBLOCK", "Operation would block"),
-#endif
-#if defined (EAGAIN)
- ENTRY(EAGAIN, "EAGAIN", "No more processes"),
-#endif
-#if defined (ENOMEM)
- ENTRY(ENOMEM, "ENOMEM", "Not enough space"),
-#endif
-#if defined (EACCES)
- ENTRY(EACCES, "EACCES", "Permission denied"),
-#endif
-#if defined (EFAULT)
- ENTRY(EFAULT, "EFAULT", "Bad address"),
-#endif
-#if defined (ENOTBLK)
- ENTRY(ENOTBLK, "ENOTBLK", "Block device required"),
-#endif
-#if defined (EBUSY)
- ENTRY(EBUSY, "EBUSY", "Device busy"),
-#endif
-#if defined (EEXIST)
- ENTRY(EEXIST, "EEXIST", "File exists"),
-#endif
-#if defined (EXDEV)
- ENTRY(EXDEV, "EXDEV", "Cross-device link"),
-#endif
-#if defined (ENODEV)
- ENTRY(ENODEV, "ENODEV", "No such device"),
-#endif
-#if defined (ENOTDIR)
- ENTRY(ENOTDIR, "ENOTDIR", "Not a directory"),
-#endif
-#if defined (EISDIR)
- ENTRY(EISDIR, "EISDIR", "Is a directory"),
-#endif
-#if defined (EINVAL)
- ENTRY(EINVAL, "EINVAL", "Invalid argument"),
-#endif
-#if defined (ENFILE)
- ENTRY(ENFILE, "ENFILE", "File table overflow"),
-#endif
-#if defined (EMFILE)
- ENTRY(EMFILE, "EMFILE", "Too many open files"),
-#endif
-#if defined (ENOTTY)
- ENTRY(ENOTTY, "ENOTTY", "Not a typewriter"),
-#endif
-#if defined (ETXTBSY)
- ENTRY(ETXTBSY, "ETXTBSY", "Text file busy"),
-#endif
-#if defined (EFBIG)
- ENTRY(EFBIG, "EFBIG", "File too large"),
-#endif
-#if defined (ENOSPC)
- ENTRY(ENOSPC, "ENOSPC", "No space left on device"),
-#endif
-#if defined (ESPIPE)
- ENTRY(ESPIPE, "ESPIPE", "Illegal seek"),
-#endif
-#if defined (EROFS)
- ENTRY(EROFS, "EROFS", "Read-only file system"),
-#endif
-#if defined (EMLINK)
- ENTRY(EMLINK, "EMLINK", "Too many links"),
-#endif
-#if defined (EPIPE)
- ENTRY(EPIPE, "EPIPE", "Broken pipe"),
-#endif
-#if defined (EDOM)
- ENTRY(EDOM, "EDOM", "Math argument out of domain of func"),
-#endif
-#if defined (ERANGE)
- ENTRY(ERANGE, "ERANGE", "Math result not representable"),
-#endif
-#if defined (ENOMSG)
- ENTRY(ENOMSG, "ENOMSG", "No message of desired type"),
-#endif
-#if defined (EIDRM)
- ENTRY(EIDRM, "EIDRM", "Identifier removed"),
-#endif
-#if defined (ECHRNG)
- ENTRY(ECHRNG, "ECHRNG", "Channel number out of range"),
-#endif
-#if defined (EL2NSYNC)
- ENTRY(EL2NSYNC, "EL2NSYNC", "Level 2 not synchronized"),
-#endif
-#if defined (EL3HLT)
- ENTRY(EL3HLT, "EL3HLT", "Level 3 halted"),
-#endif
-#if defined (EL3RST)
- ENTRY(EL3RST, "EL3RST", "Level 3 reset"),
-#endif
-#if defined (ELNRNG)
- ENTRY(ELNRNG, "ELNRNG", "Link number out of range"),
-#endif
-#if defined (EUNATCH)
- ENTRY(EUNATCH, "EUNATCH", "Protocol driver not attached"),
-#endif
-#if defined (ENOCSI)
- ENTRY(ENOCSI, "ENOCSI", "No CSI structure available"),
-#endif
-#if defined (EL2HLT)
- ENTRY(EL2HLT, "EL2HLT", "Level 2 halted"),
-#endif
-#if defined (EDEADLK)
- ENTRY(EDEADLK, "EDEADLK", "Deadlock condition"),
-#endif
-#if defined (ENOLCK)
- ENTRY(ENOLCK, "ENOLCK", "No record locks available"),
-#endif
-#if defined (EBADE)
- ENTRY(EBADE, "EBADE", "Invalid exchange"),
-#endif
-#if defined (EBADR)
- ENTRY(EBADR, "EBADR", "Invalid request descriptor"),
-#endif
-#if defined (EXFULL)
- ENTRY(EXFULL, "EXFULL", "Exchange full"),
-#endif
-#if defined (ENOANO)
- ENTRY(ENOANO, "ENOANO", "No anode"),
-#endif
-#if defined (EBADRQC)
- ENTRY(EBADRQC, "EBADRQC", "Invalid request code"),
-#endif
-#if defined (EBADSLT)
- ENTRY(EBADSLT, "EBADSLT", "Invalid slot"),
-#endif
-#if defined (EDEADLOCK)
- ENTRY(EDEADLOCK, "EDEADLOCK", "File locking deadlock error"),
-#endif
-#if defined (EBFONT)
- ENTRY(EBFONT, "EBFONT", "Bad font file format"),
-#endif
-#if defined (ENOSTR)
- ENTRY(ENOSTR, "ENOSTR", "Device not a stream"),
-#endif
-#if defined (ENODATA)
- ENTRY(ENODATA, "ENODATA", "No data available"),
-#endif
-#if defined (ETIME)
- ENTRY(ETIME, "ETIME", "Timer expired"),
-#endif
-#if defined (ENOSR)
- ENTRY(ENOSR, "ENOSR", "Out of streams resources"),
-#endif
-#if defined (ENONET)
- ENTRY(ENONET, "ENONET", "Machine is not on the network"),
-#endif
-#if defined (ENOPKG)
- ENTRY(ENOPKG, "ENOPKG", "Package not installed"),
-#endif
-#if defined (EREMOTE)
- ENTRY(EREMOTE, "EREMOTE", "Object is remote"),
-#endif
-#if defined (ENOLINK)
- ENTRY(ENOLINK, "ENOLINK", "Link has been severed"),
-#endif
-#if defined (EADV)
- ENTRY(EADV, "EADV", "Advertise error"),
-#endif
-#if defined (ESRMNT)
- ENTRY(ESRMNT, "ESRMNT", "Srmount error"),
-#endif
-#if defined (ECOMM)
- ENTRY(ECOMM, "ECOMM", "Communication error on send"),
-#endif
-#if defined (EPROTO)
- ENTRY(EPROTO, "EPROTO", "Protocol error"),
-#endif
-#if defined (EMULTIHOP)
- ENTRY(EMULTIHOP, "EMULTIHOP", "Multihop attempted"),
-#endif
-#if defined (EDOTDOT)
- ENTRY(EDOTDOT, "EDOTDOT", "RFS specific error"),
-#endif
-#if defined (EBADMSG)
- ENTRY(EBADMSG, "EBADMSG", "Not a data message"),
-#endif
-#if defined (ENAMETOOLONG)
- ENTRY(ENAMETOOLONG, "ENAMETOOLONG", "File name too long"),
-#endif
-#if defined (EOVERFLOW)
- ENTRY(EOVERFLOW, "EOVERFLOW", "Value too large for defined data type"),
-#endif
-#if defined (ENOTUNIQ)
- ENTRY(ENOTUNIQ, "ENOTUNIQ", "Name not unique on network"),
-#endif
-#if defined (EBADFD)
- ENTRY(EBADFD, "EBADFD", "File descriptor in bad state"),
-#endif
-#if defined (EREMCHG)
- ENTRY(EREMCHG, "EREMCHG", "Remote address changed"),
-#endif
-#if defined (ELIBACC)
- ENTRY(ELIBACC, "ELIBACC", "Can not access a needed shared library"),
-#endif
-#if defined (ELIBBAD)
- ENTRY(ELIBBAD, "ELIBBAD", "Accessing a corrupted shared library"),
-#endif
-#if defined (ELIBSCN)
- ENTRY(ELIBSCN, "ELIBSCN", ".lib section in a.out corrupted"),
-#endif
-#if defined (ELIBMAX)
- ENTRY(ELIBMAX, "ELIBMAX", "Attempting to link in too many shared libraries"),
-#endif
-#if defined (ELIBEXEC)
- ENTRY(ELIBEXEC, "ELIBEXEC", "Cannot exec a shared library directly"),
-#endif
-#if defined (EILSEQ)
- ENTRY(EILSEQ, "EILSEQ", "Illegal byte sequence"),
-#endif
-#if defined (ENOSYS)
- ENTRY(ENOSYS, "ENOSYS", "Operation not applicable"),
-#endif
-#if defined (ELOOP)
- ENTRY(ELOOP, "ELOOP", "Too many symbolic links encountered"),
-#endif
-#if defined (ERESTART)
- ENTRY(ERESTART, "ERESTART", "Interrupted system call should be restarted"),
-#endif
-#if defined (ESTRPIPE)
- ENTRY(ESTRPIPE, "ESTRPIPE", "Streams pipe error"),
-#endif
-#if defined (ENOTEMPTY)
- ENTRY(ENOTEMPTY, "ENOTEMPTY", "Directory not empty"),
-#endif
-#if defined (EUSERS)
- ENTRY(EUSERS, "EUSERS", "Too many users"),
-#endif
-#if defined (ENOTSOCK)
- ENTRY(ENOTSOCK, "ENOTSOCK", "Socket operation on non-socket"),
-#endif
-#if defined (EDESTADDRREQ)
- ENTRY(EDESTADDRREQ, "EDESTADDRREQ", "Destination address required"),
-#endif
-#if defined (EMSGSIZE)
- ENTRY(EMSGSIZE, "EMSGSIZE", "Message too long"),
-#endif
-#if defined (EPROTOTYPE)
- ENTRY(EPROTOTYPE, "EPROTOTYPE", "Protocol wrong type for socket"),
-#endif
-#if defined (ENOPROTOOPT)
- ENTRY(ENOPROTOOPT, "ENOPROTOOPT", "Protocol not available"),
-#endif
-#if defined (EPROTONOSUPPORT)
- ENTRY(EPROTONOSUPPORT, "EPROTONOSUPPORT", "Protocol not supported"),
-#endif
-#if defined (ESOCKTNOSUPPORT)
- ENTRY(ESOCKTNOSUPPORT, "ESOCKTNOSUPPORT", "Socket type not supported"),
-#endif
-#if defined (EOPNOTSUPP)
- ENTRY(EOPNOTSUPP, "EOPNOTSUPP", "Operation not supported on transport endpoint"),
-#endif
-#if defined (EPFNOSUPPORT)
- ENTRY(EPFNOSUPPORT, "EPFNOSUPPORT", "Protocol family not supported"),
-#endif
-#if defined (EAFNOSUPPORT)
- ENTRY(EAFNOSUPPORT, "EAFNOSUPPORT", "Address family not supported by protocol"),
-#endif
-#if defined (EADDRINUSE)
- ENTRY(EADDRINUSE, "EADDRINUSE", "Address already in use"),
-#endif
-#if defined (EADDRNOTAVAIL)
- ENTRY(EADDRNOTAVAIL, "EADDRNOTAVAIL","Cannot assign requested address"),
-#endif
-#if defined (ENETDOWN)
- ENTRY(ENETDOWN, "ENETDOWN", "Network is down"),
-#endif
-#if defined (ENETUNREACH)
- ENTRY(ENETUNREACH, "ENETUNREACH", "Network is unreachable"),
-#endif
-#if defined (ENETRESET)
- ENTRY(ENETRESET, "ENETRESET", "Network dropped connection because of reset"),
-#endif
-#if defined (ECONNABORTED)
- ENTRY(ECONNABORTED, "ECONNABORTED", "Software caused connection abort"),
-#endif
-#if defined (ECONNRESET)
- ENTRY(ECONNRESET, "ECONNRESET", "Connection reset by peer"),
-#endif
-#if defined (ENOBUFS)
- ENTRY(ENOBUFS, "ENOBUFS", "No buffer space available"),
-#endif
-#if defined (EISCONN)
- ENTRY(EISCONN, "EISCONN", "Transport endpoint is already connected"),
-#endif
-#if defined (ENOTCONN)
- ENTRY(ENOTCONN, "ENOTCONN", "Transport endpoint is not connected"),
-#endif
-#if defined (ESHUTDOWN)
- ENTRY(ESHUTDOWN, "ESHUTDOWN", "Cannot send after transport endpoint shutdown"),
-#endif
-#if defined (ETOOMANYREFS)
- ENTRY(ETOOMANYREFS, "ETOOMANYREFS", "Too many references: cannot splice"),
-#endif
-#if defined (ETIMEDOUT)
- ENTRY(ETIMEDOUT, "ETIMEDOUT", "Connection timed out"),
-#endif
-#if defined (ECONNREFUSED)
- ENTRY(ECONNREFUSED, "ECONNREFUSED", "Connection refused"),
-#endif
-#if defined (EHOSTDOWN)
- ENTRY(EHOSTDOWN, "EHOSTDOWN", "Host is down"),
-#endif
-#if defined (EHOSTUNREACH)
- ENTRY(EHOSTUNREACH, "EHOSTUNREACH", "No route to host"),
-#endif
-#if defined (EALREADY)
- ENTRY(EALREADY, "EALREADY", "Operation already in progress"),
-#endif
-#if defined (EINPROGRESS)
- ENTRY(EINPROGRESS, "EINPROGRESS", "Operation now in progress"),
-#endif
-#if defined (ESTALE)
- ENTRY(ESTALE, "ESTALE", "Stale NFS file handle"),
-#endif
-#if defined (EUCLEAN)
- ENTRY(EUCLEAN, "EUCLEAN", "Structure needs cleaning"),
-#endif
-#if defined (ENOTNAM)
- ENTRY(ENOTNAM, "ENOTNAM", "Not a XENIX named type file"),
-#endif
-#if defined (ENAVAIL)
- ENTRY(ENAVAIL, "ENAVAIL", "No XENIX semaphores available"),
-#endif
-#if defined (EISNAM)
- ENTRY(EISNAM, "EISNAM", "Is a named type file"),
-#endif
-#if defined (EREMOTEIO)
- ENTRY(EREMOTEIO, "EREMOTEIO", "Remote I/O error"),
-#endif
- ENTRY(0, NULL, NULL)
-};
-
-#ifdef EVMSERR
-/* This is not in the table, because the numeric value of EVMSERR (32767)
- lies outside the range of sys_errlist[]. */
-static struct { int value; const char *name, *msg; }
- evmserr = { EVMSERR, "EVMSERR", "VMS-specific error" };
-#endif
-
-/* Translation table allocated and initialized at runtime. Indexed by the
- errno value to find the equivalent symbolic value. */
-
-static const char **error_names;
-static int num_error_names = 0;
-
-/* Translation table allocated and initialized at runtime, if it does not
- already exist in the host environment. Indexed by the errno value to find
- the descriptive string.
-
- We don't export it for use in other modules because even though it has the
- same name, it differs from other implementations in that it is dynamically
- initialized rather than statically initialized. */
-
-#ifdef NEED_sys_errlist
-
-static int sys_nerr;
-static const char **sys_errlist;
-
-#else
-
-extern int sys_nerr;
-extern char *sys_errlist[];
-
-#endif
-
-
-/*
-
-NAME
-
- init_error_tables -- initialize the name and message tables
-
-SYNOPSIS
-
- static void init_error_tables ();
-
-DESCRIPTION
-
- Using the error_table, which is initialized at compile time, generate
- the error_names and the sys_errlist (if needed) tables, which are
- indexed at runtime by a specific errno value.
-
-BUGS
-
- The initialization of the tables may fail under low memory conditions,
- in which case we don't do anything particularly useful, but we don't
- bomb either. Who knows, it might succeed at a later point if we free
- some memory in the meantime. In any case, the other routines know
- how to deal with lack of a table after trying to initialize it. This
- may or may not be considered to be a bug, that we don't specifically
- warn about this particular failure mode.
-
-*/
-
-static void
-init_error_tables ()
-{
- const struct error_info *eip;
- int nbytes;
-
- /* If we haven't already scanned the error_table once to find the maximum
- errno value, then go find it now. */
-
- if (num_error_names == 0)
- {
- for (eip = error_table; eip -> name != NULL; eip++)
- {
- if (eip -> value >= num_error_names)
- {
- num_error_names = eip -> value + 1;
- }
- }
- }
-
- /* Now attempt to allocate the error_names table, zero it out, and then
- initialize it from the statically initialized error_table. */
-
- if (error_names == NULL)
- {
- nbytes = num_error_names * sizeof (char *);
- if ((error_names = (const char **) malloc (nbytes)) != NULL)
- {
- memset (error_names, 0, nbytes);
- for (eip = error_table; eip -> name != NULL; eip++)
- {
- error_names[eip -> value] = eip -> name;
- }
- }
- }
-
-#ifdef NEED_sys_errlist
-
- /* Now attempt to allocate the sys_errlist table, zero it out, and then
- initialize it from the statically initialized error_table. */
-
- if (sys_errlist == NULL)
- {
- nbytes = num_error_names * sizeof (char *);
- if ((sys_errlist = (const char **) malloc (nbytes)) != NULL)
- {
- memset (sys_errlist, 0, nbytes);
- sys_nerr = num_error_names;
- for (eip = error_table; eip -> name != NULL; eip++)
- {
- sys_errlist[eip -> value] = eip -> msg;
- }
- }
- }
-
-#endif
-
-}
-
-/*
-
-NAME
-
- errno_max -- return the max errno value
-
-SYNOPSIS
-
- int errno_max ();
-
-DESCRIPTION
-
- Returns the maximum errno value for which a corresponding symbolic
- name or message is available. Note that in the case where
- we use the sys_errlist supplied by the system, it is possible for
- there to be more symbolic names than messages, or vice versa.
- In fact, the manual page for perror(3C) explicitly warns that one
- should check the size of the table (sys_nerr) before indexing it,
- since new error codes may be added to the system before they are
- added to the table. Thus sys_nerr might be smaller than value
- implied by the largest errno value defined in <errno.h>.
-
- We return the maximum value that can be used to obtain a meaningful
- symbolic name or message.
-
-*/
-
-int
-errno_max ()
-{
- int maxsize;
-
- if (error_names == NULL)
- {
- init_error_tables ();
- }
- maxsize = MAX (sys_nerr, num_error_names);
- return (maxsize - 1);
-}
-
-#ifdef NEED_strerror
-
-/*
-
-NAME
-
- strerror -- map an error number to an error message string
-
-SYNOPSIS
-
- char *strerror (int errnoval)
-
-DESCRIPTION
-
- Maps an errno number to an error message string, the contents of
- which are implementation defined. On systems which have the external
- variables sys_nerr and sys_errlist, these strings will be the same
- as the ones used by perror().
-
- If the supplied error number is within the valid range of indices
- for the sys_errlist, but no message is available for the particular
- error number, then returns the string "Error NUM", where NUM is the
- error number.
-
- If the supplied error number is not a valid index into sys_errlist,
- returns NULL.
-
- The returned string is only guaranteed to be valid only until the
- next call to strerror.
-
-*/
-
-char *
-strerror (errnoval)
- int errnoval;
-{
- char *msg;
- static char buf[32];
-
-#ifdef NEED_sys_errlist
-
- if (error_names == NULL)
- {
- init_error_tables ();
- }
-
-#endif
-
- if ((errnoval < 0) || (errnoval >= sys_nerr))
- {
-#ifdef EVMSERR
- if (errnoval == evmserr.value)
- msg = evmserr.msg;
- else
-#endif
- /* Out of range, just return NULL */
- msg = NULL;
- }
- else if ((sys_errlist == NULL) || (sys_errlist[errnoval] == NULL))
- {
- /* In range, but no sys_errlist or no entry at this index. */
- sprintf (buf, "Error %d", errnoval);
- msg = buf;
- }
- else
- {
- /* In range, and a valid message. Just return the message. */
- msg = (char *) sys_errlist[errnoval];
- }
-
- return (msg);
-}
-
-#endif /* NEED_strerror */
-
-
-/*
-
-NAME
-
- strerrno -- map an error number to a symbolic name string
-
-SYNOPSIS
-
- const char *strerrno (int errnoval)
-
-DESCRIPTION
-
- Given an error number returned from a system call (typically
- returned in errno), returns a pointer to a string containing the
- symbolic name of that error number, as found in <errno.h>.
-
- If the supplied error number is within the valid range of indices
- for symbolic names, but no name is available for the particular
- error number, then returns the string "Error NUM", where NUM is
- the error number.
-
- If the supplied error number is not within the range of valid
- indices, then returns NULL.
-
-BUGS
-
- The contents of the location pointed to are only guaranteed to be
- valid until the next call to strerrno.
-
-*/
-
-const char *
-strerrno (errnoval)
- int errnoval;
-{
- const char *name;
- static char buf[32];
-
- if (error_names == NULL)
- {
- init_error_tables ();
- }
-
- if ((errnoval < 0) || (errnoval >= num_error_names))
- {
-#ifdef EVMSERR
- if (errnoval == evmserr.value)
- name = evmserr.name;
- else
-#endif
- /* Out of range, just return NULL */
- name = NULL;
- }
- else if ((error_names == NULL) || (error_names[errnoval] == NULL))
- {
- /* In range, but no error_names or no entry at this index. */
- sprintf (buf, "Error %d", errnoval);
- name = (const char *) buf;
- }
- else
- {
- /* In range, and a valid name. Just return the name. */
- name = error_names[errnoval];
- }
-
- return (name);
-}
-
-/*
-
-NAME
-
- strtoerrno -- map a symbolic errno name to a numeric value
-
-SYNOPSIS
-
- int strtoerrno (char *name)
-
-DESCRIPTION
-
- Given the symbolic name of a error number, map it to an errno value.
- If no translation is found, returns 0.
-
-*/
-
-int
-strtoerrno (name)
- const char *name;
-{
- int errnoval = 0;
-
- if (name != NULL)
- {
- if (error_names == NULL)
- {
- init_error_tables ();
- }
- for (errnoval = 0; errnoval < num_error_names; errnoval++)
- {
- if ((error_names[errnoval] != NULL) &&
- (strcmp (name, error_names[errnoval]) == 0))
- {
- break;
- }
- }
- if (errnoval == num_error_names)
- {
-#ifdef EVMSERR
- if (strcmp (name, evmserr.name) == 0)
- errnoval = evmserr.value;
- else
-#endif
- errnoval = 0;
- }
- }
- return (errnoval);
-}
-
-
-/* A simple little main that does nothing but print all the errno translations
- if MAIN is defined and this file is compiled and linked. */
-
-#ifdef MAIN
-
-#include <stdio.h>
-
-int
-main ()
-{
- int errn;
- int errnmax;
- const char *name;
- char *msg;
- char *strerror ();
-
- errnmax = errno_max ();
- printf ("%d entries in names table.\n", num_error_names);
- printf ("%d entries in messages table.\n", sys_nerr);
- printf ("%d is max useful index.\n", errnmax);
-
- /* Keep printing values until we get to the end of *both* tables, not
- *either* table. Note that knowing the maximum useful index does *not*
- relieve us of the responsibility of testing the return pointer for
- NULL. */
-
- for (errn = 0; errn <= errnmax; errn++)
- {
- name = strerrno (errn);
- name = (name == NULL) ? "<NULL>" : name;
- msg = strerror (errn);
- msg = (msg == NULL) ? "<NULL>" : msg;
- printf ("%-4d%-18s%s\n", errn, name, msg);
- }
-
- return 0;
-}
-
-#endif
diff --git a/contrib/libg++/libio/ChangeLog b/contrib/libg++/libio/ChangeLog
deleted file mode 100644
index d7d6f14aa377..000000000000
--- a/contrib/libg++/libio/ChangeLog
+++ /dev/null
@@ -1,1799 +0,0 @@
-Tue Jun 18 18:36:58 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * Version 2.7.2.
-
-Tue Jun 18 18:24:21 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * fstream.h (fstreambase): Make __my_fb mutable.
- From Joe Buck.
-
-Tue Jun 18 11:03:53 1996 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * dbz/fake.c (main): Set return type to int.
- * dbz/dbzmain.c (main): Likewise.
- * dbz/byteflip.c (main): Likewise.
-
-Mon Jun 17 14:05:36 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * gen-params: Check if clog conflicts with system libraries.
- * stdstreams.cc: If it does, use __IO_clog.
- * iostream.h: Likewise.
-
-Tue Jun 11 13:39:31 1996 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * stdiostream.h (istdiostream (FILE*)): Put istream base
- initializer before init for __f.
- (ostdiostream (FILE*)): Likewise for ostream base init.
-
-Tue May 14 11:47:21 1996 Per Bothner <bothner@andros.cygnus.com>
-
- * strfile.h (_IO_str_fields): Removed _len field.
- (_IO_STR_DYNAMIC, _IO_STR_FROZEN): new macros.
- * strstream.h (strstreambuf::is_static): Removed.
- (strstreambuf::frozen): Use _IO_STR_DYNAMIC instead of is_static.
- * strstream.h, strstream.cc: Remove support for !_IO_NEW_STREAMS.
- * strstream.cc (strstreambuf::init_dynamic): Don't set _s._len.
- * strops.c (_IO_str_init_static): Better handling of the
- negative (== unbounded) size case.
- (_IO_str_overflow, _IO_str_underflow, _IO_str_count): Re-write
- to not use _s._len, and otherwise cleanup/fix.
- * strstream.h, strstream.cc (strstreambase::strstreambase()): Call
- ios::init here.
- (other constructors): Simplify - init already called.
-
-Tue May 14 10:55:21 1996 Per Bothner <bothner@deneb.cygnus.com>
-
- Change so that strstreambuf default constructor does no allocation.
- * strstream.h (strstreambuf::init_dynamic): Default initial size = 0.
- * strstream.cc (strstreambuf::init_dynamic): Don't allocate a
- buffer (yet) if initial_size is 0.
- * strops.c (_IO_str_overflow): Add 100 to size of re-allocated
- buffer, to handle case when initial size is 0.
-
- * iostdio.h (remove, rename, tmpfile, tempnam): Comment out.
-
-Mon May 13 23:19:39 1996 Per Bothner <bothner@deneb.cygnus.com>
-
- * fileops.c (_IO_file_close_it): Just call _IO_do_flush rather
- than _IO_file_sync, to avoid useless lseek.
-
-Tue May 14 10:48:48 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * floatconv.c (_IO_strtod): Force rv into the stack.
-
-Sat Apr 27 02:37:49 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * libioP.h (JUMP*): Implement for thunks.
- (_IO_jump_t): Add second dummy field for thunks.
-
-Thu Apr 25 13:20:00 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * config.shared (CXX): Use gcc, not g++.
-
-Wed Apr 24 10:29:50 1996 Doug Evans <dje@blues.cygnus.com>
-
- * config.shared (depend.new): Delete $(srcdir)/ from foo.{c,cc}
- for SunOS VPATH.
- * depend: Regenerated.
-
-Fri Apr 19 17:24:51 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * Version 2.8.0b3.
-
-Wed Apr 10 17:16:01 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * configure.in (ALL): Don't build iostream.a.
-
-Mon Apr 8 14:44:11 1996 Per Bothner <bothner@kalessin.cygnus.com>
-
- * iosetvbuf.c (_IO_setvbuf): Clear _IO_UNBUFFERED unless _IONBF.
-
-Mon Apr 8 15:08:23 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * configure.in: Permit --enable-shared to specify a list of
- directories.
-
-Fri Apr 5 17:48:56 1996 Per Bothner <bothner@kalessin.cygnus.com>
-
- * config.shared (MOSTLYCLEAN): Also remove ${EXTRA_MOSTLYCLEAN}.
-
-Fri Mar 22 23:25:00 1996 Ulrich Drepper <drepepr@gnu.ai.mit.edu>
-
- * genops.c (_IO_sputbackc, _IO_sungetc): Clear EOF flag if putsh
- back was successful.
-
-Wed Mar 27 11:54:08 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * Version 2.8.0b2.
-
-Fri Mar 22 15:39:36 1996 Per Bothner <bothner@kalessin.cygnus.com>
-
- * fileops.c (_IO_do_write): Revert previous fix. (It fails to
- handle the case that fp->_IO_read_end != fp->_IO_write_base.)
- (_IO_file_overflow): Instead, if _IO_read_ptr is at the end of
- the buffer, reset all the read pointers to _IO_buf_base.
-
-Tue Mar 12 12:03:17 1996 Per Bothner <bothner@kalessin.cygnus.com>
-
- * fileops.c (_IO_do_write): Even if to_do==0, must re-set buffer
- pointers. Bug and solution from Luke Blanshard <luke@cs.wisc.edu>.
-
-Wed Feb 28 10:00:24 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * Version 2.8.0b1.
-
-Tue Feb 27 18:08:16 1996 Per Bothner <bothner@kalessin.cygnus.com>
-
- * iopopen.c (_IO_proc_open): Use (char*)0 rather than imprecise NULL.
-
- * streambuf.h (ios): Add ios::binary; deprecate ios::bin.
- * filebuf.cc (filebuf::open): Handle ios::binary.
-
-Fri Feb 9 12:40:19 1996 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * cleanup.c (_IO_cleanup_registration_needed) [!_G_HAVE_ATEXIT]: Init
- to NULL.
- * filedoalloc.c (_IO_cleanup_registration_needed): Remove decl.
-
-Thu Feb 8 08:12:50 1996 Brendan Kehoe <brendan@cygnus.com>
-
- * filedoalloc.c (_IO_cleanup_registration_needed): Revert previous
- change, since cleanup.c only defines it if _G_HAVE_ATEXIT.
-
-Wed Feb 7 15:10:17 1996 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * filedoalloc.c (_IO_cleanup_registration_needed): Declare as extern.
-
-Tue Dec 12 17:21:13 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * indstream.h, instream.cc (indirectbuf::uflow): New method.
- * indstream.cc (indirectbuf::underflow): Fix to use sgetc, not sbumpc.
- Fixes bug reported by Kevin Beyer <beyer@cs.wisc.edu>.
-
- * indstream.cc (indirectbuf::seekpos): Add paranoia test.
-
-Fri Dec 8 14:55:34 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * stream.h: Add warning to not use these functions.
- * stream.cc (str, chr): Re-implement here (from libg++).
-
-Tue Nov 28 15:07:01 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * config.shared: Use test instead of [ to avoid DEC Unix lossage.
-
-Thu Nov 23 14:51:43 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * iopopen.c: Move #include <sys/types.h> ahead of #include <signal.h>
- to deal with BSDI's literal implementation of Posix.
-
-Sat Nov 25 11:21:55 1995 Doug Evans <dje@canuck.cygnus.com>
-
- * Makefile.in (install): Set rootme.
- * config.shared (TOPDIR): Set with ${foo-...} rather than ${foo=...}.
- (INSTALL): Handle absolute, dot, relative-not-dot values of srcdir.
- (TEXIDIR): Likewise.
-
-Tue Nov 21 14:12:05 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * configure.in: Check ${with_cross_host} rather than comparing
- ${host} and ${target}.
-
-Mon Nov 20 13:55:29 1995 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * configure.in: Match *-sco3.2v[45]*.
-
-Wed Nov 15 20:19:31 1995 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * config.shared (FLAGS_TO_PASS): Also pass SHLIB and SHCURSES.
-
-Tue Nov 14 01:41:08 1995 Doug Evans <dje@canuck.cygnus.com>
-
- * config.shared (TO_REAL_TOPDIR): Define.
- (MULTITOP): Deleted.
- (MULTISRCTOP, MULTIBUILDTOP): New.
- (TOPDIR): Change MULTITOP to MULTIBUILDTOP, and use TO_REAL_TOPDIR.
- (INSTALL): Add with_multisrctop, TO_REAL_TOPDIR.
- (TEXIDIR): Use TO_REAL_TOPDIR.
- (LIBS): Delete MULTITOP.
- (FLAGS_TO_PASS): Add NM.
- (CXXINCLUDES): Delete MULTITOP.
- (depend.new): Delete adding MULTITOP to ../ build tree references.
- Add MULTISRCTOP to ../ source tree references.
- * configure.in: Delete call to cfg-ml-com.in. Call config-ml.in
- instead of cfg-ml-pos.in.
-
-Sun Nov 12 16:30:48 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * Makefile.in (VERSION): Set to 2.7.1.
- * configure.in: Add warning for Linux.
- * config.shared (DISTCLEAN): Add EXTRA_DISTCLEAN.
-
- * editbuf.h (edit_mark::index_in_buffer): Avoid unused param warning.
-
- * iostream.cc (istream::operator>> (char*)): Improve ANSI compliance.
-
-Fri Nov 10 08:41:37 1995 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * config.shared (check): Add missing semicolon.
-
-Thu Nov 9 17:27:22 1995 Jason Merrill <jason@yorick.cygnus.com>
-
- * configure.in (ALL): Remove $(OSPRIM_OBJECTS).
- * config.shared (check): Set LD_LIBRARY_PATH.
- * NEWS: Fix typo.
- * iogetdelim.c (_IO_getdelim): Index *lineptr, rather than lineptr.
- From alan@spri.levels.unisa.edu.au (Alan Modra).
-
-Mon Nov 6 15:03:33 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * streambuf.cc, editbuf.cc, isgetline.cc, parsestream.cc:
- Fixes to avoid -Wall warnings.
-
-Fri Nov 3 16:41:41 1995 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * gen-params [!__STDC__]: Include varargs.h instead of stdarg.h.
-
-Thu Nov 2 15:04:03 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * config.shared: Re-write if X then Y else true fi to (not X) || Y.
-
-Wed Nov 1 13:26:44 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * iostream.h (istream::ipfx): Add default argument value.
- Reported by Yotam Medini <yotam_medini@tmai.com>.
-
- * libioP.h (_IO_blen): Fix typo.
- Reported by Bryan T. Vold <btv@ldl.healthpartners.com>.
-
-Fri Oct 27 19:26:20 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * Makefile.in (_G_config.h): Set CC to $(CC) rather than to $(CXX),
- now that CXX defaults to g++ and CC default to gcc (when found).
- * config.shared: Simplify CXX and CC, since they get overridden
- by ../configure anyway.
-
-Wed Oct 25 19:45:50 1995 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * iostdio.h: Wrap including the file with #ifndef _IOSTDIO_H.
-
-Wed Oct 25 11:14:25 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * libio.h (_IO_seekoff, _IO_seekpos): New declarations.
- * libioP.h (_IO_seekoff, _IO_seekpos): Remove declarations.
- * libioP.h: Cleanup; remove old !_IO_UNIFIED_JUMPTABLES stuff.
-
- * filebuf.cc (filebuf::~filebuf): Only call SYSYCLOSE if currently
- open. Bug found by Martin Gerbershagen <ger@ezis-ulm.de>.
-
- * streambuf.h (streambuf::pubseekoff, streambuf::pubseekpos):
- Added, from ANSI draft.
- * filebuf.cc (filebuf::open), iostream.cc (variables places), SFile.cc:
- Use pubseekoff/pubseekpos rather than sseekoff/sseekpos.
-
- * Makefile.in (install): Don't install libiostream.a.
-
- * filedoalloc.c: Also #include <unistd.h>.
-
-Mon Oct 9 18:09:54 1995 Jason Molenda <crash@phydeaux.cygnus.com>
-
- * config.shared (SUFFIXES): add .c.
-
-Tue Sep 26 16:08:01 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * procbuf.cc: Move #pragma implementation to beginning.
-
-Wed Sep 20 17:53:33 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * procbuf.h, procbuf.cc: Add #pragma interface/implementation stuff.
-
-Wed Sep 20 18:59:00 1995 John Eaton <jwe@bevo.che.wisc.edu>
-
- * procbuf.h: Protect from being included multiple times.
-
-Wed Sep 20 15:47:14 1995 John Eaton <jwe@bevo.che.wisc.edu>
-
- * procbuf.h (procbuf): Add '_next' pointer field for compatibility
- with _IO_proc_file.
-
-Wed Sep 20 13:54:02 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * config.shared: Add support for maintainer-clean target as a
- synonym for realclean.
- * dbz/Makefile.in: Likewise.
-
-Mon Sep 11 12:11:19 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * iopopen.c: #include <sys/types.h> before <sys/wait.h>.
- This is in accordance with Posix, and needed for ISC.
-
-Fri Sep 8 00:11:55 1995 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * gen-params: Use double quotes in the eval setting $TYPE to
- $VALUE, to preserve any single quotes in $VALUE.
-
-Mon Aug 21 11:39:09 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * gen-params: Test for an appropriate version of gcc before using
- mode attributes.
-
- * config.shared: Add $(PICDIR) to $ALL.
-
-Mon Aug 7 17:51:40 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * gen-params: Generate new macro _G_HAVE_SYS_CDEFS.
- * libio.h: If _G_HAVE_SYS_CDEFS, get __P from <sys/cdefs.h>.
-
-Fri Aug 4 23:21:17 1995 Paul Eggert <eggert@twinsun.com>
-
- * gen-params: When following typedef changes, allow typedefs
- that do not have a space before the defined type name,
- e.g. `typedef void *__gnuc_va_list;' as in Linux. Also,
- not require a space in the definiens, e.g. `typedef void*foo;'.
-
-Thu Aug 3 17:54:15 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * iostream.h, iostream.cc (istream::sync): Added missing method.
-
-Thu Aug 3 17:49:34 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * configure.in: Remove netbsd special case.
- * config/netbsd.mt: Removed; no longer used.
-
-Tue Jun 20 16:07:12 1995 Paul Eggert <eggert@twinsun.com>
-
- * gen-params: Take transitive closure of `typedef' relation.
- This is needed for BSD/OS 2.0, which has
- fpos_t -> off_t -> quad_t -> long long.
-
-Mon Jul 24 18:28:10 1995 Doug Evans <dje@canuck.cygnus.com>
-
- * config.shared (TOPDIR): Delete extra '/', $rootme may be empty.
-
-Sat Jul 22 13:27:45 1995 Doug Evans <dje@canuck.cygnus.com>
-
- * config.shared (depend.new): Fix quoting in DO NOT EDIT line.
-
- * Makefile.in (_G_config.h): Add multilib support.
- (install): Likewise.
- * config.shared: Likewise.
- * configure.in: Likewise.
-
-Wed Jun 28 17:40:25 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * PlotFile.h, SFile.h, builtinbuf.h, editbuf.h, fstream.h,
- indstream.h, iomanip.h, iostream.h, parsestream.h, pfstream.h,
- procbuf.h, stdiostream.h, stream.h, streambuf.h, strstream.h: Wrap
- with extern "C++".
-
-Thu Jun 22 04:34:01 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * gen-params: Surround attributes with __.
-
-Mon Jun 19 00:33:22 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * config.shared (SUBDIRS): Massage broken shells that require
- 'else true'.
-
-Sat Jun 17 11:25:38 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * streambuf.h: Declare inline members inline in class.
-
-Thu Jun 15 20:45:13 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * Makefile.in (VERSION): Update to version 2.7.0.
-
-Wed Jun 14 21:41:11 1995 Jason Merrill <jason@python.cygnus.com>
-
- * Makefile.in (STDIO_WRAP_OBJECTS): Remove stdfiles.o.
- (LIBIO_OBJECTS): Add stdfiles.o.
-
-Wed Jun 7 16:11:36 1995 Jason Merrill <jason@python.cygnus.com>
-
- * config.shared (all): Appease bash.
-
-Wed Jun 7 11:16:38 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * configure.in (MOSTLYCLEAN): Remove stamp-picdir.
-
- * config.shared (MOSTLYCLEAN): Ditto.
- (CLEAN): Don't.
-
-Mon Jun 5 18:29:39 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * config/mh-*pic: Removed.
-
- * configure.in (MOSTLYCLEAN): Remove pic objects.
- (frags): Use toplevel pic fragments.
-
- * config.shared (CXXFLAGS): Use -O3.
- (PICFLAG, PICDIR): New macros.
- (all): Depend on $(PICDIR).
- (FLAGS_TO_PASS): Pass PICFLAG.
- (.x.o): Also build pic object.
- (stamp-picdir): Create directory for pic objects.
- (MOSTLYCLEAN): Remove pic objects.
- (CLEAN): Remove stamp-picdir.
-
- * Makefile.in (iostream.list): Depend on stamp-picdir.
- (c++clean): Don't remove _G_config.h.
-
-Mon Jun 5 15:03:47 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * strstream.h, strstream.cc (strstream::strstream()): Re-implement to
- be like ostrstream::ostrestream(), and not leak memory.
-
- * streambuf.h: Use #if !_IO_UNIFIED_JUMPTABLES instead of #ifndef.
-
- * iolibio.h (_IO_rewind): Add missing flags when calling _IO_seekoff.
-
-Thu May 25 22:30:21 1995 J.T. Conklin <jtc@rtl.cygnus.com>
-
- * config/netbsd.mt (G_CONFIG_ARGS): Add defn for off_t. Another
- layer of typedefs has been added and the gen-params script can
- not handle it.
-
-Wed May 10 03:02:58 1995 Jason Merrill <jason@python.cygnus.com>
-
- * iolibio.h (_IO_rewind): Add new argument to _IO_seekoff.
-
- * config/linux.mt (LIBIOSTREAM_OBJECTS): Include $(STDIO_WRAP_OBJECTS).
- (LIBIOSTREAM_DEP): Include stdio.list.
- (LIBIOSTREAM_USE): Include `cat stdio.list`.
-
- * Makefile.in (LIBIOSTREAM_DEP): New variable.
- (LIBIOSTREAM_USE): Ditto.
- (libiostream.a): Use them.
- (iostream.list): Ditto.
- (stdio.list): New rule.
- (stdio/stdio.list): Ditto.
-
-Tue May 9 18:29:38 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * libioP.h (_IO_jump_t): Change TYPE for __dummy from int to
- _G_size_t.
-
-Sat May 6 13:50:37 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * libio.h (_IO_UNIFIED_JUMPTABLES): #define as true.
- (_IO_FILE): Remove _jumps field (#if _IO_UNIFIED_JUMPTABLES).
-
- * libioP.h (enum _IO_seekflags_): Removed.
-
- * libioP.h (_IO_setbuf_t): Change return value of setpos jumptable
- function to match C++ streambuf::setpos. (Return NULL on failure.)
- * fileops.c (_IO_file_setbuf), genops.c (_IO_default_setbuf),
- filebuf.cc, iosetvbuf.c: Update to use new setbuf conventions.
-
- * streambuf.h (streambuf): Re-order virtual functions more logically.
- * streambuf.cc (streambuf::uflow), streambuf.h: New virtual.
- * libioP.h (struct _IO_jump_t): Define using new JUMP_FIELD macro.
- And re-order in more logical order consistent with streambuf vtable.
- * fileops.c (_IO_file_jumps), iopopen.c (_IO_proc_jumps), iovfprintf.c
- (_IO_helper_jumps), streambuf.cc (_IO_streambuf_jumps), strops.c
- (_IO_str_jumps): Update accordingly, using JUMP_INIT macro.
- * stdfiles.c: Set vtable to point to _IO_file_jumps.
- * filebuf.cc, iopopen.c, iovfprintf.c (helper_vfprintf), iovsprintf.c,
- iovsscanf.c: Use macros and #if to set jumptables.
-
- * streambuf.c: _IO_streambuf_jumps and the _IO_sb_* methods are not
- needed #if _IO_UNIFIED_JUMPTABLES.
- * filebuf.cc (filebuf::__new): Also no longer needed.
- * fstream.cc (fstreambase::__fb_init, fstreambase::fstreambase): Fix.
- * stdstrbufs.c: Use filebuf vtable instead of builtinbuf's.
- * builtinbuf.h, builtinbuf.cc (builtinbuf): Commented out #if
- _IO_UNIFIED_JUMPTABLES - no longer needed.
- * strstream.cc (SET_STR_JUMPS): Does nothing now.
-
- * builtinbuf.cc, fileops.c, genops.c, iofgetpos.c, iofsetpos.c,
- ioftell.c, iopopen.c, ioseekoff.c, ioseekpos.c, iosetvbuf.c,
- iovfprintf.c, iovfscanf.c, strops.c: Use DEFUN and DEFUN_VOID.
- * filebuf.cc, fileops.c, genops.c, iopopen.c, ioseekoff.c, ioseekpos.c,
- iosetvbuf.c, iovfscanf.c: Use new JUMP_* and IO_OVERFLOW/... macros.
-
- * libioP.h (_IO_seekpos_t): Third arg is now an int (using _IOS_INPUT
- and _IOS_OUTPUT), not an enum _IO_seekflags_. Flags values are
- changed, and their sense inverted (to match streambuf::seekpos).
- * libioP.h (_IO_seekoff_t): Similarly match streambuf::seekoff.
- * filebuf.cc, fileops.c (_IO_file_fopen, _IO_file_seekoff), genops.c
- (_IO_default_seekpos, _IO_default_seekpos), iofgetpos.c, iofsetpos.c,
- iolibio.h (_IO_fseek), ioftell.c, ioseekoff.c, ioseekpos.c,
- iostream.cc, streambuf.cc, strops.c (_IO_str_seekoff), strstream.cc:
- New seekpos/seekoff conventions.
- * iostreamP.h (convert_to_seekflags): Removed - no longer needed.
-
- * iolibio.h (_IO_fread): New declaration.
-
- * dbz/Makefile.in: Re-arrange for cleaner dependencies.
-
-Fri May 5 15:55:22 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * libioP.h (_IO_JUMPS. JUMP_FIELD, JUMP0, JUMP1, JUMP2, JUMP3,
- JUMP_INIT, _IO_FINISH, _IO_OVERFLOW, ... _IO_SYSSTAT): New macros
- in preparation for new unified jumptable/vtable implementation.
- * cleanup.c, filedoalloc.c, iofclose.c, iofflush.c, iofiledoalloc.c,
- ioprims.c, iosetbuffer.c, iostrerror.c, ioungetc.c: Use DEFUN.
- * filedoalloc.c, iofclose, iofflush, iosetbuffer.c: Use new macros.
-
- * iofopen.c, iofdopen.c: Use macros and #if for new jumptables.
-
- * gen-params: Do not #include <sys/types.h>.
- Add missing quote in 'eval'.
- Do add #include <sys/types.h> in test for <sys/resource.h>.
- * config/netbsd.mt: New file, defining _G_CONFIG_ARGS (for fpos_t).
- * configure.in: Use netbsd.mt for NetBSD.
-
-Wed May 3 15:03:47 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * libioP.h (DEFUN, DEFUN_VOID, AND): New macros, from ansidecl.h.
- * iofdopen.c, iofgets.c, iofopen.c, iofputs.c, iofread.c, iofwrite.c,
- iogetdelim.c, iogetline.c, iogets.c, ioignore.c, iopadn.c, ioperror.c,
- ioputs.c, iovsprintf.c, iovsscanf.c, outfloat.c: Use DEFUN.
-
-Mon May 1 16:22:30 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * gen-params: #include <sys/types.h>. Don't use __WCHAR_TYPE__ in
- definition of _G_wchar_t. Use __attribute__ ((mode)) to get
- specific-sized ints under gcc, don't worry about int8 or int64
- otherwise. Provide defaults if deduction fails.
-
-Thu Apr 27 18:27:53 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * streambuf.h (ios::~ios): Delete _arrays.
- (_IO_NEW_STREAMS): Turn on.
- * libio.h (__adjust_column): Remove bogus declaration.
- * genops.c (_IO_set_column): Fix typo (in commented-out code).
-
-Tue Apr 25 17:14:29 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * config.shared (CXXINCLUDES): Use a shell variable with a
- different name from the make variable.
- * configure.in: Update accordingly.
-
-Mon Apr 17 17:19:40 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * streambuf.h (__adjust_column): Remove redundant declaration.
-
-Sat Apr 15 11:39:25 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * config.shared (do-clean-dvi): Also remove *.cps.
-
- * gen-params: Use ${SED} instead of sed.
-
- * libio.h: Remove #if'd out stuff (confuses makedepend).
-
- * stdstreams.cc (STD_STR): Standard streams start with ios::dec set.
-
-Fri Apr 14 23:46:31 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * iostream.h, iostream.cc (istream::read, ostream::write):
- Use streamsize for the length parameter.
-
- * streambuf.h: Removed redundant __overflow and __underflow.
-
- * fstream.h, fstream.cc: Add void fstreambase::attach(int).
-
- * iosscanf.c (_IO_sscanf): Fix non-__STDC__ missing declaration.
-
-Mon Apr 3 15:40:55 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * indstream.*: Fix prototypes of xsputn and xsgetn.
-
- * fileops.c: Avoid ??? trigraph.
-
-Mon Mar 27 16:16:38 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * iomanip.h (operator<< (ostream&, const omanip<TP>&): Define
- separately.
- (operator>> (istream&, const imanip<TP>&): Ditto.
-
-Mon Mar 27 08:56:00 1995 Brendan Kehoe (brendan@lisa.cygnus.com)
-
- * builtinbuf.cc (builtinbuf::setbuf): Cast NULL to streambuf*, to
- avoid warning/error about conversion from void*.
- * indstream.cc (indirectbuf::seekoff): Likewise.
- (indirectbuf::seekpos): Likewise.
- * filebuf.cc (filebuf::setbuf): Likewise.
- (filebuf::close): Cast NULL to filebuf*.
-
-Wed Mar 1 14:23:18 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * configure.in (DISTCLEAN): Add, with target-mkfrag.
-
-Fri Feb 24 01:01:08 1995 Jason Merrill <jason@python.cygnus.com>
-
- * configure.in (frags): Don't require so many dashes in the
- canonical target name.
-
-Sat Feb 18 13:18:30 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * streambuf.cc (streambuf::sync): Always return 0, even for
- non-flushed output. This is required by the ANSI/ISO draft.
- * genops.c (_IO_sync): Likewise always return 0.
-
-Fri Feb 17 16:33:28 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * fileops.c (_IO_file_close_it): Call _IO_file_sync, rather
- than _IO_do_flush, because we want to adjust the file pointer
- if reading and not at end (as in SVR4, and as in fflush).
- Also, make sure to return error indication if sync fails.
- (_IO_file_sync): Ignore seek error if it is ESPIPE.
- (_IO_file_seekoff): If not readable, do dumb lseek.
- * iofclose.c (_IO_fclose): If closing a non-filebuf, return -1
- if _IO_ERR_SEEN.
-
-Fri Feb 17 19:31:00 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * gen-params: Check for struct tms in <sys/times.h>, defining
- HAVE_SYS_TIMES accordingly.
-
-Wed Feb 15 21:05:11 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * strops.c (_IO_str_count): Use LEN macro.
- (_IO_str_seekoff): Update _len field.
-
-Mon Feb 6 19:29:00 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * gen-params: Default to short, long and long long for 16, 32 and
- 64 bit types, in case detection fails.
-
-Wed Jan 25 18:07:30 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * gen-params (_G_wint_t): Allow for broken promotions.
-
-Tue Jan 24 16:15:40 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * stdstrbufs.cc (_IO_fake_stdiobufs): Add an extra layer of struct,
- to force correct alignment on i960s.
- (DEF_STDIOBUF, _IO_{stdin,stdout,stderr}_buf): Update accordingly.
-
-Thu Jan 19 18:30:53 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * config.shared (CXXINCLUDES): Add libstdc++ to includes for
- building libg++.
- (LIBS): Also link with libstdc++ when building libg++ toys.
- Don't set EXPORT_ALL_VARIABLES; users will have to set
- LD_LIBRARY_PATH themselves.
-
-Fri Dec 30 16:38:13 1994 Mike Stump <mrs@cygnus.com>
-
- * config/linux.mt: Fix build problem on linux 1.0.8.
-
-Thu Dec 22 11:49:45 1994 J.T. Conklin (jtc@phishhead.cygnus.com)
-
- * config/netware.mt: Use gcc to pre-link iostream.nlm's objects
- instead of using nlmconv, so that references to functions in
- libgcc.a are resolved.
-
- * configure.in: Append .mt to target makefile fragment file names.
-
- * floatconv.c (tens, tinytens, bigtens): Added const qualifier.
-
-Tue Dec 20 09:59:50 1994 Mike Stump <mrs@cygnus.com>
-
- * gen-params (VTABLE_LABEL_PREFIX): Since some systems have GNU nm
- as nm, and they demangle by default, we have to notice this, and
- try --no-cplus (linux) or --no-demangle when running nm.
-
-Wed Dec 14 18:13:58 1994 Per Bothner <bothner@kalessin.cygnus.com>
-
- * gen-params: To determine vt-name-mangling using dummy.C add
- #include and #prama interface/implementation to avoid problem with
- assemblers that don't emit local symbols. Reported under HPUX 8
- by Thomas Arend <arend@blasius.Chemietechnik.Uni-Dortmund.DE>.
-
- * streambuf.h (ios::ios): Move inline definition after
- that of ios::init (which ios::ios calls).
-
-Sun Dec 4 19:50:32 1994 Per Bothner <bothner@kalessin.cygnus.com>
-
- * fileops.c (_IO_file_init, _IO_file_close_it, _IO_file_sync):
- Set _offset to _IO_pos_BAD, to support applications that follow
- POSIX.1 rules on mixing file handles.
-
- * fileops.c (_IO_file_overflow): Handle case that buffer was
- allocated (perhaps by setvbuf) but _IO_write_base is still 0.
-
- * iostdio.h (setbuffer): #define as _IO_setbuffer.
- * streambuf.h, filebuf.cc: Removed filebuf::do_write.
-
-Tue Nov 29 23:38:57 1994 Per Bothner (bothner@rtl.cygnus.com)
-
- * floatconv.c (setword0, setword1): Fix typo.
-
-Tue Nov 29 15:37:29 1994 Per Bothner <bothner@kalessin.cygnus.com>
-
- * config.shared: Move -fno-implicit-template from CXXFLAGS
- to LIBCXXFLAGS. Tests are better run without it.
-
- * floatconv.c (word0, word1): Re-place/re-implement using unions
- instead of casts to avoid optimizer problems.
-
- * dbz/dbzmain.c: Renamed dirname -> dir_name to avoid OSF
- header file braindamage.
-
-Sat Nov 5 19:44:00 1994 Jason Merrill (jason@phydeaux.cygnus.com)
-
- * config.shared (LIBCFLAGS): Define.
- (LIBCXXFLAGS): Define.
- (DOING_LIBGXX): Define TOLIBGXX. Change LIBS to use -lg++. Add
- LD_LIBRARY_PATH and .EXPORT_ALL_VARIABLES:.
- (FLAGS_TO_PASS): Add LIBC{,XX}FLAGS.
- (XC{,XX}FLAGS): Set to LIBCFLAGS or CFLAGS depending on $LIBDIR.
- (COMPILE.c): Define, use in .c.o rule.
- (COMPILE.cc): Define, use in .cc.o rule.
-
-Sat Nov 5 15:12:12 1994 Per Bothner <bothner@kalessin.cygnus.com>
-
- * Makefile.in (VERSION): Update to 0.67.
-
- * streambuf.h (ios::dont_close): Is now set by default.
- * fstream.h, fstream.cc (__fb_init): New function. Clears
- ios::dont_close. Change fstreambase constructors to call it.
- * strstream.cc: *strstream constructors must clear ios::dont_close.
- * iostream.cc: Simplify - don't need to set ios::dont_close.
- * ioassign.cc: Simplify - assume ios::dont_close is always set.
-
- * fstream.h, fstream.cc: If _IO_NEW_STREAMS, put the
- filebuf as a member __my_fb.
- * strstream.{h,cc}: Likewile use a strstreambuf member __my_sb.
- * streambuf.h, stdstreams.cc, ioextend.cc:
- Fix if _IO_NEW_STREAMS to not use ios::dont_close.
-
- * streambuf.h (class ios): Move rdbuf later, to avoid
- inability of g++ to inline.
- * filebuf.cc (filebuf::~filebuf): Call _IO_do_flush.
-
- * config.shared: Emit rules to make depend.
- * depend: New file.
-
-Fri Nov 4 17:19:11 1994 Per Bothner <bothner@kalessin.cygnus.com>
-
- * README: Fix typos.
- * libio.h: Add comment. Update Copyright notice.
-
-Fri Nov 4 21:46:30 1994 Paul Eggert <eggert@twinsun.com>
-
- * libio.h (__P): Change argument name spelling from
- `paramlist' to `protos' for compatibility with BSDI 1.1.
-
-Thu Nov 3 00:45:16 1994 Jason Merrill (jason@phydeaux.cygnus.com)
-
- * config.shared (CXXFLAGS): Add -fno-implicit-templates.
-
-Mon Oct 24 15:57:35 1994 Per Bothner <bothner@kalessin.cygnus.com>
-
- * config.shared: Define NOSTDIC and use it for libio too.
-
-Thu Oct 20 19:45:35 1994 Jason Merrill (jason@phydeaux.cygnus.com)
-
- * iogetdelim.c: #include <stdlib.h>.
-
-Thu Oct 20 17:09:52 1994 Per Bothner <bothner@kalessin.cygnus.com>
-
- * iostream.h: Add classes _IO_istream_withassign and
- _IO_ostream_withassign. Re-type cin, cout, cerr, clog.
- (class iostream): Don't add extra _gcount field.
- * ioassign.cc: New file. Implement operator= for cin etc.
- * streambuf.h (class ios): Change return type of operator=.
- * Makefile.in (IOSTREAM_OBJECTS): Add ioassign.o.
-
- * Makefile.in: Re-arrange, so linux.mt overrides can work.
-
- * fileops.c (_IO_file_seekoff): Optimize seeks within buffer.
-
-Wed Oct 19 14:25:47 1994 Jason Merrill (jason@phydeaux.cygnus.com)
-
- * gen-params (wint_t): Return to using __WCHAR_TYPE__ for
- compatibility with gcc versions prior to 2.6.1.
-
-Tue Oct 18 17:08:18 1994 Per Bothner <bothner@kalessin.cygnus.com>
-
- * Makefile.in: Define _G_CONFOG_H as _G_config.h for Linux. Use it.
- (IO_OBJECTS): Add iogetdelim.o.
- * config/linux.mt: New file.
- * configure.in: Select config/linux.mt if Linux.
- * iogetdelim.c: Verious cleanups, many from
- Ulrich Drepper <drepper@ipd.info.uni-karlsruhe.de>.
- * libioP.h: Add _IO_getdelim. Use (void) for no-parameter functions.
-
-Thu Oct 13 16:30:56 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * libio.h: Rename USE_DTOA to _IO_USE_DTOA for namespace reasons.
- * iostream.cc, iovfscanf.c, iovfprintf, floatconv.c:
- Update USE_DTOA -> _IO_USE_DTOA.
-
- * libio.h (_IO_feof, _IO_ferror): Move to here ...
- * iolibio: ... from here
-
- * iostream.cc (istream::get, istream::ignore, istream::read):
- Set _gcount to 0 if ipfx0 failed.
-
- * iostream.cc (flush): Do virtual function call, rather than
- going through jumptable. (To get correct method in derived class.)
- Bug and fix from John Wiegley <jw@cis.ohio-state.edu>.
-
- * iofdopen.c (O_ACCMODE): Define using O_RDWR, not O_RDWRITE.
-
- * streambuf.h (ios::rdbuf(streambuf*)): New.
- * streambuf.h (ios::operator=): Make private (i.e. dis-allow).
-
-Wed Oct 12 19:09:20 1994 Jason Merrill (jason@phydeaux.cygnus.com)
-
- * gen-params: Define _G_NO_NRV and _G_NO_EXTERN_TEMPLATES if not
- compiling with g++.
-
-Thu Oct 6 16:03:43 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * iostream.texi (ostrstream::str): Note that NUL is not written
- automatically.
-
-Wed Oct 5 17:28:29 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * iogetdelim.c (_IO_getdelim): New function.
-
-Wed Oct 5 15:40:22 1994 J.T. Conklin (jtc@phishhead.cygnus.com)
-
- * config/netware.mt: New file, first cut at Netware NLM support.
- * configure.in (*-*-netware*): Use config/netware.mt.
-
- * config.shared (NLMCONV, LD): New definition.
-
- * gen-params: check for nm in ${binutils}/nm.new.
- * config.shared: Likewise.
-
-Tue Oct 4 12:20:01 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * iomanip.h (omanip::operator<<): Make 2nd arg be const.
- Bug and fix reported by Greg McGary <gkm@magilla.cichlid.com>.
-
- * strstream.cc (strstreambuf::pcount): Simplify, to match
- ANSI/ISO specification.
-
-Mon Sep 26 15:19:52 1994 Jason Merrill (jason@deneb.cygnus.com)
-
- * gen-params: Include <wchar.h> and <wctype.h> if they exist.
-
-Thu Sep 8 14:41:41 1994 Jason Merrill (jason@deneb.cygnus.com)
-
- * iostream.h (class istream): Declare operator>>(long double&).
- (class ostream): Define operator<<(long double).
-
- * iostream.cc (istream::operator>>(long double&)): Define.
-
-Wed Sep 7 14:42:29 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * iostream.texi (Overflow): Fix bugs in example.
-
-Fri Sep 2 17:45:57 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * iostream.tex: Document a little on how to write your
- own streambuf-derived class, with an example.
-
-Tue Aug 30 13:03:57 1994 Brendan Kehoe (brendan@lisa.cygnus.com)
-
- * floatconv.c (s2b): Declare X and Y to be _G_int32_t.
- (diff, quorem): Declare BORROW, Y, and Z likewise.
- (ulp): Declare L likewise.
- (_IO_strtod): Declare L and AADJ likewise.
- (_IO_dtoa): Declare L and D likewise. Cast division of D by DS to
- _G_int32_t.
-
-Mon Aug 29 16:01:54 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * iosetvbuf.c (_IO_setvbuf): If setting _IOFBF and no
- buffer was specified, call __doallocate.
-
- * fileops.c, floatconv.c: Add a bunch of parentheses to
- shut up gcc warnings. Patch from H.J.Lu.
-
- * stdiostream.cc (stdiobuf::sys_read): Inline call to getc
- for the normal case (size==1).
-
-Sat Aug 20 12:14:52 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * Makefile.in (VERSION): Increase to 0.66.
-
-Fri Aug 19 17:28:41 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * iolibio.h: Added _IO_printf prototype.
- Added extern "C" { ... } wrappers #ifdef __cplusplus.
- Bugs reported by Neal Becker <neal@ctd.comsat.com>.
-
-Wed Aug 17 18:17:15 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * fileops.c (_IO_file_seekoff): For _IO_seek_cur, adjust for
- read-ahead before jumping to label dumb.
-
-Wed Aug 3 13:15:01 1994 H.J. Lu (hjl@nynexst.com)
-
- * libioP.h (CHECK_FILE(FILE,RET)): new, which checks for
- FILE == NULL and _IO_MAGIC_MASK.
- (COERCE_FILE(FILE)): merged into CHECK_FILE(FILE,RET)
- with typo fixes.
-
- * iofread.c, iofwrite.c: add CHECK_FILE(fp, 0);
- * iofclose.c: add CHECK_FILE(fp, EOF); remove _IO_MAGIC_MASK check.
-
- * iofflush.c, iofgetpos.c, iofputs.c, iofscanf.c,
- iofsetpos.c, iofvbuf.c, ioungetc.c:
- Add CHECK_FILE(fp, EOF) and remove COERCE_FILE(fp).
-
- * iofgets.c: add CHECK_FILE(fp, NULL) and remove COERCE_FILE(fp).
- * iofprintf.c: add CHECK_FILE(fp, -1) and remove COERCE_FILE(fp).
- * ioftell.c: add CHECK_FILE(fp, -1L) and remove COERCE_FILE(fp).
- * iosetbuffer.c: add CHECK_FILE(fp, ) and remove COERCE_FILE(fp).
-
-Fri Aug 12 15:35:39 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * iofdopen.c (_IO_fdopen): #define O_ACCMODE if it isn't.
- Still set O_APPEND if "a" is given, but don't unset it
- if it isn't. Added comment.
-
-Mon Aug 8 13:11:00 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * gen-params (VTABLE_LABEL_PREFIX): Changes in the implementation.
- For look for _*vt[$_.]7*filebuf in the nm output, because that
- matches what g++ produces and has produced. Thus it should be
- somewhat more robust.
-
-Sun Aug 7 22:52:49 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * gen-params (CC): Remove no-longer-needed -I options
- passed to xgcc (now they are implied by the -B options).
-
-Wed Jul 20 16:41:13 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * Makefile.in (tooldir): Added definition, so we can do
- 'make install' in this directory.
- Bug reported by Klamer Schutte <schutte@tpd.tno.nl>.
-
-Mon Jul 18 18:02:34 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * gen-params (VTABLE_LABEL_PREFIX): Remove filename sppearing
- by itself. Add comment explaining what is going on.
-
-Tue Dec 21 13:02:48 1993 H.J. Lu (hjl@jalod)
-
- * libio.h: define _IO_uid_t and _IO_HAVE_ST_BLKSIZE
- as _G_xxxxxxxx.
-
-Tue Dec 21 13:02:48 1993 H.J. Lu (hjl@jalod)
-
- * iopopen.c: Don't include <errno.h>. It is included in "libioP.h".
-
- * iopopen.c (_IO_proc_close) : check if fp is on the list
- before close it.
-
-Thu Jul 14 16:38:47 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * gen-params (CONFIG_NM): Make sed scripts to find vtable name
- mangling more robost for different forms of nm output.
-
-Tue Dec 21 13:02:48 1993 H.J. Lu (hjl@jalod)
-
- * iofopen.c (_IO_fopen): don't check [redundantly] fp == NULL after
- IO_file_init(&fp->_file).
-
- * iomanip.h (template<class TP> class iapp):
- change ostream to istream.
-
-Tue Jul 12 14:09:02 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * Makefile.in (VERSION): Increase to 0.65.
- * libioP.h (builtinbuf_vtable): Only define #ifdef __cplusplus.
-
- * gen-params (_G_int8_t): Only define if defined(__STDC__),
- because K&R C compilers don't have signed char.
- (_G_int64_t, _G_uint64_t): Only define if defined(__GNUC__)
- because other compilers may not have long long.
-
-Sun Mar 06 13:10:21 1994 H.J. Lu (hjl@nynexst.com)
-
- * floatconv.c (_IO_dtoa ()): fix a small memory leak, set the
- "on_stack" field to be 0 if "result" is not NULL.
-
-Sat Mar 05 13:18:20 1994 H.J. Lu (hjl@nynexst.com)
-
- * floatconv.c (_IO_dtoa ()): if the number of digits of the
- floating point number is more than the previous one, free the
- old string and allocate a new one.
- [Minor optimization to avoid Bcopy. -PB]
-
-Mon Jul 11 10:53:41 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * fileops.c (_IO_file_underflow): 'count' should be unsigned,
- since it contains the return value of read. Reported by
- Teemu Torma <tot@trema.fi>.
-
-Tue Dec 21 13:02:48 1993 H.J. Lu (hjl@nynexst.com)
-
- * floatconv.c (_IO_strtod ()): make "+" and "-" as error.
-
-Sat Jul 9 15:09:21 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- Make sure _IO_FILE::_flags is always initialized correctly, for the
- C functions (fopen, fdopen, popen), and not just the C++ functions.
- * fileops.c (_IO_file_init): Set _flags to CLOSED_FILEBUF_FLAGS.
- * fileops.c (_IO_file_fopen): Remove bogus assignment.
- * filebuf.cc (filebuf constructors): Don't pass CLOSED_FILEBUF_FLAGS
- to streambuf constructor - _IO_file_init does it instead.
- * filebuf.cc (CLOSED_FILEBUF_FLAGS): Removed.
- * iopopen.c (_IO_proc_open): Use _IO_mask_flags.
-
-Thu Jun 30 08:49:53 1994 Jason Merrill (jason@deneb.cygnus.com)
-
- * dbz/Makefile.in (mostlyclean): Add target.
-
-Wed Jun 29 09:30:12 1994 Jason Merrill (jason@deneb.cygnus.com)
-
- * gen-params: Woops, can't run a C program to determine target
- characteristics. Sigh.
-
-Tue Jun 28 03:11:33 1994 Jason Merrill (jason@deneb.cygnus.com)
-
- * gen-params: Add _G_{,u}int{8,16,64}_t, use a short C program to
- determine what all these should be rather than trying to compare
- the MAX numbers in the shell.
-
-Sun Jun 26 21:04:24 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * stdiostream.h, stdiostream.cc (stdiobuf::xsgetn): Removed.
- Too hairy. If we want to optimize it, we should do so in
- filebuf::xsgetn (or rather _IO_file_xsgetn).
-
- * stdiostream.h (class stdiobuf), stdiostream.cc: Fix parameter
- and return types of virtual function to matcher base types (Oops!).
- * streamstream.cc (stdiobuf::xsgetn, stdiobuf::xsputn):
- Optimize to call fread.fwrite directly if !buffered.
- * fileops.c: Fix comment.
-
-Fri Jun 24 11:28:18 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * stdiostream.h (istdiostream, ostdiostream): New classes.
-
- More robust final cleanup.
- * cleanup.c (_IO_register_cleanup): Register _IO_cleanup,
- rather than _IO_flush_all.
- * filedoalloc.c: Update comment.
- * genops.c (_IO_unbuffer_all): New. Makes all files unbuffered.
- * genops.c (_IO_cleanup), libioP.h: New function. Call
- _IO_flush_all, and then _IO_unbuffer_all. This is in case C++
- destructors try to do output *after* _IO_cleanup is called.
-
- Construct standard stdiobufs statically (using type punning).
- * stdstrbufs.c; Unless _STDIO_USES_IOSTREAM declare standard
- stdiobufs (for stdin, stdout, and stderr), using type punning
- (struct _IO_fake_stdiobuf). This avoids constructor-time problems.
- * stdstreams.cc: Remove the declarations of the stdiobufs.
- Instead use the new (fake) ones in stdstrbufs.cc. We no longer
- have to call ios::sync_with_stdio at constructor time.
-
- Preliminary support for new ANSI streambuf::uflow virtual.
- * libioP.h (struct _IO_jump_t): Add __uflow field.
- * genops.c (_IO_default_uflow), libioP.h: New function.
- * fileops.c (_IO_file_jumps), iopopen.c (IO_proc_jumps),
- iovfprintf.c (_IO_helper_jumps), strops.c (_IO_str_jumps),
- streambuf.cc (_IO_streambuf_jumps): Add _IO_default_uflow.
- * genops.c (__uflow): New function.
- (save_for_backup): New function. Some code shared by
- __underflow and __uflow, moved out from the former.
- (_IO_default_uflow): New function.
- * libio.h (_IO_getc): Call __uflow, not __underflow.
-
-Wed Jun 22 20:22:49 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- Make sure that the vtable of a streambuf is always valid,
- which makes ios::rdbuf simpler and faster.
- * gen-params: Add code to determine _G_VTABLE_LABEL_HAS_LENGTH,
- _G_VTABLE_LABEL_PREFIX, _G_VTABLE_LABEL_PREFIX_ID, and
- _G_USING_THUNKS, which describe how virtual function tables are named.
- * stdfiles.c (FILEBUF_LITERAL): Moved to libioP.h.
- * libioP.h (builtinbuf_vtable): New (complicated) declaration.
- * filebuf.cc (filebuf::__new), strstream.cc (SET_STR_JUMPS):
- Initialize vtable to builtinbuf_vtable, not NULL.
- * stdstrbufs.cc: New file. Same as stdfiles.c, except that
- vtable is initialized to builtinbuf_vtable, not NULL.
- * streambuf.h (ios::rdbuf): Can now simplify/optimize, due to
- above changes. Always, just return _strbuf.
- * builtinbuf.h, builtinbuf.cc (builtinbuf::vtable,
- builtinbuf::get_builtin_vtable): Removed. No longer needed.
- * streambuf.h, builtinbuf.cc (ios::_IO_fix_vtable): No longer needed.
- Only defined #ifdef _STREAM_COMPAT, for binary compatibility.
- * Makefile.in: Move stdfiles.o from IO_OBJECTS to STDIO_WRAP_OBJECTS.
- (IOSTREAM_OBJECT): Add stdstrbufs.o.
- * Makefile.in (_G_config.h): Pass $(CXXFLAGS) as part of $(CXX).
-
-Fri Feb 11 11:08:01 1994 SBPM Marc GINGOLD (marc@david.saclay.cea.fr)
-
- * iovfprintf.c (helper_vfprintf): add
- hp->_IO_file_flags = _IO_MAGIC|(_IO_IS_FILEBUF+_IO_NO_READS);
- [This is needed because _IO_vfprintf checks for _IO_UNBUFFERED. -PB]
- [Actually: don't set _IO_IS_FILEBUF. -PB]
-
-Wed Jun 22 13:49:22 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * stdiostream.cc, stdiostream.h (stdiobuf::buffered): New methods.
-
- * iofdopen.c (_IO_fdopen): Various minor improvements.
-
- * iovfscanf.c: Don't return EOF on control_failure.
-
-Tue Dec 21 13:02:48 1993 H.J. Lu (hjl@nynexst.com)
-
- * iovfscanf.c: Enforce the sequence of the conversion specifications.
-
-Fri Jun 17 20:57:22 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * iofdopen.c: Use fcntl to check that requested access mode is
- compatible with existing access mode, and to change the
- O_APPEND file status flag if need be.
-
-Thu Jun 16 17:33:50 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * streambuf.h (ios::init): Initialize all the fields.
- This may be overkill, but the current ANSI working paper requires it.
- * streambuf.h (ios::ios): Reimplement in terms of ios::init.
- * iostream.cc (Non-default constructors istream::istream,
- ostream::ostream, iostream::iostream): Cannot use a mem-initializer,
- because it is ignored if initializing a derived class. Instead,
- call ios::init.
-
-Wed Jun 15 13:35:37 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * stdstreams.cc (ISTREAM_DEF): Fix typo (it's a _fake_istream, not
- a _fake_ostream). Reported by Jason Shirk <jshirk@gomez.intel.com>.
-
- * stdiostream.h, stdiostream.cc (stdiobuf::~stdiobuf): New.
- Call _IO_do_flush.
- * stdiostream.cc (stdiobuf::sync): Call _IO_do_flush rather
- than filebuf::sync (to avoid bad seeks).
-
- * libioP.h (_IO_do_flush): Add missing parentheses.
-
-Fri Jun 3 19:16:57 1994 Jason Merrill (jason@deneb.cygnus.com)
-
- * config.shared (CXXFLAGS): Remove -fno-implicit-templates.
-
- * iomanip.h: Add explicit external instantiations.
-
-Wed Jun 1 14:14:44 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * libio.h (struct _IO_FILE_plus): Move definition from here ...
- * libioP.h (struct _IO_FILE_plus): ... to here. Since this
- file is private to the implementation, we can rename the fields
- from the implementor's to the user's name anme space.
- (This avoids a lossage on SCO, whose stdio.h has a #define _file.)
- * iofdopen.c, iofopen.c, stdfiles.c: Fix field references accordingly.
- * iopopen.c (struct_IO_proc_file): Rename fields from
- implementor's name space to user's, and update usages.
- * streambuf.h (streambuf::_vtable): Re-implement to not need
- struct _IO_FILE_plus.
- * strfile.h (struct _IO_strfile_): Likewise.
-
-Wed Jun 1 13:57:48 1994 Jason Merrill (jason@deneb.cygnus.com)
-
- * config.shared (CXXFLAGS): Use -fno-implicit-templates instead of
- -fexternal-templates.
-
-Tue May 31 08:49:28 1994 Mike Stump (mrs@cygnus.com)
-
- * genops.c, iofclose.c, iofdopen.c, iofopen.c, iopopen.c: Be
- consistent about protecting #include <stdlib.h>.
-
- * ioputs.c: Add #include <string.h>, to avoid warning on alpha.
-
- * iofdopen.c: Add #include <stdlib.h>, so that malloc works on
- machines where sizeof(int) != sizeof(void *).
-
-Mon May 30 17:26:49 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * pfstream.cc (ipfstream::ipfstream, opfstream::opfstream):
- Reverse sense of test of return value of procbuf::open.
- (It returns NULL on failure.)
-
- * filedoalloc.c (_IO_file_doallocate): Remove dead code for
- USE_MALLOC_BUF. Add code to return EOF if ALLOC_BUF fails.
-
-Sat May 28 13:47:47 1994 Jason Merrill (jason@deneb.cygnus.com)
-
- * iomanip.cc: Explicitly instantiate smanip<int> and
- smanip<ios::fmtflags>.
-
-Wed May 25 16:04:12 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * strfile.h: Use __P instead of _PARAMS.
-
-Fri May 20 11:42:17 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * libio.h: Rename _PARAMS macro to __P for better glibc and BSD
- compatibility. (Also define _PARAMS for backwards compatibility.)
- * cleanup.c, iolibio.h, ioperror.c, iovfprintf.c, iovfscanf.c,
- libioP.h: Use __P instead of _PARAMS.
- * iostdio.h: Use __P instead of _ARGS.
-
- * fileops.c (_IO_file_read): Minor stylistic tweak. (It is
- preferable to test errno *after* the error return.)
-
-Fri May 13 15:25:36 1994 Jason Merrill (jason@deneb.cygnus.com)
-
- * iostream.*: Add insertor and extractor for bool (just pretend
- it's an int).
-
-Fri May 13 14:12:03 1994 Mike Stump (mrs@cygnus.com)
-
- * gen-params: Check for builtin bool support.
-
-Wed May 11 00:48:35 1994 Jason Merrill (jason@deneb.cygnus.com)
-
- Make libg++ build with gcc -ansi -pedantic-errors
- * gen-params: #ifdef __STRICT_ANSI__, #define _G_NO_NRV.
- * pfstream.cc (ipfstream::ipfstream): Wrap use of variable-size
- array in #ifndef __STRICT_ANSI__.
-
-Fri May 6 12:42:21 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * Makefile.in (VERSION): Increase to 0.64.
-
- * isgetline.cc (istream::getline): The delimiter should *not*
- be included in the gcount().
-
- * filedoalloc.c: #include <stdlib.h> (If __STDC__) to get malloc.
- * iostream.h (ostream::put): Remove overloaded versions, to match
- new working paper. (Actually just put inside _STREAM_COMPAT, for now.)
-
-Tue May 3 14:14:57 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * genops.c (_IO_default_finish): Make robust when called
- multiple times on the same _IO_FILE*. (One way this can
- happen is by the builtinbuf destructor being followed by the
- streambuf destructor.)
-
-Mon May 2 13:55:26 1994 Jason Merrill (jason@deneb.cygnus.com)
-
- * gen-params: Actually determine wint_t rather than depending on
- cpp to provide it or defaulting to the underlying type for
- wchar_t.
-
-Sat Apr 30 14:47:30 1994 Jason Merrill (jason@deneb.cygnus.com)
-
- * gen-params: Add _G_wint_t, allow __*_TYPE__ to override values
- at compile time, fix definition of _G_ARGS.
-
-Fri Apr 29 16:55:37 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * libio.h: Remove #pragma interface. (There is no implementation.)
-
-Mon Mar 28 14:22:26 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * iostream.cc (ostream::operator<<(double)): Add/fix support
- for printing '+' when ios::showpos is set.
- (Fixes bug reported by Doug Moore <dougm@cs.rice.edu>.)
- * iostream.cc (istream::read): Set eofbit as well as failbit on eof.
- * iostream.cc (ostream::operator<<(int)): Fix conversion
- to unsigned (used to lose on INT_MIN).
- * iostream.cc (ostream::operator<<(long)): Use (unsigned long),
- rather than (unsigned) for temporary.
-
- * config.shared, Makefile.in: Remove definitions and uses
- of XTRAFLAGS. It is no longer needed, since it is
- now implied by the -B flag.
-
-Fri Mar 25 00:31:22 1994 Jason Merrill (jason@deneb.cygnus.com)
-
- * builtinbuf.h: Add put /**/ around comment on trailing #endif.
-
- * Makefile.in (c++clean): Make clean in tests subdir, too.
-
-Wed Mar 23 16:42:09 1994 Doug Evans (dje@canuck.cygnus.com)
-
- * configure.in: Remove Makefile.tem before creating it.
- Needed when configuring from read-only source trees.
-
-Wed Mar 16 14:06:42 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * stdstreams.cc: Fix so that stdiobuf are used for cin/cout/cerr,
- unless _STDIO_USES_IOSTREAM is defined.
- * filebuf.cc (filebuf::setbuf): Fix confusion about return
- value from _IO_file_setbuf.
-
-Sun Mar 13 00:54:12 1994 Paul Eggert (eggert@twinsun.com)
-
- * config.shared: Ensure that `all' precedes `.PHONY';
- BSDI 1.1 needs this.
-
-Sat Mar 12 03:58:00 1994 Paul Eggert (eggert@twinsun.com)
-
- * config.shared: Output a definition of INSTALL that uses
- $${rootme}, not ${rootme}. Most `make's don't care, but BSDI
- 1.1 `make' does.
-
-Fri Mar 4 17:33:01 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * iopopen.c: #define _POSIX_SOURCE.
- * isgetline.c (istream::getline): Various fixes.
-
-Thu Mar 3 17:58:20 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * iostream.cc (write_int): Fix test for when to add initial '0'
- when ios::oct and ios::showbase are set.
- For hex, showbase adds initial 0x (or 0X) regardless of val==0.
- Bugs reported by Phil Roth <proth@cs.uiuc.edu>.
-
-Mon Feb 21 13:18:20 1994 H.J. Lu (hjl@nynexst.com)
-
- * libio.h (_IO_PENDING_OUTPUT_COUNT(_fp)): return the
- pending output count in _fp.
-
-Fri Feb 25 09:26:57 1994 Ian Lance Taylor (ian@cygnus.com)
-
- * gen-params: For HAVE_SYS_WAIT, compile dummy.c, not dummy.C.
-
-Tue Feb 22 11:19:09 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * streambuf.h, genops.c, libioP.h: Rename references to
- _IO_FILE fields other_gbase => _IO_save_base,
- _aux_limit => _IO_backup_base, and _other_egptr => _IO_save_end.
- * libio.h: Remove no-longer needed macros _other_gbase,
- _aux_limit, and _other_egptr.
- * genops.c (__underflow, _IO_default_finishh, _IO_unsave_markers):
- Check _IO_save_base for NULL before FREEing it or calling
- _IO_free_backup_area.
-
-Thu Feb 17 15:26:59 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * gen-params: Improve deduction of _G_uint32 and _G_int32.
- Should now work for 16-bit, 32-bit, or 64-bit targets.
- * gen-params: Check for sys/wait.h using ${CC}, since it's
- now used in a C file, not a C++ file.
- * floatconv.c: Typedef _G_uint32_t as unsigned32, and use
- unsigned32 in place of unsigned long. (Needed for Alpha.)
-
-Tue Feb 8 13:40:15 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * fileops.c (_IO_file_close_it): Simplify by using _IO_do_flush.
- * fileops.c (_IO_file_finish): Don't call _IO_file_close_it -
- do it inline. Call _IO_do_flush even if _IO_DELETE_DONT_CLOSE.
- * fileops.c (_IO_file_attach): Set _IO_DELETE_DONT_CLOSE.
- * genops.c (_IO_flush_all): Only call overflow if there is
- something to write.
- * iofclose.c (_IO_fclose): Check that magic number is correct,
- and clear it when done. Avoids crashing some buggy applications.
- * iogetline.c (_IO_getline): Don't gratuitously increment old_len.
- * iogets.c (_IO_gets): Take care to get required ANSi semantics.
-
-Sun Feb 6 19:50:39 1994 Jason Merrill (jason@deneb.cygnus.com)
-
- * iomanip.cc: Explicitly instantiate operator<< and >>.
-
-Fri Feb 4 12:28:22 1994 Jason Merrill (jason@deneb.cygnus.com)
-
- * config.shared (CXXFLAGS): Use -fexternal-templates.
-
- * iomanip.h: Uncomment #pragma interface.
-
-Thu Jan 20 13:48:40 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- If no characters are read by fgets, ANSI C doesn't allow '\0' to
- be written to the buffer, but it is required by ANSI C++
- for istream::get and istream::getline. Both use _IO_getline ...
- * iogetline.c (_IO_getline): Don't write a '\0' at the end
- of the read data. The input buffer length does not include
- space for a '\0'.
- * iofgets.c, iogets.c: Change appropriately.
- Also check for _IO_ERR_SEEN, as required by ANSI.
- * isgetline.cc: Update accordingly.
-
-Mon Jan 17 13:24:26 1994 Jason Merrill (jason@deneb.cygnus.com)
-
- * Makefile.in (c++clean): Added target for compiler testing
- (i.e. make c++clean all).
-
-Mon Jan 10 11:20:42 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * libio.h (_IO_putc): Add parentheses.
- Patch from Rik Faith <faith@cs.unc.edu>.
-
-Tue Jan 4 01:32:28 1993 Hongjiu Lu (hjl@nynexst.com)
-
- * genops.c (_IO_default_xsputn):
- (_IO_default_xsgetn):
- * ioignore.c: change "_IO_size_t count" to
- "_IO_ssize_t count".
- * iogetline.c: change "_IO_size_t len" to
- "_IO_ssize_t len".
-
-Mon Dec 20 00:31:21 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * config.shared (CXXINCLUDES): Fix quoting of $(NOSTDINC).
-
-Sun Dec 19 21:03:45 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * Makefile.in (VERSION): Increase to 0.63.
-
-Fri Dec 17 13:02:44 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * iofread.c (_IO_fread): Return 0 if either size or count is 0.
- * iofwrite.c (_IO_fwrite): Return 0 if either size or count is 0.
- (This is consistent with fread, and most implementations, but not
- with a literal reading of the ANSI spec.)
- * iovfscanf.c (_IO_vfscanf): If got EOF while skipping spaces,
- set seen_eof and break (instead of returning).
- * sbscan.cc (streambuf::vscan): Set error state before returning.
- * streambuf.h: Add a forward declarations for class istream
- to work around a g++ vtable name mangling bug. (Patch from
- harry@pdsrc.hilco.com via Jeffrey A Law <law@snake.cs.utah.edu>.)
- * NEWS: New file.
-
-Sat Dec 11 16:21:08 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * iovfprintf.c (struct helper_file, _IO_helper_overflow,
- helper_vfprintf, _IO_helper_jumps): New structs and functions.
- (_IO_vfprintf): Use helper_vfprintf to make printing to
- unbuffered files more efficient.
- * genops.c (_IO_default_underflow), libioP.h: New function.
-
- * iovsscanf.c (_IO_vsscanf): The input string's length marks
- its logical end-of-file.
-
-Wed Dec 8 13:20:46 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * indstream.cc (indirectbuf::sync()): Don't crash if get_stream()
- or put_stream() are NULL; sync() both streams even if error.
-
-Sun Dec 5 19:24:29 1993 Brendan Kehoe (brendan@lisa.cygnus.com)
-
- * iostreamP.h (convert_to_seekflags): Use _IO_seek_set instead of
- 0 inside the conditial expressions.
-
- * iofsetpos.c (_IO_fsetpos): Delete unused var `pos'.
-
-Sat Dec 4 15:57:26 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * filedoalloc.c (_IO_file_doallocate): Change type of couldbetty
- to int, and type of size to _IO_size_t, instead of size_t.
- (Change needed for Ultrix, which incorrectly deliberately doesn't
- define size_t in <sys/types.h> if _POSIX_SOURCE is defined.)
-
-Thu Dec 2 22:43:03 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * fileops.c (_IO_file_finish): Remove redundant call to _IO_un_link.
- * iofclose.c (_IO_fclose): Don't call fp->_jumps->__close; it's
- too low-level. Instead call _IO_file_close_it.
- * dbz/Makefile.in (rclean, distclean): Add some missing files.
-
-Wed Dec 1 13:19:14 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * config/hpux.mt (MATH_H_INLINES): No longer define.
- Patch from Jeffrey A Law <law@snake.cs.utah.edu>.
-
-Fri Nov 26 13:28:36 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * config.shared (CINCLUDES): Define default if libg++.
- * iofread.c: Use _IO_sgetn.c.
- * iolibio.h (_IO_clearerr): Fix typo.
- * genops.c (_IO_seekmark): Return 0 on success.
- * floactconv.c (Binit): Change to static.
- * iofclose.c (_IO_fclose): Check if file is _IO_stdin, _IO_stdout,
- or _IO_stderr; if so don't try to free it. Fix from hjl@nynexst.com.
-
- * genops.c (_IO_default_sync), libioP.h: New function.
- * libioP.h (_IO_default_close): Use _IO_default_sync -same interface.
-
- * Makefile.in: Increase version to 0.62.
- * iopopen.c (_IO_proc_close): Use waitpid (available in libibarty,
- if needed), rather than wait. Don't block/ignore SIGINT etc,
- as this is counter to Posix.2.
- * iopopen.c: Chain open proc_files, and have the child close
- the ones that are open (as required by Posix.2).
-
- * fstream.h (fstreambase::rdbuf), strstream.h (strstreambase
- ::rdbuf): Call ios::rdbuf() instead of getting _strbuf directly.
-
- * sbscan.cc (streambuf::vscan): Comment out duplicate default arg.
- * floatconv.c: Recognize Alpha and i860 as little-endian.
- * streambuf.cc: Return two bogus value returns from void functions.
- * iolibio.h, iofwrite.c: Fix buffer type to (const void*).
- * libio.h: Predefine of struct _IO_FILE to help non-g++-compilers.
- * libioP.h, pfstream.cc, stdfiles.c, iovfscanf.c: Cleanup syntax junk.
- * stdstreams.cc: Minor simplification.
- * streambuf.h, builtinbuf.cc: Add non-const ios::_IO_fix_vtable()
- for temporary binary compatibility.
-
- * filedoalloc.c, fileops.c: Add _POSIX_SOURCE.
- * fileops.c, iofopen.c, iofputs.c, iostream.cc, strops.c,
- strstream.cc, genops.c: Add some missing #includes.
- * iofopen.c, iofdopen.c: Return NULL if malloc fails.
- * iovfscanf.c: Fix return type in strtol prototype.
- * fwrite.c: Remove bogus file.
-
-Wed Nov 17 14:09:42 1993 Per Bothner (bothner@cygnus.com)
-
- * builtinbuf.cc (ios::_IO_fix_vtable), streambuf.h: Make method
- const, to reduce problems with -Wcast-qual.
-
-Tue Nov 16 19:30:42 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com)
-
- * config.shared (CXXINCLUDE): use ${} instead of $() for NOSTDINC
-
-Tue Nov 16 14:15:45 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * iopopen.c (_IO_proc_close): Re-structure to avoid
- declarations after statements.
- * floatconv.c: If not __STDC__, #define DBL_MANT_DIG.
- * config/isc.mt (G_CONFIG_ARGS): Remove bogus spaces.
- Patch from David A. Avery <daa@nic.cerf.net>.
-
-Tue Nov 16 15:58:31 1993 Mark Eichin (eichin@cygnus.com)
-
- * Makefile.in (_G_config.h): explicitly use $(SHELL) to run
- gen-params, since we know it is a script (we're explicitly looking
- in ${srcdir} for it) and /bin/sh might not be good enough.
-
-Mon Nov 15 13:26:22 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * builtinbuf.cc: Don't depend on initialization of static
- variable builtinbuf::vtable, since that might happen after
- we need it (for a static constructor). Instead, initialize
- it when needed by inlining the code from get_builtin_vtable
- into ios::_IO_fix_vtable().
-
- * floatconv.c: Avoid using #elif, which some C compilers lack.
- * iogetline.c, libioP.h: Make char parameter be int, to avoid
- some default promotion anomalies.
-
-Fri Nov 5 11:49:46 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * config.shared (do-clean-dvi): Remove TeX work files.
- * iopopen.c (extern _IO_fork): Don't use parameter type void.
- * strops.c (_IO_str_init_static): Clear the allocate_buffer
- function pointer, to mark the strfile as being static.
- Bug fix from Mike Raisbeck <mike@pudding.rtr.COM>.
-
-Thu Nov 4 10:44:24 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * filebuf.cc (filebuf:): Use sseekoff rather than seekoff
- (which loses if vtable pointer is NULL).
-
- * iostream.cc (ostream::operator<<(long long n)): Fix thinko.
-
- * Makefile.in (VERSION): Increase to 0.60.
- * Makefile.in (IO_OBJECTS): Added iopopen.o.
- * config.shared (DISTCLEAN): Also remove Make.pack.
- * config.shared (CXXINCLUDES): Add $(NOSTDINC).
-
- * config.shared (INSTALL): Fix so it ues the correct install.sh
- whether $srcdir is absolute or relative.
-
- * floatconv.c (DBL_MAX_10_EXP): Fix default value.
-
-Wed Nov 3 10:20:49 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * gen-params: Make more robust to allow random junk (NeXT
- has spaces) before typedefs.
-
- * fileops.c (_IO_file_overflow): Reduce code duplication.
- * Makefile.in (IO_OBJECTS): Remove ioputs.o.
-
- * iovfscanf.c, libio.h: Extra parameter to _IO_vfscanf,
- for optionally setting an error indication..
- * iofscanf.c, ioscanf.c, iofscanf.c, iovsscanf.c: Fix calls to
- _IO_vfscanf to pass an extra NULL.
- * sbscan.cc (streambuf::vscan): If passed an extra stream,
- set its error state (using new _IO_vfscanf parameter.
-
- * filedoalloc.c, fileops.c, genops.c, iogetline.c, ioignore.c,
- libio.h, libioP.h, streambuf.cc streambuf.h, strfile.h, strops.c,
- strstream.cc: Replace macros (_base, _ebuf, _eback, _gptr, _egptr,
- _pbase, _pptr, _epptr) by field names (_IO_buf_base, _IO_buf_end,
- _IO_read_base, _IO_read_pre, IO_read_end, _IO_write_base,
- _IO_write_ptr, _IO_write_end).
- * libio.h: Remove the old macros (which fixes a conflict.
-
-Mon Nov 1 15:22:12 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * iostream.cc: Use _IO_sputn instead of sputn. _IO_sputn does
- not require a vtable pointer, and is also slightly faster.
-
- * builtinbuf.{h,cc} (builtinbuf::setbuf): Fix return and
- parameter types.
-
-Mon Oct 25 12:56:33 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- Kludge to make sure _IO_FILE buffers get flushed before exit.
- * dbz/dbzmain.c, dbz/fake.c, dbz/byteflip.c:
- Invoke DBZ_FINISH macro (if defined) before (normal) exits.
- * dbz/Makefile.in (CFLAGS): Define DBZ_FINISH to call _IO_flush_all.
-
-Sat Oct 23 22:10:53 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * Makefile.in (VERSION): Set to 0.60 for libg++ release.
- * fileops.c (_IO_file_attach): Set _offset to _IO_pos_BAD.
- * iostream.cc (ostream::flush): Fix thinkp.
- * editbuf.cc, isgetsb.cc, isscan.cc, osform.cc, parsestream.cc,
- pfstream.cc, sbform.cc, sbscan.cc, stdstreams.cc, stream.cc:
- Replace #include "ioprivate.h" by #include "libioP.h" (and
- sometimes stdarg.h, stdlib.h and/or string.h).
- * ioprivate.h: Removed.
-
-
-Thu Oct 21 19:24:02 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * PlotFile.h, SFile.h, editbuf.cc, editbuf.h, filebuf.cc,
- fstream.cc, fstream.h, indstream.cc, indstream.h, iomanip.cc,
- iomanip.h, ioprivate.h, iostream.cc, iostream.h, isgetline.cc,
- isgetsb.cc, parsestream.cc, parsestream.h, pfstream.cc,
- pfstream.h, procbuf.cc, procbuf.h, stdiostream.cc, stdiostream.h,
- stdstreams.cc, streambuf.cc, streambuf.h, strstream.cc,
- strstream.h: Remove old (duplicate) copyright notices.
-
- * iostream.cc: Fix calls to sync() to be safe in the presence
- of vtable-less streambufs.
-
-Wed Oct 20 15:22:04 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * streambuf.h (streambuf::underflow, streambuf::overflow):
- Don't make virtual functions pure.
- * streambuf.cc (streambuf::underflow, streambuf::overflow):
- Default definitions (return EOF).
- * fstream.h: Add new (int fd, char* buf, int len) constructors.
- These are deprecated, but added for AT&T compatibility.
- * fstream.cc fstreambase::fstreambase(int fd, char *p, int l): New.
-
-Thu Oct 14 14:57:01 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com)
-
- * configure.in: use 'mv -f' instead of 'mv'
-
-Tue Oct 12 05:01:44 1993 Mike Stump (mrs@cygnus.com)
-
- * floatconv.c: Fix typo, change __STDC to __STDC__.
-
-Mon Oct 11 17:03:12 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * cleanup.c: It should be #if _G_HAVE_ATEXIT, not #ifdef.
-
- * floatconv.c, iostrerror.c, iovfprintf.c, iovfscanf.c, libioP.h:
- Bunch of fixes to allow use of non-ANSI (K&R) C compilers.
-
- * Makefile.in (iostream.list): Use CC=$(CXX) to force use of gcc.
- * README: New file.
-
-Fri Oct 8 16:19:58 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * Makefile.in: Move ioungetc.o from STDIO_WRAP_OBJECTS to
- IO_OBJECTS (since it is needed for iovfscanf.c).
- * iostrerror.c: Add declaration of strerror.
-
-Thu Oct 7 12:02:28 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * cleanup.c: New file, to cause flushing at exit.
- * filedoalloc.c: Cause flushing on exit.
- * Makefile.in (OSPRIM_OBJECTS): Add cleanup.o.
- * gen-params: Check for atexit.
-
-Tue Oct 5 19:11:14 1993 Mike Stump (mrs@cygnus.com)
-
- * ioperror.c (_IO_strerror): Add missing ()s in _PARAMS usage.
-
-Tue Oct 5 10:33:37 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * iofprintf.c, iofscanf.c, ioprintf.c, ioscanf.c, iosprintf.c,
- iosscanf.c: Remove bogus semi-colon after va_dcl.
- * ioperror.c: Fix typos in declaration.
-
-Mon Oct 4 17:12:22 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * configure.in (CLEAN): Define (as _G_config.h *.a).
-
- * fileops.c (_IO_file_read): Don't assume EINTR is defined.
- * iosetbuf.c: Replace by generalized ...
- * iosetbuffer.c: ... variant, derived from BSD.
- * Makefile.in (STDIO_WRAP_OBJECTS): Change correspondingly.
- * iosetvbuf.c (iosetvbuf): Minor ANSI tweak.
- * iostdio.h (setbuf, setlinebuf): New #defines.
- * iolibio.h (_IO_setbuf, _IO_setlinebuf): (Re-)define as macros.
- * Makefile.in (LIBIO_OBJECTS): New macro.
-
-Tue Sep 28 14:15:52 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * libioP.h (_IO_proc_open, _IO_proc_close): Add missing return types.
- * procbuf.cc: Belated fixes.
-
-Mon Sep 27 14:04:47 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * Makefile.in: List new files. Add STDIO_WRAP_OBJECTS macro.
- * floatconv.c (d2b): Use Exp_msk11 instead of Exp_msk1.
- * iofgetpos.c (_IO_fgetpos), iofsetpos.c (_IO_fsetpos): Clean up.
- * iolibio.h: New file. Declarations of _IO_foo, for most foo
- where foo is a stdio function. (Remove these from libio.h.)
- * iostream.h (istream::istreambuf, ostream::ostreambuf): Move
- obsolete functions inside #ifdef _STREAM_COMPAT.
- * libio.h, libioP.h, streambuf.h, parsestream.h, stdiostream.h:
- Use _IO_fpos_t rather than _IO_pos_t.
- * iopopen.c: New file type, for pipe (popen-like) streams.
- * procbuf.cc: Now just a C++ wrapper for the files in iopopen.c.
- * streambuf.h (ios::unsetf): Return complete old value of flags.
- * iogets.c (_IO_gets(), ioungetc.c (_IO_ungetc), ioperror.c
- (_IO_perror), iostrerror.c (_IO_strerror): New files and
- functions, for stdio implementation.
- * iostdio.h: Add declarations for various recently-added functions.
-
-Sun Sep 12 14:24:55 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * streambuf.h (ios::showpos):: Fix typo.
-
-Fri Aug 27 12:05:47 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * iopadn.c (_IO_padn): Change to return count of chars written.
- * outfloat.c, iovfprintf.c: Change for new _IO_padn interface.
- * iostream.cc (ostream::operator<<): Make sure to set badbit
- on a failure (many places). Use _IO_padn more.
- * iostream.cc (ostream& ostream::operator<<(const void *p): Move to
- * osform.cc: ... here, to reduce linking-in-the-world syndrome.
- * osform.cc: Use rdbuf(), instead of _strbuf directly.
-
- * genops.c (_IO_sgetn), libio.h: New function.
- * streambuf.h (streambuf.h::sgetn): Use _IO_sgetn.
- * SFile.cc (SFile::operator[]): Use sseekoff, not seekoff.
-
-Thu Aug 26 10:16:31 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com)
-
- * config.shared (SUBDIRS): only recurse if the directory is configured
-
-Wed Aug 25 12:56:12 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * config/{hpux.mt, isc.mt, sco4.mt}:
- Moved from ../libg++/config (since they affect _G_config.h).
- * configure.in: Set target_make_frag to one of the above files.
-
-Fri Aug 20 00:53:14 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * iofopen.c (iofopen): Fix type passed to _IO_un_link().
- * Makefile.in (_G_config.h): Pass $CC (not $CXX) as CC.
-
- * configure.in (configdirs): Add dbz and stdio.
- * fileops.c (_IO_file_seekoff): Convert more old functionality.
- * iofdopen.c: Use mode parameter to set _flags.
- * iofscanf.c, ioputs.c, ioscanf.c, iosprintf.c: New files.
- * Makefile.in (IO_OBJECTS): Added new objects.
- * iostdio.h: Add feof. fscanf, puts, sprintf, vsprintf.
- * libio.h: Add _IO_vprintf macro.
- * iofopen.c: Invoke _IO_un_link if failure.
- * iovsprintf.c: Write terminating NUL.
-
- * libioP.h: Add COERCE_FILE macro (by default does nothing).
- * iofclose.c, iofflush.c, iofgets.c, iofprintf.c, iofputs.c,
- iofread.c, ioftell.c, iofwrite.c, iosetbuf.c, iosetvbuf.c:
- Invoke COERCE_FILE macro.
- * ioftell.c: Use _IO_seekoff.
-
-Wed Aug 18 22:49:56 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * sbform.cc (streambuf::form), sbscan.cc (streambuf::scan):
- Remove cast to _IO_va_list. (Loses if array type.)
-
- * libio.h: Handle _IO_va_list for systems that need <stdarg.h>.
- * floatconv.h: Fix typo (reported by H.J.Lu).
-
-Wed Aug 18 19:34:04 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com)
-
- * configure.in (INSTALLDIR): handle native vs. cross case
-
- * Makefile.in (install): don't use $TARGETLIB, set INSTALLDIR to
- $(libdir)
-
-Wed Aug 18 12:10:03 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * Makefile.in: Rename iostream-files to iostream.list.
- * configure.in: Add iostream.list to MOSTLYCLEAN.
-
-Tue Aug 17 18:56:59 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * Makefile.in: Depend on _G_config.h where appropriate.
- * config.shared (CXXINCLUDES): If doing libg++, search ../libio.
-
-Tue Aug 17 17:34:24 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- New directory. Based on old libg++/iostream code,
- but extensively re-written.
-
-
diff --git a/contrib/libg++/libio/Makefile.in b/contrib/libg++/libio/Makefile.in
deleted file mode 100644
index c78639a3e229..000000000000
--- a/contrib/libg++/libio/Makefile.in
+++ /dev/null
@@ -1,124 +0,0 @@
-# Copyright (C) 1993, 1995 Free Software Foundation
-#
-# 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.
-
-srcdir = .
-
-VERSION = 2.7.2
-# The config file (overriden by Linux).
-_G_CONFIG_H=_G_config.h
-tooldir = $(exec_prefix)/$(target)
-INSTALLDIR = $(libdir)
-
-IO_OBJECTS = filedoalloc.o floatconv.o genops.o fileops.o \
- iovfprintf.o \
- iovfscanf.o ioignore.o iopadn.o \
- iofgetpos.o iofread.o iofscanf.o \
- iofsetpos.o iogetdelim.o iogetline.o \
- ioprintf.o ioseekoff.o ioseekpos.o \
- outfloat.o strops.o iofclose.o iopopen.o ioungetc.o
-
-# These emulate stdio functionality, but with a different name (_IO_ungetc
-# instead of ungetc), and using _IO_FILE instead of FILE.
-# They are not needed for C++ iostream, nor stdio, though some stdio
-# files are build using the same source files (see stdio/configure.in).
-# They are needed for iostdio.h. They are needed under Linux to avoid
-# version incompatibility problems with the C library.
-# iofclose.o is not here, because it is needed for stdio (by pclose).
-STDIO_WRAP_OBJECTS = iofdopen.o iofflush.o iofgets.o iofopen.o iofprintf.o iofputs.o iofwrite.o \
- iogets.o ioperror.o ioputs.o ioscanf.o iosetbuffer.o iosetvbuf.o \
- iosprintf.o iosscanf.o ioftell.o iovsprintf.o iovsscanf.o
-
-IOSTREAM_OBJECTS = builtinbuf.o filebuf.o fstream.o \
- indstream.o ioassign.o ioextend.o iomanip.o iostream.o \
- isgetline.o isgetsb.o isscan.o \
- osform.o procbuf.o sbform.o sbgetline.o sbscan.o \
- stdiostream.o stdstrbufs.o stdstreams.o stream.o streambuf.o strstream.o \
- PlotFile.o SFile.o parsestream.o pfstream.o editbuf.o
-
-# These files define _IO_read etc, which are just wrappers for read(2) etc.
-# They need to be changed to use name-space-clean (e.g. __read) versions
-# for each specific libc.
-OSPRIM_OBJECTS = ioprims.o iostrerror.o cleanup.o
-
-LIBIOSTREAM_OBJECTS = $(IO_OBJECTS) $(IOSTREAM_OBJECTS) $(OSPRIM_OBJECTS)
-LIBIO_OBJECTS = $(IO_OBJECTS) $(STDIO_WRAP_OBJECTS) $(OSPRIM_OBJECTS) stdfiles.o
-
-LIBIOSTREAM_DEP = $(LIBIOSTREAM_OBJECTS)
-LIBIOSTREAM_USE = $(LIBIOSTREAM_OBJECTS)
-
-USER_INCLUDES = *.h
-
-#### package, host, target, and site dependent Makefile fragments come in here.
-##
-
-libio.a: $(_G_CONFIG_H) $(LIBIO_OBJECTS)
- -rm -rf libio.a
- $(AR) $(AR_FLAGS) libio.a $(LIBIO_OBJECTS)
- $(RANLIB) libio.a
-
-libiostream.a: $(_G_CONFIG_H) $(LIBIOSTREAM_DEP)
- -rm -rf libiostream.a
- $(AR) $(AR_FLAGS) libiostream.a $(LIBIOSTREAM_USE)
- $(RANLIB) libiostream.a
-
-test: test.o libio.a
- $(CC) -o test test.o libio.a
-tpipe: tpipe.o libio.a
- $(CC) -o tpipe tpipe.o libio.a
-
-iostream.list: stamp-picdir $(_G_CONFIG_H) $(LIBIOSTREAM_DEP)
- @echo "$(LIBIOSTREAM_USE)"> iostream.list
-
-stdio/stdio.list: force
- @rootme=`pwd`/ ; export rootme; cd stdio ; \
- $(MAKE) $(FLAGS_TO_PASS) stdio.list
-
-stdio.list: stdio/stdio.list
- rm -f tstdio.list
- sed 's,\([a-z_]*\.o\),stdio/\1,g' stdio/stdio.list > tstdio.list
- mv tstdio.list stdio.list
-
-_G_config.h: ${srcdir}/gen-params
- rootme=`pwd`/ ; export rootme; \
- CC="$(CC)"; export CC; \
- CXX="$(CXX) $(NOSTDINC) $(CXXFLAGS)"; export CXX; \
- CONFIG_NM="$(NM)"; export CONFIG_NM; \
- $(SHELL) ${srcdir}/gen-params LIB_VERSION=$(VERSION) $(G_CONFIG_ARGS) >tmp-params.h
- mv tmp-params.h _G_config.h
-
-install:
- rootme=`pwd`/ ; export rootme ; \
- if [ -z "$(MULTISUBDIR)" ]; then \
- if [ "$(_G_CONFIG_H)" != "" ]; then \
- rm -f $(tooldir)/include/_G_config.h ; \
- $(INSTALL_DATA) _G_config.h $(tooldir)/include/_G_config.h || exit 1; \
- else true; \
- fi ; \
- cd $(srcdir); \
- for FILE in $(USER_INCLUDES) ; do \
- rm -f $(gxx_includedir)/$$FILE ; \
- $(INSTALL_DATA) $$FILE $(gxx_includedir)/$$FILE ; \
- chmod a-x $(gxx_includedir)/$$FILE ; \
- done ; \
- else true; \
- fi
- @rootme=`pwd`/ ; export rootme ; \
- $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=install
-
-c++clean:
- rm -rf $(IOSTREAM_OBJECTS)
- @$(MAKE) $(FLAGS_TO_PASS) "DODIRS=tests" DO=clean subdir_do
diff --git a/contrib/libg++/libio/NEWS b/contrib/libg++/libio/NEWS
deleted file mode 100644
index 4a4ade283704..000000000000
--- a/contrib/libg++/libio/NEWS
+++ /dev/null
@@ -1,51 +0,0 @@
-*** Major changes in libio version 2.7.0:
-
-* The data representations of _IO_FILE and streambufs have been modified.
- The layout of the jump-table table _IO_jumps_t has been re-arranged
- to match that of a virtual function table of a streambuf. Therefore,
- we no longer need a separate _IO_FILE::_jumps pointer; instead it can
- be shared with the virtual function table pointer. In addition to
- saving space, this also removes the overhead when double indirection
- was needed, and there are many simplificatons (e.g. we no longer need
- the builtinbuf class.
-
-* The streambuf::uflow virtual has been added, to match the standard.
-
-* The ifstream, ofstream, and fstream classes now include the filebuf
- as a member, rather than being pointed to it. Various related changes.
-
-* Version number changed to generally follow libg++ (and gcc).
-
-*** Major changes in libio version 0.66 (released with libg++ 2.6.1):
-
-* Some documentation and an example in iostream.texi on how to derive
- your own class from streambuf.
-
-* New functions added to stdio: getline, detdelim, snprintf, vsnprintf.
- This is for compatibility with the GNU C library.
-
-*** Major changes in libio version 0.65 (released with libg++ 2.6):
-
-* _IO_getline and streambuf::sgetline no longer write a '\0' at the end.
-
-* A number of improvements to get closer to the ANSI/ISO C++ working
-paper, such as:
-- Added (preliminary support for) new ANSI streambuf::uflow virtual.
-- Added istdiostream and ostdiostream classes.
-- Added ostream::operator<<(bool) and istream::operator>>(bool&).
-
-* More robust (and faster) initialization and cleanup of standard streambufs.
-
-* Many small bug fixes, portability improvements, and random enhancements.
-
-*** Major changes in libio version 0.63 (released with libg++ 2.5.3):
-
-* There is a g++ bug that causes inconsistent name mangling for the
-assembler name of the virtual function table for the istream class.
-A work-around has been put into streambuf.h, which will make g++
-always do the right thing. Note that this may require you to
-recompile programs that were incorrectly compiled by g++.
-
-* Functions that do printf-style formatting to the unbuffered
-streams have been optimized to write to a temporary buffer.
-
diff --git a/contrib/libg++/libio/PlotFile.cc b/contrib/libg++/libio/PlotFile.cc
deleted file mode 100644
index 98b2d839555d..000000000000
--- a/contrib/libg++/libio/PlotFile.cc
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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. */
-
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988, 1992, 1993 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
- converted to use iostream library by Per Bothner (bothner@cygnus.com)
-
-This file is part of the GNU IO Library. This library is free
-software; you can redistribute it and/or modify it under the
-terms of the GNU General Public License as published by the
-Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-This library is 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 GCC to produce an executable, this does not cause
-the resulting executable to be covered by the GNU General Public License.
-This exception does not however invalidate any other reasons why
-the executable file might be covered by the GNU General Public License. */
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <PlotFile.h>
-
-/*
- PlotFile implementation module
-*/
-
-
-PlotFile& PlotFile:: cmd(char c)
-{
- ofstream::put(c);
- return *this;
-}
-
-PlotFile& PlotFile:: operator<<(const int x)
-{
-#if defined(convex)
- ofstream::put((char)(x>>8));
- ofstream::put((char)(x&0377));
-#else
- ofstream::put((char)(x&0377));
- ofstream::put((char)(x>>8));
-#endif
- return *this;
-}
-
-PlotFile& PlotFile:: operator<<(const char *s)
-{
- *(ofstream*)this << s;
- return *this;
-}
-
-
-PlotFile& PlotFile:: arc(const int xi, const int yi,
- const int x0, const int y0,
- const int x1, const int y1)
-{
- return cmd('a') << xi << yi << x0 << y0 << x1 << y1;
-}
-
-
-PlotFile& PlotFile:: box(const int x0, const int y0,
- const int x1, const int y1)
-{
- line(x0, y0, x0, y1);
- line(x0, y1, x1, y1);
- line(x1, y1, x1, y0);
- return line(x1, y0, x0, y0);
-}
-
-PlotFile& PlotFile:: circle(const int x, const int y, const int r)
-{
- return cmd('c') << x << y << r;
-}
-
-PlotFile& PlotFile:: cont(const int xi, const int yi)
-{
- return cmd('n') << xi << yi;
-}
-
-PlotFile& PlotFile:: dot(const int xi, const int yi, const int dx,
- int n, const int* pat)
-{
- cmd('d') << xi << yi << dx << n;
- while (n-- > 0) *this << *pat++;
- return *this;
-}
-
-PlotFile& PlotFile:: erase()
-{
- return cmd('e');
-}
-
-PlotFile& PlotFile:: label(const char* s)
-{
- return cmd('t') << s << "\n";
-}
-
-PlotFile& PlotFile:: line(const int x0, const int y0,
- const int x1, const int y1)
-{
- return cmd('l') << x0 << y0 << x1 << y1;
-}
-
-PlotFile& PlotFile:: linemod(const char* s)
-{
- return cmd('f') << s << "\n";
-}
-
-PlotFile& PlotFile:: move(const int xi, const int yi)
-{
- return cmd('m') << xi << yi;
-}
-
-PlotFile& PlotFile:: point(const int xi, const int yi)
-{
- return cmd('p') << xi << yi;
-}
-
-PlotFile& PlotFile:: space(const int x0, const int y0,
- const int x1, const int y1)
-{
- return cmd('s') << x0 << y0 << x1 << y1;
-}
diff --git a/contrib/libg++/libio/PlotFile.h b/contrib/libg++/libio/PlotFile.h
deleted file mode 100644
index 82b08bc4681c..000000000000
--- a/contrib/libg++/libio/PlotFile.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/* This is part of libio/iostream, providing -*- C++ -*- input/output.
-Copyright (C) 1993 Free Software Foundation
-
-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. */
-
-/*
- a very simple implementation of a class to output unix "plot"
- format plotter files. See corresponding unix man pages for
- more details.
-
- written by Doug Lea (dl@rocky.oswego.edu)
- converted to use iostream library by Per Bothner (bothner@cygnus.com)
-*/
-
-#ifndef _PlotFile_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _PlotFile_h
-
-#include <fstream.h>
-
-/*
- Some plot libraries have the `box' command to draw boxes. Some don't.
- `box' is included here via moves & lines to allow both possiblilties.
-*/
-
-extern "C++" {
-class PlotFile : public ofstream
-{
-protected:
- PlotFile& cmd(char c);
- PlotFile& operator << (const int x);
- PlotFile& operator << (const char *s);
-
-public:
-
- PlotFile() : ofstream() { }
- PlotFile(int fd) : ofstream(fd) { }
- PlotFile(const char *name, int mode=ios::out, int prot=0664)
- : ofstream(name, mode, prot) { }
-
-// PlotFile& remove() { ofstream::remove(); return *this; }
-
-// int filedesc() { return ofstream::filedesc(); }
-// const char* name() { return File::name(); }
-// void setname(const char* newname) { File::setname(newname); }
-// int iocount() { return File::iocount(); }
-
- PlotFile& arc(const int xi, const int yi,
- const int x0, const int y0,
- const int x1, const int y1);
- PlotFile& box(const int x0, const int y0,
- const int x1, const int y1);
- PlotFile& circle(const int x, const int y, const int r);
- PlotFile& cont(const int xi, const int yi);
- PlotFile& dot(const int xi, const int yi, const int dx,
- int n, const int* pat);
- PlotFile& erase();
- PlotFile& label(const char* s);
- PlotFile& line(const int x0, const int y0,
- const int x1, const int y1);
- PlotFile& linemod(const char* s);
- PlotFile& move(const int xi, const int yi);
- PlotFile& point(const int xi, const int yi);
- PlotFile& space(const int x0, const int y0,
- const int x1, const int y1);
-};
-} // extern "C++"
-#endif
diff --git a/contrib/libg++/libio/README b/contrib/libg++/libio/README
deleted file mode 100644
index c2d564965ca4..000000000000
--- a/contrib/libg++/libio/README
+++ /dev/null
@@ -1,30 +0,0 @@
-This is libio, the GNU C/C++ input/output library.
-
-By default, the library is configured to build the C++ iostream
-facility (in $libdir/libiostream.a).
-
-The library can be configured to build the C stdio facility
-that is part of a C run-time library.
-
-This library is distributed with libg++; see ../libg++/README
-for installation instructions, and where to send bug reports
-and questions.
-
-* Copyright restrictions
-
-The files in this directory are generally covered by the GNU Public
-License (which is in the file ../COPYING), but modified with the
-following:
-
- 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.
-
-A few source files and subroutines are covered by other (but
-less restrictive) copyright conditions. E.g. some code (such
-as iovfprintf.c) is based on software that was developed by the
-University of California, Berkeley, for the Berkeley Software
-Distribution (BSD-4.4), and bears their copyright; and one
-file (floatconv.c) is derived from ("free") code copyrighted AT&T.
diff --git a/contrib/libg++/libio/SFile.cc b/contrib/libg++/libio/SFile.cc
deleted file mode 100644
index e5daa645695e..000000000000
--- a/contrib/libg++/libio/SFile.cc
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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. */
-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <SFile.h>
-
-SFile::SFile(const char *filename, int size, int mode, int prot)
-: fstream(filename, mode, prot)
-{
- sz = size;
-}
-
-SFile::SFile(int fd, int size)
-: fstream(fd)
-{
- sz = size;
-}
-
-void SFile::open(const char *name, int size, int mode, int prot)
-{
- fstream::open(name, mode, prot);
- sz = size;
-}
-
-SFile& SFile::get(void* x)
-{
- read(x, sz);
- return *this;
-}
-
-SFile& SFile::put(void* x)
-{
- write(x, sz);
- return *this;
-}
-
-SFile& SFile::operator[](long i)
-{
- if (rdbuf()->pubseekoff(i * sz, ios::beg) == EOF)
- set(ios::badbit);
- return *this;
-}
diff --git a/contrib/libg++/libio/SFile.h b/contrib/libg++/libio/SFile.h
deleted file mode 100644
index f07277cee49f..000000000000
--- a/contrib/libg++/libio/SFile.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/* This is part of libio/iostream, providing -*- C++ -*- input/output.
-Copyright (C) 1988, 1992, 1993 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-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. */
-
-#ifndef _SFile_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _SFile_h 1
-
-#include <fstream.h>
-
-extern "C++" {
-class SFile: public fstream
-{
- protected:
- int sz; // unit size for structured binary IO
-
-public:
- SFile() : fstream() { }
- SFile(int fd, int size);
- SFile(const char *name, int size, int mode, int prot=0664);
- void open(const char *name, int size, int mode, int prot=0664);
-
- int size() { return sz; }
- int setsize(int s) { int old = sz; sz = s; return old; }
-
- SFile& get(void* x);
- SFile& put(void* x);
- SFile& operator[](long i);
-};
-} // extern "C++"
-
-#endif
diff --git a/contrib/libg++/libio/builtinbuf.cc b/contrib/libg++/libio/builtinbuf.cc
deleted file mode 100644
index 05e65a5c371b..000000000000
--- a/contrib/libg++/libio/builtinbuf.cc
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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. */
-
-#ifdef __GNUC__
-#pragma implementation
-#endif
-#define _STREAM_COMPAT
-#include "builtinbuf.h"
-#include "iostreamP.h"
-#if !_IO_UNIFIED_JUMPTABLES
-int builtinbuf::overflow(int ch) { return _IO_OVERFLOW (this, ch); }
-
-int builtinbuf::underflow() { return _IO_UNDERFLOW (this); }
-
-streamsize builtinbuf::xsgetn(char* buf, streamsize n)
-{ return _IO_XSGETN (this, buf, n); }
-
-streamsize builtinbuf::xsputn(const char* buf, streamsize n)
-{ return _IO_XSPUTN (this, buf, n); }
-
-int builtinbuf::doallocate() { return _IO_DOALLOCATE (this); }
-
-builtinbuf::~builtinbuf() { _IO_FINISH (this); }
-
-int builtinbuf::sync() { return _IO_SYNC (this); }
-
-streambuf* builtinbuf::setbuf(char *buf, int n)
-{ return (streambuf*)_IO_SETBUF (this, buf, n); }
-
-streampos builtinbuf::seekoff(streamoff off, _seek_dir dir, int mode)
-{
- return _IO_SEEKOFF (this, off, dir, mode);
-}
-
-streampos builtinbuf::seekpos(streampos pos, int mode)
-{
- return _IO_SEEKPOS (this, pos, mode);
-}
-
-int builtinbuf::pbackfail(int c)
-{ return _IO_PBACKFAIL (this, c); }
-
-streamsize builtinbuf::sys_read(char* buf, streamsize size)
-{ return _IO_SYSREAD (this, buf, size); }
-
-streampos builtinbuf::sys_seek(streamoff off, _seek_dir dir)
-{ return _IO_SYSSEEK (this, off, dir); }
-
-streamsize builtinbuf::sys_write(const char* buf, streamsize size)
-{ return _IO_SYSWRITE (this, buf, size); }
-
-int builtinbuf::sys_stat(void* buf) // Actually, a (struct stat*)
-{ return _IO_SYSSTAT (this, buf); }
-
-int builtinbuf::sys_close()
-{ return _IO_SYSCLOSE (this); }
-#endif
diff --git a/contrib/libg++/libio/builtinbuf.h b/contrib/libg++/libio/builtinbuf.h
deleted file mode 100644
index 0e0c6e85a9ef..000000000000
--- a/contrib/libg++/libio/builtinbuf.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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. */
-
-#ifndef _BUILTINBUF_H
-#define _BUILTINBUF_H
-
-#ifdef __GNUC__
-#pragma interface
-#endif
-
-#include <streambuf.h>
-
-#if !_IO_UNIFIED_JUMPTABLES
-// A builtinbuf a a streambuf where all the virtual operations
-// call the _IO_jump_t table.
-
-extern "C++" {
-class builtinbuf : public streambuf {
- friend ios;
- virtual int overflow(int);
- virtual int underflow();
- virtual streamsize xsgetn(char *, streamsize);
- virtual streamsize xsputn(const char *, streamsize);
- virtual streambuf* setbuf(char*, int);
- virtual int doallocate();
- virtual ~builtinbuf();
- virtual int sync();
-
- virtual streampos seekoff(streamoff, _seek_dir, int mode=ios::in|ios::out);
- virtual streampos seekpos(streampos pos, int mode = ios::in|ios::out);
- virtual int pbackfail(int c);
- virtual streamsize sys_read(char* buf, streamsize size);
- virtual streampos sys_seek(streamoff, _seek_dir);
- virtual streamsize sys_write(const char*, streamsize);
- virtual int sys_stat(void*); // Actually, a (struct stat*)
- virtual int sys_close();
-#if 0
- virtual int get_column();
- virtual int set_column(int);
-#endif
- private:
- builtinbuf() { }
-};
-} // extern "C++"
-#endif
-
-#endif /* _BUILTINBUF_H */
diff --git a/contrib/libg++/libio/cleanup.c b/contrib/libg++/libio/cleanup.c
deleted file mode 100644
index a0c5052d3958..000000000000
--- a/contrib/libg++/libio/cleanup.c
+++ /dev/null
@@ -1,17 +0,0 @@
-#include "libioP.h"
-#if _G_HAVE_ATEXIT
-#include <stdlib.h>
-
-typedef void (*voidfunc) __P((void));
-
-static void
-DEFUN_VOID(_IO_register_cleanup)
-{
- atexit ((voidfunc)_IO_cleanup);
- _IO_cleanup_registration_needed = 0;
-}
-
-void (*_IO_cleanup_registration_needed)() = _IO_register_cleanup;
-#else
-void (*_IO_cleanup_registration_needed)() = NULL;
-#endif /* _G_HAVE_ATEXIT */
diff --git a/contrib/libg++/libio/depend b/contrib/libg++/libio/depend
deleted file mode 100644
index eb4a6fc82b7d..000000000000
--- a/contrib/libg++/libio/depend
+++ /dev/null
@@ -1,327 +0,0 @@
-# AUTOMATICALLY GENERATED BY 'make depend' - DO NOT EDIT
-
-PlotFile.o: PlotFile.cc \
- $(srcdir)/PlotFile.h $(srcdir)/fstream.h \
- $(srcdir)/iostream.h $(srcdir)/streambuf.h \
- $(srcdir)/libio.h _G_config.h
-SFile.o: SFile.cc \
- $(srcdir)/SFile.h $(srcdir)/fstream.h \
- $(srcdir)/iostream.h $(srcdir)/streambuf.h \
- $(srcdir)/libio.h _G_config.h
-builtinbuf.o: builtinbuf.cc \
- $(srcdir)/builtinbuf.h \
- $(srcdir)/streambuf.h $(srcdir)/libio.h \
- _G_config.h $(srcdir)/iostreamP.h \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h
-editbuf.o: editbuf.cc \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h _G_config.h \
- $(srcdir)/editbuf.h \
- $(srcdir)/fstream.h \
- $(srcdir)/iostream.h $(srcdir)/streambuf.h
-filebuf.o: filebuf.cc \
- $(srcdir)/iostreamP.h $(srcdir)/streambuf.h \
- $(srcdir)/libio.h _G_config.h \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/builtinbuf.h
-fstream.o: fstream.cc \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h _G_config.h \
- $(srcdir)/fstream.h $(srcdir)/iostream.h \
- $(srcdir)/streambuf.h
-indstream.o: indstream.cc \
- $(srcdir)/indstream.h $(srcdir)/iostream.h \
- $(srcdir)/streambuf.h $(srcdir)/libio.h \
- _G_config.h
-ioassign.o: ioassign.cc \
- $(srcdir)/iostream.h $(srcdir)/streambuf.h \
- $(srcdir)/libio.h _G_config.h \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h
-ioextend.o: ioextend.cc \
- $(srcdir)/iostream.h $(srcdir)/streambuf.h \
- $(srcdir)/libio.h _G_config.h
-iomanip.o: iomanip.cc \
- $(srcdir)/iomanip.h $(srcdir)/iostream.h \
- $(srcdir)/streambuf.h $(srcdir)/libio.h \
- _G_config.h
-iostream.o: iostream.cc \
- $(srcdir)/iostream.h $(srcdir)/streambuf.h \
- $(srcdir)/libio.h _G_config.h \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/floatio.h
-isgetline.o: isgetline.cc \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h _G_config.h \
- $(srcdir)/iostream.h $(srcdir)/streambuf.h
-isgetsb.o: isgetsb.cc \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h _G_config.h \
- $(srcdir)/iostream.h $(srcdir)/streambuf.h
-isscan.o: isscan.cc \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h _G_config.h \
- $(srcdir)/iostream.h $(srcdir)/streambuf.h
-osform.o: osform.cc \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h _G_config.h \
- $(srcdir)/iostream.h $(srcdir)/streambuf.h
-parsestream.o: parsestream.cc \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h _G_config.h \
- $(srcdir)/parsestream.h \
- $(srcdir)/streambuf.h
-pfstream.o: pfstream.cc \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h _G_config.h \
- $(srcdir)/pfstream.h $(srcdir)/fstream.h \
- $(srcdir)/iostream.h $(srcdir)/streambuf.h \
- $(srcdir)/procbuf.h
-procbuf.o: procbuf.cc \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h _G_config.h \
- $(srcdir)/procbuf.h $(srcdir)/streambuf.h
-sbform.o: sbform.cc \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h _G_config.h \
- $(srcdir)/streambuf.h
-sbgetline.o: sbgetline.cc \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h _G_config.h \
- $(srcdir)/streambuf.h
-sbscan.o: sbscan.cc \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h _G_config.h \
- $(srcdir)/streambuf.h
-stdiostream.o: stdiostream.cc \
- $(srcdir)/stdiostream.h \
- $(srcdir)/iostream.h $(srcdir)/streambuf.h \
- $(srcdir)/libio.h _G_config.h \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h
-stdstrbufs.o: stdstrbufs.cc \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h _G_config.h \
- $(srcdir)/stdiostream.h \
- $(srcdir)/iostream.h $(srcdir)/streambuf.h
-stdstreams.o: stdstreams.cc \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h _G_config.h \
- $(srcdir)/streambuf.h \
- $(srcdir)/iostream.h
-stream.o: stream.cc \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h _G_config.h \
- $(srcdir)/stream.h $(srcdir)/iostream.h \
- $(srcdir)/streambuf.h $(srcdir)/strstream.h \
- $(srcdir)/strfile.h
-streambuf.o: streambuf.cc \
- $(srcdir)/iostreamP.h $(srcdir)/streambuf.h \
- $(srcdir)/libio.h _G_config.h \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h
-strstream.o: strstream.cc \
- $(srcdir)/iostreamP.h $(srcdir)/streambuf.h \
- $(srcdir)/libio.h _G_config.h \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/strstream.h $(srcdir)/iostream.h \
- $(srcdir)/strfile.h
-cleanup.o: cleanup.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h _G_config.h
-filedoalloc.o: filedoalloc.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h _G_config.h
-fileops.o: fileops.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h _G_config.h
-floatconv.o: floatconv.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h _G_config.h
-genops.o: genops.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h _G_config.h
-iofclose.o: iofclose.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h _G_config.h
-iofdopen.o: iofdopen.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h _G_config.h
-iofflush.o: iofflush.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h _G_config.h
-iofgetpos.o: iofgetpos.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h _G_config.h
-iofgets.o: iofgets.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h _G_config.h
-iofopen.o: iofopen.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h _G_config.h
-iofprintf.o: iofprintf.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h _G_config.h
-iofputs.o: iofputs.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h _G_config.h
-iofread.o: iofread.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h _G_config.h
-iofscanf.o: iofscanf.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h _G_config.h
-iofsetpos.o: iofsetpos.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h _G_config.h
-ioftell.o: ioftell.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h _G_config.h
-iofwrite.o: iofwrite.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h _G_config.h
-iogetdelim.o: iogetdelim.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h _G_config.h
-iogetline.o: iogetline.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h _G_config.h
-iogets.o: iogets.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h _G_config.h
-ioignore.o: ioignore.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h _G_config.h
-iopadn.o: iopadn.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h _G_config.h
-ioperror.o: ioperror.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h _G_config.h
-iopopen.o: iopopen.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h _G_config.h
-ioprims.o: ioprims.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h _G_config.h
-ioprintf.o: ioprintf.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h _G_config.h
-ioputs.o: ioputs.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h _G_config.h
-ioscanf.o: ioscanf.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h _G_config.h
-ioseekoff.o: ioseekoff.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h _G_config.h
-ioseekpos.o: ioseekpos.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h _G_config.h
-iosetbuffer.o: iosetbuffer.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h _G_config.h
-iosetvbuf.o: iosetvbuf.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h _G_config.h
-iosprintf.o: iosprintf.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h _G_config.h
-iosscanf.o: iosscanf.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h _G_config.h
-iostrerror.o: iostrerror.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h _G_config.h
-ioungetc.o: ioungetc.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h _G_config.h
-iovfprintf.o: iovfprintf.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h _G_config.h \
- $(srcdir)/floatio.h
-iovfscanf.o: iovfscanf.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h _G_config.h \
- $(srcdir)/floatio.h
-iovsprintf.o: iovsprintf.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h _G_config.h \
- $(srcdir)/strfile.h
-iovsscanf.o: iovsscanf.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h _G_config.h \
- $(srcdir)/strfile.h
-outfloat.o: outfloat.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h _G_config.h
-stdfiles.o: stdfiles.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h _G_config.h
-strops.o: strops.c \
- $(srcdir)/strfile.h $(srcdir)/libio.h \
- _G_config.h $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h
diff --git a/contrib/libg++/libio/editbuf.cc b/contrib/libg++/libio/editbuf.cc
deleted file mode 100644
index 22304820f8fd..000000000000
--- a/contrib/libg++/libio/editbuf.cc
+++ /dev/null
@@ -1,717 +0,0 @@
-/* This is part of libio/iostream, providing -*- C++ -*- input/output.
-Copyright (C) 1993 Free Software Foundation
-
-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.
-
-Written by Per Bothner (bothner@cygnus.com). */
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include "libioP.h"
-#include "editbuf.h"
-#include <stddef.h>
-#include <stdlib.h>
-
-/* NOTE: Some of the code here is taken from GNU emacs */
-/* Hence this file falls under the GNU License! */
-
-// Invariants for edit_streambuf:
-// An edit_streambuf is associated with a specific edit_string,
-// which again is a sub-string of a specific edit_buffer.
-// An edit_streambuf is always in either get mode or put mode, never both.
-// In get mode, gptr() is the current position,
-// and pbase(), pptr(), and epptr() are all NULL.
-// In put mode, pptr() is the current position,
-// and eback(), gptr(), and egptr() are all NULL.
-// Any edit_streambuf that is actively doing insertion (as opposed to
-// replacing) // must have its pptr() pointing to the start of the gap.
-// Only one edit_streambuf can be actively inserting into a specific
-// edit_buffer; the edit_buffer's _writer field points to that edit_streambuf.
-// That edit_streambuf "owns" the gap, and the actual start of the
-// gap is the pptr() of the edit_streambuf; the edit_buffer::_gap_start pointer
-// will only be updated on an edit_streambuf::overflow().
-
-int edit_streambuf::truncate()
-{
- str->buffer->delete_range(str->buffer->tell((buf_char*)pptr()),
- str->buffer->tell(str->end));
- return 0;
-}
-
-#ifdef OLD_STDIO
-inline void disconnect_gap_from_file(edit_buffer* buffer, FILE* fp)
-{
- if (buffer->gap_start_ptr != &fp->__bufp)
- return;
- buffer->gap_start_normal = fp->__bufp;
- buffer->gap_start_ptr = &buffer->gap_start_normal;
-}
-#endif
-
-void edit_streambuf::flush_to_buffer(edit_buffer* buffer)
-{
- if (pptr() > buffer->_gap_start && pptr() < buffer->gap_end())
- buffer->_gap_start = pptr();
-}
-
-void edit_streambuf::disconnect_gap_from_file(edit_buffer* buffer)
-{
- if (buffer->_writer != this) return;
- flush_to_buffer(buffer);
- setp(pptr(),pptr());
- buffer->_writer = NULL;
-}
-
-buf_index edit_buffer::tell(buf_char *ptr)
-{
- if (ptr <= gap_start())
- return ptr - data;
- else
- return ptr - gap_end() + size1();
-}
-
-#if 0
-buf_index buf_cookie::tell()
-{
- return str->buffer->tell(file->__bufp);
-}
-#endif
-
-buf_index edit_buffer::tell(edit_mark*mark)
-{
- return tell(data + mark->index_in_buffer(this));
-}
-
-// adjust the position of the gap
-
-void edit_buffer::move_gap(buf_offset pos)
-{
- if (pos < size1())
- gap_left (pos);
- else if (pos > size1())
- gap_right (pos);
-}
-
-void edit_buffer::gap_left (int pos)
-{
- register buf_char *to, *from;
- register int i;
- int new_s1;
-
- i = size1();
- from = gap_start();
- to = from + gap_size();
- new_s1 = size1();
-
- /* Now copy the characters. To move the gap down,
- copy characters up. */
-
- for (;;)
- {
- /* I gets number of characters left to copy. */
- i = new_s1 - pos;
- if (i == 0)
- break;
-#if 0
- /* If a quit is requested, stop copying now.
- Change POS to be where we have actually moved the gap to. */
- if (QUITP)
- {
- pos = new_s1;
- break;
- }
-#endif
- /* Move at most 32000 chars before checking again for a quit. */
- if (i > 32000)
- i = 32000;
- new_s1 -= i;
- while (--i >= 0)
- *--to = *--from;
- }
-
- /* Adjust markers, and buffer data structure, to put the gap at POS.
- POS is where the loop above stopped, which may be what was specified
- or may be where a quit was detected. */
- adjust_markers (pos << 1, size1() << 1, gap_size(), data);
-#ifndef OLD_STDIO
- _gap_start = data + pos;
-#else
- if (gap_start_ptr == &gap_start_normal)
- gap_start_normal = data + pos;
-#endif
- __gap_end_pos = to - data;
-/* QUIT;*/
-}
-
-void edit_buffer::gap_right (int pos)
-{
- register buf_char *to, *from;
- register int i;
- int new_s1;
-
- i = size1();
- to = gap_start();
- from = i + gap_end();
- new_s1 = i;
-
- /* Now copy the characters. To move the gap up,
- copy characters down. */
-
- while (1)
- {
- /* I gets number of characters left to copy. */
- i = pos - new_s1;
- if (i == 0)
- break;
-#if 0
- /* If a quit is requested, stop copying now.
- Change POS to be where we have actually moved the gap to. */
- if (QUITP)
- {
- pos = new_s1;
- break;
- }
-#endif
- /* Move at most 32000 chars before checking again for a quit. */
- if (i > 32000)
- i = 32000;
- new_s1 += i;
- while (--i >= 0)
- *to++ = *from++;
- }
-
- adjust_markers ((size1() + gap_size()) << 1, (pos + gap_size()) << 1,
- - gap_size(), data);
-#ifndef OLD_STDIO
- _gap_start = data+pos;
-#else
- if (gap_start_ptr == &gap_start_normal)
- gap_start_normal = data + pos;
-#endif
- __gap_end_pos = from - data;
-/* QUIT;*/
-}
-
-/* make sure that the gap in the current buffer is at least k
- characters wide */
-
-void edit_buffer::make_gap(buf_offset k)
-{
- register buf_char *p1, *p2, *lim;
- buf_char *old_data = data;
- int s1 = size1();
-
- if (gap_size() >= k)
- return;
-
- /* Get more than just enough */
- if (buf_size > 1000) k += 2000;
- else k += /*200;*/ 20; // for testing!
-
- p1 = (buf_char *) realloc (data, s1 + size2() + k);
- if (p1 == 0)
- abort(); /*memory_full ();*/
-
- k -= gap_size(); /* Amount of increase. */
-
- /* Record new location of text */
- data = p1;
-
- /* Transfer the new free space from the end to the gap
- by shifting the second segment upward */
- p2 = data + buf_size;
- p1 = p2 + k;
- lim = p2 - size2();
- while (lim < p2)
- *--p1 = *--p2;
-
- /* Finish updating text location data */
- __gap_end_pos += k;
-
-#ifndef OLD_STDIO
- _gap_start = data + s1;
-#else
- if (gap_start_ptr == &gap_start_normal)
- gap_start_normal = data + s1;
-#endif
-
- /* adjust markers */
- adjust_markers (s1 << 1, (buf_size << 1) + 1, k, old_data);
- buf_size += k;
-}
-
-/* Add `amount' to the position of every marker in the current buffer
- whose current position is between `from' (exclusive) and `to' (inclusive).
- Also, any markers past the outside of that interval, in the direction
- of adjustment, are first moved back to the near end of the interval
- and then adjusted by `amount'. */
-
-void edit_buffer::adjust_markers(register mark_pointer low,
- register mark_pointer high,
- int amount, buf_char *old_data)
-{
- register struct edit_mark *m;
- register mark_pointer mpos;
- /* convert to mark_pointer */
- amount <<= 1;
-
- if (_writer)
- _writer->disconnect_gap_from_file(this);
-
- for (m = mark_list(); m != NULL; m = m->chain)
- {
- mpos = m->_pos;
- if (amount > 0)
- {
- if (mpos > high && mpos < high + amount)
- mpos = high + amount;
- }
- else
- {
- if (mpos > low + amount && mpos <= low)
- mpos = low + amount;
- }
- if (mpos > low && mpos <= high)
- mpos += amount;
- m->_pos = mpos;
- }
-
- // Now adjust files
- edit_streambuf *file;
-
- for (file = files; file != NULL; file = file->next) {
- mpos = file->current() - old_data;
- if (amount > 0)
- {
- if (mpos > high && mpos < high + amount)
- mpos = high + amount;
- }
- else
- {
- if (mpos > low + amount && mpos <= low)
- mpos = low + amount;
- }
- if (mpos > low && mpos <= high)
- mpos += amount;
- char* new_pos = data + mpos;
- file->set_current(new_pos, file->is_reading());
- }
-}
-
-#if 0
-stdio_
- __off == index at start of buffer (need only be valid after seek ? )
- __buf ==
-
-if read/read_delete/overwrite mode:
- __endp <= min(*gap_start_ptr, edit_string->end->ptr(buffer))
-
-if inserting:
- must have *gap_start_ptr == __bufp && *gap_start_ptr+gap == __endp
- file->edit_string->end->ptr(buffer) == *gap_start_ptr+end
-if write_mode:
- if before gap
-#endif
-
-int edit_streambuf::underflow()
-{
- if (!(_mode & ios::in))
- return EOF;
- struct edit_buffer *buffer = str->buffer;
- if (!is_reading()) { // Must switch from put to get mode.
- disconnect_gap_from_file(buffer);
- set_current(pptr(), 1);
- }
- buf_char *str_end = str->end->ptr(buffer);
- retry:
- if (gptr() < egptr()) {
- return *gptr();
- }
- if ((buf_char*)gptr() == str_end)
- return EOF;
- if (str_end <= buffer->gap_start()) {
- setg(eback(), gptr(), str_end);
- goto retry;
- }
- if (gptr() < buffer->gap_start()) {
- setg(eback(), gptr(), buffer->gap_start());
- goto retry;
- }
- if (gptr() == buffer->gap_start()) {
- disconnect_gap_from_file(buffer);
-// fp->__offset += fp->__bufp - fp->__buffer;
- setg(buffer->gap_end(), buffer->gap_end(), str_end);
- }
- else
- setg(eback(), gptr(), str_end);
- goto retry;
-}
-
-int edit_streambuf::overflow(int ch)
-{
- if (_mode == ios::in)
- return EOF;
- struct edit_buffer *buffer = str->buffer;
- flush_to_buffer(buffer);
- if (ch == EOF)
- return 0;
- if (is_reading()) { // Must switch from get to put mode.
- set_current(gptr(), 0);
- }
- buf_char *str_end = str->end->ptr(buffer);
- retry:
- if (pptr() < epptr()) {
- *pptr() = ch;
- pbump(1);
- return (unsigned char)ch;
- }
- if ((buf_char*)pptr() == str_end || inserting()) {
- /* insert instead */
- if (buffer->_writer)
- buffer->_writer->flush_to_buffer(); // Redundant?
- buffer->_writer = NULL;
- if (pptr() >= buffer->gap_end())
- buffer->move_gap(pptr() - buffer->gap_size());
- else
- buffer->move_gap(pptr());
- buffer->make_gap(1);
- setp(buffer->gap_start(), buffer->gap_end());
- buffer->_writer = this;
- *pptr() = ch;
- pbump(1);
- return (unsigned char)ch;
- }
- if (str_end <= buffer->gap_start()) {
- // Entire string is left of gap.
- setp(pptr(), str_end);
- }
- else if (pptr() < buffer->gap_start()) {
- // Current pos is left of gap.
- setp(pptr(), buffer->gap_start());
- goto retry;
- }
- else if (pptr() == buffer->gap_start()) {
- // Current pos is at start of gap; move to end of gap.
-// disconnect_gap_from_file(buffer);
- setp(buffer->gap_end(), str_end);
-// __offset += __bufp - __buffer;
- }
- else {
- // Otherwise, current pos is right of gap.
- setp(pptr(), str_end);
- }
- goto retry;
-}
-
-void edit_streambuf::set_current(char *new_pos, int reading)
-{
- if (reading) {
- setg(new_pos, new_pos, new_pos);
- setp(NULL, NULL);
- }
- else {
- setg(NULL, NULL, NULL);
- setp(new_pos, new_pos);
- }
-}
-
-// Called by fseek(fp, pos, whence) if fp is bound to a edit_buffer.
-
-streampos edit_streambuf::seekoff(streamoff offset, _seek_dir dir,
- int /* =ios::in|ios::out*/)
-{
- struct edit_buffer *buffer = str->buffer;
- disconnect_gap_from_file(buffer);
- buf_index cur_pos = buffer->tell((buf_char*)current());;
- buf_index start_pos = buffer->tell(str->start);
- buf_index end_pos = buffer->tell(str->end);
- switch (dir) {
- case ios::beg:
- offset += start_pos;
- break;
- case ios::cur:
- offset += cur_pos;
- break;
- case ios::end:
- offset += end_pos;
- break;
- }
- if (offset < start_pos || offset > end_pos)
- return EOF;
- buf_char *new_pos = buffer->data + offset;
- buf_char* gap_start = buffer->gap_start();
- if (new_pos > gap_start) {
- buf_char* gap_end = buffer->gap_end();
- new_pos += gap_end - gap_start;
- if (new_pos >= buffer->data + buffer->buf_size) abort(); // Paranoia.
- }
- set_current(new_pos, is_reading());
- return EOF;
-}
-
-#if 0
-int buf_seek(void *arg_cookie, fpos_t * pos, int whence)
-{
- struct buf_cookie *cookie = arg_cookie;
- FILE *file = cookie->file;
- struct edit_buffer *buffer = cookie->str->buffer;
- buf_char *str_start = cookie->str->start->ptr(buffer);
- disconnect_gap_from_file(buffer, cookie->file);
- fpos_t cur_pos, new_pos;
- if (file->__bufp <= *buffer->gap_start_ptr
- || str_start >= buffer->__gap_end)
- cur_pos = str_start - file->__bufp;
- else
- cur_pos =
- (*buffer->gap_start_ptr - str_start) + (file->__bufp - __gap_end);
- end_pos = ...;
- switch (whence) {
- case SEEK_SET:
- new_pos = *pos;
- break;
- case SEEK_CUR:
- new_pos = cur_pos + *pos;
- break;
- case SEEK_END:
- new_pos = end_pos + *pos;
- break;
- }
- if (new_pos > end_pos) {
- seek to end_pos;
- insert_nulls(new_pos - end_pos);
- return;
- }
- if (str_start + new_pos <= *gap_start_ptr &* *gap_start_ptr < end) {
- __buffer = str_start;
- __off = 0;
- __bufp = str_start + new_pos;
- file->__get_limit =
- *buffer->gap_start_ptr; /* what if gap_start_ptr == &bufp ??? */
- } else if () {
-
- }
- *pos = new_pos;
-}
-#endif
-
-/* Delete characters from `from' up to (but not incl) `to' */
-
-void edit_buffer::delete_range (buf_index from, buf_index to)
-{
- register int numdel;
-
- if ((numdel = to - from) <= 0)
- return;
-
- /* Make sure the gap is somewhere in or next to what we are deleting */
- if (from > size1())
- gap_right (from);
- if (to < size1())
- gap_left (to);
-
- /* Relocate all markers pointing into the new, larger gap
- to point at the end of the text before the gap. */
- adjust_markers ((to + gap_size()) << 1, (to + gap_size()) << 1,
- - numdel - gap_size(), data);
-
- __gap_end_pos = to + gap_size();
- _gap_start = data + from;
-}
-
-void edit_buffer::delete_range(struct edit_mark *start, struct edit_mark *end)
-{
- delete_range(tell(start), tell(end));
-}
-
-void buf_delete_chars(struct edit_buffer *, struct edit_mark *, size_t)
-{
- abort();
-}
-
-edit_streambuf::edit_streambuf(edit_string* bstr, int mode)
-{
- _mode = mode;
- str = bstr;
- edit_buffer* buffer = bstr->buffer;
- next = buffer->files;
- buffer->files = this;
- char* buf_ptr = bstr->start->ptr(buffer);
- _inserting = 0;
-// setb(buf_ptr, buf_ptr, 0);
- set_current(buf_ptr, !(mode & ios::out+ios::trunc+ios::app));
- if (_mode & ios::trunc)
- truncate();
- if (_mode & ios::ate)
- seekoff(0, ios::end);
-}
-
-// Called by fclose(fp) if fp is bound to a edit_buffer.
-
-#if 0
-static int buf_close(void *arg)
-{
- register struct buf_cookie *cookie = arg;
- struct edit_buffer *buffer = cookie->str->buffer;
- struct buf_cookie **ptr;
- for (ptr = &buffer->files; *ptr != cookie; ptr = &(*ptr)->next) ;
- *ptr = cookie->next;
- disconnect_gap_from_file(buffer, cookie->file);
- free (cookie);
- return 0;
-}
-#endif
-
-edit_streambuf::~edit_streambuf()
-{
- if (_mode == ios::out)
- truncate();
- // Unlink this from list of files associated with bstr->buffer.
- edit_streambuf **ptr = &str->buffer->files;
- for (; *ptr != this; ptr = &(*ptr)->next) { }
- *ptr = next;
-
- disconnect_gap_from_file(str->buffer);
-}
-
-edit_buffer::edit_buffer()
-{
- buf_size = /*200;*/ 15; /* for testing! */
- data = (buf_char*)malloc(buf_size);
- files = NULL;
-#ifndef OLD_STDIO
- _gap_start = data;
- _writer = NULL;
-#else
- gap_start_normal = data;
- gap_start_ptr = &gap_start_normal;
-#endif
- __gap_end_pos = buf_size;
- start_mark.chain = &end_mark;
- start_mark._pos = 0;
- end_mark.chain = NULL;
- end_mark._pos = 2 * buf_size + 1;
-}
-
-// Allocate a new mark, which is adjusted by 'delta' bytes from 'this'.
-// Restrict new mark to lie within 'str'.
-
-edit_mark::edit_mark(struct edit_string *str, long delta)
-{
- struct edit_buffer *buf = str->buffer;
- chain = buf->start_mark.chain;
- buf->start_mark.chain = this;
- mark_pointer size1 = buf->size1() << 1;
- int gap_size = buf->gap_size() << 1;
- delta <<= 1;
-
- // check if new and old marks are opposite sides of gap
- if (_pos <= size1 && _pos + delta > size1)
- delta += gap_size;
- else if (_pos >= size1 + gap_size && _pos + delta < size1 + gap_size)
- delta -= gap_size;
-
- _pos = _pos + delta;
- if (_pos < str->start->_pos & ~1)
- _pos = (str->start->_pos & ~ 1) + (_pos & 1);
- else if (_pos >= str->end->_pos)
- _pos = (str->end->_pos & ~ 1) + (_pos & 1);
-}
-
-// A (slow) way to find the buffer a mark belongs to.
-
-edit_buffer * edit_mark::buffer()
-{
- struct edit_mark *mark;
- for (mark = this; mark->chain != NULL; mark = mark->chain) ;
- // Assume that the last mark on the chain is the end_mark.
- return (edit_buffer *)((char*)mark - offsetof(edit_buffer, end_mark));
-}
-
-edit_mark::~edit_mark()
-{
- // Must unlink mark from chain of owning buffer
- struct edit_buffer *buf = buffer();
- if (this == &buf->start_mark || this == &buf->end_mark) abort();
- edit_mark **ptr;
- for (ptr = &buf->start_mark.chain; *ptr != this; ptr = &(*ptr)->chain) ;
- *ptr = this->chain;
-}
-
-int edit_string::length() const
-{
- ptrdiff_t delta = end->ptr(buffer) - start->ptr(buffer);
- if (end->ptr(buffer) <= buffer->gap_start() ||
- start->ptr(buffer) >= buffer->gap_end())
- return delta;
- return delta - buffer->gap_size();
-}
-
-buf_char * edit_string::copy_bytes(int *lenp) const
-{
- char *new_str;
- int len1, len2;
- buf_char *start1, *start2;
- start1 = start->ptr(buffer);
- if (end->ptr(buffer) <= buffer->gap_start()
- || start->ptr(buffer) >= buffer->gap_end()) {
- len1 = end->ptr(buffer) - start1;
- len2 = 0;
- start2 = NULL; // To avoid a warning from g++.
- }
- else {
- len1 = buffer->gap_start() - start1;
- start2 = buffer->gap_end();
- len2 = end->ptr(buffer) - start2;
- }
- new_str = (char*)malloc(len1 + len2 + 1);
- memcpy(new_str, start1, len1);
- if (len2 > 0) memcpy(new_str + len1, start2, len2);
- new_str[len1+len2] = '\0';
- *lenp = len1+len2;
- return new_str;
-}
-
-// Replace the buf_chars in 'this' with ones from 'src'.
-// Equivalent to deleting this, then inserting src, except tries
-// to leave marks in place: Marks whose offset from the start
-// of 'this' is less than 'src->length()' will still have the
-// same offset in 'this' when done.
-
-void edit_string::assign(struct edit_string *src)
-{
- edit_streambuf dst_file(this, ios::out);
- if (buffer == src->buffer /*&& ???*/) { /* overly conservative */
- int src_len;
- buf_char *new_str;
- new_str = src->copy_bytes(&src_len);
- dst_file.sputn(new_str, src_len);
- free (new_str);
- } else {
- edit_streambuf src_file(src, ios::in);
- for ( ; ; ) {
- int ch = src_file.sbumpc();
- if (ch == EOF) break;
- dst_file.sputc(ch);
- }
- }
-}
diff --git a/contrib/libg++/libio/editbuf.h b/contrib/libg++/libio/editbuf.h
deleted file mode 100644
index d15758f257ea..000000000000
--- a/contrib/libg++/libio/editbuf.h
+++ /dev/null
@@ -1,185 +0,0 @@
-/* This is part of libio/iostream, providing -*- C++ -*- input/output.
-Copyright (C) 1993 Free Software Foundation
-
-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.
-
-Written by Per Bothner (bothner@cygnus.com). */
-
-#ifndef _EDITBUF_H
-#define _EDITBUF_H
-#ifdef __GNUG__
-#pragma interface
-#endif
-#include <stdio.h>
-#include <fstream.h>
-
-extern "C++" {
-typedef unsigned long mark_pointer;
-// At some point, it might be nice to parameterize this code
-// in terms of buf_char.
-typedef /*unsigned*/ char buf_char;
-
-// Logical pos from start of buffer (does not count gap).
-typedef long buf_index;
-
-// Pos from start of buffer, possibly including gap_size.
-typedef long buf_offset;
-
-#if 0
-struct buf_cookie {
- FILE *file;
- struct edit_string *str;
- struct buf_cookie *next;
- buf_index tell();
-};
-#endif
-
-struct edit_buffer;
-struct edit_mark;
-
-// A edit_string is defined as the region between the 'start' and 'end' marks.
-// Normally (always?) 'start->insert_before()' should be false,
-// and 'end->insert_before()' should be true.
-
-struct edit_string {
- struct edit_buffer *buffer; // buffer that 'start' and 'end' belong to
- struct edit_mark *start, *end;
- int length() const; // count of buf_chars currently in string
- edit_string(struct edit_buffer *b,
- struct edit_mark *ms, struct edit_mark *me)
- { buffer = b; start = ms; end = me; }
-/* Make a fresh, contiguous copy of the data in STR.
- Assign length of STR to *LENP.
- (Output has extra NUL at out[*LENP].) */
- buf_char *copy_bytes(int *lenp) const;
-// FILE *open_file(char *mode);
- void assign(struct edit_string *src); // copy bytes from src to this
-};
-
-struct edit_streambuf : public streambuf {
- friend edit_buffer;
- edit_string *str;
- edit_streambuf* next; // Chain of edit_streambuf's for a edit_buffer.
- short _mode;
- edit_streambuf(edit_string* bstr, int mode);
- ~edit_streambuf();
- virtual int underflow();
- virtual int overflow(int c = EOF);
- virtual streampos seekoff(streamoff, _seek_dir, int mode=ios::in|ios::out);
- void flush_to_buffer();
- void flush_to_buffer(edit_buffer* buffer);
- int _inserting;
- int inserting() { return _inserting; }
- void inserting(int i) { _inserting = i; }
-// int delete_chars(int count, char* cut_buf); Not implemented.
- int truncate();
- int is_reading() { return gptr() != NULL; }
- buf_char* current() { return is_reading() ? gptr() : pptr(); }
- void set_current(char *p, int is_reading);
- protected:
- void disconnect_gap_from_file(edit_buffer* buffer);
-};
-
-// A 'edit_mark' indicates a position in a buffer.
-// It is "attached" the text (rather than the offset).
-// There are two kinds of mark, which have different behavior
-// when text is inserted at the mark:
-// If 'insert_before()' is true the mark will be adjusted to be
-// *after* the new text.
-
-struct edit_mark {
- struct edit_mark *chain;
- mark_pointer _pos;
- inline int insert_before() { return _pos & 1; }
- inline unsigned long index_in_buffer(struct edit_buffer *)
- { return _pos >> 1; }
- inline buf_char *ptr(struct edit_buffer *buf);
- buf_index tell();
- edit_mark() { }
- edit_mark(struct edit_string *str, long delta);
- edit_buffer *buffer();
- ~edit_mark();
-};
-
-// A 'edit_buffer' consists of a sequence of buf_chars (the data),
-// a list of edit_marks pointing into the data, and a list of FILEs
-// also pointing into the data.
-// A 'edit_buffer' coerced to a edit_string is the string of
-// all the buf_chars in the buffer.
-
-// This implementation uses a conventional buffer gap (as in Emacs).
-// The gap start is defined by de-referencing a (buf_char**).
-// This is because sometimes a FILE is inserting into the buffer,
-// so rather than having each putc adjust the gap, we use indirection
-// to have the gap be defined as the write pointer of the FILE.
-// (This assumes that putc adjusts a pointer (as in GNU's libc), not an index.)
-
-struct edit_buffer {
- buf_char *data; /* == emacs buffer_text.p1+1 */
- buf_char *_gap_start;
- edit_streambuf* _writer; // If non-NULL, currently writing stream
- inline buf_char *gap_start()
- { return _writer ? _writer->pptr() : _gap_start; }
- buf_offset __gap_end_pos; // size of part 1 + size of gap
- /* int gap; implicit: buf_size - size1 - size2 */
- int buf_size;
- struct edit_streambuf *files;
- struct edit_mark start_mark;
- struct edit_mark end_mark;
- edit_buffer();
- inline buf_offset gap_end_pos() { return __gap_end_pos; }
- inline struct edit_mark *start_marker() { return &start_mark; }
- inline struct edit_mark *end_marker() { return &end_mark; }
-/* these should be protected, ultimately */
- buf_index tell(edit_mark*);
- buf_index tell(buf_char*);
- inline buf_char *gap_end() { return data + gap_end_pos(); }
- inline int gap_size() { return gap_end() - gap_start(); }
- inline int size1() { return gap_start() - data; }
- inline int size2() { return buf_size - gap_end_pos(); }
- inline struct edit_mark * mark_list() { return &start_mark; }
- void make_gap (buf_offset);
- void move_gap (buf_offset pos);
- void move_gap (buf_char *pos) { move_gap(pos - data); }
- void gap_left (int pos);
- void gap_right (int pos);
- void adjust_markers(mark_pointer low, mark_pointer high,
- int amount, buf_char *old_data);
- void delete_range(buf_index from, buf_index to);
- void delete_range(struct edit_mark *start, struct edit_mark *end);
-};
-
-extern buf_char * bstr_copy(struct edit_string *str, int *lenp);
-
-// Convert a edit_mark to a (buf_char*)
-
-inline buf_char *edit_mark::ptr(struct edit_buffer *buf)
- { return buf->data + index_in_buffer(buf); }
-
-inline void edit_streambuf::flush_to_buffer()
-{
- edit_buffer* buffer = str->buffer;
- if (buffer->_writer == this) flush_to_buffer(buffer);
-}
-} // extern "C++"
-#endif /* !_EDITBUF_H*/
-
diff --git a/contrib/libg++/libio/filebuf.cc b/contrib/libg++/libio/filebuf.cc
deleted file mode 100644
index 1e2682fbce95..000000000000
--- a/contrib/libg++/libio/filebuf.cc
+++ /dev/null
@@ -1,206 +0,0 @@
-/* This is part of libio/iostream, providing -*- C++ -*- input/output.
-Copyright (C) 1993, 1995 Free Software Foundation
-
-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.
-
-Written by Per Bothner (bothner@cygnus.com). */
-
-#include "iostreamP.h"
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <errno.h>
-#include "builtinbuf.h"
-
-void filebuf::init()
-{
- _IO_file_init(this);
-}
-
-filebuf::filebuf()
-{
- _IO_file_init(this);
-}
-
-#if !_IO_UNIFIED_JUMPTABLES
-/* This is like "new filebuf()", but it uses the _IO_file_jump jumptable,
- for eficiency. */
-
-filebuf* filebuf::__new()
-{
- filebuf *fb = new filebuf;
- _IO_JUMPS(fb) = &_IO_file_jumps;
- fb->_vtable() = builtinbuf_vtable;
- return fb;
-}
-#endif
-
-filebuf::filebuf(int fd)
-{
- _IO_file_init(this);
- _IO_file_attach(this, fd);
-}
-
-filebuf::filebuf(int fd, char* p, int len)
-{
- _IO_file_init(this);
- _IO_file_attach(this, fd);
- setbuf(p, len);
-}
-
-filebuf::~filebuf()
-{
- if (_IO_file_is_open(this))
- {
- _IO_do_flush (this);
- if (!(xflags() & _IO_DELETE_DONT_CLOSE))
- _IO_SYSCLOSE (this);
- }
-}
-
-filebuf* filebuf::open(const char *filename, ios::openmode mode, int prot)
-{
- if (_IO_file_is_open (this))
- return NULL;
- int posix_mode;
- int read_write;
- if (mode & ios::app)
- mode |= ios::out;
- if ((mode & (ios::in|ios::out)) == (ios::in|ios::out)) {
- posix_mode = O_RDWR;
- read_write = 0;
- }
- else if (mode & ios::out)
- posix_mode = O_WRONLY, read_write = _IO_NO_READS;
- else if (mode & (int)ios::in)
- posix_mode = O_RDONLY, read_write = _IO_NO_WRITES;
- else
- posix_mode = 0, read_write = _IO_NO_READS+_IO_NO_WRITES;
- if (mode & ios::binary)
- {
- mode &= ~ios::binary;
-#ifdef O_BINARY
- /* This is a (mis-)feature of DOS/Windows C libraries. */
- posix_mode |= O_BINARY;
-#endif
- }
- if ((mode & (int)ios::trunc) || mode == (int)ios::out)
- posix_mode |= O_TRUNC;
- if (mode & ios::app)
- posix_mode |= O_APPEND, read_write |= _IO_IS_APPENDING;
- if (!(mode & (int)ios::nocreate) && mode != ios::in)
- posix_mode |= O_CREAT;
- if (mode & (int)ios::noreplace)
- posix_mode |= O_EXCL;
- int fd = ::open(filename, posix_mode, prot);
- if (fd < 0)
- return NULL;
- _fileno = fd;
- xsetflags(read_write, _IO_NO_READS+_IO_NO_WRITES+_IO_IS_APPENDING);
- if (mode & (ios::ate|ios::app)) {
- if (pubseekoff(0, ios::end) == EOF)
- return NULL;
- }
- _IO_link_in(this);
- return this;
-}
-
-filebuf* filebuf::open(const char *filename, const char *mode)
-{
- return (filebuf*)_IO_file_fopen(this, filename, mode);
-}
-
-filebuf* filebuf::attach(int fd)
-{
- return (filebuf*)_IO_file_attach(this, fd);
-}
-
-streambuf* filebuf::setbuf(char* p, int len)
-{
- return (streambuf*)_IO_file_setbuf (this, p, len);
-}
-
-int filebuf::doallocate() { return _IO_file_doallocate(this); }
-
-int filebuf::overflow(int c)
-{
- return _IO_file_overflow(this, c);
-}
-
-int filebuf::underflow()
-{
- return _IO_file_underflow(this);
-}
-
-int filebuf::sync()
-{
- return _IO_file_sync(this);
-}
-
-streampos filebuf::seekoff(streamoff offset, _seek_dir dir, int mode)
-{
- return _IO_file_seekoff (this, offset, dir, mode);
-}
-
-filebuf* filebuf::close()
-{
- return (_IO_file_close_it(this) ? (filebuf*)NULL : this);
-}
-
-streamsize filebuf::sys_read(char* buf, streamsize size)
-{
- return _IO_file_read(this, buf, size);
-}
-
-streampos filebuf::sys_seek(streamoff offset, _seek_dir dir)
-{
- return _IO_file_seek(this, offset, dir);
-}
-
-streamsize filebuf::sys_write(const char *buf, streamsize n)
-{
- return _IO_file_write (this, buf, n);
-}
-
-int filebuf::sys_stat(void* st)
-{
- return _IO_file_stat (this, st);
-}
-
-int filebuf::sys_close()
-{
- return _IO_file_close (this);
-}
-
-streamsize filebuf::xsputn(const char *s, streamsize n)
-{
- return _IO_file_xsputn(this, s, n);
-}
-
-streamsize filebuf::xsgetn(char *s, streamsize n)
-{
- // FIXME: OPTIMIZE THIS (specifically, when unbuffered()).
- return streambuf::xsgetn(s, n);
-}
-
-// Non-ANSI AT&T-ism: Default open protection.
-const int filebuf::openprot = 0644;
diff --git a/contrib/libg++/libio/filedoalloc.c b/contrib/libg++/libio/filedoalloc.c
deleted file mode 100644
index f838bb3458f7..000000000000
--- a/contrib/libg++/libio/filedoalloc.c
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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. */
-
-/*
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms are permitted
- * provided that the above copyright notice and this paragraph are
- * duplicated in all such forms and that any documentation,
- * advertising materials, and other materials related to such
- * distribution and use acknowledge that the software was developed
- * by the University of California, Berkeley. The name of the
- * University may not be used to endorse or promote products derived
- * from this software without specific prior written permission.
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- */
-
-/* Modified for GNU iostream by Per Bothner 1991, 1992. */
-
-#define _POSIX_SOURCE
-#include "libioP.h"
-#include <sys/types.h>
-#include <sys/stat.h>
-#ifdef __STDC__
-#include <stdlib.h>
-#include <unistd.h>
-#endif
-
-/*
- * Allocate a file buffer, or switch to unbuffered I/O.
- * Per the ANSI C standard, ALL tty devices default to line buffered.
- *
- * As a side effect, we set __SOPT or __SNPT (en/dis-able fseek
- * optimisation) right after the _fstat() that finds the buffer size.
- */
-
-int
-DEFUN(_IO_file_doallocate, (fp),
- register _IO_FILE *fp)
-{
- register _IO_size_t size;
- int couldbetty;
- register char *p;
- struct stat st;
-
- /* If _IO_cleanup_registration_needed is non-zero, we should call the
- function it points to. This is to make sure _IO_cleanup gets called
- on exit. We call it from _IO_file_doallocate, since that is likely
- to get called by any program that does buffered I/O. */
- if (_IO_cleanup_registration_needed)
- (*_IO_cleanup_registration_needed)();
-
- if (fp->_fileno < 0 || _IO_SYSSTAT (fp, &st) < 0)
- {
- couldbetty = 0;
- size = _IO_BUFSIZ;
-#if 0
- /* do not try to optimise fseek() */
- fp->_flags |= __SNPT;
-#endif
- }
- else
- {
- couldbetty = S_ISCHR(st.st_mode);
-#if _IO_HAVE_ST_BLKSIZE
- size = st.st_blksize <= 0 ? _IO_BUFSIZ : st.st_blksize;
-#else
- size = _IO_BUFSIZ;
-#endif
- }
- p = ALLOC_BUF(size);
- if (p == NULL)
- return EOF;
- _IO_setb(fp, p, p+size, 1);
- if (couldbetty && isatty(fp->_fileno))
- fp->_flags |= _IO_LINE_BUF;
- return 1;
-}
diff --git a/contrib/libg++/libio/fileops.c b/contrib/libg++/libio/fileops.c
deleted file mode 100644
index 812af94d0f95..000000000000
--- a/contrib/libg++/libio/fileops.c
+++ /dev/null
@@ -1,755 +0,0 @@
-/*
-Copyright (C) 1993, 1995 Free Software Foundation
-
-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. */
-
-/* written by Per Bothner (bothner@cygnus.com) */
-
-#define _POSIX_SOURCE
-#include "libioP.h"
-#include <fcntl.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <string.h>
-#include <errno.h>
-#ifndef errno
-extern int errno;
-#endif
-
-/* An fstream can be in at most one of put mode, get mode, or putback mode.
- Putback mode is a variant of get mode.
-
- In a filebuf, there is only one current position, instead of two
- separate get and put pointers. In get mode, the current posistion
- is that of gptr(); in put mode that of pptr().
-
- The position in the buffer that corresponds to the position
- in external file system is normally _IO_read_end, except in putback
- mode, when it is _IO_save_end.
- If the field _fb._offset is >= 0, it gives the offset in
- the file as a whole corresponding to eGptr(). (?)
-
- PUT MODE:
- If a filebuf is in put mode, then all of _IO_read_ptr, _IO_read_end,
- and _IO_read_base are equal to each other. These are usually equal
- to _IO_buf_base, though not necessarily if we have switched from
- get mode to put mode. (The reason is to maintain the invariant
- that _IO_read_end corresponds to the external file position.)
- _IO_write_base is non-NULL and usually equal to _IO_base_base.
- We also have _IO_write_end == _IO_buf_end, but only in fully buffered mode.
- The un-flushed character are those between _IO_write_base and _IO_write_ptr.
-
- GET MODE:
- If a filebuf is in get or putback mode, eback() != egptr().
- In get mode, the unread characters are between gptr() and egptr().
- The OS file position corresponds to that of egptr().
-
- PUTBACK MODE:
- Putback mode is used to remember "excess" characters that have
- been sputbackc'd in a separate putback buffer.
- In putback mode, the get buffer points to the special putback buffer.
- The unread characters are the characters between gptr() and egptr()
- in the putback buffer, as well as the area between save_gptr()
- and save_egptr(), which point into the original reserve buffer.
- (The pointers save_gptr() and save_egptr() are the values
- of gptr() and egptr() at the time putback mode was entered.)
- The OS position corresponds to that of save_egptr().
-
- LINE BUFFERED OUTPUT:
- During line buffered output, _IO_write_base==base() && epptr()==base().
- However, ptr() may be anywhere between base() and ebuf().
- This forces a call to filebuf::overflow(int C) on every put.
- If there is more space in the buffer, and C is not a '\n',
- then C is inserted, and pptr() incremented.
-
- UNBUFFERED STREAMS:
- If a filebuf is unbuffered(), the _shortbuf[1] is used as the buffer.
-*/
-
-#define CLOSED_FILEBUF_FLAGS \
- (_IO_IS_FILEBUF+_IO_NO_READS+_IO_NO_WRITES+_IO_TIED_PUT_GET)
-
-
-void
-DEFUN(_IO_file_init, (fp),
- register _IO_FILE *fp)
-{
- /* POSIX.1 allows another file handle to be used to change the position
- of our file descriptor. Hence we actually don't know the actual
- position before we do the first fseek (and until a following fflush). */
- fp->_offset = _IO_pos_BAD;
- fp->_IO_file_flags |= CLOSED_FILEBUF_FLAGS;
-
- _IO_link_in(fp);
- fp->_fileno = -1;
-}
-
-int
-DEFUN(_IO_file_close_it, (fp),
- register _IO_FILE* fp)
-{
- int write_status, close_status;
- if (!_IO_file_is_open(fp))
- return EOF;
-
- write_status = _IO_do_flush (fp);
-
- _IO_unsave_markers(fp);
-
- close_status = _IO_SYSCLOSE (fp);
-
- /* Free buffer. */
- _IO_setb(fp, NULL, NULL, 0);
- _IO_setg(fp, NULL, NULL, NULL);
- _IO_setp(fp, NULL, NULL);
-
- _IO_un_link(fp);
- fp->_flags = _IO_MAGIC|CLOSED_FILEBUF_FLAGS;
- fp->_fileno = EOF;
- fp->_offset = _IO_pos_BAD;
-
- return close_status ? close_status : write_status;
-}
-
-void
-DEFUN(_IO_file_finish, (fp),
- register _IO_FILE* fp)
-{
- if (_IO_file_is_open(fp))
- {
- _IO_do_flush (fp);
- if (!(fp->_flags & _IO_DELETE_DONT_CLOSE))
- _IO_SYSCLOSE (fp);
- }
- _IO_default_finish(fp);
-}
-
-_IO_FILE *
-DEFUN(_IO_file_fopen, (fp, filename, mode),
- register _IO_FILE *fp AND const char *filename AND const char *mode)
-{
- int oflags = 0, omode;
- int read_write, fdesc;
- int oprot = 0666;
- if (_IO_file_is_open (fp))
- return 0;
- switch (*mode++) {
- case 'r':
- omode = O_RDONLY;
- read_write = _IO_NO_WRITES;
- break;
- case 'w':
- omode = O_WRONLY;
- oflags = O_CREAT|O_TRUNC;
- read_write = _IO_NO_READS;
- break;
- case 'a':
- omode = O_WRONLY;
- oflags = O_CREAT|O_APPEND;
- read_write = _IO_NO_READS|_IO_IS_APPENDING;
- break;
- default:
- errno = EINVAL;
- return NULL;
- }
- if (mode[0] == '+' || (mode[0] == 'b' && mode[1] == '+')) {
- omode = O_RDWR;
- read_write &= _IO_IS_APPENDING;
- }
- fdesc = open(filename, omode|oflags, oprot);
- if (fdesc < 0)
- return NULL;
- fp->_fileno = fdesc;
- _IO_mask_flags(fp, read_write,_IO_NO_READS+_IO_NO_WRITES+_IO_IS_APPENDING);
- if (read_write & _IO_IS_APPENDING)
- if (_IO_SEEKOFF (fp, (_IO_off_t)0, _IO_seek_end, _IOS_INPUT|_IOS_OUTPUT)
- == _IO_pos_BAD)
- return NULL;
- _IO_link_in(fp);
- return fp;
-}
-
-_IO_FILE*
-DEFUN(_IO_file_attach, (fp, fd),
- _IO_FILE *fp AND int fd)
-{
- if (_IO_file_is_open(fp))
- return NULL;
- fp->_fileno = fd;
- fp->_flags &= ~(_IO_NO_READS+_IO_NO_WRITES);
- fp->_flags |= _IO_DELETE_DONT_CLOSE;
- fp->_offset = _IO_pos_BAD;
- return fp;
-}
-
-_IO_FILE*
-DEFUN(_IO_file_setbuf, (fp, p, len),
- register _IO_FILE *fp AND char* p AND _IO_ssize_t len)
-{
- if (_IO_default_setbuf(fp, p, len) == NULL)
- return NULL;
-
- fp->_IO_write_base = fp->_IO_write_ptr = fp->_IO_write_end
- = fp->_IO_buf_base;
- _IO_setg(fp, fp->_IO_buf_base, fp->_IO_buf_base, fp->_IO_buf_base);
-
- return fp;
-}
-
-/* Write TO_DO bytes from DATA to FP.
- Then mark FP as having empty buffers. */
-
-int
-DEFUN(_IO_do_write, (fp, data, to_do),
- register _IO_FILE *fp AND const char* data AND _IO_size_t to_do)
-{
- _IO_size_t count;
- if (to_do == 0)
- return 0;
- else
- {
- if (fp->_flags & _IO_IS_APPENDING)
- /* On a system without a proper O_APPEND implementation,
- you would need to sys_seek(0, SEEK_END) here, but is
- is not needed nor desirable for Unix- or Posix-like systems.
- Instead, just indicate that offset (before and after) is
- unpredictable. */
- fp->_offset = _IO_pos_BAD;
- else if (fp->_IO_read_end != fp->_IO_write_base)
- {
- _IO_pos_t new_pos
- = _IO_SYSSEEK(fp, fp->_IO_write_base - fp->_IO_read_end, 1);
- if (new_pos == _IO_pos_BAD)
- return EOF;
- fp->_offset = new_pos;
- }
- count = _IO_SYSWRITE (fp, data, to_do);
- if (fp->_cur_column)
- fp->_cur_column
- = _IO_adjust_column (fp->_cur_column - 1, data, to_do) + 1;
- }
- _IO_setg(fp, fp->_IO_buf_base, fp->_IO_buf_base, fp->_IO_buf_base);
- fp->_IO_write_base = fp->_IO_write_ptr = fp->_IO_buf_base;
- fp->_IO_write_end = (fp->_flags & (_IO_LINE_BUF+_IO_UNBUFFERED)) ? fp->_IO_buf_base
- : fp->_IO_buf_end;
- return count != to_do ? EOF : 0;
-}
-
-int
-DEFUN(_IO_file_underflow, (fp),
- register _IO_FILE *fp)
-{
- _IO_ssize_t count;
-#if 0
- /* SysV does not make this test; take it out for compatibility */
- if (fp->_flags & _IO_EOF_SEEN)
- return (EOF);
-#endif
-
- if (fp->_flags & _IO_NO_READS)
- return EOF;
- if (fp->_IO_read_ptr < fp->_IO_read_end)
- return *(unsigned char*)fp->_IO_read_ptr;
-
- if (fp->_IO_buf_base == NULL)
- _IO_doallocbuf(fp);
-
- /* Flush all line buffered files before reading. */
- /* FIXME This can/should be moved to genops ?? */
- if (fp->_flags & (_IO_LINE_BUF|_IO_UNBUFFERED))
- _IO_flush_all_linebuffered();
-
- _IO_switch_to_get_mode(fp);
-
- count = _IO_SYSREAD (fp, fp->_IO_buf_base,
- fp->_IO_buf_end - fp->_IO_buf_base);
- if (count <= 0)
- {
- if (count == 0)
- fp->_flags |= _IO_EOF_SEEN;
- else
- fp->_flags |= _IO_ERR_SEEN, count = 0;
- }
- fp->_IO_read_base = fp->_IO_read_ptr = fp->_IO_buf_base;
- fp->_IO_read_end = fp->_IO_buf_base + count;
- fp->_IO_write_base = fp->_IO_write_ptr = fp->_IO_write_end
- = fp->_IO_buf_base;
- if (count == 0)
- return EOF;
- if (fp->_offset != _IO_pos_BAD)
- _IO_pos_adjust(fp->_offset, count);
- return *(unsigned char*)fp->_IO_read_ptr;
-}
-
-int
-DEFUN(_IO_file_overflow, (f, ch),
- register _IO_FILE* f AND int ch)
-{
- if (f->_flags & _IO_NO_WRITES) /* SET ERROR */
- return EOF;
- /* If currently reading or no buffer allocated. */
- if ((f->_flags & _IO_CURRENTLY_PUTTING) == 0)
- {
- /* Allocate a buffer if needed. */
- if (f->_IO_write_base == 0)
- {
- _IO_doallocbuf(f);
- _IO_setg (f, f->_IO_buf_base, f->_IO_buf_base, f->_IO_buf_base);
- }
- /* Otherwise must be currently reading.
- If _IO_read_ptr (and hence also _IO_read_end) is at the buffer end,
- logically slide the buffer forwards one block (by setting the
- read pointers to all point at the beginning of the block). This
- makes room for subsequent output.
- Otherwise, set the read pointers to _IO_read_end (leaving that
- alone, so it can continue to correspond to the external position). */
- if (f->_IO_read_ptr == f->_IO_buf_end)
- f->_IO_read_end = f->_IO_read_ptr = f->_IO_buf_base;
- f->_IO_write_ptr = f->_IO_read_ptr;
- f->_IO_write_base = f->_IO_write_ptr;
- f->_IO_write_end = f->_IO_buf_end;
- f->_IO_read_base = f->_IO_read_ptr = f->_IO_read_end;
-
- if (f->_flags & (_IO_LINE_BUF+_IO_UNBUFFERED))
- f->_IO_write_end = f->_IO_write_ptr;
- f->_flags |= _IO_CURRENTLY_PUTTING;
- }
- if (ch == EOF)
- return _IO_do_flush(f);
- if (f->_IO_write_ptr == f->_IO_buf_end ) /* Buffer is really full */
- if (_IO_do_flush(f) == EOF)
- return EOF;
- *f->_IO_write_ptr++ = ch;
- if ((f->_flags & _IO_UNBUFFERED)
- || ((f->_flags & _IO_LINE_BUF) && ch == '\n'))
- if (_IO_do_flush(f) == EOF)
- return EOF;
- return (unsigned char)ch;
-}
-
-int
-DEFUN(_IO_file_sync, (fp),
- register _IO_FILE* fp)
-{
- _IO_size_t delta;
- /* char* ptr = cur_ptr(); */
- if (fp->_IO_write_ptr > fp->_IO_write_base)
- if (_IO_do_flush(fp)) return EOF;
- delta = fp->_IO_read_ptr - fp->_IO_read_end;
- if (delta != 0)
- {
-#ifdef TODO
- if (_IO_in_backup(fp))
- delta -= eGptr() - Gbase();
-#endif
- _IO_off_t new_pos = _IO_SYSSEEK (fp, delta, 1);
- if (new_pos != (_IO_off_t)EOF)
- fp->_IO_read_end = fp->_IO_read_ptr;
-#ifdef ESPIPE
- else if (errno == ESPIPE)
- ; /* Ignore error from unseekable devices. */
-#endif
- else
- return EOF;
- }
- fp->_offset = _IO_pos_BAD;
- /* FIXME: Cleanup - can this be shared? */
- /* setg(base(), ptr, ptr); */
- return 0;
-}
-
-_IO_pos_t
-DEFUN(_IO_file_seekoff, (fp, offset, dir, mode),
- register _IO_FILE *fp AND _IO_off_t offset AND int dir AND int mode)
-{
- _IO_pos_t result;
- _IO_off_t delta, new_offset;
- long count;
-
- if (mode == 0)
- dir = _IO_seek_cur, offset = 0; /* Don't move any pointers. */
-
- /* Flush unwritten characters.
- (This may do an unneeded write if we seek within the buffer.
- But to be able to switch to reading, we would need to set
- egptr to ptr. That can't be done in the current design,
- which assumes file_ptr() is eGptr. Anyway, since we probably
- end up flushing when we close(), it doesn't make much difference.)
- FIXME: simulate mem-papped files. */
-
- if (fp->_IO_write_ptr > fp->_IO_write_base || _IO_in_put_mode(fp))
- if (_IO_switch_to_get_mode(fp)) return EOF;
-
- if (fp->_IO_buf_base == NULL)
- {
- _IO_doallocbuf(fp);
- _IO_setp(fp, fp->_IO_buf_base, fp->_IO_buf_base);
- _IO_setg(fp, fp->_IO_buf_base, fp->_IO_buf_base, fp->_IO_buf_base);
- }
-
- switch (dir)
- {
- case _IO_seek_cur:
- /* Adjust for read-ahead (bytes is buffer). */
- offset -= fp->_IO_read_end - fp->_IO_read_ptr;
- if (fp->_offset == _IO_pos_BAD)
- goto dumb;
- /* Make offset absolute, assuming current pointer is file_ptr(). */
- offset += _IO_pos_as_off(fp->_offset);
-
- dir = _IO_seek_set;
- break;
- case _IO_seek_set:
- break;
- case _IO_seek_end:
- {
- struct stat st;
- if (_IO_SYSSTAT (fp, &st) == 0 && S_ISREG(st.st_mode))
- {
- offset += st.st_size;
- dir = _IO_seek_set;
- }
- else
- goto dumb;
- }
- }
- /* At this point, dir==_IO_seek_set. */
-
- /* If destination is within current buffer, optimize: */
- if (fp->_offset != _IO_pos_BAD && fp->_IO_read_base != NULL
- && !_IO_in_backup (fp))
- {
- /* Offset relative to start of main get area. */
- _IO_pos_t rel_offset = offset - fp->_offset
- + (fp->_IO_read_end - fp->_IO_read_base);
- if (rel_offset >= 0)
- {
-#if 0
- if (_IO_in_backup(fp))
- _IO_switch_to_main_get_area(fp);
-#endif
- if (rel_offset <= fp->_IO_read_end - fp->_IO_read_base)
- {
- _IO_setg(fp, fp->_IO_buf_base, fp->_IO_buf_base + rel_offset,
- fp->_IO_read_end);
- _IO_setp(fp, fp->_IO_buf_base, fp->_IO_buf_base);
- return offset;
- }
-#ifdef TODO
- /* If we have streammarkers, seek forward by reading ahead. */
- if (_IO_have_markers(fp))
- {
- int to_skip = rel_offset
- - (fp->_IO_read_ptr - fp->_IO_read_base);
- if (ignore(to_skip) != to_skip)
- goto dumb;
- return offset;
- }
-#endif
- }
-#ifdef TODO
- if (rel_offset < 0 && rel_offset >= Bbase() - Bptr())
- {
- if (!_IO_in_backup(fp))
- _IO_switch_to_backup_area(fp);
- gbump(fp->_IO_read_end + rel_offset - fp->_IO_read_ptr);
- return offset;
- }
-#endif
- }
-
-#ifdef TODO
- _IO_unsave_markers(fp);
-#endif
-
- if (fp->_flags & _IO_NO_READS)
- goto dumb;
-
- /* Try to seek to a block boundary, to improve kernel page management. */
- new_offset = offset & ~(fp->_IO_buf_end - fp->_IO_buf_base - 1);
- delta = offset - new_offset;
- if (delta > fp->_IO_buf_end - fp->_IO_buf_base)
- {
- new_offset = offset;
- delta = 0;
- }
- result = _IO_SYSSEEK (fp, new_offset, 0);
- if (result < 0)
- return EOF;
- if (delta == 0)
- count = 0;
- else
- {
- count = _IO_SYSREAD (fp, fp->_IO_buf_base,
- fp->_IO_buf_end - fp->_IO_buf_base);
- if (count < delta)
- {
- /* We weren't allowed to read, but try to seek the remainder. */
- offset = count == EOF ? delta : delta-count;
- dir = _IO_seek_cur;
- goto dumb;
- }
- }
- _IO_setg(fp, fp->_IO_buf_base, fp->_IO_buf_base+delta, fp->_IO_buf_base+count);
- _IO_setp(fp, fp->_IO_buf_base, fp->_IO_buf_base);
- fp->_offset = result + count;
- _IO_mask_flags(fp, 0, _IO_EOF_SEEN);
- return offset;
- dumb:
-
- _IO_unsave_markers(fp);
- result = _IO_SYSSEEK (fp, offset, dir);
- if (result != EOF)
- _IO_mask_flags(fp, 0, _IO_EOF_SEEN);
- fp->_offset = result;
- _IO_setg(fp, fp->_IO_buf_base, fp->_IO_buf_base, fp->_IO_buf_base);
- _IO_setp(fp, fp->_IO_buf_base, fp->_IO_buf_base);
- return result;
-}
-
-_IO_ssize_t
-DEFUN(_IO_file_read, (fp, buf, size),
- register _IO_FILE* fp AND void* buf AND _IO_ssize_t size)
-{
- for (;;)
- {
- _IO_ssize_t count = _IO_read(fp->_fileno, buf, size);
-#ifdef EINTR
- if (count == -1 && errno == EINTR)
- continue;
-#endif
- return count;
- }
-}
-
-_IO_pos_t
-DEFUN(_IO_file_seek, (fp, offset, dir),
- _IO_FILE *fp AND _IO_off_t offset AND int dir)
-{
- return _IO_lseek(fp->_fileno, offset, dir);
-}
-
-int
-DEFUN(_IO_file_stat, (fp, st),
- _IO_FILE *fp AND void* st)
-{
- return _IO_fstat(fp->_fileno, (struct stat*)st);
-}
-
-int
-DEFUN(_IO_file_close, (fp),
- _IO_FILE* fp)
-{
- return _IO_close(fp->_fileno);
-}
-
-_IO_ssize_t
-DEFUN(_IO_file_write, (f, data, n),
- register _IO_FILE* f AND const void* data AND _IO_ssize_t n)
-{
- _IO_ssize_t to_do = n;
- while (to_do > 0)
- {
- _IO_ssize_t count = _IO_write(f->_fileno, data, to_do);
- if (count == EOF)
- {
-#ifdef EINTR
- if (errno == EINTR)
- continue;
- else
-#endif
- {
- f->_flags |= _IO_ERR_SEEN;
- break;
- }
- }
- to_do -= count;
- data = (void*)((char*)data + count);
- }
- n -= to_do;
- if (f->_offset >= 0)
- f->_offset += n;
- return n;
-}
-
-_IO_size_t
-DEFUN(_IO_file_xsputn, (f, data, n),
- _IO_FILE *f AND const void *data AND _IO_size_t n)
-{
- register const char *s = (char*) data;
- _IO_size_t to_do = n;
- int must_flush = 0;
- _IO_size_t count;
-
- if (n <= 0)
- return 0;
- /* This is an optimized implementation.
- If the amount to be written straddles a block boundary
- (or the filebuf is unbuffered), use sys_write directly. */
-
- /* First figure out how much space is available in the buffer. */
- count = f->_IO_write_end - f->_IO_write_ptr; /* Space available. */
- if ((f->_flags & _IO_LINE_BUF) && (f->_flags & _IO_CURRENTLY_PUTTING))
- {
- count = f->_IO_buf_end - f->_IO_write_ptr;
- if (count >= n)
- { register const char *p;
- for (p = s + n; p > s; )
- {
- if (*--p == '\n') {
- count = p - s + 1;
- must_flush = 1;
- break;
- }
- }
- }
- }
- /* Then fill the buffer. */
- if (count > 0)
- {
- if (count > to_do)
- count = to_do;
- if (count > 20) {
- memcpy(f->_IO_write_ptr, s, count);
- s += count;
- }
- else
- {
- register char *p = f->_IO_write_ptr;
- register int i = (int)count;
- while (--i >= 0) *p++ = *s++;
- }
- f->_IO_write_ptr += count;
- to_do -= count;
- }
- if (to_do + must_flush > 0)
- { _IO_size_t block_size, dont_write;
- /* Next flush the (full) buffer. */
- if (__overflow(f, EOF) == EOF)
- return n - to_do;
-
- /* Try to maintain alignment: write a whole number of blocks.
- dont_write is what gets left over. */
- block_size = f->_IO_buf_end - f->_IO_buf_base;
- dont_write = block_size >= 128 ? to_do % block_size : 0;
-
- count = to_do - dont_write;
- if (_IO_do_write(f, s, count) == EOF)
- return n - to_do;
- to_do = dont_write;
-
- /* Now write out the remainder. Normally, this will fit in the
- buffer, but it's somewhat messier for line-buffered files,
- so we let _IO_default_xsputn handle the general case. */
- if (dont_write)
- to_do -= _IO_default_xsputn(f, s+count, dont_write);
- }
- return n - to_do;
-}
-
-#if 0
-/* Work in progress */
-_IO_size_t
-DEFUN(_IO_file_xsgetn, (fp, data, n),
- _IO_FILE *fp AND void *data AND _IO_size_t n)
-{
- register _IO_size_t more = n;
- register char *s = data;
- for (;;)
- {
- _IO_ssize_t count = fp->_IO_read_end - fp->_IO_read_ptr; /* Data available. */
- if (count > 0)
- {
- if (count > more)
- count = more;
- if (count > 20)
- {
- memcpy(s, fp->_IO_read_ptr, count);
- s += count;
- fp->_IO_read_ptr += count;
- }
- else if (count <= 0)
- count = 0;
- else
- {
- register char *p = fp->_IO_read_ptr;
- register int i = (int)count;
- while (--i >= 0) *s++ = *p++;
- fp->_IO_read_ptr = p;
- }
- more -= count;
- }
-#if 0
- if (! _IO_in put_mode (fp)
- && ! _IO_have_markers (fp) && ! IO_have_backup (fp))
- {
- /* This is an optimization of _IO_file_underflow */
- if (fp->_flags & _IO_NO_READS)
- break;
- /* If we're reading a lot of data, don't bother allocating
- a buffer. But if we're only reading a bit, perhaps we should ??*/
- if (count <= 512 && fp->_IO_buf_base == NULL)
- _IO_doallocbuf(fp);
- if (fp->_flags & (_IO_LINE_BUF|_IO_UNBUFFERED))
- _IO_flush_all_linebuffered();
-
- _IO_switch_to_get_mode(fp); ???;
- count = _IO_SYSREAD (fp, s, more);
- if (count <= 0)
- {
- if (count == 0)
- fp->_flags |= _IO_EOF_SEEN;
- else
- fp->_flags |= _IO_ERR_SEEN, count = 0;
- }
-
- s += count;
- more -= count;
- }
-#endif
- if (more == 0 || __underflow(fp) == EOF)
- break;
- }
- return n - more;
-}
-#endif
-
-struct _IO_jump_t _IO_file_jumps = {
- JUMP_INIT_DUMMY,
- JUMP_INIT(finish, _IO_file_finish),
- JUMP_INIT(overflow, _IO_file_overflow),
- JUMP_INIT(underflow, _IO_file_underflow),
- JUMP_INIT(uflow, _IO_default_uflow),
- JUMP_INIT(pbackfail, _IO_default_pbackfail),
- JUMP_INIT(xsputn, _IO_file_xsputn),
- JUMP_INIT(xsgetn, _IO_default_xsgetn),
- JUMP_INIT(seekoff, _IO_file_seekoff),
- JUMP_INIT(seekpos, _IO_default_seekpos),
- JUMP_INIT(setbuf, _IO_file_setbuf),
- JUMP_INIT(sync, _IO_file_sync),
- JUMP_INIT(doallocate, _IO_file_doallocate),
- JUMP_INIT(read, _IO_file_read),
- JUMP_INIT(write, _IO_file_write),
- JUMP_INIT(seek, _IO_file_seek),
- JUMP_INIT(close, _IO_file_close),
- JUMP_INIT(stat, _IO_file_stat)
-};
diff --git a/contrib/libg++/libio/floatconv.c b/contrib/libg++/libio/floatconv.c
deleted file mode 100644
index def7269d97f1..000000000000
--- a/contrib/libg++/libio/floatconv.c
+++ /dev/null
@@ -1,2350 +0,0 @@
-/*
-Copyright (C) 1993, 1994 Free Software Foundation
-
-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>
-#ifdef _IO_USE_DTOA
-/****************************************************************
- *
- * The author of this software is David M. Gay.
- *
- * Copyright (c) 1991 by AT&T.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose without fee is hereby granted, provided that this entire notice
- * is included in all copies of any software which is or includes a copy
- * or modification of this software and in all copies of the supporting
- * documentation for such software.
- *
- * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED
- * WARRANTY. IN PARTICULAR, NEITHER THE AUTHOR NOR AT&T MAKES ANY
- * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
- * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
- *
- ***************************************************************/
-
-/* Some cleaning up by Per Bothner, bothner@cygnus.com, 1992, 1993.
- Re-written to not need static variables
- (except result, result_k, HIWORD, LOWORD). */
-
-/* Please send bug reports to
- David M. Gay
- AT&T Bell Laboratories, Room 2C-463
- 600 Mountain Avenue
- Murray Hill, NJ 07974-2070
- U.S.A.
- dmg@research.att.com or research!dmg
- */
-
-/* strtod for IEEE-, VAX-, and IBM-arithmetic machines.
- *
- * This strtod returns a nearest machine number to the input decimal
- * string (or sets errno to ERANGE). With IEEE arithmetic, ties are
- * broken by the IEEE round-even rule. Otherwise ties are broken by
- * biased rounding (add half and chop).
- *
- * Inspired loosely by William D. Clinger's paper "How to Read Floating
- * Point Numbers Accurately" [Proc. ACM SIGPLAN '90, pp. 92-101].
- *
- * Modifications:
- *
- * 1. We only require IEEE, IBM, or VAX double-precision
- * arithmetic (not IEEE double-extended).
- * 2. We get by with floating-point arithmetic in a case that
- * Clinger missed -- when we're computing d * 10^n
- * for a small integer d and the integer n is not too
- * much larger than 22 (the maximum integer k for which
- * we can represent 10^k exactly), we may be able to
- * compute (d*10^k) * 10^(e-k) with just one roundoff.
- * 3. Rather than a bit-at-a-time adjustment of the binary
- * result in the hard case, we use floating-point
- * arithmetic to determine the adjustment to within
- * one bit; only in really hard cases do we need to
- * compute a second residual.
- * 4. Because of 3., we don't need a large table of powers of 10
- * for ten-to-e (just some small tables, e.g. of 10^k
- * for 0 <= k <= 22).
- */
-
-/*
- * #define IEEE_8087 for IEEE-arithmetic machines where the least
- * significant byte has the lowest address.
- * #define IEEE_MC68k for IEEE-arithmetic machines where the most
- * significant byte has the lowest address.
- * #define Sudden_Underflow for IEEE-format machines without gradual
- * underflow (i.e., that flush to zero on underflow).
- * #define IBM for IBM mainframe-style floating-point arithmetic.
- * #define VAX for VAX-style floating-point arithmetic.
- * #define Unsigned_Shifts if >> does treats its left operand as unsigned.
- * #define No_leftright to omit left-right logic in fast floating-point
- * computation of dtoa.
- * #define Check_FLT_ROUNDS if FLT_ROUNDS can assume the values 2 or 3.
- * #define RND_PRODQUOT to use rnd_prod and rnd_quot (assembly routines
- * that use extended-precision instructions to compute rounded
- * products and quotients) with IBM.
- * #define ROUND_BIASED for IEEE-format with biased rounding.
- * #define Inaccurate_Divide for IEEE-format with correctly rounded
- * products but inaccurate quotients, e.g., for Intel i860.
- * #define KR_headers for old-style C function headers.
- */
-
-#ifdef DEBUG
-#include <stdio.h>
-#define Bug(x) {fprintf(stderr, "%s\n", x); exit(1);}
-#endif
-
-#ifdef __STDC__
-#include <stdlib.h>
-#include <string.h>
-#include <float.h>
-#define CONST const
-#else
-#define CONST
-#define KR_headers
-
-/* In this case, we assume IEEE floats. */
-#define FLT_ROUNDS 1
-#define FLT_RADIX 2
-#define DBL_MANT_DIG 53
-#define DBL_DIG 15
-#define DBL_MAX_10_EXP 308
-#define DBL_MAX_EXP 1024
-#endif
-
-#include <errno.h>
-#ifndef __MATH_H__
-#include <math.h>
-#endif
-
-#ifdef Unsigned_Shifts
-#define Sign_Extend(a,b) if (b < 0) a |= 0xffff0000;
-#else
-#define Sign_Extend(a,b) /*no-op*/
-#endif
-
-#if defined(__i386__) || defined(__i860__) || defined(clipper)
-#define IEEE_8087
-#endif
-#if defined(MIPSEL) || defined(__alpha__)
-#define IEEE_8087
-#endif
-#if defined(__sparc__) || defined(sparc) || defined(MIPSEB)
-#define IEEE_MC68k
-#endif
-
-#if defined(IEEE_8087) + defined(IEEE_MC68k) + defined(VAX) + defined(IBM) != 1
-
-#if FLT_RADIX==16
-#define IBM
-#else
-#if DBL_MANT_DIG==56
-#define VAX
-#else
-#if DBL_MANT_DIG==53 && DBL_MAX_10_EXP==308
-#define IEEE_Unknown
-#else
-Exactly one of IEEE_8087, IEEE_MC68k, VAX, or IBM should be defined.
-#endif
-#endif
-#endif
-#endif
-
-typedef _G_uint32_t unsigned32;
-
-union doubleword {
- double d;
- unsigned32 u[2];
-};
-
-#ifdef IEEE_8087
-#define HIWORD 1
-#define LOWORD 0
-#define TEST_ENDIANNESS /* nothing */
-#else
-#if defined(IEEE_MC68k)
-#define HIWORD 0
-#define LOWORD 1
-#define TEST_ENDIANNESS /* nothing */
-#else
-static int HIWORD = -1, LOWORD;
-static void test_endianness()
-{
- union doubleword dw;
- dw.d = 10;
- if (dw.u[0] != 0) /* big-endian */
- HIWORD=0, LOWORD=1;
- else
- HIWORD=1, LOWORD=0;
-}
-#define TEST_ENDIANNESS if (HIWORD<0) test_endianness();
-#endif
-#endif
-
-#if 0
-union doubleword _temp;
-#endif
-#ifdef __GNUC__
-#define word0(x) ({ union doubleword _du; _du.d = (x); _du.u[HIWORD]; })
-#define word1(x) ({ union doubleword _du; _du.d = (x); _du.u[LOWORD]; })
-#define setword0(D,W) \
- ({ union doubleword _du; _du.d = (D); _du.u[HIWORD]=(W); (D)=_du.d; })
-#define setword1(D,W) \
- ({ union doubleword _du; _du.d = (D); _du.u[LOWORD]=(W); (D)=_du.d; })
-#define setwords(D,W0,W1) ({ union doubleword _du; \
- _du.u[HIWORD]=(W0); _du.u[LOWORD]=(W1); (D)=_du.d; })
-#define addword0(D,W) \
- ({ union doubleword _du; _du.d = (D); _du.u[HIWORD]+=(W); (D)=_du.d; })
-#else
-#define word0(x) ((unsigned32 *)&x)[HIWORD]
-#define word1(x) ((unsigned32 *)&x)[LOWORD]
-#define setword0(D,W) word0(D) = (W)
-#define setword1(D,W) word1(D) = (W)
-#define setwords(D,W0,W1) (setword0(D,W0),setword1(D,W1))
-#define addword0(D,X) (word0(D) += (X))
-#endif
-
-/* The following definition of Storeinc is appropriate for MIPS processors. */
-#if defined(IEEE_8087) + defined(VAX)
-#define Storeinc(a,b,c) (((unsigned short *)a)[1] = (unsigned short)b, \
-((unsigned short *)a)[0] = (unsigned short)c, a++)
-#else
-#if defined(IEEE_MC68k)
-#define Storeinc(a,b,c) (((unsigned short *)a)[0] = (unsigned short)b, \
-((unsigned short *)a)[1] = (unsigned short)c, a++)
-#else
-#define Storeinc(a,b,c) (*a++ = b << 16 | c & 0xffff)
-#endif
-#endif
-
-/* #define P DBL_MANT_DIG */
-/* Ten_pmax = floor(P*log(2)/log(5)) */
-/* Bletch = (highest power of 2 < DBL_MAX_10_EXP) / 16 */
-/* Quick_max = floor((P-1)*log(FLT_RADIX)/log(10) - 1) */
-/* Int_max = floor(P*log(FLT_RADIX)/log(10) - 1) */
-
-#if defined(IEEE_8087) + defined(IEEE_MC68k) + defined(IEEE_Unknown)
-#define Exp_shift 20
-#define Exp_shift1 20
-#define Exp_msk1 0x100000
-#define Exp_msk11 0x100000
-#define Exp_mask 0x7ff00000
-#define P 53
-#define Bias 1023
-#define IEEE_Arith
-#define Emin (-1022)
-#define Exp_1 0x3ff00000
-#define Exp_11 0x3ff00000
-#define Ebits 11
-#define Frac_mask 0xfffff
-#define Frac_mask1 0xfffff
-#define Ten_pmax 22
-#define Bletch 0x10
-#define Bndry_mask 0xfffff
-#define Bndry_mask1 0xfffff
-#define LSB 1
-#define Sign_bit 0x80000000
-#define Log2P 1
-#define Tiny0 0
-#define Tiny1 1
-#define Quick_max 14
-#define Int_max 14
-#define Infinite(x) (word0(x) == 0x7ff00000) /* sufficient test for here */
-#else
-#undef Sudden_Underflow
-#define Sudden_Underflow
-#ifdef IBM
-#define Exp_shift 24
-#define Exp_shift1 24
-#define Exp_msk1 0x1000000
-#define Exp_msk11 0x1000000
-#define Exp_mask 0x7f000000
-#define P 14
-#define Bias 65
-#define Exp_1 0x41000000
-#define Exp_11 0x41000000
-#define Ebits 8 /* exponent has 7 bits, but 8 is the right value in b2d */
-#define Frac_mask 0xffffff
-#define Frac_mask1 0xffffff
-#define Bletch 4
-#define Ten_pmax 22
-#define Bndry_mask 0xefffff
-#define Bndry_mask1 0xffffff
-#define LSB 1
-#define Sign_bit 0x80000000
-#define Log2P 4
-#define Tiny0 0x100000
-#define Tiny1 0
-#define Quick_max 14
-#define Int_max 15
-#else /* VAX */
-#define Exp_shift 23
-#define Exp_shift1 7
-#define Exp_msk1 0x80
-#define Exp_msk11 0x800000
-#define Exp_mask 0x7f80
-#define P 56
-#define Bias 129
-#define Exp_1 0x40800000
-#define Exp_11 0x4080
-#define Ebits 8
-#define Frac_mask 0x7fffff
-#define Frac_mask1 0xffff007f
-#define Ten_pmax 24
-#define Bletch 2
-#define Bndry_mask 0xffff007f
-#define Bndry_mask1 0xffff007f
-#define LSB 0x10000
-#define Sign_bit 0x8000
-#define Log2P 1
-#define Tiny0 0x80
-#define Tiny1 0
-#define Quick_max 15
-#define Int_max 15
-#endif
-#endif
-
-#ifndef IEEE_Arith
-#define ROUND_BIASED
-#endif
-
-#ifdef RND_PRODQUOT
-#define rounded_product(a,b) a = rnd_prod(a, b)
-#define rounded_quotient(a,b) a = rnd_quot(a, b)
-extern double rnd_prod(double, double), rnd_quot(double, double);
-#else
-#define rounded_product(a,b) a *= b
-#define rounded_quotient(a,b) a /= b
-#endif
-
-#define Big0 (Frac_mask1 | Exp_msk1*(DBL_MAX_EXP+Bias-1))
-#define Big1 0xffffffff
-
-#define Kmax 15
-
-/* (1<<BIGINT_MINIMUM_K) is the minimum number of words to allocate
- in a Bigint. dtoa usually manages with 1<<2, and has not been
- known to need more than 1<<3. */
-
-#define BIGINT_MINIMUM_K 3
-
-struct Bigint {
- struct Bigint *next;
- int k; /* Parameter given to Balloc(k) */
- int maxwds; /* Allocated space: equals 1<<k. */
- short on_stack; /* 1 if stack-allocated. */
- short sign; /* 0 if value is positive or zero; 1 if negative. */
- int wds; /* Current length. */
- unsigned32 x[1<<BIGINT_MINIMUM_K]; /* Actually: x[maxwds] */
-};
-
-#define BIGINT_HEADER_SIZE \
- (sizeof(Bigint) - (1<<BIGINT_MINIMUM_K) * sizeof(unsigned32))
-
-typedef struct Bigint Bigint;
-
-/* Initialize a stack-allocated Bigint. */
-
-static Bigint *
-Binit
-#ifdef KR_headers
- (v) Bigint *v;
-#else
- (Bigint *v)
-#endif
-{
- v->on_stack = 1;
- v->k = BIGINT_MINIMUM_K;
- v->maxwds = 1 << BIGINT_MINIMUM_K;
- v->sign = v->wds = 0;
- return v;
-}
-
-/* Allocate a Bigint with '1<<k' big digits. */
-
-static Bigint *
-Balloc
-#ifdef KR_headers
- (k) int k;
-#else
- (int k)
-#endif
-{
- int x;
- Bigint *rv;
-
- if (k < BIGINT_MINIMUM_K)
- k = BIGINT_MINIMUM_K;
-
- x = 1 << k;
- rv = (Bigint *)
- malloc(BIGINT_HEADER_SIZE + x * sizeof(unsigned32));
- rv->k = k;
- rv->maxwds = x;
- rv->sign = rv->wds = 0;
- rv->on_stack = 0;
- return rv;
-}
-
-static void
-Bfree
-#ifdef KR_headers
- (v) Bigint *v;
-#else
- (Bigint *v)
-#endif
-{
- if (v && !v->on_stack)
- free (v);
-}
-
-static void
-Bcopy
-#ifdef KR_headers
- (x, y) Bigint *x, *y;
-#else
- (Bigint *x, Bigint *y)
-#endif
-{
- register unsigned32 *xp, *yp;
- register int i = y->wds;
- x->sign = y->sign;
- x->wds = i;
- for (xp = x->x, yp = y->x; --i >= 0; )
- *xp++ = *yp++;
-}
-
-/* Make sure b has room for at least 1<<k big digits. */
-
-static Bigint *
-Brealloc
-#ifdef KR_headers
- (b, k) Bigint *b; int k;
-#else
- (Bigint * b, int k)
-#endif
-{
- if (b == NULL)
- return Balloc(k);
- if (b->k >= k)
- return b;
- else
- {
- Bigint *rv = Balloc (k);
- Bcopy(rv, b);
- Bfree(b);
- return rv;
- }
-}
-
-/* Return b*m+a. b is modified.
- Assumption: 0xFFFF*m+a fits in 32 bits. */
-
-static Bigint *
-multadd
-#ifdef KR_headers
- (b, m, a) Bigint *b; int m, a;
-#else
- (Bigint *b, int m, int a)
-#endif
-{
- int i, wds;
- unsigned32 *x, y;
- unsigned32 xi, z;
-
- wds = b->wds;
- x = b->x;
- i = 0;
- do {
- xi = *x;
- y = (xi & 0xffff) * m + a;
- z = (xi >> 16) * m + (y >> 16);
- a = (int)(z >> 16);
- *x++ = (z << 16) + (y & 0xffff);
- }
- while(++i < wds);
- if (a) {
- if (wds >= b->maxwds)
- b = Brealloc(b, b->k+1);
- b->x[wds++] = a;
- b->wds = wds;
- }
- return b;
- }
-
-static Bigint *
-s2b
-#ifdef KR_headers
- (result, s, nd0, nd, y9)
- Bigint *result; CONST char *s; int nd0, nd; unsigned32 y9;
-#else
- (Bigint *result, CONST char *s, int nd0, int nd, unsigned32 y9)
-#endif
-{
- int i, k;
- _G_int32_t x, y;
-
- x = (nd + 8) / 9;
- for(k = 0, y = 1; x > y; y <<= 1, k++) ;
- result = Brealloc(result, k);
- result->x[0] = y9;
- result->wds = 1;
-
- i = 9;
- if (9 < nd0)
- {
- s += 9;
- do
- result = multadd(result, 10, *s++ - '0');
- while (++i < nd0);
- s++;
- }
- else
- s += 10;
- for(; i < nd; i++)
- result = multadd(result, 10, *s++ - '0');
- return result;
-}
-
-static int
-hi0bits
-#ifdef KR_headers
- (x) register unsigned32 x;
-#else
- (register unsigned32 x)
-#endif
-{
- register int k = 0;
-
- if (!(x & 0xffff0000)) {
- k = 16;
- x <<= 16;
- }
- if (!(x & 0xff000000)) {
- k += 8;
- x <<= 8;
- }
- if (!(x & 0xf0000000)) {
- k += 4;
- x <<= 4;
- }
- if (!(x & 0xc0000000)) {
- k += 2;
- x <<= 2;
- }
- if (!(x & 0x80000000)) {
- k++;
- if (!(x & 0x40000000))
- return 32;
- }
- return k;
- }
-
-static int
-lo0bits
-#ifdef KR_headers
- (y) unsigned32 *y;
-#else
- (unsigned32 *y)
-#endif
-{
- register int k;
- register unsigned32 x = *y;
-
- if (x & 7) {
- if (x & 1)
- return 0;
- if (x & 2) {
- *y = x >> 1;
- return 1;
- }
- *y = x >> 2;
- return 2;
- }
- k = 0;
- if (!(x & 0xffff)) {
- k = 16;
- x >>= 16;
- }
- if (!(x & 0xff)) {
- k += 8;
- x >>= 8;
- }
- if (!(x & 0xf)) {
- k += 4;
- x >>= 4;
- }
- if (!(x & 0x3)) {
- k += 2;
- x >>= 2;
- }
- if (!(x & 1)) {
- k++;
- x >>= 1;
- if (!x & 1)
- return 32;
- }
- *y = x;
- return k;
- }
-
-static Bigint *
-i2b
-#ifdef KR_headers
- (result, i) Bigint *result; int i;
-#else
- (Bigint* result, int i)
-#endif
-{
- result = Brealloc(result, 1);
- result->x[0] = i;
- result->wds = 1;
- return result;
-}
-
-/* Do: c = a * b. */
-
-static Bigint *
-mult
-#ifdef KR_headers
- (c, a, b) Bigint *a, *b, *c;
-#else
- (Bigint *c, Bigint *a, Bigint *b)
-#endif
-{
- int k, wa, wb, wc;
- unsigned32 carry, y, z;
- unsigned32 *x, *xa, *xae, *xb, *xbe, *xc, *xc0;
- unsigned32 z2;
- if (a->wds < b->wds) {
- Bigint *tmp = a;
- a = b;
- b = tmp;
- }
- k = a->k;
- wa = a->wds;
- wb = b->wds;
- wc = wa + wb;
- if (wc > a->maxwds)
- k++;
- c = Brealloc(c, k);
- for(x = c->x, xa = x + wc; x < xa; x++)
- *x = 0;
- xa = a->x;
- xae = xa + wa;
- xb = b->x;
- xbe = xb + wb;
- xc0 = c->x;
- for(; xb < xbe; xb++, xc0++) {
- if ((y = *xb & 0xffff)) {
- x = xa;
- xc = xc0;
- carry = 0;
- do {
- z = (*x & 0xffff) * y + (*xc & 0xffff) + carry;
- carry = z >> 16;
- z2 = (*x++ >> 16) * y + (*xc >> 16) + carry;
- carry = z2 >> 16;
- Storeinc(xc, z2, z);
- }
- while(x < xae);
- *xc = carry;
- }
- if ((y = *xb >> 16)) {
- x = xa;
- xc = xc0;
- carry = 0;
- z2 = *xc;
- do {
- z = (*x & 0xffff) * y + (*xc >> 16) + carry;
- carry = z >> 16;
- Storeinc(xc, z, z2);
- z2 = (*x++ >> 16) * y + (*xc & 0xffff) + carry;
- carry = z2 >> 16;
- }
- while(x < xae);
- *xc = z2;
- }
- }
- for(xc0 = c->x, xc = xc0 + wc; wc > 0 && !*--xc; --wc) ;
- c->wds = wc;
- return c;
- }
-
-/* Returns b*(5**k). b is modified. */
-/* Re-written by Per Bothner to not need a static list. */
-
-static Bigint *
-pow5mult
-#ifdef KR_headers
- (b, k) Bigint *b; int k;
-#else
- (Bigint *b, int k)
-#endif
-{
- static int p05[6] = { 5, 25, 125, 625, 3125, 15625 };
-
- for (; k > 6; k -= 6)
- b = multadd(b, 15625, 0); /* b *= 5**6 */
- if (k == 0)
- return b;
- else
- return multadd(b, p05[k-1], 0);
-}
-
-/* Re-written by Per Bothner so shift can be in place. */
-
-static Bigint *
-lshift
-#ifdef KR_headers
- (b, k) Bigint *b; int k;
-#else
- (Bigint *b, int k)
-#endif
-{
- int i;
- unsigned32 *x, *x1, *xe;
- int old_wds = b->wds;
- int n = k >> 5;
- int k1 = b->k;
- int n1 = n + old_wds + 1;
-
- if (k == 0)
- return b;
-
- for(i = b->maxwds; n1 > i; i <<= 1)
- k1++;
- b = Brealloc(b, k1);
-
- xe = b->x; /* Source limit */
- x = xe + old_wds; /* Source pointer */
- x1 = x + n; /* Destination pointer */
- if (k &= 0x1f) {
- int k1 = 32 - k;
- unsigned32 z = *--x;
- if ((*x1 = (z >> k1)) != 0) {
- ++n1;
- }
- while (x > xe) {
- unsigned32 w = *--x;
- *--x1 = (z << k) | (w >> k1);
- z = w;
- }
- *--x1 = z << k;
- }
- else
- do {
- *--x1 = *--x;
- } while(x > xe);
- while (x1 > xe)
- *--x1 = 0;
- b->wds = n1 - 1;
- return b;
-}
-
-static int
-cmp
-#ifdef KR_headers
- (a, b) Bigint *a, *b;
-#else
- (Bigint *a, Bigint *b)
-#endif
-{
- unsigned32 *xa, *xa0, *xb, *xb0;
- int i, j;
-
- i = a->wds;
- j = b->wds;
-#ifdef DEBUG
- if (i > 1 && !a->x[i-1])
- Bug("cmp called with a->x[a->wds-1] == 0");
- if (j > 1 && !b->x[j-1])
- Bug("cmp called with b->x[b->wds-1] == 0");
-#endif
- if (i -= j)
- return i;
- xa0 = a->x;
- xa = xa0 + j;
- xb0 = b->x;
- xb = xb0 + j;
- for(;;) {
- if (*--xa != *--xb)
- return *xa < *xb ? -1 : 1;
- if (xa <= xa0)
- break;
- }
- return 0;
- }
-
-/* Do: c = a-b. */
-
-static Bigint *
-diff
-#ifdef KR_headers
- (c, a, b) Bigint *c, *a, *b;
-#else
- (Bigint *c, Bigint *a, Bigint *b)
-#endif
-{
- int i, wa, wb;
- _G_int32_t borrow, y; /* We need signed shifts here. */
- unsigned32 *xa, *xae, *xb, *xbe, *xc;
- _G_int32_t z;
-
- i = cmp(a,b);
- if (!i) {
- c = Brealloc(c, 0);
- c->wds = 1;
- c->x[0] = 0;
- return c;
- }
- if (i < 0) {
- Bigint *tmp = a;
- a = b;
- b = tmp;
- i = 1;
- }
- else
- i = 0;
- c = Brealloc(c, a->k);
- c->sign = i;
- wa = a->wds;
- xa = a->x;
- xae = xa + wa;
- wb = b->wds;
- xb = b->x;
- xbe = xb + wb;
- xc = c->x;
- borrow = 0;
- do {
- y = (*xa & 0xffff) - (*xb & 0xffff) + borrow;
- borrow = y >> 16;
- Sign_Extend(borrow, y);
- z = (*xa++ >> 16) - (*xb++ >> 16) + borrow;
- borrow = z >> 16;
- Sign_Extend(borrow, z);
- Storeinc(xc, z, y);
- }
- while(xb < xbe);
- while(xa < xae) {
- y = (*xa & 0xffff) + borrow;
- borrow = y >> 16;
- Sign_Extend(borrow, y);
- z = (*xa++ >> 16) + borrow;
- borrow = z >> 16;
- Sign_Extend(borrow, z);
- Storeinc(xc, z, y);
- }
- while(!*--xc)
- wa--;
- c->wds = wa;
- return c;
- }
-
-static double
-ulp
-#ifdef KR_headers
- (x) double x;
-#else
- (double x)
-#endif
-{
- register _G_int32_t L;
- double a;
-
- L = (word0(x) & Exp_mask) - (P-1)*Exp_msk1;
-#ifndef Sudden_Underflow
- if (L > 0) {
-#endif
-#ifdef IBM
- L |= Exp_msk1 >> 4;
-#endif
- setwords(a, L, 0);
-#ifndef Sudden_Underflow
- }
- else {
- L = -L >> Exp_shift;
- if (L < Exp_shift)
- setwords(a, 0x80000 >> L, 0);
- else {
- L -= Exp_shift;
- setwords(a, 0, L >= 31 ? 1 : 1 << (31 - L));
- }
- }
-#endif
- return a;
- }
-
-static double
-b2d
-#ifdef KR_headers
- (a, e) Bigint *a; int *e;
-#else
- (Bigint *a, int *e)
-#endif
-{
- unsigned32 *xa, *xa0, w, y, z;
- int k;
- double d;
- unsigned32 d0, d1;
-
- xa0 = a->x;
- xa = xa0 + a->wds;
- y = *--xa;
-#ifdef DEBUG
- if (!y) Bug("zero y in b2d");
-#endif
- k = hi0bits(y);
- *e = 32 - k;
- if (k < Ebits) {
- d0 = Exp_1 | y >> (Ebits - k);
- w = xa > xa0 ? *--xa : 0;
- d1 = y << ((32-Ebits) + k) | w >> (Ebits - k);
- goto ret_d;
- }
- z = xa > xa0 ? *--xa : 0;
- if (k -= Ebits) {
- d0 = Exp_1 | y << k | z >> (32 - k);
- y = xa > xa0 ? *--xa : 0;
- d1 = z << k | y >> (32 - k);
- }
- else {
- d0 = Exp_1 | y;
- d1 = z;
- }
- ret_d:
-#ifdef VAX
- setwords(d, d0 >> 16 | d0 << 16, d1 >> 16 | d1 << 16);
-#else
- setwords (d, d0, d1);
-#endif
- return d;
- }
-
-static Bigint *
-d2b
-#ifdef KR_headers
- (result, d, e, bits) Bigint *result; double d; int *e, *bits;
-#else
- (Bigint *result, double d, int *e, int *bits)
-#endif
-{
- int de, i, k;
- unsigned32 *x, y, z;
- unsigned32 d0, d1;
-#ifdef VAX
- d0 = word0(d) >> 16 | word0(d) << 16;
- d1 = word1(d) >> 16 | word1(d) << 16;
-#else
- d0 = word0(d);
- d1 = word1(d);
-#endif
-
- result = Brealloc(result, 1);
- x = result->x;
-
- z = d0 & Frac_mask;
- d0 &= 0x7fffffff; /* clear sign bit, which we ignore */
-
- de = (int)(d0 >> Exp_shift); /* The exponent part of d. */
-
- /* Put back the suppressed high-order bit, if normalized. */
-#ifndef IBM
-#ifndef Sudden_Underflow
- if (de)
-#endif
- z |= Exp_msk11;
-#endif
-
- if ((y = d1)) {
- if ((k = lo0bits(&y))) {
- x[0] = y | z << (32 - k);
- z >>= k;
- }
- else
- x[0] = y;
- i = result->wds = (x[1] = z) ? 2 : 1;
- }
- else {
-#ifdef DEBUG
- if (!z)
- Bug("Zero passed to d2b");
-#endif
- k = lo0bits(&z);
- x[0] = z;
- i = result->wds = 1;
- k += 32;
- }
-#ifndef Sudden_Underflow
- if (de) {
-#endif
-#ifdef IBM
- *e = (de - Bias - (P-1) << 2) + k;
- *bits = 4*P + 8 - k - hi0bits(word0(d) & Frac_mask);
-#else
- *e = de - Bias - (P-1) + k;
- *bits = P - k;
-#endif
-#ifndef Sudden_Underflow
- }
- else {
- *e = de - Bias - (P-1) + 1 + k;
- *bits = 32*i - hi0bits(x[i-1]);
- }
-#endif
- return result;
- }
-
-static double
-ratio
-#ifdef KR_headers
- (a, b) Bigint *a, *b;
-#else
- (Bigint *a, Bigint *b)
-#endif
-{
- double da, db;
- int k, ka, kb;
-
- da = b2d(a, &ka);
- db = b2d(b, &kb);
- k = ka - kb + 32*(a->wds - b->wds);
-#ifdef IBM
- if (k > 0) {
- addword0(da, (k >> 2)*Exp_msk1);
- if (k &= 3)
- da *= 1 << k;
- }
- else {
- k = -k;
- addword0(db,(k >> 2)*Exp_msk1);
- if (k &= 3)
- db *= 1 << k;
- }
-#else
- if (k > 0)
- addword0(da, k*Exp_msk1);
- else {
- k = -k;
- addword0(db, k*Exp_msk1);
- }
-#endif
- return da / db;
- }
-
-static CONST double
-tens[] = {
- 1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9,
- 1e10, 1e11, 1e12, 1e13, 1e14, 1e15, 1e16, 1e17, 1e18, 1e19,
- 1e20, 1e21, 1e22
-#ifdef VAX
- , 1e23, 1e24
-#endif
- };
-
-#ifdef IEEE_Arith
-static CONST double bigtens[] = { 1e16, 1e32, 1e64, 1e128, 1e256 };
-static CONST double tinytens[] = { 1e-16, 1e-32, 1e-64, 1e-128, 1e-256 };
-#define n_bigtens 5
-#else
-#ifdef IBM
-static CONST double bigtens[] = { 1e16, 1e32, 1e64 };
-static CONST double tinytens[] = { 1e-16, 1e-32, 1e-64 };
-#define n_bigtens 3
-#else
-static CONST double bigtens[] = { 1e16, 1e32 };
-static CONST double tinytens[] = { 1e-16, 1e-32 };
-#define n_bigtens 2
-#endif
-#endif
-
- double
-_IO_strtod
-#ifdef KR_headers
- (s00, se) CONST char *s00; char **se;
-#else
- (CONST char *s00, char **se)
-#endif
-{
- int bb2, bb5, bbe, bd2, bd5, bbbits, bs2, c, dsign,
- e, e1, esign, i, j, k, nd, nd0, nf, nz, nz0, sign;
- CONST char *s, *s0, *s1;
- double aadj, aadj1, adj, rv, rv0;
- _G_int32_t L;
- unsigned32 y, z;
- Bigint _bb, _b_avail, _bd, _bd0, _bs, _delta;
- Bigint *bb = Binit(&_bb);
- Bigint *bd = Binit(&_bd);
- Bigint *bd0 = Binit(&_bd0);
- Bigint *bs = Binit(&_bs);
- Bigint *b_avail = Binit(&_b_avail);
- Bigint *delta = Binit(&_delta);
-
- TEST_ENDIANNESS;
- sign = nz0 = nz = 0;
- rv = 0.;
- (void)&rv; /* Force rv into the stack */
- for(s = s00;;s++) switch(*s) {
- case '-':
- sign = 1;
- /* no break */
- case '+':
- if (*++s)
- goto break2;
- /* no break */
- case 0:
- /* "+" and "-" should be reported as an error? */
- sign = 0;
- s = s00;
- goto ret;
- case '\t':
- case '\n':
- case '\v':
- case '\f':
- case '\r':
- case ' ':
- continue;
- default:
- goto break2;
- }
- break2:
- if (*s == '0') {
- nz0 = 1;
- while(*++s == '0') ;
- if (!*s)
- goto ret;
- }
- s0 = s;
- y = z = 0;
- for(nd = nf = 0; (c = *s) >= '0' && c <= '9'; nd++, s++)
- if (nd < 9)
- y = 10*y + c - '0';
- else if (nd < 16)
- z = 10*z + c - '0';
- nd0 = nd;
- if (c == '.') {
- c = *++s;
- if (!nd) {
- for(; c == '0'; c = *++s)
- nz++;
- if (c > '0' && c <= '9') {
- s0 = s;
- nf += nz;
- nz = 0;
- goto have_dig;
- }
- goto dig_done;
- }
- for(; c >= '0' && c <= '9'; c = *++s) {
- have_dig:
- nz++;
- if (c -= '0') {
- nf += nz;
- for(i = 1; i < nz; i++)
- if (nd++ < 9)
- y *= 10;
- else if (nd <= DBL_DIG + 1)
- z *= 10;
- if (nd++ < 9)
- y = 10*y + c;
- else if (nd <= DBL_DIG + 1)
- z = 10*z + c;
- nz = 0;
- }
- }
- }
- dig_done:
- e = 0;
- if (c == 'e' || c == 'E') {
- if (!nd && !nz && !nz0) {
- s = s00;
- goto ret;
- }
- s00 = s;
- esign = 0;
- switch(c = *++s) {
- case '-':
- esign = 1;
- case '+':
- c = *++s;
- }
- if (c >= '0' && c <= '9') {
- while(c == '0')
- c = *++s;
- if (c > '0' && c <= '9') {
- e = c - '0';
- s1 = s;
- while((c = *++s) >= '0' && c <= '9')
- e = 10*e + c - '0';
- if (s - s1 > 8)
- /* Avoid confusion from exponents
- * so large that e might overflow.
- */
- e = 9999999;
- if (esign)
- e = -e;
- }
- else
- e = 0;
- }
- else
- s = s00;
- }
- if (!nd) {
- if (!nz && !nz0)
- s = s00;
- goto ret;
- }
- e1 = e -= nf;
-
- /* Now we have nd0 digits, starting at s0, followed by a
- * decimal point, followed by nd-nd0 digits. The number we're
- * after is the integer represented by those digits times
- * 10**e */
-
- if (!nd0)
- nd0 = nd;
- k = nd < DBL_DIG + 1 ? nd : DBL_DIG + 1;
- rv = y;
- if (k > 9)
- rv = tens[k - 9] * rv + z;
- if (nd <= DBL_DIG
-#ifndef RND_PRODQUOT
- && FLT_ROUNDS == 1
-#endif
- ) {
- if (!e)
- goto ret;
- if (e > 0) {
- if (e <= Ten_pmax) {
-#ifdef VAX
- goto vax_ovfl_check;
-#else
- /* rv = */ rounded_product(rv, tens[e]);
- goto ret;
-#endif
- }
- i = DBL_DIG - nd;
- if (e <= Ten_pmax + i) {
- /* A fancier test would sometimes let us do
- * this for larger i values.
- */
- e -= i;
- rv *= tens[i];
-#ifdef VAX
- /* VAX exponent range is so narrow we must
- * worry about overflow here...
- */
- vax_ovfl_check:
- addword0(rv, - P*Exp_msk1);
- /* rv = */ rounded_product(rv, tens[e]);
- if ((word0(rv) & Exp_mask)
- > Exp_msk1*(DBL_MAX_EXP+Bias-1-P))
- goto ovfl;
- addword0(rv, P*Exp_msk1);
-#else
- /* rv = */ rounded_product(rv, tens[e]);
-#endif
- goto ret;
- }
- }
-#ifndef Inaccurate_Divide
- else if (e >= -Ten_pmax) {
- /* rv = */ rounded_quotient(rv, tens[-e]);
- goto ret;
- }
-#endif
- }
- e1 += nd - k;
-
- /* Get starting approximation = rv * 10**e1 */
-
- if (e1 > 0) {
- if ((i = e1 & 15))
- rv *= tens[i];
- if (e1 &= ~15) {
- if (e1 > DBL_MAX_10_EXP) {
- ovfl:
- errno = ERANGE;
-#if defined(sun) && !defined(__svr4__)
-/* SunOS defines HUGE_VAL as __infinity(), which is in libm. */
-#undef HUGE_VAL
-#endif
-#ifndef HUGE_VAL
-#define HUGE_VAL 1.7976931348623157E+308
-#endif
- rv = HUGE_VAL;
- goto ret;
- }
- if (e1 >>= 4) {
- for(j = 0; e1 > 1; j++, e1 >>= 1)
- if (e1 & 1)
- rv *= bigtens[j];
- /* The last multiplication could overflow. */
- addword0(rv, -P*Exp_msk1);
- rv *= bigtens[j];
- if ((z = word0(rv) & Exp_mask)
- > Exp_msk1*(DBL_MAX_EXP+Bias-P))
- goto ovfl;
- if (z > Exp_msk1*(DBL_MAX_EXP+Bias-1-P)) {
- /* set to largest number */
- /* (Can't trust DBL_MAX) */
- setwords(rv, Big0, Big1);
- }
- else
- addword0(rv, P*Exp_msk1);
- }
-
- }
- }
- else if (e1 < 0) {
- e1 = -e1;
- if ((i = e1 & 15))
- rv /= tens[i];
- if (e1 &= ~15) {
- e1 >>= 4;
- for(j = 0; e1 > 1; j++, e1 >>= 1)
- if (e1 & 1)
- rv *= tinytens[j];
- /* The last multiplication could underflow. */
- rv0 = rv;
- rv *= tinytens[j];
- if (!rv) {
- rv = 2.*rv0;
- rv *= tinytens[j];
- if (!rv) {
- undfl:
- rv = 0.;
- errno = ERANGE;
- goto ret;
- }
- setwords(rv, Tiny0, Tiny1);
- /* The refinement below will clean
- * this approximation up.
- */
- }
- }
- }
-
- /* Now the hard part -- adjusting rv to the correct value.*/
-
- /* Put digits into bd: true value = bd * 10^e */
-
- bd0 = s2b(bd0, s0, nd0, nd, y);
- bd = Brealloc(bd, bd0->k);
-
- for(;;) {
- Bcopy(bd, bd0);
- bb = d2b(bb, rv, &bbe, &bbbits); /* rv = bb * 2^bbe */
- bs = i2b(bs, 1);
-
- if (e >= 0) {
- bb2 = bb5 = 0;
- bd2 = bd5 = e;
- }
- else {
- bb2 = bb5 = -e;
- bd2 = bd5 = 0;
- }
- if (bbe >= 0)
- bb2 += bbe;
- else
- bd2 -= bbe;
- bs2 = bb2;
-#ifdef Sudden_Underflow
-#ifdef IBM
- j = 1 + 4*P - 3 - bbbits + ((bbe + bbbits - 1) & 3);
-#else
- j = P + 1 - bbbits;
-#endif
-#else
- i = bbe + bbbits - 1; /* logb(rv) */
- if (i < Emin) /* denormal */
- j = bbe + (P-Emin);
- else
- j = P + 1 - bbbits;
-#endif
- bb2 += j;
- bd2 += j;
- i = bb2 < bd2 ? bb2 : bd2;
- if (i > bs2)
- i = bs2;
- if (i > 0) {
- bb2 -= i;
- bd2 -= i;
- bs2 -= i;
- }
- if (bb5 > 0) {
- Bigint *b_tmp;
- bs = pow5mult(bs, bb5);
- b_tmp = mult(b_avail, bs, bb);
- b_avail = bb;
- bb = b_tmp;
- }
- if (bb2 > 0)
- bb = lshift(bb, bb2);
- if (bd5 > 0)
- bd = pow5mult(bd, bd5);
- if (bd2 > 0)
- bd = lshift(bd, bd2);
- if (bs2 > 0)
- bs = lshift(bs, bs2);
- delta = diff(delta, bb, bd);
- dsign = delta->sign;
- delta->sign = 0;
- i = cmp(delta, bs);
- if (i < 0) {
- /* Error is less than half an ulp -- check for
- * special case of mantissa a power of two.
- */
- if (dsign || word1(rv) || word0(rv) & Bndry_mask)
- break;
- delta = lshift(delta,Log2P);
- if (cmp(delta, bs) > 0)
- goto drop_down;
- break;
- }
- if (i == 0) {
- /* exactly half-way between */
- if (dsign) {
- if ((word0(rv) & Bndry_mask1) == Bndry_mask1
- && word1(rv) == 0xffffffff) {
- /*boundary case -- increment exponent*/
- setword0(rv, (word0(rv) & Exp_mask)
- + Exp_msk1);
-#ifdef IBM
- setword0 (rv,
- word0(rv) | (Exp_msk1 >> 4));
-#endif
- setword1(rv, 0);
- break;
- }
- }
- else if (!(word0(rv) & Bndry_mask) && !word1(rv)) {
- drop_down:
- /* boundary case -- decrement exponent */
-#ifdef Sudden_Underflow
- L = word0(rv) & Exp_mask;
-#ifdef IBM
- if (L < Exp_msk1)
-#else
- if (L <= Exp_msk1)
-#endif
- goto undfl;
- L -= Exp_msk1;
-#else
- L = (word0(rv) & Exp_mask) - Exp_msk1;
-#endif
- setwords(rv, L | Bndry_mask1, 0xffffffff);
-#ifdef IBM
- continue;
-#else
- break;
-#endif
- }
-#ifndef ROUND_BIASED
- if (!(word1(rv) & LSB))
- break;
-#endif
- if (dsign)
- rv += ulp(rv);
-#ifndef ROUND_BIASED
- else {
- rv -= ulp(rv);
-#ifndef Sudden_Underflow
- if (!rv)
- goto undfl;
-#endif
- }
-#endif
- break;
- }
- if ((aadj = ratio(delta, bs)) <= 2.) {
- if (dsign)
- aadj = aadj1 = 1.;
- else if (word1(rv) || word0(rv) & Bndry_mask) {
-#ifndef Sudden_Underflow
- if (word1(rv) == Tiny1 && !word0(rv))
- goto undfl;
-#endif
- aadj = 1.;
- aadj1 = -1.;
- }
- else {
- /* special case -- power of FLT_RADIX to be */
- /* rounded down... */
-
- if (aadj < 2./FLT_RADIX)
- aadj = 1./FLT_RADIX;
- else
- aadj *= 0.5;
- aadj1 = -aadj;
- }
- }
- else {
- aadj *= 0.5;
- aadj1 = dsign ? aadj : -aadj;
-#ifdef Check_FLT_ROUNDS
- switch(FLT_ROUNDS) {
- case 2: /* towards +infinity */
- aadj1 -= 0.5;
- break;
- case 0: /* towards 0 */
- case 3: /* towards -infinity */
- aadj1 += 0.5;
- }
-#else
- if (FLT_ROUNDS == 0)
- aadj1 += 0.5;
-#endif
- }
- y = word0(rv) & Exp_mask;
-
- /* Check for overflow */
-
- if (y == Exp_msk1*(DBL_MAX_EXP+Bias-1)) {
- rv0 = rv;
- addword0(rv, - P*Exp_msk1);
- adj = aadj1 * ulp(rv);
- rv += adj;
- if ((word0(rv) & Exp_mask) >=
- Exp_msk1*(DBL_MAX_EXP+Bias-P)) {
- if (word0(rv0) == Big0 && word1(rv0) == Big1)
- goto ovfl;
- setwords(rv, Big0, Big1);
- continue;
- }
- else
- addword0(rv, P*Exp_msk1);
- }
- else {
-#ifdef Sudden_Underflow
- if ((word0(rv) & Exp_mask) <= P*Exp_msk1) {
- rv0 = rv;
- addword0(rv, P*Exp_msk1);
- adj = aadj1 * ulp(rv);
- rv += adj;
-#ifdef IBM
- if ((word0(rv) & Exp_mask) < P*Exp_msk1)
-#else
- if ((word0(rv) & Exp_mask) <= P*Exp_msk1)
-#endif
- {
- if (word0(rv0) == Tiny0
- && word1(rv0) == Tiny1)
- goto undfl;
- setwords(rv, Tiny0, Tiny1);
- continue;
- }
- else
- addword0(rv, -P*Exp_msk1);
- }
- else {
- adj = aadj1 * ulp(rv);
- rv += adj;
- }
-#else
- /* Compute adj so that the IEEE rounding rules will
- * correctly round rv + adj in some half-way cases.
- * If rv * ulp(rv) is denormalized (i.e.,
- * y <= (P-1)*Exp_msk1), we must adjust aadj to avoid
- * trouble from bits lost to denormalization;
- * example: 1.2e-307 .
- */
- if (y <= (P-1)*Exp_msk1 && aadj >= 1.) {
- aadj1 = (double)(int)(aadj + 0.5);
- if (!dsign)
- aadj1 = -aadj1;
- }
- adj = aadj1 * ulp(rv);
- rv += adj;
-#endif
- }
- z = word0(rv) & Exp_mask;
- if (y == z) {
- /* Can we stop now? */
- L = (_G_int32_t)aadj;
- aadj -= L;
- /* The tolerances below are conservative. */
- if (dsign || word1(rv) || word0(rv) & Bndry_mask) {
- if (aadj < .4999999 || aadj > .5000001)
- break;
- }
- else if (aadj < .4999999/FLT_RADIX)
- break;
- }
- }
- Bfree(bb);
- Bfree(bd);
- Bfree(bs);
- Bfree(bd0);
- Bfree(delta);
- Bfree(b_avail);
- ret:
- if (se)
- *se = (char *)s;
- return sign ? -rv : rv;
- }
-
-static int
-quorem
-#ifdef KR_headers
- (b, S) Bigint *b, *S;
-#else
- (Bigint *b, Bigint *S)
-#endif
-{
- int n;
- _G_int32_t borrow, y;
- unsigned32 carry, q, ys;
- unsigned32 *bx, *bxe, *sx, *sxe;
- _G_int32_t z;
- unsigned32 si, zs;
-
- n = S->wds;
-#ifdef DEBUG
- /*debug*/ if (b->wds > n)
- /*debug*/ Bug("oversize b in quorem");
-#endif
- if (b->wds < n)
- return 0;
- sx = S->x;
- sxe = sx + --n;
- bx = b->x;
- bxe = bx + n;
- q = *bxe / (*sxe + 1); /* ensure q <= true quotient */
-#ifdef DEBUG
- /*debug*/ if (q > 9)
- /*debug*/ Bug("oversized quotient in quorem");
-#endif
- if (q) {
- borrow = 0;
- carry = 0;
- do {
- si = *sx++;
- ys = (si & 0xffff) * q + carry;
- zs = (si >> 16) * q + (ys >> 16);
- carry = zs >> 16;
- y = (*bx & 0xffff) - (ys & 0xffff) + borrow;
- borrow = y >> 16;
- Sign_Extend(borrow, y);
- z = (*bx >> 16) - (zs & 0xffff) + borrow;
- borrow = z >> 16;
- Sign_Extend(borrow, z);
- Storeinc(bx, z, y);
- }
- while(sx <= sxe);
- if (!*bxe) {
- bx = b->x;
- while(--bxe > bx && !*bxe)
- --n;
- b->wds = n;
- }
- }
- if (cmp(b, S) >= 0) {
- q++;
- borrow = 0;
- carry = 0;
- bx = b->x;
- sx = S->x;
- do {
- si = *sx++;
- ys = (si & 0xffff) + carry;
- zs = (si >> 16) + (ys >> 16);
- carry = zs >> 16;
- y = (*bx & 0xffff) - (ys & 0xffff) + borrow;
- borrow = y >> 16;
- Sign_Extend(borrow, y);
- z = (*bx >> 16) - (zs & 0xffff) + borrow;
- borrow = z >> 16;
- Sign_Extend(borrow, z);
- Storeinc(bx, z, y);
- }
- while(sx <= sxe);
- bx = b->x;
- bxe = bx + n;
- if (!*bxe) {
- while(--bxe > bx && !*bxe)
- --n;
- b->wds = n;
- }
- }
- return q;
- }
-
-/* dtoa for IEEE arithmetic (dmg): convert double to ASCII string.
- *
- * Inspired by "How to Print Floating-Point Numbers Accurately" by
- * Guy L. Steele, Jr. and Jon L. White [Proc. ACM SIGPLAN '90, pp. 92-101].
- *
- * Modifications:
- * 1. Rather than iterating, we use a simple numeric overestimate
- * to determine k = floor(log10(d)). We scale relevant
- * quantities using O(log2(k)) rather than O(k) multiplications.
- * 2. For some modes > 2 (corresponding to ecvt and fcvt), we don't
- * try to generate digits strictly left to right. Instead, we
- * compute with fewer bits and propagate the carry if necessary
- * when rounding the final digit up. This is often faster.
- * 3. Under the assumption that input will be rounded nearest,
- * mode 0 renders 1e23 as 1e23 rather than 9.999999999999999e22.
- * That is, we allow equality in stopping tests when the
- * round-nearest rule will give the same floating-point value
- * as would satisfaction of the stopping test with strict
- * inequality.
- * 4. We remove common factors of powers of 2 from relevant
- * quantities.
- * 5. When converting floating-point integers less than 1e16,
- * we use floating-point arithmetic rather than resorting
- * to multiple-precision integers.
- * 6. When asked to produce fewer than 15 digits, we first try
- * to get by with floating-point arithmetic; we resort to
- * multiple-precision integer arithmetic only if we cannot
- * guarantee that the floating-point calculation has given
- * the correctly rounded result. For k requested digits and
- * "uniformly" distributed input, the probability is
- * something like 10^(k-15) that we must resort to the long
- * calculation.
- */
-
- char *
-_IO_dtoa
-#ifdef KR_headers
- (d, mode, ndigits, decpt, sign, rve)
- double d; int mode, ndigits, *decpt, *sign; char **rve;
-#else
- (double d, int mode, int ndigits, int *decpt, int *sign, char **rve)
-#endif
-{
- /* Arguments ndigits, decpt, sign are similar to those
- of ecvt and fcvt; trailing zeros are suppressed from
- the returned string. If not null, *rve is set to point
- to the end of the return value. If d is +-Infinity or NaN,
- then *decpt is set to 9999.
-
- mode:
- 0 ==> shortest string that yields d when read in
- and rounded to nearest.
- 1 ==> like 0, but with Steele & White stopping rule;
- e.g. with IEEE P754 arithmetic , mode 0 gives
- 1e23 whereas mode 1 gives 9.999999999999999e22.
- 2 ==> max(1,ndigits) significant digits. This gives a
- return value similar to that of ecvt, except
- that trailing zeros are suppressed.
- 3 ==> through ndigits past the decimal point. This
- gives a return value similar to that from fcvt,
- except that trailing zeros are suppressed, and
- ndigits can be negative.
- 4-9 should give the same return values as 2-3, i.e.,
- 4 <= mode <= 9 ==> same return as mode
- 2 + (mode & 1). These modes are mainly for
- debugging; often they run slower but sometimes
- faster than modes 2-3.
- 4,5,8,9 ==> left-to-right digit generation.
- 6-9 ==> don't try fast floating-point estimate
- (if applicable).
-
- Values of mode other than 0-9 are treated as mode 0.
-
- Sufficient space is allocated to the return value
- to hold the suppressed trailing zeros.
- */
-
- int bbits, b2, b5, be, dig, i, ieps, ilim, ilim0, ilim1,
- j, j1, k, k0, k_check, leftright, m2, m5, s2, s5,
- spec_case, try_quick;
- _G_int32_t L;
-#ifndef Sudden_Underflow
- int denorm;
-#endif
- Bigint _b_avail, _b, _mhi, _mlo, _S;
- Bigint *b_avail = Binit(&_b_avail);
- Bigint *b = Binit(&_b);
- Bigint *S = Binit(&_S);
- /* mhi and mlo are only set and used if leftright. */
- Bigint *mhi = NULL, *mlo = NULL;
- double d2, ds, eps;
- char *s, *s0;
- static Bigint *result = NULL;
- static int result_k;
-
- TEST_ENDIANNESS;
- if (result) {
- /* result is contains a string, so its fields (interpreted
- as a Bigint have been trashed. Restore them.
- This is a really ugly interface - result should
- not be static, since that is not thread-safe. FIXME. */
- result->k = result_k;
- result->maxwds = 1 << result_k;
- result->on_stack = 0;
- }
-
- if (word0(d) & Sign_bit) {
- /* set sign for everything, including 0's and NaNs */
- *sign = 1;
- setword0(d, word0(d) & ~Sign_bit); /* clear sign bit */
- }
- else
- *sign = 0;
-
-#if defined(IEEE_Arith) + defined(VAX)
-#ifdef IEEE_Arith
- if ((word0(d) & Exp_mask) == Exp_mask)
-#else
- if (word0(d) == 0x8000)
-#endif
- {
- /* Infinity or NaN */
- *decpt = 9999;
-#ifdef IEEE_Arith
- if (!word1(d) && !(word0(d) & 0xfffff))
- {
- s = "Infinity";
- if (rve)
- *rve = s + 8;
- }
- else
-#endif
- {
- s = "NaN";
- if (rve)
- *rve = s +3;
- }
- return s;
- }
-#endif
-#ifdef IBM
- d += 0; /* normalize */
-#endif
- if (!d) {
- *decpt = 1;
- s = "0";
- if (rve)
- *rve = s + 1;
- return s;
- }
-
- b = d2b(b, d, &be, &bbits);
- i = (int)(word0(d) >> Exp_shift1 & (Exp_mask>>Exp_shift1));
-#ifndef Sudden_Underflow
- if (i) {
-#endif
- d2 = d;
- setword0(d2, (word0(d2) & Frac_mask1) | Exp_11);
-#ifdef IBM
- if (j = 11 - hi0bits(word0(d2) & Frac_mask))
- d2 /= 1 << j;
-#endif
-
- i -= Bias;
-#ifdef IBM
- i <<= 2;
- i += j;
-#endif
-#ifndef Sudden_Underflow
- denorm = 0;
- }
- else {
- /* d is denormalized */
- unsigned32 x;
-
- i = bbits + be + (Bias + (P-1) - 1);
- x = i > 32 ? word0(d) << (64 - i) | word1(d) >> (i - 32)
- : word1(d) << (32 - i);
- d2 = x;
- addword0(d2, - 31*Exp_msk1); /* adjust exponent */
- i -= (Bias + (P-1) - 1) + 1;
- denorm = 1;
- }
-#endif
-
- /* Now i is the unbiased base-2 exponent. */
-
- /* log(x) ~=~ log(1.5) + (x-1.5)/1.5
- * log10(x) = log(x) / log(10)
- * ~=~ log(1.5)/log(10) + (x-1.5)/(1.5*log(10))
- * log10(d) = i*log(2)/log(10) + log10(d2)
- *
- * This suggests computing an approximation k to log10(d) by
- *
- * k = i*0.301029995663981
- * + ( (d2-1.5)*0.289529654602168 + 0.176091259055681 );
- *
- * We want k to be too large rather than too small.
- * The error in the first-order Taylor series approximation
- * is in our favor, so we just round up the constant enough
- * to compensate for any error in the multiplication of
- * (i) by 0.301029995663981; since |i| <= 1077,
- * and 1077 * 0.30103 * 2^-52 ~=~ 7.2e-14,
- * adding 1e-13 to the constant term more than suffices.
- * Hence we adjust the constant term to 0.1760912590558.
- * (We could get a more accurate k by invoking log10,
- * but this is probably not worthwhile.)
- */
-
- ds = (d2-1.5)*0.289529654602168 + 0.1760912590558 + i*0.301029995663981;
- k = (int)ds;
- if (ds < 0. && ds != k)
- k--; /* want k = floor(ds) */
- k_check = 1;
- if (k >= 0 && k <= Ten_pmax) {
- if (d < tens[k])
- k--;
- k_check = 0;
- }
- j = bbits - i - 1;
- if (j >= 0) {
- b2 = 0;
- s2 = j;
- }
- else {
- b2 = -j;
- s2 = 0;
- }
- if (k >= 0) {
- b5 = 0;
- s5 = k;
- s2 += k;
- }
- else {
- b2 -= k;
- b5 = -k;
- s5 = 0;
- }
- if (mode < 0 || mode > 9)
- mode = 0;
- try_quick = 1;
- if (mode > 5) {
- mode -= 4;
- try_quick = 0;
- }
- leftright = 1;
- switch(mode) {
- case 0:
- case 1:
- ilim = ilim1 = -1;
- i = 18;
- ndigits = 0;
- break;
- case 2:
- leftright = 0;
- /* no break */
- case 4:
- if (ndigits <= 0)
- ndigits = 1;
- ilim = ilim1 = i = ndigits;
- break;
- case 3:
- leftright = 0;
- /* no break */
- case 5:
- i = ndigits + k + 1;
- ilim = i;
- ilim1 = i - 1;
- if (i <= 0)
- i = 1;
- }
- /* i is now an upper bound of the number of digits to generate. */
- j = sizeof(unsigned32) * (1<<BIGINT_MINIMUM_K);
- /* The test is <= so as to allow room for the final '\0'. */
- for(result_k = BIGINT_MINIMUM_K; BIGINT_HEADER_SIZE + j <= i;
- j <<= 1) result_k++;
- if (!result || result_k > result->k)
- {
- Bfree (result);
- result = Balloc(result_k);
- }
- s = s0 = (char *)result;
-
- if (ilim >= 0 && ilim <= Quick_max && try_quick) {
-
- /* Try to get by with floating-point arithmetic. */
-
- i = 0;
- d2 = d;
- k0 = k;
- ilim0 = ilim;
- ieps = 2; /* conservative */
- if (k > 0) {
- ds = tens[k&0xf];
- j = k >> 4;
- if (j & Bletch) {
- /* prevent overflows */
- j &= Bletch - 1;
- d /= bigtens[n_bigtens-1];
- ieps++;
- }
- for(; j; j >>= 1, i++)
- if (j & 1) {
- ieps++;
- ds *= bigtens[i];
- }
- d /= ds;
- }
- else if ((j1 = -k)) {
- d *= tens[j1 & 0xf];
- for(j = j1 >> 4; j; j >>= 1, i++)
- if (j & 1) {
- ieps++;
- d *= bigtens[i];
- }
- }
- if (k_check && d < 1. && ilim > 0) {
- if (ilim1 <= 0)
- goto fast_failed;
- ilim = ilim1;
- k--;
- d *= 10.;
- ieps++;
- }
- eps = ieps*d + 7.;
- addword0(eps, - (P-1)*Exp_msk1);
- if (ilim == 0) {
- d -= 5.;
- if (d > eps)
- goto one_digit;
- if (d < -eps)
- goto no_digits;
- goto fast_failed;
- }
-#ifndef No_leftright
- if (leftright) {
- /* Use Steele & White method of only
- * generating digits needed.
- */
- eps = 0.5/tens[ilim-1] - eps;
- for(i = 0;;) {
- L = (_G_int32_t)d;
- d -= L;
- *s++ = '0' + (int)L;
- if (d < eps)
- goto ret1;
- if (1. - d < eps)
- goto bump_up;
- if (++i >= ilim)
- break;
- eps *= 10.;
- d *= 10.;
- }
- }
- else {
-#endif
- /* Generate ilim digits, then fix them up. */
- eps *= tens[ilim-1];
- for(i = 1;; i++, d *= 10.) {
- L = (_G_int32_t)d;
- d -= L;
- *s++ = '0' + (int)L;
- if (i == ilim) {
- if (d > 0.5 + eps)
- goto bump_up;
- else if (d < 0.5 - eps) {
- while(*--s == '0');
- s++;
- goto ret1;
- }
- break;
- }
- }
-#ifndef No_leftright
- }
-#endif
- fast_failed:
- s = s0;
- d = d2;
- k = k0;
- ilim = ilim0;
- }
-
- /* Do we have a "small" integer? */
-
- if (be >= 0 && k <= Int_max) {
- /* Yes. */
- ds = tens[k];
- if (ndigits < 0 && ilim <= 0) {
- if (ilim < 0 || d <= 5*ds)
- goto no_digits;
- goto one_digit;
- }
- for(i = 1;; i++) {
- L = (_G_int32_t)(d / ds);
- d -= L*ds;
-#ifdef Check_FLT_ROUNDS
- /* If FLT_ROUNDS == 2, L will usually be high by 1 */
- if (d < 0) {
- L--;
- d += ds;
- }
-#endif
- *s++ = '0' + (int)L;
- if (i == ilim) {
- d += d;
- if (d > ds || (d == ds && L & 1)) {
- bump_up:
- while(*--s == '9')
- if (s == s0) {
- k++;
- *s = '0';
- break;
- }
- ++*s++;
- }
- break;
- }
- if (!(d *= 10.))
- break;
- }
- goto ret1;
- }
-
- m2 = b2;
- m5 = b5;
- if (leftright) {
- if (mode < 2) {
- i =
-#ifndef Sudden_Underflow
- denorm ? be + (Bias + (P-1) - 1 + 1) :
-#endif
-#ifdef IBM
- 1 + 4*P - 3 - bbits + ((bbits + be - 1) & 3);
-#else
- 1 + P - bbits;
-#endif
- }
- else {
- j = ilim - 1;
- if (m5 >= j)
- m5 -= j;
- else {
- s5 += j -= m5;
- b5 += j;
- m5 = 0;
- }
- if ((i = ilim) < 0) {
- m2 -= i;
- i = 0;
- }
- }
- b2 += i;
- s2 += i;
- mhi = i2b(Binit(&_mhi), 1);
- }
- if (m2 > 0 && s2 > 0) {
- i = m2 < s2 ? m2 : s2;
- b2 -= i;
- m2 -= i;
- s2 -= i;
- }
- if (b5 > 0) {
- if (leftright) {
- if (m5 > 0) {
- Bigint *b_tmp;
- mhi = pow5mult(mhi, m5);
- b_tmp = mult(b_avail, mhi, b);
- b_avail = b;
- b = b_tmp;
- }
- if ((j = b5 - m5))
- b = pow5mult(b, j);
- }
- else
- b = pow5mult(b, b5);
- }
- S = i2b(S, 1);
- if (s5 > 0)
- S = pow5mult(S, s5);
-
- /* Check for special case that d is a normalized power of 2. */
-
- if (mode < 2) {
- if (!word1(d) && !(word0(d) & Bndry_mask)
-#ifndef Sudden_Underflow
- && word0(d) & Exp_mask
-#endif
- ) {
- /* The special case */
- b2 += Log2P;
- s2 += Log2P;
- spec_case = 1;
- }
- else
- spec_case = 0;
- }
-
- /* Arrange for convenient computation of quotients:
- * shift left if necessary so divisor has 4 leading 0 bits.
- *
- * Perhaps we should just compute leading 28 bits of S once
- * and for all and pass them and a shift to quorem, so it
- * can do shifts and ors to compute the numerator for q.
- */
- if ((i = ((s5 ? 32 - hi0bits(S->x[S->wds-1]) : 1) + s2) & 0x1f))
- i = 32 - i;
- if (i > 4) {
- i -= 4;
- b2 += i;
- m2 += i;
- s2 += i;
- }
- else if (i < 4) {
- i += 28;
- b2 += i;
- m2 += i;
- s2 += i;
- }
- if (b2 > 0)
- b = lshift(b, b2);
- if (s2 > 0)
- S = lshift(S, s2);
- if (k_check) {
- if (cmp(b,S) < 0) {
- k--;
- b = multadd(b, 10, 0); /* we botched the k estimate */
- if (leftright)
- mhi = multadd(mhi, 10, 0);
- ilim = ilim1;
- }
- }
- if (ilim <= 0 && mode > 2) {
- if (ilim < 0 || cmp(b,S = multadd(S,5,0)) <= 0) {
- /* no digits, fcvt style */
- no_digits:
- k = -1 - ndigits;
- goto ret;
- }
- one_digit:
- *s++ = '1';
- k++;
- goto ret;
- }
- if (leftright) {
- if (m2 > 0)
- mhi = lshift(mhi, m2);
-
- /* Compute mlo -- check for special case
- * that d is a normalized power of 2.
- */
-
- if (spec_case) {
- mlo = Brealloc(Binit(&_mlo), mhi->k);
- Bcopy(mlo, mhi);
- mhi = lshift(mhi, Log2P);
- }
- else
- mlo = mhi;
-
- for(i = 1;;i++) {
- dig = quorem(b,S) + '0';
- /* Do we yet have the shortest decimal string
- * that will round to d?
- */
- j = cmp(b, mlo);
- b_avail = diff(b_avail, S, mhi); /* b_avail = S - mi */
- j1 = b_avail->sign ? 1 : cmp(b, b_avail);
-#ifndef ROUND_BIASED
- if (j1 == 0 && !mode && !(word1(d) & 1)) {
- if (dig == '9')
- goto round_9_up;
- if (j > 0)
- dig++;
- *s++ = dig;
- goto ret;
- }
-#endif
- if (j < 0 || (j == 0 && !mode
-#ifndef ROUND_BIASED
- && !(word1(d) & 1)
-#endif
- )) {
- if (j1 > 0) {
- b = lshift(b, 1);
- j1 = cmp(b, S);
- if ((j1 > 0 || (j1 == 0 && dig & 1))
- && dig++ == '9')
- goto round_9_up;
- }
- *s++ = dig;
- goto ret;
- }
- if (j1 > 0) {
- if (dig == '9') { /* possible if i == 1 */
- round_9_up:
- *s++ = '9';
- goto roundoff;
- }
- *s++ = dig + 1;
- goto ret;
- }
- *s++ = dig;
- if (i == ilim)
- break;
- b = multadd(b, 10, 0);
- if (mlo == mhi)
- mlo = mhi = multadd(mhi, 10, 0);
- else {
- mlo = multadd(mlo, 10, 0);
- mhi = multadd(mhi, 10, 0);
- }
- }
- }
- else
- for(i = 1;; i++) {
- *s++ = dig = quorem(b,S) + '0';
- if (i >= ilim)
- break;
- b = multadd(b, 10, 0);
- }
-
- /* Round off last digit */
-
- b = lshift(b, 1);
- j = cmp(b, S);
- if (j > 0 || (j == 0 && dig & 1)) {
- roundoff:
- while(*--s == '9')
- if (s == s0) {
- k++;
- *s++ = '1';
- goto ret;
- }
- ++*s++;
- }
- else {
- while(*--s == '0');
- s++;
- }
- ret:
- Bfree(b_avail);
- Bfree(S);
- if (mhi) {
- if (mlo && mlo != mhi)
- Bfree(mlo);
- Bfree(mhi);
- }
- ret1:
- Bfree(b);
- *s = 0;
- *decpt = k + 1;
- if (rve)
- *rve = s;
- return s0;
- }
-#endif /* _IO_USE_DTOA */
diff --git a/contrib/libg++/libio/floatio.h b/contrib/libg++/libio/floatio.h
deleted file mode 100644
index 827767bde359..000000000000
--- a/contrib/libg++/libio/floatio.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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. */
-
-/*
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms are permitted
- * provided that the above copyright notice and this paragraph are
- * duplicated in all such forms and that any documentation,
- * advertising materials, and other materials related to such
- * distribution and use acknowledge that the software was developed
- * by the University of California, Berkeley. The name of the
- * University may not be used to endorse or promote products derived
- * from this software without specific prior written permission.
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- *
- * %W% (Berkeley) %G%
- */
-
-/*
- * Floating point scanf/printf (input/output) definitions.
- */
-
-/* 11-bit exponent (VAX G floating point) is 308 decimal digits */
-#define MAXEXP 308
-/* 128 bit fraction takes up 39 decimal digits; max reasonable precision */
-#define MAXFRACT 39
diff --git a/contrib/libg++/libio/fstream.cc b/contrib/libg++/libio/fstream.cc
deleted file mode 100644
index 8930e0b9271f..000000000000
--- a/contrib/libg++/libio/fstream.cc
+++ /dev/null
@@ -1,110 +0,0 @@
-/* This is part of libio/iostream, providing -*- C++ -*- input/output.
-Copyright (C) 1993 Free Software Foundation
-
-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.
-
-Written by Per Bothner (bothner@cygnus.com). */
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#define _STREAM_COMPAT
-extern "C" {
-#include "libioP.h"
-}
-#include <fstream.h>
-
-inline void
-fstreambase::__fb_init()
-{
-#ifdef _IO_NEW_STREAMS
-#if !_IO_UNIFIED_JUMPTABLES
- /* Uses the _IO_file_jump jumptable, for eficiency. */
- __my_fb._jumps = &_IO_file_jumps;
- __my_fb._vtable() = builtinbuf_vtable;
-#endif
- init (&__my_fb);
-#else
- init(filebuf::__new());
- _flags &= ~ios::dont_close;
-#endif
-}
-
-fstreambase::fstreambase()
-{
- __fb_init ();
-}
-
-fstreambase::fstreambase(int fd)
-{
- __fb_init ();
- _IO_file_attach(rdbuf(), fd);
-}
-
-fstreambase::fstreambase(const char *name, int mode, int prot)
-{
- __fb_init ();
- if (!rdbuf()->open(name, mode, prot))
- set(ios::badbit);
-}
-
-fstreambase::fstreambase(int fd, char *p, int l)
-{
-#ifdef _IO_NEW_STREAMS
- __fb_init ();
-#else
- init(filebuf::__new());
-#endif
- _IO_file_attach(rdbuf(), fd);
- _IO_file_setbuf(rdbuf(), p, l);
-}
-
-void fstreambase::open(const char *name, int mode, int prot)
-{
- clear();
- if (!rdbuf()->open(name, mode, prot))
- set(ios::badbit);
-}
-
-void fstreambase::close()
-{
- if (!rdbuf()->close())
- set(ios::failbit);
-}
-
-void fstreambase::attach(int fd)
-{
- if (!rdbuf()->attach(fd))
- set(ios::failbit);
-}
-
-#if 0
-static int mode_to_sys(enum open_mode mode)
-{
- return O_WRONLY;
-}
-
-static char* fopen_cmd_arg(io_mode i)
-{
- return "w";
-}
-#endif
diff --git a/contrib/libg++/libio/fstream.h b/contrib/libg++/libio/fstream.h
deleted file mode 100644
index ea98f5caed05..000000000000
--- a/contrib/libg++/libio/fstream.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/* This is part of libio/iostream, providing -*- C++ -*- input/output.
-Copyright (C) 1993 Free Software Foundation
-
-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. */
-
-#ifndef _FSTREAM_H
-#define _FSTREAM_H
-#ifdef __GNUG__
-#pragma interface
-#endif
-#include <iostream.h>
-
-extern "C++" {
-class fstreambase : virtual public ios {
-#ifdef _IO_NEW_STREAMS
- mutable filebuf __my_fb; // mutable so rdbuf() can be const
-#endif
- void __fb_init ();
- public:
- fstreambase();
- fstreambase(int fd);
- fstreambase(int fd, char *p, int l); /* Deprecated */
- fstreambase(const char *name, int mode, int prot=0664);
- void close();
-#ifdef _IO_NEW_STREAMS
- filebuf* rdbuf() const { return &__my_fb; }
-#else
- filebuf* rdbuf() const { return (filebuf*) ios::rdbuf(); }
-#endif
- void open(const char *name, int mode, int prot=0664);
- int is_open() const { return rdbuf()->is_open(); }
- void setbuf(char *ptr, int len) { rdbuf()->setbuf(ptr, len); }
- void attach(int fd);
-#ifdef _STREAM_COMPAT
- int filedesc() { return rdbuf()->fd(); }
- fstreambase& raw() { rdbuf()->setbuf(NULL, 0); return *this; }
-#endif
-};
-
-class ifstream : public fstreambase, public istream {
- public:
- ifstream() : fstreambase() { }
- ifstream(int fd) : fstreambase(fd) { }
- ifstream(int fd, char *p, int l) : fstreambase(fd, p, l) { } /*Deprecated*/
- ifstream(const char *name, int mode=ios::in, int prot=0664)
- : fstreambase(name, mode, prot) { }
- void open(const char *name, int mode=ios::in, int prot=0664)
- { fstreambase::open(name, mode, prot); }
-};
-
-class ofstream : public fstreambase, public ostream {
- public:
- ofstream() : fstreambase() { }
- ofstream(int fd) : fstreambase(fd) { }
- ofstream(int fd, char *p, int l) : fstreambase(fd, p, l) { } /*Deprecated*/
- ofstream(const char *name, int mode=ios::out, int prot=0664)
- : fstreambase(name, mode, prot) { }
- void open(const char *name, int mode=ios::out, int prot=0664)
- { fstreambase::open(name, mode, prot); }
-};
-
-class fstream : public fstreambase, public iostream {
- public:
- fstream() : fstreambase() { }
- fstream(int fd) : fstreambase(fd) { }
- fstream(const char *name, int mode, int prot=0664)
- : fstreambase(name, mode, prot) { }
- fstream(int fd, char *p, int l) : fstreambase(fd, p, l) { } /*Deprecated*/
- void open(const char *name, int mode, int prot=0664)
- { fstreambase::open(name, mode, prot); }
-};
-} // extern "C++"
-#endif /*!_FSTREAM_H*/
diff --git a/contrib/libg++/libio/gen-params b/contrib/libg++/libio/gen-params
deleted file mode 100755
index b6e51b042dd9..000000000000
--- a/contrib/libg++/libio/gen-params
+++ /dev/null
@@ -1,692 +0,0 @@
-#!/bin/sh
-# Copyright (C) 1992, 1993, 1994 Free Software Foundation
-#
-# 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.
-
-# Written by Per Bothner (bothner@cygnus.com)
-
-# This is a shell-script that figures out various things about a
-# system, and writes (to stdout) a C-style include files with
-# suitable definitions, including all the standard Posix types.
-# It works by compiling various test programs -- some are run through
-# the C pre-processor, and the output examined.
-# The test programs are only compiled, not executed, so the script
-# should even if you're cross-compiling.
-# It uses $CC (which defaults to cc) to compile C programs (extension .c),
-# and $CXX (which defaults to gcc) to compile C++ programs (extension .C).
-# The shell-script is written for libg++.a.
-
-# Usage: gen-params [NAME1=name1 ...]
-# - where an assignment (such as size_t="unsigned int" means to
-# use that value, instead of trying to figure it out.
-
-# Uncomment following line for debugging
-# set -x
-
-SED=sed
-
-# Evaluate the arguments (which should be assignments):
-for arg in "$@"; do
- # Quote arg (i.e. FOO=bar => FOO='bar'), then eval it.
- eval `echo "$arg" | ${SED} -e "s|^\(.*\)=\(.*\)|\1='\2'|"`
-done
-
-macro_prefix=${macro_prefix-"_G_"}
-rootdir=`pwd`/..
-gccdir=${gccdir-${rootdir}/gcc}
-binutilsdir=${binutilsdir-${rootdir}/binutils}
-CC=${CC-`if [ -f ${gccdir}/xgcc ] ; \
- then echo ${gccdir}/xgcc -B${gccdir}/ ; \
- else echo cc ; fi`}
-CXX=${CXX-`if [ -f ${gccdir}/xgcc ] ; \
- then echo ${gccdir}/xgcc -B${gccdir}/ ; \
- else echo gcc ; fi`}
-CPP=${CPP-`echo ${CC} -E`}
-CONFIG_NM=${CONFIG_NM-`if [ -f ${binutilsdir}/nm.new ] ; \
- then echo ${binutilsdir}/nm.new ; \
- else echo nm ; fi`}
-
-cat <<!EOF!
-/* AUTOMATICALLY GENERATED; DO NOT EDIT! */
-#ifndef ${macro_prefix}config_h
-#define ${macro_prefix}config_h
-!EOF!
-
-if [ x"${LIB_VERSION}" != "x" ] ; then
- echo "#define ${macro_prefix}LIB_VERSION" '"'${LIB_VERSION}'"'
-fi
-
-# This program is used to test if the compiler prepends '_' before identifiers.
-# It is also used to check the g++ uses '$' or '.' various places.
-
-if test -z "${NAMES_HAVE_UNDERSCORE}" -o -z "${DOLLAR_IN_LABEL}" \
- -o -z "${VTABLE_LABEL_PREFIX}"; then
- cat >dummy.h <<!EOF!
-#ifdef __GNUG__
-#pragma interface
-#endif
- struct filebuf {
- virtual int foo();
- };
-!EOF!
- cat >dummy.C <<!EOF!
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include "dummy.h"
- int filebuf::foo() { return 0; }
- extern "C" int FUNC(int);
- int FUNC(int i) { return i+10; }
-!EOF!
-
- if ${CXX} -O -c dummy.C ; then
- if test -z "${NAMES_HAVE_UNDERSCORE}" ; then
- if test "`${CONFIG_NM} dummy.o | grep _FUNC`" != ""; then
- NAMES_HAVE_UNDERSCORE=1
- elif test "`${CONFIG_NM} dummy.o | grep FUNC`" != ""; then
- NAMES_HAVE_UNDERSCORE=0
- else
- echo "${CONFIG_NM} failed to find FUNC in dummy.o!" 1>&2; exit -1;
- fi
- fi
- echo "#define ${macro_prefix}NAMES_HAVE_UNDERSCORE ${NAMES_HAVE_UNDERSCORE}"
-
- if test -z "${VTABLE_LABEL_PREFIX}" ; then
- # Determine how virtual function tables are named. This is fragile,
- # because different nm's produce output in different formats.
- ${CONFIG_NM} dummy.o >TMP
- if [ -n "`${SED} -n -e 's/ virtual table/nope/p' <TMP`" ] ; then
- ${CONFIG_NM} --no-cplus dummy.o >TMP 2>/dev/null ||
- ${CONFIG_NM} --no-demangle dummy.o >TMP 2>/dev/null ||
- ${CONFIG_NM} dummy.o >TMP 2>/dev/null
- fi
- # First we look for a pattern that matches historical output from g++.
- # We surround the actual label name by <> to separate it from
- # other nm junk.
- ${SED} -n -e 's/_*vt[$_.]7*filebuf/<&>/p' <TMP >dummy.out
- # For paranoia's sake (e.g. if we're using some other C++ compiler)
- # we try a more general pattern, and append the result.
- grep -v foo <TMP \
- | ${SED} -n -e 's/[a-zA-Z0-9_.$]*filebuf[a-zA-Z0-9_.$]*/<&>/p' \
- >>dummy.out
- # Now we get rid of the <>, and any other junk on the nm output line.
- # (We get rid of <filebuf> in case nm included debugging output for
- # class filebuf itself.) Finally, we select the first line of
- # the result, and hope that's what we wanted!
- vtab_name=`${SED} -n -e '/<filebuf>/d' -e 's/^.*<\(.*\)>.*$/\1/p' \
- <dummy.out | ${SED} -n -e '1p'`
- case "${vtab_name}" in
- *7filebuf) echo "#define ${macro_prefix}VTABLE_LABEL_HAS_LENGTH 1" ;;
- *) echo "#define ${macro_prefix}VTABLE_LABEL_HAS_LENGTH 0" ;;
- esac
- VTABLE_LABEL_PREFIX=`echo $vtab_name | ${SED} -e 's/7*filebuf//'`
- fi
- echo "#define ${macro_prefix}VTABLE_LABEL_PREFIX" '"'"${VTABLE_LABEL_PREFIX}"'"'
- if [ "${VTABLE_LABEL_PREFIX}" = "__vt_" -o \
- "${VTABLE_LABEL_PREFIX}" = "___vt_" ] ; then
- echo "#define ${macro_prefix}USING_THUNKS"
- fi
-
- # VTABLE_LABEL_PREFIX_ID is the same as VTABLE_LABEL_PREFIX,
- # but the former is a C identifier, while the latter is a quoted
- # st
- if [ -z ""`echo ${VTABLE_LABEL_PREFIX} | ${SED} -e 's/[a-zA-Z0-9_]//g'` ] ; then
- if [ "${NAMES_HAVE_UNDERSCORE}" = "1" ] ; then
- VTABLE_LABEL_PREFIX=`echo ${VTABLE_LABEL_PREFIX} | ${SED} -e 's/^_//'`
- fi
- echo "#define ${macro_prefix}VTABLE_LABEL_PREFIX_ID ${VTABLE_LABEL_PREFIX}"
- fi
-
-# if test -n "${DOLLAR_IN_LABEL}" ; then
-# echo "#define ${macro_prefix}DOLLAR_IN_LABEL ${DOLLAR_IN_LABEL}"
-# elif test "`${CONFIG_NM} dummy.o | grep 'vt[$$]7filebuf'`" != ""; then
-# echo "#define ${macro_prefix}DOLLAR_IN_LABEL 1"
-# elif test "`${CONFIG_NM} dummy.o | grep 'vt[.]7filebuf'`" != ""; then
-# echo "#define ${macro_prefix}DOLLAR_IN_LABEL 0"
-# elif test "`${CONFIG_NM} dummy.o | grep 'vtbl__7filebuf'`" != ""; then
-# echo "#define ${macro_prefix}DOLLAR_IN_LABEL 0"
-# else
-# echo "gen-params: ${CONFIG_NM} failed to find vt[.\$]filebuf in dummy.o!" 1>&2; exit 1
-# fi
- else
- # The compile failed for some reason (no C++?)
- echo "gen-params: could not compile dummy.C with ${CXX}" 1>&2; exit 1;
- fi
-fi
-
-# A little test program to check if struct stat has st_blksize.
-cat >dummy.c <<!EOF!
-#include <sys/types.h>
-#include <sys/stat.h>
-int BLKSIZE(struct stat *st)
-{
- return st->st_blksize;
-}
-!EOF!
-
-if ${CC} -c dummy.c >/dev/null 2>&1 ; then
- echo "#define ${macro_prefix}HAVE_ST_BLKSIZE 1"
-else
- echo "#define ${macro_prefix}HAVE_ST_BLKSIZE 0"
-fi
-
-# A little test program to check if the name 'clog' is defined in libm,
-# as it is under DEC UNIX.
-cat >dummy.c <<!EOF!
-int clog;
-main () {}
-!EOF!
-
-if ${CC} dummy.c -lm 2>&1 >/dev/null | grep clog >/dev/null; then
- echo "#define ${macro_prefix}CLOG_CONFLICT 1"
-fi
-
-# Next, generate definitions for the standard types (such as mode_t)
-# compatible with those in the standard C header files.
-# It works by a dummy program through the C pre-processor, and then
-# using sed to search for typedefs in the output.
-
-for hdr in wchar wctype; do
- eval $hdr=0
- cat >dummy.c <<EOF
-#include <${hdr}.h>
-EOF
- if ${CPP} dummy.c >/dev/null 2>&1 ; then eval $hdr=1; fi
-done
-
-cat >dummy.c <<!EOF!
-#include <sys/types.h>
-#include <stddef.h>
-#ifdef __STDC__
-#include <stdarg.h>
-#else /* !__STDC__ */
-#include <varargs.h>
-#endif /* __STDC__ */
-#include <stdio.h>
-#include <time.h>
-#include <signal.h>
-#ifdef __STDC__
-#include <limits.h>
-#endif
-#if WCHAR == 1
-#include <wchar.h>
-#endif
-#if WCTYPE == 1
-#include <wctype.h>
-#endif
-#ifdef size_t
-typedef size_t Xsize_t;
-#elif defined(__SIZE_TYPE__)
-typedef __SIZE_TYPE__ Xsize_t;
-#endif
-#ifdef ptrdiff_t
-typedef ptrdiff_t Xptrdiff_t;
-#elif defined(__PTRDIFF_TYPE__)
-typedef __PTRDIFF_TYPE__ Xptrdiff_t;
-#endif
-#ifdef wchar_t
-typedef wchar_t Xwchar_t;
-#elif defined(__WCHAR_TYPE__)
-typedef __WCHAR_TYPE__ Xwchar_t;
-#endif
-#ifdef va_list
-typedef va_list XXXva_list;
-#endif
-#ifdef BUFSIZ
-long XBUFSIZ=BUFSIZ;
-#endif
-#ifdef FOPEN_MAX
-long XFOPEN_MAX=FOPEN_MAX;
-#endif
-#ifdef FILENAME_MAX
-long XFILENAME_MAX=FILENAME_MAX;
-#endif
-#ifdef SHRT_MAX
-long XSHRT_MAX=SHRT_MAX;
-#endif
-#ifdef INT_MAX
-long XINT_MAX=INT_MAX;
-#endif
-#ifdef LONG_MAX
-long XLONG_MAX=LONG_MAX;
-#endif
-#ifdef LONG_LONG_MAX
-long XLONG_LONG_MAX=LONG_LONG_MAX;
-#endif
-!EOF!
-
-if ${CPP} dummy.c -DWCHAR=$wchar -DWCTYPE=$wctype >TMP ; then true
-else
- echo "gen-params: could not invoke ${CPP} on dummy.c" 1>&2 ; exit 1
-fi
-tr ' ' ' ' <TMP >dummy.out
-
-for TYPE in dev_t clock_t fpos_t gid_t ino_t mode_t nlink_t off_t pid_t ptrdiff_t sigset_t size_t ssize_t time_t uid_t va_list wchar_t wint_t int16_t uint16_t int32_t uint_32_t u_int16_t u_int32_t; do
- IMPORTED=`eval 'echo $'"$TYPE"`
- if [ -n "${IMPORTED}" ] ; then
- eval "$TYPE='$IMPORTED'"
- else
- t=$TYPE
- VALUE=''
-
- # Follow `typedef VALUE TYPE' chains, but don't loop indefinitely.
- for iteration in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20; do
- # Search dummy.out for a typedef for X*$t.
- sed_script="
- /.*typedef *\\(.*[^ ]\\) *X*$t *;.*/{s||\1|;p;q;}
- /.*typedef *\\(.*[^ a-zA-Z0-9_]\\)X*$t *;.*/{s||\1|;p;q;}
- "
- t=`${SED} -n "$sed_script" <dummy.out`
- case "$t" in
- '')
- break;;
- *)
- # Found a type $t; save it in VALUE.
- VALUE=$t
- # If it won't cause problems in matching,
- # look for a typedef for it in turn.
- case "$VALUE" in
- *.* | */* | *\ * | *\** | *\[* | *\\*) break;;
- esac;;
- esac
- done
-
- case "$VALUE" in
- ?*) eval "$TYPE=\"$VALUE\""
- esac
- fi
-done
-
-cat <<!EOF!
-typedef ${clock_t-int /* default */} ${macro_prefix}clock_t;
-typedef ${dev_t-int /* default */} ${macro_prefix}dev_t;
-typedef ${fpos_t-long /* default */} ${macro_prefix}fpos_t;
-typedef ${gid_t-int /* default */} ${macro_prefix}gid_t;
-typedef ${ino_t-int /* default */} ${macro_prefix}ino_t;
-typedef ${mode_t-int /* default */} ${macro_prefix}mode_t;
-typedef ${nlink_t-int /* default */} ${macro_prefix}nlink_t;
-typedef ${off_t-long /* default */} ${macro_prefix}off_t;
-typedef ${pid_t-int /* default */} ${macro_prefix}pid_t;
-#ifndef __PTRDIFF_TYPE__
-#define __PTRDIFF_TYPE__ ${ptrdiff_t-long int /* default */}
-#endif
-typedef __PTRDIFF_TYPE__ ${macro_prefix}ptrdiff_t;
-typedef ${sigset_t-int /* default */} ${macro_prefix}sigset_t;
-#ifndef __SIZE_TYPE__
-#define __SIZE_TYPE__ ${size_t-unsigned long /* default */}
-#endif
-typedef __SIZE_TYPE__ ${macro_prefix}size_t;
-typedef ${time_t-int /* default */} ${macro_prefix}time_t;
-typedef ${uid_t-int /* default */} ${macro_prefix}uid_t;
-typedef ${wchar_t-int /* default */} ${macro_prefix}wchar_t;
-!EOF!
-
-
-# ssize_t is the signed version of size_t
-if [ -n "${ssize_t}" ] ; then
- echo "typedef ${ssize_t} ${macro_prefix}ssize_t;"
-elif [ -z "${size_t}" ] ; then
- echo "typedef long ${macro_prefix}ssize_t;"
-else
- # Remove "unsigned" from ${size_t} to get ${ssize_t}.
- tmp="`echo ${size_t} | ${SED} -e 's|unsigned||g' -e 's| | |g'`"
- if [ -z "$tmp" ] ; then
- tmp=int
- else
- # check $tmp doesn't conflict with <unistd.h>
- echo "#include <unistd.h>
- extern $tmp read();" >dummy.c
- ${CC} -c dummy.c >/dev/null 2>&1 || tmp=int
- fi
- echo "typedef $tmp /* default */ ${macro_prefix}ssize_t;"
-fi
-
-# wint_t is often the integral type to which wchar_t promotes.
-if [ -z "${wint_t}" ] ; then
- for TYPE in int 'unsigned int' 'long int' 'long unsigned int'; do
- cat >dummy.C <<!EOF!
-#ifndef __WCHAR_TYPE__
-#define __WCHAR_TYPE__ ${wchar_t-int /* default */}
-#endif
-typedef __WCHAR_TYPE__ ${macro_prefix}wchar_t;
-void foo ($TYPE);
-void foo (double);
-void bar (${macro_prefix}wchar_t w)
-{
- foo (w);
-}
-!EOF!
- if ${CXX} -c dummy.C >/dev/null 2>&1 ; then
- wint_t="$TYPE /* default */"
- break
- fi
- done
-fi
-echo "typedef ${wint_t-int /* wchar_t is broken */} ${macro_prefix}wint_t;"
-
-# va_list can cause problems (e.g. some systems have va_list as a struct).
-# Check to see if ${va_list-char*} really is compatible with stdarg.h.
-cat >dummy.C <<!EOF!
-#define X_va_list ${va_list-char* /* default */}
-extern long foo(X_va_list ap); /* Check that X_va_list compiles on its own */
-extern "C" {
-#include <stdarg.h>
-}
-long foo(X_va_list ap) { return va_arg(ap, long); }
-long bar(int i, ...)
-{ va_list ap; long j; va_start(ap, i); j = foo(ap); va_end(ap); return j; }
-!EOF!
-if ${CXX} -c dummy.C >/dev/null 2>&1 ; then
- # Ok: We have something that works.
- echo "typedef ${va_list-char* /* default */} ${macro_prefix}va_list;"
-else
- # No, it breaks. Indicate that <stdarg.h> must be included.
- echo "#define ${macro_prefix}NEED_STDARG_H
-#define ${macro_prefix}va_list va_list"
-fi
-
-cat >dummy.c <<!EOF!
-#include <signal.h>
-extern int (*signal())();
-extern int dummy (int);
-main()
-{
- int (*oldsig)(int) = signal (1, dummy);
- (void) signal (2, oldsig);
- return 0;
-}
-!EOF!
-if ${CC} -c dummy.c >/dev/null 2>&1 ; then
- echo "#define ${macro_prefix}signal_return_type int"
-else
- echo "#define ${macro_prefix}signal_return_type void"
-fi
-
-# check sprintf return type
-
-cat >dummy.c <<!EOF!
-#include <stdio.h>
-extern int sprintf(); char buf[100];
-int main() { return sprintf(buf, "%d", 34); }
-!EOF!
-if ${CC} -c dummy.c >/dev/null 2>&1 ; then
- echo "#define ${macro_prefix}sprintf_return_type int"
-else
- echo "#define ${macro_prefix}sprintf_return_type char*"
-fi
-
-# Look for some standard macros.
-for NAME in BUFSIZ FOPEN_MAX FILENAME_MAX NULL; do
- IMPORTED=`eval 'echo $'"$NAME"`
- if [ -n "${IMPORTED}" ] ; then
- eval "$NAME='$IMPORTED /* specified */"
- else
- rm -f TMP
- ${SED} -n -e 's| *;|;|g' -e "s|long X${NAME}= *\(.*\);|\1|w TMP" \
- <dummy.out>/dev/null
- # Now select the first definition.
- if [ -s TMP ]; then
- eval "$NAME='"`${SED} -e '2,$d' <TMP`"'"
- fi
- fi
-done
-
-# These macros must be numerical constants; strip any trailing 'L's.
-for NAME in SHRT_MAX INT_MAX LONG_MAX LONG_LONG_MAX; do
- IMPORTED=`eval 'echo $'"$NAME"`
- if [ -n "${IMPORTED}" ] ; then
- eval "$NAME='$IMPORTED /* specified */"
- else
- rm -f TMP
- ${SED} -n -e 's| *;|;|g' -e "s|long X${NAME}= *\([0-9]*\)L* *;|\1|w TMP" \
- <dummy.out>/dev/null
- # Now select the first definition.
- if [ -s TMP ]; then
- eval "$NAME='"`${SED} -e '2,$d' <TMP`"'"
- fi
- fi
-done
-
-# Figure out integral type sizes.
-
-default_int16='short /* deduction failed */'
-default_int32='long /* deduction failed */'
-INT16=32767
-INT32=2147483647
-
-if [ "${SHRT_MAX}" = $INT16 ] ; then
- default_int16='short /* deduced */'
- if [ "${LONG_MAX}" = $INT32 ] ; then
- default_int32='long /* deduced */'
- elif [ "${INT_MAX}" = $INT32 ] ; then
- default_int32='int /* deduced */'
- fi
-fi
-
-[ -n "$u_int16_t" ] && uint16_t="$u_int16_t"
-[ -n "$u_int32_t" ] && uint32_t="$u_int32_t"
-
-[ -z "$int16_t" ] && int16_t="$default_int16"
-[ -z "$uint16_t" ] && uint16_t="unsigned $int16_t"
-[ -z "$int32_t" ] && int32_t="$default_int32"
-[ -z "$uint32_t" ] && uint32_t="unsigned $int32_t"
-
-cat <<!EOF!
-
-#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
-typedef int ${macro_prefix}int8_t __attribute__((__mode__(__QI__)));
-typedef unsigned int ${macro_prefix}uint8_t __attribute__((__mode__(__QI__)));
-typedef int ${macro_prefix}int16_t __attribute__((__mode__(__HI__)));
-typedef unsigned int ${macro_prefix}uint16_t __attribute__((__mode__(__HI__)));
-typedef int ${macro_prefix}int32_t __attribute__((__mode__(__SI__)));
-typedef unsigned int ${macro_prefix}uint32_t __attribute__((__mode__(__SI__)));
-typedef int ${macro_prefix}int64_t __attribute__((__mode__(__DI__)));
-typedef unsigned int ${macro_prefix}uint64_t __attribute__((__mode__(__DI__)));
-#else
-typedef $int16_t ${macro_prefix}int16_t;
-typedef $uint16_t ${macro_prefix}uint16_t;
-typedef $int32_t ${macro_prefix}int32_t;
-typedef $uint32_t ${macro_prefix}uint32_t;
-#endif
-
-#define ${macro_prefix}BUFSIZ ${BUFSIZ-1024 /* default */}
-#define ${macro_prefix}FOPEN_MAX ${FOPEN_MAX-32 /* default */}
-#define ${macro_prefix}FILENAME_MAX ${FILENAME_MAX-1024 /* default */}
-#define ${macro_prefix}NULL ${NULL-0 /* default */}
-#if defined (__cplusplus) || defined (__STDC__)
-#define ${macro_prefix}ARGS(ARGLIST) ARGLIST
-#else
-#define ${macro_prefix}ARGS(ARGLIST) ()
-#endif
-#if !defined (__GNUG__) || defined (__STRICT_ANSI__)
-#define ${macro_prefix}NO_NRV
-#endif
-#if !defined (__GNUG__)
-#define _G_NO_EXTERN_TEMPLATES
-#endif
-!EOF!
-
-rm -f dummy.c dummy.o dummy.h
-
-if test -n "${HAVE_ATEXIT}" ; then
- echo "#define ${macro_prefix}HAVE_ATEXIT ${HAVE_ATEXIT}"
-else
- cat >dummy.c <<!EOF!
-#include <stdlib.h>
-int main()
-{
- atexit (0);
-}
-!EOF!
- if ${CC} dummy.c >/dev/null 2>&1 ; then
- echo "#define ${macro_prefix}HAVE_ATEXIT 1"
- else
- echo "#define ${macro_prefix}HAVE_ATEXIT 0"
- fi
-fi
-
-
-# *** Check for presence of certain include files ***
-
-# check for sys/resource.h
-
-if test -n "${HAVE_SYS_RESOURCE}" ; then
- echo "#define ${macro_prefix}HAVE_SYS_RESOURCE ${HAVE_SYS_RESOURCE}"
-else
- cat >dummy.c <<!EOF!
-#include <sys/types.h>
-#include <sys/time.h>
-#include <sys/resource.h>
- int main()
- {
- struct rusage res;
- getrusage(RUSAGE_SELF, &res);
- return (int)(res.ru_utime.tv_sec + (res.ru_utime.tv_usec / 1000000.0));
- }
-!EOF!
- # Note: We link because some systems have sys/resource, but not getrusage().
- if ${CC} dummy.c >/dev/null 2>&1 ; then
- echo "#define ${macro_prefix}HAVE_SYS_RESOURCE 1"
- else
- echo "#define ${macro_prefix}HAVE_SYS_RESOURCE 0"
- fi
-fi
-
-# check for struct tms in sys/times.h
-
-if test -n "${HAVE_SYS_TIMES}" ; then
- echo "#define ${macro_prefix}HAVE_SYS_TIMES ${HAVE_SYS_TIMES}"
-else
- cat >dummy.c <<!EOF!
-#include <sys/types.h>
-#include <sys/times.h>
- int main()
- {
- struct tms s;
- return s.tms_utime;
- }
-!EOF!
- if ${CC} -c dummy.c >/dev/null 2>&1 ; then
- echo "#define ${macro_prefix}HAVE_SYS_TIMES 1"
- else
- echo "#define ${macro_prefix}HAVE_SYS_TIMES 0"
- fi
-fi
-
-# check for sys/socket.h
-
-if test -n "${HAVE_SYS_SOCKET}" ; then
- echo "#define ${macro_prefix}HAVE_SYS_SOCKET ${HAVE_SYS_SOCKET}"
-else
- echo '#include <sys/types.h>' >dummy.c
- echo '#include <sys/socket.h>' >>dummy.c
- if ${CC} -c dummy.c >/dev/null 2>&1 ; then
- echo "#define ${macro_prefix}HAVE_SYS_SOCKET 1"
- else
- echo "#define ${macro_prefix}HAVE_SYS_SOCKET 0"
- fi
-fi
-
-# check for sys/cdefs.h
-
-if test -n "${HAVE_SYS_CDEFS}" ; then
- echo "#define ${macro_prefix}HAVE_SYS_CDEFS ${HAVE_SYS_CDEFS}"
-else
- echo '#include <sys/cdefs.h>' >dummy.c
- echo 'extern int myfunc __P((int, int));' >>dummy.c
- if ${CC} -c dummy.c >/dev/null 2>&1 ; then
- echo "#define ${macro_prefix}HAVE_SYS_CDEFS 1"
- else
- echo "#define ${macro_prefix}HAVE_SYS_CDEFS 0"
- fi
-fi
-
-# Check for a (Posix-compatible) sys/wait.h */
-
-if test -n "${HAVE_SYS_WAIT}" ; then
- echo "#define ${macro_prefix}HAVE_SYS_WAIT ${HAVE_SYS_WAIT}"
-else
- cat >dummy.c <<!EOF!
-#include <sys/types.h>
-#include <sys/wait.h>
- int f() { int i; wait(&i); return i; }
-!EOF!
- if ${CC} -c dummy.c >/dev/null 2>&1 ; then
- echo "#define ${macro_prefix}HAVE_SYS_WAIT 1"
- else
- echo "#define ${macro_prefix}HAVE_SYS_WAIT 0"
- fi
-fi
-
-if test -n "${HAVE_UNISTD}" ; then
- echo "#define ${macro_prefix}HAVE_UNISTD ${HAVE_UNISTD}"
-else
- echo '#include <unistd.h>' >dummy.c
- if ${CC} -c dummy.c >/dev/null 2>&1 ; then
- echo "#define ${macro_prefix}HAVE_UNISTD 1"
- else
- echo "#define ${macro_prefix}HAVE_UNISTD 0"
- fi
-fi
-
-if test -n "${HAVE_DIRENT}" ; then
- echo "#define ${macro_prefix}HAVE_DIRENT ${HAVE_DIRENT}"
-else
- echo '#include <sys/types.h>
-#include <dirent.h>' >dummy.c
- if ${CC} -c dummy.c >/dev/null 2>&1 ; then
- echo "#define ${macro_prefix}HAVE_DIRENT 1"
- else
- echo "#define ${macro_prefix}HAVE_DIRENT 0"
- fi
-fi
-
-if test -n "${HAVE_CURSES}" ; then
- echo "#define ${macro_prefix}HAVE_CURSES ${HAVE_CURSES}"
-else
- echo '#include <curses.h>' >dummy.c
- if ${CC} -c dummy.c >/dev/null 2>&1 ; then
- echo "#define ${macro_prefix}HAVE_CURSES 1"
- else
- echo "#define ${macro_prefix}HAVE_CURSES 0"
- fi
-fi
-
-# There is no test for this at the moment; it is just set by the
-# configuration files.
-if test -n "${MATH_H_INLINES}" ; then
- echo "#define ${macro_prefix}MATH_H_INLINES ${MATH_H_INLINES}"
-else
- echo "#define ${macro_prefix}MATH_H_INLINES 0"
-fi
-
-if test -n "${HAVE_BOOL}" ; then
- echo "#define ${macro_prefix}HAVE_BOOL ${HAVE_BOOL}"
-else
- echo 'bool i=true,j=false;' >dummy.C
- if ${CXX} -c dummy.C >/dev/null 2>&1 ; then
- echo "#define ${macro_prefix}HAVE_BOOL 1"
- else
- echo "#define ${macro_prefix}HAVE_BOOL 0"
- fi
-fi
-
-# Uncomment the following line if you don't have working templates.
-# echo "#define ${macro_prefix}NO_TEMPLATES"
-
-rm -f dummy.C dummy.o dummy.c dummy.out TMP core a.out
-
-echo "#endif /* !${macro_prefix}config_h */"
diff --git a/contrib/libg++/libio/genops.c b/contrib/libg++/libio/genops.c
deleted file mode 100644
index 23a6fdeaeac7..000000000000
--- a/contrib/libg++/libio/genops.c
+++ /dev/null
@@ -1,852 +0,0 @@
-/*
-Copyright (C) 1993, 1995 Free Software Foundation
-
-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. */
-
-/* Generic or default I/O operations. */
-
-#include "libioP.h"
-#ifdef __STDC__
-#include <stdlib.h>
-#endif
-#include <string.h>
-
-void
-DEFUN(_IO_un_link, (fp),
- _IO_FILE *fp)
-{
- if (fp->_flags & _IO_LINKED) {
- _IO_FILE **f;
- for (f = &_IO_list_all; *f != NULL; f = &(*f)->_chain) {
- if (*f == fp) {
- *f = fp->_chain;
- break;
- }
- }
- fp->_flags &= ~_IO_LINKED;
- }
-}
-
-void
-DEFUN(_IO_link_in, (fp),
- _IO_FILE *fp)
-{
- if ((fp->_flags & _IO_LINKED) == 0) {
- fp->_flags |= _IO_LINKED;
- fp->_chain = _IO_list_all;
- _IO_list_all = fp;
- }
-}
-
-/* Return minimum _pos markers
- Assumes the current get area is the main get area. */
-
-_IO_size_t
-DEFUN(_IO_least_marker, (fp),
- register _IO_FILE *fp)
-{
- _IO_ssize_t least_so_far = fp->_IO_read_end - fp->_IO_read_base;
- register struct _IO_marker *mark;
- for (mark = fp->_markers; mark != NULL; mark = mark->_next)
- if (mark->_pos < least_so_far)
- least_so_far = mark->_pos;
- return least_so_far;
-}
-
-/* Switch current get area from backup buffer to (start of) main get area. */
-
-void
-DEFUN(_IO_switch_to_main_get_area, (fp),
- _IO_FILE *fp)
-{
- char *tmp;
- fp->_flags &= ~_IO_IN_BACKUP;
- /* Swap _IO_read_end and _IO_save_end. */
- tmp = fp->_IO_read_end; fp->_IO_read_end= fp->_IO_save_end; fp->_IO_save_end= tmp;
- /* Swap _IO_read_base and _IO_save_base. */
- tmp = fp->_IO_read_base; fp->_IO_read_base = fp->_IO_save_base; fp->_IO_save_base = tmp;
- fp->_IO_read_ptr = fp->_IO_read_base;
-}
-
-/* Switch current get area from main get area to (end of) backup area. */
-
-void
-DEFUN(_IO_switch_to_backup_area, (fp),
- register _IO_FILE *fp)
-{
- char *tmp;
- fp->_flags |= _IO_IN_BACKUP;
- /* Swap _IO_read_end and _IO_save_end. */
- tmp = fp->_IO_read_end; fp->_IO_read_end = fp->_IO_save_end; fp->_IO_save_end = tmp;
- /* Swap _gbase and _IO_save_base. */
- tmp = fp->_IO_read_base; fp->_IO_read_base = fp->_IO_save_base; fp->_IO_save_base = tmp;
- fp->_IO_read_ptr = fp->_IO_read_end;
-}
-
-int
-DEFUN(_IO_switch_to_get_mode, (fp),
- register _IO_FILE *fp)
-{
- if (fp->_IO_write_ptr > fp->_IO_write_base)
- if (_IO_OVERFLOW (fp, EOF) == EOF)
- return EOF;
- if (_IO_in_backup(fp))
- fp->_IO_read_base = fp->_IO_backup_base;
- else
- {
- fp->_IO_read_base = fp->_IO_buf_base;
- if (fp->_IO_write_ptr > fp->_IO_read_end)
- fp->_IO_read_end = fp->_IO_write_ptr;
- }
- fp->_IO_read_ptr = fp->_IO_write_ptr;
-
- fp->_IO_write_base = fp->_IO_write_ptr = fp->_IO_write_end = fp->_IO_read_ptr;
-
- fp->_flags &= ~_IO_CURRENTLY_PUTTING;
- return 0;
-}
-
-void
-DEFUN(_IO_free_backup_area, (fp),
- register _IO_FILE *fp)
-{
- if (_IO_in_backup (fp))
- _IO_switch_to_main_get_area(fp); /* Just in case. */
- free (fp->_IO_save_base);
- fp->_IO_save_base = NULL;
- fp->_IO_save_end = NULL;
- fp->_IO_backup_base = NULL;
-}
-
-#if 0
-int
-DEFUN(_IO_switch_to_put_mode, (fp),
- register _IO_FILE *fp)
-{
- fp->_IO_write_base = fp->_IO_read_ptr;
- fp->_IO_write_ptr = fp->_IO_read_ptr;
- /* Following is wrong if line- or un-buffered? */
- fp->_IO_write_end = fp->_flags & _IO_IN_BACKUP ? fp->_IO_read_end : fp->_IO_buf_end;
-
- fp->_IO_read_ptr = fp->_IO_read_end;
- fp->_IO_read_base = fp->_IO_read_end;
-
- fp->_flags |= _IO_CURRENTLY_PUTTING;
- return 0;
-}
-#endif
-
-int
-DEFUN(__overflow, (f, ch),
- _IO_FILE *f AND int ch)
-{
- return _IO_OVERFLOW (f, ch);
-}
-
-static int
-DEFUN(save_for_backup, (fp),
- _IO_FILE *fp)
-{
- /* Append [_IO_read_base.._IO_read_end] to backup area. */
- int least_mark = _IO_least_marker(fp);
- /* needed_size is how much space we need in the backup area. */
- int needed_size = (fp->_IO_read_end - fp->_IO_read_base) - least_mark;
- int current_Bsize = fp->_IO_save_end - fp->_IO_save_base;
- int avail; /* Extra space available for future expansion. */
- int delta;
- struct _IO_marker *mark;
- if (needed_size > current_Bsize)
- {
- char *new_buffer;
- avail = 100;
- new_buffer = (char*)malloc(avail+needed_size);
- if (new_buffer == NULL)
- return EOF; /* FIXME */
- if (least_mark < 0)
- {
- memcpy(new_buffer + avail,
- fp->_IO_save_end + least_mark,
- -least_mark);
- memcpy(new_buffer +avail - least_mark,
- fp->_IO_read_base,
- fp->_IO_read_end - fp->_IO_read_base);
- }
- else
- memcpy(new_buffer + avail,
- fp->_IO_read_base + least_mark,
- needed_size);
- if (fp->_IO_save_base)
- free (fp->_IO_save_base);
- fp->_IO_save_base = new_buffer;
- fp->_IO_save_end = new_buffer + avail + needed_size;
- }
- else
- {
- avail = current_Bsize - needed_size;
- if (least_mark < 0)
- {
- memmove(fp->_IO_save_base + avail,
- fp->_IO_save_end + least_mark,
- -least_mark);
- memcpy(fp->_IO_save_base + avail - least_mark,
- fp->_IO_read_base,
- fp->_IO_read_end - fp->_IO_read_base);
- }
- else if (needed_size > 0)
- memcpy(fp->_IO_save_base + avail,
- fp->_IO_read_base + least_mark,
- needed_size);
- }
- /* FIXME: Dubious arithmetic if pointers are NULL */
- fp->_IO_backup_base = fp->_IO_save_base + avail;
- /* Adjust all the streammarkers. */
- delta = fp->_IO_read_end - fp->_IO_read_base;
- for (mark = fp->_markers; mark != NULL; mark = mark->_next)
- mark->_pos -= delta;
- return 0;
-}
-
-int
-DEFUN(__underflow, (fp),
- _IO_FILE *fp)
-{
- if (_IO_in_put_mode(fp))
- if (_IO_switch_to_get_mode(fp) == EOF) return EOF;
- if (fp->_IO_read_ptr < fp->_IO_read_end)
- return *(unsigned char*)fp->_IO_read_ptr;
- if (_IO_in_backup(fp))
- {
- _IO_switch_to_main_get_area(fp);
- if (fp->_IO_read_ptr < fp->_IO_read_end)
- return *fp->_IO_read_ptr;
- }
- if (_IO_have_markers(fp))
- {
- if (save_for_backup (fp))
- return EOF;
- }
- else if (_IO_have_backup(fp))
- _IO_free_backup_area(fp);
- return _IO_UNDERFLOW (fp);
-}
-
-int
-DEFUN(__uflow, (fp),
- _IO_FILE *fp)
-{
- if (_IO_in_put_mode(fp))
- if (_IO_switch_to_get_mode(fp) == EOF) return EOF;
- if (fp->_IO_read_ptr < fp->_IO_read_end)
- return *(unsigned char*)fp->_IO_read_ptr++;
- if (_IO_in_backup(fp))
- {
- _IO_switch_to_main_get_area(fp);
- if (fp->_IO_read_ptr < fp->_IO_read_end)
- return *fp->_IO_read_ptr++;
- }
- if (_IO_have_markers(fp))
- {
- if (save_for_backup (fp))
- return EOF;
- }
- else if (_IO_have_backup(fp))
- _IO_free_backup_area(fp);
- return _IO_UFLOW (fp);
-}
-
-void
-DEFUN(_IO_setb, (f, b, eb, a),
- _IO_FILE *f AND char *b AND char *eb AND int a)
-{
- if (f->_IO_buf_base && !(f->_flags & _IO_USER_BUF))
- FREE_BUF(f->_IO_buf_base);
- f->_IO_buf_base = b;
- f->_IO_buf_end = eb;
- if (a)
- f->_flags &= ~_IO_USER_BUF;
- else
- f->_flags |= _IO_USER_BUF;
-}
-
-void
-DEFUN(_IO_doallocbuf, (fp),
- register _IO_FILE *fp)
-{
- if (fp->_IO_buf_base)
- return;
- if (!(fp->_flags & _IO_UNBUFFERED))
- if (_IO_DOALLOCATE (fp) != EOF)
- return;
- _IO_setb(fp, fp->_shortbuf, fp->_shortbuf+1, 0);
-}
-
-int
-DEFUN(_IO_default_underflow, (fp),
- _IO_FILE *fp)
-{
- return EOF;
-}
-
-int
-DEFUN(_IO_default_uflow, (fp),
- _IO_FILE *fp)
-{
- int ch = _IO_UNDERFLOW (fp);
- if (ch == EOF)
- return EOF;
- return *(unsigned char*)fp->_IO_read_ptr++;
-}
-
-_IO_size_t
-DEFUN(_IO_default_xsputn, (f, data, n),
- register _IO_FILE *f AND const void *data AND _IO_size_t n)
-{
- register const char *s = (char*) data;
- register _IO_size_t more = n;
- if (more <= 0)
- return 0;
- for (;;)
- {
- _IO_ssize_t count = f->_IO_write_end - f->_IO_write_ptr; /* Space available. */
- if (count > 0)
- {
- if (count > more)
- count = more;
- if (count > 20)
- {
- memcpy(f->_IO_write_ptr, s, count);
- s += count;
- f->_IO_write_ptr += count;
- }
- else if (count <= 0)
- count = 0;
- else
- {
- register char *p = f->_IO_write_ptr;
- register _IO_ssize_t i;
- for (i = count; --i >= 0; ) *p++ = *s++;
- f->_IO_write_ptr = p;
- }
- more -= count;
- }
- if (more == 0 || __overflow(f, (unsigned char)*s++) == EOF)
- break;
- more--;
- }
- return n - more;
-}
-
-_IO_size_t
-DEFUN(_IO_sgetn, (fp, data, n),
- _IO_FILE *fp AND void *data AND _IO_size_t n)
-{
- /* FIXME handle putback buffer here! */
- return _IO_XSGETN (fp, data, n);
-}
-
-_IO_size_t
-DEFUN(_IO_default_xsgetn, (fp, data, n),
- _IO_FILE *fp AND void *data AND _IO_size_t n)
-{
- register _IO_size_t more = n;
- register char *s = (char*) data;
- for (;;)
- {
- _IO_ssize_t count = fp->_IO_read_end - fp->_IO_read_ptr; /* Data available. */
- if (count > 0)
- {
- if (count > more)
- count = more;
- if (count > 20)
- {
- memcpy(s, fp->_IO_read_ptr, count);
- s += count;
- fp->_IO_read_ptr += count;
- }
- else if (count <= 0)
- count = 0;
- else
- {
- register char *p = fp->_IO_read_ptr;
- register int i = (int)count;
- while (--i >= 0) *s++ = *p++;
- fp->_IO_read_ptr = p;
- }
- more -= count;
- }
- if (more == 0 || __underflow(fp) == EOF)
- break;
- }
- return n - more;
-}
-
-int
-DEFUN(_IO_sync, (fp),
- register _IO_FILE *fp)
-{
- return 0;
-}
-
-_IO_FILE*
-DEFUN(_IO_default_setbuf, (fp, p, len),
- register _IO_FILE *fp AND char* p AND _IO_ssize_t len)
-{
- if (_IO_SYNC (fp) == EOF)
- return NULL;
- if (p == NULL || len == 0)
- {
- fp->_flags |= _IO_UNBUFFERED;
- _IO_setb(fp, fp->_shortbuf, fp->_shortbuf+1, 0);
- }
- else
- {
- fp->_flags &= ~_IO_UNBUFFERED;
- _IO_setb(fp, p, p+len, 0);
- }
- fp->_IO_write_base = fp->_IO_write_ptr = fp->_IO_write_end = 0;
- fp->_IO_read_base = fp->_IO_read_ptr = fp->_IO_read_end = 0;
- return fp;
-}
-
-_IO_pos_t
-DEFUN(_IO_default_seekpos, (fp, pos, mode),
- _IO_FILE *fp AND _IO_pos_t pos AND int mode)
-{
- return _IO_SEEKOFF (fp, _IO_pos_as_off(pos), 0, mode);
-}
-
-int
-DEFUN(_IO_default_doallocate, (fp),
- _IO_FILE *fp)
-{
- char *buf = ALLOC_BUF(_IO_BUFSIZ);
- if (buf == NULL)
- return EOF;
- _IO_setb(fp, buf, buf+_IO_BUFSIZ, 1);
- return 1;
-}
-
-void
-DEFUN(_IO_init, (fp, flags),
- register _IO_FILE *fp AND int flags)
-{
- fp->_flags = _IO_MAGIC|flags;
- fp->_IO_buf_base = NULL;
- fp->_IO_buf_end = NULL;
- fp->_IO_read_base = NULL;
- fp->_IO_read_ptr = NULL;
- fp->_IO_read_end = NULL;
- fp->_IO_write_base = NULL;
- fp->_IO_write_ptr = NULL;
- fp->_IO_write_end = NULL;
- fp->_chain = NULL; /* Not necessary. */
-
- fp->_IO_save_base = NULL;
- fp->_IO_backup_base = NULL;
- fp->_IO_save_end = NULL;
- fp->_markers = NULL;
- fp->_cur_column = 0;
-}
-
-int
-DEFUN(_IO_default_sync, (fp),
- _IO_FILE *fp)
-{
- return 0;
-}
-
-/* The way the C++ classes are mapped into the C functions in the
- current implementation, this function can get called twice! */
-
-void
-DEFUN(_IO_default_finish, (fp),
- _IO_FILE *fp)
-{
- struct _IO_marker *mark;
- if (fp->_IO_buf_base && !(fp->_flags & _IO_USER_BUF))
- {
- FREE_BUF(fp->_IO_buf_base);
- fp->_IO_buf_base = fp->_IO_buf_end = NULL;
- }
-
- for (mark = fp->_markers; mark != NULL; mark = mark->_next)
- mark->_sbuf = NULL;
-
- if (fp->_IO_save_base)
- {
- free (fp->_IO_save_base);
- fp->_IO_save_base = NULL;
- }
-
- _IO_un_link(fp);
-}
-
-_IO_pos_t
-DEFUN(_IO_default_seekoff, (fp, offset, dir, mode),
- register _IO_FILE *fp AND _IO_off_t offset AND int dir AND int mode)
-{
- return _IO_pos_BAD;
-}
-
-int
-DEFUN(_IO_sputbackc, (fp, c),
- register _IO_FILE *fp AND int c)
-{
- int result;
-
- if (fp->_IO_read_ptr > fp->_IO_read_base
- && (unsigned char)fp->_IO_read_ptr[-1] == (unsigned char)c)
- {
- fp->_IO_read_ptr--;
- result = (unsigned char)c;
- }
- else
- result = _IO_PBACKFAIL (fp, c);
-
- if (result != EOF)
- fp->_flags &= ~_IO_EOF_SEEN;
-
- return result;
-}
-
-int
-DEFUN(_IO_sungetc, (fp),
- register _IO_FILE *fp)
-{
- int result;
-
- if (fp->_IO_read_ptr > fp->_IO_read_base)
- {
- fp->_IO_read_ptr--;
- result = (unsigned char)*fp->_IO_read_ptr;
- }
- else
- result = _IO_PBACKFAIL (fp, EOF);
-
- if (result != EOF)
- fp->_flags &= ~_IO_EOF_SEEN;
-
- return result;
-}
-
-#if 0 /* Work in progress */
-void
-DEFUN(_IO_set_column, (fp, c),
- register _IO_FILE *fp AND int c)
-{
- if (c == -1)
- fp->_column = -1;
- else
- fp->_column = c - (fp->_IO_write_ptr - fp->_IO_write_base);
-}
-#else
-int
-DEFUN(_IO_set_column, (fp, i),
- register _IO_FILE *fp AND int i)
-{
- fp->_cur_column = i+1;
- return 0;
-}
-#endif
-
-
-unsigned
-DEFUN(_IO_adjust_column, (start, line, count),
- unsigned start AND const char *line AND int count)
-{
- register const char *ptr = line + count;
- while (ptr > line)
- if (*--ptr == '\n')
- return line + count - ptr - 1;
- return start + count;
-}
-
-int
-DEFUN(_IO_get_column, (fp),
- register _IO_FILE *fp)
-{
- if (fp->_cur_column)
- return _IO_adjust_column(fp->_cur_column - 1,
- fp->_IO_write_base,
- fp->_IO_write_ptr - fp->_IO_write_base);
- return -1;
-}
-
-int
-DEFUN_VOID(_IO_flush_all)
-{
- int result = 0;
- _IO_FILE *fp;
- for (fp = _IO_list_all; fp != NULL; fp = fp->_chain)
- if (fp->_IO_write_ptr > fp->_IO_write_base
- && _IO_OVERFLOW (fp, EOF) == EOF)
- result = EOF;
- return result;
-}
-
-void
-DEFUN_VOID(_IO_flush_all_linebuffered)
-{
- _IO_FILE *fp;
- for (fp = _IO_list_all; fp != NULL; fp = fp->_chain)
- if (fp->_flags & _IO_LINE_BUF)
- _IO_OVERFLOW (fp, EOF);
-}
-
-void
-DEFUN_VOID(_IO_unbuffer_all)
-{
- _IO_FILE *fp;
- for (fp = _IO_list_all; fp != NULL; fp = fp->_chain)
- if (! (fp->_flags & _IO_UNBUFFERED))
- _IO_SETBUF (fp, NULL, 0);
-}
-
-void
-DEFUN_VOID(_IO_cleanup)
-{
- _IO_flush_all ();
-
- /* We currently don't have a reliable mechanism for making sure that
- C++ static destructors are executed in the correct order.
- So it is possible that other static destructord might want to
- write to cout - and they're supposed to be able to do so.
-
- The following will make the standard streambufs be unbuffered,
- which forces any output from late destructors to be written out. */
- _IO_unbuffer_all ();
-}
-
-void
-DEFUN(_IO_init_marker, (marker, fp),
- struct _IO_marker *marker AND _IO_FILE *fp)
-{
- marker->_sbuf = fp;
- if (_IO_in_put_mode(fp))
- _IO_switch_to_get_mode(fp);
- if (_IO_in_backup(fp))
- marker->_pos = fp->_IO_read_ptr - fp->_IO_read_end;
- else
- marker->_pos = fp->_IO_read_ptr - fp->_IO_read_base;
-
- /* Should perhaps sort the chain? */
- marker->_next = fp->_markers;
- fp->_markers = marker;
-}
-
-void
-DEFUN(_IO_remove_marker, (marker),
- register struct _IO_marker *marker)
-{
- /* Unlink from sb's chain. */
- register struct _IO_marker **ptr = &marker->_sbuf->_markers;
- for (; ; ptr = &(*ptr)->_next)
- {
- if (*ptr == NULL)
- break;
- else if (*ptr == marker)
- {
- *ptr = marker->_next;
- return;
- }
- }
-#if 0
- if _sbuf has a backup area that is no longer needed, should we delete
- it now, or wait until the next underflow?
-#endif
-}
-
-#define BAD_DELTA EOF
-
-int
-DEFUN(_IO_marker_difference, (mark1, mark2),
- struct _IO_marker *mark1 AND struct _IO_marker *mark2)
-{
- return mark1->_pos - mark2->_pos;
-}
-
-/* Return difference between MARK and current posistion of MARK's stream. */
-int
-DEFUN(_IO_marker_delta, (mark),
- struct _IO_marker *mark)
-{
- int cur_pos;
- if (mark->_sbuf == NULL)
- return BAD_DELTA;
- if (_IO_in_backup(mark->_sbuf))
- cur_pos = mark->_sbuf->_IO_read_ptr - mark->_sbuf->_IO_read_end;
- else
- cur_pos = mark->_sbuf->_IO_read_ptr - mark->_sbuf->_IO_read_base;
- return mark->_pos - cur_pos;
-}
-
-int
-DEFUN(_IO_seekmark, (fp, mark, delta),
- _IO_FILE *fp AND struct _IO_marker *mark AND int delta)
-{
- if (mark->_sbuf != fp)
- return EOF;
- if (mark->_pos >= 0)
- {
- if (_IO_in_backup(fp))
- _IO_switch_to_main_get_area(fp);
- fp->_IO_read_ptr = fp->_IO_read_base + mark->_pos;
- }
- else
- {
- if (!_IO_in_backup(fp))
- _IO_switch_to_backup_area(fp);
- fp->_IO_read_ptr = fp->_IO_read_end + mark->_pos;
- }
- return 0;
-}
-
-void
-DEFUN(_IO_unsave_markers, (fp),
- register _IO_FILE *fp)
-{
- register struct _IO_marker *mark = fp->_markers;
- if (mark)
- {
-#ifdef TODO
- streampos offset = seekoff(0, ios::cur, ios::in);
- if (offset != EOF)
- {
- offset += eGptr() - Gbase();
- for ( ; mark != NULL; mark = mark->_next)
- mark->set_streampos(mark->_pos + offset);
- }
- else
- {
- for ( ; mark != NULL; mark = mark->_next)
- mark->set_streampos(EOF);
- }
-#endif
- fp->_markers = 0;
- }
-
- if (_IO_have_backup(fp))
- _IO_free_backup_area(fp);
-}
-
-int
-DEFUN(_IO_nobackup_pbackfail, (fp, c),
- register _IO_FILE *fp AND int c)
-{
- if (fp->_IO_read_ptr > fp->_IO_read_base)
- fp->_IO_read_ptr--;
- if (c != EOF && *fp->_IO_read_ptr != c)
- *fp->_IO_read_ptr = c;
- return (unsigned char)c;
-}
-
-int
-DEFUN(_IO_default_pbackfail, (fp, c),
- register _IO_FILE *fp AND int c)
-{
- if (fp->_IO_read_ptr <= fp->_IO_read_base)
- {
- /* Need to handle a filebuf in write mode (switch to read mode). FIXME!*/
- if (_IO_have_backup(fp) && !_IO_in_backup(fp))
- _IO_switch_to_backup_area(fp);
-
- if (!_IO_have_backup(fp))
- {
- /* No backup buffer: allocate one. */
- /* Use nshort buffer, if unused? (probably not) FIXME */
- int backup_size = 128;
- char *bbuf = (char*)malloc(backup_size);
- if (bbuf == NULL)
- return EOF;
- fp->_IO_save_base = bbuf;
- fp->_IO_save_end = fp->_IO_save_base + backup_size;
- fp->_IO_backup_base = fp->_IO_save_end;
- _IO_switch_to_backup_area(fp);
- }
- else if (fp->_IO_read_ptr <= fp->_IO_read_base)
- {
- /* Increase size of existing backup buffer. */
- _IO_size_t new_size;
- _IO_size_t old_size = fp->_IO_read_end - fp->_IO_read_base;
- char *new_buf;
- new_size = 2 * old_size;
- new_buf = (char*)malloc(new_size);
- if (new_buf == NULL)
- return EOF;
- memcpy(new_buf+(new_size-old_size), fp->_IO_read_base, old_size);
- free (fp->_IO_read_base);
- _IO_setg(fp,
- new_buf, new_buf+(new_size-old_size), new_buf+new_size);
- fp->_IO_backup_base = fp->_IO_read_ptr;
- }
- }
- fp->_IO_read_ptr--;
- if (c != EOF && *fp->_IO_read_ptr != c)
- *fp->_IO_read_ptr = c;
- return (unsigned char)*fp->_IO_read_ptr;
-}
-
-_IO_pos_t
-DEFUN(_IO_default_seek, (fp, offset, dir),
- _IO_FILE *fp AND _IO_off_t offset AND int dir)
-{
- return _IO_pos_BAD;
-}
-
-int
-DEFUN(_IO_default_stat, (fp, st),
- _IO_FILE *fp AND void* st)
-{
- return EOF;
-}
-
-_IO_ssize_t
-DEFUN(_IO_default_read, (fp, data, n),
- register _IO_FILE* fp AND void* data AND _IO_ssize_t n)
-{
- return -1;
-}
-
-_IO_ssize_t
-DEFUN(_IO_default_write, (fp, data, n),
- register _IO_FILE* fp AND const void* data AND _IO_ssize_t n)
-{
- return 0;
-}
-
-
-#ifdef TODO
-#if defined(linux)
-#define IO_CLEANUP ;
-#endif
-
-#ifdef IO_CLEANUP
- IO_CLEANUP
-#else
-struct __io_defs {
- __io_defs() { }
- ~__io_defs() { _IO_cleanup(); }
-};
-__io_defs io_defs__;
-#endif
-
-#endif /* TODO */
diff --git a/contrib/libg++/libio/indstream.cc b/contrib/libg++/libio/indstream.cc
deleted file mode 100644
index 15a1bb2778d3..000000000000
--- a/contrib/libg++/libio/indstream.cc
+++ /dev/null
@@ -1,121 +0,0 @@
-/* This is part of libio/iostream, providing -*- C++ -*- input/output.
-Copyright (C) 1993 Free Software Foundation
-
-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.
-
-Written by Per Bothner (bothner@cygnus.com). */
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-
-#include <indstream.h>
-
-indirectbuf::indirectbuf(streambuf *get, streambuf *put, int delete_mode)
-: streambuf()
-{
- _get_stream = get;
- _put_stream = put == NULL ? get : put;
- _delete_flags = delete_mode;
-}
-
-indirectbuf::~indirectbuf()
-{
- if (_delete_flags & ios::in) delete get_stream();
- if (_delete_flags & ios::out) delete put_stream();
-}
-
-streamsize indirectbuf::xsputn(const char* s, streamsize n)
-{
- return put_stream()->sputn(s, n);
-}
-
-streamsize indirectbuf::xsgetn(char* s, streamsize n)
-{
- return get_stream()->sgetn(s, n);
-}
-
-int indirectbuf::overflow(int c /* = EOF */)
-{
- if (c == EOF)
- return put_stream()->overflow(c);
- else
- return put_stream()->sputc(c);
-}
-
-int indirectbuf::underflow()
-{
- return get_stream()->sgetc();
-}
-
-int indirectbuf::uflow()
-{
- return get_stream()->sbumpc();
-}
-
-streampos indirectbuf::seekoff(streamoff off, _seek_dir dir, int mode)
-{
- int ret_val = 0;
- int select = mode == 0 ? (ios::in|ios::out) : mode;
- streambuf *gbuf = (select & ios::in) ? get_stream() : (streambuf*)NULL;
- streambuf *pbuf = (select & ios::out) ? put_stream() : (streambuf*)NULL;
- if (gbuf == pbuf)
- ret_val = gbuf->seekoff(off, dir, mode);
- else {
- if (gbuf)
- ret_val = gbuf->seekoff(off, dir, ios::in);
- if (pbuf && ret_val != EOF)
- ret_val = pbuf->seekoff(off, dir, ios::out);
- }
- return ret_val;
-}
-
-streampos indirectbuf::seekpos(streampos pos, int mode)
-{
- int ret_val = EOF;
- int select = mode == 0 ? (ios::in|ios::out) : mode;
- streambuf *gbuf = (select & ios::in) ? get_stream() : (streambuf*)NULL;
- streambuf *pbuf = (select & ios::out) ? put_stream() : (streambuf*)NULL;
- if (gbuf == pbuf && gbuf != NULL)
- ret_val = gbuf->seekpos(pos, mode);
- else {
- if (gbuf)
- ret_val = gbuf->seekpos(pos, ios::in);
- if (pbuf && ret_val != EOF)
- ret_val = pbuf->seekpos(pos, ios::out);
- }
- return ret_val;
-}
-
-int indirectbuf::sync()
-{
- streambuf *gbuf = get_stream();
- int get_ret_val = gbuf ? gbuf->sync() : 0;
- streambuf *pbuf = put_stream();
- int put_ret_val = (pbuf && pbuf != gbuf) ? pbuf->sync() : 0;
- return get_ret_val || put_ret_val;
-}
-
-int indirectbuf::pbackfail(int c)
-{
- return get_stream()->sputbackc(c);
-}
diff --git a/contrib/libg++/libio/indstream.h b/contrib/libg++/libio/indstream.h
deleted file mode 100644
index c4558623d079..000000000000
--- a/contrib/libg++/libio/indstream.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/* This is part of libio/iostream, providing -*- C++ -*- input/output.
-Copyright (C) 1993 Free Software Foundation
-
-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.
-
-Written by Per Bothner (bothner@cygnus.com). */
-
-#ifndef _INDSTREAM_H
-#define _INDSTREAM_H
-
-#ifdef __GNUG__
-#pragma interface
-#endif
-
-#include <iostream.h>
-
-extern "C++" {
-// An indirectbuf is one that forwards all of its I/O requests
-// to another streambuf.
-// All get-related requests are sent to get_stream().
-// All put-related requests are sent to put_stream().
-
-// An indirectbuf can be used to implement Common Lisp
-// synonym-streams and two-way-streams.
-//
-// class synonymbuf : public indirectbuf {
-// Symbol *sym;
-// synonymbuf(Symbol *s) { sym = s; }
-// virtual streambuf *lookup_stream(int mode) {
-// return coerce_to_streambuf(lookup_value(sym)); }
-// };
-
-class indirectbuf : public streambuf {
- protected:
- streambuf *_get_stream; // Optional cache for get_stream().
- streambuf *_put_stream; // Optional cache for put_stream().
- int _delete_flags;
- public:
- streambuf *get_stream()
- { return _get_stream ? _get_stream : lookup_stream(ios::in); }
- streambuf *put_stream()
- { return _put_stream ? _put_stream : lookup_stream(ios::out); }
- virtual streambuf *lookup_stream(int/*mode*/) { return NULL; } // ERROR!
- indirectbuf(streambuf *get=NULL, streambuf *put=NULL, int delete_mode=0);
- virtual ~indirectbuf();
- virtual streamsize xsputn(const char* s, streamsize n);
- virtual streamsize xsgetn(char* s, streamsize n);
- virtual int underflow();
- virtual int uflow();
- virtual int overflow(int c = EOF);
- virtual streampos seekoff(streamoff, _seek_dir, int mode=ios::in|ios::out);
- virtual streampos seekpos(streampos pos, int mode = ios::in|ios::out);
- virtual int sync();
- virtual int pbackfail(int c);
-};
-} // extern "C++"
-
-#endif /* !_INDSTREAM_H */
diff --git a/contrib/libg++/libio/ioassign.cc b/contrib/libg++/libio/ioassign.cc
deleted file mode 100644
index 5b8e68bbf539..000000000000
--- a/contrib/libg++/libio/ioassign.cc
+++ /dev/null
@@ -1,49 +0,0 @@
-/* This is part of libio/iostream, providing -*- C++ -*- input/output.
-Copyright (C) 1994 Free Software Foundation
-
-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. */
-
-/* Written by Per Bothner (bothner@cygnus.com). */
-
-#include <iostream.h>
-#include "libioP.h"
-
-// These method are provided for backward compatibility reasons.
-// It's generally poor style to use them.
-// They are not supported by the ANSI/ISO working paper.
-
-_IO_istream_withassign& _IO_istream_withassign::operator=(istream& rhs)
-{
- if (&rhs != (istream*)this)
- {
- init (rhs.rdbuf ());
- _gcount = 0;
- }
- return *this;
-}
-
-_IO_ostream_withassign& _IO_ostream_withassign::operator=(ostream& rhs)
-{
- if (&rhs != (ostream*)this)
- init (rhs.rdbuf ());
- return *this;
-}
diff --git a/contrib/libg++/libio/ioextend.cc b/contrib/libg++/libio/ioextend.cc
deleted file mode 100644
index e0ec0cb64998..000000000000
--- a/contrib/libg++/libio/ioextend.cc
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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 <iostream.h>
-
-static int __xalloc = 0;
-
-int ios::xalloc()
-{
- return __xalloc++;
-}
-
-static ios::fmtflags __used_fmt_flags
-= ios::skipws | ios::left | ios::right | ios::internal
-| ios::dec | ios::oct | ios::hex | ios::showbase | ios::showpoint
-| ios::uppercase | ios::showpos | ios::scientific | ios::fixed
-#ifndef _IO_NEW_STREAMS
-| ios::dont_close
-#endif
-| ios::unitbuf | ios::stdio;
-
-ios::fmtflags ios::bitalloc()
-{
- fmtflags bit_to_try = (fmtflags)1;
- for (; bit_to_try; bit_to_try <<= 1)
- {
- if ((__used_fmt_flags & bit_to_try) == 0)
- {
- __used_fmt_flags |= bit_to_try;
- return bit_to_try;
- }
- }
- return 0;
-}
-
-// NOTE: This implementation of ios::iword and ios::pword assumes
-// that these methods are seldom used, so we want to minimize
-// the space and time overhead when NOT using these methods.
-//
-// ANSI specifies two conceptually-infinite arrays, one whose
-// elements are longs, and one whose elements are (void*)s.
-// We implement this as a single array, each of whose element is
-// a (struct ptr_and_long), which has space for both a long and a void*.
-// We also specify that (the i field of) the 0'th element of the array
-// contains the allocated length of the array (not counting that
-// initial element).
-
-struct ptr_and_long {
- void *p;
- long i;
-};
-
-static struct ptr_and_long&
-get_array_element(ios& io, int index)
-{
- if (index < 0)
- io._throw_failure();
- register struct ptr_and_long *array = (ptr_and_long*)io._arrays;
- int old_length = array == NULL ? 0 : array[0].i;
- if (index >= old_length)
- {
- register int i;
- int new_length = index + 10;
- register struct ptr_and_long *new_array
- = new ptr_and_long[1 + new_length];
- if (array != NULL)
- {
- for (i = 1; i <= old_length; i++)
- new_array[i] = array[i];
- delete [] array;
- }
- for (i = old_length + 1; i <= new_length; i++)
- {
- new_array[i].i = 0;
- new_array[i].p = (void*)0;
- }
- new_array[0].i = new_length;
- new_array[0].p = (void*)0;
- io._arrays = (void*)new_array;
- array = new_array;
- }
- return array[index+1];
-}
-
-long& ios::iword(int index)
-{
- return get_array_element(*this, index).i;
-}
-
-void*& ios::pword(int index)
-{
- return get_array_element(*this, index).p;
-}
-
-long ios::iword(int index) const
-{
- if (index < 0)
- _throw_failure();
- register struct ptr_and_long *pl_array = (ptr_and_long*)_arrays;
- int len = pl_array == NULL ? 0 : pl_array[0].i;
- return index >= len ? 0 : pl_array[index+1].i;
-}
-
-void* ios::pword(int index) const
-{
- if (index < 0)
- _throw_failure();
- register struct ptr_and_long *pl_array = (ptr_and_long*)_arrays;
- int len = pl_array == NULL ? 0 : pl_array[0].i;
- return index >= len ? 0 : pl_array[index+1].p;
-}
diff --git a/contrib/libg++/libio/iofclose.c b/contrib/libg++/libio/iofclose.c
deleted file mode 100644
index f3ae0964e826..000000000000
--- a/contrib/libg++/libio/iofclose.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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"
-#ifdef __STDC__
-#include <stdlib.h>
-#endif
-
-int
-DEFUN(_IO_fclose, (fp),
- register _IO_FILE *fp)
-{
- int status;
- CHECK_FILE(fp, EOF);
- if (fp->_IO_file_flags & _IO_IS_FILEBUF)
- status = _IO_file_close_it(fp);
- else
- status = fp->_flags & _IO_ERR_SEEN ? -1 : 0;
- _IO_FINISH (fp);
- if (fp != _IO_stdin && fp != _IO_stdout && fp != _IO_stderr)
- {
- fp->_IO_file_flags = 0;
- free(fp);
- }
- return status;
-}
diff --git a/contrib/libg++/libio/iofdopen.c b/contrib/libg++/libio/iofdopen.c
deleted file mode 100644
index f8bc76869ad9..000000000000
--- a/contrib/libg++/libio/iofdopen.c
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
-Copyright (C) 1993, 1994 Free Software Foundation
-
-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. */
-
-#ifdef __STDC__
-#include <stdlib.h>
-#endif
-#include "libioP.h"
-#include <fcntl.h>
-
-#ifndef _IO_fcntl
-#define _IO_fcntl fcntl
-#endif
-
-_IO_FILE *
-DEFUN(_IO_fdopen, (fd, mode),
- int fd AND const char *mode)
-{
- int read_write;
- int posix_mode = 0;
- struct _IO_FILE_plus *fp;
- int fd_flags;
-
- switch (*mode++)
- {
- case 'r':
- read_write = _IO_NO_WRITES;
- break;
- case 'w':
- read_write = _IO_NO_READS;
- break;
- case 'a':
- posix_mode = O_APPEND;
- read_write = _IO_NO_READS|_IO_IS_APPENDING;
- break;
- default:
-#ifdef EINVAL
- errno = EINVAL;
-#endif
- return NULL;
- }
- if (mode[0] == '+' || (mode[0] == 'b' && mode[1] == '+'))
- read_write &= _IO_IS_APPENDING;
-#ifdef F_GETFL
- fd_flags = _IO_fcntl (fd, F_GETFL);
-#ifndef O_ACCMODE
-#define O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR)
-#endif
- if (fd_flags == -1
- || ((fd_flags & O_ACCMODE) == O_RDONLY && !(read_write & _IO_NO_WRITES))
- || ((fd_flags & O_ACCMODE) == O_WRONLY && !(read_write & _IO_NO_READS)))
- return NULL;
-
- /* The May 93 draft of P1003.4/D14.1 (redesignated as 1003.1b)
- [System Application Program Interface (API) Amendment 1:
- Realtime Extensions], Rationale B.8.3.3
- Open a Stream on a File Descriptor says:
-
- Although not explicitly required by POSIX.1, a good
- implementation of append ("a") mode would cause the
- O_APPEND flag to be set.
-
- (Historical implementations [such as Solaris2] do a one-time
- seek in fdopen.)
-
- However, we do not turn O_APPEND off if the mode is "w" (even
- though that would seem consistent) because that would be more
- likely to break historical programs.
- */
- if ((posix_mode & O_APPEND) && !(fd_flags & O_APPEND))
- {
-#ifdef F_SETFL
- if (_IO_fcntl (fd, F_SETFL, fd_flags | O_APPEND) == -1)
-#endif
- return NULL;
- }
-#endif
-
- fp = (struct _IO_FILE_plus*)malloc(sizeof(struct _IO_FILE_plus));
- if (fp == NULL)
- return NULL;
- _IO_init(&fp->file, 0);
- _IO_JUMPS(&fp->file) = &_IO_file_jumps;
- _IO_file_init(&fp->file);
-#if !_IO_UNIFIED_JUMPTABLES
- fp->vtable = NULL;
-#endif
- if (_IO_file_attach(&fp->file, fd) == NULL)
- {
- _IO_un_link(&fp->file);
- free (fp);
- return NULL;
- }
- fp->file._flags &= ~_IO_DELETE_DONT_CLOSE;
-
- fp->file._IO_file_flags =
- _IO_mask_flags(&fp->file, read_write,
- _IO_NO_READS+_IO_NO_WRITES+_IO_IS_APPENDING);
-
- return (_IO_FILE*)fp;
-}
diff --git a/contrib/libg++/libio/iofflush.c b/contrib/libg++/libio/iofflush.c
deleted file mode 100644
index ecb816d41986..000000000000
--- a/contrib/libg++/libio/iofflush.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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"
-
-int
-DEFUN(_IO_fflush, (fp),
- register _IO_FILE *fp)
-{
- if (fp == NULL)
- return _IO_flush_all();
- else
- {
- CHECK_FILE(fp, EOF);
- return _IO_SYNC (fp) ? EOF : 0;
- }
-}
diff --git a/contrib/libg++/libio/iofgetpos.c b/contrib/libg++/libio/iofgetpos.c
deleted file mode 100644
index 5e7a8632102a..000000000000
--- a/contrib/libg++/libio/iofgetpos.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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 <errno.h>
-/* ANSI explicily requires setting errno to a positive value on failure. */
-
-int
-DEFUN(_IO_fgetpos, (fp, posp),
- _IO_FILE* fp AND _IO_fpos_t *posp)
-{
- _IO_fpos_t pos;
- CHECK_FILE(fp, EOF);
- pos = _IO_seekoff(fp, 0, _IO_seek_cur, 0);
- if (pos == _IO_pos_BAD)
- {
-#ifdef EIO
- if (errno == 0)
- errno = EIO;
-#endif
- return EOF;
- }
- *posp = pos;
- return 0;
-}
diff --git a/contrib/libg++/libio/iofgets.c b/contrib/libg++/libio/iofgets.c
deleted file mode 100644
index 7b0b708a2083..000000000000
--- a/contrib/libg++/libio/iofgets.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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"
-
-char*
-DEFUN(_IO_fgets, (buf, n, fp),
- char* buf AND int n AND _IO_FILE* fp)
-{
- _IO_size_t count;
- CHECK_FILE(fp, NULL);
- if (n <= 0)
- return NULL;
- count = _IO_getline(fp, buf, n - 1, '\n', 1);
- if (count == 0 || (fp->_IO_file_flags & _IO_ERR_SEEN))
- return NULL;
- buf[count] = 0;
- return buf;
-}
diff --git a/contrib/libg++/libio/iofopen.c b/contrib/libg++/libio/iofopen.c
deleted file mode 100644
index 96910520ce73..000000000000
--- a/contrib/libg++/libio/iofopen.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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"
-#ifdef __STDC__
-#include <stdlib.h>
-#endif
-
-_IO_FILE *
-DEFUN(_IO_fopen, (filename, mode),
- const char *filename AND const char *mode)
-{
- struct _IO_FILE_plus *fp =
- (struct _IO_FILE_plus*)malloc(sizeof(struct _IO_FILE_plus));
- if (fp == NULL)
- return NULL;
- _IO_init(&fp->file, 0);
- _IO_JUMPS(&fp->file) = &_IO_file_jumps;
- _IO_file_init(&fp->file);
-#if !_IO_UNIFIED_JUMPTABLES
- fp->vtable = NULL;
-#endif
- if (_IO_file_fopen(&fp->file, filename, mode) != NULL)
- return (_IO_FILE*)fp;
- _IO_un_link(&fp->file);
- free (fp);
- return NULL;
-}
diff --git a/contrib/libg++/libio/iofprintf.c b/contrib/libg++/libio/iofprintf.c
deleted file mode 100644
index 11c76421809f..000000000000
--- a/contrib/libg++/libio/iofprintf.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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"
-
-#ifdef __STDC__
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
-
-int
-_IO_fprintf
-#ifdef __STDC__
- (_IO_FILE *fp, const char* format, ...)
-#else
-(fp, format, va_alist) _IO_FILE *fp; char *format; va_dcl
-#endif
-{
- int ret;
- va_list args;
- CHECK_FILE(fp, -1);
- _IO_va_start(args, format);
- ret = _IO_vfprintf(fp, format, args);
- va_end(args);
- return ret;
-}
diff --git a/contrib/libg++/libio/iofputs.c b/contrib/libg++/libio/iofputs.c
deleted file mode 100644
index 7a2580f7e356..000000000000
--- a/contrib/libg++/libio/iofputs.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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 <string.h>
-
-int
-DEFUN(_IO_fputs, (str, fp),
- const char *str AND _IO_FILE *fp)
-{
- _IO_size_t len = strlen(str);
- CHECK_FILE(fp, EOF);
- if (_IO_sputn(fp, str, len) != len)
- return EOF;
- return 1;
-}
diff --git a/contrib/libg++/libio/iofread.c b/contrib/libg++/libio/iofread.c
deleted file mode 100644
index 8516cf30c147..000000000000
--- a/contrib/libg++/libio/iofread.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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"
-
-_IO_size_t
-DEFUN(_IO_fread, (buf, size, count, fp),
- void *buf AND _IO_size_t size AND _IO_size_t count AND _IO_FILE* fp)
-{
- _IO_size_t bytes_requested = size*count;
- _IO_size_t bytes_read;
- CHECK_FILE(fp, 0);
- if (bytes_requested == 0)
- return 0;
- bytes_read = _IO_sgetn(fp, (char *)buf, bytes_requested);
- return bytes_requested == bytes_read ? count : bytes_read / size;
-}
diff --git a/contrib/libg++/libio/iofscanf.c b/contrib/libg++/libio/iofscanf.c
deleted file mode 100644
index 3e12d9b5315c..000000000000
--- a/contrib/libg++/libio/iofscanf.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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"
-
-#ifdef __STDC__
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
-
-int
-_IO_fscanf
-#ifdef __STDC__
- (_IO_FILE *fp, const char* format, ...)
-#else
-(fp, format, va_alist) _IO_FILE *fp; char *format; va_dcl
-#endif
-{
- int ret;
- va_list args;
- CHECK_FILE(fp, EOF);
- _IO_va_start(args, format);
- ret = _IO_vfscanf(fp, format, args, NULL);
- va_end(args);
- return ret;
-}
diff --git a/contrib/libg++/libio/iofsetpos.c b/contrib/libg++/libio/iofsetpos.c
deleted file mode 100644
index ac8a3deb12d1..000000000000
--- a/contrib/libg++/libio/iofsetpos.c
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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 <errno.h>
-
-int
-DEFUN(_IO_fsetpos, (fp, posp),
- _IO_FILE* fp AND const _IO_fpos_t *posp)
-{
- CHECK_FILE(fp, EOF);
- if (_IO_seekpos(fp, *posp, _IOS_INPUT|_IOS_OUTPUT) == _IO_pos_BAD)
- {
- /*ANSI explicily requires setting errno to a positive value on failure.*/
-#ifdef EIO
- if (errno == 0)
- errno = EIO;
-#endif
- return EOF;
- }
- return 0;
-}
diff --git a/contrib/libg++/libio/ioftell.c b/contrib/libg++/libio/ioftell.c
deleted file mode 100644
index d49ddaac8213..000000000000
--- a/contrib/libg++/libio/ioftell.c
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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 <errno.h>
-/* ANSI explicily requires setting errno to a positive value on failure. */
-
-long int
-DEFUN(_IO_ftell, (fp),
- _IO_FILE* fp)
-{
- _IO_pos_t pos;
- CHECK_FILE(fp, -1L);
- pos = _IO_seekoff(fp, 0, _IO_seek_cur, 0);
- if (pos == _IO_pos_BAD)
- {
-#ifdef EIO
- if (errno == 0)
- errno = EIO;
-#endif
- return -1L;
- }
- return _IO_pos_as_off(pos);
-}
diff --git a/contrib/libg++/libio/iofwrite.c b/contrib/libg++/libio/iofwrite.c
deleted file mode 100644
index eb3cd32b028a..000000000000
--- a/contrib/libg++/libio/iofwrite.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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"
-
-_IO_size_t
-DEFUN(_IO_fwrite, (buf, size, count, fp),
- const void* buf AND _IO_size_t size AND _IO_size_t count
- AND _IO_FILE *fp)
-{
- _IO_size_t request = size*count;
- _IO_size_t written;
- CHECK_FILE(fp, 0);
- if (request == 0)
- return 0;
- written = _IO_sputn(fp, (const char *)buf, request);
- /* Many traditional implementations return 0 if size==0 && count > 0,
- but ANSI seems to require us to return count in this case. */
- if (written == request)
- return count;
- else
- return written/size;
-}
diff --git a/contrib/libg++/libio/iogetdelim.c b/contrib/libg++/libio/iogetdelim.c
deleted file mode 100644
index ee6c0bf1f197..000000000000
--- a/contrib/libg++/libio/iogetdelim.c
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
-Copyright (C) 1994 Free Software Foundation
-
-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. */
-
-#ifdef __STDC__
-#include <stdlib.h>
-#endif
-#include "libioP.h"
-#include <string.h>
-#include <errno.h>
-
-/* Read up to (and including) a TERMINATOR from FP into *LINEPTR
- (and null-terminate it). *LINEPTR is a pointer returned from malloc (or
- NULL), pointing to *N characters of space. It is realloc'ed as
- necessary. Returns the number of characters read (not including the
- null terminator), or -1 on error or EOF. */
-
-_IO_ssize_t
-DEFUN(_IO_getdelim, (lineptr, n, delimiter, fp),
- char **lineptr AND _IO_size_t *n AND int delimiter AND _IO_FILE *fp)
-{
- register _IO_ssize_t cur_len = 0;
- _IO_ssize_t len;
-
- if (lineptr == NULL || n == NULL)
- {
-#ifdef EINVAL
- errno = EINVAL;
-#endif
- return -1;
- }
- CHECK_FILE (fp, -1);
- if (_IO_ferror (fp))
- return -1;
-
- if (*lineptr == NULL || *n == 0)
- {
- *n = 120;
- *lineptr = (char *) malloc (*n);
- if (*lineptr == NULL)
- return -1;
- }
-
- len = fp->_IO_read_end - fp->_IO_read_ptr;
- if (len <= 0)
- {
- if (__underflow (fp) == EOF)
- return -1;
- len = fp->_IO_read_end - fp->_IO_read_ptr;
- }
-
- for (;;)
- {
- _IO_size_t needed;
- char *t;
- t = (char *) memchr ((void *) fp->_IO_read_ptr, delimiter, len);
- if (t != NULL)
- len = (t - fp->_IO_read_ptr) + 1;
- /* make enough space for len+1 (for final NUL) bytes. */
- needed = cur_len + len + 1;
- if (needed > *n)
- {
- if (t == NULL && needed < 2 * *n)
- needed = 2 * *n; /* Be generous. */
- *n = needed;
- *lineptr = (char *) realloc (*lineptr, needed);
- if (*lineptr == NULL)
- return -1;
- }
- memcpy (*lineptr + cur_len, (void *) fp->_IO_read_ptr, len);
- fp->_IO_read_ptr += len;
- cur_len += len;
- if (t != NULL || __underflow (fp) == EOF)
- break;
- len = fp->_IO_read_end - fp->_IO_read_ptr;
- }
- (*lineptr)[cur_len] = '\0';
- return cur_len;
-}
diff --git a/contrib/libg++/libio/iogetline.c b/contrib/libg++/libio/iogetline.c
deleted file mode 100644
index 278905d135d3..000000000000
--- a/contrib/libg++/libio/iogetline.c
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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 <string.h>
-
-/* Algorithm based on that used by Berkeley pre-4.4 fgets implementation.
-
- Read chars into buf (of size n), until delim is seen.
- Return number of chars read (at most n).
- Does not put a terminating '\0' in buf.
- If extract_delim < 0, leave delimiter unread.
- If extract_delim > 0, insert delim in output. */
-
-_IO_size_t
-DEFUN(_IO_getline, (fp, buf, n, delim, extract_delim),
- _IO_FILE *fp AND char* buf AND _IO_size_t n
- AND int delim AND int extract_delim)
-{
- register char *ptr = buf;
- do
- {
- _IO_ssize_t len = fp->_IO_read_end - fp->_IO_read_ptr;
- char *t;
- if (len <= 0)
- if (__underflow(fp) == EOF)
- break;
- else
- len = fp->_IO_read_end - fp->_IO_read_ptr;
- if (len >= n)
- len = n;
- t = (char*)memchr((void*)fp->_IO_read_ptr, delim, len);
- if (t != NULL)
- {
- _IO_size_t old_len = ptr-buf;
- len = t - fp->_IO_read_ptr;
- if (extract_delim >= 0)
- {
- t++;
- if (extract_delim > 0)
- len++;
- }
- memcpy((void*)ptr, (void*)fp->_IO_read_ptr, len);
- fp->_IO_read_ptr = t;
- return old_len + len;
- }
- memcpy((void*)ptr, (void*)fp->_IO_read_ptr, len);
- fp->_IO_read_ptr += len;
- ptr += len;
- n -= len;
- } while (n != 0);
- return ptr - buf;
-}
diff --git a/contrib/libg++/libio/iogets.c b/contrib/libg++/libio/iogets.c
deleted file mode 100644
index f45d9c16e3fd..000000000000
--- a/contrib/libg++/libio/iogets.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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 <limits.h>
-
-char*
-DEFUN(_IO_gets, (buf),
- char* buf)
-{
- _IO_size_t count;
- int ch = _IO_getc (_IO_stdin);
- if (ch == EOF)
- return NULL;
- if (ch == '\n')
- count = 0;
- else
- {
- buf[0] = (char)ch;
- count = _IO_getline(_IO_stdin, buf + 1, INT_MAX, '\n', 0) + 1;
- if (_IO_stdin->_IO_file_flags & _IO_ERR_SEEN)
- return NULL;
- }
- buf[count] = 0;
- return buf;
-}
diff --git a/contrib/libg++/libio/ioignore.c b/contrib/libg++/libio/ioignore.c
deleted file mode 100644
index a7c2f286755f..000000000000
--- a/contrib/libg++/libio/ioignore.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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"
-
-int
-DEFUN(_IO_ignore, (fp, n),
- register _IO_FILE *fp AND _IO_size_t n)
-{
- register _IO_size_t more = n;
- for (;;)
- {
- _IO_ssize_t count = fp->_IO_read_end - fp->_IO_read_ptr;
- if (count > 0)
- {
- if (count > more)
- count = more;
- fp->_IO_read_ptr += count;
- more -= count;
- }
- if (more == 0 || __underflow(fp) == EOF)
- break;
- }
- return n - more;
-}
diff --git a/contrib/libg++/libio/iolibio.h b/contrib/libg++/libio/iolibio.h
deleted file mode 100644
index e5de77ea85c3..000000000000
--- a/contrib/libg++/libio/iolibio.h
+++ /dev/null
@@ -1,53 +0,0 @@
-#include "libio.h"
-
-/* These emulate stdio functionality, but with a different name
- (_IO_ungetc instead of ungetc), and using _IO_FILE instead of FILE. */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern int _IO_fclose __P((_IO_FILE*));
-extern _IO_FILE *_IO_fdopen __P((int, const char*));
-extern int _IO_fflush __P((_IO_FILE*));
-extern int _IO_fgetpos __P((_IO_FILE*, _IO_fpos_t*));
-extern char* _IO_fgets __P((char*, int, _IO_FILE*));
-extern _IO_FILE *_IO_fopen __P((const char*, const char*));
-extern int _IO_fprintf __P((_IO_FILE*, const char*, ...));
-extern int _IO_fputs __P((const char*, _IO_FILE*));
-extern int _IO_fsetpos __P((_IO_FILE*, const _IO_fpos_t *));
-extern long int _IO_ftell __P((_IO_FILE*));
-extern _IO_size_t _IO_fread __P((void*, _IO_size_t, _IO_size_t, _IO_FILE*));
-extern _IO_size_t _IO_fwrite __P((const void*,
- _IO_size_t, _IO_size_t, _IO_FILE*));
-extern char* _IO_gets __P((char*));
-extern void _IO_perror __P((const char*));
-extern int _IO_printf __P((const char*, ...));
-extern int _IO_puts __P((const char*));
-extern int _IO_scanf __P((const char*, ...));
-extern void _IO_setbuffer __P((_IO_FILE *, char*, _IO_size_t));
-extern int _IO_setvbuf __P((_IO_FILE*, char*, int, _IO_size_t));
-extern int _IO_sscanf __P((const char*, const char*, ...));
-extern int _IO_sprintf __P((char *, const char*, ...));
-extern int _IO_ungetc __P((int, _IO_FILE*));
-extern int _IO_vsscanf __P((const char *, const char *, _IO_va_list));
-extern int _IO_vsprintf __P((char*, const char*, _IO_va_list));
-#ifndef _IO_pos_BAD
-#define _IO_pos_BAD ((_IO_fpos_t)(-1))
-#endif
-#define _IO_clearerr(FP) ((FP)->_flags &= ~(_IO_ERR_SEEN|_IO_EOF_SEEN))
-#define _IO_fseek(__fp, __offset, __whence) \
- (_IO_seekoff(__fp, __offset, __whence, _IOS_INPUT|_IOS_OUTPUT) == _IO_pos_BAD ? EOF : 0)
-#define _IO_rewind(FILE) (void)_IO_seekoff(FILE, 0, 0, _IOS_INPUT|_IOS_OUTPUT)
-#define _IO_vprintf(FORMAT, ARGS) _IO_vfprintf(_IO_stdout, FORMAT, ARGS)
-#define _IO_freopen(FILENAME, MODE, FP) \
- (_IO_file_close_it(FP), _IO_file_fopen(FP, FILENAME, MODE))
-#define _IO_fileno(FP) ((FP)->_fileno)
-extern _IO_FILE* _IO_popen __P((const char*, const char*));
-#define _IO_pclose _IO_fclose
-#define _IO_setbuf(_FP, _BUF) _IO_setbuffer(_FP, _BUF, _IO_BUFSIZ)
-#define _IO_setlinebuf(_FP) _IO_setvbuf(_FP, NULL, 1, 0)
-
-#ifdef __cplusplus
-}
-#endif
diff --git a/contrib/libg++/libio/iomanip.cc b/contrib/libg++/libio/iomanip.cc
deleted file mode 100644
index fddba55a2b98..000000000000
--- a/contrib/libg++/libio/iomanip.cc
+++ /dev/null
@@ -1,90 +0,0 @@
-/* This is part of libio/iostream, providing -*- C++ -*- input/output.
-Copyright (C) 1993 Free Software Foundation
-
-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. */
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-
-#include "iomanip.h"
-
-
-// Those functions are called through a pointer,
-// thus it does not make sense, to inline them.
-
-ios & __iomanip_setbase (ios& i, int n)
-{
- ios::fmtflags b;
- switch (n)
- {
- case 8:
- b = ios::oct; break;
- case 10:
- b = ios::dec; break;
- case 16:
- b = ios::hex; break;
- default:
- b = 0;
- }
- i.setf(b, ios::basefield);
- return i;
-}
-
-ios & __iomanip_setfill (ios& i, int n)
-{
- //FIXME if ( i.flags() & ios::widechar )
- i.fill( (char) n);
- //FIXME else
- //FIXME i.fill( (wchar) n);
- return i;
-}
-
-ios & __iomanip_setprecision (ios& i, int n)
-{
- i.precision(n);
- return i;
-}
-ios & __iomanip_setw (ios& i, int n)
-{
- i.width(n);
- return i;
-}
-
-ios & __iomanip_setiosflags (ios& i, ios::fmtflags n)
-{
- i.setf(n,n);
- return i;
-}
-
-ios & __iomanip_resetiosflags (ios& i, ios::fmtflags n)
-{
- i.setf(0,n);
- return i;
-}
-
-template class smanip<int>;
-template class smanip<ios::fmtflags>;
-template istream& operator>>(istream&, const smanip<int>&);
-template istream& operator>>(istream&, const smanip<ios::fmtflags>&);
-template ostream& operator<<(ostream&, const smanip<int>&);
-template ostream& operator<<(ostream&, const smanip<ios::fmtflags>&);
diff --git a/contrib/libg++/libio/iomanip.h b/contrib/libg++/libio/iomanip.h
deleted file mode 100644
index fe1156569b47..000000000000
--- a/contrib/libg++/libio/iomanip.h
+++ /dev/null
@@ -1,165 +0,0 @@
-/* This is part of libio/iostream, providing -*- C++ -*- input/output.
-Copyright (C) 1993 Free Software Foundation
-
-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. */
-
-#ifndef _IOMANIP_H
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _IOMANIP_H
-
-#include <iostream.h>
-
-extern "C++" {
-//-----------------------------------------------------------------------------
-// Parametrized Manipulators as specified by ANSI draft
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// Stream Manipulators
-//-----------------------------------------------------------------------------
-//
-template<class TP> class smanip; // TP = Type Param
-
-template<class TP> class sapp {
- ios& (*_f)(ios&, TP);
-public:
- sapp(ios& (*f)(ios&, TP)) : _f(f) {}
- //
- smanip<TP> operator()(TP a)
- { return smanip<TP>(_f, a); }
-};
-
-template <class TP> class smanip {
- ios& (*_f)(ios&, TP);
- TP _a;
-public:
- smanip(ios& (*f)(ios&, TP), TP a) : _f(f), _a(a) {}
- //
- friend
- istream& operator>>(istream& i, const smanip<TP>& m);
- friend
- ostream& operator<<(ostream& o, const smanip<TP>& m);
-};
-
-#ifdef __GNUG__
-extern template class smanip<int>;
-extern template class smanip<ios::fmtflags>;
-#endif
-
-template<class TP>
-inline istream& operator>>(istream& i, const smanip<TP>& m)
-{ (*m._f)(i, m._a); return i; }
-
-template<class TP>
-inline ostream& operator<<(ostream& o, const smanip<TP>& m)
-{ (*m._f)(o, m._a); return o;}
-
-#ifdef __GNUG__
-extern template istream& operator>>(istream&, const smanip<int>&);
-extern template istream& operator>>(istream&, const smanip<ios::fmtflags>&);
-extern template ostream& operator<<(ostream&, const smanip<int>&);
-extern template ostream& operator<<(ostream&, const smanip<ios::fmtflags>&);
-#endif
-
-//-----------------------------------------------------------------------------
-// Input-Stream Manipulators
-//-----------------------------------------------------------------------------
-//
-template<class TP> class imanip;
-
-template<class TP> class iapp {
- istream& (*_f)(istream&, TP);
-public:
- iapp(istream& (*f)(istream&,TP)) : _f(f) {}
- //
- imanip<TP> operator()(TP a)
- { return imanip<TP>(_f, a); }
-};
-
-template <class TP> class imanip {
- istream& (*_f)(istream&, TP);
- TP _a;
-public:
- imanip(istream& (*f)(istream&, TP), TP a) : _f(f), _a(a) {}
- //
- friend
- istream& operator>>(istream& i, const imanip<TP>& m);
-};
-
-template <class TP>
-inline istream& operator>>(istream& i, const imanip<TP>& m)
-{ return (*m._f)( i, m._a); }
-
-//-----------------------------------------------------------------------------
-// Output-Stream Manipulators
-//-----------------------------------------------------------------------------
-//
-template<class TP> class omanip;
-
-template<class TP> class oapp {
- ostream& (*_f)(ostream&, TP);
-public:
- oapp(ostream& (*f)(ostream&,TP)) : _f(f) {}
- //
- omanip<TP> operator()(TP a)
- { return omanip<TP>(_f, a); }
-};
-
-template <class TP> class omanip {
- ostream& (*_f)(ostream&, TP);
- TP _a;
-public:
- omanip(ostream& (*f)(ostream&, TP), TP a) : _f(f), _a(a) {}
- //
- friend
- ostream& operator<<(ostream& o, const omanip<TP>& m);
-};
-
-template <class TP>
-inline ostream& operator<<(ostream& o, const omanip<TP>& m)
-{ return (*m._f)(o, m._a); }
-
-//-----------------------------------------------------------------------------
-// Available Manipulators
-//-----------------------------------------------------------------------------
-
-//
-// Macro to define an iomanip function, with one argument
-// The underlying function is `__iomanip_<name>'
-//
-#define __DEFINE_IOMANIP_FN1(type,param,function) \
- extern ios& __iomanip_##function (ios&, param); \
- inline type<param> function (param n) \
- { return type<param> (__iomanip_##function, n); }
-
-__DEFINE_IOMANIP_FN1( smanip, int, setbase)
-__DEFINE_IOMANIP_FN1( smanip, int, setfill)
-__DEFINE_IOMANIP_FN1( smanip, int, setprecision)
-__DEFINE_IOMANIP_FN1( smanip, int, setw)
-
-__DEFINE_IOMANIP_FN1( smanip, ios::fmtflags, resetiosflags)
-__DEFINE_IOMANIP_FN1( smanip, ios::fmtflags, setiosflags)
-} // extern "C++"
-
-#endif /*!_IOMANIP_H*/
diff --git a/contrib/libg++/libio/iopadn.c b/contrib/libg++/libio/iopadn.c
deleted file mode 100644
index 0e502b712c3b..000000000000
--- a/contrib/libg++/libio/iopadn.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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"
-
-#define PADSIZE 16
-static char const blanks[PADSIZE] =
-{' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' '};
-static char const zeroes[PADSIZE] =
-{'0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0'};
-
-_IO_ssize_t
-DEFUN(_IO_padn, (fp, pad, count),
- _IO_FILE *fp AND int pad AND _IO_ssize_t count)
-{
- char padbuf[PADSIZE];
- const char *padptr;
- register int i;
- _IO_size_t written = 0, w;
-
- if (pad == ' ')
- padptr = blanks;
- else if (pad == '0')
- padptr = zeroes;
- else
- {
- for (i = PADSIZE; --i >= 0; ) padbuf[i] = pad;
- padptr = padbuf;
- }
- for (i = count; i >= PADSIZE; i -= PADSIZE)
- {
- w = _IO_sputn(fp, padptr, PADSIZE);
- written += w;
- if (w != PADSIZE)
- return written;
- }
-
- if (i > 0)
- {
- w = _IO_sputn(fp, padptr, i);
- written += w;
- }
- return written;
-}
diff --git a/contrib/libg++/libio/ioperror.c b/contrib/libg++/libio/ioperror.c
deleted file mode 100644
index 55d822b63a64..000000000000
--- a/contrib/libg++/libio/ioperror.c
+++ /dev/null
@@ -1,22 +0,0 @@
-#include "libioP.h"
-#include <errno.h>
-#include <string.h>
-#ifndef errno
-extern int errno;
-#endif
-
-#ifndef _IO_strerror
-extern char* _IO_strerror __P((int));
-#endif
-
-void
-DEFUN(_IO_perror, (s),
- const char *s)
-{
- char *error = _IO_strerror (errno);
-
- if (s != NULL && *s != '\0')
- _IO_fprintf (_IO_stderr, "%s:", s);
-
- _IO_fprintf (_IO_stderr, "%s\n", error ? error : "");
-}
diff --git a/contrib/libg++/libio/iopopen.c b/contrib/libg++/libio/iopopen.c
deleted file mode 100644
index ef6ad12449f1..000000000000
--- a/contrib/libg++/libio/iopopen.c
+++ /dev/null
@@ -1,222 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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. */
-
-/* written by Per Bothner (bothner@cygnus.com) */
-
-#define _POSIX_SOURCE
-#include "libioP.h"
-#include <sys/types.h>
-#if _IO_HAVE_SYS_WAIT
-#include <signal.h>
-#include <unistd.h>
-#ifdef __STDC__
-#include <stdlib.h>
-#endif
-#include <sys/wait.h>
-
-#ifndef _IO_fork
-#define _IO_fork vfork /* defined in libiberty, if needed */
-_IO_pid_t _IO_fork();
-#endif
-
-#endif /* _IO_HAVE_SYS_WAIT */
-
-#ifndef _IO_pipe
-#define _IO_pipe pipe
-extern int _IO_pipe();
-#endif
-
-#ifndef _IO_dup2
-#define _IO_dup2 dup2
-extern int _IO_dup2();
-#endif
-
-#ifndef _IO_waitpid
-#define _IO_waitpid waitpid
-#endif
-
-#ifndef _IO_execl
-#define _IO_execl execl
-#endif
-#ifndef _IO__exit
-#define _IO__exit _exit
-#endif
-
-struct _IO_proc_file
-{
- struct _IO_FILE_plus file;
- /* Following fields must match those in class procbuf (procbuf.h) */
- _IO_pid_t pid;
- struct _IO_proc_file *next;
-};
-typedef struct _IO_proc_file _IO_proc_file;
-
-static struct _IO_proc_file *proc_file_chain = NULL;
-
-_IO_FILE *
-DEFUN(_IO_proc_open, (fp, command, mode),
- _IO_FILE* fp AND const char *command AND const char *mode)
-{
-#if _IO_HAVE_SYS_WAIT
- int read_or_write;
- int pipe_fds[2];
- int parent_end, child_end;
- _IO_pid_t child_pid;
- if (_IO_file_is_open(fp))
- return NULL;
- if (_IO_pipe(pipe_fds) < 0)
- return NULL;
- if (mode[0] == 'r')
- {
- parent_end = pipe_fds[0];
- child_end = pipe_fds[1];
- read_or_write = _IO_NO_WRITES;
- }
- else
- {
- parent_end = pipe_fds[1];
- child_end = pipe_fds[0];
- read_or_write = _IO_NO_READS;
- }
- ((_IO_proc_file*)fp)->pid = child_pid = _IO_fork();
- if (child_pid == 0)
- {
- int child_std_end = mode[0] == 'r' ? 1 : 0;
- _IO_close(parent_end);
- if (child_end != child_std_end)
- {
- _IO_dup2(child_end, child_std_end);
- _IO_close(child_end);
- }
- /* Posix.2: "popen() shall ensure that any streams from previous
- popen() calls that remain open in the parent process are closed
- in the new child process." */
- while (proc_file_chain)
- {
- _IO_close (_IO_fileno ((_IO_FILE *) proc_file_chain));
- proc_file_chain = proc_file_chain->next;
- }
-
- _IO_execl("/bin/sh", "sh", "-c", command, (char *)0);
- _IO__exit(127);
- }
- _IO_close(child_end);
- if (child_pid < 0)
- {
- _IO_close(parent_end);
- return NULL;
- }
- _IO_fileno(fp) = parent_end;
-
- /* Link into proc_file_chain. */
- ((_IO_proc_file*)fp)->next = proc_file_chain;
- proc_file_chain = (_IO_proc_file*)fp;
-
- _IO_mask_flags (fp, read_or_write, _IO_NO_READS|_IO_NO_WRITES);
- return fp;
-#else /* !_IO_HAVE_SYS_WAIT */
- return NULL;
-#endif
-}
-
-_IO_FILE *
-DEFUN(_IO_popen, (command, mode),
- const char *command AND const char *mode)
-{
- _IO_proc_file *fpx = (_IO_proc_file*)malloc(sizeof(_IO_proc_file));
- _IO_FILE *fp = (_IO_FILE*)fpx;
- if (fp == NULL)
- return NULL;
- _IO_init(fp, 0);
- _IO_JUMPS(fp) = &_IO_proc_jumps;
- _IO_file_init(fp);
-#if !_IO_UNIFIED_JUMPTABLES
- ((struct _IO_FILE_plus*)fp)->vtable = NULL;
-#endif
- if (_IO_proc_open (fp, command, mode) != NULL)
- return fp;
- free (fpx);
- return NULL;
-}
-
-int
-DEFUN(_IO_proc_close, (fp),
- _IO_FILE *fp)
-{
- /* This is not name-space clean. FIXME! */
-#if _IO_HAVE_SYS_WAIT
- int wstatus;
- _IO_proc_file **ptr = &proc_file_chain;
- _IO_pid_t wait_pid;
- int status = -1;
-
- /* Unlink from proc_file_chain. */
- for ( ; *ptr != NULL; ptr = &(*ptr)->next)
- {
- if (*ptr == (_IO_proc_file*)fp)
- {
- *ptr = (*ptr)->next;
- status = 0;
- break;
- }
- }
-
- if (status < 0 || _IO_close(_IO_fileno(fp)) < 0)
- return -1;
- /* POSIX.2 Rationale: "Some historical implementations either block
- or ignore the signals SIGINT, SIGQUIT, and SIGHUP while waiting
- for the child process to terminate. Since this behavior is not
- described in POSIX.2, such implementations are not conforming." */
- do
- {
- wait_pid = _IO_waitpid (((_IO_proc_file*)fp)->pid, &wstatus, 0);
- } while (wait_pid == -1 && errno == EINTR);
- if (wait_pid == -1)
- return -1;
- return wstatus;
-#else /* !_IO_HAVE_SYS_WAIT */
- return -1;
-#endif
-}
-
-struct _IO_jump_t _IO_proc_jumps = {
- JUMP_INIT_DUMMY,
- JUMP_INIT(finish, _IO_file_finish),
- JUMP_INIT(overflow, _IO_file_overflow),
- JUMP_INIT(underflow, _IO_file_underflow),
- JUMP_INIT(uflow, _IO_default_uflow),
- JUMP_INIT(pbackfail, _IO_default_pbackfail),
- JUMP_INIT(xsputn, _IO_file_xsputn),
- JUMP_INIT(xsgetn, _IO_default_xsgetn),
- JUMP_INIT(seekoff, _IO_file_seekoff),
- JUMP_INIT(seekpos, _IO_default_seekpos),
- JUMP_INIT(setbuf, _IO_file_setbuf),
- JUMP_INIT(sync, _IO_file_sync),
- JUMP_INIT(doallocate, _IO_file_doallocate),
- JUMP_INIT(read, _IO_file_read),
- JUMP_INIT(write, _IO_file_write),
- JUMP_INIT(seek, _IO_file_seek),
- JUMP_INIT(close, _IO_proc_close),
- JUMP_INIT(stat, _IO_file_stat)
-};
diff --git a/contrib/libg++/libio/ioprims.c b/contrib/libg++/libio/ioprims.c
deleted file mode 100644
index faa69e0feffd..000000000000
--- a/contrib/libg++/libio/ioprims.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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. */
-
-/* I/O OS-level primitives.
- Needs to be replaced if not using Unix.
- Also needs to be replaced if avoiding name-space pollution
- (in which case read would be defined in terms of _IO_read,
- rather than vice versa). */
-
-#include "libioP.h"
-#include <sys/types.h>
-#include <sys/stat.h>
-
-#ifdef TODO
-/* Add open, isatty */
-#endif
-
-_IO_ssize_t
-DEFUN(_IO_read, (fildes, buf, nbyte),
- int fildes AND void *buf AND _IO_size_t nbyte)
-{
- return read (fildes, buf, nbyte);
-}
-
-_IO_ssize_t
-DEFUN(_IO_write, (fildes, buf, nbyte),
- int fildes AND const void *buf AND _IO_size_t nbyte)
-{
- return write (fildes, buf, nbyte);
-}
-
-_IO_off_t
-DEFUN(_IO_lseek, (fildes, offset, whence),
- int fildes AND _IO_off_t offset AND int whence)
-{
- return lseek (fildes, offset, whence);
-}
-
-int
-DEFUN(_IO_close, (fildes),
- int fildes)
-{
- return close (fildes);
-}
-
-int
-DEFUN(_IO_fstat, (fildes, buf),
- int fildes AND struct stat *buf)
-{
- return fstat (fildes, buf);
-}
diff --git a/contrib/libg++/libio/ioprintf.c b/contrib/libg++/libio/ioprintf.c
deleted file mode 100644
index 0b99c2a6637f..000000000000
--- a/contrib/libg++/libio/ioprintf.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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"
-
-#ifdef __STDC__
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
-
-int
-_IO_printf
-#ifdef __STDC__
- (const char* format, ...)
-#else
-(format, va_alist) char *format; va_dcl
-#endif
-{
- int ret;
- va_list args;
- _IO_va_start(args, format);
- ret = _IO_vfprintf(_IO_stdout, format, args);
- va_end(args);
- return ret;
-}
diff --git a/contrib/libg++/libio/ioputs.c b/contrib/libg++/libio/ioputs.c
deleted file mode 100644
index f0a81642853d..000000000000
--- a/contrib/libg++/libio/ioputs.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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 <string.h>
-
-int
-DEFUN(_IO_puts, (str),
- const char *str)
-{
- _IO_size_t len = strlen(str);
- if (_IO_sputn(_IO_stdout, str, len) != len)
- return EOF;
- if (_IO_putc('\n', _IO_stdout) == EOF)
- return EOF;
- return len+1;
-}
diff --git a/contrib/libg++/libio/ioscanf.c b/contrib/libg++/libio/ioscanf.c
deleted file mode 100644
index 405d1e2eb0f7..000000000000
--- a/contrib/libg++/libio/ioscanf.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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"
-
-#ifdef __STDC__
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
-
-int
-_IO_scanf
-#ifdef __STDC__
- (const char* format, ...)
-#else
-(format, va_alist) char *format; va_dcl
-#endif
-{
- int ret;
- va_list args;
- _IO_va_start(args, format);
- ret = _IO_vfscanf(_IO_stdin, format, args, NULL);
- va_end(args);
- return ret;
-}
diff --git a/contrib/libg++/libio/ioseekoff.c b/contrib/libg++/libio/ioseekoff.c
deleted file mode 100644
index 06f4b9d2fe10..000000000000
--- a/contrib/libg++/libio/ioseekoff.c
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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>
-
-_IO_pos_t
-DEFUN(_IO_seekoff, (fp, offset, dir, mode),
- _IO_FILE* fp AND _IO_off_t offset AND int dir AND int mode)
-{
- /* If we have a backup buffer, get rid of it, since the __seekoff
- callback may not know to do the right thing about it.
- This may be over-kill, but it'll do for now. TODO */
-
- if (_IO_have_backup (fp))
- {
- if (dir == _IO_seek_cur && _IO_in_backup (fp))
- offset -= fp->_IO_read_end - fp->_IO_read_ptr;
- _IO_free_backup_area (fp);
- }
-
- return _IO_SEEKOFF (fp, offset, dir, mode);
-}
diff --git a/contrib/libg++/libio/ioseekpos.c b/contrib/libg++/libio/ioseekpos.c
deleted file mode 100644
index 1884f9df8f7c..000000000000
--- a/contrib/libg++/libio/ioseekpos.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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>
-
-_IO_pos_t
-DEFUN(_IO_seekpos, (fp, pos, mode),
- _IO_FILE* fp AND _IO_pos_t pos AND int mode)
-{
- /* If we have a backup buffer, get rid of it, since the __seekoff
- callback may not know to do the right thing about it.
- This may be over-kill, but it'll do for now. TODO */
-
- if (_IO_have_backup (fp))
- _IO_free_backup_area (fp);
-
- return _IO_SEEKPOS (fp, pos, mode);
-}
diff --git a/contrib/libg++/libio/iosetbuffer.c b/contrib/libg++/libio/iosetbuffer.c
deleted file mode 100644
index eb78d75d9ab2..000000000000
--- a/contrib/libg++/libio/iosetbuffer.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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"
-
-void
-DEFUN(_IO_setbuffer, (fp, buf, size),
- _IO_FILE *fp AND char *buf AND _IO_size_t size)
-{
- CHECK_FILE(fp, );
- fp->_flags &= ~_IO_LINE_BUF;
- if (!buf)
- size = 0;
- (void) _IO_SETBUF (fp, buf, size);
-}
diff --git a/contrib/libg++/libio/iosetvbuf.c b/contrib/libg++/libio/iosetvbuf.c
deleted file mode 100644
index 1b2da4f104c9..000000000000
--- a/contrib/libg++/libio/iosetvbuf.c
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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"
-
-#define _IOFBF 0 /* Fully buffered. */
-#define _IOLBF 1 /* Line buffered. */
-#define _IONBF 2 /* No buffering. */
-
-int
-DEFUN(_IO_setvbuf, (fp, buf, mode, size),
- _IO_FILE* fp AND char* buf AND int mode AND _IO_size_t size)
-{
- CHECK_FILE(fp, EOF);
- switch (mode)
- {
- case _IOFBF:
- fp->_IO_file_flags &= ~_IO_LINE_BUF|_IO_UNBUFFERED;
- if (buf == NULL)
- {
- if (fp->_IO_buf_base == NULL)
- {
- /* There is no flag to distinguish between "fully buffered
- mode has been explicitly set" as opposed to "line
- buffering has not been explicitly set". In both
- cases, _IO_LINE_BUF is off. If this is a tty, and
- _IO_filedoalloc later gets called, it cannot know if
- it should set the _IO_LINE_BUF flag (because that is
- the default), or not (because we have explicitly asked
- for fully buffered mode). So we make sure a buffer
- gets allocated now, and explicitly turn off line
- buffering.
-
- A possibly cleaner alternative would be to add an
- extra flag, but then flags are a finite resource. */
- if (_IO_DOALLOCATE (fp) < 0)
- return EOF;
- fp->_IO_file_flags &= ~_IO_LINE_BUF;
- }
- return 0;
- }
- break;
- case _IOLBF:
- fp->_IO_file_flags &= ~_IO_UNBUFFERED;
- fp->_IO_file_flags |= _IO_LINE_BUF;
- if (buf == NULL)
- return 0;
- break;
- case _IONBF:
- buf = NULL;
- size = 0;
- break;
- default:
- return EOF;
- }
- return _IO_SETBUF (fp, buf, size) == NULL ? EOF : 0;
-}
diff --git a/contrib/libg++/libio/iosprintf.c b/contrib/libg++/libio/iosprintf.c
deleted file mode 100644
index b873eb4455d5..000000000000
--- a/contrib/libg++/libio/iosprintf.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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"
-
-#ifdef __STDC__
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
-
-int
-_IO_sprintf
-#ifdef __STDC__
- (char *string, const char* format, ...)
-#else
-(string, format, va_alist) char *string; char *format; va_dcl
-#endif
-{
- int ret;
- va_list args;
- _IO_va_start(args, format);
- ret = _IO_vsprintf(string, format, args);
- va_end(args);
- return ret;
-}
diff --git a/contrib/libg++/libio/iosscanf.c b/contrib/libg++/libio/iosscanf.c
deleted file mode 100644
index 58868778c48e..000000000000
--- a/contrib/libg++/libio/iosscanf.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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"
-
-#ifdef __STDC__
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
-
-int
-_IO_sscanf
-#ifdef __STDC__
- (const char * string, const char* format, ...)
-#else
-(string, format, va_alist) char *string; char *format; va_dcl
-#endif
-{
- int ret;
- va_list args;
- _IO_va_start(args, format);
- ret = _IO_vsscanf(string, format, args);
- va_end(args);
- return ret;
-}
diff --git a/contrib/libg++/libio/iostdio.h b/contrib/libg++/libio/iostdio.h
deleted file mode 100644
index 9ed47a4654a4..000000000000
--- a/contrib/libg++/libio/iostdio.h
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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. */
-
-/* This file defines a stdio-like environment, except that it avoid
- link-time name clashes with an existing stdio.
- It allows for testing the libio using stdio-using programs
- with an incompatible libc.a.
- It is not predantically correct - e.g. some macros are used
- that may evaluate a stream argument more than once. */
-
-#ifndef _IOSTDIO_H
-#define _IOSTDIO_H
-
-#include "iolibio.h"
-
-typedef _IO_FILE FILE;
-#ifndef EOF
-#define EOF (-1)
-#endif
-#ifndef BUFSIZ
-#define BUFSIZ 1024
-#endif
-
-/* #define size_t, fpos_t L_tmpname TMP_MAX */
-
-#define _IOFBF 0 /* Fully buffered. */
-#define _IOLBF 1 /* Line buffered. */
-#define _IONBF 2 /* No buffering. */
-
-#define SEEK_SET 0
-#define SEEK_CUR 1
-#define SEEK_END 2
-
-#define stdin _IO_stdin
-#define stdout _IO_stdout
-#define stderr _IO_stderr
-
-#define getc(_fp) _IO_getc(_fp)
-#define putc(_ch, _fp) _IO_putc(_ch, _fp)
-
-#define clearerr _IO_clearerr
-#define fclose _IO_fclose
-#define feof _IO_feof
-#define ferror _IO_ferror
-#define fflush _IO_fflush
-#define fgetc(__fp) _IO_getc(_fp)
-#define fgetpos _IO_fgetpos
-#define fgets _IO_fgets
-#define fopen _IO_fopen
-#define fprintf _IO_fprintf
-#define fputc(_ch, _fp) _IO_putc(_ch, _fp)
-#define fputs _IO_fputs
-#define fread _IO_fread
-#define freopen _IO_freopen
-#define fscanf _IO_fscanf
-#define fseek _IO_fseek
-#define fsetpos _IO_fsetpos
-#define ftell _IO_ftell
-#define fwrite _IO_fwrite
-#define gets _IO_gets
-#define perror _IO_perror
-#define printf _IO_printf
-#define puts _IO_puts
-#define rewind _IO_rewind
-#define scanf _IO_scanf
-#define setbuf _IO_setbuf
-#define setbuffer _IO_setbuffer
-#define setvbuf _IO_setvbuf
-#define sprintf _IO_sprintf
-#define sscanf _IO_sscanf
-#define ungetc _IO_ungetc
-#define vfprintf _IO_vfprintf
-#define vprintf(__fmt, __args) vfprintf(stdout, __fmt, __args)
-#define vsprintf _IO_vsprintf
-
-#if 0
-/* We can use the libc versions of these, since they don't pass FILE*s. */
-#define remove ??? __P((const char*))
-#define rename ??? __P((const char* _old, const char* _new))
-#define tmpfile ??? __P((void))
-#define tmpnam ??? __P((char*))
-#endif
-
-#if !defined(__STRICT_ANSI__) || defined(_POSIX_SOURCE)
-#define fdopen _IO_fdopen
-#define fileno _IO_fileno
-#define popen _IO_popen
-#define pclose _IO_pclose
-#define setbuf _IO_setbuf
-#define setlinebuf _IO_setlinebuf
-#endif
-
-#endif /* _IOSTDIO_H */
diff --git a/contrib/libg++/libio/iostream.cc b/contrib/libg++/libio/iostream.cc
deleted file mode 100644
index 3bdfd59a054c..000000000000
--- a/contrib/libg++/libio/iostream.cc
+++ /dev/null
@@ -1,821 +0,0 @@
-/* This is part of libio/iostream, providing -*- C++ -*- input/output.
-Copyright (C) 1993 Free Software Foundation
-
-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. */
-
-/* Written by Per Bothner (bothner@cygnus.com). */
-
-#ifdef __GNUC__
-#pragma implementation
-#endif
-#define _STREAM_COMPAT
-#include <iostream.h>
-#include "libioP.h"
-#include <stdio.h> /* Needed for sprintf */
-#include <ctype.h>
-#include <string.h>
-#include <limits.h>
-#include "floatio.h"
-
-#define BUF (MAXEXP+MAXFRACT+1) /* + decimal point */
-
-//#define isspace(ch) ((ch)==' ' || (ch)=='\t' || (ch)=='\n')
-
-istream::istream(streambuf *sb, ostream* tied)
-{
- init (sb, tied);
- _gcount = 0;
-}
-
-int skip_ws(streambuf* sb)
-{
- int ch;
- for (;;) {
- ch = sb->sbumpc();
- if (ch == EOF || !isspace(ch))
- return ch;
- }
-}
-
-istream& istream::get(char& c)
-{
- if (ipfx1()) {
- int ch = _strbuf->sbumpc();
- if (ch == EOF) {
- set(ios::eofbit|ios::failbit);
- _gcount = 0;
- }
- else {
- c = (char)ch;
- _gcount = 1;
- }
- }
- else
- _gcount = 0;
- return *this;
-}
-
-int istream::peek()
-{
- if (!good())
- return EOF;
- if (_tie && rdbuf()->in_avail() == 0)
- _tie->flush();
- int ch = _strbuf->sgetc();
- if (ch == EOF)
- set(ios::eofbit);
- return ch;
-}
-
-istream& istream::ignore(int n /* = 1 */, int delim /* = EOF */)
-{
- _gcount = 0;
- if (ipfx1()) {
- register streambuf* sb = _strbuf;
- if (delim == EOF) {
- _gcount = sb->ignore(n);
- return *this;
- }
- for (;;) {
-#if 0
- if (n != MAXINT) // FIXME
-#endif
- if (--n < 0)
- break;
- int ch = sb->sbumpc();
- if (ch == EOF) {
- set(ios::eofbit|ios::failbit);
- break;
- }
- _gcount++;
- if (ch == delim)
- break;
- }
- }
- return *this;
-}
-
-istream& istream::read(char *s, streamsize n)
-{
- if (ipfx1()) {
- _gcount = _strbuf->sgetn(s, n);
- if (_gcount != n)
- set(ios::failbit|ios::eofbit);
- }
- else
- _gcount = 0;
- return *this;
-}
-
-int
-istream::sync ()
-{
- streambuf *sb = rdbuf ();
- if (sb == NULL)
- return EOF;
- if (sb->sync ()) // Later: pubsync
- {
- setstate (ios::badbit);
- return EOF;
- }
- else
- return 0;
-}
-
-istream& istream::seekg(streampos pos)
-{
- pos = _strbuf->pubseekpos(pos, ios::in);
- if (pos == streampos(EOF))
- set(ios::badbit);
- return *this;
-}
-
-istream& istream::seekg(streamoff off, _seek_dir dir)
-{
- streampos pos = _IO_seekoff (_strbuf, off, (int) dir, _IOS_INPUT);
- if (pos == streampos(EOF))
- set(ios::badbit);
- return *this;
-}
-
-streampos istream::tellg()
-{
-#if 0
- streampos pos = _strbuf->pubseekoff(0, ios::cur, ios::in);
-#else
- streampos pos = _IO_seekoff (_strbuf, 0, _IO_seek_cur, _IOS_INPUT);
-#endif
- if (pos == streampos(EOF))
- set(ios::badbit);
- return pos;
-}
-
-istream& istream::operator>>(char& c)
-{
- if (ipfx0()) {
- int ch = _strbuf->sbumpc();
- if (ch == EOF)
- set(ios::eofbit|ios::failbit);
- else
- c = (char)ch;
- }
- return *this;
-}
-
-istream&
-istream::operator>> (char* ptr)
-{
- register char *p = ptr;
- int w = width(0);
- if (ipfx0())
- {
- register streambuf* sb = _strbuf;
- for (;;)
- {
- int ch = sb->sbumpc();
- if (ch == EOF)
- {
- set(ios::eofbit);
- break;
- }
- else if (isspace(ch) || w == 1)
- {
- sb->sputbackc(ch);
- break;
- }
- else *p++ = ch;
- w--;
- }
- if (p == ptr)
- set(ios::failbit);
- }
- *p = '\0';
- return *this;
-}
-
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-#define LONGEST long long
-#else
-#define LONGEST long
-#endif
-
-static int read_int(istream& stream, unsigned LONGEST& val, int& neg)
-{
- if (!stream.ipfx0())
- return 0;
- register streambuf* sb = stream.rdbuf();
- int base = 10;
- int ndigits = 0;
- register int ch = skip_ws(sb);
- if (ch == EOF)
- goto eof_fail;
- neg = 0;
- if (ch == '+') {
- ch = skip_ws(sb);
- }
- else if (ch == '-') {
- neg = 1;
- ch = skip_ws(sb);
- }
- if (ch == EOF) goto eof_fail;
- if (!(stream.flags() & ios::basefield)) {
- if (ch == '0') {
- ch = sb->sbumpc();
- if (ch == EOF) {
- val = 0;
- return 1;
- }
- if (ch == 'x' || ch == 'X') {
- base = 16;
- ch = sb->sbumpc();
- if (ch == EOF) goto eof_fail;
- }
- else {
- sb->sputbackc(ch);
- base = 8;
- ch = '0';
- }
- }
- }
- else if ((stream.flags() & ios::basefield) == ios::hex)
- base = 16;
- else if ((stream.flags() & ios::basefield) == ios::oct)
- base = 8;
- val = 0;
- for (;;) {
- if (ch == EOF)
- break;
- int digit;
- if (ch >= '0' && ch <= '9')
- digit = ch - '0';
- else if (ch >= 'A' && ch <= 'F')
- digit = ch - 'A' + 10;
- else if (ch >= 'a' && ch <= 'f')
- digit = ch - 'a' + 10;
- else
- digit = 999;
- if (digit >= base) {
- sb->sputbackc(ch);
- if (ndigits == 0)
- goto fail;
- else
- return 1;
- }
- ndigits++;
- val = base * val + digit;
- ch = sb->sbumpc();
- }
- return 1;
- fail:
- stream.set(ios::failbit);
- return 0;
- eof_fail:
- stream.set(ios::failbit|ios::eofbit);
- return 0;
-}
-
-#define READ_INT(TYPE) \
-istream& istream::operator>>(TYPE& i)\
-{\
- unsigned LONGEST val; int neg;\
- if (read_int(*this, val, neg)) {\
- if (neg) val = -val;\
- i = (TYPE)val;\
- }\
- return *this;\
-}
-
-READ_INT(short)
-READ_INT(unsigned short)
-READ_INT(int)
-READ_INT(unsigned int)
-READ_INT(long)
-READ_INT(unsigned long)
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-READ_INT(long long)
-READ_INT(unsigned long long)
-#endif
-#if _G_HAVE_BOOL
-READ_INT(bool)
-#endif
-
-istream& istream::operator>>(long double& x)
-{
- if (ipfx0())
- scan("%lg", &x);
- return *this;
-}
-
-istream& istream::operator>>(double& x)
-{
- if (ipfx0())
- scan("%lg", &x);
- return *this;
-}
-
-istream& istream::operator>>(float& x)
-{
- if (ipfx0())
- scan("%g", &x);
- return *this;
-}
-
-istream& istream::operator>>(register streambuf* sbuf)
-{
- if (ipfx0()) {
- register streambuf* inbuf = rdbuf();
- // FIXME: Should optimize!
- for (;;) {
- register int ch = inbuf->sbumpc();
- if (ch == EOF) {
- set(ios::eofbit);
- break;
- }
- if (sbuf->sputc(ch) == EOF) {
- set(ios::failbit);
- break;
- }
- }
- }
- return *this;
-}
-
-ostream& ostream::operator<<(char c)
-{
- if (opfx()) {
-#if 1
- // This is what the cfront implementation does.
- if (_strbuf->sputc(c) == EOF)
- goto failed;
-#else
- // This is what cfront documentation and current ANSI drafts say.
- int w = width(0);
- char fill_char = fill();
- register int padding = w > 0 ? w - 1 : 0;
- register streambuf *sb = _strbuf;
- if (!(flags() & ios::left) && padding) // Default adjustment.
- if (_IO_padn(sb, fill_char, padding) < padding)
- goto failed;
- if (sb->sputc(c) == EOF)
- goto failed;
- if (flags() & ios::left && padding) // Left adjustment.
- if (_IO_padn(sb, fill_char, padding) < padding)
- goto failed;
-#endif
- osfx();
- }
- return *this;
- failed:
- set(ios::badbit);
- osfx();
- return *this;
-}
-
-/* Write VAL on STREAM.
- If SIGN<0, val is the absolute value of a negative number.
- If SIGN>0, val is a signed non-negative number.
- If SIGN==0, val is unsigned. */
-
-static void write_int(ostream& stream, unsigned LONGEST val, int sign)
-{
-#define WRITE_BUF_SIZE (10 + sizeof(unsigned LONGEST) * 3)
- char buf[WRITE_BUF_SIZE];
- register char *buf_ptr = buf+WRITE_BUF_SIZE; // End of buf.
- char *show_base = "";
- int show_base_len = 0;
- int show_pos = 0; // If 1, print a '+'.
-
- // Now do the actual conversion, placing the result at the *end* of buf.
- // Note that we use separate code for decimal, octal, and hex,
- // so we can divide by optimizable constants.
- if ((stream.flags() & ios::basefield) == ios::oct) { // Octal
- do {
- *--buf_ptr = (val & 7) + '0';
- val = val >> 3;
- } while (val != 0);
- if ((stream.flags() & ios::showbase) && (*buf_ptr != '0'))
- *--buf_ptr = '0';
- }
- else if ((stream.flags() & ios::basefield) == ios::hex) { // Hex
- char *xdigs = (stream.flags() & ios::uppercase) ? "0123456789ABCDEF0X"
- : "0123456789abcdef0x";
- do {
- *--buf_ptr = xdigs[val & 15];
- val = val >> 4;
- } while (val != 0);
- if ((stream.flags() & ios::showbase)) {
- show_base = xdigs + 16; // Either "0X" or "0x".
- show_base_len = 2;
- }
- }
- else { // Decimal
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
- // Optimization: Only use long long when we need to.
- while (val > UINT_MAX) {
- *--buf_ptr = (val % 10) + '0';
- val /= 10;
- }
- // Use more efficient (int) arithmetic for the rest.
- register unsigned int ival = (unsigned int)val;
-#else
- register unsigned LONGEST ival = val;
-#endif
- do {
- *--buf_ptr = (ival % 10) + '0';
- ival /= 10;
- } while (ival != 0);
- if (sign > 0 && (stream.flags() & ios::showpos))
- show_pos=1;
- }
-
- int buf_len = buf+WRITE_BUF_SIZE - buf_ptr;
- int w = stream.width(0);
-
- // Calculate padding.
- int len = buf_len+show_pos;
- if (sign < 0) len++;
- len += show_base_len;
- int padding = len > w ? 0 : w - len;
-
- // Do actual output.
- register streambuf* sbuf = stream.rdbuf();
- ios::fmtflags pad_kind =
- stream.flags() & (ios::left|ios::right|ios::internal);
- char fill_char = stream.fill();
- if (padding > 0
- && pad_kind != (ios::fmtflags)ios::left
- && pad_kind != (ios::fmtflags)ios::internal) // Default (right) adjust.
- if (_IO_padn(sbuf, fill_char, padding) < padding)
- goto failed;
- if (sign < 0 || show_pos)
- {
- char ch = sign < 0 ? '-' : '+';
- if (sbuf->sputc(ch) < 0)
- goto failed;
- }
- if (show_base_len)
- if (_IO_sputn(sbuf, show_base, show_base_len) <= 0)
- goto failed;
- if (pad_kind == (ios::fmtflags)ios::internal && padding > 0)
- if (_IO_padn(sbuf, fill_char, padding) < padding)
- goto failed;
- if (_IO_sputn (sbuf, buf_ptr, buf_len) != buf_len)
- goto failed;
- if (pad_kind == (ios::fmtflags)ios::left && padding > 0) // Left adjustment
- if (_IO_padn(sbuf, fill_char, padding) < padding)
- goto failed;
- stream.osfx();
- return;
- failed:
- stream.set(ios::badbit);
- stream.osfx();
-}
-
-ostream& ostream::operator<<(int n)
-{
- if (opfx()) {
- int sign = 1;
- unsigned int abs_n = (unsigned)n;
- if (n < 0 && (flags() & (ios::oct|ios::hex)) == 0)
- abs_n = -((unsigned)n), sign = -1;
- write_int(*this, abs_n, sign);
- }
- return *this;
-}
-
-ostream& ostream::operator<<(unsigned int n)
-{
- if (opfx())
- write_int(*this, n, 0);
- return *this;
-}
-
-
-ostream& ostream::operator<<(long n)
-{
- if (opfx()) {
- int sign = 1;
- unsigned long abs_n = (unsigned long)n;
- if (n < 0 && (flags() & (ios::oct|ios::hex)) == 0)
- abs_n = -((unsigned long)n), sign = -1;
- write_int(*this, abs_n, sign);
- }
- return *this;
-}
-
-ostream& ostream::operator<<(unsigned long n)
-{
- if (opfx())
- write_int(*this, n, 0);
- return *this;
-}
-
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-ostream& ostream::operator<<(long long n)
-{
- if (opfx()) {
- int sign = 1;
- unsigned long long abs_n = (unsigned long long)n;
- if (n < 0 && (flags() & (ios::oct|ios::hex)) == 0)
- abs_n = -((unsigned long long)n), sign = -1;
- write_int(*this, abs_n, sign);
- }
- return *this;
-}
-
-
-ostream& ostream::operator<<(unsigned long long n)
-{
- if (opfx())
- write_int(*this, n, 0);
- return *this;
-}
-#endif /*__GNUC__*/
-
-ostream& ostream::operator<<(double n)
-{
- if (opfx()) {
- // Uses __cvt_double (renamed from static cvt), in Chris Torek's
- // stdio implementation. The setup code uses the same logic
- // as in __vsbprintf.C (also based on Torek's code).
- 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 */
-
- // Do actual conversion.
-#ifdef _IO_USE_DTOA
- if (_IO_outfloat(n, rdbuf(), format_char, width(0),
- prec, flags(),
- flags() & ios::showpos ? '+' : 0,
- fill()) < 0)
- set(ios::badbit|ios::failbit); // ??
-#else
- int fpprec = 0; // 'Extra' (suppressed) floating precision.
- if (prec > MAXFRACT) {
- if (flags() & (ios::fixed|ios::scientific) & ios::showpos)
- fpprec = prec - MAXFRACT;
- prec = MAXFRACT;
- }
- int negative;
- char buf[BUF];
- int sign = '\0';
- char *cp = buf;
- *cp = 0;
- int size = __cvt_double(n, prec,
- flags() & ios::showpoint ? 0x80 : 0,
- &negative,
- format_char, cp, buf + sizeof(buf));
- if (negative) sign = '-';
- else if (flags() & ios::showpos) sign = '+';
- if (*cp == 0)
- cp++;
-
- // Calculate padding.
- int fieldsize = size + fpprec;
- if (sign) fieldsize++;
- int padding = 0;
- int w = width(0);
- if (fieldsize < w)
- padding = w - fieldsize;
-
- // Do actual output.
- register streambuf* sbuf = rdbuf();
- register i;
- char fill_char = fill();
- ios::fmtflags pad_kind =
- flags() & (ios::left|ios::right|ios::internal);
- if (pad_kind != (ios::fmtflags)ios::left // Default (right) adjust.
- && pad_kind != (ios::fmtflags)ios::internal)
- for (i = padding; --i >= 0; ) sbuf->sputc(fill_char);
- if (sign)
- sbuf->sputc(sign);
- if (pad_kind == (ios::fmtflags)ios::internal)
- for (i = padding; --i >= 0; ) sbuf->sputc(fill_char);
-
- // Emit the actual concented field, followed by extra zeros.
- _IO_sputn (sbuf, cp, size);
- for (i = fpprec; --i >= 0; ) sbuf->sputc('0');
-
- if (pad_kind == (ios::fmtflags)ios::left) // Left adjustment
- for (i = padding; --i >= 0; ) sbuf->sputc(fill_char);
-#endif
- osfx();
- }
- return *this;
-}
-
-ostream& ostream::operator<<(const char *s)
-{
- if (opfx())
- {
- if (s == NULL)
- s = "(null)";
- int len = strlen(s);
- int w = width(0);
-// FIXME: Should we: if (w && len>w) len = w;
- char fill_char = fill();
- register streambuf *sbuf = rdbuf();
- register int padding = w > len ? w - len : 0;
- if (!(flags() & ios::left) && padding > 0) // Default adjustment.
- if (_IO_padn(sbuf, fill_char, padding) != padding)
- goto failed;
- if (_IO_sputn (sbuf, s, len) != len)
- goto failed;
- if (flags() & ios::left && padding > 0) // Left adjustment.
- if (_IO_padn(sbuf, fill_char, padding) != padding)
- goto failed;
- osfx();
- }
- return *this;
- failed:
- set(ios::badbit);
- osfx();
- return *this;
-}
-
-#if 0
-ostream& ostream::operator<<(const void *p)
-{ Is in osform.cc, to avoid pulling in all of _IO_vfprintf by this file. */ }
-#endif
-
-ostream& ostream::operator<<(register streambuf* sbuf)
-{
- if (opfx())
- {
- char buffer[_IO_BUFSIZ];
- register streambuf* outbuf = _strbuf;
- for (;;)
- {
- _IO_size_t count = _IO_sgetn(sbuf, buffer, _IO_BUFSIZ);
- if (count <= 0)
- break;
- if (_IO_sputn(outbuf, buffer, count) != count)
- {
- set(ios::badbit);
- break;
- }
- }
- osfx();
- }
- return *this;
-}
-
-ostream::ostream(streambuf* sb, ostream* tied)
-{
- init (sb, tied);
-}
-
-ostream& ostream::seekp(streampos pos)
-{
- pos = _strbuf->pubseekpos(pos, ios::out);
- if (pos == streampos(EOF))
- set(ios::badbit);
- return *this;
-}
-
-ostream& ostream::seekp(streamoff off, _seek_dir dir)
-{
- streampos pos = _IO_seekoff (_strbuf, off, (int) dir, _IOS_OUTPUT);
- if (pos == streampos(EOF))
- set(ios::badbit);
- return *this;
-}
-
-streampos ostream::tellp()
-{
-#if 1
- streampos pos = _IO_seekoff (_strbuf, 0, _IO_seek_cur, _IOS_OUTPUT);
-#else
- streampos pos = _strbuf->pubseekoff(0, ios::cur, ios::out);
-#endif
- if (pos == streampos(EOF))
- set(ios::badbit);
- return pos;
-}
-
-ostream& ostream::flush()
-{
- if (_strbuf->sync())
- set(ios::badbit);
- return *this;
-}
-
-ostream& flush(ostream& outs)
-{
- return outs.flush();
-}
-
-istream& ws(istream& ins)
-{
- if (ins.ipfx1()) {
- int ch = skip_ws(ins._strbuf);
- if (ch == EOF)
- ins.set(ios::eofbit);
- else
- ins._strbuf->sputbackc(ch);
- }
- return ins;
-}
-
-// Skip white-space. Return 0 on failure (EOF), or 1 on success.
-// Differs from ws() manipulator in that failbit is set on EOF.
-// Called by ipfx() and ipfx0() if needed.
-
-int istream::_skip_ws()
-{
- int ch = skip_ws(_strbuf);
- if (ch == EOF) {
- set(ios::eofbit|ios::failbit);
- return 0;
- }
- else {
- _strbuf->sputbackc(ch);
- return 1;
- }
-}
-
-ostream& ends(ostream& outs)
-{
- outs.put('\0');
- return outs;
-}
-
-ostream& endl(ostream& outs)
-{
- return flush(outs.put('\n'));
-}
-
-ostream& ostream::write(const char *s, streamsize n)
-{
- if (opfx()) {
- if (_IO_sputn(_strbuf, s, n) != n)
- set(ios::failbit);
- }
- return *this;
-}
-
-void ostream::do_osfx()
-{
- if (flags() & ios::unitbuf)
- flush();
- if (flags() & ios::stdio) {
- fflush(stdout);
- fflush(stderr);
- }
-}
-
-iostream::iostream(streambuf* sb, ostream* tied)
-{
- init (sb, tied);
-}
-
-// NOTE: extension for compatibility with old libg++.
-// Not really compatible with fistream::close().
-#ifdef _STREAM_COMPAT
-void ios::close()
-{
- if (_strbuf->_flags & _IO_IS_FILEBUF)
- ((struct filebuf*)rdbuf())->close();
- else if (_strbuf != NULL)
- rdbuf()->sync();
- _strbuf = NULL;
- _state = badbit;
-}
-
-int istream::skip(int i)
-{
- int old = (_flags & ios::skipws) != 0;
- if (i)
- _flags |= ios::skipws;
- else
- _flags &= ~ios::skipws;
- return old;
-}
-#endif
diff --git a/contrib/libg++/libio/iostream.h b/contrib/libg++/libio/iostream.h
deleted file mode 100644
index 3c20aa5b26d6..000000000000
--- a/contrib/libg++/libio/iostream.h
+++ /dev/null
@@ -1,254 +0,0 @@
-/* This is part of libio/iostream, providing -*- C++ -*- input/output.
-Copyright (C) 1993 Free Software Foundation
-
-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. */
-
-#ifndef _IOSTREAM_H
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _IOSTREAM_H
-
-#include <streambuf.h>
-
-extern "C++" {
-class istream; class ostream;
-typedef ios& (*__manip)(ios&);
-typedef istream& (*__imanip)(istream&);
-typedef ostream& (*__omanip)(ostream&);
-
-extern istream& ws(istream& ins);
-extern ostream& flush(ostream& outs);
-extern ostream& endl(ostream& outs);
-extern ostream& ends(ostream& outs);
-
-class ostream : virtual public ios
-{
- // NOTE: If fields are changed, you must fix _fake_ostream in stdstreams.C!
- void do_osfx();
- public:
- ostream() { }
- ostream(streambuf* sb, ostream* tied=NULL);
- int opfx() {
- if (!good()) return 0; else { if (_tie) _tie->flush(); return 1;} }
- void osfx() { if (flags() & (ios::unitbuf|ios::stdio))
- do_osfx(); }
- ostream& flush();
- ostream& put(char c) { _strbuf->sputc(c); return *this; }
-#ifdef _STREAM_COMPAT
- /* Temporary binary compatibility. REMOVE IN NEXT RELEASE. */
- ostream& put(unsigned char c) { return put((char)c); }
- ostream& put(signed char c) { return put((char)c); }
-#endif
- ostream& write(const char *s, streamsize n);
- ostream& write(const unsigned char *s, streamsize n)
- { return write((const char*)s, n);}
- ostream& write(const signed char *s, streamsize n)
- { return write((const char*)s, n);}
- ostream& write(const void *s, streamsize n)
- { return write((const char*)s, n);}
- ostream& seekp(streampos);
- ostream& seekp(streamoff, _seek_dir);
- streampos tellp();
- ostream& form(const char *format ...);
- ostream& vform(const char *format, _IO_va_list args);
-
- ostream& operator<<(char c);
- ostream& operator<<(unsigned char c) { return (*this) << (char)c; }
- ostream& operator<<(signed char c) { return (*this) << (char)c; }
- ostream& operator<<(const char *s);
- ostream& operator<<(const unsigned char *s)
- { return (*this) << (const char*)s; }
- ostream& operator<<(const signed char *s)
- { return (*this) << (const char*)s; }
- ostream& operator<<(const void *p);
- ostream& operator<<(int n);
- ostream& operator<<(unsigned int n);
- ostream& operator<<(long n);
- ostream& operator<<(unsigned long n);
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
- ostream& operator<<(long long n);
- ostream& operator<<(unsigned long long n);
-#endif
- ostream& operator<<(short n) {return operator<<((int)n);}
- ostream& operator<<(unsigned short n) {return operator<<((unsigned int)n);}
-#if _G_HAVE_BOOL
- ostream& operator<<(bool b) { return operator<<((int)b); }
-#endif
- ostream& operator<<(double n);
- ostream& operator<<(float n) { return operator<<((double)n); }
- ostream& operator<<(long double n) { return operator<<((double)n); }
- ostream& operator<<(__omanip func) { return (*func)(*this); }
- ostream& operator<<(__manip func) {(*func)(*this); return *this;}
- ostream& operator<<(streambuf*);
-#ifdef _STREAM_COMPAT
- streambuf* ostreambuf() const { return _strbuf; }
-#endif
-};
-
-class istream : virtual public ios
-{
- // NOTE: If fields are changed, you must fix _fake_istream in stdstreams.C!
-protected:
- _IO_size_t _gcount;
-
- int _skip_ws();
- public:
- istream() { _gcount = 0; }
- istream(streambuf* sb, ostream*tied=NULL);
- istream& get(char* ptr, int len, char delim = '\n');
- istream& get(unsigned char* ptr, int len, char delim = '\n')
- { return get((char*)ptr, len, delim); }
- istream& get(char& c);
- istream& get(unsigned char& c) { return get((char&)c); }
- istream& getline(char* ptr, int len, char delim = '\n');
- istream& getline(unsigned char* ptr, int len, char delim = '\n')
- { return getline((char*)ptr, len, delim); }
- istream& get(signed char& c) { return get((char&)c); }
- istream& get(signed char* ptr, int len, char delim = '\n')
- { return get((char*)ptr, len, delim); }
- istream& getline(signed char* ptr, int len, char delim = '\n')
- { return getline((char*)ptr, len, delim); }
- istream& read(char *ptr, streamsize n);
- istream& read(unsigned char *ptr, streamsize n)
- { return read((char*)ptr, n); }
- istream& read(signed char *ptr, streamsize n)
- { return read((char*)ptr, n); }
- istream& read(void *ptr, streamsize n)
- { return read((char*)ptr, n); }
- istream& get(streambuf& sb, char delim = '\n');
- istream& gets(char **s, char delim = '\n');
- int ipfx(int need = 0) {
- if (!good()) { set(ios::failbit); return 0; }
- else {
- if (_tie && (need == 0 || rdbuf()->in_avail() < need)) _tie->flush();
- if (!need && (flags() & ios::skipws)) return _skip_ws();
- else return 1;
- }
- }
- int ipfx0() { // Optimized version of ipfx(0).
- if (!good()) { set(ios::failbit); return 0; }
- else {
- if (_tie) _tie->flush();
- if (flags() & ios::skipws) return _skip_ws();
- else return 1;
- }
- }
- int ipfx1() { // Optimized version of ipfx(1).
- if (!good()) { set(ios::failbit); return 0; }
- else {
- if (_tie && rdbuf()->in_avail() == 0) _tie->flush();
- return 1;
- }
- }
- void isfx() { }
- int get() { if (!ipfx1()) return EOF;
- else { int ch = _strbuf->sbumpc();
- if (ch == EOF) set(ios::eofbit);
- return ch;
- } }
- int peek();
- _IO_size_t gcount() { return _gcount; }
- istream& ignore(int n=1, int delim = EOF);
- int sync ();
- istream& seekg(streampos);
- istream& seekg(streamoff, _seek_dir);
- streampos tellg();
- istream& putback(char ch) {
- if (good() && _strbuf->sputbackc(ch) == EOF) clear(ios::badbit);
- return *this;}
- istream& unget() {
- if (good() && _strbuf->sungetc() == EOF) clear(ios::badbit);
- return *this;}
- istream& scan(const char *format ...);
- istream& vscan(const char *format, _IO_va_list args);
-#ifdef _STREAM_COMPAT
- istream& unget(char ch) { return putback(ch); }
- int skip(int i);
- streambuf* istreambuf() const { return _strbuf; }
-#endif
-
- istream& operator>>(char*);
- istream& operator>>(unsigned char* p) { return operator>>((char*)p); }
- istream& operator>>(signed char*p) { return operator>>((char*)p); }
- istream& operator>>(char& c);
- istream& operator>>(unsigned char& c) {return operator>>((char&)c);}
- istream& operator>>(signed char& c) {return operator>>((char&)c);}
- istream& operator>>(int&);
- istream& operator>>(long&);
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
- istream& operator>>(long long&);
- istream& operator>>(unsigned long long&);
-#endif
- istream& operator>>(short&);
- istream& operator>>(unsigned int&);
- istream& operator>>(unsigned long&);
- istream& operator>>(unsigned short&);
-#if _G_HAVE_BOOL
- istream& operator>>(bool&);
-#endif
- istream& operator>>(float&);
- istream& operator>>(double&);
- istream& operator>>(long double&);
- istream& operator>>( __manip func) {(*func)(*this); return *this;}
- istream& operator>>(__imanip func) { return (*func)(*this); }
- istream& operator>>(streambuf*);
-};
-
-class iostream : public istream, public ostream
-{
- public:
- iostream() { }
- iostream(streambuf* sb, ostream*tied=NULL);
-};
-
-class _IO_istream_withassign : public istream {
-public:
- _IO_istream_withassign& operator=(istream&);
-};
-
-class _IO_ostream_withassign : public ostream {
-public:
- _IO_ostream_withassign& operator=(ostream&);
-};
-
-extern _IO_istream_withassign cin;
-// clog->rdbuf() == cerr->rdbuf()
-extern _IO_ostream_withassign cout, cerr;
-
-extern _IO_ostream_withassign clog
-#if _G_CLOG_CONFLICT
-__asm__ ("__IO_clog")
-#endif
-;
-
-struct Iostream_init { } ; // Compatibility hack for AT&T library.
-
-inline ios& dec(ios& i)
-{ i.setf(ios::dec, ios::dec|ios::hex|ios::oct); return i; }
-inline ios& hex(ios& i)
-{ i.setf(ios::hex, ios::dec|ios::hex|ios::oct); return i; }
-inline ios& oct(ios& i)
-{ i.setf(ios::oct, ios::dec|ios::hex|ios::oct); return i; }
-} // extern "C++"
-
-#endif /*!_IOSTREAM_H*/
diff --git a/contrib/libg++/libio/iostream.texi b/contrib/libg++/libio/iostream.texi
deleted file mode 100644
index 54ccced6e71b..000000000000
--- a/contrib/libg++/libio/iostream.texi
+++ /dev/null
@@ -1,1971 +0,0 @@
-\input texinfo @c -*-Texinfo-*-
-@c Copyright (c) 1993 Free Software Foundation, Inc.
-
-@c %**start of header
-@setfilename iostream.info
-@settitle The GNU C++ Iostream Library
-@setchapternewpage odd
-@c %**end of header
-
-@ifinfo
-@format
-START-INFO-DIR-ENTRY
-* iostream: (iostream). The C++ input/output facility.
-END-INFO-DIR-ENTRY
-@end format
-
-This file describes libio, the GNU library for C++ iostreams and C stdio.
-
-libio includes software developed by the University of California,
-Berkeley.
-
-Copyright (C) 1993 Free Software Foundation, Inc.
-
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-
-@ignore
-Permission is granted to process this file through TeX and print the
-results, provided the printed document carries copying permission
-notice identical to this one except for the removal of this paragraph
-(this paragraph not being relevant to the printed manual).
-
-@end ignore
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided also that the
-entire resulting derived work is distributed under the terms of a
-permission notice identical to this one.
-
-Permission is granted to copy and distribute translations of this manual
-into another language, under the above conditions for modified versions.
-@end ifinfo
-
-@finalout
-@syncodeindex fn cp
-@syncodeindex vr cp
-
-@titlepage
-@title The GNU C++ Iostream Library
-@subtitle Reference Manual for @code{libio} Version 0.64
-@sp 3
-@author Per Bothner @hfill @code{bothner@@cygnus.com}
-@author Cygnus Support @hfill @code{doc@@cygnus.com}
-@page
-
-@vskip 0pt plus 1filll
-Copyright @copyright{} 1993 Free Software Foundation, Inc.
-
-@code{libio} includes software developed by the University of
-California, Berkeley.
-
-@code{libio} uses floating-point software written by David M. Gay, which
-includes the following notice:
-
-@quotation
-The author of this software is David M. Gay.
-
-Copyright (c) 1991 by AT&T.
-
-Permission to use, copy, modify, and distribute this software for any
-purpose without fee is hereby granted, provided that this entire notice
-is included in all copies of any software which is or includes a copy
-or modification of this software and in all copies of the supporting
-documentation for such software.
-
-THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED
-WARRANTY. IN PARTICULAR, NEITHER THE AUTHOR NOR AT&T MAKES ANY
-REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
-OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
-@end quotation
-
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided also that the
-entire resulting derived work is distributed under the terms of a
-permission notice identical to this one.
-
-Permission is granted to copy and distribute translations of this manual
-into another language, under the above conditions for modified versions.
-@end titlepage
-
-@ifinfo
-@node Top
-@top The GNU C++ Iostream Library
-
-This file provides reference information on the GNU C++ iostream library
-(@code{libio}), version 0.64.
-
-@menu
-* Introduction::
-* Operators:: Operators and default streams.
-* Streams:: Stream classes.
-* Files and Strings:: Classes for files and strings.
-* Streambuf:: Using the streambuf layer.
-* Stdio:: C input and output.
-* Index::
-@end menu
-@end ifinfo
-
-@node Introduction
-@chapter Introduction
-
-The iostream classes implement most of the features of AT&T version 2.0
-iostream library classes, and most of the features of the ANSI X3J16
-library draft (which is based on the AT&T design).
-
-This manual is meant as a reference; for tutorial material on iostreams,
-see the corresponding section of any recent popular introduction to C++.
-
-@menu
-* Copying:: Special GNU licensing terms for libio.
-* Acknowledgements:: Contributors to GNU iostream.
-@end menu
-
-@node Copying
-@section Licensing terms for @code{libio}
-
-Since the @code{iostream} classes are so fundamental to standard C++,
-the Free Software Foundation has agreed to a special exception to its
-standard license, when you link programs with @code{libio.a}:
-
-@quotation
-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.
-@end quotation
-
-The code is under the @sc{gnu} General Public License (version 2) for
-all other purposes than linking with this library; that means that you
-can modify and redistribute the code as usual, but remember that if you
-do, your modifications, and anything you link with the modified code,
-must be available to others on the same terms.
-
-These functions are also available as part of the @code{libg++}
-library; if you link with that library instead of @code{libio}, the
-@sc{gnu} Library General Public License applies.
-
-@node Acknowledgements
-@section Acknowledgements
-
-Per Bothner wrote most of the @code{iostream} library, but some portions
-have their origins elsewhere in the free software community. Heinz
-Seidl wrote the IO manipulators. The floating-point conversion software
-is by David M. Gay of AT&T. Some code was derived from parts of BSD
-4.4, which was written at the University of California, Berkeley.
-
-The iostream classes are found in the @code{libio} library. An early
-version was originally distributed in @code{libg++}, and they are still
-included there as well, for convenience if you need other @code{libg++}
-classes. Doug Lea was the original author of @code{libg++}, and some of
-the file-management code still in @code{libio} is his.
-
-Various people found bugs or offered suggestions. Hongjiu Lu worked
-hard to use the library as the default stdio implementation for Linux,
-and has provided much stress-testing of the library.
-
-@node Operators
-@chapter Operators and Default Streams
-
-The @sc{gnu} iostream library, @file{libio}, implements the standard
-input and output facilities for C++. These facilities are roughly
-analogous (in their purpose and ubiquity, at least) with those defined
-by the C @file{stdio} functions.
-
-Although these definitions come from a library, rather than being part
-of the ``core language'', they are sufficiently central to be specified
-in the latest working papers for C++.
-
-You can use two operators defined in this library for basic input and
-output operations. They are familiar from any C++ introductory
-textbook: @code{<<} for output, and @code{>>} for input. (Think of data
-flowing in the direction of the ``arrows''.)
-
-These operators are often used in conjunction with three streams that
-are open by default:
-
-@deftypevar ostream cout
-The standard output stream, analogous to the C @code{stdout}.
-@end deftypevar
-
-@deftypevar istream cin
-The standard input stream, analogous to the C @code{stdin}.
-@end deftypevar
-
-@deftypevar ostream cerr
-An alternative output stream for errors, analogous to the C
-@code{stderr}.
-@end deftypevar
-
-@noindent
-For example, this bare-bones C++ version of the traditional ``hello''
-program uses @code{<<} and @code{cout}:
-
-@example
-#include <iostream.h>
-
-int main(int argc, char **argv)
-@{
- cout << "Well, hi there.\n";
- return 0;
-@}
-@end example
-
-Casual use of these operators may be seductive, but---other than in
-writing throwaway code for your own use---it is not necessarily simpler
-than managing input and output in any other language. For example,
-robust code should check the state of the input and output streams
-between operations (for example, using the method @code{good}).
-@xref{States,,Checking the state of a stream}. You may also need to
-adjust maximum input or output field widths, using manipulators like
-@code{setw} or @code{setprecision}.
-
-@defop Operator ostream <<
-Write output to an open output stream of class @code{ostream}.
-Defined by this library on any @var{object} of a C++ primitive type, and
-on other classes of the library. You can overload the definition for any
-of your own applications' classes.
-
-Returns a reference to the implied argument @code{*this} (the open stream it
-writes on), permitting statements like
-@example
-cout << "The value of i is " << i << "\n";
-@end example
-@end defop
-
-@defop Operator istream >>
-Read input from an open input stream of class @code{istream}. Defined
-by this library on primitive numeric, pointer, and string types; you can
-extend the definition for any of your own applications' classes.
-
-Returns a reference to the implied argument @code{*this} (the open stream
-it reads), permitting multiple inputs in one statement.
-@end defop
-
-@node Streams
-@chapter Stream Classes
-
-The previous chapter referred in passing to the classes @code{ostream}
-and @code{istream}, for output and input respectively. These classes
-share certain properties, captured in their base class @code{ios}.
-
-@menu
-* Ios:: Shared properties.
-* Ostream:: Managing output streams.
-* Istream:: Managing input streams.
-* Iostream:: Input and output together.
-@end menu
-
-@node Ios
-@section Shared properties: class @code{ios}
-
-The base class @code{ios} provides methods to test and manage the state
-of input or output streams.
-
-@code{ios} delegates the job of actually reading and writing bytes to
-the abstract class @code{streambuf}, which is designed to provide
-buffered streams (compatible with C, in the @sc{gnu} implementation).
-@xref{Streambuf,,Using the @code{streambuf} layer}, for information on
-the facilities available at the @code{streambuf} level.
-
-@deftypefn Constructor {} ios::ios ([streambuf* @var{sb} @w{[, ostream*} @var{tie}])
-The @code{ios} constructor by default initializes a new @code{ios}, and
-if you supply a @code{streambuf} @var{sb} to associate with it, sets the
-state @code{good} in the new @code{ios} object. It also sets the
-default properties of the new object.
-
-@ignore
-@c FIXME--future: this (a) doesn't work, (b) is controversial at ANSI
-An @code{ios} without a @code{streambuf} has the state @code{bad} until
-you supply a @code{streambuf}; you can do that by assigning a new value
-to the @code{ios} with @samp{=}.
-@end ignore
-
-You can also supply an optional second argument @var{tie} to the
-constructor: if present, it is an initial value for @code{ios::tie}, to
-associate the new @code{ios} object with another stream.
-@end deftypefn
-
-@deftypefn Destructor {} ios::~ios ()
-The @code{ios} destructor is virtual, permitting application-specific
-behavior when a stream is closed---typically, the destructor frees any
-storage associated with the stream and releases any other associated
-objects.
-@end deftypefn
-
-@c FIXME-future: Is @deftypefn really the best way of displaying these?
-
-@c FIXME-future: Undocumented: ios::_throw_failure, ios::exceptions; things
-@c controlled by _STREAM_COMPAT; ios::Init; ios::_IO_fix_vtable.
-
-@menu
-* States:: Checking the state of a stream.
-* Format Control:: Choices in formatting.
-* Manipulators:: Convenient ways of changing stream properties.
-* Extending:: Extended data fields.
-* Synchronization:: Synchronizing related streams.
-* Streambuf from Ios:: Reaching the underlying streambuf.
-@end menu
-
-@node States
-@subsection Checking the state of a stream
-
-Use this collection of methods to test for (or signal) errors and other
-exceptional conditions of streams:
-
-@deftypefn Method {ios::operator void*} () const
-You can do a quick check on the state of the most recent operation on a
-stream by examining a pointer to the stream itself. The pointer is
-arbitrary except for its truth value; it is true if no failures have
-occurred (@code{ios::fail} is not true). For example, you might ask for
-input on @code{cin} only if all prior output operations succeeded:
-
-@example
-if (cout)
-@{
- // Everything OK so far
- cin >> new_value;
- @dots{}
-@}
-@end example
-@end deftypefn
-
-@deftypefn Method {ios::operator !} () const
-In case it is more convenient to check whether something has failed, the
-operator @code{!} returns true if @code{ios::fail} is true (an operation
-has failed). For example,
-you might issue an error message if input failed:
-
-@example
-if (!cin)
-@{
- // Oops
- cerr << "Eh?\n";
-@}
-@end example
-@end deftypefn
-
-@deftypefn Method iostate ios::rdstate () const
-Return the state flags for this stream. The value is from the
-enumeration @code{iostate}. You can test for any combination of
-
-@vtable @code
-@item goodbit
-There are no indications of exceptional states on this stream.
-
-@item eofbit
-End of file.
-
-@item failbit
-An operation has failed on this stream; this usually indicates bad
-format of input.
-
-@item badbit
-The stream is unusable.
-@end vtable
-@end deftypefn
-
-@deftypefn Method void ios::setstate (iostate @var{state})
-@findex ios::set
-Set the state flag for this stream to @var{state} @emph{in addition to}
-any state flags already set. Synonym (for upward compatibility):
-@code{ios::set}.
-
-See @code{ios::clear} to set the stream state without regard to existing
-state flags. See @code{ios::good}, @code{ios::eof}, @code{ios::fail},
-and @code{ios::bad}, to test the state.
-@end deftypefn
-
-@deftypefn Method int ios::good () const
-Test the state flags associated with this stream; true if no error
-indicators are set.
-@end deftypefn
-
-@deftypefn Method int ios::bad () const
-Test whether a stream is marked as unusable. (Whether
-@code{ios::badbit} is set.)
-@end deftypefn
-
-@deftypefn Method int ios::eof () const
-True if end of file was reached on this stream. (If @code{ios::eofbit}
-is set.)
-@end deftypefn
-
-@deftypefn Method int ios::fail () const
-Test for any kind of failure on this stream: @emph{either} some
-operation failed, @emph{or} the stream is marked as bad. (If either
-@code{ios::failbit} or @code{ios::badbit} is set.)
-@end deftypefn
-
-@deftypefn Method void ios::clear (iostate @var{state})
-@c FIXME-future: There is some complication to do with buffering and _throw_failure
-Set the state indication for this stream to the argument @var{state}.
-You may call @code{ios::clear} with no argument, in which case the state
-is set to @code{good} (no errors pending).
-
-See @code{ios::good}, @code{ios::eof}, @code{ios::fail}, and
-@code{ios::bad}, to test the state; see @code{ios::set} or
-@code{ios::setstate} for an alternative way of setting the state.
-@end deftypefn
-
-@node Format Control
-@subsection Choices in formatting
-
-These methods control (or report on) settings for some details of
-controlling streams, primarily to do with formatting output:
-
-@deftypefn Method char ios::fill () const
-Report on the padding character in use.
-@end deftypefn
-
-@deftypefn Method char ios::fill (char @var{padding})
-Set the padding character. You can also use the manipulator
-@code{setfill}. @xref{Manipulators,,Changing stream properties in
-expressions}.
-
-Default: blank.
-@end deftypefn
-
-@deftypefn Method int ios::precision () const
-Report the number of significant digits currently in use for output of
-floating point numbers.
-
-Default: @code{6}.
-@end deftypefn
-
-@deftypefn Method int ios::precision (int @var{signif})
-Set the number of significant digits (for input and output numeric
-conversions) to @var{signif}.
-
-@findex setprecision
-@cindex setting @code{ios::precision}
-You can also use the manipulator @code{setprecision} for this purpose.
-@xref{Manipulators,,Changing stream properties using manipulators}.
-@end deftypefn
-
-@deftypefn Method int ios::width () const
-Report the current output field width setting (the number of
-characters to write on the next @samp{<<} output operation).
-
-Default: @code{0}, which means to use as many characters as necessary.
-@end deftypefn
-
-@deftypefn Method int ios::width (int @var{num})
-Set the input field width setting to @var{num}. Return the
-@emph{previous} value for this stream.
-
-@findex setw
-@cindex setting @code{ios::width}
-This value resets to zero (the default) every time you use @samp{<<}; it is
-essentially an additional implicit argument to that operator. You can
-also use the manipulator @code{setw} for this purpose.
-@xref{Manipulators,,Changing stream properties using manipulators}.
-@end deftypefn
-
-@need 2000
-@deftypefn Method fmtflags ios::flags () const
-Return the current value of the complete collection of flags controlling
-the format state. These are the flags and their meanings when set:
-
-@vtable @code
-@item ios::dec
-@itemx ios::oct
-@itemx ios::hex
-What numeric base to use in converting integers from internal to display
-representation, or vice versa: decimal, octal, or hexadecimal,
-respectively. (You can change the base using the manipulator
-@code{setbase}, or any of the manipulators @code{dec}, @code{oct}, or
-@code{hex}; @pxref{Manipulators,,Changing stream properties in
-expressions}.)
-
-On input, if none of these flags is set, read numeric constants
-according to the prefix: decimal if no prefix (or a @samp{.} suffix),
-octal if a @samp{0} prefix is present, hexadecimal if a @samp{0x} prefix
-is present.
-
-Default: @code{dec}.
-
-@item ios::fixed
-Avoid scientific notation, and always show a fixed number of digits after
-the decimal point, according to the output precision in effect.
-Use @code{ios::precision} to set precision.
-
-@item ios::left
-@itemx ios::right
-@itemx ios::internal
-Where output is to appear in a fixed-width field; left-justified,
-right-justified, or with padding in the middle (e.g. between a numeric
-sign and the associated value), respectively.
-
-@item ios::scientific
-Use scientific (exponential) notation to display numbers.
-
-@item ios::showbase
-Display the conventional prefix as a visual indicator of the conversion
-base: no prefix for decimal, @samp{0} for octal, @samp{0x} for hexadecimal.
-
-@item ios::showpoint
-Display a decimal point and trailing zeros after it to fill out numeric
-fields, even when redundant.
-
-@item ios::showpos
-Display a positive sign on display of positive numbers.
-
-@item ios::skipws
-Skip white space. (On by default).
-
-@item ios::stdio
-Flush the C @code{stdio} streams @code{stdout} and @code{stderr} after
-each output operation (for programs that mix C and C++ output conventions).
-
-@item ios::unitbuf
-Flush after each output operation.
-
-@item ios::uppercase
-Use upper-case characters for the non-numeral elements in numeric
-displays; for instance, @samp{0X7A} rather than @samp{0x7a}, or
-@samp{3.14E+09} rather than @samp{3.14e+09}.
-@end vtable
-@end deftypefn
-
-@deftypefn Method fmtflags ios::flags (fmtflags @var{value})
-Set @var{value} as the complete collection of flags controlling the
-format state. The flag values are described under @samp{ios::flags ()}.
-
-Use @code{ios::setf} or @code{ios::unsetf} to change one property at a
-time.
-@end deftypefn
-
-@deftypefn Method fmtflags ios::setf (fmtflags @var{flag})
-Set one particular flag (of those described for @samp{ios::flags ()};
-return the complete collection of flags @emph{previously} in effect.
-(Use @code{ios::unsetf} to cancel.)
-@end deftypefn
-
-@deftypefn Method fmtflags ios::setf (fmtflags @var{flag}, fmtflags @var{mask})
-Clear the flag values indicated by @var{mask}, then set any of them that
-are also in @var{flag}. (Flag values are described for @samp{ios::flags
-()}.) Return the complete collection of flags @emph{previously} in
-effect. (See @code{ios::unsetf} for another way of clearing flags.)
-@end deftypefn
-
-@deftypefn Method fmtflags ios::unsetf (fmtflags @var{flag})
-Make certain @var{flag} (a combination of flag values described for
-@samp{ios::flags ()}) is not set for this stream; converse of
-@code{ios::setf}. Returns the old values of those flags.
-@c FIXME-future: should probably be fixed to give same result as setf.
-@end deftypefn
-
-@node Manipulators
-@subsection Changing stream properties using manipulators
-
-For convenience, @var{manipulators} provide a way to change certain
-properties of streams, or otherwise affect them, in the middle of
-expressions involving @samp{<<} or @samp{>>}. For example, you might
-write
-
-@example
-cout << "|" << setfill('*') << setw(5) << 234 << "|";
-@end example
-
-@noindent
-to produce @samp{|**234|} as output.
-
-@deftypefn Manipulator {} ws
-Skip whitespace.
-@end deftypefn
-
-@deftypefn Manipulator {} flush
-Flush an output stream. For example, @samp{cout << @dots{} <<flush;}
-has the same effect as @samp{cout << @dots{}; cout.flush();}.
-@end deftypefn
-
-@deftypefn Manipulator {} endl
-Write an end of line character @samp{\n}, then flushes the output stream.
-@end deftypefn
-
-@deftypefn Manipulator {} ends
-Write @samp{\0} (the string terminator character).
-@end deftypefn
-
-@deftypefn Manipulator {} setprecision (int @var{signif})
-You can change the value of @code{ios::precision} in @samp{<<}
-expressions with the manipulator @samp{setprecision(@var{signif})}; for
-example,
-
-@example
-cout << setprecision(2) << 4.567;
-@end example
-
-@noindent
-prints @samp{4.6}. Requires @file{#include <iomanip.h>}.
-@end deftypefn
-
-@deftypefn Manipulator {} setw (int @var{n})
-You can change the value of @code{ios::width} in @samp{<<} expressions
-with the manipulator @samp{setw(@var{n})}; for example,
-
-@example
-cout << setw(5) << 234;
-@end example
-
-@noindent
-prints @w{@samp{ 234}} with two leading blanks. Requires @file{#include
-<iomanip.h>}.
-@end deftypefn
-
-@deftypefn Manipulator {} setbase (int @var{base})
-Where @var{base} is one of @code{10} (decimal), @code{8} (octal), or
-@code{16} (hexadecimal), change the base value for numeric
-representations. Requires @file{#include <iomanip.h>}.
-@end deftypefn
-
-@deftypefn Manipulator {} dec
-Select decimal base; equivalent to @samp{setbase(10)}.
-@end deftypefn
-
-@deftypefn Manipulator {} hex
-Select hexadecimal base; equivalent to @samp{setbase(16)}.
-@end deftypefn
-
-@deftypefn Manipulator {} oct
-Select octal base; equivalent to @samp{setbase(8)}.
-@end deftypefn
-
-@deftypefn Manipulator {} setfill (char @var{padding})
-Set the padding character, in the same way as @code{ios::fill}.
-Requires @file{#include <iomanip.h>}.
-@end deftypefn
-
-@node Extending
-@subsection Extended data fields
-
-A related collection of methods allows you to extend this collection of
-flags and parameters for your own applications, without risk of conflict
-between them:
-
-@deftypefn Method {static fmtflags} ios::bitalloc ()
-Reserve a bit (the single bit on in the result) to use as a flag. Using
-@code{bitalloc} guards against conflict between two packages that use
-@code{ios} objects for different purposes.
-
-This method is available for upward compatibility, but is not in the
-@sc{ansi} working paper. The number of bits available is limited; a
-return value of @code{0} means no bit is available.
-@end deftypefn
-
-@deftypefn Method {static int} ios::xalloc ()
-Reserve space for a long integer or pointer parameter. The result is a
-unique nonnegative integer. You can use it as an index to
-@code{ios::iword} or @code{ios::pword}. Use @code{xalloc} to arrange
-for arbitrary special-purpose data in your @code{ios} objects, without
-risk of conflict between packages designed for different purposes.
-@end deftypefn
-
-@deftypefn Method long& ios::iword (int @var{index})
-Return a reference to arbitrary data, of long integer type, stored in an
-@code{ios} instance. @var{index}, conventionally returned from
-@code{ios::xalloc}, identifies what particular data you need.
-@end deftypefn
-
-@deftypefn Method long ios::iword (int @var{index}) const
-Return the actual value of a long integer stored in an @code{ios}.
-@end deftypefn
-
-@deftypefn Method void*& ios::pword (int @var{index})
-Return a reference to an arbitrary pointer, stored in an @code{ios}
-instance. @var{index}, originally returned from @code{ios::xalloc},
-identifies what particular pointer you need.
-@end deftypefn
-
-@deftypefn Method void* ios::pword (int @var{index}) const
-Return the actual value of a pointer stored in an @code{ios}.
-@end deftypefn
-
-@node Synchronization
-@subsection Synchronizing related streams
-
-You can use these methods to synchronize related streams with
-one another:
-
-@deftypefn Method ostream* ios::tie () const
-Report on what output stream, if any, is to be flushed before accessing
-this one. A pointer value of @code{0} means no stream is tied.
-@end deftypefn
-
-@deftypefn Method ostream* ios::tie (ostream* @var{assoc})
-Declare that output stream @var{assoc} must be flushed before accessing
-this stream.
-@end deftypefn
-
-@deftypefn Method int ios::sync_with_stdio ([int @var{switch}])
-Unless iostreams and C @code{stdio} are designed to work together, you
-may have to choose between efficient C++ streams output and output
-compatible with C @code{stdio}. Use @samp{ios::sync_with_stdio()} to
-select C compatibility.
-
-The argument @var{switch} is a @sc{gnu} extension; use @code{0} as the
-argument to choose output that is not necessarily compatible with C
-@code{stdio}. The default value for @var{switch} is @code{1}.
-
-If you install the @code{stdio} implementation that comes with @sc{gnu}
-@code{libio}, there are compatible input/output facilities for both C
-and C++. In that situation, this method is unnecessary---but you may
-still want to write programs that call it, for portability.
-@end deftypefn
-
-@node Streambuf from Ios
-@subsection Reaching the underlying @code{streambuf}
-
-Finally, you can use this method to access the underlying object:
-
-@deftypefn Method streambuf* ios::rdbuf () const
-Return a pointer to the @code{streambuf} object that underlies this
-@code{ios}.
-@end deftypefn
-
-@node Ostream
-@section Managing output streams: class @code{ostream}
-
-Objects of class @code{ostream} inherit the generic methods from
-@code{ios}, and in addition have the following methods available.
-Declarations for this class come from @file{iostream.h}.
-
-@deftypefn Constructor {} ostream::ostream ()
-The simplest form of the constructor for an @code{ostream} simply
-allocates a new @code{ios} object.
-@end deftypefn
-
-@deftypefn Constructor {} ostream::ostream (streambuf* @var{sb} @w{[, ostream} @var{tie}])
-This alternative constructor requires a first argument @var{sb} of type
-@code{streambuf*}, to use an existing open stream for output. It also
-accepts an optional second argument @var{tie}, to specify a related
-@code{ostream*} as the initial value for @code{ios::tie}.
-
-If you give the @code{ostream} a @code{streambuf} explicitly, using
-this constructor, the @var{sb} is @emph{not} destroyed (or deleted or
-closed) when the @code{ostream} is destroyed.
-@end deftypefn
-
-@menu
-* Writing:: Writing on an ostream.
-* Output Position:: Repositioning an ostream.
-* Ostream Housekeeping:: Miscellaneous ostream utilities.
-@end menu
-
-@node Writing
-@subsection Writing on an @code{ostream}
-
-These methods write on an @code{ostream} (you may also use the operator
-@code{<<}; @pxref{Operators,,Operators and Default Streams}).
-
-@deftypefn Method ostream& ostream::put (char @var{c})
-Write the single character @var{c}.
-@end deftypefn
-
-@deftypefn Method ostream& ostream::write (@var{string}, int @var{length})
-Write @var{length} characters of a string to this @code{ostream},
-beginning at the pointer @var{string}.
-
-@var{string} may have any of these types: @code{char*}, @code{unsigned
-char*}, @code{signed char*}.
-@end deftypefn
-
-@deftypefn Method ostream& ostream::form (const char *@var{format}, ...)
-A @sc{gnu} extension, similar to @code{fprintf(@var{file},
-@var{format}, ...)}.
-
-@var{format} is a @code{printf}-style format control string, which is used
-to format the (variable number of) arguments, printing the result on
-this @code{ostream}. See @code{ostream::vform} for a version that uses
-an argument list rather than a variable number of arguments.
-@end deftypefn
-
-@deftypefn Method ostream& ostream::vform (const char *@var{format}, va_list @var{args})
-A @sc{gnu} extension, similar to @code{vfprintf(@var{file},
-@var{format}, @var{args})}.
-
-@var{format} is a @code{printf}-style format control string, which is used
-to format the argument list @var{args}, printing the result on
-this @code{ostream}. See @code{ostream::form} for a version that uses a
-variable number of arguments rather than an argument list.
-@end deftypefn
-
-@node Output Position
-@subsection Repositioning an @code{ostream}
-
-You can control the output position (on output streams that actually
-support positions, typically files) with these methods:
-@c FIXME-future: sort out which classes support this and which
-@c don't; fstream, filebuf? And what is failure condition when not supported?
-
-@deftypefn Method streampos ostream::tellp ()
-Return the current write position in the stream.
-@end deftypefn
-
-@deftypefn Method ostream& ostream::seekp (streampos @var{loc})
-Reset the output position to @var{loc} (which is usually the result of a
-previous call to @code{ostream::tellp}). @var{loc} specifies an
-absolute position in the output stream.
-@end deftypefn
-
-@deftypefn Method ostream& ostream::seekp (streamoff @var{loc}, @var{rel})
-@findex ios::seekdir
-Reset the output position to @var{loc}, relative to the beginning, end,
-or current output position in the stream, as indicated by @var{rel} (a
-value from the enumeration @code{ios::seekdir}):
-
-@vtable @code
-@item beg
-Interpret @var{loc} as an absolute offset from the beginning of the
-file.
-
-@item cur
-Interpret @var{loc} as an offset relative to the current output
-position.
-
-@item end
-Interpret @var{loc} as an offset from the current end of the output
-stream.
-@end vtable
-@end deftypefn
-
-@node Ostream Housekeeping
-@subsection Miscellaneous @code{ostream} utilities
-
-You may need to use these @code{ostream} methods for housekeeping:
-
-@deftypefn Method ostream& flush ()
-Deliver any pending buffered output for this @code{ostream}.
-@end deftypefn
-
-@deftypefn Method int ostream::opfx ()
-@code{opfx} is a @dfn{prefix} method for operations on @code{ostream}
-objects; it is designed to be called before any further processing. See
-@code{ostream::osfx} for the converse.
-@c FIXME-future: specify sometime which methods start with opfx.
-
-@code{opfx} tests that the stream is in state @code{good}, and if so
-flushes any stream tied to this one.
-
-The result is @code{1} when @code{opfx} succeeds; else (if the stream state is
-not @code{good}), the result is @code{0}.
-@end deftypefn
-
-@deftypefn Method void ostream::osfx ()
-@code{osfx} is a @dfn{suffix} method for operations on @code{ostream}
-objects; it is designed to be called at the conclusion of any processing. All
-the @code{ostream} methods end by calling @code{osfx}. See
-@code{ostream::opfx} for the converse.
-
-If the @code{unitbuf} flag is set for this stream, @code{osfx} flushes
-any buffered output for it.
-
-If the @code{stdio} flag is set for this stream, @code{osfx} flushes any
-output buffered for the C output streams @file{stdout} and @file{stderr}.
-@end deftypefn
-
-@node Istream
-@section Managing input streams: class @code{istream}
-
-Class @code{istream} objects are specialized for input; as for
-@code{ostream}, they are derived from @code{ios}, so you can use any of
-the general-purpose methods from that base class. Declarations for this
-class also come from @file{iostream.h}.
-
-@deftypefn Constructor {} istream::istream ()
-When used without arguments, the @code{istream} constructor simply
-allocates a new @code{ios} object and initializes the input counter (the
-value reported by @code{istream::gcount}) to @code{0}.
-@end deftypefn
-
-@deftypefn Constructor {} istream::istream (streambuf *@var{sb} @w{[, ostream} @var{tie}])
-You can also call the constructor with one or two arguments. The first
-argument @var{sb} is a @code{streambuf*}; if you supply this pointer,
-the constructor uses that @code{streambuf} for input.
-You can use the second optional argument @var{tie} to specify a related
-output stream as the initial value for @code{ios::tie}.
-
-If you give the @code{istream} a @code{streambuf} explicitly, using
-this constructor, the @var{sb} is @emph{not} destroyed (or deleted or
-closed) when the @code{ostream} is destroyed.
-@end deftypefn
-
-@menu
-* Char Input:: Reading one character.
-* String Input:: Reading strings.
-* Input Position:: Repositioning an istream.
-* Istream Housekeeping:: Miscellaneous istream utilities.
-@end menu
-
-@node Char Input
-@subsection Reading one character
-
-Use these methods to read a single character from the input stream:
-
-@deftypefn Method int istream::get ()
-Read a single character (or @code{EOF}) from the input stream, returning
-it (coerced to an unsigned char) as the result.
-@end deftypefn
-
-@deftypefn Method istream& istream::get (char& @var{c})
-Read a single character from the input stream, into @code{&@var{c}}.
-@end deftypefn
-
-@deftypefn Method int istream::peek ()
-Return the next available input character, but @emph{without} changing
-the current input position.
-@end deftypefn
-
-@node String Input
-@subsection Reading strings
-
-Use these methods to read strings (for example, a line at a time) from
-the input stream:
-
-@deftypefn Method istream& istream::get (char* @var{c}, int @var{len} @w{[, char} @var{delim}])
-Read a string from the input stream, into the array at @var{c}.
-
-The remaining arguments limit how much to read: up to @samp{len-1}
-characters, or up to (but not including) the first occurrence in the
-input of a particular delimiter character @var{delim}---newline
-(@code{\n}) by default. (Naturally, if the stream reaches end of file
-first, that too will terminate reading.)
-
-If @var{delim} was present in the input, it remains available as if
-unread; to discard it instead, see @code{iostream::getline}.
-
-@code{get} writes @samp{\0} at the end of the string, regardless
-of which condition terminates the read.
-@end deftypefn
-
-@deftypefn Method istream& istream::get (streambuf& @var{sb} @w{[, char} @var{delim}])
-Read characters from the input stream and copy them on the
-@code{streambuf} object @var{sb}. Copying ends either just before the
-next instance of the delimiter character @var{delim} (newline @code{\n}
-by default), or when either stream ends. If @var{delim} was present in
-the input, it remains available as if unread.
-@end deftypefn
-
-@deftypefn Method istream& istream::getline (@var{charptr}, int @var{len} @w{[, char} @var{delim}])
-Read a line from the input stream, into the array at @var{charptr}.
-@var{charptr} may be any of three kinds of pointer: @code{char*},
-@code{unsigned char*}, or @code{signed char*}.
-
-The remaining arguments limit how much to read: up to (but not
-including) the first occurrence in the input of a line delimiter
-character @var{delim}---newline (@code{\n}) by default, or up to
-@samp{len-1} characters (or to end of file, if that happens sooner).
-
-If @code{getline} succeeds in reading a ``full line'', it also discards
-the trailing delimiter character from the input stream. (To preserve it
-as available input, see the similar form of @code{iostream::get}.)
-
-If @var{delim} was @emph{not} found before @var{len} characters or end
-of file, @code{getline} sets the @code{ios::fail} flag, as well as the
-@code{ios::eof} flag if appropriate.
-
-@code{getline} writes a null character at the end of the string, regardless
-of which condition terminates the read.
-@end deftypefn
-
-@deftypefn Method istream& istream::read (@var{pointer}, int @var{len})
-Read @var{len} bytes into the location at @var{pointer}, unless the
-input ends first.
-
-@var{pointer} may be of type @code{char*}, @code{void*}, @code{unsigned
-char*}, or @code{signed char*}.
-
-If the @code{istream} ends before reading @var{len} bytes, @code{read}
-sets the @code{ios::fail} flag.
-@end deftypefn
-
-@deftypefn Method istream& istream::gets (char **@var{s} @w{[, char} @var{delim}])
-A @sc{gnu} extension, to read an arbitrarily long string
-from the current input position to the next instance of the @var{delim}
-character (newline @code{\n} by default).
-
-To permit reading a string of arbitrary length, @code{gets} allocates
-whatever memory is required. Notice that the first argument @var{s} is
-an address to record a character pointer, rather than the pointer
-itself.
-@end deftypefn
-
-@deftypefn Method istream& istream::scan (const char *format ...)
-A @sc{gnu} extension, similar to @code{fscanf(@var{file},
-@var{format}, ...)}. The @var{format} is a @code{scanf}-style format
-control string, which is used to read the variables in the remainder of
-the argument list from the @code{istream}.
-@end deftypefn
-
-@deftypefn Method istream& istream::vscan (const char *format, va_list args)
-Like @code{istream::scan}, but takes a single @code{va_list} argument.
-@end deftypefn
-
-@node Input Position
-@subsection Repositioning an @code{istream}
-
-Use these methods to control the current input position:
-
-@deftypefn Method streampos istream::tellg ()
-Return the current read position, so that you can save it and return to
-it later with @code{istream::seekg}.
-@end deftypefn
-
-@deftypefn Method istream& istream::seekg (streampos @var{p})
-Reset the input pointer (if the input device permits it) to @var{p},
-usually the result of an earlier call to @code{istream::tellg}.
-@end deftypefn
-
-@deftypefn Method istream& istream::seekg (streamoff @var{offset}, ios::seek_dir @var{ref})
-Reset the input pointer (if the input device permits it) to @var{offset}
-characters from the beginning of the input, the current position, or the
-end of input. Specify how to interpret @var{offset} with one of these
-values for the second argument:
-
-@vtable @code
-@item ios::beg
-Interpret @var{loc} as an absolute offset from the beginning of the
-file.
-
-@item ios::cur
-Interpret @var{loc} as an offset relative to the current output
-position.
-
-@item ios::end
-Interpret @var{loc} as an offset from the current end of the output
-stream.
-@end vtable
-@end deftypefn
-
-@node Istream Housekeeping
-@subsection Miscellaneous @code{istream} utilities
-
-Use these methods for housekeeping on @code{istream} objects:
-
-@deftypefn Method int istream::gcount ()
-Report how many characters were read from this @code{istream} in the
-last unformatted input operation.
-@c FIXME! Define "unformatted input" somewhere...
-@end deftypefn
-
-@deftypefn Method int istream::ipfx (int @var{keepwhite})
-Ensure that the @code{istream} object is ready for reading; check for
-errors and end of file and flush any tied stream. @code{ipfx} skips
-whitespace if you specify @code{0} as the @var{keepwhite}
-argument, @emph{and} @code{ios::skipws} is set for this stream.
-
-To avoid skipping whitespace (regardless of the @code{skipws} setting on
-the stream), use @code{1} as the argument.
-
-Call @code{istream::ipfx} to simplify writing your own methods for reading
-@code{istream} objects.
-@end deftypefn
-
-@deftypefn Method void istream::isfx ()
-A placeholder for compliance with the draft @sc{ansi} standard; this
-method does nothing whatever.
-
-If you wish to write portable standard-conforming code on @code{istream}
-objects, call @code{isfx} after any operation that reads from an
-@code{istream}; if @code{istream::ipfx} has any special effects that
-must be cancelled when done, @code{istream::isfx} will cancel them.
-@end deftypefn
-
-@deftypefn Method istream& istream::ignore ([int @var{n}] @w{[, int} @var{delim}])
-Discard some number of characters pending input. The first optional
-argument @var{n} specifies how many characters to skip. The second
-optional argument @var{delim} specifies a ``boundary'' character:
-@code{ignore} returns immediately if this character appears in the
-input.
-
-By default, @var{delim} is @code{EOF}; that is, if you do not specify a
-second argument, only the count @var{n} restricts how much to ignore
-(while input is still available).
-
-If you do not specify how many characters to ignore, @code{ignore}
-returns after discarding only one character.
-@end deftypefn
-
-@deftypefn Method istream& istream::putback (char @var{ch})
-Attempts to back up one character, replacing the character backed-up
-over by @var{ch}. Returns @code{EOF} if this is not allowed. Putting
-back the most recently read character is always allowed. (This method
-corresponds to the C function @code{ungetc}.)
-@end deftypefn
-
-@deftypefn Method istream& istream::unget ()
-Attempt to back up one character.
-@end deftypefn
-
-@node Iostream
-@section Input and output together: class @code{iostream}
-
-If you need to use the same stream for input and output, you can use an
-object of the class @code{iostream}, which is derived from @emph{both}
-@code{istream} and @code{ostream}.
-
-The constructors for @code{iostream} behave just like the constructors
-for @code{istream}.
-
-@deftypefn Constructor {} iostream::iostream ()
-When used without arguments, the @code{iostream} constructor simply
-allocates a new @code{ios} object, and initializes the input counter
-(the value reported by @code{istream::gcount}) to @code{0}.
-@end deftypefn
-
-@deftypefn Constructor {} iostream::iostream (streambuf* @var{sb} @w{[, ostream*} @var{tie}])
-You can also call a constructor with one or two arguments. The first
-argument @var{sb} is a @code{streambuf*}; if you supply this pointer,
-the constructor uses that @code{streambuf} for input and output.
-
-You can use the optional second argument @var{tie} (an @code{ostream*})
-to specify a related output stream as the initial value for
-@code{ios::tie}.
-@end deftypefn
-
-@cindex @code{iostream} destructor
-@cindex destructor for @code{iostream}
-As for @code{ostream} and @code{istream}, @code{iostream} simply uses
-the @code{ios} destructor. However, an @code{iostream} is not deleted by
-its destructor.
-
-You can use all the @code{istream}, @code{ostream}, and @code{ios}
-methods with an @code{iostream} object.
-
-@node Files and Strings
-@chapter Classes for Files and Strings
-
-There are two very common special cases of input and output: using files,
-and using strings in memory.
-
-@code{libio} defines four specialized classes for these cases:
-
-@ftable @code
-@item ifstream
-Methods for reading files.
-
-@item ofstream
-Methods for writing files.
-
-@item istrstream
-Methods for reading strings from memory.
-
-@item ostrstream
-Methods for writing strings in memory.
-@end ftable
-
-@menu
-* Files:: Reading and writing files.
-* Strings:: Reading and writing strings in memory.
-@end menu
-
-@node Files
-@section Reading and writing files
-
-These methods are declared in @file{fstream.h}.
-
-@findex ifstream
-@cindex class @code{ifstream}
-You can read data from class @code{ifstream} with any operation from class
-@code{istream}. There are also a few specialized facilities:
-
-@deftypefn Constructor {} ifstream::ifstream ()
-Make an @code{ifstream} associated with a new file for input. (If you
-use this version of the constructor, you need to call
-@code{ifstream::open} before actually reading anything)
-@end deftypefn
-
-@deftypefn Constructor {} ifstream::ifstream (int @var{fd})
-Make an @code{ifstream} for reading from a file that was already open,
-using file descriptor @var{fd}. (This constructor is compatible with
-other versions of iostreams for @sc{posix} systems, but is not part of
-the @sc{ansi} working paper.)
-@end deftypefn
-
-@deftypefn Constructor {} ifstream::ifstream (const char* @var{fname} @w{[, int} @var{mode} @w{[, int} @var{prot}]])
-Open a file @code{*@var{fname}} for this @code{ifstream} object.
-
-By default, the file is opened for input (with @code{ios::in} as
-@var{mode}). If you use this constructor, the file will be closed when
-the @code{ifstream} is destroyed.
-
-You can use the optional argument @var{mode} to specify how to open the
-file, by combining these enumerated values (with @samp{|} bitwise or).
-(These values are actually defined in class @code{ios}, so that all
-file-related streams may inherit them.) Only some of these modes are
-defined in the latest draft @sc{ansi} specification; if portability is
-important, you may wish to avoid the others.
-
-@vtable @code
-@item ios::in
-Open for input. (Included in @sc{ansi} draft.)
-
-@item ios::out
-Open for output. (Included in @sc{ansi} draft.)
-
-@item ios::ate
-Set the initial input (or output) position to the end of the file.
-
-@item ios::app
-Seek to end of file before each write. (Included in @sc{ansi} draft.)
-
-@item ios::trunc
-Guarantee a fresh file; discard any contents that were previously
-associated with it.
-
-@item ios::nocreate
-Guarantee an existing file; fail if the specified file did not already
-exist.
-
-@item ios::noreplace
-Guarantee a new file; fail if the specified file already existed.
-
-@item ios::bin
-Open as a binary file (on systems where binary and text files have different
-properties, typically how @samp{\n} is mapped; included in @sc{ansi} draft).
-@end vtable
-
-@noindent
-The last optional argument @var{prot} is specific to Unix-like systems;
-it specifies the file protection (by default @samp{644}).
-@end deftypefn
-
-@deftypefn Method void ifstream::open (const char* @var{fname} @w{[, int} @var{mode} @w{[, int} @var{prot}]])
-Open a file explicitly after the associated @code{ifstream} object
-already exists (for instance, after using the default constructor). The
-arguments, options and defaults all have the same meanings as in the
-fully specified @code{ifstream} constructor.
-@end deftypefn
-
-@findex ostream
-@cindex class @code{ostream}
-You can write data to class @code{ofstream} with any operation from class
-@code{ostream}. There are also a few specialized facilities:
-
-@deftypefn Constructor {} ofstream::ofstream ()
-Make an @code{ofstream} associated with a new file for output.
-@end deftypefn
-
-@deftypefn Constructor {} ofstream::ofstream (int @var{fd})
-Make an @code{ofstream} for writing to a file that was already open,
-using file descriptor @var{fd}.
-@end deftypefn
-
-@deftypefn Constructor {} ofstream::ofstream (const char* @var{fname} @w{[, int} @var{mode} @w{[, int} @var{prot}]])
-Open a file @code{*@var{fname}} for this @code{ofstream} object.
-
-By default, the file is opened for output (with @code{ios::out} as @var{mode}).
-You can use the optional argument @var{mode} to specify how to open the
-file, just as described for @code{ifstream::ifstream}.
-
-The last optional argument @var{prot} specifies the file protection (by
-default @samp{644}).
-@end deftypefn
-
-@deftypefn Destructor {} ofstream::~ofstream ()
-The files associated with @code{ofstream} objects are closed when the
-corresponding object is destroyed.
-@end deftypefn
-
-@deftypefn Method void ofstream::open (const char* @var{fname} @w{[, int} @var{mode} @w{[, int} @var{prot}]])
-Open a file explicitly after the associated @code{ofstream} object
-already exists (for instance, after using the default constructor). The
-arguments, options and defaults all have the same meanings as in the
-fully specified @code{ofstream} constructor.
-@end deftypefn
-
-@findex fstream
-@cindex class @code{fstream}
-The class @code{fstream} combines the facilities of @code{ifstream} and
-@code{ofstream}, just as @code{iostream} combines @code{istream} and
-@code{ostream}.
-
-@c FIXME-future: say something about fstream constructor, maybe.
-
-@findex fstreambase
-@cindex class @code{fstreambase}
-The class @code{fstreambase} underlies both @code{ifstream} and
-@code{ofstream}. They both inherit this additional method:
-
-@deftypefn Method void fstreambase::close ()
-Close the file associated with this object, and set @code{ios::fail} in
-this object to mark the event.
-@end deftypefn
-
-@node Strings
-@section Reading and writing in memory
-
-@c FIXME!! Per, there's a lot of guesswork here---please check carefully!
-
-@findex istrstream
-@cindex class @code{istrstream}
-@findex ostrstream
-@cindex class @code{ostrstream}
-@findex strstream
-@cindex class @code{strstream}
-@findex strstreambase
-@cindex class @code{strstreambase}
-@findex strstreambuf
-@cindex class @code{strstreambuf}
-The classes @code{istrstream}, @code{ostrstream}, and @code{strstream}
-provide some additional features for reading and writing strings in
-memory---both static strings, and dynamically allocated strings. The
-underlying class @code{strstreambase} provides some features common to
-all three; @code{strstreambuf} underlies that in turn.
-
-@c FIXME-future: Document strstreambuf methods one day, when we document
-@c streambuf more fully.
-
-@deftypefn Constructor {} istrstream::istrstream (const char* @var{str} @w{[, int} @var{size}])
-Associate the new input string class @code{istrstream} with an existing
-static string starting at @var{str}, of size @var{size}. If you do not
-specify @var{size}, the string is treated as a @code{NUL} terminated string.
-@end deftypefn
-
-@deftypefn Constructor {} ostrstream::ostrstream ()
-Create a new stream for output to a dynamically managed string, which
-will grow as needed.
-@end deftypefn
-
-@deftypefn Constructor {} ostrstream::ostrstream (char* @var{str}, int @var{size} [,int @var{mode}])
-A new stream for output to a statically defined string of length
-@var{size}, starting at @var{str}. You may optionally specify one of
-the modes described for @code{ifstream::ifstream}; if you do not specify
-one, the new stream is simply open for output, with mode @code{ios::out}.
-@end deftypefn
-
-@deftypefn Method int ostrstream::pcount ()
-Report the current length of the string associated with this @code{ostrstream}.
-@end deftypefn
-
-@deftypefn Method char* ostrstream::str ()
-A pointer to the string managed by this @code{ostrstream}. Implies
-@samp{ostrstream::freeze()}.
-
-Note that if you want the string to be nul-terminated,
-you must do that yourself (perhaps by writing ends to the stream).
-@end deftypefn
-
-@deftypefn Method void ostrstream::freeze ([int @var{n}])
-If @var{n} is nonzero (the default), declare that the string associated
-with this @code{ostrstream} is not to change dynamically; while frozen,
-it will not be reallocated if it needs more space, and it will not be
-deallocated when the @code{ostrstream} is destroyed. Use
-@samp{freeze(1)} if you refer to the string as a pointer after creating
-it via @code{ostrstream} facilities.
-
-@samp{freeze(0)} cancels this declaration, allowing a dynamically
-allocated string to be freed when its @code{ostrstream} is destroyed.
-
-If this @code{ostrstream} is already static---that is, if it was created
-to manage an existing statically allocated string---@code{freeze} is
-unnecessary, and has no effect.
-@end deftypefn
-
-@deftypefn Method int ostrstream::frozen ()
-Test whether @code{freeze(1)} is in effect for this string.
-@end deftypefn
-
-@deftypefn Method strstreambuf* strstreambase::rdbuf ()
-A pointer to the underlying @code{strstreambuf}.
-@end deftypefn
-
-@node Streambuf
-@chapter Using the @code{streambuf} Layer
-
-The @code{istream} and @code{ostream} classes are meant to handle
-conversion between objects in your program and their textual representation.
-
-By contrast, the underlying @code{streambuf} class is for transferring
-raw bytes between your program, and input sources or output sinks.
-Different @code{streambuf} subclasses connect to different kinds of
-sources and sinks.
-
-The @sc{gnu} implementation of @code{streambuf} is still evolving; we
-describe only some of the highlights.
-
-@menu
-* Areas:: Areas in a streambuf.
-* Overflow:: Simple output re-direction
-* Formatting:: C-style formatting for streambuf objects.
-* Stdiobuf:: Wrappers for C stdio.
-* Procbuf:: Reading/writing from/to a pipe
-* Backing Up:: Marking and returning to a position.
-* Indirectbuf:: Forwarding I/O activity.
-@end menu
-
-@node Areas
-@section Areas of a @code{streambuf}
-
-Streambuf buffer management is fairly sophisticated (this is a
-nice way to say ``complicated''). The standard protocol
-has the following ``areas'':
-
-@itemize @bullet
-@item
-@cindex put area
-The @dfn{put area} contains characters waiting for output.
-
-@item
-@cindex get area
-The @dfn{get area} contains characters available for reading.
-@end itemize
-
-The @sc{gnu} @code{streambuf} design extends this, but the details are
-still evolving.
-
-The following methods are used to manipulate these areas.
-These are all protected methods, which are intended to be
-used by virtual function in classes derived from @code{streambuf}.
-They are also all ANSI/ISO-standard, and the ugly names
-are traditional.
-(Note that if a pointer points to the 'end' of an area,
-it means that it points to the character after the area.)
-
-@deftypefn Method char* streambuf::pbase () const
-Returns a pointer to the start of the put area.
-@end deftypefn
-
-@deftypefn Method char* streambuf::epptr () const
-Returns a pointer to the end of the put area.
-@end deftypefn
-
-@deftypefn Method char* streambuf::pptr () const
-If @code{pptr() < epptr ()}, the @code{pptr()}
-returns a pointer to the current put position.
-(In that case, the next write will
-overwrite @code{*pptr()}, and increment @code{pptr()}.)
-Otherwise, there is no put position available
-(and the next character written will cause @code{streambuf::overflow}
-to be called).
-@end deftypefn
-
-@deftypefn Method void streambuf::pbump (int @var{N})
-Add @var{N} to the current put pointer.
-No error checking is done.
-@end deftypefn
-
-@deftypefn Method void streambuf::setp (char* @var{P}, char* @var{E})
-Sets the start of the put area to @var{P}, the end of the put area to @var{E},
-and the current put pointer to @var{P} (also).
-@end deftypefn
-
-@deftypefn Method char* streambuf::eback () const
-Returns a pointer to the start of the get area.
-@end deftypefn
-
-@deftypefn Method char* streambuf::egptr () const
-Returns a pointer to the end of the get area.
-@end deftypefn
-
-@deftypefn Method char* streambuf::gptr () const
-If @code{gptr() < egptr ()}, then @code{gptr()}
-returns a pointer to the current get position.
-(In that case the next read will read @code{*gptr()},
-and possibly increment @code{gptr()}.)
-Otherwise, there is no read position available
-(and the next read will cause @code{streambuf::underflow}
-to be called).
-@end deftypefn
-
-@deftypefn Method void streambuf:gbump (int @var{N})
-Add @var{N} to the current get pointer.
-No error checking is done.
-@end deftypefn
-
-@deftypefn Method void streambuf::setg (char* @var{B}, char* @var{P}, char* @var{E})
-Sets the start of the get area to @var{B}, the end of the get area to @var{E},
-and the current put pointer to @var{P}.
-@end deftypefn
-
-@node Overflow
-@section Simple output re-direction by redefining @code{overflow}
-
-Suppose you have a function @code{write_to_window} that
-writes characters to a @code{window} object. If you want to use the
-ostream function to write to it, here is one (portable) way to do it.
-This depends on the default buffering (if any).
-
-@cartouche
-@smallexample
-#include <iostream.h>
-/* Returns number of characters successfully written to @var{win}. */
-extern int write_to_window (window* win, char* text, int length);
-
-class windowbuf : public streambuf @{
- window* win;
- public:
- windowbuf (window* w) @{ win = w; @}
- int sync ();
- int overflow (int ch);
- // Defining xsputn is an optional optimization.
- // (streamsize was recently added to ANSI C++, not portable yet.)
- streamsize xsputn (char* text, streamsize n);
-@};
-
-int windowbuf::sync ()
-@{ streamsize n = pptr () - pbase ();
- return (n && write_to_window (win, pbase (), n) != n) ? EOF : 0;
-@}
-
-int windowbuf::overflow (int ch)
-@{ streamsize n = pptr () - pbase ();
- if (n && sync ())
- return EOF;
- if (ch != EOF)
- @{
- char cbuf[1];
- cbuf[0] = ch;
- if (write_to_window (win, cbuf, 1) != 1)
- return EOF;
- @}
- pbump (-n); // Reset pptr().
- return 0;
-@}
-
-streamsize windowbuf::xsputn (char* text, streamsize n)
-@{ return sync () == EOF ? 0 : write_to_window (win, text, n); @}
-
-int
-main (int argc, char**argv)
-@{
- window *win = ...;
- windowbuf wbuf(win);
- ostream wstr(&wbuf);
- wstr << "Hello world!\n";
-@}
-@end smallexample
-@end cartouche
-
-
-
-@node Formatting
-@section C-style formatting for @code{streambuf} objects
-
-The @sc{gnu} @code{streambuf} class supports @code{printf}-like
-formatting and scanning.
-
-@deftypefn Method int streambuf::form (const char *@var{format}, ...)
-Similar to @code{fprintf(@var{file}, @var{format}, ...)}.
-The @var{format} is a @code{printf}-style format control string, which is used
-to format the (variable number of) arguments, printing the result on
-the @code{this} streambuf. The result is the number of characters printed.
-@end deftypefn
-
-@deftypefn Method int streambuf::vform (const char *@var{format}, va_list @var{args})
-Similar to @code{vfprintf(@var{file}, @var{format}, @var{args})}.
-The @var{format} is a @code{printf}-style format control string, which is used
-to format the argument list @var{args}, printing the result on
-the @code{this} streambuf. The result is the number of characters printed.
-@end deftypefn
-
-@deftypefn Method int streambuf::scan (const char *@var{format}, ...)
-Similar to @code{fscanf(@var{file}, @var{format}, ...)}.
-The @var{format} is a @code{scanf}-style format control string, which is used
-to read the (variable number of) arguments from the @code{this} streambuf.
-The result is the number of items assigned, or @code{EOF} in case of
-input failure before any conversion.
-@end deftypefn
-
-@deftypefn Method int streambuf::vscan (const char *@var{format}, va_list @var{args})
-Like @code{streambuf::scan}, but takes a single @code{va_list} argument.
-@end deftypefn
-
-@node Stdiobuf
-@section Wrappers for C @code{stdio}
-
-A @dfn{stdiobuf} is a @code{streambuf} object that points to
-a @code{FILE} object (as defined by @code{stdio.h}).
-All @code{streambuf} operations on the @code{stdiobuf} are forwarded
-to the @code{FILE}. Thus the @code{stdiobuf} object provides a
-wrapper around a @code{FILE}, allowing use of @code{streambuf}
-operations on a @code{FILE}. This can be useful when mixing
-C code with C++ code.
-
-The pre-defined streams @code{cin}, @code{cout}, and @code{cerr} are
-normally implemented as @code{stdiobuf} objects that point to
-respectively @code{stdin}, @code{stdout}, and @code{stderr}. This is
-convenient, but it does cost some extra overhead.
-
-If you set things up to use the implementation of @code{stdio} provided
-with this library, then @code{cin}, @code{cout}, and @code{cerr} will be
-set up to to use @code{stdiobuf} objects, since you get their benefits
-for free. @xref{Stdio,,C Input and Output}.
-
-@ignore
-@c FIXME-future: setbuf is not yet documented, hence this para is not useful.
-Note that if you use @code{setbuf} to give a buffer to a @code{stdiobuf},
-that buffer will provide intermediate buffering in addition that
-whatever is done by the @code{FILE}.
-@end ignore
-
-@node Procbuf
-@section Reading/writing from/to a pipe
-
-The @dfn{procbuf} class is a @sc{gnu} extension. It is derived from
-@code{streambuf}. A @code{procbuf} can be @dfn{closed} (in which case
-it does nothing), or @dfn{open} (in which case it allows communicating
-through a pipe with some other program).
-
-@deftypefn Constructor {} procbuf::procbuf ()
-Creates a @code{procbuf} in a @dfn{closed} state.
-@end deftypefn
-
-@deftypefn Method procbuf* procbuf::open (const char *@var{command}, int @var{mode})
-Uses the shell (@file{/bin/sh}) to run a program specified by @var{command}.
-
-If @var{mode} is @samp{ios::in}, standard output from the program is sent
-to a pipe; you can read from the pipe by reading from the
-@code{procbuf}. (This is similar to @w{@samp{popen(@var{command}, "r")}}.)
-
-If @var{mode} is @samp{ios::out}, output written written to the
-@code{procbuf} is written to a pipe; the program is set up to read its
-standard input from (the other end of) the pipe. (This is similar to
-@w{@samp{popen(@var{command}, "w")}}.)
-
-The @code{procbuf} must start out in the @dfn{closed} state.
-Returns @samp{*this} on success, and @samp{NULL} on failure.
-@end deftypefn
-
-@deftypefn Constructor {} procbuf::procbuf (const char *@var{command}, int @var{mode})
-Calls @samp{procbuf::open (@var{command}, @var{mode})}.
-@end deftypefn
-
-@deftypefn Method procbuf* procbuf::close ()
-Waits for the program to finish executing,
-and then cleans up the resources used.
-Returns @samp{*this} on success, and @samp{NULL} on failure.
-@end deftypefn
-
-@deftypefn Destructor {} procbuf::~procbuf ()
-Calls @samp{procbuf::close}.
-@end deftypefn
-
-@node Backing Up
-@section Backing up
-
-The @sc{gnu} iostream library allows you to ask a @code{streambuf} to
-remember the current position. This allows you to go back to this
-position later, after reading further. You can back up arbitrary
-amounts, even on unbuffered files or multiple buffers' worth, as long as
-you tell the library in advance. This unbounded backup is very useful
-for scanning and parsing applications. This example shows a typical
-scenario:
-
-@cartouche
-@smallexample
-// Read either "dog", "hound", or "hounddog".
-// If "dog" is found, return 1.
-// If "hound" is found, return 2.
-// If "hounddog" is found, return 3.
-// If none of these are found, return -1.
-int my_scan(streambuf* sb)
-@{
- streammarker fence(sb);
- char buffer[20];
- // Try reading "hounddog":
- if (sb->sgetn(buffer, 8) == 8
- && strncmp(buffer, "hounddog", 8) == 0)
- return 3;
- // No, no "hounddog": Back up to 'fence'
- sb->seekmark(fence); //
- // ... and try reading "dog":
- if (sb->sgetn(buffer, 3) == 3
- && strncmp(buffer, "dog", 3) == 0)
- return 1;
- // No, no "dog" either: Back up to 'fence'
- sb->seekmark(fence); //
- // ... and try reading "hound":
- if (sb->sgetn(buffer, 5) == 5
- && strncmp(buffer, "hound", 5) == 0)
- return 2;
- // No, no "hound" either: Back up and signal failure.
- sb->seekmark(fence); // Backup to 'fence'
- return -1;
-@}
-@end smallexample
-@end cartouche
-
-@deftypefn Constructor {} streammarker::streammarker (streambuf* @var{sbuf})
-Create a @code{streammarker} associated with @var{sbuf}
-that remembers the current position of the get pointer.
-@end deftypefn
-
-@deftypefn Method int streammarker::delta (streammarker& @var{mark2})
-Return the difference between the get positions corresponding
-to @code{*this} and @var{mark2} (which must point into the same
-@code{streambuffer} as @code{this}).
-@end deftypefn
-
-@deftypefn Method int streammarker::delta ()
-Return the position relative to the streambuffer's current get position.
-@end deftypefn
-
-@deftypefn Method int streambuf::seekmark (streammarker& @var{mark})
-Move the get pointer to where it (logically) was when @var{mark}
-was constructed.
-@end deftypefn
-
-@node Indirectbuf
-@section Forwarding I/O activity
-
-An @dfn{indirectbuf} is one that forwards all of its I/O requests
-to another streambuf.
-
-@ignore
-@c FIXME-future: get_stream and put_stream are so far undocumented.
-All get-related requests are sent to get_stream().
-All put-related requests are sent to put_stream().
-@end ignore
-
-An @code{indirectbuf} can be used to implement Common Lisp
-synonym-streams and two-way-streams:
-
-@example
-class synonymbuf : public indirectbuf @{
- Symbol *sym;
- synonymbuf(Symbol *s) @{ sym = s; @}
- virtual streambuf *lookup_stream(int mode) @{
- return coerce_to_streambuf(lookup_value(sym)); @}
-@};
-@end example
-
-@node Stdio
-@chapter C Input and Output
-
-@code{libio} is distributed with a complete implementation of the ANSI C
-@code{stdio} facility. It is implemented using @code{streambuf}
-objects. @xref{Stdiobuf,,Wrappers for C @code{stdio}}.
-
-The @code{stdio} package is intended as a replacement for the whatever
-@code{stdio} is in your C library.
-@ignore
-@c FIXME-future: This is not useful unless we specify what problems.
-It can co-exist with C libraries that have alternate implementations of
-stdio, but there may be some problems.
-@end ignore
-Since @code{stdio} works best when you build @code{libc} to contain it, and
-that may be inconvenient, it is not installed by default.
-
-Extensions beyond @sc{ansi}:
-
-@itemize @bullet
-@item
-A stdio @code{FILE} is identical to a streambuf.
-Hence there is no need to worry about synchronizing C and C++
-input/output---they are by definition always synchronized.
-
-@item
-If you create a new streambuf sub-class (in C++), you can use it as a
-@code{FILE} from C. Thus the system is extensible using the standard
-@code{streambuf} protocol.
-
-@item
-You can arbitrarily mix reading and writing, without having to seek
-in between.
-
-@item
-Unbounded @code{ungetc()} buffer.
-@end itemize
-
-@ignore
-@c FIXME-future: Per says this is not ready to go public at v0.5
-@node Libio buffer management
-@chapter Libio buffer management
-
-The libio user functions present an abstract sequence of characters,
-that they read and write from. A number of buffers are used to go
-between the user program and the abstract sequence. These buffers are
-concrete arrays of characters that contain some sub-sequence of the
-abstract sequence.
-
-The libio buffer management protocol is fairly complex. Its design is
-based on the C++ @code{streambuf} protocol, so that the C++
-@code{streambuf} classes can be trivially implemented on top of the
-libio protocol.
-
-The @dfn{write area} contains characters waiting for output.
-
-The @dfn{read area} contains characters available for reading.
-
-The @dfn{reserve area} is available to virtual methods.
-Usually, the get and/or put areas are part of the reserve area.
-
-The @dfn{main get area} contains characters that have
-been read in from the character source, but not yet
-read by the application.
-
-The @dfn{backup area} contains previously read data that is being saved
-because of a user request, or that have been "unread" (put back).
-@end ignore
-
-@ignore
-@c Per says this design is not finished
-@node Streambuf internals
-@chapter Streambuf internals
-
-@menu
-* Buffer management::
-* Filebuf internals::
-@end menu
-
-@node Buffer management
-@section Buffer management
-
-@subsection Areas
-
-NOTE: This chapter is due for an update.
-
-Streambuf buffer management is fairly sophisticated (this is a
-nice way to say "complicated"). The standard protocol
-has the following "areas":
-
-@itemize @bullet
-@cindex put area
-@item
-The @dfn{put area} contains characters waiting for output.
-@cindex get area
-@item
-The @dfn{get area} contains characters available for reading.
-@cindex reserve area
-@item
-The @dfn{reserve area} is available to virtual methods.
-Usually, the get and/or put areas are part of the reserve area.
-@end itemize
-
-The @sc{gnu} @code{streambuf} design extends this by supporting two
-get areas:
-@itemize @bullet
-@cindex main get area
-@item
-The @dfn{main get area} contains characters that have
-been read in from the character source, but not yet
-read by the application.
-@cindex backup area
-@item
-The @dfn{backup area} contains previously read data that is being
-saved because of a user request, or that have been "unread" (putback).
-@end itemize
-
-The backup and the main get area are logically contiguous: That is,
-the first character of the main get area follows the last character
-of the backup area.
-
-The @dfn{current get area} is whichever one of the backup or
-main get areas that is currently being read from.
-The other of the two is the @dfn{non-current get area}.
-
-@subsection Pointers
-
-The following @code{char*} pointers define the various areas.
-
-@deftypefn Method char* streambuf::base ()
-The start of the reserve area.
-@end deftypefn
-
-@deftypefn Method char* streambuf::ebuf ()
-The end of the reserve area.
-@end deftypefn
-
-@deftypefn Method char* streambuf::Gbase ()
-The start of the main get area.
-@end deftypefn
-
-@deftypefn Method char* streambuf::eGptr ()
-The end of the main get area.
-@end deftypefn
-
-@deftypefn Method char* streambuf::Bbase ()
-The start of the backup area.
-@end deftypefn
-
-@deftypefn Method char* streambuf::Bptr ()
-The start of the used part of the backup area.
-The area (@code{Bptr()} .. @code{eBptr()}) contains data that has been
-pushed back, while (@code{Bbase()} .. @code{eBptr()}) contains unused
-space available for future putbacks.
-@end deftypefn
-
-@deftypefn Method char* streambuf::eBptr ()
-The end of the backup area.
-@end deftypefn
-
-@deftypefn Method char* streambuf::Nbase ()
-The start of the non-current get area (either @code{main_gbase} or @code{backup_gbase}).
-@end deftypefn
-
-@deftypefn Method char* streambuf::eNptr ()
-The end of the non-current get area.
-@end deftypefn
-
-@node Filebuf internals
-@section Filebuf internals
-
-The @code{filebuf} is used a lot, so it is importamt that it be
-efficient. It is also supports rather complex semantics.
-so let us examine its implementation.
-
-@subsection Tied read and write pointers
-
-The streambuf model allows completely independent read and write pointers.
-However, a @code{filebuf} has only a single logical pointer used
-for both reads and writes. Since the @code{streambuf} protocol
-uses @code{gptr()} for reading and @code{pptr()} for writing,
-we map the logical file pointer into either @code{gptr()} or @code{pptr()}
-at different times.
-
-@itemize @bullet
-@item
-Reading is allowed when @code{gptr() < egptr()}, which we call get mode.
-
-@item
-Writing is allowed when @code{pptr() < epptr()}, which we call put mode.
-@end itemize
-
-@noindent
-A @code{filebuf} cannot be in get mode and put mode at the same time.
-
-We have up to two buffers:
-
-@itemize @bullet
-@item
-The backup area, defined by @code{Bbase()}, @code{Bptr()}, and @code{eBptr()}.
-This can be empty.
-
-@item
-The reserve area, which also contains the main get area.
-For an unbuffered file, the (@code{shortbuf()}..@code{shortbuf()+1}) is used,
-where @code{shortbuf()} points to a 1-byte buffer that is part of
-the @code{filebuf}.
-@end itemize
-
-@noindent
-The file system's idea of the current position is @code{eGptr()}.
-
-Characters that have been written into a buffer but not yet written
-out (flushed) to the file systems are those between @code{pbase()}
-and @code{pptr()}.
-
-The end of the valid data bytes is:
-@code{pptr() > eGptr() && pptr() < ebuf() ? pptr() : eGptr()}.
-
-If the @code{filebuf} is unbuffered or line buffered,
-the @code{eptr()} is @code{pbase()}. This forces a call
-to @code{overflow()} on each put of a character.
-The logical @code{epptr()} is @code{epptr() ? ebuf() : NULL}.
-(If the buffer is read-only, set @code{pbase()}, @code{pptr()},
-and @code{epptr()} to @code{NULL}. NOT!)
-@end ignore
-
-@node Index
-@unnumbered Index
-@printindex cp
-
-@contents
-@bye
diff --git a/contrib/libg++/libio/iostreamP.h b/contrib/libg++/libio/iostreamP.h
deleted file mode 100644
index c9c40cb6ba9a..000000000000
--- a/contrib/libg++/libio/iostreamP.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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 "streambuf.h"
-#include "libioP.h"
diff --git a/contrib/libg++/libio/iostrerror.c b/contrib/libg++/libio/iostrerror.c
deleted file mode 100644
index 65aa25d5e4e6..000000000000
--- a/contrib/libg++/libio/iostrerror.c
+++ /dev/null
@@ -1,12 +0,0 @@
-/* This should be replaced by whatever namespace-clean
- version of strerror you have available. */
-
-#include "libioP.h"
-extern char *strerror __P ((int));
-
-char *
-DEFUN(_IO_strerror, (errnum),
- int errnum)
-{
- return strerror(errnum);
-}
diff --git a/contrib/libg++/libio/ioungetc.c b/contrib/libg++/libio/ioungetc.c
deleted file mode 100644
index 033f652a0670..000000000000
--- a/contrib/libg++/libio/ioungetc.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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"
-
-int
-DEFUN(_IO_ungetc, (c, fp),
- int c AND _IO_FILE *fp)
-{
- CHECK_FILE(fp, EOF);
- if (c == EOF)
- return EOF;
- return _IO_sputbackc(fp, (unsigned char)c);
-}
diff --git a/contrib/libg++/libio/iovfprintf.c b/contrib/libg++/libio/iovfprintf.c
deleted file mode 100644
index c6ba7957d719..000000000000
--- a/contrib/libg++/libio/iovfprintf.c
+++ /dev/null
@@ -1,881 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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. */
-
-/*
- * Copyright (c) 1990 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms are permitted
- * provided that the above copyright notice and this paragraph are
- * duplicated in all such forms and that any documentation,
- * advertising materials, and other materials related to such
- * distribution and use acknowledge that the software was developed
- * by the University of California, Berkeley. The name of the
- * University may not be used to endorse or promote products derived
- * from this software without specific prior written permission.
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- */
-
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "%W% (Berkeley) %G%";
-#endif /* LIBC_SCCS and not lint */
-
-/*
- * Actual printf innards.
- *
- * This code is large and complicated...
- */
-
-#include <sys/types.h>
-#include "libioP.h"
-#include <string.h>
-#ifdef __STDC__
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
-
-/*
- * Define FLOATING_POINT to get floating point.
- */
-#ifndef NO_FLOATING_POINT
-#define FLOATING_POINT
-#endif
-
-/* end of configuration stuff */
-
-
-/*
- * Helper "class" for `fprintf to unbuffered': creates a
- * temporary buffer. */
-
-struct helper_file
-{
- struct _IO_FILE_plus _f;
- _IO_FILE *_put_stream;
-};
-
-static int
-DEFUN(_IO_helper_overflow, (fp, c),
- _IO_FILE *fp AND int c)
-{
- _IO_FILE *target = ((struct helper_file*)fp)->_put_stream;
- int used = fp->_IO_write_ptr - fp->_IO_write_base;
- if (used)
- {
- _IO_sputn(target, fp->_IO_write_base, used);
- fp->_IO_write_ptr -= used;
- }
- return _IO_putc (c, fp);
-}
-
-static struct _IO_jump_t _IO_helper_jumps = {
- JUMP_INIT_DUMMY,
- JUMP_INIT(finish, _IO_default_finish),
- JUMP_INIT(overflow, _IO_helper_overflow),
- JUMP_INIT(underflow, _IO_default_underflow),
- JUMP_INIT(uflow, _IO_default_uflow),
- JUMP_INIT(pbackfail, _IO_default_pbackfail),
- JUMP_INIT(xsputn, _IO_default_xsputn),
- JUMP_INIT(xsgetn, _IO_default_xsgetn),
- JUMP_INIT(seekoff, _IO_default_seekoff),
- JUMP_INIT(seekpos, _IO_default_seekpos),
- JUMP_INIT(setbuf, _IO_default_setbuf),
- JUMP_INIT(sync, _IO_default_sync),
- JUMP_INIT(doallocate, _IO_default_doallocate),
- JUMP_INIT(read, _IO_default_read),
- JUMP_INIT(write, _IO_default_write),
- JUMP_INIT(seek, _IO_default_seek),
- JUMP_INIT(close, _IO_default_close),
- JUMP_INIT(stat, _IO_default_stat)
-};
-
-static int
-DEFUN(helper_vfprintf, (fp, fmt0, ap),
- register _IO_FILE* fp AND char const *fmt0 AND _IO_va_list ap)
-{
- char buf[_IO_BUFSIZ];
- struct helper_file helper;
- register _IO_FILE *hp = (_IO_FILE*)&helper;
- int result, to_flush;
-
- /* initialize helper */
- helper._put_stream = fp;
- hp->_IO_write_base = buf;
- hp->_IO_write_ptr = buf;
- hp->_IO_write_end = buf+_IO_BUFSIZ;
- hp->_IO_file_flags = _IO_MAGIC|_IO_NO_READS;
- _IO_JUMPS(hp) = &_IO_helper_jumps;
-
- /* Now print to helper instead. */
- result = _IO_vfprintf(hp, fmt0, ap);
-
- /* Now flush anything from the helper to the fp. */
- if ((to_flush = hp->_IO_write_ptr - hp->_IO_write_base) > 0)
- {
- if (_IO_sputn(fp, hp->_IO_write_base, to_flush) != to_flush)
- return EOF;
- }
- return result;
-}
-
-#ifdef FLOATING_POINT
-
-#include "floatio.h"
-#define BUF (MAXEXP+MAXFRACT+1) /* + decimal point */
-#define DEFPREC 6
-extern double modf __P((double, double*));
-
-#else /* no FLOATING_POINT */
-
-#define BUF 40
-
-#endif /* FLOATING_POINT */
-
-
-/*
- * Macros for converting digits to letters and vice versa
- */
-#define to_digit(c) ((c) - '0')
-#define is_digit(c) ((unsigned)to_digit(c) <= 9)
-#define to_char(n) ((n) + '0')
-
-/*
- * Flags used during conversion.
- */
-#define LONGINT 0x01 /* long integer */
-#define LONGDBL 0x02 /* long double; unimplemented */
-#define SHORTINT 0x04 /* short integer */
-#define ALT 0x08 /* alternate form */
-#define LADJUST 0x10 /* left adjustment */
-#define ZEROPAD 0x20 /* zero (as opposed to blank) pad */
-#define HEXPREFIX 0x40 /* add 0x or 0X prefix */
-
-int
-DEFUN(_IO_vfprintf, (fp, fmt0, ap),
- register _IO_FILE* fp AND char const *fmt0 AND _IO_va_list ap)
-{
- register const char *fmt; /* format string */
- register int ch; /* character from fmt */
- register int n; /* handy integer (short term usage) */
- register char *cp; /* handy char pointer (short term usage) */
- const char *fmark; /* for remembering a place in fmt */
- register int flags; /* flags as above */
- int ret; /* return value accumulator */
- int width; /* width from format (%8d), or 0 */
- int prec; /* precision from format (%.3d), or -1 */
- char sign; /* sign prefix (' ', '+', '-', or \0) */
-#ifdef FLOATING_POINT
- int softsign; /* temporary negative sign for floats */
- double _double; /* double precision arguments %[eEfgG] */
-#ifndef _IO_USE_DTOA
- int fpprec; /* `extra' floating precision in [eEfgG] */
-#endif
-#endif
- unsigned long _ulong; /* integer arguments %[diouxX] */
- enum { OCT, DEC, HEX } base;/* base for [diouxX] conversion */
- int dprec; /* a copy of prec if [diouxX], 0 otherwise */
- int dpad; /* extra 0 padding needed for integers */
- int fieldsz; /* field size expanded by sign, dpad etc */
- /* The initialization of 'size' is to suppress a warning that
- 'size' might be used unitialized. It seems gcc can't
- quite grok this spaghetti code ... */
- int size = 0; /* size of converted field or string */
- char buf[BUF]; /* space for %c, %[diouxX], %[eEfgG] */
- char ox[2]; /* space for 0x hex-prefix */
-
- /*
- * BEWARE, these `goto error' on error, and PAD uses `n'.
- */
-#define PRINT(ptr, len) \
- do { if (_IO_sputn(fp,ptr, len) != len) goto error; } while (0)
-#define PAD_SP(howmany) if (_IO_padn(fp, ' ', howmany) < (howmany)) goto error;
-#define PAD_0(howmany) if (_IO_padn(fp, '0', howmany) < (howmany)) goto error;
-
- /*
- * To extend shorts properly, we need both signed and unsigned
- * argument extraction methods.
- */
-#define SARG() \
- (flags&LONGINT ? va_arg(ap, long) : \
- flags&SHORTINT ? (long)(short)va_arg(ap, int) : \
- (long)va_arg(ap, int))
-#define UARG() \
- (flags&LONGINT ? va_arg(ap, unsigned long) : \
- flags&SHORTINT ? (unsigned long)(unsigned short)va_arg(ap, int) : \
- (unsigned long)va_arg(ap, unsigned int))
-
- /* optimise stderr (and other unbuffered Unix files) */
- if (fp->_IO_file_flags & _IO_UNBUFFERED)
- return helper_vfprintf(fp, fmt0, ap);
-
- fmt = fmt0;
- ret = 0;
-
- /*
- * Scan the format for conversions (`%' character).
- */
- for (;;) {
- for (fmark = fmt; (ch = *fmt) != '\0' && ch != '%'; fmt++)
- /* void */;
- if ((n = fmt - fmark) != 0) {
- PRINT(fmark, n);
- ret += n;
- }
- if (ch == '\0')
- goto done;
- fmt++; /* skip over '%' */
-
- flags = 0;
- dprec = 0;
-#if defined(FLOATING_POINT) && !defined (_IO_USE_DTOA)
- fpprec = 0;
-#endif
- width = 0;
- prec = -1;
- sign = '\0';
-
-rflag: ch = *fmt++;
-reswitch: switch (ch) {
- case ' ':
- /*
- * ``If the space and + flags both appear, the space
- * flag will be ignored.''
- * -- ANSI X3J11
- */
- if (!sign)
- sign = ' ';
- goto rflag;
- case '#':
- flags |= ALT;
- goto rflag;
- case '*':
- /*
- * ``A negative field width argument is taken as a
- * - flag followed by a positive field width.''
- * -- ANSI X3J11
- * They don't exclude field widths read from args.
- */
- if ((width = va_arg(ap, int)) >= 0)
- goto rflag;
- width = -width;
- /* FALLTHROUGH */
- case '-':
- flags |= LADJUST;
- flags &= ~ZEROPAD; /* '-' disables '0' */
- goto rflag;
- case '+':
- sign = '+';
- goto rflag;
- case '.':
- if ((ch = *fmt++) == '*') {
- n = va_arg(ap, int);
- prec = n < 0 ? -1 : n;
- goto rflag;
- }
- n = 0;
- while (is_digit(ch)) {
- n = 10 * n + to_digit(ch);
- ch = *fmt++;
- }
- prec = n < 0 ? -1 : n;
- goto reswitch;
- case '0':
- /*
- * ``Note that 0 is taken as a flag, not as the
- * beginning of a field width.''
- * -- ANSI X3J11
- */
- if (!(flags & LADJUST))
- flags |= ZEROPAD; /* '-' disables '0' */
- goto rflag;
- case '1': case '2': case '3': case '4':
- case '5': case '6': case '7': case '8': case '9':
- n = 0;
- do {
- n = 10 * n + to_digit(ch);
- ch = *fmt++;
- } while (is_digit(ch));
- width = n;
- goto reswitch;
-#ifdef FLOATING_POINT
- case 'L':
- flags |= LONGDBL;
- goto rflag;
-#endif
- case 'h':
- flags |= SHORTINT;
- goto rflag;
- case 'l':
- flags |= LONGINT;
- goto rflag;
- case 'c':
- *(cp = buf) = va_arg(ap, int);
- size = 1;
- sign = '\0';
- break;
- case 'D':
- flags |= LONGINT;
- /*FALLTHROUGH*/
- case 'd':
- case 'i':
- _ulong = SARG();
- if ((long)_ulong < 0) {
- _ulong = -_ulong;
- sign = '-';
- }
- base = DEC;
- goto number;
-#ifdef FLOATING_POINT
- case 'e':
- case 'E':
- case 'f':
- case 'F':
- case 'g':
- case 'G':
- _double = va_arg(ap, double);
-#ifdef _IO_USE_DTOA
- {
- int fmt_flags = 0;
- int fill = ' ';
- if (flags & ALT)
- fmt_flags |= _IO_SHOWPOINT;
- if (flags & LADJUST)
- fmt_flags |= _IO_LEFT;
- else if (flags & ZEROPAD)
- fmt_flags |= _IO_INTERNAL, fill = '0';
- n = _IO_outfloat(_double, fp, ch, width,
- prec < 0 ? DEFPREC : prec,
- fmt_flags, sign, fill);
- if (n < 0)
- goto error;
- ret += n;
- }
- /* CHECK ERROR! */
- continue;
-#else
- /*
- * don't do unrealistic precision; just pad it with
- * zeroes later, so buffer size stays rational.
- */
- if (prec > MAXFRACT) {
- if ((ch != 'g' && ch != 'G') || (flags&ALT))
- fpprec = prec - MAXFRACT;
- prec = MAXFRACT;
- } else if (prec == -1)
- prec = DEFPREC;
- /* __cvt_double may have to round up before the
- "start" of its buffer, i.e.
- ``intf("%.2f", (double)9.999);'';
- if the first character is still NUL, it did.
- softsign avoids negative 0 if _double < 0 but
- no significant digits will be shown. */
- cp = buf;
- *cp = '\0';
- size = __cvt_double(_double, prec, flags, &softsign,
- ch, cp, buf + sizeof(buf));
- if (softsign)
- sign = '-';
- if (*cp == '\0')
- cp++;
- break;
-#endif
-#endif /* FLOATING_POINT */
- case 'n':
- if (flags & LONGINT)
- *va_arg(ap, long *) = ret;
- else if (flags & SHORTINT)
- *va_arg(ap, short *) = ret;
- else
- *va_arg(ap, int *) = ret;
- continue; /* no output */
- case 'O':
- flags |= LONGINT;
- /*FALLTHROUGH*/
- case 'o':
- _ulong = UARG();
- base = OCT;
- goto nosign;
- case 'p':
- /*
- * ``The argument shall be a pointer to void. The
- * value of the pointer is converted to a sequence
- * of printable characters, in an implementation-
- * defined manner.''
- * -- ANSI X3J11
- */
- /* NOSTRICT */
- _ulong = (unsigned long)va_arg(ap, void *);
- base = HEX;
- flags |= HEXPREFIX;
- ch = 'x';
- goto nosign;
- case 's':
- if ((cp = va_arg(ap, char *)) == NULL)
- cp = "(null)";
- if (prec >= 0) {
- /*
- * can't use strlen; can only look for the
- * NUL in the first `prec' characters, and
- * strlen() will go further.
- */
- char *p = (char*)memchr(cp, 0, prec);
-
- if (p != NULL) {
- size = p - cp;
- if (size > prec)
- size = prec;
- } else
- size = prec;
- } else
- size = strlen(cp);
- sign = '\0';
- break;
- case 'U':
- flags |= LONGINT;
- /*FALLTHROUGH*/
- case 'u':
- _ulong = UARG();
- base = DEC;
- goto nosign;
- case 'X':
- case 'x':
- _ulong = UARG();
- base = HEX;
- /* leading 0x/X only if non-zero */
- if (flags & ALT && _ulong != 0)
- flags |= HEXPREFIX;
-
- /* unsigned conversions */
-nosign: sign = '\0';
- /*
- * ``... diouXx conversions ... if a precision is
- * specified, the 0 flag will be ignored.''
- * -- ANSI X3J11
- */
-number: if ((dprec = prec) >= 0)
- flags &= ~ZEROPAD;
-
- /*
- * ``The result of converting a zero value with an
- * explicit precision of zero is no characters.''
- * -- ANSI X3J11
- */
- cp = buf + BUF;
- if (_ulong != 0 || prec != 0) {
- char *xdigs; /* digits for [xX] conversion */
- /*
- * unsigned mod is hard, and unsigned mod
- * by a constant is easier than that by
- * a variable; hence this switch.
- */
- switch (base) {
- case OCT:
- do {
- *--cp = to_char(_ulong & 7);
- _ulong >>= 3;
- } while (_ulong);
- /* handle octal leading 0 */
- if (flags & ALT && *cp != '0')
- *--cp = '0';
- break;
-
- case DEC:
- /* many numbers are 1 digit */
- while (_ulong >= 10) {
- *--cp = to_char(_ulong % 10);
- _ulong /= 10;
- }
- *--cp = to_char(_ulong);
- break;
-
- case HEX:
- if (ch == 'X')
- xdigs = "0123456789ABCDEF";
- else /* ch == 'x' || ch == 'p' */
- xdigs = "0123456789abcdef";
- do {
- *--cp = xdigs[_ulong & 15];
- _ulong >>= 4;
- } while (_ulong);
- break;
-
- default:
- cp = "bug in vform: bad base";
- goto skipsize;
- }
- }
- size = buf + BUF - cp;
- skipsize:
- break;
- default: /* "%?" prints ?, unless ? is NUL */
- if (ch == '\0')
- goto done;
- /* pretend it was %c with argument ch */
- cp = buf;
- *cp = ch;
- size = 1;
- sign = '\0';
- break;
- }
-
- /*
- * All reasonable formats wind up here. At this point,
- * `cp' points to a string which (if not flags&LADJUST)
- * should be padded out to `width' places. If
- * flags&ZEROPAD, it should first be prefixed by any
- * sign or other prefix; otherwise, it should be blank
- * padded before the prefix is emitted. After any
- * left-hand padding and prefixing, emit zeroes
- * required by a decimal [diouxX] precision, then print
- * the string proper, then emit zeroes required by any
- * leftover floating precision; finally, if LADJUST,
- * pad with blanks.
- */
-
- /*
- * compute actual size, so we know how much to pad.
- */
-#if defined(FLOATING_POINT) && !defined (_IO_USE_DTOA)
- fieldsz = size + fpprec;
-#else
- fieldsz = size;
-#endif
- dpad = dprec - size;
- if (dpad < 0)
- dpad = 0;
-
- if (sign)
- fieldsz++;
- else if (flags & HEXPREFIX)
- fieldsz += 2;
- fieldsz += dpad;
-
- /* right-adjusting blank padding */
- if ((flags & (LADJUST|ZEROPAD)) == 0)
- PAD_SP(width - fieldsz);
-
- /* prefix */
- if (sign) {
- PRINT(&sign, 1);
- } else if (flags & HEXPREFIX) {
- ox[0] = '0';
- ox[1] = ch;
- PRINT(ox, 2);
- }
-
- /* right-adjusting zero padding */
- if ((flags & (LADJUST|ZEROPAD)) == ZEROPAD)
- PAD_0(width - fieldsz);
-
- /* leading zeroes from decimal precision */
- PAD_0(dpad);
-
- /* the string or number proper */
- PRINT(cp, size);
-
-#if defined(FLOATING_POINT) && !defined (_IO_USE_DTOA)
- /* trailing f.p. zeroes */
- PAD_0(fpprec);
-#endif
-
- /* left-adjusting padding (always blank) */
- if (flags & LADJUST)
- PAD_SP(width - fieldsz);
-
- /* finally, adjust ret */
- ret += width > fieldsz ? width : fieldsz;
-
- }
-done:
- return ret;
-error:
- return EOF;
- /* NOTREACHED */
-}
-
-#if defined(FLOATING_POINT) && !defined(_IO_USE_DTOA)
-
-static char *exponent(register char *p, register int exp, int fmtch)
-{
- register char *t;
- char expbuf[MAXEXP];
-
- *p++ = fmtch;
- if (exp < 0) {
- exp = -exp;
- *p++ = '-';
- }
- else
- *p++ = '+';
- t = expbuf + MAXEXP;
- if (exp > 9) {
- do {
- *--t = to_char(exp % 10);
- } while ((exp /= 10) > 9);
- *--t = to_char(exp);
- for (; t < expbuf + MAXEXP; *p++ = *t++);
- }
- else {
- *p++ = '0';
- *p++ = to_char(exp);
- }
- return (p);
-}
-
-static char * round(double fract, int *exp,
- register char *start, register char *end,
- char ch, int *signp)
-{
- double tmp;
-
- if (fract)
- (void)modf(fract * 10, &tmp);
- else
- tmp = to_digit(ch);
- if (tmp > 4)
- for (;; --end) {
- if (*end == '.')
- --end;
- if (++*end <= '9')
- break;
- *end = '0';
- if (end == start) {
- if (exp) { /* e/E; increment exponent */
- *end = '1';
- ++*exp;
- }
- else { /* f; add extra digit */
- *--end = '1';
- --start;
- }
- break;
- }
- }
- /* ``"%.3f", (double)-0.0004'' gives you a negative 0. */
- else if (*signp == '-')
- for (;; --end) {
- if (*end == '.')
- --end;
- if (*end != '0')
- break;
- if (end == start)
- *signp = 0;
- }
- return (start);
-}
-
-int __cvt_double(double number, register int prec, int flags, int *signp,
- int fmtch, char *startp, char *endp)
-{
- register char *p, *t;
- register double fract;
- int dotrim = 0, expcnt, gformat = 0;
- double integer, tmp;
-
- expcnt = 0;
- if (number < 0) {
- number = -number;
- *signp = '-';
- } else
- *signp = 0;
-
- fract = modf(number, &integer);
-
- /* get an extra slot for rounding. */
- t = ++startp;
-
- /*
- * get integer portion of number; put into the end of the buffer; the
- * .01 is added for modf(356.0 / 10, &integer) returning .59999999...
- */
- for (p = endp - 1; integer; ++expcnt) {
- tmp = modf(integer / 10, &integer);
- *p-- = to_char((int)((tmp + .01) * 10));
- }
- switch (fmtch) {
- case 'f':
- case 'F':
- /* reverse integer into beginning of buffer */
- if (expcnt)
- for (; ++p < endp; *t++ = *p);
- else
- *t++ = '0';
- /*
- * if precision required or alternate flag set, add in a
- * decimal point.
- */
- if (prec || flags&ALT)
- *t++ = '.';
- /* if requires more precision and some fraction left */
- if (fract) {
- if (prec)
- do {
- fract = modf(fract * 10, &tmp);
- *t++ = to_char((int)tmp);
- } while (--prec && fract);
- if (fract)
- startp = round(fract, (int *)NULL, startp,
- t - 1, (char)0, signp);
- }
- for (; prec--; *t++ = '0');
- break;
- case 'e':
- case 'E':
-eformat: if (expcnt) {
- *t++ = *++p;
- if (prec || flags&ALT)
- *t++ = '.';
- /* if requires more precision and some integer left */
- for (; prec && ++p < endp; --prec)
- *t++ = *p;
- /*
- * if done precision and more of the integer component,
- * round using it; adjust fract so we don't re-round
- * later.
- */
- if (!prec && ++p < endp) {
- fract = 0;
- startp = round((double)0, &expcnt, startp,
- t - 1, *p, signp);
- }
- /* adjust expcnt for digit in front of decimal */
- --expcnt;
- }
- /* until first fractional digit, decrement exponent */
- else if (fract) {
- /* adjust expcnt for digit in front of decimal */
- for (expcnt = -1;; --expcnt) {
- fract = modf(fract * 10, &tmp);
- if (tmp)
- break;
- }
- *t++ = to_char((int)tmp);
- if (prec || flags&ALT)
- *t++ = '.';
- }
- else {
- *t++ = '0';
- if (prec || flags&ALT)
- *t++ = '.';
- }
- /* if requires more precision and some fraction left */
- if (fract) {
- if (prec)
- do {
- fract = modf(fract * 10, &tmp);
- *t++ = to_char((int)tmp);
- } while (--prec && fract);
- if (fract)
- startp = round(fract, &expcnt, startp,
- t - 1, (char)0, signp);
- }
- /* if requires more precision */
- for (; prec--; *t++ = '0');
-
- /* unless alternate flag, trim any g/G format trailing 0's */
- if (gformat && !(flags&ALT)) {
- while (t > startp && *--t == '0');
- if (*t == '.')
- --t;
- ++t;
- }
- t = exponent(t, expcnt, fmtch);
- break;
- case 'g':
- case 'G':
- /* a precision of 0 is treated as a precision of 1. */
- if (!prec)
- ++prec;
- /*
- * ``The style used depends on the value converted; style e
- * will be used only if the exponent resulting from the
- * conversion is less than -4 or greater than the precision.''
- * -- ANSI X3J11
- */
- if (expcnt > prec || (!expcnt && fract && fract < .0001)) {
- /*
- * g/G format counts "significant digits, not digits of
- * precision; for the e/E format, this just causes an
- * off-by-one problem, i.e. g/G considers the digit
- * before the decimal point significant and e/E doesn't
- * count it as precision.
- */
- --prec;
- fmtch -= 2; /* G->E, g->e */
- gformat = 1;
- goto eformat;
- }
- /*
- * reverse integer into beginning of buffer,
- * note, decrement precision
- */
- if (expcnt)
- for (; ++p < endp; *t++ = *p, --prec);
- else
- *t++ = '0';
- /*
- * if precision required or alternate flag set, add in a
- * decimal point. If no digits yet, add in leading 0.
- */
- if (prec || flags&ALT) {
- dotrim = 1;
- *t++ = '.';
- }
- else
- dotrim = 0;
- /* if requires more precision and some fraction left */
- if (fract) {
- if (prec) {
- /* If no integer part, don't count initial
- * zeros as significant digits. */
- do {
- fract = modf(fract * 10, &tmp);
- *t++ = to_char((int)tmp);
- } while(!tmp && !expcnt);
- while (--prec && fract) {
- fract = modf(fract * 10, &tmp);
- *t++ = to_char((int)tmp);
- }
- }
- if (fract)
- startp = round(fract, (int *)NULL, startp,
- t - 1, (char)0, signp);
- }
- /* alternate format, adds 0's for precision, else trim 0's */
- if (flags&ALT)
- for (; prec--; *t++ = '0');
- else if (dotrim) {
- while (t > startp && *--t == '0');
- if (*t != '.')
- ++t;
- }
- }
- return (t - startp);
-}
-
-#endif /* defined(FLOATING_POINT) && !defined(_IO_USE_DTOA) */
diff --git a/contrib/libg++/libio/iovfscanf.c b/contrib/libg++/libio/iovfscanf.c
deleted file mode 100644
index 1220e0750b7f..000000000000
--- a/contrib/libg++/libio/iovfscanf.c
+++ /dev/null
@@ -1,787 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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. */
-
-/*
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms are permitted
- * provided that the above copyright notice and this paragraph are
- * duplicated in all such forms and that any documentation,
- * advertising materials, and other materials related to such
- * distribution and use acknowledge that the software was developed
- * by the University of California, Berkeley. The name of the
- * University may not be used to endorse or promote products derived
- * from this software without specific prior written permission.
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- */
-
-/* Extensively hacked for GNU iostream by Per Bothner 1991, 1992, 1993.
- Changes copyright Free Software Foundation 1992, 1993. */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "%W% (Berkeley) %G%";
-#endif /* LIBC_SCCS and not lint */
-
-#include <libioP.h>
-#include <ctype.h>
-#ifdef __STDC__
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
-
-#ifndef NO_FLOATING_POINT
-#define FLOATING_POINT
-#endif
-
-#ifdef FLOATING_POINT
-#include "floatio.h"
-#define BUF (MAXEXP+MAXFRACT+3) /* 3 = sign + decimal point + NUL */
-#else
-#define BUF 40
-#endif
-
-/*
- * Flags used during conversion.
- */
-#define LONG 0x01 /* l: long or double */
-#define LONGDBL 0x02 /* L: long double; unimplemented */
-#define SHORT 0x04 /* h: short */
-#define SUPPRESS 0x08 /* suppress assignment */
-#define POINTER 0x10 /* weird %p pointer (`fake hex') */
-#define NOSKIP 0x20 /* do not skip blanks */
-#define WIDTH 0x40 /* width */
-
-/*
- * The following are used in numeric conversions only:
- * SIGNOK, NDIGITS, DPTOK, and EXPOK are for floating point;
- * SIGNOK, NDIGITS, PFXOK, and NZDIGITS are for integral.
- */
-#define SIGNOK 0x40 /* +/- is (still) legal */
-#define NDIGITS 0x80 /* no digits detected */
-
-#define DPTOK 0x100 /* (float) decimal point is still legal */
-#define EXPOK 0x200 /* (float) exponent (e+3, etc) still legal */
-
-#define PFXOK 0x100 /* 0x prefix is (still) legal */
-#define NZDIGITS 0x200 /* no zero digits detected */
-
-/*
- * Conversion types.
- */
-#define CT_CHAR 0 /* %c conversion */
-#define CT_CCL 1 /* %[...] conversion */
-#define CT_STRING 2 /* %s conversion */
-#define CT_INT 3 /* integer, i.e., strtol or strtoul */
-#define CT_FLOAT 4 /* floating, i.e., strtod */
-
-#define u_char unsigned char
-#define u_long unsigned long
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-extern u_long strtoul __P((const char*, char**, int));
-extern long strtol __P((const char*, char**, int));
-static const u_char *__sccl __P((char *tab, const u_char *fmt));
-#ifndef _IO_USE_DTOA
-extern double atof();
-#endif
-#ifdef __cplusplus
-}
-#endif
-
-/* If errp != NULL, *errp|=1 if we see a premature EOF;
- *errp|=2 if we an invalid character. */
-
-int
-DEFUN(_IO_vfscanf, (fp, fmt0, ap, errp),
- register _IO_FILE *fp AND char const *fmt0
- AND _IO_va_list ap AND int *errp)
-{
- register const u_char *fmt = (const u_char *)fmt0;
- register int c; /* character from format, or conversion */
- register _IO_ssize_t width; /* field width, or 0 */
- register char *p; /* points into all kinds of strings */
- register int n; /* handy integer */
- register int flags = 0; /* flags as defined above */
- register char *p0; /* saves original value of p when necessary */
- int nassigned; /* number of fields assigned */
- int nread; /* number of characters consumed from fp */
- /* Assignments to base and ccfn are just to suppress warnings from gcc.*/
- int base = 0; /* base argument to strtol/strtoul */
- typedef u_long (*strtoulfn) __P((const char*, char**, int));
- strtoulfn ccfn = 0;
- /* conversion function (strtol/strtoul) */
- char ccltab[256]; /* character class table for %[...] */
- char buf[BUF]; /* buffer for numeric conversions */
- int seen_eof = 0;
-
- /* `basefix' is used to avoid `if' tests in the integer scanner */
- static short basefix[17] =
- { 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 };
-
- nassigned = 0;
- nread = 0;
- for (;;) {
- c = *fmt++;
- if (c == 0)
- goto done;
- if (isspace(c)) {
- for (;;) {
- c = _IO_getc(fp);
- if (c == EOF) {
- seen_eof++;
- break;
- }
- if (!isspace(c)) {
- _IO_ungetc (c, fp);
- break;
- }
- nread++;
- }
- continue;
- }
- if (c != '%')
- goto literal;
- width = 0;
- flags = 0;
- /*
- * switch on the format. continue if done;
- * break once format type is derived.
- */
-again: c = *fmt++;
- switch (c) {
- case '%':
-literal:
- n = _IO_getc(fp);
- if (n == EOF)
- goto eof_failure;
- if (n != c) {
- _IO_ungetc (n, fp);
- goto match_failure;
- }
- nread++;
- continue;
-
- case '*':
- if (flags) goto control_failure;
- flags = SUPPRESS;
- goto again;
- case 'l':
- if (flags & ~(SUPPRESS | WIDTH)) goto control_failure;
- flags |= LONG;
- goto again;
- case 'L':
- if (flags & ~(SUPPRESS | WIDTH)) goto control_failure;
- flags |= LONGDBL;
- goto again;
- case 'h':
- if (flags & ~(SUPPRESS | WIDTH)) goto control_failure;
- flags |= SHORT;
- goto again;
-
- case '0': case '1': case '2': case '3': case '4':
- case '5': case '6': case '7': case '8': case '9':
- if (flags & ~(SUPPRESS | WIDTH)) goto control_failure;
- flags |= WIDTH;
- width = width * 10 + c - '0';
- goto again;
-
- /*
- * Conversions.
- * Those marked `compat' are for 4.[123]BSD compatibility.
- *
- * (According to ANSI, E and X formats are supposed
- * to the same as e and x. Sorry about that.)
- */
- case 'D': /* compat */
- flags |= LONG;
- /* FALLTHROUGH */
- case 'd':
- c = CT_INT;
- ccfn = (strtoulfn)strtol;
- base = 10;
- break;
-
- case 'i':
- c = CT_INT;
- ccfn = (strtoulfn)strtol;
- base = 0;
- break;
-
- case 'O': /* compat */
- flags |= LONG;
- /* FALLTHROUGH */
- case 'o':
- c = CT_INT;
- ccfn = strtoul;
- base = 8;
- break;
-
- case 'u':
- c = CT_INT;
- ccfn = strtoul;
- base = 10;
- break;
-
- case 'X':
- case 'x':
- flags |= PFXOK; /* enable 0x prefixing */
- c = CT_INT;
- ccfn = strtoul;
- base = 16;
- break;
-
-#ifdef FLOATING_POINT
- case 'E': case 'F':
- case 'e': case 'f': case 'g':
- c = CT_FLOAT;
- break;
-#endif
-
- case 's':
- c = CT_STRING;
- break;
-
- case '[':
- fmt = __sccl(ccltab, fmt);
- flags |= NOSKIP;
- c = CT_CCL;
- break;
-
- case 'c':
- flags |= NOSKIP;
- c = CT_CHAR;
- break;
-
- case 'p': /* pointer format is like hex */
- flags |= POINTER | PFXOK;
- c = CT_INT;
- ccfn = strtoul;
- base = 16;
- break;
-
- case 'n':
- if (flags & SUPPRESS) /* ??? */
- continue;
- if (flags & SHORT)
- *va_arg(ap, short *) = nread;
- else if (flags & LONG)
- *va_arg(ap, long *) = nread;
- else
- *va_arg(ap, int *) = nread;
- continue;
-
- /*
- * Disgusting backwards compatibility hacks. XXX
- */
- case '\0': /* compat */
- nassigned = EOF;
- goto done;
-
- default: /* compat */
- if (isupper(c))
- flags |= LONG;
- c = CT_INT;
- ccfn = (strtoulfn)strtol;
- base = 10;
- break;
- }
-
- /*
- * We have a conversion that requires input.
- */
- if (_IO_peekc(fp) == EOF)
- goto eof_failure;
-
- /*
- * Consume leading white space, except for formats
- * that suppress this.
- */
- if ((flags & NOSKIP) == 0) {
- n = (unsigned char)*fp->_IO_read_ptr;
- while (isspace(n)) {
- fp->_IO_read_ptr++;
- nread++;
- n = _IO_peekc(fp);
- if (n == EOF)
- goto eof_failure;
- }
- /* Note that there is at least one character in
- the buffer, so conversions that do not set NOSKIP
- can no longer result in an input failure. */
- }
-
- /*
- * Do the conversion.
- */
- switch (c) {
-
- case CT_CHAR:
- /* scan arbitrary characters (sets NOSKIP) */
- if (width == 0) /* FIXME! */
- width = 1;
- if (flags & SUPPRESS) {
- _IO_size_t sum = 0;
- for (;;) {
- n = fp->_IO_read_end - fp->_IO_read_ptr;
- if (n < (int)width) {
- sum += n;
- width -= n;
- fp->_IO_read_ptr += n;
- if (__underflow(fp) == EOF)
- if (sum == 0)
- goto eof_failure;
- else {
- seen_eof++;
- break;
- }
- } else {
- sum += width;
- fp->_IO_read_ptr += width;
- break;
- }
- }
- nread += sum;
- } else {
- _IO_size_t r =
-
- _IO_XSGETN (fp, (char*)va_arg(ap, char*), width);
- if (r != width)
- goto eof_failure;
- nread += r;
- nassigned++;
- }
- break;
-
- case CT_CCL:
- /* scan a (nonempty) character class (sets NOSKIP) */
- if (width == 0)
- width = ~0; /* `infinity' */
- /* take only those things in the class */
- if (flags & SUPPRESS) {
- n = 0;
- while (ccltab[(unsigned char)*fp->_IO_read_ptr]) {
- n++, fp->_IO_read_ptr++;
- if (--width == 0)
- break;
- if (_IO_peekc(fp) == EOF) {
- if (n == 0)
- goto eof_failure;
- seen_eof++;
- break;
- }
- }
- if (n == 0)
- goto match_failure;
- } else {
- p0 = p = va_arg(ap, char *);
- while (ccltab[(unsigned char)*fp->_IO_read_ptr]) {
- *p++ = *fp->_IO_read_ptr++;
- if (--width == 0)
- break;
- if (_IO_peekc(fp) == EOF) {
- if (p == p0)
- goto eof_failure;
- seen_eof++;
- break;
- }
- }
- n = p - p0;
- if (n == 0)
- goto match_failure;
- *p = 0;
- nassigned++;
- }
- nread += n;
- break;
-
- case CT_STRING:
- /* like CCL, but zero-length string OK, & no NOSKIP */
- if (width == 0)
- width = ~0;
- if (flags & SUPPRESS) {
- n = 0;
- while (!isspace((unsigned char)*fp->_IO_read_ptr)) {
- n++, fp->_IO_read_ptr++;
- if (--width == 0)
- break;
- if (_IO_peekc(fp) == EOF) {
- seen_eof++;
- break;
- }
- }
- nread += n;
- } else {
- p0 = p = va_arg(ap, char *);
- while (!isspace((unsigned char)*fp->_IO_read_ptr)) {
- *p++ = *fp->_IO_read_ptr++;
- if (--width == 0)
- break;
- if (_IO_peekc(fp) == EOF) {
- seen_eof++;
- break;
- }
- }
- *p = 0;
- nread += p - p0;
- nassigned++;
- }
- continue;
-
- case CT_INT:
- /* scan an integer as if by strtol/strtoul */
- if (width == 0 || width > sizeof(buf) - 1)
- width = sizeof(buf) - 1;
- flags |= SIGNOK | NDIGITS | NZDIGITS;
- for (p = buf; width; width--) {
- c = (unsigned char)*fp->_IO_read_ptr;
- /*
- * Switch on the character; `goto ok'
- * if we accept it as a part of number.
- */
- switch (c) {
-
- /*
- * The digit 0 is always legal, but is
- * special. For %i conversions, if no
- * digits (zero or nonzero) have been
- * scanned (only signs), we will have
- * base==0. In that case, we should set
- * it to 8 and enable 0x prefixing.
- * Also, if we have not scanned zero digits
- * before this, do not turn off prefixing
- * (someone else will turn it off if we
- * have scanned any nonzero digits).
- */
- case '0':
- if (base == 0) {
- base = 8;
- flags |= PFXOK;
- }
- if (flags & NZDIGITS)
- flags &= ~(SIGNOK|NZDIGITS|NDIGITS);
- else
- flags &= ~(SIGNOK|PFXOK|NDIGITS);
- goto ok;
-
- /* 1 through 7 always legal */
- case '1': case '2': case '3':
- case '4': case '5': case '6': case '7':
- base = basefix[base];
- flags &= ~(SIGNOK | PFXOK | NDIGITS);
- goto ok;
-
- /* digits 8 and 9 ok iff decimal or hex */
- case '8': case '9':
- base = basefix[base];
- if (base <= 8)
- break; /* not legal here */
- flags &= ~(SIGNOK | PFXOK | NDIGITS);
- goto ok;
-
- /* letters ok iff hex */
- case 'A': case 'B': case 'C':
- case 'D': case 'E': case 'F':
- case 'a': case 'b': case 'c':
- case 'd': case 'e': case 'f':
- /* no need to fix base here */
- if (base <= 10)
- break; /* not legal here */
- flags &= ~(SIGNOK | PFXOK | NDIGITS);
- goto ok;
-
- /* sign ok only as first character */
- case '+': case '-':
- if (flags & SIGNOK) {
- flags &= ~SIGNOK;
- goto ok;
- }
- break;
-
- /* x ok iff flag still set & 2nd char */
- case 'x': case 'X':
- if (flags & PFXOK && p == buf + 1) {
- base = 16; /* if %i */
- flags &= ~PFXOK;
- goto ok;
- }
- break;
- }
-
- /*
- * If we got here, c is not a legal character
- * for a number. Stop accumulating digits.
- */
- break;
- ok:
- /*
- * c is legal: store it and look at the next.
- */
- *p++ = c;
- fp->_IO_read_ptr++;
- if (_IO_peekc(fp) == EOF) {
- seen_eof++;
- break; /* EOF */
- }
- }
- /*
- * If we had only a sign, it is no good; push
- * back the sign. If the number ends in `x',
- * it was [sign] '0' 'x', so push back the x
- * and treat it as [sign] '0'.
- */
- if (flags & NDIGITS) {
- if (p > buf)
- (void) _IO_ungetc(*(u_char *)--p, fp);
- goto match_failure;
- }
- c = ((u_char *)p)[-1];
- if (c == 'x' || c == 'X') {
- --p;
- (void) _IO_ungetc (c, fp);
- }
- if ((flags & SUPPRESS) == 0) {
- u_long res;
-
- *p = 0;
- res = (*ccfn)(buf, (char **)NULL, base);
- if (flags & POINTER)
- *va_arg(ap, void **) = (void *)res;
- else if (flags & SHORT)
- *va_arg(ap, short *) = res;
- else if (flags & LONG)
- *va_arg(ap, long *) = res;
- else
- *va_arg(ap, int *) = res;
- nassigned++;
- }
- nread += p - buf;
- break;
-
-#ifdef FLOATING_POINT
- case CT_FLOAT:
- /* scan a floating point number as if by strtod */
- if (width == 0 || width > sizeof(buf) - 1)
- width = sizeof(buf) - 1;
- flags |= SIGNOK | NDIGITS | DPTOK | EXPOK;
- for (p = buf; width; width--) {
- c = (unsigned char)*fp->_IO_read_ptr;
- /*
- * This code mimicks the integer conversion
- * code, but is much simpler.
- */
- switch (c) {
-
- case '0': case '1': case '2': case '3':
- case '4': case '5': case '6': case '7':
- case '8': case '9':
- flags &= ~(SIGNOK | NDIGITS);
- goto fok;
-
- case '+': case '-':
- if (flags & SIGNOK) {
- flags &= ~SIGNOK;
- goto fok;
- }
- break;
- case '.':
- if (flags & DPTOK) {
- flags &= ~(SIGNOK | DPTOK);
- goto fok;
- }
- break;
- case 'e': case 'E':
- /* no exponent without some digits */
- if ((flags&(NDIGITS|EXPOK)) == EXPOK) {
- flags =
- (flags & ~(EXPOK|DPTOK)) |
- SIGNOK | NDIGITS;
- goto fok;
- }
- break;
- }
- break;
- fok:
- *p++ = c;
- fp->_IO_read_ptr++;
- if (_IO_peekc(fp) == EOF) {
- seen_eof++;
- break; /* EOF */
- }
- }
- /*
- * If no digits, might be missing exponent digits
- * (just give back the exponent) or might be missing
- * regular digits, but had sign and/or decimal point.
- */
- if (flags & NDIGITS) {
- if (flags & EXPOK) {
- /* no digits at all */
- while (p > buf)
- _IO_ungetc (*(u_char *)--p, fp);
- goto match_failure;
- }
- /* just a bad exponent (e and maybe sign) */
- c = *(u_char *)--p;
- if (c != 'e' && c != 'E') {
- (void) _IO_ungetc (c, fp);/* sign */
- c = *(u_char *)--p;
- }
- (void) _IO_ungetc (c, fp);
- }
- if ((flags & SUPPRESS) == 0) {
- double res;
- *p = 0;
-#ifdef _IO_USE_DTOA
- res = _IO_strtod(buf, NULL);
-#else
- res = atof(buf);
-#endif
- if (flags & LONG)
- *va_arg(ap, double *) = res;
- else
- *va_arg(ap, float *) = res;
- nassigned++;
- }
- nread += p - buf;
- break;
-#endif /* FLOATING_POINT */
- }
- }
-eof_failure:
- seen_eof++;
-input_failure:
- if (nassigned == 0)
- nassigned = -1;
-control_failure:
-match_failure:
- if (errp)
- *errp |= 2;
-done:
- if (errp && seen_eof)
- *errp |= 1;
- return (nassigned);
-}
-
-/*
- * Fill in the given table from the scanset at the given format
- * (just after `['). Return a pointer to the character past the
- * closing `]'. The table has a 1 wherever characters should be
- * considered part of the scanset.
- */
-static const u_char *
-DEFUN(__sccl, (tab, fmt),
- register char *tab AND register const u_char *fmt)
-{
- register int c, n, v;
-
- /* first `clear' the whole table */
- c = *fmt++; /* first char hat => negated scanset */
- if (c == '^') {
- v = 1; /* default => accept */
- c = *fmt++; /* get new first char */
- } else
- v = 0; /* default => reject */
- /* should probably use memset here */
- for (n = 0; n < 256; n++)
- tab[n] = v;
- if (c == 0)
- return (fmt - 1);/* format ended before closing ] */
-
- /*
- * Now set the entries corresponding to the actual scanset
- * to the opposite of the above.
- *
- * The first character may be ']' (or '-') without being special;
- * the last character may be '-'.
- */
- v = 1 - v;
- for (;;) {
- tab[c] = v; /* take character c */
-doswitch:
- n = *fmt++; /* and examine the next */
- switch (n) {
-
- case 0: /* format ended too soon */
- return (fmt - 1);
-
- case '-':
- /*
- * A scanset of the form
- * [01+-]
- * is defined as `the digit 0, the digit 1,
- * the character +, the character -', but
- * the effect of a scanset such as
- * [a-zA-Z0-9]
- * is implementation defined. The V7 Unix
- * scanf treats `a-z' as `the letters a through
- * z', but treats `a-a' as `the letter a, the
- * character -, and the letter a'.
- *
- * For compatibility, the `-' is not considerd
- * to define a range if the character following
- * it is either a close bracket (required by ANSI)
- * or is not numerically greater than the character
- * we just stored in the table (c).
- */
- n = *fmt;
- if (n == ']' || n < c) {
- c = '-';
- break; /* resume the for(;;) */
- }
- fmt++;
- do { /* fill in the range */
- tab[++c] = v;
- } while (c < n);
-#if 1 /* XXX another disgusting compatibility hack */
- /*
- * Alas, the V7 Unix scanf also treats formats
- * such as [a-c-e] as `the letters a through e'.
- * This too is permitted by the standard....
- */
- goto doswitch;
-#else
- c = *fmt++;
- if (c == 0)
- return (fmt - 1);
- if (c == ']')
- return (fmt);
-#endif
- break;
-
- case ']': /* end of scanset */
- return (fmt);
-
- default: /* just another character */
- c = n;
- break;
- }
- }
- /* NOTREACHED */
-}
diff --git a/contrib/libg++/libio/iovsprintf.c b/contrib/libg++/libio/iovsprintf.c
deleted file mode 100644
index 06d926d35903..000000000000
--- a/contrib/libg++/libio/iovsprintf.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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 "strfile.h"
-
-int
-DEFUN(_IO_vsprintf, (string, format, args),
- char *string AND const char *format AND _IO_va_list args)
-{
- _IO_strfile sf;
- int ret;
- _IO_init((_IO_FILE*)&sf, 0);
- _IO_JUMPS((_IO_FILE*)&sf) = &_IO_str_jumps;
- _IO_str_init_static ((_IO_FILE*)&sf, string, -1, string);
- ret = _IO_vfprintf((_IO_FILE*)&sf, format, args);
- _IO_putc('\0', (_IO_FILE*)&sf);
- return ret;
-}
diff --git a/contrib/libg++/libio/iovsscanf.c b/contrib/libg++/libio/iovsscanf.c
deleted file mode 100644
index 529778098a55..000000000000
--- a/contrib/libg++/libio/iovsscanf.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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 "strfile.h"
-
-int
-DEFUN(_IO_vsscanf, (string, format, args),
- const char *string AND const char *format AND _IO_va_list args)
-{
- _IO_strfile sf;
- _IO_init((_IO_FILE*)&sf, 0);
- _IO_JUMPS((_IO_FILE*)&sf) = &_IO_str_jumps;
- _IO_str_init_static ((_IO_FILE*)&sf, (char*)string, 0, NULL);
- return _IO_vfscanf((_IO_FILE*)&sf, format, args, NULL);
-}
diff --git a/contrib/libg++/libio/isgetline.cc b/contrib/libg++/libio/isgetline.cc
deleted file mode 100644
index add26638b203..000000000000
--- a/contrib/libg++/libio/isgetline.cc
+++ /dev/null
@@ -1,139 +0,0 @@
-/* This is part of libio/iostream, providing -*- C++ -*- input/output.
-Copyright (C) 1993 Free Software Foundation
-
-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 "iostream.h"
-#include <string.h>
-
-istream& istream::getline(char* buf, int len, char delim)
-{
- _gcount = 0;
- if (len <= 0)
- {
- set(ios::failbit);
- return *this;
- }
- int ch;
- if (ipfx1())
- {
- streambuf *sb = rdbuf();
- _gcount = _IO_getline(sb, buf, len - 1, delim, -1);
- ch = sb->sbumpc();
- if (ch == EOF)
- set (_gcount == 0 ? (ios::failbit|ios::eofbit) : ios::eofbit);
- else if (ch != (unsigned char) delim)
- {
- set(ios::failbit);
- sb->sungetc(); // Leave delimiter unread.
- }
- }
- else
- ch = EOF;
- buf[_gcount] = '\0';
- if (ch == (unsigned char)delim)
- _gcount++; // The delimiter is counted in the gcount().
- return *this;
-}
-
-istream& istream::get(char* buf, int len, char delim)
-{
- _gcount = 0;
- if (len <= 0)
- {
- set(ios::failbit);
- return *this;
- }
- if (ipfx1())
- {
- streambuf *sbuf = rdbuf();
- long count = _IO_getline(sbuf, buf, len - 1, delim, -1);
- if (count == 0 && sbuf->sgetc() == EOF)
- set(ios::failbit|ios::eofbit);
- else
- _gcount = count;
- }
- buf[_gcount] = '\0';
- return *this;
-}
-
-
-// from Doug Schmidt
-
-#define CHUNK_SIZE 512
-
-/* Reads an arbitrarily long input line terminated by a user-specified
- TERMINATOR. Super-nifty trick using recursion avoids unnecessary calls
- to NEW! */
-
-char *_sb_readline (streambuf *sb, long& total, char terminator)
-{
- char buf[CHUNK_SIZE];
- char *ptr;
- int ch;
-
- _IO_size_t count = _IO_getline(sb, buf, CHUNK_SIZE, terminator, -1);
- ch = sb->sbumpc();
- long old_total = total;
- total += count;
- if (ch != EOF && ch != terminator) {
- total++; // Include ch in total.
- ptr = _sb_readline(sb, total, terminator);
- if (ptr) {
- memcpy(ptr + old_total, buf, count);
- ptr[old_total+count] = ch;
- }
- return ptr;
- }
-
- ptr = new char[total+1];
- if (ptr != NULL) {
- ptr[total] = '\0';
- memcpy(ptr + total - count, buf, count);
- }
- return ptr;
-}
-
-/* Reads an arbitrarily long input line terminated by TERMINATOR.
- This routine allocates its own memory, so the user should
- only supply the address of a (char *). */
-
-istream& istream::gets(char **s, char delim /* = '\n' */)
-{
- if (ipfx1()) {
- long size = 0;
- streambuf *sb = rdbuf();
- *s = _sb_readline (sb, size, delim);
- _gcount = *s ? size : 0;
- if (sb->_flags & _IO_EOF_SEEN) {
- set(ios::eofbit);
- if (_gcount == 0)
- set(ios::failbit);
- }
- }
- else {
- _gcount = 0;
- *s = NULL;
- }
- return *this;
-}
diff --git a/contrib/libg++/libio/isgetsb.cc b/contrib/libg++/libio/isgetsb.cc
deleted file mode 100644
index 55617e649a0f..000000000000
--- a/contrib/libg++/libio/isgetsb.cc
+++ /dev/null
@@ -1,59 +0,0 @@
-/* This is part of libio/iostream, providing -*- C++ -*- input/output.
-Copyright (C) 1993 Free Software Foundation
-
-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 "iostream.h"
-#include <string.h>
-
-istream& istream::get(streambuf& sb, char delim /* = '\n' */)
-{
- _gcount = 0;
- if (ipfx1())
- {
- register streambuf* isb = rdbuf();
- for (;;)
- {
- streamsize len = isb->_IO_read_end - isb->_IO_read_ptr;
- if (len <= 0)
- if (__underflow(isb) == EOF)
- break;
- else
- len = isb->_IO_read_end - isb->_IO_read_ptr;
- char *delimp = (char*)memchr((void*)isb->_IO_read_ptr, delim, len);
- if (delimp != NULL)
- len = delimp - isb->_IO_read_ptr;
- int written = sb.sputn(isb->_IO_read_ptr, len);
- isb->_IO_read_ptr += written;
- _gcount += written;
- if (written != len)
- {
- set(ios::failbit);
- break;
- }
- if (delimp != NULL)
- break;
- }
- }
- return *this;
-}
diff --git a/contrib/libg++/libio/isscan.cc b/contrib/libg++/libio/isscan.cc
deleted file mode 100644
index 64d4bc682f82..000000000000
--- a/contrib/libg++/libio/isscan.cc
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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 <iostream.h>
-#include <stdarg.h>
-
-istream& istream::scan(const char *format ...)
-{
- if (ipfx0()) {
- va_list ap;
- va_start(ap, format);
- _strbuf->vscan(format, ap, this);
- va_end(ap);
- }
- return *this;
-}
-
-istream& istream::vscan(const char *format, _IO_va_list args)
-{
- if (ipfx0())
- _strbuf->vscan(format, args, this);
- return *this;
-}
diff --git a/contrib/libg++/libio/istream.h b/contrib/libg++/libio/istream.h
deleted file mode 100644
index f54ec1de9a1c..000000000000
--- a/contrib/libg++/libio/istream.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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 <stream.h>
diff --git a/contrib/libg++/libio/libio.h b/contrib/libg++/libio/libio.h
deleted file mode 100644
index 84a8217ba495..000000000000
--- a/contrib/libg++/libio/libio.h
+++ /dev/null
@@ -1,255 +0,0 @@
-/*
-Copyright (C) 1991, 1992, 1993, 1994 Free Software Foundation
-
-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. */
-
-/* This is part of the iostream library. Written by Per Bothner. */
-
-#ifndef _IO_STDIO_H
-#define _IO_STDIO_H
-
-#include <_G_config.h>
-#define _IO_pos_t _G_fpos_t /* obsolete */
-#define _IO_fpos_t _G_fpos_t
-#define _IO_size_t _G_size_t
-#define _IO_ssize_t _G_ssize_t
-#define _IO_off_t _G_off_t
-#define _IO_pid_t _G_pid_t
-#define _IO_uid_t _G_uid_t
-#define _IO_HAVE_SYS_WAIT _G_HAVE_SYS_WAIT
-#define _IO_HAVE_ST_BLKSIZE _G_HAVE_ST_BLKSIZE
-#define _IO_BUFSIZ _G_BUFSIZ
-#define _IO_va_list _G_va_list
-
-#ifdef _G_NEED_STDARG_H
-/* This define avoids name pollution if we're using GNU stdarg.h */
-#define __need___va_list
-#include <stdarg.h>
-#ifdef __GNUC_VA_LIST
-#undef _IO_va_list
-#define _IO_va_list __gnuc_va_list
-#endif /* __GNUC_VA_LIST */
-#endif
-
-#ifndef __P
-#if _G_HAVE_SYS_CDEFS
-#include <sys/cdefs.h>
-#else
-#ifdef __STDC__
-#define __P(protos) protos
-#else
-#define __P(protos) ()
-#endif
-#endif
-#endif /*!__P*/
-
-/* For backward compatibility */
-#ifndef _PARAMS
-#define _PARAMS(protos) __P(protos)
-#endif /*!_PARAMS*/
-
-#ifndef __STDC__
-#define const
-#endif
-#define _IO_USE_DTOA
-#define _IO_UNIFIED_JUMPTABLES 1
-
-#if 0
-#ifdef _IO_NEED_STDARG_H
-#include <stdarg.h>
-#endif
-#endif
-
-#ifndef EOF
-#define EOF (-1)
-#endif
-#ifndef NULL
-#if !defined(__cplusplus) || defined(__GNUC__)
-#define NULL ((void*)0)
-#else
-#define NULL (0)
-#endif
-#endif
-
-#define _IOS_INPUT 1
-#define _IOS_OUTPUT 2
-#define _IOS_ATEND 4
-#define _IOS_APPEND 8
-#define _IOS_TRUNC 16
-#define _IOS_NOCREATE 32
-#define _IOS_NOREPLACE 64
-#define _IOS_BIN 128
-
-/* Magic numbers and bits for the _flags field.
- The magic numbers use the high-order bits of _flags;
- the remaining bits are abailable for variable flags.
- Note: The magic numbers must all be negative if stdio
- emulation is desired. */
-
-#define _IO_MAGIC 0xFBAD0000 /* Magic number */
-#define _OLD_STDIO_MAGIC 0xFABC0000 /* Emulate old stdio. */
-#define _IO_MAGIC_MASK 0xFFFF0000
-#define _IO_USER_BUF 1 /* User owns buffer; don't delete it on close. */
-#define _IO_UNBUFFERED 2
-#define _IO_NO_READS 4 /* Reading not allowed */
-#define _IO_NO_WRITES 8 /* Writing not allowd */
-#define _IO_EOF_SEEN 0x10
-#define _IO_ERR_SEEN 0x20
-#define _IO_DELETE_DONT_CLOSE 0x40 /* Don't call close(_fileno) on cleanup. */
-#define _IO_LINKED 0x80 /* Set if linked (using _chain) to streambuf::_list_all.*/
-#define _IO_IN_BACKUP 0x100
-#define _IO_LINE_BUF 0x200
-#define _IO_TIED_PUT_GET 0x400 /* Set if put and get pointer logicly tied. */
-#define _IO_CURRENTLY_PUTTING 0x800
-#define _IO_IS_APPENDING 0x1000
-#define _IO_IS_FILEBUF 0x2000
-
-/* These are "formatting flags" matching the iostream fmtflags enum values. */
-#define _IO_SKIPWS 01
-#define _IO_LEFT 02
-#define _IO_RIGHT 04
-#define _IO_INTERNAL 010
-#define _IO_DEC 020
-#define _IO_OCT 040
-#define _IO_HEX 0100
-#define _IO_SHOWBASE 0200
-#define _IO_SHOWPOINT 0400
-#define _IO_UPPERCASE 01000
-#define _IO_SHOWPOS 02000
-#define _IO_SCIENTIFIC 04000
-#define _IO_FIXED 010000
-#define _IO_UNITBUF 020000
-#define _IO_STDIO 040000
-#define _IO_DONT_CLOSE 0100000
-
-/* A streammarker remembers a position in a buffer. */
-
-struct _IO_jump_t; struct _IO_FILE;
-
-struct _IO_marker {
- struct _IO_marker *_next;
- struct _IO_FILE *_sbuf;
- /* If _pos >= 0
- it points to _buf->Gbase()+_pos. FIXME comment */
- /* if _pos < 0, it points to _buf->eBptr()+_pos. FIXME comment */
- int _pos;
-#if 0
- void set_streampos(streampos sp) { _spos = sp; }
- void set_offset(int offset) { _pos = offset; _spos = (streampos)(-2); }
- public:
- streammarker(streambuf *sb);
- ~streammarker();
- int saving() { return _spos == -2; }
- int delta(streammarker&);
- int delta();
-#endif
-};
-
-struct _IO_FILE {
- int _flags; /* High-order word is _IO_MAGIC; rest is flags. */
-#define _IO_file_flags _flags
-
- /* The following pointers correspond to the C++ streambuf protocol. */
- /* Note: Tk uses the _IO_read_ptr and _IO_read_end fields directly. */
- char* _IO_read_ptr; /* Current read pointer */
- char* _IO_read_end; /* End of get area. */
- char* _IO_read_base; /* Start of putback+get area. */
- char* _IO_write_base; /* Start of put area. */
- char* _IO_write_ptr; /* Current put pointer. */
- char* _IO_write_end; /* End of put area. */
- char* _IO_buf_base; /* Start of reserve area. */
- char* _IO_buf_end; /* End of reserve area. */
- /* The following fields are used to support backing up and undo. */
- char *_IO_save_base; /* Pointer to start of non-current get area. */
- char *_IO_backup_base; /* Pointer to first valid character of backup area */
- char *_IO_save_end; /* Pointer to end of non-current get area. */
-
- struct _IO_marker *_markers;
-
- struct _IO_FILE *_chain;
-
- int _fileno;
- int _blksize;
- _IO_off_t _offset;
-
-#define __HAVE_COLUMN /* temporary */
- /* 1+column number of pbase(); 0 is unknown. */
- unsigned short _cur_column;
- char _unused;
- char _shortbuf[1];
-
- /* char* _save_gptr; char* _save_egptr; */
-};
-
-#ifndef __cplusplus
-typedef struct _IO_FILE _IO_FILE;
-#endif
-
-struct _IO_FILE_plus;
-extern struct _IO_FILE_plus _IO_stdin_, _IO_stdout_, _IO_stderr_;
-#define _IO_stdin ((_IO_FILE*)(&_IO_stdin_))
-#define _IO_stdout ((_IO_FILE*)(&_IO_stdout_))
-#define _IO_stderr ((_IO_FILE*)(&_IO_stderr_))
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern int __underflow __P((_IO_FILE*));
-extern int __uflow __P((_IO_FILE*));
-extern int __overflow __P((_IO_FILE*, int));
-
-#define _IO_getc(_fp) \
- ((_fp)->_IO_read_ptr >= (_fp)->_IO_read_end ? __uflow(_fp) \
- : *(unsigned char*)(_fp)->_IO_read_ptr++)
-#define _IO_peekc(_fp) \
- ((_fp)->_IO_read_ptr >= (_fp)->_IO_read_end \
- && __underflow(_fp) == EOF ? EOF \
- : *(unsigned char*)(_fp)->_IO_read_ptr)
-
-#define _IO_putc(_ch, _fp) \
- (((_fp)->_IO_write_ptr >= (_fp)->_IO_write_end) \
- ? __overflow(_fp, (unsigned char)(_ch)) \
- : (unsigned char)(*(_fp)->_IO_write_ptr++ = (_ch)))
-
-#define _IO_feof(__fp) (((__fp)->_flags & _IO_EOF_SEEN) != 0)
-#define _IO_ferror(__fp) (((__fp)->_flags & _IO_ERR_SEEN) != 0)
-
-/* This one is for Emacs. */
-#define _IO_PENDING_OUTPUT_COUNT(_fp) \
- ((_fp)->_IO_write_ptr - (_fp)->_IO_write_base)
-
-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 _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_fpos_t _IO_seekoff __P((_IO_FILE*, _IO_off_t, int, int));
-extern _IO_fpos_t _IO_seekpos __P((_IO_FILE*, _IO_fpos_t, int));
-
-extern void _IO_free_backup_area __P((_IO_FILE*));
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _IO_STDIO_H */
diff --git a/contrib/libg++/libio/libioP.h b/contrib/libg++/libio/libioP.h
deleted file mode 100644
index c7bc5224cabe..000000000000
--- a/contrib/libg++/libio/libioP.h
+++ /dev/null
@@ -1,494 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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 <errno.h>
-#ifndef errno
-extern int errno;
-#endif
-
-#include "iolibio.h"
-
-#if defined (__STDC__) || defined (_AIX) || (defined (__mips) && defined (_SYSTYPE_SVR4)) || defined(__cplusplus)
-/* All known AIX compilers implement these things (but don't always
- define __STDC__). The RISC/OS MIPS compiler defines these things
- in SVR4 mode, but does not define __STDC__. */
-
-#define AND ,
-#define DEFUN(name, arglist, args) name(args)
-#define DEFUN_VOID(name) name(void)
-
-#else /* Not ANSI C. */
-
-#define AND ;
-#ifndef const /* some systems define it in header files for non-ansi mode */
-#define const
-#endif
-#define DEFUN(name, arglist, args) name arglist args;
-#define DEFUN_VOID(name) name()
-#endif /* ANSI C. */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define _IO_seek_set 0
-#define _IO_seek_cur 1
-#define _IO_seek_end 2
-
-/* THE JUMPTABLE FUNCTIONS.
-
- * The _IO_FILE type is used to implement the FILE type in GNU libc,
- * as well as the streambuf class in GNU iostreams for C++.
- * These are all the same, just used differently.
- * An _IO_FILE (or FILE) object is allows followed by a pointer to
- * a jump table (of pointers to functions). The pointer is accessed
- * 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.
- * (as implemented by g++). When a pointer to a steambuf object is
- * coerced to an (_IO_FILE*), then _IO_JUMPS on the result just
- * happens to point to the virtual function table of the streambuf.
- * Thus the _IO_JUMPS function table used for C stdio/libio does
- * double duty as the virtual functiuon table for C++ streambuf.
- *
- * The entries in the _IO_JUMPS function table (and hence also the
- * virtual functions of a streambuf) are described below.
- * The first parameter of each function entry is the _IO_FILE/streambuf
- * object being acted on (i.e. the 'this' parameter).
- */
-
-#define _IO_JUMPS(THIS) ((struct _IO_FILE_plus*)(THIS))->vtable
-#ifdef _G_USING_THUNKS
-#define JUMP_FIELD(TYPE, NAME) TYPE NAME
-#define JUMP0(FUNC, THIS) _IO_JUMPS(THIS)->FUNC(THIS)
-#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 JUMP3(FUNC, THIS, X1,X2,X3) _IO_JUMPS(THIS)->FUNC(THIS, X1,X2, X3)
-#define JUMP_INIT(NAME, VALUE) VALUE
-#define JUMP_INIT_DUMMY JUMP_INIT(dummy, 0), JUMP_INIT(dummy2, 0)
-#else
-/* 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 JUMP0(FUNC, THIS) _IO_JUMPS(THIS)->FUNC.pfn(THIS)
-#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 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_DUMMY JUMP_INIT(dummy, 0)
-#endif
-
-/* 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 matches the streambuf::~streambuf virtual destructor. */
-typedef void (*_IO_finish_t) __P((_IO_FILE*)); /* finalize */
-#define _IO_FINISH(FP) JUMP0(__finish, FP)
-
-/* The 'overflow' hook flushes the buffer.
- The second argument is a character, or EOF.
- It matches the streambuf::overflow virtual function. */
-typedef int (*_IO_overflow_t) __P((_IO_FILE*, int));
-#define _IO_OVERFLOW(FP, CH) JUMP1(__overflow, FP, CH)
-
-/* The 'underflow' hook tries to fills the get buffer.
- 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.
- It matches the streambuf::underflow virtual function. */
-typedef int (*_IO_underflow_t) __P((_IO_FILE*));
-#define _IO_UNDERFLOW(FP) JUMP0(__underflow, FP)
-
-/* The 'uflow' hook returns the next character in the input stream
- (cast to unsigned char), and increments the read position;
- EOF is returned on failure.
- It matches the streambuf::uflow virtual function, which is not in the
- cfront implementation, but was added to C++ by the ANSI/ISO committee. */
-#define _IO_UFLOW(FP) JUMP0(__uflow, FP)
-
-/* The 'pbackfail' hook handles backing up.
- It matches the streambuf::pbackfail virtual function. */
-typedef int (*_IO_pbackfail_t) __P((_IO_FILE*, int));
-#define _IO_PBACKFAIL(FP, CH) JUMP1(__pbackfail, FP, CH)
-
-/* The 'xsputn' hook writes upto N characters from buffer DATA.
- Returns the number of character actually written.
- It matches the streambuf::xsputn virtual function. */
-typedef _IO_size_t (*_IO_xsputn_t)
- __P((_IO_FILE *FP, const void *DATA, _IO_size_t N));
-#define _IO_XSPUTN(FP, DATA, N) JUMP2(__xsputn, FP, DATA, N)
-
-/* The 'xsgetn' hook reads upto N characters into buffer DATA.
- Returns the number of character actually read.
- It matches the streambuf::xsgetn virtual function. */
-typedef _IO_size_t (*_IO_xsgetn_t) __P((_IO_FILE*FP, void*DATA, _IO_size_t N));
-#define _IO_XSGETN(FP, DATA, N) JUMP2(__xsgetn, FP, DATA, N)
-
-/* The 'seekoff' hook moves the stream position to a new position
- relative to the start of the file (if DIR==0), the current position
- (MODE==1), or the end of the file (MODE==2).
- It matches the streambuf::seekoff virtual function.
- It is also used for the ANSI fseek function. */
-typedef _IO_fpos_t (*_IO_seekoff_t)
- __P((_IO_FILE* FP, _IO_off_t OFF, int DIR, int MODE));
-#define _IO_SEEKOFF(FP, OFF, DIR, MODE) JUMP3(__seekoff, FP, OFF, DIR, MODE)
-
-/* The 'seekpos' hook also moves the stream position,
- but to an absolute position given by a fpos_t (seekpos).
- It matches the streambuf::seekpos virtual function.
- It is also used for the ANSI fgetpos and fsetpos functions. */
-/* 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));
-#define _IO_SEEKPOS(FP, POS, FLAGS) JUMP2(__seekpos, FP, POS, FLAGS)
-
-/* The 'setbuf' hook gives a buffer to the file.
- It matches the streambuf::setbuf virtual function. */
-typedef _IO_FILE* (*_IO_setbuf_t) __P((_IO_FILE*, char *, _IO_ssize_t));
-#define _IO_SETBUF(FP, BUFFER, LENGTH) JUMP2(__setbuf, FP, BUFFER, LENGTH)
-
-/* The 'sync' hook attempts to synchronize the internal data structures
- of the file with the external state.
- It matches the streambuf::sync virtual function. */
-typedef int (*_IO_sync_t) __P((_IO_FILE*));
-#define _IO_SYNC(FP) JUMP0(__sync, FP)
-
-/* The 'doallocate' hook is used to tell the file to allocate a buffer.
- It matches the streambuf::doallocate virtual function, which is not
- in the ANSI/ISO C++ standard, but is part traditional implementations. */
-typedef int (*_IO_doallocate_t) __P((_IO_FILE*));
-#define _IO_DOALLOCATE(FP) JUMP0(__doallocate, FP)
-
-/* The following four hooks (sysread, syswrite, sysclose, sysseek, and
- sysstat) are low-level hooks specific to this implementation.
- There is no correspondance in the ANSI/ISO C++ standard library.
- The hooks basically correspond to the Unix system functions
- (read, write, close, lseek, and stat) except that a _IO_FILE*
- parameter is used instead of a integer file descriptor; the default
- implementation used for normal files just calls those functions.
- The advantage of overriding these functions instead of the higher-level
- ones (underflow, overflow etc) is that you can leave all the buffering
- higher-level functions. */
-
-/* The 'sysread' hook is used to read data from the external file into
- an existing buffer. It generalizes the Unix read(2) function.
- It matches the streambuf::sys_read virtual function, which is
- specific to this implementaion. */
-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)
-
-/* The 'syswrite' hook is used to write data from an existing buffer
- to an external file. It generalizes the Unix write(2) function.
- It matches the streambuf::sys_write virtual function, which is
- specific to this implementaion. */
-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)
-
-/* The 'sysseek' hook is used to re-position an external file.
- It generalizes the Unix lseek(2) function.
- It matches the streambuf::sys_seek virtual function, which is
- specific to this implementaion. */
-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)
-
-/* The 'sysclose' hook is used to finalize (close, finish up) an
- external file. It generalizes the Unix close(2) function.
- It matches the streambuf::sys_close virtual function, which is
- specific to this implementation. */
-typedef int (*_IO_close_t) __P((_IO_FILE*)); /* finalize */
-#define _IO_SYSCLOSE(FP) JUMP0(__close, FP)
-
-/* The 'sysstat' hook is used to get information about an external file
- into a struct stat buffer. It generalizes the Unix fstat(2) call.
- It matches the streambuf::sys_stat virtual function, which is
- specific to this implementaion. */
-typedef int (*_IO_stat_t) __P((_IO_FILE*, void*));
-#define _IO_SYSSTAT(FP, BUF) JUMP1(__stat, FP, BUF)
-
-
-#define _IO_CHAR_TYPE char /* unsigned char ? */
-#define _IO_INT_TYPE int
-
-struct _IO_jump_t {
- JUMP_FIELD(_G_size_t, __dummy);
-#ifdef _G_USING_THUNKS
- JUMP_FIELD(_G_size_t, __dummy2);
-#endif
- JUMP_FIELD(_IO_finish_t, __finish);
- JUMP_FIELD(_IO_overflow_t, __overflow);
- JUMP_FIELD(_IO_underflow_t, __underflow);
- JUMP_FIELD(_IO_underflow_t, __uflow);
- JUMP_FIELD(_IO_pbackfail_t, __pbackfail);
- /* showmany */
- JUMP_FIELD(_IO_xsputn_t, __xsputn);
- JUMP_FIELD(_IO_xsgetn_t, __xsgetn);
- JUMP_FIELD(_IO_seekoff_t, __seekoff);
- JUMP_FIELD(_IO_seekpos_t, __seekpos);
- JUMP_FIELD(_IO_setbuf_t, __setbuf);
- JUMP_FIELD(_IO_sync_t, __sync);
- JUMP_FIELD(_IO_doallocate_t, __doallocate);
- JUMP_FIELD(_IO_read_t, __read);
- JUMP_FIELD(_IO_write_t, __write);
- JUMP_FIELD(_IO_seek_t, __seek);
- JUMP_FIELD(_IO_close_t, __close);
- JUMP_FIELD(_IO_stat_t, __stat);
-#if 0
- get_column;
- set_column;
-#endif
-};
-
-/* We always allocate an extra word following an _IO_FILE.
- This contains a pointer to the function jump table used.
- This is for compatibility with C++ streambuf; the word can
- be used to smash to a pointer to a virtual function table. */
-
-struct _IO_FILE_plus {
- _IO_FILE file;
- const struct _IO_jump_t *vtable;
-};
-
-/* Generic functions */
-
-extern int _IO_switch_to_get_mode __P((_IO_FILE*));
-extern void _IO_init __P((_IO_FILE*, int));
-extern int _IO_sputbackc __P((_IO_FILE*, int));
-extern int _IO_sungetc __P((_IO_FILE*));
-extern void _IO_un_link __P((_IO_FILE*));
-extern void _IO_link_in __P((_IO_FILE *));
-extern void _IO_doallocbuf __P((_IO_FILE*));
-extern void _IO_unsave_markers __P((_IO_FILE*));
-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. */
-
-extern void _IO_init_marker __P((struct _IO_marker *, _IO_FILE *));
-extern void _IO_remove_marker __P((struct _IO_marker*));
-extern int _IO_marker_difference __P((struct _IO_marker *, struct _IO_marker *));
-extern int _IO_marker_delta __P((struct _IO_marker *));
-extern int _IO_seekmark __P((_IO_FILE *, struct _IO_marker *, int));
-
-/* Default jumptable functions. */
-
-extern int _IO_default_underflow __P((_IO_FILE*));
-extern int _IO_default_uflow __P((_IO_FILE*));
-extern int _IO_default_doallocate __P((_IO_FILE*));
-extern void _IO_default_finish __P((_IO_FILE *));
-extern int _IO_default_pbackfail __P((_IO_FILE*, int));
-extern _IO_FILE* _IO_default_setbuf __P((_IO_FILE *, char*, _IO_ssize_t));
-extern _IO_size_t _IO_default_xsputn __P((_IO_FILE *, const void*, _IO_size_t));
-extern _IO_size_t _IO_default_xsgetn __P((_IO_FILE *, void*, _IO_size_t));
-extern _IO_fpos_t _IO_default_seekoff __P((_IO_FILE*, _IO_off_t, int, int));
-extern _IO_fpos_t _IO_default_seekpos __P((_IO_FILE*, _IO_fpos_t, int));
-extern _IO_ssize_t _IO_default_write __P((_IO_FILE*,const void*,_IO_ssize_t));
-extern _IO_ssize_t _IO_default_read __P((_IO_FILE*, void*, _IO_ssize_t));
-extern int _IO_default_stat __P((_IO_FILE*, void*));
-extern _IO_fpos_t _IO_default_seek __P((_IO_FILE*, _IO_off_t, int));
-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_streambuf_jumps;
-extern struct _IO_jump_t _IO_proc_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_flush_all __P((void));
-extern void _IO_cleanup __P((void));
-extern void _IO_flush_all_linebuffered __P((void));
-
-#define _IO_do_flush(_f) \
- _IO_do_write(_f, (_f)->_IO_write_base, \
- (_f)->_IO_write_ptr-(_f)->_IO_write_base)
-#define _IO_in_put_mode(_fp) ((_fp)->_flags & _IO_CURRENTLY_PUTTING)
-#define _IO_mask_flags(fp, f, mask) \
- ((fp)->_flags = ((fp)->_flags & ~(mask)) | ((f) & (mask)))
-#define _IO_setg(fp, eb, g, eg) ((fp)->_IO_read_base = (eb),\
- (fp)->_IO_read_ptr = (g), (fp)->_IO_read_end = (eg))
-#define _IO_setp(__fp, __p, __ep) \
- ((__fp)->_IO_write_base = (__fp)->_IO_write_ptr = __p, (__fp)->_IO_write_end = (__ep))
-#define _IO_have_backup(fp) ((fp)->_IO_save_base != NULL)
-#define _IO_in_backup(fp) ((fp)->_flags & _IO_IN_BACKUP)
-#define _IO_have_markers(fp) ((fp)->_markers != NULL)
-#define _IO_blen(fp) ((fp)->_IO_buf_end - (fp)->_IO_buf_base)
-
-/* Jumptable functions for files. */
-
-extern int _IO_file_doallocate __P((_IO_FILE*));
-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_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_close __P((_IO_FILE*));
-extern int _IO_file_underflow __P((_IO_FILE *));
-extern int _IO_file_overflow __P((_IO_FILE *, int));
-#define _IO_file_is_open(__fp) ((__fp)->_fileno >= 0)
-extern void _IO_file_init __P((_IO_FILE*));
-extern _IO_FILE* _IO_file_attach __P((_IO_FILE*, int));
-extern _IO_FILE* _IO_file_fopen __P((_IO_FILE*, const char*, const char*));
-extern _IO_ssize_t _IO_file_write __P((_IO_FILE*,const void*,_IO_ssize_t));
-extern _IO_ssize_t _IO_file_read __P((_IO_FILE*, void*, _IO_ssize_t));
-extern int _IO_file_sync __P((_IO_FILE*));
-extern int _IO_file_close_it __P((_IO_FILE*));
-extern _IO_fpos_t _IO_file_seek __P((_IO_FILE *, _IO_off_t, int));
-extern void _IO_file_finish __P((_IO_FILE*));
-
-/* Other file functions. */
-extern _IO_FILE* _IO_file_attach __P((_IO_FILE *, int));
-
-/* Jumptable functions for proc_files. */
-extern _IO_FILE* _IO_proc_open __P((_IO_FILE*, const char*, const char *));
-extern int _IO_proc_close __P((_IO_FILE*));
-
-/* Jumptable functions for strfiles. */
-extern int _IO_str_underflow __P((_IO_FILE*));
-extern int _IO_str_overflow __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));
-
-/* Other strfile functions */
-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 _IO_ssize_t _IO_str_count __P ((_IO_FILE*));
-
-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 double _IO_strtod __P((const char *, char **));
-extern char * _IO_dtoa __P((double __d, int __mode, int __ndigits,
- int *__decpt, int *__sign, char **__rve));
-extern int _IO_outfloat __P((double __value, _IO_FILE *__sb, int __type,
- int __width, int __precision, int __flags,
- int __sign_mode, int __fill));
-
-extern _IO_FILE *_IO_list_all;
-extern void (*_IO_cleanup_registration_needed) __P ((void));
-
-#ifndef EOF
-#define EOF (-1)
-#endif
-#ifndef NULL
-#if !defined(__cplusplus) || defined(__GNUC__)
-#define NULL ((void*)0)
-#else
-#define NULL (0)
-#endif
-#endif
-
-#define FREE_BUF(_B) free(_B)
-#define ALLOC_BUF(_S) (char*)malloc(_S)
-
-#ifndef OS_FSTAT
-#define OS_FSTAT fstat
-#endif
-struct stat;
-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_off_t _IO_lseek __P((int, _IO_off_t, int));
-extern int _IO_close __P((int));
-extern int _IO_fstat __P((int, struct stat *));
-
-/* Operations on _IO_fpos_t.
- Normally, these are trivial, but we provide hooks for configurations
- where an _IO_fpos_t is a struct.
- Note that _IO_off_t must be an integral type. */
-
-/* _IO_pos_BAD is an _IO_fpos_t value indicating error, unknown, or EOF. */
-#ifndef _IO_pos_BAD
-#define _IO_pos_BAD ((_IO_fpos_t)(-1))
-#endif
-/* _IO_pos_as_off converts an _IO_fpos_t value to an _IO_off_t value. */
-#ifndef _IO_pos_as_off
-#define _IO_pos_as_off(__pos) ((_IO_off_t)(__pos))
-#endif
-/* _IO_pos_adjust adjust an _IO_fpos_t by some number of bytes. */
-#ifndef _IO_pos_adjust
-#define _IO_pos_adjust(__pos, __delta) ((__pos) += (__delta))
-#endif
-/* _IO_pos_0 is an _IO_fpos_t value indicating beginning of file. */
-#ifndef _IO_pos_0
-#define _IO_pos_0 ((_IO_fpos_t)0)
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-/* check following! */
-#define FILEBUF_LITERAL(CHAIN, FLAGS, FD) \
- { _IO_MAGIC+_IO_LINKED+_IO_IS_FILEBUF+FLAGS, \
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, CHAIN, FD}
-
-/* VTABLE_LABEL defines NAME as of the CLASS class.
- CNLENGTH is strlen(#CLASS). */
-#ifdef __GNUC__
-#if _G_VTABLE_LABEL_HAS_LENGTH
-#define VTABLE_LABEL(NAME, CLASS, CNLENGTH) \
- extern char NAME[] asm (_G_VTABLE_LABEL_PREFIX #CNLENGTH #CLASS);
-#else
-#define VTABLE_LABEL(NAME, CLASS, CNLENGTH) \
- extern char NAME[] asm (_G_VTABLE_LABEL_PREFIX #CLASS);
-#endif
-#endif /* __GNUC__ */
-
-#if !defined(builtinbuf_vtable) && defined(__cplusplus)
-#ifdef __GNUC__
-VTABLE_LABEL(builtinbuf_vtable, builtinbuf, 10)
-#else
-#if _G_VTABLE_LABEL_HAS_LENGTH
-#define builtinbuf_vtable _G_VTABLE_LABEL_PREFIX_ID##10builtinbuf
-#else
-#define builtinbuf_vtable _G_VTABLE_LABEL_PREFIX_ID##builtinbuf
-#endif
-#endif
-#endif /* !defined(builtinbuf_vtable) && defined(__cplusplus) */
-
-#if defined(__STDC__) || defined(__cplusplus)
-#define _IO_va_start(args, last) va_start(args, last)
-#else
-#define _IO_va_start(args, last) va_start(args)
-#endif
-
-extern struct _IO_fake_stdiobuf _IO_stdin_buf, _IO_stdout_buf, _IO_stderr_buf;
-
-#if 1
-#define COERCE_FILE(FILE) /* Nothing */
-#else
-/* This is part of the kludge for binary compatibility with old stdio. */
-#define COERCE_FILE(FILE) \
- (((FILE)->_IO_file_flags & _IO_MAGIC_MASK) == _OLD_MAGIC_MASK \
- && (FILE) = *(FILE**)&((int*)fp)[1])
-#endif
-
-#ifdef EINVAL
-#define MAYBE_SET_EINVAL errno = EINVAL
-#else
-#define MAYBE_SET_EINVAL /* nothing */
-#endif
-
-#ifdef DEBUG
-#define CHECK_FILE(FILE,RET) \
- if ((FILE) == NULL) { MAYBE_SET_EINVAL; return RET; } \
- else { COERCE_FILE(FILE); \
- if (((FILE)->_IO_file_flags & _IO_MAGIC_MASK) != _IO_MAGIC) \
- { errno = EINVAL; return RET; }}
-#else
-#define CHECK_FILE(FILE,RET) \
- COERCE_FILE(FILE)
-#endif
diff --git a/contrib/libg++/libio/osform.cc b/contrib/libg++/libio/osform.cc
deleted file mode 100644
index 8c0011703da0..000000000000
--- a/contrib/libg++/libio/osform.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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 <iostream.h>
-#include <stdarg.h>
-
-ostream& ostream::form(const char *format ...)
-{
- if (opfx()) {
- va_list ap;
- va_start(ap, format);
- _IO_vfprintf(rdbuf(), format, ap);
- va_end(ap);
- }
- return *this;
-}
-
-ostream& ostream::vform(const char *format, _IO_va_list args)
-{
- if (opfx())
- _IO_vfprintf(rdbuf(), format, args);
- return *this;
-}
-
-ostream& ostream::operator<<(const void *p)
-{
- if (opfx()) {
- form("%p", p);
- osfx();
- }
- return *this;
-}
diff --git a/contrib/libg++/libio/ostream.h b/contrib/libg++/libio/ostream.h
deleted file mode 100644
index f54ec1de9a1c..000000000000
--- a/contrib/libg++/libio/ostream.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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 <stream.h>
diff --git a/contrib/libg++/libio/outfloat.c b/contrib/libg++/libio/outfloat.c
deleted file mode 100644
index a74b1a2c3e13..000000000000
--- a/contrib/libg++/libio/outfloat.c
+++ /dev/null
@@ -1,204 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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"
-
-/* Format floating-point number and print them.
- Return number of chars printed, or EOF on error.
-
- sign_mode == '+' : print "-" or "+"
- sign_mode == ' ' : print "-" or " "
- sign_mode == '\0' : print "-' or ""
-*/
-
-int
-DEFUN(_IO_outfloat, (value, sb, type, width, precision, flags,
- sign_mode, fill),
- double value AND _IO_FILE *sb AND int type AND int width
- AND int precision AND int flags AND int sign_mode AND int fill)
-{
- int count = 0;
-#define PUT(x) do {if (_IO_putc(x, sb) < 0) goto error; count++;} while (0)
-#define PUTN(p, n) \
- do {int _n=n; count+=_n; if (_IO_sputn(sb, p,_n) != _n) goto error;} while(0)
-#define PADN(fill, n) \
- do {int _n = n; count+=_n; if (_IO_padn(sb, fill, _n) != _n) goto error;} while (0)
- int pad_kind = flags & (_IO_LEFT|_IO_RIGHT|_IO_INTERNAL);
- int skip_zeroes = 0;
- int show_dot = (flags & _IO_SHOWPOINT) != 0;
- int decpt;
- int sign;
- int mode;
- int exponent_size;
- int print_sign;
- int trailing_zeroes, useful_digits;
- int padding, unpadded_width;
- char *p;
- char *exponent_start;
- register int i;
-#define EBUF_SIZE 12
-#define EBUF_END &ebuf[EBUF_SIZE]
- char ebuf[EBUF_SIZE];
- char *end;
- int exp = 0;
- switch (type)
- {
- case 'f':
- mode = 3;
- break;
- case 'e':
- case 'E':
- exp = type;
- mode = 2;
- if (precision != 999)
- precision++; /* Add one to include digit before decimal point. */
- break;
- case 'g':
- case 'G':
- exp = type == 'g' ? 'e' : 'E';
- if (precision == 0) precision = 1;
- if (!(flags & _IO_SHOWPOINT))
- skip_zeroes = 1;
- type = 'g';
- mode = 2;
- break;
- }
- /* Do the actual convension */
- if (precision == 999 && mode != 3)
- mode = 0;
- p = _IO_dtoa(value, mode, precision, &decpt, &sign, &end);
- useful_digits = end-p;
- exponent_start = EBUF_END;
- if (mode == 0)
- precision = useful_digits;
- /* Check if we need to emit an exponent. */
- if (mode != 3 && decpt != 9999)
- {
- i = decpt - 1;
- if ((type != 'g' && type != 'F') || i < -4 || i >= precision)
- {
- /* Print the exponent into ebuf.
- We write ebuf in reverse order (right-to-left). */
- char sign;
- if (i >= 0)
- sign = '+';
- else
- sign = '-', i = -i;
- /* Note: ANSI requires at least 2 exponent digits. */
- do {
- *--exponent_start = (i % 10) + '0';
- i /= 10;
- } while (i >= 10);
- *--exponent_start = i + '0';
- *--exponent_start = sign;
- *--exponent_start = exp;
- }
- }
- exponent_size = EBUF_END - exponent_start;
- if (mode == 1)
- precision = 1;
- /* If we print an exponent, always show just one digit before point. */
- if (exponent_size)
- decpt = 1;
- if (decpt == 9999)
- { /* Infinity or NaN */
- decpt = useful_digits;
- precision = 0;
- show_dot = 0;
- }
-
- /* dtoa truncates trailing zeroes. Set the variable trailing_zeroes to
- the number of 0's we have to add (after the decimal point). */
- if (skip_zeroes)
- trailing_zeroes = 0;
- else if (type == 'f')
- trailing_zeroes = useful_digits <= decpt ? precision
- : precision-(useful_digits-decpt);
- else if (exponent_size) /* 'e' 'E' or 'g' format using exponential notation*/
- trailing_zeroes = precision - useful_digits;
- else /* 'g' format not using exponential notation. */
- trailing_zeroes = useful_digits <= decpt ? precision - decpt
- : precision-useful_digits;
- if (trailing_zeroes < 0) trailing_zeroes = 0;
-
- if (trailing_zeroes != 0 || useful_digits > decpt)
- show_dot = 1;
- if (sign_mode == 0)
- print_sign = sign ? '-' : 0;
- else if (sign_mode == '+')
- print_sign = sign ? '-' : '+';
- else /* if (sign_mode == ' ') */
- print_sign = sign ? '-' : ' ';
-
- /* Calculate the width (before padding). */
- unpadded_width =
- (print_sign != 0) + trailing_zeroes + exponent_size + show_dot
- + useful_digits
- + (decpt > useful_digits ? decpt - useful_digits
- : decpt > 0 ? 0 : 1 - decpt);
-
- padding = width > unpadded_width ? width - unpadded_width : 0;
- if (padding > 0 && pad_kind != _IO_LEFT && pad_kind != _IO_INTERNAL)
- PADN(fill, padding); /* Default (right) adjust */
- if (print_sign)
- PUT(print_sign);
- if (pad_kind == _IO_INTERNAL && padding > 0)
- PADN(fill, padding);
- if (decpt > 0)
- {
- if (useful_digits >= decpt)
- PUTN(p, decpt);
- else
- {
- PUTN(p, useful_digits);
- PADN('0', decpt-useful_digits);
- }
- if (show_dot)
- {
- PUT('.');
- /* Print digits after the decimal point. */
- if (useful_digits > decpt)
- PUTN(p + decpt, useful_digits-decpt);
- }
- }
- else
- {
- PUT('0');
- if (show_dot)
- {
- PUT('.');
- PADN('0', -decpt);
- /* Print digits after the decimal point. */
- PUTN(p, useful_digits);
- }
- }
- PADN('0', trailing_zeroes);
- if (exponent_size)
- PUTN(exponent_start, exponent_size);
- if (pad_kind == _IO_LEFT && padding > 0) /* Left adjustment*/
- PADN(fill, padding);
- return count;
- error:
- return EOF;
-}
diff --git a/contrib/libg++/libio/parsestream.cc b/contrib/libg++/libio/parsestream.cc
deleted file mode 100644
index 320afd06d9be..000000000000
--- a/contrib/libg++/libio/parsestream.cc
+++ /dev/null
@@ -1,317 +0,0 @@
-/* This is part of libio/iostream, providing -*- C++ -*- input/output.
-Copyright (C) 1993 Free Software Foundation
-
-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.
-
-Written by Per Bothner (bothner@cygnus.com). */
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include "libioP.h"
-#include "parsestream.h"
-#include <stdlib.h>
-
-streambuf* parsebuf::setbuf(char*, int)
-{
- return NULL;
-}
-
-int parsebuf::tell_in_line()
-{
- return 0;
-}
-
-int parsebuf::pbackfail(int c)
-{
- if (c == EOF)
- return 0;
- if (seekoff(-1, ios::cur) == EOF)
- return EOF;
- return (unsigned char)c;
-}
-
-char* parsebuf::current_line() { return NULL; }
-
-streampos parsebuf::seekoff(streamoff offset, _seek_dir dir, int)
-{
- // Make offset relative to line start.
- switch (dir) {
- case ios::beg:
- offset -= pos_at_line_start;
- break;
- case ios::cur:
- offset += tell_in_line();
- break;
- default:
- return EOF;
- }
- if (offset < -1)
- return EOF;
- if (offset > _line_length + 1)
- return EOF;
- return seek_in_line(offset) + pos_at_line_start;
-}
-
-// string_parsebuf invariants:
-// The reserve ares (base() .. ebuf()) is always the entire string.
-// The get area (eback() .. egptr()) is the extended current line
-// (i.e. with the '\n' at either end, if these exist).
-
-string_parsebuf::string_parsebuf(char *buf, int len,
- int delete_at_close /* = 0*/)
-: parsebuf()
-{
- setb(buf, buf+len, delete_at_close);
- register char *ptr = buf;
- while (ptr < ebuf() && *ptr != '\n') ptr++;
- _line_length = ptr - buf;
- setg(buf, buf, ptr);
-}
-
-int string_parsebuf::underflow()
-{
- register char* ptr = egptr(); // Point to end of current_line
- do {
- int i = right() - ptr;
- if (i <= 0)
- return EOF;
- ptr++; i--; // Skip '\n'.
- char *line_start = ptr;
- while (ptr < right() && *ptr == '\n') ptr++;
- setg(line_start-1, line_start, ptr + (ptr < right()));
- pos_at_line_start = line_start - left();
- _line_length = ptr - line_start;
- __line_number++;
- } while (gptr() == ptr);
- return *gptr();
-}
-
-char* string_parsebuf::current_line()
-{
- char *ptr = eback();
- if (__line_number > 0)
- ptr++; // Skip '\n' at end of previous line.
- return ptr;
-}
-
-int string_parsebuf::tell_in_line()
-{
- int offset = gptr() - eback();
- if (__line_number > 0)
- offset--;
- return offset;
-}
-
-int string_parsebuf::seek_in_line(int i)
-{
- int delta = i - tell_in_line();
- gbump(delta); // FIXME: Needs error (bounds) checking!
- return i;
-}
-
-static const char NewLine[1] = { '\n' };
-
-general_parsebuf::general_parsebuf(streambuf *buf, int delete_arg_buf)
- : parsebuf()
-{
- delete_buf = delete_arg_buf;
- sbuf = buf;
- int buf_size = 128;
- char* buffer = ALLOC_BUF(buf_size);
- setb(buffer, buffer+buf_size, 1);
-// setg(buffer, buffer, buffer);
-}
-
-general_parsebuf::~general_parsebuf()
-{
- if (delete_buf)
- delete sbuf;
-}
-
-int general_parsebuf::underflow()
-{
- register char *ptr = base();
- int has_newline = eback() < gptr() && gptr()[-1] == '\n';
- if (has_newline)
- *ptr++ = '\n';
- register streambuf *sb = sbuf;
- register int ch;
- for (;;) {
- ch = sb->sbumpc();
- if (ch == EOF)
- break;
- if (ptr == ebuf()) {
- int old_size = ebuf() - base();
- char *new_buffer = new char[old_size * 2];
- memcpy(new_buffer, base(), old_size);
- setb(new_buffer, new_buffer + 2 * old_size, 1);
- ptr = new_buffer + old_size;
- }
- *ptr++ = ch;
- if (ch == '\n')
- break;
- }
- char *cur_pos = base() + has_newline;
- pos_at_line_start += _line_length + 1;
- _line_length = ptr - cur_pos;
- if (ch != EOF || _line_length > 0)
- __line_number++;
- setg(base(), cur_pos, ptr);
- return ptr == cur_pos ? EOF : cur_pos[0];
-}
-
-char* general_parsebuf::current_line()
-{
- char* ret = base();
- if (__line_number > 1)
- ret++; // Move past '\n' from end of previous line.
- return ret;
-}
-
-int general_parsebuf::tell_in_line()
-{
- int off = gptr() - base();
- if (__line_number > 1)
- off--; // Subtract 1 for '\n' from end of previous line.
- return off;
-}
-
-int general_parsebuf::seek_in_line(int i)
-{
- if (__line_number == 0)
- (void)general_parsebuf::underflow();
- if (__line_number > 1)
- i++; // Add 1 for '\n' from end of previous line.
- if (i < 0) i = 0;
- int len = egptr() - eback();
- if (i > len) i = len;
- setg(base(), base() + i, egptr());
- return i;
-}
-
-func_parsebuf::func_parsebuf(CharReader func, void *argm) : parsebuf()
-{
- read_func = func;
- arg = argm;
- buf_start = NULL;
- buf_end = NULL;
- setb((char*)NewLine, (char*)NewLine+1, 0);
- setg((char*)NewLine, (char*)NewLine+1, (char*)NewLine+1);
- backed_up_to_newline = 0;
-}
-
-int func_parsebuf::tell_in_line()
-{
- if (buf_start == NULL)
- return 0;
- if (egptr() != (char*)NewLine+1)
- // Get buffer was line buffer.
- return gptr() - buf_start;
- if (backed_up_to_newline)
- return -1; // Get buffer is '\n' preceding current line.
- // Get buffer is '\n' following current line.
- return (buf_end - buf_start) + (gptr() - (char*)NewLine);
-}
-
-char* func_parsebuf::current_line()
-{
- return buf_start;
-}
-
-int func_parsebuf::seek_in_line(int i)
-{
- if (i < 0) {
- // Back up to preceding '\n'.
- if (i < -1) i = -1;
- backed_up_to_newline = 1;
- setg((char*)NewLine, (char*)NewLine+(i+1), (char*)NewLine+1);
- return i;
- }
- backed_up_to_newline = 0;
- int line_length = buf_end-buf_start;
- if (i <= line_length) {
- setg(buf_start, buf_start+i, buf_end);
- return i;
- }
- i -= line_length;
- if (i > 0) i = 1;
- setg((char*)NewLine, (char*)NewLine+i, (char*)NewLine+1);
- return line_length + i;
-}
-
-int func_parsebuf::underflow()
-{
- retry:
- if (gptr() < egptr())
- return *gptr();
- if (gptr() != (char*)NewLine+1) {
- // Get buffer was line buffer. Move to following '\n'.
- setg((char*)NewLine, (char*)NewLine, (char*)NewLine+1);
- return *gptr();
- }
- if (backed_up_to_newline)
- // Get buffer was '\n' preceding current line. Move to current line.
- backed_up_to_newline = 0;
- else {
- // Get buffer was '\n' following current line. Read new line.
- if (buf_start) free(buf_start);
- char *str = (*read_func)(arg);
- buf_start = str;
- if (str == NULL)
- return EOF;
- // Initially, _line_length == -1, so pos_at_line_start becomes 0.
- pos_at_line_start += _line_length + 1;
- _line_length = strlen(str);
- buf_end = str + _line_length;
- __line_number++;
- }
- setg(buf_start, buf_start, buf_end);
- goto retry;
-}
-
-#if 0
-size_t parsebuf::line_length()
-{
- if (current_line_length == (size_t)(-1)) // Initial value;
- (void)sgetc();
- return current_line_length;
-}
-#endif
-
-int parsebuf::seek_in_line(int i)
-{
-#if 1
- abort();
- return i; // Suppress warnings.
-#else
- if (i > 0) {
- size_t len = line_length();
- if ((unsigned)i > len) i = len;
- }
- else if (i < -1) i = -1;
- int new_pos = seekoff(pos_at_line_start + i, ios::beg);
- if (new_pos == EOF)
- return tell_in_line();
- else return new_pos - pos_at_line_start;
-#endif
-}
diff --git a/contrib/libg++/libio/parsestream.h b/contrib/libg++/libio/parsestream.h
deleted file mode 100644
index 326ab87a8090..000000000000
--- a/contrib/libg++/libio/parsestream.h
+++ /dev/null
@@ -1,156 +0,0 @@
-/* This is part of libio/iostream, providing -*- C++ -*- input/output.
-Copyright (C) 1993 Free Software Foundation
-
-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.
-
-Written by Per Bothner (bothner@cygnus.com). */
-
-#ifndef PARSESTREAM_H
-#define PARSESTREAM_H
-#ifdef __GNUG__
-#pragma interface
-#endif
-#include "streambuf.h"
-
-extern "C++" {
-// A parsebuf is a streambuf optimized for scanning text files.
-// It keeps track of line and column numbers.
-// It is guaranteed to remember the entire current line,
-// as well the '\n'-s on either side of it (if they exist).
-// You can arbitrarily seek (or unget) within this extended line.
-// Other backward seeks are not supported.
-// Normal read semantics are supported (and hence istream operators like >>).
-
-class parsebuf : public streambuf {
- protected:
- _IO_fpos_t pos_at_line_start;
- long _line_length;
- unsigned long __line_number;
- char *buf_start;
- char *buf_end;
-
- public:
- parsebuf *chain;
-
- // Return column number (raw - don't handle tabs etc).
- // Retult can be -1, meaning: at '\n' before current line.
- virtual int tell_in_line();
-
- // seek to (raw) column I in current line.
- // Result is new (raw) column position - differs from I if unable to seek.
- // Seek to -1 tries to seek to before previous LF.
- virtual int seek_in_line(int i);
-
- // Note: there is no "current line" initially, until something is read.
-
- // Current line number, starting with 0.
- // If tell_in_line()==-1, then line number of next line.
- int line_number() { return __line_number; }
-
- // Length of current line, not counting either '\n'.
- int line_length() { return _line_length; }
- // Current line - not a copy, so file ops may trash it.
- virtual char* current_line();
- virtual streampos seekoff(streamoff, _seek_dir, int mode=ios::in|ios::out);
- virtual streambuf* setbuf(char* p, int len);
- protected:
- parsebuf() { chain= NULL;
- __line_number = 0; pos_at_line_start = 0; _line_length = -1; }
- virtual int pbackfail(int c);
-};
-
-// A string_parsebuf is a parsebuf whose source is a fixed string.
-
-class string_parsebuf : public parsebuf {
- public:
- int do_delete;
- string_parsebuf(char *str, int len, int delete_at_close=0);
- virtual int underflow();
- virtual char* current_line();
- virtual int seek_in_line(int i);
- virtual int tell_in_line();
- char *left() const { return base(); }
- char *right() const { return ebuf(); }
-// streampos seekoff(streamoff, _seek_dir, int);
-};
-
-// A func_parsebuf calls a given function to get new input.
-// Each call returns an entire NUL-terminated line (without the '\n').
-// That line has been allocated with malloc(), not new.
-// The interface is tailored to the GNU readline library.
-// Example:
-// char* DoReadLine(void* arg)
-// {
-// char *line = readline((char*)arg); /* 'arg' is used as prompt. */
-// if line == NULL) { putc('\n', stderr); return NULL; }
-// if (line[0] != '\0') add_history(line);
-// return line;
-// }
-// char PromptBuffer[100] = "> ";
-// func_parsebuf my_stream(DoReadLine, PromptBuffer);
-
-typedef char *(*CharReader)(void *arg);
-class istream;
-
-class func_parsebuf : public parsebuf {
- public:
- void *arg;
- CharReader read_func;
- int backed_up_to_newline;
- func_parsebuf(CharReader func, void *argm = NULL);
- int underflow();
- virtual int tell_in_line();
- virtual int seek_in_line(int i);
- virtual char* current_line();
-};
-
-// A general_parsebuf is a parsebuf which gets its input from some
-// other streambuf. It explicitly buffers up an entire line.
-
-class general_parsebuf : public parsebuf {
- public:
- streambuf *sbuf;
- int delete_buf; // Delete sbuf when destroying this.
- general_parsebuf(streambuf *buf, int delete_arg_buf = 0);
- int underflow();
- virtual int tell_in_line();
- virtual int seek_in_line(int i);
- ~general_parsebuf();
- virtual char* current_line();
-};
-
-#if 0
-class parsestream : public istream {
- streammarker marks[2];
- short _first; // of the two marks; either 0 or 1
- int _lineno;
- int first() { return _first; }
- int second() { return 1-_first; }
- int line_length() { marks[second].delta(marks[first]); }
- int line_length() { marks[second].delta(marks[first]); }
- int seek_in_line(int i);
- int tell_in_line();
- int line_number();
-};
-#endif
-} // extern "C++"
-#endif /*!defined(PARSESTREAM_H)*/
diff --git a/contrib/libg++/libio/pfstream.cc b/contrib/libg++/libio/pfstream.cc
deleted file mode 100644
index 3fa93c958f8f..000000000000
--- a/contrib/libg++/libio/pfstream.cc
+++ /dev/null
@@ -1,92 +0,0 @@
-/* This is part of libio/iostream, providing -*- C++ -*- input/output.
-Copyright (C) 1993 Free Software Foundation
-
-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. */
-
-/* Written by Per Bothner (bothner@cygnus.com). */
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include "libioP.h"
-#include <pfstream.h>
-#include <procbuf.h>
-
-ipfstream::ipfstream(const char *name, int mode, int prot)
-{
- const char* p;
-
- // Look for '| command' (as used by ftp).
- for (p = name; *p == ' ' || *p == '\t'; p++) ;
- if (*p == '|') {
- procbuf *pbuf = new procbuf();
- init(pbuf);
- if (!pbuf->open(p+1, mode))
- set(ios::badbit);
- return;
- }
-
- // Look for 'command |'
- while (*p) p++; // Point to last
- while (p[-1] == ' ' || p[-1] == '\t' || p[-1] == '\n') p--;
- if (p[-1] == '|') {
- // Must remove the final '|'.
- p--;
-#if !defined (__GNUC__) || defined (__STRICT_ANSI__)
- char *command = new char[p-name+1];
-#else
- char command[p-name+1];
-#endif
- memcpy(command, name, p-name);
- command[p-name] = '\0';
-
- procbuf *pbuf = new procbuf();
- if (pbuf->open(command, mode))
- set(ios::badbit);
-#if !defined (__GNUC__) || defined (__STRICT_ANSI__)
- delete command;
-#endif
- return;
- }
-
- init(new filebuf());
- if (!rdbuf()->open(name, mode, prot))
- set(ios::badbit);
-}
-
-opfstream::opfstream(const char *name, int mode, int prot)
-{
- const char *p;
- // Look for '| command'.
- for (p = name; *p == ' ' || *p == '\t'; p++) ;
- if (*p == '|') {
- procbuf *pbuf = new procbuf();
- init(pbuf);
- if (!pbuf->open(p+1, mode))
- set(ios::badbit);
- }
- else {
- init(new filebuf());
- if (!rdbuf()->open(name, mode, prot))
- set(ios::badbit);
- }
-}
diff --git a/contrib/libg++/libio/pfstream.h b/contrib/libg++/libio/pfstream.h
deleted file mode 100644
index 3c5458baaa93..000000000000
--- a/contrib/libg++/libio/pfstream.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/* This is part of libio/iostream, providing -*- C++ -*- input/output.
-Copyright (C) 1993 Free Software Foundation
-
-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. */
-
-/* Written by Per Bothner (bothner@cygnus.com). */
-
-#ifndef _PFSTREAM_H
-#define _PFSTREAM_H
-#ifdef __GNUG__
-#pragma interface
-#endif
-#include <fstream.h>
-
-extern "C++" {
-// ipfstream foo("NAME") is like: ifstream foo("NAME"). However,
-// if NAME starts *or ends* with a '|', the remainder of NAME is
-// evaluated as a shell command (using a procbuf), and all input
-// read from foo is whatever that shell writes to its standard output.
-// E.g. ipfstream foo("|zcat foo.Z") or ipfstream foo("zcat foo.Z|")
-// (These two forms are equivalent.)
-
-class ipfstream : public ifstream {
- public:
- ipfstream(const char *name, int mode=ios::in, int prot=0664);
-};
-
-// opfstream foo("NAME") is like: ofstream foo("NAME").
-// However, if NAME starts with a '|', the remainder of NAME is
-// evaluated as a shell command (using a procbuf), and all output
-// written to foo is piped to the standard input of that shell.
-// E.g. opfstream foo("|more");
-
-class opfstream : public ofstream {
- public:
- opfstream(const char *name, int mode=ios::out, int prot=0664);
-};
-} // extern "C++"
-#endif /*!_PFSTREAM_H*/
-
diff --git a/contrib/libg++/libio/procbuf.cc b/contrib/libg++/libio/procbuf.cc
deleted file mode 100644
index 1c79ce4ce0f7..000000000000
--- a/contrib/libg++/libio/procbuf.cc
+++ /dev/null
@@ -1,55 +0,0 @@
-/* This is part of libio/iostream, providing -*- C++ -*- input/output.
-Copyright (C) 1993 Free Software Foundation
-
-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. */
-
-/* Written by Per Bothner (bothner@cygnus.com). */
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-
-#define _POSIX_SOURCE
-#include "libioP.h"
-#include "procbuf.h"
-
-procbuf::procbuf(const char *command, int mode) : filebuf()
-{
- _IO_proc_open(this, command, (mode & ios::in) ? "r" : "w");
-}
-
-procbuf *procbuf::open(const char *command, int mode)
-{
- return (procbuf*)_IO_proc_open(this, command, (mode & ios::in) ? "r" : "w");
-}
-
-/* #define USE_SIGMASK */
-
-int procbuf::sys_close()
-{
- return _IO_proc_close(this);
-}
-
-procbuf::~procbuf()
-{
- close();
-}
diff --git a/contrib/libg++/libio/procbuf.h b/contrib/libg++/libio/procbuf.h
deleted file mode 100644
index b361a6a7c844..000000000000
--- a/contrib/libg++/libio/procbuf.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/* This is part of libio/iostream, providing -*- C++ -*- input/output.
-Copyright (C) 1993 Free Software Foundation
-
-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. */
-
-/* Written by Per Bothner (bothner@cygnus.com). */
-
-#ifndef _PROCBUF_H
-#define _PROCBUF_H
-#ifdef __GNUG__
-#pragma interface
-#endif
-
-#include <streambuf.h>
-
-extern "C++" {
-class procbuf : public filebuf {
- /* Following fields must match those in struct _IO_proc_file */
- _IO_pid_t _pid;
- procbuf *_next;
- public:
- procbuf() : filebuf() { }
- procbuf(const char *command, int mode);
- procbuf* open(const char *command, int mode);
- procbuf *close() { return (procbuf*)filebuf::close(); }
- virtual int sys_close();
- ~procbuf();
-};
-} // extern "C++"
-
-#endif /* !_PROCBUF_H */
diff --git a/contrib/libg++/libio/sbform.cc b/contrib/libg++/libio/sbform.cc
deleted file mode 100644
index c17bd08db15e..000000000000
--- a/contrib/libg++/libio/sbform.cc
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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 "streambuf.h"
-#include <stdarg.h>
-
-int streambuf::vform(char const *fmt0, _IO_va_list ap)
-{
- return _IO_vfprintf(this, fmt0, ap);
-}
-int streambuf::form(char const *format ...)
-{
- va_list ap;
- va_start(ap, format);
- int count = _IO_vfprintf(this, format, ap);
- va_end(ap);
- return count;
-}
diff --git a/contrib/libg++/libio/sbgetline.cc b/contrib/libg++/libio/sbgetline.cc
deleted file mode 100644
index 700e2ec7afc3..000000000000
--- a/contrib/libg++/libio/sbgetline.cc
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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 "streambuf.h"
-
-long streambuf::sgetline(char* buf, _IO_size_t n, char delim, int extract_delim)
-{
- return _IO_getline(this, buf, n, delim, extract_delim);
-}
diff --git a/contrib/libg++/libio/sbscan.cc b/contrib/libg++/libio/sbscan.cc
deleted file mode 100644
index c0ec35c53db6..000000000000
--- a/contrib/libg++/libio/sbscan.cc
+++ /dev/null
@@ -1,45 +0,0 @@
-
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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 "streambuf.h"
-#include <stdarg.h>
-
-int streambuf::vscan(char const *fmt0, _IO_va_list ap, ios* stream /* = NULL*/)
-{
- int errcode = 0;
- int count = _IO_vfscanf(this, fmt0, ap, &errcode);
- if (stream)
- stream->setstate((ios::iostate)errcode);
- return count;
-}
-int streambuf::scan(char const *format ...)
-{
- va_list ap;
- va_start(ap, format);
- int count = _IO_vfscanf(this, format, ap, NULL);
- va_end(ap);
- return count;
-}
diff --git a/contrib/libg++/libio/stdfiles.c b/contrib/libg++/libio/stdfiles.c
deleted file mode 100644
index 1d0ef85be90b..000000000000
--- a/contrib/libg++/libio/stdfiles.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
-Copyright (C) 1993, 1994 Free Software Foundation
-
-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. */
-
-
-/* This file provides definitions of _IO_stdin, _IO_stdout, and _IO_stderr
- for C code. Compare stdstreams.cc.
- (The difference is that here the vtable field is set to 0,
- so the objects defined are not valid C++ objects. On the other
- hand, we don't need a C++ compiler to build this file.) */
-
-#include "libioP.h"
-
-
-#define DEF_STDFILE(NAME, FD, CHAIN, FLAGS) \
- struct _IO_FILE_plus NAME \
- = {FILEBUF_LITERAL(CHAIN, FLAGS, FD), &_IO_file_jumps}
-
-DEF_STDFILE(_IO_stdin_, 0, 0, _IO_NO_WRITES);
-DEF_STDFILE(_IO_stdout_, 1, &_IO_stdin_.file, _IO_NO_READS);
-DEF_STDFILE(_IO_stderr_, 2, &_IO_stdout_.file,
- _IO_NO_READS+_IO_UNBUFFERED);
-
-_IO_FILE *_IO_list_all = &_IO_stderr_.file;
diff --git a/contrib/libg++/libio/stdiostream.cc b/contrib/libg++/libio/stdiostream.cc
deleted file mode 100644
index 80db5e59bfd5..000000000000
--- a/contrib/libg++/libio/stdiostream.cc
+++ /dev/null
@@ -1,159 +0,0 @@
-/* This is part of libio/iostream, providing -*- C++ -*- input/output.
-Copyright (C) 1993 Free Software Foundation
-
-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. */
-
-/* Written by Per Bothner (bothner@cygnus.com). */
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-
-#include <stdiostream.h>
-#include "libioP.h"
-
-// A stdiobuf is "tied" to a FILE object (as used by the stdio package).
-// Thus a stdiobuf is always synchronized with the corresponding FILE,
-// though at the cost of some overhead. (If you use the implementation
-// of stdio supplied with this library, you don't need stdiobufs.)
-// This implementation inherits from filebuf, but implement the virtual
-// functions sys_read/..., using the stdio functions fread/... instead
-// of the low-level read/... system calls. This has the advantage that
-// we get all of the nice filebuf semantics automatically, though
-// with some overhead.
-
-
-#ifndef SEEK_SET
-#define SEEK_SET 0
-#endif
-#ifndef SEEK_CUR
-#define SEEK_CUR 1
-#endif
-#ifndef SEEK_END
-#define SEEK_END 2
-#endif
-
-stdiobuf::stdiobuf(FILE *f) : filebuf(fileno(f))
-{
- _file = f;
- // Turn off buffer in stdiobuf. Instead, rely on buffering in (FILE).
- // Thus the stdiobuf will be synchronized with the FILE.
- setbuf(NULL, 0);
-}
-
-stdiobuf::~stdiobuf()
-{
- /* Only needed if we're buffered. Not buffered is the default. */
- _IO_do_flush((_IO_FILE*)this);
-}
-
-streamsize stdiobuf::sys_read(char* buf, streamsize size)
-{
- // A minor optimization, but it makes a noticable difference.
- // A bigger optimization would be to write stdiobuf::underflow,
- // but that has some modularity disadvantages. Re-evaluate that
- // after we have gotten rid of the double indirection. FIXME
- if (size == 1)
- {
- register ch = getc(_file);
- if (ch == EOF)
- return 0;
- *buf = (char)ch;
- return 1;
- }
- else
- return fread(buf, 1, size, _file);
-}
-
-streamsize stdiobuf::sys_write(const char *buf, streamsize n)
-{
- _IO_ssize_t count = fwrite(buf, 1, n, _file);
- if (_offset >= 0)
- _offset += n;
- return count;
-}
-
-streampos stdiobuf::sys_seek(streamoff offset, _seek_dir dir)
-{
- // Normally, equivalent to: fdir=dir
- int fdir =
- (dir == ios::beg) ? SEEK_SET :
- (dir == ios::cur) ? SEEK_CUR :
- (dir == ios::end) ? SEEK_END :
- dir;
- return fseek(_file, offset, fdir);
-}
-
-int stdiobuf::sys_close()
-{
- int status = fclose(_file);
- _file = NULL;
- return status;
-}
-
-int stdiobuf::sync()
-{
- if (_IO_do_flush((_IO_FILE*)this))
- return EOF;
- if (!(xflags() & _IO_NO_WRITES))
- if (fflush(_file))
- return EOF;
- return 0;
-}
-
-int stdiobuf::overflow(int c /* = EOF*/)
-{
- if (filebuf::overflow(c) == EOF)
- return EOF;
- if (c != EOF)
- return c;
- return fflush(_file);
-}
-
-streamsize stdiobuf::xsputn(const char* s, streamsize n)
-{
- if (buffered ())
- {
- // The filebuf implementation of sputn loses.
- return streambuf::xsputn(s, n);
- }
- else
- return fwrite (s, 1, n, _file);
-}
-
-void stdiobuf::buffered (int b)
-{
- if (b)
- {
- if (_flags & _IO_UNBUFFERED)
- { /* Was unbuffered, make it buffered. */
- _flags &= ~_IO_UNBUFFERED;
- }
- }
- else
- {
- if (!(_flags & _IO_UNBUFFERED))
- { /* Was buffered, make it unbuffered. */
- setbuf(NULL, 0);
- }
- }
-}
diff --git a/contrib/libg++/libio/stdiostream.h b/contrib/libg++/libio/stdiostream.h
deleted file mode 100644
index b973d7a39b62..000000000000
--- a/contrib/libg++/libio/stdiostream.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/* This is part of libio/iostream, providing -*- C++ -*- input/output.
-Copyright (C) 1993 Free Software Foundation
-
-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. */
-
-/* Written by Per Bothner (bothner@cygnus.com). */
-
-#ifndef _STDIOSTREAM_H
-#define _STDIOSTREAM_H
-
-#ifdef __GNUG__
-#pragma interface
-#endif
-
-#include <iostream.h>
-#include <stdio.h>
-
-extern "C++" {
-class stdiobuf : public filebuf {
- protected:
- FILE *_file;
- public:
- FILE* stdiofile() const { return _file; }
- stdiobuf(FILE *);
- ~stdiobuf();
- int buffered () const { return _flags & _IO_UNBUFFERED ? 0 : 1; }
- void buffered (int);
- virtual streamsize sys_read(char*, streamsize);
- virtual streampos sys_seek(streamoff, _seek_dir);
- virtual streamsize sys_write(const char*, streamsize);
- virtual int sys_close();
- virtual int sync();
- virtual int overflow(int c = EOF);
- streamsize xsputn(const char* s, streamsize n);
-};
-
-class istdiostream : public istream
-{
-private:
- stdiobuf _file;
-public:
- istdiostream (FILE* __f) : istream(), _file(__f) { init(&_file); }
- stdiobuf* rdbuf()/* const */ { return &_file; }
- int buffered () const { return _file.buffered (); }
- void buffered (int _i) { _file.buffered (_i); }
-};
-
-class ostdiostream : public ostream
-{
-private:
- stdiobuf _file;
-public:
- ostdiostream (FILE* __f) : ostream(), _file(__f) { init(&_file); }
- stdiobuf* rdbuf() /* const */ { return &_file; }
- int buffered () const { return _file.buffered (); }
- void buffered (int _i) { _file.buffered (_i); }
-};
-} // extern "C++"
-
-#endif /* !_STDIOSTREAM_H */
diff --git a/contrib/libg++/libio/stdstrbufs.cc b/contrib/libg++/libio/stdstrbufs.cc
deleted file mode 100644
index 8af259988a5d..000000000000
--- a/contrib/libg++/libio/stdstrbufs.cc
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
-Copyright (C) 1994 Free Software Foundation
-
-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. */
-
-
-/* This file provides definitions of _IO_stdin, _IO_stdout, and _IO_stderr
- for C++ code. Compare stdfiles.c.
- (The difference is that here the vtable field is set to
- point to builtinbuf's vtable, so the objects are effectively
- of class builtinbuf.) */
-
-#include "libioP.h"
-#include <stdio.h>
-
-#if !defined(filebuf_vtable) && defined(__cplusplus)
-#ifdef __GNUC__
-extern char filebuf_vtable[]
- asm (_G_VTABLE_LABEL_PREFIX
-#if _G_VTABLE_LABEL_HAS_LENGTH
- "7"
-#endif
- "filebuf");
-#else /* !__GNUC__ */
-#if _G_VTABLE_LABEL_HAS_LENGTH
-#define filebuf_vtable _G_VTABLE_LABEL_PREFIX_ID##7filebuf
-#else
-#define filebuf_vtable _G_VTABLE_LABEL_PREFIX_ID##filebuf
-#endif
-extern char filebuf_vtable[];
-#endif /* !__GNUC__ */
-#endif /* !defined(filebuf_vtable) && defined(__cplusplus) */
-
-#ifndef STD_VTABLE
-#define STD_VTABLE (const struct _IO_jump_t *)filebuf_vtable
-#endif
-
-#define DEF_STDFILE(NAME, FD, CHAIN, FLAGS) \
- struct _IO_FILE_plus NAME = {FILEBUF_LITERAL(CHAIN, FLAGS, FD), STD_VTABLE}
-
-DEF_STDFILE(_IO_stdin_, 0, 0, _IO_NO_WRITES);
-DEF_STDFILE(_IO_stdout_, 1, &_IO_stdin_.file, _IO_NO_READS);
-DEF_STDFILE(_IO_stderr_, 2, &_IO_stdout_.file,
- _IO_NO_READS+_IO_UNBUFFERED);
-
-#ifdef _STDIO_USES_IOSTREAM
-_IO_FILE *_IO_list_all = &_IO_stderr_.file;
-#else /* !_STDIO_USES_IOSTREAM */
-#include "stdiostream.h"
-
-struct _IO_fake_stdiobuf {
- struct {
- _IO_FILE file;
- const void *vtable;
- } s;
- FILE *stdio_file;
-};
-
-/* Define stdiobuf_vtable as a name for the virtual function table
- of the stdiobuf class. */
-#ifndef stdiobuf_vtable
-#ifdef __GNUC__
-extern struct _IO_jump_t stdiobuf_vtable
- asm (_G_VTABLE_LABEL_PREFIX
-#if _G_VTABLE_LABEL_HAS_LENGTH
- "8"
-#endif
- "stdiobuf");
-#else /* !__GNUC__ */
-#if _G_VTABLE_LABEL_HAS_LENGTH
-#define stdiobuf_vtable _G_VTABLE_LABEL_PREFIX_ID##8stdiobuf
-#else
-#define stdiobuf_vtable _G_VTABLE_LABEL_PREFIX_ID##stdiobuf
-#endif
-extern struct _IO_jump_t stdiobuf_vtable;
-#endif /* !__GNUC__ */
-#endif /* !stdiobuf_vtable */
-
-#if _IO_UNIFIED_JUMPTABLES
-#define JUMP_PTR /* Nothing */
-#else
-#define JUMP_PTR &_IO_streambuf_jumps,
-#endif
-
-#define DEF_STDIOFILE(NAME, FD, FILE, FLAGS, CHAIN) \
- 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, JUMP_PTR FD},\
- &stdiobuf_vtable}, 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_stderr_buf, 2, stderr, _IO_NO_READS, &_IO_stdout_buf.s.file);
-
-_IO_FILE *_IO_list_all = &_IO_stderr_buf.s.file;
-#endif /* !_STDIO_USES_IOSTREAM */
diff --git a/contrib/libg++/libio/stdstreams.cc b/contrib/libg++/libio/stdstreams.cc
deleted file mode 100644
index a5889d738e22..000000000000
--- a/contrib/libg++/libio/stdstreams.cc
+++ /dev/null
@@ -1,153 +0,0 @@
-/* This is part of libio/iostream, providing -*- C++ -*- input/output.
-Copyright (C) 1993 Free Software Foundation
-
-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. */
-
-/* Written by Per Bothner (bothner@cygnus.com). */
-
-#include "libioP.h"
-#include "streambuf.h"
-#include <stdio.h>
-
-// The ANSI draft requires that operations on cin/cout/cerr can be
-// mixed with operations on stdin/stdout/stderr on a character by
-// character basis. This normally requires that the streambuf's
-// used by cin/cout/cerr be stdiostreams. However, if the stdio
-// implementation is the one that is built using this library,
-// then we don't need to, since in that case stdin/stdout/stderr
-// are identical to _IO_stdin/_IO_stdout/_IO_stderr.
-
-#include "libio.h"
-
-#ifdef _STDIO_USES_IOSTREAM
-#define CIN_SBUF _IO_stdin_
-#define COUT_SBUF _IO_stdout_
-#define CERR_SBUF _IO_stderr_
-static int use_stdiobuf = 0;
-#else
-#define CIN_SBUF _IO_stdin_buf
-#define COUT_SBUF _IO_stdout_buf
-#define CERR_SBUF _IO_stderr_buf
-static int use_stdiobuf = 1;
-#endif
-
-#define cin CIN
-#define cout COUT
-#define cerr CERR
-#define clog CLOG
-#include "iostream.h"
-#undef cin
-#undef cout
-#undef cerr
-#undef clog
-
-#ifdef __GNUG__
-#define PAD 0 /* g++ allows 0-length arrays. */
-#else
-#define PAD 1
-#endif
-struct _fake_istream {
- struct myfields {
-#ifdef __GNUC__
- _ios_fields *vb; /* pointer to virtual base class ios */
- _IO_ssize_t _gcount;
-#else
- /* This is supposedly correct for cfront. */
- _IO_ssize_t _gcount;
- void *vptr;
- _ios_fields *vb; /* pointer to virtual base class ios */
-#endif
- } mine;
- _ios_fields base;
- char filler[sizeof(struct istream)-sizeof(struct _ios_fields)+PAD];
-};
-struct _fake_ostream {
- struct myfields {
-#ifndef __GNUC__
- void *vptr;
-#endif
- _ios_fields *vb; /* pointer to virtual base class ios */
- } mine;
- _ios_fields base;
- char filler[sizeof(struct ostream)-sizeof(struct _ios_fields)+PAD];
-};
-
-
-#ifdef _IO_NEW_STREAMS
-#define STD_STR(SBUF, TIE, EXTRA_FLAGS) \
- (streambuf*)&SBUF, TIE, 0, ios::skipws|ios::dec|EXTRA_FLAGS, ' ',0,0,6
-#else
-#define STD_STR(SBUF, TIE, EXTRA_FLAGS) \
- (streambuf*)&SBUF, TIE, 0, ios::dont_close|ios::dec|ios::skipws|EXTRA_FLAGS, ' ',0,0,6
-#endif
-
-#ifdef __GNUC__
-#define OSTREAM_DEF(NAME, SBUF, TIE, EXTRA_FLAGS, ASM) \
- _fake_ostream NAME ASM = { {&NAME.base}, {STD_STR(SBUF, TIE, EXTRA_FLAGS) }};
-#define ISTREAM_DEF(NAME, SBUF, TIE, EXTRA_FLAGS) \
- _fake_istream NAME = { {&NAME.base}, {STD_STR(SBUF, TIE, EXTRA_FLAGS) }};
-#else
-#define OSTREAM_DEF(NAME, SBUF, TIE, EXTRA_FLAGS) \
- _fake_ostream NAME = { {0, &NAME.base}, {STD_STR(SBUF, TIE, EXTRA_FLAGS) }};
-#define ISTREAM_DEF(NAME, SBUF, TIE, EXTRA_FLAGS) \
- _fake_istream NAME = {{0, 0, &NAME.base}, {STD_STR(SBUF, TIE, EXTRA_FLAGS)}};
-#endif
-
-OSTREAM_DEF(cout, COUT_SBUF, NULL, 0, )
-OSTREAM_DEF(cerr, CERR_SBUF,(ostream*)&cout, ios::unitbuf, )
-ISTREAM_DEF(cin, CIN_SBUF, (ostream*)&cout, 0)
-
-/* Only for (partial) compatibility with AT&T's library. */
-#if _G_CLOG_CONFLICT
-OSTREAM_DEF(clog, CERR_SBUF, (ostream*)&cout, 0, __asm__ ("__IO_clog"))
-#else
-OSTREAM_DEF(clog, CERR_SBUF, (ostream*)&cout, 0, )
-#endif
-
-// Switches between using _IO_std{in,out,err} and __std{in,out,err}_buf
-// for standard streams. This does not normally need to be called
-// explicitly, but is provided for AT&T compatibility.
-
-int ios::sync_with_stdio(int new_state)
-{
-#ifdef _STDIO_USES_IOSTREAM
- // It is always synced.
- return 0;
-#else
- if (new_state == use_stdiobuf) // The usual case now.
- return use_stdiobuf;
- if (new_state) {
- cin.base._strbuf = (streambuf*)&_IO_stdin_buf;
- cout.base._strbuf = (streambuf*)&_IO_stdout_buf;
- cerr.base._strbuf = (streambuf*)&_IO_stderr_buf;
- clog.base._strbuf = (streambuf*)&_IO_stderr_buf;
- } else {
- cin.base._strbuf = (streambuf*)_IO_stdin;
- cout.base._strbuf = (streambuf*)_IO_stdout;
- cerr.base._strbuf = (streambuf*)_IO_stderr;
- clog.base._strbuf = (streambuf*)_IO_stderr;
- }
- int old_state = use_stdiobuf;
- use_stdiobuf = new_state;
- return old_state;
-#endif
-}
diff --git a/contrib/libg++/libio/stream.cc b/contrib/libg++/libio/stream.cc
deleted file mode 100644
index 3440a0c9bdb4..000000000000
--- a/contrib/libg++/libio/stream.cc
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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 <stdarg.h>
-#include <string.h>
-#include "libioP.h"
-#include "stream.h"
-#include "strstream.h"
-
-static char Buffer[_IO_BUFSIZ];
-#define EndBuffer (Buffer+_IO_BUFSIZ)
-static char* next_chunk = Buffer; // Start of available part of Buffer.
-
-char* form(const char* format, ...)
-{
- int space_left = EndBuffer - next_chunk;
- // If less that 25% of the space is available start over.
- if (space_left < (_IO_BUFSIZ>>2))
- next_chunk = Buffer;
- char* buf = next_chunk;
-
- strstreambuf stream(buf, EndBuffer-buf-1, buf);
- va_list ap;
- va_start(ap, format);
- int count = stream.vform(format, ap);
- va_end(ap);
- stream.sputc(0);
- next_chunk = buf + stream.pcount();
- return buf;
-}
-
-#define u_long unsigned long
-
-static char* itoa(unsigned long i, int size, int neg, int base)
-{
- // Conservative estimate: If base==2, might need 8 characters
- // for each input byte, but normally 3 is plenty.
- int needed = size ? size
- : (base >= 8 ? 3 : 8) * sizeof(unsigned long) + 2;
- int space_left = EndBuffer - next_chunk;
- if (space_left <= needed)
- next_chunk = Buffer; // start over.
-
- char* buf = next_chunk;
-
- register char* ptr = buf+needed+1;
- next_chunk = ptr;
-
- if (needed < (2+neg) || ptr > EndBuffer)
- return NULL;
- *--ptr = 0;
-
- if (i == 0)
- *--ptr = '0';
- while (i != 0 && ptr > buf) {
- int ch = i % base;
- i = i / base;
- if (ch >= 10)
- ch += 'a' - 10;
- else
- ch += '0';
- *--ptr = ch;
- }
- if (neg)
- *--ptr = '-';
- if (size == 0)
- return ptr;
- while (ptr > buf)
- *--ptr = ' ';
- return buf;
-}
-
-char* dec(long i, int len /* = 0 */)
-{
- if (i >= 0) return itoa((unsigned long)i, len, 0, 10);
- else return itoa((unsigned long)(-i), len, 1, 10);
-}
-char* dec(int i, int len /* = 0 */)
-{
- if (i >= 0) return itoa((unsigned long)i, len, 0, 10);
- else return itoa((unsigned long)(-i), len, 1, 10);
-}
-char* dec(unsigned long i, int len /* = 0 */)
-{
- return itoa(i, len, 0, 10);
-}
-char* dec(unsigned int i, int len /* = 0 */)
-{
- return itoa(i, len, 0, 10);
-}
-
-char* hex(long i, int len /* = 0 */)
-{
- return itoa((unsigned long)i, len, 0, 16);
-}
-char* hex(int i, int len /* = 0 */)
-{
- return itoa((unsigned long)i, len, 0, 16);
-}
-char* hex(unsigned long i, int len /* = 0 */)
-{
- return itoa(i, len, 0, 16);
-}
-char* hex(unsigned int i, int len /* = 0 */)
-{
- return itoa(i, len, 0, 16);
-}
-
-char* oct(long i, int len /* = 0 */)
-{
- return itoa((unsigned long)i, len, 0, 8);
-}
-char* oct(int i, int len /* = 0 */)
-{
- return itoa((unsigned long)i, len, 0, 8);
-}
-char* oct(unsigned long i, int len /* = 0 */)
-{
- return itoa(i, len, 0, 8);
-}
-char* oct(unsigned int i, int len /* = 0 */)
-{
- return itoa(i, len, 0, 8);
-}
-
-static char *str(const char* s, int len, int width)
-{
- if (width < len)
- width = len;
- int space_left = EndBuffer - next_chunk;
- if (space_left <= width + 1)
- next_chunk = Buffer; // start over.
- char* buf = next_chunk;
- memset (buf, ' ', width - len);
- memcpy (buf + width - len, s, len);
- buf[width] = 0;
- return buf;
-}
-
-char* str(const char* s, int width)
-{
- return str (s, strlen (s), width);
-}
-
-char* chr(char ch, int width)
-{
- char c = ch;
- return str (&c, 1, width);
-}
diff --git a/contrib/libg++/libio/stream.h b/contrib/libg++/libio/stream.h
deleted file mode 100644
index 0859802ade69..000000000000
--- a/contrib/libg++/libio/stream.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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. */
-
-#ifndef _COMPAT_STREAM_H
-#define _COMPAT_STREAM_H
-
-// Compatibility with old library.
-// DO NOT USE THESE FUNCTIONS IN NEW CODE!
-// They are obsolete, non-standard, and non-reentrant.
-
-#define _STREAM_COMPAT
-#include <iostream.h>
-
-extern "C++" {
-extern char* form(const char*, ...);
-
-extern char* dec(long, int=0);
-extern char* dec(int, int=0);
-extern char* dec(unsigned long, int=0);
-extern char* dec(unsigned int, int=0);
-
-extern char* hex(long, int=0);
-extern char* hex(int, int=0);
-extern char* hex(unsigned long, int=0);
-extern char* hex(unsigned int, int=0);
-
-extern char* oct(long, int=0);
-extern char* oct(int, int=0);
-extern char* oct(unsigned long, int=0);
-extern char* oct(unsigned int, int=0);
-
-char* chr(char ch, int width = 0);
-char* str(const char* s, int width = 0);
-
-inline istream& WS(istream& str) { return ws(str); }
-} // extern "C++"
-
-#endif /* !_COMPAT_STREAM_H */
diff --git a/contrib/libg++/libio/streambuf.cc b/contrib/libg++/libio/streambuf.cc
deleted file mode 100644
index d66af097aa50..000000000000
--- a/contrib/libg++/libio/streambuf.cc
+++ /dev/null
@@ -1,343 +0,0 @@
-/* This is part of libio/iostream, providing -*- C++ -*- input/output.
-Copyright (C) 1991, 1992, 1993, 1995 Free Software Foundation
-
-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. */
-
-/* Written by Per Bothner (bothner@cygnus.com). */
-
-#define _STREAM_COMPAT
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include "iostreamP.h"
-#include <string.h>
-#include <stdarg.h>
-#include <errno.h>
-#ifndef errno
-extern int errno;
-#endif
-
-void streambuf::_un_link() { _IO_un_link(this); }
-
-void streambuf::_link_in() { _IO_link_in(this); }
-
-int streambuf::switch_to_get_mode()
-{ return _IO_switch_to_get_mode(this); }
-
-void streambuf::free_backup_area()
-{ _IO_free_backup_area(this); }
-
-#if 0
-int streambuf::switch_to_put_mode()
-{ return _IO_:switch_to_put_mode(this); }
-#endif
-
-int __overflow(streambuf* sb, int c)
-{
- return sb->overflow(c);
-}
-
-int streambuf::underflow()
-{ return EOF; }
-
-int streambuf::uflow()
-{ return _IO_default_uflow (this); }
-
-int streambuf::overflow(int /* = EOF */)
-{ return EOF; }
-
-streamsize streambuf::xsputn(register const char* s, streamsize n)
-{ return _IO_default_xsputn(this, s, n); }
-
-streamsize streambuf::xsgetn(char* s, streamsize n)
-{ return _IO_default_xsgetn(this, s, n); }
-
-int streambuf::ignore(int n)
-{
- register int more = n;
- for (;;) {
- int count = _IO_read_end - _IO_read_ptr; // Data available.
- if (count > 0) {
- if (count > more)
- count = more;
- _IO_read_ptr += count;
- more -= count;
- }
- if (more == 0 || __underflow(this) == EOF)
- break;
- }
- return n - more;
-}
-
-int streambuf::sync()
-{
- return 0;
-}
-
-int streambuf::pbackfail(int c)
-{
- return _IO_default_pbackfail(this, c);
-}
-
-streambuf* streambuf::setbuf(char* p, int len)
-{
- if (sync() == EOF)
- return NULL;
- if (p == NULL || len == 0) {
- unbuffered(1);
- setb(_shortbuf, _shortbuf+1, 0);
- }
- else {
- unbuffered(0);
- setb(p, p+len, 0);
- }
- setp(0, 0);
- setg(0, 0, 0);
- return this;
-}
-
-streampos streambuf::seekpos(streampos pos, int mode)
-{
- return seekoff(pos, ios::beg, mode);
-}
-
-streampos streambuf::sseekpos(streampos pos, int mode)
-{
- return _IO_seekpos (this, pos, mode);
-}
-
-void streambuf::setb(char* b, char* eb, int a)
-{ _IO_setb(this, b, eb, a); }
-
-int streambuf::doallocate() { return _IO_default_doallocate(this); }
-
-void streambuf::doallocbuf() { _IO_doallocbuf(this); }
-
-#if !_IO_UNIFIED_JUMPTABLES
-/* The following are jump table entries that just call the virtual method */
-
-static int _IO_sb_overflow(_IO_FILE *fp, int c)
-{ return ((streambuf*)fp)->overflow(c); }
-static int _IO_sb_underflow(_IO_FILE *fp)
-{ return ((streambuf*)fp)->underflow(); }
-static _IO_size_t _IO_sb_xsputn(_IO_FILE *fp, const void *s, _IO_size_t n)
-{ return ((streambuf*)fp)->xsputn((const char*)s, n); }
-static _IO_size_t _IO_sb_xsgetn(_IO_FILE *fp, void *s, _IO_size_t n)
-{ return ((streambuf*)fp)->xsgetn((char*)s, n); }
-static int _IO_sb_close(_IO_FILE *fp)
-{ return ((streambuf*)fp)->sys_close(); }
-static int _IO_sb_stat(_IO_FILE *fp, void *b)
-{ return ((streambuf*)fp)->sys_stat(b); }
-static int _IO_sb_doallocate(_IO_FILE *fp)
-{ return ((streambuf*)fp)->doallocate(); }
-
-static _IO_pos_t _IO_sb_seekoff(_IO_FILE *fp, _IO_off_t pos, int dir, int mode)
-{
- return ((streambuf*)fp)->seekoff(pos, (ios::seek_dir)dir, mode);
-}
-
-static _IO_pos_t _IO_sb_seekpos(_IO_FILE *fp, _IO_pos_t pos, int mode)
-{
- return ((streambuf*)fp)->seekpos(pos, mode);
-}
-
-static int _IO_sb_pbackfail(_IO_FILE *fp, int ch)
-{ return ((streambuf*)fp)->pbackfail(ch); }
-static void _IO_sb_finish(_IO_FILE *fp)
-{ ((streambuf*)fp)->~streambuf(); }
-static _IO_ssize_t _IO_sb_read(_IO_FILE *fp, void *buf, _IO_ssize_t n)
-{ return ((streambuf*)fp)->sys_read((char*)buf, n); }
-static _IO_ssize_t _IO_sb_write(_IO_FILE *fp, const void *buf, _IO_ssize_t n)
-{ return ((streambuf*)fp)->sys_write((const char*)buf, n); }
-static int _IO_sb_sync(_IO_FILE *fp)
-{ return ((streambuf*)fp)->sync(); }
-static _IO_pos_t _IO_sb_seek(_IO_FILE *fp, _IO_off_t off, int dir)
-{ return ((streambuf*)fp)->sys_seek(off, (_seek_dir)dir); }
-static _IO_FILE* _IO_sb_setbuf(_IO_FILE *fp, char *buf, _IO_ssize_t n)
-{ return ((streambuf*)fp)->setbuf(buf, n); }
-
-/* This callbacks in this jumptable just call the corresponding
- virtual function, so that C functions can access (potentially user-defined)
- streambuf-derived objects.
- Contrast the builtinbuf class, which does the converse: Allow
- C++ virtual calls to to be used on _IO_FILE objects that are builtin
- (or defined by C code). */
-
-
-struct _IO_jump_t _IO_streambuf_jumps = {
- JUMP_INIT_DUMMY,
- JUMP_INIT(finish, _IO_sb_finish),
- JUMP_INIT(overflow, _IO_sb_overflow),
- JUMP_INIT(underflow, _IO_sb_underflow),
- JUMP_INIT(uflow, _IO_default_uflow),
- JUMP_INIT(pbackfail, _IO_sb_pbackfail),
- JUMP_INIT(xsputn, _IO_sb_xsputn),
- JUMP_INIT(xsgetn, _IO_sb_xsgetn),
- JUMP_INIT(seekoff, _IO_sb_seekoff),
- JUMP_INIT(seekpos, _IO_sb_seekpos),
- JUMP_INIT(setbuf, _IO_sb_setbuf),
- JUMP_INIT(sync, _IO_sb_sync),
- JUMP_INIT(doallocate, _IO_sb_doallocate),
- JUMP_INIT(read, _IO_sb_read),
- JUMP_INIT(write, _IO_sb_write),
- JUMP_INIT(seek, _IO_sb_seek),
- JUMP_INIT(close, _IO_sb_close),
- JUMP_INIT(stat, _IO_sb_stat)
-};
-#endif
-
-streambuf::streambuf(int flags)
-{
- _IO_init(this, flags);
-#if !_IO_UNIFIED_JUMPTABLES
- _jumps = &_IO_streambuf_jumps;
-#endif
-}
-
-streambuf::~streambuf() { _IO_default_finish(this); }
-
-streampos
-streambuf::seekoff(streamoff, _seek_dir, int /*=ios::in|ios::out*/)
-{
- return EOF;
-}
-
-streampos
-streambuf::sseekoff(streamoff o , _seek_dir d, int m /*=ios::in|ios::out*/)
-{
- return _IO_seekoff (this, o, d, m);
-}
-
-int streambuf::sputbackc(char c)
-{
- return _IO_sputbackc(this, c);
-}
-
-int streambuf::sungetc()
-{
- return _IO_sungetc(this);
-}
-
-#if 0 /* Work in progress */
-void streambuf::collumn(int c)
-{
- if (c == -1)
- _collumn = -1;
- else
- _collumn = c - (_IO_write_ptr - _IO_write_base);
-}
-#endif
-
-
-int streambuf::get_column()
-{
- if (_cur_column)
- return _IO_adjust_column(_cur_column - 1, pbase(), pptr() - pbase());
- return -1;
-}
-
-int streambuf::set_column(int i)
-{
- _cur_column = i+1;
- return 0;
-}
-
-int streambuf::flush_all() { return _IO_flush_all (); }
-
-void streambuf::flush_all_linebuffered()
-{ _IO_flush_all_linebuffered(); }
-
-int streambuf::sys_stat(void *)
-{
-#ifdef EIO
- errno = EIO;
-#endif
- return -1;
-}
-
-streamsize streambuf::sys_read(char* /*buf*/, streamsize /*size*/)
-{
- return 0;
-}
-
-streamsize streambuf::sys_write(const char* /*buf*/, streamsize /*size*/)
-{
- return 0;
-}
-
-streampos streambuf::sys_seek(streamoff, _seek_dir)
-{
- return EOF;
-}
-
-int streambuf::sys_close() { return 0; /* Suceess; do nothing */ }
-
-streammarker::streammarker(streambuf *sb)
-{
- _IO_init_marker(this, sb);
-}
-
-streammarker::~streammarker()
-{
- _IO_remove_marker(this);
-}
-
-#define BAD_DELTA EOF
-
-int streammarker::delta(streammarker& other_mark)
-{
- return _IO_marker_difference(this, &other_mark);
-}
-
-int streammarker::delta()
-{
- return _IO_marker_delta(this);
-}
-
-int streambuf::seekmark(streammarker& mark, int delta /* = 0 */)
-{
- return _IO_seekmark(this, &mark, delta);
-}
-
-void streambuf::unsave_markers()
-{
- _IO_unsave_markers(this);
-}
-
-int ios::readable() { return !(rdbuf()->_flags & _IO_NO_READS); }
-int ios::writable() { return !(rdbuf()->_flags & _IO_NO_WRITES); }
-int ios::is_open() { return rdbuf()
- && (rdbuf()->_flags & _IO_NO_READS+_IO_NO_WRITES)
- != _IO_NO_READS+_IO_NO_WRITES; }
-
-#if defined(linux)
-#define IO_CLEANUP
-#endif
-
-#ifdef IO_CLEANUP
- IO_CLEANUP
-#else
-struct __io_defs {
- ~__io_defs() { _IO_cleanup (); }
-};
-__io_defs io_defs__;
-#endif
diff --git a/contrib/libg++/libio/streambuf.h b/contrib/libg++/libio/streambuf.h
deleted file mode 100644
index 688c891280e2..000000000000
--- a/contrib/libg++/libio/streambuf.h
+++ /dev/null
@@ -1,475 +0,0 @@
-/* This is part of libio/iostream, providing -*- C++ -*- input/output.
-Copyright (C) 1993 Free Software Foundation
-
-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. */
-
-#ifndef _STREAMBUF_H
-#define _STREAMBUF_H
-#ifdef __GNUG__
-#pragma interface
-#endif
-
-/* #define _G_IO_THROW */ /* Not implemented: ios::failure */
-
-#define _IO_NEW_STREAMS // new optimizated stream representation
-
-extern "C" {
-#include <libio.h>
-}
-//#include <_G_config.h>
-#ifdef _IO_NEED_STDARG_H
-#include <stdarg.h>
-#endif
-#ifndef _IO_va_list
-#define _IO_va_list char *
-#endif
-
-#ifndef EOF
-#define EOF (-1)
-#endif
-#ifndef NULL
-#ifdef __GNUC__
-#define NULL ((void*)0)
-#else
-#define NULL (0)
-#endif
-#endif
-
-#ifndef _IO_wchar_t
-#define _IO_wchar_t short
-#endif
-
-extern "C++" {
-class istream; /* Work-around for a g++ name mangling bug. Fixed in 2.6. */
-class ostream; class streambuf;
-
-// In case some header files defines these as macros.
-#undef open
-#undef close
-
-typedef _IO_off_t streamoff;
-typedef _IO_fpos_t streampos;
-typedef _IO_ssize_t streamsize;
-
-typedef unsigned long __fmtflags;
-typedef unsigned char __iostate;
-
-struct _ios_fields
-{ // The data members of an ios.
- streambuf *_strbuf;
- ostream* _tie;
- int _width;
- __fmtflags _flags;
- _IO_wchar_t _fill;
- __iostate _state;
- __iostate _exceptions;
- int _precision;
-
- void *_arrays; /* Support for ios::iword and ios::pword. */
-};
-
-#define _IOS_GOOD 0
-#define _IOS_EOF 1
-#define _IOS_FAIL 2
-#define _IOS_BAD 4
-
-#define _IO_INPUT 1
-#define _IO_OUTPUT 2
-#define _IO_ATEND 4
-#define _IO_APPEND 8
-#define _IO_TRUNC 16
-#define _IO_NOCREATE 32
-#define _IO_NOREPLACE 64
-#define _IO_BIN 128
-
-#ifdef _STREAM_COMPAT
-enum state_value {
- _good = _IOS_GOOD,
- _eof = _IOS_EOF,
- _fail = _IOS_FAIL,
- _bad = _IOS_BAD };
-enum open_mode {
- input = _IO_INPUT,
- output = _IO_OUTPUT,
- atend = _IO_ATEND,
- append = _IO_APPEND };
-#endif
-
-class ios : public _ios_fields {
- ios& operator=(ios&); /* Not allowed! */
- ios (const ios&); /* Not allowed! */
- public:
- typedef __fmtflags fmtflags;
- typedef int iostate;
- typedef int openmode;
- typedef int streamsize;
- enum io_state {
- goodbit = _IOS_GOOD,
- eofbit = _IOS_EOF,
- failbit = _IOS_FAIL,
- badbit = _IOS_BAD };
- enum open_mode {
- in = _IO_INPUT,
- out = _IO_OUTPUT,
- ate = _IO_ATEND,
- app = _IO_APPEND,
- trunc = _IO_TRUNC,
- nocreate = _IO_NOCREATE,
- noreplace = _IO_NOREPLACE,
- bin = _IOS_BIN, // Deprecated - ANSI uses ios::binary.
- binary = _IOS_BIN };
- enum seek_dir { beg, cur, end};
- // ANSI: typedef enum seek_dir seekdir; etc
- // NOTE: If adding flags here, before to update ios::bitalloc().
- enum { skipws=_IO_SKIPWS,
- left=_IO_LEFT, right=_IO_RIGHT, internal=_IO_INTERNAL,
- dec=_IO_DEC, oct=_IO_OCT, hex=_IO_HEX,
- showbase=_IO_SHOWBASE, showpoint=_IO_SHOWPOINT,
- uppercase=_IO_UPPERCASE, showpos=_IO_SHOWPOS,
- scientific=_IO_SCIENTIFIC, fixed=_IO_FIXED,
- unitbuf=_IO_UNITBUF, stdio=_IO_STDIO
-#ifndef _IO_NEW_STREAMS
- , dont_close=_IO_DONT_CLOSE // Don't delete streambuf on stream destruction
-#endif
- };
- enum { // Masks.
- basefield=dec+oct+hex,
- floatfield = scientific+fixed,
- adjustfield = left+right+internal
- };
-
-#ifdef _IO_THROW
- class failure : public xmsg {
- ios* _stream;
- public:
- failure(ios* stream) { _stream = stream; }
- failure(string cause, ios* stream) { _stream = stream; }
- ios* rdios() const { return _stream; }
- };
-#endif
-
- ostream* tie() const { return _tie; }
- ostream* tie(ostream* val) { ostream* save=_tie; _tie=val; return save; }
-
- // Methods to change the format state.
- _IO_wchar_t fill() const { return (_IO_wchar_t)_fill; }
- _IO_wchar_t fill(_IO_wchar_t newf)
- {_IO_wchar_t oldf = (_IO_wchar_t)_fill; _fill = (char)newf; return oldf;}
- fmtflags flags() const { return _flags; }
- fmtflags flags(fmtflags new_val) {
- fmtflags old_val = _flags; _flags = new_val; return old_val; }
- int precision() const { return _precision; }
- int precision(int newp) {
- unsigned short oldp = _precision; _precision = (unsigned short)newp;
- return oldp; }
- fmtflags setf(fmtflags val) {
- fmtflags oldbits = _flags;
- _flags |= val; return oldbits; }
- fmtflags setf(fmtflags val, fmtflags mask) {
- fmtflags oldbits = _flags;
- _flags = (_flags & ~mask) | (val & mask); return oldbits; }
- fmtflags unsetf(fmtflags mask) {
- fmtflags oldbits = _flags;
- _flags &= ~mask; return oldbits; }
- int width() const { return _width; }
- int width(int val) { int save = _width; _width = val; return save; }
-
-#ifdef _IO_THROW
- void _throw_failure() const { throw new ios::failure(this); }
-#else
- void _throw_failure() const { }
-#endif
- void clear(iostate state = 0) {
- _state = _strbuf ? state : state|badbit;
- if (_state & _exceptions) _throw_failure(); }
- void set(iostate flag) { _state |= flag;
- if (_state & _exceptions) _throw_failure(); }
- void setstate(iostate flag) { _state |= flag; // ANSI
- if (_state & _exceptions) _throw_failure(); }
- int good() const { return _state == 0; }
- int eof() const { return _state & ios::eofbit; }
- int fail() const { return _state & (ios::badbit|ios::failbit); }
- int bad() const { return _state & ios::badbit; }
- iostate rdstate() const { return _state; }
- operator void*() const { return fail() ? (void*)0 : (void*)(-1); }
- int operator!() const { return fail(); }
- iostate exceptions() const { return _exceptions; }
- void exceptions(iostate enable) {
- _exceptions = enable;
- if (_state & _exceptions) _throw_failure(); }
-
- streambuf* rdbuf() const { return _strbuf; }
- streambuf* rdbuf(streambuf *_s) {
- streambuf *_old = _strbuf; _strbuf = _s; clear (); return _old; }
-
- static int sync_with_stdio(int on);
- static void sync_with_stdio() { sync_with_stdio(1); }
- static fmtflags bitalloc();
- static int xalloc();
- void*& pword(int);
- void* pword(int) const;
- long& iword(int);
- long iword(int) const;
-
-#ifdef _STREAM_COMPAT
- void unset(state_value flag) { _state &= ~flag; }
- void close();
- int is_open();
- int readable();
- int writable();
-#endif
-
- // Used to initialize standard streams. Not needed in this implementation.
- class Init {
- public:
- Init () { }
- };
-
- protected:
- inline ios(streambuf* sb = 0, ostream* tie_to = 0);
- inline virtual ~ios();
- inline void init(streambuf* sb, ostream* tie = 0);
-};
-
-#if __GNUG__==1
-typedef int _seek_dir;
-#else
-typedef ios::seek_dir _seek_dir;
-#endif
-
-// Magic numbers and bits for the _flags field.
-// The magic numbers use the high-order bits of _flags;
-// the remaining bits are abailable for variable flags.
-// Note: The magic numbers must all be negative if stdio
-// emulation is desired.
-
-// A streammarker remembers a position in a buffer.
-// You are guaranteed to be able to seek back to it if it is saving().
-class streammarker : private _IO_marker {
- friend class streambuf;
- void set_offset(int offset) { _pos = offset; }
- public:
- streammarker(streambuf *sb);
- ~streammarker();
- int saving() { return 1; }
- int delta(streammarker&);
- int delta();
-};
-
-struct streambuf : public _IO_FILE { // protected??
- friend class ios;
- friend class istream;
- friend class ostream;
- friend class streammarker;
- const void *&_vtable() { return *(const void**)((_IO_FILE*)this + 1); }
- protected:
- static streambuf* _list_all; /* List of open streambufs. */
- _IO_FILE*& xchain() { return _chain; }
- void _un_link();
- void _link_in();
- char* gptr() const
- { return _IO_file_flags & _IO_IN_BACKUP ? _IO_save_base : _IO_read_ptr; }
- char* pptr() const { return _IO_write_ptr; }
- char* egptr() const
- { return _IO_file_flags & _IO_IN_BACKUP ? _IO_save_end : _IO_read_end; }
- char* epptr() const { return _IO_write_end; }
- char* pbase() const { return _IO_write_base; }
- char* eback() const
- { return _IO_file_flags & _IO_IN_BACKUP ? _IO_save_base : _IO_read_base;}
- char* base() const { return _IO_buf_base; }
- char* ebuf() const { return _IO_buf_end; }
- int blen() const { return _IO_buf_end - _IO_buf_base; }
- void xput_char(char c) { *_IO_write_ptr++ = c; }
- int xflags() { return _IO_file_flags; }
- int xflags(int f) {int fl = _IO_file_flags; _IO_file_flags = f; return fl;}
- void xsetflags(int f) { _IO_file_flags |= f; }
- void xsetflags(int f, int mask)
- { _IO_file_flags = (_IO_file_flags & ~mask) | (f & mask); }
- void gbump(int n)
- { _IO_file_flags & _IO_IN_BACKUP ? (_IO_save_base+=n):(_IO_read_ptr+=n);}
- void pbump(int n) { _IO_write_ptr += n; }
- void setb(char* b, char* eb, int a=0);
- void setp(char* p, char* ep)
- { _IO_write_base=_IO_write_ptr=p; _IO_write_end=ep; }
- void setg(char* eb, char* g, char *eg) {
- if (_IO_file_flags & _IO_IN_BACKUP) _IO_free_backup_area(this);
- _IO_read_base = eb; _IO_read_ptr = g; _IO_read_end = eg; }
- char *shortbuf() { return _shortbuf; }
-
- int in_backup() { return _flags & _IO_IN_BACKUP; }
- // The start of the main get area: FIXME: wrong for write-mode filebuf?
- char *Gbase() { return in_backup() ? _IO_save_base : _IO_read_base; }
- // The end of the main get area:
- char *eGptr() { return in_backup() ? _IO_save_end : _IO_read_end; }
- // The start of the backup area:
- char *Bbase() { return in_backup() ? _IO_read_base : _IO_save_base; }
- char *Bptr() { return _IO_backup_base; }
- // The end of the backup area:
- char *eBptr() { return in_backup() ? _IO_read_end : _IO_save_end; }
- char *Nbase() { return _IO_save_base; }
- char *eNptr() { return _IO_save_end; }
- int have_backup() { return _IO_save_base != NULL; }
- int have_markers() { return _markers != NULL; }
- void free_backup_area();
- void unsave_markers(); // Make all streammarkers !saving().
- int put_mode() { return _flags & _IO_CURRENTLY_PUTTING; }
- int switch_to_get_mode();
-
- streambuf(int flags=0);
- public:
- static int flush_all();
- static void flush_all_linebuffered(); // Flush all line buffered files.
- virtual ~streambuf();
- virtual int overflow(int c = EOF); // Leave public for now
- virtual int underflow(); // Leave public for now
- virtual int uflow(); // Leave public for now
- virtual int pbackfail(int c);
-// virtual int showmany ();
- virtual streamsize xsputn(const char* s, streamsize n);
- virtual streamsize xsgetn(char* s, streamsize n);
- virtual streampos seekoff(streamoff, _seek_dir, int mode=ios::in|ios::out);
- virtual streampos seekpos(streampos pos, int mode = ios::in|ios::out);
-
- streampos pubseekoff(streamoff o, _seek_dir d, int mode=ios::in|ios::out)
- { return _IO_seekoff (this, o, d, mode); }
- streampos pubseekpos(streampos pos, int mode = ios::in|ios::out)
- { return _IO_seekpos (this, pos, mode); }
- streampos sseekoff(streamoff, _seek_dir, int mode=ios::in|ios::out);
- streampos sseekpos(streampos pos, int mode = ios::in|ios::out);
- virtual streambuf* setbuf(char* p, int len);
- virtual int sync();
- virtual int doallocate();
-
- int seekmark(streammarker& mark, int delta = 0);
- int sputbackc(char c);
- int sungetc();
- int unbuffered() { return _flags & _IO_UNBUFFERED ? 1 : 0; }
- int linebuffered() { return _flags & _IO_LINE_BUF ? 1 : 0; }
- void unbuffered(int i)
- { if (i) _flags |= _IO_UNBUFFERED; else _flags &= ~_IO_UNBUFFERED; }
- void linebuffered(int i)
- { if (i) _flags |= _IO_LINE_BUF; else _flags &= ~_IO_LINE_BUF; }
- int allocate() { // For AT&T compatibility
- if (base() || unbuffered()) return 0;
- else return doallocate(); }
- // Allocate a buffer if needed; use _shortbuf if appropriate.
- void allocbuf() { if (base() == NULL) doallocbuf(); }
- void doallocbuf();
- int in_avail() { return _IO_read_end - _IO_read_ptr; }
- int out_waiting() { return _IO_write_ptr - _IO_write_base; }
- streamsize sputn(const char* s, streamsize n) { return xsputn(s, n); }
- streamsize padn(char pad, streamsize n) { return _IO_padn(this, pad, n); }
- streamsize sgetn(char* s, streamsize n) { return _IO_sgetn(this, s, n); }
- int ignore(int);
- int get_column();
- int set_column(int);
- long sgetline(char* buf, _IO_size_t n, char delim, int putback_delim);
- int sputc(int c) { return _IO_putc(c, this); }
- int sbumpc() { return _IO_getc(this); }
- int sgetc() { return _IO_peekc(this); }
- int snextc() {
- if (_IO_read_ptr >= _IO_read_end && __underflow(this) == EOF)
- return EOF;
- else return _IO_read_ptr++, sgetc(); }
- void stossc() { if (_IO_read_ptr < _IO_read_end) _IO_read_ptr++; }
- int vscan(char const *fmt0, _IO_va_list ap, ios* stream = NULL);
- int scan(char const *fmt0 ...);
- int vform(char const *fmt0, _IO_va_list ap);
- int form(char const *fmt0 ...);
-#if 0 /* Work in progress */
- int column(); // Current column number (of put pointer). -1 is unknown.
- void column(int c); // Set column number of put pointer to c.
-#endif
- virtual streamsize sys_read(char* buf, streamsize size);
- virtual streamsize sys_write(const char*, streamsize);
- virtual streampos sys_seek(streamoff, _seek_dir);
- virtual int sys_close();
- virtual int sys_stat(void*); // Actually, a (struct stat*)
-};
-
-// A backupbuf is a streambuf with full backup and savepoints on reading.
-// All standard streambufs in the GNU iostream library are backupbufs.
-
-class filebuf : public streambuf {
- protected:
- void init();
- public:
- static const int openprot; // Non-ANSI AT&T-ism: Default open protection.
- filebuf();
- filebuf(int fd);
- filebuf(int fd, char* p, int len);
-#if !_IO_UNIFIED_JUMPTABLES
- static filebuf *__new();
-#endif
- ~filebuf();
- filebuf* attach(int fd);
- filebuf* open(const char *filename, const char *mode);
- filebuf* open(const char *filename, ios::openmode mode, int prot = 0664);
- virtual int underflow();
- virtual int overflow(int c = EOF);
- int is_open() const { return _fileno >= 0; }
- int fd() const { return is_open() ? _fileno : EOF; }
- filebuf* close();
- virtual int doallocate();
- virtual streampos seekoff(streamoff, _seek_dir, int mode=ios::in|ios::out);
- virtual streambuf* setbuf(char* p, int len);
- streamsize xsputn(const char* s, streamsize n);
- streamsize xsgetn(char* s, streamsize n);
- virtual int sync();
- protected: // See documentation in filebuf.C.
-// virtual int pbackfail(int c);
- int is_reading() { return eback() != egptr(); }
- char* cur_ptr() { return is_reading() ? gptr() : pptr(); }
- /* System's idea of pointer */
- char* file_ptr() { return eGptr(); }
- // Low-level operations (Usually invoke system calls.)
- virtual streamsize sys_read(char* buf, streamsize size);
- virtual streampos sys_seek(streamoff, _seek_dir);
- virtual streamsize sys_write(const char*, streamsize);
- virtual int sys_stat(void*); // Actually, a (struct stat*)
- virtual int sys_close();
-#if 0
- virtual uflow;
- virtual showmany;
-#endif
-};
-
-inline void ios::init(streambuf* sb, ostream* tie_to) {
- _state = sb ? ios::goodbit : ios::badbit; _exceptions=0;
- _strbuf=sb; _tie = tie_to; _width=0; _fill=' ';
-#ifdef _IO_NEW_STREAMS
- _flags=ios::skipws|ios::dec;
-#else
- _flags=ios::skipws|ios::dec|ios::dont_close;
-#endif
- _precision=6; _arrays = 0; }
-
-inline ios::ios(streambuf* sb, ostream* tie_to) { init(sb, tie_to); }
-
-inline ios::~ios() {
-#ifndef _IO_NEW_STREAMS
- if (!(_flags & (unsigned int)ios::dont_close)) delete rdbuf();
-#endif
- if (_arrays) delete [] _arrays;
-}
-} // extern "C++"
-#endif /* _STREAMBUF_H */
diff --git a/contrib/libg++/libio/strfile.h b/contrib/libg++/libio/strfile.h
deleted file mode 100644
index d2ae4c028694..000000000000
--- a/contrib/libg++/libio/strfile.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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 <libio.h>
-#ifdef TODO
-Merge into libio.h ?
-#endif
-
-typedef void *(*_IO_alloc_type) __P((_IO_size_t));
-typedef void (*_IO_free_type) __P((void*));
-
-struct _IO_str_fields
-{
- _IO_alloc_type _allocate_buffer;
- _IO_free_type _free_buffer;
-};
-
-typedef struct _IO_strfile_
-{
- struct _IO_FILE _f;
- const void *_vtable;
- struct _IO_str_fields _s;
-} _IO_strfile;
-
-/* dynamic: set when the array object is allocated (or reallocated) as
- necessary to hold a character sequence that can change in length. */
-#define _IO_STR_DYNAMIC(FP) ((FP)->_s._allocate_buffer != (_IO_alloc_type)0)
-
-/* frozen: set when the program has requested that the array object not
- be altered, reallocated, or freed. */
-#define _IO_STR_FROZEN(FP) ((FP)->_f._IO_file_flags & _IO_USER_BUF)
diff --git a/contrib/libg++/libio/strops.c b/contrib/libg++/libio/strops.c
deleted file mode 100644
index c88a1335ffd6..000000000000
--- a/contrib/libg++/libio/strops.c
+++ /dev/null
@@ -1,290 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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 "strfile.h"
-#include "libioP.h"
-#include <string.h>
-
-#if 0
-/* The following definitions are for exposition only.
- They map the terminlogy used in the ANSI/ISO C++ draft standard
- to the implementation. */
-
-/* allocated: set when a dynamic array object has been allocated, and
- hence should be freed by the destructor for the strstreambuf object. */
-#define ALLOCATED(FP) ((FP)->_f._IO_buf_base && DYNAMIC(FP))
-
-/* constant: set when the array object has const elements,
- so the output sequence cannot be written. */
-#define CONSTANT(FP) ((FP)->_f._IO_file_flags & _IO_NO_WRITES)
-
-/* alsize: the suggested minimum size for a dynamic array object. */
-#define ALSIZE(FP) ??? /* not stored */
-
-/* palloc: points to the function to call to allocate a dynamic array object.*/
-#define PALLOC(FP) \
- ((FP)->_s._allocate_buffer == default_alloc ? 0 : (FP)->_s._allocate_buffer)
-
-/* pfree: points to the function to call to free a dynamic array object. */
-#define PFREE(FP) \
- ((FP)->_s._free_buffer == default_free ? 0 : (FP)->_s._free_buffer)
-
-#endif
-
-#ifdef TODO
-/* An "unbounded buffer" is when a buffer is supplied, but with no
- specified length. An example is the buffer argument to sprintf.
- */
-#endif
-
-void
-DEFUN(_IO_str_init_static, (fp, ptr, size, pstart),
- _IO_FILE *fp AND char *ptr AND int size AND char *pstart)
-{
- if (size == 0)
- size = strlen(ptr);
- else if (size < 0)
- {
- /* If size is negative 'the characters are assumed to
- continue indefinitely.' This is kind of messy ... */
- int s;
- size = 512;
- /* Try increasing powers of 2, as long as we don't wrap around. */
- for (; s = 2*size, s > 0 && ptr + s > ptr && s < 0x4000000L; )
- size = s;
- /* Try increasing size as much as we can without wrapping around. */
- for (s = size >> 1; s > 0; s >>= 1)
- {
- if (ptr + size + s > ptr)
- size += s;
- }
- }
- _IO_setb(fp, ptr, ptr+size, 0);
-
- fp->_IO_write_base = ptr;
- fp->_IO_read_base = ptr;
- fp->_IO_read_ptr = ptr;
- if (pstart)
- {
- fp->_IO_write_ptr = pstart;
- fp->_IO_write_end = ptr+size;
- fp->_IO_read_end = pstart;
- }
- else
- {
- fp->_IO_write_ptr = ptr;
- fp->_IO_write_end = ptr;
- fp->_IO_read_end = ptr+size;
- }
- /* A null _allocate_buffer function flags the strfile as being static. */
- (((_IO_strfile*)(fp))->_s._allocate_buffer) = (_IO_alloc_type)0;
-}
-
-void
-DEFUN(_IO_str_init_readonly, (fp, ptr, size),
- _IO_FILE *fp AND const char *ptr AND int size)
-{
- _IO_str_init_static (fp, (char*)ptr, size, NULL);
- fp->_IO_file_flags |= _IO_NO_WRITES;
-}
-
-int
-DEFUN(_IO_str_overflow, (fp, c),
- register _IO_FILE* fp AND int c)
-{
- int flush_only = c == EOF;
- _IO_size_t pos;
- if (fp->_flags & _IO_NO_WRITES)
- return flush_only ? 0 : EOF;
- if ((fp->_flags & _IO_TIED_PUT_GET) && !(fp->_flags & _IO_CURRENTLY_PUTTING))
- {
- fp->_flags |= _IO_CURRENTLY_PUTTING;
- fp->_IO_write_ptr = fp->_IO_read_ptr;
- fp->_IO_read_ptr = fp->_IO_read_end;
- }
- pos = fp->_IO_write_ptr - fp->_IO_write_base;
- if (pos >= _IO_blen(fp) + flush_only)
- {
- if (fp->_flags & _IO_USER_BUF) /* not allowed to enlarge */
- return EOF;
- else
- {
- char *new_buf;
- char *old_buf = fp->_IO_buf_base;
- _IO_size_t new_size = 2 * _IO_blen(fp) + 100;
- new_buf
- = (char*)(*((_IO_strfile*)fp)->_s._allocate_buffer)(new_size);
- if (new_buf == NULL)
- {
- /* __ferror(fp) = 1; */
- return EOF;
- }
- if (fp->_IO_buf_base)
- {
- memcpy(new_buf, old_buf, _IO_blen(fp));
- (*((_IO_strfile*)fp)->_s._free_buffer)(fp->_IO_buf_base);
- /* Make sure _IO_setb won't try to delete _IO_buf_base. */
- fp->_IO_buf_base = NULL;
- }
-#if 0
- if (lenp == &LEN(fp)) /* use '\0'-filling */
- memset(new_buf + pos, 0, blen() - pos);
-#endif
- _IO_setb(fp, new_buf, new_buf + new_size, 1);
- fp->_IO_read_base = new_buf + (fp->_IO_read_base - old_buf);
- fp->_IO_read_ptr = new_buf + (fp->_IO_read_ptr - old_buf);
- fp->_IO_read_end = new_buf + (fp->_IO_read_end - old_buf);
- fp->_IO_write_ptr = new_buf + (fp->_IO_write_ptr - old_buf);
-
- fp->_IO_write_base = new_buf;
- fp->_IO_write_end = fp->_IO_buf_end;
- }
- }
-
- if (!flush_only)
- *fp->_IO_write_ptr++ = (unsigned char) c;
- if (fp->_IO_write_ptr > fp->_IO_read_end)
- fp->_IO_read_end = fp->_IO_write_ptr;
- return c;
-}
-
-int
-DEFUN(_IO_str_underflow, (fp),
- register _IO_FILE* fp)
-{
- if (fp->_IO_write_ptr > fp->_IO_read_end)
- fp->_IO_read_end = fp->_IO_write_ptr;
- if ((fp->_flags & _IO_TIED_PUT_GET) && (fp->_flags & _IO_CURRENTLY_PUTTING))
- {
- fp->_flags &= ~_IO_CURRENTLY_PUTTING;
- fp->_IO_read_ptr = fp->_IO_write_ptr;
- fp->_IO_write_ptr = fp->_IO_write_end;
- }
- if (fp->_IO_read_ptr < fp->_IO_read_end)
- return *fp->_IO_read_ptr;
- else
- return EOF;
-}
-
-/* The size of the valid part of the buffer. */
-
-_IO_ssize_t
-DEFUN(_IO_str_count, (fp),
- register _IO_FILE *fp)
-{
- return (fp->_IO_write_ptr > fp->_IO_read_end ? fp->_IO_write_ptr
- : fp->_IO_read_end)
- - fp->_IO_read_base;
-}
-
-_IO_pos_t
-DEFUN(_IO_str_seekoff, (fp, offset, dir, mode),
- register _IO_FILE *fp AND _IO_off_t offset AND int dir AND int mode)
-{
- _IO_ssize_t cur_size = _IO_str_count(fp);
- _IO_pos_t new_pos = EOF;
-
- /* Move the get pointer, if requested. */
- if (mode & _IOS_INPUT)
- {
- switch (dir)
- {
- case _IO_seek_end:
- offset += cur_size;
- break;
- case _IO_seek_cur:
- offset += fp->_IO_read_ptr - fp->_IO_read_base;
- break;
- default: /* case _IO_seek_set: */
- break;
- }
- if (offset < 0 || (_IO_size_t)offset > cur_size)
- return EOF;
- fp->_IO_read_ptr = fp->_IO_read_base + offset;
- fp->_IO_read_end = fp->_IO_read_base + cur_size;
- new_pos = offset;
- }
-
- /* Move the put pointer, if requested. */
- if (mode & _IOS_OUTPUT)
- {
- switch (dir)
- {
- case _IO_seek_end:
- offset += cur_size;
- break;
- case _IO_seek_cur:
- offset += fp->_IO_write_ptr - fp->_IO_write_base;
- break;
- default: /* case _IO_seek_set: */
- break;
- }
- if (offset < 0 || (_IO_size_t)offset > cur_size)
- return EOF;
- fp->_IO_write_ptr = fp->_IO_write_base + offset;
- new_pos = offset;
- }
- return new_pos;
-}
-
-int
-DEFUN(_IO_str_pbackfail, (fp, c),
- register _IO_FILE *fp AND int c)
-{
- if ((fp->_flags & _IO_NO_WRITES) && c != EOF)
- return EOF;
- return _IO_default_pbackfail(fp, c);
-}
-
-void
-DEFUN (_IO_str_finish, (fp),
- register _IO_FILE* fp)
-{
- if (fp->_IO_buf_base && !(fp->_flags & _IO_USER_BUF))
- (((_IO_strfile*)fp)->_s._free_buffer)(fp->_IO_buf_base);
- fp->_IO_buf_base = NULL;
-
- _IO_default_finish(fp);
-}
-
-struct _IO_jump_t _IO_str_jumps = {
- JUMP_INIT_DUMMY,
- JUMP_INIT(finish, _IO_str_finish),
- JUMP_INIT(overflow, _IO_str_overflow),
- JUMP_INIT(underflow, _IO_str_underflow),
- JUMP_INIT(uflow, _IO_default_uflow),
- JUMP_INIT(pbackfail, _IO_str_pbackfail),
- JUMP_INIT(xsputn, _IO_default_xsputn),
- JUMP_INIT(xsgetn, _IO_default_xsgetn),
- JUMP_INIT(seekoff, _IO_str_seekoff),
- JUMP_INIT(seekpos, _IO_default_seekpos),
- JUMP_INIT(setbuf, _IO_default_setbuf),
- JUMP_INIT(sync, _IO_default_sync),
- JUMP_INIT(doallocate, _IO_default_doallocate),
- JUMP_INIT(read, _IO_default_read),
- JUMP_INIT(write, _IO_default_write),
- JUMP_INIT(seek, _IO_default_seek),
- JUMP_INIT(close, _IO_default_close),
- JUMP_INIT(stat, _IO_default_stat)
-};
diff --git a/contrib/libg++/libio/strstream.cc b/contrib/libg++/libio/strstream.cc
deleted file mode 100644
index a32e811c9d94..000000000000
--- a/contrib/libg++/libio/strstream.cc
+++ /dev/null
@@ -1,116 +0,0 @@
-/* This is part of libio/iostream, providing -*- C++ -*- input/output.
-Copyright (C) 1993 Free Software Foundation
-
-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. */
-
-/* Written by Per Bothner (bothner@cygnus.com). */
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include "iostreamP.h"
-#include "strstream.h"
-#include <string.h>
-
-static void* default_alloc(_IO_size_t size)
-{
- return (void*)new char[size];
-}
-
-static void default_free(void* ptr)
-{
- delete [] (char*)ptr;
-}
-
-istrstream::istrstream(const char *cp, int n)
-{
- __my_sb.init_readonly (cp, n);
-}
-
-strstreambase::strstreambase(char *cp, int n, int mode)
-: __my_sb (cp, n,
- (mode == ios::app || mode == ios::ate) ? cp + strlen(cp) : cp)
-{
- init (&__my_sb);
-}
-
-char *strstreambuf::str()
-{
- freeze(1);
- return base();
-}
-
-_IO_ssize_t strstreambuf::pcount () { return _IO_write_ptr - _IO_write_base; }
-
-int strstreambuf::overflow(int c /* = EOF */)
-{
- return _IO_str_overflow (this, c);
-}
-
-int strstreambuf::underflow()
-{
- return _IO_str_underflow(this);
-}
-
-
-void strstreambuf::init_dynamic(_IO_alloc_type alloc, _IO_free_type free,
- int initial_size)
-
-{
- _s._allocate_buffer = alloc ? alloc : default_alloc;
- _s._free_buffer = free ? free : default_free;
- if (initial_size > 0)
- {
- char * buf = (char*)(*_s._allocate_buffer)(initial_size);
- setb(buf, buf + initial_size, 1);
- setp(buf, buf + initial_size);
- setg(buf, buf, buf);
- }
-}
-
-void strstreambuf::init_static(char *ptr, int size, char *pstart)
-{
- _IO_str_init_static (this, ptr, size, pstart);
-}
-
-void strstreambuf::init_readonly (const char *ptr, int size)
-{
- _IO_str_init_readonly (this, ptr, size);
-}
-
-strstreambuf::~strstreambuf()
-{
- if (_IO_buf_base && !(_flags & _IO_USER_BUF))
- (_s._free_buffer)(_IO_buf_base);
- _IO_buf_base = NULL;
-}
-
-streampos strstreambuf::seekoff(streamoff off, _seek_dir dir,
- int mode /*=ios::in|ios::out*/)
-{
- return _IO_str_seekoff (this, off, dir, mode);
-}
-
-int strstreambuf::pbackfail(int c)
-{
- return _IO_str_pbackfail (this, c);
-}
diff --git a/contrib/libg++/libio/strstream.h b/contrib/libg++/libio/strstream.h
deleted file mode 100644
index d549b4547588..000000000000
--- a/contrib/libg++/libio/strstream.h
+++ /dev/null
@@ -1,113 +0,0 @@
-/* This is part of libio/iostream, providing -*- C++ -*- input/output.
-Copyright (C) 1993 Free Software Foundation
-
-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. */
-
-/* Written by Per Bothner (bothner@cygnus.com). */
-
-#ifndef __STRSTREAM_H
-#define __STRSTREAM_H
-#ifdef __GNUG__
-#pragma interface
-#endif
-#include <iostream.h>
-#include <strfile.h>
-
-extern "C++" {
-class strstreambuf : public streambuf
-{
- struct _IO_str_fields _s;
- friend class istrstream;
-
- void init_dynamic(_IO_alloc_type alloc, _IO_free_type free,
- int initial_size = 0);
- void init_static(char *ptr, int size, char *pstart);
- void init_readonly(const char *ptr, int size);
- protected:
- virtual int overflow(int = EOF);
- virtual int underflow();
- virtual int pbackfail(int c);
- public:
- virtual ~strstreambuf();
- strstreambuf() { init_dynamic(0, 0); }
- strstreambuf(int initial_size) { init_dynamic(0, 0, initial_size); }
- strstreambuf(void *(*alloc)(_IO_size_t), void (*free)(void*))
- { init_dynamic(alloc, free); }
- strstreambuf(char *ptr, int size, char *pstart = NULL)
- { init_static(ptr, size, pstart); }
- strstreambuf(unsigned char *ptr, int size, unsigned char *pstart = NULL)
- { init_static((char*)ptr, size, (char*)pstart); }
- strstreambuf(const char *ptr, int size)
- { init_readonly(ptr, size); }
- strstreambuf(const unsigned char *ptr, int size)
- { init_readonly((const char*)ptr, size); }
- strstreambuf(signed char *ptr, int size, signed char *pstart = NULL)
- { init_static((char*)ptr, size, (char*)pstart); }
- strstreambuf(const signed char *ptr, int size)
- { init_readonly((const char*)ptr, size); }
- // Note: frozen() is always true if !_IO_STR_DYNAMIC(this).
- int frozen() { return _flags & _IO_USER_BUF ? 1 : 0; }
- void freeze(int n=1)
- { if (_IO_STR_DYNAMIC(this))
- { if (n) _flags |= _IO_USER_BUF; else _flags &= ~_IO_USER_BUF; } }
- _IO_ssize_t pcount();
- char *str();
- virtual streampos seekoff(streamoff, _seek_dir, int mode=ios::in|ios::out);
-};
-
-class strstreambase : virtual public ios {
- protected:
- strstreambuf __my_sb;
- public:
- strstreambuf* rdbuf() { return &__my_sb; }
- protected:
- strstreambase() { init (&__my_sb); }
- strstreambase(char *cp, int n, int mode=ios::out);
-};
-
-class istrstream : public strstreambase, public istream {
- public:
- istrstream(const char*, int=0);
-};
-
-class ostrstream : public strstreambase, public ostream {
- public:
- ostrstream() { }
- ostrstream(char *cp, int n, int mode=ios::out) :strstreambase(cp,n,mode){}
- _IO_ssize_t pcount() { return ((strstreambuf*)_strbuf)->pcount(); }
- char *str() { return ((strstreambuf*)_strbuf)->str(); }
- void freeze(int n = 1) { ((strstreambuf*)_strbuf)->freeze(n); }
- int frozen() { return ((strstreambuf*)_strbuf)->frozen(); }
-};
-
-class strstream : public strstreambase, public iostream {
- public:
- strstream() { }
- strstream(char *cp, int n, int mode=ios::out) :strstreambase(cp,n,mode){}
- _IO_ssize_t pcount() { return ((strstreambuf*)_strbuf)->pcount(); }
- char *str() { return ((strstreambuf*)_strbuf)->str(); }
- void freeze(int n = 1) { ((strstreambuf*)_strbuf)->freeze(n); }
- int frozen() { return ((strstreambuf*)_strbuf)->frozen(); }
-};
-} // extern "C++"
-
-#endif /*!__STRSTREAM_H*/
diff --git a/contrib/libg++/libio/tests/ChangeLog b/contrib/libg++/libio/tests/ChangeLog
deleted file mode 100644
index bfd607b2ae26..000000000000
--- a/contrib/libg++/libio/tests/ChangeLog
+++ /dev/null
@@ -1,111 +0,0 @@
-Wed Apr 10 17:15:47 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * Makefile.in (IOLIBS): Link with libstdc++.
-
-Tue Mar 12 11:45:14 1996 Per Bothner <bothner@kalessin.cygnus.com>
-
- * tiomisc.cc (test_read_write_flush): New test for read/write/seek
- on block end. From Luke Blanshard <luke@cs.wisc.edu>.
-
-Thu Jul 6 17:51:30 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * tiomisc.cc (getline_test3): New function. Test reading long lines.
- * tiomisc.exp: Update for output from getline_test3.
-
-Wed May 10 03:06:51 1995 Jason Merrill <jason@python.cygnus.com>
-
- * configure.in (X*INCLUDES): Renamed.
-
-Thu Apr 27 21:05:00 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * tiomisc.cc (test_destroy), tiomisc.exp: Add support for
- _IO_NEW_STREAMS.
-
-Tue Apr 25 15:15:01 1995 Jim Wilson <wilson@chestnut.cygnus.com>
-
- * tstdiomisc.c (t2): Use N not n in last SCAN macro call.
-
-Sun Feb 12 21:23:24 1995 Brendan Kehoe (brendan@lisa.cygnus.com)
-
- * Makefile.in (JUNK_TO_CLEAN): Also delete foo.dat from tiomisc.
-
-Sat Nov 5 14:37:36 1994 Per Bothner <bothner@kalessin.cygnus.com>
-
- * tiomisc.cc (test_destroy): New test case from Jason Merrill.
- * tiomisc.exp: Update.
-
- * Makefile.in (JUNK_TO_CLEAN): Add tstdiomisc.
-
-Thu Oct 13 16:47:30 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * tiomisc.cc (reread_test): Remove bogus istream assignment.
-
-Wed Aug 31 13:59:56 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * Makefile.in (CXX_FLAGS): Not used. Removed.
-
-Wed Aug 17 18:27:37 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * tiomisc.cc (getline_test1, getline_test2, flush1_test): New tests,
- * tiomisc.cc (reread_test): New tests,
-
-Wed Jun 22 13:44:19 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * tstdiomisc.c: Add some sscanf tests.
- * Makefile.in (check-tstdiomisc): Run diff with expected output.
- * tstdiomisc.exp: New file. Expected output from tstdiomisc.
- * Makefile.in (foo): New rule, for quick one-off tests.
-
-Fri May 6 14:10:24 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * tFile.cc (t7): Revert Mar 4 change - I was confused.
-
-Sat Apr 2 04:41:41 1994 Andreas Schwab (schwab@issan.informatik.uni-dortmund.de)
-
- * Makefile.in (tfformat): Fix dependency.
-
-Fri Mar 4 17:40:14 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * tFile.cc (t7): gcount after getline shouldn't include delimiter.
- * tFile.cc (show_int, t12), tFile.exp: More integer formatting tests.
-
-Tue Feb 8 18:39:09 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * tiomisc.cc, tiomisc.exp: New test case (for filebuf::attach)
- from Joe Buck.
-
-Mon Jan 31 13:24:58 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * tfformat.c (main): Fix fprintf format string (%s -> %d).
- Bug reported by Jochen Voss <voss@mathematik.uni-kl.de>.
-
-Sun Dec 19 15:29:00 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * tstdiomisc.c, Makefile.in: New tests.
-
-Thu Dec 2 22:56:21 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * Makefile.in (JUNK_TO_CLEAN), configure.in (MOSTLYCLEAN):
- Added, to cleanup after tests.
-
-Fri Nov 26 16:05:43 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * tiomisc.cc, tiomisc.exp: A (hopefully growing) collection
- of small, random tests (mainly regression tests).
- * tiomisc.cc (test1 and test2): Tests from Wilco van Hoogstraeten
- <wilco@erasmus.et.tudelft.nl> to check for (now-fixed) bugs.
-
-Mon Oct 4 17:38:27 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * Makefile.in (IOSTDIOLIB): New macro.
-
-Fri Aug 27 12:22:10 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * tFile.cc (t7): Add test for buffer overflow.
-
-Fri Aug 20 00:23:53 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- Moved various tests over from old libg++/iostream/test.
- * Makefile.in: Edit appropriately.
-
-
diff --git a/contrib/libg++/libio/tests/Makefile.in b/contrib/libg++/libio/tests/Makefile.in
deleted file mode 100644
index 230ab6834839..000000000000
--- a/contrib/libg++/libio/tests/Makefile.in
+++ /dev/null
@@ -1,195 +0,0 @@
-# Copyright (C) 1993 Free Software Foundation
-#
-# 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 GNU CC; see the file COPYING. If not, write to
-# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
-
-srcdir = .
-
-CFLAGS = -g
-C_FLAGS = $(CFLAGS) -I. -I.. -I$(srcdir) -I$(srcdir)/..
-CXXFLAGS = -g
-CC = gcc
-CXX = gcc
-
-#### package, host, target, and site dependent Makefile fragments come in here.
-##
-
-STDIO_LD_FLAGS = -u __cleanup
-
-#LIBS = ../../libg++.a
-
-#LIBSTDIO = ../stdio/libstdio++.a
-#LIBIO = ../libio.a
-
-#STDIOLIBS = $(STDIO_LD_FLAGS) $(LIBSTDIO) $(LIBIO) $(LIBS)
-STDIOLIBS = $(LIBSTDIO) $(LIBIO) $(LIBS)
-IOLIBS = -L../../libstdc++ -lstdc++
-IOSTDIOLIB = ../libio.a ../../libiberty/libiberty.a
-
-DEPEND_SOURCES = $(srcdir)/*.C
-
-.PHONY: check check-iostream check-stdio
-check: check-iostream check-iostdio
-
-
-# These are tests written in C++, that test the iostream facility.
-check-iostream: check-tFile check-tiomisc \
- check-hounddog check-putbackdog check-tiomanip
-
-# These are tests written in C, that don't need C++.
-# They test libio's emulation of stdio.
-check-iostdio: check-tiformat check-tfformat check-tstdiomisc
-
-# check-stdio runs test programs that use stdio.
-# These aren't run by default because there may be linker tricks needed
-# to build them (if libc.a contains a competing stdio implementation).
-
-check-stdio: check-tfseek check-twrseek check-trdseek check-tpopen
-
-# See ${MOSTLYCLEAN} in configure.in
-JUNK_TO_CLEAN = tFile tiomisc hounddog putbackdog tiomanip \
- t?format *.out streamfile ftmp* tstdiomisc foo.dat
-
-.PHONY: info
-info:
-.PHONY: clean-info
-clean-info:
-.PHONY: install-info
-install-info:
-
-tst: tst.o
- gcc -v -o tst tst.o $(STDIOLIBS)
-
-tgetl: tgetl.o
- $(CXX) -o tgetl tgetl.o $(IOLIBS)
-
-tFile: tFile.o
- $(CXX) -o tFile tFile.o $(IOLIBS)
-
-tiomisc: tiomisc.o
- $(CXX) -o tiomisc tiomisc.o $(IOLIBS)
-
-hounddog: hounddog.o
- $(CXX) -o hounddog hounddog.o $(IOLIBS)
-
-check-hounddog: hounddog
- ./hounddog <$(srcdir)/hounddog.inp > hounddog.out 2>&1
- diff -c hounddog.out $(srcdir)/hounddog.exp
- ./hounddog -b0 <$(srcdir)/hounddog.inp > hound-b0.out 2>&1
- diff -c hound-b0.out $(srcdir)/hounddog.exp
- ./hounddog -b2 <$(srcdir)/hounddog.inp > hound-b2.out 2>&1
- diff -c hound-b2.out $(srcdir)/hounddog.exp
-
-putbackdog: putbackdog.o
- $(CXX) -o putbackdog putbackdog.o $(IOLIBS)
-
-check-putbackdog-regular: putbackdog
- ./putbackdog <$(srcdir)/hounddog.inp > putback.out 2>&1
- diff -c putback.out $(srcdir)/hounddog.exp
-check-putbackdog-nobuf: putbackdog
- ./putbackdog -b0 <$(srcdir)/hounddog.inp > putback-b0.out 2>&1
- diff -c putback-b0.out $(srcdir)/hounddog.exp
-check-putbackdog-buf2: putbackdog
- ./putbackdog -b2 <$(srcdir)/hounddog.inp > putback-b2.out 2>&1
- diff -c putback-b2.out $(srcdir)/hounddog.exp
-check-putbackdog: \
- check-putbackdog-regular check-putbackdog-nobuf check-putbackdog-buf2
-
-tfseek: tfseek.o
- $(CC) -o tfseek tfseek.o $(STDIOLIBS)
-
-check-tfseek: tfseek
- ./tfseek SEEK_SET fopen > tfseek-set-fopen.out 2>&1
- diff -c tfseek-set-fopen.out $(srcdir)/tfseek-set.exp
- ./tfseek SEEK_SET freopen > tfseek-set-freopen.out 2>&1
- diff -c tfseek-set-freopen.out $(srcdir)/tfseek-set.exp
- ./tfseek SEEK_CUR fopen > tfseek-cur-fopen.out 2>&1
- diff -c tfseek-cur-fopen.out $(srcdir)/tfseek-cur.exp
- ./tfseek SEEK_CUR freopen > tfseek-cur-freopen.out 2>&1
- diff -c tfseek-cur-freopen.out $(srcdir)/tfseek-cur.exp
-
-twrseek: twrseek.o
- $(CC) -o twrseek twrseek.o $(STDIOLIBS)
-
-check-twrseek: twrseek
- ./twrseek > twrseek.out 2>&1
- diff -c twrseek.out $(srcdir)/twrseek.exp
-
-trdseek: trdseek.o
- $(CC) -o trdseek -v trdseek.o $(STDIOLIBS)
-
-check-trdseek: trdseek
- ./trdseek
-
-check-tFile-regular: tFile
- ./tFile < $(srcdir)/tFile.inp > tFile.out 2>&1
- diff -c tFile.out $(srcdir)/tFile.exp
-# Run tFile with cout.rdbuf() unbuffered.
-check-tFile-nobuf: tFile
- ./tFile -b0 < $(srcdir)/tFile.inp > tFile-buf0.out 2>&1
- diff -c tFile-buf0.out $(srcdir)/tFile.exp
-# Run tFile with a 3-byte buffer for cout.rdbuf().
-check-tFile-buf3: tFile
- ./tFile -b3 < $(srcdir)/tFile.inp > tFile-buf3.out 2>&1
- diff -c tFile-buf3.out $(srcdir)/tFile.exp
-check-tFile: check-tFile-regular check-tFile-nobuf check-tFile-buf3
-
-check-tiomisc: tiomisc
- ./tiomisc >tiomisc.out 2>&1
- diff -c tiomisc.out $(srcdir)/tiomisc.exp
-
-tiomanip: tiomanip.o
- $(CXX) -o tiomanip tiomanip.o $(IOLIBS)
-check-tiomanip: tiomanip
- ./tiomanip >tiomanip.out 2>&1
- diff -c tiomanip.out $(srcdir)/tiomanip.exp
-
-tfformat: $(srcdir)/tfformat.c
- $(CC) $(C_FLAGS) -DTEST_LIBIO -DTEST_EXACTNESS \
- -o tfformat $(srcdir)/tfformat.c $(IOSTDIOLIB)
-
-check-tfformat: tfformat
- ./tfformat
-
-tiformat: $(srcdir)/tiformat.c
- $(CC) $(C_FLAGS) -DTEST_LIBIO -o tiformat $(srcdir)/tiformat.c $(IOSTDIOLIB)
-
-check-tiformat: tiformat
- ./tiformat
-
-tstdiomisc: tstdiomisc.o
- $(CC) -o tstdiomisc tstdiomisc.o $(IOSTDIOLIB)
-
-check-tstdiomisc: tstdiomisc
- ./tstdiomisc >tstdiomisc.out 2>&1
- diff -c tstdiomisc.out $(srcdir)/tstdiomisc.exp
-
-tpopen: tpopen.o
- $(CC) -o tpopen tpopen.o $(STDIOLIBS)
-
-check-tpopen: tpopen
- ./tpopen > tpopen.out 2>&1
- diff -c tpopen.out $(srcdir)/tpopen.exp
-
-trwseek: trwseek.o
- $(CC) -o trwseek trwseek.o $(STDIOLIBS)
-
-check-trwseek: trwseek
- ./trwsseek TMP r+ k w o
-
-foo: foo.o
- $(CXX) -o foo foo.o $(STDIOLIBS)
-foo+: foo+.o
- $(CXX) -o foo+ foo+.o $(IOLIBS)
diff --git a/contrib/libg++/libio/tests/configure.in b/contrib/libg++/libio/tests/configure.in
deleted file mode 100644
index f832adfb2363..000000000000
--- a/contrib/libg++/libio/tests/configure.in
+++ /dev/null
@@ -1,21 +0,0 @@
-# This file is a shell script fragment that supplies the information
-# necessary for a configure script to process the program in
-# this directory. For more information, look at ../../configure.
-
-configdirs=
-srctrigger=tFile.cc
-srcname="test C++ input/output library"
-package_makefile_frag=Make.pack
-
-# per-host:
-
-# per-target:
-
-TO_TOPDIR=../../
-ALL=' '
-XCINCLUDES='-I. -I.. -I$(srcdir) -I$(srcdir)/..'
-XCXXINCLUDES='-I. -I.. -I$(srcdir) -I$(srcdir)/..'
-MOSTLYCLEAN='*.o core $(JUNK_TO_CLEAN)'
-(. ${srcdir}/../config.shared) >${package_makefile_frag}
-
-# post-target:
diff --git a/contrib/libg++/libio/tests/hounddog.cc b/contrib/libg++/libio/tests/hounddog.cc
deleted file mode 100644
index 29a923836476..000000000000
--- a/contrib/libg++/libio/tests/hounddog.cc
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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 <iostream.h>
-#include <stdlib.h>
-#include <string.h>
-
-// Read either "dog", "hound", or "hounddog".
-// If "dog" is found, return 1.
-// If "hound" is found, return 2.
-// If "hounddog" is found, return 3.
-// If non of these are found, return -1.
-int my_scan(streambuf* sb)
-{
- streammarker fence(sb);
- char buffer[20];
- // Try reading "hounddog":
- if (sb->sgetn(buffer, 8) == 8 && strncmp(buffer, "hounddog", 8) == 0)
- return 3;
- // No, no "hounddog": Backup to 'fence' ...
- sb->seekmark(fence);
- // ... and try reading "dog":
- if (sb->sgetn(buffer, 3) == 3 && strncmp(buffer, "dog", 3) == 0)
- return 1;
- // No, no "dog" either: Backup to 'fence' ...
- sb->seekmark(fence);
- // ... and try reading "hound":
- if (sb->sgetn(buffer, 5) == 5 && strncmp(buffer, "hound", 5) == 0)
- return 2;
- // No, no "hound" either: Backup to 'fence' and signal failure.
- sb->seekmark(fence); // Backup to 'fence'..
- return -1;
-}
-
-int main(int argc, char **argv)
-{
- streambuf *sb = cin.rdbuf();
- if (argc > 1 && strncmp(argv[1], "-b", 2) == 0) {
- streambuf *ret;
- int buffer_size = atoi(&argv[1][2]);
- if (buffer_size == 0)
- ret = sb->setbuf(NULL, 0);
- else
- ret = sb->setbuf(new char[buffer_size], buffer_size);
- if (ret != sb)
- cerr << "Warning: cin.rdbuf()->setbuf failed!\n";
- }
- for (;;) {
- int code = my_scan(sb);
- int ch = sb->sbumpc();
- if (code == -1 && ch == EOF)
- break;
- int n = 0;
- while (ch != EOF && ch != '\n') {
- n++;
- ch = sb->sbumpc();
- };
- if (ch == EOF) {
- cout << "[Unexpected EOF]\n";
- break;
- }
- cout << "Code: " << code << " followed by " << n << " chars\n";
- }
-}
diff --git a/contrib/libg++/libio/tests/hounddog.exp b/contrib/libg++/libio/tests/hounddog.exp
deleted file mode 100644
index 2060807b4312..000000000000
--- a/contrib/libg++/libio/tests/hounddog.exp
+++ /dev/null
@@ -1,7 +0,0 @@
-Code: -1 followed by 6 chars
-Code: 1 followed by 3 chars
-Code: 2 followed by 0 chars
-Code: -1 followed by 3 chars
-Code: 3 followed by 4 chars
-Code: 1 followed by 0 chars
-Code: -1 followed by 3 chars
diff --git a/contrib/libg++/libio/tests/hounddog.inp b/contrib/libg++/libio/tests/hounddog.inp
deleted file mode 100644
index 370371bc2032..000000000000
--- a/contrib/libg++/libio/tests/hounddog.inp
+++ /dev/null
@@ -1,7 +0,0 @@
-hello!
-doggie
-hound
-cat
-hounddog rat
-dog
-foo
diff --git a/contrib/libg++/libio/tests/putbackdog.cc b/contrib/libg++/libio/tests/putbackdog.cc
deleted file mode 100644
index 0e1ed61f5598..000000000000
--- a/contrib/libg++/libio/tests/putbackdog.cc
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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. */
-
-// Test streambuf::sputbackc
-
-#include <iostream.h>
-#include <stdlib.h>
-#include <string.h>
-
-// Read either "dog", "hound", or "hounddog".
-// If "dog" is found, return 1.
-// If "hound" is found, return 2.
-// If "hounddog" is found, return 3.
-// If non of these are found, return -1.
-
-void unget_string(streambuf *sb, char *str, int count)
-{
- for (str += count; -- count >= 0; )
- sb->sputbackc(*--str);
-}
-
-int my_scan(streambuf* sb)
-{
- char buffer[20];
- // Try reading "hounddog":
- int count;
- count = sb->sgetn(buffer, 8);
- if (count == 8 && strncmp(buffer, "hounddog", 8) == 0)
- return 3;
- // No, no "hounddog": Backup to 'fence' ...
- unget_string(sb, buffer, count);
- // ... and try reading "dog":
- count = sb->sgetn(buffer, 3);
- if (count == 3 && strncmp(buffer, "dog", 3) == 0)
- return 1;
- // No, no "dog" either: Backup to 'fence' ...
- unget_string(sb, buffer, count);
- // ... and try reading "hound":
- count = sb->sgetn(buffer, 5);
- if (count == 5 && strncmp(buffer, "hound", 5) == 0)
- return 2;
- // No, no "hound" either: Backup to 'fence' and signal failure.
- unget_string(sb, buffer, count);
- return -1;
-}
-
-int main(int argc, char **argv)
-{
- streambuf *sb = cin.rdbuf();
- if (argc > 1 && strncmp(argv[1], "-b", 2) == 0) {
- streambuf *ret;
- int buffer_size = atoi(&argv[1][2]);
- if (buffer_size == 0)
- ret = sb->setbuf(NULL, 0);
- else
- ret = sb->setbuf(new char[buffer_size], buffer_size);
- if (ret != sb)
- cerr << "Warning: cin.rdbuf()->setbuf failed!\n";
- }
- for (;;) {
- int code = my_scan(sb);
- int ch = sb->sbumpc();
- if (code == -1 && ch == EOF)
- break;
- int n = 0;
- while (ch != EOF && ch != '\n') {
- n++;
- ch = sb->sbumpc();
- };
- if (ch == EOF) {
- cout << "[Unexpected EOF]\n";
- break;
- }
- cout << "Code: " << code << " followed by " << n << " chars\n";
- }
-}
diff --git a/contrib/libg++/libio/tests/tFile.cc b/contrib/libg++/libio/tests/tFile.cc
deleted file mode 100644
index d8a1ee301fa6..000000000000
--- a/contrib/libg++/libio/tests/tFile.cc
+++ /dev/null
@@ -1,550 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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. */
-
-// This may look like C code, but it is really -*- C++ -*-
-
-/*
- * a few tests for streams
- *
- */
-
-#include <stream.h>
-#include <fstream.h>
-#ifndef _OLD_STREAMS
-#include <strstream.h>
-#include "unistd.h"
-#endif
-#include <SFile.h>
-#include <PlotFile.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-
-class record
-{
-public:
- char c; int i; double d;
-};
-
-ostream& operator<<(ostream& s, record& r)
-{
- return(s << "(i = " << r.i << " c = " << r.c << " d = " << r.d << ")");
-}
-
-void t1()
-{
- char ch;
-
- assert(cout.good());
- assert(cout.writable());
- assert(cout.is_open());
- cout << "Hello, world via cout\n";
- assert(cerr.good());
- assert(cerr.writable());
- assert(cerr.is_open());
- cerr << "Hello, world via cerr\n";
-
- assert(cin.good());
- assert(cin.readable());
- assert(cin.is_open());
-
- cout << "enter a char:"; cin >> ch;
- cout.put('c'); cout.put(' '); cout.put('='); cout.put(' ');
- cout.put('"'); cout.put(ch); cout << '"'; cout << char('\n');
- assert(cin.good());
- assert(cout.good());
-}
-
-void t2()
-{
- int i;
- short h;
- long l;
- float f;
- double d;
- char s[100];
-
- cout << "enter three integers (short, int, long):";
- cin >> h; cin >> i;
- // cin.scan("%ld", &l);
- cin >> l;
- cout << "first = " << h << " via dec = " << dec(h, 8) << "\n";
- cout << "second = " << i << form(" via form = %d = 0%o", i, i);
- cout.form(" via cout.form = %d = 0x%x\n", i, i);
- cout << "third = " << l << " via hex = " << hex(l) << "\n";
- assert(cin.good());
- assert(cout.good());
-
- cout << "enter a float then a double:"; cin >> f; cin >> d;
- cout << "first = " << f << "\n";
- cout << "second = " << d << "\n";
- assert(cin.good());
- assert(cout.good());
-
- cout << "enter 5 characters separated with spaces:"; cin >> s;
- cout << "first = " << s << "\n";
- cin.get(s, 100);
- cout << "rest = " << s << "\n";
-
- assert(cin.good());
-
- cin.width(10);
- cin >> s;
- cin.clear();
- cout << "A 10-character buffer: " << s << endl;
-
- assert(cout.good());
-
-}
-
-void t3()
-{
- char ch;
- cout << "\nMaking streams sout and sin...";
-#ifdef _OLD_STREAMS
- ostream sout("streamfile", io_writeonly, a_create);
-#else
- ofstream sout("streamfile");
-#endif
- assert(sout.good());
- assert(sout.is_open());
- assert(sout.writable());
- assert(!sout.readable());
- sout << "This file has one line testing output streams.\n";
- sout.close();
- assert(!sout.is_open());
-#ifdef _OLD_STREAMS
- istream sin("streamfile", io_readonly, a_useonly);
-#else
- ifstream sin("streamfile");
-#endif
- assert(sin.good());
- assert(sin.is_open());
- assert(!sin.writable());
- assert(sin.readable());
- cout << "contents of file:\n";
- while(sin >> ch) cout << ch;
- sin.close();
- assert(!sin.is_open());
-}
-
-
-void t4()
-{
- char s[100];
- char ch;
- int i;
-
- cout << "\nMaking File tf ... ";
-#ifdef _OLD_STREAMS
- File tf("tempfile", io_readwrite, a_create);
-#else
- fstream tf("tempfile", ios::in|ios::out|ios::trunc);
-#endif
- assert(tf.good());
- assert(tf.is_open());
- assert(tf.writable());
- assert(tf.readable());
- strcpy(s, "This is the first and only line of this file.\n");
-#ifdef _OLD_STREAMS
- tf.put(s);
- tf.seek(0);
-#else
- tf << s;
- tf.rdbuf()->seekoff(0, ios::beg);
-#endif
- tf.get(s, 100);
- assert(tf.good());
- cout << "first line of file:\n" << s << "\n";
- cout << "next char = ";
- tf.get(ch);
- cout << (int)ch;
- cout.put('\n');
- assert(ch == 10);
- strcpy(s, "Now there is a second line.\n");
- cout << "reopening tempfile, appending: " << s;
-#ifdef _OLD_STREAMS
- tf.open(tf.name(), io_appendonly, a_use);
-#else
- tf.close();
- tf.open("tempfile", ios::app);
-#endif
- assert(tf.good());
- assert(tf.is_open());
- assert(tf.writable());
- assert(!tf.readable());
-#ifdef _OLD_STREAMS
- tf.put(s);
- assert(tf.good());
- tf.open(tf.name(), io_readonly, a_use);
-#else
- tf << s;
- assert(tf.good());
- tf.close();
- tf.open("tempfile", ios::in);
-#endif
- tf.raw();
- assert(tf.good());
- assert(tf.is_open());
- assert(!tf.writable());
- assert(tf.readable());
- cout << "First 10 chars via raw system read after reopen for input:\n";
- read(tf.filedesc(), s, 10);
- assert(tf.good());
- for (i = 0; i < 10; ++ i)
- cout.put(s[i]);
- lseek(tf.filedesc(), 5, 0);
- cout << "\nContents after raw lseek to pos 5:\n";
- while ( (tf.get(ch)) && (cout.put(ch)) );
-#ifdef _OLD_STREAMS
- tf.remove();
-#else
- tf.close();
- unlink("tempfile");
-#endif
- assert(!tf.is_open());
-}
-
-void t5()
-{
- record r;
- int i;
- cout << "\nMaking SFile rf...";
-#ifdef _OLD_STREAMS
- SFile rf("recfile", sizeof(record), io_readwrite, a_create);
-#else
- SFile rf("recfile", sizeof(record), ios::in|ios::out|ios::trunc);
-#endif
- assert(rf.good());
- assert(rf.is_open());
- assert(rf.writable());
- assert(rf.readable());
- for (i = 0; i < 10; ++i)
- {
- r.c = i + 'a';
- r.i = i;
- r.d = (double)(i) / 1000.0;
- rf.put(&r);
- }
- assert(rf.good());
- cout << "odd elements of file in reverse order:\n";
- for (i = 9; i >= 0; i -= 2)
- {
- rf[i].get(&r);
- assert(r.c == i + 'a');
- assert(r.i == i);
- cout << r << "\n";
- }
- assert(rf.good());
-#ifdef _OLD_STREAMS
- rf.remove();
-#else
- rf.close();
- unlink("recfile");
-#endif
- assert(!rf.is_open());
-}
-
-void t6()
-{
- cout << "\nMaking PlotFile pf ...";
- static const char plot_name[] = "plot.out";
- PlotFile pf(plot_name);
- assert(pf.good());
- assert(pf.is_open());
- assert(pf.writable());
- assert(!pf.readable());
- pf.move(10,10);
- pf.label("Test");
- pf.circle(300,300,200);
- pf.line(100, 100, 500, 500);
- assert(pf.good());
-#ifdef _OLD_STREAMS
- cout << "(You may delete or attempt to plot " << pf.name() << ")\n";
-#else
- cout << "(You may delete or attempt to plot " << plot_name << ")\n";
-#endif
-}
-
-void t7()
-{
- char ch;
- static char t7_line1[] = "This is a string-based stream.\n";
- static char t7_line2[] = "With two lines.\n";
- char mybuf[60];
- char *bufp;
-#ifdef _OLD_STREAMS
- cout << "creating string-based ostream...\n";
- ostream strout(60, mybuf);
-#else
- cout << "creating ostrstream...\n";
- ostrstream strout(mybuf, 60);
-#endif
- assert(strout.good());
- assert(strout.writable());
- strout << t7_line1 << t7_line2 << ends;
- assert(strout.good());
- cout << "with contents:\n";
- bufp = strout.str();
- assert(bufp == mybuf);
- strout.rdbuf()->freeze(0); /* Should be a no-op */
- cout << mybuf;
-#ifdef _OLD_STREAMS
- cout << "using it to create string-based istream...\n";
- istream strin(strlen(mybuf), mybuf);
-#else
- cout << "using it to create istrstream...\n";
- istrstream strin(mybuf, strlen(mybuf));
-#endif
- assert(strin.good());
- assert(strin.readable());
- cout << "with contents:\n";
-#ifndef _OLD_STREAMS
- char line[100];
- strin.getline(line, 100);
- int line1_len = strlen(t7_line1);
- assert(strin.tellg() == line1_len);
- int line_len = strin.gcount();
- assert(line_len == line1_len);
- cout.write(line, line1_len - 1);
- cout << endl;
-#endif
- while (strin.get(ch)) cout.put(ch);
-
- strstream str1;
- strstream str2;
- str1 << "Testing string-based stream using strstream.\n";
- str1.seekg(0);
- for (;;) {
- int i = str1.get();
- if (i == EOF)
- break;
- str2 << (char)i;
- }
- str2 << ends;
- cout << str2.str();
-
- // This should make it overflow.
- strout << t7_line1;
- assert (strout.bad());
-}
-
-void t8()
-{
-#ifdef _OLD_STREAMS
- cout << "\nThe following file open should generate error message:";
- cout.flush();
- File ef("shouldnotexist", io_readonly, a_useonly);
-#else
- ifstream ef("shouldnotexist");
-#endif
- assert(!ef.good());
- assert(!ef.is_open());
-}
-
-void t9()
-{
- char ch;
- static char ffile_name[] = "ftmp";
- {
- cout << "\nMaking filebuf streams fout and fin...";
- filebuf foutbuf;
-#ifdef _OLD_STREAMS
- foutbuf.open(ffile_name, output);
-#else
- foutbuf.open(ffile_name, ios::out);
-#endif
- ostream fout(&foutbuf);
- assert(fout.good());
- assert(fout.is_open());
- assert(fout.writable());
- assert(!fout.readable());
- fout << "This file has one line testing output streams.\n";
-#ifdef _OLD_STREAMS
- fout.close();
- assert(!fout.is_open());
-#endif
- }
- filebuf finbuf;
-#ifdef _OLD_STREAMS
- finbuf.open(ffile_name, input);
-#else
- finbuf.open(ffile_name, ios::in);
-#endif
- istream fin(&finbuf);
- assert(fin.good());
- assert(fin.is_open());
- assert(!fin.writable());
- assert(fin.readable());
- cout << "contents of file:\n";
- while(fin >> ch) cout << ch;
-#ifndef _OLD_STREAMS
- cout << '\n';
-#endif
- fin.close();
- assert(!fin.is_open());
-}
-
-void t10()
-{
- int fileCnt = 3;
- char *file_name_pattern = "ftmp%d";
- char current_file_name[50];
- ifstream inFile;
- ofstream outFile;
- char c;
- int i;
-
- cout << '\n';
-
- // Write some files.
- for (i=0; i < fileCnt; i++) {
- sprintf(current_file_name, file_name_pattern, i);
- outFile.open(current_file_name, ios::out);
-
- if ( outFile.fail() )
- cerr << "File " << current_file_name
- << " can't be opened for output" << endl;
- else {
- outFile << "This is line 1 of " << current_file_name << '\n';
- outFile << "This is line 2 of " << current_file_name << endl;
- outFile.close();
- }
- }
-
- // Now read the files back in, and write then out to cout.
- for (i=0; i < fileCnt; i++) {
- sprintf(current_file_name, file_name_pattern, i);
- inFile.open(current_file_name, ios::in);
-
-
- if ( inFile.fail() )
- cerr << "File " << current_file_name
- << " can't be opened for input" << endl;
- else {
- while ( inFile.get (c))
- cout << c;
- cout << endl;
- inFile.close();
- }
- }
-}
-
-// Test form
-
-void t11()
-{
- int count1, count2;
- cout.form("%.2f+%.2f = %4.3e\n%n", 5.5, 6.25, 5.5+6.25, &count1);
- char *text = "Previous line has12345";
- char text_length_to_use = strlen(text) - 5;
- count2 = cout.rdbuf()->form("%-*.*s%3g characters\n",
- text_length_to_use + 1,
- text_length_to_use,
- text,
- (double)(count1-1));
- cout.form("%-*.*s%+d characters\n%n",
- text_length_to_use + 1, text_length_to_use, text,
- count2-1, &count1);
- assert(count1 == 33);
-}
-
-static void
-show_int (long val)
-{
- cout.setf(ios::showbase);
- cout << dec; cout.width (8); cout << val << "(dec) = ";
- cout << hex; cout.width (8); cout << (0xFFFF & val) << "(hex) = ";
- cout << oct; cout.width (8);
- cout << (0xFFFF & val) << "(oct) [showbase on]\n";
- cout.unsetf(ios::showbase);
- cout << dec; cout.width (8); cout << val << "(dec) = ";
- cout << hex; cout.width (8); cout << (0xFFFF & val) << "(hex) = ";
- cout << oct; cout.width (8);
- cout << (0xFFFF & val) << "(oct) [showbase off]\n";
-}
-
-void
-t12 ()
-{
- ios::fmtflags old_flags = cout.setf(ios::showpos);
- int fill = cout.fill('_');
- cout.unsetf(ios::uppercase);
- cout.setf(ios::internal, ios::adjustfield);
- show_int(34567);
- show_int(-34567);
- cout.setf(ios::right, ios::adjustfield);
- show_int(0);
- cout.setf(ios::uppercase);
- cout.unsetf(ios::showpos);
- show_int(34567);
- cout.setf(ios::left, ios::adjustfield);
- show_int(-34567);
- cout.fill(fill);
- show_int(0);
- cout.setf(old_flags,
- ios::adjustfield|ios::basefield
- |ios::showbase|ios::showpos|ios::uppercase);
-}
-
-main(int argc, char **argv)
-{
- if (argc > 1 && strncmp(argv[1], "-b", 2) == 0) {
- streambuf *sb = cout.rdbuf();
- streambuf *ret;
- int buffer_size = atoi(&argv[1][2]);
- if (buffer_size == 0)
- ret = sb->setbuf(NULL, 0);
- else
- ret = sb->setbuf(new char[buffer_size], buffer_size);
- if (ret != sb)
- cerr << "Warning: cout.rdbuf()->setbuf failed!\n";
- }
- t1();
- t2();
- t3();
- t4();
- t5();
- t6();
- t7();
- t9();
- t8();
- t10();
- t11();
- t12();
-
- cout << "Final names & states:\n";
-#ifdef _OLD_STREAMS
- cout << "cin: " << cin.name() << "\t" << cin.rdstate() << "\n";
- cout << "cout: " << cout.name() << "\t" << cout.rdstate() << "\n";
- cout << "cerr: " << cerr.name() << "\t" << cerr.rdstate() << "\n";
-#else
- cout << "cin: " << "(stdin)" << "\t" << cin.rdstate() << "\n";
- cout << "cout: " << "(stdout)" << "\t" << cout.rdstate() << "\n";
- cout << "cerr: " << "(stderr)" << "\t" << cerr.rdstate() << "\n";
-#endif
- cout << "\nend of test.\n";
-}
diff --git a/contrib/libg++/libio/tests/tFile.exp b/contrib/libg++/libio/tests/tFile.exp
deleted file mode 100644
index 154cd24dc0bb..000000000000
--- a/contrib/libg++/libio/tests/tFile.exp
+++ /dev/null
@@ -1,75 +0,0 @@
-Hello, world via cout
-Hello, world via cerr
-enter a char:c = "a"
-enter three integers (short, int, long):first = 123 via dec = 123
-second = 4567 via form = 4567 = 010727 via cout.form = 4567 = 0x11d7
-third = 89012 via hex = 15bb4
-enter a float then a double:first = 123.456
-second = -0.012
-enter 5 characters separated with spaces:first = 1
-rest = 2 3 4 5
-A 10-character buffer: abcdefghi
-
-Making streams sout and sin...contents of file:
-Thisfilehasonelinetestingoutputstreams.
-Making File tf ... first line of file:
-This is the first and only line of this file.
-next char = 10
-reopening tempfile, appending: Now there is a second line.
-First 10 chars via raw system read after reopen for input:
-This is th
-Contents after raw lseek to pos 5:
-is the first and only line of this file.
-Now there is a second line.
-
-Making SFile rf...odd elements of file in reverse order:
-(i = 9 c = j d = 0.009)
-(i = 7 c = h d = 0.007)
-(i = 5 c = f d = 0.005)
-(i = 3 c = d d = 0.003)
-(i = 1 c = b d = 0.001)
-
-Making PlotFile pf ...(You may delete or attempt to plot plot.out)
-creating ostrstream...
-with contents:
-This is a string-based stream.
-With two lines.
-using it to create istrstream...
-with contents:
-This is a string-based stream.
-With two lines.
-Testing string-based stream using strstream.
-
-Making filebuf streams fout and fin...contents of file:
-Thisfilehasonelinetestingoutputstreams.
-
-This is line 1 of ftmp0
-This is line 2 of ftmp0
-
-This is line 1 of ftmp1
-This is line 2 of ftmp1
-
-This is line 1 of ftmp2
-This is line 2 of ftmp2
-
-5.50+6.25 = 1.175e+01
-Previous line has 21 characters
-Previous line has +32 characters
-+__34567(dec) = 0x__8707(hex) = _0103407(oct) [showbase on]
-+__34567(dec) = ____8707(hex) = __103407(oct) [showbase off]
--__34567(dec) = 0x__78f9(hex) = __074371(oct) [showbase on]
--__34567(dec) = ____78f9(hex) = ___74371(oct) [showbase off]
-______+0(dec) = _____0x0(hex) = _______0(oct) [showbase on]
-______+0(dec) = _______0(hex) = _______0(oct) [showbase off]
-___34567(dec) = __0X8707(hex) = _0103407(oct) [showbase on]
-___34567(dec) = ____8707(hex) = __103407(oct) [showbase off]
--34567__(dec) = 0X78F9__(hex) = 074371__(oct) [showbase on]
--34567__(dec) = 78F9____(hex) = 74371___(oct) [showbase off]
-0 (dec) = 0X0 (hex) = 0 (oct) [showbase on]
-0 (dec) = 0 (hex) = 0 (oct) [showbase off]
-Final names & states:
-cin: (stdin) 0
-cout: (stdout) 0
-cerr: (stderr) 0
-
-end of test.
diff --git a/contrib/libg++/libio/tests/tFile.inp b/contrib/libg++/libio/tests/tFile.inp
deleted file mode 100644
index 5b821ef072be..000000000000
--- a/contrib/libg++/libio/tests/tFile.inp
+++ /dev/null
@@ -1,5 +0,0 @@
-a
-123 4567 89012
-123.456 -1.2e-2
-1 2 3 4 5
-abcdefghijklmnop
diff --git a/contrib/libg++/libio/tests/tfformat.c b/contrib/libg++/libio/tests/tfformat.c
deleted file mode 100644
index f0f5ccf21777..000000000000
--- a/contrib/libg++/libio/tests/tfformat.c
+++ /dev/null
@@ -1,4145 +0,0 @@
-#ifdef TEST_LIBIO
-#include <iostdio.h>
-#else
-#ifdef __cplusplus
-#include <strstream.h>
-#else
-#include <stdio.h>
-#endif
-#endif /* !TEST_LIBIO */
-
-/* Tests taken from Cygnus C library. */
-
-typedef struct
-{
- int line;
- double value;
- char *result;
- char *format_string;
-} sprint_double_type;
-
-sprint_double_type sprint_doubles[] =
-{
-__LINE__, 30.3, "< +30.3>", "<%+15.10g>",
-__LINE__, 10.0, "<10.00>", "<%5.2f>",
-
-__LINE__, 1.002121970718271e+05, "100212.19707 ", "%0-15.5f",
-__LINE__, -1.002121970718271e+05, "-100212.19707 ", "%0-15.5f",
-__LINE__, 1.002121970718271e+05, "000100212.19707", "%015.5f",
-__LINE__, -1.002121970718271e+05, "-00100212.19707", "%015.5f",
-__LINE__, 1.002121970718271e+05, "+00100212.19707", "%+015.5f",
-__LINE__, -1.002121970718271e+05, "-00100212.19707", "%+015.5f",
-__LINE__, 1.002121970718271e+05, " 00100212.19707", "% 015.5f",
-__LINE__, -1.002121970718271e+05, "-00100212.19707", "% 015.5f",
-__LINE__, 1.002121970718271e+05, "+100212.19707 ", "%+-15.5f",
-__LINE__, -1.002121970718271e+05, "-100212.19707 ", "%+-15.5f",
-
-__LINE__, -1.002121970718271e+29, "-1.0E+29", "%.1E",
-__LINE__, -1.002126048612756e-02, "-1.002126E-02", "%+#E",
-__LINE__, -1.002653755271637e+00, "-1.00265", "%G",
-__LINE__, -1.003238744365917e-23, "-0.00", "%4.2f",
-__LINE__, -1.005084840877781e-29, " -0", "%4.f",
-__LINE__, -1.005362549674427e+01, "-10.0536", "%#g",
-__LINE__, -1.005915042991691e-17, "-1.00592E-17", "%G",
-__LINE__, -1.007829874228503e-18, "-1.00783e-18", "%.7g",
-__LINE__, -1.007829874228503e-18, "-1.007830e-18", "%#.7g",
-__LINE__, -1.009390937771849e+15, "-1009390937771848.628657", "%+f",
-__LINE__, -1.010679382726182e-29, "-0.0000000", "%.7f",
-__LINE__, -1.010691853346650e+13, "-10106918533466.497934", "%+f",
-__LINE__, -1.013412912122286e-22, "-1.01E-22", "%.2E",
-__LINE__, -1.019269582113858e-25, " -0", "%4.0f",
-__LINE__, -1.019886033368556e+24, "-1.019886E+24", "%+.7G",
-__LINE__, -1.021037413548719e+02, "-102.103741", "%f",
-__LINE__, -1.023833576089065e+26, "-1.023834E+26", "%+E",
-__LINE__, -1.024736652408627e+10, "-10247366524.086265", "%+f",
-__LINE__, -1.025439198495476e+09, "-1.02544e+09", "%+g",
-__LINE__, -1.027080247585776e-04, "-0.0001027", "%6.7f",
-__LINE__, -1.028096307262016e+18, "-1.0281E+18", "%3G",
-__LINE__, -1.029604290697901e-02, "-0.010296", "%g",
-__LINE__, -1.034347730570491e+16, "-10343477305704908.975059", "%+f",
-__LINE__, -1.034663325049286e+22, "-1.0E+22", "%#.1E",
-__LINE__, -1.034843152721857e-14, " -0", "%6.f",
-__LINE__, -1.036082122299529e-29, "-1.04e-29", "%4.3g",
-__LINE__, -1.037213662365954e-09, "-1e-09", "%3.e",
-__LINE__, -1.038563976775690e-12, "-0.000000", "%f",
-__LINE__, -1.040910158681323e-02, "-0.0104091", "%+G",
-__LINE__, -1.044680094714482e-20, "-1.04468E-20", "%G",
-__LINE__, -1.044990054091126e+24, "-1.044990E+24", "%+E",
-__LINE__, -1.045693871096982e+11, "-1.045694e+11", "%+e",
-__LINE__, -1.045714133591312e-04, "-0.000104571", "%+#3g",
-__LINE__, -1.046215079103016e-15, "-1.04622e-15", "%g",
-__LINE__, -1.046285293993789e-18, "-1.04629E-18", "%+4G",
-__LINE__, -1.046306092899333e-06, "-0.00", "%0.2f",
-__LINE__, -1.047308973649206e-22, "-1.05E-22", "%+1.3G",
-__LINE__, -1.047369032507755e+01, "-1.047369E+01", "%E",
-__LINE__, -1.048986365562919e-21, "-1.05E-21", "%+.2E",
-__LINE__, -1.049530193156793e-17, "-1.04953E-17", "%+G",
-__LINE__, -1.050073419263768e+25, "-1.05007e+25", "%g",
-__LINE__, -1.051739652002504e-28, "-0.000000", "%+f",
-__LINE__, -1.054493420082636e+21, "-1.0545e+21", "%#5.4e",
-__LINE__, -1.055867291029098e+18, "-1.05587e+18", "%g",
-__LINE__, -1.056514389757866e-16, "-1.05651E-16", "%5.6G",
-__LINE__, -1.057180924868704e+15, "-1057180924868704", "%4.f",
-__LINE__, -1.058455468395683e-23, "-1.05846e-23", "%g",
-__LINE__, -1.062560982393212e+08, "-1.06256e+08", "%g",
-__LINE__, -1.063365829241138e-10, "-1.063366e-10", "%+e",
-__LINE__, -1.063568908667280e-19, "-1.06357E-19", "%+G",
-__LINE__, -1.063734263253492e-13, "-0.000000", "%0f",
-__LINE__, -1.064472689765495e-13, "-1E-13", "%4.0G",
-__LINE__, -1.067192610000129e-25, "-1.06719E-25", "%G",
-__LINE__, -1.068401334996592e-12, "-0.0000000", "%+.7f",
-__LINE__, -1.069012628653724e-13, "-1.069013E-13", "%+.7G",
-__LINE__, -1.069451976810790e+16, "-10694519768107904.056365", "%f",
-__LINE__, -1.069568935323556e+17, "-1.06957e+17", "%g",
-__LINE__, -1.071351044854107e-29, "-1.07135e-29", "%g",
-__LINE__, -1.072274197526185e-21, "-1E-21", "%1.G",
-__LINE__, -1.073875921752995e+23, "-1E+23", "%5.E",
-__LINE__, -1.074835151152265e-12, "-1.0748e-12", "%1.5g",
-__LINE__, -1.075171047088241e-19, "-1.07517E-19", "%#G",
-__LINE__, -1.076258826412760e+22, "-1.076259e+22", "%+e",
-__LINE__, -1.076365103160401e+06, "-1.07637E+06", "%+4.6G",
-__LINE__, -1.076817750454633e+08, "-1e+08", "%4.g",
-__LINE__, -1.078615405755685e-30, "-1e-30", "%4.g",
-__LINE__, -1.078629622917468e-25, "-1.078630e-25", "%e",
-__LINE__, -1.079352432833170e+11, "-107935243283", "%+2.f",
-__LINE__, -1.081431147440215e+16, "-10814311474402147.439378", "%+f",
-__LINE__, -1.083042116905339e-16, "-1.083e-16", "%.5g",
-__LINE__, -1.085351710708553e-10, "-1.085e-10", "%1.4g",
-__LINE__, -1.085796045618276e+07, "-1.085796e+07", "%e",
-__LINE__, -1.087398259981007e+22, "-1.0874e+22", "%g",
-__LINE__, -1.087986044402224e-11, "-1.087986e-11", "%e",
-__LINE__, -1.090451848762709e-02, "-1.090452e-02", "%e",
-__LINE__, -1.091463236899737e+11, "-1.091463E+11", "%#E",
-__LINE__, -1.091617921737384e-29, "-1.09162e-29", "%3g",
-__LINE__, -1.092049328579047e-17, "-1.092049E-17", "%E",
-__LINE__, -1.093647615472090e+06, "-1093647.61547", "%6.5f",
-__LINE__, -1.094133175602384e-08, "-1.1E-08", "%0.1E",
-__LINE__, -1.095397916728214e-23, "-1e-23", "%6.e",
-__LINE__, -1.098958790437321e+02, "-109.895879", "%+#f",
-__LINE__, -1.100194638181594e-20, "-1.100195e-20", "%e",
-__LINE__, -1.102174253534260e+05, "-1.1e+05", "%2.3g",
-__LINE__, -1.102890180316350e-12, "-1.10289e-12", "%+g",
-__LINE__, -1.105582337418378e+00, "-1.11", "%3.3g",
-__LINE__, -1.110515122647056e+04, "-1.E+04", "%#0.G",
-__LINE__, -1.111365895262625e-18, "-1e-18", "%0.g",
-__LINE__, -1.112010622677495e+04, "-11120.1", "%g",
-__LINE__, -1.112580043156699e-23, "-1.11258e-23", "%1g",
-__LINE__, -1.112829057091303e+08, "-1.11283e+08", "%+2g",
-__LINE__, -1.115019046200472e+18, "-1.1150190e+18", "%+#.7e",
-__LINE__, -1.118078332268016e-13, "-1.12E-13", "%1.3G",
-__LINE__, -1.119113571963886e+08, "-1.119114e+08", "%e",
-__LINE__, -1.120102397563448e-15, "-1.12e-15", "%.4g",
-__LINE__, -1.120707480791434e-19, "-1.12071e-19", "%g",
-__LINE__, -1.124243676139007e-07, "-0.000000", "%f",
-__LINE__, -1.125025214608798e+15, "-1.12503E+15", "%0G",
-__LINE__, -1.126074395136447e+06, "-1E+06", "%+.0G",
-__LINE__, -1.127203019940870e-06, "-0.000001", "%+#7f",
-__LINE__, -1.130577648480677e+01, "-1.130578e+01", "%e",
-__LINE__, -1.131469694425240e-11, "-1.13147e-11", "%#0.6g",
-__LINE__, -1.132225023239752e+02, "-113.223", "%G",
-__LINE__, -1.133702113050128e+20, "-1E+20", "%+3.E",
-__LINE__, -1.135529466224404e-13, "-1.13553e-13", "%#g",
-__LINE__, -1.137587210063004e+21, "-1e+21", "%.1g",
-__LINE__, -1.140765637106361e-21, "-1.1e-21", "%+.1e",
-__LINE__, -1.141182595083699e-18, "-0.000000", "%f",
-__LINE__, -1.141695709120972e+00, "-1.1417", "%3G",
-__LINE__, -1.143199141708028e+18, "-1143199141708027833", "%2.f",
-__LINE__, -1.146712902056139e+21, "-1146712902056139071760.298975", "%f",
-__LINE__, -1.146837903839073e-02, " -0.0", "%+5.1f",
-__LINE__, -1.147363016107446e+10, "-1.14736e+10", "%+7g",
-__LINE__, -1.149575523465052e+20, "-114957552346505220697.28140", "%+.5f",
-__LINE__, -1.152748955392589e+13, "-1.15275E+13", "%G",
-__LINE__, -1.152751106015483e-17, "-1E-17", "%+3.E",
-__LINE__, -1.155539139258226e-18, "-1.2e-18", "%+.2g",
-__LINE__, -1.157089280563492e+20, "-1.15709e+20", "%g",
-__LINE__, -1.161217745859779e+19, "-1.161218E+19", "%E",
-__LINE__, -1.162293536734798e+10, "-11622935367.347980", "%f",
-__LINE__, -1.162629909468603e+20, "-1.16E+20", "%.3G",
-__LINE__, -1.164979155838631e+24, "-1.16498E+24", "%G",
-__LINE__, -1.165103052644816e-20, " -1e-20", "%+7.g",
-__LINE__, -1.166448459023264e-08, "-0.000000", "%f",
-__LINE__, -1.167694506705309e+28, "-1e+28", "%.1g",
-__LINE__, -1.169901754818745e-28, "-0.000000", "%+f",
-__LINE__, -1.170330336216446e+08, " -1e+08", "%7.g",
-__LINE__, -1.170946623214213e-17, "-1.17095E-17", "%G",
-__LINE__, -1.174581596799302e+27, "-1.174582e+27", "%+e",
-__LINE__, -1.174763473995155e-28, "-1E-28", "%.1G",
-__LINE__, -1.175885640508038e-23, "-1E-23", "%+.0E",
-__LINE__, -1.177268411775439e-05, "-0.000012", "%#2.6f",
-__LINE__, -1.177739669428001e-30, "-1.17774E-30", "%G",
-__LINE__, -1.178059639880544e-02, "-0.0117806", "%+.7G",
-__LINE__, -1.178793300854446e-13, "-1.2E-13", "%+#0.2G",
-__LINE__, -1.179629345138058e-04, "-0.000118", "%0.3g",
-__LINE__, -1.180730292213358e-25, "-1.18073e-25", "%g",
-__LINE__, -1.180766261654697e+02, "-118.077", "%3g",
-__LINE__, -1.181880261069391e-29, "-1.181880e-29", "%+#e",
-__LINE__, -1.183752810063514e-09, "-1.18375e-09", "%#g",
-__LINE__, -1.184191742443406e-21, "-1.184192e-21", "%e",
-__LINE__, -1.184859760488406e-26, "-1.18486E-26", "%G",
-__LINE__, -1.187276828720072e-29, "-1.18728E-29", "%G",
-__LINE__, -1.187992907205195e-04, "-1.187993E-04", "%E",
-__LINE__, -1.190586192763405e-28, "-1.E-28", "%#1.E",
-__LINE__, -1.192104053032086e+02, "-119.21", "%G",
-__LINE__, -1.192917884333569e+26, "-1.192918E+26", "%E",
-__LINE__, -1.195900753509801e+22, "-1.1959e+22", "%g",
-__LINE__, -1.196559413116537e-28, "-0.000000", "%6.6f",
-__LINE__, -1.197534588732952e+12, "-1.19753e+12", "%#g",
-__LINE__, -1.200279514790649e-25, "-0.0000", "%0.4f",
-__LINE__, -1.203806667944635e+10, "-1.2038067E+10", "%5.7E",
-__LINE__, -1.204344885974736e+07, "-1.204E+07", "%#2.4G",
-__LINE__, -1.205668007693083e+00, "-1.20567", "%g",
-__LINE__, -1.205898515218947e-11, "-1.2059e-11", "%+g",
-__LINE__, -1.206787414909373e-05, "-1.2e-05", "%2.2g",
-__LINE__, -1.207905830366447e+15, "-1.207906e+15", "%6.7g",
-__LINE__, -1.208067010597729e-17, "-1.208067e-17", "%5e",
-__LINE__, -1.210189135822574e+01, "-12", "%+2.0f",
-__LINE__, -1.211560695948122e+10, "-1.21156e+10", "%+g",
-__LINE__, -1.214003025273234e-18, "-1.214e-18", "%+g",
-__LINE__, -1.214096815259005e+17, "-121409681525900459.142520", "%f",
-__LINE__, -1.214699041716797e-14, "-1.2147E-14", "%G",
-__LINE__, -1.215061611919443e+14, "-121506161191944.306310", "%+#f",
-__LINE__, -1.217491221065185e+27, "-1.21749e+27", "%g",
-__LINE__, -1.218538401534388e-11, "-1.218538e-11", "%#e",
-__LINE__, -1.218810085883466e+16, "-1e+16", "%+.1g",
-__LINE__, -1.219422688169801e+08, "-1.219423e+08", "%e",
-__LINE__, -1.220473194407651e-14, "-1.2205E-14", "%1.5G",
-__LINE__, -1.220824440193375e-02, "-0.012208", "%4f",
-__LINE__, -1.221520240637007e+13, "-1.221520E+13", "%1E",
-__LINE__, -1.221894719843486e+29, "-1.22189E+29", "%G",
-__LINE__, -1.223020108610281e+25, "-1.22302E+25", "%G",
-__LINE__, -1.223203206227728e-02, "-0.012232", "%G",
-__LINE__, -1.225661737076919e-15, "-1.22566E-15", "%G",
-__LINE__, -1.228147221003795e-08, "-1.22815E-08", "%G",
-__LINE__, -1.228298534591771e+20, "-1.22830E+20", "%#G",
-__LINE__, -1.228469080229780e-02, "-0.012285", "%0f",
-__LINE__, -1.229161950699222e-09, "-1e-09", "%0.e",
-__LINE__, -1.231294820136559e-17, "-1.231295E-17", "%1.7G",
-__LINE__, -1.232588663406698e-21, "-1E-21", "%+0.G",
-__LINE__, -1.233381256982191e-26, "-0.000000", "%f",
-__LINE__, -1.233435864835578e+14, "-1.23344e+14", "%#g",
-__LINE__, -1.237409567806099e-25, "-1.23741E-25", "%#G",
-__LINE__, -1.238244697758558e-02, "-1.238245e-02", "%7e",
-__LINE__, -1.239393163123284e+26, "-1.23939e+26", "%+g",
-__LINE__, -1.240484781756132e-18, "-1E-18", "%4.E",
-__LINE__, -1.241420286838750e+23, "-1E+23", "%2.E",
-__LINE__, -1.243781122052343e-18, "-1.243781e-18", "%+e",
-__LINE__, -1.244421506844779e+07, "-1.244422E+07", "%+6E",
-__LINE__, -1.245754054764741e-21, "-1e-21", "%5.0g",
-__LINE__, -1.245992228426733e-24, "-0.000000", "%f",
-__LINE__, -1.246498277739883e-12, "-0.0000000", "%5.7f",
-__LINE__, -1.247130891343776e-18, "-1.24713E-18", "%G",
-__LINE__, -1.247309461703025e-03, "-0.0012473", "%#5.5G",
-__LINE__, -1.248139162966407e-29, "-1.e-29", "%+#6.g",
-__LINE__, -1.249756153623776e+08, "-1.249756e+08", "%e",
-__LINE__, -1.250899983565585e-10, "-1.2509e-10", "%5g",
-__LINE__, -1.250957368798327e+19, "-1.25096E+19", "%0G",
-__LINE__, -1.252630814464822e-02, "-0.012526", "%+f",
-__LINE__, -1.253076368257011e-28, "-0.000000", "%f",
-__LINE__, -1.254243507039370e+01, "-1.254244e+01", "%e",
-__LINE__, -1.257605614492298e-12, "-1.257606E-12", "%6.7G",
-__LINE__, -1.258041911573120e+06, "-1258041.911573", "%+f",
-__LINE__, -1.261670983426507e-25, "-0.00", "%.2f",
-__LINE__, -1.263216883336562e-14, "-1.26322e-14", "%g",
-__LINE__, -1.266846944498751e-15, "-1e-15", "%0.g",
-__LINE__, -1.266977908502326e+06, "-1266978", "%+1.f",
-__LINE__, -1.267006162870084e-23, "-1.267006e-23", "%e",
-__LINE__, -1.269144609375931e+01, "-1.269145e+01", "%+e",
-__LINE__, -1.269458714257904e+25, "-1.26946E+25", "%G",
-__LINE__, -1.276697325772662e-02, "-0.0128", "%7.3G",
-__LINE__, -1.278855081807602e+15, "-1278855081807601.87891", "%#0.5f",
-__LINE__, -1.278966821639612e+20, "-1.278967E+20", "%3E",
-__LINE__, -1.281942705258106e+03, "-1281.94", "%+G",
-__LINE__, -1.282331291499203e+14, "-128233129149920.266343", "%+f",
-__LINE__, -1.285125739341808e-28, "-1.28513e-28", "%g",
-__LINE__, -1.285700693704978e+11, "-1.285701E+11", "%E",
-__LINE__, -1.286574096459251e+28, "-1.287E+28", "%6.4G",
-__LINE__, -1.287967889247240e+03, "-1287.97", "%G",
-__LINE__, -1.288913808801319e-27, "-1.3e-27", "%7.1e",
-__LINE__, -1.289147517760377e-18, "-1.289148E-18", "%E",
-__LINE__, -1.289355006600107e+23, "-1.28936E+23", "%+G",
-__LINE__, -1.291232014623979e+01, "-1.29123E+01", "%+.5E",
-__LINE__, -1.293658562875966e-18, "-1.29366e-18", "%+g",
-__LINE__, -1.294982911983638e-19, "-1.29498E-19", "%#G",
-__LINE__, -1.296123363481695e-13, "-1.296123E-13", "%E",
-__LINE__, -1.296632862070602e-20, "-1.29663e-20", "%+g",
-__LINE__, -1.297801639022777e+23, "-129780163902277735132884.11777", "%#0.5f",
-__LINE__, -1.297886574534611e+16, "-1.297887e+16", "%+e",
-__LINE__, -1.300588216308401e+11, "-1.30e+11", "%.2e",
-__LINE__, -1.301296100909062e-10, "-1.3013e-10", "%+g",
-__LINE__, -1.303144244306468e-07, "-1.303144E-07", "%E",
-__LINE__, -1.304096315024042e-20, "-1.3041E-20", "%+G",
-__LINE__, -1.304817970675085e+16, "-1.304818E+16", "%+E",
-__LINE__, -1.304870304632683e-15, " -1e-15", "%7.g",
-__LINE__, -1.305213586757638e-18, "-1.30521e-18", "%g",
-__LINE__, -1.306880734910465e-22, "-1.306881E-22", "%E",
-__LINE__, -1.308964092631446e-23, "-1.30896e-23", "%g",
-__LINE__, -1.312070555198201e+26, "-131207055519820126043839537", "%+7.f",
-__LINE__, -1.312511609151056e-30, "-1.312512E-30", "%#E",
-__LINE__, -1.313087359008389e-23, "-0.000000", "%+f",
-__LINE__, -1.316948423042059e-02, "-1.316948E-02", "%+E",
-__LINE__, -1.317080882577385e+29, "-1.317E+29", "%+.4G",
-__LINE__, -1.317514598984346e+24, "-1.317515e+24", "%e",
-__LINE__, -1.317817551125923e-21, "-1.31782E-21", "%+G",
-__LINE__, -1.319603985988120e+29, "-131960398598811989856471882376.354188", "%f",
-__LINE__, -1.328850458671907e+06, "-1e+06", "%.0e",
-__LINE__, -1.328945346449817e-23, "-1.328945e-23", "%+e",
-__LINE__, -1.330146584094221e-08, "-1e-08", "%+5.g",
-__LINE__, -1.332609617892115e+00, "-1.33261", "%2.7G",
-#ifndef __PCCNECV70__
-__LINE__, -1.332751724965715e+22, "-13327517249657150344432.920974", "%f",
-__LINE__, -1.333194379353273e-19, "-0.000000", "%f",
-__LINE__, -1.334304387932777e-06, "-1.334304e-06", "%e",
-__LINE__, -1.334306581172082e-05, "-1.3e-05", "%+1.2g",
-__LINE__, -1.335283510893438e-05, " -1E-05", "%7.G",
-__LINE__, -1.337939692108373e+11, "-1.33794e+11", "%+4g",
-__LINE__, -1.339117288874809e-03, "-0.001", "%1.3f",
-__LINE__, -1.340100588141492e+27, "-1.340101E+27", "%E",
-__LINE__, -1.341953272572953e-19, "-0.000000", "%+f",
-__LINE__, -1.343058354301620e-02, "-1.343058e-02", "%e",
-__LINE__, -1.346662720871543e+22, "-1.34666E+22", "%#G",
-__LINE__, -1.354010578652210e-02, "-0.0135401", "%#g",
-__LINE__, -1.354066549307666e-12, " -0", "%+6.f",
-__LINE__, -1.355284719365947e+21, "-1.35528e+21", "%g",
-__LINE__, -1.356326532145087e+29, "-1E+29", "%4.G",
-__LINE__, -1.357278618897291e+19, "-13572786188972911780.581398", "%f",
-__LINE__, -1.357537331348202e-10, "-0.000", "%+.3f",
-__LINE__, -1.360011287595868e-10, "-0.000000", "%f",
-__LINE__, -1.360506902899232e+16, "-13605069028992320.", "%#5.f",
-__LINE__, -1.361102570277000e+10, "-1.3611E+10", "%G",
-__LINE__, -1.362601255900219e+07, "-1.363E+07", "%.4G",
-__LINE__, -1.366078182354771e+10, "-1.36608E+10", "%0G",
-__LINE__, -1.366667926615127e+08, "-136666792.661513", "%f",
-__LINE__, -1.367162823743231e-12, "-0.000000", "%#f",
-__LINE__, -1.371523037550709e+09, "-1.37152e+09", "%+g",
-__LINE__, -1.374328925986197e-17, "-1.37e-17", "%.2e",
-__LINE__, -1.374995603898421e-26, "-1.375e-26", "%+g",
-__LINE__, -1.376726539375688e+09, "-1.376727E+09", "%+E",
-__LINE__, -1.378351117694958e-13, "-0.000000", "%f",
-__LINE__, -1.378514699313619e-14, "-1.378515e-14", "%e",
-__LINE__, -1.379347588942324e-23, "-1.4e-23", "%+.1e",
-__LINE__, -1.380380583822272e-17, "-0.000000", "%+f",
-__LINE__, -1.381658659947406e+19, "-1.38166e+19", "%g",
-__LINE__, -1.382775316390237e+29, "-138277531639023653298181670834.3104", "%+#7.4f",
-__LINE__, -1.383541138922400e+00, "-1.383541E+00", "%E",
-__LINE__, -1.384625301445090e+01, "-13.8", "%+.3g",
-__LINE__, -1.386844086284027e-13, "-1.38684E-13", "%+G",
-__LINE__, -1.386930516448650e-28, "-1.386931E-28", "%E",
-__LINE__, -1.387444896054260e-07, "-1.38744E-07", "%G",
-__LINE__, -1.389685107980798e+22, "-1.38969E+22", "%G",
-__LINE__, -1.390880300369347e+03, "-1390.880300", "%f",
-__LINE__, -1.391423370198150e-17, "-1E-17", "%+2.G",
-__LINE__, -1.394441767471218e-09, "-1.394442e-09", "%e",
-__LINE__, -1.396275525062527e-20, "-1.39628E-20", "%G",
-__LINE__, -1.397045957455157e+24, "-1E+24", "%.0E",
-__LINE__, -1.397458546930799e+21, "-1397458546930798526375.383517", "%f",
-__LINE__, -1.397584578988941e-14, "-1.39758e-14", "%5g",
-__LINE__, -1.397789397300823e+09, "-1.398e+09", "%.4g",
-__LINE__, -1.398167472294874e+21, "-1.398167E+21", "%+7E",
-__LINE__, -1.398809636136688e-16, "-0.000000", "%+f",
-__LINE__, -1.399545335304119e+26, "-139954533530411872277454676.805064", "%#5f",
-__LINE__, -1.400102603335755e+20, "-140010260333575509150.705329", "%2f",
-__LINE__, -1.401212746235235e+04, "-1.401213e+04", "%e",
-__LINE__, -1.404409427681801e+07, "-1E+07", "%4.E",
-__LINE__, -1.406018114263948e-25, "-1e-25", "%3.e",
-__LINE__, -1.406245608096877e-06, "-1.4e-06", "%+.1e",
-__LINE__, -1.410697254683835e-10, "-1.410697e-10", "%e",
-__LINE__, -1.410739097553846e+25, "-1.410739E+25", "%+E",
-__LINE__, -1.410850631189577e+04, "-14108.5", "%.6g",
-__LINE__, -1.411680434455781e+28, "-14116804344557807304738616949.180141", "%f",
-__LINE__, -1.413309465660099e-27, "-1.413309E-27", "%+#E",
-__LINE__, -1.418468741386300e+09, "-1418468741.386300", "%f",
-__LINE__, -1.420277110892909e+06, "-1.42028e+06", "%1g",
-__LINE__, -1.420417889565590e-17, "-1.42E-17", "%.2E",
-__LINE__, -1.421098212056305e+08, "-1.421098e+08", "%4e",
-__LINE__, -1.421792812798986e-20, " -1E-20", "%7.G",
-__LINE__, -1.423675488122461e+18, "-1423675488122461363.360571", "%f",
-__LINE__, -1.423810545840653e+15, "-1E+15", "%3.E",
-__LINE__, -1.424242673476368e-15, "-1.424243e-15", "%e",
-__LINE__, -1.427847435688733e-01, "-1.427847E-01", "%E",
-__LINE__, -1.433897734612555e-04, "-0.0001", "%3.g",
-__LINE__, -1.434537754075696e-24, "-1.435E-24", "%+0.3E",
-__LINE__, -1.434774864809324e-24, "-1E-24", "%2.E",
-__LINE__, -1.435583851565142e-11, "-1E-11", "%.0E",
-__LINE__, -1.438791024010112e+11, "-1.43879e+11", "%#.6g",
-__LINE__, -1.439267565343777e+27, "-1.4e+27", "%2.1e",
-__LINE__, -1.439440602670449e+02, "-143.944", "%G",
-__LINE__, -1.439494412124925e+13, "-14394944121249.251268", "%f",
-__LINE__, -1.440032823245152e+10, "-14400328232.451516", "%f",
-__LINE__, -1.440174494009562e-08, "-0.000000", "%7f",
-__LINE__, -1.440827804010568e+07, "-1.E+07", "%#6.1G",
-__LINE__, -1.442760907195336e+09, "-1.44276E+09", "%+5G",
-__LINE__, -1.444655304181403e+10, "-14446553041.814035", "%7f",
-__LINE__, -1.444995766787036e+04, "-14450", "%5G",
-__LINE__, -1.445078682874535e-13, "-1E-13", "%3.E",
-__LINE__, -1.446781469662328e+01, "-14.4678", "%G",
-__LINE__, -1.447795251395321e-04, "-0.000145", "%+f",
-__LINE__, -1.448193079247108e-02, "-0.014", "%4.2G",
-__LINE__, -1.449552967961345e+14, "-1E+14", "%1.E",
-__LINE__, -1.451269763513571e+10, "-14512697635.135705", "%6f",
-__LINE__, -1.451843176990292e+12, "-1e+12", "%1.g",
-__LINE__, -1.452631405935931e+06, "-1.452631e+06", "%e",
-__LINE__, -1.452753650285897e+21, "-1452753650285897091265.496783", "%5f",
-__LINE__, -1.453811512433860e-05, "-1e-05", "%+6.g",
-__LINE__, -1.454071430557372e+13, "-1.4541E+13", "%.4E",
-__LINE__, -1.455956079562999e+03, "-1455.96", "%G",
-__LINE__, -1.459712196146602e-17, "-1.45971e-17", "%g",
-__LINE__, -1.461857733495947e-02, "-1.4619E-02", "%.4E",
-__LINE__, -1.465257069090911e-11, "-1.465257E-11", "%+E",
-__LINE__, -1.465306607257042e+05, "-146531", "%g",
-__LINE__, -1.465857076315921e+20, "-1.46586E+20", "%+G",
-__LINE__, -1.467919792051489e+16, "-1.46792e+16", "%2g",
-__LINE__, -1.469271519834567e+20, "-146927151983456720785", "%+.0f",
-__LINE__, -1.472961447442697e-28, "-1.47296e-28", "%#g",
-__LINE__, -1.473385695190456e-12, "-1.473386E-12", "%E",
-__LINE__, -1.485003089033267e-10, "-1.485E-10", "%2G",
-__LINE__, -1.490541379072390e-18, "-1.490541E-18", "%4E",
-__LINE__, -1.490683434793125e+22, "-14906834347931249951102.472551", "%#f",
-__LINE__, -1.498356837215425e+20, "-1.49836E+20", "%#G",
-__LINE__, -1.498677007818122e+14, "-1.49868E+14", "%+4G",
-__LINE__, -1.502143197677119e+23, "-150214319767711934616727.", "%#7.f",
-__LINE__, -1.503563770470753e-24, "-1.50356e-24", "%.6g",
-__LINE__, -1.504643092793197e-18, "-1.504643e-18", "%+4e",
-__LINE__, -1.507017706254022e-13, "-1.50702e-13", "%+g",
-__LINE__, -1.507054033750081e-22, "-0.000000", "%f",
-__LINE__, -1.508662346022339e+16, "-1.508662E+16", "%#E",
-__LINE__, -1.509366882438902e+08, "-2e+08", "%4.g",
-__LINE__, -1.511086567087967e+20, "-1.51109e+20", "%g",
-__LINE__, -1.514959134622707e-18, "-0.000000", "%+f",
-__LINE__, -1.515730120364204e+06, "-2E+06", "%0.G",
-__LINE__, -1.516372763118606e-09, "-1.51637e-09", "%g",
-__LINE__, -1.520610443546204e+27, "-1.52061e+27", "%g",
-__LINE__, -1.522040655642012e+11, "-1.52204E+11", "%+2G",
-__LINE__, -1.523772495014966e-24, "-2E-24", "%2.G",
-__LINE__, -1.523980825983892e-05, "-0.000", "%2.3f",
-__LINE__, -1.526696214603152e-03, "-0.0015267", "%+6.5G",
-__LINE__, -1.528680540769583e+00, "-1.5287", "%0.5G",
-__LINE__, -1.529951830525433e+08, "-1.529952e+08", "%+e",
-__LINE__, -1.533052896559935e+05, "-153305", "%4.0f",
-__LINE__, -1.533829640475152e-03, "-0.00153383", "%+#g",
-__LINE__, -1.535617804643105e-30, "-1.535618e-30", "%e",
-__LINE__, -1.537623698361821e+16, "-15376236983618207.7875719", "%4.7f",
-__LINE__, -1.544994895330616e+24, "-1.54499e+24", "%g",
-__LINE__, -1.545083356728403e+17, "-1.545083e+17", "%e",
-__LINE__, -1.545684535393879e+12, "-1.55E+12", "%3.3G",
-__LINE__, -1.545878334099427e+13, "-15458783340994.268762", "%1f",
-__LINE__, -1.547697185980564e-18, "-1.5477e-18", "%.6g",
-__LINE__, -1.548576527172579e-29, "-1.5E-29", "%2.2G",
-__LINE__, -1.549712227835891e+08, "-1.549712e+08", "%#6.7g",
-__LINE__, -1.550010819435335e-21, "-1.55001E-21", "%G",
-__LINE__, -1.551412476164257e+14, "-1.551412E+14", "%E",
-__LINE__, -1.553156638090030e+01, " -2E+01", "%7.G",
-__LINE__, -1.553733233064355e-01, "-0.2", "%3.g",
-__LINE__, -1.558391111609365e+00, "-1.558391", "%+f",
-__LINE__, -1.562004019284766e+15, "-1.562E+15", "%6.5G",
-__LINE__, -1.562195733239758e-16, "-0.000000", "%f",
-__LINE__, -1.563953339012525e-14, "-1.56395E-14", "%1G",
-__LINE__, -1.568317638534983e+18, "-1.56832E+18", "%1G",
-__LINE__, -1.568546851135348e+04, "-15685.5", "%+#G",
-__LINE__, -1.574297872228857e+18, "-1.574298e+18", "%e",
-__LINE__, -1.575696460196291e-21, "-1.5757E-21", "%G",
-__LINE__, -1.576324848379791e+25, "-1.57632E+25", "%+G",
-__LINE__, -1.577524395140843e+06, "-1.5775E+06", "%.5G",
-__LINE__, -1.585122856675091e+12, "-1585122856675.091452", "%f",
-__LINE__, -1.586734674395556e-02, "-1.586735E-02", "%E",
-__LINE__, -1.592602264315192e+22, "-1.5926E+22", "%G",
-__LINE__, -1.594121556700562e+05, "-2E+05", "%+.0G",
-__LINE__, -1.598538116193430e+22, "-1.59854e+22", "%+g",
-__LINE__, -1.605647463222382e+18, "-1.6056E+18", "%.5G",
-__LINE__, -1.610891449201191e+06, "-1.6109E+06", "%#6.4E",
-__LINE__, -1.614593168166818e-05, "-1.61459E-05", "%G",
-__LINE__, -1.615597722557325e-03, "-0.001616", "%f",
-__LINE__, -1.616038022182124e-29, "-1.61604E-29", "%1G",
-__LINE__, -1.618380771451625e-28, "-2e-28", "%+1.g",
-__LINE__, -1.620287456872150e+10, "-1.620e+10", "%#7.3e",
-__LINE__, -1.620469955611903e-29, "-0.000000", "%f",
-__LINE__, -1.622580720690927e+20, "-1.622581E+20", "%+#E",
-__LINE__, -1.622752500991079e-12, "-1.622753E-12", "%E",
-__LINE__, -1.622771933776459e+08, "-1.6228E+08", "%+4.4E",
-__LINE__, -1.623894567037391e+09, "-1.623895e+09", "%#e",
-__LINE__, -1.624021408185354e-25, "-1.624E-25", "%.5G",
-__LINE__, -1.624405320939366e-06, "-1.62441e-06", "%+#g",
-__LINE__, -1.631236208958857e-25, "-1.631236e-25", "%#e",
-__LINE__, -1.632165969536046e+20, "-1.63217E+20", "%G",
-__LINE__, -1.632859596256475e+06, "-1.63286E+06", "%G",
-__LINE__, -1.634371961703112e+06, "-1.634372E+06", "%+E",
-__LINE__, -1.637230383641845e+24, "-1.63723e+24", "%#g",
-__LINE__, -1.638081480475853e+17, "-1.63808e+17", "%+g",
-__LINE__, -1.638279690467673e+14, "-163827969046767.325523", "%#f",
-__LINE__, -1.640360249548215e-29, "-1.64036e-29", "%+6.6g",
-__LINE__, -1.645691728060833e-30, "-1.64569e-30", "%g",
-__LINE__, -1.648548965852592e-03, " -0", "%5.f",
-__LINE__, -1.650100957771182e+21, "-1650100957771182308420.065965", "%+f",
-__LINE__, -1.650957176011913e-02, "-0.016510", "%#4.5G",
-__LINE__, -1.651165108095301e+29, "-165116510809530137038336761179.380119", "%f",
-__LINE__, -1.657132845094847e-06, "-0.000002", "%f",
-__LINE__, -1.657152146172541e+12, "-1.657152E+12", "%.7G",
-__LINE__, -1.658377345516132e-06, "-0.00", "%.2f",
-__LINE__, -1.658850468902324e+20, "-1.659e+20", "%.4g",
-__LINE__, -1.661723557149830e+18, "-1.66172E+18", "%G",
-__LINE__, -1.663570885140273e+14, "-166357088514027", "%2.f",
-__LINE__, -1.665186944896906e+25, "-1.66519E+25", "%G",
-__LINE__, -1.675910137717036e+22, "-2e+22", "%5.g",
-__LINE__, -1.677447987675587e-15, "-1.67745E-15", "%G",
-__LINE__, -1.677510590697220e+06, "-1677510.590697", "%5f",
-__LINE__, -1.677658141289510e-18, "-2E-18", "%+5.G",
-__LINE__, -1.678316848066192e-03, "-1.678317E-03", "%E",
-__LINE__, -1.681506404024821e+24, "-1.68151E+24", "%G",
-__LINE__, -1.688584243722160e+12, "-1.68858E+12", "%+#G",
-__LINE__, -1.689468295411408e+28, "-1.68947E+28", "%+G",
-__LINE__, -1.690746767470207e-11, "-1.69075E-11", "%G",
-__LINE__, -1.692773960755248e-14, "-2E-14", "%4.E",
-__LINE__, -1.693349092740995e-18, "-1.69335e-18", "%g",
-__LINE__, -1.693642321808920e-26, "-1.69364E-26", "%G",
-__LINE__, -1.694579128700042e-12, "-0.000000", "%f",
-__LINE__, -1.695454897264717e-08, "-1.7E-08", "%+4.3G",
-__LINE__, -1.695733278397589e+19, "-1.695733e+19", "%4e",
-__LINE__, -1.699522534409388e-05, "-1.69952E-05", "%G",
-__LINE__, -1.701752039544919e+00, "-2", "%.0f",
-__LINE__, -1.702304998615036e+16, "-1.7023E+16", "%1G",
-__LINE__, -1.703113580904556e-25, "-1.703114e-25", "%+e",
-__LINE__, -1.705165515454546e+29, "-1.705166e+29", "%+e",
-__LINE__, -1.707392568277288e-05, "-1.70739E-05", "%G",
-__LINE__, -1.707477319256742e+09, "-1707477319.26", "%7.2f",
-__LINE__, -1.709669107513969e-03, " -0.002", "%7.g",
-__LINE__, -1.713284011412432e-24, "-1.713e-24", "%3.3e",
-__LINE__, -1.715512203951086e-28, "-1.715512E-28", "%E",
-__LINE__, -1.716880832248879e+13, "-1.71688e+13", "%+g",
-__LINE__, -1.720722835740680e-15, "-1.7E-15", "%.1E",
-__LINE__, -1.721855769574895e+07, "-17218557.695749", "%3f",
-__LINE__, -1.722449437415368e+01, "-1.722449e+01", "%e",
-__LINE__, -1.723218805116591e-29, "-2e-29", "%.0g",
-__LINE__, -1.726129004920195e-05, "-1.72613E-05", "%0G",
-__LINE__, -1.727400228037571e-28, "-0.0000000", "%2.7f",
-__LINE__, -1.730008745782339e-23, "-1.73e-23", "%.4g",
-__LINE__, -1.731875670201859e+09, "-1.73188E+09", "%G",
-__LINE__, -1.732142976428085e+10, "-2E+10", "%+6.0E",
-__LINE__, -1.732699651229194e-02, "-0.017327", "%5g",
-__LINE__, -1.734772870736446e-12, "-0.000000", "%+f",
-__LINE__, -1.738576887938331e+09, "-1.73858e+09", "%g",
-__LINE__, -1.738759937912438e-08, "-1.73876e-08", "%+2g",
-__LINE__, -1.739320154069143e-18, "-0.0000", "%1.4f",
-__LINE__, -1.739870415800800e+16, "-1.73987e+16", "%g",
-__LINE__, -1.741290506928618e+04, "-17412.9", "%G",
-__LINE__, -1.742520800031913e+29, "-1.742521e+29", "%7e",
-__LINE__, -1.747620095195231e+01, "-2e+01", "%+2.g",
-__LINE__, -1.749860675924882e-21, "-1.74986E-21", "%G",
-__LINE__, -1.752675363661431e-06, "-1.7527E-06", "%.5G",
-__LINE__, -1.752871508059699e-06, " -0", "%7.f",
-__LINE__, -1.755178530989839e+25, "-1.7551785e+25", "%1.7e",
-__LINE__, -1.755566213249512e-07, "-1.755566e-07", "%.6e",
-__LINE__, -1.756193485005071e-24, "-1.75619E-24", "%+2.6G",
-__LINE__, -1.758501410496218e+03, "-1758.501", "%.7G",
-__LINE__, -1.758795617219102e+20, "-1.75880E+20", "%#6G",
-__LINE__, -1.760538679276709e+03, "-2e+03", "%+1.e",
-__LINE__, -1.762660914833003e+27, "-1.76266E+27", "%G",
-__LINE__, -1.765122691141907e+19, "-17651226911419071186.1", "%5.1f",
-__LINE__, -1.765313277389086e-18, "-2E-18", "%+1.E",
-__LINE__, -1.765821717148734e+19, "-1.76582E+19", "%G",
-__LINE__, -1.767048687863149e-17, "-1.77E-17", "%+.3G",
-__LINE__, -1.768661645451962e+18, "-1.77E+18", "%+.3G",
-__LINE__, -1.769753257452233e+01, "-17.6975", "%G",
-__LINE__, -1.770945665065531e+28, "-1.770946E+28", "%0.7G",
-__LINE__, -1.776713865753894e-09, "-2e-09", "%1.g",
-__LINE__, -1.778424845787448e+03, "-1.7784E+03", "%.4E",
-__LINE__, -1.779060610701250e+06, "-1.779061E+06", "%E",
-__LINE__, -1.781447182110762e-27, "-1.781447E-27", "%E",
-__LINE__, -1.782655842123784e-13, "-2.E-13", "%#2.1G",
-__LINE__, -1.783071018169166e+16, "-17830710181691664.217851", "%+f",
-__LINE__, -1.784665985294415e+25, "-2E+25", "%3.G",
-__LINE__, -1.787297600658096e+25, "-2E+25", "%+5.E",
-__LINE__, -1.788200250255718e+12, "-1.7882E+12", "%2.4E",
-__LINE__, -1.792860730579114e-09, "-1.79286E-09", "%G",
-__LINE__, -1.793122797100936e+24, "-1.793123e+24", "%e",
-__LINE__, -1.793761706915029e-25, "-0.000000", "%f",
-__LINE__, -1.793947567431932e+22, "-1.79395e+22", "%g",
-__LINE__, -1.796428035404303e-18, "-1.79643e-18", "%g",
-__LINE__, -1.797113144273918e-16, "-1.79711E-16", "%.6G",
-__LINE__, -1.798796767828424e-29, "-1.7988E-29", "%G",
-__LINE__, -1.805004010633763e-11, "-1.805e-11", "%2.5g",
-__LINE__, -1.806936269752338e-26, "-1.80694e-26", "%g",
-__LINE__, -1.807122541760172e-10, "-1.80712e-10", "%g",
-__LINE__, -1.808295407815630e-06, "-1.8083E-06", "%+G",
-__LINE__, -1.813893236685959e+15, "-1813893236685959", "%0.f",
-__LINE__, -1.816201530145367e+06, "-1816202", "%+2.f",
-__LINE__, -1.822811219123512e+13, "-1.82281e+13", "%g",
-__LINE__, -1.826276499170243e-25, "-2E-25", "%+3.G",
-__LINE__, -1.832399287433839e-26, "-1.832399E-26", "%#4E",
-__LINE__, -1.833597815584463e-18, "-0.000000", "%+3f",
-__LINE__, -1.834165532712233e+28, "-1.834166E+28", "%.7G",
-__LINE__, -1.837633147831083e+28, "-1.8376331e+28", "%.7e",
-__LINE__, -1.839756716742518e-01, "-0.2", "%+0.G",
-__LINE__, -1.840101206950368e-14, "-1.840101E-14", "%+E",
-__LINE__, -1.842043645474877e+17, "-1.84204e+17", "%+g",
-__LINE__, -1.842155892969934e+17, "-1.84216e+17", "%+g",
-__LINE__, -1.843566073012842e-25, "-1.84357E-25", "%G",
-__LINE__, -1.843976321320497e-02, "-0.02", "%+4.2f",
-__LINE__, -1.845299931651554e+11, "-1.8453E+11", "%0.4E",
-__LINE__, -1.846199038659889e-06, "-1.8462e-06", "%0.5g",
-__LINE__, -1.847062180184169e-30, "-1.847062E-30", "%5E",
-__LINE__, -1.847962158722201e-16, "-0.000000", "%f",
-__LINE__, -1.849446376756582e+15, "-1.8E+15", "%2.2G",
-__LINE__, -1.853168465523878e-24, "-2E-24", "%1.E",
-__LINE__, -1.853601367230139e+10, "-1.853601e+10", "%e",
-__LINE__, -1.857367903775364e+18, "-1.86E+18", "%1.3G",
-__LINE__, -1.858332820633906e-05, "-0.000019", "%7f",
-__LINE__, -1.860243811657223e-23, "-1.860244e-23", "%e",
-__LINE__, -1.860660612539794e+08, "-1.86066e+08", "%+6.5e",
-__LINE__, -1.861160816251124e-09, "-2E-09", "%1.G",
-__LINE__, -1.862380636974688e-25, "-1.9E-25", "%.2G",
-__LINE__, -1.864168808453004e+15, "-1.86417E+15", "%G",
-__LINE__, -1.864273144411246e+07, "-1.86427e+07", "%g",
-__LINE__, -1.864929236615802e-02, "-2e-02", "%+3.e",
-__LINE__, -1.865010503480847e+19, "-2E+19", "%4.G",
-__LINE__, -1.866276374553144e+22, "-1.866276e+22", "%e",
-__LINE__, -1.870809567910649e+09, "-1.870810e+09", "%e",
-__LINE__, -1.872555495839008e-13, "-1.872555E-13", "%3E",
-__LINE__, -1.874465717110388e-22, "-1.874466E-22", "%E",
-__LINE__, -1.874916306627632e+21, "-1874916306627632422987.517202", "%f",
-__LINE__, -1.875804322194491e-23, "-0.000000", "%+f",
-__LINE__, -1.876662099198587e-04, "-0.000187666", "%G",
-__LINE__, -1.876775504795760e-25, "-1.87678e-25", "%0g",
-__LINE__, -1.879343051002554e-20, " -0.", "%#6.f",
-__LINE__, -1.881535445774717e-15, "-1.881535e-15", "%e",
-__LINE__, -1.887515901404300e+00, "-1.888", "%2.4G",
-__LINE__, -1.887730637149009e+17, "-1.887731E+17", "%E",
-__LINE__, -1.889920303480086e+17, "-1.889920e+17", "%+e",
-__LINE__, -1.891903478784091e+04, "-1.891903e+04", "%e",
-__LINE__, -1.893550084305833e+16, "-1.89355e+16", "%g",
-__LINE__, -1.894675230197676e+05, "-1.894675e+05", "%#e",
-__LINE__, -1.898389624953187e-27, "-1.898390e-27", "%+e",
-__LINE__, -1.899250044644046e+21, "-1899250044644046120367.875119", "%+4.6f",
-__LINE__, -1.904187609804679e-02, "-1.90419E-02", "%0.5E",
-__LINE__, -1.904452538421193e-04, "-2e-04", "%4.0e",
-__LINE__, -1.904615326969061e-16, "-1.904615e-16", "%1.7g",
-__LINE__, -1.907761255064750e+02, "-190.776126", "%f",
-__LINE__, -1.910727641826707e-10, " -2e-10", "%7.g",
-__LINE__, -1.913149279262051e+15, "-1.913149e+15", "%.7g",
-__LINE__, -1.913235739298009e+28, "-1.913236e+28", "%e",
-__LINE__, -1.913526822735271e+18, "-1.914e+18", "%.4g",
-__LINE__, -1.913780977515583e+17, "-191378097751558335.9150", "%5.4f",
-__LINE__, -1.917095456962182e-10, "-2E-10", "%4.G",
-__LINE__, -1.918803033972851e+23, "-191880303397285132405158.947222", "%f",
-__LINE__, -1.926420984801848e+16, "-19264209848018483.128840", "%+f",
-__LINE__, -1.931905465942639e-10, "-1.93191e-10", "%g",
-__LINE__, -1.932907105840252e+06, "-1.932907e+06", "%+#e",
-__LINE__, -1.933091601918916e+15, "-1.933092E+15", "%#E",
-__LINE__, -1.934296184983361e+09, "-1.9343e+09", "%1.6g",
-__LINE__, -1.934637311832448e+11, "-1.93464e+11", "%+g",
-__LINE__, -1.936201483262186e+12, "-2e+12", "%+6.g",
-__LINE__, -1.939114661603911e+19, "-1.93911E+19", "%G",
-__LINE__, -1.940478182124347e-13, "-0.000000", "%f",
-__LINE__, -1.943218220654923e+08, "-2E+08", "%+5.0G",
-__LINE__, -1.943526872455779e-30, "-1.9E-30", "%.1E",
-__LINE__, -1.949869164681357e+19, "-1.949869e+19", "%#3e",
-__LINE__, -1.954181060535402e+23, "-1.954181e+23", "%e",
-__LINE__, -1.961581555579142e+14, "-1.962E+14", "%.3E",
-__LINE__, -1.964535562036915e+07, "-1.96454E+07", "%G",
-__LINE__, -1.969749653575926e+04, "-19697.5", "%.6g",
-__LINE__, -1.973475369169053e+15, "-1.97348e+15", "%g",
-__LINE__, -1.975658532866600e-21, "-2e-21", "%+1.2g",
-__LINE__, -1.984050343831260e+09, "-1.984050E+09", "%E",
-__LINE__, -1.984422410018571e+12, "-1.984422e+12", "%+4.7g",
-__LINE__, -1.984878687667223e-22, "-0.000000", "%f",
-__LINE__, -1.986116930967811e-28, "-1.98612e-28", "%g",
-__LINE__, -1.986774457812683e+02, "-1.986774e+02", "%e",
-__LINE__, -1.987274814938726e-04, "-0.000198727", "%g",
-__LINE__, -1.987319200580415e+10, "-1.987319E+10", "%E",
-__LINE__, -1.987980768698114e-19, "-0.000000", "%3f",
-__LINE__, -1.994698965044602e-29, "-2E-29", "%+4.0G",
-__LINE__, -1.997833122667050e+26, "-1.99783E+26", "%G",
-__LINE__, -1.999453681184129e-10, "-0.00000", "%.5f",
-__LINE__, -1.999897345839745e-16, "-1.9999e-16", "%g",
-__LINE__, -2.003703825123989e-22, "-0.000000", "%f",
-__LINE__, -2.004569188274957e-23, "-2.00457E-23", "%G",
-__LINE__, -2.005911883189058e+07, "-2.00591E+07", "%G",
-__LINE__, -2.006438312005722e-25, "-2.006e-25", "%0.4g",
-__LINE__, -2.017322171210280e+18, "-2.01732E+18", "%+0G",
-__LINE__, -2.017718635819594e-06, "-2.01772e-06", "%5g",
-__LINE__, -2.019187445568160e-12, "-0.00", "%.2f",
-__LINE__, -2.021022665608503e+25, "-20210226656085028551501636.684", "%2.3f",
-__LINE__, -2.022720393474145e+07, "-2.02272E+07", "%#G",
-__LINE__, -2.024506694471065e+23, "-2.02451E+23", "%G",
-__LINE__, -2.024884686553821e-15, " -2e-15", "%7.g",
-__LINE__, -2.027484636128966e-23, "-2.0275E-23", "%.5G",
-__LINE__, -2.028185530467237e+21, "-2028185530467237374097.067", "%+4.3f",
-__LINE__, -2.028388905566873e-09, "-0.000000", "%f",
-__LINE__, -2.029856507431584e-17, "-2.02986E-17", "%G",
-__LINE__, -2.029891733449167e+27, "-2029891733449166846270372843.7190875", "%3.7f",
-__LINE__, -2.031933616694469e+14, "-2.031934E+14", "%#E",
-__LINE__, -2.034011738471413e-10, "-2.03401E-10", "%#G",
-__LINE__, -2.036087355975756e+29, "-203608735597575574161055556032.806635", "%+f",
-__LINE__, -2.036355025137273e+09, "-2.036355E+09", "%#.7G",
-__LINE__, -2.038423730536878e+12, "-2E+12", "%4.G",
-__LINE__, -2.045209202278810e+23, "-2.045209e+23", "%+#e",
-__LINE__, -2.046794083517423e-06, "-2.04679e-06", "%g",
-__LINE__, -2.048042459678599e-19, "-0.000000", "%f",
-__LINE__, -2.050526462096153e+18, "-2.05053e+18", "%+g",
-__LINE__, -2.053583900249402e+13, "-2.053584e+13", "%0.7g",
-__LINE__, -2.054342100957522e-23, "-2.05434E-23", "%#G",
-__LINE__, -2.054793400141025e+11, "-205479340014.1", "%+2.1f",
-__LINE__, -2.059200689196498e-11, "-0.000000", "%#f",
-__LINE__, -2.060960692728114e-16, "-0.000000", "%+f",
-__LINE__, -2.061417528654300e-30, "-2.06E-30", "%.3G",
-__LINE__, -2.061513401198340e-29, "-2.06151e-29", "%7g",
-__LINE__, -2.061846698845984e+27, "-2.061847E+27", "%E",
-__LINE__, -2.063922242876789e-19, "-2.06392e-19", "%#g",
-__LINE__, -2.065359431805529e+03, "-2065.359432", "%f",
-__LINE__, -2.065529069992156e-04, "-0.000206553", "%+G",
-__LINE__, -2.066082546490980e-25, "-2.06608e-25", "%5g",
-__LINE__, -2.068394312095200e+17, "-2.068394e+17", "%e",
-__LINE__, -2.071024178556425e-10, "-2.07102E-10", "%G",
-__LINE__, -2.074401605950382e-22, "-2.07e-22", "%1.3g",
-__LINE__, -2.074731895144874e-26, "-2.07473E-26", "%G",
-__LINE__, -2.074895800882730e+18, "-2074895800882730068.082083", "%+f",
-__LINE__, -2.077336220500764e-30, "-0", "%2.f",
-__LINE__, -2.078067878561077e+09, "-2.0781e+09", "%0.5g",
-__LINE__, -2.080497889634533e+15, "-2.080498E+15", "%4E",
-__LINE__, -2.084717279367594e-21, "-2.08472e-21", "%+g",
-__LINE__, -2.087827915301948e+29, "-2E+29", "%6.1G",
-__LINE__, -2.090268686389680e+05, "-2.090269e+05", "%1e",
-__LINE__, -2.092036176589720e+24, "-2.09204e+24", "%+g",
-__LINE__, -2.093546373938615e-21, "-2.093546e-21", "%#e",
-__LINE__, -2.101302069316682e+18, "-2.1013e+18", "%+7g",
-__LINE__, -2.103463622286002e-13, "-2.103464E-13", "%E",
-__LINE__, -2.105622845016732e+06, "-2105622.845017", "%1f",
-__LINE__, -2.109999123037767e+28, "-2.11E+28", "%.2E",
-__LINE__, -2.110317013992166e+04, "-21103.2", "%+g",
-__LINE__, -2.112226142154618e+21, "-2112226142154617569702.", "%#6.f",
-__LINE__, -2.112519484486528e+06, "-2.11252E+06", "%G",
-__LINE__, -2.113439260812000e+23, "-2E+23", "%1.G",
-__LINE__, -2.113465893194608e-15, "-2.1135E-15", "%.5G",
-__LINE__, -2.113547784669409e+20, "-2.1135e+20", "%2.5g",
-__LINE__, -2.114146001321822e+28, "-2.114146e+28", "%e",
-__LINE__, -2.114509425574444e-30, " -0", "%4.f",
-__LINE__, -2.114887421659561e-21, "-0.000000", "%+f",
-__LINE__, -2.121120215127601e+21, "-2121120215127601404958.5683097", "%.7f",
-__LINE__, -2.122555390665796e+06, "-2E+06", "%0.G",
-__LINE__, -2.123468430242052e-27, "-0.000000", "%+f",
-__LINE__, -2.123473598890635e+28, "-2.12347e+28", "%+g",
-__LINE__, -2.124328049748190e-04, "-2.124328E-04", "%E",
-__LINE__, -2.125633890999010e+28, "-2E+28", "%+5.G",
-__LINE__, -2.125697963566045e+21, "-2.1257E+21", "%0G",
-__LINE__, -2.127638109230109e+06, "-2.12764e+06", "%+6g",
-__LINE__, -2.128456114617786e+07, "-2.128456E+07", "%E",
-__LINE__, -2.128732742932824e-04, "-2.128733E-04", "%#E",
-__LINE__, -2.129654381588404e+27, "-2129654381588404365999167566.7697564", "%+.7f",
-__LINE__, -2.129792795009985e+20, "-2.12979e+20", "%g",
-__LINE__, -2.131026925664619e-20, "-2e-20", "%.0e",
-__LINE__, -2.132860730144188e-04, "-0.0002", "%5.g",
-__LINE__, -2.133620979309562e+06, "-2e+06", "%3.e",
-__LINE__, -2.133821423139120e-27, "-2.13382E-27", "%.6G",
-__LINE__, -2.134253401425940e-07, "-0.000000", "%f",
-__LINE__, -2.135469568156964e-29, "-2.135470E-29", "%+7E",
-__LINE__, -2.135723595288365e-25, "-0.0", "%.1f",
-__LINE__, -2.137642458920094e-09, "-2.13764e-09", "%g",
-__LINE__, -2.143412361116583e+12, "-2.14341e+12", "%+g",
-__LINE__, -2.144467087741129e-17, "-2.14447e-17", "%+g",
-__LINE__, -2.145726966596964e-11, "-0.000000", "%2f",
-__LINE__, -2.148318753042597e+08, "-2.14832E+08", "%5G",
-__LINE__, -2.149932310549644e-19, "-2.14993e-19", "%g",
-__LINE__, -2.150050917377646e-21, " -0", "%3.f",
-__LINE__, -2.150854313643430e-16, "-0.000000", "%.6f",
-__LINE__, -2.151071797121845e+00, "-2.15107", "%+g",
-__LINE__, -2.158728406865981e+14, "-215872840686598.088666", "%7f",
-__LINE__, -2.166062878011641e-23, "-2.166063e-23", "%e",
-__LINE__, -2.167045002060684e+12, "-2.167045E+12", "%E",
-__LINE__, -2.173752581051530e+20, "-217375258105153035259.604621", "%f",
-__LINE__, -2.175599129057555e+24, "-2.175599E+24", "%E",
-__LINE__, -2.176564454093042e-02, "-0.0217656", "%+G",
-__LINE__, -2.181270774327071e-12, "-0.000000", "%#1f",
-__LINE__, -2.184404769844158e-09, "-2.2E-09", "%+.2G",
-__LINE__, -2.184881476334310e-07, "-2.18488e-07", "%g",
-__LINE__, -2.189197211449684e-11, "-2E-11", "%.0G",
-__LINE__, -2.189451286805190e+20, "-218945128680519029984", "%3.f",
-__LINE__, -2.190642494146884e-27, " -0.", "%#4.f",
-__LINE__, -2.194727956725854e+06, "-2.19E+06", "%.3G",
-__LINE__, -2.196145868303877e+11, "-219614586830.387726", "%+5f",
-__LINE__, -2.196397972262690e-16, "-0.000000", "%3f",
-__LINE__, -2.202692843474668e-01, "-2.203e-01", "%.3e",
-__LINE__, -2.204528684782451e-21, "-2.20453E-21", "%G",
-__LINE__, -2.214926838821340e-16, "-2e-16", "%+2.g",
-__LINE__, -2.215558986352773e+18, "-2215558986352773374", "%0.f",
-__LINE__, -2.216976693056186e+27, "-2216976693056186498154147557.215765", "%f",
-__LINE__, -2.217348422793322e+13, "-2.21735E+13", "%6G",
-__LINE__, -2.217732695583920e-07, "-0", "%.0f",
-__LINE__, -2.221185494767834e-14, "-2.22119e-14", "%g",
-__LINE__, -2.224557193699609e-16, "-2.224557E-16", "%E",
-__LINE__, -2.227417758704028e-18, "-0.000000", "%0f",
-__LINE__, -2.231261655673006e-30, "-2.231262E-30", "%E",
-__LINE__, -2.233081938836160e+21, "-2233081938836160240668.960", "%+6.3f",
-__LINE__, -2.233158918439853e+05, "-223316", "%2G",
-__LINE__, -2.233802298007898e-30, "-2.2338E-30", "%2G",
-__LINE__, -2.233864858404732e+17, "-223386485840473181.241350", "%f",
-__LINE__, -2.241242805107749e+14, "-2.24124E+14", "%G",
-__LINE__, -2.244555498855249e+25, "-2.24456E+25", "%#G",
-__LINE__, -2.248170665127481e-07, "-2.248171E-07", "%E",
-__LINE__, -2.252558275567388e-13, "-2.25256e-13", "%g",
-__LINE__, -2.256190083496001e+13, "-22561900834960.0136398", "%7.7f",
-__LINE__, -2.259851596715945e+27, "-2.259852e+27", "%e",
-__LINE__, -2.260461480001174e-21, "-0.000000", "%f",
-__LINE__, -2.264128628428577e+22, "-2.26413e+22", "%1g",
-__LINE__, -2.265914518399595e-04, "-0.000226591", "%G",
-__LINE__, -2.266251557092826e+23, "-2.26625e+23", "%g",
-__LINE__, -2.268592252572450e+19, "-2.268592e+19", "%2.6e",
-__LINE__, -2.268597523847349e+11, "-2.2686e+11", "%g",
-__LINE__, -2.268963106935546e+05, "-226896", "%+g",
-__LINE__, -2.272527876808919e-24, "-0.000000", "%#f",
-__LINE__, -2.273366440479073e+02, "-227.337", "%g",
-__LINE__, -2.277858038556191e+25, "-2.28E+25", "%0.3G",
-__LINE__, -2.282019915623415e+25, "-2E+25", "%5.E",
-__LINE__, -2.283333247435650e-27, " -0", "%4.f",
-__LINE__, -2.285230610829355e+23, "-2E+23", "%2.G",
-__LINE__, -2.290900253402985e+23, "-2.2909E+23", "%G",
-__LINE__, -2.293266953268186e+08, "-2.29327e+08", "%g",
-__LINE__, -2.293489603164786e+23, "-229348960316478578391752.3076525", "%4.7f",
-__LINE__, -2.294434667605481e+15, "-2.2944E+15", "%.5G",
-__LINE__, -2.296607768466765e+21, "-2.29661E+21", "%G",
-__LINE__, -2.297449967994012e+14, "-229744996799401.23542", "%+.5f",
-__LINE__, -2.301162556466583e-01, "-0.230116", "%+#2g",
-__LINE__, -2.301676246374004e+05, "-230168.", "%#g",
-__LINE__, -2.301976724487835e-01, "-0.230198", "%5G",
-__LINE__, -2.303269770571222e-15, "-2.303270e-15", "%.6e",
-__LINE__, -2.306451480495636e+23, "-2.30645E+23", "%G",
-__LINE__, -2.307659351219690e-17, "-0.000000", "%+3f",
-__LINE__, -2.309009762339430e+16, "-2.30901E+16", "%G",
-__LINE__, -2.309261751862100e+06, "-2309261.751862", "%+f",
-__LINE__, -2.309504876918634e-26, " -2E-26", "%7.E",
-__LINE__, -2.310910348147804e-26, "-2e-26", "%5.g",
-__LINE__, -2.317173552252235e+05, "-231717.4", "%.7g",
-__LINE__, -2.319517289618469e-23, "-2.31952E-23", "%+G",
-__LINE__, -2.320103195142527e+08, "-2.320103E+08", "%+E",
-__LINE__, -2.323523032125633e+24, "-2323523032125633491773442.07419", "%.5f",
-__LINE__, -2.326279126614399e-16, "-0.000000", "%f",
-__LINE__, -2.331393688620925e-09, "-2.33139e-09", "%#g",
-__LINE__, -2.334233527512469e+01, " -23", "%6.0f",
-__LINE__, -2.337418834112767e+24, " -2E+24", "%7.E",
-__LINE__, -2.339455293612118e+12, "-2339455293612.1", "%+.1f",
-__LINE__, -2.341930318143367e-18, "-2.E-18", "%#4.E",
-__LINE__, -2.346107614950921e-17, "-0.00000", "%+2.5f",
-__LINE__, -2.348356578807972e+23, "-2.34836e+23", "%g",
-__LINE__, -2.351485855138244e+19, "-2.351486e+19", "%+e",
-__LINE__, -2.362101647639198e-15, "-2.36210e-15", "%#g",
-__LINE__, -2.369743873030115e+08, "-2e+08", "%.1g",
-__LINE__, -2.371658164739356e+25, "-23716581647393559784120498.079574", "%f",
-__LINE__, -2.372427847607163e+28, "-2.37243E+28", "%G",
-__LINE__, -2.375465465294647e+11, "-2.375465e+11", "%e",
-__LINE__, -2.377128971572195e-18, "-0.0", "%1.1f",
-__LINE__, -2.380322448568089e-13, "-2.38032E-13", "%+#0G",
-__LINE__, -2.385960728264882e+26, "-2E+26", "%.0E",
-__LINE__, -2.387345744004747e+00, "-2.38735", "%G",
-__LINE__, -2.390480023300201e+25, "-2.39048e+25", "%g",
-__LINE__, -2.395420431930886e+23, "-2E+23", "%2.E",
-__LINE__, -2.401144663870969e-10, "-2.e-10", "%#6.g",
-__LINE__, -2.402787441215039e-08, "-2.40279e-08", "%g",
-__LINE__, -2.402990830425278e+08, "-2.40299E+08", "%G",
-__LINE__, -2.404213682932215e+08, "-2.40421e+08", "%2g",
-__LINE__, -2.409385592298822e+21, "-2409385592298821876511.283335", "%7f",
-__LINE__, -2.410798267658614e+13, "-2.4108e+13", "%+g",
-__LINE__, -2.413180068271811e-24, "-0.000000", "%+f",
-__LINE__, -2.413268457113495e+26, "-2.41327E+26", "%3.6G",
-__LINE__, -2.415341832206007e-13, "-0.000000", "%+f",
-__LINE__, -2.422519577068670e-08, "-0.0000000", "%.7f",
-__LINE__, -2.422533651282808e+20, "-2.42253E+20", "%#G",
-__LINE__, -2.422795006880671e+17, "-2.4228e+17", "%g",
-__LINE__, -2.423483330202008e+20, "-2.42348e+20", "%g",
-__LINE__, -2.431756009640369e-04, "-0.000243176", "%+#3g",
-__LINE__, -2.431878622534173e-05, "-0.000024", "%f",
-__LINE__, -2.432012113077180e+24, "-2.43201e+24", "%g",
-__LINE__, -2.433843704470487e+07, "-24338437", "%4.f",
-__LINE__, -2.435475755031956e+11, "-2.435476E+11", "%1E",
-__LINE__, -2.438081888695437e-13, "-0.000000", "%f",
-__LINE__, -2.438334590462860e+10, "-2.4E+10", "%5.2G",
-__LINE__, -2.440223135334059e+17, "-2.44022e+17", "%g",
-__LINE__, -2.444107281115317e-21, "-2.44411e-21", "%+g",
-__LINE__, -2.444582273206171e-02, " -0.02", "%7.G",
-__LINE__, -2.445234676352794e+23, "-2.44523e+23", "%#g",
-__LINE__, -2.449185020984714e+08, "-2.E+08", "%#2.G",
-__LINE__, -2.450646640466020e+22, "-2.45065E+22", "%5G",
-__LINE__, -2.456840850262473e+13, "-24568408502625", "%0.f",
-__LINE__, -2.464466865714499e-10, "-2e-10", "%6.g",
-__LINE__, -2.466022088999151e+27, "-2.46602E+27", "%G",
-__LINE__, -2.484398113119779e-04, "-2.484398E-04", "%E",
-__LINE__, -2.484591850456328e+23, "-248459185045632846566832.085955", "%+f",
-__LINE__, -2.488166252162446e-11, "-2.5E-11", "%4.2G",
-__LINE__, -2.493507313049390e+24, "-2.49E+24", "%4.3G",
-__LINE__, -2.500280281988428e+28, "-2.5E+28", "%.4G",
-__LINE__, -2.500373956445372e-07, "-2.50037e-07", "%g",
-__LINE__, -2.505566434769299e-12, "-2.5E-12", "%+#0.2G",
-__LINE__, -2.508215917020758e+05, "-2.508216e+05", "%5e",
-__LINE__, -2.519368094680315e-29, "-2.51937e-29", "%#0g",
-__LINE__, -2.522266530587753e-11, "-2.52227e-11", "%+g",
-__LINE__, -2.534492886372514e-06, "-2.53449E-06", "%0G",
-__LINE__, -2.534617610955074e-02, "-0.03", "%0.2f",
-__LINE__, -2.540551642835634e+26, "-3E+26", "%4.G",
-__LINE__, -2.548210731830516e-26, "-0.000", "%2.3f",
-__LINE__, -2.558868082397931e-11, "-3E-11", "%2.E",
-__LINE__, -2.560062512991052e+11, "-2.56006E+11", "%+G",
-__LINE__, -2.561274682814428e-05, "-0.000026", "%f",
-__LINE__, -2.563424949397357e-02, " -0", "%6.f",
-__LINE__, -2.577010939931465e+17, "-2.57701E+17", "%G",
-__LINE__, -2.578224879294822e+10, "-3E+10", "%+4.1G",
-__LINE__, -2.585655636750244e+13, "-2.585656e+13", "%+0.7g",
-__LINE__, -2.585657986834408e+14, "-2.5857e+14", "%3.5g",
-__LINE__, -2.586728929368101e+02, "-258.673", "%+g",
-__LINE__, -2.591293023229468e+06, "-2591293.0232295", "%2.7f",
-__LINE__, -2.592454222603538e-06, "-2.59245E-06", "%G",
-__LINE__, -2.599399905869649e+02, "-259.939991", "%f",
-__LINE__, -2.605382860307596e+12, "-2.60538E+12", "%2G",
-__LINE__, -2.607507689402762e-01, "-0.260751", "%#.6g",
-__LINE__, -2.612933252582967e+15, "-2.61293e+15", "%g",
-__LINE__, -2.614337505491483e-14, "-2.61434E-14", "%.6G",
-__LINE__, -2.618302263333671e+14, "-2.62e+14", "%3.3g",
-__LINE__, -2.622998533972296e+00, "-3.", "%#0.g",
-__LINE__, -2.623348319869643e-15, "-2.62335E-15", "%#G",
-__LINE__, -2.626703132693163e+23, "-3E+23", "%+6.E",
-__LINE__, -2.629610853765779e+25, "-2.62961E+25", "%+#G",
-__LINE__, -2.632993880472784e+26, "-2.63299E+26", "%G",
-__LINE__, -2.635651112327873e-20, "-2.63565E-20", "%1G",
-__LINE__, -2.636003980473492e-23, "-2.636E-23", "%G",
-__LINE__, -2.639316453244009e+10, "-26393164532.440094", "%#f",
-__LINE__, -2.640517223417942e-28, "-2.641e-28", "%.3e",
-__LINE__, -2.640625797147664e-22, "-2.640626E-22", "%E",
-__LINE__, -2.644401262524378e-12, " -0.000", "%7.3f",
-__LINE__, -2.651033203243637e-14, "-2.651033e-14", "%+e",
-__LINE__, -2.652386470126594e-24, "-2.652386E-24", "%E",
-__LINE__, -2.654281018623631e-12, "-0.00000", "%6.5f",
-__LINE__, -2.655529742118827e+02, "-265.552974", "%f",
-__LINE__, -2.658550833241620e+22, "-26585508332416196708436.473273", "%+f",
-__LINE__, -2.660515890519100e+08, "-2.660516E+08", "%E",
-__LINE__, -2.665025749266086e-24, "-2.66503E-24", "%G",
-__LINE__, -2.666117105643095e-20, "-2.66612e-20", "%g",
-__LINE__, -2.667051347741259e+11, "-3e+11", "%6.g",
-__LINE__, -2.667207607243375e+04, "-26672.076072", "%+#f",
-__LINE__, -2.667631877167590e+26, "-2.667632E+26", "%E",
-__LINE__, -2.673817942962878e+13, "-2.673818e+13", "%+2.6e",
-__LINE__, -2.674972907853507e+20, "-2.674973E+20", "%E",
-__LINE__, -2.675830887404867e+14, "-2.675831E+14", "%E",
-__LINE__, -2.682749918168908e+26, "-2.682750E+26", "%E",
-__LINE__, -2.689222801942679e-03, "-0.0027", "%7.2G",
-__LINE__, -2.692245629411156e+25, "-2.69225e+25", "%g",
-__LINE__, -2.692606702464273e+11, "-2.69261e+11", "%g",
-__LINE__, -2.693070822061136e-27, "-2.69307e-27", "%+g",
-__LINE__, -2.694415515655336e-30, "-3E-30", "%+3.0E",
-__LINE__, -2.694770057384739e+15, "-2.69477e+15", "%g",
-__LINE__, -2.699998392329361e+01, "-27", "%+.2g",
-__LINE__, -2.700151952281511e+23, "-270015195228151050343968.", "%+#5.f",
-__LINE__, -2.707398527302841e-08, "-2.70740e-08", "%+#3g",
-__LINE__, -2.711404950850030e-21, "-2.71E-21", "%.2E",
-__LINE__, -2.714057739024281e-10, "-2.714e-10", "%.4g",
-__LINE__, -2.717657632815414e-10, "-2.71766e-10", "%g",
-__LINE__, -2.720875786430592e-09, "-2.7E-09", "%6.2G",
-__LINE__, -2.725886730997891e+19, "-2.72589e+19", "%g",
-__LINE__, -2.726089169748676e-09, "-2.72609E-09", "%+G",
-__LINE__, -2.732907572038661e-30, "-2.73291E-30", "%G",
-__LINE__, -2.737918050958789e+11, "-3e+11", "%1.g",
-__LINE__, -2.739024251198484e-18, "-2.73902e-18", "%+g",
-__LINE__, -2.742646144452305e+13, "-2.74265e+13", "%g",
-__LINE__, -2.742911865386719e+06, "-3E+06", "%+5.G",
-__LINE__, -2.759159275123811e-30, "-0.000000", "%+f",
-__LINE__, -2.759794813930001e-21, "-2.75979e-21", "%+g",
-__LINE__, -2.763243077558348e+20, "-2.7632E+20", "%+0.4E",
-__LINE__, -2.770348477810209e-14, "-0.000000", "%2f",
-__LINE__, -2.776074766292453e+05, "-277607", "%g",
-__LINE__, -2.776610811432007e-07, "-2.77661E-07", "%6G",
-__LINE__, -2.778673793270678e+23, "-3E+23", "%+4.E",
-__LINE__, -2.782405168708350e+08, "-278240516.87084", "%.5f",
-__LINE__, -2.783316149365198e-09, "-3E-09", "%5.0G",
-__LINE__, -2.785436703085409e-27, "-2.78544E-27", "%#G",
-__LINE__, -2.787479051660640e+21, "-2.78748e+21", "%g",
-__LINE__, -2.789445406042450e-03, "-0.002789", "%+f",
-__LINE__, -2.791104581836077e+05, "-279110.4581836", "%+7.7f",
-__LINE__, -2.802078617775784e+04, "-28020.786", "%0.3f",
-__LINE__, -2.804954315579055e+20, "-2.80495E+20", "%G",
-__LINE__, -2.806575341862696e-05, "-2.80658E-05", "%G",
-__LINE__, -2.807769556900402e-06, "-0.000003", "%+#f",
-__LINE__, -2.808882056357941e-12, "-0.0", "%.1f",
-__LINE__, -2.809386677339924e+10, "-2.8094E+10", "%6.5G",
-__LINE__, -2.818404311437694e+19, "-3E+19", "%6.G",
-__LINE__, -2.819463285551660e+01, "-28.1946", "%+G",
-__LINE__, -2.821428853207724e-16, "-3e-16", "%6.g",
-__LINE__, -2.824452750788444e+07, "-3e+07", "%+2.g",
-__LINE__, -2.825430381094971e+28, "-3e+28", "%+.0e",
-__LINE__, -2.830010928384944e-17, "-0", "%.0f",
-__LINE__, -2.832505114479680e-09, "-0.000000", "%f",
-__LINE__, -2.833246604950796e+13, "-2.83325E+13", "%G",
-__LINE__, -2.833274073265017e+13, "-28332740732650.174564", "%f",
-__LINE__, -2.835842581787797e+07, "-2.83584E+07", "%2G",
-__LINE__, -2.839758384681983e-07, "-2.83976E-07", "%.6G",
-__LINE__, -2.841077022753766e-09, "-3E-09", "%0.1G",
-__LINE__, -2.845307294930682e+00, "-2.845307e+00", "%+1e",
-__LINE__, -2.847420163874243e+19, "-2.8e+19", "%1.2g",
-__LINE__, -2.848133715109881e-25, "-2.848134E-25", "%E",
-__LINE__, -2.850208101288058e-06, "-2.8502E-06", "%+5.4E",
-__LINE__, -2.853666525870413e+04, "-28536.665259", "%f",
-__LINE__, -2.855661543202034e+21, "-2.85566e+21", "%g",
-__LINE__, -2.859528889324159e-08, "-2.859529e-08", "%3e",
-__LINE__, -2.860545310690251e+29, "-3e+29", "%.1g",
-__LINE__, -2.863576633666884e-14, "-2.863577e-14", "%+5e",
-__LINE__, -2.864115740396321e-14, "-2.86412e-14", "%g",
-__LINE__, -2.864481979037153e+20, "-2.86E+20", "%3.3G",
-__LINE__, -2.867582970177984e-18, "-0.000000", "%f",
-__LINE__, -2.868237707901564e+25, "-3E+25", "%6.E",
-__LINE__, -2.871741071402520e+13, "-3e+13", "%.1g",
-__LINE__, -2.873724610073364e+18, "-2873724610073364438.278531", "%+#f",
-__LINE__, -2.876433859770866e-25, "-2.87643e-25", "%g",
-__LINE__, -2.877458587075737e-08, "-2.877E-08", "%+.4G",
-__LINE__, -2.883349842927101e+24, "-2.883350E+24", "%2E",
-__LINE__, -2.883749925642885e+09, "-2.883750e+09", "%e",
-__LINE__, -2.883773835633003e-17, "-0.000000", "%+f",
-__LINE__, -2.890389090491409e+24, "-2890389090491409262995148.310438", "%#1f",
-__LINE__, -2.900848552225810e-11, "-0.000000", "%+f",
-__LINE__, -2.911942123176400e+25, "-29119421231764004431852300", "%0.f",
-__LINE__, -2.912904462180751e-18, "-2.9129E-18", "%6G",
-__LINE__, -2.917717875075651e+26, "-3e+26", "%0.e",
-__LINE__, -2.922293201084093e-26, "-2.922293E-26", "%E",
-__LINE__, -2.925070319932451e-30, "-0.000000", "%f",
-__LINE__, -2.926558572870874e+15, "-2.926559E+15", "%E",
-__LINE__, -2.928781435877896e+26, "-2.928781e+26", "%+e",
-__LINE__, -2.930178318110376e+28, "-2.930178E+28", "%E",
-__LINE__, -2.930984661925819e+05, "-293098.5", "%.7G",
-__LINE__, -2.932762424932762e-08, "-0.000000", "%#f",
-__LINE__, -2.933415597492494e+10, "-29334155974.924943", "%+#2f",
-__LINE__, -2.933564314850986e+29, "-2.93356E+29", "%7G",
-__LINE__, -2.943224907893795e+10, "-2.943225E+10", "%+7E",
-__LINE__, -2.945311540471221e+19, "-2.94531E+19", "%#G",
-__LINE__, -2.945812356522847e+15, "-2.94581e+15", "%+g",
-__LINE__, -2.945836999630957e+00, "-2.945837E+00", "%E",
-__LINE__, -2.947798782726622e-01, "-0.29478", "%+g",
-__LINE__, -2.948958405827917e+18, "-2.94896e+18", "%g",
-__LINE__, -2.949790871798059e-11, "-2.94979E-11", "%G",
-__LINE__, -2.950347806125225e-12, "-2.95035e-12", "%g",
-__LINE__, -2.952781884599368e-29, "-2.952782E-29", "%+E",
-__LINE__, -2.956801341442716e+06, "-2.9568E+06", "%G",
-__LINE__, -2.957469310356540e-07, "-0.000", "%1.3f",
-__LINE__, -2.960464869534870e-23, "-2.96046E-23", "%G",
-__LINE__, -2.962339381825446e-07, "-0", "%1.f",
-__LINE__, -2.971013180028710e+22, "-2.971e+22", "%3.5g",
-__LINE__, -2.975167862441254e+07, "-2.97517e+07", "%g",
-__LINE__, -2.976018424339993e+16, "-2.976018e+16", "%3e",
-__LINE__, -2.979173094835454e+29, "-2.97917E+29", "%G",
-__LINE__, -2.983135249987541e-03, "-0.00298314", "%+G",
-__LINE__, -2.985142444917919e-24, "-2.985142E-24", "%+#7E",
-__LINE__, -2.988680953635159e-14, "-0.0000000", "%2.7f",
-__LINE__, -2.989629778079379e+04, "-29896.297781", "%f",
-__LINE__, -2.991274275137276e+19, "-29912742751372762839.423558", "%+4f",
-__LINE__, -2.991286396006024e-06, "-2.99129e-06", "%4g",
-__LINE__, -2.993310397844811e+04, "-2.993310E+04", "%3.6E",
-__LINE__, -2.994669852410861e-29, "-2.99467E-29", "%G",
-__LINE__, -2.996082093034831e+27, "-2.996082e+27", "%1e",
-__LINE__, -2.999783904575110e+16, "-2.999784E+16", "%#E",
-__LINE__, -3.012019221956988e+25, "-3.012019E+25", "%E",
-__LINE__, -3.014211917706622e-25, "-0.000000", "%+f",
-__LINE__, -3.015149723683428e-19, "-3.01515E-19", "%G",
-__LINE__, -3.022158478004638e-19, "-3.02216e-19", "%6g",
-__LINE__, -3.022825518373900e-12, "-3.0228E-12", "%+.4E",
-__LINE__, -3.025108924057340e-19, "-0.000000", "%f",
-__LINE__, -3.026316824631967e+24, "-3026316824631966717618070.106255", "%1f",
-__LINE__, -3.033074643529623e-13, "-3.03307e-13", "%g",
-__LINE__, -3.035292960731141e+24, "-3035292960731141409524980.190326", "%f",
-__LINE__, -3.043291272956732e-13, "-3.04329e-13", "%#g",
-__LINE__, -3.045216723973715e-23, "-3.045e-23", "%.4g",
-__LINE__, -3.047140976048835e+09, "-3.04714E+09", "%3.5E",
-__LINE__, -3.047680278470886e+09, "-3.047680E+09", "%#E",
-__LINE__, -3.048465807963461e+05, "-304847", "%g",
-__LINE__, -3.050904753556756e+22, "-3.0509E+22", "%G",
-__LINE__, -3.052845748999047e-13, "-3.05285e-13", "%g",
-__LINE__, -3.053395231883620e-06, "-3E-06", "%2.G",
-__LINE__, -3.054894203375445e-28, "-3e-28", "%2.g",
-__LINE__, -3.055080347760755e-13, "-0", "%2.f",
-__LINE__, -3.055513037393624e-29, "-3e-29", "%3.g",
-__LINE__, -3.056198778208295e-06, "-3.0562e-06", "%g",
-__LINE__, -3.057813660266980e-21, "-3E-21", "%1.G",
-__LINE__, -3.059687036330998e-11, "-3.1E-11", "%#2.2G",
-__LINE__, -3.061450385559094e-10, "-3.06145E-10", "%G",
-__LINE__, -3.066605713361383e-27, "-0.000000", "%f",
-__LINE__, -3.071590110813156e+22, "-3.07159E+22", "%G",
-__LINE__, -3.073253864426931e+26, "-3.0733E+26", "%.5G",
-__LINE__, -3.078998328596940e+07, "-3.079e+07", "%5.4g",
-__LINE__, -3.082733887951920e+06, "-3.082734e+06", "%+6e",
-__LINE__, -3.084365358064710e+24, "-3.084365E+24", "%#E",
-__LINE__, -3.086948022123716e+25, "-30869480221237162176350921.072299", "%+f",
-__LINE__, -3.088200214218024e-10, "-0", "%0.f",
-__LINE__, -3.093442983942874e+08, "-309344298.394287", "%f",
-__LINE__, -3.103573455403534e-09, "-3.103573E-09", "%#E",
-__LINE__, -3.109178443120997e+07, "-31091784.431210", "%f",
-__LINE__, -3.111494549914917e+28, "-3e+28", "%0.g",
-__LINE__, -3.113384020517480e-17, " -0", "%+6.f",
-__LINE__, -3.121622779718055e+14, "-312162277971805.491", "%+.3f",
-__LINE__, -3.122780443843900e-01, "-0.312278", "%#g",
-__LINE__, -3.122952438335638e-25, "-3.122952E-25", "%E",
-__LINE__, -3.128970339463168e-18, "-3e-18", "%3.g",
-__LINE__, -3.130862507719335e+10, "-3.130863e+10", "%3e",
-__LINE__, -3.145960838955379e+03, "-3145.96", "%g",
-__LINE__, -3.149362645138929e+21, "-3.14936e+21", "%g",
-__LINE__, -3.150697168664913e+26, "-315069716866491322804222363.629378", "%+f",
-__LINE__, -3.157946785041287e+05, "-3.1579e+05", "%.4e",
-__LINE__, -3.158347006986809e-02, "-3.E-02", "%#.0E",
-__LINE__, -3.159542871923388e+07, "-31595429", "%2.f",
-__LINE__, -3.169997512351985e+15, "-3.169998E+15", "%6.7G",
-__LINE__, -3.170971776544746e+07, "-31709717.765447", "%f",
-__LINE__, -3.173246079104466e+19, "-3.173246E+19", "%1E",
-__LINE__, -3.173581228658553e-02, "-0.03", "%+0.G",
-__LINE__, -3.187598864929850e-07, "-3.18760E-07", "%#G",
-__LINE__, -3.190525302270244e+08, "-3.190525e+08", "%+0.7g",
-__LINE__, -3.191879884186422e+19, "-3.19E+19", "%.2E",
-__LINE__, -3.197292604744926e+02, "-3.197293e+02", "%+e",
-__LINE__, -3.203713337688838e-12, "-3.20371E-12", "%6G",
-__LINE__, -3.204416889544914e-18, "-0.000000", "%+f",
-__LINE__, -3.204494471917096e+09, "-3.20449e+09", "%g",
-__LINE__, -3.211933195516720e+11, "-3.21193E+11", "%G",
-__LINE__, -3.214544021431917e-24, "-0.000000", "%1f",
-__LINE__, -3.215501229487004e-07, "-3e-07", "%3.e",
-__LINE__, -3.232157492322707e-13, "-3.E-13", "%+#5.G",
-__LINE__, -3.239074974455177e-05, "-3.239e-05", "%2.4g",
-__LINE__, -3.243083730801156e-24, "-3.243084e-24", "%#e",
-__LINE__, -3.243128583394124e+07, "-32431285.8339", "%6.4f",
-__LINE__, -3.247997999770571e-08, "-3e-08", "%5.e",
-__LINE__, -3.258251054563991e-15, "-3.2583E-15", "%.5G",
-__LINE__, -3.259499053187446e+07, "-3.2595E+07", "%5.6G",
-__LINE__, -3.261907782031174e+20, "-3.3e+20", "%.2g",
-__LINE__, -3.263979380855122e+29, "-3.26398E+29", "%G",
-__LINE__, -3.264166546402073e+06, "-3.26417E+06", "%5G",
-__LINE__, -3.269357648926951e+01, "-3.E+01", "%#5.G",
-__LINE__, -3.273523287028019e-30, "-3.27352e-30", "%g",
-__LINE__, -3.274464331526264e-14, "-3e-14", "%.0g",
-__LINE__, -3.276647049958546e+05, "-327664.7", "%+.1f",
-__LINE__, -3.276853612008326e-04, "-3.276854e-04", "%e",
-__LINE__, -3.288077788905925e+17, "-3.28808e+17", "%g",
-__LINE__, -3.292054327509010e+21, "-3.29205e+21", "%+g",
-__LINE__, -3.292086868337041e-16, " -0", "%7.f",
-__LINE__, -3.299368070005327e-17, "-3E-17", "%5.G",
-__LINE__, -3.307165537474566e-30, "-3e-30", "%+2.g",
-__LINE__, -3.310556325973673e-17, "-3.31056E-17", "%G",
-__LINE__, -3.315407318453138e-09, "-3.315407e-09", "%+#.6e",
-__LINE__, -3.318402800998018e-09, "-3.3184E-09", "%+G",
-__LINE__, -3.324277622889107e-04, "-0.000332428", "%G",
-__LINE__, -3.326372457131185e+14, "-3.326372e+14", "%0e",
-__LINE__, -3.333300611287597e+18, "-3.3E+18", "%4.2G",
-__LINE__, -3.333608976277018e-25, "-3.33361e-25", "%g",
-__LINE__, -3.333613056182724e-24, "-3.33361e-24", "%.5e",
-__LINE__, -3.338505874378410e-26, "-0.00000", "%.5f",
-__LINE__, -3.339838772519661e+24, "-3.3398E+24", "%0.5G",
-__LINE__, -3.354802735583258e-27, "-3.3548E-27", "%G",
-__LINE__, -3.356542080644329e+15, "-3356542080644329.129058", "%#f",
-__LINE__, -3.360027692463026e-29, "-3.36003e-29", "%+g",
-__LINE__, -3.361845657814323e+06, "-3361845.657814", "%f",
-__LINE__, -3.363135493765816e-12, " -0", "%5.f",
-__LINE__, -3.367383112102258e+19, "-33673831121022579360.158034", "%f",
-__LINE__, -3.376798505037497e+03, "-3376.8", "%+3G",
-__LINE__, -3.388170639372559e+09, "-3.388171e+09", "%+e",
-__LINE__, -3.397304185715499e-12, "-3.397304e-12", "%+e",
-__LINE__, -3.401559374016378e-13, "-3.40156e-13", "%g",
-__LINE__, -3.402651870178825e+21, "-3.40265e+21", "%+g",
-__LINE__, -3.410491213537530e+12, "-3.41049E+12", "%G",
-__LINE__, -3.411695570460075e-01, "-3.411696e-01", "%e",
-__LINE__, -3.417311435719220e+29, "-3.4E+29", "%3.1E",
-__LINE__, -3.417581063208165e-23, " -0", "%+4.f",
-__LINE__, -3.424005615113663e-28, "-0.000000", "%f",
-__LINE__, -3.424793585094130e-12, "-0.000000", "%f",
-__LINE__, -3.434733077762304e-05, "-3.43473e-05", "%g",
-__LINE__, -3.436384988494743e+08, "-3.43638E+08", "%G",
-__LINE__, -3.441082995163884e-21, "-0.000000", "%f",
-__LINE__, -3.442868661576827e-23, "-3.442869e-23", "%#.7g",
-__LINE__, -3.444337521046186e+13, "-3.44434E+13", "%#G",
-__LINE__, -3.448230173418967e-28, "-3.44823E-28", "%#G",
-__LINE__, -3.448523828225326e-21, "-3.4485e-21", "%.4e",
-__LINE__, -3.449876796754720e-07, "-3.44988e-07", "%g",
-__LINE__, -3.450163790411588e+25, "-34501637904115876054333966.749255", "%2f",
-__LINE__, -3.450224454406567e-26, "-3.450224E-26", "%#1E",
-__LINE__, -3.459930768422874e-28, "-3.46E-28", "%2.3G",
-__LINE__, -3.460730505022601e-28, "-3.46073e-28", "%#g",
-__LINE__, -3.462894265593946e-10, "-3.46289e-10", "%+#g",
-__LINE__, -3.464808359229496e+05, "-346481", "%6.6G",
-__LINE__, -3.467272303652620e-03, "-0.00346727", "%g",
-__LINE__, -3.468252706910251e+10, "-3.5E+10", "%#7.2G",
-__LINE__, -3.473623965680253e+27, "-3.47362e+27", "%g",
-__LINE__, -3.474527926009729e+11, "-3.475E+11", "%.4G",
-__LINE__, -3.476489048299929e+15, "-3.47649e+15", "%g",
-__LINE__, -3.477809698895344e-09, "-0.000", "%+.3f",
-__LINE__, -3.493008398637667e-28, " -0", "%+4.f",
-__LINE__, -3.497441286691613e+07, "-3.49744e+07", "%g",
-__LINE__, -3.500904660533358e+00, "-3.500905E+00", "%+1E",
-__LINE__, -3.504996054364915e+25, "-3.505e+25", "%+g",
-__LINE__, -3.507738629125434e-24, "-0.00", "%+4.2f",
-__LINE__, -3.508557770253211e-04, "-3.508558e-04", "%#6e",
-__LINE__, -3.516056824437550e+20, "-3.516057e+20", "%#e",
-__LINE__, -3.521102917733367e+02, "-352.11", "%g",
-__LINE__, -3.523948985825251e+10, "-3.52395e+10", "%+g",
-__LINE__, -3.525281835697895e-15, "-3.525282e-15", "%e",
-__LINE__, -3.534088845494570e-26, "-0.000000", "%2f",
-__LINE__, -3.541002442741569e+01, "-35.410", "%3.3f",
-__LINE__, -3.541126630345017e-19, "-3.541127e-19", "%e",
-__LINE__, -3.545277845967514e-17, "-0.000000", "%f",
-__LINE__, -3.560935430637329e-12, "-3.56094E-12", "%G",
-__LINE__, -3.564234584447659e-23, "-3.56423E-23", "%G",
-__LINE__, -3.576040378379921e-11, "-0.000000", "%+6f",
-__LINE__, -3.578133580350674e-05, "-3.578134e-05", "%#e",
-__LINE__, -3.584484015191491e-28, "-0.0", "%+2.1f",
-__LINE__, -3.591961845146752e+27, "-3.59196E+27", "%G",
-__LINE__, -3.602508380305001e+26, "-3.60251e+26", "%g",
-__LINE__, -3.603113449808132e+04, "-36031.134498", "%+3.6f",
-__LINE__, -3.605569849504628e+25, "-4E+25", "%6.G",
-__LINE__, -3.611297754851416e+05, "-361129.775485", "%+f",
-__LINE__, -3.613177909959201e-28, "-0.000000", "%f",
-__LINE__, -3.616261225230595e-01, "-0.361626", "%3g",
-__LINE__, -3.619203521536307e+09, "-3.6192E+09", "%G",
-__LINE__, -3.619316709131723e-27, "-0.0000000", "%.7f",
-__LINE__, -3.623100583082346e+28, "-3.6231E+28", "%+G",
-__LINE__, -3.626582653589919e+21, "-3626582653589918603387.332041", "%f",
-__LINE__, -3.626667540343067e-30, "-4.E-30", "%#.0G",
-__LINE__, -3.633539220625861e-30, "-3.634E-30", "%+.3E",
-__LINE__, -3.641655782149502e-11, "-3.64166E-11", "%G",
-__LINE__, -3.644523594046571e+25, "-3.64452e+25", "%5g",
-__LINE__, -3.645977605394108e+25, "-3.646e+25", "%+0.3e",
-__LINE__, -3.647864582248812e+13, "-4E+13", "%4.G",
-__LINE__, -3.655241667633056e-25, "-3.655242E-25", "%E",
-__LINE__, -3.662603655433297e+23, "-3.662604e+23", "%e",
-__LINE__, -3.668995445134158e+22, " -4E+22", "%7.G",
-__LINE__, -3.670006666569412e-11, "-3.670007e-11", "%e",
-__LINE__, -3.670510381138509e-24, "-3.670510e-24", "%e",
-__LINE__, -3.671283003268254e-20, "-3.67128E-20", "%G",
-__LINE__, -3.687760201176777e-13, "-3.68776E-13", "%G",
-__LINE__, -3.687983982100676e-14, "-0.00", "%.2f",
-__LINE__, -3.694808382827435e-12, "-3.694808E-12", "%#E",
-__LINE__, -3.696158520838821e+28, "-3.69616E+28", "%3G",
-__LINE__, -3.700911860811323e+18, "-3.70091e+18", "%+g",
-__LINE__, -3.701328314738669e+24, "-3.70133e+24", "%g",
-__LINE__, -3.707068461822151e-19, "-3.707068E-19", "%E",
-__LINE__, -3.710679411506914e+25, "-3.71068e+25", "%g",
-__LINE__, -3.713003840923896e-23, "-3.713e-23", "%7g",
-__LINE__, -3.717028397747828e-28, "-3.71703e-28", "%g",
-__LINE__, -3.728159642236442e+14, "-3.72816E+14", "%G",
-__LINE__, -3.731956233637010e+21, "-3.73196E+21", "%G",
-__LINE__, -3.742336623322610e+07, "-3.74234e+07", "%g",
-__LINE__, -3.748328269630045e+04, "-37483.3", "%G",
-__LINE__, -3.750803081283569e-27, "-3.7508E-27", "%+7G",
-__LINE__, -3.752021500826652e-04, "-0.0004", "%.1G",
-__LINE__, -3.755942257004103e-12, "-3.75594E-12", "%G",
-__LINE__, -3.765921235889045e+03, " -4e+03", "%+7.g",
-__LINE__, -3.772453135667801e-28, "-3.77245E-28", "%G",
-__LINE__, -3.776384200230367e+27, "-3.776e+27", "%1.4g",
-__LINE__, -3.787035870684945e-25, "-4E-25", "%+3.G",
-__LINE__, -3.798616350818839e-29, "-3.7986164e-29", "%.7e",
-__LINE__, -3.807178315238428e-15, "-0.000000", "%+#6f",
-__LINE__, -3.822059837967635e+18, "-3822059837967634621.236357", "%6.6f",
-__LINE__, -3.823553096022006e+12, "-3.82355e+12", "%g",
-__LINE__, -3.839198115259428e-23, "-0.000000", "%f",
-__LINE__, -3.846953640321746e+02, "-3.846954E+02", "%E",
-__LINE__, -3.852230696542361e+08, "-3.8522e+08", "%#.5g",
-__LINE__, -3.861139362195314e-25, "-3.86114E-25", "%2G",
-__LINE__, -3.873388618099769e+09, "-3873388618", "%0.0f",
-__LINE__, -3.874161550543817e+15, "-3.874162e+15", "%+e",
-__LINE__, -3.874527935469425e+20, "-3.87E+20", "%3.3G",
-__LINE__, -3.878069577893697e-30, "-3.878070E-30", "%#E",
-__LINE__, -3.878852490397702e-20, "-3.87885e-20", "%g",
-__LINE__, -3.879688342272101e-10, "-0.00", "%#4.2f",
-__LINE__, -3.879797428399897e+03, "-3880", "%1.4g",
-__LINE__, -3.881588804766756e+00, "-3.9", "%+4.2G",
-__LINE__, -3.889377318111182e+01, "-38.8938", "%+.4f",
-__LINE__, -3.893444523430385e-03, "-0.004", "%+2.g",
-__LINE__, -3.894912141515856e+03, "-3894.91", "%+g",
-__LINE__, -3.905279115773667e+04, "-39052.791158", "%f",
-__LINE__, -3.905333955484919e-20, "-3.90533E-20", "%G",
-__LINE__, -3.906559442060730e+27, "-3906559442060730447110472596.250474", "%f",
-__LINE__, -3.909396469655334e-26, "-3.91E-26", "%.3G",
-__LINE__, -3.920132491092364e+11, "-3.92013e+11", "%g",
-__LINE__, -3.935651497471973e+27, "-3935651497471972604103029880", "%5.f",
-__LINE__, -3.939742577853889e-03, "-0.004", "%5.G",
-__LINE__, -3.943284017088198e+19, "-39432840170881981123.3", "%.1f",
-__LINE__, -3.947452186327660e+09, "-3947452186.33", "%0.2f",
-__LINE__, -3.951967237553488e+18, "-3951967237553488132.562052", "%f",
-__LINE__, -3.953673427359789e-28, "-3.954E-28", "%3.4G",
-__LINE__, -3.956044867371602e+23, "-4e+23", "%+6.1g",
-__LINE__, -3.965038994251913e-20, "-3.96504e-20", "%g",
-__LINE__, -3.970527677577937e+05, "-4.e+05", "%#0.1g",
-__LINE__, -3.970717822164395e-20, "-3.970718e-20", "%6e",
-__LINE__, -3.978063834438912e-19, "-3.97806E-19", "%G",
-__LINE__, -3.982705395472599e+27, "-3.9827e+27", "%#.5g",
-__LINE__, -3.983486821352571e-28, "-3.98349e-28", "%g",
-__LINE__, -3.985470630230926e-14, "-4e-14", "%.2g",
-__LINE__, -3.993095662863953e-16, "-3.993096e-16", "%e",
-__LINE__, -4.006984141314271e-22, " -4e-22", "%7.2g",
-__LINE__, -4.006984141314271e-22, "-4.0e-22", "%#7.2g",
-__LINE__, -4.013226099863981e+06, "-4.013226E+06", "%+E",
-__LINE__, -4.013702226581167e+00, "-4.0137022", "%+#3.7f",
-__LINE__, -4.017598274642537e+11, "-4E+11", "%5.G",
-__LINE__, -4.021385792825529e-09, " -4e-09", "%7.2g",
-__LINE__, -4.024099064819937e-20, "-4.0241E-20", "%+G",
-__LINE__, -4.026952473441366e+22, "-4.026952e+22", "%6.7g",
-__LINE__, -4.027636677087866e+12, "-4.02764E+12", "%G",
-__LINE__, -4.036506013049443e+17, "-4.03651e+17", "%0.6g",
-__LINE__, -4.063191953523012e-06, " -0.0", "%6.1f",
-__LINE__, -4.070953223475192e-23, "-4.07095E-23", "%G",
-__LINE__, -4.072425833070524e+09, "-4.072426E+09", "%E",
-__LINE__, -4.086025576759603e+12, "-4.086026e+12", "%e",
-__LINE__, -4.086627783296081e-24, "-4.087E-24", "%.3E",
-__LINE__, -4.086683676772144e+10, "-40866836767.721439", "%f",
-__LINE__, -4.087336043219081e-10, "-0.", "%+#0.f",
-__LINE__, -4.125162973336809e-26, "-4.125163E-26", "%.7G",
-__LINE__, -4.150753797717075e-10, "-4.2e-10", "%.2g",
-__LINE__, -4.152126152181912e+23, "-4.15213e+23", "%g",
-__LINE__, -4.164458223079432e-07, "-4.164458E-07", "%E",
-__LINE__, -4.170624866130099e+03, "-4170.624866", "%4.6f",
-__LINE__, -4.171137277374942e-01, " -4E-01", "%+7.E",
-__LINE__, -4.176067421901769e-25, "-4.17607E-25", "%G",
-__LINE__, -4.179514418604771e+24, "-4.1795e+24", "%3.5g",
-__LINE__, -4.196285183415621e+23, "-4.19629E+23", "%5G",
-__LINE__, -4.198600486581023e+23, "-4E+23", "%+4.G",
-__LINE__, -4.199020494598538e-16, "-0.000000", "%+f",
-__LINE__, -4.207824153501688e-01, "-0.420782", "%G",
-__LINE__, -4.219086441294006e-13, " -0", "%+4.f",
-__LINE__, -4.223689582765525e+12, "-4.22369e+12", "%g",
-__LINE__, -4.230213377391093e+04, "-42302.1", "%+2.6G",
-__LINE__, -4.232495358100605e-02, "-0.042325", "%+f",
-__LINE__, -4.235459662515940e-29, "-0.000000", "%f",
-__LINE__, -4.240807508057296e-07, "-4e-07", "%0.g",
-__LINE__, -4.248376819122346e-13, "-4.248377e-13", "%7e",
-__LINE__, -4.251361939638334e-23, "-4.251362E-23", "%E",
-__LINE__, -4.253044333568077e+24, "-4.253044e+24", "%4e",
-__LINE__, -4.255728039119772e-30, "-4.25573E-30", "%2G",
-__LINE__, -4.256502531648988e+02, "-425.65", "%G",
-__LINE__, -4.260731632612400e-04, "-0", "%2.f",
-__LINE__, -4.262037138254753e-25, "-4e-25", "%5.g",
-__LINE__, -4.270910126379393e+00, "-4.2709", "%#7.4f",
-__LINE__, -4.273844276097008e-09, " -0.", "%#4.f",
-__LINE__, -4.280424136111831e+21, "-4.280E+21", "%.3E",
-__LINE__, -4.284351940366486e-23, "-0.000000", "%+f",
-__LINE__, -4.291747881693517e-29, "-4.3e-29", "%+#.2g",
-__LINE__, -4.298346825232928e+04, "-42983.5", "%G",
-__LINE__, -4.298879924365432e+28, "-42988799243654316484253286034.800112", "%f",
-__LINE__, -4.302192665689887e-25, "-0.000000", "%f",
-__LINE__, -4.303899568112784e+06, "-4E+06", "%1.G",
-__LINE__, -4.307399960278190e-30, "-4.31e-30", "%.3g",
-__LINE__, -4.341161949359232e+01, "-43.411619", "%+f",
-__LINE__, -4.353334435604675e+17, " -4e+17", "%+7.g",
-__LINE__, -4.354760231068195e+08, "-4e+08", "%2.e",
-__LINE__, -4.363535913318519e+08, "-4.363536E+08", "%+7E",
-__LINE__, -4.365389605557404e-29, "-4.365390e-29", "%e",
-__LINE__, -4.369278570829168e-22, "-4.369279E-22", "%5E",
-__LINE__, -4.372187639240662e-11, "-4.37219e-11", "%+g",
-__LINE__, -4.374221079233858e-15, "-4.37422E-15", "%4.6G",
-__LINE__, -4.374840292001664e-13, "-0.000000", "%+f",
-__LINE__, -4.376554800103945e+16, "-43765548001039453.751559", "%f",
-__LINE__, -4.376659235899513e+07, "-4.4E+07", "%0.2G",
-__LINE__, -4.377316129868239e-06, "-4.37732E-06", "%+5G",
-__LINE__, -4.380028480226885e+21, "-4e+21", "%1.0e",
-__LINE__, -4.380434965450223e+16, "-43804349654502230.393405", "%f",
-__LINE__, -4.392477080355168e-15, "-4E-15", "%+2.G",
-__LINE__, -4.396120020536161e+17, "-439612002053616102.159594", "%#f",
-__LINE__, -4.400993154571784e+13, "-44009931545717.844159", "%f",
-__LINE__, -4.402873692051930e-26, "-4.4e-26", "%5.3g",
-__LINE__, -4.405330274903779e+24, "-4405330274903779042006135.568954", "%+5f",
-__LINE__, -4.406272291312090e+06, "-4.40627e+06", "%+g",
-__LINE__, -4.407065949816988e-13, "-0.000000", "%f",
-__LINE__, -4.408295597674563e-10, "-4.4083e-10", "%g",
-__LINE__, -4.417553815178214e-30, "-4.41755E-30", "%G",
-__LINE__, -4.428894120469459e+16, "-4.42889e+16", "%g",
-__LINE__, -4.433747825142046e+04, "-4.433748e+04", "%#e",
-__LINE__, -4.435051082856639e+11, "-4.43505E+11", "%G",
-__LINE__, -4.445045573007259e-27, "-4.445e-27", "%.5g",
-__LINE__, -4.447791368960968e-25, " -4e-25", "%+7.g",
-__LINE__, -4.449691386526521e-11, "-4.44969e-11", "%g",
-__LINE__, -4.451399093849402e+06, "-4.e+06", "%#0.e",
-__LINE__, -4.453753130320864e-22, "-4E-22", "%6.E",
-__LINE__, -4.455910780463539e+00, "-4", "%2.g",
-__LINE__, -4.464935674747308e+25, "-4.46494e+25", "%g",
-__LINE__, -4.469759565657550e-29, "-4.46976e-29", "%g",
-__LINE__, -4.473254139442931e+14, "-4E+14", "%3.1G",
-__LINE__, -4.480844704930373e-04, "-0.000448", "%5.6f",
-__LINE__, -4.484177356024563e+19, "-4.484177E+19", "%E",
-__LINE__, -4.488115678357666e-13, "-4.48812e-13", "%g",
-__LINE__, -4.491545112281561e+12, "-4.491545E+12", "%E",
-__LINE__, -4.492547433553077e-23, "-4.49255e-23", "%g",
-__LINE__, -4.492701755830813e-05, "-0.000045", "%f",
-__LINE__, -4.497405935096372e-02, "-4.497406e-02", "%e",
-__LINE__, -4.502764260212887e+21, "-4.50276E+21", "%G",
-__LINE__, -4.511984199938207e+29, "-451198419993820731832556703011.505306", "%f",
-__LINE__, -4.514517861504637e-13, "-4.51452e-13", "%g",
-__LINE__, -4.525577218881990e+24, "-4.5e+24", "%2.2g",
-__LINE__, -4.549244580903896e-26, "-5E-26", "%2.G",
-__LINE__, -4.569192488002113e-29, "-5E-29", "%3.G",
-__LINE__, -4.572011438847734e+17, "-4.57e+17", "%#.3g",
-__LINE__, -4.573010973514519e-08, "-4.57301e-08", "%+7g",
-__LINE__, -4.584534976177852e-04, "-0.000458453", "%7g",
-__LINE__, -4.584729895132228e-21, "-0.000000", "%4f",
-__LINE__, -4.585259328217483e-30, "-4.58526E-30", "%+#4.6G",
-__LINE__, -4.589603063610410e-04, "-4.589603E-04", "%+E",
-__LINE__, -4.592428795671033e+22, " -5e+22", "%7.g",
-__LINE__, -4.595683678223830e-20, " -0", "%5.f",
-__LINE__, -4.602585606100101e+05, "-4.602586E+05", "%E",
-__LINE__, -4.603375306660027e-08, "-5E-08", "%+6.G",
-__LINE__, -4.611341343728034e-18, "-4.611341e-18", "%5e",
-__LINE__, -4.613608487855863e+05, "-461361", "%6g",
-__LINE__, -4.615997775774194e-24, "-4.61600e-24", "%#g",
-__LINE__, -4.620310950564759e+23, "-462031095056475926696749", "%1.0f",
-__LINE__, -4.620645693595563e-10, "-4.6206457e-10", "%.7e",
-__LINE__, -4.621527706233292e-09, "-4.621528e-09", "%#e",
-__LINE__, -4.625215210297273e-13, "-4.62522E-13", "%G",
-__LINE__, -4.636755152220100e-29, "-0.000000", "%#f",
-__LINE__, -4.641203877508087e+23, "-4.6412e+23", "%0g",
-__LINE__, -4.648627249239175e+23, "-4.65E+23", "%+0.3G",
-__LINE__, -4.662546890623409e-10, "-4.663E-10", "%.3E",
-__LINE__, -4.664488650292317e-27, "-4.66449e-27", "%#g",
-__LINE__, -4.668715685060282e+08, "-466871568.50603", "%.5f",
-__LINE__, -4.673332851657081e-18, "-4.7e-18", "%#5.2g",
-__LINE__, -4.683361436174074e+24, "-4.68e+24", "%#.2e",
-__LINE__, -4.693748680461066e-01, "-0.469375", "%G",
-__LINE__, -4.697110010549124e+23, "-4.69711E+23", "%G",
-__LINE__, -4.710442739966989e+06, "-4.710443e+06", "%2e",
-__LINE__, -4.713427678642280e-09, "-4.71343e-09", "%g",
-__LINE__, -4.721999055940316e-04, "-4.721999e-04", "%#1e",
-__LINE__, -4.724262200578540e+17, "-472426220057853996.081576", "%+f",
-__LINE__, -4.733267644288093e+01, "-4.733268e+01", "%7e",
-__LINE__, -4.742854711396110e-11, "-0.000000", "%f",
-__LINE__, -4.757456106385936e+23, "-4.75746e+23", "%g",
-__LINE__, -4.770895495642298e+27, "-4770895495642298200777986494.358629", "%2f",
-__LINE__, -4.775073456318149e+29, "-4.775073E+29", "%#E",
-__LINE__, -4.779997387204258e+17, "-4.78e+17", "%g",
-__LINE__, -4.799264315770707e-23, "-4.799264E-23", "%+.7G",
-__LINE__, -4.814277930599660e+10, "-5e+10", "%2.1g",
-__LINE__, -4.818413387018612e+05, "-5e+05", "%.0g",
-__LINE__, -4.818827195107612e-16, "-4.818827e-16", "%e",
-__LINE__, -4.841524514024803e+21, "-4.84152E+21", "%G",
-__LINE__, -4.860585077313477e+10, "-4.86059E+10", "%+G",
-__LINE__, -4.870037451948589e+28, "-48700374519485887248038125107.996166", "%f",
-__LINE__, -4.888835952705153e-28, "-4.888836E-28", "%+E",
-__LINE__, -4.893523355754114e-19, "-4.893523e-19", "%.6e",
-__LINE__, -4.906070260482585e+17, "-490607026048258454", "%+.0f",
-__LINE__, -4.907734144101900e+25, "-5E+25", "%+.1G",
-__LINE__, -4.917899547741841e-25, "-4.917900e-25", "%e",
-__LINE__, -4.923348512538722e+25, "-49233485125387215219916470.232420", "%+.6f",
-__LINE__, -4.926052630078460e-26, "-4.926053e-26", "%e",
-__LINE__, -4.926751662051156e+14, "-4.927E+14", "%+5.3E",
-__LINE__, -4.928017952199046e-12, "-0.000000", "%f",
-__LINE__, -4.944296782981195e-21, "-4.9443E-21", "%1.5G",
-__LINE__, -4.947320427183599e-19, "-4.947320e-19", "%.6e",
-__LINE__, -4.968188938972135e+17, "-4.96819E+17", "%G",
-__LINE__, -4.968756725758674e+05, "-496876", "%G",
-__LINE__, -4.968788759793340e-26, "-4.97E-26", "%.3G",
-__LINE__, -4.983904999913364e-24, "-5E-24", "%0.G",
-__LINE__, -4.985209496522767e+23, "-4.985209e+23", "%e",
-__LINE__, -4.987363880732866e+08, "-4.98736E+08", "%G",
-__LINE__, -4.989754940144973e+05, "-498975.494014", "%f",
-__LINE__, -4.998203870733718e-25, "-4.9982e-25", "%g",
-__LINE__, -4.999153445016792e-27, "-5e-27", "%+1.e",
-__LINE__, -5.002693488258108e+06, " -5e+06", "%+7.g",
-__LINE__, -5.017958458603783e+05, "-5.0179585E+05", "%+.7E",
-__LINE__, -5.028902178573363e-12, "-5.0289e-12", "%0g",
-__LINE__, -5.032337536971444e+07, "-50323375.369714", "%f",
-__LINE__, -5.036525516370473e-24, "-5.0365e-24", "%4.5g",
-__LINE__, -5.038642321515756e+18, "-5038642321515755639.893541", "%f",
-__LINE__, -5.051003516976770e-14, "-5.051E-14", "%+G",
-__LINE__, -5.051196143816789e+27, "-5.0512e+27", "%g",
-__LINE__, -5.057372886713786e+28, "-5.057373e+28", "%#e",
-__LINE__, -5.057475029459727e+12, "-5.05748e+12", "%+g",
-__LINE__, -5.068286816124670e-17, "-5.068E-17", "%5.3E",
-__LINE__, -5.070475165759468e-12, "-0.000000", "%4.6f",
-__LINE__, -5.081352543220476e+20, "-5.081E+20", "%.3E",
-__LINE__, -5.084398319179363e+11, "-508439831917.936313", "%#f",
-__LINE__, -5.085781220648484e+05, "-5.E+05", "%+#7.G",
-__LINE__, -5.094941054632498e-24, "-5.09494E-24", "%+G",
-__LINE__, -5.100059596310871e-10, "-5.10006e-10", "%3.6g",
-__LINE__, -5.103072553594136e-01, "-0.5", "%+1.g",
-__LINE__, -5.106319890388412e+08, "-5.106320e+08", "%4e",
-__LINE__, -5.107120687977690e+09, "-5107120687.977690", "%f",
-__LINE__, -5.119910716893161e-13, "-5.11991E-13", "%6G",
-__LINE__, -5.127594569425709e-29, "-5.12759e-29", "%#g",
-__LINE__, -5.130365585632797e+29, "-5.13037e+29", "%#g",
-__LINE__, -5.131415638022112e+08, "-513141563.802211", "%0f",
-__LINE__, -5.144703216335916e-23, "-5.1447e-23", "%g",
-__LINE__, -5.152511923201882e-05, "-5.15251E-05", "%+G",
-__LINE__, -5.165484448280190e-12, " -0.0", "%5.1f",
-__LINE__, -5.179220760465737e-20, "-5e-20", "%+5.g",
-__LINE__, -5.183005119662180e-10, "-5.183005E-10", "%+E",
-__LINE__, -5.199587953258117e+13, "-5.19959e+13", "%6g",
-__LINE__, -5.202041951844580e-25, "-0.000000", "%f",
-__LINE__, -5.202836038621740e+00, "-5.20284", "%G",
-__LINE__, -5.212204099528552e-11, "-5.2122e-11", "%.6g",
-__LINE__, -5.225617726710534e+17, "-522561772671053414.995868", "%+f",
-__LINE__, -5.230162003281426e+25, "-52301620032814257754694153.84578", "%+6.5f",
-__LINE__, -5.251849429321286e-11, "-5.25185e-11", "%g",
-__LINE__, -5.265174939930368e+23, "-5.265175E+23", "%1.6E",
-__LINE__, -5.271218134351422e+21, "-5.27122e+21", "%+1g",
-__LINE__, -5.273823357545750e+17, "-527382335754575048.980541", "%f",
-__LINE__, -5.279848797214957e+11, "-527984879721.495659", "%0f",
-__LINE__, -5.281551888625290e+11, "-5e+11", "%4.g",
-__LINE__, -5.281780377142961e-24, "-5.28178e-24", "%g",
-__LINE__, -5.292125782379512e+03, "-5292.125782", "%f",
-__LINE__, -5.292401691410388e+15, "-5292401691410387.520875", "%f",
-__LINE__, -5.305120752102265e-25, "-5.30512e-25", "%+#.5e",
-__LINE__, -5.317975791704413e+16, "-5.31798e+16", "%+g",
-__LINE__, -5.336522843607233e+27, "-5.33652e+27", "%#6g",
-__LINE__, -5.342016438000917e-05, " -5e-05", "%+7.e",
-__LINE__, -5.351122291549103e+06, "-5351122.291549", "%+0f",
-__LINE__, -5.352043956303597e+00, "-5.35204", "%g",
-__LINE__, -5.353582488767747e+09, "-5.354E+09", "%7.3E",
-__LINE__, -5.383420177718380e+04, "-5e+04", "%1.e",
-__LINE__, -5.384320189791882e-10, "-5.384320e-10", "%e",
-__LINE__, -5.409487543257379e-12, "-5.40949E-12", "%G",
-__LINE__, -5.418395794776773e+23, "-5.4184e+23", "%g",
-__LINE__, -5.419918795921525e-09, "-0.000000", "%+f",
-__LINE__, -5.422374157832442e+11, "-5.42237e+11", "%3g",
-__LINE__, -5.426916951577001e-27, "-5.42692E-27", "%+G",
-__LINE__, -5.430058833461779e+28, "-5.43006E+28", "%G",
-__LINE__, -5.444433348653147e+23, "-5.444433E+23", "%E",
-__LINE__, -5.446560186537024e+09, "-5.446560E+09", "%E",
-__LINE__, -5.464243500152188e+27, "-5.46424E+27", "%G",
-__LINE__, -5.464427517531742e+20, "-546442751753174249529.365625", "%f",
-__LINE__, -5.465783705970954e+05, "-5E+05", "%1.E",
-__LINE__, -5.475138077475789e-11, "-5e-11", "%.0e",
-__LINE__, -5.475302250616576e+10, "-54753022506.1658", "%.4f",
-__LINE__, -5.488964905442472e+09, "-5.48896e+09", "%g",
-__LINE__, -5.492508526846316e-08, "-5.49251e-08", "%.6g",
-__LINE__, -5.520533408804846e-15, "-5.520533e-15", "%e",
-__LINE__, -5.532744688447266e+28, "-55327446884472664123677532188.594341", "%2.6f",
-__LINE__, -5.535834653450131e-14, "-5.5e-14", "%0.1e",
-__LINE__, -5.554344735392882e-02, "-5.554345E-02", "%+#E",
-__LINE__, -5.555497334515501e-17, "-5.5555e-17", "%g",
-__LINE__, -5.558304303221977e+14, "-555830430322197.699411", "%f",
-__LINE__, -5.562210815777694e-05, "-5.562211E-05", "%#1E",
-__LINE__, -5.564800722538402e-09, "-5.56480e-09", "%#.6g",
-__LINE__, -5.567143271590439e-01, "-5.567143e-01", "%#e",
-__LINE__, -5.568606044396186e+01, "-55.6861", "%4g",
-__LINE__, -5.592027856401721e+12, "-5.592028e+12", "%.7g",
-__LINE__, -5.592295342565443e+22, "-6.E+22", "%#3.G",
-__LINE__, -5.600007421926053e+07, "-56000074.219261", "%1f",
-__LINE__, -5.601444553155006e-12, "-5.60144E-12", "%G",
-__LINE__, -5.605128912835080e-03, "-0.005605", "%+f",
-__LINE__, -5.610950285679577e+19, "-5.61095E+19", "%G",
-__LINE__, -5.622074657679467e+11, "-562207465767.946690", "%f",
-__LINE__, -5.627358352391656e-01, "-0.6", "%1.g",
-__LINE__, -5.627974317622488e-02, "-5.627974e-02", "%+e",
-__LINE__, -5.629497696447229e+27, "-5.629E+27", "%+.4G",
-__LINE__, -5.631383567258576e-29, "-5.63138e-29", "%0g",
-__LINE__, -5.635241327177333e-18, "-5.63524E-18", "%G",
-__LINE__, -5.644819783138381e+06, "-5.644820E+06", "%#E",
-__LINE__, -5.648538459114833e+26, "-564853845911483265496144667.849876", "%+f",
-__LINE__, -5.649004865848537e+00, "-5.649", "%g",
-__LINE__, -5.653403316885170e+23, "-6E+23", "%2.0E",
-__LINE__, -5.656109962244926e-18, "-0.000000", "%f",
-__LINE__, -5.674988031695793e+22, "-5.674988E+22", "%+.7G",
-__LINE__, -5.686380226400881e-22, "-0.000000", "%f",
-__LINE__, -5.698840855829442e-14, "-5.69884E-14", "%G",
-__LINE__, -5.707036642649580e+03, "-5707.036643", "%f",
-__LINE__, -5.710344882278847e+11, "-5.71034E+11", "%+G",
-__LINE__, -5.714852196401017e+19, "-5.71485E+19", "%+G",
-__LINE__, -5.720153622156089e-22, "-5.72015E-22", "%G",
-__LINE__, -5.722366011976922e+26, "-5.72237e+26", "%+g",
-__LINE__, -5.722909928097404e+12, "-5.72291E+12", "%2G",
-__LINE__, -5.725325961787777e-25, "-5.72533e-25", "%g",
-__LINE__, -5.727138241052646e+19, "-5.72714e+19", "%+#g",
-__LINE__, -5.734025840446336e+14, "-5.73403e+14", "%+g",
-__LINE__, -5.736469106710259e-05, "-0.000057", "%.6f",
-__LINE__, -5.755099153733116e-14, "-5.7551e-14", "%+g",
-__LINE__, -5.758411844890947e-20, "-6E-20", "%+6.G",
-__LINE__, -5.760350214122813e+03, "-5760.35", "%+g",
-__LINE__, -5.768009192512392e-30, "-0", "%1.f",
-__LINE__, -5.772343286693103e+07, "-5.77234E+07", "%G",
-__LINE__, -5.776693265471852e-27, "-5.776693E-27", "%E",
-__LINE__, -5.779682861172754e-28, "-5.779683e-28", "%e",
-__LINE__, -5.789953490749936e+26, "-578995349074993637117358957.76656", "%5.5f",
-__LINE__, -5.796771264754334e+04, "-57967.7", "%g",
-__LINE__, -5.804788370597286e-02, "-5.80479E-02", "%+#1.5E",
-__LINE__, -5.805343475329215e-13, "-5.80534e-13", "%g",
-__LINE__, -5.809853913830122e+09, "-5809853914", "%+0.f",
-__LINE__, -5.817313814570609e-30, " -0", "%7.0f",
-__LINE__, -5.831708441750138e+00, "-5.83171", "%#g",
-__LINE__, -5.846914550593652e+29, "-5.846915e+29", "%e",
-__LINE__, -5.851455214762288e+04, "-58514.6", "%+G",
-__LINE__, -5.855803663871393e-23, "-6E-23", "%5.E",
-__LINE__, -5.858065129988470e+10, "-5.85807e+10", "%+g",
-__LINE__, -5.863147168075411e-14, "-5.86315e-14", "%+g",
-__LINE__, -5.878936740266680e-04, "-0.000587894", "%g",
-__LINE__, -5.887654893386630e+25, "-58876548933866299506689756.526612", "%#f",
-__LINE__, -5.889416409731902e-02, "-0.06", "%5.g",
-__LINE__, -5.897630195029892e-18, "-5.897630E-18", "%#0.7G",
-__LINE__, -5.898506808456422e-19, "-5.89851E-19", "%G",
-__LINE__, -5.901768645393515e+29, "-5.90177E+29", "%+G",
-__LINE__, -5.907529093570369e+10, "-59075290935.703695", "%f",
-__LINE__, -5.910069365260240e+13, "-59100693652602.39849", "%+#5.5f",
-__LINE__, -5.915678929676435e-07, "-0.000001", "%+f",
-__LINE__, -5.922232380131716e-01, "-0.592223", "%+3f",
-__LINE__, -5.923716473994306e+19, "-5.92372E+19", "%+#.6G",
-__LINE__, -5.929950428920404e-15, "-5.929950e-15", "%+e",
-__LINE__, -5.949552735665802e+26, "-5.94955e+26", "%#g",
-__LINE__, -5.949977081310732e-02, "-0.059500", "%f",
-__LINE__, -5.954520303889356e-07, "-5.954520E-07", "%5E",
-__LINE__, -5.978861337429145e-13, "-6E-13", "%1.G",
-__LINE__, -5.980539445081087e+15, "-5.98054E+15", "%.6G",
-__LINE__, -5.981724990853490e-03, " -0.006", "%#7.g",
-__LINE__, -5.989488907825821e+03, "-6E+03", "%.2G",
-__LINE__, -5.998272294890842e+06, "-6.00E+06", "%4.2E",
-__LINE__, -6.023775731455919e-29, "-6.023776e-29", "%e",
-__LINE__, -6.028153126666870e-05, "-6.e-05", "%+#6.e",
-__LINE__, -6.036200621484690e+25, "-6e+25", "%2.2g",
-__LINE__, -6.036400640928137e-14, "-6.036401e-14", "%e",
-__LINE__, -6.038198451098329e-20, "-6.038198e-20", "%1.7g",
-__LINE__, -6.045778975641123e-15, "-6.04578E-15", "%G",
-__LINE__, -6.046038904252073e+00, "-6.04604", "%g",
-__LINE__, -6.082158462782175e-06, "-0.000006", "%+#f",
-__LINE__, -6.106162726644904e+10, "-6.10616e+10", "%g",
-__LINE__, -6.126345215489182e+10, "-6e+10", "%+1.g",
-__LINE__, -6.131852309620571e+02, "-6e+02", "%4.e",
-__LINE__, -6.134589313243809e-01, "-0.613459", "%+#f",
-__LINE__, -6.142358153783462e-10, "-6.14236E-10", "%4G",
-__LINE__, -6.151524334856263e+27, "-6151524334856262932191839354.345575", "%+6f",
-__LINE__, -6.156818333724550e+04, "-6.e+04", "%#.1g",
-__LINE__, -6.166172551433993e+24, "-6166172551433993120895138.4178", "%5.4f",
-__LINE__, -6.169532428006014e-09, "-6.16953e-09", "%3g",
-__LINE__, -6.172019382601770e-28, "-0.000000", "%+f",
-__LINE__, -6.174496985807155e-09, "-6.1745E-09", "%G",
-__LINE__, -6.186771845105751e+04, "-61867.7", "%G",
-__LINE__, -6.200817973780066e+22, "-6.20082E+22", "%3G",
-__LINE__, -6.218004335456301e-22, "-0.000000", "%+f",
-__LINE__, -6.219009630546262e-18, "-6.22e-18", "%6.3g",
-__LINE__, -6.242532875230618e-06, "-0.000006", "%7f",
-__LINE__, -6.243612261280864e+14, "-6.24361e+14", "%.6g",
-__LINE__, -6.243689597320126e+10, "-6e+10", "%.0e",
-__LINE__, -6.244620667090527e+04, "-6e+04", "%6.e",
-__LINE__, -6.250789625572054e-09, "-0.000000", "%+f",
-__LINE__, -6.253537566219164e+01, "-63.", "%#1.f",
-__LINE__, -6.284420289484166e+21, "-6.2844203e+21", "%7.7e",
-__LINE__, -6.285939888202846e+27, "-6e+27", "%+.0g",
-__LINE__, -6.290025777678105e+13, "-6E+13", "%2.E",
-__LINE__, -6.291364254323924e+10, "-6.3E+10", "%3.2G",
-__LINE__, -6.292428812164449e+15, "-6292428812164448.714839", "%.6f",
-__LINE__, -6.292600606358002e+29, "-6.29260E+29", "%#G",
-__LINE__, -6.292739629144148e-15, "-6.292740E-15", "%E",
-__LINE__, -6.296471626465745e+28, "-6.29647E+28", "%G",
-__LINE__, -6.299575066640315e+27, "-6.300E+27", "%.3E",
-__LINE__, -6.315234679394876e-24, "-6E-24", "%2.G",
-__LINE__, -6.320883246383228e-01, "-0.632088", "%2g",
-__LINE__, -6.324938413548937e-11, "-6e-11", "%.1g",
-__LINE__, -6.336312983176250e+04, "-6.336313e+04", "%e",
-__LINE__, -6.341786787214541e+06, "-6.341787E+06", "%+7.6E",
-__LINE__, -6.360189291106185e-15, "-0.0000000", "%#.7f",
-__LINE__, -6.364818355457748e-15, "-0.0000000", "%1.7f",
-__LINE__, -6.366291103431814e+04, "-63662.9", "%#G",
-__LINE__, -6.366334042923153e-05, "-6.37e-05", "%5.3g",
-__LINE__, -6.370477455143194e-12, "-0.000000", "%f",
-__LINE__, -6.372829256546279e+23, "-6.37283E+23", "%G",
-__LINE__, -6.375208490193110e-23, "-6.37521e-23", "%4.5e",
-__LINE__, -6.382595100891736e-24, "-6.3826E-24", "%5G",
-__LINE__, -6.396882421146790e-22, "-6.39688e-22", "%+g",
-__LINE__, -6.407190354039938e+08, "-6.40719e+08", "%+g",
-__LINE__, -6.408581541430886e-10, "-6.E-10", "%#0.0G",
-__LINE__, -6.409206904981703e-03, "-0.006", "%+.0G",
-__LINE__, -6.416106714707772e+26, "-641610671470777216285341637.558304", "%f",
-__LINE__, -6.417436981761998e-04, "-0.000642", "%+#f",
-__LINE__, -6.429997249673124e+11, "-642999724967.312414", "%#f",
-__LINE__, -6.440827429825250e+16, "-6.44083E+16", "%G",
-__LINE__, -6.444869858444955e+02, "-6e+02", "%6.g",
-__LINE__, -6.471701890976228e-25, " -6e-25", "%7.1g",
-__LINE__, -6.485393161670371e-12, "-6.485393e-12", "%.6e",
-__LINE__, -6.487710907063584e+23, "-6.E+23", "%#3.E",
-__LINE__, -6.492942931343439e-08, "-0.", "%+#2.0f",
-__LINE__, -6.496010652113223e+18, "-6.49601e+18", "%g",
-__LINE__, -6.502856921840228e+22, "-6.50286e+22", "%4g",
-__LINE__, -6.523559906055000e-10, "-6.52356E-10", "%.6G",
-__LINE__, -6.525899074126662e+04, "-6.5e+04", "%+.1e",
-__LINE__, -6.532216801155521e-09, "-6.53222E-09", "%G",
-__LINE__, -6.544601787025684e-27, "-0", "%+.0f",
-__LINE__, -6.558968312132168e-01, " -1", "%+6.f",
-__LINE__, -6.559654261655786e+08, "-6.559654e+08", "%e",
-__LINE__, -6.566562622196495e-21, "-6.56656E-21", "%.6G",
-__LINE__, -6.573486832071960e+04, "-65734.9", "%G",
-__LINE__, -6.573806290918275e+13, "-6.57381E+13", "%G",
-__LINE__, -6.578113771674787e+17, "-6.57811E+17", "%+#G",
-__LINE__, -6.584106931007506e+15, "-6.584107E+15", "%E",
-__LINE__, -6.590538844308877e+07, "-65905388.443089", "%f",
-__LINE__, -6.593708834068371e-07, "-0.000001", "%f",
-__LINE__, -6.597116446195875e+08, "-6.5971164e+08", "%#1.7e",
-__LINE__, -6.605813542127091e-04, "-0.0007", "%+0.g",
-__LINE__, -6.607491403866429e+07, "-7e+07", "%3.g",
-__LINE__, -6.616499847522278e+09, "-6.61650E+09", "%+#G",
-__LINE__, -6.618619768691332e+20, "-7E+20", "%2.G",
-__LINE__, -6.626748168962331e-22, "-7.E-22", "%+#3.E",
-__LINE__, -6.639335450348280e+12, "-6.63934e+12", "%g",
-__LINE__, -6.643910144912576e-03, "-0.006644", "%f",
-__LINE__, -6.650293872031870e-18, "-6.65029e-18", "%+#g",
-__LINE__, -6.654903858656310e-21, "-0.000000", "%f",
-__LINE__, -6.665834666726511e-12, "-6.665835E-12", "%E",
-__LINE__, -6.666428729917570e-19, "-0.000000", "%+#f",
-__LINE__, -6.668415789681128e+27, "-6.66842E+27", "%+G",
-__LINE__, -6.675214676269601e-28, "-6.67521e-28", "%#g",
-__LINE__, -6.679560072732262e+01, "-66.7956", "%#g",
-__LINE__, -6.692325075457020e-19, "-0.000000", "%1f",
-__LINE__, -6.697096655164652e+00, "-6.70", "%#.3g",
-__LINE__, -6.712436135928394e-28, "-7e-28", "%0.g",
-__LINE__, -6.720769486122685e-16, "-7e-16", "%0.e",
-__LINE__, -6.727196898490600e+26, "-672719689849060031860972230.8", "%.1f",
-__LINE__, -6.744132627576416e+02, "-674.413", "%6G",
-__LINE__, -6.757705576425288e+28, "-6.7577056e+28", "%.7e",
-__LINE__, -6.760554929237173e-02, "-0.067606", "%+f",
-__LINE__, -6.763538810629361e+10, "-6.7635E+10", "%.4E",
-__LINE__, -6.764712008860796e-29, "-6.76471E-29", "%+G",
-__LINE__, -6.767299719678443e+04, "-67672.997197", "%f",
-__LINE__, -6.768326491352134e+20, "-676832649135213415547.70", "%+.2f",
-__LINE__, -6.771116968952891e+03, "-7E+03", "%3.1G",
-__LINE__, -6.775218099238350e-30, "-7.e-30", "%+#6.g",
-__LINE__, -6.782142689928918e-18, "-0.00", "%4.2f",
-__LINE__, -6.795409770512149e+08, "-7E+08", "%+5.0G",
-__LINE__, -6.820966157097271e+14, "-6.820966e+14", "%e",
-__LINE__, -6.824972990592273e-22, "-0.00", "%+#1.2f",
-__LINE__, -6.830452914741750e+29, "-6.8E+29", "%+7.2G",
-__LINE__, -6.835797187132348e+10, "-6.8358E+10", "%+5G",
-__LINE__, -6.837040829636343e-03, "-0.00683704", "%+g",
-__LINE__, -6.852956218658224e+23, "-6.85296e+23", "%3g",
-__LINE__, -6.854102607287217e-26, "-7e-26", "%5.e",
-__LINE__, -6.865065870249438e+16, "-6.86507E+16", "%#G",
-__LINE__, -6.884819522625523e-13, "-6.88482E-13", "%5G",
-__LINE__, -6.916316600148513e-12, "-0.000000", "%f",
-__LINE__, -6.925312418761560e-05, "-6.92531E-05", "%#G",
-__LINE__, -6.929518694178331e+09, "-6929518694.178", "%#.3f",
-__LINE__, -6.936008056682024e+02, "-6.936008E+02", "%E",
-__LINE__, -6.944911117352400e+26, "-6.944911E+26", "%1.6E",
-__LINE__, -6.945829492125162e+05, "-6.9e+05", "%+2.2g",
-__LINE__, -6.946603162471856e-13, "-6.94660E-13", "%#G",
-__LINE__, -6.947529440406653e+22, "-6.9475e+22", "%+6.5g",
-__LINE__, -6.950167604854856e-30, "-0.000000", "%7f",
-__LINE__, -6.958122319262799e-26, "-7E-26", "%+1.E",
-__LINE__, -6.958978258390961e+16, "-6.95898E+16", "%+5.6G",
-__LINE__, -6.963780466334008e-06, "-6.96378E-06", "%2G",
-__LINE__, -6.965570896221966e+13, "-6.965571E+13", "%5E",
-__LINE__, -6.967741871945064e-10, "-6.96774E-10", "%+#G",
-__LINE__, -6.973815739524307e+19, "-69738157395243067782.076", "%6.3f",
-__LINE__, -6.982714545008106e+13, "-6.98271e+13", "%g",
-__LINE__, -6.985955885054476e+03, "-6985.96", "%6G",
-__LINE__, -6.986415266835747e+18, "-6.98642e+18", "%#g",
-__LINE__, -6.996461529596512e-08, "-7.0E-08", "%#.1E",
-__LINE__, -7.000144914012241e-05, "-7.00014e-05", "%#g",
-__LINE__, -7.001017894492730e-03, "-0.00700102", "%+#.6G",
-__LINE__, -7.003690685875917e+20, "-7E+20", "%0.G",
-__LINE__, -7.010454163965384e+00, "-7.010454e+00", "%+e",
-__LINE__, -7.011493550018082e-26, " -0", "%7.f",
-__LINE__, -7.018018443394008e+21, "-7.0E+21", "%+#1.1E",
-__LINE__, -7.027253777387243e-05, "-7.02725E-05", "%+G",
-__LINE__, -7.043679213677740e-17, "-0", "%1.f",
-__LINE__, -7.051690489227881e-16, "-7.052e-16", "%0.4g",
-__LINE__, -7.063422475274161e-16, "-7.063422E-16", "%E",
-__LINE__, -7.065069592235558e-30, "-7.06507e-30", "%+#g",
-__LINE__, -7.068265283935834e-29, "-7e-29", "%+5.e",
-__LINE__, -7.068748224536295e-13, "-0.000000", "%f",
-__LINE__, -7.069621910708177e-04, "-0.000707", "%1.3g",
-__LINE__, -7.079725450964823e-12, "-0.000000", "%f",
-__LINE__, -7.087255464668218e+17, "-7.1e+17", "%.1e",
-__LINE__, -7.088715102009605e-09, "-7e-09", "%6.0g",
-__LINE__, -7.090414916270137e-15, "-0.00000", "%.5f",
-__LINE__, -7.091868311008428e-03, " -0.0", "%5.1f",
-__LINE__, -7.094242165237718e+21, "-7.09424e+21", "%+g",
-__LINE__, -7.094324305740325e-05, "-7E-05", "%+3.G",
-__LINE__, -7.104544752289144e+04, "-71045.4", "%#g",
-__LINE__, -7.105164644813694e-29, "-0.000000", "%+f",
-__LINE__, -7.114513164219487e-12, "-7.11451e-12", "%+g",
-__LINE__, -7.115778236604137e-12, "-7.11578E-12", "%G",
-__LINE__, -7.126217683410162e-27, "-7.126218e-27", "%e",
-__LINE__, -7.136214260967733e+28, "-71362142609677334803564008325.338364", "%f",
-__LINE__, -7.143452595522573e+19, "-7.14345e+19", "%g",
-__LINE__, -7.156042088843537e+27, "-7156042088843537207765166385.7977837", "%4.7f",
-__LINE__, -7.173687683710490e+24, "-7.17369e+24", "%6g",
-__LINE__, -7.190531162598206e+25, "-71905311625982060164119503", "%4.f",
-__LINE__, -7.201301831373747e-09, "-7.2013e-09", "%g",
-__LINE__, -7.209601436737306e+10, "-7.2096e+10", "%g",
-__LINE__, -7.211058997356655e-06, "-7.211059E-06", "%E",
-__LINE__, -7.226756177676272e-09, "-7.22676E-09", "%+G",
-__LINE__, -7.230870817566419e+19, "-72308708175664193618.1040364", "%#.7f",
-__LINE__, -7.231355992133345e-05, "-7.231356E-05", "%#E",
-__LINE__, -7.245999575278407e-12, "-7.246e-12", "%g",
-__LINE__, -7.247426403040390e-09, "-7.2474E-09", "%+4.5G",
-__LINE__, -7.257348680308567e-12, "-7.3E-12", "%1.2G",
-__LINE__, -7.258184256387366e-26, "-7.25818E-26", "%+2G",
-__LINE__, -7.262633672900126e+10, "-7.26263e+10", "%#g",
-__LINE__, -7.268887462426250e+03, "-7.268887e+03", "%+#e",
-__LINE__, -7.275284494682963e+08, "-7.27528e+08", "%g",
-__LINE__, -7.276335846256479e-07, " -0", "%4.f",
-__LINE__, -7.312556378294452e+15, "-7.31256e+15", "%+6g",
-__LINE__, -7.334763752442417e-15, "-0.0000", "%#.4f",
-__LINE__, -7.354627097325888e-18, "-7E-18", "%0.E",
-__LINE__, -7.360087573342401e-25, "-7.4E-25", "%6.2G",
-__LINE__, -7.368533563361098e-29, "-7.4E-29", "%3.1E",
-__LINE__, -7.379267723540596e-06, "-0.000007", "%f",
-__LINE__, -7.384525781709565e-19, "-0.000000", "%+#f",
-__LINE__, -7.388940868679677e-09, "-7.388941E-09", "%E",
-__LINE__, -7.391602149099698e+00, "-7.391602E+00", "%E",
-__LINE__, -7.393159340196723e+22, "-7.39316e+22", "%#2.6g",
-__LINE__, -7.399783260198277e-16, "-7.39978E-16", "%G",
-__LINE__, -7.405609590448331e-06, "-7.40561e-06", "%g",
-__LINE__, -7.407396977847794e-11, "-7.40740E-11", "%#G",
-__LINE__, -7.433716848698637e+20, "-7.43372e+20", "%+g",
-__LINE__, -7.444176062769411e-01, "-0.744418", "%#g",
-__LINE__, -7.448314697244012e+12, "-7448314697244.011739", "%f",
-__LINE__, -7.449533988369018e+08, "-7.449534e+08", "%+#7e",
-__LINE__, -7.465682839758801e-01, "-7E-01", "%4.E",
-__LINE__, -7.466517843126368e-26, "-7.5E-26", "%.1E",
-__LINE__, -7.471385785539900e+24, "-7471385785539899515583783.795591", "%f",
-__LINE__, -7.478345583780341e+00, "-7.478346e+00", "%e",
-__LINE__, -7.524759284626724e-06, "-7.52476e-06", "%2g",
-__LINE__, -7.534831049342539e-19, "-7.53483E-19", "%G",
-__LINE__, -7.540546673179273e+15, "-8e+15", "%.1g",
-__LINE__, -7.543440436184003e-08, "-7.54344E-08", "%6G",
-__LINE__, -7.558224240835564e-06, "-7.55822e-06", "%g",
-__LINE__, -7.564132915154469e+23, "-756413291515446850610260.298708", "%+f",
-__LINE__, -7.566590720355392e+15, "-7.566591e+15", "%1.6e",
-__LINE__, -7.568565927479741e-01, "-7.568566e-01", "%#6e",
-__LINE__, -7.615574141973305e-17, "-7.6156e-17", "%+.5g",
-__LINE__, -7.641297631509318e-28, "-8e-28", "%+.1g",
-__LINE__, -7.661227834163450e+09, "-7661227834.1634497", "%+#.7f",
-__LINE__, -7.665934364070126e+11, "-766593436407.0", "%.1f",
-__LINE__, -7.682500068463102e-27, "-0.000000", "%+#f",
-__LINE__, -7.709363160273798e+15, "-7.70936e+15", "%g",
-__LINE__, -7.712596019255238e+26, "-7.7e+26", "%.2g",
-__LINE__, -7.730213358437991e+25, "-7.7e+25", "%6.2g",
-__LINE__, -7.744420019068976e+05, "-7.74442E+05", "%.5E",
-__LINE__, -7.745813181942296e+11, "-7.7458132e+11", "%+.7e",
-__LINE__, -7.751004379716307e+16, "-7.751004e+16", "%e",
-__LINE__, -7.759862226564527e-28, "-7.75986e-28", "%g",
-__LINE__, -7.767838880221207e-27, "-7.76784e-27", "%g",
-__LINE__, -7.776301142157532e-19, "-0", "%2.f",
-__LINE__, -7.783944257077553e-14, "-8e-14", "%3.g",
-__LINE__, -7.801587579382377e+28, "-8e+28", "%+0.g",
-__LINE__, -7.806685979552780e+25, "-7.806686E+25", "%E",
-__LINE__, -7.825968891331719e-05, "-7.82597E-05", "%G",
-__LINE__, -7.826834158664018e+12, "-7.826834E+12", "%+#E",
-__LINE__, -7.832536798726886e+24, "-7.83254E+24", "%#1G",
-__LINE__, -7.840485340202362e-18, "-0.000000", "%.6f",
-__LINE__, -7.843236212099233e+21, "-7.84324e+21", "%g",
-__LINE__, -7.906644052019278e-13, "-7.906644E-13", "%E",
-__LINE__, -7.908090440678874e-20, "-7.90809E-20", "%#G",
-__LINE__, -7.917588593012283e+08, "-7.917589E+08", "%+E",
-__LINE__, -7.929100086742454e+29, "-792910008674245414539427656563.930213", "%f",
-__LINE__, -7.933235286034290e+26, "-7.933235E+26", "%E",
-__LINE__, -7.943431966567875e-03, "-0.0079434", "%+.5g",
-__LINE__, -7.950872643572970e-22, "-7.95087e-22", "%2g",
-__LINE__, -7.971225555313069e-01, "-0.797123", "%f",
-__LINE__, -7.978310272676090e-12, "-0.000000", "%#f",
-__LINE__, -8.006805393896414e-29, "-8.00681E-29", "%G",
-__LINE__, -8.006906303018830e+25, "-8.00691E+25", "%+G",
-__LINE__, -8.008484654476057e+18, "-8.008485e+18", "%5.6e",
-__LINE__, -8.008943512904249e+27, "-8008943512904249217854157905.0943", "%+.4f",
-__LINE__, -8.016539743121665e+27, "-8.01654E+27", "%G",
-__LINE__, -8.018247227006128e-05, " -8E-05", "%7.G",
-__LINE__, -8.044391842561705e+21, "-8.04439e+21", "%g",
-__LINE__, -8.081902305002036e-02, "-8.081902E-02", "%E",
-__LINE__, -8.084193011936438e-03, "-0.0080842", "%+5.5g",
-__LINE__, -8.105813534846529e-27, "-0.000000", "%f",
-__LINE__, -8.128116892989251e+00, "-8.12812", "%G",
-__LINE__, -8.136119035731877e+05, "-8e+05", "%+0.g",
-__LINE__, -8.140584224052606e+14, "-8E+14", "%5.G",
-__LINE__, -8.145928897003907e+13, "-8.15E+13", "%.3G",
-__LINE__, -8.164495905907508e-02, "-0.081645", "%G",
-__LINE__, -8.169602113313905e+20, "-8.16960e+20", "%#g",
-__LINE__, -8.179181640418333e+24, "-8.E+24", "%#.1G",
-__LINE__, -8.184324492264231e-18, "-8.18432E-18", "%G",
-__LINE__, -8.186480473850516e-28, "-0.000000", "%+f",
-__LINE__, -8.196858948158896e+07, "-8.1969E+07", "%.4E",
-__LINE__, -8.213138534699043e-30, "-0.000000", "%f",
-__LINE__, -8.221181368676532e-21, "-8.221181E-21", "%#1E",
-__LINE__, -8.222605734191438e+16, "-8.22261E+16", "%+G",
-__LINE__, -8.223925661091432e-14, "-8.223926e-14", "%0e",
-__LINE__, -8.232281541044777e-01, "-0.823228", "%f",
-__LINE__, -8.245536794508725e+22, "-8E+22", "%6.G",
-__LINE__, -8.270687365305925e+25, "-82706873653059247430974210.146815", "%f",
-__LINE__, -8.288978945738204e+11, "-8.28898e+11", "%5g",
-__LINE__, -8.290628698333139e+02, "-829.063", "%+G",
-__LINE__, -8.292416206056451e-16, "-8.29242e-16", "%+g",
-__LINE__, -8.296322623746486e-13, "-8.29632E-13", "%0.6G",
-__LINE__, -8.298321941376933e-16, "-0.000000", "%+f",
-__LINE__, -8.302331258878365e+29, "-8.30233E+29", "%0G",
-__LINE__, -8.309022429255061e+06, "-8309022.429255", "%+f",
-__LINE__, -8.312786829254646e-23, "-8.312787e-23", "%e",
-__LINE__, -8.313852965178063e-15, "-8.313853e-15", "%#7e",
-__LINE__, -8.317529094827869e+16, "-8.31753E+16", "%2G",
-__LINE__, -8.322847660882248e-17, "-0.000000", "%f",
-__LINE__, -8.324060602752638e-30, "-8.32406e-30", "%#g",
-__LINE__, -8.325043500735461e+27, "-8325043500735461066142306663.095951", "%#f",
-__LINE__, -8.332432016286935e-02, "-0.0833243", "%g",
-__LINE__, -8.334251670232117e-09, "-8.33425e-09", "%g",
-__LINE__, -8.338076225141778e+02, "-833.808", "%g",
-__LINE__, -8.338349587571534e-23, "-8.33835e-23", "%+2g",
-__LINE__, -8.342420812231939e+23, "-834242081223193920891390.00745", "%+0.5f",
-__LINE__, -8.347404637940894e+17, "-8.347405e+17", "%+e",
-__LINE__, -8.367002601133880e-12, "-0.000000", "%#2.6f",
-__LINE__, -8.368579538210858e-17, "-8.36858e-17", "%5g",
-__LINE__, -8.392398522472401e-10, "-0.0000", "%.4f",
-__LINE__, -8.393029677635258e-29, " -8E-29", "%7.G",
-__LINE__, -8.393843230819225e-11, "-8.393843E-11", "%E",
-__LINE__, -8.397239871789148e-11, "-8.39724e-11", "%g",
-__LINE__, -8.402316358199041e-29, "-0.000", "%3.3f",
-__LINE__, -8.402910159034304e-14, "-8.4e-14", "%+0.3g",
-__LINE__, -8.414960962391726e+09, "-8414960962.391726", "%#f",
-__LINE__, -8.417512471384889e-28, "-8.417512e-28", "%e",
-__LINE__, -8.418719240222911e+21, "-8418719240222911182058.851409", "%f",
-__LINE__, -8.421210956044195e-09, "-0.00000", "%.5f",
-__LINE__, -8.422001733529095e+24, "-8E+24", "%0.G",
-__LINE__, -8.443614453772469e+21, "-8.44361E+21", "%+G",
-__LINE__, -8.445883044175737e-19, "-0", "%+1.f",
-__LINE__, -8.460545304711022e-01, "-0.846055", "%G",
-__LINE__, -8.470462532754567e+12, "-8.47E+12", "%6.3G",
-__LINE__, -8.478488782426476e-07, "-8.478489E-07", "%E",
-__LINE__, -8.478657582923923e+09, "-8.5e+09", "%.2g",
-__LINE__, -8.482732098043366e+12, "-8482732098043", "%5.f",
-__LINE__, -8.489112373854447e+07, "-8.489e+07", "%#3.3e",
-__LINE__, -8.494153144629106e+02, "-849.415", "%+g",
-__LINE__, -8.496331191616493e+28, "-8E+28", "%+6.G",
-__LINE__, -8.503711894495339e+05, "-850371", "%g",
-__LINE__, -8.505271893964268e+14, "-8.505272E+14", "%E",
-__LINE__, -8.509873985358741e+15, "-9.e+15", "%#7.g",
-__LINE__, -8.518336897898081e-20, "-8.51834E-20", "%G",
-__LINE__, -8.529588044136128e+21, "-8.529588E+21", "%E",
-__LINE__, -8.539706586811079e-23, "-8.53971E-23", "%G",
-__LINE__, -8.545924619642008e+10, "-8.545925e+10", "%6e",
-__LINE__, -8.572893681637353e+09, "-8.57289E+09", "%G",
-__LINE__, -8.585483717692345e+29, "-8.58548E+29", "%+G",
-__LINE__, -8.586092014292309e+27, "-8.59e+27", "%.2e",
-__LINE__, -8.604716827086833e-26, "-8.60472e-26", "%g",
-__LINE__, -8.621349224186615e-04, "-0.000862", "%f",
-__LINE__, -8.626097065201103e-21, " -0", "%5.f",
-__LINE__, -8.631700514212522e-16, "-8.631701E-16", "%+E",
-__LINE__, -8.634703359975640e-09, "-0.000000", "%+5f",
-__LINE__, -8.639393025443855e-17, "-8.63939e-17", "%g",
-__LINE__, -8.640641942556812e-11, "-8.64064e-11", "%#g",
-__LINE__, -8.646260250525495e-09, "-0.000", "%.3f",
-__LINE__, -8.667322015806242e+09, "-8667322015.806242", "%+#f",
-__LINE__, -8.690705655554451e+10, "-8.690706E+10", "%#E",
-__LINE__, -8.714299893763934e-07, "-8.7143E-07", "%.5G",
-__LINE__, -8.715729756264988e+27, "-8.71573E+27", "%+.6G",
-__LINE__, -8.716518487180945e+16, "-9e+16", "%3.e",
-__LINE__, -8.744404488756237e+25, "-87444044887562366596966967.335902", "%4f",
-__LINE__, -8.754720498369242e+13, "-8.75472e+13", "%g",
-__LINE__, -8.763198097931010e-19, "-8.76320e-19", "%#g",
-__LINE__, -8.779007408852458e+28, "-8.77901E+28", "%G",
-__LINE__, -8.794576202907937e+11, "-8.79458E+11", "%#2.6G",
-__LINE__, -8.799091520612418e-11, "-8.799E-11", "%3.4G",
-__LINE__, -8.799246265524921e+11, "-8.79925E+11", "%G",
-__LINE__, -8.809010508550436e-04, "-8.8090E-04", "%.4E",
-__LINE__, -8.817389999872653e-10, "-8.81739e-10", "%g",
-__LINE__, -8.842022428985267e-28, "-8.842022E-28", "%E",
-__LINE__, -8.851265987586864e-07, "-0.000001", "%f",
-__LINE__, -8.861985131432196e+03, "-8861.985", "%+.7G",
-__LINE__, -8.874449013455113e-29, "-8.874449e-29", "%e",
-__LINE__, -8.878752609483453e+18, "-8.87875E+18", "%G",
-__LINE__, -8.882501665315313e-04, "-0.00088825", "%+G",
-__LINE__, -8.892056241505784e-14, "-8.89206E-14", "%G",
-__LINE__, -8.895327674961603e-30, "-8.89533E-30", "%G",
-__LINE__, -8.900059462213669e-30, "-8.900059E-30", "%+#E",
-__LINE__, -8.957100548759815e+18, "-9e+18", "%3.0e",
-__LINE__, -8.961352369869012e-30, "-8.961352e-30", "%+#2e",
-__LINE__, -8.962296474587800e+02, "-896", "%4.f",
-__LINE__, -8.962536469328530e-12, "-8.96254E-12", "%G",
-__LINE__, -8.963299420391932e+21, "-8.9633e+21", "%g",
-__LINE__, -8.967736672941522e-11, "-8.96774e-11", "%g",
-__LINE__, -8.994077362462679e+11, "-8.9940774e+11", "%+#.7e",
-__LINE__, -9.000452862345622e+15, "-9e+15", "%2.e",
-__LINE__, -9.007489135361462e+07, "-9.0075E+07", "%+2.4E",
-__LINE__, -9.036271805879910e+16, "-9.03627E+16", "%G",
-__LINE__, -9.036319073700248e+22, "-9.03632e+22", "%1g",
-__LINE__, -9.043207635989237e+11, "-9.043208e+11", "%#e",
-__LINE__, -9.043856598625815e-26, "-9e-26", "%+1.g",
-__LINE__, -9.052760561065698e+14, "-9.052761E+14", "%E",
-__LINE__, -9.066480297957160e-06, "-9E-06", "%+1.G",
-__LINE__, -9.070971376440752e-01, "-0.907097", "%g",
-__LINE__, -9.073301831888273e+09, "-9.07330E+09", "%#G",
-__LINE__, -9.091228662702147e+28, "-9E+28", "%4.G",
-__LINE__, -9.093652024983832e+04, "-9.093652E+04", "%7.6E",
-__LINE__, -9.098945831139295e-04, "-9.098946E-04", "%+1.6E",
-__LINE__, -9.124981449916591e+05, "-912498", "%G",
-__LINE__, -9.132038703003394e-02, "-0.0913204", "%#G",
-__LINE__, -9.138271437433964e-04, "-0.000913827", "%5g",
-__LINE__, -9.158186427463699e-04, "-0.000915819", "%g",
-__LINE__, -9.160846358172526e+16, "-9.160846E+16", "%#E",
-__LINE__, -9.160884330810163e+17, "-9E+17", "%+5.G",
-__LINE__, -9.190271387375542e+21, "-9.19027e+21", "%+g",
-__LINE__, -9.191651872412619e-04, "-9.191652E-04", "%E",
-__LINE__, -9.196426161984341e-10, "-9E-10", "%4.G",
-__LINE__, -9.201074139774962e+09, "-9E+09", "%4.G",
-__LINE__, -9.223294284802762e+09, "-9.22329E+09", "%G",
-__LINE__, -9.224740266754996e+02, "-9E+02", "%6.0G",
-__LINE__, -9.231583780512302e-01, " -0.9", "%6.g",
-__LINE__, -9.241998826543689e+07, "-92419988", "%1.f",
-__LINE__, -9.243603351372128e+27, "-9.243603e+27", "%#e",
-__LINE__, -9.255922697415071e+11, "-9.25592e+11", "%g",
-__LINE__, -9.265734968114124e-02, "-0.092657", "%f",
-__LINE__, -9.273132068521061e+11, "-9.27313E+11", "%G",
-__LINE__, -9.276017912826685e+27, "-9.E+27", "%+#5.G",
-__LINE__, -9.279781279788505e+17, "-9.27978E+17", "%7G",
-__LINE__, -9.305057549822465e-19, "-9.30506E-19", "%5G",
-__LINE__, -9.313182384508469e+18, "-9.31318E+18", "%G",
-__LINE__, -9.313350925182641e-12, "-9.31E-12", "%.3G",
-__LINE__, -9.362202657509130e+08, "-9e+08", "%.1g",
-__LINE__, -9.367344757598381e+19, "-9.36734e+19", "%g",
-__LINE__, -9.374222399774300e+26, "-9.37422e+26", "%4g",
-__LINE__, -9.385734023305105e+02, "-9.385734e+02", "%+0e",
-__LINE__, -9.392042570618909e+17, "-9.39204E+17", "%G",
-__LINE__, -9.395742939311926e+20, "-939574293931192627837.8451", "%.4f",
-__LINE__, -9.409066155962469e+09, "-9.40907E+09", "%#G",
-__LINE__, -9.412851077799790e+23, "-9.412851E+23", "%E",
-__LINE__, -9.431808019049818e+08, "-9.43181e+08", "%g",
-__LINE__, -9.465236900519924e-27, "-9.46524e-27", "%g",
-__LINE__, -9.478330386415852e+17, "-9.478330e+17", "%e",
-__LINE__, -9.510393719697428e+15, "-9.51039E+15", "%+G",
-__LINE__, -9.534229599909890e-09, "-0.000000", "%f",
-__LINE__, -9.541731189284823e-17, "-1.E-16", "%+#7.G",
-__LINE__, -9.548861908445902e+24, "-9548861908445902102471336.547751", "%f",
-__LINE__, -9.578447281451794e+14, "-957844728145179", "%5.f",
-__LINE__, -9.580512736933464e+11, "-9.58051E+11", "%G",
-__LINE__, -9.596838169770637e-28, "-1E-27", "%+6.G",
-__LINE__, -9.597528852877852e-22, "-1e-21", "%2.1g",
-__LINE__, -9.599943658427051e+02, "-9.599944E+02", "%E",
-__LINE__, -9.603227991185260e-14, "-1E-13", "%+0.E",
-__LINE__, -9.606818733892343e+08, "-960681873.389", "%1.3f",
-__LINE__, -9.617442692720937e+16, "-9.61744E+16", "%G",
-__LINE__, -9.628685516961109e+29, "-9.62869e+29", "%3g",
-__LINE__, -9.638354750455226e-11, "-0.000000", "%f",
-__LINE__, -9.644266379029137e+16, "-96442663790291369.707575", "%f",
-__LINE__, -9.645563533575482e+06, "-1E+07", "%1.G",
-__LINE__, -9.645993536742941e-29, "-9.64599e-29", "%+g",
-__LINE__, -9.647147223548563e+00, "-9.647147e+00", "%e",
-__LINE__, -9.671225879906396e-11, "-0", "%0.f",
-__LINE__, -9.675000471729906e-09, "-9.675000E-09", "%E",
-__LINE__, -9.683992878297159e-26, "-9.68e-26", "%2.2e",
-__LINE__, -9.695491325144765e+10, "-9.69549E+10", "%#G",
-__LINE__, -9.695661526907136e-24, " -0.", "%#6.f",
-__LINE__, -9.703124881970338e+07, "-9.703e+07", "%0.4g",
-__LINE__, -9.707701257031864e+26, "-970770125703186437249314622.022212", "%f",
-__LINE__, -9.709879792694702e+09, "-9.709880E+09", "%E",
-__LINE__, -9.736052226907940e+26, "-9.73605e+26", "%+#g",
-__LINE__, -9.745037157520795e+07, "-9.74504e+07", "%#5.6g",
-__LINE__, -9.757293950670832e-29, "-9.757E-29", "%0.4G",
-__LINE__, -9.762126832689880e+12, "-9.76213E+12", "%G",
-__LINE__, -9.801328150341989e-01, " -1", "%7.G",
-__LINE__, -9.837332964629669e-20, "-9.83733E-20", "%0G",
-__LINE__, -9.837790327283010e+23, "-1E+24", "%.1G",
-__LINE__, -9.839636176463729e+23, "-9.83964E+23", "%#6.5E",
-__LINE__, -9.841454250618272e+11, "-9.84E+11", "%+2.3G",
-__LINE__, -9.852920805249280e-12, "-9.852921e-12", "%.7g",
-__LINE__, -9.854092850182351e+12, "-9.85409e+12", "%0g",
-__LINE__, -9.866796026839712e+02, "-9.9E+02", "%#.1E",
-__LINE__, -9.867413260289803e-21, "-1e-20", "%.1g",
-__LINE__, -9.882136052131983e-08, "-9.88214e-08", "%g",
-__LINE__, -9.882755697941866e+20, "-9.882756E+20", "%E",
-__LINE__, -9.897275811087050e+20, "-9.9E+20", "%0.3G",
-__LINE__, -9.899860651812364e-04, "-9.899861e-04", "%e",
-__LINE__, -9.906754113555550e-11, "-9.90675e-11", "%3g",
-__LINE__, -9.926067557389940e+11, "-9.92607E+11", "%G",
-__LINE__, -9.929638609014063e+17, "-992963860901406292.214233", "%1f",
-__LINE__, -9.941214552193284e-24, "-0.000000", "%+#f",
-__LINE__, -9.942875240256573e+14, "-9.942875e+14", "%+1e",
-__LINE__, -9.944492909695798e-01, "-9.944E-01", "%.3E",
-__LINE__, -9.954710507359939e-27, "-1e-26", "%+0.2g",
-__LINE__, -9.955410507742851e+03, "-9955.41", "%+G",
-__LINE__, -9.974437672251590e+02, "-997.444", "%#G",
-__LINE__, -9.975683165288929e-26, "-9.97568E-26", "%6G",
-__LINE__, 1.003827370583415e+06, "1003827.370583", "%3f",
-__LINE__, 1.004189065268560e-27, "1.004189E-27", "%.7G",
-__LINE__, 1.005840059175462e-28, "+1.00584E-28", "%+G",
-__LINE__, 1.006586790090557e-12, "0.000000", "%#f",
-__LINE__, 1.007598594773359e+18, "1.0076E+18", "%G",
-__LINE__, 1.007902307001894e+29, "1.0079e+29", "%g",
-__LINE__, 1.008607405036580e-15, "1.00861E-15", "%6G",
-__LINE__, 1.008769102466771e+16, "+1.00877E+16", "%+G",
-__LINE__, 1.009545698372534e-08, "+1E-08", "%+0.0G",
-__LINE__, 1.010173673945099e-12, "+1.01017e-12", "%+#0g",
-__LINE__, 1.011375000606627e+09, "1011375000.606627", "%f",
-__LINE__, 1.011944652221650e+15, "1011944652221649.98", "%3.2f",
-__LINE__, 1.013057788090379e-21, "0.000000", "%#f",
-__LINE__, 1.014525729953198e+15, "1.01453e+15", "%3g",
-__LINE__, 1.016760538234615e-21, "+1.016761E-21", "%+3E",
-__LINE__, 1.017052611781237e-29, "0.000000", "%f",
-__LINE__, 1.018471223361229e+14, "1.01847E+14", "%G",
-__LINE__, 1.021646959220873e+15, "1021646959220872.6", "%4.1f",
-__LINE__, 1.022304833976590e+27, "1.0223e+27", "%g",
-__LINE__, 1.022500312067325e-12, "1.0225e-12", "%6g",
-__LINE__, 1.023019285462627e-20, "0.000000", "%f",
-__LINE__, 1.024192579400824e+06, "1.02419e+06", "%g",
-__LINE__, 1.024517953555766e-28, "1.02452E-28", "%G",
-__LINE__, 1.026673589339585e+21, "1.02667E+21", "%G",
-__LINE__, 1.027231090958880e-19, "1.E-19", "%#3.G",
-__LINE__, 1.028249904956487e-27, "1E-27", "%5.G",
-__LINE__, 1.028570144661448e-28, "+1.02857E-28", "%+G",
-__LINE__, 1.028934898454705e-13, "+1.028935E-13", "%+E",
-__LINE__, 1.029071053545906e-26, "1.029071E-26", "%E",
-__LINE__, 1.032672895881148e-30, "+1.032673E-30", "%+E",
-__LINE__, 1.033502358979511e+06, "1.0335E+06", "%.5G",
-__LINE__, 1.036790427717847e+19, "1e+19", "%4.g",
-__LINE__, 1.037022928821648e+03, "1037.02", "%5g",
-__LINE__, 1.040551683941284e+14, "1.04055E+14", "%G",
-__LINE__, 1.044499252101308e-17, "1.044499E-17", "%E",
-__LINE__, 1.045791899570889e+15, "+1.04579e+15", "%+g",
-__LINE__, 1.048730383198703e+28, "1.049e+28", "%.4g",
-__LINE__, 1.050654419882509e-18, "0.000000", "%f",
-__LINE__, 1.052600569262127e-27, "+0.000", "%+2.3f",
-__LINE__, 1.053213014784149e+15, "1E+15", "%4.G",
-__LINE__, 1.057553916225948e-15, "+0.000000", "%+4f",
-__LINE__, 1.058191244482453e+19, "1.058e+19", "%.3e",
-__LINE__, 1.058746269793972e-26, "+1.1E-26", "%+.2G",
-__LINE__, 1.058793271960762e-01, "+1.058793E-01", "%+4E",
-__LINE__, 1.058869592738370e-19, "1.05887e-19", "%3g",
-__LINE__, 1.060402312803008e+15, "1060402312803008.229025", "%f",
-__LINE__, 1.061106284763095e+00, "1.061106", "%0f",
-__LINE__, 1.061180160987467e+09, "1e+09", "%2.g",
-__LINE__, 1.061181537176067e-06, "+1.06118e-06", "%+g",
-__LINE__, 1.065021381771174e+20, "1.06502e+20", "%g",
-__LINE__, 1.065464040401130e-16, "1.065464e-16", "%e",
-__LINE__, 1.065573419819459e-05, "0.00001", "%.5f",
-__LINE__, 1.066107764306644e+13, "1.066108e+13", "%#e",
-__LINE__, 1.071318759598956e+12, "1.071319e+12", "%e",
-__LINE__, 1.071564727222321e+10, "1.072E+10", "%3.4G",
-__LINE__, 1.074652481218139e+14, "1.0747E+14", "%.4E",
-__LINE__, 1.078453684911309e-02, "0.0107845", "%g",
-__LINE__, 1.078550811446675e-05, "1.07855e-05", "%g",
-__LINE__, 1.078780494515273e-04, "0.000107878", "%4G",
-__LINE__, 1.079467488876157e-16, "+1.079467E-16", "%+E",
-__LINE__, 1.080529722917934e-20, "0.000000", "%f",
-__LINE__, 1.082169127709439e+01, "10.8217", "%#5g",
-__LINE__, 1.087241285590951e+22, "1E+22", "%4.G",
-__LINE__, 1.091049208406195e-14, "0.0000", "%.4f",
-__LINE__, 1.095316064213237e+16, "+1e+16", "%+0.g",
-__LINE__, 1.095349083237975e-04, "1.095349e-04", "%5e",
-__LINE__, 1.098002465452836e+12, "1098002465452.836205", "%f",
-__LINE__, 1.098445764138997e+13, "1.09845E+13", "%G",
-__LINE__, 1.099968047892474e-13, "1.1e-13", "%2.5g",
-__LINE__, 1.101017598311363e-04, "0.000110102", "%G",
-__LINE__, 1.102776332077817e+18, "1.103e+18", "%.3e",
-__LINE__, 1.103734053887830e-01, "0.110373", "%f",
-__LINE__, 1.105730106869006e-03, "0.00110573", "%g",
-__LINE__, 1.106366781854058e-10, "1.10637e-10", "%g",
-__LINE__, 1.107354763213839e+15, "1.107355e+15", "%6e",
-__LINE__, 1.108151709609825e-10, "+1.10815E-10", "%+G",
-__LINE__, 1.110054501993647e+21, "+1.11005E+21", "%+G",
-__LINE__, 1.111574814737873e-17, "+1.112E-17", "%+1.4G",
-__LINE__, 1.111865512360108e-15, "1E-15", "%.0G",
-__LINE__, 1.112281568330498e-03, "1.112282e-03", "%.6e",
-__LINE__, 1.112625415174238e+21, "+1.11263e+21", "%+g",
-__LINE__, 1.112744974910395e-02, "0.011127", "%f",
-__LINE__, 1.114726566979885e-10, "1.11473e-10", "%g",
-__LINE__, 1.115395843055731e-20, "+0.000000", "%+6f",
-__LINE__, 1.115983414693121e+15, "1.11598e+15", "%5.6g",
-__LINE__, 1.116118842074266e+27, "1.116119e+27", "%e",
-__LINE__, 1.118386983012328e+19, "11183869830123276400.968280", "%1f",
-__LINE__, 1.119344607892718e-22, "1.119345e-22", "%e",
-__LINE__, 1.120560837110279e-19, "0.000000", "%f",
-__LINE__, 1.123620157906291e-02, "0.0112362", "%G",
-__LINE__, 1.126804857639478e+29, "1.1268E+29", "%#0.5G",
-__LINE__, 1.128962199461581e+11, "1.12896e+11", "%g",
-__LINE__, 1.129878714246809e-16, "1E-16", "%0.0G",
-__LINE__, 1.130331982972407e-06, "+0.", "%+#1.f",
-__LINE__, 1.134167332070028e-16, "0", "%0.0f",
-__LINE__, 1.134248080053598e-28, "0.000000", "%f",
-__LINE__, 1.136023160708119e-10, "+0.000000", "%+1f",
-__LINE__, 1.136167141059036e+23, "113616714105903593434732.101741", "%f",
-__LINE__, 1.136439499920164e+10, "+1.13644E+10", "%+G",
-__LINE__, 1.136859734932182e+24, "1.13686e+24", "%g",
-__LINE__, 1.138985939448731e+09, "1.13899e+09", "%2g",
-__LINE__, 1.139287324790407e-25, "1e-25", "%.1g",
-__LINE__, 1.140559912153251e+06, "1.14056e+06", "%g",
-__LINE__, 1.141318036027086e-26, "1.14132E-26", "%G",
-__LINE__, 1.142586049368452e-20, "+1.14259E-20", "%+7.5E",
-__LINE__, 1.143283863993333e-17, "1.143284E-17", "%3E",
-__LINE__, 1.144637911632432e-28, "1.144638E-28", "%#3E",
-__LINE__, 1.145791416532065e-10, "1.14579e-10", "%g",
-__LINE__, 1.146958047315780e-17, "1.146958e-17", "%e",
-__LINE__, 1.147898346886569e-08, "1E-08", "%3.0E",
-__LINE__, 1.149724744965608e-14, "1.14972e-14", "%5g",
-__LINE__, 1.155383721940441e-10, "1e-10", "%1.g",
-__LINE__, 1.157066617729094e-02, "0", "%1.f",
-__LINE__, 1.157893614537215e+05, "1.157894E+05", "%E",
-__LINE__, 1.160476344451928e-19, "1.2e-19", "%.1e",
-__LINE__, 1.161610499315966e-26, "1.161610E-26", "%E",
-__LINE__, 1.162345042181490e+29, "116234504218148981813385489658.685401", "%5.6f",
-__LINE__, 1.162376053722862e+23, "1.16238e+23", "%g",
-__LINE__, 1.162996084782483e+18, "+1e+18", "%+0.g",
-__LINE__, 1.163544861478966e+26, "1.16354E+26", "%G",
-__LINE__, 1.167300137450931e+06, "1E+06", "%.0G",
-__LINE__, 1.168693829096401e-30, "+1.16869e-30", "%+g",
-__LINE__, 1.172791369381396e+15, "1.173E+15", "%.4G",
-__LINE__, 1.174427110782028e-29, " 1E-29", "%7.G",
-__LINE__, 1.179498322112450e+27, "1179498322112449759657692993.641831", "%f",
-__LINE__, 1.179555606293547e+27, "1.17956e+27", "%3g",
-__LINE__, 1.180815814881269e+06, "1.180816e+06", "%e",
-__LINE__, 1.181494870072805e+20, "1.181495e+20", "%5e",
-__LINE__, 1.181524119225619e+12, "+1181524119225.61917", "%+5.5f",
-__LINE__, 1.182111212289243e-20, "1e-20", "%4.g",
-__LINE__, 1.184503315019769e-27, "1.1845e-27", "%7g",
-__LINE__, 1.186413646767670e+29, "1.18641e+29", "%g",
-__LINE__, 1.186852938885004e-13, "1.18685e-13", "%4g",
-__LINE__, 1.188837612473914e+05, "1e+05", "%.0g",
-__LINE__, 1.190317482928293e-29, "1.190317e-29", "%e",
-__LINE__, 1.190527491143987e+02, "1.190527E+02", "%E",
-__LINE__, 1.191823062060233e-30, "1.2E-30", "%6.2G",
-__LINE__, 1.191926974812428e-23, "1.2e-23", "%.2g",
-__LINE__, 1.193549622366544e-25, "1E-25", "%4.1G",
-__LINE__, 1.195517368629765e-21, "1.195517e-21", "%1.7g",
-__LINE__, 1.195573061651289e-27, "1.19557e-27", "%#g",
-__LINE__, 1.195806681188325e-03, "+0.00120", "%+#.3G",
-__LINE__, 1.196842275192189e-28, "1.19684e-28", "%g",
-__LINE__, 1.197307550969576e+04, "1.1973E+04", "%.4E",
-__LINE__, 1.197608525847607e+15, "1197608525847606.8062805", "%4.7f",
-__LINE__, 1.197801338159407e+04, "11978", "%5G",
-__LINE__, 1.197813329735025e+27, "1.19781E+27", "%7G",
-__LINE__, 1.199483904123253e-12, "1.19948e-12", "%g",
-__LINE__, 1.199535292169766e-09, "1.199535e-09", "%e",
-__LINE__, 1.201478067515135e+05, "120147.806752", "%f",
-__LINE__, 1.202054662662158e+17, "1.20205E+17", "%#G",
-__LINE__, 1.202111922368321e+07, "+1.202112E+07", "%+#E",
-__LINE__, 1.202536892743791e-01, "0.120254", "%#g",
-__LINE__, 1.205698674119882e-29, "1.2057E-29", "%G",
-__LINE__, 1.208091664701942e-13, " 0.", "%#3.f",
-__LINE__, 1.208942413954872e-17, "1.20894E-17", "%G",
-__LINE__, 1.209704891496613e+10, "1.210e+10", "%2.3e",
-__LINE__, 1.211355639334831e+29, "1E+29", "%.0G",
-__LINE__, 1.211447553804203e+17, " 1E+17", "%7.E",
-__LINE__, 1.212481583429790e-16, "1.212482e-16", "%e",
-__LINE__, 1.212849001551862e+26, "121284900155186181613942153.4899157", "%6.7f",
-__LINE__, 1.213057538677801e+06, "1213057.538678", "%#.6f",
-__LINE__, 1.214609592911893e+25, "1.214610e+25", "%#e",
-__LINE__, 1.216086266251665e+01, "1e+01", "%5.e",
-__LINE__, 1.216468565931026e-22, "1.216469E-22", "%1E",
-__LINE__, 1.216503126598765e+14, "+1E+14", "%+0.E",
-__LINE__, 1.216641013695553e-14, "0.000000", "%f",
-__LINE__, 1.223142246779504e-23, "0.000000", "%f",
-__LINE__, 1.223884786443274e+08, "122388479", "%5.f",
-__LINE__, 1.224012562770076e+29, "1.22401e+29", "%0g",
-__LINE__, 1.225098157528297e+14, "1.22510e+14", "%#g",
-__LINE__, 1.226306848505242e-22, "1.22631E-22", "%G",
-__LINE__, 1.227487485547996e-08, "+1.22749e-08", "%+g",
-__LINE__, 1.237206486909689e+02, "+123.721", "%+#.6g",
-__LINE__, 1.240281126177077e-02, "+0.01", "%+3.g",
-__LINE__, 1.241197211306994e-06, "1.241197E-06", "%E",
-__LINE__, 1.241776311097410e+07, "1.241776E+07", "%E",
-__LINE__, 1.245995986024999e-03, "0.001246", "%g",
-__LINE__, 1.246082428199607e+03, "1246.082428", "%f",
-__LINE__, 1.247021567954220e+05, " 1e+05", "%7.g",
-__LINE__, 1.248140089618390e-30, "+1.24814E-30", "%+G",
-__LINE__, 1.248403361652064e-30, "+0.000000", "%+f",
-__LINE__, 1.251098538918842e-26, "+1.251099E-26", "%+E",
-__LINE__, 1.251952633022061e+25, "1.25195e+25", "%g",
-__LINE__, 1.253029705843461e-04, "+1.E-04", "%+#4.E",
-__LINE__, 1.259562132729488e-09, "1e-09", "%1.e",
-__LINE__, 1.261702205492260e-27, "0.000000", "%f",
-__LINE__, 1.265910361926660e-19, "+1.265910e-19", "%+e",
-__LINE__, 1.267411912651087e+12, "1.26741E+12", "%1G",
-__LINE__, 1.267830718285980e-10, "1.26783e-10", "%g",
-__LINE__, 1.268238378987517e-23, "1E-23", "%5.E",
-__LINE__, 1.275543253354167e+10, "1.27554E+10", "%G",
-__LINE__, 1.277255234454465e-10, "1.27726E-10", "%5G",
-__LINE__, 1.280590949834150e-21, "1.280591E-21", "%E",
-__LINE__, 1.285570453788242e-02, "1.285570E-02", "%E",
-__LINE__, 1.287712130719031e+09, "1287712130.719031", "%#f",
-__LINE__, 1.290142876187105e+29, "+1.290143E+29", "%+E",
-__LINE__, 1.293129213191961e+21, "1.29313E+21", "%G",
-__LINE__, 1.293317101334714e-23, "+0.000000", "%+f",
-__LINE__, 1.294506813069071e-13, "0.0", "%3.1f",
-__LINE__, 1.295576232685739e-22, "+0.000000", "%+f",
-__LINE__, 1.296010470431800e-19, "+0.000000", "%+6f",
-__LINE__, 1.298798231947674e+19, "1.2988E+19", "%2G",
-__LINE__, 1.299521114379381e+09, "1.29952E+09", "%G",
-__LINE__, 1.299847637892712e+24, "1.299848e+24", "%e",
-__LINE__, 1.301269777843698e+29, "130126977784369834978406288428.232074", "%f",
-__LINE__, 1.302911786437618e-15, " 0", "%6.f",
-__LINE__, 1.303863159906719e+27, "1303863159906719415559450681", "%0.f",
-__LINE__, 1.304396472326846e-12, "+1E-12", "%+1.0G",
-__LINE__, 1.306180443528427e-30, "+1e-30", "%+.1g",
-__LINE__, 1.308469138968514e+22, "1.30847E+22", "%0G",
-__LINE__, 1.312700156826057e-11, "1.3127e-11", "%g",
-__LINE__, 1.315364075120764e+21, "+1.31536E+21", "%+G",
-__LINE__, 1.320376485288444e-09, "+1.3204E-09", "%+6.5G",
-__LINE__, 1.321434154364635e-08, "1.32143e-08", "%1g",
-__LINE__, 1.322777272579176e+19, "+1e+19", "%+3.e",
-__LINE__, 1.322861663428564e+00, "1.322862E+00", "%#E",
-__LINE__, 1.323566013489230e+14, "+1.323566E+14", "%+1E",
-__LINE__, 1.327446904132973e-20, "+1.32745E-20", "%+4.6G",
-__LINE__, 1.328226362528158e+19, "1e+19", "%2.g",
-__LINE__, 1.329167460803610e+08, "1e+08", "%3.g",
-__LINE__, 1.335371420823160e+14, "1.33537E+14", "%7G",
-__LINE__, 1.336116185095935e-21, "0.000000", "%f",
-__LINE__, 1.338766774704671e-22, "+1.33877e-22", "%+g",
-__LINE__, 1.339199373014647e-12, "1E-12", "%1.E",
-__LINE__, 1.344293357481519e+26, "134429335748151945750805680.290796", "%#2f",
-__LINE__, 1.344328188122843e+29, "1.34433e+29", "%g",
-__LINE__, 1.344382581316972e-05, "1E-05", "%5.0E",
-__LINE__, 1.349835616116184e+11, "134983561611.6", "%2.1f",
-__LINE__, 1.349955669989707e+20, "134995566998970728533.890906", "%7f",
-__LINE__, 1.350230411093841e+20, "135023041109384145386.229648", "%f",
-__LINE__, 1.353391369565576e+10, " 1E+10", "%7.1G",
-__LINE__, 1.356889483699471e+22, "+1.35689E+22", "%+G",
-__LINE__, 1.358141775798243e+24, "+1358141775798242578687791.137781", "%+f",
-__LINE__, 1.358547541975523e-15, "1.35855e-15", "%g",
-__LINE__, 1.363402539800791e+11, "1.3634E+11", "%G",
-__LINE__, 1.363676837988798e+16, "+13636768379887982.4053", "%+2.4f",
-__LINE__, 1.364592026494839e-24, "1.36459e-24", "%g",
-__LINE__, 1.366664212399413e-09, "+1E-09", "%+6.G",
-__LINE__, 1.367446193117463e-17, "1.3674e-17", "%2.4e",
-__LINE__, 1.368681648785823e-18, "1.36868E-18", "%3G",
-__LINE__, 1.370635189583606e+05, "1.370635E+05", "%E",
-__LINE__, 1.371395540772186e-18, "+1.371396e-18", "%+e",
-__LINE__, 1.371945318043159e+10, "1E+10", "%0.E",
-__LINE__, 1.373780604772988e-21, "1e-21", "%3.g",
-__LINE__, 1.374244970441862e-28, "0.000000", "%7.6f",
-__LINE__, 1.375874695067149e-25, "1.37587E-25", "%#3G",
-__LINE__, 1.377165614832621e+20, "1.37717E+20", "%#G",
-__LINE__, 1.381541864946684e-09, "1.38154E-09", "%G",
-__LINE__, 1.382901694835415e+00, "1.382902E+00", "%E",
-__LINE__, 1.384250577530184e-21, "1.384e-21", "%.4g",
-__LINE__, 1.385322753374640e-03, " 1E-03", "%6.E",
-__LINE__, 1.387026156054724e+19, "1.387026E+19", "%E",
-__LINE__, 1.388726735790498e-27, "+1.388727E-27", "%+E",
-__LINE__, 1.388819105742044e+16, "1.38882e+16", "%g",
-__LINE__, 1.389941086024951e-19, "0.000000", "%f",
-__LINE__, 1.390101174785536e+25, "1.3901E+25", "%G",
-__LINE__, 1.392210785638597e+24, "+1.39221E+24", "%+G",
-__LINE__, 1.396148856283474e-26, "1.4e-26", "%7.3g",
-__LINE__, 1.398153728631994e-21, "1.39815E-21", "%G",
-__LINE__, 1.398332446762342e-14, "+1.39833E-14", "%+5G",
-__LINE__, 1.400250919607987e+10, "1.40025E+10", "%G",
-__LINE__, 1.400662469019739e+03, "1.E+03", "%#0.0E",
-__LINE__, 1.401720273747805e-12, "0.000000", "%#f",
-__LINE__, 1.402151358748719e+22, "1.402151e+22", "%e",
-__LINE__, 1.402351913752357e-28, "1.40235E-28", "%#1.6G",
-__LINE__, 1.403285877973810e+13, "+14032858779738.097255", "%+4f",
-__LINE__, 1.404540981735861e+04, "14045.409817", "%4f",
-__LINE__, 1.406420622355064e+19, "1.40642E+19", "%G",
-__LINE__, 1.412552725962301e-29, "+1e-29", "%+1.e",
-__LINE__, 1.413266982485044e+10, "1.41327e+10", "%g",
-__LINE__, 1.413627189411456e+21, "1.41363E+21", "%0G",
-__LINE__, 1.416647216002592e-25, "+0.000000", "%+#f",
-__LINE__, 1.417107155080584e-10, "1e-10", "%1.e",
-__LINE__, 1.418829895346648e+19, "14188298953466484952.912197", "%f",
-__LINE__, 1.419404559267523e-11, "1.4194e-11", "%g",
-__LINE__, 1.422421321425472e+15, "1.422421E+15", "%E",
-__LINE__, 1.424858902008998e+18, "1.42486E+18", "%2.5E",
-__LINE__, 1.428863051254205e+22, "1.428863e+22", "%e",
-__LINE__, 1.429533727936725e-02, "0.0142953", "%g",
-__LINE__, 1.430982219743369e-19, " 1E-19", "%6.G",
-__LINE__, 1.431974118434703e+17, "1E+17", "%3.G",
-__LINE__, 1.432418341970152e+16, "+1.432418e+16", "%+5e",
-__LINE__, 1.433470281650523e+04, "14334.7", "%g",
-__LINE__, 1.434446243424653e+24, " +1e+24", "%+7.g",
-__LINE__, 1.435118019241039e+24, "+1e+24", "%+4.g",
-__LINE__, 1.435691648420278e-01, "0.1435692", "%#4.7g",
-__LINE__, 1.437569598098744e+27, "1.437570E+27", "%#E",
-__LINE__, 1.437633484061726e-25, "+1.43763e-25", "%+7g",
-__LINE__, 1.437866591230707e-13, "1.43787e-13", "%g",
-__LINE__, 1.440593154445915e-01, "+0.144059", "%+1G",
-__LINE__, 1.441368205977342e+16, "1.441368E+16", "%#E",
-__LINE__, 1.441825266684367e+28, "1.44183e+28", "%g",
-__LINE__, 1.442374183199456e+20, "1.442374E+20", "%E",
-__LINE__, 1.445101893951061e-24, "0", "%0.f",
-__LINE__, 1.446037835160094e-20, "+1.44604E-20", "%+2G",
-__LINE__, 1.449245376093616e+04, "1.449245e+04", "%e",
-__LINE__, 1.454126845620100e+09, "1.45413E+09", "%G",
-__LINE__, 1.455764608801107e+09, "1.5e+09", "%6.1e",
-__LINE__, 1.457176183149955e-12, "1.45718e-12", "%#g",
-__LINE__, 1.458821535020046e-05, "1.45882e-05", "%#g",
-__LINE__, 1.460179141161202e-19, "1.460179E-19", "%#E",
-__LINE__, 1.461701055446198e-20, "1.461701e-20", "%#2.7g",
-__LINE__, 1.462408181482172e+10, "1.4624082E+10", "%3.7E",
-__LINE__, 1.463706296748154e+24, "1e+24", "%2.g",
-__LINE__, 1.464891255780761e-19, "+1.46489e-19", "%+g",
-__LINE__, 1.467903978945872e+25, "1.4679E+25", "%G",
-__LINE__, 1.468585992857062e+22, "14685859928570619281629.205943", "%f",
-__LINE__, 1.469803528668286e+29, "+1E+29", "%+6.G",
-__LINE__, 1.469883002609266e-23, "1.E-23", "%#2.E",
-__LINE__, 1.469941481858809e+08, "+146994148.185881", "%+f",
-__LINE__, 1.470744493304611e+13, "1.47074e+13", "%g",
-__LINE__, 1.471857261085004e+23, "1E+23", "%2.G",
-__LINE__, 1.474419778873037e+06, "1474419.7789", "%#.4f",
-__LINE__, 1.483134762223381e-03, "0", "%0.0f",
-__LINE__, 1.483575501240724e-13, "1.48358e-13", "%g",
-__LINE__, 1.486068112294452e+20, "1.486068e+20", "%e",
-__LINE__, 1.488665528787761e-03, " +0", "%+4.f",
-__LINE__, 1.492145267536713e+07, "14921452.675367", "%f",
-__LINE__, 1.492589762884761e-01, "0.149259", "%f",
-__LINE__, 1.494784286168215e+01, "1.494784E+01", "%E",
-__LINE__, 1.495945331501655e+04, "1.5e+04", "%.2g",
-__LINE__, 1.501383201904700e+14, "2e+14", "%1.g",
-__LINE__, 1.501387105011959e-02, "0.0150139", "%g",
-__LINE__, 1.505784488562271e+26, "1.50578e+26", "%5g",
-__LINE__, 1.506367986495534e+10, "1.50637e+10", "%2g",
-__LINE__, 1.507421710226296e+19, "1.507422E+19", "%#E",
-__LINE__, 1.507960881206134e+16, "2e+16", "%.0g",
-__LINE__, 1.508974301049424e+14, "+1.508974E+14", "%+E",
-__LINE__, 1.509204025111090e-18, "1.509204E-18", "%E",
-__LINE__, 1.511351799767759e+21, "1511351799767759462866.93397", "%.5f",
-__LINE__, 1.511712197184520e-06, "+1.51171e-06", "%+1g",
-__LINE__, 1.514703727491400e+02, "151.47", "%.5g",
-__LINE__, 1.514855355408287e+04, "15148.6", "%g",
-__LINE__, 1.516256896575301e+06, "1.516257e+06", "%.6e",
-__LINE__, 1.517712083681069e+14, "1.51771e+14", "%0g",
-__LINE__, 1.522102209167607e-18, "1.52210e-18", "%#g",
-__LINE__, 1.526264862895663e-12, "0.000000", "%f",
-__LINE__, 1.527165480858125e+10, "1.527e+10", "%.4g",
-__LINE__, 1.528363280308369e+00, "+1.52836", "%+0G",
-__LINE__, 1.529108490733420e-22, "1.529108E-22", "%E",
-__LINE__, 1.529783364474522e+19, "15297833644745216119.531506", "%7f",
-__LINE__, 1.530698363199346e-01, "0.1531", "%#.4f",
-__LINE__, 1.531520796537450e+22, "1.53152E+22", "%G",
-__LINE__, 1.533314559644813e+06, "+1533314.559645", "%+f",
-__LINE__, 1.534682791112854e+01, "+15.3468", "%+0G",
-__LINE__, 1.534714026386730e-11, "0.000000", "%f",
-__LINE__, 1.537145729498115e+00, "1.537146E+00", "%E",
-__LINE__, 1.538740040875751e-23, "1.538740E-23", "%E",
-__LINE__, 1.546248240596482e-03, "0.001546", "%f",
-__LINE__, 1.546808012239302e-09, "+1.54681E-09", "%+G",
-__LINE__, 1.546903877359107e+06, "1.5e+06", "%.2g",
-__LINE__, 1.550153973747718e-18, "2e-18", "%.0g",
-__LINE__, 1.551703460384378e+00, "+1.5517", "%+.4f",
-__LINE__, 1.553995673101369e+29, "1.554E+29", "%G",
-__LINE__, 1.555477017531899e+28, "1.55548e+28", "%g",
-__LINE__, 1.555548963448462e+12, "1555548963448.46227", "%6.5f",
-__LINE__, 1.558702451007712e+16, "2e+16", "%5.1g",
-__LINE__, 1.561641587723724e+29, "1.561642e+29", "%e",
-__LINE__, 1.561868589559509e-05, "1.56187E-05", "%G",
-__LINE__, 1.565229056438949e+13, "1.56523e+13", "%1.6g",
-__LINE__, 1.570074406600442e+14, "+1.57007E+14", "%+4G",
-__LINE__, 1.570951909913194e+13, "1.57095E+13", "%.6G",
-__LINE__, 1.572186421520727e-30, "+1.57219e-30", "%+g",
-__LINE__, 1.574374582066945e+12, "1.57e+12", "%5.2e",
-__LINE__, 1.577789404823585e+12, "1.577789E+12", "%E",
-__LINE__, 1.579641278389186e+04, "15796.413", "%7.3f",
-__LINE__, 1.581602330975388e+17, "1.5816E+17", "%#.5G",
-__LINE__, 1.587809692297490e-18, "+1.58781e-18", "%+2g",
-__LINE__, 1.588672954832388e-05, "1.58867E-05", "%G",
-__LINE__, 1.594548954259978e+25, "+1.595e+25", "%+.3e",
-__LINE__, 1.596653742160718e+10, "15966537421.6072", "%.4f",
-__LINE__, 1.597416186584641e+25, "1.59742e+25", "%g",
-__LINE__, 1.597810706039500e-04, "0.000159781", "%g",
-__LINE__, 1.601425691153542e+01, "16.0143", "%G",
-__LINE__, 1.601491150913706e-15, "+1.60149e-15", "%+g",
-__LINE__, 1.609357026469645e+02, "160.936", "%0g",
-__LINE__, 1.611064881461188e+06, "+1.611065E+06", "%+E",
-__LINE__, 1.611324319640770e-03, "0.00161132", "%G",
-__LINE__, 1.613202907940803e+19, "1.6E+19", "%#.1E",
-__LINE__, 1.613883500056636e-12, "0.000000", "%5f",
-__LINE__, 1.618254213010772e+07, "16182542.130108", "%6f",
-__LINE__, 1.620441271211248e-08, "1.62044E-08", "%0G",
-__LINE__, 1.622548435024803e-01, "+0.162255", "%+5G",
-__LINE__, 1.623740394555269e+19, "16237403945552689066.289531", "%3f",
-__LINE__, 1.625774250389937e+18, "1.625774e+18", "%1e",
-__LINE__, 1.626300864432426e-02, "0.016263", "%G",
-__LINE__, 1.626351146877694e-11, "1.6263511e-11", "%2.7e",
-__LINE__, 1.626568757587995e+25, "16265687575879949733348439.62220", "%6.5f",
-__LINE__, 1.626717482094360e-28, "+1.626717e-28", "%+3e",
-__LINE__, 1.630801585998995e-28, "1.6308e-28", "%0g",
-__LINE__, 1.631827173682962e+03, "1632", "%1.4g",
-__LINE__, 1.631907571243379e+18, "1631907571243378818.337533", "%f",
-__LINE__, 1.632058420447239e-14, " +2E-14", "%+7.G",
-__LINE__, 1.632847882621240e+18, "+1.63285E+18", "%+2G",
-__LINE__, 1.637329146233172e-09, "+1.63733e-09", "%+g",
-__LINE__, 1.638315287442427e-16, "+1.63832E-16", "%+G",
-__LINE__, 1.641284849351445e+15, "1641284849351445.096488", "%f",
-__LINE__, 1.644871927486929e+10, "2e+10", "%1.e",
-__LINE__, 1.645917293047431e-19, "1.64592e-19", "%.6g",
-__LINE__, 1.649201265647819e-07, "0.000000", "%f",
-__LINE__, 1.650169065733559e+23, "165016906573355903731226.135278", "%3f",
-__LINE__, 1.651217291298196e-30, "2E-30", "%4.G",
-__LINE__, 1.652680660160331e+08, "2.e+08", "%#3.g",
-__LINE__, 1.654171892948767e-15, "1.65417e-15", "%g",
-__LINE__, 1.655435863725412e+17, "+1.655436e+17", "%+#e",
-__LINE__, 1.656015606204101e+28, "+1.7E+28", "%+3.2G",
-__LINE__, 1.656814723110478e-21, "+0.000000", "%+f",
-__LINE__, 1.658632655199721e-19, "2.E-19", "%#4.G",
-__LINE__, 1.659915061311444e+27, "1.66E+27", "%.3G",
-__LINE__, 1.664258574522914e-29, "+1.664259E-29", "%+E",
-__LINE__, 1.667662840654469e-28, "+2e-28", "%+0.g",
-__LINE__, 1.673124993246863e-25, "+0.000000", "%+f",
-__LINE__, 1.677788498058833e-20, "1.678e-20", "%.4g",
-__LINE__, 1.681211731173386e-07, "1.68121e-07", "%0.6g",
-__LINE__, 1.686341560076196e+02, "169", "%.0f",
-__LINE__, 1.686507685287281e+08, "1.686508E+08", "%E",
-__LINE__, 1.689500448795801e+03, "+1689.500449", "%+0f",
-__LINE__, 1.690639426041009e-13, "2e-13", "%5.0g",
-__LINE__, 1.691554939595928e+16, "+1.6916e+16", "%+.5g",
-__LINE__, 1.698597126229626e-09, "1.699e-09", "%3.4g",
-__LINE__, 1.700093083173516e+16, "17000930831735159", "%5.f",
-__LINE__, 1.703653732982710e+13, "+1.70365e+13", "%+g",
-__LINE__, 1.705353380573352e-16, "0.000000", "%f",
-__LINE__, 1.705973328700179e-26, "1.70597e-26", "%5g",
-__LINE__, 1.717797289369145e+22, "+1.717797E+22", "%+7E",
-__LINE__, 1.722819196705361e-28, "1.722819E-28", "%1.7G",
-__LINE__, 1.723775772891202e+01, "17.237758", "%f",
-__LINE__, 1.723787102325353e-23, "0.000000", "%2f",
-__LINE__, 1.724551301171870e-13, "0.000000", "%f",
-__LINE__, 1.726098078655758e-20, "0.0000000", "%7.7f",
-__LINE__, 1.726302822039762e+18, "+2E+18", "%+1.G",
-__LINE__, 1.726659209108151e+18, "+1.72666E+18", "%+6G",
-__LINE__, 1.728324925097269e-25, "1.728325e-25", "%7e",
-__LINE__, 1.728357491215602e+02, "172.836", "%G",
-__LINE__, 1.729612227517587e+22, "1.729612e+22", "%e",
-__LINE__, 1.731753104740805e-06, "1.73175e-06", "%2g",
-__LINE__, 1.736066279733589e+18, "+1.736066E+18", "%+3E",
-__LINE__, 1.736626769480182e-19, "2e-19", "%.0g",
-__LINE__, 1.737445267713118e-13, " 2e-13", "%7.g",
-__LINE__, 1.739264683023077e+05, "173926.468302", "%f",
-__LINE__, 1.739423702667596e-16, "+1.73942e-16", "%+g",
-__LINE__, 1.741053616961658e-14, "1.74105E-14", "%G",
-__LINE__, 1.741085952255057e+29, "1.7e+29", "%#.1e",
-__LINE__, 1.743673705633426e+03, "2E+03", "%5.0G",
-__LINE__, 1.750940899205665e+27, "1.75094e+27", "%g",
-__LINE__, 1.753871003884151e-26, "0.", "%#.0f",
-__LINE__, 1.755237470854478e-14, "1.755237e-14", "%4e",
-__LINE__, 1.757491419837315e-03, "0.002", "%1.G",
-__LINE__, 1.758657797688126e+26, "+1.75866E+26", "%+#G",
-__LINE__, 1.760491452270889e+08, "1.76049E+08", "%G",
-__LINE__, 1.760816275862939e-10, "2e-10", "%.1g",
-__LINE__, 1.760905893493003e-22, "1.76e-22", "%.2e",
-__LINE__, 1.762101125986743e-12, "2e-12", "%.0g",
-__LINE__, 1.763855968659571e+27, "1.763856E+27", "%E",
-__LINE__, 1.764595217341348e-13, "1.764595E-13", "%E",
-__LINE__, 1.766737296048445e+08, "+1.77e+08", "%+.3g",
-__LINE__, 1.769916386969961e-05, "+1.76992e-05", "%+g",
-__LINE__, 1.773873506344176e-01, "1.773874e-01", "%e",
-__LINE__, 1.775392554371421e+03, "+1775.39", "%+3.2f",
-__LINE__, 1.776007623006870e+24, "1776007623006870161930237.372871", "%f",
-__LINE__, 1.777418921678653e-27, " 0", "%6.f",
-__LINE__, 1.780967607234234e-18, "1.780968E-18", "%E",
-__LINE__, 1.782510583486435e+24, "+2e+24", "%+3.g",
-__LINE__, 1.784002921603004e+14, "1.784E+14", "%G",
-__LINE__, 1.784231151778382e+11, "1.7842E+11", "%.5G",
-__LINE__, 1.785589091453195e+02, " 179.", "%#5.f",
-__LINE__, 1.786402639400039e+19, "2e+19", "%0.g",
-__LINE__, 1.786506485794647e-25, "2E-25", "%.1G",
-__LINE__, 1.787513971482493e-04, "+0.000178751", "%+G",
-__LINE__, 1.799765409320039e+23, "179976540932003885586710", "%6.0f",
-__LINE__, 1.800451864218989e+08, "+1.80045e+08", "%+g",
-__LINE__, 1.800743538258572e+04, " +18007", "%+7.f",
-__LINE__, 1.801583764453362e+25, "1.8016e+25", "%0.5g",
-__LINE__, 1.804502093739547e+14, "2e+14", "%2.g",
-__LINE__, 1.805600104488678e-17, "1.805600E-17", "%E",
-__LINE__, 1.811342448081048e+17, "1.811342e+17", "%.6e",
-__LINE__, 1.812252160066930e+19, "2e+19", "%0.e",
-__LINE__, 1.816287564395273e+02, "182", "%2.f",
-__LINE__, 1.817097386762552e-13, "2E-13", "%3.1G",
-__LINE__, 1.817881381387254e+06, "1.81788E+06", "%G",
-__LINE__, 1.818416380830953e-30, "1.81842E-30", "%G",
-__LINE__, 1.824788290177454e-23, "1.82479e-23", "%g",
-__LINE__, 1.827832506678437e-18, "1.82783E-18", "%G",
-__LINE__, 1.828048053242609e+01, "18.2805", "%g",
-__LINE__, 1.828939681844203e-21, "1.82894E-21", "%.6G",
-__LINE__, 1.829763900251753e+12, "1829763900251.752773", "%1f",
-__LINE__, 1.833100407114602e-05, "0.000018", "%#f",
-__LINE__, 1.833672780034284e-07, "1.833673e-07", "%e",
-__LINE__, 1.834307692387540e+21, "2E+21", "%5.G",
-__LINE__, 1.835119931666753e+14, "+1.835120e+14", "%+e",
-__LINE__, 1.835956566920861e-26, "0.000000", "%#f",
-__LINE__, 1.837784131899354e+22, "1.83778E+22", "%G",
-__LINE__, 1.842867094224664e-09, "1.84287e-09", "%g",
-__LINE__, 1.844234823805319e+28, "2E+28", "%1.G",
-__LINE__, 1.844877682008962e+12, "1.84488e+12", "%g",
-__LINE__, 1.846530424340488e-22, "1.846530e-22", "%#.7g",
-__LINE__, 1.849111603036448e-08, "0.00", "%.2f",
-__LINE__, 1.850158752678734e+04, "+18502", "%+.5G",
-__LINE__, 1.851431391104701e-06, " +2e-06", "%+7.e",
-__LINE__, 1.851487430609031e-04, "0.000185149", "%G",
-__LINE__, 1.853171650128773e+03, "1853.17", "%G",
-__LINE__, 1.854743263740068e-16, "1.854743E-16", "%6.6E",
-__LINE__, 1.864399020932753e-11, "+0.000000", "%+f",
-__LINE__, 1.865028568072397e-22, "1.86503E-22", "%.6G",
-__LINE__, 1.868128423759223e+14, "1.86813E+14", "%4G",
-__LINE__, 1.868453558435480e+21, "1.86845E+21", "%G",
-__LINE__, 1.870663011627498e-06, "1.87E-06", "%.3G",
-__LINE__, 1.873273487748907e+17, "+1.873273E+17", "%+E",
-__LINE__, 1.878885220839805e-04, "0.000187889", "%G",
-__LINE__, 1.879102515623569e+17, "1.8791e+17", "%g",
-__LINE__, 1.889343972100858e-10, "2E-10", "%2.E",
-__LINE__, 1.891833282879762e-24, "+2e-24", "%+.1g",
-__LINE__, 1.895148778941240e-07, "0.000000", "%0f",
-__LINE__, 1.896950834067578e-28, "+1.89695e-28", "%+#g",
-__LINE__, 1.898464546986629e-05, "1.898465e-05", "%.7g",
-__LINE__, 1.900851427578321e-19, "1.90085e-19", "%6g",
-__LINE__, 1.901171344577750e+27, "1.901171e+27", "%7.7g",
-__LINE__, 1.903563335316359e+02, "190.356", "%0g",
-__LINE__, 1.903817306004701e-16, "+1.90e-16", "%+#6.2e",
-__LINE__, 1.910606410246797e+21, "1.91061E+21", "%2.5E",
-__LINE__, 1.912537759564710e+29, "1.91254E+29", "%G",
-__LINE__, 1.913606675894566e+27, "1.91361E+27", "%7.6G",
-__LINE__, 1.916473734025505e-05, " 2e-05", "%7.g",
-__LINE__, 1.916507511720523e+23, "+2E+23", "%+.0E",
-__LINE__, 1.917688262248837e-28, "1.918e-28", "%.4g",
-__LINE__, 1.921375594217083e-12, "1.92138E-12", "%G",
-__LINE__, 1.923916000932815e-25, "1.92392E-25", "%G",
-__LINE__, 1.926303652776462e-01, "+0.2", "%+0.G",
-__LINE__, 1.929411084211293e+21, "1.92941E+21", "%6G",
-__LINE__, 1.929996820297491e-26, "1.93e-26", "%.6g",
-__LINE__, 1.937301472034748e-29, "1.9373E-29", "%G",
-__LINE__, 1.937301660220894e-11, "+1.9373E-11", "%+G",
-__LINE__, 1.939038538587083e-02, "0.0193904", "%g",
-__LINE__, 1.940575489112444e-09, "1.94058E-09", "%G",
-__LINE__, 1.946550455606677e-26, "1.946550E-26", "%#1E",
-__LINE__, 1.954250777559491e-14, "1.95425E-14", "%G",
-__LINE__, 1.955646327688473e-16, "1.956E-16", "%#.3E",
-__LINE__, 1.956999911995683e+20, "2E+20", "%2.G",
-__LINE__, 1.959125254298784e-21, "1.95913E-21", "%#G",
-__LINE__, 1.960330340481290e+26, "1.96033e+26", "%.6g",
-__LINE__, 1.964156478075422e+01, "+19.6416", "%+g",
-__LINE__, 1.964702507676036e+19, "2.0e+19", "%2.1e",
-__LINE__, 1.965762191674409e-30, "2E-30", "%1.G",
-__LINE__, 1.967492699686803e-29, "+1.967493E-29", "%+#E",
-__LINE__, 1.970072604062236e-11, "+1.97007E-11", "%+G",
-__LINE__, 1.975631055550387e+05, "197563.105555", "%.6f",
-__LINE__, 1.975722425389177e+28, "+1.975722e+28", "%+5.6e",
-__LINE__, 1.977938328895365e-05, " 2e-05", "%6.e",
-__LINE__, 1.981950849019640e+13, "1.981951E+13", "%E",
-__LINE__, 1.982543168856985e-26, "1.98254e-26", "%4g",
-__LINE__, 1.984873317384181e-20, "1.98487E-20", "%4G",
-__LINE__, 1.986146420877074e+02, "+1.986146e+02", "%+0e",
-__LINE__, 1.986465942785167e-28, "1.98647e-28", "%g",
-__LINE__, 1.988250323235468e-05, " +0", "%+7.f",
-__LINE__, 1.989966623080645e-09, "1.989967e-09", "%e",
-__LINE__, 1.991243122514519e+11, "199124312251", "%5.f",
-__LINE__, 1.993287894645908e+25, "+1.993288E+25", "%+E",
-__LINE__, 1.995172329888890e-30, "+1.99517e-30", "%+3g",
-__LINE__, 1.997075127236432e+05, "1.997E+05", "%#.4G",
-__LINE__, 2.000651599487290e+04, "2E+04", "%2.E",
-__LINE__, 2.001429412876339e-28, "0.000000", "%6f",
-__LINE__, 2.003535646264196e+03, " 2E+03", "%7.G",
-__LINE__, 2.011751504116246e+06, "2E+06", "%2.G",
-__LINE__, 2.016361237694652e-30, "2.01636e-30", "%4g",
-__LINE__, 2.018266414065554e-08, "0.00", "%2.2f",
-__LINE__, 2.020706780608565e+03, "2E+03", "%.0G",
-__LINE__, 2.025098418552005e-16, "+2.025098E-16", "%+2E",
-__LINE__, 2.026100592518976e-11, "2.026101e-11", "%6e",
-__LINE__, 2.026167291572980e+11, "2.02617E+11", "%G",
-__LINE__, 2.026782170272331e+07, "2.026782E+07", "%E",
-__LINE__, 2.029133469449347e-06, " 2e-06", "%6.g",
-__LINE__, 2.031191570768443e-20, "2.031192E-20", "%2.7G",
-__LINE__, 2.031884221862863e-16, "2.031884e-16", "%e",
-__LINE__, 2.032992924118323e+29, "203299292411832333016263874014.84", "%#0.2f",
-__LINE__, 2.035799610097827e+28, "+20357996100978272835391180706.2104344", "%+3.7f",
-__LINE__, 2.038008183612069e+25, "20380081836120691463065668", "%7.0f",
-__LINE__, 2.041632205119365e-22, "+2.04163e-22", "%+g",
-__LINE__, 2.042769811159352e-10, "2e-10", "%.1g",
-__LINE__, 2.043034975847005e-08, "2.043035e-08", "%e",
-__LINE__, 2.045930666285880e+26, "2.04593e+26", "%g",
-__LINE__, 2.048377276651386e-21, "0.00000", "%2.5f",
-__LINE__, 2.051785787301292e-23, "0.000000", "%f",
-__LINE__, 2.055085792048183e-10, "0.000000", "%f",
-__LINE__, 2.055783028451040e-21, "+0", "%+1.f",
-__LINE__, 2.057641607509489e-17, "+2E-17", "%+2.G",
-__LINE__, 2.058348703001600e-15, "2.05835E-15", "%#G",
-__LINE__, 2.059594758787322e+24, "2.05959E+24", "%1G",
-__LINE__, 2.062710740295018e+01, "20.6271", "%G",
-__LINE__, 2.063240676447750e-11, "0.000000", "%f",
-__LINE__, 2.063799238238917e-09, "+0.000000", "%+f",
-__LINE__, 2.064564135160425e-17, "2.06456E-17", "%G",
-__LINE__, 2.066363476927650e-05, "2.07E-05", "%.3G",
-__LINE__, 2.066871450514214e-02, "+2.066871e-02", "%+e",
-__LINE__, 2.067258256169148e+07, "2.06726e+07", "%g",
-__LINE__, 2.068466590729350e-22, "0.0000", "%.4f",
-__LINE__, 2.068779510112540e-26, "2.06878e-26", "%g",
-__LINE__, 2.069258770387493e+19, "20692587703874929516.700831", "%3f",
-__LINE__, 2.069547778447951e+26, "2.069548e+26", "%6e",
-__LINE__, 2.070479507710941e-23, "2.07048E-23", "%G",
-__LINE__, 2.071809640061785e+22, "2.071810E+22", "%E",
-__LINE__, 2.073364463564950e-06, "2.07336e-06", "%g",
-__LINE__, 2.073478953644888e-10, "+2.07E-10", "%+.3G",
-__LINE__, 2.076039194312519e+12, "2.07604E+12", "%G",
-__LINE__, 2.081490398946229e-07, "+2.08149e-07", "%+g",
-__LINE__, 2.084941170287895e-07, "2.084941E-07", "%7E",
-__LINE__, 2.087035885023382e-18, "+0.000000", "%+f",
-__LINE__, 2.091025884363342e-09, "2.09103E-09", "%G",
-__LINE__, 2.091830555397864e+08, "209183056", "%0.f",
-__LINE__, 2.091998109232084e-22, "0.000000", "%#f",
-__LINE__, 2.093406473464940e-17, "2.09341e-17", "%g",
-__LINE__, 2.094646724039720e-26, "2.094647e-26", "%0.7g",
-__LINE__, 2.095218667083208e-22, "2.09522e-22", "%.5e",
-__LINE__, 2.096932364992728e-27, "2.1E-27", "%.2G",
-__LINE__, 2.097012452732083e+17, "2.09701E+17", "%G",
-__LINE__, 2.102022216908102e-07, "0.000000", "%f",
-__LINE__, 2.104648382618938e-04, "0.00021", "%.3G",
-__LINE__, 2.109159578853690e-19, "2.10916e-19", "%6g",
-__LINE__, 2.111732624641178e-13, "+2.111733E-13", "%+7.7G",
-__LINE__, 2.112676138351330e+21, " 2e+21", "%6.g",
-__LINE__, 2.117332904051741e-09, "+0.000000", "%+f",
-__LINE__, 2.118001353767757e-14, "2.118E-14", "%4.3E",
-__LINE__, 2.119413720893955e+12, "2.119414E+12", "%.7G",
-__LINE__, 2.119610992647014e+07, "+21196109.9265", "%+.4f",
-__LINE__, 2.120504022069221e+25, "21205040220692210617414730.223", "%#.3f",
-__LINE__, 2.120634617123718e-16, "2.120635e-16", "%#e",
-__LINE__, 2.128702437175385e+12, "2128702437175.385", "%.3f",
-__LINE__, 2.131148830213536e-12, "2.131149e-12", "%e",
-__LINE__, 2.132682622145255e+04, "+21326.83", "%+#5.7G",
-__LINE__, 2.133864841676473e-01, " +0.2", "%+6.g",
-__LINE__, 2.133939058496273e+16, "2E+16", "%4.G",
-__LINE__, 2.135087006806302e-24, "0.000000", "%f",
-__LINE__, 2.138983961194584e-20, "+2.138984e-20", "%+7e",
-__LINE__, 2.146534189669224e+17, "+2.147E+17", "%+.4G",
-__LINE__, 2.147375595676503e+09, "2.147376e+09", "%e",
-__LINE__, 2.152994986418075e+02, "2E+02", "%0.E",
-__LINE__, 2.154127135896811e+06, "2.15E+06", "%2.3G",
-__LINE__, 2.154613053892588e-29, "2.1546E-29", "%.4E",
-__LINE__, 2.160830430730653e-12, "2.16083E-12", "%#G",
-__LINE__, 2.161740591663027e+28, "2.161741e+28", "%e",
-__LINE__, 2.167181665934011e-06, "2e-06", "%1.e",
-__LINE__, 2.167348761729060e-04, "2.167349e-04", "%#e",
-__LINE__, 2.170270852816708e-10, "2.17027E-10", "%0G",
-__LINE__, 2.173048229189370e-06, "2.173e-06", "%.5g",
-__LINE__, 2.175554537855024e+10, "2.17555E+10", "%G",
-__LINE__, 2.177447372527968e-30, "+0.000000", "%+.6f",
-__LINE__, 2.178591661569858e+05, "2.1786e+05", "%1.5g",
-__LINE__, 2.184700207174818e-29, "0.000000", "%f",
-__LINE__, 2.190817031437247e+03, "2.E+03", "%#3.0E",
-__LINE__, 2.191396212145558e-01, "2.191E-01", "%6.3E",
-__LINE__, 2.191786353372880e-23, "2.19179e-23", "%.5e",
-__LINE__, 2.193471126151079e+19, "2.1935E+19", "%.4E",
-__LINE__, 2.194750177630526e-15, "2.194750e-15", "%e",
-__LINE__, 2.196145170358973e+05, "+219615", "%+g",
-__LINE__, 2.199602360934320e-09, "2.19960E-09", "%#6.6G",
-__LINE__, 2.202913988776998e+17, "+2.20291e+17", "%+g",
-__LINE__, 2.207094560707703e-10, "2.207095e-10", "%e",
-__LINE__, 2.207557214621658e-13, " 0", "%4.f",
-__LINE__, 2.209428206272229e+13, "2.20943e+13", "%g",
-__LINE__, 2.212662463615175e-11, " 0", "%4.0f",
-__LINE__, 2.215732710968468e-30, "2E-30", "%.1G",
-__LINE__, 2.218490841936778e-10, "2.21849e-10", "%2g",
-__LINE__, 2.218850610567959e-01, "+0.221885", "%+G",
-__LINE__, 2.220796939261542e-03, "0.002221", "%#f",
-__LINE__, 2.221819894808024e+24, "2.2e+24", "%5.1e",
-__LINE__, 2.223804993235507e+27, "2.223805e+27", "%1e",
-__LINE__, 2.224715386046563e-17, "0.00000", "%#.5f",
-__LINE__, 2.224864709983882e-16, "+2.224865e-16", "%+e",
-__LINE__, 2.225764510969505e+16, "2.E+16", "%#4.G",
-__LINE__, 2.233229189161284e-07, "+2.23323e-07", "%+6g",
-__LINE__, 2.236522807209868e+17, "2.23652e+17", "%g",
-__LINE__, 2.236641620849775e+20, "2E+20", "%0.G",
-__LINE__, 2.237089952728626e-13, "2E-13", "%5.E",
-__LINE__, 2.238531255563381e-11, " 2E-11", "%7.1G",
-__LINE__, 2.242782296436871e+12, "2242782296436.871103", "%f",
-__LINE__, 2.249177852069393e-02, "+2.249178E-02", "%+5E",
-__LINE__, 2.250735782732076e+29, "+2.25074e+29", "%+g",
-__LINE__, 2.257455203557544e-11, "+2e-11", "%+4.0g",
-__LINE__, 2.258002527939529e+24, "2.258e+24", "%g",
-__LINE__, 2.266955929448160e+20, "226695592944815960123.6056915", "%.7f",
-__LINE__, 2.269019719123250e-23, "0.000000", "%f",
-__LINE__, 2.269022332502809e+02, "+226.902233", "%+f",
-__LINE__, 2.271165222038591e-03, "0.002", "%1.1g",
-__LINE__, 2.273965946408021e+14, "+227396594640802.085507", "%+f",
-__LINE__, 2.277221153386242e+22, "22772211533862418697538.032575", "%#f",
-__LINE__, 2.280214920187521e-01, "0.2", "%2.G",
-__LINE__, 2.280762993019740e+06, "2.28076E+06", "%G",
-__LINE__, 2.283479263040833e-24, "+0.000000", "%+f",
-__LINE__, 2.283686319235123e-07, "2.2837E-07", "%5.5G",
-__LINE__, 2.285842617231066e-26, "0.000000", "%f",
-__LINE__, 2.293145864755873e-02, "0.02", "%.0g",
-__LINE__, 2.293439381531532e+03, "+2.293439E+03", "%+#1E",
-__LINE__, 2.297972500660698e-22, "2.29797e-22", "%g",
-__LINE__, 2.298725366073681e+23, "2.29873E+23", "%G",
-__LINE__, 2.303151535483950e-29, "2.30315E-29", "%G",
-__LINE__, 2.308565313657699e-25, " 0", "%4.f",
-__LINE__, 2.309305373760733e-07, "2.309305E-07", "%E",
-__LINE__, 2.309693761334710e-19, "2.30969e-19", "%g",
-__LINE__, 2.312218220995774e-20, "+2.31222E-20", "%+.6G",
-__LINE__, 2.313115729670525e+24, "2.31312E+24", "%G",
-__LINE__, 2.315325159866773e-21, "2.315325E-21", "%E",
-__LINE__, 2.316932917620091e-19, "0.000000", "%f",
-__LINE__, 2.317548394633895e+13, "2.31755E+13", "%0G",
-__LINE__, 2.318951465093612e+02, "+2.32e+02", "%+1.2e",
-__LINE__, 2.319151794905482e-17, "+0.000000", "%+0f",
-__LINE__, 2.319708617851078e-27, "0.000000", "%f",
-__LINE__, 2.320019976591725e+20, "2e+20", "%.1g",
-__LINE__, 2.322859962551666e+06, "2.32286e+06", "%g",
-__LINE__, 2.326474568074649e-29, "2.326e-29", "%.4g",
-__LINE__, 2.328400844172053e-07, "2.3284E-07", "%G",
-__LINE__, 2.333695247698112e+16, "2.3337e+16", "%g",
-__LINE__, 2.333717120257130e-19, "+0.000000", "%+f",
-__LINE__, 2.334711793234782e-19, "2.33471E-19", "%5G",
-__LINE__, 2.335524987281242e+02, "+233.55", "%+7.5g",
-__LINE__, 2.335556767836369e-30, "2.34e-30", "%.3g",
-__LINE__, 2.337696964360052e-10, "2.3377e-10", "%1g",
-__LINE__, 2.337858249184500e-14, "2.337858E-14", "%5.6E",
-__LINE__, 2.339984354781169e-14, "2.339984E-14", "%E",
-__LINE__, 2.340849041430089e-04, "0.00023", "%0.2G",
-__LINE__, 2.342388410373363e-24, "2.34239E-24", "%G",
-__LINE__, 2.343933106737237e-22, "2.34393e-22", "%g",
-__LINE__, 2.344870855713960e-08, "0.000000", "%.6f",
-__LINE__, 2.347368965433808e+24, "2347368965433808352116785", "%4.f",
-__LINE__, 2.349417462171421e-02, "+0.0234942", "%+G",
-__LINE__, 2.351071111431207e+11, "235107111143.12", "%.2f",
-__LINE__, 2.352756222810670e+19, "+2.e+19", "%+#4.g",
-__LINE__, 2.355862529217003e-22, "2.355863e-22", "%#4e",
-__LINE__, 2.356804045401445e-30, "2.3568E-30", "%G",
-__LINE__, 2.362100710185559e-26, "2.3621e-26", "%g",
-__LINE__, 2.368330779173562e-12, " 0", "%4.f",
-__LINE__, 2.383329784369796e+22, "2.38333E+22", "%G",
-__LINE__, 2.386845229536477e+01, "+23.868452", "%+#f",
-__LINE__, 2.388207830036780e-05, "0.000024", "%f",
-__LINE__, 2.391809468802907e+21, "+2.391809e+21", "%+e",
-__LINE__, 2.395172908564692e-09, "+0.000000", "%+f",
-__LINE__, 2.395447167030886e-29, "2.39545e-29", "%g",
-__LINE__, 2.397292973389182e+16, "23972929733891823", "%6.f",
-__LINE__, 2.401749832237687e-30, "2.401750E-30", "%E",
-__LINE__, 2.403610502544347e-03, "0.00240361", "%4G",
-__LINE__, 2.404676421776132e+17, "240467642177613206", "%6.f",
-__LINE__, 2.406327689091479e+25, "2.406328e+25", "%e",
-__LINE__, 2.407341999590511e-02, "0.024073", "%f",
-__LINE__, 2.407352797581004e+05, "240735.", "%#g",
-__LINE__, 2.407903467439017e+13, "2.4079E+13", "%G",
-__LINE__, 2.407979635013539e+21, " +2E+21", "%+7.G",
-__LINE__, 2.409513517930790e+29, "240951351793079027174826478585.600853", "%f",
-__LINE__, 2.412530651221551e+10, "+2.41253E+10", "%+G",
-__LINE__, 2.419943224673811e+00, "2.41994", "%#g",
-__LINE__, 2.422474399040258e-15, "0.000000", "%f",
-__LINE__, 2.426060206689458e+18, "2.42606E+18", "%1G",
-__LINE__, 2.439982659679872e+14, "+2.439983E+14", "%+E",
-__LINE__, 2.440528851375447e+13, "24405288513754.466173", "%f",
-__LINE__, 2.441340473292679e+19, "2.44134E+19", "%G",
-__LINE__, 2.443521636943916e+19, " 2.e+19", "%#7.g",
-__LINE__, 2.445925211597624e-27, "2.445925E-27", "%E",
-__LINE__, 2.446966179060722e+25, "2.446966e+25", "%5e",
-__LINE__, 2.447714218717278e+11, "2e+11", "%1.e",
-__LINE__, 2.448339744613286e+06, "2.4483e+06", "%3.5g",
-__LINE__, 2.448772993496189e+03, "2448.77", "%G",
-__LINE__, 2.448857654325229e+22, "+2.44886e+22", "%+g",
-__LINE__, 2.450082452098890e-27, "2.4501E-27", "%#3.5G",
-__LINE__, 2.451293602221637e+05, "245129.360222", "%f",
-__LINE__, 2.454531490229426e+02, "245.453", "%G",
-__LINE__, 2.458958369944980e+14, "2.5E+14", "%6.1E",
-__LINE__, 2.463666680775038e+14, "+246366668077503.80", "%+#.2f",
-__LINE__, 2.471582990960795e+05, "2.471583e+05", "%e",
-__LINE__, 2.474107179274687e+22, "2.47411e+22", "%g",
-__LINE__, 2.474332114849132e-08, "+2.47433e-08", "%+g",
-__LINE__, 2.476956762431716e+18, "+2476956762431715919.348107", "%+#f",
-__LINE__, 2.479091221850607e-22, "0.000000", "%f",
-__LINE__, 2.479819586598431e-24, "2.47982e-24", "%g",
-__LINE__, 2.480006174601455e-05, "2.48001E-05", "%G",
-__LINE__, 2.482672677638334e-26, "+0.000000", "%+f",
-__LINE__, 2.492816492208918e-14, " 0", "%7.f",
-__LINE__, 2.492964173197140e-12, " 2e-12", "%7.g",
-__LINE__, 2.494646635961173e+02, "249.465", "%g",
-__LINE__, 2.494687818780545e+11, "249468781878.054546", "%#7f",
-__LINE__, 2.510083560147301e-13, "+2.510084e-13", "%+#e",
-__LINE__, 2.511186607989480e-30, "2.51E-30", "%.3G",
-__LINE__, 2.514164516133643e-11, "2.51416e-11", "%g",
-__LINE__, 2.517242520804735e+11, "2.517243e+11", "%e",
-__LINE__, 2.518526126400833e-26, "2.51853e-26", "%g",
-__LINE__, 2.520313416401176e+09, "2520313416.401176", "%5f",
-__LINE__, 2.521653160738683e-29, "2.52165e-29", "%#g",
-__LINE__, 2.521941342615338e-16, "2.52194e-16", "%g",
-__LINE__, 2.523554774354461e-03, "+3E-03", "%+.0E",
-__LINE__, 2.525434130825058e+06, "+2.525434E+06", "%+E",
-__LINE__, 2.527616380113364e+02, "2.527616E+02", "%E",
-__LINE__, 2.531871347913505e+09, "+2.53187E+09", "%+#G",
-__LINE__, 2.532167428661069e+06, "2532167.428661", "%f",
-__LINE__, 2.545585718405995e+14, "+2.54559E+14", "%+G",
-__LINE__, 2.546305097286406e+10, "2.546305e+10", "%e",
-__LINE__, 2.547467156069069e-30, "+0.00", "%+3.2f",
-__LINE__, 2.548728793004506e-14, "2.54873E-14", "%G",
-__LINE__, 2.560375602395090e+11, "256037560239.509032", "%0f",
-__LINE__, 2.560555687476687e+03, "2561", "%.4g",
-__LINE__, 2.561709077363443e-24, "+0.000000", "%+f",
-__LINE__, 2.563763849675242e+10, "2.5637638E+10", "%.7E",
-__LINE__, 2.567482414574355e+11, "+2.567482e+11", "%+e",
-__LINE__, 2.571575046303674e-17, "3E-17", "%2.0E",
-__LINE__, 2.572997971296986e+11, "257299797129.698593", "%f",
-__LINE__, 2.578625935900331e+22, "25786259359003311786295.853381", "%f",
-__LINE__, 2.579663282966370e+12, "2.579663e+12", "%e",
-__LINE__, 2.593141782397610e-08, "0.000000", "%f",
-__LINE__, 2.594386109584196e+04, "3.E+04", "%#6.0E",
-__LINE__, 2.598069318007816e-22, "2.59807e-22", "%g",
-__LINE__, 2.600910462290091e+09, "2.600910E+09", "%6E",
-__LINE__, 2.602580183614458e-03, "2.602580e-03", "%e",
-__LINE__, 2.606540360440264e+09, "+2606540360.4", "%+#0.1f",
-__LINE__, 2.610016419698116e-21, "+3.e-21", "%+#3.g",
-__LINE__, 2.612279323574882e-20, "2.61228E-20", "%G",
-__LINE__, 2.614157324336453e-14, "2.61416e-14", "%g",
-__LINE__, 2.614688721873993e-09, "2.61e-09", "%6.2e",
-__LINE__, 2.616661104472416e-15, " 0", "%5.f",
-__LINE__, 2.616742079283195e-09, " +3E-09", "%+7.E",
-__LINE__, 2.618075304717427e+24, "2.618075e+24", "%e",
-__LINE__, 2.624118573335769e+26, "262411857333576925555007619.550452", "%1f",
-__LINE__, 2.625718894274227e+24, "+2625718894274227110940955.753904", "%+f",
-__LINE__, 2.627081999477812e+03, "2627.081999", "%f",
-__LINE__, 2.631061062224705e+14, "263106106222470.481626", "%f",
-__LINE__, 2.631545877128814e+27, "+2.63155e+27", "%+g",
-__LINE__, 2.632694395848818e-11, "2.63269e-11", "%g",
-__LINE__, 2.636728891022008e-22, "+2.63673e-22", "%+#4g",
-__LINE__, 2.638495675008130e-28, "+2.638496e-28", "%+e",
-__LINE__, 2.639704195859799e-11, "0.", "%#.0f",
-__LINE__, 2.641645264652665e-20, "0", "%0.f",
-__LINE__, 2.642012075064497e-20, "3E-20", "%0.E",
-__LINE__, 2.648725869006487e-29, " 3E-29", "%6.G",
-__LINE__, 2.649060724417770e+12, "3E+12", "%3.G",
-__LINE__, 2.651188545120166e-17, "0.000", "%.3f",
-__LINE__, 2.652302152621621e+14, "2.7E+14", "%.2G",
-__LINE__, 2.653309718412604e-28, "0.000000", "%f",
-__LINE__, 2.658344750491858e-21, " 3e-21", "%6.g",
-__LINE__, 2.664625074612594e+15, "3e+15", "%1.g",
-__LINE__, 2.666953728270800e-15, "3e-15", "%0.e",
-__LINE__, 2.674515419678877e-11, " 3E-11", "%6.E",
-__LINE__, 2.680054917256578e+15, "2680054917256577.5", "%#2.1f",
-__LINE__, 2.680495609883415e-11, "2.68E-11", "%#.3G",
-__LINE__, 2.685757893641070e+23, "268575789364107020418259.70809", "%1.5f",
-__LINE__, 2.695551226058178e+16, "26955512260581775.407786", "%f",
-__LINE__, 2.696346377519671e+04, "+26963.5", "%+G",
-__LINE__, 2.714262310601257e+17, "+2.714262E+17", "%+E",
-__LINE__, 2.719227450016317e-01, "0.271923", "%G",
-__LINE__, 2.724135433346056e-30, "+2.72414e-30", "%+g",
-__LINE__, 2.725143224130276e+14, "272514322413027.576530", "%6f",
-__LINE__, 2.729355189648310e-03, "+0.00273", "%+.5f",
-__LINE__, 2.732872167724945e+11, "2.73287E+11", "%G",
-__LINE__, 2.737709476435412e+17, "273770947643541218.141650", "%f",
-__LINE__, 2.739299356074967e-15, "2.7E-15", "%.2G",
-__LINE__, 2.740793612304798e-27, "2.740794E-27", "%.7G",
-__LINE__, 2.742030156175960e+20, "2.74203e+20", "%2.6g",
-__LINE__, 2.744455324096085e+11, "2.74446E+11", "%G",
-__LINE__, 2.745179546531160e+07, "2.7452E+07", "%.5G",
-__LINE__, 2.747470562525333e+04, "3E+04", "%2.E",
-__LINE__, 2.750243314674629e+21, "2.75024E+21", "%#G",
-__LINE__, 2.750250224436030e+20, "+2.750250e+20", "%+0.6e",
-__LINE__, 2.752712858561084e-22, "2.752713e-22", "%e",
-__LINE__, 2.756982987656667e-03, "0.002756983", "%#.7G",
-__LINE__, 2.761841188479590e+13, "3e+13", "%1.g",
-__LINE__, 2.769498440434419e+00, "+3e+00", "%+0.e",
-__LINE__, 2.769993785786379e+10, "27699937857.863794", "%f",
-__LINE__, 2.772900256376753e-06, "+2.7729E-06", "%+7.6G",
-__LINE__, 2.774401482467457e-06, "2.8e-06", "%3.2g",
-__LINE__, 2.777691370374757e-02, "+0.027777", "%+f",
-__LINE__, 2.779836227365899e-09, "3e-09", "%5.0g",
-__LINE__, 2.780481651765741e+01, "2.780482E+01", "%E",
-__LINE__, 2.782228478714809e-26, "2.782228E-26", "%4.7G",
-__LINE__, 2.790457781719376e+13, "+2.8e+13", "%+.2g",
-__LINE__, 2.792026581166417e-30, " 3.e-30", "%#7.0g",
-__LINE__, 2.792396278299615e-08, "0.00", "%#.2f",
-__LINE__, 2.793658047689995e-10, "2.794e-10", "%#0.4g",
-__LINE__, 2.795707358229888e-25, "0.000000", "%f",
-__LINE__, 2.796253091758523e-06, "2.796E-06", "%.4G",
-__LINE__, 2.796756564788716e-24, "2.796757e-24", "%e",
-__LINE__, 2.798730444798773e-14, "2.79873e-14", "%g",
-__LINE__, 2.799108397670447e-24, "3E-24", "%.0G",
-__LINE__, 2.799389008872835e+06, "2799389.", "%#0.f",
-__LINE__, 2.800413998518039e-14, "0.000000", "%f",
-__LINE__, 2.803237602587100e+15, "+2803237602587100.418816", "%+5f",
-__LINE__, 2.803474415574551e-04, "0.0002803", "%.7f",
-__LINE__, 2.804957468647181e+25, "2.80496e+25", "%g",
-__LINE__, 2.809345112788226e+09, "2809345112.788226", "%.6f",
-__LINE__, 2.811518239408899e+10, "3e+10", "%1.g",
-__LINE__, 2.813188439967416e-16, "0.0000000", "%5.7f",
-__LINE__, 2.813497118051755e+08, "2.8135e+08", "%.5g",
-__LINE__, 2.815748256510577e-29, "0.000000", "%2f",
-__LINE__, 2.816076365485207e-01, "0.281608", "%0G",
-__LINE__, 2.816083345772131e+24, "2.8161e+24", "%6.4e",
-__LINE__, 2.818686957605178e+12, "2.8187E+12", "%.5G",
-__LINE__, 2.821903538737691e+20, "2.8219E+20", "%G",
-__LINE__, 2.823659589845680e+26, "2.82366e+26", "%2g",
-__LINE__, 2.823685630865012e+22, "2.82369E+22", "%G",
-__LINE__, 2.828826386007914e+21, "2.828826E+21", "%7E",
-__LINE__, 2.830997901034349e+04, "+3e+04", "%+0.e",
-__LINE__, 2.833886731091353e-26, "+2.833887e-26", "%+4e",
-__LINE__, 2.839965144893913e+28, "28399651448939131626048038015.1421", "%.4f",
-__LINE__, 2.840651452049947e-09, "2.841E-09", "%#.3E",
-__LINE__, 2.843388001911757e-01, "0.284339", "%g",
-__LINE__, 2.846122151080671e+14, "2.84612E+14", "%.5E",
-__LINE__, 2.851257828837595e+05, "+285126", "%+5.f",
-__LINE__, 2.853823884459520e+07, "+2.85382E+07", "%+G",
-__LINE__, 2.853870068368765e-06, "2.854E-06", "%4.3E",
-__LINE__, 2.856687358149867e+01, "+28.567", "%+6.5G",
-__LINE__, 2.858946600073752e+06, "2.8589466e+06", "%3.7e",
-__LINE__, 2.861525727138818e+24, "2.8615257e+24", "%2.7e",
-__LINE__, 2.865104175886071e-24, "0.000000", "%f",
-__LINE__, 2.870678920363198e-14, "2.87068E-14", "%G",
-__LINE__, 2.873298537233691e+09, "+2.8733e+09", "%+g",
-__LINE__, 2.877939609444375e-02, "0.028779", "%f",
-__LINE__, 2.878253985341728e+13, "2.87825E+13", "%G",
-__LINE__, 2.879299244903946e+29, "287929924490394597569320467301", "%0.f",
-__LINE__, 2.885516225515485e-26, "0.000000", "%f",
-__LINE__, 2.886013724129579e+20, "+3e+20", "%+4.g",
-__LINE__, 2.887032786975506e-30, "0.000000", "%f",
-__LINE__, 2.890415456531026e-29, "2.89042E-29", "%G",
-__LINE__, 2.893177360548214e-13, "2.893E-13", "%#6.3E",
-__LINE__, 2.895265536458195e+26, "2.89527e+26", "%5g",
-__LINE__, 2.903844533810152e+23, "290384453381015195105874.23", "%.2f",
-__LINE__, 2.909060558287504e+27, "2.90906e+27", "%g",
-__LINE__, 2.911615480973172e-05, "2.91162E-05", "%3G",
-__LINE__, 2.912692297221896e+09, "2912692297.221896", "%#f",
-__LINE__, 2.913595662485813e-24, "2.9136E-24", "%G",
-__LINE__, 2.915960840341896e-27, "0.000000", "%f",
-__LINE__, 2.920451095973991e-16, "2.92e-16", "%2.2e",
-__LINE__, 2.920528295810925e+06, "2.92053E+06", "%#G",
-__LINE__, 2.921564671017147e+20, "2.921565E+20", "%#6E",
-__LINE__, 2.921628350942189e+01, "2.921628E+01", "%E",
-__LINE__, 2.921843377455232e+20, "2.921843E+20", "%#E",
-__LINE__, 2.930156950319384e+29, "2.930E+29", "%1.3E",
-__LINE__, 2.931229858895071e-30, "2.9e-30", "%4.2g",
-__LINE__, 2.931753029689166e+20, "2.93175e+20", "%g",
-__LINE__, 2.933023693079342e+15, "3.E+15", "%#.1G",
-__LINE__, 2.933078733225520e+26, "2.93308E+26", "%G",
-__LINE__, 2.933528170896643e-14, "+2.93353e-14", "%+g",
-__LINE__, 2.938648437428148e+00, "2.938648e+00", "%e",
-__LINE__, 2.940752238221344e+26, "+2.94075E+26", "%+G",
-__LINE__, 2.942836470459675e+20, "2.9428e+20", "%6.4e",
-__LINE__, 2.943218333254941e+29, "294321833325494086608387078740.634024", "%f",
-__LINE__, 2.943690574007512e-27, "0.000000", "%f",
-__LINE__, 2.945452907046501e+09, "+2.9455E+09", "%+.5G",
-__LINE__, 2.946648725966953e+16, "29466487259669534.637396", "%4f",
-__LINE__, 2.955119322417825e+29, "2.95512E+29", "%G",
-__LINE__, 2.966481197538973e+24, "2.96648e+24", "%#g",
-__LINE__, 2.969362862661362e+08, "+2.969363e+08", "%+7e",
-__LINE__, 2.970062459990078e+21, "+2.97006E+21", "%+G",
-__LINE__, 2.971059959019791e+10, " 3E+10", "%7.G",
-__LINE__, 2.973020205606034e-29, "0.000000", "%f",
-__LINE__, 2.977223210301426e+04, "2.977223e+04", "%#e",
-__LINE__, 2.977467832772786e-26, "0.000000", "%f",
-__LINE__, 2.981433606423384e+18, "2981433606423384397.032805", "%f",
-__LINE__, 2.981615513287404e-17, "2.98162e-17", "%g",
-__LINE__, 2.983880743847276e+19, " 3e+19", "%7.e",
-__LINE__, 2.983927792297305e-28, "2.983928e-28", "%e",
-__LINE__, 2.984807359492058e-17, " 0", "%2.f",
-__LINE__, 2.985123412933032e+09, "+2.98512e+09", "%+g",
-__LINE__, 2.991132955408629e-27, "+2.99113e-27", "%+4g",
-__LINE__, 2.992345635923643e+19, "3E+19", "%4.G",
-__LINE__, 2.993024238285395e-05, "2.99302e-05", "%2g",
-__LINE__, 2.995303406756363e+16, "+2.995303E+16", "%+E",
-__LINE__, 2.995492577854335e+19, "+29954925778543346481.797016", "%+f",
-__LINE__, 2.996856271675341e-25, "+3e-25", "%+0.e",
-__LINE__, 2.997813968112619e+12, "2.99781e+12", "%#5g",
-__LINE__, 3.002097486457961e-17, "3.00210e-17", "%5.5e",
-__LINE__, 3.006538123158692e+28, "+3.00654E+28", "%+#G",
-__LINE__, 3.007293721729544e+04, "30072.937217", "%f",
-__LINE__, 3.008301791944493e-07, "3.008e-07", "%.3e",
-__LINE__, 3.011742184603817e-17, "3.011742E-17", "%#E",
-__LINE__, 3.024641547299177e-30, "3.02464e-30", "%g",
-__LINE__, 3.026525135110198e-28, "3e-28", "%.0e",
-__LINE__, 3.026768160756558e+20, "3.02677E+20", "%G",
-__LINE__, 3.031928829940975e+18, "3031928829940975234.1", "%0.1f",
-__LINE__, 3.039787705138620e+24, "+3.E+24", "%+#5.G",
-__LINE__, 3.039803824423916e-02, "0.030398", "%5f",
-__LINE__, 3.041236293199133e-26, "3.04124e-26", "%g",
-__LINE__, 3.045634954037886e+04, "30456.3", "%g",
-__LINE__, 3.047528114241850e+25, "3e+25", "%0.e",
-__LINE__, 3.047958193737501e-24, "3.04796E-24", "%#G",
-__LINE__, 3.049537324414302e-16, "3.04954E-16", "%G",
-__LINE__, 3.050500637681798e-30, "3.0505E-30", "%G",
-__LINE__, 3.051769626625307e-01, "0.305177", "%f",
-__LINE__, 3.057280201971847e+11, "+3.05728E+11", "%+.5E",
-__LINE__, 3.060046173306881e-10, "+3.060046e-10", "%+e",
-__LINE__, 3.069732667347204e+27, "+3069732667347204291274920251.453295", "%+f",
-__LINE__, 3.075060836786916e-14, "0.000000", "%f",
-__LINE__, 3.078175179670964e+13, "3.07818E+13", "%G",
-__LINE__, 3.080305344303183e-21, "3.08031e-21", "%6g",
-__LINE__, 3.088881497064043e+27, "+3.088881E+27", "%+3E",
-__LINE__, 3.089196877931209e-20, "3.089197e-20", "%e",
-__LINE__, 3.091400888880487e-08, "3e-08", "%2.e",
-__LINE__, 3.093410684178904e+16, "3.09341e+16", "%g",
-__LINE__, 3.104225344208216e-21, "0.000000", "%f",
-__LINE__, 3.105843728248599e+13, "3.e+13", "%#.0g",
-__LINE__, 3.106463071390893e-07, "0.0000", "%.4f",
-__LINE__, 3.107784123569379e+02, "+310.778", "%+G",
-__LINE__, 3.110605148983672e-20, "3.1106051E-20", "%.7E",
-__LINE__, 3.111702418162670e-04, "0.00031117", "%.5G",
-__LINE__, 3.117610675303153e-17, "3.11761e-17", "%g",
-__LINE__, 3.123620125717981e+07, "3.1236e+07", "%2.5g",
-__LINE__, 3.125648558809832e-24, "+3.125649E-24", "%+#0.6E",
-__LINE__, 3.129025163659283e+10, "31290251636.592825", "%#f",
-__LINE__, 3.130689119412709e-29, "+3.131E-29", "%+#.4G",
-__LINE__, 3.135681222132527e+13, "3.13568E+13", "%G",
-__LINE__, 3.138290485073330e-10, "3.13829E-10", "%G",
-__LINE__, 3.141255250155306e-12, "3.14126E-12", "%G",
-__LINE__, 3.143224520918429e+25, "3.14322E+25", "%#1G",
-__LINE__, 3.144746921366173e-16, " 0", "%7.f",
-__LINE__, 3.151336678241994e+19, "+3.15134E+19", "%+G",
-__LINE__, 3.161752935716549e+24, "3.2E+24", "%2.1E",
-__LINE__, 3.167106521258172e-10, "+3.167107e-10", "%+e",
-__LINE__, 3.167266522824146e-04, "3E-04", "%3.E",
-__LINE__, 3.169995217131489e+27, "3169995217131488907114089670.358226", "%f",
-__LINE__, 3.172117220467692e-21, "3.1721E-21", "%.5G",
-__LINE__, 3.173824170351611e+02, " 3e+02", "%6.e",
-__LINE__, 3.186291452544739e-28, " 0", "%2.f",
-__LINE__, 3.194750094186063e+03, "+3.194750E+03", "%+E",
-__LINE__, 3.195001037118137e-20, "0", "%0.0f",
-__LINE__, 3.199271564719560e+02, "319.927", "%g",
-__LINE__, 3.212803450638544e+20, "3.2128e+20", "%.6g",
-__LINE__, 3.214502877263883e+24, "3214502877263882840708220", "%2.f",
-__LINE__, 3.214658414074286e-01, "+0.321466", "%+#g",
-__LINE__, 3.217627975823673e+00, "3.217628", "%f",
-__LINE__, 3.218257328710536e-07, "3.21826e-07", "%6.5e",
-__LINE__, 3.221949479347008e+02, "322.194948", "%f",
-__LINE__, 3.222862935507443e-14, "3.222863E-14", "%E",
-__LINE__, 3.223750247261608e+19, "3.22375e+19", "%g",
-__LINE__, 3.236030335782375e+05, "3.236030e+05", "%e",
-__LINE__, 3.241078803072735e+19, "3.24108e+19", "%g",
-__LINE__, 3.248069569167045e-06, "0.000003", "%#f",
-__LINE__, 3.248148973717269e-15, "3.24815E-15", "%G",
-__LINE__, 3.251150704311790e+25, "+3.25115e+25", "%+5g",
-__LINE__, 3.254498593372140e+15, "+3.2545e+15", "%+g",
-__LINE__, 3.254949399612861e-13, "+3.255E-13", "%+7.3E",
-__LINE__, 3.255490928554106e-17, "3.255491e-17", "%e",
-__LINE__, 3.262333894422112e+17, "326233389442211185.738074", "%0f",
-__LINE__, 3.263923577545217e-24, "0.0000000", "%.7f",
-__LINE__, 3.267125289609703e+23, "3.26713e+23", "%#.5e",
-__LINE__, 3.267906049108331e+27, "3.267906E+27", "%6E",
-__LINE__, 3.269885039157328e+14, "326988503915732.797722", "%f",
-__LINE__, 3.296011393609953e-27, " 3E-27", "%7.E",
-__LINE__, 3.296452164568996e+29, "3.296452E+29", "%E",
-__LINE__, 3.296544736555325e+10, "+3.29654E+10", "%+.6G",
-__LINE__, 3.301861835798572e+03, "3301.862", "%4.7g",
-__LINE__, 3.311292283423002e+21, " 3E+21", "%6.G",
-__LINE__, 3.314868440076262e-10, "3.3149E-10", "%.5G",
-__LINE__, 3.318057982247451e-13, "3.3181e-13", "%0.5g",
-__LINE__, 3.318139218410071e-22, "0.000000", "%f",
-__LINE__, 3.326769904839351e-11, "+3.3268e-11", "%+0.4e",
-__LINE__, 3.327483659787219e+27, "+3.32748e+27", "%+g",
-__LINE__, 3.332666889640198e+17, "333266688964019763.830038", "%f",
-__LINE__, 3.333807449377253e+10, "+3.33e+10", "%+.3g",
-__LINE__, 3.334572302792625e-09, "3.334572E-09", "%E",
-__LINE__, 3.337567126586765e-17, "0.0000000", "%#3.7f",
-__LINE__, 3.340512607683786e-04, "+3E-04", "%+1.E",
-__LINE__, 3.344911557516870e+04, "33449.1", "%G",
-__LINE__, 3.346464302017296e+26, "+3.E+26", "%+#3.G",
-__LINE__, 3.348503166628953e+00, "+3.348503e+00", "%+e",
-__LINE__, 3.350025157778138e-19, "3.35003e-19", "%6g",
-__LINE__, 3.352826233035342e+11, "335282623303.534200", "%7f",
-__LINE__, 3.357174089765502e+10, "3.35717E+10", "%G",
-__LINE__, 3.369253166475501e+03, "+3369.25", "%+G",
-__LINE__, 3.371385975046735e+02, "337.", "%#.0f",
-__LINE__, 3.372532650462104e-04, "+0.000", "%+.3f",
-__LINE__, 3.376498162710442e-26, "3.376498e-26", "%e",
-__LINE__, 3.383510307689135e-12, " 3e-12", "%7.0e",
-__LINE__, 3.388427914080631e-04, "0.0003", "%2.4f",
-__LINE__, 3.390757423408097e+29, "3.3908E+29", "%.4E",
-__LINE__, 3.393963140962879e-11, "3.39396e-11", "%g",
-__LINE__, 3.399245742994444e+24, "3.399246E+24", "%E",
-__LINE__, 3.417690405546708e-26, "0.00000", "%4.5f",
-__LINE__, 3.421159360472045e-30, "3.42116E-30", "%G",
-__LINE__, 3.421973947898887e-06, "3.42197E-06", "%4G",
-__LINE__, 3.425949002482817e-10, "+3.42595E-10", "%+G",
-__LINE__, 3.428355150377972e+08, "3.42836E+08", "%G",
-__LINE__, 3.445035158951526e+15, "3445035158951526.454985", "%f",
-__LINE__, 3.447363996077534e+28, "+3e+28", "%+2.e",
-__LINE__, 3.451571062654907e-03, "0.00345157", "%G",
-__LINE__, 3.452787236877688e+09, "3.45279e+09", "%g",
-__LINE__, 3.454114826574939e-22, "3.e-22", "%#3.e",
-__LINE__, 3.455241965974631e-03, "0.003455", "%#f",
-__LINE__, 3.456190496554365e-18, "3.E-18", "%#5.E",
-__LINE__, 3.456804565717233e-19, "+0.000", "%+2.3f",
-__LINE__, 3.457077651539715e-28, "3.457078E-28", "%E",
-__LINE__, 3.472025705376229e+22, "3.472e+22", "%7.4g",
-__LINE__, 3.473308270919079e+03, "3.473308e+03", "%e",
-__LINE__, 3.474468013243007e-30, "3.47447e-30", "%g",
-__LINE__, 3.477976957097698e+22, "3.47798e+22", "%g",
-__LINE__, 3.501174631980057e-06, "4e-06", "%4.g",
-__LINE__, 3.501808481702140e+20, "3.50181E+20", "%G",
-__LINE__, 3.511760000705324e+14, "351176000070532.357000", "%f",
-__LINE__, 3.511870226306087e+29, "3.51187e+29", "%.5e",
-__LINE__, 3.518846859147841e+02, "+351.885", "%+G",
-__LINE__, 3.521659149753418e+25, "35216591497534182053641416", "%5.f",
-__LINE__, 3.521721228178747e+21, "4e+21", "%2.e",
-__LINE__, 3.526696007281458e+22, "3.5267e+22", "%g",
-__LINE__, 3.535631031379084e-11, "4e-11", "%5.0g",
-__LINE__, 3.537219665456759e-01, "0.353722", "%f",
-__LINE__, 3.537252728287785e-09, "3.537253E-09", "%E",
-__LINE__, 3.542561277796815e-19, "3.542561E-19", "%E",
-__LINE__, 3.548942336915745e+13, "3.54894E+13", "%.5E",
-__LINE__, 3.574385715121768e-24, "3.57439E-24", "%#G",
-__LINE__, 3.578068067760211e-13, "3.578068E-13", "%E",
-__LINE__, 3.583296432862266e-13, "3.5833e-13", "%g",
-__LINE__, 3.591567367115590e+19, "3.59157e+19", "%1g",
-__LINE__, 3.594902312287635e-24, "3.5949E-24", "%G",
-__LINE__, 3.602929486764515e+12, "3602929486764.514522", "%#f",
-__LINE__, 3.606699462631472e-01, "+0.360670", "%+f",
-__LINE__, 3.608605968319811e+17, "3.60861e+17", "%g",
-__LINE__, 3.608780761567885e+24, "4e+24", "%0.e",
-__LINE__, 3.623857274715022e-15, "3.62386E-15", "%1G",
-__LINE__, 3.627346251764432e-22, "3.627e-22", "%.4g",
-__LINE__, 3.652610391698086e-16, "0.000000", "%3f",
-__LINE__, 3.657463146689917e-19, " 0", "%4.0f",
-__LINE__, 3.658538858712938e-15, "4E-15", "%5.G",
-__LINE__, 3.660337267266058e+16, "+36603372672660579.034698", "%+f",
-__LINE__, 3.661588742065142e-01, "0.366159", "%g",
-__LINE__, 3.662296387211376e-25, "0.000000", "%f",
-__LINE__, 3.668511100303393e-29, "0.000000", "%7f",
-__LINE__, 3.669499303661920e+06, "3.6695e+06", "%1.5g",
-__LINE__, 3.676856420121343e-23, "3.6769e-23", "%0.4e",
-__LINE__, 3.677197473476901e-19, "+3.6772e-19", "%+g",
-__LINE__, 3.677281754506453e+12, "+3677281754506.452671", "%+f",
-__LINE__, 3.678420802401506e-19, "3.67842E-19", "%G",
-__LINE__, 3.679970245325769e+07, "3.67997e+07", "%g",
-__LINE__, 3.682528947621349e+05, "4.e+05", "%#5.e",
-__LINE__, 3.688257471304210e+22, "36882574713042104441740.320908", "%f",
-__LINE__, 3.689129734472166e-01, "0.368913", "%0.6G",
-__LINE__, 3.693483801463324e+12, "4E+12", "%3.E",
-__LINE__, 3.694612396584729e-21, "+3.69461E-21", "%+G",
-__LINE__, 3.706150073392112e-19, "0.000000", "%2f",
-__LINE__, 3.706824819530577e+21, "3706824819530576853310.321894", "%f",
-__LINE__, 3.709583789659276e+19, "+3.709584E+19", "%+#E",
-__LINE__, 3.711137503697284e+22, "3.7111E+22", "%.5G",
-__LINE__, 3.717307412969522e-22, "3.717307E-22", "%#E",
-__LINE__, 3.717434999853808e+24, " 4E+24", "%6.G",
-__LINE__, 3.720761662524312e+14, "+372076166252431.2285", "%+1.4f",
-__LINE__, 3.721613815237707e-10, "3.72161e-10", "%g",
-__LINE__, 3.725086467464346e+14, "3.72509E+14", "%G",
-__LINE__, 3.727427083626536e-15, "+4E-15", "%+.0G",
-__LINE__, 3.731138322599465e-13, "3.73114e-13", "%5g",
-__LINE__, 3.732248129614146e-04, " 4E-04", "%7.E",
-__LINE__, 3.744422223926118e-24, "3.744422E-24", "%E",
-__LINE__, 3.745595428897916e+21, "+3745595428897916079336.027906", "%+f",
-__LINE__, 3.751308304055989e-08, "+3.751308e-08", "%+e",
-__LINE__, 3.755395417696132e-02, "0.037554", "%f",
-__LINE__, 3.769103881505159e+09, "3.7691e+09", "%g",
-__LINE__, 3.769535572757430e+00, "3.769536", "%6.7G",
-__LINE__, 3.770823872348274e-28, "+0.000000", "%+f",
-__LINE__, 3.771160653578178e+29, "3.77116e+29", "%g",
-__LINE__, 3.776563752716444e-12, "4E-12", "%.0E",
-__LINE__, 3.777953798674786e-28, "3.77795e-28", "%g",
-__LINE__, 3.785994690686598e+28, "4E+28", "%5.G",
-__LINE__, 3.787487488835162e+01, "+37.874875", "%+5f",
-__LINE__, 3.788249311173359e-18, "3.788249E-18", "%E",
-__LINE__, 3.798728360791314e-08, "3.798728E-08", "%2E",
-__LINE__, 3.799038238867092e+05, "3.79904E+05", "%.5E",
-__LINE__, 3.799822564549600e+06, "3.79982E+06", "%.5E",
-__LINE__, 3.804862840499834e-16, "0", "%1.f",
-__LINE__, 3.805375156822481e+12, "3805375156822.4814861", "%.7f",
-__LINE__, 3.821612790153376e-17, "3.821613e-17", "%e",
-__LINE__, 3.825193659558693e+14, "3.82519E+14", "%#G",
-__LINE__, 3.834180638680996e+17, "+383418063868099565.638659", "%+f",
-__LINE__, 3.834759760605814e-12, "3.83476E-12", "%G",
-__LINE__, 3.839786235582770e+16, "+3.84e+16", "%+0.3g",
-__LINE__, 3.843164462248778e+28, "3.84316e+28", "%#g",
-__LINE__, 3.845599697858050e+22, "3.8456E+22", "%G",
-__LINE__, 3.850147271017228e-21, "3.85e-21", "%.4g",
-__LINE__, 3.850283557812101e+07, "3.85028E+07", "%G",
-__LINE__, 3.854235609725703e+03, "3854.24", "%G",
-__LINE__, 3.864901885489405e-15, "3.8649E-15", "%G",
-__LINE__, 3.868630187629983e-24, "3.868630e-24", "%e",
-__LINE__, 3.876764606134972e-03, "+3.8767646e-03", "%+#0.7e",
-__LINE__, 3.884553592855422e+08, "+3.8845536e+08", "%+4.7e",
-__LINE__, 3.887417494351062e+03, "3887.42", "%0g",
-__LINE__, 3.887561018972304e+03, "3887.56", "%G",
-__LINE__, 3.888554801724658e-24, "3.888555e-24", "%e",
-__LINE__, 3.892806891909861e-01, "0.389281", "%f",
-__LINE__, 3.914459791345755e+15, "+3.914460E+15", "%+E",
-__LINE__, 3.918383209642759e+01, "39.1838", "%#G",
-__LINE__, 3.923970658741865e-10, "3.92397E-10", "%G",
-__LINE__, 3.928163650272335e+18, "3928163650272335161.162118", "%f",
-__LINE__, 3.933053127721002e-20, "3.933053e-20", "%e",
-__LINE__, 3.939306552155218e-29, "3.93931E-29", "%G",
-__LINE__, 3.953007066379472e+07, "3.953007E+07", "%E",
-__LINE__, 3.954924824986267e-01, "3.954925E-01", "%E",
-__LINE__, 3.956156072067987e+15, "3.956E+15", "%0.4G",
-__LINE__, 3.957756196797224e+22, "4.0E+22", "%4.1E",
-__LINE__, 3.960011413261009e+27, "+3960011413261008783592842519.283295", "%+f",
-__LINE__, 3.961789076323378e+20, "396178907632337828914.614875", "%f",
-__LINE__, 3.961985468081708e-28, "3.96199E-28", "%1G",
-__LINE__, 3.975007582283812e-27, "0.000000", "%0.6f",
-__LINE__, 3.987586813142132e+15, "+3.98759e+15", "%+g",
-__LINE__, 3.992250836957379e+21, "3.99225E+21", "%0G",
-__LINE__, 3.992985048620057e+00, "3.9930", "%.4f",
-__LINE__, 4.000000000000000e+02, "400.00", "%.2f",
-__LINE__, 4.000145414240556e+14, "4.00015e+14", "%#6g",
-__LINE__, 4.000774453529974e-25, "4E-25", "%.0E",
-__LINE__, 4.002041494804383e+17, "4.002041E+17", "%E",
-__LINE__, 4.005505415013214e+17, " 4E+17", "%6.2G",
-__LINE__, 4.008960306876491e-28, "0.000", "%.3f",
-__LINE__, 4.032337828117640e+16, "4.03234E+16", "%G",
-__LINE__, 4.035414597530057e+26, "403541459753005682387083652.429283", "%f",
-__LINE__, 4.037065874793069e-01, "0.403707", "%f",
-__LINE__, 4.047856284449970e-14, "4.04786E-14", "%#G",
-__LINE__, 4.049037221323070e-04, "4.049037e-04", "%e",
-__LINE__, 4.053458853142009e-07, "4E-07", "%2.0E",
-__LINE__, 4.056455443275955e-22, "4.056455e-22", "%e",
-__LINE__, 4.058158020771355e-22, "4.05816e-22", "%#2g",
-__LINE__, 4.067283508945137e+02, "+4.07e+02", "%+5.2e",
-__LINE__, 4.072155715199509e+11, "4.072e+11", "%.4g",
-__LINE__, 4.074643403755990e-22, "4e-22", "%0.g",
-__LINE__, 4.077450352325251e+08, "4.1e+08", "%3.2g",
-__LINE__, 4.081492619284916e-08, "4.081493E-08", "%E",
-__LINE__, 4.083271801996951e-10, "4.083272E-10", "%#E",
-__LINE__, 4.090188547940879e-15, "4.090189E-15", "%#E",
-__LINE__, 4.091167728938537e-11, "4e-11", "%1.g",
-__LINE__, 4.091916745541154e+15, "4091916745541153.588306", "%f",
-__LINE__, 4.092366122921161e+23, "4E+23", "%0.E",
-__LINE__, 4.094638368212577e-11, "4.09464E-11", "%#G",
-__LINE__, 4.097148443124199e-16, "0.000000", "%f",
-__LINE__, 4.101057893946401e+06, "4e+06", "%4.g",
-__LINE__, 4.101209521231476e+28, "41012095212314756409455185348.633677", "%f",
-__LINE__, 4.105683659045903e+05, "+4.E+05", "%+#1.G",
-__LINE__, 4.111553717385758e-16, "4.11155e-16", "%g",
-__LINE__, 4.112186409918593e+14, "+4.11219e+14", "%+g",
-__LINE__, 4.117782144860865e+25, "4.117782E+25", "%5E",
-__LINE__, 4.119420921722146e-27, "4.11942e-27", "%g",
-__LINE__, 4.134953783635018e+14, "+4.1349538e+14", "%+.7e",
-__LINE__, 4.136990822648468e+11, "4.136991E+11", "%E",
-__LINE__, 4.140475788523046e+14, "+4E+14", "%+5.G",
-__LINE__, 4.149589679915584e+24, "4.14959E+24", "%2G",
-__LINE__, 4.151240342256744e-22, " 0", "%2.f",
-__LINE__, 4.155533104307272e-04, "+0.000416", "%+f",
-__LINE__, 4.155890511880097e+25, "4.155891e+25", "%e",
-__LINE__, 4.159907901074450e-19, "4.159908E-19", "%7E",
-__LINE__, 4.171899783464252e+18, "4E+18", "%.0E",
-__LINE__, 4.177920266276382e-17, "+0.0000", "%+1.4f",
-__LINE__, 4.181728014477237e-20, "4.18173e-20", "%.6g",
-__LINE__, 4.203600495086497e-30, " 4E-30", "%6.G",
-__LINE__, 4.211166112605717e-08, "4E-08", "%5.1G",
-__LINE__, 4.219513437404614e+18, "+4E+18", "%+.0E",
-__LINE__, 4.221426315236785e+08, "4.221426E+08", "%#E",
-__LINE__, 4.226224756005934e-13, " 4.e-13", "%#7.g",
-__LINE__, 4.226979046489921e-01, "4.226979e-01", "%#.6e",
-__LINE__, 4.236283521629158e-08, "+4.23628E-08", "%+G",
-__LINE__, 4.239850628514233e-07, "4.23985E-07", "%.6G",
-__LINE__, 4.241177358638621e+04, "42411.773586", "%2f",
-__LINE__, 4.245306724398964e-13, "0.000000", "%#f",
-__LINE__, 4.246194290300334e+16, "42461942903003340.177293", "%2f",
-__LINE__, 4.251238996137952e-05, "4.25124E-05", "%3G",
-__LINE__, 4.262432542017438e+13, "42624325420174.375978", "%1f",
-__LINE__, 4.266383084300715e+16, "4E+16", "%4.G",
-__LINE__, 4.292963398931474e-11, "4.292963E-11", "%E",
-__LINE__, 4.296530271399131e-29, "0.000000", "%6f",
-__LINE__, 4.303753949741171e+19, "4.30375E+19", "%2G",
-__LINE__, 4.303767633827431e-28, "4.30377e-28", "%g",
-__LINE__, 4.316181911403991e-30, "4.3162e-30", "%#7.5g",
-__LINE__, 4.318654697213126e-18, "4.31865e-18", "%g",
-__LINE__, 4.320618603119499e+05, "432061.860312", "%3f",
-__LINE__, 4.322443609118441e+21, "4.32244E+21", "%7.5E",
-__LINE__, 4.322522446810708e-15, "4.32252e-15", "%.6g",
-__LINE__, 4.334728493589115e-18, "0.000000", "%f",
-__LINE__, 4.335342531476346e-19, "4.33534E-19", "%G",
-__LINE__, 4.340579325084176e-30, "4.34058e-30", "%#0.6g",
-__LINE__, 4.340775659883185e+04, "43407.756599", "%6f",
-__LINE__, 4.361131891528634e-14, " 4E-14", "%6.G",
-__LINE__, 4.366662624371249e-02, "+0.04", "%+4.g",
-__LINE__, 4.369919308458348e+28, "+4.36992e+28", "%+2g",
-__LINE__, 4.369930393192433e-24, "4.369930e-24", "%e",
-__LINE__, 4.376283118322521e-01, "0.437628", "%g",
-__LINE__, 4.386868840825930e+19, "4.3869E+19", "%.5G",
-__LINE__, 4.389349113395235e+05, "+4.389349e+05", "%+e",
-__LINE__, 4.392447466753053e-08, "+4.392E-08", "%+.4G",
-__LINE__, 4.394068619246889e-13, "4.39407e-13", "%6g",
-__LINE__, 4.404889573700147e-09, "4.404890E-09", "%E",
-__LINE__, 4.410531039373014e+05, "+4.41e+05", "%+.2e",
-__LINE__, 4.412466606726400e-08, " 0.0", "%6.1f",
-__LINE__, 4.414693719279123e+17, "4.414694e+17", "%e",
-__LINE__, 4.417050329080679e-01, "+0.441705", "%+g",
-__LINE__, 4.419509841929196e-10, "4.4195098E-10", "%.7E",
-__LINE__, 4.421012777695611e+07, "+4.42101E+07", "%+0.6G",
-__LINE__, 4.426387732151208e+11, "4.42639e+11", "%g",
-__LINE__, 4.439567017550398e+26, "4.439567E+26", "%E",
-__LINE__, 4.446479816166258e-21, "4.446480e-21", "%0e",
-__LINE__, 4.453486178424380e+05, "445348.617842", "%f",
-__LINE__, 4.455733696043438e+06, "4.45573e+06", "%3g",
-__LINE__, 4.455870606312063e+16, "4.45587e+16", "%g",
-__LINE__, 4.458776435431700e+22, "4e+22", "%1.g",
-__LINE__, 4.466448605584151e-30, "0.000000", "%f",
-__LINE__, 4.471063097005706e+16, "4.47106E+16", "%G",
-__LINE__, 4.482001890035190e-22, "+4.482E-22", "%+G",
-__LINE__, 4.493246870093631e+05, "449325", "%1G",
-__LINE__, 4.496089639281023e+17, "4.49609e+17", "%g",
-__LINE__, 4.515066070117557e+15, "4.51507e+15", "%g",
-__LINE__, 4.518296460916194e+24, "+4.5183E+24", "%+G",
-__LINE__, 4.526548719445596e+02, "452.655", "%6.3f",
-__LINE__, 4.532756455106440e-26, "4.53e-26", "%4.2e",
-__LINE__, 4.534466782633055e-14, "4.53447E-14", "%G",
-__LINE__, 4.541313061854649e-14, "4.54131E-14", "%G",
-__LINE__, 4.541848265404338e+02, " 5E+02", "%7.G",
-__LINE__, 4.546603085406363e-26, "5E-26", "%3.G",
-__LINE__, 4.557349604829375e+28, "+45573496048293753446500886639.", "%+#1.f",
-__LINE__, 4.560736449944898e-27, "4.56074e-27", "%g",
-__LINE__, 4.563726230559341e-15, "+0.0", "%+2.1f",
-__LINE__, 4.572650965532532e-26, "+5E-26", "%+4.G",
-__LINE__, 4.574369572115099e-10, "+0.000000", "%+2.6f",
-__LINE__, 4.576480601519729e+28, "+4.576481e+28", "%+e",
-__LINE__, 4.587487640650499e+02, "+458.75", "%+3.2f",
-__LINE__, 4.598365231538559e-27, "4.59837E-27", "%G",
-__LINE__, 4.599348244725009e-28, "+4.5993482e-28", "%+#3.7e",
-__LINE__, 4.599897524047587e+22, "45998975240475870052136.997401", "%#f",
-__LINE__, 4.605415604725077e-25, "0.000000", "%f",
-__LINE__, 4.613055015797716e+28, "4.613055E+28", "%E",
-__LINE__, 4.618715275814238e-10, "4.618715E-10", "%E",
-__LINE__, 4.619044579489540e-14, "0.00", "%.2f",
-__LINE__, 4.633693310095410e-20, "+0.000000", "%+f",
-__LINE__, 4.648505395281916e-28, "0.000000", "%f",
-__LINE__, 4.651232770446398e+21, "4.65e+21", "%.2e",
-__LINE__, 4.659743589975352e+28, "+4.65974e+28", "%+g",
-__LINE__, 4.660181457075208e-13, "4.66018e-13", "%g",
-__LINE__, 4.669787018529686e+20, "4.66979e+20", "%g",
-__LINE__, 4.672649286126732e-21, "4.6726E-21", "%4.5G",
-__LINE__, 4.675431901120643e-11, " 0", "%3.f",
-__LINE__, 4.684404068169945e+26, "468440406816994503458317922.2", "%6.1f",
-__LINE__, 4.685438834234642e+19, "5.E+19", "%#6.G",
-__LINE__, 4.688915890732712e+00, "+5e+00", "%+2.e",
-__LINE__, 4.692999432046297e+00, "4.692999E+00", "%E",
-__LINE__, 4.708690772584701e+11, "4.70869e+11", "%g",
-__LINE__, 4.711821455782105e-11, "+4.71182e-11", "%+1g",
-__LINE__, 4.712413965116830e-01, "4.712414E-01", "%E",
-__LINE__, 4.719504715401049e-08, "0.000000", "%f",
-__LINE__, 4.719767896031655e+27, "4.71977e+27", "%#g",
-__LINE__, 4.722493017411588e-05, "0.000047", "%4f",
-__LINE__, 4.729482386761477e+08, "4.72948e+08", "%1g",
-__LINE__, 4.730102169800602e-06, "0.000005", "%f",
-__LINE__, 4.743951614209393e+24, "4.743952E+24", "%#E",
-__LINE__, 4.746077075605921e-16, "4.746E-16", "%.3E",
-__LINE__, 4.747802537919248e+24, "4747802537919247889419694", "%4.f",
-__LINE__, 4.754727690703025e-26, "0", "%0.f",
-__LINE__, 4.756952432926979e-29, " 0.", "%#3.f",
-__LINE__, 4.758335147956709e+03, "4758.335148", "%f",
-__LINE__, 4.760141880810268e-25, "4.760142e-25", "%e",
-__LINE__, 4.767079423650815e-07, "5.E-07", "%#0.G",
-__LINE__, 4.785662728343338e-28, "4.78566e-28", "%g",
-__LINE__, 4.787146245774150e-13, "+4.78715E-13", "%+G",
-__LINE__, 4.787415449888824e-17, "4.78742e-17", "%3g",
-__LINE__, 4.794589807429657e-05, "4.79459E-05", "%6G",
-__LINE__, 4.794948299666205e+08, "4.79495e+08", "%g",
-__LINE__, 4.802292865915992e-04, "4.802293e-04", "%e",
-__LINE__, 4.802513688198601e+07, "+4.8e+07", "%+2.3g",
-__LINE__, 4.810456746192536e+06, "5E+06", "%0.0G",
-__LINE__, 4.820631660081696e+20, "+4.82063E+20", "%+G",
-__LINE__, 4.827865857270075e-20, "4.82787e-20", "%g",
-__LINE__, 4.835054268490970e+21, "4835054268490970308391.752042", "%#f",
-__LINE__, 4.838136770808465e-18, "4.83814E-18", "%G",
-__LINE__, 4.839342397882353e-26, "4.839342E-26", "%E",
-__LINE__, 4.845130210072029e-16, "0", "%1.f",
-__LINE__, 4.845161043167169e-12, "+4.845e-12", "%+.4g",
-__LINE__, 4.857425142494964e+01, "48.574251", "%f",
-__LINE__, 4.858118337285513e-10, "+4.8581e-10", "%+.5g",
-__LINE__, 4.867478343525339e-15, "+4.867478E-15", "%+E",
-__LINE__, 4.886137001331278e-11, "0.000000", "%f",
-__LINE__, 4.886835850687998e-20, " 0", "%6.0f",
-__LINE__, 4.886880737482383e+26, "488688073748238327453918827.814050", "%4f",
-__LINE__, 4.888812049144075e-22, "4.888812E-22", "%E",
-__LINE__, 4.895869618002905e+02, "+489.587", "%+.7g",
-__LINE__, 4.902046593298549e+09, " 5e+09", "%7.g",
-__LINE__, 4.907918627564751e-05, "4.91e-05", "%.3g",
-__LINE__, 4.916048355579009e+19, "49160483555790088772", "%2.f",
-__LINE__, 4.917197806128638e+14, "+5e+14", "%+5.g",
-__LINE__, 4.918303274189911e+13, "4.918303e+13", "%e",
-__LINE__, 4.922687970321108e+26, "492268797032110771993984599.2485", "%0.4f",
-__LINE__, 4.929263362431195e+14, "4.92926e+14", "%g",
-__LINE__, 4.933385398543267e-17, "0.000000", "%#f",
-__LINE__, 4.942367126455025e+00, " +5", "%+6.f",
-__LINE__, 4.947687486717652e-04, "0.000495", "%.6f",
-__LINE__, 4.960855200003128e-08, "+4.960855e-08", "%+e",
-__LINE__, 4.968485435774085e-21, "0.0000", "%#2.4f",
-__LINE__, 4.972088381506133e+01, "49.7", "%.1f",
-__LINE__, 4.977561524480392e-15, "4.977562E-15", "%7E",
-__LINE__, 4.984592111249502e-13, "5.0e-13", "%.1e",
-__LINE__, 4.997502335602838e-14, "4.998e-14", "%6.4g",
-__LINE__, 5.001731554335935e-09, "5.00173e-09", "%g",
-__LINE__, 5.006231697107042e-17, "5.0062e-17", "%1.5g",
-__LINE__, 5.008035801093423e+24, "5.008036E+24", "%#E",
-__LINE__, 5.008756965733827e-28, "5.009E-28", "%.4G",
-__LINE__, 5.009774027622812e+20, "+5.00977E+20", "%+G",
-__LINE__, 5.010576312346293e+29, "5.01058E+29", "%G",
-__LINE__, 5.012335250996786e+29, "5.012335e+29", "%.7g",
-__LINE__, 5.012404365186907e+20, "5E+20", "%3.2G",
-__LINE__, 5.024670103250229e-01, "+5.024670E-01", "%+E",
-__LINE__, 5.025765369164560e+03, "5025.77", "%g",
-__LINE__, 5.027173841003918e+11, "+5.02717E+11", "%+G",
-__LINE__, 5.032093817639893e-26, "5e-26", "%3.e",
-__LINE__, 5.039636818525848e-02, "0.050396", "%#f",
-__LINE__, 5.040626671307691e+23, "5.040627E+23", "%E",
-__LINE__, 5.040788233368296e-11, "+5.04079e-11", "%+g",
-__LINE__, 5.040903321336150e-28, "5.0409E-28", "%G",
-__LINE__, 5.042078512958994e+12, "5.04208E+12", "%G",
-__LINE__, 5.045957900223303e+15, "5045957900223303", "%0.f",
-__LINE__, 5.048298764352134e-14, "5.048299e-14", "%1e",
-__LINE__, 5.048827326763192e+28, "50488273267631917917697137454.524636", "%f",
-__LINE__, 5.049714558347361e-23, "5e-23", "%5.0g",
-__LINE__, 5.051509904923853e+16, "50515099049238534", "%5.f",
-__LINE__, 5.052789863743305e-10, "5.05279E-10", "%6G",
-__LINE__, 5.057429728861999e-29, "0.000", "%#1.3f",
-__LINE__, 5.075313093968501e-13, "+5.07531e-13", "%+g",
-__LINE__, 5.075874503501582e+29, "5e+29", "%2.e",
-__LINE__, 5.079468079020803e+01, "50.795", "%.5G",
-__LINE__, 5.086214826494080e-28, " 0.0", "%4.1f",
-__LINE__, 5.096054881114421e+13, "5.096e+13", "%.4g",
-__LINE__, 5.099045274853458e-23, "5.09905E-23", "%0G",
-__LINE__, 5.100248195124433e+00, "5.100248", "%f",
-__LINE__, 5.101016114276598e-20, "5e-20", "%4.1g",
-__LINE__, 5.103213528670269e+07, "51032135.286703", "%6f",
-__LINE__, 5.108373625126768e+08, "+510837362.512677", "%+f",
-__LINE__, 5.113097157183416e+07, "5.1131E+07", "%#.4E",
-__LINE__, 5.114452611789777e+08, "+5.11445E+08", "%+G",
-__LINE__, 5.117099184715288e-16, "5.1171E-16", "%G",
-__LINE__, 5.119910534665511e-13, "+5.11991E-13", "%+G",
-__LINE__, 5.121320931953720e+23, "+5.121321e+23", "%+#e",
-__LINE__, 5.121900318443998e+06, "5.121900e+06", "%e",
-__LINE__, 5.135698679084286e+00, "5.1357", "%2g",
-__LINE__, 5.146355903104154e-10, "+5.14636E-10", "%+.6G",
-__LINE__, 5.148754210958986e-24, "+5.148754e-24", "%+e",
-__LINE__, 5.156238368448428e+26, "5e+26", "%5.g",
-__LINE__, 5.159924520667922e-19, "+5E-19", "%+0.1G",
-__LINE__, 5.159938266135425e-27, "0.000000", "%f",
-__LINE__, 5.165915205175676e-01, "5.165915e-01", "%e",
-__LINE__, 5.190205499401547e-11, "5e-11", "%2.1g",
-__LINE__, 5.193260005542003e+26, "5.19326e+26", "%#g",
-__LINE__, 5.194732077318269e+08, "519473207.731827", "%f",
-__LINE__, 5.196394616633798e-19, "0", "%.0f",
-__LINE__, 5.206753628035638e+19, "5.20675e+19", "%6.6g",
-__LINE__, 5.207364136540851e-23, " 0.000", "%6.3f",
-__LINE__, 5.210672737132108e-09, "5.21067E-09", "%G",
-__LINE__, 5.211423933057123e-20, "+5.21142E-20", "%+G",
-__LINE__, 5.219749528363367e-27, "5.219750e-27", "%e",
-__LINE__, 5.228031587478653e-06, "+5.2E-06", "%+3.1E",
-__LINE__, 5.229303095005359e-25, "+0.000000", "%+#f",
-__LINE__, 5.234703511938320e-06, " 0", "%7.f",
-__LINE__, 5.235655046937822e-20, "5.235655E-20", "%.6E",
-__LINE__, 5.237924986002288e-01, "+0.52379", "%+.5f",
-__LINE__, 5.249148093603826e+20, "5.24915E+20", "%0G",
-__LINE__, 5.262680920244596e+16, "5.26268E+16", "%G",
-__LINE__, 5.267944704715845e-06, "5.e-06", "%#3.g",
-__LINE__, 5.268543533730505e-08, "5.26854E-08", "%G",
-__LINE__, 5.275727269515247e-02, "0.0527573", "%.6g",
-__LINE__, 5.279215316873723e+24, "5279215316873722585455652.733799", "%f",
-__LINE__, 5.284326985680811e+16, "52843269856808108.286828", "%6f",
-__LINE__, 5.286192957344040e-10, "5.3E-10", "%.1E",
-__LINE__, 5.289451976001091e-23, "5.28945E-23", "%G",
-__LINE__, 5.289512908209300e+09, "+5.289513e+09", "%+e",
-__LINE__, 5.295696957972123e+11, "5.296E+11", "%#.3E",
-__LINE__, 5.303584684011050e+16, "53035846840110503.208621", "%f",
-__LINE__, 5.310315581980172e+23, "531031558198017172855998", "%4.f",
-__LINE__, 5.317492728410062e-14, "5.31749e-14", "%7g",
-__LINE__, 5.324506949499409e+18, "5.3245E+18", "%.5G",
-__LINE__, 5.329238068668336e-20, "5e-20", "%4.g",
-__LINE__, 5.336050125161774e+14, "5.33605e+14", "%g",
-__LINE__, 5.349921315003169e-17, "5.34992E-17", "%.6G",
-__LINE__, 5.355648481782587e-20, "5.355648e-20", "%e",
-__LINE__, 5.358945557589489e-26, "+5e-26", "%+0.g",
-__LINE__, 5.359638846465574e+21, "5.359639E+21", "%E",
-__LINE__, 5.377048469393900e+14, "5.377E+14", "%.5G",
-__LINE__, 5.387471194156434e+23, "5.387471E+23", "%.7G",
-__LINE__, 5.401622578962497e-03, "+0.0054", "%+5.2g",
-__LINE__, 5.406882732497444e-16, "5.406883E-16", "%E",
-__LINE__, 5.421474560523198e-11, "+5.42147e-11", "%+g",
-__LINE__, 5.440249323479418e-26, "5.44025E-26", "%7G",
-__LINE__, 5.440922682921101e-05, "5e-05", "%.1g",
-__LINE__, 5.444400103673185e-01, "0.54444", "%G",
-__LINE__, 5.449339470916152e+09, "5449339470.9162", "%.4f",
-__LINE__, 5.451583259558706e-15, "5.e-15", "%#4.e",
-__LINE__, 5.460153018660573e+26, "+546015301866057267687892817.775719", "%+f",
-__LINE__, 5.477591210511918e+08, "+5.47759E+08", "%+0.5E",
-__LINE__, 5.481665401407188e-02, "5.481665e-02", "%e",
-__LINE__, 5.482670784411319e-16, "5E-16", "%4.G",
-__LINE__, 5.487494580636099e+12, "5.48749e+12", "%g",
-__LINE__, 5.508630369473937e-10, "5.508630e-10", "%e",
-__LINE__, 5.528898001438273e+20, "6e+20", "%4.g",
-__LINE__, 5.530331734443152e-24, " 6e-24", "%6.g",
-__LINE__, 5.531704398969656e-24, "0.000000", "%f",
-__LINE__, 5.539906569043238e+05, "+553990.656904", "%+f",
-__LINE__, 5.554571854756323e-08, "+0.00000", "%+4.5f",
-__LINE__, 5.555155069925145e-28, "5.55516e-28", "%g",
-__LINE__, 5.555302705075539e-08, "+5.5553e-08", "%+g",
-__LINE__, 5.563805076159055e-05, "5.563805e-05", "%e",
-__LINE__, 5.565063508995002e+07, "5.565E+07", "%.3E",
-__LINE__, 5.566281664807526e-08, "5.56628E-08", "%G",
-__LINE__, 5.575245679736338e-08, "5.575246e-08", "%e",
-__LINE__, 5.578254777281501e-21, "0.", "%#.0f",
-__LINE__, 5.582389275770848e-01, " 0.6", "%5.G",
-__LINE__, 5.592215029176133e-04, "0.00056", "%.2g",
-__LINE__, 5.593536789867047e-25, "5.59354e-25", "%g",
-__LINE__, 5.605652054074862e-03, " 0.006", "%8.G",
-__LINE__, 5.606982382643258e+20, "+5.60698E+20", "%+G",
-__LINE__, 5.614646821116853e-18, "5.6E-18", "%.2G",
-__LINE__, 5.625586848606565e-11, "+5.62559E-11", "%+G",
-__LINE__, 5.626300428046732e+26, " 6e+26", "%7.g",
-__LINE__, 5.638236626881086e-17, " 6E-17", "%6.G",
-__LINE__, 5.645744817075691e+04, "5.645745E+04", "%E",
-__LINE__, 5.651410004691736e+06, "6.E+06", "%#3.E",
-__LINE__, 5.659582345929256e-11, "+0.000000", "%+f",
-__LINE__, 5.670968861413510e+16, "+5.67097E+16", "%+G",
-__LINE__, 5.672476851235796e+01, "+56.724769", "%+0f",
-__LINE__, 5.674563779921248e+28, " 6E+28", "%6.0G",
-__LINE__, 5.675558529939025e+19, "5.67556e+19", "%3g",
-__LINE__, 5.676326888314589e-08, " 6e-08", "%7.g",
-__LINE__, 5.677928507840897e-30, "5.67793e-30", "%0g",
-__LINE__, 5.686622552402630e-15, "5.69E-15", "%1.3G",
-__LINE__, 5.710441686922142e-14, "5.710442E-14", "%E",
-__LINE__, 5.713234603280163e-21, "0.00000", "%0.5f",
-__LINE__, 5.714968959046963e+12, "5.71497e+12", "%g",
-__LINE__, 5.722025141555638e-23, "5.72e-23", "%.2e",
-__LINE__, 5.725398571007033e-09, "5.7254E-09", "%.6G",
-__LINE__, 5.751604813862738e+18, "6E+18", "%.1G",
-__LINE__, 5.761025444751985e+20, "5.76103e+20", "%g",
-__LINE__, 5.762315767948593e+15, "5.76232e+15", "%4g",
-__LINE__, 5.764528858586032e-15, "5.764529E-15", "%6.7G",
-__LINE__, 5.766408541535810e-07, " 6E-07", "%6.1G",
-__LINE__, 5.771831571087174e-01, "0.577183", "%f",
-__LINE__, 5.790102497364865e-15, "+5.790102e-15", "%+e",
-__LINE__, 5.790222335547785e-08, "5.79022e-08", "%0.6g",
-__LINE__, 5.794082127091130e+21, "5794082127091130018925.468903", "%f",
-__LINE__, 5.804568463644165e+28, "5.80457e+28", "%g",
-__LINE__, 5.827356651901066e+20, "582735665190106555400.006982", "%f",
-__LINE__, 5.837553387436408e+18, "5.837553E+18", "%3E",
-__LINE__, 5.844458110907209e+22, "5.84446e+22", "%g",
-__LINE__, 5.851672125746866e-19, "5.85167e-19", "%g",
-__LINE__, 5.868843476784172e-12, "5.868843e-12", "%1.7g",
-__LINE__, 5.870854146748864e-04, "0.000587", "%2.3g",
-__LINE__, 5.877787821470433e+01, "+58.77788", "%+#3.5f",
-__LINE__, 5.881333514866498e+04, "5.881334E+04", "%E",
-__LINE__, 5.908427816128965e+28, "+5.908428E+28", "%+E",
-__LINE__, 5.918139800007388e+07, "59181398.000074", "%f",
-__LINE__, 5.925587467475260e+21, "5925587467475259551008.548442", "%f",
-__LINE__, 5.930403502679683e-22, "5.9304E-22", "%.6G",
-__LINE__, 5.961572644847521e+02, "+596.157", "%+G",
-__LINE__, 5.968917715225198e-21, "5.96892e-21", "%4g",
-__LINE__, 5.982184454670110e-08, "0", "%0.f",
-__LINE__, 5.988414319040855e+09, "6E+09", "%0.G",
-__LINE__, 5.996263783103995e-10, "5.996264e-10", "%e",
-__LINE__, 6.004634162276014e-18, "6.00463e-18", "%g",
-__LINE__, 6.018734975519166e-08, "6.01873E-08", "%G",
-__LINE__, 6.029071822986717e-14, "0.0000000", "%.7f",
-__LINE__, 6.030392278117406e+23, "6.030392e+23", "%e",
-__LINE__, 6.034553399237175e-27, "+6.03455e-27", "%+g",
-__LINE__, 6.034938873443862e+24, "6034938873443861595546877.651941", "%f",
-__LINE__, 6.038929148003457e-16, "6.03893e-16", "%g",
-__LINE__, 6.039149626573702e-13, "6.0391E-13", "%3.5G",
-__LINE__, 6.041247664739301e+29, "6.041248E+29", "%3E",
-__LINE__, 6.044220746789781e+20, "+6.04422e+20", "%+g",
-__LINE__, 6.045775647107433e+19, "6E+19", "%2.G",
-__LINE__, 6.051917010461611e-05, "6.05192E-05", "%G",
-__LINE__, 6.059773181566425e+17, "+605977318156642486", "%+5.f",
-__LINE__, 6.082239575475813e+01, "+6E+01", "%+.1G",
-__LINE__, 6.093984174629151e+18, "6.093984e+18", "%e",
-__LINE__, 6.102368380479137e+22, "6.1E+22", "%.2G",
-__LINE__, 6.103097446204007e+25, "61030974462040070704915706.301108", "%#0f",
-__LINE__, 6.105244994410556e-24, "0.0000000", "%2.7f",
-__LINE__, 6.110828906801633e-14, "+6.110829e-14", "%+3e",
-__LINE__, 6.124439072468681e-30, "6.12444e-30", "%g",
-__LINE__, 6.127714703273447e-15, "0", "%0.f",
-__LINE__, 6.128539582408870e-15, "6.12854e-15", "%g",
-__LINE__, 6.145470264744349e+24, "6145470264744348654062378.045637", "%f",
-__LINE__, 6.159177701667455e+26, "615917770166745537352426254.074089", "%#f",
-__LINE__, 6.159348213337442e+17, "6.15935e+17", "%g",
-__LINE__, 6.161953891020492e-21, "0.000000", "%f",
-__LINE__, 6.169474192777305e+29, "+6.169E+29", "%+.4G",
-__LINE__, 6.198519761010651e-15, "+0", "%+1.f",
-__LINE__, 6.201381824304919e-27, " 0", "%5.f",
-__LINE__, 6.204387065736372e-18, "6.204387E-18", "%7E",
-__LINE__, 6.209270088144063e-24, "0.000000", "%f",
-__LINE__, 6.209871738353546e-20, "6.20987E-20", "%G",
-__LINE__, 6.222733191871026e+14, "+6.22273e+14", "%+g",
-__LINE__, 6.234670085354310e+04, "+62346.700854", "%+f",
-__LINE__, 6.258389346602224e-09, "6E-09", "%.0G",
-__LINE__, 6.263326582587503e+12, "6263326582588.", "%#5.f",
-__LINE__, 6.272768026763922e+03, "+6272.77", "%+g",
-__LINE__, 6.287747868625765e+00, "6E+00", "%.0E",
-__LINE__, 6.297724027388795e-17, "+6E-17", "%+3.G",
-__LINE__, 6.309940679156400e+27, "6.30994e+27", "%6.5e",
-__LINE__, 6.312960327030170e+06, "+6.312960E+06", "%+E",
-__LINE__, 6.317658179632976e+02, "+631.766", "%+g",
-__LINE__, 6.321255960699571e-27, "0.000000", "%f",
-__LINE__, 6.323069932833900e+03, "6323", "%.4G",
-__LINE__, 6.337027835933034e+21, "6.33703e+21", "%#g",
-__LINE__, 6.343583177899838e-03, "0.00634358", "%7G",
-__LINE__, 6.347464241733904e-03, "6.e-03", "%#0.e",
-__LINE__, 6.352038720353924e+07, "63520387.203539", "%f",
-__LINE__, 6.355292378565109e+23, "+635529237856510942350496.407016", "%+f",
-__LINE__, 6.377901944439164e-29, "0.000", "%2.3f",
-__LINE__, 6.378660255554053e-04, "6.37866E-04", "%.5E",
-__LINE__, 6.382838195255167e-18, "0.000000", "%f",
-__LINE__, 6.391046303581911e+22, "6E+22", "%.0G",
-__LINE__, 6.404812348309621e+22, "6.404812E+22", "%.7G",
-__LINE__, 6.406154091357119e+16, "6.40615E+16", "%G",
-__LINE__, 6.419414726557980e+21, "+6.41941e+21", "%+g",
-__LINE__, 6.432166563008504e+10, " +6e+10", "%+7.g",
-__LINE__, 6.438463704193190e+19, "6.438464e+19", "%e",
-__LINE__, 6.445270237908565e+15, "+6.445270E+15", "%+E",
-__LINE__, 6.445536770502964e+09, "6.446e+09", "%.3e",
-__LINE__, 6.446614224811444e+28, "64466142248114444157636171439.662576", "%f",
-__LINE__, 6.457046289718297e+18, "6457046289718297416.015957", "%4f",
-__LINE__, 6.457682856890173e+01, "6.457683E+01", "%2E",
-__LINE__, 6.471026352792729e-16, "+6.47103e-16", "%+g",
-__LINE__, 6.474527749567342e+19, "6E+19", "%.1G",
-__LINE__, 6.481178401781131e-24, "+6.48E-24", "%+6.3G",
-__LINE__, 6.490736647261461e-15, "+6.49074e-15", "%+g",
-__LINE__, 6.493196535069719e+23, "+6.4932E+23", "%+G",
-__LINE__, 6.500296992935538e-20, "+0.0", "%+.1f",
-__LINE__, 6.502867735895890e-19, "+0.000000", "%+6f",
-__LINE__, 6.506627529164683e+14, "650662752916468", "%5.f",
-__LINE__, 6.511909298966434e-15, "+6.51191E-15", "%+G",
-__LINE__, 6.514463062693312e+01, "65.1446", "%G",
-__LINE__, 6.520721469484543e+16, "6.52072E+16", "%G",
-__LINE__, 6.528064508731680e-05, "6.528065E-05", "%7E",
-__LINE__, 6.529007214194039e-24, "0.000000", "%f",
-__LINE__, 6.537822760557410e-23, "0.000000", "%f",
-__LINE__, 6.552222096390805e+29, "+6.55222E+29", "%+G",
-__LINE__, 6.554569862717104e+12, "6.55457E+12", "%G",
-__LINE__, 6.563440840359989e-30, "7E-30", "%4.G",
-__LINE__, 6.586246985535526e+17, "6.58625E+17", "%#4G",
-__LINE__, 6.593339522442827e+16, "6.6E+16", "%#4.1E",
-__LINE__, 6.611179030024350e+02, "7E+02", "%4.E",
-__LINE__, 6.617541638586767e-10, "6.617542E-10", "%E",
-__LINE__, 6.619147920886991e-28, "7e-28", "%.1g",
-__LINE__, 6.622304444772819e-21, "6.62230E-21", "%#4G",
-__LINE__, 6.634766655157910e+12, "6634766655158", "%2.f",
-__LINE__, 6.635639771921218e+25, "+6.63564E+25", "%+G",
-__LINE__, 6.644575305929087e+17, "+6.64458e+17", "%+g",
-__LINE__, 6.648697591328432e+04, "6.648698E+04", "%3E",
-__LINE__, 6.665426012448100e+09, "6.66543E+09", "%G",
-__LINE__, 6.675222780441723e-23, "6.67522e-23", "%1g",
-__LINE__, 6.689765053880623e+00, "6.6898", "%.5g",
-__LINE__, 6.693874943680238e+25, "7.e+25", "%#1.g",
-__LINE__, 6.695033453546435e+19, "6.695033E+19", "%E",
-__LINE__, 6.720131534244976e+03, "+6720.132", "%+.3f",
-__LINE__, 6.725287004784564e+19, "+6.72529e+19", "%+g",
-__LINE__, 6.743599626906313e-18, "0.0000000", "%7.7f",
-__LINE__, 6.755534260704152e+29, "7.e+29", "%#5.e",
-__LINE__, 6.761855244766418e-18, "6.8E-18", "%.2G",
-__LINE__, 6.764974143681080e-02, "6.765E-02", "%2.3E",
-__LINE__, 6.766924477711975e-17, "0.000000", "%4f",
-__LINE__, 6.772195434106330e-19, "6.7722E-19", "%G",
-__LINE__, 6.779433073319225e-23, "0.00", "%.2f",
-__LINE__, 6.790317710068964e+05, "6.8e+05", "%.1e",
-__LINE__, 6.791378160292960e+02, "679.137816", "%f",
-__LINE__, 6.798381262104190e-27, "0.000000", "%f",
-__LINE__, 6.804165939424860e-14, "7e-14", "%4.g",
-__LINE__, 6.810668670623699e+11, "681066867062.369852", "%f",
-__LINE__, 6.838942637635821e-17, "+6.84e-17", "%+.2e",
-__LINE__, 6.868523988329111e-09, "+6.868524e-09", "%+e",
-__LINE__, 6.873228061403223e-15, "6.873228E-15", "%3E",
-__LINE__, 6.879370500093334e-12, "+0.000000", "%+f",
-__LINE__, 6.891525498686674e-10, "7e-10", "%0.g",
-__LINE__, 6.923027319286220e+21, "7.e+21", "%#1.g",
-__LINE__, 6.923565533024560e-11, "+6.92357e-11", "%+g",
-__LINE__, 6.931415640770737e-24, "+6.93142e-24", "%+g",
-__LINE__, 6.936582619246057e+09, "6.936583e+09", "%7e",
-__LINE__, 6.938661496670582e+05, "693866.1496671", "%2.7f",
-__LINE__, 6.946115378286550e-25, "0.000000", "%f",
-__LINE__, 6.955823211921219e-09, "6.95582e-09", "%g",
-__LINE__, 6.962365243425770e+29, "696236524342577034474288666388.019919", "%7f",
-__LINE__, 6.970432274812882e+05, "+7e+05", "%+1.0e",
-__LINE__, 6.975784942897122e-13, "6.975785e-13", "%e",
-__LINE__, 6.976786489904214e-07, "6.97679E-07", "%3G",
-__LINE__, 6.985245976357042e-05, "0.00", "%.2f",
-__LINE__, 6.993402879410720e-21, "6.9934e-21", "%g",
-__LINE__, 7.012183985341519e+28, "+70121839853415188770213717362", "%+2.f",
-__LINE__, 7.028670648856025e-15, "7.028671e-15", "%.7g",
-__LINE__, 7.034042985683665e-03, " 0", "%2.f",
-__LINE__, 7.044054273278726e+18, "7.044e+18", "%7.4g",
-__LINE__, 7.049706744250734e-06, "7E-06", "%0.E",
-__LINE__, 7.061982657056197e+13, "+7.061983e+13", "%+e",
-__LINE__, 7.066873668945899e+21, "7.06687E+21", "%G",
-__LINE__, 7.087941418633258e+26, "7.08794E+26", "%G",
-__LINE__, 7.108268134631547e+22, "7.108268E+22", "%E",
-__LINE__, 7.112095848565475e-19, "7.1121e-19", "%g",
-__LINE__, 7.116326241291862e+16, "7.116326e+16", "%e",
-__LINE__, 7.118854843597607e-22, "0.000000", "%f",
-__LINE__, 7.121423043456375e-27, "0.000000", "%f",
-__LINE__, 7.131415427096460e-03, "0.007131", "%3f",
-__LINE__, 7.132023279679892e+22, "7.e+22", "%#3.e",
-__LINE__, 7.146250280189992e-18, "0.000000", "%f",
-__LINE__, 7.150059058390724e+03, "7150.06", "%g",
-__LINE__, 7.161081578177381e-02, "+0.0716108", "%+G",
-__LINE__, 7.164935125149336e-27, "7.2E-27", "%#6.2G",
-__LINE__, 7.173125717489549e-10, "7.173126e-10", "%e",
-__LINE__, 7.174199549624193e+00, "7.1741995", "%.7f",
-__LINE__, 7.192493588077649e+27, "7.19249e+27", "%g",
-__LINE__, 7.215209568601445e-06, "7.215210e-06", "%e",
-__LINE__, 7.238322284100497e+03, "7238.3", "%.1f",
-__LINE__, 7.239203871123613e+06, "7239204", "%4.f",
-__LINE__, 7.245809072577019e-09, "+7.245809E-09", "%+E",
-__LINE__, 7.256275686433336e+03, "7.256276e+03", "%e",
-__LINE__, 7.265774291605193e+27, "+7.26577E+27", "%+G",
-__LINE__, 7.287968172227119e-21, "+7.287968e-21", "%+e",
-__LINE__, 7.306020169678527e+12, "7E+12", "%2.E",
-__LINE__, 7.315587463572568e-04, "0.", "%#.0f",
-__LINE__, 7.324627764547963e+09, "7.324628E+09", "%#E",
-__LINE__, 7.331904966719081e-06, "+7.3319E-06", "%+G",
-__LINE__, 7.334448152798243e-02, "0.07", "%0.g",
-__LINE__, 7.334487195961240e-01, "+0.733449", "%+#g",
-__LINE__, 7.381283575515707e+13, "7.381284E+13", "%E",
-__LINE__, 7.394854567245476e-11, "0.000000", "%7f",
-__LINE__, 7.401950211415377e-08, " 7e-08", "%6.e",
-__LINE__, 7.409023867864680e+03, "7409.023868", "%#3f",
-__LINE__, 7.411912956257733e-20, "7e-20", "%0.g",
-__LINE__, 7.445275019272160e+11, "744527501927.2159511", "%.7f",
-__LINE__, 7.450279765616891e-16, "7.45028e-16", "%.6g",
-__LINE__, 7.467047411334495e+14, "7.46705E+14", "%G",
-__LINE__, 7.485628870972725e+28, "7E+28", "%.0G",
-__LINE__, 7.495391782588563e+11, "749539178258.856253", "%f",
-__LINE__, 7.495824101611911e+06, "7.49582e+06", "%.6g",
-__LINE__, 7.499759867592402e+20, "+749975986759240154100.3", "%+.1f",
-__LINE__, 7.508983397140368e+04, "75089.8", "%g",
-__LINE__, 7.512585199581016e-27, "7.512585E-27", "%.6E",
-__LINE__, 7.516831372212545e-29, "+7.516831e-29", "%+e",
-__LINE__, 7.525789465978582e+00, "7.52579", "%G",
-__LINE__, 7.528655653725963e+06, "7.5287e+06", "%3.4e",
-__LINE__, 7.533217421035612e+28, "75332174210356122046050586504.861712", "%f",
-__LINE__, 7.534147071756384e+03, "7534.15", "%g",
-__LINE__, 7.542648637430919e-25, "+0.000000", "%+#f",
-__LINE__, 7.554380140947798e-15, " 8e-15", "%7.g",
-__LINE__, 7.557366996007743e+25, " 8E+25", "%7.G",
-__LINE__, 7.579228950138068e+08, "8e+08", "%3.e",
-__LINE__, 7.579773904052487e-13, "0.000000", "%3f",
-__LINE__, 7.580377544554059e+27, "7.58038e+27", "%#g",
-__LINE__, 7.589615147875915e-15, "7.59E-15", "%.3G",
-__LINE__, 7.593317194045158e-12, "+0.", "%+#1.f",
-__LINE__, 7.605535657484387e-07, "7.60554E-07", "%G",
-__LINE__, 7.609171121278006e-08, " 0", "%5.f",
-__LINE__, 7.612033900317304e-14, "7.61203e-14", "%g",
-__LINE__, 7.628040858080326e+23, "+7.62804e+23", "%+g",
-__LINE__, 7.632109382948695e-01, "0.763211", "%#f",
-__LINE__, 7.633415922627254e+28, "76334159226272539910951309138.908982", "%#f",
-__LINE__, 7.636190400774419e+22, "+7.636190E+22", "%+E",
-__LINE__, 7.636228368661314e-23, "0.000000", "%f",
-__LINE__, 7.653292362739654e-17, "7.65329E-17", "%#G",
-__LINE__, 7.664044705231460e+03, "7.664045E+03", "%5E",
-__LINE__, 7.664257283149626e-05, "7.66426E-05", "%0G",
-__LINE__, 7.668996632821614e-19, " 0.0", "%4.1f",
-__LINE__, 7.674502669497263e-24, "7.6745e-24", "%g",
-__LINE__, 7.681870119755193e+12, "+7.68187e+12", "%+#g",
-__LINE__, 7.693453198401315e+02, "769.3453198", "%5.7f",
-__LINE__, 7.705080073293603e-29, "7.705080E-29", "%1E",
-__LINE__, 7.707244083934683e-07, "7.71E-07", "%2.3G",
-__LINE__, 7.749445584970652e-17, "7.75E-17", "%6.3G",
-__LINE__, 7.755369447889403e+09, "7.8e+09", "%#4.2g",
-__LINE__, 7.760378169707072e-06, "7.76038e-06", "%g",
-__LINE__, 7.763518882114968e-10, "0.000000", "%f",
-__LINE__, 7.764720069569677e-18, "0.000000", "%0f",
-__LINE__, 7.768821339438552e-03, "0.00776882", "%g",
-__LINE__, 7.774767835990679e-29, "7.774768E-29", "%7E",
-__LINE__, 7.805567188246987e-04, "0.000780557", "%2G",
-__LINE__, 7.825157442935941e-26, "0.000000", "%f",
-__LINE__, 7.833373563161910e+29, "+783337356316190991378789476584.643126", "%+f",
-__LINE__, 7.875872661746674e-16, "7.875873E-16", "%E",
-__LINE__, 7.880664458920439e-28, "7.881E-28", "%#0.3E",
-__LINE__, 7.893084198630288e+18, "7893084198630288206", "%1.f",
-__LINE__, 7.912222737877417e+04, "79122.2", "%G",
-__LINE__, 7.913004582748724e-26, "0.000000", "%f",
-__LINE__, 7.913749944463836e+17, "791374994446383617.230367", "%f",
-__LINE__, 7.923881665760883e-24, "0.000000", "%f",
-__LINE__, 7.926699779993694e-03, "0.007927", "%5.6f",
-__LINE__, 7.941991860623354e-20, "7.941992e-20", "%e",
-__LINE__, 7.942700358097138e+17, "794270035809713803.587329", "%2f",
-__LINE__, 7.945451569935757e-16, "7.94545E-16", "%#4.6G",
-__LINE__, 7.948277588625241e-04, "0", "%.0f",
-__LINE__, 7.952265062569124e+21, "+7.95227e+21", "%+#g",
-__LINE__, 7.959953534668040e+11, "8e+11", "%2.e",
-__LINE__, 7.962059154424500e-22, "7.96206E-22", "%G",
-__LINE__, 7.962856142535673e-26, "7.9629E-26", "%#.5G",
-__LINE__, 7.966528574505771e+12, "7.96653e+12", "%g",
-__LINE__, 8.006496880305429e-21, "8.0065E-21", "%G",
-__LINE__, 8.023374861440542e+06, "+8023375", "%+6.f",
-__LINE__, 8.041139717082990e-20, "8.04114e-20", "%g",
-__LINE__, 8.044201752824126e+15, "8.04420E+15", "%.5E",
-__LINE__, 8.044262927409321e-10, "+8E-10", "%+2.2G",
-__LINE__, 8.058285708061202e+02, "+8.058286e+02", "%+e",
-__LINE__, 8.104422320765144e+10, "8.10442e+10", "%#4g",
-__LINE__, 8.104572628022330e-11, "0.000000", "%f",
-__LINE__, 8.112156369917432e+15, "+8.11216E+15", "%+G",
-__LINE__, 8.114566569709531e-18, "8.11457E-18", "%G",
-__LINE__, 8.114795069552519e+13, "8.114795E+13", "%E",
-__LINE__, 8.121382719830660e+03, "8121.382720", "%f",
-__LINE__, 8.125179335533733e-12, "+8.125179e-12", "%+e",
-__LINE__, 8.126383949107055e+19, "81263839491070548604.056967", "%f",
-__LINE__, 8.129961701307842e-04, "+0.00081", "%+5.2g",
-__LINE__, 8.143780077390936e+15, "8.14378E+15", "%G",
-__LINE__, 8.149891507777399e+16, "+8E+16", "%+1.G",
-__LINE__, 8.167395708830107e+03, "8167", "%3.f",
-__LINE__, 8.167703619221975e+01, "81.677", "%G",
-__LINE__, 8.178463030771759e+06, "+8.17846E+06", "%+G",
-__LINE__, 8.188188531273697e+12, "8.18819E+12", "%G",
-__LINE__, 8.189094866416537e+11, "+8E+11", "%+.1G",
-__LINE__, 8.205086844365809e-18, "+8.205087E-18", "%+#E",
-__LINE__, 8.205762333408320e-26, "0.000000", "%f",
-__LINE__, 8.212370598174696e-10, "8.2124E-10", "%.5G",
-__LINE__, 8.228054316085489e-14, "0.000000", "%3f",
-__LINE__, 8.244313484402404e-16, "8.24431e-16", "%g",
-__LINE__, 8.244472235472472e+19, "8.24447E+19", "%G",
-__LINE__, 8.245421473302411e-09, "+8.2454e-09", "%+1.5g",
-__LINE__, 8.252286626634840e-22, "8E-22", "%3.G",
-__LINE__, 8.259969177912707e-19, "0.000000", "%f",
-__LINE__, 8.265769991725211e+18, "8.26577e+18", "%.5e",
-__LINE__, 8.293986939496488e+25, "8.3E+25", "%.1E",
-__LINE__, 8.310348813512608e-23, "+8.31035e-23", "%+g",
-__LINE__, 8.316951996533247e-20, "0.000000", "%f",
-__LINE__, 8.318818016883803e+05, " 8e+05", "%6.1g",
-__LINE__, 8.324896920131877e-13, "+8.324897e-13", "%+e",
-__LINE__, 8.325228630004624e-03, "0.0083252", "%5.7f",
-__LINE__, 8.332538660129034e+14, "8.3e+14", "%5.2g",
-__LINE__, 8.343325212751775e+07, "8.34333e+07", "%#4g",
-__LINE__, 8.363117398136236e+20, "+8.36e+20", "%+.3g",
-__LINE__, 8.364181324448165e+27, "8.36418e+27", "%#g",
-__LINE__, 8.372159259848738e+10, "8.37216e+10", "%4g",
-__LINE__, 8.379252006152759e-26, "8.37925e-26", "%g",
-__LINE__, 8.392670395720252e+09, "8392670395.720252", "%f",
-__LINE__, 8.423360059147756e+05, "+842336.", "%+#G",
-__LINE__, 8.425921213167943e+09, "8.425921e+09", "%1.7g",
-__LINE__, 8.431664412515776e-16, "8.43166E-16", "%#G",
-__LINE__, 8.448608859842500e+02, "844.861", "%1.3f",
-__LINE__, 8.456292247478771e-14, "8.45629E-14", "%G",
-__LINE__, 8.460077225296853e-04, "0.000846008", "%G",
-__LINE__, 8.478635925746218e-10, "0.000000", "%f",
-__LINE__, 8.492455774427448e+06, "8.49246e+06", "%g",
-__LINE__, 8.494450528380746e-07, "8.494451e-07", "%e",
-__LINE__, 8.516435842947605e-23, "+0.000000", "%+1f",
-__LINE__, 8.519057789029134e-18, "0.000000", "%0f",
-__LINE__, 8.522602111109066e+18, " 9.e+18", "%#7.g",
-__LINE__, 8.529176788022152e-24, "8.529E-24", "%0.4G",
-__LINE__, 8.534979605642793e-07, "0.000001", "%f",
-__LINE__, 8.546859563634342e-07, "8.546860E-07", "%E",
-__LINE__, 8.552370027054106e+12, "9e+12", "%.0g",
-__LINE__, 8.561781328234041e+10, "8.56178e+10", "%4g",
-__LINE__, 8.562688793145107e-20, "8.562689e-20", "%1.7g",
-__LINE__, 8.573130147270046e-07, " 9E-07", "%7.G",
-__LINE__, 8.584571984387802e-18, "8.5846e-18", "%.5g",
-__LINE__, 8.596407996491291e+11, "8.596408E+11", "%#E",
-__LINE__, 8.604843726850381e+10, " 9E+10", "%6.G",
-__LINE__, 8.626884271938994e-23, "8.62688e-23", "%g",
-__LINE__, 8.631140282429168e+24, "8631140282429168308908629.", "%#.0f",
-__LINE__, 8.635194331917948e-16, "8.63519E-16", "%G",
-__LINE__, 8.641417311588688e-24, "+0.000000", "%+f",
-__LINE__, 8.649120264278466e+26, "8.65E+26", "%1.3G",
-__LINE__, 8.649745523383894e+06, "8.649746e+06", "%e",
-__LINE__, 8.654720740091021e+16, "8.65472e+16", "%g",
-__LINE__, 8.655445556834509e-08, "9e-08", "%4.g",
-__LINE__, 8.658954696751902e+06, "8.65895E+06", "%G",
-__LINE__, 8.665712368800818e-10, "+8.66571E-10", "%+G",
-__LINE__, 8.666937057116442e-10, "8.666937e-10", "%e",
-__LINE__, 8.670981239765155e+05, "867098", "%G",
-__LINE__, 8.679631934294932e-25, "+9.E-25", "%+#0.G",
-__LINE__, 8.683595173050962e-21, "8.68360E-21", "%#G",
-__LINE__, 8.684938704958039e+25, "8.684939E+25", "%E",
-__LINE__, 8.686745463281227e-12, "8.686745E-12", "%5.7G",
-__LINE__, 8.700227628706534e-12, "8.700228e-12", "%#e",
-__LINE__, 8.705101179577200e+04, "87051.011796", "%#2f",
-__LINE__, 8.707824829984700e-24, "9e-24", "%.1g",
-__LINE__, 8.717654041009233e+21, "+9E+21", "%+6.0E",
-__LINE__, 8.741736299906572e-11, "8.74174E-11", "%#0G",
-__LINE__, 8.742228350419966e+18, "+8742228350419965821.060941", "%+f",
-__LINE__, 8.743045146087558e-17, "+8.74305E-17", "%+2G",
-__LINE__, 8.747820269457588e+18, "8.74782E+18", "%G",
-__LINE__, 8.756274717008537e-28, "8.756275E-28", "%E",
-__LINE__, 8.769782309254687e-24, "+8.769782E-24", "%+2.6E",
-__LINE__, 8.788151659193398e-16, " 9E-16", "%6.E",
-__LINE__, 8.789514812202340e-07, "9E-07", "%0.G",
-__LINE__, 8.792657843164822e-07, "8.79266e-07", "%0g",
-__LINE__, 8.810976223440985e+05, "881097.622344", "%f",
-__LINE__, 8.822553973113614e+10, "8.82255E+10", "%G",
-__LINE__, 8.839440421530611e-04, "0.000883944", "%G",
-__LINE__, 8.842539073558434e-12, "0", "%1.f",
-__LINE__, 8.882818021261782e-13, "+8.9e-13", "%+4.2g",
-__LINE__, 8.899833909201039e+05, "8.8998E+05", "%.5G",
-__LINE__, 8.903167498000181e-13, "9e-13", "%0.g",
-__LINE__, 8.933727737932164e+09, "+8933727738", "%+4.f",
-__LINE__, 8.946226267100711e+06, "8.946E+06", "%1.4G",
-__LINE__, 8.953203780849794e-21, "8.9532E-21", "%G",
-__LINE__, 8.959934262635649e+28, "+8.959934e+28", "%+e",
-__LINE__, 8.969485341781558e-25, "0.000000", "%#f",
-__LINE__, 8.970058187654221e+02, "897.005819", "%f",
-__LINE__, 8.979846508565979e+02, "8.979847E+02", "%E",
-__LINE__, 8.984561117901212e+01, "8.984561E+01", "%E",
-__LINE__, 8.992157765875611e-12, "8.99216e-12", "%g",
-__LINE__, 9.004487016708012e+01, "9.004487e+01", "%#e",
-__LINE__, 9.007306978283218e-24, "9.007307e-24", "%e",
-__LINE__, 9.014546375043562e+17, "901454637504356171.007203", "%#3f",
-__LINE__, 9.028177786002161e-12, "9.02818E-12", "%G",
-__LINE__, 9.029635986381795e-02, "0.09", "%.1g",
-__LINE__, 9.032389962233431e-07, "+0.000001", "%+f",
-__LINE__, 9.038466945070887e+10, "+9.038467E+10", "%+E",
-__LINE__, 9.040166964322772e-27, "9.04017e-27", "%g",
-__LINE__, 9.044627673694681e-11, "9.04463E-11", "%G",
-__LINE__, 9.045906217628948e+17, "904590621762894819.823941", "%1f",
-__LINE__, 9.051764975661710e+11, "9.05176e+11", "%#g",
-__LINE__, 9.053142913711405e+29, "9.053143e+29", "%#e",
-__LINE__, 9.073185209160657e-19, "+9.07319e-19", "%+g",
-__LINE__, 9.074372574441451e+02, "907.437", "%g",
-__LINE__, 9.084624602048136e+08, "9.084625E+08", "%E",
-__LINE__, 9.088839346363631e+18, "9.09e+18", "%.2e",
-__LINE__, 9.091945159170871e-15, "9.09195e-15", "%5g",
-__LINE__, 9.115304318083716e+10, "9.115304e+10", "%e",
-__LINE__, 9.115978352902710e+28, "9.11598E+28", "%G",
-__LINE__, 9.121415008221017e-17, "9.E-17", "%#6.G",
-__LINE__, 9.127270978060388e+18, "9.E+18", "%#5.G",
-__LINE__, 9.143941729069086e+08, "9.143942E+08", "%#E",
-__LINE__, 9.162740105978580e-19, " 9.E-19", "%#7.G",
-__LINE__, 9.221509957559626e-18, "9.22151e-18", "%g",
-__LINE__, 9.227419774250317e-28, " 0.", "%#3.f",
-__LINE__, 9.230846660807540e-21, "0.000000", "%f",
-__LINE__, 9.238091727277130e-06, "+0.00001", "%+.5f",
-__LINE__, 9.244337357684406e+10, "9E+10", "%5.G",
-__LINE__, 9.259179793993285e-19, " 9E-19", "%7.0G",
-__LINE__, 9.274068541525759e-17, "9.274069e-17", "%e",
-__LINE__, 9.283833535882367e+16, "9.28383e+16", "%#g",
-__LINE__, 9.295693096364605e+11, "+9.295693E+11", "%+E",
-__LINE__, 9.301820438602407e+05, "930182", "%G",
-__LINE__, 9.322805251555376e-29, "9e-29", "%1.e",
-__LINE__, 9.358443042421307e-27, "9.35844e-27", "%g",
-__LINE__, 9.372658444745124e-23, "9.372658e-23", "%e",
-__LINE__, 9.380302971355292e+05, "938030.3", "%.7g",
-__LINE__, 9.381976354968076e-26, "+9.382E-26", "%+5.4G",
-__LINE__, 9.391072061980585e-15, "9.391072E-15", "%E",
-__LINE__, 9.403554117166546e-06, "0.000009", "%f",
-__LINE__, 9.403712900426614e-28, "9.40371e-28", "%g",
-__LINE__, 9.419046629820578e+03, "9419.046630", "%f",
-__LINE__, 9.422344695378412e+22, "94223446953784115720509.362291", "%f",
-__LINE__, 9.433327680467576e+01, "9.433328e+01", "%e",
-__LINE__, 9.443975205260596e+20, "9.44398e+20", "%g",
-__LINE__, 9.445134851965593e-04, "+9.445135E-04", "%+E",
-__LINE__, 9.448403585149890e+24, "9e+24", "%0.g",
-__LINE__, 9.463149430113036e+18, "9.46315e+18", "%g",
-__LINE__, 9.465735160722534e+27, "+9465735160722534402566452627.070248", "%+f",
-__LINE__, 9.495210794344892e-04, "0.000950", "%f",
-__LINE__, 9.501916506373814e-25, "9.50192E-25", "%#G",
-__LINE__, 9.514641335897739e+29, "9.51464E+29", "%G",
-__LINE__, 9.524633436992819e-04, " 0.001", "%6.G",
-__LINE__, 9.530925101873022e-18, "9.530925e-18", "%2e",
-__LINE__, 9.557903833216979e-22, "9.557904E-22", "%E",
-__LINE__, 9.587709102390903e-01, " 1", "%2.f",
-__LINE__, 9.592723000828453e-02, "9.592723E-02", "%5E",
-__LINE__, 9.603430008794172e+27, "9.60343e+27", "%g",
-__LINE__, 9.622648414989433e-18, "9.622648e-18", "%1e",
-__LINE__, 9.633326171289319e-23, "9.633326e-23", "%e",
-__LINE__, 9.662064616152408e+19, "96620646161524081918.5146393", "%1.7f",
-__LINE__, 9.668544846563163e-23, "9.668545e-23", "%e",
-__LINE__, 9.691014191346685e+28, "9.69101E+28", "%G",
-__LINE__, 9.693075414840598e+02, "+969.308", "%+G",
-__LINE__, 9.695013453291907e-30, "9.695013e-30", "%5e",
-__LINE__, 9.705983477801926e-24, "9.70598e-24", "%g",
-__LINE__, 9.709022568030226e-17, "0.000000", "%f",
-__LINE__, 9.715194901854826e+20, "9.715195e+20", "%e",
-__LINE__, 9.721011821337717e+16, "1E+17", "%0.G",
-__LINE__, 9.734895542899672e+14, "9.734896e+14", "%e",
-__LINE__, 9.741486438769710e-29, " 1e-28", "%6.g",
-__LINE__, 9.766657482315475e-24, "9.76666E-24", "%7G",
-__LINE__, 9.767283293054552e-02, "0.09767", "%5.5f",
-__LINE__, 9.769553159146005e-20, "9.76955E-20", "%G",
-__LINE__, 9.777220880605434e-10, "0.00", "%4.2f",
-__LINE__, 9.790290569034575e+20, "979029056903457473027.", "%#6.f",
-__LINE__, 9.793128245822718e-01, "0.979313", "%G",
-__LINE__, 9.804758536498200e+08, "980475853.650", "%.3f",
-__LINE__, 9.816883664191066e-02, "0.1", "%.0g",
-__LINE__, 9.836109821010300e+25, "9.83611e+25", "%g",
-__LINE__, 9.846197559631225e+03, "1E+04", "%2.G",
-__LINE__, 9.863289416819924e+12, "9.86329e+12", "%g",
-__LINE__, 9.865893798657353e+12, "9.866e+12", "%0.4g",
-__LINE__, 9.868248446640862e-15, "0.000000", "%#f",
-__LINE__, 9.869973080775134e+04, "98699.7", "%G",
-__LINE__, 9.899444006312953e+20, "1E+21", "%.1G",
-__LINE__, 9.904083146074285e-08, "9.904083e-08", "%6e",
-__LINE__, 9.909790408255471e+15, "9909790408255471.305665", "%f",
-__LINE__, 9.930297455798394e-13, "+9.930297E-13", "%+5.6E",
-__LINE__, 9.933314448709083e-15, "9.93331E-15", "%#.6G",
-__LINE__, 9.938714530509870e+29, "9.938715e+29", "%e",
-__LINE__, 9.953892603540162e+07, "9.95389E+07", "%G",
-__LINE__, 9.962084643867200e+14, "+996208464386720.038419", "%+f",
-__LINE__, 9.977706708809947e-09, "9.9777E-09", "%#.4E",
-#endif
-__LINE__, 9.978034352999867e+15, "9.978034e+15", "%2.6e",
-__LINE__, 9.998315286730175e-30, "9.998315e-30", "%6e",
-
-0
-};
-
-/* matches(s1, s2) is true if s1 is "approximately" equal to s2.
- Any digits after the first required_precision digits do not have to match.
- */
-
-int required_precision = 13;
-
-#if defined(__STDC__) || defined(__cplusplus)
-int matches(register char *result, register char *desired)
-#else
-int matches(result, desired)
- register char *result; register char *desired;
-#endif
-{
- int digits_seen = 0;
- for (;; result++, desired++) {
- if (*result == *desired) {
- if (*result == 0)
- return 1;
- else if (*result >= '0' && *result <= '9')
- digits_seen++;
- }
- else if (digits_seen >= required_precision
- && *result >= '0' && *result <= '9'
- && *desired >= '0' && *desired <= '9')
- continue;
- else
- return 0;
- }
-}
-
-extern void dump_stats();
-
-int main()
-{
- int errcount = 0;
- int testcount = 0;
- double d;
-#define BSIZE 1024
- char buffer[BSIZE];
- sprint_double_type *dptr;
-#if defined(__cplusplus) && !defined(TEST_LIBIO)
-
- strstream sstr(buffer, BSIZE, ios::in|ios::out);
-
- for (dptr = sprint_doubles; dptr->line; dptr++)
- {
- sstr.seekp(0);
- sstr.form(dptr->format_string, dptr->value);
- sstr << ends;
- if (!matches(buffer, dptr->result))
- {
- errcount++;
- cerr << "Error in line " << dptr->line;
- cerr << " using \"" << dptr->format_string;
- cerr << "\". Result is \"" << buffer << "\"; should be: \"";
- cerr << dptr->result << "\".\n";
- }
-
-#ifdef TEST_EXACTNESS
- sstr.seekp(0);
- sstr.form("%.999g", dptr->value);
- sstr << ends;
-
- sstr.seekg(0);
- sstr.scan("%lg", &d);
-
- if (dptr->value != d)
- {
- errcount++;
- cerr << "Error in line " << dptr->line;
- cerr << ". String is \"" << buffer << "\", value is " << d << ".\n";
- }
-#endif
- testcount++;
- }
-
- if (errcount == 0)
- {
- cerr << "Encountered no errors in " << testcount << " tests.\n";
- return 0;
- }
- else
- {
- cerr << "Encountered " << errcount << " errors in "
- << testcount << " tests.\n";
- return 1;
- }
-#else
- for (dptr = sprint_doubles; dptr->line; dptr++)
- {
- sprintf (buffer, dptr->format_string, dptr->value);
- if (!matches(buffer, dptr->result))
- {
- errcount++;
- fprintf(stderr,
- "Error in line %d using \"%s\". Result is \"%s\"; should be: \"%s\".\n",
- dptr->line, dptr->format_string, buffer, dptr->result);
- }
-
-#ifdef TEST_EXACTNESS
- sprintf (buffer, "%.999g", dptr->value);
- sscanf (buffer, "%lg", &d);
- if (dptr->value != d)
- {
- errcount++;
- fprintf (stderr,
- "Error in line %d. String is \"%s\", value is %g.\n",
- dptr->line, buffer, d);
- }
-#endif
- testcount++;
- }
-
- if (errcount == 0)
- {
- fprintf(stderr, "Encountered no errors in %d tests.\n", testcount);
- return 0;
- }
- else
- {
- fprintf(stderr, "Encountered %d errors in %d tests.\n",
- errcount, testcount);
- return 1;
- }
-#endif
-}
diff --git a/contrib/libg++/libio/tests/tiformat.c b/contrib/libg++/libio/tests/tiformat.c
deleted file mode 100644
index f28d646d72e8..000000000000
--- a/contrib/libg++/libio/tests/tiformat.c
+++ /dev/null
@@ -1,5093 +0,0 @@
-#ifdef TEST_LIBIO
-#include <iostdio.h>
-#else
-#ifdef __cplusplus
-#include <strstream.h>
-#else
-#include <stdio.h>
-#endif
-#endif /* !TEST_LIBIO */
-#include <string.h>
-
-/* Tests taken from Cygnus C library. */
-typedef struct {
- int line;
- long value;
- char *result;
- char *format_string;
-} sprint_int_type;
-
-sprint_int_type sprint_ints[] =
-{
-__LINE__, 0x000838d2, "838d2", "%.4x",
-__LINE__, 0x0063be46, "63BE46", "%-6X",
-__LINE__, -0x1b236c0, "-28456640", "%#0.d",
-__LINE__, -0x0000003, "-3", "% 0d",
-__LINE__, 0x0000ed51, "ed51", "%2.x",
-__LINE__, -0x00001f2, "-498", "%1ld",
-__LINE__, 0x0ea3e927, "EA3E927", "%+X",
-__LINE__, 0xffbef8da, "FFBEF8DA", "%5X",
-__LINE__, 0x62ff9f56, "62ff9f56", "%0x",
-__LINE__, 0x00000ad2, "AD2", "%.0X",
-__LINE__, 0x00000000, " ", "% 6.ld",
-__LINE__, 0xffffffff, "FFFFFFFF", "%1.4X",
-__LINE__, 0x0000208c, " 208C", "%5X",
-__LINE__, 0x0000003c, "3c", "%x",
-__LINE__, 0xffff6177, "0xffff6177", "%+#x",
-__LINE__, 0xffffdc8d, "ffffdc8d", "%+x",
-__LINE__, 0x00000000, "0", "%X",
-__LINE__, 0x00002434, "9268", "%0d",
-__LINE__, 0xd2c72cdb, "d2c72cdb", "%-x",
-__LINE__, 0xfe38012b, "0xfe38012b", "%+#7x",
-__LINE__, 0x00000001, "0001", "%#.4d",
-__LINE__, -0x008525a, "-0545370", "%06.7ld",
-__LINE__, 0xffffffac, "ffffffac", "%3.7x",
-__LINE__, 0x007424d2, "+7611602", "%+ld",
-__LINE__, 0x00001a85, "1A85", "%.4X",
-__LINE__, -0x0000019, "-25", "%3.d",
-__LINE__, 0xfffffffe, "fffffffe", "%-x",
-__LINE__, -0x34473b2, "-54817714", "% d",
-__LINE__, 0x000000ea, "234", "%1.ld",
-__LINE__, -0x0000004, "-4 ", "%-7.ld",
-__LINE__, 0x00006c94, "27796", "%0d",
-__LINE__, 0x00000001, "1", "%ld",
-__LINE__, 0x00000619, "619", "%1x",
-__LINE__, 0x0000209c, "8348", "%ld",
-__LINE__, -0x327f8ff, "-52951295", "%-0ld",
-__LINE__, 0xffffff0b, "FFFFFF0B", "%2.X",
-__LINE__, 0xf199d6ae, "F199D6AE", "%X",
-__LINE__, 0x3ca5602e, "1017471022", "%-1.ld",
-__LINE__, -0xfb2080b, "-263325707", "%3.5d",
-__LINE__, 0x00001cb8, "7352", "%d",
-__LINE__, 0x00000000, "0000000", "%3.7d",
-__LINE__, 0xffffff40, "FFFFFF40", "%+X",
-__LINE__, 0x14664450, "0x14664450", "%#x",
-__LINE__, 0x0000002e, "2e", "%1x",
-__LINE__, 0xffffffff, "ffffffff", "%x",
-__LINE__, 0xffff606a, "0XFFFF606A", "%#X",
-__LINE__, 0xffffff33, "0XFFFFFF33", "%#X",
-__LINE__, 0x00000000, "0", "%d",
-__LINE__, -0x0000012, "-00018", "%-2.5d",
-__LINE__, 0x0001fbe6, "130022", "%1.d",
-__LINE__, 0xfff59dd9, "fff59dd9", "%+x",
-__LINE__, 0x00000002, "2", "%0.0d",
-__LINE__, 0x00000fe1, "fe1 ", "%-7.x",
-__LINE__, 0x001f8f6a, "1F8F6A", "%1.X",
-__LINE__, 0x0000001b, "000001B", "%04.7X",
-__LINE__, 0x126a2609, " 308946441", "% 4d",
-__LINE__, 0xffffffe3, "0XFFFFFFE3", "%+#.1X",
-__LINE__, 0x1858f1c9, "1858f1c9", "%.3x",
-__LINE__, 0x003fc672, "3fc672", "%1x",
-__LINE__, 0x00c0bddc, "12631516", "%#d",
-__LINE__, 0x000006d6, "1750", "%#d",
-__LINE__, 0x000006a0, "6A0", "%X",
-__LINE__, 0x000007be, "7BE", "%X",
-__LINE__, -0x1c7cd1a, "-29871386", "%ld",
-__LINE__, 0x000000cc, "204", "%ld",
-__LINE__, 0x000002db, "731 ", "%-#5d",
-__LINE__, 0xffff67ad, "FFFF67AD", "% X",
-__LINE__, 0x00000008, "8", "%d",
-__LINE__, 0xffe07007, "FFE07007", "%5X",
-__LINE__, -0x0000001, " -1", "% 7d",
-__LINE__, 0xfffffffe, "fffffffe", "%x",
-__LINE__, 0x00027b68, "+162664", "%+ld",
-__LINE__, 0x0a7c1997, "+175905175", "%+2ld",
-__LINE__, 0xfe300896, "fe300896", "%.4x",
-__LINE__, 0x00000537, "537", "%-0.x",
-__LINE__, 0x3e981779, "3e981779", "%.6x",
-__LINE__, 0xfffff05e, "FFFFF05E", "%1.0X",
-__LINE__, -0x07bc0cf, "-8110287", "%-7d",
-__LINE__, -0x01371bc, "-1274300", "%.7ld",
-__LINE__, -0x0000013, "-19", "%.2ld",
-__LINE__, 0x000000d1, "0xd1", "%#x",
-__LINE__, -0x0000003, "-3", "%-ld",
-__LINE__, 0xfffffffc, "FFFFFFFC", "%4.1X",
-__LINE__, 0x00000000, "0", "%ld",
-__LINE__, 0x0001c8af, "116911", "%d",
-__LINE__, 0x000048c3, "48C3", "%X",
-__LINE__, 0x00000079, "0x0000079", "%-#0.7x",
-__LINE__, 0x0000615a, " 24922", "% d",
-__LINE__, 0xfffffff5, "fffffff5", "%x",
-__LINE__, 0x00000308, "0000308", "%+07.7x",
-__LINE__, 0xfcadc983, "fcadc983", "%x",
-__LINE__, 0x00000097, "151", "%#d",
-__LINE__, 0x000001c5, "453", "%0.2ld",
-__LINE__, 0x00000000, "00", "%-1.2x",
-__LINE__, 0x00000001, "+1", "%+02.d",
-__LINE__, 0x01eb4354, "1EB4354", "% X",
-__LINE__, 0xffffa7d1, "ffffa7d1", "%5.x",
-__LINE__, 0x0003170e, "0x3170e", "%#x",
-__LINE__, 0x000001ce, "1CE", "% .2X",
-__LINE__, 0x3a2991fb, "975802875", "%d",
-__LINE__, -0xcdad8e2, "-215668962", "%-d",
-__LINE__, 0xfe0261c3, "fe0261c3", "%x",
-__LINE__, -0x0006ea7, "-28327", "% ld",
-__LINE__, 0x032854a3, "0X32854A3", "% #6X",
-__LINE__, 0x0000004b, "4b", "%x",
-__LINE__, 0xffff6ca3, "FFFF6CA3", "%4.X",
-__LINE__, 0x00000000, "0", "%X",
-__LINE__, 0x00611f04, "611F04", "%.1X",
-__LINE__, 0x00000000, " 0", "%#6d",
-__LINE__, 0x0002c711, "2c711", "%-02.x",
-__LINE__, -0x07a2fe4, "-8007652", "%d",
-__LINE__, -0x0000547, "-1351", "%ld",
-__LINE__, 0x00013954, "0x13954", "%#x",
-__LINE__, -0x00523b7, "-336823", "%ld",
-__LINE__, -0x00f6c6e, "-1010798", "%6.ld",
-__LINE__, 0xffea6427, "FFEA6427", "%3X",
-__LINE__, -0x0000005, "-5", "%d",
-__LINE__, -0x04fe618, "-5236248", "% .7d",
-__LINE__, 0xffa80a28, "ffa80a28", "%-0x",
-__LINE__, 0x00000047, "71", "%ld",
-__LINE__, 0x001dc6bb, "1951419", "%#4ld",
-__LINE__, 0x00000868, " 2152", "%#6d",
-__LINE__, 0x000002fb, "2fb", "%x",
-__LINE__, 0x00607fa0, "6324128", "%4d",
-__LINE__, 0xfffed161, "fffed161", "%x",
-__LINE__, 0x0001c6e4, " 116452", "% 2.5d",
-__LINE__, 0x0003dda8, "3DDA8", "%4X",
-__LINE__, 0xfffffff8, "fffffff8", "%x",
-__LINE__, 0xfacf664a, "facf664a", "%x",
-__LINE__, 0x000000c1, "C1", "% 1X",
-__LINE__, 0x0000839c, " 839C", "%6X",
-__LINE__, 0xfffff69a, "FFFFF69A", "%X",
-__LINE__, 0x000e5c2e, "+941102", "%+d",
-__LINE__, -0x0000004, "-4", "%#d",
-__LINE__, 0x00000000, "00000", "%#.5ld",
-__LINE__, 0xfffffffe, "fffffffe", "%3.1x",
-__LINE__, 0x0010ed68, "1109352", "%-ld",
-__LINE__, 0xffffffe9, "ffffffe9", "%.6x",
-__LINE__, 0x00000007, " 7", "% 4.ld",
-__LINE__, 0x0000caba, "51898", "%ld",
-__LINE__, -0x0000119, "-281", "% d",
-__LINE__, 0x0c3012a9, "204477097", "%03.6ld",
-__LINE__, -0x001c98f, "-117135", "%ld",
-__LINE__, 0x000017b1, "+6065", "%+d",
-__LINE__, 0x00000001, "1", "%ld",
-__LINE__, -0x0000019, "-25", "% .2d",
-__LINE__, 0x0009ae28, "9AE28", "%X",
-__LINE__, 0xe861c4fe, "e861c4fe", "%7.x",
-__LINE__, 0xffac88d3, "FFAC88D3", "%X",
-__LINE__, -0x00005df, "-01503", "%-5.5ld",
-__LINE__, 0x0000013e, "318", "%-0d",
-__LINE__, 0x04b6f58f, "4b6f58f", "%x",
-__LINE__, 0xfffe3978, "fffe3978", "%+0.6x",
-__LINE__, 0x57ee5244, "57ee5244", "%+7.4x",
-__LINE__, 0xfffb5610, "fffb5610", "% 6x",
-__LINE__, 0x00000006, " 6", "%#7d",
-__LINE__, 0x0000000c, "0x0000c", "%#.5x",
-__LINE__, -0xec59362, "-247829346", "%1.7d",
-__LINE__, -0x0000001, "-1", "%ld",
-__LINE__, -0x0007e4b, "-32331", "% d",
-__LINE__, 0x0ececa6f, "248433263", "%0d",
-__LINE__, 0x00000578, " 578", "%+6.x",
-__LINE__, -0x0000003, "-3", "%ld",
-__LINE__, 0x000002bb, "2bb", "% 0x",
-__LINE__, -0x0000006, "-6", "%-ld",
-__LINE__, 0x000002f9, "761", "%d",
-__LINE__, 0xffffd736, "ffffd736", "%3.4x",
-__LINE__, 0x0010ba79, "1096313", "%7.4d",
-__LINE__, -0x0001244, "-4676", "%#.1d",
-__LINE__, 0x00000dbe, "DBE", "%1X",
-__LINE__, -0x0000015, "-21", "%-0.d",
-__LINE__, 0xffffffff, "0xffffffff", "%#x",
-__LINE__, -0x6cdf4a3, "-114160803", "%ld",
-__LINE__, 0x00008ac9, "8AC9", "%1X",
-__LINE__, 0x00000000, "00", "%.2X",
-__LINE__, -0x2263dba, "-36060602", "%5.5d",
-__LINE__, 0x00007da9, "32169", "%0d",
-__LINE__, 0xfffffff7, "FFFFFFF7", "% 4.X",
-__LINE__, 0xfbf36cca, "FBF36CCA", "%.1X",
-__LINE__, 0x00000040, "64", "%.0ld",
-__LINE__, 0x0000001c, " 28", "% d",
-__LINE__, 0xfffffadb, "0xfffffadb", "%#.5x",
-__LINE__, 0x0eb95847, "247027783", "%d",
-__LINE__, 0xfffd7030, "FFFD7030", "%+02X",
-__LINE__, 0x00000005, "00005", "%.5x",
-__LINE__, 0xfffffffd, "FFFFFFFD", "%X",
-__LINE__, 0x98975b15, "98975B15", "%02X",
-__LINE__, -0x0000034, " -52", "%6ld",
-__LINE__, 0xffd7d0cc, "ffd7d0cc", "% 5.6x",
-__LINE__, 0xffffffa6, "FFFFFFA6", "%X",
-__LINE__, 0xfff27132, "fff27132", "%x",
-__LINE__, -0x065b74d, "-6666061", "%+6ld",
-__LINE__, 0xf6ac99d6, "0XF6AC99D6", "%#X",
-__LINE__, 0xfffff4bd, "FFFFF4BD", "%X",
-__LINE__, 0xfffffb62, "FFFFFB62", "%6X",
-__LINE__, 0xf8434543, "f8434543", "%-0x",
-__LINE__, 0x0002b374, "0x2b374", "%-#6x",
-__LINE__, 0x00000000, "0", "%x",
-__LINE__, 0xffb5751d, "ffb5751d", "%-3.x",
-__LINE__, 0x34ea7347, "887780167", "%d",
-__LINE__, -0x008f457, "-586839", "%0ld",
-__LINE__, 0x00000001, " 1", "%#4d",
-__LINE__, 0xc32d7ad4, "c32d7ad4", "%0x",
-__LINE__, 0xfffffb80, "FFFFFB80", "%-.2X",
-__LINE__, 0x00000756, "756 ", "%-6x",
-__LINE__, 0xfffb020f, "FFFB020F", "%+.2X",
-__LINE__, -0xe68619f, "-241721759", "%#1.6ld",
-__LINE__, 0x180166cd, "402745037", "%3.7ld",
-__LINE__, -0x0000001, "-1", "%+00d",
-__LINE__, 0xfdbc3611, "fdbc3611", "%x",
-__LINE__, -0x000005b, "-91", "%d",
-__LINE__, 0xffffe77f, "ffffe77f", "%x",
-__LINE__, -0x0000019, "-25", "%ld",
-__LINE__, 0x00000016, "22", "%#d",
-__LINE__, -0x0000025, "-37", "%ld",
-__LINE__, 0xffffe43f, "ffffe43f", "%x",
-__LINE__, 0x000050a5, "00050a5", "%.7x",
-__LINE__, 0x0000000c, " 12", "% 5.ld",
-__LINE__, -0x001faff, "-129791", "%4d",
-__LINE__, 0x239d7cf2, "597523698", "%0.7ld",
-__LINE__, 0x04092183, "4092183", "% 7X",
-__LINE__, -0x0043498, "-275608", "%-ld",
-__LINE__, -0x0018dbe, "-101822", "%d",
-__LINE__, 0xff3e09c3, "FF3E09C3", "%X",
-__LINE__, 0x00000000, "0", "%d",
-__LINE__, -0x15d57558, "-366310744", "%+0.7ld",
-__LINE__, 0x0004fb06, "326406", "%0.0d",
-__LINE__, 0x00000119, "0X119", "%#X",
-__LINE__, -0x14c53e19, "-348470809", "%d",
-__LINE__, 0x00000019, "0000019", "% .7X",
-__LINE__, -0x0000654, "-1620", "%0.4ld",
-__LINE__, -0xde5899b, "-233146779", "%#.1d",
-__LINE__, 0x0013c1f0, "1294832", "%4.ld",
-__LINE__, 0x0a9fe761, "A9FE761", "%X",
-__LINE__, -0x00000e5, "-229", "%1ld",
-__LINE__, 0x00000161, "000353", "%.6ld",
-__LINE__, 0x6b04e4bd, "0x6b04e4bd", "%#7.0x",
-__LINE__, -0x0000ef0, "-3824 ", "%-6.ld",
-__LINE__, -0x026306e, "-2502766", "%ld",
-__LINE__, 0x00000000, "0", "%-X",
-__LINE__, 0xfffffe1f, "fffffe1f", "%-x",
-__LINE__, 0x0003aecf, " 241359", "% 2.1ld",
-__LINE__, -0x0000014, "-20", "%d",
-__LINE__, 0x00000002, "0002", "%-.4ld",
-__LINE__, 0xfffff662, "0XFFFFF662", "% #.6X",
-__LINE__, 0x00000006, "6", "%0x",
-__LINE__, 0x0001f4c4, " 128196", "% 0d",
-__LINE__, 0xffffffff, "FFFFFFFF", "%5X",
-__LINE__, 0x05605e38, "90201656", "%ld",
-__LINE__, 0xffffffde, "0XFFFFFFDE", "% #X",
-__LINE__, 0x000001e0, " 1e0", "%7.x",
-__LINE__, 0x00000007, "7", "%X",
-__LINE__, 0x00000001, "+1", "%+d",
-__LINE__, 0xffffffe0, "FFFFFFE0", "% X",
-__LINE__, 0xffd7f77a, "FFD7F77A", "%+00.1X",
-__LINE__, 0xfffffffe, "0xfffffffe", "%-#x",
-__LINE__, 0x01b0a63b, "1b0a63b", "%x",
-__LINE__, -0x06554b7, "-6640823", "%d",
-__LINE__, 0xfffffff8, "fffffff8", "%x",
-__LINE__, 0x00000b2d, "b2d", "%x",
-__LINE__, -0x2664ba2, "-40258466", "%-d",
-__LINE__, 0xfffffffe, "FFFFFFFE", "%X",
-__LINE__, -0x0000552, " -1362", "%6.2ld",
-__LINE__, 0x00000009, " 00009", "%6.5x",
-__LINE__, 0x00035c72, "220274", "%05.ld",
-__LINE__, -0x014d09d, "-1364125", "%d",
-__LINE__, -0x0000002, " -2", "% 4d",
-__LINE__, 0x00000001, "1", "%+X",
-__LINE__, 0x00000028, "28", "%X",
-__LINE__, 0xf25c9eb2, "F25C9EB2", "%7.X",
-__LINE__, -0x7ae4b62, "-128863074", "%d",
-__LINE__, 0x00630d87, "630D87", "%2X",
-__LINE__, 0x000000f8, "F8", "%-X",
-__LINE__, 0xfffffff9, "FFFFFFF9", "%X",
-__LINE__, -0x0000007, "-7", "%0d",
-__LINE__, -0x2518fcd, "-38899661", "% 3ld",
-__LINE__, 0xfffff4b4, "FFFFF4B4", "%-5X",
-__LINE__, 0x01cc36c8, "30160584", "%ld",
-__LINE__, 0xffffffff, "ffffffff", "%-x",
-__LINE__, 0x0000000b, " 11", "%6.ld",
-__LINE__, 0x00010d55, " 68949", "% d",
-__LINE__, -0x0c01306, "-12587782", "% 6.1ld",
-__LINE__, 0x001719d7, "1513943", "%.1ld",
-__LINE__, -0x0000002, " -2", "%+3.ld",
-__LINE__, 0x0000018e, "398", "%d",
-__LINE__, 0x000000a6, "0xa6", "%-#3x",
-__LINE__, 0x00006f66, " 28518", "% #d",
-__LINE__, 0x0000032a, "32A", "%X",
-__LINE__, -0x0000145, "-325", "%0d",
-__LINE__, 0xffffffff, "ffffffff", "%2.x",
-__LINE__, 0x00287171, "2650481", "%ld",
-__LINE__, 0x0000004b, "+75", "%+02.ld",
-__LINE__, 0xfffffff8, "fffffff8", "%-0x",
-__LINE__, 0x00000064, "64", "% X",
-__LINE__, 0xfffffca2, "fffffca2", "%0x",
-__LINE__, 0x000010b6, "10b6", "% .0x",
-__LINE__, -0x003806f, "-229487", "%7d",
-__LINE__, -0x00000b7, "-183", "%3ld",
-__LINE__, 0xffffe5ba, "FFFFE5BA", "%0X",
-__LINE__, 0x001f0da8, "1f0da8", "%+x",
-__LINE__, 0x000ce185, "844165", "%0ld",
-__LINE__, 0x00000c96, "3222", "%0d",
-__LINE__, -0x0013099, "-77977", "%1.ld",
-__LINE__, -0x5f3c47a, "-99861626", "%.6ld",
-__LINE__, 0x00000cbf, " CBF", "%+5.X",
-__LINE__, -0x0000001, "-1", "%+ld",
-__LINE__, 0x0d793bc3, "d793bc3", "%6.x",
-__LINE__, 0xfffffffd, "0xfffffffd", "%+#x",
-__LINE__, -0x0000070, " -112", "%6.d",
-__LINE__, 0xfffffb3f, "FFFFFB3F", "%.7X",
-__LINE__, 0x037dfc78, "0X37DFC78", "%#X",
-__LINE__, 0x00009ba5, "39845", "%3ld",
-__LINE__, 0x0000004a, "4a", "%0x",
-__LINE__, 0xffffff81, "ffffff81", "%5.5x",
-__LINE__, -0x86ef222, "-141488674", "%ld",
-__LINE__, -0xac5531e, "-180704030", "% 4ld",
-__LINE__, 0x00002493, "2493", "%+X",
-__LINE__, 0xffffffff, "FFFFFFFF", "%1.3X",
-__LINE__, 0x0005c875, "378997", "%.0ld",
-__LINE__, 0x0301d345, "50451269", "%d",
-__LINE__, 0xfff6b589, "fff6b589", "%2.4x",
-__LINE__, -0x00001db, "-475 ", "%-7.0d",
-__LINE__, 0x0000d1e7, "0x000d1e7", "%#2.7x",
-__LINE__, 0xf4c4d2bb, "f4c4d2bb", "%.6x",
-__LINE__, 0x00c89f54, "13147988", "%ld",
-__LINE__, -0x6599253c, "-1704535356", "%+ld",
-__LINE__, 0xab7d61ea, "ab7d61ea", "% x",
-__LINE__, 0x00000006, "6", "%1ld",
-__LINE__, 0xffff5ab7, "ffff5ab7", "%0x",
-__LINE__, -0x1cfeca5b, "-486459995", "%#ld",
-__LINE__, 0x000000f3, " f3", "% 6.x",
-__LINE__, -0x0000021, "-33", "%d",
-__LINE__, 0xfe7246ac, "fe7246ac", "%-5.x",
-__LINE__, 0x00000017, "00017", "%-.5X",
-__LINE__, -0x0cc250a, "-13378826", "%0.0d",
-__LINE__, -0x00010ae, "-04270", "%#.5ld",
-__LINE__, -0x7952c8b, "-127216779", "% ld",
-__LINE__, 0x0002a53e, "173374", "%4.0d",
-__LINE__, 0x03801bbf, "3801BBF", "%0X",
-__LINE__, 0x0368645f, "+57173087", "%+#0.6ld",
-__LINE__, 0x0000002f, "47", "%d",
-__LINE__, 0x00000003, "3", "%x",
-__LINE__, 0x000005f7, "5F7", "%0X",
-__LINE__, -0x06e5e76, "-7233142", "% 0.1ld",
-__LINE__, 0x053da936, "53da936", "%1.4x",
-__LINE__, -0x0df0c2f, "-14617647", "%.5ld",
-__LINE__, 0xfffffffd, "FFFFFFFD", "%-0X",
-__LINE__, 0x000104bf, "104BF", "%X",
-__LINE__, 0x000353fc, "353FC", "%X",
-__LINE__, 0x182a18dc, "+405412060", "%+ld",
-__LINE__, 0x0000000e, " 14", "% 2d",
-__LINE__, -0x0000091, "-145", "%+ld",
-__LINE__, 0x0029a9d6, "2730454", "%d",
-__LINE__, 0x00009d57, "009d57", "% .6x",
-__LINE__, 0x4c4d4f79, "1280135033", "%5.ld",
-__LINE__, -0x000075b, "-1883", "% 03d",
-__LINE__, -0x001b718, "-112408", "%+d",
-__LINE__, 0xfffaaf57, "FFFAAF57", "%+1X",
-__LINE__, 0x00f44e52, "F44E52", "% 4X",
-__LINE__, 0x00000002, "0X2", "%#X",
-__LINE__, 0x000a85e9, "A85E9", "%+0X",
-__LINE__, 0xffff70bb, "ffff70bb", "%6x",
-__LINE__, 0x00004e15, "4e15", "%x",
-__LINE__, 0x000eeb60, " 977760", "% ld",
-__LINE__, 0xfffffff1, "fffffff1", "%0x",
-__LINE__, -0x294d7e2, "-43309026", "% 02.d",
-__LINE__, 0x0001aaeb, "0109291", "%02.7ld",
-__LINE__, 0x000a01fc, "0xa01fc", "%-#.5x",
-__LINE__, 0x002c3c30, "+2898992", "%+#d",
-__LINE__, 0x015667ae, "+22439854", "%+5ld",
-__LINE__, -0x05af42b, "-5960747", "%+d",
-__LINE__, 0x0000be36, "be36", "%+2x",
-__LINE__, 0x005e3f67, "5e3f67", "% x",
-__LINE__, -0x0000020, "-32", "% ld",
-__LINE__, -0x0003617, "-13847", "% d",
-__LINE__, 0x00000014, "14 ", "%-4.X",
-__LINE__, 0x00000001, "001", "%0.3d",
-__LINE__, 0xfffffea9, "fffffea9", "%3.x",
-__LINE__, 0xe447099e, "E447099E", "%0X",
-__LINE__, 0x00049c71, "302193", "%d",
-__LINE__, 0x76356ed3, "0x76356ed3", "%#4.1x",
-__LINE__, 0x00000005, " 0X5", "%#5X",
-__LINE__, 0x00004da2, "0x004da2", "%#1.6x",
-__LINE__, 0xffdfb36c, "FFDFB36C", "%4X",
-__LINE__, 0xffffe3c5, "FFFFE3C5", "%+4.X",
-__LINE__, 0x00000006, "6", "%0x",
-__LINE__, -0x914ff17, "-152370967", "% .5ld",
-__LINE__, -0x0000002, "-2", "%0ld",
-__LINE__, 0xffffff36, "FFFFFF36", "% 2X",
-__LINE__, -0x0bb1598, "-12260760", "%-ld",
-__LINE__, 0x00006db5, "28085", "%0.5ld",
-__LINE__, 0xffffffff, "ffffffff", "%x",
-__LINE__, -0x0000001, "-1", "%0ld",
-__LINE__, 0x0fa37e79, "FA37E79", "%1.X",
-__LINE__, -0x00000ac, "-172", "%.2d",
-__LINE__, 0xffffffd8, "ffffffd8", "%.7x",
-__LINE__, -0x000a513, "-42259", "%ld",
-__LINE__, 0x00001294, "4756", "%2ld",
-__LINE__, -0x56bae0b4, "-1455087796", "%.1ld",
-__LINE__, 0x3b26d5fa, "3b26d5fa", "%x",
-__LINE__, 0xff657013, "ff657013", "%x",
-__LINE__, -0x00005f5, "-1525", "%0.0ld",
-__LINE__, -0x0000001, " -1", "% 7d",
-__LINE__, -0x02396b2, "-2332338", "%d",
-__LINE__, -0x0000003, "-000003", "%+7.6d",
-__LINE__, 0xfd3ec7c1, "fd3ec7c1", "% 3.4x",
-__LINE__, -0x076e338, "-7791416", "%0.d",
-__LINE__, -0x000015e, "-350", "%3ld",
-__LINE__, 0x0a0f0b71, "a0f0b71", "%x",
-__LINE__, 0xfffe00ba, "FFFE00BA", "%X",
-__LINE__, 0x00036bd8, " 36bd8", "% 06.x",
-__LINE__, 0xfffff2df, "0XFFFFF2DF", "%#2.6X",
-__LINE__, 0x004687fb, "4622331", "%ld",
-__LINE__, -0x0000331, " -817", "%+6.d",
-__LINE__, 0xfcd5b090, "fcd5b090", "%+0x",
-__LINE__, 0x0334f94c, "334F94C", "%.6X",
-__LINE__, 0x00000bce, "3022", "%.3ld",
-__LINE__, 0xf28d9ddd, "f28d9ddd", "%x",
-__LINE__, 0x00003a79, " 14969", "% ld",
-__LINE__, 0xfffffffe, "FFFFFFFE", "%.7X",
-__LINE__, 0x0043d7fe, "43D7FE", "%X",
-__LINE__, -0x0000b82, "-2946", "%-ld",
-__LINE__, -0x00e29d8, "-928216", "%d",
-__LINE__, 0xffffffec, "ffffffec", "%-x",
-__LINE__, 0x0aeaf557, "0xaeaf557", "%-#x",
-__LINE__, 0x00c07fe6, "C07FE6", "%X",
-__LINE__, 0x307414d8, "307414d8", "% 0x",
-__LINE__, -0x045ef67, "-4583271", "%d",
-__LINE__, 0x0000024a, " 0000586", "% .7d",
-__LINE__, 0xfffffc42, "fffffc42", "%x",
-__LINE__, 0xfc38c249, "fc38c249", "%5.x",
-__LINE__, -0x000d096, "-53398", "%-d",
-__LINE__, -0x213a345, "-34841413", "%ld",
-__LINE__, -0x0000130, "-304", "%ld",
-__LINE__, -0x000efd1, "-61393", "%ld",
-__LINE__, 0xfffff867, "FFFFF867", "%2X",
-__LINE__, 0x00113ed0, "0x113ed0", "%-#7x",
-__LINE__, 0x00000677, " 1655", "% 3.ld",
-__LINE__, 0x0000002f, "2f", "%x",
-__LINE__, 0xfffffd38, "fffffd38", "%-4x",
-__LINE__, -0x000b3cc, "-46028", "%1.2d",
-__LINE__, 0x45da719b, "45DA719B", "%+0X",
-__LINE__, -0x000a454, " -42068", "%7.3ld",
-__LINE__, 0x01cc7c30, " 30178352", "% d",
-__LINE__, -0x05ae80e, "-5957646", "%#.4ld",
-__LINE__, 0x000000b9, "185", "%d",
-__LINE__, 0x003fcaf4, "4180724", "%1.ld",
-__LINE__, 0x02da1b74, "2DA1B74", "%X",
-__LINE__, 0xffffffd9, "FFFFFFD9", "%X",
-__LINE__, 0x00064359, "64359 ", "%-6X",
-__LINE__, 0x000000f0, "240", "%ld",
-__LINE__, -0x01715e5, "-1512933", "%ld",
-__LINE__, 0xc8f6e118, "0XC8F6E118", "%#X",
-__LINE__, 0xfffffd8f, "FFFFFD8F", "%X",
-__LINE__, 0x0000176d, "5997 ", "%-6d",
-__LINE__, 0x00003cab, "0x3cab", "%#0.3x",
-__LINE__, 0x00000001, " 1", "% d",
-__LINE__, 0xfffff610, "0XFFFFF610", "%#X",
-__LINE__, 0xfffffffe, "FFFFFFFE", "%5.7X",
-__LINE__, 0x00000001, "1", "%0x",
-__LINE__, 0x00000001, "00001", "%.5ld",
-__LINE__, -0x0000d51, "-3409", "%d",
-__LINE__, -0x08639ee, "-8796654", "%ld",
-__LINE__, 0x00003121, "12577", "%#1.2ld",
-__LINE__, 0x0000004e, "78", "%d",
-__LINE__, 0xfffff64f, "fffff64f", "%-x",
-__LINE__, 0x0000002a, "2a", "%0x",
-__LINE__, 0x00000020, "20", "%x",
-__LINE__, -0x00000b8, "-184", "%#ld",
-__LINE__, 0x0000000a, "10", "%-#d",
-__LINE__, 0x00000364, "868", "%.1ld",
-__LINE__, 0x00d1f9b6, "D1F9B6", "%0.X",
-__LINE__, 0x008cfda1, "8CFDA1", "% 6.X",
-__LINE__, 0xffd58cce, "FFD58CCE", "%X",
-__LINE__, 0x00000008, "0000008", "%6.7ld",
-__LINE__, 0x00000318, " 318", "%4X",
-__LINE__, 0x000172d8, "94936", "%2ld",
-__LINE__, -0x056ccbf, "-5688511", "%ld",
-__LINE__, 0x000000c7, "+000199", "%+0.6d",
-__LINE__, 0x00000002, "0X2", "%-#X",
-__LINE__, 0xfffff634, "FFFFF634", "%.1X",
-__LINE__, -0x00001f3, "-499", "%-ld",
-__LINE__, -0x000081b, "-2075", "%-d",
-__LINE__, 0x000000b5, "181", "%0d",
-__LINE__, 0xfe961ee8, "fe961ee8", "%0x",
-__LINE__, 0x000028a2, "10402", "%d",
-__LINE__, 0xffffffff, "FFFFFFFF", "%.4X",
-__LINE__, -0x000058a, "-1418", "%.3ld",
-__LINE__, 0x00001ceb, "1CEB", "%X",
-__LINE__, 0x00000021, "21", "% X",
-__LINE__, 0x00000002, "2", "%0d",
-__LINE__, -0x2f9bbf5, "-49921013", "%.4ld",
-__LINE__, 0x00000e91, "03729", "%#.5ld",
-__LINE__, 0xf1116740, "f1116740", "%2x",
-__LINE__, 0x00014f72, "14F72", "%X",
-__LINE__, 0xfffffced, "FFFFFCED", "%X",
-__LINE__, 0xffffffff, "ffffffff", "%.5x",
-__LINE__, 0x0017cf0c, " 1560332", "% 0ld",
-__LINE__, 0x0000000a, "A", "% X",
-__LINE__, 0xff3a39d4, "ff3a39d4", "%x",
-__LINE__, 0xfffef05f, "FFFEF05F", "%X",
-__LINE__, 0xfedfe708, "fedfe708", "%03.0x",
-__LINE__, 0x000345a0, "345A0", "% X",
-__LINE__, -0x1ed5b6f7, "-517322487", "%d",
-__LINE__, 0xd2d56c22, "D2D56C22", "%0.X",
-__LINE__, 0x00002cbf, "2CBF", "%.2X",
-__LINE__, 0x00000db4, "db4", "%3x",
-__LINE__, -0x000b154, "-45396", "%d",
-__LINE__, 0x002bf4c7, "2BF4C7", "%X",
-__LINE__, 0x6954abf4, "+1767156724", "%+d",
-__LINE__, 0xfffffffb, "fffffffb", "%x",
-__LINE__, -0x29e0050e, "-702547214", "%-0ld",
-__LINE__, -0x0014989, "-84361", "%-#0.3ld",
-__LINE__, 0x001a557c, "+1725820", "%+6.5d",
-__LINE__, -0x56689a81, "-1449695873", "%.2d",
-__LINE__, 0x00000016, " 16", "%05.X",
-__LINE__, 0x0001da1e, " 121374", "% d",
-__LINE__, -0x04deac7, "-5106375", "%03.4d",
-__LINE__, 0x000012b1, "4785", "%d",
-__LINE__, 0x0009a116, "9a116", "%-x",
-__LINE__, -0x0000003, "-000003", "%4.6ld",
-__LINE__, 0x00000000, "", "%.0x",
-__LINE__, 0x0000000a, " A", "% 3X",
-__LINE__, 0xfffffff0, "0xfffffff0", "%-#0.1x",
-__LINE__, 0x00000086, "86", "%0X",
-__LINE__, 0x0000001f, "31", "%-d",
-__LINE__, 0x0386f706, "59176710", "%3.6ld",
-__LINE__, 0xffe437ae, "0XFFE437AE", "%#X",
-__LINE__, 0x0e5405c6, "e5405c6", "%-x",
-__LINE__, 0xfffdee46, "FFFDEE46", "%+X",
-__LINE__, 0xff861e9d, "FF861E9D", "%5.X",
-__LINE__, 0xfffff570, "FFFFF570", "%-X",
-__LINE__, 0x045c90bd, "45c90bd", "%0x",
-__LINE__, 0x000000aa, "AA", "%+X",
-__LINE__, -0x747262e, "-122103342", "%0ld",
-__LINE__, 0xffffad89, "FFFFAD89", "%X",
-__LINE__, 0x00000018, "18", "%0.2X",
-__LINE__, 0x00057a2d, " 358957", "% #7.d",
-__LINE__, 0x73a0e21d, "1939923485", "%ld",
-__LINE__, -0x00021e1, "-8673", "%0d",
-__LINE__, 0x000000e9, " 233", "% 06.3ld",
-__LINE__, 0xffffcc0d, "ffffcc0d", "%x",
-__LINE__, 0x00000052, "52", "%x",
-__LINE__, 0x01c155af, "1C155AF", "%.5X",
-__LINE__, 0xffffffff, "ffffffff", "%0.x",
-__LINE__, -0x00400a4, "-262308", "%-d",
-__LINE__, -0x0000001, "-0000001", "%#.7ld",
-__LINE__, 0x01fb9c99, "1fb9c99", "% 03.5x",
-__LINE__, 0xffffffff, "ffffffff", "%6.x",
-__LINE__, 0xff5e5eea, "FF5E5EEA", "%X",
-__LINE__, 0x0000000f, "F", "%+0X",
-__LINE__, 0xfffffe3a, "fffffe3a", "% x",
-__LINE__, 0xfffffffe, "FFFFFFFE", "%-X",
-__LINE__, -0x0000007, "-7", "%0ld",
-__LINE__, -0x002f635, "-194101", "%d",
-__LINE__, -0x0000005, "-5", "%ld",
-__LINE__, -0x0000059, "-89", "%0ld",
-__LINE__, -0x1ccda96, "-30202518", "%d",
-__LINE__, -0x0000002, "-2", "%-d",
-__LINE__, 0xffffffda, "0XFFFFFFDA", "%#X",
-__LINE__, 0x00036cc5, "224453", "%#d",
-__LINE__, 0x00000010, "+16", "%+ld",
-__LINE__, 0x0b6039c7, "190855623", "%d",
-__LINE__, -0x0000002, "-002", "%#.3d",
-__LINE__, 0xfff3e746, "FFF3E746", "%-4X",
-__LINE__, 0x0361b3de, "361B3DE", "% 04X",
-__LINE__, 0xffffe6a2, "ffffe6a2", "%-x",
-__LINE__, 0x00032790, "0x0032790", "%#7.7x",
-__LINE__, 0xffe33b4e, "ffe33b4e", "%-0x",
-__LINE__, -0x0094663, "-607843", "%.3ld",
-__LINE__, -0x00a3efa, "-671482", "%4d",
-__LINE__, 0x000000e6, " 00E6", "%7.4X",
-__LINE__, 0x000125cb, "125CB", "%+X",
-__LINE__, 0x0000b97e, "b97e", "%x",
-__LINE__, -0x0000039, "-57", "%+ld",
-__LINE__, 0xffffe39a, "ffffe39a", "%5.4x",
-__LINE__, 0xffffffff, "ffffffff", "%6.1x",
-__LINE__, -0xdee910c, "-233738508", "%-#2d",
-__LINE__, -0x14044930, "-335825200", "%6.ld",
-__LINE__, 0x00a81259, "a81259", "%x",
-__LINE__, 0x020e74c6, "20E74C6", "%X",
-__LINE__, -0x00000fb, "-251", "%01.d",
-__LINE__, 0x034ceb45, "34CEB45", "%5.X",
-__LINE__, 0xfeacb66a, "feacb66a", "% x",
-__LINE__, 0x00003eb6, "3EB6", "% X",
-__LINE__, 0x000009ef, "9ef", "% x",
-__LINE__, 0xf9d9dd07, "F9D9DD07", "%0X",
-#ifndef __PCCNECV70__
-
-__LINE__, 0x000154d7, "087255", "%.6ld",
-__LINE__, -0x000036e, "-878", "%-ld",
-__LINE__, -0x0007dcc, "-32204", "% d",
-__LINE__, 0x000019dc, "6620", "%d",
-__LINE__, 0xffffff6e, "FFFFFF6E", "%2X",
-__LINE__, 0x00000016, "0x16", "%-#x",
-__LINE__, 0xffdb3e96, "ffdb3e96", "%+.5x",
-__LINE__, 0xffffffef, "FFFFFFEF", "% 04.X",
-__LINE__, 0xffffffff, "FFFFFFFF", "%5X",
-__LINE__, 0x000c08cd, "C08CD", "%-X",
-__LINE__, 0x18de71ee, "18de71ee", "%x",
-__LINE__, 0xffffffff, "ffffffff", "% x",
-__LINE__, -0x00025bd, "-009661", "%#.6d",
-__LINE__, 0x2f05de14, " 788913684", "% 6.4ld",
-__LINE__, 0x0c99cf86, "211406726", "%.5d",
-__LINE__, 0x09e6a21d, " 166109725", "% 0d",
-__LINE__, -0x013da65, "-1301093", "%+ld",
-__LINE__, 0x000003d0, " 976", "% 4.2d",
-__LINE__, -0xef9e3cc, "-251257804", "%-7.0d",
-__LINE__, 0x0000000c, "+12", "%+00ld",
-__LINE__, 0xffffffe2, "ffffffe2", "%x",
-__LINE__, 0x000000fe, "fe", "%-x",
-__LINE__, 0xfffffc5f, "fffffc5f", "%x",
-__LINE__, -0x0005c55, "-23637", "%d",
-__LINE__, -0x0111ff2, "-1122290", "% 7.d",
-__LINE__, -0x1a1746e5, "-437733093", "%.4ld",
-__LINE__, 0x00001007, "004103", "%00.6d",
-__LINE__, 0xffffffe1, "ffffffe1", "%x",
-__LINE__, 0x0000d80f, "55311", "%d",
-__LINE__, 0x00000004, "4", "%+X",
-__LINE__, 0xfffffffd, "fffffffd", "%6x",
-__LINE__, -0x2afbcc3c, "-721144892", "%4.6ld",
-__LINE__, 0x00377f96, "377F96", "%6.X",
-__LINE__, 0xffffffc8, "FFFFFFC8", "%0X",
-__LINE__, 0x007ed9d1, "8313297", "%-3d",
-__LINE__, 0x00000000, "0", "%-X",
-__LINE__, 0x001e122d, "1970733", "%01.d",
-__LINE__, -0x000029b, "-667", "%ld",
-__LINE__, -0x002f563, "-193891", "% 2.5d",
-__LINE__, 0xfffffffe, "fffffffe", "%+3.7x",
-__LINE__, 0xfff7658c, "fff7658c", "%x",
-__LINE__, -0x0006d08, "-0027912", "%7.7ld",
-__LINE__, 0x00000080, "80", "%X",
-__LINE__, 0x0000078f, " 1935", "% 6ld",
-__LINE__, 0xfffffffb, "FFFFFFFB", "% X",
-__LINE__, 0x000000ae, " AE", "%7.X",
-__LINE__, -0x000d6aa, "-54954", "%-ld",
-__LINE__, 0xfffffffe, "FFFFFFFE", "%6.X",
-__LINE__, 0x000003bf, "+959", "%+d",
-__LINE__, -0x7242d04b, "-1916981323", "% ld",
-__LINE__, 0xf0e6546f, "F0E6546F", "% .7X",
-__LINE__, 0x047e196a, "75372906", "%ld",
-__LINE__, 0x0240174e, "240174E", "%+0X",
-__LINE__, -0x0000006, "-006", "%.3ld",
-__LINE__, 0x00068aac, "428716", "%#ld",
-__LINE__, 0xffffffa1, "ffffffa1", "%0x",
-__LINE__, 0x000adab3, "adab3", "%x",
-__LINE__, -0x00000ae, "-0000174", "%7.7ld",
-__LINE__, 0x0f0a8f4b, "f0a8f4b", "% x",
-__LINE__, 0xfee229bc, "fee229bc", "%x",
-__LINE__, -0x275b8455, "-660309077", "%.2ld",
-__LINE__, -0xca4b2a5, "-212120229", "%d",
-__LINE__, 0x000000b5, " 181", "%04.d",
-__LINE__, 0xfff213f2, "FFF213F2", "%X",
-__LINE__, 0x00000003, "3", "%-X",
-__LINE__, 0x0ebb978b, "247175051", "%.6ld",
-__LINE__, 0xffffffca, "FFFFFFCA", "%X",
-__LINE__, -0x0000003, "-03", "%+0.2d",
-__LINE__, -0x178ff86, "-24706950", "%+d",
-__LINE__, 0x0000003c, " 60", "%7.ld",
-__LINE__, -0x001012d, "-65837", "%.5d",
-__LINE__, 0x03673fd2, "3673fd2", "%.5x",
-__LINE__, -0x001fe74, "-130676", "%#0.6ld",
-__LINE__, 0x004f6226, "4f6226", "%-0x",
-__LINE__, 0xfffffa0f, "fffffa0f", "%7x",
-__LINE__, 0xfffffff8, "fffffff8", "%-.6x",
-__LINE__, -0x0000001, "-1", "%#d",
-__LINE__, 0xffffe43d, "ffffe43d", "%7x",
-__LINE__, 0x00009d47, "0040263", "%7.7ld",
-__LINE__, 0xff0fc79f, "FF0FC79F", "%-4.X",
-__LINE__, 0x2d610907, "2d610907", "%x",
-__LINE__, -0x00002de, "-734", "%04d",
-__LINE__, 0x0000036b, " 36B", "%7.1X",
-__LINE__, 0x00000002, "2", "%.0x",
-__LINE__, -0x1f577b3e, "-525826878", "%d",
-__LINE__, 0x0000002d, "45", "%#ld",
-__LINE__, 0xfffffffb, "fffffffb", "%x",
-__LINE__, -0x0000004, "-4", "%-.0d",
-__LINE__, 0x00016ba4, "16ba4", "%x",
-__LINE__, -0x1ad853d5, "-450384853", "% 0ld",
-__LINE__, 0x00366899, "366899", "%2.x",
-__LINE__, 0x1659158b, "1659158B", "%X",
-__LINE__, 0x000076c7, "76c7", "%x",
-__LINE__, 0x00000674, "674", "%0x",
-__LINE__, 0x016c9d8a, "+23895434", "%+ld",
-__LINE__, 0xfffffc43, "FFFFFC43", "%0X",
-__LINE__, 0xfff249d2, "fff249d2", "%-2.x",
-__LINE__, 0xffffffdd, "ffffffdd", "%5x",
-__LINE__, 0xffffa7ef, "FFFFA7EF", "%0.3X",
-__LINE__, 0x030d4d06, "30d4d06", "%x",
-__LINE__, -0x0e4694b, "-14969163", "%d",
-__LINE__, 0x00000078, "120", "%.3ld",
-__LINE__, -0x16c1273e, "-381757246", "%0d",
-__LINE__, 0xffffd183, "FFFFD183", "% 0X",
-__LINE__, -0x2dfdadd, "-48224989", "%ld",
-__LINE__, -0x5767fe5c, "-1466433116", "%ld",
-__LINE__, 0x01bea036, "29270070", "%#4.3d",
-__LINE__, 0x00000027, "27", "%-x",
-__LINE__, 0x0004d183, "4D183", "%X",
-__LINE__, 0xffdaf9c8, "FFDAF9C8", "%.7X",
-__LINE__, 0xfffffd95, "fffffd95", "%x",
-__LINE__, -0x0059acb, "-367307", "%00.d",
-__LINE__, 0x017d8db4, "17d8db4", "% 05.x",
-__LINE__, 0x0001f084, "001F084", "%5.7X",
-__LINE__, 0x00000006, " 6", "% ld",
-__LINE__, 0x011b0802, "18548738", "%.3ld",
-__LINE__, 0x00000006, " 6", "%#3.d",
-__LINE__, 0xffffffff, "ffffffff", "%6x",
-__LINE__, 0x00000001, "1", "% x",
-__LINE__, 0x00000750, " 01872", "% .5d",
-__LINE__, 0xfffffff9, "fffffff9", "%x",
-__LINE__, -0x00f842c, "-1016876", "%+d",
-__LINE__, -0x001dcf0, "-122096", "%-0d",
-__LINE__, 0x000000c9, "0XC9", "% #3X",
-__LINE__, 0x1e368e86, "1e368e86", "%7x",
-__LINE__, -0x0001157, "-4439", "% 03.4d",
-__LINE__, 0xfff91e87, "FFF91E87", "%3.5X",
-__LINE__, 0x00000006, "6", "%x",
-__LINE__, 0x00000bca, "3018", "%ld",
-__LINE__, 0x00495ff6, "495ff6", "%01.0x",
-__LINE__, -0x0267f7a, "-2523002", "% #5d",
-__LINE__, 0x00000060, "96", "%-d",
-__LINE__, 0x000850c6, "544966", "%#.1d",
-__LINE__, 0x00231457, "231457", "%-6.4X",
-__LINE__, 0x0000000b, "11", "%-d",
-__LINE__, 0x000003bd, "957", "%#d",
-__LINE__, 0xfd51d970, "FD51D970", "%+.7X",
-__LINE__, 0x000007bf, "1983", "%-ld",
-__LINE__, 0x000034b2, "34B2", "%0.X",
-__LINE__, 0x0000c18d, "C18D", "%0.X",
-__LINE__, 0xffffbb83, "ffffbb83", "% 3x",
-__LINE__, 0x000001d0, "0x1d0", "%#x",
-__LINE__, -0x003c784, "-247684", "%#ld",
-__LINE__, 0x0210cffa, "210CFFA", "%X",
-__LINE__, -0x33093a1, "-53515169", "% 0d",
-__LINE__, 0x00000001, " 1", "% #ld",
-__LINE__, 0xffffaa53, "ffffaa53", "%-4.5x",
-__LINE__, 0x2935c056, "691388502", "%1.d",
-__LINE__, -0x0000001, "-1", "%ld",
-__LINE__, 0x000013d1, "0X013D1", "%+#2.5X",
-__LINE__, -0x000035c, "-860", "%-.2d",
-__LINE__, 0x00000000, " ", "%-4.X",
-__LINE__, -0x0000147, "-327", "%d",
-__LINE__, 0x0a317eb0, "171015856", "%.7d",
-__LINE__, 0x00000003, "3", "%ld",
-__LINE__, 0x000001d6, "1d6", "%-x",
-__LINE__, 0x18185214, "404247060", "%-.2ld",
-__LINE__, 0x00574140, "0574140", "%.7X",
-__LINE__, 0x00002ea5, "02ea5", "%.5x",
-__LINE__, 0x00000005, "5", "% x",
-__LINE__, 0xffc47ed6, "ffc47ed6", "%-x",
-__LINE__, 0x0001f5da, "0X1F5DA", "%#X",
-__LINE__, 0xfffffcc9, "fffffcc9", "% x",
-__LINE__, 0x02586c98, "2586C98", "%X",
-__LINE__, -0x0000036, "-54", "% ld",
-__LINE__, 0x00064b57, "412503", "%1.5d",
-__LINE__, -0x0000007, "-7", "%#0.0ld",
-__LINE__, 0x00023a03, "145923", "%ld",
-__LINE__, -0x0000065, "-101", "%+#d",
-__LINE__, 0x00000208, "208", "%X",
-__LINE__, 0x00e97728, "15300392", "%-ld",
-__LINE__, 0x0000030a, "+778", "%+d",
-__LINE__, 0xf4d7deee, "F4D7DEEE", "%+X",
-__LINE__, -0x000009a, "-154", "%+.3ld",
-__LINE__, 0x000002c0, "+704", "%+ld",
-__LINE__, 0x0067ec23, "67ec23", "%x",
-__LINE__, 0x005ca7fc, "+6072316", "%+d",
-__LINE__, 0xfffff5f1, "fffff5f1", "%x",
-__LINE__, 0x00000601, " 0X601", "%#7.2X",
-__LINE__, -0x0000057, "-87", "% ld",
-__LINE__, -0x0000078, " -120", "%7.d",
-__LINE__, -0x000001f, "-31 ", "%-6d",
-__LINE__, 0x0160c000, "23117824", "%ld",
-__LINE__, -0x0000007, "-7", "%0ld",
-__LINE__, 0xfffffffe, "fffffffe", "%+x",
-__LINE__, 0x5b6ef898, "5b6ef898", "%+0x",
-__LINE__, 0x0009bfb6, "638902", "%d",
-__LINE__, -0x0000145, " -325", "%#6.0d",
-__LINE__, -0x508c048, "-84459592", "%-5.ld",
-__LINE__, 0x00000002, " 0x2", "% #4x",
-__LINE__, 0x0001486e, "84078", "%#d",
-__LINE__, 0x006ac76a, "6997866", "%.6d",
-__LINE__, 0xffffff98, "FFFFFF98", "%X",
-__LINE__, 0xfffffe08, "fffffe08", "%6.x",
-__LINE__, -0x24ef47e, "-38728830", "%1.6ld",
-__LINE__, 0x39d1b2db, "39D1B2DB", "% X",
-__LINE__, 0xfffc9ce2, "0xfffc9ce2", "%#x",
-__LINE__, 0x59485e14, "1497914900", "%#4ld",
-__LINE__, 0x000022eb, "22EB", "%3.X",
-__LINE__, 0xfa410352, "FA410352", "%-X",
-__LINE__, -0x4a342f0, "-77808368", "% ld",
-__LINE__, 0xef5825a4, "EF5825A4", "%.6X",
-__LINE__, 0x01b0185a, "0x1b0185a", "% #x",
-__LINE__, -0x0004290, "-17040", "%.3d",
-__LINE__, -0x10f88659, "-284722777", "%+6.2ld",
-__LINE__, 0x00003216, "12822", "%-d",
-__LINE__, 0x4a31a219, "1244766745", "%d",
-__LINE__, 0xffffffb5, "FFFFFFB5", "%-X",
-__LINE__, 0x0000d586, "D586", "%-2.X",
-__LINE__, 0x00008496, "33942", "%1.d",
-__LINE__, -0x0000011, "-17", "%1ld",
-__LINE__, 0x0000003c, "3C", "%2.X",
-__LINE__, 0xfffffffe, "FFFFFFFE", "%.3X",
-__LINE__, 0x0000152a, "152A", "%X",
-__LINE__, 0xfffe876e, "FFFE876E", "%X",
-__LINE__, -0x0003874, "-14452", "%-ld",
-__LINE__, -0x004918a, "-299402", "%#.6d",
-__LINE__, -0x000000c, "-12", "%-d",
-__LINE__, 0xffffd812, "FFFFD812", "%+X",
-__LINE__, -0x000000c, "-12", "%0d",
-__LINE__, -0x0000229, "-553", "%0d",
-__LINE__, 0x00002ab8, "2AB8", "%4.X",
-__LINE__, 0x0000004b, "+75", "%+ld",
-__LINE__, 0x001c3178, " 1847672", "% ld",
-__LINE__, -0x0000006, "-6", "%.0ld",
-__LINE__, 0x0003be65, "245349", "%ld",
-__LINE__, -0x0000001, "-1", "%#1ld",
-__LINE__, 0x0000007f, "+127", "%+ld",
-__LINE__, 0x0000020e, "526 ", "%-5ld",
-__LINE__, 0x00000002, "2", "%d",
-__LINE__, 0x03bd0873, "0X3BD0873", "%#X",
-__LINE__, 0x00093a52, "604754", "%-2d",
-__LINE__, -0x00823fc, "-0533500", "%+.7ld",
-__LINE__, 0x00000000, " ", "%4.X",
-__LINE__, -0x0000001, "-1", "%ld",
-__LINE__, 0xfff09ede, "fff09ede", "%-x",
-__LINE__, 0x01e28c24, "31624228", "%ld",
-__LINE__, 0x00001dcc, "1DCC", "%X",
-__LINE__, -0x0f0ea0d, "-15788557", "%-00.ld",
-__LINE__, 0xffff73a1, "FFFF73A1", "%X",
-__LINE__, -0x0004040, "-16448", "%+#d",
-__LINE__, 0x0073b158, "0x73b158", "%#7x",
-__LINE__, 0xfffff8ff, "FFFFF8FF", "% 5X",
-__LINE__, -0x0000004, "-4", "%0d",
-__LINE__, 0xffff56a3, "ffff56a3", "%1.6x",
-__LINE__, -0x0000041, "-65", "%0d",
-__LINE__, 0x00000009, "+0000009", "%+2.7d",
-__LINE__, 0xffffe13d, "0XFFFFE13D", "%+#2.X",
-__LINE__, -0x00002ce, "-00718", "%.5ld",
-__LINE__, 0xffc53e28, "ffc53e28", "%03.4x",
-__LINE__, 0x00000005, "0X5", "%#X",
-__LINE__, 0x00000004, "4", "%x",
-__LINE__, 0xe21b35eb, "e21b35eb", "%-x",
-__LINE__, -0x0000098, "-152", "%-ld",
-__LINE__, 0xffffff81, "FFFFFF81", "%2X",
-__LINE__, 0x00000003, "00003", "%.5ld",
-__LINE__, 0xfffffffc, "fffffffc", "%+x",
-__LINE__, 0x000491f5, "299509", "%1.ld",
-__LINE__, 0xf06bfd7d, "F06BFD7D", "%X",
-__LINE__, -0x0000006, "-6", "%0d",
-__LINE__, -0x0a4af7d, "-10792829", "%-0d",
-__LINE__, -0x11a74ef, "-18511087", "%ld",
-__LINE__, 0x2dc95e17, "768171543", "%-1.d",
-__LINE__, -0x0000001, "-1", "%#ld",
-__LINE__, 0x00000033, "51", "%-#d",
-__LINE__, 0x002d0219, "2949657", "%ld",
-__LINE__, 0xfffffffd, "FFFFFFFD", "%2.4X",
-__LINE__, 0x00000f20, "+3872", "%+ld",
-__LINE__, -0x0000047, "-071", "%4.3ld",
-__LINE__, 0x00000010, " 16", "%6d",
-__LINE__, 0x00000000, "0", "%0d",
-__LINE__, 0xffffff57, "FFFFFF57", "%X",
-__LINE__, -0x0000700, "-1792", "%-#d",
-__LINE__, -0x0000064, "-100", "%-ld",
-__LINE__, 0xff26d49a, "FF26D49A", "%-0X",
-__LINE__, -0x0000006, "-6", "%.1ld",
-__LINE__, 0x1391edc5, "1391edc5", "%.1x",
-__LINE__, 0x0000014a, "330", "%-#ld",
-__LINE__, 0x07ecd1e1, "7ecd1e1", "%6x",
-__LINE__, -0xa2b8898, "-170625176", "%3.d",
-__LINE__, 0x00035287, "0x35287", "%#.0x",
-__LINE__, 0x00000000, "00000", "%0.5X",
-__LINE__, -0x0000153, "-339", "%d",
-__LINE__, 0x0000ad6e, " 44398", "% 0.d",
-__LINE__, 0x00000001, "1", "%-X",
-__LINE__, -0x000000d, "-13 ", "%-6.2d",
-__LINE__, -0x01bff8a, "-1834890", "%d",
-__LINE__, 0x000a0fa8, "+659368", "%+ld",
-__LINE__, 0xac044dc0, "ac044dc0", "%.0x",
-__LINE__, 0x0003a729, "239401", "%ld",
-__LINE__, -0x00004f0, "-1264", "%+ld",
-__LINE__, 0x00000000, "0", "%x",
-__LINE__, 0x00000012, "12", "% x",
-__LINE__, 0xffff770b, "ffff770b", "%7.1x",
-__LINE__, 0xd7458572, "d7458572", "%x",
-__LINE__, 0x01f1b4f9, "1f1b4f9", "% 0x",
-__LINE__, 0xfffb2198, "0XFFFB2198", "% #1.X",
-__LINE__, 0x00ef6189, " 15688073", "% ld",
-__LINE__, -0x3f0ae63, "-66104931", "% #d",
-__LINE__, -0x0006075, "-24693", "%ld",
-__LINE__, 0x000000a1, "161", "%d",
-__LINE__, 0xfffffffc, "fffffffc", "%3.2x",
-__LINE__, 0xff6b4125, "FF6B4125", "%+5.X",
-__LINE__, 0x00000001, " 1", "%6.d",
-__LINE__, -0x0000001, "-1", "%+0d",
-__LINE__, -0x000096c, "-2412", "%0.4d",
-__LINE__, 0x00039c6f, "236655", "%.0d",
-__LINE__, 0x3625286c, "908404844", "%.1d",
-__LINE__, 0xfffffffa, "fffffffa", "%x",
-__LINE__, 0x00000000, "0", "%X",
-__LINE__, 0x00c34353, "12796755", "%#.4d",
-__LINE__, 0x000002df, "735", "%ld",
-__LINE__, 0xffff38fa, "FFFF38FA", "%5.1X",
-__LINE__, -0x000002a, "-42", "%0.d",
-__LINE__, 0x0000077e, "1918", "%ld",
-__LINE__, 0x000001f7, "503", "%ld",
-__LINE__, 0x00000004, "4", "%ld",
-__LINE__, 0x0021fb02, "2226946", "%d",
-__LINE__, 0x007c858d, "8160653", "%-0d",
-__LINE__, -0x0000109, "-265", "%.0d",
-__LINE__, 0xfffffffa, "fffffffa", "% x",
-__LINE__, 0x0097932d, "97932d", "%+x",
-__LINE__, 0xfffbbd03, "fffbbd03", "%-.5x",
-__LINE__, -0x0000005, "-5", "%0d",
-__LINE__, 0x03ee3a95, "65944213", "%ld",
-__LINE__, -0x0000002, " -00002", "%7.5d",
-__LINE__, 0xea1a4e54, "EA1A4E54", "%X",
-__LINE__, -0x000a9d6, "-43478", "%+d",
-__LINE__, -0x0fd8d65, "-16616805", "%5ld",
-__LINE__, 0x00000001, "1", "%-d",
-__LINE__, 0x00000072, "72", "%2.X",
-__LINE__, 0xffffff94, "FFFFFF94", "%X",
-__LINE__, 0x00000d2a, "D2A", "%+X",
-__LINE__, 0xffff614f, "ffff614f", "%x",
-__LINE__, -0x0000018, "-24", "%ld",
-__LINE__, 0x0000003b, "059", "%2.3d",
-__LINE__, 0x0000001a, "1A", "%0X",
-__LINE__, -0x0000109, "-265", "%02ld",
-__LINE__, 0x00000f9d, "3997", "%#1d",
-__LINE__, 0x0000001b, "1b", "%x",
-__LINE__, 0xffffff07, "ffffff07", "%x",
-__LINE__, 0xfff1a425, "0xfff1a425", "%#x",
-__LINE__, 0x00000005, "5", "%-1d",
-__LINE__, -0x53a6efd, "-87715581", "%ld",
-__LINE__, 0x042f37db, "42F37DB", "%6.X",
-__LINE__, 0x00053bd5, "+342997", "%+5ld",
-__LINE__, 0xffffffff, "ffffffff", "% x",
-__LINE__, 0xffffffef, "FFFFFFEF", "%6.X",
-__LINE__, -0x10ec29a, "-17744538", "%+2.d",
-__LINE__, 0x01dcc901, "1dcc901", "%x",
-__LINE__, 0x0007dc68, "515176", "%-3.d",
-__LINE__, -0x0000062, "-0098", "%#2.4d",
-__LINE__, 0x00000000, " ", "%3.0X",
-__LINE__, -0x00000de, "-222", "%ld",
-__LINE__, 0x000c1fb8, "C1FB8", "%0X",
-__LINE__, 0x0005bf58, "5BF58", "%X",
-__LINE__, -0x000dd1b, "-56603", "%-03.1d",
-__LINE__, 0x00000b14, "B14", "%+3.X",
-__LINE__, 0x00000799, "799", "%-x",
-__LINE__, 0xfffffffa, "fffffffa", "%x",
-__LINE__, 0x00000003, "0x00003", "% #7.5x",
-__LINE__, -0x002b9f1, "-178673", "%+d",
-__LINE__, -0x001b817, "-112663", "%0d",
-__LINE__, 0xf6f98533, "f6f98533", "%.1x",
-__LINE__, 0x00338ffc, "3379196", "%d",
-__LINE__, 0x0409e9b5, "0X409E9B5", "%#X",
-__LINE__, 0x00b8e98e, " 12118414", "% 0d",
-__LINE__, -0x002a8f6, "-174326", "%ld",
-__LINE__, 0x13bb9722, "331061026", "%0d",
-__LINE__, 0x00063c71, "63c71", "%x",
-__LINE__, 0xfffffe37, "FFFFFE37", "%.1X",
-__LINE__, 0xffff7b3e, "ffff7b3e", "%+.1x",
-__LINE__, 0x005eeab1, "5eeab1", "%+x",
-__LINE__, 0xffc69e99, "ffc69e99", "%x",
-__LINE__, -0x000005c, " -92", "%5ld",
-__LINE__, 0x07d8fa8a, "7d8fa8a", "%x",
-__LINE__, 0x00030e0a, "200202", "%-4.1d",
-__LINE__, 0x00001dc1, "1DC1", "%.0X",
-__LINE__, 0x00000008, "8", "%0ld",
-__LINE__, -0x01b5397, "-1790871", "%3.d",
-__LINE__, 0x27fbb4b5, "27fbb4b5", "%x",
-__LINE__, -0xe3fdcfc, "-239066364", "%4ld",
-__LINE__, 0x0008bcb1, "8bcb1", "%0x",
-__LINE__, 0xffff039e, "ffff039e", "%.6x",
-__LINE__, 0x000d0bd4, "d0bd4", "%-x",
-__LINE__, 0x00000000, "+0", "%+d",
-__LINE__, -0x2a49ea4, "-44342948", "%1d",
-__LINE__, -0x0000055, "-85", "%0d",
-__LINE__, -0x0000a05, "-2565", "%3.3ld",
-__LINE__, -0x000000b, "-11 ", "%-4d",
-__LINE__, 0xfff30444, "FFF30444", "%7.X",
-__LINE__, 0x0000003f, "63", "%-0d",
-__LINE__, 0x00046779, "46779", "%X",
-__LINE__, 0x000028d7, " 0X28D7", "%#7.X",
-__LINE__, 0x00000019, " 19", "%5x",
-__LINE__, 0x0032291d, "3287325", "%2.ld",
-__LINE__, 0x00057afa, "57AFA", "%X",
-__LINE__, 0xfffe8c64, "fffe8c64", "%3.4x",
-__LINE__, -0x624110d6, "-1648431318", "%+6d",
-__LINE__, 0x0000001a, " 26", "% 5.d",
-__LINE__, 0xfffffffd, "FFFFFFFD", "%6.X",
-__LINE__, 0x00199490, "1676432", "%-1d",
-__LINE__, -0xfff8265, "-268403301", "%-0ld",
-__LINE__, 0x0000000e, "e", "%-x",
-__LINE__, 0x00c38aec, "c38aec", "%x",
-__LINE__, -0x00658f4, "-415988", "%#ld",
-__LINE__, 0x0066ac4e, "6728782", "%0d",
-__LINE__, 0xc4a808d5, "c4a808d5", "%x",
-__LINE__, 0x00000000, " 0", "%6.1x",
-__LINE__, 0x00066d24, "66d24", "%x",
-__LINE__, 0x00002117, "2117", "%X",
-__LINE__, 0xfe06fdf4, "FE06FDF4", "%0X",
-__LINE__, 0xfffffff9, "fffffff9", "%x",
-__LINE__, 0x1c6bb795, "+476821397", "%+d",
-__LINE__, 0xfffffba4, "FFFFFBA4", "%X",
-__LINE__, 0xfffd7d44, "fffd7d44", "%0x",
-__LINE__, 0x0019dd17, "1694999", "%d",
-__LINE__, 0x6475851e, "0x6475851e", "% #7.x",
-__LINE__, -0x00330d5, "-209109", "%0ld",
-__LINE__, 0x009f53f7, "09F53F7", "%+6.7X",
-__LINE__, -0x00172f9, " -94969", "%7.5ld",
-__LINE__, 0xffffffdc, "FFFFFFDC", "%X",
-__LINE__, -0x013bdec, "-1293804", "%+#2ld",
-__LINE__, 0xfff845c0, "fff845c0", "%+7.x",
-__LINE__, -0x0fbe712, "-16508690", "%.7d",
-__LINE__, 0xffffe13f, "ffffe13f", "%x",
-__LINE__, 0xbbc19951, "BBC19951", "%-4X",
-__LINE__, -0x28d6d1b, "-42822939", "%#d",
-__LINE__, -0x93cda6b, "-154983019", "%-d",
-__LINE__, 0xffc93342, "FFC93342", "%7.X",
-__LINE__, 0x072ac8b3, " 120244403", "% ld",
-__LINE__, 0xfff8d17b, "FFF8D17B", "% X",
-__LINE__, 0x00000da5, "DA5", "%0.X",
-__LINE__, 0x055ad3ac, "0x55ad3ac", "%#1x",
-__LINE__, 0x00000e5a, " 3674", "% .4ld",
-__LINE__, 0xffffff79, "FFFFFF79", "%+X",
-__LINE__, 0xffffe167, "ffffe167", "%+5x",
-__LINE__, 0x0000fa50, "0064080", "%.7ld",
-__LINE__, 0x00000001, "1", "%-d",
-__LINE__, 0xfffffffe, "fffffffe", "%x",
-__LINE__, 0x000009ac, " 2476", "% #2.ld",
-__LINE__, 0x00000e78, "0003704", "%.7ld",
-__LINE__, -0x000dfc3, "-57283", "%6.d",
-__LINE__, 0x00000ee0, "EE0", "%0X",
-__LINE__, -0x293703b3, "-691471283", "%ld",
-__LINE__, 0x000073e8, " 73e8", "%6x",
-__LINE__, 0xffffdffd, "ffffdffd", "%5.5x",
-__LINE__, 0x00000004, "4", "%+00.x",
-__LINE__, 0x00000008, "0X8", "%#X",
-__LINE__, 0x0003044c, "3044c", "%0x",
-__LINE__, 0xffc2095e, "FFC2095E", "%0X",
-__LINE__, 0x00000aac, "0002732", "%-.7ld",
-__LINE__, 0xffffff79, "FFFFFF79", "%+1.X",
-__LINE__, 0x53a0f94a, " 1403058506", "% 2.4ld",
-__LINE__, 0x000e928d, "e928d", "%x",
-__LINE__, 0x0024127a, "2364026", "%5.d",
-__LINE__, 0x000f7c1c, " 1014812", "% 2.d",
-__LINE__, -0x000003d, "-61 ", "%-#4ld",
-__LINE__, -0x0000122, "-290", "%+ld",
-__LINE__, 0x00000006, "+6", "%+0d",
-__LINE__, 0x00000129, " 000129", "%7.6X",
-__LINE__, 0x15d873e5, " 366506981", "% 5.7d",
-__LINE__, 0x00000001, "1", "%d",
-__LINE__, 0x038d6110, "+59597072", "%+d",
-__LINE__, 0x0f46ccc3, "256298179", "%-1.4d",
-__LINE__, 0xfe434d21, "fe434d21", "%x",
-__LINE__, -0x179797d7, "-395810775", "%d",
-__LINE__, 0xe35807bf, "e35807bf", "%x",
-__LINE__, 0x00000003, " +3", "%+7d",
-__LINE__, 0x017e699e, "25061790", "%#ld",
-__LINE__, -0x0000029, "-41", "%d",
-__LINE__, 0xffffff11, "ffffff11", "%1.x",
-__LINE__, -0x0001bf6, "-7158", "%+0ld",
-__LINE__, 0xffffff4b, "FFFFFF4B", "%4X",
-__LINE__, -0x0000040, "-64", "%ld",
-__LINE__, 0x000034d6, "+13526", "%+ld",
-__LINE__, 0xffffffa7, "ffffffa7", "%x",
-__LINE__, 0xfffffe8e, "fffffe8e", "%+.3x",
-__LINE__, 0x00000000, "0", "%0.1d",
-__LINE__, -0x007cdf1, "-511473", "%ld",
-__LINE__, 0xfffffeef, "FFFFFEEF", "%-X",
-__LINE__, 0x00002d91, "2d91", "%x",
-__LINE__, -0x000025b, "-603", "%#ld",
-__LINE__, -0x000001b, "-27", "%-ld",
-__LINE__, 0x042b6752, "42B6752", "%+X",
-__LINE__, -0x75afb0a6, "-1974448294", "% ld",
-__LINE__, -0x0000001, "-1", "%ld",
-__LINE__, 0x00000542, " 1346", "%6d",
-__LINE__, -0x0000010, "-16", "%+0d",
-__LINE__, 0xfffed8f7, "FFFED8F7", "%5.X",
-__LINE__, 0x0541852e, "541852e", "% 2.x",
-__LINE__, 0xff22aec3, "ff22aec3", "% .1x",
-__LINE__, 0x5e34b745, "1580513093", "%ld",
-__LINE__, 0xfffffff3, "fffffff3", "%x",
-__LINE__, 0x0eda7b86, "+249199494", "%+.3d",
-__LINE__, 0xffffe40f, "ffffe40f", "%+x",
-__LINE__, -0x0003484, "-13444", "%-1.5ld",
-__LINE__, 0x0000334b, " 13131", "%6.ld",
-__LINE__, -0x0000149, "-329", "%ld",
-__LINE__, 0x00000001, " 001", "% 5.3x",
-__LINE__, 0xffeaa035, "ffeaa035", "%+3.5x",
-__LINE__, 0x00211dff, "2170367", "%ld",
-__LINE__, 0x007e91f4, "7e91f4", "%x",
-__LINE__, 0xfffffffc, "0xfffffffc", "%+#5x",
-__LINE__, 0xfffffffc, "FFFFFFFC", "%6.X",
-__LINE__, 0x0156a9b5, "156a9b5", "%x",
-__LINE__, 0xfffffe58, "fffffe58", "%+x",
-__LINE__, 0xffff8c66, "FFFF8C66", "%.0X",
-__LINE__, 0x00000000, "0", "%d",
-__LINE__, 0x00000005, " 5", "%7.d",
-__LINE__, -0x0000002, "-2", "%ld",
-__LINE__, 0x000076b9, " 30393", "% ld",
-__LINE__, 0x00003824, "3824", "%4X",
-__LINE__, 0x00000cdf, " CDF", "% 7X",
-__LINE__, 0x017c9e8f, "17C9E8F", "%-X",
-__LINE__, -0x20f582d, "-34560045", "%-.5d",
-__LINE__, 0x0000732e, " 29486", "% 7.ld",
-__LINE__, 0xffffffff, "FFFFFFFF", "%+0X",
-__LINE__, 0xf379a4a2, "F379A4A2", "% .7X",
-__LINE__, -0x0000028, "-40", "%-d",
-__LINE__, 0xe73cf79e, "e73cf79e", "%x",
-__LINE__, 0x00000002, " 2", "%7ld",
-__LINE__, -0x00029b1, "-10673", "%-#1.ld",
-__LINE__, -0x0002a58, "-10840", "%3.d",
-__LINE__, 0x00000002, "2", "%-X",
-__LINE__, 0xfffffffc, "FFFFFFFC", "%X",
-__LINE__, -0x000003a, " -58", "%5ld",
-__LINE__, 0x0245ef3b, "245ef3b", "%.3x",
-__LINE__, 0x00026cca, "158922", "%-06.3ld",
-__LINE__, 0x01016fd3, "16871379", "%-d",
-__LINE__, 0x000016fc, "5884", "%0ld",
-__LINE__, -0x00007fb, " -2043", "%7.3d",
-__LINE__, 0xfff73d3c, "fff73d3c", "%0x",
-__LINE__, -0x0000110, "-272", "% 04.3d",
-__LINE__, 0x0000000e, " 014", "% 04ld",
-__LINE__, -0x0000039, "-57", "%.0ld",
-__LINE__, 0x00000c95, "c95", "%0x",
-__LINE__, 0xffff3b2e, "ffff3b2e", "%x",
-__LINE__, 0xfffffffe, "FFFFFFFE", "%X",
-__LINE__, 0x00000015, "21", "%.1d",
-__LINE__, 0x0000000c, "+12", "%+ld",
-__LINE__, 0x00000000, "0", "%+X",
-__LINE__, 0xfffc9a14, "fffc9a14", "%-.5x",
-__LINE__, 0x0000003c, "60", "%.2ld",
-__LINE__, -0x0000023, " -35", "%6.d",
-__LINE__, 0x00000740, "1856", "%ld",
-__LINE__, 0x00000160, "160", "% 3.X",
-__LINE__, 0x00000006, " 6", "%5.X",
-__LINE__, -0x0000677, "-1655", "%.3ld",
-__LINE__, 0x12709c7e, "12709C7E", "%.7X",
-__LINE__, 0x0000090f, "+2319", "%+#d",
-__LINE__, 0xffffffe0, "0xffffffe0", "%#4.1x",
-__LINE__, 0x00132ce0, "1256672", "%ld",
-__LINE__, 0x00000059, "59", "%+X",
-__LINE__, -0x0000017, "-23", "%0d",
-__LINE__, -0x01fade6, "-2076134", "%-4.3ld",
-__LINE__, 0x000df3fa, "914426", "%.5ld",
-__LINE__, 0xfffffd0f, "fffffd0f", "%7x",
-__LINE__, -0x000c212, "-49682", "%0.1ld",
-__LINE__, 0xffff8bcb, "FFFF8BCB", "%.3X",
-__LINE__, 0x0000000a, "a", "% x",
-__LINE__, 0x00000021, "21", "%x",
-__LINE__, -0x0000040, "-64", "% 1ld",
-__LINE__, 0x00000009, " 9", "%6.ld",
-__LINE__, -0x0000d67, "-3431", "% 5.3d",
-__LINE__, 0x03a85f1b, "61366043", "%ld",
-__LINE__, 0x00000035, "000053", "%0.6d",
-__LINE__, 0xfffda5cb, "fffda5cb", "%+x",
-__LINE__, 0xffffff78, "FFFFFF78", "%-7.0X",
-__LINE__, 0xfffffd6d, "fffffd6d", "%7.x",
-__LINE__, 0xfffffc08, "fffffc08", "%7.3x",
-__LINE__, 0x00003335, " 13109", "% #d",
-__LINE__, -0x0000002, " -2", "%5.d",
-__LINE__, -0x13767a48, "-326531656", "%+ld",
-__LINE__, 0x00000be5, "3045", "%4.0ld",
-__LINE__, 0xfffdb28c, "FFFDB28C", "%X",
-__LINE__, 0x00127118, "1208600", "%ld",
-__LINE__, 0x00000086, " 134", "% ld",
-__LINE__, 0x0002214c, "2214c", "%+x",
-__LINE__, 0x0000a0c2, " a0c2", "%5.0x",
-__LINE__, -0x000007c, "-124", "%ld",
-__LINE__, 0x0000012a, "00298", "%3.5d",
-__LINE__, 0xfd4f1257, "FD4F1257", "%+2.X",
-__LINE__, 0xffffd8aa, "ffffd8aa", "%5x",
-__LINE__, -0x00000a7, "-167", "%+ld",
-__LINE__, -0x0009c69, "-40041", "%0.0ld",
-__LINE__, 0x02230418, "35849240", "%-0.6ld",
-__LINE__, 0x00000000, " 0", "%6x",
-__LINE__, 0xfffff184, "fffff184", "%02.5x",
-__LINE__, -0x0ae967b, "-11441787", "%d",
-__LINE__, 0x0015de3a, "1433146", "%-5.3d",
-__LINE__, -0x0071e93, "-466579", "%1.ld",
-__LINE__, 0xfffff8bd, "fffff8bd", "%+x",
-__LINE__, -0x00000e4, "-228", "%+ld",
-__LINE__, 0x000001d8, " 472", "% .3ld",
-__LINE__, 0x00315faa, "315faa", "%-0x",
-__LINE__, 0x00000e59, "e59", "%0x",
-__LINE__, -0x0000005, "-5", "%ld",
-__LINE__, 0x000018ec, "6380", "%ld",
-__LINE__, 0xfffffff9, "fffffff9", "%5.2x",
-__LINE__, -0xe7cfd39, "-243072313", "%-d",
-__LINE__, 0x0002c30b, "2C30B", "%1.2X",
-__LINE__, 0x0000007a, "7A", "%X",
-__LINE__, 0xf604ecb2, "F604ECB2", "%2X",
-__LINE__, -0x05f602c, "-6250540", "%d",
-__LINE__, 0xffff9c86, "ffff9c86", "%2.x",
-__LINE__, -0x00d7f55, "-884565", "%#d",
-__LINE__, 0xd2a37824, "D2A37824", "%4X",
-__LINE__, 0x00000000, "", "%-.0x",
-__LINE__, 0x000d4b51, "0d4b51", "%3.6x",
-__LINE__, 0x000ecd97, "ecd97", "% x",
-__LINE__, -0x0000018, "-024", "%+04ld",
-__LINE__, -0x009f292, "-651922", "%ld",
-__LINE__, -0x0002da9, "-11689", "%-0ld",
-__LINE__, -0x000a218, "-41496", "%4.5d",
-__LINE__, 0xffff85ac, "FFFF85AC", "% 04.X",
-__LINE__, -0x0d9ffbe, "-14286782", "%0d",
-__LINE__, 0xfb18cc8e, "fb18cc8e", "%x",
-__LINE__, 0xffffe5d3, "FFFFE5D3", "%-X",
-__LINE__, 0x00000000, "0", "%x",
-__LINE__, -0x0000006, "-6", "% d",
-__LINE__, 0x0002fc62, "2fc62", "% 03.x",
-__LINE__, 0x00000000, "00", "%.2d",
-__LINE__, -0x00000fd, " -253", "%6ld",
-__LINE__, -0x000000b, "-11", "%d",
-__LINE__, -0x00042a3, "-17059", "% 6d",
-__LINE__, 0x00000002, "2", "% X",
-__LINE__, -0x61ead93e, "-1642780990", "%-0d",
-__LINE__, 0xf2e61f6d, "f2e61f6d", "%-.4x",
-__LINE__, 0xffd31b93, "ffd31b93", "%x",
-__LINE__, -0x0000008, "-8", "%ld",
-__LINE__, 0xffffffff, "ffffffff", "%00x",
-__LINE__, 0x000000fb, "+000251", "%+2.6d",
-__LINE__, 0x00000015, " 15", "%4.X",
-__LINE__, 0x06ec6d96, "6EC6D96", "%+2.X",
-__LINE__, 0xffff1df7, "0xffff1df7", "% #1x",
-__LINE__, -0x000004b, "-75", "%-ld",
-__LINE__, 0x00000008, "8", "%#.0d",
-__LINE__, 0x00001355, "4949", "%3.4ld",
-__LINE__, -0x00000f7, "-247", "%d",
-__LINE__, 0x0000001f, "31", "%.2ld",
-__LINE__, 0x0000d556, "D556", "%-X",
-__LINE__, 0xffffd5a5, "ffffd5a5", "% x",
-__LINE__, -0x0000e34, "-3636", "%#d",
-__LINE__, -0x0000007, "-7", "%d",
-__LINE__, 0x01ba10a4, "1ba10a4", "%x",
-__LINE__, 0xfffff759, "FFFFF759", "% X",
-__LINE__, -0x80d0adb, "-135072475", "%d",
-__LINE__, 0x0002bf61, "2bf61", "%x",
-__LINE__, 0xffff008b, "FFFF008B", "%-7X",
-__LINE__, 0x00000e72, "E72", "%X",
-__LINE__, -0x00000ea, "-234", "%0ld",
-__LINE__, -0x0007b9d, "-0031645", "%0.7ld",
-__LINE__, 0x0001baaa, "0X1BAAA", "%#4X",
-__LINE__, 0x0000a57f, " a57f", "%6.x",
-__LINE__, -0x21a73726, "-564606758", "%ld",
-__LINE__, 0x06f45c9f, "0x6f45c9f", "%#.3x",
-__LINE__, 0x00018e5d, "101981", "%-d",
-__LINE__, 0x0001e69a, "124570", "%-d",
-__LINE__, -0x0000d26, " -3366", "% 07.d",
-__LINE__, 0x00000000, "+", "%+0.ld",
-__LINE__, 0x00003916, "14614", "%ld",
-__LINE__, 0xfffffd8f, "fffffd8f", "%-3.x",
-__LINE__, 0x00000011, "11", "%x",
-__LINE__, 0x000000e7, "E7", "%X",
-__LINE__, 0xfdf9d89b, "FDF9D89B", "%X",
-__LINE__, 0x00000a7c, "a7c", "%x",
-__LINE__, 0x0000003f, "00003F", "%.6X",
-__LINE__, 0xffffe729, "FFFFE729", "%X",
-__LINE__, 0xfffffffe, "fffffffe", "% .6x",
-__LINE__, -0x0000a4b, "-2635", "%+d",
-__LINE__, 0xffffff50, "ffffff50", "%0.7x",
-__LINE__, 0xfaf57e8b, "faf57e8b", "% 4.x",
-__LINE__, -0x0000056, "-86", "%ld",
-__LINE__, 0x08ed2a4d, "8ed2a4d", "%4x",
-__LINE__, 0xff8d9081, "FF8D9081", "%+0.X",
-__LINE__, 0x002730a1, "2568353", "%4d",
-__LINE__, 0xffff9564, "ffff9564", "%x",
-__LINE__, -0x0000006, " -6", "%4ld",
-__LINE__, -0x19890310, "-428409616", "%0ld",
-__LINE__, 0xd2ce636c, "d2ce636c", "%+x",
-__LINE__, -0x00001fe, "-510", "%d",
-__LINE__, 0x00000006, "0000006", "%+0.7x",
-__LINE__, 0xffffffc2, "0XFFFFFFC2", "%-#.5X",
-__LINE__, -0x00000fd, "-253", "%+d",
-__LINE__, 0x000216aa, "0x216aa", "%#x",
-__LINE__, 0xffe36c66, "ffe36c66", "%x",
-__LINE__, 0x00000002, "2", "%x",
-__LINE__, -0x0000025, "-37", "% d",
-__LINE__, 0x0000007e, "126", "%d",
-__LINE__, 0x0003c1f9, "+246265", "%+ld",
-__LINE__, 0x00000001, "1", "%ld",
-__LINE__, -0x0000001, "-1", "%ld",
-__LINE__, -0x00539e7, "-342503", "%06.ld",
-__LINE__, 0x00000d42, " 3394", "%#6.ld",
-__LINE__, 0xf73b7c4e, "F73B7C4E", "%X",
-__LINE__, 0x00000022, "22", "%.1x",
-__LINE__, 0xffffa883, "FFFFA883", "%X",
-__LINE__, 0x016ec247, "16ec247", "%x",
-__LINE__, 0x00000019, "19", "%+X",
-__LINE__, 0x0000665a, "665A", "% 2.X",
-__LINE__, 0xfffffffc, "FFFFFFFC", "%-5.X",
-__LINE__, 0x008e3fbc, "8E3FBC", "%X",
-__LINE__, 0xfffffffa, "FFFFFFFA", "%X",
-__LINE__, 0x1b806597, "461399447", "%.2d",
-__LINE__, 0x00000366, "0000870", "%#1.7ld",
-__LINE__, 0x0001d92e, "1d92e", "%x",
-__LINE__, 0x000104ce, "104CE", "%-X",
-__LINE__, 0xfffffe4c, "fffffe4c", "%x",
-__LINE__, 0x000000e9, "E9", "%X",
-__LINE__, 0x000a855c, " 689500", "% d",
-__LINE__, 0x00000075, "75", "% X",
-__LINE__, -0x0000026, "-38", "%ld",
-__LINE__, 0xfffff169, "fffff169", "%-04.2x",
-__LINE__, 0xffffff6f, "ffffff6f", "%x",
-__LINE__, 0x00000003, "0x3", "%#x",
-__LINE__, 0x00623bab, "6437803", "%.0d",
-__LINE__, -0x2260224c, "-576725580", "%ld",
-__LINE__, 0xe7e7a998, "E7E7A998", "%.1X",
-__LINE__, 0x00000005, "5", "%X",
-__LINE__, 0x0000b560, "0xb560", "%#x",
-__LINE__, 0xfe11854d, "fe11854d", "%-.5x",
-__LINE__, 0x00190014, "1638420", "%ld",
-__LINE__, 0x0001d22a, "0X1D22A", "%-#X",
-__LINE__, 0x00000c16, "c16", "%2x",
-__LINE__, 0x00000d1a, "3354", "%#d",
-__LINE__, 0x000165f6, "91638", "%d",
-__LINE__, 0xfffff557, "0XFFFFF557", "%#X",
-__LINE__, 0x00000588, " 588", "%07.X",
-__LINE__, 0xf4a72708, "f4a72708", "%x",
-__LINE__, 0xfff1cba9, "0xfff1cba9", "% #2.5x",
-__LINE__, 0x000333a4, "209828", "%d",
-__LINE__, 0x0000179b, "179B", "% 2.X",
-__LINE__, 0x00000460, "1120", "%0ld",
-__LINE__, 0xffffff89, "FFFFFF89", "%X",
-__LINE__, -0x0000012, "-18", "%ld",
-__LINE__, 0x00004fe0, "20448", "%0.d",
-__LINE__, 0x00532e77, "532e77", "%00.x",
-__LINE__, 0xf7b92efe, "f7b92efe", "%0x",
-__LINE__, -0x0000243, "-579", "%+1.d",
-__LINE__, 0x34894bb7, "+881413047", "%+d",
-__LINE__, 0xfffaa189, "FFFAA189", "% 6X",
-__LINE__, -0x0000579, "-1401", "%+ld",
-__LINE__, 0x005acb12, "5acb12", "%5.0x",
-__LINE__, 0xffff890a, "FFFF890A", "%X",
-__LINE__, 0x010dff2f, "10DFF2F", "%.7X",
-__LINE__, 0x00005a7f, "23167", "%#ld",
-__LINE__, 0x000005e3, "1507", "%#3d",
-__LINE__, -0xa815bcb, "-176249803", "%d",
-__LINE__, 0xffffffff, "ffffffff", "%+x",
-__LINE__, 0xfffe0ff7, "fffe0ff7", "%3x",
-__LINE__, 0xffffffff, "0XFFFFFFFF", "%#2.1X",
-__LINE__, -0x1cc5ea52, "-482732626", "%6.d",
-__LINE__, 0x000425ed, "+0271853", "%+.7d",
-__LINE__, 0x00000001, "1", "%+x",
-__LINE__, -0x48f2a72, "-76491378", "%7.0d",
-__LINE__, 0xfffffff7, "FFFFFFF7", "% 0X",
-__LINE__, 0xfd8ffc0a, "fd8ffc0a", "%.1x",
-__LINE__, 0x0001f56d, " 1F56D", "%+7.2X",
-__LINE__, 0x000000db, " DB", "%6.X",
-__LINE__, 0xffffffc2, "ffffffc2", "%x",
-__LINE__, 0x00000001, "001", "%03ld",
-__LINE__, 0xffd89f58, "ffd89f58", "% 0.x",
-__LINE__, 0xfe1a72fc, "fe1a72fc", "%x",
-__LINE__, 0xfffff9b6, "FFFFF9B6", "%X",
-__LINE__, 0x00243633, "243633", "%X",
-__LINE__, 0x00821bc7, "+8526791", "%+#0ld",
-__LINE__, 0xfe63f348, "0XFE63F348", "%#3X",
-__LINE__, 0xff729f19, "ff729f19", "%4x",
-__LINE__, 0xffff570f, "FFFF570F", "%+X",
-__LINE__, 0x00a57a42, "10844738", "%6.3d",
-__LINE__, 0xfe4a3ed0, "FE4A3ED0", "%6.X",
-__LINE__, 0x00000000, "0", "%d",
-__LINE__, 0x000001bb, "01bb", "% .4x",
-__LINE__, 0x02b4a1e9, "2b4a1e9", "%-7.x",
-__LINE__, 0x31750683, "31750683", "%x",
-__LINE__, 0x00001cd7, "7383", "%#ld",
-__LINE__, 0x0000079d, "1949", "%d",
-__LINE__, 0xffb8ff3b, "FFB8FF3B", "%X",
-__LINE__, 0x00a768b6, "0A768B6", "%-6.7X",
-__LINE__, 0x1c665b48, "0X1C665B48", "% #X",
-__LINE__, -0x000037d, "-000893", "%3.6d",
-__LINE__, 0x29890443, "29890443", "%+0x",
-__LINE__, 0x000000e5, "e5 ", "%-4x",
-__LINE__, 0xfff2b5fa, "FFF2B5FA", "%X",
-__LINE__, -0x5d32c2b, "-97725483", "%05ld",
-__LINE__, -0x00016c5, " -05829", "%+#7.5ld",
-__LINE__, 0x00000644, "644", "%X",
-__LINE__, -0x018c027, "-1622055", "%+.1d",
-__LINE__, 0x0000013c, "0x13c", "%#x",
-__LINE__, 0x00000009, "+9", "%+#ld",
-__LINE__, 0x00000000, "0", "%ld",
-__LINE__, -0x018eb19, "-1633049", "%4.3ld",
-__LINE__, 0xfffff429, "FFFFF429", "% X",
-__LINE__, 0x0032de67, "32DE67", "%X",
-__LINE__, 0x0016bdfa, " 1490426", "% .2ld",
-__LINE__, 0x00000065, "65", "%+.0X",
-__LINE__, 0x00000072, " 72", "%+4.2X",
-__LINE__, 0x00075119, "75119", "%2x",
-__LINE__, 0x000000b8, "b8", "%x",
-__LINE__, 0x000000d0, "d0", "%x",
-__LINE__, 0x000000b9, "b9", "%x",
-__LINE__, 0x003fda9d, " 4184733", "% #3.d",
-__LINE__, 0x00029a24, "170532", "%4.d",
-__LINE__, -0x132a337d, "-321532797", "% ld",
-__LINE__, 0x0000047a, "0X47A", "%-#X",
-__LINE__, 0x00000000, "0", "%-ld",
-__LINE__, -0x0d9750b, "-14251275", "% ld",
-__LINE__, 0x00029d6c, "29d6c", "%x",
-__LINE__, 0xfb060cc0, "fb060cc0", "%x",
-__LINE__, 0xffffd524, "0XFFFFD524", "%#X",
-__LINE__, 0xffffff30, "ffffff30", "%-5x",
-__LINE__, 0x00001650, "0005712", "%#0.7d",
-__LINE__, 0x0000b702, "0B702", "%03.5X",
-__LINE__, 0x000003c1, "3c1", "% .1x",
-__LINE__, -0x0290412, "-2688018", "%d",
-__LINE__, -0x00008bf, "-2239", "%#d",
-__LINE__, -0x0000001, "-1", "%d",
-__LINE__, 0x0001d750, "1D750", "%-X",
-__LINE__, 0x006eee92, "6EEE92", "%-X",
-__LINE__, 0xff812b02, "ff812b02", "%0x",
-__LINE__, 0xfffffeac, "FFFFFEAC", "%+0X",
-__LINE__, 0x000003a5, "3a5", "%x",
-__LINE__, -0x15270cee, "-354880750", "%2.ld",
-__LINE__, 0x06b686d2, "6b686d2", "%0x",
-__LINE__, 0xffe9cdcc, "ffe9cdcc", "%x",
-__LINE__, 0x0ecb168e, "ecb168e", "%x",
-__LINE__, 0x00000051, "51", "%-X",
-__LINE__, -0x0018860, "-100448", "%-0d",
-__LINE__, 0x8f08b82b, "0x8f08b82b", "%-#.5x",
-__LINE__, 0xffffffff, "ffffffff", "%x",
-__LINE__, 0x0000000e, "e", "%+01x",
-__LINE__, 0x04cf15bc, " 80680380", "% #ld",
-__LINE__, 0x50006e8a, "50006e8a", "%x",
-__LINE__, 0x0002f669, "194153", "%0d",
-__LINE__, 0x000000a6, " 166", "% 5.ld",
-__LINE__, -0x04036bb, "-4208315", "%7.5d",
-__LINE__, 0x00070dea, "70DEA", "%+X",
-__LINE__, 0x00000964, "0x964", "%#x",
-__LINE__, 0x0000004d, "0x4d", "% #3.x",
-__LINE__, -0x0000001, "-1", "%-0d",
-__LINE__, 0x0000043e, "1086", "%ld",
-__LINE__, -0x0000001, "-1", "%-d",
-__LINE__, 0x00000000, "+0", "%+d",
-__LINE__, 0xfffe68d9, "FFFE68D9", "%7.X",
-__LINE__, -0x0169199, "-1479065", "%#.5ld",
-__LINE__, -0x000003d, "-61", "%ld",
-__LINE__, 0x00000001, "+1", "%+.1d",
-__LINE__, 0x0001a65d, "1a65d", "%.5x",
-__LINE__, 0x00000141, "+000321", "%+#5.6ld",
-__LINE__, 0x00000000, " 0", "%4x",
-__LINE__, 0x00000408, "1032", "%-2.3ld",
-__LINE__, 0xffffffed, "FFFFFFED", "%-X",
-__LINE__, 0xfe832351, "FE832351", "% .4X",
-__LINE__, 0x003a421b, "3A421B", "%-X",
-__LINE__, -0x53ed7f25, "-1408073509", "%ld",
-__LINE__, -0x0000003, "-0003", "%-5.4ld",
-__LINE__, 0x00000ad0, " 2768", "%7d",
-__LINE__, 0xfffaf30b, "FFFAF30B", "%X",
-__LINE__, 0x006349d3, " 6506963", "% 6.2ld",
-__LINE__, 0x07f0146a, "7f0146a", "%+3.4x",
-__LINE__, -0x0000002, " -2", "% 3.ld",
-__LINE__, -0x26e94f3, "-40801523", "%-#ld",
-__LINE__, -0x0000004, " -004", "%7.3d",
-__LINE__, 0xfffe8cc9, "FFFE8CC9", "%0X",
-__LINE__, 0x00000018, " 18", "%5.x",
-__LINE__, -0x4941de83, "-1229053571", "% 0.5ld",
-__LINE__, 0x00000000, " 0", "%6ld",
-__LINE__, 0xfffffffe, "0XFFFFFFFE", "%-#X",
-__LINE__, -0x0142ae1, "-1321697", "%4.ld",
-__LINE__, -0x0319e7f, "-3251839", "%0ld",
-__LINE__, 0x000004ff, " 4FF", "%7.2X",
-__LINE__, -0x0001c3e, "-7230", "%#.2ld",
-__LINE__, 0xffffe522, "ffffe522", "%x",
-__LINE__, 0x0001d1cb, "+119243", "%+.3ld",
-__LINE__, 0xfad19d52, "FAD19D52", "%+X",
-__LINE__, 0x00002a7c, " 10876", "% 0.ld",
-__LINE__, 0x00001449, "1449", "%X",
-__LINE__, 0x000732b8, "471736", "%d",
-__LINE__, -0x211a496e, "-555370862", "%ld",
-__LINE__, -0x0000004, "-4", "%1.d",
-__LINE__, 0x0295c03d, "43368509", "%5.ld",
-__LINE__, 0x01fa5722, "33183522", "%0ld",
-__LINE__, 0xfffbff62, "0xfffbff62", "%#x",
-__LINE__, 0x000000f5, " 245", "% 2.d",
-__LINE__, 0x000000a0, "160", "%-d",
-__LINE__, 0x0000000f, "15", "%.2ld",
-__LINE__, 0x0bf5f077, "+200667255", "%+ld",
-__LINE__, -0x14d3e5a, "-21839450", "%#2.3d",
-__LINE__, -0x21cbe656, "-567010902", "%ld",
-__LINE__, 0x000002b9, "697", "%ld",
-__LINE__, 0xfffff9b0, "FFFFF9B0", "%X",
-__LINE__, 0x007fd9c7, "8378823", "%3.4d",
-__LINE__, 0x00036d06, "36d06", "%x",
-__LINE__, 0xffde8052, "FFDE8052", "%4.6X",
-__LINE__, 0x0000000d, "13", "%#d",
-__LINE__, 0x68157d93, "68157d93", "%x",
-__LINE__, 0x00000005, "5", "%1x",
-__LINE__, 0xfffffff4, "FFFFFFF4", "%X",
-__LINE__, 0xf5bbf7e9, "f5bbf7e9", "%+.1x",
-__LINE__, 0x0be98f98, "BE98F98", "%X",
-__LINE__, 0x00000122, "00122", "%.5X",
-__LINE__, -0x0000936, "-2358", "%+#3.0ld",
-__LINE__, 0xfd230f09, "FD230F09", "%-7X",
-__LINE__, 0x00000089, "137", "%ld",
-__LINE__, 0x00000078, " 120", "%7d",
-__LINE__, -0x68ef2b6b, "-1760504683", "%-ld",
-__LINE__, 0xc24480bb, "C24480BB", "%+4X",
-__LINE__, 0xfefe36a2, "FEFE36A2", "%0X",
-__LINE__, -0x35344ba, "-55788730", "%7.d",
-__LINE__, 0xffffffff, "FFFFFFFF", "%+.6X",
-__LINE__, -0x0000f40, "-3904", "% ld",
-__LINE__, 0xfffffffb, "FFFFFFFB", "%X",
-__LINE__, 0x58b37c4b, "58b37c4b", "%2.2x",
-__LINE__, 0x000000e2, "226", "%#ld",
-__LINE__, 0xfff5ebde, "fff5ebde", "%-7.1x",
-__LINE__, 0x0c6ea9be, "208579006", "%-ld",
-__LINE__, 0xff708c74, "FF708C74", "% 4.X",
-__LINE__, 0x00000000, " 0", "% 3X",
-__LINE__, 0x00000004, " 4", "%03.d",
-__LINE__, 0x0919be7c, "+152682108", "%+6.d",
-__LINE__, 0x00d4fd1e, "13958430", "%0d",
-__LINE__, 0xfe77a69e, "fe77a69e", "%-7.x",
-__LINE__, 0x284ded44, "676195652", "%-#2ld",
-__LINE__, -0x00006e6, "-1766", "% ld",
-__LINE__, -0x7dac7ea, "-131778538", "%.0ld",
-__LINE__, 0x0003c50f, "247055", "%#d",
-__LINE__, 0xfffffffc, "fffffffc", "%-x",
-__LINE__, 0xfe0f0d1f, "fe0f0d1f", "% 5.1x",
-__LINE__, 0x00000009, "9", "%0ld",
-__LINE__, -0x0175cc1, "-1531073", "%-04.d",
-__LINE__, 0x000e4da2, " 937378", "% 4.ld",
-__LINE__, 0x00000762, "762", "%-0.X",
-__LINE__, 0x005211bf, "5211bf", "%-x",
-__LINE__, 0xfffffffb, "fffffffb", "%+2.6x",
-__LINE__, 0x00008862, "34914", "%ld",
-__LINE__, 0xfffc9754, "fffc9754", "%+x",
-__LINE__, 0x0000716e, "716E", "%X",
-__LINE__, 0x000000a8, "a8", "%x",
-__LINE__, 0xffff84f5, "ffff84f5", "%0x",
-__LINE__, 0x00005032, "5032", "%x",
-__LINE__, 0xffe242b4, "ffe242b4", "%6x",
-__LINE__, 0x002df9bd, "3013053", "%ld",
-__LINE__, 0xffffe267, "FFFFE267", "%.5X",
-__LINE__, 0xffffffc7, "0xffffffc7", "%#x",
-__LINE__, -0x1727c38, "-24280120", "%d",
-__LINE__, 0x01308072, "1308072", "%x",
-__LINE__, -0x5883c7c, "-92814460", "%+ld",
-__LINE__, 0x000030ad, "30ad", "%x",
-__LINE__, 0xffffffff, "FFFFFFFF", "%X",
-__LINE__, -0x2090a708, "-546350856", "% d",
-__LINE__, 0x0024e6b4, "2418356", "%#ld",
-__LINE__, 0x02db71ac, "2DB71AC", "% 6.3X",
-__LINE__, 0xfffffffc, "FFFFFFFC", "%2.7X",
-__LINE__, -0x000074e, " -1870", "%7.ld",
-__LINE__, -0x0011d84, "-73092", "%d",
-__LINE__, 0x00160723, "160723", "%1.3x",
-__LINE__, 0x00412929, "4270377", "%-d",
-__LINE__, -0x0008fc6, "-36806", "% d",
-__LINE__, 0x00000002, "2", "%d",
-__LINE__, 0x0eb67ffa, "eb67ffa", "%.4x",
-__LINE__, 0x05b86c3c, "95972412", "%4.4d",
-__LINE__, 0xffffca9c, "FFFFCA9C", "% 4.X",
-__LINE__, 0x0007d571, "7d571", "%-0x",
-__LINE__, -0x000239b, "-09115", "%5.5d",
-__LINE__, -0x0000155, " -341", "%5.3ld",
-__LINE__, 0x00000034, "34", "%x",
-__LINE__, -0x0000051, "-81", "%.1ld",
-__LINE__, 0x309bbbe0, "309bbbe0", "%x",
-__LINE__, 0x0075be1e, " 7716382", "% #ld",
-__LINE__, 0x000002d5, "2d5", "%x",
-__LINE__, 0x006b466d, "6B466D", "%-0X",
-__LINE__, 0x01d6c30f, "1D6C30F", "%4.X",
-__LINE__, 0x00000003, " 3", "%07.x",
-__LINE__, 0xfffcc102, "FFFCC102", "%6.X",
-__LINE__, 0xffffffff, "0XFFFFFFFF", "%#X",
-__LINE__, 0xfffffffe, "fffffffe", "%+x",
-__LINE__, 0x00000005, "5", "%ld",
-__LINE__, 0xff060284, "ff060284", "%x",
-__LINE__, 0x007a3325, "7A3325", "%-X",
-__LINE__, 0xf5f595bd, "F5F595BD", "%0X",
-__LINE__, 0xfffa3a10, "FFFA3A10", "%0X",
-__LINE__, 0x00000000, "0", "%x",
-__LINE__, -0x15078f9, "-22051065", "%7d",
-__LINE__, -0x0000002, "-000002", "%.6d",
-__LINE__, 0x00000036, "54", "%1.1ld",
-__LINE__, -0xbbecf6a, "-197054314", "%ld",
-__LINE__, 0x0000043d, "43D", "%X",
-__LINE__, 0xfffffffa, "0xfffffffa", "% #6.x",
-__LINE__, 0x016759f8, "23550456", "%0.ld",
-__LINE__, 0x000052d2, "+21202", "%+6.2d",
-__LINE__, -0x007d232, "-512562", "%ld",
-__LINE__, 0x00240be0, "2362336", "%.1d",
-__LINE__, -0x0000001, "-1", "%0d",
-__LINE__, 0xfffffffa, "FFFFFFFA", "%X",
-__LINE__, -0x0000e88, "-3720", "%ld",
-__LINE__, 0xfffffa9b, "FFFFFA9B", "%.5X",
-__LINE__, 0x09296eeb, "153710315", "%-1.0d",
-__LINE__, 0x001f46fc, "0X1F46FC", "%#X",
-__LINE__, 0x00000006, "6", "%X",
-__LINE__, 0xffffff87, "0XFFFFFF87", "%+#X",
-__LINE__, 0x00000469, "0469", "%04X",
-__LINE__, -0x0000001, "-1", "%ld",
-__LINE__, 0x00000000, "", "%.0ld",
-__LINE__, -0x52bc137, "-86753591", "%-#3ld",
-__LINE__, -0x2bddb08, "-45996808", "%-3.d",
-__LINE__, 0x041367f7, "41367F7", "%+X",
-__LINE__, -0x0018eb5, "-102069", "%+ld",
-__LINE__, -0x0000537, "-1335", "%#ld",
-__LINE__, -0x6f159ff4, "-1863688180", "%+1.d",
-__LINE__, 0x00112ac8, "0X112AC8", "%#6.3X",
-__LINE__, 0x00000000, " ", "%3.d",
-__LINE__, 0x0008afe8, "08afe8", "%+3.6x",
-__LINE__, 0x00000015, "21", "%ld",
-__LINE__, -0x02b7130, "-2847024", "% #2.4d",
-__LINE__, 0xffffffd0, "FFFFFFD0", "%X",
-__LINE__, -0x6970fa1, "-110563233", "%+#.4ld",
-__LINE__, 0x06387dcc, "0X6387DCC", "%-#X",
-__LINE__, 0xffffd506, "ffffd506", "%+6x",
-__LINE__, -0x00fe5cd, "-1041869", "%-#7d",
-__LINE__, -0x0c35bf6, "-12803062", "%-03d",
-__LINE__, -0x0020d89, "-134537", "%#d",
-__LINE__, -0x0c7aed3, "-13086419", "%-ld",
-__LINE__, -0x000362a, "-13866", "%#.4ld",
-__LINE__, -0x02d05f0, "-2950640", "%#ld",
-__LINE__, 0x02de1321, "0x2de1321", "%#7.x",
-__LINE__, 0xffb56428, "0xffb56428", "%#x",
-__LINE__, 0xfffffffe, "FFFFFFFE", "%X",
-__LINE__, 0xf072292d, "F072292D", "%.5X",
-__LINE__, -0x0f4b0f2, "-16036082", "%.5ld",
-__LINE__, 0x01b81885, "28842117", "%5d",
-__LINE__, -0x009cfa6, "-642982", "%d",
-__LINE__, 0xfffffffd, "0XFFFFFFFD", "%-#.5X",
-__LINE__, 0x0dc97a66, "DC97A66", "%2.X",
-__LINE__, 0x000000be, "190", "%.0d",
-__LINE__, 0xffffe1c7, "FFFFE1C7", "% X",
-__LINE__, 0x01883b9a, "1883b9a", "%3x",
-__LINE__, 0xffffdde1, "ffffdde1", "%+x",
-__LINE__, 0x2f1b4e32, "+790318642", "%+ld",
-__LINE__, 0x000129aa, "129aa", "%x",
-__LINE__, -0x00092c2, "-37570", "%d",
-__LINE__, 0x00070fbd, "70fbd", "%x",
-__LINE__, -0x00000ea, "-234", "%+4ld",
-__LINE__, 0xfffffffe, "fffffffe", "%x",
-__LINE__, 0x0091c7f7, "91C7F7", "% .3X",
-__LINE__, -0x0c14fe2, "-12668898", "%d",
-__LINE__, -0x0017c15, "-97301", "%d",
-__LINE__, -0x00005d0, "-0001488", "%5.7d",
-__LINE__, 0x0114c36e, "18137966", "%0d",
-__LINE__, 0xffffffff, "ffffffff", "%+x",
-__LINE__, 0x0ac76e78, "180842104", "%d",
-__LINE__, 0x001976cd, " 1668813", "% 4.ld",
-__LINE__, -0x0642319, "-6562585", "% d",
-__LINE__, 0xffffffff, "FFFFFFFF", "%X",
-__LINE__, -0x035019d, "-3473821", "%.7d",
-__LINE__, -0x0000061, "-97", "%#3.d",
-__LINE__, 0x0000001f, " 31", "% 6.1ld",
-__LINE__, -0x0000024, "-36", "%d",
-__LINE__, 0x000b3785, "735109", "%ld",
-__LINE__, 0xfffffda9, "fffffda9", "%-x",
-__LINE__, 0x00254832, "2443314", "%-ld",
-__LINE__, 0xfffffd40, "FFFFFD40", "%0X",
-__LINE__, -0x0006105, "-24837", "%+#d",
-__LINE__, 0x00000006, "+6", "%+d",
-__LINE__, 0xffd40fd8, "ffd40fd8", "%3.x",
-__LINE__, -0x000988e, "-39054", "%03d",
-__LINE__, 0x0005ad8b, "5AD8B", "%0.0X",
-__LINE__, 0x00000001, "1", "%d",
-__LINE__, 0xfe1f59b7, "fe1f59b7", "%4.x",
-__LINE__, -0x0000022, "-34", "%#d",
-__LINE__, 0x0018e3e9, "18E3E9", "% X",
-__LINE__, 0xffffff25, "FFFFFF25", "%2.X",
-__LINE__, -0x00002c6, "-710", "%1.ld",
-__LINE__, 0x00009765, "38757", "%5ld",
-__LINE__, 0xfe197646, "FE197646", "%-X",
-__LINE__, 0x00000001, " 1", "%+5.x",
-__LINE__, -0x0000002, "-2", "%#ld",
-__LINE__, 0x0072f6be, "72F6BE", "%1X",
-__LINE__, -0x000f06d, "-61549", "%-d",
-__LINE__, 0x00000001, " 1", "%5X",
-__LINE__, 0x328cba28, " 848083496", "% 2.ld",
-__LINE__, 0x0000cddc, "cddc", "%.1x",
-__LINE__, 0xfffffff9, "fffffff9", "%7x",
-__LINE__, 0x00baf511, "BAF511", "%-5.6X",
-__LINE__, 0x00000001, " 1", "%4.ld",
-__LINE__, 0x0001e4b0, "+124080", "%+ld",
-__LINE__, -0x07548f3, "-7686387", "% 6.d",
-__LINE__, -0x01b14ea, "-1774826", "% #0d",
-__LINE__, -0x000005c, "-92 ", "%-04ld",
-__LINE__, -0x00000ae, "-174", "%+.3ld",
-__LINE__, 0x0000008c, "0X8C", "%+#X",
-__LINE__, 0x14c02360, "14C02360", "%.6X",
-__LINE__, 0xfffffff6, "FFFFFFF6", "%X",
-__LINE__, 0x009f4ee5, "9f4ee5", "%x",
-__LINE__, 0x00000035, "35", "%X",
-__LINE__, -0x00000eb, "-235", "%ld",
-__LINE__, 0x1552ced8, "1552CED8", "%04X",
-__LINE__, 0x0000002a, " 2A", "%5X",
-__LINE__, 0xffffffff, "ffffffff", "% x",
-__LINE__, -0xdec0db2, "-233573810", "%d",
-__LINE__, 0x001e2ef0, "1978096", "%2.d",
-__LINE__, 0xffffef24, "ffffef24", "%.5x",
-__LINE__, 0xfffe6a6c, "fffe6a6c", "%+x",
-__LINE__, -0x0000004, "-4", "% ld",
-__LINE__, 0xfe3c6743, "fe3c6743", "%.1x",
-__LINE__, 0x0000033d, "829", "%0ld",
-__LINE__, -0x00006a0, " -1696", "% 7.ld",
-__LINE__, 0xffffffdb, "ffffffdb", "%0.0x",
-__LINE__, 0xfffffffc, "FFFFFFFC", "%3.3X",
-__LINE__, -0x0000004, "-4", "%#ld",
-__LINE__, 0x00b32b56, "B32B56", "%X",
-__LINE__, 0xffffffff, "0xffffffff", "%+#x",
-__LINE__, 0x01cd1a48, "1cd1a48", "%+7x",
-__LINE__, 0xffffffda, "ffffffda", "%x",
-__LINE__, 0x1886509e, "1886509E", "% X",
-__LINE__, 0x000000eb, "235", "%0d",
-__LINE__, 0xfffffff4, "fffffff4", "%0x",
-__LINE__, 0x00000547, "547", "% X",
-__LINE__, 0x000017e6, "17e6", "%-2.x",
-__LINE__, 0x00001dc4, "7620", "%d",
-__LINE__, 0xffffffff, "FFFFFFFF", "%3.0X",
-__LINE__, 0xffff93fa, "0XFFFF93FA", "%#X",
-__LINE__, 0xfffffe1c, "FFFFFE1C", "%-X",
-__LINE__, 0x00000000, "", "% .0x",
-__LINE__, 0x000000a1, "A1", "%X",
-__LINE__, 0xffffffff, "0xffffffff", "%#x",
-__LINE__, -0x0001460, "-05216", "%+#.5d",
-__LINE__, 0x00000001, "1 ", "%-6.x",
-__LINE__, 0xfffd5324, "FFFD5324", "%+2.6X",
-__LINE__, 0x00000007, " 07", "%06.2d",
-__LINE__, 0x00000003, "3", "%-X",
-__LINE__, 0xfffffdb7, "0XFFFFFDB7", "%+#X",
-__LINE__, 0xfffff4cc, "fffff4cc", "%0x",
-__LINE__, 0x00000000, "0 ", "%-5X",
-__LINE__, 0x00758c96, "758C96", "%X",
-__LINE__, -0x0000001, "-1", "%-ld",
-__LINE__, 0x00000001, "1", "%ld",
-__LINE__, 0x03f03caf, "66075823", "%.2ld",
-__LINE__, 0x0000a87c, "a87c", "%1.x",
-__LINE__, 0x00000034, "34", "%X",
-__LINE__, 0x00000000, "0", "%x",
-__LINE__, 0x00010167, "10167", "%x",
-__LINE__, -0x00007ce, "-1998 ", "%-6ld",
-__LINE__, 0x00000001, "1", "%.0d",
-__LINE__, 0x00d94cee, "14241006", "%ld",
-__LINE__, -0x0000008, "-8", "% d",
-__LINE__, -0x71520839, "-1901201465", "%+0d",
-__LINE__, 0x0000035a, "35a", "%-x",
-__LINE__, 0xfffd2f68, "FFFD2F68", "%-X",
-__LINE__, 0x0006ea53, "453203", "%1d",
-__LINE__, 0x000000df, "DF", "% 1X",
-__LINE__, 0xfffffffe, "fffffffe", "% 7x",
-__LINE__, 0x00000156, "156", "% X",
-__LINE__, 0x00037ac9, " 228041", "% ld",
-__LINE__, 0xffffffde, "FFFFFFDE", "%0.5X",
-__LINE__, 0x00000025, "37", "%-0.ld",
-__LINE__, -0x4133686, "-68368006", "%2ld",
-__LINE__, -0x000003b, "-59", "%.2ld",
-__LINE__, 0xfffff910, "fffff910", "% 00.0x",
-__LINE__, 0xff9ec802, "FF9EC802", "%2.6X",
-__LINE__, 0x00000008, "0X8", "%#1X",
-__LINE__, 0xfffffff7, "FFFFFFF7", "%-X",
-__LINE__, 0x0029a4da, "2729178", "%04.ld",
-__LINE__, 0x007d1588, "8197512", "%#d",
-__LINE__, 0x0007e86d, "518253", "%0d",
-__LINE__, 0xfffffff9, "fffffff9", "%x",
-__LINE__, 0x00000002, "002", "%.3d",
-__LINE__, 0x00006ec1, "6EC1", "%2X",
-__LINE__, 0x0000300c, "12300", "%-d",
-__LINE__, -0x0000002, "-2", "%+ld",
-__LINE__, -0x0000002, "-2", "%ld",
-__LINE__, -0x00015d5, "-005589", "%#.6ld",
-__LINE__, 0x00000041, "65", "%d",
-__LINE__, 0x00000229, "0000229", "% 0.7x",
-__LINE__, 0xfffffffb, "fffffffb", "%03.x",
-__LINE__, 0x00093262, "0602722", "%.7d",
-__LINE__, -0x00037b4, "-14260", "%-0ld",
-__LINE__, 0xfffffffc, "fffffffc", "%-x",
-__LINE__, 0xf24cb3e6, "f24cb3e6", "%1x",
-__LINE__, 0x00000000, "0", "%x",
-__LINE__, 0xfffffffb, "FFFFFFFB", "%0X",
-__LINE__, 0x00000031, "0000049", "%00.7ld",
-__LINE__, 0x00000bb3, "BB3", "%.1X",
-__LINE__, -0x0000001, "-0001", "%+#4.4ld",
-__LINE__, -0x0000001, "-1", "% d",
-__LINE__, 0x00022c0c, "22c0c", "%-x",
-__LINE__, 0xffffffd4, "ffffffd4", "%x",
-__LINE__, 0x000729c6, "469446", "%3.d",
-__LINE__, 0xb180feae, "b180feae", "%3.x",
-__LINE__, 0x124fac15, "307211285", "%-0ld",
-__LINE__, -0x0000004, "-4", "%ld",
-__LINE__, 0x0000006a, "106", "%#d",
-__LINE__, 0x0000297f, "297F", "%+3X",
-__LINE__, 0x0000000e, "14", "%0ld",
-__LINE__, 0x00000027, "27", "%0.1X",
-__LINE__, 0xffeb98eb, "ffeb98eb", "% 05.2x",
-__LINE__, 0xfffff19b, "FFFFF19B", "%+X",
-__LINE__, 0x00025992, "154002", "%6.6d",
-__LINE__, 0x00000040, " 040", "%6.3X",
-__LINE__, 0x00000a9e, " 0a9e", "%5.4x",
-__LINE__, 0x00c7f2cc, "c7f2cc", "%x",
-__LINE__, 0x000325e6, " 325E6", "%6.X",
-__LINE__, -0x69faad3, "-111127251", "%d",
-__LINE__, -0x059a307, "-5874439", "% ld",
-__LINE__, 0xfffffff6, "0xfffffff6", "%#0.0x",
-__LINE__, 0x0030fdf3, "30fdf3", "%x",
-__LINE__, 0x00007343, "+29507", "%+#2d",
-__LINE__, 0x0003cf4b, "0X3CF4B", "% #.2X",
-__LINE__, 0x00000433, "+1075", "%+0ld",
-__LINE__, 0xfffffffd, "fffffffd", "%+.3x",
-__LINE__, 0x0ae30c4e, "ae30c4e", "%+00x",
-__LINE__, 0x0002540f, "02540f", "%-.6x",
-__LINE__, -0x0000001, " -01", "% #5.2ld",
-__LINE__, 0xffffffe7, "0xffffffe7", "% #5.x",
-__LINE__, 0x0000005b, "91", "%d",
-__LINE__, 0x00001f9b, "8091", "%.4ld",
-__LINE__, 0xfffff315, "fffff315", "%4.x",
-__LINE__, -0x130eec41, "-319745089", "% ld",
-__LINE__, 0xfff8fe13, "FFF8FE13", "%X",
-__LINE__, -0x0000004, "-00004", "%5.5d",
-__LINE__, 0x00000669, "669", "%0X",
-__LINE__, -0x0000004, "-4", "%d",
-__LINE__, 0xf5e81496, "F5E81496", "% 6X",
-__LINE__, -0x0000001, "-1", "% 0d",
-__LINE__, 0xfffffff7, "fffffff7", "%x",
-__LINE__, 0x000001de, "478", "%d",
-__LINE__, 0x0000623e, "25150", "%5.0d",
-__LINE__, 0xffffffa8, "FFFFFFA8", "%+X",
-__LINE__, -0x0000117, "-279", "% ld",
-__LINE__, -0x0000517, "-1303", "%d",
-__LINE__, 0xfffff9d5, "fffff9d5", "% x",
-__LINE__, 0x000001cc, "1CC", "%-X",
-__LINE__, 0x0000019a, "0000410", "%.7d",
-__LINE__, 0x00000003, "3 ", "%-06X",
-__LINE__, 0x00000009, "0x9", "%#0x",
-__LINE__, 0xfd544610, "0XFD544610", "% #X",
-__LINE__, 0xfffffffc, "fffffffc", "%+x",
-__LINE__, 0x00009437, "37943", "%ld",
-__LINE__, -0x00b5ea6, "-745126", "%d",
-__LINE__, 0xffffffd8, "ffffffd8", "%6x",
-__LINE__, 0x00002a2d, "10797", "%.3ld",
-__LINE__, 0x00275238, "2576952", "%0ld",
-__LINE__, 0xfff90a34, "FFF90A34", "%-7X",
-__LINE__, 0xfffffffe, "FFFFFFFE", "% .7X",
-__LINE__, -0xb3b673e, "-188442430", "% ld",
-__LINE__, 0xfffff67a, "0xfffff67a", "%#0.x",
-__LINE__, 0x0000dff6, " dff6", "%+7.x",
-__LINE__, 0xffee46e3, "ffee46e3", "%x",
-__LINE__, 0x00001a66, " 0006758", "% 7.7d",
-__LINE__, 0x0002b475, "2B475", "%.4X",
-__LINE__, 0x0002090d, "002090d", "%.7x",
-__LINE__, -0x0057838, "-358456", "%#ld",
-__LINE__, 0x00000004, "0x4", "%#x",
-__LINE__, 0x0574cb62, "91540322", "%#7d",
-__LINE__, -0x0054388, "-344968", "% #d",
-__LINE__, 0x000421c2, "421C2", "% X",
-__LINE__, 0x00000003, "3", "%0d",
-__LINE__, 0xffffe2e2, "ffffe2e2", "% 5.x",
-__LINE__, 0x00000021, "+33", "%+d",
-__LINE__, -0x0020033, "-131123", "%ld",
-__LINE__, -0x0000001, " -1", "%4.ld",
-__LINE__, 0x000000fd, "000fd", "%3.5x",
-__LINE__, 0x023e4337, "37634871", "%1d",
-__LINE__, 0x6e823d96, "6E823D96", "% X",
-__LINE__, 0xfff0e133, "fff0e133", "%x",
-__LINE__, -0x000decc, "-57036", "%3d",
-__LINE__, 0x004397b8, "4429752", "%0d",
-__LINE__, -0x0000023, " -35", "%6d",
-__LINE__, 0xffe701ca, "FFE701CA", "%3X",
-__LINE__, 0x000c0319, "+787225", "%+.6d",
-__LINE__, 0x00000000, "0", "%x",
-__LINE__, 0xfffffe1d, "FFFFFE1D", "%X",
-__LINE__, 0xfffffb33, "fffffb33", "%x",
-__LINE__, 0x02b5e30a, "45474570", "%d",
-__LINE__, 0x000074eb, "29931", "%03.ld",
-__LINE__, -0x4e42e310, "-1313006352", "%-0.d",
-__LINE__, -0x000007b, "-123", "%d",
-__LINE__, 0x00000160, " 352", "% d",
-__LINE__, -0x16af31ec, "-380580332", "%#ld",
-__LINE__, -0x000006e, "-000110", "%07ld",
-__LINE__, 0x232699a0, "232699a0", "%7.x",
-__LINE__, 0x00f9b8e5, "+16365797", "%+0d",
-__LINE__, 0x0000000c, "C", "%X",
-__LINE__, 0xfffffd4f, "FFFFFD4F", "%X",
-__LINE__, 0xffffe7bb, "FFFFE7BB", "%.7X",
-__LINE__, -0x0000163, "-355", "%d",
-__LINE__, 0x00070315, " 459541", "% #2.d",
-__LINE__, -0x7d5c12a, "-131449130", "% 6.ld",
-__LINE__, 0xffffffb2, "FFFFFFB2", "%X",
-__LINE__, -0x0004aad, "-19117", "%+6.4ld",
-__LINE__, 0x00115586, "1136006", "%0d",
-__LINE__, -0x0000021, "-33", "%d",
-__LINE__, 0x093ce01e, "93ce01e", "% 5x",
-__LINE__, 0x00672135, "672135", "% x",
-__LINE__, 0x05f4abd5, "0x5f4abd5", "%+#6.x",
-__LINE__, -0x0448b03, "-4492035", "%-0.2ld",
-__LINE__, 0x00000000, "0", "%#x",
-__LINE__, 0x1987217e, "428286334", "%d",
-__LINE__, 0x000010f6, "10f6", "%-x",
-__LINE__, 0x0000177a, "177a", "%1x",
-__LINE__, 0xfffffefd, "FFFFFEFD", "%7X",
-__LINE__, -0x095cbf8, "-9817080", "%-5ld",
-__LINE__, 0x0000008a, "138", "%2.0ld",
-__LINE__, 0xfffe80ad, "fffe80ad", "%0x",
-__LINE__, -0x1a4c8f7, "-27576567", "%d",
-__LINE__, 0x00000000, "0", "%-x",
-__LINE__, 0x0000a82b, "43051", "%-ld",
-__LINE__, 0x000000eb, "235", "%2.3ld",
-__LINE__, -0x0002747, "-10055", "%d",
-__LINE__, 0x00000319, "0X319", "%#X",
-__LINE__, 0xfffffcfe, "FFFFFCFE", "% X",
-__LINE__, 0x00050f0e, "50f0e", "%-1x",
-__LINE__, -0x398e09e, "-60350622", "%0.7ld",
-__LINE__, 0x00000000, " ", "%2.ld",
-__LINE__, 0x00000049, "00049", "% .5X",
-__LINE__, -0x00000dd, " -221", "%+#5ld",
-__LINE__, 0xf6db2fac, "f6db2fac", "%-07x",
-__LINE__, 0x0000004f, "4F", "% .0X",
-__LINE__, 0x00000000, "0", "%x",
-__LINE__, 0xfd07f692, "fd07f692", "%x",
-__LINE__, 0xdb98bde0, "db98bde0", "%x",
-__LINE__, 0x00000271, "0271", "% 3.4x",
-__LINE__, -0x000115a, "-4442", "%#1.ld",
-__LINE__, 0x0002f5f2, "194034", "%ld",
-__LINE__, -0x0000152, " -338", "%+7ld",
-__LINE__, 0x00059336, "365366", "%d",
-__LINE__, 0xfffffff6, "fffffff6", "%-7x",
-__LINE__, 0xfb916c51, "fb916c51", "%-x",
-__LINE__, 0xffff413d, "FFFF413D", "%-X",
-__LINE__, 0xf2576910, "F2576910", "%-4.X",
-__LINE__, 0xfffc7730, "fffc7730", "%5.x",
-__LINE__, 0x000002e6, "+742", "%+1d",
-__LINE__, -0x00001bf, "-447", "%3d",
-__LINE__, 0x000002e1, "2E1", "%-X",
-__LINE__, 0x00000096, "150", "%#0ld",
-__LINE__, 0x000002bd, "701", "%d",
-__LINE__, -0x0053386, "-340870", "%#d",
-__LINE__, 0xfffdb076, "FFFDB076", "%X",
-__LINE__, 0x00004dc5, " +19909", "%+07.ld",
-__LINE__, 0x00000f7a, " F7A", "%4X",
-__LINE__, 0x02405000, " 37769216", "% ld",
-__LINE__, 0xfffce68d, "fffce68d", "%0x",
-__LINE__, -0x35b3af2, "-56310514", "%-ld",
-__LINE__, -0x0238631, "-2328113", "%.4d",
-__LINE__, -0x000001e, "-030", "%.3ld",
-__LINE__, 0xffffffdd, "FFFFFFDD", "%.4X",
-__LINE__, 0x0013f6ac, "13f6ac", "%02.x",
-__LINE__, 0xfffffffa, "fffffffa", "%+07.x",
-__LINE__, -0x000192b, " -6443", "%6.d",
-__LINE__, 0x0000058b, "+1419", "%+d",
-__LINE__, 0x00001391, "5009", "%ld",
-__LINE__, -0x0041a57, "-268887", "%1ld",
-__LINE__, 0xfffff266, "0xfffff266", "%+#6.6x",
-__LINE__, 0x0000018b, " 395", "%6.ld",
-__LINE__, 0x009ae24d, "+10150477", "%+ld",
-__LINE__, 0x0000007e, "7E", "%X",
-__LINE__, 0xfffffd53, "FFFFFD53", "% 0X",
-__LINE__, 0x000002fa, "2FA", "%-1.3X",
-__LINE__, 0x000000a4, "164", "%0d",
-__LINE__, 0x00001833, "6195", "%ld",
-__LINE__, -0x0000001, "-1", "%d",
-__LINE__, 0xf2fcbd9b, "F2FCBD9B", "%+0.2X",
-__LINE__, 0x00004a8a, "4A8A", "%X",
-__LINE__, -0x10695cda, "-275340506", "%d",
-__LINE__, 0x00000037, "37", "%X",
-__LINE__, 0x00082d5c, "82D5C", "%+0.5X",
-__LINE__, 0xfffffe01, "fffffe01", "% 5.3x",
-__LINE__, 0x000005ea, "05EA", "% 1.4X",
-__LINE__, 0x0e0b8826, "e0b8826", "%2x",
-__LINE__, -0x0000161, "-353", "%+d",
-__LINE__, 0x19e3014a, "19E3014A", "%+5X",
-__LINE__, 0x00000140, "140", "%x",
-__LINE__, 0xffff84b9, "FFFF84B9", "%X",
-__LINE__, -0x0005776, "-22390", "%+5ld",
-__LINE__, 0x0162ad61, "162AD61", "% X",
-__LINE__, 0x00002395, "2395", "%X",
-__LINE__, 0x003702ec, "3605228", "%5.2d",
-__LINE__, 0xffffffff, "FFFFFFFF", "%7X",
-__LINE__, 0x00001778, "0x1778", "%#5.x",
-__LINE__, 0xc52bef7f, "C52BEF7F", "%X",
-__LINE__, 0xfffffec4, "FFFFFEC4", "%X",
-__LINE__, 0x00000006, "6", "%X",
-__LINE__, 0x00000000, "000", "%03.3x",
-__LINE__, 0x00000000, "0", "%x",
-__LINE__, 0xffff6c46, "FFFF6C46", "% 2.2X",
-__LINE__, -0x1506098, "-22044824", "%01.d",
-__LINE__, 0x03415caf, "3415caf", "%x",
-__LINE__, -0x00007b4, "-1972", "%#4.4d",
-__LINE__, -0x00158c9, "-88265", "%03.4d",
-__LINE__, 0x6947c336, "1766310710", "%.6d",
-__LINE__, 0x0000017c, "17C", "% 0X",
-__LINE__, -0x00001b7, "-439", "% 0ld",
-__LINE__, 0x06a7575a, "6A7575A", "%-.0X",
-__LINE__, 0x000b3459, "734297", "%ld",
-__LINE__, -0x395d8dd, "-60152029", "%ld",
-__LINE__, 0x00036bb3, "224179", "%-6.d",
-__LINE__, 0xffff14ff, "FFFF14FF", "%X",
-__LINE__, -0x15910e4f, "-361827919", "%-0d",
-__LINE__, -0x0000004, "-4", "%#d",
-__LINE__, 0xf7f7adac, "F7F7ADAC", "% 3.X",
-__LINE__, 0xffffff74, "FFFFFF74", "%0X",
-__LINE__, 0x00000000, "0", "%d",
-__LINE__, -0x000007b, "-123 ", "%-7.d",
-__LINE__, -0x000002c, "-44", "%d",
-__LINE__, -0x000002b, " -43", "%5d",
-__LINE__, 0x0000ae5f, "44639", "%d",
-__LINE__, 0x003cbc63, "3CBC63", "%X",
-__LINE__, 0xfffffffc, "0XFFFFFFFC", "%#5.7X",
-__LINE__, 0x0003e044, "3E044", "%X",
-__LINE__, -0x0000c46, "-3142", "%.1d",
-__LINE__, 0xff18f4bb, "FF18F4BB", "%0X",
-__LINE__, 0xfffffffd, "FFFFFFFD", "%.1X",
-__LINE__, -0x01c0f27, "-1838887", "%0d",
-__LINE__, -0x1242901f, "-306352159", "%.4ld",
-__LINE__, 0x1775c10a, "393593098", "%6.ld",
-__LINE__, 0x00000001, " 1", "%03.d",
-__LINE__, 0xfff1fd30, "0xfff1fd30", "%#x",
-__LINE__, 0x00000191, "191", "%0.X",
-__LINE__, 0x2e597178, "777613688", "%2.ld",
-__LINE__, -0x4ef0cf3, "-82775283", "%+.6ld",
-__LINE__, -0x0000085, " -133", "%6.d",
-__LINE__, 0x0000014d, "333 ", "%-5ld",
-__LINE__, -0xc03bd74, "-201571700", "%07.6ld",
-__LINE__, -0x000000a, "-10", "%d",
-__LINE__, 0x01f5e86e, "32893038", "%#2.ld",
-__LINE__, 0x00000033, "0X33", "% #X",
-__LINE__, 0x0087c797, " 8898455", "% 7.d",
-__LINE__, -0x0001205, "-4613", "%5d",
-__LINE__, 0x00000192, " 192", "%7.X",
-__LINE__, 0x000e6c00, "945152", "%6.1ld",
-__LINE__, 0x00018629, " 99881", "% d",
-__LINE__, -0x04739c6, "-4667846", "%-01.3ld",
-__LINE__, 0x00001f42, "8002", "%d",
-__LINE__, 0x00000caf, "3247", "%d",
-__LINE__, -0x4992e24, "-77147684", "%#.6d",
-__LINE__, 0x0000001d, "1d", "%-0x",
-__LINE__, 0x14d79f03, "349675267", "%0ld",
-__LINE__, 0x00000dd4, " 03540", "%#6.5ld",
-__LINE__, 0x0005f30e, "0X5F30E", "%#X",
-__LINE__, 0x00000157, "157", "%X",
-__LINE__, -0x9281698, "-153622168", "%d",
-__LINE__, -0x000004a, "-74", "%d",
-__LINE__, -0x0010c9e, "-68766", "%-0d",
-__LINE__, 0x00000059, "00089", "%.5ld",
-__LINE__, -0x06959e3, "-6904291", "% 4.d",
-__LINE__, 0xfbea12b1, "0XFBEA12B1", "%+#X",
-__LINE__, 0xffffdfb1, "FFFFDFB1", "%2.6X",
-__LINE__, 0x0434faac, "434faac", "%.5x",
-__LINE__, 0xffffffff, "ffffffff", "% x",
-__LINE__, 0x00000b32, "B32", "%0X",
-__LINE__, 0x00000047, "71", "%.1d",
-__LINE__, 0x00070bef, " 0461807", "% .7d",
-__LINE__, 0x00000038, "38", "% 0x",
-__LINE__, 0x00000000, " 0", "%6X",
-__LINE__, 0xfff9c011, "FFF9C011", "%2X",
-__LINE__, 0xfffffffe, "fffffffe", "%7x",
-__LINE__, 0xfffffff9, "FFFFFFF9", "%X",
-__LINE__, -0x016a095, "-1482901", "%4.0ld",
-__LINE__, -0x000001c, "-28", "% ld",
-__LINE__, 0xfffd6133, "0xfffd6133", "%#x",
-__LINE__, 0x000004a4, "0x4a4", "%#x",
-__LINE__, 0x000003c2, "0962", "%.4d",
-__LINE__, -0x000323b, "-12859", "%+#d",
-__LINE__, 0x0f620237, "F620237", "%X",
-__LINE__, 0x00007863, "007863", "%.6X",
-__LINE__, 0x0000002c, " 44", "% #ld",
-__LINE__, 0xfffffff0, "fffffff0", "%03.6x",
-__LINE__, 0xffff6346, "FFFF6346", "%1.X",
-__LINE__, 0x00063188, "63188", "% x",
-__LINE__, 0xfffff91c, "fffff91c", "%-.3x",
-__LINE__, 0x004cd0b4, "4CD0B4", "%-2.X",
-__LINE__, 0x06b4d739, "112514873", "%0.1d",
-__LINE__, -0x0009beb, "-39915", "%.2d",
-__LINE__, 0x0000831b, "33563", "%d",
-__LINE__, 0x00000001, "1", "%X",
-__LINE__, -0x942d76b, "-155375467", "% #0ld",
-__LINE__, 0xffff2a95, "FFFF2A95", "%2X",
-__LINE__, 0x00548d5e, "5541214", "%.3ld",
-__LINE__, 0x0b5e1a01, "B5E1A01", "% .7X",
-__LINE__, 0xfffffc22, "fffffc22", "%6x",
-__LINE__, -0x0000dd7, "-3543", "%-.3ld",
-__LINE__, 0xfffff834, "FFFFF834", "%X",
-__LINE__, 0x0365f762, "57014114", "%ld",
-__LINE__, -0x0000003, "-3", "%d",
-__LINE__, 0x3bd998a3, "1004116131", "%d",
-__LINE__, 0xfffff6c9, "FFFFF6C9", "%+X",
-__LINE__, 0xffffded9, "FFFFDED9", "%-.1X",
-__LINE__, -0x00fbb5a, "-1031002", "% 1.0d",
-__LINE__, 0xffffffb7, "ffffffb7", "%6.x",
-__LINE__, 0xff1b8ac3, "FF1B8AC3", "%-X",
-__LINE__, 0xfffffff2, "FFFFFFF2", "%00.X",
-__LINE__, -0x000013d, " -317", "%05.d",
-__LINE__, 0x0000f5e2, "+62946", "%+0.2ld",
-__LINE__, 0x16ac6358, "16ac6358", "%x",
-__LINE__, 0xffff8728, "FFFF8728", "%+X",
-__LINE__, -0x0014a6d, "-084589", "%0.6ld",
-__LINE__, 0xfc904514, "FC904514", "%+0X",
-__LINE__, 0x00000004, "4", "%ld",
-__LINE__, 0xffffffe0, "ffffffe0", "%+x",
-__LINE__, -0x0a0ffdd, "-10551261", "%+02d",
-__LINE__, -0x0000bbc, "-3004", "%+d",
-__LINE__, 0x00000006, " +6", "%+7ld",
-__LINE__, 0x17afa6e5, "397387493", "%ld",
-__LINE__, 0xfffff6bf, "fffff6bf", "%+04.4x",
-__LINE__, 0x000001dc, "01dc", "% 02.4x",
-__LINE__, 0x0000000e, " 14", "% d",
-__LINE__, 0xfffffff9, "0XFFFFFFF9", "%#4.X",
-__LINE__, 0x0000005d, "93", "%0d",
-__LINE__, -0x004fa05, "-0326149", "%.7d",
-__LINE__, -0x0000018, "-24", "%ld",
-__LINE__, 0xfffff7eb, "FFFFF7EB", "%X",
-__LINE__, 0x0072b044, " 7516228", "% .7ld",
-__LINE__, 0xffffffed, "0xffffffed", "%#x",
-__LINE__, 0x0010364d, "10364D", "%X",
-__LINE__, 0xfff90469, "0XFFF90469", "%#X",
-__LINE__, 0x000001b4, " 436", "% 0d",
-__LINE__, 0x00000000, "0", "% X",
-__LINE__, 0xfffffff3, "fffffff3", "%x",
-__LINE__, 0x19335d40, "19335d40", "%6x",
-__LINE__, 0x00039c24, "236580", "%ld",
-__LINE__, 0x000021f7, "8695", "%0.4ld",
-__LINE__, -0x057b406, "-5747718", "%d",
-__LINE__, -0x017b371, "-1553265", "%#ld",
-__LINE__, 0x0003e405, "254981", "%2.d",
-__LINE__, 0x00000001, "1", "%-.1x",
-__LINE__, 0x000000ae, "AE", "%.1X",
-__LINE__, 0xffd85825, "ffd85825", "%-7.x",
-__LINE__, 0xfffad763, "fffad763", "%x",
-__LINE__, 0x002431d4, "2372052", "%6.ld",
-__LINE__, 0x00000003, "000003", "%-05.6d",
-__LINE__, 0xffffffeb, "0xffffffeb", "%#x",
-__LINE__, 0xff8cf3b0, "ff8cf3b0", "%x",
-__LINE__, 0xfe88d2ff, "0xfe88d2ff", "%+#.2x",
-__LINE__, 0xffffff6b, "ffffff6b", "%6.3x",
-__LINE__, 0xfffffffe, "fffffffe", "%-x",
-__LINE__, 0xe998945a, "e998945a", "%2.x",
-__LINE__, 0x03b9c50f, "3B9C50F", "%+X",
-__LINE__, 0xffffffff, "FFFFFFFF", "%3.7X",
-__LINE__, 0x000024ef, "24ef", "%+x",
-__LINE__, 0xfffffc04, "FFFFFC04", "%X",
-__LINE__, 0x0d4bef7c, " 223080316", "% .1ld",
-__LINE__, -0xc33f3bc, "-204731324", "%.5ld",
-__LINE__, 0xffffffff, "0XFFFFFFFF", "%#2X",
-__LINE__, 0x0000e493, "e493", "%x",
-__LINE__, 0x000001b4, "1b4", "%x",
-__LINE__, 0xffffffd6, "0xffffffd6", "% #1x",
-__LINE__, 0x00000001, "1", "%d",
-__LINE__, -0x0000f28, "-3880", "%ld",
-__LINE__, 0x00000277, "631", "%-1ld",
-__LINE__, 0x00000001, " 1", "%2x",
-__LINE__, -0x0ff4d2c, "-16731436", "%#ld",
-__LINE__, 0x0bb80344, "196608836", "%00ld",
-__LINE__, 0xffffffdc, "FFFFFFDC", "%X",
-__LINE__, 0x00000484, "1156", "%ld",
-__LINE__, 0x00000341, "341", "%-.2x",
-__LINE__, 0x0000ee62, "ee62", "%x",
-__LINE__, 0xfffffe20, "fffffe20", "%+x",
-__LINE__, -0x00076eb, "-30443", "%.2d",
-__LINE__, 0x2c4a7407, "2c4a7407", "% x",
-__LINE__, 0x00000000, " ", "%3.X",
-__LINE__, 0xffffff60, "ffffff60", "% 4.x",
-__LINE__, 0x000e4cf2, "+937202", "%+.5ld",
-__LINE__, 0x00000008, " 00008", "%06.5X",
-__LINE__, 0x0002f612, "194066", "%d",
-__LINE__, 0xfffffc96, "fffffc96", "%-3.3x",
-__LINE__, -0x0000001, "-1", "% ld",
-__LINE__, 0x00000000, " ", "% 6.0X",
-__LINE__, 0xfffffff5, "fffffff5", "%3.x",
-__LINE__, 0x0bfd63a1, "201155489", "%d",
-__LINE__, -0x1547c214, "-357024276", "%ld",
-__LINE__, 0x00000004, "4", "%#0.d",
-__LINE__, -0x000f2f3, "-62195", "%.2d",
-__LINE__, 0xfff843dd, "FFF843DD", "%X",
-__LINE__, 0x00966e36, "9858614", "%.0ld",
-__LINE__, 0x0000782e, "0X782E", "% #X",
-__LINE__, 0x00bd36c0, "12400320", "%ld",
-__LINE__, 0x00000000, "00", "% .2X",
-__LINE__, 0x00000000, "0", "%1X",
-__LINE__, 0x0003f416, "3f416 ", "%-6.x",
-__LINE__, -0x00b74bd, "-750781", "% ld",
-__LINE__, 0x0000138a, "138a", "% x",
-__LINE__, 0x024df7f0, "24DF7F0", "% 0.6X",
-__LINE__, 0xfffffffc, "FFFFFFFC", "%X",
-__LINE__, -0x0003284, "-12932 ", "%-07.ld",
-__LINE__, 0x000094d3, "94d3", "%x",
-__LINE__, 0x000000bf, "bf", "%.2x",
-__LINE__, 0x00000000, "00000", "%-1.5X",
-__LINE__, -0x04899b8, "-4757944", "%d",
-__LINE__, 0x2b51bf20, "+726777632", "%+d",
-__LINE__, -0x000000d, "-13", "%.2d",
-__LINE__, 0x04f78fbd, "4F78FBD", "% 7.X",
-__LINE__, 0x00011684, "71300", "%5.d",
-__LINE__, 0x0000539d, "21405", "%0d",
-__LINE__, 0x00000008, "000008", "%-3.6X",
-__LINE__, 0xfc7a2cdc, "fc7a2cdc", "%2.3x",
-__LINE__, 0xffc21da1, "ffc21da1", "%x",
-__LINE__, 0x00000273, "273", "%x",
-__LINE__, 0x00000000, "0", "%#X",
-__LINE__, -0x31cd6b9, "-52221625", "% d",
-__LINE__, 0xfffffff8, "FFFFFFF8", "%.0X",
-__LINE__, 0x00000002, "2", "%#ld",
-__LINE__, 0x00e8922c, "15241772", "%d",
-__LINE__, 0xfeb19ea7, "FEB19EA7", "%0.1X",
-__LINE__, 0x00003931, "014641", "%06ld",
-__LINE__, 0x00000015, "0X00015", "%#.5X",
-__LINE__, 0xfffffffe, "FFFFFFFE", "%1.X",
-__LINE__, 0xfff17103, "0XFFF17103", "% #X",
-__LINE__, 0xfffffffc, "FFFFFFFC", "%+X",
-__LINE__, 0x00000002, "00002", "%.5x",
-__LINE__, 0x00001617, " 5655", "% 7.d",
-__LINE__, -0x0000010, "-000016", "%00.6d",
-__LINE__, 0x000000b0, "B0", "% X",
-__LINE__, 0xfc9362b2, "FC9362B2", "%-X",
-__LINE__, 0xfc3d8276, "fc3d8276", "% 1x",
-__LINE__, 0x00001405, "5125", "%#d",
-__LINE__, 0x02250183, " 35979651", "% ld",
-__LINE__, 0xffc9b007, "ffc9b007", "% 4.x",
-__LINE__, 0x00000311, "785", "%0d",
-__LINE__, 0x0004d273, " 316019", "% d",
-__LINE__, 0x00000001, "1", "%1.x",
-__LINE__, 0xffff240f, "FFFF240F", "%4.X",
-__LINE__, 0x0049cfda, "+4837338", "%+ld",
-__LINE__, 0x012f6dd5, "12F6DD5", "% 6.2X",
-__LINE__, 0x00000002, "0x2", "%#2.0x",
-__LINE__, 0xfffd834a, "FFFD834A", "%.6X",
-__LINE__, 0xfe2a40f8, "0XFE2A40F8", "%#X",
-__LINE__, 0xffffffeb, "ffffffeb", "%x",
-__LINE__, -0x00ac5cb, "-705995", "%d",
-__LINE__, -0x3021108c, "-807473292", "% .4d",
-__LINE__, -0x0000035, "-53", "%-ld",
-__LINE__, -0x1a36475, "-27485301", "% d",
-__LINE__, -0x0000011, "-17", "%d",
-__LINE__, 0x000001a3, "000419", "%.6ld",
-__LINE__, 0x0030a0a8, "3186856", "%.5ld",
-__LINE__, 0x00000019, "25", "%d",
-__LINE__, 0xf32deac1, "F32DEAC1", "%06.2X",
-__LINE__, -0x0000004, " -00004", "%7.5ld",
-__LINE__, 0x00000000, "0", "%ld",
-__LINE__, 0x0006bf19, "442137", "%#0.d",
-__LINE__, 0x566f6c44, "1450142788", "%1.6d",
-__LINE__, 0xfffffc10, "fffffc10", "%.2x",
-__LINE__, -0x000e04d, "-57421", "%+0d",
-__LINE__, 0x00000000, "0000000", "%+.7X",
-__LINE__, 0x00b5c74d, " 11913037", "% ld",
-__LINE__, -0x028dfe2, "-2678754", "%05.1d",
-__LINE__, 0xfffffee0, "fffffee0", "%0x",
-__LINE__, -0x030c077, "-3194999", "%-.6d",
-__LINE__, 0x00055ca1, "055ca1", "%-.6x",
-__LINE__, 0x00000000, " ", "%7.X",
-__LINE__, 0xfffffe3b, "FFFFFE3B", "%X",
-__LINE__, 0xffffffff, "FFFFFFFF", "% 3X",
-__LINE__, 0x00000857, "2135", "%-#1.d",
-__LINE__, -0x00546a2, "-345762", "%0.5d",
-__LINE__, 0x0000000b, "0xb ", "%-#6x",
-__LINE__, 0x00000d2b, "d2b ", "%-4.0x",
-__LINE__, 0x0ae02b9e, "AE02B9E", "%X",
-__LINE__, 0xfffffa7b, "fffffa7b", "%-2.x",
-__LINE__, 0x00000001, "1", "%X",
-__LINE__, 0x000006ad, "01709", "%05.5ld",
-__LINE__, -0x0000102, "-258", "%-0.ld",
-__LINE__, 0x00000000, "0", "%.1X",
-__LINE__, -0x01daa95, "-1944213", "%-1ld",
-__LINE__, 0x02b99040, "2B99040", "%2.X",
-__LINE__, 0x1b3d5621, "1B3D5621", "%X",
-__LINE__, 0x0312d16b, "51564907", "%-1.7ld",
-__LINE__, 0x000aa76c, " 698220", "% 2d",
-__LINE__, 0x00000000, "0", "%ld",
-__LINE__, 0xfff8a4ec, "FFF8A4EC", "%-X",
-__LINE__, 0xffffe06d, "ffffe06d", "%x",
-__LINE__, 0x00000003, "3", "% x",
-__LINE__, 0x00000000, "0", "%x",
-__LINE__, 0xd3e244dd, "D3E244DD", "%+5X",
-__LINE__, 0x000028b3, " 28b3", "% 5.x",
-__LINE__, 0x0001aceb, "109803", "%6d",
-__LINE__, 0xfffbc5ca, "0xfffbc5ca", "%-#5x",
-__LINE__, 0x00000097, " 151", "% 7ld",
-__LINE__, 0x00001fcc, "+8140", "%+d",
-__LINE__, 0xffffffff, "ffffffff", "%0x",
-__LINE__, -0x00052a9, "-21161", "%ld",
-__LINE__, 0xfffffc76, "FFFFFC76", "%.1X",
-__LINE__, -0x2acb012, "-44871698", "%0.1ld",
-__LINE__, 0xffffff81, "ffffff81", "%x",
-__LINE__, -0x0018394, "-99220", "%-ld",
-__LINE__, 0x0000001b, "1B", "%X",
-__LINE__, 0x00000033, "51", "%1d",
-__LINE__, 0xffec37e5, "FFEC37E5", "%-1X",
-__LINE__, -0x000000a, " -10", "%#5.d",
-__LINE__, -0x0000412, "-1042", "%ld",
-__LINE__, 0x000cd0b1, "cd0b1 ", "%-7.5x",
-__LINE__, 0x0b445370, "B445370", "%+2.0X",
-__LINE__, 0xfffffff3, "0XFFFFFFF3", "%-#X",
-__LINE__, 0xffff9f33, "FFFF9F33", "%5.X",
-__LINE__, 0x00010a1e, "10A1E", "%-2X",
-__LINE__, -0xede156f, "-249435503", "% 7.1ld",
-__LINE__, 0xfc6d63aa, "fc6d63aa", "% .6x",
-__LINE__, 0x0000311c, " 12572", "% ld",
-__LINE__, 0x00001f8a, "8074", "%00.d",
-__LINE__, 0x00000199, "199", "%-X",
-__LINE__, 0xfffffc60, "FFFFFC60", "%+3X",
-__LINE__, -0x000022c, "-556", "%+0ld",
-__LINE__, 0x021d8407, "35488775", "%-#.7ld",
-__LINE__, 0x0000020f, "527", "%d",
-__LINE__, -0x000064b, "-1611", "%#ld",
-__LINE__, -0x0c15aef, "-12671727", "%d",
-__LINE__, -0x1f1a6881, "-521824385", "%ld",
-__LINE__, 0xffffc115, "ffffc115", "% x",
-__LINE__, 0x00000017, " 23", "% #ld",
-__LINE__, 0x00000dc1, "DC1 ", "%-4X",
-__LINE__, 0x000002ca, "2CA", "%X",
-__LINE__, 0x000f052c, " 984364", "%7.d",
-__LINE__, 0x0000005a, "0090", "%0.4d",
-__LINE__, -0x001e463, "-124003", "% 4.ld",
-__LINE__, 0x00000001, "0000001", "%+.7X",
-__LINE__, 0x00000bfb, "0000bfb", "%5.7x",
-__LINE__, 0x0002484b, "149579", "%#1d",
-__LINE__, 0x0043ba18, "4438552", "%-ld",
-__LINE__, 0x000078f8, "0X78F8", "%#X",
-__LINE__, 0x00000001, " 1", "%4d",
-__LINE__, 0x0cedaeed, "CEDAEED", "%X",
-__LINE__, 0x00000003, "+3", "%+ld",
-__LINE__, 0xfffffffb, "FFFFFFFB", "%7.4X",
-__LINE__, 0x00000169, "361", "%ld",
-__LINE__, 0x00003c7a, "+15482", "%+ld",
-__LINE__, -0x0159d93, "-1416595", "% 0.0d",
-__LINE__, 0x0000775c, "+30556", "%+3.d",
-__LINE__, 0x10284768, "+271075176", "%+0.0ld",
-__LINE__, -0xf8b610e, "-260792590", "%0d",
-__LINE__, 0xfdd8d369, "fdd8d369", "%-.3x",
-__LINE__, 0x000c9495, "+824469", "%+ld",
-__LINE__, -0x000003f, " -063", "%7.3d",
-__LINE__, -0x000073b, "-1851", "%+03.ld",
-__LINE__, 0xfffe4e23, "0xfffe4e23", "%#.5x",
-__LINE__, 0x0081788c, "81788c", "%5x",
-__LINE__, -0x015f888, "-1439880", "%+1d",
-__LINE__, -0x31d64b4, "-52257972", "%0.2d",
-__LINE__, 0xffffffff, "FFFFFFFF", "%6.5X",
-__LINE__, -0x0000072, "-114", "%+.1d",
-__LINE__, -0x00000e1, "-225", "%ld",
-__LINE__, 0x000006a8, "0x6a8", "%+#x",
-__LINE__, 0xfffe673a, "fffe673a", "%01.x",
-__LINE__, 0xfff2ee0d, "FFF2EE0D", "%-X",
-__LINE__, 0x0290320a, "43004426", "%0ld",
-__LINE__, -0xeb7a832, "-246917170", "% ld",
-__LINE__, 0x02ae9265, "2ae9265", "%1.x",
-__LINE__, 0xffffffd2, "ffffffd2", "%+2.x",
-__LINE__, 0x00e6e858, "0xe6e858", "%#0.x",
-__LINE__, 0x00000c4a, "+3146", "%+3.1d",
-__LINE__, -0x6943c1a, "-110378010", "% 0ld",
-__LINE__, 0x0167b119, "167b119", "%0x",
-__LINE__, 0xfffffffe, "fffffffe", "%+x",
-__LINE__, 0xfffffffe, "FFFFFFFE", "%X",
-__LINE__, 0x000b861e, "755230", "%ld",
-__LINE__, 0x0000015b, "347", "%-#ld",
-__LINE__, 0xfffffffa, "0XFFFFFFFA", "%#X",
-__LINE__, 0x000de9e5, "911845", "%d",
-__LINE__, 0x00000001, "01", "%.2d",
-__LINE__, 0x000007a5, "1957", "%0d",
-__LINE__, 0x0000000f, "f", "%x",
-__LINE__, 0x00c38cbf, " 12815551", "% .2d",
-__LINE__, -0x7bd1b6e, "-129833838", "% d",
-__LINE__, -0x000013c, "-316", "%0d",
-__LINE__, 0x00001aad, "1AAD", "%-0X",
-__LINE__, 0x0034f903, "3471619", "%00d",
-__LINE__, 0xff925717, "ff925717", "%4x",
-__LINE__, 0x00000002, "02", "%.2d",
-__LINE__, 0x00000f34, "F34", "%+X",
-__LINE__, 0xffffeefe, "FFFFEEFE", "%X",
-__LINE__, 0xfffeecb4, "FFFEECB4", "% 2.X",
-__LINE__, 0x00034421, "214049", "%0ld",
-__LINE__, 0x00000000, " 0", "%+6X",
-__LINE__, -0x0000062, "-98", "%-#2d",
-__LINE__, -0x0000557, "-1367", "%-4.4d",
-__LINE__, 0xffffe17c, "FFFFE17C", "%X",
-__LINE__, 0x00000097, "00097", "%.5X",
-__LINE__, 0xfffcb278, "FFFCB278", "%0.7X",
-__LINE__, -0x0000001, "-0001 ", "%-7.4d",
-__LINE__, -0x0000001, "-1", "%ld",
-__LINE__, 0x000002c4, "708", "%d",
-__LINE__, 0x04946f45, "4946F45", "%-2.X",
-__LINE__, 0x000000ff, "00ff", "% 2.4x",
-__LINE__, 0x00073307, "471815", "%3ld",
-__LINE__, 0x0085b7b6, "+8763318", "%+ld",
-__LINE__, -0x0000002, "-2", "%1ld",
-__LINE__, -0x0000001, "-1", "%-2d",
-__LINE__, -0x00000b5, " -181", "%7ld",
-__LINE__, -0x0412486, "-4269190", "%+2.1ld",
-__LINE__, 0xffffffff, "ffffffff", "%0x",
-__LINE__, 0x0000006d, "6d", "%x",
-__LINE__, 0x000000da, "218", "%-.3ld",
-__LINE__, 0xfffffcfe, "fffffcfe", "%x",
-__LINE__, 0x652e60c7, "652E60C7", "%7.7X",
-__LINE__, 0x00000035, " 53", "% #2d",
-__LINE__, 0x000000fc, "FC", "%-X",
-__LINE__, 0x00000019, " 25", "% ld",
-__LINE__, 0xfffffcf4, "fffffcf4", "%6x",
-__LINE__, 0xffffff41, "ffffff41", "%x",
-__LINE__, 0x00000034, " 52", "%3.ld",
-__LINE__, 0xffffffb2, "ffffffb2", "%-x",
-__LINE__, -0x6dc43e7c, "-1841577596", "% .2ld",
-__LINE__, 0x00000004, "4", "%d",
-__LINE__, -0x000023b, "-571", "%ld",
-__LINE__, -0x000004d, "-77", "%ld",
-__LINE__, 0x0000e3ba, "58298", "%.0ld",
-__LINE__, 0xfffffff2, "fffffff2", "%0.0x",
-__LINE__, -0x0000020, "-32", "%ld",
-__LINE__, 0xffffb33e, "0XFFFFB33E", "%-#X",
-__LINE__, 0x00000000, " ", "% 4.x",
-__LINE__, 0xffd96f92, "FFD96F92", "%X",
-__LINE__, 0x0000002e, " 46", "% 0ld",
-__LINE__, 0xffffffff, "ffffffff", "%x",
-__LINE__, -0x5008ba3, "-83921827", "%+d",
-__LINE__, 0xfdc1df3d, "FDC1DF3D", "%0X",
-__LINE__, 0xfc7410e5, "fc7410e5", "%7x",
-__LINE__, 0xfffffffa, "FFFFFFFA", "% 6.X",
-__LINE__, 0x00000000, "0", "%X",
-__LINE__, -0x040fd4e, "-4259150", "% 05.d",
-__LINE__, 0x0000003b, " 59", "%3.2d",
-__LINE__, 0xff776dd8, "ff776dd8", "%x",
-__LINE__, 0x0000055b, "+1371", "%+#2d",
-__LINE__, 0x00004841, "4841", "%.1x",
-__LINE__, 0x0229d710, "36296464", "%-.2ld",
-__LINE__, 0x00000000, "0", "%x",
-__LINE__, 0xfffe8376, "fffe8376", "%0x",
-__LINE__, 0x000a7b83, "a7b83", "%x",
-__LINE__, 0x0000000d, " 013", "%#7.3d",
-__LINE__, 0xffffffff, "FFFFFFFF", "%5.0X",
-__LINE__, 0x00000704, " 0x704", "%#7.0x",
-__LINE__, 0xfff970b9, "FFF970B9", "%.1X",
-__LINE__, -0x000b60a, "-46602", "%+d",
-__LINE__, 0x00000000, " 00000", "%6.5x",
-__LINE__, 0x00000003, "3", "%X",
-__LINE__, 0x0000c14b, "c14b", "%0x",
-__LINE__, 0x066d7860, "107837536", "%-d",
-__LINE__, 0x00000013, " 13", "%4.x",
-__LINE__, 0xfff96f18, "FFF96F18", "%4X",
-__LINE__, 0xffffff30, "FFFFFF30", "%X",
-__LINE__, 0xffffffff, "FFFFFFFF", "% .7X",
-__LINE__, -0x72a9e985, "-1923737989", "%2.d",
-__LINE__, 0x00000002, "0x2", "%#x",
-__LINE__, 0x0000050e, "50e", "%2.3x",
-__LINE__, 0x0000605c, "24668", "%4.1d",
-__LINE__, 0xffffff3e, "ffffff3e", "%x",
-__LINE__, -0x0000010, "-16", "%-2d",
-__LINE__, 0x000061aa, "61AA", "%X",
-__LINE__, 0x000c2ec3, "C2EC3", "%0X",
-__LINE__, -0x0000001, "-1", "%-0d",
-__LINE__, 0x00130e17, "+1248791", "%+.6ld",
-__LINE__, 0x000000ef, "EF", "%-X",
-__LINE__, -0x0000001, " -1", "%+5ld",
-__LINE__, 0x0000989d, "39069", "%d",
-__LINE__, 0x00000000, "0", "%-x",
-__LINE__, 0x00000417, "417", "%X",
-__LINE__, 0x00005e86, "5E86", "%+X",
-__LINE__, -0x0007c08, "-31752", "%ld",
-__LINE__, 0x00da8e0f, "DA8E0F", "%2.2X",
-__LINE__, -0x3ee095ec, "-1054905836", "% 0d",
-__LINE__, 0xfffdb5a3, "fffdb5a3", "%x",
-__LINE__, 0xffffff83, "FFFFFF83", "%X",
-__LINE__, 0xfff8efd7, "0xfff8efd7", "%#x",
-__LINE__, 0x00000020, " 32", "% d",
-__LINE__, 0xfff7c002, "fff7c002", "%.7x",
-__LINE__, -0x0000001, "-1", "%ld",
-__LINE__, 0x00000000, " 000", "%05.3X",
-__LINE__, 0xfff190ee, "FFF190EE", "%X",
-__LINE__, 0x00000a6c, " 2668", "%#6.ld",
-__LINE__, 0x00037024, "37024", "%x",
-__LINE__, 0xfffec37f, "FFFEC37F", "%X",
-__LINE__, 0x007ee9bb, "8317371", "%#0.ld",
-__LINE__, 0x00000122, "290", "%ld",
-__LINE__, -0x0013b5f, "-80735", "%ld",
-__LINE__, 0xfffffff6, "FFFFFFF6", "%X",
-__LINE__, -0x0000c16, "-0003094", "%-00.7d",
-__LINE__, -0x00010ed, "-4333", "%ld",
-__LINE__, 0x00000007, " 0X007", "%#6.3X",
-__LINE__, 0x0053781e, " 5470238", "% 2d",
-__LINE__, 0xffff03e9, "0XFFFF03E9", "%+#7.3X",
-__LINE__, 0xfffffdc2, "0xfffffdc2", "% #4.x",
-__LINE__, -0x00018e1, "-6369", "%d",
-__LINE__, 0xf3a4abc6, "F3A4ABC6", "%-.2X",
-__LINE__, 0xfff64a27, "FFF64A27", "%7.7X",
-__LINE__, 0x00195ae5, "195AE5", "%+03.X",
-__LINE__, 0xfff8849a, "fff8849a", "%.1x",
-__LINE__, -0x001b045, "-110661", "%+ld",
-__LINE__, 0x01e8a106, "32022790", "%7.ld",
-__LINE__, 0x0008ee94, "8EE94", "%X",
-__LINE__, 0xfffcdabc, "FFFCDABC", "%X",
-__LINE__, 0xfda75cd2, "fda75cd2", "%x",
-__LINE__, 0x00fd505a, "fd505a", "%x",
-__LINE__, 0x00003748, "3748", "%+x",
-__LINE__, 0xffffffe5, "ffffffe5", "% 3.6x",
-__LINE__, -0x1d1c4045, "-488390725", "%d",
-__LINE__, 0xfffffff9, "0xfffffff9", "%#x",
-__LINE__, -0x0000001, "-1", "%-#ld",
-__LINE__, 0x00000191, "191", "%X",
-__LINE__, 0xfffffffe, "FFFFFFFE", "%-X",
-__LINE__, -0x0000006, "-6", "%ld",
-__LINE__, 0x00000033, " 33", "% 4x",
-__LINE__, -0x0159a14, "-1415700", "% ld",
-__LINE__, 0x000001c3, "00001c3", "%07x",
-__LINE__, 0xffffe9e2, "ffffe9e2", "%-x",
-__LINE__, 0x5b19abd9, "0x5b19abd9", "%-#x",
-__LINE__, 0xffff1bae, "0xffff1bae", "%#x",
-__LINE__, 0x00000001, "+1", "%+d",
-__LINE__, 0x006a23c7, "6A23C7", "%2.X",
-__LINE__, 0x000008a4, " 8a4", "% 4.1x",
-__LINE__, 0xfffffcd9, "fffffcd9", "%.1x",
-__LINE__, 0x0000121b, "121B", "%X",
-__LINE__, 0x001231aa, "1192362", "%7.d",
-__LINE__, -0x008026d, "-524909", "%4.2d",
-__LINE__, 0x192ea594, "422487444", "%ld",
-__LINE__, 0x0001a800, "108544", "%0d",
-__LINE__, 0x000062f1, "62f1", "%.4x",
-__LINE__, 0xff8b39b0, "ff8b39b0", "% x",
-__LINE__, 0x00000001, "0x1", "%+#x",
-__LINE__, 0x0000144a, "5194", "%ld",
-__LINE__, 0x00002599, "9625", "%d",
-__LINE__, 0xffa0a2ef, "ffa0a2ef", "%0x",
-__LINE__, 0xff6712e1, "FF6712E1", "%0X",
-__LINE__, 0x0007ebb3, "519091", "%1ld",
-__LINE__, 0x0000000f, "15 ", "%-4.ld",
-__LINE__, -0x0000096, "-150", "%2.ld",
-__LINE__, 0x0000004f, "4F", "%.2X",
-__LINE__, 0xfffffc29, "fffffc29", "%-4.x",
-__LINE__, 0x00000019, "19", "%x",
-__LINE__, 0x00000c4e, "c4e", "%x",
-__LINE__, 0x0000006b, " 0006B", "%6.5X",
-__LINE__, 0x00c8d2c6, "c8d2c6", "%.0x",
-__LINE__, -0x256fb8de, "-628078814", "%ld",
-__LINE__, 0x4f51fcf4, "4F51FCF4", "%+X",
-__LINE__, 0x000f000e, "983054", "%1.ld",
-__LINE__, 0xfffff03f, "fffff03f", "%x",
-__LINE__, 0x0000001d, " 1D", "%05.X",
-__LINE__, 0x0072ea14, "72ea14", "%x",
-__LINE__, -0xc6098b9, "-207657145", "%-7d",
-__LINE__, 0x00000a76, "2678", "%3ld",
-__LINE__, 0xfff84db3, "FFF84DB3", "%X",
-__LINE__, 0x0fb52870, "fb52870", "%+x",
-__LINE__, 0x08bc170a, "0x8bc170a", "%#x",
-__LINE__, 0xfffeeb00, "fffeeb00", "%0.5x",
-__LINE__, 0x000ece95, "970389", "%d",
-__LINE__, 0x00000000, "0", "%0X",
-__LINE__, 0x07f98e8a, "7f98e8a", "% x",
-__LINE__, 0x000499eb, " 499eb", "% 6.x",
-__LINE__, 0xffffffff, "FFFFFFFF", "%-X",
-__LINE__, 0x0aa45e86, "178544262", "%#.2d",
-__LINE__, 0xff73387d, "FF73387D", "%03.X",
-__LINE__, 0xfffffb51, "FFFFFB51", "%.3X",
-__LINE__, 0xffffffdc, "ffffffdc", "%6.x",
-__LINE__, 0xffffffed, "FFFFFFED", "%-X",
-__LINE__, 0x0001c4c2, "1c4c2", "%0.3x",
-__LINE__, -0x0000001, "-0000001", "%-#.7d",
-__LINE__, 0x00000007, "7", "%0.x",
-__LINE__, 0x00000001, "1", "%ld",
-__LINE__, 0xffffd000, "ffffd000", "%4.3x",
-__LINE__, 0x00000030, "48", "%2.d",
-__LINE__, -0x6c121ce, "-113320398", "%.5ld",
-__LINE__, 0x000001ed, "1ED", "% 3.X",
-__LINE__, 0xfffff0f3, "FFFFF0F3", "%+.6X",
-__LINE__, 0xffffffec, "ffffffec", "%x",
-__LINE__, 0x002d5ab8, "0x2d5ab8", "%-#x",
-__LINE__, 0x0026acff, "2534655", "%0ld",
-__LINE__, 0x01d90cd7, "+31001815", "%+.2ld",
-__LINE__, -0x1f7abc0, "-33008576", "%7.6d",
-__LINE__, 0xfc5babcc, "fc5babcc", "%x",
-__LINE__, -0x9b74892, "-163006610", "% .6d",
-__LINE__, 0x03931d84, "59972996", "%0.d",
-__LINE__, 0x07d261ce, "131228110", "%#ld",
-__LINE__, 0x00000000, "0", "%x",
-__LINE__, 0x00000002, "2", "%+X",
-__LINE__, -0x0000604, "-1540", "%+d",
-__LINE__, 0x00000000, " ", "%7.x",
-__LINE__, 0x00000001, "1", "%.0X",
-__LINE__, -0x0005a8e, "-23182", "% d",
-__LINE__, 0x03fb2730, "3fb2730", "%7.x",
-__LINE__, 0xffffff03, "ffffff03", "%x",
-__LINE__, 0x00000000, " ", "%-#3.d",
-__LINE__, 0x04025a4b, "0X4025A4B", "%+#X",
-__LINE__, -0x0000001, " -1", "%4.d",
-__LINE__, 0xfffe00a3, "FFFE00A3", "%+X",
-__LINE__, -0x1b26e3c8, "-455533512", "% ld",
-__LINE__, 0x000017e5, "6117", "%d",
-__LINE__, -0x0e4f3b6, "-15004598", "%0ld",
-__LINE__, 0x00000034, "52", "%ld",
-__LINE__, 0x0000024c, " 24C", "%4X",
-__LINE__, 0xfffedf65, "FFFEDF65", "%-0X",
-__LINE__, -0x000ff1f, "-65311", "%+#d",
-__LINE__, 0x00000007, " 7", "%7.x",
-__LINE__, 0x018656ae, "18656ae", "%3.7x",
-__LINE__, -0x0000004, "-4", "%d",
-__LINE__, 0x7081292d, "1887512877", "%d",
-__LINE__, 0x87d3e48c, "87d3e48c", "%-x",
-__LINE__, 0xf99c516e, "0xf99c516e", "% #7.4x",
-__LINE__, 0xfffffffa, "FFFFFFFA", "%-1X",
-__LINE__, -0x000001d, "-29", "%#ld",
-__LINE__, -0x0000001, "-1", "%+ld",
-__LINE__, 0x28ab3350, " 682308432", "% 1d",
-__LINE__, -0x0000006, "-6", "%ld",
-__LINE__, 0xfffffffb, "FFFFFFFB", "%.5X",
-__LINE__, -0x0000007, "-7", "%#d",
-__LINE__, -0x0000328, " -808", "%6.ld",
-__LINE__, -0x29386f00, "-691564288", "%.3d",
-__LINE__, -0x059f38a, "-5895050", "%.4ld",
-__LINE__, 0xfffff888, "FFFFF888", "%3X",
-__LINE__, 0xffffffdf, "ffffffdf", "%0.0x",
-__LINE__, -0xb4fc354, "-189776724", "%2d",
-__LINE__, 0x00058c07, "363527", "%1.d",
-__LINE__, 0x0a256162, "a256162", "%x",
-__LINE__, -0x05c87b0, "-6064048", "%0ld",
-__LINE__, 0xfffffda1, "fffffda1", "%x",
-__LINE__, 0x000034b7, "13495", "%d",
-__LINE__, -0x6d1a8918, "-1830455576", "%.1d",
-__LINE__, 0x00022290, "139920", "%05ld",
-__LINE__, 0x00000000, "0", "%-x",
-__LINE__, -0x1f8eafce, "-529444814", "%4.d",
-__LINE__, -0x7bf32808, "-2079533064", "% ld",
-__LINE__, 0x0000023c, "23c", "% x",
-__LINE__, 0x00000039, "39", "%X",
-__LINE__, -0x000556d, "-21869", "%ld",
-__LINE__, -0x00000ca, "-202", "%ld",
-__LINE__, 0x00002e28, "11816", "%-d",
-__LINE__, 0x00000011, "17", "%-ld",
-__LINE__, 0xfffffffb, "FFFFFFFB", "%-X",
-__LINE__, 0xfffdd67f, "0XFFFDD67F", "%#X",
-__LINE__, -0x000003d, "-61", "%d",
-__LINE__, 0x0000bfce, "0XBFCE", "%-#5.2X",
-__LINE__, 0xfffffffc, "fffffffc", "%x",
-__LINE__, -0x00aea17, "-715287", "%.5d",
-__LINE__, -0x02fce89, "-3133065", "%0d",
-__LINE__, 0x007f6ed1, "7F6ED1", "%6X",
-__LINE__, 0xffffffff, "FFFFFFFF", "%X",
-__LINE__, -0x0002761, "-10081", "%#6.2d",
-__LINE__, 0x003be8d8, "3BE8D8", "%-X",
-__LINE__, 0x00000901, " 2305", "%6.d",
-__LINE__, 0x00049916, "0301334", "%3.7ld",
-__LINE__, 0x0678ffea, "0X678FFEA", "%#4X",
-__LINE__, 0xffffffff, "ffffffff", "%+.0x",
-__LINE__, -0x31d2ec61, "-835906657", "%.0d",
-__LINE__, 0xfffffffc, "FFFFFFFC", "%0X",
-__LINE__, -0x0015588, "-87432", "%d",
-__LINE__, 0xffffff3e, "ffffff3e", "%.4x",
-__LINE__, 0x0000000a, "10", "%d",
-__LINE__, -0x0000003, "-3", "%2.1ld",
-__LINE__, -0x000d29a, "-53914", "%ld",
-__LINE__, -0x04ccbe0, "-5032928", "%2.2ld",
-__LINE__, 0x0357c2a5, "357c2a5", "% 7.x",
-__LINE__, 0x00000009, " 9", "% 1.ld",
-__LINE__, -0x005908d, "-364685", "%0d",
-__LINE__, -0x0000de6, "-3558", "%0ld",
-__LINE__, 0x2d395e6b, "+758734443", "%+6d",
-__LINE__, 0x001aba58, "1ABA58", "% X",
-__LINE__, 0x0ceba5ab, "0XCEBA5AB", "%#.1X",
-__LINE__, -0x01a8575, "-1738101", "% 2ld",
-__LINE__, 0x0000000d, "13", "%#ld",
-__LINE__, 0x00000000, "0", "%d",
-__LINE__, 0x4b856407, "4b856407", "%5x",
-__LINE__, 0x006f333c, "6F333C", "%-X",
-__LINE__, 0x000000d0, "d0", "%x",
-__LINE__, 0x2ecf0d4e, "2ecf0d4e", "%0x",
-__LINE__, -0x0000188, "-0000392", "%#1.7ld",
-__LINE__, -0x0000037, "-55", "%d",
-__LINE__, 0xfffffff1, "FFFFFFF1", "% .1X",
-__LINE__, 0x00000001, "0x1", "%#3x",
-__LINE__, 0x000005ed, "5ED", "%3X",
-__LINE__, 0x031183a3, "31183A3", "%X",
-__LINE__, 0xffffffff, "ffffffff", "%x",
-__LINE__, -0x0018695, "-99989", "%-0.5ld",
-__LINE__, -0x0000001, "-01", "%0.2ld",
-__LINE__, 0x00007822, "7822", "%+x",
-__LINE__, 0x00000000, "0", "% x",
-__LINE__, 0xfda2461a, "FDA2461A", "%X",
-__LINE__, 0x065c50ef, "106713327", "%2.ld",
-__LINE__, 0x00000a81, "a81", "% 0x",
-__LINE__, -0x000022e, "-558", "%.0ld",
-__LINE__, 0x00013d2f, "81199", "%.2ld",
-__LINE__, 0xfffffffe, "FFFFFFFE", "%+X",
-__LINE__, 0x000015f9, "5625", "%04.ld",
-__LINE__, 0x0ab575a2, "179664290", "%0d",
-__LINE__, 0x0024d07f, "0X24D07F", "%#X",
-__LINE__, 0x07ee35e1, "7EE35E1", "%+X",
-__LINE__, -0x00c114c, "-790860", "%#ld",
-__LINE__, 0x00003be3, " 15331", "%07.d",
-__LINE__, 0xfff87570, "FFF87570", "%4.0X",
-__LINE__, -0x14eab419, "-350925849", "%-ld",
-__LINE__, -0x000001b, "-27", "%ld",
-__LINE__, 0x167ce2ea, "0x167ce2ea", "%#0.x",
-__LINE__, -0x00009bc, "-002492", "% 3.6d",
-__LINE__, 0xfffffdb9, "0XFFFFFDB9", "%#7.X",
-__LINE__, 0x008b2b9d, "8B2B9D", "% X",
-__LINE__, 0x000cfec3, "CFEC3", "% 05X",
-__LINE__, 0x05970be6, "5970be6", "%x",
-__LINE__, 0x00002780, "010112", "%2.6d",
-__LINE__, 0x00000005, "+5", "%+d",
-__LINE__, 0xfffffffb, "0xfffffffb", "%#3.x",
-__LINE__, 0x00000001, "1 ", "%-#5.ld",
-__LINE__, -0x0000017, "-23", "%ld",
-__LINE__, -0x023b943, "-2341187", "%d",
-__LINE__, 0x0000000d, "13", "%ld",
-__LINE__, 0x00025a03, "25a03", "% .5x",
-__LINE__, 0x3e1ebe24, "3e1ebe24", "% x",
-__LINE__, 0x0000013a, "0x13a", "%#5.0x",
-__LINE__, 0xfff6f5b3, "FFF6F5B3", "%4.X",
-__LINE__, -0x0000a8a, "-2698", "%.3d",
-__LINE__, 0x0009dd5f, "9dd5f", "%x",
-__LINE__, 0x000003c7, " 3C7", "%04.2X",
-__LINE__, 0x1bcfa2f2, "1bcfa2f2", "%+1.x",
-__LINE__, 0x0001b4f4, "1b4f4", "%+1.x",
-__LINE__, 0x1bc19a90, "465672848", "%#d",
-__LINE__, 0xffffffff, "ffffffff", "%+06x",
-__LINE__, -0x0000a88, "-2696", "%3.d",
-__LINE__, 0x00084a19, "84A19", "%-X",
-__LINE__, 0xffe1fc8f, "FFE1FC8F", "%0.1X",
-__LINE__, -0x0000a3a, "-2618", "%5d",
-__LINE__, -0x0000001, "-1", "%ld",
-__LINE__, -0x5c6183d, "-96868413", "%+ld",
-__LINE__, -0x0000001, "-1", "%-d",
-__LINE__, 0x0000faa8, "64168", "%05.d",
-__LINE__, 0x003913ef, "3740655", "%ld",
-__LINE__, 0x0dde330a, "232665866", "%#ld",
-__LINE__, 0xfcfb1a7b, "FCFB1A7B", "%+X",
-__LINE__, 0x07b1a81f, " 129083423", "% 0d",
-__LINE__, 0x00000001, "1", "%d",
-__LINE__, 0x00000070, " 112", "%5ld",
-__LINE__, 0xffff74d9, "ffff74d9", "%x",
-__LINE__, -0x001ab93, "-109459", "%03.d",
-__LINE__, 0x0eb6b497, "EB6B497", "%+X",
-__LINE__, 0x07adbac2, "128826050", "%#0.4d",
-__LINE__, 0xff747068, "FF747068", "%6.X",
-__LINE__, -0x190ce98f, "-420276623", "%06.6ld",
-__LINE__, -0x0000007, "-7", "%.0d",
-__LINE__, 0x0001240f, "1240f", "% 3x",
-__LINE__, 0x267ae4a0, "645588128", "%-#ld",
-__LINE__, -0x0000001, "-1", "% ld",
-__LINE__, -0x0000066, "-00102", "%.5ld",
-__LINE__, 0x868fa035, "868fa035", "%x",
-__LINE__, 0x00000000, " ", "%-4.ld",
-__LINE__, 0xfffffe72, "FFFFFE72", "%4.4X",
-__LINE__, 0x00a6b4f4, "10925300", "%#ld",
-__LINE__, -0x0000002, "-2", "%00.1d",
-__LINE__, -0x00000a3, "-163", "%ld",
-__LINE__, 0xfffffffe, "fffffffe", "% 3.x",
-__LINE__, 0xffe25941, "ffe25941", "% x",
-__LINE__, 0x0000a20f, "41487", "%ld",
-__LINE__, -0x000009b, "-155", "%#.3ld",
-__LINE__, 0x000c5dc1, "810433", "%4.ld",
-__LINE__, 0x00003ec4, "16068", "%ld",
-__LINE__, 0x000002f3, "0755", "%04ld",
-__LINE__, 0xffffff28, "FFFFFF28", "%.5X",
-__LINE__, -0x08450ff, "-8671487", "%-3.0ld",
-__LINE__, 0x00000092, "92", "%x",
-__LINE__, -0x0000317, "-791", "%d",
-__LINE__, 0x0000000d, "d", "%x",
-__LINE__, 0x00000036, "36", "%x",
-__LINE__, -0x112693f, "-17983807", "%ld",
-__LINE__, 0x00004226, "16934", "%0.d",
-__LINE__, 0x000001ba, " 442", "% ld",
-__LINE__, 0xfffffffc, "0XFFFFFFFC", "%#4X",
-__LINE__, 0xffdb3d23, "0xffdb3d23", "% #x",
-__LINE__, 0x039eb84d, "39EB84D", "%+.6X",
-__LINE__, 0xffffc7da, "ffffc7da", "%0x",
-__LINE__, 0xfffffdb6, "FFFFFDB6", "%6X",
-__LINE__, 0x001b75b0, "1799600", "%ld",
-__LINE__, 0xfffffca2, "FFFFFCA2", "%-X",
-__LINE__, 0xffffffba, "ffffffba", "%7.4x",
-__LINE__, -0x000124e, "-4686", "%3.ld",
-__LINE__, -0x000bec0, "-48832", "% 0d",
-__LINE__, 0xfffffca0, "fffffca0", "%2.x",
-__LINE__, 0x00b2a462, "11707490", "%ld",
-__LINE__, 0x0745a647, "745a647", "%+4.x",
-__LINE__, 0xfffffbac, "0XFFFFFBAC", "%#3.X",
-__LINE__, -0x0000002, "-2", "%-0.1d",
-__LINE__, 0x0006cfdb, "446427", "%#5.d",
-__LINE__, -0x0000001, "-1", "%d",
-__LINE__, 0x043b134e, "43B134E", "%X",
-__LINE__, -0x0000015, "-21", "%ld",
-__LINE__, -0x0000114, "-276", "%0d",
-__LINE__, -0x0004d4a, "-19786", "%-d",
-__LINE__, -0x000001c, "-28", "%ld",
-__LINE__, -0x0cb89fc, "-13339132", "%ld",
-__LINE__, 0xffffffcf, "ffffffcf", "%x",
-__LINE__, 0xf6d2387a, "f6d2387a", "%-x",
-__LINE__, -0x00000cd, "-205", "%#ld",
-__LINE__, 0x00000000, "0", "%#x",
-__LINE__, 0xfffffc81, "fffffc81", "%x",
-__LINE__, 0x00000000, " 0", "% ld",
-__LINE__, 0x00024fb5, "24fb5", "%x",
-__LINE__, 0x000012fa, "12FA", "%X",
-__LINE__, 0x0318ce7c, "51957372", "%0d",
-__LINE__, 0x02280a99, "2280a99", "%-x",
-__LINE__, 0xffffff5c, "FFFFFF5C", "%2.X",
-__LINE__, -0x000002e, " -46", "%7ld",
-__LINE__, -0x04a73e8, "-4879336", "%4ld",
-__LINE__, 0x000007f3, "7f3", "% 1.3x",
-__LINE__, 0x00000114, "0x114", "%#x",
-__LINE__, 0x0000030c, "30c", "%-x",
-__LINE__, 0x001dd0dd, "0x1dd0dd", "%+#5.5x",
-__LINE__, 0xfff23de3, "fff23de3", "%-x",
-__LINE__, -0x0178f9c, "-1544092", "%d",
-__LINE__, 0x02ded8da, "2DED8DA", "%X",
-__LINE__, -0x0991672, "-10032754", "%3.d",
-__LINE__, 0x6943c150, "6943c150", "%x",
-__LINE__, 0xffffc25d, "FFFFC25D", "%4X",
-__LINE__, 0x00000c9c, " 0003228", "% .7d",
-__LINE__, 0xffffffdf, "FFFFFFDF", "% 6.X",
-__LINE__, 0x0001a145, " 1a145", "%6.0x",
-__LINE__, 0xffdc832f, "0xffdc832f", "%#.1x",
-__LINE__, 0x00699f7b, "699f7b", "%x",
-__LINE__, 0xf9575268, "F9575268", "%+0X",
-__LINE__, 0x04eb4783, "82528131", "%-ld",
-__LINE__, -0x0000023, "-35", "%0ld",
-__LINE__, -0x012b08a, "-1224842", "%0d",
-__LINE__, 0xffffb587, "FFFFB587", "%X",
-__LINE__, 0xffffffe9, "ffffffe9", "%x",
-__LINE__, 0x006b5596, " 7034262", "% 0d",
-__LINE__, 0x004d0d2a, "+5049642", "%+ld",
-__LINE__, -0x002a099, "-172185", "%d",
-__LINE__, 0x00000224, "548", "%ld",
-__LINE__, 0x03e0cca8, "65064104", "%d",
-__LINE__, -0x7bb389d, "-129710237", "%.3ld",
-__LINE__, 0xffc630f5, "ffc630f5", "%-07.0x",
-__LINE__, 0xfffffff8, "FFFFFFF8", "%X",
-__LINE__, 0x0030225b, "3154523", "%#d",
-__LINE__, 0xff7f4e28, "ff7f4e28", "%+4.x",
-__LINE__, 0x14ee154d, "+351147341", "%+ld",
-__LINE__, 0x00000003, "03", "%.2d",
-__LINE__, 0xfe0359d6, "fe0359d6", "%x",
-__LINE__, 0x002b71c3, "2847171", "%d",
-__LINE__, 0x055c4d4a, "55C4D4A", "%-X",
-__LINE__, 0xfffb17d2, "fffb17d2", "% .0x",
-__LINE__, 0x00000002, "2", "%x",
-__LINE__, 0x000018e1, "18E1", "%1.1X",
-__LINE__, 0x00000331, "817", "%0d",
-__LINE__, -0x0000982, "-2434 ", "%-06.ld",
-__LINE__, -0x0000168, "-0000360", "%.7ld",
-__LINE__, 0xffffffe9, "FFFFFFE9", "%-0.4X",
-__LINE__, 0xe42084ef, "E42084EF", "%X",
-__LINE__, 0x000000aa, "aa", "%x",
-__LINE__, -0xe8b98b5, "-244029621", "%+d",
-__LINE__, -0x00000d9, "-217", "%+2.d",
-__LINE__, 0x0000027b, "27B", "%+.0X",
-__LINE__, 0x002e52db, "3035867", "%-ld",
-__LINE__, -0x00e2ba8, "-928680", "%0.2ld",
-__LINE__, 0x003b74d8, "3B74D8", "%X",
-__LINE__, -0x000006f, "-111", "%+ld",
-__LINE__, 0xf8507e22, "0XF8507E22", "%-#X",
-__LINE__, 0x0629f4c0, "103412928", "%-ld",
-__LINE__, -0x000002d, "-45", "%0d",
-__LINE__, -0x0001db0, "-7600", "%d",
-__LINE__, -0x00001bb, " -443", "%5.ld",
-__LINE__, 0xffffd2b9, "ffffd2b9", "%+x",
-__LINE__, 0xffffe685, "0XFFFFE685", "%#0.7X",
-__LINE__, 0x0000a4ce, "A4CE", "% X",
-__LINE__, 0xffffffff, "FFFFFFFF", "%X",
-__LINE__, 0x0000000c, "C", "% X",
-__LINE__, 0xfff59369, "FFF59369", "%7X",
-__LINE__, 0x00000156, " 156", "%5.X",
-__LINE__, 0x02833aa9, "+42154665", "%+2d",
-__LINE__, 0x0004a8f3, "+305395", "%+d",
-__LINE__, 0x01a09267, "1A09267", "%0.3X",
-__LINE__, 0x000004f1, "4f1", "%x",
-__LINE__, 0x00000005, "5", "%x",
-__LINE__, 0x00000119, " 0281", "% #2.4ld",
-__LINE__, -0x0001a2a, "-6698", "%ld",
-__LINE__, 0xa3633a57, "A3633A57", "%7X",
-__LINE__, -0x10bd2970, "-280832368", "%-d",
-__LINE__, 0xffff9c38, "ffff9c38", "%x",
-__LINE__, 0xffdbe81e, "ffdbe81e", "%+6.7x",
-__LINE__, 0xffffffe7, "FFFFFFE7", "%-3.0X",
-__LINE__, 0x0002f6d6, "2f6d6", "%5.x",
-__LINE__, 0xffffffff, "ffffffff", "% x",
-__LINE__, 0xffc2c07a, "ffc2c07a", "%0.x",
-__LINE__, 0xfcc0e13a, "FCC0E13A", "%X",
-__LINE__, 0x0000000d, "d", "% x",
-__LINE__, 0x0016cac8, "16CAC8", "%-0.3X",
-__LINE__, 0x00945dc1, "9723329", "%2d",
-__LINE__, 0xf19a1cd1, "F19A1CD1", "%-X",
-__LINE__, 0x00000003, "+3", "%+ld",
-__LINE__, 0x00000773, "1907", "%ld",
-__LINE__, 0x000263e6, "263e6", "%-x",
-__LINE__, -0x0238b55, "-2329429", "%d",
-__LINE__, 0x00006c56, "6C56", "%X",
-__LINE__, 0x0000f34b, "62283", "%#.0ld",
-__LINE__, -0x1620e21, "-23203361", "%0ld",
-__LINE__, 0xf9257d6a, "f9257d6a", "%2x",
-__LINE__, -0x00ed463, "-971875", "%03.d",
-__LINE__, 0x02bb94c6, "45847750", "%d",
-__LINE__, 0xffffd20c, "0XFFFFD20C", "%#X",
-__LINE__, 0x000087d8, "34776", "%.0d",
-__LINE__, 0xfffffffc, "FFFFFFFC", "%+7.X",
-__LINE__, -0x0009cd5, "-40149", "%-ld",
-__LINE__, 0xfffff85e, "FFFFF85E", "% 0.7X",
-__LINE__, -0x0000006, " -6", "%+#6.ld",
-__LINE__, 0x007ff453, "0x7ff453", "%-#1.x",
-__LINE__, 0xffffffe6, "FFFFFFE6", "%2X",
-__LINE__, 0x0000001f, "0X1F", "%#4X",
-__LINE__, -0x001c157, "-115031", "%.3ld",
-__LINE__, 0x00096e06, "617990", "%3.1ld",
-__LINE__, 0x0f77271d, "259467037", "%d",
-__LINE__, -0x0001403, "-5123", "%d",
-__LINE__, 0xffffff8a, "ffffff8a", "%x",
-__LINE__, -0x000010f, "-271", "%1.ld",
-__LINE__, 0xe573cc4a, "E573CC4A", "%0X",
-__LINE__, -0x0000d88, "-3464", "%-d",
-__LINE__, 0x0000000e, "14", "%#ld",
-__LINE__, -0x000345b, "-13403", "%#d",
-__LINE__, 0x00000602, "602", "%+x",
-__LINE__, 0x00000011, "17", "%#d",
-__LINE__, -0x0000002, "-2", "%+d",
-__LINE__, 0x030fe6e6, "51373798", "%d",
-__LINE__, 0x00000007, "007", "%.3X",
-__LINE__, 0x0001abe0, "0X1ABE0", "%+#.4X",
-__LINE__, 0xfffffdb7, "fffffdb7", "%-6x",
-__LINE__, 0xffffff8d, "FFFFFF8D", "% 02.2X",
-__LINE__, 0xfff12126, "FFF12126", "%X",
-__LINE__, 0x0208e32d, "34136877", "%.2d",
-__LINE__, 0x11c04b55, "297814869", "%ld",
-__LINE__, 0xff1e5ca3, "0xff1e5ca3", "%#x",
-__LINE__, 0xf9643f09, "f9643f09", "%x",
-__LINE__, -0x003c6da, "-247514", "%4d",
-__LINE__, 0xff69d0e7, "FF69D0E7", "%-X",
-__LINE__, 0x00006ae9, "0x6ae9", "%#x",
-__LINE__, -0x005aefe, "-372478", "%d",
-__LINE__, 0x0000000d, "00013", "%3.5ld",
-__LINE__, 0x00cc185c, "CC185C", "%X",
-__LINE__, 0x3dd14d9f, "3DD14D9F", "%1.4X",
-__LINE__, -0x4cc2ad3, "-80489171", "%1.d",
-__LINE__, 0xfffff79e, "fffff79e", "%x",
-__LINE__, 0xfffeeb03, "fffeeb03", "%-1x",
-__LINE__, -0x0b1b15c, "-11645276", "%0ld",
-__LINE__, -0x06b558d, "-7034253", "%ld",
-__LINE__, 0xfffffe61, "fffffe61", "%x",
-__LINE__, -0x0000002, "-2", "%d",
-__LINE__, -0x0000162, "-000354", "%-5.6d",
-__LINE__, 0x01a23780, "27408256", "%d",
-__LINE__, 0xffff3a9b, "ffff3a9b", "% x",
-__LINE__, 0xfffffdc7, "0xfffffdc7", "%#4.5x",
-__LINE__, 0x00000000, "00", "%.2X",
-__LINE__, -0x0000006, "-6", "%0ld",
-__LINE__, -0x16072c6, "-23098054", "%#5ld",
-__LINE__, -0x07152b8, "-7426744", "%01ld",
-__LINE__, 0x0000d6c6, "0x0d6c6", "%#1.5x",
-__LINE__, 0x00000f7c, "000f7c", "%+04.6x",
-__LINE__, 0x00000bd0, "3024", "%4ld",
-__LINE__, 0x0000295e, "0x295e", "%#x",
-__LINE__, 0x00002e38, "11832", "%.5d",
-__LINE__, -0xa2f5de4, "-170876388", "%#d",
-__LINE__, -0x001aa36, "-109110", "%-#d",
-__LINE__, 0x03012091, "3012091", "%+2.5X",
-__LINE__, -0x00009ed, "-002541", "%-0.6ld",
-__LINE__, 0x0000001d, "1d", "%x",
-__LINE__, 0xffffe315, "FFFFE315", "%+4X",
-__LINE__, 0x0000716b, "716B", "%X",
-__LINE__, 0xfffb8315, "0xfffb8315", "%+#x",
-__LINE__, 0x00000132, "132 ", "%-7.3x",
-__LINE__, 0x00000000, "+0000000", "%+1.7d",
-__LINE__, 0xe16d27ab, "E16D27AB", "%X",
-__LINE__, 0xffffffe5, "ffffffe5", "%+x",
-__LINE__, -0x000ab9d, "-43933", "%ld",
-__LINE__, 0xffd042d6, "ffd042d6", "%2x",
-__LINE__, 0xffffff9b, "ffffff9b", "%x",
-__LINE__, 0x000000fb, "0xfb", "% #1.x",
-__LINE__, 0x0000000f, " 15", "%#3ld",
-__LINE__, 0xfffba2d8, "0XFFFBA2D8", "%-#0.X",
-__LINE__, 0xfffffff8, "0XFFFFFFF8", "% #X",
-__LINE__, 0x00000000, " ", "%4.ld",
-__LINE__, 0x00000002, "2", "%+x",
-__LINE__, 0xfffff314, "FFFFF314", "%-X",
-__LINE__, 0x00000000, " 0", "% ld",
-__LINE__, -0x0000007, "-07", "%3.2ld",
-__LINE__, 0xffffdd80, "FFFFDD80", "%.6X",
-__LINE__, -0x000001b, "-27", "%-ld",
-__LINE__, -0x0000258, "-600", "%-0d",
-__LINE__, 0x00016377, "16377", "%3X",
-__LINE__, 0x00000001, "1", "%X",
-__LINE__, -0xac5d314, "-180736788", "%d",
-__LINE__, -0x000036e, "-878", "% ld",
-__LINE__, 0xfe346af4, "fe346af4", "%.5x",
-__LINE__, 0xffffffe1, "ffffffe1", "%-7.6x",
-__LINE__, -0x0a1df07, "-10608391", "%#.5d",
-__LINE__, 0x000000c9, " 0XC9", "%+#5.X",
-__LINE__, 0xfffffffe, "fffffffe", "%x",
-__LINE__, 0xfffffff8, "fffffff8", "%+x",
-__LINE__, -0x4517255, "-72446549", "%.6ld",
-__LINE__, 0xfffa3670, "FFFA3670", "%-6X",
-__LINE__, 0xffffffe0, "ffffffe0", "%2.x",
-__LINE__, 0xffffffff, "ffffffff", "%0x",
-__LINE__, 0x0000230d, "8973", "%#.1d",
-__LINE__, 0x00000238, "238", "%0X",
-__LINE__, 0xfffce5ab, "FFFCE5AB", "%-X",
-__LINE__, 0x0000002c, "2C", "%X",
-__LINE__, 0x00000001, " 1", "%4.ld",
-__LINE__, 0xffffff8d, "FFFFFF8D", "%-X",
-__LINE__, 0x00069c69, "433257", "%06d",
-__LINE__, 0xfffffb8d, "0xfffffb8d", "%#x",
-__LINE__, 0x000d6a2d, "879149", "%5.5d",
-__LINE__, -0x0001fcb, " -8139", "%7.ld",
-__LINE__, 0xfff86937, "fff86937", "%-0x",
-__LINE__, 0x00059cf9, "367865", "%#.0ld",
-__LINE__, 0x02c5d87a, "46520442", "%3.ld",
-__LINE__, 0x00000571, "1393", "%ld",
-__LINE__, 0x0003c73f, "+247615", "%+4ld",
-__LINE__, 0x0000004f, "4f", "% 0x",
-__LINE__, 0x00000000, "0", "%-ld",
-__LINE__, -0x0e5850f, "-15041807", "% ld",
-__LINE__, -0x0000002, " -0002", "%7.4d",
-__LINE__, 0xfffffd1b, "fffffd1b", "%05x",
-__LINE__, 0x0000041c, " 1052", "% #0.ld",
-__LINE__, -0x0000030, "-48", "%d",
-__LINE__, -0x0013593, "-79251", "% #d",
-__LINE__, 0x00000001, "1", "%+X",
-__LINE__, 0x0000056b, " 56b", "%4.x",
-__LINE__, -0x0000004, "-4 ", "%-3d",
-__LINE__, -0x0000003, "-3", "% ld",
-__LINE__, 0xffff7c14, "0XFFFF7C14", "%#X",
-__LINE__, 0x02f63dd8, "49692120", "%.7ld",
-__LINE__, -0x03c51c9, "-3953097", "%+d",
-__LINE__, 0x00ded685, "14603909", "%5.ld",
-__LINE__, 0xffffffba, "ffffffba", "%x",
-__LINE__, 0x000370e8, "225512", "%#ld",
-__LINE__, 0x00000003, "3", "%X",
-__LINE__, -0x0024a64, "-150116", "%7.d",
-__LINE__, 0xff486ca1, "ff486ca1", "%x",
-__LINE__, 0x000001cf, "1CF", "% X",
-__LINE__, -0x0002d7e, "-11646", "%-0d",
-__LINE__, 0x0a594c65, "a594c65", "%.4x",
-__LINE__, -0x0000002, "-0002", "%-5.4ld",
-__LINE__, 0x00000000, "", "%00.ld",
-__LINE__, 0x00058bc4, "58BC4", "%3X",
-__LINE__, 0x0002cf8e, " 184206", "% 0ld",
-__LINE__, 0x000009c7, "+2503", "%+4.ld",
-__LINE__, 0xed0c984d, "ED0C984D", "%X",
-__LINE__, -0x0000058, "-088", "%#.3ld",
-__LINE__, 0x0076083d, "0X76083D", "%#6X",
-__LINE__, -0x0000001, "-1", "%#d",
-__LINE__, -0x6bf1777, "-113186679", "%#ld",
-__LINE__, -0x000011f, "-287", "%ld",
-__LINE__, 0x001b0e7d, "1B0E7D", "%-4X",
-__LINE__, 0x000007ac, " 1964", "%5.ld",
-__LINE__, 0x00000005, "5", "%0.d",
-__LINE__, -0x00003ba, "-954", "%4.0ld",
-__LINE__, 0xfffffffe, "FFFFFFFE", "%X",
-__LINE__, 0x00000019, "19", "%x",
-__LINE__, 0xffffffe0, "ffffffe0", "%-.6x",
-__LINE__, 0x0000012a, " 298", "% d",
-__LINE__, 0x00002c74, "2c74", "% 4.3x",
-__LINE__, 0x000002d5, "725", "%d",
-__LINE__, 0x0001c9a9, "1c9a9", "%-02x",
-__LINE__, 0xffc928c8, "ffc928c8", "%x",
-__LINE__, -0x03ae51f, "-3859743", "% #ld",
-__LINE__, 0x0000526d, "526d", "%x",
-__LINE__, -0x00028f0, "-10480", "%5ld",
-__LINE__, -0x49b4262, "-77283938", "%+02.0d",
-__LINE__, 0x028d37f0, "0x28d37f0", "%+#x",
-__LINE__, 0xd66e0af9, "D66E0AF9", "%03.X",
-__LINE__, -0x00c7707, "-816903", "%0d",
-__LINE__, -0x00000d0, "-208", "%-.1ld",
-__LINE__, 0x0000c328, "49960", "%d",
-__LINE__, 0x34cb86f1, "34CB86F1", "%X",
-__LINE__, 0x000000f6, "F6", "%+X",
-__LINE__, 0x0a3407ec, "0xa3407ec", "%-#x",
-__LINE__, 0x00007ebc, "32444", "%#3.d",
-__LINE__, 0xfffd3d65, "fffd3d65", "%x",
-__LINE__, 0x0007bc82, "0507010", "%0.7d",
-__LINE__, 0x0005bb93, "375699", "%ld",
-__LINE__, 0x0ec11cc8, "0XEC11CC8", "%+#6.2X",
-__LINE__, 0xfffff9c6, "fffff9c6", "%.5x",
-__LINE__, 0xff05ab70, "0XFF05AB70", "%-#.3X",
-__LINE__, 0x2328b716, "589870870", "%d",
-__LINE__, 0x00001a79, "6777", "%.1d",
-__LINE__, 0xfffee573, "fffee573", "%0.1x",
-__LINE__, -0x0000929, " -2345", "%7.d",
-__LINE__, 0xffffff9a, "FFFFFF9A", "%2.X",
-__LINE__, 0xfffffe60, "fffffe60", "%.5x",
-__LINE__, 0xfffffcd2, "fffffcd2", "%.7x",
-__LINE__, 0x00000001, " 001", "%6.3X",
-__LINE__, 0x00011e9c, "+73372", "%+0ld",
-__LINE__, 0x0000002a, "2a", "% x",
-__LINE__, 0xffffffff, "ffffffff", "%.7x",
-__LINE__, -0x0008ee8, "-36584", "%ld",
-__LINE__, 0x0000001c, "28", "%-d",
-__LINE__, 0x000abeda, "704218", "%d",
-__LINE__, 0x001347f7, "1347f7", "%3.0x",
-__LINE__, 0x0000023e, "574", "%3.3ld",
-__LINE__, 0x00000000, "0", "%-ld",
-__LINE__, -0x0016de0, "-93664", "%0ld",
-__LINE__, 0xffffff45, "FFFFFF45", "% X",
-__LINE__, 0x02dfb08c, "48214156", "%#ld",
-__LINE__, 0x003d73a2, "3d73a2", "%6.x",
-__LINE__, 0x00147da7, "1342887", "%#d",
-__LINE__, -0x5ff0f1e, "-100601630", "%-01ld",
-__LINE__, -0x000000b, "-11", "%ld",
-__LINE__, 0x00000168, " 168", "%+6.x",
-__LINE__, 0xffffc28e, "ffffc28e", "%0x",
-__LINE__, -0x00003a2, "-930", "%ld",
-__LINE__, 0x0002e56f, " 189807", "% 1.ld",
-__LINE__, 0x51abf44f, "0x51abf44f", "%#.7x",
-__LINE__, 0x00000000, "0", "%d",
-__LINE__, 0x9581268f, "9581268F", "%+X",
-__LINE__, 0xffffff3b, "FFFFFF3B", "%X",
-__LINE__, 0x000083d4, " 33748", "% #d",
-__LINE__, 0x00000001, "1", "%x",
-__LINE__, -0x000e51f, "-58655", "%.0ld",
-__LINE__, 0x0003eacb, "256715", "%6ld",
-__LINE__, 0x02be09db, " 46008795", "% 0.ld",
-__LINE__, 0xfffffffb, "FFFFFFFB", "% X",
-__LINE__, 0x000084f5, " 34037", "%6ld",
-__LINE__, -0x1127f99, "-17989529", "%#d",
-__LINE__, 0x5f6512de, "5f6512de", "%.7x",
-__LINE__, 0x00000001, "1", "%x",
-__LINE__, 0xfff74ab5, "fff74ab5", "%x",
-__LINE__, 0x0eebeb94, "250342292", "%4.ld",
-__LINE__, 0x0001b846, "0x1b846", "%#1x",
-__LINE__, 0x001e8c32, "1E8C32", "%2X",
-__LINE__, -0x0dae932, "-14346546", "%5.1d",
-__LINE__, 0x00000001, "1", "%ld",
-__LINE__, -0x0000042, "-66", "%ld",
-__LINE__, 0xffffff51, "FFFFFF51", "%0.1X",
-__LINE__, 0x00000043, "43", "%x",
-__LINE__, 0x04c21f39, " 79830841", "% 0ld",
-__LINE__, 0x0000061e, "1566", "%03.3d",
-__LINE__, -0x0000003, "-3", "%+d",
-__LINE__, 0x015b32db, " 22754011", "% .4d",
-__LINE__, 0xfffff181, "FFFFF181", "%-X",
-__LINE__, 0x000017ec, "0X17EC", "%#X",
-__LINE__, 0x000d703e, "880702", "%#ld",
-__LINE__, -0x6d7533a0, "-1836397472", "%ld",
-__LINE__, 0x0000008a, " 138", "% d",
-__LINE__, -0x7368794b, "-1936226635", "%+#d",
-__LINE__, 0x0000000d, "0XD", "%#X",
-__LINE__, 0x0000030d, "30D", "% X",
-__LINE__, 0xfffff9fe, "FFFFF9FE", "%5X",
-__LINE__, 0x00001bb2, "7090", "%d",
-__LINE__, 0x041d2a0c, "41D2A0C", "%0X",
-__LINE__, 0x00012aee, " 76526", "% d",
-__LINE__, 0x0000055f, "55f", "%.1x",
-__LINE__, 0xffffffff, "0XFFFFFFFF", "%#1X",
-__LINE__, 0x07b0a971, "+129018225", "%+.2ld",
-__LINE__, 0xfffffff8, "FFFFFFF8", "%4X",
-__LINE__, 0x00000001, "1", "%d",
-__LINE__, 0x00000038, "+56", "%+2ld",
-__LINE__, 0xfffffc2f, "fffffc2f", "%+7.x",
-__LINE__, 0x00004477, "0x4477", "% #x",
-__LINE__, 0x0000000d, "0XD", "%+#3X",
-__LINE__, 0xf5bf37b1, "F5BF37B1", "%1.X",
-__LINE__, 0x1a96f431, "446100529", "%d",
-__LINE__, 0x0037edf3, "+3665395", "%+#4.5ld",
-__LINE__, 0x0007f2aa, "520874", "%0ld",
-__LINE__, -0x00051a3, "-20899", "%+#1.ld",
-__LINE__, 0x0000037f, "37F", "%0X",
-__LINE__, 0xffffffb4, "ffffffb4", "%x",
-__LINE__, -0xd984c00, "-228084736", "%+06ld",
-__LINE__, 0xffffe1be, "FFFFE1BE", "%X",
-__LINE__, 0xfff20d48, "FFF20D48", "%+6.0X",
-__LINE__, 0x000028b7, "0x028b7", "%-#7.5x",
-__LINE__, -0x0000001, "-1", "%ld",
-__LINE__, 0x03f37945, "66287941", "%d",
-__LINE__, 0xffffffed, "0XFFFFFFED", "%+#6.4X",
-__LINE__, 0x0000f046, "f046", "%x",
-__LINE__, 0xe9772b51, "E9772B51", "%-1.X",
-__LINE__, 0xfffffffe, "fffffffe", "% x",
-__LINE__, 0xfffffffa, "0xfffffffa", "%#x",
-__LINE__, 0x00000015, "15", "%-X",
-__LINE__, 0x0000003c, "60", "%#ld",
-__LINE__, 0x3103952d, "822318381", "%0.ld",
-__LINE__, 0x17ba68bb, "398092475", "%2d",
-__LINE__, 0x000006c4, "+1732", "%+.2d",
-__LINE__, 0x00000043, "67", "%#d",
-__LINE__, 0x0043fb55, "4455253", "%.1ld",
-__LINE__, 0x00004b76, "4b76", "% 0x",
-__LINE__, 0xfff4c56b, "FFF4C56B", "%7X",
-__LINE__, 0x00766055, "766055", "%+5x",
-__LINE__, -0x000009f, "-159", "%+d",
-__LINE__, 0xffff063f, "ffff063f", "%-2x",
-__LINE__, 0x00808fc8, "808fc8", "%x",
-__LINE__, 0xffffffff, "ffffffff", "%x",
-__LINE__, 0x000000f1, "00000f1", "%+02.7x",
-__LINE__, 0x00000002, "2", "%X",
-__LINE__, 0x00000000, "000", "%03d",
-__LINE__, 0xe63f73b2, "E63F73B2", "% 1X",
-__LINE__, 0xfffffffe, "FFFFFFFE", "%5.1X",
-__LINE__, 0x0d3fa38b, "222274443", "%1d",
-__LINE__, 0x00000000, "0", "% X",
-__LINE__, 0x00000001, " 1", "%04.ld",
-__LINE__, 0x00000046, "46", "%0X",
-__LINE__, 0x0000761f, " 30239", "% ld",
-__LINE__, -0x0002517, "-9495", "%+d",
-__LINE__, 0x00000156, "156", "% 0x",
-__LINE__, 0x1c55eba2, "1c55eba2", "%.6x",
-__LINE__, 0x005af80d, "5af80d", "%.6x",
-__LINE__, 0x0000002e, "46", "%d",
-__LINE__, -0x0007c0f, "-31759", "%ld",
-__LINE__, 0xffffe924, "FFFFE924", "%7X",
-__LINE__, 0x00000174, "372", "%ld",
-__LINE__, 0xffffffc9, "0xffffffc9", "%-#x",
-__LINE__, 0x00000020, "+000032", "%+07d",
-__LINE__, 0xffffe5d9, "FFFFE5D9", "%4.5X",
-__LINE__, 0xffffffa3, "FFFFFFA3", "%+.3X",
-__LINE__, 0x00000a03, "+2563", "%+2d",
-__LINE__, 0x001b58ca, "+1792202", "%+4d",
-__LINE__, 0xffffffc9, "0xffffffc9", "%+#5x",
-__LINE__, -0x0000003, "-3", "% d",
-__LINE__, 0xfffffffc, "fffffffc", "%+0x",
-__LINE__, -0x0000002, "-02", "%.2d",
-__LINE__, 0x000243fb, "148475", "%-ld",
-__LINE__, 0x00000001, "1", "%0d",
-__LINE__, -0x0000672, "-1650", "%ld",
-__LINE__, -0x0005413, "-0021523", "% 7.7d",
-__LINE__, 0x00000017, "0X17", "%#X",
-__LINE__, 0x00000e48, "3656", "%0d",
-__LINE__, 0xffe79b38, "ffe79b38", "%-x",
-__LINE__, 0xffffff15, "FFFFFF15", "%+6.1X",
-__LINE__, 0xfff0272c, "fff0272c", "%-.5x",
-__LINE__, -0x00b706f, "-749679", "%1.ld",
-__LINE__, 0x0176aeec, "176AEEC", "%.1X",
-__LINE__, -0x00005a1, "-1441", "% 0ld",
-__LINE__, -0x0000002, "-00002", "%.5d",
-__LINE__, -0xd2e6f5d, "-221146973", "%1ld",
-__LINE__, -0x0000001, " -001", "%5.3ld",
-__LINE__, 0x00000001, " 1", "%05.ld",
-__LINE__, 0x0000749e, "+29854", "%+#d",
-__LINE__, 0x00000005, "5", "%d",
-__LINE__, 0xfa7128b0, "fa7128b0", "%1.x",
-__LINE__, 0xffffbbb4, "0XFFFFBBB4", "%#.1X",
-__LINE__, 0x0006862f, "427567", "%d",
-__LINE__, 0x00000002, "2", "%X",
-__LINE__, 0x000005d4, "5d4", "% x",
-__LINE__, 0x001387e1, "1279969", "%-05.0ld",
-__LINE__, -0x0035a56, "-219734", "%ld",
-__LINE__, -0x4064ecc6, "-1080356038", "%ld",
-__LINE__, 0x0000360d, "13837", "%0ld",
-__LINE__, -0xea1a85b, "-245475419", "%-.2ld",
-__LINE__, 0xffffff2d, "FFFFFF2D", "%X",
-__LINE__, 0x00000004, " 0004", "%7.4x",
-__LINE__, 0x00f72ffd, "F72FFD", "%-X",
-__LINE__, 0x00000fa2, "fa2 ", "%-5x",
-__LINE__, 0x05ae1f9a, "95297434", "%#ld",
-__LINE__, 0x0000bf2e, "48942", "%3.d",
-__LINE__, 0x00000000, " ", "%1.X",
-__LINE__, 0x01bcb097, "29143191", "%ld",
-__LINE__, 0x0000009c, "156 ", "%-4.0d",
-__LINE__, 0xfffffffe, "fffffffe", "% x",
-__LINE__, 0x00000001, "1 ", "%-6.d",
-__LINE__, 0xffffffef, "ffffffef", "%7.x",
-__LINE__, 0xfffffec1, "fffffec1", "%.5x",
-__LINE__, -0x000000f, "-15", "%-1d",
-__LINE__, -0x0008426, "-33830", "%0ld",
-__LINE__, 0x005be0ae, "5BE0AE", "% X",
-__LINE__, 0x00000009, " 9", "%+7X",
-__LINE__, -0x0007e18, "-32280", "%+0.d",
-__LINE__, 0x01697ba1, " 23690145", "% 5.ld",
-__LINE__, -0x0012042, "-073794", "%7.6d",
-__LINE__, 0x04e9bd0d, "4e9bd0d", "%-2x",
-__LINE__, 0xffffffd9, "FFFFFFD9", "%.2X",
-__LINE__, -0x01b9632, "-1807922", "%.6ld",
-__LINE__, 0x000000cd, "205", "%1.ld",
-__LINE__, 0x00000000, " ", "% .0d",
-__LINE__, 0xff17bbb1, "ff17bbb1", "%x",
-__LINE__, -0x00146d7, "-83671", "%+1.ld",
-__LINE__, 0xfffff144, "fffff144", "%x",
-__LINE__, 0x000f8dbe, "F8DBE", "%3.X",
-__LINE__, -0x000381c, "-14364", "%d",
-__LINE__, 0x0000001e, " 30", "%4.1d",
-__LINE__, 0x00000016, "22", "%-0d",
-__LINE__, 0x00000002, "+02", "%+1.2ld",
-__LINE__, 0x0000e803, "59395", "%d",
-__LINE__, 0xb4c2448d, "b4c2448d", "%-7x",
-__LINE__, 0x000e697d, "944509", "%ld",
-__LINE__, 0xfffe6e32, "0XFFFE6E32", "%#X",
-__LINE__, 0x00000190, " 190", "%+5.X",
-__LINE__, -0x03a2219, "-3809817", "%#6.ld",
-__LINE__, -0x000003c, "-60 ", "%-#4.ld",
-__LINE__, 0x00000000, " ", "% 03.ld",
-__LINE__, -0x074f922, "-7665954", "%ld",
-__LINE__, -0x00000f0, "-240", "%-ld",
-__LINE__, 0xfffe42d2, "0XFFFE42D2", "%#X",
-__LINE__, 0x000000dd, "DD", "%X",
-__LINE__, 0x00359abe, "359ABE", "%.1X",
-__LINE__, 0xffec7bdf, "FFEC7BDF", "%0.1X",
-__LINE__, 0x0ecddcba, "248372410", "%-#3.d",
-__LINE__, 0x00ad0dbc, "11341244", "%ld",
-__LINE__, -0x0000001, "-1", "%-d",
-__LINE__, 0x00050841, "50841", "% .5x",
-__LINE__, 0x01d359e7, "1d359e7", "%1.x",
-__LINE__, 0xff9efaa3, "FF9EFAA3", "%X",
-__LINE__, 0x0007ea10, "+518672", "%+ld",
-__LINE__, -0x000671c, "-26396", "%1d",
-__LINE__, 0xffffff91, "0xffffff91", "%#4.4x",
-__LINE__, 0x00000000, "+", "%+0.0ld",
-__LINE__, -0x002c53e, "-181566", "%3.d",
-__LINE__, 0xffffff56, "ffffff56", "%x",
-__LINE__, 0xfffff589, "FFFFF589", "%+X",
-__LINE__, 0x00024d13, "24D13", "%-5.2X",
-__LINE__, 0x00000000, " 0", "%6.1d",
-__LINE__, 0x00a64f33, "A64F33", "%4.4X",
-__LINE__, 0xffebb57a, "FFEBB57A", "%5.4X",
-__LINE__, 0xfff3b4a0, "fff3b4a0", "%2.x",
-__LINE__, 0xffffffd9, "FFFFFFD9", "%.2X",
-__LINE__, 0x00d37b84, "13859716", "%d",
-__LINE__, 0x00001e85, "0001E85", "%0.7X",
-__LINE__, -0x756148f, "-123081871", "% 7.d",
-__LINE__, -0x0319339, "-3248953", "%+#.4d",
-__LINE__, -0x00798b8, "-497848", "%#5ld",
-__LINE__, -0x0000039, "-57", "%0d",
-__LINE__, -0x000b1d7, "-45527", "%+0.ld",
-__LINE__, 0xff811fba, "FF811FBA", "%+X",
-__LINE__, 0x00000042, " 66", "% ld",
-__LINE__, 0xfffffe31, "0XFFFFFE31", "%#X",
-__LINE__, 0x00000073, "115", "%ld",
-__LINE__, 0x45091a39, "0x45091a39", "%+#3.x",
-__LINE__, 0x001270f5, "1270f5", "%-5.6x",
-__LINE__, 0xfffd91fd, "fffd91fd", "%x",
-__LINE__, -0x0817bad, "-8485805", "%#ld",
-__LINE__, -0x32ad55f, "-53138783", "%0d",
-__LINE__, 0x00003e57, "15959", "%0ld",
-__LINE__, -0x0048756, "-296790", "%2.6d",
-__LINE__, 0xff90f45f, "FF90F45F", "% X",
-__LINE__, 0x0000e454, "0e454", "% .5x",
-__LINE__, 0xfffffffc, "fffffffc", "%x",
-__LINE__, 0xfffffff7, "FFFFFFF7", "%-2X",
-__LINE__, 0xffdabf0e, "FFDABF0E", "%+X",
-__LINE__, 0xffffffff, "0XFFFFFFFF", "%#1X",
-__LINE__, 0x01516650, "1516650", "% x",
-__LINE__, 0xffffff51, "FFFFFF51", "%X",
-__LINE__, 0x000000ea, "234", "%00.d",
-__LINE__, 0x06db60ca, "115040458", "%5.d",
-__LINE__, 0x00000f01, " 3841", "% d",
-__LINE__, 0x00000009, "9", "%x",
-__LINE__, 0x299b3ba0, "299b3ba0", "%6.7x",
-__LINE__, 0x0067f298, "67f298", "%-2.6x",
-__LINE__, 0xfffffff5, "FFFFFFF5", "% 2X",
-__LINE__, 0x00102ff9, "102FF9", "%-.0X",
-__LINE__, 0xffc22393, "0xffc22393", "% #6x",
-__LINE__, 0x00007db5, "32181", "%-2ld",
-__LINE__, 0x0000b0a3, "0xb0a3", "%#0x",
-__LINE__, 0x001ceebb, "1CEEBB", "%-3.4X",
-__LINE__, 0x00025101, "0x25101", "%#x",
-__LINE__, -0x0000001, "-1", "%0ld",
-__LINE__, 0xffffd846, "FFFFD846", "%+2.3X",
-__LINE__, 0x00001d79, " 7545", "% 0.1ld",
-__LINE__, -0x0000002, " -2", "%5d",
-__LINE__, 0xf93b9fdc, "f93b9fdc", "%5x",
-__LINE__, 0xffff0021, "FFFF0021", "%6X",
-__LINE__, 0x00007cf9, "7cf9", "%3.1x",
-__LINE__, -0x0000002, "-2", "%d",
-__LINE__, 0x00001d84, "1d84", "%0x",
-__LINE__, -0x033201e, "-3350558", "%-2.0d",
-__LINE__, 0xfff8a6fb, "FFF8A6FB", "%+.7X",
-__LINE__, 0x00006fff, " 28671", "% ld",
-__LINE__, -0x02a274a, "-2762570", "%d",
-__LINE__, -0x0006628, "-26152", "%00ld",
-__LINE__, 0x00000011, "11", "%-x",
-__LINE__, -0x0000ed9, "-3801", "%0.ld",
-__LINE__, 0xfc5b725d, "FC5B725D", "%X",
-__LINE__, 0x3530bd4e, "892386638", "%7.d",
-__LINE__, 0x03bb4ff7, "62607351", "%#4.7ld",
-__LINE__, 0x00009f86, "9f86", "%x",
-__LINE__, 0x0000e727, "59175", "%1d",
-__LINE__, 0xfffffdf2, "0XFFFFFDF2", "%#X",
-__LINE__, 0x00e60dbf, "0XE60DBF", "% #1.X",
-__LINE__, 0xffffffff, "FFFFFFFF", "%+X",
-__LINE__, 0x0a16f44e, "0XA16F44E", "%#.0X",
-__LINE__, 0x0001f97c, "1f97c", "% x",
-__LINE__, 0x0000000d, "13", "%#0ld",
-__LINE__, 0x0000002a, "42", "%0ld",
-__LINE__, 0x00000007, " +7", "%+5ld",
-__LINE__, 0xffffff7f, "FFFFFF7F", "%-X",
-__LINE__, 0x000006a6, "1702", "%ld",
-__LINE__, 0xfaff2fb1, "faff2fb1", "% x",
-__LINE__, 0xffff94ab, "ffff94ab", "%x",
-__LINE__, 0x011d611b, "0X11D611B", "%#2.3X",
-__LINE__, 0x00000000, " +000", "%+#5.3ld",
-__LINE__, -0x87fcc37, "-142593079", "%+d",
-__LINE__, -0x0417424, "-4289572", "%+d",
-__LINE__, 0x03fabc0c, "3fabc0c", "%x",
-__LINE__, 0xfffff880, "fffff880", "%-x",
-__LINE__, 0x000002d7, "2d7", "%-02.x",
-__LINE__, 0x00003e82, "16002", "%#d",
-__LINE__, -0x0003713, "-14099", "% 5d",
-__LINE__, -0x0000027, "-39", "%ld",
-__LINE__, 0x00013098, "0077976", "%01.7d",
-__LINE__, -0x000000c, "-12", "%ld",
-__LINE__, -0x00000c0, "-192", "% ld",
-__LINE__, 0xffbe9285, "FFBE9285", "%3.X",
-__LINE__, 0x00000046, "46", "%x",
-__LINE__, 0x00000000, " ", "%+4.x",
-__LINE__, 0x00011e72, "73330", "%2.3d",
-__LINE__, -0x5276dd7, "-86470103", "%d",
-__LINE__, 0x00000013, "19", "%-02.ld",
-__LINE__, 0x384118a7, "0X384118A7", "%-#X",
-__LINE__, 0x00000000, "0", "% #X",
-__LINE__, 0x00000009, "9", "%#ld",
-__LINE__, 0x00021145, "135493", "%-ld",
-__LINE__, 0xff188a0c, "FF188A0C", "%1.X",
-__LINE__, 0xffffffd5, "ffffffd5", "%0x",
-__LINE__, 0xfffffffe, "FFFFFFFE", "% 0X",
-__LINE__, 0xffff74a3, "ffff74a3", "%x",
-__LINE__, 0x01d5a2f8, "1d5a2f8", "%-0.x",
-__LINE__, 0xfffffef6, "fffffef6", "%+06.x",
-__LINE__, 0x00000001, "1", "%ld",
-__LINE__, 0x00000000, "+0", "%+ld",
-__LINE__, 0xfffffffc, "fffffffc", "%4.x",
-__LINE__, -0x0000344, "-0836", "% .4d",
-__LINE__, 0xfffffffd, "FFFFFFFD", "%0X",
-__LINE__, 0x000a3121, "667937", "%#4.4ld",
-__LINE__, 0x0001e211, "0X1E211", "%#X",
-__LINE__, 0x00000c8b, "00C8B", "%05X",
-__LINE__, 0xfffffffe, "fffffffe", "%+0x",
-__LINE__, 0x001a53ce, "1725390", "%d",
-__LINE__, 0x0000057f, "57f ", "%-7.x",
-__LINE__, -0x0073e4d, "-474701", "%#ld",
-__LINE__, -0x0000002, " -2", "% 3.d",
-__LINE__, 0x482dc404, "482DC404", "%X",
-__LINE__, 0x0000011c, "11c", "%-.1x",
-__LINE__, 0x00000c12, " 3090", "%5.3ld",
-__LINE__, 0xfffe1068, "FFFE1068", "%-.4X",
-__LINE__, -0x0055e88, "-351880", "%ld",
-__LINE__, 0x000c9cef, "+826607", "%+d",
-__LINE__, 0xffffffe3, "ffffffe3", "%0x",
-__LINE__, -0x0000ee9, "-3817", "%#ld",
-__LINE__, 0xff1f6daa, "FF1F6DAA", "%X",
-__LINE__, 0xfffffc4e, "FFFFFC4E", "%5.2X",
-__LINE__, -0x000040a, "-1034", "%d",
-__LINE__, -0x0000085, "-00133", "% 01.5d",
-__LINE__, -0x126c797c, "-309098876", "%5.ld",
-__LINE__, 0x00000039, " 57", "% d",
-__LINE__, 0xfffffff6, "0xfffffff6", "%#5.x",
-__LINE__, 0xfffffff4, "fffffff4", "%7.6x",
-__LINE__, 0x00000003, "3", "%ld",
-__LINE__, 0x0000f8ae, "f8ae", "%.0x",
-__LINE__, 0x003ca1cf, "3973583", "%#3.7d",
-__LINE__, 0x14687009, "0x14687009", "%+#3x",
-__LINE__, 0xfffff1f7, "0xfffff1f7", "%#4.5x",
-__LINE__, 0xfffff17a, "fffff17a", "%3.x",
-__LINE__, 0x0011ea18, "1174040", "%ld",
-__LINE__, -0x0000019, "-25", "%03.d",
-__LINE__, 0x00015d72, "0X15D72", "%-#X",
-__LINE__, 0xffde4a41, "ffde4a41", "%x",
-__LINE__, 0x00006f1f, "28447", "%d",
-__LINE__, 0xffffffbd, "0xffffffbd", "%#.1x",
-__LINE__, 0x000013b9, "13B9", "%0X",
-__LINE__, -0x00001b9, "-00441", "%1.5d",
-__LINE__, 0x00000001, "000001", "%-.6d",
-__LINE__, 0x7b602d8f, "+2069900687", "%+0ld",
-__LINE__, 0x0005e323, "+385827", "%+ld",
-__LINE__, 0x00002fce, "2FCE", "%+0X",
-__LINE__, 0x0000000e, "0014", "%.4d",
-__LINE__, 0xffffffd6, "0XFFFFFFD6", "%#4.X",
-__LINE__, 0x037bf361, "58454881", "%5.ld",
-__LINE__, 0xffffffff, "FFFFFFFF", "%-7.5X",
-__LINE__, -0x016d4dc, "-1496284", "%6ld",
-__LINE__, 0x0005be9a, "0x5be9a", "%-#.5x",
-__LINE__, 0xffffffff, "ffffffff", "%1x",
-__LINE__, 0x00000055, " 85", "% 7.d",
-__LINE__, 0xffffffff, "ffffffff", "%x",
-__LINE__, -0x0135392, "-1266578", "% ld",
-__LINE__, 0x00850f26, "8720166", "%d",
-__LINE__, 0xffffee39, "ffffee39", "%0x",
-__LINE__, 0x000000dd, "221", "%ld",
-__LINE__, 0x00000000, " ", "%6.d",
-__LINE__, 0x000000d8, "d8", "%x",
-__LINE__, 0x000007ec, "002028", "%4.6ld",
-__LINE__, 0x0dab4e67, "0XDAB4E67", "%#X",
-__LINE__, 0xfffd7c95, "FFFD7C95", "% 4X",
-__LINE__, 0x0009302d, "9302D", "%3.1X",
-__LINE__, 0x00000003, " 3", "% d",
-__LINE__, 0x0000082f, "82f", "%-x",
-__LINE__, 0x0652517f, "652517F", "%-.2X",
-__LINE__, -0x1fd8f4e3, "-534312163", "%d",
-__LINE__, 0x00000176, "176", "%-x",
-__LINE__, 0x00000001, "1", "%ld",
-__LINE__, 0x0000001a, "1A", "%X",
-__LINE__, -0x0005740, "-22336", "% 0ld",
-__LINE__, 0xffffffff, "ffffffff", "%6x",
-__LINE__, 0x1b273b80, "0x1b273b80", "%#x",
-__LINE__, 0x00000065, "65", "%X",
-__LINE__, 0x6a62138a, "1784812426", "%2ld",
-__LINE__, 0x000001a2, "1A2", "%X",
-__LINE__, -0x002aafd, "-174845", "%02.ld",
-__LINE__, 0x00000014, "20", "%d",
-__LINE__, -0x00000c7, " -199", "%7.0ld",
-__LINE__, 0xff545bfd, "ff545bfd", "%-x",
-__LINE__, -0x002beb9, "-179897", "%02.2ld",
-__LINE__, -0x00000df, "-223", "% 02.d",
-__LINE__, -0x000d569, "-54633", "%1.ld",
-__LINE__, 0x0000000e, "14", "%d",
-__LINE__, -0x0077407, "-488455", "% ld",
-__LINE__, 0x0001be09, "114185", "%ld",
-__LINE__, -0x0000514, "-01300", "%+05.5d",
-__LINE__, 0xf1fb397f, "f1fb397f", "%+x",
-__LINE__, 0xfdb6707c, "FDB6707C", "%X",
-__LINE__, 0x03cad111, "3cad111", "%5.x",
-__LINE__, -0x022e72f, "-2287407", "%d",
-__LINE__, -0xda35f48, "-228810568", "%d",
-__LINE__, -0x02d1fd4, "-2957268", "%1.3d",
-__LINE__, 0x0000005f, "+95", "%+2d",
-__LINE__, 0xfffbf8a1, "FFFBF8A1", "%4.2X",
-__LINE__, 0x0000071e, " 71e", "%6.x",
-__LINE__, 0x000cc8a5, "+837797", "%+03ld",
-__LINE__, 0x000eebe9, " EEBE9", "%6.X",
-__LINE__, -0x2896b204, "-680964612", "%d",
-__LINE__, -0x09553f8, "-9786360", "%d",
-__LINE__, 0x000015d3, "5587", "%0d",
-__LINE__, 0x0000056d, " 56d", "%+4.x",
-__LINE__, -0x00624ad, "-402605", "% ld",
-__LINE__, 0xfea64ba5, "0xfea64ba5", "%#1x",
-__LINE__, 0x004f35c6, "5191110", "%-ld",
-__LINE__, -0x1441fe4, "-21241828", "%d",
-__LINE__, 0xffffff95, "FFFFFF95", "%X",
-__LINE__, 0xfffecf81, "FFFECF81", "%-2.X",
-__LINE__, -0x00002bb, "-699", "%-d",
-__LINE__, -0x0000c29, "-3113", "% 02ld",
-__LINE__, 0x000026a3, " 9891", "% .4d",
-__LINE__, 0x00000003, "3", "%-x",
-__LINE__, 0x000007db, "+02011", "%+.5ld",
-__LINE__, 0xfff99558, "FFF99558", "%.1X",
-__LINE__, 0x0000fce6, "64742", "%4.0d",
-__LINE__, 0x000b7ea2, "753314", "%ld",
-__LINE__, 0x13e5df30, "0X13E5DF30", "%#2.X",
-__LINE__, 0x006761c4, "06761C4", "%6.7X",
-__LINE__, 0xffffff78, "FFFFFF78", "%0.X",
-__LINE__, 0xfffff1c0, "0xfffff1c0", "% #x",
-__LINE__, -0x034af1c, "-3452700", "% 06.1d",
-__LINE__, 0x000000de, "0000222", "%2.7ld",
-__LINE__, 0x000003d8, "0x3d8", "%#4.x",
-__LINE__, -0x001a1d1, "-106961", "%3.1d",
-__LINE__, -0x0000002, "-2", "% d",
-__LINE__, 0x00001de6, "+7654", "%+0ld",
-__LINE__, 0x00000001, "001", "%#.3d",
-__LINE__, -0x53dacf9f, "-1406848927", "%ld",
-__LINE__, 0xfffffffc, "fffffffc", "%3.3x",
-__LINE__, -0x00950e8, "-610536", "%3.6ld",
-__LINE__, 0xff14ade9, "FF14ADE9", "%6X",
-__LINE__, 0x012f5284, "0X12F5284", "% #5X",
-__LINE__, 0x00005a21, " 5a21", "%5x",
-__LINE__, 0x00000638, "1592", "%2.4ld",
-__LINE__, -0x063017b, "-6488443", "%ld",
-__LINE__, 0x00000000, "0", "% X",
-__LINE__, 0xfffe8ef2, "FFFE8EF2", "%+0X",
-__LINE__, -0x0001c96, "-7318", "%.3d",
-__LINE__, 0x0000ca7d, "51837", "%ld",
-__LINE__, 0x00000001, "1", "%+1x",
-__LINE__, 0xfffff7bc, "FFFFF7BC", "%X",
-__LINE__, -0x03d15e2, "-4003298", "%ld",
-__LINE__, 0xfffffffe, "fffffffe", "% x",
-__LINE__, 0x00066183, "+418179", "%+7.1ld",
-__LINE__, 0xffffef2e, "ffffef2e", "%-2.x",
-__LINE__, 0x00000000, " 000", "%04.3x",
-__LINE__, -0x000000f, "-15", "% d",
-__LINE__, -0x00001f5, "-501", "%d",
-__LINE__, 0x0c67f159, "c67f159", "%6.2x",
-__LINE__, -0x0000006, "-6", "%.1d",
-__LINE__, 0x00000005, "0X5", "%+#1X",
-__LINE__, -0x0000002, " -2", "%6.ld",
-__LINE__, 0xeb2183ec, "eb2183ec", "% x",
-__LINE__, -0x5e12a322, "-1578279714", "%d",
-__LINE__, 0x00000001, "0x1", "%#x",
-__LINE__, -0x0001ea4, "-7844", "%0d",
-__LINE__, -0x19955a3, "-26826147", "%d",
-__LINE__, 0x000002a6, "2A6", "%2.X",
-__LINE__, 0x00000002, "2", "%X",
-__LINE__, 0xfffffeec, "fffffeec", "%0.4x",
-__LINE__, 0xfffffffc, "fffffffc", "%0x",
-__LINE__, 0xffdfe740, "FFDFE740", "% X",
-__LINE__, -0x0b0b3e7, "-11580391", "%.1d",
-__LINE__, 0x8e01077c, "8E01077C", "%5.7X",
-__LINE__, 0x3b6b6d55, "996896085", "%1.1d",
-__LINE__, 0x000016af, "5807", "%ld",
-__LINE__, -0x0004900, "-18688", "%d",
-__LINE__, 0xfffd77bc, "FFFD77BC", "%X",
-__LINE__, 0x004cbd74, "5029236", "%0d",
-__LINE__, 0x00000003, " 00003", "%6.5d",
-__LINE__, 0x0004720f, "4720f", "% x",
-__LINE__, 0x0e44535d, "e44535d", "%4x",
-__LINE__, 0xfffffff9, "FFFFFFF9", "%3.3X",
-__LINE__, -0x0000005, "-5", "%-d",
-__LINE__, 0x000001a6, "00001A6", "%1.7X",
-__LINE__, 0x0000004a, "4A", "%-2.X",
-__LINE__, 0xfffff249, "FFFFF249", "%X",
-__LINE__, 0x00004345, "4345", "%x",
-__LINE__, 0x0197041d, "197041d", "%+0x",
-__LINE__, 0x0000019a, " 19a", "% 6.x",
-__LINE__, 0xfff98376, "FFF98376", "%X",
-__LINE__, 0xfc536c41, "FC536C41", "%X",
-__LINE__, -0x0008d91, "-36241", "% d",
-__LINE__, 0xf058d69d, "f058d69d", "%4.x",
-__LINE__, -0x00013ef, "-5103", "%d",
-__LINE__, -0x0000003, "-3", "%00ld",
-__LINE__, -0x09e80f0, "-10387696", "%+07ld",
-__LINE__, -0x0222c15, "-2239509", "%#0.4ld",
-__LINE__, 0x00000004, "4", "%0ld",
-__LINE__, -0x02c6b0d, "-2910989", "% 0ld",
-__LINE__, 0xfffffffe, "FFFFFFFE", "%-4X",
-__LINE__, 0xffffff3d, "FFFFFF3D", "%-.0X",
-__LINE__, -0x0000015, "-21", "%0d",
-__LINE__, 0x131dfc90, "+320732304", "%+d",
-__LINE__, 0xffffffff, "ffffffff", "%+x",
-__LINE__, 0x000035c8, "13768", "%0ld",
-__LINE__, 0x00000033, "0x0033", "%#.4x",
-__LINE__, 0x0ce7e8c1, "0xce7e8c1", "%#.7x",
-__LINE__, 0xfc18b5d2, "FC18B5D2", "%+.3X",
-__LINE__, 0x00000015, "21", "%d",
-__LINE__, 0x001a5e7c, "1a5e7c", "%05x",
-__LINE__, -0x000fbf0, "-64496", "%ld",
-__LINE__, -0x000a4f7, "-042231", "%+2.6d",
-__LINE__, -0x0000002, "-002", "%3.3ld",
-__LINE__, 0x00728878, "728878", "%0X",
-__LINE__, -0x0000002, "-2", "%#.1ld",
-__LINE__, -0x00002ef, "-751", "%-0ld",
-__LINE__, 0xfffffff7, "fffffff7", "%.3x",
-__LINE__, 0x00491867, "0491867", "%.7X",
-__LINE__, 0x00000d4d, "3405", "%-ld",
-__LINE__, 0x00234e86, "234E86", "%0X",
-__LINE__, -0x000001b, "-27", "%ld",
-__LINE__, 0x00275255, "2576981", "%.5ld",
-__LINE__, 0xfeacc214, "0XFEACC214", "%-#3.X",
-__LINE__, -0x0001ce5, "-7397", "%+#2.2ld",
-__LINE__, 0x089ddb6a, "144563050", "%d",
-__LINE__, 0x003d5a95, "3D5A95", "%1X",
-__LINE__, 0x002f0b6d, "3083117", "%d",
-__LINE__, 0x1e79e228, "511304232", "%ld",
-__LINE__, 0xfffffe6b, "FFFFFE6B", "%+0X",
-__LINE__, -0x5104ff3, "-84955123", "%.4ld",
-__LINE__, 0xfffff1de, "FFFFF1DE", "%X",
-__LINE__, 0x000000cf, "+207", "%+.1ld",
-__LINE__, -0x16ad0164, "-380436836", "%+5.d",
-__LINE__, 0x001fefa6, "2092966", "%ld",
-__LINE__, 0x00000000, "00", "%-.2d",
-__LINE__, 0x00195f45, "195f45", "%+0x",
-__LINE__, 0x00000001, " 1", "%3.ld",
-__LINE__, -0x00001c9, "-457", "% ld",
-__LINE__, 0x0002479e, "149406", "%#ld",
-__LINE__, 0x001ab18b, "1749387", "%04d",
-__LINE__, 0x00000045, "69", "%ld",
-__LINE__, 0xfbb13f7d, "fbb13f7d", "%.2x",
-__LINE__, 0x03ddc208, "3ddc208", "%x",
-__LINE__, 0x00000007, "000007", "%#.6d",
-__LINE__, 0x00000000, "0", "%01X",
-__LINE__, -0x0023110, "-143632", "%+0.3d",
-__LINE__, 0x00000006, "06", "%#.2d",
-__LINE__, 0xffff9ec9, "ffff9ec9", "%7x",
-__LINE__, -0x08afb12, "-9108242", "% #0.ld",
-__LINE__, 0x00000004, "4", "%X",
-__LINE__, 0x00059684, "59684", "%x",
-__LINE__, 0xfff8d8f5, "FFF8D8F5", "%X",
-__LINE__, 0x00b7027d, "+11993725", "%+0.7ld",
-__LINE__, 0x0000d814, "55316", "%0ld",
-__LINE__, 0x03c95a08, "3c95a08", "%3x",
-__LINE__, -0x0b65f9a, "-11952026", "%d",
-__LINE__, 0xfd956021, "fd956021", "%0x",
-__LINE__, 0x000000ed, "ed", "%0x",
-__LINE__, -0x006a80c, "-436236", "%.6ld",
-__LINE__, 0xfedb109d, "fedb109d", "%x",
-__LINE__, 0x00000001, "1", "%X",
-__LINE__, 0x00b3eb71, " 11791217", "% d",
-__LINE__, 0x00000016, "16", "%0X",
-__LINE__, 0x000001db, " 475", "% ld",
-__LINE__, 0x00465eaf, "4611759", "%0d",
-__LINE__, 0x0001b423, "1B423", "%0X",
-__LINE__, 0x05df95ea, "5df95ea", "%+.5x",
-__LINE__, 0x0000000e, " 14", "%7ld",
-__LINE__, 0xffffb89e, "ffffb89e", "%+x",
-__LINE__, 0x01259918, " 19241240", "% d",
-__LINE__, -0x0000f8d, "-003981", "%+#.6d",
-__LINE__, 0x00054ae0, "54AE0", "%X",
-__LINE__, -0x4589ed4, "-72916692", "% ld",
-__LINE__, 0x01017516, "1017516", "%6X",
-__LINE__, 0xfffb9f15, "FFFB9F15", "%.2X",
-__LINE__, 0x005f8394, "5F8394", "%.2X",
-__LINE__, 0xffffffff, "ffffffff", "%x",
-__LINE__, -0x0000001, " -1", "%7.1ld",
-__LINE__, 0x004367af, "4417455", "%4.ld",
-__LINE__, 0xffffff86, "ffffff86", "%4.5x",
-__LINE__, -0x0000d17, "-3351", "%2.0ld",
-__LINE__, 0xffffff31, "ffffff31", "%.6x",
-__LINE__, -0x0000001, "-1", "%ld",
-__LINE__, -0x3d785fab, "-1031298987", "%d",
-__LINE__, -0x0000002, "-2", "%-0ld",
-__LINE__, 0x0000019c, "412", "%d",
-__LINE__, -0x0006f54, "-28500", "%d",
-__LINE__, 0xfffe3524, "FFFE3524", "% 6.2X",
-__LINE__, -0x128d3c00, "-311245824", "%2d",
-__LINE__, -0x3be71293, "-1004999315", "%d",
-__LINE__, 0x0000659d, "26013", "%d",
-__LINE__, 0x2d947538, "+764704056", "%+5d",
-__LINE__, 0xffa2a420, "FFA2A420", "%0X",
-__LINE__, 0x00000001, "1", "%d",
-__LINE__, 0x04477c14, "4477c14", "%.6x",
-__LINE__, -0x06e145b, "-7214171", "%d",
-__LINE__, 0x00009c01, "39937", "%-.1d",
-__LINE__, 0xffde174b, "ffde174b", "% 0x",
-__LINE__, 0x0001fbae, "1FBAE", "%01.X",
-__LINE__, -0x06b8406, "-7046150", "%d",
-__LINE__, 0x000005b8, "005b8", "%05x",
-__LINE__, -0x02d780b, "-2979851", "%1d",
-__LINE__, 0x00209e26, "2137638", "%2d",
-__LINE__, 0x0000041a, "41A", "%0X",
-__LINE__, 0x2a77f42c, "2A77F42C", "%02X",
-__LINE__, 0x13b6ee14, "+330755604", "%+0d",
-__LINE__, -0x0000002, "-2 ", "%-6.d",
-__LINE__, -0x0001eee, "-7918", "% #2.ld",
-__LINE__, 0xffffffff, "FFFFFFFF", "% .5X",
-__LINE__, 0x20d11927, "20d11927", "% 0.x",
-__LINE__, -0x0018690, "-99984", "% ld",
-__LINE__, 0x000002a0, "2A0", "%-0X",
-__LINE__, -0x0000511, "-1297", "%+d",
-__LINE__, 0x0e782f31, "242757425", "%-0.ld",
-__LINE__, 0x2ce06da0, "752905632", "%#0ld",
-__LINE__, 0x00000062, "62 ", "%-07x",
-__LINE__, -0x015d9d8, "-1432024", "% 7d",
-__LINE__, 0xc9125ea8, "c9125ea8", "%x",
-__LINE__, 0x00000006, "6", "%.0ld",
-__LINE__, 0x0000019c, "19c", "%x",
-__LINE__, 0x00000000, " ", "%6.d",
-__LINE__, 0x00043e89, "278153", "%0ld",
-__LINE__, 0x3e422abd, "1044523709", "%ld",
-__LINE__, 0x0220a75d, "35694429", "%#7.6d",
-__LINE__, 0x0000c21c, "C21C", "% X",
-__LINE__, 0x000074ab, "29867", "%d",
-__LINE__, 0x056b22aa, "56B22AA", "%+0.X",
-__LINE__, 0xfffffff9, "FFFFFFF9", "%X",
-__LINE__, 0x00000000, "0", "%X",
-__LINE__, 0xf094a4f4, "f094a4f4", "%+4.x",
-__LINE__, -0x1dad0244, "-497877572", "%d",
-__LINE__, 0xffffffff, "FFFFFFFF", "%.1X",
-__LINE__, 0xfffffe2d, "fffffe2d", "%7.x",
-__LINE__, 0x0000042b, "0x42b", "%#x",
-__LINE__, -0x0000001, "-1", "% d",
-__LINE__, 0x00e77ef5, " 15171317", "% 7.ld",
-__LINE__, 0x00006210, " 25104", "% 06d",
-__LINE__, 0x0011187a, "1120378", "%-ld",
-__LINE__, -0x000000b, "-11", "% #ld",
-__LINE__, 0x14cfaff0, "14cfaff0", "%-2.3x",
-__LINE__, 0xffff74ea, "FFFF74EA", "%3.X",
-__LINE__, 0x000bfb9d, "bfb9d", "%x",
-__LINE__, 0xfffffffe, "FFFFFFFE", "%X",
-__LINE__, 0x00014500, "0X14500", "%#4.X",
-__LINE__, -0x0000001, "-1", "%#1d",
-__LINE__, -0x0000024, "-36", "%-0d",
-__LINE__, -0x6528828, "-106072104", "%d",
-__LINE__, 0x00000075, " 117", "% #d",
-__LINE__, 0xff027d67, "ff027d67", "%0x",
-__LINE__, 0x0012b8b3, "12b8b3", "%0.1x",
-__LINE__, 0x1070147b, "275780731", "%.6ld",
-__LINE__, 0xffffe88e, "FFFFE88E", "%1.3X",
-__LINE__, 0xfffffc0d, "fffffc0d", "%00.6x",
-__LINE__, 0xffd889f5, "ffd889f5", "%x",
-__LINE__, 0x00000470, "1136", "%0ld",
-__LINE__, 0x000297f8, "169976", "%ld",
-__LINE__, 0xfffffffe, "fffffffe", "%+1x",
-__LINE__, 0x0000064a, "64a", "%x",
-__LINE__, -0x3d71e43b, "-1030874171", "%1.d",
-__LINE__, -0x0000004, "-4 ", "%-3.d",
-__LINE__, 0xfffff132, "FFFFF132", "%0.0X",
-__LINE__, 0x37b6356f, "37b6356f", "%-x",
-__LINE__, 0xffffff7a, "FFFFFF7A", "%.0X",
-__LINE__, 0x00023553, "23553", "%x",
-__LINE__, 0x39a4c29f, "39a4c29f", "%+5.x",
-__LINE__, 0xffffffcc, "ffffffcc", "%x",
-__LINE__, 0x0003a83b, "239675", "%#6ld",
-__LINE__, 0x00000002, "2", "%0x",
-__LINE__, -0x09b4e8c, "-10178188", "%+03.ld",
-__LINE__, 0x00000002, "0000002", "%-#.7ld",
-__LINE__, 0x00000b5e, "2910", "%-04ld",
-__LINE__, -0x0000254, "-596", "%+0d",
-__LINE__, 0x00000001, "1", "%+1.x",
-__LINE__, 0xf8290d3e, "0XF8290D3E", "% #X",
-__LINE__, 0x00000035, "035", "%3.3X",
-__LINE__, 0x00131d7d, "131D7D ", "%-7.6X",
-__LINE__, 0xffdbb36a, "0xffdbb36a", "%#.6x",
-__LINE__, 0xc7275816, "c7275816", "%04.x",
-__LINE__, 0x00bae994, "12249492", "%0ld",
-__LINE__, 0x00000002, "+2", "%+0.0ld",
-__LINE__, 0xffffffff, "ffffffff", "%0x",
-__LINE__, 0xffffffe0, "ffffffe0", "%x",
-__LINE__, 0x00000036, "36", "%.0X",
-__LINE__, 0xfffffffd, "FFFFFFFD", "%1X",
-__LINE__, 0xffffffc8, "ffffffc8", "%+x",
-__LINE__, 0xe71c3689, "e71c3689", "%x",
-__LINE__, 0x00000007, "7 ", "%-3.ld",
-__LINE__, 0xffffffff, "ffffffff", "%x",
-__LINE__, 0x00030400, "030400", "%-4.6x",
-__LINE__, 0xbd8c6fa7, "BD8C6FA7", "%-6X",
-__LINE__, 0x00000233, "0000563", "%.7ld",
-__LINE__, 0xfef92e35, "fef92e35", "%x",
-__LINE__, 0xffff2172, "ffff2172", "%3x",
-__LINE__, 0x00001233, "1233", "% X",
-__LINE__, -0x000d2e1, "-53985", "%-0d",
-__LINE__, -0x3ba8cb5b, "-1000917851", "%0d",
-__LINE__, -0x4fefb9a, "-83819418", "%5.ld",
-__LINE__, 0xffffe9eb, "FFFFE9EB", "%X",
-__LINE__, 0x1e472dc3, "507981251", "%ld",
-__LINE__, -0x0077046, "-487494", "%0d",
-__LINE__, 0x0002c4c9, "+181449", "%+7.d",
-__LINE__, 0xfffffe63, "fffffe63", "%x",
-__LINE__, 0xfff5a6db, "FFF5A6DB", "%X",
-__LINE__, 0x00174442, "174442", "%-5.0X",
-__LINE__, 0x017891d9, "17891D9", "%+5.X",
-__LINE__, 0x0261966b, "261966B", "%-X",
-__LINE__, -0x3e58614d, "-1045979469", "%ld",
-__LINE__, 0x002c4c41, "+2903105", "%+01ld",
-__LINE__, 0x0000000c, "012", "%#.3d",
-__LINE__, 0x0380f73a, "58783546", "%ld",
-__LINE__, 0x000002c7, "0000711", "%2.7ld",
-__LINE__, 0x00000002, " 002", "% 04ld",
-__LINE__, 0x00687ca0, "687CA0", "%X",
-__LINE__, 0x0000058a, "1418", "%0ld",
-__LINE__, -0x0000642, "-1602", "% ld",
-__LINE__, 0x0001f4f1, "1F4F1", "%X",
-__LINE__, 0x0026d6fc, "+2545404", "%+4.ld",
-__LINE__, 0x05dd423c, "+98386492", "%+#ld",
-__LINE__, 0x0000782c, "0782C", "%3.5X",
-__LINE__, 0xf67d91f8, "f67d91f8", "%-x",
-__LINE__, 0xffffcf2d, "ffffcf2d", "%+0x",
-__LINE__, -0x00af8a6, "-719014", "%0ld",
-__LINE__, -0xe606ef9, "-241200889", "%ld",
-__LINE__, 0xfe9d87f7, "fe9d87f7", "%+x",
-__LINE__, 0x00000d44, "d44", "% 1.x",
-__LINE__, 0x008716f5, "8716f5", "%2x",
-__LINE__, 0x000027d4, "27D4", "% X",
-__LINE__, 0xfdfd92ea, "FDFD92EA", "%-.4X",
-__LINE__, 0xfffe764f, "FFFE764F", "%X",
-__LINE__, 0xff699032, "ff699032", "%3.x",
-__LINE__, 0xffffffff, "FFFFFFFF", "%-3X",
-__LINE__, -0x368ba995, "-915122581", "%+#.6ld",
-__LINE__, 0xffffffff, "ffffffff", "%0x",
-__LINE__, 0x0000035e, " 862", "% 1d",
-__LINE__, 0xfe703e67, "fe703e67", "%07.0x",
-__LINE__, 0xfffffffe, "fffffffe", "%4.x",
-__LINE__, 0x000e20cf, "e20cf", "%0x",
-__LINE__, 0x000063b5, "0X63B5", "%-#X",
-__LINE__, 0xfffffffa, "fffffffa", "%+2.x",
-__LINE__, 0xffffffff, "FFFFFFFF", "%2.X",
-__LINE__, 0xfdfd69da, "FDFD69DA", "%.0X",
-__LINE__, 0x00002f61, "0x2f61", "%#3.x",
-__LINE__, 0x00000009, "9", "%x",
-__LINE__, 0xffffff86, "ffffff86", "%6x",
-__LINE__, 0xffffffe4, "ffffffe4", "%0x",
-__LINE__, 0x0062e73b, "+6481723", "%+0ld",
-__LINE__, -0x2b059130, "-721785136", "%+d",
-__LINE__, -0x0000073, "-115", "%d",
-__LINE__, 0xf596efcf, "f596efcf", "%x",
-__LINE__, 0x0002f1cb, "2F1CB", "%0X",
-__LINE__, -0x0000635, "-01589", "%.5ld",
-__LINE__, 0xfffa011a, "FFFA011A", "%0X",
-__LINE__, 0x00000047, " 47", "%4X",
-__LINE__, 0xfffffbc0, "FFFFFBC0", "%5.2X",
-__LINE__, 0x00000015, "15", "% X",
-__LINE__, 0x002a87a6, "2a87a6", "%.1x",
-__LINE__, -0x000069c, "-1692", "%+ld",
-__LINE__, 0xfffffffd, "fffffffd", "%+x",
-__LINE__, 0xfeda51f5, "FEDA51F5", "%0X",
-__LINE__, 0x001781a4, "1781a4", "%-0x",
-__LINE__, 0xe77358d4, "e77358d4", "%+0x",
-__LINE__, 0x00000084, " 84", "%3.x",
-__LINE__, 0xffff0cb2, "FFFF0CB2", "%+5.X",
-__LINE__, 0x0009fa17, "653847", "%0.0ld",
-__LINE__, -0x0000c92, "-3218", "%d",
-__LINE__, 0x0004ebbb, "4ebbb", "%x",
-__LINE__, 0x2e72568c, "+779245196", "%+#ld",
-__LINE__, 0xffae86a7, "ffae86a7", "%.7x",
-__LINE__, 0xffdf3f04, "ffdf3f04", "%x",
-__LINE__, 0x000000c7, "199", "%2.d",
-__LINE__, -0x0004a55, "-19029", "%ld",
-__LINE__, 0x00564ef9, "5656313", "%.6ld",
-__LINE__, 0xffffc205, "ffffc205", "%+.0x",
-__LINE__, -0x135085d0, "-324044240", "%#.5d",
-__LINE__, 0xfffffffe, "fffffffe", "%-7x",
-__LINE__, -0x0000003, "-3", "%.1ld",
-__LINE__, 0xffda9e0b, "ffda9e0b", "%+0x",
-__LINE__, 0x00000001, "1", "%d",
-__LINE__, 0xffffffda, "ffffffda", "%.6x",
-__LINE__, 0x5efdb3d1, "+1593684945", "%+0d",
-__LINE__, -0x00000ca, "-202", "% 4.d",
-__LINE__, -0x0014433, "-82995", "%.3d",
-__LINE__, -0x0000002, "-000002", "% .6ld",
-__LINE__, 0x24aac879, "615172217", "%.7d",
-__LINE__, -0x1db3c1d, "-31144989", "%+#4ld",
-__LINE__, 0x000945ad, "0x945ad", "%#1x",
-__LINE__, 0x0000000a, "10", "%#.1ld",
-__LINE__, -0x002a2e5, "-172773", "%d",
-__LINE__, 0xfffffff3, "FFFFFFF3", "%5X",
-__LINE__, 0x0000000e, "e", "%+x",
-__LINE__, 0x335333dc, "861090780", "%6.d",
-__LINE__, 0xfffa16f4, "FFFA16F4", "%6X",
-__LINE__, 0xffffc727, "ffffc727", "%+2.x",
-__LINE__, 0x00000273, "273", "%x",
-__LINE__, -0x000000f, "-15", "%-0d",
-__LINE__, 0x00065fbd, "417725", "%5.1d",
-__LINE__, 0x00000ed5, "3797", "%d",
-__LINE__, 0x30a40024, "30A40024", "%3.7X",
-__LINE__, 0x00000054, "84", "%ld",
-__LINE__, 0x00000515, "01301", "%.5ld",
-__LINE__, 0x00000897, "+02199", "%+.5d",
-__LINE__, -0x0001bcc, "-7116", "% ld",
-__LINE__, 0xfffffffe, "FFFFFFFE", "%7X",
-__LINE__, 0x00000013, "0X13", "%#X",
-__LINE__, 0xffffffff, "0xffffffff", "% #x",
-__LINE__, 0x00000006, "6", "%ld",
-__LINE__, -0x00000c3, "-195", "%1.ld",
-__LINE__, -0x005291e, "-338206", "%+d",
-__LINE__, 0xffb437a7, "FFB437A7", "%-0X",
-__LINE__, 0xff8335cb, "ff8335cb", "%x",
-__LINE__, 0x0000006a, "6A", "%2X",
-__LINE__, -0x004f629, "-325161", "% .4d",
-__LINE__, 0x003698ef, "3578095", "%0ld",
-__LINE__, 0x6b5cdf3a, "6b5cdf3a", "%-x",
-__LINE__, 0xe9bc5c21, "e9bc5c21", "%+x",
-__LINE__, -0x0000001, " -1", "%+6.ld",
-__LINE__, 0xfffeffc8, "FFFEFFC8", "%6.X",
-__LINE__, 0xff070a73, "ff070a73", "%+.7x",
-__LINE__, 0x0023f8ae, "2357422", "%07.4ld",
-__LINE__, 0x00000000, "0", "%X",
-__LINE__, 0x00000016, "16", "%0X",
-__LINE__, -0x000005a, " -90", "%4d",
-__LINE__, 0x00000116, "116", "% .3x",
-__LINE__, 0xfffed024, "fffed024", "%-x",
-__LINE__, 0xfb907950, "fb907950", "%.0x",
-__LINE__, 0x0101a1e5, "101a1e5", "%x",
-__LINE__, -0x09e7684, "-10385028", "%-#ld",
-__LINE__, 0xffffffff, "ffffffff", "%1x",
-__LINE__, 0xfffffff6, "fffffff6", "%x",
-__LINE__, 0x00000078, "78", "%x",
-__LINE__, 0xe6bca9c9, "0XE6BCA9C9", "%#.5X",
-__LINE__, -0x0000010, "-16", "%d",
-__LINE__, -0x1348f685, "-323548805", "%d",
-__LINE__, 0x4dd85797, "1306023831", "%ld",
-__LINE__, -0x0000080, "-128", "%.2d",
-__LINE__, -0xaed13a7, "-183309223", "%+ld",
-__LINE__, -0x000002f, "-47", "% d",
-__LINE__, -0x679911f, "-108630303", "%ld",
-__LINE__, 0xfffff221, "FFFFF221", "% .7X",
-__LINE__, 0x0007476c, "7476c", "%x",
-__LINE__, 0xffffe02a, "0xffffe02a", "%#7x",
-__LINE__, 0x00000ebb, "0XEBB", "%#X",
-__LINE__, 0xffffffff, "0XFFFFFFFF", "%-#X",
-__LINE__, 0x00281896, "281896", "%+1.x",
-__LINE__, 0x0000085d, " 0X85D", "%#6.3X",
-__LINE__, 0x000112bf, "112BF", "%X",
-__LINE__, 0xf5518fbf, "F5518FBF", "% X",
-__LINE__, -0x00c945b, "-824411", "%ld",
-__LINE__, 0x00001b43, "0x1b43", "%-#x",
-__LINE__, -0x5872a246, "-1483907654", "%#7.7ld",
-__LINE__, 0x00001f96, "8086", "%#d",
-__LINE__, 0xfffffff9, "FFFFFFF9", "%X",
-__LINE__, -0x006e244, "-451140", "% .3d",
-__LINE__, -0x0382188, "-3678600", "%0.2ld",
-__LINE__, 0x00000006, "6", "%-x",
-__LINE__, 0x00000036, "54 ", "%-5.d",
-__LINE__, -0x0000439, " -1081", "%#6.3ld",
-__LINE__, 0xfff911c6, "FFF911C6", "%X",
-__LINE__, -0x03454dc, "-3429596", "%d",
-__LINE__, -0x0363e8d, "-3554957", "%-.2ld",
-__LINE__, 0x00000000, "000", "%.3X",
-__LINE__, -0x59bb030f, "-1505428239", "%0ld",
-__LINE__, 0x073c94d8, "121410776", "%-d",
-__LINE__, -0x001ef94, "-126868", "%5.1ld",
-__LINE__, 0xfff65fc5, "FFF65FC5", "%0X",
-__LINE__, 0xfffffff4, "fffffff4", "%-x",
-__LINE__, 0x00001d83, "07555", "%5.5d",
-__LINE__, 0x0012b40a, "1225738", "%ld",
-__LINE__, -0x0000006, "-6", "%0ld",
-__LINE__, 0xfffffffc, "fffffffc", "%06.0x",
-__LINE__, -0x0000002, "-00002", "%#.5ld",
-__LINE__, 0xf9932c1d, "f9932c1d", "%-x",
-__LINE__, -0x46a31d9, "-74068441", "%.3ld",
-__LINE__, 0x000987e9, "987E9", "%1X",
-__LINE__, 0x0000000f, "15", "%-ld",
-__LINE__, -0x0001c4d, "-7245", "%ld",
-__LINE__, -0x007deee, "-515822", "%2.6d",
-__LINE__, 0xffffffa2, "FFFFFFA2", "%.6X",
-__LINE__, 0x00000001, "1", "%-ld",
-__LINE__, 0xfc106bde, "fc106bde", "%.4x",
-__LINE__, 0x0002f1f8, "0x2f1f8", "%#7.x",
-__LINE__, -0x06a290b, "-6957323", "%-ld",
-__LINE__, -0x0000037, " -55", "%4ld",
-__LINE__, 0x0000152e, "5422", "%2.d",
-__LINE__, 0xfffffcb2, "0XFFFFFCB2", "%#3.X",
-__LINE__, 0x1b7ca086, "1b7ca086", "%+x",
-__LINE__, 0x00000001, "1", "%ld",
-__LINE__, 0x006775fc, "6775fc", "%3.2x",
-__LINE__, 0x0000000e, "0XE", "%#3.X",
-__LINE__, 0xffffffff, "0xffffffff", "%+#4.x",
-__LINE__, 0x00001246, "1246", "%X",
-__LINE__, 0xffffaed6, "ffffaed6", "%2x",
-__LINE__, -0x3a2dec78, "-976088184", "% 0ld",
-__LINE__, 0x0001423b, "1423b", "%01x",
-__LINE__, 0x00000007, " 0X7", "%#4.X",
-__LINE__, 0x01a7ff5a, "27787098", "%.4ld",
-__LINE__, -0x0020d05, "-134405", "%-d",
-__LINE__, 0xffffff9a, "ffffff9a", "%-.1x",
-__LINE__, 0xffff3557, "ffff3557", "%x",
-__LINE__, 0x08828e35, "8828e35", "%+.1x",
-__LINE__, 0x000006b2, "001714", "%04.6ld",
-__LINE__, 0x00000013, "19", "%.0ld",
-__LINE__, -0x00341a5, "-213413", "%#d",
-__LINE__, -0x0000043, "-67", "%d",
-__LINE__, -0x074dce3, "-7658723", "%.1d",
-__LINE__, -0x16de2df3, "-383659507", "% ld",
-__LINE__, 0x00000000, "0", "%x",
-__LINE__, 0x00000ce7, "ce7", "% 2.1x",
-__LINE__, 0xffecd377, "ffecd377", "% 0x",
-__LINE__, 0xa4e8465c, "a4e8465c", "% x",
-__LINE__, 0x000005e8, "1512", "%d",
-__LINE__, 0x00000513, "1299", "%d",
-__LINE__, 0xffffffb8, "FFFFFFB8", "%X",
-__LINE__, 0x00000003, "00003", "%3.5x",
-__LINE__, -0x0000003, "-3 ", "%-3.ld",
-__LINE__, 0xad53f01d, "ad53f01d", "%0x",
-__LINE__, 0x0f1c1dae, "253500846", "%-#.0d",
-__LINE__, 0xff1753c0, "0xff1753c0", "%#3.x",
-__LINE__, -0x00389c5, "-231877", "%d",
-__LINE__, 0x0000016e, "00016E", "%.6X",
-__LINE__, -0x54d3310f, "-1423126799", "%-d",
-__LINE__, 0x00000005, "0X5", "%#.1X",
-__LINE__, 0xfffffffd, "0XFFFFFFFD", "%#5.3X",
-__LINE__, 0xfffffe0e, "fffffe0e", "%-x",
-__LINE__, 0xa3c02157, "a3c02157", "%.5x",
-__LINE__, 0x00005765, "22373", "%d",
-__LINE__, -0x12668cd, "-19294413", "%+ld",
-__LINE__, -0x66544da, "-107300058", "%2d",
-__LINE__, 0x8646c605, "0X8646C605", "% #X",
-__LINE__, 0x000001f5, "1F5", "%X",
-__LINE__, 0x01b33ae4, "28523236", "%5ld",
-__LINE__, 0x000007ce, "7ce", "%3.x",
-__LINE__, 0x00000355, "355", "%X",
-__LINE__, 0x000001ce, "1CE", "% X",
-__LINE__, 0xfffffccd, "fffffccd", "%7.0x",
-__LINE__, -0x0000001, "-1", "%0ld",
-__LINE__, 0x000640b6, "640b6", "%5.x",
-__LINE__, 0x0038c4ec, "3720428", "%5.4d",
-__LINE__, -0x0f10b5e, "-15797086", "%2ld",
-__LINE__, 0x256c815f, "256c815f", "%4.x",
-__LINE__, 0x00000682, " 1666", "%6ld",
-__LINE__, -0x00000ab, "-171", "%2ld",
-__LINE__, 0x00000003, "3", "%0d",
-__LINE__, 0x063f5075, "63F5075", "%X",
-__LINE__, 0xff83b5d0, "FF83B5D0", "%7.X",
-__LINE__, 0xffffffec, "ffffffec", "%x",
-__LINE__, 0xffb551c4, "0XFFB551C4", "% #4.X",
-__LINE__, -0x071f057, "-7467095", "%3.7d",
-__LINE__, 0x00634879, "6506617", "%#ld",
-__LINE__, 0x000001d7, "471", "%d",
-__LINE__, 0x00a7da92, "A7DA92", "% .4X",
-__LINE__, 0x00000003, "3 ", "%-2.ld",
-__LINE__, -0x0000004, "-0004", "%.4d",
-__LINE__, -0x01dea32, "-1960498", "% #7.d",
-__LINE__, 0x53c4159f, "53C4159F", "%1.7X",
-__LINE__, -0x1ad7904, "-28145924", "%#d",
-__LINE__, -0x0000a85, "-2693", "%ld",
-__LINE__, -0x0000c7d, "-3197", "%d",
-__LINE__, 0xfffffffc, "FFFFFFFC", "%+0X",
-__LINE__, 0x00000004, "00004", "%1.5d",
-__LINE__, 0x0000b761, "46945", "%5ld",
-__LINE__, -0x0ee3b2c, "-15612716", "%.6d",
-__LINE__, 0x0677a73d, "677a73d", "% x",
-__LINE__, -0x5f96020, "-100229152", "% d",
-__LINE__, 0x00000000, " 0", "%#7X",
-__LINE__, -0x5d1cb5b, "-97635163", "% ld",
-__LINE__, -0x00a8d8b, "-691595", "%-0ld",
-__LINE__, 0xffffffa2, "FFFFFFA2", "%X",
-__LINE__, 0xffffffc9, "FFFFFFC9", "%X",
-__LINE__, 0x0b180d35, "B180D35", "%X",
-__LINE__, 0xfc0b94ce, "fc0b94ce", "%.1x",
-__LINE__, 0x0012cd7b, "12CD7B", "% X",
-__LINE__, -0x02f1da8, "-3087784", "%ld",
-__LINE__, -0x000a6f9, "-42745", "%-ld",
-__LINE__, -0x000006d, "-109 ", "%-6d",
-__LINE__, 0x00000001, "+1", "%+0d",
-__LINE__, 0x00000001, "1", "%1d",
-__LINE__, 0xfffffff8, "fffffff8", "%5.x",
-__LINE__, -0x00fc4d7, "-1033431", "%+0.5ld",
-__LINE__, 0xffff41b4, "0xffff41b4", "%#x",
-__LINE__, -0x0000d37, "-3383", "%ld",
-__LINE__, 0xffc4e405, "ffc4e405", "%7x",
-__LINE__, 0xffffffb0, "FFFFFFB0", "%04X",
-__LINE__, -0x0054477, "-345207", "%01.ld",
-__LINE__, 0x00512778, "0x512778", "%#3.0x",
-__LINE__, 0x00000007, " 7", "%7.d",
-__LINE__, 0x00000008, " 00008", "% .5ld",
-__LINE__, 0x000053fd, "21501", "%.4ld",
-__LINE__, 0x0000370c, "370c", "%2x",
-__LINE__, -0x44670a7, "-71725223", "%3d",
-__LINE__, 0x00000064, " 64", "%+5x",
-__LINE__, 0xfffffffc, "FFFFFFFC", "%X",
-__LINE__, 0xf7bbf094, "f7bbf094", "%3x",
-__LINE__, 0xfffeb268, "FFFEB268", "%X",
-__LINE__, 0x00001ef0, "1ef0", "%4.x",
-__LINE__, 0x05ad9aa4, " 95263396", "% 0.ld",
-__LINE__, 0xf294dca7, "F294DCA7", "% 4.X",
-__LINE__, -0x0000003, "-000003", "%.6d",
-__LINE__, 0xfff57471, "fff57471", "% x",
-__LINE__, 0x0a848cfd, "176459005", "%d",
-__LINE__, -0x000002e, "-46", "%.0d",
-__LINE__, 0x00000051, " +81", "%+5d",
-__LINE__, -0x000072b, "-0001835", "%06.7d",
-__LINE__, -0x0000002, " -2", "%+#6ld",
-__LINE__, 0x00000003, "3", "%x",
-__LINE__, 0xfffd1799, "FFFD1799", "%6.X",
-__LINE__, 0x00000005, "5", "%ld",
-__LINE__, 0x0052138b, "5378955", "%#7.7ld",
-__LINE__, 0x000000c0, " 192", "% 7ld",
-__LINE__, 0x005b26cd, "5B26CD", "%X",
-__LINE__, -0x008df17, "-581399", "%.4ld",
-__LINE__, 0xfffffad8, "fffffad8", "%-x",
-__LINE__, 0x000006a9, "6a9", "%.0x",
-__LINE__, -0x003b7f9, "-243705", "%+0ld",
-__LINE__, 0x005d7ea4, "6127268", "%ld",
-__LINE__, -0x003ccea, "-249066", "%+.0ld",
-__LINE__, 0x0000846f, "846F", "%X",
-__LINE__, 0x00004f79, "4F79", "%4.X",
-__LINE__, 0xe3e1409c, "E3E1409C", "%-X",
-__LINE__, 0x07cce2f4, "7CCE2F4", "%2.X",
-__LINE__, 0x004bcc8b, "4967563", "%-.5ld",
-__LINE__, 0x7d49665e, "2101962334", "%ld",
-__LINE__, 0xfffffffc, "FFFFFFFC", "%.5X",
-__LINE__, 0x0000019e, "+000414", "%+.6d",
-__LINE__, 0x000027ef, "10223", "%d",
-__LINE__, -0x0000261, "-609", "%3ld",
-__LINE__, -0x000000e, "-14", "% 2.ld",
-__LINE__, 0xff3ba3c7, "ff3ba3c7", "%+5.7x",
-__LINE__, 0xffffffc4, "FFFFFFC4", "%-1.X",
-__LINE__, 0xfffc5a70, "0xfffc5a70", "%#4.4x",
-__LINE__, 0x0000d156, " 53590", "% d",
-__LINE__, -0x0486258, "-4743768", "%0ld",
-__LINE__, 0x00000000, " ", "% 2.d",
-__LINE__, 0x04a0ef9f, "77655967", "%0.6ld",
-__LINE__, 0xffffffff, "FFFFFFFF", "%X",
-__LINE__, 0x00000019, "0000019", "%.7x",
-__LINE__, -0x0058d3a, "-363834", "%ld",
-__LINE__, 0xfffff6b3, "fffff6b3", "%x",
-__LINE__, 0xfffffff5, "FFFFFFF5", "%.0X",
-__LINE__, 0x005e1fcb, "5E1FCB", "%+6X",
-__LINE__, 0xffc3c866, "0xffc3c866", "%-#.4x",
-__LINE__, 0x00000003, "3", "%X",
-__LINE__, 0xffa2e961, "FFA2E961", "%7.4X",
-__LINE__, 0x00000029, "41", "%d",
-__LINE__, -0x0000035, "-53", "%d",
-__LINE__, 0x0001b033, "110643", "%ld",
-__LINE__, 0x004dd51b, "5100827", "%-2ld",
-__LINE__, -0x000252d, "-9517", "% d",
-__LINE__, 0xffffdeb2, "ffffdeb2", "%4.x",
-__LINE__, 0xffe94eab, "0xffe94eab", "%#x",
-__LINE__, 0xf921edf6, "f921edf6", "%4.2x",
-__LINE__, 0x0007df97, "515991", "%4.ld",
-__LINE__, 0x00709bc5, "709BC5", "%0X",
-__LINE__, -0x0000001, "-1", "%d",
-__LINE__, 0xfffffffb, "FFFFFFFB", "%7.3X",
-__LINE__, -0x0063f74, "-409460", "%+05.0d",
-__LINE__, 0xfffffe9a, "FFFFFE9A", "%.2X",
-__LINE__, -0x0001ce2, "-7394", "%.4d",
-__LINE__, 0x000038c5, "14533", "%ld",
-__LINE__, 0x000000ad, "000ad", "% 5.5x",
-__LINE__, 0xffffbcc4, "ffffbcc4", "%-5x",
-__LINE__, 0x00000000, "0", "% X",
-__LINE__, 0x00372877, "372877", "%.6X",
-__LINE__, 0xffffffd7, "FFFFFFD7", "%1.X",
-__LINE__, 0xfa58b14b, "fa58b14b", "%x",
-__LINE__, 0xfffffd9f, "FFFFFD9F", "%0.7X",
-__LINE__, 0x00000710, "+1808", "%+#.2ld",
-__LINE__, 0x00000006, " 6", "%5.0ld",
-__LINE__, 0x0fba9706, "263886598", "%-6.3d",
-__LINE__, 0xffff420a, "ffff420a", "%-2x",
-__LINE__, 0x14b9a825, "14b9a825", "%x",
-__LINE__, 0x0077ffe4, "77FFE4", "%+.2X",
-__LINE__, 0x00067108, "422152 ", "%-7.ld",
-__LINE__, 0x00000001, " 00001", "%6.5X",
-__LINE__, 0x00000000, "0", "%ld",
-__LINE__, -0x0000001, " -1", "% 7ld",
-__LINE__, 0x01ddc7a3, "31311779", "%d",
-__LINE__, -0x2a92f9b, "-44642203", "% 3ld",
-__LINE__, 0xfffffff9, "fffffff9", "%4.6x",
-__LINE__, 0x0279a274, "279a274", "%x",
-__LINE__, 0x2e37ed8e, "775417230", "%d",
-__LINE__, 0x5ba59f58, "1537580888", "%-ld",
-__LINE__, 0xffffffe0, "ffffffe0", "%x",
-__LINE__, 0x3110ae47, "0X3110AE47", "%+#X",
-__LINE__, 0x000e00b9, "917689", "%d",
-__LINE__, 0x0000002e, " 0046", "% 7.4d",
-__LINE__, 0x00000363, " 867", "%7.d",
-__LINE__, -0x000000b, "-0011", "% 0.4d",
-__LINE__, 0x000349c8, " 349C8", "% 7.X",
-__LINE__, -0x01358f1, "-1267953", "%d",
-__LINE__, -0x0039d3c, "-236860", "%-.3d",
-__LINE__, 0xffd6de19, "ffd6de19", "%04.0x",
-__LINE__, -0x0003c54, "-0015444", "%1.7d",
-__LINE__, -0x0000e17, "-3607", "%d",
-__LINE__, 0xff0fa3a9, "ff0fa3a9", "%+3x",
-__LINE__, 0x00000009, "0000009", "%1.7x",
-__LINE__, 0xfffffc81, "FFFFFC81", "% X",
-__LINE__, -0x4ef2df5, "-82783733", "%ld",
-__LINE__, 0x00000013, "19", "%-ld",
-__LINE__, 0x00000000, " 0", "%#7x",
-__LINE__, -0x3b9485fd, "-999589373", "%1.d",
-__LINE__, -0x0000006, "-00006", "%6.5d",
-__LINE__, 0x0000003f, "+63", "%+ld",
-__LINE__, 0x000004c5, "1221", "%1.d",
-__LINE__, 0x003f8a8c, "4164236", "%d",
-__LINE__, -0x000001e, "-30", "%-#3d",
-__LINE__, 0xfff9d230, "FFF9D230", "%+07.3X",
-__LINE__, 0x0147cf17, "147cf17", "% x",
-__LINE__, 0xffffffeb, "ffffffeb", "%x",
-__LINE__, 0x0000007d, "00125", "%.5ld",
-__LINE__, 0x000fff56, "1048406", "%#3d",
-__LINE__, 0x064307a0, " 105056160", "% 0.3ld",
-__LINE__, 0x007d2860, "8202336", "%-.2d",
-__LINE__, 0x00a05711, "a05711", "%x",
-__LINE__, 0x179a7f9e, "0x179a7f9e", "%+#.3x",
-__LINE__, 0x00000003, "3", "%X",
-__LINE__, -0x0001d7d, "-7549", "%#5d",
-__LINE__, 0x0025d3f2, "+2479090", "%+2.d",
-__LINE__, -0x0000001, "-1", "%#ld",
-__LINE__, 0xfffffdd5, "fffffdd5", "%.7x",
-__LINE__, 0x003462b9, "3433145", "%d",
-__LINE__, 0x00005a81, "23169", "%d",
-__LINE__, 0xfffffcdb, "fffffcdb", "%-x",
-__LINE__, 0x00000000, "0", "%d",
-__LINE__, 0xfff22085, "fff22085", "%x",
-__LINE__, 0x00016d72, " 93554", "% d",
-__LINE__, -0x0000002, "-2", "%0ld",
-__LINE__, 0xfffffd21, "fffffd21", "% 0x",
-__LINE__, 0x00000931, "2353", "%ld",
-__LINE__, 0x00010021, "10021", "%5.1X",
-__LINE__, -0x000007e, "-126", "%1.0ld",
-__LINE__, 0xfffffff8, "fffffff8", "%01.x",
-__LINE__, -0x001d148, "-119112", "%d",
-__LINE__, -0x0000008, "-8", "%ld",
-__LINE__, -0x000038e, "-910", "% ld",
-__LINE__, 0x0039e3e5, "3793893", "%0.1d",
-__LINE__, 0x0038fb8e, "38FB8E", "%.2X",
-__LINE__, -0x002dafa, "-187130", "%ld",
-__LINE__, -0xbec275b, "-200025947", "%ld",
-__LINE__, 0x1a32f999, "1A32F999", "%05.4X",
-__LINE__, 0x0000002f, "2f", "%x",
-__LINE__, -0x0001a5b, "-6747", "%+3.ld",
-__LINE__, 0x00000762, " 1890", "%7.ld",
-__LINE__, 0x000000c2, "000194", "%0.6ld",
-__LINE__, 0xffff002b, "FFFF002B", "%.4X",
-__LINE__, -0x0019dae, "-105902", "% .2d",
-__LINE__, 0x0000125f, "125f", "%+1x",
-__LINE__, -0x000b688, " -46728", "%#7.d",
-__LINE__, 0x000401ca, "401ca", "%0x",
-__LINE__, 0x00000192, "402", "%#ld",
-__LINE__, 0xffffffff, "ffffffff", "%x",
-__LINE__, 0x1e505a0c, "0X1E505A0C", "%#1.3X",
-__LINE__, 0x000f8f6c, "1019756", "%d",
-__LINE__, 0x0004a296, "4a296", "%5.2x",
-__LINE__, 0x00000003, "3", "% x",
-__LINE__, -0x000d44c, "-54348", "%#ld",
-__LINE__, 0x00009ae2, "39650", "%-d",
-__LINE__, 0xffffff3a, "FFFFFF3A", "% .7X",
-__LINE__, 0x0042350b, "4338955", "%d",
-__LINE__, 0x000071af, "71af", "%+.4x",
-__LINE__, 0x00000001, "0x1", "%#0x",
-__LINE__, 0x00000033, "00051", "%3.5d",
-__LINE__, 0x00000001, "1", "%X",
-__LINE__, -0xebfb0e7, "-247443687", "%+3ld",
-__LINE__, 0x00000027, "27 ", "%-07.X",
-__LINE__, -0x0004837, "-18487", "%01d",
-__LINE__, 0x1a8c53da, "1A8C53DA", "%X",
-__LINE__, -0x0bdb8a9, "-12433577", "%d",
-__LINE__, -0x0000098, "-152", "%#ld",
-__LINE__, -0x003b554, "-243028", "%d",
-__LINE__, 0x000000cb, "00000CB", "%+.7X",
-__LINE__, 0xfffffeda, "FFFFFEDA", "%X",
-__LINE__, -0x0000010, "-16", "%-#d",
-__LINE__, 0x00000006, "+6", "%+d",
-__LINE__, 0x003c294a, "+3942730", "%+4.ld",
-__LINE__, 0x00000009, "9", "%ld",
-__LINE__, 0xfbbdd2bc, "FBBDD2BC", "% X",
-__LINE__, 0x71c86678, "+1908958840", "%+0.6ld",
-__LINE__, -0x0b49bff, "-11836415", "% 6.ld",
-__LINE__, 0xfff416be, "fff416be", "%3.x",
-__LINE__, 0x00000077, "+119", "%+d",
-__LINE__, 0xfff1cfaa, "FFF1CFAA", "% 0.2X",
-__LINE__, 0xfffffffb, "fffffffb", "% x",
-__LINE__, 0x0000127e, "4734", "%d",
-__LINE__, 0x00107ad2, "107ad2", "%+2.6x",
-__LINE__, 0x0006b8e9, "440553", "%-#d",
-__LINE__, 0x0000eb6f, "eb6f", "% x",
-__LINE__, 0x00001f18, "7960", "%0d",
-__LINE__, 0xfffff225, "fffff225", "%1.5x",
-__LINE__, 0xfffffff9, "fffffff9", "%+6.x",
-__LINE__, 0x000005b9, "01465", "%.5ld",
-__LINE__, 0xfffc26b8, "FFFC26B8", "% X",
-__LINE__, 0x540d580d, "0X540D580D", "%+#X",
-__LINE__, 0x05ad7094, "5AD7094", "% 4.7X",
-__LINE__, -0x000019b, "-411", "% d",
-__LINE__, 0x00000006, "000006", "%6.6ld",
-__LINE__, 0x0000026a, "+618", "%+ld",
-__LINE__, 0x0000000b, "11", "%ld",
-__LINE__, -0x26985d5, "-40469973", "%#.0ld",
-__LINE__, 0x0000007d, "7D", "%+02.0X",
-__LINE__, -0x0079ddf, "-0499167", "%+.7ld",
-__LINE__, 0x0000375f, "14175", "%0d",
-__LINE__, -0x18de7f99, "-417234841", "%ld",
-__LINE__, -0x00507cc, "-329676", "%.0d",
-__LINE__, 0x000029d5, "29D5", "%-2.1X",
-__LINE__, 0x0000328c, "328C", "%-3.X",
-__LINE__, 0x016f6234, "24076852", "%3.ld",
-__LINE__, 0xfffffffc, "0XFFFFFFFC", "%#.5X",
-__LINE__, 0xfe6163ca, "FE6163CA", "%5.X",
-__LINE__, 0xffffffc2, "FFFFFFC2", "%X",
-__LINE__, 0x00000087, "+135", "%+ld",
-__LINE__, 0x00310166, "310166", "% x",
-__LINE__, 0x00e8c871, "15255665", "%d",
-__LINE__, 0x000005ee, "1518", "%ld",
-__LINE__, 0xfcb24306, "FCB24306", "%X",
-__LINE__, 0x0000000b, " 11", "%5ld",
-__LINE__, 0x006d11d0, "0x6d11d0", "%#.0x",
-__LINE__, 0x0010d416, "1102870", "%#6.5d",
-__LINE__, -0x0047cb3, "-294067", "%.3d",
-__LINE__, 0x000000c0, "c0", "%x",
-__LINE__, 0xffffffff, "FFFFFFFF", "%+X",
-__LINE__, -0x000000a, "-10", "%d",
-__LINE__, -0x0000007, "-7", "% ld",
-__LINE__, 0xfffffffe, "FFFFFFFE", "%-X",
-__LINE__, 0x00000014, "0x14", "%-#3.1x",
-__LINE__, 0x00003319, "3319", "% x",
-__LINE__, 0x00000000, "00", "%+#.2X",
-__LINE__, -0x0000009, "-9", "% ld",
-__LINE__, -0x0000001, "-1 ", "%-3ld",
-__LINE__, 0x00262909, "2500873", "%.5ld",
-__LINE__, 0x33e76560, "33e76560", "%7.0x",
-__LINE__, -0x0000002, "-2", "%ld",
-__LINE__, 0x00035ee9, "35EE9", "%-3.X",
-__LINE__, -0x0000235, "-565", "%+4.ld",
-__LINE__, -0x3ea63c5, "-65692613", "%d",
-__LINE__, 0x00000003, "3", "%ld",
-__LINE__, -0x003362f, "-210479", "% d",
-__LINE__, -0x1a819f8a, "-444702602", "%.7d",
-__LINE__, 0x027a4668, "41567848", "%d",
-__LINE__, 0x0002b025, "2b025", "%x",
-__LINE__, -0x0000001, "-001", "%.3ld",
-__LINE__, 0xfffffff0, "fffffff0", "%-0x",
-__LINE__, -0x0000d4f, "-3407", "%-ld",
-__LINE__, 0x00000146, " 326", "% 1.d",
-__LINE__, -0x0000006, "-6", "%d",
-__LINE__, 0xffffffff, "FFFFFFFF", "%06.4X",
-__LINE__, 0x376fddae, "+930078126", "%+#0ld",
-__LINE__, 0x006d9da3, "6d9da3", "%1.x",
-__LINE__, -0x0000f28, "-3880", "%3.2ld",
-__LINE__, 0x0006962c, " 431660", "% 5d",
-__LINE__, 0x000011db, " 4571", "%6.ld",
-__LINE__, 0xffffffa8, "ffffffa8", "%+x",
-__LINE__, 0x0d886db3, "D886DB3", "%.7X",
-__LINE__, 0x00000000, "000000", "%2.6ld",
-__LINE__, 0xfffff6b6, "FFFFF6B6", "% X",
-__LINE__, -0x0739068, "-7573608", "%+6.ld",
-__LINE__, 0xfba62553, "0XFBA62553", "%#X",
-__LINE__, -0x4474bc5, "-71781317", "%-2ld",
-__LINE__, 0xffffff95, "FFFFFF95", "% 2.X",
-__LINE__, -0x1d0e1ca, "-30466506", "%+.0d",
-__LINE__, -0x000f3aa, "-62378", "%ld",
-__LINE__, 0x00000026, "26", "%1x",
-__LINE__, 0x001c5400, "1856512", "%-#d",
-__LINE__, 0x03808442, "3808442", "%X",
-__LINE__, -0x0000081, "-129", "%+#ld",
-__LINE__, 0x000004ae, " 1198", "% 3.4d",
-__LINE__, -0x7f4ed54, "-133492052", "%d",
-__LINE__, 0x00000000, "+0", "%+ld",
-__LINE__, 0x00000000, "0", "%+x",
-__LINE__, 0x004c7e46, "5013062", "%.0d",
-__LINE__, -0x647d7a65, "-1685944933", "%0.2d",
-__LINE__, 0x00003b59, "15193", "%-#1d",
-__LINE__, 0xfff3e64d, "FFF3E64D", "%-X",
-__LINE__, 0x00007022, "28706", "%-d",
-__LINE__, 0xc28d0ad8, "c28d0ad8", "%+x",
-__LINE__, -0x005c208, "-377352", "% ld",
-__LINE__, 0x00cfbadc, "13613788", "%d",
-__LINE__, 0x000016ea, "5866", "%0d",
-__LINE__, 0x00000029, "29", "%X",
-__LINE__, 0xffe16813, "0XFFE16813", "%+#X",
-__LINE__, 0x00000004, "4", "%0X",
-__LINE__, -0x0000096, " -150", "%5d",
-__LINE__, 0x00027ac7, "162503", "%ld",
-__LINE__, -0x0075de0, "-482784", "%d",
-__LINE__, 0x005fcff6, "6279158", "%d",
-__LINE__, 0xffffffef, "FFFFFFEF", "%3X",
-__LINE__, 0x267b05ec, "645596652", "%4ld",
-__LINE__, 0xa487b724, "a487b724", "%x",
-__LINE__, 0x01da2a11, "31074833", "%-.0ld",
-__LINE__, 0xffffffff, "FFFFFFFF", "%X",
-__LINE__, 0x0000037a, "37a", "%x",
-__LINE__, 0x003d0314, "+3998484", "%+#1d",
-__LINE__, 0x0000011b, " 283", "%5.2d",
-__LINE__, 0x094f6066, "94f6066", "%x",
-__LINE__, 0x00000004, "4", "%X",
-__LINE__, -0x102e14bd, "-271455421", "% 7.ld",
-__LINE__, 0x000048da, "0018650", "%07ld",
-__LINE__, -0x24ae0390, "-615383952", "%0.6d",
-__LINE__, 0xffff5159, "0XFFFF5159", "%#0X",
-__LINE__, 0xfffd38c3, "fffd38c3", "%x",
-__LINE__, 0xfffff9ea, "FFFFF9EA", "%-X",
-__LINE__, -0x000fd28, "-64808", "% ld",
-__LINE__, 0x002c1bf4, "2890740", "%-.1d",
-__LINE__, 0x00d00ee7, "D00EE7", "%0.4X",
-__LINE__, 0x00000cf9, "3321", "%0d",
-__LINE__, -0x0000001, "-1", "%-#ld",
-__LINE__, 0xfffffd75, "FFFFFD75", "%.2X",
-__LINE__, 0x00000012, "18", "%-d",
-__LINE__, 0xfd44b4b2, "fd44b4b2", "%+5.x",
-__LINE__, -0x001c53f, "-116031", "%-#6.d",
-__LINE__, 0x000ff6fd, "ff6fd", "%2x",
-__LINE__, 0x00000001, "1", "%0d",
-__LINE__, 0x0120b478, "120B478", "%.7X",
-__LINE__, 0x0145591e, "145591E", "%1.4X",
-__LINE__, 0x001f99b9, "1F99B9", "%.1X",
-__LINE__, 0xffffd078, "ffffd078", "%-1.5x",
-__LINE__, 0xffffff1a, "FFFFFF1A", "%-4.6X",
-__LINE__, 0xfffffffa, "fffffffa", "%x",
-__LINE__, -0x00000b9, "-185", "%3ld",
-__LINE__, 0x00001cf0, "7408", "%-ld",
-__LINE__, 0xffffffff, "FFFFFFFF", "%X",
-__LINE__, 0x00151f30, "151F30", "%X",
-__LINE__, -0x0000103, "-259", "%d",
-__LINE__, -0x000303f, "-12351", "%d",
-__LINE__, 0x000002ca, "714", "%ld",
-__LINE__, -0x0000c55, "-3157", "%1d",
-__LINE__, 0x00000691, "01681", "%#.5ld",
-__LINE__, 0x00230537, "2295095", "%#d",
-__LINE__, 0x032a1faa, "53092266", "%.4d",
-__LINE__, 0x000050d7, "20695", "%d",
-__LINE__, -0x0c7ad4c, "-13086028", "%#.4ld",
-__LINE__, -0x00009d9, "-2521", "%+d",
-__LINE__, 0xfffffffe, "fffffffe", "%0x",
-__LINE__, 0xffdec2d9, "FFDEC2D9", "%5.1X",
-__LINE__, -0x000563c, "-22076", "%-.2ld",
-__LINE__, 0x0073b36a, "0x73b36a", "%-#x",
-__LINE__, 0xfffffffd, "fffffffd", "%x",
-__LINE__, 0x0193ba5a, "193ba5a", "%1.x",
-__LINE__, 0x00d147b5, "13715381", "%2.d",
-__LINE__, 0xffffff10, "ffffff10", "%4x",
-__LINE__, 0x000648d5, "648d5", "%1.3x",
-__LINE__, 0x00000011, "11", "%X",
-__LINE__, 0xff259f5b, "0xff259f5b", "% #.1x",
-__LINE__, 0x00000175, "175", "%x",
-__LINE__, 0x00000000, "0", "%ld",
-__LINE__, 0x00000015, "21", "%#ld",
-__LINE__, 0xfffffffe, "fffffffe", "%-x",
-__LINE__, 0x00000013, " 19", "% 0ld",
-__LINE__, -0x0000001, "-0000001", "% 5.7ld",
-__LINE__, 0x0000139d, "139D", "%X",
-__LINE__, 0x0041ad18, "41ad18", "%-.6x",
-__LINE__, -0x00000f9, "-249", "% 3.d",
-__LINE__, 0x00000076, "118", "%ld",
-__LINE__, 0x000006f8, "1784", "%d",
-__LINE__, -0x0000005, "-5", "%ld",
-__LINE__, -0x00008e7, "-2279", "%+ld",
-__LINE__, 0x00003f77, "3F77", "%+0X",
-__LINE__, 0x000ca3f8, "0XCA3F8", "%+#X",
-__LINE__, -0x00004bf, "-001215", "%#5.6ld",
-__LINE__, 0x319129ab, "0x319129ab", "%+#x",
-__LINE__, -0x0000002, "-2", "%ld",
-__LINE__, -0x0f6686e, "-16148590", "%.6ld",
-__LINE__, 0x0329576b, "53041003", "%2.d",
-__LINE__, -0x000179e, "-6046", "%d",
-__LINE__, 0x000002cc, "+716", "%+1.3ld",
-__LINE__, 0xfffffff7, "0xfffffff7", "% #x",
-__LINE__, 0x0016eb40, "1502016", "%ld",
-__LINE__, 0x00000003, "3", "%-0ld",
-__LINE__, 0x0023e0d6, "23E0D6", "%-05.X",
-__LINE__, 0xffffa6a4, "0XFFFFA6A4", "%#X",
-__LINE__, 0x00087664, "87664", "% .2x",
-__LINE__, -0x0000002, " -2", "%3.ld",
-__LINE__, 0x003ad85d, "3AD85D", "%X",
-__LINE__, 0x00002f20, "12064", "%ld",
-__LINE__, 0x02030bfc, "2030BFC", "%02.3X",
-__LINE__, 0xfffff36a, "FFFFF36A", "%X",
-__LINE__, 0xfe0729ff, "0xfe0729ff", "% #.0x",
-__LINE__, 0xfec15164, "FEC15164", "%0.2X",
-__LINE__, -0x00169ec, "-92652", "%+d",
-__LINE__, 0x006d7990, "0x6d7990", "%#x",
-__LINE__, 0xffcc89e6, "ffcc89e6", "%x",
-__LINE__, 0x002d7cca, "2981066", "%7.7ld",
-__LINE__, -0x1649692b, "-373909803", "%#ld",
-__LINE__, 0x00664f47, "664f47", "%+6.x",
-__LINE__, 0x00000000, "0", "% X",
-__LINE__, 0x00000047, "000047", "%.6X",
-__LINE__, 0x00000007, "0000007", "%.7ld",
-__LINE__, 0x00000030, "30", "%-x",
-__LINE__, -0x25bcbabb, "-633125563", "% ld",
-__LINE__, 0xfe11c031, "FE11C031", "%4.6X",
-__LINE__, -0x0000001, "-0000001", "%.7d",
-__LINE__, 0x00b56d84, "11890052", "%ld",
-__LINE__, -0x0000b01, "-0002817", "%+07.7ld",
-__LINE__, 0xffffe4ad, "ffffe4ad", "% 0.0x",
-__LINE__, 0x007760fc, "7760fc", "%+x",
-__LINE__, 0xffef44d8, "FFEF44D8", "%X",
-__LINE__, 0xfcb6862e, "fcb6862e", "%+x",
-__LINE__, -0x0000001, "-1", "%0d",
-__LINE__, 0xffffffe6, "FFFFFFE6", "%3.1X",
-__LINE__, 0xff816e27, "FF816E27", "% 6.X",
-__LINE__, 0x00006415, "25621", "%ld",
-__LINE__, -0xfae5449, "-263083081", "%0ld",
-__LINE__, 0x00000001, " 1", "% 0d",
-__LINE__, 0x00000009, " 9", "%2.X",
-__LINE__, 0x002d7e18, "2981400", "%7d",
-__LINE__, -0x00000fc, "-0000252", "%-#.7d",
-__LINE__, 0x00000003, "3", "%0x",
-__LINE__, 0x0d46e47f, "222749823", "%ld",
-__LINE__, 0xfffcbc52, "FFFCBC52", "%+X",
-__LINE__, 0x00000000, "0", "%-X",
-__LINE__, 0xfffff0e5, "fffff0e5", "%x",
-__LINE__, 0xffffffd9, "FFFFFFD9", "%07X",
-__LINE__, 0x000004ee, "4ee", "%0x",
-__LINE__, 0xffffffff, "ffffffff", "%0x",
-__LINE__, -0x0008cb4, "-036020", "%+3.6ld",
-__LINE__, 0x0000dada, "0xdada", "%#0.x",
-__LINE__, 0x0000001a, "26 ", "%-4d",
-__LINE__, -0x000000c, " -12", "%04.d",
-__LINE__, 0x0000025c, " 25c", "%7.x",
-__LINE__, 0xfe9b091e, "FE9B091E", "%X",
-__LINE__, 0x00000002, " 2", "%07.ld",
-__LINE__, -0x0004930, "-18736", "% 6.d",
-__LINE__, 0xffffffe9, "FFFFFFE9", "%X",
-__LINE__, 0x00000003, " 3", "%2.ld",
-__LINE__, 0x00000e00, "3584", "%.4d",
-__LINE__, 0xffff38c2, "ffff38c2", "%0.x",
-__LINE__, 0xffffffff, "FFFFFFFF", "% .3X",
-__LINE__, 0xff7c1b2f, "FF7C1B2F", "%-3.2X",
-__LINE__, -0x0000005, "-5", "%2d",
-__LINE__, 0x00098775, "98775", "%x",
-__LINE__, 0x000015ff, " 15FF", "%6.X",
-__LINE__, 0xfffbe3ef, "FFFBE3EF", "%0.3X",
-__LINE__, -0x0000048, "-72", "%ld",
-__LINE__, 0x0001488a, "84106", "%d",
-__LINE__, 0x00000001, "1", "%x",
-__LINE__, -0x0000002, "-2", "%-0.0ld",
-__LINE__, -0x0000001, "-1", "%-d",
-__LINE__, 0x0006616f, "6616f", "%x",
-__LINE__, 0x3657856d, "911705453", "%6.d",
-__LINE__, -0x0007222, "-0029218", "%.7d",
-__LINE__, 0x00041606, "267782", "%04.5d",
-__LINE__, 0x00000001, " 1", "%2.ld",
-__LINE__, 0x00000219, "219", "%0x",
-__LINE__, 0x0ae0184c, "ae0184c", "%x",
-__LINE__, 0x00003a7d, " 14973", "%7.ld",
-__LINE__, 0xffffffff, "0XFFFFFFFF", "%#X",
-__LINE__, -0x0000002, "-2", "%0ld",
-__LINE__, 0x00002cdf, "11487", "%0ld",
-__LINE__, -0x000000c, "-12", "%d",
-__LINE__, -0x000000e, "-14", "%-#2d",
-__LINE__, 0x00000371, "881", "%#ld",
-__LINE__, 0x000015be, " 5566", "%5.ld",
-__LINE__, 0x01525b91, "22174609", "%#0.0ld",
-__LINE__, 0xff8fc22f, "FF8FC22F", "% X",
-__LINE__, -0x0007f7b, "-32635", "%4.ld",
-__LINE__, 0x00007bca, "7bca", "%x",
-__LINE__, -0x0000582, "-1410", "%ld",
-__LINE__, 0x00000047, " +71", "%+04.2d",
-__LINE__, 0xf8a8dce2, "f8a8dce2", "%+.6x",
-__LINE__, -0x000de2e, "-56878", "%.0d",
-__LINE__, 0x019c03c1, "0X19C03C1", "%#X",
-__LINE__, -0x0f3a43e, "-15967294", "%ld",
-__LINE__, 0x00009e87, "40583", "%#5.1d",
-__LINE__, 0x000000b8, "184", "%0ld",
-__LINE__, -0x000befe, "-48894", "%2ld",
-__LINE__, -0x002ee1a, "-192026", "%.2d",
-__LINE__, 0x00004fd8, "4fd8", "%x",
-__LINE__, 0x0006d57b, "447867", "%2d",
-__LINE__, 0xfffffa9c, "FFFFFA9C", "%-X",
-__LINE__, 0x0000000f, "15", "%ld",
-__LINE__, 0x0005deb2, "5DEB2", "% X",
-__LINE__, 0x00000007, "7", "%X",
-__LINE__, 0xffffffc8, "0XFFFFFFC8", "% #.1X",
-__LINE__, 0xfffff62f, "FFFFF62F", "%X",
-__LINE__, -0x1a935bba, "-445864890", "% 3.5d",
-__LINE__, 0x000b34b4, "0x0b34b4", "%-#3.6x",
-__LINE__, 0xfffff430, "FFFFF430", "%X",
-__LINE__, 0x00000b5f, "+0002911", "%+#.7d",
-__LINE__, 0x00000007, " 7", "%3ld",
-__LINE__, 0xffffffd8, "FFFFFFD8", "% .7X",
-__LINE__, 0xfffff544, "FFFFF544", "%0X",
-__LINE__, -0x353667b9, "-892757945", "%d",
-__LINE__, 0x00000058, "0x00058", "%+#.5x",
-__LINE__, 0x39dbcc4a, "+970705994", "%+0.6ld",
-__LINE__, 0xfffffffd, "fffffffd", "% 01x",
-__LINE__, 0x00b1c28e, "+11649678", "%+0ld",
-__LINE__, 0x000066c2, "0X66C2", "%-#4X",
-__LINE__, 0x007171a2, "+7434658", "%+07.ld",
-__LINE__, -0x0000001, "-1", "%-d",
-__LINE__, 0x00000ae0, "+2784", "%+0d",
-__LINE__, 0x13786a57, "326658647", "%#5d",
-__LINE__, -0x0000001, "-1", "%2.ld",
-__LINE__, -0x0168a16, "-1477142", "%d",
-__LINE__, 0x12df7dd6, "316636630", "%ld",
-__LINE__, 0x00000000, "000000", "%1.6d",
-__LINE__, 0x266da2a9, "644719273", "%ld",
-__LINE__, 0x0000004a, "74", "%d",
-__LINE__, 0x000102ff, "00102FF", "%+06.7X",
-__LINE__, 0x17916237, "0x17916237", "%#5x",
-__LINE__, -0x0003cbb, "-0015547", "%-.7d",
-__LINE__, 0xe7da2010, "e7da2010", "%2.4x",
-__LINE__, 0xfffffff3, "fffffff3", "% .7x",
-__LINE__, 0xfc9b64f8, "FC9B64F8", "% 7.X",
-__LINE__, 0x000001af, "431", "%0d",
-__LINE__, 0xffc81796, "0xffc81796", "%#.5x",
-__LINE__, 0x057a1fbc, "+91889596", "%+04d",
-__LINE__, 0x00001ae1, "6881", "%ld",
-__LINE__, 0xfffffff6, "fffffff6", "%3.0x",
-__LINE__, -0x6b7d5db, "-112711131", "%-06.1d",
-__LINE__, 0x008e8a5c, " 8e8a5c", "%7.0x",
-__LINE__, 0xfe07a9bd, "fe07a9bd", "%.1x",
-__LINE__, -0x00278e6, "-162022", "%0ld",
-__LINE__, 0xf98709f5, "F98709F5", "%X",
-__LINE__, -0x00000c9, "-201", "% 1.d",
-__LINE__, -0x000001d, "-00029", "%+2.5ld",
-__LINE__, 0x00000030, " 48", "% d",
-__LINE__, 0xffd753f4, "FFD753F4", "%0X",
-__LINE__, 0xfffffffd, "FFFFFFFD", "%X",
-__LINE__, 0x0000a765, "a765", "%x",
-__LINE__, 0x0026e2c8, "26E2C8", "%-0X",
-__LINE__, -0x00003eb, "-1003", "%3.1ld",
-__LINE__, 0x015d53ca, "22893514", "%0ld",
-__LINE__, -0x0000020, "-32", "%ld",
-__LINE__, -0x03558dd, "-3496157", "%1.0ld",
-__LINE__, -0x000007f, "-127", "%1.d",
-__LINE__, 0xffffc737, "0xffffc737", "%+#x",
-__LINE__, 0x0000a70d, " a70d", "%6.x",
-__LINE__, 0x01ea0e31, "0X1EA0E31", "% #1.X",
-__LINE__, 0x00b5f406, "0X0B5F406", "%-#.7X",
-__LINE__, 0x0e58fa9a, "240712346", "%.2d",
-__LINE__, 0xf43ff8a9, "f43ff8a9", "%+0.6x",
-__LINE__, -0x5d0d3d3, "-97571795", "%.3ld",
-__LINE__, -0x000027a, "-634", "%0d",
-__LINE__, 0xffcef248, "FFCEF248", "%07.X",
-__LINE__, 0x000002dc, "2dc", "%0x",
-__LINE__, -0x31fa6c1, "-52405953", "%.2d",
-__LINE__, 0x00000014, "14", "%X",
-__LINE__, -0x0282f98, "-2633624", "%ld",
-__LINE__, 0x00005f55, "24405", "%#d",
-__LINE__, -0x0000004, "-4", "%d",
-__LINE__, 0x00000001, "1", "%+x",
-__LINE__, 0x013f47ce, "13f47ce", "%0.x",
-__LINE__, 0x00143fce, "1327054", "%.3d",
-__LINE__, 0x00000000, "0", "%d",
-__LINE__, 0x00001f9a, "1F9A", "% X",
-__LINE__, 0x00000cf5, "cf5", "%x",
-__LINE__, 0xffea9c24, "ffea9c24", "%x",
-__LINE__, 0xf09f85a7, "F09F85A7", "%X",
-__LINE__, 0x00001e04, "7684", "%ld",
-__LINE__, 0xffffc82a, "ffffc82a", "%7x",
-__LINE__, -0x0000a77, "-2679", "% d",
-__LINE__, 0x0019a859, "+1681497", "%+2.6ld",
-__LINE__, -0x00002d7, "-727", "%ld",
-__LINE__, 0x00011b82, "72578", "%-#ld",
-__LINE__, 0x00000c32, "3122", "%ld",
-__LINE__, -0x0000337, "-823", "%1.d",
-__LINE__, 0x00000004, "4", "%1ld",
-__LINE__, 0x0000062c, "1580", "%.1ld",
-__LINE__, 0xffffffd3, "FFFFFFD3", "% X",
-__LINE__, -0x07b1bf8, "-8068088", "%#d",
-__LINE__, 0xfffffff9, "fffffff9", "%x",
-__LINE__, 0x159e6cfb, "159e6cfb", "%0.x",
-__LINE__, 0x0001148d, "1148d", "%-.1x",
-__LINE__, 0x003373b7, "3371959", "%#.0d",
-__LINE__, 0x00001af2, "1af2", "%.4x",
-__LINE__, -0x0000001, "-000001", "%+.6ld",
-__LINE__, -0x00001a3, "-419", "%d",
-__LINE__, 0xfdb232e7, "fdb232e7", "%5.4x",
-__LINE__, -0x000000d, "-13", "%d",
-__LINE__, 0x98ec1c74, "98ec1c74", "% 3x",
-__LINE__, 0xfffffff8, "fffffff8", "%+1.4x",
-__LINE__, -0x0000d58, "-3416", "%+#0ld",
-__LINE__, -0x65d1973, "-106764659", "%.6d",
-__LINE__, -0x0737641, "-7566913", "%-d",
-__LINE__, 0x0000037c, "37c", "%+0x",
-__LINE__, 0x0000012c, "0000300", "%#3.7d",
-__LINE__, 0x00c12d9b, "12660123", "%1.5ld",
-__LINE__, 0xe7e5e77d, "e7e5e77d", "%6x",
-__LINE__, 0x1fe0e820, "1FE0E820", "%-4X",
-__LINE__, 0xc85a793a, "C85A793A", "%X",
-__LINE__, 0x05f9fe2c, "100269612", "%#ld",
-__LINE__, 0x00000032, "0X32", "%+#4.1X",
-__LINE__, 0xfab4ce81, "fab4ce81", "%3.x",
-__LINE__, -0x0000009, "-9", "%2.d",
-__LINE__, 0xffff8d2e, "ffff8d2e", "% 6x",
-__LINE__, 0xfffffffe, "0xfffffffe", "%#x",
-__LINE__, 0x02960f60, "2960f60", "%1.x",
-__LINE__, 0x34cf3cbc, " 885996732", "% 5ld",
-__LINE__, -0x000006e, "-110", "% d",
-__LINE__, -0x0000001, "-1", "%-.0d",
-__LINE__, 0x000000b1, " B1", "%+7X",
-__LINE__, 0xfffff5b4, "FFFFF5B4", "%01.7X",
-__LINE__, 0x00000086, "86", "%0X",
-__LINE__, 0x00074367, " 74367", "% 6x",
-__LINE__, 0x001000d7, "+1048791", "%+ld",
-__LINE__, 0x00000f35, " 3893", "% d",
-__LINE__, -0x00000e1, "-225", "%d",
-__LINE__, 0xffff6694, "FFFF6694", "%6.X",
-__LINE__, 0x00019cf7, "19cf7", "%0.x",
-__LINE__, 0x00000046, "0046", "%+.4X",
-__LINE__, -0x000001f, "-31", "%ld",
-__LINE__, 0xfff25859, "fff25859", "%6x",
-__LINE__, 0x21884061, "562577505", "%#ld",
-__LINE__, 0x01448b7a, "1448B7A", "%0.1X",
-__LINE__, 0xffffffc0, "ffffffc0", "%x",
-__LINE__, 0xfffffed5, "fffffed5", "% 1.0x",
-__LINE__, 0x0e349767, "E349767", "%.5X",
-__LINE__, 0x00000330, "816", "%0d",
-__LINE__, -0x0000016, "-22", "%d",
-__LINE__, 0xffff9bab, "FFFF9BAB", "%X",
-__LINE__, 0xffffee4e, "ffffee4e", "%x",
-__LINE__, 0x0026beeb, "2539243", "%6.d",
-__LINE__, 0x00002c6c, "11372", "%.2d",
-__LINE__, -0x000002c, "-44", "%ld",
-__LINE__, -0x001dcfa, "-122106", "% d",
-__LINE__, 0x0001683c, "92220", "%#4.ld",
-__LINE__, 0x09b51fc9, "9b51fc9", "%+.7x",
-__LINE__, 0x0000001d, "29", "%0ld",
-__LINE__, -0x83f17e5, "-138352613", "%ld",
-__LINE__, 0xfa4e2c1b, "fa4e2c1b", "%x",
-__LINE__, 0x000001f3, "499", "%0ld",
-__LINE__, 0xffff03e4, "ffff03e4", "%x",
-__LINE__, 0x000000ac, "+0172", "%+.4ld",
-__LINE__, 0x03c3903b, "63148091", "%00d",
-__LINE__, 0x0000000d, "13", "%#d",
-__LINE__, 0x0000002e, "0X2E", "%#X",
-__LINE__, 0x00006b2d, "6B2D", "%X",
-__LINE__, 0x0000010b, " 0010b", "%7.5x",
-__LINE__, 0x0000017a, " 17a", "%4x",
-__LINE__, 0xfffffffb, "fffffffb", "%+x",
-__LINE__, 0xffffac6a, "ffffac6a", "%-.3x",
-__LINE__, -0x0005870, "-22640", "%0d",
-__LINE__, 0x189c17bc, "189c17bc", "%x",
-__LINE__, -0x01bbc38, "-1817656", "%#6.ld",
-__LINE__, -0x3382b55, "-54012757", "%d",
-__LINE__, -0x0000007, "-7", "%-ld",
-__LINE__, -0x000c74b, "-51019", "%ld",
-__LINE__, 0x0001a6f2, "+108274", "%+#1.ld",
-__LINE__, 0x00077448, "77448", "%x",
-__LINE__, 0x00000000, "0", "%x",
-__LINE__, 0xfffff056, "FFFFF056", "%.3X",
-__LINE__, -0x6f3f9451, "-1866437713", "%-#3.0ld",
-__LINE__, 0x000000ac, "AC", "%X",
-__LINE__, 0xffc8752f, "ffc8752f", "%-x",
-__LINE__, 0xfffffe6d, "FFFFFE6D", "%2.X",
-__LINE__, -0x377f1a5, "-58192293", "% .2d",
-__LINE__, -0x0000294, "-660", "%d",
-__LINE__, 0xfffffffe, "fffffffe", "%-x",
-__LINE__, 0xfffcbbe8, "0xfffcbbe8", "%-#4.x",
-__LINE__, 0x0022e510, "+2286864", "%+ld",
-__LINE__, 0xfffffe2a, "FFFFFE2A", "%0.3X",
-__LINE__, 0xfe29f7c0, "fe29f7c0", "%x",
-__LINE__, 0xfffe957e, "FFFE957E", "%X",
-__LINE__, 0x000080f8, "33016", "%ld",
-__LINE__, 0x0003ee2c, " 257580", "%7d",
-__LINE__, 0x000003a1, "929", "%d",
-__LINE__, 0x0000021f, "21f", "%+x",
-__LINE__, 0xffffffff, "ffffffff", "%.5x",
-__LINE__, -0x040a988, "-4237704", "%-d",
-__LINE__, 0x027c8b69, "41716585", "%ld",
-__LINE__, 0x00000003, "3", "%-X",
-__LINE__, -0x0000368, " -872", "%7.d",
-__LINE__, 0x00000d3c, "3388", "%0.2d",
-__LINE__, -0x33734cc, "-53949644", "%2ld",
-__LINE__, 0x000003db, "3DB", "%X",
-__LINE__, -0x00f154d, "-988493", "%5d",
-__LINE__, 0x0000000b, " 11", "%4.ld",
-__LINE__, 0x00000067, "103", "%-ld",
-__LINE__, -0x0199fce, "-1679310", "%4d",
-__LINE__, 0x02b6266b, "2b6266b", "% x",
-__LINE__, -0x006b39d, "-439197", "%+d",
-__LINE__, 0x00000007, "7", "%ld",
-__LINE__, 0x0141fc98, "21101720", "%0ld",
-__LINE__, -0x0008420, "-33824", "%d",
-__LINE__, 0x0011622b, "1139243", "%6ld",
-__LINE__, 0x0000001b, "27", "%-d",
-__LINE__, -0x0030935, "-198965", "%3d",
-__LINE__, 0x0000001f, " 1f", "%4.x",
-__LINE__, -0x10782a19, "-276310553", "%#ld",
-__LINE__, -0x007eac4, "-518852", "%06.ld",
-__LINE__, 0x0bc4c681, "197445249", "%6ld",
-__LINE__, 0x000000f5, "245", "%.3ld",
-__LINE__, 0x00000197, "197", "%X",
-__LINE__, 0xfffffeab, "FFFFFEAB", "% X",
-__LINE__, 0x00000f05, "F05", "%+X",
-__LINE__, 0xffe1b785, "0xffe1b785", "%#x",
-__LINE__, -0x02d3581, "-2962817", "%05d",
-__LINE__, 0xffffb994, "FFFFB994", "%X",
-__LINE__, 0x03d139a3, "64043427", "%ld",
-__LINE__, -0x0000002, " -2", "%+4.d",
-__LINE__, -0x043da83, "-4446851", "%#ld",
-__LINE__, -0x6aad891, "-111859857", "%7.ld",
-__LINE__, 0x00003e68, "15976", "%-4.5ld",
-__LINE__, 0xffe4d3ee, "FFE4D3EE", "%X",
-__LINE__, 0x00000002, "000002", "%4.6ld",
-__LINE__, 0xffffee32, "ffffee32", "%4x",
-__LINE__, 0x0cb7dd25, "cb7dd25", "%3x",
-__LINE__, 0xf773d422, "F773D422", "%X",
-__LINE__, -0x0b590f7, "-11899127", "%#d",
-__LINE__, -0x0002c45, "-11333", "%-#5ld",
-__LINE__, -0x1efc9e4, "-32492004", "%ld",
-__LINE__, -0x0003b9c, "-15260", "%d",
-__LINE__, 0x000001b6, "0X1B6", "%#4X",
-__LINE__, 0x3ce93ec3, "1021918915", "%.6d",
-__LINE__, 0xffffffff, "ffffffff", "%-x",
-__LINE__, 0xfffaf0e4, "fffaf0e4", "%2.x",
-__LINE__, 0x00000002, "0x2", "%#x",
-__LINE__, 0x0000e806, "e806", "%4x",
-__LINE__, 0xfffffff0, "fffffff0", "% 2.x",
-__LINE__, 0xfffffc0e, "fffffc0e", "%+.4x",
-__LINE__, 0xfd45716e, "FD45716E", "%.4X",
-__LINE__, 0xfff96fda, "FFF96FDA", "%-X",
-__LINE__, 0xff99d08a, "FF99D08A", "%.5X",
-__LINE__, 0x00000002, "2", "%-00.d",
-__LINE__, -0x000000f, " -15", "%6.ld",
-__LINE__, -0x00d321c, "-864796", "%#1ld",
-__LINE__, 0xff19ff8d, "ff19ff8d", "%1.5x",
-__LINE__, 0x00000000, "0000000", "%-.7x",
-__LINE__, 0x0000f50d, " F50D", "%5X",
-__LINE__, 0x00001688, " 5768", "%7.ld",
-__LINE__, 0x00000157, "343", "%2ld",
-__LINE__, 0xfffffffd, "0xfffffffd", "%+#3x",
-__LINE__, 0x00000d52, "3410", "%ld",
-__LINE__, 0x00000003, "3", "%d",
-__LINE__, 0x0001c6d2, "01c6d2", "%.6x",
-__LINE__, 0x242d65d2, "606954962", "%#7.ld",
-__LINE__, 0x00000e9f, "0000E9F", "%5.7X",
-__LINE__, 0x0002d785, "2D785", "%0X",
-__LINE__, 0x00000167, "167", "%0X",
-__LINE__, 0xfffff5e5, "fffff5e5", "% x",
-__LINE__, 0xffb69a04, "0xffb69a04", "%#0.x",
-__LINE__, 0xfffa012e, "FFFA012E", "%X",
-__LINE__, 0x0000001a, "0x1a", "% #x",
-__LINE__, 0xfffb26d3, "fffb26d3", "%+x",
-__LINE__, -0x00003e6, " -998", "%7ld",
-__LINE__, 0x00000004, "4", "%-d",
-__LINE__, 0xfffffd76, "0XFFFFFD76", "%#7X",
-__LINE__, 0x00000035, "53", "%ld",
-__LINE__, 0xffc6c190, "0XFFC6C190", "%#X",
-__LINE__, 0xffffffe2, "ffffffe2", "%7.0x",
-__LINE__, 0x03ff1b87, "67050375", "%2.d",
-__LINE__, 0x00020c47, "0X20C47", "%#X",
-__LINE__, 0x00000000, "0", "%d",
-__LINE__, 0x0000000e, "0X000E", "% #.4X",
-__LINE__, -0x00035cd, "-13773", "%+2.d",
-__LINE__, 0x00005eec, "5eec", "%1x",
-__LINE__, 0x001da0ff, "1941759", "%0d",
-__LINE__, 0xf8a9e96a, "f8a9e96a", "%+x",
-__LINE__, -0x0000120, "-288 ", "%-#6.d",
-__LINE__, 0x00000000, "0", "%-X",
-__LINE__, 0x0000152e, "152E", "%+X",
-__LINE__, -0x0001077, "-4215", "% 0d",
-__LINE__, 0xffffffd7, "FFFFFFD7", "%0X",
-__LINE__, 0xfffe097d, "FFFE097D", "%2X",
-__LINE__, 0xcb982712, "cb982712", "%x",
-__LINE__, 0xfff39f2e, "FFF39F2E", "%.5X",
-__LINE__, -0x0058cae, "-363694", "%+.1d",
-__LINE__, -0x000002b, "-043", "%#1.3d",
-__LINE__, -0x001e989, "-125321", "%1d",
-__LINE__, 0x00959ecd, "9805517", "%d",
-__LINE__, 0xf49df846, "F49DF846", "%+3X",
-__LINE__, 0xfffffffd, "fffffffd", "%+.5x",
-__LINE__, -0x000ac76, "-44150", "%3.ld",
-__LINE__, 0x00000028, " 0028", "%06.4x",
-__LINE__, 0x000003e8, "3E8", "%-02X",
-__LINE__, 0x00000012, "012", "%.3X",
-__LINE__, 0x00000006, "0X6", "%#X",
-__LINE__, 0x00ef8479, "+15697017", "%+0.6d",
-__LINE__, 0xffffffe8, "FFFFFFE8", "%-X",
-__LINE__, 0x773a90f7, "773a90f7", "%3.5x",
-__LINE__, 0x00096d44, "96D44", "%-X",
-__LINE__, -0x08a3d96, "-9059734", "%ld",
-__LINE__, -0x000001a, "-26", "%00.ld",
-__LINE__, 0x32f57585, "32f57585", "% x",
-__LINE__, 0x2825f175, "2825F175", "%X",
-__LINE__, 0x000054ff, "21759", "%-2d",
-__LINE__, -0x0266cdc, "-2518236", "%ld",
-__LINE__, 0x0000031d, "0X31D", "%+#4X",
-__LINE__, 0x0003fc99, "3fc99", "%x",
-__LINE__, -0x0064624, "-411172", "%-#d",
-__LINE__, 0x0001b2d9, "111321", "%-ld",
-__LINE__, -0x000007c, "-124", "%#d",
-__LINE__, 0xfffffffa, "FFFFFFFA", "%+X",
-__LINE__, -0x007a5b8, "-501176", "%+ld",
-__LINE__, 0x0213b583, "213B583", "%2.X",
-__LINE__, 0xfff12e51, "FFF12E51", "%+X",
-__LINE__, 0x00052403, "0336899", "%-0.7d",
-__LINE__, 0xffffffff, "ffffffff", "%-04.4x",
-__LINE__, 0x00000010, "0010", "%0.4X",
-__LINE__, 0xffffffb5, "FFFFFFB5", "%-1.3X",
-__LINE__, -0x0000001, "-1", "%d",
-__LINE__, 0x0003a2d1, "3a2d1", "% x",
-__LINE__, 0x00000424, "1060", "%0ld",
-__LINE__, -0x0000078, "-120", "%1d",
-__LINE__, 0x00000000, "0", "%ld",
-__LINE__, 0x00000414, "1044", "%ld",
-__LINE__, 0x00000072, "0x072", "%#5.3x",
-__LINE__, 0x0000007a, "7A", "% X",
-__LINE__, 0x081542a3, "135611043", "%0d",
-__LINE__, 0xfffb4ce6, "fffb4ce6", "%4.6x",
-__LINE__, 0x00002ab2, "2ab2", "%-1x",
-__LINE__, 0x00000000, " 0", "% 2x",
-__LINE__, 0xfffffa59, "FFFFFA59", "%2.X",
-__LINE__, 0xffffe22b, "ffffe22b", "%-x",
-__LINE__, 0xfffffd52, "FFFFFD52", "%+.2X",
-__LINE__, 0x0000039f, "927", "%-d",
-__LINE__, 0x0002dea6, "2dea6", "%0x",
-__LINE__, 0x000216db, "136923", "%ld",
-__LINE__, 0x00000013, "19", "%0d",
-__LINE__, 0x000047cc, "18380", "%2.2ld",
-__LINE__, -0x0007d10, "-32016", "%d",
-__LINE__, 0xff9af906, "FF9AF906", "%0X",
-__LINE__, 0x02cfa224, "+47161892", "%+0.7d",
-__LINE__, -0x0000022, "-34", "%1.d",
-__LINE__, 0xfffffff0, "FFFFFFF0", "%-4X",
-__LINE__, 0x00000029, " 41", "%6.ld",
-__LINE__, 0xffffff76, "ffffff76", "%x",
-__LINE__, 0x00000000, "0", "%+X",
-__LINE__, 0x00000001, "1", "%d",
-__LINE__, 0xfff6de5a, "FFF6DE5A", "%X",
-__LINE__, 0x00000002, "2", "%ld",
-__LINE__, 0x00000025, "25", "%+x",
-__LINE__, 0xfffffffb, "FFFFFFFB", "%5.0X",
-__LINE__, 0x0011bbb5, "1162165", "%0.0ld",
-__LINE__, 0xfffcdc96, "0XFFFCDC96", "%#X",
-__LINE__, 0x00008f5f, "8f5f", "%3.1x",
-__LINE__, 0xffa0fa5d, "0XFFA0FA5D", "%#X",
-__LINE__, 0x00004534, "4534", "% 0X",
-__LINE__, 0xfffffff9, "fffffff9", "%.2x",
-__LINE__, 0xffeeae50, "ffeeae50", "%-x",
-__LINE__, 0x00002964, " 0010596", "% 0.7d",
-__LINE__, 0x000021c9, " 21c9", "%6x",
-__LINE__, 0x00000001, " 1", "% d",
-__LINE__, 0x0002abd8, "+175064", "%+d",
-__LINE__, 0xffffffad, "FFFFFFAD", "%+0X",
-__LINE__, 0x00000003, "3", "%ld",
-__LINE__, 0x0c036da3, " 201551267", "% .3d",
-__LINE__, -0x004343c, "-275516", "%+ld",
-__LINE__, 0x00000003, "003", "% .3x",
-__LINE__, 0xffffe34e, "ffffe34e", "%x",
-__LINE__, 0x0000e118, "e118", "%x",
-__LINE__, -0x007d945, "-514373", "%+#0ld",
-__LINE__, 0x277f1cc5, "277f1cc5", "% x",
-__LINE__, 0x00003bef, "03bef", "% 0.5x",
-__LINE__, 0xfffffcb9, "fffffcb9", "%x",
-__LINE__, 0x0003311a, "209178", "%ld",
-__LINE__, 0x00000000, " ", "%3.ld",
-__LINE__, 0x05942225, "5942225", "%x",
-__LINE__, 0xfffceb4c, "FFFCEB4C", "%-X",
-__LINE__, 0xffd08633, "ffd08633", "%2.x",
-__LINE__, -0x0000001, " -1", "%6d",
-__LINE__, 0x000fdb12, "1039122", "%d",
-__LINE__, 0x00000003, "3", "% 0X",
-__LINE__, -0x2fd5bf1, "-50158577", "% 5.ld",
-__LINE__, -0x0089a03, "-563715", "%-d",
-__LINE__, 0xfffffffe, "FFFFFFFE", "% X",
-__LINE__, 0x29fdb2ba, "29fdb2ba", "% 0x",
-__LINE__, 0x0000008f, "8F", "% X",
-__LINE__, 0x00000003, "3", "%ld",
-__LINE__, 0xffc58445, "FFC58445", "%.2X",
-__LINE__, -0x00023f6, "-9206", "%+d",
-__LINE__, 0x00000011, "11", "%X",
-__LINE__, -0x0000003, "-0000003", "%-.7d",
-__LINE__, -0x0000003, "-3", "%#ld",
-__LINE__, 0x001242d9, "1242D9", "%X",
-__LINE__, -0x48d0c81, "-76352641", "%7.d",
-__LINE__, -0x001b675, "-112245", "%#ld",
-__LINE__, 0x00000003, "3", "%-d",
-__LINE__, 0xfff93fdf, "0XFFF93FDF", "% #X",
-__LINE__, 0x001a9414, "1741844", "%#ld",
-__LINE__, 0x0001fd86, "130438", "%ld",
-__LINE__, 0x010f37a8, "17774504", "%4.7d",
-__LINE__, 0x00382838, "0382838", "%3.7X",
-__LINE__, -0x47fd56c2, "-1207785154", "%ld",
-__LINE__, 0x001981dd, "1981dd", "%x",
-__LINE__, 0xffffefba, "ffffefba", "% 06.x",
-__LINE__, -0x3f402b29, "-1061169961", "%+#ld",
-__LINE__, -0x395aae44, "-962244164", "%-1d",
-__LINE__, 0x1fa39f42, "530816834", "%#d",
-__LINE__, -0x000358d, "-13709", "%d",
-__LINE__, -0xdc17b8f, "-230783887", "%ld",
-__LINE__, -0x23c41583, "-600053123", "%+3.d",
-__LINE__, 0xfffffc16, "fffffc16", "%x",
-__LINE__, 0x003f1364, "4133732", "%7.ld",
-__LINE__, 0xffffe691, "FFFFE691", "%07X",
-__LINE__, 0x07b31d71, "129178993", "%.7d",
-__LINE__, -0x0019732, "-104242", "% ld",
-__LINE__, 0x02428167, "0x2428167", "%#x",
-__LINE__, -0x06c1ecd, "-7085773", "%.7ld",
-__LINE__, 0xfb01cb4e, "fb01cb4e", "%x",
-__LINE__, 0x00005a41, "+23105", "%+ld",
-__LINE__, 0xfffffff4, "FFFFFFF4", "%-5.X",
-__LINE__, 0x00000005, " 5", "%4.ld",
-__LINE__, 0xf4ab4b2d, "F4AB4B2D", "%0.X",
-__LINE__, -0x000fce3, "-64739", "%+#3.ld",
-__LINE__, 0x000076ea, " 30442", "%6.2ld",
-__LINE__, 0x00000cb9, " cb9", "%4.x",
-__LINE__, 0x002f43ef, "3097583", "%1.1ld",
-__LINE__, 0xf5bd0105, "F5BD0105", "%+X",
-__LINE__, 0x0037954a, "3642698", "%d",
-__LINE__, 0xfffffff7, "0XFFFFFFF7", "%-#X",
-__LINE__, 0xffffcedf, "0xffffcedf", "%#6.7x",
-__LINE__, 0xfffffde4, "FFFFFDE4", "%2.4X",
-__LINE__, 0x01a6f103, "1a6f103", "%5.x",
-__LINE__, 0x00000191, " 191", "%7.0X",
-__LINE__, 0x00000003, "03", "% .2X",
-__LINE__, -0xd4e3219, "-223228441", "%6.ld",
-__LINE__, 0x00b0efbd, "11595709", "%d",
-__LINE__, -0x00000ea, "-234", "%#3d",
-__LINE__, 0x00000be8, "BE8 ", "%-5X",
-__LINE__, 0xffffffff, "ffffffff", "%5.3x",
-__LINE__, -0x267f8c6, "-40368326", "%d",
-__LINE__, 0x000006ed, "6ED", "%X",
-__LINE__, 0xfdd6c9b6, "FDD6C9B6", "%X",
-__LINE__, 0x0007ac29, "7ac29", "%-x",
-__LINE__, 0x00000014, "14", "%2x",
-__LINE__, 0x123ca563, "+305964387", "%+ld",
-__LINE__, 0x00000004, " 4", "%5.d",
-__LINE__, 0xffff877a, "ffff877a", "%x",
-__LINE__, -0x00003e7, "-999", "%+0.3d",
-__LINE__, 0x0a68ba6e, "a68ba6e", "%3.1x",
-__LINE__, 0xfe29c810, "FE29C810", "%+X",
-#endif
-
-__LINE__, 0x00000000, "0", "%o",
-__LINE__, 0000000123, "123", "%o",
-__LINE__, 0000123456, "0123456", "%#o",
-__LINE__, 0000123456, "00123456", "%#.8o",
-__LINE__, 0000123456, " 00123456", "%#10.8o",
-__LINE__, 0x00000123, "0x00123", "%#07x",
-
-0,
-};
-
-int main()
-{
- int errcount = 0;
- int testcount = 0;
-#define BSIZE 1024
- char buffer[BSIZE];
- sprint_int_type *iptr;
-#if defined(__cplusplus) && !defined(TEST_LIBIO)
-
- ostrstream sstr(buffer, BSIZE);
-
- for (iptr = sprint_ints; iptr->line; iptr++) {
- sstr.seekp(0);
- sstr.form(iptr->format_string, iptr->value);
- sstr << ends;
- if (strcmp(buffer, iptr->result) != 0) {
- errcount++;
- cerr << "Error in line " << iptr->line;
- cerr << " using \"" << iptr->format_string;
- cerr << "\". Result is \"" << buffer << "\"; should be: \"";
- cerr << iptr->result << "\".\n";
- }
- testcount++;
- }
-
-
- if (errcount == 0) {
- cerr << "Encountered no errors in " << testcount << " tests.\n";
- return 0;
- }
- else {
- cerr << "Encountered " << errcount << " errors in "
- << testcount << " tests.\n";
- return 1;
- }
-#else
- for (iptr = sprint_ints; iptr->line; iptr++) {
- sprintf(buffer, iptr->format_string, iptr->value);
- if (strcmp(buffer, iptr->result) != 0) {
- errcount++;
- fprintf(stderr,
- "Error in line %d using \"%s\". Result is \"%s\"; should be: \"%s\".\n",
- iptr->line, iptr->format_string, buffer, iptr->result);
- }
- testcount++;
- }
-
- if (errcount == 0) {
- fprintf(stderr, "Encountered no errors in %d tests.\n", testcount);
- return 0;
- }
- else {
- fprintf(stderr, "Encountered %d errors in %d tests.\n",
- errcount, testcount);
- return 1;
- }
-#endif
-}
diff --git a/contrib/libg++/libio/tests/tiomanip.cc b/contrib/libg++/libio/tests/tiomanip.cc
deleted file mode 100644
index b7dd08a4618e..000000000000
--- a/contrib/libg++/libio/tests/tiomanip.cc
+++ /dev/null
@@ -1,35 +0,0 @@
-// test the parametrized manipulators
-
-#include <stdlib.h>
-#include <iomanip.h>
-
-main()
-{
-#ifdef _G_NO_TEMPLATES
- cerr << "(IO manipulators are not supported with this compiler)\n");
- exit(-1);
-#else
-
- cout << dec << 1234 << ' '
- << hex << 1234 << ' '
- << oct << 1234 << endl;
-
- //SMANIP<int> x = setw(4);
- //operator<<(cout, x);
-
- cout
- << "("
- << dec << setw(4) << setfill('*')
- << 12 << ")\n";
-
- cout << "(" << 12 << ")\n";
-
- cout << setiosflags(ios::internal);
- cout << "(" << setw(6) << -12 << ")\n";
-
- exit(0);
-#endif
-}
-
-
-
diff --git a/contrib/libg++/libio/tests/tiomanip.exp b/contrib/libg++/libio/tests/tiomanip.exp
deleted file mode 100644
index 7a0a7ea5cb21..000000000000
--- a/contrib/libg++/libio/tests/tiomanip.exp
+++ /dev/null
@@ -1,4 +0,0 @@
-1234 4d2 2322
-(**12)
-(12)
-(-***12)
diff --git a/contrib/libg++/libio/tests/tiomisc.cc b/contrib/libg++/libio/tests/tiomisc.cc
deleted file mode 100644
index 3351e4d88145..000000000000
--- a/contrib/libg++/libio/tests/tiomisc.cc
+++ /dev/null
@@ -1,236 +0,0 @@
-/* Random regression tests etc. */
-
-#include <fstream.h>
-#include <stdio.h>
-#include <strstream.h>
-#include <string.h>
-#include <fcntl.h>
-#include <stdlib.h>
-#include <assert.h>
-
-#define BUF_SIZE 4096
-
-void
-test1 ()
-{
- fstream f;
- char buf[BUF_SIZE];
-
- f.setbuf( buf, BUF_SIZE );
-}
-
-void
-test2 ( )
-{
- char string[BUF_SIZE];
- ostrstream s( string, BUF_SIZE );
-
- s << "Bla bla bla " << 55 << ' ' << 3.23 << '\0' << endl;
- cout << "Test2: " << string << endl;
-}
-
-
-/* Test case from Joe Buck <jbuck@Synopsys.COM>. */
-
-class special_ofstream : public ofstream {
-public:
- special_ofstream() : ofstream() {}
- special_ofstream(int fd) : ofstream(fd) {}
- special_ofstream(const char *name, int mode=ios::out, int prot=0664) {
- open(name,mode,prot);
- }
- void open(const char *name, int mode=ios::out, int prot=0664);
-};
-
-void special_ofstream::open(const char* name, int mode, int prot) {
- if (strcmp(name, "<cout>") == 0) {
- rdbuf()->attach(1);
- }
- else if (strcmp(name, "<cerr>") == 0) {
- rdbuf()->attach(2);
- setf(unitbuf);
- }
- else ofstream::open(name,mode,prot);
-}
-
-void
-test3 ()
-{
- {
- special_ofstream o("<cout>");
- o << "Hello\n";
- // o is destructed now. This should not close cout
- }
- {
- special_ofstream o("<cout>");
- o << "Line 2\n";
- }
-}
-
-void
-getline_test1 ()
-{
- char buf[1000];
- char data[] = "#include <iostream.h>\n#include <fstream.h>\n";
- istrstream infile(data, strlen(data));
- infile.getline(buf,1000);
- infile.getline(buf,1000);
-
- cout << buf << '\n';
-}
-
-// test istream::getline on readng overlong lines.
-void
-getline_test2 ()
-{
- char data[] = "Line one.\nline 2.\n";
- char line[100];
- istrstream strin(data, strlen(data));
- strin.getline(line, 10);
- cout << "line: " << line << ", count: " << strin.gcount () << "\n";
-}
-
-void
-getline_test3 ()
-{
- char data[] = "123456789\nabcdefghijkl.\n";
- char line[10];
- istrstream strin(data, strlen(data));
- strin.getline(line, 10);
- cout << "line: " << line << ", count: " << strin.gcount () << "\n";
- strin.getline(line, 10);
- cout << "line: " << line << ", count: " << strin.gcount () << "\n";
- assert (!strin.good());
- strin.clear ();
- strin.getline(line, 10);
- cout << "line: " << line << ", count: " << strin.gcount () << "\n";
-}
-
-class A : private ostream
-{
-public:
- A(streambuf* s);
- ostream::flush;
-};
-A::A(streambuf* s)
-: ostream(s)
-{
-}
-
-void
-flush1_test()
-{
- A os(cout.rdbuf());
- os.flush();
-}
-
-void
-reread_test ()
-{ // This is PR 5486.
- int tag_char;
- char *fname = "Makefile";
- int mode = O_RDONLY;
- filebuf file_p;
-
- int fd = ::open(fname, mode, 0666);
- file_p.attach(fd);
-
- istream d_istream(&file_p);
-
- // Read a character from the stream, save it and put it back.
- tag_char = d_istream.get();
- int save_char = tag_char;
- d_istream.putback((char) tag_char);
-
- // Uncomment then next statement and the next get will be EOF.
- streampos pos = d_istream.tellg();
-
- // Re-read the first character
- tag_char = d_istream.get();
-
- cout << "reread_test: " << (char)save_char << " " << (char)tag_char << "\n";
- cout.flush();
-
-}
-
-void *danger_pointer;
-void operator delete (void *p)
-{
- if (p)
- {
- if (p == danger_pointer)
- fprintf (stderr, "maybe deleted\n");
-
- free (p);
- }
-}
-
-struct my_ostream: virtual public ios, public ostream
-{
- my_ostream (ostream &s): ios (s.rdbuf()) { }
-};
-
-void
-test_destroy ()
-{
- ofstream fstr ("foo.dat");
- my_ostream wa (fstr);
-
- /* Check that sure wa.rdbuf() is only freed once. */
- danger_pointer = wa.rdbuf ();
-
- wa << "Hi there" << endl;
-#ifdef _IO_NEW_STREAMS
- fprintf (stderr, "maybe deleted\n");
-#endif
-}
-
-/* Submitted by Luke Blanshard <luke@cs.wisc.edu>.
-
- In certain circumstances, the library will write past the end of the
- buffer it has allocated for a file: You must read from the file,
- exactly enough bytes that the read pointer is at the end of the
- buffer. Then you must write to the file, at the same place you just
- finished reading from.
-
- "Your patch looks great, and you're welcome to use the test code for any
- purpose whatever. I hereby renounce my implicit copyright on it." */
-
-void
-test_read_write_flush ()
-{
- fstream f;
- char buf[8192];
-
- for ( int index=0; index < sizeof buf; ++index )
- buf[index] = (index+1)&63? 'x' : '\n';
-
- f.open( "foo.dat", ios::in|ios::out|ios::trunc );
- f.write( buf, sizeof buf );
-
- f.seekg( 0, ios::beg );
- f.read( buf, sizeof buf );
-
-// f.seekp( sizeof buf, ios::beg ); // Present or absent, bug still happens.
- f.write( "a", 1 );
-
- if ( f.rdbuf()->_IO_write_ptr > f.rdbuf()->_IO_buf_end )
- cerr << "test_read_write_flush: it's broken.\n";
- else
- cout << "test_read_write_flush: the problem isn't showing itself.\n";
-}
-
-int main( )
-{
- test1 ();
- test2 ();
- test3 ();
- getline_test1 ();
- getline_test2 ();
- getline_test3 ();
- flush1_test ();
- reread_test ();
- test_destroy ();
- test_read_write_flush ();
- return 0;
-}
diff --git a/contrib/libg++/libio/tests/tiomisc.exp b/contrib/libg++/libio/tests/tiomisc.exp
deleted file mode 100644
index 26a3acd33fb1..000000000000
--- a/contrib/libg++/libio/tests/tiomisc.exp
+++ /dev/null
@@ -1,11 +0,0 @@
-Test2: Bla bla bla 55 3.23
-Hello
-Line 2
-#include <fstream.h>
-line: Line one., count: 10
-line: 123456789, count: 10
-line: abcdefghi, count: 9
-line: jkl., count: 5
-reread_test: # #
-maybe deleted
-test_read_write_flush: the problem isn't showing itself.
diff --git a/contrib/libg++/libio/tests/tstdiomisc.c b/contrib/libg++/libio/tests/tstdiomisc.c
deleted file mode 100644
index 1c15b75a7095..000000000000
--- a/contrib/libg++/libio/tests/tstdiomisc.c
+++ /dev/null
@@ -1,43 +0,0 @@
-#ifndef STDIO_H
-#define STDIO_H <iostdio.h>
-#endif
-#include STDIO_H
-
-void
-t1 ()
-{
- int n = -1;
- sscanf ("abc ", "abc %n", &n);
- printf ("t1: count=%d\n", n);
-}
-
-void
-t2 ()
-{
- int n;
- long N;
- int retval;
-#define SCAN(INPUT, FORMAT, VAR) \
- VAR = -1; \
- retval = sscanf (INPUT, FORMAT, &VAR); \
- printf ("sscanf (\"%s\", \"%s\", &x) => %d, x = %ld\n", \
- INPUT, FORMAT, retval, VAR);
-
- SCAN ("12345", "%ld", N);
- SCAN ("12345", "%llllld", N);
- SCAN ("12345", "%LLLLLd", N);
- SCAN ("test ", "%*s%n", n);
- SCAN ("test ", "%2*s%n", n);
- SCAN ("12 ", "%l2d", n);
- SCAN ("12 ", "%2ld", N);
-}
-
-int
-main ()
-{
- t1 ();
- t2 ();
-
- fflush (stdout);
- return 0;
-}
diff --git a/contrib/libg++/libio/tests/tstdiomisc.exp b/contrib/libg++/libio/tests/tstdiomisc.exp
deleted file mode 100644
index b8ee02dcd6a3..000000000000
--- a/contrib/libg++/libio/tests/tstdiomisc.exp
+++ /dev/null
@@ -1,8 +0,0 @@
-t1: count=5
-sscanf ("12345", "%ld", &x) => 1, x = 12345
-sscanf ("12345", "%llllld", &x) => 0, x = -1
-sscanf ("12345", "%LLLLLd", &x) => 0, x = -1
-sscanf ("test ", "%*s%n", &x) => 0, x = 4
-sscanf ("test ", "%2*s%n", &x) => 0, x = -1
-sscanf ("12 ", "%l2d", &x) => 0, x = -1
-sscanf ("12 ", "%2ld", &x) => 1, x = 12
diff --git a/contrib/libg++/librx/ChangeLog b/contrib/libg++/librx/ChangeLog
deleted file mode 100644
index dbeccf8682c7..000000000000
--- a/contrib/libg++/librx/ChangeLog
+++ /dev/null
@@ -1,302 +0,0 @@
-Mon Apr 8 15:17:13 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * configure.in: Add AC_ARG_ENABLE for --enable-shared. Permit it
- to specify a list of directories.
- * configure: Rebuild with autoconf 2.8.
-
-Tue Nov 14 01:49:21 1995 Doug Evans <dje@canuck.cygnus.com>
-
- * configure.in (AC_CONFIG_AUX_DIR): Define.
- (AC_OUTPUT): Call config-ml.in.
- * configure: Regenerated.
-
-Mon Nov 13 13:40:15 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * configure.in: Use AC_MSG_CHECKING and AC_MSG_RESULT, rather than
- pre-expanding them.
- * configure: Rebuild.
-
-Wed Oct 4 12:10:39 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * configure.in: If using GCC, assume we always have alloca. This
- works around problems with broken cross setups. Use
- AC_FUNC_ALLOCA rather than AC_ALLOCA.
- * configure: Rebuild.
-
-Wed Sep 20 13:55:42 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * Makefile.in (maintainer-clean): New synonym for realclean.
-
-Mon Jun 19 00:33:22 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * Makefile.in: Massage broken shells that require 'else true'.
-
-Sun Jun 18 23:24:00 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * Makefile.in (distclean): Also remove config.cache and config.log.
-
-Thu Jun 8 22:42:58 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * configure.in: Add support for PIC flag configuration.
- * configure: Regenerate.
- * Makefile.in: Adjust accordingly.
-
-Mon Jun 5 18:46:06 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * Makefile.in (PICFLAG): New macro.
- (rx.o): Depend on stamp-picdir.
- (.c.o): Also build pic object.
- (stamp-picdir): New rule.
- (clean): Remove pic and stamp-picdir.
-
-Tue May 23 12:11:28 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * rx.c (regcomp and other POSX.2 functions): Leave them out for
- now, because they conflict with Motif on HPUX.
-
- * rx.c (re_syntax_table): Only declare #ifndef RX_WANT_RX_DEFS;
- otherwise we duplicate the declaration in rx.h.
- * rx.c (re_search_2_fetch_char): Add missing cast.
-
-Sun Apr 2 23:24:52 1995 Tom Lord <lord@x1.cygnus.com>
-
- * rx.h (rx_search): check for and propogate internal
- errors correctly (bogus check sometimes mistook ok returns
- for internal errors).
-
-Sun Feb 12 19:28:22 1995 Tom Lord (lord@x1.cygnus.com)
-
- * rx.h (rx_search):
- From: hankedr@duc.auburn.edu (Darrel Hankerson)
- 2. I have some problems understanding the code which sets
- search_state.free_chunks=0. It appears to me that since this is used
- to track alloca'd mem, that it should be done once at the top of
- rx_search(). Indeed, this also fixes the problem in the tests I'm
- running, but I don't have confidence in this "solution".
- [looks right to me. -tl]
-
-
- * rx.c: Two reported by kwzh.
-
- (re_search_2_get_burst): in the two string case,
- when computing `inset', add in pos->offset.
-
- (re_search_2_fetch_char): watch for the case when
- pos is just to the left of the second string, pos refers
- to the second string, but the first string is provided.
- This can happen at the very beginning of a match when the
- first thing after matching the priming character is a side
- effect like re_se_wordend.
-
- * rx.h (rx_search): patches (marked by /*|*/)
- from From: hjl@nynexst.com (H.J. Lu). One fixes a clear
- bug in a loop termination test. The other i'm not sure about
- yet, but it doesn't break the sed tests.
-
- * rx.c (re_compile_pattern):
- Initialize buf.rx.cset_size.
- (Fixes problem report from Kayvan Sylvan <kayvan@satyr.Sylvan.COM>)
-
- * rx.c (#define RX_DECL): cleaned up handling of this macro.
-
- * rx.c (re_comp):
- From hjl@nynexst.com
- Define _GNU_SOURCE.
- Test for USE_BSD_REGEX around teh BSD entry points.
- Under BSD, treat the empty-string pattern like the NULL pattern.
- Also under BSD, rx_syntax_options --> re_syntax_options.
- Also, rx_exec --> re_exec and rx_registers --> re_registers.
-
-
- * rx.c (rx_compile):
- From: kwzh@gnu.ai.mit.edu (Karl Heuer)
- The `\sX' handler ends with `goto append_node' but without setting
- the `append' variable first. This patch should fix it.
-
-
- * rx.c (regcomp): explicitly zero the field syntax_parens.
- Reported/fix suggested by Morten Holmqvist <netrom@find2.denet.dk>.
-
- * rx.h (changes under and around ifdef emacs):
- From: kwzh@gnu.ai.mit.edu (Karl Heuer)
- Here's a patch (for 0.06) to fix most of the other problems I
- mentioned. Some of the cpp conditionals in rx.h were ending at
- the wrong place and/or were incorrectly commented; fixing these
- took care of some of the missing declarations.
-
- (fastmap_search): unnecessary defaults to switch statements
- to shut-up "gcc -Wall".
-
-Thu Nov 24 18:39:42 1994 Tom Lord (lord@x1.cygnus.com)
- These fixes let's rx pass the spencer.tests from grep.
-
- * rx.h (rx_search): moved slightly out of date debugging
- code from RX_DEBUG to RX_DEBUG_0.
-
- * rx.h (rx_search): in the outer loop, if get_burst returns
- that there are no more characters, consider the possibility
- of an empty match before failing.
-
- * rx.h (rx_search): when computing search_end, don't waste
- time computing MIN and MAX of values already forced into range.
-
- * rx.h (rx_search): when making RANGE fit within TOTAL_SIZE,
- don't forget to allow the possible empty match at the end of
- string.
-
- * rx.c (is_anchored): the equations solving side-effect
- anchoring were wrong for the r_alternate case. The interesting
- thing about this bug is that it disguises itself as a precedent
- bug between | and ^ because of an optimization in the search
- function that checks rxb->begbuf_only (a return value of is_anchored).
-
- * rx.c: Fix the print-name rx_se_win (missing comma).
- Fix the function print_cset to print non-printable characters
- as octal.
-
-Sat Nov 5 20:01:46 1994 Jason Merrill (jason@phydeaux.cygnus.com)
-
- * Makefile.in (LIBCFLAGS): New variable.
- (.c.o): Use it.
-
-Thu Sep 1 16:23:21 1994 Tom Lord (lord@x1.cygnus.com)
-
- * rx.c: applied patches from H J Lu to unrot BSD compatibility
- code.
-
-Mon Aug 29 16:48:57 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
-
- * Makefile.in (AR_FLAGS): Define.
- (librx.a): Use $(AR) and $(AR_FLAGS).
-
-Fri Aug 26 11:37:36 1994 Ian Lance Taylor (ian@cygnus.com)
-
- * configure.in: Call AC_PROG_CPP explicitly.
- * configure: Rebuilt.
-
-Thu Aug 25 18:19:47 1994 Tom Lord (lord@x1.cygnus.com)
-
- * rx.[ch], configure.in: use __const__ instead of
- AC_CONST. Only include stdio once. Don't check
- for memory.h.
-
-Tue Aug 16 12:12:01 1994 Tom Lord (lord@x1.cygnus.com)
-
- * rx.[ch]: LGPL instead of GPL
-
-Mon Aug 15 16:24:16 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * rx.h (rx_search): When checking if we've gotten to the end,
- handle the case that we're searching backwards.
-
-Tue Jun 21 12:40:50 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
-
- * rx.c (re_rx_search): New function, exports rx_search.
-
- * Makefile.in (clean): Also remove librx.a.
-
-Fri Jun 3 12:16:45 1994 Tom Lord (lord@x1.cygnus.com)
-
- * rx.c(re_search_2_fetch_char): fixed a bug that caused it to
- ignore OFFSET.
-
-Thu May 26 14:05:17 1994 Tom Lord (lord@x1.cygnus.com)
-
- * rx.[ch]: From: Michael Rendell <michael@maple.cs.mun.ca>
-
- ``The problem seems to lie in the casting between pointers and
- integers (pointers on the alpha are 64 bits, ints 32 bits, longs
- 64 bits). The core dump happens in rx_compactify_nfa(), in the
- first for loop in the while(eclose) loop -- rx_hash_find() returns
- 0, which is dereferenced.''
-
- The patch changed the type of rx_hash_masks to long and
- also a use of `int' to hold a side effect in rx_search.
-
-Sat May 14 00:45:14 1994 Tom Lord (lord@x1.cygnus.com)
-
- * rx.c, rx.h: rearranged all the code
- so that all the rx functions can be exported
- or hidden (define RX_WANT_RX_DEFS when compiling
- and when including rx.h).
-
-Wed May 11 01:15:56 1994 Tom Lord (lord@rtl.cygnus.com)
-
- * rx.c, rx.h: added rx_search -- searching in
- arbitrarily fragmented strings, continuation support.
-
-Wed May 4 13:56:55 1994 Tom Lord (lord@rtl.cygnus.com)
-
- * rx.c, rx.h: Started independent maintainence
- of these.
-
------- version 0.04 ------
-
-Fri May 13 02:31:13 1994 Tom Lord (lord@x1.cygnus.com)
-
- * rx.c: eliminated the weirdo custom allocators.
- Fixed some bugs (but lost the ChangeLog entries).
-
-Wed May 11 06:09:31 1994 Chip Salzenberg (chip@fin.uucp)
-
- * rx.c (rx_superstate_eclosure_union): Always return a value.
-
------- version 0.03 ------
-Fri Aug 6 01:57:28 1993 Tom Lord (lord@unix1.andrew.cmu.edu)
-
- * rx.c (re_search_2): sped up the fastmap search a little
- to as to not be slower than regex.c on simple patterns.
- Rx will still lose by a couple instructions in some degenerate
- cases but mostly will win.
-
-Thu Aug 5 11:39:57 1993 Tom Lord (lord@thisbe.weh.andrew.cmu.edu)
-
- * rx.c (re_search_2 & compilation front-ends): cache the starting
- superset of super-nfa's so that it isn't necessary to do an
- eclosure union for every call to re_search_2.
-
- * rx.c (re_search_2): (from Eric Backus) arrange to call
- alloca(0) from a shallower stack frame than re_search_2
- if callling it at all.
-
- This could use a better cpp test. Right now, an extra function
- call is added to re_search_2 unles __GNUC__ is defined. If
- there were something like _HAVE_LOSER_ALLOCA_....
-
- * rx.c (rx_compile, re_search_2, several new fns):
- changed the order of side effect lists so that possible
- futures that begin with complex effects more to the right
- are explored after futures more to the left. Added
- a noop complex effect to alts and stars to guarantee
- they are explored in the right order. An optimization
- after the parse removes some from the alts (and not all
- stars get them in the first place). Changed the `best
- match' criterea -- now that possible futures are ordered
- posixly, we only want to check the length of the match.
- For a given length, the best subexpression partitioning
- is the first one found.
-
- A side effect of this is that Rx will always return the
- same register assignements for a given regexp/input text.
- Bummer :-) / 2.
-
-
------- version 0.02 ------
-
-ed Jul 21 13:10:56 1993 Tom Lord (lord@unix8.andrew.cmu.edu)
-
- * rx.c (re_search_2): elaborated on the rule for picking the
- best match so that the lengths of subexpressions are taken
- into account. This is for Posix compatability.
-
-
------- version 0.01 ------
-
-Sun Jun 13 17:20:35 1993 Tom Lord (lord@tsunami.ucc.andrew.cmu.edu)
-
- * This is the first release of rx.c. Although some of the code
- is derived from regex.c, there is not much continuity between
- the two implementations.
-
-
-
diff --git a/contrib/libg++/librx/DOC b/contrib/libg++/librx/DOC
deleted file mode 100644
index dce6e2e10a4b..000000000000
--- a/contrib/libg++/librx/DOC
+++ /dev/null
@@ -1,179 +0,0 @@
-Most of the interfaces are covered by the documentation for GNU regex.
-
-This file will accumulate factoids about other interfaces until
-somebody writes a manual.
-
-
-* Don't Pass Registers Gratuitously
-
-Search and match functions take an optional parameter which is a
-pointer to "registers" or "match positions". This parameter points
-to a structure which during the match is filled in with the offset locations
-of parenthesized subexpressions.
-
-Unless you specificly need the values that would be stored in that
-structure, you should pass NULL for this parameter. Usually Rx will
-do less backtracking (and so run much faster) if subexpression
-positions are not being measured.
-
-
-* Use syntax_parens
-
-Sometimes you need to know the positions of *some* parenthesized
-subexpressions, but not others. You can still help Rx to avoid
-backtracking by telling it specificly which subexpressions you are interested
-in. You do this by filling in the rxb.syntax_parens field of
-a pattern buffer.
-
- /* If this is a valid pointer, it tells rx not to store the extents of
- * certain subexpressions (those corresponding to non-zero entries).
- * Passing 0x1 is the same as passing an array of all ones. Passing 0x0
- * is the same as passing an array of all zeros.
- * The array should contain as many entries as their are subexps in the
- * regexp.
- */
- char * syntax_parens;
-
-
-* RX_SEARCH
-
-For an example of how to use rx_search, you can look at how
-re_search_2 is defined (in rx.c). Basicly you need to define three
-functions. These are GET_BURST, FETCH_CHAR, and BACK_REF. They each
-operate on `struct rx_string_position' and a closure of your design
-passed as void *.
-
- struct rx_string_position
- {
- const unsigned char * pos; /* The current pos. */
- const unsigned char * string; /* The current string burst. */
- const unsigned char * end; /* First invalid position >= POS. */
- int offset; /* Integer address of current burst */
- int size; /* Current string's size. */
- int search_direction; /* 1 or -1 */
- int search_end; /* First position to not try. */
- };
-
-On entry to GET_BURST, all these fields are set, but POS may be >=
-END. In fact, STRING and END might both be 0.
-
-The function of GET_BURST is to make all the fields valid without
-changing the logical position in the string. SEARCH_DIRECTION is a
-hint about which way the matcher will move next. It is usually 1, and
-is -1 only when fastmapping during a reverse search. SEARCH_END
-terminates the burst.
-
- typedef enum rx_get_burst_return
- (*rx_get_burst_fn) (struct rx_string_position * pos,
- void * app_closure,
- int stop);
-
-
-The closure is whatever you pass to rx_search. STOP is an argument to
-rx_search that bounds the search. You should never return a string
-position from with SEARCH_END set beyond the position indicated by
-STOP.
-
-
- enum rx_get_burst_return
- {
- rx_get_burst_continuation,
- rx_get_burst_error,
- rx_get_burst_ok,
- rx_get_burst_no_more
- };
-
-Those are the possible return values of get_burst. Normally, you only
-ever care about the last two. An error return indicates something
-like trouble reading a file. A continuation return means suspend the
-search and resume by retrying GET_BURST if the search is restarted.
-
-GET_BURST is not quite as trivial as you might hope. If you have a
-fragmented string, you really have to keep two adjacent fragments at
-all times, even though the GET_BURST interface looks like you only
-need one. This is because of operators like `word-boundary' that try
-to look at two adjacent characters. Such operators are implemented
-with FETCH_CHAR.
-
- typedef int (*rx_fetch_char_fn) (struct rx_string_position * pos,
- int offset,
- void * app_closure,
- int stop);
-
-That takes the same closure passed to GET_BURST. It returns the
-character at POS or at one past POS according to whether OFFSET is 0
-or 1.
-
-It is guaranteed that POS + OFFSET is within the string being searched.
-
-
-
-The last function compares characters at one position with characters
-previously matched by a parenthesized subexpression.
-
- enum rx_back_check_return
- {
- rx_back_check_continuation,
- rx_back_check_error,
- rx_back_check_pass,
- rx_back_check_fail
- };
-
- typedef enum rx_back_check_return
- (*rx_back_check_fn) (struct rx_string_position * pos,
- int lparen,
- int rparen,
- unsigned char * translate,
- void * app_closure,
- int stop);
-
-LPAREN and RPAREN are the integer indexes of the previously matched
-characters. The comparison should translate both characters being
-compared by mapping them through TRANSLATE. POS is the point at which
-to begin comparing. It should be advanced to the last character
-matched during backreferencing.
-
-* Compilation Stages
-
-In rx_compile, a string is compiled into a pattern buffer.
-Compilation proceeds in these stages:
-
- 1. Make a syntax tree for the regexp.
- 2. Duplicate the syntax tree and make both trees nodes
- in a single unifying tree.
- 3. In one of the two trees, remove all side effects that
- aren't needed to test for the possibility of a match.
- Such side effects include the filling in of output registers
- for subexpressions that are not backreferenced.
- 4. Optimize the unifying tree.
- 5. Translate the tree to an NFA.
- 6. Analyze and optimize the NFA.
- 7. Copy the NFA into a contiguous region of memory.
-
-
-* Cache Size
-
-During a search or match, the NFA is translated into a "super NFA".
-A super NFA can match the patterns of the corresponding NFA in no more
-and often fewer steps.
-
-The catch is that the super NFA may be costly to construct in its entirety;
-it may not even fit in memory. So, states of the NFA are constructed
-on demand and discarded after a period of non-use. They are kept in a cache
-so that time is not wasted constructing existing nodes twice.
-
-The size of the super state NFA cache is a contributing factor the performance
-of Rx. The larger the cache (to a point) the faster Rx can run. The
-variable rx_cache_bound is an upper limit on the number of superstates
-that can exist in the cache.
-
-The defaulting setting is 128. GNU sed uses 4096. Neither setting
-has much justification although sed's is after a small number of quick
-and dirty experiments. The memory consumed by one superstate is
-between 4k and 8k. The cache only grows to its bounded size if there
-is actual demand for that many states. Sed's setting, for example,
-may appear quite high but in practice that much memory is hardly ever
-used. The default setting was chosen based on the heuristic that a
-megabyte is the upper limit on what a good citizen library can
-allocate without special arrangement.
-
diff --git a/contrib/libg++/librx/rx.c b/contrib/libg++/librx/rx.c
deleted file mode 100644
index 6a93834f55d4..000000000000
--- a/contrib/libg++/librx/rx.c
+++ /dev/null
@@ -1,7193 +0,0 @@
-/* Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
-
-This file is part of the librx library.
-
-Librx 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, or (at your option)
-any later version.
-
-Librx 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 Library General Public
-License along with this software; see the file COPYING.LIB. If not,
-write to the Free Software Foundation, 675 Mass Ave, Cambridge, MA
-02139, USA. */
-
-/* NOTE!!! AIX is so losing it requires this to be the first thing in the
- * file.
- * Do not put ANYTHING before it!
- */
-#if !defined (__GNUC__) && defined (_AIX)
- #pragma alloca
-#endif
-
-/* To make linux happy? */
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif
-
-
-char rx_version_string[] = "GNU Rx version 0.07.2";
-
- /* ``Too hard!''
- * -- anon.
- */
-
-
-#include <stdio.h>
-#include <ctype.h>
-#ifndef isgraph
-#define isgraph(c) (isprint (c) && !isspace (c))
-#endif
-#ifndef isblank
-#define isblank(c) ((c) == ' ' || (c) == '\t')
-#endif
-
-#include <sys/types.h>
-
-#undef MAX
-#undef MIN
-#define MAX(a, b) ((a) > (b) ? (a) : (b))
-#define MIN(a, b) ((a) < (b) ? (a) : (b))
-
-typedef char boolean;
-#define false 0
-#define true 1
-
-#ifndef __GCC__
-#undef __inline__
-#define __inline__
-#endif
-
-/* Emacs already defines alloca, sometimes. */
-#ifndef alloca
-
-/* Make alloca work the best possible way. */
-#ifdef __GNUC__
-#define alloca __builtin_alloca
-#else /* not __GNUC__ */
-#if HAVE_ALLOCA_H
-#include <alloca.h>
-#else /* not __GNUC__ or HAVE_ALLOCA_H */
-#ifndef _AIX /* Already did AIX, up at the top. */
-char *alloca ();
-#endif /* not _AIX */
-#endif /* not HAVE_ALLOCA_H */
-#endif /* not __GNUC__ */
-
-#endif /* not alloca */
-
-/* Memory management and stuff for emacs. */
-
-#define CHARBITS 8
-#define remalloc(M, S) (M ? realloc (M, S) : malloc (S))
-
-
-/* Should we use malloc or alloca? If REGEX_MALLOC is not defined, we
- * use `alloca' instead of `malloc' for the backtracking stack.
- *
- * Emacs will die miserably if we don't do this.
- */
-
-#ifdef REGEX_MALLOC
-#define REGEX_ALLOCATE malloc
-#else /* not REGEX_MALLOC */
-#define REGEX_ALLOCATE alloca
-#endif /* not REGEX_MALLOC */
-
-
-#ifdef RX_WANT_RX_DEFS
-#define RX_DECL extern
-#define RX_DEF_QUAL
-#else
-#define RX_WANT_RX_DEFS
-#define RX_DECL static
-#define RX_DEF_QUAL static
-#endif
-#include "rx.h"
-#undef RX_DECL
-#define RX_DECL RX_DEF_QUAL
-
-
-#ifndef emacs
-
-#ifdef SYNTAX_TABLE
-extern char *re_syntax_table;
-#else /* not SYNTAX_TABLE */
-
-#ifndef RX_WANT_RX_DEFS
-RX_DECL char re_syntax_table[CHAR_SET_SIZE];
-#endif
-
-#ifdef __STDC__
-static void
-init_syntax_once (void)
-#else
-static void
-init_syntax_once ()
-#endif
-{
- register int c;
- static int done = 0;
-
- if (done)
- return;
-
- bzero (re_syntax_table, sizeof re_syntax_table);
-
- for (c = 'a'; c <= 'z'; c++)
- re_syntax_table[c] = Sword;
-
- for (c = 'A'; c <= 'Z'; c++)
- re_syntax_table[c] = Sword;
-
- for (c = '0'; c <= '9'; c++)
- re_syntax_table[c] = Sword;
-
- re_syntax_table['_'] = Sword;
-
- done = 1;
-}
-#endif /* not SYNTAX_TABLE */
-#endif /* not emacs */
-
-/* Compile with `-DRX_DEBUG' and use the following flags.
- *
- * Debugging flags:
- * rx_debug - print information as a regexp is compiled
- * rx_debug_trace - print information as a regexp is executed
- */
-
-#ifdef RX_DEBUG
-
-int rx_debug_compile = 0;
-int rx_debug_trace = 0;
-static struct re_pattern_buffer * dbug_rxb = 0;
-
-#ifdef __STDC__
-typedef void (*side_effect_printer) (struct rx *, void *, FILE *);
-#else
-typedef void (*side_effect_printer) ();
-#endif
-
-#ifdef __STDC__
-static void print_cset (struct rx *rx, rx_Bitset cset, FILE * fp);
-#else
-static void print_cset ();
-#endif
-
-#ifdef __STDC__
-static void
-print_rexp (struct rx *rx,
- struct rexp_node *node, int depth,
- side_effect_printer seprint, FILE * fp)
-#else
-static void
-print_rexp (rx, node, depth, seprint, fp)
- struct rx *rx;
- struct rexp_node *node;
- int depth;
- side_effect_printer seprint;
- FILE * fp;
-#endif
-{
- if (!node)
- return;
- else
- {
- switch (node->type)
- {
- case r_cset:
- {
- fprintf (fp, "%*s", depth, "");
- print_cset (rx, node->params.cset, fp);
- fputc ('\n', fp);
- break;
- }
-
- case r_opt:
- case r_star:
- fprintf (fp, "%*s%s\n", depth, "",
- node->type == r_opt ? "opt" : "star");
- print_rexp (rx, node->params.pair.left, depth + 3, seprint, fp);
- break;
-
- case r_2phase_star:
- fprintf (fp, "%*s2phase star\n", depth, "");
- print_rexp (rx, node->params.pair.right, depth + 3, seprint, fp);
- print_rexp (rx, node->params.pair.left, depth + 3, seprint, fp);
- break;
-
-
- case r_alternate:
- case r_concat:
- fprintf (fp, "%*s%s\n", depth, "",
- node->type == r_alternate ? "alt" : "concat");
- print_rexp (rx, node->params.pair.left, depth + 3, seprint, fp);
- print_rexp (rx, node->params.pair.right, depth + 3, seprint, fp);
- break;
- case r_side_effect:
- fprintf (fp, "%*sSide effect: ", depth, "");
- seprint (rx, node->params.side_effect, fp);
- fputc ('\n', fp);
- }
- }
-}
-
-#ifdef __STDC__
-static void
-print_nfa (struct rx * rx,
- struct rx_nfa_state * n,
- side_effect_printer seprint, FILE * fp)
-#else
-static void
-print_nfa (rx, n, seprint, fp)
- struct rx * rx;
- struct rx_nfa_state * n;
- side_effect_printer seprint;
- FILE * fp;
-#endif
-{
- while (n)
- {
- struct rx_nfa_edge *e = n->edges;
- struct rx_possible_future *ec = n->futures;
- fprintf (fp, "node %d %s\n", n->id,
- n->is_final ? "final" : (n->is_start ? "start" : ""));
- while (e)
- {
- fprintf (fp, " edge to %d, ", e->dest->id);
- switch (e->type)
- {
- case ne_epsilon:
- fprintf (fp, "epsilon\n");
- break;
- case ne_side_effect:
- fprintf (fp, "side effect ");
- seprint (rx, e->params.side_effect, fp);
- fputc ('\n', fp);
- break;
- case ne_cset:
- fprintf (fp, "cset ");
- print_cset (rx, e->params.cset, fp);
- fputc ('\n', fp);
- break;
- }
- e = e->next;
- }
-
- while (ec)
- {
- int x;
- struct rx_nfa_state_set * s;
- struct rx_se_list * l;
- fprintf (fp, " eclosure to {");
- for (s = ec->destset; s; s = s->cdr)
- fprintf (fp, "%d ", s->car->id);
- fprintf (fp, "} (");
- for (l = ec->effects; l; l = l->cdr)
- {
- seprint (rx, l->car, fp);
- fputc (' ', fp);
- }
- fprintf (fp, ")\n");
- ec = ec->next;
- }
- n = n->next;
- }
-}
-
-static char * efnames [] =
-{
- "bogon",
- "re_se_try",
- "re_se_pushback",
- "re_se_push0",
- "re_se_pushpos",
- "re_se_chkpos",
- "re_se_poppos",
- "re_se_at_dot",
- "re_se_syntax",
- "re_se_not_syntax",
- "re_se_begbuf",
- "re_se_hat",
- "re_se_wordbeg",
- "re_se_wordbound",
- "re_se_notwordbound",
- "re_se_wordend",
- "re_se_endbuf",
- "re_se_dollar",
- "re_se_fail",
-};
-
-static char * efnames2[] =
-{
- "re_se_win",
- "re_se_lparen",
- "re_se_rparen",
- "re_se_backref",
- "re_se_iter",
- "re_se_end_iter",
- "re_se_tv"
-};
-
-static char * inx_names[] =
-{
- "rx_backtrack_point",
- "rx_do_side_effects",
- "rx_cache_miss",
- "rx_next_char",
- "rx_backtrack",
- "rx_error_inx",
- "rx_num_instructions"
-};
-
-
-#ifdef __STDC__
-static void
-re_seprint (struct rx * rx, void * effect, FILE * fp)
-#else
-static void
-re_seprint (rx, effect, fp)
- struct rx * rx;
- void * effect;
- FILE * fp;
-#endif
-{
- if ((int)effect < 0)
- fputs (efnames[-(int)effect], fp);
- else if (dbug_rxb)
- {
- struct re_se_params * p = &dbug_rxb->se_params[(int)effect];
- fprintf (fp, "%s(%d,%d)", efnames2[p->se], p->op1, p->op2);
- }
- else
- fprintf (fp, "[complex op # %d]", (int)effect);
-}
-
-
-/* These are so the regex.c regression tests will compile. */
-void
-print_compiled_pattern (rxb)
- struct re_pattern_buffer * rxb;
-{
-}
-
-void
-print_fastmap (fm)
- char * fm;
-{
-}
-
-#endif /* RX_DEBUG */
-
-
-
-/* This page: Bitsets. Completely unintersting. */
-
-#ifdef __STDC__
-RX_DECL int
-rx_bitset_is_equal (int size, rx_Bitset a, rx_Bitset b)
-#else
-RX_DECL int
-rx_bitset_is_equal (size, a, b)
- int size;
- rx_Bitset a;
- rx_Bitset b;
-#endif
-{
- int x;
- RX_subset s = b[0];
- b[0] = ~a[0];
-
- for (x = rx_bitset_numb_subsets(size) - 1; a[x] == b[x]; --x)
- ;
-
- b[0] = s;
- return !x && s == a[0];
-}
-
-#ifdef __STDC__
-RX_DECL int
-rx_bitset_is_subset (int size, rx_Bitset a, rx_Bitset b)
-#else
-RX_DECL int
-rx_bitset_is_subset (size, a, b)
- int size;
- rx_Bitset a;
- rx_Bitset b;
-#endif
-{
- int x = rx_bitset_numb_subsets(size) - 1;
- while (x-- && (a[x] & b[x]) == a[x]);
- return x == -1;
-}
-
-
-#ifdef __STDC__
-RX_DECL int
-rx_bitset_empty (int size, rx_Bitset set)
-#else
-RX_DECL int
-rx_bitset_empty (size, set)
- int size;
- rx_Bitset set;
-#endif
-{
- int x;
- RX_subset s = set[0];
- set[0] = 1;
- for (x = rx_bitset_numb_subsets(size) - 1; !set[x]; --x)
- ;
- set[0] = s;
- return !s;
-}
-
-#ifdef __STDC__
-RX_DECL void
-rx_bitset_null (int size, rx_Bitset b)
-#else
-RX_DECL void
-rx_bitset_null (size, b)
- int size;
- rx_Bitset b;
-#endif
-{
- bzero (b, rx_sizeof_bitset(size));
-}
-
-
-#ifdef __STDC__
-RX_DECL void
-rx_bitset_universe (int size, rx_Bitset b)
-#else
-RX_DECL void
-rx_bitset_universe (size, b)
- int size;
- rx_Bitset b;
-#endif
-{
- int x = rx_bitset_numb_subsets (size);
- while (x--)
- *b++ = ~(RX_subset)0;
-}
-
-
-#ifdef __STDC__
-RX_DECL void
-rx_bitset_complement (int size, rx_Bitset b)
-#else
-RX_DECL void
-rx_bitset_complement (size, b)
- int size;
- rx_Bitset b;
-#endif
-{
- int x = rx_bitset_numb_subsets (size);
- while (x--)
- {
- *b = ~*b;
- ++b;
- }
-}
-
-
-#ifdef __STDC__
-RX_DECL void
-rx_bitset_assign (int size, rx_Bitset a, rx_Bitset b)
-#else
-RX_DECL void
-rx_bitset_assign (size, a, b)
- int size;
- rx_Bitset a;
- rx_Bitset b;
-#endif
-{
- int x;
- for (x = rx_bitset_numb_subsets(size) - 1; x >=0; --x)
- a[x] = b[x];
-}
-
-
-#ifdef __STDC__
-RX_DECL void
-rx_bitset_union (int size, rx_Bitset a, rx_Bitset b)
-#else
-RX_DECL void
-rx_bitset_union (size, a, b)
- int size;
- rx_Bitset a;
- rx_Bitset b;
-#endif
-{
- int x;
- for (x = rx_bitset_numb_subsets(size) - 1; x >=0; --x)
- a[x] |= b[x];
-}
-
-
-#ifdef __STDC__
-RX_DECL void
-rx_bitset_intersection (int size,
- rx_Bitset a, rx_Bitset b)
-#else
-RX_DECL void
-rx_bitset_intersection (size, a, b)
- int size;
- rx_Bitset a;
- rx_Bitset b;
-#endif
-{
- int x;
- for (x = rx_bitset_numb_subsets(size) - 1; x >=0; --x)
- a[x] &= b[x];
-}
-
-
-#ifdef __STDC__
-RX_DECL void
-rx_bitset_difference (int size, rx_Bitset a, rx_Bitset b)
-#else
-RX_DECL void
-rx_bitset_difference (size, a, b)
- int size;
- rx_Bitset a;
- rx_Bitset b;
-#endif
-{
- int x;
- for (x = rx_bitset_numb_subsets(size) - 1; x >=0; --x)
- a[x] &= ~ b[x];
-}
-
-
-#ifdef __STDC__
-RX_DECL void
-rx_bitset_revdifference (int size,
- rx_Bitset a, rx_Bitset b)
-#else
-RX_DECL void
-rx_bitset_revdifference (size, a, b)
- int size;
- rx_Bitset a;
- rx_Bitset b;
-#endif
-{
- int x;
- for (x = rx_bitset_numb_subsets(size) - 1; x >=0; --x)
- a[x] = ~a[x] & b[x];
-}
-
-#ifdef __STDC__
-RX_DECL void
-rx_bitset_xor (int size, rx_Bitset a, rx_Bitset b)
-#else
-RX_DECL void
-rx_bitset_xor (size, a, b)
- int size;
- rx_Bitset a;
- rx_Bitset b;
-#endif
-{
- int x;
- for (x = rx_bitset_numb_subsets(size) - 1; x >=0; --x)
- a[x] ^= b[x];
-}
-
-
-#ifdef __STDC__
-RX_DECL unsigned long
-rx_bitset_hash (int size, rx_Bitset b)
-#else
-RX_DECL unsigned long
-rx_bitset_hash (size, b)
- int size;
- rx_Bitset b;
-#endif
-{
- int x;
- unsigned long hash = (unsigned long)rx_bitset_hash;
-
- for (x = rx_bitset_numb_subsets(size) - 1; x >= 0; --x)
- hash ^= rx_bitset_subset_val(b, x);
-
- return hash;
-}
-
-
-RX_DECL RX_subset rx_subset_singletons [RX_subset_bits] =
-{
- 0x1,
- 0x2,
- 0x4,
- 0x8,
- 0x10,
- 0x20,
- 0x40,
- 0x80,
- 0x100,
- 0x200,
- 0x400,
- 0x800,
- 0x1000,
- 0x2000,
- 0x4000,
- 0x8000,
- 0x10000,
- 0x20000,
- 0x40000,
- 0x80000,
- 0x100000,
- 0x200000,
- 0x400000,
- 0x800000,
- 0x1000000,
- 0x2000000,
- 0x4000000,
- 0x8000000,
- 0x10000000,
- 0x20000000,
- 0x40000000,
- 0x80000000
-};
-
-#ifdef RX_DEBUG
-
-#ifdef __STDC__
-static void
-print_cset (struct rx *rx, rx_Bitset cset, FILE * fp)
-#else
-static void
-print_cset (rx, cset, fp)
- struct rx *rx;
- rx_Bitset cset;
- FILE * fp;
-#endif
-{
- int x;
- fputc ('[', fp);
- for (x = 0; x < rx->local_cset_size; ++x)
- if (RX_bitset_member (cset, x))
- {
- if (isprint(x))
- fputc (x, fp);
- else
- fprintf (fp, "\\0%o ", x);
- }
- fputc (']', fp);
-}
-
-#endif /* RX_DEBUG */
-
-
-
-static unsigned long rx_hash_masks[4] =
-{
- 0x12488421,
- 0x96699669,
- 0xbe7dd7eb,
- 0xffffffff
-};
-
-
-/* Hash tables */
-#ifdef __STDC__
-RX_DECL struct rx_hash_item *
-rx_hash_find (struct rx_hash * table,
- unsigned long hash,
- void * value,
- struct rx_hash_rules * rules)
-#else
-RX_DECL struct rx_hash_item *
-rx_hash_find (table, hash, value, rules)
- struct rx_hash * table;
- unsigned long hash;
- void * value;
- struct rx_hash_rules * rules;
-#endif
-{
- rx_hash_eq eq = rules->eq;
- int maskc = 0;
- long mask = rx_hash_masks [0];
- int bucket = (hash & mask) % 13;
-
- while (table->children [bucket])
- {
- table = table->children [bucket];
- ++maskc;
- mask = rx_hash_masks[maskc];
- bucket = (hash & mask) % 13;
- }
-
- {
- struct rx_hash_item * it = table->buckets[bucket];
- while (it)
- if (eq (it->data, value))
- return it;
- else
- it = it->next_same_hash;
- }
-
- return 0;
-}
-
-
-#ifdef __STDC__
-RX_DECL struct rx_hash_item *
-rx_hash_store (struct rx_hash * table,
- unsigned long hash,
- void * value,
- struct rx_hash_rules * rules)
-#else
-RX_DECL struct rx_hash_item *
-rx_hash_store (table, hash, value, rules)
- struct rx_hash * table;
- unsigned long hash;
- void * value;
- struct rx_hash_rules * rules;
-#endif
-{
- rx_hash_eq eq = rules->eq;
- int maskc = 0;
- long mask = rx_hash_masks[0];
- int bucket = (hash & mask) % 13;
- int depth = 0;
-
- while (table->children [bucket])
- {
- table = table->children [bucket];
- ++maskc;
- mask = rx_hash_masks[maskc];
- bucket = (hash & mask) % 13;
- ++depth;
- }
-
- {
- struct rx_hash_item * it = table->buckets[bucket];
- while (it)
- if (eq (it->data, value))
- return it;
- else
- it = it->next_same_hash;
- }
-
- {
- if ( (depth < 3)
- && (table->bucket_size [bucket] >= 4))
- {
- struct rx_hash * newtab = ((struct rx_hash *)
- rules->hash_alloc (rules));
- if (!newtab)
- goto add_to_bucket;
- bzero (newtab, sizeof (*newtab));
- newtab->parent = table;
- {
- struct rx_hash_item * them = table->buckets[bucket];
- unsigned long newmask = rx_hash_masks[maskc + 1];
- while (them)
- {
- struct rx_hash_item * save = them->next_same_hash;
- int new_buck = (them->hash & newmask) % 13;
- them->next_same_hash = newtab->buckets[new_buck];
- newtab->buckets[new_buck] = them;
- them->table = newtab;
- them = save;
- ++newtab->bucket_size[new_buck];
- ++newtab->refs;
- }
- table->refs = (table->refs - table->bucket_size[bucket] + 1);
- table->bucket_size[bucket] = 0;
- table->buckets[bucket] = 0;
- table->children[bucket] = newtab;
- table = newtab;
- bucket = (hash & newmask) % 13;
- }
- }
- }
- add_to_bucket:
- {
- struct rx_hash_item * it = ((struct rx_hash_item *)
- rules->hash_item_alloc (rules, value));
- if (!it)
- return 0;
- it->hash = hash;
- it->table = table;
- /* DATA and BINDING are to be set in hash_item_alloc */
- it->next_same_hash = table->buckets [bucket];
- table->buckets[bucket] = it;
- ++table->bucket_size [bucket];
- ++table->refs;
- return it;
- }
-}
-
-
-#ifdef __STDC__
-RX_DECL void
-rx_hash_free (struct rx_hash_item * it, struct rx_hash_rules * rules)
-#else
-RX_DECL void
-rx_hash_free (it, rules)
- struct rx_hash_item * it;
- struct rx_hash_rules * rules;
-#endif
-{
- if (it)
- {
- struct rx_hash * table = it->table;
- unsigned long hash = it->hash;
- int depth = (table->parent
- ? (table->parent->parent
- ? (table->parent->parent->parent
- ? 3
- : 2)
- : 1)
- : 0);
- int bucket = (hash & rx_hash_masks [depth]) % 13;
- struct rx_hash_item ** pos = &table->buckets [bucket];
-
- while (*pos != it)
- pos = &(*pos)->next_same_hash;
- *pos = it->next_same_hash;
- rules->free_hash_item (it, rules);
- --table->bucket_size[bucket];
- --table->refs;
- while (!table->refs && depth)
- {
- struct rx_hash * save = table;
- table = table->parent;
- --depth;
- bucket = (hash & rx_hash_masks [depth]) % 13;
- --table->refs;
- table->children[bucket] = 0;
- rules->free_hash (save, rules);
- }
- }
-}
-
-#ifdef __STDC__
-RX_DECL void
-rx_free_hash_table (struct rx_hash * tab, rx_hash_freefn freefn,
- struct rx_hash_rules * rules)
-#else
-RX_DECL void
-rx_free_hash_table (tab, freefn, rules)
- struct rx_hash * tab;
- rx_hash_freefn freefn;
- struct rx_hash_rules * rules;
-#endif
-{
- int x;
-
- for (x = 0; x < 13; ++x)
- if (tab->children[x])
- {
- rx_free_hash_table (tab->children[x], freefn, rules);
- rules->free_hash (tab->children[x], rules);
- }
- else
- {
- struct rx_hash_item * them = tab->buckets[x];
- while (them)
- {
- struct rx_hash_item * that = them;
- them = that->next_same_hash;
- freefn (that);
- rules->free_hash_item (that, rules);
- }
- }
-}
-
-
-
-/* Utilities for manipulating bitset represntations of characters sets. */
-
-#ifdef __STDC__
-RX_DECL rx_Bitset
-rx_cset (struct rx *rx)
-#else
-RX_DECL rx_Bitset
-rx_cset (rx)
- struct rx *rx;
-#endif
-{
- rx_Bitset b = (rx_Bitset) malloc (rx_sizeof_bitset (rx->local_cset_size));
- if (b)
- rx_bitset_null (rx->local_cset_size, b);
- return b;
-}
-
-
-#ifdef __STDC__
-RX_DECL rx_Bitset
-rx_copy_cset (struct rx *rx, rx_Bitset a)
-#else
-RX_DECL rx_Bitset
-rx_copy_cset (rx, a)
- struct rx *rx;
- rx_Bitset a;
-#endif
-{
- rx_Bitset cs = rx_cset (rx);
-
- if (cs)
- rx_bitset_union (rx->local_cset_size, cs, a);
-
- return cs;
-}
-
-
-#ifdef __STDC__
-RX_DECL void
-rx_free_cset (struct rx * rx, rx_Bitset c)
-#else
-RX_DECL void
-rx_free_cset (rx, c)
- struct rx * rx;
- rx_Bitset c;
-#endif
-{
- if (c)
- free ((char *)c);
-}
-
-
-/* Hash table memory allocation policy for the regexp compiler */
-
-#ifdef __STDC__
-static struct rx_hash *
-compiler_hash_alloc (struct rx_hash_rules * rules)
-#else
-static struct rx_hash *
-compiler_hash_alloc (rules)
- struct rx_hash_rules * rules;
-#endif
-{
- return (struct rx_hash *)malloc (sizeof (struct rx_hash));
-}
-
-
-#ifdef __STDC__
-static struct rx_hash_item *
-compiler_hash_item_alloc (struct rx_hash_rules * rules, void * value)
-#else
-static struct rx_hash_item *
-compiler_hash_item_alloc (rules, value)
- struct rx_hash_rules * rules;
- void * value;
-#endif
-{
- struct rx_hash_item * it;
- it = (struct rx_hash_item *)malloc (sizeof (*it));
- if (it)
- {
- it->data = value;
- it->binding = 0;
- }
- return it;
-}
-
-
-#ifdef __STDC__
-static void
-compiler_free_hash (struct rx_hash * tab,
- struct rx_hash_rules * rules)
-#else
-static void
-compiler_free_hash (tab, rules)
- struct rx_hash * tab;
- struct rx_hash_rules * rules;
-#endif
-{
- free ((char *)tab);
-}
-
-
-#ifdef __STDC__
-static void
-compiler_free_hash_item (struct rx_hash_item * item,
- struct rx_hash_rules * rules)
-#else
-static void
-compiler_free_hash_item (item, rules)
- struct rx_hash_item * item;
- struct rx_hash_rules * rules;
-#endif
-{
- free ((char *)item);
-}
-
-
-/* This page: REXP_NODE (expression tree) structures. */
-
-#ifdef __STDC__
-RX_DECL struct rexp_node *
-rexp_node (struct rx *rx,
- enum rexp_node_type type)
-#else
-RX_DECL struct rexp_node *
-rexp_node (rx, type)
- struct rx *rx;
- enum rexp_node_type type;
-#endif
-{
- struct rexp_node *n;
-
- n = (struct rexp_node *)malloc (sizeof (*n));
- bzero (n, sizeof (*n));
- if (n)
- n->type = type;
- return n;
-}
-
-
-/* free_rexp_node assumes that the bitset passed to rx_mk_r_cset
- * can be freed using rx_free_cset.
- */
-#ifdef __STDC__
-RX_DECL struct rexp_node *
-rx_mk_r_cset (struct rx * rx,
- rx_Bitset b)
-#else
-RX_DECL struct rexp_node *
-rx_mk_r_cset (rx, b)
- struct rx * rx;
- rx_Bitset b;
-#endif
-{
- struct rexp_node * n = rexp_node (rx, r_cset);
- if (n)
- n->params.cset = b;
- return n;
-}
-
-
-#ifdef __STDC__
-RX_DECL struct rexp_node *
-rx_mk_r_concat (struct rx * rx,
- struct rexp_node * a,
- struct rexp_node * b)
-#else
-RX_DECL struct rexp_node *
-rx_mk_r_concat (rx, a, b)
- struct rx * rx;
- struct rexp_node * a;
- struct rexp_node * b;
-#endif
-{
- struct rexp_node * n = rexp_node (rx, r_concat);
- if (n)
- {
- n->params.pair.left = a;
- n->params.pair.right = b;
- }
- return n;
-}
-
-
-#ifdef __STDC__
-RX_DECL struct rexp_node *
-rx_mk_r_alternate (struct rx * rx,
- struct rexp_node * a,
- struct rexp_node * b)
-#else
-RX_DECL struct rexp_node *
-rx_mk_r_alternate (rx, a, b)
- struct rx * rx;
- struct rexp_node * a;
- struct rexp_node * b;
-#endif
-{
- struct rexp_node * n = rexp_node (rx, r_alternate);
- if (n)
- {
- n->params.pair.left = a;
- n->params.pair.right = b;
- }
- return n;
-}
-
-
-#ifdef __STDC__
-RX_DECL struct rexp_node *
-rx_mk_r_opt (struct rx * rx,
- struct rexp_node * a)
-#else
-RX_DECL struct rexp_node *
-rx_mk_r_opt (rx, a)
- struct rx * rx;
- struct rexp_node * a;
-#endif
-{
- struct rexp_node * n = rexp_node (rx, r_opt);
- if (n)
- {
- n->params.pair.left = a;
- n->params.pair.right = 0;
- }
- return n;
-}
-
-
-#ifdef __STDC__
-RX_DECL struct rexp_node *
-rx_mk_r_star (struct rx * rx,
- struct rexp_node * a)
-#else
-RX_DECL struct rexp_node *
-rx_mk_r_star (rx, a)
- struct rx * rx;
- struct rexp_node * a;
-#endif
-{
- struct rexp_node * n = rexp_node (rx, r_star);
- if (n)
- {
- n->params.pair.left = a;
- n->params.pair.right = 0;
- }
- return n;
-}
-
-
-#ifdef __STDC__
-RX_DECL struct rexp_node *
-rx_mk_r_2phase_star (struct rx * rx,
- struct rexp_node * a,
- struct rexp_node * b)
-#else
-RX_DECL struct rexp_node *
-rx_mk_r_2phase_star (rx, a, b)
- struct rx * rx;
- struct rexp_node * a;
- struct rexp_node * b;
-#endif
-{
- struct rexp_node * n = rexp_node (rx, r_2phase_star);
- if (n)
- {
- n->params.pair.left = a;
- n->params.pair.right = b;
- }
- return n;
-}
-
-
-#ifdef __STDC__
-RX_DECL struct rexp_node *
-rx_mk_r_side_effect (struct rx * rx,
- rx_side_effect a)
-#else
-RX_DECL struct rexp_node *
-rx_mk_r_side_effect (rx, a)
- struct rx * rx;
- rx_side_effect a;
-#endif
-{
- struct rexp_node * n = rexp_node (rx, r_side_effect);
- if (n)
- {
- n->params.side_effect = a;
- n->params.pair.right = 0;
- }
- return n;
-}
-
-
-#ifdef __STDC__
-RX_DECL struct rexp_node *
-rx_mk_r_data (struct rx * rx,
- void * a)
-#else
-RX_DECL struct rexp_node *
-rx_mk_r_data (rx, a)
- struct rx * rx;
- void * a;
-#endif
-{
- struct rexp_node * n = rexp_node (rx, r_data);
- if (n)
- {
- n->params.pair.left = a;
- n->params.pair.right = 0;
- }
- return n;
-}
-
-
-#ifdef __STDC__
-RX_DECL void
-rx_free_rexp (struct rx * rx, struct rexp_node * node)
-#else
-RX_DECL void
-rx_free_rexp (rx, node)
- struct rx * rx;
- struct rexp_node * node;
-#endif
-{
- if (node)
- {
- switch (node->type)
- {
- case r_cset:
- if (node->params.cset)
- rx_free_cset (rx, node->params.cset);
-
- case r_side_effect:
- break;
-
- case r_concat:
- case r_alternate:
- case r_2phase_star:
- case r_opt:
- case r_star:
- rx_free_rexp (rx, node->params.pair.left);
- rx_free_rexp (rx, node->params.pair.right);
- break;
-
- case r_data:
- /* This shouldn't occur. */
- break;
- }
- free ((char *)node);
- }
-}
-
-
-#ifdef __STDC__
-RX_DECL struct rexp_node *
-rx_copy_rexp (struct rx *rx,
- struct rexp_node *node)
-#else
-RX_DECL struct rexp_node *
-rx_copy_rexp (rx, node)
- struct rx *rx;
- struct rexp_node *node;
-#endif
-{
- if (!node)
- return 0;
- else
- {
- struct rexp_node *n = rexp_node (rx, node->type);
- if (!n)
- return 0;
- switch (node->type)
- {
- case r_cset:
- n->params.cset = rx_copy_cset (rx, node->params.cset);
- if (!n->params.cset)
- {
- rx_free_rexp (rx, n);
- return 0;
- }
- break;
-
- case r_side_effect:
- n->params.side_effect = node->params.side_effect;
- break;
-
- case r_concat:
- case r_alternate:
- case r_opt:
- case r_2phase_star:
- case r_star:
- n->params.pair.left =
- rx_copy_rexp (rx, node->params.pair.left);
- n->params.pair.right =
- rx_copy_rexp (rx, node->params.pair.right);
- if ( (node->params.pair.left && !n->params.pair.left)
- || (node->params.pair.right && !n->params.pair.right))
- {
- rx_free_rexp (rx, n);
- return 0;
- }
- break;
- case r_data:
- /* shouldn't happen */
- break;
- }
- return n;
- }
-}
-
-
-
-/* This page: functions to build and destroy graphs that describe nfa's */
-
-/* Constructs a new nfa node. */
-#ifdef __STDC__
-RX_DECL struct rx_nfa_state *
-rx_nfa_state (struct rx *rx)
-#else
-RX_DECL struct rx_nfa_state *
-rx_nfa_state (rx)
- struct rx *rx;
-#endif
-{
- struct rx_nfa_state * n = (struct rx_nfa_state *)malloc (sizeof (*n));
- if (!n)
- return 0;
- bzero (n, sizeof (*n));
- n->next = rx->nfa_states;
- rx->nfa_states = n;
- return n;
-}
-
-
-#ifdef __STDC__
-RX_DECL void
-rx_free_nfa_state (struct rx_nfa_state * n)
-#else
-RX_DECL void
-rx_free_nfa_state (n)
- struct rx_nfa_state * n;
-#endif
-{
- free ((char *)n);
-}
-
-
-/* This looks up an nfa node, given a numeric id. Numeric id's are
- * assigned after the nfa has been built.
- */
-#ifdef __STDC__
-RX_DECL struct rx_nfa_state *
-rx_id_to_nfa_state (struct rx * rx,
- int id)
-#else
-RX_DECL struct rx_nfa_state *
-rx_id_to_nfa_state (rx, id)
- struct rx * rx;
- int id;
-#endif
-{
- struct rx_nfa_state * n;
- for (n = rx->nfa_states; n; n = n->next)
- if (n->id == id)
- return n;
- return 0;
-}
-
-
-/* This adds an edge between two nodes, but doesn't initialize the
- * edge label.
- */
-
-#ifdef __STDC__
-RX_DECL struct rx_nfa_edge *
-rx_nfa_edge (struct rx *rx,
- enum rx_nfa_etype type,
- struct rx_nfa_state *start,
- struct rx_nfa_state *dest)
-#else
-RX_DECL struct rx_nfa_edge *
-rx_nfa_edge (rx, type, start, dest)
- struct rx *rx;
- enum rx_nfa_etype type;
- struct rx_nfa_state *start;
- struct rx_nfa_state *dest;
-#endif
-{
- struct rx_nfa_edge *e;
- e = (struct rx_nfa_edge *)malloc (sizeof (*e));
- if (!e)
- return 0;
- e->next = start->edges;
- start->edges = e;
- e->type = type;
- e->dest = dest;
- return e;
-}
-
-
-#ifdef __STDC__
-RX_DECL void
-rx_free_nfa_edge (struct rx_nfa_edge * e)
-#else
-RX_DECL void
-rx_free_nfa_edge (e)
- struct rx_nfa_edge * e;
-#endif
-{
- free ((char *)e);
-}
-
-
-/* This constructs a POSSIBLE_FUTURE, which is a kind epsilon-closure
- * of an NFA. These are added to an nfa automaticly by eclose_nfa.
- */
-
-#ifdef __STDC__
-static struct rx_possible_future *
-rx_possible_future (struct rx * rx,
- struct rx_se_list * effects)
-#else
-static struct rx_possible_future *
-rx_possible_future (rx, effects)
- struct rx * rx;
- struct rx_se_list * effects;
-#endif
-{
- struct rx_possible_future *ec;
- ec = (struct rx_possible_future *) malloc (sizeof (*ec));
- if (!ec)
- return 0;
- ec->destset = 0;
- ec->next = 0;
- ec->effects = effects;
- return ec;
-}
-
-
-#ifdef __STDC__
-static void
-rx_free_possible_future (struct rx_possible_future * pf)
-#else
-static void
-rx_free_possible_future (pf)
- struct rx_possible_future * pf;
-#endif
-{
- free ((char *)pf);
-}
-
-
-#ifdef __STDC__
-RX_DECL void
-rx_free_nfa (struct rx *rx)
-#else
-RX_DECL void
-rx_free_nfa (rx)
- struct rx *rx;
-#endif
-{
- while (rx->nfa_states)
- {
- while (rx->nfa_states->edges)
- {
- switch (rx->nfa_states->edges->type)
- {
- case ne_cset:
- rx_free_cset (rx, rx->nfa_states->edges->params.cset);
- break;
- default:
- break;
- }
- {
- struct rx_nfa_edge * e;
- e = rx->nfa_states->edges;
- rx->nfa_states->edges = rx->nfa_states->edges->next;
- rx_free_nfa_edge (e);
- }
- } /* while (rx->nfa_states->edges) */
- {
- /* Iterate over the partial epsilon closures of rx->nfa_states */
- struct rx_possible_future * pf = rx->nfa_states->futures;
- while (pf)
- {
- struct rx_possible_future * pft = pf;
- pf = pf->next;
- rx_free_possible_future (pft);
- }
- }
- {
- struct rx_nfa_state *n;
- n = rx->nfa_states;
- rx->nfa_states = rx->nfa_states->next;
- rx_free_nfa_state (n);
- }
- }
-}
-
-
-
-/* This page: translating a pattern expression into an nfa and doing the
- * static part of the nfa->super-nfa translation.
- */
-
-/* This is the thompson regexp->nfa algorithm.
- * It is modified to allow for `side-effect epsilons.' Those are
- * edges that are taken whenever a similar epsilon edge would be,
- * but which imply that some side effect occurs when the edge
- * is taken.
- *
- * Side effects are used to model parts of the pattern langauge
- * that are not regular (in the formal sense).
- */
-
-#ifdef __STDC__
-RX_DECL int
-rx_build_nfa (struct rx *rx,
- struct rexp_node *rexp,
- struct rx_nfa_state **start,
- struct rx_nfa_state **end)
-#else
-RX_DECL int
-rx_build_nfa (rx, rexp, start, end)
- struct rx *rx;
- struct rexp_node *rexp;
- struct rx_nfa_state **start;
- struct rx_nfa_state **end;
-#endif
-{
- struct rx_nfa_edge *edge;
-
- /* Start & end nodes may have been allocated by the caller. */
- *start = *start ? *start : rx_nfa_state (rx);
-
- if (!*start)
- return 0;
-
- if (!rexp)
- {
- *end = *start;
- return 1;
- }
-
- *end = *end ? *end : rx_nfa_state (rx);
-
- if (!*end)
- {
- rx_free_nfa_state (*start);
- return 0;
- }
-
- switch (rexp->type)
- {
- case r_data:
- return 0;
-
- case r_cset:
- edge = rx_nfa_edge (rx, ne_cset, *start, *end);
- if (!edge)
- return 0;
- edge->params.cset = rx_copy_cset (rx, rexp->params.cset);
- if (!edge->params.cset)
- {
- rx_free_nfa_edge (edge);
- return 0;
- }
- return 1;
-
- case r_opt:
- return (rx_build_nfa (rx, rexp->params.pair.left, start, end)
- && rx_nfa_edge (rx, ne_epsilon, *start, *end));
-
- case r_star:
- {
- struct rx_nfa_state * star_start = 0;
- struct rx_nfa_state * star_end = 0;
- return (rx_build_nfa (rx, rexp->params.pair.left,
- &star_start, &star_end)
- && star_start
- && star_end
- && rx_nfa_edge (rx, ne_epsilon, star_start, star_end)
- && rx_nfa_edge (rx, ne_epsilon, *start, star_start)
- && rx_nfa_edge (rx, ne_epsilon, star_end, *end)
-
- && rx_nfa_edge (rx, ne_epsilon, star_end, star_start));
- }
-
- case r_2phase_star:
- {
- struct rx_nfa_state * star_start = 0;
- struct rx_nfa_state * star_end = 0;
- struct rx_nfa_state * loop_exp_start = 0;
- struct rx_nfa_state * loop_exp_end = 0;
-
- return (rx_build_nfa (rx, rexp->params.pair.left,
- &star_start, &star_end)
- && rx_build_nfa (rx, rexp->params.pair.right,
- &loop_exp_start, &loop_exp_end)
- && star_start
- && star_end
- && loop_exp_end
- && loop_exp_start
- && rx_nfa_edge (rx, ne_epsilon, star_start, *end)
- && rx_nfa_edge (rx, ne_epsilon, *start, star_start)
- && rx_nfa_edge (rx, ne_epsilon, star_end, *end)
-
- && rx_nfa_edge (rx, ne_epsilon, star_end, loop_exp_start)
- && rx_nfa_edge (rx, ne_epsilon, loop_exp_end, star_start));
- }
-
-
- case r_concat:
- {
- struct rx_nfa_state *shared = 0;
- return
- (rx_build_nfa (rx, rexp->params.pair.left, start, &shared)
- && rx_build_nfa (rx, rexp->params.pair.right, &shared, end));
- }
-
- case r_alternate:
- {
- struct rx_nfa_state *ls = 0;
- struct rx_nfa_state *le = 0;
- struct rx_nfa_state *rs = 0;
- struct rx_nfa_state *re = 0;
- return (rx_build_nfa (rx, rexp->params.pair.left, &ls, &le)
- && rx_build_nfa (rx, rexp->params.pair.right, &rs, &re)
- && rx_nfa_edge (rx, ne_epsilon, *start, ls)
- && rx_nfa_edge (rx, ne_epsilon, *start, rs)
- && rx_nfa_edge (rx, ne_epsilon, le, *end)
- && rx_nfa_edge (rx, ne_epsilon, re, *end));
- }
-
- case r_side_effect:
- edge = rx_nfa_edge (rx, ne_side_effect, *start, *end);
- if (!edge)
- return 0;
- edge->params.side_effect = rexp->params.side_effect;
- return 1;
- }
-
- /* this should never happen */
- return 0;
-}
-
-
-/* RX_NAME_NFA_STATES identifies all nodes with outgoing non-epsilon
- * transitions. Only these nodes can occur in super-states.
- * All nodes are given an integer id.
- * The id is non-negative if the node has non-epsilon out-transitions, negative
- * otherwise (this is because we want the non-negative ids to be used as
- * array indexes in a few places).
- */
-
-#ifdef __STDC__
-RX_DECL void
-rx_name_nfa_states (struct rx *rx)
-#else
-RX_DECL void
-rx_name_nfa_states (rx)
- struct rx *rx;
-#endif
-{
- struct rx_nfa_state *n = rx->nfa_states;
-
- rx->nodec = 0;
- rx->epsnodec = -1;
-
- while (n)
- {
- struct rx_nfa_edge *e = n->edges;
-
- if (n->is_start)
- n->eclosure_needed = 1;
-
- while (e)
- {
- switch (e->type)
- {
- case ne_epsilon:
- case ne_side_effect:
- break;
-
- case ne_cset:
- n->id = rx->nodec++;
- {
- struct rx_nfa_edge *from_n = n->edges;
- while (from_n)
- {
- from_n->dest->eclosure_needed = 1;
- from_n = from_n->next;
- }
- }
- goto cont;
- }
- e = e->next;
- }
- n->id = rx->epsnodec--;
- cont:
- n = n->next;
- }
- rx->epsnodec = -rx->epsnodec;
-}
-
-
-/* This page: data structures for the static part of the nfa->supernfa
- * translation.
- *
- * There are side effect lists -- lists of side effects occuring
- * along an uninterrupted, acyclic path of side-effect epsilon edges.
- * Such paths are collapsed to single edges in the course of computing
- * epsilon closures. Such single edges are labled with a list of all
- * the side effects entailed in crossing them. Like lists of side
- * effects are made == by the constructors below.
- *
- * There are also nfa state sets. These are used to hold a list of all
- * states reachable from a starting state for a given type of transition
- * and side effect list. These are also hash-consed.
- */
-
-/* The next several functions compare, construct, etc. lists of side
- * effects. See ECLOSE_NFA (below) for details.
- */
-
-/* Ordering of rx_se_list
- * (-1, 0, 1 return value convention).
- */
-
-#ifdef __STDC__
-static int
-se_list_cmp (void * va, void * vb)
-#else
-static int
-se_list_cmp (va, vb)
- void * va;
- void * vb;
-#endif
-{
- struct rx_se_list * a = (struct rx_se_list *)va;
- struct rx_se_list * b = (struct rx_se_list *)vb;
-
- return ((va == vb)
- ? 0
- : (!va
- ? -1
- : (!vb
- ? 1
- : ((long)a->car < (long)b->car
- ? 1
- : ((long)a->car > (long)b->car
- ? -1
- : se_list_cmp ((void *)a->cdr, (void *)b->cdr))))));
-}
-
-
-#ifdef __STDC__
-static int
-se_list_equal (void * va, void * vb)
-#else
-static int
-se_list_equal (va, vb)
- void * va;
- void * vb;
-#endif
-{
- return !(se_list_cmp (va, vb));
-}
-
-static struct rx_hash_rules se_list_hash_rules =
-{
- se_list_equal,
- compiler_hash_alloc,
- compiler_free_hash,
- compiler_hash_item_alloc,
- compiler_free_hash_item
-};
-
-
-#ifdef __STDC__
-static struct rx_se_list *
-side_effect_cons (struct rx * rx,
- void * se, struct rx_se_list * list)
-#else
-static struct rx_se_list *
-side_effect_cons (rx, se, list)
- struct rx * rx;
- void * se;
- struct rx_se_list * list;
-#endif
-{
- struct rx_se_list * l;
- l = ((struct rx_se_list *) malloc (sizeof (*l)));
- if (!l)
- return 0;
- l->car = se;
- l->cdr = list;
- return l;
-}
-
-
-#ifdef __STDC__
-static struct rx_se_list *
-hash_cons_se_prog (struct rx * rx,
- struct rx_hash * memo,
- void * car, struct rx_se_list * cdr)
-#else
-static struct rx_se_list *
-hash_cons_se_prog (rx, memo, car, cdr)
- struct rx * rx;
- struct rx_hash * memo;
- void * car;
- struct rx_se_list * cdr;
-#endif
-{
- long hash = (long)car ^ (long)cdr;
- struct rx_se_list template;
-
- template.car = car;
- template.cdr = cdr;
- {
- struct rx_hash_item * it = rx_hash_store (memo, hash,
- (void *)&template,
- &se_list_hash_rules);
- if (!it)
- return 0;
- if (it->data == (void *)&template)
- {
- struct rx_se_list * consed;
- consed = (struct rx_se_list *) malloc (sizeof (*consed));
- *consed = template;
- it->data = (void *)consed;
- }
- return (struct rx_se_list *)it->data;
- }
-}
-
-
-#ifdef __STDC__
-static struct rx_se_list *
-hash_se_prog (struct rx * rx, struct rx_hash * memo, struct rx_se_list * prog)
-#else
-static struct rx_se_list *
-hash_se_prog (rx, memo, prog)
- struct rx * rx;
- struct rx_hash * memo;
- struct rx_se_list * prog;
-#endif
-{
- struct rx_se_list * answer = 0;
- while (prog)
- {
- answer = hash_cons_se_prog (rx, memo, prog->car, answer);
- if (!answer)
- return 0;
- prog = prog->cdr;
- }
- return answer;
-}
-
-#ifdef __STDC__
-static int
-nfa_set_cmp (void * va, void * vb)
-#else
-static int
-nfa_set_cmp (va, vb)
- void * va;
- void * vb;
-#endif
-{
- struct rx_nfa_state_set * a = (struct rx_nfa_state_set *)va;
- struct rx_nfa_state_set * b = (struct rx_nfa_state_set *)vb;
-
- return ((va == vb)
- ? 0
- : (!va
- ? -1
- : (!vb
- ? 1
- : (a->car->id < b->car->id
- ? 1
- : (a->car->id > b->car->id
- ? -1
- : nfa_set_cmp ((void *)a->cdr, (void *)b->cdr))))));
-}
-
-#ifdef __STDC__
-static int
-nfa_set_equal (void * va, void * vb)
-#else
-static int
-nfa_set_equal (va, vb)
- void * va;
- void * vb;
-#endif
-{
- return !nfa_set_cmp (va, vb);
-}
-
-static struct rx_hash_rules nfa_set_hash_rules =
-{
- nfa_set_equal,
- compiler_hash_alloc,
- compiler_free_hash,
- compiler_hash_item_alloc,
- compiler_free_hash_item
-};
-
-
-#ifdef __STDC__
-static struct rx_nfa_state_set *
-nfa_set_cons (struct rx * rx,
- struct rx_hash * memo, struct rx_nfa_state * state,
- struct rx_nfa_state_set * set)
-#else
-static struct rx_nfa_state_set *
-nfa_set_cons (rx, memo, state, set)
- struct rx * rx;
- struct rx_hash * memo;
- struct rx_nfa_state * state;
- struct rx_nfa_state_set * set;
-#endif
-{
- struct rx_nfa_state_set template;
- struct rx_hash_item * node;
- template.car = state;
- template.cdr = set;
- node = rx_hash_store (memo,
- (((long)state) >> 8) ^ (long)set,
- &template, &nfa_set_hash_rules);
- if (!node)
- return 0;
- if (node->data == &template)
- {
- struct rx_nfa_state_set * l;
- l = (struct rx_nfa_state_set *) malloc (sizeof (*l));
- node->data = (void *) l;
- if (!l)
- return 0;
- *l = template;
- }
- return (struct rx_nfa_state_set *)node->data;
-}
-
-
-#ifdef __STDC__
-static struct rx_nfa_state_set *
-nfa_set_enjoin (struct rx * rx,
- struct rx_hash * memo, struct rx_nfa_state * state,
- struct rx_nfa_state_set * set)
-#else
-static struct rx_nfa_state_set *
-nfa_set_enjoin (rx, memo, state, set)
- struct rx * rx;
- struct rx_hash * memo;
- struct rx_nfa_state * state;
- struct rx_nfa_state_set * set;
-#endif
-{
- if (!set || state->id < set->car->id)
- return nfa_set_cons (rx, memo, state, set);
- if (state->id == set->car->id)
- return set;
- else
- {
- struct rx_nfa_state_set * newcdr
- = nfa_set_enjoin (rx, memo, state, set->cdr);
- if (newcdr != set->cdr)
- set = nfa_set_cons (rx, memo, set->car, newcdr);
- return set;
- }
-}
-
-
-
-/* This page: computing epsilon closures. The closures aren't total.
- * Each node's closures are partitioned according to the side effects entailed
- * along the epsilon edges. Return true on success.
- */
-
-struct eclose_frame
-{
- struct rx_se_list *prog_backwards;
-};
-
-
-#ifdef __STDC__
-static int
-eclose_node (struct rx *rx, struct rx_nfa_state *outnode,
- struct rx_nfa_state *node, struct eclose_frame *frame)
-#else
-static int
-eclose_node (rx, outnode, node, frame)
- struct rx *rx;
- struct rx_nfa_state *outnode;
- struct rx_nfa_state *node;
- struct eclose_frame *frame;
-#endif
-{
- struct rx_nfa_edge *e = node->edges;
-
- /* For each node, we follow all epsilon paths to build the closure.
- * The closure omits nodes that have only epsilon edges.
- * The closure is split into partial closures -- all the states in
- * a partial closure are reached by crossing the same list of
- * of side effects (though not necessarily the same path).
- */
- if (node->mark)
- return 1;
- node->mark = 1;
-
- if (node->id >= 0 || node->is_final)
- {
- struct rx_possible_future **ec;
- struct rx_se_list * prog_in_order
- = ((struct rx_se_list *)hash_se_prog (rx,
- &rx->se_list_memo,
- frame->prog_backwards));
- int cmp;
-
- ec = &outnode->futures;
-
- while (*ec)
- {
- cmp = se_list_cmp ((void *)(*ec)->effects, (void *)prog_in_order);
- if (cmp <= 0)
- break;
- ec = &(*ec)->next;
- }
- if (!*ec || (cmp < 0))
- {
- struct rx_possible_future * saved = *ec;
- *ec = rx_possible_future (rx, prog_in_order);
- (*ec)->next = saved;
- if (!*ec)
- return 0;
- }
- if (node->id >= 0)
- {
- (*ec)->destset = nfa_set_enjoin (rx, &rx->set_list_memo,
- node, (*ec)->destset);
- if (!(*ec)->destset)
- return 0;
- }
- }
-
- while (e)
- {
- switch (e->type)
- {
- case ne_epsilon:
- if (!eclose_node (rx, outnode, e->dest, frame))
- return 0;
- break;
- case ne_side_effect:
- {
- frame->prog_backwards = side_effect_cons (rx,
- e->params.side_effect,
- frame->prog_backwards);
- if (!frame->prog_backwards)
- return 0;
- if (!eclose_node (rx, outnode, e->dest, frame))
- return 0;
- {
- struct rx_se_list * dying = frame->prog_backwards;
- frame->prog_backwards = frame->prog_backwards->cdr;
- free ((char *)dying);
- }
- break;
- }
- default:
- break;
- }
- e = e->next;
- }
- node->mark = 0;
- return 1;
-}
-
-
-#ifdef __STDC__
-RX_DECL int
-rx_eclose_nfa (struct rx *rx)
-#else
-RX_DECL int
-rx_eclose_nfa (rx)
- struct rx *rx;
-#endif
-{
- struct rx_nfa_state *n = rx->nfa_states;
- struct eclose_frame frame;
- static int rx_id = 0;
-
- frame.prog_backwards = 0;
- rx->rx_id = rx_id++;
- bzero (&rx->se_list_memo, sizeof (rx->se_list_memo));
- bzero (&rx->set_list_memo, sizeof (rx->set_list_memo));
- while (n)
- {
- n->futures = 0;
- if (n->eclosure_needed && !eclose_node (rx, n, n, &frame))
- return 0;
- /* clear_marks (rx); */
- n = n->next;
- }
- return 1;
-}
-
-
-/* This deletes epsilon edges from an NFA. After running eclose_node,
- * we have no more need for these edges. They are removed to simplify
- * further operations on the NFA.
- */
-
-#ifdef __STDC__
-RX_DECL void
-rx_delete_epsilon_transitions (struct rx *rx)
-#else
-RX_DECL void
-rx_delete_epsilon_transitions (rx)
- struct rx *rx;
-#endif
-{
- struct rx_nfa_state *n = rx->nfa_states;
- struct rx_nfa_edge **e;
-
- while (n)
- {
- e = &n->edges;
- while (*e)
- {
- struct rx_nfa_edge *t;
- switch ((*e)->type)
- {
- case ne_epsilon:
- case ne_side_effect:
- t = *e;
- *e = t->next;
- rx_free_nfa_edge (t);
- break;
-
- default:
- e = &(*e)->next;
- break;
- }
- }
- n = n->next;
- }
-}
-
-
-/* This page: storing the nfa in a contiguous region of memory for
- * subsequent conversion to a super-nfa.
- */
-
-/* This is for qsort on an array of nfa_states. The order
- * is based on state ids and goes
- * [0...MAX][MIN..-1] where (MAX>=0) and (MIN<0)
- * This way, positive ids double as array indices.
- */
-
-#ifdef __STDC__
-static int
-nfacmp (void * va, void * vb)
-#else
-static int
-nfacmp (va, vb)
- void * va;
- void * vb;
-#endif
-{
- struct rx_nfa_state **a = (struct rx_nfa_state **)va;
- struct rx_nfa_state **b = (struct rx_nfa_state **)vb;
- return (*a == *b /* &&&& 3.18 */
- ? 0
- : (((*a)->id < 0) == ((*b)->id < 0)
- ? (((*a)->id < (*b)->id) ? -1 : 1)
- : (((*a)->id < 0)
- ? 1 : -1)));
-}
-
-#ifdef __STDC__
-static int
-count_hash_nodes (struct rx_hash * st)
-#else
-static int
-count_hash_nodes (st)
- struct rx_hash * st;
-#endif
-{
- int x;
- int count = 0;
- for (x = 0; x < 13; ++x)
- count += ((st->children[x])
- ? count_hash_nodes (st->children[x])
- : st->bucket_size[x]);
-
- return count;
-}
-
-
-#ifdef __STDC__
-static void
-se_memo_freer (struct rx_hash_item * node)
-#else
-static void
-se_memo_freer (node)
- struct rx_hash_item * node;
-#endif
-{
- free ((char *)node->data);
-}
-
-
-#ifdef __STDC__
-static void
-nfa_set_freer (struct rx_hash_item * node)
-#else
-static void
-nfa_set_freer (node)
- struct rx_hash_item * node;
-#endif
-{
- free ((char *)node->data);
-}
-
-
-/* This copies an entire NFA into a single malloced block of memory.
- * Mostly this is for compatability with regex.c, though it is convenient
- * to have the nfa nodes in an array.
- */
-
-#ifdef __STDC__
-RX_DECL int
-rx_compactify_nfa (struct rx *rx,
- void **mem, unsigned long *size)
-#else
-RX_DECL int
-rx_compactify_nfa (rx, mem, size)
- struct rx *rx;
- void **mem;
- unsigned long *size;
-#endif
-{
- int total_nodec;
- struct rx_nfa_state *n;
- int edgec = 0;
- int eclosec = 0;
- int se_list_consc = count_hash_nodes (&rx->se_list_memo);
- int nfa_setc = count_hash_nodes (&rx->set_list_memo);
- unsigned long total_size;
-
- /* This takes place in two stages. First, the total size of the
- * nfa is computed, then structures are copied.
- */
- n = rx->nfa_states;
- total_nodec = 0;
- while (n)
- {
- struct rx_nfa_edge *e = n->edges;
- struct rx_possible_future *ec = n->futures;
- ++total_nodec;
- while (e)
- {
- ++edgec;
- e = e->next;
- }
- while (ec)
- {
- ++eclosec;
- ec = ec->next;
- }
- n = n->next;
- }
-
- total_size = (total_nodec * sizeof (struct rx_nfa_state)
- + edgec * rx_sizeof_bitset (rx->local_cset_size)
- + edgec * sizeof (struct rx_nfa_edge)
- + nfa_setc * sizeof (struct rx_nfa_state_set)
- + eclosec * sizeof (struct rx_possible_future)
- + se_list_consc * sizeof (struct rx_se_list)
- + rx->reserved);
-
- if (total_size > *size)
- {
- *mem = remalloc (*mem, total_size);
- if (*mem)
- *size = total_size;
- else
- return 0;
- }
- /* Now we've allocated the memory; this copies the NFA. */
- {
- static struct rx_nfa_state **scratch = 0;
- static int scratch_alloc = 0;
- struct rx_nfa_state *state_base = (struct rx_nfa_state *) * mem;
- struct rx_nfa_state *new_state = state_base;
- struct rx_nfa_edge *new_edge =
- (struct rx_nfa_edge *)
- ((char *) state_base + total_nodec * sizeof (struct rx_nfa_state));
- struct rx_se_list * new_se_list =
- (struct rx_se_list *)
- ((char *)new_edge + edgec * sizeof (struct rx_nfa_edge));
- struct rx_possible_future *new_close =
- ((struct rx_possible_future *)
- ((char *) new_se_list
- + se_list_consc * sizeof (struct rx_se_list)));
- struct rx_nfa_state_set * new_nfa_set =
- ((struct rx_nfa_state_set *)
- ((char *)new_close + eclosec * sizeof (struct rx_possible_future)));
- char *new_bitset =
- ((char *) new_nfa_set + nfa_setc * sizeof (struct rx_nfa_state_set));
- int x;
- struct rx_nfa_state *n;
-
- if (scratch_alloc < total_nodec)
- {
- scratch = ((struct rx_nfa_state **)
- remalloc (scratch, total_nodec * sizeof (*scratch)));
- if (scratch)
- scratch_alloc = total_nodec;
- else
- {
- scratch_alloc = 0;
- return 0;
- }
- }
-
- for (x = 0, n = rx->nfa_states; n; n = n->next)
- scratch[x++] = n;
-
- qsort (scratch, total_nodec,
- sizeof (struct rx_nfa_state *), (int (*)())nfacmp);
-
- for (x = 0; x < total_nodec; ++x)
- {
- struct rx_possible_future *eclose = scratch[x]->futures;
- struct rx_nfa_edge *edge = scratch[x]->edges;
- struct rx_nfa_state *cn = new_state++;
- cn->futures = 0;
- cn->edges = 0;
- cn->next = (x == total_nodec - 1) ? 0 : (cn + 1);
- cn->id = scratch[x]->id;
- cn->is_final = scratch[x]->is_final;
- cn->is_start = scratch[x]->is_start;
- cn->mark = 0;
- while (edge)
- {
- int indx = (edge->dest->id < 0
- ? (total_nodec + edge->dest->id)
- : edge->dest->id);
- struct rx_nfa_edge *e = new_edge++;
- rx_Bitset cset = (rx_Bitset) new_bitset;
- new_bitset += rx_sizeof_bitset (rx->local_cset_size);
- rx_bitset_null (rx->local_cset_size, cset);
- rx_bitset_union (rx->local_cset_size, cset, edge->params.cset);
- e->next = cn->edges;
- cn->edges = e;
- e->type = edge->type;
- e->dest = state_base + indx;
- e->params.cset = cset;
- edge = edge->next;
- }
- while (eclose)
- {
- struct rx_possible_future *ec = new_close++;
- struct rx_hash_item * sp;
- struct rx_se_list ** sepos;
- struct rx_se_list * sesrc;
- struct rx_nfa_state_set * destlst;
- struct rx_nfa_state_set ** destpos;
- ec->next = cn->futures;
- cn->futures = ec;
- for (sepos = &ec->effects, sesrc = eclose->effects;
- sesrc;
- sesrc = sesrc->cdr, sepos = &(*sepos)->cdr)
- {
- sp = rx_hash_find (&rx->se_list_memo,
- (long)sesrc->car ^ (long)sesrc->cdr,
- sesrc, &se_list_hash_rules);
- if (sp->binding)
- {
- sesrc = (struct rx_se_list *)sp->binding;
- break;
- }
- *new_se_list = *sesrc;
- sp->binding = (void *)new_se_list;
- *sepos = new_se_list;
- ++new_se_list;
- }
- *sepos = sesrc;
- for (destpos = &ec->destset, destlst = eclose->destset;
- destlst;
- destpos = &(*destpos)->cdr, destlst = destlst->cdr)
- {
- sp = rx_hash_find (&rx->set_list_memo,
- ((((long)destlst->car) >> 8)
- ^ (long)destlst->cdr),
- destlst, &nfa_set_hash_rules);
- if (sp->binding)
- {
- destlst = (struct rx_nfa_state_set *)sp->binding;
- break;
- }
- *new_nfa_set = *destlst;
- new_nfa_set->car = state_base + destlst->car->id;
- sp->binding = (void *)new_nfa_set;
- *destpos = new_nfa_set;
- ++new_nfa_set;
- }
- *destpos = destlst;
- eclose = eclose->next;
- }
- }
- }
- rx_free_hash_table (&rx->se_list_memo, se_memo_freer, &se_list_hash_rules);
- bzero (&rx->se_list_memo, sizeof (rx->se_list_memo));
- rx_free_hash_table (&rx->set_list_memo, nfa_set_freer, &nfa_set_hash_rules);
- bzero (&rx->set_list_memo, sizeof (rx->set_list_memo));
-
- rx_free_nfa (rx);
- rx->nfa_states = (struct rx_nfa_state *)*mem;
- return 1;
-}
-
-
-/* The functions in the next several pages define the lazy-NFA-conversion used
- * by matchers. The input to this construction is an NFA such as
- * is built by compactify_nfa (rx.c). The output is the superNFA.
- */
-
-/* Match engines can use arbitrary values for opcodes. So, the parse tree
- * is built using instructions names (enum rx_opcode), but the superstate
- * nfa is populated with mystery opcodes (void *).
- *
- * For convenience, here is an id table. The opcodes are == to their inxs
- *
- * The lables in re_search_2 would make good values for instructions.
- */
-
-void * rx_id_instruction_table[rx_num_instructions] =
-{
- (void *) rx_backtrack_point,
- (void *) rx_do_side_effects,
- (void *) rx_cache_miss,
- (void *) rx_next_char,
- (void *) rx_backtrack,
- (void *) rx_error_inx
-};
-
-
-
-/* Memory mgt. for superstate graphs. */
-
-#ifdef __STDC__
-static char *
-rx_cache_malloc (struct rx_cache * cache, int bytes)
-#else
-static char *
-rx_cache_malloc (cache, bytes)
- struct rx_cache * cache;
- int bytes;
-#endif
-{
- while (cache->bytes_left < bytes)
- {
- if (cache->memory_pos)
- cache->memory_pos = cache->memory_pos->next;
- if (!cache->memory_pos)
- {
- cache->morecore (cache);
- if (!cache->memory_pos)
- return 0;
- }
- cache->bytes_left = cache->memory_pos->bytes;
- cache->memory_addr = ((char *)cache->memory_pos
- + sizeof (struct rx_blocklist));
- }
- cache->bytes_left -= bytes;
- {
- char * addr = cache->memory_addr;
- cache->memory_addr += bytes;
- return addr;
- }
-}
-
-#ifdef __STDC__
-static void
-rx_cache_free (struct rx_cache * cache,
- struct rx_freelist ** freelist, char * mem)
-#else
-static void
-rx_cache_free (cache, freelist, mem)
- struct rx_cache * cache;
- struct rx_freelist ** freelist;
- char * mem;
-#endif
-{
- struct rx_freelist * it = (struct rx_freelist *)mem;
- it->next = *freelist;
- *freelist = it;
-}
-
-
-/* The partially instantiated superstate graph has a transition
- * table at every node. There is one entry for every character.
- * This fills in the transition for a set.
- */
-#ifdef __STDC__
-static void
-install_transition (struct rx_superstate *super,
- struct rx_inx *answer, rx_Bitset trcset)
-#else
-static void
-install_transition (super, answer, trcset)
- struct rx_superstate *super;
- struct rx_inx *answer;
- rx_Bitset trcset;
-#endif
-{
- struct rx_inx * transitions = super->transitions;
- int chr;
- for (chr = 0; chr < 256; )
- if (!*trcset)
- {
- ++trcset;
- chr += 32;
- }
- else
- {
- RX_subset sub = *trcset;
- RX_subset mask = 1;
- int bound = chr + 32;
- while (chr < bound)
- {
- if (sub & mask)
- transitions [chr] = *answer;
- ++chr;
- mask <<= 1;
- }
- ++trcset;
- }
-}
-
-
-#ifdef __STDC__
-static int
-qlen (struct rx_superstate * q)
-#else
-static int
-qlen (q)
- struct rx_superstate * q;
-#endif
-{
- int count = 1;
- struct rx_superstate * it;
- if (!q)
- return 0;
- for (it = q->next_recyclable; it != q; it = it->next_recyclable)
- ++count;
- return count;
-}
-
-#ifdef __STDC__
-static void
-check_cache (struct rx_cache * cache)
-#else
-static void
-check_cache (cache)
- struct rx_cache * cache;
-#endif
-{
- struct rx_cache * you_fucked_up = 0;
- int total = cache->superstates;
- int semi = cache->semifree_superstates;
- if (semi != qlen (cache->semifree_superstate))
- check_cache (you_fucked_up);
- if ((total - semi) != qlen (cache->lru_superstate))
- check_cache (you_fucked_up);
-}
-
-/* When a superstate is old and neglected, it can enter a
- * semi-free state. A semi-free state is slated to die.
- * Incoming transitions to a semi-free state are re-written
- * to cause an (interpreted) fault when they are taken.
- * The fault handler revives the semi-free state, patches
- * incoming transitions back to normal, and continues.
- *
- * The idea is basicly to free in two stages, aborting
- * between the two if the state turns out to be useful again.
- * When a free is aborted, the rescued superstate is placed
- * in the most-favored slot to maximize the time until it
- * is next semi-freed.
- */
-
-#ifdef __STDC__
-static void
-semifree_superstate (struct rx_cache * cache)
-#else
-static void
-semifree_superstate (cache)
- struct rx_cache * cache;
-#endif
-{
- int disqualified = cache->semifree_superstates;
- if (disqualified == cache->superstates)
- return;
- while (cache->lru_superstate->locks)
- {
- cache->lru_superstate = cache->lru_superstate->next_recyclable;
- ++disqualified;
- if (disqualified == cache->superstates)
- return;
- }
- {
- struct rx_superstate * it = cache->lru_superstate;
- it->next_recyclable->prev_recyclable = it->prev_recyclable;
- it->prev_recyclable->next_recyclable = it->next_recyclable;
- cache->lru_superstate = (it == it->next_recyclable
- ? 0
- : it->next_recyclable);
- if (!cache->semifree_superstate)
- {
- cache->semifree_superstate = it;
- it->next_recyclable = it;
- it->prev_recyclable = it;
- }
- else
- {
- it->prev_recyclable = cache->semifree_superstate->prev_recyclable;
- it->next_recyclable = cache->semifree_superstate;
- it->prev_recyclable->next_recyclable = it;
- it->next_recyclable->prev_recyclable = it;
- }
- {
- struct rx_distinct_future *df;
- it->is_semifree = 1;
- ++cache->semifree_superstates;
- df = it->transition_refs;
- if (df)
- {
- df->prev_same_dest->next_same_dest = 0;
- for (df = it->transition_refs; df; df = df->next_same_dest)
- {
- df->future_frame.inx = cache->instruction_table[rx_cache_miss];
- df->future_frame.data = 0;
- df->future_frame.data_2 = (void *) df;
- /* If there are any NEXT-CHAR instruction frames that
- * refer to this state, we convert them to CACHE-MISS frames.
- */
- if (!df->effects
- && (df->edge->options->next_same_super_edge[0]
- == df->edge->options))
- install_transition (df->present, &df->future_frame,
- df->edge->cset);
- }
- df = it->transition_refs;
- df->prev_same_dest->next_same_dest = df;
- }
- }
- }
-}
-
-
-#ifdef __STDC__
-static void
-refresh_semifree_superstate (struct rx_cache * cache,
- struct rx_superstate * super)
-#else
-static void
-refresh_semifree_superstate (cache, super)
- struct rx_cache * cache;
- struct rx_superstate * super;
-#endif
-{
- struct rx_distinct_future *df;
-
- if (super->transition_refs)
- {
- super->transition_refs->prev_same_dest->next_same_dest = 0;
- for (df = super->transition_refs; df; df = df->next_same_dest)
- {
- df->future_frame.inx = cache->instruction_table[rx_next_char];
- df->future_frame.data = (void *) super->transitions;
- /* CACHE-MISS instruction frames that refer to this state,
- * must be converted to NEXT-CHAR frames.
- */
- if (!df->effects
- && (df->edge->options->next_same_super_edge[0]
- == df->edge->options))
- install_transition (df->present, &df->future_frame,
- df->edge->cset);
- }
- super->transition_refs->prev_same_dest->next_same_dest
- = super->transition_refs;
- }
- if (cache->semifree_superstate == super)
- cache->semifree_superstate = (super->prev_recyclable == super
- ? 0
- : super->prev_recyclable);
- super->next_recyclable->prev_recyclable = super->prev_recyclable;
- super->prev_recyclable->next_recyclable = super->next_recyclable;
-
- if (!cache->lru_superstate)
- (cache->lru_superstate
- = super->next_recyclable
- = super->prev_recyclable
- = super);
- else
- {
- super->next_recyclable = cache->lru_superstate;
- super->prev_recyclable = cache->lru_superstate->prev_recyclable;
- super->next_recyclable->prev_recyclable = super;
- super->prev_recyclable->next_recyclable = super;
- }
- super->is_semifree = 0;
- --cache->semifree_superstates;
-}
-
-#ifdef __STDC__
-static void
-rx_refresh_this_superstate (struct rx_cache * cache, struct rx_superstate * superstate)
-#else
-static void
-rx_refresh_this_superstate (cache, superstate)
- struct rx_cache * cache;
- struct rx_superstate * superstate;
-#endif
-{
- if (superstate->is_semifree)
- refresh_semifree_superstate (cache, superstate);
- else if (cache->lru_superstate == superstate)
- cache->lru_superstate = superstate->next_recyclable;
- else if (superstate != cache->lru_superstate->prev_recyclable)
- {
- superstate->next_recyclable->prev_recyclable
- = superstate->prev_recyclable;
- superstate->prev_recyclable->next_recyclable
- = superstate->next_recyclable;
- superstate->next_recyclable = cache->lru_superstate;
- superstate->prev_recyclable = cache->lru_superstate->prev_recyclable;
- superstate->next_recyclable->prev_recyclable = superstate;
- superstate->prev_recyclable->next_recyclable = superstate;
- }
-}
-
-#ifdef __STDC__
-static void
-release_superset_low (struct rx_cache * cache,
- struct rx_superset *set)
-#else
-static void
-release_superset_low (cache, set)
- struct rx_cache * cache;
- struct rx_superset *set;
-#endif
-{
- if (!--set->refs)
- {
- if (set->cdr)
- release_superset_low (cache, set->cdr);
-
- set->starts_for = 0;
-
- rx_hash_free
- (rx_hash_find
- (&cache->superset_table,
- (unsigned long)set->car ^ set->id ^ (unsigned long)set->cdr,
- (void *)set,
- &cache->superset_hash_rules),
- &cache->superset_hash_rules);
- rx_cache_free (cache, &cache->free_supersets, (char *)set);
- }
-}
-
-#ifdef __STDC__
-RX_DECL void
-rx_release_superset (struct rx *rx,
- struct rx_superset *set)
-#else
-RX_DECL void
-rx_release_superset (rx, set)
- struct rx *rx;
- struct rx_superset *set;
-#endif
-{
- release_superset_low (rx->cache, set);
-}
-
-/* This tries to add a new superstate to the superstate freelist.
- * It might, as a result, free some edge pieces or hash tables.
- * If nothing can be freed because too many locks are being held, fail.
- */
-
-#ifdef __STDC__
-static int
-rx_really_free_superstate (struct rx_cache * cache)
-#else
-static int
-rx_really_free_superstate (cache)
- struct rx_cache * cache;
-#endif
-{
- int locked_superstates = 0;
- struct rx_superstate * it;
-
- if (!cache->superstates)
- return 0;
-
- {
- /* This is a total guess. The idea is that we should expect as
- * many misses as we've recently experienced. I.e., cache->misses
- * should be the same as cache->semifree_superstates.
- */
- while ((cache->hits + cache->misses) > cache->superstates_allowed)
- {
- cache->hits >>= 1;
- cache->misses >>= 1;
- }
- if ( ((cache->hits + cache->misses) * cache->semifree_superstates)
- < (cache->superstates * cache->misses))
- {
- semifree_superstate (cache);
- semifree_superstate (cache);
- }
- }
-
- while (cache->semifree_superstate && cache->semifree_superstate->locks)
- {
- refresh_semifree_superstate (cache, cache->semifree_superstate);
- ++locked_superstates;
- if (locked_superstates == cache->superstates)
- return 0;
- }
-
- if (cache->semifree_superstate)
- {
- it = cache->semifree_superstate;
- it->next_recyclable->prev_recyclable = it->prev_recyclable;
- it->prev_recyclable->next_recyclable = it->next_recyclable;
- cache->semifree_superstate = ((it == it->next_recyclable)
- ? 0
- : it->next_recyclable);
- --cache->semifree_superstates;
- }
- else
- {
- while (cache->lru_superstate->locks)
- {
- cache->lru_superstate = cache->lru_superstate->next_recyclable;
- ++locked_superstates;
- if (locked_superstates == cache->superstates)
- return 0;
- }
- it = cache->lru_superstate;
- it->next_recyclable->prev_recyclable = it->prev_recyclable;
- it->prev_recyclable->next_recyclable = it->next_recyclable;
- cache->lru_superstate = ((it == it->next_recyclable)
- ? 0
- : it->next_recyclable);
- }
-
- if (it->transition_refs)
- {
- struct rx_distinct_future *df;
- for (df = it->transition_refs,
- df->prev_same_dest->next_same_dest = 0;
- df;
- df = df->next_same_dest)
- {
- df->future_frame.inx = cache->instruction_table[rx_cache_miss];
- df->future_frame.data = 0;
- df->future_frame.data_2 = (void *) df;
- df->future = 0;
- }
- it->transition_refs->prev_same_dest->next_same_dest =
- it->transition_refs;
- }
- {
- struct rx_super_edge *tc = it->edges;
- while (tc)
- {
- struct rx_distinct_future * df;
- struct rx_super_edge *tct = tc->next;
- df = tc->options;
- df->next_same_super_edge[1]->next_same_super_edge[0] = 0;
- while (df)
- {
- struct rx_distinct_future *dft = df;
- df = df->next_same_super_edge[0];
-
-
- if (dft->future && dft->future->transition_refs == dft)
- {
- dft->future->transition_refs = dft->next_same_dest;
- if (dft->future->transition_refs == dft)
- dft->future->transition_refs = 0;
- }
- dft->next_same_dest->prev_same_dest = dft->prev_same_dest;
- dft->prev_same_dest->next_same_dest = dft->next_same_dest;
- rx_cache_free (cache, &cache->free_discernable_futures,
- (char *)dft);
- }
- rx_cache_free (cache, &cache->free_transition_classes, (char *)tc);
- tc = tct;
- }
- }
-
- if (it->contents->superstate == it)
- it->contents->superstate = 0;
- release_superset_low (cache, it->contents);
- rx_cache_free (cache, &cache->free_superstates, (char *)it);
- --cache->superstates;
- return 1;
-}
-
-#ifdef __STDC__
-static char *
-rx_cache_get (struct rx_cache * cache,
- struct rx_freelist ** freelist)
-#else
-static char *
-rx_cache_get (cache, freelist)
- struct rx_cache * cache;
- struct rx_freelist ** freelist;
-#endif
-{
- while (!*freelist && rx_really_free_superstate (cache))
- ;
- if (!*freelist)
- return 0;
- {
- struct rx_freelist * it = *freelist;
- *freelist = it->next;
- return (char *)it;
- }
-}
-
-#ifdef __STDC__
-static char *
-rx_cache_malloc_or_get (struct rx_cache * cache,
- struct rx_freelist ** freelist, int bytes)
-#else
-static char *
-rx_cache_malloc_or_get (cache, freelist, bytes)
- struct rx_cache * cache;
- struct rx_freelist ** freelist;
- int bytes;
-#endif
-{
- if (!*freelist)
- {
- char * answer = rx_cache_malloc (cache, bytes);
- if (answer)
- return answer;
- }
-
- return rx_cache_get (cache, freelist);
-}
-
-#ifdef __STDC__
-static char *
-rx_cache_get_superstate (struct rx_cache * cache)
-#else
-static char *
-rx_cache_get_superstate (cache)
- struct rx_cache * cache;
-#endif
-{
- char * answer;
- int bytes = ( sizeof (struct rx_superstate)
- + cache->local_cset_size * sizeof (struct rx_inx));
- if (!cache->free_superstates
- && (cache->superstates < cache->superstates_allowed))
- {
- answer = rx_cache_malloc (cache, bytes);
- if (answer)
- {
- ++cache->superstates;
- return answer;
- }
- }
- answer = rx_cache_get (cache, &cache->free_superstates);
- if (!answer)
- {
- answer = rx_cache_malloc (cache, bytes);
- if (answer)
- ++cache->superstates_allowed;
- }
- ++cache->superstates;
- return answer;
-}
-
-
-
-#ifdef __STDC__
-static int
-supersetcmp (void * va, void * vb)
-#else
-static int
-supersetcmp (va, vb)
- void * va;
- void * vb;
-#endif
-{
- struct rx_superset * a = (struct rx_superset *)va;
- struct rx_superset * b = (struct rx_superset *)vb;
- return ( (a == b)
- || (a && b && (a->car == b->car) && (a->cdr == b->cdr)));
-}
-
-#ifdef __STDC__
-static struct rx_hash_item *
-superset_allocator (struct rx_hash_rules * rules, void * val)
-#else
-static struct rx_hash_item *
-superset_allocator (rules, val)
- struct rx_hash_rules * rules;
- void * val;
-#endif
-{
- struct rx_cache * cache
- = ((struct rx_cache *)
- ((char *)rules
- - (unsigned long)(&((struct rx_cache *)0)->superset_hash_rules)));
- struct rx_superset * template = (struct rx_superset *)val;
- struct rx_superset * newset
- = ((struct rx_superset *)
- rx_cache_malloc_or_get (cache,
- &cache->free_supersets,
- sizeof (*template)));
- if (!newset)
- return 0;
- newset->refs = 0;
- newset->car = template->car;
- newset->id = template->car->id;
- newset->cdr = template->cdr;
- newset->superstate = 0;
- rx_protect_superset (rx, template->cdr);
- newset->hash_item.data = (void *)newset;
- newset->hash_item.binding = 0;
- return &newset->hash_item;
-}
-
-#ifdef __STDC__
-static struct rx_hash *
-super_hash_allocator (struct rx_hash_rules * rules)
-#else
-static struct rx_hash *
-super_hash_allocator (rules)
- struct rx_hash_rules * rules;
-#endif
-{
- struct rx_cache * cache
- = ((struct rx_cache *)
- ((char *)rules
- - (unsigned long)(&((struct rx_cache *)0)->superset_hash_rules)));
- return ((struct rx_hash *)
- rx_cache_malloc_or_get (cache,
- &cache->free_hash, sizeof (struct rx_hash)));
-}
-
-
-#ifdef __STDC__
-static void
-super_hash_liberator (struct rx_hash * hash, struct rx_hash_rules * rules)
-#else
-static void
-super_hash_liberator (hash, rules)
- struct rx_hash * hash;
- struct rx_hash_rules * rules;
-#endif
-{
- struct rx_cache * cache
- = ((struct rx_cache *)
- (char *)rules - (long)(&((struct rx_cache *)0)->superset_hash_rules));
- rx_cache_free (cache, &cache->free_hash, (char *)hash);
-}
-
-#ifdef __STDC__
-static void
-superset_hash_item_liberator (struct rx_hash_item * it,
- struct rx_hash_rules * rules)
-#else
-static void
-superset_hash_item_liberator (it, rules) /* Well, it does ya know. */
- struct rx_hash_item * it;
- struct rx_hash_rules * rules;
-#endif
-{
-}
-
-int rx_cache_bound = 128;
-static int rx_default_cache_got = 0;
-
-#ifdef __STDC__
-static int
-bytes_for_cache_size (int supers, int cset_size)
-#else
-static int
-bytes_for_cache_size (supers, cset_size)
- int supers;
- int cset_size;
-#endif
-{
- /* What the hell is this? !!!*/
- return (int)
- ((float)supers *
- ( (1.03 * (float) ( rx_sizeof_bitset (cset_size)
- + sizeof (struct rx_super_edge)))
- + (1.80 * (float) sizeof (struct rx_possible_future))
- + (float) ( sizeof (struct rx_superstate)
- + cset_size * sizeof (struct rx_inx))));
-}
-
-#ifdef __STDC__
-static void
-rx_morecore (struct rx_cache * cache)
-#else
-static void
-rx_morecore (cache)
- struct rx_cache * cache;
-#endif
-{
- if (rx_default_cache_got >= rx_cache_bound)
- return;
-
- rx_default_cache_got += 16;
- cache->superstates_allowed = rx_cache_bound;
- {
- struct rx_blocklist ** pos = &cache->memory;
- int size = bytes_for_cache_size (16, cache->local_cset_size);
- while (*pos)
- pos = &(*pos)->next;
- *pos = ((struct rx_blocklist *)
- malloc (size + sizeof (struct rx_blocklist)));
- if (!*pos)
- return;
-
- (*pos)->next = 0;
- (*pos)->bytes = size;
- cache->memory_pos = *pos;
- cache->memory_addr = (char *)*pos + sizeof (**pos);
- cache->bytes_left = size;
- }
-}
-
-static struct rx_cache default_cache =
-{
- {
- supersetcmp,
- super_hash_allocator,
- super_hash_liberator,
- superset_allocator,
- superset_hash_item_liberator,
- },
- 0,
- 0,
- 0,
- 0,
- rx_morecore,
-
- 0,
- 0,
- 0,
- 0,
- 0,
-
- 0,
- 0,
-
- 0,
-
- 0,
- 0,
- 0,
- 0,
- 128,
-
- 256,
- rx_id_instruction_table,
-
- {
- 0,
- 0,
- {0},
- {0},
- {0}
- }
-};
-
-/* This adds an element to a superstate set. These sets are lists, such
- * that lists with == elements are ==. The empty set is returned by
- * superset_cons (rx, 0, 0) and is NOT equivelent to
- * (struct rx_superset)0.
- */
-
-#ifdef __STDC__
-RX_DECL struct rx_superset *
-rx_superset_cons (struct rx * rx,
- struct rx_nfa_state *car, struct rx_superset *cdr)
-#else
-RX_DECL struct rx_superset *
-rx_superset_cons (rx, car, cdr)
- struct rx * rx;
- struct rx_nfa_state *car;
- struct rx_superset *cdr;
-#endif
-{
- struct rx_cache * cache = rx->cache;
- if (!car && !cdr)
- {
- if (!cache->empty_superset)
- {
- cache->empty_superset
- = ((struct rx_superset *)
- rx_cache_malloc_or_get (cache, &cache->free_supersets,
- sizeof (struct rx_superset)));
- if (!cache->empty_superset)
- return 0;
- bzero (cache->empty_superset, sizeof (struct rx_superset));
- cache->empty_superset->refs = 1000;
- }
- return cache->empty_superset;
- }
- {
- struct rx_superset template;
- struct rx_hash_item * hit;
- template.car = car;
- template.cdr = cdr;
- template.id = car->id;
- hit = rx_hash_store (&cache->superset_table,
- (unsigned long)car ^ car->id ^ (unsigned long)cdr,
- (void *)&template,
- &cache->superset_hash_rules);
- return (hit
- ? (struct rx_superset *)hit->data
- : 0);
- }
-}
-
-/* This computes a union of two NFA state sets. The sets do not have the
- * same representation though. One is a RX_SUPERSET structure (part
- * of the superstate NFA) and the other is an NFA_STATE_SET (part of the NFA).
- */
-
-#ifdef __STDC__
-RX_DECL struct rx_superset *
-rx_superstate_eclosure_union
- (struct rx * rx, struct rx_superset *set, struct rx_nfa_state_set *ecl)
-#else
-RX_DECL struct rx_superset *
-rx_superstate_eclosure_union (rx, set, ecl)
- struct rx * rx;
- struct rx_superset *set;
- struct rx_nfa_state_set *ecl;
-#endif
-{
- if (!ecl)
- return set;
-
- if (!set->car)
- return rx_superset_cons (rx, ecl->car,
- rx_superstate_eclosure_union (rx, set, ecl->cdr));
- if (set->car == ecl->car)
- return rx_superstate_eclosure_union (rx, set, ecl->cdr);
-
- {
- struct rx_superset * tail;
- struct rx_nfa_state * first;
-
- if (set->car > ecl->car)
- {
- tail = rx_superstate_eclosure_union (rx, set->cdr, ecl);
- first = set->car;
- }
- else
- {
- tail = rx_superstate_eclosure_union (rx, set, ecl->cdr);
- first = ecl->car;
- }
- if (!tail)
- return 0;
- else
- {
- struct rx_superset * answer;
- answer = rx_superset_cons (rx, first, tail);
- if (!answer)
- {
- rx_protect_superset (rx, tail);
- rx_release_superset (rx, tail);
- return 0;
- }
- else
- return answer;
- }
- }
-}
-
-
-
-
-/*
- * This makes sure that a list of rx_distinct_futures contains
- * a future for each possible set of side effects in the eclosure
- * of a given state. This is some of the work of filling in a
- * superstate transition.
- */
-
-#ifdef __STDC__
-static struct rx_distinct_future *
-include_futures (struct rx *rx,
- struct rx_distinct_future *df, struct rx_nfa_state
- *state, struct rx_superstate *superstate)
-#else
-static struct rx_distinct_future *
-include_futures (rx, df, state, superstate)
- struct rx *rx;
- struct rx_distinct_future *df;
- struct rx_nfa_state *state;
- struct rx_superstate *superstate;
-#endif
-{
- struct rx_possible_future *future;
- struct rx_cache * cache = rx->cache;
- for (future = state->futures; future; future = future->next)
- {
- struct rx_distinct_future *dfp;
- struct rx_distinct_future *insert_before = 0;
- if (df)
- df->next_same_super_edge[1]->next_same_super_edge[0] = 0;
- for (dfp = df; dfp; dfp = dfp->next_same_super_edge[0])
- if (dfp->effects == future->effects)
- break;
- else
- {
- int order = rx->se_list_cmp (rx, dfp->effects, future->effects);
- if (order > 0)
- {
- insert_before = dfp;
- dfp = 0;
- break;
- }
- }
- if (df)
- df->next_same_super_edge[1]->next_same_super_edge[0] = df;
- if (!dfp)
- {
- dfp
- = ((struct rx_distinct_future *)
- rx_cache_malloc_or_get (cache, &cache->free_discernable_futures,
- sizeof (struct rx_distinct_future)));
- if (!dfp)
- return 0;
- if (!df)
- {
- df = insert_before = dfp;
- df->next_same_super_edge[0] = df->next_same_super_edge[1] = df;
- }
- else if (!insert_before)
- insert_before = df;
- else if (insert_before == df)
- df = dfp;
-
- dfp->next_same_super_edge[0] = insert_before;
- dfp->next_same_super_edge[1]
- = insert_before->next_same_super_edge[1];
- dfp->next_same_super_edge[1]->next_same_super_edge[0] = dfp;
- dfp->next_same_super_edge[0]->next_same_super_edge[1] = dfp;
- dfp->next_same_dest = dfp->prev_same_dest = dfp;
- dfp->future = 0;
- dfp->present = superstate;
- dfp->future_frame.inx = rx->instruction_table[rx_cache_miss];
- dfp->future_frame.data = 0;
- dfp->future_frame.data_2 = (void *) dfp;
- dfp->side_effects_frame.inx
- = rx->instruction_table[rx_do_side_effects];
- dfp->side_effects_frame.data = 0;
- dfp->side_effects_frame.data_2 = (void *) dfp;
- dfp->effects = future->effects;
- }
- }
- return df;
-}
-
-
-
-/* This constructs a new superstate from its state set. The only
- * complexity here is memory management.
- */
-#ifdef __STDC__
-RX_DECL struct rx_superstate *
-rx_superstate (struct rx *rx,
- struct rx_superset *set)
-#else
-RX_DECL struct rx_superstate *
-rx_superstate (rx, set)
- struct rx *rx;
- struct rx_superset *set;
-#endif
-{
- struct rx_cache * cache = rx->cache;
- struct rx_superstate * superstate = 0;
-
- /* Does the superstate already exist in the cache? */
- if (set->superstate)
- {
- if (set->superstate->rx_id != rx->rx_id)
- {
- /* Aha. It is in the cache, but belongs to a superstate
- * that refers to an NFA that no longer exists.
- * (We know it no longer exists because it was evidently
- * stored in the same region of memory as the current nfa
- * yet it has a different id.)
- */
- superstate = set->superstate;
- if (!superstate->is_semifree)
- {
- if (cache->lru_superstate == superstate)
- {
- cache->lru_superstate = superstate->next_recyclable;
- if (cache->lru_superstate == superstate)
- cache->lru_superstate = 0;
- }
- {
- superstate->next_recyclable->prev_recyclable
- = superstate->prev_recyclable;
- superstate->prev_recyclable->next_recyclable
- = superstate->next_recyclable;
- if (!cache->semifree_superstate)
- {
- (cache->semifree_superstate
- = superstate->next_recyclable
- = superstate->prev_recyclable
- = superstate);
- }
- else
- {
- superstate->next_recyclable = cache->semifree_superstate;
- superstate->prev_recyclable
- = cache->semifree_superstate->prev_recyclable;
- superstate->next_recyclable->prev_recyclable
- = superstate;
- superstate->prev_recyclable->next_recyclable
- = superstate;
- cache->semifree_superstate = superstate;
- }
- ++cache->semifree_superstates;
- }
- }
- set->superstate = 0;
- goto handle_cache_miss;
- }
- ++cache->hits;
- superstate = set->superstate;
-
- rx_refresh_this_superstate (cache, superstate);
- return superstate;
- }
-
- handle_cache_miss:
-
- /* This point reached only for cache misses. */
- ++cache->misses;
-#if RX_DEBUG
- if (rx_debug_trace > 1)
- {
- struct rx_superset * setp = set;
- fprintf (stderr, "Building a superstet %d(%d): ", rx->rx_id, set);
- while (setp)
- {
- fprintf (stderr, "%d ", setp->id);
- setp = setp->cdr;
- }
- fprintf (stderr, "(%d)\n", set);
- }
-#endif
- superstate = (struct rx_superstate *)rx_cache_get_superstate (cache);
- if (!superstate)
- return 0;
-
- if (!cache->lru_superstate)
- (cache->lru_superstate
- = superstate->next_recyclable
- = superstate->prev_recyclable
- = superstate);
- else
- {
- superstate->next_recyclable = cache->lru_superstate;
- superstate->prev_recyclable = cache->lru_superstate->prev_recyclable;
- ( superstate->prev_recyclable->next_recyclable
- = superstate->next_recyclable->prev_recyclable
- = superstate);
- }
- superstate->rx_id = rx->rx_id;
- superstate->transition_refs = 0;
- superstate->locks = 0;
- superstate->is_semifree = 0;
- set->superstate = superstate;
- superstate->contents = set;
- rx_protect_superset (rx, set);
- superstate->edges = 0;
- {
- int x;
- /* None of the transitions from this superstate are known yet. */
- for (x = 0; x < rx->local_cset_size; ++x) /* &&&&& 3.8 % */
- {
- struct rx_inx * ifr = &superstate->transitions[x];
- ifr->inx = rx->instruction_table [rx_cache_miss];
- ifr->data = ifr->data_2 = 0;
- }
- }
- return superstate;
-}
-
-
-/* This computes the destination set of one edge of the superstate NFA.
- * Note that a RX_DISTINCT_FUTURE is a superstate edge.
- * Returns 0 on an allocation failure.
- */
-
-#ifdef __STDC__
-static int
-solve_destination (struct rx *rx, struct rx_distinct_future *df)
-#else
-static int
-solve_destination (rx, df)
- struct rx *rx;
- struct rx_distinct_future *df;
-#endif
-{
- struct rx_super_edge *tc = df->edge;
- struct rx_superset *nfa_state;
- struct rx_superset *nil_set = rx_superset_cons (rx, 0, 0);
- struct rx_superset *solution = nil_set;
- struct rx_superstate *dest;
-
- rx_protect_superset (rx, solution);
- /* Iterate over all NFA states in the state set of this superstate. */
- for (nfa_state = df->present->contents;
- nfa_state->car;
- nfa_state = nfa_state->cdr)
- {
- struct rx_nfa_edge *e;
- /* Iterate over all edges of each NFA state. */
- for (e = nfa_state->car->edges; e; e = e->next)
- /* If we find an edge that is labeled with
- * the characters we are solving for.....
- */
- if (rx_bitset_is_subset (rx->local_cset_size,
- tc->cset, e->params.cset))
- {
- struct rx_nfa_state *n = e->dest;
- struct rx_possible_future *pf;
- /* ....search the partial epsilon closures of the destination
- * of that edge for a path that involves the same set of
- * side effects we are solving for.
- * If we find such a RX_POSSIBLE_FUTURE, we add members to the
- * stateset we are computing.
- */
- for (pf = n->futures; pf; pf = pf->next)
- if (pf->effects == df->effects)
- {
- struct rx_superset * old_sol;
- old_sol = solution;
- solution = rx_superstate_eclosure_union (rx, solution,
- pf->destset);
- if (!solution)
- return 0;
- rx_protect_superset (rx, solution);
- rx_release_superset (rx, old_sol);
- }
- }
- }
- /* It is possible that the RX_DISTINCT_FUTURE we are working on has
- * the empty set of NFA states as its definition. In that case, this
- * is a failure point.
- */
- if (solution == nil_set)
- {
- df->future_frame.inx = (void *) rx_backtrack;
- df->future_frame.data = 0;
- df->future_frame.data_2 = 0;
- return 1;
- }
- dest = rx_superstate (rx, solution);
- rx_release_superset (rx, solution);
- if (!dest)
- return 0;
-
- {
- struct rx_distinct_future *dft;
- dft = df;
- df->prev_same_dest->next_same_dest = 0;
- while (dft)
- {
- dft->future = dest;
- dft->future_frame.inx = rx->instruction_table[rx_next_char];
- dft->future_frame.data = (void *) dest->transitions;
- dft = dft->next_same_dest;
- }
- df->prev_same_dest->next_same_dest = df;
- }
- if (!dest->transition_refs)
- dest->transition_refs = df;
- else
- {
- struct rx_distinct_future *dft = dest->transition_refs->next_same_dest;
- dest->transition_refs->next_same_dest = df->next_same_dest;
- df->next_same_dest->prev_same_dest = dest->transition_refs;
- df->next_same_dest = dft;
- dft->prev_same_dest = df;
- }
- return 1;
-}
-
-
-/* This takes a superstate and a character, and computes some edges
- * from the superstate NFA. In particular, this computes all edges
- * that lead from SUPERSTATE given CHR. This function also
- * computes the set of characters that share this edge set.
- * This returns 0 on allocation error.
- * The character set and list of edges are returned through
- * the paramters CSETOUT and DFOUT.
-} */
-
-#ifdef __STDC__
-static int
-compute_super_edge (struct rx *rx, struct rx_distinct_future **dfout,
- rx_Bitset csetout, struct rx_superstate *superstate,
- unsigned char chr)
-#else
-static int
-compute_super_edge (rx, dfout, csetout, superstate, chr)
- struct rx *rx;
- struct rx_distinct_future **dfout;
- rx_Bitset csetout;
- struct rx_superstate *superstate;
- unsigned char chr;
-#endif
-{
- struct rx_superset *stateset = superstate->contents;
-
- /* To compute the set of characters that share edges with CHR,
- * we start with the full character set, and subtract.
- */
- rx_bitset_universe (rx->local_cset_size, csetout);
- *dfout = 0;
-
- /* Iterate over the NFA states in the superstate state-set. */
- while (stateset->car)
- {
- struct rx_nfa_edge *e;
- for (e = stateset->car->edges; e; e = e->next)
- if (RX_bitset_member (e->params.cset, chr))
- {
- /* If we find an NFA edge that applies, we make sure there
- * are corresponding edges in the superstate NFA.
- */
- {
- struct rx_distinct_future * saved;
- saved = *dfout;
- *dfout = include_futures (rx, *dfout, e->dest, superstate);
- if (!*dfout)
- {
- struct rx_distinct_future * df;
- df = saved;
- if (df)
- df->next_same_super_edge[1]->next_same_super_edge[0] = 0;
- while (df)
- {
- struct rx_distinct_future *dft;
- dft = df;
- df = df->next_same_super_edge[0];
-
- if (dft->future && dft->future->transition_refs == dft)
- {
- dft->future->transition_refs = dft->next_same_dest;
- if (dft->future->transition_refs == dft)
- dft->future->transition_refs = 0;
- }
- dft->next_same_dest->prev_same_dest = dft->prev_same_dest;
- dft->prev_same_dest->next_same_dest = dft->next_same_dest;
- rx_cache_free (rx->cache,
- &rx->cache->free_discernable_futures,
- (char *)dft);
- }
- return 0;
- }
- }
- /* We also trim the character set a bit. */
- rx_bitset_intersection (rx->local_cset_size,
- csetout, e->params.cset);
- }
- else
- /* An edge that doesn't apply at least tells us some characters
- * that don't share the same edge set as CHR.
- */
- rx_bitset_difference (rx->local_cset_size, csetout, e->params.cset);
- stateset = stateset->cdr;
- }
- return 1;
-}
-
-
-/* This is a constructor for RX_SUPER_EDGE structures. These are
- * wrappers for lists of superstate NFA edges that share character sets labels.
- * If a transition class contains more than one rx_distinct_future (superstate
- * edge), then it represents a non-determinism in the superstate NFA.
- */
-
-#ifdef __STDC__
-static struct rx_super_edge *
-rx_super_edge (struct rx *rx,
- struct rx_superstate *super, rx_Bitset cset,
- struct rx_distinct_future *df)
-#else
-static struct rx_super_edge *
-rx_super_edge (rx, super, cset, df)
- struct rx *rx;
- struct rx_superstate *super;
- rx_Bitset cset;
- struct rx_distinct_future *df;
-#endif
-{
- struct rx_super_edge *tc =
- (struct rx_super_edge *)rx_cache_malloc_or_get
- (rx->cache, &rx->cache->free_transition_classes,
- sizeof (struct rx_super_edge) + rx_sizeof_bitset (rx->local_cset_size));
-
- if (!tc)
- return 0;
- tc->next = super->edges;
- super->edges = tc;
- tc->rx_backtrack_frame.inx = rx->instruction_table[rx_backtrack_point];
- tc->rx_backtrack_frame.data = 0;
- tc->rx_backtrack_frame.data_2 = (void *) tc;
- tc->options = df;
- tc->cset = (rx_Bitset) ((char *) tc + sizeof (*tc));
- rx_bitset_assign (rx->local_cset_size, tc->cset, cset);
- if (df)
- {
- struct rx_distinct_future * dfp = df;
- df->next_same_super_edge[1]->next_same_super_edge[0] = 0;
- while (dfp)
- {
- dfp->edge = tc;
- dfp = dfp->next_same_super_edge[0];
- }
- df->next_same_super_edge[1]->next_same_super_edge[0] = df;
- }
- return tc;
-}
-
-
-/* There are three kinds of cache miss. The first occurs when a
- * transition is taken that has never been computed during the
- * lifetime of the source superstate. That cache miss is handled by
- * calling COMPUTE_SUPER_EDGE. The second kind of cache miss
- * occurs when the destination superstate of a transition doesn't
- * exist. SOLVE_DESTINATION is used to construct the destination superstate.
- * Finally, the third kind of cache miss occurs when the destination
- * superstate of a transition is in a `semi-free state'. That case is
- * handled by UNFREE_SUPERSTATE.
- *
- * The function of HANDLE_CACHE_MISS is to figure out which of these
- * cases applies.
- */
-
-#ifdef __STDC__
-static void
-install_partial_transition (struct rx_superstate *super,
- struct rx_inx *answer,
- RX_subset set, int offset)
-#else
-static void
-install_partial_transition (super, answer, set, offset)
- struct rx_superstate *super;
- struct rx_inx *answer;
- RX_subset set;
- int offset;
-#endif
-{
- int start = offset;
- int end = start + 32;
- RX_subset pos = 1;
- struct rx_inx * transitions = super->transitions;
-
- while (start < end)
- {
- if (set & pos)
- transitions[start] = *answer;
- pos <<= 1;
- ++start;
- }
-}
-
-
-#ifdef __STDC__
-RX_DECL struct rx_inx *
-rx_handle_cache_miss
- (struct rx *rx, struct rx_superstate *super, unsigned char chr, void *data)
-#else
-RX_DECL struct rx_inx *
-rx_handle_cache_miss (rx, super, chr, data)
- struct rx *rx;
- struct rx_superstate *super;
- unsigned char chr;
- void *data;
-#endif
-{
- int offset = chr / RX_subset_bits;
- struct rx_distinct_future *df = data;
-
- if (!df) /* must be the shared_cache_miss_frame */
- {
- /* Perhaps this is just a transition waiting to be filled. */
- struct rx_super_edge *tc;
- RX_subset mask = rx_subset_singletons [chr % RX_subset_bits];
-
- for (tc = super->edges; tc; tc = tc->next)
- if (tc->cset[offset] & mask)
- {
- struct rx_inx * answer;
- df = tc->options;
- answer = ((tc->options->next_same_super_edge[0] != tc->options)
- ? &tc->rx_backtrack_frame
- : (df->effects
- ? &df->side_effects_frame
- : &df->future_frame));
- install_partial_transition (super, answer,
- tc->cset [offset], offset * 32);
- return answer;
- }
- /* Otherwise, it's a flushed or newly encountered edge. */
- {
- char cset_space[1024]; /* this limit is far from unreasonable */
- rx_Bitset trcset;
- struct rx_inx *answer;
-
- if (rx_sizeof_bitset (rx->local_cset_size) > sizeof (cset_space))
- return 0; /* If the arbitrary limit is hit, always fail */
- /* cleanly. */
- trcset = (rx_Bitset)cset_space;
- rx_lock_superstate (rx, super);
- if (!compute_super_edge (rx, &df, trcset, super, chr))
- {
- rx_unlock_superstate (rx, super);
- return 0;
- }
- if (!df) /* We just computed the fail transition. */
- {
- static struct rx_inx
- shared_fail_frame = { 0, 0, (void *)rx_backtrack, 0 };
- answer = &shared_fail_frame;
- }
- else
- {
- tc = rx_super_edge (rx, super, trcset, df);
- if (!tc)
- {
- rx_unlock_superstate (rx, super);
- return 0;
- }
- answer = ((tc->options->next_same_super_edge[0] != tc->options)
- ? &tc->rx_backtrack_frame
- : (df->effects
- ? &df->side_effects_frame
- : &df->future_frame));
- }
- install_partial_transition (super, answer,
- trcset[offset], offset * 32);
- rx_unlock_superstate (rx, super);
- return answer;
- }
- }
- else if (df->future) /* A cache miss on an edge with a future? Must be
- * a semi-free destination. */
- {
- if (df->future->is_semifree)
- refresh_semifree_superstate (rx->cache, df->future);
- return &df->future_frame;
- }
- else
- /* no future superstate on an existing edge */
- {
- rx_lock_superstate (rx, super);
- if (!solve_destination (rx, df))
- {
- rx_unlock_superstate (rx, super);
- return 0;
- }
- if (!df->effects
- && (df->edge->options->next_same_super_edge[0] == df->edge->options))
- install_partial_transition (super, &df->future_frame,
- df->edge->cset[offset], offset * 32);
- rx_unlock_superstate (rx, super);
- return &df->future_frame;
- }
-}
-
-
-
-
-/* The rest of the code provides a regex.c compatable interface. */
-
-
-__const__ char *re_error_msg[] =
-{
- 0, /* REG_NOUT */
- "No match", /* REG_NOMATCH */
- "Invalid regular expression", /* REG_BADPAT */
- "Invalid collation character", /* REG_ECOLLATE */
- "Invalid character class name", /* REG_ECTYPE */
- "Trailing backslash", /* REG_EESCAPE */
- "Invalid back reference", /* REG_ESUBREG */
- "Unmatched [ or [^", /* REG_EBRACK */
- "Unmatched ( or \\(", /* REG_EPAREN */
- "Unmatched \\{", /* REG_EBRACE */
- "Invalid content of \\{\\}", /* REG_BADBR */
- "Invalid range end", /* REG_ERANGE */
- "Memory exhausted", /* REG_ESPACE */
- "Invalid preceding regular expression", /* REG_BADRPT */
- "Premature end of regular expression", /* REG_EEND */
- "Regular expression too big", /* REG_ESIZE */
- "Unmatched ) or \\)", /* REG_ERPAREN */
-};
-
-
-
-/*
- * Macros used while compiling patterns.
- *
- * By convention, PEND points just past the end of the uncompiled pattern,
- * P points to the read position in the pattern. `translate' is the name
- * of the translation table (`TRANSLATE' is the name of a macro that looks
- * things up in `translate').
- */
-
-
-/*
- * Fetch the next character in the uncompiled pattern---translating it
- * if necessary. *Also cast from a signed character in the constant
- * string passed to us by the user to an unsigned char that we can use
- * as an array index (in, e.g., `translate').
- */
-#define PATFETCH(c) \
- do {if (p == pend) return REG_EEND; \
- c = (unsigned char) *p++; \
- c = translate[c]; \
- } while (0)
-
-/*
- * Fetch the next character in the uncompiled pattern, with no
- * translation.
- */
-#define PATFETCH_RAW(c) \
- do {if (p == pend) return REG_EEND; \
- c = (unsigned char) *p++; \
- } while (0)
-
-/* Go backwards one character in the pattern. */
-#define PATUNFETCH p--
-
-
-#define TRANSLATE(d) translate[(unsigned char) (d)]
-
-typedef unsigned regnum_t;
-
-/* Since offsets can go either forwards or backwards, this type needs to
- * be able to hold values from -(MAX_BUF_SIZE - 1) to MAX_BUF_SIZE - 1.
- */
-typedef int pattern_offset_t;
-
-typedef struct
-{
- struct rexp_node ** top_expression; /* was begalt */
- struct rexp_node ** last_expression; /* was laststart */
- pattern_offset_t inner_group_offset;
- regnum_t regnum;
-} compile_stack_elt_t;
-
-typedef struct
-{
- compile_stack_elt_t *stack;
- unsigned size;
- unsigned avail; /* Offset of next open position. */
-} compile_stack_type;
-
-
-#define INIT_COMPILE_STACK_SIZE 32
-
-#define COMPILE_STACK_EMPTY (compile_stack.avail == 0)
-#define COMPILE_STACK_FULL (compile_stack.avail == compile_stack.size)
-
-/* The next available element. */
-#define COMPILE_STACK_TOP (compile_stack.stack[compile_stack.avail])
-
-
-/* Set the bit for character C in a list. */
-#define SET_LIST_BIT(c) \
- (b[((unsigned char) (c)) / CHARBITS] \
- |= 1 << (((unsigned char) c) % CHARBITS))
-
-/* Get the next unsigned number in the uncompiled pattern. */
-#define GET_UNSIGNED_NUMBER(num) \
- { if (p != pend) \
- { \
- PATFETCH (c); \
- while (isdigit (c)) \
- { \
- if (num < 0) \
- num = 0; \
- num = num * 10 + c - '0'; \
- if (p == pend) \
- break; \
- PATFETCH (c); \
- } \
- } \
- }
-
-#define CHAR_CLASS_MAX_LENGTH 6 /* Namely, `xdigit'. */
-
-#define IS_CHAR_CLASS(string) \
- (!strcmp (string, "alpha") || !strcmp (string, "upper") \
- || !strcmp (string, "lower") || !strcmp (string, "digit") \
- || !strcmp (string, "alnum") || !strcmp (string, "xdigit") \
- || !strcmp (string, "space") || !strcmp (string, "print") \
- || !strcmp (string, "punct") || !strcmp (string, "graph") \
- || !strcmp (string, "cntrl") || !strcmp (string, "blank"))
-
-
-/* These predicates are used in regex_compile. */
-
-/* P points to just after a ^ in PATTERN. Return true if that ^ comes
- * after an alternative or a begin-subexpression. We assume there is at
- * least one character before the ^.
- */
-
-#ifdef __STDC__
-static boolean
-at_begline_loc_p (__const__ char *pattern, __const__ char * p, reg_syntax_t syntax)
-#else
-static boolean
-at_begline_loc_p (pattern, p, syntax)
- __const__ char *pattern;
- __const__ char * p;
- reg_syntax_t syntax;
-#endif
-{
- __const__ char *prev = p - 2;
- boolean prev_prev_backslash = ((prev > pattern) && (prev[-1] == '\\'));
-
- return
-
- (/* After a subexpression? */
- ((*prev == '(') && ((syntax & RE_NO_BK_PARENS) || prev_prev_backslash))
- ||
- /* After an alternative? */
- ((*prev == '|') && ((syntax & RE_NO_BK_VBAR) || prev_prev_backslash))
- );
-}
-
-/* The dual of at_begline_loc_p. This one is for $. We assume there is
- * at least one character after the $, i.e., `P < PEND'.
- */
-
-#ifdef __STDC__
-static boolean
-at_endline_loc_p (__const__ char *p, __const__ char *pend, int syntax)
-#else
-static boolean
-at_endline_loc_p (p, pend, syntax)
- __const__ char *p;
- __const__ char *pend;
- int syntax;
-#endif
-{
- __const__ char *next = p;
- boolean next_backslash = (*next == '\\');
- __const__ char *next_next = (p + 1 < pend) ? (p + 1) : 0;
-
- return
- (
- /* Before a subexpression? */
- ((syntax & RE_NO_BK_PARENS)
- ? (*next == ')')
- : (next_backslash && next_next && (*next_next == ')')))
- ||
- /* Before an alternative? */
- ((syntax & RE_NO_BK_VBAR)
- ? (*next == '|')
- : (next_backslash && next_next && (*next_next == '|')))
- );
-}
-
-
-unsigned char rx_id_translation[256] =
-{
- 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
- 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
- 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
- 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
- 40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
- 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
- 60, 61, 62, 63, 64, 65, 66, 67, 68, 69,
- 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
- 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
- 90, 91, 92, 93, 94, 95, 96, 97, 98, 99,
-
- 100, 101, 102, 103, 104, 105, 106, 107, 108, 109,
- 110, 111, 112, 113, 114, 115, 116, 117, 118, 119,
- 120, 121, 122, 123, 124, 125, 126, 127, 128, 129,
- 130, 131, 132, 133, 134, 135, 136, 137, 138, 139,
- 140, 141, 142, 143, 144, 145, 146, 147, 148, 149,
- 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
- 160, 161, 162, 163, 164, 165, 166, 167, 168, 169,
- 170, 171, 172, 173, 174, 175, 176, 177, 178, 179,
- 180, 181, 182, 183, 184, 185, 186, 187, 188, 189,
- 190, 191, 192, 193, 194, 195, 196, 197, 198, 199,
-
- 200, 201, 202, 203, 204, 205, 206, 207, 208, 209,
- 210, 211, 212, 213, 214, 215, 216, 217, 218, 219,
- 220, 221, 222, 223, 224, 225, 226, 227, 228, 229,
- 230, 231, 232, 233, 234, 235, 236, 237, 238, 239,
- 240, 241, 242, 243, 244, 245, 246, 247, 248, 249,
- 250, 251, 252, 253, 254, 255
-};
-
-/* The compiler keeps an inverted translation table.
- * This looks up/inititalize elements.
- * VALID is an array of booleans that validate CACHE.
- */
-
-#ifdef __STDC__
-static rx_Bitset
-inverse_translation (struct re_pattern_buffer * rxb,
- char * valid, rx_Bitset cache,
- unsigned char * translate, int c)
-#else
-static rx_Bitset
-inverse_translation (rxb, valid, cache, translate, c)
- struct re_pattern_buffer * rxb;
- char * valid;
- rx_Bitset cache;
- unsigned char * translate;
- int c;
-#endif
-{
- rx_Bitset cs
- = cache + c * rx_bitset_numb_subsets (rxb->rx.local_cset_size);
-
- if (!valid[c])
- {
- int x;
- int c_tr = TRANSLATE(c);
- rx_bitset_null (rxb->rx.local_cset_size, cs);
- for (x = 0; x < 256; ++x) /* &&&& 13.37 */
- if (TRANSLATE(x) == c_tr)
- RX_bitset_enjoin (cs, x);
- valid[c] = 1;
- }
- return cs;
-}
-
-
-
-
-/* More subroutine declarations and macros for regex_compile. */
-
-/* Returns true if REGNUM is in one of COMPILE_STACK's elements and
- false if it's not. */
-
-#ifdef __STDC__
-static boolean
-group_in_compile_stack (compile_stack_type compile_stack, regnum_t regnum)
-#else
-static boolean
-group_in_compile_stack (compile_stack, regnum)
- compile_stack_type compile_stack;
- regnum_t regnum;
-#endif
-{
- int this_element;
-
- for (this_element = compile_stack.avail - 1;
- this_element >= 0;
- this_element--)
- if (compile_stack.stack[this_element].regnum == regnum)
- return true;
-
- return false;
-}
-
-
-/*
- * Read the ending character of a range (in a bracket expression) from the
- * uncompiled pattern *P_PTR (which ends at PEND). We assume the
- * starting character is in `P[-2]'. (`P[-1]' is the character `-'.)
- * Then we set the translation of all bits between the starting and
- * ending characters (inclusive) in the compiled pattern B.
- *
- * Return an error code.
- *
- * We use these short variable names so we can use the same macros as
- * `regex_compile' itself.
- */
-
-#ifdef __STDC__
-static reg_errcode_t
-compile_range (struct re_pattern_buffer * rxb, rx_Bitset cs,
- __const__ char ** p_ptr, __const__ char * pend,
- unsigned char * translate, reg_syntax_t syntax,
- rx_Bitset inv_tr, char * valid_inv_tr)
-#else
-static reg_errcode_t
-compile_range (rxb, cs, p_ptr, pend, translate, syntax, inv_tr, valid_inv_tr)
- struct re_pattern_buffer * rxb;
- rx_Bitset cs;
- __const__ char ** p_ptr;
- __const__ char * pend;
- unsigned char * translate;
- reg_syntax_t syntax;
- rx_Bitset inv_tr;
- char * valid_inv_tr;
-#endif
-{
- unsigned this_char;
-
- __const__ char *p = *p_ptr;
-
- unsigned char range_end;
- unsigned char range_start = TRANSLATE(p[-2]);
-
- if (p == pend)
- return REG_ERANGE;
-
- PATFETCH (range_end);
-
- (*p_ptr)++;
-
- if (range_start > range_end)
- return syntax & RE_NO_EMPTY_RANGES ? REG_ERANGE : REG_NOERROR;
-
- for (this_char = range_start; this_char <= range_end; this_char++)
- {
- rx_Bitset it =
- inverse_translation (rxb, valid_inv_tr, inv_tr, translate, this_char);
- rx_bitset_union (rxb->rx.local_cset_size, cs, it);
- }
-
- return REG_NOERROR;
-}
-
-
-/* This searches a regexp for backreference side effects.
- * It fills in the array OUT with 1 at the index of every register pair
- * referenced by a backreference.
- *
- * This is used to help optimize patterns for searching. The information is
- * useful because, if the caller doesn't want register values, backreferenced
- * registers are the only registers for which we need rx_backtrack.
- */
-
-#ifdef __STDC__
-static void
-find_backrefs (char * out, struct rexp_node * rexp,
- struct re_se_params * params)
-#else
-static void
-find_backrefs (out, rexp, params)
- char * out;
- struct rexp_node * rexp;
- struct re_se_params * params;
-#endif
-{
- if (rexp)
- switch (rexp->type)
- {
- case r_cset:
- case r_data:
- return;
- case r_alternate:
- case r_concat:
- case r_opt:
- case r_star:
- case r_2phase_star:
- find_backrefs (out, rexp->params.pair.left, params);
- find_backrefs (out, rexp->params.pair.right, params);
- return;
- case r_side_effect:
- if ( ((long)rexp->params.side_effect >= 0)
- && (params [(long)rexp->params.side_effect].se == re_se_backref))
- out[ params [(long)rexp->params.side_effect].op1] = 1;
- return;
- }
-}
-
-
-
-/* Returns 0 unless the pattern can match the empty string. */
-
-#ifdef __STDC__
-static int
-compute_fastset (struct re_pattern_buffer * rxb, struct rexp_node * rexp)
-#else
-static int
-compute_fastset (rxb, rexp)
- struct re_pattern_buffer * rxb;
- struct rexp_node * rexp;
-#endif
-{
- if (!rexp)
- return 1;
- switch (rexp->type)
- {
- case r_data:
- return 1;
- case r_cset:
- {
- rx_bitset_union (rxb->rx.local_cset_size,
- rxb->fastset, rexp->params.cset);
- }
- return 0;
- case r_concat:
- return (compute_fastset (rxb, rexp->params.pair.left)
- && compute_fastset (rxb, rexp->params.pair.right));
- case r_2phase_star:
- compute_fastset (rxb, rexp->params.pair.left);
- /* compute_fastset (rxb, rexp->params.pair.right); nope... */
- return 1;
- case r_alternate:
- return !!(compute_fastset (rxb, rexp->params.pair.left)
- + compute_fastset (rxb, rexp->params.pair.right));
- case r_opt:
- case r_star:
- compute_fastset (rxb, rexp->params.pair.left);
- return 1;
- case r_side_effect:
- return 1;
- }
-
- /* this should never happen */
- return 0;
-}
-
-
-/* returns
- * 1 -- yes, definately anchored by the given side effect.
- * 2 -- maybe anchored, maybe the empty string.
- * 0 -- definately not anchored
- * There is simply no other possibility.
- */
-
-#ifdef __STDC__
-static int
-is_anchored (struct rexp_node * rexp, rx_side_effect se)
-#else
-static int
-is_anchored (rexp, se)
- struct rexp_node * rexp;
- rx_side_effect se;
-#endif
-{
- if (!rexp)
- return 2;
- switch (rexp->type)
- {
- case r_cset:
- case r_data:
- return 0;
- case r_concat:
- case r_2phase_star:
- {
- int l = is_anchored (rexp->params.pair.left, se);
- return (l == 2 ? is_anchored (rexp->params.pair.right, se) : l);
- }
- case r_alternate:
- {
- int l = is_anchored (rexp->params.pair.left, se);
- int r = l ? is_anchored (rexp->params.pair.right, se) : 0;
-
- if (l == r)
- return l;
- else if ((l == 0) || (r == 0))
- return 0;
- else
- return 2;
- }
- case r_opt:
- case r_star:
- return is_anchored (rexp->params.pair.left, se) ? 2 : 0;
-
- case r_side_effect:
- return ((rexp->params.side_effect == se)
- ? 1 : 2);
- }
-
- /* this should never happen */
- return 0;
-}
-
-
-/* This removes register assignments that aren't required by backreferencing.
- * This can speed up explore_future, especially if it eliminates
- * non-determinism in the superstate NFA.
- *
- * NEEDED is an array of characters, presumably filled in by FIND_BACKREFS.
- * The non-zero elements of the array indicate which register assignments
- * can NOT be removed from the expression.
- */
-
-#ifdef __STDC__
-static struct rexp_node *
-remove_unecessary_side_effects (struct rx * rx, char * needed,
- struct rexp_node * rexp,
- struct re_se_params * params)
-#else
-static struct rexp_node *
-remove_unecessary_side_effects (rx, needed, rexp, params)
- struct rx * rx;
- char * needed;
- struct rexp_node * rexp;
- struct re_se_params * params;
-#endif
-{
- struct rexp_node * l;
- struct rexp_node * r;
- if (!rexp)
- return 0;
- else
- switch (rexp->type)
- {
- case r_cset:
- case r_data:
- return rexp;
- case r_alternate:
- case r_concat:
- case r_2phase_star:
- l = remove_unecessary_side_effects (rx, needed,
- rexp->params.pair.left, params);
- r = remove_unecessary_side_effects (rx, needed,
- rexp->params.pair.right, params);
- if ((l && r) || (rexp->type != r_concat))
- {
- rexp->params.pair.left = l;
- rexp->params.pair.right = r;
- return rexp;
- }
- else
- {
- rexp->params.pair.left = rexp->params.pair.right = 0;
- rx_free_rexp (rx, rexp);
- return l ? l : r;
- }
- case r_opt:
- case r_star:
- l = remove_unecessary_side_effects (rx, needed,
- rexp->params.pair.left, params);
- if (l)
- {
- rexp->params.pair.left = l;
- return rexp;
- }
- else
- {
- rexp->params.pair.left = 0;
- rx_free_rexp (rx, rexp);
- return 0;
- }
- case r_side_effect:
- {
- int se = (long)rexp->params.side_effect;
- if ( (se >= 0)
- && ( ((enum re_side_effects)params[se].se == re_se_lparen)
- || ((enum re_side_effects)params[se].se == re_se_rparen))
- && (params [se].op1 > 0)
- && (!needed [params [se].op1]))
- {
- rx_free_rexp (rx, rexp);
- return 0;
- }
- else
- return rexp;
- }
- }
-
- /* this should never happen */
- return 0;
-}
-
-
-
-#ifdef __STDC__
-static int
-pointless_if_repeated (struct rexp_node * node, struct re_se_params * params)
-#else
-static int
-pointless_if_repeated (node, params)
- struct rexp_node * node;
- struct re_se_params * params;
-#endif
-{
- if (!node)
- return 1;
- switch (node->type)
- {
- case r_cset:
- return 0;
- case r_alternate:
- case r_concat:
- case r_2phase_star:
- return (pointless_if_repeated (node->params.pair.left, params)
- && pointless_if_repeated (node->params.pair.right, params));
- case r_opt:
- case r_star:
- return pointless_if_repeated (node->params.pair.left, params);
- case r_side_effect:
- switch (((long)node->params.side_effect < 0)
- ? (enum re_side_effects)node->params.side_effect
- : (enum re_side_effects)params[(long)node->params.side_effect].se)
- {
- case re_se_try:
- case re_se_at_dot:
- case re_se_begbuf:
- case re_se_hat:
- case re_se_wordbeg:
- case re_se_wordbound:
- case re_se_notwordbound:
- case re_se_wordend:
- case re_se_endbuf:
- case re_se_dollar:
- case re_se_fail:
- case re_se_win:
- return 1;
- case re_se_lparen:
- case re_se_rparen:
- case re_se_iter:
- case re_se_end_iter:
- case re_se_syntax:
- case re_se_not_syntax:
- case re_se_backref:
- return 0;
- }
- case r_data:
- default:
- return 0;
- }
-}
-
-
-
-#ifdef __STDC__
-static int
-registers_on_stack (struct re_pattern_buffer * rxb,
- struct rexp_node * rexp, int in_danger,
- struct re_se_params * params)
-#else
-static int
-registers_on_stack (rxb, rexp, in_danger, params)
- struct re_pattern_buffer * rxb;
- struct rexp_node * rexp;
- int in_danger;
- struct re_se_params * params;
-#endif
-{
- if (!rexp)
- return 0;
- else
- switch (rexp->type)
- {
- case r_cset:
- case r_data:
- return 0;
- case r_alternate:
- case r_concat:
- return ( registers_on_stack (rxb, rexp->params.pair.left,
- in_danger, params)
- || (registers_on_stack
- (rxb, rexp->params.pair.right,
- in_danger, params)));
- case r_opt:
- return registers_on_stack (rxb, rexp->params.pair.left, 0, params);
- case r_star:
- return registers_on_stack (rxb, rexp->params.pair.left, 1, params);
- case r_2phase_star:
- return
- ( registers_on_stack (rxb, rexp->params.pair.left, 1, params)
- || registers_on_stack (rxb, rexp->params.pair.right, 1, params));
- case r_side_effect:
- {
- int se = (long)rexp->params.side_effect;
- if ( in_danger
- && (se >= 0)
- && (params [se].op1 > 0)
- && ( ((enum re_side_effects)params[se].se == re_se_lparen)
- || ((enum re_side_effects)params[se].se == re_se_rparen)))
- return 1;
- else
- return 0;
- }
- }
-
- /* this should never happen */
- return 0;
-}
-
-
-
-static char idempotent_complex_se[] =
-{
-#define RX_WANT_SE_DEFS 1
-#undef RX_DEF_SE
-#undef RX_DEF_CPLX_SE
-#define RX_DEF_SE(IDEM, NAME, VALUE)
-#define RX_DEF_CPLX_SE(IDEM, NAME, VALUE) IDEM,
-#include "rx.h"
-#undef RX_DEF_SE
-#undef RX_DEF_CPLX_SE
-#undef RX_WANT_SE_DEFS
- 23
-};
-
-static char idempotent_se[] =
-{
- 13,
-#define RX_WANT_SE_DEFS 1
-#undef RX_DEF_SE
-#undef RX_DEF_CPLX_SE
-#define RX_DEF_SE(IDEM, NAME, VALUE) IDEM,
-#define RX_DEF_CPLX_SE(IDEM, NAME, VALUE)
-#include "rx.h"
-#undef RX_DEF_SE
-#undef RX_DEF_CPLX_SE
-#undef RX_WANT_SE_DEFS
- 42
-};
-
-
-
-
-#ifdef __STDC__
-static int
-has_any_se (struct rx * rx,
- struct rexp_node * rexp)
-#else
-static int
-has_any_se (rx, rexp)
- struct rx * rx;
- struct rexp_node * rexp;
-#endif
-{
- if (!rexp)
- return 0;
-
- switch (rexp->type)
- {
- case r_cset:
- case r_data:
- return 0;
-
- case r_side_effect:
- return 1;
-
- case r_2phase_star:
- case r_concat:
- case r_alternate:
- return
- ( has_any_se (rx, rexp->params.pair.left)
- || has_any_se (rx, rexp->params.pair.right));
-
- case r_opt:
- case r_star:
- return has_any_se (rx, rexp->params.pair.left);
- }
-
- /* this should never happen */
- return 0;
-}
-
-
-
-/* This must be called AFTER `convert_hard_loops' for a given REXP. */
-#ifdef __STDC__
-static int
-has_non_idempotent_epsilon_path (struct rx * rx,
- struct rexp_node * rexp,
- struct re_se_params * params)
-#else
-static int
-has_non_idempotent_epsilon_path (rx, rexp, params)
- struct rx * rx;
- struct rexp_node * rexp;
- struct re_se_params * params;
-#endif
-{
- if (!rexp)
- return 0;
-
- switch (rexp->type)
- {
- case r_cset:
- case r_data:
- case r_star:
- return 0;
-
- case r_side_effect:
- return
- !((long)rexp->params.side_effect > 0
- ? idempotent_complex_se [ params [(long)rexp->params.side_effect].se ]
- : idempotent_se [-(long)rexp->params.side_effect]);
-
- case r_alternate:
- return
- ( has_non_idempotent_epsilon_path (rx,
- rexp->params.pair.left, params)
- || has_non_idempotent_epsilon_path (rx,
- rexp->params.pair.right, params));
-
- case r_2phase_star:
- case r_concat:
- return
- ( has_non_idempotent_epsilon_path (rx,
- rexp->params.pair.left, params)
- && has_non_idempotent_epsilon_path (rx,
- rexp->params.pair.right, params));
-
- case r_opt:
- return has_non_idempotent_epsilon_path (rx,
- rexp->params.pair.left, params);
- }
-
- /* this should never happen */
- return 0;
-}
-
-
-
-/* This computes rougly what it's name suggests. It can (and does) go wrong
- * in the direction of returning spurious 0 without causing disasters.
- */
-#ifdef __STDC__
-static int
-begins_with_complex_se (struct rx * rx, struct rexp_node * rexp)
-#else
-static int
-begins_with_complex_se (rx, rexp)
- struct rx * rx;
- struct rexp_node * rexp;
-#endif
-{
- if (!rexp)
- return 0;
-
- switch (rexp->type)
- {
- case r_cset:
- case r_data:
- return 0;
-
- case r_side_effect:
- return ((long)rexp->params.side_effect >= 0);
-
- case r_alternate:
- return
- ( begins_with_complex_se (rx, rexp->params.pair.left)
- && begins_with_complex_se (rx, rexp->params.pair.right));
-
-
- case r_concat:
- return has_any_se (rx, rexp->params.pair.left);
- case r_opt:
- case r_star:
- case r_2phase_star:
- return 0;
- }
-
- /* this should never happen */
- return 0;
-}
-
-
-/* This destructively removes some of the re_se_tv side effects from
- * a rexp tree. In particular, during parsing re_se_tv was inserted on the
- * right half of every | to guarantee that posix path preference could be
- * honored. This function removes some which it can be determined aren't
- * needed.
- */
-
-#ifdef __STDC__
-static void
-speed_up_alt (struct rx * rx,
- struct rexp_node * rexp,
- int unposix)
-#else
-static void
-speed_up_alt (rx, rexp, unposix)
- struct rx * rx;
- struct rexp_node * rexp;
- int unposix;
-#endif
-{
- if (!rexp)
- return;
-
- switch (rexp->type)
- {
- case r_cset:
- case r_data:
- case r_side_effect:
- return;
-
- case r_opt:
- case r_star:
- speed_up_alt (rx, rexp->params.pair.left, unposix);
- return;
-
- case r_2phase_star:
- case r_concat:
- speed_up_alt (rx, rexp->params.pair.left, unposix);
- speed_up_alt (rx, rexp->params.pair.right, unposix);
- return;
-
- case r_alternate:
- /* the right child is guaranteed to be (concat re_se_tv <subexp>) */
-
- speed_up_alt (rx, rexp->params.pair.left, unposix);
- speed_up_alt (rx, rexp->params.pair.right->params.pair.right, unposix);
-
- if ( unposix
- || (begins_with_complex_se
- (rx, rexp->params.pair.right->params.pair.right))
- || !( has_any_se (rx, rexp->params.pair.right->params.pair.right)
- || has_any_se (rx, rexp->params.pair.left)))
- {
- struct rexp_node * conc = rexp->params.pair.right;
- rexp->params.pair.right = conc->params.pair.right;
- conc->params.pair.right = 0;
- rx_free_rexp (rx, conc);
- }
- }
-}
-
-
-
-
-
-/* `regex_compile' compiles PATTERN (of length SIZE) according to SYNTAX.
- Returns one of error codes defined in `regex.h', or zero for success.
-
- Assumes the `allocated' (and perhaps `buffer') and `translate'
- fields are set in BUFP on entry.
-
- If it succeeds, results are put in BUFP (if it returns an error, the
- contents of BUFP are undefined):
- `buffer' is the compiled pattern;
- `syntax' is set to SYNTAX;
- `used' is set to the length of the compiled pattern;
- `fastmap_accurate' is set to zero;
- `re_nsub' is set to the number of groups in PATTERN;
- `not_bol' and `not_eol' are set to zero.
-
- The `fastmap' and `newline_anchor' fields are neither
- examined nor set. */
-
-
-
-#ifdef __STDC__
-RX_DECL reg_errcode_t
-rx_compile (__const__ char *pattern, int size,
- reg_syntax_t syntax,
- struct re_pattern_buffer * rxb)
-#else
-RX_DECL reg_errcode_t
-rx_compile (pattern, size, syntax, rxb)
- __const__ char *pattern;
- int size;
- reg_syntax_t syntax;
- struct re_pattern_buffer * rxb;
-#endif
-{
- RX_subset
- inverse_translate [CHAR_SET_SIZE * rx_bitset_numb_subsets(CHAR_SET_SIZE)];
- char
- validate_inv_tr [CHAR_SET_SIZE * rx_bitset_numb_subsets(CHAR_SET_SIZE)];
-
- /* We fetch characters from PATTERN here. Even though PATTERN is
- `char *' (i.e., signed), we declare these variables as unsigned, so
- they can be reliably used as array indices. */
- register unsigned char c, c1;
-
- /* A random tempory spot in PATTERN. */
- __const__ char *p1;
-
- /* Keeps track of unclosed groups. */
- compile_stack_type compile_stack;
-
- /* Points to the current (ending) position in the pattern. */
- __const__ char *p = pattern;
- __const__ char *pend = pattern + size;
-
- /* How to translate the characters in the pattern. */
- unsigned char *translate = (rxb->translate
- ? rxb->translate
- : rx_id_translation);
-
- /* When parsing is done, this will hold the expression tree. */
- struct rexp_node * rexp = 0;
-
- /* In the midst of compilation, this holds onto the regexp
- * first parst while rexp goes on to aquire additional constructs.
- */
- struct rexp_node * orig_rexp = 0;
- struct rexp_node * fewer_side_effects = 0;
-
- /* This and top_expression are saved on the compile stack. */
- struct rexp_node ** top_expression = &rexp;
- struct rexp_node ** last_expression = top_expression;
-
- /* Parameter to `goto append_node' */
- struct rexp_node * append;
-
- /* Counts open-groups as they are encountered. This is the index of the
- * innermost group being compiled.
- */
- regnum_t regnum = 0;
-
- /* Place in the uncompiled pattern (i.e., the {) to
- * which to go back if the interval is invalid.
- */
- __const__ char *beg_interval;
-
- struct re_se_params * params = 0;
- int paramc = 0; /* How many complex side effects so far? */
-
- rx_side_effect side; /* param to `goto add_side_effect' */
-
- bzero (validate_inv_tr, sizeof (validate_inv_tr));
-
- rxb->rx.instruction_table = rx_id_instruction_table;
-
-
- /* Initialize the compile stack. */
- compile_stack.stack = (( compile_stack_elt_t *) malloc ((INIT_COMPILE_STACK_SIZE) * sizeof ( compile_stack_elt_t)));
- if (compile_stack.stack == 0)
- return REG_ESPACE;
-
- compile_stack.size = INIT_COMPILE_STACK_SIZE;
- compile_stack.avail = 0;
-
- /* Initialize the pattern buffer. */
- rxb->rx.cache = &default_cache;
- rxb->syntax = syntax;
- rxb->fastmap_accurate = 0;
- rxb->not_bol = rxb->not_eol = 0;
- rxb->least_subs = 0;
-
- /* Always count groups, whether or not rxb->no_sub is set.
- * The whole pattern is implicitly group 0, so counting begins
- * with 1.
- */
- rxb->re_nsub = 0;
-
-#if !defined (emacs) && !defined (SYNTAX_TABLE)
- /* Initialize the syntax table. */
- init_syntax_once ();
-#endif
-
- /* Loop through the uncompiled pattern until we're at the end. */
- while (p != pend)
- {
- PATFETCH (c);
-
- switch (c)
- {
- case '^':
- {
- if ( /* If at start of pattern, it's an operator. */
- p == pattern + 1
- /* If context independent, it's an operator. */
- || syntax & RE_CONTEXT_INDEP_ANCHORS
- /* Otherwise, depends on what's come before. */
- || at_begline_loc_p (pattern, p, syntax))
- {
- struct rexp_node * n
- = rx_mk_r_side_effect (&rxb->rx, (rx_side_effect)re_se_hat);
- if (!n)
- return REG_ESPACE;
- append = n;
- goto append_node;
- }
- else
- goto normal_char;
- }
- break;
-
-
- case '$':
- {
- if ( /* If at end of pattern, it's an operator. */
- p == pend
- /* If context independent, it's an operator. */
- || syntax & RE_CONTEXT_INDEP_ANCHORS
- /* Otherwise, depends on what's next. */
- || at_endline_loc_p (p, pend, syntax))
- {
- struct rexp_node * n
- = rx_mk_r_side_effect (&rxb->rx, (rx_side_effect)re_se_dollar);
- if (!n)
- return REG_ESPACE;
- append = n;
- goto append_node;
- }
- else
- goto normal_char;
- }
- break;
-
-
- case '+':
- case '?':
- if ((syntax & RE_BK_PLUS_QM)
- || (syntax & RE_LIMITED_OPS))
- goto normal_char;
-
- handle_plus:
- case '*':
- /* If there is no previous pattern... */
- if (pointless_if_repeated (*last_expression, params))
- {
- if (syntax & RE_CONTEXT_INVALID_OPS)
- return REG_BADRPT;
- else if (!(syntax & RE_CONTEXT_INDEP_OPS))
- goto normal_char;
- }
-
- {
- /* 1 means zero (many) matches is allowed. */
- char zero_times_ok = 0, many_times_ok = 0;
-
- /* If there is a sequence of repetition chars, collapse it
- down to just one (the right one). We can't combine
- interval operators with these because of, e.g., `a{2}*',
- which should only match an even number of `a's. */
-
- for (;;)
- {
- zero_times_ok |= c != '+';
- many_times_ok |= c != '?';
-
- if (p == pend)
- break;
-
- PATFETCH (c);
-
- if (c == '*'
- || (!(syntax & RE_BK_PLUS_QM) && (c == '+' || c == '?')))
- ;
-
- else if (syntax & RE_BK_PLUS_QM && c == '\\')
- {
- if (p == pend) return REG_EESCAPE;
-
- PATFETCH (c1);
- if (!(c1 == '+' || c1 == '?'))
- {
- PATUNFETCH;
- PATUNFETCH;
- break;
- }
-
- c = c1;
- }
- else
- {
- PATUNFETCH;
- break;
- }
-
- /* If we get here, we found another repeat character. */
- }
-
- /* Star, etc. applied to an empty pattern is equivalent
- to an empty pattern. */
- if (!last_expression)
- break;
-
- /* Now we know whether or not zero matches is allowed
- * and also whether or not two or more matches is allowed.
- */
-
- {
- struct rexp_node * inner_exp = *last_expression;
- int need_sync = 0;
-
- if (many_times_ok
- && has_non_idempotent_epsilon_path (&rxb->rx,
- inner_exp, params))
- {
- struct rexp_node * pusher
- = rx_mk_r_side_effect (&rxb->rx,
- (rx_side_effect)re_se_pushpos);
- struct rexp_node * checker
- = rx_mk_r_side_effect (&rxb->rx,
- (rx_side_effect)re_se_chkpos);
- struct rexp_node * pushback
- = rx_mk_r_side_effect (&rxb->rx,
- (rx_side_effect)re_se_pushback);
- rx_Bitset cs = rx_cset (&rxb->rx);
- struct rexp_node * lit_t = rx_mk_r_cset (&rxb->rx, cs);
- struct rexp_node * fake_state
- = rx_mk_r_concat (&rxb->rx, pushback, lit_t);
- struct rexp_node * phase2
- = rx_mk_r_concat (&rxb->rx, checker, fake_state);
- struct rexp_node * popper
- = rx_mk_r_side_effect (&rxb->rx,
- (rx_side_effect)re_se_poppos);
- struct rexp_node * star
- = rx_mk_r_2phase_star (&rxb->rx, inner_exp, phase2);
- struct rexp_node * a
- = rx_mk_r_concat (&rxb->rx, pusher, star);
- struct rexp_node * whole_thing
- = rx_mk_r_concat (&rxb->rx, a, popper);
- if (!(pusher && star && pushback && lit_t && fake_state
- && lit_t && phase2 && checker && popper
- && a && whole_thing))
- return REG_ESPACE;
- RX_bitset_enjoin (cs, 't');
- *last_expression = whole_thing;
- }
- else
- {
- struct rexp_node * star =
- (many_times_ok ? rx_mk_r_star : rx_mk_r_opt)
- (&rxb->rx, *last_expression);
- if (!star)
- return REG_ESPACE;
- *last_expression = star;
- need_sync = has_any_se (&rxb->rx, *last_expression);
- }
- if (!zero_times_ok)
- {
- struct rexp_node * concat
- = rx_mk_r_concat (&rxb->rx,
- rx_copy_rexp (&rxb->rx,
- inner_exp),
- *last_expression);
- if (!concat)
- return REG_ESPACE;
- *last_expression = concat;
- }
- if (need_sync)
- {
- int sync_se = paramc;
- params = (params
- ? ((struct re_se_params *)
- realloc (params,
- sizeof (*params) * (1 + paramc)))
- : ((struct re_se_params *)
- malloc (sizeof (*params))));
- if (!params)
- return REG_ESPACE;
- ++paramc;
- params [sync_se].se = re_se_tv;
- side = (rx_side_effect)sync_se;
- goto add_side_effect;
- }
- }
- /* The old regex.c used to optimize `.*\n'.
- * Maybe rx should too?
- */
- }
- break;
-
-
- case '.':
- {
- rx_Bitset cs = rx_cset (&rxb->rx);
- struct rexp_node * n = rx_mk_r_cset (&rxb->rx, cs);
- if (!(cs && n))
- return REG_ESPACE;
-
- rx_bitset_universe (rxb->rx.local_cset_size, cs);
- if (!(rxb->syntax & RE_DOT_NEWLINE))
- RX_bitset_remove (cs, '\n');
- if (!(rxb->syntax & RE_DOT_NOT_NULL))
- RX_bitset_remove (cs, 0);
-
- append = n;
- goto append_node;
- break;
- }
-
-
- case '[':
- if (p == pend) return REG_EBRACK;
- {
- boolean had_char_class = false;
- rx_Bitset cs = rx_cset (&rxb->rx);
- struct rexp_node * node = rx_mk_r_cset (&rxb->rx, cs);
- int is_inverted = *p == '^';
-
- if (!(node && cs))
- return REG_ESPACE;
-
- /* This branch of the switch is normally exited with
- *`goto append_node'
- */
- append = node;
-
- if (is_inverted)
- p++;
-
- /* Remember the first position in the bracket expression. */
- p1 = p;
-
- /* Read in characters and ranges, setting map bits. */
- for (;;)
- {
- if (p == pend) return REG_EBRACK;
-
- PATFETCH (c);
-
- /* \ might escape characters inside [...] and [^...]. */
- if ((syntax & RE_BACKSLASH_ESCAPE_IN_LISTS) && c == '\\')
- {
- if (p == pend) return REG_EESCAPE;
-
- PATFETCH (c1);
- {
- rx_Bitset it = inverse_translation (rxb,
- validate_inv_tr,
- inverse_translate,
- translate,
- c1);
- rx_bitset_union (rxb->rx.local_cset_size, cs, it);
- }
- continue;
- }
-
- /* Could be the end of the bracket expression. If it's
- not (i.e., when the bracket expression is `[]' so
- far), the ']' character bit gets set way below. */
- if (c == ']' && p != p1 + 1)
- goto finalize_class_and_append;
-
- /* Look ahead to see if it's a range when the last thing
- was a character class. */
- if (had_char_class && c == '-' && *p != ']')
- return REG_ERANGE;
-
- /* Look ahead to see if it's a range when the last thing
- was a character: if this is a hyphen not at the
- beginning or the end of a list, then it's the range
- operator. */
- if (c == '-'
- && !(p - 2 >= pattern && p[-2] == '[')
- && !(p - 3 >= pattern && p[-3] == '[' && p[-2] == '^')
- && *p != ']')
- {
- reg_errcode_t ret
- = compile_range (rxb, cs, &p, pend, translate, syntax,
- inverse_translate, validate_inv_tr);
- if (ret != REG_NOERROR) return ret;
- }
-
- else if (p[0] == '-' && p[1] != ']')
- { /* This handles ranges made up of characters only. */
- reg_errcode_t ret;
-
- /* Move past the `-'. */
- PATFETCH (c1);
-
- ret = compile_range (rxb, cs, &p, pend, translate, syntax,
- inverse_translate, validate_inv_tr);
- if (ret != REG_NOERROR) return ret;
- }
-
- /* See if we're at the beginning of a possible character
- class. */
-
- else if ((syntax & RE_CHAR_CLASSES)
- && (c == '[') && (*p == ':'))
- {
- char str[CHAR_CLASS_MAX_LENGTH + 1];
-
- PATFETCH (c);
- c1 = 0;
-
- /* If pattern is `[[:'. */
- if (p == pend) return REG_EBRACK;
-
- for (;;)
- {
- PATFETCH (c);
- if (c == ':' || c == ']' || p == pend
- || c1 == CHAR_CLASS_MAX_LENGTH)
- break;
- str[c1++] = c;
- }
- str[c1] = '\0';
-
- /* If isn't a word bracketed by `[:' and:`]':
- undo the ending character, the letters, and leave
- the leading `:' and `[' (but set bits for them). */
- if (c == ':' && *p == ']')
- {
- int ch;
- boolean is_alnum = !strcmp (str, "alnum");
- boolean is_alpha = !strcmp (str, "alpha");
- boolean is_blank = !strcmp (str, "blank");
- boolean is_cntrl = !strcmp (str, "cntrl");
- boolean is_digit = !strcmp (str, "digit");
- boolean is_graph = !strcmp (str, "graph");
- boolean is_lower = !strcmp (str, "lower");
- boolean is_print = !strcmp (str, "print");
- boolean is_punct = !strcmp (str, "punct");
- boolean is_space = !strcmp (str, "space");
- boolean is_upper = !strcmp (str, "upper");
- boolean is_xdigit = !strcmp (str, "xdigit");
-
- if (!IS_CHAR_CLASS (str)) return REG_ECTYPE;
-
- /* Throw away the ] at the end of the character
- class. */
- PATFETCH (c);
-
- if (p == pend) return REG_EBRACK;
-
- for (ch = 0; ch < 1 << CHARBITS; ch++)
- {
- if ( (is_alnum && isalnum (ch))
- || (is_alpha && isalpha (ch))
- || (is_blank && isblank (ch))
- || (is_cntrl && iscntrl (ch))
- || (is_digit && isdigit (ch))
- || (is_graph && isgraph (ch))
- || (is_lower && islower (ch))
- || (is_print && isprint (ch))
- || (is_punct && ispunct (ch))
- || (is_space && isspace (ch))
- || (is_upper && isupper (ch))
- || (is_xdigit && isxdigit (ch)))
- {
- rx_Bitset it =
- inverse_translation (rxb,
- validate_inv_tr,
- inverse_translate,
- translate,
- ch);
- rx_bitset_union (rxb->rx.local_cset_size,
- cs, it);
- }
- }
- had_char_class = true;
- }
- else
- {
- c1++;
- while (c1--)
- PATUNFETCH;
- {
- rx_Bitset it =
- inverse_translation (rxb,
- validate_inv_tr,
- inverse_translate,
- translate,
- '[');
- rx_bitset_union (rxb->rx.local_cset_size,
- cs, it);
- }
- {
- rx_Bitset it =
- inverse_translation (rxb,
- validate_inv_tr,
- inverse_translate,
- translate,
- ':');
- rx_bitset_union (rxb->rx.local_cset_size,
- cs, it);
- }
- had_char_class = false;
- }
- }
- else
- {
- had_char_class = false;
- {
- rx_Bitset it = inverse_translation (rxb,
- validate_inv_tr,
- inverse_translate,
- translate,
- c);
- rx_bitset_union (rxb->rx.local_cset_size, cs, it);
- }
- }
- }
-
- finalize_class_and_append:
- if (is_inverted)
- {
- rx_bitset_complement (rxb->rx.local_cset_size, cs);
- if (syntax & RE_HAT_LISTS_NOT_NEWLINE)
- RX_bitset_remove (cs, '\n');
- }
- goto append_node;
- }
- break;
-
-
- case '(':
- if (syntax & RE_NO_BK_PARENS)
- goto handle_open;
- else
- goto normal_char;
-
-
- case ')':
- if (syntax & RE_NO_BK_PARENS)
- goto handle_close;
- else
- goto normal_char;
-
-
- case '\n':
- if (syntax & RE_NEWLINE_ALT)
- goto handle_alt;
- else
- goto normal_char;
-
-
- case '|':
- if (syntax & RE_NO_BK_VBAR)
- goto handle_alt;
- else
- goto normal_char;
-
-
- case '{':
- if ((syntax & RE_INTERVALS) && (syntax & RE_NO_BK_BRACES))
- goto handle_interval;
- else
- goto normal_char;
-
-
- case '\\':
- if (p == pend) return REG_EESCAPE;
-
- /* Do not translate the character after the \, so that we can
- distinguish, e.g., \B from \b, even if we normally would
- translate, e.g., B to b. */
- PATFETCH_RAW (c);
-
- switch (c)
- {
- case '(':
- if (syntax & RE_NO_BK_PARENS)
- goto normal_backslash;
-
- handle_open:
- rxb->re_nsub++;
- regnum++;
- if (COMPILE_STACK_FULL)
- {
- ((compile_stack.stack) =
- (compile_stack_elt_t *) realloc (compile_stack.stack, ( compile_stack.size << 1) * sizeof (
- compile_stack_elt_t)));
- if (compile_stack.stack == 0) return REG_ESPACE;
-
- compile_stack.size <<= 1;
- }
-
- if (*last_expression)
- {
- struct rexp_node * concat
- = rx_mk_r_concat (&rxb->rx, *last_expression, 0);
- if (!concat)
- return REG_ESPACE;
- *last_expression = concat;
- last_expression = &concat->params.pair.right;
- }
-
- /*
- * These are the values to restore when we hit end of this
- * group.
- */
- COMPILE_STACK_TOP.top_expression = top_expression;
- COMPILE_STACK_TOP.last_expression = last_expression;
- COMPILE_STACK_TOP.regnum = regnum;
-
- compile_stack.avail++;
-
- top_expression = last_expression;
- break;
-
-
- case ')':
- if (syntax & RE_NO_BK_PARENS) goto normal_backslash;
-
- handle_close:
- /* See similar code for backslashed left paren above. */
- if (COMPILE_STACK_EMPTY)
- if (syntax & RE_UNMATCHED_RIGHT_PAREN_ORD)
- goto normal_char;
- else
- return REG_ERPAREN;
-
- /* Since we just checked for an empty stack above, this
- ``can't happen''. */
-
- {
- /* We don't just want to restore into `regnum', because
- later groups should continue to be numbered higher,
- as in `(ab)c(de)' -- the second group is #2. */
- regnum_t this_group_regnum;
- struct rexp_node ** inner = top_expression;
-
- compile_stack.avail--;
- top_expression = COMPILE_STACK_TOP.top_expression;
- last_expression = COMPILE_STACK_TOP.last_expression;
- this_group_regnum = COMPILE_STACK_TOP.regnum;
- {
- int left_se = paramc;
- int right_se = paramc + 1;
-
- params = (params
- ? ((struct re_se_params *)
- realloc (params,
- (paramc + 2) * sizeof (params[0])))
- : ((struct re_se_params *)
- malloc (2 * sizeof (params[0]))));
- if (!params)
- return REG_ESPACE;
- paramc += 2;
-
- params[left_se].se = re_se_lparen;
- params[left_se].op1 = this_group_regnum;
- params[right_se].se = re_se_rparen;
- params[right_se].op1 = this_group_regnum;
- {
- struct rexp_node * left
- = rx_mk_r_side_effect (&rxb->rx,
- (rx_side_effect)left_se);
- struct rexp_node * right
- = rx_mk_r_side_effect (&rxb->rx,
- (rx_side_effect)right_se);
- struct rexp_node * c1
- = (*inner
- ? rx_mk_r_concat (&rxb->rx, left, *inner) : left);
- struct rexp_node * c2
- = rx_mk_r_concat (&rxb->rx, c1, right);
- if (!(left && right && c1 && c2))
- return REG_ESPACE;
- *inner = c2;
- }
- }
- break;
- }
-
- case '|': /* `\|'. */
- if ((syntax & RE_LIMITED_OPS) || (syntax & RE_NO_BK_VBAR))
- goto normal_backslash;
- handle_alt:
- if (syntax & RE_LIMITED_OPS)
- goto normal_char;
-
- {
- struct rexp_node * alt
- = rx_mk_r_alternate (&rxb->rx, *top_expression, 0);
- if (!alt)
- return REG_ESPACE;
- *top_expression = alt;
- last_expression = &alt->params.pair.right;
- {
- int sync_se = paramc;
-
- params = (params
- ? ((struct re_se_params *)
- realloc (params,
- (paramc + 1) * sizeof (params[0])))
- : ((struct re_se_params *)
- malloc (sizeof (params[0]))));
- if (!params)
- return REG_ESPACE;
- ++paramc;
-
- params[sync_se].se = re_se_tv;
- {
- struct rexp_node * sync
- = rx_mk_r_side_effect (&rxb->rx,
- (rx_side_effect)sync_se);
- struct rexp_node * conc
- = rx_mk_r_concat (&rxb->rx, sync, 0);
-
- if (!sync || !conc)
- return REG_ESPACE;
-
- *last_expression = conc;
- last_expression = &conc->params.pair.right;
- }
- }
- }
- break;
-
-
- case '{':
- /* If \{ is a literal. */
- if (!(syntax & RE_INTERVALS)
- /* If we're at `\{' and it's not the open-interval
- operator. */
- || ((syntax & RE_INTERVALS) && (syntax & RE_NO_BK_BRACES))
- || (p - 2 == pattern && p == pend))
- goto normal_backslash;
-
- handle_interval:
- {
- /* If got here, then the syntax allows intervals. */
-
- /* At least (most) this many matches must be made. */
- int lower_bound = -1, upper_bound = -1;
-
- beg_interval = p - 1;
-
- if (p == pend)
- {
- if (syntax & RE_NO_BK_BRACES)
- goto unfetch_interval;
- else
- return REG_EBRACE;
- }
-
- GET_UNSIGNED_NUMBER (lower_bound);
-
- if (c == ',')
- {
- GET_UNSIGNED_NUMBER (upper_bound);
- if (upper_bound < 0) upper_bound = RE_DUP_MAX;
- }
- else
- /* Interval such as `{1}' => match exactly once. */
- upper_bound = lower_bound;
-
- if (lower_bound < 0 || upper_bound > RE_DUP_MAX
- || lower_bound > upper_bound)
- {
- if (syntax & RE_NO_BK_BRACES)
- goto unfetch_interval;
- else
- return REG_BADBR;
- }
-
- if (!(syntax & RE_NO_BK_BRACES))
- {
- if (c != '\\') return REG_EBRACE;
- PATFETCH (c);
- }
-
- if (c != '}')
- {
- if (syntax & RE_NO_BK_BRACES)
- goto unfetch_interval;
- else
- return REG_BADBR;
- }
-
- /* We just parsed a valid interval. */
-
- /* If it's invalid to have no preceding re. */
- if (pointless_if_repeated (*last_expression, params))
- {
- if (syntax & RE_CONTEXT_INVALID_OPS)
- return REG_BADRPT;
- else if (!(syntax & RE_CONTEXT_INDEP_OPS))
- goto unfetch_interval;
- /* was: else laststart = b; */
- }
-
- /* If the upper bound is zero, don't want to iterate
- * at all.
- */
- if (upper_bound == 0)
- {
- if (*last_expression)
- {
- rx_free_rexp (&rxb->rx, *last_expression);
- *last_expression = 0;
- }
- }
- else
- /* Otherwise, we have a nontrivial interval. */
- {
- int iter_se = paramc;
- int end_se = paramc + 1;
- params = (params
- ? ((struct re_se_params *)
- realloc (params,
- sizeof (*params) * (2 + paramc)))
- : ((struct re_se_params *)
- malloc (2 * sizeof (*params))));
- if (!params)
- return REG_ESPACE;
- paramc += 2;
- params [iter_se].se = re_se_iter;
- params [iter_se].op1 = lower_bound;
- params[iter_se].op2 = upper_bound;
-
- params[end_se].se = re_se_end_iter;
- params[end_se].op1 = lower_bound;
- params[end_se].op2 = upper_bound;
- {
- struct rexp_node * push0
- = rx_mk_r_side_effect (&rxb->rx,
- (rx_side_effect)re_se_push0);
- struct rexp_node * start_one_iter
- = rx_mk_r_side_effect (&rxb->rx,
- (rx_side_effect)iter_se);
- struct rexp_node * phase1
- = rx_mk_r_concat (&rxb->rx, start_one_iter,
- *last_expression);
- struct rexp_node * pushback
- = rx_mk_r_side_effect (&rxb->rx,
- (rx_side_effect)re_se_pushback);
- rx_Bitset cs = rx_cset (&rxb->rx);
- struct rexp_node * lit_t
- = rx_mk_r_cset (&rxb->rx, cs);
- struct rexp_node * phase2
- = rx_mk_r_concat (&rxb->rx, pushback, lit_t);
- struct rexp_node * loop
- = rx_mk_r_2phase_star (&rxb->rx, phase1, phase2);
- struct rexp_node * push_n_loop
- = rx_mk_r_concat (&rxb->rx, push0, loop);
- struct rexp_node * final_test
- = rx_mk_r_side_effect (&rxb->rx,
- (rx_side_effect)end_se);
- struct rexp_node * full_exp
- = rx_mk_r_concat (&rxb->rx, push_n_loop, final_test);
-
- if (!(push0 && start_one_iter && phase1
- && pushback && lit_t && phase2
- && loop && push_n_loop && final_test && full_exp))
- return REG_ESPACE;
-
- RX_bitset_enjoin(cs, 't');
-
- *last_expression = full_exp;
- }
- }
- beg_interval = 0;
- }
- break;
-
- unfetch_interval:
- /* If an invalid interval, match the characters as literals. */
- p = beg_interval;
- beg_interval = 0;
-
- /* normal_char and normal_backslash need `c'. */
- PATFETCH (c);
-
- if (!(syntax & RE_NO_BK_BRACES))
- {
- if (p > pattern && p[-1] == '\\')
- goto normal_backslash;
- }
- goto normal_char;
-
-#ifdef emacs
- /* There is no way to specify the before_dot and after_dot
- operators. rms says this is ok. --karl */
- case '=':
- side = (rx_side_effect)rx_se_at_dot;
- goto add_side_effect;
- break;
-
- case 's':
- case 'S':
- {
- rx_Bitset cs = rx_cset (&rxb->rx);
- struct rexp_node * set = rx_mk_r_cset (&rxb->rx, cs);
- if (!(cs && set))
- return REG_ESPACE;
- if (c == 'S')
- rx_bitset_universe (rxb->rx.local_cset_size, cs);
-
- PATFETCH (c);
- {
- int x;
- enum syntaxcode code = syntax_spec_code [c];
- for (x = 0; x < 256; ++x)
- {
-
- if (SYNTAX (x) == code)
- {
- rx_Bitset it =
- inverse_translation (rxb, validate_inv_tr,
- inverse_translate,
- translate, x);
- rx_bitset_xor (rxb->rx.local_cset_size, cs, it);
- }
- }
- }
- append = set;
- goto append_node;
- }
- break;
-#endif /* emacs */
-
-
- case 'w':
- case 'W':
- {
- rx_Bitset cs = rx_cset (&rxb->rx);
- struct rexp_node * n = (cs ? rx_mk_r_cset (&rxb->rx, cs) : 0);
- if (!(cs && n))
- return REG_ESPACE;
- if (c == 'W')
- rx_bitset_universe (rxb->rx.local_cset_size ,cs);
- {
- int x;
- for (x = rxb->rx.local_cset_size - 1; x > 0; --x)
- if (SYNTAX(x) & Sword)
- RX_bitset_toggle (cs, x);
- }
- append = n;
- goto append_node;
- }
- break;
-
-/* With a little extra work, some of these side effects could be optimized
- * away (basicly by looking at what we already know about the surrounding
- * chars).
- */
- case '<':
- side = (rx_side_effect)re_se_wordbeg;
- goto add_side_effect;
- break;
-
- case '>':
- side = (rx_side_effect)re_se_wordend;
- goto add_side_effect;
- break;
-
- case 'b':
- side = (rx_side_effect)re_se_wordbound;
- goto add_side_effect;
- break;
-
- case 'B':
- side = (rx_side_effect)re_se_notwordbound;
- goto add_side_effect;
- break;
-
- case '`':
- side = (rx_side_effect)re_se_begbuf;
- goto add_side_effect;
- break;
-
- case '\'':
- side = (rx_side_effect)re_se_endbuf;
- goto add_side_effect;
- break;
-
- add_side_effect:
- {
- struct rexp_node * se
- = rx_mk_r_side_effect (&rxb->rx, side);
- if (!se)
- return REG_ESPACE;
- append = se;
- goto append_node;
- }
- break;
-
- case '1': case '2': case '3': case '4': case '5':
- case '6': case '7': case '8': case '9':
- if (syntax & RE_NO_BK_REFS)
- goto normal_char;
-
- c1 = c - '0';
-
- if (c1 > regnum)
- return REG_ESUBREG;
-
- /* Can't back reference to a subexpression if inside of it. */
- if (group_in_compile_stack (compile_stack, c1))
- return REG_ESUBREG;
-
- {
- int backref_se = paramc;
- params = (params
- ? ((struct re_se_params *)
- realloc (params,
- sizeof (*params) * (1 + paramc)))
- : ((struct re_se_params *)
- malloc (sizeof (*params))));
- if (!params)
- return REG_ESPACE;
- ++paramc;
- params[backref_se].se = re_se_backref;
- params[backref_se].op1 = c1;
- side = (rx_side_effect)backref_se;
- goto add_side_effect;
- }
- break;
-
- case '+':
- case '?':
- if (syntax & RE_BK_PLUS_QM)
- goto handle_plus;
- else
- goto normal_backslash;
-
- default:
- normal_backslash:
- /* You might think it would be useful for \ to mean
- not to translate; but if we don't translate it
- it will never match anything. */
- c = TRANSLATE (c);
- goto normal_char;
- }
- break;
-
-
- default:
- /* Expects the character in `c'. */
- normal_char:
- {
- rx_Bitset cs = rx_cset(&rxb->rx);
- struct rexp_node * match = rx_mk_r_cset (&rxb->rx, cs);
- rx_Bitset it;
- if (!(cs && match))
- return REG_ESPACE;
- it = inverse_translation (rxb, validate_inv_tr,
- inverse_translate, translate, c);
- rx_bitset_union (CHAR_SET_SIZE, cs, it);
- append = match;
-
- append_node:
- /* This genericly appends the rexp APPEND to *LAST_EXPRESSION
- * and then parses the next character normally.
- */
- if (*last_expression)
- {
- struct rexp_node * concat
- = rx_mk_r_concat (&rxb->rx, *last_expression, append);
- if (!concat)
- return REG_ESPACE;
- *last_expression = concat;
- last_expression = &concat->params.pair.right;
- }
- else
- *last_expression = append;
- }
- } /* switch (c) */
- } /* while p != pend */
-
-
- {
- int win_se = paramc;
- params = (params
- ? ((struct re_se_params *)
- realloc (params,
- sizeof (*params) * (1 + paramc)))
- : ((struct re_se_params *)
- malloc (sizeof (*params))));
- if (!params)
- return REG_ESPACE;
- ++paramc;
- params[win_se].se = re_se_win;
- {
- struct rexp_node * se
- = rx_mk_r_side_effect (&rxb->rx, (rx_side_effect)win_se);
- struct rexp_node * concat
- = rx_mk_r_concat (&rxb->rx, rexp, se);
- if (!(se && concat))
- return REG_ESPACE;
- rexp = concat;
- }
- }
-
-
- /* Through the pattern now. */
-
- if (!COMPILE_STACK_EMPTY)
- return REG_EPAREN;
-
- free (compile_stack.stack);
-
- orig_rexp = rexp;
-#ifdef RX_DEBUG
- if (rx_debug_compile)
- {
- dbug_rxb = rxb;
- fputs ("\n\nCompiling ", stdout);
- fwrite (pattern, 1, size, stdout);
- fputs (":\n", stdout);
- rxb->se_params = params;
- print_rexp (&rxb->rx, orig_rexp, 2, re_seprint, stdout);
- }
-#endif
- {
- rx_Bitset cs = rx_cset(&rxb->rx);
- rx_Bitset cs2 = rx_cset(&rxb->rx);
- char * se_map = (char *) alloca (paramc);
- struct rexp_node * new_rexp = 0;
-
-
- bzero (se_map, paramc);
- find_backrefs (se_map, rexp, params);
- fewer_side_effects =
- remove_unecessary_side_effects (&rxb->rx, se_map,
- rx_copy_rexp (&rxb->rx, rexp), params);
-
- speed_up_alt (&rxb->rx, rexp, 0);
- speed_up_alt (&rxb->rx, fewer_side_effects, 1);
-
- {
- char * syntax_parens = rxb->syntax_parens;
- if (syntax_parens == (char *)0x1)
- rexp = remove_unecessary_side_effects
- (&rxb->rx, se_map, rexp, params);
- else if (syntax_parens)
- {
- int x;
- for (x = 0; x < paramc; ++x)
- if (( (params[x].se == re_se_lparen)
- || (params[x].se == re_se_rparen))
- && (!syntax_parens [params[x].op1]))
- se_map [x] = 1;
- rexp = remove_unecessary_side_effects
- (&rxb->rx, se_map, rexp, params);
- }
- }
-
- /* At least one more optimization would be nice to have here but i ran out
- * of time. The idea would be to delay side effects.
- * For examle, `(abc)' is the same thing as `abc()' except that the
- * left paren is offset by 3 (which we know at compile time).
- * (In this comment, write that second pattern `abc(:3:)'
- * where `(:3:' is a syntactic unit.)
- *
- * Trickier: `(abc|defg)' is the same as `(abc(:3:|defg(:4:))'
- * (The paren nesting may be hard to follow -- that's an alternation
- * of `abc(:3:' and `defg(:4:' inside (purely syntactic) parens
- * followed by the closing paren from the original expression.)
- *
- * Neither the expression tree representation nor the the nfa make
- * this very easy to write. :(
- */
-
- /* What we compile is different than what the parser returns.
- * Suppose the parser returns expression R.
- * Let R' be R with unnecessary register assignments removed
- * (see REMOVE_UNECESSARY_SIDE_EFFECTS, above).
- *
- * What we will compile is the expression:
- *
- * m{try}R{win}\|s{try}R'{win}
- *
- * {try} and {win} denote side effect epsilons (see EXPLORE_FUTURE).
- *
- * When trying a match, we insert an `m' at the beginning of the
- * string if the user wants registers to be filled, `s' if not.
- */
- new_rexp =
- rx_mk_r_alternate
- (&rxb->rx,
- rx_mk_r_concat (&rxb->rx, rx_mk_r_cset (&rxb->rx, cs2), rexp),
- rx_mk_r_concat (&rxb->rx,
- rx_mk_r_cset (&rxb->rx, cs), fewer_side_effects));
-
- if (!(new_rexp && cs && cs2))
- return REG_ESPACE;
- RX_bitset_enjoin (cs2, '\0'); /* prefixed to the rexp used for matching. */
- RX_bitset_enjoin (cs, '\1'); /* prefixed to the rexp used for searching. */
- rexp = new_rexp;
- }
-
-#ifdef RX_DEBUG
- if (rx_debug_compile)
- {
- fputs ("\n...which is compiled as:\n", stdout);
- print_rexp (&rxb->rx, rexp, 2, re_seprint, stdout);
- }
-#endif
- {
- struct rx_nfa_state *start = 0;
- struct rx_nfa_state *end = 0;
-
- if (!rx_build_nfa (&rxb->rx, rexp, &start, &end))
- return REG_ESPACE; /* */
- else
- {
- void * mem = (void *)rxb->buffer;
- unsigned long size = rxb->allocated;
- int start_id;
- char * perm_mem;
- int iterator_size = paramc * sizeof (params[0]);
-
- end->is_final = 1;
- start->is_start = 1;
- rx_name_nfa_states (&rxb->rx);
- start_id = start->id;
-#ifdef RX_DEBUG
- if (rx_debug_compile)
- {
- fputs ("...giving the NFA: \n", stdout);
- dbug_rxb = rxb;
- print_nfa (&rxb->rx, rxb->rx.nfa_states, re_seprint, stdout);
- }
-#endif
- if (!rx_eclose_nfa (&rxb->rx))
- return REG_ESPACE;
- else
- {
- rx_delete_epsilon_transitions (&rxb->rx);
-
- /* For compatability reasons, we need to shove the
- * compiled nfa into one chunk of malloced memory.
- */
- rxb->rx.reserved = ( sizeof (params[0]) * paramc
- + rx_sizeof_bitset (rxb->rx.local_cset_size));
-#ifdef RX_DEBUG
- if (rx_debug_compile)
- {
- dbug_rxb = rxb;
- fputs ("...which cooks down (uncompactified) to: \n", stdout);
- print_nfa (&rxb->rx, rxb->rx.nfa_states, re_seprint, stdout);
- }
-#endif
- if (!rx_compactify_nfa (&rxb->rx, &mem, &size))
- return REG_ESPACE;
- rxb->buffer = mem;
- rxb->allocated = size;
- rxb->rx.buffer = mem;
- rxb->rx.allocated = size;
- perm_mem = ((char *)rxb->rx.buffer
- + rxb->rx.allocated - rxb->rx.reserved);
- rxb->se_params = ((struct re_se_params *)perm_mem);
- bcopy (params, rxb->se_params, iterator_size);
- perm_mem += iterator_size;
- rxb->fastset = (rx_Bitset) perm_mem;
- rxb->start = rx_id_to_nfa_state (&rxb->rx, start_id);
- }
- rx_bitset_null (rxb->rx.local_cset_size, rxb->fastset);
- rxb->can_match_empty = compute_fastset (rxb, orig_rexp);
- rxb->match_regs_on_stack =
- registers_on_stack (rxb, orig_rexp, 0, params);
- rxb->search_regs_on_stack =
- registers_on_stack (rxb, fewer_side_effects, 0, params);
- if (rxb->can_match_empty)
- rx_bitset_universe (rxb->rx.local_cset_size, rxb->fastset);
- rxb->is_anchored = is_anchored (orig_rexp, (rx_side_effect) re_se_hat);
- rxb->begbuf_only = is_anchored (orig_rexp,
- (rx_side_effect) re_se_begbuf);
- }
- rx_free_rexp (&rxb->rx, rexp);
- if (params)
- free (params);
-#ifdef RX_DEBUG
- if (rx_debug_compile)
- {
- dbug_rxb = rxb;
- fputs ("...which cooks down to: \n", stdout);
- print_nfa (&rxb->rx, rxb->rx.nfa_states, re_seprint, stdout);
- }
-#endif
- }
- return REG_NOERROR;
-}
-
-
-
-/* This table gives an error message for each of the error codes listed
- in regex.h. Obviously the order here has to be same as there. */
-
-__const__ char * rx_error_msg[] =
-{ 0, /* REG_NOERROR */
- "No match", /* REG_NOMATCH */
- "Invalid regular expression", /* REG_BADPAT */
- "Invalid collation character", /* REG_ECOLLATE */
- "Invalid character class name", /* REG_ECTYPE */
- "Trailing backslash", /* REG_EESCAPE */
- "Invalid back reference", /* REG_ESUBREG */
- "Unmatched [ or [^", /* REG_EBRACK */
- "Unmatched ( or \\(", /* REG_EPAREN */
- "Unmatched \\{", /* REG_EBRACE */
- "Invalid content of \\{\\}", /* REG_BADBR */
- "Invalid range end", /* REG_ERANGE */
- "Memory exhausted", /* REG_ESPACE */
- "Invalid preceding regular expression", /* REG_BADRPT */
- "Premature end of regular expression", /* REG_EEND */
- "Regular expression too big", /* REG_ESIZE */
- "Unmatched ) or \\)", /* REG_ERPAREN */
-};
-
-
-
-
-char rx_slowmap [256] =
-{
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-};
-
-#ifdef __STDC__
-RX_DECL void
-rx_blow_up_fastmap (struct re_pattern_buffer * rxb)
-#else
-RX_DECL void
-rx_blow_up_fastmap (rxb)
- struct re_pattern_buffer * rxb;
-#endif
-{
- int x;
- for (x = 0; x < 256; ++x) /* &&&& 3.6 % */
- rxb->fastmap [x] = !!RX_bitset_member (rxb->fastset, x);
- rxb->fastmap_accurate = 1;
-}
-
-
-
-
-#if !defined(REGEX_MALLOC) && !defined(__GNUC__)
-#define RE_SEARCH_2_FN inner_re_search_2
-#define RE_S2_QUAL static
-#else
-#define RE_SEARCH_2_FN re_search_2
-#define RE_S2_QUAL
-#endif
-
-struct re_search_2_closure
-{
- __const__ char * string1;
- int size1;
- __const__ char * string2;
- int size2;
-};
-
-
-static __inline__ enum rx_get_burst_return
-re_search_2_get_burst (pos, vclosure, stop)
- struct rx_string_position * pos;
- void * vclosure;
- int stop;
-{
- struct re_search_2_closure * closure;
- closure = (struct re_search_2_closure *)vclosure;
- if (!closure->string2)
- {
- int inset;
-
- inset = pos->pos - pos->string;
- if ((inset < -1) || (inset > closure->size1))
- return rx_get_burst_no_more;
- else
- {
- pos->pos = (__const__ unsigned char *) closure->string1 + inset;
- pos->string = (__const__ unsigned char *) closure->string1;
- pos->size = closure->size1;
- pos->end = ((__const__ unsigned char *)
- MIN(closure->string1 + closure->size1,
- closure->string1 + stop));
- pos->offset = 0;
- return ((pos->pos < pos->end)
- ? rx_get_burst_ok
- : rx_get_burst_no_more);
- }
- }
- else if (!closure->string1)
- {
- int inset;
-
- inset = pos->pos - pos->string;
- pos->pos = (__const__ unsigned char *) closure->string2 + inset;
- pos->string = (__const__ unsigned char *) closure->string2;
- pos->size = closure->size2;
- pos->end = ((__const__ unsigned char *)
- MIN(closure->string2 + closure->size2,
- closure->string2 + stop));
- pos->offset = 0;
- return ((pos->pos < pos->end)
- ? rx_get_burst_ok
- : rx_get_burst_no_more);
- }
- else
- {
- int inset;
-
- inset = pos->pos - pos->string + pos->offset;
- if (inset < closure->size1)
- {
- pos->pos = (__const__ unsigned char *) closure->string1 + inset;
- pos->string = (__const__ unsigned char *) closure->string1;
- pos->size = closure->size1;
- pos->end = ((__const__ unsigned char *)
- MIN(closure->string1 + closure->size1,
- closure->string1 + stop));
- pos->offset = 0;
- return rx_get_burst_ok;
- }
- else
- {
- pos->pos = ((__const__ unsigned char *)
- closure->string2 + inset - closure->size1);
- pos->string = (__const__ unsigned char *) closure->string2;
- pos->size = closure->size2;
- pos->end = ((__const__ unsigned char *)
- MIN(closure->string2 + closure->size2,
- closure->string2 + stop - closure->size1));
- pos->offset = closure->size1;
- return ((pos->pos < pos->end)
- ? rx_get_burst_ok
- : rx_get_burst_no_more);
- }
- }
-}
-
-
-static __inline__ enum rx_back_check_return
-re_search_2_back_check (pos, lparen, rparen, translate, vclosure, stop)
- struct rx_string_position * pos;
- int lparen;
- int rparen;
- unsigned char * translate;
- void * vclosure;
- int stop;
-{
- struct rx_string_position there;
- struct rx_string_position past;
-
- there = *pos;
- there.pos = there.string + lparen - there.offset;
- re_search_2_get_burst (&there, vclosure, stop);
-
- past = *pos;
- past.pos = past.string + rparen - there.offset;
- re_search_2_get_burst (&past, vclosure, stop);
-
- ++pos->pos;
- re_search_2_get_burst (pos, vclosure, stop);
-
- while ( (there.pos != past.pos)
- && (pos->pos != pos->end))
- if (TRANSLATE(*there.pos) != TRANSLATE(*pos->pos))
- return rx_back_check_fail;
- else
- {
- ++there.pos;
- ++pos->pos;
- if (there.pos == there.end)
- re_search_2_get_burst (&there, vclosure, stop);
- if (pos->pos == pos->end)
- re_search_2_get_burst (pos, vclosure, stop);
- }
-
- if (there.pos != past.pos)
- return rx_back_check_fail;
- --pos->pos;
- re_search_2_get_burst (pos, vclosure, stop);
- return rx_back_check_pass;
-}
-
-static __inline__ int
-re_search_2_fetch_char (pos, offset, app_closure, stop)
- struct rx_string_position * pos;
- int offset;
- void * app_closure;
- int stop;
-{
- struct re_search_2_closure * closure;
- closure = (struct re_search_2_closure *)app_closure;
- if (offset == 0)
- {
- if (pos->pos >= pos->string)
- return *pos->pos;
- else
- {
- if ( (pos->string == (__const__ unsigned char *) closure->string2)
- && (closure->string1)
- && (closure->size1))
- return closure->string1[closure->size1 - 1];
- else
- return 0; /* sure, why not. */
- }
- }
- if (pos->pos == pos->end)
- return *closure->string2;
- else
- return pos->pos[1];
-}
-
-
-#ifdef __STDC__
-RE_S2_QUAL int
-RE_SEARCH_2_FN (struct re_pattern_buffer *rxb,
- __const__ char * string1, int size1,
- __const__ char * string2, int size2,
- int startpos, int range,
- struct re_registers *regs,
- int stop)
-#else
-RE_S2_QUAL int
-RE_SEARCH_2_FN (rxb,
- string1, size1, string2, size2, startpos, range, regs, stop)
- struct re_pattern_buffer *rxb;
- __const__ char * string1;
- int size1;
- __const__ char * string2;
- int size2;
- int startpos;
- int range;
- struct re_registers *regs;
- int stop;
-#endif
-{
- int answer;
- struct re_search_2_closure closure;
- closure.string1 = string1;
- closure.size1 = size1;
- closure.string2 = string2;
- closure.size2 = size2;
- answer = rx_search (rxb, startpos, range, stop, size1 + size2,
- re_search_2_get_burst,
- re_search_2_back_check,
- re_search_2_fetch_char,
- (void *)&closure,
- regs,
- 0,
- 0);
- switch (answer)
- {
- case rx_search_continuation:
- abort ();
- case rx_search_error:
- return -2;
- case rx_search_soft_fail:
- case rx_search_fail:
- return -1;
- default:
- return answer;
- }
-}
-
-/* Export rx_search to callers outside this file. */
-
-int
-re_rx_search (rxb, startpos, range, stop, total_size,
- get_burst, back_check, fetch_char,
- app_closure, regs, resume_state, save_state)
- struct re_pattern_buffer * rxb;
- int startpos;
- int range;
- int stop;
- int total_size;
- rx_get_burst_fn get_burst;
- rx_back_check_fn back_check;
- rx_fetch_char_fn fetch_char;
- void * app_closure;
- struct re_registers * regs;
- struct rx_search_state * resume_state;
- struct rx_search_state * save_state;
-{
- return rx_search (rxb, startpos, range, stop, total_size,
- get_burst, back_check, fetch_char, app_closure,
- regs, resume_state, save_state);
-}
-
-#if !defined(REGEX_MALLOC) && !defined(__GNUC__)
-#ifdef __STDC__
-int
-re_search_2 (struct re_pattern_buffer *rxb,
- __const__ char * string1, int size1,
- __const__ char * string2, int size2,
- int startpos, int range,
- struct re_registers *regs,
- int stop)
-#else
-int
-re_search_2 (rxb, string1, size1, string2, size2, startpos, range, regs, stop)
- struct re_pattern_buffer *rxb;
- __const__ char * string1;
- int size1;
- __const__ char * string2;
- int size2;
- int startpos;
- int range;
- struct re_registers *regs;
- int stop;
-#endif
-{
- int ret;
- ret = inner_re_search_2 (rxb, string1, size1, string2, size2, startpos,
- range, regs, stop);
- alloca (0);
- return ret;
-}
-#endif
-
-
-/* Like re_search_2, above, but only one string is specified, and
- * doesn't let you say where to stop matching.
- */
-
-#ifdef __STDC__
-int
-re_search (struct re_pattern_buffer * rxb, __const__ char *string,
- int size, int startpos, int range,
- struct re_registers *regs)
-#else
-int
-re_search (rxb, string, size, startpos, range, regs)
- struct re_pattern_buffer * rxb;
- __const__ char * string;
- int size;
- int startpos;
- int range;
- struct re_registers *regs;
-#endif
-{
- return re_search_2 (rxb, 0, 0, string, size, startpos, range, regs, size);
-}
-
-#ifdef __STDC__
-int
-re_match_2 (struct re_pattern_buffer * rxb,
- __const__ char * string1, int size1,
- __const__ char * string2, int size2,
- int pos, struct re_registers *regs, int stop)
-#else
-int
-re_match_2 (rxb, string1, size1, string2, size2, pos, regs, stop)
- struct re_pattern_buffer * rxb;
- __const__ char * string1;
- int size1;
- __const__ char * string2;
- int size2;
- int pos;
- struct re_registers *regs;
- int stop;
-#endif
-{
- struct re_registers some_regs;
- regoff_t start;
- regoff_t end;
- int srch;
- int save = rxb->regs_allocated;
- struct re_registers * regs_to_pass = regs;
-
- if (!regs)
- {
- some_regs.start = &start;
- some_regs.end = &end;
- some_regs.num_regs = 1;
- regs_to_pass = &some_regs;
- rxb->regs_allocated = REGS_FIXED;
- }
-
- srch = re_search_2 (rxb, string1, size1, string2, size2,
- pos, 1, regs_to_pass, stop);
- if (regs_to_pass != regs)
- rxb->regs_allocated = save;
- if (srch < 0)
- return srch;
- return regs_to_pass->end[0] - regs_to_pass->start[0];
-}
-
-/* re_match is like re_match_2 except it takes only a single string. */
-
-#ifdef __STDC__
-int
-re_match (struct re_pattern_buffer * rxb,
- __const__ char * string,
- int size, int pos,
- struct re_registers *regs)
-#else
-int
-re_match (rxb, string, size, pos, regs)
- struct re_pattern_buffer * rxb;
- __const__ char *string;
- int size;
- int pos;
- struct re_registers *regs;
-#endif
-{
- return re_match_2 (rxb, string, size, 0, 0, pos, regs, size);
-}
-
-
-
-/* Set by `re_set_syntax' to the current regexp syntax to recognize. Can
- also be assigned to arbitrarily: each pattern buffer stores its own
- syntax, so it can be changed between regex compilations. */
-reg_syntax_t re_syntax_options = RE_SYNTAX_EMACS;
-
-
-/* Specify the precise syntax of regexps for compilation. This provides
- for compatibility for various utilities which historically have
- different, incompatible syntaxes.
-
- The argument SYNTAX is a bit mask comprised of the various bits
- defined in regex.h. We return the old syntax. */
-
-#ifdef __STDC__
-reg_syntax_t
-re_set_syntax (reg_syntax_t syntax)
-#else
-reg_syntax_t
-re_set_syntax (syntax)
- reg_syntax_t syntax;
-#endif
-{
- reg_syntax_t ret = re_syntax_options;
-
- re_syntax_options = syntax;
- return ret;
-}
-
-
-/* Set REGS to hold NUM_REGS registers, storing them in STARTS and
- ENDS. Subsequent matches using PATTERN_BUFFER and REGS will use
- this memory for recording register information. STARTS and ENDS
- must be allocated using the malloc library routine, and must each
- be at least NUM_REGS * sizeof (regoff_t) bytes long.
-
- If NUM_REGS == 0, then subsequent matches should allocate their own
- register data.
-
- Unless this function is called, the first search or match using
- PATTERN_BUFFER will allocate its own register data, without
- freeing the old data. */
-
-#ifdef __STDC__
-void
-re_set_registers (struct re_pattern_buffer *bufp,
- struct re_registers *regs,
- unsigned num_regs,
- regoff_t * starts, regoff_t * ends)
-#else
-void
-re_set_registers (bufp, regs, num_regs, starts, ends)
- struct re_pattern_buffer *bufp;
- struct re_registers *regs;
- unsigned num_regs;
- regoff_t * starts;
- regoff_t * ends;
-#endif
-{
- if (num_regs)
- {
- bufp->regs_allocated = REGS_REALLOCATE;
- regs->num_regs = num_regs;
- regs->start = starts;
- regs->end = ends;
- }
- else
- {
- bufp->regs_allocated = REGS_UNALLOCATED;
- regs->num_regs = 0;
- regs->start = regs->end = (regoff_t) 0;
- }
-}
-
-
-
-
-#ifdef __STDC__
-static int
-cplx_se_sublist_len (struct rx_se_list * list)
-#else
-static int
-cplx_se_sublist_len (list)
- struct rx_se_list * list;
-#endif
-{
- int x = 0;
- while (list)
- {
- if ((long)list->car >= 0)
- ++x;
- list = list->cdr;
- }
- return x;
-}
-
-
-/* For rx->se_list_cmp */
-
-#ifdef __STDC__
-static int
-posix_se_list_order (struct rx * rx,
- struct rx_se_list * a, struct rx_se_list * b)
-#else
-static int
-posix_se_list_order (rx, a, b)
- struct rx * rx;
- struct rx_se_list * a;
- struct rx_se_list * b;
-#endif
-{
- int al = cplx_se_sublist_len (a);
- int bl = cplx_se_sublist_len (b);
-
- if (!al && !bl)
- return ((a == b)
- ? 0
- : ((a < b) ? -1 : 1));
-
- else if (!al)
- return -1;
-
- else if (!bl)
- return 1;
-
- else
- {
- rx_side_effect * av = ((rx_side_effect *)
- alloca (sizeof (rx_side_effect) * (al + 1)));
- rx_side_effect * bv = ((rx_side_effect *)
- alloca (sizeof (rx_side_effect) * (bl + 1)));
- struct rx_se_list * ap = a;
- struct rx_se_list * bp = b;
- int ai, bi;
-
- for (ai = al - 1; ai >= 0; --ai)
- {
- while ((long)ap->car < 0)
- ap = ap->cdr;
- av[ai] = ap->car;
- ap = ap->cdr;
- }
- av[al] = (rx_side_effect)-2;
- for (bi = bl - 1; bi >= 0; --bi)
- {
- while ((long)bp->car < 0)
- bp = bp->cdr;
- bv[bi] = bp->car;
- bp = bp->cdr;
- }
- bv[bl] = (rx_side_effect)-1;
-
- {
- int ret;
- int x = 0;
- while (av[x] == bv[x])
- ++x;
- ret = (((unsigned *)(av[x]) < (unsigned *)(bv[x])) ? -1 : 1);
- return ret;
- }
- }
-}
-
-
-
-
-/* re_compile_pattern is the GNU regular expression compiler: it
- compiles PATTERN (of length SIZE) and puts the result in RXB.
- Returns 0 if the pattern was valid, otherwise an error string.
-
- Assumes the `allocated' (and perhaps `buffer') and `translate' fields
- are set in RXB on entry.
-
- We call rx_compile to do the actual compilation. */
-
-#ifdef __STDC__
-__const__ char *
-re_compile_pattern (__const__ char *pattern,
- int length,
- struct re_pattern_buffer * rxb)
-#else
-__const__ char *
-re_compile_pattern (pattern, length, rxb)
- __const__ char *pattern;
- int length;
- struct re_pattern_buffer * rxb;
-#endif
-{
- reg_errcode_t ret;
-
- /* GNU code is written to assume at least RE_NREGS registers will be set
- (and at least one extra will be -1). */
- rxb->regs_allocated = REGS_UNALLOCATED;
-
- /* And GNU code determines whether or not to get register information
- by passing null for the REGS argument to re_match, etc., not by
- setting no_sub. */
- rxb->no_sub = 0;
-
- rxb->rx.local_cset_size = 256;
-
- /* Match anchors at newline. */
- rxb->newline_anchor = 1;
-
- rxb->re_nsub = 0;
- rxb->start = 0;
- rxb->se_params = 0;
- rxb->rx.nodec = 0;
- rxb->rx.epsnodec = 0;
- rxb->rx.instruction_table = 0;
- rxb->rx.nfa_states = 0;
- rxb->rx.se_list_cmp = posix_se_list_order;
- rxb->rx.start_set = 0;
-
- ret = rx_compile (pattern, length, re_syntax_options, rxb);
- alloca (0);
- return rx_error_msg[(int) ret];
-}
-
-
-
-#ifdef __STDC__
-int
-re_compile_fastmap (struct re_pattern_buffer * rxb)
-#else
-int
-re_compile_fastmap (rxb)
- struct re_pattern_buffer * rxb;
-#endif
-{
- rx_blow_up_fastmap (rxb);
- return 0;
-}
-
-
-
-
-/* Entry points compatible with 4.2 BSD regex library. We don't define
- them if this is an Emacs or POSIX compilation. */
-
-/* Don't build them for libg++ either. This is a temporary measure
- * until the functions are moved to another file and reconditionalized.
- */
-#if 0
-/* #if (!defined (emacs) && !defined (_POSIX_SOURCE)) || defined(USE_BSD_REGEX) */
-
-/* BSD has one and only one pattern buffer. */
-static struct re_pattern_buffer rx_comp_buf;
-
-#ifdef __STDC__
-char *
-re_comp (__const__ char *s)
-#else
-char *
-re_comp (s)
- __const__ char *s;
-#endif
-{
- reg_errcode_t ret;
-
- if (!s || (*s == '\0'))
- {
- if (!rx_comp_buf.buffer)
- return "No previous regular expression";
- return 0;
- }
-
- if (!rx_comp_buf.fastmap)
- {
- rx_comp_buf.fastmap = (char *) malloc (1 << CHARBITS);
- if (!rx_comp_buf.fastmap)
- return "Memory exhausted";
- }
-
- /* Since `rx_exec' always passes NULL for the `regs' argument, we
- don't need to initialize the pattern buffer fields which affect it. */
-
- /* Match anchors at newlines. */
- rx_comp_buf.newline_anchor = 1;
-
- rx_comp_buf.fastmap_accurate = 0;
- rx_comp_buf.re_nsub = 0;
- rx_comp_buf.start = 0;
- rx_comp_buf.se_params = 0;
- rx_comp_buf.rx.nodec = 0;
- rx_comp_buf.rx.epsnodec = 0;
- rx_comp_buf.rx.instruction_table = 0;
- rx_comp_buf.rx.nfa_states = 0;
- rx_comp_buf.rx.start = 0;
- rx_comp_buf.rx.se_list_cmp = posix_se_list_order;
- rx_comp_buf.rx.start_set = 0;
- rx_comp_buf.rx.local_cset_size = 256;
-
- ret = rx_compile (s, strlen (s), re_syntax_options, &rx_comp_buf);
- alloca (0);
-
- /* Yes, we're discarding `__const__' here. */
- return (char *) rx_error_msg[(int) ret];
-}
-
-
-#ifdef __STDC__
-int
-re_exec (__const__ char *s)
-#else
-int
-re_exec (s)
- __const__ char *s;
-#endif
-{
- __const__ int len = strlen (s);
- return
- 0 <= re_search (&rx_comp_buf, s, len, 0, len, (struct re_registers *) 0);
-}
-#endif /* not emacs and not _POSIX_SOURCE */
-
-
-
-/* POSIX.2 functions. Don't define these for Emacs. */
-
-/* For now we leave these out, because regex_t is not binary
- compatible with the implementation in other systems. */
-#if 0 /*!defined(emacs)*/
-
-/* regcomp takes a regular expression as a string and compiles it.
-
- PREG is a regex_t *. We do not expect any fields to be initialized,
- since POSIX says we shouldn't. Thus, we set
-
- `buffer' to the compiled pattern;
- `used' to the length of the compiled pattern;
- `syntax' to RE_SYNTAX_POSIX_EXTENDED if the
- REG_EXTENDED bit in CFLAGS is set; otherwise, to
- RE_SYNTAX_POSIX_BASIC;
- `newline_anchor' to REG_NEWLINE being set in CFLAGS;
- `fastmap' and `fastmap_accurate' to zero;
- `re_nsub' to the number of subexpressions in PATTERN.
-
- PATTERN is the address of the pattern string.
-
- CFLAGS is a series of bits which affect compilation.
-
- If REG_EXTENDED is set, we use POSIX extended syntax; otherwise, we
- use POSIX basic syntax.
-
- If REG_NEWLINE is set, then . and [^...] don't match newline.
- Also, regexec will try a match beginning after every newline.
-
- If REG_ICASE is set, then we considers upper- and lowercase
- versions of letters to be equivalent when matching.
-
- If REG_NOSUB is set, then when PREG is passed to regexec, that
- routine will report only success or failure, and nothing about the
- registers.
-
- It returns 0 if it succeeds, nonzero if it doesn't. (See regex.h for
- the return codes and their meanings.) */
-
-
-#ifdef __STDC__
-int
-regcomp (regex_t * preg, __const__ char * pattern, int cflags)
-#else
-int
-regcomp (preg, pattern, cflags)
- regex_t * preg;
- __const__ char * pattern;
- int cflags;
-#endif
-{
- reg_errcode_t ret;
- unsigned syntax
- = cflags & REG_EXTENDED ? RE_SYNTAX_POSIX_EXTENDED : RE_SYNTAX_POSIX_BASIC;
-
- /* regex_compile will allocate the space for the compiled pattern. */
- preg->buffer = 0;
- preg->allocated = 0;
- preg->fastmap = malloc (256);
- if (!preg->fastmap)
- return REG_ESPACE;
- preg->fastmap_accurate = 0;
-
- if (cflags & REG_ICASE)
- {
- unsigned i;
-
- preg->translate = (unsigned char *) malloc (256);
- if (!preg->translate)
- return (int) REG_ESPACE;
-
- /* Map uppercase characters to corresponding lowercase ones. */
- for (i = 0; i < CHAR_SET_SIZE; i++)
- preg->translate[i] = isupper (i) ? tolower (i) : i;
- }
- else
- preg->translate = 0;
-
- /* If REG_NEWLINE is set, newlines are treated differently. */
- if (cflags & REG_NEWLINE)
- { /* REG_NEWLINE implies neither . nor [^...] match newline. */
- syntax &= ~RE_DOT_NEWLINE;
- syntax |= RE_HAT_LISTS_NOT_NEWLINE;
- /* It also changes the matching behavior. */
- preg->newline_anchor = 1;
- }
- else
- preg->newline_anchor = 0;
-
- preg->no_sub = !!(cflags & REG_NOSUB);
-
- /* POSIX says a null character in the pattern terminates it, so we
- can use strlen here in compiling the pattern. */
- preg->re_nsub = 0;
- preg->start = 0;
- preg->se_params = 0;
- preg->syntax_parens = 0;
- preg->rx.nodec = 0;
- preg->rx.epsnodec = 0;
- preg->rx.instruction_table = 0;
- preg->rx.nfa_states = 0;
- preg->rx.local_cset_size = 256;
- preg->rx.start = 0;
- preg->rx.se_list_cmp = posix_se_list_order;
- preg->rx.start_set = 0;
- ret = rx_compile (pattern, strlen (pattern), syntax, preg);
- alloca (0);
-
- /* POSIX doesn't distinguish between an unmatched open-group and an
- unmatched close-group: both are REG_EPAREN. */
- if (ret == REG_ERPAREN) ret = REG_EPAREN;
-
- return (int) ret;
-}
-
-
-/* regexec searches for a given pattern, specified by PREG, in the
- string STRING.
-
- If NMATCH is zero or REG_NOSUB was set in the cflags argument to
- `regcomp', we ignore PMATCH. Otherwise, we assume PMATCH has at
- least NMATCH elements, and we set them to the offsets of the
- corresponding matched substrings.
-
- EFLAGS specifies `execution flags' which affect matching: if
- REG_NOTBOL is set, then ^ does not match at the beginning of the
- string; if REG_NOTEOL is set, then $ does not match at the end.
-
- We return 0 if we find a match and REG_NOMATCH if not. */
-
-#ifdef __STDC__
-int
-regexec (__const__ regex_t *preg, __const__ char *string,
- size_t nmatch, regmatch_t pmatch[],
- int eflags)
-#else
-int
-regexec (preg, string, nmatch, pmatch, eflags)
- __const__ regex_t *preg;
- __const__ char *string;
- size_t nmatch;
- regmatch_t pmatch[];
- int eflags;
-#endif
-{
- int ret;
- struct re_registers regs;
- regex_t private_preg;
- int len = strlen (string);
- boolean want_reg_info = !preg->no_sub && nmatch > 0;
-
- private_preg = *preg;
-
- private_preg.not_bol = !!(eflags & REG_NOTBOL);
- private_preg.not_eol = !!(eflags & REG_NOTEOL);
-
- /* The user has told us exactly how many registers to return
- * information about, via `nmatch'. We have to pass that on to the
- * matching routines.
- */
- private_preg.regs_allocated = REGS_FIXED;
-
- if (want_reg_info)
- {
- regs.num_regs = nmatch;
- regs.start = (( regoff_t *) malloc ((nmatch) * sizeof ( regoff_t)));
- regs.end = (( regoff_t *) malloc ((nmatch) * sizeof ( regoff_t)));
- if (regs.start == 0 || regs.end == 0)
- return (int) REG_NOMATCH;
- }
-
- /* Perform the searching operation. */
- ret = re_search (&private_preg,
- string, len,
- /* start: */ 0,
- /* range: */ len,
- want_reg_info ? &regs : (struct re_registers *) 0);
-
- /* Copy the register information to the POSIX structure. */
- if (want_reg_info)
- {
- if (ret >= 0)
- {
- unsigned r;
-
- for (r = 0; r < nmatch; r++)
- {
- pmatch[r].rm_so = regs.start[r];
- pmatch[r].rm_eo = regs.end[r];
- }
- }
-
- /* If we needed the temporary register info, free the space now. */
- free (regs.start);
- free (regs.end);
- }
-
- /* We want zero return to mean success, unlike `re_search'. */
- return ret >= 0 ? (int) REG_NOERROR : (int) REG_NOMATCH;
-}
-
-
-/* Returns a message corresponding to an error code, ERRCODE, returned
- from either regcomp or regexec. */
-
-#ifdef __STDC__
-size_t
-regerror (int errcode, __const__ regex_t *preg,
- char *errbuf, size_t errbuf_size)
-#else
-size_t
-regerror (errcode, preg, errbuf, errbuf_size)
- int errcode;
- __const__ regex_t *preg;
- char *errbuf;
- size_t errbuf_size;
-#endif
-{
- __const__ char *msg
- = rx_error_msg[errcode] == 0 ? "Success" : rx_error_msg[errcode];
- size_t msg_size = strlen (msg) + 1; /* Includes the 0. */
-
- if (errbuf_size != 0)
- {
- if (msg_size > errbuf_size)
- {
- strncpy (errbuf, msg, errbuf_size - 1);
- errbuf[errbuf_size - 1] = 0;
- }
- else
- strcpy (errbuf, msg);
- }
-
- return msg_size;
-}
-
-
-/* Free dynamically allocated space used by PREG. */
-
-#ifdef __STDC__
-void
-regfree (regex_t *preg)
-#else
-void
-regfree (preg)
- regex_t *preg;
-#endif
-{
- if (preg->buffer != 0)
- free (preg->buffer);
- preg->buffer = 0;
- preg->allocated = 0;
-
- if (preg->fastmap != 0)
- free (preg->fastmap);
- preg->fastmap = 0;
- preg->fastmap_accurate = 0;
-
- if (preg->translate != 0)
- free (preg->translate);
- preg->translate = 0;
-}
-
-#endif /* not emacs */
diff --git a/contrib/libg++/librx/rx.h b/contrib/libg++/librx/rx.h
deleted file mode 100644
index 60f99e199e28..000000000000
--- a/contrib/libg++/librx/rx.h
+++ /dev/null
@@ -1,3732 +0,0 @@
-#if !defined(RXH) || defined(RX_WANT_SE_DEFS)
-#define RXH
-
-/* Copyright (C) 1992, 1993 Free Software Foundation, Inc.
-
-This file is part of the librx library.
-
-Librx 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, or (at your option)
-any later version.
-
-Librx 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 Library General Public
-License along with this software; see the file COPYING.LIB. If not,
-write to the Free Software Foundation, 675 Mass Ave, Cambridge, MA
-02139, USA. */
-/* t. lord Wed Sep 23 18:20:57 1992 */
-
-
-
-
-
-
-
-
-#ifndef RX_WANT_SE_DEFS
-
-/* This page: Bitsets */
-
-#ifndef RX_subset
-typedef unsigned int RX_subset;
-#define RX_subset_bits (32)
-#define RX_subset_mask (RX_subset_bits - 1)
-#endif
-
-typedef RX_subset * rx_Bitset;
-
-#ifdef __STDC__
-typedef void (*rx_bitset_iterator) (void *, int member_index);
-#else
-typedef void (*rx_bitset_iterator) ();
-#endif
-
-#define rx_bitset_subset(N) ((N) / RX_subset_bits)
-#define rx_bitset_subset_val(B,N) ((B)[rx_bitset_subset(N)])
-#define RX_bitset_access(B,N,OP) \
- ((B)[rx_bitset_subset(N)] OP rx_subset_singletons[(N) & RX_subset_mask])
-#define RX_bitset_member(B,N) RX_bitset_access(B, N, &)
-#define RX_bitset_enjoin(B,N) RX_bitset_access(B, N, |=)
-#define RX_bitset_remove(B,N) RX_bitset_access(B, N, &= ~)
-#define RX_bitset_toggle(B,N) RX_bitset_access(B, N, ^= )
-#define rx_bitset_numb_subsets(N) (((N) + RX_subset_bits - 1) / RX_subset_bits)
-#define rx_sizeof_bitset(N) (rx_bitset_numb_subsets(N) * sizeof(RX_subset))
-
-
-
-/* This page: Splay trees. */
-
-#ifdef __STDC__
-typedef int (*rx_sp_comparer) (void * a, void * b);
-#else
-typedef int (*rx_sp_comparer) ();
-#endif
-
-struct rx_sp_node
-{
- void * key;
- void * data;
- struct rx_sp_node * kids[2];
-};
-
-#ifdef __STDC__
-typedef void (*rx_sp_key_data_freer) (struct rx_sp_node *);
-#else
-typedef void (*rx_sp_key_data_freer) ();
-#endif
-
-
-/* giant inflatable hash trees */
-
-struct rx_hash_item
-{
- struct rx_hash_item * next_same_hash;
- struct rx_hash * table;
- unsigned long hash;
- void * data;
- void * binding;
-};
-
-struct rx_hash
-{
- struct rx_hash * parent;
- int refs;
- struct rx_hash * children[13];
- struct rx_hash_item * buckets [13];
- int bucket_size [13];
-};
-
-struct rx_hash_rules;
-
-#ifdef __STDC__
-/* should return like == */
-typedef int (*rx_hash_eq)(void *, void *);
-typedef struct rx_hash * (*rx_alloc_hash)(struct rx_hash_rules *);
-typedef void (*rx_free_hash)(struct rx_hash *,
- struct rx_hash_rules *);
-typedef struct rx_hash_item * (*rx_alloc_hash_item)(struct rx_hash_rules *,
- void *);
-typedef void (*rx_free_hash_item)(struct rx_hash_item *,
- struct rx_hash_rules *);
-#else
-typedef int (*rx_hash_eq)();
-typedef struct rx_hash * (*rx_alloc_hash)();
-typedef void (*rx_free_hash)();
-typedef struct rx_hash_item * (*rx_alloc_hash_item)();
-typedef void (*rx_free_hash_item)();
-#endif
-
-struct rx_hash_rules
-{
- rx_hash_eq eq;
- rx_alloc_hash hash_alloc;
- rx_free_hash free_hash;
- rx_alloc_hash_item hash_item_alloc;
- rx_free_hash_item free_hash_item;
-};
-
-
-/* Forward declarations */
-
-struct rx_cache;
-struct rx_superset;
-struct rx;
-struct rx_se_list;
-
-
-
-/*
- * GLOSSARY
- *
- * regexp
- * regular expression
- * expression
- * pattern - a `regular' expression. The expression
- * need not be formally regular -- it can contain
- * constructs that don't correspond to purely regular
- * expressions.
- *
- * buffer
- * string - the string (or strings) being searched or matched.
- *
- * pattern buffer - a structure of type `struct re_pattern_buffer'
- * This in turn contains a `struct rx', which holds the
- * NFA compiled from a pattern, as well as some of the state
- * of a matcher using the pattern.
- *
- * NFA - nondeterministic finite automata. Some people
- * use this term to a member of the class of
- * regular automata (those corresponding to a regular
- * language). However, in this code, the meaning is
- * more general. The automata used by Rx are comperable
- * in power to what are usually called `push down automata'.
- *
- * Two NFA are built by rx for every pattern. One is built
- * by the compiler. The other is built from the first, on
- * the fly, by the matcher. The latter is called the `superstate
- * NFA' because its states correspond to sets of states from
- * the first NFA. (Joe Keane gets credit for the name
- * `superstate NFA').
- *
- * NFA edges
- * epsilon edges
- * side-effect edges - The NFA compiled from a pattern can have three
- * kinds of edges. Epsilon edges can be taken freely anytime
- * their source state is reached. Character set edges can be
- * taken when their source state is reached and when the next
- * character in the buffer is a member of the set. Side effect
- * edges imply a transition that can only be taken after the
- * indicated side effect has been successfully accomplished.
- * Some examples of side effects are:
- *
- * Storing the current match position to record the
- * location of a parentesized subexpression.
- *
- * Advancing the matcher over N characters if they
- * match the N characters previously matched by a
- * parentesized subexpression.
- *
- * Both of those kinds of edges occur in the NFA generated
- * by the pattern: \(.\)\1
- *
- * Epsilon and side effect edges are similar. Unfortunately,
- * some of the code uses the name `epsilon edge' to mean
- * both epsilon and side effect edges. For example, the
- * function has_non_idempotent_epsilon_path computes the existance
- * of a non-trivial path containing only a mix of epsilon and
- * side effect edges. In that case `nonidempotent epsilon' is being
- * used to mean `side effect'.
- */
-
-
-
-
-
-/* LOW LEVEL PATTERN BUFFERS */
-
-/* Suppose that from some NFA state, more than one path through
- * side-effect edges is possible. In what order should the paths
- * be tried? A function of type rx_se_list_order answers that
- * question. It compares two lists of side effects, and says
- * which list comes first.
- */
-
-#ifdef __STDC__
-typedef int (*rx_se_list_order) (struct rx *,
- struct rx_se_list *,
- struct rx_se_list *);
-#else
-typedef int (*rx_se_list_order) ();
-#endif
-
-
-
-/* Struct RX holds a compiled regular expression - that is, an nfa
- * ready to be converted on demand to a more efficient superstate nfa.
- * This is for the low level interface. The high-level interfaces enclose
- * this in a `struct re_pattern_buffer'.
- */
-struct rx
-{
- /* The compiler assigns a unique id to every pattern.
- * Like sequence numbers in X, there is a subtle bug here
- * if you use Rx in a system that runs for a long time.
- * But, because of the way the caches work out, it is almost
- * impossible to trigger the Rx version of this bug.
- *
- * The id is used to validate superstates found in a cache
- * of superstates. It isn't sufficient to let a superstate
- * point back to the rx for which it was compiled -- the caller
- * may be re-using a `struct rx' in which case the superstate
- * is not really valid. So instead, superstates are validated
- * by checking the sequence number of the pattern for which
- * they were built.
- */
- int rx_id;
-
- /* This is memory mgt. state for superstates. This may be
- * shared by more than one struct rx.
- */
- struct rx_cache * cache;
-
- /* Every regex defines the size of its own character set.
- * A superstate has an array of this size, with each element
- * a `struct rx_inx'. So, don't make this number too large.
- * In particular, don't make it 2^16.
- */
- int local_cset_size;
-
- /* After the NFA is built, it is copied into a contiguous region
- * of memory (mostly for compatability with GNU regex).
- * Here is that region, and it's size:
- */
- void * buffer;
- unsigned long allocated;
-
- /* Clients of RX can ask for some extra storage in the space pointed
- * to by BUFFER. The field RESERVED is an input parameter to the
- * compiler. After compilation, this much space will be available
- * at (buffer + allocated - reserved)
- */
- unsigned long reserved;
-
- /* --------- The remaining fields are for internal use only. --------- */
- /* --------- But! they must be initialized to 0. --------- */
-
- /* NODEC is the number of nodes in the NFA with non-epsilon
- * transitions.
- */
- int nodec;
-
- /* EPSNODEC is the number of nodes with only epsilon transitions. */
- int epsnodec;
-
- /* The sum (NODEC + EPSNODEC) is the total number of states in the
- * compiled NFA.
- */
-
- /* Lists of side effects as stored in the NFA are `hash consed'..meaning
- * that lists with the same elements are ==. During compilation,
- * this table facilitates hash-consing.
- */
- struct rx_hash se_list_memo;
-
- /* Lists of NFA states are also hashed.
- */
- struct rx_hash set_list_memo;
-
-
-
-
- /* The compiler and matcher must build a number of instruction frames.
- * The format of these frames is fixed (c.f. struct rx_inx). The values
- * of the instructions is not fixed.
- *
- * An enumerated type (enum rx_opcode) defines the set of instructions
- * that the compiler or matcher might generate. When filling an instruction
- * frame, the INX field is found by indexing this instruction table
- * with an opcode:
- */
- void ** instruction_table;
-
- /* The list of all states in an NFA.
- * During compilation, the NEXT field of NFA states links this list.
- * After compilation, all the states are compacted into an array,
- * ordered by state id numbers. At that time, this points to the base
- * of that array.
- */
- struct rx_nfa_state *nfa_states;
-
- /* Every nfa begins with one distinguished starting state:
- */
- struct rx_nfa_state *start;
-
- /* This orders the search through super-nfa paths.
- * See the comment near the typedef of rx_se_list_order.
- */
- rx_se_list_order se_list_cmp;
-
- struct rx_superset * start_set;
-};
-
-
-
-
-/* SYNTAX TREES */
-
-/* Compilation is in stages.
- *
- * In the first stage, a pattern specified by a string is
- * translated into a syntax tree. Later stages will convert
- * the syntax tree into an NFA optimized for conversion to a
- * superstate-NFA.
- *
- * This page is about syntax trees.
- */
-
-enum rexp_node_type
-{
- r_cset, /* Match from a character set. `a' or `[a-z]'*/
- r_concat, /* Concat two subexpressions. `ab' */
- r_alternate, /* Choose one of two subexpressions. `a\|b' */
- r_opt, /* Optional subexpression. `a?' */
- r_star, /* Repeated subexpression. `a*' */
-
-
- /* A 2phase-star is a variation on a repeated subexpression.
- * In this case, there are two subexpressions. The first, if matched,
- * begins a repitition (otherwise, the whole expression is matches the
- * empth string).
- *
- * After matching the first subexpression, a 2phase star either finishes,
- * or matches the second subexpression. If the second subexpression is
- * matched, then the whole construct repeats.
- *
- * 2phase stars are used in two circumstances. First, they
- * are used as part of the implementation of POSIX intervals (counted
- * repititions). Second, they are used to implement proper star
- * semantics when the repeated subexpression contains paths of
- * only side effects. See rx_compile for more information.
- */
- r_2phase_star,
-
-
- /* c.f. "typedef void * rx_side_effect" */
- r_side_effect,
-
- /* This is an extension type: It is for transient use in source->source
- * transformations (implemented over syntax trees).
- */
- r_data
-};
-
-/* A side effect is a matcher-specific action associated with
- * transitions in the NFA. The details of side effects are up
- * to the matcher. To the compiler and superstate constructors
- * side effects are opaque:
- */
-
-typedef void * rx_side_effect;
-
-/* Nodes in a syntax tree are of this type:
- */
-struct rexp_node
-{
- enum rexp_node_type type;
- union
- {
- rx_Bitset cset;
- rx_side_effect side_effect;
- struct
- {
- struct rexp_node *left;
- struct rexp_node *right;
- } pair;
- void * data;
- } params;
-};
-
-
-
-/* NFA
- *
- * A syntax tree is compiled into an NFA. This page defines the structure
- * of that NFA.
- */
-
-struct rx_nfa_state
-{
- /* These are kept in a list as the NFA is being built. */
- struct rx_nfa_state *next;
-
- /* After the NFA is built, states are given integer id's.
- * States whose outgoing transitions are all either epsilon or
- * side effect edges are given ids less than 0. Other states
- * are given successive non-negative ids starting from 0.
- */
- int id;
-
- /* The list of NFA edges that go from this state to some other. */
- struct rx_nfa_edge *edges;
-
- /* If you land in this state, then you implicitly land
- * in all other states reachable by only epsilon translations.
- * Call the set of maximal paths to such states the epsilon closure
- * of this state.
- *
- * There may be other states that are reachable by a mixture of
- * epsilon and side effect edges. Consider the set of maximal paths
- * of that sort from this state. Call it the epsilon-side-effect
- * closure of the state.
- *
- * The epsilon closure of the state is a subset of the epsilon-side-
- * effect closure. It consists of all the paths that contain
- * no side effects -- only epsilon edges.
- *
- * The paths in the epsilon-side-effect closure can be partitioned
- * into equivalance sets. Two paths are equivalant if they have the
- * same set of side effects, in the same order. The epsilon-closure
- * is one of these equivalance sets. Let's call these equivalance
- * sets: observably equivalant path sets. That name is chosen
- * because equivalance of two paths means they cause the same side
- * effects -- so they lead to the same subsequent observations other
- * than that they may wind up in different target states.
- *
- * The superstate nfa, which is derived from this nfa, is based on
- * the observation that all of the paths in an observably equivalant
- * path set can be explored at the same time, provided that the
- * matcher keeps track not of a single nfa state, but of a set of
- * states. In particular, after following all the paths in an
- * observably equivalant set, you wind up at a set of target states.
- * That set of target states corresponds to one state in the
- * superstate NFA.
- *
- * Staticly, before matching begins, it is convenient to analyze the
- * nfa. Each state is labeled with a list of the observably
- * equivalant path sets who's union covers all the
- * epsilon-side-effect paths beginning in this state. This list is
- * called the possible futures of the state.
- *
- * A trivial example is this NFA:
- * s1
- * A ---> B
- *
- * s2
- * ---> C
- *
- * epsilon s1
- * ---------> D ------> E
- *
- *
- * In this example, A has two possible futures.
- * One invokes the side effect `s1' and contains two paths,
- * one ending in state B, the other in state E.
- * The other invokes the side effect `s2' and contains only
- * one path, landing in state C.
- */
- struct rx_possible_future *futures;
-
-
- /* There are exactly two distinguished states in every NFA: */
- unsigned int is_final:1;
- unsigned int is_start:1;
-
- /* These are used during NFA construction... */
- unsigned int eclosure_needed:1;
- unsigned int mark:1;
-};
-
-
-/* An edge in an NFA is typed: */
-enum rx_nfa_etype
-{
- /* A cset edge is labled with a set of characters one of which
- * must be matched for the edge to be taken.
- */
- ne_cset,
-
- /* An epsilon edge is taken whenever its starting state is
- * reached.
- */
- ne_epsilon,
-
- /* A side effect edge is taken whenever its starting state is
- * reached. Side effects may cause the match to fail or the
- * position of the matcher to advance.
- */
- ne_side_effect /* A special kind of epsilon. */
-};
-
-struct rx_nfa_edge
-{
- struct rx_nfa_edge *next;
- enum rx_nfa_etype type;
- struct rx_nfa_state *dest;
- union
- {
- rx_Bitset cset;
- rx_side_effect side_effect;
- } params;
-};
-
-
-
-/* A possible future consists of a list of side effects
- * and a set of destination states. Below are their
- * representations. These structures are hash-consed which
- * means that lists with the same elements share a representation
- * (their addresses are ==).
- */
-
-struct rx_nfa_state_set
-{
- struct rx_nfa_state * car;
- struct rx_nfa_state_set * cdr;
-};
-
-struct rx_se_list
-{
- rx_side_effect car;
- struct rx_se_list * cdr;
-};
-
-struct rx_possible_future
-{
- struct rx_possible_future *next;
- struct rx_se_list * effects;
- struct rx_nfa_state_set * destset;
-};
-
-
-
-/* This begins the description of the superstate NFA.
- *
- * The superstate NFA corresponds to the NFA in these ways:
- *
- * Every superstate NFA states SUPER correspond to sets of NFA states,
- * nfa_states(SUPER).
- *
- * Superstate edges correspond to NFA paths.
- *
- * The superstate has no epsilon transitions;
- * every edge has a character label, and a (possibly empty) side
- * effect label. The side effect label corresponds to a list of
- * side effects that occur in the NFA. These parts are referred
- * to as: superedge_character(EDGE) and superedge_sides(EDGE).
- *
- * For a superstate edge EDGE starting in some superstate SUPER,
- * the following is true (in pseudo-notation :-):
- *
- * exists DEST in nfa_states s.t.
- * exists nfaEDGE in nfa_edges s.t.
- * origin (nfaEDGE) == DEST
- * && origin (nfaEDGE) is a member of nfa_states(SUPER)
- * && exists PF in possible_futures(dest(nfaEDGE)) s.t.
- * sides_of_possible_future (PF) == superedge_sides (EDGE)
- *
- * also:
- *
- * let SUPER2 := superedge_destination(EDGE)
- * nfa_states(SUPER2)
- * == union of all nfa state sets S s.t.
- * exists PF in possible_futures(dest(nfaEDGE)) s.t.
- * sides_of_possible_future (PF) == superedge_sides (EDGE)
- * && S == dests_of_possible_future (PF) }
- *
- * Or in english, every superstate is a set of nfa states. A given
- * character and a superstate implies many transitions in the NFA --
- * those that begin with an edge labeled with that character from a
- * state in the set corresponding to the superstate.
- *
- * The destinations of those transitions each have a set of possible
- * futures. A possible future is a list of side effects and a set of
- * destination NFA states. Two sets of possible futures can be
- * `merged' by combining all pairs of possible futures that have the
- * same side effects. A pair is combined by creating a new future
- * with the same side effect but the union of the two destination sets.
- * In this way, all the possible futures suggested by a superstate
- * and a character can be merged into a set of possible futures where
- * no two elements of the set have the same set of side effects.
- *
- * The destination of a possible future, being a set of NFA states,
- * corresponds to a supernfa state. So, the merged set of possible
- * futures we just created can serve as a set of edges in the
- * supernfa.
- *
- * The representation of the superstate nfa and the nfa is critical.
- * The nfa has to be compact, but has to facilitate the rapid
- * computation of missing superstates. The superstate nfa has to
- * be fast to interpret, lazilly constructed, and bounded in space.
- *
- * To facilitate interpretation, the superstate data structures are
- * peppered with `instruction frames'. There is an instruction set
- * defined below which matchers using the supernfa must be able to
- * interpret.
- *
- * We'd like to make it possible but not mandatory to use code
- * addresses to represent instructions (c.f. gcc's computed goto).
- * Therefore, we define an enumerated type of opcodes, and when
- * writing one of these instructions into a data structure, use
- * the opcode as an index into a table of instruction values.
- *
- * Here are the opcodes that occur in the superstate nfa:
- */
-
-
-/* Every superstate contains a table of instruction frames indexed
- * by characters. A normal `move' in a matcher is to fetch the next
- * character and use it as an index into a superstates transition
- * table.
- *
- * In the fasted case, only one edge follows from that character.
- * In other cases there is more work to do.
- *
- * The descriptions of the opcodes refer to data structures that are
- * described further below.
- */
-
-enum rx_opcode
-{
- /*
- * BACKTRACK_POINT is invoked when a character transition in
- * a superstate leads to more than one edge. In that case,
- * the edges have to be explored independently using a backtracking
- * strategy.
- *
- * A BACKTRACK_POINT instruction is stored in a superstate's
- * transition table for some character when it is known that that
- * character crosses more than one edge. On encountering this
- * instruction, the matcher saves enough state to backtrack to this
- * point in the match later.
- */
- rx_backtrack_point = 0, /* data is (struct transition_class *) */
-
- /*
- * RX_DO_SIDE_EFFECTS evaluates the side effects of an epsilon path.
- * There is one occurence of this instruction per rx_distinct_future.
- * This instruction is skipped if a rx_distinct_future has no side effects.
- */
- rx_do_side_effects = rx_backtrack_point + 1,
-
- /* data is (struct rx_distinct_future *) */
-
- /*
- * RX_CACHE_MISS instructions are stored in rx_distinct_futures whose
- * destination superstate has been reclaimed (or was never built).
- * It recomputes the destination superstate.
- * RX_CACHE_MISS is also stored in a superstate transition table before
- * any of its edges have been built.
- */
- rx_cache_miss = rx_do_side_effects + 1,
- /* data is (struct rx_distinct_future *) */
-
- /*
- * RX_NEXT_CHAR is called to consume the next character and take the
- * corresponding transition. This is the only instruction that uses
- * the DATA field of the instruction frame instead of DATA_2.
- * (see EXPLORE_FUTURE in regex.c).
- */
- rx_next_char = rx_cache_miss + 1, /* data is (struct superstate *) */
-
- /* RX_BACKTRACK indicates that a transition fails.
- */
- rx_backtrack = rx_next_char + 1, /* no data */
-
- /*
- * RX_ERROR_INX is stored only in places that should never be executed.
- */
- rx_error_inx = rx_backtrack + 1, /* Not supposed to occur. */
-
- rx_num_instructions = rx_error_inx + 1
-};
-
-/* An id_instruction_table holds the values stored in instruction
- * frames. The table is indexed by the enums declared above.
- */
-extern void * rx_id_instruction_table[rx_num_instructions];
-
-/* The heart of the matcher is a `word-code-interpreter'
- * (like a byte-code interpreter, except that instructions
- * are a full word wide).
- *
- * Instructions are not stored in a vector of code, instead,
- * they are scattered throughout the data structures built
- * by the regexp compiler and the matcher. One word-code instruction,
- * together with the arguments to that instruction, constitute
- * an instruction frame (struct rx_inx).
- *
- * This structure type is padded by hand to a power of 2 because
- * in one of the dominant cases, we dispatch by indexing a table
- * of instruction frames. If that indexing can be accomplished
- * by just a shift of the index, we're happy.
- *
- * Instructions take at most one argument, but there are two
- * slots in an instruction frame that might hold that argument.
- * These are called data and data_2. The data slot is only
- * used for one instruction (RX_NEXT_CHAR). For all other
- * instructions, data should be set to 0.
- *
- * RX_NEXT_CHAR is the most important instruction by far.
- * By reserving the data field for its exclusive use,
- * instruction dispatch is sped up in that case. There is
- * no need to fetch both the instruction and the data,
- * only the data is needed. In other words, a `cycle' begins
- * by fetching the field data. If that is non-0, then it must
- * be the destination state of a next_char transition, so
- * make that value the current state, advance the match position
- * by one character, and start a new cycle. On the other hand,
- * if data is 0, fetch the instruction and do a more complicated
- * dispatch on that.
- */
-
-struct rx_inx
-{
- void * data;
- void * data_2;
- void * inx;
- void * fnord;
-};
-
-#ifndef RX_TAIL_ARRAY
-#define RX_TAIL_ARRAY 1
-#endif
-
-/* A superstate corresponds to a set of nfa states. Those sets are
- * represented by STRUCT RX_SUPERSET. The constructors
- * guarantee that only one (shared) structure is created for a given set.
- */
-struct rx_superset
-{
- int refs; /* This is a reference counted structure. */
-
- /* We keep these sets in a cache because (in an unpredictable way),
- * the same set is often created again and again. But that is also
- * problematic -- compatibility with POSIX and GNU regex requires
- * that we not be able to tell when a program discards a particular
- * NFA (thus invalidating the supersets created from it).
- *
- * But when a cache hit appears to occur, we will have in hand the
- * nfa for which it may have happened. That is why every nfa is given
- * its own sequence number. On a cache hit, the cache is validated
- * by comparing the nfa sequence number to this field:
- */
- int id;
-
- struct rx_nfa_state * car; /* May or may not be a valid addr. */
- struct rx_superset * cdr;
-
- /* If the corresponding superstate exists: */
- struct rx_superstate * superstate;
-
-
- /* There is another bookkeeping problem. It is expensive to
- * compute the starting nfa state set for an nfa. So, once computed,
- * it is cached in the `struct rx'.
- *
- * But, the state set can be flushed from the superstate cache.
- * When that happens, we can't know if the corresponding `struct rx'
- * is still alive or if it has been freed or re-used by the program.
- * So, the cached pointer to this set in a struct rx might be invalid
- * and we need a way to validate it.
- *
- * Fortunately, even if this set is flushed from the cache, it is
- * not freed. It just goes on the free-list of supersets.
- * So we can still examine it.
- *
- * So to validate a starting set memo, check to see if the
- * starts_for field still points back to the struct rx in question,
- * and if the ID matches the rx sequence number.
- */
- struct rx * starts_for;
-
- /* This is used to link into a hash bucket so these objects can
- * be `hash-consed'.
- */
- struct rx_hash_item hash_item;
-};
-
-#define rx_protect_superset(RX,CON) (++(CON)->refs)
-
-/* The terminology may be confusing (rename this structure?).
- * Every character occurs in at most one rx_super_edge per super-state.
- * But, that structure might have more than one option, indicating a point
- * of non-determinism.
- *
- * In other words, this structure holds a list of superstate edges
- * sharing a common starting state and character label. The edges
- * are in the field OPTIONS. All superstate edges sharing the same
- * starting state and character are in this list.
- */
-struct rx_super_edge
-{
- struct rx_super_edge *next;
- struct rx_inx rx_backtrack_frame;
- int cset_size;
- rx_Bitset cset;
- struct rx_distinct_future *options;
-};
-
-/* A superstate is a set of nfa states (RX_SUPERSET) along
- * with a transition table. Superstates are built on demand and reclaimed
- * without warning. To protect a superstate from this ghastly fate,
- * use LOCK_SUPERSTATE.
- */
-struct rx_superstate
-{
- int rx_id; /* c.f. the id field of rx_superset */
- int locks; /* protection from reclamation */
-
- /* Within a superstate cache, all the superstates are kept in a big
- * queue. The tail of the queue is the state most likely to be
- * reclaimed. The *recyclable fields hold the queue position of
- * this state.
- */
- struct rx_superstate * next_recyclable;
- struct rx_superstate * prev_recyclable;
-
- /* The supernfa edges that exist in the cache and that have
- * this state as their destination are kept in this list:
- */
- struct rx_distinct_future * transition_refs;
-
- /* The list of nfa states corresponding to this superstate: */
- struct rx_superset * contents;
-
- /* The list of edges in the cache beginning from this state. */
- struct rx_super_edge * edges;
-
- /* A tail of the recyclable queue is marked as semifree. A semifree
- * state has no incoming next_char transitions -- any transition
- * into a semifree state causes a complex dispatch with the side
- * effect of rescuing the state from its semifree state.
- *
- * An alternative to this might be to make next_char more expensive,
- * and to move a state to the head of the recyclable queue whenever
- * it is entered. That way, popular states would never be recycled.
- *
- * But unilaterally making next_char more expensive actually loses.
- * So, incoming transitions are only made expensive for states near
- * the tail of the recyclable queue. The more cache contention
- * there is, the more frequently a state will have to prove itself
- * and be moved back to the front of the queue. If there is less
- * contention, then popular states just aggregate in the front of
- * the queue and stay there.
- */
- int is_semifree;
-
-
- /* This keeps track of the size of the transition table for this
- * state. There is a half-hearted attempt to support variable sized
- * superstates.
- */
- int trans_size;
-
- /* Indexed by characters... */
- struct rx_inx transitions[RX_TAIL_ARRAY];
-};
-
-
-/* A list of distinct futures define the edges that leave from a
- * given superstate on a given character. c.f. rx_super_edge.
- */
-
-struct rx_distinct_future
-{
- struct rx_distinct_future * next_same_super_edge[2];
- struct rx_distinct_future * next_same_dest;
- struct rx_distinct_future * prev_same_dest;
- struct rx_superstate * present; /* source state */
- struct rx_superstate * future; /* destination state */
- struct rx_super_edge * edge;
-
-
- /* The future_frame holds the instruction that should be executed
- * after all the side effects are done, when it is time to complete
- * the transition to the next state.
- *
- * Normally this is a next_char instruction, but it may be a
- * cache_miss instruction as well, depending on whether or not
- * the superstate is in the cache and semifree.
- *
- * If this is the only future for a given superstate/char, and
- * if there are no side effects to be performed, this frame is
- * not used (directly) at all. Instead, its contents are copied
- * into the transition table of the starting state of this dist. future.
- */
- struct rx_inx future_frame;
-
- struct rx_inx side_effects_frame;
- struct rx_se_list * effects;
-};
-
-#define rx_lock_superstate(R,S) ((S)->locks++)
-#define rx_unlock_superstate(R,S) (--(S)->locks)
-
-
-/* This page destined for rx.h */
-
-struct rx_blocklist
-{
- struct rx_blocklist * next;
- int bytes;
-};
-
-struct rx_freelist
-{
- struct rx_freelist * next;
-};
-
-struct rx_cache;
-
-#ifdef __STDC__
-typedef void (*rx_morecore_fn)(struct rx_cache *);
-#else
-typedef void (*rx_morecore_fn)();
-#endif
-
-/* You use this to control the allocation of superstate data
- * during matching. Most of it should be initialized to 0.
- *
- * A MORECORE function is necessary. It should allocate
- * a new block of memory or return 0.
- * A default that uses malloc is called `rx_morecore'.
- *
- * The number of SUPERSTATES_ALLOWED indirectly limits how much memory
- * the system will try to allocate. The default is 128. Batch style
- * applications that are very regexp intensive should use as high a number
- * as possible without thrashing.
- *
- * The LOCAL_CSET_SIZE is the number of characters in a character set.
- * It is therefore the number of entries in a superstate transition table.
- * Generally, it should be 256. If your character set has 16 bits,
- * it is better to translate your regexps into equivalent 8 bit patterns.
- */
-
-struct rx_cache
-{
- struct rx_hash_rules superset_hash_rules;
-
- /* Objects are allocated by incrementing a pointer that
- * scans across rx_blocklists.
- */
- struct rx_blocklist * memory;
- struct rx_blocklist * memory_pos;
- int bytes_left;
- char * memory_addr;
- rx_morecore_fn morecore;
-
- /* Freelists. */
- struct rx_freelist * free_superstates;
- struct rx_freelist * free_transition_classes;
- struct rx_freelist * free_discernable_futures;
- struct rx_freelist * free_supersets;
- struct rx_freelist * free_hash;
-
- /* Two sets of superstates -- those that are semifreed, and those
- * that are being used.
- */
- struct rx_superstate * lru_superstate;
- struct rx_superstate * semifree_superstate;
-
- struct rx_superset * empty_superset;
-
- int superstates;
- int semifree_superstates;
- int hits;
- int misses;
- int superstates_allowed;
-
- int local_cset_size;
- void ** instruction_table;
-
- struct rx_hash superset_table;
-};
-
-
-
-/* The lowest-level search function supports arbitrarily fragmented
- * strings and (optionally) suspendable/resumable searches.
- *
- * Callers have to provide a few hooks.
- */
-
-#ifndef __GNUC__
-#ifdef __STDC__
-#define __const__ const
-#else
-#define __const__
-#endif
-#endif
-
-/* This holds a matcher position */
-struct rx_string_position
-{
- __const__ unsigned char * pos; /* The current pos. */
- __const__ unsigned char * string; /* The current string burst. */
- __const__ unsigned char * end; /* First invalid position >= POS. */
- int offset; /* Integer address of the current burst. */
- int size; /* Current string's size. */
- int search_direction; /* 1 or -1 */
- int search_end; /* First position to not try. */
-};
-
-
-enum rx_get_burst_return
-{
- rx_get_burst_continuation,
- rx_get_burst_error,
- rx_get_burst_ok,
- rx_get_burst_no_more
-};
-
-
-/* A call to get burst should make POS valid. It might be invalid
- * if the STRING field doesn't point to a burst that actually
- * contains POS.
- *
- * GET_BURST should take a clue from SEARCH_DIRECTION (1 or -1) as to
- * whether or not to pad to the left. Padding to the right is always
- * appropriate, but need not go past the point indicated by STOP.
- *
- * If a continuation is returned, then the reentering call to
- * a search function will retry the get_burst.
- */
-
-#ifdef __STDC__
-typedef enum rx_get_burst_return
- (*rx_get_burst_fn) (struct rx_string_position * pos,
- void * app_closure,
- int stop);
-
-#else
-typedef enum rx_get_burst_return (*rx_get_burst_fn) ();
-#endif
-
-
-enum rx_back_check_return
-{
- rx_back_check_continuation,
- rx_back_check_error,
- rx_back_check_pass,
- rx_back_check_fail
-};
-
-/* Back_check should advance the position it is passed
- * over rparen - lparen characters and return pass iff
- * the characters starting at POS match those indexed
- * by [LPAREN..RPAREN].
- *
- * If a continuation is returned, then the reentering call to
- * a search function will retry the back_check.
- */
-
-#ifdef __STDC__
-typedef enum rx_back_check_return
- (*rx_back_check_fn) (struct rx_string_position * pos,
- int lparen,
- int rparen,
- unsigned char * translate,
- void * app_closure,
- int stop);
-
-#else
-typedef enum rx_back_check_return (*rx_back_check_fn) ();
-#endif
-
-
-
-
-/* A call to fetch_char should return the character at POS or POS + 1.
- * Returning continuations here isn't supported. OFFSET is either 0 or 1
- * and indicates which characters is desired.
- */
-
-#ifdef __STDC__
-typedef int (*rx_fetch_char_fn) (struct rx_string_position * pos,
- int offset,
- void * app_closure,
- int stop);
-#else
-typedef int (*rx_fetch_char_fn) ();
-#endif
-
-
-enum rx_search_return
-{
- rx_search_continuation = -4,
- rx_search_error = -3,
- rx_search_soft_fail = -2, /* failed by running out of string */
- rx_search_fail = -1 /* failed only by reaching failure states */
- /* return values >= 0 indicate the position of a successful match */
-};
-
-
-
-
-
-
-/* regex.h
- *
- * The remaining declarations replace regex.h.
- */
-
-/* This is an array of error messages corresponding to the error codes.
- */
-extern __const__ char *re_error_msg[];
-
-/* If any error codes are removed, changed, or added, update the
- `re_error_msg' table in regex.c. */
-typedef enum
-{
- REG_NOERROR = 0, /* Success. */
- REG_NOMATCH, /* Didn't find a match (for regexec). */
-
- /* POSIX regcomp return error codes. (In the order listed in the
- standard.) */
- REG_BADPAT, /* Invalid pattern. */
- REG_ECOLLATE, /* Not implemented. */
- REG_ECTYPE, /* Invalid character class name. */
- REG_EESCAPE, /* Trailing backslash. */
- REG_ESUBREG, /* Invalid back reference. */
- REG_EBRACK, /* Unmatched left bracket. */
- REG_EPAREN, /* Parenthesis imbalance. */
- REG_EBRACE, /* Unmatched \{. */
- REG_BADBR, /* Invalid contents of \{\}. */
- REG_ERANGE, /* Invalid range end. */
- REG_ESPACE, /* Ran out of memory. */
- REG_BADRPT, /* No preceding re for repetition op. */
-
- /* Error codes we've added. */
- REG_EEND, /* Premature end. */
- REG_ESIZE, /* Compiled pattern bigger than 2^16 bytes. */
- REG_ERPAREN /* Unmatched ) or \); not returned from regcomp. */
-} reg_errcode_t;
-
-/* The regex.c support, as a client of rx, defines a set of possible
- * side effects that can be added to the edge lables of nfa edges.
- * Here is the list of sidef effects in use.
- */
-
-enum re_side_effects
-{
-#define RX_WANT_SE_DEFS 1
-#undef RX_DEF_SE
-#undef RX_DEF_CPLX_SE
-#define RX_DEF_SE(IDEM, NAME, VALUE) NAME VALUE,
-#define RX_DEF_CPLX_SE(IDEM, NAME, VALUE) NAME VALUE,
-#include "rx.h"
-#undef RX_DEF_SE
-#undef RX_DEF_CPLX_SE
-#undef RX_WANT_SE_DEFS
- re_floogle_flap = 65533
-};
-
-/* These hold paramaters for the kinds of side effects that are possible
- * in the supported pattern languages. These include things like the
- * numeric bounds of {} operators and the index of paren registers for
- * subexpression measurement or backreferencing.
- */
-struct re_se_params
-{
- enum re_side_effects se;
- int op1;
- int op2;
-};
-
-typedef unsigned reg_syntax_t;
-
-struct re_pattern_buffer
-{
- struct rx rx;
- reg_syntax_t syntax; /* See below for syntax bit definitions. */
-
- unsigned int no_sub:1; /* If set, don't return register offsets. */
- unsigned int not_bol:1; /* If set, the anchors ('^' and '$') don't */
- unsigned int not_eol:1; /* match at the ends of the string. */
- unsigned int newline_anchor:1;/* If true, an anchor at a newline matches.*/
- unsigned int least_subs:1; /* If set, and returning registers, return
- * as few values as possible. Only
- * backreferenced groups and group 0 (the whole
- * match) will be returned.
- */
-
- /* If true, this says that the matcher should keep registers on its
- * backtracking stack. For many patterns, we can easily determine that
- * this isn't necessary.
- */
- unsigned int match_regs_on_stack:1;
- unsigned int search_regs_on_stack:1;
-
- /* is_anchored and begbuf_only are filled in by rx_compile. */
- unsigned int is_anchored:1; /* Anchorded by ^? */
- unsigned int begbuf_only:1; /* Anchored to char position 0? */
-
-
- /* If REGS_UNALLOCATED, allocate space in the `regs' structure
- * for `max (RE_NREGS, re_nsub + 1)' groups.
- * If REGS_REALLOCATE, reallocate space if necessary.
- * If REGS_FIXED, use what's there.
- */
-#define REGS_UNALLOCATED 0
-#define REGS_REALLOCATE 1
-#define REGS_FIXED 2
- unsigned int regs_allocated:2;
-
-
- /* Either a translate table to apply to all characters before
- * comparing them, or zero for no translation. The translation
- * is applied to a pattern when it is compiled and to a string
- * when it is matched.
- */
- unsigned char * translate;
-
- /* If this is a valid pointer, it tells rx not to store the extents of
- * certain subexpressions (those corresponding to non-zero entries).
- * Passing 0x1 is the same as passing an array of all ones. Passing 0x0
- * is the same as passing an array of all zeros.
- * The array should contain as many entries as their are subexps in the
- * regexp.
- *
- * For POSIX compatability, when using regcomp and regexec this field
- * is zeroed and ignored.
- */
- char * syntax_parens;
-
- /* Number of subexpressions found by the compiler. */
- size_t re_nsub;
-
- void * buffer; /* Malloced memory for the nfa. */
- unsigned long allocated; /* Size of that memory. */
-
- /* Pointer to a fastmap, if any, otherwise zero. re_search uses
- * the fastmap, if there is one, to skip over impossible
- * starting points for matches. */
- char *fastmap;
-
- unsigned int fastmap_accurate:1; /* These three are internal. */
- unsigned int can_match_empty:1;
- struct rx_nfa_state * start; /* The nfa starting state. */
-
- /* This is the list of iterator bounds for {lo,hi} constructs.
- * The memory pointed to is part of the rx->buffer.
- */
- struct re_se_params *se_params;
-
- /* This is a bitset representation of the fastmap.
- * This is a true fastmap that already takes the translate
- * table into account.
- */
- rx_Bitset fastset;
-};
-
-/* Type for byte offsets within the string. POSIX mandates this. */
-typedef int regoff_t;
-
-/* This is the structure we store register match data in. See
- regex.texinfo for a full description of what registers match. */
-struct re_registers
-{
- unsigned num_regs;
- regoff_t *start;
- regoff_t *end;
-};
-
-typedef struct re_pattern_buffer regex_t;
-
-/* POSIX specification for registers. Aside from the different names than
- `re_registers', POSIX uses an array of structures, instead of a
- structure of arrays. */
-typedef struct
-{
- regoff_t rm_so; /* Byte offset from string's start to substring's start. */
- regoff_t rm_eo; /* Byte offset from string's start to substring's end. */
-} regmatch_t;
-
-
-/* The following bits are used to determine the regexp syntax we
- recognize. The set/not-set meanings are chosen so that Emacs syntax
- remains the value 0. The bits are given in alphabetical order, and
- the definitions shifted by one from the previous bit; thus, when we
- add or remove a bit, only one other definition need change. */
-
-/* If this bit is not set, then \ inside a bracket expression is literal.
- If set, then such a \ quotes the following character. */
-#define RE_BACKSLASH_ESCAPE_IN_LISTS (1)
-
-/* If this bit is not set, then + and ? are operators, and \+ and \? are
- literals.
- If set, then \+ and \? are operators and + and ? are literals. */
-#define RE_BK_PLUS_QM (RE_BACKSLASH_ESCAPE_IN_LISTS << 1)
-
-/* If this bit is set, then character classes are supported. They are:
- [:alpha:], [:upper:], [:lower:], [:digit:], [:alnum:], [:xdigit:],
- [:space:], [:print:], [:punct:], [:graph:], and [:cntrl:].
- If not set, then character classes are not supported. */
-#define RE_CHAR_CLASSES (RE_BK_PLUS_QM << 1)
-
-/* If this bit is set, then ^ and $ are always anchors (outside bracket
- expressions, of course).
- If this bit is not set, then it depends:
- ^ is an anchor if it is at the beginning of a regular
- expression or after an open-group or an alternation operator;
- $ is an anchor if it is at the end of a regular expression, or
- before a close-group or an alternation operator.
-
- This bit could be (re)combined with RE_CONTEXT_INDEP_OPS, because
- POSIX draft 11.2 says that * etc. in leading positions is undefined.
- We already implemented a previous draft which made those constructs
- invalid, though, so we haven't changed the code back. */
-#define RE_CONTEXT_INDEP_ANCHORS (RE_CHAR_CLASSES << 1)
-
-/* If this bit is set, then special characters are always special
- regardless of where they are in the pattern.
- If this bit is not set, then special characters are special only in
- some contexts; otherwise they are ordinary. Specifically,
- * + ? and intervals are only special when not after the beginning,
- open-group, or alternation operator. */
-#define RE_CONTEXT_INDEP_OPS (RE_CONTEXT_INDEP_ANCHORS << 1)
-
-/* If this bit is set, then *, +, ?, and { cannot be first in an re or
- immediately after an alternation or begin-group operator. */
-#define RE_CONTEXT_INVALID_OPS (RE_CONTEXT_INDEP_OPS << 1)
-
-/* If this bit is set, then . matches newline.
- If not set, then it doesn't. */
-#define RE_DOT_NEWLINE (RE_CONTEXT_INVALID_OPS << 1)
-
-/* If this bit is set, then . doesn't match NUL.
- If not set, then it does. */
-#define RE_DOT_NOT_NULL (RE_DOT_NEWLINE << 1)
-
-/* If this bit is set, nonmatching lists [^...] do not match newline.
- If not set, they do. */
-#define RE_HAT_LISTS_NOT_NEWLINE (RE_DOT_NOT_NULL << 1)
-
-/* If this bit is set, either \{...\} or {...} defines an
- interval, depending on RE_NO_BK_BRACES.
- If not set, \{, \}, {, and } are literals. */
-#define RE_INTERVALS (RE_HAT_LISTS_NOT_NEWLINE << 1)
-
-/* If this bit is set, +, ? and | aren't recognized as operators.
- If not set, they are. */
-#define RE_LIMITED_OPS (RE_INTERVALS << 1)
-
-/* If this bit is set, newline is an alternation operator.
- If not set, newline is literal. */
-#define RE_NEWLINE_ALT (RE_LIMITED_OPS << 1)
-
-/* If this bit is set, then `{...}' defines an interval, and \{ and \}
- are literals.
- If not set, then `\{...\}' defines an interval. */
-#define RE_NO_BK_BRACES (RE_NEWLINE_ALT << 1)
-
-/* If this bit is set, (...) defines a group, and \( and \) are literals.
- If not set, \(...\) defines a group, and ( and ) are literals. */
-#define RE_NO_BK_PARENS (RE_NO_BK_BRACES << 1)
-
-/* If this bit is set, then \<digit> matches <digit>.
- If not set, then \<digit> is a back-reference. */
-#define RE_NO_BK_REFS (RE_NO_BK_PARENS << 1)
-
-/* If this bit is set, then | is an alternation operator, and \| is literal.
- If not set, then \| is an alternation operator, and | is literal. */
-#define RE_NO_BK_VBAR (RE_NO_BK_REFS << 1)
-
-/* If this bit is set, then an ending range point collating higher
- than the starting range point, as in [z-a], is invalid.
- If not set, then when ending range point collates higher than the
- starting range point, the range is ignored. */
-#define RE_NO_EMPTY_RANGES (RE_NO_BK_VBAR << 1)
-
-/* If this bit is set, then an unmatched ) is ordinary.
- If not set, then an unmatched ) is invalid. */
-#define RE_UNMATCHED_RIGHT_PAREN_ORD (RE_NO_EMPTY_RANGES << 1)
-
-/* This global variable defines the particular regexp syntax to use (for
- some interfaces). When a regexp is compiled, the syntax used is
- stored in the pattern buffer, so changing this does not affect
- already-compiled regexps. */
-extern reg_syntax_t re_syntax_options;
-
-/* Define combinations of the above bits for the standard possibilities.
- (The [[[ comments delimit what gets put into the Texinfo file, so
- don't delete them!) */
-/* [[[begin syntaxes]]] */
-#define RE_SYNTAX_EMACS 0
-
-#define RE_SYNTAX_AWK \
- (RE_BACKSLASH_ESCAPE_IN_LISTS | RE_DOT_NOT_NULL \
- | RE_NO_BK_PARENS | RE_NO_BK_REFS \
- | RE_NO_BK_VBAR | RE_NO_EMPTY_RANGES \
- | RE_UNMATCHED_RIGHT_PAREN_ORD)
-
-#define RE_SYNTAX_POSIX_AWK \
- (RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS)
-
-#define RE_SYNTAX_GREP \
- (RE_BK_PLUS_QM | RE_CHAR_CLASSES \
- | RE_HAT_LISTS_NOT_NEWLINE | RE_INTERVALS \
- | RE_NEWLINE_ALT)
-
-#define RE_SYNTAX_EGREP \
- (RE_CHAR_CLASSES | RE_CONTEXT_INDEP_ANCHORS \
- | RE_CONTEXT_INDEP_OPS | RE_HAT_LISTS_NOT_NEWLINE \
- | RE_NEWLINE_ALT | RE_NO_BK_PARENS \
- | RE_NO_BK_VBAR)
-
-#define RE_SYNTAX_POSIX_EGREP \
- (RE_SYNTAX_EGREP | RE_INTERVALS | RE_NO_BK_BRACES)
-
-#define RE_SYNTAX_SED RE_SYNTAX_POSIX_BASIC
-
-/* Syntax bits common to both basic and extended POSIX regex syntax. */
-#define _RE_SYNTAX_POSIX_COMMON \
- (RE_CHAR_CLASSES | RE_DOT_NEWLINE | RE_DOT_NOT_NULL \
- | RE_INTERVALS | RE_NO_EMPTY_RANGES)
-
-#define RE_SYNTAX_POSIX_BASIC \
- (_RE_SYNTAX_POSIX_COMMON | RE_BK_PLUS_QM)
-
-/* Differs from ..._POSIX_BASIC only in that RE_BK_PLUS_QM becomes
- RE_LIMITED_OPS, i.e., \? \+ \| are not recognized. Actually, this
- isn't minimal, since other operators, such as \`, aren't disabled. */
-#define RE_SYNTAX_POSIX_MINIMAL_BASIC \
- (_RE_SYNTAX_POSIX_COMMON | RE_LIMITED_OPS)
-
-#define RE_SYNTAX_POSIX_EXTENDED \
- (_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \
- | RE_CONTEXT_INDEP_OPS | RE_NO_BK_BRACES \
- | RE_NO_BK_PARENS | RE_NO_BK_VBAR \
- | RE_UNMATCHED_RIGHT_PAREN_ORD)
-
-/* Differs from ..._POSIX_EXTENDED in that RE_CONTEXT_INVALID_OPS
- replaces RE_CONTEXT_INDEP_OPS and RE_NO_BK_REFS is added. */
-#define RE_SYNTAX_POSIX_MINIMAL_EXTENDED \
- (_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \
- | RE_CONTEXT_INVALID_OPS | RE_NO_BK_BRACES \
- | RE_NO_BK_PARENS | RE_NO_BK_REFS \
- | RE_NO_BK_VBAR | RE_UNMATCHED_RIGHT_PAREN_ORD)
-/* [[[end syntaxes]]] */
-
-/* Maximum number of duplicates an interval can allow. Some systems
- (erroneously) define this in other header files, but we want our
- value, so remove any previous define. */
-#ifdef RE_DUP_MAX
-#undef RE_DUP_MAX
-#endif
-#define RE_DUP_MAX ((1 << 15) - 1)
-
-
-
-/* POSIX `cflags' bits (i.e., information for `regcomp'). */
-
-/* If this bit is set, then use extended regular expression syntax.
- If not set, then use basic regular expression syntax. */
-#define REG_EXTENDED 1
-
-/* If this bit is set, then ignore case when matching.
- If not set, then case is significant. */
-#define REG_ICASE (REG_EXTENDED << 1)
-
-/* If this bit is set, then anchors do not match at newline
- characters in the string.
- If not set, then anchors do match at newlines. */
-#define REG_NEWLINE (REG_ICASE << 1)
-
-/* If this bit is set, then report only success or fail in regexec.
- If not set, then returns differ between not matching and errors. */
-#define REG_NOSUB (REG_NEWLINE << 1)
-
-
-/* POSIX `eflags' bits (i.e., information for regexec). */
-
-/* If this bit is set, then the beginning-of-line operator doesn't match
- the beginning of the string (presumably because it's not the
- beginning of a line).
- If not set, then the beginning-of-line operator does match the
- beginning of the string. */
-#define REG_NOTBOL 1
-
-/* Like REG_NOTBOL, except for the end-of-line. */
-#define REG_NOTEOL (1 << 1)
-
-/* If `regs_allocated' is REGS_UNALLOCATED in the pattern buffer,
- * `re_match_2' returns information about at least this many registers
- * the first time a `regs' structure is passed.
- *
- * Also, this is the greatest number of backreferenced subexpressions
- * allowed in a pattern being matched without caller-supplied registers.
- */
-#ifndef RE_NREGS
-#define RE_NREGS 30
-#endif
-
-extern int rx_cache_bound;
-extern char rx_version_string[];
-
-
-
-#ifdef RX_WANT_RX_DEFS
-
-/* This is decls to the interesting subsystems and lower layers
- * of rx. Everything which doesn't have a public counterpart in
- * regex.c is declared here.
- */
-
-
-#ifdef __STDC__
-typedef void (*rx_hash_freefn) (struct rx_hash_item * it);
-#else /* ndef __STDC__ */
-typedef void (*rx_hash_freefn) ();
-#endif /* ndef __STDC__ */
-
-
-
-
-#ifdef __STDC__
-RX_DECL int rx_bitset_is_equal (int size, rx_Bitset a, rx_Bitset b);
-RX_DECL int rx_bitset_is_subset (int size, rx_Bitset a, rx_Bitset b);
-RX_DECL int rx_bitset_empty (int size, rx_Bitset set);
-RX_DECL void rx_bitset_null (int size, rx_Bitset b);
-RX_DECL void rx_bitset_universe (int size, rx_Bitset b);
-RX_DECL void rx_bitset_complement (int size, rx_Bitset b);
-RX_DECL void rx_bitset_assign (int size, rx_Bitset a, rx_Bitset b);
-RX_DECL void rx_bitset_union (int size, rx_Bitset a, rx_Bitset b);
-RX_DECL void rx_bitset_intersection (int size,
- rx_Bitset a, rx_Bitset b);
-RX_DECL void rx_bitset_difference (int size, rx_Bitset a, rx_Bitset b);
-RX_DECL void rx_bitset_revdifference (int size,
- rx_Bitset a, rx_Bitset b);
-RX_DECL void rx_bitset_xor (int size, rx_Bitset a, rx_Bitset b);
-RX_DECL unsigned long rx_bitset_hash (int size, rx_Bitset b);
-RX_DECL struct rx_hash_item * rx_hash_find (struct rx_hash * table,
- unsigned long hash,
- void * value,
- struct rx_hash_rules * rules);
-RX_DECL struct rx_hash_item * rx_hash_store (struct rx_hash * table,
- unsigned long hash,
- void * value,
- struct rx_hash_rules * rules);
-RX_DECL void rx_hash_free (struct rx_hash_item * it, struct rx_hash_rules * rules);
-RX_DECL void rx_free_hash_table (struct rx_hash * tab, rx_hash_freefn freefn,
- struct rx_hash_rules * rules);
-RX_DECL rx_Bitset rx_cset (struct rx *rx);
-RX_DECL rx_Bitset rx_copy_cset (struct rx *rx, rx_Bitset a);
-RX_DECL void rx_free_cset (struct rx * rx, rx_Bitset c);
-RX_DECL struct rexp_node * rexp_node (struct rx *rx,
- enum rexp_node_type type);
-RX_DECL struct rexp_node * rx_mk_r_cset (struct rx * rx,
- rx_Bitset b);
-RX_DECL struct rexp_node * rx_mk_r_concat (struct rx * rx,
- struct rexp_node * a,
- struct rexp_node * b);
-RX_DECL struct rexp_node * rx_mk_r_alternate (struct rx * rx,
- struct rexp_node * a,
- struct rexp_node * b);
-RX_DECL struct rexp_node * rx_mk_r_opt (struct rx * rx,
- struct rexp_node * a);
-RX_DECL struct rexp_node * rx_mk_r_star (struct rx * rx,
- struct rexp_node * a);
-RX_DECL struct rexp_node * rx_mk_r_2phase_star (struct rx * rx,
- struct rexp_node * a,
- struct rexp_node * b);
-RX_DECL struct rexp_node * rx_mk_r_side_effect (struct rx * rx,
- rx_side_effect a);
-RX_DECL struct rexp_node * rx_mk_r_data (struct rx * rx,
- void * a);
-RX_DECL void rx_free_rexp (struct rx * rx, struct rexp_node * node);
-RX_DECL struct rexp_node * rx_copy_rexp (struct rx *rx,
- struct rexp_node *node);
-RX_DECL struct rx_nfa_state * rx_nfa_state (struct rx *rx);
-RX_DECL void rx_free_nfa_state (struct rx_nfa_state * n);
-RX_DECL struct rx_nfa_state * rx_id_to_nfa_state (struct rx * rx,
- int id);
-RX_DECL struct rx_nfa_edge * rx_nfa_edge (struct rx *rx,
- enum rx_nfa_etype type,
- struct rx_nfa_state *start,
- struct rx_nfa_state *dest);
-RX_DECL void rx_free_nfa_edge (struct rx_nfa_edge * e);
-RX_DECL void rx_free_nfa (struct rx *rx);
-RX_DECL int rx_build_nfa (struct rx *rx,
- struct rexp_node *rexp,
- struct rx_nfa_state **start,
- struct rx_nfa_state **end);
-RX_DECL void rx_name_nfa_states (struct rx *rx);
-RX_DECL int rx_eclose_nfa (struct rx *rx);
-RX_DECL void rx_delete_epsilon_transitions (struct rx *rx);
-RX_DECL int rx_compactify_nfa (struct rx *rx,
- void **mem, unsigned long *size);
-RX_DECL void rx_release_superset (struct rx *rx,
- struct rx_superset *set);
-RX_DECL struct rx_superset * rx_superset_cons (struct rx * rx,
- struct rx_nfa_state *car, struct rx_superset *cdr);
-RX_DECL struct rx_superset * rx_superstate_eclosure_union
- (struct rx * rx, struct rx_superset *set, struct rx_nfa_state_set *ecl);
-RX_DECL struct rx_superstate * rx_superstate (struct rx *rx,
- struct rx_superset *set);
-RX_DECL struct rx_inx * rx_handle_cache_miss
- (struct rx *rx, struct rx_superstate *super, unsigned char chr, void *data);
-RX_DECL reg_errcode_t rx_compile (__const__ char *pattern, int size,
- reg_syntax_t syntax,
- struct re_pattern_buffer * rxb);
-RX_DECL void rx_blow_up_fastmap (struct re_pattern_buffer * rxb);
-#else /* STDC */
-RX_DECL int rx_bitset_is_equal ();
-RX_DECL int rx_bitset_is_subset ();
-RX_DECL int rx_bitset_empty ();
-RX_DECL void rx_bitset_null ();
-RX_DECL void rx_bitset_universe ();
-RX_DECL void rx_bitset_complement ();
-RX_DECL void rx_bitset_assign ();
-RX_DECL void rx_bitset_union ();
-RX_DECL void rx_bitset_intersection ();
-RX_DECL void rx_bitset_difference ();
-RX_DECL void rx_bitset_revdifference ();
-RX_DECL void rx_bitset_xor ();
-RX_DECL unsigned long rx_bitset_hash ();
-RX_DECL struct rx_hash_item * rx_hash_find ();
-RX_DECL struct rx_hash_item * rx_hash_store ();
-RX_DECL void rx_hash_free ();
-RX_DECL void rx_free_hash_table ();
-RX_DECL rx_Bitset rx_cset ();
-RX_DECL rx_Bitset rx_copy_cset ();
-RX_DECL void rx_free_cset ();
-RX_DECL struct rexp_node * rexp_node ();
-RX_DECL struct rexp_node * rx_mk_r_cset ();
-RX_DECL struct rexp_node * rx_mk_r_concat ();
-RX_DECL struct rexp_node * rx_mk_r_alternate ();
-RX_DECL struct rexp_node * rx_mk_r_opt ();
-RX_DECL struct rexp_node * rx_mk_r_star ();
-RX_DECL struct rexp_node * rx_mk_r_2phase_star ();
-RX_DECL struct rexp_node * rx_mk_r_side_effect ();
-RX_DECL struct rexp_node * rx_mk_r_data ();
-RX_DECL void rx_free_rexp ();
-RX_DECL struct rexp_node * rx_copy_rexp ();
-RX_DECL struct rx_nfa_state * rx_nfa_state ();
-RX_DECL void rx_free_nfa_state ();
-RX_DECL struct rx_nfa_state * rx_id_to_nfa_state ();
-RX_DECL struct rx_nfa_edge * rx_nfa_edge ();
-RX_DECL void rx_free_nfa_edge ();
-RX_DECL void rx_free_nfa ();
-RX_DECL int rx_build_nfa ();
-RX_DECL void rx_name_nfa_states ();
-RX_DECL int rx_eclose_nfa ();
-RX_DECL void rx_delete_epsilon_transitions ();
-RX_DECL int rx_compactify_nfa ();
-RX_DECL void rx_release_superset ();
-RX_DECL struct rx_superset * rx_superset_cons ();
-RX_DECL struct rx_superset * rx_superstate_eclosure_union ();
-RX_DECL struct rx_superstate * rx_superstate ();
-RX_DECL struct rx_inx * rx_handle_cache_miss ();
-RX_DECL reg_errcode_t rx_compile ();
-RX_DECL void rx_blow_up_fastmap ();
-#endif /* STDC */
-
-
-#endif /* RX_WANT_RX_DEFS */
-
-
-
-#ifdef __STDC__
-extern int re_search_2 (struct re_pattern_buffer *rxb,
- __const__ char * string1, int size1,
- __const__ char * string2, int size2,
- int startpos, int range,
- struct re_registers *regs,
- int stop);
-extern int re_search (struct re_pattern_buffer * rxb, __const__ char *string,
- int size, int startpos, int range,
- struct re_registers *regs);
-extern int re_match_2 (struct re_pattern_buffer * rxb,
- __const__ char * string1, int size1,
- __const__ char * string2, int size2,
- int pos, struct re_registers *regs, int stop);
-extern int re_match (struct re_pattern_buffer * rxb,
- __const__ char * string,
- int size, int pos,
- struct re_registers *regs);
-extern reg_syntax_t re_set_syntax (reg_syntax_t syntax);
-extern void re_set_registers (struct re_pattern_buffer *bufp,
- struct re_registers *regs,
- unsigned num_regs,
- regoff_t * starts, regoff_t * ends);
-extern __const__ char * re_compile_pattern (__const__ char *pattern,
- int length,
- struct re_pattern_buffer * rxb);
-extern int re_compile_fastmap (struct re_pattern_buffer * rxb);
-extern char * re_comp (__const__ char *s);
-extern int re_exec (__const__ char *s);
-extern int regcomp (regex_t * preg, __const__ char * pattern, int cflags);
-extern int regexec (__const__ regex_t *preg, __const__ char *string,
- size_t nmatch, regmatch_t pmatch[],
- int eflags);
-extern size_t regerror (int errcode, __const__ regex_t *preg,
- char *errbuf, size_t errbuf_size);
-extern void regfree (regex_t *preg);
-
-#else /* STDC */
-extern int re_search_2 ();
-extern int re_search ();
-extern int re_match_2 ();
-extern int re_match ();
-extern reg_syntax_t re_set_syntax ();
-extern void re_set_registers ();
-extern __const__ char * re_compile_pattern ();
-extern int re_compile_fastmap ();
-extern char * re_comp ();
-extern int re_exec ();
-extern int regcomp ();
-extern int regexec ();
-extern size_t regerror ();
-extern void regfree ();
-
-#endif /* STDC */
-
-
-
-#ifdef RX_WANT_RX_DEFS
-
-struct rx_counter_frame
-{
- int tag;
- int val;
- struct rx_counter_frame * inherited_from; /* If this is a copy. */
- struct rx_counter_frame * cdr;
-};
-
-struct rx_backtrack_frame
-{
- char * counter_stack_sp;
-
- /* A frame is used to save the matchers state when it crosses a
- * backtracking point. The `stk_' fields correspond to variables
- * in re_search_2 (just strip off thes `stk_'). They are documented
- * tere.
- */
- struct rx_superstate * stk_super;
- unsigned int stk_c;
- struct rx_string_position stk_test_pos;
- int stk_last_l;
- int stk_last_r;
- int stk_test_ret;
-
- /* This is the list of options left to explore at the backtrack
- * point for which this frame was created.
- */
- struct rx_distinct_future * df;
- struct rx_distinct_future * first_df;
-
-#ifdef RX_DEBUG
- int stk_line_no;
-#endif
-};
-
-struct rx_stack_chunk
-{
- struct rx_stack_chunk * next_chunk;
- int bytes_left;
- char * sp;
-};
-
-enum rx_outer_entry
-{
- rx_outer_start,
- rx_outer_fastmap,
- rx_outer_test,
- rx_outer_restore_pos
-};
-
-enum rx_fastmap_return
-{
- rx_fastmap_continuation,
- rx_fastmap_error,
- rx_fastmap_ok,
- rx_fastmap_fail
-};
-
-enum rx_fastmap_entry
-{
- rx_fastmap_start,
- rx_fastmap_string_break
-};
-
-enum rx_test_return
-{
- rx_test_continuation,
- rx_test_error,
- rx_test_fail,
- rx_test_ok
-};
-
-enum rx_test_internal_return
-{
- rx_test_internal_error,
- rx_test_found_first,
- rx_test_line_finished
-};
-
-enum rx_test_match_entry
-{
- rx_test_start,
- rx_test_cache_hit_loop,
- rx_test_backreference_check,
- rx_test_backtrack_return
-};
-
-struct rx_search_state
-{
- /* Two groups of registers are kept. The group with the register state
- * of the current test match, and the group that holds the state at the end
- * of the best known match, if any.
- *
- * For some patterns, there may also be registers saved on the stack.
- */
- unsigned num_regs; /* Includes an element for register zero. */
- regoff_t * lparen; /* scratch space for register returns */
- regoff_t * rparen;
- regoff_t * best_lpspace; /* in case the user doesn't want these */
- regoff_t * best_rpspace; /* values, we still need space to store
- * them. Normally, this memoryis unused
- * and the space pointed to by REGS is
- * used instead.
- */
-
- int last_l; /* Highest index of a valid lparen. */
- int last_r; /* It's dual. */
-
- int * best_lparen; /* This contains the best known register */
- int * best_rparen; /* assignments.
- * This may point to the same mem as
- * best_lpspace, or it might point to memory
- * passed by the caller.
- */
- int best_last_l; /* best_last_l:best_lparen::last_l:lparen */
- int best_last_r;
-
-
- unsigned char * translate;
-
- struct rx_string_position outer_pos;
-
- struct rx_superstate * start_super;
- int nfa_choice;
- int first_found; /* If true, return after finding any match. */
- int ret_val;
-
- /* For continuations... */
- enum rx_outer_entry outer_search_resume_pt;
- struct re_pattern_buffer * saved_rxb;
- int saved_startpos;
- int saved_range;
- int saved_stop;
- int saved_total_size;
- rx_get_burst_fn saved_get_burst;
- rx_back_check_fn saved_back_check;
- struct re_registers * saved_regs;
-
- /**
- ** state for fastmap
- **/
- char * fastmap;
- int fastmap_chr;
- int fastmap_val;
-
- /* for continuations in the fastmap procedure: */
- enum rx_fastmap_entry fastmap_resume_pt;
-
- /**
- ** state for test_match
- **/
-
- /* The current superNFA position of the matcher. */
- struct rx_superstate * super;
-
- /* The matcher interprets a series of instruction frames.
- * This is the `instruction counter' for the interpretation.
- */
- struct rx_inx * ifr;
-
- /* We insert a ghost character in the string to prime
- * the nfa. test_pos.pos, test_pos.str_half, and test_pos.end_half
- * keep track of the test-match position and string-half.
- */
- unsigned char c;
-
- /* Position within the string. */
- struct rx_string_position test_pos;
-
- struct rx_stack_chunk * counter_stack;
- struct rx_stack_chunk * backtrack_stack;
- int backtrack_frame_bytes;
- int chunk_bytes;
- struct rx_stack_chunk * free_chunks;
-
- /* To return from this function, set test_ret and
- * `goto test_do_return'.
- *
- * Possible return values are:
- * 1 --- end of string while the superNFA is still going
- * 0 --- internal error (out of memory)
- * -1 --- search completed by reaching the superNFA fail state
- * -2 --- a match was found, maybe not the longest.
- *
- * When the search is complete (-1), best_last_r indicates whether
- * a match was found.
- *
- * -2 is return only if search_state.first_found is non-zero.
- *
- * if search_state.first_found is non-zero, a return of -1 indicates no match,
- * otherwise, best_last_r has to be checked.
- */
- int test_ret;
-
- int could_have_continued;
-
-#ifdef RX_DEBUG
- int backtrack_depth;
- /* There is a search tree with every node as set of deterministic
- * transitions in the super nfa. For every branch of a
- * backtrack point is an edge in the tree.
- * This counts up a pre-order of nodes in that tree.
- * It's saved on the search stack and printed when debugging.
- */
- int line_no;
- int lines_found;
-#endif
-
-
- /* For continuations within the match tester */
- enum rx_test_match_entry test_match_resume_pt;
- struct rx_inx * saved_next_tr_table;
- struct rx_inx * saved_this_tr_table;
- int saved_reg;
- struct rx_backtrack_frame * saved_bf;
-
-};
-
-
-extern char rx_slowmap[];
-extern unsigned char rx_id_translation[];
-
-static __inline__ void
-init_fastmap (rxb, search_state)
- struct re_pattern_buffer * rxb;
- struct rx_search_state * search_state;
-{
- search_state->fastmap = (rxb->fastmap
- ? (char *)rxb->fastmap
- : (char *)rx_slowmap);
- /* Update the fastmap now if not correct already.
- * When the regexp was compiled, the fastmap was computed
- * and stored in a bitset. This expands the bitset into a
- * character array containing 1s and 0s.
- */
- if ((search_state->fastmap == rxb->fastmap) && !rxb->fastmap_accurate)
- rx_blow_up_fastmap (rxb);
- search_state->fastmap_chr = -1;
- search_state->fastmap_val = 0;
- search_state->fastmap_resume_pt = rx_fastmap_start;
-}
-
-static __inline__ void
-uninit_fastmap (rxb, search_state)
- struct re_pattern_buffer * rxb;
- struct rx_search_state * search_state;
-{
- /* Unset the fastmap sentinel */
- if (search_state->fastmap_chr >= 0)
- search_state->fastmap[search_state->fastmap_chr]
- = search_state->fastmap_val;
-}
-
-static __inline__ int
-fastmap_search (rxb, stop, get_burst, app_closure, search_state)
- struct re_pattern_buffer * rxb;
- int stop;
- rx_get_burst_fn get_burst;
- void * app_closure;
- struct rx_search_state * search_state;
-{
- enum rx_fastmap_entry pc;
-
- if (0)
- {
- return_continuation:
- search_state->fastmap_resume_pt = pc;
- return rx_fastmap_continuation;
- }
-
- pc = search_state->fastmap_resume_pt;
-
- switch (pc)
- {
- default:
- return rx_fastmap_error;
- case rx_fastmap_start:
- init_fastmap_sentinal:
- /* For the sake of fast fastmapping, set a sentinal in the fastmap.
- * This sentinal will trap the fastmap loop when it reaches the last
- * valid character in a string half.
- *
- * This must be reset when the fastmap/search loop crosses a string
- * boundry, and before returning to the caller. So sometimes,
- * the fastmap loop is restarted with `continue', othertimes by
- * `goto init_fastmap_sentinal'.
- */
- if (search_state->outer_pos.size)
- {
- search_state->fastmap_chr = ((search_state->outer_pos.search_direction == 1)
- ? *(search_state->outer_pos.end - 1)
- : *search_state->outer_pos.string);
- search_state->fastmap_val
- = search_state->fastmap[search_state->fastmap_chr];
- search_state->fastmap[search_state->fastmap_chr] = 1;
- }
- else
- {
- search_state->fastmap_chr = -1;
- search_state->fastmap_val = 0;
- }
-
- if (search_state->outer_pos.pos >= search_state->outer_pos.end)
- goto fastmap_hit_bound;
- else
- {
- if (search_state->outer_pos.search_direction == 1)
- {
- if (search_state->fastmap_val)
- {
- for (;;)
- {
- while (!search_state->fastmap[*search_state->outer_pos.pos])
- ++search_state->outer_pos.pos;
- return rx_fastmap_ok;
- }
- }
- else
- {
- for (;;)
- {
- while (!search_state->fastmap[*search_state->outer_pos.pos])
- ++search_state->outer_pos.pos;
- if (*search_state->outer_pos.pos != search_state->fastmap_chr)
- return rx_fastmap_ok;
- else
- {
- ++search_state->outer_pos.pos;
- if (search_state->outer_pos.pos == search_state->outer_pos.end)
- goto fastmap_hit_bound;
- }
- }
- }
- }
- else
- {
- __const__ unsigned char * bound;
- bound = search_state->outer_pos.string - 1;
- if (search_state->fastmap_val)
- {
- for (;;)
- {
- while (!search_state->fastmap[*search_state->outer_pos.pos])
- --search_state->outer_pos.pos;
- return rx_fastmap_ok;
- }
- }
- else
- {
- for (;;)
- {
- while (!search_state->fastmap[*search_state->outer_pos.pos])
- --search_state->outer_pos.pos;
- if ((*search_state->outer_pos.pos != search_state->fastmap_chr) || search_state->fastmap_val)
- return rx_fastmap_ok;
- else
- {
- --search_state->outer_pos.pos;
- if (search_state->outer_pos.pos == bound)
- goto fastmap_hit_bound;
- }
- }
- }
- }
- }
-
- case rx_fastmap_string_break:
- fastmap_hit_bound:
- {
- /* If we hit a bound, it may be time to fetch another burst
- * of string, or it may be time to return a continuation to
- * the caller, or it might be time to fail.
- */
-
- int burst_state;
- burst_state = get_burst (&search_state->outer_pos, app_closure, stop);
- switch (burst_state)
- {
- default:
- case rx_get_burst_error:
- return rx_fastmap_error;
- case rx_get_burst_continuation:
- {
- pc = rx_fastmap_string_break;
- goto return_continuation;
- }
- case rx_get_burst_ok:
- goto init_fastmap_sentinal;
- case rx_get_burst_no_more:
- /* ...not a string split, simply no more string.
- *
- * When searching backward, running out of string
- * is reason to quit.
- *
- * When searching forward, we allow the possibility
- * of an (empty) match after the last character in the
- * virtual string. So, fall through to the matcher
- */
- return ( (search_state->outer_pos.search_direction == 1)
- ? rx_fastmap_ok
- : rx_fastmap_fail);
- }
- }
- }
-
-}
-
-
-
-#ifdef emacs
-/* The `emacs' switch turns on certain matching commands
- * that make sense only in Emacs.
- */
-#include "config.h"
-#include "lisp.h"
-#include "buffer.h"
-#include "syntax.h"
-#endif /* emacs */
-
-/* Setting RX_MEMDBUG is useful if you have dbmalloc. Maybe with similar
- * packages too.
- */
-#ifdef RX_MEMDBUG
-#include <malloc.h>
-#endif /* RX_RX_MEMDBUG */
-
-/* We used to test for `BSTRING' here, but only GCC and Emacs define
- * `BSTRING', as far as I know, and neither of them use this code.
- */
-#if HAVE_STRING_H || STDC_HEADERS
-#include <string.h>
-
-#ifndef bcmp
-#define bcmp(s1, s2, n) memcmp ((s1), (s2), (n))
-#endif
-
-#ifndef bcopy
-#define bcopy(s, d, n) memcpy ((d), (s), (n))
-#endif
-
-#ifndef bzero
-#define bzero(s, n) memset ((s), 0, (n))
-#endif
-
-#else /* HAVE_STRING_H || STDC_HEADERS */
-#include <strings.h>
-#endif /* not (HAVE_STRING_H || STDC_HEADERS) */
-
-#ifdef STDC_HEADERS
-#include <stdlib.h>
-#else /* not STDC_HEADERS */
-char *malloc ();
-char *realloc ();
-#endif /* not STDC_HEADERS */
-
-
-
-
-/* How many characters in the character set. */
-#define CHAR_SET_SIZE (1 << CHARBITS)
-
-#ifndef emacs
-/* Define the syntax basics for \<, \>, etc.
- * This must be nonzero for the wordchar and notwordchar pattern
- * commands in re_match_2.
- */
-#ifndef Sword
-#define Sword 1
-#endif
-#define SYNTAX(c) re_syntax_table[c]
-RX_DECL char re_syntax_table[CHAR_SET_SIZE];
-#endif /* not emacs */
-
-
-/* Test if at very beginning or at very end of the virtual concatenation
- * of `string1' and `string2'. If only one string, it's `string2'.
- */
-
-#define AT_STRINGS_BEG() \
- ( -1 \
- == ((search_state.test_pos.pos - search_state.test_pos.string) \
- + search_state.test_pos.offset))
-
-#define AT_STRINGS_END() \
- ( (total_size - 1) \
- == ((search_state.test_pos.pos - search_state.test_pos.string) \
- + search_state.test_pos.offset))
-
-
-/* Test if POS + 1 points to a character which is word-constituent. We have
- * two special cases to check for: if past the end of string1, look at
- * the first character in string2; and if before the beginning of
- * string2, look at the last character in string1.
- *
- * Assumes `string1' exists, so use in conjunction with AT_STRINGS_BEG ().
- */
-#define LETTER_P(POS,OFF) \
- ( SYNTAX (fetch_char(POS, OFF, app_closure, stop)) \
- == Sword)
-
-/* Test if the character at D and the one after D differ with respect
- * to being word-constituent.
- */
-#define AT_WORD_BOUNDARY(d) \
- (AT_STRINGS_BEG () || AT_STRINGS_END () || LETTER_P (d,0) != LETTER_P (d, 1))
-
-
-#ifdef RX_SUPPORT_CONTINUATIONS
-#define RX_STACK_ALLOC(BYTES) malloc(BYTES)
-#define RX_STACK_FREE(MEM) free(MEM)
-#else
-#define RX_STACK_ALLOC(BYTES) alloca(BYTES)
-#define RX_STACK_FREE(MEM) \
- ((struct rx_stack_chunk *)MEM)->next_chunk = search_state.free_chunks; \
- search_state.free_chunks = ((struct rx_stack_chunk *)MEM);
-
-#endif
-
-#define PUSH(CHUNK_VAR,BYTES) \
- if (!CHUNK_VAR || (CHUNK_VAR->bytes_left < (BYTES))) \
- { \
- struct rx_stack_chunk * new_chunk; \
- if (search_state.free_chunks) \
- { \
- new_chunk = search_state.free_chunks; \
- search_state.free_chunks = search_state.free_chunks->next_chunk; \
- } \
- else \
- { \
- new_chunk = (struct rx_stack_chunk *)RX_STACK_ALLOC(search_state.chunk_bytes); \
- if (!new_chunk) \
- { \
- search_state.ret_val = 0; \
- goto test_do_return; \
- } \
- } \
- new_chunk->sp = (char *)new_chunk + sizeof (struct rx_stack_chunk); \
- new_chunk->bytes_left = (search_state.chunk_bytes \
- - (BYTES) \
- - sizeof (struct rx_stack_chunk)); \
- new_chunk->next_chunk = CHUNK_VAR; \
- CHUNK_VAR = new_chunk; \
- } \
- else \
- (CHUNK_VAR->sp += (BYTES)), (CHUNK_VAR->bytes_left -= (BYTES))
-
-#define POP(CHUNK_VAR,BYTES) \
- if (CHUNK_VAR->sp == ((char *)CHUNK_VAR + sizeof(*CHUNK_VAR))) \
- { \
- struct rx_stack_chunk * new_chunk = CHUNK_VAR->next_chunk; \
- RX_STACK_FREE(CHUNK_VAR); \
- CHUNK_VAR = new_chunk; \
- } \
- else \
- (CHUNK_VAR->sp -= BYTES), (CHUNK_VAR->bytes_left += BYTES)
-
-
-
-#define SRCH_TRANSLATE(C) search_state.translate[(unsigned char) (C)]
-
-
-
-
-#ifdef __STDC__
-RX_DECL __inline__ int
-rx_search (struct re_pattern_buffer * rxb,
- int startpos,
- int range,
- int stop,
- int total_size,
- rx_get_burst_fn get_burst,
- rx_back_check_fn back_check,
- rx_fetch_char_fn fetch_char,
- void * app_closure,
- struct re_registers * regs,
- struct rx_search_state * resume_state,
- struct rx_search_state * save_state)
-#else
-RX_DECL __inline__ int
-rx_search (rxb, startpos, range, stop, total_size,
- get_burst, back_check, fetch_char,
- app_closure, regs, resume_state, save_state)
- struct re_pattern_buffer * rxb;
- int startpos;
- int range;
- int stop;
- int total_size;
- rx_get_burst_fn get_burst;
- rx_back_check_fn back_check;
- rx_fetch_char_fn fetch_char;
- void * app_closure;
- struct re_registers * regs;
- struct rx_search_state * resume_state;
- struct rx_search_state * save_state;
-#endif
-{
- int pc;
- int test_state;
- struct rx_search_state search_state;
-
- search_state.free_chunks = 0;
- if (!resume_state)
- pc = rx_outer_start;
- else
- {
- search_state = *resume_state;
- regs = search_state.saved_regs;
- rxb = search_state.saved_rxb;
- startpos = search_state.saved_startpos;
- range = search_state.saved_range;
- stop = search_state.saved_stop;
- total_size = search_state.saved_total_size;
- get_burst = search_state.saved_get_burst;
- back_check = search_state.saved_back_check;
- pc = search_state.outer_search_resume_pt;
- if (0)
- {
- return_continuation:
- if (save_state)
- {
- *save_state = search_state;
- save_state->saved_regs = regs;
- save_state->saved_rxb = rxb;
- save_state->saved_startpos = startpos;
- save_state->saved_range = range;
- save_state->saved_stop = stop;
- save_state->saved_total_size = total_size;
- save_state->saved_get_burst = get_burst;
- save_state->saved_back_check = back_check;
- save_state->outer_search_resume_pt = pc;
- }
- return rx_search_continuation;
- }
- }
-
- switch (pc)
- {
- case rx_outer_start:
- search_state.ret_val = rx_search_fail;
- ( search_state.lparen
- = search_state.rparen
- = search_state.best_lpspace
- = search_state.best_rpspace
- = 0);
-
- /* figure the number of registers we may need for use in backreferences.
- * the number here includes an element for register zero.
- */
- search_state.num_regs = rxb->re_nsub + 1;
-
-
- /* check for out-of-range startpos. */
- if ((startpos < 0) || (startpos > total_size))
- return rx_search_fail;
-
- /* fix up range if it might eventually take us outside the string. */
- {
- int endpos;
- endpos = startpos + range;
- if (endpos < -1)
- range = (-1 - startpos);
- else if (endpos > (total_size + 1))
- range = total_size - startpos;
- }
-
- /* if the search isn't to be a backwards one, don't waste time in a
- * long search for a pattern that says it is anchored.
- */
- if (rxb->begbuf_only && (range > 0))
- {
- if (startpos > 0)
- return rx_search_fail;
- else
- range = 1;
- }
-
- /* decide whether to use internal or user-provided reg buffers. */
- if (!regs || rxb->no_sub)
- {
- search_state.best_lpspace =
- (regoff_t *)REGEX_ALLOCATE (search_state.num_regs * sizeof(regoff_t));
- search_state.best_rpspace =
- (regoff_t *)REGEX_ALLOCATE (search_state.num_regs * sizeof(regoff_t));
- search_state.best_lparen = search_state.best_lpspace;
- search_state.best_rparen = search_state.best_rpspace;
- }
- else
- {
- /* have the register data arrays been allocated? */
- if (rxb->regs_allocated == REGS_UNALLOCATED)
- { /* no. so allocate them with malloc. we need one
- extra element beyond `search_state.num_regs' for the `-1' marker
- gnu code uses. */
- regs->num_regs = MAX (RE_NREGS, rxb->re_nsub + 1);
- regs->start = ((regoff_t *)
- malloc (regs->num_regs * sizeof ( regoff_t)));
- regs->end = ((regoff_t *)
- malloc (regs->num_regs * sizeof ( regoff_t)));
- if (regs->start == 0 || regs->end == 0)
- return rx_search_error;
- rxb->regs_allocated = REGS_REALLOCATE;
- }
- else if (rxb->regs_allocated == REGS_REALLOCATE)
- { /* yes. if we need more elements than were already
- allocated, reallocate them. if we need fewer, just
- leave it alone. */
- if (regs->num_regs < search_state.num_regs + 1)
- {
- regs->num_regs = search_state.num_regs + 1;
- regs->start = ((regoff_t *)
- realloc (regs->start,
- regs->num_regs * sizeof (regoff_t)));
- regs->end = ((regoff_t *)
- realloc (regs->end,
- regs->num_regs * sizeof ( regoff_t)));
- if (regs->start == 0 || regs->end == 0)
- return rx_search_error;
- }
- }
- else if (rxb->regs_allocated != REGS_FIXED)
- return rx_search_error;
-
- if (regs->num_regs < search_state.num_regs + 1)
- {
- search_state.best_lpspace =
- ((regoff_t *)
- REGEX_ALLOCATE (search_state.num_regs * sizeof(regoff_t)));
- search_state.best_rpspace =
- ((regoff_t *)
- REGEX_ALLOCATE (search_state.num_regs * sizeof(regoff_t)));
- search_state.best_lparen = search_state.best_lpspace;
- search_state.best_rparen = search_state.best_rpspace;
- }
- else
- {
- search_state.best_lparen = regs->start;
- search_state.best_rparen = regs->end;
- }
- }
-
- search_state.lparen =
- (regoff_t *) REGEX_ALLOCATE (search_state.num_regs * sizeof(regoff_t));
- search_state.rparen =
- (regoff_t *) REGEX_ALLOCATE (search_state.num_regs * sizeof(regoff_t));
-
- if (! ( search_state.best_rparen
- && search_state.best_lparen
- && search_state.lparen && search_state.rparen))
- return rx_search_error;
-
- search_state.best_last_l = search_state.best_last_r = -1;
-
- search_state.translate = (rxb->translate
- ? rxb->translate
- : rx_id_translation);
-
-
-
- /*
- * two nfa's were compiled.
- * `0' is complete.
- * `1' faster but gets registers wrong and ends too soon.
- */
- search_state.nfa_choice = (regs && !rxb->least_subs) ? '\0' : '\1';
-
- /* we have the option to look for the best match or the first
- * one we can find. if the user isn't asking for register information,
- * we don't need to find the best match.
- */
- search_state.first_found = !regs;
-
- if (range >= 0)
- {
- search_state.outer_pos.search_end = startpos + range;
- search_state.outer_pos.search_direction = 1;
- }
- else
- {
- search_state.outer_pos.search_end = startpos + range;
- search_state.outer_pos.search_direction = -1;
- }
-
- /* the vacuous search always turns up nothing. */
- if ((search_state.outer_pos.search_direction == 1)
- ? (startpos > search_state.outer_pos.search_end)
- : (startpos < search_state.outer_pos.search_end))
- return rx_search_fail;
-
- /* now we build the starting state of the supernfa. */
- {
- struct rx_superset * start_contents;
- struct rx_nfa_state_set * start_nfa_set;
-
- /* we presume here that the nfa start state has only one
- * possible future with no side effects.
- */
- start_nfa_set = rxb->start->futures->destset;
- if ( rxb->rx.start_set
- && (rxb->rx.start_set->starts_for == &rxb->rx))
- start_contents = rxb->rx.start_set;
- else
- {
- start_contents =
- rx_superstate_eclosure_union (&rxb->rx,
- rx_superset_cons (&rxb->rx, 0, 0),
- start_nfa_set);
-
- if (!start_contents)
- return rx_search_fail;
-
- start_contents->starts_for = &rxb->rx;
- rxb->rx.start_set = start_contents;
- }
- if ( start_contents->superstate
- && (start_contents->superstate->rx_id == rxb->rx.rx_id))
- {
- search_state.start_super = start_contents->superstate;
- rx_lock_superstate (&rxb->rx, search_state.start_super);
- }
- else
- {
- rx_protect_superset (&rxb->rx, start_contents);
-
- search_state.start_super = rx_superstate (&rxb->rx, start_contents);
- if (!search_state.start_super)
- return rx_search_fail;
- rx_lock_superstate (&rxb->rx, search_state.start_super);
- rx_release_superset (&rxb->rx, start_contents);
- }
- }
-
-
- /* The outer_pos tracks the position within the strings
- * as seen by loop that calls fastmap_search.
- *
- * The caller supplied get_burst function actually
- * gives us pointers to chars.
- *
- * Communication with the get_burst function is through an
- * rx_string_position structure. Here, the structure for
- * outer_pos is initialized. It is set to point to the
- * NULL string, at an offset of STARTPOS. STARTPOS is out
- * of range of the NULL string, so the first call to
- * getburst will patch up the rx_string_position to point
- * to valid characters.
- */
-
- ( search_state.outer_pos.string
- = search_state.outer_pos.end
- = 0);
-
- search_state.outer_pos.offset = 0;
- search_state.outer_pos.size = 0;
- search_state.outer_pos.pos = (unsigned char *)startpos;
- init_fastmap (rxb, &search_state);
-
- search_state.fastmap_resume_pt = rx_fastmap_start;
- case rx_outer_fastmap:
- /* do { */
- pseudo_do:
- {
- {
- int fastmap_state;
- fastmap_state = fastmap_search (rxb, stop, get_burst, app_closure,
- &search_state);
- switch (fastmap_state)
- {
- case rx_fastmap_continuation:
- pc = rx_outer_fastmap;
- goto return_continuation;
- case rx_fastmap_fail:
- goto finish;
- case rx_fastmap_ok:
- break;
- }
- }
-
- /* now the fastmap loop has brought us to a plausible
- * starting point for a match. so, it's time to run the
- * nfa and see if a match occured.
- */
- startpos = ( search_state.outer_pos.pos
- - search_state.outer_pos.string
- + search_state.outer_pos.offset);
-#if 0
-/*|*/ if ((range > 0) && (startpos == search_state.outer_pos.search_end))
-/*|*/ goto finish;
-#endif
- }
-
- search_state.test_match_resume_pt = rx_test_start;
- /* do interrupted for entry point... */
- case rx_outer_test:
- /* ...do continued */
- {
- goto test_match;
- test_returns_to_search:
- switch (test_state)
- {
- case rx_test_continuation:
- pc = rx_outer_test;
- goto return_continuation;
- case rx_test_error:
- search_state.ret_val = rx_search_error;
- goto finish;
- case rx_test_fail:
- break;
- case rx_test_ok:
- goto finish;
- }
- search_state.outer_pos.pos += search_state.outer_pos.search_direction;
- startpos += search_state.outer_pos.search_direction;
-#if 0
-/*|*/ if (search_state.test_pos.pos < search_state.test_pos.end)
-/*|*/ break;
-#endif
- }
- /* do interrupted for entry point... */
- case rx_outer_restore_pos:
- {
- int x;
- x = get_burst (&search_state.outer_pos, app_closure, stop);
- switch (x)
- {
- case rx_get_burst_continuation:
- pc = rx_outer_restore_pos;
- goto return_continuation;
- case rx_get_burst_error:
- search_state.ret_val = rx_search_error;
- goto finish;
- case rx_get_burst_no_more:
- if (rxb->can_match_empty)
- break;
- goto finish;
- case rx_get_burst_ok:
- break;
- }
- } /* } while (...see below...) */
-
- if ((search_state.outer_pos.search_direction == 1)
- ? (startpos <= search_state.outer_pos.search_end)
- : (startpos > search_state.outer_pos.search_end))
- goto pseudo_do;
-
-
- finish:
- uninit_fastmap (rxb, &search_state);
- if (search_state.start_super)
- rx_unlock_superstate (&rxb->rx, search_state.start_super);
-
-#ifdef regex_malloc
- if (search_state.lparen) free (search_state.lparen);
- if (search_state.rparen) free (search_state.rparen);
- if (search_state.best_lpspace) free (search_state.best_lpspace);
- if (search_state.best_rpspace) free (search_state.best_rpspace);
-#endif
- return search_state.ret_val;
- }
-
-
- test_match:
- {
- enum rx_test_match_entry test_pc;
- int inx;
- test_pc = search_state.test_match_resume_pt;
- if (test_pc == rx_test_start)
- {
-#ifdef RX_DEBUG
- search_state.backtrack_depth = 0;
-#endif
- search_state.last_l = search_state.last_r = 0;
- search_state.lparen[0] = startpos;
- search_state.super = search_state.start_super;
- search_state.c = search_state.nfa_choice;
- search_state.test_pos.pos = search_state.outer_pos.pos - 1;
- search_state.test_pos.string = search_state.outer_pos.string;
- search_state.test_pos.end = search_state.outer_pos.end;
- search_state.test_pos.offset = search_state.outer_pos.offset;
- search_state.test_pos.size = search_state.outer_pos.size;
- search_state.test_pos.search_direction = 1;
- search_state.counter_stack = 0;
- search_state.backtrack_stack = 0;
- search_state.backtrack_frame_bytes =
- (sizeof (struct rx_backtrack_frame)
- + (rxb->match_regs_on_stack
- ? sizeof (regoff_t) * (search_state.num_regs + 1) * 2
- : 0));
- search_state.chunk_bytes = search_state.backtrack_frame_bytes * 64;
- search_state.test_ret = rx_test_line_finished;
- search_state.could_have_continued = 0;
- }
- /* This is while (1)...except that the body of the loop is interrupted
- * by some alternative entry points.
- */
- pseudo_while_1:
- switch (test_pc)
- {
- case rx_test_cache_hit_loop:
- goto resume_continuation_1;
- case rx_test_backreference_check:
- goto resume_continuation_2;
- case rx_test_backtrack_return:
- goto resume_continuation_3;
- case rx_test_start:
-#ifdef RX_DEBUG
- /* There is a search tree with every node as set of deterministic
- * transitions in the super nfa. For every branch of a
- * backtrack point is an edge in the tree.
- * This counts up a pre-order of nodes in that tree.
- * It's saved on the search stack and printed when debugging.
- */
- search_state.line_no = 0;
- search_state.lines_found = 0;
-#endif
-
- top_of_cycle:
- /* A superstate is basicly a transition table, indexed by
- * characters from the string being tested, and containing
- * RX_INX (`instruction frame') structures.
- */
- search_state.ifr = &search_state.super->transitions [search_state.c];
-
- recurse_test_match:
- /* This is the point to which control is sent when the
- * test matcher `recurses'. Before jumping here, some variables
- * need to be saved on the stack and the next instruction frame
- * has to be computed.
- */
-
- restart:
- /* Some instructions don't advance the matcher, but just
- * carry out some side effects and fetch a new instruction.
- * To dispatch that new instruction, `goto restart'.
- */
-
- {
- struct rx_inx * next_tr_table;
- struct rx_inx * this_tr_table;
- /* The fastest route through the loop is when the instruction
- * is RX_NEXT_CHAR. This case is detected when SEARCH_STATE.IFR->DATA
- * is non-zero. In that case, it points to the next
- * superstate.
- *
- * This allows us to not bother fetching the bytecode.
- */
- next_tr_table = (struct rx_inx *)search_state.ifr->data;
- this_tr_table = search_state.super->transitions;
- while (next_tr_table)
- {
-#ifdef RX_DEBUG_0
- if (rx_debug_trace)
- {
- struct rx_superset * setp;
-
- fprintf (stderr, "%d %d>> re_next_char @ %d (%d)",
- search_state.line_no,
- search_state.backtrack_depth,
- (search_state.test_pos.pos - search_state.test_pos.string
- + search_state.test_pos.offset), search_state.c);
-
- search_state.super =
- ((struct rx_superstate *)
- ((char *)this_tr_table
- - ((unsigned long)
- ((struct rx_superstate *)0)->transitions)));
-
- setp = search_state.super->contents;
- fprintf (stderr, " superstet (rx=%d, &=%x: ",
- rxb->rx.rx_id, setp);
- while (setp)
- {
- fprintf (stderr, "%d ", setp->id);
- setp = setp->cdr;
- }
- fprintf (stderr, "\n");
- }
-#endif
- this_tr_table = next_tr_table;
- ++search_state.test_pos.pos;
- if (search_state.test_pos.pos == search_state.test_pos.end)
- {
- int burst_state;
- try_burst_1:
- burst_state = get_burst (&search_state.test_pos,
- app_closure, stop);
- switch (burst_state)
- {
- case rx_get_burst_continuation:
- search_state.saved_this_tr_table = this_tr_table;
- search_state.saved_next_tr_table = next_tr_table;
- test_pc = rx_test_cache_hit_loop;
- goto test_return_continuation;
-
- resume_continuation_1:
- /* Continuation one jumps here to do its work: */
- search_state.saved_this_tr_table = this_tr_table;
- search_state.saved_next_tr_table = next_tr_table;
- goto try_burst_1;
-
- case rx_get_burst_ok:
- /* get_burst succeeded...keep going */
- break;
-
- case rx_get_burst_no_more:
- search_state.test_ret = rx_test_line_finished;
- search_state.could_have_continued = 1;
- goto test_do_return;
-
- case rx_get_burst_error:
- /* An error... */
- search_state.test_ret = rx_test_internal_error;
- goto test_do_return;
- }
- }
- search_state.c = *search_state.test_pos.pos;
- search_state.ifr = this_tr_table + search_state.c;
- next_tr_table = (struct rx_inx *)search_state.ifr->data;
- } /* Fast loop through cached transition tables */
-
- /* Here when we ran out of cached next-char transitions.
- * So, it will be necessary to do a more expensive
- * dispatch on the current instruction. The superstate
- * pointer is allowed to become invalid during next-char
- * transitions -- now we must bring it up to date.
- */
- search_state.super =
- ((struct rx_superstate *)
- ((char *)this_tr_table
- - ((unsigned long)
- ((struct rx_superstate *)0)->transitions)));
- }
-
- /* We've encountered an instruction other than next-char.
- * Dispatch that instruction:
- */
- inx = (int)search_state.ifr->inx;
-#ifdef RX_DEBUG_0
- if (rx_debug_trace)
- {
- struct rx_superset * setp = search_state.super->contents;
-
- fprintf (stderr, "%d %d>> %s @ %d (%d)", search_state.line_no,
- search_state.backtrack_depth,
- inx_names[inx],
- (search_state.test_pos.pos - search_state.test_pos.string
- + (test_pos.half == 0 ? 0 : size1)), search_state.c);
-
- fprintf (stderr, " superstet (rx=%d, &=%x: ",
- rxb->rx.rx_id, setp);
- while (setp)
- {
- fprintf (stderr, "%d ", setp->id);
- setp = setp->cdr;
- }
- fprintf (stderr, "\n");
- }
-#endif
- switch ((enum rx_opcode)inx)
- {
- case rx_do_side_effects:
-
- /* RX_DO_SIDE_EFFECTS occurs when we cross epsilon
- * edges associated with parentheses, backreferencing, etc.
- */
- {
- struct rx_distinct_future * df =
- (struct rx_distinct_future *)search_state.ifr->data_2;
- struct rx_se_list * el = df->effects;
- /* Side effects come in lists. This walks down
- * a list, dispatching.
- */
- while (el)
- {
- long effect;
- effect = (long)el->car;
- if (effect < 0)
- {
-#ifdef RX_DEBUG_0
- if (rx_debug_trace)
- {
- struct rx_superset * setp = search_state.super->contents;
-
- fprintf (stderr, "....%d %d>> %s\n", search_state.line_no,
- search_state.backtrack_depth,
- efnames[-effect]);
- }
-#endif
- switch ((enum re_side_effects) effect)
-
- {
- case re_se_pushback:
- search_state.ifr = &df->future_frame;
- if (!search_state.ifr->data)
- {
- struct rx_superstate * sup;
- sup = search_state.super;
- rx_lock_superstate (rx, sup);
- if (!rx_handle_cache_miss (&rxb->rx,
- search_state.super,
- search_state.c,
- (search_state.ifr
- ->data_2)))
- {
- rx_unlock_superstate (rx, sup);
- search_state.test_ret = rx_test_internal_error;
- goto test_do_return;
- }
- rx_unlock_superstate (rx, sup);
- }
- /* --search_state.test_pos.pos; */
- search_state.c = 't';
- search_state.super
- = ((struct rx_superstate *)
- ((char *)search_state.ifr->data
- - (long)(((struct rx_superstate *)0)
- ->transitions)));
- goto top_of_cycle;
- break;
- case re_se_push0:
- {
- struct rx_counter_frame * old_cf
- = (search_state.counter_stack
- ? ((struct rx_counter_frame *)
- search_state.counter_stack->sp)
- : 0);
- struct rx_counter_frame * cf;
- PUSH (search_state.counter_stack,
- sizeof (struct rx_counter_frame));
- cf = ((struct rx_counter_frame *)
- search_state.counter_stack->sp);
- cf->tag = re_se_iter;
- cf->val = 0;
- cf->inherited_from = 0;
- cf->cdr = old_cf;
- break;
- }
- case re_se_fail:
- goto test_do_return;
- case re_se_begbuf:
- if (!AT_STRINGS_BEG ())
- goto test_do_return;
- break;
- case re_se_endbuf:
- if (!AT_STRINGS_END ())
- goto test_do_return;
- break;
- case re_se_wordbeg:
- if ( LETTER_P (&search_state.test_pos, 1)
- && ( AT_STRINGS_BEG()
- || !LETTER_P (&search_state.test_pos, 0)))
- break;
- else
- goto test_do_return;
- case re_se_wordend:
- if ( !AT_STRINGS_BEG ()
- && LETTER_P (&search_state.test_pos, 0)
- && (AT_STRINGS_END ()
- || !LETTER_P (&search_state.test_pos, 1)))
- break;
- else
- goto test_do_return;
- case re_se_wordbound:
- if (AT_WORD_BOUNDARY (&search_state.test_pos))
- break;
- else
- goto test_do_return;
- case re_se_notwordbound:
- if (!AT_WORD_BOUNDARY (&search_state.test_pos))
- break;
- else
- goto test_do_return;
- case re_se_hat:
- if (AT_STRINGS_BEG ())
- {
- if (rxb->not_bol)
- goto test_do_return;
- else
- break;
- }
- else
- {
- char pos_c = *search_state.test_pos.pos;
- if ( (SRCH_TRANSLATE (pos_c)
- == SRCH_TRANSLATE('\n'))
- && rxb->newline_anchor)
- break;
- else
- goto test_do_return;
- }
- case re_se_dollar:
- if (AT_STRINGS_END ())
- {
- if (rxb->not_eol)
- goto test_do_return;
- else
- break;
- }
- else
- {
- if ( ( SRCH_TRANSLATE (fetch_char
- (&search_state.test_pos, 1,
- app_closure, stop))
- == SRCH_TRANSLATE ('\n'))
- && rxb->newline_anchor)
- break;
- else
- goto test_do_return;
- }
-
- case re_se_try:
- /* This is the first side effect in every
- * expression.
- *
- * FOR NO GOOD REASON...get rid of it...
- */
- break;
-
- case re_se_pushpos:
- {
- int urhere =
- ((int)(search_state.test_pos.pos
- - search_state.test_pos.string)
- + search_state.test_pos.offset);
- struct rx_counter_frame * old_cf
- = (search_state.counter_stack
- ? ((struct rx_counter_frame *)
- search_state.counter_stack->sp)
- : 0);
- struct rx_counter_frame * cf;
- PUSH(search_state.counter_stack,
- sizeof (struct rx_counter_frame));
- cf = ((struct rx_counter_frame *)
- search_state.counter_stack->sp);
- cf->tag = re_se_pushpos;
- cf->val = urhere;
- cf->inherited_from = 0;
- cf->cdr = old_cf;
- break;
- }
-
- case re_se_chkpos:
- {
- int urhere =
- ((int)(search_state.test_pos.pos
- - search_state.test_pos.string)
- + search_state.test_pos.offset);
- struct rx_counter_frame * cf
- = ((struct rx_counter_frame *)
- search_state.counter_stack->sp);
- if (cf->val == urhere)
- goto test_do_return;
- cf->val = urhere;
- break;
- }
- break;
-
- case re_se_poppos:
- POP(search_state.counter_stack,
- sizeof (struct rx_counter_frame));
- break;
-
-
- case re_se_at_dot:
- case re_se_syntax:
- case re_se_not_syntax:
-#ifdef emacs
- /*
- * this release lacks emacs support
- */
-#endif
- break;
- case re_se_win:
- case re_se_lparen:
- case re_se_rparen:
- case re_se_backref:
- case re_se_iter:
- case re_se_end_iter:
- case re_se_tv:
- case re_floogle_flap:
- search_state.ret_val = 0;
- goto test_do_return;
- }
- }
- else
- {
-#ifdef RX_DEBUG_0
- if (rx_debug_trace)
- fprintf (stderr, "....%d %d>> %s %d %d\n", search_state.line_no,
- search_state.backtrack_depth,
- efnames2[rxb->se_params [effect].se],
- rxb->se_params [effect].op1,
- rxb->se_params [effect].op2);
-#endif
- switch (rxb->se_params [effect].se)
- {
- case re_se_win:
- /* This side effect indicates that we've
- * found a match, though not necessarily the
- * best match. This is a fancy assignment to
- * register 0 unless the caller didn't
- * care about registers. In which case,
- * this stops the match.
- */
- {
- int urhere =
- ((int)(search_state.test_pos.pos
- - search_state.test_pos.string)
- + search_state.test_pos.offset);
-
- if ( (search_state.best_last_r < 0)
- || (urhere + 1 > search_state.best_rparen[0]))
- {
- /* Record the best known and keep
- * looking.
- */
- int x;
- for (x = 0; x <= search_state.last_l; ++x)
- search_state.best_lparen[x] = search_state.lparen[x];
- search_state.best_last_l = search_state.last_l;
- for (x = 0; x <= search_state.last_r; ++x)
- search_state.best_rparen[x] = search_state.rparen[x];
- search_state.best_rparen[0] = urhere + 1;
- search_state.best_last_r = search_state.last_r;
- }
- /* If we're not reporting the match-length
- * or other register info, we need look no
- * further.
- */
- if (search_state.first_found)
- {
- search_state.test_ret = rx_test_found_first;
- goto test_do_return;
- }
- }
- break;
- case re_se_lparen:
- {
- int urhere =
- ((int)(search_state.test_pos.pos
- - search_state.test_pos.string)
- + search_state.test_pos.offset);
-
- int reg = rxb->se_params [effect].op1;
-#if 0
- if (reg > search_state.last_l)
-#endif
- {
- search_state.lparen[reg] = urhere + 1;
- /* In addition to making this assignment,
- * we now know that lower numbered regs
- * that haven't already been assigned,
- * won't be. We make sure they're
- * filled with -1, so they can be
- * recognized as unassigned.
- */
- if (search_state.last_l < reg)
- while (++search_state.last_l < reg)
- search_state.lparen[search_state.last_l] = -1;
- }
- break;
- }
-
- case re_se_rparen:
- {
- int urhere =
- ((int)(search_state.test_pos.pos
- - search_state.test_pos.string)
- + search_state.test_pos.offset);
- int reg = rxb->se_params [effect].op1;
- search_state.rparen[reg] = urhere + 1;
- if (search_state.last_r < reg)
- {
- while (++search_state.last_r < reg)
- search_state.rparen[search_state.last_r]
- = -1;
- }
- break;
- }
-
- case re_se_backref:
- {
- int reg = rxb->se_params [effect].op1;
- if ( reg > search_state.last_r
- || search_state.rparen[reg] < 0)
- goto test_do_return;
-
- {
- int backref_status;
- check_backreference:
- backref_status
- = back_check (&search_state.test_pos,
- search_state.lparen[reg],
- search_state.rparen[reg],
- search_state.translate,
- app_closure,
- stop);
- switch (backref_status)
- {
- case rx_back_check_continuation:
- search_state.saved_reg = reg;
- test_pc = rx_test_backreference_check;
- goto test_return_continuation;
- resume_continuation_2:
- reg = search_state.saved_reg;
- goto check_backreference;
- case rx_back_check_fail:
- /* Fail */
- goto test_do_return;
- case rx_back_check_pass:
- /* pass --
- * test_pos now advanced to last
- * char matched by backref
- */
- break;
- }
- }
- break;
- }
- case re_se_iter:
- {
- struct rx_counter_frame * csp
- = ((struct rx_counter_frame *)
- search_state.counter_stack->sp);
- if (csp->val == rxb->se_params[effect].op2)
- goto test_do_return;
- else
- ++csp->val;
- break;
- }
- case re_se_end_iter:
- {
- struct rx_counter_frame * csp
- = ((struct rx_counter_frame *)
- search_state.counter_stack->sp);
- if (csp->val < rxb->se_params[effect].op1)
- goto test_do_return;
- else
- {
- struct rx_counter_frame * source = csp;
- while (source->inherited_from)
- source = source->inherited_from;
- if (!source || !source->cdr)
- {
- POP(search_state.counter_stack,
- sizeof(struct rx_counter_frame));
- }
- else
- {
- source = source->cdr;
- csp->val = source->val;
- csp->tag = source->tag;
- csp->cdr = 0;
- csp->inherited_from = source;
- }
- }
- break;
- }
- case re_se_tv:
- /* is a noop */
- break;
- case re_se_try:
- case re_se_pushback:
- case re_se_push0:
- case re_se_pushpos:
- case re_se_chkpos:
- case re_se_poppos:
- case re_se_at_dot:
- case re_se_syntax:
- case re_se_not_syntax:
- case re_se_begbuf:
- case re_se_hat:
- case re_se_wordbeg:
- case re_se_wordbound:
- case re_se_notwordbound:
- case re_se_wordend:
- case re_se_endbuf:
- case re_se_dollar:
- case re_se_fail:
- case re_floogle_flap:
- search_state.ret_val = 0;
- goto test_do_return;
- }
- }
- el = el->cdr;
- }
- /* Now the side effects are done,
- * so get the next instruction.
- * and move on.
- */
- search_state.ifr = &df->future_frame;
- goto restart;
- }
-
- case rx_backtrack_point:
- {
- /* A backtrack point indicates that we've reached a
- * non-determinism in the superstate NFA. This is a
- * loop that exhaustively searches the possibilities.
- *
- * A backtracking strategy is used. We keep track of what
- * registers are valid so we can erase side effects.
- *
- * First, make sure there is some stack space to hold
- * our state.
- */
-
- struct rx_backtrack_frame * bf;
-
- PUSH(search_state.backtrack_stack,
- search_state.backtrack_frame_bytes);
-#ifdef RX_DEBUG_0
- ++search_state.backtrack_depth;
-#endif
-
- bf = ((struct rx_backtrack_frame *)
- search_state.backtrack_stack->sp);
- {
- bf->stk_super = search_state.super;
- /* We prevent the current superstate from being
- * deleted from the superstate cache.
- */
- rx_lock_superstate (&rxb->rx, search_state.super);
-#ifdef RX_DEBUG_0
- bf->stk_search_state.line_no = search_state.line_no;
-#endif
- bf->stk_c = search_state.c;
- bf->stk_test_pos = search_state.test_pos;
- bf->stk_last_l = search_state.last_l;
- bf->stk_last_r = search_state.last_r;
- bf->df = ((struct rx_super_edge *)
- search_state.ifr->data_2)->options;
- bf->first_df = bf->df;
- bf->counter_stack_sp = (search_state.counter_stack
- ? search_state.counter_stack->sp
- : 0);
- bf->stk_test_ret = search_state.test_ret;
- if (rxb->match_regs_on_stack)
- {
- int x;
- regoff_t * stk =
- (regoff_t *)((char *)bf + sizeof (*bf));
- for (x = 0; x <= search_state.last_l; ++x)
- stk[x] = search_state.lparen[x];
- stk += x;
- for (x = 0; x <= search_state.last_r; ++x)
- stk[x] = search_state.rparen[x];
- }
- }
-
- /* Here is a while loop whose body is mainly a function
- * call and some code to handle a return from that
- * function.
- *
- * From here on for the rest of `case backtrack_point' it
- * is unsafe to assume that the search_state copies of
- * variables saved on the backtracking stack are valid
- * -- so read their values from the backtracking stack.
- *
- * This lets us use one generation fewer stack saves in
- * the call-graph of a search.
- */
-
- while_non_det_options:
-#ifdef RX_DEBUG_0
- ++search_state.lines_found;
- if (rx_debug_trace)
- fprintf (stderr, "@@@ %d calls %d @@@\n",
- search_state.line_no, search_state.lines_found);
-
- search_state.line_no = search_state.lines_found;
-#endif
-
- if (bf->df->next_same_super_edge[0] == bf->first_df)
- {
- /* This is a tail-call optimization -- we don't recurse
- * for the last of the possible futures.
- */
- search_state.ifr = (bf->df->effects
- ? &bf->df->side_effects_frame
- : &bf->df->future_frame);
-
- rx_unlock_superstate (&rxb->rx, search_state.super);
- POP(search_state.backtrack_stack,
- search_state.backtrack_frame_bytes);
-#ifdef RX_DEBUG
- --search_state.backtrack_depth;
-#endif
- goto restart;
- }
- else
- {
- if (search_state.counter_stack)
- {
- struct rx_counter_frame * old_cf
- = ((struct rx_counter_frame *)search_state.counter_stack->sp);
- struct rx_counter_frame * cf;
- PUSH(search_state.counter_stack, sizeof (struct rx_counter_frame));
- cf = ((struct rx_counter_frame *)search_state.counter_stack->sp);
- cf->tag = old_cf->tag;
- cf->val = old_cf->val;
- cf->inherited_from = old_cf;
- cf->cdr = 0;
- }
- /* `Call' this test-match block */
- search_state.ifr = (bf->df->effects
- ? &bf->df->side_effects_frame
- : &bf->df->future_frame);
- goto recurse_test_match;
- }
-
- /* Returns in this block are accomplished by
- * goto test_do_return. There are two cases.
- * If there is some search-stack left,
- * then it is a return from a `recursive' call.
- * If there is no search-stack left, then
- * we should return to the fastmap/search loop.
- */
-
- test_do_return:
-
- if (!search_state.backtrack_stack)
- {
-#ifdef RX_DEBUG_0
- if (rx_debug_trace)
- fprintf (stderr, "!!! %d bails returning %d !!!\n",
- search_state.line_no, search_state.test_ret);
-#endif
-
- /* No more search-stack -- this test is done. */
- if (search_state.test_ret != rx_test_internal_error)
- goto return_from_test_match;
- else
- goto error_in_testing_match;
- }
-
- /* Returning from a recursive call to
- * the test match block:
- */
-
- bf = ((struct rx_backtrack_frame *)
- search_state.backtrack_stack->sp);
-#ifdef RX_DEBUG_0
- if (rx_debug_trace)
- fprintf (stderr, "+++ %d returns %d (to %d)+++\n",
- search_state.line_no,
- search_state.test_ret,
- bf->stk_search_state.line_no);
-#endif
-
- while (search_state.counter_stack
- && (!bf->counter_stack_sp
- || (bf->counter_stack_sp
- != search_state.counter_stack->sp)))
- {
- POP(search_state.counter_stack,
- sizeof (struct rx_counter_frame));
- }
-
- if (search_state.test_ret == rx_test_internal_error)
- {
- POP (search_state.backtrack_stack,
- search_state.backtrack_frame_bytes);
- search_state.test_ret = rx_test_internal_error;
- goto test_do_return;
- }
-
- /* If a non-longest match was found and that is good
- * enough, return immediately.
- */
- if ( (search_state.test_ret == rx_test_found_first)
- && search_state.first_found)
- {
- rx_unlock_superstate (&rxb->rx, bf->stk_super);
- POP (search_state.backtrack_stack,
- search_state.backtrack_frame_bytes);
- goto test_do_return;
- }
-
- search_state.test_ret = bf->stk_test_ret;
- search_state.last_l = bf->stk_last_l;
- search_state.last_r = bf->stk_last_r;
- bf->df = bf->df->next_same_super_edge[0];
- search_state.super = bf->stk_super;
- search_state.c = bf->stk_c;
-#ifdef RX_DEBUG_0
- search_state.line_no = bf->stk_search_state.line_no;
-#endif
-
- if (rxb->match_regs_on_stack)
- {
- int x;
- regoff_t * stk =
- (regoff_t *)((char *)bf + sizeof (*bf));
- for (x = 0; x <= search_state.last_l; ++x)
- search_state.lparen[x] = stk[x];
- stk += x;
- for (x = 0; x <= search_state.last_r; ++x)
- search_state.rparen[x] = stk[x];
- }
-
- {
- int x;
- try_burst_2:
- x = get_burst (&bf->stk_test_pos, app_closure, stop);
- switch (x)
- {
- case rx_get_burst_continuation:
- search_state.saved_bf = bf;
- test_pc = rx_test_backtrack_return;
- goto test_return_continuation;
- resume_continuation_3:
- bf = search_state.saved_bf;
- goto try_burst_2;
- case rx_get_burst_no_more:
- /* Since we've been here before, it is some kind of
- * error that we can't return.
- */
- case rx_get_burst_error:
- search_state.test_ret = rx_test_internal_error;
- goto test_do_return;
- case rx_get_burst_ok:
- break;
- }
- }
- search_state.test_pos = bf->stk_test_pos;
- goto while_non_det_options;
- }
-
-
- case rx_cache_miss:
- /* Because the superstate NFA is lazily constructed,
- * and in fact may erode from underneath us, we sometimes
- * have to construct the next instruction from the hard way.
- * This invokes one step in the lazy-conversion.
- */
- search_state.ifr = rx_handle_cache_miss (&rxb->rx,
- search_state.super,
- search_state.c,
- search_state.ifr->data_2);
- if (!search_state.ifr)
- {
- search_state.test_ret = rx_test_internal_error;
- goto test_do_return;
- }
- goto restart;
-
- case rx_backtrack:
- /* RX_BACKTRACK means that we've reached the empty
- * superstate, indicating that match can't succeed
- * from this point.
- */
- goto test_do_return;
-
- case rx_next_char:
- case rx_error_inx:
- case rx_num_instructions:
- search_state.ret_val = 0;
- goto test_do_return;
- }
- goto pseudo_while_1;
- }
-
- /* Healthy exits from the test-match loop do a
- * `goto return_from_test_match' On the other hand,
- * we might end up here.
- */
- error_in_testing_match:
- test_state = rx_test_error;
- goto test_returns_to_search;
-
- /***** fastmap/search loop body
- * considering the results testing for a match
- */
-
- return_from_test_match:
-
- if (search_state.best_last_l >= 0)
- {
- if (regs && (regs->start != search_state.best_lparen))
- {
- bcopy (search_state.best_lparen, regs->start,
- regs->num_regs * sizeof (int));
- bcopy (search_state.best_rparen, regs->end,
- regs->num_regs * sizeof (int));
- }
- if (regs && !rxb->no_sub)
- {
- int q;
- int bound = (regs->num_regs > search_state.num_regs
- ? regs->num_regs
- : search_state.num_regs);
- regoff_t * s = regs->start;
- regoff_t * e = regs->end;
- for (q = search_state.best_last_l + 1; q < bound; ++q)
- s[q] = e[q] = -1;
- }
- search_state.ret_val = search_state.best_lparen[0];
- test_state = rx_test_ok;
- goto test_returns_to_search;
- }
- else
- {
- test_state = rx_test_fail;
- goto test_returns_to_search;
- }
-
- test_return_continuation:
- search_state.test_match_resume_pt = test_pc;
- test_state = rx_test_continuation;
- goto test_returns_to_search;
- }
-}
-
-
-
-#endif /* RX_WANT_RX_DEFS */
-
-
-
-#else /* RX_WANT_SE_DEFS */
- /* Integers are used to represent side effects.
- *
- * Simple side effects are given negative integer names by these enums.
- *
- * Non-negative names are reserved for complex effects.
- *
- * Complex effects are those that take arguments. For example,
- * a register assignment associated with a group is complex because
- * it requires an argument to tell which group is being matched.
- *
- * The integer name of a complex effect is an index into rxb->se_params.
- */
-
- RX_DEF_SE(1, re_se_try, = -1) /* Epsilon from start state */
-
- RX_DEF_SE(0, re_se_pushback, = re_se_try - 1)
- RX_DEF_SE(0, re_se_push0, = re_se_pushback -1)
- RX_DEF_SE(0, re_se_pushpos, = re_se_push0 - 1)
- RX_DEF_SE(0, re_se_chkpos, = re_se_pushpos -1)
- RX_DEF_SE(0, re_se_poppos, = re_se_chkpos - 1)
-
- RX_DEF_SE(1, re_se_at_dot, = re_se_poppos - 1) /* Emacs only */
- RX_DEF_SE(0, re_se_syntax, = re_se_at_dot - 1) /* Emacs only */
- RX_DEF_SE(0, re_se_not_syntax, = re_se_syntax - 1) /* Emacs only */
-
- RX_DEF_SE(1, re_se_begbuf, = re_se_not_syntax - 1) /* match beginning of buffer */
- RX_DEF_SE(1, re_se_hat, = re_se_begbuf - 1) /* match beginning of line */
-
- RX_DEF_SE(1, re_se_wordbeg, = re_se_hat - 1)
- RX_DEF_SE(1, re_se_wordbound, = re_se_wordbeg - 1)
- RX_DEF_SE(1, re_se_notwordbound, = re_se_wordbound - 1)
-
- RX_DEF_SE(1, re_se_wordend, = re_se_notwordbound - 1)
- RX_DEF_SE(1, re_se_endbuf, = re_se_wordend - 1)
-
- /* This fails except at the end of a line.
- * It deserves to go here since it is typicly one of the last steps
- * in a match.
- */
- RX_DEF_SE(1, re_se_dollar, = re_se_endbuf - 1)
-
- /* Simple effects: */
- RX_DEF_SE(1, re_se_fail, = re_se_dollar - 1)
-
- /* Complex effects. These are used in the 'se' field of
- * a struct re_se_params. Indexes into the se array
- * are stored as instructions on nfa edges.
- */
- RX_DEF_CPLX_SE(1, re_se_win, = 0)
- RX_DEF_CPLX_SE(1, re_se_lparen, = re_se_win + 1)
- RX_DEF_CPLX_SE(1, re_se_rparen, = re_se_lparen + 1)
- RX_DEF_CPLX_SE(0, re_se_backref, = re_se_rparen + 1)
- RX_DEF_CPLX_SE(0, re_se_iter, = re_se_backref + 1)
- RX_DEF_CPLX_SE(0, re_se_end_iter, = re_se_iter + 1)
- RX_DEF_CPLX_SE(0, re_se_tv, = re_se_end_iter + 1)
-
-#endif
-
-#endif
diff --git a/contrib/libg++/libstdc++/ChangeLog b/contrib/libg++/libstdc++/ChangeLog
deleted file mode 100644
index fc08f0d7d90b..000000000000
--- a/contrib/libg++/libstdc++/ChangeLog
+++ /dev/null
@@ -1,620 +0,0 @@
-Tue Jun 18 18:36:58 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * Version 2.7.2.
-
-Mon Jun 17 13:57:24 1996 Per Bothner <bothner@deneb.cygnus.com>
-
- * std/bastring.h (class basic_string::remove): Add casts.
-
- * configure.in: Use EXTRA_DISTCLEAN rather than DISTCLEAN.
-
-Wed Apr 24 10:43:07 1996 Doug Evans <dje@blues.cygnus.com>
-
- * Makefile.in (newi.o,cstringi.o,stddefi.o,cstdlibi.o,cmathi.o): Add
- rules for SunOS VPATH.
-
-Mon Apr 8 15:20:32 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * configure.in: Permit --enable-shared to specify a list of
- directories.
-
-Thu Mar 7 07:29:00 1996 Lee Iverson <leei@Canada.AI.SRI.COM>
-
- * Makefile.in (install): Restore deleted chdir to stl subdir.
-
-Tue Feb 20 18:29:30 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * Makefile.in (CXXFLAGS): Remove -pedantic -ansi.
- (CFLAGS): Ditto.
-
-Wed Feb 14 14:39:07 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * std/bastring.cc (check_realloc): Fix for sizeof (charT) > 1.
- From John Hickin <hickin@bnr.ca>.
-
-Wed Jan 10 11:05:04 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * std/bastring.h (insert): Fix iterator handling.
- From Joe Buck <jbuck@synopsys.com>.
-
-Mon Jan 8 11:48:03 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * std/bastring.h (max_size): Fix for sizeof (charT) > 1.
- * std/bastring.cc (replace): Use it.
-
- * std/bastring.cc (rfind): Fix for n > length ().
-
-Tue Dec 19 15:13:08 1995 Jason Merrill <jason@yorick.cygnus.com>
-
- * config/aix.ml (SHFLAGS): Add -Wl,-unix.
-
-Mon Dec 18 12:48:25 1995 Mike Stump <mrs@cygnus.com>
-
- * Makefile.in (exceptioni.o): Compile with -fhandle-exceptions, so
- we can unwind through unexpected on machines that don't have a
- working __unwind_function.
-
-Sun Dec 17 00:28:31 1995 Jeffrey A Law (law@cygnus.com)
-
- * Makefile.in (install): Make sure shared libraries
- are installed with mode 555.
-
-Mon Nov 27 15:01:56 1995 Jason Merrill <jason@yorick.cygnus.com>
-
- * Makefile.in (install): Make shared library links relative.
- (install): Break up -sf into -s -f.
- ({M,}SHLINK): Ditto.
-
-Sun Nov 26 22:48:06 1995 Jason Merrill <jason@yorick.cygnus.com>
-
- * queue: Include <stack.h> instead of <queue.h>.
-
-Sat Nov 25 11:33:13 1995 Doug Evans <dje@canuck.cygnus.com>
-
- * Makefile.in (install): Fix setting of rootme.
-
-Tue Nov 21 14:20:34 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * configure.in: Check ${with_cross_host} rather than comparing
- ${host} and ${target}.
-
-Tue Nov 14 01:50:52 1995 Doug Evans <dje@canuck.cygnus.com>
-
- * Makefile.in (IO_DIR): Delete MULTITOP, MULTISUBDIR.
- (LIBIBERTY_DIR): Likewise.
- (INSTALLDIR): Delete MULTISUBDIR.
- * configure.in: Delete call to cfg-ml-com.in. Call config-ml.in
- instead of cfg-ml-pos.in.
- (XCXXINCLUDES): Delete MULTITOP.
- * stl/configure.in (XCXXINCLUDES): Delete MULTITOP.
- (config-ml.in): Call instead of cfg-ml-pos.in.
-
-Sun Nov 12 16:44:25 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * Makefile.in (VERSION): Set to 2.7.1.
-
-Thu Nov 9 17:39:28 1995 Jason Merrill <jason@yorick.cygnus.com>
-
- * config/{aix,dec-osf,irix5,linux,sol2shm}.ml: Remove LDLIBS defn;
- no longer needed now that make check sets LD_LIBRARY_PATH.
-
-Wed Nov 8 19:46:35 1995 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * std/bastring.h: Wrap with #ifndef/#define/#endif.
- * std/cassert.h: Likewise.
- * std/cinst.h: Likewise.
- * std/complext.h: Likewise.
- * std/dcomplex.h: Likewise.
- * std/fcomplex.h: Likewise.
- * std/ldcomplex.h: Likewise.
- * std/sinst.h: Likewise.
-
-Wed Nov 8 16:15:48 1995 Jason Merrill <jason@yorick.cygnus.com>
-
- * std/bastring.cc (getline): Update to September 95 WP. Now we
- don't set failbit when reading an empty line.
-
-Tue Nov 7 16:09:04 1995 Jason Merrill <jason@yorick.cygnus.com>
-
- * std/bastring.cc (new): Fix for sizeof (charT) != 1.
-
-Sat Nov 4 17:37:16 1995 Jason Merrill <jason@yorick.cygnus.com>
-
- * std/complext.cc (operator / (FLOAT, const complex<FLOAT>&)):
- Reimplement along the lines of the other operator / templates.
- From John Eaton <jwe@bevo.che.wisc.edu>.
-
-Sat Nov 4 13:33:50 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * configure.in (DISTCLEAN): New, to add target-mkfrag.
-
-Tue Oct 31 13:59:32 1995 Jason Merrill <jason@yorick.cygnus.com>
-
- * std/bastring.h: Use size_t for the reference count.
- * std/bastring.cc (create): Set selfish.
- From Joe Buck (jbuck@synopsys.com).
-
-Mon Oct 30 23:09:48 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * configure.in: Don't bother changing LIBIBERTY for cross,
- now that we are using target-libiberty instead.
- * Makefile.in (LIBIBERTY_DIR): Simplify.
- (LIBIBERTY): Remove.
-
-Wed Oct 11 14:56:49 1995 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * config/sol2shm.ml: New files with -rpath.
- * configure (*-*-solaris*): Use sol2shm.ml.
-
-Thu Sep 28 09:26:52 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * std/straits.h (compare, copy, move, set): Fix for non-char charT's.
- * std/bastring.h (basic_string::remove): Fix for non-char charT's.
-
-Tue Sep 26 15:22:56 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * config/irix5.ml: Pass -rpath to links.
-
-Fri Sep 15 00:17:47 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * config/linux.ml: Conform to Linux shared library numbering
- scheme.
- * Makefile.in: Ditto.
-
-Tue Sep 12 00:28:56 1995 Mike Stump <mrs@cygnus.com>
-
- * typeinfoi.cc: (__pointer_type_info::__rtti_match): Moved from
- the headerfile, include all sorts of pointer conversions from 15.3
- para 2.
- * std/typeinfo.h (__pointer_type_info::__rtti_match): Moved from here.
-
-Mon Sep 11 23:27:59 1995 Mike Stump <mrs@cygnus.com>
-
- * std/typeinfo.h (__pointer_type_info::__rtti_match): We no longer
- have to dereference the object pointer, as the pointer is always
- passed directly.
-
-Mon Sep 11 19:29:51 1995 Mike Stump <mrs@cygnus.com>
-
- * std/typeinfo.h (__pointer_type_info::__rtti_match): Define so
- that pointer conversions can happen on catch type matching.
- * typeinfoi.cc (__throw_type_match_rtti): Arrange for __rtti_match
- to be used on pointers.
-
-Tue Sep 5 14:49:19 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * string.h: Remove for now.
-
-Thu Aug 31 14:14:01 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * std/bastring.cc (operator>>): Simplify and fix.
- (resize): Fix order of arguments to append.
- (getline): Simplify and fix.
-
-Thu Aug 24 17:44:09 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * std/cstdlib.h (abs): Provide default implementation for peons
- without labs.
-
-Tue Aug 22 08:43:07 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * std/cstdlib.h: Comment out definition of div(long,long) for now,
- since not all targets have ldiv.
-
-Mon Aug 21 11:46:03 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * std/cmath.h: Wrap abs(double) with #if ! _G_MATH_H_INLINES.
-
- * stl.h: Add, for compatibility with ObjectSpace STL.
-
- * std/complext.cc (operator /): Use abs instead of fabs.
-
- * std/bastring.h (replace): Update single-character replace method
- as per my proposal.
-
- * std/cmath.h: Add abs(float), abs(double) and abs(long double).
- Add commented-out declarations for other float and long double
- math functions.
-
- * std/cstdlib.h: Add abs(long) and div(long,long).
-
- * Makefile.in (install): Make shared library executable and
- non-writable. Tidy.
- (OBJS): Add cstdlibi.o and cmathi.o.
-
- * Rename implementation files to have different basenames.
-
-Mon Aug 21 00:57:03 1995 Jeffrey A. Law <law@rtl.cygnus.com>
-
- * Makefile.in (install): Use "cd stl"; no need for $(srcdir)
- prefix because we're already in $(srcdir).
-
-Tue Jul 25 18:41:29 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * std/stddef.h: Remove obsolete definition of enum capacity.
-
-Sat Jul 22 13:37:01 1995 Doug Evans <dje@canuck.cygnus.com>
-
- * Makefile.in (IO_DIR): Add multilib support.
- (LIBIBERTY, LIBIBERTY_OBJS, INSTALLDIR, stdlist): Likewise.
- (libiberty.a, install): Likewise.
- * configure.in: Likewise.
- (XCXXINCLUDES): Likewise.
- * stl/configure.in: Likewise.
- (XCXXINCLUDES): Likewise.
-
-Mon Jul 17 09:29:31 1995 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * Makefile.in (typeinfo.o, stdexcept.o): Put an else for the if
- stmt checking PICFLAG.
- (stmp-string, bigstmp-string, stmp-complex, bigstmp-complex): Likewise.
-
-Wed Jun 28 17:05:29 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * std/*.h: Wrap with extern "C++".
-
- * std/ciso646.h: Don't worry about #undefing the keywords.
-
-Mon Jun 26 19:05:38 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * std/bastring.h (operator!=): If they've included the STL
- function.h, don't overload the operator templates that it defines.
-
-Fri Jun 23 16:54:17 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * Makefile.in (SHLINK): Force link.
- (install): Ditto.
-
- * std/bastring.h (terminate): Never reallocate.
- (alloc): No longer const.
-
- * std/bastring.cc (create): Always allocate an extra byte.
- (check_realloc): Always leave room for an extra byte.
- (*find*): Add missing 'const'.
-
- * Makefile.in (SHARLIB): Provide a default value.
-
-Tue Jun 20 16:29:52 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * std/cstring.h: Don't bother tweaking prototypes for now. When
- we do, we will use new-style casts.
-
-Fri Jun 16 13:57:53 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * Makefile.in (VERSION): Update to 2.7.0.
-
- * config/aix.ml: Build both shared and archive libraries.
-
-Wed Jun 14 21:44:21 1995 Jason Merrill <jason@python.cygnus.com>
-
- * configure.in (frags): Use linux.ml for Linux/ELF.
- * config/linux.ml: New file.
-
-Wed Jun 14 17:56:23 1995 Niclas Andersson <nican@ida.liu.se>
-
- * configure.in: Use xiberty when building cross-compiler.
-
-Wed Jun 14 12:57:47 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * std/*complex*, std/cinst.h, cinst.cc: Pass by reference to const
- rather than by value.
- * std/*complex*: Add member functions real() and imag().
-
-Sat Jun 10 12:14:38 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * Makefile.in (bigstmp-string): Call main string object cstrmain.o
- instead of cstring.o.
-
-Wed Jun 7 11:15:15 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * std/cstring.h: Use #include_next to pick up <string.h>.
-
- * string.h: New file.
-
- * Makefile.in (MOSTLYCLEAN_JUNK): Remove piclist.
-
- * configure.in (MOSTLYCLEAN): Remove stamp-picdir.
-
-Mon Jun 5 18:36:39 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * config/*.ml: Build both shared and archive libraries.
-
- * configure.in (MOSTLYCLEAN): Remove pic.
- (frags): Use toplevel pic frags.
-
- * Makefile.in (piclist): New rule.
- (SHLIB): Use it.
- (stl.list): Removed.
- (typeinfo.o): Also build pic version.
- (stdexcept.o): Ditto.
- (*stmp-*): Ditto.
-
-Tue May 30 12:01:14 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * std/{complext,{f,d,ld}complex}.h: To declare specializations,
- use friend declarations in the class body...
- * std/cinst.h: ...rather than macro hackery.
-
- * Makefile.in (stdlist): Renamed from list.
-
- * cstdarg: Don't define __CSTDARG__.
- * complex.h: Similarly.
-
-Tue May 9 19:31:20 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * std/bastring.cc (operator>>): Use an int to store the return value
- of streambuf::sbumpc.
- (getline): Ditto.
- * std/bastring.* (replace): Reverse size_t and charT arguments.
-
- * configure.in (enable_shared): Support enable_shared under AIX.
-
- * Makefile.in (SHARLIB): New variable and rule for building an
- archive library containing a single shared object (for AIX).
-
-Mon May 8 01:43:19 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * std/bastring.h (remove): Forgot one.
- (empty): And this.
- Disable copy-on-write if someone takes an iterator.
-
- * std/bastring.cc (getline): Avoid resizing down if unnecessary.
- (operator>>): Don't use private methods.
-
-Sun May 7 02:39:56 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * std/bastring.h (insert, replace): Fix.
- * std/bastring.cc (find_*_of): Fix.
-
-Fri May 5 01:45:10 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * std/bastring.h: Add iterator remove fn. Remove evil default
- arguments.
-
- * std/*complex*, std/cinst.h, cinst.cc: s/__complex/complex/g.
- complex<float> is now specialized. Lose _*_complex in favor of
- 'explicit' constructors.
- * std/complex.h: Lose typedef of complex.
- * std/fcomplex.h: New file.
- * std/complext.cc (operator<<): Accept more input forms.
-
- * std/bastring.h: Add iterator insert fns.
-
-Thu May 4 02:30:04 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * std/bastring.*: Update to current draft.
-
- * std/bastring.*: Reorganize so that the pointer in a string
- object points to the data rather than the bsrep object, for
- debugging.
-
-Tue Apr 25 17:15:09 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * configure.in: Update to stay in sync with config.shared.
-
-Mon Apr 24 13:08:46 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * std/complext.h: Declare hypot. Declare appropriate functions const.
-
-Wed Apr 12 15:26:25 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * Makefile.in (typeinfo.o): Don't use $<.
- (stdexcept.o): Ditto.
-
-Sat Apr 8 15:35:00 1995 Mike Stump <mrs@cygnus.com>
-
- * std/typeinfo.h: Move bad_cast, bad_typeid and __bad_cast_object
- from here to stdexcept.
- * std/stdexcept.h: Ditto.
- * Makefile.in (stdexcept.o): Added rule to build typeinfo.o with
- -frtti to support matching of thrown objects with rtti info for
- bad_cast.
-
-Mon Apr 3 18:13:14 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * typeinfo: New file.
-
- * Makefile.in (HEADERS): Add typeinfo.
-
-Mon Apr 3 15:06:58 1995 Mike Stump <mrs@cygnus.com>
-
- * Makefile.in (typeinfo.o): Added rule to build typeinfo.o with
- -frtti to support matching of thrown objects with rtti info for
- bad_cast.
-
-Wed Mar 29 15:56:06 1995 Mike Stump <mrs@cygnus.com>
-
- * typeinfo.cc: (__throw_type_match_rtti): Added to support
- matching of thrown objects with rtti info.
-
-Thu Mar 23 18:42:30 1995 Jason Merrill <jason@deneb.cygnus.com>
-
- * Makefile.in (HEADERS): Add stdexcept.
-
-Sun Mar 12 01:25:27 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * std/typeinfo.h: Add return statements to dummy methods.
-
-Wed Mar 8 16:09:50 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * config/dec-osf.ml: Use -rpath flag.
-
-Fri Feb 17 18:16:46 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * std/typeinfo.h: Add copyright header.
-
- * Makefile.in (CXXFLAGS): Add a bunch of warning options to keep
- me honest.
-
-Thu Feb 16 00:04:49 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * Makefile.in, config/*.ml: Generate shared library on most hosts
- as libstdc++.so.$(VERSION), with a symlink to libstdc++.so, so that
- multiple versions can coexist.
-
-Fri Feb 10 02:59:39 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * std/exception.h: {set_,}{terminate,unexpected} have C++ linkage.
-
- * Makefile.in: Allow string and complex to be split up either by
- individual function or into I/O and non-I/O. Default to the
- latter.
-
-Wed Feb 8 02:39:47 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * std/bastring.h: Start thinking about throwing exceptions.
-
- * typeinfo.cc: Remove private functions; defining them to call
- abort () just delays errors until runtime. Define
- __bad_cast_object.
-
- * std/exception.h: Standard exceptions are now defined in
- stdexcept.h. This header now contains declarations of terminate()
- et al.
- * exception.cc: Move code from libg++/src/except.c here.
- * std/typeinfo.h: Define RTTI-related exceptions here.
- * stdexcept{,.cc},std/stdexcept.h: New files.
-
-Mon Feb 6 18:51:31 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * Makefile.in (HEADERS): Resurrect, add new STL header names.
- (install): Install extensionless headers again.
- * extensionless headers: Resurrect, add new STL headers.
- Currently only forward to std/whatever or stl/whatever.
-
-Mon Jan 30 13:53:22 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * std/bastring.h (basic_string (charT, size_t)): Mark explicit.
-
- * Makefile.in (install): Set rootme when installing stl headers.
- Only install *.* from std.
-
-Wed Jan 25 02:29:30 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * std/bastring.h (operator=): grab before releasing.
-
-Mon Jan 23 19:54:02 1995 Ronald F. Guilmette <rfg@segfault.us.com>
-
- * Makefile.in (install): Also install STL headers.
-
-Mon Jan 23 04:09:35 1995 Jason Merrill <jason@python.cygnus.com>
-
- * Makefile.in (list): Set $rootme before calling make.
-
-Wed Jan 11 19:24:47 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * typeinfo.cc (__rtti_match): Don't try to do pointer arithmetic
- with a void *.
-
- * move all headers into std subdirectory and update files accordingly.
-
-Thu Jan 5 01:51:49 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * bastring.ccI (basic_string (size_t, capacity)): s/reserve/::reserve/.
-
-Wed Jan 4 17:27:32 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * exception: s/string/__string/g.
-
- * configure.in (MOSTLYCLEAN): Add so_locations.
-
- * bastring.ccI (basic_string (size_t, capacity)): Fix thinko.
- (various find functions): Ditto.
-
-Fri Dec 30 18:04:00 1994 Mike Stump <mrs@cygnus.com>
-
- * typeinfo.h: Add support for the built-in type bool.
-
-Fri Dec 30 14:57:02 1994 Mike Stump <mrs@cygnus.com>
-
- * typeinfo.{cc, h}: Guard against multiple inclusions, and add #p i/i.
-
-Fri Dec 2 17:56:05 1994 Mike Stump <mrs@cygnus.com>
-
- * libg++ 2.6.2 released.
-
- * typeinfo.{cc, h} (__rtti_match): Change interface to compiler
- for dynamic_casting to gear up for exception handling's use of
- rtti for argument matching.
-
-Tue Nov 29 16:49:32 1994 Per Bothner <bothner@kalessin.cygnus.com>
-
- * configure.in (configdirs): Add stl.
- * Makefile.in: Build stl, and merge .o files from it.
-
-Thu Nov 17 15:30:57 1994 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * bastring.hI: Add iterator, const_iterator, begin() and end() to
- basic_string.
-
-Mon Nov 7 16:50:33 1994 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * Makefile.in, configure.in, config/*.ml, tests/Makefile.in,
- tests/configure.in: Various changes to handle --enable-shared.
-
-Fri Nov 4 19:13:33 1994 Mike Stump (mrs@cygnus.com)
-
- * exception{,.cc}: Added to support catching bad_cast's.
-
-Thu Nov 3 17:42:13 1994 Mike Stump (mrs@cygnus.com)
-
- * typeinfo.h (type_info::{name, before}): Add to match draft.
-
-Thu Nov 3 00:56:34 1994 Jason Merrill (jason@phydeaux.cygnus.com)
-
- * Makefile.in (LIBIBERTY_OBJS): Add strerror.o.
-
-Mon Oct 31 15:33:06 1994 Kung Hsu (kung@mexican.cygnus.com)
-
- * typeinfo.cc: Fix a bug in the final return.
- * typeinfo.cc: Fix the ANSI header version number.
- * typeinfo.h: ditto.
-
-Fri Oct 28 14:23:12 1994 Mike Stump <mrs@cygnus.com>
-
- * type_info.{cc,h}: Rename to typeinfo to better match current draft.
-
-Wed Oct 26 11:13:53 1994 Kung Hsu (kung@mexican.cygnus.com)
-
- * type_info.h: new header file for rtti.
- * type_info.cc: new code file for rtti.
- * Makefile.in: change to include type_info.o in libstdc++ for rtti.
-
-Sat Oct 15 16:09:51 1994 Jason Merrill (jason@phydeaux.cygnus.com)
-
- * libg++ 2.6.1 released.
-
- * cinst.hI: Also declare instantiations of out-of-line functions.
-
-Fri Oct 14 15:00:09 1994 Jason Merrill (jason@phydeaux.cygnus.com)
-
- * configure.in (CXXINCLUDES): Use {} to wrap variable name.
- * tests/configure.in (CXXINCLUDES): Ditto.
-
- * cinst.hI: Declare instantiations of two-argument functions so
- overload resolution will work.
- * complext.hI: Always include cinst.hI.
-
- * bastring.ccI (operator>>): Tweak.
-
-Tue Oct 11 17:07:49 1994 Jason Merrill (jason@phydeaux.cygnus.com)
-
- * stddef*: Do the #pragma i/i thang.
-
- * bastring.hI (basic_string::put_at): Use operator[].
- (basic_string::terminate): Don't necessarily copy the rep.
-
- * bastring.ccI (operator>>): Avoid shrinking and then re-expanding
- the string.
-
- * bastring.*I, sinst.cc: Only allow allocation policy control if
- _G_ALLOC_CONTROL is defined.
-
- * Makefile.in (libstdc++.a): Depend on iostream.list and libiberty.a.
- (../libio/iostream.list): New rule.
- (../libiberty/libiberty.a): New rule.
- (OBJS): Add stddef.o.
-
-Sat Oct 8 23:59:45 1994 Jason Merrill (jason@phydeaux.cygnus.com)
-
- * *: First checkin.
diff --git a/contrib/libg++/libstdc++/Makefile.in b/contrib/libg++/libstdc++/Makefile.in
deleted file mode 100644
index a4bdc4fc216f..000000000000
--- a/contrib/libg++/libstdc++/Makefile.in
+++ /dev/null
@@ -1,310 +0,0 @@
-# Copyright (C) 1994, 1995 Free Software Foundation
-
-# This file is part of the GNU ANSI C++ 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.
-
-VERSION = 2.7.2
-
-OBJS = newi.o cstringi.o stddefi.o typeinfoi.o exceptioni.o stdexcepti.o \
- cstdlibi.o cmathi.o
-SUBLIBS = $(STAMP)-string $(STAMP)-complex
-
-# C++ headers with no extension
-HEADERS= cassert cctype cerrno cfloat ciso646 climits clocale cmath complex \
- csetjmp csignal cstdarg cstddef cstdio cstdlib cstring ctime \
- cwchar cwctype new stddef string exception stdexcept typeinfo \
- algorithm deque list map queue set stack vector utility functional \
- iterator memory numeric
-
-ARLIB = libstdc++.a
-SHLIB = libstdc++.so.$(VERSION)
-SHARLIB = libstdc++-sh.a
-SHLINK = libstdc++.so
-MSHLINK = foo
-SHFLAGS =
-SHDEPS =
-
-STAMP = bigstmp
-
-LIBS = $(ARLIB)
-
-#### package, host, target, and site dependent Makefile fragments come in here.
-##
-
-IO_DIR = ../libio
-LIBIBERTY_DIR = ../libiberty
-
-LIBIBERTY_OBJS = `cat $(LIBIBERTY_DIR)/needed-list` strerror.o
-
-tooldir = $(exec_prefix)/$(target)
-INSTALLDIR = $(libdir)
-
-MOSTLYCLEAN_JUNK = *stmp-* tlib*.a *.s *.ii stdlist piclist
-CLEAN_JUNK = $(LIBS)
-
-# Remove these for public releases.
-CXXFLAGS = -g -O3 -Wall -Wpointer-arith -Wnested-externs -Woverloaded-virtual -Wbad-function-cast -Winline
-CFLAGS = -g -O3 -Wpointer-arith -Wnested-externs
-
-.PHONY: libs
-libs: $(LIBS)
-
-stdlist: $(IO_DIR)/iostream.list $(OBJS) $(SUBLIBS) $(LIBIBERTY_DIR)/libiberty.a
- -rm -f tlist
- touch tlist
- echo *.o >> tlist
- for f in `cat $(IO_DIR)/iostream.list` ; do \
- echo "$(IO_DIR)/$$f" >> tlist ; \
- done
- for f in $(LIBIBERTY_OBJS) ; do \
- echo "$(LIBIBERTY_DIR)/$$f" >> tlist ; \
- done
- mv tlist stdlist
-
-piclist: stdlist stl/stl.list
- -rm -f tlist
- cp stdlist tlist
- sed 's,\([A-Za-z_]*\.o\),stl/\1,g' stl/stl.list >> tlist
- if [ -n "$(PICFLAG)" ]; then \
- sed 's,\([A-Za-z_]*\.o\),pic/\1,g' tlist > tlist2 ; \
- mv tlist2 tlist ; \
- else true ; fi
- mv tlist piclist
-
-$(ARLIB): stdlist stl/stl.list
- -rm -f t$(ARLIB)
- $(AR) $(AR_FLAGS) t$(ARLIB) `cat stdlist`
- cd stl; $(AR) $(AR_FLAGS) ../t$(ARLIB) `cat stl.list`
- mv t$(ARLIB) $(ARLIB)
- $(RANLIB) $(ARLIB)
-
-$(SHLIB): piclist
- $(CXX) $(SHFLAGS) -shared -o $(SHLIB) `cat piclist` $(SHDEPS)
-
-$(SHARLIB): $(SHLIB)
- -rm -f t$(SHARLIB)
- $(AR) $(AR_FLAGS) t$(SHARLIB) $(SHLIB)
- mv t$(SHARLIB) $(SHARLIB)
- $(RANLIB) $(SHARLIB)
-
-$(SHLINK):
- ln -s -f $(SHLIB) $(SHLINK)
-
-$(MSHLINK):
- ln -s -f $(SHLIB) $(MSHLINK)
-
-$(IO_DIR)/iostream.list: force
- cd $(IO_DIR) ; $(MAKE) $(FLAGS_TO_PASS) iostream.list
-
-stl/stl.list: force
- @rootme=`pwd`/ ; export rootme; cd stl ; \
- $(MAKE) $(FLAGS_TO_PASS) stl.list
-
-$(LIBIBERTY_DIR)/libiberty.a:
- cd $(LIBIBERTY_DIR) ; $(MAKE) $(FLAGS_TO_PASS)
-
-STRFUNCS = REP MAIN TRAITS ADDSS ADDPS ADDCS ADDSP ADDSC \
- EQSS EQPS EQSP NESS NEPS NESP LTSS LTPS LTSP GTSS GTPS GTSP \
- LESS LEPS LESP GESS GEPS GESP
-STRIO = EXTRACT INSERT GETLINE
-
-typeinfoi.o: ${srcdir}/typeinfoi.cc ${srcdir}/std/typeinfo.h
- if [ -n "$(PICFLAG)" ]; then \
- $(COMPILE.cc) $(PICFLAG) ${srcdir}/typeinfoi.cc -frtti -o pic/typeinfoi.o; \
- else true ; fi
- $(COMPILE.cc) ${srcdir}/typeinfoi.cc -frtti
-
-stdexcepti.o: ${srcdir}/stdexcepti.cc ${srcdir}/std/stdexcept.h
- if [ -n "$(PICFLAG)" ]; then \
- $(COMPILE.cc) $(PICFLAG) ${srcdir}/stdexcepti.cc -frtti -o pic/stdexcepti.o; \
- else true ; fi
- $(COMPILE.cc) ${srcdir}/stdexcepti.cc -frtti
-
-exceptioni.o: ${srcdir}/exceptioni.cc
- if [ -n "$(PICFLAG)" ]; then \
- $(COMPILE.cc) $(PICFLAG) ${srcdir}/exceptioni.cc -O0 -fhandle-exceptions -frtti -o pic/exceptioni.o; \
- else true ; fi
- $(COMPILE.cc) ${srcdir}/exceptioni.cc -O0 -fhandle-exceptions -frtti
-
-# These are here for SunOS VPATH.
-newi.o: newi.cc
-cstringi.o: cstringi.cc
-stddefi.o: stddefi.cc
-cstdlibi.o: cstdlibi.cc
-cmathi.o: cmathi.cc
-typeinfoi.o: typeinfoi.cc
-stdexcepti.o: stdexcepti.cc
-
-# Later do wide strings, too.
-stmp-string: ${srcdir}/sinst.cc ${srcdir}/std/bastring.h \
- ${srcdir}/std/bastring.cc ${srcdir}/std/straits.h
- for name in $(STRFUNCS) $(STRIO); do \
- echo c$${name}; \
- if [ -n "$(PICFLAG)" ]; then \
- $(COMPILE.cc) $(PICFLAG) -DC -D$${name} ${srcdir}/sinst.cc \
- -o pic/c$${name}.o; \
- else true ; fi; \
- if [ $$? -eq 0 ]; then true; else exit 1; fi; \
- $(COMPILE.cc) -DC -D$${name} ${srcdir}/sinst.cc -o c$${name}.o; \
- if [ $$? -eq 0 ]; then true; else exit 1; fi; \
- done
- touch stmp-string
-
-bigstmp-string: ${srcdir}/sinst.cc ${srcdir}/std/bastring.h \
- ${srcdir}/std/bastring.cc ${srcdir}/std/straits.h
- echo cstring
- if [ -n "$(PICFLAG)" ]; then \
- $(COMPILE.cc) $(PICFLAG) -DC \
- `for N in $(STRFUNCS); do echo " -D$${N}"; done` \
- $(srcdir)/sinst.cc -o pic/cstrmain.o; \
- else true ; fi
- $(COMPILE.cc) -DC `for N in $(STRFUNCS); do echo " -D$${N}"; done` \
- $(srcdir)/sinst.cc -o cstrmain.o
- echo cstrio
- if [ -n "$(PICFLAG)" ]; then \
- $(COMPILE.cc) $(PICFLAG) -DC \
- `for N in $(STRIO); do echo " -D$${N}"; done` \
- $(srcdir)/sinst.cc -o pic/cstrio.o; \
- else true ; fi
- $(COMPILE.cc) -DC `for N in $(STRIO); do echo " -D$${N}"; done` \
- $(srcdir)/sinst.cc -o cstrio.o
- touch bigstmp-string
-
-COMFUNCS = MAIN ADDCC ADDCF ADDFC SUBCC SUBCF SUBFC MULCC MULCF MULFC DIVCC \
- DIVCF DIVFC PLUS MINUS EQCC EQCF EQFC NECC NECF NEFC ABS ARG POLAR \
- CONJ NORM COS COSH EXP LOG POWCC POWCF POWCI POWFC SIN SINH SQRT
-COMIO = EXTRACT INSERT
-
-stmp-complex: ${srcdir}/cinst.cc ${srcdir}/std/complext.h \
- ${srcdir}/std/complext.cc ${srcdir}/std/dcomplex.h \
- ${srcdir}/std/ldcomplex.h
- for N in $(COMFUNCS) $(COMIO); do \
- echo f$${N}; \
- if [ -n "$(PICFLAG)" ]; then \
- $(COMPILE.cc) $(PICFLAG) -DF -D$${N} $(srcdir)/cinst.cc \
- -o pic/f$${N}.o; \
- else true ; fi; \
- if [ $$? -eq 0 ]; then true; else exit 1; fi; \
- $(COMPILE.cc) -DF -D$${N} ${srcdir}/cinst.cc -o f$${N}.o; \
- if [ $$? -eq 0 ]; then true; else exit 1; fi; \
- echo d$${N}; \
- if [ -n "$(PICFLAG)" ]; then \
- $(COMPILE.cc) $(PICFLAG) -DD -D$${N} $(srcdir)/cinst.cc \
- -o pic/d$${N}.o; \
- else true ; fi; \
- if [ $$? -eq 0 ]; then true; else exit 1; fi; \
- $(COMPILE.cc) -DD -D$${N} ${srcdir}/cinst.cc -o d$${N}.o; \
- if [ $$? -eq 0 ]; then true; else exit 1; fi; \
- echo ld$${N}; \
- if [ -n "$(PICFLAG)" ]; then \
- $(COMPILE.cc) $(PICFLAG) -DLD -D$${N} $(srcdir)/cinst.cc \
- -o pic/ld$${N}.o; \
- else true ; fi; \
- if [ $$? -eq 0 ]; then true; else exit 1; fi; \
- $(COMPILE.cc) -DLD -D$${N} ${srcdir}/cinst.cc -o ld$${N}.o; \
- if [ $$? -eq 0 ]; then true; else exit 1; fi; \
- done
- touch stmp-complex
-
-bigstmp-complex: ${srcdir}/cinst.cc ${srcdir}/std/complext.h \
- ${srcdir}/std/complext.cc ${srcdir}/std/dcomplex.h \
- ${srcdir}/std/ldcomplex.h
- echo fcomplex
- if [ -n "$(PICFLAG)" ]; then \
- $(COMPILE.cc) $(PICFLAG) -DF \
- `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
- $(srcdir)/cinst.cc -o pic/fcomplex.o; \
- else true ; fi
- $(COMPILE.cc) -DF `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
- $(srcdir)/cinst.cc -o fcomplex.o
- echo fcomio
- if [ -n "$(PICFLAG)" ]; then \
- $(COMPILE.cc) $(PICFLAG) -DF \
- `for N in $(COMIO); do echo " -D$${N}"; done` \
- $(srcdir)/cinst.cc -o pic/fcomio.o; \
- else true ; fi
- $(COMPILE.cc) -DF `for N in $(COMIO); do echo " -D$${N}"; done` \
- $(srcdir)/cinst.cc -o fcomio.o
- echo dcomplex
- if [ -n "$(PICFLAG)" ]; then \
- $(COMPILE.cc) $(PICFLAG) -DD \
- `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
- $(srcdir)/cinst.cc -o pic/dcomplex.o; \
- else true ; fi
- $(COMPILE.cc) -DD `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
- $(srcdir)/cinst.cc -o dcomplex.o
- echo dcomio
- if [ -n "$(PICFLAG)" ]; then \
- $(COMPILE.cc) $(PICFLAG) -DD \
- `for N in $(COMIO); do echo " -D$${N}"; done` \
- $(srcdir)/cinst.cc -o pic/dcomio.o; \
- else true ; fi
- $(COMPILE.cc) -DD `for N in $(COMIO); do echo " -D$${N}"; done` \
- $(srcdir)/cinst.cc -o dcomio.o
- echo ldcomplex
- if [ -n "$(PICFLAG)" ]; then \
- $(COMPILE.cc) $(PICFLAG) -DLD \
- `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
- $(srcdir)/cinst.cc -o pic/ldcomplex.o; \
- else true ; fi
- $(COMPILE.cc) -DLD `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
- $(srcdir)/cinst.cc -o ldcomplex.o
- echo ldcomio
- if [ -n "$(PICFLAG)" ]; then \
- $(COMPILE.cc) $(PICFLAG) -DLD \
- `for N in $(COMIO); do echo " -D$${N}"; done` \
- $(srcdir)/cinst.cc -o pic/ldcomio.o; \
- else true ; fi
- $(COMPILE.cc) -DLD `for N in $(COMIO); do echo " -D$${N}"; done` \
- $(srcdir)/cinst.cc -o ldcomio.o
- touch bigstmp-complex
-
-.PHONY: install
-install:
- rootme=`pwd`/ ; export rootme ; \
- if [ -z "$(MULTISUBDIR)" ]; then \
- cd $(srcdir); \
- for FILE in $(HEADERS) *.h std/*.*; do \
- rm -f $(gxx_includedir)/$$FILE ; \
- $(INSTALL_DATA) $$FILE $(gxx_includedir)/$$FILE ; \
- chmod a-x $(gxx_includedir)/$$FILE ; \
- done ; \
- cd stl; \
- for FILE in *.h; do \
- rm -f $(gxx_includedir)/$$FILE ; \
- $(INSTALL_DATA) $$FILE $(gxx_includedir)/$$FILE ; \
- chmod a-x $(gxx_includedir)/$$FILE ; \
- done ; \
- else true ; \
- fi
- rootme=`pwd`/ ; export rootme ; \
- for FILE in $(LIBS) ; do \
- rm -f $(INSTALLDIR)$(MULTISUBDIR)/$$FILE ; \
- if [ $$FILE = $(SHLINK) ] || [ $$FILE = $(MSHLINK) ]; then \
- ln -s -f $(SHLIB) $(INSTALLDIR)$(MULTISUBDIR)/$$FILE ; \
- elif [ $$FILE = $(SHLIB) ]; then \
- $(INSTALL_PROGRAM) $$FILE $(INSTALLDIR)$(MULTISUBDIR)/$$FILE ; \
- : On the HP, shared libraries must be mode 555. ;\
- chmod 555 $(INSTALLDIR)$(MULTISUBDIR)/$$FILE ; \
- else \
- $(INSTALL_DATA) $$FILE $(INSTALLDIR)$(MULTISUBDIR)/$$FILE ; \
- $(RANLIB) $(INSTALLDIR)$(MULTISUBDIR)/$$FILE ; \
- chmod a-x $(INSTALLDIR)$(MULTISUBDIR)/$$FILE ; \
- fi ; \
- done
- @rootme=`pwd`/ ; export rootme ; \
- $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=install
-
-.PHONY: force
-force:
diff --git a/contrib/libg++/libstdc++/algorithm b/contrib/libg++/libstdc++/algorithm
deleted file mode 100644
index 472d24166401..000000000000
--- a/contrib/libg++/libstdc++/algorithm
+++ /dev/null
@@ -1,7 +0,0 @@
-// -*- C++ -*- forwarding header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __ALGORITHM__
-#define __ALGORITHM__
-#include <algo.h>
-#endif
diff --git a/contrib/libg++/libstdc++/cassert b/contrib/libg++/libstdc++/cassert
deleted file mode 100644
index 848087f1783c..000000000000
--- a/contrib/libg++/libstdc++/cassert
+++ /dev/null
@@ -1,6 +0,0 @@
-// -*- C++ -*- forwarding header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __CASSERT__
-#include <std/cassert.h>
-#endif
diff --git a/contrib/libg++/libstdc++/cctype b/contrib/libg++/libstdc++/cctype
deleted file mode 100644
index 12d96d75917b..000000000000
--- a/contrib/libg++/libstdc++/cctype
+++ /dev/null
@@ -1,6 +0,0 @@
-// -*- C++ -*- forwarding header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __CCTYPE__
-#include <std/cctype.h>
-#endif
diff --git a/contrib/libg++/libstdc++/cerrno b/contrib/libg++/libstdc++/cerrno
deleted file mode 100644
index bbd93f750673..000000000000
--- a/contrib/libg++/libstdc++/cerrno
+++ /dev/null
@@ -1,6 +0,0 @@
-// -*- C++ -*- forwarding header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __CERRNO__
-#include <std/cerrno.h>
-#endif
diff --git a/contrib/libg++/libstdc++/cfloat b/contrib/libg++/libstdc++/cfloat
deleted file mode 100644
index bd7497a9ebd6..000000000000
--- a/contrib/libg++/libstdc++/cfloat
+++ /dev/null
@@ -1,6 +0,0 @@
-// -*- C++ -*- forwarding header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __CFLOAT__
-#include <std/cfloat.h>
-#endif
diff --git a/contrib/libg++/libstdc++/cinst.cc b/contrib/libg++/libstdc++/cinst.cc
deleted file mode 100644
index 92236c4f8c0c..000000000000
--- a/contrib/libg++/libstdc++/cinst.cc
+++ /dev/null
@@ -1,151 +0,0 @@
-// Instantiation file for the -*- C++ -*- complex number classes.
-// Copyright (C) 1994 Free Software Foundation
-
-#ifdef F
-typedef float f;
-#endif
-#ifdef D
-typedef double f;
-#endif
-#ifdef LD
-typedef long double f;
-#endif
-
-#if defined (MAIN) && defined (__GNUG__)
-#ifdef F
-#pragma implementation "fcomplex"
-#endif
-#ifdef D
-#pragma implementation "dcomplex"
-#endif
-#ifdef LD
-#pragma implementation "ldcomplex"
-#endif
-#endif
-
-#if 0
-#define _G_NO_EXTERN_TEMPLATES
-#endif
-#include <std/complext.cc>
-
-typedef complex<f> c;
-typedef const c& ccr;
-
-#ifdef MAIN
-template class complex<f>;
-#endif
-
-#ifdef ADDCC
-template c operator+ (ccr, ccr);
-#endif
-#ifdef ADDCF
-template c operator+ (ccr, f);
-#endif
-#ifdef ADDFC
-template c operator+ (f, ccr);
-#endif
-#ifdef SUBCC
-template c operator- (ccr, ccr);
-#endif
-#ifdef SUBCF
-template c operator- (ccr, f);
-#endif
-#ifdef SUBFC
-template c operator- (f, ccr);
-#endif
-#ifdef MULCC
-template c operator* (ccr, ccr);
-#endif
-#ifdef MULCF
-template c operator* (ccr, f);
-#endif
-#ifdef MULFC
-template c operator* (f, ccr);
-#endif
-#ifdef DIVCC
-template c operator/ (ccr, ccr);
-#endif
-#ifdef DIVCF
-template c operator/ (ccr, f);
-#endif
-#ifdef DIVFC
-template c operator/ (f, ccr);
-#endif
-#ifdef PLUS
-template c operator+ (ccr);
-#endif
-#ifdef MINUS
-template c operator- (ccr);
-#endif
-#ifdef EQCC
-template bool operator== (ccr, ccr);
-#endif
-#ifdef EQCF
-template bool operator== (ccr, f);
-#endif
-#ifdef EQFC
-template bool operator== (f, ccr);
-#endif
-#ifdef NECC
-template bool operator!= (ccr, ccr);
-#endif
-#ifdef NECF
-template bool operator!= (ccr, f);
-#endif
-#ifdef NEFC
-template bool operator!= (f, ccr);
-#endif
-#ifdef ABS
-template f abs (ccr);
-#endif
-#ifdef ARG
-template f arg (ccr);
-#endif
-#ifdef POLAR
-template c polar (f, f);
-#endif
-#ifdef CONJ
-template c conj (ccr);
-#endif
-#ifdef NORM
-template f norm (ccr);
-#endif
-#ifdef COS
-template c cos (ccr);
-#endif
-#ifdef COSH
-template c cosh (ccr);
-#endif
-#ifdef EXP
-template c exp (ccr);
-#endif
-#ifdef LOG
-template c log (ccr);
-#endif
-#ifdef POWCC
-template c pow (ccr, ccr);
-#endif
-#ifdef POWCF
-template c pow (ccr, f);
-#endif
-#ifdef POWCI
-template c pow (ccr, int);
-#endif
-#ifdef POWFC
-template c pow (f, ccr);
-#endif
-#ifdef SIN
-template c sin (ccr);
-#endif
-#ifdef SINH
-template c sinh (ccr);
-#endif
-#ifdef SQRT
-template c sqrt (ccr);
-#endif
-#ifdef EXTRACT
-template istream& operator>> (istream&, complex<f>&);
-#endif
-#ifdef INSERT
-template ostream& operator<< (ostream&, complex<f>);
-#endif
diff --git a/contrib/libg++/libstdc++/ciso646 b/contrib/libg++/libstdc++/ciso646
deleted file mode 100644
index 512090866954..000000000000
--- a/contrib/libg++/libstdc++/ciso646
+++ /dev/null
@@ -1,6 +0,0 @@
-// -*- C++ -*- forwarding header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __CISO646__
-#include <std/ciso646.h>
-#endif
diff --git a/contrib/libg++/libstdc++/climits b/contrib/libg++/libstdc++/climits
deleted file mode 100644
index 4b7b81d82e35..000000000000
--- a/contrib/libg++/libstdc++/climits
+++ /dev/null
@@ -1,6 +0,0 @@
-// -*- C++ -*- forwarding header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __CLIMITS__
-#include <std/climits.h>
-#endif
diff --git a/contrib/libg++/libstdc++/clocale b/contrib/libg++/libstdc++/clocale
deleted file mode 100644
index 9e20a88bfa42..000000000000
--- a/contrib/libg++/libstdc++/clocale
+++ /dev/null
@@ -1,6 +0,0 @@
-// -*- C++ -*- forwarding header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __CLOCALE__
-#include <std/clocale.h>
-#endif
diff --git a/contrib/libg++/libstdc++/cmath b/contrib/libg++/libstdc++/cmath
deleted file mode 100644
index da5bce9cad31..000000000000
--- a/contrib/libg++/libstdc++/cmath
+++ /dev/null
@@ -1,6 +0,0 @@
-// -*- C++ -*- forwarding header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __CMATH__
-#include <std/cmath.h>
-#endif
diff --git a/contrib/libg++/libstdc++/cmathi.cc b/contrib/libg++/libstdc++/cmathi.cc
deleted file mode 100644
index e9fa0604eb92..000000000000
--- a/contrib/libg++/libstdc++/cmathi.cc
+++ /dev/null
@@ -1,7 +0,0 @@
-// Implementation file for the -*- C++ -*- math functions header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifdef __GNUG__
-#pragma implementation "std/cmath.h"
-#endif
-#include <std/cmath.h>
diff --git a/contrib/libg++/libstdc++/complex b/contrib/libg++/libstdc++/complex
deleted file mode 100644
index 17e2fe439bf7..000000000000
--- a/contrib/libg++/libstdc++/complex
+++ /dev/null
@@ -1,6 +0,0 @@
-// -*- C++ -*- forwarding header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __COMPLEX__
-#include <std/complex.h>
-#endif
diff --git a/contrib/libg++/libstdc++/complex.h b/contrib/libg++/libstdc++/complex.h
deleted file mode 100644
index 554210dcffd6..000000000000
--- a/contrib/libg++/libstdc++/complex.h
+++ /dev/null
@@ -1,6 +0,0 @@
-// -*- C++ -*- backward compatiblity header.
-// Copyright (C) 1994 Free Software Foundation
-
-#ifndef __COMPLEX_H__
-#include <std/complex.h>
-#endif
diff --git a/contrib/libg++/libstdc++/csetjmp b/contrib/libg++/libstdc++/csetjmp
deleted file mode 100644
index b635d738a4fb..000000000000
--- a/contrib/libg++/libstdc++/csetjmp
+++ /dev/null
@@ -1,6 +0,0 @@
-// -*- C++ -*- forwarding header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __CSETJMP__
-#include <std/csetjmp.h>
-#endif
diff --git a/contrib/libg++/libstdc++/csignal b/contrib/libg++/libstdc++/csignal
deleted file mode 100644
index 21ed90cda088..000000000000
--- a/contrib/libg++/libstdc++/csignal
+++ /dev/null
@@ -1,6 +0,0 @@
-// -*- C++ -*- forwarding header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __CSIGNAL__
-#include <std/csignal.h>
-#endif
diff --git a/contrib/libg++/libstdc++/cstdarg b/contrib/libg++/libstdc++/cstdarg
deleted file mode 100644
index c8ca3eabf13d..000000000000
--- a/contrib/libg++/libstdc++/cstdarg
+++ /dev/null
@@ -1,6 +0,0 @@
-// -*- C++ -*- forwarding header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __CSTDARG__
-#include <std/cstdarg.h>
-#endif
diff --git a/contrib/libg++/libstdc++/cstddef b/contrib/libg++/libstdc++/cstddef
deleted file mode 100644
index 18134383bb23..000000000000
--- a/contrib/libg++/libstdc++/cstddef
+++ /dev/null
@@ -1,6 +0,0 @@
-// -*- C++ -*- forwarding header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __CSTDDEF__
-#include <std/cstddef.h>
-#endif
diff --git a/contrib/libg++/libstdc++/cstdio b/contrib/libg++/libstdc++/cstdio
deleted file mode 100644
index ac851787b307..000000000000
--- a/contrib/libg++/libstdc++/cstdio
+++ /dev/null
@@ -1,6 +0,0 @@
-// -*- C++ -*- forwarding header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __CSTDIO__
-#include <std/cstdio.h>
-#endif
diff --git a/contrib/libg++/libstdc++/cstdlib b/contrib/libg++/libstdc++/cstdlib
deleted file mode 100644
index fa4dac415f56..000000000000
--- a/contrib/libg++/libstdc++/cstdlib
+++ /dev/null
@@ -1,6 +0,0 @@
-// -*- C++ -*- forwarding header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __CSTDLIB__
-#include <std/cstdlib.h>
-#endif
diff --git a/contrib/libg++/libstdc++/cstdlibi.cc b/contrib/libg++/libstdc++/cstdlibi.cc
deleted file mode 100644
index bd94aa5dfa38..000000000000
--- a/contrib/libg++/libstdc++/cstdlibi.cc
+++ /dev/null
@@ -1,7 +0,0 @@
-// Implementation file for the -*- C++ -*- standard library header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifdef __GNUG__
-#pragma implementation "std/cstdlib.h"
-#endif
-#include <std/cstdlib.h>
diff --git a/contrib/libg++/libstdc++/cstring b/contrib/libg++/libstdc++/cstring
deleted file mode 100644
index e0d18cfaa5ec..000000000000
--- a/contrib/libg++/libstdc++/cstring
+++ /dev/null
@@ -1,6 +0,0 @@
-// -*- C++ -*- forwarding header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __CSTRING__
-#include <std/cstring.h>
-#endif
diff --git a/contrib/libg++/libstdc++/cstringi.cc b/contrib/libg++/libstdc++/cstringi.cc
deleted file mode 100644
index e981ab73c984..000000000000
--- a/contrib/libg++/libstdc++/cstringi.cc
+++ /dev/null
@@ -1,7 +0,0 @@
-// Implementation file for the -*- C++ -*- null-terminated string header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifdef __GNUG__
-#pragma implementation "std/cstring.h"
-#endif
-#include <std/cstring.h>
diff --git a/contrib/libg++/libstdc++/ctime b/contrib/libg++/libstdc++/ctime
deleted file mode 100644
index 8b68715ac44a..000000000000
--- a/contrib/libg++/libstdc++/ctime
+++ /dev/null
@@ -1,6 +0,0 @@
-// -*- C++ -*- forwarding header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __CTIME__
-#include <std/ctime.h>
-#endif
diff --git a/contrib/libg++/libstdc++/cwchar b/contrib/libg++/libstdc++/cwchar
deleted file mode 100644
index be96cc81d5b4..000000000000
--- a/contrib/libg++/libstdc++/cwchar
+++ /dev/null
@@ -1,6 +0,0 @@
-// -*- C++ -*- forwarding header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __CWCHAR__
-#include <std/cwchar.h>
-#endif
diff --git a/contrib/libg++/libstdc++/cwctype b/contrib/libg++/libstdc++/cwctype
deleted file mode 100644
index 1eaa0ca8e031..000000000000
--- a/contrib/libg++/libstdc++/cwctype
+++ /dev/null
@@ -1,6 +0,0 @@
-// -*- C++ -*- forwarding header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __CWCTYPE__
-#include <std/cwctype.h>
-#endif
diff --git a/contrib/libg++/libstdc++/deque b/contrib/libg++/libstdc++/deque
deleted file mode 100644
index bdc14299a045..000000000000
--- a/contrib/libg++/libstdc++/deque
+++ /dev/null
@@ -1,7 +0,0 @@
-// -*- C++ -*- forwarding header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __DEQUE__
-#define __DEQUE__
-#include <deque.h>
-#endif
diff --git a/contrib/libg++/libstdc++/exception b/contrib/libg++/libstdc++/exception
deleted file mode 100644
index a843d4bbc9c0..000000000000
--- a/contrib/libg++/libstdc++/exception
+++ /dev/null
@@ -1,6 +0,0 @@
-// -*- C++ -*- forwarding header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __EXCEPTION__
-#include <std/exception.h>
-#endif
diff --git a/contrib/libg++/libstdc++/exceptioni.cc b/contrib/libg++/libstdc++/exceptioni.cc
deleted file mode 100644
index 115c6d6b7a41..000000000000
--- a/contrib/libg++/libstdc++/exceptioni.cc
+++ /dev/null
@@ -1,78 +0,0 @@
-// Functions for Exception Support for -*- C++ -*-
-// Copyright (C) 1994, 1995 Free Software Foundation
-
-// This file is part of the GNU ANSI C++ 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 <exception>
-#include <stdlib.h>
-
-/* terminate (), unexpected (), set_terminate (), set_unexpected () as
- well as the default terminate func and default unexpected func */
-
-#if 0
-extern "C" int printf(const char *, ...);
-#endif
-
-void
-__default_terminate ()
-{
- abort ();
-}
-
-void
-__default_unexpected ()
-{
- __default_terminate ();
-}
-
-static terminate_handler __terminate_func = __default_terminate;
-static unexpected_handler __unexpected_func = __default_unexpected;
-
-terminate_handler
-set_terminate (terminate_handler func)
-{
- terminate_handler old = __terminate_func;
-
- __terminate_func = func;
- return old;
-}
-
-unexpected_handler
-set_unexpected (unexpected_handler func)
-{
- unexpected_handler old = __unexpected_func;
-
- __unexpected_func = func;
- return old;
-}
-
-void
-terminate ()
-{
- __terminate_func ();
-}
-
-void
-unexpected ()
-{
- __unexpected_func ();
-}
diff --git a/contrib/libg++/libstdc++/functional b/contrib/libg++/libstdc++/functional
deleted file mode 100644
index ee8b7f20202e..000000000000
--- a/contrib/libg++/libstdc++/functional
+++ /dev/null
@@ -1,7 +0,0 @@
-// -*- C++ -*- forwarding header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __FUNCTIONAL__
-#define __FUNCTIONAL__
-#include <function.h>
-#endif
diff --git a/contrib/libg++/libstdc++/iterator b/contrib/libg++/libstdc++/iterator
deleted file mode 100644
index a0fa054c5ec6..000000000000
--- a/contrib/libg++/libstdc++/iterator
+++ /dev/null
@@ -1,7 +0,0 @@
-// -*- C++ -*- forwarding header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __ITERATOR__
-#define __ITERATOR__
-#include <iterator.h>
-#endif
diff --git a/contrib/libg++/libstdc++/list b/contrib/libg++/libstdc++/list
deleted file mode 100644
index 475d8443d167..000000000000
--- a/contrib/libg++/libstdc++/list
+++ /dev/null
@@ -1,7 +0,0 @@
-// -*- C++ -*- forwarding header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __LIST__
-#define __LIST__
-#include <list.h>
-#endif
diff --git a/contrib/libg++/libstdc++/map b/contrib/libg++/libstdc++/map
deleted file mode 100644
index 0127b9db250f..000000000000
--- a/contrib/libg++/libstdc++/map
+++ /dev/null
@@ -1,7 +0,0 @@
-// -*- C++ -*- forwarding header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __MAP__
-#define __MAP__
-#include <map.h>
-#endif
diff --git a/contrib/libg++/libstdc++/memory b/contrib/libg++/libstdc++/memory
deleted file mode 100644
index 8328720db6d5..000000000000
--- a/contrib/libg++/libstdc++/memory
+++ /dev/null
@@ -1,7 +0,0 @@
-// -*- C++ -*- forwarding header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __MEMORY__
-#define __MEMORY__
-#include <defalloc.h>
-#endif
diff --git a/contrib/libg++/libstdc++/new b/contrib/libg++/libstdc++/new
deleted file mode 100644
index 47944fcff98d..000000000000
--- a/contrib/libg++/libstdc++/new
+++ /dev/null
@@ -1,6 +0,0 @@
-// -*- C++ -*- forwarding header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __NEW__
-#include <std/new.h>
-#endif
diff --git a/contrib/libg++/libstdc++/new.h b/contrib/libg++/libstdc++/new.h
deleted file mode 100644
index 02bba4509b0f..000000000000
--- a/contrib/libg++/libstdc++/new.h
+++ /dev/null
@@ -1,7 +0,0 @@
-// -*- C++ -*- backward compatiblity header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __NEW_H__
-#define __NEW_H__
-#include <std/new.h>
-#endif
diff --git a/contrib/libg++/libstdc++/newi.cc b/contrib/libg++/libstdc++/newi.cc
deleted file mode 100644
index b4a5b6aeb7e3..000000000000
--- a/contrib/libg++/libstdc++/newi.cc
+++ /dev/null
@@ -1,7 +0,0 @@
-// Implementation file for the -*- C++ -*- dynamic memory management header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifdef __GNUG__
-#pragma implementation "std/new.h"
-#endif
-#include <std/new.h>
diff --git a/contrib/libg++/libstdc++/numeric b/contrib/libg++/libstdc++/numeric
deleted file mode 100644
index dcb88737f171..000000000000
--- a/contrib/libg++/libstdc++/numeric
+++ /dev/null
@@ -1,7 +0,0 @@
-// -*- C++ -*- forwarding header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __NUMERIC__
-#define __NUMERIC__
-#include <algo.h>
-#endif
diff --git a/contrib/libg++/libstdc++/queue b/contrib/libg++/libstdc++/queue
deleted file mode 100644
index e71ce343067c..000000000000
--- a/contrib/libg++/libstdc++/queue
+++ /dev/null
@@ -1,7 +0,0 @@
-// -*- C++ -*- forwarding header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __QUEUE__
-#define __QUEUE__
-#include <stack.h>
-#endif
diff --git a/contrib/libg++/libstdc++/set b/contrib/libg++/libstdc++/set
deleted file mode 100644
index 0353285fe502..000000000000
--- a/contrib/libg++/libstdc++/set
+++ /dev/null
@@ -1,7 +0,0 @@
-// -*- C++ -*- forwarding header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __SET__
-#define __SET__
-#include <set.h>
-#endif
diff --git a/contrib/libg++/libstdc++/sinst.cc b/contrib/libg++/libstdc++/sinst.cc
deleted file mode 100644
index 136a05e532bb..000000000000
--- a/contrib/libg++/libstdc++/sinst.cc
+++ /dev/null
@@ -1,147 +0,0 @@
-// Instantiation file for the -*- C++ -*- string classes.
-// Copyright (C) 1994 Free Software Foundation
-
-// This file is part of the GNU ANSI C++ 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.
-
-// Written by Jason Merrill based upon the specification by Takanori Adachi
-// in ANSI X3J16/94-0013R2.
-
-#ifdef __GNUG__
-#ifdef TRAITS
-#ifdef C
-#pragma implementation "std/straits.h"
-#endif
-#endif
-#endif
-
-#if 0
-#define _G_NO_EXTERN_TEMPLATES
-#endif
-#include <std/bastring.cc>
-
-#ifdef C
-typedef char c;
-#endif
-#ifdef W
-typedef wchar_t c;
-#endif
-
-#ifdef TRAITS
-template class string_char_traits <c>;
-#endif
-
-#define STRING basic_string <c, string_char_traits <c> >
-typedef class STRING s;
-#define BSREP __bsrep <c, string_char_traits <c> >
-typedef class BSREP r;
-
-#ifdef REP
-template class BSREP;
-r s::nilRep = { 0, 0, 1 };
-#ifdef _G_ALLOC_CONTROL
-bool (*r::excess_slop) (size_t, size_t) = r::default_excess;
-size_t (*r::frob_size) (size_t) = r::default_frob;
-#endif
-#endif
-
-#ifdef MAIN
-template class STRING;
-#endif
-
-#ifdef ADDSS
-template s operator+ (const s&, const s&);
-#endif
-#ifdef ADDPS
-template s operator+ (const c*, const s&);
-#endif
-#ifdef ADDCS
-template s operator+ (c, const s&);
-#endif
-#ifdef ADDSP
-template s operator+ (const s&, const c*);
-#endif
-#ifdef ADDSC
-template s operator+ (const s&, c);
-#endif
-#ifdef EQSS
-template bool operator== (const s&, const s&);
-#endif
-#ifdef EQPS
-template bool operator== (const c*, const s&);
-#endif
-#ifdef EQSP
-template bool operator== (const s&, const c*);
-#endif
-#ifdef NESS
-template bool operator!= (const s&, const s&);
-#endif
-#ifdef NEPS
-template bool operator!= (const c*, const s&);
-#endif
-#ifdef NESP
-template bool operator!= (const s&, const c*);
-#endif
-#ifdef LTSS
-template bool operator< (const s&, const s&);
-#endif
-#ifdef LTPS
-template bool operator< (const c*, const s&);
-#endif
-#ifdef LTSP
-template bool operator< (const s&, const c*);
-#endif
-#ifdef GTSS
-template bool operator> (const s&, const s&);
-#endif
-#ifdef GTPS
-template bool operator> (const c*, const s&);
-#endif
-#ifdef GTSP
-template bool operator> (const s&, const c*);
-#endif
-#ifdef LESS
-template bool operator<= (const s&, const s&);
-#endif
-#ifdef LEPS
-template bool operator<= (const c*, const s&);
-#endif
-#ifdef LESP
-template bool operator<= (const s&, const c*);
-#endif
-#ifdef GESS
-template bool operator>= (const s&, const s&);
-#endif
-#ifdef GEPS
-template bool operator>= (const c*, const s&);
-#endif
-#ifdef GESP
-template bool operator>= (const s&, const c*);
-#endif
-#ifdef EXTRACT
-template istream& operator>> (istream&, s&);
-#endif // EXTRACT
-#ifdef INSERT
-template ostream& operator<< (ostream&, const s&);
-#endif // INSERT
-#ifdef GETLINE
-template istream& getline (istream&, s&);
-#endif
diff --git a/contrib/libg++/libstdc++/stack b/contrib/libg++/libstdc++/stack
deleted file mode 100644
index dfe0c51e1813..000000000000
--- a/contrib/libg++/libstdc++/stack
+++ /dev/null
@@ -1,7 +0,0 @@
-// -*- C++ -*- forwarding header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __STACK__
-#define __STACK__
-#include <stack.h>
-#endif
diff --git a/contrib/libg++/libstdc++/std/bastring.cc b/contrib/libg++/libstdc++/std/bastring.cc
deleted file mode 100644
index 92c69d845b22..000000000000
--- a/contrib/libg++/libstdc++/std/bastring.cc
+++ /dev/null
@@ -1,489 +0,0 @@
-// Member templates for the -*- C++ -*- string classes.
-// Copyright (C) 1994 Free Software Foundation
-
-// This file is part of the GNU ANSI C++ 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.
-
-// Written by Jason Merrill based upon the specification by Takanori Adachi
-// in ANSI X3J16/94-0013R2.
-
-#include <std/stddef.h>
-#include <std/bastring.h>
-
-extern "C++" {
-template <class charT, class traits>
-inline void * __bsrep <charT, traits>::
-operator new (size_t s, size_t extra)
-{
- return ::operator new (s + extra * sizeof (charT));
-}
-
-template <class charT, class traits>
-inline size_t __bsrep <charT, traits>::
-#if _G_ALLOC_CONTROL
-default_frob (size_t s)
-#else
-frob_size (size_t s)
-#endif
-{
- size_t i = 16;
- while (i < s) i *= 2;
- return i;
-}
-
-template <class charT, class traits>
-inline __bsrep <charT, traits> * __bsrep <charT, traits>::
-create (size_t extra)
-{
- extra = frob_size (extra + 1);
- Rep *p = new (extra) Rep;
- p->res = extra;
- p->ref = 1;
- p->selfish = false;
- return p;
-}
-
-template <class charT, class traits>
-charT * __bsrep <charT, traits>::
-clone ()
-{
- Rep *p = Rep::create (len);
- p->copy (0, data (), len);
- p->len = len;
- return p->data ();
-}
-
-template <class charT, class traits>
-inline bool __bsrep <charT, traits>::
-#ifdef _G_ALLOC_CONTROL
-default_excess (size_t s, size_t r)
-#else
-excess_slop (size_t s, size_t r)
-#endif
-{
- return 2 * (s <= 16 ? 16 : s) < r;
-}
-
-template <class charT, class traits>
-inline bool basic_string <charT, traits>::
-check_realloc (size_t s) const
-{
- s += sizeof (charT);
- return (rep ()->ref > 1
- || s > capacity ()
- || Rep::excess_slop (s, capacity ()));
-}
-
-template <class charT, class traits>
-void basic_string <charT, traits>::
-alloc (size_t size, bool save)
-{
- if (! check_realloc (size))
- return;
-
- Rep *p = Rep::create (size);
-
- if (save)
- {
- p->copy (0, data (), length ());
- p->len = length ();
- }
- else
- p->len = 0;
-
- repup (p);
-}
-
-template <class charT, class traits>
-basic_string <charT, traits>& basic_string <charT, traits>::
-replace (size_t pos1, size_t n1,
- const basic_string& str, size_t pos2, size_t n2)
-{
- const size_t len2 = str.length ();
-
- if (pos1 == 0 && n1 >= length () && pos2 == 0 && n2 >= len2)
- return operator= (str);
-
- OUTOFRANGE (pos2 > len2);
-
- if (n2 > len2 - pos2)
- n2 = len2 - pos2;
-
- return replace (pos1, n1, str.data () + pos2, n2);
-}
-
-template <class charT, class traits>
-inline void __bsrep <charT, traits>::
-copy (size_t pos, const charT *s, size_t n)
-{
- if (n)
- traits::copy (data () + pos, s, n);
-}
-
-template <class charT, class traits>
-inline void __bsrep <charT, traits>::
-move (size_t pos, const charT *s, size_t n)
-{
- if (n)
- traits::move (data () + pos, s, n);
-}
-
-template <class charT, class traits>
-basic_string <charT, traits>& basic_string <charT, traits>::
-replace (size_t pos, size_t n1, const charT* s, size_t n2)
-{
- const size_t len = length ();
- OUTOFRANGE (pos > len);
- if (n1 > len - pos)
- n1 = len - pos;
- LENGTHERROR (len - n1 > max_size () - n2);
- size_t newlen = len - n1 + n2;
-
- if (check_realloc (newlen))
- {
- Rep *p = Rep::create (newlen);
- p->copy (0, data (), pos);
- p->copy (pos + n2, data () + pos + n1, len - (pos + n1));
- p->copy (pos, s, n2);
- repup (p);
- }
- else
- {
- rep ()->move (pos + n2, data () + pos + n1, len - (pos + n1));
- rep ()->copy (pos, s, n2);
- }
- rep ()->len = newlen;
-
- return *this;
-}
-
-template <class charT, class traits>
-inline void __bsrep <charT, traits>::
-set (size_t pos, const charT c, size_t n)
-{
- traits::set (data () + pos, c, n);
-}
-
-template <class charT, class traits>
-basic_string <charT, traits>& basic_string <charT, traits>::
-replace (size_t pos, size_t n1, size_t n2, charT c)
-{
- const size_t len = length ();
- OUTOFRANGE (pos > len);
- if (n1 > len - pos)
- n1 = len - pos;
- LENGTHERROR (len - n1 > max_size () - n2);
- size_t newlen = len - n1 + n2;
-
- if (check_realloc (newlen))
- {
- Rep *p = Rep::create (newlen);
- p->copy (0, data (), pos);
- p->copy (pos + n2, data () + pos + n1, len - (pos + n1));
- p->set (pos, c, n2);
- repup (p);
- }
- else
- {
- rep ()->move (pos + n2, data () + pos + n1, len - (pos + n1));
- rep ()->set (pos, c, n2);
- }
- rep ()->len = newlen;
-
- return *this;
-}
-
-template <class charT, class traits>
-void basic_string <charT, traits>::
-resize (size_t n, charT c)
-{
- LENGTHERROR (n > max_size ());
-
- if (n > length ())
- append (n - length (), c);
- else
- remove (n);
-}
-
-template <class charT, class traits>
-size_t basic_string <charT, traits>::
-copy (charT* s, size_t n, size_t pos)
-{
- OUTOFRANGE (pos > length ());
-
- if (n > length () - pos)
- n = length () - pos;
-
- traits::copy (s, data () + pos, n);
- return n;
-}
-
-template <class charT, class traits>
-size_t basic_string <charT, traits>::
-find (const charT* s, size_t pos, size_t n) const
-{
- size_t xpos = pos;
- for (; xpos + n <= length (); ++xpos)
- if (traits::eq (data () [xpos], *s)
- && traits::compare (data () + xpos, s, n) == 0)
- return xpos;
- return npos;
-}
-
-template <class charT, class traits>
-inline size_t basic_string <charT, traits>::
-_find (const charT* ptr, charT c, size_t xpos, size_t len)
-{
- for (; xpos < len; ++xpos)
- if (traits::eq (ptr [xpos], c))
- return xpos;
- return npos;
-}
-
-template <class charT, class traits>
-size_t basic_string <charT, traits>::
-find (charT c, size_t pos) const
-{
- return _find (data (), c, pos, length ());
-}
-
-template <class charT, class traits>
-size_t basic_string <charT, traits>::
-rfind (const charT* s, size_t pos, size_t n) const
-{
- if (n > length ())
- return npos;
-
- size_t xpos = length () - n;
- if (xpos > pos)
- xpos = pos;
-
- for (++xpos; xpos-- > 0; )
- if (traits::eq (data () [xpos], *s)
- && traits::compare (data () + xpos, s, n) == 0)
- return xpos;
- return npos;
-}
-
-template <class charT, class traits>
-size_t basic_string <charT, traits>::
-rfind (charT c, size_t pos) const
-{
- if (1 > length ())
- return npos;
-
- size_t xpos = length () - 1;
- if (xpos > pos)
- xpos = pos;
-
- for (++xpos; xpos-- > 0; )
- if (traits::eq (data () [xpos], c))
- return xpos;
- return npos;
-}
-
-template <class charT, class traits>
-size_t basic_string <charT, traits>::
-find_first_of (const charT* s, size_t pos, size_t n) const
-{
- size_t xpos = pos;
- for (; xpos < length (); ++xpos)
- if (_find (s, data () [xpos], 0, n) != npos)
- return xpos;
- return npos;
-}
-
-template <class charT, class traits>
-size_t basic_string <charT, traits>::
-find_last_of (const charT* s, size_t pos, size_t n) const
-{
- size_t xpos = length ();
- for (; xpos-- > pos; )
- if (_find (s, data () [xpos], 0, n) != npos)
- return xpos;
- return npos;
-}
-
-template <class charT, class traits>
-size_t basic_string <charT, traits>::
-find_first_not_of (const charT* s, size_t pos, size_t n) const
-{
- size_t xpos = pos;
- for (; xpos < length (); ++xpos)
- if (_find (s, data () [xpos], 0, n) == npos)
- return xpos;
- return npos;
-}
-
-template <class charT, class traits>
-size_t basic_string <charT, traits>::
-find_first_not_of (charT c, size_t pos) const
-{
- size_t xpos = pos;
- for (; xpos < length (); ++xpos)
- if (traits::ne (data () [xpos], c))
- return xpos;
- return npos;
-}
-
-template <class charT, class traits>
-size_t basic_string <charT, traits>::
-find_last_not_of (const charT* s, size_t pos, size_t n) const
-{
- size_t xpos = length ();
- for (; xpos-- > pos; )
- if (_find (s, data () [xpos], 0, n) == npos)
- return xpos;
- return npos;
-}
-
-template <class charT, class traits>
-size_t basic_string <charT, traits>::
-find_last_not_of (charT c, size_t pos) const
-{
- size_t xpos = length ();
- for (; xpos-- > pos; )
- if (traits::ne (data () [xpos], c))
- return xpos;
- return npos;
-}
-
-template <class charT, class traits>
-int basic_string <charT, traits>::
-compare (const basic_string& str, size_t pos, size_t n) const
-{
- OUTOFRANGE (pos > length ());
-
- size_t rlen = length () - pos;
- if (rlen > n)
- rlen = n;
- if (rlen > str.length ())
- rlen = str.length ();
- int r = traits::compare (data () + pos, str.data (), rlen);
- if (r != 0)
- return r;
- if (rlen == n)
- return 0;
- return (length () - pos) - str.length ();
-}
-
-template <class charT, class traits>
-int basic_string <charT, traits>::
-compare (const charT* s, size_t pos, size_t n) const
-{
- OUTOFRANGE (pos > length ());
-
- size_t rlen = length () - pos;
- if (rlen > n)
- rlen = n;
- int r = traits::compare (data () + pos, s, rlen);
- if (r != 0)
- return r;
- return (length () - pos) - n;
-}
-
-#include <iostream.h>
-
-template <class charT, class traits>
-istream &
-operator>> (istream &is, basic_string <charT, traits> &s)
-{
- int w = is.width (0);
- if (is.ipfx0 ())
- {
- register streambuf *sb = is.rdbuf ();
- s.resize (0);
- while (1)
- {
- int ch = sb->sbumpc ();
- if (ch == EOF)
- {
- is.setstate (ios::eofbit);
- break;
- }
- else if (traits::is_del (ch))
- {
- sb->sungetc ();
- break;
- }
- s += ch;
- if (--w == 1)
- break;
- }
- }
-
- is.isfx ();
- if (s.length () == 0)
- is.setstate (ios::failbit);
-
- return is;
-}
-
-template <class charT, class traits>
-ostream &
-operator<< (ostream &o, const basic_string <charT, traits>& s)
-{
- return o.write (s.data (), s.length ());
-}
-
-template <class charT, class traits>
-istream&
-getline (istream &is, basic_string <charT, traits>& s, charT delim)
-{
- if (is.ipfx1 ())
- {
- _IO_size_t count = 0;
- streambuf *sb = is.rdbuf ();
- s.resize (0);
-
- while (1)
- {
- int ch = sb->sbumpc ();
- if (ch == EOF)
- {
- is.setstate (count == 0
- ? (ios::failbit|ios::eofbit)
- : ios::eofbit);
- break;
- }
-
- ++count;
-
- if (ch == delim)
- break;
-
- s += ch;
-
- if (s.length () == s.npos - 1)
- {
- is.setstate (ios::failbit);
- break;
- }
- }
- }
-
- // We need to be friends with istream to do this.
- // is._gcount = count;
- is.isfx ();
-
- return is;
-}
-} // extern "C++"
diff --git a/contrib/libg++/libstdc++/std/bastring.h b/contrib/libg++/libstdc++/std/bastring.h
deleted file mode 100644
index d6174a21f92d..000000000000
--- a/contrib/libg++/libstdc++/std/bastring.h
+++ /dev/null
@@ -1,574 +0,0 @@
-// Main templates for the -*- C++ -*- string classes.
-// Copyright (C) 1994, 1995 Free Software Foundation
-
-// This file is part of the GNU ANSI C++ 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.
-
-// Written by Jason Merrill based upon the specification by Takanori Adachi
-// in ANSI X3J16/94-0013R2.
-
-#ifndef __BASTRING__
-#define __BASTRING__
-
-#ifdef __GNUG__
-#pragma interface
-#endif
-
-#include <std/stddef.h>
-#include <std/straits.h>
-
-#if _G_USE_EXCEPTIONS
-
-#include <stdexcept>
-#define OUTOFRANGE(cond) \
- do { if (!(cond)) throw out_of_range (#cond); } while (0)
-#define LENGTHERROR(cond) \
- do { if (!(cond)) throw length_error (#cond); } while (0)
-
-#else
-
-#include <cassert>
-#define OUTOFRANGE(cond) assert (!(cond))
-#define LENGTHERROR(cond) assert (!(cond))
-
-#endif
-
-extern "C++" {
-class istream; class ostream;
-
-// Should be a nested class basic_string<charT, traits>::Rep, but nested
-// classes don't work well with templates in g++.
-template <class charT, class traits = string_char_traits<charT> >
-struct __bsrep {
- typedef __bsrep Rep;
-
- size_t len, res, ref;
- bool selfish;
-
- charT* data () { return reinterpret_cast<charT *>(this + 1); }
- charT& operator[] (size_t s) { return data () [s]; }
- charT* grab () { if (selfish) return clone (); ++ref; return data (); }
- void release () { if (--ref == 0) delete this; }
-
- inline static void * operator new (size_t, size_t);
- inline static Rep* create (size_t);
- charT* clone ();
-
- inline void copy (size_t, const charT *, size_t);
- inline void move (size_t, const charT *, size_t);
- inline void set (size_t, const charT, size_t);
-
-#if _G_ALLOC_CONTROL
- // These function pointers allow you to modify the allocation policy used
- // by the string classes. By default they expand by powers of two, but
- // this may be excessive for space-critical applications.
-
- // Returns true if ALLOCATED is too much larger than LENGTH
- static bool (*excess_slop) (size_t length, size_t allocated);
- inline static bool default_excess (size_t, size_t);
-
- // Returns a good amount of space to allocate for a string of length LENGTH
- static size_t (*frob_size) (size_t length);
- inline static size_t default_frob (size_t);
-#else
- inline static bool excess_slop (size_t, size_t);
- inline static size_t frob_size (size_t);
-#endif
-
-private:
- Rep &operator= (const Rep &);
-};
-
-// #include <iterator.h>
-
-template <class charT, class traits = string_char_traits<charT> >
-class basic_string
-{
-private:
- typedef __bsrep<charT, traits> Rep;
-
-public:
-// types:
- typedef traits traits_type;
- typedef charT value_type;
- typedef size_t size_type;
- typedef ptrdiff_t difference_type;
- typedef charT& reference;
- typedef const charT& const_reference;
- typedef charT* pointer;
- typedef const charT* const_pointer;
- typedef pointer iterator;
- typedef const_pointer const_iterator;
-#if 0
- typedef reverse_iterator<iterator, value_type,
- reference, difference_type> reverse_iterator;
- typedef reverse_iterator<const_iterator, value_type, const_reference,
- difference_type> const_reverse_iterator;
-#endif
- static const size_type npos = static_cast<size_type>(-1);
-
-private:
- Rep *rep () const { return reinterpret_cast<Rep *>(dat) - 1; }
- void repup (Rep *p) { rep ()->release (); dat = p->data (); }
-
-public:
- const charT* data () const
- { return rep ()->data(); }
- size_type length () const
- { return rep ()->len; }
- size_type size () const
- { return rep ()->len; }
- size_type capacity () const
- { return rep ()->res; }
- size_type max_size () const
- { return (npos - 1)/sizeof (charT); } // XXX
- bool empty () const
- { return size () == 0; }
-
-// _lib.string.cons_ construct/copy/destroy:
- basic_string& operator= (const basic_string& str)
- {
- if (&str != this) { rep ()->release (); dat = str.rep ()->grab (); }
- return *this;
- }
-
- explicit basic_string (): dat (nilRep.grab ()) { }
- basic_string (const basic_string& str): dat (str.rep ()->grab ()) { }
- basic_string (const basic_string& str, size_type pos, size_type n = npos)
- : dat (nilRep.grab ()) { assign (str, pos, n); }
- basic_string (const charT* s, size_type n)
- : dat (nilRep.grab ()) { assign (s, n); }
- basic_string (const charT* s)
- : dat (nilRep.grab ()) { assign (s); }
- basic_string (size_type n, charT c)
- : dat (nilRep.grab ()) { assign (n, c); }
-#if 0
- template<class InputIterator>
- basic_string(InputIterator begin, InputIterator end,
- Allocator& = Allocator());
-#endif
-
- ~basic_string ()
- { rep ()->release (); }
-
- void swap (basic_string &s) { charT *d = dat; dat = s.dat; s.dat = d; }
-
- basic_string& append (const basic_string& str, size_type pos = 0,
- size_type n = npos)
- { return replace (length (), 0, str, pos, n); }
- basic_string& append (const charT* s, size_type n)
- { return replace (length (), 0, s, n); }
- basic_string& append (const charT* s)
- { return append (s, traits::length (s)); }
- basic_string& append (size_type n, charT c)
- { return replace (length (), 0, n, c); }
-#if 0
- template<class InputIterator>
- basic_string& append(InputIterator first, InputIterator last);
-#endif
-
- basic_string& assign (const basic_string& str, size_type pos = 0,
- size_type n = npos)
- { return replace (0, npos, str, pos, n); }
- basic_string& assign (const charT* s, size_type n)
- { return replace (0, npos, s, n); }
- basic_string& assign (const charT* s)
- { return assign (s, traits::length (s)); }
- basic_string& assign (size_type n, charT c)
- { return replace (0, npos, n, c); }
-#if 0
- template<class InputIterator>
- basic_string& assign(InputIterator first, InputIterator last);
-#endif
-
- basic_string& operator= (const charT* s)
- { return assign (s); }
- basic_string& operator= (charT c)
- { return assign (1, c); }
-
- basic_string& operator+= (const basic_string& rhs)
- { return append (rhs); }
- basic_string& operator+= (const charT* s)
- { return append (s); }
- basic_string& operator+= (charT c)
- { return append (1, c); }
-
- basic_string& insert (size_type pos1, const basic_string& str,
- size_type pos2 = 0, size_type n = npos)
- { return replace (pos1, 0, str, pos2, n); }
- basic_string& insert (size_type pos, const charT* s, size_type n)
- { return replace (pos, 0, s, n); }
- basic_string& insert (size_type pos, const charT* s)
- { return insert (pos, s, traits::length (s)); }
- basic_string& insert (size_type pos, size_type n, charT c)
- { return replace (pos, 0, n, c); }
- iterator insert(iterator p, charT c)
- { size_type pos = p - begin (); insert (pos, 1, c); return pos +begin (); }
- iterator insert(iterator p, size_type n, charT c)
- { size_type pos = p - begin (); insert (pos, n, c); return pos +begin (); }
-#if 0
- template<class InputIterator>
- void insert(iterator p, InputIterator first, InputIterator last);
-#endif
-
- basic_string& remove (size_type pos = 0, size_type n = npos)
- { return replace (pos, n, (size_type)0, (charT)0); }
- basic_string& remove (iterator pos)
- { return replace (pos - begin (), 1, (size_type)0, (charT)0); }
- basic_string& remove (iterator first, iterator last)
- { return replace (first - begin (), last - first, (size_type)0, (charT)0);}
-
- basic_string& replace (size_type pos1, size_type n1, const basic_string& str,
- size_type pos2 = 0, size_type n2 = npos);
- basic_string& replace (size_type pos, size_type n1, const charT* s,
- size_type n2);
- basic_string& replace (size_type pos, size_type n1, const charT* s)
- { return replace (pos, n1, s, traits::length (s)); }
- basic_string& replace (size_type pos, size_type n1, size_type n2, charT c);
- basic_string& replace (size_type pos, size_type n, charT c)
- { return replace (pos, n, 1, c); }
- basic_string& replace (iterator i1, iterator i2, const basic_string& str)
- { return replace (i1 - begin (), i2 - i1, str); }
- basic_string& replace (iterator i1, iterator i2, const charT* s, size_type n)
- { return replace (i1 - begin (), i2 - i1, s, n); }
- basic_string& replace (iterator i1, iterator i2, const charT* s)
- { return replace (i1 - begin (), i2 - i1, s); }
- basic_string& replace (iterator i1, iterator i2, size_type n, charT c)
- { return replace (i1 - begin (), i2 - i1, n, c); }
-#if 0
- template<class InputIterator>
- basic_string& replace(iterator i1, iterator i2,
- InputIterator j1, InputIterator j2);
-#endif
-
-private:
- static charT eos () { return traits::eos (); }
- void unique () { if (rep ()->ref > 1) alloc (capacity (), true); }
- void selfish () { unique (); rep ()->selfish = true; }
-
-public:
- charT operator[] (size_type pos) const
- {
- if (pos == length ())
- return eos ();
- return data ()[pos];
- }
-
- reference operator[] (size_type pos)
- { unique (); return (*rep ())[pos]; }
-
- reference at (size_type pos)
- {
- OUTOFRANGE (pos >= length ());
- return (*this)[pos];
- }
- const_reference at (size_type pos) const
- {
- OUTOFRANGE (pos >= length ());
- return data ()[pos];
- }
-
-private:
- void terminate () const
- { traits::assign ((*rep ())[length ()], eos ()); }
-
-public:
- const charT* c_str () const
- { terminate (); return data (); }
- void resize (size_type n, charT c);
- void resize (size_type n)
- { resize (n, eos ()); }
- void reserve (size_type) { }
-
- size_type copy (charT* s, size_type n, size_type pos = 0);
-
- size_type find (const basic_string& str, size_type pos = 0) const
- { return find (str.data(), pos, str.length()); }
- size_type find (const charT* s, size_type pos, size_type n) const;
- size_type find (const charT* s, size_type pos = 0) const
- { return find (s, pos, traits::length (s)); }
- size_type find (charT c, size_type pos = 0) const;
-
- size_type rfind (const basic_string& str, size_type pos = npos) const
- { return rfind (str.data(), pos, str.length()); }
- size_type rfind (const charT* s, size_type pos, size_type n) const;
- size_type rfind (const charT* s, size_type pos = npos) const
- { return rfind (s, pos, traits::length (s)); }
- size_type rfind (charT c, size_type pos = npos) const;
-
- size_type find_first_of (const basic_string& str, size_type pos = 0) const
- { return find_first_of (str.data(), pos, str.length()); }
- size_type find_first_of (const charT* s, size_type pos, size_type n) const;
- size_type find_first_of (const charT* s, size_type pos = 0) const
- { return find_first_of (s, pos, traits::length (s)); }
- size_type find_first_of (charT c, size_type pos = 0) const
- { return find (c, pos); }
-
- size_type find_last_of (const basic_string& str, size_type pos = npos) const
- { return find_last_of (str.data(), pos, str.length()); }
- size_type find_last_of (const charT* s, size_type pos, size_type n) const;
- size_type find_last_of (const charT* s, size_type pos = npos) const
- { return find_last_of (s, pos, traits::length (s)); }
- size_type find_last_of (charT c, size_type pos = npos) const
- { return rfind (c, pos); }
-
- size_type find_first_not_of (const basic_string& str, size_type pos = 0) const
- { return find_first_not_of (str.data(), pos, str.length()); }
- size_type find_first_not_of (const charT* s, size_type pos, size_type n) const;
- size_type find_first_not_of (const charT* s, size_type pos = 0) const
- { return find_first_not_of (s, pos, traits::length (s)); }
- size_type find_first_not_of (charT c, size_type pos = 0) const;
-
- size_type find_last_not_of (const basic_string& str, size_type pos = npos) const
- { return find_last_not_of (str.data(), pos, str.length()); }
- size_type find_last_not_of (const charT* s, size_type pos, size_type n) const;
- size_type find_last_not_of (const charT* s, size_type pos = npos) const
- { return find_last_not_of (s, pos, traits::length (s)); }
- size_type find_last_not_of (charT c, size_type pos = npos) const;
-
- basic_string substr (size_type pos = 0, size_type n = npos) const
- { return basic_string (*this, pos, n); }
-
- int compare (const basic_string& str, size_type pos = 0, size_type n = npos) const;
- // There is no 'strncmp' equivalent for charT pointers.
- int compare (const charT* s, size_type pos, size_type n) const;
- int compare (const charT* s, size_type pos = 0) const
- { return compare (s, pos, traits::length (s)); }
-
- iterator begin () { selfish (); return &(*this)[0]; }
- iterator end () { selfish (); return &(*this)[length ()]; }
- const_iterator begin () const { return &(*rep ())[0]; }
- const_iterator end () const { return &(*rep ())[length ()]; }
-
-#if 0
- reverse_iterator rbegin() { return reverse_iterator (end ()); }
- const_reverse_iterator rbegin() const
- { return const_reverse_iterator (end ()); }
- reverse_iterator rend() { return reverse_iterator (begin ()); }
- const_reverse_iterator rend() const
- { return const reverse_iterator (begin ()); }
-#endif
-
-private:
- void alloc (size_type size, bool save);
- static size_type _find (const charT* ptr, charT c, size_type xpos, size_type len);
- inline bool check_realloc (size_type s) const;
-
- static Rep nilRep;
- charT *dat;
-};
-
-template <class charT, class traits>
-inline basic_string <charT, traits>
-operator+ (const basic_string <charT, traits>& lhs,
- const basic_string <charT, traits>& rhs)
-{
- basic_string <charT, traits> str (lhs);
- str.append (rhs);
- return str;
-}
-
-template <class charT, class traits>
-inline basic_string <charT, traits>
-operator+ (const charT* lhs, const basic_string <charT, traits>& rhs)
-{
- basic_string <charT, traits> str (lhs);
- str.append (rhs);
- return str;
-}
-
-template <class charT, class traits>
-inline basic_string <charT, traits>
-operator+ (charT lhs, const basic_string <charT, traits>& rhs)
-{
- basic_string <charT, traits> str (1, lhs);
- str.append (rhs);
- return str;
-}
-
-template <class charT, class traits>
-inline basic_string <charT, traits>
-operator+ (const basic_string <charT, traits>& lhs, const charT* rhs)
-{
- basic_string <charT, traits> str (lhs);
- str.append (rhs);
- return str;
-}
-
-template <class charT, class traits>
-inline basic_string <charT, traits>
-operator+ (const basic_string <charT, traits>& lhs, charT rhs)
-{
- basic_string <charT, traits> str (lhs);
- str.append (1, rhs);
- return str;
-}
-
-template <class charT, class traits>
-inline bool
-operator== (const basic_string <charT, traits>& lhs,
- const basic_string <charT, traits>& rhs)
-{
- return (lhs.compare (rhs) == 0);
-}
-
-template <class charT, class traits>
-inline bool
-operator== (const charT* lhs, const basic_string <charT, traits>& rhs)
-{
- return (rhs.compare (lhs) == 0);
-}
-
-template <class charT, class traits>
-inline bool
-operator== (const basic_string <charT, traits>& lhs, const charT* rhs)
-{
- return (lhs.compare (rhs) == 0);
-}
-
-template <class charT, class traits>
-inline bool
-operator!= (const charT* lhs, const basic_string <charT, traits>& rhs)
-{
- return (rhs.compare (lhs) != 0);
-}
-
-template <class charT, class traits>
-inline bool
-operator!= (const basic_string <charT, traits>& lhs, const charT* rhs)
-{
- return (lhs.compare (rhs) != 0);
-}
-
-template <class charT, class traits>
-inline bool
-operator< (const basic_string <charT, traits>& lhs,
- const basic_string <charT, traits>& rhs)
-{
- return (lhs.compare (rhs) < 0);
-}
-
-template <class charT, class traits>
-inline bool
-operator< (const charT* lhs, const basic_string <charT, traits>& rhs)
-{
- return (rhs.compare (lhs) > 0);
-}
-
-template <class charT, class traits>
-inline bool
-operator< (const basic_string <charT, traits>& lhs, const charT* rhs)
-{
- return (lhs.compare (rhs) < 0);
-}
-
-template <class charT, class traits>
-inline bool
-operator> (const charT* lhs, const basic_string <charT, traits>& rhs)
-{
- return (rhs.compare (lhs) < 0);
-}
-
-template <class charT, class traits>
-inline bool
-operator> (const basic_string <charT, traits>& lhs, const charT* rhs)
-{
- return (lhs.compare (rhs) > 0);
-}
-
-template <class charT, class traits>
-inline bool
-operator<= (const charT* lhs, const basic_string <charT, traits>& rhs)
-{
- return (rhs.compare (lhs) >= 0);
-}
-
-template <class charT, class traits>
-inline bool
-operator<= (const basic_string <charT, traits>& lhs, const charT* rhs)
-{
- return (lhs.compare (rhs) <= 0);
-}
-
-template <class charT, class traits>
-inline bool
-operator>= (const charT* lhs, const basic_string <charT, traits>& rhs)
-{
- return (rhs.compare (lhs) <= 0);
-}
-
-template <class charT, class traits>
-inline bool
-operator>= (const basic_string <charT, traits>& lhs, const charT* rhs)
-{
- return (lhs.compare (rhs) >= 0);
-}
-
-// Kludge this until g++ supports the new template overloading semantics.
-#if !defined(FUNCTION_H)
-template <class charT, class traits>
-inline bool
-operator!= (const basic_string <charT, traits>& lhs,
- const basic_string <charT, traits>& rhs)
-{
- return (lhs.compare (rhs) != 0);
-}
-
-template <class charT, class traits>
-inline bool
-operator> (const basic_string <charT, traits>& lhs,
- const basic_string <charT, traits>& rhs)
-{
- return (lhs.compare (rhs) > 0);
-}
-
-template <class charT, class traits>
-inline bool
-operator<= (const basic_string <charT, traits>& lhs,
- const basic_string <charT, traits>& rhs)
-{
- return (lhs.compare (rhs) <= 0);
-}
-
-template <class charT, class traits>
-inline bool
-operator>= (const basic_string <charT, traits>& lhs,
- const basic_string <charT, traits>& rhs)
-{
- return (lhs.compare (rhs) >= 0);
-}
-#endif
-
-class istream; class ostream;
-template <class charT, class traits> istream&
-operator>> (istream&, basic_string <charT, traits>&);
-template <class charT, class traits> ostream&
-operator<< (ostream&, const basic_string <charT, traits>&);
-template <class charT, class traits> istream&
-getline (istream&, basic_string <charT, traits>&, charT delim = '\n');
-
-} // extern "C++"
-
-#if !defined (_G_NO_EXTERN_TEMPLATES)
-#include <std/sinst.h>
-#endif
-
-#endif
diff --git a/contrib/libg++/libstdc++/std/cassert.h b/contrib/libg++/libstdc++/std/cassert.h
deleted file mode 100644
index 83f9f4042f3b..000000000000
--- a/contrib/libg++/libstdc++/std/cassert.h
+++ /dev/null
@@ -1,7 +0,0 @@
-// The -*- C++ -*- assertions header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __ASSERT__
-#define __ASSERT__
-#include <assert.h>
-#endif
diff --git a/contrib/libg++/libstdc++/std/cctype.h b/contrib/libg++/libstdc++/std/cctype.h
deleted file mode 100644
index e2765aed50a6..000000000000
--- a/contrib/libg++/libstdc++/std/cctype.h
+++ /dev/null
@@ -1,7 +0,0 @@
-// The -*- C++ -*- character type header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __CCTYPE__
-#define __CCTYPE__
-#include <ctype.h>
-#endif
diff --git a/contrib/libg++/libstdc++/std/cerrno.h b/contrib/libg++/libstdc++/std/cerrno.h
deleted file mode 100644
index ce493469597e..000000000000
--- a/contrib/libg++/libstdc++/std/cerrno.h
+++ /dev/null
@@ -1,7 +0,0 @@
-// The -*- C++ -*- error number header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __CERRNO__
-#define __CERRNO__
-#include <errno.h>
-#endif
diff --git a/contrib/libg++/libstdc++/std/cfloat.h b/contrib/libg++/libstdc++/std/cfloat.h
deleted file mode 100644
index 05a6338740e7..000000000000
--- a/contrib/libg++/libstdc++/std/cfloat.h
+++ /dev/null
@@ -1,7 +0,0 @@
-// The -*- C++ -*- floating point header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __CFLOAT__
-#define __CFLOAT__
-#include <float.h>
-#endif
diff --git a/contrib/libg++/libstdc++/std/cinst.h b/contrib/libg++/libstdc++/std/cinst.h
deleted file mode 100644
index e41a2bad1460..000000000000
--- a/contrib/libg++/libstdc++/std/cinst.h
+++ /dev/null
@@ -1,112 +0,0 @@
-// Forward declarations of -*- C++ -*- complex number instantiations.
-// Copyright (C) 1994 Free Software Foundation
-
-// This file is part of the GNU ANSI C++ 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.
-
-// Written by Jason Merrill based upon the specification in the 27 May 1994
-// C++ working paper, ANSI document X3J16/94-0098.
-
-#ifndef __CINST__
-#define __CINST__
-
-#ifndef _G_NO_EXTERN_TEMPLATES
-extern "C++" {
-extern template class complex<float>;
-extern template class complex<double>;
-extern template class complex<long double>;
-
-#define __B(type) bool
-#define __C(type) complex<type>
-#define __F(type) type
-#define __I(type) int
-#define __IS(type) istream&
-#define __OS(type) ostream&
-#define __CR(type) complex<type>&
-#define __CCR(type) const complex<type>&
-
-#define __D2(name,type,ret,arg1,arg2) ret(type) name (arg1(type), arg2(type));
-
-#define __S1(name,type,ret,arg1) \
- extern template ret(type) name (arg1(type));
-#define __S2(name,type,ret,arg1,arg2) \
- extern template __D2 (name,type,ret,arg1,arg2)
-
-#define __DO1(name,ret,arg1) \
- __S1(name,float,ret,arg1) \
- __S1(name,double,ret,arg1) \
- __S1(name,long double,ret,arg1)
-#define __DO2(name,ret,arg1,arg2) \
- __S2(name,float,ret,arg1,arg2) \
- __S2(name,double,ret,arg1,arg2) \
- __S2(name,long double,ret,arg1,arg2)
-
-#define __DOCCC(name) __DO2(name,__C,__CCR,__CCR)
-#define __DOCCF(name) __DO2(name,__C,__CCR,__F)
-#define __DOCFC(name) __DO2(name,__C,__F,__CCR)
-#define __DOCFF(name) __DO2(name,__C,__F,__F)
-#define __DOBCC(name) __DO2(name,__B,__CCR,__CCR)
-#define __DOBCF(name) __DO2(name,__B,__CCR,__F)
-#define __DOBFC(name) __DO2(name,__B,__F,__CCR)
-#define __DOFC(name) __DO1(name,__F,__CCR)
-#define __DOCC(name) __DO1(name,__C,__CCR)
-
-__DO2(operator+,__C,__CCR,__CCR)
-__DO2(operator+,__C,__CCR,__F)
-__DO2(operator+,__C,__F,__CCR)
-__DO2(operator-,__C,__CCR,__CCR)
-__DO2(operator-,__C,__CCR,__F)
-__DO2(operator-,__C,__F,__CCR)
-__DO2(operator*,__C,__CCR,__CCR)
-__DO2(operator*,__C,__CCR,__F)
-__DO2(operator*,__C,__F,__CCR)
-__DO2(operator/,__C,__CCR,__F)
-__DO1(operator+,__C,__CCR)
-__DO1(operator-,__C,__CCR)
-__DO2(operator==,__B,__CCR,__CCR)
-__DO2(operator==,__B,__CCR,__F)
-__DO2(operator==,__B,__F,__CCR)
-__DO2(operator!=,__B,__CCR,__CCR)
-__DO2(operator!=,__B,__CCR,__F)
-__DO2(operator!=,__B,__F,__CCR)
-__DO1(abs,__F,__CCR)
-__DO1(arg,__F,__CCR)
-__DO2(polar,__C,__F,__F)
-__DO1(conj,__C,__CCR)
-__DO1(norm,__F,__CCR)
-
-#undef __DO1
-#undef __DO2
-#undef __S1
-#undef __S2
-#undef __D2
-#undef __B
-#undef __C
-#undef __F
-#undef __I
-#undef __IS
-#undef __OS
-#undef __CR
-#undef __CCR
-} // extern "C++"
-#endif
-
-#endif
diff --git a/contrib/libg++/libstdc++/std/ciso646.h b/contrib/libg++/libstdc++/std/ciso646.h
deleted file mode 100644
index 974d15b57420..000000000000
--- a/contrib/libg++/libstdc++/std/ciso646.h
+++ /dev/null
@@ -1,7 +0,0 @@
-// The -*- C++ -*- ISO 646 header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __CISO646__
-#define __CISO646__
-#include <iso646.h>
-#endif
diff --git a/contrib/libg++/libstdc++/std/climits.h b/contrib/libg++/libstdc++/std/climits.h
deleted file mode 100644
index 45e3d62b492f..000000000000
--- a/contrib/libg++/libstdc++/std/climits.h
+++ /dev/null
@@ -1,7 +0,0 @@
-// The -*- C++ -*- integral type limits header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __CLIMITS__
-#define __CLIMITS__
-#include <limits.h>
-#endif
diff --git a/contrib/libg++/libstdc++/std/clocale.h b/contrib/libg++/libstdc++/std/clocale.h
deleted file mode 100644
index b67cf31c9d2e..000000000000
--- a/contrib/libg++/libstdc++/std/clocale.h
+++ /dev/null
@@ -1,7 +0,0 @@
-// The -*- C++ -*- locale support header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __CLOCALE__
-#define __CLOCALE__
-#include <locale.h>
-#endif
diff --git a/contrib/libg++/libstdc++/std/cmath.h b/contrib/libg++/libstdc++/std/cmath.h
deleted file mode 100644
index 8c6628ed83c9..000000000000
--- a/contrib/libg++/libstdc++/std/cmath.h
+++ /dev/null
@@ -1,76 +0,0 @@
-// The -*- C++ -*- math functions header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __CMATH__
-#define __CMATH__
-#include <_G_config.h>
-#include <math.h>
-
-#ifdef __GNUG__
-#pragma interface "std/cmath.h"
-#endif
-
-extern "C++" {
-#if 0
-float acos (float);
-float asin (float);
-float atan (float);
-float atan2(float, float);
-float ceil (float);
-float cos (float);
-float cosh (float);
-float exp (float);
-float fabs (float);
-float floor(float);
-float fmod (float, float);
-float frexp(float, int*);
-float modf (float, float*);
-float ldexp(float, int);
-float log (float);
-float log10(float);
-float pow (float, float);
-float pow (float, int);
-float sin (float);
-float sinh (float);
-float sqrt (float);
-float tan (float);
-float tanh (float);
-#endif
-
-inline float abs (float x) { return fabs (x); }
-#if ! _G_MATH_H_INLINES /* hpux and SCO define this in math.h */
-inline double abs (double x) { return fabs (x); }
-#endif
-
-#if 0
-double pow(double, int);
-
-long double acos (long double);
-long double asin (long double);
-long double atan (long double);
-long double atan2(long double, long double);
-long double ceil (long double);
-long double cos (long double);
-long double cosh (long double);
-long double exp (long double);
-long double fabs (long double);
-long double floor(long double);
-long double frexp(long double, int*);
-long double fmod (long double, long double);
-long double frexp(long double, int*);
-long double log (long double);
-long double log10(long double);
-long double modf (long double, long double*);
-long double pow (long double, long double);
-long double pow (long double, int);
-long double sin (long double);
-long double sinh (long double);
-long double sqrt (long double);
-long double tan (long double);
-long double tanh (long double);
-#endif
-inline long double abs (long double x) { return fabs (x); }
-
-} // extern "C++"
-
-#endif
diff --git a/contrib/libg++/libstdc++/std/complex.h b/contrib/libg++/libstdc++/std/complex.h
deleted file mode 100644
index bfdd352b4623..000000000000
--- a/contrib/libg++/libstdc++/std/complex.h
+++ /dev/null
@@ -1,18 +0,0 @@
-// Main header for the -*- C++ -*- complex number classes.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __COMPLEX__
-#define __COMPLEX__
-
-#include <std/complext.h>
-
-extern "C++" {
-#define __STD_COMPLEX
-
-// ANSI complex types
-typedef complex<float> float_complex;
-typedef complex<double> double_complex;
-typedef complex<long double> long_double_complex;
-}
-
-#endif
diff --git a/contrib/libg++/libstdc++/std/complext.cc b/contrib/libg++/libstdc++/std/complext.cc
deleted file mode 100644
index 0b63125b2d20..000000000000
--- a/contrib/libg++/libstdc++/std/complext.cc
+++ /dev/null
@@ -1,273 +0,0 @@
-// Member templates for the -*- C++ -*- complex number classes.
-// Copyright (C) 1994 Free Software Foundation
-
-// This file is part of the GNU ANSI C++ 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.
-
-// Written by Jason Merrill based upon the specification in the 27 May 1994
-// C++ working paper, ANSI document X3J16/94-0098.
-
-#include <std/complex.h>
-
-extern "C++" {
-template <class FLOAT> complex<FLOAT>
-cos (const complex<FLOAT>& x)
-{
- return complex<FLOAT> (cos (real (x)) * cosh (imag (x)),
- - sin (real (x)) * sinh (imag (x)));
-}
-
-template <class FLOAT> complex<FLOAT>
-cosh (const complex<FLOAT>& x)
-{
- return complex<FLOAT> (cosh (real (x)) * cos (imag (x)),
- sinh (real (x)) * sin (imag (x)));
-}
-
-template <class FLOAT> complex<FLOAT>
-exp (const complex<FLOAT>& x)
-{
- return polar (FLOAT (exp (real (x))), imag (x));
-}
-
-template <class FLOAT> complex<FLOAT>
-log (const complex<FLOAT>& x)
-{
- return complex<FLOAT> (log (abs (x)), arg (x));
-}
-
-template <class FLOAT> complex<FLOAT>
-pow (const complex<FLOAT>& x, const complex<FLOAT>& y)
-{
- FLOAT logr = log (abs (x));
- FLOAT t = arg (x);
-
- return polar (FLOAT (exp (logr * real (y) - imag (y) * t)),
- FLOAT (imag (y) * logr + real (y) * t));
-}
-
-template <class FLOAT> complex<FLOAT>
-pow (const complex<FLOAT>& x, FLOAT y)
-{
- return exp (FLOAT (y) * log (x));
-}
-
-template <class FLOAT> complex<FLOAT>
-pow (FLOAT x, const complex<FLOAT>& y)
-{
- return exp (y * FLOAT (log (x)));
-}
-
-template <class FLOAT> complex<FLOAT>
-sin (const complex<FLOAT>& x)
-{
- return complex<FLOAT> (sin (real (x)) * cosh (imag (x)),
- cos (real (x)) * sinh (imag (x)));
-}
-
-template <class FLOAT> complex<FLOAT>
-sinh (const complex<FLOAT>& x)
-{
- return complex<FLOAT> (sinh (real (x)) * cos (imag (x)),
- cosh (real (x)) * sin (imag (x)));
-}
-
-#include <iostream.h>
-
-template <class FLOAT> istream&
-operator >> (istream& is, complex<FLOAT>& x)
-{
- FLOAT re, im = 0;
- char ch = 0;
-
- if (is.ipfx0 ())
- {
- if (is.peek () == '(')
- is >> ch;
- is >> re;
- if (ch == '(')
- {
- is >> ch;
- if (ch == ',')
- is >> im >> ch;
- }
- }
- is.isfx ();
-
- if (ch != 0 && ch != ')')
- is.setstate (ios::failbit);
- else if (is.good ())
- x = complex<FLOAT> (re, im);
-
- return is;
-}
-
-template <class FLOAT> ostream&
-operator << (ostream& os, const complex<FLOAT>& x)
-{
- return os << '(' << real (x) << ',' << imag (x) << ')';
-}
-
-// The code below is adapted from f2c's libF77, and is subject to this
-// copyright:
-
-/****************************************************************
-Copyright 1990, 1991, 1992, 1993 by AT&T Bell Laboratories and Bellcore.
-
-Permission to use, copy, modify, and distribute this software
-and its documentation for any purpose and without fee is hereby
-granted, provided that the above copyright notice appear in all
-copies and that both that the copyright notice and this
-permission notice and warranty disclaimer appear in supporting
-documentation, and that the names of AT&T Bell Laboratories or
-Bellcore or any of their entities not be used in advertising or
-publicity pertaining to distribution of the software without
-specific, written prior permission.
-
-AT&T and Bellcore disclaim all warranties with regard to this
-software, including all implied warranties of merchantability
-and fitness. In no event shall AT&T or Bellcore be liable for
-any special, indirect or consequential damages or any damages
-whatsoever resulting from loss of use, data or profits, whether
-in an action of contract, negligence or other tortious action,
-arising out of or in connection with the use or performance of
-this software.
-****************************************************************/
-
-template <class FLOAT> complex<FLOAT>& complex<FLOAT>::
-operator /= (const complex& y)
-{
- FLOAT ar = abs (y.re);
- FLOAT ai = abs (y.im);
- FLOAT nr, ni;
- FLOAT t, d;
- if (ar <= ai)
- {
- t = y.re / y.im;
- d = y.im * (1 + t*t);
- nr = (re * t + im) / d;
- ni = (im * t - re) / d;
- }
- else
- {
- t = y.im / y.re;
- d = y.re * (1 + t*t);
- nr = (re + im * t) / d;
- ni = (im - re * t) / d;
- }
- re = nr;
- im = ni;
- return *this;
-}
-
-template <class FLOAT> complex<FLOAT>
-operator / (const complex<FLOAT>& x, const complex<FLOAT>& y)
-{
- FLOAT ar = abs (real (y));
- FLOAT ai = abs (imag (y));
- FLOAT nr, ni;
- FLOAT t, d;
- if (ar <= ai)
- {
- t = real (y) / imag (y);
- d = imag (y) * (1 + t*t);
- nr = (real (x) * t + imag (x)) / d;
- ni = (imag (x) * t - real (x)) / d;
- }
- else
- {
- t = imag (y) / real (y);
- d = real (y) * (1 + t*t);
- nr = (real (x) + imag (x) * t) / d;
- ni = (imag (x) - real (x) * t) / d;
- }
- return complex<FLOAT> (nr, ni);
-}
-
-template <class FLOAT> complex<FLOAT>
-operator / (FLOAT x, const complex<FLOAT>& y)
-{
- FLOAT ar = abs (real (y));
- FLOAT ai = abs (imag (y));
- FLOAT nr, ni;
- FLOAT t, d;
- if (ar <= ai)
- {
- t = real (y) / imag (y);
- d = imag (y) * (1 + t*t);
- nr = x * t / d;
- ni = -x / d;
- }
- else
- {
- t = imag (y) / real (y);
- d = real (y) * (1 + t*t);
- nr = x / d;
- ni = -x * t / d;
- }
- return complex<FLOAT> (nr, ni);
-}
-
-template <class FLOAT> complex<FLOAT>
-pow (const complex<FLOAT>& xin, int y)
-{
- if (y == 0)
- return complex<FLOAT> (1.0);
- complex<FLOAT> r (1.0);
- complex<FLOAT> x (xin);
- if (y < 0)
- {
- y = -y;
- x = 1/x;
- }
- for (;;)
- {
- if (y & 1)
- r *= x;
- if (y >>= 1)
- x *= x;
- else
- return r;
- }
-}
-
-template <class FLOAT> complex<FLOAT>
-sqrt (const complex<FLOAT>& x)
-{
- FLOAT r = abs (x);
- FLOAT nr, ni;
- if (r == 0.0)
- nr = ni = r;
- else if (real (x) > 0)
- {
- nr = sqrt (0.5 * (r + real (x)));
- ni = imag (x) / nr / 2;
- }
- else
- {
- ni = sqrt (0.5 * (r - real (x)));
- if (imag (x) < 0)
- ni = - ni;
- nr = imag (x) / ni / 2;
- }
- return complex<FLOAT> (nr, ni);
-}
-} // extern "C++"
diff --git a/contrib/libg++/libstdc++/std/complext.h b/contrib/libg++/libstdc++/std/complext.h
deleted file mode 100644
index db87dd0988fe..000000000000
--- a/contrib/libg++/libstdc++/std/complext.h
+++ /dev/null
@@ -1,317 +0,0 @@
-// The template and inlines for the -*- C++ -*- complex number classes.
-// Copyright (C) 1994 Free Software Foundation
-
-// This file is part of the GNU ANSI C++ 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.
-
-// Written by Jason Merrill based upon the specification in the 27 May 1994
-// C++ working paper, ANSI document X3J16/94-0098.
-
-#ifndef __COMPLEXT__
-#define __COMPLEXT__
-
-#ifdef __GNUG__
-#pragma interface
-#endif
-
-#include <std/cmath.h>
-
-#if ! defined (__GNUG__) && ! defined (__attribute__)
-#define __attribute__ (foo) /* Ignore. */
-#endif
-
-extern "C++" {
-template <class FLOAT>
-class complex
-{
-public:
- complex (FLOAT r = 0, FLOAT i = 0): re (r), im (i) { }
- complex& operator += (const complex&);
- complex& operator -= (const complex&);
- complex& operator *= (const complex&);
- complex& operator /= (const complex&);
- FLOAT real () const { return re; }
- FLOAT imag () const { return im; }
-private:
- FLOAT re, im;
-
- // These functions are specified as friends for purposes of name injection;
- // they do not actually reference private members.
- friend FLOAT real (const complex&) __attribute__ ((const));
- friend FLOAT imag (const complex&) __attribute__ ((const));
- friend complex operator + (const complex&, const complex&) __attribute__ ((const));
- friend complex operator + (const complex&, FLOAT) __attribute__ ((const));
- friend complex operator + (FLOAT, const complex&) __attribute__ ((const));
- friend complex operator - (const complex&, const complex&) __attribute__ ((const));
- friend complex operator - (const complex&, FLOAT) __attribute__ ((const));
- friend complex operator - (FLOAT, const complex&) __attribute__ ((const));
- friend complex operator * (const complex&, const complex&) __attribute__ ((const));
- friend complex operator * (const complex&, FLOAT) __attribute__ ((const));
- friend complex operator * (FLOAT, const complex&) __attribute__ ((const));
- friend complex operator / (const complex&, const complex&) __attribute__ ((const));
- friend complex operator / (const complex&, FLOAT) __attribute__ ((const));
- friend complex operator / (FLOAT, const complex&) __attribute__ ((const));
- friend bool operator == (const complex&, const complex&) __attribute__ ((const));
- friend bool operator == (const complex&, FLOAT) __attribute__ ((const));
- friend bool operator == (FLOAT, const complex&) __attribute__ ((const));
- friend bool operator != (const complex&, const complex&) __attribute__ ((const));
- friend bool operator != (const complex&, FLOAT) __attribute__ ((const));
- friend bool operator != (FLOAT, const complex&) __attribute__ ((const));
- friend complex polar (FLOAT, FLOAT) __attribute__ ((const));
- friend complex pow (const complex&, const complex&) __attribute__ ((const));
- friend complex pow (const complex&, FLOAT) __attribute__ ((const));
- friend complex pow (const complex&, int) __attribute__ ((const));
- friend complex pow (FLOAT, const complex&) __attribute__ ((const));
- friend istream& operator>> (istream&, complex&);
- friend ostream& operator<< (ostream&, const complex&);
-};
-
-// Declare specializations.
-class complex<float>;
-class complex<double>;
-class complex<long double>;
-
-template <class FLOAT>
-inline complex<FLOAT>&
-complex<FLOAT>::operator += (const complex<FLOAT>& r)
-{
- re += r.re;
- im += r.im;
- return *this;
-}
-
-template <class FLOAT>
-inline complex<FLOAT>&
-complex<FLOAT>::operator -= (const complex<FLOAT>& r)
-{
- re -= r.re;
- im -= r.im;
- return *this;
-}
-
-template <class FLOAT>
-inline complex<FLOAT>&
-complex<FLOAT>::operator *= (const complex<FLOAT>& r)
-{
- FLOAT f = re * r.re - im * r.im;
- im = re * r.im + im * r.re;
- re = f;
- return *this;
-}
-
-template <class FLOAT> inline FLOAT
-imag (const complex<FLOAT>& x) __attribute__ ((const))
-{
- return x.imag ();
-}
-
-template <class FLOAT> inline FLOAT
-real (const complex<FLOAT>& x) __attribute__ ((const))
-{
- return x.real ();
-}
-
-template <class FLOAT> inline complex<FLOAT>
-operator + (const complex<FLOAT>& x, const complex<FLOAT>& y) __attribute__ ((const))
-{
- return complex<FLOAT> (real (x) + real (y), imag (x) + imag (y));
-}
-
-template <class FLOAT> inline complex<FLOAT>
-operator + (const complex<FLOAT>& x, FLOAT y) __attribute__ ((const))
-{
- return complex<FLOAT> (real (x) + y, imag (x));
-}
-
-template <class FLOAT> inline complex<FLOAT>
-operator + (FLOAT x, const complex<FLOAT>& y) __attribute__ ((const))
-{
- return complex<FLOAT> (x + real (y), imag (y));
-}
-
-template <class FLOAT> inline complex<FLOAT>
-operator - (const complex<FLOAT>& x, const complex<FLOAT>& y) __attribute__ ((const))
-{
- return complex<FLOAT> (real (x) - real (y), imag (x) - imag (y));
-}
-
-template <class FLOAT> inline complex<FLOAT>
-operator - (const complex<FLOAT>& x, FLOAT y) __attribute__ ((const))
-{
- return complex<FLOAT> (real (x) - y, imag (x));
-}
-
-template <class FLOAT> inline complex<FLOAT>
-operator - (FLOAT x, const complex<FLOAT>& y) __attribute__ ((const))
-{
- return complex<FLOAT> (x - real (y), - imag (y));
-}
-
-template <class FLOAT> inline complex<FLOAT>
-operator * (const complex<FLOAT>& x, const complex<FLOAT>& y) __attribute__ ((const))
-{
- return complex<FLOAT> (real (x) * real (y) - imag (x) * imag (y),
- real (x) * imag (y) + imag (x) * real (y));
-}
-
-template <class FLOAT> inline complex<FLOAT>
-operator * (const complex<FLOAT>& x, FLOAT y) __attribute__ ((const))
-{
- return complex<FLOAT> (real (x) * y, imag (x) * y);
-}
-
-template <class FLOAT> inline complex<FLOAT>
-operator * (FLOAT x, const complex<FLOAT>& y) __attribute__ ((const))
-{
- return complex<FLOAT> (x * real (y), x * imag (y));
-}
-
-template <class FLOAT> complex<FLOAT>
-operator / (const complex<FLOAT>& x, FLOAT y) __attribute__ ((const))
-{
- return complex<FLOAT> (real (x) / y, imag (x) / y);
-}
-
-template <class FLOAT> inline complex<FLOAT>
-operator + (const complex<FLOAT>& x) __attribute__ ((const))
-{
- return x;
-}
-
-template <class FLOAT> inline complex<FLOAT>
-operator - (const complex<FLOAT>& x) __attribute__ ((const))
-{
- return complex<FLOAT> (-real (x), -imag (x));
-}
-
-template <class FLOAT> inline bool
-operator == (const complex<FLOAT>& x, const complex<FLOAT>& y) __attribute__ ((const))
-{
- return real (x) == real (y) && imag (x) == imag (y);
-}
-
-template <class FLOAT> inline bool
-operator == (const complex<FLOAT>& x, FLOAT y) __attribute__ ((const))
-{
- return real (x) == y && imag (x) == 0;
-}
-
-template <class FLOAT> inline bool
-operator == (FLOAT x, const complex<FLOAT>& y) __attribute__ ((const))
-{
- return x == real (y) && imag (y) == 0;
-}
-
-template <class FLOAT> inline bool
-operator != (const complex<FLOAT>& x, const complex<FLOAT>& y) __attribute__ ((const))
-{
- return real (x) != real (y) || imag (x) != imag (y);
-}
-
-template <class FLOAT> inline bool
-operator != (const complex<FLOAT>& x, FLOAT y) __attribute__ ((const))
-{
- return real (x) != y || imag (x) != 0;
-}
-
-template <class FLOAT> inline bool
-operator != (FLOAT x, const complex<FLOAT>& y) __attribute__ ((const))
-{
- return x != real (y) || imag (y) != 0;
-}
-
-// Some targets don't provide a prototype for hypot when -ansi.
-extern "C" double hypot (double, double) __attribute__ ((const));
-
-template <class FLOAT> inline FLOAT
-abs (const complex<FLOAT>& x) __attribute__ ((const))
-{
- return hypot (real (x), imag (x));
-}
-
-template <class FLOAT> inline FLOAT
-arg (const complex<FLOAT>& x) __attribute__ ((const))
-{
- return atan2 (imag (x), real (x));
-}
-
-template <class FLOAT> inline complex<FLOAT>
-polar (FLOAT r, FLOAT t) __attribute__ ((const))
-{
- return complex<FLOAT> (r * cos (t), r * sin (t));
-}
-
-template <class FLOAT> inline complex<FLOAT>
-conj (const complex<FLOAT>& x) __attribute__ ((const))
-{
- return complex<FLOAT> (real (x), -imag (x));
-}
-
-template <class FLOAT> inline FLOAT
-norm (const complex<FLOAT>& x) __attribute__ ((const))
-{
- return real (x) * real (x) + imag (x) * imag (x);
-}
-
-// Declarations of templates in complext.ccI
-
-template <class FLOAT> complex<FLOAT>
- operator / (const complex<FLOAT>&, const complex<FLOAT>&) __attribute__ ((const));
-template <class FLOAT> complex<FLOAT>
- operator / (FLOAT, const complex<FLOAT>&) __attribute__ ((const));
-template <class FLOAT> complex<FLOAT>
- cos (const complex<FLOAT>&) __attribute__ ((const));
-template <class FLOAT> complex<FLOAT>
- cosh (const complex<FLOAT>&) __attribute__ ((const));
-template <class FLOAT> complex<FLOAT>
- exp (const complex<FLOAT>&) __attribute__ ((const));
-template <class FLOAT> complex<FLOAT>
- log (const complex<FLOAT>&) __attribute__ ((const));
-template <class FLOAT> complex<FLOAT>
- pow (const complex<FLOAT>&, const complex<FLOAT>&) __attribute__ ((const));
-template <class FLOAT> complex<FLOAT>
- pow (const complex<FLOAT>&, FLOAT) __attribute__ ((const));
-template <class FLOAT> complex<FLOAT>
- pow (const complex<FLOAT>&, int) __attribute__ ((const));
-template <class FLOAT> complex<FLOAT>
- pow (FLOAT, const complex<FLOAT>&) __attribute__ ((const));
-template <class FLOAT> complex<FLOAT>
- sin (const complex<FLOAT>&) __attribute__ ((const));
-template <class FLOAT> complex<FLOAT>
- sinh (const complex<FLOAT>&) __attribute__ ((const));
-template <class FLOAT> complex<FLOAT>
- sqrt (const complex<FLOAT>&) __attribute__ ((const));
-
-class istream;
-class ostream;
-template <class FLOAT> istream& operator >> (istream&, complex<FLOAT>&);
-template <class FLOAT> ostream& operator << (ostream&, const complex<FLOAT>&);
-} // extern "C++"
-
-// Specializations and such
-
-#include <std/fcomplex.h>
-#include <std/dcomplex.h>
-#include <std/ldcomplex.h>
-
-// Declare the instantiations.
-#include <std/cinst.h>
-
-#endif
diff --git a/contrib/libg++/libstdc++/std/csetjmp.h b/contrib/libg++/libstdc++/std/csetjmp.h
deleted file mode 100644
index 4bba048dcb5e..000000000000
--- a/contrib/libg++/libstdc++/std/csetjmp.h
+++ /dev/null
@@ -1,8 +0,0 @@
-// The -*- C++ -*- setjmp/longjmp header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __CSETJMP__
-#define __CSETJMP__
-#include <setjmp.h>
-#endif
-
diff --git a/contrib/libg++/libstdc++/std/csignal.h b/contrib/libg++/libstdc++/std/csignal.h
deleted file mode 100644
index 6febfb7b2ed5..000000000000
--- a/contrib/libg++/libstdc++/std/csignal.h
+++ /dev/null
@@ -1,7 +0,0 @@
-// The -*- C++ -*- signal handling header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __CSIGNAL__
-#define __CSIGNAL__
-#include <signal.h>
-#endif
diff --git a/contrib/libg++/libstdc++/std/cstdarg.h b/contrib/libg++/libstdc++/std/cstdarg.h
deleted file mode 100644
index 24c57f062997..000000000000
--- a/contrib/libg++/libstdc++/std/cstdarg.h
+++ /dev/null
@@ -1,7 +0,0 @@
-// The -*- C++ -*- variable argument handling header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __CSTDARG__
-#define __CSTDARG__
-#include <stdarg.h>
-#endif
diff --git a/contrib/libg++/libstdc++/std/cstddef.h b/contrib/libg++/libstdc++/std/cstddef.h
deleted file mode 100644
index 0e025e3d163c..000000000000
--- a/contrib/libg++/libstdc++/std/cstddef.h
+++ /dev/null
@@ -1,7 +0,0 @@
-// The -*- C++ -*- wrapper for the C standard definitions header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __CSTDDEF__
-#define __CSTDDEF__
-#include <stddef.h>
-#endif
diff --git a/contrib/libg++/libstdc++/std/cstdio.h b/contrib/libg++/libstdc++/std/cstdio.h
deleted file mode 100644
index 1fe1456b5bdf..000000000000
--- a/contrib/libg++/libstdc++/std/cstdio.h
+++ /dev/null
@@ -1,7 +0,0 @@
-// The -*- C++ -*- standard I/O header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __CSTDIO__
-#define __CSTDIO__
-#include <stdio.h>
-#endif
diff --git a/contrib/libg++/libstdc++/std/cstdlib.h b/contrib/libg++/libstdc++/std/cstdlib.h
deleted file mode 100644
index 51dc00a5af09..000000000000
--- a/contrib/libg++/libstdc++/std/cstdlib.h
+++ /dev/null
@@ -1,23 +0,0 @@
-// The -*- C++ -*- standard library header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __CSTDLIB__
-#define __CSTDLIB__
-#include <stdlib.h>
-
-#ifdef __GNUG__
-#pragma interface "std/cstdlib.h"
-#endif
-
-extern "C++" {
-
-#if _G_HAS_LABS
-inline long abs(long x) { return labs (x); }
-#else
-inline long abs(long x) { return x >= 0 ? x : -x; }
-#endif
-//inline ldiv_t div(long x, long y) { return ldiv (x, y); }
-
-} // extern "C++"
-
-#endif
diff --git a/contrib/libg++/libstdc++/std/cstring.h b/contrib/libg++/libstdc++/std/cstring.h
deleted file mode 100644
index 6d493e7501e5..000000000000
--- a/contrib/libg++/libstdc++/std/cstring.h
+++ /dev/null
@@ -1,71 +0,0 @@
-// The -*- C++ -*- null-terminated string header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __CSTRING__
-#define __CSTRING__
-
-#if 0 // Let's not bother with this just yet.
-// The ANSI C prototypes for these functions have a const argument type and
-// non-const return type, so we can't use them.
-
-#define strchr __hide_strchr
-#define strpbrk __hide_strpbrk
-#define strrchr __hide_strrchr
-#define strstr __hide_strstr
-#define memchr __hide_memchr
-#endif // 0
-
-#include_next <string.h>
-
-#if 0 // Let's not bother with this just yet.
-#undef strchr
-#undef strpbrk
-#undef strrchr
-#undef strstr
-#undef memchr
-
-#include <std/cstddef.h>
-
-#ifdef __GNUG__
-#pragma interface "std/cstring.h"
-#endif
-
-extern "C++" {
-extern "C" const char *strchr (const char *, int);
-inline char *
-strchr (char *s, int c)
-{
- return const_cast<char *> (strchr (static_cast<const char *> (s), c));
-}
-
-extern "C" const char *strpbrk (const char *, const char *);
-inline char *
-strpbrk (char *s1, const char *s2)
-{
- return const_cast<char *> (strpbrk (static_cast<const char *> (s1), s2));
-}
-
-extern "C" const char *strrchr (const char *, int);
-inline char *
-strrchr (char *s, int c)
-{
- return const_cast<char *> (strrchr (static_cast<const char *> (s), c));
-}
-
-extern "C" const char *strstr (const char *, const char *);
-inline char *
-strstr (char *s1, const char *s2)
-{
- return const_cast<char *> (strstr (static_cast<const char *> (s1), s2));
-}
-
-extern "C" const void *memchr (const void *, int, size_t);
-inline void *
-memchr (void *s, int c, size_t n)
-{
- return const_cast<void *> (memchr (static_cast<const void *> (s), c, n));
-}
-} // extern "C++"
-
-#endif // 0
-#endif // !defined (__CSTRING__)
diff --git a/contrib/libg++/libstdc++/std/ctime.h b/contrib/libg++/libstdc++/std/ctime.h
deleted file mode 100644
index 0184da5929f3..000000000000
--- a/contrib/libg++/libstdc++/std/ctime.h
+++ /dev/null
@@ -1,7 +0,0 @@
-// The -*- C++ -*- time header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __CTIME__
-#define __CTIME__
-#include <time.h>
-#endif
diff --git a/contrib/libg++/libstdc++/std/cwchar.h b/contrib/libg++/libstdc++/std/cwchar.h
deleted file mode 100644
index 1674c12b61f0..000000000000
--- a/contrib/libg++/libstdc++/std/cwchar.h
+++ /dev/null
@@ -1,7 +0,0 @@
-// The -*- C++ -*- wide character header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __CWCHAR__
-#define __CWCHAR__
-#include <wchar.h>
-#endif
diff --git a/contrib/libg++/libstdc++/std/cwctype.h b/contrib/libg++/libstdc++/std/cwctype.h
deleted file mode 100644
index 81122012bd04..000000000000
--- a/contrib/libg++/libstdc++/std/cwctype.h
+++ /dev/null
@@ -1,7 +0,0 @@
-// The -*- C++ -*- wide character type header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __CWCTYPE__
-#define __CWCTYPE__
-#include <wctype.h>
-#endif
diff --git a/contrib/libg++/libstdc++/std/dcomplex.h b/contrib/libg++/libstdc++/std/dcomplex.h
deleted file mode 100644
index d3e5d311c634..000000000000
--- a/contrib/libg++/libstdc++/std/dcomplex.h
+++ /dev/null
@@ -1,89 +0,0 @@
-// The -*- C++ -*- double_complex class.
-// Copyright (C) 1994 Free Software Foundation
-
-// This file is part of the GNU ANSI C++ 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.
-
-// Written by Jason Merrill based upon the specification in the 27 May 1994
-// C++ working paper, ANSI document X3J16/94-0098.
-
-#ifndef __DCOMPLEX__
-#define __DCOMPLEX__
-
-#ifdef __GNUG__
-#pragma interface "dcomplex"
-#endif
-
-extern "C++" {
-class complex<double>
-{
-public:
- complex (double r = 0, double i = 0): re (r), im (i) { }
- complex (const complex<float>& r): re (r.real ()), im (r.imag ()) { }
- explicit complex (const complex<long double>& r);
-
- complex& operator+= (const complex&);
- complex& operator-= (const complex&);
- complex& operator*= (const complex&);
- complex& operator/= (const complex&);
-
- double real () const { return re; }
- double imag () const { return im; }
-private:
- double re, im;
-
- // These functions are specified as friends for purposes of name injection;
- // they do not actually reference private members.
- friend double real (const complex& x) { return x.real (); }
- friend double imag (const complex& x) { return x.imag (); }
- friend complex operator + (const complex&, const complex&) __attribute__ ((const));
- friend complex operator + (const complex&, double) __attribute__ ((const));
- friend complex operator + (double, const complex&) __attribute__ ((const));
- friend complex operator - (const complex&, const complex&) __attribute__ ((const));
- friend complex operator - (const complex&, double) __attribute__ ((const));
- friend complex operator - (double, const complex&) __attribute__ ((const));
- friend complex operator * (const complex&, const complex&) __attribute__ ((const));
- friend complex operator * (const complex&, double) __attribute__ ((const));
- friend complex operator * (double, const complex&) __attribute__ ((const));
- friend complex operator / (const complex&, const complex&) __attribute__ ((const));
- friend complex operator / (const complex&, double) __attribute__ ((const));
- friend complex operator / (double, const complex&) __attribute__ ((const));
- friend bool operator == (const complex&, const complex&) __attribute__ ((const));
- friend bool operator == (const complex&, double) __attribute__ ((const));
- friend bool operator == (double, const complex&) __attribute__ ((const));
- friend bool operator != (const complex&, const complex&) __attribute__ ((const));
- friend bool operator != (const complex&, double) __attribute__ ((const));
- friend bool operator != (double, const complex&) __attribute__ ((const));
- friend complex polar (double, double) __attribute__ ((const));
- friend complex pow (const complex&, const complex&) __attribute__ ((const));
- friend complex pow (const complex&, double) __attribute__ ((const));
- friend complex pow (const complex&, int) __attribute__ ((const));
- friend complex pow (double, const complex&) __attribute__ ((const));
- friend istream& operator>> (istream&, complex&);
- friend ostream& operator<< (ostream&, const complex&);
-};
-
-inline complex<float>::complex (const complex<double>& r)
-: re (r.real ()), im (r.imag ())
-{ }
-} // extern "C++"
-
-#endif
diff --git a/contrib/libg++/libstdc++/std/exception.h b/contrib/libg++/libstdc++/std/exception.h
deleted file mode 100644
index 6de65d8fc108..000000000000
--- a/contrib/libg++/libstdc++/std/exception.h
+++ /dev/null
@@ -1,39 +0,0 @@
-// Exception Handling header for -*- C++ -*-
-// Copyright (C) 1995 Free Software Foundation
-
-// This file is part of the GNU ANSI C++ 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.
-
-#ifndef __EXCEPTION__
-#define __EXCEPTION__
-
-extern "C++" {
-// class XUNEXPECTED { to be specified };
-typedef void (*terminate_handler) ();
-typedef void (*unexpected_handler) ();
-
-terminate_handler set_terminate (terminate_handler);
-void terminate (void);
-unexpected_handler set_unexpected (unexpected_handler);
-void unexpected (void);
-} // extern "C++"
-
-#endif
diff --git a/contrib/libg++/libstdc++/std/fcomplex.h b/contrib/libg++/libstdc++/std/fcomplex.h
deleted file mode 100644
index 27f3be7a4809..000000000000
--- a/contrib/libg++/libstdc++/std/fcomplex.h
+++ /dev/null
@@ -1,85 +0,0 @@
-// The -*- C++ -*- float_complex class.
-// Copyright (C) 1994 Free Software Foundation
-
-// This file is part of the GNU ANSI C++ 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.
-
-// Written by Jason Merrill based upon the specification in the 27 May 1994
-// C++ working paper, ANSI document X3J16/94-0098.
-
-#ifndef __FCOMPLEX__
-#define __FCOMPLEX__
-
-#ifdef __GNUG__
-#pragma interface "fcomplex"
-#endif
-
-extern "C++" {
-class complex<float>
-{
-public:
- complex (float r = 0, float i = 0): re (r), im (i) { }
- explicit complex (const complex<double>& r);
- explicit complex (const complex<long double>& r);
-
- complex& operator+= (const complex&);
- complex& operator-= (const complex&);
- complex& operator*= (const complex&);
- complex& operator/= (const complex&);
-
- float real () const { return re; }
- float imag () const { return im; }
-private:
- float re, im;
-
- // These functions are specified as friends for purposes of name injection;
- // they do not actually reference private members.
- friend float real (const complex& x) { return x.real (); }
- friend float imag (const complex& x) { return x.imag (); }
- friend complex operator + (const complex&, const complex&) __attribute__ ((const));
- friend complex operator + (const complex&, float) __attribute__ ((const));
- friend complex operator + (float, const complex&) __attribute__ ((const));
- friend complex operator - (const complex&, const complex&) __attribute__ ((const));
- friend complex operator - (const complex&, float) __attribute__ ((const));
- friend complex operator - (float, const complex&) __attribute__ ((const));
- friend complex operator * (const complex&, const complex&) __attribute__ ((const));
- friend complex operator * (const complex&, float) __attribute__ ((const));
- friend complex operator * (float, const complex&) __attribute__ ((const));
- friend complex operator / (const complex&, const complex&) __attribute__ ((const));
- friend complex operator / (const complex&, float) __attribute__ ((const));
- friend complex operator / (float, const complex&) __attribute__ ((const));
- friend bool operator == (const complex&, const complex&) __attribute__ ((const));
- friend bool operator == (const complex&, float) __attribute__ ((const));
- friend bool operator == (float, const complex&) __attribute__ ((const));
- friend bool operator != (const complex&, const complex&) __attribute__ ((const));
- friend bool operator != (const complex&, float) __attribute__ ((const));
- friend bool operator != (float, const complex&) __attribute__ ((const));
- friend complex polar (float, float) __attribute__ ((const));
- friend complex pow (const complex&, const complex&) __attribute__ ((const));
- friend complex pow (const complex&, float) __attribute__ ((const));
- friend complex pow (const complex&, int) __attribute__ ((const));
- friend complex pow (float, const complex&) __attribute__ ((const));
- friend istream& operator>> (istream&, complex&);
- friend ostream& operator<< (ostream&, const complex&);
-};
-} // extern "C++"
-
-#endif
diff --git a/contrib/libg++/libstdc++/std/ldcomplex.h b/contrib/libg++/libstdc++/std/ldcomplex.h
deleted file mode 100644
index 95f90ae7f0ef..000000000000
--- a/contrib/libg++/libstdc++/std/ldcomplex.h
+++ /dev/null
@@ -1,93 +0,0 @@
-// The -*- C++ -*- long_double_complex class.
-// Copyright (C) 1994 Free Software Foundation
-
-// This file is part of the GNU ANSI C++ 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.
-
-// Written by Jason Merrill based upon the specification in the 27 May 1994
-// C++ working paper, ANSI document X3J16/94-0098.
-
-#ifndef __LDCOMPLEX__
-#define __LDCOMPLEX__
-
-#ifdef __GNUG__
-#pragma interface "ldcomplex"
-#endif
-
-extern "C++" {
-class complex<long double>
-{
-public:
- complex (long double r = 0, long double i = 0): re (r), im (i) { }
- complex (const complex<float>& r): re (r.real ()), im (r.imag ()) { }
- complex (const complex<double>& r): re (r.real ()), im (r.imag ()) { }
-
- complex& operator+= (const complex&);
- complex& operator-= (const complex&);
- complex& operator*= (const complex&);
- complex& operator/= (const complex&);
-
- long double real () const { return re; }
- long double imag () const { return im; }
-private:
- long double re, im;
-
- // These functions are specified as friends for purposes of name injection;
- // they do not actually reference private members.
- friend long double real (const complex& x) { return x.real (); }
- friend long double imag (const complex& x) { return x.imag (); }
- friend complex operator + (const complex&, const complex&) __attribute__ ((const));
- friend complex operator + (const complex&, long double) __attribute__ ((const));
- friend complex operator + (long double, const complex&) __attribute__ ((const));
- friend complex operator - (const complex&, const complex&) __attribute__ ((const));
- friend complex operator - (const complex&, long double) __attribute__ ((const));
- friend complex operator - (long double, const complex&) __attribute__ ((const));
- friend complex operator * (const complex&, const complex&) __attribute__ ((const));
- friend complex operator * (const complex&, long double) __attribute__ ((const));
- friend complex operator * (long double, const complex&) __attribute__ ((const));
- friend complex operator / (const complex&, const complex&) __attribute__ ((const));
- friend complex operator / (const complex&, long double) __attribute__ ((const));
- friend complex operator / (long double, const complex&) __attribute__ ((const));
- friend bool operator == (const complex&, const complex&) __attribute__ ((const));
- friend bool operator == (const complex&, long double) __attribute__ ((const));
- friend bool operator == (long double, const complex&) __attribute__ ((const));
- friend bool operator != (const complex&, const complex&) __attribute__ ((const));
- friend bool operator != (const complex&, long double) __attribute__ ((const));
- friend bool operator != (long double, const complex&) __attribute__ ((const));
- friend complex polar (long double, long double) __attribute__ ((const));
- friend complex pow (const complex&, const complex&) __attribute__ ((const));
- friend complex pow (const complex&, long double) __attribute__ ((const));
- friend complex pow (const complex&, int) __attribute__ ((const));
- friend complex pow (long double, const complex&) __attribute__ ((const));
- friend istream& operator>> (istream&, complex&);
- friend ostream& operator<< (ostream&, const complex&);
-};
-
-inline complex<float>::complex (const complex<long double>& r)
-: re (r.real ()), im (r.imag ())
-{ }
-
-inline complex<double>::complex (const complex<long double>& r)
-: re (r.real ()), im (r.imag ())
-{ }
-} // extern "C++"
-
-#endif
diff --git a/contrib/libg++/libstdc++/std/new.h b/contrib/libg++/libstdc++/std/new.h
deleted file mode 100644
index cfdfbebdd63d..000000000000
--- a/contrib/libg++/libstdc++/std/new.h
+++ /dev/null
@@ -1,34 +0,0 @@
-// The -*- C++ -*- dynamic memory management header.
-// Copyright (C) 1994 Free Software Foundation
-
-#ifndef __NEW__
-#define __NEW__
-
-#ifdef __GNUG__
-#pragma interface "std/new.h"
-#endif
-
-#include <std/cstddef.h>
-
-extern "C++" {
-typedef void (*new_handler)();
-extern "C" new_handler set_new_handler (new_handler);
-
-#if defined(__GNUG__) && !defined (__STRICT_ANSI__)
-// G++ implementation internals
-extern new_handler __new_handler;
-extern "C" void __default_new_handler (void);
-#endif
-
-// replaceable signatures
-void *operator new (size_t);
-void *operator new[] (size_t);
-void operator delete (void *);
-void operator delete[] (void *);
-
-// default placement versions of operator new
-inline void *operator new(size_t, void *place) { return place; }
-inline void *operator new[](size_t, void *place) { return place; }
-} // extern "C++"
-
-#endif
diff --git a/contrib/libg++/libstdc++/std/sinst.h b/contrib/libg++/libstdc++/std/sinst.h
deleted file mode 100644
index 6bd9bfc6d19d..000000000000
--- a/contrib/libg++/libstdc++/std/sinst.h
+++ /dev/null
@@ -1,73 +0,0 @@
-// Forward declarations of -*- C++ -*- string instantiations.
-// Copyright (C) 1994 Free Software Foundation
-
-// This file is part of the GNU ANSI C++ 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.
-
-// Written by Jason Merrill based upon the specification by Takanori Adachi
-// in ANSI X3J16/94-0013R2.
-
-#ifndef __SINST__
-#define __SINST__
-
-extern "C++" {
-#define __S basic_string<char,string_char_traits<char> >
-//#define __W basic_string<wchar_t,string_char_traits<wchar_t> >
-
-extern template class __bsrep<char, string_char_traits<char> >;
-extern template class __S;
-// extern template class __W;
-// extern template class __bsrep<wchar_t, string_char_traits<wchar_t> >;
-
-#define __DOPR(op, ret, c, s) \
- extern template ret operator op (const s&, const s&); \
- extern template ret operator op (const c*, const s&); \
- extern template ret operator op (const s&, const c*); \
-
-#define __DO(op, ret, c, s) \
- extern template ret operator op (const s&, const s&); \
- extern template ret operator op (const c*, const s&); \
- extern template ret operator op (const s&, const c*); \
- extern template ret operator op (c, const s&); \
- extern template ret operator op (const s&, c);
-
-__DO (+, __S, char, __S)
-// __DO (+, __W, wchar_t, __W) */
-
-#define __DOB(op) \
- __DOPR (op, bool, char, __S)
-// __DOPR (op, bool, wchar_t, __W)
-
-__DOB (==)
-__DOB (!=)
-__DOB (<)
-__DOB (>)
-__DOB (<=)
-__DOB (>=)
-
-#undef __S
-//#undef __W
-#undef __DO
-#undef __DOB
-#undef __DOPR
-} // extern "C++"
-
-#endif
diff --git a/contrib/libg++/libstdc++/std/stddef.h b/contrib/libg++/libstdc++/std/stddef.h
deleted file mode 100644
index 00cf47e7a027..000000000000
--- a/contrib/libg++/libstdc++/std/stddef.h
+++ /dev/null
@@ -1,25 +0,0 @@
-// The -*- C++ -*- standard definitions header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __STDDEF__
-#define __STDDEF__
-
-#ifdef __GNUG__
-#pragma interface "std/stddef.h"
-#endif
-
-#include <_G_config.h>
-#include <std/cstddef.h>
-
-extern "C++" {
-const size_t NPOS = (size_t)(-1);
-typedef void fvoid_t();
-
-#ifndef _WINT_T
-#define _WINT_T
-typedef _G_wint_t wint_t;
-#endif
-
-} // extern "C++"
-
-#endif
diff --git a/contrib/libg++/libstdc++/std/stdexcept.h b/contrib/libg++/libstdc++/std/stdexcept.h
deleted file mode 100644
index 785bb6a4223f..000000000000
--- a/contrib/libg++/libstdc++/std/stdexcept.h
+++ /dev/null
@@ -1,126 +0,0 @@
-// Methods for Exception Support for -*- C++ -*-
-// Copyright (C) 1994, 1995 Free Software Foundation
-
-// This file is part of the GNU ANSI C++ 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.
-
-// Written by Mike Stump based upon the specification in the 20 September 1994
-// C++ working paper, ANSI document X3J16/94-0158.
-
-#ifndef __STDEXCEPT__
-#define __STDEXCEPT__
-
-#ifdef __GNUG__
-#pragma interface "std/stdexcept.h"
-#endif
-
-#include <typeinfo>
-
-extern "C++" {
-#if 0
-#include <string>
-typedef string __string;
-#else
-typedef const char * __string;
-#endif
-
-class exception {
-public:
- typedef void (*raise_handler)(exception&);
- static raise_handler set_raise_handler(raise_handler handler_arg);
- exception (const __string& what_arg): desc (what_arg) { }
- virtual ~exception() { }
- void raise();
- virtual __string what() const { return desc; }
-protected:
- exception() { }
- virtual void do_raise() { }
-private:
- __string desc;
-};
-
-class logic_error : public exception {
-public:
- logic_error(const __string& what_arg): exception (what_arg) { }
- virtual ~logic_error() { }
-};
-
-class domain_error : public logic_error {
-public:
- domain_error (const __string& what_arg): logic_error (what_arg) { }
- virtual ~domain_error () { }
-};
-
-class invalid_argument : public logic_error {
-public:
- invalid_argument (const __string& what_arg): logic_error (what_arg) { }
- virtual ~invalid_argument () { }
-};
-
-class length_error : public logic_error {
-public:
- length_error (const __string& what_arg): logic_error (what_arg) { }
- virtual ~length_error () { }
-};
-
-class out_of_range : public logic_error {
-public:
- out_of_range (const __string& what_arg): logic_error (what_arg) { }
- virtual ~out_of_range () { }
-};
-
-class runtime_error : public exception {
-public:
- runtime_error(const __string& what_arg): exception (what_arg) { }
- virtual ~runtime_error() { }
-protected:
- runtime_error(): exception () { }
-};
-
-class range_error : public runtime_error {
-public:
- range_error (const __string& what_arg): runtime_error (what_arg) { }
- virtual ~range_error () { }
-};
-
-class overflow_error : public runtime_error {
-public:
- overflow_error (const __string& what_arg): runtime_error (what_arg) { }
- virtual ~overflow_error () { }
-};
-
-// These are moved here from typeinfo so that we can compile with -frtti
-class bad_cast : public logic_error {
-public:
- bad_cast(const __string& what_arg): logic_error (what_arg) { }
- virtual ~bad_cast() { }
-};
-
-extern bad_cast __bad_cast_object;
-
-class bad_typeid : public logic_error {
- public:
- bad_typeid (): logic_error ("bad_typeid") { }
- virtual ~bad_typeid () { }
-};
-} // extern "C++"
-
-#endif
diff --git a/contrib/libg++/libstdc++/std/straits.h b/contrib/libg++/libstdc++/std/straits.h
deleted file mode 100644
index 42fbad37fe94..000000000000
--- a/contrib/libg++/libstdc++/std/straits.h
+++ /dev/null
@@ -1,161 +0,0 @@
-// Character traits template for the -*- C++ -*- string classes.
-// Copyright (C) 1994 Free Software Foundation
-
-// This file is part of the GNU ANSI C++ 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.
-
-// Written by Jason Merrill based upon the specification by Takanori Adachi
-// in ANSI X3J16/94-0013R2.
-
-#ifndef __STRING_CHAR_TRAITS__
-#define __STRING_CHAR_TRAITS__
-
-#ifdef __GNUG__
-// For string_char_traits <char>
-#pragma interface "std/straits.h"
-#endif
-
-#include <std/stddef.h>
-
-extern "C++" {
-template <class charT>
-struct string_char_traits {
- typedef charT char_type; // for users to acquire the basic character type
-
- // constraints
-
- static void assign (char_type& c1, const char_type& c2)
- { c1 = c2; }
- static bool eq (const char_type& c1, const char_type& c2)
- { return (c1 == c2); }
- static bool ne (const char_type& c1, const char_type& c2)
- { return !(c1 == c2); }
- static bool lt (const char_type& c1, const char_type& c2)
- { return (c1 < c2); }
- static char_type eos () { return char_type(); } // the null character
- static bool is_del(char_type a) { return 0; }
- // characteristic function for delimiters of charT
-
- // speed-up functions
-
- static int compare (const char_type* s1, const char_type* s2, size_t n)
- {
- size_t i;
- for (i = 0; i < n; ++i)
- if (ne (s1[i], s2[i]))
- return lt (s1[i], s2[i]) ? -1 : 1;
-
- return 0;
- }
-
- static size_t length (const char_type* s)
- {
- size_t l = 0;
- while (ne (*s++, eos ()))
- ++l;
- return l;
- }
-
- static char_type* copy (char_type* s1, const char_type* s2, size_t n)
- {
- for (; n--; )
- assign (s1[n], s2[n]);
- return s1;
- }
-
- static char_type* move (char_type* s1, const char_type* s2, size_t n)
- {
- char_type a[n];
- size_t i;
- for (i = 0; i < n; ++i)
- assign (a[i], s2[i]);
- for (i = 0; i < n; ++i)
- assign (s1[i], a[i]);
- return s1;
- }
-
- static char_type* set (char_type* s1, const char_type& c, size_t n)
- {
- for (; n--; )
- assign (s1[n], c);
- return s1;
- }
-};
-
-class istream;
-class ostream;
-#include <std/cctype.h>
-#include <std/cstring.h>
-
-struct string_char_traits <char> {
- typedef char char_type;
-
- static void assign (char_type& c1, const char_type& c2)
- { c1 = c2; }
- static bool eq (const char_type & c1, const char_type& c2)
- { return (c1 == c2); }
- static bool ne (const char_type& c1, const char_type& c2)
- { return (c1 != c2); }
- static bool lt (const char_type& c1, const char_type& c2)
- { return (c1 < c2); }
- static char_type eos () { return 0; }
- static bool is_del(char_type a) { return isspace(a); }
-
- static int compare (const char_type* s1, const char_type* s2, size_t n)
- { return memcmp (s1, s2, n); }
- static size_t length (const char_type* s)
- { return strlen (s); }
- static char_type* copy (char_type* s1, const char_type* s2, size_t n)
- { return (char_type*) memcpy (s1, s2, n); }
- static char_type* move (char_type* s1, const char_type* s2, size_t n)
- { return (char_type*) memmove (s1, s2, n); }
- static char_type* set (char_type* s1, const char_type& c, size_t n)
- { return (char_type*) memset (s1, c, n); }
-};
-
-#if 0
-#include <std/cwctype.h>
-struct string_char_traits <wchar_t> {
- typedef wchar_t char_type;
-
- static void assign (char_type& c1, const char_type& c2)
- { c1 = c2; }
- static bool eq (const char_type & c1, const char_type& c2)
- { return (c1 == c2); }
- static bool ne (const char_type& c1, const char_type& c2)
- { return (c1 != c2); }
- static bool lt (const char_type& c1, const char_type& c2)
- { return (c1 < c2); }
- static char_type eos () { return 0; }
- static bool is_del(char_type a) { return iswspace(a); }
-
- static int compare (const char_type* s1, const char_type* s2, size_t n)
- { return wmemcmp (s1, s2, n); }
- static size_t length (const char_type* s)
- { return wcslen (s); }
- static char_type* copy (char_type* s1, const char_type* s2, size_t n)
- { return wmemcpy (s1, s2, n); }
- static char_type* set (char_type* s1, const char_type& c, size_t n)
- { return wmemset (s1, c, n); }
-};
-#endif
-} // extern "C++"
-#endif
diff --git a/contrib/libg++/libstdc++/std/string.h b/contrib/libg++/libstdc++/std/string.h
deleted file mode 100644
index 77cc801be16f..000000000000
--- a/contrib/libg++/libstdc++/std/string.h
+++ /dev/null
@@ -1,13 +0,0 @@
-// Main header for the -*- C++ -*- string classes.
-
-#ifndef __STRING__
-#define __STRING__
-
-#include <std/bastring.h>
-
-extern "C++" {
-typedef basic_string <char, string_char_traits <char> > string;
-// typedef basic_string <wchar_t, string_char_traits <wchar_t> > wstring;
-} // extern "C++"
-
-#endif
diff --git a/contrib/libg++/libstdc++/std/typeinfo.h b/contrib/libg++/libstdc++/std/typeinfo.h
deleted file mode 100644
index 44f833cd6858..000000000000
--- a/contrib/libg++/libstdc++/std/typeinfo.h
+++ /dev/null
@@ -1,245 +0,0 @@
-// RTTI support for -*- C++ -*-
-// Copyright (C) 1994, 1995 Free Software Foundation
-
-// This file is part of the GNU ANSI C++ 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.
-
-// Written by Kung Hsu based upon the specification in the 20 September 1994
-// C++ working paper, ANSI document X3J16/94-0158.
-
-#ifndef __TYPEINFO__
-#define __TYPEINFO__
-
-#ifdef __GNUG__
-#pragma interface "std/typeinfo.h"
-#endif
-
-extern "C" void* __throw_type_match_rtti (void *, void *, void *);
-
-extern "C++" {
-class type_info {
-private:
- // assigning type_info is not supported. made private.
- type_info& operator=(const type_info&);
- type_info(const type_info&);
-
-public:
- enum node_type {
- _RTTI_BUILTIN_TYPE, // builtin type
- _RTTI_USER_TYPE, // user defined type
- _RTTI_CLASS_TYPE, // class type
- _RTTI_POINTER_TYPE, // pointer type
- _RTTI_ATTR_TYPE, // attribute type for const and volatile
- _RTTI_FUNC_TYPE, // function type
- _RTTI_PTMF_TYPE, // pointer to member function type
- _RTTI_PTMD_TYPE // pointer to member data type
- };
-
- // return node type of the object
- virtual node_type __rtti_get_node_type() const { return _RTTI_BUILTIN_TYPE; }
-
- // get_name will return the name of the type, NULL if no name (like builtin)
- virtual const char * __rtti_get_name() const { return 0; }
-
- // compare if type represented by the type_info are the same type
- virtual int __rtti_compare(const type_info&) const { return 0; }
-
- // argument passed is the desired type,
- // for class type, if the type can be converted to the desired type,
- // it will be, and returned, else 0 is returned. If the match
- // succeeds, the return value will be adjusted to point to the sub-object.
- virtual void* __rtti_match(const type_info&, int, void *) const {
- // This should never be called.
- return 0;
- };
-
- // destructor
- virtual ~type_info() {}
- type_info() {}
-
- bool before(const type_info& arg);
- const char* name() const
- { return __rtti_get_name(); }
- bool operator==(const type_info& arg) const
- { return __rtti_compare(arg) == 0; }
- bool operator!=(const type_info& arg) const
- { return __rtti_compare(arg) != 0; }
-};
-
-// type_info for builtin type
-
-class __builtin_type_info : public type_info {
-public:
- enum builtin_type_val {
- _RTTI_BI_BOOL = 1, _RTTI_BI_CHAR, _RTTI_BI_SHORT, _RTTI_BI_INT,
- _RTTI_BI_LONG, _RTTI_BI_LONGLONG, _RTTI_BI_FLOAT,
- _RTTI_BI_DOUBLE, _RTTI_BI_LDOUBLE, _RTTI_BI_UCHAR,
- _RTTI_BI_USHORT, _RTTI_BI_UINT, _RTTI_BI_ULONG,
- _RTTI_BI_ULONGLONG, _RTTI_BI_SCHAR, _RTTI_BI_WCHAR, _RTTI_BI_VOID
- };
-
- builtin_type_val b_type;
-
- __builtin_type_info (builtin_type_val bt) : b_type (bt) {}
- node_type __rtti_get_node_type () const
- { return _RTTI_BUILTIN_TYPE; }
- const char *__rtti_get_name () const
- { return (const char *)0; }
- int __rtti_compare (const type_info& arg) const
- { return (arg.__rtti_get_node_type () == _RTTI_BUILTIN_TYPE &&
- ((__builtin_type_info&)arg).b_type == b_type) ? 0 : -1; }
-};
-
-// serice function for comparing types by name.
-
-inline int __fast_compare (const char *n1, const char *n2) {
- int c;
- if (n1 == n2) return 0;
- if (n1 == 0) return *n2;
- else if (n2 == 0) return *n1;
-
- c = (int)*n1++ - (int)*n2++;
- return c == 0 ? strcmp (n1, n2) : c;
-};
-
-// type_info for user type.
-
-class __user_type_info : public type_info {
- private:
- const char *_name;
-
-public:
- __user_type_info (const char *nm) : _name (nm) {}
- node_type __rtti_get_node_type () const
- { return _RTTI_USER_TYPE; }
- const char *__rtti_get_name () const
- { return _name; }
- int __rtti_compare (const type_info& arg) const
- { return (arg.__rtti_get_node_type () == __rtti_get_node_type() &&
- __fast_compare (_name, arg.__rtti_get_name ()) == 0) ? 0 : -1; }
-};
-
-// type_info for a class.
-
-class __class_type_info : public __user_type_info {
-private:
- enum access_mode {
- _RTTI_ACCESS_PUBLIC, _RTTI_ACCESS_PROTECTED, _RTTI_ACCESS_PRIVATE
- };
- type_info **base_list;
- int *offset_list;
- int *is_virtual_list;
- access_mode *access_list;
- int n_bases;
-
-public:
- __class_type_info (const char *name, type_info **bl, int *off,
- int *is_vir, access_mode *acc, int bn)
- : __user_type_info (name), base_list (bl), offset_list(off),
- is_virtual_list(is_vir), access_list(acc), n_bases (bn) {}
- node_type __rtti_get_node_type () const
- { return _RTTI_CLASS_TYPE; }
-
- // inherit __rtti_compare from __user_type_info
-
- // This is a little complex defined in typeinfo.cc
- void* __rtti_match(const type_info&, int, void *) const;
-};
-
-// type info for pointer type.
-
-class __pointer_type_info : public type_info {
-private:
- type_info& type;
-
-public:
- __pointer_type_info (type_info& ti) : type (ti) {}
- node_type __rtti_get_node_type () const
- { return _RTTI_POINTER_TYPE; }
- const char *__rtti_get_name () const
- { return (const char *)0; }
- int __rtti_compare (const type_info& arg) const
- { return (arg.__rtti_get_node_type () == __rtti_get_node_type() &&
- type.__rtti_compare ( ((__pointer_type_info&)arg).type) == 0) ? 0 : -1; }
- void* __rtti_match(const type_info& catch_type, int, void *objptr) const;
-};
-
-// type info for attributes
-
-class __attr_type_info : public type_info {
-public:
- enum attr_val {
- _RTTI_ATTR_CONST = 1, _RTTI_ATTR_VOLATILE, _RTTI_ATTR_CONSTVOL
- };
-
- attr_val attr;
- type_info& type;
-
- __attr_type_info (attr_val a, type_info& t) : attr (a), type(t) {}
- node_type __rtti_get_node_type () const
- { return _RTTI_ATTR_TYPE; }
- const char *__rtti_get_name () const
- { return (const char *)0; }
- int __rtti_compare (const type_info& arg) const
- { return (arg.__rtti_get_node_type () == _RTTI_ATTR_TYPE &&
- attr == ((__attr_type_info&)arg).attr &&
- type.__rtti_compare ( ((__attr_type_info&)arg).type ) == 0)
- ? 0 : -1; }
-};
-
-// type info for function.
-
-class __func_type_info : public __user_type_info {
-public:
- __func_type_info (const char *name) : __user_type_info (name) {}
- node_type __rtti_get_node_type () const
- { return _RTTI_FUNC_TYPE; }
-};
-
-// type info for pointer to member function.
-
-class __ptmf_type_info : public __user_type_info {
-public:
- __ptmf_type_info (const char *name) : __user_type_info (name) {}
- node_type __rtti_get_node_type () const
- { return _RTTI_PTMF_TYPE; }
-};
-
-// type info for pointer to data member.
-
-class __ptmd_type_info : public type_info {
- type_info& classtype;
- type_info& type;
-public:
- __ptmd_type_info (type_info& tc, type_info& t) : classtype (tc), type (t) {}
- node_type __rtti_get_node_type () const
- { return _RTTI_PTMD_TYPE; }
- int __rtti_compare (const type_info& arg) const
- { return (arg.__rtti_get_node_type () == _RTTI_PTMD_TYPE &&
- classtype.__rtti_compare ( ((__ptmd_type_info&)arg).classtype ) == 0 &&
- type.__rtti_compare ( ((__ptmd_type_info&)arg).type ) == 0)
- ? 0 : -1; }
-};
-} // extern "C++"
-
-#include <stdexcept>
-
-#endif
diff --git a/contrib/libg++/libstdc++/stddef b/contrib/libg++/libstdc++/stddef
deleted file mode 100644
index 9bfd4a91782d..000000000000
--- a/contrib/libg++/libstdc++/stddef
+++ /dev/null
@@ -1,6 +0,0 @@
-// -*- C++ -*- forwarding header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __STDDEF__
-#include <std/stddef.h>
-#endif
diff --git a/contrib/libg++/libstdc++/stddefi.cc b/contrib/libg++/libstdc++/stddefi.cc
deleted file mode 100644
index b49c42c945c7..000000000000
--- a/contrib/libg++/libstdc++/stddefi.cc
+++ /dev/null
@@ -1,7 +0,0 @@
-// Implementation file for the -*- C++ -*- standard definitions header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifdef __GNUG__
-#pragma implementation "std/stddef.h"
-#endif
-#include <std/stddef.h>
diff --git a/contrib/libg++/libstdc++/stdexcept b/contrib/libg++/libstdc++/stdexcept
deleted file mode 100644
index 560c53dd8888..000000000000
--- a/contrib/libg++/libstdc++/stdexcept
+++ /dev/null
@@ -1,6 +0,0 @@
-// -*- C++ -*- forwarding header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __STDEXCEPT__
-#include <std/stdexcept.h>
-#endif
diff --git a/contrib/libg++/libstdc++/stdexcepti.cc b/contrib/libg++/libstdc++/stdexcepti.cc
deleted file mode 100644
index 4025f5ba187f..000000000000
--- a/contrib/libg++/libstdc++/stdexcepti.cc
+++ /dev/null
@@ -1,8 +0,0 @@
-// Implementation file for Exception Support for -*- C++ -*-
-// This file is part of the GNU ANSI C++ Library.
-
-#ifdef __GNUG__
-#pragma implementation "std/stdexcept.h"
-#endif
-
-#include <stdexcept>
diff --git a/contrib/libg++/libstdc++/stl.h b/contrib/libg++/libstdc++/stl.h
deleted file mode 100644
index 4b270742c9cf..000000000000
--- a/contrib/libg++/libstdc++/stl.h
+++ /dev/null
@@ -1,15 +0,0 @@
-// -*- C++ -*- compatibility header.
-// This file is part of the GNU ANSI C++ Library.
-
-#include <algorithm>
-#include <deque>
-#include <functional>
-#include <iterator>
-#include <list>
-#include <map>
-#include <memory>
-#include <numeric>
-#include <set>
-#include <stack>
-#include <utility>
-#include <vector>
diff --git a/contrib/libg++/libstdc++/stl/ChangeLog b/contrib/libg++/libstdc++/stl/ChangeLog
deleted file mode 100644
index 786989d76693..000000000000
--- a/contrib/libg++/libstdc++/stl/ChangeLog
+++ /dev/null
@@ -1,86 +0,0 @@
-Wed Apr 24 10:45:22 1996 Doug Evans <dje@blues.cygnus.com>
-
- * Makefile.in (tempbuf.o,random.o): Add rules for SunOS VPATH.
-
-Fri Apr 5 17:52:31 1996 Per Bothner <bothner@kalessin.cygnus.com>
-
- * configure.in (EXTRA_MOSTLYCLEAN): New, to remove stl.list.
-
-Sun Mar 10 07:49:03 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * deque.h (distance_type): Add overload for g++.
- From Joe Buck.
-
-Thu Nov 9 17:05:23 1995 Jason Merrill <jason@yorick.cygnus.com>
-
- * algo.h algobase.h bvector.h defalloc.h deque.h function.h heap.h
- iterator.h list.h map.h multimap.h multiset.h pair.h projectn.h
- set.h stack.h tempbuf.h tree.h vector.h: Wrap #include <bool.h>
- with #ifndef __GNUG__.
-
-Thu Nov 2 17:05:44 1995 Jason Merrill <jason@yorick.cygnus.com>
-
- * deque.h (deque<T>::insert): Fix merge typo.
- * vector.h (value_type): Lose.
-
-Thu Nov 2 14:33:47 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * algo.h, algobase.h, deque.h, function.h, list.h, pair.h, random.cc:
- Merge in Oct 31 1995 release from HP.
-
-Fri Aug 11 17:11:12 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * list.h: Avoid duplicate construction and destruction of list_nodes.
- Patch from Klamer Schutte <klamer@ph.tn.tudelft.nl>.
-
-Fri Aug 11 16:45:18 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * algo.h, algobase.h, deque.h: Merged in Jul 12 1995 release from HP.
-
-Mon Jun 5 18:38:56 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * Makefile.in (stl.list): Depend on stamp-picdir.
-
-Wed May 17 02:30:47 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * tree.h: Rearrange member initializers in rb_tree constructors.
-
- * Update to HP's February 7, 1995 release.
-
-Fri May 5 10:45:31 1995 Mike Stump <mrs@cygnus.com>
-
- * random.cc (seed): Move `for' decl out of `for' statement.
-
-Wed Apr 26 13:09:16 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * configure.in (XCXXINCLUDES): Rename.
-
-Wed Mar 29 19:24:56 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * tree.h (insert): Return a value.
-
- * vector.h (insert): Cast iterator difference to size_type to
- avoid warning.
-
-Sun Feb 12 09:12:17 1995 Mike Stump <mrs@cygnus.com>
-
- * tree.h (rb_tree::max_size): Add definition when using GNU
- workaround.
-
-Thu Jan 12 01:37:42 1995 deanm@medulla.LABS.TEK.COM (Dean Messing)
-
- * configure.in (LIBDIR): Set to yes.
-
-Fri Dec 30 18:26:20 1994 Mike Stump <mrs@cygnus.com>
-
- * iterator.h: Add default template parameters where possible.
-
-Fri Dec 30 16:29:39 1994 Mike Stump <mrs@cygnus.com>
-
- * algo.h: Change rand to __rand to fix make check on linux systems.
-
-Tue Nov 29 15:30:30 1994 Per Bothner <bothner@kalessin.cygnus.com>
-
- * Initial check-in, based on HP's October 21, 1994.
-
-
diff --git a/contrib/libg++/libstdc++/stl/Makefile.in b/contrib/libg++/libstdc++/stl/Makefile.in
deleted file mode 100644
index 438d81df2d77..000000000000
--- a/contrib/libg++/libstdc++/stl/Makefile.in
+++ /dev/null
@@ -1,12 +0,0 @@
-#### package, host, target, and site dependent Makefile fragments come in here.
-##
-
-STL_OBJECTS = tempbuf.o tree.o random.o
-
-stl.list: stamp-picdir $(STL_OBJECTS)
- @echo "$(STL_OBJECTS)" >stl.list
-
-# These are here for SunOS VPATH.
-tempbuf.o: tempbuf.cc
-random.o: random.cc
-tree.o: tree.cc
diff --git a/contrib/libg++/libstdc++/stl/README b/contrib/libg++/libstdc++/stl/README
deleted file mode 100644
index fad26dec0c0d..000000000000
--- a/contrib/libg++/libstdc++/stl/README
+++ /dev/null
@@ -1,86 +0,0 @@
-This directory contains Hewlett-Packard's implementation of
-the C++ Standard Template Library.
-It is the October 31, 1995 version.
-It has been extensively modified so it can be compiled by g++.
-(Version 2.6.1 or newer is recommended.)
-Some of these hacks are pretty ugly, but are needed to work around
-bugs in g++ (which we are working on).
-Thanks to Carsten Bormann <cabo@informatik.uni-bremen.de> for
-coming up with many of these work-arounds. However, I have
-come up with alternate (possibly inferior!) work-arounds in some cases.
-
-Note that this is based on a pre-Draft Standard for C++.
-Things are likely to change. For example, the header file names
-are very likely to change. The Allocator interface will change. Etc, etc.
-CYGNUS MAKES NO COMMITTMENT (yet) TO SUPPORT BACKWARD COMPATIBILITY FOR STL.
-
-For examples if things that should work, look in the ../tests directory.
-
-DOCUMENTATION:
-See http://www.cs.rpi.edu/~musser/stl.html on the World-Wide Web,
-or anonymous ftp to butler.hpl.hp.com, directory stl, file sharfile.Z.
-
- --Per Bothner
-Cygnus Support bothner@cygnus.com
-
------------
-Here is Carsten Bormann's notes on his changes:
-
-This is a set of seriously bletcherous hacks to HP's wonderful STL
-library. The objective is to hammer STL through GCC 2.6.1 (2.6.0
-seems to work, too, until you run into one of its bugs) so that us
-academic types can play with STL, not to make STL better in any way.
-
-Many of these changes make the library much less efficient. All
-changes (except vector<bool> -- see below) are due to bugs (or
-non-features) in GCC, not due to any problems in STL. Do not judge
-the performance of STL (code space, data space, compile time
-complexity, run time complexity) from these hacks -- they will be much
-better when GCC implements more of Standard C++. May the authors of
-STL forgive me.
-
-The class templates generally have been hacked in the following ways:
-
-1) Static data members have been eliminated, generally by making them
-non-static members or member functions (both of which generally
-seriously impairs performance -- e.g., each rb_tree iterator now
-carries a copy of NIL since there is no other place to put it). The
-template list<> has suffered most.
-
-Allocators are still static members, since I changed defalloc.h to
-have static members only. (This makes allocators less useful, but
-still useable.) (Note that a static member without data need not be
-initialized.)
-
-2) For member functions defined outside the class template, parameters
-of type tmpl<T>::something have been changed. In some cases, a class
-derived from the type has been used; in some cases the function simply
-has been made inline (again causing code bloat).
-
-3) A number of function templates in iterator.h have been declared
-again for derived classes defined by templates, usually by making them
-friend functions and using the name injection feature of GCC. I don't
-understand the relevant sections of the WP, so I don't know if this
-hack will cease to work in more conforming versions of GCC or become
-unneccessary or simply STL won't work with standard C++. Some of
-the necessary friends may still be missing...
-
-defalloc.h has lost much of its functionality: see above.
-
-bool.h has been made ineffective, since GCC supports bool.
-
-Finally, bit_vector has been changed into a proper specialization of
-vector<bool>.
-[Not in this libstdc++ release. -PB]
-
-demo.cc and Makefile build a small demo program for a number of
-features of STL. This is not a test suite, so I certainly have not
-found all my mistakes (could anyone in possession of such a test suite
-please run it over these hacks?). Send bug reports (that follow GNU
-bug reporting conventions) to
-
- cabo@informatik.uni-bremen.de
-
-Note that I generally do not have time to answer questions about STL.
-
-Carsten Bormann
diff --git a/contrib/libg++/libstdc++/stl/algo.h b/contrib/libg++/libstdc++/stl/algo.h
deleted file mode 100644
index e038d715a250..000000000000
--- a/contrib/libg++/libstdc++/stl/algo.h
+++ /dev/null
@@ -1,2386 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef ALGO_H
-#define ALGO_H
-
-#include <stdlib.h>
-#ifndef __GNUG__
-#include <bool.h>
-#endif
-#include <pair.h>
-#include <iterator.h>
-#include <algobase.h>
-#include <heap.h>
-#include <tempbuf.h>
-
-template <class T>
-inline const T& __median(const T& a, const T& b, const T& c) {
- if (a < b)
- if (b < c)
- return b;
- else if (a < c)
- return c;
- else
- return a;
- else if (a < c)
- return a;
- else if (b < c)
- return c;
- else
- return b;
-}
-
-template <class T, class Compare>
-inline const T& __median(const T& a, const T& b, const T& c, Compare comp) {
- if (comp(a, b))
- if (comp(b, c))
- return b;
- else if (comp(a, c))
- return c;
- else
- return a;
- else if (comp(a, c))
- return a;
- else if (comp(b, c))
- return c;
- else
- return b;
-}
-
-template <class InputIterator, class Function>
-Function for_each(InputIterator first, InputIterator last, Function f) {
- while (first != last) f(*first++);
- return f;
-}
-
-template <class InputIterator, class T>
-InputIterator find(InputIterator first, InputIterator last, const T& value) {
- while (first != last && *first != value) ++first;
- return first;
-}
-
-template <class InputIterator, class Predicate>
-InputIterator find_if(InputIterator first, InputIterator last,
- Predicate pred) {
- while (first != last && !pred(*first)) ++first;
- return first;
-}
-
-template <class ForwardIterator>
-ForwardIterator adjacent_find(ForwardIterator first, ForwardIterator last) {
- if (first == last) return last;
- ForwardIterator next = first;
- while(++next != last) {
- if (*first == *next) return first;
- first = next;
- }
- return last;
-}
-
-template <class ForwardIterator, class BinaryPredicate>
-ForwardIterator adjacent_find(ForwardIterator first, ForwardIterator last,
- BinaryPredicate binary_pred) {
- if (first == last) return last;
- ForwardIterator next = first;
- while(++next != last) {
- if (binary_pred(*first, *next)) return first;
- first = next;
- }
- return last;
-}
-
-template <class InputIterator, class T, class Size>
-void count(InputIterator first, InputIterator last, const T& value,
- Size& n) {
- while (first != last)
- if (*first++ == value) ++n;
-}
-
-template <class InputIterator, class Predicate, class Size>
-void count_if(InputIterator first, InputIterator last, Predicate pred,
- Size& n) {
- while (first != last)
- if (pred(*first++)) ++n;
-}
-
-template <class ForwardIterator1, class ForwardIterator2, class Distance1,
- class Distance2>
-ForwardIterator1 __search(ForwardIterator1 first1, ForwardIterator1 last1,
- ForwardIterator2 first2, ForwardIterator2 last2,
- Distance1*, Distance2*) {
- Distance1 d1 = 0;
- distance(first1, last1, d1);
- Distance2 d2 = 0;
- distance(first2, last2, d2);
-
- if (d1 < d2) return last1;
-
- ForwardIterator1 current1 = first1;
- ForwardIterator2 current2 = first2;
-
- while (current2 != last2)
- if (*current1++ != *current2++)
- if (d1-- == d2)
- return last1;
- else {
- current1 = ++first1;
- current2 = first2;
- }
- return (current2 == last2) ? first1 : last1;
-}
-
-template <class ForwardIterator1, class ForwardIterator2>
-inline ForwardIterator1 search(ForwardIterator1 first1, ForwardIterator1 last1,
- ForwardIterator2 first2, ForwardIterator2 last2)
-{
- return __search(first1, last1, first2, last2, distance_type(first1),
- distance_type(first2));
-}
-
-template <class ForwardIterator1, class ForwardIterator2,
- class BinaryPredicate, class Distance1, class Distance2>
-ForwardIterator1 __search(ForwardIterator1 first1, ForwardIterator1 last1,
- ForwardIterator2 first2, ForwardIterator2 last2,
- BinaryPredicate binary_pred, Distance1*, Distance2*) {
- Distance1 d1 = 0;
- distance(first1, last1, d1);
- Distance2 d2 = 0;
- distance(first2, last2, d2);
-
- if (d1 < d2) return last1;
-
- ForwardIterator1 current1 = first1;
- ForwardIterator2 current2 = first2;
-
- while (current2 != last2)
- if (!binary_pred(*current1++, *current2++))
- if (d1-- == d2)
- return last1;
- else {
- current1 = ++first1;
- current2 = first2;
- }
- return (current2 == last2) ? first1 : last1;
-}
-
-template <class ForwardIterator1, class ForwardIterator2,
- class BinaryPredicate>
-inline ForwardIterator1 search(ForwardIterator1 first1, ForwardIterator1 last1,
- ForwardIterator2 first2, ForwardIterator2 last2,
- BinaryPredicate binary_pred) {
- return __search(first1, last1, first2, last2, binary_pred,
- distance_type(first1), distance_type(first2));
-}
-
-template <class ForwardIterator1, class ForwardIterator2>
-ForwardIterator2 swap_ranges(ForwardIterator1 first1, ForwardIterator1 last1,
- ForwardIterator2 first2) {
- while (first1 != last1) iter_swap(first1++, first2++);
- return first2;
-}
-
-template <class InputIterator, class OutputIterator, class UnaryOperation>
-OutputIterator transform(InputIterator first, InputIterator last,
- OutputIterator result, UnaryOperation op) {
- while (first != last) *result++ = op(*first++);
- return result;
-}
-
-template <class InputIterator1, class InputIterator2, class OutputIterator,
- class BinaryOperation>
-OutputIterator transform(InputIterator1 first1, InputIterator1 last1,
- InputIterator2 first2, OutputIterator result,
- BinaryOperation binary_op) {
- while (first1 != last1) *result++ = binary_op(*first1++, *first2++);
- return result;
-}
-
-template <class ForwardIterator, class T>
-void replace(ForwardIterator first, ForwardIterator last, const T& old_value,
- const T& new_value) {
- while (first != last) {
- if (*first == old_value) *first = new_value;
- ++first;
- }
-}
-
-template <class ForwardIterator, class Predicate, class T>
-void replace_if(ForwardIterator first, ForwardIterator last, Predicate pred,
- const T& new_value) {
- while (first != last) {
- if (pred(*first)) *first = new_value;
- ++first;
- }
-}
-
-template <class InputIterator, class OutputIterator, class T>
-OutputIterator replace_copy(InputIterator first, InputIterator last,
- OutputIterator result, const T& old_value,
- const T& new_value) {
- while (first != last) {
- *result++ = *first == old_value ? new_value : *first;
- ++first;
- }
- return result;
-}
-
-template <class Iterator, class OutputIterator, class Predicate, class T>
-OutputIterator replace_copy_if(Iterator first, Iterator last,
- OutputIterator result, Predicate pred,
- const T& new_value) {
- while (first != last) {
- *result++ = pred(*first) ? new_value : *first;
- ++first;
- }
- return result;
-}
-
-template <class ForwardIterator, class Generator>
-void generate(ForwardIterator first, ForwardIterator last, Generator gen) {
- while (first != last) *first++ = gen();
-}
-
-template <class OutputIterator, class Size, class Generator>
-OutputIterator generate_n(OutputIterator first, Size n, Generator gen) {
- while (n-- > 0) *first++ = gen();
- return first;
-}
-
-template <class InputIterator, class OutputIterator, class T>
-OutputIterator remove_copy(InputIterator first, InputIterator last,
- OutputIterator result, const T& value) {
- while (first != last) {
- if (*first != value) *result++ = *first;
- ++first;
- }
- return result;
-}
-
-template <class InputIterator, class OutputIterator, class Predicate>
-OutputIterator remove_copy_if(InputIterator first, InputIterator last,
- OutputIterator result, Predicate pred) {
- while (first != last) {
- if (!pred(*first)) *result++ = *first;
- ++first;
- }
- return result;
-}
-
-template <class ForwardIterator, class T>
-ForwardIterator remove(ForwardIterator first, ForwardIterator last,
- const T& value) {
- first = find(first, last, value);
- ForwardIterator next = first;
- return first == last ? first : remove_copy(++next, last, first, value);
-}
-
-template <class ForwardIterator, class Predicate>
-ForwardIterator remove_if(ForwardIterator first, ForwardIterator last,
- Predicate pred) {
- first = find_if(first, last, pred);
- ForwardIterator next = first;
- return first == last ? first : remove_copy_if(++next, last, first, pred);
-}
-
-template <class InputIterator, class ForwardIterator>
-ForwardIterator __unique_copy(InputIterator first, InputIterator last,
- ForwardIterator result, forward_iterator_tag) {
- *result = *first;
- while (++first != last)
- if (*result != *first) *++result = *first;
- return ++result;
-}
-
-template <class InputIterator, class BidirectionalIterator>
-inline BidirectionalIterator __unique_copy(InputIterator first,
- InputIterator last,
- BidirectionalIterator result,
- bidirectional_iterator_tag) {
- return __unique_copy(first, last, result, forward_iterator_tag());
-}
-
-template <class InputIterator, class RandomAccessIterator>
-inline RandomAccessIterator __unique_copy(InputIterator first,
- InputIterator last,
- RandomAccessIterator result,
- random_access_iterator_tag) {
- return __unique_copy(first, last, result, forward_iterator_tag());
-}
-
-template <class InputIterator, class OutputIterator, class T>
-OutputIterator __unique_copy(InputIterator first, InputIterator last,
- OutputIterator result, T*) {
- T value = *first;
- *result = value;
- while (++first != last)
- if (value != *first) {
- value = *first;
- *++result = value;
- }
- return ++result;
-}
-
-template <class InputIterator, class OutputIterator>
-inline OutputIterator __unique_copy(InputIterator first, InputIterator last,
- OutputIterator result,
- output_iterator_tag) {
- return __unique_copy(first, last, result, value_type(first));
-}
-
-template <class InputIterator, class OutputIterator>
-inline OutputIterator unique_copy(InputIterator first, InputIterator last,
- OutputIterator result) {
- if (first == last) return result;
- return __unique_copy(first, last, result, iterator_category(result));
-}
-template <class InputIterator, class ForwardIterator, class BinaryPredicate>
-ForwardIterator __unique_copy(InputIterator first, InputIterator last,
- ForwardIterator result,
- BinaryPredicate binary_pred,
- forward_iterator_tag) {
- *result = *first;
- while (++first != last)
- if (!binary_pred(*result, *first)) *++result = *first;
- return ++result;
-}
-
-template <class InputIterator, class BidirectionalIterator,
- class BinaryPredicate>
-inline BidirectionalIterator __unique_copy(InputIterator first,
- InputIterator last,
- BidirectionalIterator result,
- BinaryPredicate binary_pred,
- bidirectional_iterator_tag) {
- return __unique_copy(first, last, result, binary_pred,
- forward_iterator_tag());
-}
-
-template <class InputIterator, class RandomAccessIterator,
- class BinaryPredicate>
-inline RandomAccessIterator __unique_copy(InputIterator first,
- InputIterator last,
- RandomAccessIterator result,
- BinaryPredicate binary_pred,
- random_access_iterator_tag) {
- return __unique_copy(first, last, result, binary_pred,
- forward_iterator_tag());
-}
-
-template <class InputIterator, class OutputIterator, class BinaryPredicate,
- class T>
-OutputIterator __unique_copy(InputIterator first, InputIterator last,
- OutputIterator result,
- BinaryPredicate binary_pred, T*) {
- T value = *first;
- *result = value;
- while (++first != last)
- if (!binary_pred(value, *first)) {
- value = *first;
- *++result = value;
- }
- return ++result;
-}
-
-template <class InputIterator, class OutputIterator, class BinaryPredicate>
-inline OutputIterator __unique_copy(InputIterator first, InputIterator last,
- OutputIterator result,
- BinaryPredicate binary_pred,
- output_iterator_tag) {
- return __unique_copy(first, last, result, binary_pred, value_type(first));
-}
-
-template <class InputIterator, class OutputIterator, class BinaryPredicate>
-inline OutputIterator unique_copy(InputIterator first, InputIterator last,
- OutputIterator result,
- BinaryPredicate binary_pred) {
- if (first == last) return result;
- return __unique_copy(first, last, result, binary_pred,
- iterator_category(result));
-}
-
-template <class ForwardIterator>
-ForwardIterator unique(ForwardIterator first, ForwardIterator last) {
- first = adjacent_find(first, last);
- return unique_copy(first, last, first);
-}
-
-template <class ForwardIterator, class BinaryPredicate>
-ForwardIterator unique(ForwardIterator first, ForwardIterator last,
- BinaryPredicate binary_pred) {
- first = adjacent_find(first, last, binary_pred);
- return unique_copy(first, last, first, binary_pred);
-}
-
-template <class BidirectionalIterator>
-void __reverse(BidirectionalIterator first, BidirectionalIterator last,
- bidirectional_iterator_tag) {
- while (true)
- if (first == last || first == --last)
- return;
- else
- iter_swap(first++, last);
-}
-
-template <class RandomAccessIterator>
-void __reverse(RandomAccessIterator first, RandomAccessIterator last,
- random_access_iterator_tag) {
- while (first < last) iter_swap(first++, --last);
-}
-
-template <class BidirectionalIterator>
-inline void reverse(BidirectionalIterator first, BidirectionalIterator last) {
- __reverse(first, last, iterator_category(first));
-}
-
-template <class BidirectionalIterator, class OutputIterator>
-OutputIterator reverse_copy(BidirectionalIterator first,
- BidirectionalIterator last,
- OutputIterator result) {
- while (first != last) *result++ = *--last;
- return result;
-}
-
-template <class ForwardIterator, class Distance>
-void __rotate(ForwardIterator first, ForwardIterator middle,
- ForwardIterator last, Distance*, forward_iterator_tag) {
- for (ForwardIterator i = middle; ;) {
- iter_swap(first++, i++);
- if (first == middle) {
- if (i == last) return;
- middle = i;
- } else if (i == last)
- i = middle;
- }
-}
-
-template <class BidirectionalIterator, class Distance>
-void __rotate(BidirectionalIterator first, BidirectionalIterator middle,
- BidirectionalIterator last, Distance*,
- bidirectional_iterator_tag) {
- reverse(first, middle);
- reverse(middle, last);
- reverse(first, last);
-}
-
-template <class EuclideanRingElement>
-EuclideanRingElement __gcd(EuclideanRingElement m, EuclideanRingElement n)
-{
- while (n != 0) {
- EuclideanRingElement t = m % n;
- m = n;
- n = t;
- }
- return m;
-}
-
-template <class RandomAccessIterator, class Distance, class T>
-void __rotate_cycle(RandomAccessIterator first, RandomAccessIterator last,
- RandomAccessIterator initial, Distance shift, T*) {
- T value = *initial;
- RandomAccessIterator ptr1 = initial;
- RandomAccessIterator ptr2 = ptr1 + shift;
- while (ptr2 != initial) {
- *ptr1 = *ptr2;
- ptr1 = ptr2;
- if (last - ptr2 > shift)
- ptr2 += shift;
- else
- ptr2 = first + (shift - (last - ptr2));
- }
- *ptr1 = value;
-}
-
-template <class RandomAccessIterator, class Distance>
-void __rotate(RandomAccessIterator first, RandomAccessIterator middle,
- RandomAccessIterator last, Distance*,
- random_access_iterator_tag) {
- Distance n = __gcd(last - first, middle - first);
- while (n--)
- __rotate_cycle(first, last, first + n, middle - first,
- value_type(first));
-}
-
-template <class ForwardIterator>
-inline void rotate(ForwardIterator first, ForwardIterator middle,
- ForwardIterator last) {
- if (first == middle || middle == last) return;
- __rotate(first, middle, last, distance_type(first),
- iterator_category(first));
-}
-
-template <class ForwardIterator, class OutputIterator>
-OutputIterator rotate_copy(ForwardIterator first, ForwardIterator middle,
- ForwardIterator last, OutputIterator result) {
- return copy(first, middle, copy(middle, last, result));
-}
-
-unsigned long __long_random(unsigned long);
-
-template <class RandomAccessIterator, class Distance>
-void __random_shuffle(RandomAccessIterator first, RandomAccessIterator last,
- Distance*) {
- if (first == last) return;
- for (RandomAccessIterator i = first + 1; i != last; ++i)
- iter_swap(i, first + Distance(__long_random((i - first) + 1)));
-}
-
-template <class RandomAccessIterator>
-inline void random_shuffle(RandomAccessIterator first,
- RandomAccessIterator last) {
- __random_shuffle(first, last, distance_type(first));
-}
-
-template <class RandomAccessIterator, class RandomNumberGenerator>
-void random_shuffle(RandomAccessIterator first, RandomAccessIterator last,
- RandomNumberGenerator& __rand) {
- if (first == last) return;
- for (RandomAccessIterator i = first + 1; i != last; ++i)
- iter_swap(i, first + __rand((i - first) + 1));
-}
-
-template <class BidirectionalIterator, class Predicate>
-BidirectionalIterator partition(BidirectionalIterator first,
- BidirectionalIterator last, Predicate pred) {
- while (true) {
- while (true)
- if (first == last)
- return first;
- else if (pred(*first))
- ++first;
- else
- break;
- --last;
- while (true)
- if (first == last)
- return first;
- else if (!pred(*last))
- --last;
- else
- break;
- iter_swap(first, last);
- ++first;
- }
-}
-
-template <class ForwardIterator, class Predicate, class Distance>
-ForwardIterator __inplace_stable_partition(ForwardIterator first,
- ForwardIterator last,
- Predicate pred, Distance len) {
- if (len == 1) return pred(*first) ? last : first;
- ForwardIterator middle = first;
- advance(middle, len / 2);
- ForwardIterator
- first_cut = __inplace_stable_partition(first, middle, pred, len / 2);
- ForwardIterator
- second_cut = __inplace_stable_partition(middle, last, pred,
- len - len / 2);
- rotate(first_cut, middle, second_cut);
- len = 0;
- distance(middle, second_cut, len);
- advance(first_cut, len);
- return first_cut;
-}
-
-template <class ForwardIterator, class Pointer, class Predicate,
- class Distance, class T>
-ForwardIterator __stable_partition_adaptive(ForwardIterator first,
- ForwardIterator last,
- Predicate pred, Distance len,
- Pointer buffer,
- Distance buffer_size,
- Distance& fill_pointer, T*) {
- if (len <= buffer_size) {
- len = 0;
- ForwardIterator result1 = first;
- Pointer result2 = buffer;
- while (first != last && len < fill_pointer)
- if (pred(*first))
- *result1++ = *first++;
- else {
- *result2++ = *first++;
- ++len;
- }
- if (first != last) {
- raw_storage_iterator<Pointer, T> result3 = result2;
- while (first != last)
- if (pred(*first))
- *result1++ = *first++;
- else {
- *result3++ = *first++;
- ++len;
- }
- fill_pointer = len;
- }
- copy(buffer, buffer + len, result1);
- return result1;
- }
- ForwardIterator middle = first;
- advance(middle, len / 2);
- ForwardIterator first_cut = __stable_partition_adaptive
- (first, middle, pred, len / 2, buffer, buffer_size, fill_pointer,
- (T*)0);
- ForwardIterator second_cut = __stable_partition_adaptive
- (middle, last, pred, len - len / 2, buffer, buffer_size,
- fill_pointer, (T*)0);
- rotate(first_cut, middle, second_cut);
- len = 0;
- distance(middle, second_cut, len);
- advance(first_cut, len);
- return first_cut;
-}
-
-template <class ForwardIterator, class Predicate, class Pointer,
- class Distance>
-ForwardIterator __stable_partition(ForwardIterator first, ForwardIterator last,
- Predicate pred, Distance len,
- pair<Pointer, Distance> p) {
- if (p.first == 0)
- return __inplace_stable_partition(first, last, pred, len);
- Distance fill_pointer = 0;
- ForwardIterator result =
- __stable_partition_adaptive(first, last, pred, len, p.first, p.second,
- fill_pointer, value_type(first));
- destroy(p.first, p.first + fill_pointer);
- return_temporary_buffer(p.first);
- return result;
-}
-
-template <class ForwardIterator, class Predicate, class Distance>
-inline ForwardIterator __stable_partition_aux(ForwardIterator first,
- ForwardIterator last,
- Predicate pred, Distance*) {
- Distance len = 0;
- distance(first, last, len);
- return __stable_partition(first, last, pred, len,
- get_temporary_buffer(len, value_type(first)));
-}
-
-template <class ForwardIterator, class Predicate>
-inline ForwardIterator stable_partition(ForwardIterator first,
- ForwardIterator last,
- Predicate pred) {
- return __stable_partition_aux(first, last, pred, distance_type(first));
-}
-
-template <class RandomAccessIterator, class T>
-RandomAccessIterator __unguarded_partition(RandomAccessIterator first,
- RandomAccessIterator last,
- T pivot) {
- while (1) {
- while (*first < pivot) ++first;
- --last;
- while (pivot < *last) --last;
- if (!(first < last)) return first;
- iter_swap(first, last);
- ++first;
- }
-}
-
-template <class RandomAccessIterator, class T, class Compare>
-RandomAccessIterator __unguarded_partition(RandomAccessIterator first,
- RandomAccessIterator last,
- T pivot, Compare comp) {
- while (1) {
- while (comp(*first, pivot)) ++first;
- --last;
- while (comp(pivot, *last)) --last;
- if (!(first < last)) return first;
- iter_swap(first, last);
- ++first;
- }
-}
-
-const int __stl_threshold = 16;
-
-template <class RandomAccessIterator, class T>
-void __quick_sort_loop_aux(RandomAccessIterator first,
- RandomAccessIterator last, T*) {
- while (last - first > __stl_threshold) {
- RandomAccessIterator cut = __unguarded_partition
- (first, last, T(__median(*first, *(first + (last - first)/2),
- *(last - 1))));
- if (cut - first >= last - cut) {
- __quick_sort_loop(cut, last);
- last = cut;
- } else {
- __quick_sort_loop(first, cut);
- first = cut;
- }
- }
-}
-
-template <class RandomAccessIterator>
-inline void __quick_sort_loop(RandomAccessIterator first,
- RandomAccessIterator last) {
- __quick_sort_loop_aux(first, last, value_type(first));
-}
-
-template <class RandomAccessIterator, class T, class Compare>
-void __quick_sort_loop_aux(RandomAccessIterator first,
- RandomAccessIterator last, T*, Compare comp) {
- while (last - first > __stl_threshold) {
- RandomAccessIterator cut = __unguarded_partition
- (first, last, T(__median(*first, *(first + (last - first)/2),
- *(last - 1), comp)), comp);
- if (cut - first >= last - cut) {
- __quick_sort_loop(cut, last, comp);
- last = cut;
- } else {
- __quick_sort_loop(first, cut, comp);
- first = cut;
- }
- }
-}
-
-template <class RandomAccessIterator, class Compare>
-inline void __quick_sort_loop(RandomAccessIterator first,
- RandomAccessIterator last, Compare comp) {
- __quick_sort_loop_aux(first, last, value_type(first), comp);
-}
-
-template <class RandomAccessIterator, class T>
-void __unguarded_linear_insert(RandomAccessIterator last, T value) {
- RandomAccessIterator next = last;
- --next;
- while (value < *next) {
- *last = *next;
- last = next--;
- }
- *last = value;
-}
-
-template <class RandomAccessIterator, class T, class Compare>
-void __unguarded_linear_insert(RandomAccessIterator last, T value,
- Compare comp) {
- RandomAccessIterator next = last;
- --next;
- while (comp(value , *next)) {
- *last = *next;
- last = next--;
- }
- *last = value;
-}
-
-template <class RandomAccessIterator, class T>
-inline void __linear_insert(RandomAccessIterator first,
- RandomAccessIterator last, T*) {
- T value = *last;
- if (value < *first) {
- copy_backward(first, last, last + 1);
- *first = value;
- } else
- __unguarded_linear_insert(last, value);
-}
-
-template <class RandomAccessIterator, class T, class Compare>
-inline void __linear_insert(RandomAccessIterator first,
- RandomAccessIterator last, T*, Compare comp) {
- T value = *last;
- if (comp(value, *first)) {
- copy_backward(first, last, last + 1);
- *first = value;
- } else
- __unguarded_linear_insert(last, value, comp);
-}
-
-template <class RandomAccessIterator>
-void __insertion_sort(RandomAccessIterator first, RandomAccessIterator last) {
- if (first == last) return;
- for (RandomAccessIterator i = first + 1; i != last; ++i)
- __linear_insert(first, i, value_type(first));
-}
-
-template <class RandomAccessIterator, class Compare>
-void __insertion_sort(RandomAccessIterator first,
- RandomAccessIterator last, Compare comp) {
- if (first == last) return;
- for (RandomAccessIterator i = first + 1; i != last; ++i)
- __linear_insert(first, i, value_type(first), comp);
-}
-
-template <class RandomAccessIterator, class T>
-void __unguarded_insertion_sort_aux(RandomAccessIterator first,
- RandomAccessIterator last, T*) {
- for (RandomAccessIterator i = first; i != last; ++i)
- __unguarded_linear_insert(i, T(*i));
-}
-
-template <class RandomAccessIterator>
-inline void __unguarded_insertion_sort(RandomAccessIterator first,
- RandomAccessIterator last) {
- __unguarded_insertion_sort_aux(first, last, value_type(first));
-}
-
-template <class RandomAccessIterator, class T, class Compare>
-void __unguarded_insertion_sort_aux(RandomAccessIterator first,
- RandomAccessIterator last,
- T*, Compare comp) {
- for (RandomAccessIterator i = first; i != last; ++i)
- __unguarded_linear_insert(i, T(*i), comp);
-}
-
-template <class RandomAccessIterator, class Compare>
-inline void __unguarded_insertion_sort(RandomAccessIterator first,
- RandomAccessIterator last,
- Compare comp) {
- __unguarded_insertion_sort_aux(first, last, value_type(first), comp);
-}
-
-template <class RandomAccessIterator>
-void __final_insertion_sort(RandomAccessIterator first,
- RandomAccessIterator last) {
- if (last - first > __stl_threshold) {
- __insertion_sort(first, first + __stl_threshold);
- __unguarded_insertion_sort(first + __stl_threshold, last);
- } else
- __insertion_sort(first, last);
-}
-
-template <class RandomAccessIterator, class Compare>
-void __final_insertion_sort(RandomAccessIterator first,
- RandomAccessIterator last, Compare comp) {
- if (last - first > __stl_threshold) {
- __insertion_sort(first, first + __stl_threshold, comp);
- __unguarded_insertion_sort(first + __stl_threshold, last, comp);
- } else
- __insertion_sort(first, last, comp);
-}
-
-template <class RandomAccessIterator>
-void sort(RandomAccessIterator first, RandomAccessIterator last) {
- __quick_sort_loop(first, last);
- __final_insertion_sort(first, last);
-}
-
-template <class RandomAccessIterator, class Compare>
-void sort(RandomAccessIterator first, RandomAccessIterator last,
- Compare comp) {
- __quick_sort_loop(first, last, comp);
- __final_insertion_sort(first, last, comp);
-}
-
-template <class RandomAccessIterator>
-void __inplace_stable_sort(RandomAccessIterator first,
- RandomAccessIterator last) {
- if (last - first < 15) {
- __insertion_sort(first, last);
- return;
- }
- RandomAccessIterator middle = first + (last - first) / 2;
- __inplace_stable_sort(first, middle);
- __inplace_stable_sort(middle, last);
- __merge_without_buffer(first, middle, last, middle - first, last - middle);
-}
-
-template <class RandomAccessIterator, class Compare>
-void __inplace_stable_sort(RandomAccessIterator first,
- RandomAccessIterator last, Compare comp) {
- if (last - first < 15) {
- __insertion_sort(first, last, comp);
- return;
- }
- RandomAccessIterator middle = first + (last - first) / 2;
- __inplace_stable_sort(first, middle, comp);
- __inplace_stable_sort(middle, last, comp);
- __merge_without_buffer(first, middle, last, middle - first,
- last - middle, comp);
-}
-
-template <class RandomAccessIterator1, class RandomAccessIterator2,
- class Distance>
-void __merge_sort_loop(RandomAccessIterator1 first,
- RandomAccessIterator1 last,
- RandomAccessIterator2 result, Distance step_size) {
- Distance two_step = 2 * step_size;
-
- while (last - first >= two_step) {
- result = merge(first, first + step_size,
- first + step_size, first + two_step, result);
- first += two_step;
- }
- step_size = min(Distance(last - first), step_size);
-
- merge(first, first + step_size, first + step_size, last, result);
-}
-
-template <class RandomAccessIterator1, class RandomAccessIterator2,
- class Distance, class Compare>
-void __merge_sort_loop(RandomAccessIterator1 first,
- RandomAccessIterator1 last,
- RandomAccessIterator2 result, Distance step_size,
- Compare comp) {
- Distance two_step = 2 * step_size;
-
- while (last - first >= two_step) {
- result = merge(first, first + step_size,
- first + step_size, first + two_step, result, comp);
- first += two_step;
- }
- step_size = min(Distance(last - first), step_size);
-
- merge(first, first + step_size, first + step_size, last, result, comp);
-}
-
-const int __stl_chunk_size = 7;
-
-template <class RandomAccessIterator, class Distance>
-void __chunk_insertion_sort(RandomAccessIterator first,
- RandomAccessIterator last, Distance chunk_size) {
- while (last - first >= chunk_size) {
- __insertion_sort(first, first + chunk_size);
- first += chunk_size;
- }
- __insertion_sort(first, last);
-}
-
-template <class RandomAccessIterator, class Distance, class Compare>
-void __chunk_insertion_sort(RandomAccessIterator first,
- RandomAccessIterator last,
- Distance chunk_size, Compare comp) {
- while (last - first >= chunk_size) {
- __insertion_sort(first, first + chunk_size, comp);
- first += chunk_size;
- }
- __insertion_sort(first, last, comp);
-}
-
-template <class RandomAccessIterator, class Pointer, class Distance, class T>
-void __merge_sort_with_buffer(RandomAccessIterator first,
- RandomAccessIterator last,
- Pointer buffer, Distance*, T*) {
- Distance len = last - first;
- Pointer buffer_last = buffer + len;
-
- Distance step_size = __stl_chunk_size;
- __chunk_insertion_sort(first, last, step_size);
-
- while (step_size < len) {
- __merge_sort_loop(first, last, buffer, step_size);
- step_size *= 2;
- __merge_sort_loop(buffer, buffer_last, first, step_size);
- step_size *= 2;
- }
-}
-
-template <class RandomAccessIterator, class Pointer, class Distance, class T,
- class Compare>
-void __merge_sort_with_buffer(RandomAccessIterator first,
- RandomAccessIterator last, Pointer buffer,
- Distance*, T*, Compare comp) {
- Distance len = last - first;
- Pointer buffer_last = buffer + len;
-
- Distance step_size = __stl_chunk_size;
- __chunk_insertion_sort(first, last, step_size, comp);
-
- while (step_size < len) {
- __merge_sort_loop(first, last, buffer, step_size, comp);
- step_size *= 2;
- __merge_sort_loop(buffer, buffer_last, first, step_size, comp);
- step_size *= 2;
- }
-}
-
-template <class RandomAccessIterator, class Pointer, class Distance, class T>
-void __stable_sort_adaptive(RandomAccessIterator first,
- RandomAccessIterator last, Pointer buffer,
- Distance buffer_size, T*) {
- Distance len = (last - first + 1) / 2;
- RandomAccessIterator middle = first + len;
- if (len > buffer_size) {
- __stable_sort_adaptive(first, middle, buffer, buffer_size, (T*)0);
- __stable_sort_adaptive(middle, last, buffer, buffer_size, (T*)0);
- } else {
- __merge_sort_with_buffer(first, middle, buffer, (Distance*)0, (T*)0);
- __merge_sort_with_buffer(middle, last, buffer, (Distance*)0, (T*)0);
- }
- __merge_adaptive(first, middle, last, Distance(middle - first),
- Distance(last - middle), buffer, buffer_size, (T*)0);
-}
-
-template <class RandomAccessIterator, class Pointer, class Distance, class T,
- class Compare>
-void __stable_sort_adaptive(RandomAccessIterator first,
- RandomAccessIterator last, Pointer buffer,
- Distance buffer_size, T*, Compare comp) {
- Distance len = (last - first + 1) / 2;
- RandomAccessIterator middle = first + len;
- if (len > buffer_size) {
- __stable_sort_adaptive(first, middle, buffer, buffer_size, (T*)0, comp);
- __stable_sort_adaptive(middle, last, buffer, buffer_size, (T*)0, comp);
- } else {
- __merge_sort_with_buffer(first, middle, buffer, (Distance*)0, (T*)0,
- comp);
- __merge_sort_with_buffer(middle, last, buffer, (Distance*)0, (T*)0,
- comp);
- }
- __merge_adaptive(first, middle, last, Distance(middle - first),
- Distance(last - middle), buffer, buffer_size, (T*)0, comp);
-}
-
-template <class RandomAccessIterator, class Pointer, class Distance, class T>
-inline void __stable_sort(RandomAccessIterator first,
- RandomAccessIterator last,
- pair<Pointer, Distance> p, T*) {
- if (p.first == 0) {
- __inplace_stable_sort(first, last);
- return;
- }
- Distance len = min(p.second, last - first);
- copy(first, first + len, raw_storage_iterator<Pointer, T>(p.first));
- __stable_sort_adaptive(first, last, p.first, p.second, (T*)0);
- destroy(p.first, p.first + len);
- return_temporary_buffer(p.first);
-}
-
-template <class RandomAccessIterator, class Pointer, class Distance, class T,
- class Compare>
-inline void __stable_sort(RandomAccessIterator first,
- RandomAccessIterator last,
- pair<Pointer, Distance> p, T*, Compare comp) {
- if (p.first == 0) {
- __inplace_stable_sort(first, last, comp);
- return;
- }
- Distance len = min(p.second, last - first);
- copy(first, first + len, raw_storage_iterator<Pointer, T>(p.first));
- __stable_sort_adaptive(first, last, p.first, p.second, (T*)0, comp);
- destroy(p.first, p.first + len);
- return_temporary_buffer(p.first);
-}
-
-template <class RandomAccessIterator, class T, class Distance>
-inline void __stable_sort_aux(RandomAccessIterator first,
- RandomAccessIterator last, T*, Distance*) {
- __stable_sort(first, last, get_temporary_buffer(Distance(last - first),
- (T*)0), (T*)0);
-}
-
-template <class RandomAccessIterator, class T, class Distance, class Compare>
-inline void __stable_sort_aux(RandomAccessIterator first,
- RandomAccessIterator last, T*, Distance*,
- Compare comp) {
- __stable_sort(first, last, get_temporary_buffer(Distance(last - first),
- (T*)0), (T*)0, comp);
-}
-
-template <class RandomAccessIterator>
-inline void stable_sort(RandomAccessIterator first,
- RandomAccessIterator last) {
- __stable_sort_aux(first, last, value_type(first), distance_type(first));
-}
-
-template <class RandomAccessIterator, class Compare>
-inline void stable_sort(RandomAccessIterator first,
- RandomAccessIterator last, Compare comp) {
- __stable_sort_aux(first, last, value_type(first), distance_type(first),
- comp);
-}
-
-template <class RandomAccessIterator, class T>
-void __partial_sort(RandomAccessIterator first, RandomAccessIterator middle,
- RandomAccessIterator last, T*) {
- make_heap(first, middle);
- for (RandomAccessIterator i = middle; i < last; ++i)
- if (*i < *first)
- __pop_heap(first, middle, i, T(*i), distance_type(first));
- sort_heap(first, middle);
-}
-
-template <class RandomAccessIterator>
-inline void partial_sort(RandomAccessIterator first,
- RandomAccessIterator middle,
- RandomAccessIterator last) {
- __partial_sort(first, middle, last, value_type(first));
-}
-
-template <class RandomAccessIterator, class T, class Compare>
-void __partial_sort(RandomAccessIterator first, RandomAccessIterator middle,
- RandomAccessIterator last, T*, Compare comp) {
- make_heap(first, middle, comp);
- for (RandomAccessIterator i = middle; i < last; ++i)
- if (comp(*i, *first))
- __pop_heap(first, middle, i, T(*i), comp, distance_type(first));
- sort_heap(first, middle, comp);
-}
-
-template <class RandomAccessIterator, class Compare>
-inline void partial_sort(RandomAccessIterator first,
- RandomAccessIterator middle,
- RandomAccessIterator last, Compare comp) {
- __partial_sort(first, middle, last, value_type(first), comp);
-}
-
-template <class InputIterator, class RandomAccessIterator, class Distance,
- class T>
-RandomAccessIterator __partial_sort_copy(InputIterator first,
- InputIterator last,
- RandomAccessIterator result_first,
- RandomAccessIterator result_last,
- Distance*, T*) {
- if (result_first == result_last) return result_last;
- RandomAccessIterator result_real_last = result_first;
- while(first != last && result_real_last != result_last)
- *result_real_last++ = *first++;
- make_heap(result_first, result_real_last);
- while (first != last) {
- if (*first < *result_first)
- __adjust_heap(result_first, Distance(0),
- Distance(result_real_last - result_first), T(*first));
- ++first;
- }
- sort_heap(result_first, result_real_last);
- return result_real_last;
-}
-
-template <class InputIterator, class RandomAccessIterator>
-inline RandomAccessIterator
-partial_sort_copy(InputIterator first, InputIterator last,
- RandomAccessIterator result_first,
- RandomAccessIterator result_last) {
- return __partial_sort_copy(first, last, result_first, result_last,
- distance_type(result_first), value_type(first));
-}
-
-template <class InputIterator, class RandomAccessIterator, class Compare,
- class Distance, class T>
-RandomAccessIterator __partial_sort_copy(InputIterator first,
- InputIterator last,
- RandomAccessIterator result_first,
- RandomAccessIterator result_last,
- Compare comp, Distance*, T*) {
- if (result_first == result_last) return result_last;
- RandomAccessIterator result_real_last = result_first;
- while(first != last && result_real_last != result_last)
- *result_real_last++ = *first++;
- make_heap(result_first, result_real_last, comp);
- while (first != last) {
- if (comp(*first, *result_first))
- __adjust_heap(result_first, Distance(0),
- Distance(result_real_last - result_first), T(*first),
- comp);
- ++first;
- }
- sort_heap(result_first, result_real_last, comp);
- return result_real_last;
-}
-
-template <class InputIterator, class RandomAccessIterator, class Compare>
-inline RandomAccessIterator
-partial_sort_copy(InputIterator first, InputIterator last,
- RandomAccessIterator result_first,
- RandomAccessIterator result_last, Compare comp) {
- return __partial_sort_copy(first, last, result_first, result_last, comp,
- distance_type(result_first), value_type(first));
-}
-
-template <class RandomAccessIterator, class T>
-void __nth_element(RandomAccessIterator first, RandomAccessIterator nth,
- RandomAccessIterator last, T*) {
- while (last - first > 3) {
- RandomAccessIterator cut = __unguarded_partition
- (first, last, T(__median(*first, *(first + (last - first)/2),
- *(last - 1))));
- if (cut <= nth)
- first = cut;
- else
- last = cut;
- }
- __insertion_sort(first, last);
-}
-
-template <class RandomAccessIterator>
-inline void nth_element(RandomAccessIterator first, RandomAccessIterator nth,
- RandomAccessIterator last) {
- __nth_element(first, nth, last, value_type(first));
-}
-
-template <class RandomAccessIterator, class T, class Compare>
-void __nth_element(RandomAccessIterator first, RandomAccessIterator nth,
- RandomAccessIterator last, T*, Compare comp) {
- while (last - first > 3) {
- RandomAccessIterator cut = __unguarded_partition
- (first, last, T(__median(*first, *(first + (last - first)/2),
- *(last - 1), comp)), comp);
- if (cut <= nth)
- first = cut;
- else
- last = cut;
- }
- __insertion_sort(first, last, comp);
-}
-
-template <class RandomAccessIterator, class Compare>
-inline void nth_element(RandomAccessIterator first, RandomAccessIterator nth,
- RandomAccessIterator last, Compare comp) {
- __nth_element(first, nth, last, value_type(first), comp);
-}
-
-template <class ForwardIterator, class T, class Distance>
-ForwardIterator __lower_bound(ForwardIterator first, ForwardIterator last,
- const T& value, Distance*,
- forward_iterator_tag) {
- Distance len = 0;
- distance(first, last, len);
- Distance half;
- ForwardIterator middle;
-
- while (len > 0) {
- half = len / 2;
- middle = first;
- advance(middle, half);
- if (*middle < value) {
- first = middle;
- ++first;
- len = len - half - 1;
- } else
- len = half;
- }
- return first;
-}
-
-template <class ForwardIterator, class T, class Distance>
-inline ForwardIterator __lower_bound(ForwardIterator first,
- ForwardIterator last,
- const T& value, Distance*,
- bidirectional_iterator_tag) {
- return __lower_bound(first, last, value, (Distance*)0,
- forward_iterator_tag());
-}
-
-template <class RandomAccessIterator, class T, class Distance>
-RandomAccessIterator __lower_bound(RandomAccessIterator first,
- RandomAccessIterator last, const T& value,
- Distance*, random_access_iterator_tag) {
- Distance len = last - first;
- Distance half;
- RandomAccessIterator middle;
-
- while (len > 0) {
- half = len / 2;
- middle = first + half;
- if (*middle < value) {
- first = middle + 1;
- len = len - half - 1;
- } else
- len = half;
- }
- return first;
-}
-
-template <class ForwardIterator, class T>
-inline ForwardIterator lower_bound(ForwardIterator first, ForwardIterator last,
- const T& value) {
- return __lower_bound(first, last, value, distance_type(first),
- iterator_category(first));
-}
-
-template <class ForwardIterator, class T, class Compare, class Distance>
-ForwardIterator __lower_bound(ForwardIterator first, ForwardIterator last,
- const T& value, Compare comp, Distance*,
- forward_iterator_tag) {
- Distance len = 0;
- distance(first, last, len);
- Distance half;
- ForwardIterator middle;
-
- while (len > 0) {
- half = len / 2;
- middle = first;
- advance(middle, half);
- if (comp(*middle, value)) {
- first = middle;
- ++first;
- len = len - half - 1;
- } else
- len = half;
- }
- return first;
-}
-
-template <class ForwardIterator, class T, class Compare, class Distance>
-inline ForwardIterator __lower_bound(ForwardIterator first,
- ForwardIterator last,
- const T& value, Compare comp, Distance*,
- bidirectional_iterator_tag) {
- return __lower_bound(first, last, value, comp, (Distance*)0,
- forward_iterator_tag());
-}
-
-template <class RandomAccessIterator, class T, class Compare, class Distance>
-RandomAccessIterator __lower_bound(RandomAccessIterator first,
- RandomAccessIterator last,
- const T& value, Compare comp, Distance*,
- random_access_iterator_tag) {
- Distance len = last - first;
- Distance half;
- RandomAccessIterator middle;
-
- while (len > 0) {
- half = len / 2;
- middle = first + half;
- if (comp(*middle, value)) {
- first = middle + 1;
- len = len - half - 1;
- } else
- len = half;
- }
- return first;
-}
-
-template <class ForwardIterator, class T, class Compare>
-inline ForwardIterator lower_bound(ForwardIterator first, ForwardIterator last,
- const T& value, Compare comp) {
- return __lower_bound(first, last, value, comp, distance_type(first),
- iterator_category(first));
-}
-
-template <class ForwardIterator, class T, class Distance>
-ForwardIterator __upper_bound(ForwardIterator first, ForwardIterator last,
- const T& value, Distance*,
- forward_iterator_tag) {
- Distance len = 0;
- distance(first, last, len);
- Distance half;
- ForwardIterator middle;
-
- while (len > 0) {
- half = len / 2;
- middle = first;
- advance(middle, half);
- if (value < *middle)
- len = half;
- else {
- first = middle;
- ++first;
- len = len - half - 1;
- }
- }
- return first;
-}
-
-template <class ForwardIterator, class T, class Distance>
-inline ForwardIterator __upper_bound(ForwardIterator first,
- ForwardIterator last,
- const T& value, Distance*,
- bidirectional_iterator_tag) {
- return __upper_bound(first, last, value, (Distance*)0,
- forward_iterator_tag());
-}
-
-template <class RandomAccessIterator, class T, class Distance>
-RandomAccessIterator __upper_bound(RandomAccessIterator first,
- RandomAccessIterator last, const T& value,
- Distance*, random_access_iterator_tag) {
- Distance len = last - first;
- Distance half;
- RandomAccessIterator middle;
-
- while (len > 0) {
- half = len / 2;
- middle = first + half;
- if (value < *middle)
- len = half;
- else {
- first = middle + 1;
- len = len - half - 1;
- }
- }
- return first;
-}
-
-template <class ForwardIterator, class T>
-inline ForwardIterator upper_bound(ForwardIterator first, ForwardIterator last,
- const T& value) {
- return __upper_bound(first, last, value, distance_type(first),
- iterator_category(first));
-}
-
-template <class ForwardIterator, class T, class Compare, class Distance>
-ForwardIterator __upper_bound(ForwardIterator first, ForwardIterator last,
- const T& value, Compare comp, Distance*,
- forward_iterator_tag) {
- Distance len = 0;
- distance(first, last, len);
- Distance half;
- ForwardIterator middle;
-
- while (len > 0) {
- half = len / 2;
- middle = first;
- advance(middle, half);
- if (comp(value, *middle))
- len = half;
- else {
- first = middle;
- ++first;
- len = len - half - 1;
- }
- }
- return first;
-}
-
-template <class ForwardIterator, class T, class Compare, class Distance>
-inline ForwardIterator __upper_bound(ForwardIterator first,
- ForwardIterator last,
- const T& value, Compare comp, Distance*,
- bidirectional_iterator_tag) {
- return __upper_bound(first, last, value, comp, (Distance*)0,
- forward_iterator_tag());
-}
-
-template <class RandomAccessIterator, class T, class Compare, class Distance>
-RandomAccessIterator __upper_bound(RandomAccessIterator first,
- RandomAccessIterator last,
- const T& value, Compare comp, Distance*,
- random_access_iterator_tag) {
- Distance len = last - first;
- Distance half;
- RandomAccessIterator middle;
-
- while (len > 0) {
- half = len / 2;
- middle = first + half;
- if (comp(value, *middle))
- len = half;
- else {
- first = middle + 1;
- len = len - half - 1;
- }
- }
- return first;
-}
-
-template <class ForwardIterator, class T, class Compare>
-inline ForwardIterator upper_bound(ForwardIterator first, ForwardIterator last,
- const T& value, Compare comp) {
- return __upper_bound(first, last, value, comp, distance_type(first),
- iterator_category(first));
-}
-
-template <class ForwardIterator, class T, class Distance>
-pair<ForwardIterator, ForwardIterator>
-__equal_range(ForwardIterator first, ForwardIterator last, const T& value,
- Distance*, forward_iterator_tag) {
- Distance len = 0;
- distance(first, last, len);
- Distance half;
- ForwardIterator middle, left, right;
-
- while (len > 0) {
- half = len / 2;
- middle = first;
- advance(middle, half);
- if (*middle < value) {
- first = middle;
- ++first;
- len = len - half - 1;
- } else if (value < *middle)
- len = half;
- else {
- left = lower_bound(first, middle, value);
- advance(first, len);
- right = upper_bound(++middle, first, value);
- return pair<ForwardIterator, ForwardIterator>(left, right);
- }
- }
- return pair<ForwardIterator, ForwardIterator>(first, first);
-}
-
-template <class ForwardIterator, class T, class Distance>
-inline pair<ForwardIterator, ForwardIterator>
-__equal_range(ForwardIterator first, ForwardIterator last, const T& value,
- Distance*, bidirectional_iterator_tag) {
- return __equal_range(first, last, value, (Distance*)0,
- forward_iterator_tag());
-}
-
-template <class RandomAccessIterator, class T, class Distance>
-pair<RandomAccessIterator, RandomAccessIterator>
-__equal_range(RandomAccessIterator first, RandomAccessIterator last,
- const T& value, Distance*, random_access_iterator_tag) {
- Distance len = last - first;
- Distance half;
- RandomAccessIterator middle, left, right;
-
- while (len > 0) {
- half = len / 2;
- middle = first + half;
- if (*middle < value) {
- first = middle + 1;
- len = len - half - 1;
- } else if (value < *middle)
- len = half;
- else {
- left = lower_bound(first, middle, value);
- right = upper_bound(++middle, first + len, value);
- return pair<RandomAccessIterator, RandomAccessIterator>(left,
- right);
- }
- }
- return pair<RandomAccessIterator, RandomAccessIterator>(first, first);
-}
-
-template <class ForwardIterator, class T>
-inline pair<ForwardIterator, ForwardIterator>
-equal_range(ForwardIterator first, ForwardIterator last, const T& value) {
- return __equal_range(first, last, value, distance_type(first),
- iterator_category(first));
-}
-
-template <class ForwardIterator, class T, class Compare, class Distance>
-pair<ForwardIterator, ForwardIterator>
-__equal_range(ForwardIterator first, ForwardIterator last, const T& value,
- Compare comp, Distance*, forward_iterator_tag) {
- Distance len = 0;
- distance(first, last, len);
- Distance half;
- ForwardIterator middle, left, right;
-
- while (len > 0) {
- half = len / 2;
- middle = first;
- advance(middle, half);
- if (comp(*middle, value)) {
- first = middle;
- ++first;
- len = len - half - 1;
- } else if (comp(value, *middle))
- len = half;
- else {
- left = lower_bound(first, middle, value, comp);
- advance(first, len);
- right = upper_bound(++middle, first, value, comp);
- return pair<ForwardIterator, ForwardIterator>(left, right);
- }
- }
- return pair<ForwardIterator, ForwardIterator>(first, first);
-}
-
-template <class ForwardIterator, class T, class Compare, class Distance>
-inline pair<ForwardIterator, ForwardIterator>
-__equal_range(ForwardIterator first, ForwardIterator last, const T& value,
- Compare comp, Distance*, bidirectional_iterator_tag) {
- return __equal_range(first, last, value, comp, (Distance*)0,
- forward_iterator_tag());
-}
-
-template <class RandomAccessIterator, class T, class Compare, class Distance>
-pair<RandomAccessIterator, RandomAccessIterator>
-__equal_range(RandomAccessIterator first, RandomAccessIterator last,
- const T& value, Compare comp, Distance*,
- random_access_iterator_tag) {
- Distance len = last - first;
- Distance half;
- RandomAccessIterator middle, left, right;
-
- while (len > 0) {
- half = len / 2;
- middle = first + half;
- if (comp(*middle, value)) {
- first = middle + 1;
- len = len - half - 1;
- } else if (comp(value, *middle))
- len = half;
- else {
- left = lower_bound(first, middle, value, comp);
- right = upper_bound(++middle, first + len, value, comp);
- return pair<RandomAccessIterator, RandomAccessIterator>(left,
- right);
- }
- }
- return pair<RandomAccessIterator, RandomAccessIterator>(first, first);
-}
-
-template <class ForwardIterator, class T, class Compare>
-inline pair<ForwardIterator, ForwardIterator>
-equal_range(ForwardIterator first, ForwardIterator last, const T& value,
- Compare comp) {
- return __equal_range(first, last, value, comp, distance_type(first),
- iterator_category(first));
-}
-
-template <class ForwardIterator, class T>
-bool binary_search(ForwardIterator first, ForwardIterator last,
- const T& value) {
- ForwardIterator i = lower_bound(first, last, value);
- return i != last && !(value < *i);
-}
-
-template <class ForwardIterator, class T, class Compare>
-bool binary_search(ForwardIterator first, ForwardIterator last, const T& value,
- Compare comp) {
- ForwardIterator i = lower_bound(first, last, value, comp);
- return i != last && !comp(value, *i);
-}
-
-template <class InputIterator1, class InputIterator2, class OutputIterator>
-OutputIterator merge(InputIterator1 first1, InputIterator1 last1,
- InputIterator2 first2, InputIterator2 last2,
- OutputIterator result) {
- while (first1 != last1 && first2 != last2)
- if (*first2 < *first1)
- *result++ = *first2++;
- else
- *result++ = *first1++;
- return copy(first2, last2, copy(first1, last1, result));
-}
-
-template <class InputIterator1, class InputIterator2, class OutputIterator,
- class Compare>
-OutputIterator merge(InputIterator1 first1, InputIterator1 last1,
- InputIterator2 first2, InputIterator2 last2,
- OutputIterator result, Compare comp) {
- while (first1 != last1 && first2 != last2)
- if (comp(*first2, *first1))
- *result++ = *first2++;
- else
- *result++ = *first1++;
- return copy(first2, last2, copy(first1, last1, result));
-}
-
-template <class BidirectionalIterator, class Distance>
-void __merge_without_buffer(BidirectionalIterator first,
- BidirectionalIterator middle,
- BidirectionalIterator last,
- Distance len1, Distance len2) {
- if (len1 == 0 || len2 == 0) return;
- if (len1 + len2 == 2) {
- if (*middle < *first) iter_swap(first, middle);
- return;
- }
- BidirectionalIterator first_cut = first;
- BidirectionalIterator second_cut = middle;
- Distance len11 = 0;
- Distance len22 = 0;
- if (len1 > len2) {
- len11 = len1 / 2;
- advance(first_cut, len11);
- second_cut = lower_bound(middle, last, *first_cut);
- distance(middle, second_cut, len22);
- } else {
- len22 = len2 / 2;
- advance(second_cut, len22);
- first_cut = upper_bound(first, middle, *second_cut);
- distance(first, first_cut, len11);
- }
- rotate(first_cut, middle, second_cut);
- BidirectionalIterator new_middle = first_cut;
- advance(new_middle, len22);
- __merge_without_buffer(first, first_cut, new_middle, len11, len22);
- __merge_without_buffer(new_middle, second_cut, last, len1 - len11,
- len2 - len22);
-}
-
-template <class BidirectionalIterator, class Distance, class Compare>
-void __merge_without_buffer(BidirectionalIterator first,
- BidirectionalIterator middle,
- BidirectionalIterator last,
- Distance len1, Distance len2, Compare comp) {
- if (len1 == 0 || len2 == 0) return;
- if (len1 + len2 == 2) {
- if (comp(*middle, *first)) iter_swap(first, middle);
- return;
- }
- BidirectionalIterator first_cut = first;
- BidirectionalIterator second_cut = middle;
- Distance len11 = 0;
- Distance len22 = 0;
- if (len1 > len2) {
- len11 = len1 / 2;
- advance(first_cut, len11);
- second_cut = lower_bound(middle, last, *first_cut, comp);
- distance(middle, second_cut, len22);
- } else {
- len22 = len2 / 2;
- advance(second_cut, len22);
- first_cut = upper_bound(first, middle, *second_cut, comp);
- distance(first, first_cut, len11);
- }
- rotate(first_cut, middle, second_cut);
- BidirectionalIterator new_middle = first_cut;
- advance(new_middle, len22);
- __merge_without_buffer(first, first_cut, new_middle, len11, len22, comp);
- __merge_without_buffer(new_middle, second_cut, last, len1 - len11,
- len2 - len22, comp);
-}
-
-
-template <class InputIterator, class OutputIterator>
-OutputIterator __borland_bugfix_copy(InputIterator first, InputIterator last,
- OutputIterator result) {
-// this is used in __rotate_adaptive to work around some obscure Borland
-// bug. It is the same as copy, but with a different (and appropriate) name.
- while (first != last) *result++ = *first++;
- return result;
-}
-
-template <class BidirectionalIterator1, class BidirectionalIterator2,
- class Distance>
-BidirectionalIterator1 __rotate_adaptive(BidirectionalIterator1 first,
- BidirectionalIterator1 middle,
- BidirectionalIterator1 last,
- Distance len1, Distance len2,
- BidirectionalIterator2 buffer,
- Distance buffer_size) {
- BidirectionalIterator2 buffer_end;
- if (len1 > len2 && len2 <= buffer_size) {
- buffer_end = __borland_bugfix_copy(middle, last, buffer);
- copy_backward(first, middle, last);
- return copy(buffer, buffer_end, first);
- } else if (len1 <= buffer_size) {
- buffer_end = __borland_bugfix_copy(first, middle, buffer);
- copy(middle, last, first);
- return copy_backward(buffer, buffer_end, last);
- } else {
- rotate(first, middle, last);
- advance(first, len2);
- return first;
- }
-}
-
-template <class BidirectionalIterator1, class BidirectionalIterator2,
- class BidirectionalIterator3>
-BidirectionalIterator3 __merge_backward(BidirectionalIterator1 first1,
- BidirectionalIterator1 last1,
- BidirectionalIterator2 first2,
- BidirectionalIterator2 last2,
- BidirectionalIterator3 result) {
- if (first1 == last1) return copy_backward(first2, last2, result);
- if (first2 == last2) return copy_backward(first1, last1, result);
- --last1;
- --last2;
- while (true) {
- if (*last2 < *last1) {
- *--result = *last1;
- if (first1 == last1) return copy_backward(first2, ++last2, result);
- --last1;
- } else {
- *--result = *last2;
- if (first2 == last2) return copy_backward(first1, ++last1, result);
- --last2;
- }
- }
-}
-
-template <class BidirectionalIterator1, class BidirectionalIterator2,
- class BidirectionalIterator3, class Compare>
-BidirectionalIterator3 __merge_backward(BidirectionalIterator1 first1,
- BidirectionalIterator1 last1,
- BidirectionalIterator2 first2,
- BidirectionalIterator2 last2,
- BidirectionalIterator3 result,
- Compare comp) {
- if (first1 == last1) return copy_backward(first2, last2, result);
- if (first2 == last2) return copy_backward(first1, last1, result);
- --last1;
- --last2;
- while (true) {
- if (comp(*last2, *last1)) {
- *--result = *last1;
- if (first1 == last1) return copy_backward(first2, ++last2, result);
- --last1;
- } else {
- *--result = *last2;
- if (first2 == last2) return copy_backward(first1, ++last1, result);
- --last2;
- }
- }
-}
-
-template <class BidirectionalIterator, class Distance, class Pointer, class T>
-void __merge_adaptive(BidirectionalIterator first,
- BidirectionalIterator middle,
- BidirectionalIterator last, Distance len1, Distance len2,
- Pointer buffer, Distance buffer_size, T*) {
- if (len1 <= len2 && len1 <= buffer_size) {
- Pointer end_buffer = copy(first, middle, buffer);
- merge(buffer, end_buffer, middle, last, first);
- } else if (len2 <= buffer_size) {
- Pointer end_buffer = copy(middle, last, buffer);
- __merge_backward(first, middle, buffer, end_buffer, last);
- } else {
- BidirectionalIterator first_cut = first;
- BidirectionalIterator second_cut = middle;
- Distance len11 = 0;
- Distance len22 = 0;
- if (len1 > len2) {
- len11 = len1 / 2;
- advance(first_cut, len11);
- second_cut = lower_bound(middle, last, *first_cut);
- distance(middle, second_cut, len22);
- } else {
- len22 = len2 / 2;
- advance(second_cut, len22);
- first_cut = upper_bound(first, middle, *second_cut);
- distance(first, first_cut, len11);
- }
- BidirectionalIterator new_middle =
- __rotate_adaptive(first_cut, middle, second_cut, len1 - len11,
- len22, buffer, buffer_size);
- __merge_adaptive(first, first_cut, new_middle, len11, len22, buffer,
- buffer_size, (T*)0);
- __merge_adaptive(new_middle, second_cut, last, len1 - len11,
- len2 - len22, buffer, buffer_size, (T*)0);
- }
-}
-
-template <class BidirectionalIterator, class Distance, class Pointer, class T,
- class Compare>
-void __merge_adaptive(BidirectionalIterator first,
- BidirectionalIterator middle,
- BidirectionalIterator last, Distance len1, Distance len2,
- Pointer buffer, Distance buffer_size, T*, Compare comp) {
- if (len1 <= len2 && len1 <= buffer_size) {
- Pointer end_buffer = copy(first, middle, buffer);
- merge(buffer, end_buffer, middle, last, first, comp);
- } else if (len2 <= buffer_size) {
- Pointer end_buffer = copy(middle, last, buffer);
- __merge_backward(first, middle, buffer, end_buffer, last, comp);
- } else {
- BidirectionalIterator first_cut = first;
- BidirectionalIterator second_cut = middle;
- Distance len11 = 0;
- Distance len22 = 0;
- if (len1 > len2) {
- len11 = len1 / 2;
- advance(first_cut, len11);
- second_cut = lower_bound(middle, last, *first_cut, comp);
- distance(middle, second_cut, len22);
- } else {
- len22 = len2 / 2;
- advance(second_cut, len22);
- first_cut = upper_bound(first, middle, *second_cut, comp);
- distance(first, first_cut, len11);
- }
- BidirectionalIterator new_middle =
- __rotate_adaptive(first_cut, middle, second_cut, len1 - len11,
- len22, buffer, buffer_size);
- __merge_adaptive(first, first_cut, new_middle, len11, len22, buffer,
- buffer_size, (T*)0, comp);
- __merge_adaptive(new_middle, second_cut, last, len1 - len11,
- len2 - len22, buffer, buffer_size, (T*)0, comp);
- }
-}
-
-template <class BidirectionalIterator, class Distance, class Pointer, class T>
-void __inplace_merge(BidirectionalIterator first,
- BidirectionalIterator middle,
- BidirectionalIterator last, Distance len1, Distance len2,
- pair<Pointer, Distance> p, T*) {
- if (p.first == 0) {
- __merge_without_buffer(first, middle, last, len1, len2);
- return;
- }
- Distance len = min(p.second, len1 + len2);
- fill_n(raw_storage_iterator<Pointer, T>(p.first), len, *first);
- __merge_adaptive(first, middle, last, len1, len2, p.first, p.second, (T*)0);
- destroy(p.first, p.first + len);
- return_temporary_buffer(p.first);
-}
-
-template <class BidirectionalIterator, class Distance, class Pointer, class T,
- class Compare>
-void __inplace_merge(BidirectionalIterator first,
- BidirectionalIterator middle,
- BidirectionalIterator last, Distance len1, Distance len2,
- pair<Pointer, Distance> p, T*, Compare comp) {
- if (p.first == 0) {
- __merge_without_buffer(first, middle, last, len1, len2, comp);
- return;
- }
- Distance len = min(p.second, len1 + len2);
- fill_n(raw_storage_iterator<Pointer, T>(p.first), len, *first);
- __merge_adaptive(first, middle, last, len1, len2, p.first, p.second, (T*)0,
- comp);
- destroy(p.first, p.first + len);
- return_temporary_buffer(p.first);
-}
-
-template <class BidirectionalIterator, class T, class Distance>
-inline void __inplace_merge_aux(BidirectionalIterator first,
- BidirectionalIterator middle,
- BidirectionalIterator last, T*, Distance*) {
- Distance len1 = 0;
- distance(first, middle, len1);
- Distance len2 = 0;
- distance(middle, last, len2);
- __inplace_merge(first, middle, last, len1, len2,
- get_temporary_buffer(len1 + len2, (T*)0), (T*)0);
-}
-
-template <class BidirectionalIterator, class T, class Distance, class Compare>
-inline void __inplace_merge_aux(BidirectionalIterator first,
- BidirectionalIterator middle,
- BidirectionalIterator last, T*, Distance*,
- Compare comp) {
- Distance len1 = 0;
- distance(first, middle, len1);
- Distance len2 = 0;
- distance(middle, last, len2);
- __inplace_merge(first, middle, last, len1, len2,
- get_temporary_buffer(len1 + len2, (T*)0), (T*)0,
- comp);
-}
-
-template <class BidirectionalIterator>
-inline void inplace_merge(BidirectionalIterator first,
- BidirectionalIterator middle,
- BidirectionalIterator last) {
- if (first == middle || middle == last) return;
- __inplace_merge_aux(first, middle, last, value_type(first),
- distance_type(first));
-}
-
-template <class BidirectionalIterator, class Compare>
-inline void inplace_merge(BidirectionalIterator first,
- BidirectionalIterator middle,
- BidirectionalIterator last, Compare comp) {
- if (first == middle || middle == last) return;
- __inplace_merge_aux(first, middle, last, value_type(first),
- distance_type(first), comp);
-}
-
-template <class InputIterator1, class InputIterator2>
-bool includes(InputIterator1 first1, InputIterator1 last1,
- InputIterator2 first2, InputIterator2 last2) {
- while (first1 != last1 && first2 != last2)
- if (*first2 < *first1)
- return false;
- else if(*first1 < *first2)
- ++first1;
- else
- ++first1, ++first2;
-
- return first2 == last2;
-}
-
-template <class InputIterator1, class InputIterator2, class Compare>
-bool includes(InputIterator1 first1, InputIterator1 last1,
- InputIterator2 first2, InputIterator2 last2, Compare comp) {
- while (first1 != last1 && first2 != last2)
- if (comp(*first2, *first1))
- return false;
- else if(comp(*first1, *first2))
- ++first1;
- else
- ++first1, ++first2;
-
- return first2 == last2;
-}
-
-template <class InputIterator1, class InputIterator2, class OutputIterator>
-OutputIterator set_union(InputIterator1 first1, InputIterator1 last1,
- InputIterator2 first2, InputIterator2 last2,
- OutputIterator result) {
- while (first1 != last1 && first2 != last2)
- if (*first1 < *first2)
- *result++ = *first1++;
- else if (*first2 < *first1)
- *result++ = *first2++;
- else {
- *result++ = *first1++;
- first2++;
- }
- return copy(first2, last2, copy(first1, last1, result));
-}
-
-template <class InputIterator1, class InputIterator2, class OutputIterator,
- class Compare>
-OutputIterator set_union(InputIterator1 first1, InputIterator1 last1,
- InputIterator2 first2, InputIterator2 last2,
- OutputIterator result, Compare comp) {
- while (first1 != last1 && first2 != last2)
- if (comp(*first1, *first2))
- *result++ = *first1++;
- else if (comp(*first2, *first1))
- *result++ = *first2++;
- else {
- *result++ = *first1++;
- ++first2;
- }
- return copy(first2, last2, copy(first1, last1, result));
-}
-
-template <class InputIterator1, class InputIterator2, class OutputIterator>
-OutputIterator set_intersection(InputIterator1 first1, InputIterator1 last1,
- InputIterator2 first2, InputIterator2 last2,
- OutputIterator result) {
- while (first1 != last1 && first2 != last2)
- if (*first1 < *first2)
- ++first1;
- else if (*first2 < *first1)
- ++first2;
- else {
- *result++ = *first1++;
- ++first2;
- }
- return result;
-}
-
-template <class InputIterator1, class InputIterator2, class OutputIterator,
- class Compare>
-OutputIterator set_intersection(InputIterator1 first1, InputIterator1 last1,
- InputIterator2 first2, InputIterator2 last2,
- OutputIterator result, Compare comp) {
- while (first1 != last1 && first2 != last2)
- if (comp(*first1, *first2))
- ++first1;
- else if (comp(*first2, *first1))
- ++first2;
- else {
- *result++ = *first1++;
- ++first2;
- }
- return result;
-}
-
-template <class InputIterator1, class InputIterator2, class OutputIterator>
-OutputIterator set_difference(InputIterator1 first1, InputIterator1 last1,
- InputIterator2 first2, InputIterator2 last2,
- OutputIterator result) {
- while (first1 != last1 && first2 != last2)
- if (*first1 < *first2)
- *result++ = *first1++;
- else if (*first2 < *first1)
- ++first2;
- else {
- ++first1;
- ++first2;
- }
- return copy(first1, last1, result);
-}
-
-template <class InputIterator1, class InputIterator2, class OutputIterator,
- class Compare>
-OutputIterator set_difference(InputIterator1 first1, InputIterator1 last1,
- InputIterator2 first2, InputIterator2 last2,
- OutputIterator result, Compare comp) {
- while (first1 != last1 && first2 != last2)
- if (comp(*first1, *first2))
- *result++ = *first1++;
- else if (comp(*first2, *first1))
- ++first2;
- else {
- ++first1;
- ++first2;
- }
- return copy(first1, last1, result);
-}
-
-template <class InputIterator1, class InputIterator2, class OutputIterator>
-OutputIterator set_symmetric_difference(InputIterator1 first1,
- InputIterator1 last1,
- InputIterator2 first2,
- InputIterator2 last2,
- OutputIterator result) {
- while (first1 != last1 && first2 != last2)
- if (*first1 < *first2)
- *result++ = *first1++;
- else if (*first2 < *first1)
- *result++ = *first2++;
- else {
- ++first1;
- ++first2;
- }
- return copy(first2, last2, copy(first1, last1, result));
-}
-
-template <class InputIterator1, class InputIterator2, class OutputIterator,
- class Compare>
-OutputIterator set_symmetric_difference(InputIterator1 first1,
- InputIterator1 last1,
- InputIterator2 first2,
- InputIterator2 last2,
- OutputIterator result, Compare comp) {
- while (first1 != last1 && first2 != last2)
- if (comp(*first1, *first2))
- *result++ = *first1++;
- else if (comp(*first2, *first1))
- *result++ = *first2++;
- else {
- ++first1;
- ++first2;
- }
- return copy(first2, last2, copy(first1, last1, result));
-}
-
-template <class ForwardIterator>
-ForwardIterator max_element(ForwardIterator first, ForwardIterator last) {
- if (first == last) return first;
- ForwardIterator result = first;
- while (++first != last)
- if (*result < *first) result = first;
- return result;
-}
-
-template <class ForwardIterator, class Compare>
-ForwardIterator max_element(ForwardIterator first, ForwardIterator last,
- Compare comp) {
- if (first == last) return first;
- ForwardIterator result = first;
- while (++first != last)
- if (comp(*result, *first)) result = first;
- return result;
-}
-
-template <class ForwardIterator>
-ForwardIterator min_element(ForwardIterator first, ForwardIterator last) {
- if (first == last) return first;
- ForwardIterator result = first;
- while (++first != last)
- if (*first < *result) result = first;
- return result;
-}
-
-template <class ForwardIterator, class Compare>
-ForwardIterator min_element(ForwardIterator first, ForwardIterator last,
- Compare comp) {
- if (first == last) return first;
- ForwardIterator result = first;
- while (++first != last)
- if (comp(*first, *result)) result = first;
- return result;
-}
-
-template <class BidirectionalIterator>
-bool next_permutation(BidirectionalIterator first,
- BidirectionalIterator last) {
- if (first == last) return false;
- BidirectionalIterator i = first;
- ++i;
- if (i == last) return false;
- i = last;
- --i;
-
- for(;;) {
- BidirectionalIterator ii = i--;
- if (*i < *ii) {
- BidirectionalIterator j = last;
- while (!(*i < *--j));
- iter_swap(i, j);
- reverse(ii, last);
- return true;
- }
- if (i == first) {
- reverse(first, last);
- return false;
- }
- }
-}
-
-template <class BidirectionalIterator, class Compare>
-bool next_permutation(BidirectionalIterator first, BidirectionalIterator last,
- Compare comp) {
- if (first == last) return false;
- BidirectionalIterator i = first;
- ++i;
- if (i == last) return false;
- i = last;
- --i;
-
- for(;;) {
- BidirectionalIterator ii = i--;
- if (comp(*i, *ii)) {
- BidirectionalIterator j = last;
- while (!comp(*i, *--j));
- iter_swap(i, j);
- reverse(ii, last);
- return true;
- }
- if (i == first) {
- reverse(first, last);
- return false;
- }
- }
-}
-
-template <class BidirectionalIterator>
-bool prev_permutation(BidirectionalIterator first,
- BidirectionalIterator last) {
- if (first == last) return false;
- BidirectionalIterator i = first;
- ++i;
- if (i == last) return false;
- i = last;
- --i;
-
- for(;;) {
- BidirectionalIterator ii = i--;
- if (*ii < *i) {
- BidirectionalIterator j = last;
- while (!(*--j < *i));
- iter_swap(i, j);
- reverse(ii, last);
- return true;
- }
- if (i == first) {
- reverse(first, last);
- return false;
- }
- }
-}
-
-template <class BidirectionalIterator, class Compare>
-bool prev_permutation(BidirectionalIterator first, BidirectionalIterator last,
- Compare comp) {
- if (first == last) return false;
- BidirectionalIterator i = first;
- ++i;
- if (i == last) return false;
- i = last;
- --i;
-
- for(;;) {
- BidirectionalIterator ii = i--;
- if (comp(*ii, *i)) {
- BidirectionalIterator j = last;
- while (!comp(*--j, *i));
- iter_swap(i, j);
- reverse(ii, last);
- return true;
- }
- if (i == first) {
- reverse(first, last);
- return false;
- }
- }
-}
-
-template <class InputIterator, class T>
-T accumulate(InputIterator first, InputIterator last, T init) {
- while (first != last)
- init = init + *first++;
- return init;
-}
-
-template <class InputIterator, class T, class BinaryOperation>
-T accumulate(InputIterator first, InputIterator last, T init,
- BinaryOperation binary_op) {
- while (first != last)
- init = binary_op(init, *first++);
- return init;
-}
-
-template <class InputIterator1, class InputIterator2, class T>
-T inner_product(InputIterator1 first1, InputIterator1 last1,
- InputIterator2 first2, T init) {
- while (first1 != last1)
- init = init + (*first1++ * *first2++);
- return init;
-}
-
-template <class InputIterator1, class InputIterator2, class T,
- class BinaryOperation1, class BinaryOperation2>
-T inner_product(InputIterator1 first1, InputIterator1 last1,
- InputIterator2 first2, T init, BinaryOperation1 binary_op1,
- BinaryOperation2 binary_op2) {
- while (first1 != last1)
- init = binary_op1(init, binary_op2(*first1++, *first2++));
- return init;
-}
-
-template <class InputIterator, class OutputIterator, class T>
-OutputIterator __partial_sum(InputIterator first, InputIterator last,
- OutputIterator result, T*) {
- T value = *first;
- while (++first != last) {
- value = value + *first;
- *++result = value;
- }
- return ++result;
-}
-
-template <class InputIterator, class OutputIterator>
-OutputIterator partial_sum(InputIterator first, InputIterator last,
- OutputIterator result) {
- if (first == last) return result;
- *result = *first;
- return __partial_sum(first, last, result, value_type(first));
-}
-
-template <class InputIterator, class OutputIterator, class T,
- class BinaryOperation>
-OutputIterator __partial_sum(InputIterator first, InputIterator last,
- OutputIterator result, T*,
- BinaryOperation binary_op) {
- T value = *first;
- while (++first != last) {
- value = binary_op(value, *first);
- *++result = value;
- }
- return ++result;
-}
-
-template <class InputIterator, class OutputIterator, class BinaryOperation>
-OutputIterator partial_sum(InputIterator first, InputIterator last,
- OutputIterator result, BinaryOperation binary_op) {
- if (first == last) return result;
- *result = *first;
- return __partial_sum(first, last, result, value_type(first), binary_op);
-}
-
-template <class InputIterator, class OutputIterator, class T>
-OutputIterator __adjacent_difference(InputIterator first, InputIterator last,
- OutputIterator result, T*) {
- T value = *first;
- while (++first != last) {
- T tmp = *first;
- *++result = tmp - value;
- value = tmp;
- }
- return ++result;
-}
-
-template <class InputIterator, class OutputIterator>
-OutputIterator adjacent_difference(InputIterator first, InputIterator last,
- OutputIterator result) {
- if (first == last) return result;
- *result = *first;
- return __adjacent_difference(first, last, result, value_type(first));
-}
-
-template <class InputIterator, class OutputIterator, class T,
- class BinaryOperation>
-OutputIterator __adjacent_difference(InputIterator first, InputIterator last,
- OutputIterator result, T*,
- BinaryOperation binary_op) {
- T value = *first;
- while (++first != last) {
- T tmp = *first;
- *++result = binary_op(tmp, value);
- value = tmp;
- }
- return ++result;
-}
-
-template <class InputIterator, class OutputIterator, class BinaryOperation>
-OutputIterator adjacent_difference(InputIterator first, InputIterator last,
- OutputIterator result,
- BinaryOperation binary_op) {
- if (first == last) return result;
- *result = *first;
- return __adjacent_difference(first, last, result, value_type(first),
- binary_op);
-}
-
-template <class ForwardIterator, class T>
-void iota(ForwardIterator first, ForwardIterator last, T value) {
- while (first != last) *first++ = value++;
-}
-
-#endif
-
diff --git a/contrib/libg++/libstdc++/stl/algobase.h b/contrib/libg++/libstdc++/stl/algobase.h
deleted file mode 100644
index 21cea93b5f88..000000000000
--- a/contrib/libg++/libstdc++/stl/algobase.h
+++ /dev/null
@@ -1,232 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef ALGOBASE_H
-#define ALGOBASE_H
-
-#include <pair.h>
-#include <iterator.h>
-
-template <class ForwardIterator1, class ForwardIterator2, class T>
-inline void __iter_swap(ForwardIterator1 a, ForwardIterator2 b, T*) {
- T tmp = *a;
- *a = *b;
- *b = tmp;
-}
-
-template <class ForwardIterator1, class ForwardIterator2>
-inline void iter_swap(ForwardIterator1 a, ForwardIterator2 b) {
- __iter_swap(a, b, value_type(a));
-}
-
-template <class T>
-inline void swap(T& a, T& b) {
- T tmp = a;
- a = b;
- b = tmp;
-}
-
-template <class T>
-inline const T& min(const T& a, const T& b) {
- return b < a ? b : a;
-}
-
-template <class T, class Compare>
-inline const T& min(const T& a, const T& b, Compare comp) {
- return comp(b, a) ? b : a;
-}
-
-template <class T>
-inline const T& max(const T& a, const T& b) {
- return a < b ? b : a;
-}
-
-template <class T, class Compare>
-inline const T& max(const T& a, const T& b, Compare comp) {
- return comp(a, b) ? b : a;
-}
-
-template <class InputIterator, class Distance>
-void __distance(InputIterator first, InputIterator last, Distance& n,
- input_iterator_tag) {
- while (first != last) { ++first; ++n; }
-}
-
-template <class ForwardIterator, class Distance>
-void __distance(ForwardIterator first, ForwardIterator last, Distance& n,
- forward_iterator_tag) {
- while (first != last) { ++first; ++n; }
-}
-
-template <class BidirectionalIterator, class Distance>
-void __distance(BidirectionalIterator first, BidirectionalIterator last,
- Distance& n, bidirectional_iterator_tag) {
- while (first != last) { ++first; ++n; }
-}
-
-template <class RandomAccessIterator, class Distance>
-inline void __distance(RandomAccessIterator first, RandomAccessIterator last,
- Distance& n, random_access_iterator_tag) {
- n += last - first;
-}
-
-template <class InputIterator, class Distance>
-inline void distance(InputIterator first, InputIterator last, Distance& n) {
- __distance(first, last, n, iterator_category(first));
-}
-
-template <class InputIterator, class Distance>
-void __advance(InputIterator& i, Distance n, input_iterator_tag) {
- while (n--) ++i;
-}
-
-template <class ForwardIterator, class Distance>
-void __advance(ForwardIterator& i, Distance n, forward_iterator_tag) {
- while (n--) ++i;
-}
-
-template <class BidirectionalIterator, class Distance>
-void __advance(BidirectionalIterator& i, Distance n,
- bidirectional_iterator_tag) {
- if (n >= 0)
- while (n--) ++i;
- else
- while (n++) --i;
-}
-
-template <class RandomAccessIterator, class Distance>
-inline void __advance(RandomAccessIterator& i, Distance n,
- random_access_iterator_tag) {
- i += n;
-}
-
-template <class InputIterator, class Distance>
-inline void advance(InputIterator& i, Distance n) {
- __advance(i, n, iterator_category(i));
-}
-
-template <class ForwardIterator>
-void destroy(ForwardIterator first, ForwardIterator last) {
- while (first != last) {
- /* Borland bug */
- destroy(&*first);
- ++first;
- //destroy(&*first++);
- }
-}
-
-template <class InputIterator, class ForwardIterator>
-ForwardIterator uninitialized_copy(InputIterator first, InputIterator last,
- ForwardIterator result) {
- while (first != last) construct(&*result++, *first++);
- return result;
-}
-
-template <class ForwardIterator, class T>
-void uninitialized_fill(ForwardIterator first, ForwardIterator last,
- const T& x) {
- while (first != last) construct(&*first++, x);
-}
-
-template <class ForwardIterator, class Size, class T>
-ForwardIterator uninitialized_fill_n(ForwardIterator first, Size n,
- const T& x) {
- while (n--) construct(&*first++, x);
- return first;
-}
-
-template <class InputIterator, class OutputIterator>
-OutputIterator copy(InputIterator first, InputIterator last,
- OutputIterator result) {
- while (first != last) *result++ = *first++;
- return result;
-}
-
-template <class BidirectionalIterator1, class BidirectionalIterator2>
-BidirectionalIterator2 copy_backward(BidirectionalIterator1 first,
- BidirectionalIterator1 last,
- BidirectionalIterator2 result) {
- while (first != last) *--result = *--last;
- return result;
-}
-
-template <class ForwardIterator, class T>
-void fill(ForwardIterator first, ForwardIterator last, const T& value) {
- while (first != last) *first++ = value;
-}
-
-template <class OutputIterator, class Size, class T>
-OutputIterator fill_n(OutputIterator first, Size n, const T& value) {
- while (n-- > 0) *first++ = value;
- return first;
-}
-
-template <class InputIterator1, class InputIterator2>
-pair<InputIterator1, InputIterator2> mismatch(InputIterator1 first1,
- InputIterator1 last1,
- InputIterator2 first2) {
- while (first1 != last1 && *first1 == *first2) {
- ++first1;
- ++first2;
- }
- return pair<InputIterator1, InputIterator2>(first1, first2);
-}
-
-template <class InputIterator1, class InputIterator2, class BinaryPredicate>
-pair<InputIterator1, InputIterator2> mismatch(InputIterator1 first1,
- InputIterator1 last1,
- InputIterator2 first2,
- BinaryPredicate binary_pred) {
- while (first1 != last1 && binary_pred(*first1, *first2)) {
- ++first1;
- ++first2;
- }
- return pair<InputIterator1, InputIterator2>(first1, first2);
-}
-
-template <class InputIterator1, class InputIterator2>
-inline bool equal(InputIterator1 first1, InputIterator1 last1,
- InputIterator2 first2) {
- return mismatch(first1, last1, first2).first == last1;
-}
-
-template <class InputIterator1, class InputIterator2, class BinaryPredicate>
-inline bool equal(InputIterator1 first1, InputIterator1 last1,
- InputIterator2 first2, BinaryPredicate binary_pred) {
- return mismatch(first1, last1, first2, binary_pred).first == last1;
-}
-
-template <class InputIterator1, class InputIterator2>
-bool lexicographical_compare(InputIterator1 first1, InputIterator1 last1,
- InputIterator2 first2, InputIterator2 last2) {
- while (first1 != last1 && first2 != last2) {
- if (*first1 < *first2) return true;
- if (*first2++ < *first1++) return false;
- }
- return first1 == last1 && first2 != last2;
-}
-
-template <class InputIterator1, class InputIterator2, class Compare>
-bool lexicographical_compare(InputIterator1 first1, InputIterator1 last1,
- InputIterator2 first2, InputIterator2 last2,
- Compare comp) {
- while (first1 != last1 && first2 != last2) {
- if (comp(*first1, *first2)) return true;
- if (comp(*first2++, *first1++)) return false;
- }
- return first1 == last1 && first2 != last2;
-}
-
-#endif
diff --git a/contrib/libg++/libstdc++/stl/bool.h b/contrib/libg++/libstdc++/stl/bool.h
deleted file mode 100644
index 9d86aac99c68..000000000000
--- a/contrib/libg++/libstdc++/stl/bool.h
+++ /dev/null
@@ -1,20 +0,0 @@
-#ifndef __GNUC__
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- */
-
-#define bool int
-#define true 1
-#define false 0
-#endif
diff --git a/contrib/libg++/libstdc++/stl/bvector.h b/contrib/libg++/libstdc++/stl/bvector.h
deleted file mode 100644
index f9fe10655cbc..000000000000
--- a/contrib/libg++/libstdc++/stl/bvector.h
+++ /dev/null
@@ -1,421 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- */
-
-// vector<bool> is replaced by bit_vector at present because bool is not
-// implemented.
-
-#ifndef BVECTOR_H
-#define BVECTOR_H
-
-#include <function.h>
-#include <algobase.h>
-#include <iterator.h>
-#ifndef __GNUG__
-#include <bool.h>
-#endif
-
-#ifndef Allocator
-#define Allocator allocator
-#include <defalloc.h>
-#endif
-
-#define __WORD_BIT (int(CHAR_BIT*sizeof(unsigned int)))
-
-class bit_vector {
-public:
- typedef Allocator<unsigned int> vector_allocator;
- typedef bool value_type;
- typedef vector_allocator::size_type size_type;
- typedef vector_allocator::difference_type difference_type;
-
- class iterator;
- class const_iterator;
-
- class reference {
- friend class iterator;
- friend class const_iterator;
- protected:
- unsigned int* p;
- unsigned int mask;
- reference(unsigned int* x, unsigned int y) : p(x), mask(y) {}
- public:
- reference() : p(0), mask(0) {}
- operator bool() const { return !(!(*p & mask)); }
- reference& operator=(bool x) {
- if (x)
- *p |= mask;
- else
- *p &= ~mask;
- return *this;
- }
- reference& operator=(const reference& x) { return *this = bool(x); }
- bool operator==(const reference& x) const {
- return bool(*this) == bool(x);
- }
- bool operator<(const reference& x) const {
- return bool(*this) < bool(x);
- }
- void flip() { *p ^= mask; }
- };
- typedef bool const_reference;
- class iterator : public random_access_iterator<bool, difference_type> {
- friend class bit_vector;
- friend class const_iterator;
- protected:
- unsigned int* p;
- unsigned int offset;
- void bump_up() {
- if (offset++ == __WORD_BIT - 1) {
- offset = 0;
- ++p;
- }
- }
- void bump_down() {
- if (offset-- == 0) {
- offset = __WORD_BIT - 1;
- --p;
- }
- }
- public:
- iterator() : p(0), offset(0) {}
- iterator(unsigned int* x, unsigned int y) : p(x), offset(y) {}
- reference operator*() const { return reference(p, 1U << offset); }
- iterator& operator++() {
- bump_up();
- return *this;
- }
- iterator operator++(int) {
- iterator tmp = *this;
- bump_up();
- return tmp;
- }
- iterator& operator--() {
- bump_down();
- return *this;
- }
- iterator operator--(int) {
- iterator tmp = *this;
- bump_down();
- return tmp;
- }
- iterator& operator+=(difference_type i) {
- difference_type n = i + offset;
- p += n / __WORD_BIT;
- n = n % __WORD_BIT;
- if (n < 0) {
- offset = n + __WORD_BIT;
- --p;
- } else
- offset = n;
- return *this;
- }
- iterator& operator-=(difference_type i) {
- *this += -i;
- return *this;
- }
- iterator operator+(difference_type i) const {
- iterator tmp = *this;
- return tmp += i;
- }
- iterator operator-(difference_type i) const {
- iterator tmp = *this;
- return tmp -= i;
- }
- difference_type operator-(iterator x) const {
- return __WORD_BIT * (p - x.p) + offset - x.offset;
- }
- reference operator[](difference_type i) { return *(*this + i); }
- bool operator==(const iterator& x) const {
- return p == x.p && offset == x.offset;
- }
- bool operator<(iterator x) const {
- return p < x.p || (p == x.p && offset < x.offset);
- }
- };
-
- class const_iterator
- : public random_access_iterator<bool, difference_type> {
- friend class bit_vector;
- protected:
- unsigned int* p;
- unsigned int offset;
- void bump_up() {
- if (offset++ == __WORD_BIT - 1) {
- offset = 0;
- ++p;
- }
- }
- void bump_down() {
- if (offset-- == 0) {
- offset = __WORD_BIT - 1;
- --p;
- }
- }
- public:
- const_iterator() : p(0), offset(0) {}
- const_iterator(unsigned int* x, unsigned int y) : p(x), offset(y) {}
- const_iterator(const iterator& x) : p(x.p), offset(x.offset) {}
- const_reference operator*() const {
- return reference(p, 1U << offset);
- }
- const_iterator& operator++() {
- bump_up();
- return *this;
- }
- const_iterator operator++(int) {
- const_iterator tmp = *this;
- bump_up();
- return tmp;
- }
- const_iterator& operator--() {
- bump_down();
- return *this;
- }
- const_iterator operator--(int) {
- const_iterator tmp = *this;
- bump_down();
- return tmp;
- }
- const_iterator& operator+=(difference_type i) {
- difference_type n = i + offset;
- p += n / __WORD_BIT;
- n = n % __WORD_BIT;
- if (n < 0) {
- offset = n + __WORD_BIT;
- --p;
- } else
- offset = n;
- return *this;
- }
- const_iterator& operator-=(difference_type i) {
- *this += -i;
- return *this;
- }
- const_iterator operator+(difference_type i) const {
- const_iterator tmp = *this;
- return tmp += i;
- }
- const_iterator operator-(difference_type i) const {
- const_iterator tmp = *this;
- return tmp -= i;
- }
- difference_type operator-(const_iterator x) const {
- return __WORD_BIT * (p - x.p) + offset - x.offset;
- }
- const_reference operator[](difference_type i) {
- return *(*this + i);
- }
- bool operator==(const const_iterator& x) const {
- return p == x.p && offset == x.offset;
- }
- bool operator<(const_iterator x) const {
- return p < x.p || (p == x.p && offset < x.offset);
- }
- };
-
- typedef reverse_iterator<const_iterator, value_type, const_reference,
- difference_type> const_reverse_iterator;
- typedef reverse_iterator<iterator, value_type, reference, difference_type>
- reverse_iterator;
-
-protected:
- static Allocator<unsigned int> static_allocator;
- iterator start;
- iterator finish;
- unsigned int* end_of_storage;
- unsigned int* bit_alloc(size_type n) {
- return static_allocator.allocate((n + __WORD_BIT - 1)/__WORD_BIT);
- }
- void initialize(size_type n) {
- unsigned int* q = bit_alloc(n);
- end_of_storage = q + (n + __WORD_BIT - 1)/__WORD_BIT;
- start = iterator(q, 0);
- finish = start + n;
- }
- void insert_aux(iterator position, bool x);
- typedef bit_vector self;
-public:
- iterator begin() { return start; }
- const_iterator begin() const { return start; }
- iterator end() { return finish; }
- const_iterator end() const { return finish; }
-
- reverse_iterator rbegin() { return reverse_iterator(end()); }
- const_reverse_iterator rbegin() const {
- return const_reverse_iterator(end());
- }
- reverse_iterator rend() { return reverse_iterator(begin()); }
- const_reverse_iterator rend() const {
- return const_reverse_iterator(begin());
- }
-
- size_type size() const { return size_type(end() - begin()); }
- size_type max_size() const { return static_allocator.max_size(); }
- size_type capacity() const {
- return size_type(const_iterator(end_of_storage, 0) - begin());
- }
- bool empty() const { return begin() == end(); }
- reference operator[](size_type n) { return *(begin() + n); }
- const_reference operator[](size_type n) const { return *(begin() + n); }
- bit_vector() : start(iterator()), finish(iterator()), end_of_storage(0) {}
- bit_vector(size_type n, bool value = bool()) {
- initialize(n);
- fill(start.p, end_of_storage, value ? ~0 : 0);
- }
- bit_vector(const self& x) {
- initialize(x.size());
- copy(x.begin(), x.end(), start);
- }
- bit_vector(const_iterator first, const_iterator last) {
- size_type n = 0;
- distance(first, last, n);
- initialize(n);
- copy(first, last, start);
- }
- ~bit_vector() { static_allocator.deallocate(start.p); }
- self& operator=(const self& x) {
- if (&x == this) return *this;
- if (x.size() > capacity()) {
- static_allocator.deallocate(start.p);
- initialize(x.size());
- }
- copy(x.begin(), x.end(), begin());
- finish = begin() + x.size();
- return *this;
- }
- void reserve(size_type n) {
- if (capacity() < n) {
- unsigned int* q = bit_alloc(n);
- finish = copy(begin(), end(), iterator(q, 0));
- static_allocator.deallocate(start.p);
- start = iterator(q, 0);
- end_of_storage = q + (n + __WORD_BIT - 1)/__WORD_BIT;
- }
- }
- reference front() { return *begin(); }
- const_reference front() const { return *begin(); }
- reference back() { return *(end() - 1); }
- const_reference back() const { return *(end() - 1); }
- void push_back(bool x) {
- if (finish.p != end_of_storage)
- *finish++ = x;
- else
- insert_aux(end(), x);
- }
- void swap(bit_vector& x) {
- ::swap(start, x.start);
- ::swap(finish, x.finish);
- ::swap(end_of_storage, x.end_of_storage);
- }
- iterator insert(iterator position, bool x) {
- size_type n = position - begin();
- if (finish.p != end_of_storage && position == end())
- *finish++ = x;
- else
- insert_aux(position, x);
- return begin() + n;
- }
- void insert(iterator position, const_iterator first,
- const_iterator last);
- void insert(iterator position, size_type n, bool x);
- void pop_back() { --finish; }
- void erase(iterator position) {
- if (position + 1 != end())
- copy(position + 1, end(), position);
- --finish;
- }
- void erase(iterator first, iterator last) {
- finish = copy(last, end(), first);
- }
-};
-
-Allocator<unsigned int> bit_vector::static_allocator;
-
-inline bool operator==(const bit_vector& x, const bit_vector& y) {
- return x.size() == y.size() && equal(x.begin(), x.end(), y.begin());
-}
-
-inline bool operator<(const bit_vector& x, const bit_vector& y) {
- return lexicographical_compare(x.begin(), x.end(), y.begin(), y.end());
-}
-
-void swap(bit_vector::reference x, bit_vector::reference y) {
- bool tmp = x;
- x = y;
- y = tmp;
-}
-
-void bit_vector::insert_aux(iterator position, bool x) {
- if (finish.p != end_of_storage) {
- copy_backward(position, finish - 1, finish);
- *position = x;
- ++finish;
- } else {
- size_type len = size() ? 2 * size() : __WORD_BIT;
- unsigned int* q = bit_alloc(len);
- iterator i = copy(begin(), position, iterator(q, 0));
- *i++ = x;
- finish = copy(position, end(), i);
- static_allocator.deallocate(start.p);
- end_of_storage = q + (len + __WORD_BIT - 1)/__WORD_BIT;
- start = iterator(q, 0);
- }
-}
-
-void bit_vector::insert(iterator position, size_type n, bool x) {
- if (n == 0) return;
- if (capacity() - size() >= n) {
- copy_backward(position, end(), finish + n);
- fill(position, position + n, x);
- finish += n;
- } else {
- size_type len = size() + max(size(), n);
- unsigned int* q = bit_alloc(len);
- iterator i = copy(begin(), position, iterator(q, 0));
- fill_n(i, n, x);
- finish = copy(position, end(), i + n);
- static_allocator.deallocate(start.p);
- end_of_storage = q + (n + __WORD_BIT - 1)/__WORD_BIT;
- start = iterator(q, 0);
- }
-}
-
-void bit_vector::insert(iterator position, const_iterator first,
- const_iterator last) {
- if (first == last) return;
- size_type n = 0;
- distance(first, last, n);
- if (capacity() - size() >= n) {
- copy_backward(position, end(), finish + n);
- copy(first, last, position);
- finish += n;
- } else {
- size_type len = size() + max(size(), n);
- unsigned int* q = bit_alloc(len);
- iterator i = copy(begin(), position, iterator(q, 0));
- i = copy(first, last, i);
- finish = copy(position, end(), i);
- static_allocator.deallocate(start.p);
- end_of_storage = q + (len + __WORD_BIT - 1)/__WORD_BIT;
- start = iterator(q, 0);
- }
-}
-
-#undef Allocator
-#undef __WORD_BIT
-
-#endif
-
-
diff --git a/contrib/libg++/libstdc++/stl/configure.in b/contrib/libg++/libstdc++/stl/configure.in
deleted file mode 100644
index d452935df77f..000000000000
--- a/contrib/libg++/libstdc++/stl/configure.in
+++ /dev/null
@@ -1,37 +0,0 @@
-# This file is a shell script fragment that supplies the information
-# necessary for a configure script to process the program in
-# this directory. For more information, look at ../../configure.
-
-configdirs=
-srctrigger=iterator.h
-srcname="Standard Template Library"
-package_makefile_frag=Make.pack
-
-# per-host:
-
-# per-target:
-
-target_makefile_frag=../target-mkfrag
-
-LIBDIR=yes
-TO_TOPDIR=../../
-ALL='stl.list'
-EXTRA_MOSTLYCLEAN=stl.list
-XCXXINCLUDES="-I${srcdir} -I${srcdir}/.. -I${TO_TOPDIR}libio -I${srcdir}/${TO_TOPDIR}libio"
-(. ${srcdir}/${TO_TOPDIR}libio/config.shared) >${package_makefile_frag}
-
-# post-target:
-
-# We need multilib support.
-case ${srcdir} in
-.)
- if [ "${with_target_subdir}" != "." ] ; then
- . ${srcdir}/${with_multisrctop}../../../config-ml.in
- else
- . ${srcdir}/${with_multisrctop}../../config-ml.in
- fi
- ;;
-*)
- . ${srcdir}/../../config-ml.in
- ;;
-esac
diff --git a/contrib/libg++/libstdc++/stl/defalloc.h b/contrib/libg++/libstdc++/stl/defalloc.h
deleted file mode 100644
index 388e58fd7444..000000000000
--- a/contrib/libg++/libstdc++/stl/defalloc.h
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef DEFALLOC_H
-#define DEFALLOC_H
-
-#include <new.h>
-#include <stddef.h>
-#include <stdlib.h>
-#include <limits.h>
-#include <iostream.h>
-#include <algobase.h>
-
-#ifndef __GNUG__
-inline void* operator new(size_t, void* p) {return p;}
-#endif
-
-/*
- * the following template function is replaced by the following two functions
- * due to the fact that the Borland compiler doesn't change prediff_t type
- * to type long when compile with -ml or -mh.
-
-template <class T>
-inline T* allocate(ptrdiff_t size, T*) {
- set_new_handler(0);
- T* tmp = (T*)(::operator new((size_t)(size * sizeof(T))));
- if (tmp == 0) {
- cerr << "out of memory" << endl;
- exit(1);
- }
- return tmp;
-}
-*/
-
-template <class T>
-inline T* allocate(int size, T*) {
- set_new_handler(0);
- T* tmp = (T*)(::operator new((unsigned int)(size * sizeof(T))));
- if (tmp == 0) {
- cerr << "out of memory" << endl;
- exit(1);
- }
- return tmp;
-}
-
-template <class T>
-inline T* allocate(long size, T*) {
- set_new_handler(0);
- T* tmp = (T*)(::operator new((unsigned long)(size * sizeof(T))));
- if (tmp == 0) {
- cerr << "out of memory" << endl;
- exit(1);
- }
- return tmp;
-}
-
-template <class T>
-inline void deallocate(T* buffer) {
- ::operator delete(buffer);
-}
-
-template <class T>
-inline void destroy(T* pointer) {
- pointer->~T();
-}
-
-inline void destroy(char*) {}
-inline void destroy(unsigned char*) {}
-inline void destroy(short*) {}
-inline void destroy(unsigned short*) {}
-inline void destroy(int*) {}
-inline void destroy(unsigned int*) {}
-inline void destroy(long*) {}
-inline void destroy(unsigned long*) {}
-inline void destroy(float*) {}
-inline void destroy(double*) {}
-inline void destroy(char**) {}
-inline void destroy(unsigned char**) {}
-inline void destroy(short**) {}
-inline void destroy(unsigned short**) {}
-inline void destroy(int**) {}
-inline void destroy(unsigned int**) {}
-inline void destroy(long**) {}
-inline void destroy(unsigned long**) {}
-inline void destroy(float**) {}
-inline void destroy(double**) {}
-
-inline void destroy(char*, char*) {}
-inline void destroy(unsigned char*, unsigned char*) {}
-inline void destroy(short*, short*) {}
-inline void destroy(unsigned short*, unsigned short*) {}
-inline void destroy(int*, int*) {}
-inline void destroy(unsigned int*, unsigned int*) {}
-inline void destroy(long*, long*) {}
-inline void destroy(unsigned long*, unsigned long*) {}
-inline void destroy(float*, float*) {}
-inline void destroy(double*, double*) {}
-inline void destroy(char**, char**) {}
-inline void destroy(unsigned char**, unsigned char**) {}
-inline void destroy(short**, short**) {}
-inline void destroy(unsigned short**, unsigned short**) {}
-inline void destroy(int**, int**) {}
-inline void destroy(unsigned int**, unsigned int**) {}
-inline void destroy(long**, long**) {}
-inline void destroy(unsigned long**, unsigned long**) {}
-inline void destroy(float**, float**) {}
-inline void destroy(double**, double**) {}
-
-template <class T1, class T2>
-inline void construct(T1* p, const T2& value) {
- new (p) T1(value);
-}
-
-template <class T>
-class allocator {
-public:
- typedef T value_type;
- typedef T* pointer;
- typedef const T* const_pointer;
- typedef T& reference;
- typedef const T& const_reference;
- typedef size_t size_type;
- typedef ptrdiff_t difference_type;
-#ifdef __GNUG__
- static pointer allocate(size_type n) {
- return ::allocate((difference_type)n, (pointer)0);
- }
- static void deallocate(pointer p) { ::deallocate(p); }
- static pointer address(reference x) { return (pointer)&x; }
- static const_pointer const_address(const_reference x) {
- return (const_pointer)&x;
- }
- static size_type init_page_size() {
- return max(size_type(1), size_type(4096/sizeof(T)));
- }
- static size_type max_size() {
- return max(size_type(1), size_type(UINT_MAX/sizeof(T)));
- }
-#else
- pointer allocate(size_type n) {
- return ::allocate((difference_type)n, (pointer)0);
- }
- void deallocate(pointer p) { ::deallocate(p); }
- pointer address(reference x) { return (pointer)&x; }
- const_pointer const_address(const_reference x) {
- return (const_pointer)&x;
- }
- size_type init_page_size() {
- return max(size_type(1), size_type(4096/sizeof(T)));
- }
- size_type max_size() const {
- return max(size_type(1), size_type(UINT_MAX/sizeof(T)));
- }
-#endif
-};
-
-class allocator<void> {
-public:
- typedef void* pointer;
-};
-
-
-
-#endif
diff --git a/contrib/libg++/libstdc++/stl/deque.h b/contrib/libg++/libstdc++/stl/deque.h
deleted file mode 100644
index dc790142b54d..000000000000
--- a/contrib/libg++/libstdc++/stl/deque.h
+++ /dev/null
@@ -1,684 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef DEQUE_H
-#define DEQUE_H
-
-#include <function.h>
-#include <algobase.h>
-#include <iterator.h>
-#ifndef __GNUG__
-#include <bool.h>
-#endif
-
-#ifndef Allocator
-#define Allocator allocator
-#include <defalloc.h>
-#endif
-
-#ifndef deque
-#define deque deque
-#endif
-
-template <class T>
-class deque {
-public:
- class iterator;
- class const_iterator;
- friend class iterator;
- friend class const_iterator;
-public:
- typedef T value_type;
- typedef Allocator<T> data_allocator_type;
- typedef Allocator<T>::pointer pointer;
- typedef Allocator<T>::reference reference;
- typedef Allocator<T>::const_reference const_reference;
- typedef Allocator<T>::size_type size_type;
- typedef Allocator<T>::difference_type difference_type;
- typedef Allocator<pointer> map_allocator_type;
-protected:
- static data_allocator_type data_allocator;
-#ifdef __GNUG__
- // static // Too bad -- I don't like this hack very much...
- static size_type buffer_size() {
- return data_allocator.init_page_size();
- }
-#define __dq_buffer_size buffer_size()
-#else
- static size_type buffer_size;
-#define __dq_buffer_size buffer_size
-#endif
- static map_allocator_type map_allocator;
- typedef Allocator<pointer>::pointer map_pointer;
-public:
- class iterator : public random_access_iterator<T, difference_type> {
- friend class deque<T>;
- friend class const_iterator;
- protected:
- pointer current;
- pointer first;
- pointer last;
- map_pointer node;
- iterator(pointer x, map_pointer y)
- : current(x), first(*y), last(*y + __dq_buffer_size), node(y) {}
- public:
- iterator() : current(0), first(0), last(0), node(0) {}
- reference operator*() const { return *current; }
- difference_type operator-(const iterator& x) const {
- return node == x.node
- ? current - x.current
- : difference_type(__dq_buffer_size * (node - x.node - 1) +
- (current - first) + (x.last - x.current));
- }
- iterator& operator++() {
- if (++current == last) {
- first = *(++node);
- current = first;
- last = first + __dq_buffer_size;
- }
- return *this;
- }
- iterator operator++(int) {
- iterator tmp = *this;
- ++*this;
- return tmp;
- }
- iterator& operator--() {
- if (current == first) {
- first = *(--node);
- last = first + __dq_buffer_size;
- current = last;
- }
- --current;
- return *this;
- }
- iterator operator--(int) {
- iterator tmp = *this;
- --*this;
- return tmp;
- }
- iterator& operator+=(difference_type n) {
- difference_type offset = n + (current - first);
- difference_type num_node_to_jump = offset >= 0
- ? offset / __dq_buffer_size
- : -((-offset + __dq_buffer_size - 1) / __dq_buffer_size);
- if (num_node_to_jump == 0)
- current += n;
- else {
- node = node + num_node_to_jump;
- first = *node;
- last = first + __dq_buffer_size;
- current = first + (offset - num_node_to_jump * __dq_buffer_size);
- }
- return *this;
- }
- iterator& operator-=(difference_type n) { return *this += -n; }
- iterator operator+(difference_type n) const {
- iterator tmp = *this;
- return tmp += n;
- }
- iterator operator-(difference_type n) const {
- iterator tmp = *this;
- return tmp -= n;
- }
- reference operator[](difference_type n) { return *(*this + n); }
- bool operator==(const iterator& x) const {
- return current == x.current ||
- ((current == first || x.current == x.first) &&
- *this - x == 0);
- }
- bool operator<(const iterator& x) const {
- return (node == x.node) ? (current < x.current) : (node < x.node);
- }
- };
- class const_iterator : public random_access_iterator<T, difference_type> {
- friend class deque<T>;
- protected:
- pointer current;
- pointer first;
- pointer last;
- map_pointer node;
- const_iterator(pointer x, map_pointer y)
- : current(x), first(*y), last(*y + __dq_buffer_size), node(y) {}
- public:
- const_iterator() : current(0), first(0), last(0), node(0) {}
- const_iterator(const iterator& x)
- : current(x.current), first(x.first), last(x.last), node(x.node) {}
- const_reference operator*() const { return *current; }
- difference_type operator-(const const_iterator& x) const {
- return node == x.node
- ? current - x.current
- : difference_type(__dq_buffer_size * (node - x.node - 1) +
- (current - first) + (x.last - x.current));
- }
- const_iterator& operator++() {
- if (++current == last) {
- first = *(++node);
- current = first;
- last = first + __dq_buffer_size;
- }
- return *this;
- }
- const_iterator operator++(int) {
- const_iterator tmp = *this;
- ++*this;
- return tmp;
- }
- const_iterator& operator--() {
- if (current == first) {
- first = *(--node);
- last = first + __dq_buffer_size;
- current = last;
- }
- --current;
- return *this;
- }
- const_iterator operator--(int) {
- const_iterator tmp = *this;
- --*this;
- return tmp;
- }
- const_iterator& operator+=(difference_type n) {
- difference_type offset = n + (current - first);
- difference_type num_node_to_jump = offset >= 0
- ? offset / __dq_buffer_size
- : -((-offset + __dq_buffer_size - 1) / __dq_buffer_size);
- if (num_node_to_jump == 0)
- current += n;
- else {
- node = node + num_node_to_jump;
- first = *node;
- last = first + __dq_buffer_size;
- current = first + (offset - num_node_to_jump * __dq_buffer_size);
- }
- return *this;
- }
- const_iterator& operator-=(difference_type n) { return *this += -n; }
- const_iterator operator+(difference_type n) const {
- const_iterator tmp = *this;
- return tmp += n;
- }
- const_iterator operator-(difference_type n) const {
- const_iterator tmp = *this;
- return tmp -= n;
- }
- const_reference operator[](difference_type n) {
- return *(*this + n);
- }
- bool operator==(const const_iterator& x) const {
- return current == x.current ||
- ((current == first || x.current == x.first) &&
- *this - x == 0);
- }
- bool operator<(const const_iterator& x) const {
- return (node == x.node) ? (current < x.current) : (node < x.node);
- }
- };
- typedef reverse_iterator<const_iterator, value_type, const_reference,
- difference_type> const_reverse_iterator;
- typedef reverse_iterator<iterator, value_type, reference, difference_type>
- reverse_iterator;
-protected:
- iterator start;
- iterator finish;
- size_type length;
- map_pointer map;
- size_type map_size;
-
- void allocate_at_begin();
- void allocate_at_end();
- void deallocate_at_begin();
- void deallocate_at_end();
-
-public:
- deque() : start(), finish(), length(0), map(0), map_size(0) {
-#ifndef __GNUG__
- __dq_buffer_size = data_allocator.init_page_size();
-#endif
- }
- iterator begin() { return start; }
- const_iterator begin() const { return start; }
- iterator end() { return finish; }
- const_iterator end() const { return finish; }
- reverse_iterator rbegin() { return reverse_iterator(end()); }
- const_reverse_iterator rbegin() const {
- return const_reverse_iterator(end());
- }
- reverse_iterator rend() { return reverse_iterator(begin()); }
- const_reverse_iterator rend() const {
- return const_reverse_iterator(begin());
- }
- bool empty() const { return length == 0; }
- size_type size() const { return length; }
- size_type max_size() const { return data_allocator.max_size(); }
- reference operator[](size_type n) { return *(begin() + n); }
- const_reference operator[](size_type n) const { return *(begin() + n); }
- reference front() { return *begin(); }
- const_reference front() const { return *begin(); }
- reference back() { return *(end() - 1); }
- const_reference back() const { return *(end() - 1); }
- void push_front(const T& x) {
- if (empty() || begin().current == begin().first)
- allocate_at_begin();
- --start.current;
- construct(start.current, x);
- ++length;
- if (end().current == end().last) allocate_at_end();
- }
- void push_back(const T& x) {
- if (empty()) allocate_at_end();
- construct(finish.current, x);
- ++finish.current;
- ++length;
- if (end().current == end().last) allocate_at_end();
- }
- void pop_front() {
- destroy(start.current);
- ++start.current;
- --length;
- if (empty() || begin().current == begin().last)
- deallocate_at_begin();
- }
- void pop_back() {
- if (end().current == end().first) deallocate_at_end();
- --finish.current;
- destroy(finish.current);
- --length;
- if (empty()) deallocate_at_end();
- }
- void swap(deque<T>& x) {
- ::swap(start, x.start);
- ::swap(finish, x.finish);
- ::swap(length, x.length);
- ::swap(map, x.map);
- ::swap(map_size, x.map_size);
- }
-#ifdef __GNUG__
- iterator insert(iterator position, const T& x) {
- return insert(deque_iterator<T>(position), x);
- }
- deque_iterator<T> insert(deque_iterator<T> position, const T& x);
- void insert(iterator position, size_type n, const T& x) {
- insert(deque_iterator<T>(position), n, x);
- }
- void insert(deque_iterator<T>(position), size_type n, const T& x);
-// template <class Iterator> void insert(iterator position,
-// Iterator first, Iterator last);
- void insert(iterator position, const T* first, const T* last) {
- insert(deque_iterator<T>(position), first, last);
- }
- void insert(deque_iterator<T> position, const T* first, const T* last);
- void erase(iterator position) {
- erase(deque_iterator<T>(position));
- }
- void erase(deque_iterator<T> position);
- void erase(iterator first, iterator last) {
- erase(deque_iterator<T>(first), deque_iterator<T>(last));
- }
- void erase(deque_iterator<T> first, deque_iterator<T> last);
-#else
- iterator insert(iterator position, const T& x);
- void insert(iterator position, size_type n, const T& x);
-// template <class Iterator> void insert(iterator position,
-// Iterator first, Iterator last);
- void insert(iterator position, const T* first, const T* last);
- void erase(iterator position);
- void erase(iterator first, iterator last);
-#endif
- deque(size_type n, const T& value = T())
- : start(), finish(), length(0), map(0), map_size(0) {
-#ifndef __GNUG__
- __dq_buffer_size = data_allocator.init_page_size();
-#endif
- insert(begin(), n, value);
- }
-// template <class Iterator> deque(Iterator first, Iterator last);
- deque(const T* first, const T* last)
- : start(), finish(), length(0), map(0), map_size(0) {
-#ifndef __GNUG__
- __dq_buffer_size = data_allocator.init_page_size();
-#endif
- copy(first, last, back_inserter(*this));
- }
- deque(const deque<T>& x)
- : start(), finish(), length(0), map(0), map_size(0) {
-#ifndef __GNUG__
- __dq_buffer_size = data_allocator.init_page_size();
-#endif
- copy(x.begin(), x.end(), back_inserter(*this));
- }
- deque<T>& operator=(const deque<T>& x) {
- if (this != &x)
- if (size() >= x.size())
- erase(copy(x.begin(), x.end(), begin()), end());
- else
- copy(x.begin() + size(), x.end(),
- inserter(*this, copy(x.begin(), x.begin() + size(),
- begin())));
- return *this;
- }
- ~deque();
-#ifdef __GNUG__
- friend T* value_type(const iterator&) {
- return (T*)(0);
- }
- friend inline difference_type* distance_type(const iterator&) {
- return (difference_type*)(0);
- }
-#endif
-};
-
-#ifdef __GNUG__
-template <class T>
-struct deque_iterator: deque<T>::iterator {
- deque_iterator(deque<T>::iterator i) : deque<T>::iterator(i) {}
-};
-
-template <class T>
-inline T* value_type(const deque_iterator<T>&) {
- return (T*)(0);
-}
-#else
-template <class T>
-deque<T>::data_allocator_type deque<T>::data_allocator;
-
-template <class T>
-deque<T>::map_allocator_type deque<T>::map_allocator;
-
-template <class T>
-deque<T>::size_type deque<T>::__dq_buffer_size = 0;
-// should be data_allocator.init_page_size(); // Borland bug
-#endif
-
-template <class T>
-bool operator==(const deque<T>& x, const deque<T>& y) {
- return x.size() == y.size() && equal(x.begin(), x.end(), y.begin());
-}
-
-template <class T>
-bool operator<(const deque<T>& x, const deque<T>& y) {
- return lexicographical_compare(x.begin(), x.end(), y.begin(), y.end());
-}
-
-template <class T>
-deque<T>::~deque() { while (!empty()) pop_front(); }
-
-template <class T>
-void deque<T>::allocate_at_begin() {
- pointer p = data_allocator.allocate(__dq_buffer_size);
- if (!empty()) {
- if (start.node == map) {
- difference_type i = finish.node - start.node;
- map_size = (i + 1) * 2;
-#ifdef __GNU_G__
- map_pointer tmp = map_allocator_type::allocate(map_size);
- copy(start.node, finish.node + 1, tmp + map_size / 4 + 1);
- map_allocator_type::deallocate(map);
-#else
- map_pointer tmp = map_allocator.allocate(map_size);
- copy(start.node, finish.node + 1, tmp + map_size / 4 + 1);
- map_allocator.deallocate(map);
-#endif
- map = tmp;
- map[map_size / 4] = p;
- start = iterator(p + __dq_buffer_size, map + map_size / 4);
- finish = iterator(finish.current, map + map_size / 4 + i + 1);
- } else {
-#ifdef __GNUG__
- map_size = map_allocator_type::init_page_size();
- map = map_allocator_type::allocate(map_size);
-#else
- *--start.node = p;
- start = iterator(p + __dq_buffer_size, start.node);
-#endif
- }
- } else {
-#ifdef __GNUG__
- map_size = map_allocator_type::init_page_size();
- map = map_allocator_type::allocate(map_size);
-#else
- map_size = map_allocator.init_page_size();
- map = map_allocator.allocate(map_size);
-#endif
- map[map_size / 2] = p;
- start = iterator(p + __dq_buffer_size / 2 + 1, map + map_size / 2);
- finish = start;
- }
-}
-
-template <class T>
-void deque<T>::allocate_at_end() {
- pointer p = data_allocator.allocate(__dq_buffer_size);
- if (!empty()) {
- if (finish.node == map + map_size - 1) {
- difference_type i = finish.node - start.node;
- map_size = (i + 1) * 2;
-#ifdef __GNUG__
- map_pointer tmp = map_allocator_type::allocate(map_size);
- copy(start.node, finish.node + 1, tmp + map_size / 4);
- map_allocator_type::deallocate(map);
-#else
- map_pointer tmp = map_allocator.allocate(map_size);
- copy(start.node, finish.node + 1, tmp + map_size / 4);
- map_allocator.deallocate(map);
-#endif
- map = tmp;
- map[map_size / 4 + i + 1] = p;
- start = iterator(start.current, map + map_size / 4);
- finish = iterator(p, map + map_size / 4 + i + 1);
- } else {
- *++finish.node = p;
- finish = iterator(p, finish.node);
- }
- } else {
-#ifdef __GNUG__
- map_size = map_allocator_type::init_page_size();
- map = map_allocator_type::allocate(map_size);
-#else
- map_size = map_allocator.init_page_size();
- map = map_allocator.allocate(map_size);
-#endif
- map[map_size / 2] = p;
- start = iterator(p + __dq_buffer_size / 2, map + map_size / 2);
- finish = start;
- }
-}
-
-template <class T>
-void deque<T>::deallocate_at_begin() {
- data_allocator.deallocate(*start.node++);
- if (empty()) {
- if (finish.current == finish.first)
- data_allocator.deallocate(*start.node);
- start = iterator();
- finish = start;
-#ifdef __GNUG__
- map_allocator.deallocate(map);
-#else
- map_allocator.deallocate(map);
-#endif
- } else
- start = iterator(*start.node, start.node);
-}
-
-template <class T>
-void deque<T>::deallocate_at_end() {
- data_allocator.deallocate(*finish.node--);
- if (empty()) {
- start = iterator();
- finish = start;
-#ifdef __GNUG__
- map_allocator.deallocate(map);
-#else
- map_allocator.deallocate(map);
-#endif
- } else
- finish = iterator(*finish.node + __dq_buffer_size, finish.node);
-}
-
-template <class T>
-#ifdef __GNUG__
-deque_iterator<T>
-deque<T>::insert(deque_iterator<T> posn, const T& x) {
- iterator position = posn;
-#else
-deque<T>::iterator deque<T>::insert(iterator position, const T& x) {
-#endif
- if (position == begin()) {
- push_front(x);
- return begin();
- } else if (position == end()) {
- push_back(x);
- return end() - 1;
- } else {
- difference_type index = position - begin();
- if (index < length) {
- push_front(*begin());
- copy(begin() + 2, begin() + index + 1, begin() + 1);
- } else {
- push_back(*(end() - 1));
- copy_backward(begin() + index, end() - 2, end() - 1);
- }
- *(begin() + index) = x;
- return begin() + index;
- }
-}
-
-template <class T>
-#ifdef __GNUG__
-void deque<T>::insert(deque_iterator<T> posn,
- size_t n, // BAD HACK
- const T& x) {
- iterator position = posn;
-#else
-void deque<T>::insert(iterator position, size_type n, const T& x) {
-#endif
- difference_type index = position - begin();
- difference_type remainder = length - index;
- if (remainder > index) {
- if (n > index) {
- difference_type m = n - index;
- while (m-- > 0) push_front(x);
- difference_type i = index;
- while (i--) push_front(*(begin() + n - 1));
- fill(begin() + n, begin() + n + index, x);
- } else {
- difference_type i = n;
- while (i--) push_front(*(begin() + n - 1));
- copy(begin() + n + n, begin() + n + index, begin() + n);
- fill(begin() + index, begin() + n + index, x);
- }
- } else {
- difference_type orig_len = index + remainder;
- if (n > remainder) {
- difference_type m = n - remainder;
- while (m-- > 0) push_back(x);
- difference_type i = 0;
- while (i < remainder) push_back(*(begin() + index + i++));
- fill(begin() + index, begin() + orig_len, x);
- } else {
- difference_type i = 0;
- while (i < n) push_back(*(begin() + orig_len - n + i++));
- copy_backward(begin() + index, begin() + orig_len - n,
- begin() + orig_len);
- fill(begin() + index, begin() + index + n, x);
- }
- }
-}
-
-template <class T>
-void deque<T>::insert
-#ifdef __GNUG__
-(deque_iterator<T> posn, const T* first, const T* last)
-{
- iterator position = posn;
-#else
-(iterator position, const T* first, const T* last)
-{
-#endif
- difference_type index = position - begin();
- difference_type remainder = length - index;
- size_type n = 0;
- distance(first, last, n);
- if (remainder > index) {
- if (n > index) {
- const T* m = last - index;
- while (m != first) push_front(*--m);
- difference_type i = index;
- while (i--) push_front(*(begin() + n - 1));
- copy(last - index, last, begin() + n);
- } else {
- difference_type i = n;
- while (i--) push_front(*(begin() + n - 1));
- copy(begin() + n + n, begin() + n + index, begin() + n);
- copy(first, last, begin() + index);
- }
- } else {
- difference_type orig_len = index + remainder;
- if (n > remainder) {
- const T* m = first + remainder;
- while (m != last) push_back(*m++);
- difference_type i = 0;
- while (i < remainder) push_back(*(begin() + index + i++));
- copy(first, first + remainder, begin() + index);
- } else {
- difference_type i = 0;
- while (i < n) push_back(*(begin() + orig_len - n + i++));
- copy_backward(begin() + index, begin() + orig_len - n,
- begin() + orig_len);
- copy(first, last, begin() + index);
- }
- }
-}
-
-template <class T>
-#ifdef __GNUG__
-void deque<T>::erase(deque_iterator<T> posn) {
- iterator position = posn;
-#else
-void deque<T>::erase(iterator position) {
-#endif
- if (end() - position > position - begin()) {
- copy_backward(begin(), position, position + 1);
- pop_front();
- } else {
- copy(position + 1, end(), position);
- pop_back();
- }
-}
-
-template <class T>
-#ifdef __GNUG__
-void deque<T>::erase(deque_iterator<T> fi, deque_iterator<T> la) {
- iterator first = fi;
- iterator last = la;
- difference_type n = last - first;
-#else
-void deque<T>::erase(iterator first, iterator last) {
- difference_type n = last - first;
-#endif
- if (end() - last > first - begin()) {
- copy_backward(begin(), first, last);
- while(n-- > 0) pop_front();
- } else {
- copy(last, end(), first);
- while(n-- > 0) pop_back();
- }
-}
-
-#undef Allocator
-#undef deque
-
-#endif
diff --git a/contrib/libg++/libstdc++/stl/faralloc.h b/contrib/libg++/libstdc++/stl/faralloc.h
deleted file mode 100644
index b29602cc6327..000000000000
--- a/contrib/libg++/libstdc++/stl/faralloc.h
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef FARALLOC_H
-#define FARALLOC_H
-
-#include <new.h>
-#include <stddef.h>
-#include <stdlib.h>
-#include <limits.h>
-#include <iostream.h>
-#include <algobase.h>
-
-template <class T>
-inline random_access_iterator_tag iterator_category(const T __far *) {
- return random_access_iterator_tag();
-}
-
-template <class T>
-inline T* value_type(const T __far *) { return (T*)(0); }
-
-template <class T>
-inline long* distance_type(const T __far*) { return (long*)(0); }
-
-inline void destroy(char __far *) {}
-inline void destroy(unsigned char __far *) {}
-inline void destroy(short __far *) {}
-inline void destroy(unsigned short __far *) {}
-inline void destroy(int __far *) {}
-inline void destroy(unsigned int __far *) {}
-inline void destroy(long __far *) {}
-inline void destroy(unsigned long __far *) {}
-inline void destroy(float __far *) {}
-inline void destroy(double __far *) {}
-
-inline void destroy(char __far *, char __far *) {}
-inline void destroy(unsigned char __far *, unsigned char __far *) {}
-inline void destroy(short __far *, short __far *) {}
-inline void destroy(unsigned short __far *, unsigned short __far *) {}
-inline void destroy(int __far *, int __far *) {}
-inline void destroy(unsigned int __far *, unsigned int __far *) {}
-inline void destroy(long __far *, long __far *) {}
-inline void destroy(unsigned long __far *, unsigned long __far *) {}
-inline void destroy(float __far *, float __far *) {}
-inline void destroy(double __far *, double __far *) {}
-
-inline void __far * operator new(size_t, void __far *p) { return p; }
-
-template <class T>
-inline T __far * allocate(long size, T __far * p) {
- set_new_handler(0);
- T __far * tmp =
- (T __far *)(::operator new((unsigned long)(size * sizeof(T))));
- if (tmp == 0) {
- cerr << "out of memory" << endl;
- exit(1);
- }
- return tmp;
-}
-
-template <class T>
-inline void deallocate(T __far * buffer) {
- ::operator delete(buffer);
-}
-
-template <class T1, class T2>
-inline void construct( T1 __far *p, const T2& value )
-{
- new(p)T1(value);
-}
-
-template <class T>
-inline void destroy( T __far * pointer ) {
- pointer->~T();
-}
-
-template <class T>
-class far_allocator {
-public:
- typedef T value_type;
- typedef T __far * pointer;
- typedef const T __far * const_pointer;
- typedef T __far & reference;
- typedef const T __far & const_reference;
- typedef unsigned long size_type;
- typedef long difference_type;
- pointer allocate(size_type n) {
- return ::allocate((difference_type)n, (pointer)0);
- }
- void deallocate(pointer p) { ::deallocate(p); }
- pointer address(reference x) { return (pointer)&x; }
- const_pointer const_address(const_reference x) {
- return (const_pointer)&x;
- }
- size_type init_page_size() {
- return max(size_type(1), size_type(4096/sizeof(T)));
- }
- size_type max_size() const {
- return max(size_type(1), size_type(ULONG_MAX/sizeof(T)));
- }
-};
-
-class far_allocator<void> {
-public:
- typedef void __far * pointer;
-};
-
-#endif
diff --git a/contrib/libg++/libstdc++/stl/fdeque.h b/contrib/libg++/libstdc++/stl/fdeque.h
deleted file mode 100644
index 7b512b62dc2a..000000000000
--- a/contrib/libg++/libstdc++/stl/fdeque.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef FDEQUE_H
-#define FDEQUE_H
-
-#ifdef DEQUE_H
-#undef DEQUE_H
-#define __DEQUE_WAS_DEFINED
-#endif
-
-#define Allocator far_allocator
-#define deque far_deque
-#include <faralloc.h>
-#include <deque.h>
-
-#undef DEQUE_H
-
-#ifdef __DEQUE_WAS_DEFINED
-#define DEQUE_H
-#undef __DEQUE_WAS_DEFINED
-#endif
-
-#undef Allocator
-#undef deque
-
-#endif
diff --git a/contrib/libg++/libstdc++/stl/flist.h b/contrib/libg++/libstdc++/stl/flist.h
deleted file mode 100644
index 35fe9bf6288f..000000000000
--- a/contrib/libg++/libstdc++/stl/flist.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef FLIST_H
-#define FLIST_H
-
-#ifdef LIST_H
-#undef LIST_H
-#define __LIST_WAS_DEFINED
-#endif
-
-#define Allocator far_allocator
-#define list far_list
-#include <faralloc.h>
-#include <list.h>
-
-#undef LIST_H
-
-#ifdef __LIST_WAS_DEFINED
-#define LIST_H
-#undef __LIST_WAS_DEFINED
-#endif
-
-#undef Allocator
-#undef list
-
-#endif
diff --git a/contrib/libg++/libstdc++/stl/fmap.h b/contrib/libg++/libstdc++/stl/fmap.h
deleted file mode 100644
index 65aa2091fc20..000000000000
--- a/contrib/libg++/libstdc++/stl/fmap.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef FMAP_H
-#define FMAP_H
-
-#ifdef MAP_H
-#undef MAP_H
-#undef TREE_H
-#define __MAP_WAS_DEFINED
-#endif
-
-#define Allocator far_allocator
-#define map far_map
-#define rb_tree far_rb_tree
-#include <faralloc.h>
-#include <map.h>
-
-#undef MAP_H
-#undef TREE_H
-
-#ifdef __MAP_WAS_DEFINED
-#define MAP_H
-#define TREE_H
-#undef __MAP_WAS_DEFINED
-#endif
-
-#undef Allocator
-#undef map
-#undef rb_tree
-
-#endif
diff --git a/contrib/libg++/libstdc++/stl/fmultmap.h b/contrib/libg++/libstdc++/stl/fmultmap.h
deleted file mode 100644
index ecb5cd4fdeff..000000000000
--- a/contrib/libg++/libstdc++/stl/fmultmap.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef FMULTIMAP_H
-#define FMULTIMAP_H
-
-#ifdef MULTIMAP_H
-#undef MULTIMAP_H
-#undef TREE_H
-#define __MULTIMAP_WAS_DEFINED
-#endif
-
-#define Allocator far_allocator
-#define multimap far_multimap
-#define rb_tree far_rb_tree
-#include <faralloc.h>
-#include <multimap.h>
-
-#undef MULTIMAP_H
-#undef TREE_H
-
-#ifdef __MULTIMAP_WAS_DEFINED
-#define MULTIMAP_H
-#define TREE_H
-#undef __MULTIMAP_WAS_DEFINED
-#endif
-
-#undef Allocator
-#undef multimap
-#undef rb_tree
-
-#endif
diff --git a/contrib/libg++/libstdc++/stl/fmultset.h b/contrib/libg++/libstdc++/stl/fmultset.h
deleted file mode 100644
index ca9887646ce7..000000000000
--- a/contrib/libg++/libstdc++/stl/fmultset.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef FMULTISET_H
-#define FMULTISET_H
-
-#ifdef MULTISET_H
-#undef MULTISET_H
-#undef TREE_H
-#define __MULTISET_WAS_DEFINED
-#endif
-
-#define Allocator far_allocator
-#define multiset far_multiset
-#define rb_tree far_rb_tree
-#include <faralloc.h>
-#include <multiset.h>
-
-#undef MULTISET_H
-#undef TREE_H
-
-#ifdef __MULTISET_WAS_DEFINED
-#define MULTISET_H
-#define TREE_H
-#undef __MULTISET_WAS_DEFINED
-#endif
-
-#undef Allocator
-#undef multiset
-#undef rb_tree
-
-#endif
diff --git a/contrib/libg++/libstdc++/stl/fset.h b/contrib/libg++/libstdc++/stl/fset.h
deleted file mode 100644
index b374bc435a6c..000000000000
--- a/contrib/libg++/libstdc++/stl/fset.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef FSET_H
-#define FSET_H
-
-#ifdef SET_H
-#undef SET_H
-#undef TREE_H
-#define __SET_WAS_DEFINED
-#endif
-
-#define Allocator far_allocator
-#define set far_set
-#define rb_tree far_rb_tree
-#include <faralloc.h>
-#include <set.h>
-
-#undef SET_H
-#undef TREE_H
-
-#ifdef __SET_WAS_DEFINED
-#define SET_H
-#define TREE_H
-#undef __SET_WAS_DEFINED
-#endif
-
-#undef Allocator
-#undef set
-#undef rb_tree
-
-#endif
diff --git a/contrib/libg++/libstdc++/stl/function.h b/contrib/libg++/libstdc++/stl/function.h
deleted file mode 100644
index 46fe55569bbd..000000000000
--- a/contrib/libg++/libstdc++/stl/function.h
+++ /dev/null
@@ -1,282 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef FUNCTION_H
-#define FUNCTION_H
-
-#ifndef __GNUG__
-#include <bool.h>
-#endif
-
-template <class T1, class T2>
-inline bool operator!=(const T1& x, const T2& y) {
- return !(x == y);
-}
-
-template <class T1, class T2>
-inline bool operator>(const T1& x, const T2& y) {
- return y < x;
-}
-
-template <class T1, class T2>
-inline bool operator<=(const T1& x, const T2& y) {
- return !(y < x);
-}
-
-template <class T1, class T2>
-inline bool operator>=(const T1& x, const T2& y) {
- return !(x < y);
-}
-
-template <class Arg, class Result>
-struct unary_function {
- typedef Arg argument_type;
- typedef Result result_type;
-};
-
-template <class Arg1, class Arg2, class Result>
-struct binary_function {
- typedef Arg1 first_argument_type;
- typedef Arg2 second_argument_type;
- typedef Result result_type;
-};
-
-template <class T>
-struct plus : binary_function<T, T, T> {
- T operator()(const T& x, const T& y) const { return x + y; }
-};
-
-template <class T>
-struct minus : binary_function<T, T, T> {
- T operator()(const T& x, const T& y) const { return x - y; }
-};
-
-template <class T>
-struct times : binary_function<T, T, T> {
- T operator()(const T& x, const T& y) const { return x * y; }
-};
-
-template <class T>
-struct divides : binary_function<T, T, T> {
- T operator()(const T& x, const T& y) const { return x / y; }
-};
-
-template <class T>
-#ifdef __GNU__
-struct modulus {
- typedef T first_argument_type;
- typedef T second_argument_type;
- typedef T result_type;
- T operator()(const T& x, const T& y) const { return x % y; }
-};
-#else
-struct modulus : binary_function<T, T, T> {
- T operator()(const T& x, const T& y) const { return x % y; }
-};
-#endif
-
-template <class T>
-struct negate : unary_function<T, T> {
- T operator()(const T& x) const { return -x; }
-};
-
-template <class T>
-struct equal_to : binary_function<T, T, bool> {
- bool operator()(const T& x, const T& y) const { return x == y; }
-};
-
-template <class T>
-struct not_equal_to : binary_function<T, T, bool> {
- bool operator()(const T& x, const T& y) const { return x != y; }
-};
-
-template <class T>
-struct greater : binary_function<T, T, bool> {
- bool operator()(const T& x, const T& y) const { return x > y; }
-};
-
-template <class T>
-struct less : binary_function<T, T, bool> {
- bool operator()(const T& x, const T& y) const { return x < y; }
-};
-
-template <class T>
-struct greater_equal : binary_function<T, T, bool> {
- bool operator()(const T& x, const T& y) const { return x >= y; }
-};
-
-template <class T>
-struct less_equal : binary_function<T, T, bool> {
- bool operator()(const T& x, const T& y) const { return x <= y; }
-};
-
-template <class T>
-struct logical_and : binary_function<T, T, bool> {
- bool operator()(const T& x, const T& y) const { return x && y; }
-};
-
-template <class T>
-struct logical_or : binary_function<T, T, bool> {
- bool operator()(const T& x, const T& y) const { return x || y; }
-};
-
-template <class T>
-struct logical_not : unary_function<T, bool> {
- bool operator()(const T& x) const { return !x; }
-};
-
-template <class Predicate>
-class unary_negate : public unary_function<Predicate::argument_type, bool> {
-protected:
- Predicate pred;
-public:
- unary_negate(const Predicate& x) : pred(x) {}
- bool operator()(const argument_type& x) const { return !pred(x); }
-};
-
-template <class Predicate>
-unary_negate<Predicate> not1(const Predicate& pred) {
- return unary_negate<Predicate>(pred);
-}
-
-template <class Predicate>
-class binary_negate
- : public binary_function<Predicate::first_argument_type,
- Predicate::second_argument_type, bool> {
-protected:
- Predicate pred;
-public:
- binary_negate(const Predicate& x) : pred(x) {}
- bool operator()(const first_argument_type& x,
- const second_argument_type& y) const {
- return !pred(x, y);
- }
-};
-
-template <class Predicate>
-binary_negate<Predicate> not2(const Predicate& pred) {
- return binary_negate<Predicate>(pred);
-}
-
-template <class Operation>
-class binder1st : public unary_function<Operation::second_argument_type,
- Operation::result_type> {
-protected:
- Operation op;
- Operation::first_argument_type value;
-public:
- binder1st(const Operation& x, const Operation::first_argument_type& y)
- : op(x), value(y) {}
- result_type operator()(const argument_type& x) const {
- return op(value, x);
- }
-};
-
-template <class Operation, class T>
-binder1st<Operation> bind1st(const Operation& op, const T& x) {
- return binder1st<Operation>(op, Operation::first_argument_type(x));
-}
-
-template <class Operation>
-class binder2nd : public unary_function<Operation::first_argument_type,
- Operation::result_type> {
-protected:
- Operation op;
- Operation::second_argument_type value;
-public:
- binder2nd(const Operation& x, const Operation::second_argument_type& y)
- : op(x), value(y) {}
- result_type operator()(const argument_type& x) const {
- return op(x, value);
- }
-};
-
-template <class Operation, class T>
-binder2nd<Operation> bind2nd(const Operation& op, const T& x) {
- return binder2nd<Operation>(op, Operation::second_argument_type(x));
-}
-
-template <class Operation1, class Operation2>
-class unary_compose : public unary_function<Operation2::argument_type,
- Operation1::result_type> {
-protected:
- Operation1 op1;
- Operation2 op2;
-public:
- unary_compose(const Operation1& x, const Operation2& y) : op1(x), op2(y) {}
- result_type operator()(const argument_type& x) const {
- return op1(op2(x));
- }
-};
-
-template <class Operation1, class Operation2>
-unary_compose<Operation1, Operation2> compose1(const Operation1& op1,
- const Operation2& op2) {
- return unary_compose<Operation1, Operation2>(op1, op2);
-}
-
-template <class Operation1, class Operation2, class Operation3>
-class binary_compose : public unary_function<Operation2::argument_type,
- Operation1::result_type> {
-protected:
- Operation1 op1;
- Operation2 op2;
- Operation3 op3;
-public:
- binary_compose(const Operation1& x, const Operation2& y,
- const Operation3& z) : op1(x), op2(y), op3(z) { }
- result_type operator()(const argument_type& x) const {
- return op1(op2(x), op3(x));
- }
-};
-
-template <class Operation1, class Operation2, class Operation3>
-binary_compose<Operation1, Operation2, Operation3>
-compose2(const Operation1& op1, const Operation2& op2, const Operation3& op3) {
- return binary_compose<Operation1, Operation2, Operation3>(op1, op2, op3);
-}
-
-template <class Arg, class Result>
-class pointer_to_unary_function : public unary_function<Arg, Result> {
-protected:
- Result (*ptr)(Arg);
-public:
- pointer_to_unary_function() {}
- pointer_to_unary_function(Result (*x)(Arg)) : ptr(x) {}
- Result operator()(Arg x) const { return ptr(x); }
-};
-
-template <class Arg, class Result>
-pointer_to_unary_function<Arg, Result> ptr_fun(Result (*x)(Arg)) {
- return pointer_to_unary_function<Arg, Result>(x);
-}
-
-template <class Arg1, class Arg2, class Result>
-class pointer_to_binary_function : public binary_function<Arg1, Arg2, Result> {
-protected:
- Result (*ptr)(Arg1, Arg2);
-public:
- pointer_to_binary_function() {}
- pointer_to_binary_function(Result (*x)(Arg1, Arg2)) : ptr(x) {}
- Result operator()(Arg1 x, Arg2 y) const { return ptr(x, y); }
-};
-
-template <class Arg1, class Arg2, class Result>
-pointer_to_binary_function<Arg1, Arg2, Result>
-ptr_fun(Result (*x)(Arg1, Arg2)) {
- return pointer_to_binary_function<Arg1, Arg2, Result>(x);
-}
-
-#endif
diff --git a/contrib/libg++/libstdc++/stl/hdeque.h b/contrib/libg++/libstdc++/stl/hdeque.h
deleted file mode 100644
index 0d47098a06c4..000000000000
--- a/contrib/libg++/libstdc++/stl/hdeque.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef HDEQUE_H
-#define HDEQUE_H
-
-#ifdef DEQUE_H
-#undef DEQUE_H
-#define __DEQUE_WAS_DEFINED
-#endif
-
-#define Allocator huge_allocator
-#define deque huge_deque
-#include <hugalloc.h>
-#include <deque.h>
-
-#undef DEQUE_H
-
-#ifdef __DEQUE_WAS_DEFINED
-#define DEQUE_H
-#undef __DEQUE_WAS_DEFINED
-#endif
-
-#undef Allocator
-#undef deque
-
-#endif
diff --git a/contrib/libg++/libstdc++/stl/heap.h b/contrib/libg++/libstdc++/stl/heap.h
deleted file mode 100644
index 7f2747fc5b91..000000000000
--- a/contrib/libg++/libstdc++/stl/heap.h
+++ /dev/null
@@ -1,193 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef HEAP_H
-#define HEAP_H
-
-template <class RandomAccessIterator, class Distance, class T>
-void __push_heap(RandomAccessIterator first, Distance holeIndex,
- Distance topIndex, T value) {
- Distance parent = (holeIndex - 1) / 2;
- while (holeIndex > topIndex && *(first + parent) < value) {
- *(first + holeIndex) = *(first + parent);
- holeIndex = parent;
- parent = (holeIndex - 1) / 2;
- }
- *(first + holeIndex) = value;
-}
-
-template <class RandomAccessIterator, class T>
-inline void __push_heap_aux(RandomAccessIterator first,
- RandomAccessIterator last, T*) {
- __push_heap(first, (last - first) - 1, 0, T(*(last - 1)));
-}
-
-template <class RandomAccessIterator>
-inline void push_heap(RandomAccessIterator first, RandomAccessIterator last) {
- __push_heap_aux(first, last, value_type(first));
-}
-
-template <class RandomAccessIterator, class Distance, class T, class Compare>
-void __push_heap(RandomAccessIterator first, Distance holeIndex,
- Distance topIndex, T value, Compare comp) {
- Distance parent = (holeIndex - 1) / 2;
- while (holeIndex > topIndex && comp(*(first + parent), value)) {
- *(first + holeIndex) = *(first + parent);
- holeIndex = parent;
- parent = (holeIndex - 1) / 2;
- }
- *(first + holeIndex) = value;
-}
-
-template <class RandomAccessIterator, class Compare, class T>
-inline void __push_heap_aux(RandomAccessIterator first,
- RandomAccessIterator last, Compare comp, T*) {
- __push_heap(first, (last - first) - 1, 0, T(*(last - 1)), comp);
-}
-
-template <class RandomAccessIterator, class Compare>
-inline void push_heap(RandomAccessIterator first, RandomAccessIterator last,
- Compare comp) {
- __push_heap_aux(first, last, comp, value_type(first));
-}
-
-template <class RandomAccessIterator, class Distance, class T>
-void __adjust_heap(RandomAccessIterator first, Distance holeIndex,
- Distance len, T value) {
- Distance topIndex = holeIndex;
- Distance secondChild = 2 * holeIndex + 2;
- while (secondChild < len) {
- if (*(first + secondChild) < *(first + (secondChild - 1)))
- secondChild--;
- *(first + holeIndex) = *(first + secondChild);
- holeIndex = secondChild;
- secondChild = 2 * (secondChild + 1);
- }
- if (secondChild == len) {
- *(first + holeIndex) = *(first + (secondChild - 1));
- holeIndex = secondChild - 1;
- }
- __push_heap(first, holeIndex, topIndex, value);
-}
-
-template <class RandomAccessIterator, class T, class Distance>
-inline void __pop_heap(RandomAccessIterator first, RandomAccessIterator last,
- RandomAccessIterator result, T value, Distance*) {
- *result = *first;
- __adjust_heap(first, Distance(0), Distance(last - first), value);
-}
-
-template <class RandomAccessIterator, class T>
-inline void __pop_heap_aux(RandomAccessIterator first,
- RandomAccessIterator last, T*) {
- __pop_heap(first, last - 1, last - 1, T(*(last - 1)), distance_type(first));
-}
-
-template <class RandomAccessIterator>
-inline void pop_heap(RandomAccessIterator first, RandomAccessIterator last) {
- __pop_heap_aux(first, last, value_type(first));
-}
-
-template <class RandomAccessIterator, class Distance, class T, class Compare>
-void __adjust_heap(RandomAccessIterator first, Distance holeIndex,
- Distance len, T value, Compare comp) {
- Distance topIndex = holeIndex;
- Distance secondChild = 2 * holeIndex + 2;
- while (secondChild < len) {
- if (comp(*(first + secondChild), *(first + (secondChild - 1))))
- secondChild--;
- *(first + holeIndex) = *(first + secondChild);
- holeIndex = secondChild;
- secondChild = 2 * (secondChild + 1);
- }
- if (secondChild == len) {
- *(first + holeIndex) = *(first + (secondChild - 1));
- holeIndex = secondChild - 1;
- }
- __push_heap(first, holeIndex, topIndex, value, comp);
-}
-
-template <class RandomAccessIterator, class T, class Compare, class Distance>
-inline void __pop_heap(RandomAccessIterator first, RandomAccessIterator last,
- RandomAccessIterator result, T value, Compare comp,
- Distance*) {
- *result = *first;
- __adjust_heap(first, Distance(0), Distance(last - first), value, comp);
-}
-
-template <class RandomAccessIterator, class T, class Compare>
-inline void __pop_heap_aux(RandomAccessIterator first,
- RandomAccessIterator last, T*, Compare comp) {
- __pop_heap(first, last - 1, last - 1, T(*(last - 1)), comp,
- distance_type(first));
-}
-
-template <class RandomAccessIterator, class Compare>
-inline void pop_heap(RandomAccessIterator first, RandomAccessIterator last,
- Compare comp) {
- __pop_heap_aux(first, last, value_type(first), comp);
-}
-
-template <class RandomAccessIterator, class T, class Distance>
-void __make_heap(RandomAccessIterator first, RandomAccessIterator last, T*,
- Distance*) {
- if (last - first < 2) return;
- Distance len = last - first;
- Distance parent = (len - 2)/2;
-
- while (true) {
- __adjust_heap(first, parent, len, T(*(first + parent)));
- if (parent == 0) return;
- parent--;
- }
-}
-
-template <class RandomAccessIterator>
-inline void make_heap(RandomAccessIterator first, RandomAccessIterator last) {
- __make_heap(first, last, value_type(first), distance_type(first));
-}
-
-template <class RandomAccessIterator, class Compare, class T, class Distance>
-void __make_heap(RandomAccessIterator first, RandomAccessIterator last,
- Compare comp, T*, Distance*) {
- if (last - first < 2) return;
- Distance len = last - first;
- Distance parent = (len - 2)/2;
-
- while (true) {
- __adjust_heap(first, parent, len, T(*(first + parent)), comp);
- if (parent == 0) return;
- parent--;
- }
-}
-
-template <class RandomAccessIterator, class Compare>
-inline void make_heap(RandomAccessIterator first, RandomAccessIterator last,
- Compare comp) {
- __make_heap(first, last, comp, value_type(first), distance_type(first));
-}
-
-template <class RandomAccessIterator>
-void sort_heap(RandomAccessIterator first, RandomAccessIterator last) {
- while (last - first > 1) pop_heap(first, last--);
-}
-
-template <class RandomAccessIterator, class Compare>
-void sort_heap(RandomAccessIterator first, RandomAccessIterator last,
- Compare comp) {
- while (last - first > 1) pop_heap(first, last--, comp);
-}
-
-#endif
diff --git a/contrib/libg++/libstdc++/stl/hlist.h b/contrib/libg++/libstdc++/stl/hlist.h
deleted file mode 100644
index 543ffa7a77ee..000000000000
--- a/contrib/libg++/libstdc++/stl/hlist.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef HLIST_H
-#define HLIST_H
-
-#ifdef LIST_H
-#undef LIST_H
-#define __LIST_WAS_DEFINED
-#endif
-
-#define Allocator huge_allocator
-#define list huge_list
-#include <hugalloc.h>
-#include <list.h>
-
-#undef LIST_H
-
-#ifdef __LIST_WAS_DEFINED
-#define LIST_H
-#undef __LIST_WAS_DEFINED
-#endif
-
-#undef Allocator
-#undef list
-
-#endif
diff --git a/contrib/libg++/libstdc++/stl/hmap.h b/contrib/libg++/libstdc++/stl/hmap.h
deleted file mode 100644
index f40abc042ada..000000000000
--- a/contrib/libg++/libstdc++/stl/hmap.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef HMAP_H
-#define HMAP_H
-
-#ifdef MAP_H
-#undef MAP_H
-#undef TREE_H
-#define __MAP_WAS_DEFINED
-#endif
-
-#define Allocator huge_allocator
-#define map huge_map
-#define rb_tree huge_rb_tree
-#include <hugalloc.h>
-#include <map.h>
-
-#undef MAP_H
-#undef TREE_H
-
-#ifdef __MAP_WAS_DEFINED
-#define MAP_H
-#define TREE_H
-#undef __MAP_WAS_DEFINED
-#endif
-
-#undef Allocator
-#undef map
-#undef rb_tree
-
-#endif
diff --git a/contrib/libg++/libstdc++/stl/hmultmap.h b/contrib/libg++/libstdc++/stl/hmultmap.h
deleted file mode 100644
index 0a8551e9ec53..000000000000
--- a/contrib/libg++/libstdc++/stl/hmultmap.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef HMULTIMAP_H
-#define HMULTIMAP_H
-
-#ifdef MULTIMAP_H
-#undef MULTIMAP_H
-#undef TREE_H
-#define __MULTIMAP_WAS_DEFINED
-#endif
-
-#define Allocator huge_allocator
-#define multimap huge_multimap
-#define rb_tree huge_rb_tree
-#include <hugalloc.h>
-#include <multimap.h>
-
-#undef MULTIMAP_H
-#undef TREE_H
-
-#ifdef __MULTIMAP_WAS_DEFINED
-#define MULTIMAP_H
-#define TREE_H
-#undef __MULTIMAP_WAS_DEFINED
-#endif
-
-#undef Allocator
-#undef multimap
-#undef rb_tree
-
-#endif
diff --git a/contrib/libg++/libstdc++/stl/hmultset.h b/contrib/libg++/libstdc++/stl/hmultset.h
deleted file mode 100644
index e207299603fb..000000000000
--- a/contrib/libg++/libstdc++/stl/hmultset.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef HMULTISET_H
-#define HMULTISET_H
-
-#ifdef MULTISET_H
-#undef MULTISET_H
-#undef TREE_H
-#define __MULTISET_WAS_DEFINED
-#endif
-
-#define Allocator huge_allocator
-#define multiset huge_multiset
-#define rb_tree huge_rb_tree
-#include <hugalloc.h>
-#include <multiset.h>
-
-#undef MULTISET_H
-#undef TREE_H
-
-#ifdef __MULTISET_WAS_DEFINED
-#define MULTISET_H
-#define TREE_H
-#undef __MULTISET_WAS_DEFINED
-#endif
-
-#undef Allocator
-#undef multiset
-#undef rb_tree
-
-#endif
diff --git a/contrib/libg++/libstdc++/stl/hset.h b/contrib/libg++/libstdc++/stl/hset.h
deleted file mode 100644
index 11a157632168..000000000000
--- a/contrib/libg++/libstdc++/stl/hset.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef HSET_H
-#define HSET_H
-
-#ifdef SET_H
-#undef SET_H
-#undef TREE_H
-#define __SET_WAS_DEFINED
-#endif
-
-#define Allocator huge_allocator
-#define set huge_set
-#define rb_tree huge_rb_tree
-#include <hugalloc.h>
-#include <set.h>
-
-#undef SET_H
-#undef TREE_H
-
-#ifdef __SET_WAS_DEFINED
-#define SET_H
-#define TREE_H
-#undef __SET_WAS_DEFINED
-#endif
-
-#undef Allocator
-#undef set
-#undef rb_tree
-
-#endif
diff --git a/contrib/libg++/libstdc++/stl/hugalloc.h b/contrib/libg++/libstdc++/stl/hugalloc.h
deleted file mode 100644
index a793ab27fd7c..000000000000
--- a/contrib/libg++/libstdc++/stl/hugalloc.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef HUGALLOC_H
-#define HUGALLOC_H
-
-#ifdef FARALLOC_H
-#undef FARALLOC_H
-#define __FARALLOC_WAS_DEFINED
-#endif
-
-#define __far __huge
-#define far_allocator huge_allocator
-#include <faralloc.h>
-#undef __far
-#undef far_allocator
-
-#undef FARALLOC_H
-
-#ifdef __FARALLOC_WAS_DEFINED
-#define FARALLOC_H
-#undef __FARALLOC_WAS_DEFINED
-#endif
-
-#endif
-
diff --git a/contrib/libg++/libstdc++/stl/hvector.h b/contrib/libg++/libstdc++/stl/hvector.h
deleted file mode 100644
index e7fb41530db8..000000000000
--- a/contrib/libg++/libstdc++/stl/hvector.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef HVECTOR_H
-#define HVECTOR_H
-
-#ifdef VECTOR_H
-#undef VECTOR_H
-#define __VECTOR_WAS_DEFINED
-#endif
-
-#define Allocator huge_allocator
-#define vector huge_vector
-#include <hugalloc.h>
-#include <vector.h>
-
-#undef VECTOR_H
-
-#ifdef __VECTOR_WAS_DEFINED
-#define VECTOR_H
-#undef __VECTOR_WAS_DEFINED
-#endif
-
-#undef Allocator
-#undef vector
-
-#endif
diff --git a/contrib/libg++/libstdc++/stl/iterator.h b/contrib/libg++/libstdc++/stl/iterator.h
deleted file mode 100644
index 5e51598f200f..000000000000
--- a/contrib/libg++/libstdc++/stl/iterator.h
+++ /dev/null
@@ -1,395 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef ITERATOR_H
-#define ITERATOR_H
-
-#include <stddef.h>
-#include <iostream.h>
-#ifndef __GNUG__
-#include <bool.h>
-#endif
-#include <function.h>
-
-struct input_iterator_tag {};
-struct output_iterator_tag {};
-struct forward_iterator_tag {};
-struct bidirectional_iterator_tag {};
-struct random_access_iterator_tag {};
-
-template <class T, class Distance> struct input_iterator {};
-struct output_iterator {};
-template <class T, class Distance> struct forward_iterator {};
-template <class T, class Distance> struct bidirectional_iterator {};
-template <class T, class Distance> struct random_access_iterator {};
-
-template <class T, class Distance>
-inline input_iterator_tag
-iterator_category(const input_iterator<T, Distance>&) {
- return input_iterator_tag();
-}
-
-inline output_iterator_tag iterator_category(const output_iterator&) {
- return output_iterator_tag();
-}
-
-template <class T, class Distance>
-inline forward_iterator_tag
-iterator_category(const forward_iterator<T, Distance>&) {
- return forward_iterator_tag();
-}
-
-template <class T, class Distance>
-inline bidirectional_iterator_tag
-iterator_category(const bidirectional_iterator<T, Distance>&) {
- return bidirectional_iterator_tag();
-}
-
-template <class T, class Distance>
-inline random_access_iterator_tag
-iterator_category(const random_access_iterator<T, Distance>&) {
- return random_access_iterator_tag();
-}
-
-template <class T>
-inline random_access_iterator_tag iterator_category(const T*) {
- return random_access_iterator_tag();
-}
-
-template <class T, class Distance>
-inline T* value_type(const input_iterator<T, Distance>&) {
- return (T*)(0);
-}
-
-template <class T, class Distance>
-inline T* value_type(const forward_iterator<T, Distance>&) {
- return (T*)(0);
-}
-
-template <class T, class Distance>
-inline T* value_type(const bidirectional_iterator<T, Distance>&) {
- return (T*)(0);
-}
-
-template <class T, class Distance>
-inline T* value_type(const random_access_iterator<T, Distance>&) {
- return (T*)(0);
-}
-
-template <class T>
-inline T* value_type(const T*) { return (T*)(0); }
-
-template <class T, class Distance>
-inline Distance* distance_type(const input_iterator<T, Distance>&) {
- return (Distance*)(0);
-}
-
-template <class T, class Distance>
-inline Distance* distance_type(const forward_iterator<T, Distance>&) {
- return (Distance*)(0);
-}
-
-template <class T, class Distance>
-inline Distance*
-distance_type(const bidirectional_iterator<T, Distance>&) {
- return (Distance*)(0);
-}
-
-template <class T, class Distance>
-inline Distance*
-distance_type(const random_access_iterator<T, Distance>&) {
- return (Distance*)(0);
-}
-
-template <class T>
-inline ptrdiff_t* distance_type(const T*) { return (ptrdiff_t*)(0); }
-
-template <class Container>
-class back_insert_iterator : public output_iterator {
-protected:
- Container& container;
-public:
- back_insert_iterator(Container& x) : container(x) {}
- back_insert_iterator<Container>&
- operator=(const Container::value_type& value) {
- container.push_back(value);
- return *this;
- }
- back_insert_iterator<Container>& operator*() { return *this; }
- back_insert_iterator<Container>& operator++() { return *this; }
- back_insert_iterator<Container>& operator++(int) { return *this; }
-};
-
-template <class Container>
-back_insert_iterator<Container> back_inserter(Container& x) {
- return back_insert_iterator<Container>(x);
-}
-
-template <class Container>
-class front_insert_iterator : public output_iterator {
-protected:
- Container& container;
-public:
- front_insert_iterator(Container& x) : container(x) {}
- front_insert_iterator<Container>&
- operator=(const Container::value_type& value) {
- container.push_front(value);
- return *this;
- }
- front_insert_iterator<Container>& operator*() { return *this; }
- front_insert_iterator<Container>& operator++() { return *this; }
- front_insert_iterator<Container>& operator++(int) { return *this; }
-};
-
-template <class Container>
-front_insert_iterator<Container> front_inserter(Container& x) {
- return front_insert_iterator<Container>(x);
-}
-
-template <class Container>
-class insert_iterator : public output_iterator {
-protected:
- Container& container;
- Container::iterator iter;
-public:
- insert_iterator(Container& x, Container::iterator i)
- : container(x), iter(i) {}
- insert_iterator<Container>&
- operator=(const Container::value_type& value) {
- iter = container.insert(iter, value);
- ++iter;
- return *this;
- }
- insert_iterator<Container>& operator*() { return *this; }
- insert_iterator<Container>& operator++() { return *this; }
- insert_iterator<Container>& operator++(int) { return *this; }
-};
-
-template <class Container, class Iterator>
-insert_iterator<Container> inserter(Container& x, Iterator i) {
- return insert_iterator<Container>(x, Container::iterator(i));
-}
-
-template <class BidirectionalIterator, class T, class Reference,
- class Distance = ptrdiff_t>
-// Reference = T&
-class reverse_bidirectional_iterator
- : public bidirectional_iterator<T, Distance> {
- typedef reverse_bidirectional_iterator<BidirectionalIterator, T, Reference,
- Distance> self;
- friend bool operator==(const self& x, const self& y);
-protected:
- BidirectionalIterator current;
-public:
- reverse_bidirectional_iterator() {}
- reverse_bidirectional_iterator(BidirectionalIterator x) : current(x) {}
- BidirectionalIterator base() { return current; }
- Reference operator*() const {
- BidirectionalIterator tmp = current;
- return *--tmp;
- }
- self& operator++() {
- --current;
- return *this;
- }
- self operator++(int) {
- self tmp = *this;
- --current;
- return tmp;
- }
- self& operator--() {
- ++current;
- return *this;
- }
- self operator--(int) {
- self tmp = *this;
- ++current;
- return tmp;
- }
-};
-
-template <class BidirectionalIterator, class T, class Reference,
- class Distance>
-inline bool operator==(
- const reverse_bidirectional_iterator<BidirectionalIterator, T, Reference,
- Distance>& x,
- const reverse_bidirectional_iterator<BidirectionalIterator, T, Reference,
- Distance>& y) {
- return x.current == y.current;
-}
-
-template <class RandomAccessIterator, class T, class Reference,
- class Distance = ptrdiff_t>
-// Reference = T&
-class reverse_iterator : public random_access_iterator<T, Distance> {
- typedef reverse_iterator<RandomAccessIterator, T, Reference, Distance>
- self;
- friend bool operator==(const self& x, const self& y);
- friend bool operator<(const self& x, const self& y);
- friend Distance operator-(const self& x, const self& y);
- friend self operator+(Distance n, const self& x);
-protected:
- RandomAccessIterator current;
-public:
- reverse_iterator() {}
- reverse_iterator(RandomAccessIterator x) : current(x) {}
- RandomAccessIterator base() { return current; }
- Reference operator*() const { return *(current - 1); }
- self& operator++() {
- --current;
- return *this;
- }
- self operator++(int) {
- self tmp = *this;
- --current;
- return tmp;
- }
- self& operator--() {
- ++current;
- return *this;
- }
- self operator--(int) {
- self tmp = *this;
- ++current;
- return tmp;
- }
- self operator+(Distance n) const {
- return self(current - n);
- }
- self& operator+=(Distance n) {
- current -= n;
- return *this;
- }
- self operator-(Distance n) const {
- return self(current + n);
- }
- self& operator-=(Distance n) {
- current += n;
- return *this;
- }
- Reference operator[](Distance n) { return *(*this + n); }
-};
-
-template <class RandomAccessIterator, class T, class Reference, class Distance>
-inline bool operator==(const reverse_iterator<RandomAccessIterator, T,
- Reference, Distance>& x,
- const reverse_iterator<RandomAccessIterator, T,
- Reference, Distance>& y) {
- return x.current == y.current;
-}
-
-template <class RandomAccessIterator, class T, class Reference, class Distance>
-inline bool operator<(const reverse_iterator<RandomAccessIterator, T,
- Reference, Distance>& x,
- const reverse_iterator<RandomAccessIterator, T,
- Reference, Distance>& y) {
- return y.current < x.current;
-}
-
-template <class RandomAccessIterator, class T, class Reference, class Distance>
-inline Distance operator-(const reverse_iterator<RandomAccessIterator, T,
- Reference, Distance>& x,
- const reverse_iterator<RandomAccessIterator, T,
- Reference, Distance>& y) {
- return y.current - x.current;
-}
-
-template <class RandomAccessIterator, class T, class Reference, class Distance>
-inline reverse_iterator<RandomAccessIterator, T, Reference, Distance>
-operator+(Distance n,
- const reverse_iterator<RandomAccessIterator, T, Reference,
- Distance>& x) {
- return reverse_iterator<RandomAccessIterator, T, Reference, Distance>
- (x.current - n);
-}
-
-
-template <class OutputIterator, class T>
-class raw_storage_iterator : public output_iterator {
-protected:
- OutputIterator iter;
-public:
- raw_storage_iterator(OutputIterator x) : iter(x) {}
- raw_storage_iterator<OutputIterator, T>& operator*() { return *this; }
- raw_storage_iterator<OutputIterator, T>& operator=(const T& element) {
- construct(iter, element);
- return *this;
- }
- raw_storage_iterator<OutputIterator, T>& operator++() {
- ++iter;
- return *this;
- }
- raw_storage_iterator<OutputIterator, T> operator++(int) {
- raw_storage_iterator<OutputIterator, T> tmp = *this;
- ++iter;
- return tmp;
- }
-};
-
-
-template <class T, class Distance = ptrdiff_t>
-class istream_iterator : public input_iterator<T, Distance> {
-friend bool operator==(const istream_iterator<T, Distance>& x,
- const istream_iterator<T, Distance>& y);
-protected:
- istream* stream;
- T value;
- bool end_marker;
- void read() {
- end_marker = (*stream) ? true : false;
- if (end_marker) *stream >> value;
- end_marker = (*stream) ? true : false;
- }
-public:
- istream_iterator() : stream(&cin), end_marker(false) {}
- istream_iterator(istream& s) : stream(&s) { read(); }
- const T& operator*() const { return value; }
- istream_iterator<T, Distance>& operator++() {
- read();
- return *this;
- }
- istream_iterator<T, Distance> operator++(int) {
- istream_iterator<T, Distance> tmp = *this;
- read();
- return tmp;
- }
-};
-
-template <class T, class Distance>
-bool operator==(const istream_iterator<T, Distance>& x,
- const istream_iterator<T, Distance>& y) {
- return x.stream == y.stream && x.end_marker == y.end_marker ||
- x.end_marker == false && y.end_marker == false;
-}
-
-template <class T>
-class ostream_iterator : public output_iterator {
-protected:
- ostream* stream;
- char* string;
-public:
- ostream_iterator(ostream& s) : stream(&s), string(0) {}
- ostream_iterator(ostream& s, char* c) : stream(&s), string(c) {}
- ostream_iterator<T>& operator=(const T& value) {
- *stream << value;
- if (string) *stream << string;
- return *this;
- }
- ostream_iterator<T>& operator*() { return *this; }
- ostream_iterator<T>& operator++() { return *this; }
- ostream_iterator<T>& operator++(int) { return *this; }
-};
-
-#endif
diff --git a/contrib/libg++/libstdc++/stl/lbvector.h b/contrib/libg++/libstdc++/stl/lbvector.h
deleted file mode 100644
index 763666c3d39b..000000000000
--- a/contrib/libg++/libstdc++/stl/lbvector.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef LBVECTOR_H
-#define LBVECTOR_H
-
-#ifdef BVECTOR_H
-#undef BVECTOR_H
-#define __BVECTOR_WAS_DEFINED
-#endif
-
-#define Allocator long_allocator
-#define bit_vector long_bit_vector
-#include <lngalloc.h>
-#include <bvector.h>
-
-#undef BVECTOR_H
-
-#ifdef __BVECTOR_WAS_DEFINED
-#define BVECTOR_H
-#undef __BVECTOR_WAS_DEFINED
-#endif
-
-#undef Allocator
-#undef bit_vector
-
-#endif
diff --git a/contrib/libg++/libstdc++/stl/ldeque.h b/contrib/libg++/libstdc++/stl/ldeque.h
deleted file mode 100644
index 4c8761c9f8be..000000000000
--- a/contrib/libg++/libstdc++/stl/ldeque.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef LDEQUE_H
-#define LDEQUE_H
-
-#ifdef DEQUE_H
-#undef DEQUE_H
-#define __DEQUE_WAS_DEFINED
-#endif
-
-#define Allocator long_allocator
-#define deque long_deque
-#include <lngalloc.h>
-#include <deque.h>
-
-#undef DEQUE_H
-
-#ifdef __DEQUE_WAS_DEFINED
-#define DEQUE_H
-#undef __DEQUE_WAS_DEFINED
-#endif
-
-#undef Allocator
-#undef deque
-
-#endif
diff --git a/contrib/libg++/libstdc++/stl/list.h b/contrib/libg++/libstdc++/stl/list.h
deleted file mode 100644
index 42b5d0f5f673..000000000000
--- a/contrib/libg++/libstdc++/stl/list.h
+++ /dev/null
@@ -1,531 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef LIST_H
-#define LIST_H
-
-#include <function.h>
-#include <algobase.h>
-#include <iterator.h>
-#ifndef __GNUG__
-#include <bool.h>
-#endif
-
-#ifndef Allocator
-#define Allocator allocator
-#include <defalloc.h>
-#endif
-
-#ifndef list
-#define list list
-#endif
-
-template <class T>
-class list {
-protected:
- typedef Allocator<void>::pointer void_pointer;
- struct list_node;
- friend list_node;
- struct list_node {
- void_pointer next;
- void_pointer prev;
- T data;
- };
-#ifndef __GNUG__
- static Allocator<list_node> list_node_allocator;
- static Allocator<T> value_allocator;
-#endif
-public:
- typedef T value_type;
- typedef Allocator<T> value_allocator_type;
- typedef Allocator<T>::pointer pointer;
- typedef Allocator<T>::reference reference;
- typedef Allocator<T>::const_reference const_reference;
- typedef Allocator<list_node> list_node_allocator_type;
- typedef Allocator<list_node>::pointer link_type;
- typedef Allocator<list_node>::size_type size_type;
- typedef Allocator<list_node>::difference_type difference_type;
-protected:
-#ifdef __GNUG__
- link_type get_node() { return (link_type)(::operator new(sizeof(list_node))); }
- void put_node(link_type p) { ::operator delete(p); }
-#else
- size_type buffer_size() {
- return list_node_allocator.init_page_size();
- }
- struct list_node_buffer;
- friend list_node_buffer;
- struct list_node_buffer {
- void_pointer next_buffer;
- link_type buffer;
- };
-public:
- typedef Allocator<list_node_buffer> buffer_allocator_type;
- typedef Allocator<list_node_buffer>::pointer buffer_pointer;
-protected:
- static Allocator<list_node_buffer> buffer_allocator;
- static buffer_pointer buffer_list;
- static link_type free_list;
- static link_type next_avail;
- static link_type last;
- void add_new_buffer() {
- buffer_pointer tmp = buffer_allocator.allocate((size_type)1);
- tmp->buffer = list_node_allocator.allocate(buffer_size());
- tmp->next_buffer = buffer_list;
- buffer_list = tmp;
- next_avail = buffer_list->buffer;
- last = next_avail + buffer_size();
- }
- static size_type number_of_lists;
- void deallocate_buffers();
- link_type get_node() {
- link_type tmp = free_list;
- return free_list ? (free_list = (link_type)(free_list->next), tmp)
- : (next_avail == last ? (add_new_buffer(), next_avail++)
- : next_avail++);
- // ugly code for inlining - avoids multiple returns
- }
- void put_node(link_type p) {
- p->next = free_list;
- free_list = p;
- }
-#endif
-
- link_type node;
- size_type length;
-public:
- class iterator;
- class const_iterator;
- class iterator : public bidirectional_iterator<T, difference_type> {
- friend class list<T>;
- friend class const_iterator;
-// friend bool operator==(const iterator& x, const iterator& y);
- protected:
- link_type node;
- iterator(link_type x) : node(x) {}
- public:
- iterator() {}
- bool operator==(const iterator& x) const { return node == x.node; }
- reference operator*() const { return (*node).data; }
- iterator& operator++() {
- node = (link_type)((*node).next);
- return *this;
- }
- iterator operator++(int) {
- iterator tmp = *this;
- ++*this;
- return tmp;
- }
- iterator& operator--() {
- node = (link_type)((*node).prev);
- return *this;
- }
- iterator operator--(int) {
- iterator tmp = *this;
- --*this;
- return tmp;
- }
- };
- class const_iterator : public bidirectional_iterator<T, difference_type> {
- friend class list<T>;
- protected:
- link_type node;
- const_iterator(link_type x) : node(x) {}
- public:
- const_iterator() {}
- const_iterator(const iterator& x) : node(x.node) {}
- bool operator==(const const_iterator& x) const { return node == x.node; }
- const_reference operator*() const { return (*node).data; }
- const_iterator& operator++() {
- node = (link_type)((*node).next);
- return *this;
- }
- const_iterator operator++(int) {
- const_iterator tmp = *this;
- ++*this;
- return tmp;
- }
- const_iterator& operator--() {
- node = (link_type)((*node).prev);
- return *this;
- }
- const_iterator operator--(int) {
- const_iterator tmp = *this;
- --*this;
- return tmp;
- }
- };
- typedef reverse_bidirectional_iterator<const_iterator, value_type,
- const_reference, difference_type>
- const_reverse_iterator;
- typedef reverse_bidirectional_iterator<iterator, value_type, reference,
- difference_type>
- reverse_iterator;
- list() : length(0) {
-#ifndef __GNUG__
- ++number_of_lists;
-#endif
- node = get_node();
- (*node).next = node;
- (*node).prev = node;
- }
- iterator begin() { return (link_type)((*node).next); }
- const_iterator begin() const { return (link_type)((*node).next); }
- iterator end() { return node; }
- const_iterator end() const { return node; }
- reverse_iterator rbegin() { return reverse_iterator(end()); }
- const_reverse_iterator rbegin() const {
- return const_reverse_iterator(end());
- }
- reverse_iterator rend() { return reverse_iterator(begin()); }
- const_reverse_iterator rend() const {
- return const_reverse_iterator(begin());
- }
- bool empty() const { return length == 0; }
- size_type size() const { return length; }
-#ifndef __GNUG__
- size_type max_size() const { return list_node_allocator.max_size(); }
-#endif
- reference front() { return *begin(); }
- const_reference front() const { return *begin(); }
- reference back() { return *(--end()); }
- const_reference back() const { return *(--end()); }
- void swap(list<T>& x) {
- ::swap(node, x.node);
- ::swap(length, x.length);
- }
- iterator insert(iterator position, const T& x) {
- link_type tmp = get_node();
-#ifdef __GNUG__
- construct(&(*tmp).data, x);
-#else
- construct(value_allocator.address((*tmp).data), x);
-#endif
- (*tmp).next = position.node;
- (*tmp).prev = (*position.node).prev;
- (*(link_type((*position.node).prev))).next = tmp;
- (*position.node).prev = tmp;
- ++length;
- return tmp;
- }
-#ifdef __GNUG__
- void insert(iterator position, const T* first, const T* last) {
- while (first != last) insert(position, *first++);
- }
- void insert(iterator position, const_iterator first,
- const_iterator last) {
- while (first != last) insert(position, *first++);
- }
- void insert(iterator position, size_type n, const T& x) {
- while (n--) insert(position, x);
- }
-#else
- void insert(iterator position, const T* first, const T* last);
- void insert(iterator position, const_iterator first,
- const_iterator last);
- void insert(iterator position, size_type n, const T& x);
-#endif
- void push_front(const T& x) { insert(begin(), x); }
- void push_back(const T& x) { insert(end(), x); }
- void erase(iterator position) {
- (*(link_type((*position.node).prev))).next = (*position.node).next;
- (*(link_type((*position.node).next))).prev = (*position.node).prev;
-#ifdef __GNUG__
- destroy(&(*position.node).data);
-#else
- destroy(value_allocator.address((*position.node).data));
-#endif
- put_node(position.node);
- --length;
- }
-#ifdef __GNUG__
- void erase(iterator first, iterator last) {
- while (first != last) erase(first++);
- }
-#else
- void erase(iterator first, iterator last);
-#endif
- void pop_front() { erase(begin()); }
- void pop_back() {
- iterator tmp = end();
- erase(--tmp);
- }
- list(size_type n, const T& value = T()) : length(0) {
-#ifndef __GNUG__
- ++number_of_lists;
-#endif
- node = get_node();
- (*node).next = node;
- (*node).prev = node;
- insert(begin(), n, value);
- }
- list(const T* first, const T* last) : length(0) {
-#ifndef __GNUG__
- ++number_of_lists;
-#endif
- node = get_node();
- (*node).next = node;
- (*node).prev = node;
- insert(begin(), first, last);
- }
- list(const list<T>& x) : length(0) {
-#ifndef __GNUG__
- ++number_of_lists;
-#endif
- node = get_node();
- (*node).next = node;
- (*node).prev = node;
- insert(begin(), x.begin(), x.end());
- }
- ~list() {
- erase(begin(), end());
- put_node(node);
-#ifndef __GNUG__
- if (--number_of_lists == 0) deallocate_buffers();
-#endif
- }
- list<T>& operator=(const list<T>& x);
-protected:
- void transfer(iterator position, iterator first, iterator last) {
- (*(link_type((*last.node).prev))).next = position.node;
- (*(link_type((*first.node).prev))).next = last.node;
- (*(link_type((*position.node).prev))).next = first.node;
- link_type tmp = link_type((*position.node).prev);
- (*position.node).prev = (*last.node).prev;
- (*last.node).prev = (*first.node).prev;
- (*first.node).prev = tmp;
- }
-public:
- void splice(iterator position, list<T>& x) {
- if (!x.empty()) {
- transfer(position, x.begin(), x.end());
- length += x.length;
- x.length = 0;
- }
- }
- void splice(iterator position, list<T>& x, iterator i) {
- iterator j = i;
- if (position == i || position == ++j) return;
- transfer(position, i, j);
- ++length;
- --x.length;
- }
- void splice(iterator position, list<T>& x, iterator first, iterator last) {
- if (first != last) {
- if (&x != this) {
- difference_type n = 0;
- distance(first, last, n);
- x.length -= n;
- length += n;
- }
- transfer(position, first, last);
- }
- }
- void remove(const T& value);
- void unique();
- void merge(list<T>& x);
- void reverse();
- void sort();
-#ifdef __GNUG__
- friend difference_type* distance_type(const iterator&) {
- return (difference_type*)(0);
- }
- friend T* value_type(const iterator&) {
- return (T*)(0);
- }
- friend bidirectional_iterator_tag iterator_category(iterator) {
- return bidirectional_iterator_tag();
- }
-#endif
-};
-
-#ifndef __GNUG__
-template <class T>
-list<T>::buffer_pointer list<T>::buffer_list = 0;
-
-template <class T>
-list<T>::link_type list<T>::free_list = 0;
-
-template <class T>
-list<T>::link_type list<T>::next_avail = 0;
-
-template <class T>
-list<T>::link_type list<T>::last = 0;
-
-template <class T>
-list<T>::size_type list<T>::number_of_lists = 0;
-
-template <class T>
-list<T>::list_node_allocator_type list<T>::list_node_allocator;
-
-template <class T>
-list<T>::value_allocator_type list<T>::value_allocator;
-
-template <class T>
-list<T>::buffer_allocator_type list<T>::buffer_allocator;
-#endif
-
-/*
- * currently the following does not work - made into a member function
-
-template <class T>
-inline bool operator==(const list<T>::iterator& x, const list<T>::iterator& y) {
- return x.node == y.node;
-}
-*/
-
-template <class T>
-inline bool operator==(const list<T>& x, const list<T>& y) {
- return x.size() == y.size() && equal(x.begin(), x.end(), y.begin());
-}
-
-template <class T>
-inline bool operator<(const list<T>& x, const list<T>& y) {
- return lexicographical_compare(x.begin(), x.end(), y.begin(), y.end());
-}
-
-#ifndef __GNUG__
-template <class T>
-void list<T>::deallocate_buffers() {
- while (buffer_list) {
- buffer_pointer tmp = buffer_list;
- buffer_list = (buffer_pointer)(buffer_list->next_buffer);
- list_node_allocator.deallocate(tmp->buffer);
- buffer_allocator.deallocate(tmp);
- }
- free_list = 0;
- next_avail = 0;
- last = 0;
-}
-#endif
-
-#ifndef __GNUG__
-template <class T>
-void list<T>::insert(iterator position, const T* first, const T* last) {
- while (first != last) insert(position, *first++);
-}
-
-template <class T>
-void list<T>::insert(iterator position, const_iterator first,
- const_iterator last) {
- while (first != last) insert(position, *first++);
-}
-
-template <class T>
-void list<T>::insert(iterator position, size_type n, const T& x) {
- while (n--) insert(position, x);
-}
-
-template <class T>
-void list<T>::erase(iterator first, iterator last) {
- while (first != last) erase(first++);
-}
-#endif
-
-template <class T>
-list<T>& list<T>::operator=(const list<T>& x) {
- if (this != &x) {
- iterator first1 = begin();
- iterator last1 = end();
- const_iterator first2 = x.begin();
- const_iterator last2 = x.end();
- while (first1 != last1 && first2 != last2) *first1++ = *first2++;
- if (first2 == last2)
- erase(first1, last1);
- else
- insert(last1, first2, last2);
- }
- return *this;
-}
-
-template <class T>
-void list<T>::remove(const T& value) {
- iterator first = begin();
- iterator last = end();
- while (first != last) {
- iterator next = first;
- ++next;
- if (*first == value) erase(first);
- first = next;
- }
-}
-
-template <class T>
-void list<T>::unique() {
- iterator first = begin();
- iterator last = end();
- if (first == last) return;
- iterator next = first;
- while (++next != last) {
- if (*first == *next)
- erase(next);
- else
- first = next;
- next = first;
- }
-}
-
-template <class T>
-void list<T>::merge(list<T>& x) {
- iterator first1 = begin();
- iterator last1 = end();
- iterator first2 = x.begin();
- iterator last2 = x.end();
- while (first1 != last1 && first2 != last2)
- if (*first2 < *first1) {
- iterator next = first2;
- transfer(first1, first2, ++next);
- first2 = next;
- } else
- ++first1;
- if (first2 != last2) transfer(last1, first2, last2);
- length += x.length;
- x.length= 0;
-}
-
-template <class T>
-void list<T>::reverse() {
- if (size() < 2) return;
- for (iterator first = ++begin(); first != end();) {
- iterator old = first++;
- transfer(begin(), old, first);
- }
-}
-
-template <class T>
-void list<T>::sort() {
- if (size() < 2) return;
- list<T> carry;
- list<T> counter[64];
- int fill = 0;
- while (!empty()) {
- carry.splice(carry.begin(), *this, begin());
- int i = 0;
- while(i < fill && !counter[i].empty()) {
- counter[i].merge(carry);
- carry.swap(counter[i++]);
- }
- carry.swap(counter[i]);
- if (i == fill) ++fill;
- }
-
- for (int i = 1; i < fill; ++i) counter[i].merge(counter[i-1]);
- swap(counter[fill-1]);
-}
-
-#undef Allocator
-#undef list
-
-#endif
diff --git a/contrib/libg++/libstdc++/stl/llist.h b/contrib/libg++/libstdc++/stl/llist.h
deleted file mode 100644
index 07ee6113a096..000000000000
--- a/contrib/libg++/libstdc++/stl/llist.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef LLIST_H
-#define LLIST_H
-
-#ifdef LIST_H
-#undef LIST_H
-#define __LIST_WAS_DEFINED
-#endif
-
-#define Allocator long_allocator
-#define list long_list
-#include <lngalloc.h>
-#include <list.h>
-
-#undef LIST_H
-
-#ifdef __LIST_WAS_DEFINED
-#define LIST_H
-#undef __LIST_WAS_DEFINED
-#endif
-
-#undef Allocator
-#undef list
-
-#endif
diff --git a/contrib/libg++/libstdc++/stl/lmap.h b/contrib/libg++/libstdc++/stl/lmap.h
deleted file mode 100644
index da1eeba6c8cc..000000000000
--- a/contrib/libg++/libstdc++/stl/lmap.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef LMAP_H
-#define LMAP_H
-
-#ifdef MAP_H
-#undef MAP_H
-#undef TREE_H
-#define __MAP_WAS_DEFINED
-#endif
-
-#define Allocator long_allocator
-#define map long_map
-#define rb_tree long_rb_tree
-#include <lngalloc.h>
-#include <map.h>
-
-#undef MAP_H
-#undef TREE_H
-
-#ifdef __MAP_WAS_DEFINED
-#define MAP_H
-#define TREE_H
-#undef __MAP_WAS_DEFINED
-#endif
-
-#undef Allocator
-#undef map
-#undef rb_tree
-
-#endif
diff --git a/contrib/libg++/libstdc++/stl/lmultmap.h b/contrib/libg++/libstdc++/stl/lmultmap.h
deleted file mode 100644
index 1a87e3372d8d..000000000000
--- a/contrib/libg++/libstdc++/stl/lmultmap.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef LMULTIMAP_H
-#define LMULTIMAP_H
-
-#ifdef MULTIMAP_H
-#undef MULTIMAP_H
-#undef TREE_H
-#define __MULTIMAP_WAS_DEFINED
-#endif
-
-#define Allocator long_allocator
-#define multimap long_multimap
-#define rb_tree long_rb_tree
-#include <lngalloc.h>
-#include <multimap.h>
-
-#undef MULTIMAP_H
-#undef TREE_H
-
-#ifdef __MULTIMAP_WAS_DEFINED
-#define MULTIMAP_H
-#define TREE_H
-#undef __MULTIMAP_WAS_DEFINED
-#endif
-
-#undef Allocator
-#undef multimap
-#undef rb_tree
-
-#endif
diff --git a/contrib/libg++/libstdc++/stl/lmultset.h b/contrib/libg++/libstdc++/stl/lmultset.h
deleted file mode 100644
index bb1571f6c906..000000000000
--- a/contrib/libg++/libstdc++/stl/lmultset.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef LMULTISET_H
-#define LMULTISET_H
-
-#ifdef MULTISET_H
-#undef MULTISET_H
-#undef TREE_H
-#define __MULTISET_WAS_DEFINED
-#endif
-
-#define Allocator long_allocator
-#define multiset long_multiset
-#define rb_tree long_rb_tree
-#include <lngalloc.h>
-#include <multiset.h>
-
-#undef MULTISET_H
-#undef TREE_H
-
-#ifdef __MULTISET_WAS_DEFINED
-#define MULTISET_H
-#define TREE_H
-#undef __MULTISET_WAS_DEFINED
-#endif
-
-#undef Allocator
-#undef multiset
-#undef rb_tree
-
-#endif
diff --git a/contrib/libg++/libstdc++/stl/lngalloc.h b/contrib/libg++/libstdc++/stl/lngalloc.h
deleted file mode 100644
index 6685ea54511c..000000000000
--- a/contrib/libg++/libstdc++/stl/lngalloc.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef LNGALLOC_H
-#define LNGALLOC_H
-
-#include <limits.h>
-#include <algobase.h>
-#include <defalloc.h>
-
-template <class T>
-class long_allocator {
-public:
- typedef T value_type;
- typedef T* pointer;
- typedef const T* const_pointer;
- typedef T& reference;
- typedef const T& const_reference;
- typedef unsigned long size_type;
- typedef long difference_type;
- pointer allocate(size_type n) {
- return ::allocate((difference_type)n, (pointer)0);
- }
- void deallocate(pointer p) { ::deallocate(p); }
- pointer address(reference x) { return (pointer)&x; }
- const_pointer const_address(const_reference x) {
- return (const_pointer)&x;
- }
- size_type init_page_size() {
- return max(size_type(1), size_type(4096/sizeof(T)));
- }
- size_type max_size() const {
- return max(size_type(1), size_type(ULONG_MAX/sizeof(T)));
- }
-};
-
-class long_allocator<void> {
-public:
- typedef void* pointer;
-};
-
-#endif
diff --git a/contrib/libg++/libstdc++/stl/lset.h b/contrib/libg++/libstdc++/stl/lset.h
deleted file mode 100644
index e4d52f7c39e1..000000000000
--- a/contrib/libg++/libstdc++/stl/lset.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef LSET_H
-#define LSET_H
-
-#ifdef SET_H
-#undef SET_H
-#undef TREE_H
-#define __SET_WAS_DEFINED
-#endif
-
-#define Allocator long_allocator
-#define set long_set
-#define rb_tree long_rb_tree
-#include <lngalloc.h>
-#include <set.h>
-
-#undef SET_H
-#undef TREE_H
-
-#ifdef __SET_WAS_DEFINED
-#define SET_H
-#define TREE_H
-#undef __SET_WAS_DEFINED
-#endif
-
-#undef Allocator
-#undef set
-#undef rb_tree
-
-#endif
diff --git a/contrib/libg++/libstdc++/stl/map.h b/contrib/libg++/libstdc++/stl/map.h
deleted file mode 100644
index 5c1c30d49e67..000000000000
--- a/contrib/libg++/libstdc++/stl/map.h
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef MAP_H
-#define MAP_H
-
-#ifndef Allocator
-#define Allocator allocator
-#include <defalloc.h>
-#endif
-
-#include <tree.h>
-
-template <class Key, class T, class Compare>
-class map {
-public:
-
-// typedefs:
-
- typedef Key key_type;
- typedef pair<const Key, T> value_type;
- typedef Compare key_compare;
-
- class value_compare
- : public binary_function<value_type, value_type, bool> {
- friend class map<Key, T, Compare>;
- protected :
- Compare comp;
- value_compare(Compare c) : comp(c) {}
- public:
- bool operator()(const value_type& x, const value_type& y) const {
- return comp(x.first, y.first);
- }
- };
-
-private:
- typedef rb_tree<key_type, value_type,
- select1st<value_type, key_type>, key_compare> rep_type;
- rep_type t; // red-black tree representing map
-public:
- typedef rep_type::pointer pointer;
- typedef rep_type::reference reference;
- typedef rep_type::const_reference const_reference;
- typedef rep_type::iterator iterator;
- typedef rep_type::const_iterator const_iterator;
- typedef rep_type::reverse_iterator reverse_iterator;
- typedef rep_type::const_reverse_iterator const_reverse_iterator;
- typedef rep_type::size_type size_type;
- typedef rep_type::difference_type difference_type;
-
-// allocation/deallocation
-
- map(const Compare& comp = Compare()) : t(comp, false) {}
- map(const value_type* first, const value_type* last,
- const Compare& comp = Compare()) : t(first, last, comp, false) {}
- map(const map<Key, T, Compare>& x) : t(x.t, false) {}
- map<Key, T, Compare>& operator=(const map<Key, T, Compare>& x) {
- t = x.t;
- return *this;
- }
-
-// accessors:
-
- key_compare key_comp() const { return t.key_comp(); }
- value_compare value_comp() const { return value_compare(t.key_comp()); }
- iterator begin() { return t.begin(); }
- const_iterator begin() const { return t.begin(); }
- iterator end() { return t.end(); }
- const_iterator end() const { return t.end(); }
- reverse_iterator rbegin() { return t.rbegin(); }
- const_reverse_iterator rbegin() const { return t.rbegin(); }
- reverse_iterator rend() { return t.rend(); }
- const_reverse_iterator rend() const { return t.rend(); }
- bool empty() const { return t.empty(); }
- size_type size() const { return t.size(); }
-#ifndef __GNUG__
- size_type max_size() const { return t.max_size(); }
-#endif
- Allocator<T>::reference operator[](const key_type& k) {
- return (*((insert(value_type(k, T()))).first)).second;
- }
- void swap(map<Key, T, Compare>& x) { t.swap(x.t); }
-
-// insert/erase
-
- typedef pair<iterator, bool> pair_iterator_bool;
- // typedef done to get around compiler bug
- pair_iterator_bool insert(const value_type& x) { return t.insert(x); }
- iterator insert(iterator position, const value_type& x) {
- return t.insert(position, x);
- }
- void insert(const value_type* first, const value_type* last) {
- t.insert(first, last);
- }
- void erase(iterator position) { t.erase(position); }
- size_type erase(const key_type& x) { return t.erase(x); }
- void erase(iterator first, iterator last) { t.erase(first, last); }
-
-// map operations:
-
- iterator find(const key_type& x) { return t.find(x); }
- const_iterator find(const key_type& x) const { return t.find(x); }
- size_type count(const key_type& x) const { return t.count(x); }
- iterator lower_bound(const key_type& x) {return t.lower_bound(x); }
- const_iterator lower_bound(const key_type& x) const {
- return t.lower_bound(x);
- }
- iterator upper_bound(const key_type& x) {return t.upper_bound(x); }
- const_iterator upper_bound(const key_type& x) const {
- return t.upper_bound(x);
- }
- typedef pair<iterator, iterator> pair_iterator_iterator;
- // typedef done to get around compiler bug
- pair_iterator_iterator equal_range(const key_type& x) {
- return t.equal_range(x);
- }
- typedef pair<const_iterator, const_iterator> pair_citerator_citerator;
- // typedef done to get around compiler bug
- pair_citerator_citerator equal_range(const key_type& x) const {
- return t.equal_range(x);
- }
-};
-
-template <class Key, class T, class Compare>
-inline bool operator==(const map<Key, T, Compare>& x,
- const map<Key, T, Compare>& y) {
- return x.size() == y.size() && equal(x.begin(), x.end(), y.begin());
-}
-
-template <class Key, class T, class Compare>
-inline bool operator<(const map<Key, T, Compare>& x,
- const map<Key, T, Compare>& y) {
- return lexicographical_compare(x.begin(), x.end(), y.begin(), y.end());
-}
-
-#undef Allocator
-
-#endif
diff --git a/contrib/libg++/libstdc++/stl/multimap.h b/contrib/libg++/libstdc++/stl/multimap.h
deleted file mode 100644
index 2478e2419fa6..000000000000
--- a/contrib/libg++/libstdc++/stl/multimap.h
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef MULTIMAP_H
-#define MULTIMAP_H
-
-#ifndef Allocator
-#define Allocator allocator
-#include <defalloc.h>
-#endif
-
-#include <tree.h>
-
-template <class Key, class T, class Compare>
-class multimap {
-public:
-
-// typedefs:
-
- typedef Key key_type;
- typedef pair<const Key, T> value_type;
- typedef Compare key_compare;
-
- class value_compare
- : public binary_function<value_type, value_type, bool> {
- friend class multimap<Key, T, Compare>;
- protected:
- Compare comp;
- value_compare(Compare c) : comp(c) {}
- public:
- bool operator()(const value_type& x, const value_type& y) const {
- return comp(x.first, y.first);
- }
- };
-
-private:
- typedef rb_tree<key_type, value_type,
- select1st<value_type, key_type>, key_compare> rep_type;
- rep_type t; // red-black tree representing multimap
-public:
- typedef rep_type::reference reference;
- typedef rep_type::const_reference const_reference;
- typedef rep_type::iterator iterator;
- typedef rep_type::const_iterator const_iterator;
- typedef rep_type::reverse_iterator reverse_iterator;
- typedef rep_type::const_reverse_iterator const_reverse_iterator;
- typedef rep_type::size_type size_type;
- typedef rep_type::difference_type difference_type;
-
-// allocation/deallocation
-
- multimap(const Compare& comp = Compare()) : t(comp, true) { }
- multimap(const value_type* first, const value_type* last,
- const Compare& comp = Compare()) : t(first, last, comp, true) { }
- multimap(const multimap<Key, T, Compare>& x) : t(x.t, true) { }
- multimap<Key, T, Compare>& operator=(const multimap<Key, T, Compare>& x) {
- t = x.t;
- return *this;
- }
-
-// accessors:
-
- key_compare key_comp() const { return t.key_comp(); }
- value_compare value_comp() const { return value_compare(t.key_comp()); }
- iterator begin() { return t.begin(); }
- const_iterator begin() const { return t.begin(); }
- iterator end() { return t.end(); }
- const_iterator end() const { return t.end(); }
- reverse_iterator rbegin() { return t.rbegin(); }
- const_reverse_iterator rbegin() const { return t.rbegin(); }
- reverse_iterator rend() { return t.rend(); }
- const_reverse_iterator rend() const { return t.rend(); }
- bool empty() const { return t.empty(); }
- size_type size() const { return t.size(); }
- size_type max_size() const { return t.max_size(); }
- void swap(multimap<Key, T, Compare>& x) { t.swap(x.t); }
-
-// insert/erase
-
- iterator insert(const value_type& x) { return t.insert(x).first; }
- iterator insert(iterator position, const value_type& x) {
- return t.insert(position, x);
- }
- void insert(const value_type* first, const value_type* last) {
- t.insert(first, last);
- }
- void erase(iterator position) { t.erase(position); }
- size_type erase(const key_type& x) { return t.erase(x); }
- void erase(iterator first, iterator last) { t.erase(first, last); }
-
-// multimap operations:
-
- iterator find(const key_type& x) { return t.find(x); }
- const_iterator find(const key_type& x) const { return t.find(x); }
- size_type count(const key_type& x) const { return t.count(x); }
- iterator lower_bound(const key_type& x) {return t.lower_bound(x); }
- const_iterator lower_bound(const key_type& x) const {
- return t.lower_bound(x);
- }
- iterator upper_bound(const key_type& x) {return t.upper_bound(x); }
- const_iterator upper_bound(const key_type& x) const {
- return t.upper_bound(x);
- }
- typedef pair<iterator, iterator> pair_iterator_iterator;
- // typedef done to get around compiler bug
- pair_iterator_iterator equal_range(const key_type& x) {
- return t.equal_range(x);
- }
- typedef pair<const_iterator, const_iterator> pair_citerator_citerator;
- // typedef done to get around compiler bug
- pair_citerator_citerator equal_range(const key_type& x) const {
- return t.equal_range(x);
- }
-};
-
-template <class Key, class T, class Compare>
-inline bool operator==(const multimap<Key, T, Compare>& x,
- const multimap<Key, T, Compare>& y) {
- return x.size() == y.size() && equal(x.begin(), x.end(), y.begin());
-}
-
-template <class Key, class T, class Compare>
-inline bool operator<(const multimap<Key, T, Compare>& x,
- const multimap<Key, T, Compare>& y) {
- return lexicographical_compare(x.begin(), x.end(), y.begin(), y.end());
-}
-
-#undef Allocator
-
-#endif
diff --git a/contrib/libg++/libstdc++/stl/multiset.h b/contrib/libg++/libstdc++/stl/multiset.h
deleted file mode 100644
index 1ee6d93e352d..000000000000
--- a/contrib/libg++/libstdc++/stl/multiset.h
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef MULTISET_H
-#define MULTISET_H
-
-#ifndef Allocator
-#define Allocator allocator
-#include <defalloc.h>
-#endif
-
-#include <tree.h>
-
-template <class Key, class Compare>
-class multiset {
-public:
-// typedefs:
-
- typedef Key key_type;
- typedef Key value_type;
- typedef Compare key_compare;
- typedef Compare value_compare;
-private:
- typedef rb_tree<key_type, value_type,
- ident<value_type, key_type>, key_compare> rep_type;
- rep_type t; // red-black tree representing multiset
-public:
- typedef rep_type::const_reference reference;
- typedef rep_type::const_reference const_reference;
- typedef rep_type::const_iterator iterator;
- typedef rep_type::const_iterator const_iterator;
- typedef rep_type::const_reverse_iterator reverse_iterator;
- typedef rep_type::const_reverse_iterator const_reverse_iterator;
- typedef rep_type::size_type size_type;
- typedef rep_type::difference_type difference_type;
-
-// allocation/deallocation
-
- multiset(const Compare& comp = Compare()) : t(comp, true) {}
- multiset(const value_type* first, const value_type* last,
- const Compare& comp = Compare()) : t(comp, true) {
- for (const value_type* i = first; i != last; ++i)
- t.insert(*i);
- }
- multiset(const multiset<Key, Compare>& x) : t(x.t, true) {}
- multiset<Key, Compare>& operator=(const multiset<Key, Compare>& x) {
- t = x.t;
- return *this;
- }
-
-// accessors:
-
- key_compare key_comp() const { return t.key_comp(); }
- value_compare value_comp() const { return t.key_comp(); }
- iterator begin() const { return t.begin(); }
- iterator end() const { return t.end(); }
- reverse_iterator rbegin() const { return t.rbegin(); }
- reverse_iterator rend() const { return t.rend(); }
- bool empty() const { return t.empty(); }
- size_type size() const { return t.size(); }
- size_type max_size() const { return t.max_size(); }
- void swap(multiset<Key, Compare>& x) { t.swap(x.t); }
-
-// insert/erase
- iterator insert(const value_type& x) {
- return t.insert(x).first;
- }
- iterator insert(iterator position, const value_type& x) {
- return t.insert((rep_type::iterator&)position, x);
- }
- void insert(const value_type* first, const value_type* last) {
- for (const value_type* i = first; i != last; ++i)
- t.insert(*i);
- }
- void erase(iterator position) {
- t.erase((rep_type::iterator&)position);
- }
- size_type erase(const key_type& x) {
- return t.erase(x);
- }
- void erase(iterator first, iterator last) {
- t.erase((rep_type::iterator&)first,
- (rep_type::iterator&)last);
- }
-
-// multiset operations:
-
- iterator find(const key_type& x) const { return t.find(x); }
- size_type count(const key_type& x) const { return t.count(x); }
- iterator lower_bound(const key_type& x) const {
- return t.lower_bound(x);
- }
- iterator upper_bound(const key_type& x) const {
- return t.upper_bound(x);
- }
- typedef pair<iterator, iterator> pair_iterator_iterator;
- // typedef done to get around compiler bug
- pair_iterator_iterator equal_range(const key_type& x) const {
- return t.equal_range(x);
- }
-};
-
-template <class Key, class Compare>
-inline bool operator==(const multiset<Key, Compare>& x,
- const multiset<Key, Compare>& y) {
- return x.size() == y.size() && equal(x.begin(), x.end(), y.begin());
-}
-
-template <class Key, class Compare>
-inline bool operator<(const multiset<Key, Compare>& x,
- const multiset<Key, Compare>& y) {
- return lexicographical_compare(x.begin(), x.end(), y.begin(), y.end());
-}
-
-#undef Allocator
-
-#endif
diff --git a/contrib/libg++/libstdc++/stl/neralloc.h b/contrib/libg++/libstdc++/stl/neralloc.h
deleted file mode 100644
index c66e9b366a02..000000000000
--- a/contrib/libg++/libstdc++/stl/neralloc.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef NEARALLOC_H
-#define NEARALLOC_H
-
-#ifdef FARALLOC_H
-#undef FARALLOC_H
-#define __FARALLOC_WAS_DEFINED
-#endif
-
-#define __far __near
-#define far_allocator near_allocator
-#include <faralloc.h>
-#undef __far
-#undef far_allocator
-
-#undef FARALLOC_H
-
-#ifdef __FARALLOC_WAS_DEFINED
-#define FARALLOC_H
-#undef __FARALLOC_WAS_DEFINED
-#endif
-
-#endif
-
diff --git a/contrib/libg++/libstdc++/stl/nmap.h b/contrib/libg++/libstdc++/stl/nmap.h
deleted file mode 100644
index 99754c781692..000000000000
--- a/contrib/libg++/libstdc++/stl/nmap.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef NMAP_H
-#define NMAP_H
-
-#ifdef MAP_H
-#undef MAP_H
-#undef TREE_H
-#define __MAP_WAS_DEFINED
-#endif
-
-#define Allocator near_allocator
-#define map near_map
-#define rb_tree near_rb_tree
-#include <neralloc.h>
-#include <map.h>
-
-#undef MAP_H
-#undef TREE_H
-
-#ifdef __MAP_WAS_DEFINED
-#define MAP_H
-#define TREE_H
-#undef __MAP_WAS_DEFINED
-#endif
-
-#undef Allocator
-#undef map
-#undef rb_tree
-
-#endif
diff --git a/contrib/libg++/libstdc++/stl/nmultmap.h b/contrib/libg++/libstdc++/stl/nmultmap.h
deleted file mode 100644
index a6ad67c4fbb2..000000000000
--- a/contrib/libg++/libstdc++/stl/nmultmap.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef NMULTIMAP_H
-#define NMULTIMAP_H
-
-#ifdef MULTIMAP_H
-#undef MULTIMAP_H
-#undef TREE_H
-#define __MULTIMAP_WAS_DEFINED
-#endif
-
-#define Allocator near_allocator
-#define multimap near_multimap
-#define rb_tree near_rb_tree
-#include <neralloc.h>
-#include <multimap.h>
-
-#undef MULTIMAP_H
-#undef TREE_H
-
-#ifdef __MULTIMAP_WAS_DEFINED
-#define MULTIMAP_H
-#define TREE_H
-#undef __MULTIMAP_WAS_DEFINED
-#endif
-
-#undef Allocator
-#undef multimap
-#undef rb_tree
-
-#endif
diff --git a/contrib/libg++/libstdc++/stl/nmultset.h b/contrib/libg++/libstdc++/stl/nmultset.h
deleted file mode 100644
index 3a0ad30db0d6..000000000000
--- a/contrib/libg++/libstdc++/stl/nmultset.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef NMULTISET_H
-#define NMULTISET_H
-
-#ifdef MULTISET_H
-#undef MULTISET_H
-#undef TREE_H
-#define __MULTISET_WAS_DEFINED
-#endif
-
-#define Allocator near_allocator
-#define multiset near_multiset
-#define rb_tree near_rb_tree
-#include <neralloc.h>
-#include <multiset.h>
-
-#undef MULTISET_H
-#undef TREE_H
-
-#ifdef __MULTISET_WAS_DEFINED
-#define MULTISET_H
-#define TREE_H
-#undef __MULTISET_WAS_DEFINED
-#endif
-
-#undef Allocator
-#undef multiset
-#undef rb_tree
-
-#endif
diff --git a/contrib/libg++/libstdc++/stl/nset.h b/contrib/libg++/libstdc++/stl/nset.h
deleted file mode 100644
index 325d6b94aacf..000000000000
--- a/contrib/libg++/libstdc++/stl/nset.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef NSET_H
-#define NSET_H
-
-#ifdef SET_H
-#undef SET_H
-#undef TREE_H
-#define __SET_WAS_DEFINED
-#endif
-
-#define Allocator near_allocator
-#define set near_set
-#define rb_tree near_rb_tree
-#include <neralloc.h>
-#include <set.h>
-
-#undef SET_H
-#undef TREE_H
-
-#ifdef __SET_WAS_DEFINED
-#define SET_H
-#define TREE_H
-#undef __SET_WAS_DEFINED
-#endif
-
-#undef Allocator
-#undef set
-#undef rb_tree
-
-#endif
diff --git a/contrib/libg++/libstdc++/stl/pair.h b/contrib/libg++/libstdc++/stl/pair.h
deleted file mode 100644
index 817d9a439695..000000000000
--- a/contrib/libg++/libstdc++/stl/pair.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef PAIR_H
-#define PAIR_H
-
-#ifndef __GNUG__
-#include <bool.h>
-#endif
-
-template <class T1, class T2>
-struct pair {
- T1 first;
- T2 second;
- pair() {}
- pair(const T1& a, const T2& b) : first(a), second(b) {}
-};
-
-template <class T1, class T2>
-inline bool operator==(const pair<T1, T2>& x, const pair<T1, T2>& y) {
- return x.first == y.first && x.second == y.second;
-}
-
-template <class T1, class T2>
-inline bool operator<(const pair<T1, T2>& x, const pair<T1, T2>& y) {
- return x.first < y.first || (!(y.first < x.first) && x.second < y.second);
-}
-
-template <class T1, class T2>
-inline pair<T1, T2> make_pair(const T1& x, const T2& y) {
- return pair<T1, T2>(x, y);
-}
-
-#endif
diff --git a/contrib/libg++/libstdc++/stl/projectn.h b/contrib/libg++/libstdc++/stl/projectn.h
deleted file mode 100644
index 766796e9f218..000000000000
--- a/contrib/libg++/libstdc++/stl/projectn.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef PROJECTN_H
-#define PROJECTN_H
-
-#include <function.h>
-
-template <class T, class U>
-struct select1st : public unary_function<T, U> {
- const U& operator()(const T& x) const { return x.first; }
-};
-
-template <class T, class U>
-struct ident : public unary_function<T, U> {
- const U& operator()(const T& x) const { return x; }
-};
-
-#endif
-
-
diff --git a/contrib/libg++/libstdc++/stl/random.cc b/contrib/libg++/libstdc++/stl/random.cc
deleted file mode 100644
index e79872ca49b1..000000000000
--- a/contrib/libg++/libstdc++/stl/random.cc
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- */
-
-#include <stddef.h>
-
-#define __SEED 161803398
-
-class __random_generator {
-protected:
- unsigned long table[55];
- size_t index1;
- size_t index2;
-public:
- unsigned long operator()(unsigned long limit) {
- index1 = (index1 + 1) % 55;
- index2 = (index2 + 1) % 55;
- table[index1] = table[index1] - table[index2];
- return table[index1] % limit;
- }
- void seed(unsigned long j);
- __random_generator(unsigned long j) { seed(j); }
-};
-
-void __random_generator::seed(unsigned long j) {
- unsigned long k = 1;
- table[54] = j;
- for (size_t i = 0; i < 54; i++) {
- size_t ii = 21 * i % 55;
- table[ii] = k;
- k = j - k;
- j = table[ii];
- }
- for (int loop = 0; loop < 4; loop++) {
- for (size_t i = 0; i < 55; i++)
- table[i] = table[i] - table[(1 + i + 30) % 55];
- }
- index1 = 0;
- index2 = 31;
-}
-
-static __random_generator rd(__SEED);
-
-unsigned long __long_random(unsigned long limit) {
- return rd(limit);
-}
-
-
-
diff --git a/contrib/libg++/libstdc++/stl/set.h b/contrib/libg++/libstdc++/stl/set.h
deleted file mode 100644
index d108e42371a0..000000000000
--- a/contrib/libg++/libstdc++/stl/set.h
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef SET_H
-#define SET_H
-
-#ifndef Allocator
-#define Allocator allocator
-#include <defalloc.h>
-#endif
-
-#include <tree.h>
-
-template <class Key, class Compare>
-class set {
-public:
-// typedefs:
-
- typedef Key key_type;
- typedef Key value_type;
- typedef Compare key_compare;
- typedef Compare value_compare;
-private:
- typedef rb_tree<key_type, value_type,
- ident<value_type, key_type>, key_compare> rep_type;
- rep_type t; // red-black tree representing set
-public:
- typedef rep_type::const_reference reference;
- typedef rep_type::const_reference const_reference;
- typedef rep_type::const_iterator iterator;
- typedef rep_type::const_iterator const_iterator;
- typedef rep_type::const_reverse_iterator reverse_iterator;
- typedef rep_type::const_reverse_iterator const_reverse_iterator;
- typedef rep_type::size_type size_type;
- typedef rep_type::difference_type difference_type;
-
-// allocation/deallocation
-
- set(const Compare& comp = Compare()) : t(comp, false) {}
- set(const value_type* first, const value_type* last,
- const Compare& comp = Compare()) : t(comp, false) {
- for (const value_type* i = first; i != last; ++i)
- t.insert(*i);
- }
- set(const set<Key, Compare>& x) : t(x.t, false) {}
- set<Key, Compare>& operator=(const set<Key, Compare>& x) {
- t = x.t;
- return *this;
- }
-
-// accessors:
-
- key_compare key_comp() const { return t.key_comp(); }
- value_compare value_comp() const { return t.key_comp(); }
- iterator begin() const { return t.begin(); }
- iterator end() const { return t.end(); }
- reverse_iterator rbegin() const { return t.rbegin(); }
- reverse_iterator rend() const { return t.rend(); }
- bool empty() const { return t.empty(); }
- size_type size() const { return t.size(); }
- size_type max_size() const { return t.max_size(); }
- void swap(set<Key, Compare>& x) { t.swap(x.t); }
-
-// insert/erase
- typedef pair<iterator, bool> pair_iterator_bool;
- // typedef done to get around compiler bug
- pair_iterator_bool insert(const value_type& x) {
- pair<rep_type::iterator, bool> p = t.insert(x);
- return pair<iterator, bool>(p.first, p.second);
- }
- iterator insert(iterator position, const value_type& x) {
- return t.insert((rep_type::iterator&)position, x);
- }
- void insert(const value_type* first, const value_type* last) {
- for (const value_type* i = first; i != last; ++i)
- t.insert(*i);
- }
- void erase(iterator position) {
- t.erase((rep_type::iterator&)position);
- }
- size_type erase(const key_type& x) {
- return t.erase(x);
- }
- void erase(iterator first, iterator last) {
- t.erase((rep_type::iterator&)first,
- (rep_type::iterator&)last);
- }
-
-// set operations:
-
- iterator find(const key_type& x) const { return t.find(x); }
- size_type count(const key_type& x) const { return t.count(x); }
- iterator lower_bound(const key_type& x) const {
- return t.lower_bound(x);
- }
- iterator upper_bound(const key_type& x) const {
- return t.upper_bound(x);
- }
- typedef pair<iterator, iterator> pair_iterator_iterator;
- // typedef done to get around compiler bug
- pair_iterator_iterator equal_range(const key_type& x) const {
- return t.equal_range(x);
- }
-};
-
-template <class Key, class Compare>
-inline bool operator==(const set<Key, Compare>& x,
- const set<Key, Compare>& y) {
- return x.size() == y.size() && equal(x.begin(), x.end(), y.begin());
-}
-
-template <class Key, class Compare>
-inline bool operator<(const set<Key, Compare>& x,
- const set<Key, Compare>& y) {
- return lexicographical_compare(x.begin(), x.end(), y.begin(), y.end());
-}
-
-#undef Allocator
-
-#endif
diff --git a/contrib/libg++/libstdc++/stl/stack.h b/contrib/libg++/libstdc++/stl/stack.h
deleted file mode 100644
index 83a59a4c2afc..000000000000
--- a/contrib/libg++/libstdc++/stl/stack.h
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef STACK_H
-#define STACK_H
-
-#ifndef __GNUG__
-#include <bool.h>
-#endif
-#include <heap.h>
-
-template <class Container>
-class stack {
-friend bool operator==(const stack<Container>& x, const stack<Container>& y);
-friend bool operator<(const stack<Container>& x, const stack<Container>& y);
-public:
- typedef Container::value_type value_type;
- typedef Container::size_type size_type;
-protected:
- Container c;
-public:
- bool empty() const { return c.empty(); }
- size_type size() const { return c.size(); }
- value_type& top() { return c.back(); }
- const value_type& top() const { return c.back(); }
- void push(const value_type& x) { c.push_back(x); }
- void pop() { c.pop_back(); }
-};
-
-template <class Container>
-bool operator==(const stack<Container>& x, const stack<Container>& y) {
- return x.c == y.c;
-}
-
-template <class Container>
-bool operator<(const stack<Container>& x, const stack<Container>& y) {
- return x.c < y.c;
-}
-
-template <class Container>
-class queue {
-friend bool operator==(const queue<Container>& x, const queue<Container>& y);
-friend bool operator<(const queue<Container>& x, const queue<Container>& y);
-public:
- typedef Container::value_type value_type;
- typedef Container::size_type size_type;
-protected:
- Container c;
-public:
- bool empty() const { return c.empty(); }
- size_type size() const { return c.size(); }
- value_type& front() { return c.front(); }
- const value_type& front() const { return c.front(); }
- value_type& back() { return c.back(); }
- const value_type& back() const { return c.back(); }
- void push(const value_type& x) { c.push_back(x); }
- void pop() { c.pop_front(); }
-};
-
-template <class Container>
-bool operator==(const queue<Container>& x, const queue<Container>& y) {
- return x.c == y.c;
-}
-
-template <class Container>
-bool operator<(const queue<Container>& x, const queue<Container>& y) {
- return x.c < y.c;
-}
-
-template <class Container, class Compare>
-// Compare = less<Container::value_type> >
-class priority_queue {
-public:
- typedef Container::value_type value_type;
- typedef Container::size_type size_type;
-protected:
- Container c;
- Compare comp;
-public:
- priority_queue(const Compare& x = Compare()) : c(), comp(x) {}
- priority_queue(const value_type* first, const value_type* last,
- const Compare& x = Compare()) : c(first, last), comp(x) {
- make_heap(c.begin(), c.end(), comp);
- }
-/*
- template <class InputIterator>
- priority_queue(InputIterator first, InputIterator last,
- const Compare& x = Compare()) : c(first, last), comp(x) {
- make_heap(c.begin(), c.end(), comp);
- }
-*/
- bool empty() const { return c.empty(); }
- size_type size() const { return c.size(); }
- value_type& top() { return c.front(); }
- const value_type& top() const { return c.front(); }
- void push(const value_type& x) {
- c.push_back(x);
- push_heap(c.begin(), c.end(), comp);
- }
- void pop() {
- pop_heap(c.begin(), c.end(), comp);
- c.pop_back();
- }
-};
-
-// no equality is provided
-
-#endif
diff --git a/contrib/libg++/libstdc++/stl/tempbuf.cc b/contrib/libg++/libstdc++/stl/tempbuf.cc
deleted file mode 100644
index 2e7408eadd30..000000000000
--- a/contrib/libg++/libstdc++/stl/tempbuf.cc
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- */
-
-#include <tempbuf.h>
-
-char __stl_temp_buffer[__stl_buffer_size];
diff --git a/contrib/libg++/libstdc++/stl/tempbuf.h b/contrib/libg++/libstdc++/stl/tempbuf.h
deleted file mode 100644
index 238b6acc31bb..000000000000
--- a/contrib/libg++/libstdc++/stl/tempbuf.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef TEMPBUF_H
-#define TEMPBUF_H
-
-#include <limits.h>
-#include <pair.h>
-
-#ifndef __stl_buffer_size
-#define __stl_buffer_size 16384 // 16k
-#endif
-
-extern char __stl_temp_buffer[__stl_buffer_size];
-
-//not reentrant code
-
-template <class T>
-pair<T*, int> get_temporary_buffer(int len, T*) {
- while (len > __stl_buffer_size / sizeof(T)) {
- set_new_handler(0);
- T* tmp = (T*)(::operator new((unsigned int)len * sizeof(T)));
- if (tmp) return pair<T*, int>(tmp, len);
- len = len / 2;
- }
- return pair<T*, int>((T*)__stl_temp_buffer,
- (int)(__stl_buffer_size / sizeof(T)));
-}
-
-template <class T>
-void return_temporary_buffer(T* p) {
- if ((char*)(p) != __stl_temp_buffer) deallocate(p);
-}
-
-template <class T>
-pair<T*, long> get_temporary_buffer(long len, T* p) {
- if (len > INT_MAX/sizeof(T))
- len = INT_MAX/sizeof(T);
- pair<T*, int> tmp = get_temporary_buffer((int)len, p);
- return pair<T*, long>(tmp.first, (long)(tmp.second));
-}
-
-#endif
diff --git a/contrib/libg++/libstdc++/stl/tree.cc b/contrib/libg++/libstdc++/stl/tree.cc
deleted file mode 100644
index e4a9cfe10fa7..000000000000
--- a/contrib/libg++/libstdc++/stl/tree.cc
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "tree.h"
-
-__rb_tree_node_base __rb_NIL = { black, 0, 0, 0 };
diff --git a/contrib/libg++/libstdc++/stl/tree.h b/contrib/libg++/libstdc++/stl/tree.h
deleted file mode 100644
index 3ae5da02b08c..000000000000
--- a/contrib/libg++/libstdc++/stl/tree.h
+++ /dev/null
@@ -1,1246 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef TREE_H
-#define TREE_H
-
-/*
-
-Red-black tree class, designed for use in implementing STL
-associative containers (set, multiset, map, and multimap). The
-insertion and deletion algorithms are based on those in Cormen,
-Leiserson, and Rivest, Introduction to Algorithms (MIT Press, 1990),
-except that
-
-(1) the header cell is maintained with links not only to the root
-but also to the leftmost node of the tree, to enable constant time
-begin(), and to the rightmost node of the tree, to enable linear time
-performance when used with the generic set algorithms (set_union,
-etc.);
-
-(2) when a node being deleted has two children its successor node is
-relinked into its place, rather than copied, so that the only
-iterators invalidated are those referring to the deleted node.
-
-*/
-
-#include <algobase.h>
-#include <iterator.h>
-#include <function.h>
-#ifndef __GNUG__
-#include <bool.h>
-#endif
-#include <projectn.h>
-
-#ifndef rb_tree
-#define rb_tree rb_tree
-#endif
-
-enum __rb_color_type {red, black};
-
-struct __rb_tree_node_base {
- enum __rb_color_type color_field;
- void* parent_link;
- void* left_link;
- void* right_link;
-};
-
-extern __rb_tree_node_base __rb_NIL;
-
-template <class Key, class Value, class KeyOfValue, class Compare>
-class rb_tree {
-protected:
- typedef enum __rb_color_type color_type;
- typedef Allocator<void>::pointer void_pointer;
- struct rb_tree_node;
- friend rb_tree_node;
- struct rb_tree_node : public __rb_tree_node_base {
- Value value_field;
- };
-#ifndef __GNUG__
- static Allocator<rb_tree_node> rb_tree_node_allocator;
- static Allocator<Value> value_allocator;
-#endif
-public:
- typedef Key key_type;
- typedef Value value_type;
- typedef Allocator<Value>::pointer pointer;
- typedef Allocator<Value>::reference reference;
- typedef Allocator<Value>::const_reference const_reference;
- typedef Allocator<rb_tree_node> rb_tree_node_allocator_type;
- typedef Allocator<rb_tree_node>::pointer link_type;
- typedef Allocator<rb_tree_node>::size_type size_type;
- typedef Allocator<rb_tree_node>::difference_type difference_type;
-protected:
-#ifndef __GNUG__
- size_type buffer_size() {
- return rb_tree_node_allocator.init_page_size();
- }
-#endif
- struct rb_tree_node_buffer;
- friend rb_tree_node_buffer;
- struct rb_tree_node_buffer {
- void_pointer next_buffer;
- link_type buffer;
- };
-public:
- typedef Allocator<rb_tree_node_buffer> buffer_allocator_type;
- typedef Allocator<rb_tree_node_buffer>::pointer buffer_pointer;
-protected:
-#ifdef __GNUG__
- static Allocator<rb_tree_node_buffer> buffer_allocator;
- static buffer_pointer buffer_list;
- static link_type free_list;
- static link_type next_avail;
- static link_type last;
- link_type get_node() { return (link_type) operator new (sizeof (rb_tree_node)); }
- void put_node(link_type p) { operator delete (p); }
-#else
- void add_new_buffer() {
- buffer_pointer tmp = buffer_allocator.allocate((size_type)1);
- tmp->buffer = rb_tree_node_allocator.allocate(buffer_size());
- tmp->next_buffer = buffer_list;
- buffer_list = tmp;
- next_avail = buffer_list->buffer;
- last = next_avail + buffer_size();
- }
- static size_type number_of_trees;
- void deallocate_buffers();
- link_type get_node() {
- link_type tmp = free_list;
- return free_list ?
- (free_list = (link_type)(free_list->right_link), tmp)
- : (next_avail == last ? (add_new_buffer(), next_avail++)
- : next_avail++);
- // ugly code for inlining - avoids multiple returns
- }
- void put_node(link_type p) {
- p->right_link = free_list;
- free_list = p;
- }
-#endif
-protected:
- link_type header;
- link_type& root() { return parent(header); }
- link_type& root() const { return parent(header); }
- link_type& leftmost() { return left(header); }
- link_type& leftmost() const { return left(header); }
- link_type& rightmost() { return right(header); }
- link_type& rightmost() const { return right(header); }
- size_type node_count; // keeps track of size of tree
- bool insert_always; // controls whether an element already in the
- // tree is inserted again
-//public:
- Compare key_compare;
- static link_type& left(link_type x) {
- return (link_type&)((*x).left_link);
- }
- static link_type& right(link_type x) {
- return (link_type&)((*x).right_link);
- }
- static link_type& parent(link_type x) {
- return (link_type&)((*x).parent_link);
- }
- static reference value(link_type x) { return (*x).value_field; }
- static Allocator<Key>::const_reference key(link_type x) {
- return KeyOfValue()(value(x));
- }
- static color_type& color(link_type x) {
- return (color_type&)(*x).color_field; }
- static link_type minimum(link_type x) {
- while (left(x) != &__rb_NIL)
- x = left(x);
- return x;
- }
- static link_type maximum(link_type x) {
- while (right(x) != &__rb_NIL)
- x = right(x);
- return x;
- }
-public:
- class iterator;
- friend iterator;
- class const_iterator;
- friend const_iterator;
- class iterator : public bidirectional_iterator<Value, difference_type> {
- friend class rb_tree<Key, Value, KeyOfValue, Compare>;
- friend class const_iterator;
-/*
- friend bool operator==(const iterator& x, const iterator& y) {
- return x.node == y.node;
- }
-*/
- protected:
- link_type node;
- iterator(link_type x) : node(x) {}
- public:
- iterator() {}
- bool operator==(const iterator& y) const { return node == y.node; }
- reference operator*() const { return value(node); }
- iterator& operator++() {
- if (right(node) != &__rb_NIL) {
- node = right(node);
- while (left(node) != &__rb_NIL)
- node = left(node);
- } else {
- link_type y = parent(node);
- while (node == right(y)) {
- node = y;
- y = parent(y);
- }
- if (right(node) != y) // necessary because of rightmost
- node = y;
- }
- return *this;
- }
- iterator operator++(int) {
- iterator tmp = *this;
- ++*this;
- return tmp;
- }
- iterator& operator--() {
- if (color(node) == red && parent(parent(node)) == node)
- // check for header
- node = right(node); // return rightmost
- else if (left(node) != &__rb_NIL) {
- link_type y = left(node);
- while (right(y) != &__rb_NIL)
- y = right(y);
- node = y;
- } else {
- link_type y = parent(node);
- while (node == left(y)) {
- node = y;
- y = parent(y);
- }
- node = y;
- }
- return *this;
- }
- iterator operator--(int) {
- iterator tmp = *this;
- --*this;
- return tmp;
- }
- };
- class const_iterator
- : public bidirectional_iterator<Value,difference_type> {
- friend class rb_tree<Key, Value, KeyOfValue, Compare>;
- friend class iterator;
-/*
- friend bool operator==(const const_iterator& x, const const_iterator& y) {
- return x.node == y.node;
- }
-*/
- protected:
- link_type node;
- const_iterator(link_type x) : node(x) {}
- public:
- const_iterator() {}
- const_iterator(const iterator& x) : node(x.node) {}
- bool operator==(const const_iterator& y) const {
- return node == y.node;
- }
- bool operator!=(const const_iterator& y) const {
- return node != y.node;
- }
- const_reference operator*() const { return value(node); }
- const_iterator& operator++() {
- if (right(node) != &__rb_NIL) {
- node = right(node);
- while (left(node) != &__rb_NIL)
- node = left(node);
- } else {
- link_type y = parent(node);
- while (node == right(y)) {
- node = y;
- y = parent(y);
- }
- if (right(node) != y) // necessary because of rightmost
- node = y;
- }
- return *this;
- }
- const_iterator operator++(int) {
- const_iterator tmp = *this;
- ++*this;
- return tmp;
- }
- const_iterator& operator--() {
- if (color(node) == red && parent(parent(node)) == node)
- // check for header
- node = right(node); // return rightmost
- else if (left(node) != &__rb_NIL) {
- link_type y = left(node);
- while (right(y) != &__rb_NIL)
- y = right(y);
- node = y;
- } else {
- link_type y = parent(node);
- while (node == left(y)) {
- node = y;
- y = parent(y);
- }
- node = y;
- }
- return *this;
- }
- const_iterator operator--(int) {
- const_iterator tmp = *this;
- --*this;
- return tmp;
- }
- };
- typedef reverse_bidirectional_iterator<iterator, value_type, reference,
- difference_type>
- reverse_iterator;
- typedef reverse_bidirectional_iterator<const_iterator, value_type,
- const_reference, difference_type>
- const_reverse_iterator;
-private:
-#ifdef __GNUC__
- rb_tree_iterator<Key, Value, KeyOfValue, Compare> __insert(void* x, void* y, const value_type& v);
- link_type __copy(link_type x, link_type p) {
- return (link_type) __copy_hack (x, p);
- }
-private:
- void * __copy_hack (void *, void *);
-public:
- void __erase(void* x);
-#else
- iterator __insert(link_type x, link_type y, const value_type& v);
- link_type __copy(link_type x, link_type p);
- void __erase(link_type x);
-#endif
- void init() {
-#ifndef __GNUG__
- ++number_of_trees;
-#endif
- header = get_node();
- color(header) = red; // used to distinguish header from root,
- // in iterator.operator++
- header->parent_link = &__rb_NIL;
- leftmost() = header;
- rightmost() = header;
- }
-public:
-
-// allocation/deallocation
-
- rb_tree(const Compare& comp = Compare(), bool always = true)
- : node_count(0), insert_always(always), key_compare(comp) {
- init();
- }
- rb_tree(const value_type* first, const value_type* last,
- const Compare& comp = Compare(), bool always = true)
- : node_count(0), insert_always(always), key_compare(comp) {
- init();
- insert(first, last);
- }
- rb_tree(const rb_tree<Key, Value, KeyOfValue, Compare>& x,
- bool always = true) : node_count(x.node_count),
- insert_always(always), key_compare(x.key_compare) {
-#ifndef __GNUG__
- ++number_of_trees;
-#endif
- header = get_node();
- color(header) = red;
- root() = __copy(x.root(), header);
- if (root() == &__rb_NIL) {
- leftmost() = header;
- rightmost() = header;
- } else {
- leftmost() = minimum(root());
- rightmost() = maximum(root());
- }
- }
- ~rb_tree() {
- erase(begin(), end());
- put_node(header);
-#ifndef __GNUG__
- if (--number_of_trees == 0) {
- deallocate_buffers();
- free_list = 0;
- next_avail = 0;
- last = 0;
- }
-#endif
- }
- rb_tree<Key, Value, KeyOfValue, Compare>&
- operator=(const rb_tree<Key, Value, KeyOfValue, Compare>& x);
-
-// accessors:
-
- Compare key_comp() const { return key_compare; }
- iterator begin() { return leftmost(); }
- const_iterator begin() const { return leftmost(); }
- iterator end() { return header; }
- const_iterator end() const { return header; }
- reverse_iterator rbegin() { return reverse_iterator(end()); }
- const_reverse_iterator rbegin() const {
- return const_reverse_iterator(end());
- }
- reverse_iterator rend() { return reverse_iterator(begin()); }
- const_reverse_iterator rend() const {
- return const_reverse_iterator(begin());
- }
- bool empty() const { return node_count == 0; }
- size_type size() const { return node_count; }
-#ifndef __GNUG__
- size_type max_size() const {
- return rb_tree_node_allocator.max_size();
- }
-#else
- size_type max_size() const {
- return rb_tree_node_allocator_type::max_size();
- }
-#endif
- void swap(rb_tree<Key, Value, KeyOfValue, Compare>& t) {
- ::swap(header, t.header);
- ::swap(node_count, t.node_count);
- ::swap(insert_always, t.insert_always);
- ::swap(key_compare, t.key_compare);
- }
-
-// insert/erase
-
- typedef pair<iterator, bool> pair_iterator_bool;
- // typedef done to get around compiler bug
-#ifdef __GNUG__
- pair_iterator_bool insert(const value_type& x) {
- return insert_hack(x);
- }
-private:
- rb_tree_pair_iterator_bool<Key, Value, KeyOfValue, Compare>
- insert_hack(const Value& v);
-public:
- iterator insert(iterator position, const value_type& x) {
- return insert_hack(position, x);
- }
-private:
- rb_tree_iterator<Key, Value, KeyOfValue, Compare>
- insert_hack(rb_tree_iterator<Key, Value, KeyOfValue, Compare> posn,
- const Value& v);
-public:
- void insert(iterator first, iterator last) {
- while (first != last) insert(*first++);
- }
- void insert(const value_type* first, const value_type* last){
- while (first != last) insert(*first++);
- }
- void erase(iterator position) {
- erase_hack(position);
- }
-private:
- void erase_hack(rb_tree_iterator<Key, Value, KeyOfValue, Compare> position);
-public:
- size_type erase(const key_type& x);
- void erase(iterator first, iterator last) {
- while (first != last) erase(first++);
- }
-#else
- pair_iterator_bool insert(const value_type& x);
- iterator insert(iterator position, const value_type& x);
- void insert(iterator first, iterator last);
- void insert(const value_type* first, const value_type* last);
- void erase(iterator position);
- size_type erase(const key_type& x);
- void erase(iterator first, iterator last);
-#endif
- void erase(const key_type* first, const key_type* last);
-
-// set operations:
-
-#ifdef __GNUG__
- iterator find(const key_type& x) {
- return find_hack(x);
- }
- const_iterator find(const key_type& x) const {
- return find_hack(x);
- }
-private:
- rb_tree_iterator<Key, Value, KeyOfValue, Compare>
- find_hack(const key_type& x);
- rb_tree_const_iterator<Key, Value, KeyOfValue, Compare>
- find_hack(const Key& k) const;
-public:
-
- size_type count(const key_type& x) const;
- iterator lower_bound(const key_type& x) {
- return lower_bound_hack(x);
- }
- const_iterator lower_bound(const key_type& x) const {
- return lower_bound_hack(x);
- }
- iterator upper_bound(const key_type& x) {
- return upper_bound_hack(x);
- }
- const_iterator upper_bound(const key_type& x) const {
- return upper_bound_hack(x);
- }
-private:
- rb_tree_iterator<Key, Value, KeyOfValue, Compare>
- lower_bound_hack(const key_type& x);
- rb_tree_const_iterator<Key, Value, KeyOfValue, Compare>
- lower_bound_hack(const Key& k) const;
- rb_tree_iterator<Key, Value, KeyOfValue, Compare>
- upper_bound_hack(const key_type& x);
- rb_tree_const_iterator<Key, Value, KeyOfValue, Compare>
- upper_bound_hack(const Key& k) const;
-public:
- typedef pair<iterator, iterator> pair_iterator_iterator;
- // typedef done to get around compiler bug
- pair_iterator_iterator equal_range(const key_type& x) {
- return pair_iterator_iterator(lower_bound(x), upper_bound(x));
- }
- typedef pair<const_iterator, const_iterator> pair_citerator_citerator;
-
- // typedef done to get around compiler bug
- pair_citerator_citerator equal_range(const key_type& x) const {
- return pair_citerator_citerator(lower_bound(x), upper_bound(x));
- }
- inline void rotate_left(link_type x) {
- link_type y = right(x);
- right(x) = left(y);
- if (left(y) != &__rb_NIL)
- parent(left(y)) = x;
- parent(y) = parent(x);
- if (x == root())
- root() = y;
- else if (x == left(parent(x)))
- left(parent(x)) = y;
- else
- right(parent(x)) = y;
- left(y) = x;
- parent(x) = y;
- }
-
- inline void rotate_right(link_type x) {
- link_type y = left(x);
- left(x) = right(y);
- if (right(y) != &__rb_NIL)
- parent(right(y)) = x;
- parent(y) = parent(x);
- if (x == root())
- root() = y;
- else if (x == right(parent(x)))
- right(parent(x)) = y;
- else
- left(parent(x)) = y;
- right(y) = x;
- parent(x) = y;
- }
- friend bidirectional_iterator_tag iterator_category(iterator) {
- return bidirectional_iterator_tag();
- }
- friend bidirectional_iterator_tag iterator_category(const_iterator) {
- return bidirectional_iterator_tag();
- }
-#else
- iterator find(const key_type& x);
- const_iterator find(const key_type& x) const;
- size_type count(const key_type& x) const;
- iterator lower_bound(const key_type& x);
- const_iterator lower_bound(const key_type& x) const;
- iterator upper_bound(const key_type& x);
- const_iterator upper_bound(const key_type& x) const;
- typedef pair<iterator, iterator> pair_iterator_iterator;
- // typedef done to get around compiler bug
- pair_iterator_iterator equal_range(const key_type& x);
- typedef pair<const_iterator, const_iterator> pair_citerator_citerator;
- // typedef done to get around compiler bug
- pair_citerator_citerator equal_range(const key_type& x) const;
- inline void rotate_left(link_type x);
- inline void rotate_right(link_type x);
-#endif
-};
-
-#ifndef __GNUG__
-template <class Key, class Value, class KeyOfValue, class Compare>
-rb_tree<Key, Value, KeyOfValue, Compare>::buffer_pointer
- rb_tree<Key, Value, KeyOfValue, Compare>::buffer_list = 0;
-
-template <class Key, class Value, class KeyOfValue, class Compare>
-rb_tree<Key, Value, KeyOfValue, Compare>::link_type
- rb_tree<Key, Value, KeyOfValue, Compare>::free_list = 0;
-
-template <class Key, class Value, class KeyOfValue, class Compare>
-rb_tree<Key, Value, KeyOfValue, Compare>::link_type
- rb_tree<Key, Value, KeyOfValue, Compare>::next_avail = 0;
-
-template <class Key, class Value, class KeyOfValue, class Compare>
-rb_tree<Key, Value, KeyOfValue, Compare>::link_type
- rb_tree<Key, Value, KeyOfValue, Compare>::last = 0;
-
-template <class Key, class Value, class KeyOfValue, class Compare>
-rb_tree<Key, Value, KeyOfValue, Compare>::size_type
- rb_tree<Key, Value, KeyOfValue, Compare>::number_of_trees = 0;
-
-template <class Key, class Value, class KeyOfValue, class Compare>
-rb_tree<Key, Value, KeyOfValue, Compare>::rb_tree_node_allocator_type
- rb_tree<Key, Value, KeyOfValue, Compare>::rb_tree_node_allocator;
-
-template <class Key, class Value, class KeyOfValue, class Compare>
-Allocator<Value> rb_tree<Key, Value, KeyOfValue, Compare>::value_allocator;
-
-template <class Key, class Value, class KeyOfValue, class Compare>
-rb_tree<Key, Value, KeyOfValue, Compare>::buffer_allocator_type
- rb_tree<Key, Value, KeyOfValue, Compare>::buffer_allocator;
-
-template <class Key, class Value, class KeyOfValue, class Compare>
-void rb_tree<Key, Value, KeyOfValue, Compare>::deallocate_buffers() {
- while (buffer_list) {
- buffer_pointer tmp = buffer_list;
- buffer_list = (buffer_pointer)(buffer_list->next_buffer);
- rb_tree_node_allocator.deallocate(tmp->buffer);
- buffer_allocator.deallocate(tmp);
- }
-}
-#endif
-
-#ifdef __GNUC__
-template <class Key, class Value, class KeyOfValue, class Compare>
-struct rb_tree_iterator {
- rb_tree<Key, Value, KeyOfValue, Compare>::iterator it;
- rb_tree_iterator(rb_tree<Key, Value, KeyOfValue, Compare>::iterator i) : it(i) {}
- operator rb_tree<Key, Value, KeyOfValue, Compare>::iterator() {
- return it;
- }
-};
-
-template <class Key, class Value, class KeyOfValue, class Compare>
-inline Value* value_type(const rb_tree_iterator<Key, Value, KeyOfValue, Compare>&) {
- return (Value*)(0);
-}
-
-template <class Key, class Value, class KeyOfValue, class Compare>
-struct rb_tree_const_iterator {
- rb_tree<Key, Value, KeyOfValue, Compare>::const_iterator it;
- rb_tree_const_iterator(rb_tree<Key, Value, KeyOfValue, Compare>::const_iterator i) : it(i) {}
- operator rb_tree<Key, Value, KeyOfValue, Compare>::const_iterator() {
- return it;
- }
-};
-
-template <class Key, class Value, class KeyOfValue, class Compare>
-inline Value* value_type(const rb_tree_const_iterator<Key, Value, KeyOfValue, Compare>&) {
- return (Value*)(0);
-}
-
-template <class Key, class Value, class KeyOfValue, class Compare>
-struct rb_tree_pair_iterator_bool {
- rb_tree<Key, Value, KeyOfValue, Compare>::pair_iterator_bool it;
- rb_tree_pair_iterator_bool(rb_tree<Key, Value, KeyOfValue, Compare>::pair_iterator_bool i) : it(i) {}
- operator rb_tree<Key, Value, KeyOfValue, Compare>::pair_iterator_bool() {
- return it;
- }
-};
-
-template <class Key, class Value, class KeyOfValue, class Compare>
-inline Value* value_type(rb_tree_pair_iterator_bool<Key, Value, KeyOfValue, Compare>&) {
- return (Value*)(0);
-}
-#endif
-
-template <class Key, class Value, class KeyOfValue, class Compare>
-inline bool operator==(const rb_tree<Key, Value, KeyOfValue, Compare>& x,
- const rb_tree<Key, Value, KeyOfValue, Compare>& y) {
- return x.size() == y.size() && equal(x.begin(), x.end(), y.begin());
-}
-
-template <class Key, class Value, class KeyOfValue, class Compare>
-inline bool operator<(const rb_tree<Key, Value, KeyOfValue, Compare>& x,
- const rb_tree<Key, Value, KeyOfValue, Compare>& y) {
- return lexicographical_compare(x.begin(), x.end(), y.begin(), y.end());
-}
-
-template <class Key, class Value, class KeyOfValue, class Compare>
-rb_tree<Key, Value, KeyOfValue, Compare>&
-rb_tree<Key, Value, KeyOfValue, Compare>::
-operator=(const rb_tree<Key, Value, KeyOfValue, Compare>& x) {
- if (this != &x) {
- // can't be done as in list because Key may be a constant type
- erase(begin(), end());
- root() = __copy(x.root(), header);
- if (root() == &__rb_NIL) {
- leftmost() = header;
- rightmost() = header;
- } else {
- leftmost() = minimum(root());
- rightmost() = maximum(root());
- }
- node_count = x.node_count;
- }
- return *this;
-}
-
-template <class Key, class Value, class KeyOfValue, class Compare>
-#ifdef __GNUC__
-rb_tree_iterator<Key, Value, KeyOfValue, Compare>
-rb_tree<Key, Value, KeyOfValue, Compare>::__insert
-(void* xa, void* ya, const Value& v) {
- link_type x = (link_type)xa;
- link_type y = (link_type)ya;
-#else
-rb_tree<Key, Value, KeyOfValue, Compare>::iterator
-rb_tree<Key, Value, KeyOfValue, Compare>::
-__insert(link_type x, link_type y, const Value& v) {
-#endif
- ++node_count;
- link_type z = get_node();
-#ifdef __GNUG__
- construct(&(value(z)), v);
-#else
- construct(value_allocator.address(value(z)), v);
-#endif
- if (y == header || x != &__rb_NIL || key_compare(KeyOfValue()(v), key(y))) {
- left(y) = z; // also makes leftmost() = z when y == header
- if (y == header) {
- root() = z;
- rightmost() = z;
- } else if (y == leftmost())
- leftmost() = z; // maintain leftmost() pointing to minimum node
- } else {
- right(y) = z;
- if (y == rightmost())
- rightmost() = z; // maintain rightmost() pointing to maximum node
- }
- parent(z) = y;
- z->left_link = &__rb_NIL;
- z->right_link = &__rb_NIL;
- x = z; // recolor and rebalance the tree
- color(x) = red;
- while (x != root() && color(parent(x)) == red)
- if (parent(x) == left(parent(parent(x)))) {
- y = right(parent(parent(x)));
- if (color(y) == red) {
- color(parent(x)) = black;
- color(y) = black;
- color(parent(parent(x))) = red;
- x = parent(parent(x));
- } else {
- if (x == right(parent(x))) {
- x = parent(x);
- rotate_left(x);
- }
- color(parent(x)) = black;
- color(parent(parent(x))) = red;
- rotate_right(parent(parent(x)));
- }
- } else {
- y = left(parent(parent(x)));
- if (color(y) == red) {
- color(parent(x)) = black;
- color(y) = black;
- color(parent(parent(x))) = red;
- x = parent(parent(x));
- } else {
- if (x == left(parent(x))) {
- x = parent(x);
- rotate_right(x);
- }
- color(parent(x)) = black;
- color(parent(parent(x))) = red;
- rotate_left(parent(parent(x)));
- }
- }
- color(root()) = black;
- return iterator(z);
-}
-
-template <class Key, class Value, class KeyOfValue, class Compare>
-#ifdef __GNUC__
-rb_tree_pair_iterator_bool<Key, Value, KeyOfValue, Compare>
-rb_tree<Key, Value, KeyOfValue, Compare>::insert_hack(const Value& v) {
-#else
-rb_tree<Key, Value, KeyOfValue, Compare>::pair_iterator_bool
-rb_tree<Key, Value, KeyOfValue, Compare>::insert(const Value& v) {
-#endif
- link_type y = header;
- link_type x = root();
- bool comp = true;
- while (x != &__rb_NIL) {
- y = x;
- comp = key_compare(KeyOfValue()(v), key(x));
- x = comp ? left(x) : right(x);
- }
- if (insert_always)
- return pair_iterator_bool(__insert(x, y, v), true);
- iterator j = iterator(y);
- if (comp)
- if (j == begin())
- return pair_iterator_bool(__insert(x, y, v), true);
- else
- --j;
- if (key_compare(key(j.node), KeyOfValue()(v)))
- return pair_iterator_bool(__insert(x, y, v), true);
- return pair_iterator_bool(j, false);
-}
-
-template <class Key, class Value, class KeyOfValue, class Compare>
-#ifdef __GNUC__
-rb_tree_iterator<Key, Value, KeyOfValue, Compare>
-rb_tree<Key, Value, KeyOfValue, Compare>::insert_hack(rb_tree_iterator<Key, Value, KeyOfValue, Compare> posn,
- const Value& v) {
- iterator position = posn;
-#else
-rb_tree<Key, Value, KeyOfValue, Compare>::iterator
-rb_tree<Key, Value, KeyOfValue, Compare>::insert(iterator position,
- const Value& v) {
-#endif
- if (position == iterator(begin()))
- if (size() > 0 && key_compare(KeyOfValue()(v), key(position.node)))
- return __insert(position.node, position.node, v);
- // first argument just needs to be non-&__rb_NIL
- else
- return insert(v).first;
- else if (position == iterator(end()))
- if (key_compare(key(rightmost()), KeyOfValue()(v)))
- return __insert(&__rb_NIL, rightmost(), v);
- else
- return insert(v).first;
- else {
- iterator before = --position;
- if (key_compare(key(before.node), KeyOfValue()(v))
- && key_compare(KeyOfValue()(v), key(position.node)))
- if (right(before.node) == &__rb_NIL)
- return __insert(&__rb_NIL, before.node, v);
- else
- return __insert(position.node, position.node, v);
- // first argument just needs to be non-&__rb_NIL
- else
- return insert(v).first;
- }
-}
-
-#ifndef __GNUC__
-template <class Key, class Value, class KeyOfValue, class Compare>
-void rb_tree<Key, Value, KeyOfValue, Compare>::insert(iterator first,
- iterator last) {
- while (first != last) insert(*first++);
-}
-
-template <class Key, class Value, class KeyOfValue, class Compare>
-void rb_tree<Key, Value, KeyOfValue, Compare>::insert(const Value* first,
- const Value* last) {
- while (first != last) insert(*first++);
-}
-#endif
-
-template <class Key, class Value, class KeyOfValue, class Compare>
-#ifdef __GNUC__
-void rb_tree<Key, Value, KeyOfValue, Compare>::erase_hack(
- rb_tree_iterator<Key, Value, KeyOfValue, Compare> posn) {
- iterator position = posn;
-#else
-void rb_tree<Key, Value, KeyOfValue, Compare>::erase(iterator position) {
-#endif
- link_type z = position.node;
- link_type y = z;
- link_type x;
- if (left(y) == &__rb_NIL)
- x = right(y);
- else
- if (right(y) == &__rb_NIL)
- x = left(y);
- else {
- y = right(y);
- while (left(y) != &__rb_NIL)
- y = left(y);
- x = right(y);
- }
- if (y != z) { // relink y in place of z
- parent(left(z)) = y;
- left(y) = left(z);
- if (y != right(z)) {
- parent(x) = parent(y); // possibly x == &__rb_NIL
- left(parent(y)) = x; // y must be a left child
- right(y) = right(z);
- parent(right(z)) = y;
- } else
- parent(x) = y; // needed in case x == &__rb_NIL
- if (root() == z)
- root() = y;
- else if (left(parent(z)) == z)
- left(parent(z)) = y;
- else
- right(parent(z)) = y;
- parent(y) = parent(z);
- ::swap(color(y), color(z));
- ::swap(y, z);
- // y points to node to be actually deleted,
- // z points to old z's former successor
- } else { // y == z
- parent(x) = parent(y); // possibly x == &__rb_NIL
- if (root() == z)
- root() = x;
- else
- if (left(parent(z)) == z)
- left(parent(z)) = x;
- else
- right(parent(z)) = x;
- if (leftmost() == z)
- if (right(z) == &__rb_NIL) // left(z) must be &__rb_NIL also
- leftmost() = parent(z);
- // makes leftmost() == header if z == root()
- else
- leftmost() = minimum(x);
- if (rightmost() == z)
- if (left(z) == &__rb_NIL) // right(z) must be &__rb_NIL also
- rightmost() = parent(z);
- // makes rightmost() == header if z == root()
- else // x == left(z)
- rightmost() = maximum(x);
- }
- if (color(y) != red) {
- while (x != root() && color(x) == black)
- if (x == left(parent(x))) {
- link_type w = right(parent(x));
- if (color(w) == red) {
- color(w) = black;
- color(parent(x)) = red;
- rotate_left(parent(x));
- w = right(parent(x));
- }
- if (color(left(w)) == black && color(right(w)) == black) {
- color(w) = red;
- x = parent(x);
- } else {
- if (color(right(w)) == black) {
- color(left(w)) = black;
- color(w) = red;
- rotate_right(w);
- w = right(parent(x));
- }
- color(w) = color(parent(x));
- color(parent(x)) = black;
- color(right(w)) = black;
- rotate_left(parent(x));
- break;
- }
- } else { // same as then clause with "right" and "left" exchanged
- link_type w = left(parent(x));
- if (color(w) == red) {
- color(w) = black;
- color(parent(x)) = red;
- rotate_right(parent(x));
- w = left(parent(x));
- }
- if (color(right(w)) == black && color(left(w)) == black) {
- color(w) = red;
- x = parent(x);
- } else {
- if (color(left(w)) == black) {
- color(right(w)) = black;
- color(w) = red;
- rotate_left(w);
- w = left(parent(x));
- }
- color(w) = color(parent(x));
- color(parent(x)) = black;
- color(left(w)) = black;
- rotate_right(parent(x));
- break;
- }
- }
- color(x) = black;
- }
-#ifdef __GNUG__
- delete y;
-#else
- destroy(value_allocator.address(value(y)));
- put_node(y);
-#endif
- --node_count;
-}
-
-template <class Key, class Value, class KeyOfValue, class Compare>
-#ifdef __GNUC__
-#ifndef __SIZE_TYPE__
-#define __SIZE_TYPE__ long unsigned int
-#endif
-__SIZE_TYPE__
-#else
-rb_tree<Key, Value, KeyOfValue, Compare>::size_type
-#endif
-rb_tree<Key, Value, KeyOfValue, Compare>::erase(const Key& x) {
- pair_iterator_iterator p = equal_range(x);
- size_type n = 0;
- distance(p.first, p.second, n);
- erase(p.first, p.second);
- return n;
-}
-
-template <class Key, class Value, class KeyOfValue, class Compare>
-#ifdef __GNUG__
-void *
-rb_tree<Key, Value, KeyOfValue, Compare>::__copy_hack(void* xa, void* pa) {
- link_type x = (link_type)xa;
- link_type p = (link_type)pa;
-#else
-rb_tree<Key, Value, KeyOfValue, Compare>::link_type
-rb_tree<Key, Value, KeyOfValue, Compare>::__copy(link_type x, link_type p) {
-#endif
- // structural copy
- link_type r = x;
- while (x != &__rb_NIL) {
- link_type y = get_node();
- if (r == x) r = y; // save for return value
-#ifdef __GNUG__
- construct(&(value(y)), value(x));
-#else
- construct(value_allocator.address(value(y)), value(x));
-#endif
- left(p) = y;
- parent(y) = p;
- color(y) = color(x);
- right(y) = __copy(right(x), y);
- p = y;
- x = left(x);
- }
- left(p) = (link_type)&__rb_NIL;
- return r;
-}
-
-template <class Key, class Value, class KeyOfValue, class Compare>
-#ifdef __GNUG__
-void rb_tree<Key, Value, KeyOfValue, Compare>::__erase(void* xa) {
- link_type x = (link_type)xa;
-#else
-void rb_tree<Key, Value, KeyOfValue, Compare>::__erase(link_type x) {
-#endif
- // erase without rebalancing
- while (x != &__rb_NIL) {
- __erase(right(x));
- link_type y = left(x);
-#ifdef __GNUG__
- delete x;
-#else
- destroy(value_allocator.address(value(x)));
- put_node(x);
-#endif
- x = y;
- }
-}
-
-#ifndef __GNUC__
-template <class Key, class Value, class KeyOfValue, class Compare>
-void rb_tree<Key, Value, KeyOfValue, Compare>::erase(iterator first,
- iterator last) {
- if (first == begin() && last == end() && node_count != 0) {
- __erase(root());
- leftmost() = header;
- root() = NIL;
- rightmost() = header;
- node_count = 0;
- } else
- while (first != last) erase(first++);
-}
-#endif
-
-template <class Key, class Value, class KeyOfValue, class Compare>
-void rb_tree<Key, Value, KeyOfValue, Compare>::erase(const Key* first,
- const Key* last) {
- while (first != last) erase(*first++);
-}
-
-template <class Key, class Value, class KeyOfValue, class Compare>
-#ifdef __GNUC__
-rb_tree_iterator<Key, Value, KeyOfValue, Compare>
-rb_tree<Key, Value, KeyOfValue, Compare>::find_hack(const Key& k) {
-#else
-rb_tree<Key, Value, KeyOfValue, Compare>::iterator
-rb_tree<Key, Value, KeyOfValue, Compare>::find(const Key& k) {
-#endif
- link_type y = header;
- link_type x = root();
- bool comp = false;
- while (x != &__rb_NIL) {
- y = x;
- comp = key_compare(key(x), k);
- x = comp ? right(x) : left(x);
- }
- iterator j = iterator(y);
- if (comp) ++j;
- return (j == end() || key_compare(k, key(j.node))) ? end() : j;
-}
-
-template <class Key, class Value, class KeyOfValue, class Compare>
-#ifdef __GNUC__
-rb_tree_const_iterator<Key, Value, KeyOfValue, Compare>
-rb_tree<Key, Value, KeyOfValue, Compare>::find_hack(const Key& k) const {
-#else
-rb_tree<Key, Value, KeyOfValue, Compare>::const_iterator
-rb_tree<Key, Value, KeyOfValue, Compare>::find(const Key& k) const {
-#endif
- link_type y = header;
- link_type x = root();
- bool comp = false;
- while (x != &__rb_NIL) {
- y = x;
- comp = key_compare(key(x), k);
- x = comp ? right(x) : left(x);
- }
- const_iterator j = const_iterator(y);
- if (comp) ++j;
- return (j == end() || key_compare(k, key(j.node))) ? end() : j;
-}
-
-template <class Key, class Value, class KeyOfValue, class Compare>
-#ifdef __GNUG__
-__SIZE_TYPE__
-#else
-rb_tree<Key, Value, KeyOfValue, Compare>::size_type
-#endif
-rb_tree<Key, Value, KeyOfValue, Compare>::count(const Key& k) const {
- pair<const_iterator, const_iterator> p = equal_range(k);
- size_type n = 0;
- distance(p.first, p.second, n);
- return n;
-}
-
-template <class Key, class Value, class KeyOfValue, class Compare>
-#ifdef __GNUC__
-rb_tree_iterator<Key, Value, KeyOfValue, Compare>
-rb_tree<Key, Value, KeyOfValue, Compare>::lower_bound_hack(const Key& k) {
-#else
-rb_tree<Key, Value, KeyOfValue, Compare>::iterator
-rb_tree<Key, Value, KeyOfValue, Compare>::lower_bound(const Key& k) {
-#endif
- link_type y = header;
- link_type x = root();
- bool comp = false;
- while (x != &__rb_NIL) {
- y = x;
- comp = key_compare(key(x), k);
- x = comp ? right(x) : left(x);
- }
- iterator j = iterator(y);
- return comp ? ++j : j;
-}
-
-template <class Key, class Value, class KeyOfValue, class Compare>
-#ifdef __GNUC__
-rb_tree_const_iterator<Key, Value, KeyOfValue, Compare>
-rb_tree<Key, Value, KeyOfValue, Compare>::lower_bound_hack(const Key& k) const {
-#else
-rb_tree<Key, Value, KeyOfValue, Compare>::const_iterator
-rb_tree<Key, Value, KeyOfValue, Compare>::lower_bound(const Key& k) const {
-#endif
- link_type y = header;
- link_type x = root();
- bool comp = false;
- while (x != &__rb_NIL) {
- y = x;
- comp = key_compare(key(x), k);
- x = comp ? right(x) : left(x);
- }
- const_iterator j = const_iterator(y);
- return comp ? ++j : j;
-}
-
-template <class Key, class Value, class KeyOfValue, class Compare>
-#ifdef __GNUC__
-rb_tree_iterator<Key, Value, KeyOfValue, Compare>
-rb_tree<Key, Value, KeyOfValue, Compare>::upper_bound_hack(const Key& k) {
-#else
-rb_tree<Key, Value, KeyOfValue, Compare>::iterator
-rb_tree<Key, Value, KeyOfValue, Compare>::upper_bound(const Key& k) {
-#endif
- link_type y = header;
- link_type x = root();
- bool comp = true;
- while (x != &__rb_NIL) {
- y = x;
- comp = key_compare(k, key(x));
- x = comp ? left(x) : right(x);
- }
- iterator j = iterator(y);
- return comp ? j : ++j;
-}
-
-template <class Key, class Value, class KeyOfValue, class Compare>
-#ifdef __GNUC__
-rb_tree_const_iterator<Key, Value, KeyOfValue, Compare>
-rb_tree<Key, Value, KeyOfValue, Compare>::upper_bound_hack(const Key& k) const {
-#else
-rb_tree<Key, Value, KeyOfValue, Compare>::const_iterator
-rb_tree<Key, Value, KeyOfValue, Compare>::upper_bound(const Key& k) const {
-#endif
- link_type y = header;
- link_type x = root();
- bool comp = true;
- while (x != &__rb_NIL) {
- y = x;
- comp = key_compare(k, key(x));
- x = comp ? left(x) : right(x);
- }
- const_iterator j = const_iterator(y);
- return comp ? j : ++j;
-}
-
-
-#ifndef __GNUC__
-template <class Key, class Value, class KeyOfValue, class Compare>
-rb_tree<Key, Value, KeyOfValue, Compare>::pair_iterator_iterator
-rb_tree<Key, Value, KeyOfValue, Compare>::equal_range(const Key& k) {
- return pair_iterator_iterator(lower_bound(k), upper_bound(k));
-}
-
-template <class Key, class Value, class KeyOfValue, class Compare>
-rb_tree<Key, Value, KeyOfValue, Compare>::pair_citerator_citerator
-rb_tree<Key, Value, KeyOfValue, Compare>::equal_range(const Key& k) const {
- return pair_citerator_citerator(lower_bound(k), upper_bound(k));
-}
-
-template <class Key, class Value, class KeyOfValue, class Compare>
-inline void
-rb_tree<Key, Value, KeyOfValue, Compare>::rotate_left(link_type x) {
- link_type y = right(x);
- right(x) = left(y);
- if (left(y) != &__rb_NIL)
- parent(left(y)) = x;
- parent(y) = parent(x);
- if (x == root())
- root() = y;
- else if (x == left(parent(x)))
- left(parent(x)) = y;
- else
- right(parent(x)) = y;
- left(y) = x;
- parent(x) = y;
-}
-
-template <class Key, class Value, class KeyOfValue, class Compare>
-inline void
-rb_tree<Key, Value, KeyOfValue, Compare>::rotate_right(link_type x) {
- link_type y = left(x);
- left(x) = right(y);
- if (right(y) != &__rb_NIL)
- parent(right(y)) = x;
- parent(y) = parent(x);
- if (x == root())
- root() = y;
- else if (x == right(parent(x)))
- right(parent(x)) = y;
- else
- left(parent(x)) = y;
- right(y) = x;
- parent(x) = y;
-}
-#endif
-
-#endif
-
diff --git a/contrib/libg++/libstdc++/stl/vector.h b/contrib/libg++/libstdc++/stl/vector.h
deleted file mode 100644
index e609aa109a0a..000000000000
--- a/contrib/libg++/libstdc++/stl/vector.h
+++ /dev/null
@@ -1,355 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef VECTOR_H
-#define VECTOR_H
-
-#include <function.h>
-#include <algobase.h>
-#ifndef __GNUG__
-#include <bool.h>
-#endif
-
-#ifndef Allocator
-#define Allocator allocator
-#include <defalloc.h>
-#endif
-
-#ifndef vector
-#define vector vector
-#endif
-
-template <class T>
-class vector {
-public:
-
- typedef Allocator<T> vector_allocator;
- typedef T value_type;
- typedef vector_allocator::pointer pointer;
- typedef vector_allocator::pointer iterator;
- typedef vector_allocator::const_pointer const_iterator;
- typedef vector_allocator::reference reference;
- typedef vector_allocator::const_reference const_reference;
- typedef vector_allocator::size_type size_type;
- typedef vector_allocator::difference_type difference_type;
- typedef reverse_iterator<const_iterator, value_type, const_reference,
- difference_type> const_reverse_iterator;
- typedef reverse_iterator<iterator, value_type, reference, difference_type>
- reverse_iterator;
-protected:
- static Allocator<T> static_allocator;
- iterator start;
- iterator finish;
- iterator end_of_storage;
-#ifdef __GNUG__
- void insert_aux(iterator position, const T& x) {
- insert_aux(vector_iterator<T>(position), x);
- }
- void insert_aux(vector_iterator<T> position, const T& x);
-#else
- void insert_aux(iterator position, const T& x);
-#endif
-public:
- iterator begin() { return start; }
- const_iterator begin() const { return start; }
- iterator end() { return finish; }
- const_iterator end() const { return finish; }
- reverse_iterator rbegin() { return reverse_iterator(end()); }
- const_reverse_iterator rbegin() const {
- return const_reverse_iterator(end());
- }
- reverse_iterator rend() { return reverse_iterator(begin()); }
- const_reverse_iterator rend() const {
- return const_reverse_iterator(begin());
- }
- size_type size() const { return size_type(end() - begin()); }
- size_type max_size() const { return static_allocator.max_size(); }
- size_type capacity() const { return size_type(end_of_storage - begin()); }
- bool empty() const { return begin() == end(); }
- reference operator[](size_type n) { return *(begin() + n); }
- const_reference operator[](size_type n) const { return *(begin() + n); }
- vector() : start(0), finish(0), end_of_storage(0) {}
- vector(size_type n, const T& value = T()) {
- start = static_allocator.allocate(n);
- uninitialized_fill_n(start, n, value);
- finish = start + n;
- end_of_storage = finish;
- }
- vector(const vector<T>& x) {
- start = static_allocator.allocate(x.end() - x.begin());
- finish = uninitialized_copy(x.begin(), x.end(), start);
- end_of_storage = finish;
- }
- vector(const_iterator first, const_iterator last) {
- size_type n = 0;
- distance(first, last, n);
- start = static_allocator.allocate(n);
- finish = uninitialized_copy(first, last, start);
- end_of_storage = finish;
- }
- ~vector() {
- destroy(start, finish);
- static_allocator.deallocate(start);
- }
- vector<T>& operator=(const vector<T>& x);
- void reserve(size_type n) {
- if (capacity() < n) {
- iterator tmp = static_allocator.allocate(n);
- uninitialized_copy(begin(), end(), tmp);
- destroy(start, finish);
- static_allocator.deallocate(start);
- finish = tmp + size();
- start = tmp;
- end_of_storage = begin() + n;
- }
- }
- reference front() { return *begin(); }
- const_reference front() const { return *begin(); }
- reference back() { return *(end() - 1); }
- const_reference back() const { return *(end() - 1); }
- void push_back(const T& x) {
- if (finish != end_of_storage) {
- /* Borland bug */
- construct(finish, x);
- finish++;
- } else
- insert_aux(end(), x);
- }
- void swap(vector<T>& x) {
- ::swap(start, x.start);
- ::swap(finish, x.finish);
- ::swap(end_of_storage, x.end_of_storage);
- }
- iterator insert(iterator position, const T& x) {
- size_type n = position - begin();
- if (finish != end_of_storage && position == end()) {
- /* Borland bug */
- construct(finish, x);
- finish++;
- } else
- insert_aux(position, x);
- return begin() + n;
- }
-#ifdef __GNUG__
- void insert (iterator position, const_iterator first,
- const_iterator last) {
- insert(vector_iterator<T>(position),
- vector_const_iterator<T>(first),
- vector_const_iterator<T>(last));
- }
- void insert (vector_iterator<T> position, vector_const_iterator<T> first,
- vector_const_iterator<T> last);
- void insert (iterator position, size_type n, const T& x) {
- insert(vector_iterator<T>(position), n, x);
- }
- void insert (vector_iterator<T> position, size_type n, const T& x);
-#else
- void insert (iterator position, const_iterator first,
- const_iterator last);
- void insert (iterator position, size_type n, const T& x);
-#endif
- void pop_back() {
- /* Borland bug */
- --finish;
- destroy(finish);
- }
- void erase(iterator position) {
- if (position + 1 != end())
- copy(position + 1, end(), position);
- /* Borland bug */
- --finish;
- destroy(finish);
- }
- void erase(iterator first, iterator last) {
- vector<T>::iterator i = copy(last, end(), first);
- destroy(i, finish);
- // work around for destroy(copy(last, end(), first), finish);
- finish = finish - (last - first);
- }
-};
-
-#ifdef __GNUG__
-template <class T>
-struct vector_iterator {
- vector<T>::iterator it;
- vector_iterator(vector<T>::iterator i) : it(i) {}
- operator vector<T>::iterator() {
- return it;
- }
-};
-
-template <class T>
-inline T* value_type(const vector_iterator<T>&) {
- return (T*)(0);
-}
-
-
-template <class T>
-struct vector_const_iterator {
- vector<T>::const_iterator it;
- vector_const_iterator(vector<T>::const_iterator i) : it(i) {}
- operator vector<T>::const_iterator() {
- return it;
- }
-};
-#endif
-
-template <class T>
-inline bool operator==(const vector<T>& x, const vector<T>& y) {
- return x.size() == y.size() && equal(x.begin(), x.end(), y.begin());
-}
-
-template <class T>
-inline bool operator<(const vector<T>& x, const vector<T>& y) {
- return lexicographical_compare(x.begin(), x.end(), y.begin(), y.end());
-}
-
-#ifndef __GNUG__
-template <class T>
-vector<T>::vector_allocator vector<T>::static_allocator;
-#endif
-
-template <class T>
-vector<T>& vector<T>::operator=(const vector<T>& x) {
- if (&x == this) return *this;
- if (x.size() > capacity()) {
- destroy(start, finish);
- static_allocator.deallocate(start);
- start = static_allocator.allocate(x.end() - x.begin());
- end_of_storage = uninitialized_copy(x.begin(), x.end(), start);
- } else if (size() >= x.size()) {
- vector<T>::iterator i = copy(x.begin(), x.end(), begin());
- destroy(i, finish);
- // work around for destroy(copy(x.begin(), x.end(), begin()), finish);
- } else {
- copy(x.begin(), x.begin() + size(), begin());
- uninitialized_copy(x.begin() + size(), x.end(), begin() + size());
- }
- finish = begin() + x.size();
- return *this;
-}
-
-template <class T>
-#ifdef __GNUG__
-void vector<T>::insert_aux(vector_iterator<T> posn, const T& x) {
- iterator position = posn;
-#else
-void vector<T>::insert_aux(iterator position, const T& x) {
-#endif
- if (finish != end_of_storage) {
- construct(finish, *(finish - 1));
- copy_backward(position, finish - 1, finish);
- *position = x;
- ++finish;
- } else {
- size_type len = size() ? 2 * size()
- : static_allocator.init_page_size();
- iterator tmp = static_allocator.allocate(len);
- uninitialized_copy(begin(), position, tmp);
- construct(tmp + (position - begin()), x);
- uninitialized_copy(position, end(), tmp + (position - begin()) + 1);
- destroy(begin(), end());
- static_allocator.deallocate(begin());
- end_of_storage = tmp + len;
- finish = tmp + size() + 1;
- start = tmp;
- }
-}
-
-template <class T>
-#ifdef __GNUG__
-void vector<T>::insert(vector_iterator<T> posn,
- size_t n,
- const T& x) {
- iterator position = posn;
-#else
-void vector<T>::insert(iterator position, size_type n, const T& x) {
-#endif
- if (n == 0) return;
- if ((size_type) (end_of_storage - finish) >= n) {
- if ((size_type) (end() - position) > n) {
- uninitialized_copy(end() - n, end(), end());
- copy_backward(position, end() - n, end());
- fill(position, position + n, x);
- } else {
- uninitialized_copy(position, end(), position + n);
- fill(position, end(), x);
- uninitialized_fill_n(end(), n - (end() - position), x);
- }
- finish += n;
- } else {
- size_type len = size() + max(size(), n);
- iterator tmp = static_allocator.allocate(len);
- uninitialized_copy(begin(), position, tmp);
- uninitialized_fill_n(tmp + (position - begin()), n, x);
- uninitialized_copy(position, end(), tmp + (position - begin() + n));
- destroy(begin(), end());
- static_allocator.deallocate(begin());
- end_of_storage = tmp + len;
- finish = tmp + size() + n;
- start = tmp;
- }
-}
-
-template <class T>
-#ifdef __GNUG__
-void vector<T>::insert(vector_iterator<T> posn,
- vector_const_iterator<T> fi,
- vector_const_iterator<T> la) {
- iterator position = posn;
- const_iterator first = fi;
- const_iterator last = la;
-#else
-void vector<T>::insert(iterator position,
- const_iterator first,
- const_iterator last) {
-#endif
- if (first == last) return;
- size_type n = 0;
- distance(first, last, n);
- if ((size_type) (end_of_storage - finish) >= n) {
- if ((size_type) (end() - position) > n) {
- uninitialized_copy(end() - n, end(), end());
- copy_backward(position, end() - n, end());
- copy(first, last, position);
- } else {
- uninitialized_copy(position, end(), position + n);
- copy(first, first + (end() - position), position);
- uninitialized_copy(first + (end() - position), last, end());
- }
- finish += n;
- } else {
- size_type len = size() + max(size(), n);
- iterator tmp = static_allocator.allocate(len);
- uninitialized_copy(begin(), position, tmp);
- uninitialized_copy(first, last, tmp + (position - begin()));
- uninitialized_copy(position, end(), tmp + (position - begin() + n));
- destroy(begin(), end());
- static_allocator.deallocate(begin());
- end_of_storage = tmp + len;
- finish = tmp + size() + n;
- start = tmp;
- }
-}
-
-#undef Allocator
-#undef vector
-
-#endif
-
-
-
-
-
diff --git a/contrib/libg++/libstdc++/string b/contrib/libg++/libstdc++/string
deleted file mode 100644
index 467a2fd0a690..000000000000
--- a/contrib/libg++/libstdc++/string
+++ /dev/null
@@ -1,6 +0,0 @@
-// -*- C++ -*- forwarding header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __STRING__
-#include <std/string.h>
-#endif
diff --git a/contrib/libg++/libstdc++/tests/ChangeLog b/contrib/libg++/libstdc++/tests/ChangeLog
deleted file mode 100644
index c089bfbda21d..000000000000
--- a/contrib/libg++/libstdc++/tests/ChangeLog
+++ /dev/null
@@ -1,52 +0,0 @@
-Mon Jun 17 14:05:50 1996 Per Bothner <bothner@deneb.cygnus.com>
-
- * tlist.cc (test_splice): New test.
-
-Sat Nov 18 19:52:26 1995 Mike Stump <mrs@cygnus.com>
-
- * Makefile.in: Update version to 2.7.1.
-
-Tue May 9 19:36:54 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * tstring.cc (decltest): Adjust single-character test.
-
-Fri May 5 14:35:19 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * tcomplex.*: Update to reflect that operator<< now
- accepts more forms of input.
-
-Thu Apr 27 15:34:58 1995 Brendan Kehoe (brendan@lisa.cygnus.com)
-
- * configure.in: Update to stay in sync with config.shared.
-
-Thu Feb 16 00:08:28 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * Makefile.in (VERSION, SHLIB): Define.
-
-Tue Jan 24 02:36:24 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * Makefile.in (CXXFLAGS): Don't set.
-
-Mon Jan 23 04:12:10 1995 Jason Merrill <jason@python.cygnus.com>
-
- * tlist.cc (plus): Remove.
-
-Thu Jan 19 19:41:07 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * Makefile.in: Don't set LD_LIBRARY_PATH. Users will have to set
- it themselves.
-
-Mon Jan 16 13:57:34 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * Makefile.in: Update to reflect header movement.
-
-Wed Dec 14 19:55:45 1994 Per Bothner <bothner@kalessin.cygnus.com>
-
- * configure.in: Fix quoting problem. Reported nu H.J.Lu.
-
-Tue Nov 29 16:46:56 1994 Per Bothner <bothner@kalessin.cygnus.com>
-
- * Makefile.in, configure.in: Re-write to avoid duplication.
- * {tvector,tmap,tlist}.{cc,exp}, configure.in: New tests for STL.
-
-
diff --git a/contrib/libg++/libstdc++/tests/Makefile.in b/contrib/libg++/libstdc++/tests/Makefile.in
deleted file mode 100644
index a068ec160a7f..000000000000
--- a/contrib/libg++/libstdc++/tests/Makefile.in
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (C) 1994 Free Software Foundation
-
-# This file is part of the GNU ANSI C++ 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.
-
-VERSION = 2.7.2
-SHLIB = libstdc++.so.$(VERSION)
-
-DEPLIBS = ../libstdc++.a
-LDLIBS = -L.. -lstdc++
-MDEPLIBS = $(DEPLIBS)
-MLDLIBS = $(LDLIBS) -lm
-
-#### package, host, target, and site dependent Makefile fragments come in here.
-##
-
-tcomplex.o: ${srcdir}/../std/complext.h ${srcdir}/../std/dcomplex.h
-tcomplex: tcomplex.o $(MDEPLIBS)
- $(CXX) -o tcomplex tcomplex.o $(MLDLIBS)
-
-tstring.o: ${srcdir}/../std/bastring.h
-
-# NOTE: Rules for following tests are generated by $(srcdir)/configure.in !!!
-
diff --git a/contrib/libg++/libstdc++/tests/configure.in b/contrib/libg++/libstdc++/tests/configure.in
deleted file mode 100644
index a32d0495f45e..000000000000
--- a/contrib/libg++/libstdc++/tests/configure.in
+++ /dev/null
@@ -1,49 +0,0 @@
-# This file is a shell script fragment that supplies the information
-# necessary for a configure script to process the program in
-# this directory. For more information, look at ../../configure.
-
-configdirs=
-srctrigger=tcomplex.cc
-srcname="tests for ANSI C++ library"
-package_makefile_frag=Make.pack
-
-# per-host:
-
-# per-target:
-
-target_makefile_frag=../target-mkfrag
-
-TO_TOPDIR=../../
-ALL=' '
-XCXXINCLUDES="-I${srcdir}/.. -I${srcdir}/../stl -I${TO_TOPDIR}libio -I${srcdir}/${TO_TOPDIR}libio"
-SIMPLE_TESTS='tstring tlist tmap tvector'
-TESTS="tcomplex ${SIMPLE_TESTS}"
-MOSTLYCLEAN="*.o core ${TESTS} *.out"
-(. ${srcdir}/${TO_TOPDIR}libio/config.shared) >${package_makefile_frag}
-
-# post-target:
-
-CHECK=""
-
-for TEST in ${SIMPLE_TESTS} ; do
- echo "${TEST}: ${TEST}.o" '$(DEPLIBS)
- $(CXX) -o' "${TEST} ${TEST}.o" '$(LDLIBS)
-' >> Makefile
-done
-
-for TEST in ${TESTS} ; do
- echo ".PHONY: check-${TEST}" >>Makefile
- if [ -f ${srcdir}/${TEST}.inp ] ; then
- echo "check-${TEST}: ${TEST}" '$(srcdir)'"/${TEST}.inp
- ./${TEST} < "'$(srcdir)'"/${TEST}.inp > ${TEST}.out 2>&1" >>Makefile
- else
- echo "check-${TEST}: ${TEST}
- ./${TEST} > ${TEST}.out 2>&1" >>Makefile
- fi
- echo ' diff -c $(srcdir)/'"${TEST}.exp ${TEST}.out" >>Makefile
- CHECK="${CHECK} check-${TEST}"
-done
-echo "
-check: ${CHECK}" >>Makefile
-
-
diff --git a/contrib/libg++/libstdc++/tests/tcomplex.cc b/contrib/libg++/libstdc++/tests/tcomplex.cc
deleted file mode 100644
index c9d27360b1b8..000000000000
--- a/contrib/libg++/libstdc++/tests/tcomplex.cc
+++ /dev/null
@@ -1,143 +0,0 @@
-// Tests for the -*- C++ -*- complex number classes.
-// Copyright (C) 1994 Free Software Foundation
-
-// This file is part of the GNU ANSI C++ 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.
-
-#include <std/cassert.h>
-#include <iostream.h>
-#include <std/complex.h>
-
-// to test near-equality
-
-const double eps = 0.000001;
-
-static void close_enough(const double_complex& a, const double_complex& b)
-{
- assert(fabs(real(a) - real(b)) < eps &&
- fabs(imag(a) - imag(b)) < eps);
-}
-
-
-void test3(double_complex& a, double_complex& b, double_complex& c)
-{
-
- close_enough(-(-a) , a);
- close_enough((a + b) , (b + a));
- close_enough((a + (-b)) , (a - b));
- close_enough((a * b) , (b * a));
- close_enough((a * (-b)) , -(a * b));
- close_enough((a / (-b)) , -(a / b));
- close_enough((a - b) , -(b - a));
- close_enough((a + (b + c)) , ((a + b) + c));
- close_enough((a * (b * c)) , ((a * b) * c));
- close_enough((a * (b + c)) , ((a * b) + (a * c)));
- close_enough(((a - b) + b) , a);
- close_enough(((a + b) - b) , a);
- close_enough(((a * b) / b) , a);
- close_enough(((a / b) * b) , a);
-
-
- double_complex x = a;
- x *= b;
- close_enough(x , (a * b));
- x += c;
- close_enough(x , ((a * b) + c));
- x -= a;
- close_enough(x , (((a * b) + c) - a));
- x /= b;
- close_enough(x , ((((a * b) + c) - a) / b));
-
-}
-
-main()
-{
- double_complex one = 1.0;
- double_complex i (0.0, 1.0);
- double_complex neg_one = -1.0;
-
- cout << "double_complex one = " << one << "\n";
- cout << "i = " << i << "\n";
- cout << "neg_one = " << neg_one << "\n";
- cout << "sqrt(neg_one) = " << sqrt(neg_one) << "\n";
-
- double_complex a (2.0, 3.0);
- double_complex b (4.0, 5.0);
-
- cout << "a = " << a << "\n";
- cout << "b = " << b << "\n";
-
- cout << "a + one = " << (a + one) << "\n";
- (close_enough((a+one), double_complex(3.0, 3.0)));
- cout << "a - one = " << (a - one) << "\n";
- (close_enough((a-one), double_complex(1.0, 3.0)));
- cout << "a * one = " << (a * one) << "\n";
- (close_enough((a*one), a));
- cout << "a / one = " << (a / one) << "\n";
- (close_enough((a/one), a));
-
- cout << "a + b = " << (a + b) << "\n";
- (close_enough((a+b), double_complex(6.0, 8.0)));
- cout << "a - b = " << (a - b) << "\n";
- (close_enough((a-b), double_complex(-2.0, -2.0)));
- cout << "a * b = " << (a * b) << "\n";
- (close_enough((a*b), double_complex(-7.0, 22.0)));
- cout << "a / b = " << (a / b) << "\n";
- (close_enough((a/b), double_complex(0.5609760976, 0.0487804878)));
-
- double_complex c;
-
- c = a; cout << "c = a; c += b = " << (c += b) << "\n";
- c = a; cout << "c = a; c -= b = " << (c -= b) << "\n";
- c = a; cout << "c = a; c *= b = " << (c *= b) << "\n";
- c = a; cout << "c = a; c /= b = " << (c /= b) << "\n";
-
- cout << "-a = " << (-a) << "\n";
- cout << "real(a) = " << real(a) << "\n";
- assert(real(a) == 2.0);
- cout << "imag(a) = " << imag(a) << "\n";
- assert(imag(a) == 3.0);
- cout << "conj(a) = " << conj(a) << "\n";
- assert(conj(a) == double_complex(2.0, -3.0));
- cout << "norm(a) = " << norm(a) << "\n";
- assert(norm(a) == 13.0);
-
- cout << "abs(a) = " << abs(a) << "\n";
- cout << "arg(a) = " << arg(a) << "\n";
- cout << "cos(a) = " << cos(a) << "\n";
- cout << "sin(a) = " << sin(a) << "\n";
- cout << "cosh(a) = " << cosh(a) << "\n";
- cout << "sinh(a) = " << sinh(a) << "\n";
- cout << "log(a) = " << log(a) << "\n";
- cout << "exp(a) = " << exp(a) << "\n";
- cout << "sqrt(a) = " << sqrt(a) << "\n";
- cout << "pow(a, 2) = " << pow(a, 2) << "\n";
- cout << "pow(a, b) = " << pow(a, b) << "\n";
-
- double_complex d (10, 20);
- double_complex e = pow(a, 2);
-
- test3(one, one, one);
- test3(a, a, a);
- test3(a, b, d);
- test3(e, i, b);
- test3(d, d, i);
-
- cout << "enter a complex number in form a or (a) or (a, b): ";
- cin >> c;
- cout << "number = " << c << "\n";
-
- cout << "\nEnd of test\n";
- return 0;
-}
diff --git a/contrib/libg++/libstdc++/tests/tcomplex.exp b/contrib/libg++/libstdc++/tests/tcomplex.exp
deleted file mode 100644
index 5bef15cd3769..000000000000
--- a/contrib/libg++/libstdc++/tests/tcomplex.exp
+++ /dev/null
@@ -1,37 +0,0 @@
-double_complex one = (1,0)
-i = (0,1)
-neg_one = (-1,0)
-sqrt(neg_one) = (0,1)
-a = (2,3)
-b = (4,5)
-a + one = (3,3)
-a - one = (1,3)
-a * one = (2,3)
-a / one = (2,3)
-a + b = (6,8)
-a - b = (-2,-2)
-a * b = (-7,22)
-a / b = (0.560976,0.0487805)
-c = a; c += b = (6,8)
-c = a; c -= b = (-2,-2)
-c = a; c *= b = (-7,22)
-c = a; c /= b = (0.560976,0.0487805)
--a = (-2,-3)
-real(a) = 2
-imag(a) = 3
-conj(a) = (2,-3)
-norm(a) = 13
-abs(a) = 3.60555
-arg(a) = 0.982794
-cos(a) = (-4.18963,-9.10923)
-sin(a) = (9.1545,-4.16891)
-cosh(a) = (-3.72455,0.511823)
-sinh(a) = (-3.59056,0.530921)
-log(a) = (1.28247,0.982794)
-exp(a) = (-7.31511,1.04274)
-sqrt(a) = (1.67415,0.895977)
-pow(a, 2) = (-5,12)
-pow(a, b) = (-0.753046,-0.986429)
-enter a complex number in form a or (a) or (a, b): number = (1.2,-34)
-
-End of test
diff --git a/contrib/libg++/libstdc++/tests/tcomplex.inp b/contrib/libg++/libstdc++/tests/tcomplex.inp
deleted file mode 100644
index c4e1d84660f2..000000000000
--- a/contrib/libg++/libstdc++/tests/tcomplex.inp
+++ /dev/null
@@ -1 +0,0 @@
-(1.2, -34)
diff --git a/contrib/libg++/libstdc++/tests/tlist.cc b/contrib/libg++/libstdc++/tests/tlist.cc
deleted file mode 100644
index aaf56714a79c..000000000000
--- a/contrib/libg++/libstdc++/tests/tlist.cc
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- test/demo of generic lists
-*/
-
-#include <assert.h>
-
-#define tassert(ex) {if ((ex)) cerr << #ex << "\n"; \
- else _assert(#ex, __FILE__,__LINE__); }
-
-#include <iostream.h>
-#include "list.h"
-#include "algo.h"
-
-bool int_compare(int a, int b)
-{
- return a < b;
-}
-
-int inc(int x)
-{
- return x + 1;
-}
-
-void print(list<int>& l)
-{
- for (list<int>::iterator it = l.begin(); it != l.end(); it++)
- cout << *it << " ";
- cout << "\n";
-}
-
-int is_odd(int x)
-{
- return x & 1;
-}
-
-int is_even(int x)
-{
- return (x & 1) == 0;
-}
-
-void sequence(list<int>& a, int lo, int hi)
-{
- back_insert_iterator<list<int> > it(a);
- while (lo <= hi)
- *it++ = lo++;
-}
-
-int old_rand = 9999;
-
-int get_rand()
-{
- old_rand = ((long)old_rand * (long)1243) % (long)971;
- return old_rand;
-}
-
-void randseq(list<int>& a, int n)
-{
- back_insert_iterator<list<int> > it(a);
- while (--n >= 0)
- *it++ = get_rand() % 50;
-}
-
-int array1 [] = { 9, 16, 36 };
-int array2 [] = { 1, 4 };
-
-int test_splice ()
-{
- list<int> l1 (array1, array1 + 3);
- list<int> l2 (array2, array2 + 2);
- list<int>::iterator i1 = l1.begin ();
- l1.splice (i1, l2);
- list<int>::iterator i2 = l1.begin ();
- while (i2 != l1.end ())
- cout << *i2++ << endl;
- return 0;
-}
-
-main()
-{
- list<int> a; int i;
- list<int>::iterator it, bit;
- sequence(a, 1, 20);
- cout << "\nlist<int> a = sequence(1, 20);\n"; print(a);
- for (it = a.begin (), i = 0; it != a.end (); it++, i++)
- assert (*it == i + 1);
- list<int> b;
- randseq(b, 20);
- cout << "\nlist<int> b = randseq(20);\n"; print(b);
- list<int> c;
- c.insert (c.end(), a.begin(), a.end());
- c.insert (c.end(), b.begin(), b.end());
- cout << "\nlist<int> c = a and b;\n"; print(c);
-
- list<int> d;
- for (it = a.begin(); it != a.end(); it++)
- d.insert(d.end (), inc(*it));
- cout << "\nlist<int> d = map(inc, a);\n"; print(d);
-
- list<int> e;
- back_insert_iterator<list<int> > e_insertor (e);
- reverse_copy (a.begin(), a.end (), e_insertor);
- cout << "\nlist<int> e = reverse(a);\n"; print(e);
-
- list<int> f;
- for (it = a.begin(); it != a.end(); it++)
- if (is_odd (*it))
- f.insert(f.end (), *it);
- cout << "\nlist<int> f = select(is_odd, a);\n"; print(f);
- list<int> ff;
- for (it = f.begin(); it != f.end(); it++)
- if (is_even (*it))
- ff.insert(ff.end (), *it);
- assert(ff.empty());
-
- int red = 0;
- for (it = a.begin(); it != a.end(); it++)
- red += *it;
- cout << "\nint red = a.reduce(plus, 0);\n"; cout << red;
- it = a.begin(); ++it; ++it;
- int second = *it;
- cout << "\nint second = a[2];\n"; cout << second;
- list<int> g;
- for (it = a.begin(), bit = b.begin(); it != a.end () && bit != b.end (); )
- g.insert (g.end (), *it++ + *bit++);
- cout << "\nlist<int> g = combine(plus, a, b);\n"; print(g);
-#if 1
- for (it = g.begin(); it != g.end(); )
- {
- bit = it++;
- if (is_odd (*bit))
- g.erase (bit);
- }
-#else
- g.remove_if (is_odd);
-#endif
- cout << "\ng.del(is_odd);\n"; print(g);
-
- ff.erase (ff.begin (), ff.end());
- for (it = g.begin(); it != g.end(); it++)
- if (is_odd (*it))
- ff.insert (ff.end (), *it);
- assert(ff.empty());
-
- b.sort();
- for (it = b.begin(); bit = it++, it != b.end (); ) assert (*it >= *bit);
- cout << "\nb.sort(int_compare);\n"; print(b);
-
- list<int> h;
- back_insert_iterator<list<int> > h_insertor (h);
- merge (a.begin (), a.end (), b.begin (), b.end (), h_insertor, int_compare);
- cout << "\nlist<int> h = merge(a, b, int_compare);\n"; print(h);
- for (it = h.begin(); bit = it++, it != h.end (); ) assert (*it >= *bit);
-
- cout << "\nh via iterator:\n";
- for (it = h.begin(); it != h.end (); it++)
- cout << *it << ", ";
- cout << "\n";
-
- test_splice ();
-
- cout << "\ndone\n";
-}
diff --git a/contrib/libg++/libstdc++/tests/tlist.exp b/contrib/libg++/libstdc++/tests/tlist.exp
deleted file mode 100644
index 65f7806826f6..000000000000
--- a/contrib/libg++/libstdc++/tests/tlist.exp
+++ /dev/null
@@ -1,44 +0,0 @@
-
-list<int> a = sequence(1, 20);
-1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
-
-list<int> b = randseq(20);
-28 27 5 17 44 6 9 40 15 26 49 35 15 48 13 27 25 25 9 6
-
-list<int> c = a and b;
-1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 28 27 5 17 44 6 9 40 15 26 49 35 15 48 13 27 25 25 9 6
-
-list<int> d = map(inc, a);
-2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
-
-list<int> e = reverse(a);
-20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1
-
-list<int> f = select(is_odd, a);
-1 3 5 7 9 11 13 15 17 19
-
-int red = a.reduce(plus, 0);
-210
-int second = a[2];
-3
-list<int> g = combine(plus, a, b);
-29 29 8 21 49 12 16 48 24 36 60 47 28 62 28 43 42 43 28 26
-
-g.del(is_odd);
-8 12 16 48 24 36 60 28 62 28 42 28 26
-
-b.sort(int_compare);
-5 6 6 9 9 13 15 15 17 25 25 26 27 27 28 35 40 44 48 49
-
-list<int> h = merge(a, b, int_compare);
-1 2 3 4 5 5 6 6 6 7 8 9 9 9 10 11 12 13 13 14 15 15 15 16 17 17 18 19 20 25 25 26 27 27 28 35 40 44 48 49
-
-h via iterator:
-1, 2, 3, 4, 5, 5, 6, 6, 6, 7, 8, 9, 9, 9, 10, 11, 12, 13, 13, 14, 15, 15, 15, 16, 17, 17, 18, 19, 20, 25, 25, 26, 27, 27, 28, 35, 40, 44, 48, 49,
-1
-4
-9
-16
-36
-
-done
diff --git a/contrib/libg++/libstdc++/tests/tmap.cc b/contrib/libg++/libstdc++/tests/tmap.cc
deleted file mode 100644
index 7169f9d20d19..000000000000
--- a/contrib/libg++/libstdc++/tests/tmap.cc
+++ /dev/null
@@ -1,66 +0,0 @@
-#include <map.h>
-#include <algo.h>
-#include <iostream.h>
-#include <function.h>
-
-int SIZE;
-
-#if 0
-/* Crashes compiler */
-#define int_less less<int>
-#else
-struct int_less {
- bool operator() (int x, int y) const { return x < y; }
-};
-struct str_less {
- bool operator() (char* x, char* y) const { return strcmp(x,y) < 0; }
-};
-#endif
-
-#if 0
-void add(int x[], int y[], map<int,int, int_less>& a)
-{
- for (int i = 0; i < SIZE; ++i) a[x[i]] = y[i];
-}
-#endif
-
-int
-main(int argv, char** argc)
-{
-#if 0
- if (argv > 1)
- {
- SIZE = abs(atoi(argc[1]));
- SIZE &= ~1;
- }
- else
- SIZE = 100;
- nums = new int[SIZE];
- odds = new int[SIZE];
- perm = new int[SIZE];
-#endif
-
- map<int, int, int_less> my_map;
-
- map<char*, int, str_less> phones;
-
- my_map[4] = 40;
- my_map[2] = 20;
-
- // The (char*) is needed because g++ doesn't
- // convert char[] to char* in this context.
- phones[(char*)"tom"] = 2345;
- phones[(char*)"dick"] = 5678;
- phones[(char*)"harry"] = 7654;
-
- cout << "2 -> " << my_map[2] << endl;
- cout << "4 -> " << my_map[4] << endl;
-
- map<int, int, int_less>::iterator it = my_map.begin();
- for ( ; it != my_map.end(); it++)
- cout << "my_map[" << (*it).first << "] = " << (*it).second << endl;
-
- map<char*, int, str_less>::iterator pit = phones.begin();
- for ( ; pit != phones.end(); pit++)
- cout << "phones[" << (*pit).first << "] = " << (*pit).second << endl;
-}
diff --git a/contrib/libg++/libstdc++/tests/tmap.exp b/contrib/libg++/libstdc++/tests/tmap.exp
deleted file mode 100644
index b7b5df249fb0..000000000000
--- a/contrib/libg++/libstdc++/tests/tmap.exp
+++ /dev/null
@@ -1,7 +0,0 @@
-2 -> 20
-4 -> 40
-my_map[2] = 20
-my_map[4] = 40
-phones[dick] = 5678
-phones[harry] = 7654
-phones[tom] = 2345
diff --git a/contrib/libg++/libstdc++/tests/tstring.cc b/contrib/libg++/libstdc++/tests/tstring.cc
deleted file mode 100644
index 490f2c843e7a..000000000000
--- a/contrib/libg++/libstdc++/tests/tstring.cc
+++ /dev/null
@@ -1,189 +0,0 @@
-// Tests for the -*- C++ -*- string classes.
-// Copyright (C) 1994 Free Software Foundation
-
-// This file is part of the GNU ANSI C++ 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.
-
-#include <std/string.h>
-#include <iostream.h>
-#include <std/cstdlib.h>
-#include <std/cassert.h>
-
-string X = "Hello";
-string Y = "world";
-string N = "123";
-string c;
-char* s = ",";
-
-void decltest()
-{
- string x;
- cout << "an empty string:" << x << "\n";
- assert(x == "");
-
- string y = "Hello";
- cout << "A string initialized to Hello:" << y << "\n";
- assert(y == "Hello");
-
- if (y[y.length()-1] == 'o')
- y = y + '\n';
- assert(y == "Hello\n");
- y = "Hello";
-
- string a = y;
- cout << "A string initialized to previous string:" << a << "\n";
- assert(a == "Hello");
- assert(a == y);
-
- string b (a, 1, 2);
- cout << "A string initialized to (previous string, 1, 2):" << b << "\n";
- assert(b == "el");
-
- char ch = '@';
- string z (1, ch);
- cout << "A string initialized to @:" << z << "\n";
- assert (z == "@");
-
- string n ("20");
- cout << "A string initialized to 20:" << n << "\n";
- assert(n == "20");
-
- int i = atoi(n.c_str ());
- double f = atof(n.c_str ());
- cout << "n = " << n << " atoi(n) = " << i << " atof(n) = " << f << "\n";
- assert(i == 20);
- assert(f == 20);
-
-}
-
-void cattest()
-{
- string x = X;
- string y = Y;
- string z = x + y;
- cout << "z = x + y = " << z << "\n";
- assert(z == "Helloworld");
-
- x += y;
- cout << "x += y; x = " << x << "\n";
- assert(x == "Helloworld");
-
- y = Y;
- x = X;
- y.insert (0, x);
- cout << "y.insert (0, x); y = " << y << "\n";
- assert(y == "Helloworld");
-
- y = Y;
- x = X;
- x = x + y + x;
- cout << "x = x + y + x; x = " << x << "\n";
- assert(x == "HelloworldHello");
-
- y = Y;
- x = X;
- x = y + x + x;
- cout << "x = y + x + x; x = " << x << "\n";
- assert(x == "worldHelloHello");
-
- x = X;
- y = Y;
- z = x + s + ' ' + y.substr (y.find ('w'), 1) + y.substr (y.find ('w') + 1) + ".";
- cout << "z = x + s + + y.substr (y.find (w), 1) + y.substr (y.find (w) + 1) + . = " << z << "\n";
- assert(z == "Hello, world.");
-}
-
-void comparetest()
-{
- string x = X;
- string y = Y;
- string n = N;
- string z = x + y;
-
- assert(x != y);
- assert(x == "Hello");
- assert(x != z.substr (0, 4));
- assert(x.compare (y) < 0);
- assert(x.compare (z.substr (0, 6)) < 0);
-
- assert(x.find ("lo") == 3);
- assert(x.find ("l", 2) == 2);
- assert(x.rfind ("l") == 3);
-}
-
-void substrtest()
-{
- string x = X;
-
- char ch = x[0];
- cout << "ch = x[0] = " << ch << "\n";
- assert(ch == 'H');
-
- string z = x.substr (2, 3);
- cout << "z = x.substr (2, 3) = " << z << "\n";
- assert(z == "llo");
-
- x.replace (2, 2, "r");
- cout << "x.replace (2, 2, r); x = " << x << "\n";
- assert(x == "Hero");
-
- x = X;
- x.replace (0, 1, 'j');
- cout << "x.replace (0, 1, 'j'); x = " << x << "\n";
- assert(x == "jello");
-}
-
-void iotest()
-{
- string z;
- cout << "enter a word:";
- cin >> z;
- cout << "word =" << z << " ";
- cout << "length = " << z.length() << "\n";
-}
-
-void identitytest(string a, string b)
-{
- string x = a;
- string y = b;
- x += b;
- y.insert (0, a);
- assert((a + b) == x);
- assert((a + b) == y);
- assert(x == y);
-
- assert((a + b + a) == (a + (b + a)));
-
- x.remove (x.rfind (b));
- assert(x == a);
-
- y.replace (0, y.rfind (b), b);
- assert(y == (b + b));
- y.replace (y.find (b), b.length (), a);
- assert(y == (a + b));
-}
-
-int main()
-{
- decltest();
- cattest();
- comparetest();
- substrtest();
- identitytest(X, X);
- identitytest(X, Y);
- identitytest(X+Y+N+X+Y+N, "A string that will be used in identitytest but is otherwise just another useless string.");
- iotest();
- cout << "\nEnd of test\n";
- return 0;
-}
diff --git a/contrib/libg++/libstdc++/tests/tstring.exp b/contrib/libg++/libstdc++/tests/tstring.exp
deleted file mode 100644
index 3333ab1231d3..000000000000
--- a/contrib/libg++/libstdc++/tests/tstring.exp
+++ /dev/null
@@ -1,20 +0,0 @@
-an empty string:
-A string initialized to Hello:Hello
-A string initialized to previous string:Hello
-A string initialized to (previous string, 1, 2):el
-A string initialized to @:@
-A string initialized to 20:20
-n = 20 atoi(n) = 20 atof(n) = 20
-z = x + y = Helloworld
-x += y; x = Helloworld
-y.insert (0, x); y = Helloworld
-x = x + y + x; x = HelloworldHello
-x = y + x + x; x = worldHelloHello
-z = x + s + + y.substr (y.find (w), 1) + y.substr (y.find (w) + 1) + . = Hello, world.
-ch = x[0] = H
-z = x.substr (2, 3) = llo
-x.replace (2, 2, r); x = Hero
-x.replace (0, 1, 'j'); x = jello
-enter a word:word =abcdefghijklmnopqrstuvwxyz length = 26
-
-End of test
diff --git a/contrib/libg++/libstdc++/tests/tstring.inp b/contrib/libg++/libstdc++/tests/tstring.inp
deleted file mode 100644
index b0883f382e1a..000000000000
--- a/contrib/libg++/libstdc++/tests/tstring.inp
+++ /dev/null
@@ -1 +0,0 @@
-abcdefghijklmnopqrstuvwxyz
diff --git a/contrib/libg++/libstdc++/tests/tvector.cc b/contrib/libg++/libstdc++/tests/tvector.cc
deleted file mode 100644
index ef238ef52da5..000000000000
--- a/contrib/libg++/libstdc++/tests/tvector.cc
+++ /dev/null
@@ -1,20 +0,0 @@
-#include <vector.h>
-#include <iostream.h>
-#include <algo.h>
-
-main ()
-{
- cout << "Fill of C array:\n";
- char x[50];
- fill (x, x+50, '/');
- fill (x+1, x+49, '*');
- copy (x, x+50, ostream_iterator<char>(cout));
-
- cout << "\nFill of vector<char>:\n";
-
- vector<char> cvec;
- cvec.insert (cvec.begin(), 50, '/');
- fill (cvec.begin()+1, cvec.end()-1, '-');
- copy (cvec.begin(), cvec.end(), ostream_iterator<char>(cout));
- cout << endl;
-}
diff --git a/contrib/libg++/libstdc++/tests/tvector.exp b/contrib/libg++/libstdc++/tests/tvector.exp
deleted file mode 100644
index 84a9d1bf3a4d..000000000000
--- a/contrib/libg++/libstdc++/tests/tvector.exp
+++ /dev/null
@@ -1,4 +0,0 @@
-Fill of C array:
-/************************************************/
-Fill of vector<char>:
-/------------------------------------------------/
diff --git a/contrib/libg++/libstdc++/typeinfo b/contrib/libg++/libstdc++/typeinfo
deleted file mode 100644
index 93524ed18626..000000000000
--- a/contrib/libg++/libstdc++/typeinfo
+++ /dev/null
@@ -1,6 +0,0 @@
-// -*- C++ -*- forwarding header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __TYPEINFO__
-#include <std/typeinfo.h>
-#endif
diff --git a/contrib/libg++/libstdc++/typeinfoi.cc b/contrib/libg++/libstdc++/typeinfoi.cc
deleted file mode 100644
index 8daa17764f4a..000000000000
--- a/contrib/libg++/libstdc++/typeinfoi.cc
+++ /dev/null
@@ -1,131 +0,0 @@
-// Methods for type_info for the -*- C++ -*- Run Time Type Identification.
-// Copyright (C) 1994 Free Software Foundation
-
-// This file is part of the GNU ANSI C++ 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.
-
-// Written by Kung Hsu based upon the specification in the 20 September 1994
-// C++ working paper, ANSI document X3J16/94-0158.
-
-#ifdef __GNUG__
-#pragma implementation "std/typeinfo.h"
-#endif
-
-#include <std/cstdlib.h>
-#include <std/typeinfo.h>
-
-// Offset functions for the class type.
-
-// 0 is returned if the cast is invalid, otherwise the converted
-// object pointer that points to the sub-object that is matched is
-// returned.
-
-void*
-__class_type_info::__rtti_match (const type_info& desired, int is_public,
- void *objptr) const
-{
- if (__rtti_compare (desired) == 0)
- return objptr;
-
- void *match_found = 0;
- for (int i = 0; i < n_bases; i++) {
- if (is_public && access_list[i] != _RTTI_ACCESS_PUBLIC)
- continue;
- void *p = (char *)objptr + offset_list[i];
- if (is_virtual_list[i])
- p = *(void **)p;
-
- if ((p=base_list[i]->__rtti_match (desired, is_public, p))
- != 0)
- if (match_found == 0)
- match_found = p;
- else if (match_found != p) {
- // base found at two different pointers,
- // conversion is not unique
- return 0;
- }
- }
-
- return match_found;
-}
-
-void*
-__pointer_type_info::__rtti_match (const type_info& catch_type, int,
- void *objptr) const
-{
- if (catch_type.__rtti_get_node_type () == __rtti_get_node_type())
- {
- type_info &sub_catch_type = ((__pointer_type_info&)catch_type).type;
- type_info &sub_throw_type = ((__pointer_type_info*)this)->type;
- if (sub_catch_type.__rtti_get_node_type () == _RTTI_BUILTIN_TYPE
- && ((__builtin_type_info&)sub_catch_type).b_type == __builtin_type_info::_RTTI_BI_VOID)
- {
- return objptr;
- }
- if (sub_catch_type.__rtti_get_node_type () == _RTTI_ATTR_TYPE
- && ((__attr_type_info&)sub_catch_type).attr == __attr_type_info::_RTTI_ATTR_CONST)
- {
- /* We have to allow a catch of const int* on a int * throw. */
- type_info &sub_sub_catch_type = ((__attr_type_info&)sub_catch_type).type;
- return __throw_type_match_rtti (&sub_sub_catch_type, &sub_throw_type, objptr);
- }
- return __throw_type_match_rtti (&sub_catch_type, &sub_throw_type, objptr);
- }
- return 0;
-}
-
-/* Low level match routine used by compiler to match types of catch variables and thrown
- objects. */
-extern "C"
-void*
-__throw_type_match_rtti (void *catch_type_r, void *throw_type_r, void *objptr)
-{
- type_info &catch_type = *(type_info*)catch_type_r;
- type_info &throw_type = *(type_info*)throw_type_r;
- void *new_objptr;
-
- if (catch_type == throw_type)
- return objptr;
-
- /* Ensure we can call __rtti_match. */
- if ((throw_type.__rtti_get_node_type () != type_info::_RTTI_CLASS_TYPE
- && throw_type.__rtti_get_node_type () != type_info::_RTTI_USER_TYPE
- && throw_type.__rtti_get_node_type () != type_info::_RTTI_POINTER_TYPE)
- || ((catch_type.__rtti_get_node_type () != type_info::_RTTI_CLASS_TYPE
- && catch_type.__rtti_get_node_type () != type_info::_RTTI_USER_TYPE
- && catch_type.__rtti_get_node_type () != type_info::_RTTI_POINTER_TYPE)))
- return 0;
-
-#if 0
- printf ("We want to match a %s against a %s!\n",
- throw_type.name (), catch_type.name ());
-#endif
-
- /* The 1 skips conversions to private bases. */
- new_objptr = throw_type.__rtti_match (catch_type, 1, objptr);
-#if 0
- if (new_objptr)
- printf ("It converts, delta is %d\n", new_objptr-objptr);
-#endif
- return new_objptr;
-}
-
-bad_cast __bad_cast_object ("bad_cast");
diff --git a/contrib/libg++/libstdc++/utility b/contrib/libg++/libstdc++/utility
deleted file mode 100644
index fb79aa782746..000000000000
--- a/contrib/libg++/libstdc++/utility
+++ /dev/null
@@ -1,8 +0,0 @@
-// -*- C++ -*- forwarding header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __UTILITY__
-#define __UTILITY__
-#include <function.h>
-#include <pair.h>
-#endif
diff --git a/contrib/libg++/libstdc++/vector b/contrib/libg++/libstdc++/vector
deleted file mode 100644
index 79f735937517..000000000000
--- a/contrib/libg++/libstdc++/vector
+++ /dev/null
@@ -1,7 +0,0 @@
-// -*- C++ -*- forwarding header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __VECTOR__
-#define __VECTOR__
-#include <vector.h>
-#endif
diff --git a/contrib/libio/ChangeLog b/contrib/libio/ChangeLog
deleted file mode 100644
index b4564ded4713..000000000000
--- a/contrib/libio/ChangeLog
+++ /dev/null
@@ -1,2807 +0,0 @@
-Fri Mar 16 12:46:19 GMT 2001 Bernd Schmidt (bernds@redhat.com)
-
- * gcc-2.95.3 Released.
-
-2000-12-10 Bernd Schmidt <bernds@redhat.com>
-
- 2000-10-16 Jakub Jelinek <jakub@redhat.com>
- * iostream.cc (ostream::operator<<(double n)) [__GLIBC_MINOR__ >= 2]:
- Initialize new fields wide and i18n of struct printf_info.
- (ostream::operator<<(long double n)) [__GLIBC_MINOR__ >= 2]:
- Likewise.
-
- 2000-09-23 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
- * stdstreams.cc: Include <libio.h>, not "libio.h".
- * iolibio.h: Likewise.
- (_IO_pos_BAD): Use _IO_off_t instead of _IO_fpos_t.
- * libio.h (_IO_USER_LOCK): Define.
-
- 1999-12-22 Jakub Jelinek <jakub@redhat.com>
- * libio.h (_IO_cookie_io_functions_t): Use _IO_off_t instead of
- _IO_fpos_t.
- (_IO_seekoff, _IO_seekpos): Likewise. Use _IO_off64_t instead of
- _IO_fpos64_t.
- * libioP.h (_IO_seekoff_t, _IO_seekpos_t, _IO_seek_t): Likewise.
- (_IO_seekoff, _IO_seekpos): Likewise.
- (_IO_default_seekoff, _IO_default_seekpos): Likewise.
- (_IO_default_seek): Likewise.
- (_IO_file_seekoff, _IO_file_seek, _IO_str_seekoff): Likewise.
- * streambuf.h (streampos): Typedef to _IO_off_t resp. _IO_off64_t.
- * parsestream.h (class parsebuf::pos_at_line_start): Change type
- to _IO_off_t.
-
-2000-01-28 Martin v. Löwis <loewis@informatik.hu-berlin.de>
-
- * fstream.h (ifstream::ifstream): Add ios::in to mode.
- (ifstream::open): Likewise.
- (ofstream::ofstream): Add ios::out to mode.
- (ofstream::open): Likewise.
-
-1999-12-21 Martin v. Löwis <loewis@informatik.hu-berlin.de>
-
- * filebuf.cc (open): Support ios::ate if _G_HAVE_IO_FILE_OPEN.
- Remove seek for ios::app if not.
-
-1999-12-14 Martin v. Löwis <loewis@informatik.hu-berlin.de>
-
- * strstream.h (strstreambuf::streambuf): Rename parameters to
- avoid shadow warning.
- * stream.h (WS): Likewise.
-
-Sun Oct 24 23:54:10 PDT 1999 Jeff Law (law@cygnus.com)
-
- * gcc-2.95.2 Released.
-
-Mon Aug 16 01:29:24 PDT 1999 Jeff Law (law@cygnus.com)
-
- * gcc-2.95.1 Released.
-
-1999-08-08 Alexandre Oliva <oliva@dcc.unicamp.br>
-
- * streambuf.h (ios::streamsize): Declare as _IO_ssize_t, as in the
- global scope.
-
-1999-08-07 Andreas Schwab <schwab@suse.de>
-
- * iostream.cc: Add missing calls to isfx and setup a cleanup
- region for the locked stream.
- * iostream.h: Likewise.
- * isgetline.cc: Likewise.
- * isgetsb.cc: Likewise.
- * isscan.cc: Likewise.
-
-Wed Jul 28 21:39:31 PDT 1999 Jeff Law (law@cygnus.com)
-
- * gcc-2.95 Released.
-
-Sun Jul 25 23:40:51 PDT 1999 Jeff Law (law@cygnus.com)
-
- * gcc-2.95 Released.
-
-Mon Jun 28 09:25:23 1999 Hans-Peter Nilsson <hp@bitrange.com>
-
- * configure.in (post-target): Use "$(topsrcdir)", not "$(srcdir)/..".
-
-1999-05-20 Angela Marie Thomas <angela@cygnus.com>
-
- * configure.in: Test for ${compiler_name}.exe as well.
-
-1999-05-17 Mark Kettenis <kettenis@gnu.org>
-
- * libioP.h: Only include libc-lock.h if _IO_MTSAFE_IO is defined.
-
-1999-05-12 Jason Merrill <jason@yorick.cygnus.com>
-
- * configure.in (compiler_name): Don't do the skip-this-dir thing
- if we're reconfiguring.
-
-1999-04-29 Nathan Sidwell <nathan@acm.org>
-
- * streambuf.h (ios::~ios): Use operator delete[] to remove _arrays.
-
-Mon Apr 12 19:22:44 1999 Mumit Khan <khan@xraylith.wisc.edu>
-
- * filedoalloc.c (_POSIX_SOURCE): Remove definition.
- * fileops.c (_POSIX_SOURCE): Likewise.
- * iopopen.c (_POSIX_SOURCE): Likewise.
- * procbuf.cc (_POSIX_SOURCE): Likewise.
- * libioP.h (_POSIX_SOURCE): And define it here.
- * stdiostream.cc: Include libioP.h before others.
-
-Fri Apr 2 15:11:58 1999 H.J. Lu (hjl@gnu.org)
-
- * libio/configure.in (gxx_include_dir): Handle it.
- * libio/Makefile.in: Likewise.
-
-Wed Mar 24 22:36:45 1999 Mumit Khan <khan@xraylith.wisc.edu>
-
- * configure.in (EXEEXT): Define.
- (compiler_name): Use.
-
-1999-03-24 Alexandre Oliva <oliva@dcc.unicamp.br>
-
- * gen-params (CONFIG_NM): `test ... -o ...' is not portable.
-
-Thu Mar 11 01:07:55 1999 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
-
- * configure.in: Cleanup and add mh-*pic handling for arm, powerpc
-
-Fri Mar 5 01:15:15 1999 H.J. Lu (hjl@gnu.org)
-
- * config/linuxlibc1.mt (MT_CFLAGS): Add -D_G_STDIO_USES_LIBIO
- -D_G_HAVE_WEAK_SYMBOL.
-
- * genops.c: Add the proper weak alias if _G_STDIO_USES_LIBIO
- and _G_HAVE_WEAK_SYMBOL are defined.
- * iofclose.c: Likewise.
- * iofeof.c: Likewise.
- * ioferror.c: Likewise.
- * iogetc.c: Likewise.
- * ioputc.c: Likewise.
- * iovsprintf.c: Likewise.
- * iovsscanf.c: Likewise.
-
-Sun Feb 28 22:39:17 1999 Geoffrey Noer <noer@cygnus.com>
-
- * configure.in: Check cygwin*, not cygwin32*.
-
-Wed Feb 10 09:25:48 1999 Mumit Khan <khan@xraylith.wisc.edu>
-
- * gen-params (VTABLE_LABEL_PREFIX): Handle windows32.
-
-Wed Feb 3 22:05:41 1999 H.J. Lu (hjl@gnu.org)
- Jeffrey A Law (law@cygnus.com)
-
- * Makefile.in (iostream.list): Remove dependency on
- stamp-picdir.
- ($(LIBIOSTREAM_DEP)): Depend on stamp-picdir.
- ($(LIBIO_FILES)): Similarly.
-
- * config.shared (all): Make $(PICDIR) concurrent.
-
-1998-11-26 Manfred Hollstein <manfred@s-direktnet.de>
-
- * configure.in (compiler_name): Add check to detect if this
- language's compiler has been built.
-
-1998-10-12 Alexandre Oliva <oliva@dcc.unicamp.br>
-
- * config.shared (depend.new): Delete libc-lock.h from
- dependencies, and fix _G_config.h -> $(_G_CONFIG_H) rule.
- * depend: Rebuilt.
-
-Sun Oct 11 01:51:42 1998 Jeffrey A Law (law@cygnus.com)
-
- * config.shared (depend.new): Fix typo.
- * depend: Rebuilt.
-
-1998-09-09 Manfred Hollstein <manfred@s-direktnet.de>
-
- * configure.in (INSTALLDIR): Fix comment about changing INSTALLDIR's
- value; don't change its value if --enable-version-specific-runtime-libs
- has been specified.
-
-Wed Sep 2 21:05:39 1998 H.J. Lu (hjl@gnu.org)
-
- * configure.in: Fix INSTALLDIR replacement for cross-compile.
-
-Sun Aug 30 22:27:02 1998 Lutz Wohlrab <lutz.wohlrab@informatik.tu-chemnitz.de>
-
- * dbz/Makefile.in: Avoid assumptions about "tr" behaves when
- LANG is set to something other than English.
-
-Sun Aug 30 22:17:00 1998 H.J. Lu (hjl@gnu.org)
-
- * config.shared: Set libsubdir.
-
-1998-08-25 14:34 Ulrich Drepper <drepper@cygnus.com>
-
- * libio/iogetline.c (_IO_getline_info): Don't read anything for
- N == 0. Patch by HJ Lu.
-
-1998-08-23 Mark Mitchell <mark@markmitchell.com>
-
- * iomanip.h: Use __extension__ for `extern' explicit template
- instantiations.
-
-1998-08-17 Ulrich Drepper <drepper@cygnus.com>
-
- * strfile.h: Define __PMT if not already defined.
-
-1998-08-03 Andreas Jaeger <aj@arthur.rhein-neckar.de>
-
- * libioP.h: Use __PMT in typedefs.
- * strfile.h: Likewise.
-
-1998-06-29 Ulrich Drepper <drepper@cygnus.com>
-
- * libio.h: Rewrite __PMT change so that it works with platforms
- defining __P but not __PMT.
-
- * libio.h (__PMT): New macro. Defined like __P. Use is for
- function pointers.
-
-1998-06-27 Manfred Hollstein <manfred@s-direktnet.de>
-
- * Makefile.in (install): Remove superfluous /include.
-
-1998-06-26 Manfred Hollstein <manfred@s-direktnet.de>
-
- * config.shared (FLAGS_TO_PASS): Add gcc_version_trigger.
- (Makefile): Add dependency upon $(gcc_version_trigger).
-
-1998-06-24 Manfred Hollstein <manfred@s-direktnet.de>
-
- * Makefile.in (install): Install _G_config.h depending on new flag
- --enable-version-specific-runtime-libs.
- * config/linux.mt (gxx_include_dir): Remove definition here as we use
- gcc's default anyway.
-
-1998-06-24 Manfred Hollstein <manfred@s-direktnet.de>
-
- * config.shared (FLAGS_TO_PASS): Add gcc_version.
-
-1998-06-19 Manfred Hollstein <manfred@s-direktnet.de>
-
- * config.shared (FLAGS_TO_PASS): Add libsubdir.
-
-1998-06-07 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * genops.c (__underflow): Read character from read pointer as unsigned.
- (__uflow): Likewise.
-
-1998-05-22 Ulrich Drepper <drepper@cygnus.com>
-
- * strops.c (_IO_str_underflow): Read newly available character
- from buffer as unsigned.
-
-Sun Apr 19 22:13:36 1998 H.J. Lu (hjl@gnu.org)
-
- * isgetline.cc (istream::get): Fix a typo.
-
-Thu Mar 5 09:23:28 1998 Manfred Hollstein <manfred@s-direktnet.de>
-
- * configure.in: Make locating frag files failsafe even for the
- special case if configuring and building in srcdir.
-
-1998-02-24 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- Changes for _G_IO_IO_FILE_VERSION == 0x20001:
- * libioP.h (_IO_showmanyc_t, _IO_SHOWMANYC, _IO_imbue_t,
- _IO_IMBUE): New definitions.
- (struct _IO_jump_t): Add __showmanyc and __imbue fields.
- (_IO_file_fopen): Add new fourth argument.
- * filebuf.cc (filebuf::open): Pass new fourth argument to
- _IO_file_fopen.
- * iolibio.h (_IO_freopen): Likewise.
- * streambuf.cc (streambuf::showmanyc, streambuf::imbue): New
- functions.
- * streambuf.h (_IO_wchar_t): Define to _G_wchar_t.
- (ios::fill): Remove casts.
- (struct streambuf): Add showmanyc and imbue members.
-
- * iostream.cc (ostream::operator<<(double n)) [__GLIBC_MINOR__ >=
- 1]: Initialize new fields is_char of struct printf_info.
- (ostream::operator<<(long double n)) [__GLIBC_MINOR__ >= 1]:
- Likewise.
-
-Sun Feb 22 17:24:53 1998 Jeffrey A Law (law@cygnus.com)
-
- * config.shared: Bring back changes from Ian and Fred that were
- accidentally clobbered. Should eliminate the need for Dave's
- recent change.
-
-Tue Feb 17 21:56:25 1998 H.J. Lu (hjl@gnu.org)
-
- * config/linux.mt (IO_OBJECTS): Add iogetline.o.
- * config/linuxlibc1.mt: Ditto.
-
- * iogetline.c (_IO_getline_info): Renamed from _IO_getline.
- (_IO_getline): Just call _IO_getline_info.
-
- * isgetline.cc (istream::getline, istream::get, _sb_readline):
- Call _IO_getline_info instead of _IO_getline and get the EOF
- information.
- * sbgetline.cc (streambuf::sgetline): Ditto.
-
- * libioP.h (_IO_getline_info): New declaration.
-
- * iogetline.c (_IO_getline): Handle the case when there is no
- buffer.
-
-Fri Feb 13 00:57:20 1998 Krister Walfridsson (cato@df.lth.se)
-
- * fileops.c: #include <unistd.h>.
- * ioprims.c: Likewise.
-
-1998-02-10 Mark Mitchell <mmitchell@usa.net>
-
- * iostream.cc (ostream::operator<<(long double)): Don't use
- labeled initializers.
-
-Fri Feb 6 01:35:56 1998 Manfred Hollstein <manfred@s-direktnet.de>
-
- * config.shared (FLAGS_TO_PASS): Don't emit PICFLAG.
- (.c.o): Check value of enable_shared, not PICFLAG.
- (.C.o): Dito.
- (.cc.o): Dito.
- (stamp-picdir): Dito.
-
-Thu Feb 5 17:41:26 1998 Dave Brolley <brolley@cygnus.com>
-
- * config.shared (LIBS): Change to -L../../libstdc++ (was -L../libstdc++)
- if ${DOING_GPERF} is true.
-
-1998-01-20 Andreas Schwab (schwab@issan.informatik.uni-dortmund.de)
-
- * iostream.cc (istream::operator>>(long double&))
- [!_G_HAVE_LONG_DOUBLE_IO]: Scan value into separate variable, in
- case long double is bigger than double.
- (ostream::operator<<(double)) [_G_HAVE_PRINTF_FP]: Fix order of
- initializers of struct printf_info to match declaration order,
- to work around g++ bug.
- (ostream::operator<<(long double)) [_G_HAVE_PRINTF_FP]: Likewise.
-
- * gen-params: Add missing quotes. Avoid useless use of command
- substitution.
-
-Sun Feb 1 13:29:47 1998 H.J. Lu (hjl@gnu.org)
-
- * filebuf.cc (filebuf::open): Call _IO_file_open if
- _G_HAVE_IO_FILE_OPEN is 1.
-
- * libio.h (_IO_fpos64_t, _IO_off64_t): Defined if
- _G_IO_IO_FILE_VERSION == 0x20001.
-
- * libioP.h (_IO_file_open): New declaration.
-
- * libio.h (_IO_FILE, _IO_stdin_, _IO_stdout_, _IO_stderr_,
- _IO_seekoff, _IO_seekpos): Add support for libio in glibc 2.1.
- * libioP.h (_IO_seekoff_t, _IO_seekpos_t, _IO_seek_t,
- _IO_seekoff, _IO_seekpos, _IO_default_seekoff,
- _IO_default_seekpos, _IO_default_seek, _IO_file_seekoff,
- _IO_file_seek, _IO_str_seekoff, _IO_pos_BAD, _IO_pos_as_off,
- _IO_pos_0): Ditto.
- * streambuf.h (streamoff, streampos): Ditto.
-
- * gen-params (__extension__): Use only if gcc version >= 2.8.
-
-Sun Feb 1 13:08:18 1998 Krister Walfridsson (cato@df.lth.se)
-
- * dbz/dbz.c (putconf): Handle systems which use "long long" as type
- for "off_t".
- * dbz/dbzmain.c (mkfiles): Likewise.
-
-Wed Jan 28 10:27:11 1998 Manfred Hollstein <manfred@s-direktnet.de>
-
- * config.shared (FLAGS_TO_PASS): Add gxx_include_dir.
-
- * stdio/configure.in, tests/configure.in: Update with yesterday's
- toplevel configure.in changes.
- * testsuite/configure.in: Likewise.
-
- * config.shared: Fix typo in yesterday's changes.
-
-Tue Jan 27 23:26:07 1998 Manfred Hollstein <manfred@s-direktnet.de>
-
- * config.shared: Emit everything which needs to be re-definable
- via file descriptor 1; the generic stuff is emitted using redirection
- onto fd 2.
-
- * configure.in (package_makefile_rules_frag): New variable
- which is used in the call to config.shared; redirect file descriptor 2
- to ${package_makefile_rules_frag}.
-
-Tue Jan 27 10:35:22 1998 H.J. Lu (hjl@gnu.org)
-
- * configure.in (topsrcdir): New.
- (CHECK_SUBDIRS, configdirs): Check ${topsrcdir}/gcc instead.
- (config-ml.in): Use ${topsrcdir}/config-ml.in.
-
- * tests/configure.in (topsrcdir): New.
- (CHECK): Check ${topsrcdir}/gcc instead.
-
-Fri Jan 16 00:48:03 1998 Manfred Hollstein <manfred@lts.sel.alcatel.de>
-
- * config.shared (FLAGS_TO_PASS): Add SHELL.
-
-Thu Jan 15 00:21:58 1998 Ian Lance Taylor <ian@cygnus.com>
-
- * configure.in: For *-*-cygwin32*, add a -I for winsup to both
- XCINCLUDES and XCXXINCLUDES.
- * config.shared: Use ${host_includes} when setting CXXINCLUDES in
- the DOING_LIBGXX case.
- * Makefile.in (_G_config.h): Pass $(CINCLUDES) in CC and
- $(CXXINCLUDES) in CXX when running gen-params.
-
-Tue Jan 13 21:32:08 1998 H.J. Lu (hjl@gnu.org)
-
- * configure.in (CHECK_SUBDIRS): Set to testsuite only if
- ${srcdir}/../gcc exists.
- (configdirs): Include testsuite only if ${srcdir}/../gcc exists.
-
- * tests/Makefile.in (check): Depend on $(CHECK).
-
- * tests/configure.in (CHECK): Set to "check-iostream
- check-stdio" if ${srcdir}/../../gcc doesn't exists.
-
-Thu Jan 8 18:09:03 1998 Fred Fish <fnf@cygnus.com>
-
- * config.shared (THIS_FILE): Really found via TOLIBIO instead
- of TOLIBCXX, which is empty when configuring gperf.
- (LIBS): When linking gperf, find libstdc++ relative to TO_TOPDIR
- instead of hardcoded "../".
-
-1997-12-12 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- Don't make gperf depend upon libg++.
- * config.shared (TOLIBGCXX) [DOING_GPERF]: Delete.
- (LIBS) [DOING_GPERF]: Make it just `-L../libstdc++ -lstdc++'.
-
-Thu Dec 11 11:20:59 1997 H.J. Lu (hjl@gnu.org)
-
- * configure.in (target frags): Add *-linux-gnu.
-
-Fri Dec 5 16:22:15 1997 H.J. Lu (hjl@gnu.org)
-
- * streambuf.cc (streambuf::~streambuf): Don't delete _lock
- for _IO_stdin/_IO_stdout/_IO_stderr.
-
-Thu Nov 27 01:32:43 1997 Jeffrey A Law (law@cygnus.com)
-
- * Makefile.in (install): Change gxx_includedir to gcc_include_dir.
- * config.shared (gxx_includedir): Remove default definition.
- * config/linux.mt: Change gxx_includedir to gxx_include_dir.
- * config/linuxaxp1.mt: Likewise.
-
-Wed Nov 26 16:08:50 1997 Richard Henderson (rth@cygnus.com)
-
- * configure.in (target frags): Add powerpc*-linux-gnulibc1.
- (stdio-lock): Similarly.
-
- * configure.in (target frags): Add alpha*-linux-gnulibc1.
- (pic frags): Its alpha*- not alpha-.
- (stdio-lock): Kill everything. Add alpha*-linux-gnulibc1.
- * libio.h: Check __GLIBC_MINOR__ to find stdio-lock.h. If not
- _IO_MTSAFE_IO & GLIBC, make sure the lock pointer is still there.
- * libioP.h: Check __GLIBC_MINOR__ to find libc-lock.h.
-
- * config/linuxaxp1-libc-lock.h: New file.
- * config/linuxaxp1-stdio-lock.h: New file.
- * config/linuxaxp1.mt: New file.
-
- * gen-params (va_list): Check for and use __gnuc_va_list.
- (NULL): Work around some linux kernel headers and redefine NULL.
-
-Mon Nov 24 17:04:18 1997 Michael Meissner <meissner@cygnus.com>
-
- * stdiostream.cc (sys_read): Declare ch with int type, rather than
- without a type.
-
-Tue Nov 18 09:53:58 1997 H.J. Lu (hjl@gnu.ai.mit.edu)
-
- * stdstrbufs.cc (DEF_STDFILE): Use STD_VTABLE.
-
-Tue Nov 11 01:40:17 1997 Oleg Krivosheev <kriol@fnal.gov>
-
- * iomanip.h: Fix guiding decls.
-
-1997-11-05 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * libio.h (__P): Name its arg `p' instead of `params'.
- Avoids problems with an unchanged Solaris math.h header.
-
-Wed Oct 29 23:01:47 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * gen-params: Override NULL.
-
-1997-10-27 03:53 Ulrich Drepper <drepper@cygnus.com>
-
- * stdio-lock.h: Removed. Was never needed.
-
-Wed Oct 22 19:19:32 1997 H.J. Lu (hjl@gnu.ai.mit.edu)
-
- * libio.h (_IO_LOCK_T): Handle glibc 2 when _IO_MTSAFE_IO is
- not defined.
-
- * iovsscanf.c (vsscanf): Make it weak alias of _IO_vsscanf if
- __linux__ is defined instead of __ELF__
-
- * config/linuxlibc1.mt (USER_INCLUDES): Add libio.h.
-
-1997-10-15 Ulrich Drepper <drepper@cygnus.com>
-
- * configure.in: Create compatibility code in bits/libc-lock.h file.
-
-Thu Oct 9 07:08:41 1997 H.J. Lu (hjl@gnu.ai.mit.edu)
-
- * libio.h (_IO_LOCK_T): Handle glibc 2 when _IO_MTSAFE_IO is
- not defined.
-
- * filedoalloc.c (_IO_file_doallocate): Don't call
- _IO_cleanup_registration_needed if __linux__ is defined.
-
- * iofclose.c (fclose): Make it weak alias of _IO_fclose if
- __ELF__ is defined.
-
- * iovsprintf.c (vsprintf): Make it weak alias of _IO_vsprintf
- if __ELF__ is defined.
-
- * iovsscanf.c (vsscanf): Make it weak alias of _IO_vsscanf if
- __ELF__ is defined.
-
- * config/linuxlibc1.mt (MT_CFLAGS): Defined as -D_G_HAVE_MMAP.
- (IO_OBJECTS): Add filedoalloc.o fileops.o genops.o iofclose.o
- iovsprintf.o iovsscanf.o strops.o.
-
-Fri Oct 3 10:13:13 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * iostream.cc, libio.h: Convert other uses of #ifdef
- _G_HAVE_PRINTF_FP to #if.
-
-1997-10-02 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * iostream.cc (operator<<): Use `#if _G_HAVE_PRINTF_FP', not ifdef.
-
-Thu Oct 2 10:36:49 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * gen-params: Fix __printf_fp test.
- * config/linuxlibc1.mt (gxx_includedir): Don't define.
-
-Thu Oct 2 10:36:26 1997 Ulrich Drepper <drepper@rtl.cygnus.com>
-
- * config/linuxlibc1.mt (_G_CONFIG_H): Don't define.
- * gen-params: Add test for __printf_fp.
-
-Sun Sep 28 12:09:04 1997 Mark Mitchell <mmitchell@usa.net>
-
- * iomanip.h: Use new friend <> syntax.
-
-Sun Sep 28 12:04:21 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * libio.h: Don't use _IO_LOCK_T if it's not defined.
-
-Fri Sep 26 20:56:41 1997
-
- Based on a patch by H.J. Lu (hjl@gnu.ai.mit.edu).
-
- * Makefile.in (STDIO_OBJECTS): New. Defined as stdfiles.o.
- (LIBIO_OBJECTS): Add $(STDIO_OBJECTS).
- (PICFLAG): New, empty. moved to here from config.shared.
-
- * config.shared (DISTCLEAN): Add target-mkfrag.
- (PICFLAG): Removed.
-
- * configure.in (*-linux-gnulibc1): Remove warning.
- (*-linux-gnu): Use linux.mt mtsafe.mt.
- (alpha-*-linux*): Use mh-elfalphapic.
-
- * gen-params (_G_ullong): Also check unsigned long long int.
- (_G_llong): Also check long long int.
-
- * libio.h (_IO_lock_t): Add support for the Linux libc 5.
- (_IO_peekc): Defined as _IO_peekc_unlocked if _IO_MTSAFE_IO
- is not defined.
-
- * iostream.cc (__cvt_double): Fix a typo in declaration.
- (info): Use expr != 0 to initialize the bit fields. Don't
- initialize "extra" for the Linux libc 5.
-
- * streambuf.h (_G_NEED_STDARG_H): Changed from _IO_NEED_STDARG_H.
-
- * config/linux.mt (STDIO_OBJECTS): New, empty.
- (MT_CFLAGS): Removed.
-
- * config/linuxlibc1.mt: Rewrite. it's identical to linux.mt but
- IO_OBJECTS mentions files not in early libc5 versions.
-
- * config/mtsafe.mt: New.
-
- * dbz/Makefile.in (check): Support make -j.
-
- * tests/tFile.cc (tempfile): Fix a typo.
-
-1997-09-19 11:52 Jim Wilson <wilson@cygnus.com>
-
- * Makefile.in (LIBIO_OBJECTS): Depend on _G_CONFIG_H.
-
-1997-09-17 04:08 Ulrich Drepper <drepper@cygnus.com>
-
- * iostream.cc: Add forward declaration for __cvt_double.
- * libio.h: Define _IO_USE_DTOA is _G_HAVE_PRINTF_FP is not defined.
- * strops.c (_IO_str_count): Correct last change.
-
-1997-09-17 02:50 Ulrich Drepper <drepper@cygnus.com>
-
- * libioP.h: Define __set_errno if not already defined.
-
-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>
-
- * Makefile.in (iostream.list): Remove STDIO_WRAP_OBJECTS.
-
-Mon Sep 8 01:30:27 1997 Weiwen Liu <liu@hepunix.physics.yale.edu>
-
- * libio.h: Fix typo.
-
-Sun Sep 7 23:00:18 1997 Jim Wilson (wilson@cygnus.com)
-
- * linux.mt (LIBIOSTREAM_DEP): Change stdio.list to stmp-stdio.
-
-Fri Sep 5 09:58:43 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * Makefile.in (iostream.list): Instead of adding stdio.list, add
- STDIO_WRAP_OBJECTS.
- (iostream.list): Lose dependency on stmp-stdio, not necessary for
- our stuff. The stdio stuff is present here just for uniformity
- with glibc.
-
-Thu Sep 4 17:26:22 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * parsestream.cc (general_parsebuf): Cast return of malloc to char*.
-
-1997-09-04 16:11 Ulrich Drepper <drepper@cygnus.com>
-
- Change compared to version initially intended to in:
- * strops.c (_IO_str_count): Still use _IO_write_ptr, not
- _IO_write_end, for now.
-
- * iofeof.c, ioferror.c, iofflush_u.c, iogetc.c, ioputc.c, peekc.c,
- stdio-lock.h: New files.
-
- * include: New dir.
- * include/empty.h: New header.
-
- * filedoalloc.c: Update and reformat copyright.
- Don't use DEFUN.
- Use __set_errno throughout the code to support multi-threaded
- programs.
- Correct layout to follow the Coding Standard.
- Add casts to prevent warnings.
- * fileops.c: Likewise.
- * genops.c: Likewise.
- * iofclose.c: Likewise.
- * iofdopen.c: Likewise.
- * iofflush.c: Likewise.
- * iofgetpos.c: Likewise.
- * iofgets.c: Likewise.
- * iofopen.c: Likewise.
- * iofprintf.c: Likewise.
- * iofputs.c: Likewise.
- * iofread.c: Likewise.
- * iofsetpos.c: Likewise.
- * ioftell.c: Likewise.
- * iofwrite.c: Likewise.
- * iogetdelim.c: Likewise.
- * iogetline.c: Likewise.
- * iogets.c: Likewise.
- * iopadn.c: Likewise.
- * iopopen.c: Likewise.
- * ioputs.c: Likewise.
- * ioseekoff.c: Likewise.
- * iosetbuffer.c: Likewise.
- * iosetvbuf.c: Likewise.
- * iosprintf.c: Likewise.
- * ioungetc.c: Likewise.
- * iovsprintf.c: Likewise.
- * iovsscanf.c: Likewise.
- * libio.h: Likewise.
- * libioP.h: Likewise.
- * stdfiles.c: Likewise.
- * strfile.h: Likewise.
- * strops.c: Likewise.
-
- * Makefile.in (IO_OBJECTS): Add peekc.o, iogetc.o, ioputc.o,
- iofeof.o, and ioferror.o.
- (iostream.list): Depend upon stmp-stdio. Add the entries
- from stdio.list to iostream.list.
- (stmp-stdio): New name for what was the stdio/stdio.list rule.
- All it now does is cd down into stdio and build stdio.list.
-
- * configure.in (ALL): Add libiostream.a.
-
- * libio.h [_IO_MTSFE_IO]: Include header declaring locking code.
- Otherwise define opaque _IO_lock_t.
- Define _IO_cookie_file.
- Rename _IO_getc to _IO_getc_unlocked, _IO_peekc to _IO_peekc_unlocked,
- _IO_putc to _IO_putc_unlocked, _IO_feof to _IO_feof_unclocked, and
- _IO_ferror to _IO_ferror_unlocked.
- Add prototypes for _IO_getc, _IO_putc, _IO_feof, _IO_ferror,
- and _IO_peekc_locked.
- Add declarations for _IO_flockfile, _IO_funlockfile, and
- _IO_ftrylockfile. If !_IO_MTSAFE_IO define _IO_flockfile,
- _IO_funlockfile, _IO_ftrylockfile, _IO_cleanup_region_start, and
- _IO_cleanup_region_end as empty macros.
-
- * libioP.h: Change type of finish function to take an additional int
- argument and change declaration of finish functions.
- Add prototypes for _IO_seekoff and _IO_seekpos.
- If _G_HAVE_MMAP is defined use stream buffers allocated with mmap.
- Redefine FREE_BUF and ALLOC_BUF macros to help in both situations.
- (FILEBUF_LITERAL): If we compile for a thread-safe library also
- initialize lock member.
-
- * filedoalloc.c: Take care for systems already defining _POSIX_SOURCE.
- Keep name space clean on systems which require this.
- (_IO_file_doallocate): Adopt ALLOC_BUF call for changed semantic.
-
- * fileops.c: Keep name space clean on systems which require this.
- (_IO_file_attach): Don't fail if seek failed because it's used on a
- pipe.
- (_IO_file_underflow): Update buffer pointers before calling `read'
- since the `read' might not return anymore.
- (_IO_file_overflow): If stream allows no writes set error flag.
- (_IO_seekoff): Make sure that after flushing the file pointer in
- the underlying file is exact.
- (_IO_file_read): Don't restart `read' syscall if it return EINTR.
- This violates POSIX.
- (_IO_file_write): Likewise for `write'.
- (_IO_cleanup): Install as exit handler in glibc.
-
- * genops.c (_IO_setb): Correctly use FREE_BUF.
- (_IO_default_doallocate): Correctly use ALLOC_BUF.
- (_IO_init): Initialize lock in stream structure.
- (_IO_default_finish): Destroy lock.
- (_IO_get_column): Don't compile since it's not needed.
- (_IO_nobackup_default): Likewise.
-
- * iopopen.c: Take care for systems already defining _POSIX_SOURCE.
- Correct _IO_fork and _IO_dup2 prototypes.
-
- * iofclose.c: Acquire lock before starting the work.
- * iofflush.c: Likewise.
- * iofgetpos.c: Likewise.
- * iofgets.c: Likewise.
- * iofputs.c: Likewise.
- * iofread.c: Likewise.
- * iofsetpos.c: Likewise.
- * ioftell.c: Likewise.
- * iofwrite.c: Likewise.
- * iogetdelim.c: Likewise.
- * iogets.c: Likewise.
- * ioputs.c: Likewise.
- * iosetbuffer.c: Likewise.
- * iosetvbuf.c: Likewise.
- * ioungetc.c: Likewise.
-
- * iofdopen.c: Create and initialize lock for new stream.
- * iofopen.c: Likewise.
- * iopopen.c (_IO_popen): Likewise.
- * iovsprintf.c: Likewise.
- * iovsscanf.c: Likewise.
-
- * genops.c: Make weak aliases for various functions.
- * iofclose.c: Likewise.
- * iofdopen.c: Likewise.
- * iofflush.c: Likewise.
- * iofgetpos.c: Likewise.
- * iofgets.c: Likewise.
- * iofopen.c: Likewise.
- * iofputs.c: Likewise.
- * iofread.c: Likewise.
- * iofsetpos.c: Likewise.
- * ioftell.c: Likewise.
- * iofwrite.c: Likewise.
- * iogetdelim.c: Likewise.
- * iogets.c: Likewise.
- * ioputs.c: Likewise.
- * iosetbuffer.c: Likewise.
- * iosetvbuf.c: Likewise.
- * ioungetc.c: Likewise.
- * iovsprintf.c: Likewise.
- * iovsscanf.c: Likewise.
-
- * iofflush_u.c: New file. fflush_unlocked implementation.
-
- * iostream.h [_G_HAVE_LONG_DOUBLE_IO]: Declare real long double
- output operator.
-
- * peekc.c: New file. Implement _IO_peekc_locked function.
-
- * stdfiles.c: If we compile for a thread-safe library also define
- lock variable.
-
-Tue Aug 26 12:24:01 1997 H.J. Lu (hjl@gnu.ai.mit.edu)
-
- * testsuite/Makefile.in (check): Don't depend on site.exp.
- (just-check): Depend on site.exp.
-
-Wed Aug 20 02:01:34 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * iostream.h: Add copy assignment ops for _IO_?stream_withassign.
-
-Tue Jul 22 10:31:41 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * config.shared (CHECK_SUBDIRS): Use install-sh, not install.sh.
-
-Wed Jun 25 12:20:55 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * config.shared (DOING_GPERF): Look for this, defining TOLIBGXX
- and LIBS for it.
-
-Wed Jun 18 11:03:34 1997 Bob Manson <manson@charmed.cygnus.com>
-
- * config.shared (FLAGS_TO_PASS): Don't include RUNTEST.
-
-Tue Jun 17 22:23:48 1997 Bob Manson <manson@charmed.cygnus.com>
-
- * config.shared (FLAGS_TO_PASS): Pass RUNTEST and RUNTESTFLAGS.
-
-Fri May 16 21:08:53 1997 Bob Manson <manson@charmed.cygnus.com>
-
- * iovfprintf.c: Declare __cvt_double before use.
-
- * floatconv.c (d2b): Use _G_int32_t instead of int for the
- e and bits parameters.
- (_IO_strtod): Use _G_int32_t.
-
- * gen-params: Look for NO_USE_DTOA and USE_INT32_FLAGS.
-
- * strops.c (_IO_str_init_static): use _G_int32_t appropriately.
-
- * libio.h: If _G_NO_USE_DTOA is set, then don't define
- _IO_USE_DTOA.
-
- * config/mn10200.mt: Don't use dtoa, it only works
- for "real" doubles.
-
-Thu May 15 17:44:12 1997 Bob Manson <manson@charmed.cygnus.com>
-
- * configure.in: Set CHECK_SUBDIRS to testsuite if we're doing
- a cross compile.
-
- * config.shared(check): Only run make check in the directories
- specified by CHECK_SUBDIRS. Set CHECK_SUBDIRS to SUBDIRS
- if it has no previous value.
-
-Thu May 1 17:35:19 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * Makefile.in (test, tpipe): Add $(CFLAGS).
-
-Wed Apr 30 12:16:29 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * configure.in: Don't turn on multilib here.
-
-Sat Apr 26 13:38:21 1997 Bob Manson <manson@charmed.cygnus.com>
-
- * configure.in (configdirs): Add testsuite directory.
-
- * testsuite/ChangeLog:
- * testsuite/Makefile.in:
- * testsuite/libio.tests/tiomanip.exp:
- * testsuite/libio.tests/tstdiomisc.exp:
- * testsuite/libio.tests/tiomisc.exp:
- * testsuite/libio.tests/tFile.exp:
- * testsuite/libio.tests/tfformat.exp:
- * testsuite/libio.tests/tiformat.exp:
- * testsuite/libio.tests/hounddog.exp:
- * testsuite/libio.tests/putbackdog.exp:
- * testsuite/configure.in:
- * testsuite/lib/libio.exp:
- * testsuite/config/default.exp:
- New files for DejaGnu-style testsuite.
-
-Fri Apr 4 03:16:44 1997 Ulrich Drepper <drepepr@cygnus.com>
-
- * configure.in: Enable multilibing by default.
- Update multilib template to read config-ml.in.
-
- * floatconv.c: Enable use in cross targets which use the
- newlib ieeefp.h header.
-
-Thu Jan 23 09:16:16 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * libioP.h (_IO_file_attach): Delete redundant decl.
-
-Tue Jan 21 22:13:45 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * streambuf.h (class ios): Take out STREAMSIZE member, since we
- only need (and should only have) the global one.
-
-Tue Jan 7 14:02:40 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * iostream.h (long long fns): Use __extension__.
-
- * gen-params: Use _G_llong and _G_ullong instead of long long for
- deduced types.
-
-Fri Dec 6 13:13:30 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * dbz/dbz.c: Use off_t.
-
-Sat Nov 23 15:44:37 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * Makefile.in (install): Don't install _G_config.h with other headers.
-
-Mon Nov 18 17:12:41 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * config.shared (SUBDIRS): Use -O instead of -O3 for debugging.
-
-Sun Nov 3 12:43:34 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * iostream.cc (write_int): Treat string literals as const.
-
-Thu Sep 26 10:09:18 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * depend: Regenerate.
-
-Wed Sep 25 22:54:45 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * config.shared (depend.new): Deal with headers that don't end in .h.
-
-Thu Aug 29 17:05:53 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * configure.in (i[345]86-*-*): Recognize i686 for pentium pro.
-
-Mon Aug 5 01:26:32 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * config{ure.in,.shared} (DISTCLEAN): Add multilib.out.
-
-Fri Aug 2 17:39:35 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * libio.h (NULL): Use __null.
- * libioP.h (NULL): Ditto.
- * streambuf.h (NULL): Ditto.
- * ioextend.cc (get_array_element): Use NULL instead of (void*)0.
-
-Fri Jul 5 18:26:41 1996 Jim Wilson <wilson@cygnus.com>
-
- * strfile.h (struct _IO_streambuf): New struct type.
- (struct _IO_strfile): Use it.
-
-Tue Jun 18 18:24:21 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * fstream.h (fstreambase): Make __my_fb mutable.
- From Joe Buck.
-
-Tue Jun 18 11:03:53 1996 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * dbz/fake.c (main): Set return type to int.
- * dbz/dbzmain.c (main): Likewise.
- * dbz/byteflip.c (main): Likewise.
-
-Mon Jun 17 14:05:36 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * gen-params: Check if clog conflicts with system libraries.
- * stdstreams.cc: If it does, use __IO_clog.
- * iostream.h: Likewise.
-
-Tue Jun 11 13:39:31 1996 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * stdiostream.h (istdiostream (FILE*)): Put istream base
- initializer before init for __f.
- (ostdiostream (FILE*)): Likewise for ostream base init.
-
-Tue May 14 11:47:21 1996 Per Bothner <bothner@andros.cygnus.com>
-
- * strfile.h (_IO_str_fields): Removed _len field.
- (_IO_STR_DYNAMIC, _IO_STR_FROZEN): new macros.
- * strstream.h (strstreambuf::is_static): Removed.
- (strstreambuf::frozen): Use _IO_STR_DYNAMIC instead of is_static.
- * strstream.h, strstream.cc: Remove support for !_IO_NEW_STREAMS.
- * strstream.cc (strstreambuf::init_dynamic): Don't set _s._len.
- * strops.c (_IO_str_init_static): Better handling of the
- negative (== unbounded) size case.
- (_IO_str_overflow, _IO_str_underflow, _IO_str_count): Re-write
- to not use _s._len, and otherwise cleanup/fix.
- * strstream.h, strstream.cc (strstreambase::strstreambase()): Call
- ios::init here.
- (other constructors): Simplify - init already called.
-
-Tue May 14 10:55:21 1996 Per Bothner <bothner@deneb.cygnus.com>
-
- Change so that strstreambuf default constructor does no allocation.
- * strstream.h (strstreambuf::init_dynamic): Default initial size = 0.
- * strstream.cc (strstreambuf::init_dynamic): Don't allocate a
- buffer (yet) if initial_size is 0.
- * strops.c (_IO_str_overflow): Add 100 to size of re-allocated
- buffer, to handle case when initial size is 0.
-
- * iostdio.h (remove, rename, tmpfile, tempnam): Comment out.
-
-Mon May 13 23:19:39 1996 Per Bothner <bothner@deneb.cygnus.com>
-
- * fileops.c (_IO_file_close_it): Just call _IO_do_flush rather
- than _IO_file_sync, to avoid useless lseek.
-
-Tue May 14 10:48:48 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * floatconv.c (_IO_strtod): Force rv into the stack.
-
- * config.shared (gxx_includedir): Now $(includedir)/g++.
-
-Sat Apr 27 02:37:49 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * libioP.h (JUMP*): Implement for thunks.
- (_IO_jump_t): Add second dummy field for thunks.
-
-Thu Apr 25 13:20:00 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * config.shared (CXX): Use gcc, not g++.
-
-Wed Apr 24 10:29:50 1996 Doug Evans <dje@blues.cygnus.com>
-
- * config.shared (depend.new): Delete $(srcdir)/ from foo.{c,cc}
- for SunOS VPATH.
- * depend: Regenerated.
-
-Fri Apr 19 17:24:51 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * Version 2.8.0b3.
-
-Wed Apr 10 17:16:01 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * configure.in (ALL): Don't build iostream.a.
-
-Mon Apr 8 14:44:11 1996 Per Bothner <bothner@kalessin.cygnus.com>
-
- * iosetvbuf.c (_IO_setvbuf): Clear _IO_UNBUFFERED unless _IONBF.
-
-Mon Apr 8 15:08:23 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * configure.in: Permit --enable-shared to specify a list of
- directories.
-
-Fri Apr 5 17:48:56 1996 Per Bothner <bothner@kalessin.cygnus.com>
-
- * config.shared (MOSTLYCLEAN): Also remove ${EXTRA_MOSTLYCLEAN}.
-
-Fri Mar 22 23:25:00 1996 Ulrich Drepper <drepepr@gnu.ai.mit.edu>
-
- * genops.c (_IO_sputbackc, _IO_sungetc): Clear EOF flag if putsh
- back was successful.
-
-Wed Mar 27 11:54:08 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * Version 2.8.0b2.
-
-Fri Mar 22 15:39:36 1996 Per Bothner <bothner@kalessin.cygnus.com>
-
- * fileops.c (_IO_do_write): Revert previous fix. (It fails to
- handle the case that fp->_IO_read_end != fp->_IO_write_base.)
- (_IO_file_overflow): Instead, if _IO_read_ptr is at the end of
- the buffer, reset all the read pointers to _IO_buf_base.
-
-Tue Mar 12 12:03:17 1996 Per Bothner <bothner@kalessin.cygnus.com>
-
- * fileops.c (_IO_do_write): Even if to_do==0, must re-set buffer
- pointers. Bug and solution from Luke Blanshard <luke@cs.wisc.edu>.
-
-Wed Feb 28 10:00:24 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * Version 2.8.0b1.
-
-Tue Feb 27 18:08:16 1996 Per Bothner <bothner@kalessin.cygnus.com>
-
- * iopopen.c (_IO_proc_open): Use (char*)0 rather than imprecise NULL.
-
- * streambuf.h (ios): Add ios::binary; deprecate ios::bin.
- * filebuf.cc (filebuf::open): Handle ios::binary.
-
-Fri Feb 9 12:40:19 1996 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * cleanup.c (_IO_cleanup_registration_needed) [!_G_HAVE_ATEXIT]: Init
- to NULL.
- * filedoalloc.c (_IO_cleanup_registration_needed): Remove decl.
-
-Thu Feb 8 08:12:50 1996 Brendan Kehoe <brendan@cygnus.com>
-
- * filedoalloc.c (_IO_cleanup_registration_needed): Revert previous
- change, since cleanup.c only defines it if _G_HAVE_ATEXIT.
-
-Wed Feb 7 15:10:17 1996 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * filedoalloc.c (_IO_cleanup_registration_needed): Declare as extern.
-
-Tue Dec 12 17:21:13 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * indstream.h, instream.cc (indirectbuf::uflow): New method.
- * indstream.cc (indirectbuf::underflow): Fix to use sgetc, not sbumpc.
- Fixes bug reported by Kevin Beyer <beyer@cs.wisc.edu>.
-
- * indstream.cc (indirectbuf::seekpos): Add paranoia test.
-
-Fri Dec 8 14:55:34 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * stream.h: Add warning to not use these functions.
- * stream.cc (str, chr): Re-implement here (from libg++).
-
-Tue Nov 28 15:07:01 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * config.shared: Use test instead of [ to avoid DEC Unix lossage.
-
-Thu Nov 23 14:51:43 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * iopopen.c: Move #include <sys/types.h> ahead of #include <signal.h>
- to deal with BSDI's literal implementation of Posix.
-
-Sat Nov 25 11:21:55 1995 Doug Evans <dje@canuck.cygnus.com>
-
- * Makefile.in (install): Set rootme.
- * config.shared (TOPDIR): Set with ${foo-...} rather than ${foo=...}.
- (INSTALL): Handle absolute, dot, relative-not-dot values of srcdir.
- (TEXIDIR): Likewise.
-
-Tue Nov 21 14:12:05 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * configure.in: Check ${with_cross_host} rather than comparing
- ${host} and ${target}.
-
-Mon Nov 20 13:55:29 1995 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * configure.in: Match *-sco3.2v[45]*.
-
-Wed Nov 15 20:19:31 1995 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * config.shared (FLAGS_TO_PASS): Also pass SHLIB and SHCURSES.
-
-Tue Nov 14 01:41:08 1995 Doug Evans <dje@canuck.cygnus.com>
-
- * config.shared (TO_REAL_TOPDIR): Define.
- (MULTITOP): Deleted.
- (MULTISRCTOP, MULTIBUILDTOP): New.
- (TOPDIR): Change MULTITOP to MULTIBUILDTOP, and use TO_REAL_TOPDIR.
- (INSTALL): Add with_multisrctop, TO_REAL_TOPDIR.
- (TEXIDIR): Use TO_REAL_TOPDIR.
- (LIBS): Delete MULTITOP.
- (FLAGS_TO_PASS): Add NM.
- (CXXINCLUDES): Delete MULTITOP.
- (depend.new): Delete adding MULTITOP to ../ build tree references.
- Add MULTISRCTOP to ../ source tree references.
- * configure.in: Delete call to cfg-ml-com.in. Call config-ml.in
- instead of cfg-ml-pos.in.
-
-Sun Nov 12 16:30:48 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * Makefile.in (VERSION): Set to 2.7.1.
- * configure.in: Add warning for Linux.
- * config.shared (DISTCLEAN): Add EXTRA_DISTCLEAN.
-
- * editbuf.h (edit_mark::index_in_buffer): Avoid unused param warning.
-
- * iostream.cc (istream::operator>> (char*)): Improve ANSI compliance.
-
-Fri Nov 10 08:41:37 1995 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * config.shared (check): Add missing semicolon.
-
-Thu Nov 9 17:27:22 1995 Jason Merrill <jason@yorick.cygnus.com>
-
- * configure.in (ALL): Remove $(OSPRIM_OBJECTS).
- * config.shared (check): Set LD_LIBRARY_PATH.
- * NEWS: Fix typo.
- * iogetdelim.c (_IO_getdelim): Index *lineptr, rather than lineptr.
- From alan@spri.levels.unisa.edu.au (Alan Modra).
-
-Mon Nov 6 15:03:33 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * streambuf.cc, editbuf.cc, isgetline.cc, parsestream.cc:
- Fixes to avoid -Wall warnings.
-
-Fri Nov 3 16:41:41 1995 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * gen-params [!__STDC__]: Include varargs.h instead of stdarg.h.
-
-Thu Nov 2 15:04:03 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * config.shared: Re-write if X then Y else true fi to (not X) || Y.
-
-Wed Nov 1 13:26:44 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * iostream.h (istream::ipfx): Add default argument value.
- Reported by Yotam Medini <yotam_medini@tmai.com>.
-
- * libioP.h (_IO_blen): Fix typo.
- Reported by Bryan T. Vold <btv@ldl.healthpartners.com>.
-
-Fri Oct 27 19:26:20 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * Makefile.in (_G_config.h): Set CC to $(CC) rather than to $(CXX),
- now that CXX defaults to g++ and CC default to gcc (when found).
- * config.shared: Simplify CXX and CC, since they get overridden
- by ../configure anyway.
-
-Wed Oct 25 19:45:50 1995 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * iostdio.h: Wrap including the file with #ifndef _IOSTDIO_H.
-
-Wed Oct 25 11:14:25 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * libio.h (_IO_seekoff, _IO_seekpos): New declarations.
- * libioP.h (_IO_seekoff, _IO_seekpos): Remove declarations.
- * libioP.h: Cleanup; remove old !_IO_UNIFIED_JUMPTABLES stuff.
-
- * filebuf.cc (filebuf::~filebuf): Only call SYSYCLOSE if currently
- open. Bug found by Martin Gerbershagen <ger@ezis-ulm.de>.
-
- * streambuf.h (streambuf::pubseekoff, streambuf::pubseekpos):
- Added, from ANSI draft.
- * filebuf.cc (filebuf::open), iostream.cc (variables places), SFile.cc:
- Use pubseekoff/pubseekpos rather than sseekoff/sseekpos.
-
- * Makefile.in (install): Don't install libiostream.a.
-
- * filedoalloc.c: Also #include <unistd.h>.
-
-Mon Oct 9 18:09:54 1995 Jason Molenda <crash@phydeaux.cygnus.com>
-
- * config.shared (SUFFIXES): add .c.
-
-Tue Sep 26 16:08:01 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * procbuf.cc: Move #pragma implementation to beginning.
-
-Wed Sep 20 17:53:33 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * procbuf.h, procbuf.cc: Add #pragma interface/implementation stuff.
-
-Wed Sep 20 18:59:00 1995 John Eaton <jwe@bevo.che.wisc.edu>
-
- * procbuf.h: Protect from being included multiple times.
-
-Wed Sep 20 15:47:14 1995 John Eaton <jwe@bevo.che.wisc.edu>
-
- * procbuf.h (procbuf): Add '_next' pointer field for compatibility
- with _IO_proc_file.
-
-Wed Sep 20 13:54:02 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * config.shared: Add support for maintainer-clean target as a
- synonym for realclean.
- * dbz/Makefile.in: Likewise.
-
-Mon Sep 11 12:11:19 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * iopopen.c: #include <sys/types.h> before <sys/wait.h>.
- This is in accordance with Posix, and needed for ISC.
-
-Fri Sep 8 00:11:55 1995 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * gen-params: Use double quotes in the eval setting $TYPE to
- $VALUE, to preserve any single quotes in $VALUE.
-
-Mon Aug 21 11:39:09 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * gen-params: Test for an appropriate version of gcc before using
- mode attributes.
-
- * config.shared: Add $(PICDIR) to $ALL.
-
-Mon Aug 7 17:51:40 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * gen-params: Generate new macro _G_HAVE_SYS_CDEFS.
- * libio.h: If _G_HAVE_SYS_CDEFS, get __P from <sys/cdefs.h>.
-
-Fri Aug 4 23:21:17 1995 Paul Eggert <eggert@twinsun.com>
-
- * gen-params: When following typedef changes, allow typedefs
- that do not have a space before the defined type name,
- e.g. `typedef void *__gnuc_va_list;' as in Linux. Also,
- not require a space in the definiens, e.g. `typedef void*foo;'.
-
-Thu Aug 3 17:54:15 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * iostream.h, iostream.cc (istream::sync): Added missing method.
-
-Thu Aug 3 17:49:34 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * configure.in: Remove netbsd special case.
- * config/netbsd.mt: Removed; no longer used.
-
-Tue Jun 20 16:07:12 1995 Paul Eggert <eggert@twinsun.com>
-
- * gen-params: Take transitive closure of `typedef' relation.
- This is needed for BSD/OS 2.0, which has
- fpos_t -> off_t -> quad_t -> long long.
-
-Mon Jul 24 18:28:10 1995 Doug Evans <dje@canuck.cygnus.com>
-
- * config.shared (TOPDIR): Delete extra '/', $rootme may be empty.
-
-Sat Jul 22 13:27:45 1995 Doug Evans <dje@canuck.cygnus.com>
-
- * config.shared (depend.new): Fix quoting in DO NOT EDIT line.
-
- * Makefile.in (_G_config.h): Add multilib support.
- (install): Likewise.
- * config.shared: Likewise.
- * configure.in: Likewise.
-
-Wed Jun 28 17:40:25 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * PlotFile.h, SFile.h, builtinbuf.h, editbuf.h, fstream.h,
- indstream.h, iomanip.h, iostream.h, parsestream.h, pfstream.h,
- procbuf.h, stdiostream.h, stream.h, streambuf.h, strstream.h: Wrap
- with extern "C++".
-
-Thu Jun 22 04:34:01 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * gen-params: Surround attributes with __.
-
-Mon Jun 19 00:33:22 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * config.shared (SUBDIRS): Massage broken shells that require
- 'else true'.
-
-Sat Jun 17 11:25:38 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * streambuf.h: Declare inline members inline in class.
-
-Thu Jun 15 20:45:13 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * Makefile.in (VERSION): Update to version 2.7.0.
-
-Wed Jun 14 21:41:11 1995 Jason Merrill <jason@python.cygnus.com>
-
- * Makefile.in (STDIO_WRAP_OBJECTS): Remove stdfiles.o.
- (LIBIO_OBJECTS): Add stdfiles.o.
-
-Wed Jun 7 16:11:36 1995 Jason Merrill <jason@python.cygnus.com>
-
- * config.shared (all): Appease bash.
-
-Wed Jun 7 11:16:38 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * configure.in (MOSTLYCLEAN): Remove stamp-picdir.
-
- * config.shared (MOSTLYCLEAN): Ditto.
- (CLEAN): Don't.
-
-Mon Jun 5 18:29:39 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * config/mh-*pic: Removed.
-
- * configure.in (MOSTLYCLEAN): Remove pic objects.
- (frags): Use toplevel pic fragments.
-
- * config.shared (CXXFLAGS): Use -O3.
- (PICFLAG, PICDIR): New macros.
- (all): Depend on $(PICDIR).
- (FLAGS_TO_PASS): Pass PICFLAG.
- (.x.o): Also build pic object.
- (stamp-picdir): Create directory for pic objects.
- (MOSTLYCLEAN): Remove pic objects.
- (CLEAN): Remove stamp-picdir.
-
- * Makefile.in (iostream.list): Depend on stamp-picdir.
- (c++clean): Don't remove _G_config.h.
-
-Mon Jun 5 15:03:47 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * strstream.h, strstream.cc (strstream::strstream()): Re-implement to
- be like ostrstream::ostrestream(), and not leak memory.
-
- * streambuf.h: Use #if !_IO_UNIFIED_JUMPTABLES instead of #ifndef.
-
- * iolibio.h (_IO_rewind): Add missing flags when calling _IO_seekoff.
-
-Thu May 25 22:30:21 1995 J.T. Conklin <jtc@rtl.cygnus.com>
-
- * config/netbsd.mt (G_CONFIG_ARGS): Add defn for off_t. Another
- layer of typedefs has been added and the gen-params script can
- not handle it.
-
-Wed May 10 03:02:58 1995 Jason Merrill <jason@python.cygnus.com>
-
- * iolibio.h (_IO_rewind): Add new argument to _IO_seekoff.
-
- * config/linux.mt (LIBIOSTREAM_OBJECTS): Include $(STDIO_WRAP_OBJECTS).
- (LIBIOSTREAM_DEP): Include stdio.list.
- (LIBIOSTREAM_USE): Include `cat stdio.list`.
-
- * Makefile.in (LIBIOSTREAM_DEP): New variable.
- (LIBIOSTREAM_USE): Ditto.
- (libiostream.a): Use them.
- (iostream.list): Ditto.
- (stdio.list): New rule.
- (stdio/stdio.list): Ditto.
-
-Tue May 9 18:29:38 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * libioP.h (_IO_jump_t): Change TYPE for __dummy from int to
- _G_size_t.
-
-Sat May 6 13:50:37 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * libio.h (_IO_UNIFIED_JUMPTABLES): #define as true.
- (_IO_FILE): Remove _jumps field (#if _IO_UNIFIED_JUMPTABLES).
-
- * libioP.h (enum _IO_seekflags_): Removed.
-
- * libioP.h (_IO_setbuf_t): Change return value of setpos jumptable
- function to match C++ streambuf::setpos. (Return NULL on failure.)
- * fileops.c (_IO_file_setbuf), genops.c (_IO_default_setbuf),
- filebuf.cc, iosetvbuf.c: Update to use new setbuf conventions.
-
- * streambuf.h (streambuf): Re-order virtual functions more logically.
- * streambuf.cc (streambuf::uflow), streambuf.h: New virtual.
- * libioP.h (struct _IO_jump_t): Define using new JUMP_FIELD macro.
- And re-order in more logical order consistent with streambuf vtable.
- * fileops.c (_IO_file_jumps), iopopen.c (_IO_proc_jumps), iovfprintf.c
- (_IO_helper_jumps), streambuf.cc (_IO_streambuf_jumps), strops.c
- (_IO_str_jumps): Update accordingly, using JUMP_INIT macro.
- * stdfiles.c: Set vtable to point to _IO_file_jumps.
- * filebuf.cc, iopopen.c, iovfprintf.c (helper_vfprintf), iovsprintf.c,
- iovsscanf.c: Use macros and #if to set jumptables.
-
- * streambuf.c: _IO_streambuf_jumps and the _IO_sb_* methods are not
- needed #if _IO_UNIFIED_JUMPTABLES.
- * filebuf.cc (filebuf::__new): Also no longer needed.
- * fstream.cc (fstreambase::__fb_init, fstreambase::fstreambase): Fix.
- * stdstrbufs.c: Use filebuf vtable instead of builtinbuf's.
- * builtinbuf.h, builtinbuf.cc (builtinbuf): Commented out #if
- _IO_UNIFIED_JUMPTABLES - no longer needed.
- * strstream.cc (SET_STR_JUMPS): Does nothing now.
-
- * builtinbuf.cc, fileops.c, genops.c, iofgetpos.c, iofsetpos.c,
- ioftell.c, iopopen.c, ioseekoff.c, ioseekpos.c, iosetvbuf.c,
- iovfprintf.c, iovfscanf.c, strops.c: Use DEFUN and DEFUN_VOID.
- * filebuf.cc, fileops.c, genops.c, iopopen.c, ioseekoff.c, ioseekpos.c,
- iosetvbuf.c, iovfscanf.c: Use new JUMP_* and IO_OVERFLOW/... macros.
-
- * libioP.h (_IO_seekpos_t): Third arg is now an int (using _IOS_INPUT
- and _IOS_OUTPUT), not an enum _IO_seekflags_. Flags values are
- changed, and their sense inverted (to match streambuf::seekpos).
- * libioP.h (_IO_seekoff_t): Similarly match streambuf::seekoff.
- * filebuf.cc, fileops.c (_IO_file_fopen, _IO_file_seekoff), genops.c
- (_IO_default_seekpos, _IO_default_seekpos), iofgetpos.c, iofsetpos.c,
- iolibio.h (_IO_fseek), ioftell.c, ioseekoff.c, ioseekpos.c,
- iostream.cc, streambuf.cc, strops.c (_IO_str_seekoff), strstream.cc:
- New seekpos/seekoff conventions.
- * iostreamP.h (convert_to_seekflags): Removed - no longer needed.
-
- * iolibio.h (_IO_fread): New declaration.
-
- * dbz/Makefile.in: Re-arrange for cleaner dependencies.
-
-Fri May 5 15:55:22 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * libioP.h (_IO_JUMPS. JUMP_FIELD, JUMP0, JUMP1, JUMP2, JUMP3,
- JUMP_INIT, _IO_FINISH, _IO_OVERFLOW, ... _IO_SYSSTAT): New macros
- in preparation for new unified jumptable/vtable implementation.
- * cleanup.c, filedoalloc.c, iofclose.c, iofflush.c, iofiledoalloc.c,
- ioprims.c, iosetbuffer.c, iostrerror.c, ioungetc.c: Use DEFUN.
- * filedoalloc.c, iofclose, iofflush, iosetbuffer.c: Use new macros.
-
- * iofopen.c, iofdopen.c: Use macros and #if for new jumptables.
-
- * gen-params: Do not #include <sys/types.h>.
- Add missing quote in 'eval'.
- Do add #include <sys/types.h> in test for <sys/resource.h>.
- * config/netbsd.mt: New file, defining _G_CONFIG_ARGS (for fpos_t).
- * configure.in: Use netbsd.mt for NetBSD.
-
-Wed May 3 15:03:47 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * libioP.h (DEFUN, DEFUN_VOID, AND): New macros, from ansidecl.h.
- * iofdopen.c, iofgets.c, iofopen.c, iofputs.c, iofread.c, iofwrite.c,
- iogetdelim.c, iogetline.c, iogets.c, ioignore.c, iopadn.c, ioperror.c,
- ioputs.c, iovsprintf.c, iovsscanf.c, outfloat.c: Use DEFUN.
-
-Mon May 1 16:22:30 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * gen-params: #include <sys/types.h>. Don't use __WCHAR_TYPE__ in
- definition of _G_wchar_t. Use __attribute__ ((mode)) to get
- specific-sized ints under gcc, don't worry about int8 or int64
- otherwise. Provide defaults if deduction fails.
-
-Thu Apr 27 18:27:53 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * streambuf.h (ios::~ios): Delete _arrays.
- (_IO_NEW_STREAMS): Turn on.
- * libio.h (__adjust_column): Remove bogus declaration.
- * genops.c (_IO_set_column): Fix typo (in commented-out code).
-
-Tue Apr 25 17:14:29 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * config.shared (CXXINCLUDES): Use a shell variable with a
- different name from the make variable.
- * configure.in: Update accordingly.
-
-Mon Apr 17 17:19:40 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * streambuf.h (__adjust_column): Remove redundant declaration.
-
-Sat Apr 15 11:39:25 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * config.shared (do-clean-dvi): Also remove *.cps.
-
- * gen-params: Use ${SED} instead of sed.
-
- * libio.h: Remove #if'd out stuff (confuses makedepend).
-
- * stdstreams.cc (STD_STR): Standard streams start with ios::dec set.
-
-Fri Apr 14 23:46:31 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * iostream.h, iostream.cc (istream::read, ostream::write):
- Use streamsize for the length parameter.
-
- * streambuf.h: Removed redundant __overflow and __underflow.
-
- * fstream.h, fstream.cc: Add void fstreambase::attach(int).
-
- * iosscanf.c (_IO_sscanf): Fix non-__STDC__ missing declaration.
-
-Mon Apr 3 15:40:55 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * indstream.*: Fix prototypes of xsputn and xsgetn.
-
- * fileops.c: Avoid ??? trigraph.
-
-Mon Mar 27 16:16:38 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * iomanip.h (operator<< (ostream&, const omanip<TP>&): Define
- separately.
- (operator>> (istream&, const imanip<TP>&): Ditto.
-
-Mon Mar 27 08:56:00 1995 Brendan Kehoe (brendan@lisa.cygnus.com)
-
- * builtinbuf.cc (builtinbuf::setbuf): Cast NULL to streambuf*, to
- avoid warning/error about conversion from void*.
- * indstream.cc (indirectbuf::seekoff): Likewise.
- (indirectbuf::seekpos): Likewise.
- * filebuf.cc (filebuf::setbuf): Likewise.
- (filebuf::close): Cast NULL to filebuf*.
-
-Wed Mar 1 14:23:18 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * configure.in (DISTCLEAN): Add, with target-mkfrag.
-
-Fri Feb 24 01:01:08 1995 Jason Merrill <jason@python.cygnus.com>
-
- * configure.in (frags): Don't require so many dashes in the
- canonical target name.
-
-Sat Feb 18 13:18:30 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * streambuf.cc (streambuf::sync): Always return 0, even for
- non-flushed output. This is required by the ANSI/ISO draft.
- * genops.c (_IO_sync): Likewise always return 0.
-
-Fri Feb 17 16:33:28 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * fileops.c (_IO_file_close_it): Call _IO_file_sync, rather
- than _IO_do_flush, because we want to adjust the file pointer
- if reading and not at end (as in SVR4, and as in fflush).
- Also, make sure to return error indication if sync fails.
- (_IO_file_sync): Ignore seek error if it is ESPIPE.
- (_IO_file_seekoff): If not readable, do dumb lseek.
- * iofclose.c (_IO_fclose): If closing a non-filebuf, return -1
- if _IO_ERR_SEEN.
-
-Fri Feb 17 19:31:00 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * gen-params: Check for struct tms in <sys/times.h>, defining
- HAVE_SYS_TIMES accordingly.
-
-Wed Feb 15 21:05:11 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * strops.c (_IO_str_count): Use LEN macro.
- (_IO_str_seekoff): Update _len field.
-
-Mon Feb 6 19:29:00 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * gen-params: Default to short, long and long long for 16, 32 and
- 64 bit types, in case detection fails.
-
-Wed Jan 25 18:07:30 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * gen-params (_G_wint_t): Allow for broken promotions.
-
-Tue Jan 24 16:15:40 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * stdstrbufs.cc (_IO_fake_stdiobufs): Add an extra layer of struct,
- to force correct alignment on i960s.
- (DEF_STDIOBUF, _IO_{stdin,stdout,stderr}_buf): Update accordingly.
-
-Thu Jan 19 18:30:53 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * config.shared (CXXINCLUDES): Add libstdc++ to includes for
- building libg++.
- (LIBS): Also link with libstdc++ when building libg++ toys.
- Don't set EXPORT_ALL_VARIABLES; users will have to set
- LD_LIBRARY_PATH themselves.
-
-Fri Dec 30 16:38:13 1994 Mike Stump <mrs@cygnus.com>
-
- * config/linux.mt: Fix build problem on linux 1.0.8.
-
-Thu Dec 22 11:49:45 1994 J.T. Conklin (jtc@phishhead.cygnus.com)
-
- * config/netware.mt: Use gcc to pre-link iostream.nlm's objects
- instead of using nlmconv, so that references to functions in
- libgcc.a are resolved.
-
- * configure.in: Append .mt to target makefile fragment file names.
-
- * floatconv.c (tens, tinytens, bigtens): Added const qualifier.
-
-Tue Dec 20 09:59:50 1994 Mike Stump <mrs@cygnus.com>
-
- * gen-params (VTABLE_LABEL_PREFIX): Since some systems have GNU nm
- as nm, and they demangle by default, we have to notice this, and
- try --no-cplus (linux) or --no-demangle when running nm.
-
-Wed Dec 14 18:13:58 1994 Per Bothner <bothner@kalessin.cygnus.com>
-
- * gen-params: To determine vt-name-mangling using dummy.C add
- #include and #prama interface/implementation to avoid problem with
- assemblers that don't emit local symbols. Reported under HPUX 8
- by Thomas Arend <arend@blasius.Chemietechnik.Uni-Dortmund.DE>.
-
- * streambuf.h (ios::ios): Move inline definition after
- that of ios::init (which ios::ios calls).
-
-Sun Dec 4 19:50:32 1994 Per Bothner <bothner@kalessin.cygnus.com>
-
- * fileops.c (_IO_file_init, _IO_file_close_it, _IO_file_sync):
- Set _offset to _IO_pos_BAD, to support applications that follow
- POSIX.1 rules on mixing file handles.
-
- * fileops.c (_IO_file_overflow): Handle case that buffer was
- allocated (perhaps by setvbuf) but _IO_write_base is still 0.
-
- * iostdio.h (setbuffer): #define as _IO_setbuffer.
- * streambuf.h, filebuf.cc: Removed filebuf::do_write.
-
-Tue Nov 29 23:38:57 1994 Per Bothner (bothner@rtl.cygnus.com)
-
- * floatconv.c (setword0, setword1): Fix typo.
-
-Tue Nov 29 15:37:29 1994 Per Bothner <bothner@kalessin.cygnus.com>
-
- * config.shared: Move -fno-implicit-template from CXXFLAGS
- to LIBCXXFLAGS. Tests are better run without it.
-
- * floatconv.c (word0, word1): Re-place/re-implement using unions
- instead of casts to avoid optimizer problems.
-
- * dbz/dbzmain.c: Renamed dirname -> dir_name to avoid OSF
- header file braindamage.
-
-Sat Nov 5 19:44:00 1994 Jason Merrill (jason@phydeaux.cygnus.com)
-
- * config.shared (LIBCFLAGS): Define.
- (LIBCXXFLAGS): Define.
- (DOING_LIBGXX): Define TOLIBGXX. Change LIBS to use -lg++. Add
- LD_LIBRARY_PATH and .EXPORT_ALL_VARIABLES:.
- (FLAGS_TO_PASS): Add LIBC{,XX}FLAGS.
- (XC{,XX}FLAGS): Set to LIBCFLAGS or CFLAGS depending on $LIBDIR.
- (COMPILE.c): Define, use in .c.o rule.
- (COMPILE.cc): Define, use in .cc.o rule.
-
-Sat Nov 5 15:12:12 1994 Per Bothner <bothner@kalessin.cygnus.com>
-
- * Makefile.in (VERSION): Update to 0.67.
-
- * streambuf.h (ios::dont_close): Is now set by default.
- * fstream.h, fstream.cc (__fb_init): New function. Clears
- ios::dont_close. Change fstreambase constructors to call it.
- * strstream.cc: *strstream constructors must clear ios::dont_close.
- * iostream.cc: Simplify - don't need to set ios::dont_close.
- * ioassign.cc: Simplify - assume ios::dont_close is always set.
-
- * fstream.h, fstream.cc: If _IO_NEW_STREAMS, put the
- filebuf as a member __my_fb.
- * strstream.{h,cc}: Likewile use a strstreambuf member __my_sb.
- * streambuf.h, stdstreams.cc, ioextend.cc:
- Fix if _IO_NEW_STREAMS to not use ios::dont_close.
-
- * streambuf.h (class ios): Move rdbuf later, to avoid
- inability of g++ to inline.
- * filebuf.cc (filebuf::~filebuf): Call _IO_do_flush.
-
- * config.shared: Emit rules to make depend.
- * depend: New file.
-
-Fri Nov 4 17:19:11 1994 Per Bothner <bothner@kalessin.cygnus.com>
-
- * README: Fix typos.
- * libio.h: Add comment. Update Copyright notice.
-
-Fri Nov 4 21:46:30 1994 Paul Eggert <eggert@twinsun.com>
-
- * libio.h (__P): Change argument name spelling from
- `paramlist' to `protos' for compatibility with BSDI 1.1.
-
-Thu Nov 3 00:45:16 1994 Jason Merrill (jason@phydeaux.cygnus.com)
-
- * config.shared (CXXFLAGS): Add -fno-implicit-templates.
-
-Mon Oct 24 15:57:35 1994 Per Bothner <bothner@kalessin.cygnus.com>
-
- * config.shared: Define NOSTDIC and use it for libio too.
-
-Thu Oct 20 19:45:35 1994 Jason Merrill (jason@phydeaux.cygnus.com)
-
- * iogetdelim.c: #include <stdlib.h>.
-
-Thu Oct 20 17:09:52 1994 Per Bothner <bothner@kalessin.cygnus.com>
-
- * iostream.h: Add classes _IO_istream_withassign and
- _IO_ostream_withassign. Re-type cin, cout, cerr, clog.
- (class iostream): Don't add extra _gcount field.
- * ioassign.cc: New file. Implement operator= for cin etc.
- * streambuf.h (class ios): Change return type of operator=.
- * Makefile.in (IOSTREAM_OBJECTS): Add ioassign.o.
-
- * Makefile.in: Re-arrange, so linux.mt overrides can work.
-
- * fileops.c (_IO_file_seekoff): Optimize seeks within buffer.
-
-Wed Oct 19 14:25:47 1994 Jason Merrill (jason@phydeaux.cygnus.com)
-
- * gen-params (wint_t): Return to using __WCHAR_TYPE__ for
- compatibility with gcc versions prior to 2.6.1.
-
-Tue Oct 18 17:08:18 1994 Per Bothner <bothner@kalessin.cygnus.com>
-
- * Makefile.in: Define _G_CONFOG_H as _G_config.h for Linux. Use it.
- (IO_OBJECTS): Add iogetdelim.o.
- * config/linux.mt: New file.
- * configure.in: Select config/linux.mt if Linux.
- * iogetdelim.c: Verious cleanups, many from
- Ulrich Drepper <drepper@ipd.info.uni-karlsruhe.de>.
- * libioP.h: Add _IO_getdelim. Use (void) for no-parameter functions.
-
-Thu Oct 13 16:30:56 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * libio.h: Rename USE_DTOA to _IO_USE_DTOA for namespace reasons.
- * iostream.cc, iovfscanf.c, iovfprintf, floatconv.c:
- Update USE_DTOA -> _IO_USE_DTOA.
-
- * libio.h (_IO_feof, _IO_ferror): Move to here ...
- * iolibio: ... from here
-
- * iostream.cc (istream::get, istream::ignore, istream::read):
- Set _gcount to 0 if ipfx0 failed.
-
- * iostream.cc (flush): Do virtual function call, rather than
- going through jumptable. (To get correct method in derived class.)
- Bug and fix from John Wiegley <jw@cis.ohio-state.edu>.
-
- * iofdopen.c (O_ACCMODE): Define using O_RDWR, not O_RDWRITE.
-
- * streambuf.h (ios::rdbuf(streambuf*)): New.
- * streambuf.h (ios::operator=): Make private (i.e. dis-allow).
-
-Wed Oct 12 19:09:20 1994 Jason Merrill (jason@phydeaux.cygnus.com)
-
- * gen-params: Define _G_NO_NRV and _G_NO_EXTERN_TEMPLATES if not
- compiling with g++.
-
-Thu Oct 6 16:03:43 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * iostream.texi (ostrstream::str): Note that NUL is not written
- automatically.
-
-Wed Oct 5 17:28:29 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * iogetdelim.c (_IO_getdelim): New function.
-
-Wed Oct 5 15:40:22 1994 J.T. Conklin (jtc@phishhead.cygnus.com)
-
- * config/netware.mt: New file, first cut at Netware NLM support.
- * configure.in (*-*-netware*): Use config/netware.mt.
-
- * config.shared (NLMCONV, LD): New definition.
-
- * gen-params: check for nm in ${binutils}/nm.new.
- * config.shared: Likewise.
-
-Tue Oct 4 12:20:01 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * iomanip.h (omanip::operator<<): Make 2nd arg be const.
- Bug and fix reported by Greg McGary <gkm@magilla.cichlid.com>.
-
- * strstream.cc (strstreambuf::pcount): Simplify, to match
- ANSI/ISO specification.
-
-Mon Sep 26 15:19:52 1994 Jason Merrill (jason@deneb.cygnus.com)
-
- * gen-params: Include <wchar.h> and <wctype.h> if they exist.
-
-Thu Sep 8 14:41:41 1994 Jason Merrill (jason@deneb.cygnus.com)
-
- * iostream.h (class istream): Declare operator>>(long double&).
- (class ostream): Define operator<<(long double).
-
- * iostream.cc (istream::operator>>(long double&)): Define.
-
-Wed Sep 7 14:42:29 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * iostream.texi (Overflow): Fix bugs in example.
-
-Fri Sep 2 17:45:57 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * iostream.tex: Document a little on how to write your
- own streambuf-derived class, with an example.
-
-Tue Aug 30 13:03:57 1994 Brendan Kehoe (brendan@lisa.cygnus.com)
-
- * floatconv.c (s2b): Declare X and Y to be _G_int32_t.
- (diff, quorem): Declare BORROW, Y, and Z likewise.
- (ulp): Declare L likewise.
- (_IO_strtod): Declare L and AADJ likewise.
- (_IO_dtoa): Declare L and D likewise. Cast division of D by DS to
- _G_int32_t.
-
-Mon Aug 29 16:01:54 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * iosetvbuf.c (_IO_setvbuf): If setting _IOFBF and no
- buffer was specified, call __doallocate.
-
- * fileops.c, floatconv.c: Add a bunch of parentheses to
- shut up gcc warnings. Patch from H.J.Lu.
-
- * stdiostream.cc (stdiobuf::sys_read): Inline call to getc
- for the normal case (size==1).
-
-Sat Aug 20 12:14:52 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * Makefile.in (VERSION): Increase to 0.66.
-
-Fri Aug 19 17:28:41 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * iolibio.h: Added _IO_printf prototype.
- Added extern "C" { ... } wrappers #ifdef __cplusplus.
- Bugs reported by Neal Becker <neal@ctd.comsat.com>.
-
-Wed Aug 17 18:17:15 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * fileops.c (_IO_file_seekoff): For _IO_seek_cur, adjust for
- read-ahead before jumping to label dumb.
-
-Wed Aug 3 13:15:01 1994 H.J. Lu (hjl@nynexst.com)
-
- * libioP.h (CHECK_FILE(FILE,RET)): new, which checks for
- FILE == NULL and _IO_MAGIC_MASK.
- (COERCE_FILE(FILE)): merged into CHECK_FILE(FILE,RET)
- with typo fixes.
-
- * iofread.c, iofwrite.c: add CHECK_FILE(fp, 0);
- * iofclose.c: add CHECK_FILE(fp, EOF); remove _IO_MAGIC_MASK check.
-
- * iofflush.c, iofgetpos.c, iofputs.c, iofscanf.c,
- iofsetpos.c, iofvbuf.c, ioungetc.c:
- Add CHECK_FILE(fp, EOF) and remove COERCE_FILE(fp).
-
- * iofgets.c: add CHECK_FILE(fp, NULL) and remove COERCE_FILE(fp).
- * iofprintf.c: add CHECK_FILE(fp, -1) and remove COERCE_FILE(fp).
- * ioftell.c: add CHECK_FILE(fp, -1L) and remove COERCE_FILE(fp).
- * iosetbuffer.c: add CHECK_FILE(fp, ) and remove COERCE_FILE(fp).
-
-Fri Aug 12 15:35:39 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * iofdopen.c (_IO_fdopen): #define O_ACCMODE if it isn't.
- Still set O_APPEND if "a" is given, but don't unset it
- if it isn't. Added comment.
-
-Mon Aug 8 13:11:00 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * gen-params (VTABLE_LABEL_PREFIX): Changes in the implementation.
- For look for _*vt[$_.]7*filebuf in the nm output, because that
- matches what g++ produces and has produced. Thus it should be
- somewhat more robust.
-
-Sun Aug 7 22:52:49 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * gen-params (CC): Remove no-longer-needed -I options
- passed to xgcc (now they are implied by the -B options).
-
-Wed Jul 20 16:41:13 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * Makefile.in (tooldir): Added definition, so we can do
- 'make install' in this directory.
- Bug reported by Klamer Schutte <schutte@tpd.tno.nl>.
-
-Mon Jul 18 18:02:34 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * gen-params (VTABLE_LABEL_PREFIX): Remove filename sppearing
- by itself. Add comment explaining what is going on.
-
-Tue Dec 21 13:02:48 1993 H.J. Lu (hjl@jalod)
-
- * libio.h: define _IO_uid_t and _IO_HAVE_ST_BLKSIZE
- as _G_xxxxxxxx.
-
-Tue Dec 21 13:02:48 1993 H.J. Lu (hjl@jalod)
-
- * iopopen.c: Don't include <errno.h>. It is included in "libioP.h".
-
- * iopopen.c (_IO_proc_close) : check if fp is on the list
- before close it.
-
-Thu Jul 14 16:38:47 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * gen-params (CONFIG_NM): Make sed scripts to find vtable name
- mangling more robost for different forms of nm output.
-
-Tue Dec 21 13:02:48 1993 H.J. Lu (hjl@jalod)
-
- * iofopen.c (_IO_fopen): don't check [redundantly] fp == NULL after
- IO_file_init(&fp->_file).
-
- * iomanip.h (template<class TP> class iapp):
- change ostream to istream.
-
-Tue Jul 12 14:09:02 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * Makefile.in (VERSION): Increase to 0.65.
- * libioP.h (builtinbuf_vtable): Only define #ifdef __cplusplus.
-
- * gen-params (_G_int8_t): Only define if defined(__STDC__),
- because K&R C compilers don't have signed char.
- (_G_int64_t, _G_uint64_t): Only define if defined(__GNUC__)
- because other compilers may not have long long.
-
-Sun Mar 06 13:10:21 1994 H.J. Lu (hjl@nynexst.com)
-
- * floatconv.c (_IO_dtoa ()): fix a small memory leak, set the
- "on_stack" field to be 0 if "result" is not NULL.
-
-Sat Mar 05 13:18:20 1994 H.J. Lu (hjl@nynexst.com)
-
- * floatconv.c (_IO_dtoa ()): if the number of digits of the
- floating point number is more than the previous one, free the
- old string and allocate a new one.
- [Minor optimization to avoid Bcopy. -PB]
-
-Mon Jul 11 10:53:41 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * fileops.c (_IO_file_underflow): 'count' should be unsigned,
- since it contains the return value of read. Reported by
- Teemu Torma <tot@trema.fi>.
-
-Tue Dec 21 13:02:48 1993 H.J. Lu (hjl@nynexst.com)
-
- * floatconv.c (_IO_strtod ()): make "+" and "-" as error.
-
-Sat Jul 9 15:09:21 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- Make sure _IO_FILE::_flags is always initialized correctly, for the
- C functions (fopen, fdopen, popen), and not just the C++ functions.
- * fileops.c (_IO_file_init): Set _flags to CLOSED_FILEBUF_FLAGS.
- * fileops.c (_IO_file_fopen): Remove bogus assignment.
- * filebuf.cc (filebuf constructors): Don't pass CLOSED_FILEBUF_FLAGS
- to streambuf constructor - _IO_file_init does it instead.
- * filebuf.cc (CLOSED_FILEBUF_FLAGS): Removed.
- * iopopen.c (_IO_proc_open): Use _IO_mask_flags.
-
-Thu Jun 30 08:49:53 1994 Jason Merrill (jason@deneb.cygnus.com)
-
- * dbz/Makefile.in (mostlyclean): Add target.
-
-Wed Jun 29 09:30:12 1994 Jason Merrill (jason@deneb.cygnus.com)
-
- * gen-params: Woops, can't run a C program to determine target
- characteristics. Sigh.
-
-Tue Jun 28 03:11:33 1994 Jason Merrill (jason@deneb.cygnus.com)
-
- * gen-params: Add _G_{,u}int{8,16,64}_t, use a short C program to
- determine what all these should be rather than trying to compare
- the MAX numbers in the shell.
-
-Sun Jun 26 21:04:24 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * stdiostream.h, stdiostream.cc (stdiobuf::xsgetn): Removed.
- Too hairy. If we want to optimize it, we should do so in
- filebuf::xsgetn (or rather _IO_file_xsgetn).
-
- * stdiostream.h (class stdiobuf), stdiostream.cc: Fix parameter
- and return types of virtual function to matcher base types (Oops!).
- * streamstream.cc (stdiobuf::xsgetn, stdiobuf::xsputn):
- Optimize to call fread.fwrite directly if !buffered.
- * fileops.c: Fix comment.
-
-Fri Jun 24 11:28:18 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * stdiostream.h (istdiostream, ostdiostream): New classes.
-
- More robust final cleanup.
- * cleanup.c (_IO_register_cleanup): Register _IO_cleanup,
- rather than _IO_flush_all.
- * filedoalloc.c: Update comment.
- * genops.c (_IO_unbuffer_all): New. Makes all files unbuffered.
- * genops.c (_IO_cleanup), libioP.h: New function. Call
- _IO_flush_all, and then _IO_unbuffer_all. This is in case C++
- destructors try to do output *after* _IO_cleanup is called.
-
- Construct standard stdiobufs statically (using type punning).
- * stdstrbufs.c; Unless _STDIO_USES_IOSTREAM declare standard
- stdiobufs (for stdin, stdout, and stderr), using type punning
- (struct _IO_fake_stdiobuf). This avoids constructor-time problems.
- * stdstreams.cc: Remove the declarations of the stdiobufs.
- Instead use the new (fake) ones in stdstrbufs.cc. We no longer
- have to call ios::sync_with_stdio at constructor time.
-
- Preliminary support for new ANSI streambuf::uflow virtual.
- * libioP.h (struct _IO_jump_t): Add __uflow field.
- * genops.c (_IO_default_uflow), libioP.h: New function.
- * fileops.c (_IO_file_jumps), iopopen.c (IO_proc_jumps),
- iovfprintf.c (_IO_helper_jumps), strops.c (_IO_str_jumps),
- streambuf.cc (_IO_streambuf_jumps): Add _IO_default_uflow.
- * genops.c (__uflow): New function.
- (save_for_backup): New function. Some code shared by
- __underflow and __uflow, moved out from the former.
- (_IO_default_uflow): New function.
- * libio.h (_IO_getc): Call __uflow, not __underflow.
-
-Wed Jun 22 20:22:49 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- Make sure that the vtable of a streambuf is always valid,
- which makes ios::rdbuf simpler and faster.
- * gen-params: Add code to determine _G_VTABLE_LABEL_HAS_LENGTH,
- _G_VTABLE_LABEL_PREFIX, _G_VTABLE_LABEL_PREFIX_ID, and
- _G_USING_THUNKS, which describe how virtual function tables are named.
- * stdfiles.c (FILEBUF_LITERAL): Moved to libioP.h.
- * libioP.h (builtinbuf_vtable): New (complicated) declaration.
- * filebuf.cc (filebuf::__new), strstream.cc (SET_STR_JUMPS):
- Initialize vtable to builtinbuf_vtable, not NULL.
- * stdstrbufs.cc: New file. Same as stdfiles.c, except that
- vtable is initialized to builtinbuf_vtable, not NULL.
- * streambuf.h (ios::rdbuf): Can now simplify/optimize, due to
- above changes. Always, just return _strbuf.
- * builtinbuf.h, builtinbuf.cc (builtinbuf::vtable,
- builtinbuf::get_builtin_vtable): Removed. No longer needed.
- * streambuf.h, builtinbuf.cc (ios::_IO_fix_vtable): No longer needed.
- Only defined #ifdef _STREAM_COMPAT, for binary compatibility.
- * Makefile.in: Move stdfiles.o from IO_OBJECTS to STDIO_WRAP_OBJECTS.
- (IOSTREAM_OBJECT): Add stdstrbufs.o.
- * Makefile.in (_G_config.h): Pass $(CXXFLAGS) as part of $(CXX).
-
-Fri Feb 11 11:08:01 1994 SBPM Marc GINGOLD (marc@david.saclay.cea.fr)
-
- * iovfprintf.c (helper_vfprintf): add
- hp->_IO_file_flags = _IO_MAGIC|(_IO_IS_FILEBUF+_IO_NO_READS);
- [This is needed because _IO_vfprintf checks for _IO_UNBUFFERED. -PB]
- [Actually: don't set _IO_IS_FILEBUF. -PB]
-
-Wed Jun 22 13:49:22 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * stdiostream.cc, stdiostream.h (stdiobuf::buffered): New methods.
-
- * iofdopen.c (_IO_fdopen): Various minor improvements.
-
- * iovfscanf.c: Don't return EOF on control_failure.
-
-Tue Dec 21 13:02:48 1993 H.J. Lu (hjl@nynexst.com)
-
- * iovfscanf.c: Enforce the sequence of the conversion specifications.
-
-Fri Jun 17 20:57:22 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * iofdopen.c: Use fcntl to check that requested access mode is
- compatible with existing access mode, and to change the
- O_APPEND file status flag if need be.
-
-Thu Jun 16 17:33:50 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * streambuf.h (ios::init): Initialize all the fields.
- This may be overkill, but the current ANSI working paper requires it.
- * streambuf.h (ios::ios): Reimplement in terms of ios::init.
- * iostream.cc (Non-default constructors istream::istream,
- ostream::ostream, iostream::iostream): Cannot use a mem-initializer,
- because it is ignored if initializing a derived class. Instead,
- call ios::init.
-
-Wed Jun 15 13:35:37 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * stdstreams.cc (ISTREAM_DEF): Fix typo (it's a _fake_istream, not
- a _fake_ostream). Reported by Jason Shirk <jshirk@gomez.intel.com>.
-
- * stdiostream.h, stdiostream.cc (stdiobuf::~stdiobuf): New.
- Call _IO_do_flush.
- * stdiostream.cc (stdiobuf::sync): Call _IO_do_flush rather
- than filebuf::sync (to avoid bad seeks).
-
- * libioP.h (_IO_do_flush): Add missing parentheses.
-
-Fri Jun 3 19:16:57 1994 Jason Merrill (jason@deneb.cygnus.com)
-
- * config.shared (CXXFLAGS): Remove -fno-implicit-templates.
-
- * iomanip.h: Add explicit external instantiations.
-
-Wed Jun 1 14:14:44 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * libio.h (struct _IO_FILE_plus): Move definition from here ...
- * libioP.h (struct _IO_FILE_plus): ... to here. Since this
- file is private to the implementation, we can rename the fields
- from the implementor's to the user's name anme space.
- (This avoids a lossage on SCO, whose stdio.h has a #define _file.)
- * iofdopen.c, iofopen.c, stdfiles.c: Fix field references accordingly.
- * iopopen.c (struct_IO_proc_file): Rename fields from
- implementor's name space to user's, and update usages.
- * streambuf.h (streambuf::_vtable): Re-implement to not need
- struct _IO_FILE_plus.
- * strfile.h (struct _IO_strfile_): Likewise.
-
-Wed Jun 1 13:57:48 1994 Jason Merrill (jason@deneb.cygnus.com)
-
- * config.shared (CXXFLAGS): Use -fno-implicit-templates instead of
- -fexternal-templates.
-
-Tue May 31 08:49:28 1994 Mike Stump (mrs@cygnus.com)
-
- * genops.c, iofclose.c, iofdopen.c, iofopen.c, iopopen.c: Be
- consistent about protecting #include <stdlib.h>.
-
- * ioputs.c: Add #include <string.h>, to avoid warning on alpha.
-
- * iofdopen.c: Add #include <stdlib.h>, so that malloc works on
- machines where sizeof(int) != sizeof(void *).
-
-Mon May 30 17:26:49 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * pfstream.cc (ipfstream::ipfstream, opfstream::opfstream):
- Reverse sense of test of return value of procbuf::open.
- (It returns NULL on failure.)
-
- * filedoalloc.c (_IO_file_doallocate): Remove dead code for
- USE_MALLOC_BUF. Add code to return EOF if ALLOC_BUF fails.
-
-Sat May 28 13:47:47 1994 Jason Merrill (jason@deneb.cygnus.com)
-
- * iomanip.cc: Explicitly instantiate smanip<int> and
- smanip<ios::fmtflags>.
-
-Wed May 25 16:04:12 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * strfile.h: Use __P instead of _PARAMS.
-
-Fri May 20 11:42:17 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * libio.h: Rename _PARAMS macro to __P for better glibc and BSD
- compatibility. (Also define _PARAMS for backwards compatibility.)
- * cleanup.c, iolibio.h, ioperror.c, iovfprintf.c, iovfscanf.c,
- libioP.h: Use __P instead of _PARAMS.
- * iostdio.h: Use __P instead of _ARGS.
-
- * fileops.c (_IO_file_read): Minor stylistic tweak. (It is
- preferable to test errno *after* the error return.)
-
-Fri May 13 15:25:36 1994 Jason Merrill (jason@deneb.cygnus.com)
-
- * iostream.*: Add insertor and extractor for bool (just pretend
- it's an int).
-
-Fri May 13 14:12:03 1994 Mike Stump (mrs@cygnus.com)
-
- * gen-params: Check for builtin bool support.
-
-Wed May 11 00:48:35 1994 Jason Merrill (jason@deneb.cygnus.com)
-
- Make libg++ build with gcc -ansi -pedantic-errors
- * gen-params: #ifdef __STRICT_ANSI__, #define _G_NO_NRV.
- * pfstream.cc (ipfstream::ipfstream): Wrap use of variable-size
- array in #ifndef __STRICT_ANSI__.
-
-Fri May 6 12:42:21 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * Makefile.in (VERSION): Increase to 0.64.
-
- * isgetline.cc (istream::getline): The delimiter should *not*
- be included in the gcount().
-
- * filedoalloc.c: #include <stdlib.h> (If __STDC__) to get malloc.
- * iostream.h (ostream::put): Remove overloaded versions, to match
- new working paper. (Actually just put inside _STREAM_COMPAT, for now.)
-
-Tue May 3 14:14:57 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * genops.c (_IO_default_finish): Make robust when called
- multiple times on the same _IO_FILE*. (One way this can
- happen is by the builtinbuf destructor being followed by the
- streambuf destructor.)
-
-Mon May 2 13:55:26 1994 Jason Merrill (jason@deneb.cygnus.com)
-
- * gen-params: Actually determine wint_t rather than depending on
- cpp to provide it or defaulting to the underlying type for
- wchar_t.
-
-Sat Apr 30 14:47:30 1994 Jason Merrill (jason@deneb.cygnus.com)
-
- * gen-params: Add _G_wint_t, allow __*_TYPE__ to override values
- at compile time, fix definition of _G_ARGS.
-
-Fri Apr 29 16:55:37 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * libio.h: Remove #pragma interface. (There is no implementation.)
-
-Mon Mar 28 14:22:26 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * iostream.cc (ostream::operator<<(double)): Add/fix support
- for printing '+' when ios::showpos is set.
- (Fixes bug reported by Doug Moore <dougm@cs.rice.edu>.)
- * iostream.cc (istream::read): Set eofbit as well as failbit on eof.
- * iostream.cc (ostream::operator<<(int)): Fix conversion
- to unsigned (used to lose on INT_MIN).
- * iostream.cc (ostream::operator<<(long)): Use (unsigned long),
- rather than (unsigned) for temporary.
-
- * config.shared, Makefile.in: Remove definitions and uses
- of XTRAFLAGS. It is no longer needed, since it is
- now implied by the -B flag.
-
-Fri Mar 25 00:31:22 1994 Jason Merrill (jason@deneb.cygnus.com)
-
- * builtinbuf.h: Add put /**/ around comment on trailing #endif.
-
- * Makefile.in (c++clean): Make clean in tests subdir, too.
-
-Wed Mar 23 16:42:09 1994 Doug Evans (dje@canuck.cygnus.com)
-
- * configure.in: Remove Makefile.tem before creating it.
- Needed when configuring from read-only source trees.
-
-Wed Mar 16 14:06:42 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * stdstreams.cc: Fix so that stdiobuf are used for cin/cout/cerr,
- unless _STDIO_USES_IOSTREAM is defined.
- * filebuf.cc (filebuf::setbuf): Fix confusion about return
- value from _IO_file_setbuf.
-
-Sun Mar 13 00:54:12 1994 Paul Eggert (eggert@twinsun.com)
-
- * config.shared: Ensure that `all' precedes `.PHONY';
- BSDI 1.1 needs this.
-
-Sat Mar 12 03:58:00 1994 Paul Eggert (eggert@twinsun.com)
-
- * config.shared: Output a definition of INSTALL that uses
- $${rootme}, not ${rootme}. Most `make's don't care, but BSDI
- 1.1 `make' does.
-
-Fri Mar 4 17:33:01 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * iopopen.c: #define _POSIX_SOURCE.
- * isgetline.c (istream::getline): Various fixes.
-
-Thu Mar 3 17:58:20 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * iostream.cc (write_int): Fix test for when to add initial '0'
- when ios::oct and ios::showbase are set.
- For hex, showbase adds initial 0x (or 0X) regardless of val==0.
- Bugs reported by Phil Roth <proth@cs.uiuc.edu>.
-
-Mon Feb 21 13:18:20 1994 H.J. Lu (hjl@nynexst.com)
-
- * libio.h (_IO_PENDING_OUTPUT_COUNT(_fp)): return the
- pending output count in _fp.
-
-Fri Feb 25 09:26:57 1994 Ian Lance Taylor (ian@cygnus.com)
-
- * gen-params: For HAVE_SYS_WAIT, compile dummy.c, not dummy.C.
-
-Tue Feb 22 11:19:09 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * streambuf.h, genops.c, libioP.h: Rename references to
- _IO_FILE fields other_gbase => _IO_save_base,
- _aux_limit => _IO_backup_base, and _other_egptr => _IO_save_end.
- * libio.h: Remove no-longer needed macros _other_gbase,
- _aux_limit, and _other_egptr.
- * genops.c (__underflow, _IO_default_finishh, _IO_unsave_markers):
- Check _IO_save_base for NULL before FREEing it or calling
- _IO_free_backup_area.
-
-Thu Feb 17 15:26:59 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * gen-params: Improve deduction of _G_uint32 and _G_int32.
- Should now work for 16-bit, 32-bit, or 64-bit targets.
- * gen-params: Check for sys/wait.h using ${CC}, since it's
- now used in a C file, not a C++ file.
- * floatconv.c: Typedef _G_uint32_t as unsigned32, and use
- unsigned32 in place of unsigned long. (Needed for Alpha.)
-
-Tue Feb 8 13:40:15 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * fileops.c (_IO_file_close_it): Simplify by using _IO_do_flush.
- * fileops.c (_IO_file_finish): Don't call _IO_file_close_it -
- do it inline. Call _IO_do_flush even if _IO_DELETE_DONT_CLOSE.
- * fileops.c (_IO_file_attach): Set _IO_DELETE_DONT_CLOSE.
- * genops.c (_IO_flush_all): Only call overflow if there is
- something to write.
- * iofclose.c (_IO_fclose): Check that magic number is correct,
- and clear it when done. Avoids crashing some buggy applications.
- * iogetline.c (_IO_getline): Don't gratuitously increment old_len.
- * iogets.c (_IO_gets): Take care to get required ANSi semantics.
-
-Sun Feb 6 19:50:39 1994 Jason Merrill (jason@deneb.cygnus.com)
-
- * iomanip.cc: Explicitly instantiate operator<< and >>.
-
-Fri Feb 4 12:28:22 1994 Jason Merrill (jason@deneb.cygnus.com)
-
- * config.shared (CXXFLAGS): Use -fexternal-templates.
-
- * iomanip.h: Uncomment #pragma interface.
-
-Thu Jan 20 13:48:40 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- If no characters are read by fgets, ANSI C doesn't allow '\0' to
- be written to the buffer, but it is required by ANSI C++
- for istream::get and istream::getline. Both use _IO_getline ...
- * iogetline.c (_IO_getline): Don't write a '\0' at the end
- of the read data. The input buffer length does not include
- space for a '\0'.
- * iofgets.c, iogets.c: Change appropriately.
- Also check for _IO_ERR_SEEN, as required by ANSI.
- * isgetline.cc: Update accordingly.
-
-Mon Jan 17 13:24:26 1994 Jason Merrill (jason@deneb.cygnus.com)
-
- * Makefile.in (c++clean): Added target for compiler testing
- (i.e. make c++clean all).
-
-Mon Jan 10 11:20:42 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * libio.h (_IO_putc): Add parentheses.
- Patch from Rik Faith <faith@cs.unc.edu>.
-
-Tue Jan 4 01:32:28 1993 Hongjiu Lu (hjl@nynexst.com)
-
- * genops.c (_IO_default_xsputn):
- (_IO_default_xsgetn):
- * ioignore.c: change "_IO_size_t count" to
- "_IO_ssize_t count".
- * iogetline.c: change "_IO_size_t len" to
- "_IO_ssize_t len".
-
-Mon Dec 20 00:31:21 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * config.shared (CXXINCLUDES): Fix quoting of $(NOSTDINC).
-
-Sun Dec 19 21:03:45 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * Makefile.in (VERSION): Increase to 0.63.
-
-Fri Dec 17 13:02:44 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * iofread.c (_IO_fread): Return 0 if either size or count is 0.
- * iofwrite.c (_IO_fwrite): Return 0 if either size or count is 0.
- (This is consistent with fread, and most implementations, but not
- with a literal reading of the ANSI spec.)
- * iovfscanf.c (_IO_vfscanf): If got EOF while skipping spaces,
- set seen_eof and break (instead of returning).
- * sbscan.cc (streambuf::vscan): Set error state before returning.
- * streambuf.h: Add a forward declarations for class istream
- to work around a g++ vtable name mangling bug. (Patch from
- harry@pdsrc.hilco.com via Jeffrey A Law <law@snake.cs.utah.edu>.)
- * NEWS: New file.
-
-Sat Dec 11 16:21:08 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * iovfprintf.c (struct helper_file, _IO_helper_overflow,
- helper_vfprintf, _IO_helper_jumps): New structs and functions.
- (_IO_vfprintf): Use helper_vfprintf to make printing to
- unbuffered files more efficient.
- * genops.c (_IO_default_underflow), libioP.h: New function.
-
- * iovsscanf.c (_IO_vsscanf): The input string's length marks
- its logical end-of-file.
-
-Wed Dec 8 13:20:46 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * indstream.cc (indirectbuf::sync()): Don't crash if get_stream()
- or put_stream() are NULL; sync() both streams even if error.
-
-Sun Dec 5 19:24:29 1993 Brendan Kehoe (brendan@lisa.cygnus.com)
-
- * iostreamP.h (convert_to_seekflags): Use _IO_seek_set instead of
- 0 inside the conditial expressions.
-
- * iofsetpos.c (_IO_fsetpos): Delete unused var `pos'.
-
-Sat Dec 4 15:57:26 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * filedoalloc.c (_IO_file_doallocate): Change type of couldbetty
- to int, and type of size to _IO_size_t, instead of size_t.
- (Change needed for Ultrix, which incorrectly deliberately doesn't
- define size_t in <sys/types.h> if _POSIX_SOURCE is defined.)
-
-Thu Dec 2 22:43:03 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * fileops.c (_IO_file_finish): Remove redundant call to _IO_un_link.
- * iofclose.c (_IO_fclose): Don't call fp->_jumps->__close; it's
- too low-level. Instead call _IO_file_close_it.
- * dbz/Makefile.in (rclean, distclean): Add some missing files.
-
-Wed Dec 1 13:19:14 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * config/hpux.mt (MATH_H_INLINES): No longer define.
- Patch from Jeffrey A Law <law@snake.cs.utah.edu>.
-
-Fri Nov 26 13:28:36 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * config.shared (CINCLUDES): Define default if libg++.
- * iofread.c: Use _IO_sgetn.c.
- * iolibio.h (_IO_clearerr): Fix typo.
- * genops.c (_IO_seekmark): Return 0 on success.
- * floactconv.c (Binit): Change to static.
- * iofclose.c (_IO_fclose): Check if file is _IO_stdin, _IO_stdout,
- or _IO_stderr; if so don't try to free it. Fix from hjl@nynexst.com.
-
- * genops.c (_IO_default_sync), libioP.h: New function.
- * libioP.h (_IO_default_close): Use _IO_default_sync -same interface.
-
- * Makefile.in: Increase version to 0.62.
- * iopopen.c (_IO_proc_close): Use waitpid (available in libibarty,
- if needed), rather than wait. Don't block/ignore SIGINT etc,
- as this is counter to Posix.2.
- * iopopen.c: Chain open proc_files, and have the child close
- the ones that are open (as required by Posix.2).
-
- * fstream.h (fstreambase::rdbuf), strstream.h (strstreambase
- ::rdbuf): Call ios::rdbuf() instead of getting _strbuf directly.
-
- * sbscan.cc (streambuf::vscan): Comment out duplicate default arg.
- * floatconv.c: Recognize Alpha and i860 as little-endian.
- * streambuf.cc: Return two bogus value returns from void functions.
- * iolibio.h, iofwrite.c: Fix buffer type to (const void*).
- * libio.h: Predefine of struct _IO_FILE to help non-g++-compilers.
- * libioP.h, pfstream.cc, stdfiles.c, iovfscanf.c: Cleanup syntax junk.
- * stdstreams.cc: Minor simplification.
- * streambuf.h, builtinbuf.cc: Add non-const ios::_IO_fix_vtable()
- for temporary binary compatibility.
-
- * filedoalloc.c, fileops.c: Add _POSIX_SOURCE.
- * fileops.c, iofopen.c, iofputs.c, iostream.cc, strops.c,
- strstream.cc, genops.c: Add some missing #includes.
- * iofopen.c, iofdopen.c: Return NULL if malloc fails.
- * iovfscanf.c: Fix return type in strtol prototype.
- * fwrite.c: Remove bogus file.
-
-Wed Nov 17 14:09:42 1993 Per Bothner (bothner@cygnus.com)
-
- * builtinbuf.cc (ios::_IO_fix_vtable), streambuf.h: Make method
- const, to reduce problems with -Wcast-qual.
-
-Tue Nov 16 19:30:42 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com)
-
- * config.shared (CXXINCLUDE): use ${} instead of $() for NOSTDINC
-
-Tue Nov 16 14:15:45 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * iopopen.c (_IO_proc_close): Re-structure to avoid
- declarations after statements.
- * floatconv.c: If not __STDC__, #define DBL_MANT_DIG.
- * config/isc.mt (G_CONFIG_ARGS): Remove bogus spaces.
- Patch from David A. Avery <daa@nic.cerf.net>.
-
-Tue Nov 16 15:58:31 1993 Mark Eichin (eichin@cygnus.com)
-
- * Makefile.in (_G_config.h): explicitly use $(SHELL) to run
- gen-params, since we know it is a script (we're explicitly looking
- in ${srcdir} for it) and /bin/sh might not be good enough.
-
-Mon Nov 15 13:26:22 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * builtinbuf.cc: Don't depend on initialization of static
- variable builtinbuf::vtable, since that might happen after
- we need it (for a static constructor). Instead, initialize
- it when needed by inlining the code from get_builtin_vtable
- into ios::_IO_fix_vtable().
-
- * floatconv.c: Avoid using #elif, which some C compilers lack.
- * iogetline.c, libioP.h: Make char parameter be int, to avoid
- some default promotion anomalies.
-
-Fri Nov 5 11:49:46 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * config.shared (do-clean-dvi): Remove TeX work files.
- * iopopen.c (extern _IO_fork): Don't use parameter type void.
- * strops.c (_IO_str_init_static): Clear the allocate_buffer
- function pointer, to mark the strfile as being static.
- Bug fix from Mike Raisbeck <mike@pudding.rtr.COM>.
-
-Thu Nov 4 10:44:24 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * filebuf.cc (filebuf:): Use sseekoff rather than seekoff
- (which loses if vtable pointer is NULL).
-
- * iostream.cc (ostream::operator<<(long long n)): Fix thinko.
-
- * Makefile.in (VERSION): Increase to 0.60.
- * Makefile.in (IO_OBJECTS): Added iopopen.o.
- * config.shared (DISTCLEAN): Also remove Make.pack.
- * config.shared (CXXINCLUDES): Add $(NOSTDINC).
-
- * config.shared (INSTALL): Fix so it ues the correct install.sh
- whether $srcdir is absolute or relative.
-
- * floatconv.c (DBL_MAX_10_EXP): Fix default value.
-
-Wed Nov 3 10:20:49 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * gen-params: Make more robust to allow random junk (NeXT
- has spaces) before typedefs.
-
- * fileops.c (_IO_file_overflow): Reduce code duplication.
- * Makefile.in (IO_OBJECTS): Remove ioputs.o.
-
- * iovfscanf.c, libio.h: Extra parameter to _IO_vfscanf,
- for optionally setting an error indication..
- * iofscanf.c, ioscanf.c, iofscanf.c, iovsscanf.c: Fix calls to
- _IO_vfscanf to pass an extra NULL.
- * sbscan.cc (streambuf::vscan): If passed an extra stream,
- set its error state (using new _IO_vfscanf parameter.
-
- * filedoalloc.c, fileops.c, genops.c, iogetline.c, ioignore.c,
- libio.h, libioP.h, streambuf.cc streambuf.h, strfile.h, strops.c,
- strstream.cc: Replace macros (_base, _ebuf, _eback, _gptr, _egptr,
- _pbase, _pptr, _epptr) by field names (_IO_buf_base, _IO_buf_end,
- _IO_read_base, _IO_read_pre, IO_read_end, _IO_write_base,
- _IO_write_ptr, _IO_write_end).
- * libio.h: Remove the old macros (which fixes a conflict.
-
-Mon Nov 1 15:22:12 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * iostream.cc: Use _IO_sputn instead of sputn. _IO_sputn does
- not require a vtable pointer, and is also slightly faster.
-
- * builtinbuf.{h,cc} (builtinbuf::setbuf): Fix return and
- parameter types.
-
-Mon Oct 25 12:56:33 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- Kludge to make sure _IO_FILE buffers get flushed before exit.
- * dbz/dbzmain.c, dbz/fake.c, dbz/byteflip.c:
- Invoke DBZ_FINISH macro (if defined) before (normal) exits.
- * dbz/Makefile.in (CFLAGS): Define DBZ_FINISH to call _IO_flush_all.
-
-Sat Oct 23 22:10:53 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * Makefile.in (VERSION): Set to 0.60 for libg++ release.
- * fileops.c (_IO_file_attach): Set _offset to _IO_pos_BAD.
- * iostream.cc (ostream::flush): Fix thinkp.
- * editbuf.cc, isgetsb.cc, isscan.cc, osform.cc, parsestream.cc,
- pfstream.cc, sbform.cc, sbscan.cc, stdstreams.cc, stream.cc:
- Replace #include "ioprivate.h" by #include "libioP.h" (and
- sometimes stdarg.h, stdlib.h and/or string.h).
- * ioprivate.h: Removed.
-
-
-Thu Oct 21 19:24:02 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * PlotFile.h, SFile.h, editbuf.cc, editbuf.h, filebuf.cc,
- fstream.cc, fstream.h, indstream.cc, indstream.h, iomanip.cc,
- iomanip.h, ioprivate.h, iostream.cc, iostream.h, isgetline.cc,
- isgetsb.cc, parsestream.cc, parsestream.h, pfstream.cc,
- pfstream.h, procbuf.cc, procbuf.h, stdiostream.cc, stdiostream.h,
- stdstreams.cc, streambuf.cc, streambuf.h, strstream.cc,
- strstream.h: Remove old (duplicate) copyright notices.
-
- * iostream.cc: Fix calls to sync() to be safe in the presence
- of vtable-less streambufs.
-
-Wed Oct 20 15:22:04 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * streambuf.h (streambuf::underflow, streambuf::overflow):
- Don't make virtual functions pure.
- * streambuf.cc (streambuf::underflow, streambuf::overflow):
- Default definitions (return EOF).
- * fstream.h: Add new (int fd, char* buf, int len) constructors.
- These are deprecated, but added for AT&T compatibility.
- * fstream.cc fstreambase::fstreambase(int fd, char *p, int l): New.
-
-Thu Oct 14 14:57:01 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com)
-
- * configure.in: use 'mv -f' instead of 'mv'
-
-Tue Oct 12 05:01:44 1993 Mike Stump (mrs@cygnus.com)
-
- * floatconv.c: Fix typo, change __STDC to __STDC__.
-
-Mon Oct 11 17:03:12 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * cleanup.c: It should be #if _G_HAVE_ATEXIT, not #ifdef.
-
- * floatconv.c, iostrerror.c, iovfprintf.c, iovfscanf.c, libioP.h:
- Bunch of fixes to allow use of non-ANSI (K&R) C compilers.
-
- * Makefile.in (iostream.list): Use CC=$(CXX) to force use of gcc.
- * README: New file.
-
-Fri Oct 8 16:19:58 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * Makefile.in: Move ioungetc.o from STDIO_WRAP_OBJECTS to
- IO_OBJECTS (since it is needed for iovfscanf.c).
- * iostrerror.c: Add declaration of strerror.
-
-Thu Oct 7 12:02:28 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * cleanup.c: New file, to cause flushing at exit.
- * filedoalloc.c: Cause flushing on exit.
- * Makefile.in (OSPRIM_OBJECTS): Add cleanup.o.
- * gen-params: Check for atexit.
-
-Tue Oct 5 19:11:14 1993 Mike Stump (mrs@cygnus.com)
-
- * ioperror.c (_IO_strerror): Add missing ()s in _PARAMS usage.
-
-Tue Oct 5 10:33:37 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * iofprintf.c, iofscanf.c, ioprintf.c, ioscanf.c, iosprintf.c,
- iosscanf.c: Remove bogus semi-colon after va_dcl.
- * ioperror.c: Fix typos in declaration.
-
-Mon Oct 4 17:12:22 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * configure.in (CLEAN): Define (as _G_config.h *.a).
-
- * fileops.c (_IO_file_read): Don't assume EINTR is defined.
- * iosetbuf.c: Replace by generalized ...
- * iosetbuffer.c: ... variant, derived from BSD.
- * Makefile.in (STDIO_WRAP_OBJECTS): Change correspondingly.
- * iosetvbuf.c (iosetvbuf): Minor ANSI tweak.
- * iostdio.h (setbuf, setlinebuf): New #defines.
- * iolibio.h (_IO_setbuf, _IO_setlinebuf): (Re-)define as macros.
- * Makefile.in (LIBIO_OBJECTS): New macro.
-
-Tue Sep 28 14:15:52 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * libioP.h (_IO_proc_open, _IO_proc_close): Add missing return types.
- * procbuf.cc: Belated fixes.
-
-Mon Sep 27 14:04:47 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * Makefile.in: List new files. Add STDIO_WRAP_OBJECTS macro.
- * floatconv.c (d2b): Use Exp_msk11 instead of Exp_msk1.
- * iofgetpos.c (_IO_fgetpos), iofsetpos.c (_IO_fsetpos): Clean up.
- * iolibio.h: New file. Declarations of _IO_foo, for most foo
- where foo is a stdio function. (Remove these from libio.h.)
- * iostream.h (istream::istreambuf, ostream::ostreambuf): Move
- obsolete functions inside #ifdef _STREAM_COMPAT.
- * libio.h, libioP.h, streambuf.h, parsestream.h, stdiostream.h:
- Use _IO_fpos_t rather than _IO_pos_t.
- * iopopen.c: New file type, for pipe (popen-like) streams.
- * procbuf.cc: Now just a C++ wrapper for the files in iopopen.c.
- * streambuf.h (ios::unsetf): Return complete old value of flags.
- * iogets.c (_IO_gets(), ioungetc.c (_IO_ungetc), ioperror.c
- (_IO_perror), iostrerror.c (_IO_strerror): New files and
- functions, for stdio implementation.
- * iostdio.h: Add declarations for various recently-added functions.
-
-Sun Sep 12 14:24:55 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * streambuf.h (ios::showpos):: Fix typo.
-
-Fri Aug 27 12:05:47 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * iopadn.c (_IO_padn): Change to return count of chars written.
- * outfloat.c, iovfprintf.c: Change for new _IO_padn interface.
- * iostream.cc (ostream::operator<<): Make sure to set badbit
- on a failure (many places). Use _IO_padn more.
- * iostream.cc (ostream& ostream::operator<<(const void *p): Move to
- * osform.cc: ... here, to reduce linking-in-the-world syndrome.
- * osform.cc: Use rdbuf(), instead of _strbuf directly.
-
- * genops.c (_IO_sgetn), libio.h: New function.
- * streambuf.h (streambuf.h::sgetn): Use _IO_sgetn.
- * SFile.cc (SFile::operator[]): Use sseekoff, not seekoff.
-
-Thu Aug 26 10:16:31 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com)
-
- * config.shared (SUBDIRS): only recurse if the directory is configured
-
-Wed Aug 25 12:56:12 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * config/{hpux.mt, isc.mt, sco4.mt}:
- Moved from ../libg++/config (since they affect _G_config.h).
- * configure.in: Set target_make_frag to one of the above files.
-
-Fri Aug 20 00:53:14 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * iofopen.c (iofopen): Fix type passed to _IO_un_link().
- * Makefile.in (_G_config.h): Pass $CC (not $CXX) as CC.
-
- * configure.in (configdirs): Add dbz and stdio.
- * fileops.c (_IO_file_seekoff): Convert more old functionality.
- * iofdopen.c: Use mode parameter to set _flags.
- * iofscanf.c, ioputs.c, ioscanf.c, iosprintf.c: New files.
- * Makefile.in (IO_OBJECTS): Added new objects.
- * iostdio.h: Add feof. fscanf, puts, sprintf, vsprintf.
- * libio.h: Add _IO_vprintf macro.
- * iofopen.c: Invoke _IO_un_link if failure.
- * iovsprintf.c: Write terminating NUL.
-
- * libioP.h: Add COERCE_FILE macro (by default does nothing).
- * iofclose.c, iofflush.c, iofgets.c, iofprintf.c, iofputs.c,
- iofread.c, ioftell.c, iofwrite.c, iosetbuf.c, iosetvbuf.c:
- Invoke COERCE_FILE macro.
- * ioftell.c: Use _IO_seekoff.
-
-Wed Aug 18 22:49:56 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * sbform.cc (streambuf::form), sbscan.cc (streambuf::scan):
- Remove cast to _IO_va_list. (Loses if array type.)
-
- * libio.h: Handle _IO_va_list for systems that need <stdarg.h>.
- * floatconv.h: Fix typo (reported by H.J.Lu).
-
-Wed Aug 18 19:34:04 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com)
-
- * configure.in (INSTALLDIR): handle native vs. cross case
-
- * Makefile.in (install): don't use $TARGETLIB, set INSTALLDIR to
- $(libdir)
-
-Wed Aug 18 12:10:03 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * Makefile.in: Rename iostream-files to iostream.list.
- * configure.in: Add iostream.list to MOSTLYCLEAN.
-
-Tue Aug 17 18:56:59 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * Makefile.in: Depend on _G_config.h where appropriate.
- * config.shared (CXXINCLUDES): If doing libg++, search ../libio.
-
-Tue Aug 17 17:34:24 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- New directory. Based on old libg++/iostream code,
- but extensively re-written.
diff --git a/contrib/libio/Makefile.in b/contrib/libio/Makefile.in
deleted file mode 100644
index 1d4123b523c3..000000000000
--- a/contrib/libio/Makefile.in
+++ /dev/null
@@ -1,137 +0,0 @@
-# Copyright (C) 1993, 1995, 1996, 1997, 1998 Free Software Foundation
-#
-# 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.
-
-srcdir = .
-
-VERSION = 2.8.0
-# The config file (overriden by Linux).
-_G_CONFIG_H=_G_config.h
-tooldir = $(exec_prefix)/$(target)
-INSTALLDIR = $(libdir)
-gxx_include_dir=${includedir}/g++
-
-IO_OBJECTS = filedoalloc.o floatconv.o genops.o fileops.o \
- iovfprintf.o \
- iovfscanf.o ioignore.o iopadn.o \
- iofgetpos.o iofread.o iofscanf.o \
- iofsetpos.o iogetdelim.o iogetline.o \
- ioprintf.o ioseekoff.o ioseekpos.o \
- outfloat.o strops.o iofclose.o iopopen.o ioungetc.o peekc.o iogetc.o \
- ioputc.o iofeof.o ioferror.o
-
-STDIO_OBJECTS = stdfiles.o
-
-# These emulate stdio functionality, but with a different name (_IO_ungetc
-# instead of ungetc), and using _IO_FILE instead of FILE.
-# They are not needed for C++ iostream, nor stdio, though some stdio
-# files are build using the same source files (see stdio/configure.in).
-# They are needed for iostdio.h. They are needed under Linux to avoid
-# version incompatibility problems with the C library.
-# iofclose.o is not here, because it is needed for stdio (by pclose).
-STDIO_WRAP_OBJECTS = iofdopen.o iofflush.o iofgets.o iofopen.o iofprintf.o iofputs.o iofwrite.o \
- iogets.o ioperror.o ioputs.o ioscanf.o iosetbuffer.o iosetvbuf.o \
- iosprintf.o iosscanf.o ioftell.o iovsscanf.o iovsprintf.o
-
-IOSTREAM_OBJECTS = builtinbuf.o filebuf.o fstream.o \
- indstream.o ioassign.o ioextend.o iomanip.o iostream.o \
- isgetline.o isgetsb.o isscan.o \
- osform.o procbuf.o sbform.o sbgetline.o sbscan.o \
- stdiostream.o stdstrbufs.o stdstreams.o stream.o streambuf.o strstream.o \
- PlotFile.o SFile.o parsestream.o pfstream.o editbuf.o
-
-# These files define _IO_read etc, which are just wrappers for read(2) etc.
-# They need to be changed to use name-space-clean (e.g. __read) versions
-# for each specific libc.
-OSPRIM_OBJECTS = ioprims.o iostrerror.o cleanup.o
-
-LIBIOSTREAM_OBJECTS = $(IO_OBJECTS) $(IOSTREAM_OBJECTS) $(OSPRIM_OBJECTS)
-LIBIO_OBJECTS = $(IO_OBJECTS) $(STDIO_WRAP_OBJECTS) $(OSPRIM_OBJECTS) \
- $(STDIO_OBJECTS)
-
-LIBIOSTREAM_DEP = $(LIBIOSTREAM_OBJECTS)
-LIBIOSTREAM_USE = $(LIBIOSTREAM_OBJECTS)
-
-USER_INCLUDES = *.h
-
-PICFLAG =
-
-#### package, host, target, and site dependent Makefile fragments come in here.
-##
-
-$(LIBIO_OBJECTS): $(_G_CONFIG_H)
-
-libio.a: $(_G_CONFIG_H) $(LIBIO_OBJECTS)
- -rm -rf libio.a
- $(AR) $(AR_FLAGS) libio.a $(LIBIO_OBJECTS)
- $(RANLIB) libio.a
-
-libiostream.a: $(_G_CONFIG_H) $(LIBIOSTREAM_DEP)
- -rm -rf libiostream.a
- $(AR) $(AR_FLAGS) libiostream.a $(LIBIOSTREAM_USE)
- $(RANLIB) libiostream.a
-
-test: test.o libio.a
- $(CC) $(CFLAGS) -o test test.o libio.a
-tpipe: tpipe.o libio.a
- $(CC) $(CFLAGS) -o tpipe tpipe.o libio.a
-
-iostream.list: $(_G_CONFIG_H) $(LIBIOSTREAM_DEP)
- @echo "$(LIBIOSTREAM_USE)"> iostream.list
-
-# The "pic" subdir must be created before we can put any object
-# files into it.
-$(LIBIOSTREAM_DEP) $(LIBIO_OBJECTS): stamp-picdir
-
-stmp-stdio:
- @rootme=`pwd`/ ; export rootme; cd stdio ; \
- $(MAKE) $(FLAGS_TO_PASS) stdio.list
-
-_G_config.h: ${srcdir}/gen-params
- rootme=`pwd`/ ; export rootme; \
- CC="$(CC) $(CINCLUDES)"; export CC; \
- CXX="$(CXX) $(CXXINCLUDES) $(NOSTDINC) $(CXXFLAGS)"; export CXX; \
- CONFIG_NM="$(NM)"; export CONFIG_NM; \
- $(SHELL) ${srcdir}/gen-params LIB_VERSION=$(VERSION) $(G_CONFIG_ARGS) >tmp-params.h
- mv tmp-params.h _G_config.h
-
-install:
- rootme=`pwd`/ ; export rootme ; \
- if [ -z "$(MULTISUBDIR)" ]; then \
- if [ "$(_G_CONFIG_H)" != "" ]; then \
- if [ x$(enable_version_specific_runtime_libs) = xyes ]; then \
- rm -f $(gxx_include_dir)/_G_config.h ; \
- $(INSTALL_DATA) _G_config.h $(gxx_include_dir)/_G_config.h || exit 1; \
- else \
- rm -f $(tooldir)/include/_G_config.h ; \
- $(INSTALL_DATA) _G_config.h $(tooldir)/include/_G_config.h || exit 1; \
- fi; \
- else true; \
- fi ; \
- cd $(srcdir); \
- for FILE in $(USER_INCLUDES); do if [ $$FILE != _G_config.h ]; then \
- rm -f $(gxx_include_dir)/$$FILE ; \
- $(INSTALL_DATA) $$FILE $(gxx_include_dir)/$$FILE ; \
- chmod a-x $(gxx_include_dir)/$$FILE ; \
- else true; fi; done ; \
- else true; \
- fi
- @rootme=`pwd`/ ; export rootme ; \
- $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=install
-
-c++clean:
- rm -rf $(IOSTREAM_OBJECTS)
- @$(MAKE) $(FLAGS_TO_PASS) "DODIRS=tests" DO=clean subdir_do
diff --git a/contrib/libio/NEWS b/contrib/libio/NEWS
deleted file mode 100644
index 1f3b7781e226..000000000000
--- a/contrib/libio/NEWS
+++ /dev/null
@@ -1,57 +0,0 @@
-*** Major changes in libio for egcs:
-
-* Better support for Linux.
-
-* Dejagnu testsuite.
-
-*** Major changes in libio version 2.7.0:
-
-* The data representations of _IO_FILE and streambufs have been modified.
- The layout of the jump-table table _IO_jumps_t has been re-arranged
- to match that of a virtual function table of a streambuf. Therefore,
- we no longer need a separate _IO_FILE::_jumps pointer; instead it can
- be shared with the virtual function table pointer. In addition to
- saving space, this also removes the overhead when double indirection
- was needed, and there are many simplificatons (e.g. we no longer need
- the builtinbuf class.
-
-* The streambuf::uflow virtual has been added, to match the standard.
-
-* The ifstream, ofstream, and fstream classes now include the filebuf
- as a member, rather than being pointed to it. Various related changes.
-
-* Version number changed to generally follow libg++ (and gcc).
-
-*** Major changes in libio version 0.66 (released with libg++ 2.6.1):
-
-* Some documentation and an example in iostream.texi on how to derive
- your own class from streambuf.
-
-* New functions added to stdio: getline, detdelim, snprintf, vsnprintf.
- This is for compatibility with the GNU C library.
-
-*** Major changes in libio version 0.65 (released with libg++ 2.6):
-
-* _IO_getline and streambuf::sgetline no longer write a '\0' at the end.
-
-* A number of improvements to get closer to the ANSI/ISO C++ working
-paper, such as:
-- Added (preliminary support for) new ANSI streambuf::uflow virtual.
-- Added istdiostream and ostdiostream classes.
-- Added ostream::operator<<(bool) and istream::operator>>(bool&).
-
-* More robust (and faster) initialization and cleanup of standard streambufs.
-
-* Many small bug fixes, portability improvements, and random enhancements.
-
-*** Major changes in libio version 0.63 (released with libg++ 2.5.3):
-
-* There is a g++ bug that causes inconsistent name mangling for the
-assembler name of the virtual function table for the istream class.
-A work-around has been put into streambuf.h, which will make g++
-always do the right thing. Note that this may require you to
-recompile programs that were incorrectly compiled by g++.
-
-* Functions that do printf-style formatting to the unbuffered
-streams have been optimized to write to a temporary buffer.
-
diff --git a/contrib/libio/PlotFile.cc b/contrib/libio/PlotFile.cc
deleted file mode 100644
index 98b2d839555d..000000000000
--- a/contrib/libio/PlotFile.cc
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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. */
-
-// This may look like C code, but it is really -*- C++ -*-
-/*
-Copyright (C) 1988, 1992, 1993 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
- converted to use iostream library by Per Bothner (bothner@cygnus.com)
-
-This file is part of the GNU IO Library. This library is free
-software; you can redistribute it and/or modify it under the
-terms of the GNU General Public License as published by the
-Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-This library is 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 GCC to produce an executable, this does not cause
-the resulting executable to be covered by the GNU General Public License.
-This exception does not however invalidate any other reasons why
-the executable file might be covered by the GNU General Public License. */
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <PlotFile.h>
-
-/*
- PlotFile implementation module
-*/
-
-
-PlotFile& PlotFile:: cmd(char c)
-{
- ofstream::put(c);
- return *this;
-}
-
-PlotFile& PlotFile:: operator<<(const int x)
-{
-#if defined(convex)
- ofstream::put((char)(x>>8));
- ofstream::put((char)(x&0377));
-#else
- ofstream::put((char)(x&0377));
- ofstream::put((char)(x>>8));
-#endif
- return *this;
-}
-
-PlotFile& PlotFile:: operator<<(const char *s)
-{
- *(ofstream*)this << s;
- return *this;
-}
-
-
-PlotFile& PlotFile:: arc(const int xi, const int yi,
- const int x0, const int y0,
- const int x1, const int y1)
-{
- return cmd('a') << xi << yi << x0 << y0 << x1 << y1;
-}
-
-
-PlotFile& PlotFile:: box(const int x0, const int y0,
- const int x1, const int y1)
-{
- line(x0, y0, x0, y1);
- line(x0, y1, x1, y1);
- line(x1, y1, x1, y0);
- return line(x1, y0, x0, y0);
-}
-
-PlotFile& PlotFile:: circle(const int x, const int y, const int r)
-{
- return cmd('c') << x << y << r;
-}
-
-PlotFile& PlotFile:: cont(const int xi, const int yi)
-{
- return cmd('n') << xi << yi;
-}
-
-PlotFile& PlotFile:: dot(const int xi, const int yi, const int dx,
- int n, const int* pat)
-{
- cmd('d') << xi << yi << dx << n;
- while (n-- > 0) *this << *pat++;
- return *this;
-}
-
-PlotFile& PlotFile:: erase()
-{
- return cmd('e');
-}
-
-PlotFile& PlotFile:: label(const char* s)
-{
- return cmd('t') << s << "\n";
-}
-
-PlotFile& PlotFile:: line(const int x0, const int y0,
- const int x1, const int y1)
-{
- return cmd('l') << x0 << y0 << x1 << y1;
-}
-
-PlotFile& PlotFile:: linemod(const char* s)
-{
- return cmd('f') << s << "\n";
-}
-
-PlotFile& PlotFile:: move(const int xi, const int yi)
-{
- return cmd('m') << xi << yi;
-}
-
-PlotFile& PlotFile:: point(const int xi, const int yi)
-{
- return cmd('p') << xi << yi;
-}
-
-PlotFile& PlotFile:: space(const int x0, const int y0,
- const int x1, const int y1)
-{
- return cmd('s') << x0 << y0 << x1 << y1;
-}
diff --git a/contrib/libio/PlotFile.h b/contrib/libio/PlotFile.h
deleted file mode 100644
index 82b08bc4681c..000000000000
--- a/contrib/libio/PlotFile.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/* This is part of libio/iostream, providing -*- C++ -*- input/output.
-Copyright (C) 1993 Free Software Foundation
-
-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. */
-
-/*
- a very simple implementation of a class to output unix "plot"
- format plotter files. See corresponding unix man pages for
- more details.
-
- written by Doug Lea (dl@rocky.oswego.edu)
- converted to use iostream library by Per Bothner (bothner@cygnus.com)
-*/
-
-#ifndef _PlotFile_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _PlotFile_h
-
-#include <fstream.h>
-
-/*
- Some plot libraries have the `box' command to draw boxes. Some don't.
- `box' is included here via moves & lines to allow both possiblilties.
-*/
-
-extern "C++" {
-class PlotFile : public ofstream
-{
-protected:
- PlotFile& cmd(char c);
- PlotFile& operator << (const int x);
- PlotFile& operator << (const char *s);
-
-public:
-
- PlotFile() : ofstream() { }
- PlotFile(int fd) : ofstream(fd) { }
- PlotFile(const char *name, int mode=ios::out, int prot=0664)
- : ofstream(name, mode, prot) { }
-
-// PlotFile& remove() { ofstream::remove(); return *this; }
-
-// int filedesc() { return ofstream::filedesc(); }
-// const char* name() { return File::name(); }
-// void setname(const char* newname) { File::setname(newname); }
-// int iocount() { return File::iocount(); }
-
- PlotFile& arc(const int xi, const int yi,
- const int x0, const int y0,
- const int x1, const int y1);
- PlotFile& box(const int x0, const int y0,
- const int x1, const int y1);
- PlotFile& circle(const int x, const int y, const int r);
- PlotFile& cont(const int xi, const int yi);
- PlotFile& dot(const int xi, const int yi, const int dx,
- int n, const int* pat);
- PlotFile& erase();
- PlotFile& label(const char* s);
- PlotFile& line(const int x0, const int y0,
- const int x1, const int y1);
- PlotFile& linemod(const char* s);
- PlotFile& move(const int xi, const int yi);
- PlotFile& point(const int xi, const int yi);
- PlotFile& space(const int x0, const int y0,
- const int x1, const int y1);
-};
-} // extern "C++"
-#endif
diff --git a/contrib/libio/README b/contrib/libio/README
deleted file mode 100644
index c2d564965ca4..000000000000
--- a/contrib/libio/README
+++ /dev/null
@@ -1,30 +0,0 @@
-This is libio, the GNU C/C++ input/output library.
-
-By default, the library is configured to build the C++ iostream
-facility (in $libdir/libiostream.a).
-
-The library can be configured to build the C stdio facility
-that is part of a C run-time library.
-
-This library is distributed with libg++; see ../libg++/README
-for installation instructions, and where to send bug reports
-and questions.
-
-* Copyright restrictions
-
-The files in this directory are generally covered by the GNU Public
-License (which is in the file ../COPYING), but modified with the
-following:
-
- 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.
-
-A few source files and subroutines are covered by other (but
-less restrictive) copyright conditions. E.g. some code (such
-as iovfprintf.c) is based on software that was developed by the
-University of California, Berkeley, for the Berkeley Software
-Distribution (BSD-4.4), and bears their copyright; and one
-file (floatconv.c) is derived from ("free") code copyrighted AT&T.
diff --git a/contrib/libio/SFile.cc b/contrib/libio/SFile.cc
deleted file mode 100644
index e5daa645695e..000000000000
--- a/contrib/libio/SFile.cc
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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. */
-
-/*
-Copyright (C) 1988 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-This file is part of the GNU C++ Library. This library is free
-software; you can redistribute it and/or modify it under the terms of
-the GNU Library General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your
-option) any later version. This library is distributed in the hope
-that it will be useful, but WITHOUT ANY WARRANTY; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <SFile.h>
-
-SFile::SFile(const char *filename, int size, int mode, int prot)
-: fstream(filename, mode, prot)
-{
- sz = size;
-}
-
-SFile::SFile(int fd, int size)
-: fstream(fd)
-{
- sz = size;
-}
-
-void SFile::open(const char *name, int size, int mode, int prot)
-{
- fstream::open(name, mode, prot);
- sz = size;
-}
-
-SFile& SFile::get(void* x)
-{
- read(x, sz);
- return *this;
-}
-
-SFile& SFile::put(void* x)
-{
- write(x, sz);
- return *this;
-}
-
-SFile& SFile::operator[](long i)
-{
- if (rdbuf()->pubseekoff(i * sz, ios::beg) == EOF)
- set(ios::badbit);
- return *this;
-}
diff --git a/contrib/libio/SFile.h b/contrib/libio/SFile.h
deleted file mode 100644
index f07277cee49f..000000000000
--- a/contrib/libio/SFile.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/* This is part of libio/iostream, providing -*- C++ -*- input/output.
-Copyright (C) 1988, 1992, 1993 Free Software Foundation
- written by Doug Lea (dl@rocky.oswego.edu)
-
-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. */
-
-#ifndef _SFile_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _SFile_h 1
-
-#include <fstream.h>
-
-extern "C++" {
-class SFile: public fstream
-{
- protected:
- int sz; // unit size for structured binary IO
-
-public:
- SFile() : fstream() { }
- SFile(int fd, int size);
- SFile(const char *name, int size, int mode, int prot=0664);
- void open(const char *name, int size, int mode, int prot=0664);
-
- int size() { return sz; }
- int setsize(int s) { int old = sz; sz = s; return old; }
-
- SFile& get(void* x);
- SFile& put(void* x);
- SFile& operator[](long i);
-};
-} // extern "C++"
-
-#endif
diff --git a/contrib/libio/builtinbuf.cc b/contrib/libio/builtinbuf.cc
deleted file mode 100644
index 05e65a5c371b..000000000000
--- a/contrib/libio/builtinbuf.cc
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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. */
-
-#ifdef __GNUC__
-#pragma implementation
-#endif
-#define _STREAM_COMPAT
-#include "builtinbuf.h"
-#include "iostreamP.h"
-#if !_IO_UNIFIED_JUMPTABLES
-int builtinbuf::overflow(int ch) { return _IO_OVERFLOW (this, ch); }
-
-int builtinbuf::underflow() { return _IO_UNDERFLOW (this); }
-
-streamsize builtinbuf::xsgetn(char* buf, streamsize n)
-{ return _IO_XSGETN (this, buf, n); }
-
-streamsize builtinbuf::xsputn(const char* buf, streamsize n)
-{ return _IO_XSPUTN (this, buf, n); }
-
-int builtinbuf::doallocate() { return _IO_DOALLOCATE (this); }
-
-builtinbuf::~builtinbuf() { _IO_FINISH (this); }
-
-int builtinbuf::sync() { return _IO_SYNC (this); }
-
-streambuf* builtinbuf::setbuf(char *buf, int n)
-{ return (streambuf*)_IO_SETBUF (this, buf, n); }
-
-streampos builtinbuf::seekoff(streamoff off, _seek_dir dir, int mode)
-{
- return _IO_SEEKOFF (this, off, dir, mode);
-}
-
-streampos builtinbuf::seekpos(streampos pos, int mode)
-{
- return _IO_SEEKPOS (this, pos, mode);
-}
-
-int builtinbuf::pbackfail(int c)
-{ return _IO_PBACKFAIL (this, c); }
-
-streamsize builtinbuf::sys_read(char* buf, streamsize size)
-{ return _IO_SYSREAD (this, buf, size); }
-
-streampos builtinbuf::sys_seek(streamoff off, _seek_dir dir)
-{ return _IO_SYSSEEK (this, off, dir); }
-
-streamsize builtinbuf::sys_write(const char* buf, streamsize size)
-{ return _IO_SYSWRITE (this, buf, size); }
-
-int builtinbuf::sys_stat(void* buf) // Actually, a (struct stat*)
-{ return _IO_SYSSTAT (this, buf); }
-
-int builtinbuf::sys_close()
-{ return _IO_SYSCLOSE (this); }
-#endif
diff --git a/contrib/libio/builtinbuf.h b/contrib/libio/builtinbuf.h
deleted file mode 100644
index 3aa4c37a654f..000000000000
--- a/contrib/libio/builtinbuf.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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. */
-
-#ifndef _BUILTINBUF_H
-#define _BUILTINBUF_H
-
-#ifdef __GNUC__
-#pragma interface
-#endif
-
-#include <streambuf.h>
-
-#if !_IO_UNIFIED_JUMPTABLES
-// A builtinbuf is a streambuf where all the virtual operations
-// call the _IO_jump_t table.
-
-extern "C++" {
-class builtinbuf : public streambuf {
- friend ios;
- virtual int overflow(int);
- virtual int underflow();
- virtual streamsize xsgetn(char *, streamsize);
- virtual streamsize xsputn(const char *, streamsize);
- virtual streambuf* setbuf(char*, int);
- virtual int doallocate();
- virtual ~builtinbuf();
- virtual int sync();
-
- virtual streampos seekoff(streamoff, _seek_dir, int mode=ios::in|ios::out);
- virtual streampos seekpos(streampos pos, int mode = ios::in|ios::out);
- virtual int pbackfail(int c);
- virtual streamsize sys_read(char* buf, streamsize size);
- virtual streampos sys_seek(streamoff, _seek_dir);
- virtual streamsize sys_write(const char*, streamsize);
- virtual int sys_stat(void*); // Actually, a (struct stat*)
- virtual int sys_close();
-#if 0
- virtual int get_column();
- virtual int set_column(int);
-#endif
- private:
- builtinbuf() { }
-};
-} // extern "C++"
-#endif
-
-#endif /* _BUILTINBUF_H */
diff --git a/contrib/libio/cleanup.c b/contrib/libio/cleanup.c
deleted file mode 100644
index 691fa838b26a..000000000000
--- a/contrib/libio/cleanup.c
+++ /dev/null
@@ -1,17 +0,0 @@
-#include "libioP.h"
-#if _G_HAVE_ATEXIT
-#include <stdlib.h>
-
-typedef void (*voidfunc) __P((void));
-
-static void
-_IO_register_cleanup ()
-{
- atexit ((voidfunc)_IO_cleanup);
- _IO_cleanup_registration_needed = 0;
-}
-
-void (*_IO_cleanup_registration_needed)() = _IO_register_cleanup;
-#else
-void (*_IO_cleanup_registration_needed)() = NULL;
-#endif /* _G_HAVE_ATEXIT */
diff --git a/contrib/libio/config.shared b/contrib/libio/config.shared
deleted file mode 100644
index 6cda566eb7bd..000000000000
--- a/contrib/libio/config.shared
+++ /dev/null
@@ -1,499 +0,0 @@
-# Copyright (C) 1993, 1995, 1997, 1998 Free Software Foundation
-#
-# 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 GNU CC; see the file COPYING. If not, write to
-# the Free Software Foundation, 59 Temple Place - Suite 330,
-# Boston, MA 02111-1307, USA. */
-
-# File descriptor usage:
-# 1: All macros which need to be re-definable by any target fragments
-# 2: All generic rules; especially those which use re-defined macros, e.g. _G_CONFIG_H!
-
-# Significant variables:
-
-# Note that TO_TOPDIR does *not* include multilib.
-test -z "${TO_TOPDIR}" && TO_TOPDIR=${TOLIBGXX}../
-# Native configurations build target libraries in directories at the same
-# level as the rest of the tree. Cross configurations build target libraries
-# one level deeper. TO_REAL_TOPDIR accounts for this.
-# Obviously, TO_REAL_TOPDIR can only be used in the build tree.
-if [ "${with_target_subdir}" != "." ] ; then
- TO_REAL_TOPDIR="${TO_TOPDIR}../"
-else
- TO_REAL_TOPDIR="${TO_TOPDIR}"
-fi
-DOING_LIBGXX=${DOING_LIBGXX-false}
-THIS_FILE="${srcdir}/${TOLIBIO}config.shared"
-
-echo "# Start of package fragment generated by ${THIS_FILE}."
-echo ""
-echo >&2 "# Start of package rules fragment generated by ${THIS_FILE}."
-echo >&2 ""
-
-# Multilib support.
-echo 'MULTISRCTOP ='
-echo 'MULTIBUILDTOP ='
-echo 'MULTIDIRS ='
-echo 'MULTISUBDIR ='
-echo 'MULTIDO = true'
-echo 'MULTICLEAN = true'
-echo ''
-
-# TOLIBGXX
-# MOSTLYCLEAN
-# CLEAN
-# DISTCLEAN
-# REALCLEAN
-# SUBDIRS [defaults to (configdirs)]
-# INFO_FILES List of (basenames of) texinfo files
-# INFO_SUBDIRS [default: empty] sub-directories containing documentation
-
-# ??? This doesn't appear to be used by us or any of our callers.
-# Note that all uses in this file are single-quoted.
-rootme=${rootme-`pwd`}
-
-# libg++ uses the convention that $rootme includes a trailing '/'.
-# We use that in the definition of TOPDIR. $rootme is either empty
-# or an absolute pathname to the current directory (with trailing '/').
-TOPDIR=${TOPDIR-'$${rootme}$(MULTIBUILDTOP)'${TO_REAL_TOPDIR}}
-echo '#' TOPDIR="${TOPDIR} invsubdir=${invsubdir} subdir=${subdir}"
-SUBDIRS=${SUBDIRS-${configdirs}}
-CHECK_SUBDIRS=${CHECK_SUBDIRS-${SUBDIRS}}
-
-echo "srcdir = ${srcdir}"
-echo "SUBDIRS = ${SUBDIRS}"
-echo "CHECK_SUBDIRS = ${CHECK_SUBDIRS}"
-
-echo "prefix = ${prefix-/usr/local}"
-echo "exec_prefix = ${exec_prefix-'${prefix}'}"
-
-echo 'bindir = $(exec_prefix)/bin'
-echo 'libdir = $(exec_prefix)/lib'
-echo 'libsubdir = $(libdir)/gcc-lib/$(target_alias)/$(gcc_version)'
-
-echo 'datadir = $(prefix)/lib'
-echo 'mandir = $(prefix)/man'
-echo 'man1dir = $(mandir)/man1'
-echo 'man2dir = $(mandir)/man2'
-echo 'man3dir = $(mandir)/man3'
-echo 'man4dir = $(mandir)/man4'
-echo 'man5dir = $(mandir)/man5'
-echo 'man6dir = $(mandir)/man6'
-echo 'man7dir = $(mandir)/man7'
-echo 'man8dir = $(mandir)/man8'
-echo 'man9dir = $(mandir)/man9'
-
-echo 'infodir = $(prefix)/info'
-echo 'includedir = $(prefix)/include'
-echo 'docdir = $(datadir)/doc'
-echo ''
-echo 'SHELL = /bin/sh'
-echo ''
-case "$srcdir" in
- /*) echo 'INSTALL = $(srcdir)'/"${TO_TOPDIR}install-sh -c" ;;
- .) echo 'INSTALL = $${rootme}'"${with_multisrctop}${TO_REAL_TOPDIR}install-sh -c" ;;
- *) echo 'INSTALL = $${rootme}$(srcdir)'/"${TO_TOPDIR}install-sh -c" ;;
-esac
-echo 'INSTALL_PROGRAM = $(INSTALL)'
-echo 'INSTALL_DATA = $(INSTALL)'
-echo ''
-echo 'AR = `if [ -f' ${TOPDIR}'binutils/ar ] ; \'
-echo " then echo ${TOPDIR}binutils/ar ; "'\'
-echo ' else echo ar ; fi`'
-echo 'AR_FLAGS = rc'
-echo 'RANLIB = `if [ -f' ${TOPDIR}'binutils/ranlib ] ; \'
-echo ' then echo '${TOPDIR}'binutils/ranlib ; \'
-echo ' else echo ranlib ; fi`'
-echo 'NM = `if [ -f' ${TOPDIR}'binutils/nm.new ] ; \'
-echo ' then echo '${TOPDIR}'binutils/nm.new ; \'
-echo ' else echo nm ; fi`'
-echo 'NLMCONV = `if [ -f' ${TOPDIR}'binutils/nlmconv ] ; \'
-echo ' then echo '${TOPDIR}'binutils/nlmconv ; \'
-echo ' else echo nlmconv ; fi`'
-echo 'LD = `if [ -f' ${TOPDIR}'ld/ld.new ] ; \'
-echo ' then echo '${TOPDIR}'ld/ld.new ; \'
-echo ' else echo ld ; fi`'
-echo ''
-echo 'MAKEINFO = `if [ -f '${TOPDIR}'texinfo/C/makeinfo ] ; \'
-echo ' then echo '${TOPDIR}'texinfo/C/makeinfo ; \'
-echo ' else echo makeinfo ; fi`'
-case "$srcdir" in
- .) echo 'TEXIDIR = '"${with_multisrctop}${TO_REAL_TOPDIR}texinfo" ;;
- *) echo 'TEXIDIR = $(srcdir)'/"${TO_TOPDIR}texinfo" ;;
-esac
-echo 'TEXI2DVI = TEXINPUTS=${TEXIDIR}:$$TEXINPUTS texi2dvi'
-echo ''
-echo 'CC = cc'
-echo 'CXX = gcc'
-echo ''
-# FIXME!!!
-if true ; then
- echo 'WRAP_C_INCLUDES ='
-else
- echo 'WRAP_C_INCLUDES = -I$(srcdir)'/${TOLIBGXX}g++-include
-fi
-echo 'CFLAGS = -g'
-echo 'CXXFLAGS = -g -O'
-echo 'LIBCFLAGS = $(CFLAGS)'
-echo 'LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates'
-if [ "${LIBDIR}" = "yes" ]; then
- echo 'PICDIR = stamp-picdir'
-else
- echo 'PICDIR = '
-fi
-
-if test "${DOING_LIBGXX}" = "true" ; then
- echo "TOLIBGXX = ${TOLIBGXX}"
- echo 'PROTODIR = $(srcdir)'/${TOLIBGXX}src/gen
- echo "LIBS = -L./${TOLIBGXX} -L./${TOLIBGXX}../libstdc++ -lg++ -lstdc++"
-
- # You can override iostream (e.g. in a site- or host-Makefile fragment) to:
- # iostream (Normal iostream library)
- # old-stream (Old stream library; no longer supported)
- # no-stream (If you don't want iostream to be part of libg++)
- echo 'IO_DIR = ../libio'
- echo '# IO_DIR = no-stream'
-elif test "${DOING_GPERF}" = "true" ; then
- echo "IO_DIR = libio"
- echo "LIBS = -L${TO_TOPDIR}libstdc++ -lstdc++"
-fi
-
-if [ -z "${ALL}" ] ; then
- if [ -n "${TARGETLIB}" ] ; then
- ALL='$(TARGETLIB)'
- echo "TARGETLIB = ${TARGETLIB}"
- elif [ -n "${TARGETPROG}" ] ; then
- ALL='${TARGETPROG}'
- echo "TARGETPROG = ${TARGETPROG}"
- else
- echo "config error: neither ALL, TARGETLIB or TARGETPROG is defined" 1>&2
- fi
-fi
-
-echo >&2 "all: ${ALL} multi-all"
-if [ "${SUBDIRS}" != "" ] ; then
- echo >&2 ' @rootme=`pwd`/; export rootme; \'
- echo >&2 ' $(MAKE) "DODIRS=$(SUBDIRS)" DO=all $(FLAGS_TO_PASS) subdir_do'
-fi
-if [ "${LIBDIR}" = "yes" ]; then
- echo >&2 "${ALL} "'multi-all: $(PICDIR)'
-fi
-echo >&2 '.PHONY: all'
-echo >&2 ''
-
-echo >&2 '.PHONY: multi-all'
-echo >&2 'multi-all:'
-echo >&2 ' @$(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=all'
-echo >&2 ''
-
-echo >&2
-if [ "${SUBDIRS}" != "" ] ; then
- echo >&2 '.PHONY: subdir_do'
- echo >&2 'subdir_do: force'
- echo >&2 ' @rootme=`pwd`/; export rootme; \'
- echo >&2 ' for i in $(DODIRS); do \'
- echo >&2 ' if [ -f ./$$i/Makefile ] ; then \'
- echo >&2 ' echo "cd $$i; make $(DO) ..." ; \'
- echo >&2 ' (cd $$i ; $(MAKE) $(FLAGS_TO_PASS) $(DO)) || exit 1 ; \'
- echo >&2 ' else true ; fi ; \'
- echo >&2 ' done'
- echo >&2 ''
- echo >&2 '# List of variables to pass to sub-makes. This should not be needed'
- echo >&2 '# by GNU make or Sun make (both of which pass command-line variable'
- echo >&2 '# overrides thouh $(MAKE)) but may be needed by older versions.'
- echo >&2 ''
- echo >&2 'FLAGS_TO_PASS= \'
- echo >&2 ' "SHELL=$(SHELL)" \'
- echo >&2 ' "INSTALL=$(INSTALL)" \'
- echo >&2 ' "INSTALL_DATA=$(INSTALL_DATA)" \'
- echo >&2 ' "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \'
- echo >&2 ' "prefix=$(prefix)" \'
- echo >&2 ' "exec_prefix=$(exec_prefix)" \'
- echo >&2 ' "tooldir=$(tooldir)" \'
- echo >&2 ' "gxx_include_dir=$(gxx_include_dir)" \'
- echo >&2 ' "libsubdir=$(libsubdir)" \'
- echo >&2 ' "gcc_version=$(gcc_version)" \'
- echo >&2 ' "gcc_version_trigger=$(gcc_version_trigger)" \'
- echo >&2 ' "AR=$(AR)" \'
- echo >&2 ' "AR_FLAGS=$(AR_FLAGS)" \'
- echo >&2 ' "CC=$(CC)" \'
- echo >&2 ' "CXX=$(CXX)" \'
- echo >&2 ' "CFLAGS=$(CFLAGS)" \'
- echo >&2 ' "CXXFLAGS=$(CXXFLAGS)" \'
- echo >&2 ' "NM=$(NM)" \'
- echo >&2 ' "RANLIB=$(RANLIB)" \'
- echo >&2 ' "LIBCFLAGS=$(LIBCFLAGS)" \'
- echo >&2 ' "LIBCXXFLAGS=$(LIBCXXFLAGS)" \'
- echo >&2 ' "LOADLIBES=$(LOADLIBES)" \'
- echo >&2 ' "LDFLAGS=$(LDFLAGS)" \'
- echo >&2 ' "MAKEINFO=$(MAKEINFO)" \'
- echo >&2 ' "SHLIB=$(SHLIB)" \'
- echo >&2 ' "SHCURSES=$(SHCURSES)" \'
- echo >&2 ' "RUNTESTFLAGS=$(RUNTESTFLAGS)"'
-fi
-
-echo >&2 'NOSTDINC = -nostdinc++'
-if test -n "${XCXXINCLUDES}" ; then
- echo >&2 "CXXINCLUDES = ${XCXXINCLUDES} "'$(NOSTDINC)'
-elif test "${DOING_LIBGXX}" = "true" ; then
- echo >&2 'CXXINCLUDES = $(NOSTDINC) -I. -I'"${TO_TOPDIR}libio"' -I$(srcdir) -I$(srcdir)/'"${TOLIBGXX}"'$(IO_DIR) -I$(srcdir)/'"${TOLIBGXX}"'../libstdc++ -I$(srcdir)/'"${TOLIBGXX}src"' '"${host_includes}"' $(WRAP_C_INCLUDES)'
-fi
-if test -n "${XCINCLUDES}" ; then
- echo >&2 "CINCLUDES = ${XCINCLUDES}"
-elif test "${DOING_LIBGXX}" = "true" ; then
- echo >&2 'CINCLUDES ='
-fi
-
-if [ "${LIBDIR}" = "yes" ]; then
- echo >&2 'XCFLAGS = $(LIBCFLAGS)'
- echo >&2 'XCXXFLAGS = $(LIBCXXFLAGS)'
-else
- echo >&2 'XCFLAGS = $(CFLAGS)'
- echo >&2 'XCXXFLAGS = $(CXXFLAGS)'
-fi
-
-echo >&2 '.SUFFIXES: .o .C .cc .c'
-echo >&2 'COMPILE.c = $(CC) -c $(XCFLAGS) $(CINCLUDES) $(MT_CFLAGS)'
-echo >&2 '.c.o:'
-if [ "${LIBDIR}" = "yes" ]; then
-echo >&2 ' test x"$(enable_shared)" != xyes ||\'
-echo >&2 ' $(COMPILE.c) $(PICFLAG) $< -o pic/$@'
-fi
-echo >&2 ' $(COMPILE.c) $<'
-[ "${TOUCH_ON_COMPILE}" = "yes" ] && echo >&2 ' @touch stamp'
-echo >&2 'COMPILE.cc = $(CXX) -c $(XCXXFLAGS) $(CXXINCLUDES) $(MT_CFLAGS)'
-echo >&2 '.C.o:'
-if [ "${LIBDIR}" = "yes" ]; then
-echo >&2 ' test x"$(enable_shared)" != xyes ||\'
-echo >&2 ' $(COMPILE.cc) $(PICFLAG) $< -o pic/$@'
-fi
-echo >&2 ' $(COMPILE.cc) $<'
-[ "${TOUCH_ON_COMPILE}" = "yes" ] && echo >&2 ' @touch stamp'
-echo >&2 '.cc.o:'
-if [ "${LIBDIR}" = "yes" ]; then
-echo >&2 ' test x"$(enable_shared)" != xyes || \'
-echo >&2 ' $(COMPILE.cc) $(PICFLAG) $< -o pic/$@'
-fi
-echo >&2 ' $(COMPILE.cc) $<'
-[ "${TOUCH_ON_COMPILE}" = "yes" ] && echo >&2 ' @touch stamp'
-echo >&2 ''
-
-if [ -n "${TARGETLIB}" ] ; then
- echo TARGETLIB = ${TARGETLIB}
-fi
-if [ -n "${TARGETPROG}" ] ; then
- echo TARGETPROG = ${TARGETPROG}
-fi
-
-if [ "${LIBDIR}" = "yes" ]; then
- echo >&2 ''
- echo >&2 'stamp-picdir:'
- echo >&2 ' if [ x"$(enable_shared)" = xyes ] && [ ! -d pic ]; then \'
- echo >&2 ' mkdir pic; \'
- echo >&2 ' else true; fi'
- echo >&2 ' touch stamp-picdir'
-fi
-
-echo >&2 ''
-echo >&2 '.PHONY: install'
-echo >&2 'install:'
-echo >&2 '.PHONY: check'
-if [ "${CHECK}" != "check" ] ; then
- echo >&2 "check: ${ALL} ${CHECK}"
- if [ "${CHECK_SUBDIRS}" != "" ] ; then
- echo >&2 ' rootme=`pwd`/; export rootme; \'
- echo >&2 ' SAVE_LLPATH="$${SAVE_LLPATH-$$LD_LIBRARY_PATH}"; export SAVE_LLPATH; \'
- echo >&2 ' LD_LIBRARY_PATH="$${rootme}${TOLIBGXX}../libstdc++:$${rootme}${TOLIBGXX}../libg++:$$SAVE_LLPATH"; \'
- echo >&2 ' export LD_LIBRARY_PATH; \'
- echo >&2 ' $(MAKE) "DODIRS=$(CHECK_SUBDIRS)" DO=check $(FLAGS_TO_PASS) subdir_do'
- fi
-fi
-
-# Generate rules for documentation (depending on INFO_FILES and INFO_SUBDIRS).
-
-echo >&2 '.PHONY: info dvi install-info clean-info'
-
-# emit the rule for 'info'
-# (Note that the top-level ../Makefile.in greps for '^info:' when making
-# a release (in "make taz"), so don't break that!)
-if [ -z "${INFO_FILES}" ] ; then
- echo >&2 'info:'
-else
- echo >&2 info: `for file in ${INFO_FILES} ; do echo $file.info ; done`
-fi
-if [ "${INFO_SUBDIRS}" != "" ] ; then
- echo >&2 ' @rootme=`pwd`/; export rootme; \
- $(MAKE) "DODIRS='${INFO_SUBDIRS}'" DO=info $(FLAGS_TO_PASS) subdir_do'
-fi
-
-# emit the rule for 'dvi'
-if [ -z "${INFO_FILES}" ] ; then
- echo >&2 'dvi:'
-else
- echo >&2 dvi: `for file in ${INFO_FILES} ; do echo $file.dvi ; done`
-fi
-if [ "${INFO_SUBDIRS}" != "" ] ; then
- echo >&2 ' @rootme=`pwd`/; export rootme; \
- $(MAKE) "DODIRS='${INFO_SUBDIRS}'" DO=dvi $(FLAGS_TO_PASS) subdir_do'
-fi
-
-# Emit rules for each *.info and *.dvi file
-for file in ${INFO_FILES} ; do
- echo >&2 ${file}.info: '$(srcdir)'/${file}.texi
- echo >&2 ' $(MAKEINFO) -I$(srcdir) -I$(TEXIDIR) $(srcdir)/'${file}.texi -o ${file}.info
- echo >&2 ${file}.dvi: '$(srcdir)'/${file}.texi
- echo >&2 ' $(TEXI2DVI) $(srcdir)'/${file}.texi
- echo >&2 "${file}.ps: ${file}.dvi"
- echo >&2 " dvips ${file} -o"
-done
-
-# emit the rule for install-info
-echo >&2 'install-info:'
-if [ -n "${INFO_FILES}" ] ; then
- echo >&2 ' -parent=`echo $(infodir)|sed -e' "'"'s@/[^/]*$$@@'"'"'`; \'
- echo >&2 ' if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi'
- echo >&2 ' -if [ -d $(infodir) ] ; then true ; else mkdir $(infodir) ; fi'
- echo >&2 ' for i in *.info* ; do \'
- echo >&2 ' $(INSTALL_DATA) $$i $(infodir)/$$i ; \'
- echo >&2 ' done'
-fi
-if [ "${INFO_SUBDIRS}" != "" ] ; then
- echo >&2 ' @rootme=`pwd`/; export rootme; \
- $(MAKE) "DODIRS='${INFO_SUBDIRS}'" DO=install-info $(FLAGS_TO_PASS) subdir_do'
-fi
-
-# emit clean-info and clean-dvi rules
-echo >&2 '.PHONY: do-clean-info clean-info do-clean-dvi clean-dvi'
-echo >&2 do-clean-info:
-if [ -n "${INFO_FILES}" ] ; then
- echo >&2 ' rm -f *.info*'
-fi
-echo >&2 'do-clean-dvi:'
-if [ -n "${INFO_FILES}" ] ; then
- echo >&2 ' rm -f *.dvi *.aux *.cp *.cps *.fn* *.ky *.log *.pg *.toc *.tp *.vr'
-fi
-for type in info dvi ; do
- echo >&2 clean-${type}: do-clean-${type}
- if [ "${INFO_SUBDIRS}" != "" ] ; then
- echo >&2 ' @rootme=`pwd`/; export rootme; \
- $(MAKE) "DODIRS='${NFO_SUBDIRS}'" DO=clean-'${type} '$(FLAGS_TO_PASS) subdir_do'
- fi
-done
-
-echo >&2 ''
-
-echo >&2 '.PHONY: boltcc'
-echo >&2 'boltcc:'
-echo >&2 ' rootme=`pwd`/ ; export rootme ; $(MAKE) $(FLAGS_TO_PASS)'
-echo >&2 ''
-
-# Emit clean rules
-
-echo >&2 ''
-echo >&2 '# clean rules'
-
-MOSTLYCLEAN="${MOSTLYCLEAN-*.o pic stamp-picdir core ${EXTRA_MOSTLYCLEAN}} `if test -n "${TOUCH_ON_COMPILE}"; then echo stamp; else true; fi`"
-CLEAN="${CLEAN-${TARGETPROG} ${TARGETLIB}}"
-DISTCLEAN="${DISTCLEAN-config.status Makefile *~ Make.pack target-mkfrag multilib.out ${EXTRA_DISTCLEAN-}}"
-REALCLEAN="${REALCLEAN-depend *.info*}"
-
-
-echo >&2 '.PHONY: mostlyclean clean distclean maintainer-clean realclean'
-if test -z "${SUBDIRS}" ; then
- echo >&2 "mostlyclean: clean-dvi"
- echo >&2 " rm -rf ${MOSTLYCLEAN}"
- echo >&2 ' @$(MULTICLEAN) multi-clean DO=mostlyclean'
- echo >&2 "clean: clean-dvi"
- echo >&2 " rm -rf ${MOSTLYCLEAN} ${CLEAN}"
- echo >&2 ' @$(MULTICLEAN) multi-clean DO=clean'
- echo >&2 "distclean: clean"
- echo >&2 ' @$(MULTICLEAN) multi-clean DO=distclean'
- echo >&2 " rm -rf ${DISTCLEAN}"
- echo >&2 "maintainer-clean realclean: clean clean-info"
- echo >&2 ' @$(MULTICLEAN) multi-clean DO=maintainer-clean'
- echo >&2 " rm -rf ${DISTCLEAN} ${REALCLEAN}"
-else
- echo >&2 '.PHONY: do-clean subdir_distclean subdir_maintainer_clean'
- echo >&2 "mostlyclean: do-clean-dvi"
- echo >&2 " rm -rf ${MOSTLYCLEAN}"
- echo >&2 ' @$(MAKE) $(FLAGS_TO_PASS) "DODIRS=$(SUBDIRS)" DO=mostlyclean subdir_do'
- echo >&2 ' @$(MULTICLEAN) multi-clean DO=mostlyclean'
- echo >&2 "do-clean: do-clean-dvi"
- echo >&2 " rm -rf ${MOSTLYCLEAN} ${CLEAN}"
- echo >&2 "clean: do-clean"
- echo >&2 ' @$(MAKE) $(FLAGS_TO_PASS) "DODIRS=$(SUBDIRS)" DO=clean subdir_do'
- echo >&2 ' @$(MULTICLEAN) multi-clean DO=clean'
- # distclean and maintainer-clean are tricky because they remove the Makefile.
- echo >&2 "subdir_distclean:"
- echo >&2 ' @$(MAKE) $(FLAGS_TO_PASS) "DODIRS=$(SUBDIRS)" DO=distclean subdir_do'
- echo >&2 "distclean: do-clean subdir_distclean"
- echo >&2 ' @$(MULTICLEAN) multi-clean DO=distclean'
- echo >&2 " rm -rf ${DISTCLEAN}"
- echo >&2 "subdir_maintainer_clean:"
- echo >&2 ' @$(MAKE) $(FLAGS_TO_PASS) "DODIRS=$(SUBDIRS)" DO=maintainer-clean subdir_do'
- echo >&2 "maintainer-clean realclean: do-clean subdir_maintainer_clean do-clean-info"
- echo >&2 ' @$(MULTICLEAN) multi-clean DO=maintainer-clean'
- echo >&2 " rm -rf ${DISTCLEAN} ${REALCLEAN}"
-fi
-
-echo >&2 ''
-echo >&2 '.PHONY: force'
-echo >&2 'force:'
-echo >&2 ''
-echo >&2 '# with the gnu make, this is done automatically.'
-echo >&2 ''
-echo >&2 'Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag) $(gcc_version_trigger)'
-echo >&2 ' $(SHELL) ./config.status'
-echo >&2 ''
-echo >&2 '.NOEXPORT:'
-echo >&2 'MAKEOVERRIDES='
-
-cat >&2 <<"EOF"
-DEPEND_SOURCES = ${srcdir}/*.cc ${srcdir}/*.c
-depend.new:
-# The sed script below attempts to make the depend output portable.
-# It cleans up the depenency information generated by cpp.
-# It replaces instances of $(srcdir)/ by the string '$(srcdir)/'.
-# It removes remaining absolute files names (such as /usr/include/stdio.h).
-# It removes lines containing only "\\".
-# It inserts '$(MULTISRCTOP)' in '$(srcdir)/..'.
-# In order to support SunOS VPATH, $(srcdir)/[a-z]*.{c,cc} is replaced with
-# [a-z]*.{c,cc} (the directory part is removed).
-# The awk script removes a continuation marker that is followed by
-# a blank line, since that may confuse make.
- echo "# AUTOMATICALLY GENERATED BY 'make depend' - DO NOT EDIT" \
- >depend.new
- $(CXX) -M $(CXXINCLUDES) $(DEPEND_SOURCES) \
- | sed -e 's|$(srcdir)/|$$(srcdir)/|g' \
- -e 's| [^ ]*_G_config.h| $$(_G_CONFIG_H)|g' \
- -e 's| /[^ ]*||g' -e 's| libc-lock\.h||' \
- -e '/^[ ]*\\$$/d' -e 's/^[ ]*$$//' \
- | sed -e 's|$$(srcdir)/[.][.]|$$(srcdir)/$$(MULTISRCTOP)..|g' \
- -e 's|$$(srcdir)/\([^/]*[.]c\)|\1|' \
- | awk 'BEGIN { prev = "" } \
- /^( )*$$/ { if (prev ~ /\\$$/) \
- { prev = substr(prev,1,length(prev)-1); next } } \
- { print prev; prev = $$0 } \
- END { if (prev !~ /^( )*$$/) print prev }' \
- >> depend.new
-$(srcdir)/depend: depend.new
- mv depend.new $(srcdir)/depend
-EOF
-
-if [ -f ${srcdir}/${subdir}/depend ] ; then
- cat ${srcdir}/${subdir}/depend >&2
-fi
-
-echo "# End of package fragment generated by ${THIS_FILE}."
-echo >&2 "# End of package rules fragment generated by ${THIS_FILE}."
diff --git a/contrib/libio/config/hpux.mt b/contrib/libio/config/hpux.mt
deleted file mode 100644
index fc95afa64fa9..000000000000
--- a/contrib/libio/config/hpux.mt
+++ /dev/null
@@ -1,3 +0,0 @@
-# Flags to pass to gen-params when building _G_config.h.
-# For example: G_CONFIG_ARGS = size_t="unsigned long"
-G_CONFIG_ARGS = DOLLAR_IN_LABEL=1
diff --git a/contrib/libio/config/isc.mt b/contrib/libio/config/isc.mt
deleted file mode 100644
index 15cbb8c36c2e..000000000000
--- a/contrib/libio/config/isc.mt
+++ /dev/null
@@ -1,4 +0,0 @@
-# Flags to pass to gen-params when building _G_config.h.
-# For example: G_CONFIG_ARGS = size_t="unsigned long"
-G_CONFIG_ARGS = pid_t="unsigned short" \
- gid_t="unsigned short" uid_t="unsigned short"
diff --git a/contrib/libio/config/linux.mt b/contrib/libio/config/linux.mt
deleted file mode 100644
index 9e3c519ed13b..000000000000
--- a/contrib/libio/config/linux.mt
+++ /dev/null
@@ -1,25 +0,0 @@
-# Use the libio which comes with the local libc.
-
-# Comment this out to avoid including the stdio functions in libiostream.a:
-# LIBIOSTREAM_OBJECTS = $(IO_OBJECTS) $(IOSTREAM_OBJECTS) $(STDIO_WRAP_OBJECTS) $(OSPRIM_OBJECTS)
-# LIBIOSTREAM_DEP = $(LIBIOSTREAM_OBJECTS) stdio.list
-# LIBIOSTREAM_USE = $(LIBIOSTREAM_OBJECTS) `cat stdio.list`
-
-# Comment the above and uncomment the below to use the code in the Linux libc:
-# We have _G_config.h in /usr/include.
-_G_CONFIG_H=
-
-# We must not see the libio.h file from this library.
-LIBIO_INCLUDE=
-
-# We have those in libc.a.
-IO_OBJECTS= iogetline.o
-STDIO_WRAP_OBJECTS=
-OSPRIM_OBJECTS=
-STDIO_OBJECTS=
-
-# We have the rest in /usr/include.
-USER_INCLUDES=PlotFile.h SFile.h builtinbuf.h editbuf.h fstream.h \
- indstream.h iomanip.h iostream.h istream.h ostream.h \
- parsestream.h pfstream.h procbuf.h stdiostream.h stream.h \
- streambuf.h strfile.h strstream.h
diff --git a/contrib/libio/config/linuxaxp1-libc-lock.h b/contrib/libio/config/linuxaxp1-libc-lock.h
deleted file mode 100644
index 2523a0d5157b..000000000000
--- a/contrib/libio/config/linuxaxp1-libc-lock.h
+++ /dev/null
@@ -1,112 +0,0 @@
-/* libc-internal interface for mutex locks. LinuxThreads version.
- Copyright (C) 1996 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- 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 _LIBC_LOCK_H
-#define _LIBC_LOCK_H 1
-
-#include <pthread.h>
-#define __libc_lock_t pthread_mutex_t
-
-/* Define a lock variable NAME with storage class CLASS. The lock must be
- initialized with __libc_lock_init before it can be used (or define it
- with __libc_lock_define_initialized, below). Use `extern' for CLASS to
- declare a lock defined in another module. In public structure
- definitions you must use a pointer to the lock structure (i.e., NAME
- begins with a `*'), because its storage size will not be known outside
- of libc. */
-#define __libc_lock_define(CLASS,NAME) \
- CLASS __libc_lock_t NAME;
-
-/* Define an initialized lock variable NAME with storage class CLASS. */
-#define __libc_lock_define_initialized(CLASS,NAME) \
- CLASS __libc_lock_t NAME = PTHREAD_MUTEX_INITIALIZER;
-
-/* Initialize the named lock variable, leaving it in a consistent, unlocked
- state. */
-#define __libc_lock_init(NAME) \
- (__pthread_mutex_init != NULL ? __pthread_mutex_init (&(NAME), NULL) : 0);
-
-/* Same as last but this time we initialize a recursive mutex. */
-#define __libc_lock_init_recursive(NAME) \
- do { \
- if (__pthread_mutex_init != NULL) \
- { \
- pthread_mutexattr_t __attr; \
- __pthread_mutexattr_init (&__attr); \
- __pthread_mutexattr_setkind_np (&__attr, PTHREAD_MUTEX_RECURSIVE_NP); \
- __pthread_mutex_init (&(NAME), &__attr); \
- __pthread_mutexattr_destroy (&__attr); \
- } \
- } while (0);
-
-/* Finalize the named lock variable, which must be locked. It cannot be
- used again until __libc_lock_init is called again on it. This must be
- called on a lock variable before the containing storage is reused. */
-#define __libc_lock_fini(NAME) \
- (__pthread_mutex_destroy != NULL ? __pthread_mutex_destroy (&(NAME)) : 0);
-
-/* Lock the named lock variable. */
-#define __libc_lock_lock(NAME) \
- (__pthread_mutex_lock != NULL ? __pthread_mutex_lock (&(NAME)) : 0);
-
-/* Try to lock the named lock variable. */
-#define __libc_lock_trylock(NAME) \
- (__pthread_mutex_trylock != NULL ? __pthread_mutex_trylock (&(NAME)) : 0);
-
-/* Unlock the named lock variable. */
-#define __libc_lock_unlock(NAME) \
- (__pthread_mutex_unlock != NULL ? __pthread_mutex_unlock (&(NAME)) : 0);
-
-/* Start critical region with cleanup. */
-#define __libc_cleanup_region_start(FCT, ARG) \
- { struct _pthread_cleanup_buffer _buffer; \
- if (_pthread_cleanup_push_defer != NULL) { \
- _pthread_cleanup_push_defer (&_buffer, (FCT), (ARG)); \
- }
-
-/* End critical region with cleanup. */
-#define __libc_cleanup_region_end(DOIT) \
- if (_pthread_cleanup_push_defer != NULL) { \
- _pthread_cleanup_pop_restore (&_buffer, (DOIT)); \
- } \
- }
-
-/* Make the pthread functions weak so that we can elide them from
- single-threaded processes. */
-#pragma weak __pthread_mutex_init
-#pragma weak __pthread_mutex_destroy
-#pragma weak __pthread_mutex_lock
-#pragma weak __pthread_mutex_trylock
-#pragma weak __pthread_mutex_unlock
-#pragma weak __pthread_mutexattr_init
-#pragma weak __pthread_mutexattr_destroy
-#pragma weak __pthread_mutexattr_setkind_np
-#pragma weak __pthread_key_create
-#pragma weak __pthread_setspecific
-#pragma weak __pthread_getspecific
-#pragma weak __pthread_initialize
-#pragma weak _pthread_cleanup_push_defer
-#pragma weak _pthread_cleanup_pop_restore
-
-/* We need portable names for some functions. E.g., when they are
- used as argument to __libc_cleanup_region_start. */
-#define __libc_mutex_unlock __pthread_mutex_unlock
-
-#endif /* libc-lock.h */
-
diff --git a/contrib/libio/config/linuxaxp1-stdio-lock.h b/contrib/libio/config/linuxaxp1-stdio-lock.h
deleted file mode 100644
index cbee76867d12..000000000000
--- a/contrib/libio/config/linuxaxp1-stdio-lock.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/* 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. */
-
-#include <pthread.h>
-
-typedef pthread_mutex_t _IO_lock_t;
-
-/* We need recursive (counting) mutexes. */
-#define _IO_lock_initializer PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
-
-
-#define _IO_cleanup_region_start(_fct, _fp) \
- __libc_cleanup_region_start (_fct, _fp)
-#define _IO_cleanup_region_end(_doit) \
- __libc_cleanup_region_end (_doit)
-#define _IO_lock_init(_name) \
- __libc_lock_init_recursive (_name)
-#define _IO_lock_fini(_name) \
- __libc_lock_fini_recursive (_name)
-
diff --git a/contrib/libio/config/linuxaxp1.mt b/contrib/libio/config/linuxaxp1.mt
deleted file mode 100644
index d9b7e8c7e956..000000000000
--- a/contrib/libio/config/linuxaxp1.mt
+++ /dev/null
@@ -1,10 +0,0 @@
-# We _do_ need a new _G_config.h
-_G_CONFIG_H=_G_config.h
-
-# And the two bits files.
-all:
-install: install-axp-mt-headers
-
-install-axp-mt-headers:
- $(INSTALL_DATA) libc-lock.h $(gxx_include_dir)/libc-lock.h
- $(INSTALL_DATA) stdio-lock.h $(gxx_include_dir)/stdio-lock.h
diff --git a/contrib/libio/config/linuxlibc1.mt b/contrib/libio/config/linuxlibc1.mt
deleted file mode 100644
index 742cbf185342..000000000000
--- a/contrib/libio/config/linuxlibc1.mt
+++ /dev/null
@@ -1,26 +0,0 @@
-# Use the libio which comes with the local libc.
-
-# Comment this out to avoid including the stdio functions in libiostream.a:
-# LIBIOSTREAM_OBJECTS = $(IO_OBJECTS) $(IOSTREAM_OBJECTS) $(STDIO_WRAP_OBJECTS) $(OSPRIM_OBJECTS)
-# LIBIOSTREAM_DEP = $(LIBIOSTREAM_OBJECTS) stdio.list
-# LIBIOSTREAM_USE = $(LIBIOSTREAM_OBJECTS) `cat stdio.list`
-
-# We must not see the libio.h file from this library.
-LIBIO_INCLUDE=
-
-# We have those in libc.a.
-IO_OBJECTS=iogetc.o ioputc.o iofeof.o ioferror.o \
- filedoalloc.o fileops.o genops.o iofclose.o \
- iovsprintf.o iovsscanf.o strops.o iogetline.o
-STDIO_WRAP_OBJECTS=
-OSPRIM_OBJECTS=
-STDIO_OBJECTS=
-
-# We have the rest in /usr/include.
-USER_INCLUDES=PlotFile.h SFile.h builtinbuf.h editbuf.h fstream.h \
- indstream.h iomanip.h iostream.h istream.h ostream.h \
- parsestream.h pfstream.h procbuf.h stdiostream.h stream.h \
- streambuf.h strfile.h strstream.h libio.h
-
-# A bad kludge
-MT_CFLAGS=-D_G_HAVE_MMAP -D_G_STDIO_USES_LIBIO -D_G_HAVE_WEAK_SYMBOL
diff --git a/contrib/libio/config/mn10200.mt b/contrib/libio/config/mn10200.mt
deleted file mode 100644
index 71e79167658b..000000000000
--- a/contrib/libio/config/mn10200.mt
+++ /dev/null
@@ -1,3 +0,0 @@
-# Flags to pass to gen-params when building _G_config.h.
-# For example: G_CONFIG_ARGS = size_t="unsigned long"
-G_CONFIG_ARGS = NO_USE_DTOA=1 USE_INT32_FLAGS=1
diff --git a/contrib/libio/config/mtsafe.mt b/contrib/libio/config/mtsafe.mt
deleted file mode 100644
index 5848851be8ac..000000000000
--- a/contrib/libio/config/mtsafe.mt
+++ /dev/null
@@ -1,2 +0,0 @@
-# tell we want the mt-safe version
-MT_CFLAGS = -D_IO_MTSAFE_IO
diff --git a/contrib/libio/config/netware.mt b/contrib/libio/config/netware.mt
deleted file mode 100644
index 339a865717c0..000000000000
--- a/contrib/libio/config/netware.mt
+++ /dev/null
@@ -1,16 +0,0 @@
-IMPDIR= $(srcdir)/config/netware
-
-PRELUDE= prelude.o
-
-iostream.def: Makefile
- -rm -f iostream.def
- echo "description \"libiostream\"" >> iostream.def
- echo "screenname \"NONE\"" >> iostream.def
- echo "version `echo $(VERSION) | sed 's|\.|,|g'`" >> iostream.def
- echo "export @$(IMPDIR)/iostream.imp" >> iostream.def
-
-iostream.O: $(PRELUDE) $(LIBIOSTREAM_OBJECTS)
- $(CC) -Xlinker -Ur -o $@ $(PRELUDE) $(LIBIOSTREAM_OBJECTS)
-
-iostream.nlm: iostream.def iostream.O $(IMPDIR)/iostream.imp
- $(NLMCONV) -l $(LD) -T iostream.def iostream.O iostream.nlm
diff --git a/contrib/libio/configure.in b/contrib/libio/configure.in
deleted file mode 100644
index ac494296fe2f..000000000000
--- a/contrib/libio/configure.in
+++ /dev/null
@@ -1,199 +0,0 @@
-# This file is a shell script fragment that supplies the information
-# necessary for a configure script to process the program in
-# this directory. For more information, look at ../configure.
-
-# If the language specific compiler does not exist, but the "gcc" directory
-# does, we do not build anything. Note, $r is set by the top-level Makefile.
-# Note that when we look for the compiler, we search both with and without
-# extension to handle cross and canadian cross builds.
-# Note that if $norecursion is set we're being called from config.status,
-# so don't check for the compiler; we might be doing a make clean.
-compiler_name=cc1plus
-rm -f skip-this-dir
-if test -n "$r" && [ -z "$norecursion" ] ; then
- if test -d "$r"/gcc; then
- if test -f "$r"/gcc/$compiler_name \
- || test -f "$r"/gcc/$compiler_name.exe; then
- true
- else
- echo "rm -f multilib.out" > skip-this-dir
- fi
- fi
-fi
-
-if [ "${srcdir}" = "." ] ; then
- if [ "${with_target_subdir}" != "." ] ; then
- topsrcdir=${with_multisrctop}../..
- else
- topsrcdir=${with_multisrctop}..
- fi
-else
- topsrcdir=${srcdir}/..
-fi
-
-if [ -d ${topsrcdir}/gcc ] ; then
- configdirs="tests dbz stdio testsuite"
-else
- configdirs="tests dbz stdio"
-fi
-srctrigger=libioP.h
-srcname="input/output library"
-package_makefile_frag=Make.pack
-package_makefile_rules_frag=Make.pack.r
-
-# per-host:
-
-# per-target:
-
-echo "# Warning: this fragment is automatically generated" > temp.mt
-frags=
-
-case "${target}" in
- *-hpux*) frags=hpux.mt ;;
- alpha*-*-linux-gnulibc1)
- frags="linux.mt linuxaxp1.mt mtsafe.mt" ;;
- powerpc*-*-linux-gnulibc1)
- frags="linux.mt linuxaxp1.mt mtsafe.mt" ;;
- *-linux-gnulibc1)
- frags=linuxlibc1.mt ;;
- *-linux-gnu) frags="linux.mt mtsafe.mt" ;;
- *-sco3.2v[45]*) frags=sco4.mt ;;
- *-isc*) frags=isc.mt ;;
- *-netware*) frags=netware.mt ;;
- *) frags=${target_cpu}.mt ;;
-esac
-
-case "${enable_shared}" in
- yes) shared=yes ;;
- no) shared=no ;;
- *libio*) shared=yes ;;
- *) shared=no ;;
-esac
-
-if [ "${shared}" = "yes" ]; then
- case "${target}" in
- alpha*-*-linux*) frags="${frags} ../../config/mh-elfalphapic" ;;
- arm*-*-*) frags="${frags} ../../config/mh-armpic" ;;
- hppa*-*-*) frags="${frags} ../../config/mh-papic" ;;
- i[3456]86-*-*) frags="${frags} ../../config/mh-x86pic" ;;
- powerpc*-*-aix*) ;;
- powerpc*-*-*) frags="${frags} ../../config/mh-ppcpic" ;;
- *-*-*) frags="${frags} ../../config/mh-${target_cpu}pic" ;;
- esac
-fi
-
-# Take care of header file lossage.
-case "${target}" in
- alpha*-*-linux-gnulibc1)
- # For some reason stdio-lock.h is not installed on Red Hat systems.
- # Further, libc-lock.h needs to define the pthreads stuff weak, and
- # fails to do this for other than _LIBC. Install our own versions
- # of these files.
- cp ${srcdir}/config/linuxaxp1-libc-lock.h libc-lock.h
- cp ${srcdir}/config/linuxaxp1-stdio-lock.h stdio-lock.h
- ;;
- powerpc*-*-linux-gnulibc1)
- # For some reason stdio-lock.h is not installed on Red Hat systems.
- # Further, libc-lock.h needs to define the pthreads stuff weak, and
- # fails to do this for other than _LIBC. Install our own versions
- # of these files.
- cp ${srcdir}/config/linuxaxp1-libc-lock.h libc-lock.h
- cp ${srcdir}/config/linuxaxp1-stdio-lock.h stdio-lock.h
- ;;
- *-linux-gnu)
- # We have a correct libc-lock.h in glibc 2.1 but not all glibc 2.0.
- # Create a wrapper if necessary.
- (echo "#include <bits/libc-lock.h>" | ${CC-cc} -E -) >/dev/null 2>&1 ||
- {
- echo "#include_next <libc-lock.h>" > libc-lock.h
- echo 'asm (".weak _pthread_cleanup_pop_restore");' >> libc-lock.h
- echo 'asm (".weak _pthread_cleanup_push_defer");' >> libc-lock.h
-
- }
- ;;
-esac
-
-for frag in ${frags}; do
- case ${frag} in
- ../* )
- if [ ${srcdir} = . ]; then
- [ -n "${with_target_subdir}" ] && frag=../${frag}
- [ -n "${with_multisrctop}" ] && frag=${with_multisrctop}${frag}
- fi
- ;;
- esac
- frag=${srcdir}/config/$frag
- if [ -f ${frag} ]; then
- echo "Appending ${frag} to target-mkfrag"
- echo "# Following fragment copied from ${frag}" >> temp.mt
- cat ${frag} >> temp.mt
- fi
-done
-
-target_makefile_frag=target-mkfrag
-${moveifchange} temp.mt target-mkfrag
-
-LIBDIR=yes
-TO_TOPDIR=../
-ALL='$(_G_CONFIG_H) libio.a libiostream.a iostream.list'
-case "${target}" in
- *-*-cygwin*)
- XCINCLUDES='-I. -I$(srcdir) -I$(srcdir)/../winsup/include'
- XCXXINCLUDES='-I. -I$(srcdir) -I$(srcdir)/../winsup/include'
- ;;
- *)
- XCINCLUDES='-I. -I$(srcdir)'
- XCXXINCLUDES='-I. -I$(srcdir)'
- ;;
-esac
-MOSTLYCLEAN='*.o pic stamp-picdir core iostream.list'
-DISTCLEAN='config.status Makefile *~ Make.pack target-mkfrag multilib.out'
-CLEAN='_G_config.h *.a'
-INFO_FILES=iostream
-if [ -n "${with_cross_host}" -a -d ${topsrcdir}/gcc ]; then
- CHECK_SUBDIRS=testsuite
-fi
-(. ${srcdir}/config.shared) >${package_makefile_frag} 2>${package_makefile_rules_frag}
-
-# post-target:
-
-# If cross-compiling, we install in $(tooldir)/lib or in $(libsubdir)
-# depending on --enable-version-specific-runtime-libs.
-if [ -n "${with_cross_host}" ] ; then
- rm -f Makefile.tem
- sed \
- -e 's|\(^[ ]*INSTALLDIR[ ]*=[ ]*\)\$(libdir)|\1$(tooldir)/lib|' \
- Makefile >Makefile.tem
- mv -f Makefile.tem Makefile
-fi
-
-. ${topsrcdir}/config-ml.in
-
-gxx_include_dir=
-# Specify the g++ header file directory
-# Check whether --with-gxx-include-dir or --without-gxx-include-dir was given.
-if test "${with_gxx_include_dir+set}" = set; then
- withval="$with_gxx_include_dir"
- case "${withval}" in
- yes)
- echo "configure.in: error: bad value ${withval} given for g++ include directory" 1>&2
- exit 1
- ;;
- no) ;;
- *) gxx_include_dir=$with_gxx_include_dir ;;
- esac
-fi
-
-if test x${gxx_include_dir} = x; then
- if test x${enable_version_specific_runtime_libs} = xyes; then
- gxx_include_dir='${libsubdir}/include/g++'
- else
- . ${topsrcdir}/config.if
- gxx_include_dir='${prefix}/include/g++'-${libstdcxx_interface}
- fi
-fi
-
-rm -f Makefile.tem
-sed -e "s%^gxx_include_dir[ ]*=.*$%gxx_include_dir=${gxx_include_dir}%" \
- Makefile >Makefile.tem
-mv -f Makefile.tem Makefile
diff --git a/contrib/libio/dbz/Makefile.in b/contrib/libio/dbz/Makefile.in
deleted file mode 100644
index 0fd956414148..000000000000
--- a/contrib/libio/dbz/Makefile.in
+++ /dev/null
@@ -1,218 +0,0 @@
-srcdir = .
-CFLAGS = -g
-C_FLAGS = $(CFLAGS) -I$(srcdir) -I.. -I$(srcdir)/.. -DDBZ_FINISH='_IO_flush_all()'
-CC = `if [ -f ../../../gcc/gcc ] ; \
- then echo ../../../gcc/gcc -B../../../gcc/ ; \
- else echo gcc ; fi`
-LIBIO = ../libio.a ../../libiberty/libiberty.a
-LIBS = $(LIBIO)
-# LIBS = ../libcnews.a
-DBM =
-RFC = -DHAVERFCIZE
-CASE = case.o
-DEBUG = -DDBZDEBUG
-LINTFLAGS = -h $(DEBUG) $(RFC) -I$(srcdir)
-LDFLAGS =
-# =()<NEWSBIN = @<NEWSBIN>@>()=
-NEWSBIN = /usr/lib/newsbin
-# workaround for System V make bug
-SHELL = /bin/sh
-
-# database sizes for performance tests, regression, and regression prime-find
-TSIZE=12007
-RSIZE=4019
-RPSIZE=2679
-
-#### host and target dependent Makefile fragments come in here.
-##
-
-# history files for regression and performance tests
-RHIST=hist3.3
-R2HIST=hist10
-THIST=hist13
-
-#all: dbz
-all:
-install:
-install-info:
-info:
-
-check: r
- $(MAKE) rclean
-
-bininstall: dbz
- cp dbz $(NEWSBIN)
-
-cmp: dbz
- cmp dbz $(NEWSBIN)/dbz
-
-newsinstall:
- : nothing
-
-u: dbz.o
- ar ruv ../libcnews.a dbz.o
- cmp dbz.h ../h/dbz.h
-
-t: tdbz fake
-
-lint:
- lint $(LINTFLAGS) dbzmain.c dbz.c
-
-.c.o:
- $(CC) $(C_FLAGS) -c $<
-
-rdbz.o: rdbz.c
- $(CC) $(C_FLAGS) $(DEBUG) -DDEFSIZE=$(RSIZE) -c rdbz.c
-
-rdbzmain.o: rdbzmain.c
- $(CC) $(C_FLAGS) $(RFC) -c rdbzmain.c
-
-tdbz.o: $(srcdir)/dbz.c
- cp $(srcdir)/dbz.c tdbz.c
- $(CC) $(C_FLAGS) -DDEFSIZE=$(TSIZE) -c tdbz.c
- rm tdbz.c
-
-dbz: dbzmain.o $(CASE)
- $(CC) $(LDFLAGS) dbzmain.o $(CASE) $(PRE) $(DBM) $(LIBS) $(POST) -o $@
-
-tdbz: dbzmain.o tdbz.o $(CASE)
- $(CC) $(LDFLAGS) dbzmain.o tdbz.o $(CASE) $(PRE) $(LIBS) $(POST) -o $@
-
-rdbz: rdbzmain.o rdbz.o $(CASE)
- $(CC) $(LDFLAGS) rdbzmain.o rdbz.o $(CASE) $(PRE) $(LIBS) $(POST) -o $@
-
-fake: fake.o random.o
- $(CC) $(LDFLAGS) fake.o random.o $(PRE) $(LIBS) $(POST) -o $@
-
-byteflip: byteflip.o
- $(CC) $(LDFLAGS) byteflip.o $(PRE) $(LIBS) $(POST) -o $@
-
-hist10: fake
- ./fake -t -e 75 10000 >$@
-
-hist3.3: fake
- ./fake -t -e 75 3300 >$@
-
-hist13: fake
- ./fake -t -e 75 13000 >$@
-
-r: $(srcdir)/getmap $(srcdir)/revbytes $(srcdir)/altbytes stamp-r8
- : success!
-
-stamp-r0:
- : 'WARNING: creates about 2MB of debris; do "make rclean" afterward'
- rm -f dbase dbase[23] dbase.* dbase[23].*
- test ! -d xx || rmdir xx
- @touch stamp-r0
-
-stamp-r1: $(RHIST) $(R2HIST) stamp-r0
- : crude check of synthetic history file
- ( sed 25q $(RHIST) ; tail -25 $(RHIST) ) >histjunk
- cmp histjunk $(srcdir)/firstlast25
- rm histjunk
- @touch stamp-r1
-
-r2a: rdbz stamp-r1
- : basic tests, exercising as many options as possible
- cp $(RHIST) dbase
- mkdir xx
- chmod -w xx
- ./rdbz -E 1000 -0 -M -i -S -u -U -C xx dbase
- rmdir xx
- sed '/> 0/d' $(RHIST) >dbase.used
- test "`cat dbase.used | wc -l`" -eq "`sed -n '2s/ .*//p' dbase.dir`" ;
-
-stamp-r2: r2a
- cp $(RHIST) dbase2
- ./rdbz -E 1000 -0 -p $(RPSIZE) -t ' ' dbase2
- cmp $(RHIST) dbase
- cmp dbase dbase2
- cmp dbase.dir dbase2.dir
- cmp dbase.pag dbase2.pag
- ./rdbz -E 1000 -0 -c dbase
- ./rdbz -E 1000 -0 -c -i -q -M -U dbase
- @touch stamp-r2
-
-stamp-r3: stamp-r2
- : build a database and then add to it
- sed 1000q $(RHIST) >dbase2
- sed 1,1000d $(RHIST) >dbase2.add
- ./rdbz -E 1000 -0 dbase2
- ./rdbz -E 1000 -0 -a dbase2 dbase2.add
- cmp dbase dbase2
- cmp dbase.dir dbase2.dir
- cmp dbase.pag dbase2.pag
- @touch stamp-r3
-
-stamp-r4: stamp-r3
- : build based on existing one, test extraction and readonly files
- ./rdbz -E 1000 -0 -f dbase dbase2
- test "`cat dbase.used | wc -l`" -eq "`awk 'NR==2{print $$1}' dbase2.dir`" ;
- test "`cat dbase.used | wc -l`" -eq "`awk 'NR==2{print $$2}' dbase2.dir`" ;
- chmod -w dbase2.dir dbase2.pag
- ./rdbz -E 1000 -x dbase2 dbase >dbase.temp
- cmp dbase.used dbase.temp
- @touch stamp-r4
-
-stamp-r5: stamp-r4
- : try some small case perversions
- sed 's/\(@[^ ]*\)A/\1a/' dbase >dbase.ick
- ./rdbz -E 1000 -x dbase2 dbase.ick >dbase.temp
- cmp dbase.used dbase.temp
- sed -n 's/A\([^ ]*@\)/a\1/p' dbase >dbase.ick
- ./rdbz -x dbase2 dbase.ick >dbase.temp
- test ! -s dbase.temp ;
- rm -f dbase2.dir dbase2.pag
- @touch stamp-r5
-
-stamp-r6: stamp-r5
- : try it without tags, case-insensitive, with case perversions
- ./rdbz -E 1000 -0 -p '0 b 1' dbase2
- tr 'ABCDEFGHIJKLMnopqrstuvwxyz' 'abcdefghijklmNOPQRSTUVWXYZ' <dbase2 >dbase.ick
- ./rdbz -E 1000 -x dbase2 dbase.ick >dbase.temp
- cmp dbase.used dbase.temp
- rm -f dbase.temp dbase.ick
- @touch stamp-r6
-
-stamp-r7: byteflip stamp-r6
- : test various perversions of byte ordering
- awk -f $(srcdir)/revbytes dbase.dir >dbase2.dir
- ./byteflip `$(srcdir)/getmap dbase.dir` `$(srcdir)/getmap dbase2.dir` <dbase.pag >dbase2.pag
- cp dbase dbase2
- ./rdbz -E 1000 -0 -c dbase2
- awk -f $(srcdir)/altbytes dbase.dir >dbase2.dir
- dd conv=swab <dbase.pag >dbase2.pag
- ./rdbz -E 1000 -0 -c dbase2
- cp dbase2 dbase3
- ./rdbz -E 1000 -0 -f dbase2 dbase3
- ./rdbz -E 1000 -0 -c dbase3
- test " `$(srcdir)/getmap dbase2.dir`" = " `$(srcdir)/getmap dbase3.dir`" ;
- @touch stamp-r7
-
-stamp-r8: stamp-r7
- : test massive overflow, throw in case sensitivity and tag mask
- cp $(R2HIST) dbase
- ./rdbz -E 1000 -0 -p '0 0 7ffc0000' dbase
- ./rdbz -E 1000 -0 -cq dbase
- sed 100q dbase | egrep '[aA].* ' | tr aA Aa >dbase.ick
- ./rdbz -x dbase dbase.ick >dbase.temp
- test ! -s dbase.temp ;
- @touch stamp-r8
-
-rclean:
- rm -f dbase dbase[23] dbase.* dbase[23].* fake fake.o random.o
- rm -f rdbz rdbz.o rdbzmain.o $(RHIST) $(R2HIST) byteflip byteflip.o
- rm -f histjunk core stamp-r? *~
- test ! -d xx || rmdir xx
-
-mostlyclean: rclean
- rm -f *.o [a-z]dbz [a-z][a-z]dbz junk* PostScript.out
- rm -f hist* dbase* *.bak mon.out gmon.out core dbm.h
-
-clean: mostlyclean
- rm -f dbz
-
-distclean: clean
- rm -rf Makefile config.status rdbz.c rdbzmain.c
-
-maintainer-clean realclean: distclean
diff --git a/contrib/libio/dbz/README b/contrib/libio/dbz/README
deleted file mode 100644
index e7fa8765ad5c..000000000000
--- a/contrib/libio/dbz/README
+++ /dev/null
@@ -1,25 +0,0 @@
-The dbz package was "liberated" from C News.
-It is included with the GNU libio because it provides
-a fairly good work-out for a stdio implementation.
-The Makefile.in, configure.in, and stdio.h have been
-set up to test libio.
-
-------
-
-This is the new, improved, lemon-freshened :-) dbz.
-
-Just "make" will get you dbz.o and the dbz program. "make r" runs an
-extensive set of regression tests; most of the mysterious oddments lying
-around here are to do with that. "make rclean" cleans up after "make r".
-
-You probably want to inspect the #ifdef list early in dbz.c before
-compiling, although the defaults should work all right on most systems.
-
-If you are not building this as part of C News, you will need to change
-the -I option in FLAGS in the Makefile to "-I.", and delete the DBMLIBS
-and RFC lines entirely. That will break some of the regression tests;
-at some point I'll fix this.
-
-If you are using this independently from C News, you probably still want
-to look through ../notebook/problems, as some of the portability problems
-described in there can affect dbz.
diff --git a/contrib/libio/dbz/altbytes b/contrib/libio/dbz/altbytes
deleted file mode 100644
index 26cc9fb9e023..000000000000
--- a/contrib/libio/dbz/altbytes
+++ /dev/null
@@ -1,7 +0,0 @@
-NR == 1 {
- printf "%s %s %s %s %s %s %s %s %s", $1, $2, $3, $4, $5, $6, $7, $8, $9
- for (i = 10; i <= NF; i += 2)
- printf " %s %s", $(i+1), $i
- printf "\n"
-}
-NR > 1 { print }
diff --git a/contrib/libio/dbz/byteflip.c b/contrib/libio/dbz/byteflip.c
deleted file mode 100644
index d54c6591fa18..000000000000
--- a/contrib/libio/dbz/byteflip.c
+++ /dev/null
@@ -1,38 +0,0 @@
-#include <stdio.h>
-
-#define MAXWORD 32
-
-int
-main(argc, argv)
-int argc;
-char *argv[];
-{
- register int len;
- int inmap[MAXWORD];
- int outmap[MAXWORD];
- char in[MAXWORD];
- char out[MAXWORD];
- register int i;
- register int a;
-
- a = 1;
- len = atoi(argv[a++]);
- if (len > MAXWORD)
- abort(); /* kind of drastic... */
- for (i = 0; i < len; i++)
- inmap[i] = atoi(argv[a++]);
- if (atoi(argv[a++]) != len)
- abort();
- for (i = 0; i < len; i++)
- outmap[i] = atoi(argv[a++]);
-
- while (fread(in, 1, len, stdin) == len) {
- for (i = 0; i < len; i++)
- out[outmap[i]] = in[inmap[i]];
- fwrite(out, 1, len, stdout);
- }
-#ifdef DBZ_FINISH
- DBZ_FINISH;
-#endif
- exit(0);
-}
diff --git a/contrib/libio/dbz/case.c b/contrib/libio/dbz/case.c
deleted file mode 100644
index 87b741ff54a7..000000000000
--- a/contrib/libio/dbz/case.c
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * case-mapping stuff
- *
- * We exploit the fact that we are dealing only with headers here, and
- * headers are limited to the ASCII characters by RFC822. It is barely
- * possible that we might be dealing with a translation into another
- * character set, but in particular it's very unlikely for a header
- * character to be outside -128..255.
- *
- * Life would be a whole lot simpler if tolower() could safely and portably
- * be applied to any char.
- */
-#include <stdio.h>
-#include "string.h"
-#include "case.h"
-
-/* note that case.h knows the value of OFFSET */
-#define OFFSET 128 /* avoid trouble with negative chars */
-#define MAPSIZE (256+OFFSET)
-char casemap[MAPSIZE]; /* relies on init to '\0' */
-static int primed = 0; /* has casemap been set up? */
-
-/*
- - prime - set up case-mapping stuff
- */
-static void
-prime()
-{
- register char *lp;
- register char *up;
- register int c;
- register int i;
- static char lower[] = "abcdefghijklmnopqrstuvwxyz";
- static char upper[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
-
- for (lp = lower, up = upper; *lp != '\0'; lp++, up++) {
- c = *lp;
- casemap[c+OFFSET] = c;
- casemap[*up+OFFSET] = c;
- }
- for (i = 0; i < MAPSIZE; i++)
- if (casemap[i] == '\0')
- casemap[i] = (char)(i-OFFSET);
- primed = 1;
-}
-
-/*
- - cistrncmp - case-independent strncmp
- */
-int /* < == > 0 */
-cistrncmp(s1, s2, len)
-char *s1;
-char *s2;
-int len;
-{
- register char *p1;
- register char *p2;
- register int n;
-
- if (!primed)
- prime();
-
- p1 = s1;
- p2 = s2;
- n = len;
- while (--n >= 0 && *p1 != '\0' && TOLOW(*p1) == TOLOW(*p2)) {
- p1++;
- p2++;
- }
- if (n < 0)
- return(0);
-
- /*
- * The following case analysis is necessary so that characters
- * which look negative collate low against normal characters but
- * high against the end-of-string NUL.
- */
- if (*p1 == '\0' && *p2 == '\0')
- return(0);
- else if (*p1 == '\0')
- return(-1);
- else if (*p2 == '\0')
- return(1);
- else
- return(TOLOW(*p1) - TOLOW(*p2));
-}
-
-/*
- - rfc822ize - do the bizarre case conversion needed for rfc822 message-ids
- *
- * Actually, this is not quite complete. Absolute, total, full RFC822
- * compliance requires a horrible parsing job, because of the arcane
- * quoting conventions -- abc"def"ghi is not equivalent to abc"DEF"ghi,
- * for example. There are three or four things that might occur in the
- * domain part of a message-id that are case-sensitive. They don't seem
- * to ever occur in real news, thank Cthulhu. (What? You were expecting
- * a merciful and forgiving deity to be invoked in connection with RFC822?
- * Forget it; none of them would come near it.)
- */
-char * /* returns the argument */
-rfc822ize(s)
-char *s;
-{
- register char *p;
- static char post[] = "postmaster";
- static int postlen = sizeof(post)-1;
-
- if (!primed)
- prime();
-
- p = strrchr(s, '@');
- if (p == NULL) /* no local/domain split */
- p = ""; /* assume all local */
- else if (p - (s+1) == postlen && CISTREQN(s+1, post, postlen)) {
- /* crazy special case -- "postmaster" is case-insensitive */
- p = s;
- }
-#ifdef NONSTANDARD
-#ifdef RFCVIOLATION
-#ifdef B_2_11_MISTAKE
- p = s; /* all case-insensitive */
-#endif
-#endif
-#endif
- for (; *p != '\0'; p++)
- *p = TOLOW(*p);
-
- return(s);
-}
diff --git a/contrib/libio/dbz/case.h b/contrib/libio/dbz/case.h
deleted file mode 100644
index d5ef69615506..000000000000
--- a/contrib/libio/dbz/case.h
+++ /dev/null
@@ -1,12 +0,0 @@
-extern int cistrncmp();
-extern char *rfc822ize();
-
-extern char casemap[];
-
-/* must call cistrncmp before invoking TOLOW... */
-#define TOLOW(c) (casemap[(c)+128]) /* see case.c for why 128 */
-
-/* ...but the use of it in CISTREQN is safe without the preliminary call (!) */
-/* CISTREQN is an optimised case-insensitive strncmp(a,b,n)==0; n > 0 */
-#define CISTREQN(a, b, n) \
- (TOLOW((a)[0]) == TOLOW((b)[0]) && cistrncmp(a, b, n) == 0)
diff --git a/contrib/libio/dbz/configure.in b/contrib/libio/dbz/configure.in
deleted file mode 100644
index 4cb9b57ce0fa..000000000000
--- a/contrib/libio/dbz/configure.in
+++ /dev/null
@@ -1,17 +0,0 @@
-# This file is a shell script fragment that supplies the information
-# necessary for a configure script to process the program in
-# this directory. For more information, look at ../configure.
-
-configdirs=
-srctrigger=dbzmain.c
-srcname="libio dbz test"
-
-# per-host:
-
-# per-target:
-
-files="dbz.c dbzmain.c"
-links="rdbz.c rdbzmain.c"
-
-# post-target:
-
diff --git a/contrib/libio/dbz/dbz.1 b/contrib/libio/dbz/dbz.1
deleted file mode 100644
index d2fff17af985..000000000000
--- a/contrib/libio/dbz/dbz.1
+++ /dev/null
@@ -1,221 +0,0 @@
-.TH DBZ 1 "11 Feb 1992"
-.BY "C News"
-.SH NAME
-dbz \- operate on dbz databases of text
-.SH SYNOPSIS
-.B dbz
-[
-.BR \- { axmc }
-] [
-.B \-t
-c
-] [
-.B \-l
-length
-] [
-.BR \- { qiue }
-] [
-.B \-f
-old
-] [
-.B \-p
-parms
-] database file ...
-.SH DESCRIPTION
-.I Dbz
-is a shell-level interface to the
-.IR dbz (3z)
-database routines for indexed access to a text file.
-.PP
-The
-.I database
-file must be a text file,
-one line per database record,
-with the key the first field on the line.
-The
-.B \-t
-option sets the field-separator character; the default is tab.
-Setting the separator character to NUL (with
-.BR "\-t\ ''" )
-makes the whole line the key.
-Lines must not exceed 1023 bytes in length including the newline;
-this limit can be increased with the
-.B \-l
-option.
-The limitations and restrictions of
-.IR dbz (3z)
-must also be observed;
-in particular, it remains the user's responsibility to ensure that
-no attempt is made to store two entries (whether identical or not)
-with the same key.
-.PP
-In the absence of options,
-.I dbz
-creates a
-.IR dbz (3z)
-index for the database;
-the index comprises files
-.IB database .pag
-and
-.IB database .dir
-in the same directory.
-Any previous index is silently overwritten.
-The
-.BR \-a ,
-.BR \-x ,
-.BR \-m ,
-and
-.B \-c
-options specify other operations.
-.PP
-With
-.BR \-a ,
-.I dbz
-appends lines from the
-.IR file (s)
-(standard input if none)
-to the database, updating both the
-text file and the indexes.
-.PP
-With
-.BR \-x ,
-.I dbz
-reads keys from the
-.IR file (s)
-(standard input if none)
-and prints (on standard output) the corresponding lines, if any,
-from the database.
-The input is in the form of database lines, although only the keys are
-significant.
-The
-.B \-q
-option makes
-.B \-x
-print the input lines whose keys are found instead of the database
-lines; this is somewhat faster.
-.PP
-With
-.BR \-m ,
-operation is the same as for
-.B \-x
-except that the keys which are \fInot\fR present in the database are printed.
-.PP
-With
-.BR \-c ,
-.I dbz
-checks the database for internal consistency.
-The
-.B \-q
-option causes this check to be done more quickly but less thoroughly
-(each key is looked up in the index, but no check is made to be sure
-that the index entry points to the right place).
-.PP
-The
-.B \-i
-option suppresses the use of
-.IR dbz (3z)'s
-.I incore
-facility.
-This makes accesses slower, but keeps the files current
-during updating
-and reduces
-startup/shutdown overhead.
-.PP
-Normally,
-.I dbz
-checks whether a key is already in the database before adding it.
-The
-.B \-u
-option suppresses this check, speeding things up at the expense of safety.
-.PP
-A new index is normally created with default size,
-case mapping, and tagging.
-The default size is right for 90-100,000 records.
-The default case mapping is right for RFC822 message-ids.
-See
-.IR dbz (3z)
-for what tagging is about.
-(Note, these defaults can be changed when
-.IR dbz (3z)
-is installed.)
-.PP
-If the
-.B \-f
-option is given,
-size, case mapping, and tagging
-are instead initialized based on the
-database
-.IR old .
-This is mostly useful when
-creating a new generation of an existing database.
-(See the description of
-.I dbzagain
-in
-.IR dbz (3z)
-for details.)
-.PP
-If the
-.B \-p
-option is given, the
-.I parms
-string specifies the size, case mapping, and tagging.
-If
-.I parms
-is a single decimal number,
-that is taken as the expected number of records
-in the index, with case mapping and tagging defaulted.
-Alternatively,
-.I parms
-can be three fields\(ema decimal number, a case-mapping code character, and a
-hexadecimal tag mask\(emseparated by white space.
-The decimal number is, again, the expected number of records;
-0 means ``use the default''.
-See
-.IR dbz (3z)
-for possible choices of case-mapping code,
-but in particular,
-.B 0
-means ``no case mapping''.
-See
-.IR dbz (3z)
-for details on tag masks;
-0 means ``use the default''.
-.PP
-If the
-.B \-e
-option is given, the decimal number in
-.B \-p
-is taken to be the exact table size, not the expected number of records,
-and invocation of
-.I dbzsize
-(see
-.IR dbz (3z))
-to predict a good size for that number of records is suppressed.
-.PP
-The
-.B \&.pag
-file is normally about 6 bytes per record (based on the estimate given to
-.B \-p
-or the previous history of the
-.B \-f
-database).
-The
-.B \&.dir
-file is tiny.
-.SH SEE ALSO
-dbz(3z)
-.SH HISTORY
-Written at U of Toronto by Henry Spencer, for the C News project.
-See
-.IR dbz (3z)
-for the history of the underlying database routines.
-.SH BUGS
-There are a number of undocumented options with obscure effects,
-meant for debugging and regression testing of
-.IR dbz (3z).
-.PP
-Permissions for the index files probably ought to be taken from those
-of the base file.
-.PP
-The line-length limit is a blemish, alleviated only slightly by
-.BR \-l .
diff --git a/contrib/libio/dbz/dbz.3z b/contrib/libio/dbz/dbz.3z
deleted file mode 100644
index 6df25311c701..000000000000
--- a/contrib/libio/dbz/dbz.3z
+++ /dev/null
@@ -1,547 +0,0 @@
-.TH DBZ 3Z "3 Feb 1991"
-.BY "C News"
-.SH NAME
-dbminit, fetch, store, dbmclose \- somewhat dbm-compatible database routines
-.br
-dbzfresh, dbzagain, dbzfetch, dbzstore \- database routines
-.br
-dbzsync, dbzsize, dbzincore, dbzcancel, dbzdebug \- database routines
-.SH SYNOPSIS
-.nf
-.B #include <dbz.h>
-.PP
-.B dbminit(base)
-.B char *base;
-.PP
-.B datum
-.B fetch(key)
-.B datum key;
-.PP
-.B store(key, value)
-.B datum key;
-.B datum value;
-.PP
-.B dbmclose()
-.PP
-.B dbzfresh(base, size, fieldsep, cmap, tagmask)
-.B char *base;
-.B long size;
-.B int fieldsep;
-.B int cmap;
-.B long tagmask;
-.PP
-.B dbzagain(base, oldbase)
-.B char *base;
-.B char *oldbase;
-.PP
-.B datum
-.B dbzfetch(key)
-.B datum key;
-.PP
-.B dbzstore(key, value)
-.B datum key;
-.B datum value;
-.PP
-.B dbzsync()
-.PP
-.B long
-.B dbzsize(nentries)
-.B long nentries;
-.PP
-.B dbzincore(newvalue)
-.PP
-.B dbzcancel()
-.PP
-.B dbzdebug(newvalue)
-.SH DESCRIPTION
-These functions provide an indexing system for rapid random access to a
-text file (the
-.I base
-.IR file ).
-Subject to certain constraints, they are call-compatible with
-.IR dbm (3),
-although they also provide some extensions.
-(Note that they are
-.I not
-file-compatible with
-.I dbm
-or any variant thereof.)
-.PP
-In principle,
-.I dbz
-stores key-value pairs, where both key and value are arbitrary sequences
-of bytes, specified to the functions by
-values of type
-.IR datum ,
-typedefed in the header file to be a structure with members
-.I dptr
-(a value of type
-.I char *
-pointing to the bytes)
-and
-.I dsize
-(a value of type
-.I int
-indicating how long the byte sequence is).
-.PP
-In practice,
-.I dbz
-is more restricted than
-.IR dbm .
-A
-.I dbz
-database
-must be an index into a base file,
-with the database
-.IR value s
-being
-.IR fseek (3)
-offsets into the base file.
-Each such
-.I value
-must ``point to'' a place in the base file where the corresponding
-.I key
-sequence is found.
-A key can be no longer than
-.SM DBZMAXKEY
-(a constant defined in the header file) bytes.
-No key can be an initial subsequence of another,
-which in most applications requires that keys be
-either bracketed or terminated in some way (see the
-discussion of the
-.I fieldsep
-parameter of
-.IR dbzfresh ,
-below,
-for a fine point on terminators).
-.PP
-.I Dbminit
-opens a database,
-an index into the base file
-.IR base ,
-consisting of files
-.IB base .dir
-and
-.IB base .pag
-which must already exist.
-(If the database is new, they should be zero-length files.)
-Subsequent accesses go to that database until
-.I dbmclose
-is called to close the database.
-The base file need not exist at the time of the
-.IR dbminit ,
-but it must exist before accesses are attempted.
-.PP
-.I Fetch
-searches the database for the specified
-.IR key ,
-returning the corresponding
-.IR value
-if any.
-.I Store
-stores the
-.IR key - value
-pair in the database.
-.I Store
-will fail unless the database files are writeable.
-See below for a complication arising from case mapping.
-.PP
-.I Dbzfresh
-is a variant of
-.I dbminit
-for creating a new database with more control over details.
-Unlike for
-.IR dbminit ,
-the database files need not exist:
-they will be created if necessary,
-and truncated in any case.
-.PP
-.IR Dbzfresh 's
-.I size
-parameter specifies the size of the first hash table within the database,
-in key-value pairs.
-Performance will be best if
-.I size
-is a prime number and
-the number of key-value pairs stored in the database does not exceed
-about 2/3 of
-.IR size .
-(The
-.I dbzsize
-function, given the expected number of key-value pairs,
-will suggest a database size that meets these criteria.)
-Assuming that an
-.I fseek
-offset is 4 bytes,
-the
-.B .pag
-file will be
-.RI 4* size
-bytes
-(the
-.B .dir
-file is tiny and roughly constant in size)
-until
-the number of key-value pairs exceeds about 80% of
-.IR size .
-(Nothing awful will happen if the database grows beyond 100% of
-.IR size ,
-but accesses will slow down somewhat and the
-.B .pag
-file will grow somewhat.)
-.PP
-.IR Dbzfresh 's
-.I fieldsep
-parameter specifies the field separator in the base file.
-If this is not
-NUL (0), and the last character of a
-.I key
-argument is NUL, that NUL compares equal to either a NUL or a
-.I fieldsep
-in the base file.
-This permits use of NUL to terminate key strings without requiring that
-NULs appear in the base file.
-The
-.I fieldsep
-of a database created with
-.I dbminit
-is the horizontal-tab character.
-.PP
-For use in news systems, various forms of case mapping (e.g. uppercase to
-lowercase) in keys are available.
-The
-.I cmap
-parameter to
-.I dbzfresh
-is a single character specifying which of several mapping algorithms to use.
-Available algorithms are:
-.RS
-.TP
-.B 0
-case-sensitive: no case mapping
-.TP
-.B B
-same as
-.B 0
-.TP
-.B NUL
-same as
-.B 0
-.TP
-.B =
-case-insensitive: uppercase and lowercase equivalent
-.TP
-.B b
-same as
-.B =
-.TP
-.B C
-RFC822 message-ID rules, case-sensitive before `@' (with certain exceptions)
-and case-insensitive after
-.TP
-.B ?
-whatever the local default is, normally
-.B C
-.RE
-.PP
-Mapping algorithm
-.B 0
-(no mapping) is faster than the others and is overwhelmingly the correct
-choice for most applications.
-Unless compatibility constraints interfere, it is more efficient to pre-map
-the keys, storing mapped keys in the base file, than to have
-.I dbz
-do the mapping on every search.
-.PP
-For historical reasons,
-.I fetch
-and
-.I store
-expect their
-.I key
-arguments to be pre-mapped, but expect unmapped keys in the base file.
-.I Dbzfetch
-and
-.I dbzstore
-do the same jobs but handle all case mapping internally,
-so the customer need not worry about it.
-.PP
-.I Dbz
-stores only the database
-.IR value s
-in its files, relying on reference to the base file to confirm a hit on a key.
-References to the base file can be minimized, greatly speeding up searches,
-if a little bit of information about the keys can be stored in the
-.I dbz
-files.
-This is ``free'' if there are some unused bits in an
-.I fseek
-offset,
-so that the offset can be
-.I tagged
-with some information about the key.
-The
-.I tagmask
-parameter of
-.I dbzfresh
-allows specifying the location of unused bits.
-.I Tagmask
-should be a mask with
-one group of
-contiguous
-.B 1
-bits.
-The bits in the mask should
-be unused (0) in
-.I most
-offsets.
-The bit immediately above the mask (the
-.I flag
-bit) should be unused (0) in
-.I all
-offsets;
-.I (dbz)store
-will reject attempts to store a key-value pair in which the
-.I value
-has the flag bit on.
-Apart from this restriction, tagging is invisible to the user.
-As a special case, a
-.I tagmask
-of 1 means ``no tagging'', for use with enormous base files or
-on systems with unusual offset representations.
-.PP
-A
-.I size
-of 0
-given to
-.I dbzfresh
-is synonymous with the local default;
-the normal default is suitable for tables of 90-100,000
-key-value pairs.
-A
-.I cmap
-of 0 (NUL) is synonymous with the character
-.BR 0 ,
-signifying no case mapping
-(note that the character
-.B ?
-specifies the local default mapping,
-normally
-.BR C ).
-A
-.I tagmask
-of 0 is synonymous with the local default tag mask,
-normally 0x7f000000 (specifying the top bit in a 32-bit offset
-as the flag bit, and the next 7 bits as the mask,
-which is suitable for base files up to circa 24MB).
-Calling
-.I dbminit(name)
-with the database files empty is equivalent to calling
-.IR dbzfresh(name,0,'\et','?',0) .
-.PP
-When databases are regenerated periodically, as in news,
-it is simplest to pick the parameters for a new database based on the old one.
-This also permits some memory of past sizes of the old database, so that
-a new database size can be chosen to cover expected fluctuations.
-.I Dbzagain
-is a variant of
-.I dbminit
-for creating a new database as a new generation of an old database.
-The database files for
-.I oldbase
-must exist.
-.I Dbzagain
-is equivalent to calling
-.I dbzfresh
-with the same field separator, case mapping, and tag mask as the old database,
-and a
-.I size
-equal to the result of applying
-.I dbzsize
-to the largest number of entries in the
-.I oldbase
-database and its previous 10 generations.
-.PP
-When many accesses are being done by the same program,
-.I dbz
-is massively faster if its first hash table is in memory.
-If an internal flag is 1,
-an attempt is made to read the table in when
-the database is opened, and
-.I dbmclose
-writes it out to disk again (if it was read successfully and
-has been modified).
-.I Dbzincore
-sets the flag to
-.I newvalue
-(which should be 0 or 1)
-and returns the previous value;
-this does not affect the status of a database that has already been opened.
-The default is 0.
-The attempt to read the table in may fail due to memory shortage;
-in this case
-.I dbz
-quietly falls back on its default behavior.
-.IR Store s
-to an in-memory database are not (in general) written out to the file
-until
-.IR dbmclose
-or
-.IR dbzsync ,
-so if robustness in the presence of crashes
-or concurrent accesses
-is crucial, in-memory databases
-should probably be avoided.
-.PP
-.I Dbzsync
-causes all buffers etc. to be flushed out to the files.
-It is typically used as a precaution against crashes or concurrent accesses
-when a
-.IR dbz -using
-process will be running for a long time.
-It is a somewhat expensive operation,
-especially
-for an in-memory database.
-.PP
-.I Dbzcancel
-cancels any pending writes from buffers.
-This is typically useful only for in-core databases, since writes are
-otherwise done immediately.
-Its main purpose is to let a child process, in the wake of a
-.IR fork ,
-do a
-.I dbmclose
-without writing its parent's data to disk.
-.PP
-If
-.I dbz
-has been compiled with debugging facilities available (which makes it
-bigger and a bit slower),
-.I dbzdebug
-alters the value (and returns the previous value) of an internal flag
-which (when 1; default is 0) causes
-verbose and cryptic debugging output on standard output.
-.PP
-Concurrent reading of databases is fairly safe,
-but there is no (inter)locking,
-so concurrent updating is not.
-.PP
-The database files include a record of the byte order of the processor
-creating the database, and accesses by processors with different byte
-order will work, although they will be slightly slower.
-Byte order is preserved by
-.IR dbzagain .
-However,
-agreement on the size and internal structure of an
-.I fseek
-offset is necessary, as is consensus on
-the character set.
-.PP
-An open database occupies three
-.I stdio
-streams and their corresponding file descriptors;
-a fourth is needed for an in-memory database.
-Memory consumption is negligible (except for
-.I stdio
-buffers) except for in-memory databases.
-.SH SEE ALSO
-dbz(1), dbm(3)
-.SH DIAGNOSTICS
-Functions returning
-.I int
-values return 0 for success, \-1 for failure.
-Functions returning
-.I datum
-values return a value with
-.I dptr
-set to NULL for failure.
-.I Dbminit
-attempts to have
-.I errno
-set plausibly on return, but otherwise this is not guaranteed.
-An
-.I errno
-of
-.B EDOM
-from
-.I dbminit
-indicates that the database did not appear to be in
-.I dbz
-format.
-.SH HISTORY
-The original
-.I dbz
-was written by
-Jon Zeeff (zeeff@b-tech.ann-arbor.mi.us).
-Later contributions by David Butler and Mark Moraes.
-Extensive reworking,
-including this documentation,
-by Henry Spencer (henry@zoo.toronto.edu) as
-part of the C News project.
-Hashing function by Peter Honeyman.
-.SH BUGS
-The
-.I dptr
-members of returned
-.I datum
-values point to static storage which is overwritten by later calls.
-.PP
-Unlike
-.IR dbm ,
-.I dbz
-will misbehave if an existing key-value pair is `overwritten' by
-a new
-.I (dbz)store
-with the same key.
-The user is responsible for avoiding this by using
-.I (dbz)fetch
-first to check for duplicates;
-an internal optimization remembers the result of the
-first search so there is minimal overhead in this.
-.PP
-Waiting until after
-.I dbminit
-to bring the base file into existence
-will fail if
-.IR chdir (2)
-has been used meanwhile.
-.PP
-The RFC822 case mapper implements only a first approximation to the
-hideously-complex RFC822 case rules.
-.PP
-The prime finder in
-.I dbzsize
-is not particularly quick.
-.PP
-Should implement the
-.I dbm
-functions
-.IR delete ,
-.IR firstkey ,
-and
-.IR nextkey .
-.PP
-On C implementations which trap integer overflow,
-.I dbz
-will refuse to
-.I (dbz)store
-an
-.I fseek
-offset equal to the greatest
-representable
-positive number,
-as this would cause overflow in the biased representation used.
-.PP
-.I Dbzagain
-perhaps ought to notice when many offsets
-in the old database were
-too big for
-tagging, and shrink the tag mask to match.
-.PP
-Marking
-.IR dbz 's
-file descriptors
-.RI close-on- exec
-would be a better approach to the problem
-.I dbzcancel
-tries to address, but that's harder to do portably.
diff --git a/contrib/libio/dbz/dbz.c b/contrib/libio/dbz/dbz.c
deleted file mode 100644
index 7489a09d15ae..000000000000
--- a/contrib/libio/dbz/dbz.c
+++ /dev/null
@@ -1,1768 +0,0 @@
-/*
-
-dbz.c V3.2
-
-Copyright 1988 Jon Zeeff (zeeff@b-tech.ann-arbor.mi.us)
-You can use this code in any manner, as long as you leave my name on it
-and don't hold me responsible for any problems with it.
-
-Hacked on by gdb@ninja.UUCP (David Butler); Sun Jun 5 00:27:08 CDT 1988
-
-Various improvments + INCORE by moraes@ai.toronto.edu (Mark Moraes)
-
-Major reworking by Henry Spencer as part of the C News project.
-
-These routines replace dbm as used by the usenet news software
-(it's not a full dbm replacement by any means). It's fast and
-simple. It contains no AT&T code.
-
-In general, dbz's files are 1/20 the size of dbm's. Lookup performance
-is somewhat better, while file creation is spectacularly faster, especially
-if the incore facility is used.
-
-*/
-
-#include <stdio.h>
-#include <sys/types.h>
-#include <string.h>
-#include <ctype.h>
-#include <errno.h>
-#ifndef __STDC__
-extern int errno;
-#endif
-#include <dbz.h>
-
-/*
- * #ifdef index. "LIA" = "leave it alone unless you know what you're doing".
- *
- * FUNNYSEEKS SEEK_SET is not 0, get it from <unistd.h>
- * INDEX_SIZE backward compatibility with old dbz; avoid using this
- * NMEMORY number of days of memory for use in sizing new table (LIA)
- * INCORE backward compatibility with old dbz; use dbzincore() instead
- * DBZDEBUG enable debugging
- * DEFSIZE default table size (not as critical as in old dbz)
- * OLDBNEWS default case mapping as in old B News; set NOBUFFER
- * BNEWS default case mapping as in current B News; set NOBUFFER
- * DEFCASE default case-map algorithm selector
- * NOTAGS fseek offsets are strange, do not do tagging (see below)
- * NPAGBUF size of .pag buffer, in longs (LIA)
- * SHISTBUF size of ASCII-file buffer, in bytes (LIA)
- * MAXRUN length of run which shifts to next table (see below) (LIA)
- * OVERFLOW long-int arithmetic overflow must be avoided, will trap
- * NOBUFFER do not buffer hash-table i/o, B News locking is defective
- */
-
-#ifdef FUNNYSEEKS
-#include <unistd.h>
-#else
-#define SEEK_SET 0
-#endif
-#ifdef OVERFLOW
-#include <limits.h>
-#endif
-
-static int dbzversion = 3; /* for validating .dir file format */
-
-/*
- * The dbz database exploits the fact that when news stores a <key,value>
- * tuple, the `value' part is a seek offset into a text file, pointing to
- * a copy of the `key' part. This avoids the need to store a copy of
- * the key in the dbz files. However, the text file *must* exist and be
- * consistent with the dbz files, or things will fail.
- *
- * The basic format of the database is a simple hash table containing the
- * values. A value is stored by indexing into the table using a hash value
- * computed from the key; collisions are resolved by linear probing (just
- * search forward for an empty slot, wrapping around to the beginning of
- * the table if necessary). Linear probing is a performance disaster when
- * the table starts to get full, so a complication is introduced. The
- * database is actually one *or more* tables, stored sequentially in the
- * .pag file, and the length of linear-probe sequences is limited. The
- * search (for an existing item or an empty slot) always starts in the
- * first table, and whenever MAXRUN probes have been done in table N,
- * probing continues in table N+1. This behaves reasonably well even in
- * cases of massive overflow. There are some other small complications
- * added, see comments below.
- *
- * The table size is fixed for any particular database, but is determined
- * dynamically when a database is rebuilt. The strategy is to try to pick
- * the size so the first table will be no more than 2/3 full, that being
- * slightly before the point where performance starts to degrade. (It is
- * desirable to be a bit conservative because the overflow strategy tends
- * to produce files with holes in them, which is a nuisance.)
- */
-
-/*
- * The following is for backward compatibility.
- */
-#ifdef INDEX_SIZE
-#define DEFSIZE INDEX_SIZE
-#endif
-
-/*
- * ANSI C says the offset argument to fseek is a long, not an off_t, for some
- * reason. Let's use off_t anyway.
- */
-#define SOF (sizeof(off_t))
-
-/*
- * We assume that unused areas of a binary file are zeros, and that the
- * bit pattern of `(off_t)0' is all zeros. The alternative is rather
- * painful file initialization. Note that okayvalue(), if OVERFLOW is
- * defined, knows what value of an offset would cause overflow.
- */
-#define VACANT ((off_t)0)
-#define BIAS(o) ((o)+1) /* make any valid off_t non-VACANT */
-#define UNBIAS(o) ((o)-1) /* reverse BIAS() effect */
-
-/*
- * In a Unix implementation, or indeed any in which an off_t is a byte
- * count, there are a bunch of high bits free in an off_t. There is a
- * use for them. Checking a possible hit by looking it up in the base
- * file is relatively expensive, and the cost can be dramatically reduced
- * by using some of those high bits to tag the value with a few more bits
- * of the key's hash. This detects most false hits without the overhead of
- * seek+read+strcmp. We use the top bit to indicate whether the value is
- * tagged or not, and don't tag a value which is using the tag bits itself.
- * We're in trouble if the off_t representation wants to use the top bit.
- * The actual bitmasks and offset come from the configuration stuff,
- * which permits fiddling with them as necessary, and also suppressing
- * them completely (by defining the masks to 0). We build pre-shifted
- * versions of the masks for efficiency.
- */
-static off_t tagbits; /* pre-shifted tag mask */
-static off_t taghere; /* pre-shifted tag-enable bit */
-static off_t tagboth; /* tagbits|taghere */
-#define HASTAG(o) ((o)&taghere)
-#define TAG(o) ((o)&tagbits)
-#define NOTAG(o) ((o)&~tagboth)
-#define CANTAG(o) (((o)&tagboth) == 0)
-#define MKTAG(v) (((v)<<conf.tagshift)&tagbits)
-
-/*
- * A new, from-scratch database, not built as a rebuild of an old one,
- * needs to know table size, casemap algorithm, and tagging. Normally
- * the user supplies this info, but there have to be defaults.
- */
-#ifndef DEFSIZE
-#define DEFSIZE 120011 /* 300007 might be better */
-#endif
-#ifdef OLDBNEWS
-#define DEFCASE '0' /* B2.10 -- no mapping */
-#define NOBUFFER /* B News locking is defective */
-#endif
-#ifdef BNEWS
-#define DEFCASE '=' /* B2.11 -- all mapped */
-#define NOBUFFER /* B News locking is defective */
-#endif
-#ifndef DEFCASE /* C News compatibility is the default */
-#define DEFCASE 'C' /* C News -- RFC822 mapping */
-#endif
-#ifndef NOTAGS
-#define TAGENB 0x80 /* tag enable is top bit, tag is next 7 */
-#define TAGMASK 0x7f
-#define TAGSHIFT 24
-#else
-#define TAGENB 0 /* no tags */
-#define TAGMASK 0
-#define TAGSHIFT 0
-#endif
-
-/*
- * We read configuration info from the .dir file into this structure,
- * so we can avoid wired-in assumptions for an existing database.
- *
- * Among the info is a record of recent peak usages, so that a new table
- * size can be chosen intelligently when rebuilding. 10 is a good
- * number of usages to keep, since news displays marked fluctuations
- * in volume on a 7-day cycle.
- */
-struct dbzconfig {
- int olddbz; /* .dir file empty but .pag not? */
- off_t tsize; /* table size */
-# ifndef NMEMORY
-# define NMEMORY 10 /* # days of use info to remember */
-# endif
-# define NUSEDS (1+NMEMORY)
- off_t used[NUSEDS]; /* entries used today, yesterday, ... */
- int valuesize; /* size of table values, == SOF */
- int bytemap[SOF]; /* byte-order map */
- char casemap; /* case-mapping algorithm (see cipoint()) */
- char fieldsep; /* field separator in base file, if any */
- off_t tagenb; /* unshifted tag-enable bit */
- off_t tagmask; /* unshifted tag mask */
- int tagshift; /* shift count for tagmask and tagenb */
-};
-static struct dbzconfig conf;
-static int getconf();
-static long getno();
-static int putconf();
-static void mybytemap();
-static off_t bytemap();
-
-/*
- * For a program that makes many, many references to the database, it
- * is a large performance win to keep the table in core, if it will fit.
- * Note that this does hurt robustness in the event of crashes, and
- * dbmclose() *must* be called to flush the in-core database to disk.
- * The code is prepared to deal with the possibility that there isn't
- * enough memory. There *is* an assumption that a size_t is big enough
- * to hold the size (in bytes) of one table, so dbminit() tries to figure
- * out whether this is possible first.
- *
- * The preferred way to ask for an in-core table is to do dbzincore(1)
- * before dbminit(). The default is not to do it, although -DINCORE
- * overrides this for backward compatibility with old dbz.
- *
- * We keep only the first table in core. This greatly simplifies the
- * code, and bounds memory demand. Furthermore, doing this is a large
- * performance win even in the event of massive overflow.
- */
-#ifdef INCORE
-static int incore = 1;
-#else
-static int incore = 0;
-#endif
-
-/*
- * Stdio buffer for .pag reads. Buffering more than about 16 does not help
- * significantly at the densities we try to maintain, and the much larger
- * buffers that most stdios default to are much more expensive to fill.
- * With small buffers, stdio is performance-competitive with raw read(),
- * and it's much more portable.
- */
-#ifndef NPAGBUF
-#define NPAGBUF 16
-#endif
-#ifndef NOBUFFER
-#ifdef _IOFBF
-static off_t pagbuf[NPAGBUF]; /* only needed if !NOBUFFER && _IOFBF */
-#endif
-#endif
-
-/*
- * Stdio buffer for base-file reads. Message-IDs (all news ever needs to
- * read) are essentially never longer than 64 bytes, and the typical stdio
- * buffer is so much larger that it is much more expensive to fill.
- */
-#ifndef SHISTBUF
-#define SHISTBUF 64
-#endif
-#ifdef _IOFBF
-static char basebuf[SHISTBUF]; /* only needed if _IOFBF exists */
-#endif
-
-/*
- * Data structure for recording info about searches.
- */
-struct searcher {
- off_t place; /* current location in file */
- int tabno; /* which table we're in */
- int run; /* how long we'll stay in this table */
-# ifndef MAXRUN
-# define MAXRUN 100
-# endif
- long hash; /* the key's hash code (for optimization) */
- off_t tag; /* tag we are looking for */
- int seen; /* have we examined current location? */
- int aborted; /* has i/o error aborted search? */
-};
-static void start();
-#define FRESH ((struct searcher *)NULL)
-static off_t search();
-#define NOTFOUND ((off_t)-1)
-static int okayvalue();
-static int set();
-
-/*
- * Arguably the searcher struct for a given routine ought to be local to
- * it, but a fetch() is very often immediately followed by a store(), and
- * in some circumstances it is a useful performance win to remember where
- * the fetch() completed. So we use a global struct and remember whether
- * it is current.
- */
-static struct searcher srch;
-static struct searcher *prevp; /* &srch or FRESH */
-
-/* byte-ordering stuff */
-static int mybmap[SOF]; /* my byte order (see mybytemap()) */
-static int bytesame; /* is database order same as mine? */
-#define MAPIN(o) ((bytesame) ? (o) : bytemap((o), conf.bytemap, mybmap))
-#define MAPOUT(o) ((bytesame) ? (o) : bytemap((o), mybmap, conf.bytemap))
-
-/*
- * The double parentheses needed to make this work are ugly, but the
- * alternative (under most compilers) is to pack around 2K of unused
- * strings -- there's just no way to get rid of them.
- */
-static int debug; /* controlled by dbzdebug() */
-#ifdef DBZDEBUG
-#define DEBUG(args) if (debug) { (void) printf args ; }
-#else
-#define DEBUG(args) ;
-#endif
-
-/* externals used */
-extern char *malloc();
-extern char *calloc();
-extern void free(); /* ANSI C; some old implementations say int */
-extern int atoi();
-extern long atol();
-
-/* misc. forwards */
-static long hash();
-static void crcinit();
-static char *cipoint();
-static char *mapcase();
-static int isprime();
-static FILE *latebase();
-
-/* file-naming stuff */
-static char dir[] = ".dir";
-static char pag[] = ".pag";
-static char *enstring();
-
-/* central data structures */
-static FILE *basef; /* descriptor for base file */
-static char *basefname; /* name for not-yet-opened base file */
-static FILE *dirf; /* descriptor for .dir file */
-static int dirronly; /* dirf open read-only? */
-static FILE *pagf = NULL; /* descriptor for .pag file */
-static off_t pagpos; /* posn in pagf; only search may set != -1 */
-static int pagronly; /* pagf open read-only? */
-static off_t *corepag; /* incore version of .pag file, if any */
-static FILE *bufpagf; /* well-buffered pagf, for incore rewrite */
-static off_t *getcore();
-static int putcore();
-static int written; /* has a store() been done? */
-
-/*
- - dbzfresh - set up a new database, no historical info
- */
-int /* 0 success, -1 failure */
-dbzfresh(name, size, fs, cmap, tagmask)
-char *name; /* base name; .dir and .pag must exist */
-long size; /* table size (0 means default) */
-int fs; /* field-separator character in base file */
-int cmap; /* case-map algorithm (0 means default) */
-off_t tagmask; /* 0 default, 1 no tags */
-{
- register char *fn;
- struct dbzconfig c;
- register off_t m;
- register FILE *f;
-
- if (pagf != NULL) {
- DEBUG(("dbzfresh: database already open\n"));
- return(-1);
- }
- if (size != 0 && size < 2) {
- DEBUG(("dbzfresh: preposterous size (%ld)\n", size));
- return(-1);
- }
-
- /* get default configuration */
- if (getconf((FILE *)NULL, (FILE *)NULL, &c) < 0)
- return(-1); /* "can't happen" */
-
- /* and mess with it as specified */
- if (size != 0)
- c.tsize = size;
- c.fieldsep = fs;
- switch (cmap) {
- case 0:
- case '0':
- case 'B': /* 2.10 compat */
- c.casemap = '0'; /* '\0' nicer, but '0' printable! */
- break;
- case '=':
- case 'b': /* 2.11 compat */
- c.casemap = '=';
- break;
- case 'C':
- c.casemap = 'C';
- break;
- case '?':
- c.casemap = DEFCASE;
- break;
- default:
- DEBUG(("dbzfresh case map `%c' unknown\n", cmap));
- return(-1);
- break;
- }
- switch (tagmask) {
- case 0: /* default */
- break;
- case 1: /* no tags */
- c.tagshift = 0;
- c.tagmask = 0;
- c.tagenb = 0;
- break;
- default:
- m = tagmask;
- c.tagshift = 0;
- while (!(m&01)) {
- m >>= 1;
- c.tagshift++;
- }
- c.tagmask = m;
- c.tagenb = (m << 1) & ~m;
- break;
- }
-
- /* write it out */
- fn = enstring(name, dir);
- if (fn == NULL)
- return(-1);
- f = fopen(fn, "w");
- free(fn);
- if (f == NULL) {
- DEBUG(("dbzfresh: unable to write config\n"));
- return(-1);
- }
- if (putconf(f, &c) < 0) {
- (void) fclose(f);
- return(-1);
- }
- if (fclose(f) == EOF) {
- DEBUG(("dbzfresh: fclose failure\n"));
- return(-1);
- }
-
- /* create/truncate .pag */
- fn = enstring(name, pag);
- if (fn == NULL)
- return(-1);
- f = fopen(fn, "w");
- free(fn);
- if (f == NULL) {
- DEBUG(("dbzfresh: unable to create/truncate .pag file\n"));
- return(-1);
- } else
- (void) fclose(f);
-
- /* and punt to dbminit for the hard work */
- return(dbminit(name));
-}
-
-/*
- - dbzsize - what's a good table size to hold this many entries?
- */
-long
-dbzsize(contents)
-long contents; /* 0 means what's the default */
-{
- register long n;
-
- if (contents <= 0) { /* foulup or default inquiry */
- DEBUG(("dbzsize: preposterous input (%ld)\n", contents));
- return(DEFSIZE);
- }
- n = (contents/2)*3; /* try to keep table at most 2/3 full */
- if (!(n&01)) /* make it odd */
- n++;
- DEBUG(("dbzsize: tentative size %ld\n", n));
- while (!isprime(n)) /* and look for a prime */
- n += 2;
- DEBUG(("dbzsize: final size %ld\n", n));
-
- return(n);
-}
-
-/*
- - isprime - is a number prime?
- *
- * This is not a terribly efficient approach.
- */
-static int /* predicate */
-isprime(x)
-register long x;
-{
- static int quick[] = { 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 0 };
- register int *ip;
- register long div;
- register long stop;
-
- /* hit the first few primes quickly to eliminate easy ones */
- /* this incidentally prevents ridiculously small tables */
- for (ip = quick; (div = *ip) != 0; ip++)
- if (x%div == 0) {
- DEBUG(("isprime: quick result on %ld\n", (long)x));
- return(0);
- }
-
- /* approximate square root of x */
- for (stop = x; x/stop < stop; stop >>= 1)
- continue;
- stop <<= 1;
-
- /* try odd numbers up to stop */
- for (div = *--ip; div < stop; div += 2)
- if (x%div == 0)
- return(0);
-
- return(1);
-}
-
-/*
- - dbzagain - set up a new database to be a rebuild of an old one
- */
-int /* 0 success, -1 failure */
-dbzagain(name, oldname)
-char *name; /* base name; .dir and .pag must exist */
-char *oldname; /* base name; all must exist */
-{
- register char *fn;
- struct dbzconfig c;
- register int i;
- register long top;
- register FILE *f;
- register int newtable;
- register off_t newsize;
-
- if (pagf != NULL) {
- DEBUG(("dbzagain: database already open\n"));
- return(-1);
- }
-
- /* pick up the old configuration */
- fn = enstring(oldname, dir);
- if (fn == NULL)
- return(-1);
- f = fopen(fn, "r");
- free(fn);
- if (f == NULL) {
- DEBUG(("dbzagain: cannot open old .dir file\n"));
- return(-1);
- }
- i = getconf(f, (FILE *)NULL, &c);
- (void) fclose(f);
- if (i < 0) {
- DEBUG(("dbzagain: getconf failed\n"));
- return(-1);
- }
-
- /* tinker with it */
- top = 0;
- newtable = 0;
- for (i = 0; i < NUSEDS; i++) {
- if (top < c.used[i])
- top = c.used[i];
- if (c.used[i] == 0)
- newtable = 1; /* hasn't got full usage history yet */
- }
- if (top == 0) {
- DEBUG(("dbzagain: old table has no contents!\n"));
- newtable = 1;
- }
- for (i = NUSEDS-1; i > 0; i--)
- c.used[i] = c.used[i-1];
- c.used[0] = 0;
- newsize = dbzsize(top);
- if (!newtable || newsize > c.tsize) /* don't shrink new table */
- c.tsize = newsize;
-
- /* write it out */
- fn = enstring(name, dir);
- if (fn == NULL)
- return(-1);
- f = fopen(fn, "w");
- free(fn);
- if (f == NULL) {
- DEBUG(("dbzagain: unable to write new .dir\n"));
- return(-1);
- }
- i = putconf(f, &c);
- (void) fclose(f);
- if (i < 0) {
- DEBUG(("dbzagain: putconf failed\n"));
- return(-1);
- }
-
- /* create/truncate .pag */
- fn = enstring(name, pag);
- if (fn == NULL)
- return(-1);
- f = fopen(fn, "w");
- free(fn);
- if (f == NULL) {
- DEBUG(("dbzagain: unable to create/truncate .pag file\n"));
- return(-1);
- } else
- (void) fclose(f);
-
- /* and let dbminit do the work */
- return(dbminit(name));
-}
-
-/*
- - dbminit - open a database, creating it (using defaults) if necessary
- *
- * We try to leave errno set plausibly, to the extent that underlying
- * functions permit this, since many people consult it if dbminit() fails.
- */
-int /* 0 success, -1 failure */
-dbminit(name)
-char *name;
-{
- register int i;
- register size_t s;
- register char *dirfname;
- register char *pagfname;
-
- if (pagf != NULL) {
- DEBUG(("dbminit: dbminit already called once\n"));
- errno = 0;
- return(-1);
- }
-
- /* open the .dir file */
- dirfname = enstring(name, dir);
- if (dirfname == NULL)
- return(-1);
- dirf = fopen(dirfname, "r+");
- if (dirf == NULL) {
- dirf = fopen(dirfname, "r");
- dirronly = 1;
- } else
- dirronly = 0;
- free(dirfname);
- if (dirf == NULL) {
- DEBUG(("dbminit: can't open .dir file\n"));
- return(-1);
- }
-
- /* open the .pag file */
- pagfname = enstring(name, pag);
- if (pagfname == NULL) {
- (void) fclose(dirf);
- return(-1);
- }
- pagf = fopen(pagfname, "r+b");
- if (pagf == NULL) {
- pagf = fopen(pagfname, "rb");
- if (pagf == NULL) {
- DEBUG(("dbminit: .pag open failed\n"));
- (void) fclose(dirf);
- free(pagfname);
- return(-1);
- }
- pagronly = 1;
- } else if (dirronly)
- pagronly = 1;
- else
- pagronly = 0;
-#ifdef NOBUFFER
- /*
- * B News does not do adequate locking on its database accesses.
- * Why it doesn't get into trouble using dbm is a mystery. In any
- * case, doing unbuffered i/o does not cure the problem, but does
- * enormously reduce its incidence.
- */
- (void) setbuf(pagf, (char *)NULL);
-#else
-#ifdef _IOFBF
- (void) setvbuf(pagf, (char *)pagbuf, _IOFBF, sizeof(pagbuf));
-#endif
-#endif
- pagpos = -1;
- /* don't free pagfname, need it below */
-
- /* open the base file */
- basef = fopen(name, "r");
- if (basef == NULL) {
- DEBUG(("dbminit: basefile open failed\n"));
- basefname = enstring(name, "");
- if (basefname == NULL) {
- (void) fclose(pagf);
- (void) fclose(dirf);
- free(pagfname);
- pagf = NULL;
- return(-1);
- }
- } else
- basefname = NULL;
-#ifdef _IOFBF
- if (basef != NULL)
- (void) setvbuf(basef, basebuf, _IOFBF, sizeof(basebuf));
-#endif
-
- /* pick up configuration */
- if (getconf(dirf, pagf, &conf) < 0) {
- DEBUG(("dbminit: getconf failure\n"));
- (void) fclose(basef);
- (void) fclose(pagf);
- (void) fclose(dirf);
- free(pagfname);
- pagf = NULL;
- errno = EDOM; /* kind of a kludge, but very portable */
- return(-1);
- }
- tagbits = conf.tagmask << conf.tagshift;
- taghere = conf.tagenb << conf.tagshift;
- tagboth = tagbits | taghere;
- mybytemap(mybmap);
- bytesame = 1;
- for (i = 0; i < SOF; i++)
- if (mybmap[i] != conf.bytemap[i])
- bytesame = 0;
-
- /* get first table into core, if it looks desirable and feasible */
- s = (size_t)conf.tsize * SOF;
- if (incore && (off_t)(s/SOF) == conf.tsize) {
- bufpagf = fopen(pagfname, (pagronly) ? "rb" : "r+b");
- if (bufpagf != NULL)
- corepag = getcore(bufpagf);
- } else {
- bufpagf = NULL;
- corepag = NULL;
- }
- free(pagfname);
-
- /* misc. setup */
- crcinit();
- written = 0;
- prevp = FRESH;
- DEBUG(("dbminit: succeeded\n"));
- return(0);
-}
-
-/*
- - enstring - concatenate two strings into a malloced area
- */
-static char * /* NULL if malloc fails */
-enstring(s1, s2)
-char *s1;
-char *s2;
-{
- register char *p;
-
- p = malloc((size_t)strlen(s1) + (size_t)strlen(s2) + 1);
- if (p != NULL) {
- (void) strcpy(p, s1);
- (void) strcat(p, s2);
- } else {
- DEBUG(("enstring(%s, %s) out of memory\n", s1, s2));
- }
- return(p);
-}
-
-/*
- - dbmclose - close a database
- */
-int
-dbmclose()
-{
- register int ret = 0;
-
- if (pagf == NULL) {
- DEBUG(("dbmclose: not opened!\n"));
- return(-1);
- }
-
- if (fclose(pagf) == EOF) {
- DEBUG(("dbmclose: fclose(pagf) failed\n"));
- ret = -1;
- }
- pagf = basef; /* ensure valid pointer; dbzsync checks it */
- if (dbzsync() < 0)
- ret = -1;
- if (bufpagf != NULL && fclose(bufpagf) == EOF) {
- DEBUG(("dbmclose: fclose(bufpagf) failed\n"));
- ret = -1;
- }
- if (corepag != NULL)
- free((char *)corepag);
- corepag = NULL;
- if (fclose(basef) == EOF) {
- DEBUG(("dbmclose: fclose(basef) failed\n"));
- ret = -1;
- }
- if (basefname != NULL)
- free(basefname);
- basef = NULL;
- pagf = NULL;
- if (fclose(dirf) == EOF) {
- DEBUG(("dbmclose: fclose(dirf) failed\n"));
- ret = -1;
- }
-
- DEBUG(("dbmclose: %s\n", (ret == 0) ? "succeeded" : "failed"));
- return(ret);
-}
-
-/*
- - dbzsync - push all in-core data out to disk
- */
-int
-dbzsync()
-{
- register int ret = 0;
-
- if (pagf == NULL) {
- DEBUG(("dbzsync: not opened!\n"));
- return(-1);
- }
- if (!written)
- return(0);
-
- if (corepag != NULL) {
- if (putcore(corepag, bufpagf) < 0) {
- DEBUG(("dbzsync: putcore failed\n"));
- ret = -1;
- }
- }
- if (!conf.olddbz)
- if (putconf(dirf, &conf) < 0)
- ret = -1;
-
- DEBUG(("dbzsync: %s\n", (ret == 0) ? "succeeded" : "failed"));
- return(ret);
-}
-
-/*
- - dbzcancel - cancel writing of in-core data
- * Mostly for use from child processes.
- * Note that we don't need to futz around with stdio buffers, because we
- * always fflush them immediately anyway and so they never have stale data.
- */
-int
-dbzcancel()
-{
- if (pagf == NULL) {
- DEBUG(("dbzcancel: not opened!\n"));
- return(-1);
- }
-
- written = 0;
- return(0);
-}
-
-/*
- - dbzfetch - fetch() with case mapping built in
- */
-datum
-dbzfetch(key)
-datum key;
-{
- char buffer[DBZMAXKEY + 1];
- datum mappedkey;
- register size_t keysize;
-
- DEBUG(("dbzfetch: (%s)\n", key.dptr));
-
- /* Key is supposed to be less than DBZMAXKEY */
- keysize = key.dsize;
- if (keysize >= DBZMAXKEY) {
- keysize = DBZMAXKEY;
- DEBUG(("keysize is %d - truncated to %d\n", key.dsize, DBZMAXKEY));
- }
-
- mappedkey.dptr = mapcase(buffer, key.dptr, keysize);
- buffer[keysize] = '\0'; /* just a debug aid */
- mappedkey.dsize = keysize;
-
- return(fetch(mappedkey));
-}
-
-/*
- - fetch - get an entry from the database
- *
- * Disgusting fine point, in the name of backward compatibility: if the
- * last character of "key" is a NUL, that character is (effectively) not
- * part of the comparison against the stored keys.
- */
-datum /* dptr NULL, dsize 0 means failure */
-fetch(key)
-datum key;
-{
- char buffer[DBZMAXKEY + 1];
- static off_t key_ptr; /* return value points here */
- datum output;
- register size_t keysize;
- register size_t cmplen;
- register char *sepp;
-
- DEBUG(("fetch: (%s)\n", key.dptr));
- output.dptr = NULL;
- output.dsize = 0;
- prevp = FRESH;
-
- /* Key is supposed to be less than DBZMAXKEY */
- keysize = key.dsize;
- if (keysize >= DBZMAXKEY) {
- keysize = DBZMAXKEY;
- DEBUG(("keysize is %d - truncated to %d\n", key.dsize, DBZMAXKEY));
- }
-
- if (pagf == NULL) {
- DEBUG(("fetch: database not open!\n"));
- return(output);
- } else if (basef == NULL) { /* basef didn't exist yet */
- basef = latebase();
- if (basef == NULL)
- return(output);
- }
-
- cmplen = keysize;
- sepp = &conf.fieldsep;
- if (key.dptr[keysize-1] == '\0') {
- cmplen--;
- sepp = &buffer[keysize-1];
- }
- start(&srch, &key, FRESH);
- while ((key_ptr = search(&srch)) != NOTFOUND) {
- DEBUG(("got 0x%lx\n", key_ptr));
-
- /* fetch the key */
- if (fseek(basef, key_ptr, SEEK_SET) != 0) {
- DEBUG(("fetch: seek failed\n"));
- return(output);
- }
- if (fread(buffer, 1, keysize, basef) != keysize) {
- DEBUG(("fetch: read failed\n"));
- return(output);
- }
-
- /* try it */
- buffer[keysize] = '\0'; /* terminated for DEBUG */
- (void) mapcase(buffer, buffer, keysize);
- DEBUG(("fetch: buffer (%s) looking for (%s) size = %d\n",
- buffer, key.dptr, keysize));
- if (memcmp(key.dptr, buffer, cmplen) == 0 &&
- (*sepp == conf.fieldsep || *sepp == '\0')) {
- /* we found it */
- output.dptr = (char *)&key_ptr;
- output.dsize = SOF;
- DEBUG(("fetch: successful\n"));
- return(output);
- }
- }
-
- /* we didn't find it */
- DEBUG(("fetch: failed\n"));
- prevp = &srch; /* remember where we stopped */
- return(output);
-}
-
-/*
- - latebase - try to open a base file that wasn't there at the start
- */
-static FILE *
-latebase()
-{
- register FILE *it;
-
- if (basefname == NULL) {
- DEBUG(("latebase: name foulup\n"));
- return(NULL);
- }
- it = fopen(basefname, "r");
- if (it == NULL) {
- DEBUG(("latebase: still can't open base\n"));
- } else {
- DEBUG(("latebase: late open succeeded\n"));
- free(basefname);
- basefname = NULL;
-#ifdef _IOFBF
- (void) setvbuf(it, basebuf, _IOFBF, sizeof(basebuf));
-#endif
- }
- return(it);
-}
-
-/*
- - dbzstore - store() with case mapping built in
- */
-int
-dbzstore(key, data)
-datum key;
-datum data;
-{
- char buffer[DBZMAXKEY + 1];
- datum mappedkey;
- register size_t keysize;
-
- DEBUG(("dbzstore: (%s)\n", key.dptr));
-
- /* Key is supposed to be less than DBZMAXKEY */
- keysize = key.dsize;
- if (keysize >= DBZMAXKEY) {
- DEBUG(("dbzstore: key size too big (%d)\n", key.dsize));
- return(-1);
- }
-
- mappedkey.dptr = mapcase(buffer, key.dptr, keysize);
- buffer[keysize] = '\0'; /* just a debug aid */
- mappedkey.dsize = keysize;
-
- return(store(mappedkey, data));
-}
-
-/*
- - store - add an entry to the database
- */
-int /* 0 success, -1 failure */
-store(key, data)
-datum key;
-datum data;
-{
- off_t value;
-
- if (pagf == NULL) {
- DEBUG(("store: database not open!\n"));
- return(-1);
- } else if (basef == NULL) { /* basef didn't exist yet */
- basef = latebase();
- if (basef == NULL)
- return(-1);
- }
- if (pagronly) {
- DEBUG(("store: database open read-only\n"));
- return(-1);
- }
- if (data.dsize != SOF) {
- DEBUG(("store: value size wrong (%d)\n", data.dsize));
- return(-1);
- }
- if (key.dsize >= DBZMAXKEY) {
- DEBUG(("store: key size too big (%d)\n", key.dsize));
- return(-1);
- }
-
- /* copy the value in to ensure alignment */
- (void) memcpy((char *)&value, data.dptr, SOF);
- DEBUG(("store: (%s, %ld)\n", key.dptr, (long)value));
- if (!okayvalue(value)) {
- DEBUG(("store: reserved bit or overflow in 0x%lx\n", value));
- return(-1);
- }
-
- /* find the place, exploiting previous search if possible */
- start(&srch, &key, prevp);
- while (search(&srch) != NOTFOUND)
- continue;
-
- prevp = FRESH;
- conf.used[0]++;
- DEBUG(("store: used count %ld\n", conf.used[0]));
- written = 1;
- return(set(&srch, value));
-}
-
-/*
- - dbzincore - control attempts to keep .pag file in core
- */
-int /* old setting */
-dbzincore(value)
-int value;
-{
- register int old = incore;
-
- incore = value;
- return(old);
-}
-
-/*
- - getconf - get configuration from .dir file
- */
-static int /* 0 success, -1 failure */
-getconf(df, pf, cp)
-register FILE *df; /* NULL means just give me the default */
-register FILE *pf; /* NULL means don't care about .pag */
-register struct dbzconfig *cp;
-{
- register int c;
- register int i;
- int err = 0;
-
- c = (df != NULL) ? getc(df) : EOF;
- if (c == EOF) { /* empty file, no configuration known */
- cp->olddbz = 0;
- if (df != NULL && pf != NULL && getc(pf) != EOF)
- cp->olddbz = 1;
- cp->tsize = DEFSIZE;
- cp->fieldsep = '\t';
- for (i = 0; i < NUSEDS; i++)
- cp->used[i] = 0;
- cp->valuesize = SOF;
- mybytemap(cp->bytemap);
- cp->casemap = DEFCASE;
- cp->tagenb = TAGENB;
- cp->tagmask = TAGMASK;
- cp->tagshift = TAGSHIFT;
- DEBUG(("getconf: defaults (%ld, %c, (0x%lx/0x%lx<<%d))\n",
- cp->tsize, cp->casemap, cp->tagenb,
- cp->tagmask, cp->tagshift));
- return(0);
- }
- (void) ungetc(c, df);
-
- /* first line, the vital stuff */
- if (getc(df) != 'd' || getc(df) != 'b' || getc(df) != 'z')
- err = -1;
- if (getno(df, &err) != dbzversion)
- err = -1;
- cp->tsize = getno(df, &err);
- cp->fieldsep = getno(df, &err);
- while ((c = getc(df)) == ' ')
- continue;
- cp->casemap = c;
- cp->tagenb = getno(df, &err);
- cp->tagmask = getno(df, &err);
- cp->tagshift = getno(df, &err);
- cp->valuesize = getno(df, &err);
- if (cp->valuesize != SOF) {
- DEBUG(("getconf: wrong off_t size (%d)\n", cp->valuesize));
- err = -1;
- cp->valuesize = SOF; /* to protect the loops below */
- }
- for (i = 0; i < cp->valuesize; i++)
- cp->bytemap[i] = getno(df, &err);
- if (getc(df) != '\n')
- err = -1;
- DEBUG(("size %ld, sep %d, cmap %c, tags 0x%lx/0x%lx<<%d, ", cp->tsize,
- cp->fieldsep, cp->casemap, cp->tagenb, cp->tagmask,
- cp->tagshift));
- DEBUG(("bytemap (%d)", cp->valuesize));
- for (i = 0; i < cp->valuesize; i++) {
- DEBUG((" %d", cp->bytemap[i]));
- }
- DEBUG(("\n"));
-
- /* second line, the usages */
- for (i = 0; i < NUSEDS; i++)
- cp->used[i] = getno(df, &err);
- if (getc(df) != '\n')
- err = -1;
- DEBUG(("used %ld %ld %ld...\n", cp->used[0], cp->used[1], cp->used[2]));
-
- if (err < 0) {
- DEBUG(("getconf error\n"));
- return(-1);
- }
- return(0);
-}
-
-/*
- - getno - get a long
- */
-static long
-getno(f, ep)
-FILE *f;
-int *ep;
-{
- register char *p;
-# define MAXN 50
- char getbuf[MAXN];
- register int c;
-
- while ((c = getc(f)) == ' ')
- continue;
- if (c == EOF || c == '\n') {
- DEBUG(("getno: missing number\n"));
- *ep = -1;
- return(0);
- }
- p = getbuf;
- *p++ = c;
- while ((c = getc(f)) != EOF && c != '\n' && c != ' ')
- if (p < &getbuf[MAXN-1])
- *p++ = c;
- if (c == EOF) {
- DEBUG(("getno: EOF\n"));
- *ep = -1;
- } else
- (void) ungetc(c, f);
- *p = '\0';
-
- if (strspn(getbuf, "-1234567890") != strlen(getbuf)) {
- DEBUG(("getno: `%s' non-numeric\n", getbuf));
- *ep = -1;
- }
- return(atol(getbuf));
-}
-
-/*
- - putconf - write configuration to .dir file
- */
-static int /* 0 success, -1 failure */
-putconf(f, cp)
-register FILE *f;
-register struct dbzconfig *cp;
-{
- register int i;
- register int ret = 0;
-
- if (fseek(f, 0, SEEK_SET) != 0) {
- DEBUG(("fseek failure in putconf\n"));
- ret = -1;
- }
- fprintf(f, "dbz %d %ld %d %c %ld %ld %d %d", dbzversion,
- (long)cp->tsize,
- cp->fieldsep, cp->casemap, (long)cp->tagenb,
- (long)cp->tagmask, cp->tagshift,
- cp->valuesize);
-
- for (i = 0; i < cp->valuesize; i++)
- fprintf(f, " %d", cp->bytemap[i]);
- fprintf(f, "\n");
- for (i = 0; i < NUSEDS; i++)
- fprintf(f, "%ld%c",
- (long)cp->used[i], (i < NUSEDS-1) ? ' ' : '\n');
-
-
- (void) fflush(f);
- if (ferror(f))
- ret = -1;
-
- DEBUG(("putconf status %d\n", ret));
- return(ret);
-}
-
-/*
- - getcore - try to set up an in-core copy of .pag file
- */
-static off_t * /* pointer to copy, or NULL */
-getcore(f)
-FILE *f;
-{
- register off_t *p;
- register size_t i;
- register size_t nread;
- register char *it;
-
- it = malloc((size_t)conf.tsize * SOF);
- if (it == NULL) {
- DEBUG(("getcore: malloc failed\n"));
- return(NULL);
- }
-
- nread = fread(it, SOF, (size_t)conf.tsize, f);
- if (ferror(f)) {
- DEBUG(("getcore: read failed\n"));
- free(it);
- return(NULL);
- }
-
- p = (off_t *)it + nread;
- i = (size_t)conf.tsize - nread;
- while (i-- > 0)
- *p++ = VACANT;
- return((off_t *)it);
-}
-
-/*
- - putcore - try to rewrite an in-core table
- */
-static int /* 0 okay, -1 fail */
-putcore(tab, f)
-off_t *tab;
-FILE *f;
-{
- if (fseek(f, 0, SEEK_SET) != 0) {
- DEBUG(("fseek failure in putcore\n"));
- return(-1);
- }
- (void) fwrite((char *)tab, SOF, (size_t)conf.tsize, f);
- (void) fflush(f);
- return((ferror(f)) ? -1 : 0);
-}
-
-/*
- - start - set up to start or restart a search
- */
-static void
-start(sp, kp, osp)
-register struct searcher *sp;
-register datum *kp;
-register struct searcher *osp; /* may be FRESH, i.e. NULL */
-{
- register long h;
-
- h = hash(kp->dptr, kp->dsize);
- if (osp != FRESH && osp->hash == h) {
- if (sp != osp)
- *sp = *osp;
- DEBUG(("search restarted\n"));
- } else {
- sp->hash = h;
- sp->tag = MKTAG(h / conf.tsize);
- DEBUG(("tag 0x%lx\n", sp->tag));
- sp->place = h % conf.tsize;
- sp->tabno = 0;
- sp->run = (conf.olddbz) ? conf.tsize : MAXRUN;
- sp->aborted = 0;
- }
- sp->seen = 0;
-}
-
-/*
- - search - conduct part of a search
- */
-static off_t /* NOTFOUND if we hit VACANT or error */
-search(sp)
-register struct searcher *sp;
-{
- register off_t dest;
- register off_t value;
- off_t val; /* buffer for value (can't fread register) */
- register off_t place;
-
- if (sp->aborted)
- return(NOTFOUND);
-
- for (;;) {
- /* determine location to be examined */
- place = sp->place;
- if (sp->seen) {
- /* go to next location */
- if (--sp->run <= 0) {
- sp->tabno++;
- sp->run = MAXRUN;
- }
- place = (place+1)%conf.tsize + sp->tabno*conf.tsize;
- sp->place = place;
- } else
- sp->seen = 1; /* now looking at current location */
- DEBUG(("search @ %ld\n", place));
-
- /* get the tagged value */
- if (corepag != NULL && place < conf.tsize) {
- DEBUG(("search: in core\n"));
- value = MAPIN(corepag[place]);
- } else {
- /* seek, if necessary */
- dest = place * SOF;
- if (pagpos != dest) {
- if (fseek(pagf, dest, SEEK_SET) != 0) {
- DEBUG(("search: seek failed\n"));
- pagpos = -1;
- sp->aborted = 1;
- return(NOTFOUND);
- }
- pagpos = dest;
- }
-
- /* read it */
- if (fread((char *)&val, sizeof(val), 1, pagf) == 1)
- value = MAPIN(val);
- else if (ferror(pagf)) {
- DEBUG(("search: read failed\n"));
- pagpos = -1;
- sp->aborted = 1;
- return(NOTFOUND);
- } else
- value = VACANT;
-
- /* and finish up */
- pagpos += sizeof(val);
- }
-
- /* vacant slot is always cause to return */
- if (value == VACANT) {
- DEBUG(("search: empty slot\n"));
- return(NOTFOUND);
- };
-
- /* check the tag */
- value = UNBIAS(value);
- DEBUG(("got 0x%lx\n", value));
- if (!HASTAG(value)) {
- DEBUG(("tagless\n"));
- return(value);
- } else if (TAG(value) == sp->tag) {
- DEBUG(("match\n"));
- return(NOTAG(value));
- } else {
- DEBUG(("mismatch 0x%lx\n", TAG(value)));
- }
- }
- /* NOTREACHED */
-}
-
-/*
- - okayvalue - check that a value can be stored
- */
-static int /* predicate */
-okayvalue(value)
-off_t value;
-{
- if (HASTAG(value))
- return(0);
-#ifdef OVERFLOW
- if (value == LONG_MAX) /* BIAS() and UNBIAS() will overflow */
- return(0);
-#endif
- return(1);
-}
-
-/*
- - set - store a value into a location previously found by search
- */
-static int /* 0 success, -1 failure */
-set(sp, value)
-register struct searcher *sp;
-off_t value;
-{
- register off_t place = sp->place;
- register off_t v = value;
-
- if (sp->aborted)
- return(-1);
-
- if (CANTAG(v) && !conf.olddbz) {
- v |= sp->tag | taghere;
- if (v != UNBIAS(VACANT)) /* BIAS(v) won't look VACANT */
-#ifdef OVERFLOW
- if (v != LONG_MAX) /* and it won't overflow */
-#endif
- value = v;
- }
- DEBUG(("tagged value is 0x%lx\n", value));
- value = BIAS(value);
- value = MAPOUT(value);
-
- /* If we have the index file in memory, use it */
- if (corepag != NULL && place < conf.tsize) {
- corepag[place] = value;
- DEBUG(("set: incore\n"));
- return(0);
- }
-
- /* seek to spot */
- pagpos = -1; /* invalidate position memory */
- if (fseek(pagf, place * SOF, SEEK_SET) != 0) {
- DEBUG(("set: seek failed\n"));
- sp->aborted = 1;
- return(-1);
- }
-
- /* write in data */
- if (fwrite((char *)&value, SOF, 1, pagf) != 1) {
- DEBUG(("set: write failed\n"));
- sp->aborted = 1;
- return(-1);
- }
- /* fflush improves robustness, and buffer re-use is rare anyway */
- if (fflush(pagf) == EOF) {
- DEBUG(("set: fflush failed\n"));
- sp->aborted = 1;
- return(-1);
- }
-
- DEBUG(("set: succeeded\n"));
- return(0);
-}
-
-/*
- - mybytemap - determine this machine's byte map
- *
- * A byte map is an array of ints, sizeof(off_t) of them. The 0th int
- * is the byte number of the high-order byte in my off_t, and so forth.
- */
-static void
-mybytemap(map)
-int map[]; /* -> int[SOF] */
-{
- union {
- off_t o;
- char c[SOF];
- } u;
- register int *mp = &map[SOF];
- register int ntodo;
- register int i;
-
- u.o = 1;
- for (ntodo = (int)SOF; ntodo > 0; ntodo--) {
- for (i = 0; i < SOF; i++)
- if (u.c[i] != 0)
- break;
- if (i == SOF) {
- /* trouble -- set it to *something* consistent */
- DEBUG(("mybytemap: nonexistent byte %d!!!\n", ntodo));
- for (i = 0; i < SOF; i++)
- map[i] = i;
- return;
- }
- DEBUG(("mybytemap: byte %d\n", i));
- *--mp = i;
- while (u.c[i] != 0)
- u.o <<= 1;
- }
-}
-
-/*
- - bytemap - transform an off_t from byte ordering map1 to map2
- */
-static off_t /* transformed result */
-bytemap(ino, map1, map2)
-off_t ino;
-int *map1;
-int *map2;
-{
- union oc {
- off_t o;
- char c[SOF];
- };
- union oc in;
- union oc out;
- register int i;
-
- in.o = ino;
- for (i = 0; i < SOF; i++)
- out.c[map2[i]] = in.c[map1[i]];
- return(out.o);
-}
-
-/*
- * This is a simplified version of the pathalias hashing function.
- * Thanks to Steve Belovin and Peter Honeyman
- *
- * hash a string into a long int. 31 bit crc (from andrew appel).
- * the crc table is computed at run time by crcinit() -- we could
- * precompute, but it takes 1 clock tick on a 750.
- *
- * This fast table calculation works only if POLY is a prime polynomial
- * in the field of integers modulo 2. Since the coefficients of a
- * 32-bit polynomial won't fit in a 32-bit word, the high-order bit is
- * implicit. IT MUST ALSO BE THE CASE that the coefficients of orders
- * 31 down to 25 are zero. Happily, we have candidates, from
- * E. J. Watson, "Primitive Polynomials (Mod 2)", Math. Comp. 16 (1962):
- * x^32 + x^7 + x^5 + x^3 + x^2 + x^1 + x^0
- * x^31 + x^3 + x^0
- *
- * We reverse the bits to get:
- * 111101010000000000000000000000001 but drop the last 1
- * f 5 0 0 0 0 0 0
- * 010010000000000000000000000000001 ditto, for 31-bit crc
- * 4 8 0 0 0 0 0 0
- */
-
-#define POLY 0x48000000L /* 31-bit polynomial (avoids sign problems) */
-
-static long CrcTable[128];
-
-/*
- - crcinit - initialize tables for hash function
- */
-static void
-crcinit()
-{
- register int i, j;
- register long sum;
-
- for (i = 0; i < 128; ++i) {
- sum = 0L;
- for (j = 7 - 1; j >= 0; --j)
- if (i & (1 << j))
- sum ^= POLY >> j;
- CrcTable[i] = sum;
- }
- DEBUG(("crcinit: done\n"));
-}
-
-/*
- - hash - Honeyman's nice hashing function
- */
-static long
-hash(name, size)
-register char *name;
-register int size;
-{
- register long sum = 0L;
-
- while (size--) {
- sum = (sum >> 7) ^ CrcTable[(sum ^ (*name++)) & 0x7f];
- }
- DEBUG(("hash: returns (%ld)\n", sum));
- return(sum);
-}
-
-/*
- * case-mapping stuff
- *
- * Borrowed from C News, by permission of the authors. Somewhat modified.
- *
- * We exploit the fact that we are dealing only with headers here, and
- * headers are limited to the ASCII characters by RFC822. It is barely
- * possible that we might be dealing with a translation into another
- * character set, but in particular it's very unlikely for a header
- * character to be outside -128..255.
- *
- * Life would be a whole lot simpler if tolower() could safely and portably
- * be applied to any char.
- */
-
-#define OFFSET 128 /* avoid trouble with negative chars */
-
-/* must call casencmp before invoking TOLOW... */
-#define TOLOW(c) (cmap[(c)+OFFSET])
-
-/* ...but the use of it in CISTREQN is safe without the preliminary call (!) */
-/* CISTREQN is an optimised case-insensitive strncmp(a,b,n)==0; n > 0 */
-#define CISTREQN(a, b, n) \
- (TOLOW((a)[0]) == TOLOW((b)[0]) && casencmp(a, b, n) == 0)
-
-#define MAPSIZE (256+OFFSET)
-static char cmap[MAPSIZE]; /* relies on init to '\0' */
-static int mprimed = 0; /* has cmap been set up? */
-
-/*
- - mapprime - set up case-mapping stuff
- */
-static void
-mapprime()
-{
- register char *lp;
- register char *up;
- register int c;
- register int i;
- static char lower[] = "abcdefghijklmnopqrstuvwxyz";
- static char upper[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
-
- for (lp = lower, up = upper; *lp != '\0'; lp++, up++) {
- c = *lp;
- cmap[c+OFFSET] = c;
- cmap[*up+OFFSET] = c;
- }
- for (i = 0; i < MAPSIZE; i++)
- if (cmap[i] == '\0')
- cmap[i] = (char)(i-OFFSET);
- mprimed = 1;
-}
-
-/*
- - casencmp - case-independent strncmp
- */
-static int /* < == > 0 */
-casencmp(s1, s2, len)
-char *s1;
-char *s2;
-int len;
-{
- register char *p1;
- register char *p2;
- register int n;
-
- if (!mprimed)
- mapprime();
-
- p1 = s1;
- p2 = s2;
- n = len;
- while (--n >= 0 && *p1 != '\0' && TOLOW(*p1) == TOLOW(*p2)) {
- p1++;
- p2++;
- }
- if (n < 0)
- return(0);
-
- /*
- * The following case analysis is necessary so that characters
- * which look negative collate low against normal characters but
- * high against the end-of-string NUL.
- */
- if (*p1 == '\0' && *p2 == '\0')
- return(0);
- else if (*p1 == '\0')
- return(-1);
- else if (*p2 == '\0')
- return(1);
- else
- return(TOLOW(*p1) - TOLOW(*p2));
-}
-
-/*
- - mapcase - do case-mapped copy
- */
-static char * /* returns src or dst */
-mapcase(dst, src, siz)
-char *dst; /* destination, used only if mapping needed */
-char *src; /* source; src == dst is legal */
-size_t siz;
-{
- register char *s;
- register char *d;
- register char *c; /* case break */
- register char *e; /* end of source */
-
-
- c = cipoint(src, siz);
- if (c == NULL)
- return(src);
-
- if (!mprimed)
- mapprime();
- s = src;
- e = s + siz;
- d = dst;
-
- while (s < c)
- *d++ = *s++;
- while (s < e)
- *d++ = TOLOW(*s++);
-
- return(dst);
-}
-
-/*
- - cipoint - where in this message-ID does it become case-insensitive?
- *
- * The RFC822 code is not quite complete. Absolute, total, full RFC822
- * compliance requires a horrible parsing job, because of the arcane
- * quoting conventions -- abc"def"ghi is not equivalent to abc"DEF"ghi,
- * for example. There are three or four things that might occur in the
- * domain part of a message-id that are case-sensitive. They don't seem
- * to ever occur in real news, thank Cthulhu. (What? You were expecting
- * a merciful and forgiving deity to be invoked in connection with RFC822?
- * Forget it; none of them would come near it.)
- */
-static char * /* pointer into s, or NULL for "nowhere" */
-cipoint(s, siz)
-char *s;
-size_t siz;
-{
- register char *p;
- static char post[] = "postmaster";
- static int plen = sizeof(post)-1;
-
- switch (conf.casemap) {
- case '0': /* unmapped, sensible */
- return(NULL);
- break;
- case 'C': /* C News, RFC 822 conformant (approx.) */
- p = memchr(s, '@', siz);
- if (p == NULL) /* no local/domain split */
- return(NULL); /* assume all local */
- else if (p - (s+1) == plen && CISTREQN(s+1, post, plen)) {
- /* crazy -- "postmaster" is case-insensitive */
- return(s);
- } else
- return(p);
- break;
- case '=': /* 2.11, neither sensible nor conformant */
- return(s); /* all case-insensitive */
- break;
- }
-
- DEBUG(("cipoint: unknown case mapping `%c'\n", conf.casemap));
- return(NULL); /* just leave it alone */
-}
-
-/*
- - dbzdebug - control dbz debugging at run time
- */
-int /* old value */
-dbzdebug(value)
-int value;
-{
-#ifdef DBZDEBUG
- register int old = debug;
-
- debug = value;
- return(old);
-#else
- return(-1);
-#endif
-}
diff --git a/contrib/libio/dbz/dbz.h b/contrib/libio/dbz/dbz.h
deleted file mode 100644
index 3d7e8ed702cb..000000000000
--- a/contrib/libio/dbz/dbz.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/* for dbm and dbz */
-typedef struct {
- char *dptr;
- int dsize;
-} datum;
-
-/* standard dbm functions */
-extern int dbminit();
-extern datum fetch();
-extern int store();
-extern int delete(); /* not in dbz */
-extern datum firstkey(); /* not in dbz */
-extern datum nextkey(); /* not in dbz */
-extern int dbmclose(); /* in dbz, but not in old dbm */
-
-/* new stuff for dbz */
-extern int dbzfresh();
-extern int dbzagain();
-extern datum dbzfetch();
-extern int dbzstore();
-extern int dbzsync();
-extern long dbzsize();
-extern int dbzincore();
-extern int dbzcancel();
-extern int dbzdebug();
-
-/*
- * In principle we could handle unlimited-length keys by operating a chunk
- * at a time, but it's not worth it in practice. Setting a nice large
- * bound on them simplifies the code and doesn't hurt anything.
- */
-#define DBZMAXKEY 255
diff --git a/contrib/libio/dbz/dbzmain.c b/contrib/libio/dbz/dbzmain.c
deleted file mode 100644
index a393d6432bdd..000000000000
--- a/contrib/libio/dbz/dbzmain.c
+++ /dev/null
@@ -1,519 +0,0 @@
-/*
- * dbz - use and test dbz in various ways
- *
- * -Log-
- */
-
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <string.h>
-#include <dbz.h>
-
-#ifdef FUNNYSEEKS
-#include <unistd.h>
-#else
-#define SEEK_SET 0
-#endif
-
-#define STREQ(a, b) (*(a) == *(b) && strcmp((a), (b)) == 0)
-
-#ifndef lint
-static char RCSid[] = "$Header: /egcs/carton/cvsfiles/egcs/./libio/dbz/dbzmain.c,v 1.1.1.1 1997/08/21 22:58:23 jason Exp $";
-#endif
-
-char *progname;
-
-char *inname = "(no file)"; /* filename for messages etc. */
-long lineno; /* line number for messages etc. */
-
-char *my_basename;
-char *pagname;
-char *dir_name;
-char *str2dup();
-FILE *base;
-
-int op = 'b'; /* what to do, default build a new table */
-int baseinput = 1; /* is the base file also the input? */
-
-char *from = NULL; /* old table to use for dbzagain() */
-int omitzero = 0; /* omit lines tagged with 0 */
-long every = 0; /* report every n lines */
-int syncs = 0; /* dbzsync() on each report */
-int quick = 0; /* quick checking, not too thorough */
-int sweep = 0; /* sweep file checking all offsets */
-int useincore = 1; /* should we use incore facility? */
-long xxx = 0; /* debugging variable */
-int printx = 0; /* print xxx after all is done */
-int unique = 1; /* before store(), check with fetch() */
-int usefresh = 0; /* use dbzfresh? */
-long siz = 0; /* -p size */
-char map = 'C'; /* -p map */
-long tag = 0; /* -p tag mask */
-int exact = 0; /* do not run dbzsize(siz) */
-int dbzint = 1; /* use new interface? */
-char fs = '\t'; /* field separator, default tab */
-int unopen = 0; /* make base unopenable during dbminit? */
-char *change = NULL; /* chdir here before dbmclose */
-
-#define DEFBUF 1024 /* default line-buffer size */
-int buflen = DEFBUF; /* line length limit */
-char lbuf[DEFBUF];
-char *line = lbuf;
-char cbuf[DEFBUF];
-char *cmp = cbuf;
-
-void fail();
-void dofile();
-void runs();
-void dosweep();
-void mkfiles();
-void crfile();
-void doline();
-void process();
-
-#ifdef HAVERFCIZE
-extern char *rfc822ize();
-#else
-#define rfc822ize(n) (n)
-#endif
-
-extern char *malloc();
-
-/*
- - main - parse arguments and handle options
- */
-int
-main(argc, argv)
-int argc;
-char *argv[];
-{
- int c;
- int errflg = 0;
- extern int optind;
- extern char *optarg;
- int doruns = 0;
- extern long atol();
-
- progname = argv[0];
-
- while ((c = getopt(argc, argv, "axcmt:l:R0E:SqOiX:Yuf:p:eMUC:d")) != EOF)
- switch (c) {
- case 'a': /* append to existing table */
- if (op != 'b')
- fail("only one of -a -x -c -m can be given", "");
- op = 'a';
- baseinput = 0;
- break;
- case 'x': /* extract from existing table */
- if (op != 'b')
- fail("only one of -a -x -c -m can be given", "");
- op = 'x';
- baseinput = 0;
- break;
- case 'c': /* check existing table */
- if (op != 'b')
- fail("only one of -a -x -c -m can be given", "");
- op = 'c';
- break;
- case 'm': /* extract missing (complement of -x) */
- if (op != 'b')
- fail("only one of -a -x -c -m can be given", "");
- op = 'm';
- baseinput = 0;
- break;
- case 't': /* set field separator */
- if (strlen(optarg) > 1)
- fail("only one field separator allowed", "");
- fs = *optarg;
- break;
- case 'l': /* override line-length limit */
- buflen = atoi(optarg) + 1;
- if (buflen <= 2)
- fail("bad -l value `%s'", optarg);
- line = malloc(buflen);
- cmp = malloc(buflen);
- if (line == NULL || cmp == NULL)
- fail("cannot allocate %s-byte buffers", optarg);
- break;
- case 'R': /* print run statistics */
- doruns = 1;
- break;
- case '0': /* omit lines tagged (by fake -t) with 0 */
- omitzero = 1;
- break;
- case 'E': /* report every n items */
- every = atol(optarg);
- break;
- case 'S': /* dbzsync() on each -E report */
- syncs = 1;
- break;
- case 'q': /* quick check or extract */
- quick = 1;
- break;
- case 'O': /* sweep file checking all offsets */
- sweep = 1;
- break;
- case 'i': /* don't use incore */
- useincore = 0;
- break;
- case 'X': /* set xxx */
- xxx = atoi(optarg);
- break;
- case 'Y': /* print xxx afterward */
- printx = 1;
- break;
- case 'u': /* don't check uniqueness */
- unique = 0;
- break;
- case 'f': /* init from existing table's parameters */
- from = optarg;
- break;
- case 'p': /* parameters for dbzfresh */
- if (sscanf(optarg, "%ld %1s %lx", &siz, &map, &tag) != 3) {
- map = '?';
- tag = 0;
- if (sscanf(optarg, "%ld", &siz) != 1)
- fail("bad -n value `%s'", optarg);
- }
- usefresh = 1;
- break;
- case 'e': /* -p size is exact, don't dbzsize() it */
- exact = 1;
- break;
- case 'M': /* use old dbm interface + rfc822ize */
- dbzint = 0;
- break;
- case 'U': /* make base unopenable during init */
- unopen = 1;
- break;
- case 'C': /* change directories before dbmclose */
- change = optarg;
- break;
- case 'd': /* Debugging. */
- if (dbzdebug(1) < 0)
- fail("dbz debugging not available", "");
- break;
- case '?':
- default:
- errflg++;
- break;
- }
- if (errflg || optind >= argc || (optind+1 < argc && baseinput)) {
- fprintf(stderr, "usage: %s ", progname);
- fprintf(stderr, "[-a] [-x] [-c] database [file] ...\n");
- exit(2);
- }
-
- (void) dbzincore(useincore);
- my_basename = argv[optind];
- pagname = str2dup(my_basename, ".pag");
- dir_name = str2dup(my_basename, ".dir");
- mkfiles();
- optind++;
-
- if (baseinput) /* implies no further arguments */
- process(base, my_basename);
- else if (optind >= argc)
- process(stdin, "stdin");
- else
- for (; optind < argc; optind++)
- dofile(argv[optind]);
-
- if (change != NULL)
- (void) chdir(change);
- if (dbmclose() < 0)
- fail("dbmclose failed", "");
- if (doruns)
- runs(pagname);
- if (sweep)
- dosweep(my_basename, pagname);
- if (printx)
- printf("%ld\n", xxx);
-#ifdef DBZ_FINISH
- DBZ_FINISH;
-#endif
- exit(0);
-}
-
-/*
- - dofile - open a file and invoke process()
- */
-void
-dofile(name)
-char *name;
-{
- register FILE *in;
-
- if (STREQ(name, "-"))
- process(stdin, "-");
- else {
- in = fopen(name, "r");
- if (in == NULL)
- fail("cannot open `%s'", name);
- process(in, name);
- (void) fclose(in);
- }
-}
-
-/*
- - mkfiles - create empty files and open them up
- */
-void
-mkfiles()
-{
- if (op == 'b' && !dbzint) {
- crfile(dir_name);
- crfile(pagname);
- }
-
- base = fopen(my_basename, (op == 'a') ? "a" : "r");
- if (base == NULL)
- fail("cannot open `%s'", my_basename);
- if (unopen)
- (void) chmod(my_basename, 0);
- if (from != NULL) {
- if (dbzagain(my_basename, from) < 0)
- fail("dbzagain(`%s'...) failed", my_basename);
- } else if (op == 'b' && dbzint) {
- if (!exact)
- siz = dbzsize(siz);
- if (dbzfresh(my_basename, siz, (int)fs, map, (off_t)tag) < 0)
- fail("dbzfresh(`%s'...) failed", my_basename);
- } else if (dbminit(my_basename) < 0)
- fail("dbminit(`%s') failed", my_basename);
- if (unopen)
- (void) chmod(my_basename, 0600); /* hard to restore original */
-}
-
-/*
- - crfile - create a file
- */
-void
-crfile(name)
-char *name;
-{
- register int f;
-
- f = creat(name, 0666);
- if (f < 0)
- fail("cannot create `%s'", name);
- (void) close(f);
-}
-
-/*
- - process - process input file
- */
-void
-process(in, name)
-FILE *in;
-char *name;
-{
- register off_t place;
-
- inname = name;
- lineno = 0;
-
- for (;;) {
- place = ftell(in);
- if (fgets(line, buflen, in) == NULL)
- return;
- lineno++;
- if (every > 0 && lineno%every == 0) {
- fprintf(stderr, "%ld\n", lineno);
- if (dbzsync() < 0)
- fail("dbzsync failed", "");
- }
- doline(line, place);
- }
- /* NOTREACHED */
-}
-
-/*
- - doline - process input line
- */
-void
-doline(lp, inoffset)
-char *lp;
-off_t inoffset;
-{
- register char *p;
- register char pc;
- datum key, value;
- off_t place = inoffset;
- register int shouldfind;
- register int llen;
- char keytext[DBZMAXKEY+1];
-
- p = NULL;
- if (fs != '\0')
- p = strchr(lp, fs);
- if (p == NULL)
- p = lp + strlen(lp);
- if (p > lp && *(p-1) == '\n')
- p--;
- if (p - lp > DBZMAXKEY)
- fail("key of `%.40s...' too long", lp);
- pc = *p;
- *p = '\0';
- (void) strcpy(keytext, lp);
- *p = pc;
- key.dptr = (dbzint) ? keytext : rfc822ize(keytext);
- key.dsize = strlen(keytext)+1;
-
- switch (op) {
- case 'a':
- place = ftell(base);
- llen = strlen(lp);
- if (fwrite(lp, 1, llen, base) != llen)
- fail("write error in `%s'", my_basename);
- /* FALLTHROUGH */
- case 'b':
- if (omitzero && p != NULL && *(p+1) == '0')
- return;
- if (unique) {
- value = (dbzint) ? dbzfetch(key) : fetch(key);
- if (value.dptr != NULL)
- fail("`%.40s...' already present", lp);
- }
- value.dptr = (char *)&place;
- value.dsize = (int)sizeof(off_t);
- if (((dbzint) ? dbzstore(key, value) : store(key, value)) < 0)
- fail("store failed on `%.40s...'", lp);
- break;
- case 'c':
- value = (dbzint) ? dbzfetch(key) : fetch(key);
- shouldfind = (omitzero && p != NULL && *(p+1) == '0') ? 0 : 1;
- if (!shouldfind && (value.dptr != NULL || value.dsize != 0))
- fail("`%.40s...' found, shouldn't be", lp);
- if (shouldfind && (value.dptr == NULL ||
- value.dsize != sizeof(off_t)))
- fail("can't find `%.40s...'", lp);
- if (shouldfind && !quick) {
- (void) memcpy((char *)&place, value.dptr, sizeof(off_t));
- if (place != inoffset)
- fail("offset mismatch on `%.40s...'", lp);
- if (fseek(base, place, SEEK_SET) == -1)
- fail("fseek failed on `%.40s...'", lp);
- if (fgets(cmp, buflen, base) == NULL)
- fail("can't read line for `%.40s...'", lp);
- if (!STREQ(lp, cmp))
- fail("compare failed on `%.40s...'", lp);
- }
- break;
- case 'x':
- value = (dbzint) ? dbzfetch(key) : fetch(key);
- if (value.dptr != NULL && !quick) {
- (void) memcpy((char *)&place, value.dptr, sizeof(off_t));
- if (fseek(base, place, SEEK_SET) == -1)
- fail("fseek failed on `%.40s...'", lp);
- if (fgets(cmp, buflen, base) == NULL)
- fail("can't read line for `%.40s...'", lp);
- fputs(cmp, stdout);
- } else if (value.dptr != NULL)
- fputs(lp, stdout);
- break;
- case 'm':
- value = (dbzint) ? dbzfetch(key) : fetch(key);
- if (value.dptr == NULL) {
- fputs(keytext, stdout);
- putchar('\n');
- }
- break;
- default:
- fail("unknown operator -- can't happen", "");
- break;
- }
-}
-
-/*
- - runs - print run statistics
- */
-void
-runs(file)
-char *file;
-{
- register FILE *fd;
- off_t it;
- register long run;
-
- fd = fopen(file, "r");
- if (fd == NULL)
- fail("cannot reopen `%s'", file);
- run = 0;
- while (fread((char *)&it, sizeof(off_t), 1, fd) == 1) {
- if (it != 0)
- run++;
- else if (run > 0) {
- printf("%ld\n", run);
- run = 0;
- }
- }
- (void) fclose(fd);
-}
-
-/*
- - dosweep - sweep pag file checking for valid offsets
- */
-void
-dosweep(fn, pn)
-char *fn;
-char *pn;
-{
- register FILE *pf;
- off_t it;
- char nl;
- register FILE *hf;
-
- hf = fopen(fn, "r");
- if (hf == NULL)
- fail("cannot reopen `%s'", fn);
- pf = fopen(pn, "r");
- if (pf == NULL)
- fail("cannot reopen `%s'", pn);
- while (fread((char *)&it, sizeof(off_t), 1, pf) == 1) {
- it = (it & ((off_t)0x80000000)) ? (it&~((off_t)0xff000000)) : it;
- if (it != 0 && it != 1) { /* 0 empty, 1 known okay */
- it--; /* get rid of bias */
- (void) fseek(hf, it-1, SEEK_SET);
- nl = getc(hf);
- if (nl != '\n')
- fprintf(stderr, "offset 0%lo does not point to line\n",
- (long)it);
- }
- }
- (void) fclose(hf);
- (void) fclose(pf);
-}
-
-/*
- - fail - complain and die
- */
-void
-fail(s1, s2)
-char *s1;
-char *s2;
-{
- fprintf(stderr, "%s: (file `%s', line %ld) ", progname, inname, lineno);
- fprintf(stderr, s1, s2);
- fprintf(stderr, "\n");
- exit(1);
-}
-
-/*
- - str2dup - concatenate strings and malloc result
- */
-char *
-str2dup(s1, s2)
-char *s1;
-char *s2;
-{
- register char *p;
-
- p = malloc((size_t)strlen(s1) + strlen(s2) + 1);
- if (p == NULL)
- fail("can't allocate space for strings", "");
- (void) strcpy(p, s1);
- (void) strcat(p, s2);
- return(p);
-}
diff --git a/contrib/libio/dbz/fake.c b/contrib/libio/dbz/fake.c
deleted file mode 100644
index ed2a2b759376..000000000000
--- a/contrib/libio/dbz/fake.c
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * fake - make up random lines resembling history-file entries, reproducibly
- *
- * -Log-
- */
-
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <string.h>
-
-#define MAXSTR 500 /* For sizing strings -- DON'T use BUFSIZ! */
-#define STREQ(a, b) (*(a) == *(b) && strcmp((a), (b)) == 0)
-
-#ifndef lint
-static char RCSid[] = "$Header: /rel/cvsfiles/devo/libio/dbz/fake.c,v 1.2 1993/10/25 20:02:42 bothner Exp $";
-#endif
-
-int midonly = 0; /* just message ids, rest not realistic */
-int tag = 0; /* tag lines with random digit for later use */
-int expired = -1; /* percentage of lines to be expired */
-
-int debug = 0;
-char *progname;
-
-char *inname; /* filename for messages etc. */
-long lineno; /* line number for messages etc. */
-
-void doline();
-void addchars();
-void seed();
-
-/*
- - main - parse arguments and handle options
- */
-int
-main(argc, argv)
-int argc;
-char *argv[];
-{
- int c;
- int errflg = 0;
- FILE *in;
- struct stat statbuf;
- extern int optind;
- extern char *optarg;
- void process();
- register long no;
- extern long atol();
- char line[MAXSTR];
-
- progname = argv[0];
-
- while ((c = getopt(argc, argv, "ms:te:d")) != EOF)
- switch (c) {
- case 'm': /* message-ids only */
- midonly = 1;
- break;
- case 's': /* seed */
- seed(atol(optarg));
- break;
- case 't': /* tag lines with a random digit */
- tag = 1;
- break;
- case 'e': /* percentage to be expired */
- expired = atoi(optarg);
- break;
- case 'd': /* Debugging. */
- debug++;
- break;
- case '?':
- default:
- errflg++;
- break;
- }
- if (errflg || optind != argc - 1) {
- fprintf(stderr, "usage: %s ", progname);
- fprintf(stderr, "[-m] [-s seed] length\n");
- exit(2);
- }
-
- for (no = atol(argv[optind]); no > 0; no--) {
- doline(line);
- puts(line);
- }
-#ifdef DBZ_FINISH
- DBZ_FINISH;
-#endif
- exit(0);
-}
-
-/*
- - doline - generate random history pseudo-line
- */
-void
-doline(buf)
-char *buf;
-{
- char tagch[2];
-
- (void) strcpy(buf, "<");
- addchars(buf, range(4, 20));
- (void) strcat(buf, "@");
- addchars(buf, range(8, 20));
- if (midonly)
- (void) strcat(buf, ">\tx");
- else {
- if (tag) {
- tagch[0] = "1234567890"[range(0,9)];
- tagch[1] = '\0';
- (void) strcat(buf, ">\t");
- (void) strcat(buf, tagch);
- (void) strcat(buf, "00000000~-");
- } else
- (void) strcat(buf, ">\t1234567890~-");
- }
- if (range(1, 100) > expired) {
- if (midonly)
- (void) strcat(buf, "\tx");
- else {
- (void) strcat(buf, "\t");
- addchars(buf, range(10, 30));
- }
- }
-}
-
-/*
- - addchars - generate n random characters suitable for history file
- */
-void
-addchars(buf, len)
-char *buf;
-int len;
-{
- register int i;
- register char *p = buf + strlen(buf);
- static char vocab[] = "1234567890.abcde.fghij.klmno.pqrst.uvwxyz.\
-1234567890.ABCDE.FGHIJ.KLMNO.PQRST.UVWXYZ.1234567890.\
-1234567890.abcde.fghij.klmno.pqrst.uvwxyz.1234567890";
-
- for (i = len; i > 0; i--)
- *p++ = vocab[range(0, sizeof(vocab)-2)];
- *p++ = '\0';
-}
diff --git a/contrib/libio/dbz/firstlast25 b/contrib/libio/dbz/firstlast25
deleted file mode 100644
index 4850468c0c2a..000000000000
--- a/contrib/libio/dbz/firstlast25
+++ /dev/null
@@ -1,50 +0,0 @@
-<m....VO1.9q.@s95e1zKsIj7LrIwa1> 600000000~- 90fz0706yo.1Env21x8b
-<H5.i.R6ZQ2@Vg6.5mqj8..z> 200000000~-
-<1Hy.ufmjqe371x5.o@HEEl0tAp4> 700000000~-
-<T6.c9.xM4i@943..7z.c..3h> 600000000~-
-<Exus7LsME4fPL9v8@2.ouu97O25z9cdft> 700000000~-
-<6kUzkf.v74@iC1iGj882RQ0zli> 400000000~-
-<J.7YT7dV.Kkul8Bh0fc@Rar.EnMx2lm0.6Yeob> 600000000~-
-<.wVJi1DX42@5.4i6.jaZ6qw9Ln1.> 500000000~-
-<uUd9e18vxzevae7uY@33a480208l0.4p2q> 300000000~-
-<43hQ.5shbE7@912400.ajES6x0sXl.M> 400000000~-
-<g25r..2r.0WOZ6k3@tb3.U9xrR.uw61a2y0> 600000000~-
-<923s5e67d5Oq085Y.1@6Pik68584> 900000000~-
-<.5.n5cx5aD62i9q8@Ai60Sc.4x> 200000000~-
-<9N9n@3.1ql87.yj2xFs.zLqI> 700000000~- Q2.kni8kZps7kF5uiEv32B38y4z.p
-<.X.fw.6LtoT.0@pp6bp.5s6yh74.> 400000000~-
-<54c1w@7..u1.99m9T4j.BNGBiK> 600000000~- .F3hb.OFh06V..p
-<j12Mtn6q9@m2.m1X1s> 500000000~-
-<o1WJV9G4H.zf0BX44w@W7.76xn33> 000000000~-
-<0C605s6plaAgfM.ap40@e6d66n.uv01W.j.8ph.> 100000000~- m.x7TY8.8DQ5
-<.2.14xdn.@D0g.W.uZ.75gyyg.q1G> 100000000~-
-<.A..03.@5v..64.5v3.3tbjUo.> 500000000~-
-<72..c19ms65.WCf0G3.@83seEG9nnhM.O.j22> 900000000~-
-<D..xX.kti9@u739li.xvy2> 000000000~- NPLL42XVfM
-<6HO.nFal1ufl3.8b@3.n0k7a.IDgNy> 700000000~- Wv4j3Itccnh0Zp3
-<x5RjUnIpd03xBBnuN@z0puc82Q26Ou.0T6> 400000000~- k67.hvXwv6X745R4rh2ybuFN3n.
-<62dIeg.fW92.ov375@x76mf5c6.37.v> 000000000~-
-<chdpqs.0mgZOp.@Dxl9v..94e7ar2> 900000000~-
-<.9Xr.7V91..oe5CG.hX@p5x3jos3s27R6O3yj1> 400000000~-
-<Mm6dr.231dH35ua@SE1u0za3V1M43lRn9> 100000000~-
-<JIhw2@.Qdf.8v28Tnf1M> 200000000~-
-<z4FCa.q4MF..EE0.2@W9U63e33h9w3lcFFl> 400000000~-
-<87.W3r6is4.@svVqQCBiNqz400A.qwj> 200000000~-
-<0liI7Lu0Mx435m7M99@87Xw.8j63.9.> 500000000~-
-<tRtht5M.6d0@06gj.qm3.s9> 200000000~- e27S.BKVD70P.o
-<Jpga8@m68yvw.b4b> 200000000~-
-<.2.69hy3JT1@Aq3.r83o.9> 700000000~-
-<.W7EurYppo4fhzs.I@8651m2W7v> 700000000~-
-<3m02.@22074.a5ct2j3> 900000000~-
-<.fy9Epa@.1.kNGCNokFwB8ezo1WM> 800000000~-
-<c758d64.FS4yY7L5@43sw.kI6> 900000000~-
-<vLd0.t@.kq70oHl96ixdnXd.GVv> 100000000~- 9A6Ejq5t55I4VJ6.q1
-<d3.4@n17p4N.77N7W..7.8> 300000000~-
-<f2lv064.8@4jokk3e07> 400000000~-
-<rr7hoxA.U7.JXxnpvd@1rbMO437vHnakx> 000000000~-
-<.0p3G7novlrYz9kjI@Sx.2w.yqzerZl12781.k> 700000000~-
-<51ny.pQ7ay4@nfU2l1f0ixG09584.m> 000000000~- 38K5bhK7cr6.bg.5MlC2Fxq06Ziuw.
-<2.cau.9s@.n4Pk0Jd9g> 300000000~-
-<bEH1Bwa.662i@zm.3g.gx4.lp3> 300000000~- c8.t4Q0.8t0.m50
-<.t13789u5AqM4m3.z0T@P17e.ypf> 200000000~- q17z.fZ3.FyD533WthqZs8q7
-<M4r1I@Ovaev.dp> 100000000~-
diff --git a/contrib/libio/dbz/getmap b/contrib/libio/dbz/getmap
deleted file mode 100755
index fd746cad7d95..000000000000
--- a/contrib/libio/dbz/getmap
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-awk 'NR == 1 {
- for (i = 9; i <= NF; i++)
- printf "%s ", $i
- printf "\n"
-}' $*
diff --git a/contrib/libio/dbz/random.c b/contrib/libio/dbz/random.c
deleted file mode 100644
index 1d8de3a2b44d..000000000000
--- a/contrib/libio/dbz/random.c
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * random-number generator for testing
- */
-static unsigned long next = 1;
-
-/*
- - range - generate a random number within an inclusive range
- *
- * Algorithm from ANSI C standard. Limitation: max-min <= 32767.
- */
-int
-range(min, max)
-int min;
-int max;
-{
- register int temp;
-
- next = next * 1103515245 + 12345;
- temp = (int)((next/65536)%32768);
- return(temp%(max - min + 1) + min);
-}
-
-/*
- - seed - seed random number generator
- */
-void
-seed(n)
-long n;
-{
- next = (unsigned long)n;
-}
diff --git a/contrib/libio/dbz/revbytes b/contrib/libio/dbz/revbytes
deleted file mode 100644
index b3d80c2685fb..000000000000
--- a/contrib/libio/dbz/revbytes
+++ /dev/null
@@ -1,7 +0,0 @@
-NR == 1 {
- printf "%s %s %s %s %s %s %s %s %s", $1, $2, $3, $4, $5, $6, $7, $8, $9
- for (i = NF; i > 9; i--)
- printf " %s", $i
- printf "\n"
-}
-NR > 1 { print }
diff --git a/contrib/libio/dbz/stdio.h b/contrib/libio/dbz/stdio.h
deleted file mode 100644
index 80faee30ad96..000000000000
--- a/contrib/libio/dbz/stdio.h
+++ /dev/null
@@ -1 +0,0 @@
-#include "../iostdio.h"
diff --git a/contrib/libio/depend b/contrib/libio/depend
deleted file mode 100644
index 15888c4574a7..000000000000
--- a/contrib/libio/depend
+++ /dev/null
@@ -1,379 +0,0 @@
-# AUTOMATICALLY GENERATED BY 'make depend' - DO NOT EDIT
-
-PlotFile.o: PlotFile.cc \
- $(srcdir)/PlotFile.h \
- $(srcdir)/fstream.h \
- $(srcdir)/iostream.h \
- $(srcdir)/streambuf.h \
- $(srcdir)/libio.h $(_G_CONFIG_H)
-SFile.o: SFile.cc \
- $(srcdir)/SFile.h \
- $(srcdir)/fstream.h \
- $(srcdir)/iostream.h \
- $(srcdir)/streambuf.h \
- $(srcdir)/libio.h $(_G_CONFIG_H)
-builtinbuf.o: builtinbuf.cc \
- $(srcdir)/builtinbuf.h \
- $(srcdir)/streambuf.h \
- $(srcdir)/libio.h $(_G_CONFIG_H) \
- $(srcdir)/iostreamP.h \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h
-editbuf.o: editbuf.cc \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h $(_G_CONFIG_H) \
- $(srcdir)/editbuf.h \
- $(srcdir)/fstream.h \
- $(srcdir)/iostream.h \
- $(srcdir)/streambuf.h
-filebuf.o: filebuf.cc \
- $(srcdir)/iostreamP.h \
- $(srcdir)/streambuf.h \
- $(srcdir)/libio.h $(_G_CONFIG_H) \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/builtinbuf.h
-fstream.o: fstream.cc \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h $(_G_CONFIG_H) \
- $(srcdir)/fstream.h \
- $(srcdir)/iostream.h \
- $(srcdir)/streambuf.h
-indstream.o: indstream.cc \
- $(srcdir)/indstream.h \
- $(srcdir)/iostream.h \
- $(srcdir)/streambuf.h \
- $(srcdir)/libio.h $(_G_CONFIG_H)
-ioassign.o: ioassign.cc \
- $(srcdir)/iostream.h \
- $(srcdir)/streambuf.h \
- $(srcdir)/libio.h $(_G_CONFIG_H) \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h
-ioextend.o: ioextend.cc \
- $(srcdir)/iostream.h \
- $(srcdir)/streambuf.h \
- $(srcdir)/libio.h $(_G_CONFIG_H)
-iomanip.o: iomanip.cc \
- $(srcdir)/iomanip.h \
- $(srcdir)/iostream.h \
- $(srcdir)/streambuf.h \
- $(srcdir)/libio.h $(_G_CONFIG_H)
-iostream.o: iostream.cc \
- $(srcdir)/iostream.h \
- $(srcdir)/streambuf.h \
- $(srcdir)/libio.h $(_G_CONFIG_H) \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/floatio.h
-isgetline.o: isgetline.cc \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h $(_G_CONFIG_H) \
- $(srcdir)/iostream.h \
- $(srcdir)/streambuf.h
-isgetsb.o: isgetsb.cc \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h $(_G_CONFIG_H) \
- $(srcdir)/iostream.h \
- $(srcdir)/streambuf.h
-isscan.o: isscan.cc \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h $(_G_CONFIG_H) \
- $(srcdir)/iostream.h \
- $(srcdir)/streambuf.h
-osform.o: osform.cc \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h $(_G_CONFIG_H) \
- $(srcdir)/iostream.h \
- $(srcdir)/streambuf.h
-parsestream.o: parsestream.cc \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h $(_G_CONFIG_H) \
- $(srcdir)/parsestream.h \
- $(srcdir)/streambuf.h
-pfstream.o: pfstream.cc \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h $(_G_CONFIG_H) \
- $(srcdir)/pfstream.h \
- $(srcdir)/fstream.h \
- $(srcdir)/iostream.h \
- $(srcdir)/streambuf.h \
- $(srcdir)/procbuf.h
-procbuf.o: procbuf.cc \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h $(_G_CONFIG_H) \
- $(srcdir)/procbuf.h \
- $(srcdir)/streambuf.h
-sbform.o: sbform.cc \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h $(_G_CONFIG_H) \
- $(srcdir)/streambuf.h
-sbgetline.o: sbgetline.cc \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h $(_G_CONFIG_H) \
- $(srcdir)/streambuf.h
-sbscan.o: sbscan.cc \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h $(_G_CONFIG_H) \
- $(srcdir)/streambuf.h
-stdiostream.o: stdiostream.cc \
- $(srcdir)/stdiostream.h \
- $(srcdir)/iostream.h \
- $(srcdir)/streambuf.h \
- $(srcdir)/libio.h $(_G_CONFIG_H) \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h
-stdstrbufs.o: stdstrbufs.cc \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h $(_G_CONFIG_H) \
- $(srcdir)/stdiostream.h \
- $(srcdir)/iostream.h \
- $(srcdir)/streambuf.h
-stdstreams.o: stdstreams.cc \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h $(_G_CONFIG_H) \
- $(srcdir)/streambuf.h \
- $(srcdir)/iostream.h
-stream.o: stream.cc \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h $(_G_CONFIG_H) \
- $(srcdir)/stream.h \
- $(srcdir)/iostream.h \
- $(srcdir)/streambuf.h \
- $(srcdir)/strstream.h \
- $(srcdir)/strfile.h
-streambuf.o: streambuf.cc \
- $(srcdir)/iostreamP.h \
- $(srcdir)/streambuf.h \
- $(srcdir)/libio.h $(_G_CONFIG_H) \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h
-strstream.o: strstream.cc \
- $(srcdir)/iostreamP.h \
- $(srcdir)/streambuf.h \
- $(srcdir)/libio.h $(_G_CONFIG_H) \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/strstream.h \
- $(srcdir)/iostream.h \
- $(srcdir)/strfile.h
-cleanup.o: cleanup.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h $(_G_CONFIG_H)
-filedoalloc.o: filedoalloc.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h $(_G_CONFIG_H)
-fileops.o: fileops.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h $(_G_CONFIG_H)
-floatconv.o: floatconv.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h $(_G_CONFIG_H)
-genops.o: genops.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h $(_G_CONFIG_H)
-iofclose.o: iofclose.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h $(_G_CONFIG_H)
-iofdopen.o: iofdopen.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h $(_G_CONFIG_H)
-iofeof.o: iofeof.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h $(_G_CONFIG_H)
-ioferror.o: ioferror.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h $(_G_CONFIG_H)
-iofflush.o: iofflush.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h $(_G_CONFIG_H)
-iofflush_u.o: iofflush_u.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h $(_G_CONFIG_H)
-iofgetpos.o: iofgetpos.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h $(_G_CONFIG_H)
-iofgets.o: iofgets.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h $(_G_CONFIG_H)
-iofopen.o: iofopen.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h $(_G_CONFIG_H)
-iofprintf.o: iofprintf.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h $(_G_CONFIG_H)
-iofputs.o: iofputs.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h $(_G_CONFIG_H)
-iofread.o: iofread.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h $(_G_CONFIG_H)
-iofscanf.o: iofscanf.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h $(_G_CONFIG_H)
-iofsetpos.o: iofsetpos.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h $(_G_CONFIG_H)
-ioftell.o: ioftell.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h $(_G_CONFIG_H)
-iofwrite.o: iofwrite.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h $(_G_CONFIG_H)
-iogetc.o: iogetc.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h $(_G_CONFIG_H)
-iogetdelim.o: iogetdelim.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h $(_G_CONFIG_H)
-iogetline.o: iogetline.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h $(_G_CONFIG_H)
-iogets.o: iogets.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h $(_G_CONFIG_H)
-ioignore.o: ioignore.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h $(_G_CONFIG_H)
-iopadn.o: iopadn.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h $(_G_CONFIG_H)
-ioperror.o: ioperror.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h $(_G_CONFIG_H)
-iopopen.o: iopopen.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h $(_G_CONFIG_H)
-ioprims.o: ioprims.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h $(_G_CONFIG_H)
-ioprintf.o: ioprintf.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h $(_G_CONFIG_H)
-ioputc.o: ioputc.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h $(_G_CONFIG_H)
-ioputs.o: ioputs.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h $(_G_CONFIG_H)
-ioscanf.o: ioscanf.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h $(_G_CONFIG_H)
-ioseekoff.o: ioseekoff.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h $(_G_CONFIG_H)
-ioseekpos.o: ioseekpos.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h $(_G_CONFIG_H)
-iosetbuffer.o: iosetbuffer.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h $(_G_CONFIG_H)
-iosetvbuf.o: iosetvbuf.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h $(_G_CONFIG_H)
-iosprintf.o: iosprintf.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h $(_G_CONFIG_H)
-iosscanf.o: iosscanf.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h $(_G_CONFIG_H)
-iostrerror.o: iostrerror.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h $(_G_CONFIG_H)
-ioungetc.o: ioungetc.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h $(_G_CONFIG_H)
-iovfprintf.o: iovfprintf.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h $(_G_CONFIG_H) \
- $(srcdir)/floatio.h
-iovfscanf.o: iovfscanf.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h $(_G_CONFIG_H) \
- $(srcdir)/floatio.h
-iovsprintf.o: iovsprintf.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h $(_G_CONFIG_H) \
- $(srcdir)/strfile.h
-iovsscanf.o: iovsscanf.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h $(_G_CONFIG_H) \
- $(srcdir)/strfile.h
-outfloat.o: outfloat.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h $(_G_CONFIG_H)
-peekc.o: peekc.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h $(_G_CONFIG_H)
-stdfiles.o: stdfiles.c \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h \
- $(srcdir)/libio.h $(_G_CONFIG_H)
-strops.o: strops.c \
- $(srcdir)/strfile.h \
- $(srcdir)/libio.h $(_G_CONFIG_H) \
- $(srcdir)/libioP.h \
- $(srcdir)/iolibio.h
diff --git a/contrib/libio/editbuf.cc b/contrib/libio/editbuf.cc
deleted file mode 100644
index 22304820f8fd..000000000000
--- a/contrib/libio/editbuf.cc
+++ /dev/null
@@ -1,717 +0,0 @@
-/* This is part of libio/iostream, providing -*- C++ -*- input/output.
-Copyright (C) 1993 Free Software Foundation
-
-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.
-
-Written by Per Bothner (bothner@cygnus.com). */
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include "libioP.h"
-#include "editbuf.h"
-#include <stddef.h>
-#include <stdlib.h>
-
-/* NOTE: Some of the code here is taken from GNU emacs */
-/* Hence this file falls under the GNU License! */
-
-// Invariants for edit_streambuf:
-// An edit_streambuf is associated with a specific edit_string,
-// which again is a sub-string of a specific edit_buffer.
-// An edit_streambuf is always in either get mode or put mode, never both.
-// In get mode, gptr() is the current position,
-// and pbase(), pptr(), and epptr() are all NULL.
-// In put mode, pptr() is the current position,
-// and eback(), gptr(), and egptr() are all NULL.
-// Any edit_streambuf that is actively doing insertion (as opposed to
-// replacing) // must have its pptr() pointing to the start of the gap.
-// Only one edit_streambuf can be actively inserting into a specific
-// edit_buffer; the edit_buffer's _writer field points to that edit_streambuf.
-// That edit_streambuf "owns" the gap, and the actual start of the
-// gap is the pptr() of the edit_streambuf; the edit_buffer::_gap_start pointer
-// will only be updated on an edit_streambuf::overflow().
-
-int edit_streambuf::truncate()
-{
- str->buffer->delete_range(str->buffer->tell((buf_char*)pptr()),
- str->buffer->tell(str->end));
- return 0;
-}
-
-#ifdef OLD_STDIO
-inline void disconnect_gap_from_file(edit_buffer* buffer, FILE* fp)
-{
- if (buffer->gap_start_ptr != &fp->__bufp)
- return;
- buffer->gap_start_normal = fp->__bufp;
- buffer->gap_start_ptr = &buffer->gap_start_normal;
-}
-#endif
-
-void edit_streambuf::flush_to_buffer(edit_buffer* buffer)
-{
- if (pptr() > buffer->_gap_start && pptr() < buffer->gap_end())
- buffer->_gap_start = pptr();
-}
-
-void edit_streambuf::disconnect_gap_from_file(edit_buffer* buffer)
-{
- if (buffer->_writer != this) return;
- flush_to_buffer(buffer);
- setp(pptr(),pptr());
- buffer->_writer = NULL;
-}
-
-buf_index edit_buffer::tell(buf_char *ptr)
-{
- if (ptr <= gap_start())
- return ptr - data;
- else
- return ptr - gap_end() + size1();
-}
-
-#if 0
-buf_index buf_cookie::tell()
-{
- return str->buffer->tell(file->__bufp);
-}
-#endif
-
-buf_index edit_buffer::tell(edit_mark*mark)
-{
- return tell(data + mark->index_in_buffer(this));
-}
-
-// adjust the position of the gap
-
-void edit_buffer::move_gap(buf_offset pos)
-{
- if (pos < size1())
- gap_left (pos);
- else if (pos > size1())
- gap_right (pos);
-}
-
-void edit_buffer::gap_left (int pos)
-{
- register buf_char *to, *from;
- register int i;
- int new_s1;
-
- i = size1();
- from = gap_start();
- to = from + gap_size();
- new_s1 = size1();
-
- /* Now copy the characters. To move the gap down,
- copy characters up. */
-
- for (;;)
- {
- /* I gets number of characters left to copy. */
- i = new_s1 - pos;
- if (i == 0)
- break;
-#if 0
- /* If a quit is requested, stop copying now.
- Change POS to be where we have actually moved the gap to. */
- if (QUITP)
- {
- pos = new_s1;
- break;
- }
-#endif
- /* Move at most 32000 chars before checking again for a quit. */
- if (i > 32000)
- i = 32000;
- new_s1 -= i;
- while (--i >= 0)
- *--to = *--from;
- }
-
- /* Adjust markers, and buffer data structure, to put the gap at POS.
- POS is where the loop above stopped, which may be what was specified
- or may be where a quit was detected. */
- adjust_markers (pos << 1, size1() << 1, gap_size(), data);
-#ifndef OLD_STDIO
- _gap_start = data + pos;
-#else
- if (gap_start_ptr == &gap_start_normal)
- gap_start_normal = data + pos;
-#endif
- __gap_end_pos = to - data;
-/* QUIT;*/
-}
-
-void edit_buffer::gap_right (int pos)
-{
- register buf_char *to, *from;
- register int i;
- int new_s1;
-
- i = size1();
- to = gap_start();
- from = i + gap_end();
- new_s1 = i;
-
- /* Now copy the characters. To move the gap up,
- copy characters down. */
-
- while (1)
- {
- /* I gets number of characters left to copy. */
- i = pos - new_s1;
- if (i == 0)
- break;
-#if 0
- /* If a quit is requested, stop copying now.
- Change POS to be where we have actually moved the gap to. */
- if (QUITP)
- {
- pos = new_s1;
- break;
- }
-#endif
- /* Move at most 32000 chars before checking again for a quit. */
- if (i > 32000)
- i = 32000;
- new_s1 += i;
- while (--i >= 0)
- *to++ = *from++;
- }
-
- adjust_markers ((size1() + gap_size()) << 1, (pos + gap_size()) << 1,
- - gap_size(), data);
-#ifndef OLD_STDIO
- _gap_start = data+pos;
-#else
- if (gap_start_ptr == &gap_start_normal)
- gap_start_normal = data + pos;
-#endif
- __gap_end_pos = from - data;
-/* QUIT;*/
-}
-
-/* make sure that the gap in the current buffer is at least k
- characters wide */
-
-void edit_buffer::make_gap(buf_offset k)
-{
- register buf_char *p1, *p2, *lim;
- buf_char *old_data = data;
- int s1 = size1();
-
- if (gap_size() >= k)
- return;
-
- /* Get more than just enough */
- if (buf_size > 1000) k += 2000;
- else k += /*200;*/ 20; // for testing!
-
- p1 = (buf_char *) realloc (data, s1 + size2() + k);
- if (p1 == 0)
- abort(); /*memory_full ();*/
-
- k -= gap_size(); /* Amount of increase. */
-
- /* Record new location of text */
- data = p1;
-
- /* Transfer the new free space from the end to the gap
- by shifting the second segment upward */
- p2 = data + buf_size;
- p1 = p2 + k;
- lim = p2 - size2();
- while (lim < p2)
- *--p1 = *--p2;
-
- /* Finish updating text location data */
- __gap_end_pos += k;
-
-#ifndef OLD_STDIO
- _gap_start = data + s1;
-#else
- if (gap_start_ptr == &gap_start_normal)
- gap_start_normal = data + s1;
-#endif
-
- /* adjust markers */
- adjust_markers (s1 << 1, (buf_size << 1) + 1, k, old_data);
- buf_size += k;
-}
-
-/* Add `amount' to the position of every marker in the current buffer
- whose current position is between `from' (exclusive) and `to' (inclusive).
- Also, any markers past the outside of that interval, in the direction
- of adjustment, are first moved back to the near end of the interval
- and then adjusted by `amount'. */
-
-void edit_buffer::adjust_markers(register mark_pointer low,
- register mark_pointer high,
- int amount, buf_char *old_data)
-{
- register struct edit_mark *m;
- register mark_pointer mpos;
- /* convert to mark_pointer */
- amount <<= 1;
-
- if (_writer)
- _writer->disconnect_gap_from_file(this);
-
- for (m = mark_list(); m != NULL; m = m->chain)
- {
- mpos = m->_pos;
- if (amount > 0)
- {
- if (mpos > high && mpos < high + amount)
- mpos = high + amount;
- }
- else
- {
- if (mpos > low + amount && mpos <= low)
- mpos = low + amount;
- }
- if (mpos > low && mpos <= high)
- mpos += amount;
- m->_pos = mpos;
- }
-
- // Now adjust files
- edit_streambuf *file;
-
- for (file = files; file != NULL; file = file->next) {
- mpos = file->current() - old_data;
- if (amount > 0)
- {
- if (mpos > high && mpos < high + amount)
- mpos = high + amount;
- }
- else
- {
- if (mpos > low + amount && mpos <= low)
- mpos = low + amount;
- }
- if (mpos > low && mpos <= high)
- mpos += amount;
- char* new_pos = data + mpos;
- file->set_current(new_pos, file->is_reading());
- }
-}
-
-#if 0
-stdio_
- __off == index at start of buffer (need only be valid after seek ? )
- __buf ==
-
-if read/read_delete/overwrite mode:
- __endp <= min(*gap_start_ptr, edit_string->end->ptr(buffer))
-
-if inserting:
- must have *gap_start_ptr == __bufp && *gap_start_ptr+gap == __endp
- file->edit_string->end->ptr(buffer) == *gap_start_ptr+end
-if write_mode:
- if before gap
-#endif
-
-int edit_streambuf::underflow()
-{
- if (!(_mode & ios::in))
- return EOF;
- struct edit_buffer *buffer = str->buffer;
- if (!is_reading()) { // Must switch from put to get mode.
- disconnect_gap_from_file(buffer);
- set_current(pptr(), 1);
- }
- buf_char *str_end = str->end->ptr(buffer);
- retry:
- if (gptr() < egptr()) {
- return *gptr();
- }
- if ((buf_char*)gptr() == str_end)
- return EOF;
- if (str_end <= buffer->gap_start()) {
- setg(eback(), gptr(), str_end);
- goto retry;
- }
- if (gptr() < buffer->gap_start()) {
- setg(eback(), gptr(), buffer->gap_start());
- goto retry;
- }
- if (gptr() == buffer->gap_start()) {
- disconnect_gap_from_file(buffer);
-// fp->__offset += fp->__bufp - fp->__buffer;
- setg(buffer->gap_end(), buffer->gap_end(), str_end);
- }
- else
- setg(eback(), gptr(), str_end);
- goto retry;
-}
-
-int edit_streambuf::overflow(int ch)
-{
- if (_mode == ios::in)
- return EOF;
- struct edit_buffer *buffer = str->buffer;
- flush_to_buffer(buffer);
- if (ch == EOF)
- return 0;
- if (is_reading()) { // Must switch from get to put mode.
- set_current(gptr(), 0);
- }
- buf_char *str_end = str->end->ptr(buffer);
- retry:
- if (pptr() < epptr()) {
- *pptr() = ch;
- pbump(1);
- return (unsigned char)ch;
- }
- if ((buf_char*)pptr() == str_end || inserting()) {
- /* insert instead */
- if (buffer->_writer)
- buffer->_writer->flush_to_buffer(); // Redundant?
- buffer->_writer = NULL;
- if (pptr() >= buffer->gap_end())
- buffer->move_gap(pptr() - buffer->gap_size());
- else
- buffer->move_gap(pptr());
- buffer->make_gap(1);
- setp(buffer->gap_start(), buffer->gap_end());
- buffer->_writer = this;
- *pptr() = ch;
- pbump(1);
- return (unsigned char)ch;
- }
- if (str_end <= buffer->gap_start()) {
- // Entire string is left of gap.
- setp(pptr(), str_end);
- }
- else if (pptr() < buffer->gap_start()) {
- // Current pos is left of gap.
- setp(pptr(), buffer->gap_start());
- goto retry;
- }
- else if (pptr() == buffer->gap_start()) {
- // Current pos is at start of gap; move to end of gap.
-// disconnect_gap_from_file(buffer);
- setp(buffer->gap_end(), str_end);
-// __offset += __bufp - __buffer;
- }
- else {
- // Otherwise, current pos is right of gap.
- setp(pptr(), str_end);
- }
- goto retry;
-}
-
-void edit_streambuf::set_current(char *new_pos, int reading)
-{
- if (reading) {
- setg(new_pos, new_pos, new_pos);
- setp(NULL, NULL);
- }
- else {
- setg(NULL, NULL, NULL);
- setp(new_pos, new_pos);
- }
-}
-
-// Called by fseek(fp, pos, whence) if fp is bound to a edit_buffer.
-
-streampos edit_streambuf::seekoff(streamoff offset, _seek_dir dir,
- int /* =ios::in|ios::out*/)
-{
- struct edit_buffer *buffer = str->buffer;
- disconnect_gap_from_file(buffer);
- buf_index cur_pos = buffer->tell((buf_char*)current());;
- buf_index start_pos = buffer->tell(str->start);
- buf_index end_pos = buffer->tell(str->end);
- switch (dir) {
- case ios::beg:
- offset += start_pos;
- break;
- case ios::cur:
- offset += cur_pos;
- break;
- case ios::end:
- offset += end_pos;
- break;
- }
- if (offset < start_pos || offset > end_pos)
- return EOF;
- buf_char *new_pos = buffer->data + offset;
- buf_char* gap_start = buffer->gap_start();
- if (new_pos > gap_start) {
- buf_char* gap_end = buffer->gap_end();
- new_pos += gap_end - gap_start;
- if (new_pos >= buffer->data + buffer->buf_size) abort(); // Paranoia.
- }
- set_current(new_pos, is_reading());
- return EOF;
-}
-
-#if 0
-int buf_seek(void *arg_cookie, fpos_t * pos, int whence)
-{
- struct buf_cookie *cookie = arg_cookie;
- FILE *file = cookie->file;
- struct edit_buffer *buffer = cookie->str->buffer;
- buf_char *str_start = cookie->str->start->ptr(buffer);
- disconnect_gap_from_file(buffer, cookie->file);
- fpos_t cur_pos, new_pos;
- if (file->__bufp <= *buffer->gap_start_ptr
- || str_start >= buffer->__gap_end)
- cur_pos = str_start - file->__bufp;
- else
- cur_pos =
- (*buffer->gap_start_ptr - str_start) + (file->__bufp - __gap_end);
- end_pos = ...;
- switch (whence) {
- case SEEK_SET:
- new_pos = *pos;
- break;
- case SEEK_CUR:
- new_pos = cur_pos + *pos;
- break;
- case SEEK_END:
- new_pos = end_pos + *pos;
- break;
- }
- if (new_pos > end_pos) {
- seek to end_pos;
- insert_nulls(new_pos - end_pos);
- return;
- }
- if (str_start + new_pos <= *gap_start_ptr &* *gap_start_ptr < end) {
- __buffer = str_start;
- __off = 0;
- __bufp = str_start + new_pos;
- file->__get_limit =
- *buffer->gap_start_ptr; /* what if gap_start_ptr == &bufp ??? */
- } else if () {
-
- }
- *pos = new_pos;
-}
-#endif
-
-/* Delete characters from `from' up to (but not incl) `to' */
-
-void edit_buffer::delete_range (buf_index from, buf_index to)
-{
- register int numdel;
-
- if ((numdel = to - from) <= 0)
- return;
-
- /* Make sure the gap is somewhere in or next to what we are deleting */
- if (from > size1())
- gap_right (from);
- if (to < size1())
- gap_left (to);
-
- /* Relocate all markers pointing into the new, larger gap
- to point at the end of the text before the gap. */
- adjust_markers ((to + gap_size()) << 1, (to + gap_size()) << 1,
- - numdel - gap_size(), data);
-
- __gap_end_pos = to + gap_size();
- _gap_start = data + from;
-}
-
-void edit_buffer::delete_range(struct edit_mark *start, struct edit_mark *end)
-{
- delete_range(tell(start), tell(end));
-}
-
-void buf_delete_chars(struct edit_buffer *, struct edit_mark *, size_t)
-{
- abort();
-}
-
-edit_streambuf::edit_streambuf(edit_string* bstr, int mode)
-{
- _mode = mode;
- str = bstr;
- edit_buffer* buffer = bstr->buffer;
- next = buffer->files;
- buffer->files = this;
- char* buf_ptr = bstr->start->ptr(buffer);
- _inserting = 0;
-// setb(buf_ptr, buf_ptr, 0);
- set_current(buf_ptr, !(mode & ios::out+ios::trunc+ios::app));
- if (_mode & ios::trunc)
- truncate();
- if (_mode & ios::ate)
- seekoff(0, ios::end);
-}
-
-// Called by fclose(fp) if fp is bound to a edit_buffer.
-
-#if 0
-static int buf_close(void *arg)
-{
- register struct buf_cookie *cookie = arg;
- struct edit_buffer *buffer = cookie->str->buffer;
- struct buf_cookie **ptr;
- for (ptr = &buffer->files; *ptr != cookie; ptr = &(*ptr)->next) ;
- *ptr = cookie->next;
- disconnect_gap_from_file(buffer, cookie->file);
- free (cookie);
- return 0;
-}
-#endif
-
-edit_streambuf::~edit_streambuf()
-{
- if (_mode == ios::out)
- truncate();
- // Unlink this from list of files associated with bstr->buffer.
- edit_streambuf **ptr = &str->buffer->files;
- for (; *ptr != this; ptr = &(*ptr)->next) { }
- *ptr = next;
-
- disconnect_gap_from_file(str->buffer);
-}
-
-edit_buffer::edit_buffer()
-{
- buf_size = /*200;*/ 15; /* for testing! */
- data = (buf_char*)malloc(buf_size);
- files = NULL;
-#ifndef OLD_STDIO
- _gap_start = data;
- _writer = NULL;
-#else
- gap_start_normal = data;
- gap_start_ptr = &gap_start_normal;
-#endif
- __gap_end_pos = buf_size;
- start_mark.chain = &end_mark;
- start_mark._pos = 0;
- end_mark.chain = NULL;
- end_mark._pos = 2 * buf_size + 1;
-}
-
-// Allocate a new mark, which is adjusted by 'delta' bytes from 'this'.
-// Restrict new mark to lie within 'str'.
-
-edit_mark::edit_mark(struct edit_string *str, long delta)
-{
- struct edit_buffer *buf = str->buffer;
- chain = buf->start_mark.chain;
- buf->start_mark.chain = this;
- mark_pointer size1 = buf->size1() << 1;
- int gap_size = buf->gap_size() << 1;
- delta <<= 1;
-
- // check if new and old marks are opposite sides of gap
- if (_pos <= size1 && _pos + delta > size1)
- delta += gap_size;
- else if (_pos >= size1 + gap_size && _pos + delta < size1 + gap_size)
- delta -= gap_size;
-
- _pos = _pos + delta;
- if (_pos < str->start->_pos & ~1)
- _pos = (str->start->_pos & ~ 1) + (_pos & 1);
- else if (_pos >= str->end->_pos)
- _pos = (str->end->_pos & ~ 1) + (_pos & 1);
-}
-
-// A (slow) way to find the buffer a mark belongs to.
-
-edit_buffer * edit_mark::buffer()
-{
- struct edit_mark *mark;
- for (mark = this; mark->chain != NULL; mark = mark->chain) ;
- // Assume that the last mark on the chain is the end_mark.
- return (edit_buffer *)((char*)mark - offsetof(edit_buffer, end_mark));
-}
-
-edit_mark::~edit_mark()
-{
- // Must unlink mark from chain of owning buffer
- struct edit_buffer *buf = buffer();
- if (this == &buf->start_mark || this == &buf->end_mark) abort();
- edit_mark **ptr;
- for (ptr = &buf->start_mark.chain; *ptr != this; ptr = &(*ptr)->chain) ;
- *ptr = this->chain;
-}
-
-int edit_string::length() const
-{
- ptrdiff_t delta = end->ptr(buffer) - start->ptr(buffer);
- if (end->ptr(buffer) <= buffer->gap_start() ||
- start->ptr(buffer) >= buffer->gap_end())
- return delta;
- return delta - buffer->gap_size();
-}
-
-buf_char * edit_string::copy_bytes(int *lenp) const
-{
- char *new_str;
- int len1, len2;
- buf_char *start1, *start2;
- start1 = start->ptr(buffer);
- if (end->ptr(buffer) <= buffer->gap_start()
- || start->ptr(buffer) >= buffer->gap_end()) {
- len1 = end->ptr(buffer) - start1;
- len2 = 0;
- start2 = NULL; // To avoid a warning from g++.
- }
- else {
- len1 = buffer->gap_start() - start1;
- start2 = buffer->gap_end();
- len2 = end->ptr(buffer) - start2;
- }
- new_str = (char*)malloc(len1 + len2 + 1);
- memcpy(new_str, start1, len1);
- if (len2 > 0) memcpy(new_str + len1, start2, len2);
- new_str[len1+len2] = '\0';
- *lenp = len1+len2;
- return new_str;
-}
-
-// Replace the buf_chars in 'this' with ones from 'src'.
-// Equivalent to deleting this, then inserting src, except tries
-// to leave marks in place: Marks whose offset from the start
-// of 'this' is less than 'src->length()' will still have the
-// same offset in 'this' when done.
-
-void edit_string::assign(struct edit_string *src)
-{
- edit_streambuf dst_file(this, ios::out);
- if (buffer == src->buffer /*&& ???*/) { /* overly conservative */
- int src_len;
- buf_char *new_str;
- new_str = src->copy_bytes(&src_len);
- dst_file.sputn(new_str, src_len);
- free (new_str);
- } else {
- edit_streambuf src_file(src, ios::in);
- for ( ; ; ) {
- int ch = src_file.sbumpc();
- if (ch == EOF) break;
- dst_file.sputc(ch);
- }
- }
-}
diff --git a/contrib/libio/editbuf.h b/contrib/libio/editbuf.h
deleted file mode 100644
index d15758f257ea..000000000000
--- a/contrib/libio/editbuf.h
+++ /dev/null
@@ -1,185 +0,0 @@
-/* This is part of libio/iostream, providing -*- C++ -*- input/output.
-Copyright (C) 1993 Free Software Foundation
-
-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.
-
-Written by Per Bothner (bothner@cygnus.com). */
-
-#ifndef _EDITBUF_H
-#define _EDITBUF_H
-#ifdef __GNUG__
-#pragma interface
-#endif
-#include <stdio.h>
-#include <fstream.h>
-
-extern "C++" {
-typedef unsigned long mark_pointer;
-// At some point, it might be nice to parameterize this code
-// in terms of buf_char.
-typedef /*unsigned*/ char buf_char;
-
-// Logical pos from start of buffer (does not count gap).
-typedef long buf_index;
-
-// Pos from start of buffer, possibly including gap_size.
-typedef long buf_offset;
-
-#if 0
-struct buf_cookie {
- FILE *file;
- struct edit_string *str;
- struct buf_cookie *next;
- buf_index tell();
-};
-#endif
-
-struct edit_buffer;
-struct edit_mark;
-
-// A edit_string is defined as the region between the 'start' and 'end' marks.
-// Normally (always?) 'start->insert_before()' should be false,
-// and 'end->insert_before()' should be true.
-
-struct edit_string {
- struct edit_buffer *buffer; // buffer that 'start' and 'end' belong to
- struct edit_mark *start, *end;
- int length() const; // count of buf_chars currently in string
- edit_string(struct edit_buffer *b,
- struct edit_mark *ms, struct edit_mark *me)
- { buffer = b; start = ms; end = me; }
-/* Make a fresh, contiguous copy of the data in STR.
- Assign length of STR to *LENP.
- (Output has extra NUL at out[*LENP].) */
- buf_char *copy_bytes(int *lenp) const;
-// FILE *open_file(char *mode);
- void assign(struct edit_string *src); // copy bytes from src to this
-};
-
-struct edit_streambuf : public streambuf {
- friend edit_buffer;
- edit_string *str;
- edit_streambuf* next; // Chain of edit_streambuf's for a edit_buffer.
- short _mode;
- edit_streambuf(edit_string* bstr, int mode);
- ~edit_streambuf();
- virtual int underflow();
- virtual int overflow(int c = EOF);
- virtual streampos seekoff(streamoff, _seek_dir, int mode=ios::in|ios::out);
- void flush_to_buffer();
- void flush_to_buffer(edit_buffer* buffer);
- int _inserting;
- int inserting() { return _inserting; }
- void inserting(int i) { _inserting = i; }
-// int delete_chars(int count, char* cut_buf); Not implemented.
- int truncate();
- int is_reading() { return gptr() != NULL; }
- buf_char* current() { return is_reading() ? gptr() : pptr(); }
- void set_current(char *p, int is_reading);
- protected:
- void disconnect_gap_from_file(edit_buffer* buffer);
-};
-
-// A 'edit_mark' indicates a position in a buffer.
-// It is "attached" the text (rather than the offset).
-// There are two kinds of mark, which have different behavior
-// when text is inserted at the mark:
-// If 'insert_before()' is true the mark will be adjusted to be
-// *after* the new text.
-
-struct edit_mark {
- struct edit_mark *chain;
- mark_pointer _pos;
- inline int insert_before() { return _pos & 1; }
- inline unsigned long index_in_buffer(struct edit_buffer *)
- { return _pos >> 1; }
- inline buf_char *ptr(struct edit_buffer *buf);
- buf_index tell();
- edit_mark() { }
- edit_mark(struct edit_string *str, long delta);
- edit_buffer *buffer();
- ~edit_mark();
-};
-
-// A 'edit_buffer' consists of a sequence of buf_chars (the data),
-// a list of edit_marks pointing into the data, and a list of FILEs
-// also pointing into the data.
-// A 'edit_buffer' coerced to a edit_string is the string of
-// all the buf_chars in the buffer.
-
-// This implementation uses a conventional buffer gap (as in Emacs).
-// The gap start is defined by de-referencing a (buf_char**).
-// This is because sometimes a FILE is inserting into the buffer,
-// so rather than having each putc adjust the gap, we use indirection
-// to have the gap be defined as the write pointer of the FILE.
-// (This assumes that putc adjusts a pointer (as in GNU's libc), not an index.)
-
-struct edit_buffer {
- buf_char *data; /* == emacs buffer_text.p1+1 */
- buf_char *_gap_start;
- edit_streambuf* _writer; // If non-NULL, currently writing stream
- inline buf_char *gap_start()
- { return _writer ? _writer->pptr() : _gap_start; }
- buf_offset __gap_end_pos; // size of part 1 + size of gap
- /* int gap; implicit: buf_size - size1 - size2 */
- int buf_size;
- struct edit_streambuf *files;
- struct edit_mark start_mark;
- struct edit_mark end_mark;
- edit_buffer();
- inline buf_offset gap_end_pos() { return __gap_end_pos; }
- inline struct edit_mark *start_marker() { return &start_mark; }
- inline struct edit_mark *end_marker() { return &end_mark; }
-/* these should be protected, ultimately */
- buf_index tell(edit_mark*);
- buf_index tell(buf_char*);
- inline buf_char *gap_end() { return data + gap_end_pos(); }
- inline int gap_size() { return gap_end() - gap_start(); }
- inline int size1() { return gap_start() - data; }
- inline int size2() { return buf_size - gap_end_pos(); }
- inline struct edit_mark * mark_list() { return &start_mark; }
- void make_gap (buf_offset);
- void move_gap (buf_offset pos);
- void move_gap (buf_char *pos) { move_gap(pos - data); }
- void gap_left (int pos);
- void gap_right (int pos);
- void adjust_markers(mark_pointer low, mark_pointer high,
- int amount, buf_char *old_data);
- void delete_range(buf_index from, buf_index to);
- void delete_range(struct edit_mark *start, struct edit_mark *end);
-};
-
-extern buf_char * bstr_copy(struct edit_string *str, int *lenp);
-
-// Convert a edit_mark to a (buf_char*)
-
-inline buf_char *edit_mark::ptr(struct edit_buffer *buf)
- { return buf->data + index_in_buffer(buf); }
-
-inline void edit_streambuf::flush_to_buffer()
-{
- edit_buffer* buffer = str->buffer;
- if (buffer->_writer == this) flush_to_buffer(buffer);
-}
-} // extern "C++"
-#endif /* !_EDITBUF_H*/
-
diff --git a/contrib/libio/filebuf.cc b/contrib/libio/filebuf.cc
deleted file mode 100644
index 0b0fd6d88d3a..000000000000
--- a/contrib/libio/filebuf.cc
+++ /dev/null
@@ -1,223 +0,0 @@
-/* This is part of libio/iostream, providing -*- C++ -*- input/output.
-Copyright (C) 1993, 1995, 1999 Free Software Foundation
-
-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.
-
-Written by Per Bothner (bothner@cygnus.com). */
-
-#include "iostreamP.h"
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <errno.h>
-#include "builtinbuf.h"
-
-void filebuf::init()
-{
- _IO_file_init(this);
-}
-
-filebuf::filebuf()
-{
- _IO_file_init(this);
-}
-
-#if !_IO_UNIFIED_JUMPTABLES
-/* This is like "new filebuf()", but it uses the _IO_file_jump jumptable,
- for eficiency. */
-
-filebuf* filebuf::__new()
-{
- filebuf *fb = new filebuf;
- _IO_JUMPS(fb) = &_IO_file_jumps;
- fb->_vtable() = builtinbuf_vtable;
- return fb;
-}
-#endif
-
-filebuf::filebuf(int fd)
-{
- _IO_file_init(this);
- _IO_file_attach(this, fd);
-}
-
-filebuf::filebuf(int fd, char* p, int len)
-{
- _IO_file_init(this);
- _IO_file_attach(this, fd);
- setbuf(p, len);
-}
-
-filebuf::~filebuf()
-{
- if (_IO_file_is_open(this))
- {
- _IO_do_flush (this);
- if (!(xflags() & _IO_DELETE_DONT_CLOSE))
- _IO_SYSCLOSE (this);
- }
-}
-
-filebuf* filebuf::open(const char *filename, ios::openmode mode, int prot)
-{
- if (_IO_file_is_open (this))
- return NULL;
- int posix_mode;
- int read_write;
- if (mode & ios::app)
- mode |= ios::out;
- if ((mode & (ios::in|ios::out)) == (ios::in|ios::out)) {
- posix_mode = O_RDWR;
- read_write = 0;
- }
- else if (mode & ios::out)
- posix_mode = O_WRONLY, read_write = _IO_NO_READS;
- else if (mode & (int)ios::in)
- posix_mode = O_RDONLY, read_write = _IO_NO_WRITES;
- else
- posix_mode = 0, read_write = _IO_NO_READS+_IO_NO_WRITES;
- if (mode & ios::binary)
- {
- mode &= ~ios::binary;
-#ifdef O_BINARY
- /* This is a (mis-)feature of DOS/Windows C libraries. */
- posix_mode |= O_BINARY;
-#endif
- }
- if ((mode & (int)ios::trunc) || mode == (int)ios::out)
- posix_mode |= O_TRUNC;
- if (mode & ios::app)
- posix_mode |= O_APPEND, read_write |= _IO_IS_APPENDING;
- if (!(mode & (int)ios::nocreate) && mode != ios::in)
- posix_mode |= O_CREAT;
- if (mode & (int)ios::noreplace)
- posix_mode |= O_EXCL;
-#if _G_HAVE_IO_FILE_OPEN
- if (!_IO_file_open (this, filename, posix_mode, prot,
- read_write, 0))
- return NULL;
- if (mode & ios::ate) {
- if (pubseekoff(0, ios::end) == EOF) {
- _IO_un_link (this);
- return NULL;
- }
- }
- return this;
-#else
- int fd = ::open(filename, posix_mode, prot);
- if (fd < 0)
- return NULL;
- _fileno = fd;
- xsetflags(read_write, _IO_NO_READS+_IO_NO_WRITES+_IO_IS_APPENDING);
- if (mode & ios::ate) {
- if (pubseekoff(0, ios::end) == EOF)
- return NULL;
- }
- _IO_link_in(this);
- return this;
-#endif
-}
-
-filebuf* filebuf::open(const char *filename, const char *mode)
-{
-#if _G_IO_IO_FILE_VERSION == 0x20001
- return (filebuf*)_IO_file_fopen(this, filename, mode, 0);
-#else
- return (filebuf*)_IO_file_fopen(this, filename, mode);
-#endif
-}
-
-filebuf* filebuf::attach(int fd)
-{
- return (filebuf*)_IO_file_attach(this, fd);
-}
-
-streambuf* filebuf::setbuf(char* p, int len)
-{
- return (streambuf*)_IO_file_setbuf (this, p, len);
-}
-
-int filebuf::doallocate() { return _IO_file_doallocate(this); }
-
-int filebuf::overflow(int c)
-{
- return _IO_file_overflow(this, c);
-}
-
-int filebuf::underflow()
-{
- return _IO_file_underflow(this);
-}
-
-int filebuf::sync()
-{
- return _IO_file_sync(this);
-}
-
-streampos filebuf::seekoff(streamoff offset, _seek_dir dir, int mode)
-{
- return _IO_file_seekoff (this, offset, dir, mode);
-}
-
-filebuf* filebuf::close()
-{
- return (_IO_file_close_it(this) ? (filebuf*)NULL : this);
-}
-
-streamsize filebuf::sys_read(char* buf, streamsize size)
-{
- return _IO_file_read(this, buf, size);
-}
-
-streampos filebuf::sys_seek(streamoff offset, _seek_dir dir)
-{
- return _IO_file_seek(this, offset, dir);
-}
-
-streamsize filebuf::sys_write(const char *buf, streamsize n)
-{
- return _IO_file_write (this, buf, n);
-}
-
-int filebuf::sys_stat(void* st)
-{
- return _IO_file_stat (this, st);
-}
-
-int filebuf::sys_close()
-{
- return _IO_file_close (this);
-}
-
-streamsize filebuf::xsputn(const char *s, streamsize n)
-{
- return _IO_file_xsputn(this, s, n);
-}
-
-streamsize filebuf::xsgetn(char *s, streamsize n)
-{
- // FIXME: OPTIMIZE THIS (specifically, when unbuffered()).
- return streambuf::xsgetn(s, n);
-}
-
-// Non-ANSI AT&T-ism: Default open protection.
-const int filebuf::openprot = 0644;
diff --git a/contrib/libio/filedoalloc.c b/contrib/libio/filedoalloc.c
deleted file mode 100644
index 52b554400c21..000000000000
--- a/contrib/libio/filedoalloc.c
+++ /dev/null
@@ -1,107 +0,0 @@
-/* Copyright (C) 1993, 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. */
-
-/*
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms are permitted
- * provided that the above copyright notice and this paragraph are
- * duplicated in all such forms and that any documentation,
- * advertising materials, and other materials related to such
- * distribution and use acknowledge that the software was developed
- * by the University of California, Berkeley. The name of the
- * University may not be used to endorse or promote products derived
- * from this software without specific prior written permission.
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- */
-
-/* Modified for GNU iostream by Per Bothner 1991, 1992. */
-
-#include "libioP.h"
-#include <sys/types.h>
-#include <sys/stat.h>
-#ifdef __STDC__
-#include <stdlib.h>
-#include <unistd.h>
-#endif
-
-#ifdef _LIBC
-# undef isatty
-# define isatty(Fd) __isatty (Fd)
-#endif
-
-/*
- * Allocate a file buffer, or switch to unbuffered I/O.
- * Per the ANSI C standard, ALL tty devices default to line buffered.
- *
- * As a side effect, we set __SOPT or __SNPT (en/dis-able fseek
- * optimisation) right after the _fstat() that finds the buffer size.
- */
-
-int
-_IO_file_doallocate (fp)
- _IO_FILE *fp;
-{
- _IO_size_t size;
- int couldbetty;
- char *p;
- struct stat st;
-
-#if !defined(_LIBC) && !defined(__linux__)
- /* If _IO_cleanup_registration_needed is non-zero, we should call the
- function it points to. This is to make sure _IO_cleanup gets called
- on exit. We call it from _IO_file_doallocate, since that is likely
- to get called by any program that does buffered I/O. */
- if (_IO_cleanup_registration_needed)
- (*_IO_cleanup_registration_needed) ();
-#endif
-
- if (fp->_fileno < 0 || _IO_SYSSTAT (fp, &st) < 0)
- {
- couldbetty = 0;
- size = _IO_BUFSIZ;
-#if 0
- /* do not try to optimise fseek() */
- fp->_flags |= __SNPT;
-#endif
- }
- else
- {
- couldbetty = S_ISCHR (st.st_mode);
-#if _IO_HAVE_ST_BLKSIZE
- size = st.st_blksize <= 0 ? _IO_BUFSIZ : st.st_blksize;
-#else
- size = _IO_BUFSIZ;
-#endif
- }
- ALLOC_BUF (p, size, EOF);
- _IO_setb (fp, p, p + size, 1);
- if (couldbetty && isatty (fp->_fileno))
- fp->_flags |= _IO_LINE_BUF;
- return 1;
-}
diff --git a/contrib/libio/fileops.c b/contrib/libio/fileops.c
deleted file mode 100644
index 54e13d3f18fe..000000000000
--- a/contrib/libio/fileops.c
+++ /dev/null
@@ -1,811 +0,0 @@
-/* Copyright (C) 1993, 1995, 1997 Free Software Foundation, Inc.
- This file is part of the GNU IO Library.
- Written by Per Bothner <bothner@cygnus.com>.
-
- This 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 <fcntl.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <string.h>
-#include <unistd.h>
-#include <errno.h>
-#ifndef errno
-extern int errno;
-#endif
-
-
-#ifdef _LIBC
-# 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
-
-/* An fstream can be in at most one of put mode, get mode, or putback mode.
- Putback mode is a variant of get mode.
-
- In a filebuf, there is only one current position, instead of two
- separate get and put pointers. In get mode, the current position
- is that of gptr(); in put mode that of pptr().
-
- The position in the buffer that corresponds to the position
- in external file system is normally _IO_read_end, except in putback
- mode, when it is _IO_save_end.
- If the field _fb._offset is >= 0, it gives the offset in
- the file as a whole corresponding to eGptr(). (?)
-
- PUT MODE:
- If a filebuf is in put mode, then all of _IO_read_ptr, _IO_read_end,
- and _IO_read_base are equal to each other. These are usually equal
- to _IO_buf_base, though not necessarily if we have switched from
- get mode to put mode. (The reason is to maintain the invariant
- that _IO_read_end corresponds to the external file position.)
- _IO_write_base is non-NULL and usually equal to _IO_base_base.
- We also have _IO_write_end == _IO_buf_end, but only in fully buffered mode.
- The un-flushed character are those between _IO_write_base and _IO_write_ptr.
-
- GET MODE:
- If a filebuf is in get or putback mode, eback() != egptr().
- In get mode, the unread characters are between gptr() and egptr().
- The OS file position corresponds to that of egptr().
-
- PUTBACK MODE:
- Putback mode is used to remember "excess" characters that have
- been sputbackc'd in a separate putback buffer.
- In putback mode, the get buffer points to the special putback buffer.
- The unread characters are the characters between gptr() and egptr()
- in the putback buffer, as well as the area between save_gptr()
- and save_egptr(), which point into the original reserve buffer.
- (The pointers save_gptr() and save_egptr() are the values
- of gptr() and egptr() at the time putback mode was entered.)
- The OS position corresponds to that of save_egptr().
-
- LINE BUFFERED OUTPUT:
- During line buffered output, _IO_write_base==base() && epptr()==base().
- However, ptr() may be anywhere between base() and ebuf().
- This forces a call to filebuf::overflow(int C) on every put.
- If there is more space in the buffer, and C is not a '\n',
- then C is inserted, and pptr() incremented.
-
- UNBUFFERED STREAMS:
- If a filebuf is unbuffered(), the _shortbuf[1] is used as the buffer.
-*/
-
-#define CLOSED_FILEBUF_FLAGS \
- (_IO_IS_FILEBUF+_IO_NO_READS+_IO_NO_WRITES+_IO_TIED_PUT_GET)
-
-
-void
-_IO_file_init (fp)
- _IO_FILE *fp;
-{
- /* POSIX.1 allows another file handle to be used to change the position
- of our file descriptor. Hence we actually don't know the actual
- position before we do the first fseek (and until a following fflush). */
- fp->_offset = _IO_pos_BAD;
- fp->_IO_file_flags |= CLOSED_FILEBUF_FLAGS;
-
- _IO_link_in(fp);
- fp->_fileno = -1;
-}
-
-int
-_IO_file_close_it (fp)
- _IO_FILE *fp;
-{
- int write_status, close_status;
- if (!_IO_file_is_open (fp))
- return EOF;
-
- write_status = _IO_do_flush (fp);
-
- _IO_unsave_markers(fp);
-
- close_status = _IO_SYSCLOSE (fp);
-
- /* Free buffer. */
- _IO_setb (fp, NULL, NULL, 0);
- _IO_setg (fp, NULL, NULL, NULL);
- _IO_setp (fp, NULL, NULL);
-
- _IO_un_link (fp);
- fp->_flags = _IO_MAGIC|CLOSED_FILEBUF_FLAGS;
- fp->_fileno = EOF;
- fp->_offset = _IO_pos_BAD;
-
- return close_status ? close_status : write_status;
-}
-
-void
-_IO_file_finish (fp, dummy)
- _IO_FILE *fp;
- int dummy;
-{
- if (_IO_file_is_open (fp))
- {
- _IO_do_flush (fp);
- if (!(fp->_flags & _IO_DELETE_DONT_CLOSE))
- _IO_SYSCLOSE (fp);
- }
- _IO_default_finish (fp, 0);
-}
-
-_IO_FILE *
-_IO_file_fopen (fp, filename, mode)
- _IO_FILE *fp;
- const char *filename;
- const char *mode;
-{
- int oflags = 0, omode;
- int read_write, fdesc;
- int oprot = 0666;
- if (_IO_file_is_open (fp))
- return 0;
- switch (*mode++)
- {
- case 'r':
- omode = O_RDONLY;
- read_write = _IO_NO_WRITES;
- break;
- case 'w':
- omode = O_WRONLY;
- oflags = O_CREAT|O_TRUNC;
- read_write = _IO_NO_READS;
- break;
- case 'a':
- omode = O_WRONLY;
- oflags = O_CREAT|O_APPEND;
- read_write = _IO_NO_READS|_IO_IS_APPENDING;
- break;
- default:
- __set_errno (EINVAL);
- return NULL;
- }
- if (mode[0] == '+' || (mode[0] == 'b' && mode[1] == '+'))
- {
- omode = O_RDWR;
- read_write &= _IO_IS_APPENDING;
- }
- fdesc = open (filename, omode|oflags, oprot);
- if (fdesc < 0)
- return NULL;
- fp->_fileno = fdesc;
- _IO_mask_flags (fp, read_write,_IO_NO_READS+_IO_NO_WRITES+_IO_IS_APPENDING);
- if (read_write & _IO_IS_APPENDING)
- if (_IO_SEEKOFF (fp, (_IO_off_t)0, _IO_seek_end, _IOS_INPUT|_IOS_OUTPUT)
- == _IO_pos_BAD && errno != ESPIPE)
- return NULL;
- _IO_link_in (fp);
- return fp;
-}
-
-_IO_FILE *
-_IO_file_attach (fp, fd)
- _IO_FILE *fp;
- int fd;
-{
- if (_IO_file_is_open (fp))
- return NULL;
- fp->_fileno = fd;
- fp->_flags &= ~(_IO_NO_READS+_IO_NO_WRITES);
- fp->_flags |= _IO_DELETE_DONT_CLOSE;
- /* Get the current position of the file. */
- /* We have to do that since that may be junk. */
- fp->_offset = _IO_pos_BAD;
- if (_IO_SEEKOFF (fp, (_IO_off_t)0, _IO_seek_cur, _IOS_INPUT|_IOS_OUTPUT)
- == _IO_pos_BAD && errno != ESPIPE)
- return NULL;
- return fp;
-}
-
-_IO_FILE *
-_IO_file_setbuf (fp, p, len)
- _IO_FILE *fp;
- char *p;
- _IO_ssize_t len;
-{
- if (_IO_default_setbuf (fp, p, len) == NULL)
- return NULL;
-
- fp->_IO_write_base = fp->_IO_write_ptr = fp->_IO_write_end
- = fp->_IO_buf_base;
- _IO_setg (fp, fp->_IO_buf_base, fp->_IO_buf_base, fp->_IO_buf_base);
-
- return fp;
-}
-
-/* Write TO_DO bytes from DATA to FP.
- Then mark FP as having empty buffers. */
-
-int
-_IO_do_write (fp, data, to_do)
- _IO_FILE *fp;
- const char *data;
- _IO_size_t to_do;
-{
- _IO_size_t count;
- if (to_do == 0)
- return 0;
- if (fp->_flags & _IO_IS_APPENDING)
- /* On a system without a proper O_APPEND implementation,
- you would need to sys_seek(0, SEEK_END) here, but it
- is not needed nor desirable for Unix- or Posix-like systems.
- Instead, just indicate that offset (before and after) is
- unpredictable. */
- fp->_offset = _IO_pos_BAD;
- else if (fp->_IO_read_end != fp->_IO_write_base)
- {
- _IO_pos_t new_pos
- = _IO_SYSSEEK (fp, fp->_IO_write_base - fp->_IO_read_end, 1);
- if (new_pos == _IO_pos_BAD)
- return EOF;
- fp->_offset = new_pos;
- }
- count = _IO_SYSWRITE (fp, data, to_do);
- if (fp->_cur_column)
- fp->_cur_column = _IO_adjust_column (fp->_cur_column - 1, data, to_do) + 1;
- _IO_setg (fp, fp->_IO_buf_base, fp->_IO_buf_base, fp->_IO_buf_base);
- fp->_IO_write_base = fp->_IO_write_ptr = fp->_IO_buf_base;
- fp->_IO_write_end = ((fp->_flags & (_IO_LINE_BUF+_IO_UNBUFFERED))
- ? fp->_IO_buf_base : fp->_IO_buf_end);
- return count != to_do ? EOF : 0;
-}
-
-int
-_IO_file_underflow (fp)
- _IO_FILE *fp;
-{
- _IO_ssize_t count;
-#if 0
- /* SysV does not make this test; take it out for compatibility */
- if (fp->_flags & _IO_EOF_SEEN)
- return (EOF);
-#endif
-
- if (fp->_flags & _IO_NO_READS)
- {
- __set_errno (EBADF);
- return EOF;
- }
- if (fp->_IO_read_ptr < fp->_IO_read_end)
- return *(unsigned char *) fp->_IO_read_ptr;
-
- if (fp->_IO_buf_base == NULL)
- _IO_doallocbuf (fp);
-
- /* Flush all line buffered files before reading. */
- /* FIXME This can/should be moved to genops ?? */
- if (fp->_flags & (_IO_LINE_BUF|_IO_UNBUFFERED))
- _IO_flush_all_linebuffered ();
-
- _IO_switch_to_get_mode (fp);
-
- /* This is very tricky. We have to adjust those
- pointers before we call _IO_SYSREAD () since
- we may longjump () out while waiting for
- input. Those pointers may be screwed up. H.J. */
- fp->_IO_read_base = fp->_IO_read_ptr = fp->_IO_buf_base;
- fp->_IO_read_end = fp->_IO_buf_base;
- fp->_IO_write_base = fp->_IO_write_ptr = fp->_IO_write_end
- = fp->_IO_buf_base;
-
- count = _IO_SYSREAD (fp, fp->_IO_buf_base,
- fp->_IO_buf_end - fp->_IO_buf_base);
- if (count <= 0)
- {
- if (count == 0)
- fp->_flags |= _IO_EOF_SEEN;
- else
- fp->_flags |= _IO_ERR_SEEN, count = 0;
- }
- fp->_IO_read_end += count;
- if (count == 0)
- return EOF;
- if (fp->_offset != _IO_pos_BAD)
- _IO_pos_adjust (fp->_offset, count);
- return *(unsigned char *) fp->_IO_read_ptr;
-}
-
-int
-_IO_file_overflow (f, ch)
- _IO_FILE *f;
- int ch;
-{
- if (f->_flags & _IO_NO_WRITES) /* SET ERROR */
- {
- f->_flags |= _IO_ERR_SEEN;
- __set_errno (EBADF);
- return EOF;
- }
- /* If currently reading or no buffer allocated. */
- if ((f->_flags & _IO_CURRENTLY_PUTTING) == 0)
- {
- /* Allocate a buffer if needed. */
- if (f->_IO_write_base == 0)
- {
- _IO_doallocbuf (f);
- _IO_setg (f, f->_IO_buf_base, f->_IO_buf_base, f->_IO_buf_base);
- }
- /* Otherwise must be currently reading.
- If _IO_read_ptr (and hence also _IO_read_end) is at the buffer end,
- logically slide the buffer forwards one block (by setting the
- read pointers to all point at the beginning of the block). This
- makes room for subsequent output.
- Otherwise, set the read pointers to _IO_read_end (leaving that
- alone, so it can continue to correspond to the external position). */
- if (f->_IO_read_ptr == f->_IO_buf_end)
- f->_IO_read_end = f->_IO_read_ptr = f->_IO_buf_base;
- f->_IO_write_ptr = f->_IO_read_ptr;
- f->_IO_write_base = f->_IO_write_ptr;
- f->_IO_write_end = f->_IO_buf_end;
- f->_IO_read_base = f->_IO_read_ptr = f->_IO_read_end;
-
- if (f->_flags & (_IO_LINE_BUF+_IO_UNBUFFERED))
- f->_IO_write_end = f->_IO_write_ptr;
- f->_flags |= _IO_CURRENTLY_PUTTING;
- }
- if (ch == EOF)
- return _IO_do_flush (f);
- if (f->_IO_write_ptr == f->_IO_buf_end ) /* Buffer is really full */
- if (_IO_do_flush (f) == EOF)
- return EOF;
- *f->_IO_write_ptr++ = ch;
- if ((f->_flags & _IO_UNBUFFERED)
- || ((f->_flags & _IO_LINE_BUF) && ch == '\n'))
- if (_IO_do_flush (f) == EOF)
- return EOF;
- return (unsigned char) ch;
-}
-
-int
-_IO_file_sync (fp)
- _IO_FILE *fp;
-{
- _IO_size_t delta;
- int retval = 0;
-
- _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
- _IO_flockfile (fp);
- /* char* ptr = cur_ptr(); */
- if (fp->_IO_write_ptr > fp->_IO_write_base)
- if (_IO_do_flush(fp)) return EOF;
- delta = fp->_IO_read_ptr - fp->_IO_read_end;
- if (delta != 0)
- {
-#ifdef TODO
- if (_IO_in_backup (fp))
- delta -= eGptr () - Gbase ();
-#endif
- _IO_off_t new_pos = _IO_SYSSEEK (fp, delta, 1);
- if (new_pos != (_IO_off_t) EOF)
- fp->_IO_read_end = fp->_IO_read_ptr;
-#ifdef ESPIPE
- else if (errno == ESPIPE)
- ; /* Ignore error from unseekable devices. */
-#endif
- else
- retval = EOF;
- }
- if (retval != EOF)
- fp->_offset = _IO_pos_BAD;
- /* FIXME: Cleanup - can this be shared? */
- /* setg(base(), ptr, ptr); */
- _IO_cleanup_region_end (1);
- return retval;
-}
-
-_IO_pos_t
-_IO_file_seekoff (fp, offset, dir, mode)
- _IO_FILE *fp;
- _IO_off_t offset;
- int dir;
- int mode;
-{
- _IO_pos_t result;
- _IO_off_t delta, new_offset;
- long count;
- /* POSIX.1 8.2.3.7 says that after a call the fflush() the file
- offset of the underlying file must be exact. */
- int must_be_exact = (fp->_IO_read_base == fp->_IO_read_end
- && fp->_IO_write_base == fp->_IO_write_ptr);
-
- if (mode == 0)
- dir = _IO_seek_cur, offset = 0; /* Don't move any pointers. */
-
- /* Flush unwritten characters.
- (This may do an unneeded write if we seek within the buffer.
- But to be able to switch to reading, we would need to set
- egptr to ptr. That can't be done in the current design,
- which assumes file_ptr() is eGptr. Anyway, since we probably
- end up flushing when we close(), it doesn't make much difference.)
- FIXME: simulate mem-papped files. */
-
- if (fp->_IO_write_ptr > fp->_IO_write_base || _IO_in_put_mode (fp))
- if (_IO_switch_to_get_mode (fp))
- return EOF;
-
- if (fp->_IO_buf_base == NULL)
- {
- _IO_doallocbuf (fp);
- _IO_setp (fp, fp->_IO_buf_base, fp->_IO_buf_base);
- _IO_setg (fp, fp->_IO_buf_base, fp->_IO_buf_base, fp->_IO_buf_base);
- }
-
- switch (dir)
- {
- case _IO_seek_cur:
- /* Adjust for read-ahead (bytes is buffer). */
- offset -= fp->_IO_read_end - fp->_IO_read_ptr;
- if (fp->_offset == _IO_pos_BAD)
- goto dumb;
- /* Make offset absolute, assuming current pointer is file_ptr(). */
- offset += _IO_pos_as_off (fp->_offset);
-
- dir = _IO_seek_set;
- break;
- case _IO_seek_set:
- break;
- case _IO_seek_end:
- {
- struct stat st;
- if (_IO_SYSSTAT (fp, &st) == 0 && S_ISREG (st.st_mode))
- {
- offset += st.st_size;
- dir = _IO_seek_set;
- }
- else
- goto dumb;
- }
- }
- /* At this point, dir==_IO_seek_set. */
-
- /* If destination is within current buffer, optimize: */
- if (fp->_offset != _IO_pos_BAD && fp->_IO_read_base != NULL
- && !_IO_in_backup (fp))
- {
- /* Offset relative to start of main get area. */
- _IO_pos_t rel_offset = (offset - fp->_offset
- + (fp->_IO_read_end - fp->_IO_read_base));
- if (rel_offset >= 0)
- {
-#if 0
- if (_IO_in_backup (fp))
- _IO_switch_to_main_get_area (fp);
-#endif
- if (rel_offset <= fp->_IO_read_end - fp->_IO_read_base)
- {
- _IO_setg (fp, fp->_IO_buf_base, fp->_IO_buf_base + rel_offset,
- fp->_IO_read_end);
- _IO_setp (fp, fp->_IO_buf_base, fp->_IO_buf_base);
- return offset;
- }
-#ifdef TODO
- /* If we have streammarkers, seek forward by reading ahead. */
- if (_IO_have_markers (fp))
- {
- int to_skip = rel_offset
- - (fp->_IO_read_ptr - fp->_IO_read_base);
- if (ignore (to_skip) != to_skip)
- goto dumb;
- return offset;
- }
-#endif
- }
-#ifdef TODO
- if (rel_offset < 0 && rel_offset >= Bbase () - Bptr ())
- {
- if (!_IO_in_backup (fp))
- _IO_switch_to_backup_area (fp);
- gbump (fp->_IO_read_end + rel_offset - fp->_IO_read_ptr);
- return offset;
- }
-#endif
- }
-
-#ifdef TODO
- _IO_unsave_markers (fp);
-#endif
-
- if (fp->_flags & _IO_NO_READS)
- goto dumb;
-
- /* Try to seek to a block boundary, to improve kernel page management. */
- new_offset = offset & ~(fp->_IO_buf_end - fp->_IO_buf_base - 1);
- delta = offset - new_offset;
- if (delta > fp->_IO_buf_end - fp->_IO_buf_base)
- {
- new_offset = offset;
- delta = 0;
- }
- result = _IO_SYSSEEK (fp, new_offset, 0);
- if (result < 0)
- return EOF;
- if (delta == 0)
- count = 0;
- else
- {
- count = _IO_SYSREAD (fp, fp->_IO_buf_base,
- (must_be_exact
- ? delta : fp->_IO_buf_end - fp->_IO_buf_base));
- if (count < delta)
- {
- /* We weren't allowed to read, but try to seek the remainder. */
- offset = count == EOF ? delta : delta-count;
- dir = _IO_seek_cur;
- goto dumb;
- }
- }
- _IO_setg (fp, fp->_IO_buf_base, fp->_IO_buf_base + delta,
- fp->_IO_buf_base + count);
- _IO_setp (fp, fp->_IO_buf_base, fp->_IO_buf_base);
- fp->_offset = result + count;
- _IO_mask_flags (fp, 0, _IO_EOF_SEEN);
- return offset;
- dumb:
-
- _IO_unsave_markers (fp);
- result = _IO_SYSSEEK (fp, offset, dir);
- if (result != EOF)
- _IO_mask_flags (fp, 0, _IO_EOF_SEEN);
- fp->_offset = result;
- _IO_setg (fp, fp->_IO_buf_base, fp->_IO_buf_base, fp->_IO_buf_base);
- _IO_setp (fp, fp->_IO_buf_base, fp->_IO_buf_base);
- return result;
-}
-
-_IO_ssize_t
-_IO_file_read (fp, buf, size)
- _IO_FILE *fp;
- void *buf;
- _IO_ssize_t size;
-{
- return read (fp->_fileno, buf, size);
-}
-
-_IO_pos_t
-_IO_file_seek (fp, offset, dir)
- _IO_FILE *fp;
- _IO_off_t offset;
- int dir;
-{
- return lseek (fp->_fileno, offset, dir);
-}
-
-int
-_IO_file_stat (fp, st)
- _IO_FILE *fp;
- void *st;
-{
- return fstat (fp->_fileno, (struct stat *) st);
-}
-
-int
-_IO_file_close (fp)
- _IO_FILE *fp;
-{
- return close (fp->_fileno);
-}
-
-_IO_ssize_t
-_IO_file_write (f, data, n)
- _IO_FILE *f;
- const void *data;
- _IO_ssize_t n;
-{
- _IO_ssize_t to_do = n;
- while (to_do > 0)
- {
- _IO_ssize_t count = write (f->_fileno, data, to_do);
- if (count == EOF)
- {
- f->_flags |= _IO_ERR_SEEN;
- break;
- }
- to_do -= count;
- data = (void *) ((char *) data + count);
- }
- n -= to_do;
- if (f->_offset >= 0)
- f->_offset += n;
- return n;
-}
-
-_IO_size_t
-_IO_file_xsputn (f, data, n)
- _IO_FILE *f;
- const void *data;
- _IO_size_t n;
-{
- register const char *s = (char *) data;
- _IO_size_t to_do = n;
- int must_flush = 0;
- _IO_size_t count;
-
- if (n <= 0)
- return 0;
- /* This is an optimized implementation.
- If the amount to be written straddles a block boundary
- (or the filebuf is unbuffered), use sys_write directly. */
-
- /* First figure out how much space is available in the buffer. */
- count = f->_IO_write_end - f->_IO_write_ptr; /* Space available. */
- if ((f->_flags & _IO_LINE_BUF) && (f->_flags & _IO_CURRENTLY_PUTTING))
- {
- count = f->_IO_buf_end - f->_IO_write_ptr;
- if (count >= n)
- {
- register const char *p;
- for (p = s + n; p > s; )
- {
- if (*--p == '\n')
- {
- count = p - s + 1;
- must_flush = 1;
- break;
- }
- }
- }
- }
- /* Then fill the buffer. */
- if (count > 0)
- {
- if (count > to_do)
- count = to_do;
- if (count > 20)
- {
- memcpy (f->_IO_write_ptr, s, count);
- s += count;
- }
- else
- {
- register char *p = f->_IO_write_ptr;
- register int i = (int) count;
- while (--i >= 0)
- *p++ = *s++;
- }
- f->_IO_write_ptr += count;
- to_do -= count;
- }
- if (to_do + must_flush > 0)
- {
- _IO_size_t block_size, dont_write;
- /* Next flush the (full) buffer. */
- if (__overflow (f, EOF) == EOF)
- return n - to_do;
-
- /* Try to maintain alignment: write a whole number of blocks.
- dont_write is what gets left over. */
- block_size = f->_IO_buf_end - f->_IO_buf_base;
- dont_write = block_size >= 128 ? to_do % block_size : 0;
-
- count = to_do - dont_write;
- if (_IO_do_write (f, s, count) == EOF)
- return n - to_do;
- to_do = dont_write;
-
- /* Now write out the remainder. Normally, this will fit in the
- buffer, but it's somewhat messier for line-buffered files,
- so we let _IO_default_xsputn handle the general case. */
- if (dont_write)
- to_do -= _IO_default_xsputn (f, s+count, dont_write);
- }
- return n - to_do;
-}
-
-#if 0
-/* Work in progress */
-_IO_size_t
-_IO_file_xsgetn (fp, data, n)
- _IO_FILE *fp;
- void *data;
- _IO_size_t n;
-{
- register _IO_size_t more = n;
- register char *s = data;
- for (;;)
- {
- /* Data available. */
- _IO_ssize_t count = fp->_IO_read_end - fp->_IO_read_ptr;
- if (count > 0)
- {
- if (count > more)
- count = more;
- if (count > 20)
- {
- memcpy (s, fp->_IO_read_ptr, count);
- s += count;
- fp->_IO_read_ptr += count;
- }
- else if (count <= 0)
- count = 0;
- else
- {
- register char *p = fp->_IO_read_ptr;
- register int i = (int) count;
- while (--i >= 0)
- *s++ = *p++;
- fp->_IO_read_ptr = p;
- }
- more -= count;
- }
-#if 0
- if (! _IO_in put_mode (fp)
- && ! _IO_have_markers (fp) && ! IO_have_backup (fp))
- {
- /* This is an optimization of _IO_file_underflow */
- if (fp->_flags & _IO_NO_READS)
- break;
- /* If we're reading a lot of data, don't bother allocating
- a buffer. But if we're only reading a bit, perhaps we should ??*/
- if (count <= 512 && fp->_IO_buf_base == NULL)
- _IO_doallocbuf (fp);
- if (fp->_flags & (_IO_LINE_BUF|_IO_UNBUFFERED))
- _IO_flush_all_linebuffered ();
-
- _IO_switch_to_get_mode (fp); ???;
- count = _IO_SYSREAD (fp, s, more);
- if (count <= 0)
- {
- if (count == 0)
- fp->_flags |= _IO_EOF_SEEN;
- else
- fp->_flags |= _IO_ERR_SEEN, count = 0;
- }
-
- s += count;
- more -= count;
- }
-#endif
- if (more == 0 || __underflow (fp) == EOF)
- break;
- }
- return n - more;
-}
-#endif
-
-struct _IO_jump_t _IO_file_jumps =
-{
- JUMP_INIT_DUMMY,
- JUMP_INIT(finish, _IO_file_finish),
- JUMP_INIT(overflow, _IO_file_overflow),
- JUMP_INIT(underflow, _IO_file_underflow),
- JUMP_INIT(uflow, _IO_default_uflow),
- JUMP_INIT(pbackfail, _IO_default_pbackfail),
- JUMP_INIT(xsputn, _IO_file_xsputn),
- JUMP_INIT(xsgetn, _IO_default_xsgetn),
- JUMP_INIT(seekoff, _IO_file_seekoff),
- JUMP_INIT(seekpos, _IO_default_seekpos),
- JUMP_INIT(setbuf, _IO_file_setbuf),
- JUMP_INIT(sync, _IO_file_sync),
- JUMP_INIT(doallocate, _IO_file_doallocate),
- JUMP_INIT(read, _IO_file_read),
- JUMP_INIT(write, _IO_file_write),
- JUMP_INIT(seek, _IO_file_seek),
- JUMP_INIT(close, _IO_file_close),
- JUMP_INIT(stat, _IO_file_stat)
-};
diff --git a/contrib/libio/floatconv.c b/contrib/libio/floatconv.c
deleted file mode 100644
index 9503187b5d57..000000000000
--- a/contrib/libio/floatconv.c
+++ /dev/null
@@ -1,2375 +0,0 @@
-/*
-Copyright (C) 1993, 1994 Free Software Foundation
-
-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>
-#ifdef _IO_USE_DTOA
-/****************************************************************
- *
- * The author of this software is David M. Gay.
- *
- * Copyright (c) 1991 by AT&T.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose without fee is hereby granted, provided that this entire notice
- * is included in all copies of any software which is or includes a copy
- * or modification of this software and in all copies of the supporting
- * documentation for such software.
- *
- * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED
- * WARRANTY. IN PARTICULAR, NEITHER THE AUTHOR NOR AT&T MAKES ANY
- * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
- * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
- *
- ***************************************************************/
-
-/* Some cleaning up by Per Bothner, bothner@cygnus.com, 1992, 1993.
- Re-written to not need static variables
- (except result, result_k, HIWORD, LOWORD). */
-
-/* Note that the checking of _DOUBLE_IS_32BITS is for use with the
- cross targets that employ the newlib ieeefp.h header. -- brendan */
-
-/* Please send bug reports to
- David M. Gay
- AT&T Bell Laboratories, Room 2C-463
- 600 Mountain Avenue
- Murray Hill, NJ 07974-2070
- U.S.A.
- dmg@research.att.com or research!dmg
- */
-
-/* strtod for IEEE-, VAX-, and IBM-arithmetic machines.
- *
- * This strtod returns a nearest machine number to the input decimal
- * string (or sets errno to ERANGE). With IEEE arithmetic, ties are
- * broken by the IEEE round-even rule. Otherwise ties are broken by
- * biased rounding (add half and chop).
- *
- * Inspired loosely by William D. Clinger's paper "How to Read Floating
- * Point Numbers Accurately" [Proc. ACM SIGPLAN '90, pp. 92-101].
- *
- * Modifications:
- *
- * 1. We only require IEEE, IBM, or VAX double-precision
- * arithmetic (not IEEE double-extended).
- * 2. We get by with floating-point arithmetic in a case that
- * Clinger missed -- when we're computing d * 10^n
- * for a small integer d and the integer n is not too
- * much larger than 22 (the maximum integer k for which
- * we can represent 10^k exactly), we may be able to
- * compute (d*10^k) * 10^(e-k) with just one roundoff.
- * 3. Rather than a bit-at-a-time adjustment of the binary
- * result in the hard case, we use floating-point
- * arithmetic to determine the adjustment to within
- * one bit; only in really hard cases do we need to
- * compute a second residual.
- * 4. Because of 3., we don't need a large table of powers of 10
- * for ten-to-e (just some small tables, e.g. of 10^k
- * for 0 <= k <= 22).
- */
-
-/*
- * #define IEEE_8087 for IEEE-arithmetic machines where the least
- * significant byte has the lowest address.
- * #define IEEE_MC68k for IEEE-arithmetic machines where the most
- * significant byte has the lowest address.
- * #define Sudden_Underflow for IEEE-format machines without gradual
- * underflow (i.e., that flush to zero on underflow).
- * #define IBM for IBM mainframe-style floating-point arithmetic.
- * #define VAX for VAX-style floating-point arithmetic.
- * #define Unsigned_Shifts if >> does treats its left operand as unsigned.
- * #define No_leftright to omit left-right logic in fast floating-point
- * computation of dtoa.
- * #define Check_FLT_ROUNDS if FLT_ROUNDS can assume the values 2 or 3.
- * #define RND_PRODQUOT to use rnd_prod and rnd_quot (assembly routines
- * that use extended-precision instructions to compute rounded
- * products and quotients) with IBM.
- * #define ROUND_BIASED for IEEE-format with biased rounding.
- * #define Inaccurate_Divide for IEEE-format with correctly rounded
- * products but inaccurate quotients, e.g., for Intel i860.
- * #define KR_headers for old-style C function headers.
- */
-
-#ifdef DEBUG
-#include <stdio.h>
-#define Bug(x) {fprintf(stderr, "%s\n", x); exit(1);}
-#endif
-
-#ifdef __STDC__
-#include <stdlib.h>
-#include <string.h>
-#include <float.h>
-#define CONST const
-#else
-#define CONST
-#define KR_headers
-
-/* In this case, we assume IEEE floats. */
-#define FLT_ROUNDS 1
-#define FLT_RADIX 2
-#define DBL_MANT_DIG 53
-#define DBL_DIG 15
-#define DBL_MAX_10_EXP 308
-#define DBL_MAX_EXP 1024
-#endif
-
-#include <errno.h>
-#ifndef __MATH_H__
-#include <math.h>
-#endif
-
-#ifdef Unsigned_Shifts
-#define Sign_Extend(a,b) if (b < 0) a |= 0xffff0000;
-#else
-#define Sign_Extend(a,b) /*no-op*/
-#endif
-
-#if defined(__i386__) || defined(__i860__) || defined(clipper)
-#define IEEE_8087
-#endif
-#if defined(MIPSEL) || defined(__alpha__)
-#define IEEE_8087
-#endif
-#if defined(__sparc__) || defined(sparc) || defined(MIPSEB)
-#define IEEE_MC68k
-#endif
-
-#if defined(IEEE_8087) + defined(IEEE_MC68k) + defined(VAX) + defined(IBM) != 1
-
-#ifndef _DOUBLE_IS_32BITS
-#if FLT_RADIX==16
-#define IBM
-#else
-#if DBL_MANT_DIG==56
-#define VAX
-#else
-#if DBL_MANT_DIG==53 && DBL_MAX_10_EXP==308
-#define IEEE_Unknown
-#else
-Exactly one of IEEE_8087, IEEE_MC68k, VAX, or IBM should be defined.
-#endif
-#endif
-#endif
-#endif /* !_DOUBLE_IS_32BITS */
-#endif
-
-typedef _G_uint32_t unsigned32;
-
-union doubleword {
- double d;
- unsigned32 u[2];
-};
-
-#ifdef IEEE_8087
-#define HIWORD 1
-#define LOWORD 0
-#define TEST_ENDIANNESS /* nothing */
-#else
-#if defined(IEEE_MC68k)
-#define HIWORD 0
-#define LOWORD 1
-#define TEST_ENDIANNESS /* nothing */
-#else
-static int HIWORD = -1, LOWORD;
-static void test_endianness()
-{
- union doubleword dw;
- dw.d = 10;
- if (dw.u[0] != 0) /* big-endian */
- HIWORD=0, LOWORD=1;
- else
- HIWORD=1, LOWORD=0;
-}
-#define TEST_ENDIANNESS if (HIWORD<0) test_endianness();
-#endif
-#endif
-
-#if 0
-union doubleword _temp;
-#endif
-#if defined(__GNUC__) && !defined(_DOUBLE_IS_32BITS)
-#define word0(x) ({ union doubleword _du; _du.d = (x); _du.u[HIWORD]; })
-#define word1(x) ({ union doubleword _du; _du.d = (x); _du.u[LOWORD]; })
-#define setword0(D,W) \
- ({ union doubleword _du; _du.d = (D); _du.u[HIWORD]=(W); (D)=_du.d; })
-#define setword1(D,W) \
- ({ union doubleword _du; _du.d = (D); _du.u[LOWORD]=(W); (D)=_du.d; })
-#define setwords(D,W0,W1) ({ union doubleword _du; \
- _du.u[HIWORD]=(W0); _du.u[LOWORD]=(W1); (D)=_du.d; })
-#define addword0(D,W) \
- ({ union doubleword _du; _du.d = (D); _du.u[HIWORD]+=(W); (D)=_du.d; })
-#else
-#define word0(x) ((unsigned32 *)&x)[HIWORD]
-#ifndef _DOUBLE_IS_32BITS
-#define word1(x) ((unsigned32 *)&x)[LOWORD]
-#else
-#define word1(x) 0
-#endif
-#define setword0(D,W) word0(D) = (W)
-#ifndef _DOUBLE_IS_32BITS
-#define setword1(D,W) word1(D) = (W)
-#define setwords(D,W0,W1) (setword0(D,W0),setword1(D,W1))
-#else
-#define setword1(D,W)
-#define setwords(D,W0,W1) (setword0(D,W0))
-#endif
-#define addword0(D,X) (word0(D) += (X))
-#endif
-
-/* The following definition of Storeinc is appropriate for MIPS processors. */
-#if defined(IEEE_8087) + defined(VAX)
-#define Storeinc(a,b,c) (((unsigned short *)a)[1] = (unsigned short)b, \
-((unsigned short *)a)[0] = (unsigned short)c, a++)
-#else
-#if defined(IEEE_MC68k)
-#define Storeinc(a,b,c) (((unsigned short *)a)[0] = (unsigned short)b, \
-((unsigned short *)a)[1] = (unsigned short)c, a++)
-#else
-#define Storeinc(a,b,c) (*a++ = b << 16 | c & 0xffff)
-#endif
-#endif
-
-/* #define P DBL_MANT_DIG */
-/* Ten_pmax = floor(P*log(2)/log(5)) */
-/* Bletch = (highest power of 2 < DBL_MAX_10_EXP) / 16 */
-/* Quick_max = floor((P-1)*log(FLT_RADIX)/log(10) - 1) */
-/* Int_max = floor(P*log(FLT_RADIX)/log(10) - 1) */
-
-#if defined(IEEE_8087) + defined(IEEE_MC68k) + defined(IEEE_Unknown)
-#define Exp_shift 20
-#define Exp_shift1 20
-#define Exp_msk1 0x100000
-#define Exp_msk11 0x100000
-#define Exp_mask 0x7ff00000
-#define P 53
-#define Bias 1023
-#define IEEE_Arith
-#define Emin (-1022)
-#define Exp_1 0x3ff00000
-#define Exp_11 0x3ff00000
-#define Ebits 11
-#define Frac_mask 0xfffff
-#define Frac_mask1 0xfffff
-#define Ten_pmax 22
-#define Bletch 0x10
-#define Bndry_mask 0xfffff
-#define Bndry_mask1 0xfffff
-#define LSB 1
-#define Sign_bit 0x80000000
-#define Log2P 1
-#define Tiny0 0
-#define Tiny1 1
-#define Quick_max 14
-#define Int_max 14
-#define Infinite(x) (word0(x) == 0x7ff00000) /* sufficient test for here */
-#else
-#undef Sudden_Underflow
-#define Sudden_Underflow
-#ifdef IBM
-#define Exp_shift 24
-#define Exp_shift1 24
-#define Exp_msk1 0x1000000
-#define Exp_msk11 0x1000000
-#define Exp_mask 0x7f000000
-#define P 14
-#define Bias 65
-#define Exp_1 0x41000000
-#define Exp_11 0x41000000
-#define Ebits 8 /* exponent has 7 bits, but 8 is the right value in b2d */
-#define Frac_mask 0xffffff
-#define Frac_mask1 0xffffff
-#define Bletch 4
-#define Ten_pmax 22
-#define Bndry_mask 0xefffff
-#define Bndry_mask1 0xffffff
-#define LSB 1
-#define Sign_bit 0x80000000
-#define Log2P 4
-#define Tiny0 0x100000
-#define Tiny1 0
-#define Quick_max 14
-#define Int_max 15
-#else /* VAX */
-#define Exp_shift 23
-#define Exp_shift1 7
-#define Exp_msk1 0x80
-#define Exp_msk11 0x800000
-#define Exp_mask 0x7f80
-#define P 56
-#define Bias 129
-#define Exp_1 0x40800000
-#define Exp_11 0x4080
-#define Ebits 8
-#define Frac_mask 0x7fffff
-#define Frac_mask1 0xffff007f
-#define Ten_pmax 24
-#define Bletch 2
-#define Bndry_mask 0xffff007f
-#define Bndry_mask1 0xffff007f
-#define LSB 0x10000
-#define Sign_bit 0x8000
-#define Log2P 1
-#define Tiny0 0x80
-#define Tiny1 0
-#define Quick_max 15
-#define Int_max 15
-#endif
-#endif
-
-#ifndef IEEE_Arith
-#define ROUND_BIASED
-#endif
-
-#ifdef RND_PRODQUOT
-#define rounded_product(a,b) a = rnd_prod(a, b)
-#define rounded_quotient(a,b) a = rnd_quot(a, b)
-extern double rnd_prod(double, double), rnd_quot(double, double);
-#else
-#define rounded_product(a,b) a *= b
-#define rounded_quotient(a,b) a /= b
-#endif
-
-#define Big0 (Frac_mask1 | Exp_msk1*(DBL_MAX_EXP+Bias-1))
-#define Big1 0xffffffff
-
-#define Kmax 15
-
-/* (1<<BIGINT_MINIMUM_K) is the minimum number of words to allocate
- in a Bigint. dtoa usually manages with 1<<2, and has not been
- known to need more than 1<<3. */
-
-#define BIGINT_MINIMUM_K 3
-
-struct Bigint {
- struct Bigint *next;
- int k; /* Parameter given to Balloc(k) */
- int maxwds; /* Allocated space: equals 1<<k. */
- short on_stack; /* 1 if stack-allocated. */
- short sign; /* 0 if value is positive or zero; 1 if negative. */
- int wds; /* Current length. */
- unsigned32 x[1<<BIGINT_MINIMUM_K]; /* Actually: x[maxwds] */
-};
-
-#define BIGINT_HEADER_SIZE \
- (sizeof(Bigint) - (1<<BIGINT_MINIMUM_K) * sizeof(unsigned32))
-
-typedef struct Bigint Bigint;
-
-/* Initialize a stack-allocated Bigint. */
-
-static Bigint *
-Binit
-#ifdef KR_headers
- (v) Bigint *v;
-#else
- (Bigint *v)
-#endif
-{
- v->on_stack = 1;
- v->k = BIGINT_MINIMUM_K;
- v->maxwds = 1 << BIGINT_MINIMUM_K;
- v->sign = v->wds = 0;
- return v;
-}
-
-/* Allocate a Bigint with '1<<k' big digits. */
-
-static Bigint *
-Balloc
-#ifdef KR_headers
- (k) int k;
-#else
- (int k)
-#endif
-{
- int x;
- Bigint *rv;
-
- if (k < BIGINT_MINIMUM_K)
- k = BIGINT_MINIMUM_K;
-
- x = 1 << k;
- rv = (Bigint *)
- malloc(BIGINT_HEADER_SIZE + x * sizeof(unsigned32));
- rv->k = k;
- rv->maxwds = x;
- rv->sign = rv->wds = 0;
- rv->on_stack = 0;
- return rv;
-}
-
-static void
-Bfree
-#ifdef KR_headers
- (v) Bigint *v;
-#else
- (Bigint *v)
-#endif
-{
- if (v && !v->on_stack)
- free (v);
-}
-
-static void
-Bcopy
-#ifdef KR_headers
- (x, y) Bigint *x, *y;
-#else
- (Bigint *x, Bigint *y)
-#endif
-{
- register unsigned32 *xp, *yp;
- register int i = y->wds;
- x->sign = y->sign;
- x->wds = i;
- for (xp = x->x, yp = y->x; --i >= 0; )
- *xp++ = *yp++;
-}
-
-/* Make sure b has room for at least 1<<k big digits. */
-
-static Bigint *
-Brealloc
-#ifdef KR_headers
- (b, k) Bigint *b; int k;
-#else
- (Bigint * b, int k)
-#endif
-{
- if (b == NULL)
- return Balloc(k);
- if (b->k >= k)
- return b;
- else
- {
- Bigint *rv = Balloc (k);
- Bcopy(rv, b);
- Bfree(b);
- return rv;
- }
-}
-
-/* Return b*m+a. b is modified.
- Assumption: 0xFFFF*m+a fits in 32 bits. */
-
-static Bigint *
-multadd
-#ifdef KR_headers
- (b, m, a) Bigint *b; int m, a;
-#else
- (Bigint *b, int m, int a)
-#endif
-{
- int i, wds;
- unsigned32 *x, y;
- unsigned32 xi, z;
-
- wds = b->wds;
- x = b->x;
- i = 0;
- do {
- xi = *x;
- y = (xi & 0xffff) * m + a;
- z = (xi >> 16) * m + (y >> 16);
- a = (int)(z >> 16);
- *x++ = (z << 16) + (y & 0xffff);
- }
- while(++i < wds);
- if (a) {
- if (wds >= b->maxwds)
- b = Brealloc(b, b->k+1);
- b->x[wds++] = a;
- b->wds = wds;
- }
- return b;
- }
-
-static Bigint *
-s2b
-#ifdef KR_headers
- (result, s, nd0, nd, y9)
- Bigint *result; CONST char *s; int nd0, nd; unsigned32 y9;
-#else
- (Bigint *result, CONST char *s, int nd0, int nd, unsigned32 y9)
-#endif
-{
- int i, k;
- _G_int32_t x, y;
-
- x = (nd + 8) / 9;
- for(k = 0, y = 1; x > y; y <<= 1, k++) ;
- result = Brealloc(result, k);
- result->x[0] = y9;
- result->wds = 1;
-
- i = 9;
- if (9 < nd0)
- {
- s += 9;
- do
- result = multadd(result, 10, *s++ - '0');
- while (++i < nd0);
- s++;
- }
- else
- s += 10;
- for(; i < nd; i++)
- result = multadd(result, 10, *s++ - '0');
- return result;
-}
-
-static int
-hi0bits
-#ifdef KR_headers
- (x) register unsigned32 x;
-#else
- (register unsigned32 x)
-#endif
-{
- register int k = 0;
-
- if (!(x & 0xffff0000)) {
- k = 16;
- x <<= 16;
- }
- if (!(x & 0xff000000)) {
- k += 8;
- x <<= 8;
- }
- if (!(x & 0xf0000000)) {
- k += 4;
- x <<= 4;
- }
- if (!(x & 0xc0000000)) {
- k += 2;
- x <<= 2;
- }
- if (!(x & 0x80000000)) {
- k++;
- if (!(x & 0x40000000))
- return 32;
- }
- return k;
- }
-
-static int
-lo0bits
-#ifdef KR_headers
- (y) unsigned32 *y;
-#else
- (unsigned32 *y)
-#endif
-{
- register int k;
- register unsigned32 x = *y;
-
- if (x & 7) {
- if (x & 1)
- return 0;
- if (x & 2) {
- *y = x >> 1;
- return 1;
- }
- *y = x >> 2;
- return 2;
- }
- k = 0;
- if (!(x & 0xffff)) {
- k = 16;
- x >>= 16;
- }
- if (!(x & 0xff)) {
- k += 8;
- x >>= 8;
- }
- if (!(x & 0xf)) {
- k += 4;
- x >>= 4;
- }
- if (!(x & 0x3)) {
- k += 2;
- x >>= 2;
- }
- if (!(x & 1)) {
- k++;
- x >>= 1;
- if (!x & 1)
- return 32;
- }
- *y = x;
- return k;
- }
-
-static Bigint *
-i2b
-#ifdef KR_headers
- (result, i) Bigint *result; int i;
-#else
- (Bigint* result, int i)
-#endif
-{
- result = Brealloc(result, 1);
- result->x[0] = i;
- result->wds = 1;
- return result;
-}
-
-/* Do: c = a * b. */
-
-static Bigint *
-mult
-#ifdef KR_headers
- (c, a, b) Bigint *a, *b, *c;
-#else
- (Bigint *c, Bigint *a, Bigint *b)
-#endif
-{
- int k, wa, wb, wc;
- unsigned32 carry, y, z;
- unsigned32 *x, *xa, *xae, *xb, *xbe, *xc, *xc0;
- unsigned32 z2;
- if (a->wds < b->wds) {
- Bigint *tmp = a;
- a = b;
- b = tmp;
- }
- k = a->k;
- wa = a->wds;
- wb = b->wds;
- wc = wa + wb;
- if (wc > a->maxwds)
- k++;
- c = Brealloc(c, k);
- for(x = c->x, xa = x + wc; x < xa; x++)
- *x = 0;
- xa = a->x;
- xae = xa + wa;
- xb = b->x;
- xbe = xb + wb;
- xc0 = c->x;
- for(; xb < xbe; xb++, xc0++) {
- if ((y = *xb & 0xffff)) {
- x = xa;
- xc = xc0;
- carry = 0;
- do {
- z = (*x & 0xffff) * y + (*xc & 0xffff) + carry;
- carry = z >> 16;
- z2 = (*x++ >> 16) * y + (*xc >> 16) + carry;
- carry = z2 >> 16;
- Storeinc(xc, z2, z);
- }
- while(x < xae);
- *xc = carry;
- }
- if ((y = *xb >> 16)) {
- x = xa;
- xc = xc0;
- carry = 0;
- z2 = *xc;
- do {
- z = (*x & 0xffff) * y + (*xc >> 16) + carry;
- carry = z >> 16;
- Storeinc(xc, z, z2);
- z2 = (*x++ >> 16) * y + (*xc & 0xffff) + carry;
- carry = z2 >> 16;
- }
- while(x < xae);
- *xc = z2;
- }
- }
- for(xc0 = c->x, xc = xc0 + wc; wc > 0 && !*--xc; --wc) ;
- c->wds = wc;
- return c;
- }
-
-/* Returns b*(5**k). b is modified. */
-/* Re-written by Per Bothner to not need a static list. */
-
-static Bigint *
-pow5mult
-#ifdef KR_headers
- (b, k) Bigint *b; int k;
-#else
- (Bigint *b, int k)
-#endif
-{
- static int p05[6] = { 5, 25, 125, 625, 3125, 15625 };
-
- for (; k > 6; k -= 6)
- b = multadd(b, 15625, 0); /* b *= 5**6 */
- if (k == 0)
- return b;
- else
- return multadd(b, p05[k-1], 0);
-}
-
-/* Re-written by Per Bothner so shift can be in place. */
-
-static Bigint *
-lshift
-#ifdef KR_headers
- (b, k) Bigint *b; int k;
-#else
- (Bigint *b, int k)
-#endif
-{
- int i;
- unsigned32 *x, *x1, *xe;
- int old_wds = b->wds;
- int n = k >> 5;
- int k1 = b->k;
- int n1 = n + old_wds + 1;
-
- if (k == 0)
- return b;
-
- for(i = b->maxwds; n1 > i; i <<= 1)
- k1++;
- b = Brealloc(b, k1);
-
- xe = b->x; /* Source limit */
- x = xe + old_wds; /* Source pointer */
- x1 = x + n; /* Destination pointer */
- if (k &= 0x1f) {
- int k1 = 32 - k;
- unsigned32 z = *--x;
- if ((*x1 = (z >> k1)) != 0) {
- ++n1;
- }
- while (x > xe) {
- unsigned32 w = *--x;
- *--x1 = (z << k) | (w >> k1);
- z = w;
- }
- *--x1 = z << k;
- }
- else
- do {
- *--x1 = *--x;
- } while(x > xe);
- while (x1 > xe)
- *--x1 = 0;
- b->wds = n1 - 1;
- return b;
-}
-
-static int
-cmp
-#ifdef KR_headers
- (a, b) Bigint *a, *b;
-#else
- (Bigint *a, Bigint *b)
-#endif
-{
- unsigned32 *xa, *xa0, *xb, *xb0;
- int i, j;
-
- i = a->wds;
- j = b->wds;
-#ifdef DEBUG
- if (i > 1 && !a->x[i-1])
- Bug("cmp called with a->x[a->wds-1] == 0");
- if (j > 1 && !b->x[j-1])
- Bug("cmp called with b->x[b->wds-1] == 0");
-#endif
- if (i -= j)
- return i;
- xa0 = a->x;
- xa = xa0 + j;
- xb0 = b->x;
- xb = xb0 + j;
- for(;;) {
- if (*--xa != *--xb)
- return *xa < *xb ? -1 : 1;
- if (xa <= xa0)
- break;
- }
- return 0;
- }
-
-/* Do: c = a-b. */
-
-static Bigint *
-diff
-#ifdef KR_headers
- (c, a, b) Bigint *c, *a, *b;
-#else
- (Bigint *c, Bigint *a, Bigint *b)
-#endif
-{
- int i, wa, wb;
- _G_int32_t borrow, y; /* We need signed shifts here. */
- unsigned32 *xa, *xae, *xb, *xbe, *xc;
- _G_int32_t z;
-
- i = cmp(a,b);
- if (!i) {
- c = Brealloc(c, 0);
- c->wds = 1;
- c->x[0] = 0;
- return c;
- }
- if (i < 0) {
- Bigint *tmp = a;
- a = b;
- b = tmp;
- i = 1;
- }
- else
- i = 0;
- c = Brealloc(c, a->k);
- c->sign = i;
- wa = a->wds;
- xa = a->x;
- xae = xa + wa;
- wb = b->wds;
- xb = b->x;
- xbe = xb + wb;
- xc = c->x;
- borrow = 0;
- do {
- y = (*xa & 0xffff) - (*xb & 0xffff) + borrow;
- borrow = y >> 16;
- Sign_Extend(borrow, y);
- z = (*xa++ >> 16) - (*xb++ >> 16) + borrow;
- borrow = z >> 16;
- Sign_Extend(borrow, z);
- Storeinc(xc, z, y);
- }
- while(xb < xbe);
- while(xa < xae) {
- y = (*xa & 0xffff) + borrow;
- borrow = y >> 16;
- Sign_Extend(borrow, y);
- z = (*xa++ >> 16) + borrow;
- borrow = z >> 16;
- Sign_Extend(borrow, z);
- Storeinc(xc, z, y);
- }
- while(!*--xc)
- wa--;
- c->wds = wa;
- return c;
- }
-
-static double
-ulp
-#ifdef KR_headers
- (x) double x;
-#else
- (double x)
-#endif
-{
- register _G_int32_t L;
- double a;
-
- L = (word0(x) & Exp_mask) - (P-1)*Exp_msk1;
-#ifndef Sudden_Underflow
- if (L > 0) {
-#endif
-#ifdef IBM
- L |= Exp_msk1 >> 4;
-#endif
- setwords(a, L, 0);
-#ifndef Sudden_Underflow
- }
- else {
- L = -L >> Exp_shift;
- if (L < Exp_shift)
- setwords(a, 0x80000 >> L, 0);
- else {
- L -= Exp_shift;
- setwords(a, 0, L >= 31 ? 1 : 1 << (31 - L));
- }
- }
-#endif
- return a;
- }
-
-static double
-b2d
-#ifdef KR_headers
- (a, e) Bigint *a; int *e;
-#else
- (Bigint *a, int *e)
-#endif
-{
- unsigned32 *xa, *xa0, w, y, z;
- int k;
- double d;
- unsigned32 d0, d1;
-
- xa0 = a->x;
- xa = xa0 + a->wds;
- y = *--xa;
-#ifdef DEBUG
- if (!y) Bug("zero y in b2d");
-#endif
- k = hi0bits(y);
- *e = 32 - k;
- if (k < Ebits) {
- d0 = Exp_1 | y >> (Ebits - k);
- w = xa > xa0 ? *--xa : 0;
-#ifndef _DOUBLE_IS_32BITS
- d1 = y << ((32-Ebits) + k) | w >> (Ebits - k);
-#endif
- goto ret_d;
- }
- z = xa > xa0 ? *--xa : 0;
- if (k -= Ebits) {
- d0 = Exp_1 | y << k | z >> (32 - k);
- y = xa > xa0 ? *--xa : 0;
-#ifndef _DOUBLE_IS_32BITS
- d1 = z << k | y >> (32 - k);
-#endif
- }
- else {
- d0 = Exp_1 | y;
-#ifndef _DOUBLE_IS_32BITS
- d1 = z;
-#endif
- }
- ret_d:
-#ifdef VAX
- setwords(d, d0 >> 16 | d0 << 16, d1 >> 16 | d1 << 16);
-#else
- setwords (d, d0, d1);
-#endif
- return d;
- }
-
-static Bigint *
-d2b
-#ifdef KR_headers
- (result, d, e, bits) Bigint *result; double d; _G_int32_t *e, *bits;
-#else
- (Bigint *result, double d, _G_int32_t *e, _G_int32_t *bits)
-#endif
-{
- int de, i, k;
- unsigned32 *x, y, z;
- unsigned32 d0, d1;
-#ifdef VAX
- d0 = word0(d) >> 16 | word0(d) << 16;
- d1 = word1(d) >> 16 | word1(d) << 16;
-#else
- d0 = word0(d);
- d1 = word1(d);
-#endif
-
- result = Brealloc(result, 1);
- x = result->x;
-
- z = d0 & Frac_mask;
- d0 &= 0x7fffffff; /* clear sign bit, which we ignore */
-
- de = (int)(d0 >> Exp_shift); /* The exponent part of d. */
-
- /* Put back the suppressed high-order bit, if normalized. */
-#ifndef IBM
-#ifndef Sudden_Underflow
- if (de)
-#endif
- z |= Exp_msk11;
-#endif
-
-#ifndef _DOUBLE_IS_32BITS
- if ((y = d1)) {
- if ((k = lo0bits(&y))) {
- x[0] = y | z << (32 - k);
- z >>= k;
- }
- else
- x[0] = y;
- i = result->wds = (x[1] = z) ? 2 : 1;
- }
- else {
-#endif /* !_DOUBLE_IS_32BITS */
-#ifdef DEBUG
- if (!z)
- Bug("Zero passed to d2b");
-#endif
- k = lo0bits(&z);
- x[0] = z;
- i = result->wds = 1;
-#ifndef _DOUBLE_IS_32BITS
- k += 32;
- }
-#endif
-#ifndef Sudden_Underflow
- if (de) {
-#endif
-#ifdef IBM
- *e = (de - Bias - (P-1) << 2) + k;
- *bits = 4*P + 8 - k - hi0bits(word0(d) & Frac_mask);
-#else
- *e = de - Bias - (P-1) + k;
- *bits = P - k;
-#endif
-#ifndef Sudden_Underflow
- }
- else {
- *e = de - Bias - (P-1) + 1 + k;
- *bits = 32*i - hi0bits(x[i-1]);
- }
-#endif
- return result;
- }
-
-static double
-ratio
-#ifdef KR_headers
- (a, b) Bigint *a, *b;
-#else
- (Bigint *a, Bigint *b)
-#endif
-{
- double da, db;
- int k, ka, kb;
-
- da = b2d(a, &ka);
- db = b2d(b, &kb);
- k = ka - kb + 32*(a->wds - b->wds);
-#ifdef IBM
- if (k > 0) {
- addword0(da, (k >> 2)*Exp_msk1);
- if (k &= 3)
- da *= 1 << k;
- }
- else {
- k = -k;
- addword0(db,(k >> 2)*Exp_msk1);
- if (k &= 3)
- db *= 1 << k;
- }
-#else
- if (k > 0)
- addword0(da, k*Exp_msk1);
- else {
- k = -k;
- addword0(db, k*Exp_msk1);
- }
-#endif
- return da / db;
- }
-
-static CONST double
-tens[] = {
- 1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9,
- 1e10, 1e11, 1e12, 1e13, 1e14, 1e15, 1e16, 1e17, 1e18, 1e19,
- 1e20, 1e21, 1e22
-#ifdef VAX
- , 1e23, 1e24
-#endif
- };
-
-#ifdef IEEE_Arith
-static CONST double bigtens[] = { 1e16, 1e32, 1e64, 1e128, 1e256 };
-static CONST double tinytens[] = { 1e-16, 1e-32, 1e-64, 1e-128, 1e-256 };
-#define n_bigtens 5
-#else
-#ifdef IBM
-static CONST double bigtens[] = { 1e16, 1e32, 1e64 };
-static CONST double tinytens[] = { 1e-16, 1e-32, 1e-64 };
-#define n_bigtens 3
-#else
-/* Also used for the case when !_DOUBLE_IS_32BITS. */
-static CONST double bigtens[] = { 1e16, 1e32 };
-static CONST double tinytens[] = { 1e-16, 1e-32 };
-#define n_bigtens 2
-#endif
-#endif
-
- double
-_IO_strtod
-#ifdef KR_headers
- (s00, se) CONST char *s00; char **se;
-#else
- (CONST char *s00, char **se)
-#endif
-{
- _G_int32_t bb2, bb5, bbe, bd2, bd5, bbbits, bs2, c, dsign,
- e, e1, esign, i, j, k, nd, nd0, nf, nz, nz0, sign;
- CONST char *s, *s0, *s1;
- double aadj, aadj1, adj, rv, rv0;
- _G_int32_t L;
- unsigned32 y, z;
- Bigint _bb, _b_avail, _bd, _bd0, _bs, _delta;
- Bigint *bb = Binit(&_bb);
- Bigint *bd = Binit(&_bd);
- Bigint *bd0 = Binit(&_bd0);
- Bigint *bs = Binit(&_bs);
- Bigint *b_avail = Binit(&_b_avail);
- Bigint *delta = Binit(&_delta);
-
- TEST_ENDIANNESS;
- sign = nz0 = nz = 0;
- rv = 0.;
- (void)&rv; /* Force rv into the stack */
- for(s = s00;;s++) switch(*s) {
- case '-':
- sign = 1;
- /* no break */
- case '+':
- if (*++s)
- goto break2;
- /* no break */
- case 0:
- /* "+" and "-" should be reported as an error? */
- sign = 0;
- s = s00;
- goto ret;
- case '\t':
- case '\n':
- case '\v':
- case '\f':
- case '\r':
- case ' ':
- continue;
- default:
- goto break2;
- }
- break2:
- if (*s == '0') {
- nz0 = 1;
- while(*++s == '0') ;
- if (!*s)
- goto ret;
- }
- s0 = s;
- y = z = 0;
- for(nd = nf = 0; (c = *s) >= '0' && c <= '9'; nd++, s++)
- if (nd < 9)
- y = 10*y + c - '0';
- else if (nd < 16)
- z = 10*z + c - '0';
- nd0 = nd;
- if (c == '.') {
- c = *++s;
- if (!nd) {
- for(; c == '0'; c = *++s)
- nz++;
- if (c > '0' && c <= '9') {
- s0 = s;
- nf += nz;
- nz = 0;
- goto have_dig;
- }
- goto dig_done;
- }
- for(; c >= '0' && c <= '9'; c = *++s) {
- have_dig:
- nz++;
- if (c -= '0') {
- nf += nz;
- for(i = 1; i < nz; i++)
- if (nd++ < 9)
- y *= 10;
- else if (nd <= DBL_DIG + 1)
- z *= 10;
- if (nd++ < 9)
- y = 10*y + c;
- else if (nd <= DBL_DIG + 1)
- z = 10*z + c;
- nz = 0;
- }
- }
- }
- dig_done:
- e = 0;
- if (c == 'e' || c == 'E') {
- if (!nd && !nz && !nz0) {
- s = s00;
- goto ret;
- }
- s00 = s;
- esign = 0;
- switch(c = *++s) {
- case '-':
- esign = 1;
- case '+':
- c = *++s;
- }
- if (c >= '0' && c <= '9') {
- while(c == '0')
- c = *++s;
- if (c > '0' && c <= '9') {
- e = c - '0';
- s1 = s;
- while((c = *++s) >= '0' && c <= '9')
- e = 10*e + c - '0';
- if (s - s1 > 8)
- /* Avoid confusion from exponents
- * so large that e might overflow.
- */
- e = 9999999;
- if (esign)
- e = -e;
- }
- else
- e = 0;
- }
- else
- s = s00;
- }
- if (!nd) {
- if (!nz && !nz0)
- s = s00;
- goto ret;
- }
- e1 = e -= nf;
-
- /* Now we have nd0 digits, starting at s0, followed by a
- * decimal point, followed by nd-nd0 digits. The number we're
- * after is the integer represented by those digits times
- * 10**e */
-
- if (!nd0)
- nd0 = nd;
- k = nd < DBL_DIG + 1 ? nd : DBL_DIG + 1;
- rv = y;
- if (k > 9)
- rv = tens[k - 9] * rv + z;
- if (nd <= DBL_DIG
-#ifndef RND_PRODQUOT
- && FLT_ROUNDS == 1
-#endif
- ) {
- if (!e)
- goto ret;
- if (e > 0) {
- if (e <= Ten_pmax) {
-#ifdef VAX
- goto vax_ovfl_check;
-#else
- /* rv = */ rounded_product(rv, tens[e]);
- goto ret;
-#endif
- }
- i = DBL_DIG - nd;
- if (e <= Ten_pmax + i) {
- /* A fancier test would sometimes let us do
- * this for larger i values.
- */
- e -= i;
- rv *= tens[i];
-#ifdef VAX
- /* VAX exponent range is so narrow we must
- * worry about overflow here...
- */
- vax_ovfl_check:
- addword0(rv, - P*Exp_msk1);
- /* rv = */ rounded_product(rv, tens[e]);
- if ((word0(rv) & Exp_mask)
- > Exp_msk1*(DBL_MAX_EXP+Bias-1-P))
- goto ovfl;
- addword0(rv, P*Exp_msk1);
-#else
- /* rv = */ rounded_product(rv, tens[e]);
-#endif
- goto ret;
- }
- }
-#ifndef Inaccurate_Divide
- else if (e >= -Ten_pmax) {
- /* rv = */ rounded_quotient(rv, tens[-e]);
- goto ret;
- }
-#endif
- }
- e1 += nd - k;
-
- /* Get starting approximation = rv * 10**e1 */
-
- if (e1 > 0) {
- if ((i = e1 & 15))
- rv *= tens[i];
- if (e1 &= ~15) {
- if (e1 > DBL_MAX_10_EXP) {
- ovfl:
- errno = ERANGE;
-#if defined(sun) && !defined(__svr4__)
-/* SunOS defines HUGE_VAL as __infinity(), which is in libm. */
-#undef HUGE_VAL
-#endif
-#ifndef HUGE_VAL
-#define HUGE_VAL 1.7976931348623157E+308
-#endif
- rv = HUGE_VAL;
- goto ret;
- }
- if (e1 >>= 4) {
- for(j = 0; e1 > 1; j++, e1 >>= 1)
- if (e1 & 1)
- rv *= bigtens[j];
- /* The last multiplication could overflow. */
- addword0(rv, -P*Exp_msk1);
- rv *= bigtens[j];
- if ((z = word0(rv) & Exp_mask)
- > Exp_msk1*(DBL_MAX_EXP+Bias-P))
- goto ovfl;
- if (z > Exp_msk1*(DBL_MAX_EXP+Bias-1-P)) {
- /* set to largest number */
- /* (Can't trust DBL_MAX) */
- setwords(rv, Big0, Big1);
- }
- else
- addword0(rv, P*Exp_msk1);
- }
-
- }
- }
- else if (e1 < 0) {
- e1 = -e1;
- if ((i = e1 & 15))
- rv /= tens[i];
- if (e1 &= ~15) {
- e1 >>= 4;
- for(j = 0; e1 > 1; j++, e1 >>= 1)
- if (e1 & 1)
- rv *= tinytens[j];
- /* The last multiplication could underflow. */
- rv0 = rv;
- rv *= tinytens[j];
- if (!rv) {
- rv = 2.*rv0;
- rv *= tinytens[j];
- if (!rv) {
- undfl:
- rv = 0.;
- errno = ERANGE;
- goto ret;
- }
- setwords(rv, Tiny0, Tiny1);
- /* The refinement below will clean
- * this approximation up.
- */
- }
- }
- }
-
- /* Now the hard part -- adjusting rv to the correct value.*/
-
- /* Put digits into bd: true value = bd * 10^e */
-
- bd0 = s2b(bd0, s0, nd0, nd, y);
- bd = Brealloc(bd, bd0->k);
-
- for(;;) {
- Bcopy(bd, bd0);
- bb = d2b(bb, rv, &bbe, &bbbits); /* rv = bb * 2^bbe */
- bs = i2b(bs, 1);
-
- if (e >= 0) {
- bb2 = bb5 = 0;
- bd2 = bd5 = e;
- }
- else {
- bb2 = bb5 = -e;
- bd2 = bd5 = 0;
- }
- if (bbe >= 0)
- bb2 += bbe;
- else
- bd2 -= bbe;
- bs2 = bb2;
-#ifdef Sudden_Underflow
-#ifdef IBM
- j = 1 + 4*P - 3 - bbbits + ((bbe + bbbits - 1) & 3);
-#else
- j = P + 1 - bbbits;
-#endif
-#else
- i = bbe + bbbits - 1; /* logb(rv) */
- if (i < Emin) /* denormal */
- j = bbe + (P-Emin);
- else
- j = P + 1 - bbbits;
-#endif
- bb2 += j;
- bd2 += j;
- i = bb2 < bd2 ? bb2 : bd2;
- if (i > bs2)
- i = bs2;
- if (i > 0) {
- bb2 -= i;
- bd2 -= i;
- bs2 -= i;
- }
- if (bb5 > 0) {
- Bigint *b_tmp;
- bs = pow5mult(bs, bb5);
- b_tmp = mult(b_avail, bs, bb);
- b_avail = bb;
- bb = b_tmp;
- }
- if (bb2 > 0)
- bb = lshift(bb, bb2);
- if (bd5 > 0)
- bd = pow5mult(bd, bd5);
- if (bd2 > 0)
- bd = lshift(bd, bd2);
- if (bs2 > 0)
- bs = lshift(bs, bs2);
- delta = diff(delta, bb, bd);
- dsign = delta->sign;
- delta->sign = 0;
- i = cmp(delta, bs);
- if (i < 0) {
- /* Error is less than half an ulp -- check for
- * special case of mantissa a power of two.
- */
- if (dsign || word1(rv) || word0(rv) & Bndry_mask)
- break;
- delta = lshift(delta,Log2P);
- if (cmp(delta, bs) > 0)
- goto drop_down;
- break;
- }
- if (i == 0) {
- /* exactly half-way between */
- if (dsign) {
- if ((word0(rv) & Bndry_mask1) == Bndry_mask1
- && word1(rv) == 0xffffffff) {
- /*boundary case -- increment exponent*/
- setword0(rv, (word0(rv) & Exp_mask)
- + Exp_msk1);
-#ifdef IBM
- setword0 (rv,
- word0(rv) | (Exp_msk1 >> 4));
-#endif
- setword1(rv, 0);
- break;
- }
- }
- else if (!(word0(rv) & Bndry_mask) && !word1(rv)) {
- drop_down:
- /* boundary case -- decrement exponent */
-#ifdef Sudden_Underflow
- L = word0(rv) & Exp_mask;
-#ifdef IBM
- if (L < Exp_msk1)
-#else
- if (L <= Exp_msk1)
-#endif
- goto undfl;
- L -= Exp_msk1;
-#else
- L = (word0(rv) & Exp_mask) - Exp_msk1;
-#endif
- setwords(rv, L | Bndry_mask1, 0xffffffff);
-#ifdef IBM
- continue;
-#else
- break;
-#endif
- }
-#ifndef ROUND_BIASED
- if (!(word1(rv) & LSB))
- break;
-#endif
- if (dsign)
- rv += ulp(rv);
-#ifndef ROUND_BIASED
- else {
- rv -= ulp(rv);
-#ifndef Sudden_Underflow
- if (!rv)
- goto undfl;
-#endif
- }
-#endif
- break;
- }
- if ((aadj = ratio(delta, bs)) <= 2.) {
- if (dsign)
- aadj = aadj1 = 1.;
- else if (word1(rv) || word0(rv) & Bndry_mask) {
-#ifndef Sudden_Underflow
- if (word1(rv) == Tiny1 && !word0(rv))
- goto undfl;
-#endif
- aadj = 1.;
- aadj1 = -1.;
- }
- else {
- /* special case -- power of FLT_RADIX to be */
- /* rounded down... */
-
- if (aadj < 2./FLT_RADIX)
- aadj = 1./FLT_RADIX;
- else
- aadj *= 0.5;
- aadj1 = -aadj;
- }
- }
- else {
- aadj *= 0.5;
- aadj1 = dsign ? aadj : -aadj;
-#ifdef Check_FLT_ROUNDS
- switch(FLT_ROUNDS) {
- case 2: /* towards +infinity */
- aadj1 -= 0.5;
- break;
- case 0: /* towards 0 */
- case 3: /* towards -infinity */
- aadj1 += 0.5;
- }
-#else
- if (FLT_ROUNDS == 0)
- aadj1 += 0.5;
-#endif
- }
- y = word0(rv) & Exp_mask;
-
- /* Check for overflow */
-
- if (y == Exp_msk1*(DBL_MAX_EXP+Bias-1)) {
- rv0 = rv;
- addword0(rv, - P*Exp_msk1);
- adj = aadj1 * ulp(rv);
- rv += adj;
- if ((word0(rv) & Exp_mask) >=
- Exp_msk1*(DBL_MAX_EXP+Bias-P)) {
- if (word0(rv0) == Big0 && word1(rv0) == Big1)
- goto ovfl;
- setwords(rv, Big0, Big1);
- continue;
- }
- else
- addword0(rv, P*Exp_msk1);
- }
- else {
-#ifdef Sudden_Underflow
- if ((word0(rv) & Exp_mask) <= P*Exp_msk1) {
- rv0 = rv;
- addword0(rv, P*Exp_msk1);
- adj = aadj1 * ulp(rv);
- rv += adj;
-#ifdef IBM
- if ((word0(rv) & Exp_mask) < P*Exp_msk1)
-#else
- if ((word0(rv) & Exp_mask) <= P*Exp_msk1)
-#endif
- {
- if (word0(rv0) == Tiny0
- && word1(rv0) == Tiny1)
- goto undfl;
- setwords(rv, Tiny0, Tiny1);
- continue;
- }
- else
- addword0(rv, -P*Exp_msk1);
- }
- else {
- adj = aadj1 * ulp(rv);
- rv += adj;
- }
-#else
- /* Compute adj so that the IEEE rounding rules will
- * correctly round rv + adj in some half-way cases.
- * If rv * ulp(rv) is denormalized (i.e.,
- * y <= (P-1)*Exp_msk1), we must adjust aadj to avoid
- * trouble from bits lost to denormalization;
- * example: 1.2e-307 .
- */
- if (y <= (P-1)*Exp_msk1 && aadj >= 1.) {
- aadj1 = (double)(int)(aadj + 0.5);
- if (!dsign)
- aadj1 = -aadj1;
- }
- adj = aadj1 * ulp(rv);
- rv += adj;
-#endif
- }
- z = word0(rv) & Exp_mask;
- if (y == z) {
- /* Can we stop now? */
- L = (_G_int32_t)aadj;
- aadj -= L;
- /* The tolerances below are conservative. */
- if (dsign || word1(rv) || word0(rv) & Bndry_mask) {
- if (aadj < .4999999 || aadj > .5000001)
- break;
- }
- else if (aadj < .4999999/FLT_RADIX)
- break;
- }
- }
- Bfree(bb);
- Bfree(bd);
- Bfree(bs);
- Bfree(bd0);
- Bfree(delta);
- Bfree(b_avail);
- ret:
- if (se)
- *se = (char *)s;
- return sign ? -rv : rv;
- }
-
-static int
-quorem
-#ifdef KR_headers
- (b, S) Bigint *b, *S;
-#else
- (Bigint *b, Bigint *S)
-#endif
-{
- int n;
- _G_int32_t borrow, y;
- unsigned32 carry, q, ys;
- unsigned32 *bx, *bxe, *sx, *sxe;
- _G_int32_t z;
- unsigned32 si, zs;
-
- n = S->wds;
-#ifdef DEBUG
- /*debug*/ if (b->wds > n)
- /*debug*/ Bug("oversize b in quorem");
-#endif
- if (b->wds < n)
- return 0;
- sx = S->x;
- sxe = sx + --n;
- bx = b->x;
- bxe = bx + n;
- q = *bxe / (*sxe + 1); /* ensure q <= true quotient */
-#ifdef DEBUG
- /*debug*/ if (q > 9)
- /*debug*/ Bug("oversized quotient in quorem");
-#endif
- if (q) {
- borrow = 0;
- carry = 0;
- do {
- si = *sx++;
- ys = (si & 0xffff) * q + carry;
- zs = (si >> 16) * q + (ys >> 16);
- carry = zs >> 16;
- y = (*bx & 0xffff) - (ys & 0xffff) + borrow;
- borrow = y >> 16;
- Sign_Extend(borrow, y);
- z = (*bx >> 16) - (zs & 0xffff) + borrow;
- borrow = z >> 16;
- Sign_Extend(borrow, z);
- Storeinc(bx, z, y);
- }
- while(sx <= sxe);
- if (!*bxe) {
- bx = b->x;
- while(--bxe > bx && !*bxe)
- --n;
- b->wds = n;
- }
- }
- if (cmp(b, S) >= 0) {
- q++;
- borrow = 0;
- carry = 0;
- bx = b->x;
- sx = S->x;
- do {
- si = *sx++;
- ys = (si & 0xffff) + carry;
- zs = (si >> 16) + (ys >> 16);
- carry = zs >> 16;
- y = (*bx & 0xffff) - (ys & 0xffff) + borrow;
- borrow = y >> 16;
- Sign_Extend(borrow, y);
- z = (*bx >> 16) - (zs & 0xffff) + borrow;
- borrow = z >> 16;
- Sign_Extend(borrow, z);
- Storeinc(bx, z, y);
- }
- while(sx <= sxe);
- bx = b->x;
- bxe = bx + n;
- if (!*bxe) {
- while(--bxe > bx && !*bxe)
- --n;
- b->wds = n;
- }
- }
- return q;
- }
-
-/* dtoa for IEEE arithmetic (dmg): convert double to ASCII string.
- *
- * Inspired by "How to Print Floating-Point Numbers Accurately" by
- * Guy L. Steele, Jr. and Jon L. White [Proc. ACM SIGPLAN '90, pp. 92-101].
- *
- * Modifications:
- * 1. Rather than iterating, we use a simple numeric overestimate
- * to determine k = floor(log10(d)). We scale relevant
- * quantities using O(log2(k)) rather than O(k) multiplications.
- * 2. For some modes > 2 (corresponding to ecvt and fcvt), we don't
- * try to generate digits strictly left to right. Instead, we
- * compute with fewer bits and propagate the carry if necessary
- * when rounding the final digit up. This is often faster.
- * 3. Under the assumption that input will be rounded nearest,
- * mode 0 renders 1e23 as 1e23 rather than 9.999999999999999e22.
- * That is, we allow equality in stopping tests when the
- * round-nearest rule will give the same floating-point value
- * as would satisfaction of the stopping test with strict
- * inequality.
- * 4. We remove common factors of powers of 2 from relevant
- * quantities.
- * 5. When converting floating-point integers less than 1e16,
- * we use floating-point arithmetic rather than resorting
- * to multiple-precision integers.
- * 6. When asked to produce fewer than 15 digits, we first try
- * to get by with floating-point arithmetic; we resort to
- * multiple-precision integer arithmetic only if we cannot
- * guarantee that the floating-point calculation has given
- * the correctly rounded result. For k requested digits and
- * "uniformly" distributed input, the probability is
- * something like 10^(k-15) that we must resort to the long
- * calculation.
- */
-
- char *
-_IO_dtoa
-#ifdef KR_headers
- (d, mode, ndigits, decpt, sign, rve)
- double d; int mode, ndigits, *decpt, *sign; char **rve;
-#else
- (double d, int mode, int ndigits, int *decpt, int *sign, char **rve)
-#endif
-{
- /* Arguments ndigits, decpt, sign are similar to those
- of ecvt and fcvt; trailing zeros are suppressed from
- the returned string. If not null, *rve is set to point
- to the end of the return value. If d is +-Infinity or NaN,
- then *decpt is set to 9999.
-
- mode:
- 0 ==> shortest string that yields d when read in
- and rounded to nearest.
- 1 ==> like 0, but with Steele & White stopping rule;
- e.g. with IEEE P754 arithmetic , mode 0 gives
- 1e23 whereas mode 1 gives 9.999999999999999e22.
- 2 ==> max(1,ndigits) significant digits. This gives a
- return value similar to that of ecvt, except
- that trailing zeros are suppressed.
- 3 ==> through ndigits past the decimal point. This
- gives a return value similar to that from fcvt,
- except that trailing zeros are suppressed, and
- ndigits can be negative.
- 4-9 should give the same return values as 2-3, i.e.,
- 4 <= mode <= 9 ==> same return as mode
- 2 + (mode & 1). These modes are mainly for
- debugging; often they run slower but sometimes
- faster than modes 2-3.
- 4,5,8,9 ==> left-to-right digit generation.
- 6-9 ==> don't try fast floating-point estimate
- (if applicable).
-
- Values of mode other than 0-9 are treated as mode 0.
-
- Sufficient space is allocated to the return value
- to hold the suppressed trailing zeros.
- */
-
- _G_int32_t bbits, b2, b5, be, dig, i, ieps, ilim, ilim0, ilim1,
- j, j1, k, k0, k_check, leftright, m2, m5, s2, s5,
- spec_case, try_quick;
- _G_int32_t L;
-#ifndef Sudden_Underflow
- int denorm;
-#endif
- Bigint _b_avail, _b, _mhi, _mlo, _S;
- Bigint *b_avail = Binit(&_b_avail);
- Bigint *b = Binit(&_b);
- Bigint *S = Binit(&_S);
- /* mhi and mlo are only set and used if leftright. */
- Bigint *mhi = NULL, *mlo = NULL;
- double d2, ds, eps;
- char *s, *s0;
- static Bigint *result = NULL;
- static int result_k;
-
- TEST_ENDIANNESS;
- if (result) {
- /* result is contains a string, so its fields (interpreted
- as a Bigint have been trashed. Restore them.
- This is a really ugly interface - result should
- not be static, since that is not thread-safe. FIXME. */
- result->k = result_k;
- result->maxwds = 1 << result_k;
- result->on_stack = 0;
- }
-
- if (word0(d) & Sign_bit) {
- /* set sign for everything, including 0's and NaNs */
- *sign = 1;
- setword0(d, word0(d) & ~Sign_bit); /* clear sign bit */
- }
- else
- *sign = 0;
-
-#if defined(IEEE_Arith) + defined(VAX)
-#ifdef IEEE_Arith
- if ((word0(d) & Exp_mask) == Exp_mask)
-#else
- if (word0(d) == 0x8000)
-#endif
- {
- /* Infinity or NaN */
- *decpt = 9999;
-#ifdef IEEE_Arith
- if (!word1(d) && !(word0(d) & 0xfffff))
- {
- s = "Infinity";
- if (rve)
- *rve = s + 8;
- }
- else
-#endif
- {
- s = "NaN";
- if (rve)
- *rve = s +3;
- }
- return s;
- }
-#endif
-#ifdef IBM
- d += 0; /* normalize */
-#endif
- if (!d) {
- *decpt = 1;
- s = "0";
- if (rve)
- *rve = s + 1;
- return s;
- }
-
- b = d2b(b, d, &be, &bbits);
- i = (int)(word0(d) >> Exp_shift1 & (Exp_mask>>Exp_shift1));
-#ifndef Sudden_Underflow
- if (i) {
-#endif
- d2 = d;
- setword0(d2, (word0(d2) & Frac_mask1) | Exp_11);
-#ifdef IBM
- if (j = 11 - hi0bits(word0(d2) & Frac_mask))
- d2 /= 1 << j;
-#endif
-
- i -= Bias;
-#ifdef IBM
- i <<= 2;
- i += j;
-#endif
-#ifndef Sudden_Underflow
- denorm = 0;
- }
- else {
- /* d is denormalized */
- unsigned32 x;
-
- i = bbits + be + (Bias + (P-1) - 1);
- x = i > 32 ? word0(d) << (64 - i) | word1(d) >> (i - 32)
- : word1(d) << (32 - i);
- d2 = x;
- addword0(d2, - 31*Exp_msk1); /* adjust exponent */
- i -= (Bias + (P-1) - 1) + 1;
- denorm = 1;
- }
-#endif
-
- /* Now i is the unbiased base-2 exponent. */
-
- /* log(x) ~=~ log(1.5) + (x-1.5)/1.5
- * log10(x) = log(x) / log(10)
- * ~=~ log(1.5)/log(10) + (x-1.5)/(1.5*log(10))
- * log10(d) = i*log(2)/log(10) + log10(d2)
- *
- * This suggests computing an approximation k to log10(d) by
- *
- * k = i*0.301029995663981
- * + ( (d2-1.5)*0.289529654602168 + 0.176091259055681 );
- *
- * We want k to be too large rather than too small.
- * The error in the first-order Taylor series approximation
- * is in our favor, so we just round up the constant enough
- * to compensate for any error in the multiplication of
- * (i) by 0.301029995663981; since |i| <= 1077,
- * and 1077 * 0.30103 * 2^-52 ~=~ 7.2e-14,
- * adding 1e-13 to the constant term more than suffices.
- * Hence we adjust the constant term to 0.1760912590558.
- * (We could get a more accurate k by invoking log10,
- * but this is probably not worthwhile.)
- */
-
- ds = (d2-1.5)*0.289529654602168 + 0.1760912590558 + i*0.301029995663981;
- k = (int)ds;
- if (ds < 0. && ds != k)
- k--; /* want k = floor(ds) */
- k_check = 1;
- if (k >= 0 && k <= Ten_pmax) {
- if (d < tens[k])
- k--;
- k_check = 0;
- }
- j = bbits - i - 1;
- if (j >= 0) {
- b2 = 0;
- s2 = j;
- }
- else {
- b2 = -j;
- s2 = 0;
- }
- if (k >= 0) {
- b5 = 0;
- s5 = k;
- s2 += k;
- }
- else {
- b2 -= k;
- b5 = -k;
- s5 = 0;
- }
- if (mode < 0 || mode > 9)
- mode = 0;
- try_quick = 1;
- if (mode > 5) {
- mode -= 4;
- try_quick = 0;
- }
- leftright = 1;
- switch(mode) {
- case 0:
- case 1:
- ilim = ilim1 = -1;
- i = 18;
- ndigits = 0;
- break;
- case 2:
- leftright = 0;
- /* no break */
- case 4:
- if (ndigits <= 0)
- ndigits = 1;
- ilim = ilim1 = i = ndigits;
- break;
- case 3:
- leftright = 0;
- /* no break */
- case 5:
- i = ndigits + k + 1;
- ilim = i;
- ilim1 = i - 1;
- if (i <= 0)
- i = 1;
- }
- /* i is now an upper bound of the number of digits to generate. */
- j = sizeof(unsigned32) * (1<<BIGINT_MINIMUM_K);
- /* The test is <= so as to allow room for the final '\0'. */
- for(result_k = BIGINT_MINIMUM_K; BIGINT_HEADER_SIZE + j <= i;
- j <<= 1) result_k++;
- if (!result || result_k > result->k)
- {
- Bfree (result);
- result = Balloc(result_k);
- }
- s = s0 = (char *)result;
-
- if (ilim >= 0 && ilim <= Quick_max && try_quick) {
-
- /* Try to get by with floating-point arithmetic. */
-
- i = 0;
- d2 = d;
- k0 = k;
- ilim0 = ilim;
- ieps = 2; /* conservative */
- if (k > 0) {
- ds = tens[k&0xf];
- j = k >> 4;
- if (j & Bletch) {
- /* prevent overflows */
- j &= Bletch - 1;
- d /= bigtens[n_bigtens-1];
- ieps++;
- }
- for(; j; j >>= 1, i++)
- if (j & 1) {
- ieps++;
- ds *= bigtens[i];
- }
- d /= ds;
- }
- else if ((j1 = -k)) {
- d *= tens[j1 & 0xf];
- for(j = j1 >> 4; j; j >>= 1, i++)
- if (j & 1) {
- ieps++;
- d *= bigtens[i];
- }
- }
- if (k_check && d < 1. && ilim > 0) {
- if (ilim1 <= 0)
- goto fast_failed;
- ilim = ilim1;
- k--;
- d *= 10.;
- ieps++;
- }
- eps = ieps*d + 7.;
- addword0(eps, - (P-1)*Exp_msk1);
- if (ilim == 0) {
- d -= 5.;
- if (d > eps)
- goto one_digit;
- if (d < -eps)
- goto no_digits;
- goto fast_failed;
- }
-#ifndef No_leftright
- if (leftright) {
- /* Use Steele & White method of only
- * generating digits needed.
- */
- eps = 0.5/tens[ilim-1] - eps;
- for(i = 0;;) {
- L = (_G_int32_t)d;
- d -= L;
- *s++ = '0' + (int)L;
- if (d < eps)
- goto ret1;
- if (1. - d < eps)
- goto bump_up;
- if (++i >= ilim)
- break;
- eps *= 10.;
- d *= 10.;
- }
- }
- else {
-#endif
- /* Generate ilim digits, then fix them up. */
- eps *= tens[ilim-1];
- for(i = 1;; i++, d *= 10.) {
- L = (_G_int32_t)d;
- d -= L;
- *s++ = '0' + (int)L;
- if (i == ilim) {
- if (d > 0.5 + eps)
- goto bump_up;
- else if (d < 0.5 - eps) {
- while(*--s == '0');
- s++;
- goto ret1;
- }
- break;
- }
- }
-#ifndef No_leftright
- }
-#endif
- fast_failed:
- s = s0;
- d = d2;
- k = k0;
- ilim = ilim0;
- }
-
- /* Do we have a "small" integer? */
-
- if (be >= 0 && k <= Int_max) {
- /* Yes. */
- ds = tens[k];
- if (ndigits < 0 && ilim <= 0) {
- if (ilim < 0 || d <= 5*ds)
- goto no_digits;
- goto one_digit;
- }
- for(i = 1;; i++) {
- L = (_G_int32_t)(d / ds);
- d -= L*ds;
-#ifdef Check_FLT_ROUNDS
- /* If FLT_ROUNDS == 2, L will usually be high by 1 */
- if (d < 0) {
- L--;
- d += ds;
- }
-#endif
- *s++ = '0' + (int)L;
- if (i == ilim) {
- d += d;
- if (d > ds || (d == ds && L & 1)) {
- bump_up:
- while(*--s == '9')
- if (s == s0) {
- k++;
- *s = '0';
- break;
- }
- ++*s++;
- }
- break;
- }
- if (!(d *= 10.))
- break;
- }
- goto ret1;
- }
-
- m2 = b2;
- m5 = b5;
- if (leftright) {
- if (mode < 2) {
- i =
-#ifndef Sudden_Underflow
- denorm ? be + (Bias + (P-1) - 1 + 1) :
-#endif
-#ifdef IBM
- 1 + 4*P - 3 - bbits + ((bbits + be - 1) & 3);
-#else
- 1 + P - bbits;
-#endif
- }
- else {
- j = ilim - 1;
- if (m5 >= j)
- m5 -= j;
- else {
- s5 += j -= m5;
- b5 += j;
- m5 = 0;
- }
- if ((i = ilim) < 0) {
- m2 -= i;
- i = 0;
- }
- }
- b2 += i;
- s2 += i;
- mhi = i2b(Binit(&_mhi), 1);
- }
- if (m2 > 0 && s2 > 0) {
- i = m2 < s2 ? m2 : s2;
- b2 -= i;
- m2 -= i;
- s2 -= i;
- }
- if (b5 > 0) {
- if (leftright) {
- if (m5 > 0) {
- Bigint *b_tmp;
- mhi = pow5mult(mhi, m5);
- b_tmp = mult(b_avail, mhi, b);
- b_avail = b;
- b = b_tmp;
- }
- if ((j = b5 - m5))
- b = pow5mult(b, j);
- }
- else
- b = pow5mult(b, b5);
- }
- S = i2b(S, 1);
- if (s5 > 0)
- S = pow5mult(S, s5);
-
- /* Check for special case that d is a normalized power of 2. */
-
- if (mode < 2) {
- if (!word1(d) && !(word0(d) & Bndry_mask)
-#ifndef Sudden_Underflow
- && word0(d) & Exp_mask
-#endif
- ) {
- /* The special case */
- b2 += Log2P;
- s2 += Log2P;
- spec_case = 1;
- }
- else
- spec_case = 0;
- }
-
- /* Arrange for convenient computation of quotients:
- * shift left if necessary so divisor has 4 leading 0 bits.
- *
- * Perhaps we should just compute leading 28 bits of S once
- * and for all and pass them and a shift to quorem, so it
- * can do shifts and ors to compute the numerator for q.
- */
- if ((i = ((s5 ? 32 - hi0bits(S->x[S->wds-1]) : 1) + s2) & 0x1f))
- i = 32 - i;
- if (i > 4) {
- i -= 4;
- b2 += i;
- m2 += i;
- s2 += i;
- }
- else if (i < 4) {
- i += 28;
- b2 += i;
- m2 += i;
- s2 += i;
- }
- if (b2 > 0)
- b = lshift(b, b2);
- if (s2 > 0)
- S = lshift(S, s2);
- if (k_check) {
- if (cmp(b,S) < 0) {
- k--;
- b = multadd(b, 10, 0); /* we botched the k estimate */
- if (leftright)
- mhi = multadd(mhi, 10, 0);
- ilim = ilim1;
- }
- }
- if (ilim <= 0 && mode > 2) {
- if (ilim < 0 || cmp(b,S = multadd(S,5,0)) <= 0) {
- /* no digits, fcvt style */
- no_digits:
- k = -1 - ndigits;
- goto ret;
- }
- one_digit:
- *s++ = '1';
- k++;
- goto ret;
- }
- if (leftright) {
- if (m2 > 0)
- mhi = lshift(mhi, m2);
-
- /* Compute mlo -- check for special case
- * that d is a normalized power of 2.
- */
-
- if (spec_case) {
- mlo = Brealloc(Binit(&_mlo), mhi->k);
- Bcopy(mlo, mhi);
- mhi = lshift(mhi, Log2P);
- }
- else
- mlo = mhi;
-
- for(i = 1;;i++) {
- dig = quorem(b,S) + '0';
- /* Do we yet have the shortest decimal string
- * that will round to d?
- */
- j = cmp(b, mlo);
- b_avail = diff(b_avail, S, mhi); /* b_avail = S - mi */
- j1 = b_avail->sign ? 1 : cmp(b, b_avail);
-#ifndef ROUND_BIASED
- if (j1 == 0 && !mode && !(word1(d) & 1)) {
- if (dig == '9')
- goto round_9_up;
- if (j > 0)
- dig++;
- *s++ = dig;
- goto ret;
- }
-#endif
- if (j < 0 || (j == 0 && !mode
-#ifndef ROUND_BIASED
- && !(word1(d) & 1)
-#endif
- )) {
- if (j1 > 0) {
- b = lshift(b, 1);
- j1 = cmp(b, S);
- if ((j1 > 0 || (j1 == 0 && dig & 1))
- && dig++ == '9')
- goto round_9_up;
- }
- *s++ = dig;
- goto ret;
- }
- if (j1 > 0) {
- if (dig == '9') { /* possible if i == 1 */
- round_9_up:
- *s++ = '9';
- goto roundoff;
- }
- *s++ = dig + 1;
- goto ret;
- }
- *s++ = dig;
- if (i == ilim)
- break;
- b = multadd(b, 10, 0);
- if (mlo == mhi)
- mlo = mhi = multadd(mhi, 10, 0);
- else {
- mlo = multadd(mlo, 10, 0);
- mhi = multadd(mhi, 10, 0);
- }
- }
- }
- else
- for(i = 1;; i++) {
- *s++ = dig = quorem(b,S) + '0';
- if (i >= ilim)
- break;
- b = multadd(b, 10, 0);
- }
-
- /* Round off last digit */
-
- b = lshift(b, 1);
- j = cmp(b, S);
- if (j > 0 || (j == 0 && dig & 1)) {
- roundoff:
- while(*--s == '9')
- if (s == s0) {
- k++;
- *s++ = '1';
- goto ret;
- }
- ++*s++;
- }
- else {
- while(*--s == '0');
- s++;
- }
- ret:
- Bfree(b_avail);
- Bfree(S);
- if (mhi) {
- if (mlo && mlo != mhi)
- Bfree(mlo);
- Bfree(mhi);
- }
- ret1:
- Bfree(b);
- *s = 0;
- *decpt = k + 1;
- if (rve)
- *rve = s;
- return s0;
- }
-#endif /* _IO_USE_DTOA */
diff --git a/contrib/libio/floatio.h b/contrib/libio/floatio.h
deleted file mode 100644
index 827767bde359..000000000000
--- a/contrib/libio/floatio.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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. */
-
-/*
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms are permitted
- * provided that the above copyright notice and this paragraph are
- * duplicated in all such forms and that any documentation,
- * advertising materials, and other materials related to such
- * distribution and use acknowledge that the software was developed
- * by the University of California, Berkeley. The name of the
- * University may not be used to endorse or promote products derived
- * from this software without specific prior written permission.
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- *
- * %W% (Berkeley) %G%
- */
-
-/*
- * Floating point scanf/printf (input/output) definitions.
- */
-
-/* 11-bit exponent (VAX G floating point) is 308 decimal digits */
-#define MAXEXP 308
-/* 128 bit fraction takes up 39 decimal digits; max reasonable precision */
-#define MAXFRACT 39
diff --git a/contrib/libio/fstream.cc b/contrib/libio/fstream.cc
deleted file mode 100644
index 8930e0b9271f..000000000000
--- a/contrib/libio/fstream.cc
+++ /dev/null
@@ -1,110 +0,0 @@
-/* This is part of libio/iostream, providing -*- C++ -*- input/output.
-Copyright (C) 1993 Free Software Foundation
-
-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.
-
-Written by Per Bothner (bothner@cygnus.com). */
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#define _STREAM_COMPAT
-extern "C" {
-#include "libioP.h"
-}
-#include <fstream.h>
-
-inline void
-fstreambase::__fb_init()
-{
-#ifdef _IO_NEW_STREAMS
-#if !_IO_UNIFIED_JUMPTABLES
- /* Uses the _IO_file_jump jumptable, for eficiency. */
- __my_fb._jumps = &_IO_file_jumps;
- __my_fb._vtable() = builtinbuf_vtable;
-#endif
- init (&__my_fb);
-#else
- init(filebuf::__new());
- _flags &= ~ios::dont_close;
-#endif
-}
-
-fstreambase::fstreambase()
-{
- __fb_init ();
-}
-
-fstreambase::fstreambase(int fd)
-{
- __fb_init ();
- _IO_file_attach(rdbuf(), fd);
-}
-
-fstreambase::fstreambase(const char *name, int mode, int prot)
-{
- __fb_init ();
- if (!rdbuf()->open(name, mode, prot))
- set(ios::badbit);
-}
-
-fstreambase::fstreambase(int fd, char *p, int l)
-{
-#ifdef _IO_NEW_STREAMS
- __fb_init ();
-#else
- init(filebuf::__new());
-#endif
- _IO_file_attach(rdbuf(), fd);
- _IO_file_setbuf(rdbuf(), p, l);
-}
-
-void fstreambase::open(const char *name, int mode, int prot)
-{
- clear();
- if (!rdbuf()->open(name, mode, prot))
- set(ios::badbit);
-}
-
-void fstreambase::close()
-{
- if (!rdbuf()->close())
- set(ios::failbit);
-}
-
-void fstreambase::attach(int fd)
-{
- if (!rdbuf()->attach(fd))
- set(ios::failbit);
-}
-
-#if 0
-static int mode_to_sys(enum open_mode mode)
-{
- return O_WRONLY;
-}
-
-static char* fopen_cmd_arg(io_mode i)
-{
- return "w";
-}
-#endif
diff --git a/contrib/libio/fstream.h b/contrib/libio/fstream.h
deleted file mode 100644
index b5f6598538f2..000000000000
--- a/contrib/libio/fstream.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/* This is part of libio/iostream, providing -*- C++ -*- input/output.
-Copyright (C) 1993, 2000 Free Software Foundation
-
-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. */
-
-#ifndef _FSTREAM_H
-#define _FSTREAM_H
-#ifdef __GNUG__
-#pragma interface
-#endif
-#include <iostream.h>
-
-extern "C++" {
-class fstreambase : virtual public ios {
-#ifdef _IO_NEW_STREAMS
- mutable filebuf __my_fb; // mutable so rdbuf() can be const
-#endif
- void __fb_init ();
- public:
- fstreambase();
- fstreambase(int fd);
- fstreambase(int fd, char *p, int l); /* Deprecated */
- fstreambase(const char *name, int mode, int prot=0664);
- void close();
-#ifdef _IO_NEW_STREAMS
- filebuf* rdbuf() const { return &__my_fb; }
-#else
- filebuf* rdbuf() const { return (filebuf*) ios::rdbuf(); }
-#endif
- void open(const char *name, int mode, int prot=0664);
- int is_open() const { return rdbuf()->is_open(); }
- void setbuf(char *ptr, int len) { rdbuf()->setbuf(ptr, len); }
- void attach(int fd);
-#ifdef _STREAM_COMPAT
- int filedesc() { return rdbuf()->fd(); }
- fstreambase& raw() { rdbuf()->setbuf(NULL, 0); return *this; }
-#endif
-};
-
-class ifstream : public fstreambase, public istream {
- public:
- ifstream() : fstreambase() { }
- ifstream(int fd) : fstreambase(fd) { }
- ifstream(int fd, char *p, int l) : fstreambase(fd, p, l) { } /*Deprecated*/
- ifstream(const char *name, int mode=ios::in, int prot=0664)
- : fstreambase(name, mode | ios::in, prot) { }
- void open(const char *name, int mode=ios::in, int prot=0664)
- { fstreambase::open(name, mode | ios::in, prot); }
-};
-
-class ofstream : public fstreambase, public ostream {
- public:
- ofstream() : fstreambase() { }
- ofstream(int fd) : fstreambase(fd) { }
- ofstream(int fd, char *p, int l) : fstreambase(fd, p, l) { } /*Deprecated*/
- ofstream(const char *name, int mode=ios::out, int prot=0664)
- : fstreambase(name, mode | ios::out, prot) { }
- void open(const char *name, int mode=ios::out, int prot=0664)
- { fstreambase::open(name, mode | ios::out, prot); }
-};
-
-class fstream : public fstreambase, public iostream {
- public:
- fstream() : fstreambase() { }
- fstream(int fd) : fstreambase(fd) { }
- fstream(const char *name, int mode, int prot=0664)
- : fstreambase(name, mode, prot) { }
- fstream(int fd, char *p, int l) : fstreambase(fd, p, l) { } /*Deprecated*/
- void open(const char *name, int mode, int prot=0664)
- { fstreambase::open(name, mode, prot); }
-};
-} // extern "C++"
-#endif /*!_FSTREAM_H*/
diff --git a/contrib/libio/gen-params b/contrib/libio/gen-params
deleted file mode 100755
index afb8f3b03c04..000000000000
--- a/contrib/libio/gen-params
+++ /dev/null
@@ -1,739 +0,0 @@
-#!/bin/sh
-# Copyright (C) 1992, 1993, 1994, 1997, 1998, 1999 Free Software Foundation
-#
-# 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.
-
-# Written by Per Bothner (bothner@cygnus.com)
-
-# This is a shell-script that figures out various things about a
-# system, and writes (to stdout) a C-style include files with
-# suitable definitions, including all the standard Posix types.
-# It works by compiling various test programs -- some are run through
-# the C pre-processor, and the output examined.
-# The test programs are only compiled, not executed, so the script
-# should even if you're cross-compiling.
-# It uses $CC (which defaults to cc) to compile C programs (extension .c),
-# and $CXX (which defaults to gcc) to compile C++ programs (extension .C).
-# The shell-script is written for libg++.a.
-
-# Usage: gen-params [NAME1=name1 ...]
-# - where an assignment (such as size_t="unsigned int" means to
-# use that value, instead of trying to figure it out.
-
-# Uncomment following line for debugging
-# set -x
-
-SED=sed
-
-# Evaluate the arguments (which should be assignments):
-for arg in "$@"; do
- # Quote arg (i.e. FOO=bar => FOO='bar'), then eval it.
- eval `echo "$arg" | ${SED} -e "s|^\(.*\)=\(.*\)|\1='\2'|"`
-done
-
-macro_prefix=${macro_prefix-"_G_"}
-rootdir=`pwd`/..
-gccdir=${gccdir-${rootdir}/gcc}
-binutilsdir=${binutilsdir-${rootdir}/binutils}
-CC=${CC-`if [ -f ${gccdir}/xgcc ] ; \
- then echo ${gccdir}/xgcc -B${gccdir}/ ; \
- else echo cc ; fi`}
-CXX=${CXX-`if [ -f ${gccdir}/xgcc ] ; \
- then echo ${gccdir}/xgcc -B${gccdir}/ ; \
- else echo gcc ; fi`}
-CPP=${CPP-`echo ${CC} -E`}
-CONFIG_NM=${CONFIG_NM-`if [ -f ${binutilsdir}/nm.new ] ; \
- then echo ${binutilsdir}/nm.new ; \
- else echo nm ; fi`}
-
-cat <<!EOF!
-/* AUTOMATICALLY GENERATED; DO NOT EDIT! */
-#ifndef ${macro_prefix}config_h
-#define ${macro_prefix}config_h
-!EOF!
-
-if [ x"${LIB_VERSION}" != "x" ] ; then
- echo "#define ${macro_prefix}LIB_VERSION" '"'${LIB_VERSION}'"'
-fi
-
-# This program is used to test if the compiler prepends '_' before identifiers.
-# It is also used to check the g++ uses '$' or '.' various places.
-
-if test -z "${NAMES_HAVE_UNDERSCORE}" \
- || test -z "${DOLLAR_IN_LABEL}" \
- || test -z "${VTABLE_LABEL_PREFIX}"; then
- cat >dummy.h <<!EOF!
-#ifdef __GNUG__
-#pragma interface
-#endif
- struct filebuf {
- virtual int foo();
- };
-!EOF!
- cat >dummy.C <<!EOF!
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include "dummy.h"
- int filebuf::foo() { return 0; }
- extern "C" int FUNC(int);
- int FUNC(int i) { return i+10; }
-!EOF!
-
- if ${CXX} -O -c dummy.C ; then
- if test -z "${NAMES_HAVE_UNDERSCORE}" ; then
- if test "`${CONFIG_NM} dummy.o | grep _FUNC`" != ""; then
- NAMES_HAVE_UNDERSCORE=1
- elif test "`${CONFIG_NM} dummy.o | grep FUNC`" != ""; then
- NAMES_HAVE_UNDERSCORE=0
- else
- echo "${CONFIG_NM} failed to find FUNC in dummy.o!" 1>&2; exit -1;
- fi
- fi
- echo "#define ${macro_prefix}NAMES_HAVE_UNDERSCORE ${NAMES_HAVE_UNDERSCORE}"
-
- if test -z "${VTABLE_LABEL_PREFIX}" ; then
- # Determine how virtual function tables are named. This is fragile,
- # because different nm's produce output in different formats.
- ${CONFIG_NM} dummy.o >TMP
- if [ -n "`${SED} -n -e 's/ virtual table/nope/p' <TMP`" ] ; then
- ${CONFIG_NM} --no-cplus dummy.o >TMP 2>/dev/null ||
- ${CONFIG_NM} --no-demangle dummy.o >TMP 2>/dev/null ||
- ${CONFIG_NM} dummy.o >TMP 2>/dev/null
- fi
- # First we look for a pattern that matches historical output from g++.
- # We surround the actual label name by <> to separate it from
- # other nm junk.
- ${SED} -n -e 's/_*vt[$_.]7*filebuf/<&>/p' <TMP >dummy.out
- # For paranoia's sake (e.g. if we're using some other C++ compiler)
- # we try a more general pattern, and append the result.
- grep -v foo <TMP \
- | ${SED} -n -e 's/[a-zA-Z0-9_.$]*filebuf[a-zA-Z0-9_.$]*/<&>/p' \
- >>dummy.out
- # Now we get rid of the <>, and any other junk on the nm output line.
- # (We get rid of <filebuf> in case nm included debugging output for
- # class filebuf itself.) On windows32, we also need to delete the
- # unique sections (.data$_vt$*), otherwise we get the wrong result.
- # Finally, we select the first line of the result, and hope that's
- # what we wanted!
- vtab_name=`${SED} -n -e '/<filebuf>/d' \
- -e '/\.data[$_.]<_vt\$7filebuf>/d' \
- -e 's/^.*<\(.*\)>.*$/\1/p' \
- <dummy.out | ${SED} -n -e '1p'`
- case "${vtab_name}" in
- *7filebuf) echo "#define ${macro_prefix}VTABLE_LABEL_HAS_LENGTH 1" ;;
- *) echo "#define ${macro_prefix}VTABLE_LABEL_HAS_LENGTH 0" ;;
- esac
- VTABLE_LABEL_PREFIX=`echo $vtab_name | ${SED} -e 's/7*filebuf//'`
- fi
- echo "#define ${macro_prefix}VTABLE_LABEL_PREFIX" '"'"${VTABLE_LABEL_PREFIX}"'"'
- if [ "${VTABLE_LABEL_PREFIX}" = "__vt_" -o \
- "${VTABLE_LABEL_PREFIX}" = "___vt_" ] ; then
- echo "#define ${macro_prefix}USING_THUNKS"
- fi
-
- # VTABLE_LABEL_PREFIX_ID is the same as VTABLE_LABEL_PREFIX,
- # but the former is a C identifier, while the latter is a quoted
- # st
- if [ -z ""`echo ${VTABLE_LABEL_PREFIX} | ${SED} -e 's/[a-zA-Z0-9_]//g'` ] ; then
- if [ "${NAMES_HAVE_UNDERSCORE}" = "1" ] ; then
- VTABLE_LABEL_PREFIX=`echo ${VTABLE_LABEL_PREFIX} | ${SED} -e 's/^_//'`
- fi
- echo "#define ${macro_prefix}VTABLE_LABEL_PREFIX_ID ${VTABLE_LABEL_PREFIX}"
- fi
-
-# if test -n "${DOLLAR_IN_LABEL}" ; then
-# echo "#define ${macro_prefix}DOLLAR_IN_LABEL ${DOLLAR_IN_LABEL}"
-# elif test "`${CONFIG_NM} dummy.o | grep 'vt[$$]7filebuf'`" != ""; then
-# echo "#define ${macro_prefix}DOLLAR_IN_LABEL 1"
-# elif test "`${CONFIG_NM} dummy.o | grep 'vt[.]7filebuf'`" != ""; then
-# echo "#define ${macro_prefix}DOLLAR_IN_LABEL 0"
-# elif test "`${CONFIG_NM} dummy.o | grep 'vtbl__7filebuf'`" != ""; then
-# echo "#define ${macro_prefix}DOLLAR_IN_LABEL 0"
-# else
-# echo "gen-params: ${CONFIG_NM} failed to find vt[.\$]filebuf in dummy.o!" 1>&2; exit 1
-# fi
- else
- # The compile failed for some reason (no C++?)
- echo "gen-params: could not compile dummy.C with ${CXX}" 1>&2; exit 1;
- fi
-fi
-
-# A little test program to check if struct stat has st_blksize.
-cat >dummy.c <<!EOF!
-#include <sys/types.h>
-#include <sys/stat.h>
-int BLKSIZE(struct stat *st)
-{
- return st->st_blksize;
-}
-!EOF!
-
-if ${CC} -c dummy.c >/dev/null 2>&1 ; then
- echo "#define ${macro_prefix}HAVE_ST_BLKSIZE 1"
-else
- echo "#define ${macro_prefix}HAVE_ST_BLKSIZE 0"
-fi
-
-# A little test program to check if the name 'clog' is defined in libm,
-# as it is under DEC UNIX.
-cat >dummy.c <<!EOF!
-int clog;
-main () {}
-!EOF!
-
-if ${CC} dummy.c -lm 2>&1 >/dev/null | grep clog >/dev/null; then
- echo "#define ${macro_prefix}CLOG_CONFLICT 1"
-fi
-
-echo ""
-
-# Next, generate definitions for the standard types (such as mode_t)
-# compatible with those in the standard C header files.
-# It works by a dummy program through the C pre-processor, and then
-# using sed to search for typedefs in the output.
-
-for hdr in wchar wctype; do
- eval $hdr=0
- cat >dummy.c <<EOF
-#include <${hdr}.h>
-EOF
- if ${CPP} dummy.c >/dev/null 2>&1 ; then eval $hdr=1; fi
-done
-
-cat >dummy.c <<!EOF!
-#include <sys/types.h>
-#include <stddef.h>
-#ifdef __STDC__
-#include <stdarg.h>
-#else /* !__STDC__ */
-#include <varargs.h>
-#endif /* __STDC__ */
-#include <stdio.h>
-#include <time.h>
-#include <signal.h>
-#ifdef __STDC__
-#include <limits.h>
-#endif
-#if WCHAR == 1
-#include <wchar.h>
-#endif
-#if WCTYPE == 1
-#include <wctype.h>
-#endif
-#ifdef size_t
-typedef size_t Xsize_t;
-#elif defined(__SIZE_TYPE__)
-typedef __SIZE_TYPE__ Xsize_t;
-#endif
-#ifdef ptrdiff_t
-typedef ptrdiff_t Xptrdiff_t;
-#elif defined(__PTRDIFF_TYPE__)
-typedef __PTRDIFF_TYPE__ Xptrdiff_t;
-#endif
-#ifdef wchar_t
-typedef wchar_t Xwchar_t;
-#elif defined(__WCHAR_TYPE__)
-typedef __WCHAR_TYPE__ Xwchar_t;
-#endif
-#ifdef va_list
-typedef va_list XXXva_list;
-#endif
-#ifdef BUFSIZ
-long XBUFSIZ=BUFSIZ;
-#endif
-#ifdef FOPEN_MAX
-long XFOPEN_MAX=FOPEN_MAX;
-#endif
-#ifdef FILENAME_MAX
-long XFILENAME_MAX=FILENAME_MAX;
-#endif
-#ifdef SHRT_MAX
-long XSHRT_MAX=SHRT_MAX;
-#endif
-#ifdef INT_MAX
-long XINT_MAX=INT_MAX;
-#endif
-#ifdef LONG_MAX
-long XLONG_MAX=LONG_MAX;
-#endif
-#ifdef LONG_LONG_MAX
-long XLONG_LONG_MAX=LONG_LONG_MAX;
-#endif
-!EOF!
-
-if ${CPP} dummy.c -DWCHAR=$wchar -DWCTYPE=$wctype >TMP ; then true
-else
- echo "gen-params: could not invoke ${CPP} on dummy.c" 1>&2 ; exit 1
-fi
-tr ' ' ' ' <TMP >dummy.out
-
-for TYPE in dev_t clock_t fpos_t gid_t ino_t mode_t nlink_t off_t pid_t ptrdiff_t sigset_t size_t ssize_t time_t uid_t va_list wchar_t wint_t int16_t uint16_t int32_t uint_32_t u_int16_t u_int32_t; do
- eval IMPORTED=\$$TYPE
- if [ -n "${IMPORTED}" ] ; then
- eval "$TYPE='$IMPORTED'"
- else
- t=$TYPE
- VALUE=''
-
- # Follow `typedef VALUE TYPE' chains, but don't loop indefinitely.
- for iteration in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20; do
- # Search dummy.out for a typedef for X*$t.
- sed_script="
- s/unsigned long long int/_G_ullong/g
- s/long long int/_G_llong/g
- s/unsigned long long/_G_ullong/g
- s/long long/_G_llong/g
- /.*typedef *\\(.*[^ ]\\) *X*$t *;.*/{s||\1|;p;q;}
- /.*typedef *\\(.*[^ a-zA-Z0-9_]\\)X*$t *;.*/{s||\1|;p;q;}
- "
- t=`${SED} -n "$sed_script" <dummy.out`
- case "$t" in
- '')
- break;;
- *)
- # Found a type $t; save it in VALUE.
- VALUE=$t
- # If it won't cause problems in matching,
- # look for a typedef for it in turn.
- case "$VALUE" in
- *.* | */* | *\ * | *\** | *\[* | *\\*) break;;
- esac;;
- esac
- done
-
- case "$VALUE" in
- ?*) eval "$TYPE=\"$VALUE\""
- esac
- fi
-done
-
-# Look for some standard macros.
-for NAME in BUFSIZ FOPEN_MAX FILENAME_MAX NULL; do
- eval IMPORTED=\$$NAME
- if [ -n "${IMPORTED}" ] ; then
- eval "$NAME='$IMPORTED /* specified */'"
- else
- rm -f TMP
- ${SED} -n -e 's| *;|;|g' -e "s|long X${NAME}= *\(.*\);|\1|w TMP" \
- <dummy.out>/dev/null
- # Now select the first definition.
- if [ -s TMP ]; then
- eval "$NAME='"`${SED} -e '2,$d' <TMP`"'"
- fi
- fi
-done
-
-# These macros must be numerical constants; strip any trailing 'L's.
-for NAME in SHRT_MAX INT_MAX LONG_MAX LONG_LONG_MAX; do
- eval IMPORTED=\$$NAME
- if [ -n "${IMPORTED}" ] ; then
- eval "$NAME='$IMPORTED /* specified */'"
- else
- rm -f TMP
- ${SED} -n -e 's| *;|;|g' -e "s|long X${NAME}= *\([0-9]*\)L* *;|\1|w TMP" \
- <dummy.out>/dev/null
- # Now select the first definition.
- if [ -s TMP ]; then
- eval "$NAME='"`${SED} -e '2,$d' <TMP`"'"
- fi
- fi
-done
-
-# Figure out integral type sizes.
-
-default_int16='short /* deduction failed */'
-default_int32='long /* deduction failed */'
-INT16=32767
-INT32=2147483647
-
-if [ "${SHRT_MAX}" = $INT16 ] ; then
- default_int16='short /* deduced */'
- if [ "${LONG_MAX}" = $INT32 ] ; then
- default_int32='long /* deduced */'
- elif [ "${INT_MAX}" = $INT32 ] ; then
- default_int32='int /* deduced */'
- fi
-fi
-
-[ -n "$u_int16_t" ] && uint16_t="$u_int16_t"
-[ -n "$u_int32_t" ] && uint32_t="$u_int32_t"
-
-[ -z "$int16_t" ] && int16_t="$default_int16"
-[ -z "$uint16_t" ] && uint16_t="unsigned $int16_t"
-[ -z "$int32_t" ] && int32_t="$default_int32"
-[ -z "$uint32_t" ] && uint32_t="unsigned $int32_t"
-
-cat <<!EOF!
-#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
-typedef int ${macro_prefix}int8_t __attribute__((__mode__(__QI__)));
-typedef unsigned int ${macro_prefix}uint8_t __attribute__((__mode__(__QI__)));
-typedef int ${macro_prefix}int16_t __attribute__((__mode__(__HI__)));
-typedef unsigned int ${macro_prefix}uint16_t __attribute__((__mode__(__HI__)));
-typedef int ${macro_prefix}int32_t __attribute__((__mode__(__SI__)));
-typedef unsigned int ${macro_prefix}uint32_t __attribute__((__mode__(__SI__)));
-typedef int ${macro_prefix}int64_t __attribute__((__mode__(__DI__)));
-typedef unsigned int ${macro_prefix}uint64_t __attribute__((__mode__(__DI__)));
-#if __GNUC__ > 2 || __GNUC_MINOR__ >= 8
-__extension__ typedef long long ${macro_prefix}llong;
-__extension__ typedef unsigned long long ${macro_prefix}ullong;
-#endif
-#else
-typedef $int16_t ${macro_prefix}int16_t;
-typedef $uint16_t ${macro_prefix}uint16_t;
-typedef $int32_t ${macro_prefix}int32_t;
-typedef $uint32_t ${macro_prefix}uint32_t;
-#endif
-
-typedef ${clock_t-int /* default */} ${macro_prefix}clock_t;
-typedef ${dev_t-int /* default */} ${macro_prefix}dev_t;
-typedef ${fpos_t-long /* default */} ${macro_prefix}fpos_t;
-typedef ${gid_t-int /* default */} ${macro_prefix}gid_t;
-typedef ${ino_t-int /* default */} ${macro_prefix}ino_t;
-typedef ${mode_t-int /* default */} ${macro_prefix}mode_t;
-typedef ${nlink_t-int /* default */} ${macro_prefix}nlink_t;
-typedef ${off_t-long /* default */} ${macro_prefix}off_t;
-typedef ${pid_t-int /* default */} ${macro_prefix}pid_t;
-#ifndef __PTRDIFF_TYPE__
-#define __PTRDIFF_TYPE__ ${ptrdiff_t-long int /* default */}
-#endif
-typedef __PTRDIFF_TYPE__ ${macro_prefix}ptrdiff_t;
-typedef ${sigset_t-int /* default */} ${macro_prefix}sigset_t;
-#ifndef __SIZE_TYPE__
-#define __SIZE_TYPE__ ${size_t-unsigned long /* default */}
-#endif
-typedef __SIZE_TYPE__ ${macro_prefix}size_t;
-typedef ${time_t-int /* default */} ${macro_prefix}time_t;
-typedef ${uid_t-int /* default */} ${macro_prefix}uid_t;
-typedef ${wchar_t-int /* default */} ${macro_prefix}wchar_t;
-
-#define ${macro_prefix}BUFSIZ ${BUFSIZ-1024 /* default */}
-#define ${macro_prefix}FOPEN_MAX ${FOPEN_MAX-32 /* default */}
-#define ${macro_prefix}FILENAME_MAX ${FILENAME_MAX-1024 /* default */}
-#if defined (__cplusplus) || defined (__STDC__)
-#define ${macro_prefix}ARGS(ARGLIST) ARGLIST
-#else
-#define ${macro_prefix}ARGS(ARGLIST) ()
-#endif
-#if !defined (__GNUG__) || defined (__STRICT_ANSI__)
-#define ${macro_prefix}NO_NRV
-#endif
-#if !defined (__GNUG__)
-#define _G_NO_EXTERN_TEMPLATES
-#endif
-!EOF!
-
-# ssize_t is the signed version of size_t
-if [ -n "${ssize_t}" ] ; then
- echo "typedef ${ssize_t} ${macro_prefix}ssize_t;"
-elif [ -z "${size_t}" ] ; then
- echo "typedef long ${macro_prefix}ssize_t;"
-else
- # Remove "unsigned" from ${size_t} to get ${ssize_t}.
- tmp="`echo ${size_t} | ${SED} -e 's|unsigned||g' -e 's| | |g'`"
- if [ -z "$tmp" ] ; then
- tmp=int
- else
- # check $tmp doesn't conflict with <unistd.h>
- echo "#include <unistd.h>
- extern $tmp read();" >dummy.c
- ${CC} -c dummy.c >/dev/null 2>&1 || tmp=int
- fi
- echo "typedef $tmp /* default */ ${macro_prefix}ssize_t;"
-fi
-
-# wint_t is often the integral type to which wchar_t promotes.
-if [ -z "${wint_t}" ] ; then
- for TYPE in int 'unsigned int' 'long int' 'long unsigned int'; do
- cat >dummy.C <<!EOF!
-#ifndef __WCHAR_TYPE__
-#define __WCHAR_TYPE__ ${wchar_t-int /* default */}
-#endif
-typedef __WCHAR_TYPE__ ${macro_prefix}wchar_t;
-void foo ($TYPE);
-void foo (double);
-void bar (${macro_prefix}wchar_t w)
-{
- foo (w);
-}
-!EOF!
- if ${CXX} -c dummy.C >/dev/null 2>&1 ; then
- wint_t="$TYPE /* default */"
- break
- fi
- done
-fi
-echo "typedef ${wint_t-int /* wchar_t is broken */} ${macro_prefix}wint_t;"
-
-# va_list can cause problems (e.g. some systems have va_list as a struct).
-# Check to see if ${va_list-char*} really is compatible with stdarg.h.
-cat >dummy.C <<!EOF!
-#define X_va_list ${va_list-char* /* default */}
-extern long foo(X_va_list ap); /* Check that X_va_list compiles on its own */
-extern "C" {
-#include <stdarg.h>
-}
-long foo(X_va_list ap) { return va_arg(ap, long); }
-long bar(int i, ...)
-{ va_list ap; long j; va_start(ap, i); j = foo(ap); va_end(ap); return j; }
-!EOF!
-if ${CXX} -c dummy.C >/dev/null 2>&1 ; then
- # Ok: We have something that works.
- echo "typedef ${va_list-char* /* default */} ${macro_prefix}va_list;"
-else
- echo "#define ${macro_prefix}NEED_STDARG_H"
- # Check and see if we have __gnuc_va_list, as we might set up define
- # loops if we use va_list.
- cat >dummy.C <<!EOF!
-#include <stdarg.h>
-long foo(__gnuc_va_list ap) { return va_arg(ap, long); }
-!EOF!
- if ${CXX} -c dummy.C >/dev/null 2>&1 ; then
- echo "#define ${macro_prefix}va_list __gnuc_va_list"
- else
- echo "#define ${macro_prefix}va_list va_list"
- fi
-fi
-
-cat >dummy.c <<!EOF!
-#include <signal.h>
-extern int (*signal())();
-extern int dummy (int);
-main()
-{
- int (*oldsig)(int) = signal (1, dummy);
- (void) signal (2, oldsig);
- return 0;
-}
-!EOF!
-if ${CC} -c dummy.c >/dev/null 2>&1 ; then
- echo "#define ${macro_prefix}signal_return_type int"
-else
- echo "#define ${macro_prefix}signal_return_type void"
-fi
-
-# check sprintf return type
-
-cat >dummy.c <<!EOF!
-#include <stdio.h>
-extern int sprintf(); char buf[100];
-int main() { return sprintf(buf, "%d", 34); }
-!EOF!
-if ${CC} -c dummy.c >/dev/null 2>&1 ; then
- echo "#define ${macro_prefix}sprintf_return_type int"
-else
- echo "#define ${macro_prefix}sprintf_return_type char*"
-fi
-
-if test -n "${HAVE_ATEXIT}" ; then
- echo "#define ${macro_prefix}HAVE_ATEXIT ${HAVE_ATEXIT}"
-else
- cat >dummy.c <<!EOF!
-#include <stdlib.h>
-int main()
-{
- atexit (0);
-}
-!EOF!
- if ${CC} dummy.c >/dev/null 2>&1 ; then
- echo "#define ${macro_prefix}HAVE_ATEXIT 1"
- else
- echo "#define ${macro_prefix}HAVE_ATEXIT 0"
- fi
-fi
-
-
-# *** Check for presence of certain include files ***
-
-# check for sys/resource.h
-
-if test -n "${HAVE_SYS_RESOURCE}" ; then
- echo "#define ${macro_prefix}HAVE_SYS_RESOURCE ${HAVE_SYS_RESOURCE}"
-else
- cat >dummy.c <<!EOF!
-#include <sys/types.h>
-#include <sys/time.h>
-#include <sys/resource.h>
- int main()
- {
- struct rusage res;
- getrusage(RUSAGE_SELF, &res);
- return (int)(res.ru_utime.tv_sec + (res.ru_utime.tv_usec / 1000000.0));
- }
-!EOF!
- # Note: We link because some systems have sys/resource, but not getrusage().
- if ${CC} dummy.c >/dev/null 2>&1 ; then
- echo "#define ${macro_prefix}HAVE_SYS_RESOURCE 1"
- else
- echo "#define ${macro_prefix}HAVE_SYS_RESOURCE 0"
- fi
-fi
-
-# check for struct tms in sys/times.h
-
-if test -n "${HAVE_SYS_TIMES}" ; then
- echo "#define ${macro_prefix}HAVE_SYS_TIMES ${HAVE_SYS_TIMES}"
-else
- cat >dummy.c <<!EOF!
-#include <sys/types.h>
-#include <sys/times.h>
- int main()
- {
- struct tms s;
- return s.tms_utime;
- }
-!EOF!
- if ${CC} -c dummy.c >/dev/null 2>&1 ; then
- echo "#define ${macro_prefix}HAVE_SYS_TIMES 1"
- else
- echo "#define ${macro_prefix}HAVE_SYS_TIMES 0"
- fi
-fi
-
-# check for sys/socket.h
-
-if test -n "${HAVE_SYS_SOCKET}" ; then
- echo "#define ${macro_prefix}HAVE_SYS_SOCKET ${HAVE_SYS_SOCKET}"
-else
- echo '#include <sys/types.h>' >dummy.c
- echo '#include <sys/socket.h>' >>dummy.c
- if ${CC} -c dummy.c >/dev/null 2>&1 ; then
- echo "#define ${macro_prefix}HAVE_SYS_SOCKET 1"
- else
- echo "#define ${macro_prefix}HAVE_SYS_SOCKET 0"
- fi
-fi
-
-# check for sys/cdefs.h
-
-if test -n "${HAVE_SYS_CDEFS}" ; then
- echo "#define ${macro_prefix}HAVE_SYS_CDEFS ${HAVE_SYS_CDEFS}"
-else
- echo '#include <sys/cdefs.h>' >dummy.c
- echo 'extern int myfunc __P((int, int));' >>dummy.c
- if ${CC} -c dummy.c >/dev/null 2>&1 ; then
- echo "#define ${macro_prefix}HAVE_SYS_CDEFS 1"
- else
- echo "#define ${macro_prefix}HAVE_SYS_CDEFS 0"
- fi
-fi
-
-# Check for a (Posix-compatible) sys/wait.h */
-
-if test -n "${HAVE_SYS_WAIT}" ; then
- echo "#define ${macro_prefix}HAVE_SYS_WAIT ${HAVE_SYS_WAIT}"
-else
- cat >dummy.c <<!EOF!
-#include <sys/types.h>
-#include <sys/wait.h>
- int f() { int i; wait(&i); return i; }
-!EOF!
- if ${CC} -c dummy.c >/dev/null 2>&1 ; then
- echo "#define ${macro_prefix}HAVE_SYS_WAIT 1"
- else
- echo "#define ${macro_prefix}HAVE_SYS_WAIT 0"
- fi
-fi
-
-if test -n "${HAVE_UNISTD}" ; then
- echo "#define ${macro_prefix}HAVE_UNISTD ${HAVE_UNISTD}"
-else
- echo '#include <unistd.h>' >dummy.c
- if ${CC} -c dummy.c >/dev/null 2>&1 ; then
- echo "#define ${macro_prefix}HAVE_UNISTD 1"
- else
- echo "#define ${macro_prefix}HAVE_UNISTD 0"
- fi
-fi
-
-if test -n "${HAVE_DIRENT}" ; then
- echo "#define ${macro_prefix}HAVE_DIRENT ${HAVE_DIRENT}"
-else
- echo '#include <sys/types.h>
-#include <dirent.h>' >dummy.c
- if ${CC} -c dummy.c >/dev/null 2>&1 ; then
- echo "#define ${macro_prefix}HAVE_DIRENT 1"
- else
- echo "#define ${macro_prefix}HAVE_DIRENT 0"
- fi
-fi
-
-if test -n "${HAVE_CURSES}" ; then
- echo "#define ${macro_prefix}HAVE_CURSES ${HAVE_CURSES}"
-else
- echo '#include <curses.h>' >dummy.c
- if ${CC} -c dummy.c >/dev/null 2>&1 ; then
- echo "#define ${macro_prefix}HAVE_CURSES 1"
- else
- echo "#define ${macro_prefix}HAVE_CURSES 0"
- fi
-fi
-
-# There is no test for this at the moment; it is just set by the
-# configuration files.
-if test -n "${MATH_H_INLINES}" ; then
- echo "#define ${macro_prefix}MATH_H_INLINES ${MATH_H_INLINES}"
-else
- echo "#define ${macro_prefix}MATH_H_INLINES 0"
-fi
-
-if test -n "${HAVE_BOOL}" ; then
- echo "#define ${macro_prefix}HAVE_BOOL ${HAVE_BOOL}"
-else
- echo 'bool i=true,j=false;' >dummy.C
- if ${CXX} -c dummy.C >/dev/null 2>&1 ; then
- echo "#define ${macro_prefix}HAVE_BOOL 1"
- else
- echo "#define ${macro_prefix}HAVE_BOOL 0"
- fi
-fi
-
-if test -n "${NO_USE_DTOA}" ; then
- echo "#define ${macro_prefix}NO_USE_DTOA 1"
-fi
-if test -n "${USE_INT32_FLAGS}" ; then
- echo "#define ${macro_prefix}USE_INT32_FLAGS 1"
-fi
-
-# A little test program to check if __printf_fp is available.
-cat >dummy.c <<EOF
-int main()
-{
- return __printf_fp ();
-}
-EOF
-
-if ${CC} dummy.c >/dev/null 2>&1 ; then
- echo "#define ${macro_prefix}HAVE_PRINTF_FP 1"
- echo "#define ${macro_prefix}HAVE_LONG_DOUBLE_IO 1"
-else
- echo "#define ${macro_prefix}HAVE_PRINTF_FP 0"
- echo "#define ${macro_prefix}HAVE_LONG_DOUBLE_IO 0"
-fi
-
-# Uncomment the following line if you don't have working templates.
-# echo "#define ${macro_prefix}NO_TEMPLATES"
-
-# Override bogus definitions of NULL in system headers.
-cat <<EOF
-#undef NULL
-#define __need_NULL
-#include <stddef.h>
-EOF
-
-rm -f dummy.C dummy.o dummy.c dummy.out TMP core a.out
-
-echo "#endif /* !${macro_prefix}config_h */"
diff --git a/contrib/libio/genops.c b/contrib/libio/genops.c
deleted file mode 100644
index b899e150afab..000000000000
--- a/contrib/libio/genops.c
+++ /dev/null
@@ -1,946 +0,0 @@
-/* Copyright (C) 1993, 1995, 1997, 1998 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. */
-
-/* Generic or default I/O operations. */
-
-#include "libioP.h"
-#ifdef __STDC__
-#include <stdlib.h>
-#endif
-#include <string.h>
-
-void
-_IO_un_link (fp)
- _IO_FILE *fp;
-{
- if (fp->_flags & _IO_LINKED)
- {
- _IO_FILE **f;
- for (f = &_IO_list_all; *f != NULL; f = &(*f)->_chain)
- {
- if (*f == fp)
- {
- *f = fp->_chain;
- break;
- }
- }
- fp->_flags &= ~_IO_LINKED;
- }
-}
-
-void
-_IO_link_in (fp)
- _IO_FILE *fp;
-{
- if ((fp->_flags & _IO_LINKED) == 0)
- {
- fp->_flags |= _IO_LINKED;
- fp->_chain = _IO_list_all;
- _IO_list_all = fp;
- }
-}
-
-/* Return minimum _pos markers
- Assumes the current get area is the main get area. */
-static _IO_size_t _IO_least_marker __P ((_IO_FILE *fp));
-
-static _IO_size_t
-_IO_least_marker (fp)
- _IO_FILE *fp;
-{
- _IO_ssize_t least_so_far = fp->_IO_read_end - fp->_IO_read_base;
- struct _IO_marker *mark;
- for (mark = fp->_markers; mark != NULL; mark = mark->_next)
- if (mark->_pos < least_so_far)
- least_so_far = mark->_pos;
- return least_so_far;
-}
-
-/* Switch current get area from backup buffer to (start of) main get area. */
-
-void
-_IO_switch_to_main_get_area (fp)
- _IO_FILE *fp;
-{
- char *tmp;
- fp->_flags &= ~_IO_IN_BACKUP;
- /* Swap _IO_read_end and _IO_save_end. */
- tmp = fp->_IO_read_end;
- fp->_IO_read_end = fp->_IO_save_end;
- fp->_IO_save_end= tmp;
- /* Swap _IO_read_base and _IO_save_base. */
- tmp = fp->_IO_read_base;
- fp->_IO_read_base = fp->_IO_save_base;
- fp->_IO_save_base = tmp;
-
- fp->_IO_read_ptr = fp->_IO_read_base;
-}
-
-/* Switch current get area from main get area to (end of) backup area. */
-
-void
-_IO_switch_to_backup_area (fp)
- _IO_FILE *fp;
-{
- char *tmp;
- fp->_flags |= _IO_IN_BACKUP;
- /* Swap _IO_read_end and _IO_save_end. */
- tmp = fp->_IO_read_end;
- fp->_IO_read_end = fp->_IO_save_end;
- fp->_IO_save_end = tmp;
- /* Swap _gbase and _IO_save_base. */
- tmp = fp->_IO_read_base;
- fp->_IO_read_base = fp->_IO_save_base;
- fp->_IO_save_base = tmp;
-
- fp->_IO_read_ptr = fp->_IO_read_end;
-}
-
-int
-_IO_switch_to_get_mode (fp)
- _IO_FILE *fp;
-{
- if (fp->_IO_write_ptr > fp->_IO_write_base)
- if (_IO_OVERFLOW (fp, EOF) == EOF)
- return EOF;
- if (_IO_in_backup (fp))
- fp->_IO_read_base = fp->_IO_backup_base;
- else
- {
- fp->_IO_read_base = fp->_IO_buf_base;
- if (fp->_IO_write_ptr > fp->_IO_read_end)
- fp->_IO_read_end = fp->_IO_write_ptr;
- }
- fp->_IO_read_ptr = fp->_IO_write_ptr;
-
- fp->_IO_write_base = fp->_IO_write_ptr = fp->_IO_write_end = fp->_IO_read_ptr;
-
- fp->_flags &= ~_IO_CURRENTLY_PUTTING;
- return 0;
-}
-
-void
-_IO_free_backup_area (fp)
- _IO_FILE *fp;
-{
- if (_IO_in_backup (fp))
- _IO_switch_to_main_get_area (fp); /* Just in case. */
- free (fp->_IO_save_base);
- fp->_IO_save_base = NULL;
- fp->_IO_save_end = NULL;
- fp->_IO_backup_base = NULL;
-}
-
-#if 0
-int
-_IO_switch_to_put_mode (fp)
- _IO_FILE *fp;
-{
- fp->_IO_write_base = fp->_IO_read_ptr;
- fp->_IO_write_ptr = fp->_IO_read_ptr;
- /* Following is wrong if line- or un-buffered? */
- fp->_IO_write_end = (fp->_flags & _IO_IN_BACKUP
- ? fp->_IO_read_end : fp->_IO_buf_end);
-
- fp->_IO_read_ptr = fp->_IO_read_end;
- fp->_IO_read_base = fp->_IO_read_end;
-
- fp->_flags |= _IO_CURRENTLY_PUTTING;
- return 0;
-}
-#endif
-
-int
-__overflow (f, ch)
- _IO_FILE *f;
- int ch;
-{
- return _IO_OVERFLOW (f, ch);
-}
-
-static int save_for_backup __P ((_IO_FILE *fp));
-
- static int
-save_for_backup (fp)
- _IO_FILE *fp;
-{
- /* Append [_IO_read_base.._IO_read_end] to backup area. */
- int least_mark = _IO_least_marker (fp);
- /* needed_size is how much space we need in the backup area. */
- int needed_size = (fp->_IO_read_end - fp->_IO_read_base) - least_mark;
- int current_Bsize = fp->_IO_save_end - fp->_IO_save_base;
- int avail; /* Extra space available for future expansion. */
- int delta;
- struct _IO_marker *mark;
- if (needed_size > current_Bsize)
- {
- char *new_buffer;
- avail = 100;
- new_buffer = (char *) malloc (avail + needed_size);
- if (new_buffer == NULL)
- return EOF; /* FIXME */
- if (least_mark < 0)
- {
- memcpy (new_buffer + avail,
- fp->_IO_save_end + least_mark,
- -least_mark);
- memcpy (new_buffer + avail - least_mark,
- fp->_IO_read_base,
- fp->_IO_read_end - fp->_IO_read_base);
- }
- else
- memcpy (new_buffer + avail,
- fp->_IO_read_base + least_mark,
- needed_size);
- if (fp->_IO_save_base)
- free (fp->_IO_save_base);
- fp->_IO_save_base = new_buffer;
- fp->_IO_save_end = new_buffer + avail + needed_size;
- }
- else
- {
- avail = current_Bsize - needed_size;
- if (least_mark < 0)
- {
- memmove (fp->_IO_save_base + avail,
- fp->_IO_save_end + least_mark,
- -least_mark);
- memcpy (fp->_IO_save_base + avail - least_mark,
- fp->_IO_read_base,
- fp->_IO_read_end - fp->_IO_read_base);
- }
- else if (needed_size > 0)
- memcpy (fp->_IO_save_base + avail,
- fp->_IO_read_base + least_mark,
- needed_size);
- }
- /* FIXME: Dubious arithmetic if pointers are NULL */
- fp->_IO_backup_base = fp->_IO_save_base + avail;
- /* Adjust all the streammarkers. */
- delta = fp->_IO_read_end - fp->_IO_read_base;
- for (mark = fp->_markers; mark != NULL; mark = mark->_next)
- mark->_pos -= delta;
- return 0;
-}
-
-int
-__underflow (fp)
- _IO_FILE *fp;
-{
- if (_IO_in_put_mode (fp))
- if (_IO_switch_to_get_mode (fp) == EOF)
- return EOF;
- if (fp->_IO_read_ptr < fp->_IO_read_end)
- return *(unsigned char *) fp->_IO_read_ptr;
- if (_IO_in_backup (fp))
- {
- _IO_switch_to_main_get_area (fp);
- if (fp->_IO_read_ptr < fp->_IO_read_end)
- return *(unsigned char *) fp->_IO_read_ptr;
- }
- if (_IO_have_markers (fp))
- {
- if (save_for_backup (fp))
- return EOF;
- }
- else if (_IO_have_backup (fp))
- _IO_free_backup_area (fp);
- return _IO_UNDERFLOW (fp);
-}
-
-int
-__uflow (fp)
- _IO_FILE *fp;
-{
- if (_IO_in_put_mode (fp))
- if (_IO_switch_to_get_mode (fp) == EOF)
- return EOF;
- if (fp->_IO_read_ptr < fp->_IO_read_end)
- return *(unsigned char *) fp->_IO_read_ptr++;
- if (_IO_in_backup (fp))
- {
- _IO_switch_to_main_get_area (fp);
- if (fp->_IO_read_ptr < fp->_IO_read_end)
- return *(unsigned char *) fp->_IO_read_ptr++;
- }
- if (_IO_have_markers (fp))
- {
- if (save_for_backup (fp))
- return EOF;
- }
- else if (_IO_have_backup (fp))
- _IO_free_backup_area (fp);
- return _IO_UFLOW (fp);
-}
-
-void
-_IO_setb (f, b, eb, a)
- _IO_FILE *f;
- char *b;
- char *eb;
- int a;
-{
- if (f->_IO_buf_base && !(f->_flags & _IO_USER_BUF))
- FREE_BUF (f->_IO_buf_base, _IO_blen (f));
- f->_IO_buf_base = b;
- f->_IO_buf_end = eb;
- if (a)
- f->_flags &= ~_IO_USER_BUF;
- else
- f->_flags |= _IO_USER_BUF;
-}
-
-void
-_IO_doallocbuf (fp)
- _IO_FILE *fp;
-{
- if (fp->_IO_buf_base)
- return;
- if (!(fp->_flags & _IO_UNBUFFERED))
- if (_IO_DOALLOCATE (fp) != EOF)
- return;
- _IO_setb (fp, fp->_shortbuf, fp->_shortbuf+1, 0);
-}
-
-int
-_IO_default_underflow (fp)
- _IO_FILE *fp;
-{
- return EOF;
-}
-
-int
-_IO_default_uflow (fp)
- _IO_FILE *fp;
-{
- int ch = _IO_UNDERFLOW (fp);
- if (ch == EOF)
- return EOF;
- return *(unsigned char *) fp->_IO_read_ptr++;
-}
-
-_IO_size_t
-_IO_default_xsputn (f, data, n)
- _IO_FILE *f;
- const void *data;
- _IO_size_t n;
-{
- const char *s = (char *) data;
- _IO_size_t more = n;
- if (more <= 0)
- return 0;
- for (;;)
- {
- /* Space available. */
- _IO_ssize_t count = f->_IO_write_end - f->_IO_write_ptr;
- if (count > 0)
- {
- if ((_IO_size_t) count > more)
- count = more;
- if (count > 20)
- {
- memcpy (f->_IO_write_ptr, s, count);
- s += count;
- f->_IO_write_ptr += count;
- }
- else if (count <= 0)
- count = 0;
- else
- {
- char *p = f->_IO_write_ptr;
- _IO_ssize_t i;
- for (i = count; --i >= 0; )
- *p++ = *s++;
- f->_IO_write_ptr = p;
- }
- more -= count;
- }
- if (more == 0 || __overflow (f, (unsigned char) *s++) == EOF)
- break;
- more--;
- }
- return n - more;
-}
-
-_IO_size_t
-_IO_sgetn (fp, data, n)
- _IO_FILE *fp;
- void *data;
- _IO_size_t n;
-{
- /* FIXME handle putback buffer here! */
- return _IO_XSGETN (fp, data, n);
-}
-
-_IO_size_t
-_IO_default_xsgetn (fp, data, n)
- _IO_FILE *fp;
- void *data;
- _IO_size_t n;
-{
- _IO_size_t more = n;
- char *s = (char*) data;
- for (;;)
- {
- /* Data available. */
- _IO_ssize_t count = fp->_IO_read_end - fp->_IO_read_ptr;
- if (count > 0)
- {
- if ((_IO_size_t) count > more)
- count = more;
- if (count > 20)
- {
- memcpy (s, fp->_IO_read_ptr, count);
- s += count;
- fp->_IO_read_ptr += count;
- }
- else if (count <= 0)
- count = 0;
- else
- {
- char *p = fp->_IO_read_ptr;
- int i = (int) count;
- while (--i >= 0)
- *s++ = *p++;
- fp->_IO_read_ptr = p;
- }
- more -= count;
- }
- if (more == 0 || __underflow (fp) == EOF)
- break;
- }
- return n - more;
-}
-
-#if 0
-/* Seems not to be needed. --drepper */
-int
-_IO_sync (fp)
- _IO_FILE *fp;
-{
- return 0;
-}
-#endif
-
-_IO_FILE *
-_IO_default_setbuf (fp, p, len)
- _IO_FILE *fp;
- char *p;
- _IO_ssize_t len;
-{
- if (_IO_SYNC (fp) == EOF)
- return NULL;
- if (p == NULL || len == 0)
- {
- fp->_flags |= _IO_UNBUFFERED;
- _IO_setb (fp, fp->_shortbuf, fp->_shortbuf+1, 0);
- }
- else
- {
- fp->_flags &= ~_IO_UNBUFFERED;
- _IO_setb (fp, p, p+len, 0);
- }
- fp->_IO_write_base = fp->_IO_write_ptr = fp->_IO_write_end = 0;
- fp->_IO_read_base = fp->_IO_read_ptr = fp->_IO_read_end = 0;
- return fp;
-}
-
-_IO_pos_t
-_IO_default_seekpos (fp, pos, mode)
- _IO_FILE *fp;
- _IO_pos_t pos;
- int mode;
-{
- return _IO_SEEKOFF (fp, _IO_pos_as_off (pos), 0, mode);
-}
-
-int
-_IO_default_doallocate (fp)
- _IO_FILE *fp;
-{
- char *buf;
-
- ALLOC_BUF (buf, _IO_BUFSIZ, EOF);
- _IO_setb (fp, buf, buf+_IO_BUFSIZ, 1);
- return 1;
-}
-
-void
-_IO_init (fp, flags)
- _IO_FILE *fp;
- int flags;
-{
- fp->_flags = _IO_MAGIC|flags;
- fp->_IO_buf_base = NULL;
- fp->_IO_buf_end = NULL;
- fp->_IO_read_base = NULL;
- fp->_IO_read_ptr = NULL;
- fp->_IO_read_end = NULL;
- fp->_IO_write_base = NULL;
- fp->_IO_write_ptr = NULL;
- fp->_IO_write_end = NULL;
- fp->_chain = NULL; /* Not necessary. */
-
- fp->_IO_save_base = NULL;
- fp->_IO_backup_base = NULL;
- fp->_IO_save_end = NULL;
- fp->_markers = NULL;
- fp->_cur_column = 0;
-#ifdef _IO_MTSAFE_IO
- _IO_lock_init (*fp->_lock);
-#endif
-}
-
-int
-_IO_default_sync (fp)
- _IO_FILE *fp;
-{
- return 0;
-}
-
-/* The way the C++ classes are mapped into the C functions in the
- current implementation, this function can get called twice! */
-
-void
-_IO_default_finish (fp, dummy)
- _IO_FILE *fp;
- int dummy;
-{
- struct _IO_marker *mark;
- if (fp->_IO_buf_base && !(fp->_flags & _IO_USER_BUF))
- {
- FREE_BUF (fp->_IO_buf_base, _IO_blen (fp));
- fp->_IO_buf_base = fp->_IO_buf_end = NULL;
- }
-
- for (mark = fp->_markers; mark != NULL; mark = mark->_next)
- mark->_sbuf = NULL;
-
- if (fp->_IO_save_base)
- {
- free (fp->_IO_save_base);
- fp->_IO_save_base = NULL;
- }
-
-#ifdef _IO_MTSAFE_IO
- _IO_lock_fini (*fp->_lock);
-#endif
-
- _IO_un_link (fp);
-}
-
-_IO_pos_t
-_IO_default_seekoff (fp, offset, dir, mode)
- _IO_FILE *fp;
- _IO_off_t offset;
- int dir;
- int mode;
-{
- return _IO_pos_BAD;
-}
-
-int
-_IO_sputbackc (fp, c)
- _IO_FILE *fp;
- int c;
-{
- int result;
-
- if (fp->_IO_read_ptr > fp->_IO_read_base
- && (unsigned char)fp->_IO_read_ptr[-1] == (unsigned char)c)
- {
- fp->_IO_read_ptr--;
- result = (unsigned char) c;
- }
- else
- result = _IO_PBACKFAIL (fp, c);
-
- if (result != EOF)
- fp->_flags &= ~_IO_EOF_SEEN;
-
- return result;
-}
-
-int
-_IO_sungetc (fp)
- _IO_FILE *fp;
-{
- int result;
-
- if (fp->_IO_read_ptr > fp->_IO_read_base)
- {
- fp->_IO_read_ptr--;
- result = (unsigned char) *fp->_IO_read_ptr;
- }
- else
- result = _IO_PBACKFAIL (fp, EOF);
-
- if (result != EOF)
- fp->_flags &= ~_IO_EOF_SEEN;
-
- return result;
-}
-
-#if 0 /* Work in progress */
-/* Seems not to be needed. */
-#if 0
-void
-_IO_set_column (fp, c)
- _IO_FILE *fp;
- int c;
-{
- if (c == -1)
- fp->_column = -1;
- else
- fp->_column = c - (fp->_IO_write_ptr - fp->_IO_write_base);
-}
-#else
-int
-_IO_set_column (fp, i)
- _IO_FILE *fp;
- int i;
-{
- fp->_cur_column = i + 1;
- return 0;
-}
-#endif
-#endif
-
-
-unsigned
-_IO_adjust_column (start, line, count)
- unsigned start;
- const char *line;
- int count;
-{
- const char *ptr = line + count;
- while (ptr > line)
- if (*--ptr == '\n')
- return line + count - ptr - 1;
- return start + count;
-}
-
-#if 0
-/* Seems not to be needed. --drepper */
-int
-_IO_get_column (fp)
- _IO_FILE *fp;
-{
- if (fp->_cur_column)
- return _IO_adjust_column (fp->_cur_column - 1,
- fp->_IO_write_base,
- fp->_IO_write_ptr - fp->_IO_write_base);
- return -1;
-}
-#endif
-
-int
-_IO_flush_all ()
-{
- int result = 0;
- _IO_FILE *fp;
- for (fp = _IO_list_all; fp != NULL; fp = fp->_chain)
- if (fp->_IO_write_ptr > fp->_IO_write_base
- && _IO_OVERFLOW (fp, EOF) == EOF)
- result = EOF;
- return result;
-}
-
-void
-_IO_flush_all_linebuffered ()
-{
- _IO_FILE *fp;
- for (fp = _IO_list_all; fp != NULL; fp = fp->_chain)
- if ((fp->_flags & _IO_NO_WRITES) == 0 && fp->_flags & _IO_LINE_BUF)
- _IO_OVERFLOW (fp, EOF);
-}
-
-static void _IO_unbuffer_all __P ((void));
-
-static void
-_IO_unbuffer_all ()
-{
- _IO_FILE *fp;
- for (fp = _IO_list_all; fp != NULL; fp = fp->_chain)
- if (! (fp->_flags & _IO_UNBUFFERED))
- _IO_SETBUF (fp, NULL, 0);
-}
-
-void
-_IO_cleanup ()
-{
- _IO_flush_all ();
-
- /* We currently don't have a reliable mechanism for making sure that
- C++ static destructors are executed in the correct order.
- So it is possible that other static destructors might want to
- write to cout - and they're supposed to be able to do so.
-
- The following will make the standard streambufs be unbuffered,
- which forces any output from late destructors to be written out. */
- _IO_unbuffer_all ();
-}
-
-void
-_IO_init_marker (marker, fp)
- struct _IO_marker *marker;
- _IO_FILE *fp;
-{
- marker->_sbuf = fp;
- if (_IO_in_put_mode (fp))
- _IO_switch_to_get_mode (fp);
- if (_IO_in_backup (fp))
- marker->_pos = fp->_IO_read_ptr - fp->_IO_read_end;
- else
- marker->_pos = fp->_IO_read_ptr - fp->_IO_read_base;
-
- /* Should perhaps sort the chain? */
- marker->_next = fp->_markers;
- fp->_markers = marker;
-}
-
-void
-_IO_remove_marker (marker)
- struct _IO_marker *marker;
-{
- /* Unlink from sb's chain. */
- struct _IO_marker **ptr = &marker->_sbuf->_markers;
- for (; ; ptr = &(*ptr)->_next)
- {
- if (*ptr == NULL)
- break;
- else if (*ptr == marker)
- {
- *ptr = marker->_next;
- return;
- }
- }
-#if 0
- if _sbuf has a backup area that is no longer needed, should we delete
- it now, or wait until the next underflow?
-#endif
-}
-
-#define BAD_DELTA EOF
-
-int
-_IO_marker_difference (mark1, mark2)
- struct _IO_marker *mark1;
- struct _IO_marker *mark2;
-{
- return mark1->_pos - mark2->_pos;
-}
-
-/* Return difference between MARK and current position of MARK's stream. */
-int
-_IO_marker_delta (mark)
- struct _IO_marker *mark;
-{
- int cur_pos;
- if (mark->_sbuf == NULL)
- return BAD_DELTA;
- if (_IO_in_backup (mark->_sbuf))
- cur_pos = mark->_sbuf->_IO_read_ptr - mark->_sbuf->_IO_read_end;
- else
- cur_pos = mark->_sbuf->_IO_read_ptr - mark->_sbuf->_IO_read_base;
- return mark->_pos - cur_pos;
-}
-
-int
-_IO_seekmark (fp, mark, delta)
- _IO_FILE *fp;
- struct _IO_marker *mark;
- int delta;
-{
- if (mark->_sbuf != fp)
- return EOF;
- if (mark->_pos >= 0)
- {
- if (_IO_in_backup (fp))
- _IO_switch_to_main_get_area (fp);
- fp->_IO_read_ptr = fp->_IO_read_base + mark->_pos;
- }
- else
- {
- if (!_IO_in_backup (fp))
- _IO_switch_to_backup_area (fp);
- fp->_IO_read_ptr = fp->_IO_read_end + mark->_pos;
- }
- return 0;
-}
-
-void
-_IO_unsave_markers (fp)
- _IO_FILE *fp;
-{
- struct _IO_marker *mark = fp->_markers;
- if (mark)
- {
-#ifdef TODO
- streampos offset = seekoff (0, ios::cur, ios::in);
- if (offset != EOF)
- {
- offset += eGptr () - Gbase ();
- for ( ; mark != NULL; mark = mark->_next)
- mark->set_streampos (mark->_pos + offset);
- }
- else
- {
- for ( ; mark != NULL; mark = mark->_next)
- mark->set_streampos (EOF);
- }
-#endif
- fp->_markers = 0;
- }
-
- if (_IO_have_backup (fp))
- _IO_free_backup_area (fp);
-}
-
-#if 0
-/* Seems not to be needed. --drepper */
-int
-_IO_nobackup_pbackfail (fp, c)
- _IO_FILE *fp;
- int c;
-{
- if (fp->_IO_read_ptr > fp->_IO_read_base)
- fp->_IO_read_ptr--;
- if (c != EOF && *fp->_IO_read_ptr != c)
- *fp->_IO_read_ptr = c;
- return (unsigned char) c;
-}
-#endif
-
-int
-_IO_default_pbackfail (fp, c)
- _IO_FILE *fp;
- int c;
-{
- if (fp->_IO_read_ptr <= fp->_IO_read_base)
- {
- /* Need to handle a filebuf in write mode (switch to read mode). FIXME!*/
- if (_IO_have_backup (fp) && !_IO_in_backup (fp))
- _IO_switch_to_backup_area (fp);
-
- if (!_IO_have_backup (fp))
- {
- /* No backup buffer: allocate one. */
- /* Use nshort buffer, if unused? (probably not) FIXME */
- int backup_size = 128;
- char *bbuf = (char *) malloc (backup_size);
- if (bbuf == NULL)
- return EOF;
- fp->_IO_save_base = bbuf;
- fp->_IO_save_end = fp->_IO_save_base + backup_size;
- fp->_IO_backup_base = fp->_IO_save_end;
- _IO_switch_to_backup_area (fp);
- }
- else if (fp->_IO_read_ptr <= fp->_IO_read_base)
- {
- /* Increase size of existing backup buffer. */
- _IO_size_t new_size;
- _IO_size_t old_size = fp->_IO_read_end - fp->_IO_read_base;
- char *new_buf;
- new_size = 2 * old_size;
- new_buf = (char *) malloc (new_size);
- if (new_buf == NULL)
- return EOF;
- memcpy (new_buf + (new_size - old_size), fp->_IO_read_base,
- old_size);
- free (fp->_IO_read_base);
- _IO_setg (fp, new_buf, new_buf + (new_size - old_size),
- new_buf + new_size);
- fp->_IO_backup_base = fp->_IO_read_ptr;
- }
- }
- --fp->_IO_read_ptr;
- if (c != EOF && *fp->_IO_read_ptr != c)
- *fp->_IO_read_ptr = c;
- return (unsigned char) *fp->_IO_read_ptr;
-}
-
-_IO_pos_t
-_IO_default_seek (fp, offset, dir)
- _IO_FILE *fp;
- _IO_off_t offset;
- int dir;
-{
- return _IO_pos_BAD;
-}
-
-int
-_IO_default_stat (fp, st)
- _IO_FILE *fp;
- void* st;
-{
- return EOF;
-}
-
-_IO_ssize_t
-_IO_default_read (fp, data, n)
- _IO_FILE* fp;
- void *data;
- _IO_ssize_t n;
-{
- return -1;
-}
-
-_IO_ssize_t
-_IO_default_write (fp, data, n)
- _IO_FILE *fp;
- const void *data;
- _IO_ssize_t n;
-{
- return 0;
-}
-
-
-#ifdef TODO
-#if defined(linux)
-#define IO_CLEANUP ;
-#endif
-
-#ifdef IO_CLEANUP
- IO_CLEANUP
-#else
-struct __io_defs {
- __io_defs() { }
- ~__io_defs() { _IO_cleanup (); }
-};
-__io_defs io_defs__;
-#endif
-
-#endif /* TODO */
-
-#ifdef weak_alias
-weak_alias (_IO_cleanup, _cleanup)
-#elif defined(_G_STDIO_USES_LIBIO) && defined(_G_HAVE_WEAK_SYMBOL)
-void _cleanup () __attribute__ ((weak, alias ("_IO_cleanup")));
-#endif
-
-#ifdef text_set_element
-text_set_element(__libc_atexit, _cleanup);
-#endif
diff --git a/contrib/libio/include/empty.h b/contrib/libio/include/empty.h
deleted file mode 100644
index dcbf758df9c7..000000000000
--- a/contrib/libio/include/empty.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* 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*/
diff --git a/contrib/libio/indstream.cc b/contrib/libio/indstream.cc
deleted file mode 100644
index 15a1bb2778d3..000000000000
--- a/contrib/libio/indstream.cc
+++ /dev/null
@@ -1,121 +0,0 @@
-/* This is part of libio/iostream, providing -*- C++ -*- input/output.
-Copyright (C) 1993 Free Software Foundation
-
-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.
-
-Written by Per Bothner (bothner@cygnus.com). */
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-
-#include <indstream.h>
-
-indirectbuf::indirectbuf(streambuf *get, streambuf *put, int delete_mode)
-: streambuf()
-{
- _get_stream = get;
- _put_stream = put == NULL ? get : put;
- _delete_flags = delete_mode;
-}
-
-indirectbuf::~indirectbuf()
-{
- if (_delete_flags & ios::in) delete get_stream();
- if (_delete_flags & ios::out) delete put_stream();
-}
-
-streamsize indirectbuf::xsputn(const char* s, streamsize n)
-{
- return put_stream()->sputn(s, n);
-}
-
-streamsize indirectbuf::xsgetn(char* s, streamsize n)
-{
- return get_stream()->sgetn(s, n);
-}
-
-int indirectbuf::overflow(int c /* = EOF */)
-{
- if (c == EOF)
- return put_stream()->overflow(c);
- else
- return put_stream()->sputc(c);
-}
-
-int indirectbuf::underflow()
-{
- return get_stream()->sgetc();
-}
-
-int indirectbuf::uflow()
-{
- return get_stream()->sbumpc();
-}
-
-streampos indirectbuf::seekoff(streamoff off, _seek_dir dir, int mode)
-{
- int ret_val = 0;
- int select = mode == 0 ? (ios::in|ios::out) : mode;
- streambuf *gbuf = (select & ios::in) ? get_stream() : (streambuf*)NULL;
- streambuf *pbuf = (select & ios::out) ? put_stream() : (streambuf*)NULL;
- if (gbuf == pbuf)
- ret_val = gbuf->seekoff(off, dir, mode);
- else {
- if (gbuf)
- ret_val = gbuf->seekoff(off, dir, ios::in);
- if (pbuf && ret_val != EOF)
- ret_val = pbuf->seekoff(off, dir, ios::out);
- }
- return ret_val;
-}
-
-streampos indirectbuf::seekpos(streampos pos, int mode)
-{
- int ret_val = EOF;
- int select = mode == 0 ? (ios::in|ios::out) : mode;
- streambuf *gbuf = (select & ios::in) ? get_stream() : (streambuf*)NULL;
- streambuf *pbuf = (select & ios::out) ? put_stream() : (streambuf*)NULL;
- if (gbuf == pbuf && gbuf != NULL)
- ret_val = gbuf->seekpos(pos, mode);
- else {
- if (gbuf)
- ret_val = gbuf->seekpos(pos, ios::in);
- if (pbuf && ret_val != EOF)
- ret_val = pbuf->seekpos(pos, ios::out);
- }
- return ret_val;
-}
-
-int indirectbuf::sync()
-{
- streambuf *gbuf = get_stream();
- int get_ret_val = gbuf ? gbuf->sync() : 0;
- streambuf *pbuf = put_stream();
- int put_ret_val = (pbuf && pbuf != gbuf) ? pbuf->sync() : 0;
- return get_ret_val || put_ret_val;
-}
-
-int indirectbuf::pbackfail(int c)
-{
- return get_stream()->sputbackc(c);
-}
diff --git a/contrib/libio/indstream.h b/contrib/libio/indstream.h
deleted file mode 100644
index c4558623d079..000000000000
--- a/contrib/libio/indstream.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/* This is part of libio/iostream, providing -*- C++ -*- input/output.
-Copyright (C) 1993 Free Software Foundation
-
-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.
-
-Written by Per Bothner (bothner@cygnus.com). */
-
-#ifndef _INDSTREAM_H
-#define _INDSTREAM_H
-
-#ifdef __GNUG__
-#pragma interface
-#endif
-
-#include <iostream.h>
-
-extern "C++" {
-// An indirectbuf is one that forwards all of its I/O requests
-// to another streambuf.
-// All get-related requests are sent to get_stream().
-// All put-related requests are sent to put_stream().
-
-// An indirectbuf can be used to implement Common Lisp
-// synonym-streams and two-way-streams.
-//
-// class synonymbuf : public indirectbuf {
-// Symbol *sym;
-// synonymbuf(Symbol *s) { sym = s; }
-// virtual streambuf *lookup_stream(int mode) {
-// return coerce_to_streambuf(lookup_value(sym)); }
-// };
-
-class indirectbuf : public streambuf {
- protected:
- streambuf *_get_stream; // Optional cache for get_stream().
- streambuf *_put_stream; // Optional cache for put_stream().
- int _delete_flags;
- public:
- streambuf *get_stream()
- { return _get_stream ? _get_stream : lookup_stream(ios::in); }
- streambuf *put_stream()
- { return _put_stream ? _put_stream : lookup_stream(ios::out); }
- virtual streambuf *lookup_stream(int/*mode*/) { return NULL; } // ERROR!
- indirectbuf(streambuf *get=NULL, streambuf *put=NULL, int delete_mode=0);
- virtual ~indirectbuf();
- virtual streamsize xsputn(const char* s, streamsize n);
- virtual streamsize xsgetn(char* s, streamsize n);
- virtual int underflow();
- virtual int uflow();
- virtual int overflow(int c = EOF);
- virtual streampos seekoff(streamoff, _seek_dir, int mode=ios::in|ios::out);
- virtual streampos seekpos(streampos pos, int mode = ios::in|ios::out);
- virtual int sync();
- virtual int pbackfail(int c);
-};
-} // extern "C++"
-
-#endif /* !_INDSTREAM_H */
diff --git a/contrib/libio/ioassign.cc b/contrib/libio/ioassign.cc
deleted file mode 100644
index 5b8e68bbf539..000000000000
--- a/contrib/libio/ioassign.cc
+++ /dev/null
@@ -1,49 +0,0 @@
-/* This is part of libio/iostream, providing -*- C++ -*- input/output.
-Copyright (C) 1994 Free Software Foundation
-
-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. */
-
-/* Written by Per Bothner (bothner@cygnus.com). */
-
-#include <iostream.h>
-#include "libioP.h"
-
-// These method are provided for backward compatibility reasons.
-// It's generally poor style to use them.
-// They are not supported by the ANSI/ISO working paper.
-
-_IO_istream_withassign& _IO_istream_withassign::operator=(istream& rhs)
-{
- if (&rhs != (istream*)this)
- {
- init (rhs.rdbuf ());
- _gcount = 0;
- }
- return *this;
-}
-
-_IO_ostream_withassign& _IO_ostream_withassign::operator=(ostream& rhs)
-{
- if (&rhs != (ostream*)this)
- init (rhs.rdbuf ());
- return *this;
-}
diff --git a/contrib/libio/ioextend.cc b/contrib/libio/ioextend.cc
deleted file mode 100644
index a31ff36e6e58..000000000000
--- a/contrib/libio/ioextend.cc
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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 <iostream.h>
-
-static int __xalloc = 0;
-
-int ios::xalloc()
-{
- return __xalloc++;
-}
-
-static ios::fmtflags __used_fmt_flags
-= ios::skipws | ios::left | ios::right | ios::internal
-| ios::dec | ios::oct | ios::hex | ios::showbase | ios::showpoint
-| ios::uppercase | ios::showpos | ios::scientific | ios::fixed
-#ifndef _IO_NEW_STREAMS
-| ios::dont_close
-#endif
-| ios::unitbuf | ios::stdio;
-
-ios::fmtflags ios::bitalloc()
-{
- fmtflags bit_to_try = (fmtflags)1;
- for (; bit_to_try; bit_to_try <<= 1)
- {
- if ((__used_fmt_flags & bit_to_try) == 0)
- {
- __used_fmt_flags |= bit_to_try;
- return bit_to_try;
- }
- }
- return 0;
-}
-
-// NOTE: This implementation of ios::iword and ios::pword assumes
-// that these methods are seldom used, so we want to minimize
-// the space and time overhead when NOT using these methods.
-//
-// ANSI specifies two conceptually-infinite arrays, one whose
-// elements are longs, and one whose elements are (void*)s.
-// We implement this as a single array, each of whose element is
-// a (struct ptr_and_long), which has space for both a long and a void*.
-// We also specify that (the i field of) the 0'th element of the array
-// contains the allocated length of the array (not counting that
-// initial element).
-
-struct ptr_and_long {
- void *p;
- long i;
-};
-
-static struct ptr_and_long&
-get_array_element(ios& io, int index)
-{
- if (index < 0)
- io._throw_failure();
- register struct ptr_and_long *array = (ptr_and_long*)io._arrays;
- int old_length = array == NULL ? 0 : array[0].i;
- if (index >= old_length)
- {
- register int i;
- int new_length = index + 10;
- register struct ptr_and_long *new_array
- = new ptr_and_long[1 + new_length];
- if (array != NULL)
- {
- for (i = 1; i <= old_length; i++)
- new_array[i] = array[i];
- delete [] array;
- }
- for (i = old_length + 1; i <= new_length; i++)
- {
- new_array[i].i = 0;
- new_array[i].p = NULL;
- }
- new_array[0].i = new_length;
- new_array[0].p = NULL;
- io._arrays = (void*)new_array;
- array = new_array;
- }
- return array[index+1];
-}
-
-long& ios::iword(int index)
-{
- return get_array_element(*this, index).i;
-}
-
-void*& ios::pword(int index)
-{
- return get_array_element(*this, index).p;
-}
-
-long ios::iword(int index) const
-{
- if (index < 0)
- _throw_failure();
- register struct ptr_and_long *pl_array = (ptr_and_long*)_arrays;
- int len = pl_array == NULL ? 0 : pl_array[0].i;
- return index >= len ? 0 : pl_array[index+1].i;
-}
-
-void* ios::pword(int index) const
-{
- if (index < 0)
- _throw_failure();
- register struct ptr_and_long *pl_array = (ptr_and_long*)_arrays;
- int len = pl_array == NULL ? 0 : pl_array[0].i;
- return index >= len ? 0 : pl_array[index+1].p;
-}
diff --git a/contrib/libio/iofclose.c b/contrib/libio/iofclose.c
deleted file mode 100644
index 7db336c5d539..000000000000
--- a/contrib/libio/iofclose.c
+++ /dev/null
@@ -1,60 +0,0 @@
-/* Copyright (C) 1993, 1995, 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"
-#ifdef __STDC__
-#include <stdlib.h>
-#endif
-
-int
-_IO_fclose (fp)
- _IO_FILE *fp;
-{
- int status;
-
- CHECK_FILE(fp, EOF);
-
- _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
- _IO_flockfile (fp);
- if (fp->_IO_file_flags & _IO_IS_FILEBUF)
- status = _IO_file_close_it (fp);
- else
- status = fp->_flags & _IO_ERR_SEEN ? -1 : 0;
- _IO_FINISH (fp);
- _IO_cleanup_region_end (1);
- if (fp != _IO_stdin && fp != _IO_stdout && fp != _IO_stderr)
- {
- fp->_IO_file_flags = 0;
- free(fp);
- }
-
- return status;
-}
-
-#ifdef weak_alias
-weak_alias (_IO_fclose, fclose)
-#elif defined(_G_STDIO_USES_LIBIO) && defined(_G_HAVE_WEAK_SYMBOL)
-int fclose (_IO_FILE *) __attribute__ ((weak, alias("_IO_fclose")));
-#endif
diff --git a/contrib/libio/iofdopen.c b/contrib/libio/iofdopen.c
deleted file mode 100644
index 841e7032b803..000000000000
--- a/contrib/libio/iofdopen.c
+++ /dev/null
@@ -1,134 +0,0 @@
-/* Copyright (C) 1993, 1994, 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. */
-
-#ifdef __STDC__
-#include <stdlib.h>
-#endif
-#include "libioP.h"
-#include <fcntl.h>
-
-#ifndef _IO_fcntl
-#define _IO_fcntl fcntl
-#endif
-
-_IO_FILE *
-_IO_fdopen (fd, mode)
- int fd;
- const char *mode;
-{
- int read_write;
- int posix_mode = 0;
- struct locked_FILE
- {
- struct _IO_FILE_plus fp;
-#ifdef _IO_MTSAFE_IO
- _IO_lock_t lock;
-#endif
- } *new_f;
- int fd_flags;
-
- switch (*mode++)
- {
- case 'r':
- read_write = _IO_NO_WRITES;
- break;
- case 'w':
- read_write = _IO_NO_READS;
- break;
- case 'a':
- posix_mode = O_APPEND;
- read_write = _IO_NO_READS|_IO_IS_APPENDING;
- break;
- default:
- MAYBE_SET_EINVAL;
- return NULL;
- }
- if (mode[0] == '+' || (mode[0] == 'b' && mode[1] == '+'))
- read_write &= _IO_IS_APPENDING;
-#ifdef F_GETFL
- fd_flags = _IO_fcntl (fd, F_GETFL);
-#ifndef O_ACCMODE
-#define O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR)
-#endif
- if (fd_flags == -1
- || ((fd_flags & O_ACCMODE) == O_RDONLY && !(read_write & _IO_NO_WRITES))
- || ((fd_flags & O_ACCMODE) == O_WRONLY && !(read_write & _IO_NO_READS)))
- return NULL;
-
- /* The May 93 draft of P1003.4/D14.1 (redesignated as 1003.1b)
- [System Application Program Interface (API) Amendment 1:
- Realtime Extensions], Rationale B.8.3.3
- Open a Stream on a File Descriptor says:
-
- Although not explicitly required by POSIX.1, a good
- implementation of append ("a") mode would cause the
- O_APPEND flag to be set.
-
- (Historical implementations [such as Solaris2] do a one-time
- seek in fdopen.)
-
- However, we do not turn O_APPEND off if the mode is "w" (even
- though that would seem consistent) because that would be more
- likely to break historical programs.
- */
- if ((posix_mode & O_APPEND) && !(fd_flags & O_APPEND))
- {
-#ifdef F_SETFL
- if (_IO_fcntl (fd, F_SETFL, fd_flags | O_APPEND) == -1)
-#endif
- return NULL;
- }
-#endif
-
- new_f = (struct locked_FILE *) malloc (sizeof (struct locked_FILE));
- if (new_f == NULL)
- return NULL;
-#ifdef _IO_MTSAFE_IO
- new_f->fp.file._lock = &new_f->lock;
-#endif
- _IO_init (&new_f->fp.file, 0);
- _IO_JUMPS (&new_f->fp.file) = &_IO_file_jumps;
- _IO_file_init (&new_f->fp.file);
-#if !_IO_UNIFIED_JUMPTABLES
- new_f->fp.vtable = NULL;
-#endif
- if (_IO_file_attach (&new_f->fp.file, fd) == NULL)
- {
- _IO_un_link (&new_f->fp.file);
- free (new_f);
- return NULL;
- }
- new_f->fp.file._flags &= ~_IO_DELETE_DONT_CLOSE;
-
- new_f->fp.file._IO_file_flags =
- _IO_mask_flags (&new_f->fp.file, read_write,
- _IO_NO_READS+_IO_NO_WRITES+_IO_IS_APPENDING);
-
- return (_IO_FILE *) &new_f->fp;
-}
-
-#ifdef weak_alias
-weak_alias (_IO_fdopen, fdopen)
-#endif
diff --git a/contrib/libio/iofeof.c b/contrib/libio/iofeof.c
deleted file mode 100644
index 7bf8cba285be..000000000000
--- a/contrib/libio/iofeof.c
+++ /dev/null
@@ -1,45 +0,0 @@
-/* Copyright (C) 1993, 1996, 1997 Free Software Foundation, Inc.
- This file is part of the GNU IO Library.
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License as
- published by the Free Software Foundation; either version 2, or (at
- your option) any later version.
-
- This library is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this library; see the file COPYING. If not, write to
- the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
- MA 02111-1307, USA.
-
- As a special exception, if you link this library with files
- compiled with a GNU compiler to produce an executable, this does
- not cause the resulting executable to be covered by the GNU General
- Public License. This exception does not however invalidate any
- other reasons why the executable file might be covered by the GNU
- General Public License. */
-
-#include "libioP.h"
-#include "stdio.h"
-
-int
-_IO_feof (fp)
- _IO_FILE* fp;
-{
- int result;
- 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)
-#elif defined(_G_STDIO_USES_LIBIO) && defined(_G_HAVE_WEAK_SYMBOL)
-int feof (_IO_FILE *) __attribute__ ((weak, alias("_IO_feof")));
-#endif
diff --git a/contrib/libio/ioferror.c b/contrib/libio/ioferror.c
deleted file mode 100644
index 3019e796a1f6..000000000000
--- a/contrib/libio/ioferror.c
+++ /dev/null
@@ -1,45 +0,0 @@
-/* Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
- This file is part of the GNU IO Library.
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License as
- published by the Free Software Foundation; either version 2, or (at
- your option) any later version.
-
- This library is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this library; see the file COPYING. If not, write to
- the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
- MA 02111-1307, USA.
-
- As a special exception, if you link this library with files
- compiled with a GNU compiler to produce an executable, this does
- not cause the resulting executable to be covered by the GNU General
- Public License. This exception does not however invalidate any
- other reasons why the executable file might be covered by the GNU
- General Public License. */
-
-#include "libioP.h"
-#include "stdio.h"
-
-int
-_IO_ferror (fp)
- _IO_FILE* fp;
-{
- int result;
- 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)
-#elif defined(_G_STDIO_USES_LIBIO) && defined(_G_HAVE_WEAK_SYMBOL)
-int ferror (_IO_FILE *) __attribute__ ((weak, alias("_IO_ferror")));
-#endif
diff --git a/contrib/libio/iofflush.c b/contrib/libio/iofflush.c
deleted file mode 100644
index 540c99d535ee..000000000000
--- a/contrib/libio/iofflush.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/* Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
- This file is part of the GNU IO Library.
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License as
- published by the Free Software Foundation; either version 2, or (at
- your option) any later version.
-
- This library is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this library; see the file COPYING. If not, write to
- the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
- MA 02111-1307, USA.
-
- As a special exception, if you link this library with files
- compiled with a GNU compiler to produce an executable, this does
- not cause the resulting executable to be covered by the GNU General
- Public License. This exception does not however invalidate any
- other reasons why the executable file might be covered by the GNU
- General Public License. */
-
-#include "libioP.h"
-#include <stdio.h>
-
-int
-_IO_fflush (fp)
- _IO_FILE *fp;
-{
- if (fp == NULL)
- return _IO_flush_all ();
- else
- {
- int result;
- CHECK_FILE (fp, EOF);
- _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
- _IO_flockfile (fp);
- result = _IO_SYNC (fp) ? EOF : 0;
- _IO_cleanup_region_end (1);
- return result;
- }
-}
-
-#ifdef weak_alias
-weak_alias (_IO_fflush, fflush)
-#endif
diff --git a/contrib/libio/iofflush_u.c b/contrib/libio/iofflush_u.c
deleted file mode 100644
index b46ae4a3f949..000000000000
--- a/contrib/libio/iofflush_u.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/* Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
- This file is part of the GNU IO Library.
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License as
- published by the Free Software Foundation; either version 2, or (at
- your option) any later version.
-
- This library is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this library; see the file COPYING. If not, write to
- the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
- MA 02111-1307, USA.
-
- As a special exception, if you link this library with files
- compiled with a GNU compiler to produce an executable, this does
- not cause the resulting executable to be covered by the GNU General
- Public License. This exception does not however invalidate any
- other reasons why the executable file might be covered by the GNU
- General Public License. */
-
-#include "libioP.h"
-#include <stdio.h>
-
-int
-fflush_unlocked (fp)
- _IO_FILE *fp;
-{
- if (fp == NULL)
- return _IO_flush_all ();
- else
- {
- CHECK_FILE (fp, EOF);
- return _IO_SYNC (fp) ? EOF : 0;
- }
-}
diff --git a/contrib/libio/iofgetpos.c b/contrib/libio/iofgetpos.c
deleted file mode 100644
index 716be4bca107..000000000000
--- a/contrib/libio/iofgetpos.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/* 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 <errno.h>
-/* ANSI explicitly requires setting errno to a positive value on failure. */
-
-int
-_IO_fgetpos (fp, posp)
- _IO_FILE* fp;
- _IO_fpos_t *posp;
-{
- _IO_fpos_t pos;
- CHECK_FILE (fp, EOF);
- _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
- _IO_flockfile (fp);
- pos = _IO_seekoff (fp, 0, _IO_seek_cur, 0);
- _IO_cleanup_region_end (1);
- if (pos == _IO_pos_BAD)
- {
-#ifdef EIO
- if (errno == 0)
- __set_errno (EIO);
-#endif
- return EOF;
- }
- *posp = pos;
- return 0;
-}
-
-#ifdef weak_alias
-weak_alias (_IO_fgetpos, fgetpos)
-#endif
diff --git a/contrib/libio/iofgets.c b/contrib/libio/iofgets.c
deleted file mode 100644
index 74754d5d1ea8..000000000000
--- a/contrib/libio/iofgets.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/* Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
- This file is part of the GNU IO Library.
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License as
- published by the Free Software Foundation; either version 2, or (at
- your option) any later version.
-
- This library is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this library; see the file COPYING. If not, write to
- the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
- MA 02111-1307, USA.
-
- As a special exception, if you link this library with files
- compiled with a GNU compiler to produce an executable, this does
- not cause the resulting executable to be covered by the GNU General
- Public License. This exception does not however invalidate any
- other reasons why the executable file might be covered by the GNU
- General Public License. */
-
-#include "libioP.h"
-#include <stdio.h>
-
-char *
-_IO_fgets (buf, n, fp)
- char *buf;
- int n;
- _IO_FILE *fp;
-{
- _IO_size_t count;
- char *result;
- CHECK_FILE (fp, NULL);
- if (n <= 0)
- return NULL;
- _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
- _IO_flockfile (fp);
- count = _IO_getline (fp, buf, n - 1, '\n', 1);
- if (count == 0 || (fp->_IO_file_flags & _IO_ERR_SEEN))
- result = NULL;
- else
- {
- buf[count] = '\0';
- result = buf;
- }
- _IO_cleanup_region_end (1);
- return result;
-}
-
-#ifdef weak_alias
-weak_alias (_IO_fgets, fgets)
-#endif
diff --git a/contrib/libio/iofopen.c b/contrib/libio/iofopen.c
deleted file mode 100644
index 1dbeccb81a8f..000000000000
--- a/contrib/libio/iofopen.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/* Copyright (C) 1993, 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"
-#ifdef __STDC__
-#include <stdlib.h>
-#endif
-
-_IO_FILE *
-_IO_fopen (filename, mode)
- const char *filename;
- const char *mode;
-{
- struct locked_FILE
- {
- struct _IO_FILE_plus fp;
-#ifdef _IO_MTSAFE_IO
- _IO_lock_t lock;
-#endif
- } *new_f = (struct locked_FILE *) malloc (sizeof (struct locked_FILE));
-
- if (new_f == NULL)
- return NULL;
-#ifdef _IO_MTSAFE_IO
- new_f->fp.file._lock = &new_f->lock;
-#endif
- _IO_init (&new_f->fp.file, 0);
- _IO_JUMPS (&new_f->fp.file) = &_IO_file_jumps;
- _IO_file_init (&new_f->fp.file);
-#if !_IO_UNIFIED_JUMPTABLES
- new_f->fp.vtable = NULL;
-#endif
- if (_IO_file_fopen (&new_f->fp.file, filename, mode) != NULL)
- return (_IO_FILE *) &new_f->fp;
- _IO_un_link (&new_f->fp.file);
- free (new_f);
- return NULL;
-}
-
-#ifdef weak_alias
-weak_alias (_IO_fopen, fopen)
-#endif
diff --git a/contrib/libio/iofprintf.c b/contrib/libio/iofprintf.c
deleted file mode 100644
index 4dc9d3f6617e..000000000000
--- a/contrib/libio/iofprintf.c
+++ /dev/null
@@ -1,51 +0,0 @@
-/* Copyright (C) 1993, 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"
-
-#ifdef __STDC__
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
-
-int
-#ifdef __STDC__
-_IO_fprintf (_IO_FILE *fp, const char* format, ...)
-#else
-_IO_fprintf (fp, format, va_alist)
- _IO_FILE *fp;
- char *format;
- va_dcl
-#endif
-{
- int ret;
- va_list args;
- CHECK_FILE (fp, -1);
- _IO_va_start (args, format);
- ret = _IO_vfprintf (fp, format, args);
- va_end (args);
- return ret;
-}
diff --git a/contrib/libio/iofputs.c b/contrib/libio/iofputs.c
deleted file mode 100644
index 1a329bbe26fc..000000000000
--- a/contrib/libio/iofputs.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/* Copyright (C) 1993, 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 <string.h>
-
-int
-_IO_fputs (str, fp)
- const char *str;
- _IO_FILE *fp;
-{
- _IO_size_t len = strlen (str);
- int result;
- CHECK_FILE (fp, EOF);
- _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
- _IO_flockfile (fp);
- if (_IO_sputn (fp, str, len) != len)
- result = EOF;
- else
- result = 1;
- _IO_cleanup_region_end (1);
- return result;
-}
-
-#ifdef weak_alias
-weak_alias (_IO_fputs, fputs)
-#endif
diff --git a/contrib/libio/iofread.c b/contrib/libio/iofread.c
deleted file mode 100644
index c83d2b638c97..000000000000
--- a/contrib/libio/iofread.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/* Copyright (C) 1993, 1995, 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"
-
-_IO_size_t
-_IO_fread (buf, size, count, fp)
- void *buf;
- _IO_size_t size;
- _IO_size_t count;
- _IO_FILE *fp;
-{
- _IO_size_t bytes_requested = size*count;
- _IO_size_t bytes_read;
- CHECK_FILE (fp, 0);
- if (bytes_requested == 0)
- return 0;
- _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
- _IO_flockfile (fp);
- bytes_read = _IO_sgetn (fp, (char *) buf, bytes_requested);
- _IO_cleanup_region_end (1);
- return bytes_requested == bytes_read ? count : bytes_read / size;
-}
-
-#ifdef weak_alias
-weak_alias (_IO_fread, fread)
-#endif
diff --git a/contrib/libio/iofscanf.c b/contrib/libio/iofscanf.c
deleted file mode 100644
index 3e12d9b5315c..000000000000
--- a/contrib/libio/iofscanf.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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"
-
-#ifdef __STDC__
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
-
-int
-_IO_fscanf
-#ifdef __STDC__
- (_IO_FILE *fp, const char* format, ...)
-#else
-(fp, format, va_alist) _IO_FILE *fp; char *format; va_dcl
-#endif
-{
- int ret;
- va_list args;
- CHECK_FILE(fp, EOF);
- _IO_va_start(args, format);
- ret = _IO_vfscanf(fp, format, args, NULL);
- va_end(args);
- return ret;
-}
diff --git a/contrib/libio/iofsetpos.c b/contrib/libio/iofsetpos.c
deleted file mode 100644
index a8d816f5a393..000000000000
--- a/contrib/libio/iofsetpos.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/* Copyright (C) 1993, 1995, 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 <errno.h>
-
-int
-_IO_fsetpos (fp, posp)
- _IO_FILE *fp;
- const _IO_fpos_t *posp;
-{
- int result;
- CHECK_FILE (fp, EOF);
- _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
- _IO_flockfile (fp);
- if (_IO_seekpos (fp, *posp, _IOS_INPUT|_IOS_OUTPUT) == _IO_pos_BAD)
- {
- /* ANSI explicitly requires setting errno to a positive value on
- failure. */
-#ifdef EIO
- if (errno == 0)
- __set_errno (EIO);
-#endif
- result = EOF;
- }
- else
- result = 0;
- _IO_cleanup_region_end (1);
- return result;
-}
-
-#ifdef weak_alias
-weak_alias (_IO_fsetpos, fsetpos)
-#endif
diff --git a/contrib/libio/ioftell.c b/contrib/libio/ioftell.c
deleted file mode 100644
index d8a1ce1d2423..000000000000
--- a/contrib/libio/ioftell.c
+++ /dev/null
@@ -1,53 +0,0 @@
-/* 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 <errno.h>
-/* ANSI explicily requires setting errno to a positive value on failure. */
-
-long int
-_IO_ftell (fp)
- _IO_FILE *fp;
-{
- _IO_pos_t pos;
- CHECK_FILE (fp, -1L);
- _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
- _IO_flockfile (fp);
- pos = _IO_seekoff (fp, 0, _IO_seek_cur, 0);
- _IO_cleanup_region_end (1);
- if (pos == _IO_pos_BAD)
- {
-#ifdef EIO
- if (errno == 0)
- __set_errno (EIO);
-#endif
- return -1L;
- }
- return _IO_pos_as_off (pos);
-}
-
-#ifdef weak_alias
-weak_alias (_IO_ftell, ftell)
-#endif
diff --git a/contrib/libio/iofwrite.c b/contrib/libio/iofwrite.c
deleted file mode 100644
index 5bc525ffc704..000000000000
--- a/contrib/libio/iofwrite.c
+++ /dev/null
@@ -1,54 +0,0 @@
-/* Copyright (C) 1993, 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"
-
-_IO_size_t
-_IO_fwrite (buf, size, count, fp)
- const void *buf;
- _IO_size_t size;
- _IO_size_t count;
- _IO_FILE *fp;
-{
- _IO_size_t request = size * count;
- _IO_size_t written;
- CHECK_FILE (fp, 0);
- if (request == 0)
- return 0;
- _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
- _IO_flockfile (fp);
- written = _IO_sputn (fp, (const char *) buf, request);
- _IO_cleanup_region_end (1);
- /* Many traditional implementations return 0 if size==0 && count > 0,
- but ANSI requires us to return count in this case. */
- if (written == request)
- return count;
- else
- return written / size;
-}
-
-#ifdef weak_alias
-weak_alias (_IO_fwrite, fwrite)
-#endif
diff --git a/contrib/libio/iogetc.c b/contrib/libio/iogetc.c
deleted file mode 100644
index 6a11e47334dc..000000000000
--- a/contrib/libio/iogetc.c
+++ /dev/null
@@ -1,50 +0,0 @@
-/* Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
- This file is part of the GNU IO Library.
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License as
- published by the Free Software Foundation; either version 2, or (at
- your option) any later version.
-
- This library is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this library; see the file COPYING. If not, write to
- the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
- MA 02111-1307, USA.
-
- As a special exception, if you link this library with files
- compiled with a GNU compiler to produce an executable, this does
- not cause the resulting executable to be covered by the GNU General
- Public License. This exception does not however invalidate any
- other reasons why the executable file might be covered by the GNU
- General Public License. */
-
-#include "libioP.h"
-#include "stdio.h"
-
-#undef _IO_getc
-
-int
-_IO_getc (fp)
- _IO_FILE *fp;
-{
- 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)
-#elif defined(_G_STDIO_USES_LIBIO) && defined(_G_HAVE_WEAK_SYMBOL)
-int getc (_IO_FILE *) __attribute__ ((weak, alias("_IO_getc")));
-#endif
diff --git a/contrib/libio/iogetdelim.c b/contrib/libio/iogetdelim.c
deleted file mode 100644
index 50918b3e8dcc..000000000000
--- a/contrib/libio/iogetdelim.c
+++ /dev/null
@@ -1,125 +0,0 @@
-/* Copyright (C) 1994, 1996, 1997 Free Software Foundation, Inc.
- This file is part of the GNU IO Library.
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License as
- published by the Free Software Foundation; either version 2, or (at
- your option) any later version.
-
- This library is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this library; see the file COPYING. If not, write to
- the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
- MA 02111-1307, USA.
-
- As a special exception, if you link this library with files
- compiled with a GNU compiler to produce an executable, this does
- not cause the resulting executable to be covered by the GNU General
- Public License. This exception does not however invalidate any
- other reasons why the executable file might be covered by the GNU
- General Public License. */
-
-#ifdef __STDC__
-#include <stdlib.h>
-#endif
-#include "libioP.h"
-#include <string.h>
-#include <errno.h>
-
-/* Read up to (and including) a TERMINATOR from FP into *LINEPTR
- (and null-terminate it). *LINEPTR is a pointer returned from malloc (or
- NULL), pointing to *N characters of space. It is realloc'ed as
- necessary. Returns the number of characters read (not including the
- null terminator), or -1 on error or EOF. */
-
-_IO_ssize_t
-_IO_getdelim (lineptr, n, delimiter, fp)
- char **lineptr;
- _IO_size_t *n;
- int delimiter;
- _IO_FILE *fp;
-{
- int result;
- _IO_ssize_t cur_len = 0;
- _IO_ssize_t len;
-
- if (lineptr == NULL || n == NULL)
- {
- MAYBE_SET_EINVAL;
- return -1;
- }
- CHECK_FILE (fp, -1);
- _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
- _IO_flockfile (fp);
- if (_IO_ferror_unlocked (fp))
- {
- result = -1;
- goto unlock_return;
- }
-
- if (*lineptr == NULL || *n == 0)
- {
- *n = 120;
- *lineptr = (char *) malloc (*n);
- if (*lineptr == NULL)
- {
- result = -1;
- goto unlock_return;
- }
- }
-
- len = fp->_IO_read_end - fp->_IO_read_ptr;
- if (len <= 0)
- {
- if (__underflow (fp) == EOF)
- {
- result = -1;
- goto unlock_return;
- }
- len = fp->_IO_read_end - fp->_IO_read_ptr;
- }
-
- for (;;)
- {
- _IO_size_t needed;
- char *t;
- t = (char *) memchr ((void *) fp->_IO_read_ptr, delimiter, len);
- if (t != NULL)
- len = (t - fp->_IO_read_ptr) + 1;
- /* Make enough space for len+1 (for final NUL) bytes. */
- needed = cur_len + len + 1;
- if (needed > *n)
- {
- if (needed < 2 * *n)
- needed = 2 * *n; /* Be generous. */
- *n = needed;
- *lineptr = (char *) realloc (*lineptr, needed);
- if (*lineptr == NULL)
- {
- result = -1;
- goto unlock_return;
- }
- }
- memcpy (*lineptr + cur_len, (void *) fp->_IO_read_ptr, len);
- fp->_IO_read_ptr += len;
- cur_len += len;
- if (t != NULL || __underflow (fp) == EOF)
- break;
- len = fp->_IO_read_end - fp->_IO_read_ptr;
- }
- (*lineptr)[cur_len] = '\0';
- result = cur_len;
-
-unlock_return:
- _IO_cleanup_region_end (1);
- return result;
-}
-
-#ifdef weak_alias
-weak_alias (_IO_getdelim, __getdelim)
-weak_alias (_IO_getdelim, getdelim)
-#endif
diff --git a/contrib/libio/iogetline.c b/contrib/libio/iogetline.c
deleted file mode 100644
index 5aac9b56387e..000000000000
--- a/contrib/libio/iogetline.c
+++ /dev/null
@@ -1,112 +0,0 @@
-/* Copyright (C) 1993, 1997, 1998 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 <string.h>
-
-#if defined(_LIBC) || !_G_HAVE_IO_GETLINE_INFO
-
-_IO_size_t
-_IO_getline (fp, buf, n, delim, extract_delim)
- _IO_FILE *fp;
- char *buf;
- _IO_size_t n;
- int delim;
- int extract_delim;
-{
- return _IO_getline_info (fp, buf, n, delim, extract_delim, (int *) 0);
-}
-
-/* Algorithm based on that used by Berkeley pre-4.4 fgets implementation.
-
- Read chars into buf (of size n), until delim is seen.
- Return number of chars read (at most n).
- Does not put a terminating '\0' in buf.
- If extract_delim < 0, leave delimiter unread.
- If extract_delim > 0, insert delim in output. */
-
-_IO_size_t
-_IO_getline_info (fp, buf, n, delim, extract_delim, eof)
- _IO_FILE *fp;
- char *buf;
- _IO_size_t n;
- int delim;
- int extract_delim;
- int *eof;
-{
- char *ptr = buf;
- if (eof) *eof = 0;
- while (n != 0)
- {
- _IO_ssize_t len = fp->_IO_read_end - fp->_IO_read_ptr;
- if (len <= 0)
- {
- int c = __uflow (fp);
- if (c == EOF)
- {
- if (eof) *eof = c;
- break;
- }
- if (c == delim)
- {
- if (extract_delim > 0)
- *ptr++ = c;
- else if (extract_delim < 0)
- _IO_sputbackc (fp, c);
- return ptr - buf;
- }
- *ptr++ = c;
- n--;
- }
- else
- {
- char *t;
- if ((_IO_size_t) len >= n)
- len = n;
- t = (char *) memchr ((void *) fp->_IO_read_ptr, delim, len);
- if (t != NULL)
- {
- _IO_size_t old_len = ptr-buf;
- len = t - fp->_IO_read_ptr;
- if (extract_delim >= 0)
- {
- ++t;
- if (extract_delim > 0)
- ++len;
- }
- memcpy ((void *) ptr, (void *) fp->_IO_read_ptr, len);
- fp->_IO_read_ptr = t;
- return old_len + len;
- }
- memcpy ((void *) ptr, (void *) fp->_IO_read_ptr, len);
- fp->_IO_read_ptr += len;
- ptr += len;
- n -= len;
- }
- }
- return ptr - buf;
-}
-
-#endif /* Defined(_LIBC) || !_G_HAVE_IO_GETLINE_INFO */
diff --git a/contrib/libio/iogets.c b/contrib/libio/iogets.c
deleted file mode 100644
index 9e88ca1037ae..000000000000
--- a/contrib/libio/iogets.c
+++ /dev/null
@@ -1,71 +0,0 @@
-/* Copyright (C) 1993, 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 <limits.h>
-
-char*
-_IO_gets (buf)
- char *buf;
-{
- _IO_size_t count;
- int ch;
- char *retval;
-
- _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile,
- _IO_stdin);
- _IO_flockfile (_IO_stdin);
- ch = _IO_getc_unlocked (_IO_stdin);
- if (ch == EOF)
- {
- retval = NULL;
- goto unlock_return;
- }
- if (ch == '\n')
- count = 0;
- else
- {
- buf[0] = (char) ch;
- count = _IO_getline (_IO_stdin, buf + 1, INT_MAX, '\n', 0) + 1;
- if (_IO_stdin->_IO_file_flags & _IO_ERR_SEEN)
- {
- retval = NULL;
- goto unlock_return;
- }
- }
- buf[count] = 0;
- retval = buf;
-unlock_return:
- _IO_cleanup_region_end (1);
- return retval;
-}
-
-#ifdef weak_alias
-weak_alias (_IO_gets, gets)
-#endif
-
-#ifdef _LIBC
-link_warning (gets, "the `gets' function is dangerous and should not be used.")
-#endif
diff --git a/contrib/libio/ioignore.c b/contrib/libio/ioignore.c
deleted file mode 100644
index ac0678ed7b99..000000000000
--- a/contrib/libio/ioignore.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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"
-
-int
-_IO_ignore (fp, n)
- _IO_FILE *fp;
- _IO_size_t n;
-{
- register _IO_size_t more = n;
- for (;;)
- {
- _IO_ssize_t count = fp->_IO_read_end - fp->_IO_read_ptr;
- if (count > 0)
- {
- if (count > more)
- count = more;
- fp->_IO_read_ptr += count;
- more -= count;
- }
- if (more == 0 || __underflow(fp) == EOF)
- break;
- }
- return n - more;
-}
diff --git a/contrib/libio/iolibio.h b/contrib/libio/iolibio.h
deleted file mode 100644
index 0ebc14f7ac2b..000000000000
--- a/contrib/libio/iolibio.h
+++ /dev/null
@@ -1,67 +0,0 @@
-#include <libio.h>
-
-/* These emulate stdio functionality, but with a different name
- (_IO_ungetc instead of ungetc), and using _IO_FILE instead of FILE. */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern int _IO_fclose __P((_IO_FILE*));
-extern _IO_FILE *_IO_fdopen __P((int, const char*));
-extern int _IO_fflush __P((_IO_FILE*));
-extern int _IO_fgetpos __P((_IO_FILE*, _IO_fpos_t*));
-extern char* _IO_fgets __P((char*, int, _IO_FILE*));
-extern _IO_FILE *_IO_fopen __P((const char*, const char*));
-extern int _IO_fprintf __P((_IO_FILE*, const char*, ...));
-extern int _IO_fputs __P((const char*, _IO_FILE*));
-extern int _IO_fsetpos __P((_IO_FILE*, const _IO_fpos_t *));
-extern long int _IO_ftell __P((_IO_FILE*));
-extern _IO_size_t _IO_fread __P((void*, _IO_size_t, _IO_size_t, _IO_FILE*));
-extern _IO_size_t _IO_fwrite __P((const void*,
- _IO_size_t, _IO_size_t, _IO_FILE*));
-extern char* _IO_gets __P((char*));
-extern void _IO_perror __P((const char*));
-extern int _IO_printf __P((const char*, ...));
-extern int _IO_puts __P((const char*));
-extern int _IO_scanf __P((const char*, ...));
-extern void _IO_setbuffer __P((_IO_FILE *, char*, _IO_size_t));
-extern int _IO_setvbuf __P((_IO_FILE*, char*, int, _IO_size_t));
-extern int _IO_sscanf __P((const char*, const char*, ...));
-extern int _IO_sprintf __P((char *, const char*, ...));
-extern int _IO_ungetc __P((int, _IO_FILE*));
-extern int _IO_vsscanf __P((const 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
-# if defined(_G_IO_IO_FILE_VERSION) && _G_IO_IO_FILE_VERSION == 0x20001
-# define _IO_pos_BAD ((_IO_off64_t) -1)
-# else
-# define _IO_pos_BAD ((_IO_off_t) -1)
-# endif
-#endif
-#define _IO_clearerr(FP) ((FP)->_flags &= ~(_IO_ERR_SEEN|_IO_EOF_SEEN))
-#define _IO_fseek(__fp, __offset, __whence) \
- (_IO_seekoff(__fp, __offset, __whence, _IOS_INPUT|_IOS_OUTPUT) == _IO_pos_BAD ? EOF : 0)
-#define _IO_rewind(FILE) (void)_IO_seekoff(FILE, 0, 0, _IOS_INPUT|_IOS_OUTPUT)
-#define _IO_vprintf(FORMAT, ARGS) _IO_vfprintf(_IO_stdout, FORMAT, ARGS)
-#if _G_IO_IO_FILE_VERSION == 0x20001
-#define _IO_freopen(FILENAME, MODE, FP) \
- (_IO_file_close_it(FP), _IO_file_fopen(FP, FILENAME, MODE, 0))
-#else
-#define _IO_freopen(FILENAME, MODE, FP) \
- (_IO_file_close_it(FP), _IO_file_fopen(FP, FILENAME, MODE))
-#endif
-#define _IO_fileno(FP) ((FP)->_fileno)
-extern _IO_FILE* _IO_popen __P((const char*, const char*));
-#define _IO_pclose _IO_fclose
-#define _IO_setbuf(_FP, _BUF) _IO_setbuffer(_FP, _BUF, _IO_BUFSIZ)
-#define _IO_setlinebuf(_FP) _IO_setvbuf(_FP, NULL, 1, 0)
-
-#ifdef __cplusplus
-}
-#endif
diff --git a/contrib/libio/iomanip.cc b/contrib/libio/iomanip.cc
deleted file mode 100644
index fddba55a2b98..000000000000
--- a/contrib/libio/iomanip.cc
+++ /dev/null
@@ -1,90 +0,0 @@
-/* This is part of libio/iostream, providing -*- C++ -*- input/output.
-Copyright (C) 1993 Free Software Foundation
-
-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. */
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-
-#include "iomanip.h"
-
-
-// Those functions are called through a pointer,
-// thus it does not make sense, to inline them.
-
-ios & __iomanip_setbase (ios& i, int n)
-{
- ios::fmtflags b;
- switch (n)
- {
- case 8:
- b = ios::oct; break;
- case 10:
- b = ios::dec; break;
- case 16:
- b = ios::hex; break;
- default:
- b = 0;
- }
- i.setf(b, ios::basefield);
- return i;
-}
-
-ios & __iomanip_setfill (ios& i, int n)
-{
- //FIXME if ( i.flags() & ios::widechar )
- i.fill( (char) n);
- //FIXME else
- //FIXME i.fill( (wchar) n);
- return i;
-}
-
-ios & __iomanip_setprecision (ios& i, int n)
-{
- i.precision(n);
- return i;
-}
-ios & __iomanip_setw (ios& i, int n)
-{
- i.width(n);
- return i;
-}
-
-ios & __iomanip_setiosflags (ios& i, ios::fmtflags n)
-{
- i.setf(n,n);
- return i;
-}
-
-ios & __iomanip_resetiosflags (ios& i, ios::fmtflags n)
-{
- i.setf(0,n);
- return i;
-}
-
-template class smanip<int>;
-template class smanip<ios::fmtflags>;
-template istream& operator>>(istream&, const smanip<int>&);
-template istream& operator>>(istream&, const smanip<ios::fmtflags>&);
-template ostream& operator<<(ostream&, const smanip<int>&);
-template ostream& operator<<(ostream&, const smanip<ios::fmtflags>&);
diff --git a/contrib/libio/iomanip.h b/contrib/libio/iomanip.h
deleted file mode 100644
index 7c0232ed1e16..000000000000
--- a/contrib/libio/iomanip.h
+++ /dev/null
@@ -1,180 +0,0 @@
-/* This is part of libio/iostream, providing -*- C++ -*- input/output.
-Copyright (C) 1993 Free Software Foundation
-
-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. */
-
-#ifndef _IOMANIP_H
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _IOMANIP_H
-
-#include <iostream.h>
-
-extern "C++" {
-//-----------------------------------------------------------------------------
-// Parametrized Manipulators as specified by ANSI draft
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// Stream Manipulators
-//-----------------------------------------------------------------------------
-//
-template<class TP> class smanip; // TP = Type Param
-
-template<class TP> class sapp {
- ios& (*_f)(ios&, TP);
-public:
- sapp(ios& (*f)(ios&, TP)) : _f(f) {}
- //
- smanip<TP> operator()(TP a)
- { return smanip<TP>(_f, a); }
-};
-
-template<class TP>
-inline istream& operator>>(istream& i, const smanip<TP>& m);
-template<class TP>
-inline ostream& operator<<(ostream& o, const smanip<TP>& m);
-
-template <class TP> class smanip {
- ios& (*_f)(ios&, TP);
- TP _a;
-public:
- smanip(ios& (*f)(ios&, TP), TP a) : _f(f), _a(a) {}
- //
- friend
- istream& operator>> <>(istream& i, const smanip<TP>& m);
- friend
- ostream& operator<< <>(ostream& o, const smanip<TP>& m);
-};
-
-#ifdef __GNUG__
-__extension__ extern template class smanip<int>;
-__extension__ extern template class smanip<ios::fmtflags>;
-#endif
-
-template<class TP>
-inline istream& operator>>(istream& i, const smanip<TP>& m)
-{ (*m._f)(i, m._a); return i; }
-
-template<class TP>
-inline ostream& operator<<(ostream& o, const smanip<TP>& m)
-{ (*m._f)(o, m._a); return o;}
-
-#ifdef __GNUG__
-__extension__ extern
-template istream& operator>>(istream&, const smanip<int>&);
-__extension__ extern
-template istream& operator>>(istream&, const smanip<ios::fmtflags>&);
-__extension__ extern
-template ostream& operator<<(ostream&, const smanip<int>&);
-__extension__ extern
-template ostream& operator<<(ostream&, const smanip<ios::fmtflags>&);
-#endif
-
-//-----------------------------------------------------------------------------
-// Input-Stream Manipulators
-//-----------------------------------------------------------------------------
-//
-template<class TP> class imanip;
-
-template<class TP> class iapp {
- istream& (*_f)(istream&, TP);
-public:
- iapp(istream& (*f)(istream&,TP)) : _f(f) {}
- //
- imanip<TP> operator()(TP a)
- { return imanip<TP>(_f, a); }
-};
-
-template <class TP>
-inline istream& operator>>(istream&, const imanip<TP>&);
-
-template <class TP> class imanip {
- istream& (*_f)(istream&, TP);
- TP _a;
-public:
- imanip(istream& (*f)(istream&, TP), TP a) : _f(f), _a(a) {}
- //
- friend
- istream& operator>> <>(istream& i, const imanip<TP>& m);
-};
-
-template <class TP>
-inline istream& operator>>(istream& i, const imanip<TP>& m)
-{ return (*m._f)( i, m._a); }
-
-//-----------------------------------------------------------------------------
-// Output-Stream Manipulators
-//-----------------------------------------------------------------------------
-//
-template<class TP> class omanip;
-
-template<class TP> class oapp {
- ostream& (*_f)(ostream&, TP);
-public:
- oapp(ostream& (*f)(ostream&,TP)) : _f(f) {}
- //
- omanip<TP> operator()(TP a)
- { return omanip<TP>(_f, a); }
-};
-
-template <class TP>
-inline ostream& operator<<(ostream&, const omanip<TP>&);
-
-template <class TP> class omanip {
- ostream& (*_f)(ostream&, TP);
- TP _a;
-public:
- omanip(ostream& (*f)(ostream&, TP), TP a) : _f(f), _a(a) {}
- //
- friend
- ostream& operator<< <>(ostream& o, const omanip<TP>& m);
-};
-
-template <class TP>
-inline ostream& operator<<(ostream& o, const omanip<TP>& m)
-{ return (*m._f)(o, m._a); }
-
-//-----------------------------------------------------------------------------
-// Available Manipulators
-//-----------------------------------------------------------------------------
-
-//
-// Macro to define an iomanip function, with one argument
-// The underlying function is `__iomanip_<name>'
-//
-#define __DEFINE_IOMANIP_FN1(type,param,function) \
- extern ios& __iomanip_##function (ios&, param); \
- inline type<param> function (param n) \
- { return type<param> (__iomanip_##function, n); }
-
-__DEFINE_IOMANIP_FN1( smanip, int, setbase)
-__DEFINE_IOMANIP_FN1( smanip, int, setfill)
-__DEFINE_IOMANIP_FN1( smanip, int, setprecision)
-__DEFINE_IOMANIP_FN1( smanip, int, setw)
-
-__DEFINE_IOMANIP_FN1( smanip, ios::fmtflags, resetiosflags)
-__DEFINE_IOMANIP_FN1( smanip, ios::fmtflags, setiosflags)
-} // extern "C++"
-
-#endif /*!_IOMANIP_H*/
diff --git a/contrib/libio/iopadn.c b/contrib/libio/iopadn.c
deleted file mode 100644
index 087715b349b8..000000000000
--- a/contrib/libio/iopadn.c
+++ /dev/null
@@ -1,70 +0,0 @@
-/* Copyright (C) 1993, 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"
-
-#define PADSIZE 16
-static char const blanks[PADSIZE] =
-{' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' '};
-static char const zeroes[PADSIZE] =
-{'0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0'};
-
-_IO_ssize_t
-_IO_padn (fp, pad, count)
- _IO_FILE *fp;
- int pad;
- _IO_ssize_t count;
-{
- char padbuf[PADSIZE];
- const char *padptr;
- int i;
- _IO_size_t written = 0;
- _IO_size_t w;
-
- if (pad == ' ')
- padptr = blanks;
- else if (pad == '0')
- padptr = zeroes;
- else
- {
- for (i = PADSIZE; --i >= 0; )
- padbuf[i] = pad;
- padptr = padbuf;
- }
- for (i = count; i >= PADSIZE; i -= PADSIZE)
- {
- w = _IO_sputn (fp, padptr, PADSIZE);
- written += w;
- if (w != PADSIZE)
- return written;
- }
-
- if (i > 0)
- {
- w = _IO_sputn (fp, padptr, i);
- written += w;
- }
- return written;
-}
diff --git a/contrib/libio/ioperror.c b/contrib/libio/ioperror.c
deleted file mode 100644
index 7ca72b0bb60b..000000000000
--- a/contrib/libio/ioperror.c
+++ /dev/null
@@ -1,22 +0,0 @@
-#include "libioP.h"
-#include <errno.h>
-#include <string.h>
-#ifndef errno
-extern int errno;
-#endif
-
-#ifndef _IO_strerror
-extern char* _IO_strerror __P((int));
-#endif
-
-void
-_IO_perror (s)
- const char *s;
-{
- char *error = _IO_strerror (errno);
-
- if (s != NULL && *s != '\0')
- _IO_fprintf (_IO_stderr, "%s:", s);
-
- _IO_fprintf (_IO_stderr, "%s\n", error ? error : "");
-}
diff --git a/contrib/libio/iopopen.c b/contrib/libio/iopopen.c
deleted file mode 100644
index 58f97495c11b..000000000000
--- a/contrib/libio/iopopen.c
+++ /dev/null
@@ -1,248 +0,0 @@
-/* Copyright (C) 1993, 1997 Free Software Foundation, Inc.
- This file is part of the GNU IO Library.
- Written by Per Bothner <bothner@cygnus.com>.
-
- This 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"
-#if _IO_HAVE_SYS_WAIT
-#include <signal.h>
-#include <unistd.h>
-#ifdef __STDC__
-#include <stdlib.h>
-#endif
-#ifdef _LIBC
-# include <unistd.h>
-#endif
-#include <sys/types.h>
-#include <sys/wait.h>
-
-#ifndef _IO_fork
-#define _IO_fork vfork /* defined in libiberty, if needed */
-extern _IO_pid_t _IO_fork __P ((void));
-#endif
-
-#endif /* _IO_HAVE_SYS_WAIT */
-
-#ifndef _IO_pipe
-#define _IO_pipe pipe
-extern int _IO_pipe __P ((int des[2]));
-#endif
-
-#ifndef _IO_dup2
-#define _IO_dup2 dup2
-extern int _IO_dup2 __P ((int fd, int fd2));
-#endif
-
-#ifndef _IO_waitpid
-#define _IO_waitpid waitpid
-#endif
-
-#ifndef _IO_execl
-#define _IO_execl execl
-#endif
-#ifndef _IO__exit
-#define _IO__exit _exit
-#endif
-
-#ifndef _IO_close
-#define _IO_close close
-#endif
-
-struct _IO_proc_file
-{
- struct _IO_FILE_plus file;
- /* Following fields must match those in class procbuf (procbuf.h) */
- _IO_pid_t pid;
- struct _IO_proc_file *next;
-};
-typedef struct _IO_proc_file _IO_proc_file;
-
-static struct _IO_proc_file *proc_file_chain = NULL;
-
-_IO_FILE *
-_IO_proc_open (fp, command, mode)
- _IO_FILE *fp;
- const char *command;
- const char *mode;
-{
-#if _IO_HAVE_SYS_WAIT
- volatile int read_or_write;
- volatile int parent_end, child_end;
- int pipe_fds[2];
- _IO_pid_t child_pid;
- if (_IO_file_is_open (fp))
- return NULL;
- if (_IO_pipe (pipe_fds) < 0)
- return NULL;
- if (mode[0] == 'r')
- {
- parent_end = pipe_fds[0];
- child_end = pipe_fds[1];
- read_or_write = _IO_NO_WRITES;
- }
- else
- {
- parent_end = pipe_fds[1];
- child_end = pipe_fds[0];
- read_or_write = _IO_NO_READS;
- }
- ((_IO_proc_file *) fp)->pid = child_pid = _IO_fork ();
- if (child_pid == 0)
- {
- int child_std_end = mode[0] == 'r' ? 1 : 0;
- _IO_close (parent_end);
- if (child_end != child_std_end)
- {
- _IO_dup2 (child_end, child_std_end);
- _IO_close (child_end);
- }
- /* POSIX.2: "popen() shall ensure that any streams from previous
- popen() calls that remain open in the parent process are closed
- in the new child process." */
- while (proc_file_chain)
- {
- _IO_close (_IO_fileno ((_IO_FILE *) proc_file_chain));
- proc_file_chain = proc_file_chain->next;
- }
-
- _IO_execl ("/bin/sh", "sh", "-c", command, (char *) 0);
- _IO__exit (127);
- }
- _IO_close (child_end);
- if (child_pid < 0)
- {
- _IO_close (parent_end);
- return NULL;
- }
- _IO_fileno (fp) = parent_end;
-
- /* Link into proc_file_chain. */
- ((_IO_proc_file *) fp)->next = proc_file_chain;
- proc_file_chain = (_IO_proc_file *) fp;
-
- _IO_mask_flags (fp, read_or_write, _IO_NO_READS|_IO_NO_WRITES);
- return fp;
-#else /* !_IO_HAVE_SYS_WAIT */
- return NULL;
-#endif
-}
-
-_IO_FILE *
-_IO_popen (command, mode)
- const char *command;
- const char *mode;
-{
- struct locked_FILE
- {
- struct _IO_proc_file fpx;
-#ifdef _IO_MTSAFE_IO
- _IO_lock_t lock;
-#endif
- } *new_f;
- _IO_FILE *fp;
-
- new_f = (struct locked_FILE *) malloc (sizeof (struct locked_FILE));
- if (new_f == NULL)
- return NULL;
-#ifdef _IO_MTSAFE_IO
- new_f->fpx.file.file._lock = &new_f->lock;
-#endif
- fp = (_IO_FILE*)&new_f->fpx;
- _IO_init (fp, 0);
- _IO_JUMPS (fp) = &_IO_proc_jumps;
- _IO_file_init (fp);
-#if !_IO_UNIFIED_JUMPTABLES
- ((struct _IO_FILE_plus *) fp)->vtable = NULL;
-#endif
- if (_IO_proc_open (fp, command, mode) != NULL)
- return fp;
- free (new_f);
- return NULL;
-}
-
-#ifdef strong_alias
-strong_alias (_IO_popen, popen);
-#endif
-
-int
-_IO_proc_close (fp)
- _IO_FILE *fp;
-{
- /* This is not name-space clean. FIXME! */
-#if _IO_HAVE_SYS_WAIT
- int wstatus;
- _IO_proc_file **ptr = &proc_file_chain;
- _IO_pid_t wait_pid;
- int status = -1;
-
- /* Unlink from proc_file_chain. */
- for ( ; *ptr != NULL; ptr = &(*ptr)->next)
- {
- if (*ptr == (_IO_proc_file *) fp)
- {
- *ptr = (*ptr)->next;
- status = 0;
- break;
- }
- }
-
- if (status < 0 || _IO_close (_IO_fileno(fp)) < 0)
- return -1;
- /* POSIX.2 Rationale: "Some historical implementations either block
- or ignore the signals SIGINT, SIGQUIT, and SIGHUP while waiting
- for the child process to terminate. Since this behavior is not
- described in POSIX.2, such implementations are not conforming." */
- do
- {
- wait_pid = _IO_waitpid (((_IO_proc_file *) fp)->pid, &wstatus, 0);
- }
- while (wait_pid == -1 && errno == EINTR);
- if (wait_pid == -1)
- return -1;
- return wstatus;
-#else /* !_IO_HAVE_SYS_WAIT */
- return -1;
-#endif
-}
-
-struct _IO_jump_t _IO_proc_jumps = {
- JUMP_INIT_DUMMY,
- JUMP_INIT(finish, _IO_file_finish),
- JUMP_INIT(overflow, _IO_file_overflow),
- JUMP_INIT(underflow, _IO_file_underflow),
- JUMP_INIT(uflow, _IO_default_uflow),
- JUMP_INIT(pbackfail, _IO_default_pbackfail),
- JUMP_INIT(xsputn, _IO_file_xsputn),
- JUMP_INIT(xsgetn, _IO_default_xsgetn),
- JUMP_INIT(seekoff, _IO_file_seekoff),
- JUMP_INIT(seekpos, _IO_default_seekpos),
- JUMP_INIT(setbuf, _IO_file_setbuf),
- JUMP_INIT(sync, _IO_file_sync),
- JUMP_INIT(doallocate, _IO_file_doallocate),
- JUMP_INIT(read, _IO_file_read),
- JUMP_INIT(write, _IO_file_write),
- JUMP_INIT(seek, _IO_file_seek),
- JUMP_INIT(close, _IO_proc_close),
- JUMP_INIT(stat, _IO_file_stat)
-};
diff --git a/contrib/libio/ioprims.c b/contrib/libio/ioprims.c
deleted file mode 100644
index e3e0d7e75cdc..000000000000
--- a/contrib/libio/ioprims.c
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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. */
-
-/* I/O OS-level primitives.
- Needs to be replaced if not using Unix.
- Also needs to be replaced if avoiding name-space pollution
- (in which case read would be defined in terms of _IO_read,
- rather than vice versa). */
-
-#include "libioP.h"
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-
-#ifdef TODO
-/* Add open, isatty */
-#endif
-
-_IO_ssize_t
-_IO_read (fildes, buf, nbyte)
- int fildes;
- void *buf;
- _IO_size_t nbyte;
-{
- return read (fildes, buf, nbyte);
-}
-
-_IO_ssize_t
-_IO_write (fildes, buf, nbyte)
- int fildes;
- const void *buf;
- _IO_size_t nbyte;
-{
- return write (fildes, buf, nbyte);
-}
-
-_IO_off_t
-_IO_lseek (fildes, offset, whence)
- int fildes;
- _IO_off_t offset;
- int whence;
-{
- return lseek (fildes, offset, whence);
-}
-
-int
-_IO_close (fildes)
- int fildes;
-{
- return close (fildes);
-}
-
-int
-_IO_fstat (fildes, buf)
- int fildes;
- struct stat *buf;
-{
- return fstat (fildes, buf);
-}
diff --git a/contrib/libio/ioprintf.c b/contrib/libio/ioprintf.c
deleted file mode 100644
index 0b99c2a6637f..000000000000
--- a/contrib/libio/ioprintf.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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"
-
-#ifdef __STDC__
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
-
-int
-_IO_printf
-#ifdef __STDC__
- (const char* format, ...)
-#else
-(format, va_alist) char *format; va_dcl
-#endif
-{
- int ret;
- va_list args;
- _IO_va_start(args, format);
- ret = _IO_vfprintf(_IO_stdout, format, args);
- va_end(args);
- return ret;
-}
diff --git a/contrib/libio/ioputc.c b/contrib/libio/ioputc.c
deleted file mode 100644
index 38a3ec9a00b7..000000000000
--- a/contrib/libio/ioputc.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/* 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 "stdio.h"
-
-#undef _IO_putc
-
-int
-_IO_putc (c, fp)
- int c;
- _IO_FILE *fp;
-{
- 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)
-#elif defined(_G_STDIO_USES_LIBIO) && defined(_G_HAVE_WEAK_SYMBOL)
-int putc (int, _IO_FILE *) __attribute__ ((weak, alias("_IO_putc")));
-#endif
diff --git a/contrib/libio/ioputs.c b/contrib/libio/ioputs.c
deleted file mode 100644
index ab5e6aaa4cc9..000000000000
--- a/contrib/libio/ioputs.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/* Copyright (C) 1993, 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 <string.h>
-
-int
-_IO_puts (str)
- const char *str;
-{
- int result;
- _IO_size_t len = strlen (str);
- _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile,
- _IO_stdout);
- _IO_flockfile (_IO_stdout);
- if (_IO_sputn (_IO_stdout, str, len) == len
- && _IO_putc_unlocked ('\n', _IO_stdout) != EOF)
- result = len + 1;
- else
- result = EOF;
- _IO_cleanup_region_end (1);
- return result;
-}
-
-#ifdef weak_alias
-weak_alias (_IO_puts, puts)
-#endif
diff --git a/contrib/libio/ioscanf.c b/contrib/libio/ioscanf.c
deleted file mode 100644
index 405d1e2eb0f7..000000000000
--- a/contrib/libio/ioscanf.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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"
-
-#ifdef __STDC__
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
-
-int
-_IO_scanf
-#ifdef __STDC__
- (const char* format, ...)
-#else
-(format, va_alist) char *format; va_dcl
-#endif
-{
- int ret;
- va_list args;
- _IO_va_start(args, format);
- ret = _IO_vfscanf(_IO_stdin, format, args, NULL);
- va_end(args);
- return ret;
-}
diff --git a/contrib/libio/ioseekoff.c b/contrib/libio/ioseekoff.c
deleted file mode 100644
index b1c4729b3d1d..000000000000
--- a/contrib/libio/ioseekoff.c
+++ /dev/null
@@ -1,54 +0,0 @@
-/* Copyright (C) 1993, 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>
-
-_IO_pos_t
-_IO_seekoff (fp, offset, dir, mode)
- _IO_FILE *fp;
- _IO_off_t offset;
- int dir;
- int mode;
-{
- _IO_pos_t retval;
-
- /* If we have a backup buffer, get rid of it, since the __seekoff
- callback may not know to do the right thing about it.
- 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 (dir == _IO_seek_cur && _IO_in_backup (fp))
- offset -= fp->_IO_read_end - fp->_IO_read_ptr;
- _IO_free_backup_area (fp);
- }
- retval = _IO_SEEKOFF (fp, offset, dir, mode);
-
- _IO_cleanup_region_end (1);
- return retval;
-}
diff --git a/contrib/libio/ioseekpos.c b/contrib/libio/ioseekpos.c
deleted file mode 100644
index 2ce0c2224ec7..000000000000
--- a/contrib/libio/ioseekpos.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/* Copyright (C) 1993, 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>
-
-_IO_pos_t
-_IO_seekpos (fp, pos, mode)
- _IO_FILE *fp;
- _IO_pos_t pos;
- int mode;
-{
- _IO_pos_t retval;
-
- /* If we have a backup buffer, get rid of it, since the __seekoff
- callback may not know to do the right thing about it.
- 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))
- _IO_free_backup_area (fp);
- retval = _IO_SEEKPOS (fp, pos, mode);
-
- _IO_cleanup_region_end (1);
- return retval;
-}
diff --git a/contrib/libio/iosetbuffer.c b/contrib/libio/iosetbuffer.c
deleted file mode 100644
index f140a9ad046e..000000000000
--- a/contrib/libio/iosetbuffer.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/* 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"
-
-void
-_IO_setbuffer (fp, buf, size)
- _IO_FILE *fp;
- char *buf;
- _IO_size_t size;
-{
- CHECK_FILE (fp, );
- _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
- _IO_flockfile (fp);
- fp->_flags &= ~_IO_LINE_BUF;
- if (!buf)
- size = 0;
- (void) _IO_SETBUF (fp, buf, size);
- _IO_cleanup_region_end (1);
-}
-
-#ifdef weak_alias
-weak_alias (_IO_setbuffer, setbuffer)
-#endif
diff --git a/contrib/libio/iosetvbuf.c b/contrib/libio/iosetvbuf.c
deleted file mode 100644
index 65eeea51a6fa..000000000000
--- a/contrib/libio/iosetvbuf.c
+++ /dev/null
@@ -1,100 +0,0 @@
-/* Copyright (C) 1993, 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"
-
-#define _IOFBF 0 /* Fully buffered. */
-#define _IOLBF 1 /* Line buffered. */
-#define _IONBF 2 /* No buffering. */
-
-int
-_IO_setvbuf (fp, buf, mode, size)
- _IO_FILE *fp;
- char *buf;
- int mode;
- _IO_size_t size;
-{
- int result;
- CHECK_FILE (fp, EOF);
- _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
- _IO_flockfile (fp);
- switch (mode)
- {
- case _IOFBF:
- fp->_IO_file_flags &= ~_IO_LINE_BUF|_IO_UNBUFFERED;
- if (buf == NULL)
- {
- if (fp->_IO_buf_base == NULL)
- {
- /* There is no flag to distinguish between "fully buffered
- mode has been explicitly set" as opposed to "line
- buffering has not been explicitly set". In both
- cases, _IO_LINE_BUF is off. If this is a tty, and
- _IO_filedoalloc later gets called, it cannot know if
- it should set the _IO_LINE_BUF flag (because that is
- the default), or not (because we have explicitly asked
- for fully buffered mode). So we make sure a buffer
- gets allocated now, and explicitly turn off line
- buffering.
-
- A possibly cleaner alternative would be to add an
- extra flag, but then flags are a finite resource. */
- if (_IO_DOALLOCATE (fp) < 0)
- {
- result = EOF;
- goto unlock_return;
- }
- fp->_IO_file_flags &= ~_IO_LINE_BUF;
- }
- result = 0;
- goto unlock_return;
- }
- break;
- case _IOLBF:
- fp->_IO_file_flags &= ~_IO_UNBUFFERED;
- fp->_IO_file_flags |= _IO_LINE_BUF;
- if (buf == NULL)
- {
- result = 0;
- goto unlock_return;
- }
- break;
- case _IONBF:
- buf = NULL;
- size = 0;
- break;
- default:
- result = EOF;
- goto unlock_return;
- }
- result = _IO_SETBUF (fp, buf, size) == NULL ? EOF : 0;
-unlock_return:
- _IO_cleanup_region_end (1);
- return result;
-}
-
-#ifdef weak_alias
-weak_alias (_IO_setvbuf, setvbuf)
-#endif
diff --git a/contrib/libio/iosprintf.c b/contrib/libio/iosprintf.c
deleted file mode 100644
index 704a6dbd72d9..000000000000
--- a/contrib/libio/iosprintf.c
+++ /dev/null
@@ -1,50 +0,0 @@
-/* Copyright (C) 1993, 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"
-
-#ifdef __STDC__
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
-
-int
-#ifdef __STDC__
-_IO_sprintf (char *string, const char* format, ...)
-#else
-_IO_sprintf (string, format, va_alist)
- char *string;
- char *format;
- va_dcl
-#endif
-{
- int ret;
- va_list args;
- _IO_va_start (args, format);
- ret = _IO_vsprintf (string, format, args);
- va_end (args);
- return ret;
-}
diff --git a/contrib/libio/iosscanf.c b/contrib/libio/iosscanf.c
deleted file mode 100644
index 58868778c48e..000000000000
--- a/contrib/libio/iosscanf.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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"
-
-#ifdef __STDC__
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
-
-int
-_IO_sscanf
-#ifdef __STDC__
- (const char * string, const char* format, ...)
-#else
-(string, format, va_alist) char *string; char *format; va_dcl
-#endif
-{
- int ret;
- va_list args;
- _IO_va_start(args, format);
- ret = _IO_vsscanf(string, format, args);
- va_end(args);
- return ret;
-}
diff --git a/contrib/libio/iostdio.h b/contrib/libio/iostdio.h
deleted file mode 100644
index 9ed47a4654a4..000000000000
--- a/contrib/libio/iostdio.h
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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. */
-
-/* This file defines a stdio-like environment, except that it avoid
- link-time name clashes with an existing stdio.
- It allows for testing the libio using stdio-using programs
- with an incompatible libc.a.
- It is not predantically correct - e.g. some macros are used
- that may evaluate a stream argument more than once. */
-
-#ifndef _IOSTDIO_H
-#define _IOSTDIO_H
-
-#include "iolibio.h"
-
-typedef _IO_FILE FILE;
-#ifndef EOF
-#define EOF (-1)
-#endif
-#ifndef BUFSIZ
-#define BUFSIZ 1024
-#endif
-
-/* #define size_t, fpos_t L_tmpname TMP_MAX */
-
-#define _IOFBF 0 /* Fully buffered. */
-#define _IOLBF 1 /* Line buffered. */
-#define _IONBF 2 /* No buffering. */
-
-#define SEEK_SET 0
-#define SEEK_CUR 1
-#define SEEK_END 2
-
-#define stdin _IO_stdin
-#define stdout _IO_stdout
-#define stderr _IO_stderr
-
-#define getc(_fp) _IO_getc(_fp)
-#define putc(_ch, _fp) _IO_putc(_ch, _fp)
-
-#define clearerr _IO_clearerr
-#define fclose _IO_fclose
-#define feof _IO_feof
-#define ferror _IO_ferror
-#define fflush _IO_fflush
-#define fgetc(__fp) _IO_getc(_fp)
-#define fgetpos _IO_fgetpos
-#define fgets _IO_fgets
-#define fopen _IO_fopen
-#define fprintf _IO_fprintf
-#define fputc(_ch, _fp) _IO_putc(_ch, _fp)
-#define fputs _IO_fputs
-#define fread _IO_fread
-#define freopen _IO_freopen
-#define fscanf _IO_fscanf
-#define fseek _IO_fseek
-#define fsetpos _IO_fsetpos
-#define ftell _IO_ftell
-#define fwrite _IO_fwrite
-#define gets _IO_gets
-#define perror _IO_perror
-#define printf _IO_printf
-#define puts _IO_puts
-#define rewind _IO_rewind
-#define scanf _IO_scanf
-#define setbuf _IO_setbuf
-#define setbuffer _IO_setbuffer
-#define setvbuf _IO_setvbuf
-#define sprintf _IO_sprintf
-#define sscanf _IO_sscanf
-#define ungetc _IO_ungetc
-#define vfprintf _IO_vfprintf
-#define vprintf(__fmt, __args) vfprintf(stdout, __fmt, __args)
-#define vsprintf _IO_vsprintf
-
-#if 0
-/* We can use the libc versions of these, since they don't pass FILE*s. */
-#define remove ??? __P((const char*))
-#define rename ??? __P((const char* _old, const char* _new))
-#define tmpfile ??? __P((void))
-#define tmpnam ??? __P((char*))
-#endif
-
-#if !defined(__STRICT_ANSI__) || defined(_POSIX_SOURCE)
-#define fdopen _IO_fdopen
-#define fileno _IO_fileno
-#define popen _IO_popen
-#define pclose _IO_pclose
-#define setbuf _IO_setbuf
-#define setlinebuf _IO_setlinebuf
-#endif
-
-#endif /* _IOSTDIO_H */
diff --git a/contrib/libio/iostream.cc b/contrib/libio/iostream.cc
deleted file mode 100644
index 792eaae6b4c4..000000000000
--- a/contrib/libio/iostream.cc
+++ /dev/null
@@ -1,1049 +0,0 @@
-/* This is part of libio/iostream, providing -*- C++ -*- input/output.
- Copyright (C) 1993, 1997, 2000 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. */
-
-/* Written by Per Bothner (bothner@cygnus.com). */
-
-#ifdef __GNUC__
-#pragma implementation
-#endif
-#define _STREAM_COMPAT
-#include <iostream.h>
-#include "libioP.h"
-#include <stdio.h> /* Needed for sprintf */
-#include <ctype.h>
-#include <string.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"
-# ifndef _IO_USE_DTOA
-int __cvt_double(double number, register int prec, int flags, int *signp,
- int fmtch, char *startp, char *endp);
-# endif
-#endif
-
-#define BUF (MAXEXP+MAXFRACT+1) /* + decimal point */
-
-//#define isspace(ch) ((ch)==' ' || (ch)=='\t' || (ch)=='\n')
-
-istream::istream(streambuf *sb, ostream* tied)
-{
- init (sb, tied);
- _gcount = 0;
-}
-
-int skip_ws(streambuf* sb)
-{
- int ch;
- for (;;) {
- ch = sb->sbumpc();
- if (ch == EOF || !isspace(ch))
- return ch;
- }
-}
-
-istream& istream::get(char& c)
-{
- if (ipfx1()) {
- _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile,
- _strbuf);
- int ch = _strbuf->sbumpc();
- if (ch == EOF) {
- set(ios::eofbit|ios::failbit);
- _gcount = 0;
- }
- else {
- c = (char)ch;
- _gcount = 1;
- }
- isfx();
- _IO_cleanup_region_end (0);
- }
- else
- _gcount = 0;
- return *this;
-}
-
-int istream::peek()
-{
- if (!good())
- return EOF;
- if (_tie && rdbuf()->in_avail() == 0)
- _tie->flush();
- int ch = _strbuf->sgetc();
- if (ch == EOF)
- set(ios::eofbit);
- return ch;
-}
-
-istream& istream::ignore(int n /* = 1 */, int delim /* = EOF */)
-{
- _gcount = 0;
- if (ipfx1()) {
- _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile,
- _strbuf);
- register streambuf* sb = _strbuf;
- if (delim == EOF) {
- _gcount = sb->ignore(n);
- goto unlock;
- }
- for (;;) {
-#if 0
- if (n != MAXINT) // FIXME
-#endif
- if (--n < 0)
- break;
- int ch = sb->sbumpc();
- if (ch == EOF) {
- set(ios::eofbit|ios::failbit);
- break;
- }
- _gcount++;
- if (ch == delim)
- break;
- }
- unlock:
- isfx();
- _IO_cleanup_region_end (0);
- }
- return *this;
-}
-
-istream& istream::read(char *s, streamsize n)
-{
- if (ipfx1()) {
- _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile,
- _strbuf);
- _gcount = _strbuf->sgetn(s, n);
- if (_gcount != n)
- set(ios::failbit|ios::eofbit);
- isfx();
- _IO_cleanup_region_end (0);
- }
- else
- _gcount = 0;
- return *this;
-}
-
-int
-istream::sync ()
-{
- streambuf *sb = rdbuf ();
- if (sb == NULL)
- return EOF;
- if (sb->sync ()) // Later: pubsync
- {
- setstate (ios::badbit);
- return EOF;
- }
- else
- return 0;
-}
-
-istream& istream::seekg(streampos pos)
-{
- pos = _strbuf->pubseekpos(pos, ios::in);
- if (pos == streampos(EOF))
- set(ios::badbit);
- return *this;
-}
-
-istream& istream::seekg(streamoff off, _seek_dir dir)
-{
- streampos pos = _IO_seekoff (_strbuf, off, (int) dir, _IOS_INPUT);
- if (pos == streampos(EOF))
- set(ios::badbit);
- return *this;
-}
-
-streampos istream::tellg()
-{
-#if 0
- streampos pos = _strbuf->pubseekoff(0, ios::cur, ios::in);
-#else
- streampos pos = _IO_seekoff (_strbuf, 0, _IO_seek_cur, _IOS_INPUT);
-#endif
- if (pos == streampos(EOF))
- set(ios::badbit);
- return pos;
-}
-
-istream& istream::operator>>(char& c)
-{
- if (ipfx0()) {
- _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile,
- _strbuf);
- int ch = _strbuf->sbumpc();
- if (ch == EOF)
- set(ios::eofbit|ios::failbit);
- else
- c = (char)ch;
- isfx();
- _IO_cleanup_region_end (0);
- }
- return *this;
-}
-
-istream&
-istream::operator>> (char* ptr)
-{
- register char *p = ptr;
- int w = width(0);
- if (ipfx0())
- {
- _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile,
- _strbuf);
- register streambuf* sb = _strbuf;
- for (;;)
- {
- int ch = sb->sbumpc();
- if (ch == EOF)
- {
- set(ios::eofbit);
- break;
- }
- else if (isspace(ch) || w == 1)
- {
- sb->sputbackc(ch);
- break;
- }
- else *p++ = ch;
- w--;
- }
- if (p == ptr)
- set(ios::failbit);
- isfx();
- _IO_cleanup_region_end (0);
- }
- *p = '\0';
- return *this;
-}
-
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-#define LONGEST long long
-#else
-#define LONGEST long
-#endif
-
-static int read_int(istream& stream, unsigned LONGEST& val, int& neg)
-{
- if (!stream.ipfx0())
- return 0;
- int retval;
- _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile,
- stream._strbuf);
- register streambuf* sb = stream.rdbuf();
- int base = 10;
- int ndigits = 0;
- register int ch = skip_ws(sb);
- if (ch == EOF)
- goto eof_fail;
- neg = 0;
- if (ch == '+') {
- ch = skip_ws(sb);
- }
- else if (ch == '-') {
- neg = 1;
- ch = skip_ws(sb);
- }
- if (ch == EOF) goto eof_fail;
- if (!(stream.flags() & ios::basefield)) {
- if (ch == '0') {
- ch = sb->sbumpc();
- if (ch == EOF) {
- val = 0;
- goto unlock;
- }
- if (ch == 'x' || ch == 'X') {
- base = 16;
- ch = sb->sbumpc();
- if (ch == EOF) goto eof_fail;
- }
- else {
- sb->sputbackc(ch);
- base = 8;
- ch = '0';
- }
- }
- }
- else if ((stream.flags() & ios::basefield) == ios::hex)
- base = 16;
- else if ((stream.flags() & ios::basefield) == ios::oct)
- base = 8;
- val = 0;
- for (;;) {
- if (ch == EOF)
- break;
- int digit;
- if (ch >= '0' && ch <= '9')
- digit = ch - '0';
- else if (ch >= 'A' && ch <= 'F')
- digit = ch - 'A' + 10;
- else if (ch >= 'a' && ch <= 'f')
- digit = ch - 'a' + 10;
- else
- digit = 999;
- if (digit >= base) {
- sb->sputbackc(ch);
- if (ndigits == 0)
- goto fail;
- else
- goto unlock;
- }
- ndigits++;
- val = base * val + digit;
- ch = sb->sbumpc();
- }
- unlock:
- retval = 1;
- goto out;
- fail:
- stream.set(ios::failbit);
- retval = 0;
- goto out;
- eof_fail:
- stream.set(ios::failbit|ios::eofbit);
- retval = 0;
- out:
- stream.isfx();
- _IO_cleanup_region_end (0);
- return retval;
-}
-
-#define READ_INT(TYPE) \
-istream& istream::operator>>(TYPE& i)\
-{\
- unsigned LONGEST val; int neg;\
- if (read_int(*this, val, neg)) {\
- if (neg) val = -val;\
- i = (TYPE)val;\
- }\
- return *this;\
-}
-
-READ_INT(short)
-READ_INT(unsigned short)
-READ_INT(int)
-READ_INT(unsigned int)
-READ_INT(long)
-READ_INT(unsigned long)
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-READ_INT(long long)
-READ_INT(unsigned long long)
-#endif
-#if _G_HAVE_BOOL
-READ_INT(bool)
-#endif
-
-istream& istream::operator>>(long double& x)
-{
- if (ipfx0())
- {
- _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile,
- _strbuf);
-#if _G_HAVE_LONG_DOUBLE_IO
- scan("%Lg", &x);
-#else
- double y;
- scan("%lg", &y);
- x = y;
-#endif
- isfx();
- _IO_cleanup_region_end (0);
- }
- return *this;
-}
-
-istream& istream::operator>>(double& x)
-{
- if (ipfx0())
- {
- _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile,
- _strbuf);
- scan("%lg", &x);
- isfx();
- _IO_cleanup_region_end (0);
- }
- return *this;
-}
-
-istream& istream::operator>>(float& x)
-{
- if (ipfx0())
- {
- _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile,
- _strbuf);
- scan("%g", &x);
- isfx();
- _IO_cleanup_region_end (0);
- }
- return *this;
-}
-
-istream& istream::operator>>(register streambuf* sbuf)
-{
- if (ipfx0()) {
- _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile,
- _strbuf);
- register streambuf* inbuf = rdbuf();
- // FIXME: Should optimize!
- for (;;) {
- register int ch = inbuf->sbumpc();
- if (ch == EOF) {
- set(ios::eofbit);
- break;
- }
- if (sbuf->sputc(ch) == EOF) {
- set(ios::failbit);
- break;
- }
- }
- isfx();
- _IO_cleanup_region_end (0);
- }
- return *this;
-}
-
-ostream& ostream::operator<<(char c)
-{
- if (opfx()) {
- _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile,
- _strbuf);
-#if 1
- // This is what the cfront implementation does.
- if (_strbuf->sputc(c) == EOF) {
- set(ios::badbit);
- goto failed;
- }
-#else
- // This is what cfront documentation and current ANSI drafts say.
- int w = width(0);
- char fill_char = fill();
- register int padding = w > 0 ? w - 1 : 0;
- register streambuf *sb = _strbuf;
- if (!(flags() & ios::left) && padding) // Default adjustment.
- if (_IO_padn(sb, fill_char, padding) < padding) {
- set(ios::badbit);
- goto failed;
- }
- if (sb->sputc(c) == EOF) {
- set(ios::badbit);
- goto failed;
- }
- if (flags() & ios::left && padding) // Left adjustment.
- if (_IO_padn(sb, fill_char, padding) < padding)
- set(ios::badbit);
-#endif
- failed:
- osfx();
- _IO_cleanup_region_end (0);
- }
- return *this;
-}
-
-/* Write VAL on STREAM.
- If SIGN<0, val is the absolute value of a negative number.
- If SIGN>0, val is a signed non-negative number.
- If SIGN==0, val is unsigned. */
-
-static void write_int(ostream& stream, unsigned LONGEST val, int sign)
-{
-#define WRITE_BUF_SIZE (10 + sizeof(unsigned LONGEST) * 3)
- char buf[WRITE_BUF_SIZE];
- register char *buf_ptr = buf+WRITE_BUF_SIZE; // End of buf.
- const char *show_base = "";
- int show_base_len = 0;
- int show_pos = 0; // If 1, print a '+'.
-
- // Now do the actual conversion, placing the result at the *end* of buf.
- // Note that we use separate code for decimal, octal, and hex,
- // so we can divide by optimizable constants.
- if ((stream.flags() & ios::basefield) == ios::oct) { // Octal
- do {
- *--buf_ptr = (val & 7) + '0';
- val = val >> 3;
- } while (val != 0);
- if ((stream.flags() & ios::showbase) && (*buf_ptr != '0'))
- *--buf_ptr = '0';
- }
- else if ((stream.flags() & ios::basefield) == ios::hex) { // Hex
- const char *xdigs = (stream.flags() & ios::uppercase) ? "0123456789ABCDEF0X"
- : "0123456789abcdef0x";
- do {
- *--buf_ptr = xdigs[val & 15];
- val = val >> 4;
- } while (val != 0);
- if ((stream.flags() & ios::showbase)) {
- show_base = xdigs + 16; // Either "0X" or "0x".
- show_base_len = 2;
- }
- }
- else { // Decimal
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
- // Optimization: Only use long long when we need to.
- while (val > UINT_MAX) {
- *--buf_ptr = (val % 10) + '0';
- val /= 10;
- }
- // Use more efficient (int) arithmetic for the rest.
- register unsigned int ival = (unsigned int)val;
-#else
- register unsigned LONGEST ival = val;
-#endif
- do {
- *--buf_ptr = (ival % 10) + '0';
- ival /= 10;
- } while (ival != 0);
- if (sign > 0 && (stream.flags() & ios::showpos))
- show_pos=1;
- }
-
- int buf_len = buf+WRITE_BUF_SIZE - buf_ptr;
- int w = stream.width(0);
-
- // Calculate padding.
- int len = buf_len+show_pos;
- if (sign < 0) len++;
- len += show_base_len;
- int padding = len > w ? 0 : w - len;
-
- // Do actual output.
- register streambuf* sbuf = stream.rdbuf();
- ios::fmtflags pad_kind =
- stream.flags() & (ios::left|ios::right|ios::internal);
- char fill_char = stream.fill();
- if (padding > 0
- && pad_kind != (ios::fmtflags)ios::left
- && pad_kind != (ios::fmtflags)ios::internal) // Default (right) adjust.
- if (_IO_padn(sbuf, fill_char, padding) < padding)
- goto failed;
- if (sign < 0 || show_pos)
- {
- char ch = sign < 0 ? '-' : '+';
- if (sbuf->sputc(ch) < 0)
- goto failed;
- }
- if (show_base_len)
- if (_IO_sputn(sbuf, show_base, show_base_len) <= 0)
- goto failed;
- if (pad_kind == (ios::fmtflags)ios::internal && padding > 0)
- if (_IO_padn(sbuf, fill_char, padding) < padding)
- goto failed;
- if (_IO_sputn (sbuf, buf_ptr, buf_len) != buf_len)
- goto failed;
- if (pad_kind == (ios::fmtflags)ios::left && padding > 0) // Left adjustment
- if (_IO_padn(sbuf, fill_char, padding) < padding)
- goto failed;
- stream.osfx();
- return;
- failed:
- stream.set(ios::badbit);
- stream.osfx();
-}
-
-ostream& ostream::operator<<(int n)
-{
- if (opfx()) {
- _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile,
- _strbuf);
- int sign = 1;
- unsigned int abs_n = (unsigned)n;
- if (n < 0 && (flags() & (ios::oct|ios::hex)) == 0)
- abs_n = -((unsigned)n), sign = -1;
- write_int(*this, abs_n, sign);
- _IO_cleanup_region_end (0);
- }
- return *this;
-}
-
-ostream& ostream::operator<<(unsigned int n)
-{
- if (opfx()) {
- _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile,
- _strbuf);
- write_int(*this, n, 0);
- _IO_cleanup_region_end (0);
- }
- return *this;
-}
-
-
-ostream& ostream::operator<<(long n)
-{
- if (opfx()) {
- _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile,
- _strbuf);
- int sign = 1;
- unsigned long abs_n = (unsigned long)n;
- if (n < 0 && (flags() & (ios::oct|ios::hex)) == 0)
- abs_n = -((unsigned long)n), sign = -1;
- write_int(*this, abs_n, sign);
- _IO_cleanup_region_end (0);
- }
- return *this;
-}
-
-ostream& ostream::operator<<(unsigned long n)
-{
- if (opfx()) {
- _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile,
- _strbuf);
- write_int(*this, n, 0);
- _IO_cleanup_region_end (0);
- }
- return *this;
-}
-
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-ostream& ostream::operator<<(long long n)
-{
- if (opfx()) {
- _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile,
- _strbuf);
- int sign = 1;
- unsigned long long abs_n = (unsigned long long)n;
- if (n < 0 && (flags() & (ios::oct|ios::hex)) == 0)
- abs_n = -((unsigned long long)n), sign = -1;
- write_int(*this, abs_n, sign);
- _IO_cleanup_region_end (0);
- }
- return *this;
-}
-
-
-ostream& ostream::operator<<(unsigned long long n)
-{
- if (opfx()) {
- _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile,
- _strbuf);
- write_int(*this, n, 0);
- _IO_cleanup_region_end (0);
- }
- return *this;
-}
-#endif /*__GNUC__*/
-
-ostream& ostream::operator<<(double n)
-{
- if (opfx()) {
- _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile,
- _strbuf);
- // Uses __cvt_double (renamed from static cvt), in Chris Torek's
- // stdio implementation. The setup code uses the same logic
- // as in __vsbprintf.C (also based on Torek's code).
- 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 */
-
- // Do actual conversion.
-#if _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) != 0,
- /* space: */ 0,
- /* left: */ (flags() & ios::left) != 0,
- /* showsign: */ (flags() & ios::showpos) != 0,
- /* group: */ 0,
-#if defined __GLIBC__ && __GLIBC__ >= 2
- /* extra: */ 0,
-#if __GLIBC_MINOR__ >= 1
- /* is_char: */ 0,
-#if __GLIBC_MINOR__ >= 2
- /* wide: */ 0,
- /* i18n: */ 0,
-#endif
-#endif
-#endif
- /* pad: */ fill()
- };
- const void *ptr = (const void *) &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),
- prec, flags(),
- flags() & ios::showpos ? '+' : 0,
- fill()) < 0)
- set(ios::badbit|ios::failbit); // ??
-#else
- int fpprec = 0; // 'Extra' (suppressed) floating precision.
- if (prec > MAXFRACT) {
- if (flags() & (ios::fixed|ios::scientific) & ios::showpos)
- fpprec = prec - MAXFRACT;
- prec = MAXFRACT;
- }
- int negative;
- char buf[BUF];
- int sign = '\0';
- char *cp = buf;
- *cp = 0;
- int size = __cvt_double(n, prec,
- flags() & ios::showpoint ? 0x80 : 0,
- &negative,
- format_char, cp, buf + sizeof(buf));
- if (negative) sign = '-';
- else if (flags() & ios::showpos) sign = '+';
- if (*cp == 0)
- cp++;
-
- // Calculate padding.
- int fieldsize = size + fpprec;
- if (sign) fieldsize++;
- int padding = 0;
- int w = width(0);
- if (fieldsize < w)
- padding = w - fieldsize;
-
- // Do actual output.
- register streambuf* sbuf = rdbuf();
- register i;
- char fill_char = fill();
- ios::fmtflags pad_kind =
- flags() & (ios::left|ios::right|ios::internal);
- if (pad_kind != (ios::fmtflags)ios::left // Default (right) adjust.
- && pad_kind != (ios::fmtflags)ios::internal)
- for (i = padding; --i >= 0; ) sbuf->sputc(fill_char);
- if (sign)
- sbuf->sputc(sign);
- if (pad_kind == (ios::fmtflags)ios::internal)
- for (i = padding; --i >= 0; ) sbuf->sputc(fill_char);
-
- // Emit the actual concented field, followed by extra zeros.
- _IO_sputn (sbuf, cp, size);
- for (i = fpprec; --i >= 0; ) sbuf->sputc('0');
-
- if (pad_kind == (ios::fmtflags)ios::left) // Left adjustment
- for (i = padding; --i >= 0; ) sbuf->sputc(fill_char);
-#endif
- osfx();
- _IO_cleanup_region_end (0);
- }
- 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 */
-
-#if _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) != 0,
- /* space: */ 0,
- /* left: */ (flags() & ios::left) != 0,
- /* showsign: */ (flags() & ios::showpos) != 0,
- /* group: */ 0,
-#if defined __GLIBC__ && __GLIBC__ >= 2
- /* extra: */ 0,
-#if __GLIBC_MINOR__ >= 1
- /* is_char: */ 0,
-#if __GLIBC_MINOR__ >= 2
- /* wide: */ 0,
- /* i18n: */ 0,
-#endif
-#endif
-#endif
- /* pad: */ fill()
- };
-
- const void *ptr = (const void *) &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)
-{
- if (opfx())
- {
- _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile,
- _strbuf);
- if (s == NULL)
- s = "(null)";
- int len = strlen(s);
- int w = width(0);
-// FIXME: Should we: if (w && len>w) len = w;
- char fill_char = fill();
- register streambuf *sbuf = rdbuf();
- register int padding = w > len ? w - len : 0;
- if (!(flags() & ios::left) && padding > 0) // Default adjustment.
- if (_IO_padn(sbuf, fill_char, padding) != padding)
- {
- set(ios::badbit);
- goto failed;
- }
- if (_IO_sputn (sbuf, s, len) != len)
- {
- set(ios::badbit);
- goto failed;
- }
- if (flags() & ios::left && padding > 0) // Left adjustment.
- if (_IO_padn(sbuf, fill_char, padding) != padding)
- set(ios::badbit);
- failed:
- osfx();
- _IO_cleanup_region_end (0);
- }
- return *this;
-}
-
-#if 0
-ostream& ostream::operator<<(const void *p)
-{ Is in osform.cc, to avoid pulling in all of _IO_vfprintf by this file. */ }
-#endif
-
-ostream& ostream::operator<<(register streambuf* sbuf)
-{
- if (opfx())
- {
- _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile,
- _strbuf);
- char buffer[_IO_BUFSIZ];
- register streambuf* outbuf = _strbuf;
- for (;;)
- {
- _IO_size_t count = _IO_sgetn(sbuf, buffer, _IO_BUFSIZ);
- if (count <= 0)
- break;
- if (_IO_sputn(outbuf, buffer, count) != count)
- {
- set(ios::badbit);
- break;
- }
- }
- osfx();
- _IO_cleanup_region_end (0);
- }
- return *this;
-}
-
-ostream::ostream(streambuf* sb, ostream* tied)
-{
- init (sb, tied);
-}
-
-ostream& ostream::seekp(streampos pos)
-{
- pos = _strbuf->pubseekpos(pos, ios::out);
- if (pos == streampos(EOF))
- set(ios::badbit);
- return *this;
-}
-
-ostream& ostream::seekp(streamoff off, _seek_dir dir)
-{
- streampos pos = _IO_seekoff (_strbuf, off, (int) dir, _IOS_OUTPUT);
- if (pos == streampos(EOF))
- set(ios::badbit);
- return *this;
-}
-
-streampos ostream::tellp()
-{
-#if 1
- streampos pos = _IO_seekoff (_strbuf, 0, _IO_seek_cur, _IOS_OUTPUT);
-#else
- streampos pos = _strbuf->pubseekoff(0, ios::cur, ios::out);
-#endif
- if (pos == streampos(EOF))
- set(ios::badbit);
- return pos;
-}
-
-ostream& ostream::flush()
-{
- if (_strbuf->sync())
- set(ios::badbit);
- return *this;
-}
-
-ostream& flush(ostream& outs)
-{
- return outs.flush();
-}
-
-istream& ws(istream& ins)
-{
- if (ins.ipfx1()) {
- _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile,
- ins._strbuf);
- int ch = skip_ws(ins._strbuf);
- if (ch == EOF)
- ins.set(ios::eofbit);
- else
- ins._strbuf->sputbackc(ch);
- ins.isfx();
- _IO_cleanup_region_end (0);
- }
- return ins;
-}
-
-// Skip white-space. Return 0 on failure (EOF), or 1 on success.
-// Differs from ws() manipulator in that failbit is set on EOF.
-// Called by ipfx() and ipfx0() if needed.
-
-int istream::_skip_ws()
-{
- int ch = skip_ws(_strbuf);
- if (ch == EOF) {
- set(ios::eofbit|ios::failbit);
- return 0;
- }
- else {
- _strbuf->sputbackc(ch);
- return 1;
- }
-}
-
-ostream& ends(ostream& outs)
-{
- outs.put('\0');
- return outs;
-}
-
-ostream& endl(ostream& outs)
-{
- 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)
-{
- if (opfx()) {
- _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile,
- _strbuf);
- if (_IO_sputn(_strbuf, s, n) != n)
- set(ios::failbit);
- osfx();
- _IO_cleanup_region_end (0);
- }
- return *this;
-}
-
-void ostream::do_osfx()
-{
- if (flags() & ios::unitbuf)
- flush();
- if (flags() & ios::stdio) {
- fflush(stdout);
- fflush(stderr);
- }
-}
-
-iostream::iostream(streambuf* sb, ostream* tied)
-{
- init (sb, tied);
-}
-
-// NOTE: extension for compatibility with old libg++.
-// Not really compatible with fistream::close().
-#ifdef _STREAM_COMPAT
-void ios::close()
-{
- if (_strbuf->_flags & _IO_IS_FILEBUF)
- ((struct filebuf*)rdbuf())->close();
- else if (_strbuf != NULL)
- rdbuf()->sync();
- _strbuf = NULL;
- _state = badbit;
-}
-
-int istream::skip(int i)
-{
- int old = (_flags & ios::skipws) != 0;
- if (i)
- _flags |= ios::skipws;
- else
- _flags &= ~ios::skipws;
- return old;
-}
-#endif
diff --git a/contrib/libio/iostream.h b/contrib/libio/iostream.h
deleted file mode 100644
index 19fbf8a4d95c..000000000000
--- a/contrib/libio/iostream.h
+++ /dev/null
@@ -1,273 +0,0 @@
-/* This is part of libio/iostream, providing -*- C++ -*- input/output.
-Copyright (C) 1993 Free Software Foundation
-
-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. */
-
-#ifndef _IOSTREAM_H
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _IOSTREAM_H
-
-#include <streambuf.h>
-
-extern "C++" {
-class istream; class ostream;
-typedef ios& (*__manip)(ios&);
-typedef istream& (*__imanip)(istream&);
-typedef ostream& (*__omanip)(ostream&);
-
-extern istream& ws(istream& ins);
-extern ostream& flush(ostream& outs);
-extern ostream& endl(ostream& outs);
-extern ostream& ends(ostream& outs);
-
-class ostream : virtual public ios
-{
- // NOTE: If fields are changed, you must fix _fake_ostream in stdstreams.C!
- void do_osfx();
- public:
- ostream() { }
- ostream(streambuf* sb, ostream* tied=NULL);
- int opfx() {
- if (!good()) return 0;
- else { if (_tie) _tie->flush(); _IO_flockfile(_strbuf); return 1;} }
- void osfx() { _IO_funlockfile(_strbuf);
- if (flags() & (ios::unitbuf|ios::stdio))
- do_osfx(); }
- ostream& flush();
- ostream& put(char c) { _strbuf->sputc(c); return *this; }
-#ifdef _STREAM_COMPAT
- /* Temporary binary compatibility. REMOVE IN NEXT RELEASE. */
- ostream& put(unsigned char c) { return put((char)c); }
- ostream& put(signed char c) { return put((char)c); }
-#endif
- ostream& write(const char *s, streamsize n);
- ostream& write(const unsigned char *s, streamsize n)
- { return write((const char*)s, n);}
- ostream& write(const signed char *s, streamsize n)
- { return write((const char*)s, n);}
- ostream& write(const void *s, streamsize n)
- { return write((const char*)s, n);}
- ostream& seekp(streampos);
- ostream& seekp(streamoff, _seek_dir);
- streampos tellp();
- ostream& form(const char *format ...);
- ostream& vform(const char *format, _IO_va_list args);
-
- ostream& operator<<(char c);
- ostream& operator<<(unsigned char c) { return (*this) << (char)c; }
- ostream& operator<<(signed char c) { return (*this) << (char)c; }
- ostream& operator<<(const char *s);
- ostream& operator<<(const unsigned char *s)
- { return (*this) << (const char*)s; }
- ostream& operator<<(const signed char *s)
- { return (*this) << (const char*)s; }
- ostream& operator<<(const void *p);
- ostream& operator<<(int n);
- ostream& operator<<(unsigned int n);
- ostream& operator<<(long n);
- ostream& operator<<(unsigned long n);
-#if defined(__GNUC__)
- __extension__ ostream& operator<<(long long n);
- __extension__ ostream& operator<<(unsigned long long n);
-#endif
- ostream& operator<<(short n) {return operator<<((int)n);}
- ostream& operator<<(unsigned short n) {return operator<<((unsigned int)n);}
-#if _G_HAVE_BOOL
- ostream& operator<<(bool b) { return operator<<((int)b); }
-#endif
- ostream& operator<<(double n);
- ostream& operator<<(float n) { return operator<<((double)n); }
-#if _G_HAVE_LONG_DOUBLE_IO
- ostream& operator<<(long double n);
-#else
- ostream& operator<<(long double n) { return operator<<((double)n); }
-#endif
- ostream& operator<<(__omanip func) { return (*func)(*this); }
- ostream& operator<<(__manip func) {(*func)(*this); return *this;}
- ostream& operator<<(streambuf*);
-#ifdef _STREAM_COMPAT
- streambuf* ostreambuf() const { return _strbuf; }
-#endif
-};
-
-class istream : virtual public ios
-{
- // NOTE: If fields are changed, you must fix _fake_istream in stdstreams.C!
-protected:
- _IO_size_t _gcount;
-
- int _skip_ws();
- public:
- istream(): _gcount (0) { }
- istream(streambuf* sb, ostream*tied=NULL);
- istream& get(char* ptr, int len, char delim = '\n');
- istream& get(unsigned char* ptr, int len, char delim = '\n')
- { return get((char*)ptr, len, delim); }
- istream& get(char& c);
- istream& get(unsigned char& c) { return get((char&)c); }
- istream& getline(char* ptr, int len, char delim = '\n');
- istream& getline(unsigned char* ptr, int len, char delim = '\n')
- { return getline((char*)ptr, len, delim); }
- istream& get(signed char& c) { return get((char&)c); }
- istream& get(signed char* ptr, int len, char delim = '\n')
- { return get((char*)ptr, len, delim); }
- istream& getline(signed char* ptr, int len, char delim = '\n')
- { return getline((char*)ptr, len, delim); }
- istream& read(char *ptr, streamsize n);
- istream& read(unsigned char *ptr, streamsize n)
- { return read((char*)ptr, n); }
- istream& read(signed char *ptr, streamsize n)
- { return read((char*)ptr, n); }
- istream& read(void *ptr, streamsize n)
- { return read((char*)ptr, n); }
- istream& get(streambuf& sb, char delim = '\n');
- istream& gets(char **s, char delim = '\n');
- int ipfx(int need = 0) {
- if (!good()) { set(ios::failbit); return 0; }
- else {
- _IO_flockfile(_strbuf);
- if (_tie && (need == 0 || rdbuf()->in_avail() < need)) _tie->flush();
- if (!need && (flags() & ios::skipws)) return _skip_ws();
- else return 1;
- }
- }
- int ipfx0() { // Optimized version of ipfx(0).
- if (!good()) { set(ios::failbit); return 0; }
- else {
- _IO_flockfile(_strbuf);
- if (_tie) _tie->flush();
- if (flags() & ios::skipws) return _skip_ws();
- else return 1;
- }
- }
- int ipfx1() { // Optimized version of ipfx(1).
- if (!good()) { set(ios::failbit); return 0; }
- else {
- _IO_flockfile(_strbuf);
- if (_tie && rdbuf()->in_avail() == 0) _tie->flush();
- return 1;
- }
- }
- void isfx() { _IO_funlockfile(_strbuf); }
- int get() { if (!ipfx1()) return EOF;
- else { int ch = _strbuf->sbumpc();
- if (ch == EOF) set(ios::eofbit);
- isfx();
- return ch;
- } }
- int peek();
- _IO_size_t gcount() { return _gcount; }
- istream& ignore(int n=1, int delim = EOF);
- int sync ();
- istream& seekg(streampos);
- istream& seekg(streamoff, _seek_dir);
- streampos tellg();
- istream& putback(char ch) {
- if (good() && _strbuf->sputbackc(ch) == EOF) clear(ios::badbit);
- return *this;}
- istream& unget() {
- if (good() && _strbuf->sungetc() == EOF) clear(ios::badbit);
- return *this;}
- istream& scan(const char *format ...);
- istream& vscan(const char *format, _IO_va_list args);
-#ifdef _STREAM_COMPAT
- istream& unget(char ch) { return putback(ch); }
- int skip(int i);
- streambuf* istreambuf() const { return _strbuf; }
-#endif
-
- istream& operator>>(char*);
- istream& operator>>(unsigned char* p) { return operator>>((char*)p); }
- istream& operator>>(signed char*p) { return operator>>((char*)p); }
- istream& operator>>(char& c);
- istream& operator>>(unsigned char& c) {return operator>>((char&)c);}
- istream& operator>>(signed char& c) {return operator>>((char&)c);}
- istream& operator>>(int&);
- istream& operator>>(long&);
-#if defined(__GNUC__)
- __extension__ istream& operator>>(long long&);
- __extension__ istream& operator>>(unsigned long long&);
-#endif
- istream& operator>>(short&);
- istream& operator>>(unsigned int&);
- istream& operator>>(unsigned long&);
- istream& operator>>(unsigned short&);
-#if _G_HAVE_BOOL
- istream& operator>>(bool&);
-#endif
- istream& operator>>(float&);
- istream& operator>>(double&);
- istream& operator>>(long double&);
- istream& operator>>( __manip func) {(*func)(*this); return *this;}
- istream& operator>>(__imanip func) { return (*func)(*this); }
- istream& operator>>(streambuf*);
-};
-
-class iostream : public istream, public ostream
-{
- public:
- iostream() { }
- iostream(streambuf* sb, ostream*tied=NULL);
-};
-
-class _IO_istream_withassign : public istream {
-public:
- _IO_istream_withassign& operator=(istream&);
- _IO_istream_withassign& operator=(_IO_istream_withassign& rhs)
- { return operator= (static_cast<istream&> (rhs)); }
-};
-
-class _IO_ostream_withassign : public ostream {
-public:
- _IO_ostream_withassign& operator=(ostream&);
- _IO_ostream_withassign& operator=(_IO_ostream_withassign& rhs)
- { return operator= (static_cast<ostream&> (rhs)); }
-};
-
-extern _IO_istream_withassign cin;
-// clog->rdbuf() == cerr->rdbuf()
-extern _IO_ostream_withassign cout, cerr;
-
-extern _IO_ostream_withassign clog
-#if _G_CLOG_CONFLICT
-__asm__ ("__IO_clog")
-#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.
-
-inline ios& dec(ios& i)
-{ i.setf(ios::dec, ios::dec|ios::hex|ios::oct); return i; }
-inline ios& hex(ios& i)
-{ i.setf(ios::hex, ios::dec|ios::hex|ios::oct); return i; }
-inline ios& oct(ios& i)
-{ i.setf(ios::oct, ios::dec|ios::hex|ios::oct); return i; }
-} // extern "C++"
-
-#endif /*!_IOSTREAM_H*/
diff --git a/contrib/libio/iostream.texi b/contrib/libio/iostream.texi
deleted file mode 100644
index 641cd7da22f0..000000000000
--- a/contrib/libio/iostream.texi
+++ /dev/null
@@ -1,1971 +0,0 @@
-\input texinfo @c -*-Texinfo-*-
-@c Copyright (c) 1993 Free Software Foundation, Inc.
-
-@c %**start of header
-@setfilename iostream.info
-@settitle The GNU C++ Iostream Library
-@setchapternewpage odd
-@c %**end of header
-
-@ifinfo
-@format
-START-INFO-DIR-ENTRY
-* iostream: (iostream). The C++ input/output facility.
-END-INFO-DIR-ENTRY
-@end format
-
-This file describes libio, the GNU library for C++ iostreams and C stdio.
-
-libio includes software developed by the University of California,
-Berkeley.
-
-Copyright (C) 1993 Free Software Foundation, Inc.
-
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-
-@ignore
-Permission is granted to process this file through TeX and print the
-results, provided the printed document carries copying permission
-notice identical to this one except for the removal of this paragraph
-(this paragraph not being relevant to the printed manual).
-
-@end ignore
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided also that the
-entire resulting derived work is distributed under the terms of a
-permission notice identical to this one.
-
-Permission is granted to copy and distribute translations of this manual
-into another language, under the above conditions for modified versions.
-@end ifinfo
-
-@finalout
-@syncodeindex fn cp
-@syncodeindex vr cp
-
-@titlepage
-@title The GNU C++ Iostream Library
-@subtitle Reference Manual for @code{libio} Version 0.64
-@sp 3
-@author Per Bothner @hfill @code{bothner@@cygnus.com}
-@author Cygnus Support @hfill @code{doc@@cygnus.com}
-@page
-
-@vskip 0pt plus 1filll
-Copyright @copyright{} 1993 Free Software Foundation, Inc.
-
-@code{libio} includes software developed by the University of
-California, Berkeley.
-
-@code{libio} uses floating-point software written by David M. Gay, which
-includes the following notice:
-
-@quotation
-The author of this software is David M. Gay.
-
-Copyright (c) 1991 by AT&T.
-
-Permission to use, copy, modify, and distribute this software for any
-purpose without fee is hereby granted, provided that this entire notice
-is included in all copies of any software which is or includes a copy
-or modification of this software and in all copies of the supporting
-documentation for such software.
-
-THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED
-WARRANTY. IN PARTICULAR, NEITHER THE AUTHOR NOR AT&T MAKES ANY
-REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
-OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
-@end quotation
-
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided also that the
-entire resulting derived work is distributed under the terms of a
-permission notice identical to this one.
-
-Permission is granted to copy and distribute translations of this manual
-into another language, under the above conditions for modified versions.
-@end titlepage
-
-@ifinfo
-@node Top
-@top The GNU C++ Iostream Library
-
-This file provides reference information on the GNU C++ iostream library
-(@code{libio}), version 0.64.
-
-@menu
-* Introduction::
-* Operators:: Operators and default streams.
-* Streams:: Stream classes.
-* Files and Strings:: Classes for files and strings.
-* Streambuf:: Using the streambuf layer.
-* Stdio:: C input and output.
-* Index::
-@end menu
-@end ifinfo
-
-@node Introduction
-@chapter Introduction
-
-The iostream classes implement most of the features of AT&T version 2.0
-iostream library classes, and most of the features of the ANSI X3J16
-library draft (which is based on the AT&T design).
-
-This manual is meant as a reference; for tutorial material on iostreams,
-see the corresponding section of any recent popular introduction to C++.
-
-@menu
-* Copying:: Special GNU licensing terms for libio.
-* Acknowledgements:: Contributors to GNU iostream.
-@end menu
-
-@node Copying
-@section Licensing terms for @code{libio}
-
-Since the @code{iostream} classes are so fundamental to standard C++,
-the Free Software Foundation has agreed to a special exception to its
-standard license, when you link programs with @code{libio.a}:
-
-@quotation
-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.
-@end quotation
-
-The code is under the @sc{gnu} General Public License (version 2) for
-all other purposes than linking with this library; that means that you
-can modify and redistribute the code as usual, but remember that if you
-do, your modifications, and anything you link with the modified code,
-must be available to others on the same terms.
-
-These functions are also available as part of the @code{libg++}
-library; if you link with that library instead of @code{libio}, the
-@sc{gnu} Library General Public License applies.
-
-@node Acknowledgements
-@section Acknowledgements
-
-Per Bothner wrote most of the @code{iostream} library, but some portions
-have their origins elsewhere in the free software community. Heinz
-Seidl wrote the IO manipulators. The floating-point conversion software
-is by David M. Gay of AT&T. Some code was derived from parts of BSD
-4.4, which was written at the University of California, Berkeley.
-
-The iostream classes are found in the @code{libio} library. An early
-version was originally distributed in @code{libg++}, and they are still
-included there as well, for convenience if you need other @code{libg++}
-classes. Doug Lea was the original author of @code{libg++}, and some of
-the file-management code still in @code{libio} is his.
-
-Various people found bugs or offered suggestions. Hongjiu Lu worked
-hard to use the library as the default stdio implementation for Linux,
-and has provided much stress-testing of the library.
-
-@node Operators
-@chapter Operators and Default Streams
-
-The @sc{gnu} iostream library, @file{libio}, implements the standard
-input and output facilities for C++. These facilities are roughly
-analogous (in their purpose and ubiquity, at least) with those defined
-by the C @file{stdio} functions.
-
-Although these definitions come from a library, rather than being part
-of the ``core language'', they are sufficiently central to be specified
-in the latest working papers for C++.
-
-You can use two operators defined in this library for basic input and
-output operations. They are familiar from any C++ introductory
-textbook: @code{<<} for output, and @code{>>} for input. (Think of data
-flowing in the direction of the ``arrows''.)
-
-These operators are often used in conjunction with three streams that
-are open by default:
-
-@deftypevar ostream cout
-The standard output stream, analogous to the C @code{stdout}.
-@end deftypevar
-
-@deftypevar istream cin
-The standard input stream, analogous to the C @code{stdin}.
-@end deftypevar
-
-@deftypevar ostream cerr
-An alternative output stream for errors, analogous to the C
-@code{stderr}.
-@end deftypevar
-
-@noindent
-For example, this bare-bones C++ version of the traditional ``hello''
-program uses @code{<<} and @code{cout}:
-
-@example
-#include <iostream.h>
-
-int main(int argc, char **argv)
-@{
- cout << "Well, hi there.\n";
- return 0;
-@}
-@end example
-
-Casual use of these operators may be seductive, but---other than in
-writing throwaway code for your own use---it is not necessarily simpler
-than managing input and output in any other language. For example,
-robust code should check the state of the input and output streams
-between operations (for example, using the method @code{good}).
-@xref{States,,Checking the state of a stream}. You may also need to
-adjust maximum input or output field widths, using manipulators like
-@code{setw} or @code{setprecision}.
-
-@defop Operator ostream <<
-Write output to an open output stream of class @code{ostream}.
-Defined by this library on any @var{object} of a C++ primitive type, and
-on other classes of the library. You can overload the definition for any
-of your own applications' classes.
-
-Returns a reference to the implied argument @code{*this} (the open stream it
-writes on), permitting statements like
-@example
-cout << "The value of i is " << i << "\n";
-@end example
-@end defop
-
-@defop Operator istream >>
-Read input from an open input stream of class @code{istream}. Defined
-by this library on primitive numeric, pointer, and string types; you can
-extend the definition for any of your own applications' classes.
-
-Returns a reference to the implied argument @code{*this} (the open stream
-it reads), permitting multiple inputs in one statement.
-@end defop
-
-@node Streams
-@chapter Stream Classes
-
-The previous chapter referred in passing to the classes @code{ostream}
-and @code{istream}, for output and input respectively. These classes
-share certain properties, captured in their base class @code{ios}.
-
-@menu
-* Ios:: Shared properties.
-* Ostream:: Managing output streams.
-* Istream:: Managing input streams.
-* Iostream:: Input and output together.
-@end menu
-
-@node Ios
-@section Shared properties: class @code{ios}
-
-The base class @code{ios} provides methods to test and manage the state
-of input or output streams.
-
-@code{ios} delegates the job of actually reading and writing bytes to
-the abstract class @code{streambuf}, which is designed to provide
-buffered streams (compatible with C, in the @sc{gnu} implementation).
-@xref{Streambuf,,Using the @code{streambuf} layer}, for information on
-the facilities available at the @code{streambuf} level.
-
-@deftypefn Constructor {} ios::ios ([streambuf* @var{sb} @w{[, ostream*} @var{tie}])
-The @code{ios} constructor by default initializes a new @code{ios}, and
-if you supply a @code{streambuf} @var{sb} to associate with it, sets the
-state @code{good} in the new @code{ios} object. It also sets the
-default properties of the new object.
-
-@ignore
-@c FIXME--future: this (a) doesn't work, (b) is controversial at ANSI
-An @code{ios} without a @code{streambuf} has the state @code{bad} until
-you supply a @code{streambuf}; you can do that by assigning a new value
-to the @code{ios} with @samp{=}.
-@end ignore
-
-You can also supply an optional second argument @var{tie} to the
-constructor: if present, it is an initial value for @code{ios::tie}, to
-associate the new @code{ios} object with another stream.
-@end deftypefn
-
-@deftypefn Destructor {} ios::~ios ()
-The @code{ios} destructor is virtual, permitting application-specific
-behavior when a stream is closed---typically, the destructor frees any
-storage associated with the stream and releases any other associated
-objects.
-@end deftypefn
-
-@c FIXME-future: Is @deftypefn really the best way of displaying these?
-
-@c FIXME-future: Undocumented: ios::_throw_failure, ios::exceptions; things
-@c controlled by _STREAM_COMPAT; ios::Init; ios::_IO_fix_vtable.
-
-@menu
-* States:: Checking the state of a stream.
-* Format Control:: Choices in formatting.
-* Manipulators:: Convenient ways of changing stream properties.
-* Extending:: Extended data fields.
-* Synchronization:: Synchronizing related streams.
-* Streambuf from Ios:: Reaching the underlying streambuf.
-@end menu
-
-@node States
-@subsection Checking the state of a stream
-
-Use this collection of methods to test for (or signal) errors and other
-exceptional conditions of streams:
-
-@deftypefn Method {ios::operator void*} () const
-You can do a quick check on the state of the most recent operation on a
-stream by examining a pointer to the stream itself. The pointer is
-arbitrary except for its truth value; it is true if no failures have
-occurred (@code{ios::fail} is not true). For example, you might ask for
-input on @code{cin} only if all prior output operations succeeded:
-
-@example
-if (cout)
-@{
- // Everything OK so far
- cin >> new_value;
- @dots{}
-@}
-@end example
-@end deftypefn
-
-@deftypefn Method {ios::operator !} () const
-In case it is more convenient to check whether something has failed, the
-operator @code{!} returns true if @code{ios::fail} is true (an operation
-has failed). For example,
-you might issue an error message if input failed:
-
-@example
-if (!cin)
-@{
- // Oops
- cerr << "Eh?\n";
-@}
-@end example
-@end deftypefn
-
-@deftypefn Method iostate ios::rdstate () const
-Return the state flags for this stream. The value is from the
-enumeration @code{iostate}. You can test for any combination of
-
-@vtable @code
-@item goodbit
-There are no indications of exceptional states on this stream.
-
-@item eofbit
-End of file.
-
-@item failbit
-An operation has failed on this stream; this usually indicates bad
-format of input.
-
-@item badbit
-The stream is unusable.
-@end vtable
-@end deftypefn
-
-@deftypefn Method void ios::setstate (iostate @var{state})
-@findex ios::set
-Set the state flag for this stream to @var{state} @emph{in addition to}
-any state flags already set. Synonym (for upward compatibility):
-@code{ios::set}.
-
-See @code{ios::clear} to set the stream state without regard to existing
-state flags. See @code{ios::good}, @code{ios::eof}, @code{ios::fail},
-and @code{ios::bad}, to test the state.
-@end deftypefn
-
-@deftypefn Method int ios::good () const
-Test the state flags associated with this stream; true if no error
-indicators are set.
-@end deftypefn
-
-@deftypefn Method int ios::bad () const
-Test whether a stream is marked as unusable. (Whether
-@code{ios::badbit} is set.)
-@end deftypefn
-
-@deftypefn Method int ios::eof () const
-True if end of file was reached on this stream. (If @code{ios::eofbit}
-is set.)
-@end deftypefn
-
-@deftypefn Method int ios::fail () const
-Test for any kind of failure on this stream: @emph{either} some
-operation failed, @emph{or} the stream is marked as bad. (If either
-@code{ios::failbit} or @code{ios::badbit} is set.)
-@end deftypefn
-
-@deftypefn Method void ios::clear (iostate @var{state})
-@c FIXME-future: There is some complication to do with buffering and _throw_failure
-Set the state indication for this stream to the argument @var{state}.
-You may call @code{ios::clear} with no argument, in which case the state
-is set to @code{good} (no errors pending).
-
-See @code{ios::good}, @code{ios::eof}, @code{ios::fail}, and
-@code{ios::bad}, to test the state; see @code{ios::set} or
-@code{ios::setstate} for an alternative way of setting the state.
-@end deftypefn
-
-@node Format Control
-@subsection Choices in formatting
-
-These methods control (or report on) settings for some details of
-controlling streams, primarily to do with formatting output:
-
-@deftypefn Method char ios::fill () const
-Report on the padding character in use.
-@end deftypefn
-
-@deftypefn Method char ios::fill (char @var{padding})
-Set the padding character. You can also use the manipulator
-@code{setfill}. @xref{Manipulators,,Changing stream properties in
-expressions}.
-
-Default: blank.
-@end deftypefn
-
-@deftypefn Method int ios::precision () const
-Report the number of significant digits currently in use for output of
-floating point numbers.
-
-Default: @code{6}.
-@end deftypefn
-
-@deftypefn Method int ios::precision (int @var{signif})
-Set the number of significant digits (for input and output numeric
-conversions) to @var{signif}.
-
-@findex setprecision
-@cindex setting @code{ios::precision}
-You can also use the manipulator @code{setprecision} for this purpose.
-@xref{Manipulators,,Changing stream properties using manipulators}.
-@end deftypefn
-
-@deftypefn Method int ios::width () const
-Report the current output field width setting (the number of
-characters to write on the next @samp{<<} output operation).
-
-Default: @code{0}, which means to use as many characters as necessary.
-@end deftypefn
-
-@deftypefn Method int ios::width (int @var{num})
-Set the input field width setting to @var{num}. Return the
-@emph{previous} value for this stream.
-
-@findex setw
-@cindex setting @code{ios::width}
-This value resets to zero (the default) every time you use @samp{<<}; it is
-essentially an additional implicit argument to that operator. You can
-also use the manipulator @code{setw} for this purpose.
-@xref{Manipulators,,Changing stream properties using manipulators}.
-@end deftypefn
-
-@need 2000
-@deftypefn Method fmtflags ios::flags () const
-Return the current value of the complete collection of flags controlling
-the format state. These are the flags and their meanings when set:
-
-@vtable @code
-@item ios::dec
-@itemx ios::oct
-@itemx ios::hex
-What numeric base to use in converting integers from internal to display
-representation, or vice versa: decimal, octal, or hexadecimal,
-respectively. (You can change the base using the manipulator
-@code{setbase}, or any of the manipulators @code{dec}, @code{oct}, or
-@code{hex}; @pxref{Manipulators,,Changing stream properties in
-expressions}.)
-
-On input, if none of these flags is set, read numeric constants
-according to the prefix: decimal if no prefix (or a @samp{.} suffix),
-octal if a @samp{0} prefix is present, hexadecimal if a @samp{0x} prefix
-is present.
-
-Default: @code{dec}.
-
-@item ios::fixed
-Avoid scientific notation, and always show a fixed number of digits after
-the decimal point, according to the output precision in effect.
-Use @code{ios::precision} to set precision.
-
-@item ios::left
-@itemx ios::right
-@itemx ios::internal
-Where output is to appear in a fixed-width field; left-justified,
-right-justified, or with padding in the middle (e.g. between a numeric
-sign and the associated value), respectively.
-
-@item ios::scientific
-Use scientific (exponential) notation to display numbers.
-
-@item ios::showbase
-Display the conventional prefix as a visual indicator of the conversion
-base: no prefix for decimal, @samp{0} for octal, @samp{0x} for hexadecimal.
-
-@item ios::showpoint
-Display a decimal point and trailing zeros after it to fill out numeric
-fields, even when redundant.
-
-@item ios::showpos
-Display a positive sign on display of positive numbers.
-
-@item ios::skipws
-Skip white space. (On by default).
-
-@item ios::stdio
-Flush the C @code{stdio} streams @code{stdout} and @code{stderr} after
-each output operation (for programs that mix C and C++ output conventions).
-
-@item ios::unitbuf
-Flush after each output operation.
-
-@item ios::uppercase
-Use upper-case characters for the non-numeral elements in numeric
-displays; for instance, @samp{0X7A} rather than @samp{0x7a}, or
-@samp{3.14E+09} rather than @samp{3.14e+09}.
-@end vtable
-@end deftypefn
-
-@deftypefn Method fmtflags ios::flags (fmtflags @var{value})
-Set @var{value} as the complete collection of flags controlling the
-format state. The flag values are described under @samp{ios::flags ()}.
-
-Use @code{ios::setf} or @code{ios::unsetf} to change one property at a
-time.
-@end deftypefn
-
-@deftypefn Method fmtflags ios::setf (fmtflags @var{flag})
-Set one particular flag (of those described for @samp{ios::flags ()};
-return the complete collection of flags @emph{previously} in effect.
-(Use @code{ios::unsetf} to cancel.)
-@end deftypefn
-
-@deftypefn Method fmtflags ios::setf (fmtflags @var{flag}, fmtflags @var{mask})
-Clear the flag values indicated by @var{mask}, then set any of them that
-are also in @var{flag}. (Flag values are described for @samp{ios::flags
-()}.) Return the complete collection of flags @emph{previously} in
-effect. (See @code{ios::unsetf} for another way of clearing flags.)
-@end deftypefn
-
-@deftypefn Method fmtflags ios::unsetf (fmtflags @var{flag})
-Make certain @var{flag} (a combination of flag values described for
-@samp{ios::flags ()}) is not set for this stream; converse of
-@code{ios::setf}. Returns the old values of those flags.
-@c FIXME-future: should probably be fixed to give same result as setf.
-@end deftypefn
-
-@node Manipulators
-@subsection Changing stream properties using manipulators
-
-For convenience, @var{manipulators} provide a way to change certain
-properties of streams, or otherwise affect them, in the middle of
-expressions involving @samp{<<} or @samp{>>}. For example, you might
-write
-
-@example
-cout << "|" << setfill('*') << setw(5) << 234 << "|";
-@end example
-
-@noindent
-to produce @samp{|**234|} as output.
-
-@deftypefn Manipulator {} ws
-Skip whitespace.
-@end deftypefn
-
-@deftypefn Manipulator {} flush
-Flush an output stream. For example, @samp{cout << @dots{} <<flush;}
-has the same effect as @samp{cout << @dots{}; cout.flush();}.
-@end deftypefn
-
-@deftypefn Manipulator {} endl
-Write an end of line character @samp{\n}, then flushes the output stream.
-@end deftypefn
-
-@deftypefn Manipulator {} ends
-Write @samp{\0} (the string terminator character).
-@end deftypefn
-
-@deftypefn Manipulator {} setprecision (int @var{signif})
-You can change the value of @code{ios::precision} in @samp{<<}
-expressions with the manipulator @samp{setprecision(@var{signif})}; for
-example,
-
-@example
-cout << setprecision(2) << 4.567;
-@end example
-
-@noindent
-prints @samp{4.6}. Requires @file{#include <iomanip.h>}.
-@end deftypefn
-
-@deftypefn Manipulator {} setw (int @var{n})
-You can change the value of @code{ios::width} in @samp{<<} expressions
-with the manipulator @samp{setw(@var{n})}; for example,
-
-@example
-cout << setw(5) << 234;
-@end example
-
-@noindent
-prints @w{@samp{ 234}} with two leading blanks. Requires @file{#include
-<iomanip.h>}.
-@end deftypefn
-
-@deftypefn Manipulator {} setbase (int @var{base})
-Where @var{base} is one of @code{10} (decimal), @code{8} (octal), or
-@code{16} (hexadecimal), change the base value for numeric
-representations. Requires @file{#include <iomanip.h>}.
-@end deftypefn
-
-@deftypefn Manipulator {} dec
-Select decimal base; equivalent to @samp{setbase(10)}.
-@end deftypefn
-
-@deftypefn Manipulator {} hex
-Select hexadecimal base; equivalent to @samp{setbase(16)}.
-@end deftypefn
-
-@deftypefn Manipulator {} oct
-Select octal base; equivalent to @samp{setbase(8)}.
-@end deftypefn
-
-@deftypefn Manipulator {} setfill (char @var{padding})
-Set the padding character, in the same way as @code{ios::fill}.
-Requires @file{#include <iomanip.h>}.
-@end deftypefn
-
-@node Extending
-@subsection Extended data fields
-
-A related collection of methods allows you to extend this collection of
-flags and parameters for your own applications, without risk of conflict
-between them:
-
-@deftypefn Method {static fmtflags} ios::bitalloc ()
-Reserve a bit (the single bit on in the result) to use as a flag. Using
-@code{bitalloc} guards against conflict between two packages that use
-@code{ios} objects for different purposes.
-
-This method is available for upward compatibility, but is not in the
-@sc{ansi} working paper. The number of bits available is limited; a
-return value of @code{0} means no bit is available.
-@end deftypefn
-
-@deftypefn Method {static int} ios::xalloc ()
-Reserve space for a long integer or pointer parameter. The result is a
-unique nonnegative integer. You can use it as an index to
-@code{ios::iword} or @code{ios::pword}. Use @code{xalloc} to arrange
-for arbitrary special-purpose data in your @code{ios} objects, without
-risk of conflict between packages designed for different purposes.
-@end deftypefn
-
-@deftypefn Method long& ios::iword (int @var{index})
-Return a reference to arbitrary data, of long integer type, stored in an
-@code{ios} instance. @var{index}, conventionally returned from
-@code{ios::xalloc}, identifies what particular data you need.
-@end deftypefn
-
-@deftypefn Method long ios::iword (int @var{index}) const
-Return the actual value of a long integer stored in an @code{ios}.
-@end deftypefn
-
-@deftypefn Method void*& ios::pword (int @var{index})
-Return a reference to an arbitrary pointer, stored in an @code{ios}
-instance. @var{index}, originally returned from @code{ios::xalloc},
-identifies what particular pointer you need.
-@end deftypefn
-
-@deftypefn Method void* ios::pword (int @var{index}) const
-Return the actual value of a pointer stored in an @code{ios}.
-@end deftypefn
-
-@node Synchronization
-@subsection Synchronizing related streams
-
-You can use these methods to synchronize related streams with
-one another:
-
-@deftypefn Method ostream* ios::tie () const
-Report on what output stream, if any, is to be flushed before accessing
-this one. A pointer value of @code{0} means no stream is tied.
-@end deftypefn
-
-@deftypefn Method ostream* ios::tie (ostream* @var{assoc})
-Declare that output stream @var{assoc} must be flushed before accessing
-this stream.
-@end deftypefn
-
-@deftypefn Method int ios::sync_with_stdio ([int @var{switch}])
-Unless iostreams and C @code{stdio} are designed to work together, you
-may have to choose between efficient C++ streams output and output
-compatible with C @code{stdio}. Use @samp{ios::sync_with_stdio()} to
-select C compatibility.
-
-The argument @var{switch} is a @sc{gnu} extension; use @code{0} as the
-argument to choose output that is not necessarily compatible with C
-@code{stdio}. The default value for @var{switch} is @code{1}.
-
-If you install the @code{stdio} implementation that comes with @sc{gnu}
-@code{libio}, there are compatible input/output facilities for both C
-and C++. In that situation, this method is unnecessary---but you may
-still want to write programs that call it, for portability.
-@end deftypefn
-
-@node Streambuf from Ios
-@subsection Reaching the underlying @code{streambuf}
-
-Finally, you can use this method to access the underlying object:
-
-@deftypefn Method streambuf* ios::rdbuf () const
-Return a pointer to the @code{streambuf} object that underlies this
-@code{ios}.
-@end deftypefn
-
-@node Ostream
-@section Managing output streams: class @code{ostream}
-
-Objects of class @code{ostream} inherit the generic methods from
-@code{ios}, and in addition have the following methods available.
-Declarations for this class come from @file{iostream.h}.
-
-@deftypefn Constructor {} ostream::ostream ()
-The simplest form of the constructor for an @code{ostream} simply
-allocates a new @code{ios} object.
-@end deftypefn
-
-@deftypefn Constructor {} ostream::ostream (streambuf* @var{sb} @w{[, ostream} @var{tie}])
-This alternative constructor requires a first argument @var{sb} of type
-@code{streambuf*}, to use an existing open stream for output. It also
-accepts an optional second argument @var{tie}, to specify a related
-@code{ostream*} as the initial value for @code{ios::tie}.
-
-If you give the @code{ostream} a @code{streambuf} explicitly, using
-this constructor, the @var{sb} is @emph{not} destroyed (or deleted or
-closed) when the @code{ostream} is destroyed.
-@end deftypefn
-
-@menu
-* Writing:: Writing on an ostream.
-* Output Position:: Repositioning an ostream.
-* Ostream Housekeeping:: Miscellaneous ostream utilities.
-@end menu
-
-@node Writing
-@subsection Writing on an @code{ostream}
-
-These methods write on an @code{ostream} (you may also use the operator
-@code{<<}; @pxref{Operators,,Operators and Default Streams}).
-
-@deftypefn Method ostream& ostream::put (char @var{c})
-Write the single character @var{c}.
-@end deftypefn
-
-@deftypefn Method ostream& ostream::write (@var{string}, int @var{length})
-Write @var{length} characters of a string to this @code{ostream},
-beginning at the pointer @var{string}.
-
-@var{string} may have any of these types: @code{char*}, @code{unsigned
-char*}, @code{signed char*}.
-@end deftypefn
-
-@deftypefn Method ostream& ostream::form (const char *@var{format}, ...)
-A @sc{gnu} extension, similar to @code{fprintf(@var{file},
-@var{format}, ...)}.
-
-@var{format} is a @code{printf}-style format control string, which is used
-to format the (variable number of) arguments, printing the result on
-this @code{ostream}. See @code{ostream::vform} for a version that uses
-an argument list rather than a variable number of arguments.
-@end deftypefn
-
-@deftypefn Method ostream& ostream::vform (const char *@var{format}, va_list @var{args})
-A @sc{gnu} extension, similar to @code{vfprintf(@var{file},
-@var{format}, @var{args})}.
-
-@var{format} is a @code{printf}-style format control string, which is used
-to format the argument list @var{args}, printing the result on
-this @code{ostream}. See @code{ostream::form} for a version that uses a
-variable number of arguments rather than an argument list.
-@end deftypefn
-
-@node Output Position
-@subsection Repositioning an @code{ostream}
-
-You can control the output position (on output streams that actually
-support positions, typically files) with these methods:
-@c FIXME-future: sort out which classes support this and which
-@c don't; fstream, filebuf? And what is failure condition when not supported?
-
-@deftypefn Method streampos ostream::tellp ()
-Return the current write position in the stream.
-@end deftypefn
-
-@deftypefn Method ostream& ostream::seekp (streampos @var{loc})
-Reset the output position to @var{loc} (which is usually the result of a
-previous call to @code{ostream::tellp}). @var{loc} specifies an
-absolute position in the output stream.
-@end deftypefn
-
-@deftypefn Method ostream& ostream::seekp (streamoff @var{loc}, @var{rel})
-@findex ios::seekdir
-Reset the output position to @var{loc}, relative to the beginning, end,
-or current output position in the stream, as indicated by @var{rel} (a
-value from the enumeration @code{ios::seekdir}):
-
-@vtable @code
-@item beg
-Interpret @var{loc} as an absolute offset from the beginning of the
-file.
-
-@item cur
-Interpret @var{loc} as an offset relative to the current output
-position.
-
-@item end
-Interpret @var{loc} as an offset from the current end of the output
-stream.
-@end vtable
-@end deftypefn
-
-@node Ostream Housekeeping
-@subsection Miscellaneous @code{ostream} utilities
-
-You may need to use these @code{ostream} methods for housekeeping:
-
-@deftypefn Method ostream& flush ()
-Deliver any pending buffered output for this @code{ostream}.
-@end deftypefn
-
-@deftypefn Method int ostream::opfx ()
-@code{opfx} is a @dfn{prefix} method for operations on @code{ostream}
-objects; it is designed to be called before any further processing. See
-@code{ostream::osfx} for the converse.
-@c FIXME-future: specify sometime which methods start with opfx.
-
-@code{opfx} tests that the stream is in state @code{good}, and if so
-flushes any stream tied to this one.
-
-The result is @code{1} when @code{opfx} succeeds; else (if the stream state is
-not @code{good}), the result is @code{0}.
-@end deftypefn
-
-@deftypefn Method void ostream::osfx ()
-@code{osfx} is a @dfn{suffix} method for operations on @code{ostream}
-objects; it is designed to be called at the conclusion of any processing. All
-the @code{ostream} methods end by calling @code{osfx}. See
-@code{ostream::opfx} for the converse.
-
-If the @code{unitbuf} flag is set for this stream, @code{osfx} flushes
-any buffered output for it.
-
-If the @code{stdio} flag is set for this stream, @code{osfx} flushes any
-output buffered for the C output streams @file{stdout} and @file{stderr}.
-@end deftypefn
-
-@node Istream
-@section Managing input streams: class @code{istream}
-
-Class @code{istream} objects are specialized for input; as for
-@code{ostream}, they are derived from @code{ios}, so you can use any of
-the general-purpose methods from that base class. Declarations for this
-class also come from @file{iostream.h}.
-
-@deftypefn Constructor {} istream::istream ()
-When used without arguments, the @code{istream} constructor simply
-allocates a new @code{ios} object and initializes the input counter (the
-value reported by @code{istream::gcount}) to @code{0}.
-@end deftypefn
-
-@deftypefn Constructor {} istream::istream (streambuf *@var{sb} @w{[, ostream} @var{tie}])
-You can also call the constructor with one or two arguments. The first
-argument @var{sb} is a @code{streambuf*}; if you supply this pointer,
-the constructor uses that @code{streambuf} for input.
-You can use the second optional argument @var{tie} to specify a related
-output stream as the initial value for @code{ios::tie}.
-
-If you give the @code{istream} a @code{streambuf} explicitly, using
-this constructor, the @var{sb} is @emph{not} destroyed (or deleted or
-closed) when the @code{ostream} is destroyed.
-@end deftypefn
-
-@menu
-* Char Input:: Reading one character.
-* String Input:: Reading strings.
-* Input Position:: Repositioning an istream.
-* Istream Housekeeping:: Miscellaneous istream utilities.
-@end menu
-
-@node Char Input
-@subsection Reading one character
-
-Use these methods to read a single character from the input stream:
-
-@deftypefn Method int istream::get ()
-Read a single character (or @code{EOF}) from the input stream, returning
-it (coerced to an unsigned char) as the result.
-@end deftypefn
-
-@deftypefn Method istream& istream::get (char& @var{c})
-Read a single character from the input stream, into @code{&@var{c}}.
-@end deftypefn
-
-@deftypefn Method int istream::peek ()
-Return the next available input character, but @emph{without} changing
-the current input position.
-@end deftypefn
-
-@node String Input
-@subsection Reading strings
-
-Use these methods to read strings (for example, a line at a time) from
-the input stream:
-
-@deftypefn Method istream& istream::get (char* @var{c}, int @var{len} @w{[, char} @var{delim}])
-Read a string from the input stream, into the array at @var{c}.
-
-The remaining arguments limit how much to read: up to @samp{len-1}
-characters, or up to (but not including) the first occurrence in the
-input of a particular delimiter character @var{delim}---newline
-(@code{\n}) by default. (Naturally, if the stream reaches end of file
-first, that too will terminate reading.)
-
-If @var{delim} was present in the input, it remains available as if
-unread; to discard it instead, see @code{iostream::getline}.
-
-@code{get} writes @samp{\0} at the end of the string, regardless
-of which condition terminates the read.
-@end deftypefn
-
-@deftypefn Method istream& istream::get (streambuf& @var{sb} @w{[, char} @var{delim}])
-Read characters from the input stream and copy them on the
-@code{streambuf} object @var{sb}. Copying ends either just before the
-next instance of the delimiter character @var{delim} (newline @code{\n}
-by default), or when either stream ends. If @var{delim} was present in
-the input, it remains available as if unread.
-@end deftypefn
-
-@deftypefn Method istream& istream::getline (@var{charptr}, int @var{len} @w{[, char} @var{delim}])
-Read a line from the input stream, into the array at @var{charptr}.
-@var{charptr} may be any of three kinds of pointer: @code{char*},
-@code{unsigned char*}, or @code{signed char*}.
-
-The remaining arguments limit how much to read: up to (but not
-including) the first occurrence in the input of a line delimiter
-character @var{delim}---newline (@code{\n}) by default, or up to
-@samp{len-1} characters (or to end of file, if that happens sooner).
-
-If @code{getline} succeeds in reading a ``full line'', it also discards
-the trailing delimiter character from the input stream. (To preserve it
-as available input, see the similar form of @code{iostream::get}.)
-
-If @var{delim} was @emph{not} found before @var{len} characters or end
-of file, @code{getline} sets the @code{ios::fail} flag, as well as the
-@code{ios::eof} flag if appropriate.
-
-@code{getline} writes a null character at the end of the string, regardless
-of which condition terminates the read.
-@end deftypefn
-
-@deftypefn Method istream& istream::read (@var{pointer}, int @var{len})
-Read @var{len} bytes into the location at @var{pointer}, unless the
-input ends first.
-
-@var{pointer} may be of type @code{char*}, @code{void*}, @code{unsigned
-char*}, or @code{signed char*}.
-
-If the @code{istream} ends before reading @var{len} bytes, @code{read}
-sets the @code{ios::fail} flag.
-@end deftypefn
-
-@deftypefn Method istream& istream::gets (char **@var{s} @w{[, char} @var{delim}])
-A @sc{gnu} extension, to read an arbitrarily long string
-from the current input position to the next instance of the @var{delim}
-character (newline @code{\n} by default).
-
-To permit reading a string of arbitrary length, @code{gets} allocates
-whatever memory is required. Notice that the first argument @var{s} is
-an address to record a character pointer, rather than the pointer
-itself.
-@end deftypefn
-
-@deftypefn Method istream& istream::scan (const char *format ...)
-A @sc{gnu} extension, similar to @code{fscanf(@var{file},
-@var{format}, ...)}. The @var{format} is a @code{scanf}-style format
-control string, which is used to read the variables in the remainder of
-the argument list from the @code{istream}.
-@end deftypefn
-
-@deftypefn Method istream& istream::vscan (const char *format, va_list args)
-Like @code{istream::scan}, but takes a single @code{va_list} argument.
-@end deftypefn
-
-@node Input Position
-@subsection Repositioning an @code{istream}
-
-Use these methods to control the current input position:
-
-@deftypefn Method streampos istream::tellg ()
-Return the current read position, so that you can save it and return to
-it later with @code{istream::seekg}.
-@end deftypefn
-
-@deftypefn Method istream& istream::seekg (streampos @var{p})
-Reset the input pointer (if the input device permits it) to @var{p},
-usually the result of an earlier call to @code{istream::tellg}.
-@end deftypefn
-
-@deftypefn Method istream& istream::seekg (streamoff @var{offset}, ios::seek_dir @var{ref})
-Reset the input pointer (if the input device permits it) to @var{offset}
-characters from the beginning of the input, the current position, or the
-end of input. Specify how to interpret @var{offset} with one of these
-values for the second argument:
-
-@vtable @code
-@item ios::beg
-Interpret @var{loc} as an absolute offset from the beginning of the
-file.
-
-@item ios::cur
-Interpret @var{loc} as an offset relative to the current output
-position.
-
-@item ios::end
-Interpret @var{loc} as an offset from the current end of the output
-stream.
-@end vtable
-@end deftypefn
-
-@node Istream Housekeeping
-@subsection Miscellaneous @code{istream} utilities
-
-Use these methods for housekeeping on @code{istream} objects:
-
-@deftypefn Method int istream::gcount ()
-Report how many characters were read from this @code{istream} in the
-last unformatted input operation.
-@c FIXME! Define "unformatted input" somewhere...
-@end deftypefn
-
-@deftypefn Method int istream::ipfx (int @var{keepwhite})
-Ensure that the @code{istream} object is ready for reading; check for
-errors and end of file and flush any tied stream. @code{ipfx} skips
-whitespace if you specify @code{0} as the @var{keepwhite}
-argument, @emph{and} @code{ios::skipws} is set for this stream.
-
-To avoid skipping whitespace (regardless of the @code{skipws} setting on
-the stream), use @code{1} as the argument.
-
-Call @code{istream::ipfx} to simplify writing your own methods for reading
-@code{istream} objects.
-@end deftypefn
-
-@deftypefn Method void istream::isfx ()
-A placeholder for compliance with the draft @sc{ansi} standard; this
-method does nothing whatever.
-
-If you wish to write portable standard-conforming code on @code{istream}
-objects, call @code{isfx} after any operation that reads from an
-@code{istream}; if @code{istream::ipfx} has any special effects that
-must be cancelled when done, @code{istream::isfx} will cancel them.
-@end deftypefn
-
-@deftypefn Method istream& istream::ignore ([int @var{n}] @w{[, int} @var{delim}])
-Discard some number of characters pending input. The first optional
-argument @var{n} specifies how many characters to skip. The second
-optional argument @var{delim} specifies a ``boundary'' character:
-@code{ignore} returns immediately if this character appears in the
-input.
-
-By default, @var{delim} is @code{EOF}; that is, if you do not specify a
-second argument, only the count @var{n} restricts how much to ignore
-(while input is still available).
-
-If you do not specify how many characters to ignore, @code{ignore}
-returns after discarding only one character.
-@end deftypefn
-
-@deftypefn Method istream& istream::putback (char @var{ch})
-Attempts to back up one character, replacing the character backed-up
-over by @var{ch}. Returns @code{EOF} if this is not allowed. Putting
-back the most recently read character is always allowed. (This method
-corresponds to the C function @code{ungetc}.)
-@end deftypefn
-
-@deftypefn Method istream& istream::unget ()
-Attempt to back up one character.
-@end deftypefn
-
-@node Iostream
-@section Input and output together: class @code{iostream}
-
-If you need to use the same stream for input and output, you can use an
-object of the class @code{iostream}, which is derived from @emph{both}
-@code{istream} and @code{ostream}.
-
-The constructors for @code{iostream} behave just like the constructors
-for @code{istream}.
-
-@deftypefn Constructor {} iostream::iostream ()
-When used without arguments, the @code{iostream} constructor simply
-allocates a new @code{ios} object, and initializes the input counter
-(the value reported by @code{istream::gcount}) to @code{0}.
-@end deftypefn
-
-@deftypefn Constructor {} iostream::iostream (streambuf* @var{sb} @w{[, ostream*} @var{tie}])
-You can also call a constructor with one or two arguments. The first
-argument @var{sb} is a @code{streambuf*}; if you supply this pointer,
-the constructor uses that @code{streambuf} for input and output.
-
-You can use the optional second argument @var{tie} (an @code{ostream*})
-to specify a related output stream as the initial value for
-@code{ios::tie}.
-@end deftypefn
-
-@cindex @code{iostream} destructor
-@cindex destructor for @code{iostream}
-As for @code{ostream} and @code{istream}, @code{iostream} simply uses
-the @code{ios} destructor. However, an @code{iostream} is not deleted by
-its destructor.
-
-You can use all the @code{istream}, @code{ostream}, and @code{ios}
-methods with an @code{iostream} object.
-
-@node Files and Strings
-@chapter Classes for Files and Strings
-
-There are two very common special cases of input and output: using files,
-and using strings in memory.
-
-@code{libio} defines four specialized classes for these cases:
-
-@ftable @code
-@item ifstream
-Methods for reading files.
-
-@item ofstream
-Methods for writing files.
-
-@item istrstream
-Methods for reading strings from memory.
-
-@item ostrstream
-Methods for writing strings in memory.
-@end ftable
-
-@menu
-* Files:: Reading and writing files.
-* Strings:: Reading and writing strings in memory.
-@end menu
-
-@node Files
-@section Reading and writing files
-
-These methods are declared in @file{fstream.h}.
-
-@findex ifstream
-@cindex class @code{ifstream}
-You can read data from class @code{ifstream} with any operation from class
-@code{istream}. There are also a few specialized facilities:
-
-@deftypefn Constructor {} ifstream::ifstream ()
-Make an @code{ifstream} associated with a new file for input. (If you
-use this version of the constructor, you need to call
-@code{ifstream::open} before actually reading anything)
-@end deftypefn
-
-@deftypefn Constructor {} ifstream::ifstream (int @var{fd})
-Make an @code{ifstream} for reading from a file that was already open,
-using file descriptor @var{fd}. (This constructor is compatible with
-other versions of iostreams for @sc{posix} systems, but is not part of
-the @sc{ansi} working paper.)
-@end deftypefn
-
-@deftypefn Constructor {} ifstream::ifstream (const char* @var{fname} @w{[, int} @var{mode} @w{[, int} @var{prot}]])
-Open a file @code{*@var{fname}} for this @code{ifstream} object.
-
-By default, the file is opened for input (with @code{ios::in} as
-@var{mode}). If you use this constructor, the file will be closed when
-the @code{ifstream} is destroyed.
-
-You can use the optional argument @var{mode} to specify how to open the
-file, by combining these enumerated values (with @samp{|} bitwise or).
-(These values are actually defined in class @code{ios}, so that all
-file-related streams may inherit them.) Only some of these modes are
-defined in the latest draft @sc{ansi} specification; if portability is
-important, you may wish to avoid the others.
-
-@vtable @code
-@item ios::in
-Open for input. (Included in @sc{ansi} draft.)
-
-@item ios::out
-Open for output. (Included in @sc{ansi} draft.)
-
-@item ios::ate
-Set the initial input (or output) position to the end of the file.
-
-@item ios::app
-Seek to end of file before each write. (Included in @sc{ansi} draft.)
-
-@item ios::trunc
-Guarantee a fresh file; discard any contents that were previously
-associated with it.
-
-@item ios::nocreate
-Guarantee an existing file; fail if the specified file did not already
-exist.
-
-@item ios::noreplace
-Guarantee a new file; fail if the specified file already existed.
-
-@item ios::bin
-Open as a binary file (on systems where binary and text files have different
-properties, typically how @samp{\n} is mapped; included in @sc{ansi} draft).
-@end vtable
-
-@noindent
-The last optional argument @var{prot} is specific to Unix-like systems;
-it specifies the file protection (by default @samp{644}).
-@end deftypefn
-
-@deftypefn Method void ifstream::open (const char* @var{fname} @w{[, int} @var{mode} @w{[, int} @var{prot}]])
-Open a file explicitly after the associated @code{ifstream} object
-already exists (for instance, after using the default constructor). The
-arguments, options and defaults all have the same meanings as in the
-fully specified @code{ifstream} constructor.
-@end deftypefn
-
-@findex ostream
-@cindex class @code{ostream}
-You can write data to class @code{ofstream} with any operation from class
-@code{ostream}. There are also a few specialized facilities:
-
-@deftypefn Constructor {} ofstream::ofstream ()
-Make an @code{ofstream} associated with a new file for output.
-@end deftypefn
-
-@deftypefn Constructor {} ofstream::ofstream (int @var{fd})
-Make an @code{ofstream} for writing to a file that was already open,
-using file descriptor @var{fd}.
-@end deftypefn
-
-@deftypefn Constructor {} ofstream::ofstream (const char* @var{fname} @w{[, int} @var{mode} @w{[, int} @var{prot}]])
-Open a file @code{*@var{fname}} for this @code{ofstream} object.
-
-By default, the file is opened for output (with @code{ios::out} as @var{mode}).
-You can use the optional argument @var{mode} to specify how to open the
-file, just as described for @code{ifstream::ifstream}.
-
-The last optional argument @var{prot} specifies the file protection (by
-default @samp{644}).
-@end deftypefn
-
-@deftypefn Destructor {} ofstream::~ofstream ()
-The files associated with @code{ofstream} objects are closed when the
-corresponding object is destroyed.
-@end deftypefn
-
-@deftypefn Method void ofstream::open (const char* @var{fname} @w{[, int} @var{mode} @w{[, int} @var{prot}]])
-Open a file explicitly after the associated @code{ofstream} object
-already exists (for instance, after using the default constructor). The
-arguments, options and defaults all have the same meanings as in the
-fully specified @code{ofstream} constructor.
-@end deftypefn
-
-@findex fstream
-@cindex class @code{fstream}
-The class @code{fstream} combines the facilities of @code{ifstream} and
-@code{ofstream}, just as @code{iostream} combines @code{istream} and
-@code{ostream}.
-
-@c FIXME-future: say something about fstream constructor, maybe.
-
-@findex fstreambase
-@cindex class @code{fstreambase}
-The class @code{fstreambase} underlies both @code{ifstream} and
-@code{ofstream}. They both inherit this additional method:
-
-@deftypefn Method void fstreambase::close ()
-Close the file associated with this object, and set @code{ios::fail} in
-this object to mark the event.
-@end deftypefn
-
-@node Strings
-@section Reading and writing in memory
-
-@c FIXME!! Per, there's a lot of guesswork here---please check carefully!
-
-@findex istrstream
-@cindex class @code{istrstream}
-@findex ostrstream
-@cindex class @code{ostrstream}
-@findex strstream
-@cindex class @code{strstream}
-@findex strstreambase
-@cindex class @code{strstreambase}
-@findex strstreambuf
-@cindex class @code{strstreambuf}
-The classes @code{istrstream}, @code{ostrstream}, and @code{strstream}
-provide some additional features for reading and writing strings in
-memory---both static strings, and dynamically allocated strings. The
-underlying class @code{strstreambase} provides some features common to
-all three; @code{strstreambuf} underlies that in turn.
-
-@c FIXME-future: Document strstreambuf methods one day, when we document
-@c streambuf more fully.
-
-@deftypefn Constructor {} istrstream::istrstream (const char* @var{str} @w{[, int} @var{size}])
-Associate the new input string class @code{istrstream} with an existing
-static string starting at @var{str}, of size @var{size}. If you do not
-specify @var{size}, the string is treated as a @code{NUL} terminated string.
-@end deftypefn
-
-@deftypefn Constructor {} ostrstream::ostrstream ()
-Create a new stream for output to a dynamically managed string, which
-will grow as needed.
-@end deftypefn
-
-@deftypefn Constructor {} ostrstream::ostrstream (char* @var{str}, int @var{size} [,int @var{mode}])
-A new stream for output to a statically defined string of length
-@var{size}, starting at @var{str}. You may optionally specify one of
-the modes described for @code{ifstream::ifstream}; if you do not specify
-one, the new stream is simply open for output, with mode @code{ios::out}.
-@end deftypefn
-
-@deftypefn Method int ostrstream::pcount ()
-Report the current length of the string associated with this @code{ostrstream}.
-@end deftypefn
-
-@deftypefn Method char* ostrstream::str ()
-A pointer to the string managed by this @code{ostrstream}. Implies
-@samp{ostrstream::freeze()}.
-
-Note that if you want the string to be nul-terminated,
-you must do that yourself (perhaps by writing ends to the stream).
-@end deftypefn
-
-@deftypefn Method void ostrstream::freeze ([int @var{n}])
-If @var{n} is nonzero (the default), declare that the string associated
-with this @code{ostrstream} is not to change dynamically; while frozen,
-it will not be reallocated if it needs more space, and it will not be
-deallocated when the @code{ostrstream} is destroyed. Use
-@samp{freeze(1)} if you refer to the string as a pointer after creating
-it via @code{ostrstream} facilities.
-
-@samp{freeze(0)} cancels this declaration, allowing a dynamically
-allocated string to be freed when its @code{ostrstream} is destroyed.
-
-If this @code{ostrstream} is already static---that is, if it was created
-to manage an existing statically allocated string---@code{freeze} is
-unnecessary, and has no effect.
-@end deftypefn
-
-@deftypefn Method int ostrstream::frozen ()
-Test whether @code{freeze(1)} is in effect for this string.
-@end deftypefn
-
-@deftypefn Method strstreambuf* strstreambase::rdbuf ()
-A pointer to the underlying @code{strstreambuf}.
-@end deftypefn
-
-@node Streambuf
-@chapter Using the @code{streambuf} Layer
-
-The @code{istream} and @code{ostream} classes are meant to handle
-conversion between objects in your program and their textual representation.
-
-By contrast, the underlying @code{streambuf} class is for transferring
-raw bytes between your program, and input sources or output sinks.
-Different @code{streambuf} subclasses connect to different kinds of
-sources and sinks.
-
-The @sc{gnu} implementation of @code{streambuf} is still evolving; we
-describe only some of the highlights.
-
-@menu
-* Areas:: Areas in a streambuf.
-* Overflow:: Simple output re-direction
-* Formatting:: C-style formatting for streambuf objects.
-* Stdiobuf:: Wrappers for C stdio.
-* Procbuf:: Reading/writing from/to a pipe
-* Backing Up:: Marking and returning to a position.
-* Indirectbuf:: Forwarding I/O activity.
-@end menu
-
-@node Areas
-@section Areas of a @code{streambuf}
-
-Streambuf buffer management is fairly sophisticated (this is a
-nice way to say ``complicated''). The standard protocol
-has the following ``areas'':
-
-@itemize @bullet
-@item
-@cindex put area
-The @dfn{put area} contains characters waiting for output.
-
-@item
-@cindex get area
-The @dfn{get area} contains characters available for reading.
-@end itemize
-
-The @sc{gnu} @code{streambuf} design extends this, but the details are
-still evolving.
-
-The following methods are used to manipulate these areas.
-These are all protected methods, which are intended to be
-used by virtual function in classes derived from @code{streambuf}.
-They are also all ANSI/ISO-standard, and the ugly names
-are traditional.
-(Note that if a pointer points to the 'end' of an area,
-it means that it points to the character after the area.)
-
-@deftypefn Method char* streambuf::pbase () const
-Returns a pointer to the start of the put area.
-@end deftypefn
-
-@deftypefn Method char* streambuf::epptr () const
-Returns a pointer to the end of the put area.
-@end deftypefn
-
-@deftypefn Method char* streambuf::pptr () const
-If @code{pptr() < epptr ()}, the @code{pptr()}
-returns a pointer to the current put position.
-(In that case, the next write will
-overwrite @code{*pptr()}, and increment @code{pptr()}.)
-Otherwise, there is no put position available
-(and the next character written will cause @code{streambuf::overflow}
-to be called).
-@end deftypefn
-
-@deftypefn Method void streambuf::pbump (int @var{N})
-Add @var{N} to the current put pointer.
-No error checking is done.
-@end deftypefn
-
-@deftypefn Method void streambuf::setp (char* @var{P}, char* @var{E})
-Sets the start of the put area to @var{P}, the end of the put area to @var{E},
-and the current put pointer to @var{P} (also).
-@end deftypefn
-
-@deftypefn Method char* streambuf::eback () const
-Returns a pointer to the start of the get area.
-@end deftypefn
-
-@deftypefn Method char* streambuf::egptr () const
-Returns a pointer to the end of the get area.
-@end deftypefn
-
-@deftypefn Method char* streambuf::gptr () const
-If @code{gptr() < egptr ()}, then @code{gptr()}
-returns a pointer to the current get position.
-(In that case the next read will read @code{*gptr()},
-and possibly increment @code{gptr()}.)
-Otherwise, there is no read position available
-(and the next read will cause @code{streambuf::underflow}
-to be called).
-@end deftypefn
-
-@deftypefn Method void streambuf:gbump (int @var{N})
-Add @var{N} to the current get pointer.
-No error checking is done.
-@end deftypefn
-
-@deftypefn Method void streambuf::setg (char* @var{B}, char* @var{P}, char* @var{E})
-Sets the start of the get area to @var{B}, the end of the get area to @var{E},
-and the current put pointer to @var{P}.
-@end deftypefn
-
-@node Overflow
-@section Simple output re-direction by redefining @code{overflow}
-
-Suppose you have a function @code{write_to_window} that
-writes characters to a @code{window} object. If you want to use the
-ostream function to write to it, here is one (portable) way to do it.
-This depends on the default buffering (if any).
-
-@cartouche
-@smallexample
-#include <iostream.h>
-/* Returns number of characters successfully written to @var{win}. */
-extern int write_to_window (window* win, char* text, int length);
-
-class windowbuf : public streambuf @{
- window* win;
- public:
- windowbuf (window* w) @{ win = w; @}
- int sync ();
- int overflow (int ch);
- // Defining xsputn is an optional optimization.
- // (streamsize was recently added to ANSI C++, not portable yet.)
- streamsize xsputn (char* text, streamsize n);
-@};
-
-int windowbuf::sync ()
-@{ streamsize n = pptr () - pbase ();
- return (n && write_to_window (win, pbase (), n) != n) ? EOF : 0;
-@}
-
-int windowbuf::overflow (int ch)
-@{ streamsize n = pptr () - pbase ();
- if (n && sync ())
- return EOF;
- if (ch != EOF)
- @{
- char cbuf[1];
- cbuf[0] = ch;
- if (write_to_window (win, cbuf, 1) != 1)
- return EOF;
- @}
- pbump (-n); // Reset pptr().
- return 0;
-@}
-
-streamsize windowbuf::xsputn (char* text, streamsize n)
-@{ return sync () == EOF ? 0 : write_to_window (win, text, n); @}
-
-int
-main (int argc, char**argv)
-@{
- window *win = ...;
- windowbuf wbuf(win);
- ostream wstr(&wbuf);
- wstr << "Hello world!\n";
-@}
-@end smallexample
-@end cartouche
-
-
-
-@node Formatting
-@section C-style formatting for @code{streambuf} objects
-
-The @sc{gnu} @code{streambuf} class supports @code{printf}-like
-formatting and scanning.
-
-@deftypefn Method int streambuf::form (const char *@var{format}, ...)
-Similar to @code{fprintf(@var{file}, @var{format}, ...)}.
-The @var{format} is a @code{printf}-style format control string, which is used
-to format the (variable number of) arguments, printing the result on
-the @code{this} streambuf. The result is the number of characters printed.
-@end deftypefn
-
-@deftypefn Method int streambuf::vform (const char *@var{format}, va_list @var{args})
-Similar to @code{vfprintf(@var{file}, @var{format}, @var{args})}.
-The @var{format} is a @code{printf}-style format control string, which is used
-to format the argument list @var{args}, printing the result on
-the @code{this} streambuf. The result is the number of characters printed.
-@end deftypefn
-
-@deftypefn Method int streambuf::scan (const char *@var{format}, ...)
-Similar to @code{fscanf(@var{file}, @var{format}, ...)}.
-The @var{format} is a @code{scanf}-style format control string, which is used
-to read the (variable number of) arguments from the @code{this} streambuf.
-The result is the number of items assigned, or @code{EOF} in case of
-input failure before any conversion.
-@end deftypefn
-
-@deftypefn Method int streambuf::vscan (const char *@var{format}, va_list @var{args})
-Like @code{streambuf::scan}, but takes a single @code{va_list} argument.
-@end deftypefn
-
-@node Stdiobuf
-@section Wrappers for C @code{stdio}
-
-A @dfn{stdiobuf} is a @code{streambuf} object that points to
-a @code{FILE} object (as defined by @code{stdio.h}).
-All @code{streambuf} operations on the @code{stdiobuf} are forwarded
-to the @code{FILE}. Thus the @code{stdiobuf} object provides a
-wrapper around a @code{FILE}, allowing use of @code{streambuf}
-operations on a @code{FILE}. This can be useful when mixing
-C code with C++ code.
-
-The pre-defined streams @code{cin}, @code{cout}, and @code{cerr} are
-normally implemented as @code{stdiobuf} objects that point to
-respectively @code{stdin}, @code{stdout}, and @code{stderr}. This is
-convenient, but it does cost some extra overhead.
-
-If you set things up to use the implementation of @code{stdio} provided
-with this library, then @code{cin}, @code{cout}, and @code{cerr} will be
-set up to use @code{stdiobuf} objects, since you get their benefits
-for free. @xref{Stdio,,C Input and Output}.
-
-@ignore
-@c FIXME-future: setbuf is not yet documented, hence this para is not useful.
-Note that if you use @code{setbuf} to give a buffer to a @code{stdiobuf},
-that buffer will provide intermediate buffering in addition that
-whatever is done by the @code{FILE}.
-@end ignore
-
-@node Procbuf
-@section Reading/writing from/to a pipe
-
-The @dfn{procbuf} class is a @sc{gnu} extension. It is derived from
-@code{streambuf}. A @code{procbuf} can be @dfn{closed} (in which case
-it does nothing), or @dfn{open} (in which case it allows communicating
-through a pipe with some other program).
-
-@deftypefn Constructor {} procbuf::procbuf ()
-Creates a @code{procbuf} in a @dfn{closed} state.
-@end deftypefn
-
-@deftypefn Method procbuf* procbuf::open (const char *@var{command}, int @var{mode})
-Uses the shell (@file{/bin/sh}) to run a program specified by @var{command}.
-
-If @var{mode} is @samp{ios::in}, standard output from the program is sent
-to a pipe; you can read from the pipe by reading from the
-@code{procbuf}. (This is similar to @w{@samp{popen(@var{command}, "r")}}.)
-
-If @var{mode} is @samp{ios::out}, output written to the
-@code{procbuf} is written to a pipe; the program is set up to read its
-standard input from (the other end of) the pipe. (This is similar to
-@w{@samp{popen(@var{command}, "w")}}.)
-
-The @code{procbuf} must start out in the @dfn{closed} state.
-Returns @samp{*this} on success, and @samp{NULL} on failure.
-@end deftypefn
-
-@deftypefn Constructor {} procbuf::procbuf (const char *@var{command}, int @var{mode})
-Calls @samp{procbuf::open (@var{command}, @var{mode})}.
-@end deftypefn
-
-@deftypefn Method procbuf* procbuf::close ()
-Waits for the program to finish executing,
-and then cleans up the resources used.
-Returns @samp{*this} on success, and @samp{NULL} on failure.
-@end deftypefn
-
-@deftypefn Destructor {} procbuf::~procbuf ()
-Calls @samp{procbuf::close}.
-@end deftypefn
-
-@node Backing Up
-@section Backing up
-
-The @sc{gnu} iostream library allows you to ask a @code{streambuf} to
-remember the current position. This allows you to go back to this
-position later, after reading further. You can back up arbitrary
-amounts, even on unbuffered files or multiple buffers' worth, as long as
-you tell the library in advance. This unbounded backup is very useful
-for scanning and parsing applications. This example shows a typical
-scenario:
-
-@cartouche
-@smallexample
-// Read either "dog", "hound", or "hounddog".
-// If "dog" is found, return 1.
-// If "hound" is found, return 2.
-// If "hounddog" is found, return 3.
-// If none of these are found, return -1.
-int my_scan(streambuf* sb)
-@{
- streammarker fence(sb);
- char buffer[20];
- // Try reading "hounddog":
- if (sb->sgetn(buffer, 8) == 8
- && strncmp(buffer, "hounddog", 8) == 0)
- return 3;
- // No, no "hounddog": Back up to 'fence'
- sb->seekmark(fence); //
- // ... and try reading "dog":
- if (sb->sgetn(buffer, 3) == 3
- && strncmp(buffer, "dog", 3) == 0)
- return 1;
- // No, no "dog" either: Back up to 'fence'
- sb->seekmark(fence); //
- // ... and try reading "hound":
- if (sb->sgetn(buffer, 5) == 5
- && strncmp(buffer, "hound", 5) == 0)
- return 2;
- // No, no "hound" either: Back up and signal failure.
- sb->seekmark(fence); // Backup to 'fence'
- return -1;
-@}
-@end smallexample
-@end cartouche
-
-@deftypefn Constructor {} streammarker::streammarker (streambuf* @var{sbuf})
-Create a @code{streammarker} associated with @var{sbuf}
-that remembers the current position of the get pointer.
-@end deftypefn
-
-@deftypefn Method int streammarker::delta (streammarker& @var{mark2})
-Return the difference between the get positions corresponding
-to @code{*this} and @var{mark2} (which must point into the same
-@code{streambuffer} as @code{this}).
-@end deftypefn
-
-@deftypefn Method int streammarker::delta ()
-Return the position relative to the streambuffer's current get position.
-@end deftypefn
-
-@deftypefn Method int streambuf::seekmark (streammarker& @var{mark})
-Move the get pointer to where it (logically) was when @var{mark}
-was constructed.
-@end deftypefn
-
-@node Indirectbuf
-@section Forwarding I/O activity
-
-An @dfn{indirectbuf} is one that forwards all of its I/O requests
-to another streambuf.
-
-@ignore
-@c FIXME-future: get_stream and put_stream are so far undocumented.
-All get-related requests are sent to get_stream().
-All put-related requests are sent to put_stream().
-@end ignore
-
-An @code{indirectbuf} can be used to implement Common Lisp
-synonym-streams and two-way-streams:
-
-@example
-class synonymbuf : public indirectbuf @{
- Symbol *sym;
- synonymbuf(Symbol *s) @{ sym = s; @}
- virtual streambuf *lookup_stream(int mode) @{
- return coerce_to_streambuf(lookup_value(sym)); @}
-@};
-@end example
-
-@node Stdio
-@chapter C Input and Output
-
-@code{libio} is distributed with a complete implementation of the ANSI C
-@code{stdio} facility. It is implemented using @code{streambuf}
-objects. @xref{Stdiobuf,,Wrappers for C @code{stdio}}.
-
-The @code{stdio} package is intended as a replacement for the whatever
-@code{stdio} is in your C library.
-@ignore
-@c FIXME-future: This is not useful unless we specify what problems.
-It can co-exist with C libraries that have alternate implementations of
-stdio, but there may be some problems.
-@end ignore
-Since @code{stdio} works best when you build @code{libc} to contain it, and
-that may be inconvenient, it is not installed by default.
-
-Extensions beyond @sc{ansi}:
-
-@itemize @bullet
-@item
-A stdio @code{FILE} is identical to a streambuf.
-Hence there is no need to worry about synchronizing C and C++
-input/output---they are by definition always synchronized.
-
-@item
-If you create a new streambuf sub-class (in C++), you can use it as a
-@code{FILE} from C. Thus the system is extensible using the standard
-@code{streambuf} protocol.
-
-@item
-You can arbitrarily mix reading and writing, without having to seek
-in between.
-
-@item
-Unbounded @code{ungetc()} buffer.
-@end itemize
-
-@ignore
-@c FIXME-future: Per says this is not ready to go public at v0.5
-@node Libio buffer management
-@chapter Libio buffer management
-
-The libio user functions present an abstract sequence of characters,
-that they read and write from. A number of buffers are used to go
-between the user program and the abstract sequence. These buffers are
-concrete arrays of characters that contain some sub-sequence of the
-abstract sequence.
-
-The libio buffer management protocol is fairly complex. Its design is
-based on the C++ @code{streambuf} protocol, so that the C++
-@code{streambuf} classes can be trivially implemented on top of the
-libio protocol.
-
-The @dfn{write area} contains characters waiting for output.
-
-The @dfn{read area} contains characters available for reading.
-
-The @dfn{reserve area} is available to virtual methods.
-Usually, the get and/or put areas are part of the reserve area.
-
-The @dfn{main get area} contains characters that have
-been read in from the character source, but not yet
-read by the application.
-
-The @dfn{backup area} contains previously read data that is being saved
-because of a user request, or that have been "unread" (put back).
-@end ignore
-
-@ignore
-@c Per says this design is not finished
-@node Streambuf internals
-@chapter Streambuf internals
-
-@menu
-* Buffer management::
-* Filebuf internals::
-@end menu
-
-@node Buffer management
-@section Buffer management
-
-@subsection Areas
-
-NOTE: This chapter is due for an update.
-
-Streambuf buffer management is fairly sophisticated (this is a
-nice way to say "complicated"). The standard protocol
-has the following "areas":
-
-@itemize @bullet
-@cindex put area
-@item
-The @dfn{put area} contains characters waiting for output.
-@cindex get area
-@item
-The @dfn{get area} contains characters available for reading.
-@cindex reserve area
-@item
-The @dfn{reserve area} is available to virtual methods.
-Usually, the get and/or put areas are part of the reserve area.
-@end itemize
-
-The @sc{gnu} @code{streambuf} design extends this by supporting two
-get areas:
-@itemize @bullet
-@cindex main get area
-@item
-The @dfn{main get area} contains characters that have
-been read in from the character source, but not yet
-read by the application.
-@cindex backup area
-@item
-The @dfn{backup area} contains previously read data that is being
-saved because of a user request, or that have been "unread" (putback).
-@end itemize
-
-The backup and the main get area are logically contiguous: That is,
-the first character of the main get area follows the last character
-of the backup area.
-
-The @dfn{current get area} is whichever one of the backup or
-main get areas that is currently being read from.
-The other of the two is the @dfn{non-current get area}.
-
-@subsection Pointers
-
-The following @code{char*} pointers define the various areas.
-
-@deftypefn Method char* streambuf::base ()
-The start of the reserve area.
-@end deftypefn
-
-@deftypefn Method char* streambuf::ebuf ()
-The end of the reserve area.
-@end deftypefn
-
-@deftypefn Method char* streambuf::Gbase ()
-The start of the main get area.
-@end deftypefn
-
-@deftypefn Method char* streambuf::eGptr ()
-The end of the main get area.
-@end deftypefn
-
-@deftypefn Method char* streambuf::Bbase ()
-The start of the backup area.
-@end deftypefn
-
-@deftypefn Method char* streambuf::Bptr ()
-The start of the used part of the backup area.
-The area (@code{Bptr()} .. @code{eBptr()}) contains data that has been
-pushed back, while (@code{Bbase()} .. @code{eBptr()}) contains unused
-space available for future putbacks.
-@end deftypefn
-
-@deftypefn Method char* streambuf::eBptr ()
-The end of the backup area.
-@end deftypefn
-
-@deftypefn Method char* streambuf::Nbase ()
-The start of the non-current get area (either @code{main_gbase} or @code{backup_gbase}).
-@end deftypefn
-
-@deftypefn Method char* streambuf::eNptr ()
-The end of the non-current get area.
-@end deftypefn
-
-@node Filebuf internals
-@section Filebuf internals
-
-The @code{filebuf} is used a lot, so it is importamt that it be
-efficient. It is also supports rather complex semantics.
-so let us examine its implementation.
-
-@subsection Tied read and write pointers
-
-The streambuf model allows completely independent read and write pointers.
-However, a @code{filebuf} has only a single logical pointer used
-for both reads and writes. Since the @code{streambuf} protocol
-uses @code{gptr()} for reading and @code{pptr()} for writing,
-we map the logical file pointer into either @code{gptr()} or @code{pptr()}
-at different times.
-
-@itemize @bullet
-@item
-Reading is allowed when @code{gptr() < egptr()}, which we call get mode.
-
-@item
-Writing is allowed when @code{pptr() < epptr()}, which we call put mode.
-@end itemize
-
-@noindent
-A @code{filebuf} cannot be in get mode and put mode at the same time.
-
-We have up to two buffers:
-
-@itemize @bullet
-@item
-The backup area, defined by @code{Bbase()}, @code{Bptr()}, and @code{eBptr()}.
-This can be empty.
-
-@item
-The reserve area, which also contains the main get area.
-For an unbuffered file, the (@code{shortbuf()}..@code{shortbuf()+1}) is used,
-where @code{shortbuf()} points to a 1-byte buffer that is part of
-the @code{filebuf}.
-@end itemize
-
-@noindent
-The file system's idea of the current position is @code{eGptr()}.
-
-Characters that have been written into a buffer but not yet written
-out (flushed) to the file systems are those between @code{pbase()}
-and @code{pptr()}.
-
-The end of the valid data bytes is:
-@code{pptr() > eGptr() && pptr() < ebuf() ? pptr() : eGptr()}.
-
-If the @code{filebuf} is unbuffered or line buffered,
-the @code{eptr()} is @code{pbase()}. This forces a call
-to @code{overflow()} on each put of a character.
-The logical @code{epptr()} is @code{epptr() ? ebuf() : NULL}.
-(If the buffer is read-only, set @code{pbase()}, @code{pptr()},
-and @code{epptr()} to @code{NULL}. NOT!)
-@end ignore
-
-@node Index
-@unnumbered Index
-@printindex cp
-
-@contents
-@bye
diff --git a/contrib/libio/iostreamP.h b/contrib/libio/iostreamP.h
deleted file mode 100644
index c9c40cb6ba9a..000000000000
--- a/contrib/libio/iostreamP.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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 "streambuf.h"
-#include "libioP.h"
diff --git a/contrib/libio/iostrerror.c b/contrib/libio/iostrerror.c
deleted file mode 100644
index 348e0956d70f..000000000000
--- a/contrib/libio/iostrerror.c
+++ /dev/null
@@ -1,12 +0,0 @@
-/* This should be replaced by whatever namespace-clean
- version of strerror you have available. */
-
-#include "libioP.h"
-extern char *strerror __P ((int));
-
-char *
-_IO_strerror (errnum)
- int errnum;
-{
- return strerror(errnum);
-}
diff --git a/contrib/libio/ioungetc.c b/contrib/libio/ioungetc.c
deleted file mode 100644
index 07f38e747bf3..000000000000
--- a/contrib/libio/ioungetc.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/* Copyright (C) 1993, 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"
-
-int
-_IO_ungetc (c, fp)
- int c;
- _IO_FILE *fp;
-{
- int result;
- CHECK_FILE (fp, EOF);
- if (c == EOF)
- return EOF;
- _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
- _IO_flockfile (fp);
- result = _IO_sputbackc (fp, (unsigned char) c);
- _IO_cleanup_region_end (1);
- return result;
-}
-
-#ifdef weak_alias
-weak_alias (_IO_ungetc, ungetc)
-#endif
diff --git a/contrib/libio/iovfprintf.c b/contrib/libio/iovfprintf.c
deleted file mode 100644
index 755334c2bf23..000000000000
--- a/contrib/libio/iovfprintf.c
+++ /dev/null
@@ -1,890 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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. */
-
-/*
- * Copyright (c) 1990 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms are permitted
- * provided that the above copyright notice and this paragraph are
- * duplicated in all such forms and that any documentation,
- * advertising materials, and other materials related to such
- * distribution and use acknowledge that the software was developed
- * by the University of California, Berkeley. The name of the
- * University may not be used to endorse or promote products derived
- * from this software without specific prior written permission.
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- */
-
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "%W% (Berkeley) %G%";
-#endif /* LIBC_SCCS and not lint */
-
-/*
- * Actual printf innards.
- *
- * This code is large and complicated...
- */
-
-#include <sys/types.h>
-#include "libioP.h"
-#include <string.h>
-#ifdef __STDC__
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
-
-#ifndef _IO_USE_DTOA
-int __cvt_double __P((double number, register int prec, int flags, int *signp, int fmtch, char *startp, char *endp));
-#endif
-
-/*
- * Define FLOATING_POINT to get floating point.
- */
-#ifndef NO_FLOATING_POINT
-#define FLOATING_POINT
-#endif
-
-/* end of configuration stuff */
-
-
-/*
- * Helper "class" for `fprintf to unbuffered': creates a
- * temporary buffer. */
-
-struct helper_file
-{
- struct _IO_FILE_plus _f;
- _IO_FILE *_put_stream;
-};
-
-static int
-_IO_helper_overflow (fp, c)
- _IO_FILE *fp;
- int c;
-{
- _IO_FILE *target = ((struct helper_file*)fp)->_put_stream;
- int used = fp->_IO_write_ptr - fp->_IO_write_base;
- if (used)
- {
- _IO_sputn(target, fp->_IO_write_base, used);
- fp->_IO_write_ptr -= used;
- }
- return _IO_putc (c, fp);
-}
-
-static struct _IO_jump_t _IO_helper_jumps = {
- JUMP_INIT_DUMMY,
- JUMP_INIT(finish, _IO_default_finish),
- JUMP_INIT(overflow, _IO_helper_overflow),
- JUMP_INIT(underflow, _IO_default_underflow),
- JUMP_INIT(uflow, _IO_default_uflow),
- JUMP_INIT(pbackfail, _IO_default_pbackfail),
- JUMP_INIT(xsputn, _IO_default_xsputn),
- JUMP_INIT(xsgetn, _IO_default_xsgetn),
- JUMP_INIT(seekoff, _IO_default_seekoff),
- JUMP_INIT(seekpos, _IO_default_seekpos),
- JUMP_INIT(setbuf, _IO_default_setbuf),
- JUMP_INIT(sync, _IO_default_sync),
- JUMP_INIT(doallocate, _IO_default_doallocate),
- JUMP_INIT(read, _IO_default_read),
- JUMP_INIT(write, _IO_default_write),
- JUMP_INIT(seek, _IO_default_seek),
- JUMP_INIT(close, _IO_default_close),
- JUMP_INIT(stat, _IO_default_stat)
-};
-
-static int
-helper_vfprintf (fp, fmt0, ap)
- _IO_FILE *fp;
- char const *fmt0;
- _IO_va_list ap;
-{
- char buf[_IO_BUFSIZ];
- struct helper_file helper;
- register _IO_FILE *hp = (_IO_FILE*)&helper;
- int result, to_flush;
-
- /* initialize helper */
- helper._put_stream = fp;
- hp->_IO_write_base = buf;
- hp->_IO_write_ptr = buf;
- hp->_IO_write_end = buf+_IO_BUFSIZ;
- hp->_IO_file_flags = _IO_MAGIC|_IO_NO_READS;
- _IO_JUMPS(hp) = &_IO_helper_jumps;
-
- /* Now print to helper instead. */
- result = _IO_vfprintf(hp, fmt0, ap);
-
- /* Now flush anything from the helper to the fp. */
- if ((to_flush = hp->_IO_write_ptr - hp->_IO_write_base) > 0)
- {
- if (_IO_sputn(fp, hp->_IO_write_base, to_flush) != to_flush)
- return EOF;
- }
- return result;
-}
-
-#ifdef FLOATING_POINT
-
-#include "floatio.h"
-#define BUF (MAXEXP+MAXFRACT+1) /* + decimal point */
-#define DEFPREC 6
-extern double modf __P((double, double*));
-
-#else /* no FLOATING_POINT */
-
-#define BUF 40
-
-#endif /* FLOATING_POINT */
-
-
-/*
- * Macros for converting digits to letters and vice versa
- */
-#define to_digit(c) ((c) - '0')
-#define is_digit(c) ((unsigned)to_digit(c) <= 9)
-#define to_char(n) ((n) + '0')
-
-/*
- * Flags used during conversion.
- */
-#define LONGINT 0x01 /* long integer */
-#define LONGDBL 0x02 /* long double; unimplemented */
-#define SHORTINT 0x04 /* short integer */
-#define ALT 0x08 /* alternate form */
-#define LADJUST 0x10 /* left adjustment */
-#define ZEROPAD 0x20 /* zero (as opposed to blank) pad */
-#define HEXPREFIX 0x40 /* add 0x or 0X prefix */
-
-int
-_IO_vfprintf (fp, fmt0, ap)
- _IO_FILE *fp;
- char const *fmt0;
- _IO_va_list ap;
-{
- register const char *fmt; /* format string */
- register int ch; /* character from fmt */
- register int n; /* handy integer (short term usage) */
- register char *cp; /* handy char pointer (short term usage) */
- const char *fmark; /* for remembering a place in fmt */
- register int flags; /* flags as above */
- int ret; /* return value accumulator */
- int width; /* width from format (%8d), or 0 */
- int prec; /* precision from format (%.3d), or -1 */
- char sign; /* sign prefix (' ', '+', '-', or \0) */
-#ifdef FLOATING_POINT
- int softsign; /* temporary negative sign for floats */
- double _double; /* double precision arguments %[eEfgG] */
-#ifndef _IO_USE_DTOA
- int fpprec; /* `extra' floating precision in [eEfgG] */
-#endif
-#endif
- unsigned long _ulong; /* integer arguments %[diouxX] */
- enum { OCT, DEC, HEX } base;/* base for [diouxX] conversion */
- int dprec; /* a copy of prec if [diouxX], 0 otherwise */
- int dpad; /* extra 0 padding needed for integers */
- int fieldsz; /* field size expanded by sign, dpad etc */
- /* The initialization of 'size' is to suppress a warning that
- 'size' might be used unitialized. It seems gcc can't
- quite grok this spaghetti code ... */
- int size = 0; /* size of converted field or string */
- char buf[BUF]; /* space for %c, %[diouxX], %[eEfgG] */
- char ox[2]; /* space for 0x hex-prefix */
-
- /*
- * BEWARE, these `goto error' on error, and PAD uses `n'.
- */
-#define PRINT(ptr, len) \
- do { if (_IO_sputn(fp,ptr, len) != len) goto error; } while (0)
-#define PAD_SP(howmany) if (_IO_padn(fp, ' ', howmany) < (howmany)) goto error;
-#define PAD_0(howmany) if (_IO_padn(fp, '0', howmany) < (howmany)) goto error;
-
- /*
- * To extend shorts properly, we need both signed and unsigned
- * argument extraction methods.
- */
-#define SARG() \
- (flags&LONGINT ? va_arg(ap, long) : \
- flags&SHORTINT ? (long)(short)va_arg(ap, int) : \
- (long)va_arg(ap, int))
-#define UARG() \
- (flags&LONGINT ? va_arg(ap, unsigned long) : \
- flags&SHORTINT ? (unsigned long)(unsigned short)va_arg(ap, int) : \
- (unsigned long)va_arg(ap, unsigned int))
-
- /* optimise stderr (and other unbuffered Unix files) */
- if (fp->_IO_file_flags & _IO_UNBUFFERED)
- return helper_vfprintf(fp, fmt0, ap);
-
- fmt = fmt0;
- ret = 0;
-
- /*
- * Scan the format for conversions (`%' character).
- */
- for (;;) {
- for (fmark = fmt; (ch = *fmt) != '\0' && ch != '%'; fmt++)
- /* void */;
- if ((n = fmt - fmark) != 0) {
- PRINT(fmark, n);
- ret += n;
- }
- if (ch == '\0')
- goto done;
- fmt++; /* skip over '%' */
-
- flags = 0;
- dprec = 0;
-#if defined(FLOATING_POINT) && !defined (_IO_USE_DTOA)
- fpprec = 0;
-#endif
- width = 0;
- prec = -1;
- sign = '\0';
-
-rflag: ch = *fmt++;
-reswitch: switch (ch) {
- case ' ':
- /*
- * ``If the space and + flags both appear, the space
- * flag will be ignored.''
- * -- ANSI X3J11
- */
- if (!sign)
- sign = ' ';
- goto rflag;
- case '#':
- flags |= ALT;
- goto rflag;
- case '*':
- /*
- * ``A negative field width argument is taken as a
- * - flag followed by a positive field width.''
- * -- ANSI X3J11
- * They don't exclude field widths read from args.
- */
- if ((width = va_arg(ap, int)) >= 0)
- goto rflag;
- width = -width;
- /* FALLTHROUGH */
- case '-':
- flags |= LADJUST;
- flags &= ~ZEROPAD; /* '-' disables '0' */
- goto rflag;
- case '+':
- sign = '+';
- goto rflag;
- case '.':
- if ((ch = *fmt++) == '*') {
- n = va_arg(ap, int);
- prec = n < 0 ? -1 : n;
- goto rflag;
- }
- n = 0;
- while (is_digit(ch)) {
- n = 10 * n + to_digit(ch);
- ch = *fmt++;
- }
- prec = n < 0 ? -1 : n;
- goto reswitch;
- case '0':
- /*
- * ``Note that 0 is taken as a flag, not as the
- * beginning of a field width.''
- * -- ANSI X3J11
- */
- if (!(flags & LADJUST))
- flags |= ZEROPAD; /* '-' disables '0' */
- goto rflag;
- case '1': case '2': case '3': case '4':
- case '5': case '6': case '7': case '8': case '9':
- n = 0;
- do {
- n = 10 * n + to_digit(ch);
- ch = *fmt++;
- } while (is_digit(ch));
- width = n;
- goto reswitch;
-#ifdef FLOATING_POINT
- case 'L':
- flags |= LONGDBL;
- goto rflag;
-#endif
- case 'h':
- flags |= SHORTINT;
- goto rflag;
- case 'l':
- flags |= LONGINT;
- goto rflag;
- case 'c':
- *(cp = buf) = va_arg(ap, int);
- size = 1;
- sign = '\0';
- break;
- case 'D':
- flags |= LONGINT;
- /*FALLTHROUGH*/
- case 'd':
- case 'i':
- _ulong = SARG();
- if ((long)_ulong < 0) {
- _ulong = -_ulong;
- sign = '-';
- }
- base = DEC;
- goto number;
-#ifdef FLOATING_POINT
- case 'e':
- case 'E':
- case 'f':
- case 'F':
- case 'g':
- case 'G':
- _double = va_arg(ap, double);
-#ifdef _IO_USE_DTOA
- {
- int fmt_flags = 0;
- int fill = ' ';
- if (flags & ALT)
- fmt_flags |= _IO_SHOWPOINT;
- if (flags & LADJUST)
- fmt_flags |= _IO_LEFT;
- else if (flags & ZEROPAD)
- fmt_flags |= _IO_INTERNAL, fill = '0';
- n = _IO_outfloat(_double, fp, ch, width,
- prec < 0 ? DEFPREC : prec,
- fmt_flags, sign, fill);
- if (n < 0)
- goto error;
- ret += n;
- }
- /* CHECK ERROR! */
- continue;
-#else
- /*
- * don't do unrealistic precision; just pad it with
- * zeroes later, so buffer size stays rational.
- */
- if (prec > MAXFRACT) {
- if ((ch != 'g' && ch != 'G') || (flags&ALT))
- fpprec = prec - MAXFRACT;
- prec = MAXFRACT;
- } else if (prec == -1)
- prec = DEFPREC;
- /* __cvt_double may have to round up before the
- "start" of its buffer, i.e.
- ``intf("%.2f", (double)9.999);'';
- if the first character is still NUL, it did.
- softsign avoids negative 0 if _double < 0 but
- no significant digits will be shown. */
- cp = buf;
- *cp = '\0';
- size = __cvt_double(_double, prec, flags, &softsign,
- ch, cp, buf + sizeof(buf));
- if (softsign)
- sign = '-';
- if (*cp == '\0')
- cp++;
- break;
-#endif
-#endif /* FLOATING_POINT */
- case 'n':
- if (flags & LONGINT)
- *va_arg(ap, long *) = ret;
- else if (flags & SHORTINT)
- *va_arg(ap, short *) = ret;
- else
- *va_arg(ap, int *) = ret;
- continue; /* no output */
- case 'O':
- flags |= LONGINT;
- /*FALLTHROUGH*/
- case 'o':
- _ulong = UARG();
- base = OCT;
- goto nosign;
- case 'p':
- /*
- * ``The argument shall be a pointer to void. The
- * value of the pointer is converted to a sequence
- * of printable characters, in an implementation-
- * defined manner.''
- * -- ANSI X3J11
- */
- /* NOSTRICT */
- _ulong = (unsigned long)va_arg(ap, void *);
- base = HEX;
- flags |= HEXPREFIX;
- ch = 'x';
- goto nosign;
- case 's':
- if ((cp = va_arg(ap, char *)) == NULL)
- cp = "(null)";
- if (prec >= 0) {
- /*
- * can't use strlen; can only look for the
- * NUL in the first `prec' characters, and
- * strlen() will go further.
- */
- char *p = (char*)memchr(cp, 0, prec);
-
- if (p != NULL) {
- size = p - cp;
- if (size > prec)
- size = prec;
- } else
- size = prec;
- } else
- size = strlen(cp);
- sign = '\0';
- break;
- case 'U':
- flags |= LONGINT;
- /*FALLTHROUGH*/
- case 'u':
- _ulong = UARG();
- base = DEC;
- goto nosign;
- case 'X':
- case 'x':
- _ulong = UARG();
- base = HEX;
- /* leading 0x/X only if non-zero */
- if (flags & ALT && _ulong != 0)
- flags |= HEXPREFIX;
-
- /* unsigned conversions */
-nosign: sign = '\0';
- /*
- * ``... diouXx conversions ... if a precision is
- * specified, the 0 flag will be ignored.''
- * -- ANSI X3J11
- */
-number: if ((dprec = prec) >= 0)
- flags &= ~ZEROPAD;
-
- /*
- * ``The result of converting a zero value with an
- * explicit precision of zero is no characters.''
- * -- ANSI X3J11
- */
- cp = buf + BUF;
- if (_ulong != 0 || prec != 0) {
- char *xdigs; /* digits for [xX] conversion */
- /*
- * unsigned mod is hard, and unsigned mod
- * by a constant is easier than that by
- * a variable; hence this switch.
- */
- switch (base) {
- case OCT:
- do {
- *--cp = to_char(_ulong & 7);
- _ulong >>= 3;
- } while (_ulong);
- /* handle octal leading 0 */
- if (flags & ALT && *cp != '0')
- *--cp = '0';
- break;
-
- case DEC:
- /* many numbers are 1 digit */
- while (_ulong >= 10) {
- *--cp = to_char(_ulong % 10);
- _ulong /= 10;
- }
- *--cp = to_char(_ulong);
- break;
-
- case HEX:
- if (ch == 'X')
- xdigs = "0123456789ABCDEF";
- else /* ch == 'x' || ch == 'p' */
- xdigs = "0123456789abcdef";
- do {
- *--cp = xdigs[_ulong & 15];
- _ulong >>= 4;
- } while (_ulong);
- break;
-
- default:
- cp = "bug in vform: bad base";
- goto skipsize;
- }
- }
- size = buf + BUF - cp;
- skipsize:
- break;
- default: /* "%?" prints ?, unless ? is NUL */
- if (ch == '\0')
- goto done;
- /* pretend it was %c with argument ch */
- cp = buf;
- *cp = ch;
- size = 1;
- sign = '\0';
- break;
- }
-
- /*
- * All reasonable formats wind up here. At this point,
- * `cp' points to a string which (if not flags&LADJUST)
- * should be padded out to `width' places. If
- * flags&ZEROPAD, it should first be prefixed by any
- * sign or other prefix; otherwise, it should be blank
- * padded before the prefix is emitted. After any
- * left-hand padding and prefixing, emit zeroes
- * required by a decimal [diouxX] precision, then print
- * the string proper, then emit zeroes required by any
- * leftover floating precision; finally, if LADJUST,
- * pad with blanks.
- */
-
- /*
- * compute actual size, so we know how much to pad.
- */
-#if defined(FLOATING_POINT) && !defined (_IO_USE_DTOA)
- fieldsz = size + fpprec;
-#else
- fieldsz = size;
-#endif
- dpad = dprec - size;
- if (dpad < 0)
- dpad = 0;
-
- if (sign)
- fieldsz++;
- else if (flags & HEXPREFIX)
- fieldsz += 2;
- fieldsz += dpad;
-
- /* right-adjusting blank padding */
- if ((flags & (LADJUST|ZEROPAD)) == 0)
- PAD_SP(width - fieldsz);
-
- /* prefix */
- if (sign) {
- PRINT(&sign, 1);
- } else if (flags & HEXPREFIX) {
- ox[0] = '0';
- ox[1] = ch;
- PRINT(ox, 2);
- }
-
- /* right-adjusting zero padding */
- if ((flags & (LADJUST|ZEROPAD)) == ZEROPAD)
- PAD_0(width - fieldsz);
-
- /* leading zeroes from decimal precision */
- PAD_0(dpad);
-
- /* the string or number proper */
- PRINT(cp, size);
-
-#if defined(FLOATING_POINT) && !defined (_IO_USE_DTOA)
- /* trailing f.p. zeroes */
- PAD_0(fpprec);
-#endif
-
- /* left-adjusting padding (always blank) */
- if (flags & LADJUST)
- PAD_SP(width - fieldsz);
-
- /* finally, adjust ret */
- ret += width > fieldsz ? width : fieldsz;
-
- }
-done:
- return ret;
-error:
- return EOF;
- /* NOTREACHED */
-}
-
-#if defined(FLOATING_POINT) && !defined(_IO_USE_DTOA)
-
-static char *exponent(register char *p, register int exp, int fmtch)
-{
- register char *t;
- char expbuf[MAXEXP];
-
- *p++ = fmtch;
- if (exp < 0) {
- exp = -exp;
- *p++ = '-';
- }
- else
- *p++ = '+';
- t = expbuf + MAXEXP;
- if (exp > 9) {
- do {
- *--t = to_char(exp % 10);
- } while ((exp /= 10) > 9);
- *--t = to_char(exp);
- for (; t < expbuf + MAXEXP; *p++ = *t++);
- }
- else {
- *p++ = '0';
- *p++ = to_char(exp);
- }
- return (p);
-}
-
-static char * round(double fract, int *exp,
- register char *start, register char *end,
- char ch, int *signp)
-{
- double tmp;
-
- if (fract)
- (void)modf(fract * 10, &tmp);
- else
- tmp = to_digit(ch);
- if (tmp > 4)
- for (;; --end) {
- if (*end == '.')
- --end;
- if (++*end <= '9')
- break;
- *end = '0';
- if (end == start) {
- if (exp) { /* e/E; increment exponent */
- *end = '1';
- ++*exp;
- }
- else { /* f; add extra digit */
- *--end = '1';
- --start;
- }
- break;
- }
- }
- /* ``"%.3f", (double)-0.0004'' gives you a negative 0. */
- else if (*signp == '-')
- for (;; --end) {
- if (*end == '.')
- --end;
- if (*end != '0')
- break;
- if (end == start)
- *signp = 0;
- }
- return (start);
-}
-
-int __cvt_double(double number, register int prec, int flags, int *signp,
- int fmtch, char *startp, char *endp)
-{
- register char *p, *t;
- register double fract;
- int dotrim = 0, expcnt, gformat = 0;
- double integer, tmp;
-
- expcnt = 0;
- if (number < 0) {
- number = -number;
- *signp = '-';
- } else
- *signp = 0;
-
- fract = modf(number, &integer);
-
- /* get an extra slot for rounding. */
- t = ++startp;
-
- /*
- * get integer portion of number; put into the end of the buffer; the
- * .01 is added for modf(356.0 / 10, &integer) returning .59999999...
- */
- for (p = endp - 1; p >= startp && integer; ++expcnt) {
- tmp = modf(integer / 10, &integer);
- *p-- = to_char((int)((tmp + .01) * 10));
- }
- switch (fmtch) {
- case 'f':
- case 'F':
- /* reverse integer into beginning of buffer */
- if (expcnt)
- for (; ++p < endp; *t++ = *p);
- else
- *t++ = '0';
- /*
- * if precision required or alternate flag set, add in a
- * decimal point.
- */
- if (prec || flags&ALT)
- *t++ = '.';
- /* if requires more precision and some fraction left */
- if (fract) {
- if (prec)
- do {
- fract = modf(fract * 10, &tmp);
- *t++ = to_char((int)tmp);
- } while (--prec && fract);
- if (fract)
- startp = round(fract, (int *)NULL, startp,
- t - 1, (char)0, signp);
- }
- for (; prec--; *t++ = '0');
- break;
- case 'e':
- case 'E':
-eformat: if (expcnt) {
- *t++ = *++p;
- if (prec || flags&ALT)
- *t++ = '.';
- /* if requires more precision and some integer left */
- for (; prec && ++p < endp; --prec)
- *t++ = *p;
- /*
- * if done precision and more of the integer component,
- * round using it; adjust fract so we don't re-round
- * later.
- */
- if (!prec && ++p < endp) {
- fract = 0;
- startp = round((double)0, &expcnt, startp,
- t - 1, *p, signp);
- }
- /* adjust expcnt for digit in front of decimal */
- --expcnt;
- }
- /* until first fractional digit, decrement exponent */
- else if (fract) {
- /* adjust expcnt for digit in front of decimal */
- for (expcnt = -1;; --expcnt) {
- fract = modf(fract * 10, &tmp);
- if (tmp)
- break;
- }
- *t++ = to_char((int)tmp);
- if (prec || flags&ALT)
- *t++ = '.';
- }
- else {
- *t++ = '0';
- if (prec || flags&ALT)
- *t++ = '.';
- }
- /* if requires more precision and some fraction left */
- if (fract) {
- if (prec)
- do {
- fract = modf(fract * 10, &tmp);
- *t++ = to_char((int)tmp);
- } while (--prec && fract);
- if (fract)
- startp = round(fract, &expcnt, startp,
- t - 1, (char)0, signp);
- }
- /* if requires more precision */
- for (; prec--; *t++ = '0');
-
- /* unless alternate flag, trim any g/G format trailing 0's */
- if (gformat && !(flags&ALT)) {
- while (t > startp && *--t == '0');
- if (*t == '.')
- --t;
- ++t;
- }
- t = exponent(t, expcnt, fmtch);
- break;
- case 'g':
- case 'G':
- /* a precision of 0 is treated as a precision of 1. */
- if (!prec)
- ++prec;
- /*
- * ``The style used depends on the value converted; style e
- * will be used only if the exponent resulting from the
- * conversion is less than -4 or greater than the precision.''
- * -- ANSI X3J11
- */
- if (expcnt > prec || (!expcnt && fract && fract < .0001)) {
- /*
- * g/G format counts "significant digits, not digits of
- * precision; for the e/E format, this just causes an
- * off-by-one problem, i.e. g/G considers the digit
- * before the decimal point significant and e/E doesn't
- * count it as precision.
- */
- --prec;
- fmtch -= 2; /* G->E, g->e */
- gformat = 1;
- goto eformat;
- }
- /*
- * reverse integer into beginning of buffer,
- * note, decrement precision
- */
- if (expcnt)
- for (; ++p < endp; *t++ = *p, --prec);
- else
- *t++ = '0';
- /*
- * if precision required or alternate flag set, add in a
- * decimal point. If no digits yet, add in leading 0.
- */
- if (prec || flags&ALT) {
- dotrim = 1;
- *t++ = '.';
- }
- else
- dotrim = 0;
- /* if requires more precision and some fraction left */
- if (fract) {
- if (prec) {
- /* If no integer part, don't count initial
- * zeros as significant digits. */
- do {
- fract = modf(fract * 10, &tmp);
- *t++ = to_char((int)tmp);
- } while(!tmp && !expcnt);
- while (--prec && fract) {
- fract = modf(fract * 10, &tmp);
- *t++ = to_char((int)tmp);
- }
- }
- if (fract)
- startp = round(fract, (int *)NULL, startp,
- t - 1, (char)0, signp);
- }
- /* alternate format, adds 0's for precision, else trim 0's */
- if (flags&ALT)
- for (; prec--; *t++ = '0');
- else if (dotrim) {
- while (t > startp && *--t == '0');
- if (*t != '.')
- ++t;
- }
- }
- return (t - startp);
-}
-
-#endif /* defined(FLOATING_POINT) && !defined(_IO_USE_DTOA) */
diff --git a/contrib/libio/iovfscanf.c b/contrib/libio/iovfscanf.c
deleted file mode 100644
index 0631458f21ec..000000000000
--- a/contrib/libio/iovfscanf.c
+++ /dev/null
@@ -1,790 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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. */
-
-/*
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms are permitted
- * provided that the above copyright notice and this paragraph are
- * duplicated in all such forms and that any documentation,
- * advertising materials, and other materials related to such
- * distribution and use acknowledge that the software was developed
- * by the University of California, Berkeley. The name of the
- * University may not be used to endorse or promote products derived
- * from this software without specific prior written permission.
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- */
-
-/* Extensively hacked for GNU iostream by Per Bothner 1991, 1992, 1993.
- Changes copyright Free Software Foundation 1992, 1993. */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "%W% (Berkeley) %G%";
-#endif /* LIBC_SCCS and not lint */
-
-#include <libioP.h>
-#include <ctype.h>
-#ifdef __STDC__
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
-
-#ifndef NO_FLOATING_POINT
-#define FLOATING_POINT
-#endif
-
-#ifdef FLOATING_POINT
-#include "floatio.h"
-#define BUF (MAXEXP+MAXFRACT+3) /* 3 = sign + decimal point + NUL */
-#else
-#define BUF 40
-#endif
-
-/*
- * Flags used during conversion.
- */
-#define LONG 0x01 /* l: long or double */
-#define LONGDBL 0x02 /* L: long double; unimplemented */
-#define SHORT 0x04 /* h: short */
-#define SUPPRESS 0x08 /* suppress assignment */
-#define POINTER 0x10 /* weird %p pointer (`fake hex') */
-#define NOSKIP 0x20 /* do not skip blanks */
-#define WIDTH 0x40 /* width */
-
-/*
- * The following are used in numeric conversions only:
- * SIGNOK, NDIGITS, DPTOK, and EXPOK are for floating point;
- * SIGNOK, NDIGITS, PFXOK, and NZDIGITS are for integral.
- */
-#define SIGNOK 0x40 /* +/- is (still) legal */
-#define NDIGITS 0x80 /* no digits detected */
-
-#define DPTOK 0x100 /* (float) decimal point is still legal */
-#define EXPOK 0x200 /* (float) exponent (e+3, etc) still legal */
-
-#define PFXOK 0x100 /* 0x prefix is (still) legal */
-#define NZDIGITS 0x200 /* no zero digits detected */
-
-/*
- * Conversion types.
- */
-#define CT_CHAR 0 /* %c conversion */
-#define CT_CCL 1 /* %[...] conversion */
-#define CT_STRING 2 /* %s conversion */
-#define CT_INT 3 /* integer, i.e., strtol or strtoul */
-#define CT_FLOAT 4 /* floating, i.e., strtod */
-
-#define u_char unsigned char
-#define u_long unsigned long
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-extern u_long strtoul __P((const char*, char**, int));
-extern long strtol __P((const char*, char**, int));
-static const u_char *__sccl __P((char *tab, const u_char *fmt));
-#ifndef _IO_USE_DTOA
-extern double atof();
-#endif
-#ifdef __cplusplus
-}
-#endif
-
-/* If errp != NULL, *errp|=1 if we see a premature EOF;
- *errp|=2 if we an invalid character. */
-
-int
-_IO_vfscanf (fp, fmt0, ap, errp)
- _IO_FILE *fp;
- char const *fmt0;
- _IO_va_list ap;
- int *errp;
-{
- register const u_char *fmt = (const u_char *)fmt0;
- register int c; /* character from format, or conversion */
- register _IO_ssize_t width; /* field width, or 0 */
- register char *p; /* points into all kinds of strings */
- register int n; /* handy integer */
- register int flags = 0; /* flags as defined above */
- register char *p0; /* saves original value of p when necessary */
- int nassigned; /* number of fields assigned */
- int nread; /* number of characters consumed from fp */
- /* Assignments to base and ccfn are just to suppress warnings from gcc.*/
- int base = 0; /* base argument to strtol/strtoul */
- typedef u_long (*strtoulfn) __P((const char*, char**, int));
- strtoulfn ccfn = 0;
- /* conversion function (strtol/strtoul) */
- char ccltab[256]; /* character class table for %[...] */
- char buf[BUF]; /* buffer for numeric conversions */
- int seen_eof = 0;
-
- /* `basefix' is used to avoid `if' tests in the integer scanner */
- static short basefix[17] =
- { 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 };
-
- nassigned = 0;
- nread = 0;
- for (;;) {
- c = *fmt++;
- if (c == 0)
- goto done;
- if (isspace(c)) {
- for (;;) {
- c = _IO_getc(fp);
- if (c == EOF) {
- seen_eof++;
- break;
- }
- if (!isspace(c)) {
- _IO_ungetc (c, fp);
- break;
- }
- nread++;
- }
- continue;
- }
- if (c != '%')
- goto literal;
- width = 0;
- flags = 0;
- /*
- * switch on the format. continue if done;
- * break once format type is derived.
- */
-again: c = *fmt++;
- switch (c) {
- case '%':
-literal:
- n = _IO_getc(fp);
- if (n == EOF)
- goto eof_failure;
- if (n != c) {
- _IO_ungetc (n, fp);
- goto match_failure;
- }
- nread++;
- continue;
-
- case '*':
- if (flags) goto control_failure;
- flags = SUPPRESS;
- goto again;
- case 'l':
- if (flags & ~(SUPPRESS | WIDTH)) goto control_failure;
- flags |= LONG;
- goto again;
- case 'L':
- if (flags & ~(SUPPRESS | WIDTH)) goto control_failure;
- flags |= LONGDBL;
- goto again;
- case 'h':
- if (flags & ~(SUPPRESS | WIDTH)) goto control_failure;
- flags |= SHORT;
- goto again;
-
- case '0': case '1': case '2': case '3': case '4':
- case '5': case '6': case '7': case '8': case '9':
- if (flags & ~(SUPPRESS | WIDTH)) goto control_failure;
- flags |= WIDTH;
- width = width * 10 + c - '0';
- goto again;
-
- /*
- * Conversions.
- * Those marked `compat' are for 4.[123]BSD compatibility.
- *
- * (According to ANSI, E and X formats are supposed
- * to the same as e and x. Sorry about that.)
- */
- case 'D': /* compat */
- flags |= LONG;
- /* FALLTHROUGH */
- case 'd':
- c = CT_INT;
- ccfn = (strtoulfn)strtol;
- base = 10;
- break;
-
- case 'i':
- c = CT_INT;
- ccfn = (strtoulfn)strtol;
- base = 0;
- break;
-
- case 'O': /* compat */
- flags |= LONG;
- /* FALLTHROUGH */
- case 'o':
- c = CT_INT;
- ccfn = strtoul;
- base = 8;
- break;
-
- case 'u':
- c = CT_INT;
- ccfn = strtoul;
- base = 10;
- break;
-
- case 'X':
- case 'x':
- flags |= PFXOK; /* enable 0x prefixing */
- c = CT_INT;
- ccfn = strtoul;
- base = 16;
- break;
-
-#ifdef FLOATING_POINT
- case 'E': case 'F':
- case 'e': case 'f': case 'g':
- c = CT_FLOAT;
- break;
-#endif
-
- case 's':
- c = CT_STRING;
- break;
-
- case '[':
- fmt = __sccl(ccltab, fmt);
- flags |= NOSKIP;
- c = CT_CCL;
- break;
-
- case 'c':
- flags |= NOSKIP;
- c = CT_CHAR;
- break;
-
- case 'p': /* pointer format is like hex */
- flags |= POINTER | PFXOK;
- c = CT_INT;
- ccfn = strtoul;
- base = 16;
- break;
-
- case 'n':
- if (flags & SUPPRESS) /* ??? */
- continue;
- if (flags & SHORT)
- *va_arg(ap, short *) = nread;
- else if (flags & LONG)
- *va_arg(ap, long *) = nread;
- else
- *va_arg(ap, int *) = nread;
- continue;
-
- /*
- * Disgusting backwards compatibility hacks. XXX
- */
- case '\0': /* compat */
- nassigned = EOF;
- goto done;
-
- default: /* compat */
- if (isupper(c))
- flags |= LONG;
- c = CT_INT;
- ccfn = (strtoulfn)strtol;
- base = 10;
- break;
- }
-
- /*
- * We have a conversion that requires input.
- */
- if (_IO_peekc(fp) == EOF)
- goto eof_failure;
-
- /*
- * Consume leading white space, except for formats
- * that suppress this.
- */
- if ((flags & NOSKIP) == 0) {
- n = (unsigned char)*fp->_IO_read_ptr;
- while (isspace(n)) {
- fp->_IO_read_ptr++;
- nread++;
- n = _IO_peekc(fp);
- if (n == EOF)
- goto eof_failure;
- }
- /* Note that there is at least one character in
- the buffer, so conversions that do not set NOSKIP
- can no longer result in an input failure. */
- }
-
- /*
- * Do the conversion.
- */
- switch (c) {
-
- case CT_CHAR:
- /* scan arbitrary characters (sets NOSKIP) */
- if (width == 0) /* FIXME! */
- width = 1;
- if (flags & SUPPRESS) {
- _IO_size_t sum = 0;
- for (;;) {
- n = fp->_IO_read_end - fp->_IO_read_ptr;
- if (n < (int)width) {
- sum += n;
- width -= n;
- fp->_IO_read_ptr += n;
- if (__underflow(fp) == EOF)
- if (sum == 0)
- goto eof_failure;
- else {
- seen_eof++;
- break;
- }
- } else {
- sum += width;
- fp->_IO_read_ptr += width;
- break;
- }
- }
- nread += sum;
- } else {
- _IO_size_t r =
-
- _IO_XSGETN (fp, (char*)va_arg(ap, char*), width);
- if (r != width)
- goto eof_failure;
- nread += r;
- nassigned++;
- }
- break;
-
- case CT_CCL:
- /* scan a (nonempty) character class (sets NOSKIP) */
- if (width == 0)
- width = ~0; /* `infinity' */
- /* take only those things in the class */
- if (flags & SUPPRESS) {
- n = 0;
- while (ccltab[(unsigned char)*fp->_IO_read_ptr]) {
- n++, fp->_IO_read_ptr++;
- if (--width == 0)
- break;
- if (_IO_peekc(fp) == EOF) {
- if (n == 0)
- goto eof_failure;
- seen_eof++;
- break;
- }
- }
- if (n == 0)
- goto match_failure;
- } else {
- p0 = p = va_arg(ap, char *);
- while (ccltab[(unsigned char)*fp->_IO_read_ptr]) {
- *p++ = *fp->_IO_read_ptr++;
- if (--width == 0)
- break;
- if (_IO_peekc(fp) == EOF) {
- if (p == p0)
- goto eof_failure;
- seen_eof++;
- break;
- }
- }
- n = p - p0;
- if (n == 0)
- goto match_failure;
- *p = 0;
- nassigned++;
- }
- nread += n;
- break;
-
- case CT_STRING:
- /* like CCL, but zero-length string OK, & no NOSKIP */
- if (width == 0)
- width = ~0;
- if (flags & SUPPRESS) {
- n = 0;
- while (!isspace((unsigned char)*fp->_IO_read_ptr)) {
- n++, fp->_IO_read_ptr++;
- if (--width == 0)
- break;
- if (_IO_peekc(fp) == EOF) {
- seen_eof++;
- break;
- }
- }
- nread += n;
- } else {
- p0 = p = va_arg(ap, char *);
- while (!isspace((unsigned char)*fp->_IO_read_ptr)) {
- *p++ = *fp->_IO_read_ptr++;
- if (--width == 0)
- break;
- if (_IO_peekc(fp) == EOF) {
- seen_eof++;
- break;
- }
- }
- *p = 0;
- nread += p - p0;
- nassigned++;
- }
- continue;
-
- case CT_INT:
- /* scan an integer as if by strtol/strtoul */
- if (width == 0 || width > sizeof(buf) - 1)
- width = sizeof(buf) - 1;
- flags |= SIGNOK | NDIGITS | NZDIGITS;
- for (p = buf; width; width--) {
- c = (unsigned char)*fp->_IO_read_ptr;
- /*
- * Switch on the character; `goto ok'
- * if we accept it as a part of number.
- */
- switch (c) {
-
- /*
- * The digit 0 is always legal, but is
- * special. For %i conversions, if no
- * digits (zero or nonzero) have been
- * scanned (only signs), we will have
- * base==0. In that case, we should set
- * it to 8 and enable 0x prefixing.
- * Also, if we have not scanned zero digits
- * before this, do not turn off prefixing
- * (someone else will turn it off if we
- * have scanned any nonzero digits).
- */
- case '0':
- if (base == 0) {
- base = 8;
- flags |= PFXOK;
- }
- if (flags & NZDIGITS)
- flags &= ~(SIGNOK|NZDIGITS|NDIGITS);
- else
- flags &= ~(SIGNOK|PFXOK|NDIGITS);
- goto ok;
-
- /* 1 through 7 always legal */
- case '1': case '2': case '3':
- case '4': case '5': case '6': case '7':
- base = basefix[base];
- flags &= ~(SIGNOK | PFXOK | NDIGITS);
- goto ok;
-
- /* digits 8 and 9 ok iff decimal or hex */
- case '8': case '9':
- base = basefix[base];
- if (base <= 8)
- break; /* not legal here */
- flags &= ~(SIGNOK | PFXOK | NDIGITS);
- goto ok;
-
- /* letters ok iff hex */
- case 'A': case 'B': case 'C':
- case 'D': case 'E': case 'F':
- case 'a': case 'b': case 'c':
- case 'd': case 'e': case 'f':
- /* no need to fix base here */
- if (base <= 10)
- break; /* not legal here */
- flags &= ~(SIGNOK | PFXOK | NDIGITS);
- goto ok;
-
- /* sign ok only as first character */
- case '+': case '-':
- if (flags & SIGNOK) {
- flags &= ~SIGNOK;
- goto ok;
- }
- break;
-
- /* x ok iff flag still set & 2nd char */
- case 'x': case 'X':
- if (flags & PFXOK && p == buf + 1) {
- base = 16; /* if %i */
- flags &= ~PFXOK;
- goto ok;
- }
- break;
- }
-
- /*
- * If we got here, c is not a legal character
- * for a number. Stop accumulating digits.
- */
- break;
- ok:
- /*
- * c is legal: store it and look at the next.
- */
- *p++ = c;
- fp->_IO_read_ptr++;
- if (_IO_peekc(fp) == EOF) {
- seen_eof++;
- break; /* EOF */
- }
- }
- /*
- * If we had only a sign, it is no good; push
- * back the sign. If the number ends in `x',
- * it was [sign] '0' 'x', so push back the x
- * and treat it as [sign] '0'.
- */
- if (flags & NDIGITS) {
- if (p > buf)
- (void) _IO_ungetc(*(u_char *)--p, fp);
- goto match_failure;
- }
- c = ((u_char *)p)[-1];
- if (c == 'x' || c == 'X') {
- --p;
- (void) _IO_ungetc (c, fp);
- }
- if ((flags & SUPPRESS) == 0) {
- u_long res;
-
- *p = 0;
- res = (*ccfn)(buf, (char **)NULL, base);
- if (flags & POINTER)
- *va_arg(ap, void **) = (void *)res;
- else if (flags & SHORT)
- *va_arg(ap, short *) = res;
- else if (flags & LONG)
- *va_arg(ap, long *) = res;
- else
- *va_arg(ap, int *) = res;
- nassigned++;
- }
- nread += p - buf;
- break;
-
-#ifdef FLOATING_POINT
- case CT_FLOAT:
- /* scan a floating point number as if by strtod */
- if (width == 0 || width > sizeof(buf) - 1)
- width = sizeof(buf) - 1;
- flags |= SIGNOK | NDIGITS | DPTOK | EXPOK;
- for (p = buf; width; width--) {
- c = (unsigned char)*fp->_IO_read_ptr;
- /*
- * This code mimicks the integer conversion
- * code, but is much simpler.
- */
- switch (c) {
-
- case '0': case '1': case '2': case '3':
- case '4': case '5': case '6': case '7':
- case '8': case '9':
- flags &= ~(SIGNOK | NDIGITS);
- goto fok;
-
- case '+': case '-':
- if (flags & SIGNOK) {
- flags &= ~SIGNOK;
- goto fok;
- }
- break;
- case '.':
- if (flags & DPTOK) {
- flags &= ~(SIGNOK | DPTOK);
- goto fok;
- }
- break;
- case 'e': case 'E':
- /* no exponent without some digits */
- if ((flags&(NDIGITS|EXPOK)) == EXPOK) {
- flags =
- (flags & ~(EXPOK|DPTOK)) |
- SIGNOK | NDIGITS;
- goto fok;
- }
- break;
- }
- break;
- fok:
- *p++ = c;
- fp->_IO_read_ptr++;
- if (_IO_peekc(fp) == EOF) {
- seen_eof++;
- break; /* EOF */
- }
- }
- /*
- * If no digits, might be missing exponent digits
- * (just give back the exponent) or might be missing
- * regular digits, but had sign and/or decimal point.
- */
- if (flags & NDIGITS) {
- if (flags & EXPOK) {
- /* no digits at all */
- while (p > buf)
- _IO_ungetc (*(u_char *)--p, fp);
- goto match_failure;
- }
- /* just a bad exponent (e and maybe sign) */
- c = *(u_char *)--p;
- if (c != 'e' && c != 'E') {
- (void) _IO_ungetc (c, fp);/* sign */
- c = *(u_char *)--p;
- }
- (void) _IO_ungetc (c, fp);
- }
- if ((flags & SUPPRESS) == 0) {
- double res;
- *p = 0;
-#ifdef _IO_USE_DTOA
- res = _IO_strtod(buf, NULL);
-#else
- res = atof(buf);
-#endif
- if (flags & LONG)
- *va_arg(ap, double *) = res;
- else
- *va_arg(ap, float *) = res;
- nassigned++;
- }
- nread += p - buf;
- break;
-#endif /* FLOATING_POINT */
- }
- }
-eof_failure:
- seen_eof++;
-input_failure:
- if (nassigned == 0)
- nassigned = -1;
-control_failure:
-match_failure:
- if (errp)
- *errp |= 2;
-done:
- if (errp && seen_eof)
- *errp |= 1;
- return (nassigned);
-}
-
-/*
- * Fill in the given table from the scanset at the given format
- * (just after `['). Return a pointer to the character past the
- * closing `]'. The table has a 1 wherever characters should be
- * considered part of the scanset.
- */
-static const u_char *
-__sccl (tab, fmt)
- char *tab;
- const u_char *fmt;
-{
- register int c, n, v;
-
- /* first `clear' the whole table */
- c = *fmt++; /* first char hat => negated scanset */
- if (c == '^') {
- v = 1; /* default => accept */
- c = *fmt++; /* get new first char */
- } else
- v = 0; /* default => reject */
- /* should probably use memset here */
- for (n = 0; n < 256; n++)
- tab[n] = v;
- if (c == 0)
- return (fmt - 1);/* format ended before closing ] */
-
- /*
- * Now set the entries corresponding to the actual scanset
- * to the opposite of the above.
- *
- * The first character may be ']' (or '-') without being special;
- * the last character may be '-'.
- */
- v = 1 - v;
- for (;;) {
- tab[c] = v; /* take character c */
-doswitch:
- n = *fmt++; /* and examine the next */
- switch (n) {
-
- case 0: /* format ended too soon */
- return (fmt - 1);
-
- case '-':
- /*
- * A scanset of the form
- * [01+-]
- * is defined as `the digit 0, the digit 1,
- * the character +, the character -', but
- * the effect of a scanset such as
- * [a-zA-Z0-9]
- * is implementation defined. The V7 Unix
- * scanf treats `a-z' as `the letters a through
- * z', but treats `a-a' as `the letter a, the
- * character -, and the letter a'.
- *
- * For compatibility, the `-' is not considerd
- * to define a range if the character following
- * it is either a close bracket (required by ANSI)
- * or is not numerically greater than the character
- * we just stored in the table (c).
- */
- n = *fmt;
- if (n == ']' || n < c) {
- c = '-';
- break; /* resume the for(;;) */
- }
- fmt++;
- do { /* fill in the range */
- tab[++c] = v;
- } while (c < n);
-#if 1 /* XXX another disgusting compatibility hack */
- /*
- * Alas, the V7 Unix scanf also treats formats
- * such as [a-c-e] as `the letters a through e'.
- * This too is permitted by the standard....
- */
- goto doswitch;
-#else
- c = *fmt++;
- if (c == 0)
- return (fmt - 1);
- if (c == ']')
- return (fmt);
-#endif
- break;
-
- case ']': /* end of scanset */
- return (fmt);
-
- default: /* just another character */
- c = n;
- break;
- }
- }
- /* NOTREACHED */
-}
diff --git a/contrib/libio/iovsprintf.c b/contrib/libio/iovsprintf.c
deleted file mode 100644
index 617a5888405d..000000000000
--- a/contrib/libio/iovsprintf.c
+++ /dev/null
@@ -1,60 +0,0 @@
-/* Copyright (C) 1993, 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 "strfile.h"
-
-int
-_IO_vsprintf (string, format, args)
- char *string;
- const char *format;
- _IO_va_list args;
-{
- _IO_strfile sf;
-#ifdef _IO_MTSAFE_IO
- _IO_lock_t lock;
-#endif
- int ret;
-
-#ifdef _IO_MTSAFE_IO
- sf._sbf._f._lock = &lock;
-#endif
- _IO_init (&sf._sbf._f, 0);
- _IO_JUMPS (&sf._sbf._f) = &_IO_str_jumps;
- _IO_str_init_static (&sf._sbf._f, string, -1, string);
- _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, &sf);
- _IO_flockfile (&sf._sbf._f);
- ret = _IO_vfprintf (&sf._sbf._f, format, args);
- _IO_putc_unlocked ('\0', &sf._sbf._f);
- _IO_cleanup_region_end (1);
- return ret;
-}
-
-#ifdef weak_alias
-weak_alias (_IO_vsprintf, vsprintf)
-#elif defined(_G_STDIO_USES_LIBIO) && defined(_G_HAVE_WEAK_SYMBOL)
-int vsprintf (char *, const char *, _IO_va_list)
- __attribute__ ((weak, alias("_IO_vsprintf")));
-#endif
diff --git a/contrib/libio/iovsscanf.c b/contrib/libio/iovsscanf.c
deleted file mode 100644
index 6bdc3ccf0182..000000000000
--- a/contrib/libio/iovsscanf.c
+++ /dev/null
@@ -1,59 +0,0 @@
-/* Copyright (C) 1993, 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 "strfile.h"
-
-int
-_IO_vsscanf (string, format, args)
- const char *string;
- const char *format;
- _IO_va_list args;
-{
- int ret;
- _IO_strfile sf;
-#ifdef _IO_MTSAFE_IO
- _IO_lock_t lock;
- sf._sbf._f._lock = &lock;
-#endif
- _IO_init (&sf._sbf._f, 0);
- _IO_JUMPS (&sf._sbf._f) = &_IO_str_jumps;
- _IO_str_init_static (&sf._sbf._f, (char*)string, 0, NULL);
- _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, &sf);
- _IO_flockfile (&sf._sbf._f);
- ret = _IO_vfscanf (&sf._sbf._f, format, args, NULL);
- _IO_cleanup_region_end (1);
- return ret;
-}
-
-#ifdef weak_alias
-weak_alias (_IO_vsscanf, __vsscanf)
-weak_alias (_IO_vsscanf, vsscanf)
-#elif defined(_G_STDIO_USES_LIBIO) && defined(_G_HAVE_WEAK_SYMBOL)
-int __vsscanf (const char *, const char *, _IO_va_list)
- __attribute__ ((weak, alias("_IO_vsscanf")));
-int vsscanf (const char *, const char *, _IO_va_list)
- __attribute__ ((weak, alias("_IO_vsscanf")));
-#endif
diff --git a/contrib/libio/isgetline.cc b/contrib/libio/isgetline.cc
deleted file mode 100644
index 5e48a000c09a..000000000000
--- a/contrib/libio/isgetline.cc
+++ /dev/null
@@ -1,153 +0,0 @@
-/* This is part of libio/iostream, providing -*- C++ -*- input/output.
-Copyright (C) 1993 Free Software Foundation
-
-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 "iostream.h"
-#include <string.h>
-
-istream& istream::getline(char* buf, int len, char delim)
-{
- _gcount = 0;
- if (len <= 0)
- {
- set(ios::failbit);
- return *this;
- }
- int ch;
- if (ipfx1())
- {
- _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile,
- _strbuf);
- streambuf *sb = rdbuf();
- _gcount = _IO_getline_info(sb, buf, len - 1, delim, -1, &ch);
- if (ch != EOF)
- ch = sb->sbumpc();
- if (ch == EOF)
- set (_gcount == 0 ? (ios::failbit|ios::eofbit) : ios::eofbit);
- else if (ch != (unsigned char) delim)
- {
- set(ios::failbit);
- sb->sungetc(); // Leave delimiter unread.
- }
- isfx();
- _IO_cleanup_region_end (0);
- }
- else
- ch = EOF;
- buf[_gcount] = '\0';
- if (ch == (unsigned char)delim)
- _gcount++; // The delimiter is counted in the gcount().
- return *this;
-}
-
-istream& istream::get(char* buf, int len, char delim)
-{
- _gcount = 0;
- if (len <= 0)
- {
- set(ios::failbit);
- return *this;
- }
- if (ipfx1())
- {
- _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile,
- _strbuf);
- streambuf *sbuf = rdbuf();
- int ch;
- _gcount = _IO_getline_info(sbuf, buf, len - 1, delim, -1, &ch);
- if (_gcount == 0 && ch == EOF)
- set(ios::failbit|ios::eofbit);
- isfx();
- _IO_cleanup_region_end (0);
- }
- buf[_gcount] = '\0';
- return *this;
-}
-
-
-// from Doug Schmidt
-
-#define CHUNK_SIZE 512
-
-/* Reads an arbitrarily long input line terminated by a user-specified
- TERMINATOR. Super-nifty trick using recursion avoids unnecessary calls
- to NEW! */
-
-char *_sb_readline (streambuf *sb, long& total, char terminator)
-{
- char buf[CHUNK_SIZE];
- char *ptr;
- int ch;
-
- _IO_size_t count = _IO_getline_info(sb, buf, CHUNK_SIZE, terminator,
- -1, &ch);
- if (ch != EOF)
- ch = sb->sbumpc();
- long old_total = total;
- total += count;
- if (ch != EOF && ch != terminator) {
- total++; // Include ch in total.
- ptr = _sb_readline(sb, total, terminator);
- if (ptr) {
- memcpy(ptr + old_total, buf, count);
- ptr[old_total+count] = ch;
- }
- return ptr;
- }
-
- ptr = new char[total+1];
- if (ptr != NULL) {
- ptr[total] = '\0';
- memcpy(ptr + total - count, buf, count);
- }
- return ptr;
-}
-
-/* Reads an arbitrarily long input line terminated by TERMINATOR.
- This routine allocates its own memory, so the user should
- only supply the address of a (char *). */
-
-istream& istream::gets(char **s, char delim /* = '\n' */)
-{
- if (ipfx1()) {
- _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile,
- _strbuf);
- long size = 0;
- streambuf *sb = rdbuf();
- *s = _sb_readline (sb, size, delim);
- _gcount = *s ? size : 0;
- if (sb->_flags & _IO_EOF_SEEN) {
- set(ios::eofbit);
- if (_gcount == 0)
- set(ios::failbit);
- }
- isfx();
- _IO_cleanup_region_end (0);
- }
- else {
- _gcount = 0;
- *s = NULL;
- }
- return *this;
-}
diff --git a/contrib/libio/isgetsb.cc b/contrib/libio/isgetsb.cc
deleted file mode 100644
index 655c972589ab..000000000000
--- a/contrib/libio/isgetsb.cc
+++ /dev/null
@@ -1,63 +0,0 @@
-/* This is part of libio/iostream, providing -*- C++ -*- input/output.
-Copyright (C) 1993 Free Software Foundation
-
-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 "iostream.h"
-#include <string.h>
-
-istream& istream::get(streambuf& sb, char delim /* = '\n' */)
-{
- _gcount = 0;
- if (ipfx1())
- {
- _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile,
- _strbuf);
- register streambuf* isb = rdbuf();
- for (;;)
- {
- streamsize len = isb->_IO_read_end - isb->_IO_read_ptr;
- if (len <= 0)
- if (__underflow(isb) == EOF)
- break;
- else
- len = isb->_IO_read_end - isb->_IO_read_ptr;
- char *delimp = (char*)memchr((void*)isb->_IO_read_ptr, delim, len);
- if (delimp != NULL)
- len = delimp - isb->_IO_read_ptr;
- int written = sb.sputn(isb->_IO_read_ptr, len);
- isb->_IO_read_ptr += written;
- _gcount += written;
- if (written != len)
- {
- set(ios::failbit);
- break;
- }
- if (delimp != NULL)
- break;
- }
- isfx();
- _IO_cleanup_region_end (0);
- }
- return *this;
-}
diff --git a/contrib/libio/isscan.cc b/contrib/libio/isscan.cc
deleted file mode 100644
index 977559c2cba5..000000000000
--- a/contrib/libio/isscan.cc
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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 <iostream.h>
-#include <stdarg.h>
-
-istream& istream::scan(const char *format ...)
-{
- if (ipfx0()) {
- _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile,
- _strbuf);
- va_list ap;
- va_start(ap, format);
- _strbuf->vscan(format, ap, this);
- va_end(ap);
- isfx();
- _IO_cleanup_region_end (0);
- }
- return *this;
-}
-
-istream& istream::vscan(const char *format, _IO_va_list args)
-{
- if (ipfx0())
- {
- _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile,
- _strbuf);
- _strbuf->vscan(format, args, this);
- isfx();
- _IO_cleanup_region_end (0);
- }
- return *this;
-}
diff --git a/contrib/libio/istream.h b/contrib/libio/istream.h
deleted file mode 100644
index f54ec1de9a1c..000000000000
--- a/contrib/libio/istream.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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 <stream.h>
diff --git a/contrib/libio/libio.h b/contrib/libio/libio.h
deleted file mode 100644
index c453b77bf30d..000000000000
--- a/contrib/libio/libio.h
+++ /dev/null
@@ -1,365 +0,0 @@
-/* Copyright (C) 1991, 92, 93, 94, 95, 97, 98 Free Software Foundation, Inc.
- This file is part of the GNU IO Library.
- Written by Per Bothner <bothner@cygnus.com>.
-
- 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. */
-
-#ifndef _IO_STDIO_H
-#define _IO_STDIO_H
-
-#include <_G_config.h>
-#define _IO_pos_t _G_fpos_t /* obsolete */
-#define _IO_fpos_t _G_fpos_t
-#define _IO_size_t _G_size_t
-#define _IO_ssize_t _G_ssize_t
-#define _IO_off_t _G_off_t
-#define _IO_pid_t _G_pid_t
-#define _IO_uid_t _G_uid_t
-#define _IO_HAVE_SYS_WAIT _G_HAVE_SYS_WAIT
-#define _IO_HAVE_ST_BLKSIZE _G_HAVE_ST_BLKSIZE
-#define _IO_BUFSIZ _G_BUFSIZ
-#define _IO_va_list _G_va_list
-#if defined(_G_IO_IO_FILE_VERSION) && _G_IO_IO_FILE_VERSION == 0x20001
-#define _IO_fpos64_t _G_fpos64_t
-#define _IO_off64_t _G_off64_t
-#endif
-
-#ifdef _G_NEED_STDARG_H
-/* This define avoids name pollution if we're using GNU stdarg.h */
-# define __need___va_list
-# include <stdarg.h>
-# ifdef __GNUC_VA_LIST
-# undef _IO_va_list
-# define _IO_va_list __gnuc_va_list
-# endif /* __GNUC_VA_LIST */
-#endif
-
-#ifndef __P
-# if _G_HAVE_SYS_CDEFS
-# include <sys/cdefs.h>
-# else
-# ifdef __STDC__
-# define __P(p) p
-# else
-# define __P(p) ()
-# endif
-# endif
-#endif /*!__P*/
-
-#ifndef __PMT
-# ifdef __STDC__
-# define __PMT(p) p
-# else
-# define __PMT(p) ()
-# endif
-#endif /*!__P*/
-
-/* For backward compatibility */
-#ifndef _PARAMS
-# define _PARAMS(protos) __P(protos)
-#endif /*!_PARAMS*/
-
-#ifndef __STDC__
-# define const
-#endif
-#define _IO_UNIFIED_JUMPTABLES 1
-#if !_G_HAVE_PRINTF_FP
-# define _IO_USE_DTOA 1
-#endif
-
-#ifndef EOF
-# define EOF (-1)
-#endif
-#ifndef NULL
-# if defined __GNUG__ && \
- (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8))
-# define NULL (__null)
-# else
-# if !defined(__cplusplus)
-# define NULL ((void*)0)
-# else
-# define NULL (0)
-# endif
-# endif
-#endif
-
-#define _IOS_INPUT 1
-#define _IOS_OUTPUT 2
-#define _IOS_ATEND 4
-#define _IOS_APPEND 8
-#define _IOS_TRUNC 16
-#define _IOS_NOCREATE 32
-#define _IOS_NOREPLACE 64
-#define _IOS_BIN 128
-
-/* Magic numbers and bits for the _flags field.
- The magic numbers use the high-order bits of _flags;
- the remaining bits are available for variable flags.
- Note: The magic numbers must all be negative if stdio
- emulation is desired. */
-
-#define _IO_MAGIC 0xFBAD0000 /* Magic number */
-#define _OLD_STDIO_MAGIC 0xFABC0000 /* Emulate old stdio. */
-#define _IO_MAGIC_MASK 0xFFFF0000
-#define _IO_USER_BUF 1 /* User owns buffer; don't delete it on close. */
-#define _IO_UNBUFFERED 2
-#define _IO_NO_READS 4 /* Reading not allowed */
-#define _IO_NO_WRITES 8 /* Writing not allowd */
-#define _IO_EOF_SEEN 0x10
-#define _IO_ERR_SEEN 0x20
-#define _IO_DELETE_DONT_CLOSE 0x40 /* Don't call close(_fileno) on cleanup. */
-#define _IO_LINKED 0x80 /* Set if linked (using _chain) to streambuf::_list_all.*/
-#define _IO_IN_BACKUP 0x100
-#define _IO_LINE_BUF 0x200
-#define _IO_TIED_PUT_GET 0x400 /* Set if put and get pointer logicly tied. */
-#define _IO_CURRENTLY_PUTTING 0x800
-#define _IO_IS_APPENDING 0x1000
-#define _IO_IS_FILEBUF 0x2000
-#define _IO_BAD_SEEN 0x4000
-#define _IO_USER_LOCK 0x8000
-
-/* These are "formatting flags" matching the iostream fmtflags enum values. */
-#define _IO_SKIPWS 01
-#define _IO_LEFT 02
-#define _IO_RIGHT 04
-#define _IO_INTERNAL 010
-#define _IO_DEC 020
-#define _IO_OCT 040
-#define _IO_HEX 0100
-#define _IO_SHOWBASE 0200
-#define _IO_SHOWPOINT 0400
-#define _IO_UPPERCASE 01000
-#define _IO_SHOWPOS 02000
-#define _IO_SCIENTIFIC 04000
-#define _IO_FIXED 010000
-#define _IO_UNITBUF 020000
-#define _IO_STDIO 040000
-#define _IO_DONT_CLOSE 0100000
-#define _IO_BOOLALPHA 0200000
-
-
-struct _IO_jump_t; struct _IO_FILE;
-
-/* Handle lock. */
-#ifdef _IO_MTSAFE_IO
-# if defined __GLIBC__ && __GLIBC__ >= 2
-# if __GLIBC_MINOR__ > 0
-# include <bits/stdio-lock.h>
-# else
-# include <stdio-lock.h>
-# endif
-# define _IO_LOCK_T _IO_lock_t *
-# else
-/*# include <comthread.h>*/
-# endif
-#else
-# if defined(__GLIBC__) && __GLIBC__ >= 2
- typedef void _IO_lock_t;
-# define _IO_LOCK_T void *
-# else
-# ifdef __linux__
- struct _IO_lock_t { void *ptr; short int field1; short int field2; };
-# define _IO_LOCK_T struct _IO_lock_t
-# else
- typedef void _IO_lock_t;
-# endif
-# endif
-#endif
-
-
-/* A streammarker remembers a position in a buffer. */
-
-struct _IO_marker {
- struct _IO_marker *_next;
- struct _IO_FILE *_sbuf;
- /* If _pos >= 0
- it points to _buf->Gbase()+_pos. FIXME comment */
- /* if _pos < 0, it points to _buf->eBptr()+_pos. FIXME comment */
- int _pos;
-#if 0
- void set_streampos(streampos sp) { _spos = sp; }
- void set_offset(int offset) { _pos = offset; _spos = (streampos)(-2); }
- public:
- streammarker(streambuf *sb);
- ~streammarker();
- int saving() { return _spos == -2; }
- int delta(streammarker&);
- int delta();
-#endif
-};
-
-struct _IO_FILE {
- int _flags; /* High-order word is _IO_MAGIC; rest is flags. */
-#define _IO_file_flags _flags
-
- /* The following pointers correspond to the C++ streambuf protocol. */
- /* Note: Tk uses the _IO_read_ptr and _IO_read_end fields directly. */
- char* _IO_read_ptr; /* Current read pointer */
- char* _IO_read_end; /* End of get area. */
- char* _IO_read_base; /* Start of putback+get area. */
- char* _IO_write_base; /* Start of put area. */
- char* _IO_write_ptr; /* Current put pointer. */
- char* _IO_write_end; /* End of put area. */
- char* _IO_buf_base; /* Start of reserve area. */
- char* _IO_buf_end; /* End of reserve area. */
- /* The following fields are used to support backing up and undo. */
- char *_IO_save_base; /* Pointer to start of non-current get area. */
- char *_IO_backup_base; /* Pointer to first valid character of backup area */
- char *_IO_save_end; /* Pointer to end of non-current get area. */
-
- struct _IO_marker *_markers;
-
- struct _IO_FILE *_chain;
-
- int _fileno;
- int _blksize;
-#ifdef _G_IO_IO_FILE_VERSION
- _IO_off_t _old_offset;
-#else
- _IO_off_t _offset;
-#endif
-
-#define __HAVE_COLUMN /* temporary */
- /* 1+column number of pbase(); 0 is unknown. */
- unsigned short _cur_column;
- char _unused;
- char _shortbuf[1];
-
- /* char* _save_gptr; char* _save_egptr; */
-
-#ifdef _IO_LOCK_T
- _IO_LOCK_T _lock;
-#endif
-#if defined(_G_IO_IO_FILE_VERSION) && _G_IO_IO_FILE_VERSION == 0x20001
- _IO_off64_t _offset;
- int _unused2[16]; /* Make sure we don't get into trouble again. */
-#endif
-};
-
-#ifndef __cplusplus
-typedef struct _IO_FILE _IO_FILE;
-#endif
-
-#if defined(_G_IO_IO_FILE_VERSION) && _G_IO_IO_FILE_VERSION == 0x20001
-#define _IO_stdin_ _IO_2_1_stdin_
-#define _IO_stdout_ _IO_2_1_stdout_
-#define _IO_stderr_ _IO_2_1_stderr_
-#endif
-
-struct _IO_FILE_plus;
-extern struct _IO_FILE_plus _IO_stdin_, _IO_stdout_, _IO_stderr_;
-#define _IO_stdin ((_IO_FILE*)(&_IO_stdin_))
-#define _IO_stdout ((_IO_FILE*)(&_IO_stdout_))
-#define _IO_stderr ((_IO_FILE*)(&_IO_stderr_))
-
-
-/* Define the user-visible type, with user-friendly member names. */
-typedef struct
-{
- _IO_ssize_t (*read) __PMT ((struct _IO_FILE *, void *, _IO_ssize_t));
- _IO_ssize_t (*write) __PMT ((struct _IO_FILE *, const void *, _IO_ssize_t));
- _IO_off_t (*seek) __PMT ((struct _IO_FILE *, _IO_off_t, int));
- int (*close) __PMT ((struct _IO_FILE *));
-} _IO_cookie_io_functions_t;
-
-/* Special file type for fopencookie function. */
-struct _IO_cookie_file
-{
- struct _IO_FILE file;
- const void *vtable;
- void *cookie;
- _IO_cookie_io_functions_t io_functions;
-};
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern int __underflow __P ((_IO_FILE *));
-extern int __uflow __P ((_IO_FILE *));
-extern int __overflow __P ((_IO_FILE *, int));
-
-#define _IO_getc_unlocked(_fp) \
- ((_fp)->_IO_read_ptr >= (_fp)->_IO_read_end ? __uflow (_fp) \
- : *(unsigned char *) (_fp)->_IO_read_ptr++)
-#define _IO_peekc_unlocked(_fp) \
- ((_fp)->_IO_read_ptr >= (_fp)->_IO_read_end \
- && __underflow (_fp) == EOF ? EOF \
- : *(unsigned char *) (_fp)->_IO_read_ptr)
-
-#define _IO_putc_unlocked(_ch, _fp) \
- (((_fp)->_IO_write_ptr >= (_fp)->_IO_write_end) \
- ? __overflow (_fp, (unsigned char) (_ch)) \
- : (unsigned char) (*(_fp)->_IO_write_ptr++ = (_ch)))
-
-#define _IO_feof_unlocked(__fp) (((__fp)->_flags & _IO_EOF_SEEN) != 0)
-#define _IO_ferror_unlocked(__fp) (((__fp)->_flags & _IO_ERR_SEEN) != 0)
-
-extern int _IO_getc __P ((_IO_FILE *__fp));
-extern int _IO_putc __P ((int __c, _IO_FILE *__fp));
-extern int _IO_feof __P ((_IO_FILE *__fp));
-extern int _IO_ferror __P ((_IO_FILE *__fp));
-
-extern int _IO_peekc_locked __P ((_IO_FILE *__fp));
-
-/* This one is for Emacs. */
-#define _IO_PENDING_OUTPUT_COUNT(_fp) \
- ((_fp)->_IO_write_ptr - (_fp)->_IO_write_base)
-
-extern void _IO_flockfile __P ((_IO_FILE *));
-extern void _IO_funlockfile __P ((_IO_FILE *));
-extern int _IO_ftrylockfile __P ((_IO_FILE *));
-
-#ifdef _IO_MTSAFE_IO
-# define _IO_peekc(_fp) _IO_peekc_locked (_fp)
-#else
-# define _IO_peekc(_fp) _IO_peekc_unlocked (_fp)
-# define _IO_flockfile(_fp) /**/
-# define _IO_funlockfile(_fp) /**/
-# define _IO_ftrylockfile(_fp) /**/
-# define _IO_cleanup_region_start(_fct, _fp) /**/
-# define _IO_cleanup_region_end(_Doit) /**/
-#endif /* !_IO_MTSAFE_IO */
-
-
-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 _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));
-
-#if defined(_G_IO_IO_FILE_VERSION) && _G_IO_IO_FILE_VERSION == 0x20001
-extern _IO_off64_t _IO_seekoff __P ((_IO_FILE *, _IO_off64_t, int, int));
-extern _IO_off64_t _IO_seekpos __P ((_IO_FILE *, _IO_off64_t, int));
-#else
-extern _IO_off_t _IO_seekoff __P ((_IO_FILE *, _IO_off_t, int, int));
-extern _IO_off_t _IO_seekpos __P ((_IO_FILE *, _IO_off_t, int));
-#endif
-
-extern void _IO_free_backup_area __P ((_IO_FILE *));
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _IO_STDIO_H */
diff --git a/contrib/libio/libioP.h b/contrib/libio/libioP.h
deleted file mode 100644
index be70f526bbe6..000000000000
--- a/contrib/libio/libioP.h
+++ /dev/null
@@ -1,648 +0,0 @@
-/* Copyright (C) 1993, 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. */
-
-#ifndef _POSIX_SOURCE
-# define _POSIX_SOURCE
-#endif
-
-#include <errno.h>
-#ifndef __set_errno
-# define __set_errno(Val) errno = (Val)
-#endif
-
-#ifdef _IO_MTSAFE_IO
-# if defined __GLIBC__ && __GLIBC__ >= 2
-# if __GLIBC_MINOR__ > 0
-# include <bits/libc-lock.h>
-# else
-# include <libc-lock.h>
-# endif
-# else
-/*# include <comthread.h>*/
-# endif
-#endif
-
-#include "iolibio.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define _IO_seek_set 0
-#define _IO_seek_cur 1
-#define _IO_seek_end 2
-
-/* THE JUMPTABLE FUNCTIONS.
-
- * The _IO_FILE type is used to implement the FILE type in GNU libc,
- * as well as the streambuf class in GNU iostreams for C++.
- * These are all the same, just used differently.
- * An _IO_FILE (or FILE) object is allows followed by a pointer to
- * a jump table (of pointers to functions). The pointer is accessed
- * 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.
- * (as implemented by g++). When a pointer to a streambuf object is
- * coerced to an (_IO_FILE*), then _IO_JUMPS on the result just
- * happens to point to the virtual function table of the streambuf.
- * Thus the _IO_JUMPS function table used for C stdio/libio does
- * double duty as the virtual function table for C++ streambuf.
- *
- * The entries in the _IO_JUMPS function table (and hence also the
- * virtual functions of a streambuf) are described below.
- * The first parameter of each function entry is the _IO_FILE/streambuf
- * object being acted on (i.e. the 'this' parameter).
- */
-
-#define _IO_JUMPS(THIS) ((struct _IO_FILE_plus *) (THIS))->vtable
-#ifdef _G_USING_THUNKS
-# define JUMP_FIELD(TYPE, NAME) TYPE NAME
-# define JUMP0(FUNC, THIS) _IO_JUMPS(THIS)->FUNC (THIS)
-# 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 JUMP3(FUNC, THIS, X1,X2,X3) _IO_JUMPS(THIS)->FUNC (THIS, X1,X2, X3)
-# define JUMP_INIT(NAME, VALUE) VALUE
-# define JUMP_INIT_DUMMY JUMP_INIT(dummy, 0), JUMP_INIT (dummy2, 0)
-#else
-/* 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 JUMP0(FUNC, THIS) _IO_JUMPS(THIS)->FUNC.pfn (THIS)
-# 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 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_DUMMY JUMP_INIT(dummy, 0)
-#endif
-
-/* 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 matches the streambuf::~streambuf virtual destructor. */
-typedef void (*_IO_finish_t) __PMT ((_IO_FILE *, int)); /* finalize */
-#define _IO_FINISH(FP) JUMP1 (__finish, FP, 0)
-
-/* The 'overflow' hook flushes the buffer.
- The second argument is a character, or EOF.
- It matches the streambuf::overflow virtual function. */
-typedef int (*_IO_overflow_t) __PMT ((_IO_FILE *, int));
-#define _IO_OVERFLOW(FP, CH) JUMP1 (__overflow, FP, CH)
-
-/* The 'underflow' hook tries to fills the get buffer.
- It returns the next character (as an unsigned char) or EOF. The next
- character remains in the get buffer, and the get position is not changed.
- It matches the streambuf::underflow virtual function. */
-typedef int (*_IO_underflow_t) __PMT ((_IO_FILE *));
-#define _IO_UNDERFLOW(FP) JUMP0 (__underflow, FP)
-
-/* The 'uflow' hook returns the next character in the input stream
- (cast to unsigned char), and increments the read position;
- EOF is returned on failure.
- It matches the streambuf::uflow virtual function, which is not in the
- cfront implementation, but was added to C++ by the ANSI/ISO committee. */
-#define _IO_UFLOW(FP) JUMP0 (__uflow, FP)
-
-/* The 'pbackfail' hook handles backing up.
- It matches the streambuf::pbackfail virtual function. */
-typedef int (*_IO_pbackfail_t) __PMT ((_IO_FILE *, int));
-#define _IO_PBACKFAIL(FP, CH) JUMP1 (__pbackfail, FP, CH)
-
-/* The 'xsputn' hook writes upto N characters from buffer DATA.
- Returns the number of character actually written.
- It matches the streambuf::xsputn virtual function. */
-typedef _IO_size_t (*_IO_xsputn_t) __PMT ((_IO_FILE *FP, const void *DATA,
- _IO_size_t N));
-#define _IO_XSPUTN(FP, DATA, N) JUMP2 (__xsputn, FP, DATA, N)
-
-/* The 'xsgetn' hook reads upto N characters into buffer DATA.
- Returns the number of character actually read.
- It matches the streambuf::xsgetn virtual function. */
-typedef _IO_size_t (*_IO_xsgetn_t) __PMT ((_IO_FILE *FP, void *DATA,
- _IO_size_t N));
-#define _IO_XSGETN(FP, DATA, N) JUMP2 (__xsgetn, FP, DATA, N)
-
-/* The 'seekoff' hook moves the stream position to a new position
- relative to the start of the file (if DIR==0), the current position
- (MODE==1), or the end of the file (MODE==2).
- It matches the streambuf::seekoff virtual function.
- It is also used for the ANSI fseek function. */
-#if defined(_G_IO_IO_FILE_VERSION) && _G_IO_IO_FILE_VERSION == 0x20001
-typedef _IO_off64_t (*_IO_seekoff_t) __PMT ((_IO_FILE *FP, _IO_off64_t OFF,
- int DIR, int MODE));
-#else
-typedef _IO_off_t (*_IO_seekoff_t) __PMT ((_IO_FILE *FP, _IO_off_t OFF,
- int DIR, int MODE));
-#endif
-#define _IO_SEEKOFF(FP, OFF, DIR, MODE) JUMP3 (__seekoff, FP, OFF, DIR, MODE)
-
-/* The 'seekpos' hook also moves the stream position,
- but to an absolute position given by a fpos_t (seekpos).
- It matches the streambuf::seekpos virtual function.
- It is also used for the ANSI fgetpos and fsetpos functions. */
-/* The _IO_seek_cur and _IO_seek_end options are not allowed. */
-#if defined(_G_IO_IO_FILE_VERSION) && _G_IO_IO_FILE_VERSION == 0x20001
-typedef _IO_off64_t (*_IO_seekpos_t) __PMT ((_IO_FILE *, _IO_off64_t, int));
-#else
-typedef _IO_off_t (*_IO_seekpos_t) __PMT ((_IO_FILE *, _IO_off_t, int));
-#endif
-#define _IO_SEEKPOS(FP, POS, FLAGS) JUMP2 (__seekpos, FP, POS, FLAGS)
-
-/* The 'setbuf' hook gives a buffer to the file.
- It matches the streambuf::setbuf virtual function. */
-typedef _IO_FILE* (*_IO_setbuf_t) __PMT ((_IO_FILE *, char *, _IO_ssize_t));
-#define _IO_SETBUF(FP, BUFFER, LENGTH) JUMP2 (__setbuf, FP, BUFFER, LENGTH)
-
-/* The 'sync' hook attempts to synchronize the internal data structures
- of the file with the external state.
- It matches the streambuf::sync virtual function. */
-typedef int (*_IO_sync_t) __PMT ((_IO_FILE *));
-#define _IO_SYNC(FP) JUMP0 (__sync, FP)
-
-/* The 'doallocate' hook is used to tell the file to allocate a buffer.
- It matches the streambuf::doallocate virtual function, which is not
- in the ANSI/ISO C++ standard, but is part traditional implementations. */
-typedef int (*_IO_doallocate_t) __PMT ((_IO_FILE *));
-#define _IO_DOALLOCATE(FP) JUMP0 (__doallocate, FP)
-
-/* The following four hooks (sysread, syswrite, sysclose, sysseek, and
- sysstat) are low-level hooks specific to this implementation.
- There is no correspondence in the ANSI/ISO C++ standard library.
- The hooks basically correspond to the Unix system functions
- (read, write, close, lseek, and stat) except that a _IO_FILE*
- parameter is used instead of a integer file descriptor; the default
- implementation used for normal files just calls those functions.
- The advantage of overriding these functions instead of the higher-level
- ones (underflow, overflow etc) is that you can leave all the buffering
- higher-level functions. */
-
-/* The 'sysread' hook is used to read data from the external file into
- an existing buffer. It generalizes the Unix read(2) function.
- It matches the streambuf::sys_read virtual function, which is
- specific to this implementation. */
-typedef _IO_ssize_t (*_IO_read_t) __PMT ((_IO_FILE *, void *, _IO_ssize_t));
-#define _IO_SYSREAD(FP, DATA, LEN) JUMP2 (__read, FP, DATA, LEN)
-
-/* The 'syswrite' hook is used to write data from an existing buffer
- to an external file. It generalizes the Unix write(2) function.
- It matches the streambuf::sys_write virtual function, which is
- specific to this implementation. */
-typedef _IO_ssize_t (*_IO_write_t) __PMT ((_IO_FILE *,const void *,_IO_ssize_t));
-#define _IO_SYSWRITE(FP, DATA, LEN) JUMP2 (__write, FP, DATA, LEN)
-
-/* The 'sysseek' hook is used to re-position an external file.
- It generalizes the Unix lseek(2) function.
- It matches the streambuf::sys_seek virtual function, which is
- specific to this implementation. */
-#if defined(_G_IO_IO_FILE_VERSION) && _G_IO_IO_FILE_VERSION == 0x20001
-typedef _IO_off64_t (*_IO_seek_t) __PMT ((_IO_FILE *, _IO_off64_t, int));
-#else
-typedef _IO_off_t (*_IO_seek_t) __PMT ((_IO_FILE *, _IO_off_t, int));
-#endif
-#define _IO_SYSSEEK(FP, OFFSET, MODE) JUMP2 (__seek, FP, OFFSET, MODE)
-
-/* The 'sysclose' hook is used to finalize (close, finish up) an
- external file. It generalizes the Unix close(2) function.
- It matches the streambuf::sys_close virtual function, which is
- specific to this implementation. */
-typedef int (*_IO_close_t) __PMT ((_IO_FILE *)); /* finalize */
-#define _IO_SYSCLOSE(FP) JUMP0 (__close, FP)
-
-/* The 'sysstat' hook is used to get information about an external file
- into a struct stat buffer. It generalizes the Unix fstat(2) call.
- It matches the streambuf::sys_stat virtual function, which is
- specific to this implementation. */
-typedef int (*_IO_stat_t) __PMT ((_IO_FILE *, void *));
-#define _IO_SYSSTAT(FP, BUF) JUMP1 (__stat, FP, BUF)
-
-#if _G_IO_IO_FILE_VERSION == 0x20001
-/* The 'showmany' hook can be used to get an image how much input is
- available. In many cases the answer will be 0 which means unknown
- but some cases one can provide real information. */
-typedef int (*_IO_showmanyc_t) __PMT ((_IO_FILE *));
-#define _IO_SHOWMANYC(FP) JUMP0 (__showmanyc, FP)
-
-/* The 'imbue' hook is used to get information about the currently
- installed locales. */
-typedef void (*_IO_imbue_t) __PMT ((_IO_FILE *, void *));
-#define _IO_IMBUE(FP, LOCALE) JUMP1 (__imbue, FP, LOCALE)
-#endif
-
-
-#define _IO_CHAR_TYPE char /* unsigned char ? */
-#define _IO_INT_TYPE int
-
-struct _IO_jump_t
-{
- JUMP_FIELD(_G_size_t, __dummy);
-#ifdef _G_USING_THUNKS
- JUMP_FIELD(_G_size_t, __dummy2);
-#endif
- JUMP_FIELD(_IO_finish_t, __finish);
- JUMP_FIELD(_IO_overflow_t, __overflow);
- JUMP_FIELD(_IO_underflow_t, __underflow);
- JUMP_FIELD(_IO_underflow_t, __uflow);
- JUMP_FIELD(_IO_pbackfail_t, __pbackfail);
- /* showmany */
- JUMP_FIELD(_IO_xsputn_t, __xsputn);
- JUMP_FIELD(_IO_xsgetn_t, __xsgetn);
- JUMP_FIELD(_IO_seekoff_t, __seekoff);
- JUMP_FIELD(_IO_seekpos_t, __seekpos);
- JUMP_FIELD(_IO_setbuf_t, __setbuf);
- JUMP_FIELD(_IO_sync_t, __sync);
- JUMP_FIELD(_IO_doallocate_t, __doallocate);
- JUMP_FIELD(_IO_read_t, __read);
- JUMP_FIELD(_IO_write_t, __write);
- JUMP_FIELD(_IO_seek_t, __seek);
- JUMP_FIELD(_IO_close_t, __close);
- JUMP_FIELD(_IO_stat_t, __stat);
-#if _G_IO_IO_FILE_VERSION == 0x20001
- JUMP_FIELD(_IO_showmanyc_t, __showmanyc);
- JUMP_FIELD(_IO_imbue_t, __imbue);
-#endif
-#if 0
- get_column;
- set_column;
-#endif
-};
-
-/* We always allocate an extra word following an _IO_FILE.
- This contains a pointer to the function jump table used.
- This is for compatibility with C++ streambuf; the word can
- be used to smash to a pointer to a virtual function table. */
-
-struct _IO_FILE_plus
-{
- _IO_FILE file;
- const struct _IO_jump_t *vtable;
-};
-
-/* Generic functions */
-
-#if defined(_G_IO_IO_FILE_VERSION) && _G_IO_IO_FILE_VERSION == 0x20001
-extern _IO_off64_t _IO_seekoff __P ((_IO_FILE *, _IO_off64_t, int, int));
-extern _IO_off64_t _IO_seekpos __P ((_IO_FILE *, _IO_off64_t, int));
-#else
-extern _IO_off_t _IO_seekoff __P ((_IO_FILE *, _IO_off_t, int, int));
-extern _IO_off_t _IO_seekpos __P ((_IO_FILE *, _IO_off_t, int));
-#endif
-
-extern void _IO_switch_to_main_get_area __P ((_IO_FILE *));
-extern void _IO_switch_to_backup_area __P ((_IO_FILE *));
-extern int _IO_switch_to_get_mode __P ((_IO_FILE *));
-extern void _IO_init __P ((_IO_FILE *, int));
-extern int _IO_sputbackc __P ((_IO_FILE *, int));
-extern int _IO_sungetc __P ((_IO_FILE *));
-extern void _IO_un_link __P ((_IO_FILE *));
-extern void _IO_link_in __P ((_IO_FILE *));
-extern void _IO_doallocbuf __P ((_IO_FILE *));
-extern void _IO_unsave_markers __P ((_IO_FILE *));
-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. */
-
-extern void _IO_init_marker __P ((struct _IO_marker *, _IO_FILE *));
-extern void _IO_remove_marker __P ((struct _IO_marker *));
-extern int _IO_marker_difference __P ((struct _IO_marker *,
- struct _IO_marker *));
-extern int _IO_marker_delta __P ((struct _IO_marker *));
-extern int _IO_seekmark __P ((_IO_FILE *, struct _IO_marker *, int));
-
-/* Default jumptable functions. */
-
-extern int _IO_default_underflow __P ((_IO_FILE *));
-extern int _IO_default_uflow __P ((_IO_FILE *));
-extern int _IO_default_doallocate __P ((_IO_FILE *));
-extern void _IO_default_finish __P ((_IO_FILE *, int));
-extern int _IO_default_pbackfail __P ((_IO_FILE *, int));
-extern _IO_FILE* _IO_default_setbuf __P ((_IO_FILE *, char *, _IO_ssize_t));
-extern _IO_size_t _IO_default_xsputn __P ((_IO_FILE *, const void *,
- _IO_size_t));
-extern _IO_size_t _IO_default_xsgetn __P ((_IO_FILE *, void *, _IO_size_t));
-#if defined(_G_IO_IO_FILE_VERSION) && _G_IO_IO_FILE_VERSION == 0x20001
-extern _IO_off64_t _IO_default_seekoff __P ((_IO_FILE *,
- _IO_off64_t, int, int));
-extern _IO_off64_t _IO_default_seekpos __P ((_IO_FILE *,
- _IO_off64_t, int));
-#else
-extern _IO_off_t _IO_default_seekoff __P ((_IO_FILE *, _IO_off_t, int, int));
-extern _IO_off_t _IO_default_seekpos __P ((_IO_FILE *, _IO_off_t, int));
-#endif
-extern _IO_ssize_t _IO_default_write __P ((_IO_FILE *, const void *,
- _IO_ssize_t));
-extern _IO_ssize_t _IO_default_read __P ((_IO_FILE *, void *, _IO_ssize_t));
-extern int _IO_default_stat __P ((_IO_FILE *, void *));
-#if defined(_G_IO_IO_FILE_VERSION) && _G_IO_IO_FILE_VERSION == 0x20001
-extern _IO_off64_t _IO_default_seek __P ((_IO_FILE *, _IO_off64_t, int));
-#else
-extern _IO_off_t _IO_default_seek __P ((_IO_FILE *, _IO_off_t, int));
-#endif
-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_streambuf_jumps;
-extern struct _IO_jump_t _IO_proc_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_flush_all __P ((void));
-extern void _IO_cleanup __P ((void));
-extern void _IO_flush_all_linebuffered __P ((void));
-
-#define _IO_do_flush(_f) \
- _IO_do_write(_f, (_f)->_IO_write_base, \
- (_f)->_IO_write_ptr-(_f)->_IO_write_base)
-#define _IO_in_put_mode(_fp) ((_fp)->_flags & _IO_CURRENTLY_PUTTING)
-#define _IO_mask_flags(fp, f, mask) \
- ((fp)->_flags = ((fp)->_flags & ~(mask)) | ((f) & (mask)))
-#define _IO_setg(fp, eb, g, eg) ((fp)->_IO_read_base = (eb),\
- (fp)->_IO_read_ptr = (g), (fp)->_IO_read_end = (eg))
-#define _IO_setp(__fp, __p, __ep) \
- ((__fp)->_IO_write_base = (__fp)->_IO_write_ptr = __p, (__fp)->_IO_write_end = (__ep))
-#define _IO_have_backup(fp) ((fp)->_IO_save_base != NULL)
-#define _IO_in_backup(fp) ((fp)->_flags & _IO_IN_BACKUP)
-#define _IO_have_markers(fp) ((fp)->_markers != NULL)
-#define _IO_blen(fp) ((fp)->_IO_buf_end - (fp)->_IO_buf_base)
-
-/* Jumptable functions for files. */
-
-extern int _IO_file_doallocate __P ((_IO_FILE *));
-extern _IO_FILE* _IO_file_setbuf __P ((_IO_FILE *, char *, _IO_ssize_t));
-#if defined(_G_IO_IO_FILE_VERSION) && _G_IO_IO_FILE_VERSION == 0x20001
-extern _IO_off64_t _IO_file_seekoff __P ((_IO_FILE *, _IO_off64_t, int, int));
-extern _IO_off64_t _IO_file_seek __P ((_IO_FILE *, _IO_off64_t, int));
-#else
-extern _IO_off_t _IO_file_seekoff __P ((_IO_FILE *, _IO_off_t, int, int));
-extern _IO_off_t _IO_file_seek __P ((_IO_FILE *, _IO_off_t, int));
-#endif
-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_close __P ((_IO_FILE *));
-extern int _IO_file_underflow __P ((_IO_FILE *));
-extern int _IO_file_overflow __P ((_IO_FILE *, int));
-#define _IO_file_is_open(__fp) ((__fp)->_fileno >= 0)
-extern void _IO_file_init __P ((_IO_FILE *));
-extern _IO_FILE* _IO_file_attach __P ((_IO_FILE *, int));
-extern _IO_FILE* _IO_file_open __P ((_IO_FILE *, const char *, int, int,
- int, int));
-#if _G_IO_IO_FILE_VERSION == 0x20001
-extern _IO_FILE* _IO_file_fopen __P ((_IO_FILE *, const char *, const char *,
- int));
-#else
-extern _IO_FILE* _IO_file_fopen __P ((_IO_FILE *, const char *, const char *));
-#endif
-extern _IO_ssize_t _IO_file_write __P ((_IO_FILE *, const void *,
- _IO_ssize_t));
-extern _IO_ssize_t _IO_file_read __P ((_IO_FILE *, void *, _IO_ssize_t));
-extern int _IO_file_sync __P ((_IO_FILE *));
-extern int _IO_file_close_it __P ((_IO_FILE *));
-extern void _IO_file_finish __P ((_IO_FILE *, int));
-
-/* Jumptable functions for proc_files. */
-extern _IO_FILE* _IO_proc_open __P ((_IO_FILE *, const char *, const char *));
-extern int _IO_proc_close __P ((_IO_FILE *));
-
-/* Jumptable functions for strfiles. */
-extern int _IO_str_underflow __P ((_IO_FILE *));
-extern int _IO_str_overflow __P ((_IO_FILE *, int));
-extern int _IO_str_pbackfail __P ((_IO_FILE *, int));
-#if defined(_G_IO_IO_FILE_VERSION) && _G_IO_IO_FILE_VERSION == 0x20001
-extern _IO_off64_t _IO_str_seekoff __P ((_IO_FILE *, _IO_off64_t, int, int));
-#else
-extern _IO_off_t _IO_str_seekoff __P ((_IO_FILE *, _IO_off_t, int, int));
-#endif
-extern void _IO_str_finish __P ((_IO_FILE *, int));
-
-/* Other strfile functions */
-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 _IO_ssize_t _IO_str_count __P ((_IO_FILE *));
-
-extern int _IO_vasprintf __P ((char **result_ptr, __const char *format,
- _IO_va_list args));
-extern int _IO_vdprintf __P ((int d, __const char *format, _IO_va_list arg));
-extern int _IO_vsnprintf __P ((char *string, _IO_size_t maxlen,
- __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_info __P ((_IO_FILE *,char *, _IO_size_t,
- int, int, int *));
-extern _IO_ssize_t _IO_getdelim __P ((char **, _IO_size_t *, int, _IO_FILE *));
-extern double _IO_strtod __P ((const char *, char **));
-extern char *_IO_dtoa __P ((double __d, int __mode, int __ndigits,
- int *__decpt, int *__sign, char **__rve));
-extern int _IO_outfloat __P ((double __value, _IO_FILE *__sb, int __type,
- int __width, int __precision, int __flags,
- int __sign_mode, int __fill));
-
-extern _IO_FILE *_IO_list_all;
-extern void (*_IO_cleanup_registration_needed) __PMT ((void));
-
-#ifndef EOF
-# define EOF (-1)
-#endif
-#ifndef NULL
-# if defined __GNUG__ && \
- (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8))
-# define NULL (__null)
-# else
-# if !defined(__cplusplus)
-# define NULL ((void*)0)
-# else
-# define NULL (0)
-# endif
-# endif
-#endif
-
-#if _G_HAVE_MMAP
-
-# include <unistd.h>
-# include <fcntl.h>
-# include <sys/mman.h>
-# include <sys/param.h>
-
-# if !defined(MAP_ANONYMOUS) && defined(MAP_ANON)
-# define MAP_ANONYMOUS MAP_ANON
-# endif
-
-# if !defined(MAP_ANONYMOUS) || !defined(EXEC_PAGESIZE)
-# undef _G_HAVE_MMAP
-# define _G_HAVE_MMAP 0
-# endif
-
-#endif /* _G_HAVE_MMAP */
-
-#if _G_HAVE_MMAP
-
-# 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))
-
-# define FREE_BUF(_B, _S) \
- munmap ((_B), ROUND_TO_PAGE (_S))
-# define ALLOC_BUF(_B, _S, _R) \
- do { \
- (_B) = (char *) mmap (0, ROUND_TO_PAGE (_S), \
- PROT_READ | PROT_WRITE, \
- MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); \
- if ((_B) == (char *) -1) \
- return (_R); \
- } while (0)
-
-#else /* _G_HAVE_MMAP */
-
-# define FREE_BUF(_B, _S) \
- free(_B)
-# define ALLOC_BUF(_B, _S, _R) \
- do { \
- (_B) = (char*)malloc(_S); \
- if ((_B) == NULL) \
- return (_R); \
- } while (0)
-
-#endif /* _G_HAVE_MMAP */
-
-#ifndef OS_FSTAT
-# define OS_FSTAT fstat
-#endif
-struct stat;
-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_off_t _IO_lseek __P ((int, _IO_off_t, int));
-extern int _IO_close __P ((int));
-extern int _IO_fstat __P ((int, struct stat *));
-extern int _IO_vscanf __P ((const char *, _IO_va_list));
-
-/* Operations on _IO_fpos_t.
- Normally, these are trivial, but we provide hooks for configurations
- where an _IO_fpos_t is a struct.
- Note that _IO_off_t must be an integral type. */
-
-/* _IO_pos_BAD is an _IO_off_t value indicating error, unknown, or EOF. */
-#ifndef _IO_pos_BAD
-# if defined(_G_IO_IO_FILE_VERSION) && _G_IO_IO_FILE_VERSION == 0x20001
-# define _IO_pos_BAD ((_IO_off64_t) -1)
-# else
-# define _IO_pos_BAD ((_IO_off_t) -1)
-# endif
-#endif
-/* _IO_pos_as_off converts an _IO_fpos_t value to an _IO_off_t value. */
-#ifndef _IO_pos_as_off
-# if defined(_G_IO_IO_FILE_VERSION) && _G_IO_IO_FILE_VERSION == 0x20001
-# define _IO_pos_as_off(__pos) ((_IO_off64_t) (__pos))
-# else
-# 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. */
-#ifndef _IO_pos_adjust
-# define _IO_pos_adjust(__pos, __delta) ((__pos) += (__delta))
-#endif
-/* _IO_pos_0 is an _IO_fpos_t value indicating beginning of file. */
-#ifndef _IO_pos_0
-# if defined(_G_IO_IO_FILE_VERSION) && _G_IO_IO_FILE_VERSION == 0x20001
-# define _IO_pos_0 ((_IO_fpos64_t) 0)
-# else
-# define _IO_pos_0 ((_IO_fpos_t) 0)
-# endif
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#ifdef _IO_MTSAFE_IO
-/* check following! */
-# define FILEBUF_LITERAL(CHAIN, FLAGS, FD) \
- { _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 }, &_IO_stdfile_##FD##_lock }
-#else
-/* check following! */
-# define FILEBUF_LITERAL(CHAIN, FLAGS, FD) \
- { _IO_MAGIC+_IO_LINKED+_IO_IS_FILEBUF+FLAGS, \
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, CHAIN, FD }
-#endif
-
-/* VTABLE_LABEL defines NAME as of the CLASS class.
- CNLENGTH is strlen(#CLASS). */
-#ifdef __GNUC__
-# if _G_VTABLE_LABEL_HAS_LENGTH
-# define VTABLE_LABEL(NAME, CLASS, CNLENGTH) \
- extern char NAME[] asm (_G_VTABLE_LABEL_PREFIX #CNLENGTH #CLASS);
-# else
-# define VTABLE_LABEL(NAME, CLASS, CNLENGTH) \
- extern char NAME[] asm (_G_VTABLE_LABEL_PREFIX #CLASS);
-# endif
-#endif /* __GNUC__ */
-
-#if !defined(builtinbuf_vtable) && defined(__cplusplus)
-# ifdef __GNUC__
-VTABLE_LABEL(builtinbuf_vtable, builtinbuf, 10)
-# else
-# if _G_VTABLE_LABEL_HAS_LENGTH
-# define builtinbuf_vtable _G_VTABLE_LABEL_PREFIX_ID##10builtinbuf
-# else
-# define builtinbuf_vtable _G_VTABLE_LABEL_PREFIX_ID##builtinbuf
-# endif
-# endif
-#endif /* !defined(builtinbuf_vtable) && defined(__cplusplus) */
-
-#if defined(__STDC__) || defined(__cplusplus)
-# define _IO_va_start(args, last) va_start(args, last)
-#else
-# define _IO_va_start(args, last) va_start(args)
-#endif
-
-extern struct _IO_fake_stdiobuf _IO_stdin_buf, _IO_stdout_buf, _IO_stderr_buf;
-
-#if 1
-# define COERCE_FILE(FILE) /* Nothing */
-#else
-/* This is part of the kludge for binary compatibility with old stdio. */
-# define COERCE_FILE(FILE) \
- (((FILE)->_IO_file_flags & _IO_MAGIC_MASK) == _OLD_MAGIC_MASK \
- && (FILE) = *(FILE**)&((int*)fp)[1])
-#endif
-
-#ifdef EINVAL
-# define MAYBE_SET_EINVAL __set_errno (EINVAL)
-#else
-# define MAYBE_SET_EINVAL /* nothing */
-#endif
-
-#ifdef IO_DEBUG
-# define CHECK_FILE(FILE, RET) \
- if ((FILE) == NULL) { MAYBE_SET_EINVAL; return RET; } \
- else { COERCE_FILE(FILE); \
- if (((FILE)->_IO_file_flags & _IO_MAGIC_MASK) != _IO_MAGIC) \
- { MAYBE_SET_EINVAL; return RET; }}
-#else
-# define CHECK_FILE(FILE, RET) COERCE_FILE (FILE)
-#endif
diff --git a/contrib/libio/osform.cc b/contrib/libio/osform.cc
deleted file mode 100644
index f08f2efaa39e..000000000000
--- a/contrib/libio/osform.cc
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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 <iostream.h>
-#include <stdarg.h>
-
-ostream& ostream::form(const char *format ...)
-{
- if (opfx()) {
- _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile,
- _strbuf);
- va_list ap;
- va_start(ap, format);
- _IO_vfprintf(rdbuf(), format, ap);
- va_end(ap);
- osfx();
- _IO_cleanup_region_end (0);
- }
- return *this;
-}
-
-ostream& ostream::vform(const char *format, _IO_va_list args)
-{
- if (opfx()) {
- _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile,
- _strbuf);
- _IO_vfprintf(rdbuf(), format, args);
- osfx();
- _IO_cleanup_region_end (0);
- }
- return *this;
-}
-
-ostream& ostream::operator<<(const void *p)
-{
- if (opfx()) {
- _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile,
- _strbuf);
- form("%p", p);
- osfx();
- _IO_cleanup_region_end (0);
- }
- return *this;
-}
diff --git a/contrib/libio/ostream.h b/contrib/libio/ostream.h
deleted file mode 100644
index f54ec1de9a1c..000000000000
--- a/contrib/libio/ostream.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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 <stream.h>
diff --git a/contrib/libio/outfloat.c b/contrib/libio/outfloat.c
deleted file mode 100644
index 5cbb6c925982..000000000000
--- a/contrib/libio/outfloat.c
+++ /dev/null
@@ -1,211 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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"
-
-#ifdef _IO_USE_DTOA
-/* Format floating-point number and print them.
- Return number of chars printed, or EOF on error.
-
- sign_mode == '+' : print "-" or "+"
- sign_mode == ' ' : print "-" or " "
- sign_mode == '\0' : print "-' or ""
-*/
-
-int
-_IO_outfloat (value, sb, type, width, precision, flags, sign_mode, fill)
- double value;
- _IO_FILE *sb;
- int type;
- int width;
- int precision;
- int flags;
- int sign_mode;
- int fill;
-{
- int count = 0;
-#define PUT(x) do {if (_IO_putc(x, sb) < 0) goto error; count++;} while (0)
-#define PUTN(p, n) \
- do {int _n=n; count+=_n; if (_IO_sputn(sb, p,_n) != _n) goto error;} while(0)
-#define PADN(fill, n) \
- do {int _n = n; count+=_n; if (_IO_padn(sb, fill, _n) != _n) goto error;} while (0)
- int pad_kind = flags & (_IO_LEFT|_IO_RIGHT|_IO_INTERNAL);
- int skip_zeroes = 0;
- int show_dot = (flags & _IO_SHOWPOINT) != 0;
- int decpt;
- int sign;
- int mode;
- int exponent_size;
- int print_sign;
- int trailing_zeroes, useful_digits;
- int padding, unpadded_width;
- char *p;
- char *exponent_start;
- register int i;
-#define EBUF_SIZE 12
-#define EBUF_END &ebuf[EBUF_SIZE]
- char ebuf[EBUF_SIZE];
- char *end;
- int exp = 0;
- switch (type)
- {
- case 'f':
- mode = 3;
- break;
- case 'e':
- case 'E':
- exp = type;
- mode = 2;
- if (precision != 999)
- precision++; /* Add one to include digit before decimal point. */
- break;
- case 'g':
- case 'G':
- exp = type == 'g' ? 'e' : 'E';
- if (precision == 0) precision = 1;
- if (!(flags & _IO_SHOWPOINT))
- skip_zeroes = 1;
- type = 'g';
- mode = 2;
- break;
- }
- /* Do the actual convension */
- if (precision == 999 && mode != 3)
- mode = 0;
- p = _IO_dtoa(value, mode, precision, &decpt, &sign, &end);
- useful_digits = end-p;
- exponent_start = EBUF_END;
- if (mode == 0)
- precision = useful_digits;
- /* Check if we need to emit an exponent. */
- if (mode != 3 && decpt != 9999)
- {
- i = decpt - 1;
- if ((type != 'g' && type != 'F') || i < -4 || i >= precision)
- {
- /* Print the exponent into ebuf.
- We write ebuf in reverse order (right-to-left). */
- char sign;
- if (i >= 0)
- sign = '+';
- else
- sign = '-', i = -i;
- /* Note: ANSI requires at least 2 exponent digits. */
- do {
- *--exponent_start = (i % 10) + '0';
- i /= 10;
- } while (i >= 10);
- *--exponent_start = i + '0';
- *--exponent_start = sign;
- *--exponent_start = exp;
- }
- }
- exponent_size = EBUF_END - exponent_start;
- if (mode == 1)
- precision = 1;
- /* If we print an exponent, always show just one digit before point. */
- if (exponent_size)
- decpt = 1;
- if (decpt == 9999)
- { /* Infinity or NaN */
- decpt = useful_digits;
- precision = 0;
- show_dot = 0;
- }
-
- /* dtoa truncates trailing zeroes. Set the variable trailing_zeroes to
- the number of 0's we have to add (after the decimal point). */
- if (skip_zeroes)
- trailing_zeroes = 0;
- else if (type == 'f')
- trailing_zeroes = useful_digits <= decpt ? precision
- : precision-(useful_digits-decpt);
- else if (exponent_size) /* 'e' 'E' or 'g' format using exponential notation*/
- trailing_zeroes = precision - useful_digits;
- else /* 'g' format not using exponential notation. */
- trailing_zeroes = useful_digits <= decpt ? precision - decpt
- : precision-useful_digits;
- if (trailing_zeroes < 0) trailing_zeroes = 0;
-
- if (trailing_zeroes != 0 || useful_digits > decpt)
- show_dot = 1;
- if (sign_mode == 0)
- print_sign = sign ? '-' : 0;
- else if (sign_mode == '+')
- print_sign = sign ? '-' : '+';
- else /* if (sign_mode == ' ') */
- print_sign = sign ? '-' : ' ';
-
- /* Calculate the width (before padding). */
- unpadded_width =
- (print_sign != 0) + trailing_zeroes + exponent_size + show_dot
- + useful_digits
- + (decpt > useful_digits ? decpt - useful_digits
- : decpt > 0 ? 0 : 1 - decpt);
-
- padding = width > unpadded_width ? width - unpadded_width : 0;
- if (padding > 0 && pad_kind != _IO_LEFT && pad_kind != _IO_INTERNAL)
- PADN(fill, padding); /* Default (right) adjust */
- if (print_sign)
- PUT(print_sign);
- if (pad_kind == _IO_INTERNAL && padding > 0)
- PADN(fill, padding);
- if (decpt > 0)
- {
- if (useful_digits >= decpt)
- PUTN(p, decpt);
- else
- {
- PUTN(p, useful_digits);
- PADN('0', decpt-useful_digits);
- }
- if (show_dot)
- {
- PUT('.');
- /* Print digits after the decimal point. */
- if (useful_digits > decpt)
- PUTN(p + decpt, useful_digits-decpt);
- }
- }
- else
- {
- PUT('0');
- if (show_dot)
- {
- PUT('.');
- PADN('0', -decpt);
- /* Print digits after the decimal point. */
- PUTN(p, useful_digits);
- }
- }
- PADN('0', trailing_zeroes);
- if (exponent_size)
- PUTN(exponent_start, exponent_size);
- if (pad_kind == _IO_LEFT && padding > 0) /* Left adjustment*/
- PADN(fill, padding);
- return count;
- error:
- return EOF;
-}
-#endif
diff --git a/contrib/libio/parsestream.cc b/contrib/libio/parsestream.cc
deleted file mode 100644
index e430e602c8dc..000000000000
--- a/contrib/libio/parsestream.cc
+++ /dev/null
@@ -1,317 +0,0 @@
-/* This is part of libio/iostream, providing -*- C++ -*- input/output.
-Copyright (C) 1993 Free Software Foundation
-
-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.
-
-Written by Per Bothner (bothner@cygnus.com). */
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include "libioP.h"
-#include "parsestream.h"
-#include <stdlib.h>
-
-streambuf* parsebuf::setbuf(char*, int)
-{
- return NULL;
-}
-
-int parsebuf::tell_in_line()
-{
- return 0;
-}
-
-int parsebuf::pbackfail(int c)
-{
- if (c == EOF)
- return 0;
- if (seekoff(-1, ios::cur) == EOF)
- return EOF;
- return (unsigned char)c;
-}
-
-char* parsebuf::current_line() { return NULL; }
-
-streampos parsebuf::seekoff(streamoff offset, _seek_dir dir, int)
-{
- // Make offset relative to line start.
- switch (dir) {
- case ios::beg:
- offset -= pos_at_line_start;
- break;
- case ios::cur:
- offset += tell_in_line();
- break;
- default:
- return EOF;
- }
- if (offset < -1)
- return EOF;
- if (offset > _line_length + 1)
- return EOF;
- return seek_in_line(offset) + pos_at_line_start;
-}
-
-// string_parsebuf invariants:
-// The reserve ares (base() .. ebuf()) is always the entire string.
-// The get area (eback() .. egptr()) is the extended current line
-// (i.e. with the '\n' at either end, if these exist).
-
-string_parsebuf::string_parsebuf(char *buf, int len,
- int delete_at_close /* = 0*/)
-: parsebuf()
-{
- setb(buf, buf+len, delete_at_close);
- register char *ptr = buf;
- while (ptr < ebuf() && *ptr != '\n') ptr++;
- _line_length = ptr - buf;
- setg(buf, buf, ptr);
-}
-
-int string_parsebuf::underflow()
-{
- register char* ptr = egptr(); // Point to end of current_line
- do {
- int i = right() - ptr;
- if (i <= 0)
- return EOF;
- ptr++; i--; // Skip '\n'.
- char *line_start = ptr;
- while (ptr < right() && *ptr == '\n') ptr++;
- setg(line_start-1, line_start, ptr + (ptr < right()));
- pos_at_line_start = line_start - left();
- _line_length = ptr - line_start;
- __line_number++;
- } while (gptr() == ptr);
- return *gptr();
-}
-
-char* string_parsebuf::current_line()
-{
- char *ptr = eback();
- if (__line_number > 0)
- ptr++; // Skip '\n' at end of previous line.
- return ptr;
-}
-
-int string_parsebuf::tell_in_line()
-{
- int offset = gptr() - eback();
- if (__line_number > 0)
- offset--;
- return offset;
-}
-
-int string_parsebuf::seek_in_line(int i)
-{
- int delta = i - tell_in_line();
- gbump(delta); // FIXME: Needs error (bounds) checking!
- return i;
-}
-
-static const char NewLine[1] = { '\n' };
-
-general_parsebuf::general_parsebuf(streambuf *buf, int delete_arg_buf)
- : parsebuf()
-{
- delete_buf = delete_arg_buf;
- sbuf = buf;
- int buf_size = 128;
- char* buffer = (char*)malloc(buf_size);
- setb(buffer, buffer+buf_size, 1);
-// setg(buffer, buffer, buffer);
-}
-
-general_parsebuf::~general_parsebuf()
-{
- if (delete_buf)
- delete sbuf;
-}
-
-int general_parsebuf::underflow()
-{
- register char *ptr = base();
- int has_newline = eback() < gptr() && gptr()[-1] == '\n';
- if (has_newline)
- *ptr++ = '\n';
- register streambuf *sb = sbuf;
- register int ch;
- for (;;) {
- ch = sb->sbumpc();
- if (ch == EOF)
- break;
- if (ptr == ebuf()) {
- int old_size = ebuf() - base();
- char *new_buffer = new char[old_size * 2];
- memcpy(new_buffer, base(), old_size);
- setb(new_buffer, new_buffer + 2 * old_size, 1);
- ptr = new_buffer + old_size;
- }
- *ptr++ = ch;
- if (ch == '\n')
- break;
- }
- char *cur_pos = base() + has_newline;
- pos_at_line_start += _line_length + 1;
- _line_length = ptr - cur_pos;
- if (ch != EOF || _line_length > 0)
- __line_number++;
- setg(base(), cur_pos, ptr);
- return ptr == cur_pos ? EOF : cur_pos[0];
-}
-
-char* general_parsebuf::current_line()
-{
- char* ret = base();
- if (__line_number > 1)
- ret++; // Move past '\n' from end of previous line.
- return ret;
-}
-
-int general_parsebuf::tell_in_line()
-{
- int off = gptr() - base();
- if (__line_number > 1)
- off--; // Subtract 1 for '\n' from end of previous line.
- return off;
-}
-
-int general_parsebuf::seek_in_line(int i)
-{
- if (__line_number == 0)
- (void)general_parsebuf::underflow();
- if (__line_number > 1)
- i++; // Add 1 for '\n' from end of previous line.
- if (i < 0) i = 0;
- int len = egptr() - eback();
- if (i > len) i = len;
- setg(base(), base() + i, egptr());
- return i;
-}
-
-func_parsebuf::func_parsebuf(CharReader func, void *argm) : parsebuf()
-{
- read_func = func;
- arg = argm;
- buf_start = NULL;
- buf_end = NULL;
- setb((char*)NewLine, (char*)NewLine+1, 0);
- setg((char*)NewLine, (char*)NewLine+1, (char*)NewLine+1);
- backed_up_to_newline = 0;
-}
-
-int func_parsebuf::tell_in_line()
-{
- if (buf_start == NULL)
- return 0;
- if (egptr() != (char*)NewLine+1)
- // Get buffer was line buffer.
- return gptr() - buf_start;
- if (backed_up_to_newline)
- return -1; // Get buffer is '\n' preceding current line.
- // Get buffer is '\n' following current line.
- return (buf_end - buf_start) + (gptr() - (char*)NewLine);
-}
-
-char* func_parsebuf::current_line()
-{
- return buf_start;
-}
-
-int func_parsebuf::seek_in_line(int i)
-{
- if (i < 0) {
- // Back up to preceding '\n'.
- if (i < -1) i = -1;
- backed_up_to_newline = 1;
- setg((char*)NewLine, (char*)NewLine+(i+1), (char*)NewLine+1);
- return i;
- }
- backed_up_to_newline = 0;
- int line_length = buf_end-buf_start;
- if (i <= line_length) {
- setg(buf_start, buf_start+i, buf_end);
- return i;
- }
- i -= line_length;
- if (i > 0) i = 1;
- setg((char*)NewLine, (char*)NewLine+i, (char*)NewLine+1);
- return line_length + i;
-}
-
-int func_parsebuf::underflow()
-{
- retry:
- if (gptr() < egptr())
- return *gptr();
- if (gptr() != (char*)NewLine+1) {
- // Get buffer was line buffer. Move to following '\n'.
- setg((char*)NewLine, (char*)NewLine, (char*)NewLine+1);
- return *gptr();
- }
- if (backed_up_to_newline)
- // Get buffer was '\n' preceding current line. Move to current line.
- backed_up_to_newline = 0;
- else {
- // Get buffer was '\n' following current line. Read new line.
- if (buf_start) free(buf_start);
- char *str = (*read_func)(arg);
- buf_start = str;
- if (str == NULL)
- return EOF;
- // Initially, _line_length == -1, so pos_at_line_start becomes 0.
- pos_at_line_start += _line_length + 1;
- _line_length = strlen(str);
- buf_end = str + _line_length;
- __line_number++;
- }
- setg(buf_start, buf_start, buf_end);
- goto retry;
-}
-
-#if 0
-size_t parsebuf::line_length()
-{
- if (current_line_length == (size_t)(-1)) // Initial value;
- (void)sgetc();
- return current_line_length;
-}
-#endif
-
-int parsebuf::seek_in_line(int i)
-{
-#if 1
- abort();
- return i; // Suppress warnings.
-#else
- if (i > 0) {
- size_t len = line_length();
- if ((unsigned)i > len) i = len;
- }
- else if (i < -1) i = -1;
- int new_pos = seekoff(pos_at_line_start + i, ios::beg);
- if (new_pos == EOF)
- return tell_in_line();
- else return new_pos - pos_at_line_start;
-#endif
-}
diff --git a/contrib/libio/parsestream.h b/contrib/libio/parsestream.h
deleted file mode 100644
index 97655bcbf691..000000000000
--- a/contrib/libio/parsestream.h
+++ /dev/null
@@ -1,156 +0,0 @@
-/* This is part of libio/iostream, providing -*- C++ -*- input/output.
-Copyright (C) 1993 Free Software Foundation
-
-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.
-
-Written by Per Bothner (bothner@cygnus.com). */
-
-#ifndef PARSESTREAM_H
-#define PARSESTREAM_H
-#ifdef __GNUG__
-#pragma interface
-#endif
-#include "streambuf.h"
-
-extern "C++" {
-// A parsebuf is a streambuf optimized for scanning text files.
-// It keeps track of line and column numbers.
-// It is guaranteed to remember the entire current line,
-// as well the '\n'-s on either side of it (if they exist).
-// You can arbitrarily seek (or unget) within this extended line.
-// Other backward seeks are not supported.
-// Normal read semantics are supported (and hence istream operators like >>).
-
-class parsebuf : public streambuf {
- protected:
- _IO_off_t pos_at_line_start;
- long _line_length;
- unsigned long __line_number;
- char *buf_start;
- char *buf_end;
-
- public:
- parsebuf *chain;
-
- // Return column number (raw - don't handle tabs etc).
- // Retult can be -1, meaning: at '\n' before current line.
- virtual int tell_in_line();
-
- // seek to (raw) column I in current line.
- // Result is new (raw) column position - differs from I if unable to seek.
- // Seek to -1 tries to seek to before previous LF.
- virtual int seek_in_line(int i);
-
- // Note: there is no "current line" initially, until something is read.
-
- // Current line number, starting with 0.
- // If tell_in_line()==-1, then line number of next line.
- int line_number() { return __line_number; }
-
- // Length of current line, not counting either '\n'.
- int line_length() { return _line_length; }
- // Current line - not a copy, so file ops may trash it.
- virtual char* current_line();
- virtual streampos seekoff(streamoff, _seek_dir, int mode=ios::in|ios::out);
- virtual streambuf* setbuf(char* p, int len);
- protected:
- parsebuf() { chain= NULL;
- __line_number = 0; pos_at_line_start = 0; _line_length = -1; }
- virtual int pbackfail(int c);
-};
-
-// A string_parsebuf is a parsebuf whose source is a fixed string.
-
-class string_parsebuf : public parsebuf {
- public:
- int do_delete;
- string_parsebuf(char *str, int len, int delete_at_close=0);
- virtual int underflow();
- virtual char* current_line();
- virtual int seek_in_line(int i);
- virtual int tell_in_line();
- char *left() const { return base(); }
- char *right() const { return ebuf(); }
-// streampos seekoff(streamoff, _seek_dir, int);
-};
-
-// A func_parsebuf calls a given function to get new input.
-// Each call returns an entire NUL-terminated line (without the '\n').
-// That line has been allocated with malloc(), not new.
-// The interface is tailored to the GNU readline library.
-// Example:
-// char* DoReadLine(void* arg)
-// {
-// char *line = readline((char*)arg); /* 'arg' is used as prompt. */
-// if line == NULL) { putc('\n', stderr); return NULL; }
-// if (line[0] != '\0') add_history(line);
-// return line;
-// }
-// char PromptBuffer[100] = "> ";
-// func_parsebuf my_stream(DoReadLine, PromptBuffer);
-
-typedef char *(*CharReader)(void *arg);
-class istream;
-
-class func_parsebuf : public parsebuf {
- public:
- void *arg;
- CharReader read_func;
- int backed_up_to_newline;
- func_parsebuf(CharReader func, void *argm = NULL);
- int underflow();
- virtual int tell_in_line();
- virtual int seek_in_line(int i);
- virtual char* current_line();
-};
-
-// A general_parsebuf is a parsebuf which gets its input from some
-// other streambuf. It explicitly buffers up an entire line.
-
-class general_parsebuf : public parsebuf {
- public:
- streambuf *sbuf;
- int delete_buf; // Delete sbuf when destroying this.
- general_parsebuf(streambuf *buf, int delete_arg_buf = 0);
- int underflow();
- virtual int tell_in_line();
- virtual int seek_in_line(int i);
- ~general_parsebuf();
- virtual char* current_line();
-};
-
-#if 0
-class parsestream : public istream {
- streammarker marks[2];
- short _first; // of the two marks; either 0 or 1
- int _lineno;
- int first() { return _first; }
- int second() { return 1-_first; }
- int line_length() { marks[second].delta(marks[first]); }
- int line_length() { marks[second].delta(marks[first]); }
- int seek_in_line(int i);
- int tell_in_line();
- int line_number();
-};
-#endif
-} // extern "C++"
-#endif /*!defined(PARSESTREAM_H)*/
diff --git a/contrib/libio/peekc.c b/contrib/libio/peekc.c
deleted file mode 100644
index 0b3b5140c26f..000000000000
--- a/contrib/libio/peekc.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/* Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
- This file is part of the GNU IO Library.
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License as
- published by the Free Software Foundation; either version 2, or (at
- your option) any later version.
-
- This library is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this library; see the file COPYING. If not, write to
- the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
- MA 02111-1307, USA.
-
- As a special exception, if you link this library with files
- compiled with a GNU compiler to produce an executable, this does
- not cause the resulting executable to be covered by the GNU General
- Public License. This exception does not however invalidate any
- other reasons why the executable file might be covered by the GNU
- General Public License. */
-
-#include "libioP.h"
-#include "stdio.h"
-
-#undef _IO_peekc
-
-int
-_IO_peekc_locked (fp)
- _IO_FILE *fp;
-{
- int result;
- CHECK_FILE (fp, EOF);
- _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
- _IO_flockfile (fp);
- result = _IO_peekc_unlocked (fp);
- _IO_cleanup_region_end (1);
- return result;
-}
diff --git a/contrib/libio/pfstream.cc b/contrib/libio/pfstream.cc
deleted file mode 100644
index 3fa93c958f8f..000000000000
--- a/contrib/libio/pfstream.cc
+++ /dev/null
@@ -1,92 +0,0 @@
-/* This is part of libio/iostream, providing -*- C++ -*- input/output.
-Copyright (C) 1993 Free Software Foundation
-
-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. */
-
-/* Written by Per Bothner (bothner@cygnus.com). */
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include "libioP.h"
-#include <pfstream.h>
-#include <procbuf.h>
-
-ipfstream::ipfstream(const char *name, int mode, int prot)
-{
- const char* p;
-
- // Look for '| command' (as used by ftp).
- for (p = name; *p == ' ' || *p == '\t'; p++) ;
- if (*p == '|') {
- procbuf *pbuf = new procbuf();
- init(pbuf);
- if (!pbuf->open(p+1, mode))
- set(ios::badbit);
- return;
- }
-
- // Look for 'command |'
- while (*p) p++; // Point to last
- while (p[-1] == ' ' || p[-1] == '\t' || p[-1] == '\n') p--;
- if (p[-1] == '|') {
- // Must remove the final '|'.
- p--;
-#if !defined (__GNUC__) || defined (__STRICT_ANSI__)
- char *command = new char[p-name+1];
-#else
- char command[p-name+1];
-#endif
- memcpy(command, name, p-name);
- command[p-name] = '\0';
-
- procbuf *pbuf = new procbuf();
- if (pbuf->open(command, mode))
- set(ios::badbit);
-#if !defined (__GNUC__) || defined (__STRICT_ANSI__)
- delete command;
-#endif
- return;
- }
-
- init(new filebuf());
- if (!rdbuf()->open(name, mode, prot))
- set(ios::badbit);
-}
-
-opfstream::opfstream(const char *name, int mode, int prot)
-{
- const char *p;
- // Look for '| command'.
- for (p = name; *p == ' ' || *p == '\t'; p++) ;
- if (*p == '|') {
- procbuf *pbuf = new procbuf();
- init(pbuf);
- if (!pbuf->open(p+1, mode))
- set(ios::badbit);
- }
- else {
- init(new filebuf());
- if (!rdbuf()->open(name, mode, prot))
- set(ios::badbit);
- }
-}
diff --git a/contrib/libio/pfstream.h b/contrib/libio/pfstream.h
deleted file mode 100644
index 3c5458baaa93..000000000000
--- a/contrib/libio/pfstream.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/* This is part of libio/iostream, providing -*- C++ -*- input/output.
-Copyright (C) 1993 Free Software Foundation
-
-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. */
-
-/* Written by Per Bothner (bothner@cygnus.com). */
-
-#ifndef _PFSTREAM_H
-#define _PFSTREAM_H
-#ifdef __GNUG__
-#pragma interface
-#endif
-#include <fstream.h>
-
-extern "C++" {
-// ipfstream foo("NAME") is like: ifstream foo("NAME"). However,
-// if NAME starts *or ends* with a '|', the remainder of NAME is
-// evaluated as a shell command (using a procbuf), and all input
-// read from foo is whatever that shell writes to its standard output.
-// E.g. ipfstream foo("|zcat foo.Z") or ipfstream foo("zcat foo.Z|")
-// (These two forms are equivalent.)
-
-class ipfstream : public ifstream {
- public:
- ipfstream(const char *name, int mode=ios::in, int prot=0664);
-};
-
-// opfstream foo("NAME") is like: ofstream foo("NAME").
-// However, if NAME starts with a '|', the remainder of NAME is
-// evaluated as a shell command (using a procbuf), and all output
-// written to foo is piped to the standard input of that shell.
-// E.g. opfstream foo("|more");
-
-class opfstream : public ofstream {
- public:
- opfstream(const char *name, int mode=ios::out, int prot=0664);
-};
-} // extern "C++"
-#endif /*!_PFSTREAM_H*/
-
diff --git a/contrib/libio/procbuf.cc b/contrib/libio/procbuf.cc
deleted file mode 100644
index eb6d50e7797f..000000000000
--- a/contrib/libio/procbuf.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-/* This is part of libio/iostream, providing -*- C++ -*- input/output.
-Copyright (C) 1993 Free Software Foundation
-
-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. */
-
-/* Written by Per Bothner (bothner@cygnus.com). */
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-
-#include "libioP.h"
-#include "procbuf.h"
-
-procbuf::procbuf(const char *command, int mode) : filebuf()
-{
- _IO_proc_open(this, command, (mode & ios::in) ? "r" : "w");
-}
-
-procbuf *procbuf::open(const char *command, int mode)
-{
- return (procbuf*)_IO_proc_open(this, command, (mode & ios::in) ? "r" : "w");
-}
-
-/* #define USE_SIGMASK */
-
-int procbuf::sys_close()
-{
- return _IO_proc_close(this);
-}
-
-procbuf::~procbuf()
-{
- close();
-}
diff --git a/contrib/libio/procbuf.h b/contrib/libio/procbuf.h
deleted file mode 100644
index b361a6a7c844..000000000000
--- a/contrib/libio/procbuf.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/* This is part of libio/iostream, providing -*- C++ -*- input/output.
-Copyright (C) 1993 Free Software Foundation
-
-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. */
-
-/* Written by Per Bothner (bothner@cygnus.com). */
-
-#ifndef _PROCBUF_H
-#define _PROCBUF_H
-#ifdef __GNUG__
-#pragma interface
-#endif
-
-#include <streambuf.h>
-
-extern "C++" {
-class procbuf : public filebuf {
- /* Following fields must match those in struct _IO_proc_file */
- _IO_pid_t _pid;
- procbuf *_next;
- public:
- procbuf() : filebuf() { }
- procbuf(const char *command, int mode);
- procbuf* open(const char *command, int mode);
- procbuf *close() { return (procbuf*)filebuf::close(); }
- virtual int sys_close();
- ~procbuf();
-};
-} // extern "C++"
-
-#endif /* !_PROCBUF_H */
diff --git a/contrib/libio/sbform.cc b/contrib/libio/sbform.cc
deleted file mode 100644
index c17bd08db15e..000000000000
--- a/contrib/libio/sbform.cc
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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 "streambuf.h"
-#include <stdarg.h>
-
-int streambuf::vform(char const *fmt0, _IO_va_list ap)
-{
- return _IO_vfprintf(this, fmt0, ap);
-}
-int streambuf::form(char const *format ...)
-{
- va_list ap;
- va_start(ap, format);
- int count = _IO_vfprintf(this, format, ap);
- va_end(ap);
- return count;
-}
diff --git a/contrib/libio/sbgetline.cc b/contrib/libio/sbgetline.cc
deleted file mode 100644
index 0475114c629e..000000000000
--- a/contrib/libio/sbgetline.cc
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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 "streambuf.h"
-
-long streambuf::sgetline(char* buf, _IO_size_t n, char delim, int extract_delim)
-{
- return _IO_getline_info(this, buf, n, delim, extract_delim, (int *) 0);
-}
diff --git a/contrib/libio/sbscan.cc b/contrib/libio/sbscan.cc
deleted file mode 100644
index c0ec35c53db6..000000000000
--- a/contrib/libio/sbscan.cc
+++ /dev/null
@@ -1,45 +0,0 @@
-
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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 "streambuf.h"
-#include <stdarg.h>
-
-int streambuf::vscan(char const *fmt0, _IO_va_list ap, ios* stream /* = NULL*/)
-{
- int errcode = 0;
- int count = _IO_vfscanf(this, fmt0, ap, &errcode);
- if (stream)
- stream->setstate((ios::iostate)errcode);
- return count;
-}
-int streambuf::scan(char const *format ...)
-{
- va_list ap;
- va_start(ap, format);
- int count = _IO_vfscanf(this, format, ap, NULL);
- va_end(ap);
- return count;
-}
diff --git a/contrib/libio/stdfiles.c b/contrib/libio/stdfiles.c
deleted file mode 100644
index 8453e33c34cd..000000000000
--- a/contrib/libio/stdfiles.c
+++ /dev/null
@@ -1,51 +0,0 @@
-/* Copyright (C) 1993, 1994, 1996, 1997 Free Software Foundation, Inc.
- This file is part of the GNU IO Library.
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License as
- published by the Free Software Foundation; either version 2, or (at
- your option) any later version.
-
- This library is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this library; see the file COPYING. If not, write to
- the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
- MA 02111-1307, USA.
-
- As a special exception, if you link this library with files
- compiled with a GNU compiler to produce an executable, this does
- not cause the resulting executable to be covered by the GNU General
- Public License. This exception does not however invalidate any
- other reasons why the executable file might be covered by the GNU
- General Public License. */
-
-
-/* This file provides definitions of _IO_stdin, _IO_stdout, and _IO_stderr
- for C code. Compare stdstreams.cc.
- (The difference is that here the vtable field is set to 0,
- so the objects defined are not valid C++ objects. On the other
- hand, we don't need a C++ compiler to build this file.) */
-
-#include "libioP.h"
-
-#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) \
- struct _IO_FILE_plus NAME \
- = {FILEBUF_LITERAL(CHAIN, FLAGS, FD), &_IO_file_jumps}
-#endif
-
-DEF_STDFILE(_IO_stdin_, 0, 0, _IO_NO_WRITES);
-DEF_STDFILE(_IO_stdout_, 1, &_IO_stdin_.file, _IO_NO_READS);
-DEF_STDFILE(_IO_stderr_, 2, &_IO_stdout_.file,
- _IO_NO_READS+_IO_UNBUFFERED);
-
-_IO_FILE *_IO_list_all = &_IO_stderr_.file;
diff --git a/contrib/libio/stdio/ChangeLog b/contrib/libio/stdio/ChangeLog
deleted file mode 100644
index 8ef9dcc0b3ce..000000000000
--- a/contrib/libio/stdio/ChangeLog
+++ /dev/null
@@ -1,153 +0,0 @@
-Fri Mar 16 12:46:19 GMT 2001 Bernd Schmidt (bernds@redhat.com)
-
- * gcc-2.95.3 Released.
-
-Sun Oct 24 23:54:10 PDT 1999 Jeff Law (law@cygnus.com)
-
- * gcc-2.95.2 Released.
-
-Mon Aug 16 01:29:24 PDT 1999 Jeff Law (law@cygnus.com)
-
- * gcc-2.95.1 Released.
-
-Wed Jul 28 21:39:31 PDT 1999 Jeff Law (law@cygnus.com)
-
- * gcc-2.95 Released.
-
-Sun Jul 25 23:40:51 PDT 1999 Jeff Law (law@cygnus.com)
-
- * gcc-2.95 Released.
-
-1997-09-04 16:11 Ulrich Drepper <drepper@cygnus.com>
-
- * Makefile.in (STDIO_OBJECTS): Lose feof.o and ferror.o. Add getc.o
- and putc.o.
- (stmp-libio, stmp-libiostream, stmp-io, stmp-streamlib): New rules.
-
- (iostream.list): Depend upon stmp-stdio. Add the entries
- from stdio.list to iostream.list.
- (stmp-stdio): New name for what was the stdio/stdio.list rule.
- All it now does is cd down into stdio and build stdio.list.
-
- * clearerr.c: Add copyright and lock stream before use.
- * feof.c: Likewise.
- * ferror.c: Likewise.
- * fgetc.c: Likewise.
- * fputc.c: Likewise.
- * freopen.c: Likewise.
- * fseek.c: Likewise.
- * getc.c: Likewise.
- * getchar.c: Likewise.
- * putc.c: Likewise.
- * putchar.c: Likewise.
- * rewind.c: Likewise.
-
- * setbuf.c: Update copyright.
- * setlinebuf.c: Likewise.
- * vscanf.c: Likewise.
-
- * fileno.c: Define alias fileno_unlocked. Update copyright.
-
- * clearerr_u.c: New file. Implement clearerr_unlocked function.
- * feof_u.c: New file. Implement feof_unlocked function.
- * ferror_u.c: New file. Implement ferror_unlocked function.
- * fputc_u.c: New file. Implement fputc_unlocked function.
- * getc_u.c: New file. Implement getc_unclocked function.
- * getchar_u.c: New file. Implement getchar_unclocked function.
- * putc_u.c: New file. Implement putc_unclocked function.
- * putchar_u.c: New file. Implement putchar_unclocked function.
-
- * vsnprintf.c: Rewrite according to ISO C 9X draft.
-
-Thu May 1 11:03:45 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * stdio.h (TMP_MAX): Wrap it with #ifndef for now, since it can
- get defined by <limits.h> (e.g., HP/UX and AIX).
-
-Wed Mar 12 08:51:37 1997 Gavin Koch <gavin@cygnus.com>
-
- * stdio.h: Use _IO_va_list rather than _G_va_list.
-
-Wed Jun 14 21:41:50 1995 Jason Merrill <jason@python.cygnus.com>
-
- * configure.in (LIBDIR): Set.
- (MOSTLYCLEAN): Remove pic and stamp-picdir.
- (stdio_objects): Also compile pic version.
-
- * Makefile.in (STDIO_OBJECTS): Remove getdelim.o.
-
-Wed May 10 03:05:53 1995 Jason Merrill <jason@python.cygnus.com>
-
- * vsnprintf.c (vsnprintf): Update to use _IO_JUMPS.
-
- * Makefile.in (STDIO_OBJECTS): Fix typo.
-
-Tue Oct 18 17:15:09 1994 Per Bothner <bothner@kalessin.cygnus.com>
-
- * getline.c, snprintf.c, vsnprintf.c: New files, providing
- functionality of the GNU C library.
- * Makefile.in (STDIO_OBJECTS), configure.in: Add new files.
- * stdio.h: Add new functions.
-
-Fri Oct 14 15:56:27 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * stdio.h: Added vfscanf, vscanf, vsscanf, #ifndef __STRICT_ANSI__.
-
-Tue Aug 23 16:17:25 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * stdio.h: Added comment, at hjl's request.
-
-Sun Aug 7 13:28:12 1994 H.J. Lu (hjl@nynexst.com)
-
- * stdio.h (getc, getchar, putc, putchar): New declarations.
- Move macros after the declarations.
-
-Fri Aug 5 18:27:21 1994 H.J. Lu (hjl@nynexst.com)
-
- * clearerr.c, rewind.c, setfileno.c:
- Add CHECK_FILE(fp, ) and remove COERCE_FILE(fp).
- * feof.c, ferror.c, fgetc.c, fileno.c, fputc.c, getw.c, putw.c,
- vfscanf.c: Add CHECK_FILE(fp, EOF) and remove COERCE_FILE(fp).
- * freopen.c: Add CHECK_FILE(fp, NULL) and remove COERCE_FILE(fp).
- * fseek.c, vfprintf.c:
- Add CHECK_FILE(fp, -1) and remove COERCE_FILE(fp).
-
-Fri May 20 13:11:58 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * stdio.h: Rename _ARGS macro to __P for better gnlibc and
- BSD compatibility.
-
-Fri Nov 26 13:26:35 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- Bunch of little changes, many from H.J. Lu <hjl@nynexst.com>.
- * feof.c, setbuf.c, vprintf.c, vcanf.c: #include <stdio.h>,
- for error checking.
- * fileno.c: #include libioP.h, not just libio.h.
- * fputc.c: Fix typo.
- * fseek.c, rewind.c: Use #include "...", not <...> ,for local files.
- * getc.c, getchar.c, putc.c, putchar.c: New files, providing
- non-macro versions of the standard macros.
- * getw.c, putw.c, setfileno.c, setlinebuf.c: New files.
- * Makefile.in (STDIO_OBJECTS): Add new files.
- * vfscanf.c: Add missing new 4th arg to _IO_vfscanf call.
-
-Thu Oct 14 16:12:07 1993 Karen Christiansen (karen@deneb.cygnus.com)
-
- * configure.in: changed mv to mv -f
-
-Mon Oct 4 17:29:23 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * configure.in (stdio_renames): Add fgetpos, fsetpos, gets,
- perror, setbuffer, ungetc.
- * clearerr.c, ferror.c, fgetc.c, fileno.c, fputc.c, freopen.c,
- fseek.c, popen.c, rewind.c, setbuf.c: New files.
- * Makefile.in (STDIO_OBJECTS): Add new files.
- * stdio.h: Use _IO_XXX instead of _G_XXX many places.
- #include <libio.h> instead of <_stdio.h>, to get useful defs.
-
-Fri Aug 20 00:28:28 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * feof.c, vprintf.c, vscanf.c: Converted stub functions.
- * configure.in (stdio_renamed): Removed feof.
- Added sprintf sscanf vsscanf.
- * ChangeLog.old: Copy of old libg++/iostream/stdio/ChangeLog.
diff --git a/contrib/libio/stdio/Makefile.in b/contrib/libio/stdio/Makefile.in
deleted file mode 100644
index 680c8a497a41..000000000000
--- a/contrib/libio/stdio/Makefile.in
+++ /dev/null
@@ -1,35 +0,0 @@
-srcdir = .
-
-#### package, host, target, and site dependent Makefile fragments come in here.
-##
-
-# These are compiled from the corresponding ../ioFOO.c files.
-STDIO_RENAMED_OBJECTS = ... filled in by configure ...
-# These are the files that a libc would want.
-STDIO_OBJECTS = $(STDIO_RENAMED_OBJECTS) \
- clearerr.o fdopen.o fgetc.o fileno.o \
- fputc.o freopen.o fseek.o getchar.o getline.o getw.o \
- popen.o putchar.o putw.o rewind.o \
- setbuf.o setfileno.o setlinebuf.o snprintf.o \
- vfprintf.o vfscanf.o vprintf.o vscanf.o vsnprintf.o
-
-CC_FOR_STDIO=$(CC)
-CINCLUDES = -I. -I$(srcdir) -I.. -I$(srcdir)/.. -D__USE_GNU
-
-nothing:
-
-stmp-libio: stdio.list stamp-io
-
-stamp-io:
- $(AR) $(AR_FLAGS) ../libio.a $(STDIO_OBJECTS)
- touch stmp-io
-
-stmp-libiostream: stdio.list stamp-streamlib
-
-stamp-streamlib:
- $(AR) $(AR_FLAGS) ../libiostream.a $(STDIO_OBJECTS)
- touch stmp-streamlib
-
-stdio.list: stamp-picdir $(STDIO_OBJECTS)
- @echo "$(STDIO_OBJECTS)" >stdio.list
-
diff --git a/contrib/libio/stdio/clearerr.c b/contrib/libio/stdio/clearerr.c
deleted file mode 100644
index 4776250ff8d9..000000000000
--- a/contrib/libio/stdio/clearerr.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Copyright (C) 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 "stdio.h"
-
-void
-clearerr (fp)
- FILE *fp;
-{
- CHECK_FILE (fp, /*nothing*/);
- _IO_flockfile (fp);
- _IO_clearerr (fp);
- _IO_funlockfile (fp);
-}
diff --git a/contrib/libio/stdio/clearerr_u.c b/contrib/libio/stdio/clearerr_u.c
deleted file mode 100644
index 2a1ba7070bb7..000000000000
--- a/contrib/libio/stdio/clearerr_u.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Copyright (C) 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 "stdio.h"
-
-void
-clearerr_unlocked (fp)
- FILE *fp;
-{
- CHECK_FILE (fp, /*nothing*/);
- _IO_clearerr (fp);
-}
diff --git a/contrib/libio/stdio/configure.in b/contrib/libio/stdio/configure.in
deleted file mode 100644
index 83cac17ebc7c..000000000000
--- a/contrib/libio/stdio/configure.in
+++ /dev/null
@@ -1,49 +0,0 @@
-# This file is a shell script fragment that supplies the information
-# necessary for a configure script to process the program in
-# this directory. For more information, look at ../configure.
-
-configdirs=
-srctrigger=stdio.h
-srcname="libio/stdio"
-package_makefile_frag=../Make.pack
-package_makefile_rules_frag=../Make.pack.r
-
-# per-host:
-
-# per-target:
-
-LIBDIR=yes
-TO_TOPDIR=../../
-ALL=nothing
-MOSTLYCLEAN='*.o pic stamp-picdir core stdio.list'
-(. ${srcdir}/../config.shared) >${package_makefile_frag} 2>${package_makefile_rules_frag}
-
-# post-target:
-
-# Certain files that are used to build a C library (such as fprintf.o)
-# are compled from the same sources as the ioXXX versions (such as ioprintf.c).
-# These lines add the appropriate rules.
-# NOTE: We assume a C compiler that where -o with -c works.
-# But these files are not built by default anyway ...
-
-# TODO: remove rename tmpfile tmpnam
-
-stdio_renames="fclose fflush fgetpos fgets fopen fprintf fputs fread \
- fscanf fsetpos ftell fwrite getdelim gets perror printf puts \
- scanf setbuffer setvbuf sprintf sscanf ungetc vsprintf vsscanf"
-stdio_objects=""
-
-for file in $stdio_renames ; do
- cat >>Makefile <<EOF
-$file.o: \$(srcdir)/../io$file.c
- if [ -n "\$(PICFLAG)" ]; then \\
- \$(CC_FOR_STDIO) \$(CFLAGS) \$(CINCLUDES) \$(PICFLAG) -c \\
- \$(srcdir)/../io$file.c -D_IO_$file=$file -o pic/$file.o; \\
- fi
- \$(CC_FOR_STDIO) \$(CFLAGS) \$(CINCLUDES) -c \\
- \$(srcdir)/../io$file.c -D_IO_$file=$file -o $file.o
-EOF
- stdio_objects="$stdio_objects $file.o"
-done
-sed -e "/STDIO_RENAMED_OBJECTS =/s/=.*/=${stdio_objects}/" <Makefile >tmp
-mv -f tmp Makefile
diff --git a/contrib/libio/stdio/fdopen.c b/contrib/libio/stdio/fdopen.c
deleted file mode 100644
index 83e026ec7f76..000000000000
--- a/contrib/libio/stdio/fdopen.c
+++ /dev/null
@@ -1,9 +0,0 @@
-#include "libioP.h"
-
-_IO_FILE *
-fdopen (fd, mode)
- int fd;
- const char *mode;
-{
- return _IO_fdopen (fd, mode);
-}
diff --git a/contrib/libio/stdio/feof.c b/contrib/libio/stdio/feof.c
deleted file mode 100644
index d06de044fba5..000000000000
--- a/contrib/libio/stdio/feof.c
+++ /dev/null
@@ -1,43 +0,0 @@
-/* Copyright (C) 1993, 1996, 1997 Free Software Foundation, Inc.
- This file is part of the GNU IO Library.
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License as
- published by the Free Software Foundation; either version 2, or (at
- your option) any later version.
-
- This library is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this library; see the file COPYING. If not, write to
- the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
- MA 02111-1307, USA.
-
- As a special exception, if you link this library with files
- compiled with a GNU compiler to produce an executable, this does
- not cause the resulting executable to be covered by the GNU General
- Public License. This exception does not however invalidate any
- other reasons why the executable file might be covered by the GNU
- General Public License. */
-
-#include "libioP.h"
-#include "stdio.h"
-
-int
-_IO_feof (fp)
- _IO_FILE* fp;
-{
- int result;
- 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
diff --git a/contrib/libio/stdio/feof_u.c b/contrib/libio/stdio/feof_u.c
deleted file mode 100644
index 4773599012dd..000000000000
--- a/contrib/libio/stdio/feof_u.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Copyright (C) 1993, 1996, 1997 Free Software Foundation, Inc.
- This file is part of the GNU IO Library.
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License as
- published by the Free Software Foundation; either version 2, or (at
- your option) any later version.
-
- This library is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this library; see the file COPYING. If not, write to
- the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
- MA 02111-1307, USA.
-
- As a special exception, if you link this library with files
- compiled with a GNU compiler to produce an executable, this does
- not cause the resulting executable to be covered by the GNU General
- Public License. This exception does not however invalidate any
- other reasons why the executable file might be covered by the GNU
- General Public License. */
-
-#include "libioP.h"
-#include "stdio.h"
-
-#undef feof_unlocked
-
-int
-feof_unlocked (fp)
- _IO_FILE* fp;
-{
- CHECK_FILE (fp, EOF);
- return _IO_feof_unlocked (fp);
-}
diff --git a/contrib/libio/stdio/ferror.c b/contrib/libio/stdio/ferror.c
deleted file mode 100644
index 855627ade66d..000000000000
--- a/contrib/libio/stdio/ferror.c
+++ /dev/null
@@ -1,43 +0,0 @@
-/* Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
- This file is part of the GNU IO Library.
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License as
- published by the Free Software Foundation; either version 2, or (at
- your option) any later version.
-
- This library is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this library; see the file COPYING. If not, write to
- the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
- MA 02111-1307, USA.
-
- As a special exception, if you link this library with files
- compiled with a GNU compiler to produce an executable, this does
- not cause the resulting executable to be covered by the GNU General
- Public License. This exception does not however invalidate any
- other reasons why the executable file might be covered by the GNU
- General Public License. */
-
-#include "libioP.h"
-#include "stdio.h"
-
-int
-_IO_ferror (fp)
- _IO_FILE* fp;
-{
- int result;
- 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
diff --git a/contrib/libio/stdio/ferror_u.c b/contrib/libio/stdio/ferror_u.c
deleted file mode 100644
index 6e13e53ddc00..000000000000
--- a/contrib/libio/stdio/ferror_u.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
- This file is part of the GNU IO Library.
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License as
- published by the Free Software Foundation; either version 2, or (at
- your option) any later version.
-
- This library is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this library; see the file COPYING. If not, write to
- the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
- MA 02111-1307, USA.
-
- As a special exception, if you link this library with files
- compiled with a GNU compiler to produce an executable, this does
- not cause the resulting executable to be covered by the GNU General
- Public License. This exception does not however invalidate any
- other reasons why the executable file might be covered by the GNU
- General Public License. */
-
-#include "libioP.h"
-#include "stdio.h"
-
-#undef ferror_unlocked
-
-int
-ferror_unlocked (fp)
- _IO_FILE* fp;
-{
- CHECK_FILE (fp, EOF);
- return _IO_ferror_unlocked (fp);
-}
diff --git a/contrib/libio/stdio/fgetc.c b/contrib/libio/stdio/fgetc.c
deleted file mode 100644
index 174e60fa3fd2..000000000000
--- a/contrib/libio/stdio/fgetc.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/* Copyright (C) 1993, 1995, 1997 Free Software Foundation, Inc.
- This file is part of the GNU IO Library.
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License as
- published by the Free Software Foundation; either version 2, or (at
- your option) any later version.
-
- This library is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this library; see the file COPYING. If not, write to
- the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
- MA 02111-1307, USA.
-
- As a special exception, if you link this library with files
- compiled with a GNU compiler to produce an executable, this does
- not cause the resulting executable to be covered by the GNU General
- Public License. This exception does not however invalidate any
- other reasons why the executable file might be covered by the GNU
- General Public License. */
-
-#include "libioP.h"
-#include "stdio.h"
-
-int
-fgetc (fp)
- FILE *fp;
-{
- 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;
-}
diff --git a/contrib/libio/stdio/fileno.c b/contrib/libio/stdio/fileno.c
deleted file mode 100644
index 7ff93e6a8138..000000000000
--- a/contrib/libio/stdio/fileno.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/* Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
- This file is part of the GNU IO Library.
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License as
- published by the Free Software Foundation; either version 2, or (at
- your option) any later version.
-
- This library is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this library; see the file COPYING. If not, write to
- the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
- MA 02111-1307, USA.
-
- As a special exception, if you link this library with files
- compiled with a GNU compiler to produce an executable, this does
- not cause the resulting executable to be covered by the GNU General
- Public License. This exception does not however invalidate any
- other reasons why the executable file might be covered by the GNU
- General Public License. */
-
-#include "libioP.h"
-#include "stdio.h"
-
-int
-fileno (fp)
- _IO_FILE* fp;
-{
- CHECK_FILE (fp, EOF);
-
- if (!(fp->_flags & _IO_IS_FILEBUF))
- return EOF;
-
- return _IO_fileno (fp);
-}
-
-#ifdef _IO_MTSAFE_IO
-#ifdef weak_alias
-/* The fileno implementation for libio does not require locking because
- it only accesses once a single variable and this is already atomic
- (at least at thread level). */
-
-weak_alias (fileno, fileno_unlocked)
-#endif
-#endif
diff --git a/contrib/libio/stdio/fputc.c b/contrib/libio/stdio/fputc.c
deleted file mode 100644
index 22cdfab9a844..000000000000
--- a/contrib/libio/stdio/fputc.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/* Copyright (C) 1993, 1996, 1997 Free Software Foundation, Inc.
- This file is part of the GNU IO Library.
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License as
- published by the Free Software Foundation; either version 2, or (at
- your option) any later version.
-
- This library is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this library; see the file COPYING. If not, write to
- the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
- MA 02111-1307, USA.
-
- As a special exception, if you link this library with files
- compiled with a GNU compiler to produce an executable, this does
- not cause the resulting executable to be covered by the GNU General
- Public License. This exception does not however invalidate any
- other reasons why the executable file might be covered by the GNU
- General Public License. */
-
-#include "libioP.h"
-#include "stdio.h"
-
-int
-fputc (c, fp)
- int c;
- _IO_FILE *fp;
-{
- 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;
-}
diff --git a/contrib/libio/stdio/fputc_u.c b/contrib/libio/stdio/fputc_u.c
deleted file mode 100644
index 48701e1d6cb5..000000000000
--- a/contrib/libio/stdio/fputc_u.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Copyright (C) 1993, 1996, 1997 Free Software Foundation, Inc.
- This file is part of the GNU IO Library.
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License as
- published by the Free Software Foundation; either version 2, or (at
- your option) any later version.
-
- This library is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this library; see the file COPYING. If not, write to
- the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
- MA 02111-1307, USA.
-
- As a special exception, if you link this library with files
- compiled with a GNU compiler to produce an executable, this does
- not cause the resulting executable to be covered by the GNU General
- Public License. This exception does not however invalidate any
- other reasons why the executable file might be covered by the GNU
- General Public License. */
-
-#include "libioP.h"
-#include "stdio.h"
-
-#undef fputc_unlocked
-
-int
-fputc_unlocked (c, fp)
- int c;
- _IO_FILE *fp;
-{
- CHECK_FILE (fp, EOF);
- return _IO_putc_unlocked (c, fp);
-}
diff --git a/contrib/libio/stdio/freopen.c b/contrib/libio/stdio/freopen.c
deleted file mode 100644
index ff57d6033dc1..000000000000
--- a/contrib/libio/stdio/freopen.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
- This file is part of the GNU IO Library.
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License as
- published by the Free Software Foundation; either version 2, or (at
- your option) any later version.
-
- This library is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this library; see the file COPYING. If not, write to
- the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
- MA 02111-1307, USA.
-
- As a special exception, if you link this library with files
- compiled with a GNU compiler to produce an executable, this does
- not cause the resulting executable to be covered by the GNU General
- Public License. This exception does not however invalidate any
- other reasons why the executable file might be covered by the GNU
- General Public License. */
-
-#include "libioP.h"
-#include "stdio.h"
-
-FILE*
-freopen (filename, mode, fp)
- const char* filename;
- const char* mode;
- FILE* fp;
-{
- FILE *result;
- CHECK_FILE (fp, NULL);
- if (!(fp->_flags & _IO_IS_FILEBUF))
- return NULL;
- _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
- _IO_flockfile (fp);
- result = _IO_freopen (filename, mode, fp);
- _IO_cleanup_region_end (1);
- return result;
-}
diff --git a/contrib/libio/stdio/fseek.c b/contrib/libio/stdio/fseek.c
deleted file mode 100644
index f2563d33f28f..000000000000
--- a/contrib/libio/stdio/fseek.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/* Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
- This file is part of the GNU IO Library.
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License as
- published by the Free Software Foundation; either version 2, or (at
- your option) any later version.
-
- This library is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this library; see the file COPYING. If not, write to
- the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
- MA 02111-1307, USA.
-
- As a special exception, if you link this library with files
- compiled with a GNU compiler to produce an executable, this does
- not cause the resulting executable to be covered by the GNU General
- Public License. This exception does not however invalidate any
- other reasons why the executable file might be covered by the GNU
- General Public License. */
-
-#include "libioP.h"
-#include "stdio.h"
-
-int
-fseek (fp, offset, whence)
- _IO_FILE* fp;
- long int offset;
- int whence;
-{
- int result;
- CHECK_FILE (fp, -1);
- _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
- _IO_flockfile (fp);
- result = _IO_fseek (fp, offset, whence);
- _IO_cleanup_region_end (1);
- return result;
-}
diff --git a/contrib/libio/stdio/getc.c b/contrib/libio/stdio/getc.c
deleted file mode 100644
index 1dc53b5ed651..000000000000
--- a/contrib/libio/stdio/getc.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/* Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
- This file is part of the GNU IO Library.
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License as
- published by the Free Software Foundation; either version 2, or (at
- your option) any later version.
-
- This library is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this library; see the file COPYING. If not, write to
- the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
- MA 02111-1307, USA.
-
- As a special exception, if you link this library with files
- compiled with a GNU compiler to produce an executable, this does
- not cause the resulting executable to be covered by the GNU General
- Public License. This exception does not however invalidate any
- other reasons why the executable file might be covered by the GNU
- General Public License. */
-
-#include "libioP.h"
-#include "stdio.h"
-
-#undef _IO_getc
-
-int
-_IO_getc (fp)
- FILE *fp;
-{
- 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
diff --git a/contrib/libio/stdio/getc_u.c b/contrib/libio/stdio/getc_u.c
deleted file mode 100644
index f07442744661..000000000000
--- a/contrib/libio/stdio/getc_u.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
- This file is part of the GNU IO Library.
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License as
- published by the Free Software Foundation; either version 2, or (at
- your option) any later version.
-
- This library is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this library; see the file COPYING. If not, write to
- the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
- MA 02111-1307, USA.
-
- As a special exception, if you link this library with files
- compiled with a GNU compiler to produce an executable, this does
- not cause the resulting executable to be covered by the GNU General
- Public License. This exception does not however invalidate any
- other reasons why the executable file might be covered by the GNU
- General Public License. */
-
-#include "libioP.h"
-#include "stdio.h"
-
-#undef getc_unlocked
-
-int
-getc_unlocked (fp)
- FILE *fp;
-{
- CHECK_FILE (fp, EOF);
- return _IO_getc_unlocked (fp);
-}
diff --git a/contrib/libio/stdio/getchar.c b/contrib/libio/stdio/getchar.c
deleted file mode 100644
index 93194b3912d9..000000000000
--- a/contrib/libio/stdio/getchar.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/* Copyright (C) 1993, 1996, 1997 Free Software Foundation, Inc.
- This file is part of the GNU IO Library.
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License as
- published by the Free Software Foundation; either version 2, or (at
- your option) any later version.
-
- This library is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this library; see the file COPYING. If not, write to
- the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
- MA 02111-1307, USA.
-
- As a special exception, if you link this library with files
- compiled with a GNU compiler to produce an executable, this does
- not cause the resulting executable to be covered by the GNU General
- Public License. This exception does not however invalidate any
- other reasons why the executable file might be covered by the GNU
- General Public License. */
-
-#include "libioP.h"
-#include "stdio.h"
-
-#undef getchar
-
-int
-getchar ()
-{
- int result;
- _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, stdin);
- _IO_flockfile (stdin);
- result = _IO_getc_unlocked (stdin);
- _IO_cleanup_region_end (1);
- return result;
-}
diff --git a/contrib/libio/stdio/getchar_u.c b/contrib/libio/stdio/getchar_u.c
deleted file mode 100644
index bfbe56b30c09..000000000000
--- a/contrib/libio/stdio/getchar_u.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Copyright (C) 1993, 1996, 1997 Free Software Foundation, Inc.
- This file is part of the GNU IO Library.
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License as
- published by the Free Software Foundation; either version 2, or (at
- your option) any later version.
-
- This library is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this library; see the file COPYING. If not, write to
- the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
- MA 02111-1307, USA.
-
- As a special exception, if you link this library with files
- compiled with a GNU compiler to produce an executable, this does
- not cause the resulting executable to be covered by the GNU General
- Public License. This exception does not however invalidate any
- other reasons why the executable file might be covered by the GNU
- General Public License. */
-
-#include "libioP.h"
-#include "stdio.h"
-
-#undef getchar_unlocked
-
-int
-getchar_unlocked ()
-{
- return _IO_getc_unlocked (stdin);
-}
diff --git a/contrib/libio/stdio/getline.c b/contrib/libio/stdio/getline.c
deleted file mode 100644
index 6f4b677086e8..000000000000
--- a/contrib/libio/stdio/getline.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include "libioP.h"
-#include "stdio.h"
-
-/* NOTE: This geline function is different from _IO_getline. */
-
-_IO_ssize_t
-getline (lineptr, linelen, fp)
- char** lineptr;
- size_t* linelen;
- FILE* fp;
-{
- return _IO_getdelim (lineptr, linelen, '\n', fp);
-}
diff --git a/contrib/libio/stdio/getw.c b/contrib/libio/stdio/getw.c
deleted file mode 100644
index 1dfafbc1d4f4..000000000000
--- a/contrib/libio/stdio/getw.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include "libioP.h"
-#include "stdio.h"
-
-int
-getw(fp)
- FILE *fp;
-{
- int w;
- _IO_size_t bytes_read;
- CHECK_FILE(fp, EOF);
- bytes_read = _IO_sgetn (fp, (char*)&w, sizeof(w));
- return sizeof(w) == bytes_read ? w : EOF;
-}
diff --git a/contrib/libio/stdio/obprintf.c b/contrib/libio/stdio/obprintf.c
deleted file mode 100644
index 6b959e455a8d..000000000000
--- a/contrib/libio/stdio/obprintf.c
+++ /dev/null
@@ -1,168 +0,0 @@
-/* Print output of stream to given obstack.
- Copyright (C) 1996, 1997 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-
-#ifdef __STDC__
-#include <stdlib.h>
-#endif
-#include "libioP.h"
-#include <string.h>
-#include <errno.h>
-#include <obstack.h>
-#include <stdarg.h>
-
-
-struct _IO_obstack_file
-{
- struct _IO_FILE file;
- const void *vtable;
- struct obstack *obstack;
-};
-
-
-static int
-_IO_obstack_overflow (_IO_FILE *fp, int c)
-{
- struct obstack *obstack = ((struct _IO_obstack_file *) fp)->obstack;
-
- /* Make room for another character. This might as well allocate a
- new chunk a memory and moves the old contents over. */
- if (c != EOF)
- obstack_1grow (obstack, c);
-
- /* Setup the buffer pointers again. */
- fp->_IO_write_base = obstack_base (obstack);
- fp->_IO_write_ptr = obstack_next_free (obstack);
- fp->_IO_write_end = fp->_IO_write_base + obstack_room (obstack);
- /* Now allocate the rest of the current chunk. */
- obstack_blank_fast (obstack, fp->_IO_write_end - fp->_IO_write_ptr);
-
- return c;
-}
-
-
-static _IO_size_t
-_IO_obstack_xsputn (_IO_FILE *fp, const void *data, _IO_size_t n)
-{
- struct obstack *obstack = ((struct _IO_obstack_file *) fp)->obstack;
-
- if (fp->_IO_write_ptr + n > fp->_IO_write_end)
- {
- /* We need some more memory. First shrink the buffer to the
- space we really currently need. */
- obstack_blank (obstack, fp->_IO_write_ptr - fp->_IO_write_end);
-
- /* Now grow for N bytes. */
- obstack_blank (obstack, n);
-
- /* Setup the buffer pointers again. */
- fp->_IO_write_base = obstack_base (obstack);
- fp->_IO_write_ptr = obstack_next_free (obstack);
- fp->_IO_write_end = (fp->_IO_write_base + obstack_room (obstack));
- /* Now allocate the rest of the current chunk. */
- obstack_blank_fast (obstack, fp->_IO_write_end - fp->_IO_write_ptr);
- }
- else
- {
- memcpy (fp->_IO_write_ptr, data, n);
- fp->_IO_write_ptr += n;
- }
-
- return n;
-}
-
-
-/* the jump table. */
-static struct _IO_jump_t _IO_obstack_jumps =
-{
- JUMP_INIT_DUMMY,
- JUMP_INIT(finish, NULL),
- JUMP_INIT(overflow, _IO_obstack_overflow),
- JUMP_INIT(underflow, NULL),
- JUMP_INIT(uflow, NULL),
- JUMP_INIT(pbackfail, NULL),
- JUMP_INIT(xsputn, _IO_obstack_xsputn),
- JUMP_INIT(xsgetn, NULL),
- JUMP_INIT(seekoff, NULL),
- JUMP_INIT(seekpos, NULL),
- JUMP_INIT(setbuf, NULL),
- JUMP_INIT(sync, NULL),
- JUMP_INIT(doallocate, NULL),
- JUMP_INIT(read, NULL),
- JUMP_INIT(write, NULL),
- JUMP_INIT(seek, NULL),
- JUMP_INIT(close, NULL),
- JUMP_INIT(stat, NULL)
-};
-
-
-int
-_IO_obstack_vprintf (struct obstack *obstack, const char *format, va_list args)
-{
- struct obstack_FILE
- {
- struct _IO_obstack_file ofile;
-#ifdef _IO_MTSAFE_IO
- _IO_lock_t lock;
-#endif
- } new_f;
- int result;
-
-#ifdef _IO_MTSAFE_IO
- new_f.ofile.file._lock = &new_f.lock;
-#endif
-
- _IO_init ((_IO_FILE *) &new_f.ofile, 0);
- _IO_JUMPS (&new_f.ofile.file) = &_IO_obstack_jumps;
- _IO_str_init_static (&new_f.ofile.file, obstack_base (obstack),
- (obstack_object_size (obstack) +
- obstack_room (obstack)), obstack_next_free (obstack));
- /* Now allocate the rest of the current chunk. */
- obstack_blank_fast (obstack,
- (new_f.ofile.file._IO_write_end
- - new_f.ofile.file._IO_write_ptr));
- new_f.ofile.obstack = obstack;
-
- result = _IO_vfprintf ((_IO_FILE *) &new_f, format, args);
-
- /* Shrink the buffer to the space we really currently need. */
- obstack_blank (obstack, (new_f.ofile.file._IO_write_ptr
- - new_f.ofile.file._IO_write_end));
-
- return result;
-}
-#ifdef weak_alias
-weak_alias (_IO_obstack_vprintf, obstack_vprintf)
-#endif
-
-
-int
-_IO_obstack_printf (struct obstack *obstack, const char *format, ...)
-{
- int result;
- va_list ap;
- va_start (ap, format);
- result = _IO_obstack_vprintf (obstack, format, ap);
- va_end (ap);
- return result;
-}
-#ifdef weak_alias
-weak_alias (_IO_obstack_printf, obstack_printf)
-#endif
diff --git a/contrib/libio/stdio/popen.c b/contrib/libio/stdio/popen.c
deleted file mode 100644
index 9f9f3f72f58e..000000000000
--- a/contrib/libio/stdio/popen.c
+++ /dev/null
@@ -1,23 +0,0 @@
-#include "libioP.h"
-#include "stdio.h"
-#include <errno.h>
-
-FILE *
-popen(command, mode)
- const char *command; const char *mode;
-{
- return _IO_popen(command, mode);
-}
-
-int
-pclose(fp)
- FILE *fp;
-{
-#if 0
- /* Does not actually test that stream was created by popen(). Instead,
- it depends on the filebuf::sys_close() virtual to Do The Right Thing. */
- if (fp is not a proc_file)
- return -1;
-#endif
- return _IO_fclose(fp);
-}
diff --git a/contrib/libio/stdio/putc.c b/contrib/libio/stdio/putc.c
deleted file mode 100644
index 3c35c365f07a..000000000000
--- a/contrib/libio/stdio/putc.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/* 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 "stdio.h"
-
-#undef _IO_putc
-
-int
-_IO_putc (c, fp)
- int c;
- _IO_FILE *fp;
-{
- 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
diff --git a/contrib/libio/stdio/putc_u.c b/contrib/libio/stdio/putc_u.c
deleted file mode 100644
index b4d94e8912bc..000000000000
--- a/contrib/libio/stdio/putc_u.c
+++ /dev/null
@@ -1,31 +0,0 @@
-/* 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 "stdio.h"
-
-#undef putc_unlocked
-
-int
-putc_unlocked (c, fp)
- int c;
- _IO_FILE *fp;
-{
- CHECK_FILE (fp, EOF);
- return _IO_putc_unlocked (c, fp);
-}
diff --git a/contrib/libio/stdio/putchar.c b/contrib/libio/stdio/putchar.c
deleted file mode 100644
index 1e1dd1376267..000000000000
--- a/contrib/libio/stdio/putchar.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/* 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 "stdio.h"
-
-#undef putchar
-
-int
-putchar (c)
- int c;
-{
- int result;
- _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile,
- _IO_stdout);
- _IO_flockfile (_IO_stdout);
- result = _IO_putc_unlocked (c, _IO_stdout);
- _IO_cleanup_region_end (1);
- return result;
-}
diff --git a/contrib/libio/stdio/putchar_u.c b/contrib/libio/stdio/putchar_u.c
deleted file mode 100644
index f8f387ac4edb..000000000000
--- a/contrib/libio/stdio/putchar_u.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/* 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 "stdio.h"
-
-#undef putchar_unlocked
-
-int
-putchar_unlocked (c)
- int c;
-{
- CHECK_FILE (stdout, EOF);
- return _IO_putc_unlocked (c, stdout);
-}
diff --git a/contrib/libio/stdio/putw.c b/contrib/libio/stdio/putw.c
deleted file mode 100644
index fd73261359cf..000000000000
--- a/contrib/libio/stdio/putw.c
+++ /dev/null
@@ -1,15 +0,0 @@
-#include "libioP.h"
-#include "stdio.h"
-
-#undef putw
-
-int
-putw(w, fp)
- int w;
- FILE *fp;
-{
- _IO_size_t written;
- CHECK_FILE(fp, EOF);
- written = _IO_sputn(fp, (const char *)&w, sizeof(w));
- return written == sizeof(w) ? 0 : EOF;
-}
diff --git a/contrib/libio/stdio/rewind.c b/contrib/libio/stdio/rewind.c
deleted file mode 100644
index bce27575fd8a..000000000000
--- a/contrib/libio/stdio/rewind.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Copyright (C) 1993, 1996, 1997 Free Software Foundation, Inc.
- This file is part of the GNU IO Library.
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License as
- published by the Free Software Foundation; either version 2, or (at
- your option) any later version.
-
- This library is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this library; see the file COPYING. If not, write to
- the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
- MA 02111-1307, USA.
-
- As a special exception, if you link this library with files
- compiled with a GNU compiler to produce an executable, this does
- not cause the resulting executable to be covered by the GNU General
- Public License. This exception does not however invalidate any
- other reasons why the executable file might be covered by the GNU
- General Public License. */
-
-#include "libioP.h"
-#include "stdio.h"
-
-void
-rewind (fp)
- _IO_FILE *fp;
-{
- CHECK_FILE (fp, );
- _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
- _IO_flockfile (fp);
- _IO_rewind (fp);
- _IO_cleanup_region_end (1);
-}
diff --git a/contrib/libio/stdio/setbuf.c b/contrib/libio/stdio/setbuf.c
deleted file mode 100644
index ac323a31b5ba..000000000000
--- a/contrib/libio/stdio/setbuf.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Copyright (C) 1993, 1997 Free Software Foundation, Inc.
- This file is part of the GNU IO Library.
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License as
- published by the Free Software Foundation; either version 2, or (at
- your option) any later version.
-
- This library is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this library; see the file COPYING. If not, write to
- the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
- MA 02111-1307, USA.
-
- As a special exception, if you link this library with files
- compiled with a GNU compiler to produce an executable, this does
- not cause the resulting executable to be covered by the GNU General
- Public License. This exception does not however invalidate any
- other reasons why the executable file might be covered by the GNU
- General Public License. */
-
-#include "libioP.h"
-#include "stdio.h"
-
-void
-setbuf (fp, buf)
- _IO_FILE *fp;
- char *buf;
-{
- _IO_setbuffer (fp, buf, _IO_BUFSIZ);
-}
diff --git a/contrib/libio/stdio/setfileno.c b/contrib/libio/stdio/setfileno.c
deleted file mode 100644
index f7ccc6fdd666..000000000000
--- a/contrib/libio/stdio/setfileno.c
+++ /dev/null
@@ -1,17 +0,0 @@
-/* Some known programs (xterm, pdksh?) non-portably change the _file
- field of s struct _iobuf. This kludge allows the same "functionality".
- This code is an undocumented feature for iostream/stdio. Use it at
- your own risk. */
-
-#include "libioP.h"
-#include "stdio.h"
-
-void
-setfileno(fp, fd)
- _IO_FILE* fp;
- int fd;
-{
- CHECK_FILE(fp, );
- if ((fp->_flags & _IO_IS_FILEBUF) != 0)
- fp->_fileno = fd;
-}
diff --git a/contrib/libio/stdio/setlinebuf.c b/contrib/libio/stdio/setlinebuf.c
deleted file mode 100644
index e4e029faeac2..000000000000
--- a/contrib/libio/stdio/setlinebuf.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/* Copyright (C) 1993, 1997 Free Software Foundation, Inc.
- This file is part of the GNU IO Library.
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License as
- published by the Free Software Foundation; either version 2, or (at
- your option) any later version.
-
- This library is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this library; see the file COPYING. If not, write to
- the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
- MA 02111-1307, USA.
-
- As a special exception, if you link this library with files
- compiled with a GNU compiler to produce an executable, this does
- not cause the resulting executable to be covered by the GNU General
- Public License. This exception does not however invalidate any
- other reasons why the executable file might be covered by the GNU
- General Public License. */
-
-#include "libioP.h"
-#include "stdio.h"
-
-#undef setlinebuf
-
-void
-setlinebuf (stream)
- _IO_FILE *stream;
-{
- _IO_setvbuf (stream, NULL, 1, 0);
-}
diff --git a/contrib/libio/stdio/snprintf.c b/contrib/libio/stdio/snprintf.c
deleted file mode 100644
index 5c70a4441127..000000000000
--- a/contrib/libio/stdio/snprintf.c
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
-Copyright (C) 1994 Free Software Foundation
-
-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"
-
-#ifdef __STDC__
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
-
-int
-snprintf
-#ifdef __STDC__
- (char *string, _IO_size_t maxlen, const char *format, ...)
-#else
-(string, maxlen, format, va_alist)
- char *string;
- _IO_size_t maxlen;
- char *format;
- va_dcl
-#endif
-{
- int ret;
- va_list args;
- _IO_va_start(args, format);
- ret = vsnprintf(string, maxlen, format, args);
- va_end(args);
- return ret;
-}
diff --git a/contrib/libio/stdio/stdio.h b/contrib/libio/stdio/stdio.h
deleted file mode 100644
index 30065ac87149..000000000000
--- a/contrib/libio/stdio/stdio.h
+++ /dev/null
@@ -1,219 +0,0 @@
-/* This is part of the iostream/stdio library, providing -*- C -*- I/O.
- Define ANSI C stdio on top of C++ iostreams.
- Copyright (C) 1991, 1994 Free Software Foundation
-
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Library General Public
-License as published by the Free Software Foundation; either
-version 2 of the License, or (at your option) any later version.
-
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Library General Public License for more details.
-
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-/*
- * ANSI Standard: 4.9 INPUT/OUTPUT <stdio.h>
- */
-
-#ifndef _STDIO_H
-#define _STDIO_H
-#define _STDIO_USES_IOSTREAM
-
-#include <libio.h>
-
-#ifndef NULL
-#ifdef __cplusplus
-#define NULL 0
-#else
-#define NULL (void*)0
-#endif
-#endif
-
-#ifndef EOF
-#define EOF (-1)
-#endif
-#ifndef BUFSIZ
-#define BUFSIZ 1024
-#endif
-
-#define _IOFBF 0 /* Fully buffered. */
-#define _IOLBF 1 /* Line buffered. */
-#define _IONBF 2 /* No buffering. */
-
-#define SEEK_SET 0
-#define SEEK_CUR 1
-#define SEEK_END 2
-
- /* define size_t. Crud in case <sys/types.h> has defined it. */
-#if !defined(_SIZE_T) && !defined(_T_SIZE_) && !defined(_T_SIZE)
-#if !defined(__SIZE_T) && !defined(_SIZE_T_) && !defined(___int_size_t_h)
-#if !defined(_GCC_SIZE_T) && !defined(_SIZET_)
-#define _SIZE_T
-#define _T_SIZE_
-#define _T_SIZE
-#define __SIZE_T
-#define _SIZE_T_
-#define ___int_size_t_h
-#define _GCC_SIZE_T
-#define _SIZET_
-typedef _IO_size_t size_t;
-#endif
-#endif
-#endif
-
-typedef struct _IO_FILE FILE;
-typedef _IO_fpos_t fpos_t;
-
-#define FOPEN_MAX _G_FOPEN_MAX
-#define FILENAME_MAX _G_FILENAME_MAX
-#ifndef TMP_MAX
-#define TMP_MAX 999 /* Only limited by filename length */
-#endif
-
-#define L_ctermid 9
-#define L_cuserid 9
-#define P_tmpdir "/tmp"
-#define L_tmpnam 20
-
-/* For use by debuggers. These are linked in if printf or fprintf are used. */
-extern FILE *stdin, *stdout, *stderr; /* TODO */
-
-#define stdin _IO_stdin
-#define stdout _IO_stdout
-#define stderr _IO_stderr
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef __P
-#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
-#define __P(args) args
-#else
-#define __P(args) ()
-#endif
-#endif /*!__P*/
-
-extern void clearerr __P((FILE*));
-extern int fclose __P((FILE*));
-extern int feof __P((FILE*));
-extern int ferror __P((FILE*));
-extern int fflush __P((FILE*));
-extern int fgetc __P((FILE *));
-extern int fgetpos __P((FILE* fp, fpos_t *pos));
-extern char* fgets __P((char*, int, FILE*));
-extern FILE* fopen __P((const char*, const char*));
-extern int fprintf __P((FILE*, const char* format, ...));
-extern int fputc __P((int, FILE*));
-extern int fputs __P((const char *str, FILE *fp));
-extern size_t fread __P((void*, size_t, size_t, FILE*));
-extern FILE* freopen __P((const char*, const char*, FILE*));
-extern int fscanf __P((FILE *fp, const char* format, ...));
-extern int fseek __P((FILE* fp, long int offset, int whence));
-extern int fsetpos __P((FILE* fp, const fpos_t *pos));
-extern long int ftell __P((FILE* fp));
-extern size_t fwrite __P((const void*, size_t, size_t, FILE*));
-extern int getc __P((FILE *));
-extern int getchar __P((void));
-extern char* gets __P((char*));
-extern void perror __P((const char *));
-extern int printf __P((const char* format, ...));
-extern int putc __P((int, FILE *));
-extern int putchar __P((int));
-extern int puts __P((const char *str));
-extern int remove __P((const char*));
-extern int rename __P((const char* _old, const char* _new));
-extern void rewind __P((FILE*));
-extern int scanf __P((const char* format, ...));
-extern void setbuf __P((FILE*, char*));
-extern void setlinebuf __P((FILE*));
-extern void setbuffer __P((FILE*, char*, int));
-extern int setvbuf __P((FILE*, char*, int mode, size_t size));
-extern int sprintf __P((char*, const char* format, ...));
-extern int sscanf __P((const char* string, const char* format, ...));
-extern FILE* tmpfile __P((void));
-extern char* tmpnam __P((char*));
-extern int ungetc __P((int c, FILE* fp));
-extern int vfprintf __P((FILE *fp, char const *fmt0, _IO_va_list));
-extern int vprintf __P((char const *fmt, _IO_va_list));
-extern int vsprintf __P((char* string, const char* format, _IO_va_list));
-
-#ifndef __STRICT_ANSI__
-extern int vfscanf __P((FILE*, const char *, _IO_va_list));
-extern int vscanf __P((const char *, _IO_va_list));
-extern int vsscanf __P((const char *, const char *, _IO_va_list));
-#endif
-
-#if !defined(__STRICT_ANSI__) || defined(_POSIX_SOURCE)
-extern FILE *fdopen __P((int, const char *));
-extern int fileno __P((FILE*));
-extern FILE* popen __P((const char*, const char*));
-extern int pclose __P((FILE*));
-#endif
-
-#ifdef __USE_GNU
-extern _IO_ssize_t getdelim __P ((char **, size_t *, int, FILE*));
-extern _IO_ssize_t getline __P ((char **, size_t *, FILE *));
-
-extern int snprintf __P ((char *, size_t, const char *, ...));
-extern int vsnprintf __P ((char *, size_t, const char *, _IO_va_list));
-#endif
-
-extern int __underflow __P((struct _IO_FILE*));
-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 putc(c, fp) _IO_putc(c, fp)
-#define putchar(c) _IO_putc(c, stdout)
-#define getchar() _IO_getc(stdin)
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /*!_STDIO_H*/
diff --git a/contrib/libio/stdio/vasprintf.c b/contrib/libio/stdio/vasprintf.c
deleted file mode 100644
index 15513d0fca7d..000000000000
--- a/contrib/libio/stdio/vasprintf.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/* Copyright (C) 1995, 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 <malloc.h>
-#include "libioP.h"
-#include "stdio.h"
-#include "strfile.h"
-
-int
-_IO_vasprintf (result_ptr, format, args)
- char **result_ptr;
- const char *format;
- _IO_va_list args;
-{
- /* Initial size of the buffer to be used. Will be doubled each time an
- overflow occurs. */
- const _IO_size_t init_string_size = 100;
- char *string;
- _IO_strfile sf;
-#ifdef _IO_MTSAFE_IO
- _IO_lock_t lock;
-#endif
- int ret;
- string = (char *) malloc (init_string_size);
- if (string == NULL)
- return -1;
-#ifdef _IO_MTSAFE_IO
- sf._sbf._f._lock = &lock;
-#endif
- _IO_init ((_IO_FILE *) &sf, 0);
- _IO_JUMPS ((_IO_FILE *) &sf) = &_IO_str_jumps;
- _IO_str_init_static ((_IO_FILE *) &sf, string, init_string_size, string);
- sf._sbf._f._flags &= ~_IO_USER_BUF;
- sf._s._allocate_buffer = (_IO_alloc_type) malloc;
- sf._s._free_buffer = (_IO_free_type) free;
- ret = _IO_vfprintf ((_IO_FILE *) &sf, format, args);
- if (ret < 0)
- return ret;
- *result_ptr = (char *) realloc (sf._sbf._f._IO_buf_base,
- (sf._sbf._f._IO_write_ptr
- - sf._sbf._f._IO_write_base) +1);
- if (*result_ptr == NULL)
- *result_ptr = sf._sbf._f._IO_buf_base;
- (*result_ptr)[sf._sbf._f._IO_write_ptr-sf._sbf._f._IO_write_base] = '\0';
- return ret;
-}
-
-#ifdef weak_alias
-weak_alias (_IO_vasprintf, vasprintf)
-#endif
diff --git a/contrib/libio/stdio/vfprintf.c b/contrib/libio/stdio/vfprintf.c
deleted file mode 100644
index fca620944529..000000000000
--- a/contrib/libio/stdio/vfprintf.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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"
-
-int
-vfprintf(fp, format, args)
- register _IO_FILE* fp;
- char const *format;
- _IO_va_list args;
-{
- CHECK_FILE(fp, -1);
- return _IO_vfprintf(fp, format, args);
-}
diff --git a/contrib/libio/stdio/vfscanf.c b/contrib/libio/stdio/vfscanf.c
deleted file mode 100644
index 1759ee5ee017..000000000000
--- a/contrib/libio/stdio/vfscanf.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-This file is part of the GNU IO Library. This library is free
-software; you can redistribute it and/or modify it under the
-terms of the GNU General Public License as published by the
-Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this library; see the file COPYING. If not, write to the Free
-Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-As a special exception, if you link this library with files
-compiled with a GNU compiler to produce an executable, this does not cause
-the resulting executable to be covered by the GNU General Public License.
-This exception does not however invalidate any other reasons why
-the executable file might be covered by the GNU General Public License. */
-
-#include "libioP.h"
-#include "stdio.h"
-
-int
-vfscanf(fp, format, args)
- register _IO_FILE* fp;
- const char *format;
- _IO_va_list args;
-{
- CHECK_FILE(fp, EOF);
- return _IO_vfscanf(fp, format, args, NULL);
-}
diff --git a/contrib/libio/stdio/vprintf.c b/contrib/libio/stdio/vprintf.c
deleted file mode 100644
index 784f0d9b8dfe..000000000000
--- a/contrib/libio/stdio/vprintf.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-This file is part of the GNU IO Library. This library is free
-software; you can redistribute it and/or modify it under the
-terms of the GNU General Public License as published by the
-Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this library; see the file COPYING. If not, write to the Free
-Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-As a special exception, if you link this library with files
-compiled with a GNU compiler to produce an executable, this does not cause
-the resulting executable to be covered by the GNU General Public License.
-This exception does not however invalidate any other reasons why
-the executable file might be covered by the GNU General Public License. */
-
-#include "libioP.h"
-#include "stdio.h"
-
-int vprintf(format, args)
- const char* format;
- _IO_va_list args;
-{
- return _IO_vfprintf(_IO_stdout, format, args);
-}
diff --git a/contrib/libio/stdio/vscanf.c b/contrib/libio/stdio/vscanf.c
deleted file mode 100644
index 8b92ae270e6d..000000000000
--- a/contrib/libio/stdio/vscanf.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/* Copyright (C) 1993, 1997 Free Software Foundation, Inc.
- This file is part of the GNU IO Library.
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License as
- published by the Free Software Foundation; either version 2, or (at
- your option) any later version.
-
- This library is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this library; see the file COPYING. If not, write to
- the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
- MA 02111-1307, USA.
-
- As a special exception, if you link this library with files
- compiled with a GNU compiler to produce an executable, this does
- not cause the resulting executable to be covered by the GNU General
- Public License. This exception does not however invalidate any
- other reasons why the executable file might be covered by the GNU
- General Public License. */
-
-#include "libioP.h"
-#include "stdio.h"
-
-#undef vscanf
-
-int
-_IO_vscanf (format, args)
- const char *format;
- _IO_va_list args;
-{
- return _IO_vfscanf (_IO_stdin, format, args, NULL);
-}
-
-#ifdef weak_alias
-weak_alias (_IO_vscanf, vscanf)
-#endif
diff --git a/contrib/libio/stdio/vsnprintf.c b/contrib/libio/stdio/vsnprintf.c
deleted file mode 100644
index 3f35af299ab7..000000000000
--- a/contrib/libio/stdio/vsnprintf.c
+++ /dev/null
@@ -1,136 +0,0 @@
-/* Copyright (C) 1994, 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 "strfile.h"
-
-
-typedef struct
-{
- _IO_strfile f;
- /* This is used for the characters which do not fit in the buffer
- provided by the user. */
- char overflow_buf[64];
-} _IO_strnfile;
-
-
-static int _IO_strn_overflow __P ((_IO_FILE *fp, int c));
-
-static int
-_IO_strn_overflow (fp, c)
- _IO_FILE *fp;
- int c;
-{
- /* When we come to here this means the user supplied buffer is
- filled. But since we must return the number of characters which
- would have been written in total we must provide a buffer for
- further use. We can do this by writing on and on in the overflow
- buffer in the _IO_strnfile structure. */
- _IO_strnfile *snf = (_IO_strnfile *) fp;
-
- if (fp->_IO_buf_base != snf->overflow_buf)
- {
- /* Terminate the string. We know that there is room for at
- least one more character since we initialized the stream with
- a size to make this possible. */
- *fp->_IO_write_ptr = '\0';
-
- _IO_setb (fp, snf->overflow_buf,
- snf->overflow_buf + sizeof (snf->overflow_buf), 0);
-
- fp->_IO_write_base = snf->overflow_buf;
- fp->_IO_read_base = snf->overflow_buf;
- fp->_IO_read_ptr = snf->overflow_buf;
- fp->_IO_read_end = snf->overflow_buf + sizeof (snf->overflow_buf);
- }
-
- fp->_IO_write_ptr = snf->overflow_buf;
- fp->_IO_write_end = snf->overflow_buf;
-
- /* Since we are not really interested in storing the characters
- which do not fit in the buffer we simply ignore it. */
- return c;
-}
-
-
-static struct _IO_jump_t _IO_strn_jumps =
-{
- JUMP_INIT_DUMMY,
- JUMP_INIT(finish, _IO_str_finish),
- JUMP_INIT(overflow, _IO_strn_overflow),
- JUMP_INIT(underflow, _IO_str_underflow),
- JUMP_INIT(uflow, _IO_default_uflow),
- JUMP_INIT(pbackfail, _IO_str_pbackfail),
- JUMP_INIT(xsputn, _IO_default_xsputn),
- JUMP_INIT(xsgetn, _IO_default_xsgetn),
- JUMP_INIT(seekoff, _IO_str_seekoff),
- JUMP_INIT(seekpos, _IO_default_seekpos),
- JUMP_INIT(setbuf, _IO_default_setbuf),
- JUMP_INIT(sync, _IO_default_sync),
- JUMP_INIT(doallocate, _IO_default_doallocate),
- JUMP_INIT(read, _IO_default_read),
- JUMP_INIT(write, _IO_default_write),
- JUMP_INIT(seek, _IO_default_seek),
- JUMP_INIT(close, _IO_default_close),
- JUMP_INIT(stat, _IO_default_stat)
-};
-
-
-int
-_IO_vsnprintf (string, maxlen, format, args)
- char *string;
- _IO_size_t maxlen;
- const char *format;
- _IO_va_list args;
-{
- _IO_strnfile sf;
- int ret;
-#ifdef _IO_MTSAFE_IO
- _IO_lock_t lock;
- sf.f._sbf._f._lock = &lock;
-#endif
-
- /* We need to handle the special case where MAXLEN is 0. Use the
- overflow buffer right from the start. */
- if (maxlen == 0)
- {
- string = sf.overflow_buf;
- maxlen = sizeof (sf.overflow_buf);
- }
-
- _IO_init ((_IO_FILE *) &sf, 0);
- _IO_JUMPS ((_IO_FILE *) &sf) = &_IO_strn_jumps;
- _IO_str_init_static ((_IO_FILE *) &sf, string, maxlen - 1, string);
- ret = _IO_vfprintf ((_IO_FILE *) &sf, format, args);
-
- if (sf.f._sbf._f._IO_buf_base != sf.overflow_buf)
- *sf.f._sbf._f._IO_write_ptr = '\0';
- return ret;
-}
-
-#ifdef weak_alias
-weak_alias (_IO_vsnprintf, __vsnprintf)
-weak_alias (_IO_vsnprintf, vsnprintf)
-#endif
diff --git a/contrib/libio/stdiostream.cc b/contrib/libio/stdiostream.cc
deleted file mode 100644
index ee0907b209f4..000000000000
--- a/contrib/libio/stdiostream.cc
+++ /dev/null
@@ -1,159 +0,0 @@
-/* This is part of libio/iostream, providing -*- C++ -*- input/output.
-Copyright (C) 1993 Free Software Foundation
-
-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. */
-
-/* Written by Per Bothner (bothner@cygnus.com). */
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-
-#include "libioP.h"
-#include <stdiostream.h>
-
-// A stdiobuf is "tied" to a FILE object (as used by the stdio package).
-// Thus a stdiobuf is always synchronized with the corresponding FILE,
-// though at the cost of some overhead. (If you use the implementation
-// of stdio supplied with this library, you don't need stdiobufs.)
-// This implementation inherits from filebuf, but implement the virtual
-// functions sys_read/..., using the stdio functions fread/... instead
-// of the low-level read/... system calls. This has the advantage that
-// we get all of the nice filebuf semantics automatically, though
-// with some overhead.
-
-
-#ifndef SEEK_SET
-#define SEEK_SET 0
-#endif
-#ifndef SEEK_CUR
-#define SEEK_CUR 1
-#endif
-#ifndef SEEK_END
-#define SEEK_END 2
-#endif
-
-stdiobuf::stdiobuf(FILE *f) : filebuf(fileno(f))
-{
- _file = f;
- // Turn off buffer in stdiobuf. Instead, rely on buffering in (FILE).
- // Thus the stdiobuf will be synchronized with the FILE.
- setbuf(NULL, 0);
-}
-
-stdiobuf::~stdiobuf()
-{
- /* Only needed if we're buffered. Not buffered is the default. */
- _IO_do_flush((_IO_FILE*)this);
-}
-
-streamsize stdiobuf::sys_read(char* buf, streamsize size)
-{
- // A minor optimization, but it makes a noticable difference.
- // A bigger optimization would be to write stdiobuf::underflow,
- // but that has some modularity disadvantages. Re-evaluate that
- // after we have gotten rid of the double indirection. FIXME
- if (size == 1)
- {
- register int ch = getc(_file);
- if (ch == EOF)
- return 0;
- *buf = (char)ch;
- return 1;
- }
- else
- return fread(buf, 1, size, _file);
-}
-
-streamsize stdiobuf::sys_write(const char *buf, streamsize n)
-{
- _IO_ssize_t count = fwrite(buf, 1, n, _file);
- if (_offset >= 0)
- _offset += n;
- return count;
-}
-
-streampos stdiobuf::sys_seek(streamoff offset, _seek_dir dir)
-{
- // Normally, equivalent to: fdir=dir
- int fdir =
- (dir == ios::beg) ? SEEK_SET :
- (dir == ios::cur) ? SEEK_CUR :
- (dir == ios::end) ? SEEK_END :
- dir;
- return fseek(_file, offset, fdir);
-}
-
-int stdiobuf::sys_close()
-{
- int status = fclose(_file);
- _file = NULL;
- return status;
-}
-
-int stdiobuf::sync()
-{
- if (_IO_do_flush((_IO_FILE*)this))
- return EOF;
- if (!(xflags() & _IO_NO_WRITES))
- if (fflush(_file))
- return EOF;
- return 0;
-}
-
-int stdiobuf::overflow(int c /* = EOF*/)
-{
- if (filebuf::overflow(c) == EOF)
- return EOF;
- if (c != EOF)
- return c;
- return fflush(_file);
-}
-
-streamsize stdiobuf::xsputn(const char* s, streamsize n)
-{
- if (buffered ())
- {
- // The filebuf implementation of sputn loses.
- return streambuf::xsputn(s, n);
- }
- else
- return fwrite (s, 1, n, _file);
-}
-
-void stdiobuf::buffered (int b)
-{
- if (b)
- {
- if (_flags & _IO_UNBUFFERED)
- { /* Was unbuffered, make it buffered. */
- _flags &= ~_IO_UNBUFFERED;
- }
- }
- else
- {
- if (!(_flags & _IO_UNBUFFERED))
- { /* Was buffered, make it unbuffered. */
- setbuf(NULL, 0);
- }
- }
-}
diff --git a/contrib/libio/stdiostream.h b/contrib/libio/stdiostream.h
deleted file mode 100644
index b973d7a39b62..000000000000
--- a/contrib/libio/stdiostream.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/* This is part of libio/iostream, providing -*- C++ -*- input/output.
-Copyright (C) 1993 Free Software Foundation
-
-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. */
-
-/* Written by Per Bothner (bothner@cygnus.com). */
-
-#ifndef _STDIOSTREAM_H
-#define _STDIOSTREAM_H
-
-#ifdef __GNUG__
-#pragma interface
-#endif
-
-#include <iostream.h>
-#include <stdio.h>
-
-extern "C++" {
-class stdiobuf : public filebuf {
- protected:
- FILE *_file;
- public:
- FILE* stdiofile() const { return _file; }
- stdiobuf(FILE *);
- ~stdiobuf();
- int buffered () const { return _flags & _IO_UNBUFFERED ? 0 : 1; }
- void buffered (int);
- virtual streamsize sys_read(char*, streamsize);
- virtual streampos sys_seek(streamoff, _seek_dir);
- virtual streamsize sys_write(const char*, streamsize);
- virtual int sys_close();
- virtual int sync();
- virtual int overflow(int c = EOF);
- streamsize xsputn(const char* s, streamsize n);
-};
-
-class istdiostream : public istream
-{
-private:
- stdiobuf _file;
-public:
- istdiostream (FILE* __f) : istream(), _file(__f) { init(&_file); }
- stdiobuf* rdbuf()/* const */ { return &_file; }
- int buffered () const { return _file.buffered (); }
- void buffered (int _i) { _file.buffered (_i); }
-};
-
-class ostdiostream : public ostream
-{
-private:
- stdiobuf _file;
-public:
- ostdiostream (FILE* __f) : ostream(), _file(__f) { init(&_file); }
- stdiobuf* rdbuf() /* const */ { return &_file; }
- int buffered () const { return _file.buffered (); }
- void buffered (int _i) { _file.buffered (_i); }
-};
-} // extern "C++"
-
-#endif /* !_STDIOSTREAM_H */
diff --git a/contrib/libio/stdstrbufs.cc b/contrib/libio/stdstrbufs.cc
deleted file mode 100644
index 48aa719df863..000000000000
--- a/contrib/libio/stdstrbufs.cc
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
-Copyright (C) 1994 Free Software Foundation
-
-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. */
-
-
-/* This file provides definitions of _IO_stdin, _IO_stdout, and _IO_stderr
- for C++ code. Compare stdfiles.c.
- (The difference is that here the vtable field is set to
- point to builtinbuf's vtable, so the objects are effectively
- of class builtinbuf.) */
-
-#include "libioP.h"
-#include <stdio.h>
-
-#if !defined(filebuf_vtable) && defined(__cplusplus)
-#ifdef __GNUC__
-extern char filebuf_vtable[]
- asm (_G_VTABLE_LABEL_PREFIX
-#if _G_VTABLE_LABEL_HAS_LENGTH
- "7"
-#endif
- "filebuf");
-#else /* !__GNUC__ */
-#if _G_VTABLE_LABEL_HAS_LENGTH
-#define filebuf_vtable _G_VTABLE_LABEL_PREFIX_ID##7filebuf
-#else
-#define filebuf_vtable _G_VTABLE_LABEL_PREFIX_ID##filebuf
-#endif
-extern char filebuf_vtable[];
-#endif /* !__GNUC__ */
-#endif /* !defined(filebuf_vtable) && defined(__cplusplus) */
-
-#ifndef STD_VTABLE
-#define STD_VTABLE (const struct _IO_jump_t *)filebuf_vtable
-#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), STD_VTABLE}
-#else
-#define DEF_STDFILE(NAME, FD, CHAIN, FLAGS) \
- 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_stdout_, 1, &_IO_stdin_.file, _IO_NO_READS);
-DEF_STDFILE(_IO_stderr_, 2, &_IO_stdout_.file,
- _IO_NO_READS+_IO_UNBUFFERED);
-
-#ifdef _STDIO_USES_IOSTREAM
-_IO_FILE *_IO_list_all = &_IO_stderr_.file;
-#else /* !_STDIO_USES_IOSTREAM */
-#include "stdiostream.h"
-
-struct _IO_fake_stdiobuf {
- struct {
- _IO_FILE file;
- const void *vtable;
- } s;
- FILE *stdio_file;
-};
-
-/* Define stdiobuf_vtable as a name for the virtual function table
- of the stdiobuf class. */
-#ifndef stdiobuf_vtable
-#ifdef __GNUC__
-extern struct _IO_jump_t stdiobuf_vtable
- asm (_G_VTABLE_LABEL_PREFIX
-#if _G_VTABLE_LABEL_HAS_LENGTH
- "8"
-#endif
- "stdiobuf");
-#else /* !__GNUC__ */
-#if _G_VTABLE_LABEL_HAS_LENGTH
-#define stdiobuf_vtable _G_VTABLE_LABEL_PREFIX_ID##8stdiobuf
-#else
-#define stdiobuf_vtable _G_VTABLE_LABEL_PREFIX_ID##stdiobuf
-#endif
-extern struct _IO_jump_t stdiobuf_vtable;
-#endif /* !__GNUC__ */
-#endif /* !stdiobuf_vtable */
-
-#ifdef _IO_MTSAFE_IO
-#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
-#define DEF_STDIOFILE(NAME, FD, FILE, FLAGS, CHAIN) \
- 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}, \
- &stdiobuf_vtable}, FILE}
-#endif
-
-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_stderr_buf, 2, stderr, _IO_NO_READS, &_IO_stdout_buf.s.file);
-
-_IO_FILE *_IO_list_all = &_IO_stderr_buf.s.file;
-#endif /* !_STDIO_USES_IOSTREAM */
diff --git a/contrib/libio/stdstreams.cc b/contrib/libio/stdstreams.cc
deleted file mode 100644
index 7a74eaaa4433..000000000000
--- a/contrib/libio/stdstreams.cc
+++ /dev/null
@@ -1,153 +0,0 @@
-/* This is part of libio/iostream, providing -*- C++ -*- input/output.
-Copyright (C) 1993 Free Software Foundation
-
-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. */
-
-/* Written by Per Bothner (bothner@cygnus.com). */
-
-#include "libioP.h"
-#include "streambuf.h"
-#include <stdio.h>
-
-// The ANSI draft requires that operations on cin/cout/cerr can be
-// mixed with operations on stdin/stdout/stderr on a character by
-// character basis. This normally requires that the streambuf's
-// used by cin/cout/cerr be stdiostreams. However, if the stdio
-// implementation is the one that is built using this library,
-// then we don't need to, since in that case stdin/stdout/stderr
-// are identical to _IO_stdin/_IO_stdout/_IO_stderr.
-
-#include <libio.h>
-
-#ifdef _STDIO_USES_IOSTREAM
-#define CIN_SBUF _IO_stdin_
-#define COUT_SBUF _IO_stdout_
-#define CERR_SBUF _IO_stderr_
-static int use_stdiobuf = 0;
-#else
-#define CIN_SBUF _IO_stdin_buf
-#define COUT_SBUF _IO_stdout_buf
-#define CERR_SBUF _IO_stderr_buf
-static int use_stdiobuf = 1;
-#endif
-
-#define cin CIN
-#define cout COUT
-#define cerr CERR
-#define clog CLOG
-#include "iostream.h"
-#undef cin
-#undef cout
-#undef cerr
-#undef clog
-
-#ifdef __GNUG__
-#define PAD 0 /* g++ allows 0-length arrays. */
-#else
-#define PAD 1
-#endif
-struct _fake_istream {
- struct myfields {
-#ifdef __GNUC__
- _ios_fields *vb; /* pointer to virtual base class ios */
- _IO_ssize_t _gcount;
-#else
- /* This is supposedly correct for cfront. */
- _IO_ssize_t _gcount;
- void *vptr;
- _ios_fields *vb; /* pointer to virtual base class ios */
-#endif
- } mine;
- _ios_fields base;
- char filler[sizeof(struct istream)-sizeof(struct _ios_fields)+PAD];
-};
-struct _fake_ostream {
- struct myfields {
-#ifndef __GNUC__
- void *vptr;
-#endif
- _ios_fields *vb; /* pointer to virtual base class ios */
- } mine;
- _ios_fields base;
- char filler[sizeof(struct ostream)-sizeof(struct _ios_fields)+PAD];
-};
-
-
-#ifdef _IO_NEW_STREAMS
-#define STD_STR(SBUF, TIE, EXTRA_FLAGS) \
- (streambuf*)&SBUF, TIE, 0, ios::skipws|ios::dec|EXTRA_FLAGS, ' ',0,0,6
-#else
-#define STD_STR(SBUF, TIE, EXTRA_FLAGS) \
- (streambuf*)&SBUF, TIE, 0, ios::dont_close|ios::dec|ios::skipws|EXTRA_FLAGS, ' ',0,0,6
-#endif
-
-#ifdef __GNUC__
-#define OSTREAM_DEF(NAME, SBUF, TIE, EXTRA_FLAGS, ASM) \
- _fake_ostream NAME ASM = { {&NAME.base}, {STD_STR(SBUF, TIE, EXTRA_FLAGS) }};
-#define ISTREAM_DEF(NAME, SBUF, TIE, EXTRA_FLAGS) \
- _fake_istream NAME = { {&NAME.base}, {STD_STR(SBUF, TIE, EXTRA_FLAGS) }};
-#else
-#define OSTREAM_DEF(NAME, SBUF, TIE, EXTRA_FLAGS) \
- _fake_ostream NAME = { {0, &NAME.base}, {STD_STR(SBUF, TIE, EXTRA_FLAGS) }};
-#define ISTREAM_DEF(NAME, SBUF, TIE, EXTRA_FLAGS) \
- _fake_istream NAME = {{0, 0, &NAME.base}, {STD_STR(SBUF, TIE, EXTRA_FLAGS)}};
-#endif
-
-OSTREAM_DEF(cout, COUT_SBUF, NULL, 0, )
-OSTREAM_DEF(cerr, CERR_SBUF,(ostream*)&cout, ios::unitbuf, )
-ISTREAM_DEF(cin, CIN_SBUF, (ostream*)&cout, 0)
-
-/* Only for (partial) compatibility with AT&T's library. */
-#if _G_CLOG_CONFLICT
-OSTREAM_DEF(clog, CERR_SBUF, (ostream*)&cout, 0, __asm__ ("__IO_clog"))
-#else
-OSTREAM_DEF(clog, CERR_SBUF, (ostream*)&cout, 0, )
-#endif
-
-// Switches between using _IO_std{in,out,err} and __std{in,out,err}_buf
-// for standard streams. This does not normally need to be called
-// explicitly, but is provided for AT&T compatibility.
-
-int ios::sync_with_stdio(int new_state)
-{
-#ifdef _STDIO_USES_IOSTREAM
- // It is always synced.
- return 0;
-#else
- if (new_state == use_stdiobuf) // The usual case now.
- return use_stdiobuf;
- if (new_state) {
- cin.base._strbuf = (streambuf*)&_IO_stdin_buf;
- cout.base._strbuf = (streambuf*)&_IO_stdout_buf;
- cerr.base._strbuf = (streambuf*)&_IO_stderr_buf;
- clog.base._strbuf = (streambuf*)&_IO_stderr_buf;
- } else {
- cin.base._strbuf = (streambuf*)_IO_stdin;
- cout.base._strbuf = (streambuf*)_IO_stdout;
- cerr.base._strbuf = (streambuf*)_IO_stderr;
- clog.base._strbuf = (streambuf*)_IO_stderr;
- }
- int old_state = use_stdiobuf;
- use_stdiobuf = new_state;
- return old_state;
-#endif
-}
diff --git a/contrib/libio/stream.cc b/contrib/libio/stream.cc
deleted file mode 100644
index 3440a0c9bdb4..000000000000
--- a/contrib/libio/stream.cc
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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 <stdarg.h>
-#include <string.h>
-#include "libioP.h"
-#include "stream.h"
-#include "strstream.h"
-
-static char Buffer[_IO_BUFSIZ];
-#define EndBuffer (Buffer+_IO_BUFSIZ)
-static char* next_chunk = Buffer; // Start of available part of Buffer.
-
-char* form(const char* format, ...)
-{
- int space_left = EndBuffer - next_chunk;
- // If less that 25% of the space is available start over.
- if (space_left < (_IO_BUFSIZ>>2))
- next_chunk = Buffer;
- char* buf = next_chunk;
-
- strstreambuf stream(buf, EndBuffer-buf-1, buf);
- va_list ap;
- va_start(ap, format);
- int count = stream.vform(format, ap);
- va_end(ap);
- stream.sputc(0);
- next_chunk = buf + stream.pcount();
- return buf;
-}
-
-#define u_long unsigned long
-
-static char* itoa(unsigned long i, int size, int neg, int base)
-{
- // Conservative estimate: If base==2, might need 8 characters
- // for each input byte, but normally 3 is plenty.
- int needed = size ? size
- : (base >= 8 ? 3 : 8) * sizeof(unsigned long) + 2;
- int space_left = EndBuffer - next_chunk;
- if (space_left <= needed)
- next_chunk = Buffer; // start over.
-
- char* buf = next_chunk;
-
- register char* ptr = buf+needed+1;
- next_chunk = ptr;
-
- if (needed < (2+neg) || ptr > EndBuffer)
- return NULL;
- *--ptr = 0;
-
- if (i == 0)
- *--ptr = '0';
- while (i != 0 && ptr > buf) {
- int ch = i % base;
- i = i / base;
- if (ch >= 10)
- ch += 'a' - 10;
- else
- ch += '0';
- *--ptr = ch;
- }
- if (neg)
- *--ptr = '-';
- if (size == 0)
- return ptr;
- while (ptr > buf)
- *--ptr = ' ';
- return buf;
-}
-
-char* dec(long i, int len /* = 0 */)
-{
- if (i >= 0) return itoa((unsigned long)i, len, 0, 10);
- else return itoa((unsigned long)(-i), len, 1, 10);
-}
-char* dec(int i, int len /* = 0 */)
-{
- if (i >= 0) return itoa((unsigned long)i, len, 0, 10);
- else return itoa((unsigned long)(-i), len, 1, 10);
-}
-char* dec(unsigned long i, int len /* = 0 */)
-{
- return itoa(i, len, 0, 10);
-}
-char* dec(unsigned int i, int len /* = 0 */)
-{
- return itoa(i, len, 0, 10);
-}
-
-char* hex(long i, int len /* = 0 */)
-{
- return itoa((unsigned long)i, len, 0, 16);
-}
-char* hex(int i, int len /* = 0 */)
-{
- return itoa((unsigned long)i, len, 0, 16);
-}
-char* hex(unsigned long i, int len /* = 0 */)
-{
- return itoa(i, len, 0, 16);
-}
-char* hex(unsigned int i, int len /* = 0 */)
-{
- return itoa(i, len, 0, 16);
-}
-
-char* oct(long i, int len /* = 0 */)
-{
- return itoa((unsigned long)i, len, 0, 8);
-}
-char* oct(int i, int len /* = 0 */)
-{
- return itoa((unsigned long)i, len, 0, 8);
-}
-char* oct(unsigned long i, int len /* = 0 */)
-{
- return itoa(i, len, 0, 8);
-}
-char* oct(unsigned int i, int len /* = 0 */)
-{
- return itoa(i, len, 0, 8);
-}
-
-static char *str(const char* s, int len, int width)
-{
- if (width < len)
- width = len;
- int space_left = EndBuffer - next_chunk;
- if (space_left <= width + 1)
- next_chunk = Buffer; // start over.
- char* buf = next_chunk;
- memset (buf, ' ', width - len);
- memcpy (buf + width - len, s, len);
- buf[width] = 0;
- return buf;
-}
-
-char* str(const char* s, int width)
-{
- return str (s, strlen (s), width);
-}
-
-char* chr(char ch, int width)
-{
- char c = ch;
- return str (&c, 1, width);
-}
diff --git a/contrib/libio/stream.h b/contrib/libio/stream.h
deleted file mode 100644
index 90f8c1f27819..000000000000
--- a/contrib/libio/stream.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
-Copyright (C) 1993, 1999 Free Software Foundation
-
-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. */
-
-#ifndef _COMPAT_STREAM_H
-#define _COMPAT_STREAM_H
-
-// Compatibility with old library.
-// DO NOT USE THESE FUNCTIONS IN NEW CODE!
-// They are obsolete, non-standard, and non-reentrant.
-
-#define _STREAM_COMPAT
-#include <iostream.h>
-
-extern "C++" {
-extern char* form(const char*, ...);
-
-extern char* dec(long, int=0);
-extern char* dec(int, int=0);
-extern char* dec(unsigned long, int=0);
-extern char* dec(unsigned int, int=0);
-
-extern char* hex(long, int=0);
-extern char* hex(int, int=0);
-extern char* hex(unsigned long, int=0);
-extern char* hex(unsigned int, int=0);
-
-extern char* oct(long, int=0);
-extern char* oct(int, int=0);
-extern char* oct(unsigned long, int=0);
-extern char* oct(unsigned int, int=0);
-
-char* chr(char ch, int width = 0);
-char* str(const char* s, int width = 0);
-
-inline istream& WS(istream& __str) { return ws(__str); }
-} // extern "C++"
-
-#endif /* !_COMPAT_STREAM_H */
diff --git a/contrib/libio/streambuf.cc b/contrib/libio/streambuf.cc
deleted file mode 100644
index 057d1e6e4ce9..000000000000
--- a/contrib/libio/streambuf.cc
+++ /dev/null
@@ -1,364 +0,0 @@
-/* This is part of libio/iostream, providing -*- C++ -*- input/output.
-Copyright (C) 1991, 1992, 1993, 1995 Free Software Foundation
-
-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. */
-
-/* Written by Per Bothner (bothner@cygnus.com). */
-
-#define _STREAM_COMPAT
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include "iostreamP.h"
-#include <string.h>
-#include <stdarg.h>
-#include <errno.h>
-#ifndef errno
-extern int errno;
-#endif
-
-void streambuf::_un_link() { _IO_un_link(this); }
-
-void streambuf::_link_in() { _IO_link_in(this); }
-
-int streambuf::switch_to_get_mode()
-{ return _IO_switch_to_get_mode(this); }
-
-void streambuf::free_backup_area()
-{ _IO_free_backup_area(this); }
-
-#if 0
-int streambuf::switch_to_put_mode()
-{ return _IO_:switch_to_put_mode(this); }
-#endif
-
-int __overflow(streambuf* sb, int c)
-{
- return sb->overflow(c);
-}
-
-int streambuf::underflow()
-{ return EOF; }
-
-int streambuf::uflow()
-{ return _IO_default_uflow (this); }
-
-int streambuf::overflow(int /* = EOF */)
-{ return EOF; }
-
-streamsize streambuf::xsputn(register const char* s, streamsize n)
-{ return _IO_default_xsputn(this, s, n); }
-
-streamsize streambuf::xsgetn(char* s, streamsize n)
-{ return _IO_default_xsgetn(this, s, n); }
-
-int streambuf::ignore(int n)
-{
- register int more = n;
- for (;;) {
- int count = _IO_read_end - _IO_read_ptr; // Data available.
- if (count > 0) {
- if (count > more)
- count = more;
- _IO_read_ptr += count;
- more -= count;
- }
- if (more == 0 || __underflow(this) == EOF)
- break;
- }
- return n - more;
-}
-
-int streambuf::sync()
-{
- return 0;
-}
-
-int streambuf::pbackfail(int c)
-{
- return _IO_default_pbackfail(this, c);
-}
-
-streambuf* streambuf::setbuf(char* p, int len)
-{
- if (sync() == EOF)
- return NULL;
- if (p == NULL || len == 0) {
- unbuffered(1);
- setb(_shortbuf, _shortbuf+1, 0);
- }
- else {
- unbuffered(0);
- setb(p, p+len, 0);
- }
- setp(0, 0);
- setg(0, 0, 0);
- return this;
-}
-
-streampos streambuf::seekpos(streampos pos, int mode)
-{
- return seekoff(pos, ios::beg, mode);
-}
-
-streampos streambuf::sseekpos(streampos pos, int mode)
-{
- return _IO_seekpos (this, pos, mode);
-}
-
-void streambuf::setb(char* b, char* eb, int a)
-{ _IO_setb(this, b, eb, a); }
-
-int streambuf::doallocate() { return _IO_default_doallocate(this); }
-
-void streambuf::doallocbuf() { _IO_doallocbuf(this); }
-
-#if !_IO_UNIFIED_JUMPTABLES
-/* The following are jump table entries that just call the virtual method */
-
-static int _IO_sb_overflow(_IO_FILE *fp, int c)
-{ return ((streambuf*)fp)->overflow(c); }
-static int _IO_sb_underflow(_IO_FILE *fp)
-{ return ((streambuf*)fp)->underflow(); }
-static _IO_size_t _IO_sb_xsputn(_IO_FILE *fp, const void *s, _IO_size_t n)
-{ return ((streambuf*)fp)->xsputn((const char*)s, n); }
-static _IO_size_t _IO_sb_xsgetn(_IO_FILE *fp, void *s, _IO_size_t n)
-{ return ((streambuf*)fp)->xsgetn((char*)s, n); }
-static int _IO_sb_close(_IO_FILE *fp)
-{ return ((streambuf*)fp)->sys_close(); }
-static int _IO_sb_stat(_IO_FILE *fp, void *b)
-{ return ((streambuf*)fp)->sys_stat(b); }
-static int _IO_sb_doallocate(_IO_FILE *fp)
-{ return ((streambuf*)fp)->doallocate(); }
-
-static _IO_pos_t _IO_sb_seekoff(_IO_FILE *fp, _IO_off_t pos, int dir, int mode)
-{
- return ((streambuf*)fp)->seekoff(pos, (ios::seek_dir)dir, mode);
-}
-
-static _IO_pos_t _IO_sb_seekpos(_IO_FILE *fp, _IO_pos_t pos, int mode)
-{
- return ((streambuf*)fp)->seekpos(pos, mode);
-}
-
-static int _IO_sb_pbackfail(_IO_FILE *fp, int ch)
-{ return ((streambuf*)fp)->pbackfail(ch); }
-static void _IO_sb_finish(_IO_FILE *fp, int)
-{ ((streambuf*)fp)->~streambuf(); }
-static _IO_ssize_t _IO_sb_read(_IO_FILE *fp, void *buf, _IO_ssize_t n)
-{ return ((streambuf*)fp)->sys_read((char*)buf, n); }
-static _IO_ssize_t _IO_sb_write(_IO_FILE *fp, const void *buf, _IO_ssize_t n)
-{ return ((streambuf*)fp)->sys_write((const char*)buf, n); }
-static int _IO_sb_sync(_IO_FILE *fp)
-{ return ((streambuf*)fp)->sync(); }
-static _IO_pos_t _IO_sb_seek(_IO_FILE *fp, _IO_off_t off, int dir)
-{ return ((streambuf*)fp)->sys_seek(off, (_seek_dir)dir); }
-static _IO_FILE* _IO_sb_setbuf(_IO_FILE *fp, char *buf, _IO_ssize_t n)
-{ return ((streambuf*)fp)->setbuf(buf, n); }
-
-/* This callbacks in this jumptable just call the corresponding
- virtual function, so that C functions can access (potentially user-defined)
- streambuf-derived objects.
- Contrast the builtinbuf class, which does the converse: Allow
- C++ virtual calls to be used on _IO_FILE objects that are builtin
- (or defined by C code). */
-
-
-struct _IO_jump_t _IO_streambuf_jumps = {
- JUMP_INIT_DUMMY,
- JUMP_INIT(finish, _IO_sb_finish),
- JUMP_INIT(overflow, _IO_sb_overflow),
- JUMP_INIT(underflow, _IO_sb_underflow),
- JUMP_INIT(uflow, _IO_default_uflow),
- JUMP_INIT(pbackfail, _IO_sb_pbackfail),
- JUMP_INIT(xsputn, _IO_sb_xsputn),
- JUMP_INIT(xsgetn, _IO_sb_xsgetn),
- JUMP_INIT(seekoff, _IO_sb_seekoff),
- JUMP_INIT(seekpos, _IO_sb_seekpos),
- JUMP_INIT(setbuf, _IO_sb_setbuf),
- JUMP_INIT(sync, _IO_sb_sync),
- JUMP_INIT(doallocate, _IO_sb_doallocate),
- JUMP_INIT(read, _IO_sb_read),
- JUMP_INIT(write, _IO_sb_write),
- JUMP_INIT(seek, _IO_sb_seek),
- JUMP_INIT(close, _IO_sb_close),
- JUMP_INIT(stat, _IO_sb_stat)
-};
-#endif
-
-streambuf::streambuf(int flags)
-{
-#ifdef _IO_MTSAFE_IO
- _lock = new _IO_lock_t;
-#endif
- _IO_init(this, flags);
-#if !_IO_UNIFIED_JUMPTABLES
- _jumps = &_IO_streambuf_jumps;
-#endif
-}
-
-streambuf::~streambuf()
-{
- _IO_default_finish(this,0);
-#ifdef _IO_MTSAFE_IO
- if (this != _IO_stdin && this != _IO_stdout && this != _IO_stderr)
- delete _lock;
-#endif
-}
-
-streampos
-streambuf::seekoff(streamoff, _seek_dir, int /*=ios::in|ios::out*/)
-{
- return EOF;
-}
-
-streampos
-streambuf::sseekoff(streamoff o , _seek_dir d, int m /*=ios::in|ios::out*/)
-{
- return _IO_seekoff (this, o, d, m);
-}
-
-int streambuf::sputbackc(char c)
-{
- return _IO_sputbackc(this, c);
-}
-
-int streambuf::sungetc()
-{
- return _IO_sungetc(this);
-}
-
-#if 0 /* Work in progress */
-void streambuf::collumn(int c)
-{
- if (c == -1)
- _collumn = -1;
- else
- _collumn = c - (_IO_write_ptr - _IO_write_base);
-}
-#endif
-
-
-int streambuf::get_column()
-{
- if (_cur_column)
- return _IO_adjust_column(_cur_column - 1, pbase(), pptr() - pbase());
- return -1;
-}
-
-int streambuf::set_column(int i)
-{
- _cur_column = i+1;
- return 0;
-}
-
-int streambuf::flush_all() { return _IO_flush_all (); }
-
-void streambuf::flush_all_linebuffered()
-{ _IO_flush_all_linebuffered(); }
-
-int streambuf::sys_stat(void *)
-{
-#ifdef EIO
- errno = EIO;
-#endif
- return -1;
-}
-
-streamsize streambuf::sys_read(char* /*buf*/, streamsize /*size*/)
-{
- return 0;
-}
-
-streamsize streambuf::sys_write(const char* /*buf*/, streamsize /*size*/)
-{
- return 0;
-}
-
-streampos streambuf::sys_seek(streamoff, _seek_dir)
-{
- return EOF;
-}
-
-int streambuf::sys_close() { return 0; /* Suceess; do nothing */ }
-
-#if _G_IO_IO_FILE_VERSION == 0x20001
-int streambuf::showmanyc()
-{
- return -1;
-}
-
-void streambuf::imbue(void *)
-{
-}
-#endif
-
-streammarker::streammarker(streambuf *sb)
-{
- _IO_init_marker(this, sb);
-}
-
-streammarker::~streammarker()
-{
- _IO_remove_marker(this);
-}
-
-#define BAD_DELTA EOF
-
-int streammarker::delta(streammarker& other_mark)
-{
- return _IO_marker_difference(this, &other_mark);
-}
-
-int streammarker::delta()
-{
- return _IO_marker_delta(this);
-}
-
-int streambuf::seekmark(streammarker& mark, int delta /* = 0 */)
-{
- return _IO_seekmark(this, &mark, delta);
-}
-
-void streambuf::unsave_markers()
-{
- _IO_unsave_markers(this);
-}
-
-int ios::readable() { return !(rdbuf()->_flags & _IO_NO_READS); }
-int ios::writable() { return !(rdbuf()->_flags & _IO_NO_WRITES); }
-int ios::is_open() { return rdbuf()
- && (rdbuf()->_flags & _IO_NO_READS+_IO_NO_WRITES)
- != _IO_NO_READS+_IO_NO_WRITES; }
-
-#if defined(linux)
-#define IO_CLEANUP
-#endif
-
-#ifdef IO_CLEANUP
- IO_CLEANUP
-#else
-struct __io_defs {
- ~__io_defs() { _IO_cleanup (); }
-};
-__io_defs io_defs__;
-#endif
diff --git a/contrib/libio/streambuf.h b/contrib/libio/streambuf.h
deleted file mode 100644
index 193c4993827f..000000000000
--- a/contrib/libio/streambuf.h
+++ /dev/null
@@ -1,490 +0,0 @@
-/* This is part of libio/iostream, providing -*- C++ -*- input/output.
-Copyright (C) 1993 Free Software Foundation
-
-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. */
-
-#ifndef _STREAMBUF_H
-#define _STREAMBUF_H
-#ifdef __GNUG__
-#pragma interface
-#endif
-
-/* #define _G_IO_THROW */ /* Not implemented: ios::failure */
-
-#define _IO_NEW_STREAMS // new optimizated stream representation
-
-extern "C" {
-#include <libio.h>
-}
-//#include <_G_config.h>
-#ifdef _G_NEED_STDARG_H
-#include <stdarg.h>
-#endif
-#ifndef _IO_va_list
-#define _IO_va_list char *
-#endif
-
-#ifndef EOF
-#define EOF (-1)
-#endif
-#ifndef NULL
-#ifdef __GNUG__
-#define NULL (__null)
-#else
-#define NULL (0)
-#endif
-#endif
-
-#ifndef _IO_wchar_t
-#if _G_IO_IO_FILE_VERSION == 0x20001
-#define _IO_wchar_t _G_wchar_t
-#else
-#define _IO_wchar_t short
-#endif
-#endif
-
-extern "C++" {
-class istream; /* Work-around for a g++ name mangling bug. Fixed in 2.6. */
-class ostream; class streambuf;
-
-// In case some header files defines these as macros.
-#undef open
-#undef close
-
-#if defined(_G_IO_IO_FILE_VERSION) && _G_IO_IO_FILE_VERSION == 0x20001
-typedef _IO_off64_t streamoff;
-typedef _IO_off64_t streampos;
-#else
-typedef _IO_off_t streamoff;
-typedef _IO_off_t streampos;
-#endif
-typedef _IO_ssize_t streamsize;
-
-typedef unsigned long __fmtflags;
-typedef unsigned char __iostate;
-
-struct _ios_fields
-{ // The data members of an ios.
- streambuf *_strbuf;
- ostream* _tie;
- int _width;
- __fmtflags _flags;
- _IO_wchar_t _fill;
- __iostate _state;
- __iostate _exceptions;
- int _precision;
-
- void *_arrays; /* Support for ios::iword and ios::pword. */
-};
-
-#define _IOS_GOOD 0
-#define _IOS_EOF 1
-#define _IOS_FAIL 2
-#define _IOS_BAD 4
-
-#define _IO_INPUT 1
-#define _IO_OUTPUT 2
-#define _IO_ATEND 4
-#define _IO_APPEND 8
-#define _IO_TRUNC 16
-#define _IO_NOCREATE 32
-#define _IO_NOREPLACE 64
-#define _IO_BIN 128
-
-#ifdef _STREAM_COMPAT
-enum state_value {
- _good = _IOS_GOOD,
- _eof = _IOS_EOF,
- _fail = _IOS_FAIL,
- _bad = _IOS_BAD };
-enum open_mode {
- input = _IO_INPUT,
- output = _IO_OUTPUT,
- atend = _IO_ATEND,
- append = _IO_APPEND };
-#endif
-
-class ios : public _ios_fields {
- ios& operator=(ios&); /* Not allowed! */
- ios (const ios&); /* Not allowed! */
- public:
- typedef __fmtflags fmtflags;
- typedef int iostate;
- typedef int openmode;
- typedef _IO_ssize_t streamsize;
- enum io_state {
- goodbit = _IOS_GOOD,
- eofbit = _IOS_EOF,
- failbit = _IOS_FAIL,
- badbit = _IOS_BAD };
- enum open_mode {
- in = _IO_INPUT,
- out = _IO_OUTPUT,
- ate = _IO_ATEND,
- app = _IO_APPEND,
- trunc = _IO_TRUNC,
- nocreate = _IO_NOCREATE,
- noreplace = _IO_NOREPLACE,
- bin = _IOS_BIN, // Deprecated - ANSI uses ios::binary.
- binary = _IOS_BIN };
- enum seek_dir { beg, cur, end};
- typedef enum seek_dir seekdir;
- // NOTE: If adding flags here, before to update ios::bitalloc().
- enum { skipws=_IO_SKIPWS,
- left=_IO_LEFT, right=_IO_RIGHT, internal=_IO_INTERNAL,
- dec=_IO_DEC, oct=_IO_OCT, hex=_IO_HEX,
- showbase=_IO_SHOWBASE, showpoint=_IO_SHOWPOINT,
- uppercase=_IO_UPPERCASE, showpos=_IO_SHOWPOS,
- scientific=_IO_SCIENTIFIC, fixed=_IO_FIXED,
- unitbuf=_IO_UNITBUF, stdio=_IO_STDIO
-#ifndef _IO_NEW_STREAMS
- , dont_close=_IO_DONT_CLOSE // Don't delete streambuf on stream destruction
-#endif
- };
- enum { // Masks.
- basefield=dec+oct+hex,
- floatfield = scientific+fixed,
- adjustfield = left+right+internal
- };
-
-#ifdef _IO_THROW
- class failure : public xmsg {
- ios* _stream;
- public:
- failure(ios* stream) { _stream = stream; }
- failure(string cause, ios* stream) { _stream = stream; }
- ios* rdios() const { return _stream; }
- };
-#endif
-
- ostream* tie() const { return _tie; }
- ostream* tie(ostream* val) { ostream* save=_tie; _tie=val; return save; }
-
- // Methods to change the format state.
- _IO_wchar_t fill() const { return _fill; }
- _IO_wchar_t fill(_IO_wchar_t newf)
- {_IO_wchar_t oldf = _fill; _fill = newf; return oldf;}
- fmtflags flags() const { return _flags; }
- fmtflags flags(fmtflags new_val) {
- fmtflags old_val = _flags; _flags = new_val; return old_val; }
- int precision() const { return _precision; }
- int precision(int newp) {
- unsigned short oldp = _precision; _precision = (unsigned short)newp;
- return oldp; }
- fmtflags setf(fmtflags val) {
- fmtflags oldbits = _flags;
- _flags |= val; return oldbits; }
- fmtflags setf(fmtflags val, fmtflags mask) {
- fmtflags oldbits = _flags;
- _flags = (_flags & ~mask) | (val & mask); return oldbits; }
- fmtflags unsetf(fmtflags mask) {
- fmtflags oldbits = _flags;
- _flags &= ~mask; return oldbits; }
- int width() const { return _width; }
- int width(int val) { int save = _width; _width = val; return save; }
-
-#ifdef _IO_THROW
- void _throw_failure() const { throw new ios::failure(this); }
-#else
- void _throw_failure() const { }
-#endif
- void clear(iostate state = 0) {
- _state = _strbuf ? state : state|badbit;
- if (_state & _exceptions) _throw_failure(); }
- void set(iostate flag) { _state |= flag;
- if (_state & _exceptions) _throw_failure(); }
- void setstate(iostate flag) { _state |= flag; // ANSI
- if (_state & _exceptions) _throw_failure(); }
- int good() const { return _state == 0; }
- int eof() const { return _state & ios::eofbit; }
- int fail() const { return _state & (ios::badbit|ios::failbit); }
- int bad() const { return _state & ios::badbit; }
- iostate rdstate() const { return _state; }
- operator void*() const { return fail() ? (void*)0 : (void*)(-1); }
- int operator!() const { return fail(); }
- iostate exceptions() const { return _exceptions; }
- void exceptions(iostate enable) {
- _exceptions = enable;
- if (_state & _exceptions) _throw_failure(); }
-
- streambuf* rdbuf() const { return _strbuf; }
- streambuf* rdbuf(streambuf *_s) {
- streambuf *_old = _strbuf; _strbuf = _s; clear (); return _old; }
-
- static int sync_with_stdio(int on);
- static void sync_with_stdio() { sync_with_stdio(1); }
- static fmtflags bitalloc();
- static int xalloc();
- void*& pword(int);
- void* pword(int) const;
- long& iword(int);
- long iword(int) const;
-
-#ifdef _STREAM_COMPAT
- void unset(state_value flag) { _state &= ~flag; }
- void close();
- int is_open();
- int readable();
- int writable();
-#endif
-
- // Used to initialize standard streams. Not needed in this implementation.
- class Init {
- public:
- Init () { }
- };
-
- protected:
- inline ios(streambuf* sb = 0, ostream* tie_to = 0);
- inline virtual ~ios();
- inline void init(streambuf* sb, ostream* tie = 0);
-};
-
-#if __GNUG__==1
-typedef int _seek_dir;
-#else
-typedef ios::seek_dir _seek_dir;
-#endif
-
-// Magic numbers and bits for the _flags field.
-// The magic numbers use the high-order bits of _flags;
-// the remaining bits are abailable for variable flags.
-// Note: The magic numbers must all be negative if stdio
-// emulation is desired.
-
-// A streammarker remembers a position in a buffer.
-// You are guaranteed to be able to seek back to it if it is saving().
-class streammarker : private _IO_marker {
- friend class streambuf;
- void set_offset(int offset) { _pos = offset; }
- public:
- streammarker(streambuf *sb);
- ~streammarker();
- int saving() { return 1; }
- int delta(streammarker&);
- int delta();
-};
-
-struct streambuf : public _IO_FILE { // protected??
- friend class ios;
- friend class istream;
- friend class ostream;
- friend class streammarker;
- const void *&_vtable() { return *(const void**)((_IO_FILE*)this + 1); }
- protected:
- static streambuf* _list_all; /* List of open streambufs. */
- _IO_FILE*& xchain() { return _chain; }
- void _un_link();
- void _link_in();
- char* gptr() const
- { return _IO_file_flags & _IO_IN_BACKUP ? _IO_save_base : _IO_read_ptr; }
- char* pptr() const { return _IO_write_ptr; }
- char* egptr() const
- { return _IO_file_flags & _IO_IN_BACKUP ? _IO_save_end : _IO_read_end; }
- char* epptr() const { return _IO_write_end; }
- char* pbase() const { return _IO_write_base; }
- char* eback() const
- { return _IO_file_flags & _IO_IN_BACKUP ? _IO_save_base : _IO_read_base;}
- char* base() const { return _IO_buf_base; }
- char* ebuf() const { return _IO_buf_end; }
- int blen() const { return _IO_buf_end - _IO_buf_base; }
- void xput_char(char c) { *_IO_write_ptr++ = c; }
- int xflags() { return _IO_file_flags; }
- int xflags(int f) {int fl = _IO_file_flags; _IO_file_flags = f; return fl;}
- void xsetflags(int f) { _IO_file_flags |= f; }
- void xsetflags(int f, int mask)
- { _IO_file_flags = (_IO_file_flags & ~mask) | (f & mask); }
- void gbump(int n)
- { _IO_file_flags & _IO_IN_BACKUP ? (_IO_save_base+=n):(_IO_read_ptr+=n);}
- void pbump(int n) { _IO_write_ptr += n; }
- void setb(char* b, char* eb, int a=0);
- void setp(char* p, char* ep)
- { _IO_write_base=_IO_write_ptr=p; _IO_write_end=ep; }
- void setg(char* eb, char* g, char *eg) {
- if (_IO_file_flags & _IO_IN_BACKUP) _IO_free_backup_area(this);
- _IO_read_base = eb; _IO_read_ptr = g; _IO_read_end = eg; }
- char *shortbuf() { return _shortbuf; }
-
- int in_backup() { return _flags & _IO_IN_BACKUP; }
- // The start of the main get area: FIXME: wrong for write-mode filebuf?
- char *Gbase() { return in_backup() ? _IO_save_base : _IO_read_base; }
- // The end of the main get area:
- char *eGptr() { return in_backup() ? _IO_save_end : _IO_read_end; }
- // The start of the backup area:
- char *Bbase() { return in_backup() ? _IO_read_base : _IO_save_base; }
- char *Bptr() { return _IO_backup_base; }
- // The end of the backup area:
- char *eBptr() { return in_backup() ? _IO_read_end : _IO_save_end; }
- char *Nbase() { return _IO_save_base; }
- char *eNptr() { return _IO_save_end; }
- int have_backup() { return _IO_save_base != NULL; }
- int have_markers() { return _markers != NULL; }
- void free_backup_area();
- void unsave_markers(); // Make all streammarkers !saving().
- int put_mode() { return _flags & _IO_CURRENTLY_PUTTING; }
- int switch_to_get_mode();
-
- streambuf(int flags=0);
- public:
- static int flush_all();
- static void flush_all_linebuffered(); // Flush all line buffered files.
- virtual ~streambuf();
- virtual int overflow(int c = EOF); // Leave public for now
- virtual int underflow(); // Leave public for now
- virtual int uflow(); // Leave public for now
- virtual int pbackfail(int c);
-// virtual int showmany ();
- virtual streamsize xsputn(const char* s, streamsize n);
- virtual streamsize xsgetn(char* s, streamsize n);
- virtual streampos seekoff(streamoff, _seek_dir, int mode=ios::in|ios::out);
- virtual streampos seekpos(streampos pos, int mode = ios::in|ios::out);
-
- streampos pubseekoff(streamoff o, _seek_dir d, int mode=ios::in|ios::out)
- { return _IO_seekoff (this, o, d, mode); }
- streampos pubseekpos(streampos pos, int mode = ios::in|ios::out)
- { return _IO_seekpos (this, pos, mode); }
- streampos sseekoff(streamoff, _seek_dir, int mode=ios::in|ios::out);
- streampos sseekpos(streampos pos, int mode = ios::in|ios::out);
- virtual streambuf* setbuf(char* p, int len);
- virtual int sync();
- virtual int doallocate();
-
- int seekmark(streammarker& mark, int delta = 0);
- int sputbackc(char c);
- int sungetc();
- int unbuffered() { return _flags & _IO_UNBUFFERED ? 1 : 0; }
- int linebuffered() { return _flags & _IO_LINE_BUF ? 1 : 0; }
- void unbuffered(int i)
- { if (i) _flags |= _IO_UNBUFFERED; else _flags &= ~_IO_UNBUFFERED; }
- void linebuffered(int i)
- { if (i) _flags |= _IO_LINE_BUF; else _flags &= ~_IO_LINE_BUF; }
- int allocate() { // For AT&T compatibility
- if (base() || unbuffered()) return 0;
- else return doallocate(); }
- // Allocate a buffer if needed; use _shortbuf if appropriate.
- void allocbuf() { if (base() == NULL) doallocbuf(); }
- void doallocbuf();
- int in_avail() { return _IO_read_end - _IO_read_ptr; }
- int out_waiting() { return _IO_write_ptr - _IO_write_base; }
- streamsize sputn(const char* s, streamsize n) { return xsputn(s, n); }
- streamsize padn(char pad, streamsize n) { return _IO_padn(this, pad, n); }
- streamsize sgetn(char* s, streamsize n) { return _IO_sgetn(this, s, n); }
- int ignore(int);
- int get_column();
- int set_column(int);
- long sgetline(char* buf, _IO_size_t n, char delim, int putback_delim);
- int sputc(int c) { return _IO_putc(c, this); }
- int sbumpc() { return _IO_getc(this); }
- int sgetc() { return _IO_peekc(this); }
- int snextc() {
- if (_IO_read_ptr >= _IO_read_end && __underflow(this) == EOF)
- return EOF;
- else return _IO_read_ptr++, sgetc(); }
- void stossc() { if (_IO_read_ptr < _IO_read_end) _IO_read_ptr++; }
- int vscan(char const *fmt0, _IO_va_list ap, ios* stream = NULL);
- int scan(char const *fmt0 ...);
- int vform(char const *fmt0, _IO_va_list ap);
- int form(char const *fmt0 ...);
-#if 0 /* Work in progress */
- int column(); // Current column number (of put pointer). -1 is unknown.
- void column(int c); // Set column number of put pointer to c.
-#endif
- virtual streamsize sys_read(char* buf, streamsize size);
- virtual streamsize sys_write(const char*, streamsize);
- virtual streampos sys_seek(streamoff, _seek_dir);
- virtual int sys_close();
- virtual int sys_stat(void*); // Actually, a (struct stat*)
-#if _G_IO_IO_FILE_VERSION == 0x20001
- virtual int showmanyc();
- virtual void imbue(void *);
-#endif
-};
-
-// A backupbuf is a streambuf with full backup and savepoints on reading.
-// All standard streambufs in the GNU iostream library are backupbufs.
-
-class filebuf : public streambuf {
- protected:
- void init();
- public:
- static const int openprot; // Non-ANSI AT&T-ism: Default open protection.
- filebuf();
- filebuf(int fd);
- filebuf(int fd, char* p, int len);
-#if !_IO_UNIFIED_JUMPTABLES
- static filebuf *__new();
-#endif
- ~filebuf();
- filebuf* attach(int fd);
- filebuf* open(const char *filename, const char *mode);
- filebuf* open(const char *filename, ios::openmode mode, int prot = 0664);
- virtual int underflow();
- virtual int overflow(int c = EOF);
- int is_open() const { return _fileno >= 0; }
- int fd() const { return is_open() ? _fileno : EOF; }
- filebuf* close();
- virtual int doallocate();
- virtual streampos seekoff(streamoff, _seek_dir, int mode=ios::in|ios::out);
- virtual streambuf* setbuf(char* p, int len);
- streamsize xsputn(const char* s, streamsize n);
- streamsize xsgetn(char* s, streamsize n);
- virtual int sync();
- protected: // See documentation in filebuf.C.
-// virtual int pbackfail(int c);
- int is_reading() { return eback() != egptr(); }
- char* cur_ptr() { return is_reading() ? gptr() : pptr(); }
- /* System's idea of pointer */
- char* file_ptr() { return eGptr(); }
- // Low-level operations (Usually invoke system calls.)
- virtual streamsize sys_read(char* buf, streamsize size);
- virtual streampos sys_seek(streamoff, _seek_dir);
- virtual streamsize sys_write(const char*, streamsize);
- virtual int sys_stat(void*); // Actually, a (struct stat*)
- virtual int sys_close();
-#if 0
- virtual uflow;
- virtual showmany;
-#endif
-};
-
-inline void ios::init(streambuf* sb, ostream* tie_to) {
- _state = sb ? ios::goodbit : ios::badbit; _exceptions=0;
- _strbuf=sb; _tie = tie_to; _width=0; _fill=' ';
-#ifdef _IO_NEW_STREAMS
- _flags=ios::skipws|ios::dec;
-#else
- _flags=ios::skipws|ios::dec|ios::dont_close;
-#endif
- _precision=6; _arrays = 0; }
-
-inline ios::ios(streambuf* sb, ostream* tie_to) { init(sb, tie_to); }
-
-inline ios::~ios() {
-#ifndef _IO_NEW_STREAMS
- if (!(_flags & (unsigned int)ios::dont_close)) delete rdbuf();
-#endif
- // It is safe to use naked operator delete[] as we know elements have no
- // dtor, and g++ does not add a new[] cookie for such cases.
- operator delete[] (_arrays);
-}
-} // extern "C++"
-#endif /* _STREAMBUF_H */
diff --git a/contrib/libio/strfile.h b/contrib/libio/strfile.h
deleted file mode 100644
index 85e83a95d073..000000000000
--- a/contrib/libio/strfile.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/* Copyright (C) 1993, 1997, 1998 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 <libio.h>
-#ifdef TODO
-Merge into libio.h ?
-#endif
-
-#ifndef __PMT
-# ifdef __STDC__
-# define __PMT(p) p
-# else
-# define __PMT(p) ()
-# endif
-#endif /*!__P*/
-
-typedef void *(*_IO_alloc_type) __PMT ((_IO_size_t));
-typedef void (*_IO_free_type) __PMT ((void*));
-
-struct _IO_str_fields
-{
- _IO_alloc_type _allocate_buffer;
- _IO_free_type _free_buffer;
-};
-
-/* This is needed for the Irix6 N32 ABI, which has a 64 bit off_t type,
- but a 32 bit pointer type. In this case, we get 4 bytes of padding
- after the vtable pointer. Putting them in a structure together solves
- this problem. */
-
-struct _IO_streambuf
-{
- struct _IO_FILE _f;
- const void *_vtable;
-};
-
-typedef struct _IO_strfile_
-{
- struct _IO_streambuf _sbf;
- struct _IO_str_fields _s;
-} _IO_strfile;
-
-/* dynamic: set when the array object is allocated (or reallocated) as
- necessary to hold a character sequence that can change in length. */
-#define _IO_STR_DYNAMIC(FP) ((FP)->_s._allocate_buffer != (_IO_alloc_type)0)
-
-/* frozen: set when the program has requested that the array object not
- be altered, reallocated, or freed. */
-#define _IO_STR_FROZEN(FP) ((FP)->_f._IO_file_flags & _IO_USER_BUF)
diff --git a/contrib/libio/strops.c b/contrib/libio/strops.c
deleted file mode 100644
index 193e39d55cb8..000000000000
--- a/contrib/libio/strops.c
+++ /dev/null
@@ -1,303 +0,0 @@
-/* Copyright (C) 1993, 1997, 1998 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 "strfile.h"
-#include "libioP.h"
-#include <string.h>
-
-#if 0
-/* The following definitions are for exposition only.
- They map the terminology used in the ANSI/ISO C++ draft standard
- to the implementation. */
-
-/* allocated: set when a dynamic array object has been allocated, and
- hence should be freed by the destructor for the strstreambuf object. */
-#define ALLOCATED(FP) ((FP)->_f._IO_buf_base && DYNAMIC(FP))
-
-/* constant: set when the array object has const elements,
- so the output sequence cannot be written. */
-#define CONSTANT(FP) ((FP)->_f._IO_file_flags & _IO_NO_WRITES)
-
-/* alsize: the suggested minimum size for a dynamic array object. */
-#define ALSIZE(FP) ??? /* not stored */
-
-/* palloc: points to the function to call to allocate a dynamic array object.*/
-#define PALLOC(FP) \
- ((FP)->_s._allocate_buffer == default_alloc ? 0 : (FP)->_s._allocate_buffer)
-
-/* pfree: points to the function to call to free a dynamic array object. */
-#define PFREE(FP) \
- ((FP)->_s._free_buffer == default_free ? 0 : (FP)->_s._free_buffer)
-
-#endif
-
-#ifdef TODO
-/* An "unbounded buffer" is when a buffer is supplied, but with no
- specified length. An example is the buffer argument to sprintf.
- */
-#endif
-
-void
-_IO_str_init_static (fp, ptr, size, pstart)
- _IO_FILE *fp;
- char *ptr;
- int size;
- char *pstart;
-{
- if (size == 0)
- size = strlen (ptr);
- else if (size < 0)
- {
- /* If size is negative 'the characters are assumed to
- continue indefinitely.' This is kind of messy ... */
- int s;
- size = 512;
- /* Try increasing powers of 2, as long as we don't wrap around. */
- for (; s = 2*size, s > 0 && ptr + s > ptr && s < 0x4000000L; )
- size = s;
- /* Try increasing size as much as we can without wrapping around. */
- for (s = size >> 1; s > 0; s >>= 1)
- {
- if (ptr + size + s > ptr)
- size += s;
- }
- }
- _IO_setb (fp, ptr, ptr + size, 0);
-
- fp->_IO_write_base = ptr;
- fp->_IO_read_base = ptr;
- fp->_IO_read_ptr = ptr;
- if (pstart)
- {
- fp->_IO_write_ptr = pstart;
- fp->_IO_write_end = ptr + size;
- fp->_IO_read_end = pstart;
- }
- else
- {
- fp->_IO_write_ptr = ptr;
- fp->_IO_write_end = ptr;
- fp->_IO_read_end = ptr+size;
- }
- /* A null _allocate_buffer function flags the strfile as being static. */
- (((_IO_strfile *) fp)->_s._allocate_buffer) = (_IO_alloc_type)0;
-}
-
-void
-_IO_str_init_readonly (fp, ptr, size)
- _IO_FILE *fp;
- const char *ptr;
- int size;
-{
- _IO_str_init_static (fp, (char *) ptr, size, NULL);
- fp->_IO_file_flags |= _IO_NO_WRITES;
-}
-
-int
-_IO_str_overflow (fp, c)
- _IO_FILE *fp;
- int c;
-{
- int flush_only = c == EOF;
- _IO_size_t pos;
- if (fp->_flags & _IO_NO_WRITES)
- return flush_only ? 0 : EOF;
- if ((fp->_flags & _IO_TIED_PUT_GET) && !(fp->_flags & _IO_CURRENTLY_PUTTING))
- {
- fp->_flags |= _IO_CURRENTLY_PUTTING;
- fp->_IO_write_ptr = fp->_IO_read_ptr;
- fp->_IO_read_ptr = fp->_IO_read_end;
- }
- pos = fp->_IO_write_ptr - fp->_IO_write_base;
- if (pos >= (_IO_size_t) (_IO_blen (fp) + flush_only))
- {
- if (fp->_flags & _IO_USER_BUF) /* not allowed to enlarge */
- return EOF;
- else
- {
- char *new_buf;
- char *old_buf = fp->_IO_buf_base;
- _IO_size_t new_size = 2 * _IO_blen (fp) + 100;
- new_buf
- = (char *) (*((_IO_strfile *) fp)->_s._allocate_buffer) (new_size);
- if (new_buf == NULL)
- {
- /* __ferror(fp) = 1; */
- return EOF;
- }
- if (fp->_IO_buf_base)
- {
- memcpy (new_buf, old_buf, _IO_blen (fp));
- (*((_IO_strfile *) fp)->_s._free_buffer) (fp->_IO_buf_base);
- /* Make sure _IO_setb won't try to delete _IO_buf_base. */
- fp->_IO_buf_base = NULL;
- }
-#if 0
- if (lenp == &LEN(fp)) /* use '\0'-filling */
- memset (new_buf + pos, 0, blen() - pos);
-#endif
- _IO_setb (fp, new_buf, new_buf + new_size, 1);
- fp->_IO_read_base = new_buf + (fp->_IO_read_base - old_buf);
- fp->_IO_read_ptr = new_buf + (fp->_IO_read_ptr - old_buf);
- fp->_IO_read_end = new_buf + (fp->_IO_read_end - old_buf);
- fp->_IO_write_ptr = new_buf + (fp->_IO_write_ptr - old_buf);
-
- fp->_IO_write_base = new_buf;
- fp->_IO_write_end = fp->_IO_buf_end;
- }
- }
-
- if (!flush_only)
- *fp->_IO_write_ptr++ = (unsigned char) c;
- if (fp->_IO_write_ptr > fp->_IO_read_end)
- fp->_IO_read_end = fp->_IO_write_ptr;
- return c;
-}
-
-int
-_IO_str_underflow (fp)
- _IO_FILE *fp;
-{
- if (fp->_IO_write_ptr > fp->_IO_read_end)
- fp->_IO_read_end = fp->_IO_write_ptr;
- if ((fp->_flags & _IO_TIED_PUT_GET) && (fp->_flags & _IO_CURRENTLY_PUTTING))
- {
- fp->_flags &= ~_IO_CURRENTLY_PUTTING;
- fp->_IO_read_ptr = fp->_IO_write_ptr;
- fp->_IO_write_ptr = fp->_IO_write_end;
- }
- if (fp->_IO_read_ptr < fp->_IO_read_end)
- return *((unsigned char *) fp->_IO_read_ptr);
- else
- return EOF;
-}
-
-/* The size of the valid part of the buffer. */
-
-_IO_ssize_t
-_IO_str_count (fp)
- _IO_FILE *fp;
-{
- return ((fp->_IO_write_ptr > fp->_IO_read_end
- ? fp->_IO_write_ptr : fp->_IO_read_end)
- - fp->_IO_read_base);
-}
-
-_IO_pos_t
-_IO_str_seekoff (fp, offset, dir, mode)
- _IO_FILE *fp;
- _IO_off_t offset;
- int dir;
- int mode;
-{
- _IO_ssize_t cur_size = _IO_str_count (fp);
- _IO_pos_t new_pos = EOF;
-
- /* Move the get pointer, if requested. */
- if (mode & _IOS_INPUT)
- {
- switch (dir)
- {
- case _IO_seek_end:
- offset += cur_size;
- break;
- case _IO_seek_cur:
- offset += fp->_IO_read_ptr - fp->_IO_read_base;
- break;
- default: /* case _IO_seek_set: */
- break;
- }
- if (offset < 0 || (_IO_ssize_t) offset > cur_size)
- return EOF;
- fp->_IO_read_ptr = fp->_IO_read_base + offset;
- fp->_IO_read_end = fp->_IO_read_base + cur_size;
- new_pos = offset;
- }
-
- /* Move the put pointer, if requested. */
- if (mode & _IOS_OUTPUT)
- {
- switch (dir)
- {
- case _IO_seek_end:
- offset += cur_size;
- break;
- case _IO_seek_cur:
- offset += fp->_IO_write_ptr - fp->_IO_write_base;
- break;
- default: /* case _IO_seek_set: */
- break;
- }
- if (offset < 0 || (_IO_ssize_t) offset > cur_size)
- return EOF;
- fp->_IO_write_ptr = fp->_IO_write_base + offset;
- new_pos = offset;
- }
- return new_pos;
-}
-
-int
-_IO_str_pbackfail (fp, c)
- _IO_FILE *fp;
- int c;
-{
- if ((fp->_flags & _IO_NO_WRITES) && c != EOF)
- return EOF;
- return _IO_default_pbackfail (fp, c);
-}
-
-void
-_IO_str_finish (fp, dummy)
- _IO_FILE *fp;
- int dummy;
-{
- if (fp->_IO_buf_base && !(fp->_flags & _IO_USER_BUF))
- (((_IO_strfile *) fp)->_s._free_buffer) (fp->_IO_buf_base);
- fp->_IO_buf_base = NULL;
-
- _IO_default_finish (fp, 0);
-}
-
-struct _IO_jump_t _IO_str_jumps =
-{
- JUMP_INIT_DUMMY,
- JUMP_INIT(finish, _IO_str_finish),
- JUMP_INIT(overflow, _IO_str_overflow),
- JUMP_INIT(underflow, _IO_str_underflow),
- JUMP_INIT(uflow, _IO_default_uflow),
- JUMP_INIT(pbackfail, _IO_str_pbackfail),
- JUMP_INIT(xsputn, _IO_default_xsputn),
- JUMP_INIT(xsgetn, _IO_default_xsgetn),
- JUMP_INIT(seekoff, _IO_str_seekoff),
- JUMP_INIT(seekpos, _IO_default_seekpos),
- JUMP_INIT(setbuf, _IO_default_setbuf),
- JUMP_INIT(sync, _IO_default_sync),
- JUMP_INIT(doallocate, _IO_default_doallocate),
- JUMP_INIT(read, _IO_default_read),
- JUMP_INIT(write, _IO_default_write),
- JUMP_INIT(seek, _IO_default_seek),
- JUMP_INIT(close, _IO_default_close),
- JUMP_INIT(stat, _IO_default_stat)
-};
diff --git a/contrib/libio/strstream.cc b/contrib/libio/strstream.cc
deleted file mode 100644
index a32e811c9d94..000000000000
--- a/contrib/libio/strstream.cc
+++ /dev/null
@@ -1,116 +0,0 @@
-/* This is part of libio/iostream, providing -*- C++ -*- input/output.
-Copyright (C) 1993 Free Software Foundation
-
-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. */
-
-/* Written by Per Bothner (bothner@cygnus.com). */
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include "iostreamP.h"
-#include "strstream.h"
-#include <string.h>
-
-static void* default_alloc(_IO_size_t size)
-{
- return (void*)new char[size];
-}
-
-static void default_free(void* ptr)
-{
- delete [] (char*)ptr;
-}
-
-istrstream::istrstream(const char *cp, int n)
-{
- __my_sb.init_readonly (cp, n);
-}
-
-strstreambase::strstreambase(char *cp, int n, int mode)
-: __my_sb (cp, n,
- (mode == ios::app || mode == ios::ate) ? cp + strlen(cp) : cp)
-{
- init (&__my_sb);
-}
-
-char *strstreambuf::str()
-{
- freeze(1);
- return base();
-}
-
-_IO_ssize_t strstreambuf::pcount () { return _IO_write_ptr - _IO_write_base; }
-
-int strstreambuf::overflow(int c /* = EOF */)
-{
- return _IO_str_overflow (this, c);
-}
-
-int strstreambuf::underflow()
-{
- return _IO_str_underflow(this);
-}
-
-
-void strstreambuf::init_dynamic(_IO_alloc_type alloc, _IO_free_type free,
- int initial_size)
-
-{
- _s._allocate_buffer = alloc ? alloc : default_alloc;
- _s._free_buffer = free ? free : default_free;
- if (initial_size > 0)
- {
- char * buf = (char*)(*_s._allocate_buffer)(initial_size);
- setb(buf, buf + initial_size, 1);
- setp(buf, buf + initial_size);
- setg(buf, buf, buf);
- }
-}
-
-void strstreambuf::init_static(char *ptr, int size, char *pstart)
-{
- _IO_str_init_static (this, ptr, size, pstart);
-}
-
-void strstreambuf::init_readonly (const char *ptr, int size)
-{
- _IO_str_init_readonly (this, ptr, size);
-}
-
-strstreambuf::~strstreambuf()
-{
- if (_IO_buf_base && !(_flags & _IO_USER_BUF))
- (_s._free_buffer)(_IO_buf_base);
- _IO_buf_base = NULL;
-}
-
-streampos strstreambuf::seekoff(streamoff off, _seek_dir dir,
- int mode /*=ios::in|ios::out*/)
-{
- return _IO_str_seekoff (this, off, dir, mode);
-}
-
-int strstreambuf::pbackfail(int c)
-{
- return _IO_str_pbackfail (this, c);
-}
diff --git a/contrib/libio/strstream.h b/contrib/libio/strstream.h
deleted file mode 100644
index 967e5b0b76ac..000000000000
--- a/contrib/libio/strstream.h
+++ /dev/null
@@ -1,113 +0,0 @@
-/* This is part of libio/iostream, providing -*- C++ -*- input/output.
-Copyright (C) 1993, 1999 Free Software Foundation
-
-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. */
-
-/* Written by Per Bothner (bothner@cygnus.com). */
-
-#ifndef __STRSTREAM_H
-#define __STRSTREAM_H
-#ifdef __GNUG__
-#pragma interface
-#endif
-#include <iostream.h>
-#include <strfile.h>
-
-extern "C++" {
-class strstreambuf : public streambuf
-{
- struct _IO_str_fields _s;
- friend class istrstream;
-
- void init_dynamic(_IO_alloc_type alloc, _IO_free_type free,
- int initial_size = 0);
- void init_static(char *ptr, int size, char *pstart);
- void init_readonly(const char *ptr, int size);
- protected:
- virtual int overflow(int = EOF);
- virtual int underflow();
- virtual int pbackfail(int c);
- public:
- virtual ~strstreambuf();
- strstreambuf() { init_dynamic(0, 0); }
- strstreambuf(int initial_size) { init_dynamic(0, 0, initial_size); }
- strstreambuf(void *(*__alloc)(_IO_size_t), void (*__free)(void*))
- { init_dynamic(__alloc, __free); }
- strstreambuf(char *ptr, int size, char *pstart = NULL)
- { init_static(ptr, size, pstart); }
- strstreambuf(unsigned char *ptr, int size, unsigned char *pstart = NULL)
- { init_static((char*)ptr, size, (char*)pstart); }
- strstreambuf(const char *ptr, int size)
- { init_readonly(ptr, size); }
- strstreambuf(const unsigned char *ptr, int size)
- { init_readonly((const char*)ptr, size); }
- strstreambuf(signed char *ptr, int size, signed char *pstart = NULL)
- { init_static((char*)ptr, size, (char*)pstart); }
- strstreambuf(const signed char *ptr, int size)
- { init_readonly((const char*)ptr, size); }
- // Note: frozen() is always true if !_IO_STR_DYNAMIC(this).
- int frozen() { return _flags & _IO_USER_BUF ? 1 : 0; }
- void freeze(int n=1)
- { if (_IO_STR_DYNAMIC(this))
- { if (n) _flags |= _IO_USER_BUF; else _flags &= ~_IO_USER_BUF; } }
- _IO_ssize_t pcount();
- char *str();
- virtual streampos seekoff(streamoff, _seek_dir, int mode=ios::in|ios::out);
-};
-
-class strstreambase : virtual public ios {
- protected:
- strstreambuf __my_sb;
- public:
- strstreambuf* rdbuf() { return &__my_sb; }
- protected:
- strstreambase() { init (&__my_sb); }
- strstreambase(char *cp, int n, int mode=ios::out);
-};
-
-class istrstream : public strstreambase, public istream {
- public:
- istrstream(const char*, int=0);
-};
-
-class ostrstream : public strstreambase, public ostream {
- public:
- ostrstream() { }
- ostrstream(char *cp, int n, int mode=ios::out) :strstreambase(cp,n,mode){}
- _IO_ssize_t pcount() { return ((strstreambuf*)_strbuf)->pcount(); }
- char *str() { return ((strstreambuf*)_strbuf)->str(); }
- void freeze(int n = 1) { ((strstreambuf*)_strbuf)->freeze(n); }
- int frozen() { return ((strstreambuf*)_strbuf)->frozen(); }
-};
-
-class strstream : public strstreambase, public iostream {
- public:
- strstream() { }
- strstream(char *cp, int n, int mode=ios::out) :strstreambase(cp,n,mode){}
- _IO_ssize_t pcount() { return ((strstreambuf*)_strbuf)->pcount(); }
- char *str() { return ((strstreambuf*)_strbuf)->str(); }
- void freeze(int n = 1) { ((strstreambuf*)_strbuf)->freeze(n); }
- int frozen() { return ((strstreambuf*)_strbuf)->frozen(); }
-};
-} // extern "C++"
-
-#endif /*!__STRSTREAM_H*/
diff --git a/contrib/libio/tests/ChangeLog b/contrib/libio/tests/ChangeLog
deleted file mode 100644
index 548e9e0519aa..000000000000
--- a/contrib/libio/tests/ChangeLog
+++ /dev/null
@@ -1,166 +0,0 @@
-Fri Mar 16 12:46:19 GMT 2001 Bernd Schmidt (bernds@redhat.com)
-
- * gcc-2.95.3 Released.
-
-Sun Oct 24 23:54:10 PDT 1999 Jeff Law (law@cygnus.com)
-
- * gcc-2.95.2 Released.
-
-Mon Aug 16 01:29:24 PDT 1999 Jeff Law (law@cygnus.com)
-
- * gcc-2.95.1 Released.
-
-Wed Jul 28 21:39:31 PDT 1999 Jeff Law (law@cygnus.com)
-
- * gcc-2.95 Released.
-
-Sun Jul 25 23:40:51 PDT 1999 Jeff Law (law@cygnus.com)
-
- * gcc-2.95 Released.
-
-1997-10-31 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * tFile.cc (t4): Cast TMPFILE to char* in the call to unlink, to
- solve warning problems with vxworks headers that leave const off
- their declarations.
-
-Tue May 20 17:57:31 1997 Jeffrey A Law (law@cygnus.com)
-
- * tfformat.c (main): Only run half the testcases if SLOW_SIMULATOR
- is defined.
-
-Sun May 18 17:15:32 1997 Jeffrey A Law (law@cygnus.com)
-
- * tfformat.c (main): Exit immediately if doubles are not
- at least 64 bits wide.
-
-Fri May 16 19:31:29 1997 Bob Manson <manson@charmed.cygnus.com>
-
- Fix testscases to use _G_int32_t appropriately.
-
-Thu May 1 17:35:43 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * Makefile.in (tgetl, tFile, tiomisc, hounddog, putbackdog,
- tiomanip, foo, foo+): Add $(CXXFLAGS).
- (tfseek, twrseek, trdseek, tstdiomisc, tpopen): Add $(CFLAGS).
-
-Mon Apr 28 11:28:36 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * tiomisc.cc (operator delete): Add throw spec.
-
-Sat Apr 26 13:40:17 1997 Bob Manson <manson@charmed.cygnus.com>
-
- * Makefile.in: Change check to check-old. Add do-nothing
- check target.
-
-Wed Apr 10 17:15:47 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * Makefile.in (IOLIBS): Link with libstdc++.
-
-Tue Mar 12 11:45:14 1996 Per Bothner <bothner@kalessin.cygnus.com>
-
- * tiomisc.cc (test_read_write_flush): New test for read/write/seek
- on block end. From Luke Blanshard <luke@cs.wisc.edu>.
-
-Thu Jul 6 17:51:30 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * tiomisc.cc (getline_test3): New function. Test reading long lines.
- * tiomisc.exp: Update for output from getline_test3.
-
-Wed May 10 03:06:51 1995 Jason Merrill <jason@python.cygnus.com>
-
- * configure.in (X*INCLUDES): Renamed.
-
-Thu Apr 27 21:05:00 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * tiomisc.cc (test_destroy), tiomisc.exp: Add support for
- _IO_NEW_STREAMS.
-
-Tue Apr 25 15:15:01 1995 Jim Wilson <wilson@chestnut.cygnus.com>
-
- * tstdiomisc.c (t2): Use N not n in last SCAN macro call.
-
-Sun Feb 12 21:23:24 1995 Brendan Kehoe (brendan@lisa.cygnus.com)
-
- * Makefile.in (JUNK_TO_CLEAN): Also delete foo.dat from tiomisc.
-
-Sat Nov 5 14:37:36 1994 Per Bothner <bothner@kalessin.cygnus.com>
-
- * tiomisc.cc (test_destroy): New test case from Jason Merrill.
- * tiomisc.exp: Update.
-
- * Makefile.in (JUNK_TO_CLEAN): Add tstdiomisc.
-
-Thu Oct 13 16:47:30 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * tiomisc.cc (reread_test): Remove bogus istream assignment.
-
-Wed Aug 31 13:59:56 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * Makefile.in (CXX_FLAGS): Not used. Removed.
-
-Wed Aug 17 18:27:37 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * tiomisc.cc (getline_test1, getline_test2, flush1_test): New tests,
- * tiomisc.cc (reread_test): New tests,
-
-Wed Jun 22 13:44:19 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * tstdiomisc.c: Add some sscanf tests.
- * Makefile.in (check-tstdiomisc): Run diff with expected output.
- * tstdiomisc.exp: New file. Expected output from tstdiomisc.
- * Makefile.in (foo): New rule, for quick one-off tests.
-
-Fri May 6 14:10:24 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * tFile.cc (t7): Revert Mar 4 change - I was confused.
-
-Sat Apr 2 04:41:41 1994 Andreas Schwab (schwab@issan.informatik.uni-dortmund.de)
-
- * Makefile.in (tfformat): Fix dependency.
-
-Fri Mar 4 17:40:14 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * tFile.cc (t7): gcount after getline shouldn't include delimiter.
- * tFile.cc (show_int, t12), tFile.exp: More integer formatting tests.
-
-Tue Feb 8 18:39:09 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * tiomisc.cc, tiomisc.exp: New test case (for filebuf::attach)
- from Joe Buck.
-
-Mon Jan 31 13:24:58 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * tfformat.c (main): Fix fprintf format string (%s -> %d).
- Bug reported by Jochen Voss <voss@mathematik.uni-kl.de>.
-
-Sun Dec 19 15:29:00 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * tstdiomisc.c, Makefile.in: New tests.
-
-Thu Dec 2 22:56:21 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * Makefile.in (JUNK_TO_CLEAN), configure.in (MOSTLYCLEAN):
- Added, to cleanup after tests.
-
-Fri Nov 26 16:05:43 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * tiomisc.cc, tiomisc.exp: A (hopefully growing) collection
- of small, random tests (mainly regression tests).
- * tiomisc.cc (test1 and test2): Tests from Wilco van Hoogstraeten
- <wilco@erasmus.et.tudelft.nl> to check for (now-fixed) bugs.
-
-Mon Oct 4 17:38:27 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * Makefile.in (IOSTDIOLIB): New macro.
-
-Fri Aug 27 12:22:10 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * tFile.cc (t7): Add test for buffer overflow.
-
-Fri Aug 20 00:23:53 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- Moved various tests over from old libg++/iostream/test.
- * Makefile.in: Edit appropriately.
-
-
diff --git a/contrib/libio/tests/Makefile.in b/contrib/libio/tests/Makefile.in
deleted file mode 100644
index b70639a68096..000000000000
--- a/contrib/libio/tests/Makefile.in
+++ /dev/null
@@ -1,196 +0,0 @@
-# Copyright (C) 1993, 1998 Free Software Foundation
-#
-# 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 GNU CC; see the file COPYING. If not, write to
-# the Free Software Foundation, 59 Temple Place - Suite 330,
-# Boston, MA 02111-1307, USA. */
-
-srcdir = .
-
-CFLAGS = -g
-C_FLAGS = $(CFLAGS) -I. -I.. -I$(srcdir) -I$(srcdir)/..
-CXXFLAGS = -g
-CC = gcc
-CXX = gcc
-
-#### package, host, target, and site dependent Makefile fragments come in here.
-##
-
-STDIO_LD_FLAGS = -u __cleanup
-
-#LIBS = ../../libg++.a
-
-#LIBSTDIO = ../stdio/libstdio++.a
-#LIBIO = ../libio.a
-
-#STDIOLIBS = $(STDIO_LD_FLAGS) $(LIBSTDIO) $(LIBIO) $(LIBS)
-STDIOLIBS = $(LIBSTDIO) $(LIBIO) $(LIBS)
-IOLIBS = -L../../libstdc++ -lstdc++
-IOSTDIOLIB = ../libio.a ../../libiberty/libiberty.a
-
-DEPEND_SOURCES = $(srcdir)/*.C
-
-.PHONY: check check-old check-iostream check-stdio
-check: $(CHECK)
-
-
-# These are tests written in C++, that test the iostream facility.
-check-iostream: check-tFile check-tiomisc \
- check-hounddog check-putbackdog check-tiomanip
-
-# These are tests written in C, that don't need C++.
-# They test libio's emulation of stdio.
-check-iostdio: check-tiformat check-tfformat check-tstdiomisc
-
-# check-stdio runs test programs that use stdio.
-# These aren't run by default because there may be linker tricks needed
-# to build them (if libc.a contains a competing stdio implementation).
-
-check-stdio: check-tfseek check-twrseek check-trdseek check-tpopen
-
-# See ${MOSTLYCLEAN} in configure.in
-JUNK_TO_CLEAN = tFile tiomisc hounddog putbackdog tiomanip \
- t?format *.out streamfile ftmp* tstdiomisc foo.dat
-
-.PHONY: info
-info:
-.PHONY: clean-info
-clean-info:
-.PHONY: install-info
-install-info:
-
-tst: tst.o
- gcc -v -o tst tst.o $(STDIOLIBS)
-
-tgetl: tgetl.o
- $(CXX) $(CXXFLAGS) -o tgetl tgetl.o $(IOLIBS)
-
-tFile: tFile.o
- $(CXX) $(CXXFLAGS) -o tFile tFile.o $(IOLIBS)
-
-tiomisc: tiomisc.o
- $(CXX) $(CXXFLAGS) -o tiomisc tiomisc.o $(IOLIBS)
-
-hounddog: hounddog.o
- $(CXX) $(CXXFLAGS) -o hounddog hounddog.o $(IOLIBS)
-
-check-hounddog: hounddog
- ./hounddog <$(srcdir)/hounddog.inp > hounddog.out 2>&1
- diff -c hounddog.out $(srcdir)/hounddog.exp
- ./hounddog -b0 <$(srcdir)/hounddog.inp > hound-b0.out 2>&1
- diff -c hound-b0.out $(srcdir)/hounddog.exp
- ./hounddog -b2 <$(srcdir)/hounddog.inp > hound-b2.out 2>&1
- diff -c hound-b2.out $(srcdir)/hounddog.exp
-
-putbackdog: putbackdog.o
- $(CXX) $(CXXFLAGS) -o putbackdog putbackdog.o $(IOLIBS)
-
-check-putbackdog-regular: putbackdog
- ./putbackdog <$(srcdir)/hounddog.inp > putback.out 2>&1
- diff -c putback.out $(srcdir)/hounddog.exp
-check-putbackdog-nobuf: putbackdog
- ./putbackdog -b0 <$(srcdir)/hounddog.inp > putback-b0.out 2>&1
- diff -c putback-b0.out $(srcdir)/hounddog.exp
-check-putbackdog-buf2: putbackdog
- ./putbackdog -b2 <$(srcdir)/hounddog.inp > putback-b2.out 2>&1
- diff -c putback-b2.out $(srcdir)/hounddog.exp
-check-putbackdog: \
- check-putbackdog-regular check-putbackdog-nobuf check-putbackdog-buf2
-
-tfseek: tfseek.o
- $(CC) $(CFLAGS) -o tfseek tfseek.o $(STDIOLIBS)
-
-check-tfseek: tfseek
- ./tfseek SEEK_SET fopen > tfseek-set-fopen.out 2>&1
- diff -c tfseek-set-fopen.out $(srcdir)/tfseek-set.exp
- ./tfseek SEEK_SET freopen > tfseek-set-freopen.out 2>&1
- diff -c tfseek-set-freopen.out $(srcdir)/tfseek-set.exp
- ./tfseek SEEK_CUR fopen > tfseek-cur-fopen.out 2>&1
- diff -c tfseek-cur-fopen.out $(srcdir)/tfseek-cur.exp
- ./tfseek SEEK_CUR freopen > tfseek-cur-freopen.out 2>&1
- diff -c tfseek-cur-freopen.out $(srcdir)/tfseek-cur.exp
-
-twrseek: twrseek.o
- $(CC) $(CFLAGS) -o twrseek twrseek.o $(STDIOLIBS)
-
-check-twrseek: twrseek
- ./twrseek > twrseek.out 2>&1
- diff -c twrseek.out $(srcdir)/twrseek.exp
-
-trdseek: trdseek.o
- $(CC) $(CFLAGS) -o trdseek -v trdseek.o $(STDIOLIBS)
-
-check-trdseek: trdseek
- ./trdseek
-
-check-tFile-regular: tFile
- ./tFile < $(srcdir)/tFile.inp > tFile.out 2>&1
- diff -c tFile.out $(srcdir)/tFile.exp
-# Run tFile with cout.rdbuf() unbuffered.
-check-tFile-nobuf: tFile
- ./tFile -b0 < $(srcdir)/tFile.inp > tFile-buf0.out 2>&1
- diff -c tFile-buf0.out $(srcdir)/tFile.exp
-# Run tFile with a 3-byte buffer for cout.rdbuf().
-check-tFile-buf3: tFile
- ./tFile -b3 < $(srcdir)/tFile.inp > tFile-buf3.out 2>&1
- diff -c tFile-buf3.out $(srcdir)/tFile.exp
-check-tFile: check-tFile-regular check-tFile-nobuf check-tFile-buf3
-
-check-tiomisc: tiomisc
- ./tiomisc >tiomisc.out 2>&1
- diff -c tiomisc.out $(srcdir)/tiomisc.exp
-
-tiomanip: tiomanip.o
- $(CXX) $(CXXFLAGS) -o tiomanip tiomanip.o $(IOLIBS)
-check-tiomanip: tiomanip
- ./tiomanip >tiomanip.out 2>&1
- diff -c tiomanip.out $(srcdir)/tiomanip.exp
-
-tfformat: $(srcdir)/tfformat.c
- $(CC) $(C_FLAGS) -DTEST_LIBIO -DTEST_EXACTNESS \
- -o tfformat $(srcdir)/tfformat.c $(IOSTDIOLIB)
-
-check-tfformat: tfformat
- ./tfformat
-
-tiformat: $(srcdir)/tiformat.c
- $(CC) $(C_FLAGS) -DTEST_LIBIO -o tiformat $(srcdir)/tiformat.c $(IOSTDIOLIB)
-
-check-tiformat: tiformat
- ./tiformat
-
-tstdiomisc: tstdiomisc.o
- $(CC) $(CFLAGS) -o tstdiomisc tstdiomisc.o $(IOSTDIOLIB)
-
-check-tstdiomisc: tstdiomisc
- ./tstdiomisc >tstdiomisc.out 2>&1
- diff -c tstdiomisc.out $(srcdir)/tstdiomisc.exp
-
-tpopen: tpopen.o
- $(CC) $(CFLAGS) -o tpopen tpopen.o $(STDIOLIBS)
-
-check-tpopen: tpopen
- ./tpopen > tpopen.out 2>&1
- diff -c tpopen.out $(srcdir)/tpopen.exp
-
-trwseek: trwseek.o
- $(CC) $(CFLAGS) -o trwseek trwseek.o $(STDIOLIBS)
-
-check-trwseek: trwseek
- ./trwsseek TMP r+ k w o
-
-foo: foo.o
- $(CXX) $(CXXFLAGS) -o foo foo.o $(STDIOLIBS)
-foo+: foo+.o
- $(CXX) $(CXXFLAGS) -o foo+ foo+.o $(IOLIBS)
diff --git a/contrib/libio/tests/configure.in b/contrib/libio/tests/configure.in
deleted file mode 100644
index 46deefbc8c95..000000000000
--- a/contrib/libio/tests/configure.in
+++ /dev/null
@@ -1,36 +0,0 @@
-# This file is a shell script fragment that supplies the information
-# necessary for a configure script to process the program in
-# this directory. For more information, look at ../../configure.
-
-configdirs=
-srctrigger=tFile.cc
-srcname="test C++ input/output library"
-package_makefile_frag=Make.pack
-package_makefile_rules_frag=Make.pack.r
-
-# per-host:
-
-# per-target:
-
-TO_TOPDIR=../../
-ALL=' '
-XCINCLUDES='-I. -I.. -I$(srcdir) -I$(srcdir)/..'
-XCXXINCLUDES='-I. -I.. -I$(srcdir) -I$(srcdir)/..'
-MOSTLYCLEAN='*.o core $(JUNK_TO_CLEAN)'
-(. ${srcdir}/../config.shared) >${package_makefile_frag} 2>${package_makefile_rules_frag}
-
-if [ "${srcdir}" = "." ] ; then
- if [ "${with_target_subdir}" != "." ] ; then
- topsrcdir=${with_multisrctop}../../..
- else
- topsrcdir=${with_multisrctop}../..
- fi
-else
- topsrcdir=${srcdir}/../..
-fi
-
-if [ ! -d ${topsrcdir}/gcc ] ; then
- echo "CHECK = check-iostream check-iostdio" >>${package_makefile_frag}
-fi
-
-# post-target:
diff --git a/contrib/libio/tests/hounddog.cc b/contrib/libio/tests/hounddog.cc
deleted file mode 100644
index 29a923836476..000000000000
--- a/contrib/libio/tests/hounddog.cc
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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 <iostream.h>
-#include <stdlib.h>
-#include <string.h>
-
-// Read either "dog", "hound", or "hounddog".
-// If "dog" is found, return 1.
-// If "hound" is found, return 2.
-// If "hounddog" is found, return 3.
-// If non of these are found, return -1.
-int my_scan(streambuf* sb)
-{
- streammarker fence(sb);
- char buffer[20];
- // Try reading "hounddog":
- if (sb->sgetn(buffer, 8) == 8 && strncmp(buffer, "hounddog", 8) == 0)
- return 3;
- // No, no "hounddog": Backup to 'fence' ...
- sb->seekmark(fence);
- // ... and try reading "dog":
- if (sb->sgetn(buffer, 3) == 3 && strncmp(buffer, "dog", 3) == 0)
- return 1;
- // No, no "dog" either: Backup to 'fence' ...
- sb->seekmark(fence);
- // ... and try reading "hound":
- if (sb->sgetn(buffer, 5) == 5 && strncmp(buffer, "hound", 5) == 0)
- return 2;
- // No, no "hound" either: Backup to 'fence' and signal failure.
- sb->seekmark(fence); // Backup to 'fence'..
- return -1;
-}
-
-int main(int argc, char **argv)
-{
- streambuf *sb = cin.rdbuf();
- if (argc > 1 && strncmp(argv[1], "-b", 2) == 0) {
- streambuf *ret;
- int buffer_size = atoi(&argv[1][2]);
- if (buffer_size == 0)
- ret = sb->setbuf(NULL, 0);
- else
- ret = sb->setbuf(new char[buffer_size], buffer_size);
- if (ret != sb)
- cerr << "Warning: cin.rdbuf()->setbuf failed!\n";
- }
- for (;;) {
- int code = my_scan(sb);
- int ch = sb->sbumpc();
- if (code == -1 && ch == EOF)
- break;
- int n = 0;
- while (ch != EOF && ch != '\n') {
- n++;
- ch = sb->sbumpc();
- };
- if (ch == EOF) {
- cout << "[Unexpected EOF]\n";
- break;
- }
- cout << "Code: " << code << " followed by " << n << " chars\n";
- }
-}
diff --git a/contrib/libio/tests/hounddog.exp b/contrib/libio/tests/hounddog.exp
deleted file mode 100644
index 2060807b4312..000000000000
--- a/contrib/libio/tests/hounddog.exp
+++ /dev/null
@@ -1,7 +0,0 @@
-Code: -1 followed by 6 chars
-Code: 1 followed by 3 chars
-Code: 2 followed by 0 chars
-Code: -1 followed by 3 chars
-Code: 3 followed by 4 chars
-Code: 1 followed by 0 chars
-Code: -1 followed by 3 chars
diff --git a/contrib/libio/tests/hounddog.inp b/contrib/libio/tests/hounddog.inp
deleted file mode 100644
index 370371bc2032..000000000000
--- a/contrib/libio/tests/hounddog.inp
+++ /dev/null
@@ -1,7 +0,0 @@
-hello!
-doggie
-hound
-cat
-hounddog rat
-dog
-foo
diff --git a/contrib/libio/tests/putbackdog.cc b/contrib/libio/tests/putbackdog.cc
deleted file mode 100644
index 0e1ed61f5598..000000000000
--- a/contrib/libio/tests/putbackdog.cc
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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. */
-
-// Test streambuf::sputbackc
-
-#include <iostream.h>
-#include <stdlib.h>
-#include <string.h>
-
-// Read either "dog", "hound", or "hounddog".
-// If "dog" is found, return 1.
-// If "hound" is found, return 2.
-// If "hounddog" is found, return 3.
-// If non of these are found, return -1.
-
-void unget_string(streambuf *sb, char *str, int count)
-{
- for (str += count; -- count >= 0; )
- sb->sputbackc(*--str);
-}
-
-int my_scan(streambuf* sb)
-{
- char buffer[20];
- // Try reading "hounddog":
- int count;
- count = sb->sgetn(buffer, 8);
- if (count == 8 && strncmp(buffer, "hounddog", 8) == 0)
- return 3;
- // No, no "hounddog": Backup to 'fence' ...
- unget_string(sb, buffer, count);
- // ... and try reading "dog":
- count = sb->sgetn(buffer, 3);
- if (count == 3 && strncmp(buffer, "dog", 3) == 0)
- return 1;
- // No, no "dog" either: Backup to 'fence' ...
- unget_string(sb, buffer, count);
- // ... and try reading "hound":
- count = sb->sgetn(buffer, 5);
- if (count == 5 && strncmp(buffer, "hound", 5) == 0)
- return 2;
- // No, no "hound" either: Backup to 'fence' and signal failure.
- unget_string(sb, buffer, count);
- return -1;
-}
-
-int main(int argc, char **argv)
-{
- streambuf *sb = cin.rdbuf();
- if (argc > 1 && strncmp(argv[1], "-b", 2) == 0) {
- streambuf *ret;
- int buffer_size = atoi(&argv[1][2]);
- if (buffer_size == 0)
- ret = sb->setbuf(NULL, 0);
- else
- ret = sb->setbuf(new char[buffer_size], buffer_size);
- if (ret != sb)
- cerr << "Warning: cin.rdbuf()->setbuf failed!\n";
- }
- for (;;) {
- int code = my_scan(sb);
- int ch = sb->sbumpc();
- if (code == -1 && ch == EOF)
- break;
- int n = 0;
- while (ch != EOF && ch != '\n') {
- n++;
- ch = sb->sbumpc();
- };
- if (ch == EOF) {
- cout << "[Unexpected EOF]\n";
- break;
- }
- cout << "Code: " << code << " followed by " << n << " chars\n";
- }
-}
diff --git a/contrib/libio/tests/tFile.cc b/contrib/libio/tests/tFile.cc
deleted file mode 100644
index 42090ff83a30..000000000000
--- a/contrib/libio/tests/tFile.cc
+++ /dev/null
@@ -1,558 +0,0 @@
-/*
-Copyright (C) 1993 Free Software Foundation
-
-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. */
-
-// This may look like C code, but it is really -*- C++ -*-
-
-/*
- * a few tests for streams
- *
- */
-
-#include <stream.h>
-#include <fstream.h>
-#ifndef _OLD_STREAMS
-#include <strstream.h>
-#include "unistd.h"
-#endif
-#include <SFile.h>
-#include <PlotFile.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-
-const char *tempfile;
-
-class record
-{
-public:
- char c; int i; double d;
-};
-
-ostream& operator<<(ostream& s, record& r)
-{
- return(s << "(i = " << r.i << " c = " << r.c << " d = " << r.d << ")");
-}
-
-void t1()
-{
- char ch;
-
- assert(cout.good());
- assert(cout.writable());
- assert(cout.is_open());
- cout << "Hello, world via cout\n";
- assert(cerr.good());
- assert(cerr.writable());
- assert(cerr.is_open());
- cerr << "Hello, world via cerr\n";
-
- assert(cin.good());
- assert(cin.readable());
- assert(cin.is_open());
-
- cout << "enter a char:"; cin >> ch;
- cout.put('c'); cout.put(' '); cout.put('='); cout.put(' ');
- cout.put('"'); cout.put(ch); cout << '"'; cout << char('\n');
- assert(cin.good());
- assert(cout.good());
-}
-
-void t2()
-{
- int i;
- short h;
- long l;
- float f;
- double d;
- char s[100];
-
- cout << "enter three integers (short, int, long):";
- cin >> h; cin >> i;
- // cin.scan("%ld", &l);
- cin >> l;
- cout << "first = " << h << " via dec = " << dec(h, 8) << "\n";
- cout << "second = " << i << form(" via form = %d = 0%o", i, i);
- cout.form(" via cout.form = %d = 0x%x\n", i, i);
- cout << "third = " << l << " via hex = " << hex(l) << "\n";
- assert(cin.good());
- assert(cout.good());
-
- cout << "enter a float then a double:"; cin >> f; cin >> d;
- cout << "first = " << f << "\n";
- cout << "second = " << d << "\n";
- assert(cin.good());
- assert(cout.good());
-
- cout << "enter 5 characters separated with spaces:"; cin >> s;
- cout << "first = " << s << "\n";
- cin.get(s, 100);
- cout << "rest = " << s << "\n";
-
- assert(cin.good());
-
- cin.width(10);
- cin >> s;
- cin.clear();
- cout << "A 10-character buffer: " << s << endl;
-
- assert(cout.good());
-
-}
-
-void t3()
-{
- char ch;
- cout << "\nMaking streams sout and sin...";
-#ifdef _OLD_STREAMS
- ostream sout("streamfile", io_writeonly, a_create);
-#else
- ofstream sout("streamfile");
-#endif
- assert(sout.good());
- assert(sout.is_open());
- assert(sout.writable());
- assert(!sout.readable());
- sout << "This file has one line testing output streams.\n";
- sout.close();
- assert(!sout.is_open());
-#ifdef _OLD_STREAMS
- istream sin("streamfile", io_readonly, a_useonly);
-#else
- ifstream sin("streamfile");
-#endif
- assert(sin.good());
- assert(sin.is_open());
- assert(!sin.writable());
- assert(sin.readable());
- cout << "contents of file:\n";
- while(sin >> ch) cout << ch;
- sin.close();
- assert(!sin.is_open());
-}
-
-
-void t4()
-{
- char s[100];
- char ch;
- int i;
-
- cout << "\nMaking File tf ... ";
-#ifdef _OLD_STREAMS
- File tf(tempfile, io_readwrite, a_create);
-#else
- fstream tf(tempfile, ios::in|ios::out|ios::trunc);
-#endif
- assert(tf.good());
- assert(tf.is_open());
- assert(tf.writable());
- assert(tf.readable());
- strcpy(s, "This is the first and only line of this file.\n");
-#ifdef _OLD_STREAMS
- tf.put(s);
- tf.seek(0);
-#else
- tf << s;
- tf.rdbuf()->seekoff(0, ios::beg);
-#endif
- tf.get(s, 100);
- assert(tf.good());
- cout << "first line of file:\n" << s << "\n";
- cout << "next char = ";
- tf.get(ch);
- cout << (int)ch;
- cout.put('\n');
- assert(ch == 10);
- strcpy(s, "Now there is a second line.\n");
- cout << "reopening tempfile, appending: " << s;
-#ifdef _OLD_STREAMS
- tf.open(tf.name(), io_appendonly, a_use);
-#else
- tf.close();
- tf.open(tempfile, ios::app);
-#endif
- assert(tf.good());
- assert(tf.is_open());
- assert(tf.writable());
- assert(!tf.readable());
-#ifdef _OLD_STREAMS
- tf.put(s);
- assert(tf.good());
- tf.open(tf.name(), io_readonly, a_use);
-#else
- tf << s;
- assert(tf.good());
- tf.close();
- tf.open(tempfile, ios::in);
-#endif
- tf.raw();
- assert(tf.good());
- assert(tf.is_open());
- assert(!tf.writable());
- assert(tf.readable());
- cout << "First 10 chars via raw system read after reopen for input:\n";
- read(tf.filedesc(), s, 10);
- assert(tf.good());
- for (i = 0; i < 10; ++ i)
- cout.put(s[i]);
- lseek(tf.filedesc(), 5, 0);
- cout << "\nContents after raw lseek to pos 5:\n";
- while ( (tf.get(ch)) && (cout.put(ch)) );
-#ifdef _OLD_STREAMS
- tf.remove();
-#else
- tf.close();
- unlink((char*)tempfile);
-#endif
- assert(!tf.is_open());
-}
-
-void t5()
-{
- record r;
- int i;
- cout << "\nMaking SFile rf...";
-#ifdef _OLD_STREAMS
- SFile rf("recfile", sizeof(record), io_readwrite, a_create);
-#else
- SFile rf("recfile", sizeof(record), ios::in|ios::out|ios::trunc);
-#endif
- assert(rf.good());
- assert(rf.is_open());
- assert(rf.writable());
- assert(rf.readable());
- for (i = 0; i < 10; ++i)
- {
- r.c = i + 'a';
- r.i = i;
- r.d = (double)(i) / 1000.0;
- rf.put(&r);
- }
- assert(rf.good());
- cout << "odd elements of file in reverse order:\n";
- for (i = 9; i >= 0; i -= 2)
- {
- rf[i].get(&r);
- assert(r.c == i + 'a');
- assert(r.i == i);
- cout << r << "\n";
- }
- assert(rf.good());
-#ifdef _OLD_STREAMS
- rf.remove();
-#else
- rf.close();
- unlink("recfile");
-#endif
- assert(!rf.is_open());
-}
-
-void t6()
-{
- cout << "\nMaking PlotFile pf ...";
- static const char plot_name[] = "plot.out";
- PlotFile pf(plot_name);
- assert(pf.good());
- assert(pf.is_open());
- assert(pf.writable());
- assert(!pf.readable());
- pf.move(10,10);
- pf.label("Test");
- pf.circle(300,300,200);
- pf.line(100, 100, 500, 500);
- assert(pf.good());
-#ifdef _OLD_STREAMS
- cout << "(You may delete or attempt to plot " << pf.name() << ")\n";
-#else
- cout << "(You may delete or attempt to plot " << plot_name << ")\n";
-#endif
-}
-
-void t7()
-{
- char ch;
- static char t7_line1[] = "This is a string-based stream.\n";
- static char t7_line2[] = "With two lines.\n";
- char mybuf[60];
- char *bufp;
-#ifdef _OLD_STREAMS
- cout << "creating string-based ostream...\n";
- ostream strout(60, mybuf);
-#else
- cout << "creating ostrstream...\n";
- ostrstream strout(mybuf, 60);
-#endif
- assert(strout.good());
- assert(strout.writable());
- strout << t7_line1 << t7_line2 << ends;
- assert(strout.good());
- cout << "with contents:\n";
- bufp = strout.str();
- assert(bufp == mybuf);
- strout.rdbuf()->freeze(0); /* Should be a no-op */
- cout << mybuf;
-#ifdef _OLD_STREAMS
- cout << "using it to create string-based istream...\n";
- istream strin(strlen(mybuf), mybuf);
-#else
- cout << "using it to create istrstream...\n";
- istrstream strin(mybuf, strlen(mybuf));
-#endif
- assert(strin.good());
- assert(strin.readable());
- cout << "with contents:\n";
-#ifndef _OLD_STREAMS
- char line[100];
- strin.getline(line, 100);
- int line1_len = strlen(t7_line1);
- assert(strin.tellg() == line1_len);
- int line_len = strin.gcount();
- assert(line_len == line1_len);
- cout.write(line, line1_len - 1);
- cout << endl;
-#endif
- while (strin.get(ch)) cout.put(ch);
-
- strstream str1;
- strstream str2;
- str1 << "Testing string-based stream using strstream.\n";
- str1.seekg(0);
- for (;;) {
- int i = str1.get();
- if (i == EOF)
- break;
- str2 << (char)i;
- }
- str2 << ends;
- cout << str2.str();
-
- // This should make it overflow.
- strout << t7_line1;
- assert (strout.bad());
-}
-
-void t8()
-{
-#ifdef _OLD_STREAMS
- cout << "\nThe following file open should generate error message:";
- cout.flush();
- File ef("shouldnotexist", io_readonly, a_useonly);
-#else
- ifstream ef("shouldnotexist");
-#endif
- assert(!ef.good());
- assert(!ef.is_open());
-}
-
-void t9()
-{
- char ch;
- static char ffile_name[] = "ftmp";
- {
- cout << "\nMaking filebuf streams fout and fin...";
- filebuf foutbuf;
-#ifdef _OLD_STREAMS
- foutbuf.open(ffile_name, output);
-#else
- foutbuf.open(ffile_name, ios::out);
-#endif
- ostream fout(&foutbuf);
- assert(fout.good());
- assert(fout.is_open());
- assert(fout.writable());
- assert(!fout.readable());
- fout << "This file has one line testing output streams.\n";
-#ifdef _OLD_STREAMS
- fout.close();
- assert(!fout.is_open());
-#endif
- }
- filebuf finbuf;
-#ifdef _OLD_STREAMS
- finbuf.open(ffile_name, input);
-#else
- finbuf.open(ffile_name, ios::in);
-#endif
- istream fin(&finbuf);
- assert(fin.good());
- assert(fin.is_open());
- assert(!fin.writable());
- assert(fin.readable());
- cout << "contents of file:\n";
- while(fin >> ch) cout << ch;
-#ifndef _OLD_STREAMS
- cout << '\n';
-#endif
- fin.close();
- assert(!fin.is_open());
-}
-
-void t10()
-{
- int fileCnt = 3;
- char *file_name_pattern = "ftmp%d";
- char current_file_name[50];
- ifstream inFile;
- ofstream outFile;
- char c;
- int i;
-
- cout << '\n';
-
- // Write some files.
- for (i=0; i < fileCnt; i++) {
- sprintf(current_file_name, file_name_pattern, i);
- outFile.open(current_file_name, ios::out);
-
- if ( outFile.fail() )
- cerr << "File " << current_file_name
- << " can't be opened for output" << endl;
- else {
- outFile << "This is line 1 of " << current_file_name << '\n';
- outFile << "This is line 2 of " << current_file_name << endl;
- outFile.close();
- }
- }
-
- // Now read the files back in, and write then out to cout.
- for (i=0; i < fileCnt; i++) {
- sprintf(current_file_name, file_name_pattern, i);
- inFile.open(current_file_name, ios::in);
-
-
- if ( inFile.fail() )
- cerr << "File " << current_file_name
- << " can't be opened for input" << endl;
- else {
- while ( inFile.get (c))
- cout << c;
- cout << endl;
- inFile.close();
- }
- }
-}
-
-// Test form
-
-void t11()
-{
- int count1, count2;
- cout.form("%.2f+%.2f = %4.3e\n%n", 5.5, 6.25, 5.5+6.25, &count1);
- char *text = "Previous line has12345";
- char text_length_to_use = strlen(text) - 5;
- count2 = cout.rdbuf()->form("%-*.*s%3g characters\n",
- text_length_to_use + 1,
- text_length_to_use,
- text,
- (double)(count1-1));
- cout.form("%-*.*s%+d characters\n%n",
- text_length_to_use + 1, text_length_to_use, text,
- count2-1, &count1);
- assert(count1 == 33);
-}
-
-static void
-show_int (long val)
-{
- cout.setf(ios::showbase);
- cout << dec; cout.width (8); cout << val << "(dec) = ";
- cout << hex; cout.width (8); cout << (0xFFFF & val) << "(hex) = ";
- cout << oct; cout.width (8);
- cout << (0xFFFF & val) << "(oct) [showbase on]\n";
- cout.unsetf(ios::showbase);
- cout << dec; cout.width (8); cout << val << "(dec) = ";
- cout << hex; cout.width (8); cout << (0xFFFF & val) << "(hex) = ";
- cout << oct; cout.width (8);
- cout << (0xFFFF & val) << "(oct) [showbase off]\n";
-}
-
-void
-t12 ()
-{
- ios::fmtflags old_flags = cout.setf(ios::showpos);
- int fill = cout.fill('_');
- cout.unsetf(ios::uppercase);
- cout.setf(ios::internal, ios::adjustfield);
- show_int(34567);
- show_int(-34567);
- cout.setf(ios::right, ios::adjustfield);
- show_int(0);
- cout.setf(ios::uppercase);
- cout.unsetf(ios::showpos);
- show_int(34567);
- cout.setf(ios::left, ios::adjustfield);
- show_int(-34567);
- cout.fill(fill);
- show_int(0);
- cout.setf(old_flags,
- ios::adjustfield|ios::basefield
- |ios::showbase|ios::showpos|ios::uppercase);
-}
-
-main(int argc, char **argv)
-{
- char temp [1024] = "tempfile";
-
- if (argc > 1 && strncmp(argv[1], "-b", 2) == 0) {
- streambuf *sb = cout.rdbuf();
- streambuf *ret;
- int buffer_size = atoi(&argv[1][2]);
- if (buffer_size == 0)
- ret = sb->setbuf(NULL, 0);
- else
- ret = sb->setbuf(new char[buffer_size], buffer_size);
- if (ret != sb)
- cerr << "Warning: cout.rdbuf()->setbuf failed!\n";
-
- strncpy (&temp [8], &argv[1][2], 1000);
- temp [1008] = '\0';
- }
- tempfile = temp;
- t1();
- t2();
- t3();
- t4();
- t5();
- t6();
- t7();
- t9();
- t8();
- t10();
- t11();
- t12();
-
- cout << "Final names & states:\n";
-#ifdef _OLD_STREAMS
- cout << "cin: " << cin.name() << "\t" << cin.rdstate() << "\n";
- cout << "cout: " << cout.name() << "\t" << cout.rdstate() << "\n";
- cout << "cerr: " << cerr.name() << "\t" << cerr.rdstate() << "\n";
-#else
- cout << "cin: " << "(stdin)" << "\t" << cin.rdstate() << "\n";
- cout << "cout: " << "(stdout)" << "\t" << cout.rdstate() << "\n";
- cout << "cerr: " << "(stderr)" << "\t" << cerr.rdstate() << "\n";
-#endif
- cout << "\nend of test.\n";
-}
diff --git a/contrib/libio/tests/tFile.exp b/contrib/libio/tests/tFile.exp
deleted file mode 100644
index 154cd24dc0bb..000000000000
--- a/contrib/libio/tests/tFile.exp
+++ /dev/null
@@ -1,75 +0,0 @@
-Hello, world via cout
-Hello, world via cerr
-enter a char:c = "a"
-enter three integers (short, int, long):first = 123 via dec = 123
-second = 4567 via form = 4567 = 010727 via cout.form = 4567 = 0x11d7
-third = 89012 via hex = 15bb4
-enter a float then a double:first = 123.456
-second = -0.012
-enter 5 characters separated with spaces:first = 1
-rest = 2 3 4 5
-A 10-character buffer: abcdefghi
-
-Making streams sout and sin...contents of file:
-Thisfilehasonelinetestingoutputstreams.
-Making File tf ... first line of file:
-This is the first and only line of this file.
-next char = 10
-reopening tempfile, appending: Now there is a second line.
-First 10 chars via raw system read after reopen for input:
-This is th
-Contents after raw lseek to pos 5:
-is the first and only line of this file.
-Now there is a second line.
-
-Making SFile rf...odd elements of file in reverse order:
-(i = 9 c = j d = 0.009)
-(i = 7 c = h d = 0.007)
-(i = 5 c = f d = 0.005)
-(i = 3 c = d d = 0.003)
-(i = 1 c = b d = 0.001)
-
-Making PlotFile pf ...(You may delete or attempt to plot plot.out)
-creating ostrstream...
-with contents:
-This is a string-based stream.
-With two lines.
-using it to create istrstream...
-with contents:
-This is a string-based stream.
-With two lines.
-Testing string-based stream using strstream.
-
-Making filebuf streams fout and fin...contents of file:
-Thisfilehasonelinetestingoutputstreams.
-
-This is line 1 of ftmp0
-This is line 2 of ftmp0
-
-This is line 1 of ftmp1
-This is line 2 of ftmp1
-
-This is line 1 of ftmp2
-This is line 2 of ftmp2
-
-5.50+6.25 = 1.175e+01
-Previous line has 21 characters
-Previous line has +32 characters
-+__34567(dec) = 0x__8707(hex) = _0103407(oct) [showbase on]
-+__34567(dec) = ____8707(hex) = __103407(oct) [showbase off]
--__34567(dec) = 0x__78f9(hex) = __074371(oct) [showbase on]
--__34567(dec) = ____78f9(hex) = ___74371(oct) [showbase off]
-______+0(dec) = _____0x0(hex) = _______0(oct) [showbase on]
-______+0(dec) = _______0(hex) = _______0(oct) [showbase off]
-___34567(dec) = __0X8707(hex) = _0103407(oct) [showbase on]
-___34567(dec) = ____8707(hex) = __103407(oct) [showbase off]
--34567__(dec) = 0X78F9__(hex) = 074371__(oct) [showbase on]
--34567__(dec) = 78F9____(hex) = 74371___(oct) [showbase off]
-0 (dec) = 0X0 (hex) = 0 (oct) [showbase on]
-0 (dec) = 0 (hex) = 0 (oct) [showbase off]
-Final names & states:
-cin: (stdin) 0
-cout: (stdout) 0
-cerr: (stderr) 0
-
-end of test.
diff --git a/contrib/libio/tests/tFile.inp b/contrib/libio/tests/tFile.inp
deleted file mode 100644
index 5b821ef072be..000000000000
--- a/contrib/libio/tests/tFile.inp
+++ /dev/null
@@ -1,5 +0,0 @@
-a
-123 4567 89012
-123.456 -1.2e-2
-1 2 3 4 5
-abcdefghijklmnop
diff --git a/contrib/libio/tests/tfformat.c b/contrib/libio/tests/tfformat.c
deleted file mode 100644
index 29bac8b6b792..000000000000
--- a/contrib/libio/tests/tfformat.c
+++ /dev/null
@@ -1,4181 +0,0 @@
-#ifdef TEST_LIBIO
-#include <iostdio.h>
-#else
-#ifdef __cplusplus
-#include <strstream.h>
-#else
-#include <stdio.h>
-#endif
-#endif /* !TEST_LIBIO */
-
-/* Tests taken from Cygnus C library. */
-
-typedef struct
-{
- int line;
- double value;
- char *result;
- char *format_string;
-} sprint_double_type;
-
-sprint_double_type sprint_doubles[] =
-{
-__LINE__, 30.3, "< +30.3>", "<%+15.10g>",
-__LINE__, 10.0, "<10.00>", "<%5.2f>",
-
-__LINE__, 1.002121970718271e+05, "100212.19707 ", "%0-15.5f",
-__LINE__, -1.002121970718271e+05, "-100212.19707 ", "%0-15.5f",
-__LINE__, 1.002121970718271e+05, "000100212.19707", "%015.5f",
-__LINE__, -1.002121970718271e+05, "-00100212.19707", "%015.5f",
-__LINE__, 1.002121970718271e+05, "+00100212.19707", "%+015.5f",
-__LINE__, -1.002121970718271e+05, "-00100212.19707", "%+015.5f",
-__LINE__, 1.002121970718271e+05, " 00100212.19707", "% 015.5f",
-__LINE__, -1.002121970718271e+05, "-00100212.19707", "% 015.5f",
-__LINE__, 1.002121970718271e+05, "+100212.19707 ", "%+-15.5f",
-__LINE__, -1.002121970718271e+05, "-100212.19707 ", "%+-15.5f",
-
-__LINE__, -1.002121970718271e+29, "-1.0E+29", "%.1E",
-__LINE__, -1.002126048612756e-02, "-1.002126E-02", "%+#E",
-__LINE__, -1.002653755271637e+00, "-1.00265", "%G",
-__LINE__, -1.003238744365917e-23, "-0.00", "%4.2f",
-__LINE__, -1.005084840877781e-29, " -0", "%4.f",
-__LINE__, -1.005362549674427e+01, "-10.0536", "%#g",
-__LINE__, -1.005915042991691e-17, "-1.00592E-17", "%G",
-__LINE__, -1.007829874228503e-18, "-1.00783e-18", "%.7g",
-__LINE__, -1.007829874228503e-18, "-1.007830e-18", "%#.7g",
-__LINE__, -1.009390937771849e+15, "-1009390937771848.628657", "%+f",
-__LINE__, -1.010679382726182e-29, "-0.0000000", "%.7f",
-__LINE__, -1.010691853346650e+13, "-10106918533466.497934", "%+f",
-__LINE__, -1.013412912122286e-22, "-1.01E-22", "%.2E",
-__LINE__, -1.019269582113858e-25, " -0", "%4.0f",
-__LINE__, -1.019886033368556e+24, "-1.019886E+24", "%+.7G",
-__LINE__, -1.021037413548719e+02, "-102.103741", "%f",
-__LINE__, -1.023833576089065e+26, "-1.023834E+26", "%+E",
-__LINE__, -1.024736652408627e+10, "-10247366524.086265", "%+f",
-__LINE__, -1.025439198495476e+09, "-1.02544e+09", "%+g",
-__LINE__, -1.027080247585776e-04, "-0.0001027", "%6.7f",
-__LINE__, -1.028096307262016e+18, "-1.0281E+18", "%3G",
-__LINE__, -1.029604290697901e-02, "-0.010296", "%g",
-__LINE__, -1.034347730570491e+16, "-10343477305704908.975059", "%+f",
-__LINE__, -1.034663325049286e+22, "-1.0E+22", "%#.1E",
-__LINE__, -1.034843152721857e-14, " -0", "%6.f",
-__LINE__, -1.036082122299529e-29, "-1.04e-29", "%4.3g",
-__LINE__, -1.037213662365954e-09, "-1e-09", "%3.e",
-__LINE__, -1.038563976775690e-12, "-0.000000", "%f",
-__LINE__, -1.040910158681323e-02, "-0.0104091", "%+G",
-__LINE__, -1.044680094714482e-20, "-1.04468E-20", "%G",
-__LINE__, -1.044990054091126e+24, "-1.044990E+24", "%+E",
-__LINE__, -1.045693871096982e+11, "-1.045694e+11", "%+e",
-__LINE__, -1.045714133591312e-04, "-0.000104571", "%+#3g",
-__LINE__, -1.046215079103016e-15, "-1.04622e-15", "%g",
-__LINE__, -1.046285293993789e-18, "-1.04629E-18", "%+4G",
-__LINE__, -1.046306092899333e-06, "-0.00", "%0.2f",
-__LINE__, -1.047308973649206e-22, "-1.05E-22", "%+1.3G",
-__LINE__, -1.047369032507755e+01, "-1.047369E+01", "%E",
-__LINE__, -1.048986365562919e-21, "-1.05E-21", "%+.2E",
-__LINE__, -1.049530193156793e-17, "-1.04953E-17", "%+G",
-__LINE__, -1.050073419263768e+25, "-1.05007e+25", "%g",
-__LINE__, -1.051739652002504e-28, "-0.000000", "%+f",
-__LINE__, -1.054493420082636e+21, "-1.0545e+21", "%#5.4e",
-__LINE__, -1.055867291029098e+18, "-1.05587e+18", "%g",
-__LINE__, -1.056514389757866e-16, "-1.05651E-16", "%5.6G",
-__LINE__, -1.057180924868704e+15, "-1057180924868704", "%4.f",
-__LINE__, -1.058455468395683e-23, "-1.05846e-23", "%g",
-__LINE__, -1.062560982393212e+08, "-1.06256e+08", "%g",
-__LINE__, -1.063365829241138e-10, "-1.063366e-10", "%+e",
-__LINE__, -1.063568908667280e-19, "-1.06357E-19", "%+G",
-__LINE__, -1.063734263253492e-13, "-0.000000", "%0f",
-__LINE__, -1.064472689765495e-13, "-1E-13", "%4.0G",
-__LINE__, -1.067192610000129e-25, "-1.06719E-25", "%G",
-__LINE__, -1.068401334996592e-12, "-0.0000000", "%+.7f",
-__LINE__, -1.069012628653724e-13, "-1.069013E-13", "%+.7G",
-__LINE__, -1.069451976810790e+16, "-10694519768107904.056365", "%f",
-__LINE__, -1.069568935323556e+17, "-1.06957e+17", "%g",
-__LINE__, -1.071351044854107e-29, "-1.07135e-29", "%g",
-__LINE__, -1.072274197526185e-21, "-1E-21", "%1.G",
-__LINE__, -1.073875921752995e+23, "-1E+23", "%5.E",
-__LINE__, -1.074835151152265e-12, "-1.0748e-12", "%1.5g",
-__LINE__, -1.075171047088241e-19, "-1.07517E-19", "%#G",
-__LINE__, -1.076258826412760e+22, "-1.076259e+22", "%+e",
-__LINE__, -1.076365103160401e+06, "-1.07637E+06", "%+4.6G",
-__LINE__, -1.076817750454633e+08, "-1e+08", "%4.g",
-__LINE__, -1.078615405755685e-30, "-1e-30", "%4.g",
-__LINE__, -1.078629622917468e-25, "-1.078630e-25", "%e",
-__LINE__, -1.079352432833170e+11, "-107935243283", "%+2.f",
-__LINE__, -1.081431147440215e+16, "-10814311474402147.439378", "%+f",
-__LINE__, -1.083042116905339e-16, "-1.083e-16", "%.5g",
-__LINE__, -1.085351710708553e-10, "-1.085e-10", "%1.4g",
-__LINE__, -1.085796045618276e+07, "-1.085796e+07", "%e",
-__LINE__, -1.087398259981007e+22, "-1.0874e+22", "%g",
-__LINE__, -1.087986044402224e-11, "-1.087986e-11", "%e",
-__LINE__, -1.090451848762709e-02, "-1.090452e-02", "%e",
-__LINE__, -1.091463236899737e+11, "-1.091463E+11", "%#E",
-__LINE__, -1.091617921737384e-29, "-1.09162e-29", "%3g",
-__LINE__, -1.092049328579047e-17, "-1.092049E-17", "%E",
-__LINE__, -1.093647615472090e+06, "-1093647.61547", "%6.5f",
-__LINE__, -1.094133175602384e-08, "-1.1E-08", "%0.1E",
-__LINE__, -1.095397916728214e-23, "-1e-23", "%6.e",
-__LINE__, -1.098958790437321e+02, "-109.895879", "%+#f",
-__LINE__, -1.100194638181594e-20, "-1.100195e-20", "%e",
-__LINE__, -1.102174253534260e+05, "-1.1e+05", "%2.3g",
-__LINE__, -1.102890180316350e-12, "-1.10289e-12", "%+g",
-__LINE__, -1.105582337418378e+00, "-1.11", "%3.3g",
-__LINE__, -1.110515122647056e+04, "-1.E+04", "%#0.G",
-__LINE__, -1.111365895262625e-18, "-1e-18", "%0.g",
-__LINE__, -1.112010622677495e+04, "-11120.1", "%g",
-__LINE__, -1.112580043156699e-23, "-1.11258e-23", "%1g",
-__LINE__, -1.112829057091303e+08, "-1.11283e+08", "%+2g",
-__LINE__, -1.115019046200472e+18, "-1.1150190e+18", "%+#.7e",
-__LINE__, -1.118078332268016e-13, "-1.12E-13", "%1.3G",
-__LINE__, -1.119113571963886e+08, "-1.119114e+08", "%e",
-__LINE__, -1.120102397563448e-15, "-1.12e-15", "%.4g",
-__LINE__, -1.120707480791434e-19, "-1.12071e-19", "%g",
-__LINE__, -1.124243676139007e-07, "-0.000000", "%f",
-__LINE__, -1.125025214608798e+15, "-1.12503E+15", "%0G",
-__LINE__, -1.126074395136447e+06, "-1E+06", "%+.0G",
-__LINE__, -1.127203019940870e-06, "-0.000001", "%+#7f",
-__LINE__, -1.130577648480677e+01, "-1.130578e+01", "%e",
-__LINE__, -1.131469694425240e-11, "-1.13147e-11", "%#0.6g",
-__LINE__, -1.132225023239752e+02, "-113.223", "%G",
-__LINE__, -1.133702113050128e+20, "-1E+20", "%+3.E",
-__LINE__, -1.135529466224404e-13, "-1.13553e-13", "%#g",
-__LINE__, -1.137587210063004e+21, "-1e+21", "%.1g",
-__LINE__, -1.140765637106361e-21, "-1.1e-21", "%+.1e",
-__LINE__, -1.141182595083699e-18, "-0.000000", "%f",
-__LINE__, -1.141695709120972e+00, "-1.1417", "%3G",
-__LINE__, -1.143199141708028e+18, "-1143199141708027833", "%2.f",
-__LINE__, -1.146712902056139e+21, "-1146712902056139071760.298975", "%f",
-__LINE__, -1.146837903839073e-02, " -0.0", "%+5.1f",
-__LINE__, -1.147363016107446e+10, "-1.14736e+10", "%+7g",
-__LINE__, -1.149575523465052e+20, "-114957552346505220697.28140", "%+.5f",
-__LINE__, -1.152748955392589e+13, "-1.15275E+13", "%G",
-__LINE__, -1.152751106015483e-17, "-1E-17", "%+3.E",
-__LINE__, -1.155539139258226e-18, "-1.2e-18", "%+.2g",
-__LINE__, -1.157089280563492e+20, "-1.15709e+20", "%g",
-__LINE__, -1.161217745859779e+19, "-1.161218E+19", "%E",
-__LINE__, -1.162293536734798e+10, "-11622935367.347980", "%f",
-__LINE__, -1.162629909468603e+20, "-1.16E+20", "%.3G",
-__LINE__, -1.164979155838631e+24, "-1.16498E+24", "%G",
-__LINE__, -1.165103052644816e-20, " -1e-20", "%+7.g",
-__LINE__, -1.166448459023264e-08, "-0.000000", "%f",
-__LINE__, -1.167694506705309e+28, "-1e+28", "%.1g",
-__LINE__, -1.169901754818745e-28, "-0.000000", "%+f",
-__LINE__, -1.170330336216446e+08, " -1e+08", "%7.g",
-__LINE__, -1.170946623214213e-17, "-1.17095E-17", "%G",
-__LINE__, -1.174581596799302e+27, "-1.174582e+27", "%+e",
-__LINE__, -1.174763473995155e-28, "-1E-28", "%.1G",
-__LINE__, -1.175885640508038e-23, "-1E-23", "%+.0E",
-__LINE__, -1.177268411775439e-05, "-0.000012", "%#2.6f",
-__LINE__, -1.177739669428001e-30, "-1.17774E-30", "%G",
-__LINE__, -1.178059639880544e-02, "-0.0117806", "%+.7G",
-__LINE__, -1.178793300854446e-13, "-1.2E-13", "%+#0.2G",
-__LINE__, -1.179629345138058e-04, "-0.000118", "%0.3g",
-__LINE__, -1.180730292213358e-25, "-1.18073e-25", "%g",
-__LINE__, -1.180766261654697e+02, "-118.077", "%3g",
-__LINE__, -1.181880261069391e-29, "-1.181880e-29", "%+#e",
-__LINE__, -1.183752810063514e-09, "-1.18375e-09", "%#g",
-__LINE__, -1.184191742443406e-21, "-1.184192e-21", "%e",
-__LINE__, -1.184859760488406e-26, "-1.18486E-26", "%G",
-__LINE__, -1.187276828720072e-29, "-1.18728E-29", "%G",
-__LINE__, -1.187992907205195e-04, "-1.187993E-04", "%E",
-__LINE__, -1.190586192763405e-28, "-1.E-28", "%#1.E",
-__LINE__, -1.192104053032086e+02, "-119.21", "%G",
-__LINE__, -1.192917884333569e+26, "-1.192918E+26", "%E",
-__LINE__, -1.195900753509801e+22, "-1.1959e+22", "%g",
-__LINE__, -1.196559413116537e-28, "-0.000000", "%6.6f",
-__LINE__, -1.197534588732952e+12, "-1.19753e+12", "%#g",
-__LINE__, -1.200279514790649e-25, "-0.0000", "%0.4f",
-__LINE__, -1.203806667944635e+10, "-1.2038067E+10", "%5.7E",
-__LINE__, -1.204344885974736e+07, "-1.204E+07", "%#2.4G",
-__LINE__, -1.205668007693083e+00, "-1.20567", "%g",
-__LINE__, -1.205898515218947e-11, "-1.2059e-11", "%+g",
-__LINE__, -1.206787414909373e-05, "-1.2e-05", "%2.2g",
-__LINE__, -1.207905830366447e+15, "-1.207906e+15", "%6.7g",
-__LINE__, -1.208067010597729e-17, "-1.208067e-17", "%5e",
-__LINE__, -1.210189135822574e+01, "-12", "%+2.0f",
-__LINE__, -1.211560695948122e+10, "-1.21156e+10", "%+g",
-__LINE__, -1.214003025273234e-18, "-1.214e-18", "%+g",
-__LINE__, -1.214096815259005e+17, "-121409681525900459.142520", "%f",
-__LINE__, -1.214699041716797e-14, "-1.2147E-14", "%G",
-__LINE__, -1.215061611919443e+14, "-121506161191944.306310", "%+#f",
-__LINE__, -1.217491221065185e+27, "-1.21749e+27", "%g",
-__LINE__, -1.218538401534388e-11, "-1.218538e-11", "%#e",
-__LINE__, -1.218810085883466e+16, "-1e+16", "%+.1g",
-__LINE__, -1.219422688169801e+08, "-1.219423e+08", "%e",
-__LINE__, -1.220473194407651e-14, "-1.2205E-14", "%1.5G",
-__LINE__, -1.220824440193375e-02, "-0.012208", "%4f",
-__LINE__, -1.221520240637007e+13, "-1.221520E+13", "%1E",
-__LINE__, -1.221894719843486e+29, "-1.22189E+29", "%G",
-__LINE__, -1.223020108610281e+25, "-1.22302E+25", "%G",
-__LINE__, -1.223203206227728e-02, "-0.012232", "%G",
-__LINE__, -1.225661737076919e-15, "-1.22566E-15", "%G",
-__LINE__, -1.228147221003795e-08, "-1.22815E-08", "%G",
-__LINE__, -1.228298534591771e+20, "-1.22830E+20", "%#G",
-__LINE__, -1.228469080229780e-02, "-0.012285", "%0f",
-__LINE__, -1.229161950699222e-09, "-1e-09", "%0.e",
-__LINE__, -1.231294820136559e-17, "-1.231295E-17", "%1.7G",
-__LINE__, -1.232588663406698e-21, "-1E-21", "%+0.G",
-__LINE__, -1.233381256982191e-26, "-0.000000", "%f",
-__LINE__, -1.233435864835578e+14, "-1.23344e+14", "%#g",
-__LINE__, -1.237409567806099e-25, "-1.23741E-25", "%#G",
-__LINE__, -1.238244697758558e-02, "-1.238245e-02", "%7e",
-__LINE__, -1.239393163123284e+26, "-1.23939e+26", "%+g",
-__LINE__, -1.240484781756132e-18, "-1E-18", "%4.E",
-__LINE__, -1.241420286838750e+23, "-1E+23", "%2.E",
-__LINE__, -1.243781122052343e-18, "-1.243781e-18", "%+e",
-__LINE__, -1.244421506844779e+07, "-1.244422E+07", "%+6E",
-__LINE__, -1.245754054764741e-21, "-1e-21", "%5.0g",
-__LINE__, -1.245992228426733e-24, "-0.000000", "%f",
-__LINE__, -1.246498277739883e-12, "-0.0000000", "%5.7f",
-__LINE__, -1.247130891343776e-18, "-1.24713E-18", "%G",
-__LINE__, -1.247309461703025e-03, "-0.0012473", "%#5.5G",
-__LINE__, -1.248139162966407e-29, "-1.e-29", "%+#6.g",
-__LINE__, -1.249756153623776e+08, "-1.249756e+08", "%e",
-__LINE__, -1.250899983565585e-10, "-1.2509e-10", "%5g",
-__LINE__, -1.250957368798327e+19, "-1.25096E+19", "%0G",
-__LINE__, -1.252630814464822e-02, "-0.012526", "%+f",
-__LINE__, -1.253076368257011e-28, "-0.000000", "%f",
-__LINE__, -1.254243507039370e+01, "-1.254244e+01", "%e",
-__LINE__, -1.257605614492298e-12, "-1.257606E-12", "%6.7G",
-__LINE__, -1.258041911573120e+06, "-1258041.911573", "%+f",
-__LINE__, -1.261670983426507e-25, "-0.00", "%.2f",
-__LINE__, -1.263216883336562e-14, "-1.26322e-14", "%g",
-__LINE__, -1.266846944498751e-15, "-1e-15", "%0.g",
-__LINE__, -1.266977908502326e+06, "-1266978", "%+1.f",
-__LINE__, -1.267006162870084e-23, "-1.267006e-23", "%e",
-__LINE__, -1.269144609375931e+01, "-1.269145e+01", "%+e",
-__LINE__, -1.269458714257904e+25, "-1.26946E+25", "%G",
-__LINE__, -1.276697325772662e-02, "-0.0128", "%7.3G",
-__LINE__, -1.278855081807602e+15, "-1278855081807601.87891", "%#0.5f",
-__LINE__, -1.278966821639612e+20, "-1.278967E+20", "%3E",
-__LINE__, -1.281942705258106e+03, "-1281.94", "%+G",
-__LINE__, -1.282331291499203e+14, "-128233129149920.266343", "%+f",
-__LINE__, -1.285125739341808e-28, "-1.28513e-28", "%g",
-__LINE__, -1.285700693704978e+11, "-1.285701E+11", "%E",
-__LINE__, -1.286574096459251e+28, "-1.287E+28", "%6.4G",
-__LINE__, -1.287967889247240e+03, "-1287.97", "%G",
-__LINE__, -1.288913808801319e-27, "-1.3e-27", "%7.1e",
-__LINE__, -1.289147517760377e-18, "-1.289148E-18", "%E",
-__LINE__, -1.289355006600107e+23, "-1.28936E+23", "%+G",
-__LINE__, -1.291232014623979e+01, "-1.29123E+01", "%+.5E",
-__LINE__, -1.293658562875966e-18, "-1.29366e-18", "%+g",
-__LINE__, -1.294982911983638e-19, "-1.29498E-19", "%#G",
-__LINE__, -1.296123363481695e-13, "-1.296123E-13", "%E",
-__LINE__, -1.296632862070602e-20, "-1.29663e-20", "%+g",
-__LINE__, -1.297801639022777e+23, "-129780163902277735132884.11777", "%#0.5f",
-__LINE__, -1.297886574534611e+16, "-1.297887e+16", "%+e",
-__LINE__, -1.300588216308401e+11, "-1.30e+11", "%.2e",
-__LINE__, -1.301296100909062e-10, "-1.3013e-10", "%+g",
-__LINE__, -1.303144244306468e-07, "-1.303144E-07", "%E",
-__LINE__, -1.304096315024042e-20, "-1.3041E-20", "%+G",
-__LINE__, -1.304817970675085e+16, "-1.304818E+16", "%+E",
-__LINE__, -1.304870304632683e-15, " -1e-15", "%7.g",
-__LINE__, -1.305213586757638e-18, "-1.30521e-18", "%g",
-__LINE__, -1.306880734910465e-22, "-1.306881E-22", "%E",
-__LINE__, -1.308964092631446e-23, "-1.30896e-23", "%g",
-__LINE__, -1.312070555198201e+26, "-131207055519820126043839537", "%+7.f",
-__LINE__, -1.312511609151056e-30, "-1.312512E-30", "%#E",
-__LINE__, -1.313087359008389e-23, "-0.000000", "%+f",
-__LINE__, -1.316948423042059e-02, "-1.316948E-02", "%+E",
-__LINE__, -1.317080882577385e+29, "-1.317E+29", "%+.4G",
-__LINE__, -1.317514598984346e+24, "-1.317515e+24", "%e",
-__LINE__, -1.317817551125923e-21, "-1.31782E-21", "%+G",
-__LINE__, -1.319603985988120e+29, "-131960398598811989856471882376.354188", "%f",
-__LINE__, -1.328850458671907e+06, "-1e+06", "%.0e",
-__LINE__, -1.328945346449817e-23, "-1.328945e-23", "%+e",
-__LINE__, -1.330146584094221e-08, "-1e-08", "%+5.g",
-__LINE__, -1.332609617892115e+00, "-1.33261", "%2.7G",
-#ifndef __PCCNECV70__
-__LINE__, -1.332751724965715e+22, "-13327517249657150344432.920974", "%f",
-__LINE__, -1.333194379353273e-19, "-0.000000", "%f",
-__LINE__, -1.334304387932777e-06, "-1.334304e-06", "%e",
-__LINE__, -1.334306581172082e-05, "-1.3e-05", "%+1.2g",
-__LINE__, -1.335283510893438e-05, " -1E-05", "%7.G",
-__LINE__, -1.337939692108373e+11, "-1.33794e+11", "%+4g",
-__LINE__, -1.339117288874809e-03, "-0.001", "%1.3f",
-__LINE__, -1.340100588141492e+27, "-1.340101E+27", "%E",
-__LINE__, -1.341953272572953e-19, "-0.000000", "%+f",
-__LINE__, -1.343058354301620e-02, "-1.343058e-02", "%e",
-__LINE__, -1.346662720871543e+22, "-1.34666E+22", "%#G",
-__LINE__, -1.354010578652210e-02, "-0.0135401", "%#g",
-__LINE__, -1.354066549307666e-12, " -0", "%+6.f",
-__LINE__, -1.355284719365947e+21, "-1.35528e+21", "%g",
-__LINE__, -1.356326532145087e+29, "-1E+29", "%4.G",
-__LINE__, -1.357278618897291e+19, "-13572786188972911780.581398", "%f",
-__LINE__, -1.357537331348202e-10, "-0.000", "%+.3f",
-__LINE__, -1.360011287595868e-10, "-0.000000", "%f",
-__LINE__, -1.360506902899232e+16, "-13605069028992320.", "%#5.f",
-__LINE__, -1.361102570277000e+10, "-1.3611E+10", "%G",
-__LINE__, -1.362601255900219e+07, "-1.363E+07", "%.4G",
-__LINE__, -1.366078182354771e+10, "-1.36608E+10", "%0G",
-__LINE__, -1.366667926615127e+08, "-136666792.661513", "%f",
-__LINE__, -1.367162823743231e-12, "-0.000000", "%#f",
-__LINE__, -1.371523037550709e+09, "-1.37152e+09", "%+g",
-__LINE__, -1.374328925986197e-17, "-1.37e-17", "%.2e",
-__LINE__, -1.374995603898421e-26, "-1.375e-26", "%+g",
-__LINE__, -1.376726539375688e+09, "-1.376727E+09", "%+E",
-__LINE__, -1.378351117694958e-13, "-0.000000", "%f",
-__LINE__, -1.378514699313619e-14, "-1.378515e-14", "%e",
-__LINE__, -1.379347588942324e-23, "-1.4e-23", "%+.1e",
-__LINE__, -1.380380583822272e-17, "-0.000000", "%+f",
-__LINE__, -1.381658659947406e+19, "-1.38166e+19", "%g",
-__LINE__, -1.382775316390237e+29, "-138277531639023653298181670834.3104", "%+#7.4f",
-__LINE__, -1.383541138922400e+00, "-1.383541E+00", "%E",
-__LINE__, -1.384625301445090e+01, "-13.8", "%+.3g",
-__LINE__, -1.386844086284027e-13, "-1.38684E-13", "%+G",
-__LINE__, -1.386930516448650e-28, "-1.386931E-28", "%E",
-__LINE__, -1.387444896054260e-07, "-1.38744E-07", "%G",
-__LINE__, -1.389685107980798e+22, "-1.38969E+22", "%G",
-__LINE__, -1.390880300369347e+03, "-1390.880300", "%f",
-__LINE__, -1.391423370198150e-17, "-1E-17", "%+2.G",
-__LINE__, -1.394441767471218e-09, "-1.394442e-09", "%e",
-__LINE__, -1.396275525062527e-20, "-1.39628E-20", "%G",
-__LINE__, -1.397045957455157e+24, "-1E+24", "%.0E",
-__LINE__, -1.397458546930799e+21, "-1397458546930798526375.383517", "%f",
-__LINE__, -1.397584578988941e-14, "-1.39758e-14", "%5g",
-__LINE__, -1.397789397300823e+09, "-1.398e+09", "%.4g",
-__LINE__, -1.398167472294874e+21, "-1.398167E+21", "%+7E",
-__LINE__, -1.398809636136688e-16, "-0.000000", "%+f",
-__LINE__, -1.399545335304119e+26, "-139954533530411872277454676.805064", "%#5f",
-__LINE__, -1.400102603335755e+20, "-140010260333575509150.705329", "%2f",
-__LINE__, -1.401212746235235e+04, "-1.401213e+04", "%e",
-__LINE__, -1.404409427681801e+07, "-1E+07", "%4.E",
-__LINE__, -1.406018114263948e-25, "-1e-25", "%3.e",
-__LINE__, -1.406245608096877e-06, "-1.4e-06", "%+.1e",
-__LINE__, -1.410697254683835e-10, "-1.410697e-10", "%e",
-__LINE__, -1.410739097553846e+25, "-1.410739E+25", "%+E",
-__LINE__, -1.410850631189577e+04, "-14108.5", "%.6g",
-__LINE__, -1.411680434455781e+28, "-14116804344557807304738616949.180141", "%f",
-__LINE__, -1.413309465660099e-27, "-1.413309E-27", "%+#E",
-__LINE__, -1.418468741386300e+09, "-1418468741.386300", "%f",
-__LINE__, -1.420277110892909e+06, "-1.42028e+06", "%1g",
-__LINE__, -1.420417889565590e-17, "-1.42E-17", "%.2E",
-__LINE__, -1.421098212056305e+08, "-1.421098e+08", "%4e",
-__LINE__, -1.421792812798986e-20, " -1E-20", "%7.G",
-__LINE__, -1.423675488122461e+18, "-1423675488122461363.360571", "%f",
-__LINE__, -1.423810545840653e+15, "-1E+15", "%3.E",
-__LINE__, -1.424242673476368e-15, "-1.424243e-15", "%e",
-__LINE__, -1.427847435688733e-01, "-1.427847E-01", "%E",
-__LINE__, -1.433897734612555e-04, "-0.0001", "%3.g",
-__LINE__, -1.434537754075696e-24, "-1.435E-24", "%+0.3E",
-__LINE__, -1.434774864809324e-24, "-1E-24", "%2.E",
-__LINE__, -1.435583851565142e-11, "-1E-11", "%.0E",
-__LINE__, -1.438791024010112e+11, "-1.43879e+11", "%#.6g",
-__LINE__, -1.439267565343777e+27, "-1.4e+27", "%2.1e",
-__LINE__, -1.439440602670449e+02, "-143.944", "%G",
-__LINE__, -1.439494412124925e+13, "-14394944121249.251268", "%f",
-__LINE__, -1.440032823245152e+10, "-14400328232.451516", "%f",
-__LINE__, -1.440174494009562e-08, "-0.000000", "%7f",
-__LINE__, -1.440827804010568e+07, "-1.E+07", "%#6.1G",
-__LINE__, -1.442760907195336e+09, "-1.44276E+09", "%+5G",
-__LINE__, -1.444655304181403e+10, "-14446553041.814035", "%7f",
-__LINE__, -1.444995766787036e+04, "-14450", "%5G",
-__LINE__, -1.445078682874535e-13, "-1E-13", "%3.E",
-__LINE__, -1.446781469662328e+01, "-14.4678", "%G",
-__LINE__, -1.447795251395321e-04, "-0.000145", "%+f",
-__LINE__, -1.448193079247108e-02, "-0.014", "%4.2G",
-__LINE__, -1.449552967961345e+14, "-1E+14", "%1.E",
-__LINE__, -1.451269763513571e+10, "-14512697635.135705", "%6f",
-__LINE__, -1.451843176990292e+12, "-1e+12", "%1.g",
-__LINE__, -1.452631405935931e+06, "-1.452631e+06", "%e",
-__LINE__, -1.452753650285897e+21, "-1452753650285897091265.496783", "%5f",
-__LINE__, -1.453811512433860e-05, "-1e-05", "%+6.g",
-__LINE__, -1.454071430557372e+13, "-1.4541E+13", "%.4E",
-__LINE__, -1.455956079562999e+03, "-1455.96", "%G",
-__LINE__, -1.459712196146602e-17, "-1.45971e-17", "%g",
-__LINE__, -1.461857733495947e-02, "-1.4619E-02", "%.4E",
-__LINE__, -1.465257069090911e-11, "-1.465257E-11", "%+E",
-__LINE__, -1.465306607257042e+05, "-146531", "%g",
-__LINE__, -1.465857076315921e+20, "-1.46586E+20", "%+G",
-__LINE__, -1.467919792051489e+16, "-1.46792e+16", "%2g",
-__LINE__, -1.469271519834567e+20, "-146927151983456720785", "%+.0f",
-__LINE__, -1.472961447442697e-28, "-1.47296e-28", "%#g",
-__LINE__, -1.473385695190456e-12, "-1.473386E-12", "%E",
-__LINE__, -1.485003089033267e-10, "-1.485E-10", "%2G",
-__LINE__, -1.490541379072390e-18, "-1.490541E-18", "%4E",
-__LINE__, -1.490683434793125e+22, "-14906834347931249951102.472551", "%#f",
-__LINE__, -1.498356837215425e+20, "-1.49836E+20", "%#G",
-__LINE__, -1.498677007818122e+14, "-1.49868E+14", "%+4G",
-__LINE__, -1.502143197677119e+23, "-150214319767711934616727.", "%#7.f",
-__LINE__, -1.503563770470753e-24, "-1.50356e-24", "%.6g",
-__LINE__, -1.504643092793197e-18, "-1.504643e-18", "%+4e",
-__LINE__, -1.507017706254022e-13, "-1.50702e-13", "%+g",
-__LINE__, -1.507054033750081e-22, "-0.000000", "%f",
-__LINE__, -1.508662346022339e+16, "-1.508662E+16", "%#E",
-__LINE__, -1.509366882438902e+08, "-2e+08", "%4.g",
-__LINE__, -1.511086567087967e+20, "-1.51109e+20", "%g",
-__LINE__, -1.514959134622707e-18, "-0.000000", "%+f",
-__LINE__, -1.515730120364204e+06, "-2E+06", "%0.G",
-__LINE__, -1.516372763118606e-09, "-1.51637e-09", "%g",
-__LINE__, -1.520610443546204e+27, "-1.52061e+27", "%g",
-__LINE__, -1.522040655642012e+11, "-1.52204E+11", "%+2G",
-__LINE__, -1.523772495014966e-24, "-2E-24", "%2.G",
-__LINE__, -1.523980825983892e-05, "-0.000", "%2.3f",
-__LINE__, -1.526696214603152e-03, "-0.0015267", "%+6.5G",
-__LINE__, -1.528680540769583e+00, "-1.5287", "%0.5G",
-__LINE__, -1.529951830525433e+08, "-1.529952e+08", "%+e",
-__LINE__, -1.533052896559935e+05, "-153305", "%4.0f",
-__LINE__, -1.533829640475152e-03, "-0.00153383", "%+#g",
-__LINE__, -1.535617804643105e-30, "-1.535618e-30", "%e",
-__LINE__, -1.537623698361821e+16, "-15376236983618207.7875719", "%4.7f",
-__LINE__, -1.544994895330616e+24, "-1.54499e+24", "%g",
-__LINE__, -1.545083356728403e+17, "-1.545083e+17", "%e",
-__LINE__, -1.545684535393879e+12, "-1.55E+12", "%3.3G",
-__LINE__, -1.545878334099427e+13, "-15458783340994.268762", "%1f",
-__LINE__, -1.547697185980564e-18, "-1.5477e-18", "%.6g",
-__LINE__, -1.548576527172579e-29, "-1.5E-29", "%2.2G",
-__LINE__, -1.549712227835891e+08, "-1.549712e+08", "%#6.7g",
-__LINE__, -1.550010819435335e-21, "-1.55001E-21", "%G",
-__LINE__, -1.551412476164257e+14, "-1.551412E+14", "%E",
-__LINE__, -1.553156638090030e+01, " -2E+01", "%7.G",
-__LINE__, -1.553733233064355e-01, "-0.2", "%3.g",
-__LINE__, -1.558391111609365e+00, "-1.558391", "%+f",
-__LINE__, -1.562004019284766e+15, "-1.562E+15", "%6.5G",
-__LINE__, -1.562195733239758e-16, "-0.000000", "%f",
-__LINE__, -1.563953339012525e-14, "-1.56395E-14", "%1G",
-__LINE__, -1.568317638534983e+18, "-1.56832E+18", "%1G",
-__LINE__, -1.568546851135348e+04, "-15685.5", "%+#G",
-__LINE__, -1.574297872228857e+18, "-1.574298e+18", "%e",
-__LINE__, -1.575696460196291e-21, "-1.5757E-21", "%G",
-__LINE__, -1.576324848379791e+25, "-1.57632E+25", "%+G",
-__LINE__, -1.577524395140843e+06, "-1.5775E+06", "%.5G",
-__LINE__, -1.585122856675091e+12, "-1585122856675.091452", "%f",
-__LINE__, -1.586734674395556e-02, "-1.586735E-02", "%E",
-__LINE__, -1.592602264315192e+22, "-1.5926E+22", "%G",
-__LINE__, -1.594121556700562e+05, "-2E+05", "%+.0G",
-__LINE__, -1.598538116193430e+22, "-1.59854e+22", "%+g",
-__LINE__, -1.605647463222382e+18, "-1.6056E+18", "%.5G",
-__LINE__, -1.610891449201191e+06, "-1.6109E+06", "%#6.4E",
-__LINE__, -1.614593168166818e-05, "-1.61459E-05", "%G",
-__LINE__, -1.615597722557325e-03, "-0.001616", "%f",
-__LINE__, -1.616038022182124e-29, "-1.61604E-29", "%1G",
-__LINE__, -1.618380771451625e-28, "-2e-28", "%+1.g",
-__LINE__, -1.620287456872150e+10, "-1.620e+10", "%#7.3e",
-__LINE__, -1.620469955611903e-29, "-0.000000", "%f",
-__LINE__, -1.622580720690927e+20, "-1.622581E+20", "%+#E",
-__LINE__, -1.622752500991079e-12, "-1.622753E-12", "%E",
-__LINE__, -1.622771933776459e+08, "-1.6228E+08", "%+4.4E",
-__LINE__, -1.623894567037391e+09, "-1.623895e+09", "%#e",
-__LINE__, -1.624021408185354e-25, "-1.624E-25", "%.5G",
-__LINE__, -1.624405320939366e-06, "-1.62441e-06", "%+#g",
-__LINE__, -1.631236208958857e-25, "-1.631236e-25", "%#e",
-__LINE__, -1.632165969536046e+20, "-1.63217E+20", "%G",
-__LINE__, -1.632859596256475e+06, "-1.63286E+06", "%G",
-__LINE__, -1.634371961703112e+06, "-1.634372E+06", "%+E",
-__LINE__, -1.637230383641845e+24, "-1.63723e+24", "%#g",
-__LINE__, -1.638081480475853e+17, "-1.63808e+17", "%+g",
-__LINE__, -1.638279690467673e+14, "-163827969046767.325523", "%#f",
-__LINE__, -1.640360249548215e-29, "-1.64036e-29", "%+6.6g",
-__LINE__, -1.645691728060833e-30, "-1.64569e-30", "%g",
-__LINE__, -1.648548965852592e-03, " -0", "%5.f",
-__LINE__, -1.650100957771182e+21, "-1650100957771182308420.065965", "%+f",
-__LINE__, -1.650957176011913e-02, "-0.016510", "%#4.5G",
-__LINE__, -1.651165108095301e+29, "-165116510809530137038336761179.380119", "%f",
-__LINE__, -1.657132845094847e-06, "-0.000002", "%f",
-__LINE__, -1.657152146172541e+12, "-1.657152E+12", "%.7G",
-__LINE__, -1.658377345516132e-06, "-0.00", "%.2f",
-__LINE__, -1.658850468902324e+20, "-1.659e+20", "%.4g",
-__LINE__, -1.661723557149830e+18, "-1.66172E+18", "%G",
-__LINE__, -1.663570885140273e+14, "-166357088514027", "%2.f",
-__LINE__, -1.665186944896906e+25, "-1.66519E+25", "%G",
-__LINE__, -1.675910137717036e+22, "-2e+22", "%5.g",
-__LINE__, -1.677447987675587e-15, "-1.67745E-15", "%G",
-__LINE__, -1.677510590697220e+06, "-1677510.590697", "%5f",
-__LINE__, -1.677658141289510e-18, "-2E-18", "%+5.G",
-__LINE__, -1.678316848066192e-03, "-1.678317E-03", "%E",
-__LINE__, -1.681506404024821e+24, "-1.68151E+24", "%G",
-__LINE__, -1.688584243722160e+12, "-1.68858E+12", "%+#G",
-__LINE__, -1.689468295411408e+28, "-1.68947E+28", "%+G",
-__LINE__, -1.690746767470207e-11, "-1.69075E-11", "%G",
-__LINE__, -1.692773960755248e-14, "-2E-14", "%4.E",
-__LINE__, -1.693349092740995e-18, "-1.69335e-18", "%g",
-__LINE__, -1.693642321808920e-26, "-1.69364E-26", "%G",
-__LINE__, -1.694579128700042e-12, "-0.000000", "%f",
-__LINE__, -1.695454897264717e-08, "-1.7E-08", "%+4.3G",
-__LINE__, -1.695733278397589e+19, "-1.695733e+19", "%4e",
-__LINE__, -1.699522534409388e-05, "-1.69952E-05", "%G",
-__LINE__, -1.701752039544919e+00, "-2", "%.0f",
-__LINE__, -1.702304998615036e+16, "-1.7023E+16", "%1G",
-__LINE__, -1.703113580904556e-25, "-1.703114e-25", "%+e",
-__LINE__, -1.705165515454546e+29, "-1.705166e+29", "%+e",
-__LINE__, -1.707392568277288e-05, "-1.70739E-05", "%G",
-__LINE__, -1.707477319256742e+09, "-1707477319.26", "%7.2f",
-__LINE__, -1.709669107513969e-03, " -0.002", "%7.g",
-__LINE__, -1.713284011412432e-24, "-1.713e-24", "%3.3e",
-__LINE__, -1.715512203951086e-28, "-1.715512E-28", "%E",
-__LINE__, -1.716880832248879e+13, "-1.71688e+13", "%+g",
-__LINE__, -1.720722835740680e-15, "-1.7E-15", "%.1E",
-__LINE__, -1.721855769574895e+07, "-17218557.695749", "%3f",
-__LINE__, -1.722449437415368e+01, "-1.722449e+01", "%e",
-__LINE__, -1.723218805116591e-29, "-2e-29", "%.0g",
-__LINE__, -1.726129004920195e-05, "-1.72613E-05", "%0G",
-__LINE__, -1.727400228037571e-28, "-0.0000000", "%2.7f",
-__LINE__, -1.730008745782339e-23, "-1.73e-23", "%.4g",
-__LINE__, -1.731875670201859e+09, "-1.73188E+09", "%G",
-__LINE__, -1.732142976428085e+10, "-2E+10", "%+6.0E",
-__LINE__, -1.732699651229194e-02, "-0.017327", "%5g",
-__LINE__, -1.734772870736446e-12, "-0.000000", "%+f",
-__LINE__, -1.738576887938331e+09, "-1.73858e+09", "%g",
-__LINE__, -1.738759937912438e-08, "-1.73876e-08", "%+2g",
-__LINE__, -1.739320154069143e-18, "-0.0000", "%1.4f",
-__LINE__, -1.739870415800800e+16, "-1.73987e+16", "%g",
-__LINE__, -1.741290506928618e+04, "-17412.9", "%G",
-__LINE__, -1.742520800031913e+29, "-1.742521e+29", "%7e",
-__LINE__, -1.747620095195231e+01, "-2e+01", "%+2.g",
-__LINE__, -1.749860675924882e-21, "-1.74986E-21", "%G",
-__LINE__, -1.752675363661431e-06, "-1.7527E-06", "%.5G",
-__LINE__, -1.752871508059699e-06, " -0", "%7.f",
-__LINE__, -1.755178530989839e+25, "-1.7551785e+25", "%1.7e",
-__LINE__, -1.755566213249512e-07, "-1.755566e-07", "%.6e",
-__LINE__, -1.756193485005071e-24, "-1.75619E-24", "%+2.6G",
-__LINE__, -1.758501410496218e+03, "-1758.501", "%.7G",
-__LINE__, -1.758795617219102e+20, "-1.75880E+20", "%#6G",
-__LINE__, -1.760538679276709e+03, "-2e+03", "%+1.e",
-__LINE__, -1.762660914833003e+27, "-1.76266E+27", "%G",
-__LINE__, -1.765122691141907e+19, "-17651226911419071186.1", "%5.1f",
-__LINE__, -1.765313277389086e-18, "-2E-18", "%+1.E",
-__LINE__, -1.765821717148734e+19, "-1.76582E+19", "%G",
-__LINE__, -1.767048687863149e-17, "-1.77E-17", "%+.3G",
-__LINE__, -1.768661645451962e+18, "-1.77E+18", "%+.3G",
-__LINE__, -1.769753257452233e+01, "-17.6975", "%G",
-__LINE__, -1.770945665065531e+28, "-1.770946E+28", "%0.7G",
-__LINE__, -1.776713865753894e-09, "-2e-09", "%1.g",
-__LINE__, -1.778424845787448e+03, "-1.7784E+03", "%.4E",
-__LINE__, -1.779060610701250e+06, "-1.779061E+06", "%E",
-__LINE__, -1.781447182110762e-27, "-1.781447E-27", "%E",
-__LINE__, -1.782655842123784e-13, "-2.E-13", "%#2.1G",
-__LINE__, -1.783071018169166e+16, "-17830710181691664.217851", "%+f",
-__LINE__, -1.784665985294415e+25, "-2E+25", "%3.G",
-__LINE__, -1.787297600658096e+25, "-2E+25", "%+5.E",
-__LINE__, -1.788200250255718e+12, "-1.7882E+12", "%2.4E",
-__LINE__, -1.792860730579114e-09, "-1.79286E-09", "%G",
-__LINE__, -1.793122797100936e+24, "-1.793123e+24", "%e",
-__LINE__, -1.793761706915029e-25, "-0.000000", "%f",
-__LINE__, -1.793947567431932e+22, "-1.79395e+22", "%g",
-__LINE__, -1.796428035404303e-18, "-1.79643e-18", "%g",
-__LINE__, -1.797113144273918e-16, "-1.79711E-16", "%.6G",
-__LINE__, -1.798796767828424e-29, "-1.7988E-29", "%G",
-__LINE__, -1.805004010633763e-11, "-1.805e-11", "%2.5g",
-__LINE__, -1.806936269752338e-26, "-1.80694e-26", "%g",
-__LINE__, -1.807122541760172e-10, "-1.80712e-10", "%g",
-__LINE__, -1.808295407815630e-06, "-1.8083E-06", "%+G",
-__LINE__, -1.813893236685959e+15, "-1813893236685959", "%0.f",
-__LINE__, -1.816201530145367e+06, "-1816202", "%+2.f",
-__LINE__, -1.822811219123512e+13, "-1.82281e+13", "%g",
-__LINE__, -1.826276499170243e-25, "-2E-25", "%+3.G",
-__LINE__, -1.832399287433839e-26, "-1.832399E-26", "%#4E",
-__LINE__, -1.833597815584463e-18, "-0.000000", "%+3f",
-__LINE__, -1.834165532712233e+28, "-1.834166E+28", "%.7G",
-__LINE__, -1.837633147831083e+28, "-1.8376331e+28", "%.7e",
-__LINE__, -1.839756716742518e-01, "-0.2", "%+0.G",
-__LINE__, -1.840101206950368e-14, "-1.840101E-14", "%+E",
-__LINE__, -1.842043645474877e+17, "-1.84204e+17", "%+g",
-__LINE__, -1.842155892969934e+17, "-1.84216e+17", "%+g",
-__LINE__, -1.843566073012842e-25, "-1.84357E-25", "%G",
-__LINE__, -1.843976321320497e-02, "-0.02", "%+4.2f",
-__LINE__, -1.845299931651554e+11, "-1.8453E+11", "%0.4E",
-__LINE__, -1.846199038659889e-06, "-1.8462e-06", "%0.5g",
-__LINE__, -1.847062180184169e-30, "-1.847062E-30", "%5E",
-__LINE__, -1.847962158722201e-16, "-0.000000", "%f",
-__LINE__, -1.849446376756582e+15, "-1.8E+15", "%2.2G",
-__LINE__, -1.853168465523878e-24, "-2E-24", "%1.E",
-__LINE__, -1.853601367230139e+10, "-1.853601e+10", "%e",
-__LINE__, -1.857367903775364e+18, "-1.86E+18", "%1.3G",
-__LINE__, -1.858332820633906e-05, "-0.000019", "%7f",
-__LINE__, -1.860243811657223e-23, "-1.860244e-23", "%e",
-__LINE__, -1.860660612539794e+08, "-1.86066e+08", "%+6.5e",
-__LINE__, -1.861160816251124e-09, "-2E-09", "%1.G",
-__LINE__, -1.862380636974688e-25, "-1.9E-25", "%.2G",
-__LINE__, -1.864168808453004e+15, "-1.86417E+15", "%G",
-__LINE__, -1.864273144411246e+07, "-1.86427e+07", "%g",
-__LINE__, -1.864929236615802e-02, "-2e-02", "%+3.e",
-__LINE__, -1.865010503480847e+19, "-2E+19", "%4.G",
-__LINE__, -1.866276374553144e+22, "-1.866276e+22", "%e",
-__LINE__, -1.870809567910649e+09, "-1.870810e+09", "%e",
-__LINE__, -1.872555495839008e-13, "-1.872555E-13", "%3E",
-__LINE__, -1.874465717110388e-22, "-1.874466E-22", "%E",
-__LINE__, -1.874916306627632e+21, "-1874916306627632422987.517202", "%f",
-__LINE__, -1.875804322194491e-23, "-0.000000", "%+f",
-__LINE__, -1.876662099198587e-04, "-0.000187666", "%G",
-__LINE__, -1.876775504795760e-25, "-1.87678e-25", "%0g",
-__LINE__, -1.879343051002554e-20, " -0.", "%#6.f",
-__LINE__, -1.881535445774717e-15, "-1.881535e-15", "%e",
-__LINE__, -1.887515901404300e+00, "-1.888", "%2.4G",
-__LINE__, -1.887730637149009e+17, "-1.887731E+17", "%E",
-__LINE__, -1.889920303480086e+17, "-1.889920e+17", "%+e",
-__LINE__, -1.891903478784091e+04, "-1.891903e+04", "%e",
-__LINE__, -1.893550084305833e+16, "-1.89355e+16", "%g",
-__LINE__, -1.894675230197676e+05, "-1.894675e+05", "%#e",
-__LINE__, -1.898389624953187e-27, "-1.898390e-27", "%+e",
-__LINE__, -1.899250044644046e+21, "-1899250044644046120367.875119", "%+4.6f",
-__LINE__, -1.904187609804679e-02, "-1.90419E-02", "%0.5E",
-__LINE__, -1.904452538421193e-04, "-2e-04", "%4.0e",
-__LINE__, -1.904615326969061e-16, "-1.904615e-16", "%1.7g",
-__LINE__, -1.907761255064750e+02, "-190.776126", "%f",
-__LINE__, -1.910727641826707e-10, " -2e-10", "%7.g",
-__LINE__, -1.913149279262051e+15, "-1.913149e+15", "%.7g",
-__LINE__, -1.913235739298009e+28, "-1.913236e+28", "%e",
-__LINE__, -1.913526822735271e+18, "-1.914e+18", "%.4g",
-__LINE__, -1.913780977515583e+17, "-191378097751558335.9150", "%5.4f",
-__LINE__, -1.917095456962182e-10, "-2E-10", "%4.G",
-__LINE__, -1.918803033972851e+23, "-191880303397285132405158.947222", "%f",
-__LINE__, -1.926420984801848e+16, "-19264209848018483.128840", "%+f",
-__LINE__, -1.931905465942639e-10, "-1.93191e-10", "%g",
-__LINE__, -1.932907105840252e+06, "-1.932907e+06", "%+#e",
-__LINE__, -1.933091601918916e+15, "-1.933092E+15", "%#E",
-__LINE__, -1.934296184983361e+09, "-1.9343e+09", "%1.6g",
-__LINE__, -1.934637311832448e+11, "-1.93464e+11", "%+g",
-__LINE__, -1.936201483262186e+12, "-2e+12", "%+6.g",
-__LINE__, -1.939114661603911e+19, "-1.93911E+19", "%G",
-__LINE__, -1.940478182124347e-13, "-0.000000", "%f",
-__LINE__, -1.943218220654923e+08, "-2E+08", "%+5.0G",
-__LINE__, -1.943526872455779e-30, "-1.9E-30", "%.1E",
-__LINE__, -1.949869164681357e+19, "-1.949869e+19", "%#3e",
-__LINE__, -1.954181060535402e+23, "-1.954181e+23", "%e",
-__LINE__, -1.961581555579142e+14, "-1.962E+14", "%.3E",
-__LINE__, -1.964535562036915e+07, "-1.96454E+07", "%G",
-__LINE__, -1.969749653575926e+04, "-19697.5", "%.6g",
-__LINE__, -1.973475369169053e+15, "-1.97348e+15", "%g",
-__LINE__, -1.975658532866600e-21, "-2e-21", "%+1.2g",
-__LINE__, -1.984050343831260e+09, "-1.984050E+09", "%E",
-__LINE__, -1.984422410018571e+12, "-1.984422e+12", "%+4.7g",
-__LINE__, -1.984878687667223e-22, "-0.000000", "%f",
-__LINE__, -1.986116930967811e-28, "-1.98612e-28", "%g",
-__LINE__, -1.986774457812683e+02, "-1.986774e+02", "%e",
-__LINE__, -1.987274814938726e-04, "-0.000198727", "%g",
-__LINE__, -1.987319200580415e+10, "-1.987319E+10", "%E",
-__LINE__, -1.987980768698114e-19, "-0.000000", "%3f",
-__LINE__, -1.994698965044602e-29, "-2E-29", "%+4.0G",
-__LINE__, -1.997833122667050e+26, "-1.99783E+26", "%G",
-__LINE__, -1.999453681184129e-10, "-0.00000", "%.5f",
-__LINE__, -1.999897345839745e-16, "-1.9999e-16", "%g",
-__LINE__, -2.003703825123989e-22, "-0.000000", "%f",
-__LINE__, -2.004569188274957e-23, "-2.00457E-23", "%G",
-__LINE__, -2.005911883189058e+07, "-2.00591E+07", "%G",
-__LINE__, -2.006438312005722e-25, "-2.006e-25", "%0.4g",
-__LINE__, -2.017322171210280e+18, "-2.01732E+18", "%+0G",
-__LINE__, -2.017718635819594e-06, "-2.01772e-06", "%5g",
-__LINE__, -2.019187445568160e-12, "-0.00", "%.2f",
-__LINE__, -2.021022665608503e+25, "-20210226656085028551501636.684", "%2.3f",
-__LINE__, -2.022720393474145e+07, "-2.02272E+07", "%#G",
-__LINE__, -2.024506694471065e+23, "-2.02451E+23", "%G",
-__LINE__, -2.024884686553821e-15, " -2e-15", "%7.g",
-__LINE__, -2.027484636128966e-23, "-2.0275E-23", "%.5G",
-__LINE__, -2.028185530467237e+21, "-2028185530467237374097.067", "%+4.3f",
-__LINE__, -2.028388905566873e-09, "-0.000000", "%f",
-__LINE__, -2.029856507431584e-17, "-2.02986E-17", "%G",
-__LINE__, -2.029891733449167e+27, "-2029891733449166846270372843.7190875", "%3.7f",
-__LINE__, -2.031933616694469e+14, "-2.031934E+14", "%#E",
-__LINE__, -2.034011738471413e-10, "-2.03401E-10", "%#G",
-__LINE__, -2.036087355975756e+29, "-203608735597575574161055556032.806635", "%+f",
-__LINE__, -2.036355025137273e+09, "-2.036355E+09", "%#.7G",
-__LINE__, -2.038423730536878e+12, "-2E+12", "%4.G",
-__LINE__, -2.045209202278810e+23, "-2.045209e+23", "%+#e",
-__LINE__, -2.046794083517423e-06, "-2.04679e-06", "%g",
-__LINE__, -2.048042459678599e-19, "-0.000000", "%f",
-__LINE__, -2.050526462096153e+18, "-2.05053e+18", "%+g",
-__LINE__, -2.053583900249402e+13, "-2.053584e+13", "%0.7g",
-__LINE__, -2.054342100957522e-23, "-2.05434E-23", "%#G",
-__LINE__, -2.054793400141025e+11, "-205479340014.1", "%+2.1f",
-__LINE__, -2.059200689196498e-11, "-0.000000", "%#f",
-__LINE__, -2.060960692728114e-16, "-0.000000", "%+f",
-__LINE__, -2.061417528654300e-30, "-2.06E-30", "%.3G",
-__LINE__, -2.061513401198340e-29, "-2.06151e-29", "%7g",
-__LINE__, -2.061846698845984e+27, "-2.061847E+27", "%E",
-__LINE__, -2.063922242876789e-19, "-2.06392e-19", "%#g",
-__LINE__, -2.065359431805529e+03, "-2065.359432", "%f",
-__LINE__, -2.065529069992156e-04, "-0.000206553", "%+G",
-__LINE__, -2.066082546490980e-25, "-2.06608e-25", "%5g",
-__LINE__, -2.068394312095200e+17, "-2.068394e+17", "%e",
-__LINE__, -2.071024178556425e-10, "-2.07102E-10", "%G",
-__LINE__, -2.074401605950382e-22, "-2.07e-22", "%1.3g",
-__LINE__, -2.074731895144874e-26, "-2.07473E-26", "%G",
-__LINE__, -2.074895800882730e+18, "-2074895800882730068.082083", "%+f",
-__LINE__, -2.077336220500764e-30, "-0", "%2.f",
-__LINE__, -2.078067878561077e+09, "-2.0781e+09", "%0.5g",
-__LINE__, -2.080497889634533e+15, "-2.080498E+15", "%4E",
-__LINE__, -2.084717279367594e-21, "-2.08472e-21", "%+g",
-__LINE__, -2.087827915301948e+29, "-2E+29", "%6.1G",
-__LINE__, -2.090268686389680e+05, "-2.090269e+05", "%1e",
-__LINE__, -2.092036176589720e+24, "-2.09204e+24", "%+g",
-__LINE__, -2.093546373938615e-21, "-2.093546e-21", "%#e",
-__LINE__, -2.101302069316682e+18, "-2.1013e+18", "%+7g",
-__LINE__, -2.103463622286002e-13, "-2.103464E-13", "%E",
-__LINE__, -2.105622845016732e+06, "-2105622.845017", "%1f",
-__LINE__, -2.109999123037767e+28, "-2.11E+28", "%.2E",
-__LINE__, -2.110317013992166e+04, "-21103.2", "%+g",
-__LINE__, -2.112226142154618e+21, "-2112226142154617569702.", "%#6.f",
-__LINE__, -2.112519484486528e+06, "-2.11252E+06", "%G",
-__LINE__, -2.113439260812000e+23, "-2E+23", "%1.G",
-__LINE__, -2.113465893194608e-15, "-2.1135E-15", "%.5G",
-__LINE__, -2.113547784669409e+20, "-2.1135e+20", "%2.5g",
-__LINE__, -2.114146001321822e+28, "-2.114146e+28", "%e",
-__LINE__, -2.114509425574444e-30, " -0", "%4.f",
-__LINE__, -2.114887421659561e-21, "-0.000000", "%+f",
-__LINE__, -2.121120215127601e+21, "-2121120215127601404958.5683097", "%.7f",
-__LINE__, -2.122555390665796e+06, "-2E+06", "%0.G",
-__LINE__, -2.123468430242052e-27, "-0.000000", "%+f",
-__LINE__, -2.123473598890635e+28, "-2.12347e+28", "%+g",
-__LINE__, -2.124328049748190e-04, "-2.124328E-04", "%E",
-__LINE__, -2.125633890999010e+28, "-2E+28", "%+5.G",
-__LINE__, -2.125697963566045e+21, "-2.1257E+21", "%0G",
-__LINE__, -2.127638109230109e+06, "-2.12764e+06", "%+6g",
-__LINE__, -2.128456114617786e+07, "-2.128456E+07", "%E",
-__LINE__, -2.128732742932824e-04, "-2.128733E-04", "%#E",
-__LINE__, -2.129654381588404e+27, "-2129654381588404365999167566.7697564", "%+.7f",
-__LINE__, -2.129792795009985e+20, "-2.12979e+20", "%g",
-__LINE__, -2.131026925664619e-20, "-2e-20", "%.0e",
-__LINE__, -2.132860730144188e-04, "-0.0002", "%5.g",
-__LINE__, -2.133620979309562e+06, "-2e+06", "%3.e",
-__LINE__, -2.133821423139120e-27, "-2.13382E-27", "%.6G",
-__LINE__, -2.134253401425940e-07, "-0.000000", "%f",
-__LINE__, -2.135469568156964e-29, "-2.135470E-29", "%+7E",
-__LINE__, -2.135723595288365e-25, "-0.0", "%.1f",
-__LINE__, -2.137642458920094e-09, "-2.13764e-09", "%g",
-__LINE__, -2.143412361116583e+12, "-2.14341e+12", "%+g",
-__LINE__, -2.144467087741129e-17, "-2.14447e-17", "%+g",
-__LINE__, -2.145726966596964e-11, "-0.000000", "%2f",
-__LINE__, -2.148318753042597e+08, "-2.14832E+08", "%5G",
-__LINE__, -2.149932310549644e-19, "-2.14993e-19", "%g",
-__LINE__, -2.150050917377646e-21, " -0", "%3.f",
-__LINE__, -2.150854313643430e-16, "-0.000000", "%.6f",
-__LINE__, -2.151071797121845e+00, "-2.15107", "%+g",
-__LINE__, -2.158728406865981e+14, "-215872840686598.088666", "%7f",
-__LINE__, -2.166062878011641e-23, "-2.166063e-23", "%e",
-__LINE__, -2.167045002060684e+12, "-2.167045E+12", "%E",
-__LINE__, -2.173752581051530e+20, "-217375258105153035259.604621", "%f",
-__LINE__, -2.175599129057555e+24, "-2.175599E+24", "%E",
-__LINE__, -2.176564454093042e-02, "-0.0217656", "%+G",
-__LINE__, -2.181270774327071e-12, "-0.000000", "%#1f",
-__LINE__, -2.184404769844158e-09, "-2.2E-09", "%+.2G",
-__LINE__, -2.184881476334310e-07, "-2.18488e-07", "%g",
-__LINE__, -2.189197211449684e-11, "-2E-11", "%.0G",
-__LINE__, -2.189451286805190e+20, "-218945128680519029984", "%3.f",
-__LINE__, -2.190642494146884e-27, " -0.", "%#4.f",
-__LINE__, -2.194727956725854e+06, "-2.19E+06", "%.3G",
-__LINE__, -2.196145868303877e+11, "-219614586830.387726", "%+5f",
-__LINE__, -2.196397972262690e-16, "-0.000000", "%3f",
-__LINE__, -2.202692843474668e-01, "-2.203e-01", "%.3e",
-__LINE__, -2.204528684782451e-21, "-2.20453E-21", "%G",
-__LINE__, -2.214926838821340e-16, "-2e-16", "%+2.g",
-__LINE__, -2.215558986352773e+18, "-2215558986352773374", "%0.f",
-__LINE__, -2.216976693056186e+27, "-2216976693056186498154147557.215765", "%f",
-__LINE__, -2.217348422793322e+13, "-2.21735E+13", "%6G",
-__LINE__, -2.217732695583920e-07, "-0", "%.0f",
-__LINE__, -2.221185494767834e-14, "-2.22119e-14", "%g",
-__LINE__, -2.224557193699609e-16, "-2.224557E-16", "%E",
-__LINE__, -2.227417758704028e-18, "-0.000000", "%0f",
-__LINE__, -2.231261655673006e-30, "-2.231262E-30", "%E",
-__LINE__, -2.233081938836160e+21, "-2233081938836160240668.960", "%+6.3f",
-__LINE__, -2.233158918439853e+05, "-223316", "%2G",
-__LINE__, -2.233802298007898e-30, "-2.2338E-30", "%2G",
-__LINE__, -2.233864858404732e+17, "-223386485840473181.241350", "%f",
-__LINE__, -2.241242805107749e+14, "-2.24124E+14", "%G",
-__LINE__, -2.244555498855249e+25, "-2.24456E+25", "%#G",
-__LINE__, -2.248170665127481e-07, "-2.248171E-07", "%E",
-__LINE__, -2.252558275567388e-13, "-2.25256e-13", "%g",
-__LINE__, -2.256190083496001e+13, "-22561900834960.0136398", "%7.7f",
-__LINE__, -2.259851596715945e+27, "-2.259852e+27", "%e",
-__LINE__, -2.260461480001174e-21, "-0.000000", "%f",
-__LINE__, -2.264128628428577e+22, "-2.26413e+22", "%1g",
-__LINE__, -2.265914518399595e-04, "-0.000226591", "%G",
-__LINE__, -2.266251557092826e+23, "-2.26625e+23", "%g",
-__LINE__, -2.268592252572450e+19, "-2.268592e+19", "%2.6e",
-__LINE__, -2.268597523847349e+11, "-2.2686e+11", "%g",
-__LINE__, -2.268963106935546e+05, "-226896", "%+g",
-__LINE__, -2.272527876808919e-24, "-0.000000", "%#f",
-__LINE__, -2.273366440479073e+02, "-227.337", "%g",
-__LINE__, -2.277858038556191e+25, "-2.28E+25", "%0.3G",
-__LINE__, -2.282019915623415e+25, "-2E+25", "%5.E",
-__LINE__, -2.283333247435650e-27, " -0", "%4.f",
-__LINE__, -2.285230610829355e+23, "-2E+23", "%2.G",
-__LINE__, -2.290900253402985e+23, "-2.2909E+23", "%G",
-__LINE__, -2.293266953268186e+08, "-2.29327e+08", "%g",
-__LINE__, -2.293489603164786e+23, "-229348960316478578391752.3076525", "%4.7f",
-__LINE__, -2.294434667605481e+15, "-2.2944E+15", "%.5G",
-__LINE__, -2.296607768466765e+21, "-2.29661E+21", "%G",
-__LINE__, -2.297449967994012e+14, "-229744996799401.23542", "%+.5f",
-__LINE__, -2.301162556466583e-01, "-0.230116", "%+#2g",
-__LINE__, -2.301676246374004e+05, "-230168.", "%#g",
-__LINE__, -2.301976724487835e-01, "-0.230198", "%5G",
-__LINE__, -2.303269770571222e-15, "-2.303270e-15", "%.6e",
-__LINE__, -2.306451480495636e+23, "-2.30645E+23", "%G",
-__LINE__, -2.307659351219690e-17, "-0.000000", "%+3f",
-__LINE__, -2.309009762339430e+16, "-2.30901E+16", "%G",
-__LINE__, -2.309261751862100e+06, "-2309261.751862", "%+f",
-__LINE__, -2.309504876918634e-26, " -2E-26", "%7.E",
-__LINE__, -2.310910348147804e-26, "-2e-26", "%5.g",
-__LINE__, -2.317173552252235e+05, "-231717.4", "%.7g",
-__LINE__, -2.319517289618469e-23, "-2.31952E-23", "%+G",
-__LINE__, -2.320103195142527e+08, "-2.320103E+08", "%+E",
-__LINE__, -2.323523032125633e+24, "-2323523032125633491773442.07419", "%.5f",
-__LINE__, -2.326279126614399e-16, "-0.000000", "%f",
-__LINE__, -2.331393688620925e-09, "-2.33139e-09", "%#g",
-__LINE__, -2.334233527512469e+01, " -23", "%6.0f",
-__LINE__, -2.337418834112767e+24, " -2E+24", "%7.E",
-__LINE__, -2.339455293612118e+12, "-2339455293612.1", "%+.1f",
-__LINE__, -2.341930318143367e-18, "-2.E-18", "%#4.E",
-__LINE__, -2.346107614950921e-17, "-0.00000", "%+2.5f",
-__LINE__, -2.348356578807972e+23, "-2.34836e+23", "%g",
-__LINE__, -2.351485855138244e+19, "-2.351486e+19", "%+e",
-__LINE__, -2.362101647639198e-15, "-2.36210e-15", "%#g",
-__LINE__, -2.369743873030115e+08, "-2e+08", "%.1g",
-__LINE__, -2.371658164739356e+25, "-23716581647393559784120498.079574", "%f",
-__LINE__, -2.372427847607163e+28, "-2.37243E+28", "%G",
-__LINE__, -2.375465465294647e+11, "-2.375465e+11", "%e",
-__LINE__, -2.377128971572195e-18, "-0.0", "%1.1f",
-__LINE__, -2.380322448568089e-13, "-2.38032E-13", "%+#0G",
-__LINE__, -2.385960728264882e+26, "-2E+26", "%.0E",
-__LINE__, -2.387345744004747e+00, "-2.38735", "%G",
-__LINE__, -2.390480023300201e+25, "-2.39048e+25", "%g",
-__LINE__, -2.395420431930886e+23, "-2E+23", "%2.E",
-__LINE__, -2.401144663870969e-10, "-2.e-10", "%#6.g",
-__LINE__, -2.402787441215039e-08, "-2.40279e-08", "%g",
-__LINE__, -2.402990830425278e+08, "-2.40299E+08", "%G",
-__LINE__, -2.404213682932215e+08, "-2.40421e+08", "%2g",
-__LINE__, -2.409385592298822e+21, "-2409385592298821876511.283335", "%7f",
-__LINE__, -2.410798267658614e+13, "-2.4108e+13", "%+g",
-__LINE__, -2.413180068271811e-24, "-0.000000", "%+f",
-__LINE__, -2.413268457113495e+26, "-2.41327E+26", "%3.6G",
-__LINE__, -2.415341832206007e-13, "-0.000000", "%+f",
-__LINE__, -2.422519577068670e-08, "-0.0000000", "%.7f",
-__LINE__, -2.422533651282808e+20, "-2.42253E+20", "%#G",
-__LINE__, -2.422795006880671e+17, "-2.4228e+17", "%g",
-__LINE__, -2.423483330202008e+20, "-2.42348e+20", "%g",
-__LINE__, -2.431756009640369e-04, "-0.000243176", "%+#3g",
-__LINE__, -2.431878622534173e-05, "-0.000024", "%f",
-__LINE__, -2.432012113077180e+24, "-2.43201e+24", "%g",
-__LINE__, -2.433843704470487e+07, "-24338437", "%4.f",
-__LINE__, -2.435475755031956e+11, "-2.435476E+11", "%1E",
-__LINE__, -2.438081888695437e-13, "-0.000000", "%f",
-__LINE__, -2.438334590462860e+10, "-2.4E+10", "%5.2G",
-__LINE__, -2.440223135334059e+17, "-2.44022e+17", "%g",
-__LINE__, -2.444107281115317e-21, "-2.44411e-21", "%+g",
-__LINE__, -2.444582273206171e-02, " -0.02", "%7.G",
-__LINE__, -2.445234676352794e+23, "-2.44523e+23", "%#g",
-__LINE__, -2.449185020984714e+08, "-2.E+08", "%#2.G",
-__LINE__, -2.450646640466020e+22, "-2.45065E+22", "%5G",
-__LINE__, -2.456840850262473e+13, "-24568408502625", "%0.f",
-__LINE__, -2.464466865714499e-10, "-2e-10", "%6.g",
-__LINE__, -2.466022088999151e+27, "-2.46602E+27", "%G",
-__LINE__, -2.484398113119779e-04, "-2.484398E-04", "%E",
-__LINE__, -2.484591850456328e+23, "-248459185045632846566832.085955", "%+f",
-__LINE__, -2.488166252162446e-11, "-2.5E-11", "%4.2G",
-__LINE__, -2.493507313049390e+24, "-2.49E+24", "%4.3G",
-__LINE__, -2.500280281988428e+28, "-2.5E+28", "%.4G",
-__LINE__, -2.500373956445372e-07, "-2.50037e-07", "%g",
-__LINE__, -2.505566434769299e-12, "-2.5E-12", "%+#0.2G",
-__LINE__, -2.508215917020758e+05, "-2.508216e+05", "%5e",
-__LINE__, -2.519368094680315e-29, "-2.51937e-29", "%#0g",
-__LINE__, -2.522266530587753e-11, "-2.52227e-11", "%+g",
-__LINE__, -2.534492886372514e-06, "-2.53449E-06", "%0G",
-__LINE__, -2.534617610955074e-02, "-0.03", "%0.2f",
-__LINE__, -2.540551642835634e+26, "-3E+26", "%4.G",
-__LINE__, -2.548210731830516e-26, "-0.000", "%2.3f",
-__LINE__, -2.558868082397931e-11, "-3E-11", "%2.E",
-__LINE__, -2.560062512991052e+11, "-2.56006E+11", "%+G",
-__LINE__, -2.561274682814428e-05, "-0.000026", "%f",
-__LINE__, -2.563424949397357e-02, " -0", "%6.f",
-__LINE__, -2.577010939931465e+17, "-2.57701E+17", "%G",
-__LINE__, -2.578224879294822e+10, "-3E+10", "%+4.1G",
-__LINE__, -2.585655636750244e+13, "-2.585656e+13", "%+0.7g",
-__LINE__, -2.585657986834408e+14, "-2.5857e+14", "%3.5g",
-__LINE__, -2.586728929368101e+02, "-258.673", "%+g",
-__LINE__, -2.591293023229468e+06, "-2591293.0232295", "%2.7f",
-__LINE__, -2.592454222603538e-06, "-2.59245E-06", "%G",
-__LINE__, -2.599399905869649e+02, "-259.939991", "%f",
-__LINE__, -2.605382860307596e+12, "-2.60538E+12", "%2G",
-__LINE__, -2.607507689402762e-01, "-0.260751", "%#.6g",
-__LINE__, -2.612933252582967e+15, "-2.61293e+15", "%g",
-__LINE__, -2.614337505491483e-14, "-2.61434E-14", "%.6G",
-__LINE__, -2.618302263333671e+14, "-2.62e+14", "%3.3g",
-__LINE__, -2.622998533972296e+00, "-3.", "%#0.g",
-__LINE__, -2.623348319869643e-15, "-2.62335E-15", "%#G",
-__LINE__, -2.626703132693163e+23, "-3E+23", "%+6.E",
-__LINE__, -2.629610853765779e+25, "-2.62961E+25", "%+#G",
-__LINE__, -2.632993880472784e+26, "-2.63299E+26", "%G",
-__LINE__, -2.635651112327873e-20, "-2.63565E-20", "%1G",
-__LINE__, -2.636003980473492e-23, "-2.636E-23", "%G",
-__LINE__, -2.639316453244009e+10, "-26393164532.440094", "%#f",
-__LINE__, -2.640517223417942e-28, "-2.641e-28", "%.3e",
-__LINE__, -2.640625797147664e-22, "-2.640626E-22", "%E",
-__LINE__, -2.644401262524378e-12, " -0.000", "%7.3f",
-__LINE__, -2.651033203243637e-14, "-2.651033e-14", "%+e",
-__LINE__, -2.652386470126594e-24, "-2.652386E-24", "%E",
-__LINE__, -2.654281018623631e-12, "-0.00000", "%6.5f",
-__LINE__, -2.655529742118827e+02, "-265.552974", "%f",
-__LINE__, -2.658550833241620e+22, "-26585508332416196708436.473273", "%+f",
-__LINE__, -2.660515890519100e+08, "-2.660516E+08", "%E",
-__LINE__, -2.665025749266086e-24, "-2.66503E-24", "%G",
-__LINE__, -2.666117105643095e-20, "-2.66612e-20", "%g",
-__LINE__, -2.667051347741259e+11, "-3e+11", "%6.g",
-__LINE__, -2.667207607243375e+04, "-26672.076072", "%+#f",
-__LINE__, -2.667631877167590e+26, "-2.667632E+26", "%E",
-__LINE__, -2.673817942962878e+13, "-2.673818e+13", "%+2.6e",
-__LINE__, -2.674972907853507e+20, "-2.674973E+20", "%E",
-__LINE__, -2.675830887404867e+14, "-2.675831E+14", "%E",
-__LINE__, -2.682749918168908e+26, "-2.682750E+26", "%E",
-__LINE__, -2.689222801942679e-03, "-0.0027", "%7.2G",
-__LINE__, -2.692245629411156e+25, "-2.69225e+25", "%g",
-__LINE__, -2.692606702464273e+11, "-2.69261e+11", "%g",
-__LINE__, -2.693070822061136e-27, "-2.69307e-27", "%+g",
-__LINE__, -2.694415515655336e-30, "-3E-30", "%+3.0E",
-__LINE__, -2.694770057384739e+15, "-2.69477e+15", "%g",
-__LINE__, -2.699998392329361e+01, "-27", "%+.2g",
-__LINE__, -2.700151952281511e+23, "-270015195228151050343968.", "%+#5.f",
-__LINE__, -2.707398527302841e-08, "-2.70740e-08", "%+#3g",
-__LINE__, -2.711404950850030e-21, "-2.71E-21", "%.2E",
-__LINE__, -2.714057739024281e-10, "-2.714e-10", "%.4g",
-__LINE__, -2.717657632815414e-10, "-2.71766e-10", "%g",
-__LINE__, -2.720875786430592e-09, "-2.7E-09", "%6.2G",
-__LINE__, -2.725886730997891e+19, "-2.72589e+19", "%g",
-__LINE__, -2.726089169748676e-09, "-2.72609E-09", "%+G",
-__LINE__, -2.732907572038661e-30, "-2.73291E-30", "%G",
-__LINE__, -2.737918050958789e+11, "-3e+11", "%1.g",
-__LINE__, -2.739024251198484e-18, "-2.73902e-18", "%+g",
-__LINE__, -2.742646144452305e+13, "-2.74265e+13", "%g",
-__LINE__, -2.742911865386719e+06, "-3E+06", "%+5.G",
-__LINE__, -2.759159275123811e-30, "-0.000000", "%+f",
-__LINE__, -2.759794813930001e-21, "-2.75979e-21", "%+g",
-__LINE__, -2.763243077558348e+20, "-2.7632E+20", "%+0.4E",
-__LINE__, -2.770348477810209e-14, "-0.000000", "%2f",
-__LINE__, -2.776074766292453e+05, "-277607", "%g",
-__LINE__, -2.776610811432007e-07, "-2.77661E-07", "%6G",
-__LINE__, -2.778673793270678e+23, "-3E+23", "%+4.E",
-__LINE__, -2.782405168708350e+08, "-278240516.87084", "%.5f",
-__LINE__, -2.783316149365198e-09, "-3E-09", "%5.0G",
-__LINE__, -2.785436703085409e-27, "-2.78544E-27", "%#G",
-__LINE__, -2.787479051660640e+21, "-2.78748e+21", "%g",
-__LINE__, -2.789445406042450e-03, "-0.002789", "%+f",
-__LINE__, -2.791104581836077e+05, "-279110.4581836", "%+7.7f",
-__LINE__, -2.802078617775784e+04, "-28020.786", "%0.3f",
-__LINE__, -2.804954315579055e+20, "-2.80495E+20", "%G",
-__LINE__, -2.806575341862696e-05, "-2.80658E-05", "%G",
-__LINE__, -2.807769556900402e-06, "-0.000003", "%+#f",
-__LINE__, -2.808882056357941e-12, "-0.0", "%.1f",
-__LINE__, -2.809386677339924e+10, "-2.8094E+10", "%6.5G",
-__LINE__, -2.818404311437694e+19, "-3E+19", "%6.G",
-__LINE__, -2.819463285551660e+01, "-28.1946", "%+G",
-__LINE__, -2.821428853207724e-16, "-3e-16", "%6.g",
-__LINE__, -2.824452750788444e+07, "-3e+07", "%+2.g",
-__LINE__, -2.825430381094971e+28, "-3e+28", "%+.0e",
-__LINE__, -2.830010928384944e-17, "-0", "%.0f",
-__LINE__, -2.832505114479680e-09, "-0.000000", "%f",
-__LINE__, -2.833246604950796e+13, "-2.83325E+13", "%G",
-__LINE__, -2.833274073265017e+13, "-28332740732650.174564", "%f",
-__LINE__, -2.835842581787797e+07, "-2.83584E+07", "%2G",
-__LINE__, -2.839758384681983e-07, "-2.83976E-07", "%.6G",
-__LINE__, -2.841077022753766e-09, "-3E-09", "%0.1G",
-__LINE__, -2.845307294930682e+00, "-2.845307e+00", "%+1e",
-__LINE__, -2.847420163874243e+19, "-2.8e+19", "%1.2g",
-__LINE__, -2.848133715109881e-25, "-2.848134E-25", "%E",
-__LINE__, -2.850208101288058e-06, "-2.8502E-06", "%+5.4E",
-__LINE__, -2.853666525870413e+04, "-28536.665259", "%f",
-__LINE__, -2.855661543202034e+21, "-2.85566e+21", "%g",
-__LINE__, -2.859528889324159e-08, "-2.859529e-08", "%3e",
-__LINE__, -2.860545310690251e+29, "-3e+29", "%.1g",
-__LINE__, -2.863576633666884e-14, "-2.863577e-14", "%+5e",
-__LINE__, -2.864115740396321e-14, "-2.86412e-14", "%g",
-__LINE__, -2.864481979037153e+20, "-2.86E+20", "%3.3G",
-__LINE__, -2.867582970177984e-18, "-0.000000", "%f",
-__LINE__, -2.868237707901564e+25, "-3E+25", "%6.E",
-__LINE__, -2.871741071402520e+13, "-3e+13", "%.1g",
-__LINE__, -2.873724610073364e+18, "-2873724610073364438.278531", "%+#f",
-__LINE__, -2.876433859770866e-25, "-2.87643e-25", "%g",
-__LINE__, -2.877458587075737e-08, "-2.877E-08", "%+.4G",
-__LINE__, -2.883349842927101e+24, "-2.883350E+24", "%2E",
-__LINE__, -2.883749925642885e+09, "-2.883750e+09", "%e",
-__LINE__, -2.883773835633003e-17, "-0.000000", "%+f",
-__LINE__, -2.890389090491409e+24, "-2890389090491409262995148.310438", "%#1f",
-__LINE__, -2.900848552225810e-11, "-0.000000", "%+f",
-__LINE__, -2.911942123176400e+25, "-29119421231764004431852300", "%0.f",
-__LINE__, -2.912904462180751e-18, "-2.9129E-18", "%6G",
-__LINE__, -2.917717875075651e+26, "-3e+26", "%0.e",
-__LINE__, -2.922293201084093e-26, "-2.922293E-26", "%E",
-__LINE__, -2.925070319932451e-30, "-0.000000", "%f",
-__LINE__, -2.926558572870874e+15, "-2.926559E+15", "%E",
-__LINE__, -2.928781435877896e+26, "-2.928781e+26", "%+e",
-__LINE__, -2.930178318110376e+28, "-2.930178E+28", "%E",
-__LINE__, -2.930984661925819e+05, "-293098.5", "%.7G",
-__LINE__, -2.932762424932762e-08, "-0.000000", "%#f",
-__LINE__, -2.933415597492494e+10, "-29334155974.924943", "%+#2f",
-__LINE__, -2.933564314850986e+29, "-2.93356E+29", "%7G",
-__LINE__, -2.943224907893795e+10, "-2.943225E+10", "%+7E",
-__LINE__, -2.945311540471221e+19, "-2.94531E+19", "%#G",
-__LINE__, -2.945812356522847e+15, "-2.94581e+15", "%+g",
-__LINE__, -2.945836999630957e+00, "-2.945837E+00", "%E",
-__LINE__, -2.947798782726622e-01, "-0.29478", "%+g",
-__LINE__, -2.948958405827917e+18, "-2.94896e+18", "%g",
-__LINE__, -2.949790871798059e-11, "-2.94979E-11", "%G",
-__LINE__, -2.950347806125225e-12, "-2.95035e-12", "%g",
-__LINE__, -2.952781884599368e-29, "-2.952782E-29", "%+E",
-__LINE__, -2.956801341442716e+06, "-2.9568E+06", "%G",
-__LINE__, -2.957469310356540e-07, "-0.000", "%1.3f",
-__LINE__, -2.960464869534870e-23, "-2.96046E-23", "%G",
-__LINE__, -2.962339381825446e-07, "-0", "%1.f",
-__LINE__, -2.971013180028710e+22, "-2.971e+22", "%3.5g",
-__LINE__, -2.975167862441254e+07, "-2.97517e+07", "%g",
-__LINE__, -2.976018424339993e+16, "-2.976018e+16", "%3e",
-__LINE__, -2.979173094835454e+29, "-2.97917E+29", "%G",
-__LINE__, -2.983135249987541e-03, "-0.00298314", "%+G",
-__LINE__, -2.985142444917919e-24, "-2.985142E-24", "%+#7E",
-__LINE__, -2.988680953635159e-14, "-0.0000000", "%2.7f",
-__LINE__, -2.989629778079379e+04, "-29896.297781", "%f",
-__LINE__, -2.991274275137276e+19, "-29912742751372762839.423558", "%+4f",
-__LINE__, -2.991286396006024e-06, "-2.99129e-06", "%4g",
-__LINE__, -2.993310397844811e+04, "-2.993310E+04", "%3.6E",
-__LINE__, -2.994669852410861e-29, "-2.99467E-29", "%G",
-__LINE__, -2.996082093034831e+27, "-2.996082e+27", "%1e",
-__LINE__, -2.999783904575110e+16, "-2.999784E+16", "%#E",
-__LINE__, -3.012019221956988e+25, "-3.012019E+25", "%E",
-__LINE__, -3.014211917706622e-25, "-0.000000", "%+f",
-__LINE__, -3.015149723683428e-19, "-3.01515E-19", "%G",
-__LINE__, -3.022158478004638e-19, "-3.02216e-19", "%6g",
-__LINE__, -3.022825518373900e-12, "-3.0228E-12", "%+.4E",
-__LINE__, -3.025108924057340e-19, "-0.000000", "%f",
-__LINE__, -3.026316824631967e+24, "-3026316824631966717618070.106255", "%1f",
-__LINE__, -3.033074643529623e-13, "-3.03307e-13", "%g",
-__LINE__, -3.035292960731141e+24, "-3035292960731141409524980.190326", "%f",
-__LINE__, -3.043291272956732e-13, "-3.04329e-13", "%#g",
-__LINE__, -3.045216723973715e-23, "-3.045e-23", "%.4g",
-__LINE__, -3.047140976048835e+09, "-3.04714E+09", "%3.5E",
-__LINE__, -3.047680278470886e+09, "-3.047680E+09", "%#E",
-__LINE__, -3.048465807963461e+05, "-304847", "%g",
-__LINE__, -3.050904753556756e+22, "-3.0509E+22", "%G",
-__LINE__, -3.052845748999047e-13, "-3.05285e-13", "%g",
-__LINE__, -3.053395231883620e-06, "-3E-06", "%2.G",
-__LINE__, -3.054894203375445e-28, "-3e-28", "%2.g",
-__LINE__, -3.055080347760755e-13, "-0", "%2.f",
-__LINE__, -3.055513037393624e-29, "-3e-29", "%3.g",
-__LINE__, -3.056198778208295e-06, "-3.0562e-06", "%g",
-__LINE__, -3.057813660266980e-21, "-3E-21", "%1.G",
-__LINE__, -3.059687036330998e-11, "-3.1E-11", "%#2.2G",
-__LINE__, -3.061450385559094e-10, "-3.06145E-10", "%G",
-__LINE__, -3.066605713361383e-27, "-0.000000", "%f",
-__LINE__, -3.071590110813156e+22, "-3.07159E+22", "%G",
-__LINE__, -3.073253864426931e+26, "-3.0733E+26", "%.5G",
-__LINE__, -3.078998328596940e+07, "-3.079e+07", "%5.4g",
-__LINE__, -3.082733887951920e+06, "-3.082734e+06", "%+6e",
-__LINE__, -3.084365358064710e+24, "-3.084365E+24", "%#E",
-__LINE__, -3.086948022123716e+25, "-30869480221237162176350921.072299", "%+f",
-__LINE__, -3.088200214218024e-10, "-0", "%0.f",
-__LINE__, -3.093442983942874e+08, "-309344298.394287", "%f",
-__LINE__, -3.103573455403534e-09, "-3.103573E-09", "%#E",
-__LINE__, -3.109178443120997e+07, "-31091784.431210", "%f",
-__LINE__, -3.111494549914917e+28, "-3e+28", "%0.g",
-__LINE__, -3.113384020517480e-17, " -0", "%+6.f",
-__LINE__, -3.121622779718055e+14, "-312162277971805.491", "%+.3f",
-__LINE__, -3.122780443843900e-01, "-0.312278", "%#g",
-__LINE__, -3.122952438335638e-25, "-3.122952E-25", "%E",
-__LINE__, -3.128970339463168e-18, "-3e-18", "%3.g",
-__LINE__, -3.130862507719335e+10, "-3.130863e+10", "%3e",
-__LINE__, -3.145960838955379e+03, "-3145.96", "%g",
-__LINE__, -3.149362645138929e+21, "-3.14936e+21", "%g",
-__LINE__, -3.150697168664913e+26, "-315069716866491322804222363.629378", "%+f",
-__LINE__, -3.157946785041287e+05, "-3.1579e+05", "%.4e",
-__LINE__, -3.158347006986809e-02, "-3.E-02", "%#.0E",
-__LINE__, -3.159542871923388e+07, "-31595429", "%2.f",
-__LINE__, -3.169997512351985e+15, "-3.169998E+15", "%6.7G",
-__LINE__, -3.170971776544746e+07, "-31709717.765447", "%f",
-__LINE__, -3.173246079104466e+19, "-3.173246E+19", "%1E",
-__LINE__, -3.173581228658553e-02, "-0.03", "%+0.G",
-__LINE__, -3.187598864929850e-07, "-3.18760E-07", "%#G",
-__LINE__, -3.190525302270244e+08, "-3.190525e+08", "%+0.7g",
-__LINE__, -3.191879884186422e+19, "-3.19E+19", "%.2E",
-__LINE__, -3.197292604744926e+02, "-3.197293e+02", "%+e",
-__LINE__, -3.203713337688838e-12, "-3.20371E-12", "%6G",
-__LINE__, -3.204416889544914e-18, "-0.000000", "%+f",
-__LINE__, -3.204494471917096e+09, "-3.20449e+09", "%g",
-__LINE__, -3.211933195516720e+11, "-3.21193E+11", "%G",
-__LINE__, -3.214544021431917e-24, "-0.000000", "%1f",
-__LINE__, -3.215501229487004e-07, "-3e-07", "%3.e",
-__LINE__, -3.232157492322707e-13, "-3.E-13", "%+#5.G",
-__LINE__, -3.239074974455177e-05, "-3.239e-05", "%2.4g",
-__LINE__, -3.243083730801156e-24, "-3.243084e-24", "%#e",
-__LINE__, -3.243128583394124e+07, "-32431285.8339", "%6.4f",
-__LINE__, -3.247997999770571e-08, "-3e-08", "%5.e",
-__LINE__, -3.258251054563991e-15, "-3.2583E-15", "%.5G",
-__LINE__, -3.259499053187446e+07, "-3.2595E+07", "%5.6G",
-__LINE__, -3.261907782031174e+20, "-3.3e+20", "%.2g",
-__LINE__, -3.263979380855122e+29, "-3.26398E+29", "%G",
-__LINE__, -3.264166546402073e+06, "-3.26417E+06", "%5G",
-__LINE__, -3.269357648926951e+01, "-3.E+01", "%#5.G",
-__LINE__, -3.273523287028019e-30, "-3.27352e-30", "%g",
-__LINE__, -3.274464331526264e-14, "-3e-14", "%.0g",
-__LINE__, -3.276647049958546e+05, "-327664.7", "%+.1f",
-__LINE__, -3.276853612008326e-04, "-3.276854e-04", "%e",
-__LINE__, -3.288077788905925e+17, "-3.28808e+17", "%g",
-__LINE__, -3.292054327509010e+21, "-3.29205e+21", "%+g",
-__LINE__, -3.292086868337041e-16, " -0", "%7.f",
-__LINE__, -3.299368070005327e-17, "-3E-17", "%5.G",
-__LINE__, -3.307165537474566e-30, "-3e-30", "%+2.g",
-__LINE__, -3.310556325973673e-17, "-3.31056E-17", "%G",
-__LINE__, -3.315407318453138e-09, "-3.315407e-09", "%+#.6e",
-__LINE__, -3.318402800998018e-09, "-3.3184E-09", "%+G",
-__LINE__, -3.324277622889107e-04, "-0.000332428", "%G",
-__LINE__, -3.326372457131185e+14, "-3.326372e+14", "%0e",
-__LINE__, -3.333300611287597e+18, "-3.3E+18", "%4.2G",
-__LINE__, -3.333608976277018e-25, "-3.33361e-25", "%g",
-__LINE__, -3.333613056182724e-24, "-3.33361e-24", "%.5e",
-__LINE__, -3.338505874378410e-26, "-0.00000", "%.5f",
-__LINE__, -3.339838772519661e+24, "-3.3398E+24", "%0.5G",
-__LINE__, -3.354802735583258e-27, "-3.3548E-27", "%G",
-__LINE__, -3.356542080644329e+15, "-3356542080644329.129058", "%#f",
-__LINE__, -3.360027692463026e-29, "-3.36003e-29", "%+g",
-__LINE__, -3.361845657814323e+06, "-3361845.657814", "%f",
-__LINE__, -3.363135493765816e-12, " -0", "%5.f",
-__LINE__, -3.367383112102258e+19, "-33673831121022579360.158034", "%f",
-__LINE__, -3.376798505037497e+03, "-3376.8", "%+3G",
-__LINE__, -3.388170639372559e+09, "-3.388171e+09", "%+e",
-__LINE__, -3.397304185715499e-12, "-3.397304e-12", "%+e",
-__LINE__, -3.401559374016378e-13, "-3.40156e-13", "%g",
-__LINE__, -3.402651870178825e+21, "-3.40265e+21", "%+g",
-__LINE__, -3.410491213537530e+12, "-3.41049E+12", "%G",
-__LINE__, -3.411695570460075e-01, "-3.411696e-01", "%e",
-__LINE__, -3.417311435719220e+29, "-3.4E+29", "%3.1E",
-__LINE__, -3.417581063208165e-23, " -0", "%+4.f",
-__LINE__, -3.424005615113663e-28, "-0.000000", "%f",
-__LINE__, -3.424793585094130e-12, "-0.000000", "%f",
-__LINE__, -3.434733077762304e-05, "-3.43473e-05", "%g",
-__LINE__, -3.436384988494743e+08, "-3.43638E+08", "%G",
-__LINE__, -3.441082995163884e-21, "-0.000000", "%f",
-__LINE__, -3.442868661576827e-23, "-3.442869e-23", "%#.7g",
-__LINE__, -3.444337521046186e+13, "-3.44434E+13", "%#G",
-__LINE__, -3.448230173418967e-28, "-3.44823E-28", "%#G",
-__LINE__, -3.448523828225326e-21, "-3.4485e-21", "%.4e",
-__LINE__, -3.449876796754720e-07, "-3.44988e-07", "%g",
-__LINE__, -3.450163790411588e+25, "-34501637904115876054333966.749255", "%2f",
-__LINE__, -3.450224454406567e-26, "-3.450224E-26", "%#1E",
-__LINE__, -3.459930768422874e-28, "-3.46E-28", "%2.3G",
-__LINE__, -3.460730505022601e-28, "-3.46073e-28", "%#g",
-__LINE__, -3.462894265593946e-10, "-3.46289e-10", "%+#g",
-__LINE__, -3.464808359229496e+05, "-346481", "%6.6G",
-__LINE__, -3.467272303652620e-03, "-0.00346727", "%g",
-__LINE__, -3.468252706910251e+10, "-3.5E+10", "%#7.2G",
-__LINE__, -3.473623965680253e+27, "-3.47362e+27", "%g",
-__LINE__, -3.474527926009729e+11, "-3.475E+11", "%.4G",
-__LINE__, -3.476489048299929e+15, "-3.47649e+15", "%g",
-__LINE__, -3.477809698895344e-09, "-0.000", "%+.3f",
-__LINE__, -3.493008398637667e-28, " -0", "%+4.f",
-__LINE__, -3.497441286691613e+07, "-3.49744e+07", "%g",
-__LINE__, -3.500904660533358e+00, "-3.500905E+00", "%+1E",
-__LINE__, -3.504996054364915e+25, "-3.505e+25", "%+g",
-__LINE__, -3.507738629125434e-24, "-0.00", "%+4.2f",
-__LINE__, -3.508557770253211e-04, "-3.508558e-04", "%#6e",
-__LINE__, -3.516056824437550e+20, "-3.516057e+20", "%#e",
-__LINE__, -3.521102917733367e+02, "-352.11", "%g",
-__LINE__, -3.523948985825251e+10, "-3.52395e+10", "%+g",
-__LINE__, -3.525281835697895e-15, "-3.525282e-15", "%e",
-__LINE__, -3.534088845494570e-26, "-0.000000", "%2f",
-__LINE__, -3.541002442741569e+01, "-35.410", "%3.3f",
-__LINE__, -3.541126630345017e-19, "-3.541127e-19", "%e",
-__LINE__, -3.545277845967514e-17, "-0.000000", "%f",
-__LINE__, -3.560935430637329e-12, "-3.56094E-12", "%G",
-__LINE__, -3.564234584447659e-23, "-3.56423E-23", "%G",
-__LINE__, -3.576040378379921e-11, "-0.000000", "%+6f",
-__LINE__, -3.578133580350674e-05, "-3.578134e-05", "%#e",
-__LINE__, -3.584484015191491e-28, "-0.0", "%+2.1f",
-__LINE__, -3.591961845146752e+27, "-3.59196E+27", "%G",
-__LINE__, -3.602508380305001e+26, "-3.60251e+26", "%g",
-__LINE__, -3.603113449808132e+04, "-36031.134498", "%+3.6f",
-__LINE__, -3.605569849504628e+25, "-4E+25", "%6.G",
-__LINE__, -3.611297754851416e+05, "-361129.775485", "%+f",
-__LINE__, -3.613177909959201e-28, "-0.000000", "%f",
-__LINE__, -3.616261225230595e-01, "-0.361626", "%3g",
-__LINE__, -3.619203521536307e+09, "-3.6192E+09", "%G",
-__LINE__, -3.619316709131723e-27, "-0.0000000", "%.7f",
-__LINE__, -3.623100583082346e+28, "-3.6231E+28", "%+G",
-__LINE__, -3.626582653589919e+21, "-3626582653589918603387.332041", "%f",
-__LINE__, -3.626667540343067e-30, "-4.E-30", "%#.0G",
-__LINE__, -3.633539220625861e-30, "-3.634E-30", "%+.3E",
-__LINE__, -3.641655782149502e-11, "-3.64166E-11", "%G",
-__LINE__, -3.644523594046571e+25, "-3.64452e+25", "%5g",
-__LINE__, -3.645977605394108e+25, "-3.646e+25", "%+0.3e",
-__LINE__, -3.647864582248812e+13, "-4E+13", "%4.G",
-__LINE__, -3.655241667633056e-25, "-3.655242E-25", "%E",
-__LINE__, -3.662603655433297e+23, "-3.662604e+23", "%e",
-__LINE__, -3.668995445134158e+22, " -4E+22", "%7.G",
-__LINE__, -3.670006666569412e-11, "-3.670007e-11", "%e",
-__LINE__, -3.670510381138509e-24, "-3.670510e-24", "%e",
-__LINE__, -3.671283003268254e-20, "-3.67128E-20", "%G",
-__LINE__, -3.687760201176777e-13, "-3.68776E-13", "%G",
-__LINE__, -3.687983982100676e-14, "-0.00", "%.2f",
-__LINE__, -3.694808382827435e-12, "-3.694808E-12", "%#E",
-__LINE__, -3.696158520838821e+28, "-3.69616E+28", "%3G",
-__LINE__, -3.700911860811323e+18, "-3.70091e+18", "%+g",
-__LINE__, -3.701328314738669e+24, "-3.70133e+24", "%g",
-__LINE__, -3.707068461822151e-19, "-3.707068E-19", "%E",
-__LINE__, -3.710679411506914e+25, "-3.71068e+25", "%g",
-__LINE__, -3.713003840923896e-23, "-3.713e-23", "%7g",
-__LINE__, -3.717028397747828e-28, "-3.71703e-28", "%g",
-__LINE__, -3.728159642236442e+14, "-3.72816E+14", "%G",
-__LINE__, -3.731956233637010e+21, "-3.73196E+21", "%G",
-__LINE__, -3.742336623322610e+07, "-3.74234e+07", "%g",
-__LINE__, -3.748328269630045e+04, "-37483.3", "%G",
-__LINE__, -3.750803081283569e-27, "-3.7508E-27", "%+7G",
-__LINE__, -3.752021500826652e-04, "-0.0004", "%.1G",
-__LINE__, -3.755942257004103e-12, "-3.75594E-12", "%G",
-__LINE__, -3.765921235889045e+03, " -4e+03", "%+7.g",
-__LINE__, -3.772453135667801e-28, "-3.77245E-28", "%G",
-__LINE__, -3.776384200230367e+27, "-3.776e+27", "%1.4g",
-__LINE__, -3.787035870684945e-25, "-4E-25", "%+3.G",
-__LINE__, -3.798616350818839e-29, "-3.7986164e-29", "%.7e",
-__LINE__, -3.807178315238428e-15, "-0.000000", "%+#6f",
-__LINE__, -3.822059837967635e+18, "-3822059837967634621.236357", "%6.6f",
-__LINE__, -3.823553096022006e+12, "-3.82355e+12", "%g",
-__LINE__, -3.839198115259428e-23, "-0.000000", "%f",
-__LINE__, -3.846953640321746e+02, "-3.846954E+02", "%E",
-__LINE__, -3.852230696542361e+08, "-3.8522e+08", "%#.5g",
-__LINE__, -3.861139362195314e-25, "-3.86114E-25", "%2G",
-__LINE__, -3.873388618099769e+09, "-3873388618", "%0.0f",
-__LINE__, -3.874161550543817e+15, "-3.874162e+15", "%+e",
-__LINE__, -3.874527935469425e+20, "-3.87E+20", "%3.3G",
-__LINE__, -3.878069577893697e-30, "-3.878070E-30", "%#E",
-__LINE__, -3.878852490397702e-20, "-3.87885e-20", "%g",
-__LINE__, -3.879688342272101e-10, "-0.00", "%#4.2f",
-__LINE__, -3.879797428399897e+03, "-3880", "%1.4g",
-__LINE__, -3.881588804766756e+00, "-3.9", "%+4.2G",
-__LINE__, -3.889377318111182e+01, "-38.8938", "%+.4f",
-__LINE__, -3.893444523430385e-03, "-0.004", "%+2.g",
-__LINE__, -3.894912141515856e+03, "-3894.91", "%+g",
-__LINE__, -3.905279115773667e+04, "-39052.791158", "%f",
-__LINE__, -3.905333955484919e-20, "-3.90533E-20", "%G",
-__LINE__, -3.906559442060730e+27, "-3906559442060730447110472596.250474", "%f",
-__LINE__, -3.909396469655334e-26, "-3.91E-26", "%.3G",
-__LINE__, -3.920132491092364e+11, "-3.92013e+11", "%g",
-__LINE__, -3.935651497471973e+27, "-3935651497471972604103029880", "%5.f",
-__LINE__, -3.939742577853889e-03, "-0.004", "%5.G",
-__LINE__, -3.943284017088198e+19, "-39432840170881981123.3", "%.1f",
-__LINE__, -3.947452186327660e+09, "-3947452186.33", "%0.2f",
-__LINE__, -3.951967237553488e+18, "-3951967237553488132.562052", "%f",
-__LINE__, -3.953673427359789e-28, "-3.954E-28", "%3.4G",
-__LINE__, -3.956044867371602e+23, "-4e+23", "%+6.1g",
-__LINE__, -3.965038994251913e-20, "-3.96504e-20", "%g",
-__LINE__, -3.970527677577937e+05, "-4.e+05", "%#0.1g",
-__LINE__, -3.970717822164395e-20, "-3.970718e-20", "%6e",
-__LINE__, -3.978063834438912e-19, "-3.97806E-19", "%G",
-__LINE__, -3.982705395472599e+27, "-3.9827e+27", "%#.5g",
-__LINE__, -3.983486821352571e-28, "-3.98349e-28", "%g",
-__LINE__, -3.985470630230926e-14, "-4e-14", "%.2g",
-__LINE__, -3.993095662863953e-16, "-3.993096e-16", "%e",
-__LINE__, -4.006984141314271e-22, " -4e-22", "%7.2g",
-__LINE__, -4.006984141314271e-22, "-4.0e-22", "%#7.2g",
-__LINE__, -4.013226099863981e+06, "-4.013226E+06", "%+E",
-__LINE__, -4.013702226581167e+00, "-4.0137022", "%+#3.7f",
-__LINE__, -4.017598274642537e+11, "-4E+11", "%5.G",
-__LINE__, -4.021385792825529e-09, " -4e-09", "%7.2g",
-__LINE__, -4.024099064819937e-20, "-4.0241E-20", "%+G",
-__LINE__, -4.026952473441366e+22, "-4.026952e+22", "%6.7g",
-__LINE__, -4.027636677087866e+12, "-4.02764E+12", "%G",
-__LINE__, -4.036506013049443e+17, "-4.03651e+17", "%0.6g",
-__LINE__, -4.063191953523012e-06, " -0.0", "%6.1f",
-__LINE__, -4.070953223475192e-23, "-4.07095E-23", "%G",
-__LINE__, -4.072425833070524e+09, "-4.072426E+09", "%E",
-__LINE__, -4.086025576759603e+12, "-4.086026e+12", "%e",
-__LINE__, -4.086627783296081e-24, "-4.087E-24", "%.3E",
-__LINE__, -4.086683676772144e+10, "-40866836767.721439", "%f",
-__LINE__, -4.087336043219081e-10, "-0.", "%+#0.f",
-__LINE__, -4.125162973336809e-26, "-4.125163E-26", "%.7G",
-__LINE__, -4.150753797717075e-10, "-4.2e-10", "%.2g",
-__LINE__, -4.152126152181912e+23, "-4.15213e+23", "%g",
-__LINE__, -4.164458223079432e-07, "-4.164458E-07", "%E",
-__LINE__, -4.170624866130099e+03, "-4170.624866", "%4.6f",
-__LINE__, -4.171137277374942e-01, " -4E-01", "%+7.E",
-__LINE__, -4.176067421901769e-25, "-4.17607E-25", "%G",
-__LINE__, -4.179514418604771e+24, "-4.1795e+24", "%3.5g",
-__LINE__, -4.196285183415621e+23, "-4.19629E+23", "%5G",
-__LINE__, -4.198600486581023e+23, "-4E+23", "%+4.G",
-__LINE__, -4.199020494598538e-16, "-0.000000", "%+f",
-__LINE__, -4.207824153501688e-01, "-0.420782", "%G",
-__LINE__, -4.219086441294006e-13, " -0", "%+4.f",
-__LINE__, -4.223689582765525e+12, "-4.22369e+12", "%g",
-__LINE__, -4.230213377391093e+04, "-42302.1", "%+2.6G",
-__LINE__, -4.232495358100605e-02, "-0.042325", "%+f",
-__LINE__, -4.235459662515940e-29, "-0.000000", "%f",
-__LINE__, -4.240807508057296e-07, "-4e-07", "%0.g",
-__LINE__, -4.248376819122346e-13, "-4.248377e-13", "%7e",
-__LINE__, -4.251361939638334e-23, "-4.251362E-23", "%E",
-__LINE__, -4.253044333568077e+24, "-4.253044e+24", "%4e",
-__LINE__, -4.255728039119772e-30, "-4.25573E-30", "%2G",
-__LINE__, -4.256502531648988e+02, "-425.65", "%G",
-__LINE__, -4.260731632612400e-04, "-0", "%2.f",
-__LINE__, -4.262037138254753e-25, "-4e-25", "%5.g",
-__LINE__, -4.270910126379393e+00, "-4.2709", "%#7.4f",
-__LINE__, -4.273844276097008e-09, " -0.", "%#4.f",
-__LINE__, -4.280424136111831e+21, "-4.280E+21", "%.3E",
-__LINE__, -4.284351940366486e-23, "-0.000000", "%+f",
-__LINE__, -4.291747881693517e-29, "-4.3e-29", "%+#.2g",
-__LINE__, -4.298346825232928e+04, "-42983.5", "%G",
-__LINE__, -4.298879924365432e+28, "-42988799243654316484253286034.800112", "%f",
-__LINE__, -4.302192665689887e-25, "-0.000000", "%f",
-__LINE__, -4.303899568112784e+06, "-4E+06", "%1.G",
-__LINE__, -4.307399960278190e-30, "-4.31e-30", "%.3g",
-__LINE__, -4.341161949359232e+01, "-43.411619", "%+f",
-__LINE__, -4.353334435604675e+17, " -4e+17", "%+7.g",
-__LINE__, -4.354760231068195e+08, "-4e+08", "%2.e",
-__LINE__, -4.363535913318519e+08, "-4.363536E+08", "%+7E",
-__LINE__, -4.365389605557404e-29, "-4.365390e-29", "%e",
-__LINE__, -4.369278570829168e-22, "-4.369279E-22", "%5E",
-__LINE__, -4.372187639240662e-11, "-4.37219e-11", "%+g",
-__LINE__, -4.374221079233858e-15, "-4.37422E-15", "%4.6G",
-__LINE__, -4.374840292001664e-13, "-0.000000", "%+f",
-__LINE__, -4.376554800103945e+16, "-43765548001039453.751559", "%f",
-__LINE__, -4.376659235899513e+07, "-4.4E+07", "%0.2G",
-__LINE__, -4.377316129868239e-06, "-4.37732E-06", "%+5G",
-__LINE__, -4.380028480226885e+21, "-4e+21", "%1.0e",
-__LINE__, -4.380434965450223e+16, "-43804349654502230.393405", "%f",
-__LINE__, -4.392477080355168e-15, "-4E-15", "%+2.G",
-__LINE__, -4.396120020536161e+17, "-439612002053616102.159594", "%#f",
-__LINE__, -4.400993154571784e+13, "-44009931545717.844159", "%f",
-__LINE__, -4.402873692051930e-26, "-4.4e-26", "%5.3g",
-__LINE__, -4.405330274903779e+24, "-4405330274903779042006135.568954", "%+5f",
-__LINE__, -4.406272291312090e+06, "-4.40627e+06", "%+g",
-__LINE__, -4.407065949816988e-13, "-0.000000", "%f",
-__LINE__, -4.408295597674563e-10, "-4.4083e-10", "%g",
-__LINE__, -4.417553815178214e-30, "-4.41755E-30", "%G",
-__LINE__, -4.428894120469459e+16, "-4.42889e+16", "%g",
-__LINE__, -4.433747825142046e+04, "-4.433748e+04", "%#e",
-__LINE__, -4.435051082856639e+11, "-4.43505E+11", "%G",
-__LINE__, -4.445045573007259e-27, "-4.445e-27", "%.5g",
-__LINE__, -4.447791368960968e-25, " -4e-25", "%+7.g",
-__LINE__, -4.449691386526521e-11, "-4.44969e-11", "%g",
-__LINE__, -4.451399093849402e+06, "-4.e+06", "%#0.e",
-__LINE__, -4.453753130320864e-22, "-4E-22", "%6.E",
-__LINE__, -4.455910780463539e+00, "-4", "%2.g",
-__LINE__, -4.464935674747308e+25, "-4.46494e+25", "%g",
-__LINE__, -4.469759565657550e-29, "-4.46976e-29", "%g",
-__LINE__, -4.473254139442931e+14, "-4E+14", "%3.1G",
-__LINE__, -4.480844704930373e-04, "-0.000448", "%5.6f",
-__LINE__, -4.484177356024563e+19, "-4.484177E+19", "%E",
-__LINE__, -4.488115678357666e-13, "-4.48812e-13", "%g",
-__LINE__, -4.491545112281561e+12, "-4.491545E+12", "%E",
-__LINE__, -4.492547433553077e-23, "-4.49255e-23", "%g",
-__LINE__, -4.492701755830813e-05, "-0.000045", "%f",
-__LINE__, -4.497405935096372e-02, "-4.497406e-02", "%e",
-__LINE__, -4.502764260212887e+21, "-4.50276E+21", "%G",
-__LINE__, -4.511984199938207e+29, "-451198419993820731832556703011.505306", "%f",
-__LINE__, -4.514517861504637e-13, "-4.51452e-13", "%g",
-__LINE__, -4.525577218881990e+24, "-4.5e+24", "%2.2g",
-__LINE__, -4.549244580903896e-26, "-5E-26", "%2.G",
-__LINE__, -4.569192488002113e-29, "-5E-29", "%3.G",
-__LINE__, -4.572011438847734e+17, "-4.57e+17", "%#.3g",
-__LINE__, -4.573010973514519e-08, "-4.57301e-08", "%+7g",
-__LINE__, -4.584534976177852e-04, "-0.000458453", "%7g",
-__LINE__, -4.584729895132228e-21, "-0.000000", "%4f",
-__LINE__, -4.585259328217483e-30, "-4.58526E-30", "%+#4.6G",
-__LINE__, -4.589603063610410e-04, "-4.589603E-04", "%+E",
-__LINE__, -4.592428795671033e+22, " -5e+22", "%7.g",
-__LINE__, -4.595683678223830e-20, " -0", "%5.f",
-__LINE__, -4.602585606100101e+05, "-4.602586E+05", "%E",
-__LINE__, -4.603375306660027e-08, "-5E-08", "%+6.G",
-__LINE__, -4.611341343728034e-18, "-4.611341e-18", "%5e",
-__LINE__, -4.613608487855863e+05, "-461361", "%6g",
-__LINE__, -4.615997775774194e-24, "-4.61600e-24", "%#g",
-__LINE__, -4.620310950564759e+23, "-462031095056475926696749", "%1.0f",
-__LINE__, -4.620645693595563e-10, "-4.6206457e-10", "%.7e",
-__LINE__, -4.621527706233292e-09, "-4.621528e-09", "%#e",
-__LINE__, -4.625215210297273e-13, "-4.62522E-13", "%G",
-__LINE__, -4.636755152220100e-29, "-0.000000", "%#f",
-__LINE__, -4.641203877508087e+23, "-4.6412e+23", "%0g",
-__LINE__, -4.648627249239175e+23, "-4.65E+23", "%+0.3G",
-__LINE__, -4.662546890623409e-10, "-4.663E-10", "%.3E",
-__LINE__, -4.664488650292317e-27, "-4.66449e-27", "%#g",
-__LINE__, -4.668715685060282e+08, "-466871568.50603", "%.5f",
-__LINE__, -4.673332851657081e-18, "-4.7e-18", "%#5.2g",
-__LINE__, -4.683361436174074e+24, "-4.68e+24", "%#.2e",
-__LINE__, -4.693748680461066e-01, "-0.469375", "%G",
-__LINE__, -4.697110010549124e+23, "-4.69711E+23", "%G",
-__LINE__, -4.710442739966989e+06, "-4.710443e+06", "%2e",
-__LINE__, -4.713427678642280e-09, "-4.71343e-09", "%g",
-__LINE__, -4.721999055940316e-04, "-4.721999e-04", "%#1e",
-__LINE__, -4.724262200578540e+17, "-472426220057853996.081576", "%+f",
-__LINE__, -4.733267644288093e+01, "-4.733268e+01", "%7e",
-__LINE__, -4.742854711396110e-11, "-0.000000", "%f",
-__LINE__, -4.757456106385936e+23, "-4.75746e+23", "%g",
-__LINE__, -4.770895495642298e+27, "-4770895495642298200777986494.358629", "%2f",
-__LINE__, -4.775073456318149e+29, "-4.775073E+29", "%#E",
-__LINE__, -4.779997387204258e+17, "-4.78e+17", "%g",
-__LINE__, -4.799264315770707e-23, "-4.799264E-23", "%+.7G",
-__LINE__, -4.814277930599660e+10, "-5e+10", "%2.1g",
-__LINE__, -4.818413387018612e+05, "-5e+05", "%.0g",
-__LINE__, -4.818827195107612e-16, "-4.818827e-16", "%e",
-__LINE__, -4.841524514024803e+21, "-4.84152E+21", "%G",
-__LINE__, -4.860585077313477e+10, "-4.86059E+10", "%+G",
-__LINE__, -4.870037451948589e+28, "-48700374519485887248038125107.996166", "%f",
-__LINE__, -4.888835952705153e-28, "-4.888836E-28", "%+E",
-__LINE__, -4.893523355754114e-19, "-4.893523e-19", "%.6e",
-__LINE__, -4.906070260482585e+17, "-490607026048258454", "%+.0f",
-__LINE__, -4.907734144101900e+25, "-5E+25", "%+.1G",
-__LINE__, -4.917899547741841e-25, "-4.917900e-25", "%e",
-__LINE__, -4.923348512538722e+25, "-49233485125387215219916470.232420", "%+.6f",
-__LINE__, -4.926052630078460e-26, "-4.926053e-26", "%e",
-__LINE__, -4.926751662051156e+14, "-4.927E+14", "%+5.3E",
-__LINE__, -4.928017952199046e-12, "-0.000000", "%f",
-__LINE__, -4.944296782981195e-21, "-4.9443E-21", "%1.5G",
-__LINE__, -4.947320427183599e-19, "-4.947320e-19", "%.6e",
-__LINE__, -4.968188938972135e+17, "-4.96819E+17", "%G",
-__LINE__, -4.968756725758674e+05, "-496876", "%G",
-__LINE__, -4.968788759793340e-26, "-4.97E-26", "%.3G",
-__LINE__, -4.983904999913364e-24, "-5E-24", "%0.G",
-__LINE__, -4.985209496522767e+23, "-4.985209e+23", "%e",
-__LINE__, -4.987363880732866e+08, "-4.98736E+08", "%G",
-__LINE__, -4.989754940144973e+05, "-498975.494014", "%f",
-__LINE__, -4.998203870733718e-25, "-4.9982e-25", "%g",
-__LINE__, -4.999153445016792e-27, "-5e-27", "%+1.e",
-__LINE__, -5.002693488258108e+06, " -5e+06", "%+7.g",
-__LINE__, -5.017958458603783e+05, "-5.0179585E+05", "%+.7E",
-__LINE__, -5.028902178573363e-12, "-5.0289e-12", "%0g",
-__LINE__, -5.032337536971444e+07, "-50323375.369714", "%f",
-__LINE__, -5.036525516370473e-24, "-5.0365e-24", "%4.5g",
-__LINE__, -5.038642321515756e+18, "-5038642321515755639.893541", "%f",
-__LINE__, -5.051003516976770e-14, "-5.051E-14", "%+G",
-__LINE__, -5.051196143816789e+27, "-5.0512e+27", "%g",
-__LINE__, -5.057372886713786e+28, "-5.057373e+28", "%#e",
-__LINE__, -5.057475029459727e+12, "-5.05748e+12", "%+g",
-__LINE__, -5.068286816124670e-17, "-5.068E-17", "%5.3E",
-__LINE__, -5.070475165759468e-12, "-0.000000", "%4.6f",
-__LINE__, -5.081352543220476e+20, "-5.081E+20", "%.3E",
-__LINE__, -5.084398319179363e+11, "-508439831917.936313", "%#f",
-__LINE__, -5.085781220648484e+05, "-5.E+05", "%+#7.G",
-__LINE__, -5.094941054632498e-24, "-5.09494E-24", "%+G",
-__LINE__, -5.100059596310871e-10, "-5.10006e-10", "%3.6g",
-__LINE__, -5.103072553594136e-01, "-0.5", "%+1.g",
-__LINE__, -5.106319890388412e+08, "-5.106320e+08", "%4e",
-__LINE__, -5.107120687977690e+09, "-5107120687.977690", "%f",
-__LINE__, -5.119910716893161e-13, "-5.11991E-13", "%6G",
-__LINE__, -5.127594569425709e-29, "-5.12759e-29", "%#g",
-__LINE__, -5.130365585632797e+29, "-5.13037e+29", "%#g",
-__LINE__, -5.131415638022112e+08, "-513141563.802211", "%0f",
-__LINE__, -5.144703216335916e-23, "-5.1447e-23", "%g",
-__LINE__, -5.152511923201882e-05, "-5.15251E-05", "%+G",
-__LINE__, -5.165484448280190e-12, " -0.0", "%5.1f",
-__LINE__, -5.179220760465737e-20, "-5e-20", "%+5.g",
-__LINE__, -5.183005119662180e-10, "-5.183005E-10", "%+E",
-__LINE__, -5.199587953258117e+13, "-5.19959e+13", "%6g",
-__LINE__, -5.202041951844580e-25, "-0.000000", "%f",
-__LINE__, -5.202836038621740e+00, "-5.20284", "%G",
-__LINE__, -5.212204099528552e-11, "-5.2122e-11", "%.6g",
-__LINE__, -5.225617726710534e+17, "-522561772671053414.995868", "%+f",
-__LINE__, -5.230162003281426e+25, "-52301620032814257754694153.84578", "%+6.5f",
-__LINE__, -5.251849429321286e-11, "-5.25185e-11", "%g",
-__LINE__, -5.265174939930368e+23, "-5.265175E+23", "%1.6E",
-__LINE__, -5.271218134351422e+21, "-5.27122e+21", "%+1g",
-__LINE__, -5.273823357545750e+17, "-527382335754575048.980541", "%f",
-__LINE__, -5.279848797214957e+11, "-527984879721.495659", "%0f",
-__LINE__, -5.281551888625290e+11, "-5e+11", "%4.g",
-__LINE__, -5.281780377142961e-24, "-5.28178e-24", "%g",
-__LINE__, -5.292125782379512e+03, "-5292.125782", "%f",
-__LINE__, -5.292401691410388e+15, "-5292401691410387.520875", "%f",
-__LINE__, -5.305120752102265e-25, "-5.30512e-25", "%+#.5e",
-__LINE__, -5.317975791704413e+16, "-5.31798e+16", "%+g",
-__LINE__, -5.336522843607233e+27, "-5.33652e+27", "%#6g",
-__LINE__, -5.342016438000917e-05, " -5e-05", "%+7.e",
-__LINE__, -5.351122291549103e+06, "-5351122.291549", "%+0f",
-__LINE__, -5.352043956303597e+00, "-5.35204", "%g",
-__LINE__, -5.353582488767747e+09, "-5.354E+09", "%7.3E",
-__LINE__, -5.383420177718380e+04, "-5e+04", "%1.e",
-__LINE__, -5.384320189791882e-10, "-5.384320e-10", "%e",
-__LINE__, -5.409487543257379e-12, "-5.40949E-12", "%G",
-__LINE__, -5.418395794776773e+23, "-5.4184e+23", "%g",
-__LINE__, -5.419918795921525e-09, "-0.000000", "%+f",
-__LINE__, -5.422374157832442e+11, "-5.42237e+11", "%3g",
-__LINE__, -5.426916951577001e-27, "-5.42692E-27", "%+G",
-__LINE__, -5.430058833461779e+28, "-5.43006E+28", "%G",
-__LINE__, -5.444433348653147e+23, "-5.444433E+23", "%E",
-__LINE__, -5.446560186537024e+09, "-5.446560E+09", "%E",
-__LINE__, -5.464243500152188e+27, "-5.46424E+27", "%G",
-__LINE__, -5.464427517531742e+20, "-546442751753174249529.365625", "%f",
-__LINE__, -5.465783705970954e+05, "-5E+05", "%1.E",
-__LINE__, -5.475138077475789e-11, "-5e-11", "%.0e",
-__LINE__, -5.475302250616576e+10, "-54753022506.1658", "%.4f",
-__LINE__, -5.488964905442472e+09, "-5.48896e+09", "%g",
-__LINE__, -5.492508526846316e-08, "-5.49251e-08", "%.6g",
-__LINE__, -5.520533408804846e-15, "-5.520533e-15", "%e",
-__LINE__, -5.532744688447266e+28, "-55327446884472664123677532188.594341", "%2.6f",
-__LINE__, -5.535834653450131e-14, "-5.5e-14", "%0.1e",
-__LINE__, -5.554344735392882e-02, "-5.554345E-02", "%+#E",
-__LINE__, -5.555497334515501e-17, "-5.5555e-17", "%g",
-__LINE__, -5.558304303221977e+14, "-555830430322197.699411", "%f",
-__LINE__, -5.562210815777694e-05, "-5.562211E-05", "%#1E",
-__LINE__, -5.564800722538402e-09, "-5.56480e-09", "%#.6g",
-__LINE__, -5.567143271590439e-01, "-5.567143e-01", "%#e",
-__LINE__, -5.568606044396186e+01, "-55.6861", "%4g",
-__LINE__, -5.592027856401721e+12, "-5.592028e+12", "%.7g",
-__LINE__, -5.592295342565443e+22, "-6.E+22", "%#3.G",
-__LINE__, -5.600007421926053e+07, "-56000074.219261", "%1f",
-__LINE__, -5.601444553155006e-12, "-5.60144E-12", "%G",
-__LINE__, -5.605128912835080e-03, "-0.005605", "%+f",
-__LINE__, -5.610950285679577e+19, "-5.61095E+19", "%G",
-__LINE__, -5.622074657679467e+11, "-562207465767.946690", "%f",
-__LINE__, -5.627358352391656e-01, "-0.6", "%1.g",
-__LINE__, -5.627974317622488e-02, "-5.627974e-02", "%+e",
-__LINE__, -5.629497696447229e+27, "-5.629E+27", "%+.4G",
-__LINE__, -5.631383567258576e-29, "-5.63138e-29", "%0g",
-__LINE__, -5.635241327177333e-18, "-5.63524E-18", "%G",
-__LINE__, -5.644819783138381e+06, "-5.644820E+06", "%#E",
-__LINE__, -5.648538459114833e+26, "-564853845911483265496144667.849876", "%+f",
-__LINE__, -5.649004865848537e+00, "-5.649", "%g",
-__LINE__, -5.653403316885170e+23, "-6E+23", "%2.0E",
-__LINE__, -5.656109962244926e-18, "-0.000000", "%f",
-__LINE__, -5.674988031695793e+22, "-5.674988E+22", "%+.7G",
-__LINE__, -5.686380226400881e-22, "-0.000000", "%f",
-__LINE__, -5.698840855829442e-14, "-5.69884E-14", "%G",
-__LINE__, -5.707036642649580e+03, "-5707.036643", "%f",
-__LINE__, -5.710344882278847e+11, "-5.71034E+11", "%+G",
-__LINE__, -5.714852196401017e+19, "-5.71485E+19", "%+G",
-__LINE__, -5.720153622156089e-22, "-5.72015E-22", "%G",
-__LINE__, -5.722366011976922e+26, "-5.72237e+26", "%+g",
-__LINE__, -5.722909928097404e+12, "-5.72291E+12", "%2G",
-__LINE__, -5.725325961787777e-25, "-5.72533e-25", "%g",
-__LINE__, -5.727138241052646e+19, "-5.72714e+19", "%+#g",
-__LINE__, -5.734025840446336e+14, "-5.73403e+14", "%+g",
-__LINE__, -5.736469106710259e-05, "-0.000057", "%.6f",
-__LINE__, -5.755099153733116e-14, "-5.7551e-14", "%+g",
-__LINE__, -5.758411844890947e-20, "-6E-20", "%+6.G",
-__LINE__, -5.760350214122813e+03, "-5760.35", "%+g",
-__LINE__, -5.768009192512392e-30, "-0", "%1.f",
-__LINE__, -5.772343286693103e+07, "-5.77234E+07", "%G",
-__LINE__, -5.776693265471852e-27, "-5.776693E-27", "%E",
-__LINE__, -5.779682861172754e-28, "-5.779683e-28", "%e",
-__LINE__, -5.789953490749936e+26, "-578995349074993637117358957.76656", "%5.5f",
-__LINE__, -5.796771264754334e+04, "-57967.7", "%g",
-__LINE__, -5.804788370597286e-02, "-5.80479E-02", "%+#1.5E",
-__LINE__, -5.805343475329215e-13, "-5.80534e-13", "%g",
-__LINE__, -5.809853913830122e+09, "-5809853914", "%+0.f",
-__LINE__, -5.817313814570609e-30, " -0", "%7.0f",
-__LINE__, -5.831708441750138e+00, "-5.83171", "%#g",
-__LINE__, -5.846914550593652e+29, "-5.846915e+29", "%e",
-__LINE__, -5.851455214762288e+04, "-58514.6", "%+G",
-__LINE__, -5.855803663871393e-23, "-6E-23", "%5.E",
-__LINE__, -5.858065129988470e+10, "-5.85807e+10", "%+g",
-__LINE__, -5.863147168075411e-14, "-5.86315e-14", "%+g",
-__LINE__, -5.878936740266680e-04, "-0.000587894", "%g",
-__LINE__, -5.887654893386630e+25, "-58876548933866299506689756.526612", "%#f",
-__LINE__, -5.889416409731902e-02, "-0.06", "%5.g",
-__LINE__, -5.897630195029892e-18, "-5.897630E-18", "%#0.7G",
-__LINE__, -5.898506808456422e-19, "-5.89851E-19", "%G",
-__LINE__, -5.901768645393515e+29, "-5.90177E+29", "%+G",
-__LINE__, -5.907529093570369e+10, "-59075290935.703695", "%f",
-__LINE__, -5.910069365260240e+13, "-59100693652602.39849", "%+#5.5f",
-__LINE__, -5.915678929676435e-07, "-0.000001", "%+f",
-__LINE__, -5.922232380131716e-01, "-0.592223", "%+3f",
-__LINE__, -5.923716473994306e+19, "-5.92372E+19", "%+#.6G",
-__LINE__, -5.929950428920404e-15, "-5.929950e-15", "%+e",
-__LINE__, -5.949552735665802e+26, "-5.94955e+26", "%#g",
-__LINE__, -5.949977081310732e-02, "-0.059500", "%f",
-__LINE__, -5.954520303889356e-07, "-5.954520E-07", "%5E",
-__LINE__, -5.978861337429145e-13, "-6E-13", "%1.G",
-__LINE__, -5.980539445081087e+15, "-5.98054E+15", "%.6G",
-__LINE__, -5.981724990853490e-03, " -0.006", "%#7.g",
-__LINE__, -5.989488907825821e+03, "-6E+03", "%.2G",
-__LINE__, -5.998272294890842e+06, "-6.00E+06", "%4.2E",
-__LINE__, -6.023775731455919e-29, "-6.023776e-29", "%e",
-__LINE__, -6.028153126666870e-05, "-6.e-05", "%+#6.e",
-__LINE__, -6.036200621484690e+25, "-6e+25", "%2.2g",
-__LINE__, -6.036400640928137e-14, "-6.036401e-14", "%e",
-__LINE__, -6.038198451098329e-20, "-6.038198e-20", "%1.7g",
-__LINE__, -6.045778975641123e-15, "-6.04578E-15", "%G",
-__LINE__, -6.046038904252073e+00, "-6.04604", "%g",
-__LINE__, -6.082158462782175e-06, "-0.000006", "%+#f",
-__LINE__, -6.106162726644904e+10, "-6.10616e+10", "%g",
-__LINE__, -6.126345215489182e+10, "-6e+10", "%+1.g",
-__LINE__, -6.131852309620571e+02, "-6e+02", "%4.e",
-__LINE__, -6.134589313243809e-01, "-0.613459", "%+#f",
-__LINE__, -6.142358153783462e-10, "-6.14236E-10", "%4G",
-__LINE__, -6.151524334856263e+27, "-6151524334856262932191839354.345575", "%+6f",
-__LINE__, -6.156818333724550e+04, "-6.e+04", "%#.1g",
-__LINE__, -6.166172551433993e+24, "-6166172551433993120895138.4178", "%5.4f",
-__LINE__, -6.169532428006014e-09, "-6.16953e-09", "%3g",
-__LINE__, -6.172019382601770e-28, "-0.000000", "%+f",
-__LINE__, -6.174496985807155e-09, "-6.1745E-09", "%G",
-__LINE__, -6.186771845105751e+04, "-61867.7", "%G",
-__LINE__, -6.200817973780066e+22, "-6.20082E+22", "%3G",
-__LINE__, -6.218004335456301e-22, "-0.000000", "%+f",
-__LINE__, -6.219009630546262e-18, "-6.22e-18", "%6.3g",
-__LINE__, -6.242532875230618e-06, "-0.000006", "%7f",
-__LINE__, -6.243612261280864e+14, "-6.24361e+14", "%.6g",
-__LINE__, -6.243689597320126e+10, "-6e+10", "%.0e",
-__LINE__, -6.244620667090527e+04, "-6e+04", "%6.e",
-__LINE__, -6.250789625572054e-09, "-0.000000", "%+f",
-__LINE__, -6.253537566219164e+01, "-63.", "%#1.f",
-__LINE__, -6.284420289484166e+21, "-6.2844203e+21", "%7.7e",
-__LINE__, -6.285939888202846e+27, "-6e+27", "%+.0g",
-__LINE__, -6.290025777678105e+13, "-6E+13", "%2.E",
-__LINE__, -6.291364254323924e+10, "-6.3E+10", "%3.2G",
-__LINE__, -6.292428812164449e+15, "-6292428812164448.714839", "%.6f",
-__LINE__, -6.292600606358002e+29, "-6.29260E+29", "%#G",
-__LINE__, -6.292739629144148e-15, "-6.292740E-15", "%E",
-__LINE__, -6.296471626465745e+28, "-6.29647E+28", "%G",
-__LINE__, -6.299575066640315e+27, "-6.300E+27", "%.3E",
-__LINE__, -6.315234679394876e-24, "-6E-24", "%2.G",
-__LINE__, -6.320883246383228e-01, "-0.632088", "%2g",
-__LINE__, -6.324938413548937e-11, "-6e-11", "%.1g",
-__LINE__, -6.336312983176250e+04, "-6.336313e+04", "%e",
-__LINE__, -6.341786787214541e+06, "-6.341787E+06", "%+7.6E",
-__LINE__, -6.360189291106185e-15, "-0.0000000", "%#.7f",
-__LINE__, -6.364818355457748e-15, "-0.0000000", "%1.7f",
-__LINE__, -6.366291103431814e+04, "-63662.9", "%#G",
-__LINE__, -6.366334042923153e-05, "-6.37e-05", "%5.3g",
-__LINE__, -6.370477455143194e-12, "-0.000000", "%f",
-__LINE__, -6.372829256546279e+23, "-6.37283E+23", "%G",
-__LINE__, -6.375208490193110e-23, "-6.37521e-23", "%4.5e",
-__LINE__, -6.382595100891736e-24, "-6.3826E-24", "%5G",
-__LINE__, -6.396882421146790e-22, "-6.39688e-22", "%+g",
-__LINE__, -6.407190354039938e+08, "-6.40719e+08", "%+g",
-__LINE__, -6.408581541430886e-10, "-6.E-10", "%#0.0G",
-__LINE__, -6.409206904981703e-03, "-0.006", "%+.0G",
-__LINE__, -6.416106714707772e+26, "-641610671470777216285341637.558304", "%f",
-__LINE__, -6.417436981761998e-04, "-0.000642", "%+#f",
-__LINE__, -6.429997249673124e+11, "-642999724967.312414", "%#f",
-__LINE__, -6.440827429825250e+16, "-6.44083E+16", "%G",
-__LINE__, -6.444869858444955e+02, "-6e+02", "%6.g",
-__LINE__, -6.471701890976228e-25, " -6e-25", "%7.1g",
-__LINE__, -6.485393161670371e-12, "-6.485393e-12", "%.6e",
-__LINE__, -6.487710907063584e+23, "-6.E+23", "%#3.E",
-__LINE__, -6.492942931343439e-08, "-0.", "%+#2.0f",
-__LINE__, -6.496010652113223e+18, "-6.49601e+18", "%g",
-__LINE__, -6.502856921840228e+22, "-6.50286e+22", "%4g",
-__LINE__, -6.523559906055000e-10, "-6.52356E-10", "%.6G",
-__LINE__, -6.525899074126662e+04, "-6.5e+04", "%+.1e",
-__LINE__, -6.532216801155521e-09, "-6.53222E-09", "%G",
-__LINE__, -6.544601787025684e-27, "-0", "%+.0f",
-__LINE__, -6.558968312132168e-01, " -1", "%+6.f",
-__LINE__, -6.559654261655786e+08, "-6.559654e+08", "%e",
-__LINE__, -6.566562622196495e-21, "-6.56656E-21", "%.6G",
-__LINE__, -6.573486832071960e+04, "-65734.9", "%G",
-__LINE__, -6.573806290918275e+13, "-6.57381E+13", "%G",
-__LINE__, -6.578113771674787e+17, "-6.57811E+17", "%+#G",
-__LINE__, -6.584106931007506e+15, "-6.584107E+15", "%E",
-__LINE__, -6.590538844308877e+07, "-65905388.443089", "%f",
-__LINE__, -6.593708834068371e-07, "-0.000001", "%f",
-__LINE__, -6.597116446195875e+08, "-6.5971164e+08", "%#1.7e",
-__LINE__, -6.605813542127091e-04, "-0.0007", "%+0.g",
-__LINE__, -6.607491403866429e+07, "-7e+07", "%3.g",
-__LINE__, -6.616499847522278e+09, "-6.61650E+09", "%+#G",
-__LINE__, -6.618619768691332e+20, "-7E+20", "%2.G",
-__LINE__, -6.626748168962331e-22, "-7.E-22", "%+#3.E",
-__LINE__, -6.639335450348280e+12, "-6.63934e+12", "%g",
-__LINE__, -6.643910144912576e-03, "-0.006644", "%f",
-__LINE__, -6.650293872031870e-18, "-6.65029e-18", "%+#g",
-__LINE__, -6.654903858656310e-21, "-0.000000", "%f",
-__LINE__, -6.665834666726511e-12, "-6.665835E-12", "%E",
-__LINE__, -6.666428729917570e-19, "-0.000000", "%+#f",
-__LINE__, -6.668415789681128e+27, "-6.66842E+27", "%+G",
-__LINE__, -6.675214676269601e-28, "-6.67521e-28", "%#g",
-__LINE__, -6.679560072732262e+01, "-66.7956", "%#g",
-__LINE__, -6.692325075457020e-19, "-0.000000", "%1f",
-__LINE__, -6.697096655164652e+00, "-6.70", "%#.3g",
-__LINE__, -6.712436135928394e-28, "-7e-28", "%0.g",
-__LINE__, -6.720769486122685e-16, "-7e-16", "%0.e",
-__LINE__, -6.727196898490600e+26, "-672719689849060031860972230.8", "%.1f",
-__LINE__, -6.744132627576416e+02, "-674.413", "%6G",
-__LINE__, -6.757705576425288e+28, "-6.7577056e+28", "%.7e",
-__LINE__, -6.760554929237173e-02, "-0.067606", "%+f",
-__LINE__, -6.763538810629361e+10, "-6.7635E+10", "%.4E",
-__LINE__, -6.764712008860796e-29, "-6.76471E-29", "%+G",
-__LINE__, -6.767299719678443e+04, "-67672.997197", "%f",
-__LINE__, -6.768326491352134e+20, "-676832649135213415547.70", "%+.2f",
-__LINE__, -6.771116968952891e+03, "-7E+03", "%3.1G",
-__LINE__, -6.775218099238350e-30, "-7.e-30", "%+#6.g",
-__LINE__, -6.782142689928918e-18, "-0.00", "%4.2f",
-__LINE__, -6.795409770512149e+08, "-7E+08", "%+5.0G",
-__LINE__, -6.820966157097271e+14, "-6.820966e+14", "%e",
-__LINE__, -6.824972990592273e-22, "-0.00", "%+#1.2f",
-__LINE__, -6.830452914741750e+29, "-6.8E+29", "%+7.2G",
-__LINE__, -6.835797187132348e+10, "-6.8358E+10", "%+5G",
-__LINE__, -6.837040829636343e-03, "-0.00683704", "%+g",
-__LINE__, -6.852956218658224e+23, "-6.85296e+23", "%3g",
-__LINE__, -6.854102607287217e-26, "-7e-26", "%5.e",
-__LINE__, -6.865065870249438e+16, "-6.86507E+16", "%#G",
-__LINE__, -6.884819522625523e-13, "-6.88482E-13", "%5G",
-__LINE__, -6.916316600148513e-12, "-0.000000", "%f",
-__LINE__, -6.925312418761560e-05, "-6.92531E-05", "%#G",
-__LINE__, -6.929518694178331e+09, "-6929518694.178", "%#.3f",
-__LINE__, -6.936008056682024e+02, "-6.936008E+02", "%E",
-__LINE__, -6.944911117352400e+26, "-6.944911E+26", "%1.6E",
-__LINE__, -6.945829492125162e+05, "-6.9e+05", "%+2.2g",
-__LINE__, -6.946603162471856e-13, "-6.94660E-13", "%#G",
-__LINE__, -6.947529440406653e+22, "-6.9475e+22", "%+6.5g",
-__LINE__, -6.950167604854856e-30, "-0.000000", "%7f",
-__LINE__, -6.958122319262799e-26, "-7E-26", "%+1.E",
-__LINE__, -6.958978258390961e+16, "-6.95898E+16", "%+5.6G",
-__LINE__, -6.963780466334008e-06, "-6.96378E-06", "%2G",
-__LINE__, -6.965570896221966e+13, "-6.965571E+13", "%5E",
-__LINE__, -6.967741871945064e-10, "-6.96774E-10", "%+#G",
-__LINE__, -6.973815739524307e+19, "-69738157395243067782.076", "%6.3f",
-__LINE__, -6.982714545008106e+13, "-6.98271e+13", "%g",
-__LINE__, -6.985955885054476e+03, "-6985.96", "%6G",
-__LINE__, -6.986415266835747e+18, "-6.98642e+18", "%#g",
-__LINE__, -6.996461529596512e-08, "-7.0E-08", "%#.1E",
-__LINE__, -7.000144914012241e-05, "-7.00014e-05", "%#g",
-__LINE__, -7.001017894492730e-03, "-0.00700102", "%+#.6G",
-__LINE__, -7.003690685875917e+20, "-7E+20", "%0.G",
-__LINE__, -7.010454163965384e+00, "-7.010454e+00", "%+e",
-__LINE__, -7.011493550018082e-26, " -0", "%7.f",
-__LINE__, -7.018018443394008e+21, "-7.0E+21", "%+#1.1E",
-__LINE__, -7.027253777387243e-05, "-7.02725E-05", "%+G",
-__LINE__, -7.043679213677740e-17, "-0", "%1.f",
-__LINE__, -7.051690489227881e-16, "-7.052e-16", "%0.4g",
-__LINE__, -7.063422475274161e-16, "-7.063422E-16", "%E",
-__LINE__, -7.065069592235558e-30, "-7.06507e-30", "%+#g",
-__LINE__, -7.068265283935834e-29, "-7e-29", "%+5.e",
-__LINE__, -7.068748224536295e-13, "-0.000000", "%f",
-__LINE__, -7.069621910708177e-04, "-0.000707", "%1.3g",
-__LINE__, -7.079725450964823e-12, "-0.000000", "%f",
-__LINE__, -7.087255464668218e+17, "-7.1e+17", "%.1e",
-__LINE__, -7.088715102009605e-09, "-7e-09", "%6.0g",
-__LINE__, -7.090414916270137e-15, "-0.00000", "%.5f",
-__LINE__, -7.091868311008428e-03, " -0.0", "%5.1f",
-__LINE__, -7.094242165237718e+21, "-7.09424e+21", "%+g",
-__LINE__, -7.094324305740325e-05, "-7E-05", "%+3.G",
-__LINE__, -7.104544752289144e+04, "-71045.4", "%#g",
-__LINE__, -7.105164644813694e-29, "-0.000000", "%+f",
-__LINE__, -7.114513164219487e-12, "-7.11451e-12", "%+g",
-__LINE__, -7.115778236604137e-12, "-7.11578E-12", "%G",
-__LINE__, -7.126217683410162e-27, "-7.126218e-27", "%e",
-__LINE__, -7.136214260967733e+28, "-71362142609677334803564008325.338364", "%f",
-__LINE__, -7.143452595522573e+19, "-7.14345e+19", "%g",
-__LINE__, -7.156042088843537e+27, "-7156042088843537207765166385.7977837", "%4.7f",
-__LINE__, -7.173687683710490e+24, "-7.17369e+24", "%6g",
-__LINE__, -7.190531162598206e+25, "-71905311625982060164119503", "%4.f",
-__LINE__, -7.201301831373747e-09, "-7.2013e-09", "%g",
-__LINE__, -7.209601436737306e+10, "-7.2096e+10", "%g",
-__LINE__, -7.211058997356655e-06, "-7.211059E-06", "%E",
-__LINE__, -7.226756177676272e-09, "-7.22676E-09", "%+G",
-__LINE__, -7.230870817566419e+19, "-72308708175664193618.1040364", "%#.7f",
-__LINE__, -7.231355992133345e-05, "-7.231356E-05", "%#E",
-__LINE__, -7.245999575278407e-12, "-7.246e-12", "%g",
-__LINE__, -7.247426403040390e-09, "-7.2474E-09", "%+4.5G",
-__LINE__, -7.257348680308567e-12, "-7.3E-12", "%1.2G",
-__LINE__, -7.258184256387366e-26, "-7.25818E-26", "%+2G",
-__LINE__, -7.262633672900126e+10, "-7.26263e+10", "%#g",
-__LINE__, -7.268887462426250e+03, "-7.268887e+03", "%+#e",
-__LINE__, -7.275284494682963e+08, "-7.27528e+08", "%g",
-__LINE__, -7.276335846256479e-07, " -0", "%4.f",
-__LINE__, -7.312556378294452e+15, "-7.31256e+15", "%+6g",
-__LINE__, -7.334763752442417e-15, "-0.0000", "%#.4f",
-__LINE__, -7.354627097325888e-18, "-7E-18", "%0.E",
-__LINE__, -7.360087573342401e-25, "-7.4E-25", "%6.2G",
-__LINE__, -7.368533563361098e-29, "-7.4E-29", "%3.1E",
-__LINE__, -7.379267723540596e-06, "-0.000007", "%f",
-__LINE__, -7.384525781709565e-19, "-0.000000", "%+#f",
-__LINE__, -7.388940868679677e-09, "-7.388941E-09", "%E",
-__LINE__, -7.391602149099698e+00, "-7.391602E+00", "%E",
-__LINE__, -7.393159340196723e+22, "-7.39316e+22", "%#2.6g",
-__LINE__, -7.399783260198277e-16, "-7.39978E-16", "%G",
-__LINE__, -7.405609590448331e-06, "-7.40561e-06", "%g",
-__LINE__, -7.407396977847794e-11, "-7.40740E-11", "%#G",
-__LINE__, -7.433716848698637e+20, "-7.43372e+20", "%+g",
-__LINE__, -7.444176062769411e-01, "-0.744418", "%#g",
-__LINE__, -7.448314697244012e+12, "-7448314697244.011739", "%f",
-__LINE__, -7.449533988369018e+08, "-7.449534e+08", "%+#7e",
-__LINE__, -7.465682839758801e-01, "-7E-01", "%4.E",
-__LINE__, -7.466517843126368e-26, "-7.5E-26", "%.1E",
-__LINE__, -7.471385785539900e+24, "-7471385785539899515583783.795591", "%f",
-__LINE__, -7.478345583780341e+00, "-7.478346e+00", "%e",
-__LINE__, -7.524759284626724e-06, "-7.52476e-06", "%2g",
-__LINE__, -7.534831049342539e-19, "-7.53483E-19", "%G",
-__LINE__, -7.540546673179273e+15, "-8e+15", "%.1g",
-__LINE__, -7.543440436184003e-08, "-7.54344E-08", "%6G",
-__LINE__, -7.558224240835564e-06, "-7.55822e-06", "%g",
-__LINE__, -7.564132915154469e+23, "-756413291515446850610260.298708", "%+f",
-__LINE__, -7.566590720355392e+15, "-7.566591e+15", "%1.6e",
-__LINE__, -7.568565927479741e-01, "-7.568566e-01", "%#6e",
-__LINE__, -7.615574141973305e-17, "-7.6156e-17", "%+.5g",
-__LINE__, -7.641297631509318e-28, "-8e-28", "%+.1g",
-__LINE__, -7.661227834163450e+09, "-7661227834.1634497", "%+#.7f",
-__LINE__, -7.665934364070126e+11, "-766593436407.0", "%.1f",
-__LINE__, -7.682500068463102e-27, "-0.000000", "%+#f",
-__LINE__, -7.709363160273798e+15, "-7.70936e+15", "%g",
-__LINE__, -7.712596019255238e+26, "-7.7e+26", "%.2g",
-__LINE__, -7.730213358437991e+25, "-7.7e+25", "%6.2g",
-__LINE__, -7.744420019068976e+05, "-7.74442E+05", "%.5E",
-__LINE__, -7.745813181942296e+11, "-7.7458132e+11", "%+.7e",
-__LINE__, -7.751004379716307e+16, "-7.751004e+16", "%e",
-__LINE__, -7.759862226564527e-28, "-7.75986e-28", "%g",
-__LINE__, -7.767838880221207e-27, "-7.76784e-27", "%g",
-__LINE__, -7.776301142157532e-19, "-0", "%2.f",
-__LINE__, -7.783944257077553e-14, "-8e-14", "%3.g",
-__LINE__, -7.801587579382377e+28, "-8e+28", "%+0.g",
-__LINE__, -7.806685979552780e+25, "-7.806686E+25", "%E",
-__LINE__, -7.825968891331719e-05, "-7.82597E-05", "%G",
-__LINE__, -7.826834158664018e+12, "-7.826834E+12", "%+#E",
-__LINE__, -7.832536798726886e+24, "-7.83254E+24", "%#1G",
-__LINE__, -7.840485340202362e-18, "-0.000000", "%.6f",
-__LINE__, -7.843236212099233e+21, "-7.84324e+21", "%g",
-__LINE__, -7.906644052019278e-13, "-7.906644E-13", "%E",
-__LINE__, -7.908090440678874e-20, "-7.90809E-20", "%#G",
-__LINE__, -7.917588593012283e+08, "-7.917589E+08", "%+E",
-__LINE__, -7.929100086742454e+29, "-792910008674245414539427656563.930213", "%f",
-__LINE__, -7.933235286034290e+26, "-7.933235E+26", "%E",
-__LINE__, -7.943431966567875e-03, "-0.0079434", "%+.5g",
-__LINE__, -7.950872643572970e-22, "-7.95087e-22", "%2g",
-__LINE__, -7.971225555313069e-01, "-0.797123", "%f",
-__LINE__, -7.978310272676090e-12, "-0.000000", "%#f",
-__LINE__, -8.006805393896414e-29, "-8.00681E-29", "%G",
-__LINE__, -8.006906303018830e+25, "-8.00691E+25", "%+G",
-__LINE__, -8.008484654476057e+18, "-8.008485e+18", "%5.6e",
-__LINE__, -8.008943512904249e+27, "-8008943512904249217854157905.0943", "%+.4f",
-__LINE__, -8.016539743121665e+27, "-8.01654E+27", "%G",
-__LINE__, -8.018247227006128e-05, " -8E-05", "%7.G",
-__LINE__, -8.044391842561705e+21, "-8.04439e+21", "%g",
-__LINE__, -8.081902305002036e-02, "-8.081902E-02", "%E",
-__LINE__, -8.084193011936438e-03, "-0.0080842", "%+5.5g",
-__LINE__, -8.105813534846529e-27, "-0.000000", "%f",
-__LINE__, -8.128116892989251e+00, "-8.12812", "%G",
-__LINE__, -8.136119035731877e+05, "-8e+05", "%+0.g",
-__LINE__, -8.140584224052606e+14, "-8E+14", "%5.G",
-__LINE__, -8.145928897003907e+13, "-8.15E+13", "%.3G",
-__LINE__, -8.164495905907508e-02, "-0.081645", "%G",
-__LINE__, -8.169602113313905e+20, "-8.16960e+20", "%#g",
-__LINE__, -8.179181640418333e+24, "-8.E+24", "%#.1G",
-__LINE__, -8.184324492264231e-18, "-8.18432E-18", "%G",
-__LINE__, -8.186480473850516e-28, "-0.000000", "%+f",
-__LINE__, -8.196858948158896e+07, "-8.1969E+07", "%.4E",
-__LINE__, -8.213138534699043e-30, "-0.000000", "%f",
-__LINE__, -8.221181368676532e-21, "-8.221181E-21", "%#1E",
-__LINE__, -8.222605734191438e+16, "-8.22261E+16", "%+G",
-__LINE__, -8.223925661091432e-14, "-8.223926e-14", "%0e",
-__LINE__, -8.232281541044777e-01, "-0.823228", "%f",
-__LINE__, -8.245536794508725e+22, "-8E+22", "%6.G",
-__LINE__, -8.270687365305925e+25, "-82706873653059247430974210.146815", "%f",
-__LINE__, -8.288978945738204e+11, "-8.28898e+11", "%5g",
-__LINE__, -8.290628698333139e+02, "-829.063", "%+G",
-__LINE__, -8.292416206056451e-16, "-8.29242e-16", "%+g",
-__LINE__, -8.296322623746486e-13, "-8.29632E-13", "%0.6G",
-__LINE__, -8.298321941376933e-16, "-0.000000", "%+f",
-__LINE__, -8.302331258878365e+29, "-8.30233E+29", "%0G",
-__LINE__, -8.309022429255061e+06, "-8309022.429255", "%+f",
-__LINE__, -8.312786829254646e-23, "-8.312787e-23", "%e",
-__LINE__, -8.313852965178063e-15, "-8.313853e-15", "%#7e",
-__LINE__, -8.317529094827869e+16, "-8.31753E+16", "%2G",
-__LINE__, -8.322847660882248e-17, "-0.000000", "%f",
-__LINE__, -8.324060602752638e-30, "-8.32406e-30", "%#g",
-__LINE__, -8.325043500735461e+27, "-8325043500735461066142306663.095951", "%#f",
-__LINE__, -8.332432016286935e-02, "-0.0833243", "%g",
-__LINE__, -8.334251670232117e-09, "-8.33425e-09", "%g",
-__LINE__, -8.338076225141778e+02, "-833.808", "%g",
-__LINE__, -8.338349587571534e-23, "-8.33835e-23", "%+2g",
-__LINE__, -8.342420812231939e+23, "-834242081223193920891390.00745", "%+0.5f",
-__LINE__, -8.347404637940894e+17, "-8.347405e+17", "%+e",
-__LINE__, -8.367002601133880e-12, "-0.000000", "%#2.6f",
-__LINE__, -8.368579538210858e-17, "-8.36858e-17", "%5g",
-__LINE__, -8.392398522472401e-10, "-0.0000", "%.4f",
-__LINE__, -8.393029677635258e-29, " -8E-29", "%7.G",
-__LINE__, -8.393843230819225e-11, "-8.393843E-11", "%E",
-__LINE__, -8.397239871789148e-11, "-8.39724e-11", "%g",
-__LINE__, -8.402316358199041e-29, "-0.000", "%3.3f",
-__LINE__, -8.402910159034304e-14, "-8.4e-14", "%+0.3g",
-__LINE__, -8.414960962391726e+09, "-8414960962.391726", "%#f",
-__LINE__, -8.417512471384889e-28, "-8.417512e-28", "%e",
-__LINE__, -8.418719240222911e+21, "-8418719240222911182058.851409", "%f",
-__LINE__, -8.421210956044195e-09, "-0.00000", "%.5f",
-__LINE__, -8.422001733529095e+24, "-8E+24", "%0.G",
-__LINE__, -8.443614453772469e+21, "-8.44361E+21", "%+G",
-__LINE__, -8.445883044175737e-19, "-0", "%+1.f",
-__LINE__, -8.460545304711022e-01, "-0.846055", "%G",
-__LINE__, -8.470462532754567e+12, "-8.47E+12", "%6.3G",
-__LINE__, -8.478488782426476e-07, "-8.478489E-07", "%E",
-__LINE__, -8.478657582923923e+09, "-8.5e+09", "%.2g",
-__LINE__, -8.482732098043366e+12, "-8482732098043", "%5.f",
-__LINE__, -8.489112373854447e+07, "-8.489e+07", "%#3.3e",
-__LINE__, -8.494153144629106e+02, "-849.415", "%+g",
-__LINE__, -8.496331191616493e+28, "-8E+28", "%+6.G",
-__LINE__, -8.503711894495339e+05, "-850371", "%g",
-__LINE__, -8.505271893964268e+14, "-8.505272E+14", "%E",
-__LINE__, -8.509873985358741e+15, "-9.e+15", "%#7.g",
-__LINE__, -8.518336897898081e-20, "-8.51834E-20", "%G",
-__LINE__, -8.529588044136128e+21, "-8.529588E+21", "%E",
-__LINE__, -8.539706586811079e-23, "-8.53971E-23", "%G",
-__LINE__, -8.545924619642008e+10, "-8.545925e+10", "%6e",
-__LINE__, -8.572893681637353e+09, "-8.57289E+09", "%G",
-__LINE__, -8.585483717692345e+29, "-8.58548E+29", "%+G",
-__LINE__, -8.586092014292309e+27, "-8.59e+27", "%.2e",
-__LINE__, -8.604716827086833e-26, "-8.60472e-26", "%g",
-__LINE__, -8.621349224186615e-04, "-0.000862", "%f",
-__LINE__, -8.626097065201103e-21, " -0", "%5.f",
-__LINE__, -8.631700514212522e-16, "-8.631701E-16", "%+E",
-__LINE__, -8.634703359975640e-09, "-0.000000", "%+5f",
-__LINE__, -8.639393025443855e-17, "-8.63939e-17", "%g",
-__LINE__, -8.640641942556812e-11, "-8.64064e-11", "%#g",
-__LINE__, -8.646260250525495e-09, "-0.000", "%.3f",
-__LINE__, -8.667322015806242e+09, "-8667322015.806242", "%+#f",
-__LINE__, -8.690705655554451e+10, "-8.690706E+10", "%#E",
-__LINE__, -8.714299893763934e-07, "-8.7143E-07", "%.5G",
-__LINE__, -8.715729756264988e+27, "-8.71573E+27", "%+.6G",
-__LINE__, -8.716518487180945e+16, "-9e+16", "%3.e",
-__LINE__, -8.744404488756237e+25, "-87444044887562366596966967.335902", "%4f",
-__LINE__, -8.754720498369242e+13, "-8.75472e+13", "%g",
-__LINE__, -8.763198097931010e-19, "-8.76320e-19", "%#g",
-__LINE__, -8.779007408852458e+28, "-8.77901E+28", "%G",
-__LINE__, -8.794576202907937e+11, "-8.79458E+11", "%#2.6G",
-__LINE__, -8.799091520612418e-11, "-8.799E-11", "%3.4G",
-__LINE__, -8.799246265524921e+11, "-8.79925E+11", "%G",
-__LINE__, -8.809010508550436e-04, "-8.8090E-04", "%.4E",
-__LINE__, -8.817389999872653e-10, "-8.81739e-10", "%g",
-__LINE__, -8.842022428985267e-28, "-8.842022E-28", "%E",
-__LINE__, -8.851265987586864e-07, "-0.000001", "%f",
-__LINE__, -8.861985131432196e+03, "-8861.985", "%+.7G",
-__LINE__, -8.874449013455113e-29, "-8.874449e-29", "%e",
-__LINE__, -8.878752609483453e+18, "-8.87875E+18", "%G",
-__LINE__, -8.882501665315313e-04, "-0.00088825", "%+G",
-__LINE__, -8.892056241505784e-14, "-8.89206E-14", "%G",
-__LINE__, -8.895327674961603e-30, "-8.89533E-30", "%G",
-__LINE__, -8.900059462213669e-30, "-8.900059E-30", "%+#E",
-__LINE__, -8.957100548759815e+18, "-9e+18", "%3.0e",
-__LINE__, -8.961352369869012e-30, "-8.961352e-30", "%+#2e",
-__LINE__, -8.962296474587800e+02, "-896", "%4.f",
-__LINE__, -8.962536469328530e-12, "-8.96254E-12", "%G",
-__LINE__, -8.963299420391932e+21, "-8.9633e+21", "%g",
-__LINE__, -8.967736672941522e-11, "-8.96774e-11", "%g",
-__LINE__, -8.994077362462679e+11, "-8.9940774e+11", "%+#.7e",
-__LINE__, -9.000452862345622e+15, "-9e+15", "%2.e",
-__LINE__, -9.007489135361462e+07, "-9.0075E+07", "%+2.4E",
-__LINE__, -9.036271805879910e+16, "-9.03627E+16", "%G",
-__LINE__, -9.036319073700248e+22, "-9.03632e+22", "%1g",
-__LINE__, -9.043207635989237e+11, "-9.043208e+11", "%#e",
-__LINE__, -9.043856598625815e-26, "-9e-26", "%+1.g",
-__LINE__, -9.052760561065698e+14, "-9.052761E+14", "%E",
-__LINE__, -9.066480297957160e-06, "-9E-06", "%+1.G",
-__LINE__, -9.070971376440752e-01, "-0.907097", "%g",
-__LINE__, -9.073301831888273e+09, "-9.07330E+09", "%#G",
-__LINE__, -9.091228662702147e+28, "-9E+28", "%4.G",
-__LINE__, -9.093652024983832e+04, "-9.093652E+04", "%7.6E",
-__LINE__, -9.098945831139295e-04, "-9.098946E-04", "%+1.6E",
-__LINE__, -9.124981449916591e+05, "-912498", "%G",
-__LINE__, -9.132038703003394e-02, "-0.0913204", "%#G",
-__LINE__, -9.138271437433964e-04, "-0.000913827", "%5g",
-__LINE__, -9.158186427463699e-04, "-0.000915819", "%g",
-__LINE__, -9.160846358172526e+16, "-9.160846E+16", "%#E",
-__LINE__, -9.160884330810163e+17, "-9E+17", "%+5.G",
-__LINE__, -9.190271387375542e+21, "-9.19027e+21", "%+g",
-__LINE__, -9.191651872412619e-04, "-9.191652E-04", "%E",
-__LINE__, -9.196426161984341e-10, "-9E-10", "%4.G",
-__LINE__, -9.201074139774962e+09, "-9E+09", "%4.G",
-__LINE__, -9.223294284802762e+09, "-9.22329E+09", "%G",
-__LINE__, -9.224740266754996e+02, "-9E+02", "%6.0G",
-__LINE__, -9.231583780512302e-01, " -0.9", "%6.g",
-__LINE__, -9.241998826543689e+07, "-92419988", "%1.f",
-__LINE__, -9.243603351372128e+27, "-9.243603e+27", "%#e",
-__LINE__, -9.255922697415071e+11, "-9.25592e+11", "%g",
-__LINE__, -9.265734968114124e-02, "-0.092657", "%f",
-__LINE__, -9.273132068521061e+11, "-9.27313E+11", "%G",
-__LINE__, -9.276017912826685e+27, "-9.E+27", "%+#5.G",
-__LINE__, -9.279781279788505e+17, "-9.27978E+17", "%7G",
-__LINE__, -9.305057549822465e-19, "-9.30506E-19", "%5G",
-__LINE__, -9.313182384508469e+18, "-9.31318E+18", "%G",
-__LINE__, -9.313350925182641e-12, "-9.31E-12", "%.3G",
-__LINE__, -9.362202657509130e+08, "-9e+08", "%.1g",
-__LINE__, -9.367344757598381e+19, "-9.36734e+19", "%g",
-__LINE__, -9.374222399774300e+26, "-9.37422e+26", "%4g",
-__LINE__, -9.385734023305105e+02, "-9.385734e+02", "%+0e",
-__LINE__, -9.392042570618909e+17, "-9.39204E+17", "%G",
-__LINE__, -9.395742939311926e+20, "-939574293931192627837.8451", "%.4f",
-__LINE__, -9.409066155962469e+09, "-9.40907E+09", "%#G",
-__LINE__, -9.412851077799790e+23, "-9.412851E+23", "%E",
-__LINE__, -9.431808019049818e+08, "-9.43181e+08", "%g",
-__LINE__, -9.465236900519924e-27, "-9.46524e-27", "%g",
-__LINE__, -9.478330386415852e+17, "-9.478330e+17", "%e",
-__LINE__, -9.510393719697428e+15, "-9.51039E+15", "%+G",
-__LINE__, -9.534229599909890e-09, "-0.000000", "%f",
-__LINE__, -9.541731189284823e-17, "-1.E-16", "%+#7.G",
-__LINE__, -9.548861908445902e+24, "-9548861908445902102471336.547751", "%f",
-__LINE__, -9.578447281451794e+14, "-957844728145179", "%5.f",
-__LINE__, -9.580512736933464e+11, "-9.58051E+11", "%G",
-__LINE__, -9.596838169770637e-28, "-1E-27", "%+6.G",
-__LINE__, -9.597528852877852e-22, "-1e-21", "%2.1g",
-__LINE__, -9.599943658427051e+02, "-9.599944E+02", "%E",
-__LINE__, -9.603227991185260e-14, "-1E-13", "%+0.E",
-__LINE__, -9.606818733892343e+08, "-960681873.389", "%1.3f",
-__LINE__, -9.617442692720937e+16, "-9.61744E+16", "%G",
-__LINE__, -9.628685516961109e+29, "-9.62869e+29", "%3g",
-__LINE__, -9.638354750455226e-11, "-0.000000", "%f",
-__LINE__, -9.644266379029137e+16, "-96442663790291369.707575", "%f",
-__LINE__, -9.645563533575482e+06, "-1E+07", "%1.G",
-__LINE__, -9.645993536742941e-29, "-9.64599e-29", "%+g",
-__LINE__, -9.647147223548563e+00, "-9.647147e+00", "%e",
-__LINE__, -9.671225879906396e-11, "-0", "%0.f",
-__LINE__, -9.675000471729906e-09, "-9.675000E-09", "%E",
-__LINE__, -9.683992878297159e-26, "-9.68e-26", "%2.2e",
-__LINE__, -9.695491325144765e+10, "-9.69549E+10", "%#G",
-__LINE__, -9.695661526907136e-24, " -0.", "%#6.f",
-__LINE__, -9.703124881970338e+07, "-9.703e+07", "%0.4g",
-__LINE__, -9.707701257031864e+26, "-970770125703186437249314622.022212", "%f",
-__LINE__, -9.709879792694702e+09, "-9.709880E+09", "%E",
-__LINE__, -9.736052226907940e+26, "-9.73605e+26", "%+#g",
-__LINE__, -9.745037157520795e+07, "-9.74504e+07", "%#5.6g",
-__LINE__, -9.757293950670832e-29, "-9.757E-29", "%0.4G",
-__LINE__, -9.762126832689880e+12, "-9.76213E+12", "%G",
-__LINE__, -9.801328150341989e-01, " -1", "%7.G",
-__LINE__, -9.837332964629669e-20, "-9.83733E-20", "%0G",
-__LINE__, -9.837790327283010e+23, "-1E+24", "%.1G",
-__LINE__, -9.839636176463729e+23, "-9.83964E+23", "%#6.5E",
-__LINE__, -9.841454250618272e+11, "-9.84E+11", "%+2.3G",
-__LINE__, -9.852920805249280e-12, "-9.852921e-12", "%.7g",
-__LINE__, -9.854092850182351e+12, "-9.85409e+12", "%0g",
-__LINE__, -9.866796026839712e+02, "-9.9E+02", "%#.1E",
-__LINE__, -9.867413260289803e-21, "-1e-20", "%.1g",
-__LINE__, -9.882136052131983e-08, "-9.88214e-08", "%g",
-__LINE__, -9.882755697941866e+20, "-9.882756E+20", "%E",
-__LINE__, -9.897275811087050e+20, "-9.9E+20", "%0.3G",
-__LINE__, -9.899860651812364e-04, "-9.899861e-04", "%e",
-__LINE__, -9.906754113555550e-11, "-9.90675e-11", "%3g",
-__LINE__, -9.926067557389940e+11, "-9.92607E+11", "%G",
-__LINE__, -9.929638609014063e+17, "-992963860901406292.214233", "%1f",
-__LINE__, -9.941214552193284e-24, "-0.000000", "%+#f",
-__LINE__, -9.942875240256573e+14, "-9.942875e+14", "%+1e",
-__LINE__, -9.944492909695798e-01, "-9.944E-01", "%.3E",
-__LINE__, -9.954710507359939e-27, "-1e-26", "%+0.2g",
-__LINE__, -9.955410507742851e+03, "-9955.41", "%+G",
-__LINE__, -9.974437672251590e+02, "-997.444", "%#G",
-__LINE__, -9.975683165288929e-26, "-9.97568E-26", "%6G",
-__LINE__, 1.003827370583415e+06, "1003827.370583", "%3f",
-__LINE__, 1.004189065268560e-27, "1.004189E-27", "%.7G",
-__LINE__, 1.005840059175462e-28, "+1.00584E-28", "%+G",
-__LINE__, 1.006586790090557e-12, "0.000000", "%#f",
-__LINE__, 1.007598594773359e+18, "1.0076E+18", "%G",
-__LINE__, 1.007902307001894e+29, "1.0079e+29", "%g",
-__LINE__, 1.008607405036580e-15, "1.00861E-15", "%6G",
-__LINE__, 1.008769102466771e+16, "+1.00877E+16", "%+G",
-__LINE__, 1.009545698372534e-08, "+1E-08", "%+0.0G",
-__LINE__, 1.010173673945099e-12, "+1.01017e-12", "%+#0g",
-__LINE__, 1.011375000606627e+09, "1011375000.606627", "%f",
-__LINE__, 1.011944652221650e+15, "1011944652221649.98", "%3.2f",
-__LINE__, 1.013057788090379e-21, "0.000000", "%#f",
-__LINE__, 1.014525729953198e+15, "1.01453e+15", "%3g",
-__LINE__, 1.016760538234615e-21, "+1.016761E-21", "%+3E",
-__LINE__, 1.017052611781237e-29, "0.000000", "%f",
-__LINE__, 1.018471223361229e+14, "1.01847E+14", "%G",
-__LINE__, 1.021646959220873e+15, "1021646959220872.6", "%4.1f",
-__LINE__, 1.022304833976590e+27, "1.0223e+27", "%g",
-__LINE__, 1.022500312067325e-12, "1.0225e-12", "%6g",
-__LINE__, 1.023019285462627e-20, "0.000000", "%f",
-__LINE__, 1.024192579400824e+06, "1.02419e+06", "%g",
-__LINE__, 1.024517953555766e-28, "1.02452E-28", "%G",
-__LINE__, 1.026673589339585e+21, "1.02667E+21", "%G",
-__LINE__, 1.027231090958880e-19, "1.E-19", "%#3.G",
-__LINE__, 1.028249904956487e-27, "1E-27", "%5.G",
-__LINE__, 1.028570144661448e-28, "+1.02857E-28", "%+G",
-__LINE__, 1.028934898454705e-13, "+1.028935E-13", "%+E",
-__LINE__, 1.029071053545906e-26, "1.029071E-26", "%E",
-__LINE__, 1.032672895881148e-30, "+1.032673E-30", "%+E",
-__LINE__, 1.033502358979511e+06, "1.0335E+06", "%.5G",
-__LINE__, 1.036790427717847e+19, "1e+19", "%4.g",
-__LINE__, 1.037022928821648e+03, "1037.02", "%5g",
-__LINE__, 1.040551683941284e+14, "1.04055E+14", "%G",
-__LINE__, 1.044499252101308e-17, "1.044499E-17", "%E",
-__LINE__, 1.045791899570889e+15, "+1.04579e+15", "%+g",
-__LINE__, 1.048730383198703e+28, "1.049e+28", "%.4g",
-__LINE__, 1.050654419882509e-18, "0.000000", "%f",
-__LINE__, 1.052600569262127e-27, "+0.000", "%+2.3f",
-__LINE__, 1.053213014784149e+15, "1E+15", "%4.G",
-__LINE__, 1.057553916225948e-15, "+0.000000", "%+4f",
-__LINE__, 1.058191244482453e+19, "1.058e+19", "%.3e",
-__LINE__, 1.058746269793972e-26, "+1.1E-26", "%+.2G",
-__LINE__, 1.058793271960762e-01, "+1.058793E-01", "%+4E",
-__LINE__, 1.058869592738370e-19, "1.05887e-19", "%3g",
-__LINE__, 1.060402312803008e+15, "1060402312803008.229025", "%f",
-__LINE__, 1.061106284763095e+00, "1.061106", "%0f",
-__LINE__, 1.061180160987467e+09, "1e+09", "%2.g",
-__LINE__, 1.061181537176067e-06, "+1.06118e-06", "%+g",
-__LINE__, 1.065021381771174e+20, "1.06502e+20", "%g",
-__LINE__, 1.065464040401130e-16, "1.065464e-16", "%e",
-__LINE__, 1.065573419819459e-05, "0.00001", "%.5f",
-__LINE__, 1.066107764306644e+13, "1.066108e+13", "%#e",
-__LINE__, 1.071318759598956e+12, "1.071319e+12", "%e",
-__LINE__, 1.071564727222321e+10, "1.072E+10", "%3.4G",
-__LINE__, 1.074652481218139e+14, "1.0747E+14", "%.4E",
-__LINE__, 1.078453684911309e-02, "0.0107845", "%g",
-__LINE__, 1.078550811446675e-05, "1.07855e-05", "%g",
-__LINE__, 1.078780494515273e-04, "0.000107878", "%4G",
-__LINE__, 1.079467488876157e-16, "+1.079467E-16", "%+E",
-__LINE__, 1.080529722917934e-20, "0.000000", "%f",
-__LINE__, 1.082169127709439e+01, "10.8217", "%#5g",
-__LINE__, 1.087241285590951e+22, "1E+22", "%4.G",
-__LINE__, 1.091049208406195e-14, "0.0000", "%.4f",
-__LINE__, 1.095316064213237e+16, "+1e+16", "%+0.g",
-__LINE__, 1.095349083237975e-04, "1.095349e-04", "%5e",
-__LINE__, 1.098002465452836e+12, "1098002465452.836205", "%f",
-__LINE__, 1.098445764138997e+13, "1.09845E+13", "%G",
-__LINE__, 1.099968047892474e-13, "1.1e-13", "%2.5g",
-__LINE__, 1.101017598311363e-04, "0.000110102", "%G",
-__LINE__, 1.102776332077817e+18, "1.103e+18", "%.3e",
-__LINE__, 1.103734053887830e-01, "0.110373", "%f",
-__LINE__, 1.105730106869006e-03, "0.00110573", "%g",
-__LINE__, 1.106366781854058e-10, "1.10637e-10", "%g",
-__LINE__, 1.107354763213839e+15, "1.107355e+15", "%6e",
-__LINE__, 1.108151709609825e-10, "+1.10815E-10", "%+G",
-__LINE__, 1.110054501993647e+21, "+1.11005E+21", "%+G",
-__LINE__, 1.111574814737873e-17, "+1.112E-17", "%+1.4G",
-__LINE__, 1.111865512360108e-15, "1E-15", "%.0G",
-__LINE__, 1.112281568330498e-03, "1.112282e-03", "%.6e",
-__LINE__, 1.112625415174238e+21, "+1.11263e+21", "%+g",
-__LINE__, 1.112744974910395e-02, "0.011127", "%f",
-__LINE__, 1.114726566979885e-10, "1.11473e-10", "%g",
-__LINE__, 1.115395843055731e-20, "+0.000000", "%+6f",
-__LINE__, 1.115983414693121e+15, "1.11598e+15", "%5.6g",
-__LINE__, 1.116118842074266e+27, "1.116119e+27", "%e",
-__LINE__, 1.118386983012328e+19, "11183869830123276400.968280", "%1f",
-__LINE__, 1.119344607892718e-22, "1.119345e-22", "%e",
-__LINE__, 1.120560837110279e-19, "0.000000", "%f",
-__LINE__, 1.123620157906291e-02, "0.0112362", "%G",
-__LINE__, 1.126804857639478e+29, "1.1268E+29", "%#0.5G",
-__LINE__, 1.128962199461581e+11, "1.12896e+11", "%g",
-__LINE__, 1.129878714246809e-16, "1E-16", "%0.0G",
-__LINE__, 1.130331982972407e-06, "+0.", "%+#1.f",
-__LINE__, 1.134167332070028e-16, "0", "%0.0f",
-__LINE__, 1.134248080053598e-28, "0.000000", "%f",
-__LINE__, 1.136023160708119e-10, "+0.000000", "%+1f",
-__LINE__, 1.136167141059036e+23, "113616714105903593434732.101741", "%f",
-__LINE__, 1.136439499920164e+10, "+1.13644E+10", "%+G",
-__LINE__, 1.136859734932182e+24, "1.13686e+24", "%g",
-__LINE__, 1.138985939448731e+09, "1.13899e+09", "%2g",
-__LINE__, 1.139287324790407e-25, "1e-25", "%.1g",
-__LINE__, 1.140559912153251e+06, "1.14056e+06", "%g",
-__LINE__, 1.141318036027086e-26, "1.14132E-26", "%G",
-__LINE__, 1.142586049368452e-20, "+1.14259E-20", "%+7.5E",
-__LINE__, 1.143283863993333e-17, "1.143284E-17", "%3E",
-__LINE__, 1.144637911632432e-28, "1.144638E-28", "%#3E",
-__LINE__, 1.145791416532065e-10, "1.14579e-10", "%g",
-__LINE__, 1.146958047315780e-17, "1.146958e-17", "%e",
-__LINE__, 1.147898346886569e-08, "1E-08", "%3.0E",
-__LINE__, 1.149724744965608e-14, "1.14972e-14", "%5g",
-__LINE__, 1.155383721940441e-10, "1e-10", "%1.g",
-__LINE__, 1.157066617729094e-02, "0", "%1.f",
-__LINE__, 1.157893614537215e+05, "1.157894E+05", "%E",
-__LINE__, 1.160476344451928e-19, "1.2e-19", "%.1e",
-__LINE__, 1.161610499315966e-26, "1.161610E-26", "%E",
-__LINE__, 1.162345042181490e+29, "116234504218148981813385489658.685401", "%5.6f",
-__LINE__, 1.162376053722862e+23, "1.16238e+23", "%g",
-__LINE__, 1.162996084782483e+18, "+1e+18", "%+0.g",
-__LINE__, 1.163544861478966e+26, "1.16354E+26", "%G",
-__LINE__, 1.167300137450931e+06, "1E+06", "%.0G",
-__LINE__, 1.168693829096401e-30, "+1.16869e-30", "%+g",
-__LINE__, 1.172791369381396e+15, "1.173E+15", "%.4G",
-__LINE__, 1.174427110782028e-29, " 1E-29", "%7.G",
-__LINE__, 1.179498322112450e+27, "1179498322112449759657692993.641831", "%f",
-__LINE__, 1.179555606293547e+27, "1.17956e+27", "%3g",
-__LINE__, 1.180815814881269e+06, "1.180816e+06", "%e",
-__LINE__, 1.181494870072805e+20, "1.181495e+20", "%5e",
-__LINE__, 1.181524119225619e+12, "+1181524119225.61917", "%+5.5f",
-__LINE__, 1.182111212289243e-20, "1e-20", "%4.g",
-__LINE__, 1.184503315019769e-27, "1.1845e-27", "%7g",
-__LINE__, 1.186413646767670e+29, "1.18641e+29", "%g",
-__LINE__, 1.186852938885004e-13, "1.18685e-13", "%4g",
-__LINE__, 1.188837612473914e+05, "1e+05", "%.0g",
-__LINE__, 1.190317482928293e-29, "1.190317e-29", "%e",
-__LINE__, 1.190527491143987e+02, "1.190527E+02", "%E",
-__LINE__, 1.191823062060233e-30, "1.2E-30", "%6.2G",
-__LINE__, 1.191926974812428e-23, "1.2e-23", "%.2g",
-__LINE__, 1.193549622366544e-25, "1E-25", "%4.1G",
-__LINE__, 1.195517368629765e-21, "1.195517e-21", "%1.7g",
-__LINE__, 1.195573061651289e-27, "1.19557e-27", "%#g",
-__LINE__, 1.195806681188325e-03, "+0.00120", "%+#.3G",
-__LINE__, 1.196842275192189e-28, "1.19684e-28", "%g",
-__LINE__, 1.197307550969576e+04, "1.1973E+04", "%.4E",
-__LINE__, 1.197608525847607e+15, "1197608525847606.8062805", "%4.7f",
-__LINE__, 1.197801338159407e+04, "11978", "%5G",
-__LINE__, 1.197813329735025e+27, "1.19781E+27", "%7G",
-__LINE__, 1.199483904123253e-12, "1.19948e-12", "%g",
-__LINE__, 1.199535292169766e-09, "1.199535e-09", "%e",
-__LINE__, 1.201478067515135e+05, "120147.806752", "%f",
-__LINE__, 1.202054662662158e+17, "1.20205E+17", "%#G",
-__LINE__, 1.202111922368321e+07, "+1.202112E+07", "%+#E",
-__LINE__, 1.202536892743791e-01, "0.120254", "%#g",
-__LINE__, 1.205698674119882e-29, "1.2057E-29", "%G",
-__LINE__, 1.208091664701942e-13, " 0.", "%#3.f",
-__LINE__, 1.208942413954872e-17, "1.20894E-17", "%G",
-__LINE__, 1.209704891496613e+10, "1.210e+10", "%2.3e",
-__LINE__, 1.211355639334831e+29, "1E+29", "%.0G",
-__LINE__, 1.211447553804203e+17, " 1E+17", "%7.E",
-__LINE__, 1.212481583429790e-16, "1.212482e-16", "%e",
-__LINE__, 1.212849001551862e+26, "121284900155186181613942153.4899157", "%6.7f",
-__LINE__, 1.213057538677801e+06, "1213057.538678", "%#.6f",
-__LINE__, 1.214609592911893e+25, "1.214610e+25", "%#e",
-__LINE__, 1.216086266251665e+01, "1e+01", "%5.e",
-__LINE__, 1.216468565931026e-22, "1.216469E-22", "%1E",
-__LINE__, 1.216503126598765e+14, "+1E+14", "%+0.E",
-__LINE__, 1.216641013695553e-14, "0.000000", "%f",
-__LINE__, 1.223142246779504e-23, "0.000000", "%f",
-__LINE__, 1.223884786443274e+08, "122388479", "%5.f",
-__LINE__, 1.224012562770076e+29, "1.22401e+29", "%0g",
-__LINE__, 1.225098157528297e+14, "1.22510e+14", "%#g",
-__LINE__, 1.226306848505242e-22, "1.22631E-22", "%G",
-__LINE__, 1.227487485547996e-08, "+1.22749e-08", "%+g",
-__LINE__, 1.237206486909689e+02, "+123.721", "%+#.6g",
-__LINE__, 1.240281126177077e-02, "+0.01", "%+3.g",
-__LINE__, 1.241197211306994e-06, "1.241197E-06", "%E",
-__LINE__, 1.241776311097410e+07, "1.241776E+07", "%E",
-__LINE__, 1.245995986024999e-03, "0.001246", "%g",
-__LINE__, 1.246082428199607e+03, "1246.082428", "%f",
-__LINE__, 1.247021567954220e+05, " 1e+05", "%7.g",
-__LINE__, 1.248140089618390e-30, "+1.24814E-30", "%+G",
-__LINE__, 1.248403361652064e-30, "+0.000000", "%+f",
-__LINE__, 1.251098538918842e-26, "+1.251099E-26", "%+E",
-__LINE__, 1.251952633022061e+25, "1.25195e+25", "%g",
-__LINE__, 1.253029705843461e-04, "+1.E-04", "%+#4.E",
-__LINE__, 1.259562132729488e-09, "1e-09", "%1.e",
-__LINE__, 1.261702205492260e-27, "0.000000", "%f",
-__LINE__, 1.265910361926660e-19, "+1.265910e-19", "%+e",
-__LINE__, 1.267411912651087e+12, "1.26741E+12", "%1G",
-__LINE__, 1.267830718285980e-10, "1.26783e-10", "%g",
-__LINE__, 1.268238378987517e-23, "1E-23", "%5.E",
-__LINE__, 1.275543253354167e+10, "1.27554E+10", "%G",
-__LINE__, 1.277255234454465e-10, "1.27726E-10", "%5G",
-__LINE__, 1.280590949834150e-21, "1.280591E-21", "%E",
-__LINE__, 1.285570453788242e-02, "1.285570E-02", "%E",
-__LINE__, 1.287712130719031e+09, "1287712130.719031", "%#f",
-__LINE__, 1.290142876187105e+29, "+1.290143E+29", "%+E",
-__LINE__, 1.293129213191961e+21, "1.29313E+21", "%G",
-__LINE__, 1.293317101334714e-23, "+0.000000", "%+f",
-__LINE__, 1.294506813069071e-13, "0.0", "%3.1f",
-__LINE__, 1.295576232685739e-22, "+0.000000", "%+f",
-__LINE__, 1.296010470431800e-19, "+0.000000", "%+6f",
-__LINE__, 1.298798231947674e+19, "1.2988E+19", "%2G",
-__LINE__, 1.299521114379381e+09, "1.29952E+09", "%G",
-__LINE__, 1.299847637892712e+24, "1.299848e+24", "%e",
-__LINE__, 1.301269777843698e+29, "130126977784369834978406288428.232074", "%f",
-__LINE__, 1.302911786437618e-15, " 0", "%6.f",
-__LINE__, 1.303863159906719e+27, "1303863159906719415559450681", "%0.f",
-__LINE__, 1.304396472326846e-12, "+1E-12", "%+1.0G",
-__LINE__, 1.306180443528427e-30, "+1e-30", "%+.1g",
-__LINE__, 1.308469138968514e+22, "1.30847E+22", "%0G",
-__LINE__, 1.312700156826057e-11, "1.3127e-11", "%g",
-__LINE__, 1.315364075120764e+21, "+1.31536E+21", "%+G",
-__LINE__, 1.320376485288444e-09, "+1.3204E-09", "%+6.5G",
-__LINE__, 1.321434154364635e-08, "1.32143e-08", "%1g",
-__LINE__, 1.322777272579176e+19, "+1e+19", "%+3.e",
-__LINE__, 1.322861663428564e+00, "1.322862E+00", "%#E",
-__LINE__, 1.323566013489230e+14, "+1.323566E+14", "%+1E",
-__LINE__, 1.327446904132973e-20, "+1.32745E-20", "%+4.6G",
-__LINE__, 1.328226362528158e+19, "1e+19", "%2.g",
-__LINE__, 1.329167460803610e+08, "1e+08", "%3.g",
-__LINE__, 1.335371420823160e+14, "1.33537E+14", "%7G",
-__LINE__, 1.336116185095935e-21, "0.000000", "%f",
-__LINE__, 1.338766774704671e-22, "+1.33877e-22", "%+g",
-__LINE__, 1.339199373014647e-12, "1E-12", "%1.E",
-__LINE__, 1.344293357481519e+26, "134429335748151945750805680.290796", "%#2f",
-__LINE__, 1.344328188122843e+29, "1.34433e+29", "%g",
-__LINE__, 1.344382581316972e-05, "1E-05", "%5.0E",
-__LINE__, 1.349835616116184e+11, "134983561611.6", "%2.1f",
-__LINE__, 1.349955669989707e+20, "134995566998970728533.890906", "%7f",
-__LINE__, 1.350230411093841e+20, "135023041109384145386.229648", "%f",
-__LINE__, 1.353391369565576e+10, " 1E+10", "%7.1G",
-__LINE__, 1.356889483699471e+22, "+1.35689E+22", "%+G",
-__LINE__, 1.358141775798243e+24, "+1358141775798242578687791.137781", "%+f",
-__LINE__, 1.358547541975523e-15, "1.35855e-15", "%g",
-__LINE__, 1.363402539800791e+11, "1.3634E+11", "%G",
-__LINE__, 1.363676837988798e+16, "+13636768379887982.4053", "%+2.4f",
-__LINE__, 1.364592026494839e-24, "1.36459e-24", "%g",
-__LINE__, 1.366664212399413e-09, "+1E-09", "%+6.G",
-__LINE__, 1.367446193117463e-17, "1.3674e-17", "%2.4e",
-__LINE__, 1.368681648785823e-18, "1.36868E-18", "%3G",
-__LINE__, 1.370635189583606e+05, "1.370635E+05", "%E",
-__LINE__, 1.371395540772186e-18, "+1.371396e-18", "%+e",
-__LINE__, 1.371945318043159e+10, "1E+10", "%0.E",
-__LINE__, 1.373780604772988e-21, "1e-21", "%3.g",
-__LINE__, 1.374244970441862e-28, "0.000000", "%7.6f",
-__LINE__, 1.375874695067149e-25, "1.37587E-25", "%#3G",
-__LINE__, 1.377165614832621e+20, "1.37717E+20", "%#G",
-__LINE__, 1.381541864946684e-09, "1.38154E-09", "%G",
-__LINE__, 1.382901694835415e+00, "1.382902E+00", "%E",
-__LINE__, 1.384250577530184e-21, "1.384e-21", "%.4g",
-__LINE__, 1.385322753374640e-03, " 1E-03", "%6.E",
-__LINE__, 1.387026156054724e+19, "1.387026E+19", "%E",
-__LINE__, 1.388726735790498e-27, "+1.388727E-27", "%+E",
-__LINE__, 1.388819105742044e+16, "1.38882e+16", "%g",
-__LINE__, 1.389941086024951e-19, "0.000000", "%f",
-__LINE__, 1.390101174785536e+25, "1.3901E+25", "%G",
-__LINE__, 1.392210785638597e+24, "+1.39221E+24", "%+G",
-__LINE__, 1.396148856283474e-26, "1.4e-26", "%7.3g",
-__LINE__, 1.398153728631994e-21, "1.39815E-21", "%G",
-__LINE__, 1.398332446762342e-14, "+1.39833E-14", "%+5G",
-__LINE__, 1.400250919607987e+10, "1.40025E+10", "%G",
-__LINE__, 1.400662469019739e+03, "1.E+03", "%#0.0E",
-__LINE__, 1.401720273747805e-12, "0.000000", "%#f",
-__LINE__, 1.402151358748719e+22, "1.402151e+22", "%e",
-__LINE__, 1.402351913752357e-28, "1.40235E-28", "%#1.6G",
-__LINE__, 1.403285877973810e+13, "+14032858779738.097255", "%+4f",
-__LINE__, 1.404540981735861e+04, "14045.409817", "%4f",
-__LINE__, 1.406420622355064e+19, "1.40642E+19", "%G",
-__LINE__, 1.412552725962301e-29, "+1e-29", "%+1.e",
-__LINE__, 1.413266982485044e+10, "1.41327e+10", "%g",
-__LINE__, 1.413627189411456e+21, "1.41363E+21", "%0G",
-__LINE__, 1.416647216002592e-25, "+0.000000", "%+#f",
-__LINE__, 1.417107155080584e-10, "1e-10", "%1.e",
-__LINE__, 1.418829895346648e+19, "14188298953466484952.912197", "%f",
-__LINE__, 1.419404559267523e-11, "1.4194e-11", "%g",
-__LINE__, 1.422421321425472e+15, "1.422421E+15", "%E",
-__LINE__, 1.424858902008998e+18, "1.42486E+18", "%2.5E",
-__LINE__, 1.428863051254205e+22, "1.428863e+22", "%e",
-__LINE__, 1.429533727936725e-02, "0.0142953", "%g",
-__LINE__, 1.430982219743369e-19, " 1E-19", "%6.G",
-__LINE__, 1.431974118434703e+17, "1E+17", "%3.G",
-__LINE__, 1.432418341970152e+16, "+1.432418e+16", "%+5e",
-__LINE__, 1.433470281650523e+04, "14334.7", "%g",
-__LINE__, 1.434446243424653e+24, " +1e+24", "%+7.g",
-__LINE__, 1.435118019241039e+24, "+1e+24", "%+4.g",
-__LINE__, 1.435691648420278e-01, "0.1435692", "%#4.7g",
-__LINE__, 1.437569598098744e+27, "1.437570E+27", "%#E",
-__LINE__, 1.437633484061726e-25, "+1.43763e-25", "%+7g",
-__LINE__, 1.437866591230707e-13, "1.43787e-13", "%g",
-__LINE__, 1.440593154445915e-01, "+0.144059", "%+1G",
-__LINE__, 1.441368205977342e+16, "1.441368E+16", "%#E",
-__LINE__, 1.441825266684367e+28, "1.44183e+28", "%g",
-__LINE__, 1.442374183199456e+20, "1.442374E+20", "%E",
-__LINE__, 1.445101893951061e-24, "0", "%0.f",
-__LINE__, 1.446037835160094e-20, "+1.44604E-20", "%+2G",
-__LINE__, 1.449245376093616e+04, "1.449245e+04", "%e",
-__LINE__, 1.454126845620100e+09, "1.45413E+09", "%G",
-__LINE__, 1.455764608801107e+09, "1.5e+09", "%6.1e",
-__LINE__, 1.457176183149955e-12, "1.45718e-12", "%#g",
-__LINE__, 1.458821535020046e-05, "1.45882e-05", "%#g",
-__LINE__, 1.460179141161202e-19, "1.460179E-19", "%#E",
-__LINE__, 1.461701055446198e-20, "1.461701e-20", "%#2.7g",
-__LINE__, 1.462408181482172e+10, "1.4624082E+10", "%3.7E",
-__LINE__, 1.463706296748154e+24, "1e+24", "%2.g",
-__LINE__, 1.464891255780761e-19, "+1.46489e-19", "%+g",
-__LINE__, 1.467903978945872e+25, "1.4679E+25", "%G",
-__LINE__, 1.468585992857062e+22, "14685859928570619281629.205943", "%f",
-__LINE__, 1.469803528668286e+29, "+1E+29", "%+6.G",
-__LINE__, 1.469883002609266e-23, "1.E-23", "%#2.E",
-__LINE__, 1.469941481858809e+08, "+146994148.185881", "%+f",
-__LINE__, 1.470744493304611e+13, "1.47074e+13", "%g",
-__LINE__, 1.471857261085004e+23, "1E+23", "%2.G",
-__LINE__, 1.474419778873037e+06, "1474419.7789", "%#.4f",
-__LINE__, 1.483134762223381e-03, "0", "%0.0f",
-__LINE__, 1.483575501240724e-13, "1.48358e-13", "%g",
-__LINE__, 1.486068112294452e+20, "1.486068e+20", "%e",
-__LINE__, 1.488665528787761e-03, " +0", "%+4.f",
-__LINE__, 1.492145267536713e+07, "14921452.675367", "%f",
-__LINE__, 1.492589762884761e-01, "0.149259", "%f",
-__LINE__, 1.494784286168215e+01, "1.494784E+01", "%E",
-__LINE__, 1.495945331501655e+04, "1.5e+04", "%.2g",
-__LINE__, 1.501383201904700e+14, "2e+14", "%1.g",
-__LINE__, 1.501387105011959e-02, "0.0150139", "%g",
-__LINE__, 1.505784488562271e+26, "1.50578e+26", "%5g",
-__LINE__, 1.506367986495534e+10, "1.50637e+10", "%2g",
-__LINE__, 1.507421710226296e+19, "1.507422E+19", "%#E",
-__LINE__, 1.507960881206134e+16, "2e+16", "%.0g",
-__LINE__, 1.508974301049424e+14, "+1.508974E+14", "%+E",
-__LINE__, 1.509204025111090e-18, "1.509204E-18", "%E",
-__LINE__, 1.511351799767759e+21, "1511351799767759462866.93397", "%.5f",
-__LINE__, 1.511712197184520e-06, "+1.51171e-06", "%+1g",
-__LINE__, 1.514703727491400e+02, "151.47", "%.5g",
-__LINE__, 1.514855355408287e+04, "15148.6", "%g",
-__LINE__, 1.516256896575301e+06, "1.516257e+06", "%.6e",
-__LINE__, 1.517712083681069e+14, "1.51771e+14", "%0g",
-__LINE__, 1.522102209167607e-18, "1.52210e-18", "%#g",
-__LINE__, 1.526264862895663e-12, "0.000000", "%f",
-__LINE__, 1.527165480858125e+10, "1.527e+10", "%.4g",
-__LINE__, 1.528363280308369e+00, "+1.52836", "%+0G",
-__LINE__, 1.529108490733420e-22, "1.529108E-22", "%E",
-__LINE__, 1.529783364474522e+19, "15297833644745216119.531506", "%7f",
-__LINE__, 1.530698363199346e-01, "0.1531", "%#.4f",
-__LINE__, 1.531520796537450e+22, "1.53152E+22", "%G",
-__LINE__, 1.533314559644813e+06, "+1533314.559645", "%+f",
-__LINE__, 1.534682791112854e+01, "+15.3468", "%+0G",
-__LINE__, 1.534714026386730e-11, "0.000000", "%f",
-__LINE__, 1.537145729498115e+00, "1.537146E+00", "%E",
-__LINE__, 1.538740040875751e-23, "1.538740E-23", "%E",
-__LINE__, 1.546248240596482e-03, "0.001546", "%f",
-__LINE__, 1.546808012239302e-09, "+1.54681E-09", "%+G",
-__LINE__, 1.546903877359107e+06, "1.5e+06", "%.2g",
-__LINE__, 1.550153973747718e-18, "2e-18", "%.0g",
-__LINE__, 1.551703460384378e+00, "+1.5517", "%+.4f",
-__LINE__, 1.553995673101369e+29, "1.554E+29", "%G",
-__LINE__, 1.555477017531899e+28, "1.55548e+28", "%g",
-__LINE__, 1.555548963448462e+12, "1555548963448.46227", "%6.5f",
-__LINE__, 1.558702451007712e+16, "2e+16", "%5.1g",
-__LINE__, 1.561641587723724e+29, "1.561642e+29", "%e",
-__LINE__, 1.561868589559509e-05, "1.56187E-05", "%G",
-__LINE__, 1.565229056438949e+13, "1.56523e+13", "%1.6g",
-__LINE__, 1.570074406600442e+14, "+1.57007E+14", "%+4G",
-__LINE__, 1.570951909913194e+13, "1.57095E+13", "%.6G",
-__LINE__, 1.572186421520727e-30, "+1.57219e-30", "%+g",
-__LINE__, 1.574374582066945e+12, "1.57e+12", "%5.2e",
-__LINE__, 1.577789404823585e+12, "1.577789E+12", "%E",
-__LINE__, 1.579641278389186e+04, "15796.413", "%7.3f",
-__LINE__, 1.581602330975388e+17, "1.5816E+17", "%#.5G",
-__LINE__, 1.587809692297490e-18, "+1.58781e-18", "%+2g",
-__LINE__, 1.588672954832388e-05, "1.58867E-05", "%G",
-__LINE__, 1.594548954259978e+25, "+1.595e+25", "%+.3e",
-__LINE__, 1.596653742160718e+10, "15966537421.6072", "%.4f",
-__LINE__, 1.597416186584641e+25, "1.59742e+25", "%g",
-__LINE__, 1.597810706039500e-04, "0.000159781", "%g",
-__LINE__, 1.601425691153542e+01, "16.0143", "%G",
-__LINE__, 1.601491150913706e-15, "+1.60149e-15", "%+g",
-__LINE__, 1.609357026469645e+02, "160.936", "%0g",
-__LINE__, 1.611064881461188e+06, "+1.611065E+06", "%+E",
-__LINE__, 1.611324319640770e-03, "0.00161132", "%G",
-__LINE__, 1.613202907940803e+19, "1.6E+19", "%#.1E",
-__LINE__, 1.613883500056636e-12, "0.000000", "%5f",
-__LINE__, 1.618254213010772e+07, "16182542.130108", "%6f",
-__LINE__, 1.620441271211248e-08, "1.62044E-08", "%0G",
-__LINE__, 1.622548435024803e-01, "+0.162255", "%+5G",
-__LINE__, 1.623740394555269e+19, "16237403945552689066.289531", "%3f",
-__LINE__, 1.625774250389937e+18, "1.625774e+18", "%1e",
-__LINE__, 1.626300864432426e-02, "0.016263", "%G",
-__LINE__, 1.626351146877694e-11, "1.6263511e-11", "%2.7e",
-__LINE__, 1.626568757587995e+25, "16265687575879949733348439.62220", "%6.5f",
-__LINE__, 1.626717482094360e-28, "+1.626717e-28", "%+3e",
-__LINE__, 1.630801585998995e-28, "1.6308e-28", "%0g",
-__LINE__, 1.631827173682962e+03, "1632", "%1.4g",
-__LINE__, 1.631907571243379e+18, "1631907571243378818.337533", "%f",
-__LINE__, 1.632058420447239e-14, " +2E-14", "%+7.G",
-__LINE__, 1.632847882621240e+18, "+1.63285E+18", "%+2G",
-__LINE__, 1.637329146233172e-09, "+1.63733e-09", "%+g",
-__LINE__, 1.638315287442427e-16, "+1.63832E-16", "%+G",
-__LINE__, 1.641284849351445e+15, "1641284849351445.096488", "%f",
-__LINE__, 1.644871927486929e+10, "2e+10", "%1.e",
-__LINE__, 1.645917293047431e-19, "1.64592e-19", "%.6g",
-__LINE__, 1.649201265647819e-07, "0.000000", "%f",
-__LINE__, 1.650169065733559e+23, "165016906573355903731226.135278", "%3f",
-__LINE__, 1.651217291298196e-30, "2E-30", "%4.G",
-__LINE__, 1.652680660160331e+08, "2.e+08", "%#3.g",
-__LINE__, 1.654171892948767e-15, "1.65417e-15", "%g",
-__LINE__, 1.655435863725412e+17, "+1.655436e+17", "%+#e",
-__LINE__, 1.656015606204101e+28, "+1.7E+28", "%+3.2G",
-__LINE__, 1.656814723110478e-21, "+0.000000", "%+f",
-__LINE__, 1.658632655199721e-19, "2.E-19", "%#4.G",
-__LINE__, 1.659915061311444e+27, "1.66E+27", "%.3G",
-__LINE__, 1.664258574522914e-29, "+1.664259E-29", "%+E",
-__LINE__, 1.667662840654469e-28, "+2e-28", "%+0.g",
-__LINE__, 1.673124993246863e-25, "+0.000000", "%+f",
-__LINE__, 1.677788498058833e-20, "1.678e-20", "%.4g",
-__LINE__, 1.681211731173386e-07, "1.68121e-07", "%0.6g",
-__LINE__, 1.686341560076196e+02, "169", "%.0f",
-__LINE__, 1.686507685287281e+08, "1.686508E+08", "%E",
-__LINE__, 1.689500448795801e+03, "+1689.500449", "%+0f",
-__LINE__, 1.690639426041009e-13, "2e-13", "%5.0g",
-__LINE__, 1.691554939595928e+16, "+1.6916e+16", "%+.5g",
-__LINE__, 1.698597126229626e-09, "1.699e-09", "%3.4g",
-__LINE__, 1.700093083173516e+16, "17000930831735159", "%5.f",
-__LINE__, 1.703653732982710e+13, "+1.70365e+13", "%+g",
-__LINE__, 1.705353380573352e-16, "0.000000", "%f",
-__LINE__, 1.705973328700179e-26, "1.70597e-26", "%5g",
-__LINE__, 1.717797289369145e+22, "+1.717797E+22", "%+7E",
-__LINE__, 1.722819196705361e-28, "1.722819E-28", "%1.7G",
-__LINE__, 1.723775772891202e+01, "17.237758", "%f",
-__LINE__, 1.723787102325353e-23, "0.000000", "%2f",
-__LINE__, 1.724551301171870e-13, "0.000000", "%f",
-__LINE__, 1.726098078655758e-20, "0.0000000", "%7.7f",
-__LINE__, 1.726302822039762e+18, "+2E+18", "%+1.G",
-__LINE__, 1.726659209108151e+18, "+1.72666E+18", "%+6G",
-__LINE__, 1.728324925097269e-25, "1.728325e-25", "%7e",
-__LINE__, 1.728357491215602e+02, "172.836", "%G",
-__LINE__, 1.729612227517587e+22, "1.729612e+22", "%e",
-__LINE__, 1.731753104740805e-06, "1.73175e-06", "%2g",
-__LINE__, 1.736066279733589e+18, "+1.736066E+18", "%+3E",
-__LINE__, 1.736626769480182e-19, "2e-19", "%.0g",
-__LINE__, 1.737445267713118e-13, " 2e-13", "%7.g",
-__LINE__, 1.739264683023077e+05, "173926.468302", "%f",
-__LINE__, 1.739423702667596e-16, "+1.73942e-16", "%+g",
-__LINE__, 1.741053616961658e-14, "1.74105E-14", "%G",
-__LINE__, 1.741085952255057e+29, "1.7e+29", "%#.1e",
-__LINE__, 1.743673705633426e+03, "2E+03", "%5.0G",
-__LINE__, 1.750940899205665e+27, "1.75094e+27", "%g",
-__LINE__, 1.753871003884151e-26, "0.", "%#.0f",
-__LINE__, 1.755237470854478e-14, "1.755237e-14", "%4e",
-__LINE__, 1.757491419837315e-03, "0.002", "%1.G",
-__LINE__, 1.758657797688126e+26, "+1.75866E+26", "%+#G",
-__LINE__, 1.760491452270889e+08, "1.76049E+08", "%G",
-__LINE__, 1.760816275862939e-10, "2e-10", "%.1g",
-__LINE__, 1.760905893493003e-22, "1.76e-22", "%.2e",
-__LINE__, 1.762101125986743e-12, "2e-12", "%.0g",
-__LINE__, 1.763855968659571e+27, "1.763856E+27", "%E",
-__LINE__, 1.764595217341348e-13, "1.764595E-13", "%E",
-__LINE__, 1.766737296048445e+08, "+1.77e+08", "%+.3g",
-__LINE__, 1.769916386969961e-05, "+1.76992e-05", "%+g",
-__LINE__, 1.773873506344176e-01, "1.773874e-01", "%e",
-__LINE__, 1.775392554371421e+03, "+1775.39", "%+3.2f",
-__LINE__, 1.776007623006870e+24, "1776007623006870161930237.372871", "%f",
-__LINE__, 1.777418921678653e-27, " 0", "%6.f",
-__LINE__, 1.780967607234234e-18, "1.780968E-18", "%E",
-__LINE__, 1.782510583486435e+24, "+2e+24", "%+3.g",
-__LINE__, 1.784002921603004e+14, "1.784E+14", "%G",
-__LINE__, 1.784231151778382e+11, "1.7842E+11", "%.5G",
-__LINE__, 1.785589091453195e+02, " 179.", "%#5.f",
-__LINE__, 1.786402639400039e+19, "2e+19", "%0.g",
-__LINE__, 1.786506485794647e-25, "2E-25", "%.1G",
-__LINE__, 1.787513971482493e-04, "+0.000178751", "%+G",
-__LINE__, 1.799765409320039e+23, "179976540932003885586710", "%6.0f",
-__LINE__, 1.800451864218989e+08, "+1.80045e+08", "%+g",
-__LINE__, 1.800743538258572e+04, " +18007", "%+7.f",
-__LINE__, 1.801583764453362e+25, "1.8016e+25", "%0.5g",
-__LINE__, 1.804502093739547e+14, "2e+14", "%2.g",
-__LINE__, 1.805600104488678e-17, "1.805600E-17", "%E",
-__LINE__, 1.811342448081048e+17, "1.811342e+17", "%.6e",
-__LINE__, 1.812252160066930e+19, "2e+19", "%0.e",
-__LINE__, 1.816287564395273e+02, "182", "%2.f",
-__LINE__, 1.817097386762552e-13, "2E-13", "%3.1G",
-__LINE__, 1.817881381387254e+06, "1.81788E+06", "%G",
-__LINE__, 1.818416380830953e-30, "1.81842E-30", "%G",
-__LINE__, 1.824788290177454e-23, "1.82479e-23", "%g",
-__LINE__, 1.827832506678437e-18, "1.82783E-18", "%G",
-__LINE__, 1.828048053242609e+01, "18.2805", "%g",
-__LINE__, 1.828939681844203e-21, "1.82894E-21", "%.6G",
-__LINE__, 1.829763900251753e+12, "1829763900251.752773", "%1f",
-__LINE__, 1.833100407114602e-05, "0.000018", "%#f",
-__LINE__, 1.833672780034284e-07, "1.833673e-07", "%e",
-__LINE__, 1.834307692387540e+21, "2E+21", "%5.G",
-__LINE__, 1.835119931666753e+14, "+1.835120e+14", "%+e",
-__LINE__, 1.835956566920861e-26, "0.000000", "%#f",
-__LINE__, 1.837784131899354e+22, "1.83778E+22", "%G",
-__LINE__, 1.842867094224664e-09, "1.84287e-09", "%g",
-__LINE__, 1.844234823805319e+28, "2E+28", "%1.G",
-__LINE__, 1.844877682008962e+12, "1.84488e+12", "%g",
-__LINE__, 1.846530424340488e-22, "1.846530e-22", "%#.7g",
-__LINE__, 1.849111603036448e-08, "0.00", "%.2f",
-__LINE__, 1.850158752678734e+04, "+18502", "%+.5G",
-__LINE__, 1.851431391104701e-06, " +2e-06", "%+7.e",
-__LINE__, 1.851487430609031e-04, "0.000185149", "%G",
-__LINE__, 1.853171650128773e+03, "1853.17", "%G",
-__LINE__, 1.854743263740068e-16, "1.854743E-16", "%6.6E",
-__LINE__, 1.864399020932753e-11, "+0.000000", "%+f",
-__LINE__, 1.865028568072397e-22, "1.86503E-22", "%.6G",
-__LINE__, 1.868128423759223e+14, "1.86813E+14", "%4G",
-__LINE__, 1.868453558435480e+21, "1.86845E+21", "%G",
-__LINE__, 1.870663011627498e-06, "1.87E-06", "%.3G",
-__LINE__, 1.873273487748907e+17, "+1.873273E+17", "%+E",
-__LINE__, 1.878885220839805e-04, "0.000187889", "%G",
-__LINE__, 1.879102515623569e+17, "1.8791e+17", "%g",
-__LINE__, 1.889343972100858e-10, "2E-10", "%2.E",
-__LINE__, 1.891833282879762e-24, "+2e-24", "%+.1g",
-__LINE__, 1.895148778941240e-07, "0.000000", "%0f",
-__LINE__, 1.896950834067578e-28, "+1.89695e-28", "%+#g",
-__LINE__, 1.898464546986629e-05, "1.898465e-05", "%.7g",
-__LINE__, 1.900851427578321e-19, "1.90085e-19", "%6g",
-__LINE__, 1.901171344577750e+27, "1.901171e+27", "%7.7g",
-__LINE__, 1.903563335316359e+02, "190.356", "%0g",
-__LINE__, 1.903817306004701e-16, "+1.90e-16", "%+#6.2e",
-__LINE__, 1.910606410246797e+21, "1.91061E+21", "%2.5E",
-__LINE__, 1.912537759564710e+29, "1.91254E+29", "%G",
-__LINE__, 1.913606675894566e+27, "1.91361E+27", "%7.6G",
-__LINE__, 1.916473734025505e-05, " 2e-05", "%7.g",
-__LINE__, 1.916507511720523e+23, "+2E+23", "%+.0E",
-__LINE__, 1.917688262248837e-28, "1.918e-28", "%.4g",
-__LINE__, 1.921375594217083e-12, "1.92138E-12", "%G",
-__LINE__, 1.923916000932815e-25, "1.92392E-25", "%G",
-__LINE__, 1.926303652776462e-01, "+0.2", "%+0.G",
-__LINE__, 1.929411084211293e+21, "1.92941E+21", "%6G",
-__LINE__, 1.929996820297491e-26, "1.93e-26", "%.6g",
-__LINE__, 1.937301472034748e-29, "1.9373E-29", "%G",
-__LINE__, 1.937301660220894e-11, "+1.9373E-11", "%+G",
-__LINE__, 1.939038538587083e-02, "0.0193904", "%g",
-__LINE__, 1.940575489112444e-09, "1.94058E-09", "%G",
-__LINE__, 1.946550455606677e-26, "1.946550E-26", "%#1E",
-__LINE__, 1.954250777559491e-14, "1.95425E-14", "%G",
-__LINE__, 1.955646327688473e-16, "1.956E-16", "%#.3E",
-__LINE__, 1.956999911995683e+20, "2E+20", "%2.G",
-__LINE__, 1.959125254298784e-21, "1.95913E-21", "%#G",
-__LINE__, 1.960330340481290e+26, "1.96033e+26", "%.6g",
-__LINE__, 1.964156478075422e+01, "+19.6416", "%+g",
-__LINE__, 1.964702507676036e+19, "2.0e+19", "%2.1e",
-__LINE__, 1.965762191674409e-30, "2E-30", "%1.G",
-__LINE__, 1.967492699686803e-29, "+1.967493E-29", "%+#E",
-__LINE__, 1.970072604062236e-11, "+1.97007E-11", "%+G",
-__LINE__, 1.975631055550387e+05, "197563.105555", "%.6f",
-__LINE__, 1.975722425389177e+28, "+1.975722e+28", "%+5.6e",
-__LINE__, 1.977938328895365e-05, " 2e-05", "%6.e",
-__LINE__, 1.981950849019640e+13, "1.981951E+13", "%E",
-__LINE__, 1.982543168856985e-26, "1.98254e-26", "%4g",
-__LINE__, 1.984873317384181e-20, "1.98487E-20", "%4G",
-__LINE__, 1.986146420877074e+02, "+1.986146e+02", "%+0e",
-__LINE__, 1.986465942785167e-28, "1.98647e-28", "%g",
-__LINE__, 1.988250323235468e-05, " +0", "%+7.f",
-__LINE__, 1.989966623080645e-09, "1.989967e-09", "%e",
-__LINE__, 1.991243122514519e+11, "199124312251", "%5.f",
-__LINE__, 1.993287894645908e+25, "+1.993288E+25", "%+E",
-__LINE__, 1.995172329888890e-30, "+1.99517e-30", "%+3g",
-__LINE__, 1.997075127236432e+05, "1.997E+05", "%#.4G",
-__LINE__, 2.000651599487290e+04, "2E+04", "%2.E",
-__LINE__, 2.001429412876339e-28, "0.000000", "%6f",
-__LINE__, 2.003535646264196e+03, " 2E+03", "%7.G",
-__LINE__, 2.011751504116246e+06, "2E+06", "%2.G",
-__LINE__, 2.016361237694652e-30, "2.01636e-30", "%4g",
-__LINE__, 2.018266414065554e-08, "0.00", "%2.2f",
-__LINE__, 2.020706780608565e+03, "2E+03", "%.0G",
-__LINE__, 2.025098418552005e-16, "+2.025098E-16", "%+2E",
-__LINE__, 2.026100592518976e-11, "2.026101e-11", "%6e",
-__LINE__, 2.026167291572980e+11, "2.02617E+11", "%G",
-__LINE__, 2.026782170272331e+07, "2.026782E+07", "%E",
-__LINE__, 2.029133469449347e-06, " 2e-06", "%6.g",
-__LINE__, 2.031191570768443e-20, "2.031192E-20", "%2.7G",
-__LINE__, 2.031884221862863e-16, "2.031884e-16", "%e",
-__LINE__, 2.032992924118323e+29, "203299292411832333016263874014.84", "%#0.2f",
-__LINE__, 2.035799610097827e+28, "+20357996100978272835391180706.2104344", "%+3.7f",
-__LINE__, 2.038008183612069e+25, "20380081836120691463065668", "%7.0f",
-__LINE__, 2.041632205119365e-22, "+2.04163e-22", "%+g",
-__LINE__, 2.042769811159352e-10, "2e-10", "%.1g",
-__LINE__, 2.043034975847005e-08, "2.043035e-08", "%e",
-__LINE__, 2.045930666285880e+26, "2.04593e+26", "%g",
-__LINE__, 2.048377276651386e-21, "0.00000", "%2.5f",
-__LINE__, 2.051785787301292e-23, "0.000000", "%f",
-__LINE__, 2.055085792048183e-10, "0.000000", "%f",
-__LINE__, 2.055783028451040e-21, "+0", "%+1.f",
-__LINE__, 2.057641607509489e-17, "+2E-17", "%+2.G",
-__LINE__, 2.058348703001600e-15, "2.05835E-15", "%#G",
-__LINE__, 2.059594758787322e+24, "2.05959E+24", "%1G",
-__LINE__, 2.062710740295018e+01, "20.6271", "%G",
-__LINE__, 2.063240676447750e-11, "0.000000", "%f",
-__LINE__, 2.063799238238917e-09, "+0.000000", "%+f",
-__LINE__, 2.064564135160425e-17, "2.06456E-17", "%G",
-__LINE__, 2.066363476927650e-05, "2.07E-05", "%.3G",
-__LINE__, 2.066871450514214e-02, "+2.066871e-02", "%+e",
-__LINE__, 2.067258256169148e+07, "2.06726e+07", "%g",
-__LINE__, 2.068466590729350e-22, "0.0000", "%.4f",
-__LINE__, 2.068779510112540e-26, "2.06878e-26", "%g",
-__LINE__, 2.069258770387493e+19, "20692587703874929516.700831", "%3f",
-__LINE__, 2.069547778447951e+26, "2.069548e+26", "%6e",
-__LINE__, 2.070479507710941e-23, "2.07048E-23", "%G",
-__LINE__, 2.071809640061785e+22, "2.071810E+22", "%E",
-__LINE__, 2.073364463564950e-06, "2.07336e-06", "%g",
-__LINE__, 2.073478953644888e-10, "+2.07E-10", "%+.3G",
-__LINE__, 2.076039194312519e+12, "2.07604E+12", "%G",
-__LINE__, 2.081490398946229e-07, "+2.08149e-07", "%+g",
-__LINE__, 2.084941170287895e-07, "2.084941E-07", "%7E",
-__LINE__, 2.087035885023382e-18, "+0.000000", "%+f",
-__LINE__, 2.091025884363342e-09, "2.09103E-09", "%G",
-__LINE__, 2.091830555397864e+08, "209183056", "%0.f",
-__LINE__, 2.091998109232084e-22, "0.000000", "%#f",
-__LINE__, 2.093406473464940e-17, "2.09341e-17", "%g",
-__LINE__, 2.094646724039720e-26, "2.094647e-26", "%0.7g",
-__LINE__, 2.095218667083208e-22, "2.09522e-22", "%.5e",
-__LINE__, 2.096932364992728e-27, "2.1E-27", "%.2G",
-__LINE__, 2.097012452732083e+17, "2.09701E+17", "%G",
-__LINE__, 2.102022216908102e-07, "0.000000", "%f",
-__LINE__, 2.104648382618938e-04, "0.00021", "%.3G",
-__LINE__, 2.109159578853690e-19, "2.10916e-19", "%6g",
-__LINE__, 2.111732624641178e-13, "+2.111733E-13", "%+7.7G",
-__LINE__, 2.112676138351330e+21, " 2e+21", "%6.g",
-__LINE__, 2.117332904051741e-09, "+0.000000", "%+f",
-__LINE__, 2.118001353767757e-14, "2.118E-14", "%4.3E",
-__LINE__, 2.119413720893955e+12, "2.119414E+12", "%.7G",
-__LINE__, 2.119610992647014e+07, "+21196109.9265", "%+.4f",
-__LINE__, 2.120504022069221e+25, "21205040220692210617414730.223", "%#.3f",
-__LINE__, 2.120634617123718e-16, "2.120635e-16", "%#e",
-__LINE__, 2.128702437175385e+12, "2128702437175.385", "%.3f",
-__LINE__, 2.131148830213536e-12, "2.131149e-12", "%e",
-__LINE__, 2.132682622145255e+04, "+21326.83", "%+#5.7G",
-__LINE__, 2.133864841676473e-01, " +0.2", "%+6.g",
-__LINE__, 2.133939058496273e+16, "2E+16", "%4.G",
-__LINE__, 2.135087006806302e-24, "0.000000", "%f",
-__LINE__, 2.138983961194584e-20, "+2.138984e-20", "%+7e",
-__LINE__, 2.146534189669224e+17, "+2.147E+17", "%+.4G",
-__LINE__, 2.147375595676503e+09, "2.147376e+09", "%e",
-__LINE__, 2.152994986418075e+02, "2E+02", "%0.E",
-__LINE__, 2.154127135896811e+06, "2.15E+06", "%2.3G",
-__LINE__, 2.154613053892588e-29, "2.1546E-29", "%.4E",
-__LINE__, 2.160830430730653e-12, "2.16083E-12", "%#G",
-__LINE__, 2.161740591663027e+28, "2.161741e+28", "%e",
-__LINE__, 2.167181665934011e-06, "2e-06", "%1.e",
-__LINE__, 2.167348761729060e-04, "2.167349e-04", "%#e",
-__LINE__, 2.170270852816708e-10, "2.17027E-10", "%0G",
-__LINE__, 2.173048229189370e-06, "2.173e-06", "%.5g",
-__LINE__, 2.175554537855024e+10, "2.17555E+10", "%G",
-__LINE__, 2.177447372527968e-30, "+0.000000", "%+.6f",
-__LINE__, 2.178591661569858e+05, "2.1786e+05", "%1.5g",
-__LINE__, 2.184700207174818e-29, "0.000000", "%f",
-__LINE__, 2.190817031437247e+03, "2.E+03", "%#3.0E",
-__LINE__, 2.191396212145558e-01, "2.191E-01", "%6.3E",
-__LINE__, 2.191786353372880e-23, "2.19179e-23", "%.5e",
-__LINE__, 2.193471126151079e+19, "2.1935E+19", "%.4E",
-__LINE__, 2.194750177630526e-15, "2.194750e-15", "%e",
-__LINE__, 2.196145170358973e+05, "+219615", "%+g",
-__LINE__, 2.199602360934320e-09, "2.19960E-09", "%#6.6G",
-__LINE__, 2.202913988776998e+17, "+2.20291e+17", "%+g",
-__LINE__, 2.207094560707703e-10, "2.207095e-10", "%e",
-__LINE__, 2.207557214621658e-13, " 0", "%4.f",
-__LINE__, 2.209428206272229e+13, "2.20943e+13", "%g",
-__LINE__, 2.212662463615175e-11, " 0", "%4.0f",
-__LINE__, 2.215732710968468e-30, "2E-30", "%.1G",
-__LINE__, 2.218490841936778e-10, "2.21849e-10", "%2g",
-__LINE__, 2.218850610567959e-01, "+0.221885", "%+G",
-__LINE__, 2.220796939261542e-03, "0.002221", "%#f",
-__LINE__, 2.221819894808024e+24, "2.2e+24", "%5.1e",
-__LINE__, 2.223804993235507e+27, "2.223805e+27", "%1e",
-__LINE__, 2.224715386046563e-17, "0.00000", "%#.5f",
-__LINE__, 2.224864709983882e-16, "+2.224865e-16", "%+e",
-__LINE__, 2.225764510969505e+16, "2.E+16", "%#4.G",
-__LINE__, 2.233229189161284e-07, "+2.23323e-07", "%+6g",
-__LINE__, 2.236522807209868e+17, "2.23652e+17", "%g",
-__LINE__, 2.236641620849775e+20, "2E+20", "%0.G",
-__LINE__, 2.237089952728626e-13, "2E-13", "%5.E",
-__LINE__, 2.238531255563381e-11, " 2E-11", "%7.1G",
-__LINE__, 2.242782296436871e+12, "2242782296436.871103", "%f",
-__LINE__, 2.249177852069393e-02, "+2.249178E-02", "%+5E",
-__LINE__, 2.250735782732076e+29, "+2.25074e+29", "%+g",
-__LINE__, 2.257455203557544e-11, "+2e-11", "%+4.0g",
-__LINE__, 2.258002527939529e+24, "2.258e+24", "%g",
-__LINE__, 2.266955929448160e+20, "226695592944815960123.6056915", "%.7f",
-__LINE__, 2.269019719123250e-23, "0.000000", "%f",
-__LINE__, 2.269022332502809e+02, "+226.902233", "%+f",
-__LINE__, 2.271165222038591e-03, "0.002", "%1.1g",
-__LINE__, 2.273965946408021e+14, "+227396594640802.085507", "%+f",
-__LINE__, 2.277221153386242e+22, "22772211533862418697538.032575", "%#f",
-__LINE__, 2.280214920187521e-01, "0.2", "%2.G",
-__LINE__, 2.280762993019740e+06, "2.28076E+06", "%G",
-__LINE__, 2.283479263040833e-24, "+0.000000", "%+f",
-__LINE__, 2.283686319235123e-07, "2.2837E-07", "%5.5G",
-__LINE__, 2.285842617231066e-26, "0.000000", "%f",
-__LINE__, 2.293145864755873e-02, "0.02", "%.0g",
-__LINE__, 2.293439381531532e+03, "+2.293439E+03", "%+#1E",
-__LINE__, 2.297972500660698e-22, "2.29797e-22", "%g",
-__LINE__, 2.298725366073681e+23, "2.29873E+23", "%G",
-__LINE__, 2.303151535483950e-29, "2.30315E-29", "%G",
-__LINE__, 2.308565313657699e-25, " 0", "%4.f",
-__LINE__, 2.309305373760733e-07, "2.309305E-07", "%E",
-__LINE__, 2.309693761334710e-19, "2.30969e-19", "%g",
-__LINE__, 2.312218220995774e-20, "+2.31222E-20", "%+.6G",
-__LINE__, 2.313115729670525e+24, "2.31312E+24", "%G",
-__LINE__, 2.315325159866773e-21, "2.315325E-21", "%E",
-__LINE__, 2.316932917620091e-19, "0.000000", "%f",
-__LINE__, 2.317548394633895e+13, "2.31755E+13", "%0G",
-__LINE__, 2.318951465093612e+02, "+2.32e+02", "%+1.2e",
-__LINE__, 2.319151794905482e-17, "+0.000000", "%+0f",
-__LINE__, 2.319708617851078e-27, "0.000000", "%f",
-__LINE__, 2.320019976591725e+20, "2e+20", "%.1g",
-__LINE__, 2.322859962551666e+06, "2.32286e+06", "%g",
-__LINE__, 2.326474568074649e-29, "2.326e-29", "%.4g",
-__LINE__, 2.328400844172053e-07, "2.3284E-07", "%G",
-__LINE__, 2.333695247698112e+16, "2.3337e+16", "%g",
-__LINE__, 2.333717120257130e-19, "+0.000000", "%+f",
-__LINE__, 2.334711793234782e-19, "2.33471E-19", "%5G",
-__LINE__, 2.335524987281242e+02, "+233.55", "%+7.5g",
-__LINE__, 2.335556767836369e-30, "2.34e-30", "%.3g",
-__LINE__, 2.337696964360052e-10, "2.3377e-10", "%1g",
-__LINE__, 2.337858249184500e-14, "2.337858E-14", "%5.6E",
-__LINE__, 2.339984354781169e-14, "2.339984E-14", "%E",
-__LINE__, 2.340849041430089e-04, "0.00023", "%0.2G",
-__LINE__, 2.342388410373363e-24, "2.34239E-24", "%G",
-__LINE__, 2.343933106737237e-22, "2.34393e-22", "%g",
-__LINE__, 2.344870855713960e-08, "0.000000", "%.6f",
-__LINE__, 2.347368965433808e+24, "2347368965433808352116785", "%4.f",
-__LINE__, 2.349417462171421e-02, "+0.0234942", "%+G",
-__LINE__, 2.351071111431207e+11, "235107111143.12", "%.2f",
-__LINE__, 2.352756222810670e+19, "+2.e+19", "%+#4.g",
-__LINE__, 2.355862529217003e-22, "2.355863e-22", "%#4e",
-__LINE__, 2.356804045401445e-30, "2.3568E-30", "%G",
-__LINE__, 2.362100710185559e-26, "2.3621e-26", "%g",
-__LINE__, 2.368330779173562e-12, " 0", "%4.f",
-__LINE__, 2.383329784369796e+22, "2.38333E+22", "%G",
-__LINE__, 2.386845229536477e+01, "+23.868452", "%+#f",
-__LINE__, 2.388207830036780e-05, "0.000024", "%f",
-__LINE__, 2.391809468802907e+21, "+2.391809e+21", "%+e",
-__LINE__, 2.395172908564692e-09, "+0.000000", "%+f",
-__LINE__, 2.395447167030886e-29, "2.39545e-29", "%g",
-__LINE__, 2.397292973389182e+16, "23972929733891823", "%6.f",
-__LINE__, 2.401749832237687e-30, "2.401750E-30", "%E",
-__LINE__, 2.403610502544347e-03, "0.00240361", "%4G",
-__LINE__, 2.404676421776132e+17, "240467642177613206", "%6.f",
-__LINE__, 2.406327689091479e+25, "2.406328e+25", "%e",
-__LINE__, 2.407341999590511e-02, "0.024073", "%f",
-__LINE__, 2.407352797581004e+05, "240735.", "%#g",
-__LINE__, 2.407903467439017e+13, "2.4079E+13", "%G",
-__LINE__, 2.407979635013539e+21, " +2E+21", "%+7.G",
-__LINE__, 2.409513517930790e+29, "240951351793079027174826478585.600853", "%f",
-__LINE__, 2.412530651221551e+10, "+2.41253E+10", "%+G",
-__LINE__, 2.419943224673811e+00, "2.41994", "%#g",
-__LINE__, 2.422474399040258e-15, "0.000000", "%f",
-__LINE__, 2.426060206689458e+18, "2.42606E+18", "%1G",
-__LINE__, 2.439982659679872e+14, "+2.439983E+14", "%+E",
-__LINE__, 2.440528851375447e+13, "24405288513754.466173", "%f",
-__LINE__, 2.441340473292679e+19, "2.44134E+19", "%G",
-__LINE__, 2.443521636943916e+19, " 2.e+19", "%#7.g",
-__LINE__, 2.445925211597624e-27, "2.445925E-27", "%E",
-__LINE__, 2.446966179060722e+25, "2.446966e+25", "%5e",
-__LINE__, 2.447714218717278e+11, "2e+11", "%1.e",
-__LINE__, 2.448339744613286e+06, "2.4483e+06", "%3.5g",
-__LINE__, 2.448772993496189e+03, "2448.77", "%G",
-__LINE__, 2.448857654325229e+22, "+2.44886e+22", "%+g",
-__LINE__, 2.450082452098890e-27, "2.4501E-27", "%#3.5G",
-__LINE__, 2.451293602221637e+05, "245129.360222", "%f",
-__LINE__, 2.454531490229426e+02, "245.453", "%G",
-__LINE__, 2.458958369944980e+14, "2.5E+14", "%6.1E",
-__LINE__, 2.463666680775038e+14, "+246366668077503.80", "%+#.2f",
-__LINE__, 2.471582990960795e+05, "2.471583e+05", "%e",
-__LINE__, 2.474107179274687e+22, "2.47411e+22", "%g",
-__LINE__, 2.474332114849132e-08, "+2.47433e-08", "%+g",
-__LINE__, 2.476956762431716e+18, "+2476956762431715919.348107", "%+#f",
-__LINE__, 2.479091221850607e-22, "0.000000", "%f",
-__LINE__, 2.479819586598431e-24, "2.47982e-24", "%g",
-__LINE__, 2.480006174601455e-05, "2.48001E-05", "%G",
-__LINE__, 2.482672677638334e-26, "+0.000000", "%+f",
-__LINE__, 2.492816492208918e-14, " 0", "%7.f",
-__LINE__, 2.492964173197140e-12, " 2e-12", "%7.g",
-__LINE__, 2.494646635961173e+02, "249.465", "%g",
-__LINE__, 2.494687818780545e+11, "249468781878.054546", "%#7f",
-__LINE__, 2.510083560147301e-13, "+2.510084e-13", "%+#e",
-__LINE__, 2.511186607989480e-30, "2.51E-30", "%.3G",
-__LINE__, 2.514164516133643e-11, "2.51416e-11", "%g",
-__LINE__, 2.517242520804735e+11, "2.517243e+11", "%e",
-__LINE__, 2.518526126400833e-26, "2.51853e-26", "%g",
-__LINE__, 2.520313416401176e+09, "2520313416.401176", "%5f",
-__LINE__, 2.521653160738683e-29, "2.52165e-29", "%#g",
-__LINE__, 2.521941342615338e-16, "2.52194e-16", "%g",
-__LINE__, 2.523554774354461e-03, "+3E-03", "%+.0E",
-__LINE__, 2.525434130825058e+06, "+2.525434E+06", "%+E",
-__LINE__, 2.527616380113364e+02, "2.527616E+02", "%E",
-__LINE__, 2.531871347913505e+09, "+2.53187E+09", "%+#G",
-__LINE__, 2.532167428661069e+06, "2532167.428661", "%f",
-__LINE__, 2.545585718405995e+14, "+2.54559E+14", "%+G",
-__LINE__, 2.546305097286406e+10, "2.546305e+10", "%e",
-__LINE__, 2.547467156069069e-30, "+0.00", "%+3.2f",
-__LINE__, 2.548728793004506e-14, "2.54873E-14", "%G",
-__LINE__, 2.560375602395090e+11, "256037560239.509032", "%0f",
-__LINE__, 2.560555687476687e+03, "2561", "%.4g",
-__LINE__, 2.561709077363443e-24, "+0.000000", "%+f",
-__LINE__, 2.563763849675242e+10, "2.5637638E+10", "%.7E",
-__LINE__, 2.567482414574355e+11, "+2.567482e+11", "%+e",
-__LINE__, 2.571575046303674e-17, "3E-17", "%2.0E",
-__LINE__, 2.572997971296986e+11, "257299797129.698593", "%f",
-__LINE__, 2.578625935900331e+22, "25786259359003311786295.853381", "%f",
-__LINE__, 2.579663282966370e+12, "2.579663e+12", "%e",
-__LINE__, 2.593141782397610e-08, "0.000000", "%f",
-__LINE__, 2.594386109584196e+04, "3.E+04", "%#6.0E",
-__LINE__, 2.598069318007816e-22, "2.59807e-22", "%g",
-__LINE__, 2.600910462290091e+09, "2.600910E+09", "%6E",
-__LINE__, 2.602580183614458e-03, "2.602580e-03", "%e",
-__LINE__, 2.606540360440264e+09, "+2606540360.4", "%+#0.1f",
-__LINE__, 2.610016419698116e-21, "+3.e-21", "%+#3.g",
-__LINE__, 2.612279323574882e-20, "2.61228E-20", "%G",
-__LINE__, 2.614157324336453e-14, "2.61416e-14", "%g",
-__LINE__, 2.614688721873993e-09, "2.61e-09", "%6.2e",
-__LINE__, 2.616661104472416e-15, " 0", "%5.f",
-__LINE__, 2.616742079283195e-09, " +3E-09", "%+7.E",
-__LINE__, 2.618075304717427e+24, "2.618075e+24", "%e",
-__LINE__, 2.624118573335769e+26, "262411857333576925555007619.550452", "%1f",
-__LINE__, 2.625718894274227e+24, "+2625718894274227110940955.753904", "%+f",
-__LINE__, 2.627081999477812e+03, "2627.081999", "%f",
-__LINE__, 2.631061062224705e+14, "263106106222470.481626", "%f",
-__LINE__, 2.631545877128814e+27, "+2.63155e+27", "%+g",
-__LINE__, 2.632694395848818e-11, "2.63269e-11", "%g",
-__LINE__, 2.636728891022008e-22, "+2.63673e-22", "%+#4g",
-__LINE__, 2.638495675008130e-28, "+2.638496e-28", "%+e",
-__LINE__, 2.639704195859799e-11, "0.", "%#.0f",
-__LINE__, 2.641645264652665e-20, "0", "%0.f",
-__LINE__, 2.642012075064497e-20, "3E-20", "%0.E",
-__LINE__, 2.648725869006487e-29, " 3E-29", "%6.G",
-__LINE__, 2.649060724417770e+12, "3E+12", "%3.G",
-__LINE__, 2.651188545120166e-17, "0.000", "%.3f",
-__LINE__, 2.652302152621621e+14, "2.7E+14", "%.2G",
-__LINE__, 2.653309718412604e-28, "0.000000", "%f",
-__LINE__, 2.658344750491858e-21, " 3e-21", "%6.g",
-__LINE__, 2.664625074612594e+15, "3e+15", "%1.g",
-__LINE__, 2.666953728270800e-15, "3e-15", "%0.e",
-__LINE__, 2.674515419678877e-11, " 3E-11", "%6.E",
-__LINE__, 2.680054917256578e+15, "2680054917256577.5", "%#2.1f",
-__LINE__, 2.680495609883415e-11, "2.68E-11", "%#.3G",
-__LINE__, 2.685757893641070e+23, "268575789364107020418259.70809", "%1.5f",
-__LINE__, 2.695551226058178e+16, "26955512260581775.407786", "%f",
-__LINE__, 2.696346377519671e+04, "+26963.5", "%+G",
-__LINE__, 2.714262310601257e+17, "+2.714262E+17", "%+E",
-__LINE__, 2.719227450016317e-01, "0.271923", "%G",
-__LINE__, 2.724135433346056e-30, "+2.72414e-30", "%+g",
-__LINE__, 2.725143224130276e+14, "272514322413027.576530", "%6f",
-__LINE__, 2.729355189648310e-03, "+0.00273", "%+.5f",
-__LINE__, 2.732872167724945e+11, "2.73287E+11", "%G",
-__LINE__, 2.737709476435412e+17, "273770947643541218.141650", "%f",
-__LINE__, 2.739299356074967e-15, "2.7E-15", "%.2G",
-__LINE__, 2.740793612304798e-27, "2.740794E-27", "%.7G",
-__LINE__, 2.742030156175960e+20, "2.74203e+20", "%2.6g",
-__LINE__, 2.744455324096085e+11, "2.74446E+11", "%G",
-__LINE__, 2.745179546531160e+07, "2.7452E+07", "%.5G",
-__LINE__, 2.747470562525333e+04, "3E+04", "%2.E",
-__LINE__, 2.750243314674629e+21, "2.75024E+21", "%#G",
-__LINE__, 2.750250224436030e+20, "+2.750250e+20", "%+0.6e",
-__LINE__, 2.752712858561084e-22, "2.752713e-22", "%e",
-__LINE__, 2.756982987656667e-03, "0.002756983", "%#.7G",
-__LINE__, 2.761841188479590e+13, "3e+13", "%1.g",
-__LINE__, 2.769498440434419e+00, "+3e+00", "%+0.e",
-__LINE__, 2.769993785786379e+10, "27699937857.863794", "%f",
-__LINE__, 2.772900256376753e-06, "+2.7729E-06", "%+7.6G",
-__LINE__, 2.774401482467457e-06, "2.8e-06", "%3.2g",
-__LINE__, 2.777691370374757e-02, "+0.027777", "%+f",
-__LINE__, 2.779836227365899e-09, "3e-09", "%5.0g",
-__LINE__, 2.780481651765741e+01, "2.780482E+01", "%E",
-__LINE__, 2.782228478714809e-26, "2.782228E-26", "%4.7G",
-__LINE__, 2.790457781719376e+13, "+2.8e+13", "%+.2g",
-__LINE__, 2.792026581166417e-30, " 3.e-30", "%#7.0g",
-__LINE__, 2.792396278299615e-08, "0.00", "%#.2f",
-__LINE__, 2.793658047689995e-10, "2.794e-10", "%#0.4g",
-__LINE__, 2.795707358229888e-25, "0.000000", "%f",
-__LINE__, 2.796253091758523e-06, "2.796E-06", "%.4G",
-__LINE__, 2.796756564788716e-24, "2.796757e-24", "%e",
-__LINE__, 2.798730444798773e-14, "2.79873e-14", "%g",
-__LINE__, 2.799108397670447e-24, "3E-24", "%.0G",
-__LINE__, 2.799389008872835e+06, "2799389.", "%#0.f",
-__LINE__, 2.800413998518039e-14, "0.000000", "%f",
-__LINE__, 2.803237602587100e+15, "+2803237602587100.418816", "%+5f",
-__LINE__, 2.803474415574551e-04, "0.0002803", "%.7f",
-__LINE__, 2.804957468647181e+25, "2.80496e+25", "%g",
-__LINE__, 2.809345112788226e+09, "2809345112.788226", "%.6f",
-__LINE__, 2.811518239408899e+10, "3e+10", "%1.g",
-__LINE__, 2.813188439967416e-16, "0.0000000", "%5.7f",
-__LINE__, 2.813497118051755e+08, "2.8135e+08", "%.5g",
-__LINE__, 2.815748256510577e-29, "0.000000", "%2f",
-__LINE__, 2.816076365485207e-01, "0.281608", "%0G",
-__LINE__, 2.816083345772131e+24, "2.8161e+24", "%6.4e",
-__LINE__, 2.818686957605178e+12, "2.8187E+12", "%.5G",
-__LINE__, 2.821903538737691e+20, "2.8219E+20", "%G",
-__LINE__, 2.823659589845680e+26, "2.82366e+26", "%2g",
-__LINE__, 2.823685630865012e+22, "2.82369E+22", "%G",
-__LINE__, 2.828826386007914e+21, "2.828826E+21", "%7E",
-__LINE__, 2.830997901034349e+04, "+3e+04", "%+0.e",
-__LINE__, 2.833886731091353e-26, "+2.833887e-26", "%+4e",
-__LINE__, 2.839965144893913e+28, "28399651448939131626048038015.1421", "%.4f",
-__LINE__, 2.840651452049947e-09, "2.841E-09", "%#.3E",
-__LINE__, 2.843388001911757e-01, "0.284339", "%g",
-__LINE__, 2.846122151080671e+14, "2.84612E+14", "%.5E",
-__LINE__, 2.851257828837595e+05, "+285126", "%+5.f",
-__LINE__, 2.853823884459520e+07, "+2.85382E+07", "%+G",
-__LINE__, 2.853870068368765e-06, "2.854E-06", "%4.3E",
-__LINE__, 2.856687358149867e+01, "+28.567", "%+6.5G",
-__LINE__, 2.858946600073752e+06, "2.8589466e+06", "%3.7e",
-__LINE__, 2.861525727138818e+24, "2.8615257e+24", "%2.7e",
-__LINE__, 2.865104175886071e-24, "0.000000", "%f",
-__LINE__, 2.870678920363198e-14, "2.87068E-14", "%G",
-__LINE__, 2.873298537233691e+09, "+2.8733e+09", "%+g",
-__LINE__, 2.877939609444375e-02, "0.028779", "%f",
-__LINE__, 2.878253985341728e+13, "2.87825E+13", "%G",
-__LINE__, 2.879299244903946e+29, "287929924490394597569320467301", "%0.f",
-__LINE__, 2.885516225515485e-26, "0.000000", "%f",
-__LINE__, 2.886013724129579e+20, "+3e+20", "%+4.g",
-__LINE__, 2.887032786975506e-30, "0.000000", "%f",
-__LINE__, 2.890415456531026e-29, "2.89042E-29", "%G",
-__LINE__, 2.893177360548214e-13, "2.893E-13", "%#6.3E",
-__LINE__, 2.895265536458195e+26, "2.89527e+26", "%5g",
-__LINE__, 2.903844533810152e+23, "290384453381015195105874.23", "%.2f",
-__LINE__, 2.909060558287504e+27, "2.90906e+27", "%g",
-__LINE__, 2.911615480973172e-05, "2.91162E-05", "%3G",
-__LINE__, 2.912692297221896e+09, "2912692297.221896", "%#f",
-__LINE__, 2.913595662485813e-24, "2.9136E-24", "%G",
-__LINE__, 2.915960840341896e-27, "0.000000", "%f",
-__LINE__, 2.920451095973991e-16, "2.92e-16", "%2.2e",
-__LINE__, 2.920528295810925e+06, "2.92053E+06", "%#G",
-__LINE__, 2.921564671017147e+20, "2.921565E+20", "%#6E",
-__LINE__, 2.921628350942189e+01, "2.921628E+01", "%E",
-__LINE__, 2.921843377455232e+20, "2.921843E+20", "%#E",
-__LINE__, 2.930156950319384e+29, "2.930E+29", "%1.3E",
-__LINE__, 2.931229858895071e-30, "2.9e-30", "%4.2g",
-__LINE__, 2.931753029689166e+20, "2.93175e+20", "%g",
-__LINE__, 2.933023693079342e+15, "3.E+15", "%#.1G",
-__LINE__, 2.933078733225520e+26, "2.93308E+26", "%G",
-__LINE__, 2.933528170896643e-14, "+2.93353e-14", "%+g",
-__LINE__, 2.938648437428148e+00, "2.938648e+00", "%e",
-__LINE__, 2.940752238221344e+26, "+2.94075E+26", "%+G",
-__LINE__, 2.942836470459675e+20, "2.9428e+20", "%6.4e",
-__LINE__, 2.943218333254941e+29, "294321833325494086608387078740.634024", "%f",
-__LINE__, 2.943690574007512e-27, "0.000000", "%f",
-__LINE__, 2.945452907046501e+09, "+2.9455E+09", "%+.5G",
-__LINE__, 2.946648725966953e+16, "29466487259669534.637396", "%4f",
-__LINE__, 2.955119322417825e+29, "2.95512E+29", "%G",
-__LINE__, 2.966481197538973e+24, "2.96648e+24", "%#g",
-__LINE__, 2.969362862661362e+08, "+2.969363e+08", "%+7e",
-__LINE__, 2.970062459990078e+21, "+2.97006E+21", "%+G",
-__LINE__, 2.971059959019791e+10, " 3E+10", "%7.G",
-__LINE__, 2.973020205606034e-29, "0.000000", "%f",
-__LINE__, 2.977223210301426e+04, "2.977223e+04", "%#e",
-__LINE__, 2.977467832772786e-26, "0.000000", "%f",
-__LINE__, 2.981433606423384e+18, "2981433606423384397.032805", "%f",
-__LINE__, 2.981615513287404e-17, "2.98162e-17", "%g",
-__LINE__, 2.983880743847276e+19, " 3e+19", "%7.e",
-__LINE__, 2.983927792297305e-28, "2.983928e-28", "%e",
-__LINE__, 2.984807359492058e-17, " 0", "%2.f",
-__LINE__, 2.985123412933032e+09, "+2.98512e+09", "%+g",
-__LINE__, 2.991132955408629e-27, "+2.99113e-27", "%+4g",
-__LINE__, 2.992345635923643e+19, "3E+19", "%4.G",
-__LINE__, 2.993024238285395e-05, "2.99302e-05", "%2g",
-__LINE__, 2.995303406756363e+16, "+2.995303E+16", "%+E",
-__LINE__, 2.995492577854335e+19, "+29954925778543346481.797016", "%+f",
-__LINE__, 2.996856271675341e-25, "+3e-25", "%+0.e",
-__LINE__, 2.997813968112619e+12, "2.99781e+12", "%#5g",
-__LINE__, 3.002097486457961e-17, "3.00210e-17", "%5.5e",
-__LINE__, 3.006538123158692e+28, "+3.00654E+28", "%+#G",
-__LINE__, 3.007293721729544e+04, "30072.937217", "%f",
-__LINE__, 3.008301791944493e-07, "3.008e-07", "%.3e",
-__LINE__, 3.011742184603817e-17, "3.011742E-17", "%#E",
-__LINE__, 3.024641547299177e-30, "3.02464e-30", "%g",
-__LINE__, 3.026525135110198e-28, "3e-28", "%.0e",
-__LINE__, 3.026768160756558e+20, "3.02677E+20", "%G",
-__LINE__, 3.031928829940975e+18, "3031928829940975234.1", "%0.1f",
-__LINE__, 3.039787705138620e+24, "+3.E+24", "%+#5.G",
-__LINE__, 3.039803824423916e-02, "0.030398", "%5f",
-__LINE__, 3.041236293199133e-26, "3.04124e-26", "%g",
-__LINE__, 3.045634954037886e+04, "30456.3", "%g",
-__LINE__, 3.047528114241850e+25, "3e+25", "%0.e",
-__LINE__, 3.047958193737501e-24, "3.04796E-24", "%#G",
-__LINE__, 3.049537324414302e-16, "3.04954E-16", "%G",
-__LINE__, 3.050500637681798e-30, "3.0505E-30", "%G",
-__LINE__, 3.051769626625307e-01, "0.305177", "%f",
-__LINE__, 3.057280201971847e+11, "+3.05728E+11", "%+.5E",
-__LINE__, 3.060046173306881e-10, "+3.060046e-10", "%+e",
-__LINE__, 3.069732667347204e+27, "+3069732667347204291274920251.453295", "%+f",
-__LINE__, 3.075060836786916e-14, "0.000000", "%f",
-__LINE__, 3.078175179670964e+13, "3.07818E+13", "%G",
-__LINE__, 3.080305344303183e-21, "3.08031e-21", "%6g",
-__LINE__, 3.088881497064043e+27, "+3.088881E+27", "%+3E",
-__LINE__, 3.089196877931209e-20, "3.089197e-20", "%e",
-__LINE__, 3.091400888880487e-08, "3e-08", "%2.e",
-__LINE__, 3.093410684178904e+16, "3.09341e+16", "%g",
-__LINE__, 3.104225344208216e-21, "0.000000", "%f",
-__LINE__, 3.105843728248599e+13, "3.e+13", "%#.0g",
-__LINE__, 3.106463071390893e-07, "0.0000", "%.4f",
-__LINE__, 3.107784123569379e+02, "+310.778", "%+G",
-__LINE__, 3.110605148983672e-20, "3.1106051E-20", "%.7E",
-__LINE__, 3.111702418162670e-04, "0.00031117", "%.5G",
-__LINE__, 3.117610675303153e-17, "3.11761e-17", "%g",
-__LINE__, 3.123620125717981e+07, "3.1236e+07", "%2.5g",
-__LINE__, 3.125648558809832e-24, "+3.125649E-24", "%+#0.6E",
-__LINE__, 3.129025163659283e+10, "31290251636.592825", "%#f",
-__LINE__, 3.130689119412709e-29, "+3.131E-29", "%+#.4G",
-__LINE__, 3.135681222132527e+13, "3.13568E+13", "%G",
-__LINE__, 3.138290485073330e-10, "3.13829E-10", "%G",
-__LINE__, 3.141255250155306e-12, "3.14126E-12", "%G",
-__LINE__, 3.143224520918429e+25, "3.14322E+25", "%#1G",
-__LINE__, 3.144746921366173e-16, " 0", "%7.f",
-__LINE__, 3.151336678241994e+19, "+3.15134E+19", "%+G",
-__LINE__, 3.161752935716549e+24, "3.2E+24", "%2.1E",
-__LINE__, 3.167106521258172e-10, "+3.167107e-10", "%+e",
-__LINE__, 3.167266522824146e-04, "3E-04", "%3.E",
-__LINE__, 3.169995217131489e+27, "3169995217131488907114089670.358226", "%f",
-__LINE__, 3.172117220467692e-21, "3.1721E-21", "%.5G",
-__LINE__, 3.173824170351611e+02, " 3e+02", "%6.e",
-__LINE__, 3.186291452544739e-28, " 0", "%2.f",
-__LINE__, 3.194750094186063e+03, "+3.194750E+03", "%+E",
-__LINE__, 3.195001037118137e-20, "0", "%0.0f",
-__LINE__, 3.199271564719560e+02, "319.927", "%g",
-__LINE__, 3.212803450638544e+20, "3.2128e+20", "%.6g",
-__LINE__, 3.214502877263883e+24, "3214502877263882840708220", "%2.f",
-__LINE__, 3.214658414074286e-01, "+0.321466", "%+#g",
-__LINE__, 3.217627975823673e+00, "3.217628", "%f",
-__LINE__, 3.218257328710536e-07, "3.21826e-07", "%6.5e",
-__LINE__, 3.221949479347008e+02, "322.194948", "%f",
-__LINE__, 3.222862935507443e-14, "3.222863E-14", "%E",
-__LINE__, 3.223750247261608e+19, "3.22375e+19", "%g",
-__LINE__, 3.236030335782375e+05, "3.236030e+05", "%e",
-__LINE__, 3.241078803072735e+19, "3.24108e+19", "%g",
-__LINE__, 3.248069569167045e-06, "0.000003", "%#f",
-__LINE__, 3.248148973717269e-15, "3.24815E-15", "%G",
-__LINE__, 3.251150704311790e+25, "+3.25115e+25", "%+5g",
-__LINE__, 3.254498593372140e+15, "+3.2545e+15", "%+g",
-__LINE__, 3.254949399612861e-13, "+3.255E-13", "%+7.3E",
-__LINE__, 3.255490928554106e-17, "3.255491e-17", "%e",
-__LINE__, 3.262333894422112e+17, "326233389442211185.738074", "%0f",
-__LINE__, 3.263923577545217e-24, "0.0000000", "%.7f",
-__LINE__, 3.267125289609703e+23, "3.26713e+23", "%#.5e",
-__LINE__, 3.267906049108331e+27, "3.267906E+27", "%6E",
-__LINE__, 3.269885039157328e+14, "326988503915732.797722", "%f",
-__LINE__, 3.296011393609953e-27, " 3E-27", "%7.E",
-__LINE__, 3.296452164568996e+29, "3.296452E+29", "%E",
-__LINE__, 3.296544736555325e+10, "+3.29654E+10", "%+.6G",
-__LINE__, 3.301861835798572e+03, "3301.862", "%4.7g",
-__LINE__, 3.311292283423002e+21, " 3E+21", "%6.G",
-__LINE__, 3.314868440076262e-10, "3.3149E-10", "%.5G",
-__LINE__, 3.318057982247451e-13, "3.3181e-13", "%0.5g",
-__LINE__, 3.318139218410071e-22, "0.000000", "%f",
-__LINE__, 3.326769904839351e-11, "+3.3268e-11", "%+0.4e",
-__LINE__, 3.327483659787219e+27, "+3.32748e+27", "%+g",
-__LINE__, 3.332666889640198e+17, "333266688964019763.830038", "%f",
-__LINE__, 3.333807449377253e+10, "+3.33e+10", "%+.3g",
-__LINE__, 3.334572302792625e-09, "3.334572E-09", "%E",
-__LINE__, 3.337567126586765e-17, "0.0000000", "%#3.7f",
-__LINE__, 3.340512607683786e-04, "+3E-04", "%+1.E",
-__LINE__, 3.344911557516870e+04, "33449.1", "%G",
-__LINE__, 3.346464302017296e+26, "+3.E+26", "%+#3.G",
-__LINE__, 3.348503166628953e+00, "+3.348503e+00", "%+e",
-__LINE__, 3.350025157778138e-19, "3.35003e-19", "%6g",
-__LINE__, 3.352826233035342e+11, "335282623303.534200", "%7f",
-__LINE__, 3.357174089765502e+10, "3.35717E+10", "%G",
-__LINE__, 3.369253166475501e+03, "+3369.25", "%+G",
-__LINE__, 3.371385975046735e+02, "337.", "%#.0f",
-__LINE__, 3.372532650462104e-04, "+0.000", "%+.3f",
-__LINE__, 3.376498162710442e-26, "3.376498e-26", "%e",
-__LINE__, 3.383510307689135e-12, " 3e-12", "%7.0e",
-__LINE__, 3.388427914080631e-04, "0.0003", "%2.4f",
-__LINE__, 3.390757423408097e+29, "3.3908E+29", "%.4E",
-__LINE__, 3.393963140962879e-11, "3.39396e-11", "%g",
-__LINE__, 3.399245742994444e+24, "3.399246E+24", "%E",
-__LINE__, 3.417690405546708e-26, "0.00000", "%4.5f",
-__LINE__, 3.421159360472045e-30, "3.42116E-30", "%G",
-__LINE__, 3.421973947898887e-06, "3.42197E-06", "%4G",
-__LINE__, 3.425949002482817e-10, "+3.42595E-10", "%+G",
-__LINE__, 3.428355150377972e+08, "3.42836E+08", "%G",
-__LINE__, 3.445035158951526e+15, "3445035158951526.454985", "%f",
-__LINE__, 3.447363996077534e+28, "+3e+28", "%+2.e",
-__LINE__, 3.451571062654907e-03, "0.00345157", "%G",
-__LINE__, 3.452787236877688e+09, "3.45279e+09", "%g",
-__LINE__, 3.454114826574939e-22, "3.e-22", "%#3.e",
-__LINE__, 3.455241965974631e-03, "0.003455", "%#f",
-__LINE__, 3.456190496554365e-18, "3.E-18", "%#5.E",
-__LINE__, 3.456804565717233e-19, "+0.000", "%+2.3f",
-__LINE__, 3.457077651539715e-28, "3.457078E-28", "%E",
-__LINE__, 3.472025705376229e+22, "3.472e+22", "%7.4g",
-__LINE__, 3.473308270919079e+03, "3.473308e+03", "%e",
-__LINE__, 3.474468013243007e-30, "3.47447e-30", "%g",
-__LINE__, 3.477976957097698e+22, "3.47798e+22", "%g",
-__LINE__, 3.501174631980057e-06, "4e-06", "%4.g",
-__LINE__, 3.501808481702140e+20, "3.50181E+20", "%G",
-__LINE__, 3.511760000705324e+14, "351176000070532.357000", "%f",
-__LINE__, 3.511870226306087e+29, "3.51187e+29", "%.5e",
-__LINE__, 3.518846859147841e+02, "+351.885", "%+G",
-__LINE__, 3.521659149753418e+25, "35216591497534182053641416", "%5.f",
-__LINE__, 3.521721228178747e+21, "4e+21", "%2.e",
-__LINE__, 3.526696007281458e+22, "3.5267e+22", "%g",
-__LINE__, 3.535631031379084e-11, "4e-11", "%5.0g",
-__LINE__, 3.537219665456759e-01, "0.353722", "%f",
-__LINE__, 3.537252728287785e-09, "3.537253E-09", "%E",
-__LINE__, 3.542561277796815e-19, "3.542561E-19", "%E",
-__LINE__, 3.548942336915745e+13, "3.54894E+13", "%.5E",
-__LINE__, 3.574385715121768e-24, "3.57439E-24", "%#G",
-__LINE__, 3.578068067760211e-13, "3.578068E-13", "%E",
-__LINE__, 3.583296432862266e-13, "3.5833e-13", "%g",
-__LINE__, 3.591567367115590e+19, "3.59157e+19", "%1g",
-__LINE__, 3.594902312287635e-24, "3.5949E-24", "%G",
-__LINE__, 3.602929486764515e+12, "3602929486764.514522", "%#f",
-__LINE__, 3.606699462631472e-01, "+0.360670", "%+f",
-__LINE__, 3.608605968319811e+17, "3.60861e+17", "%g",
-__LINE__, 3.608780761567885e+24, "4e+24", "%0.e",
-__LINE__, 3.623857274715022e-15, "3.62386E-15", "%1G",
-__LINE__, 3.627346251764432e-22, "3.627e-22", "%.4g",
-__LINE__, 3.652610391698086e-16, "0.000000", "%3f",
-__LINE__, 3.657463146689917e-19, " 0", "%4.0f",
-__LINE__, 3.658538858712938e-15, "4E-15", "%5.G",
-__LINE__, 3.660337267266058e+16, "+36603372672660579.034698", "%+f",
-__LINE__, 3.661588742065142e-01, "0.366159", "%g",
-__LINE__, 3.662296387211376e-25, "0.000000", "%f",
-__LINE__, 3.668511100303393e-29, "0.000000", "%7f",
-__LINE__, 3.669499303661920e+06, "3.6695e+06", "%1.5g",
-__LINE__, 3.676856420121343e-23, "3.6769e-23", "%0.4e",
-__LINE__, 3.677197473476901e-19, "+3.6772e-19", "%+g",
-__LINE__, 3.677281754506453e+12, "+3677281754506.452671", "%+f",
-__LINE__, 3.678420802401506e-19, "3.67842E-19", "%G",
-__LINE__, 3.679970245325769e+07, "3.67997e+07", "%g",
-__LINE__, 3.682528947621349e+05, "4.e+05", "%#5.e",
-__LINE__, 3.688257471304210e+22, "36882574713042104441740.320908", "%f",
-__LINE__, 3.689129734472166e-01, "0.368913", "%0.6G",
-__LINE__, 3.693483801463324e+12, "4E+12", "%3.E",
-__LINE__, 3.694612396584729e-21, "+3.69461E-21", "%+G",
-__LINE__, 3.706150073392112e-19, "0.000000", "%2f",
-__LINE__, 3.706824819530577e+21, "3706824819530576853310.321894", "%f",
-__LINE__, 3.709583789659276e+19, "+3.709584E+19", "%+#E",
-__LINE__, 3.711137503697284e+22, "3.7111E+22", "%.5G",
-__LINE__, 3.717307412969522e-22, "3.717307E-22", "%#E",
-__LINE__, 3.717434999853808e+24, " 4E+24", "%6.G",
-__LINE__, 3.720761662524312e+14, "+372076166252431.2285", "%+1.4f",
-__LINE__, 3.721613815237707e-10, "3.72161e-10", "%g",
-__LINE__, 3.725086467464346e+14, "3.72509E+14", "%G",
-__LINE__, 3.727427083626536e-15, "+4E-15", "%+.0G",
-__LINE__, 3.731138322599465e-13, "3.73114e-13", "%5g",
-__LINE__, 3.732248129614146e-04, " 4E-04", "%7.E",
-__LINE__, 3.744422223926118e-24, "3.744422E-24", "%E",
-__LINE__, 3.745595428897916e+21, "+3745595428897916079336.027906", "%+f",
-__LINE__, 3.751308304055989e-08, "+3.751308e-08", "%+e",
-__LINE__, 3.755395417696132e-02, "0.037554", "%f",
-__LINE__, 3.769103881505159e+09, "3.7691e+09", "%g",
-__LINE__, 3.769535572757430e+00, "3.769536", "%6.7G",
-__LINE__, 3.770823872348274e-28, "+0.000000", "%+f",
-__LINE__, 3.771160653578178e+29, "3.77116e+29", "%g",
-__LINE__, 3.776563752716444e-12, "4E-12", "%.0E",
-__LINE__, 3.777953798674786e-28, "3.77795e-28", "%g",
-__LINE__, 3.785994690686598e+28, "4E+28", "%5.G",
-__LINE__, 3.787487488835162e+01, "+37.874875", "%+5f",
-__LINE__, 3.788249311173359e-18, "3.788249E-18", "%E",
-__LINE__, 3.798728360791314e-08, "3.798728E-08", "%2E",
-__LINE__, 3.799038238867092e+05, "3.79904E+05", "%.5E",
-__LINE__, 3.799822564549600e+06, "3.79982E+06", "%.5E",
-__LINE__, 3.804862840499834e-16, "0", "%1.f",
-__LINE__, 3.805375156822481e+12, "3805375156822.4814861", "%.7f",
-__LINE__, 3.821612790153376e-17, "3.821613e-17", "%e",
-__LINE__, 3.825193659558693e+14, "3.82519E+14", "%#G",
-__LINE__, 3.834180638680996e+17, "+383418063868099565.638659", "%+f",
-__LINE__, 3.834759760605814e-12, "3.83476E-12", "%G",
-__LINE__, 3.839786235582770e+16, "+3.84e+16", "%+0.3g",
-__LINE__, 3.843164462248778e+28, "3.84316e+28", "%#g",
-__LINE__, 3.845599697858050e+22, "3.8456E+22", "%G",
-__LINE__, 3.850147271017228e-21, "3.85e-21", "%.4g",
-__LINE__, 3.850283557812101e+07, "3.85028E+07", "%G",
-__LINE__, 3.854235609725703e+03, "3854.24", "%G",
-__LINE__, 3.864901885489405e-15, "3.8649E-15", "%G",
-__LINE__, 3.868630187629983e-24, "3.868630e-24", "%e",
-__LINE__, 3.876764606134972e-03, "+3.8767646e-03", "%+#0.7e",
-__LINE__, 3.884553592855422e+08, "+3.8845536e+08", "%+4.7e",
-__LINE__, 3.887417494351062e+03, "3887.42", "%0g",
-__LINE__, 3.887561018972304e+03, "3887.56", "%G",
-__LINE__, 3.888554801724658e-24, "3.888555e-24", "%e",
-__LINE__, 3.892806891909861e-01, "0.389281", "%f",
-__LINE__, 3.914459791345755e+15, "+3.914460E+15", "%+E",
-__LINE__, 3.918383209642759e+01, "39.1838", "%#G",
-__LINE__, 3.923970658741865e-10, "3.92397E-10", "%G",
-__LINE__, 3.928163650272335e+18, "3928163650272335161.162118", "%f",
-__LINE__, 3.933053127721002e-20, "3.933053e-20", "%e",
-__LINE__, 3.939306552155218e-29, "3.93931E-29", "%G",
-__LINE__, 3.953007066379472e+07, "3.953007E+07", "%E",
-__LINE__, 3.954924824986267e-01, "3.954925E-01", "%E",
-__LINE__, 3.956156072067987e+15, "3.956E+15", "%0.4G",
-__LINE__, 3.957756196797224e+22, "4.0E+22", "%4.1E",
-__LINE__, 3.960011413261009e+27, "+3960011413261008783592842519.283295", "%+f",
-__LINE__, 3.961789076323378e+20, "396178907632337828914.614875", "%f",
-__LINE__, 3.961985468081708e-28, "3.96199E-28", "%1G",
-__LINE__, 3.975007582283812e-27, "0.000000", "%0.6f",
-__LINE__, 3.987586813142132e+15, "+3.98759e+15", "%+g",
-__LINE__, 3.992250836957379e+21, "3.99225E+21", "%0G",
-__LINE__, 3.992985048620057e+00, "3.9930", "%.4f",
-__LINE__, 4.000000000000000e+02, "400.00", "%.2f",
-__LINE__, 4.000145414240556e+14, "4.00015e+14", "%#6g",
-__LINE__, 4.000774453529974e-25, "4E-25", "%.0E",
-__LINE__, 4.002041494804383e+17, "4.002041E+17", "%E",
-__LINE__, 4.005505415013214e+17, " 4E+17", "%6.2G",
-__LINE__, 4.008960306876491e-28, "0.000", "%.3f",
-__LINE__, 4.032337828117640e+16, "4.03234E+16", "%G",
-__LINE__, 4.035414597530057e+26, "403541459753005682387083652.429283", "%f",
-__LINE__, 4.037065874793069e-01, "0.403707", "%f",
-__LINE__, 4.047856284449970e-14, "4.04786E-14", "%#G",
-__LINE__, 4.049037221323070e-04, "4.049037e-04", "%e",
-__LINE__, 4.053458853142009e-07, "4E-07", "%2.0E",
-__LINE__, 4.056455443275955e-22, "4.056455e-22", "%e",
-__LINE__, 4.058158020771355e-22, "4.05816e-22", "%#2g",
-__LINE__, 4.067283508945137e+02, "+4.07e+02", "%+5.2e",
-__LINE__, 4.072155715199509e+11, "4.072e+11", "%.4g",
-__LINE__, 4.074643403755990e-22, "4e-22", "%0.g",
-__LINE__, 4.077450352325251e+08, "4.1e+08", "%3.2g",
-__LINE__, 4.081492619284916e-08, "4.081493E-08", "%E",
-__LINE__, 4.083271801996951e-10, "4.083272E-10", "%#E",
-__LINE__, 4.090188547940879e-15, "4.090189E-15", "%#E",
-__LINE__, 4.091167728938537e-11, "4e-11", "%1.g",
-__LINE__, 4.091916745541154e+15, "4091916745541153.588306", "%f",
-__LINE__, 4.092366122921161e+23, "4E+23", "%0.E",
-__LINE__, 4.094638368212577e-11, "4.09464E-11", "%#G",
-__LINE__, 4.097148443124199e-16, "0.000000", "%f",
-__LINE__, 4.101057893946401e+06, "4e+06", "%4.g",
-__LINE__, 4.101209521231476e+28, "41012095212314756409455185348.633677", "%f",
-__LINE__, 4.105683659045903e+05, "+4.E+05", "%+#1.G",
-__LINE__, 4.111553717385758e-16, "4.11155e-16", "%g",
-__LINE__, 4.112186409918593e+14, "+4.11219e+14", "%+g",
-__LINE__, 4.117782144860865e+25, "4.117782E+25", "%5E",
-__LINE__, 4.119420921722146e-27, "4.11942e-27", "%g",
-__LINE__, 4.134953783635018e+14, "+4.1349538e+14", "%+.7e",
-__LINE__, 4.136990822648468e+11, "4.136991E+11", "%E",
-__LINE__, 4.140475788523046e+14, "+4E+14", "%+5.G",
-__LINE__, 4.149589679915584e+24, "4.14959E+24", "%2G",
-__LINE__, 4.151240342256744e-22, " 0", "%2.f",
-__LINE__, 4.155533104307272e-04, "+0.000416", "%+f",
-__LINE__, 4.155890511880097e+25, "4.155891e+25", "%e",
-__LINE__, 4.159907901074450e-19, "4.159908E-19", "%7E",
-__LINE__, 4.171899783464252e+18, "4E+18", "%.0E",
-__LINE__, 4.177920266276382e-17, "+0.0000", "%+1.4f",
-__LINE__, 4.181728014477237e-20, "4.18173e-20", "%.6g",
-__LINE__, 4.203600495086497e-30, " 4E-30", "%6.G",
-__LINE__, 4.211166112605717e-08, "4E-08", "%5.1G",
-__LINE__, 4.219513437404614e+18, "+4E+18", "%+.0E",
-__LINE__, 4.221426315236785e+08, "4.221426E+08", "%#E",
-__LINE__, 4.226224756005934e-13, " 4.e-13", "%#7.g",
-__LINE__, 4.226979046489921e-01, "4.226979e-01", "%#.6e",
-__LINE__, 4.236283521629158e-08, "+4.23628E-08", "%+G",
-__LINE__, 4.239850628514233e-07, "4.23985E-07", "%.6G",
-__LINE__, 4.241177358638621e+04, "42411.773586", "%2f",
-__LINE__, 4.245306724398964e-13, "0.000000", "%#f",
-__LINE__, 4.246194290300334e+16, "42461942903003340.177293", "%2f",
-__LINE__, 4.251238996137952e-05, "4.25124E-05", "%3G",
-__LINE__, 4.262432542017438e+13, "42624325420174.375978", "%1f",
-__LINE__, 4.266383084300715e+16, "4E+16", "%4.G",
-__LINE__, 4.292963398931474e-11, "4.292963E-11", "%E",
-__LINE__, 4.296530271399131e-29, "0.000000", "%6f",
-__LINE__, 4.303753949741171e+19, "4.30375E+19", "%2G",
-__LINE__, 4.303767633827431e-28, "4.30377e-28", "%g",
-__LINE__, 4.316181911403991e-30, "4.3162e-30", "%#7.5g",
-__LINE__, 4.318654697213126e-18, "4.31865e-18", "%g",
-__LINE__, 4.320618603119499e+05, "432061.860312", "%3f",
-__LINE__, 4.322443609118441e+21, "4.32244E+21", "%7.5E",
-__LINE__, 4.322522446810708e-15, "4.32252e-15", "%.6g",
-__LINE__, 4.334728493589115e-18, "0.000000", "%f",
-__LINE__, 4.335342531476346e-19, "4.33534E-19", "%G",
-__LINE__, 4.340579325084176e-30, "4.34058e-30", "%#0.6g",
-__LINE__, 4.340775659883185e+04, "43407.756599", "%6f",
-__LINE__, 4.361131891528634e-14, " 4E-14", "%6.G",
-__LINE__, 4.366662624371249e-02, "+0.04", "%+4.g",
-__LINE__, 4.369919308458348e+28, "+4.36992e+28", "%+2g",
-__LINE__, 4.369930393192433e-24, "4.369930e-24", "%e",
-__LINE__, 4.376283118322521e-01, "0.437628", "%g",
-__LINE__, 4.386868840825930e+19, "4.3869E+19", "%.5G",
-__LINE__, 4.389349113395235e+05, "+4.389349e+05", "%+e",
-__LINE__, 4.392447466753053e-08, "+4.392E-08", "%+.4G",
-__LINE__, 4.394068619246889e-13, "4.39407e-13", "%6g",
-__LINE__, 4.404889573700147e-09, "4.404890E-09", "%E",
-__LINE__, 4.410531039373014e+05, "+4.41e+05", "%+.2e",
-__LINE__, 4.412466606726400e-08, " 0.0", "%6.1f",
-__LINE__, 4.414693719279123e+17, "4.414694e+17", "%e",
-__LINE__, 4.417050329080679e-01, "+0.441705", "%+g",
-__LINE__, 4.419509841929196e-10, "4.4195098E-10", "%.7E",
-__LINE__, 4.421012777695611e+07, "+4.42101E+07", "%+0.6G",
-__LINE__, 4.426387732151208e+11, "4.42639e+11", "%g",
-__LINE__, 4.439567017550398e+26, "4.439567E+26", "%E",
-__LINE__, 4.446479816166258e-21, "4.446480e-21", "%0e",
-__LINE__, 4.453486178424380e+05, "445348.617842", "%f",
-__LINE__, 4.455733696043438e+06, "4.45573e+06", "%3g",
-__LINE__, 4.455870606312063e+16, "4.45587e+16", "%g",
-__LINE__, 4.458776435431700e+22, "4e+22", "%1.g",
-__LINE__, 4.466448605584151e-30, "0.000000", "%f",
-__LINE__, 4.471063097005706e+16, "4.47106E+16", "%G",
-__LINE__, 4.482001890035190e-22, "+4.482E-22", "%+G",
-__LINE__, 4.493246870093631e+05, "449325", "%1G",
-__LINE__, 4.496089639281023e+17, "4.49609e+17", "%g",
-__LINE__, 4.515066070117557e+15, "4.51507e+15", "%g",
-__LINE__, 4.518296460916194e+24, "+4.5183E+24", "%+G",
-__LINE__, 4.526548719445596e+02, "452.655", "%6.3f",
-__LINE__, 4.532756455106440e-26, "4.53e-26", "%4.2e",
-__LINE__, 4.534466782633055e-14, "4.53447E-14", "%G",
-__LINE__, 4.541313061854649e-14, "4.54131E-14", "%G",
-__LINE__, 4.541848265404338e+02, " 5E+02", "%7.G",
-__LINE__, 4.546603085406363e-26, "5E-26", "%3.G",
-__LINE__, 4.557349604829375e+28, "+45573496048293753446500886639.", "%+#1.f",
-__LINE__, 4.560736449944898e-27, "4.56074e-27", "%g",
-__LINE__, 4.563726230559341e-15, "+0.0", "%+2.1f",
-__LINE__, 4.572650965532532e-26, "+5E-26", "%+4.G",
-__LINE__, 4.574369572115099e-10, "+0.000000", "%+2.6f",
-__LINE__, 4.576480601519729e+28, "+4.576481e+28", "%+e",
-__LINE__, 4.587487640650499e+02, "+458.75", "%+3.2f",
-__LINE__, 4.598365231538559e-27, "4.59837E-27", "%G",
-__LINE__, 4.599348244725009e-28, "+4.5993482e-28", "%+#3.7e",
-__LINE__, 4.599897524047587e+22, "45998975240475870052136.997401", "%#f",
-__LINE__, 4.605415604725077e-25, "0.000000", "%f",
-__LINE__, 4.613055015797716e+28, "4.613055E+28", "%E",
-__LINE__, 4.618715275814238e-10, "4.618715E-10", "%E",
-__LINE__, 4.619044579489540e-14, "0.00", "%.2f",
-__LINE__, 4.633693310095410e-20, "+0.000000", "%+f",
-__LINE__, 4.648505395281916e-28, "0.000000", "%f",
-__LINE__, 4.651232770446398e+21, "4.65e+21", "%.2e",
-__LINE__, 4.659743589975352e+28, "+4.65974e+28", "%+g",
-__LINE__, 4.660181457075208e-13, "4.66018e-13", "%g",
-__LINE__, 4.669787018529686e+20, "4.66979e+20", "%g",
-__LINE__, 4.672649286126732e-21, "4.6726E-21", "%4.5G",
-__LINE__, 4.675431901120643e-11, " 0", "%3.f",
-__LINE__, 4.684404068169945e+26, "468440406816994503458317922.2", "%6.1f",
-__LINE__, 4.685438834234642e+19, "5.E+19", "%#6.G",
-__LINE__, 4.688915890732712e+00, "+5e+00", "%+2.e",
-__LINE__, 4.692999432046297e+00, "4.692999E+00", "%E",
-__LINE__, 4.708690772584701e+11, "4.70869e+11", "%g",
-__LINE__, 4.711821455782105e-11, "+4.71182e-11", "%+1g",
-__LINE__, 4.712413965116830e-01, "4.712414E-01", "%E",
-__LINE__, 4.719504715401049e-08, "0.000000", "%f",
-__LINE__, 4.719767896031655e+27, "4.71977e+27", "%#g",
-__LINE__, 4.722493017411588e-05, "0.000047", "%4f",
-__LINE__, 4.729482386761477e+08, "4.72948e+08", "%1g",
-__LINE__, 4.730102169800602e-06, "0.000005", "%f",
-__LINE__, 4.743951614209393e+24, "4.743952E+24", "%#E",
-__LINE__, 4.746077075605921e-16, "4.746E-16", "%.3E",
-__LINE__, 4.747802537919248e+24, "4747802537919247889419694", "%4.f",
-__LINE__, 4.754727690703025e-26, "0", "%0.f",
-__LINE__, 4.756952432926979e-29, " 0.", "%#3.f",
-__LINE__, 4.758335147956709e+03, "4758.335148", "%f",
-__LINE__, 4.760141880810268e-25, "4.760142e-25", "%e",
-__LINE__, 4.767079423650815e-07, "5.E-07", "%#0.G",
-__LINE__, 4.785662728343338e-28, "4.78566e-28", "%g",
-__LINE__, 4.787146245774150e-13, "+4.78715E-13", "%+G",
-__LINE__, 4.787415449888824e-17, "4.78742e-17", "%3g",
-__LINE__, 4.794589807429657e-05, "4.79459E-05", "%6G",
-__LINE__, 4.794948299666205e+08, "4.79495e+08", "%g",
-__LINE__, 4.802292865915992e-04, "4.802293e-04", "%e",
-__LINE__, 4.802513688198601e+07, "+4.8e+07", "%+2.3g",
-__LINE__, 4.810456746192536e+06, "5E+06", "%0.0G",
-__LINE__, 4.820631660081696e+20, "+4.82063E+20", "%+G",
-__LINE__, 4.827865857270075e-20, "4.82787e-20", "%g",
-__LINE__, 4.835054268490970e+21, "4835054268490970308391.752042", "%#f",
-__LINE__, 4.838136770808465e-18, "4.83814E-18", "%G",
-__LINE__, 4.839342397882353e-26, "4.839342E-26", "%E",
-__LINE__, 4.845130210072029e-16, "0", "%1.f",
-__LINE__, 4.845161043167169e-12, "+4.845e-12", "%+.4g",
-__LINE__, 4.857425142494964e+01, "48.574251", "%f",
-__LINE__, 4.858118337285513e-10, "+4.8581e-10", "%+.5g",
-__LINE__, 4.867478343525339e-15, "+4.867478E-15", "%+E",
-__LINE__, 4.886137001331278e-11, "0.000000", "%f",
-__LINE__, 4.886835850687998e-20, " 0", "%6.0f",
-__LINE__, 4.886880737482383e+26, "488688073748238327453918827.814050", "%4f",
-__LINE__, 4.888812049144075e-22, "4.888812E-22", "%E",
-__LINE__, 4.895869618002905e+02, "+489.587", "%+.7g",
-__LINE__, 4.902046593298549e+09, " 5e+09", "%7.g",
-__LINE__, 4.907918627564751e-05, "4.91e-05", "%.3g",
-__LINE__, 4.916048355579009e+19, "49160483555790088772", "%2.f",
-__LINE__, 4.917197806128638e+14, "+5e+14", "%+5.g",
-__LINE__, 4.918303274189911e+13, "4.918303e+13", "%e",
-__LINE__, 4.922687970321108e+26, "492268797032110771993984599.2485", "%0.4f",
-__LINE__, 4.929263362431195e+14, "4.92926e+14", "%g",
-__LINE__, 4.933385398543267e-17, "0.000000", "%#f",
-__LINE__, 4.942367126455025e+00, " +5", "%+6.f",
-__LINE__, 4.947687486717652e-04, "0.000495", "%.6f",
-__LINE__, 4.960855200003128e-08, "+4.960855e-08", "%+e",
-__LINE__, 4.968485435774085e-21, "0.0000", "%#2.4f",
-__LINE__, 4.972088381506133e+01, "49.7", "%.1f",
-__LINE__, 4.977561524480392e-15, "4.977562E-15", "%7E",
-__LINE__, 4.984592111249502e-13, "5.0e-13", "%.1e",
-__LINE__, 4.997502335602838e-14, "4.998e-14", "%6.4g",
-__LINE__, 5.001731554335935e-09, "5.00173e-09", "%g",
-__LINE__, 5.006231697107042e-17, "5.0062e-17", "%1.5g",
-__LINE__, 5.008035801093423e+24, "5.008036E+24", "%#E",
-__LINE__, 5.008756965733827e-28, "5.009E-28", "%.4G",
-__LINE__, 5.009774027622812e+20, "+5.00977E+20", "%+G",
-__LINE__, 5.010576312346293e+29, "5.01058E+29", "%G",
-__LINE__, 5.012335250996786e+29, "5.012335e+29", "%.7g",
-__LINE__, 5.012404365186907e+20, "5E+20", "%3.2G",
-__LINE__, 5.024670103250229e-01, "+5.024670E-01", "%+E",
-__LINE__, 5.025765369164560e+03, "5025.77", "%g",
-__LINE__, 5.027173841003918e+11, "+5.02717E+11", "%+G",
-__LINE__, 5.032093817639893e-26, "5e-26", "%3.e",
-__LINE__, 5.039636818525848e-02, "0.050396", "%#f",
-__LINE__, 5.040626671307691e+23, "5.040627E+23", "%E",
-__LINE__, 5.040788233368296e-11, "+5.04079e-11", "%+g",
-__LINE__, 5.040903321336150e-28, "5.0409E-28", "%G",
-__LINE__, 5.042078512958994e+12, "5.04208E+12", "%G",
-__LINE__, 5.045957900223303e+15, "5045957900223303", "%0.f",
-__LINE__, 5.048298764352134e-14, "5.048299e-14", "%1e",
-__LINE__, 5.048827326763192e+28, "50488273267631917917697137454.524636", "%f",
-__LINE__, 5.049714558347361e-23, "5e-23", "%5.0g",
-__LINE__, 5.051509904923853e+16, "50515099049238534", "%5.f",
-__LINE__, 5.052789863743305e-10, "5.05279E-10", "%6G",
-__LINE__, 5.057429728861999e-29, "0.000", "%#1.3f",
-__LINE__, 5.075313093968501e-13, "+5.07531e-13", "%+g",
-__LINE__, 5.075874503501582e+29, "5e+29", "%2.e",
-__LINE__, 5.079468079020803e+01, "50.795", "%.5G",
-__LINE__, 5.086214826494080e-28, " 0.0", "%4.1f",
-__LINE__, 5.096054881114421e+13, "5.096e+13", "%.4g",
-__LINE__, 5.099045274853458e-23, "5.09905E-23", "%0G",
-__LINE__, 5.100248195124433e+00, "5.100248", "%f",
-__LINE__, 5.101016114276598e-20, "5e-20", "%4.1g",
-__LINE__, 5.103213528670269e+07, "51032135.286703", "%6f",
-__LINE__, 5.108373625126768e+08, "+510837362.512677", "%+f",
-__LINE__, 5.113097157183416e+07, "5.1131E+07", "%#.4E",
-__LINE__, 5.114452611789777e+08, "+5.11445E+08", "%+G",
-__LINE__, 5.117099184715288e-16, "5.1171E-16", "%G",
-__LINE__, 5.119910534665511e-13, "+5.11991E-13", "%+G",
-__LINE__, 5.121320931953720e+23, "+5.121321e+23", "%+#e",
-__LINE__, 5.121900318443998e+06, "5.121900e+06", "%e",
-__LINE__, 5.135698679084286e+00, "5.1357", "%2g",
-__LINE__, 5.146355903104154e-10, "+5.14636E-10", "%+.6G",
-__LINE__, 5.148754210958986e-24, "+5.148754e-24", "%+e",
-__LINE__, 5.156238368448428e+26, "5e+26", "%5.g",
-__LINE__, 5.159924520667922e-19, "+5E-19", "%+0.1G",
-__LINE__, 5.159938266135425e-27, "0.000000", "%f",
-__LINE__, 5.165915205175676e-01, "5.165915e-01", "%e",
-__LINE__, 5.190205499401547e-11, "5e-11", "%2.1g",
-__LINE__, 5.193260005542003e+26, "5.19326e+26", "%#g",
-__LINE__, 5.194732077318269e+08, "519473207.731827", "%f",
-__LINE__, 5.196394616633798e-19, "0", "%.0f",
-__LINE__, 5.206753628035638e+19, "5.20675e+19", "%6.6g",
-__LINE__, 5.207364136540851e-23, " 0.000", "%6.3f",
-__LINE__, 5.210672737132108e-09, "5.21067E-09", "%G",
-__LINE__, 5.211423933057123e-20, "+5.21142E-20", "%+G",
-__LINE__, 5.219749528363367e-27, "5.219750e-27", "%e",
-__LINE__, 5.228031587478653e-06, "+5.2E-06", "%+3.1E",
-__LINE__, 5.229303095005359e-25, "+0.000000", "%+#f",
-__LINE__, 5.234703511938320e-06, " 0", "%7.f",
-__LINE__, 5.235655046937822e-20, "5.235655E-20", "%.6E",
-__LINE__, 5.237924986002288e-01, "+0.52379", "%+.5f",
-__LINE__, 5.249148093603826e+20, "5.24915E+20", "%0G",
-__LINE__, 5.262680920244596e+16, "5.26268E+16", "%G",
-__LINE__, 5.267944704715845e-06, "5.e-06", "%#3.g",
-__LINE__, 5.268543533730505e-08, "5.26854E-08", "%G",
-__LINE__, 5.275727269515247e-02, "0.0527573", "%.6g",
-__LINE__, 5.279215316873723e+24, "5279215316873722585455652.733799", "%f",
-__LINE__, 5.284326985680811e+16, "52843269856808108.286828", "%6f",
-__LINE__, 5.286192957344040e-10, "5.3E-10", "%.1E",
-__LINE__, 5.289451976001091e-23, "5.28945E-23", "%G",
-__LINE__, 5.289512908209300e+09, "+5.289513e+09", "%+e",
-__LINE__, 5.295696957972123e+11, "5.296E+11", "%#.3E",
-__LINE__, 5.303584684011050e+16, "53035846840110503.208621", "%f",
-__LINE__, 5.310315581980172e+23, "531031558198017172855998", "%4.f",
-__LINE__, 5.317492728410062e-14, "5.31749e-14", "%7g",
-__LINE__, 5.324506949499409e+18, "5.3245E+18", "%.5G",
-__LINE__, 5.329238068668336e-20, "5e-20", "%4.g",
-__LINE__, 5.336050125161774e+14, "5.33605e+14", "%g",
-__LINE__, 5.349921315003169e-17, "5.34992E-17", "%.6G",
-__LINE__, 5.355648481782587e-20, "5.355648e-20", "%e",
-__LINE__, 5.358945557589489e-26, "+5e-26", "%+0.g",
-__LINE__, 5.359638846465574e+21, "5.359639E+21", "%E",
-__LINE__, 5.377048469393900e+14, "5.377E+14", "%.5G",
-__LINE__, 5.387471194156434e+23, "5.387471E+23", "%.7G",
-__LINE__, 5.401622578962497e-03, "+0.0054", "%+5.2g",
-__LINE__, 5.406882732497444e-16, "5.406883E-16", "%E",
-__LINE__, 5.421474560523198e-11, "+5.42147e-11", "%+g",
-__LINE__, 5.440249323479418e-26, "5.44025E-26", "%7G",
-__LINE__, 5.440922682921101e-05, "5e-05", "%.1g",
-__LINE__, 5.444400103673185e-01, "0.54444", "%G",
-__LINE__, 5.449339470916152e+09, "5449339470.9162", "%.4f",
-__LINE__, 5.451583259558706e-15, "5.e-15", "%#4.e",
-__LINE__, 5.460153018660573e+26, "+546015301866057267687892817.775719", "%+f",
-__LINE__, 5.477591210511918e+08, "+5.47759E+08", "%+0.5E",
-__LINE__, 5.481665401407188e-02, "5.481665e-02", "%e",
-__LINE__, 5.482670784411319e-16, "5E-16", "%4.G",
-__LINE__, 5.487494580636099e+12, "5.48749e+12", "%g",
-__LINE__, 5.508630369473937e-10, "5.508630e-10", "%e",
-__LINE__, 5.528898001438273e+20, "6e+20", "%4.g",
-__LINE__, 5.530331734443152e-24, " 6e-24", "%6.g",
-__LINE__, 5.531704398969656e-24, "0.000000", "%f",
-__LINE__, 5.539906569043238e+05, "+553990.656904", "%+f",
-__LINE__, 5.554571854756323e-08, "+0.00000", "%+4.5f",
-__LINE__, 5.555155069925145e-28, "5.55516e-28", "%g",
-__LINE__, 5.555302705075539e-08, "+5.5553e-08", "%+g",
-__LINE__, 5.563805076159055e-05, "5.563805e-05", "%e",
-__LINE__, 5.565063508995002e+07, "5.565E+07", "%.3E",
-__LINE__, 5.566281664807526e-08, "5.56628E-08", "%G",
-__LINE__, 5.575245679736338e-08, "5.575246e-08", "%e",
-__LINE__, 5.578254777281501e-21, "0.", "%#.0f",
-__LINE__, 5.582389275770848e-01, " 0.6", "%5.G",
-__LINE__, 5.592215029176133e-04, "0.00056", "%.2g",
-__LINE__, 5.593536789867047e-25, "5.59354e-25", "%g",
-__LINE__, 5.605652054074862e-03, " 0.006", "%8.G",
-__LINE__, 5.606982382643258e+20, "+5.60698E+20", "%+G",
-__LINE__, 5.614646821116853e-18, "5.6E-18", "%.2G",
-__LINE__, 5.625586848606565e-11, "+5.62559E-11", "%+G",
-__LINE__, 5.626300428046732e+26, " 6e+26", "%7.g",
-__LINE__, 5.638236626881086e-17, " 6E-17", "%6.G",
-__LINE__, 5.645744817075691e+04, "5.645745E+04", "%E",
-__LINE__, 5.651410004691736e+06, "6.E+06", "%#3.E",
-__LINE__, 5.659582345929256e-11, "+0.000000", "%+f",
-__LINE__, 5.670968861413510e+16, "+5.67097E+16", "%+G",
-__LINE__, 5.672476851235796e+01, "+56.724769", "%+0f",
-__LINE__, 5.674563779921248e+28, " 6E+28", "%6.0G",
-__LINE__, 5.675558529939025e+19, "5.67556e+19", "%3g",
-__LINE__, 5.676326888314589e-08, " 6e-08", "%7.g",
-__LINE__, 5.677928507840897e-30, "5.67793e-30", "%0g",
-__LINE__, 5.686622552402630e-15, "5.69E-15", "%1.3G",
-__LINE__, 5.710441686922142e-14, "5.710442E-14", "%E",
-__LINE__, 5.713234603280163e-21, "0.00000", "%0.5f",
-__LINE__, 5.714968959046963e+12, "5.71497e+12", "%g",
-__LINE__, 5.722025141555638e-23, "5.72e-23", "%.2e",
-__LINE__, 5.725398571007033e-09, "5.7254E-09", "%.6G",
-__LINE__, 5.751604813862738e+18, "6E+18", "%.1G",
-__LINE__, 5.761025444751985e+20, "5.76103e+20", "%g",
-__LINE__, 5.762315767948593e+15, "5.76232e+15", "%4g",
-__LINE__, 5.764528858586032e-15, "5.764529E-15", "%6.7G",
-__LINE__, 5.766408541535810e-07, " 6E-07", "%6.1G",
-__LINE__, 5.771831571087174e-01, "0.577183", "%f",
-__LINE__, 5.790102497364865e-15, "+5.790102e-15", "%+e",
-__LINE__, 5.790222335547785e-08, "5.79022e-08", "%0.6g",
-__LINE__, 5.794082127091130e+21, "5794082127091130018925.468903", "%f",
-__LINE__, 5.804568463644165e+28, "5.80457e+28", "%g",
-__LINE__, 5.827356651901066e+20, "582735665190106555400.006982", "%f",
-__LINE__, 5.837553387436408e+18, "5.837553E+18", "%3E",
-__LINE__, 5.844458110907209e+22, "5.84446e+22", "%g",
-__LINE__, 5.851672125746866e-19, "5.85167e-19", "%g",
-__LINE__, 5.868843476784172e-12, "5.868843e-12", "%1.7g",
-__LINE__, 5.870854146748864e-04, "0.000587", "%2.3g",
-__LINE__, 5.877787821470433e+01, "+58.77788", "%+#3.5f",
-__LINE__, 5.881333514866498e+04, "5.881334E+04", "%E",
-__LINE__, 5.908427816128965e+28, "+5.908428E+28", "%+E",
-__LINE__, 5.918139800007388e+07, "59181398.000074", "%f",
-__LINE__, 5.925587467475260e+21, "5925587467475259551008.548442", "%f",
-__LINE__, 5.930403502679683e-22, "5.9304E-22", "%.6G",
-__LINE__, 5.961572644847521e+02, "+596.157", "%+G",
-__LINE__, 5.968917715225198e-21, "5.96892e-21", "%4g",
-__LINE__, 5.982184454670110e-08, "0", "%0.f",
-__LINE__, 5.988414319040855e+09, "6E+09", "%0.G",
-__LINE__, 5.996263783103995e-10, "5.996264e-10", "%e",
-__LINE__, 6.004634162276014e-18, "6.00463e-18", "%g",
-__LINE__, 6.018734975519166e-08, "6.01873E-08", "%G",
-__LINE__, 6.029071822986717e-14, "0.0000000", "%.7f",
-__LINE__, 6.030392278117406e+23, "6.030392e+23", "%e",
-__LINE__, 6.034553399237175e-27, "+6.03455e-27", "%+g",
-__LINE__, 6.034938873443862e+24, "6034938873443861595546877.651941", "%f",
-__LINE__, 6.038929148003457e-16, "6.03893e-16", "%g",
-__LINE__, 6.039149626573702e-13, "6.0391E-13", "%3.5G",
-__LINE__, 6.041247664739301e+29, "6.041248E+29", "%3E",
-__LINE__, 6.044220746789781e+20, "+6.04422e+20", "%+g",
-__LINE__, 6.045775647107433e+19, "6E+19", "%2.G",
-__LINE__, 6.051917010461611e-05, "6.05192E-05", "%G",
-__LINE__, 6.059773181566425e+17, "+605977318156642486", "%+5.f",
-__LINE__, 6.082239575475813e+01, "+6E+01", "%+.1G",
-__LINE__, 6.093984174629151e+18, "6.093984e+18", "%e",
-__LINE__, 6.102368380479137e+22, "6.1E+22", "%.2G",
-__LINE__, 6.103097446204007e+25, "61030974462040070704915706.301108", "%#0f",
-__LINE__, 6.105244994410556e-24, "0.0000000", "%2.7f",
-__LINE__, 6.110828906801633e-14, "+6.110829e-14", "%+3e",
-__LINE__, 6.124439072468681e-30, "6.12444e-30", "%g",
-__LINE__, 6.127714703273447e-15, "0", "%0.f",
-__LINE__, 6.128539582408870e-15, "6.12854e-15", "%g",
-__LINE__, 6.145470264744349e+24, "6145470264744348654062378.045637", "%f",
-__LINE__, 6.159177701667455e+26, "615917770166745537352426254.074089", "%#f",
-__LINE__, 6.159348213337442e+17, "6.15935e+17", "%g",
-__LINE__, 6.161953891020492e-21, "0.000000", "%f",
-__LINE__, 6.169474192777305e+29, "+6.169E+29", "%+.4G",
-__LINE__, 6.198519761010651e-15, "+0", "%+1.f",
-__LINE__, 6.201381824304919e-27, " 0", "%5.f",
-__LINE__, 6.204387065736372e-18, "6.204387E-18", "%7E",
-__LINE__, 6.209270088144063e-24, "0.000000", "%f",
-__LINE__, 6.209871738353546e-20, "6.20987E-20", "%G",
-__LINE__, 6.222733191871026e+14, "+6.22273e+14", "%+g",
-__LINE__, 6.234670085354310e+04, "+62346.700854", "%+f",
-__LINE__, 6.258389346602224e-09, "6E-09", "%.0G",
-__LINE__, 6.263326582587503e+12, "6263326582588.", "%#5.f",
-__LINE__, 6.272768026763922e+03, "+6272.77", "%+g",
-__LINE__, 6.287747868625765e+00, "6E+00", "%.0E",
-__LINE__, 6.297724027388795e-17, "+6E-17", "%+3.G",
-__LINE__, 6.309940679156400e+27, "6.30994e+27", "%6.5e",
-__LINE__, 6.312960327030170e+06, "+6.312960E+06", "%+E",
-__LINE__, 6.317658179632976e+02, "+631.766", "%+g",
-__LINE__, 6.321255960699571e-27, "0.000000", "%f",
-__LINE__, 6.323069932833900e+03, "6323", "%.4G",
-__LINE__, 6.337027835933034e+21, "6.33703e+21", "%#g",
-__LINE__, 6.343583177899838e-03, "0.00634358", "%7G",
-__LINE__, 6.347464241733904e-03, "6.e-03", "%#0.e",
-__LINE__, 6.352038720353924e+07, "63520387.203539", "%f",
-__LINE__, 6.355292378565109e+23, "+635529237856510942350496.407016", "%+f",
-__LINE__, 6.377901944439164e-29, "0.000", "%2.3f",
-__LINE__, 6.378660255554053e-04, "6.37866E-04", "%.5E",
-__LINE__, 6.382838195255167e-18, "0.000000", "%f",
-__LINE__, 6.391046303581911e+22, "6E+22", "%.0G",
-__LINE__, 6.404812348309621e+22, "6.404812E+22", "%.7G",
-__LINE__, 6.406154091357119e+16, "6.40615E+16", "%G",
-__LINE__, 6.419414726557980e+21, "+6.41941e+21", "%+g",
-__LINE__, 6.432166563008504e+10, " +6e+10", "%+7.g",
-__LINE__, 6.438463704193190e+19, "6.438464e+19", "%e",
-__LINE__, 6.445270237908565e+15, "+6.445270E+15", "%+E",
-__LINE__, 6.445536770502964e+09, "6.446e+09", "%.3e",
-__LINE__, 6.446614224811444e+28, "64466142248114444157636171439.662576", "%f",
-__LINE__, 6.457046289718297e+18, "6457046289718297416.015957", "%4f",
-__LINE__, 6.457682856890173e+01, "6.457683E+01", "%2E",
-__LINE__, 6.471026352792729e-16, "+6.47103e-16", "%+g",
-__LINE__, 6.474527749567342e+19, "6E+19", "%.1G",
-__LINE__, 6.481178401781131e-24, "+6.48E-24", "%+6.3G",
-__LINE__, 6.490736647261461e-15, "+6.49074e-15", "%+g",
-__LINE__, 6.493196535069719e+23, "+6.4932E+23", "%+G",
-__LINE__, 6.500296992935538e-20, "+0.0", "%+.1f",
-__LINE__, 6.502867735895890e-19, "+0.000000", "%+6f",
-__LINE__, 6.506627529164683e+14, "650662752916468", "%5.f",
-__LINE__, 6.511909298966434e-15, "+6.51191E-15", "%+G",
-__LINE__, 6.514463062693312e+01, "65.1446", "%G",
-__LINE__, 6.520721469484543e+16, "6.52072E+16", "%G",
-__LINE__, 6.528064508731680e-05, "6.528065E-05", "%7E",
-__LINE__, 6.529007214194039e-24, "0.000000", "%f",
-__LINE__, 6.537822760557410e-23, "0.000000", "%f",
-__LINE__, 6.552222096390805e+29, "+6.55222E+29", "%+G",
-__LINE__, 6.554569862717104e+12, "6.55457E+12", "%G",
-__LINE__, 6.563440840359989e-30, "7E-30", "%4.G",
-__LINE__, 6.586246985535526e+17, "6.58625E+17", "%#4G",
-__LINE__, 6.593339522442827e+16, "6.6E+16", "%#4.1E",
-__LINE__, 6.611179030024350e+02, "7E+02", "%4.E",
-__LINE__, 6.617541638586767e-10, "6.617542E-10", "%E",
-__LINE__, 6.619147920886991e-28, "7e-28", "%.1g",
-__LINE__, 6.622304444772819e-21, "6.62230E-21", "%#4G",
-__LINE__, 6.634766655157910e+12, "6634766655158", "%2.f",
-__LINE__, 6.635639771921218e+25, "+6.63564E+25", "%+G",
-__LINE__, 6.644575305929087e+17, "+6.64458e+17", "%+g",
-__LINE__, 6.648697591328432e+04, "6.648698E+04", "%3E",
-__LINE__, 6.665426012448100e+09, "6.66543E+09", "%G",
-__LINE__, 6.675222780441723e-23, "6.67522e-23", "%1g",
-__LINE__, 6.689765053880623e+00, "6.6898", "%.5g",
-__LINE__, 6.693874943680238e+25, "7.e+25", "%#1.g",
-__LINE__, 6.695033453546435e+19, "6.695033E+19", "%E",
-__LINE__, 6.720131534244976e+03, "+6720.132", "%+.3f",
-__LINE__, 6.725287004784564e+19, "+6.72529e+19", "%+g",
-__LINE__, 6.743599626906313e-18, "0.0000000", "%7.7f",
-__LINE__, 6.755534260704152e+29, "7.e+29", "%#5.e",
-__LINE__, 6.761855244766418e-18, "6.8E-18", "%.2G",
-__LINE__, 6.764974143681080e-02, "6.765E-02", "%2.3E",
-__LINE__, 6.766924477711975e-17, "0.000000", "%4f",
-__LINE__, 6.772195434106330e-19, "6.7722E-19", "%G",
-__LINE__, 6.779433073319225e-23, "0.00", "%.2f",
-__LINE__, 6.790317710068964e+05, "6.8e+05", "%.1e",
-__LINE__, 6.791378160292960e+02, "679.137816", "%f",
-__LINE__, 6.798381262104190e-27, "0.000000", "%f",
-__LINE__, 6.804165939424860e-14, "7e-14", "%4.g",
-__LINE__, 6.810668670623699e+11, "681066867062.369852", "%f",
-__LINE__, 6.838942637635821e-17, "+6.84e-17", "%+.2e",
-__LINE__, 6.868523988329111e-09, "+6.868524e-09", "%+e",
-__LINE__, 6.873228061403223e-15, "6.873228E-15", "%3E",
-__LINE__, 6.879370500093334e-12, "+0.000000", "%+f",
-__LINE__, 6.891525498686674e-10, "7e-10", "%0.g",
-__LINE__, 6.923027319286220e+21, "7.e+21", "%#1.g",
-__LINE__, 6.923565533024560e-11, "+6.92357e-11", "%+g",
-__LINE__, 6.931415640770737e-24, "+6.93142e-24", "%+g",
-__LINE__, 6.936582619246057e+09, "6.936583e+09", "%7e",
-__LINE__, 6.938661496670582e+05, "693866.1496671", "%2.7f",
-__LINE__, 6.946115378286550e-25, "0.000000", "%f",
-__LINE__, 6.955823211921219e-09, "6.95582e-09", "%g",
-__LINE__, 6.962365243425770e+29, "696236524342577034474288666388.019919", "%7f",
-__LINE__, 6.970432274812882e+05, "+7e+05", "%+1.0e",
-__LINE__, 6.975784942897122e-13, "6.975785e-13", "%e",
-__LINE__, 6.976786489904214e-07, "6.97679E-07", "%3G",
-__LINE__, 6.985245976357042e-05, "0.00", "%.2f",
-__LINE__, 6.993402879410720e-21, "6.9934e-21", "%g",
-__LINE__, 7.012183985341519e+28, "+70121839853415188770213717362", "%+2.f",
-__LINE__, 7.028670648856025e-15, "7.028671e-15", "%.7g",
-__LINE__, 7.034042985683665e-03, " 0", "%2.f",
-__LINE__, 7.044054273278726e+18, "7.044e+18", "%7.4g",
-__LINE__, 7.049706744250734e-06, "7E-06", "%0.E",
-__LINE__, 7.061982657056197e+13, "+7.061983e+13", "%+e",
-__LINE__, 7.066873668945899e+21, "7.06687E+21", "%G",
-__LINE__, 7.087941418633258e+26, "7.08794E+26", "%G",
-__LINE__, 7.108268134631547e+22, "7.108268E+22", "%E",
-__LINE__, 7.112095848565475e-19, "7.1121e-19", "%g",
-__LINE__, 7.116326241291862e+16, "7.116326e+16", "%e",
-__LINE__, 7.118854843597607e-22, "0.000000", "%f",
-__LINE__, 7.121423043456375e-27, "0.000000", "%f",
-__LINE__, 7.131415427096460e-03, "0.007131", "%3f",
-__LINE__, 7.132023279679892e+22, "7.e+22", "%#3.e",
-__LINE__, 7.146250280189992e-18, "0.000000", "%f",
-__LINE__, 7.150059058390724e+03, "7150.06", "%g",
-__LINE__, 7.161081578177381e-02, "+0.0716108", "%+G",
-__LINE__, 7.164935125149336e-27, "7.2E-27", "%#6.2G",
-__LINE__, 7.173125717489549e-10, "7.173126e-10", "%e",
-__LINE__, 7.174199549624193e+00, "7.1741995", "%.7f",
-__LINE__, 7.192493588077649e+27, "7.19249e+27", "%g",
-__LINE__, 7.215209568601445e-06, "7.215210e-06", "%e",
-__LINE__, 7.238322284100497e+03, "7238.3", "%.1f",
-__LINE__, 7.239203871123613e+06, "7239204", "%4.f",
-__LINE__, 7.245809072577019e-09, "+7.245809E-09", "%+E",
-__LINE__, 7.256275686433336e+03, "7.256276e+03", "%e",
-__LINE__, 7.265774291605193e+27, "+7.26577E+27", "%+G",
-__LINE__, 7.287968172227119e-21, "+7.287968e-21", "%+e",
-__LINE__, 7.306020169678527e+12, "7E+12", "%2.E",
-__LINE__, 7.315587463572568e-04, "0.", "%#.0f",
-__LINE__, 7.324627764547963e+09, "7.324628E+09", "%#E",
-__LINE__, 7.331904966719081e-06, "+7.3319E-06", "%+G",
-__LINE__, 7.334448152798243e-02, "0.07", "%0.g",
-__LINE__, 7.334487195961240e-01, "+0.733449", "%+#g",
-__LINE__, 7.381283575515707e+13, "7.381284E+13", "%E",
-__LINE__, 7.394854567245476e-11, "0.000000", "%7f",
-__LINE__, 7.401950211415377e-08, " 7e-08", "%6.e",
-__LINE__, 7.409023867864680e+03, "7409.023868", "%#3f",
-__LINE__, 7.411912956257733e-20, "7e-20", "%0.g",
-__LINE__, 7.445275019272160e+11, "744527501927.2159511", "%.7f",
-__LINE__, 7.450279765616891e-16, "7.45028e-16", "%.6g",
-__LINE__, 7.467047411334495e+14, "7.46705E+14", "%G",
-__LINE__, 7.485628870972725e+28, "7E+28", "%.0G",
-__LINE__, 7.495391782588563e+11, "749539178258.856253", "%f",
-__LINE__, 7.495824101611911e+06, "7.49582e+06", "%.6g",
-__LINE__, 7.499759867592402e+20, "+749975986759240154100.3", "%+.1f",
-__LINE__, 7.508983397140368e+04, "75089.8", "%g",
-__LINE__, 7.512585199581016e-27, "7.512585E-27", "%.6E",
-__LINE__, 7.516831372212545e-29, "+7.516831e-29", "%+e",
-__LINE__, 7.525789465978582e+00, "7.52579", "%G",
-__LINE__, 7.528655653725963e+06, "7.5287e+06", "%3.4e",
-__LINE__, 7.533217421035612e+28, "75332174210356122046050586504.861712", "%f",
-__LINE__, 7.534147071756384e+03, "7534.15", "%g",
-__LINE__, 7.542648637430919e-25, "+0.000000", "%+#f",
-__LINE__, 7.554380140947798e-15, " 8e-15", "%7.g",
-__LINE__, 7.557366996007743e+25, " 8E+25", "%7.G",
-__LINE__, 7.579228950138068e+08, "8e+08", "%3.e",
-__LINE__, 7.579773904052487e-13, "0.000000", "%3f",
-__LINE__, 7.580377544554059e+27, "7.58038e+27", "%#g",
-__LINE__, 7.589615147875915e-15, "7.59E-15", "%.3G",
-__LINE__, 7.593317194045158e-12, "+0.", "%+#1.f",
-__LINE__, 7.605535657484387e-07, "7.60554E-07", "%G",
-__LINE__, 7.609171121278006e-08, " 0", "%5.f",
-__LINE__, 7.612033900317304e-14, "7.61203e-14", "%g",
-__LINE__, 7.628040858080326e+23, "+7.62804e+23", "%+g",
-__LINE__, 7.632109382948695e-01, "0.763211", "%#f",
-__LINE__, 7.633415922627254e+28, "76334159226272539910951309138.908982", "%#f",
-__LINE__, 7.636190400774419e+22, "+7.636190E+22", "%+E",
-__LINE__, 7.636228368661314e-23, "0.000000", "%f",
-__LINE__, 7.653292362739654e-17, "7.65329E-17", "%#G",
-__LINE__, 7.664044705231460e+03, "7.664045E+03", "%5E",
-__LINE__, 7.664257283149626e-05, "7.66426E-05", "%0G",
-__LINE__, 7.668996632821614e-19, " 0.0", "%4.1f",
-__LINE__, 7.674502669497263e-24, "7.6745e-24", "%g",
-__LINE__, 7.681870119755193e+12, "+7.68187e+12", "%+#g",
-__LINE__, 7.693453198401315e+02, "769.3453198", "%5.7f",
-__LINE__, 7.705080073293603e-29, "7.705080E-29", "%1E",
-__LINE__, 7.707244083934683e-07, "7.71E-07", "%2.3G",
-__LINE__, 7.749445584970652e-17, "7.75E-17", "%6.3G",
-__LINE__, 7.755369447889403e+09, "7.8e+09", "%#4.2g",
-__LINE__, 7.760378169707072e-06, "7.76038e-06", "%g",
-__LINE__, 7.763518882114968e-10, "0.000000", "%f",
-__LINE__, 7.764720069569677e-18, "0.000000", "%0f",
-__LINE__, 7.768821339438552e-03, "0.00776882", "%g",
-__LINE__, 7.774767835990679e-29, "7.774768E-29", "%7E",
-__LINE__, 7.805567188246987e-04, "0.000780557", "%2G",
-__LINE__, 7.825157442935941e-26, "0.000000", "%f",
-__LINE__, 7.833373563161910e+29, "+783337356316190991378789476584.643126", "%+f",
-__LINE__, 7.875872661746674e-16, "7.875873E-16", "%E",
-__LINE__, 7.880664458920439e-28, "7.881E-28", "%#0.3E",
-__LINE__, 7.893084198630288e+18, "7893084198630288206", "%1.f",
-__LINE__, 7.912222737877417e+04, "79122.2", "%G",
-__LINE__, 7.913004582748724e-26, "0.000000", "%f",
-__LINE__, 7.913749944463836e+17, "791374994446383617.230367", "%f",
-__LINE__, 7.923881665760883e-24, "0.000000", "%f",
-__LINE__, 7.926699779993694e-03, "0.007927", "%5.6f",
-__LINE__, 7.941991860623354e-20, "7.941992e-20", "%e",
-__LINE__, 7.942700358097138e+17, "794270035809713803.587329", "%2f",
-__LINE__, 7.945451569935757e-16, "7.94545E-16", "%#4.6G",
-__LINE__, 7.948277588625241e-04, "0", "%.0f",
-__LINE__, 7.952265062569124e+21, "+7.95227e+21", "%+#g",
-__LINE__, 7.959953534668040e+11, "8e+11", "%2.e",
-__LINE__, 7.962059154424500e-22, "7.96206E-22", "%G",
-__LINE__, 7.962856142535673e-26, "7.9629E-26", "%#.5G",
-__LINE__, 7.966528574505771e+12, "7.96653e+12", "%g",
-__LINE__, 8.006496880305429e-21, "8.0065E-21", "%G",
-__LINE__, 8.023374861440542e+06, "+8023375", "%+6.f",
-__LINE__, 8.041139717082990e-20, "8.04114e-20", "%g",
-__LINE__, 8.044201752824126e+15, "8.04420E+15", "%.5E",
-__LINE__, 8.044262927409321e-10, "+8E-10", "%+2.2G",
-__LINE__, 8.058285708061202e+02, "+8.058286e+02", "%+e",
-__LINE__, 8.104422320765144e+10, "8.10442e+10", "%#4g",
-__LINE__, 8.104572628022330e-11, "0.000000", "%f",
-__LINE__, 8.112156369917432e+15, "+8.11216E+15", "%+G",
-__LINE__, 8.114566569709531e-18, "8.11457E-18", "%G",
-__LINE__, 8.114795069552519e+13, "8.114795E+13", "%E",
-__LINE__, 8.121382719830660e+03, "8121.382720", "%f",
-__LINE__, 8.125179335533733e-12, "+8.125179e-12", "%+e",
-__LINE__, 8.126383949107055e+19, "81263839491070548604.056967", "%f",
-__LINE__, 8.129961701307842e-04, "+0.00081", "%+5.2g",
-__LINE__, 8.143780077390936e+15, "8.14378E+15", "%G",
-__LINE__, 8.149891507777399e+16, "+8E+16", "%+1.G",
-__LINE__, 8.167395708830107e+03, "8167", "%3.f",
-__LINE__, 8.167703619221975e+01, "81.677", "%G",
-__LINE__, 8.178463030771759e+06, "+8.17846E+06", "%+G",
-__LINE__, 8.188188531273697e+12, "8.18819E+12", "%G",
-__LINE__, 8.189094866416537e+11, "+8E+11", "%+.1G",
-__LINE__, 8.205086844365809e-18, "+8.205087E-18", "%+#E",
-__LINE__, 8.205762333408320e-26, "0.000000", "%f",
-__LINE__, 8.212370598174696e-10, "8.2124E-10", "%.5G",
-__LINE__, 8.228054316085489e-14, "0.000000", "%3f",
-__LINE__, 8.244313484402404e-16, "8.24431e-16", "%g",
-__LINE__, 8.244472235472472e+19, "8.24447E+19", "%G",
-__LINE__, 8.245421473302411e-09, "+8.2454e-09", "%+1.5g",
-__LINE__, 8.252286626634840e-22, "8E-22", "%3.G",
-__LINE__, 8.259969177912707e-19, "0.000000", "%f",
-__LINE__, 8.265769991725211e+18, "8.26577e+18", "%.5e",
-__LINE__, 8.293986939496488e+25, "8.3E+25", "%.1E",
-__LINE__, 8.310348813512608e-23, "+8.31035e-23", "%+g",
-__LINE__, 8.316951996533247e-20, "0.000000", "%f",
-__LINE__, 8.318818016883803e+05, " 8e+05", "%6.1g",
-__LINE__, 8.324896920131877e-13, "+8.324897e-13", "%+e",
-__LINE__, 8.325228630004624e-03, "0.0083252", "%5.7f",
-__LINE__, 8.332538660129034e+14, "8.3e+14", "%5.2g",
-__LINE__, 8.343325212751775e+07, "8.34333e+07", "%#4g",
-__LINE__, 8.363117398136236e+20, "+8.36e+20", "%+.3g",
-__LINE__, 8.364181324448165e+27, "8.36418e+27", "%#g",
-__LINE__, 8.372159259848738e+10, "8.37216e+10", "%4g",
-__LINE__, 8.379252006152759e-26, "8.37925e-26", "%g",
-__LINE__, 8.392670395720252e+09, "8392670395.720252", "%f",
-__LINE__, 8.423360059147756e+05, "+842336.", "%+#G",
-__LINE__, 8.425921213167943e+09, "8.425921e+09", "%1.7g",
-__LINE__, 8.431664412515776e-16, "8.43166E-16", "%#G",
-__LINE__, 8.448608859842500e+02, "844.861", "%1.3f",
-__LINE__, 8.456292247478771e-14, "8.45629E-14", "%G",
-__LINE__, 8.460077225296853e-04, "0.000846008", "%G",
-__LINE__, 8.478635925746218e-10, "0.000000", "%f",
-__LINE__, 8.492455774427448e+06, "8.49246e+06", "%g",
-__LINE__, 8.494450528380746e-07, "8.494451e-07", "%e",
-__LINE__, 8.516435842947605e-23, "+0.000000", "%+1f",
-__LINE__, 8.519057789029134e-18, "0.000000", "%0f",
-__LINE__, 8.522602111109066e+18, " 9.e+18", "%#7.g",
-__LINE__, 8.529176788022152e-24, "8.529E-24", "%0.4G",
-__LINE__, 8.534979605642793e-07, "0.000001", "%f",
-__LINE__, 8.546859563634342e-07, "8.546860E-07", "%E",
-__LINE__, 8.552370027054106e+12, "9e+12", "%.0g",
-__LINE__, 8.561781328234041e+10, "8.56178e+10", "%4g",
-__LINE__, 8.562688793145107e-20, "8.562689e-20", "%1.7g",
-__LINE__, 8.573130147270046e-07, " 9E-07", "%7.G",
-__LINE__, 8.584571984387802e-18, "8.5846e-18", "%.5g",
-__LINE__, 8.596407996491291e+11, "8.596408E+11", "%#E",
-__LINE__, 8.604843726850381e+10, " 9E+10", "%6.G",
-__LINE__, 8.626884271938994e-23, "8.62688e-23", "%g",
-__LINE__, 8.631140282429168e+24, "8631140282429168308908629.", "%#.0f",
-__LINE__, 8.635194331917948e-16, "8.63519E-16", "%G",
-__LINE__, 8.641417311588688e-24, "+0.000000", "%+f",
-__LINE__, 8.649120264278466e+26, "8.65E+26", "%1.3G",
-__LINE__, 8.649745523383894e+06, "8.649746e+06", "%e",
-__LINE__, 8.654720740091021e+16, "8.65472e+16", "%g",
-__LINE__, 8.655445556834509e-08, "9e-08", "%4.g",
-__LINE__, 8.658954696751902e+06, "8.65895E+06", "%G",
-__LINE__, 8.665712368800818e-10, "+8.66571E-10", "%+G",
-__LINE__, 8.666937057116442e-10, "8.666937e-10", "%e",
-__LINE__, 8.670981239765155e+05, "867098", "%G",
-__LINE__, 8.679631934294932e-25, "+9.E-25", "%+#0.G",
-__LINE__, 8.683595173050962e-21, "8.68360E-21", "%#G",
-__LINE__, 8.684938704958039e+25, "8.684939E+25", "%E",
-__LINE__, 8.686745463281227e-12, "8.686745E-12", "%5.7G",
-__LINE__, 8.700227628706534e-12, "8.700228e-12", "%#e",
-__LINE__, 8.705101179577200e+04, "87051.011796", "%#2f",
-__LINE__, 8.707824829984700e-24, "9e-24", "%.1g",
-__LINE__, 8.717654041009233e+21, "+9E+21", "%+6.0E",
-__LINE__, 8.741736299906572e-11, "8.74174E-11", "%#0G",
-__LINE__, 8.742228350419966e+18, "+8742228350419965821.060941", "%+f",
-__LINE__, 8.743045146087558e-17, "+8.74305E-17", "%+2G",
-__LINE__, 8.747820269457588e+18, "8.74782E+18", "%G",
-__LINE__, 8.756274717008537e-28, "8.756275E-28", "%E",
-__LINE__, 8.769782309254687e-24, "+8.769782E-24", "%+2.6E",
-__LINE__, 8.788151659193398e-16, " 9E-16", "%6.E",
-__LINE__, 8.789514812202340e-07, "9E-07", "%0.G",
-__LINE__, 8.792657843164822e-07, "8.79266e-07", "%0g",
-__LINE__, 8.810976223440985e+05, "881097.622344", "%f",
-__LINE__, 8.822553973113614e+10, "8.82255E+10", "%G",
-__LINE__, 8.839440421530611e-04, "0.000883944", "%G",
-__LINE__, 8.842539073558434e-12, "0", "%1.f",
-__LINE__, 8.882818021261782e-13, "+8.9e-13", "%+4.2g",
-__LINE__, 8.899833909201039e+05, "8.8998E+05", "%.5G",
-__LINE__, 8.903167498000181e-13, "9e-13", "%0.g",
-__LINE__, 8.933727737932164e+09, "+8933727738", "%+4.f",
-__LINE__, 8.946226267100711e+06, "8.946E+06", "%1.4G",
-__LINE__, 8.953203780849794e-21, "8.9532E-21", "%G",
-__LINE__, 8.959934262635649e+28, "+8.959934e+28", "%+e",
-__LINE__, 8.969485341781558e-25, "0.000000", "%#f",
-__LINE__, 8.970058187654221e+02, "897.005819", "%f",
-__LINE__, 8.979846508565979e+02, "8.979847E+02", "%E",
-__LINE__, 8.984561117901212e+01, "8.984561E+01", "%E",
-__LINE__, 8.992157765875611e-12, "8.99216e-12", "%g",
-__LINE__, 9.004487016708012e+01, "9.004487e+01", "%#e",
-__LINE__, 9.007306978283218e-24, "9.007307e-24", "%e",
-__LINE__, 9.014546375043562e+17, "901454637504356171.007203", "%#3f",
-__LINE__, 9.028177786002161e-12, "9.02818E-12", "%G",
-__LINE__, 9.029635986381795e-02, "0.09", "%.1g",
-__LINE__, 9.032389962233431e-07, "+0.000001", "%+f",
-__LINE__, 9.038466945070887e+10, "+9.038467E+10", "%+E",
-__LINE__, 9.040166964322772e-27, "9.04017e-27", "%g",
-__LINE__, 9.044627673694681e-11, "9.04463E-11", "%G",
-__LINE__, 9.045906217628948e+17, "904590621762894819.823941", "%1f",
-__LINE__, 9.051764975661710e+11, "9.05176e+11", "%#g",
-__LINE__, 9.053142913711405e+29, "9.053143e+29", "%#e",
-__LINE__, 9.073185209160657e-19, "+9.07319e-19", "%+g",
-__LINE__, 9.074372574441451e+02, "907.437", "%g",
-__LINE__, 9.084624602048136e+08, "9.084625E+08", "%E",
-__LINE__, 9.088839346363631e+18, "9.09e+18", "%.2e",
-__LINE__, 9.091945159170871e-15, "9.09195e-15", "%5g",
-__LINE__, 9.115304318083716e+10, "9.115304e+10", "%e",
-__LINE__, 9.115978352902710e+28, "9.11598E+28", "%G",
-__LINE__, 9.121415008221017e-17, "9.E-17", "%#6.G",
-__LINE__, 9.127270978060388e+18, "9.E+18", "%#5.G",
-__LINE__, 9.143941729069086e+08, "9.143942E+08", "%#E",
-__LINE__, 9.162740105978580e-19, " 9.E-19", "%#7.G",
-__LINE__, 9.221509957559626e-18, "9.22151e-18", "%g",
-__LINE__, 9.227419774250317e-28, " 0.", "%#3.f",
-__LINE__, 9.230846660807540e-21, "0.000000", "%f",
-__LINE__, 9.238091727277130e-06, "+0.00001", "%+.5f",
-__LINE__, 9.244337357684406e+10, "9E+10", "%5.G",
-__LINE__, 9.259179793993285e-19, " 9E-19", "%7.0G",
-__LINE__, 9.274068541525759e-17, "9.274069e-17", "%e",
-__LINE__, 9.283833535882367e+16, "9.28383e+16", "%#g",
-__LINE__, 9.295693096364605e+11, "+9.295693E+11", "%+E",
-__LINE__, 9.301820438602407e+05, "930182", "%G",
-__LINE__, 9.322805251555376e-29, "9e-29", "%1.e",
-__LINE__, 9.358443042421307e-27, "9.35844e-27", "%g",
-__LINE__, 9.372658444745124e-23, "9.372658e-23", "%e",
-__LINE__, 9.380302971355292e+05, "938030.3", "%.7g",
-__LINE__, 9.381976354968076e-26, "+9.382E-26", "%+5.4G",
-__LINE__, 9.391072061980585e-15, "9.391072E-15", "%E",
-__LINE__, 9.403554117166546e-06, "0.000009", "%f",
-__LINE__, 9.403712900426614e-28, "9.40371e-28", "%g",
-__LINE__, 9.419046629820578e+03, "9419.046630", "%f",
-__LINE__, 9.422344695378412e+22, "94223446953784115720509.362291", "%f",
-__LINE__, 9.433327680467576e+01, "9.433328e+01", "%e",
-__LINE__, 9.443975205260596e+20, "9.44398e+20", "%g",
-__LINE__, 9.445134851965593e-04, "+9.445135E-04", "%+E",
-__LINE__, 9.448403585149890e+24, "9e+24", "%0.g",
-__LINE__, 9.463149430113036e+18, "9.46315e+18", "%g",
-__LINE__, 9.465735160722534e+27, "+9465735160722534402566452627.070248", "%+f",
-__LINE__, 9.495210794344892e-04, "0.000950", "%f",
-__LINE__, 9.501916506373814e-25, "9.50192E-25", "%#G",
-__LINE__, 9.514641335897739e+29, "9.51464E+29", "%G",
-__LINE__, 9.524633436992819e-04, " 0.001", "%6.G",
-__LINE__, 9.530925101873022e-18, "9.530925e-18", "%2e",
-__LINE__, 9.557903833216979e-22, "9.557904E-22", "%E",
-__LINE__, 9.587709102390903e-01, " 1", "%2.f",
-__LINE__, 9.592723000828453e-02, "9.592723E-02", "%5E",
-__LINE__, 9.603430008794172e+27, "9.60343e+27", "%g",
-__LINE__, 9.622648414989433e-18, "9.622648e-18", "%1e",
-__LINE__, 9.633326171289319e-23, "9.633326e-23", "%e",
-__LINE__, 9.662064616152408e+19, "96620646161524081918.5146393", "%1.7f",
-__LINE__, 9.668544846563163e-23, "9.668545e-23", "%e",
-__LINE__, 9.691014191346685e+28, "9.69101E+28", "%G",
-__LINE__, 9.693075414840598e+02, "+969.308", "%+G",
-__LINE__, 9.695013453291907e-30, "9.695013e-30", "%5e",
-__LINE__, 9.705983477801926e-24, "9.70598e-24", "%g",
-__LINE__, 9.709022568030226e-17, "0.000000", "%f",
-__LINE__, 9.715194901854826e+20, "9.715195e+20", "%e",
-__LINE__, 9.721011821337717e+16, "1E+17", "%0.G",
-__LINE__, 9.734895542899672e+14, "9.734896e+14", "%e",
-__LINE__, 9.741486438769710e-29, " 1e-28", "%6.g",
-__LINE__, 9.766657482315475e-24, "9.76666E-24", "%7G",
-__LINE__, 9.767283293054552e-02, "0.09767", "%5.5f",
-__LINE__, 9.769553159146005e-20, "9.76955E-20", "%G",
-__LINE__, 9.777220880605434e-10, "0.00", "%4.2f",
-__LINE__, 9.790290569034575e+20, "979029056903457473027.", "%#6.f",
-__LINE__, 9.793128245822718e-01, "0.979313", "%G",
-__LINE__, 9.804758536498200e+08, "980475853.650", "%.3f",
-__LINE__, 9.816883664191066e-02, "0.1", "%.0g",
-__LINE__, 9.836109821010300e+25, "9.83611e+25", "%g",
-__LINE__, 9.846197559631225e+03, "1E+04", "%2.G",
-__LINE__, 9.863289416819924e+12, "9.86329e+12", "%g",
-__LINE__, 9.865893798657353e+12, "9.866e+12", "%0.4g",
-__LINE__, 9.868248446640862e-15, "0.000000", "%#f",
-__LINE__, 9.869973080775134e+04, "98699.7", "%G",
-__LINE__, 9.899444006312953e+20, "1E+21", "%.1G",
-__LINE__, 9.904083146074285e-08, "9.904083e-08", "%6e",
-__LINE__, 9.909790408255471e+15, "9909790408255471.305665", "%f",
-__LINE__, 9.930297455798394e-13, "+9.930297E-13", "%+5.6E",
-__LINE__, 9.933314448709083e-15, "9.93331E-15", "%#.6G",
-__LINE__, 9.938714530509870e+29, "9.938715e+29", "%e",
-__LINE__, 9.953892603540162e+07, "9.95389E+07", "%G",
-__LINE__, 9.962084643867200e+14, "+996208464386720.038419", "%+f",
-__LINE__, 9.977706708809947e-09, "9.9777E-09", "%#.4E",
-#endif
-__LINE__, 9.978034352999867e+15, "9.978034e+15", "%2.6e",
-__LINE__, 9.998315286730175e-30, "9.998315e-30", "%6e",
-
-0
-};
-
-/* matches(s1, s2) is true if s1 is "approximately" equal to s2.
- Any digits after the first required_precision digits do not have to match.
- */
-
-int required_precision = 13;
-
-#if defined(__STDC__) || defined(__cplusplus)
-int matches(register char *result, register char *desired)
-#else
-int matches(result, desired)
- register char *result; register char *desired;
-#endif
-{
- int digits_seen = 0;
- for (;; result++, desired++) {
- if (*result == *desired) {
- if (*result == 0)
- return 1;
- else if (*result >= '0' && *result <= '9')
- digits_seen++;
- }
- else if (digits_seen >= required_precision
- && *result >= '0' && *result <= '9'
- && *desired >= '0' && *desired <= '9')
- continue;
- else
- return 0;
- }
-}
-
-extern void dump_stats();
-
-int main()
-{
- int errcount = 0;
- int testcount = 0;
- double d;
-#define BSIZE 1024
- char buffer[BSIZE];
- sprint_double_type *dptr;
-
- /* This test demands more precision than a 32bit floating
- point format can provide. So only run it if doubles
- are last least 64bits wide. */
- if (sizeof (double) < 8)
- exit (0);
-
-#if defined(__cplusplus) && !defined(TEST_LIBIO)
-
- strstream sstr(buffer, BSIZE, ios::in|ios::out);
-
- for (dptr = sprint_doubles; dptr->line; dptr++)
- {
-
-#ifdef SLOW_SIMULATOR
- /* We only run half the tests if we have a slow simulator to
- avoid dejagnu timeouts. */
- if (testcount % 2)
- {
- testcount++;
- continue;
- }
-#endif
-
- sstr.seekp(0);
- sstr.form(dptr->format_string, dptr->value);
- sstr << ends;
- if (!matches(buffer, dptr->result))
- {
- errcount++;
- cerr << "Error in line " << dptr->line;
- cerr << " using \"" << dptr->format_string;
- cerr << "\". Result is \"" << buffer << "\"; should be: \"";
- cerr << dptr->result << "\".\n";
- }
-
-#ifdef TEST_EXACTNESS
- sstr.seekp(0);
- sstr.form("%.999g", dptr->value);
- sstr << ends;
-
- sstr.seekg(0);
- sstr.scan("%lg", &d);
-
- if (dptr->value != d)
- {
- errcount++;
- cerr << "Error in line " << dptr->line;
- cerr << ". String is \"" << buffer << "\", value is " << d << ".\n";
- }
-#endif
- testcount++;
- }
-
-#ifdef SLOW_SIMULATOR
- testcount /= 2;
-#endif
-
- if (errcount == 0)
- {
- cerr << "Encountered no errors in " << testcount << " tests.\n";
- return 0;
- }
- else
- {
- cerr << "Encountered " << errcount << " errors in "
- << testcount << " tests.\n";
- return 1;
- }
-#else
- for (dptr = sprint_doubles; dptr->line; dptr++)
- {
-#ifdef SLOW_SIMULATOR
- /* We only run half the tests if we have a slow simulator to
- avoid dejagnu timeouts. */
- if (testcount % 2)
- {
- testcount++;
- continue;
- }
-#endif
-
- sprintf (buffer, dptr->format_string, dptr->value);
- if (!matches(buffer, dptr->result))
- {
- errcount++;
- fprintf(stderr,
- "Error in line %d using \"%s\". Result is \"%s\"; should be: \"%s\".\n",
- dptr->line, dptr->format_string, buffer, dptr->result);
- }
-
-#ifdef TEST_EXACTNESS
- sprintf (buffer, "%.999g", dptr->value);
- sscanf (buffer, "%lg", &d);
- if (dptr->value != d)
- {
- errcount++;
- fprintf (stderr,
- "Error in line %d. String is \"%s\", value is %g.\n",
- dptr->line, buffer, d);
- }
-#endif
- testcount++;
- }
-
-#ifdef SLOW_SIMULATOR
- testcount /= 2;
-#endif
-
- if (errcount == 0)
- {
- fprintf(stderr, "Encountered no errors in %d tests.\n", testcount);
- return 0;
- }
- else
- {
- fprintf(stderr, "Encountered %d errors in %d tests.\n",
- errcount, testcount);
- return 1;
- }
-#endif
-}
diff --git a/contrib/libio/tests/tiformat.c b/contrib/libio/tests/tiformat.c
deleted file mode 100644
index 78d09cedc230..000000000000
--- a/contrib/libio/tests/tiformat.c
+++ /dev/null
@@ -1,5112 +0,0 @@
-#ifdef TEST_LIBIO
-#include <iostdio.h>
-#else
-#ifdef __cplusplus
-#include <strstream.h>
-#else
-#include <stdio.h>
-#endif
-#endif /* !TEST_LIBIO */
-#include <string.h>
-
-/* Tests taken from Cygnus C library. */
-typedef struct {
- int line;
- long value;
- char *result;
- char *format_string;
-} sprint_int_type;
-
-sprint_int_type sprint_ints[] =
-{
-__LINE__, 0x000838d2L, "838d2", "%.4x",
-__LINE__, 0x0063be46L, "63BE46", "%-6X",
-__LINE__, -0x1b236c0L, "-28456640", "%#0.d",
-__LINE__, -0x0000003L, "-3", "% 0d",
-__LINE__, 0x0000ed51L, "ed51", "%2.x",
-__LINE__, -0x00001f2L, "-498", "%1ld",
-__LINE__, 0x0ea3e927L, "EA3E927", "%+X",
-__LINE__, 0xffbef8daL, "FFBEF8DA", "%5X",
-__LINE__, 0x62ff9f56L, "62ff9f56", "%0x",
-__LINE__, 0x00000ad2L, "AD2", "%.0X",
-__LINE__, 0x00000000L, " ", "% 6.ld",
-__LINE__, 0xffffffffL, "FFFFFFFF", "%1.4X",
-__LINE__, 0x0000208cL, " 208C", "%5X",
-__LINE__, 0x0000003cL, "3c", "%x",
-__LINE__, 0xffff6177L, "0xffff6177", "%+#x",
-__LINE__, 0xffffdc8dL, "ffffdc8d", "%+x",
-__LINE__, 0x00000000L, "0", "%X",
-__LINE__, 0x00002434L, "9268", "%0d",
-__LINE__, 0xd2c72cdbL, "d2c72cdb", "%-x",
-__LINE__, 0xfe38012bL, "0xfe38012b", "%+#7x",
-__LINE__, 0x00000001L, "0001", "%#.4d",
-__LINE__, -0x008525aL, "-0545370", "%06.7ld",
-__LINE__, 0xffffffacL, "ffffffac", "%3.7x",
-__LINE__, 0x007424d2L, "+7611602", "%+ld",
-__LINE__, 0x00001a85L, "1A85", "%.4X",
-__LINE__, -0x0000019L, "-25", "%3.d",
-__LINE__, 0xfffffffeL, "fffffffe", "%-x",
-__LINE__, -0x34473b2L, "-54817714", "% d",
-__LINE__, 0x000000eaL, "234", "%1.ld",
-__LINE__, -0x0000004L, "-4 ", "%-7.ld",
-__LINE__, 0x00006c94L, "27796", "%0d",
-__LINE__, 0x00000001L, "1", "%ld",
-__LINE__, 0x00000619L, "619", "%1x",
-__LINE__, 0x0000209cL, "8348", "%ld",
-__LINE__, -0x327f8ffL, "-52951295", "%-0ld",
-__LINE__, 0xffffff0bL, "FFFFFF0B", "%2.X",
-__LINE__, 0xf199d6aeL, "F199D6AE", "%X",
-__LINE__, 0x3ca5602eL, "1017471022", "%-1.ld",
-__LINE__, -0xfb2080bL, "-263325707", "%3.5d",
-__LINE__, 0x00001cb8L, "7352", "%d",
-__LINE__, 0x00000000L, "0000000", "%3.7d",
-__LINE__, 0xffffff40L, "FFFFFF40", "%+X",
-__LINE__, 0x14664450L, "0x14664450", "%#x",
-__LINE__, 0x0000002eL, "2e", "%1x",
-__LINE__, 0xffffffffL, "ffffffff", "%x",
-__LINE__, 0xffff606aL, "0XFFFF606A", "%#X",
-__LINE__, 0xffffff33L, "0XFFFFFF33", "%#X",
-__LINE__, 0x00000000L, "0", "%d",
-__LINE__, -0x0000012L, "-00018", "%-2.5d",
-__LINE__, 0x0001fbe6L, "130022", "%1.d",
-__LINE__, 0xfff59dd9L, "fff59dd9", "%+x",
-__LINE__, 0x00000002L, "2", "%0.0d",
-__LINE__, 0x00000fe1L, "fe1 ", "%-7.x",
-__LINE__, 0x001f8f6aL, "1F8F6A", "%1.X",
-__LINE__, 0x0000001bL, "000001B", "%04.7X",
-__LINE__, 0x126a2609L, " 308946441", "% 4d",
-__LINE__, 0xffffffe3L, "0XFFFFFFE3", "%+#.1X",
-__LINE__, 0x1858f1c9L, "1858f1c9", "%.3x",
-__LINE__, 0x003fc672L, "3fc672", "%1x",
-__LINE__, 0x00c0bddcL, "12631516", "%#d",
-__LINE__, 0x000006d6L, "1750", "%#d",
-__LINE__, 0x000006a0L, "6A0", "%X",
-__LINE__, 0x000007beL, "7BE", "%X",
-__LINE__, -0x1c7cd1aL, "-29871386", "%ld",
-__LINE__, 0x000000ccL, "204", "%ld",
-__LINE__, 0x000002dbL, "731 ", "%-#5d",
-__LINE__, 0xffff67adL, "FFFF67AD", "% X",
-__LINE__, 0x00000008L, "8", "%d",
-__LINE__, 0xffe07007L, "FFE07007", "%5X",
-__LINE__, -0x0000001L, " -1", "% 7d",
-__LINE__, 0xfffffffeL, "fffffffe", "%x",
-__LINE__, 0x00027b68L, "+162664", "%+ld",
-__LINE__, 0x0a7c1997L, "+175905175", "%+2ld",
-__LINE__, 0xfe300896L, "fe300896", "%.4x",
-__LINE__, 0x00000537L, "537", "%-0.x",
-__LINE__, 0x3e981779L, "3e981779", "%.6x",
-__LINE__, 0xfffff05eL, "FFFFF05E", "%1.0X",
-__LINE__, -0x07bc0cfL, "-8110287", "%-7d",
-__LINE__, -0x01371bcL, "-1274300", "%.7ld",
-__LINE__, -0x0000013L, "-19", "%.2ld",
-__LINE__, 0x000000d1L, "0xd1", "%#x",
-__LINE__, -0x0000003L, "-3", "%-ld",
-__LINE__, 0xfffffffcL, "FFFFFFFC", "%4.1X",
-__LINE__, 0x00000000L, "0", "%ld",
-__LINE__, 0x0001c8afL, "116911", "%d",
-__LINE__, 0x000048c3L, "48C3", "%X",
-__LINE__, 0x00000079L, "0x0000079", "%-#0.7x",
-__LINE__, 0x0000615aL, " 24922", "% d",
-__LINE__, 0xfffffff5L, "fffffff5", "%x",
-__LINE__, 0x00000308L, "0000308", "%+07.7x",
-__LINE__, 0xfcadc983L, "fcadc983", "%x",
-__LINE__, 0x00000097L, "151", "%#d",
-__LINE__, 0x000001c5L, "453", "%0.2ld",
-__LINE__, 0x00000000L, "00", "%-1.2x",
-__LINE__, 0x00000001L, "+1", "%+02.d",
-__LINE__, 0x01eb4354L, "1EB4354", "% X",
-__LINE__, 0xffffa7d1L, "ffffa7d1", "%5.x",
-__LINE__, 0x0003170eL, "0x3170e", "%#x",
-__LINE__, 0x000001ceL, "1CE", "% .2X",
-__LINE__, 0x3a2991fbL, "975802875", "%d",
-__LINE__, -0xcdad8e2L, "-215668962", "%-d",
-__LINE__, 0xfe0261c3L, "fe0261c3", "%x",
-__LINE__, -0x0006ea7L, "-28327", "% ld",
-__LINE__, 0x032854a3L, "0X32854A3", "% #6X",
-__LINE__, 0x0000004bL, "4b", "%x",
-__LINE__, 0xffff6ca3L, "FFFF6CA3", "%4.X",
-__LINE__, 0x00000000L, "0", "%X",
-__LINE__, 0x00611f04L, "611F04", "%.1X",
-__LINE__, 0x00000000L, " 0", "%#6d",
-__LINE__, 0x0002c711L, "2c711", "%-02.x",
-__LINE__, -0x07a2fe4L, "-8007652", "%d",
-__LINE__, -0x0000547L, "-1351", "%ld",
-__LINE__, 0x00013954L, "0x13954", "%#x",
-__LINE__, -0x00523b7L, "-336823", "%ld",
-__LINE__, -0x00f6c6eL, "-1010798", "%6.ld",
-__LINE__, 0xffea6427L, "FFEA6427", "%3X",
-__LINE__, -0x0000005L, "-5", "%d",
-__LINE__, -0x04fe618L, "-5236248", "% .7d",
-__LINE__, 0xffa80a28L, "ffa80a28", "%-0x",
-__LINE__, 0x00000047L, "71", "%ld",
-__LINE__, 0x001dc6bbL, "1951419", "%#4ld",
-__LINE__, 0x00000868L, " 2152", "%#6d",
-__LINE__, 0x000002fbL, "2fb", "%x",
-__LINE__, 0x00607fa0L, "6324128", "%4d",
-__LINE__, 0xfffed161L, "fffed161", "%x",
-__LINE__, 0x0001c6e4L, " 116452", "% 2.5d",
-__LINE__, 0x0003dda8L, "3DDA8", "%4X",
-__LINE__, 0xfffffff8L, "fffffff8", "%x",
-__LINE__, 0xfacf664aL, "facf664a", "%x",
-__LINE__, 0x000000c1L, "C1", "% 1X",
-__LINE__, 0x0000839cL, " 839C", "%6X",
-__LINE__, 0xfffff69aL, "FFFFF69A", "%X",
-__LINE__, 0x000e5c2eL, "+941102", "%+d",
-__LINE__, -0x0000004L, "-4", "%#d",
-__LINE__, 0x00000000L, "00000", "%#.5ld",
-__LINE__, 0xfffffffeL, "fffffffe", "%3.1x",
-__LINE__, 0x0010ed68L, "1109352", "%-ld",
-__LINE__, 0xffffffe9L, "ffffffe9", "%.6x",
-__LINE__, 0x00000007L, " 7", "% 4.ld",
-__LINE__, 0x0000cabaL, "51898", "%ld",
-__LINE__, -0x0000119L, "-281", "% d",
-__LINE__, 0x0c3012a9L, "204477097", "%03.6ld",
-__LINE__, -0x001c98fL, "-117135", "%ld",
-__LINE__, 0x000017b1L, "+6065", "%+d",
-__LINE__, 0x00000001L, "1", "%ld",
-__LINE__, -0x0000019L, "-25", "% .2d",
-__LINE__, 0x0009ae28L, "9AE28", "%X",
-__LINE__, 0xe861c4feL, "e861c4fe", "%7.x",
-__LINE__, 0xffac88d3L, "FFAC88D3", "%X",
-__LINE__, -0x00005dfL, "-01503", "%-5.5ld",
-__LINE__, 0x0000013eL, "318", "%-0d",
-__LINE__, 0x04b6f58fL, "4b6f58f", "%x",
-__LINE__, 0xfffe3978L, "fffe3978", "%+0.6x",
-__LINE__, 0x57ee5244L, "57ee5244", "%+7.4x",
-__LINE__, 0xfffb5610L, "fffb5610", "% 6x",
-__LINE__, 0x00000006L, " 6", "%#7d",
-__LINE__, 0x0000000cL, "0x0000c", "%#.5x",
-__LINE__, -0xec59362L, "-247829346", "%1.7d",
-__LINE__, -0x0000001L, "-1", "%ld",
-__LINE__, -0x0007e4bL, "-32331", "% d",
-__LINE__, 0x0ececa6fL, "248433263", "%0d",
-__LINE__, 0x00000578L, " 578", "%+6.x",
-__LINE__, -0x0000003L, "-3", "%ld",
-__LINE__, 0x000002bbL, "2bb", "% 0x",
-__LINE__, -0x0000006L, "-6", "%-ld",
-__LINE__, 0x000002f9L, "761", "%d",
-__LINE__, 0xffffd736L, "ffffd736", "%3.4x",
-__LINE__, 0x0010ba79L, "1096313", "%7.4d",
-__LINE__, -0x0001244L, "-4676", "%#.1d",
-__LINE__, 0x00000dbeL, "DBE", "%1X",
-__LINE__, -0x0000015L, "-21", "%-0.d",
-__LINE__, 0xffffffffL, "0xffffffff", "%#x",
-__LINE__, -0x6cdf4a3L, "-114160803", "%ld",
-__LINE__, 0x00008ac9L, "8AC9", "%1X",
-__LINE__, 0x00000000L, "00", "%.2X",
-__LINE__, -0x2263dbaL, "-36060602", "%5.5d",
-__LINE__, 0x00007da9L, "32169", "%0d",
-__LINE__, 0xfffffff7L, "FFFFFFF7", "% 4.X",
-__LINE__, 0xfbf36ccaL, "FBF36CCA", "%.1X",
-__LINE__, 0x00000040L, "64", "%.0ld",
-__LINE__, 0x0000001cL, " 28", "% d",
-__LINE__, 0xfffffadbL, "0xfffffadb", "%#.5x",
-__LINE__, 0x0eb95847L, "247027783", "%d",
-__LINE__, 0xfffd7030L, "FFFD7030", "%+02X",
-__LINE__, 0x00000005L, "00005", "%.5x",
-__LINE__, 0xfffffffdL, "FFFFFFFD", "%X",
-__LINE__, 0x98975b15L, "98975B15", "%02X",
-__LINE__, -0x0000034L, " -52", "%6ld",
-__LINE__, 0xffd7d0ccL, "ffd7d0cc", "% 5.6x",
-__LINE__, 0xffffffa6L, "FFFFFFA6", "%X",
-__LINE__, 0xfff27132L, "fff27132", "%x",
-__LINE__, -0x065b74dL, "-6666061", "%+6ld",
-__LINE__, 0xf6ac99d6L, "0XF6AC99D6", "%#X",
-__LINE__, 0xfffff4bdL, "FFFFF4BD", "%X",
-__LINE__, 0xfffffb62L, "FFFFFB62", "%6X",
-__LINE__, 0xf8434543L, "f8434543", "%-0x",
-__LINE__, 0x0002b374L, "0x2b374", "%-#6x",
-__LINE__, 0x00000000L, "0", "%x",
-__LINE__, 0xffb5751dL, "ffb5751d", "%-3.x",
-__LINE__, 0x34ea7347L, "887780167", "%d",
-__LINE__, -0x008f457L, "-586839", "%0ld",
-__LINE__, 0x00000001L, " 1", "%#4d",
-__LINE__, 0xc32d7ad4L, "c32d7ad4", "%0x",
-__LINE__, 0xfffffb80L, "FFFFFB80", "%-.2X",
-__LINE__, 0x00000756L, "756 ", "%-6x",
-__LINE__, 0xfffb020fL, "FFFB020F", "%+.2X",
-__LINE__, -0xe68619fL, "-241721759", "%#1.6ld",
-__LINE__, 0x180166cdL, "402745037", "%3.7ld",
-__LINE__, -0x0000001L, "-1", "%+00d",
-__LINE__, 0xfdbc3611L, "fdbc3611", "%x",
-__LINE__, -0x000005bL, "-91", "%d",
-__LINE__, 0xffffe77fL, "ffffe77f", "%x",
-__LINE__, -0x0000019L, "-25", "%ld",
-__LINE__, 0x00000016L, "22", "%#d",
-__LINE__, -0x0000025L, "-37", "%ld",
-__LINE__, 0xffffe43fL, "ffffe43f", "%x",
-__LINE__, 0x000050a5L, "00050a5", "%.7x",
-__LINE__, 0x0000000cL, " 12", "% 5.ld",
-__LINE__, -0x001faffL, "-129791", "%4d",
-__LINE__, 0x239d7cf2L, "597523698", "%0.7ld",
-__LINE__, 0x04092183L, "4092183", "% 7X",
-__LINE__, -0x0043498L, "-275608", "%-ld",
-__LINE__, -0x0018dbeL, "-101822", "%d",
-__LINE__, 0xff3e09c3L, "FF3E09C3", "%X",
-__LINE__, 0x00000000L, "0", "%d",
-__LINE__, -0x15d57558L, "-366310744", "%+0.7ld",
-__LINE__, 0x0004fb06L, "326406", "%0.0d",
-__LINE__, 0x00000119L, "0X119", "%#X",
-__LINE__, -0x14c53e19L, "-348470809", "%d",
-__LINE__, 0x00000019L, "0000019", "% .7X",
-__LINE__, -0x0000654L, "-1620", "%0.4ld",
-__LINE__, -0xde5899bL, "-233146779", "%#.1d",
-__LINE__, 0x0013c1f0L, "1294832", "%4.ld",
-__LINE__, 0x0a9fe761L, "A9FE761", "%X",
-__LINE__, -0x00000e5L, "-229", "%1ld",
-__LINE__, 0x00000161L, "000353", "%.6ld",
-__LINE__, 0x6b04e4bdL, "0x6b04e4bd", "%#7.0x",
-__LINE__, -0x0000ef0L, "-3824 ", "%-6.ld",
-__LINE__, -0x026306eL, "-2502766", "%ld",
-__LINE__, 0x00000000L, "0", "%-X",
-__LINE__, 0xfffffe1fL, "fffffe1f", "%-x",
-__LINE__, 0x0003aecfL, " 241359", "% 2.1ld",
-__LINE__, -0x0000014L, "-20", "%d",
-__LINE__, 0x00000002L, "0002", "%-.4ld",
-__LINE__, 0xfffff662L, "0XFFFFF662", "% #.6X",
-__LINE__, 0x00000006L, "6", "%0x",
-__LINE__, 0x0001f4c4L, " 128196", "% 0d",
-__LINE__, 0xffffffffL, "FFFFFFFF", "%5X",
-__LINE__, 0x05605e38L, "90201656", "%ld",
-__LINE__, 0xffffffdeL, "0XFFFFFFDE", "% #X",
-__LINE__, 0x000001e0L, " 1e0", "%7.x",
-__LINE__, 0x00000007L, "7", "%X",
-__LINE__, 0x00000001L, "+1", "%+d",
-__LINE__, 0xffffffe0L, "FFFFFFE0", "% X",
-__LINE__, 0xffd7f77aL, "FFD7F77A", "%+00.1X",
-__LINE__, 0xfffffffeL, "0xfffffffe", "%-#x",
-__LINE__, 0x01b0a63bL, "1b0a63b", "%x",
-__LINE__, -0x06554b7L, "-6640823", "%d",
-__LINE__, 0xfffffff8L, "fffffff8", "%x",
-__LINE__, 0x00000b2dL, "b2d", "%x",
-__LINE__, -0x2664ba2L, "-40258466", "%-d",
-__LINE__, 0xfffffffeL, "FFFFFFFE", "%X",
-__LINE__, -0x0000552L, " -1362", "%6.2ld",
-__LINE__, 0x00000009L, " 00009", "%6.5x",
-__LINE__, 0x00035c72L, "220274", "%05.ld",
-__LINE__, -0x014d09dL, "-1364125", "%d",
-__LINE__, -0x0000002L, " -2", "% 4d",
-__LINE__, 0x00000001L, "1", "%+X",
-__LINE__, 0x00000028L, "28", "%X",
-__LINE__, 0xf25c9eb2L, "F25C9EB2", "%7.X",
-__LINE__, -0x7ae4b62L, "-128863074", "%d",
-__LINE__, 0x00630d87L, "630D87", "%2X",
-__LINE__, 0x000000f8L, "F8", "%-X",
-__LINE__, 0xfffffff9L, "FFFFFFF9", "%X",
-__LINE__, -0x0000007L, "-7", "%0d",
-__LINE__, -0x2518fcdL, "-38899661", "% 3ld",
-__LINE__, 0xfffff4b4L, "FFFFF4B4", "%-5X",
-__LINE__, 0x01cc36c8L, "30160584", "%ld",
-__LINE__, 0xffffffffL, "ffffffff", "%-x",
-__LINE__, 0x0000000bL, " 11", "%6.ld",
-__LINE__, 0x00010d55L, " 68949", "% d",
-__LINE__, -0x0c01306L, "-12587782", "% 6.1ld",
-__LINE__, 0x001719d7L, "1513943", "%.1ld",
-__LINE__, -0x0000002L, " -2", "%+3.ld",
-__LINE__, 0x0000018eL, "398", "%d",
-__LINE__, 0x000000a6L, "0xa6", "%-#3x",
-__LINE__, 0x00006f66L, " 28518", "% #d",
-__LINE__, 0x0000032aL, "32A", "%X",
-__LINE__, -0x0000145L, "-325", "%0d",
-__LINE__, 0xffffffffL, "ffffffff", "%2.x",
-__LINE__, 0x00287171L, "2650481", "%ld",
-__LINE__, 0x0000004bL, "+75", "%+02.ld",
-__LINE__, 0xfffffff8L, "fffffff8", "%-0x",
-__LINE__, 0x00000064L, "64", "% X",
-__LINE__, 0xfffffca2L, "fffffca2", "%0x",
-__LINE__, 0x000010b6L, "10b6", "% .0x",
-__LINE__, -0x003806fL, "-229487", "%7d",
-__LINE__, -0x00000b7L, "-183", "%3ld",
-__LINE__, 0xffffe5baL, "FFFFE5BA", "%0X",
-__LINE__, 0x001f0da8L, "1f0da8", "%+x",
-__LINE__, 0x000ce185L, "844165", "%0ld",
-__LINE__, 0x00000c96L, "3222", "%0d",
-__LINE__, -0x0013099L, "-77977", "%1.ld",
-__LINE__, -0x5f3c47aL, "-99861626", "%.6ld",
-__LINE__, 0x00000cbfL, " CBF", "%+5.X",
-__LINE__, -0x0000001L, "-1", "%+ld",
-__LINE__, 0x0d793bc3L, "d793bc3", "%6.x",
-__LINE__, 0xfffffffdL, "0xfffffffd", "%+#x",
-__LINE__, -0x0000070L, " -112", "%6.d",
-__LINE__, 0xfffffb3fL, "FFFFFB3F", "%.7X",
-__LINE__, 0x037dfc78L, "0X37DFC78", "%#X",
-__LINE__, 0x00009ba5L, "39845", "%3ld",
-__LINE__, 0x0000004aL, "4a", "%0x",
-__LINE__, 0xffffff81L, "ffffff81", "%5.5x",
-__LINE__, -0x86ef222L, "-141488674", "%ld",
-__LINE__, -0xac5531eL, "-180704030", "% 4ld",
-__LINE__, 0x00002493L, "2493", "%+X",
-__LINE__, 0xffffffffL, "FFFFFFFF", "%1.3X",
-__LINE__, 0x0005c875L, "378997", "%.0ld",
-__LINE__, 0x0301d345L, "50451269", "%d",
-__LINE__, 0xfff6b589L, "fff6b589", "%2.4x",
-__LINE__, -0x00001dbL, "-475 ", "%-7.0d",
-__LINE__, 0x0000d1e7L, "0x000d1e7", "%#2.7x",
-__LINE__, 0xf4c4d2bbL, "f4c4d2bb", "%.6x",
-__LINE__, 0x00c89f54L, "13147988", "%ld",
-__LINE__, -0x6599253cL, "-1704535356", "%+ld",
-__LINE__, 0xab7d61eaL, "ab7d61ea", "% x",
-__LINE__, 0x00000006L, "6", "%1ld",
-__LINE__, 0xffff5ab7L, "ffff5ab7", "%0x",
-__LINE__, -0x1cfeca5bL, "-486459995", "%#ld",
-__LINE__, 0x000000f3L, " f3", "% 6.x",
-__LINE__, -0x0000021L, "-33", "%d",
-__LINE__, 0xfe7246acL, "fe7246ac", "%-5.x",
-__LINE__, 0x00000017L, "00017", "%-.5X",
-__LINE__, -0x0cc250aL, "-13378826", "%0.0d",
-__LINE__, -0x00010aeL, "-04270", "%#.5ld",
-__LINE__, -0x7952c8bL, "-127216779", "% ld",
-__LINE__, 0x0002a53eL, "173374", "%4.0d",
-__LINE__, 0x03801bbfL, "3801BBF", "%0X",
-__LINE__, 0x0368645fL, "+57173087", "%+#0.6ld",
-__LINE__, 0x0000002fL, "47", "%d",
-__LINE__, 0x00000003L, "3", "%x",
-__LINE__, 0x000005f7L, "5F7", "%0X",
-__LINE__, -0x06e5e76L, "-7233142", "% 0.1ld",
-__LINE__, 0x053da936L, "53da936", "%1.4x",
-__LINE__, -0x0df0c2fL, "-14617647", "%.5ld",
-__LINE__, 0xfffffffdL, "FFFFFFFD", "%-0X",
-__LINE__, 0x000104bfL, "104BF", "%X",
-__LINE__, 0x000353fcL, "353FC", "%X",
-__LINE__, 0x182a18dcL, "+405412060", "%+ld",
-__LINE__, 0x0000000eL, " 14", "% 2d",
-__LINE__, -0x0000091L, "-145", "%+ld",
-__LINE__, 0x0029a9d6L, "2730454", "%d",
-__LINE__, 0x00009d57L, "009d57", "% .6x",
-__LINE__, 0x4c4d4f79L, "1280135033", "%5.ld",
-__LINE__, -0x000075bL, "-1883", "% 03d",
-__LINE__, -0x001b718L, "-112408", "%+d",
-__LINE__, 0xfffaaf57L, "FFFAAF57", "%+1X",
-__LINE__, 0x00f44e52L, "F44E52", "% 4X",
-__LINE__, 0x00000002L, "0X2", "%#X",
-__LINE__, 0x000a85e9L, "A85E9", "%+0X",
-__LINE__, 0xffff70bbL, "ffff70bb", "%6x",
-__LINE__, 0x00004e15L, "4e15", "%x",
-__LINE__, 0x000eeb60L, " 977760", "% ld",
-__LINE__, 0xfffffff1L, "fffffff1", "%0x",
-__LINE__, -0x294d7e2L, "-43309026", "% 02.d",
-__LINE__, 0x0001aaebL, "0109291", "%02.7ld",
-__LINE__, 0x000a01fcL, "0xa01fc", "%-#.5x",
-__LINE__, 0x002c3c30L, "+2898992", "%+#d",
-__LINE__, 0x015667aeL, "+22439854", "%+5ld",
-__LINE__, -0x05af42bL, "-5960747", "%+d",
-__LINE__, 0x0000be36L, "be36", "%+2x",
-__LINE__, 0x005e3f67L, "5e3f67", "% x",
-__LINE__, -0x0000020L, "-32", "% ld",
-__LINE__, -0x0003617L, "-13847", "% d",
-__LINE__, 0x00000014L, "14 ", "%-4.X",
-__LINE__, 0x00000001L, "001", "%0.3d",
-__LINE__, 0xfffffea9L, "fffffea9", "%3.x",
-__LINE__, 0xe447099eL, "E447099E", "%0X",
-__LINE__, 0x00049c71L, "302193", "%d",
-__LINE__, 0x76356ed3L, "0x76356ed3", "%#4.1x",
-__LINE__, 0x00000005L, " 0X5", "%#5X",
-__LINE__, 0x00004da2L, "0x004da2", "%#1.6x",
-__LINE__, 0xffdfb36cL, "FFDFB36C", "%4X",
-__LINE__, 0xffffe3c5L, "FFFFE3C5", "%+4.X",
-__LINE__, 0x00000006L, "6", "%0x",
-__LINE__, -0x914ff17L, "-152370967", "% .5ld",
-__LINE__, -0x0000002L, "-2", "%0ld",
-__LINE__, 0xffffff36L, "FFFFFF36", "% 2X",
-__LINE__, -0x0bb1598L, "-12260760", "%-ld",
-__LINE__, 0x00006db5L, "28085", "%0.5ld",
-__LINE__, 0xffffffffL, "ffffffff", "%x",
-__LINE__, -0x0000001L, "-1", "%0ld",
-__LINE__, 0x0fa37e79L, "FA37E79", "%1.X",
-__LINE__, -0x00000acL, "-172", "%.2d",
-__LINE__, 0xffffffd8L, "ffffffd8", "%.7x",
-__LINE__, -0x000a513L, "-42259", "%ld",
-__LINE__, 0x00001294L, "4756", "%2ld",
-__LINE__, -0x56bae0b4L, "-1455087796", "%.1ld",
-__LINE__, 0x3b26d5faL, "3b26d5fa", "%x",
-__LINE__, 0xff657013L, "ff657013", "%x",
-__LINE__, -0x00005f5L, "-1525", "%0.0ld",
-__LINE__, -0x0000001L, " -1", "% 7d",
-__LINE__, -0x02396b2L, "-2332338", "%d",
-__LINE__, -0x0000003L, "-000003", "%+7.6d",
-__LINE__, 0xfd3ec7c1L, "fd3ec7c1", "% 3.4x",
-__LINE__, -0x076e338L, "-7791416", "%0.d",
-__LINE__, -0x000015eL, "-350", "%3ld",
-__LINE__, 0x0a0f0b71L, "a0f0b71", "%x",
-__LINE__, 0xfffe00baL, "FFFE00BA", "%X",
-__LINE__, 0x00036bd8L, " 36bd8", "% 06.x",
-__LINE__, 0xfffff2dfL, "0XFFFFF2DF", "%#2.6X",
-__LINE__, 0x004687fbL, "4622331", "%ld",
-__LINE__, -0x0000331L, " -817", "%+6.d",
-__LINE__, 0xfcd5b090L, "fcd5b090", "%+0x",
-__LINE__, 0x0334f94cL, "334F94C", "%.6X",
-__LINE__, 0x00000bceL, "3022", "%.3ld",
-__LINE__, 0xf28d9dddL, "f28d9ddd", "%x",
-__LINE__, 0x00003a79L, " 14969", "% ld",
-__LINE__, 0xfffffffeL, "FFFFFFFE", "%.7X",
-__LINE__, 0x0043d7feL, "43D7FE", "%X",
-__LINE__, -0x0000b82L, "-2946", "%-ld",
-__LINE__, -0x00e29d8L, "-928216", "%d",
-__LINE__, 0xffffffecL, "ffffffec", "%-x",
-__LINE__, 0x0aeaf557L, "0xaeaf557", "%-#x",
-__LINE__, 0x00c07fe6L, "C07FE6", "%X",
-__LINE__, 0x307414d8L, "307414d8", "% 0x",
-__LINE__, -0x045ef67L, "-4583271", "%d",
-__LINE__, 0x0000024aL, " 0000586", "% .7d",
-__LINE__, 0xfffffc42L, "fffffc42", "%x",
-__LINE__, 0xfc38c249L, "fc38c249", "%5.x",
-__LINE__, -0x000d096L, "-53398", "%-d",
-__LINE__, -0x213a345L, "-34841413", "%ld",
-__LINE__, -0x0000130L, "-304", "%ld",
-__LINE__, -0x000efd1L, "-61393", "%ld",
-__LINE__, 0xfffff867L, "FFFFF867", "%2X",
-__LINE__, 0x00113ed0L, "0x113ed0", "%-#7x",
-__LINE__, 0x00000677L, " 1655", "% 3.ld",
-__LINE__, 0x0000002fL, "2f", "%x",
-__LINE__, 0xfffffd38L, "fffffd38", "%-4x",
-__LINE__, -0x000b3ccL, "-46028", "%1.2d",
-__LINE__, 0x45da719bL, "45DA719B", "%+0X",
-__LINE__, -0x000a454L, " -42068", "%7.3ld",
-__LINE__, 0x01cc7c30L, " 30178352", "% d",
-__LINE__, -0x05ae80eL, "-5957646", "%#.4ld",
-__LINE__, 0x000000b9L, "185", "%d",
-__LINE__, 0x003fcaf4L, "4180724", "%1.ld",
-__LINE__, 0x02da1b74L, "2DA1B74", "%X",
-__LINE__, 0xffffffd9L, "FFFFFFD9", "%X",
-__LINE__, 0x00064359L, "64359 ", "%-6X",
-__LINE__, 0x000000f0L, "240", "%ld",
-__LINE__, -0x01715e5L, "-1512933", "%ld",
-__LINE__, 0xc8f6e118L, "0XC8F6E118", "%#X",
-__LINE__, 0xfffffd8fL, "FFFFFD8F", "%X",
-__LINE__, 0x0000176dL, "5997 ", "%-6d",
-__LINE__, 0x00003cabL, "0x3cab", "%#0.3x",
-__LINE__, 0x00000001L, " 1", "% d",
-__LINE__, 0xfffff610L, "0XFFFFF610", "%#X",
-__LINE__, 0xfffffffeL, "FFFFFFFE", "%5.7X",
-__LINE__, 0x00000001L, "1", "%0x",
-__LINE__, 0x00000001L, "00001", "%.5ld",
-__LINE__, -0x0000d51L, "-3409", "%d",
-__LINE__, -0x08639eeL, "-8796654", "%ld",
-__LINE__, 0x00003121L, "12577", "%#1.2ld",
-__LINE__, 0x0000004eL, "78", "%d",
-__LINE__, 0xfffff64fL, "fffff64f", "%-x",
-__LINE__, 0x0000002aL, "2a", "%0x",
-__LINE__, 0x00000020L, "20", "%x",
-__LINE__, -0x00000b8L, "-184", "%#ld",
-__LINE__, 0x0000000aL, "10", "%-#d",
-__LINE__, 0x00000364L, "868", "%.1ld",
-__LINE__, 0x00d1f9b6L, "D1F9B6", "%0.X",
-__LINE__, 0x008cfda1L, "8CFDA1", "% 6.X",
-__LINE__, 0xffd58cceL, "FFD58CCE", "%X",
-__LINE__, 0x00000008L, "0000008", "%6.7ld",
-__LINE__, 0x00000318L, " 318", "%4X",
-__LINE__, 0x000172d8L, "94936", "%2ld",
-__LINE__, -0x056ccbfL, "-5688511", "%ld",
-__LINE__, 0x000000c7L, "+000199", "%+0.6d",
-__LINE__, 0x00000002L, "0X2", "%-#X",
-__LINE__, 0xfffff634L, "FFFFF634", "%.1X",
-__LINE__, -0x00001f3L, "-499", "%-ld",
-__LINE__, -0x000081bL, "-2075", "%-d",
-__LINE__, 0x000000b5L, "181", "%0d",
-__LINE__, 0xfe961ee8L, "fe961ee8", "%0x",
-__LINE__, 0x000028a2L, "10402", "%d",
-__LINE__, 0xffffffffL, "FFFFFFFF", "%.4X",
-__LINE__, -0x000058aL, "-1418", "%.3ld",
-__LINE__, 0x00001cebL, "1CEB", "%X",
-__LINE__, 0x00000021L, "21", "% X",
-__LINE__, 0x00000002L, "2", "%0d",
-__LINE__, -0x2f9bbf5L, "-49921013", "%.4ld",
-__LINE__, 0x00000e91L, "03729", "%#.5ld",
-__LINE__, 0xf1116740L, "f1116740", "%2x",
-__LINE__, 0x00014f72L, "14F72", "%X",
-__LINE__, 0xfffffcedL, "FFFFFCED", "%X",
-__LINE__, 0xffffffffL, "ffffffff", "%.5x",
-__LINE__, 0x0017cf0cL, " 1560332", "% 0ld",
-__LINE__, 0x0000000aL, "A", "% X",
-__LINE__, 0xff3a39d4L, "ff3a39d4", "%x",
-__LINE__, 0xfffef05fL, "FFFEF05F", "%X",
-__LINE__, 0xfedfe708L, "fedfe708", "%03.0x",
-__LINE__, 0x000345a0L, "345A0", "% X",
-__LINE__, -0x1ed5b6f7L, "-517322487", "%d",
-__LINE__, 0xd2d56c22L, "D2D56C22", "%0.X",
-__LINE__, 0x00002cbfL, "2CBF", "%.2X",
-__LINE__, 0x00000db4L, "db4", "%3x",
-__LINE__, -0x000b154L, "-45396", "%d",
-__LINE__, 0x002bf4c7L, "2BF4C7", "%X",
-__LINE__, 0x6954abf4L, "+1767156724", "%+d",
-__LINE__, 0xfffffffbL, "fffffffb", "%x",
-__LINE__, -0x29e0050eL, "-702547214", "%-0ld",
-__LINE__, -0x0014989L, "-84361", "%-#0.3ld",
-__LINE__, 0x001a557cL, "+1725820", "%+6.5d",
-__LINE__, -0x56689a81L, "-1449695873", "%.2d",
-__LINE__, 0x00000016L, " 16", "%05.X",
-__LINE__, 0x0001da1eL, " 121374", "% d",
-__LINE__, -0x04deac7L, "-5106375", "%03.4d",
-__LINE__, 0x000012b1L, "4785", "%d",
-__LINE__, 0x0009a116L, "9a116", "%-x",
-__LINE__, -0x0000003L, "-000003", "%4.6ld",
-__LINE__, 0x00000000L, "", "%.0x",
-__LINE__, 0x0000000aL, " A", "% 3X",
-__LINE__, 0xfffffff0L, "0xfffffff0", "%-#0.1x",
-__LINE__, 0x00000086L, "86", "%0X",
-__LINE__, 0x0000001fL, "31", "%-d",
-__LINE__, 0x0386f706L, "59176710", "%3.6ld",
-__LINE__, 0xffe437aeL, "0XFFE437AE", "%#X",
-__LINE__, 0x0e5405c6L, "e5405c6", "%-x",
-__LINE__, 0xfffdee46L, "FFFDEE46", "%+X",
-__LINE__, 0xff861e9dL, "FF861E9D", "%5.X",
-__LINE__, 0xfffff570L, "FFFFF570", "%-X",
-__LINE__, 0x045c90bdL, "45c90bd", "%0x",
-__LINE__, 0x000000aaL, "AA", "%+X",
-__LINE__, -0x747262eL, "-122103342", "%0ld",
-__LINE__, 0xffffad89L, "FFFFAD89", "%X",
-__LINE__, 0x00000018L, "18", "%0.2X",
-__LINE__, 0x00057a2dL, " 358957", "% #7.d",
-__LINE__, 0x73a0e21dL, "1939923485", "%ld",
-__LINE__, -0x00021e1L, "-8673", "%0d",
-__LINE__, 0x000000e9L, " 233", "% 06.3ld",
-__LINE__, 0xffffcc0dL, "ffffcc0d", "%x",
-__LINE__, 0x00000052L, "52", "%x",
-__LINE__, 0x01c155afL, "1C155AF", "%.5X",
-__LINE__, 0xffffffffL, "ffffffff", "%0.x",
-__LINE__, -0x00400a4L, "-262308", "%-d",
-__LINE__, -0x0000001L, "-0000001", "%#.7ld",
-__LINE__, 0x01fb9c99L, "1fb9c99", "% 03.5x",
-__LINE__, 0xffffffffL, "ffffffff", "%6.x",
-__LINE__, 0xff5e5eeaL, "FF5E5EEA", "%X",
-__LINE__, 0x0000000fL, "F", "%+0X",
-__LINE__, 0xfffffe3aL, "fffffe3a", "% x",
-__LINE__, 0xfffffffeL, "FFFFFFFE", "%-X",
-__LINE__, -0x0000007L, "-7", "%0ld",
-__LINE__, -0x002f635L, "-194101", "%d",
-__LINE__, -0x0000005L, "-5", "%ld",
-__LINE__, -0x0000059L, "-89", "%0ld",
-__LINE__, -0x1ccda96L, "-30202518", "%d",
-__LINE__, -0x0000002L, "-2", "%-d",
-__LINE__, 0xffffffdaL, "0XFFFFFFDA", "%#X",
-__LINE__, 0x00036cc5L, "224453", "%#d",
-__LINE__, 0x00000010L, "+16", "%+ld",
-__LINE__, 0x0b6039c7L, "190855623", "%d",
-__LINE__, -0x0000002L, "-002", "%#.3d",
-__LINE__, 0xfff3e746L, "FFF3E746", "%-4X",
-__LINE__, 0x0361b3deL, "361B3DE", "% 04X",
-__LINE__, 0xffffe6a2L, "ffffe6a2", "%-x",
-__LINE__, 0x00032790L, "0x0032790", "%#7.7x",
-__LINE__, 0xffe33b4eL, "ffe33b4e", "%-0x",
-__LINE__, -0x0094663L, "-607843", "%.3ld",
-__LINE__, -0x00a3efaL, "-671482", "%4d",
-__LINE__, 0x000000e6L, " 00E6", "%7.4X",
-__LINE__, 0x000125cbL, "125CB", "%+X",
-__LINE__, 0x0000b97eL, "b97e", "%x",
-__LINE__, -0x0000039L, "-57", "%+ld",
-__LINE__, 0xffffe39aL, "ffffe39a", "%5.4x",
-__LINE__, 0xffffffffL, "ffffffff", "%6.1x",
-__LINE__, -0xdee910cL, "-233738508", "%-#2d",
-__LINE__, -0x14044930L, "-335825200", "%6.ld",
-__LINE__, 0x00a81259L, "a81259", "%x",
-__LINE__, 0x020e74c6L, "20E74C6", "%X",
-__LINE__, -0x00000fbL, "-251", "%01.d",
-__LINE__, 0x034ceb45L, "34CEB45", "%5.X",
-__LINE__, 0xfeacb66aL, "feacb66a", "% x",
-__LINE__, 0x00003eb6L, "3EB6", "% X",
-__LINE__, 0x000009efL, "9ef", "% x",
-__LINE__, 0xf9d9dd07L, "F9D9DD07", "%0X",
-#ifndef __PCCNECV70__
-
-__LINE__, 0x000154d7L, "087255", "%.6ld",
-__LINE__, -0x000036eL, "-878", "%-ld",
-__LINE__, -0x0007dccL, "-32204", "% d",
-__LINE__, 0x000019dcL, "6620", "%d",
-__LINE__, 0xffffff6eL, "FFFFFF6E", "%2X",
-__LINE__, 0x00000016L, "0x16", "%-#x",
-__LINE__, 0xffdb3e96L, "ffdb3e96", "%+.5x",
-__LINE__, 0xffffffefL, "FFFFFFEF", "% 04.X",
-__LINE__, 0xffffffffL, "FFFFFFFF", "%5X",
-__LINE__, 0x000c08cdL, "C08CD", "%-X",
-__LINE__, 0x18de71eeL, "18de71ee", "%x",
-__LINE__, 0xffffffffL, "ffffffff", "% x",
-__LINE__, -0x00025bdL, "-009661", "%#.6d",
-__LINE__, 0x2f05de14L, " 788913684", "% 6.4ld",
-__LINE__, 0x0c99cf86L, "211406726", "%.5d",
-__LINE__, 0x09e6a21dL, " 166109725", "% 0d",
-__LINE__, -0x013da65L, "-1301093", "%+ld",
-__LINE__, 0x000003d0L, " 976", "% 4.2d",
-__LINE__, -0xef9e3ccL, "-251257804", "%-7.0d",
-__LINE__, 0x0000000cL, "+12", "%+00ld",
-__LINE__, 0xffffffe2L, "ffffffe2", "%x",
-__LINE__, 0x000000feL, "fe", "%-x",
-__LINE__, 0xfffffc5fL, "fffffc5f", "%x",
-__LINE__, -0x0005c55L, "-23637", "%d",
-__LINE__, -0x0111ff2L, "-1122290", "% 7.d",
-__LINE__, -0x1a1746e5L, "-437733093", "%.4ld",
-__LINE__, 0x00001007L, "004103", "%00.6d",
-__LINE__, 0xffffffe1L, "ffffffe1", "%x",
-__LINE__, 0x0000d80fL, "55311", "%d",
-__LINE__, 0x00000004L, "4", "%+X",
-__LINE__, 0xfffffffdL, "fffffffd", "%6x",
-__LINE__, -0x2afbcc3cL, "-721144892", "%4.6ld",
-__LINE__, 0x00377f96L, "377F96", "%6.X",
-__LINE__, 0xffffffc8L, "FFFFFFC8", "%0X",
-__LINE__, 0x007ed9d1L, "8313297", "%-3d",
-__LINE__, 0x00000000L, "0", "%-X",
-__LINE__, 0x001e122dL, "1970733", "%01.d",
-__LINE__, -0x000029bL, "-667", "%ld",
-__LINE__, -0x002f563L, "-193891", "% 2.5d",
-__LINE__, 0xfffffffeL, "fffffffe", "%+3.7x",
-__LINE__, 0xfff7658cL, "fff7658c", "%x",
-__LINE__, -0x0006d08L, "-0027912", "%7.7ld",
-__LINE__, 0x00000080L, "80", "%X",
-__LINE__, 0x0000078fL, " 1935", "% 6ld",
-__LINE__, 0xfffffffbL, "FFFFFFFB", "% X",
-__LINE__, 0x000000aeL, " AE", "%7.X",
-__LINE__, -0x000d6aaL, "-54954", "%-ld",
-__LINE__, 0xfffffffeL, "FFFFFFFE", "%6.X",
-__LINE__, 0x000003bfL, "+959", "%+d",
-__LINE__, -0x7242d04bL, "-1916981323", "% ld",
-__LINE__, 0xf0e6546fL, "F0E6546F", "% .7X",
-__LINE__, 0x047e196aL, "75372906", "%ld",
-__LINE__, 0x0240174eL, "240174E", "%+0X",
-__LINE__, -0x0000006L, "-006", "%.3ld",
-__LINE__, 0x00068aacL, "428716", "%#ld",
-__LINE__, 0xffffffa1L, "ffffffa1", "%0x",
-__LINE__, 0x000adab3L, "adab3", "%x",
-__LINE__, -0x00000aeL, "-0000174", "%7.7ld",
-__LINE__, 0x0f0a8f4bL, "f0a8f4b", "% x",
-__LINE__, 0xfee229bcL, "fee229bc", "%x",
-__LINE__, -0x275b8455L, "-660309077", "%.2ld",
-__LINE__, -0xca4b2a5L, "-212120229", "%d",
-__LINE__, 0x000000b5L, " 181", "%04.d",
-__LINE__, 0xfff213f2L, "FFF213F2", "%X",
-__LINE__, 0x00000003L, "3", "%-X",
-__LINE__, 0x0ebb978bL, "247175051", "%.6ld",
-__LINE__, 0xffffffcaL, "FFFFFFCA", "%X",
-__LINE__, -0x0000003L, "-03", "%+0.2d",
-__LINE__, -0x178ff86L, "-24706950", "%+d",
-__LINE__, 0x0000003cL, " 60", "%7.ld",
-__LINE__, -0x001012dL, "-65837", "%.5d",
-__LINE__, 0x03673fd2L, "3673fd2", "%.5x",
-__LINE__, -0x001fe74L, "-130676", "%#0.6ld",
-__LINE__, 0x004f6226L, "4f6226", "%-0x",
-__LINE__, 0xfffffa0fL, "fffffa0f", "%7x",
-__LINE__, 0xfffffff8L, "fffffff8", "%-.6x",
-__LINE__, -0x0000001L, "-1", "%#d",
-__LINE__, 0xffffe43dL, "ffffe43d", "%7x",
-__LINE__, 0x00009d47L, "0040263", "%7.7ld",
-__LINE__, 0xff0fc79fL, "FF0FC79F", "%-4.X",
-__LINE__, 0x2d610907L, "2d610907", "%x",
-__LINE__, -0x00002deL, "-734", "%04d",
-__LINE__, 0x0000036bL, " 36B", "%7.1X",
-__LINE__, 0x00000002L, "2", "%.0x",
-__LINE__, -0x1f577b3eL, "-525826878", "%d",
-__LINE__, 0x0000002dL, "45", "%#ld",
-__LINE__, 0xfffffffbL, "fffffffb", "%x",
-__LINE__, -0x0000004L, "-4", "%-.0d",
-__LINE__, 0x00016ba4L, "16ba4", "%x",
-__LINE__, -0x1ad853d5L, "-450384853", "% 0ld",
-__LINE__, 0x00366899L, "366899", "%2.x",
-__LINE__, 0x1659158bL, "1659158B", "%X",
-__LINE__, 0x000076c7L, "76c7", "%x",
-__LINE__, 0x00000674L, "674", "%0x",
-__LINE__, 0x016c9d8aL, "+23895434", "%+ld",
-__LINE__, 0xfffffc43L, "FFFFFC43", "%0X",
-__LINE__, 0xfff249d2L, "fff249d2", "%-2.x",
-__LINE__, 0xffffffddL, "ffffffdd", "%5x",
-__LINE__, 0xffffa7efL, "FFFFA7EF", "%0.3X",
-__LINE__, 0x030d4d06L, "30d4d06", "%x",
-__LINE__, -0x0e4694bL, "-14969163", "%d",
-__LINE__, 0x00000078L, "120", "%.3ld",
-__LINE__, -0x16c1273eL, "-381757246", "%0d",
-__LINE__, 0xffffd183L, "FFFFD183", "% 0X",
-__LINE__, -0x2dfdaddL, "-48224989", "%ld",
-__LINE__, -0x5767fe5cL, "-1466433116", "%ld",
-__LINE__, 0x01bea036L, "29270070", "%#4.3d",
-__LINE__, 0x00000027L, "27", "%-x",
-__LINE__, 0x0004d183L, "4D183", "%X",
-__LINE__, 0xffdaf9c8L, "FFDAF9C8", "%.7X",
-__LINE__, 0xfffffd95L, "fffffd95", "%x",
-__LINE__, -0x0059acbL, "-367307", "%00.d",
-__LINE__, 0x017d8db4L, "17d8db4", "% 05.x",
-__LINE__, 0x0001f084L, "001F084", "%5.7X",
-__LINE__, 0x00000006L, " 6", "% ld",
-__LINE__, 0x011b0802L, "18548738", "%.3ld",
-__LINE__, 0x00000006L, " 6", "%#3.d",
-__LINE__, 0xffffffffL, "ffffffff", "%6x",
-__LINE__, 0x00000001L, "1", "% x",
-__LINE__, 0x00000750L, " 01872", "% .5d",
-__LINE__, 0xfffffff9L, "fffffff9", "%x",
-__LINE__, -0x00f842cL, "-1016876", "%+d",
-__LINE__, -0x001dcf0L, "-122096", "%-0d",
-__LINE__, 0x000000c9L, "0XC9", "% #3X",
-__LINE__, 0x1e368e86L, "1e368e86", "%7x",
-__LINE__, -0x0001157L, "-4439", "% 03.4d",
-__LINE__, 0xfff91e87L, "FFF91E87", "%3.5X",
-__LINE__, 0x00000006L, "6", "%x",
-__LINE__, 0x00000bcaL, "3018", "%ld",
-__LINE__, 0x00495ff6L, "495ff6", "%01.0x",
-__LINE__, -0x0267f7aL, "-2523002", "% #5d",
-__LINE__, 0x00000060L, "96", "%-d",
-__LINE__, 0x000850c6L, "544966", "%#.1d",
-__LINE__, 0x00231457L, "231457", "%-6.4X",
-__LINE__, 0x0000000bL, "11", "%-d",
-__LINE__, 0x000003bdL, "957", "%#d",
-__LINE__, 0xfd51d970L, "FD51D970", "%+.7X",
-__LINE__, 0x000007bfL, "1983", "%-ld",
-__LINE__, 0x000034b2L, "34B2", "%0.X",
-__LINE__, 0x0000c18dL, "C18D", "%0.X",
-__LINE__, 0xffffbb83L, "ffffbb83", "% 3x",
-__LINE__, 0x000001d0L, "0x1d0", "%#x",
-__LINE__, -0x003c784L, "-247684", "%#ld",
-__LINE__, 0x0210cffaL, "210CFFA", "%X",
-__LINE__, -0x33093a1L, "-53515169", "% 0d",
-__LINE__, 0x00000001L, " 1", "% #ld",
-__LINE__, 0xffffaa53L, "ffffaa53", "%-4.5x",
-__LINE__, 0x2935c056L, "691388502", "%1.d",
-__LINE__, -0x0000001L, "-1", "%ld",
-__LINE__, 0x000013d1L, "0X013D1", "%+#2.5X",
-__LINE__, -0x000035cL, "-860", "%-.2d",
-__LINE__, 0x00000000L, " ", "%-4.X",
-__LINE__, -0x0000147L, "-327", "%d",
-__LINE__, 0x0a317eb0L, "171015856", "%.7d",
-__LINE__, 0x00000003L, "3", "%ld",
-__LINE__, 0x000001d6L, "1d6", "%-x",
-__LINE__, 0x18185214L, "404247060", "%-.2ld",
-__LINE__, 0x00574140L, "0574140", "%.7X",
-__LINE__, 0x00002ea5L, "02ea5", "%.5x",
-__LINE__, 0x00000005L, "5", "% x",
-__LINE__, 0xffc47ed6L, "ffc47ed6", "%-x",
-__LINE__, 0x0001f5daL, "0X1F5DA", "%#X",
-__LINE__, 0xfffffcc9L, "fffffcc9", "% x",
-__LINE__, 0x02586c98L, "2586C98", "%X",
-__LINE__, -0x0000036L, "-54", "% ld",
-__LINE__, 0x00064b57L, "412503", "%1.5d",
-__LINE__, -0x0000007L, "-7", "%#0.0ld",
-__LINE__, 0x00023a03L, "145923", "%ld",
-__LINE__, -0x0000065L, "-101", "%+#d",
-__LINE__, 0x00000208L, "208", "%X",
-__LINE__, 0x00e97728L, "15300392", "%-ld",
-__LINE__, 0x0000030aL, "+778", "%+d",
-__LINE__, 0xf4d7deeeL, "F4D7DEEE", "%+X",
-__LINE__, -0x000009aL, "-154", "%+.3ld",
-__LINE__, 0x000002c0L, "+704", "%+ld",
-__LINE__, 0x0067ec23L, "67ec23", "%x",
-__LINE__, 0x005ca7fcL, "+6072316", "%+d",
-__LINE__, 0xfffff5f1L, "fffff5f1", "%x",
-__LINE__, 0x00000601L, " 0X601", "%#7.2X",
-__LINE__, -0x0000057L, "-87", "% ld",
-__LINE__, -0x0000078L, " -120", "%7.d",
-__LINE__, -0x000001fL, "-31 ", "%-6d",
-__LINE__, 0x0160c000L, "23117824", "%ld",
-__LINE__, -0x0000007L, "-7", "%0ld",
-__LINE__, 0xfffffffeL, "fffffffe", "%+x",
-__LINE__, 0x5b6ef898L, "5b6ef898", "%+0x",
-__LINE__, 0x0009bfb6L, "638902", "%d",
-__LINE__, -0x0000145L, " -325", "%#6.0d",
-__LINE__, -0x508c048L, "-84459592", "%-5.ld",
-__LINE__, 0x00000002L, " 0x2", "% #4x",
-__LINE__, 0x0001486eL, "84078", "%#d",
-__LINE__, 0x006ac76aL, "6997866", "%.6d",
-__LINE__, 0xffffff98L, "FFFFFF98", "%X",
-__LINE__, 0xfffffe08L, "fffffe08", "%6.x",
-__LINE__, -0x24ef47eL, "-38728830", "%1.6ld",
-__LINE__, 0x39d1b2dbL, "39D1B2DB", "% X",
-__LINE__, 0xfffc9ce2L, "0xfffc9ce2", "%#x",
-__LINE__, 0x59485e14L, "1497914900", "%#4ld",
-__LINE__, 0x000022ebL, "22EB", "%3.X",
-__LINE__, 0xfa410352L, "FA410352", "%-X",
-__LINE__, -0x4a342f0L, "-77808368", "% ld",
-__LINE__, 0xef5825a4L, "EF5825A4", "%.6X",
-__LINE__, 0x01b0185aL, "0x1b0185a", "% #x",
-__LINE__, -0x0004290L, "-17040", "%.3d",
-__LINE__, -0x10f88659L, "-284722777", "%+6.2ld",
-__LINE__, 0x00003216L, "12822", "%-d",
-__LINE__, 0x4a31a219L, "1244766745", "%d",
-__LINE__, 0xffffffb5L, "FFFFFFB5", "%-X",
-__LINE__, 0x0000d586L, "D586", "%-2.X",
-__LINE__, 0x00008496L, "33942", "%1.d",
-__LINE__, -0x0000011L, "-17", "%1ld",
-__LINE__, 0x0000003cL, "3C", "%2.X",
-__LINE__, 0xfffffffeL, "FFFFFFFE", "%.3X",
-__LINE__, 0x0000152aL, "152A", "%X",
-__LINE__, 0xfffe876eL, "FFFE876E", "%X",
-__LINE__, -0x0003874L, "-14452", "%-ld",
-__LINE__, -0x004918aL, "-299402", "%#.6d",
-__LINE__, -0x000000cL, "-12", "%-d",
-__LINE__, 0xffffd812L, "FFFFD812", "%+X",
-__LINE__, -0x000000cL, "-12", "%0d",
-__LINE__, -0x0000229L, "-553", "%0d",
-__LINE__, 0x00002ab8L, "2AB8", "%4.X",
-__LINE__, 0x0000004bL, "+75", "%+ld",
-__LINE__, 0x001c3178L, " 1847672", "% ld",
-__LINE__, -0x0000006L, "-6", "%.0ld",
-__LINE__, 0x0003be65L, "245349", "%ld",
-__LINE__, -0x0000001L, "-1", "%#1ld",
-__LINE__, 0x0000007fL, "+127", "%+ld",
-__LINE__, 0x0000020eL, "526 ", "%-5ld",
-__LINE__, 0x00000002L, "2", "%d",
-__LINE__, 0x03bd0873L, "0X3BD0873", "%#X",
-__LINE__, 0x00093a52L, "604754", "%-2d",
-__LINE__, -0x00823fcL, "-0533500", "%+.7ld",
-__LINE__, 0x00000000L, " ", "%4.X",
-__LINE__, -0x0000001L, "-1", "%ld",
-__LINE__, 0xfff09edeL, "fff09ede", "%-x",
-__LINE__, 0x01e28c24L, "31624228", "%ld",
-__LINE__, 0x00001dccL, "1DCC", "%X",
-__LINE__, -0x0f0ea0dL, "-15788557", "%-00.ld",
-__LINE__, 0xffff73a1L, "FFFF73A1", "%X",
-__LINE__, -0x0004040L, "-16448", "%+#d",
-__LINE__, 0x0073b158L, "0x73b158", "%#7x",
-__LINE__, 0xfffff8ffL, "FFFFF8FF", "% 5X",
-__LINE__, -0x0000004L, "-4", "%0d",
-__LINE__, 0xffff56a3L, "ffff56a3", "%1.6x",
-__LINE__, -0x0000041L, "-65", "%0d",
-__LINE__, 0x00000009L, "+0000009", "%+2.7d",
-__LINE__, 0xffffe13dL, "0XFFFFE13D", "%+#2.X",
-__LINE__, -0x00002ceL, "-00718", "%.5ld",
-__LINE__, 0xffc53e28L, "ffc53e28", "%03.4x",
-__LINE__, 0x00000005L, "0X5", "%#X",
-__LINE__, 0x00000004L, "4", "%x",
-__LINE__, 0xe21b35ebL, "e21b35eb", "%-x",
-__LINE__, -0x0000098L, "-152", "%-ld",
-__LINE__, 0xffffff81L, "FFFFFF81", "%2X",
-__LINE__, 0x00000003L, "00003", "%.5ld",
-__LINE__, 0xfffffffcL, "fffffffc", "%+x",
-__LINE__, 0x000491f5L, "299509", "%1.ld",
-__LINE__, 0xf06bfd7dL, "F06BFD7D", "%X",
-__LINE__, -0x0000006L, "-6", "%0d",
-__LINE__, -0x0a4af7dL, "-10792829", "%-0d",
-__LINE__, -0x11a74efL, "-18511087", "%ld",
-__LINE__, 0x2dc95e17L, "768171543", "%-1.d",
-__LINE__, -0x0000001L, "-1", "%#ld",
-__LINE__, 0x00000033L, "51", "%-#d",
-__LINE__, 0x002d0219L, "2949657", "%ld",
-__LINE__, 0xfffffffdL, "FFFFFFFD", "%2.4X",
-__LINE__, 0x00000f20L, "+3872", "%+ld",
-__LINE__, -0x0000047L, "-071", "%4.3ld",
-__LINE__, 0x00000010L, " 16", "%6d",
-__LINE__, 0x00000000L, "0", "%0d",
-__LINE__, 0xffffff57L, "FFFFFF57", "%X",
-__LINE__, -0x0000700L, "-1792", "%-#d",
-__LINE__, -0x0000064L, "-100", "%-ld",
-__LINE__, 0xff26d49aL, "FF26D49A", "%-0X",
-__LINE__, -0x0000006L, "-6", "%.1ld",
-__LINE__, 0x1391edc5L, "1391edc5", "%.1x",
-__LINE__, 0x0000014aL, "330", "%-#ld",
-__LINE__, 0x07ecd1e1L, "7ecd1e1", "%6x",
-__LINE__, -0xa2b8898L, "-170625176", "%3.d",
-__LINE__, 0x00035287L, "0x35287", "%#.0x",
-__LINE__, 0x00000000L, "00000", "%0.5X",
-__LINE__, -0x0000153L, "-339", "%d",
-__LINE__, 0x0000ad6eL, " 44398", "% 0.d",
-__LINE__, 0x00000001L, "1", "%-X",
-__LINE__, -0x000000dL, "-13 ", "%-6.2d",
-__LINE__, -0x01bff8aL, "-1834890", "%d",
-__LINE__, 0x000a0fa8L, "+659368", "%+ld",
-__LINE__, 0xac044dc0L, "ac044dc0", "%.0x",
-__LINE__, 0x0003a729L, "239401", "%ld",
-__LINE__, -0x00004f0L, "-1264", "%+ld",
-__LINE__, 0x00000000L, "0", "%x",
-__LINE__, 0x00000012L, "12", "% x",
-__LINE__, 0xffff770bL, "ffff770b", "%7.1x",
-__LINE__, 0xd7458572L, "d7458572", "%x",
-__LINE__, 0x01f1b4f9L, "1f1b4f9", "% 0x",
-__LINE__, 0xfffb2198L, "0XFFFB2198", "% #1.X",
-__LINE__, 0x00ef6189L, " 15688073", "% ld",
-__LINE__, -0x3f0ae63L, "-66104931", "% #d",
-__LINE__, -0x0006075L, "-24693", "%ld",
-__LINE__, 0x000000a1L, "161", "%d",
-__LINE__, 0xfffffffcL, "fffffffc", "%3.2x",
-__LINE__, 0xff6b4125L, "FF6B4125", "%+5.X",
-__LINE__, 0x00000001L, " 1", "%6.d",
-__LINE__, -0x0000001L, "-1", "%+0d",
-__LINE__, -0x000096cL, "-2412", "%0.4d",
-__LINE__, 0x00039c6fL, "236655", "%.0d",
-__LINE__, 0x3625286cL, "908404844", "%.1d",
-__LINE__, 0xfffffffaL, "fffffffa", "%x",
-__LINE__, 0x00000000L, "0", "%X",
-__LINE__, 0x00c34353L, "12796755", "%#.4d",
-__LINE__, 0x000002dfL, "735", "%ld",
-__LINE__, 0xffff38faL, "FFFF38FA", "%5.1X",
-__LINE__, -0x000002aL, "-42", "%0.d",
-__LINE__, 0x0000077eL, "1918", "%ld",
-__LINE__, 0x000001f7L, "503", "%ld",
-__LINE__, 0x00000004L, "4", "%ld",
-__LINE__, 0x0021fb02L, "2226946", "%d",
-__LINE__, 0x007c858dL, "8160653", "%-0d",
-__LINE__, -0x0000109L, "-265", "%.0d",
-__LINE__, 0xfffffffaL, "fffffffa", "% x",
-__LINE__, 0x0097932dL, "97932d", "%+x",
-__LINE__, 0xfffbbd03L, "fffbbd03", "%-.5x",
-__LINE__, -0x0000005L, "-5", "%0d",
-__LINE__, 0x03ee3a95L, "65944213", "%ld",
-__LINE__, -0x0000002L, " -00002", "%7.5d",
-__LINE__, 0xea1a4e54L, "EA1A4E54", "%X",
-__LINE__, -0x000a9d6L, "-43478", "%+d",
-__LINE__, -0x0fd8d65L, "-16616805", "%5ld",
-__LINE__, 0x00000001L, "1", "%-d",
-__LINE__, 0x00000072L, "72", "%2.X",
-__LINE__, 0xffffff94L, "FFFFFF94", "%X",
-__LINE__, 0x00000d2aL, "D2A", "%+X",
-__LINE__, 0xffff614fL, "ffff614f", "%x",
-__LINE__, -0x0000018L, "-24", "%ld",
-__LINE__, 0x0000003bL, "059", "%2.3d",
-__LINE__, 0x0000001aL, "1A", "%0X",
-__LINE__, -0x0000109L, "-265", "%02ld",
-__LINE__, 0x00000f9dL, "3997", "%#1d",
-__LINE__, 0x0000001bL, "1b", "%x",
-__LINE__, 0xffffff07L, "ffffff07", "%x",
-__LINE__, 0xfff1a425L, "0xfff1a425", "%#x",
-__LINE__, 0x00000005L, "5", "%-1d",
-__LINE__, -0x53a6efdL, "-87715581", "%ld",
-__LINE__, 0x042f37dbL, "42F37DB", "%6.X",
-__LINE__, 0x00053bd5L, "+342997", "%+5ld",
-__LINE__, 0xffffffffL, "ffffffff", "% x",
-__LINE__, 0xffffffefL, "FFFFFFEF", "%6.X",
-__LINE__, -0x10ec29aL, "-17744538", "%+2.d",
-__LINE__, 0x01dcc901L, "1dcc901", "%x",
-__LINE__, 0x0007dc68L, "515176", "%-3.d",
-__LINE__, -0x0000062L, "-0098", "%#2.4d",
-__LINE__, 0x00000000L, " ", "%3.0X",
-__LINE__, -0x00000deL, "-222", "%ld",
-__LINE__, 0x000c1fb8L, "C1FB8", "%0X",
-__LINE__, 0x0005bf58L, "5BF58", "%X",
-__LINE__, -0x000dd1bL, "-56603", "%-03.1d",
-__LINE__, 0x00000b14L, "B14", "%+3.X",
-__LINE__, 0x00000799L, "799", "%-x",
-__LINE__, 0xfffffffaL, "fffffffa", "%x",
-__LINE__, 0x00000003L, "0x00003", "% #7.5x",
-__LINE__, -0x002b9f1L, "-178673", "%+d",
-__LINE__, -0x001b817L, "-112663", "%0d",
-__LINE__, 0xf6f98533L, "f6f98533", "%.1x",
-__LINE__, 0x00338ffcL, "3379196", "%d",
-__LINE__, 0x0409e9b5L, "0X409E9B5", "%#X",
-__LINE__, 0x00b8e98eL, " 12118414", "% 0d",
-__LINE__, -0x002a8f6L, "-174326", "%ld",
-__LINE__, 0x13bb9722L, "331061026", "%0d",
-__LINE__, 0x00063c71L, "63c71", "%x",
-__LINE__, 0xfffffe37L, "FFFFFE37", "%.1X",
-__LINE__, 0xffff7b3eL, "ffff7b3e", "%+.1x",
-__LINE__, 0x005eeab1L, "5eeab1", "%+x",
-__LINE__, 0xffc69e99L, "ffc69e99", "%x",
-__LINE__, -0x000005cL, " -92", "%5ld",
-__LINE__, 0x07d8fa8aL, "7d8fa8a", "%x",
-__LINE__, 0x00030e0aL, "200202", "%-4.1d",
-__LINE__, 0x00001dc1L, "1DC1", "%.0X",
-__LINE__, 0x00000008L, "8", "%0ld",
-__LINE__, -0x01b5397L, "-1790871", "%3.d",
-__LINE__, 0x27fbb4b5L, "27fbb4b5", "%x",
-__LINE__, -0xe3fdcfcL, "-239066364", "%4ld",
-__LINE__, 0x0008bcb1L, "8bcb1", "%0x",
-__LINE__, 0xffff039eL, "ffff039e", "%.6x",
-__LINE__, 0x000d0bd4L, "d0bd4", "%-x",
-__LINE__, 0x00000000L, "+0", "%+d",
-__LINE__, -0x2a49ea4L, "-44342948", "%1d",
-__LINE__, -0x0000055L, "-85", "%0d",
-__LINE__, -0x0000a05L, "-2565", "%3.3ld",
-__LINE__, -0x000000bL, "-11 ", "%-4d",
-__LINE__, 0xfff30444L, "FFF30444", "%7.X",
-__LINE__, 0x0000003fL, "63", "%-0d",
-__LINE__, 0x00046779L, "46779", "%X",
-__LINE__, 0x000028d7L, " 0X28D7", "%#7.X",
-__LINE__, 0x00000019L, " 19", "%5x",
-__LINE__, 0x0032291dL, "3287325", "%2.ld",
-__LINE__, 0x00057afaL, "57AFA", "%X",
-__LINE__, 0xfffe8c64L, "fffe8c64", "%3.4x",
-__LINE__, -0x624110d6L, "-1648431318", "%+6d",
-__LINE__, 0x0000001aL, " 26", "% 5.d",
-__LINE__, 0xfffffffdL, "FFFFFFFD", "%6.X",
-__LINE__, 0x00199490L, "1676432", "%-1d",
-__LINE__, -0xfff8265L, "-268403301", "%-0ld",
-__LINE__, 0x0000000eL, "e", "%-x",
-__LINE__, 0x00c38aecL, "c38aec", "%x",
-__LINE__, -0x00658f4L, "-415988", "%#ld",
-__LINE__, 0x0066ac4eL, "6728782", "%0d",
-__LINE__, 0xc4a808d5L, "c4a808d5", "%x",
-__LINE__, 0x00000000L, " 0", "%6.1x",
-__LINE__, 0x00066d24L, "66d24", "%x",
-__LINE__, 0x00002117L, "2117", "%X",
-__LINE__, 0xfe06fdf4L, "FE06FDF4", "%0X",
-__LINE__, 0xfffffff9L, "fffffff9", "%x",
-__LINE__, 0x1c6bb795L, "+476821397", "%+d",
-__LINE__, 0xfffffba4L, "FFFFFBA4", "%X",
-__LINE__, 0xfffd7d44L, "fffd7d44", "%0x",
-__LINE__, 0x0019dd17L, "1694999", "%d",
-__LINE__, 0x6475851eL, "0x6475851e", "% #7.x",
-__LINE__, -0x00330d5L, "-209109", "%0ld",
-__LINE__, 0x009f53f7L, "09F53F7", "%+6.7X",
-__LINE__, -0x00172f9L, " -94969", "%7.5ld",
-__LINE__, 0xffffffdcL, "FFFFFFDC", "%X",
-__LINE__, -0x013bdecL, "-1293804", "%+#2ld",
-__LINE__, 0xfff845c0L, "fff845c0", "%+7.x",
-__LINE__, -0x0fbe712L, "-16508690", "%.7d",
-__LINE__, 0xffffe13fL, "ffffe13f", "%x",
-__LINE__, 0xbbc19951L, "BBC19951", "%-4X",
-__LINE__, -0x28d6d1bL, "-42822939", "%#d",
-__LINE__, -0x93cda6bL, "-154983019", "%-d",
-__LINE__, 0xffc93342L, "FFC93342", "%7.X",
-__LINE__, 0x072ac8b3L, " 120244403", "% ld",
-__LINE__, 0xfff8d17bL, "FFF8D17B", "% X",
-__LINE__, 0x00000da5L, "DA5", "%0.X",
-__LINE__, 0x055ad3acL, "0x55ad3ac", "%#1x",
-__LINE__, 0x00000e5aL, " 3674", "% .4ld",
-__LINE__, 0xffffff79L, "FFFFFF79", "%+X",
-__LINE__, 0xffffe167L, "ffffe167", "%+5x",
-__LINE__, 0x0000fa50L, "0064080", "%.7ld",
-__LINE__, 0x00000001L, "1", "%-d",
-__LINE__, 0xfffffffeL, "fffffffe", "%x",
-__LINE__, 0x000009acL, " 2476", "% #2.ld",
-__LINE__, 0x00000e78L, "0003704", "%.7ld",
-__LINE__, -0x000dfc3L, "-57283", "%6.d",
-__LINE__, 0x00000ee0L, "EE0", "%0X",
-__LINE__, -0x293703b3L, "-691471283", "%ld",
-__LINE__, 0x000073e8L, " 73e8", "%6x",
-__LINE__, 0xffffdffdL, "ffffdffd", "%5.5x",
-__LINE__, 0x00000004L, "4", "%+00.x",
-__LINE__, 0x00000008L, "0X8", "%#X",
-__LINE__, 0x0003044cL, "3044c", "%0x",
-__LINE__, 0xffc2095eL, "FFC2095E", "%0X",
-__LINE__, 0x00000aacL, "0002732", "%-.7ld",
-__LINE__, 0xffffff79L, "FFFFFF79", "%+1.X",
-__LINE__, 0x53a0f94aL, " 1403058506", "% 2.4ld",
-__LINE__, 0x000e928dL, "e928d", "%x",
-__LINE__, 0x0024127aL, "2364026", "%5.d",
-__LINE__, 0x000f7c1cL, " 1014812", "% 2.d",
-__LINE__, -0x000003dL, "-61 ", "%-#4ld",
-__LINE__, -0x0000122L, "-290", "%+ld",
-__LINE__, 0x00000006L, "+6", "%+0d",
-__LINE__, 0x00000129L, " 000129", "%7.6X",
-__LINE__, 0x15d873e5L, " 366506981", "% 5.7d",
-__LINE__, 0x00000001L, "1", "%d",
-__LINE__, 0x038d6110L, "+59597072", "%+d",
-__LINE__, 0x0f46ccc3L, "256298179", "%-1.4d",
-__LINE__, 0xfe434d21L, "fe434d21", "%x",
-__LINE__, -0x179797d7L, "-395810775", "%d",
-__LINE__, 0xe35807bfL, "e35807bf", "%x",
-__LINE__, 0x00000003L, " +3", "%+7d",
-__LINE__, 0x017e699eL, "25061790", "%#ld",
-__LINE__, -0x0000029L, "-41", "%d",
-__LINE__, 0xffffff11L, "ffffff11", "%1.x",
-__LINE__, -0x0001bf6L, "-7158", "%+0ld",
-__LINE__, 0xffffff4bL, "FFFFFF4B", "%4X",
-__LINE__, -0x0000040L, "-64", "%ld",
-__LINE__, 0x000034d6L, "+13526", "%+ld",
-__LINE__, 0xffffffa7L, "ffffffa7", "%x",
-__LINE__, 0xfffffe8eL, "fffffe8e", "%+.3x",
-__LINE__, 0x00000000L, "0", "%0.1d",
-__LINE__, -0x007cdf1L, "-511473", "%ld",
-__LINE__, 0xfffffeefL, "FFFFFEEF", "%-X",
-__LINE__, 0x00002d91L, "2d91", "%x",
-__LINE__, -0x000025bL, "-603", "%#ld",
-__LINE__, -0x000001bL, "-27", "%-ld",
-__LINE__, 0x042b6752L, "42B6752", "%+X",
-__LINE__, -0x75afb0a6L, "-1974448294", "% ld",
-__LINE__, -0x0000001L, "-1", "%ld",
-__LINE__, 0x00000542L, " 1346", "%6d",
-__LINE__, -0x0000010L, "-16", "%+0d",
-__LINE__, 0xfffed8f7L, "FFFED8F7", "%5.X",
-__LINE__, 0x0541852eL, "541852e", "% 2.x",
-__LINE__, 0xff22aec3L, "ff22aec3", "% .1x",
-__LINE__, 0x5e34b745L, "1580513093", "%ld",
-__LINE__, 0xfffffff3L, "fffffff3", "%x",
-__LINE__, 0x0eda7b86L, "+249199494", "%+.3d",
-__LINE__, 0xffffe40fL, "ffffe40f", "%+x",
-__LINE__, -0x0003484L, "-13444", "%-1.5ld",
-__LINE__, 0x0000334bL, " 13131", "%6.ld",
-__LINE__, -0x0000149L, "-329", "%ld",
-__LINE__, 0x00000001L, " 001", "% 5.3x",
-__LINE__, 0xffeaa035L, "ffeaa035", "%+3.5x",
-__LINE__, 0x00211dffL, "2170367", "%ld",
-__LINE__, 0x007e91f4L, "7e91f4", "%x",
-__LINE__, 0xfffffffcL, "0xfffffffc", "%+#5x",
-__LINE__, 0xfffffffcL, "FFFFFFFC", "%6.X",
-__LINE__, 0x0156a9b5L, "156a9b5", "%x",
-__LINE__, 0xfffffe58L, "fffffe58", "%+x",
-__LINE__, 0xffff8c66L, "FFFF8C66", "%.0X",
-__LINE__, 0x00000000L, "0", "%d",
-__LINE__, 0x00000005L, " 5", "%7.d",
-__LINE__, -0x0000002L, "-2", "%ld",
-__LINE__, 0x000076b9L, " 30393", "% ld",
-__LINE__, 0x00003824L, "3824", "%4X",
-__LINE__, 0x00000cdfL, " CDF", "% 7X",
-__LINE__, 0x017c9e8fL, "17C9E8F", "%-X",
-__LINE__, -0x20f582dL, "-34560045", "%-.5d",
-__LINE__, 0x0000732eL, " 29486", "% 7.ld",
-__LINE__, 0xffffffffL, "FFFFFFFF", "%+0X",
-__LINE__, 0xf379a4a2L, "F379A4A2", "% .7X",
-__LINE__, -0x0000028L, "-40", "%-d",
-__LINE__, 0xe73cf79eL, "e73cf79e", "%x",
-__LINE__, 0x00000002L, " 2", "%7ld",
-__LINE__, -0x00029b1L, "-10673", "%-#1.ld",
-__LINE__, -0x0002a58L, "-10840", "%3.d",
-__LINE__, 0x00000002L, "2", "%-X",
-__LINE__, 0xfffffffcL, "FFFFFFFC", "%X",
-__LINE__, -0x000003aL, " -58", "%5ld",
-__LINE__, 0x0245ef3bL, "245ef3b", "%.3x",
-__LINE__, 0x00026ccaL, "158922", "%-06.3ld",
-__LINE__, 0x01016fd3L, "16871379", "%-d",
-__LINE__, 0x000016fcL, "5884", "%0ld",
-__LINE__, -0x00007fbL, " -2043", "%7.3d",
-__LINE__, 0xfff73d3cL, "fff73d3c", "%0x",
-__LINE__, -0x0000110L, "-272", "% 04.3d",
-__LINE__, 0x0000000eL, " 014", "% 04ld",
-__LINE__, -0x0000039L, "-57", "%.0ld",
-__LINE__, 0x00000c95L, "c95", "%0x",
-__LINE__, 0xffff3b2eL, "ffff3b2e", "%x",
-__LINE__, 0xfffffffeL, "FFFFFFFE", "%X",
-__LINE__, 0x00000015L, "21", "%.1d",
-__LINE__, 0x0000000cL, "+12", "%+ld",
-__LINE__, 0x00000000L, "0", "%+X",
-__LINE__, 0xfffc9a14L, "fffc9a14", "%-.5x",
-__LINE__, 0x0000003cL, "60", "%.2ld",
-__LINE__, -0x0000023L, " -35", "%6.d",
-__LINE__, 0x00000740L, "1856", "%ld",
-__LINE__, 0x00000160L, "160", "% 3.X",
-__LINE__, 0x00000006L, " 6", "%5.X",
-__LINE__, -0x0000677L, "-1655", "%.3ld",
-__LINE__, 0x12709c7eL, "12709C7E", "%.7X",
-__LINE__, 0x0000090fL, "+2319", "%+#d",
-__LINE__, 0xffffffe0L, "0xffffffe0", "%#4.1x",
-__LINE__, 0x00132ce0L, "1256672", "%ld",
-__LINE__, 0x00000059L, "59", "%+X",
-__LINE__, -0x0000017L, "-23", "%0d",
-__LINE__, -0x01fade6L, "-2076134", "%-4.3ld",
-__LINE__, 0x000df3faL, "914426", "%.5ld",
-__LINE__, 0xfffffd0fL, "fffffd0f", "%7x",
-__LINE__, -0x000c212L, "-49682", "%0.1ld",
-__LINE__, 0xffff8bcbL, "FFFF8BCB", "%.3X",
-__LINE__, 0x0000000aL, "a", "% x",
-__LINE__, 0x00000021L, "21", "%x",
-__LINE__, -0x0000040L, "-64", "% 1ld",
-__LINE__, 0x00000009L, " 9", "%6.ld",
-__LINE__, -0x0000d67L, "-3431", "% 5.3d",
-__LINE__, 0x03a85f1bL, "61366043", "%ld",
-__LINE__, 0x00000035L, "000053", "%0.6d",
-__LINE__, 0xfffda5cbL, "fffda5cb", "%+x",
-__LINE__, 0xffffff78L, "FFFFFF78", "%-7.0X",
-__LINE__, 0xfffffd6dL, "fffffd6d", "%7.x",
-__LINE__, 0xfffffc08L, "fffffc08", "%7.3x",
-__LINE__, 0x00003335L, " 13109", "% #d",
-__LINE__, -0x0000002L, " -2", "%5.d",
-__LINE__, -0x13767a48L, "-326531656", "%+ld",
-__LINE__, 0x00000be5L, "3045", "%4.0ld",
-__LINE__, 0xfffdb28cL, "FFFDB28C", "%X",
-__LINE__, 0x00127118L, "1208600", "%ld",
-__LINE__, 0x00000086L, " 134", "% ld",
-__LINE__, 0x0002214cL, "2214c", "%+x",
-__LINE__, 0x0000a0c2L, " a0c2", "%5.0x",
-__LINE__, -0x000007cL, "-124", "%ld",
-__LINE__, 0x0000012aL, "00298", "%3.5d",
-__LINE__, 0xfd4f1257L, "FD4F1257", "%+2.X",
-__LINE__, 0xffffd8aaL, "ffffd8aa", "%5x",
-__LINE__, -0x00000a7L, "-167", "%+ld",
-__LINE__, -0x0009c69L, "-40041", "%0.0ld",
-__LINE__, 0x02230418L, "35849240", "%-0.6ld",
-__LINE__, 0x00000000L, " 0", "%6x",
-__LINE__, 0xfffff184L, "fffff184", "%02.5x",
-__LINE__, -0x0ae967bL, "-11441787", "%d",
-__LINE__, 0x0015de3aL, "1433146", "%-5.3d",
-__LINE__, -0x0071e93L, "-466579", "%1.ld",
-__LINE__, 0xfffff8bdL, "fffff8bd", "%+x",
-__LINE__, -0x00000e4L, "-228", "%+ld",
-__LINE__, 0x000001d8L, " 472", "% .3ld",
-__LINE__, 0x00315faaL, "315faa", "%-0x",
-__LINE__, 0x00000e59L, "e59", "%0x",
-__LINE__, -0x0000005L, "-5", "%ld",
-__LINE__, 0x000018ecL, "6380", "%ld",
-__LINE__, 0xfffffff9L, "fffffff9", "%5.2x",
-__LINE__, -0xe7cfd39L, "-243072313", "%-d",
-__LINE__, 0x0002c30bL, "2C30B", "%1.2X",
-__LINE__, 0x0000007aL, "7A", "%X",
-__LINE__, 0xf604ecb2L, "F604ECB2", "%2X",
-__LINE__, -0x05f602cL, "-6250540", "%d",
-__LINE__, 0xffff9c86L, "ffff9c86", "%2.x",
-__LINE__, -0x00d7f55L, "-884565", "%#d",
-__LINE__, 0xd2a37824L, "D2A37824", "%4X",
-__LINE__, 0x00000000L, "", "%-.0x",
-__LINE__, 0x000d4b51L, "0d4b51", "%3.6x",
-__LINE__, 0x000ecd97L, "ecd97", "% x",
-__LINE__, -0x0000018L, "-024", "%+04ld",
-__LINE__, -0x009f292L, "-651922", "%ld",
-__LINE__, -0x0002da9L, "-11689", "%-0ld",
-__LINE__, -0x000a218L, "-41496", "%4.5d",
-__LINE__, 0xffff85acL, "FFFF85AC", "% 04.X",
-__LINE__, -0x0d9ffbeL, "-14286782", "%0d",
-__LINE__, 0xfb18cc8eL, "fb18cc8e", "%x",
-__LINE__, 0xffffe5d3L, "FFFFE5D3", "%-X",
-__LINE__, 0x00000000L, "0", "%x",
-__LINE__, -0x0000006L, "-6", "% d",
-__LINE__, 0x0002fc62L, "2fc62", "% 03.x",
-__LINE__, 0x00000000L, "00", "%.2d",
-__LINE__, -0x00000fdL, " -253", "%6ld",
-__LINE__, -0x000000bL, "-11", "%d",
-__LINE__, -0x00042a3L, "-17059", "% 6d",
-__LINE__, 0x00000002L, "2", "% X",
-__LINE__, -0x61ead93eL, "-1642780990", "%-0d",
-__LINE__, 0xf2e61f6dL, "f2e61f6d", "%-.4x",
-__LINE__, 0xffd31b93L, "ffd31b93", "%x",
-__LINE__, -0x0000008L, "-8", "%ld",
-__LINE__, 0xffffffffL, "ffffffff", "%00x",
-__LINE__, 0x000000fbL, "+000251", "%+2.6d",
-__LINE__, 0x00000015L, " 15", "%4.X",
-__LINE__, 0x06ec6d96L, "6EC6D96", "%+2.X",
-__LINE__, 0xffff1df7L, "0xffff1df7", "% #1x",
-__LINE__, -0x000004bL, "-75", "%-ld",
-__LINE__, 0x00000008L, "8", "%#.0d",
-__LINE__, 0x00001355L, "4949", "%3.4ld",
-__LINE__, -0x00000f7L, "-247", "%d",
-__LINE__, 0x0000001fL, "31", "%.2ld",
-__LINE__, 0x0000d556L, "D556", "%-X",
-__LINE__, 0xffffd5a5L, "ffffd5a5", "% x",
-__LINE__, -0x0000e34L, "-3636", "%#d",
-__LINE__, -0x0000007L, "-7", "%d",
-__LINE__, 0x01ba10a4L, "1ba10a4", "%x",
-__LINE__, 0xfffff759L, "FFFFF759", "% X",
-__LINE__, -0x80d0adbL, "-135072475", "%d",
-__LINE__, 0x0002bf61L, "2bf61", "%x",
-__LINE__, 0xffff008bL, "FFFF008B", "%-7X",
-__LINE__, 0x00000e72L, "E72", "%X",
-__LINE__, -0x00000eaL, "-234", "%0ld",
-__LINE__, -0x0007b9dL, "-0031645", "%0.7ld",
-__LINE__, 0x0001baaaL, "0X1BAAA", "%#4X",
-__LINE__, 0x0000a57fL, " a57f", "%6.x",
-__LINE__, -0x21a73726L, "-564606758", "%ld",
-__LINE__, 0x06f45c9fL, "0x6f45c9f", "%#.3x",
-__LINE__, 0x00018e5dL, "101981", "%-d",
-__LINE__, 0x0001e69aL, "124570", "%-d",
-__LINE__, -0x0000d26L, " -3366", "% 07.d",
-__LINE__, 0x00000000L, "+", "%+0.ld",
-__LINE__, 0x00003916L, "14614", "%ld",
-__LINE__, 0xfffffd8fL, "fffffd8f", "%-3.x",
-__LINE__, 0x00000011L, "11", "%x",
-__LINE__, 0x000000e7L, "E7", "%X",
-__LINE__, 0xfdf9d89bL, "FDF9D89B", "%X",
-__LINE__, 0x00000a7cL, "a7c", "%x",
-__LINE__, 0x0000003fL, "00003F", "%.6X",
-__LINE__, 0xffffe729L, "FFFFE729", "%X",
-__LINE__, 0xfffffffeL, "fffffffe", "% .6x",
-__LINE__, -0x0000a4bL, "-2635", "%+d",
-__LINE__, 0xffffff50L, "ffffff50", "%0.7x",
-__LINE__, 0xfaf57e8bL, "faf57e8b", "% 4.x",
-__LINE__, -0x0000056L, "-86", "%ld",
-__LINE__, 0x08ed2a4dL, "8ed2a4d", "%4x",
-__LINE__, 0xff8d9081L, "FF8D9081", "%+0.X",
-__LINE__, 0x002730a1L, "2568353", "%4d",
-__LINE__, 0xffff9564L, "ffff9564", "%x",
-__LINE__, -0x0000006L, " -6", "%4ld",
-__LINE__, -0x19890310L, "-428409616", "%0ld",
-__LINE__, 0xd2ce636cL, "d2ce636c", "%+x",
-__LINE__, -0x00001feL, "-510", "%d",
-__LINE__, 0x00000006L, "0000006", "%+0.7x",
-__LINE__, 0xffffffc2L, "0XFFFFFFC2", "%-#.5X",
-__LINE__, -0x00000fdL, "-253", "%+d",
-__LINE__, 0x000216aaL, "0x216aa", "%#x",
-__LINE__, 0xffe36c66L, "ffe36c66", "%x",
-__LINE__, 0x00000002L, "2", "%x",
-__LINE__, -0x0000025L, "-37", "% d",
-__LINE__, 0x0000007eL, "126", "%d",
-__LINE__, 0x0003c1f9L, "+246265", "%+ld",
-__LINE__, 0x00000001L, "1", "%ld",
-__LINE__, -0x0000001L, "-1", "%ld",
-__LINE__, -0x00539e7L, "-342503", "%06.ld",
-__LINE__, 0x00000d42L, " 3394", "%#6.ld",
-__LINE__, 0xf73b7c4eL, "F73B7C4E", "%X",
-__LINE__, 0x00000022L, "22", "%.1x",
-__LINE__, 0xffffa883L, "FFFFA883", "%X",
-__LINE__, 0x016ec247L, "16ec247", "%x",
-__LINE__, 0x00000019L, "19", "%+X",
-__LINE__, 0x0000665aL, "665A", "% 2.X",
-__LINE__, 0xfffffffcL, "FFFFFFFC", "%-5.X",
-__LINE__, 0x008e3fbcL, "8E3FBC", "%X",
-__LINE__, 0xfffffffaL, "FFFFFFFA", "%X",
-__LINE__, 0x1b806597L, "461399447", "%.2d",
-__LINE__, 0x00000366L, "0000870", "%#1.7ld",
-__LINE__, 0x0001d92eL, "1d92e", "%x",
-__LINE__, 0x000104ceL, "104CE", "%-X",
-__LINE__, 0xfffffe4cL, "fffffe4c", "%x",
-__LINE__, 0x000000e9L, "E9", "%X",
-__LINE__, 0x000a855cL, " 689500", "% d",
-__LINE__, 0x00000075L, "75", "% X",
-__LINE__, -0x0000026L, "-38", "%ld",
-__LINE__, 0xfffff169L, "fffff169", "%-04.2x",
-__LINE__, 0xffffff6fL, "ffffff6f", "%x",
-__LINE__, 0x00000003L, "0x3", "%#x",
-__LINE__, 0x00623babL, "6437803", "%.0d",
-__LINE__, -0x2260224cL, "-576725580", "%ld",
-__LINE__, 0xe7e7a998L, "E7E7A998", "%.1X",
-__LINE__, 0x00000005L, "5", "%X",
-__LINE__, 0x0000b560L, "0xb560", "%#x",
-__LINE__, 0xfe11854dL, "fe11854d", "%-.5x",
-__LINE__, 0x00190014L, "1638420", "%ld",
-__LINE__, 0x0001d22aL, "0X1D22A", "%-#X",
-__LINE__, 0x00000c16L, "c16", "%2x",
-__LINE__, 0x00000d1aL, "3354", "%#d",
-__LINE__, 0x000165f6L, "91638", "%d",
-__LINE__, 0xfffff557L, "0XFFFFF557", "%#X",
-__LINE__, 0x00000588L, " 588", "%07.X",
-__LINE__, 0xf4a72708L, "f4a72708", "%x",
-__LINE__, 0xfff1cba9L, "0xfff1cba9", "% #2.5x",
-__LINE__, 0x000333a4L, "209828", "%d",
-__LINE__, 0x0000179bL, "179B", "% 2.X",
-__LINE__, 0x00000460L, "1120", "%0ld",
-__LINE__, 0xffffff89L, "FFFFFF89", "%X",
-__LINE__, -0x0000012L, "-18", "%ld",
-__LINE__, 0x00004fe0L, "20448", "%0.d",
-__LINE__, 0x00532e77L, "532e77", "%00.x",
-__LINE__, 0xf7b92efeL, "f7b92efe", "%0x",
-__LINE__, -0x0000243L, "-579", "%+1.d",
-__LINE__, 0x34894bb7L, "+881413047", "%+d",
-__LINE__, 0xfffaa189L, "FFFAA189", "% 6X",
-__LINE__, -0x0000579L, "-1401", "%+ld",
-__LINE__, 0x005acb12L, "5acb12", "%5.0x",
-__LINE__, 0xffff890aL, "FFFF890A", "%X",
-__LINE__, 0x010dff2fL, "10DFF2F", "%.7X",
-__LINE__, 0x00005a7fL, "23167", "%#ld",
-__LINE__, 0x000005e3L, "1507", "%#3d",
-__LINE__, -0xa815bcbL, "-176249803", "%d",
-__LINE__, 0xffffffffL, "ffffffff", "%+x",
-__LINE__, 0xfffe0ff7L, "fffe0ff7", "%3x",
-__LINE__, 0xffffffffL, "0XFFFFFFFF", "%#2.1X",
-__LINE__, -0x1cc5ea52L, "-482732626", "%6.d",
-__LINE__, 0x000425edL, "+0271853", "%+.7d",
-__LINE__, 0x00000001L, "1", "%+x",
-__LINE__, -0x48f2a72L, "-76491378", "%7.0d",
-__LINE__, 0xfffffff7L, "FFFFFFF7", "% 0X",
-__LINE__, 0xfd8ffc0aL, "fd8ffc0a", "%.1x",
-__LINE__, 0x0001f56dL, " 1F56D", "%+7.2X",
-__LINE__, 0x000000dbL, " DB", "%6.X",
-__LINE__, 0xffffffc2L, "ffffffc2", "%x",
-__LINE__, 0x00000001L, "001", "%03ld",
-__LINE__, 0xffd89f58L, "ffd89f58", "% 0.x",
-__LINE__, 0xfe1a72fcL, "fe1a72fc", "%x",
-__LINE__, 0xfffff9b6L, "FFFFF9B6", "%X",
-__LINE__, 0x00243633L, "243633", "%X",
-__LINE__, 0x00821bc7L, "+8526791", "%+#0ld",
-__LINE__, 0xfe63f348L, "0XFE63F348", "%#3X",
-__LINE__, 0xff729f19L, "ff729f19", "%4x",
-__LINE__, 0xffff570fL, "FFFF570F", "%+X",
-__LINE__, 0x00a57a42L, "10844738", "%6.3d",
-__LINE__, 0xfe4a3ed0L, "FE4A3ED0", "%6.X",
-__LINE__, 0x00000000L, "0", "%d",
-__LINE__, 0x000001bbL, "01bb", "% .4x",
-__LINE__, 0x02b4a1e9L, "2b4a1e9", "%-7.x",
-__LINE__, 0x31750683L, "31750683", "%x",
-__LINE__, 0x00001cd7L, "7383", "%#ld",
-__LINE__, 0x0000079dL, "1949", "%d",
-__LINE__, 0xffb8ff3bL, "FFB8FF3B", "%X",
-__LINE__, 0x00a768b6L, "0A768B6", "%-6.7X",
-__LINE__, 0x1c665b48L, "0X1C665B48", "% #X",
-__LINE__, -0x000037dL, "-000893", "%3.6d",
-__LINE__, 0x29890443L, "29890443", "%+0x",
-__LINE__, 0x000000e5L, "e5 ", "%-4x",
-__LINE__, 0xfff2b5faL, "FFF2B5FA", "%X",
-__LINE__, -0x5d32c2bL, "-97725483", "%05ld",
-__LINE__, -0x00016c5L, " -05829", "%+#7.5ld",
-__LINE__, 0x00000644L, "644", "%X",
-__LINE__, -0x018c027L, "-1622055", "%+.1d",
-__LINE__, 0x0000013cL, "0x13c", "%#x",
-__LINE__, 0x00000009L, "+9", "%+#ld",
-__LINE__, 0x00000000L, "0", "%ld",
-__LINE__, -0x018eb19L, "-1633049", "%4.3ld",
-__LINE__, 0xfffff429L, "FFFFF429", "% X",
-__LINE__, 0x0032de67L, "32DE67", "%X",
-__LINE__, 0x0016bdfaL, " 1490426", "% .2ld",
-__LINE__, 0x00000065L, "65", "%+.0X",
-__LINE__, 0x00000072L, " 72", "%+4.2X",
-__LINE__, 0x00075119L, "75119", "%2x",
-__LINE__, 0x000000b8L, "b8", "%x",
-__LINE__, 0x000000d0L, "d0", "%x",
-__LINE__, 0x000000b9L, "b9", "%x",
-__LINE__, 0x003fda9dL, " 4184733", "% #3.d",
-__LINE__, 0x00029a24L, "170532", "%4.d",
-__LINE__, -0x132a337dL, "-321532797", "% ld",
-__LINE__, 0x0000047aL, "0X47A", "%-#X",
-__LINE__, 0x00000000L, "0", "%-ld",
-__LINE__, -0x0d9750bL, "-14251275", "% ld",
-__LINE__, 0x00029d6cL, "29d6c", "%x",
-__LINE__, 0xfb060cc0L, "fb060cc0", "%x",
-__LINE__, 0xffffd524L, "0XFFFFD524", "%#X",
-__LINE__, 0xffffff30L, "ffffff30", "%-5x",
-__LINE__, 0x00001650L, "0005712", "%#0.7d",
-__LINE__, 0x0000b702L, "0B702", "%03.5X",
-__LINE__, 0x000003c1L, "3c1", "% .1x",
-__LINE__, -0x0290412L, "-2688018", "%d",
-__LINE__, -0x00008bfL, "-2239", "%#d",
-__LINE__, -0x0000001L, "-1", "%d",
-__LINE__, 0x0001d750L, "1D750", "%-X",
-__LINE__, 0x006eee92L, "6EEE92", "%-X",
-__LINE__, 0xff812b02L, "ff812b02", "%0x",
-__LINE__, 0xfffffeacL, "FFFFFEAC", "%+0X",
-__LINE__, 0x000003a5L, "3a5", "%x",
-__LINE__, -0x15270ceeL, "-354880750", "%2.ld",
-__LINE__, 0x06b686d2L, "6b686d2", "%0x",
-__LINE__, 0xffe9cdccL, "ffe9cdcc", "%x",
-__LINE__, 0x0ecb168eL, "ecb168e", "%x",
-__LINE__, 0x00000051L, "51", "%-X",
-__LINE__, -0x0018860L, "-100448", "%-0d",
-__LINE__, 0x8f08b82bL, "0x8f08b82b", "%-#.5x",
-__LINE__, 0xffffffffL, "ffffffff", "%x",
-__LINE__, 0x0000000eL, "e", "%+01x",
-__LINE__, 0x04cf15bcL, " 80680380", "% #ld",
-__LINE__, 0x50006e8aL, "50006e8a", "%x",
-__LINE__, 0x0002f669L, "194153", "%0d",
-__LINE__, 0x000000a6L, " 166", "% 5.ld",
-__LINE__, -0x04036bbL, "-4208315", "%7.5d",
-__LINE__, 0x00070deaL, "70DEA", "%+X",
-__LINE__, 0x00000964L, "0x964", "%#x",
-__LINE__, 0x0000004dL, "0x4d", "% #3.x",
-__LINE__, -0x0000001L, "-1", "%-0d",
-__LINE__, 0x0000043eL, "1086", "%ld",
-__LINE__, -0x0000001L, "-1", "%-d",
-__LINE__, 0x00000000L, "+0", "%+d",
-__LINE__, 0xfffe68d9L, "FFFE68D9", "%7.X",
-__LINE__, -0x0169199L, "-1479065", "%#.5ld",
-__LINE__, -0x000003dL, "-61", "%ld",
-__LINE__, 0x00000001L, "+1", "%+.1d",
-__LINE__, 0x0001a65dL, "1a65d", "%.5x",
-__LINE__, 0x00000141L, "+000321", "%+#5.6ld",
-__LINE__, 0x00000000L, " 0", "%4x",
-__LINE__, 0x00000408L, "1032", "%-2.3ld",
-__LINE__, 0xffffffedL, "FFFFFFED", "%-X",
-__LINE__, 0xfe832351L, "FE832351", "% .4X",
-__LINE__, 0x003a421bL, "3A421B", "%-X",
-__LINE__, -0x53ed7f25L, "-1408073509", "%ld",
-__LINE__, -0x0000003L, "-0003", "%-5.4ld",
-__LINE__, 0x00000ad0L, " 2768", "%7d",
-__LINE__, 0xfffaf30bL, "FFFAF30B", "%X",
-__LINE__, 0x006349d3L, " 6506963", "% 6.2ld",
-__LINE__, 0x07f0146aL, "7f0146a", "%+3.4x",
-__LINE__, -0x0000002L, " -2", "% 3.ld",
-__LINE__, -0x26e94f3L, "-40801523", "%-#ld",
-__LINE__, -0x0000004L, " -004", "%7.3d",
-__LINE__, 0xfffe8cc9L, "FFFE8CC9", "%0X",
-__LINE__, 0x00000018L, " 18", "%5.x",
-__LINE__, -0x4941de83L, "-1229053571", "% 0.5ld",
-__LINE__, 0x00000000L, " 0", "%6ld",
-__LINE__, 0xfffffffeL, "0XFFFFFFFE", "%-#X",
-__LINE__, -0x0142ae1L, "-1321697", "%4.ld",
-__LINE__, -0x0319e7fL, "-3251839", "%0ld",
-__LINE__, 0x000004ffL, " 4FF", "%7.2X",
-__LINE__, -0x0001c3eL, "-7230", "%#.2ld",
-__LINE__, 0xffffe522L, "ffffe522", "%x",
-__LINE__, 0x0001d1cbL, "+119243", "%+.3ld",
-__LINE__, 0xfad19d52L, "FAD19D52", "%+X",
-__LINE__, 0x00002a7cL, " 10876", "% 0.ld",
-__LINE__, 0x00001449L, "1449", "%X",
-__LINE__, 0x000732b8L, "471736", "%d",
-__LINE__, -0x211a496eL, "-555370862", "%ld",
-__LINE__, -0x0000004L, "-4", "%1.d",
-__LINE__, 0x0295c03dL, "43368509", "%5.ld",
-__LINE__, 0x01fa5722L, "33183522", "%0ld",
-__LINE__, 0xfffbff62L, "0xfffbff62", "%#x",
-__LINE__, 0x000000f5L, " 245", "% 2.d",
-__LINE__, 0x000000a0L, "160", "%-d",
-__LINE__, 0x0000000fL, "15", "%.2ld",
-__LINE__, 0x0bf5f077L, "+200667255", "%+ld",
-__LINE__, -0x14d3e5aL, "-21839450", "%#2.3d",
-__LINE__, -0x21cbe656L, "-567010902", "%ld",
-__LINE__, 0x000002b9L, "697", "%ld",
-__LINE__, 0xfffff9b0L, "FFFFF9B0", "%X",
-__LINE__, 0x007fd9c7L, "8378823", "%3.4d",
-__LINE__, 0x00036d06L, "36d06", "%x",
-__LINE__, 0xffde8052L, "FFDE8052", "%4.6X",
-__LINE__, 0x0000000dL, "13", "%#d",
-__LINE__, 0x68157d93L, "68157d93", "%x",
-__LINE__, 0x00000005L, "5", "%1x",
-__LINE__, 0xfffffff4L, "FFFFFFF4", "%X",
-__LINE__, 0xf5bbf7e9L, "f5bbf7e9", "%+.1x",
-__LINE__, 0x0be98f98L, "BE98F98", "%X",
-__LINE__, 0x00000122L, "00122", "%.5X",
-__LINE__, -0x0000936L, "-2358", "%+#3.0ld",
-__LINE__, 0xfd230f09L, "FD230F09", "%-7X",
-__LINE__, 0x00000089L, "137", "%ld",
-__LINE__, 0x00000078L, " 120", "%7d",
-__LINE__, -0x68ef2b6bL, "-1760504683", "%-ld",
-__LINE__, 0xc24480bbL, "C24480BB", "%+4X",
-__LINE__, 0xfefe36a2L, "FEFE36A2", "%0X",
-__LINE__, -0x35344baL, "-55788730", "%7.d",
-__LINE__, 0xffffffffL, "FFFFFFFF", "%+.6X",
-__LINE__, -0x0000f40L, "-3904", "% ld",
-__LINE__, 0xfffffffbL, "FFFFFFFB", "%X",
-__LINE__, 0x58b37c4bL, "58b37c4b", "%2.2x",
-__LINE__, 0x000000e2L, "226", "%#ld",
-__LINE__, 0xfff5ebdeL, "fff5ebde", "%-7.1x",
-__LINE__, 0x0c6ea9beL, "208579006", "%-ld",
-__LINE__, 0xff708c74L, "FF708C74", "% 4.X",
-__LINE__, 0x00000000L, " 0", "% 3X",
-__LINE__, 0x00000004L, " 4", "%03.d",
-__LINE__, 0x0919be7cL, "+152682108", "%+6.d",
-__LINE__, 0x00d4fd1eL, "13958430", "%0d",
-__LINE__, 0xfe77a69eL, "fe77a69e", "%-7.x",
-__LINE__, 0x284ded44L, "676195652", "%-#2ld",
-__LINE__, -0x00006e6L, "-1766", "% ld",
-__LINE__, -0x7dac7eaL, "-131778538", "%.0ld",
-__LINE__, 0x0003c50fL, "247055", "%#d",
-__LINE__, 0xfffffffcL, "fffffffc", "%-x",
-__LINE__, 0xfe0f0d1fL, "fe0f0d1f", "% 5.1x",
-__LINE__, 0x00000009L, "9", "%0ld",
-__LINE__, -0x0175cc1L, "-1531073", "%-04.d",
-__LINE__, 0x000e4da2L, " 937378", "% 4.ld",
-__LINE__, 0x00000762L, "762", "%-0.X",
-__LINE__, 0x005211bfL, "5211bf", "%-x",
-__LINE__, 0xfffffffbL, "fffffffb", "%+2.6x",
-__LINE__, 0x00008862L, "34914", "%ld",
-__LINE__, 0xfffc9754L, "fffc9754", "%+x",
-__LINE__, 0x0000716eL, "716E", "%X",
-__LINE__, 0x000000a8L, "a8", "%x",
-__LINE__, 0xffff84f5L, "ffff84f5", "%0x",
-__LINE__, 0x00005032L, "5032", "%x",
-__LINE__, 0xffe242b4L, "ffe242b4", "%6x",
-__LINE__, 0x002df9bdL, "3013053", "%ld",
-__LINE__, 0xffffe267L, "FFFFE267", "%.5X",
-__LINE__, 0xffffffc7L, "0xffffffc7", "%#x",
-__LINE__, -0x1727c38L, "-24280120", "%d",
-__LINE__, 0x01308072L, "1308072", "%x",
-__LINE__, -0x5883c7cL, "-92814460", "%+ld",
-__LINE__, 0x000030adL, "30ad", "%x",
-__LINE__, 0xffffffffL, "FFFFFFFF", "%X",
-__LINE__, -0x2090a708L, "-546350856", "% d",
-__LINE__, 0x0024e6b4L, "2418356", "%#ld",
-__LINE__, 0x02db71acL, "2DB71AC", "% 6.3X",
-__LINE__, 0xfffffffcL, "FFFFFFFC", "%2.7X",
-__LINE__, -0x000074eL, " -1870", "%7.ld",
-__LINE__, -0x0011d84L, "-73092", "%d",
-__LINE__, 0x00160723L, "160723", "%1.3x",
-__LINE__, 0x00412929L, "4270377", "%-d",
-__LINE__, -0x0008fc6L, "-36806", "% d",
-__LINE__, 0x00000002L, "2", "%d",
-__LINE__, 0x0eb67ffaL, "eb67ffa", "%.4x",
-__LINE__, 0x05b86c3cL, "95972412", "%4.4d",
-__LINE__, 0xffffca9cL, "FFFFCA9C", "% 4.X",
-__LINE__, 0x0007d571L, "7d571", "%-0x",
-__LINE__, -0x000239bL, "-09115", "%5.5d",
-__LINE__, -0x0000155L, " -341", "%5.3ld",
-__LINE__, 0x00000034L, "34", "%x",
-__LINE__, -0x0000051L, "-81", "%.1ld",
-__LINE__, 0x309bbbe0L, "309bbbe0", "%x",
-__LINE__, 0x0075be1eL, " 7716382", "% #ld",
-__LINE__, 0x000002d5L, "2d5", "%x",
-__LINE__, 0x006b466dL, "6B466D", "%-0X",
-__LINE__, 0x01d6c30fL, "1D6C30F", "%4.X",
-__LINE__, 0x00000003L, " 3", "%07.x",
-__LINE__, 0xfffcc102L, "FFFCC102", "%6.X",
-__LINE__, 0xffffffffL, "0XFFFFFFFF", "%#X",
-__LINE__, 0xfffffffeL, "fffffffe", "%+x",
-__LINE__, 0x00000005L, "5", "%ld",
-__LINE__, 0xff060284L, "ff060284", "%x",
-__LINE__, 0x007a3325L, "7A3325", "%-X",
-__LINE__, 0xf5f595bdL, "F5F595BD", "%0X",
-__LINE__, 0xfffa3a10L, "FFFA3A10", "%0X",
-__LINE__, 0x00000000L, "0", "%x",
-__LINE__, -0x15078f9L, "-22051065", "%7d",
-__LINE__, -0x0000002L, "-000002", "%.6d",
-__LINE__, 0x00000036L, "54", "%1.1ld",
-__LINE__, -0xbbecf6aL, "-197054314", "%ld",
-__LINE__, 0x0000043dL, "43D", "%X",
-__LINE__, 0xfffffffaL, "0xfffffffa", "% #6.x",
-__LINE__, 0x016759f8L, "23550456", "%0.ld",
-__LINE__, 0x000052d2L, "+21202", "%+6.2d",
-__LINE__, -0x007d232L, "-512562", "%ld",
-__LINE__, 0x00240be0L, "2362336", "%.1d",
-__LINE__, -0x0000001L, "-1", "%0d",
-__LINE__, 0xfffffffaL, "FFFFFFFA", "%X",
-__LINE__, -0x0000e88L, "-3720", "%ld",
-__LINE__, 0xfffffa9bL, "FFFFFA9B", "%.5X",
-__LINE__, 0x09296eebL, "153710315", "%-1.0d",
-__LINE__, 0x001f46fcL, "0X1F46FC", "%#X",
-__LINE__, 0x00000006L, "6", "%X",
-__LINE__, 0xffffff87L, "0XFFFFFF87", "%+#X",
-__LINE__, 0x00000469L, "0469", "%04X",
-__LINE__, -0x0000001L, "-1", "%ld",
-__LINE__, 0x00000000L, "", "%.0ld",
-__LINE__, -0x52bc137L, "-86753591", "%-#3ld",
-__LINE__, -0x2bddb08L, "-45996808", "%-3.d",
-__LINE__, 0x041367f7L, "41367F7", "%+X",
-__LINE__, -0x0018eb5L, "-102069", "%+ld",
-__LINE__, -0x0000537L, "-1335", "%#ld",
-__LINE__, -0x6f159ff4L, "-1863688180", "%+1.d",
-__LINE__, 0x00112ac8L, "0X112AC8", "%#6.3X",
-__LINE__, 0x00000000L, " ", "%3.d",
-__LINE__, 0x0008afe8L, "08afe8", "%+3.6x",
-__LINE__, 0x00000015L, "21", "%ld",
-__LINE__, -0x02b7130L, "-2847024", "% #2.4d",
-__LINE__, 0xffffffd0L, "FFFFFFD0", "%X",
-__LINE__, -0x6970fa1L, "-110563233", "%+#.4ld",
-__LINE__, 0x06387dccL, "0X6387DCC", "%-#X",
-__LINE__, 0xffffd506L, "ffffd506", "%+6x",
-__LINE__, -0x00fe5cdL, "-1041869", "%-#7d",
-__LINE__, -0x0c35bf6L, "-12803062", "%-03d",
-__LINE__, -0x0020d89L, "-134537", "%#d",
-__LINE__, -0x0c7aed3L, "-13086419", "%-ld",
-__LINE__, -0x000362aL, "-13866", "%#.4ld",
-__LINE__, -0x02d05f0L, "-2950640", "%#ld",
-__LINE__, 0x02de1321L, "0x2de1321", "%#7.x",
-__LINE__, 0xffb56428L, "0xffb56428", "%#x",
-__LINE__, 0xfffffffeL, "FFFFFFFE", "%X",
-__LINE__, 0xf072292dL, "F072292D", "%.5X",
-__LINE__, -0x0f4b0f2L, "-16036082", "%.5ld",
-__LINE__, 0x01b81885L, "28842117", "%5d",
-__LINE__, -0x009cfa6L, "-642982", "%d",
-__LINE__, 0xfffffffdL, "0XFFFFFFFD", "%-#.5X",
-__LINE__, 0x0dc97a66L, "DC97A66", "%2.X",
-__LINE__, 0x000000beL, "190", "%.0d",
-__LINE__, 0xffffe1c7L, "FFFFE1C7", "% X",
-__LINE__, 0x01883b9aL, "1883b9a", "%3x",
-__LINE__, 0xffffdde1L, "ffffdde1", "%+x",
-__LINE__, 0x2f1b4e32L, "+790318642", "%+ld",
-__LINE__, 0x000129aaL, "129aa", "%x",
-__LINE__, -0x00092c2L, "-37570", "%d",
-__LINE__, 0x00070fbdL, "70fbd", "%x",
-__LINE__, -0x00000eaL, "-234", "%+4ld",
-__LINE__, 0xfffffffeL, "fffffffe", "%x",
-__LINE__, 0x0091c7f7L, "91C7F7", "% .3X",
-__LINE__, -0x0c14fe2L, "-12668898", "%d",
-__LINE__, -0x0017c15L, "-97301", "%d",
-__LINE__, -0x00005d0L, "-0001488", "%5.7d",
-__LINE__, 0x0114c36eL, "18137966", "%0d",
-__LINE__, 0xffffffffL, "ffffffff", "%+x",
-__LINE__, 0x0ac76e78L, "180842104", "%d",
-__LINE__, 0x001976cdL, " 1668813", "% 4.ld",
-__LINE__, -0x0642319L, "-6562585", "% d",
-__LINE__, 0xffffffffL, "FFFFFFFF", "%X",
-__LINE__, -0x035019dL, "-3473821", "%.7d",
-__LINE__, -0x0000061L, "-97", "%#3.d",
-__LINE__, 0x0000001fL, " 31", "% 6.1ld",
-__LINE__, -0x0000024L, "-36", "%d",
-__LINE__, 0x000b3785L, "735109", "%ld",
-__LINE__, 0xfffffda9L, "fffffda9", "%-x",
-__LINE__, 0x00254832L, "2443314", "%-ld",
-__LINE__, 0xfffffd40L, "FFFFFD40", "%0X",
-__LINE__, -0x0006105L, "-24837", "%+#d",
-__LINE__, 0x00000006L, "+6", "%+d",
-__LINE__, 0xffd40fd8L, "ffd40fd8", "%3.x",
-__LINE__, -0x000988eL, "-39054", "%03d",
-__LINE__, 0x0005ad8bL, "5AD8B", "%0.0X",
-__LINE__, 0x00000001L, "1", "%d",
-__LINE__, 0xfe1f59b7L, "fe1f59b7", "%4.x",
-__LINE__, -0x0000022L, "-34", "%#d",
-__LINE__, 0x0018e3e9L, "18E3E9", "% X",
-__LINE__, 0xffffff25L, "FFFFFF25", "%2.X",
-__LINE__, -0x00002c6L, "-710", "%1.ld",
-__LINE__, 0x00009765L, "38757", "%5ld",
-__LINE__, 0xfe197646L, "FE197646", "%-X",
-__LINE__, 0x00000001L, " 1", "%+5.x",
-__LINE__, -0x0000002L, "-2", "%#ld",
-__LINE__, 0x0072f6beL, "72F6BE", "%1X",
-__LINE__, -0x000f06dL, "-61549", "%-d",
-__LINE__, 0x00000001L, " 1", "%5X",
-__LINE__, 0x328cba28L, " 848083496", "% 2.ld",
-__LINE__, 0x0000cddcL, "cddc", "%.1x",
-__LINE__, 0xfffffff9L, "fffffff9", "%7x",
-__LINE__, 0x00baf511L, "BAF511", "%-5.6X",
-__LINE__, 0x00000001L, " 1", "%4.ld",
-__LINE__, 0x0001e4b0L, "+124080", "%+ld",
-__LINE__, -0x07548f3L, "-7686387", "% 6.d",
-__LINE__, -0x01b14eaL, "-1774826", "% #0d",
-__LINE__, -0x000005cL, "-92 ", "%-04ld",
-__LINE__, -0x00000aeL, "-174", "%+.3ld",
-__LINE__, 0x0000008cL, "0X8C", "%+#X",
-__LINE__, 0x14c02360L, "14C02360", "%.6X",
-__LINE__, 0xfffffff6L, "FFFFFFF6", "%X",
-__LINE__, 0x009f4ee5L, "9f4ee5", "%x",
-__LINE__, 0x00000035L, "35", "%X",
-__LINE__, -0x00000ebL, "-235", "%ld",
-__LINE__, 0x1552ced8L, "1552CED8", "%04X",
-__LINE__, 0x0000002aL, " 2A", "%5X",
-__LINE__, 0xffffffffL, "ffffffff", "% x",
-__LINE__, -0xdec0db2L, "-233573810", "%d",
-__LINE__, 0x001e2ef0L, "1978096", "%2.d",
-__LINE__, 0xffffef24L, "ffffef24", "%.5x",
-__LINE__, 0xfffe6a6cL, "fffe6a6c", "%+x",
-__LINE__, -0x0000004L, "-4", "% ld",
-__LINE__, 0xfe3c6743L, "fe3c6743", "%.1x",
-__LINE__, 0x0000033dL, "829", "%0ld",
-__LINE__, -0x00006a0L, " -1696", "% 7.ld",
-__LINE__, 0xffffffdbL, "ffffffdb", "%0.0x",
-__LINE__, 0xfffffffcL, "FFFFFFFC", "%3.3X",
-__LINE__, -0x0000004L, "-4", "%#ld",
-__LINE__, 0x00b32b56L, "B32B56", "%X",
-__LINE__, 0xffffffffL, "0xffffffff", "%+#x",
-__LINE__, 0x01cd1a48L, "1cd1a48", "%+7x",
-__LINE__, 0xffffffdaL, "ffffffda", "%x",
-__LINE__, 0x1886509eL, "1886509E", "% X",
-__LINE__, 0x000000ebL, "235", "%0d",
-__LINE__, 0xfffffff4L, "fffffff4", "%0x",
-__LINE__, 0x00000547L, "547", "% X",
-__LINE__, 0x000017e6L, "17e6", "%-2.x",
-__LINE__, 0x00001dc4L, "7620", "%d",
-__LINE__, 0xffffffffL, "FFFFFFFF", "%3.0X",
-__LINE__, 0xffff93faL, "0XFFFF93FA", "%#X",
-__LINE__, 0xfffffe1cL, "FFFFFE1C", "%-X",
-__LINE__, 0x00000000L, "", "% .0x",
-__LINE__, 0x000000a1L, "A1", "%X",
-__LINE__, 0xffffffffL, "0xffffffff", "%#x",
-__LINE__, -0x0001460L, "-05216", "%+#.5d",
-__LINE__, 0x00000001L, "1 ", "%-6.x",
-__LINE__, 0xfffd5324L, "FFFD5324", "%+2.6X",
-__LINE__, 0x00000007L, " 07", "%06.2d",
-__LINE__, 0x00000003L, "3", "%-X",
-__LINE__, 0xfffffdb7L, "0XFFFFFDB7", "%+#X",
-__LINE__, 0xfffff4ccL, "fffff4cc", "%0x",
-__LINE__, 0x00000000L, "0 ", "%-5X",
-__LINE__, 0x00758c96L, "758C96", "%X",
-__LINE__, -0x0000001L, "-1", "%-ld",
-__LINE__, 0x00000001L, "1", "%ld",
-__LINE__, 0x03f03cafL, "66075823", "%.2ld",
-__LINE__, 0x0000a87cL, "a87c", "%1.x",
-__LINE__, 0x00000034L, "34", "%X",
-__LINE__, 0x00000000L, "0", "%x",
-__LINE__, 0x00010167L, "10167", "%x",
-__LINE__, -0x00007ceL, "-1998 ", "%-6ld",
-__LINE__, 0x00000001L, "1", "%.0d",
-__LINE__, 0x00d94ceeL, "14241006", "%ld",
-__LINE__, -0x0000008L, "-8", "% d",
-__LINE__, -0x71520839L, "-1901201465", "%+0d",
-__LINE__, 0x0000035aL, "35a", "%-x",
-__LINE__, 0xfffd2f68L, "FFFD2F68", "%-X",
-__LINE__, 0x0006ea53L, "453203", "%1d",
-__LINE__, 0x000000dfL, "DF", "% 1X",
-__LINE__, 0xfffffffeL, "fffffffe", "% 7x",
-__LINE__, 0x00000156L, "156", "% X",
-__LINE__, 0x00037ac9L, " 228041", "% ld",
-__LINE__, 0xffffffdeL, "FFFFFFDE", "%0.5X",
-__LINE__, 0x00000025L, "37", "%-0.ld",
-__LINE__, -0x4133686L, "-68368006", "%2ld",
-__LINE__, -0x000003bL, "-59", "%.2ld",
-__LINE__, 0xfffff910L, "fffff910", "% 00.0x",
-__LINE__, 0xff9ec802L, "FF9EC802", "%2.6X",
-__LINE__, 0x00000008L, "0X8", "%#1X",
-__LINE__, 0xfffffff7L, "FFFFFFF7", "%-X",
-__LINE__, 0x0029a4daL, "2729178", "%04.ld",
-__LINE__, 0x007d1588L, "8197512", "%#d",
-__LINE__, 0x0007e86dL, "518253", "%0d",
-__LINE__, 0xfffffff9L, "fffffff9", "%x",
-__LINE__, 0x00000002L, "002", "%.3d",
-__LINE__, 0x00006ec1L, "6EC1", "%2X",
-__LINE__, 0x0000300cL, "12300", "%-d",
-__LINE__, -0x0000002L, "-2", "%+ld",
-__LINE__, -0x0000002L, "-2", "%ld",
-__LINE__, -0x00015d5L, "-005589", "%#.6ld",
-__LINE__, 0x00000041L, "65", "%d",
-__LINE__, 0x00000229L, "0000229", "% 0.7x",
-__LINE__, 0xfffffffbL, "fffffffb", "%03.x",
-__LINE__, 0x00093262L, "0602722", "%.7d",
-__LINE__, -0x00037b4L, "-14260", "%-0ld",
-__LINE__, 0xfffffffcL, "fffffffc", "%-x",
-__LINE__, 0xf24cb3e6L, "f24cb3e6", "%1x",
-__LINE__, 0x00000000L, "0", "%x",
-__LINE__, 0xfffffffbL, "FFFFFFFB", "%0X",
-__LINE__, 0x00000031L, "0000049", "%00.7ld",
-__LINE__, 0x00000bb3L, "BB3", "%.1X",
-__LINE__, -0x0000001L, "-0001", "%+#4.4ld",
-__LINE__, -0x0000001L, "-1", "% d",
-__LINE__, 0x00022c0cL, "22c0c", "%-x",
-__LINE__, 0xffffffd4L, "ffffffd4", "%x",
-__LINE__, 0x000729c6L, "469446", "%3.d",
-__LINE__, 0xb180feaeL, "b180feae", "%3.x",
-__LINE__, 0x124fac15L, "307211285", "%-0ld",
-__LINE__, -0x0000004L, "-4", "%ld",
-__LINE__, 0x0000006aL, "106", "%#d",
-__LINE__, 0x0000297fL, "297F", "%+3X",
-__LINE__, 0x0000000eL, "14", "%0ld",
-__LINE__, 0x00000027L, "27", "%0.1X",
-__LINE__, 0xffeb98ebL, "ffeb98eb", "% 05.2x",
-__LINE__, 0xfffff19bL, "FFFFF19B", "%+X",
-__LINE__, 0x00025992L, "154002", "%6.6d",
-__LINE__, 0x00000040L, " 040", "%6.3X",
-__LINE__, 0x00000a9eL, " 0a9e", "%5.4x",
-__LINE__, 0x00c7f2ccL, "c7f2cc", "%x",
-__LINE__, 0x000325e6L, " 325E6", "%6.X",
-__LINE__, -0x69faad3L, "-111127251", "%d",
-__LINE__, -0x059a307L, "-5874439", "% ld",
-__LINE__, 0xfffffff6L, "0xfffffff6", "%#0.0x",
-__LINE__, 0x0030fdf3L, "30fdf3", "%x",
-__LINE__, 0x00007343L, "+29507", "%+#2d",
-__LINE__, 0x0003cf4bL, "0X3CF4B", "% #.2X",
-__LINE__, 0x00000433L, "+1075", "%+0ld",
-__LINE__, 0xfffffffdL, "fffffffd", "%+.3x",
-__LINE__, 0x0ae30c4eL, "ae30c4e", "%+00x",
-__LINE__, 0x0002540fL, "02540f", "%-.6x",
-__LINE__, -0x0000001L, " -01", "% #5.2ld",
-__LINE__, 0xffffffe7L, "0xffffffe7", "% #5.x",
-__LINE__, 0x0000005bL, "91", "%d",
-__LINE__, 0x00001f9bL, "8091", "%.4ld",
-__LINE__, 0xfffff315L, "fffff315", "%4.x",
-__LINE__, -0x130eec41L, "-319745089", "% ld",
-__LINE__, 0xfff8fe13L, "FFF8FE13", "%X",
-__LINE__, -0x0000004L, "-00004", "%5.5d",
-__LINE__, 0x00000669L, "669", "%0X",
-__LINE__, -0x0000004L, "-4", "%d",
-__LINE__, 0xf5e81496L, "F5E81496", "% 6X",
-__LINE__, -0x0000001L, "-1", "% 0d",
-__LINE__, 0xfffffff7L, "fffffff7", "%x",
-__LINE__, 0x000001deL, "478", "%d",
-__LINE__, 0x0000623eL, "25150", "%5.0d",
-__LINE__, 0xffffffa8L, "FFFFFFA8", "%+X",
-__LINE__, -0x0000117L, "-279", "% ld",
-__LINE__, -0x0000517L, "-1303", "%d",
-__LINE__, 0xfffff9d5L, "fffff9d5", "% x",
-__LINE__, 0x000001ccL, "1CC", "%-X",
-__LINE__, 0x0000019aL, "0000410", "%.7d",
-__LINE__, 0x00000003L, "3 ", "%-06X",
-__LINE__, 0x00000009L, "0x9", "%#0x",
-__LINE__, 0xfd544610L, "0XFD544610", "% #X",
-__LINE__, 0xfffffffcL, "fffffffc", "%+x",
-__LINE__, 0x00009437L, "37943", "%ld",
-__LINE__, -0x00b5ea6L, "-745126", "%d",
-__LINE__, 0xffffffd8L, "ffffffd8", "%6x",
-__LINE__, 0x00002a2dL, "10797", "%.3ld",
-__LINE__, 0x00275238L, "2576952", "%0ld",
-__LINE__, 0xfff90a34L, "FFF90A34", "%-7X",
-__LINE__, 0xfffffffeL, "FFFFFFFE", "% .7X",
-__LINE__, -0xb3b673eL, "-188442430", "% ld",
-__LINE__, 0xfffff67aL, "0xfffff67a", "%#0.x",
-__LINE__, 0x0000dff6L, " dff6", "%+7.x",
-__LINE__, 0xffee46e3L, "ffee46e3", "%x",
-__LINE__, 0x00001a66L, " 0006758", "% 7.7d",
-__LINE__, 0x0002b475L, "2B475", "%.4X",
-__LINE__, 0x0002090dL, "002090d", "%.7x",
-__LINE__, -0x0057838L, "-358456", "%#ld",
-__LINE__, 0x00000004L, "0x4", "%#x",
-__LINE__, 0x0574cb62L, "91540322", "%#7d",
-__LINE__, -0x0054388L, "-344968", "% #d",
-__LINE__, 0x000421c2L, "421C2", "% X",
-__LINE__, 0x00000003L, "3", "%0d",
-__LINE__, 0xffffe2e2L, "ffffe2e2", "% 5.x",
-__LINE__, 0x00000021L, "+33", "%+d",
-__LINE__, -0x0020033L, "-131123", "%ld",
-__LINE__, -0x0000001L, " -1", "%4.ld",
-__LINE__, 0x000000fdL, "000fd", "%3.5x",
-__LINE__, 0x023e4337L, "37634871", "%1d",
-__LINE__, 0x6e823d96L, "6E823D96", "% X",
-__LINE__, 0xfff0e133L, "fff0e133", "%x",
-__LINE__, -0x000deccL, "-57036", "%3d",
-__LINE__, 0x004397b8L, "4429752", "%0d",
-__LINE__, -0x0000023L, " -35", "%6d",
-__LINE__, 0xffe701caL, "FFE701CA", "%3X",
-__LINE__, 0x000c0319L, "+787225", "%+.6d",
-__LINE__, 0x00000000L, "0", "%x",
-__LINE__, 0xfffffe1dL, "FFFFFE1D", "%X",
-__LINE__, 0xfffffb33L, "fffffb33", "%x",
-__LINE__, 0x02b5e30aL, "45474570", "%d",
-__LINE__, 0x000074ebL, "29931", "%03.ld",
-__LINE__, -0x4e42e310L, "-1313006352", "%-0.d",
-__LINE__, -0x000007bL, "-123", "%d",
-__LINE__, 0x00000160L, " 352", "% d",
-__LINE__, -0x16af31ecL, "-380580332", "%#ld",
-__LINE__, -0x000006eL, "-000110", "%07ld",
-__LINE__, 0x232699a0L, "232699a0", "%7.x",
-__LINE__, 0x00f9b8e5L, "+16365797", "%+0d",
-__LINE__, 0x0000000cL, "C", "%X",
-__LINE__, 0xfffffd4fL, "FFFFFD4F", "%X",
-__LINE__, 0xffffe7bbL, "FFFFE7BB", "%.7X",
-__LINE__, -0x0000163L, "-355", "%d",
-__LINE__, 0x00070315L, " 459541", "% #2.d",
-__LINE__, -0x7d5c12aL, "-131449130", "% 6.ld",
-__LINE__, 0xffffffb2L, "FFFFFFB2", "%X",
-__LINE__, -0x0004aadL, "-19117", "%+6.4ld",
-__LINE__, 0x00115586L, "1136006", "%0d",
-__LINE__, -0x0000021L, "-33", "%d",
-__LINE__, 0x093ce01eL, "93ce01e", "% 5x",
-__LINE__, 0x00672135L, "672135", "% x",
-__LINE__, 0x05f4abd5L, "0x5f4abd5", "%+#6.x",
-__LINE__, -0x0448b03L, "-4492035", "%-0.2ld",
-__LINE__, 0x00000000L, "0", "%#x",
-__LINE__, 0x1987217eL, "428286334", "%d",
-__LINE__, 0x000010f6L, "10f6", "%-x",
-__LINE__, 0x0000177aL, "177a", "%1x",
-__LINE__, 0xfffffefdL, "FFFFFEFD", "%7X",
-__LINE__, -0x095cbf8L, "-9817080", "%-5ld",
-__LINE__, 0x0000008aL, "138", "%2.0ld",
-__LINE__, 0xfffe80adL, "fffe80ad", "%0x",
-__LINE__, -0x1a4c8f7L, "-27576567", "%d",
-__LINE__, 0x00000000L, "0", "%-x",
-__LINE__, 0x0000a82bL, "43051", "%-ld",
-__LINE__, 0x000000ebL, "235", "%2.3ld",
-__LINE__, -0x0002747L, "-10055", "%d",
-__LINE__, 0x00000319L, "0X319", "%#X",
-__LINE__, 0xfffffcfeL, "FFFFFCFE", "% X",
-__LINE__, 0x00050f0eL, "50f0e", "%-1x",
-__LINE__, -0x398e09eL, "-60350622", "%0.7ld",
-__LINE__, 0x00000000L, " ", "%2.ld",
-__LINE__, 0x00000049L, "00049", "% .5X",
-__LINE__, -0x00000ddL, " -221", "%+#5ld",
-__LINE__, 0xf6db2facL, "f6db2fac", "%-07x",
-__LINE__, 0x0000004fL, "4F", "% .0X",
-__LINE__, 0x00000000L, "0", "%x",
-__LINE__, 0xfd07f692L, "fd07f692", "%x",
-__LINE__, 0xdb98bde0L, "db98bde0", "%x",
-__LINE__, 0x00000271L, "0271", "% 3.4x",
-__LINE__, -0x000115aL, "-4442", "%#1.ld",
-__LINE__, 0x0002f5f2L, "194034", "%ld",
-__LINE__, -0x0000152L, " -338", "%+7ld",
-__LINE__, 0x00059336L, "365366", "%d",
-__LINE__, 0xfffffff6L, "fffffff6", "%-7x",
-__LINE__, 0xfb916c51L, "fb916c51", "%-x",
-__LINE__, 0xffff413dL, "FFFF413D", "%-X",
-__LINE__, 0xf2576910L, "F2576910", "%-4.X",
-__LINE__, 0xfffc7730L, "fffc7730", "%5.x",
-__LINE__, 0x000002e6L, "+742", "%+1d",
-__LINE__, -0x00001bfL, "-447", "%3d",
-__LINE__, 0x000002e1L, "2E1", "%-X",
-__LINE__, 0x00000096L, "150", "%#0ld",
-__LINE__, 0x000002bdL, "701", "%d",
-__LINE__, -0x0053386L, "-340870", "%#d",
-__LINE__, 0xfffdb076L, "FFFDB076", "%X",
-__LINE__, 0x00004dc5L, " +19909", "%+07.ld",
-__LINE__, 0x00000f7aL, " F7A", "%4X",
-__LINE__, 0x02405000L, " 37769216", "% ld",
-__LINE__, 0xfffce68dL, "fffce68d", "%0x",
-__LINE__, -0x35b3af2L, "-56310514", "%-ld",
-__LINE__, -0x0238631L, "-2328113", "%.4d",
-__LINE__, -0x000001eL, "-030", "%.3ld",
-__LINE__, 0xffffffddL, "FFFFFFDD", "%.4X",
-__LINE__, 0x0013f6acL, "13f6ac", "%02.x",
-__LINE__, 0xfffffffaL, "fffffffa", "%+07.x",
-__LINE__, -0x000192bL, " -6443", "%6.d",
-__LINE__, 0x0000058bL, "+1419", "%+d",
-__LINE__, 0x00001391L, "5009", "%ld",
-__LINE__, -0x0041a57L, "-268887", "%1ld",
-__LINE__, 0xfffff266L, "0xfffff266", "%+#6.6x",
-__LINE__, 0x0000018bL, " 395", "%6.ld",
-__LINE__, 0x009ae24dL, "+10150477", "%+ld",
-__LINE__, 0x0000007eL, "7E", "%X",
-__LINE__, 0xfffffd53L, "FFFFFD53", "% 0X",
-__LINE__, 0x000002faL, "2FA", "%-1.3X",
-__LINE__, 0x000000a4L, "164", "%0d",
-__LINE__, 0x00001833L, "6195", "%ld",
-__LINE__, -0x0000001L, "-1", "%d",
-__LINE__, 0xf2fcbd9bL, "F2FCBD9B", "%+0.2X",
-__LINE__, 0x00004a8aL, "4A8A", "%X",
-__LINE__, -0x10695cdaL, "-275340506", "%d",
-__LINE__, 0x00000037L, "37", "%X",
-__LINE__, 0x00082d5cL, "82D5C", "%+0.5X",
-__LINE__, 0xfffffe01L, "fffffe01", "% 5.3x",
-__LINE__, 0x000005eaL, "05EA", "% 1.4X",
-__LINE__, 0x0e0b8826L, "e0b8826", "%2x",
-__LINE__, -0x0000161L, "-353", "%+d",
-__LINE__, 0x19e3014aL, "19E3014A", "%+5X",
-__LINE__, 0x00000140L, "140", "%x",
-__LINE__, 0xffff84b9L, "FFFF84B9", "%X",
-__LINE__, -0x0005776L, "-22390", "%+5ld",
-__LINE__, 0x0162ad61L, "162AD61", "% X",
-__LINE__, 0x00002395L, "2395", "%X",
-__LINE__, 0x003702ecL, "3605228", "%5.2d",
-__LINE__, 0xffffffffL, "FFFFFFFF", "%7X",
-__LINE__, 0x00001778L, "0x1778", "%#5.x",
-__LINE__, 0xc52bef7fL, "C52BEF7F", "%X",
-__LINE__, 0xfffffec4L, "FFFFFEC4", "%X",
-__LINE__, 0x00000006L, "6", "%X",
-__LINE__, 0x00000000L, "000", "%03.3x",
-__LINE__, 0x00000000L, "0", "%x",
-__LINE__, 0xffff6c46L, "FFFF6C46", "% 2.2X",
-__LINE__, -0x1506098L, "-22044824", "%01.d",
-__LINE__, 0x03415cafL, "3415caf", "%x",
-__LINE__, -0x00007b4L, "-1972", "%#4.4d",
-__LINE__, -0x00158c9L, "-88265", "%03.4d",
-__LINE__, 0x6947c336L, "1766310710", "%.6d",
-__LINE__, 0x0000017cL, "17C", "% 0X",
-__LINE__, -0x00001b7L, "-439", "% 0ld",
-__LINE__, 0x06a7575aL, "6A7575A", "%-.0X",
-__LINE__, 0x000b3459L, "734297", "%ld",
-__LINE__, -0x395d8ddL, "-60152029", "%ld",
-__LINE__, 0x00036bb3L, "224179", "%-6.d",
-__LINE__, 0xffff14ffL, "FFFF14FF", "%X",
-__LINE__, -0x15910e4fL, "-361827919", "%-0d",
-__LINE__, -0x0000004L, "-4", "%#d",
-__LINE__, 0xf7f7adacL, "F7F7ADAC", "% 3.X",
-__LINE__, 0xffffff74L, "FFFFFF74", "%0X",
-__LINE__, 0x00000000L, "0", "%d",
-__LINE__, -0x000007bL, "-123 ", "%-7.d",
-__LINE__, -0x000002cL, "-44", "%d",
-__LINE__, -0x000002bL, " -43", "%5d",
-__LINE__, 0x0000ae5fL, "44639", "%d",
-__LINE__, 0x003cbc63L, "3CBC63", "%X",
-__LINE__, 0xfffffffcL, "0XFFFFFFFC", "%#5.7X",
-__LINE__, 0x0003e044L, "3E044", "%X",
-__LINE__, -0x0000c46L, "-3142", "%.1d",
-__LINE__, 0xff18f4bbL, "FF18F4BB", "%0X",
-__LINE__, 0xfffffffdL, "FFFFFFFD", "%.1X",
-__LINE__, -0x01c0f27L, "-1838887", "%0d",
-__LINE__, -0x1242901fL, "-306352159", "%.4ld",
-__LINE__, 0x1775c10aL, "393593098", "%6.ld",
-__LINE__, 0x00000001L, " 1", "%03.d",
-__LINE__, 0xfff1fd30L, "0xfff1fd30", "%#x",
-__LINE__, 0x00000191L, "191", "%0.X",
-__LINE__, 0x2e597178L, "777613688", "%2.ld",
-__LINE__, -0x4ef0cf3L, "-82775283", "%+.6ld",
-__LINE__, -0x0000085L, " -133", "%6.d",
-__LINE__, 0x0000014dL, "333 ", "%-5ld",
-__LINE__, -0xc03bd74L, "-201571700", "%07.6ld",
-__LINE__, -0x000000aL, "-10", "%d",
-__LINE__, 0x01f5e86eL, "32893038", "%#2.ld",
-__LINE__, 0x00000033L, "0X33", "% #X",
-__LINE__, 0x0087c797L, " 8898455", "% 7.d",
-__LINE__, -0x0001205L, "-4613", "%5d",
-__LINE__, 0x00000192L, " 192", "%7.X",
-__LINE__, 0x000e6c00L, "945152", "%6.1ld",
-__LINE__, 0x00018629L, " 99881", "% d",
-__LINE__, -0x04739c6L, "-4667846", "%-01.3ld",
-__LINE__, 0x00001f42L, "8002", "%d",
-__LINE__, 0x00000cafL, "3247", "%d",
-__LINE__, -0x4992e24L, "-77147684", "%#.6d",
-__LINE__, 0x0000001dL, "1d", "%-0x",
-__LINE__, 0x14d79f03L, "349675267", "%0ld",
-__LINE__, 0x00000dd4L, " 03540", "%#6.5ld",
-__LINE__, 0x0005f30eL, "0X5F30E", "%#X",
-__LINE__, 0x00000157L, "157", "%X",
-__LINE__, -0x9281698L, "-153622168", "%d",
-__LINE__, -0x000004aL, "-74", "%d",
-__LINE__, -0x0010c9eL, "-68766", "%-0d",
-__LINE__, 0x00000059L, "00089", "%.5ld",
-__LINE__, -0x06959e3L, "-6904291", "% 4.d",
-__LINE__, 0xfbea12b1L, "0XFBEA12B1", "%+#X",
-__LINE__, 0xffffdfb1L, "FFFFDFB1", "%2.6X",
-__LINE__, 0x0434faacL, "434faac", "%.5x",
-__LINE__, 0xffffffffL, "ffffffff", "% x",
-__LINE__, 0x00000b32L, "B32", "%0X",
-__LINE__, 0x00000047L, "71", "%.1d",
-__LINE__, 0x00070befL, " 0461807", "% .7d",
-__LINE__, 0x00000038L, "38", "% 0x",
-__LINE__, 0x00000000L, " 0", "%6X",
-__LINE__, 0xfff9c011L, "FFF9C011", "%2X",
-__LINE__, 0xfffffffeL, "fffffffe", "%7x",
-__LINE__, 0xfffffff9L, "FFFFFFF9", "%X",
-__LINE__, -0x016a095L, "-1482901", "%4.0ld",
-__LINE__, -0x000001cL, "-28", "% ld",
-__LINE__, 0xfffd6133L, "0xfffd6133", "%#x",
-__LINE__, 0x000004a4L, "0x4a4", "%#x",
-__LINE__, 0x000003c2L, "0962", "%.4d",
-__LINE__, -0x000323bL, "-12859", "%+#d",
-__LINE__, 0x0f620237L, "F620237", "%X",
-__LINE__, 0x00007863L, "007863", "%.6X",
-__LINE__, 0x0000002cL, " 44", "% #ld",
-__LINE__, 0xfffffff0L, "fffffff0", "%03.6x",
-__LINE__, 0xffff6346L, "FFFF6346", "%1.X",
-__LINE__, 0x00063188L, "63188", "% x",
-__LINE__, 0xfffff91cL, "fffff91c", "%-.3x",
-__LINE__, 0x004cd0b4L, "4CD0B4", "%-2.X",
-__LINE__, 0x06b4d739L, "112514873", "%0.1d",
-__LINE__, -0x0009bebL, "-39915", "%.2d",
-__LINE__, 0x0000831bL, "33563", "%d",
-__LINE__, 0x00000001L, "1", "%X",
-__LINE__, -0x942d76bL, "-155375467", "% #0ld",
-__LINE__, 0xffff2a95L, "FFFF2A95", "%2X",
-__LINE__, 0x00548d5eL, "5541214", "%.3ld",
-__LINE__, 0x0b5e1a01L, "B5E1A01", "% .7X",
-__LINE__, 0xfffffc22L, "fffffc22", "%6x",
-__LINE__, -0x0000dd7L, "-3543", "%-.3ld",
-__LINE__, 0xfffff834L, "FFFFF834", "%X",
-__LINE__, 0x0365f762L, "57014114", "%ld",
-__LINE__, -0x0000003L, "-3", "%d",
-__LINE__, 0x3bd998a3L, "1004116131", "%d",
-__LINE__, 0xfffff6c9L, "FFFFF6C9", "%+X",
-__LINE__, 0xffffded9L, "FFFFDED9", "%-.1X",
-__LINE__, -0x00fbb5aL, "-1031002", "% 1.0d",
-__LINE__, 0xffffffb7L, "ffffffb7", "%6.x",
-__LINE__, 0xff1b8ac3L, "FF1B8AC3", "%-X",
-__LINE__, 0xfffffff2L, "FFFFFFF2", "%00.X",
-__LINE__, -0x000013dL, " -317", "%05.d",
-__LINE__, 0x0000f5e2L, "+62946", "%+0.2ld",
-__LINE__, 0x16ac6358L, "16ac6358", "%x",
-__LINE__, 0xffff8728L, "FFFF8728", "%+X",
-__LINE__, -0x0014a6dL, "-084589", "%0.6ld",
-__LINE__, 0xfc904514L, "FC904514", "%+0X",
-__LINE__, 0x00000004L, "4", "%ld",
-__LINE__, 0xffffffe0L, "ffffffe0", "%+x",
-__LINE__, -0x0a0ffddL, "-10551261", "%+02d",
-__LINE__, -0x0000bbcL, "-3004", "%+d",
-__LINE__, 0x00000006L, " +6", "%+7ld",
-__LINE__, 0x17afa6e5L, "397387493", "%ld",
-__LINE__, 0xfffff6bfL, "fffff6bf", "%+04.4x",
-__LINE__, 0x000001dcL, "01dc", "% 02.4x",
-__LINE__, 0x0000000eL, " 14", "% d",
-__LINE__, 0xfffffff9L, "0XFFFFFFF9", "%#4.X",
-__LINE__, 0x0000005dL, "93", "%0d",
-__LINE__, -0x004fa05L, "-0326149", "%.7d",
-__LINE__, -0x0000018L, "-24", "%ld",
-__LINE__, 0xfffff7ebL, "FFFFF7EB", "%X",
-__LINE__, 0x0072b044L, " 7516228", "% .7ld",
-__LINE__, 0xffffffedL, "0xffffffed", "%#x",
-__LINE__, 0x0010364dL, "10364D", "%X",
-__LINE__, 0xfff90469L, "0XFFF90469", "%#X",
-__LINE__, 0x000001b4L, " 436", "% 0d",
-__LINE__, 0x00000000L, "0", "% X",
-__LINE__, 0xfffffff3L, "fffffff3", "%x",
-__LINE__, 0x19335d40L, "19335d40", "%6x",
-__LINE__, 0x00039c24L, "236580", "%ld",
-__LINE__, 0x000021f7L, "8695", "%0.4ld",
-__LINE__, -0x057b406L, "-5747718", "%d",
-__LINE__, -0x017b371L, "-1553265", "%#ld",
-__LINE__, 0x0003e405L, "254981", "%2.d",
-__LINE__, 0x00000001L, "1", "%-.1x",
-__LINE__, 0x000000aeL, "AE", "%.1X",
-__LINE__, 0xffd85825L, "ffd85825", "%-7.x",
-__LINE__, 0xfffad763L, "fffad763", "%x",
-__LINE__, 0x002431d4L, "2372052", "%6.ld",
-__LINE__, 0x00000003L, "000003", "%-05.6d",
-__LINE__, 0xffffffebL, "0xffffffeb", "%#x",
-__LINE__, 0xff8cf3b0L, "ff8cf3b0", "%x",
-__LINE__, 0xfe88d2ffL, "0xfe88d2ff", "%+#.2x",
-__LINE__, 0xffffff6bL, "ffffff6b", "%6.3x",
-__LINE__, 0xfffffffeL, "fffffffe", "%-x",
-__LINE__, 0xe998945aL, "e998945a", "%2.x",
-__LINE__, 0x03b9c50fL, "3B9C50F", "%+X",
-__LINE__, 0xffffffffL, "FFFFFFFF", "%3.7X",
-__LINE__, 0x000024efL, "24ef", "%+x",
-__LINE__, 0xfffffc04L, "FFFFFC04", "%X",
-__LINE__, 0x0d4bef7cL, " 223080316", "% .1ld",
-__LINE__, -0xc33f3bcL, "-204731324", "%.5ld",
-__LINE__, 0xffffffffL, "0XFFFFFFFF", "%#2X",
-__LINE__, 0x0000e493L, "e493", "%x",
-__LINE__, 0x000001b4L, "1b4", "%x",
-__LINE__, 0xffffffd6L, "0xffffffd6", "% #1x",
-__LINE__, 0x00000001L, "1", "%d",
-__LINE__, -0x0000f28L, "-3880", "%ld",
-__LINE__, 0x00000277L, "631", "%-1ld",
-__LINE__, 0x00000001L, " 1", "%2x",
-__LINE__, -0x0ff4d2cL, "-16731436", "%#ld",
-__LINE__, 0x0bb80344L, "196608836", "%00ld",
-__LINE__, 0xffffffdcL, "FFFFFFDC", "%X",
-__LINE__, 0x00000484L, "1156", "%ld",
-__LINE__, 0x00000341L, "341", "%-.2x",
-__LINE__, 0x0000ee62L, "ee62", "%x",
-__LINE__, 0xfffffe20L, "fffffe20", "%+x",
-__LINE__, -0x00076ebL, "-30443", "%.2d",
-__LINE__, 0x2c4a7407L, "2c4a7407", "% x",
-__LINE__, 0x00000000L, " ", "%3.X",
-__LINE__, 0xffffff60L, "ffffff60", "% 4.x",
-__LINE__, 0x000e4cf2L, "+937202", "%+.5ld",
-__LINE__, 0x00000008L, " 00008", "%06.5X",
-__LINE__, 0x0002f612L, "194066", "%d",
-__LINE__, 0xfffffc96L, "fffffc96", "%-3.3x",
-__LINE__, -0x0000001L, "-1", "% ld",
-__LINE__, 0x00000000L, " ", "% 6.0X",
-__LINE__, 0xfffffff5L, "fffffff5", "%3.x",
-__LINE__, 0x0bfd63a1L, "201155489", "%d",
-__LINE__, -0x1547c214L, "-357024276", "%ld",
-__LINE__, 0x00000004L, "4", "%#0.d",
-__LINE__, -0x000f2f3L, "-62195", "%.2d",
-__LINE__, 0xfff843ddL, "FFF843DD", "%X",
-__LINE__, 0x00966e36L, "9858614", "%.0ld",
-__LINE__, 0x0000782eL, "0X782E", "% #X",
-__LINE__, 0x00bd36c0L, "12400320", "%ld",
-__LINE__, 0x00000000L, "00", "% .2X",
-__LINE__, 0x00000000L, "0", "%1X",
-__LINE__, 0x0003f416L, "3f416 ", "%-6.x",
-__LINE__, -0x00b74bdL, "-750781", "% ld",
-__LINE__, 0x0000138aL, "138a", "% x",
-__LINE__, 0x024df7f0L, "24DF7F0", "% 0.6X",
-__LINE__, 0xfffffffcL, "FFFFFFFC", "%X",
-__LINE__, -0x0003284L, "-12932 ", "%-07.ld",
-__LINE__, 0x000094d3L, "94d3", "%x",
-__LINE__, 0x000000bfL, "bf", "%.2x",
-__LINE__, 0x00000000L, "00000", "%-1.5X",
-__LINE__, -0x04899b8L, "-4757944", "%d",
-__LINE__, 0x2b51bf20L, "+726777632", "%+d",
-__LINE__, -0x000000dL, "-13", "%.2d",
-__LINE__, 0x04f78fbdL, "4F78FBD", "% 7.X",
-__LINE__, 0x00011684L, "71300", "%5.d",
-__LINE__, 0x0000539dL, "21405", "%0d",
-__LINE__, 0x00000008L, "000008", "%-3.6X",
-__LINE__, 0xfc7a2cdcL, "fc7a2cdc", "%2.3x",
-__LINE__, 0xffc21da1L, "ffc21da1", "%x",
-__LINE__, 0x00000273L, "273", "%x",
-__LINE__, 0x00000000L, "0", "%#X",
-__LINE__, -0x31cd6b9L, "-52221625", "% d",
-__LINE__, 0xfffffff8L, "FFFFFFF8", "%.0X",
-__LINE__, 0x00000002L, "2", "%#ld",
-__LINE__, 0x00e8922cL, "15241772", "%d",
-__LINE__, 0xfeb19ea7L, "FEB19EA7", "%0.1X",
-__LINE__, 0x00003931L, "014641", "%06ld",
-__LINE__, 0x00000015L, "0X00015", "%#.5X",
-__LINE__, 0xfffffffeL, "FFFFFFFE", "%1.X",
-__LINE__, 0xfff17103L, "0XFFF17103", "% #X",
-__LINE__, 0xfffffffcL, "FFFFFFFC", "%+X",
-__LINE__, 0x00000002L, "00002", "%.5x",
-__LINE__, 0x00001617L, " 5655", "% 7.d",
-__LINE__, -0x0000010L, "-000016", "%00.6d",
-__LINE__, 0x000000b0L, "B0", "% X",
-__LINE__, 0xfc9362b2L, "FC9362B2", "%-X",
-__LINE__, 0xfc3d8276L, "fc3d8276", "% 1x",
-__LINE__, 0x00001405L, "5125", "%#d",
-__LINE__, 0x02250183L, " 35979651", "% ld",
-__LINE__, 0xffc9b007L, "ffc9b007", "% 4.x",
-__LINE__, 0x00000311L, "785", "%0d",
-__LINE__, 0x0004d273L, " 316019", "% d",
-__LINE__, 0x00000001L, "1", "%1.x",
-__LINE__, 0xffff240fL, "FFFF240F", "%4.X",
-__LINE__, 0x0049cfdaL, "+4837338", "%+ld",
-__LINE__, 0x012f6dd5L, "12F6DD5", "% 6.2X",
-__LINE__, 0x00000002L, "0x2", "%#2.0x",
-__LINE__, 0xfffd834aL, "FFFD834A", "%.6X",
-__LINE__, 0xfe2a40f8L, "0XFE2A40F8", "%#X",
-__LINE__, 0xffffffebL, "ffffffeb", "%x",
-__LINE__, -0x00ac5cbL, "-705995", "%d",
-__LINE__, -0x3021108cL, "-807473292", "% .4d",
-__LINE__, -0x0000035L, "-53", "%-ld",
-__LINE__, -0x1a36475L, "-27485301", "% d",
-__LINE__, -0x0000011L, "-17", "%d",
-__LINE__, 0x000001a3L, "000419", "%.6ld",
-__LINE__, 0x0030a0a8L, "3186856", "%.5ld",
-__LINE__, 0x00000019L, "25", "%d",
-__LINE__, 0xf32deac1L, "F32DEAC1", "%06.2X",
-__LINE__, -0x0000004L, " -00004", "%7.5ld",
-__LINE__, 0x00000000L, "0", "%ld",
-__LINE__, 0x0006bf19L, "442137", "%#0.d",
-__LINE__, 0x566f6c44L, "1450142788", "%1.6d",
-__LINE__, 0xfffffc10L, "fffffc10", "%.2x",
-__LINE__, -0x000e04dL, "-57421", "%+0d",
-__LINE__, 0x00000000L, "0000000", "%+.7X",
-__LINE__, 0x00b5c74dL, " 11913037", "% ld",
-__LINE__, -0x028dfe2L, "-2678754", "%05.1d",
-__LINE__, 0xfffffee0L, "fffffee0", "%0x",
-__LINE__, -0x030c077L, "-3194999", "%-.6d",
-__LINE__, 0x00055ca1L, "055ca1", "%-.6x",
-__LINE__, 0x00000000L, " ", "%7.X",
-__LINE__, 0xfffffe3bL, "FFFFFE3B", "%X",
-__LINE__, 0xffffffffL, "FFFFFFFF", "% 3X",
-__LINE__, 0x00000857L, "2135", "%-#1.d",
-__LINE__, -0x00546a2L, "-345762", "%0.5d",
-__LINE__, 0x0000000bL, "0xb ", "%-#6x",
-__LINE__, 0x00000d2bL, "d2b ", "%-4.0x",
-__LINE__, 0x0ae02b9eL, "AE02B9E", "%X",
-__LINE__, 0xfffffa7bL, "fffffa7b", "%-2.x",
-__LINE__, 0x00000001L, "1", "%X",
-__LINE__, 0x000006adL, "01709", "%05.5ld",
-__LINE__, -0x0000102L, "-258", "%-0.ld",
-__LINE__, 0x00000000L, "0", "%.1X",
-__LINE__, -0x01daa95L, "-1944213", "%-1ld",
-__LINE__, 0x02b99040L, "2B99040", "%2.X",
-__LINE__, 0x1b3d5621L, "1B3D5621", "%X",
-__LINE__, 0x0312d16bL, "51564907", "%-1.7ld",
-__LINE__, 0x000aa76cL, " 698220", "% 2d",
-__LINE__, 0x00000000L, "0", "%ld",
-__LINE__, 0xfff8a4ecL, "FFF8A4EC", "%-X",
-__LINE__, 0xffffe06dL, "ffffe06d", "%x",
-__LINE__, 0x00000003L, "3", "% x",
-__LINE__, 0x00000000L, "0", "%x",
-__LINE__, 0xd3e244ddL, "D3E244DD", "%+5X",
-__LINE__, 0x000028b3L, " 28b3", "% 5.x",
-__LINE__, 0x0001acebL, "109803", "%6d",
-__LINE__, 0xfffbc5caL, "0xfffbc5ca", "%-#5x",
-__LINE__, 0x00000097L, " 151", "% 7ld",
-__LINE__, 0x00001fccL, "+8140", "%+d",
-__LINE__, 0xffffffffL, "ffffffff", "%0x",
-__LINE__, -0x00052a9L, "-21161", "%ld",
-__LINE__, 0xfffffc76L, "FFFFFC76", "%.1X",
-__LINE__, -0x2acb012L, "-44871698", "%0.1ld",
-__LINE__, 0xffffff81L, "ffffff81", "%x",
-__LINE__, -0x0018394L, "-99220", "%-ld",
-__LINE__, 0x0000001bL, "1B", "%X",
-__LINE__, 0x00000033L, "51", "%1d",
-__LINE__, 0xffec37e5L, "FFEC37E5", "%-1X",
-__LINE__, -0x000000aL, " -10", "%#5.d",
-__LINE__, -0x0000412L, "-1042", "%ld",
-__LINE__, 0x000cd0b1L, "cd0b1 ", "%-7.5x",
-__LINE__, 0x0b445370L, "B445370", "%+2.0X",
-__LINE__, 0xfffffff3L, "0XFFFFFFF3", "%-#X",
-__LINE__, 0xffff9f33L, "FFFF9F33", "%5.X",
-__LINE__, 0x00010a1eL, "10A1E", "%-2X",
-__LINE__, -0xede156fL, "-249435503", "% 7.1ld",
-__LINE__, 0xfc6d63aaL, "fc6d63aa", "% .6x",
-__LINE__, 0x0000311cL, " 12572", "% ld",
-__LINE__, 0x00001f8aL, "8074", "%00.d",
-__LINE__, 0x00000199L, "199", "%-X",
-__LINE__, 0xfffffc60L, "FFFFFC60", "%+3X",
-__LINE__, -0x000022cL, "-556", "%+0ld",
-__LINE__, 0x021d8407L, "35488775", "%-#.7ld",
-__LINE__, 0x0000020fL, "527", "%d",
-__LINE__, -0x000064bL, "-1611", "%#ld",
-__LINE__, -0x0c15aefL, "-12671727", "%d",
-__LINE__, -0x1f1a6881L, "-521824385", "%ld",
-__LINE__, 0xffffc115L, "ffffc115", "% x",
-__LINE__, 0x00000017L, " 23", "% #ld",
-__LINE__, 0x00000dc1L, "DC1 ", "%-4X",
-__LINE__, 0x000002caL, "2CA", "%X",
-__LINE__, 0x000f052cL, " 984364", "%7.d",
-__LINE__, 0x0000005aL, "0090", "%0.4d",
-__LINE__, -0x001e463L, "-124003", "% 4.ld",
-__LINE__, 0x00000001L, "0000001", "%+.7X",
-__LINE__, 0x00000bfbL, "0000bfb", "%5.7x",
-__LINE__, 0x0002484bL, "149579", "%#1d",
-__LINE__, 0x0043ba18L, "4438552", "%-ld",
-__LINE__, 0x000078f8L, "0X78F8", "%#X",
-__LINE__, 0x00000001L, " 1", "%4d",
-__LINE__, 0x0cedaeedL, "CEDAEED", "%X",
-__LINE__, 0x00000003L, "+3", "%+ld",
-__LINE__, 0xfffffffbL, "FFFFFFFB", "%7.4X",
-__LINE__, 0x00000169L, "361", "%ld",
-__LINE__, 0x00003c7aL, "+15482", "%+ld",
-__LINE__, -0x0159d93L, "-1416595", "% 0.0d",
-__LINE__, 0x0000775cL, "+30556", "%+3.d",
-__LINE__, 0x10284768L, "+271075176", "%+0.0ld",
-__LINE__, -0xf8b610eL, "-260792590", "%0d",
-__LINE__, 0xfdd8d369L, "fdd8d369", "%-.3x",
-__LINE__, 0x000c9495L, "+824469", "%+ld",
-__LINE__, -0x000003fL, " -063", "%7.3d",
-__LINE__, -0x000073bL, "-1851", "%+03.ld",
-__LINE__, 0xfffe4e23L, "0xfffe4e23", "%#.5x",
-__LINE__, 0x0081788cL, "81788c", "%5x",
-__LINE__, -0x015f888L, "-1439880", "%+1d",
-__LINE__, -0x31d64b4L, "-52257972", "%0.2d",
-__LINE__, 0xffffffffL, "FFFFFFFF", "%6.5X",
-__LINE__, -0x0000072L, "-114", "%+.1d",
-__LINE__, -0x00000e1L, "-225", "%ld",
-__LINE__, 0x000006a8L, "0x6a8", "%+#x",
-__LINE__, 0xfffe673aL, "fffe673a", "%01.x",
-__LINE__, 0xfff2ee0dL, "FFF2EE0D", "%-X",
-__LINE__, 0x0290320aL, "43004426", "%0ld",
-__LINE__, -0xeb7a832L, "-246917170", "% ld",
-__LINE__, 0x02ae9265L, "2ae9265", "%1.x",
-__LINE__, 0xffffffd2L, "ffffffd2", "%+2.x",
-__LINE__, 0x00e6e858L, "0xe6e858", "%#0.x",
-__LINE__, 0x00000c4aL, "+3146", "%+3.1d",
-__LINE__, -0x6943c1aL, "-110378010", "% 0ld",
-__LINE__, 0x0167b119L, "167b119", "%0x",
-__LINE__, 0xfffffffeL, "fffffffe", "%+x",
-__LINE__, 0xfffffffeL, "FFFFFFFE", "%X",
-__LINE__, 0x000b861eL, "755230", "%ld",
-__LINE__, 0x0000015bL, "347", "%-#ld",
-__LINE__, 0xfffffffaL, "0XFFFFFFFA", "%#X",
-__LINE__, 0x000de9e5L, "911845", "%d",
-__LINE__, 0x00000001L, "01", "%.2d",
-__LINE__, 0x000007a5L, "1957", "%0d",
-__LINE__, 0x0000000fL, "f", "%x",
-__LINE__, 0x00c38cbfL, " 12815551", "% .2d",
-__LINE__, -0x7bd1b6eL, "-129833838", "% d",
-__LINE__, -0x000013cL, "-316", "%0d",
-__LINE__, 0x00001aadL, "1AAD", "%-0X",
-__LINE__, 0x0034f903L, "3471619", "%00d",
-__LINE__, 0xff925717L, "ff925717", "%4x",
-__LINE__, 0x00000002L, "02", "%.2d",
-__LINE__, 0x00000f34L, "F34", "%+X",
-__LINE__, 0xffffeefeL, "FFFFEEFE", "%X",
-__LINE__, 0xfffeecb4L, "FFFEECB4", "% 2.X",
-__LINE__, 0x00034421L, "214049", "%0ld",
-__LINE__, 0x00000000L, " 0", "%+6X",
-__LINE__, -0x0000062L, "-98", "%-#2d",
-__LINE__, -0x0000557L, "-1367", "%-4.4d",
-__LINE__, 0xffffe17cL, "FFFFE17C", "%X",
-__LINE__, 0x00000097L, "00097", "%.5X",
-__LINE__, 0xfffcb278L, "FFFCB278", "%0.7X",
-__LINE__, -0x0000001L, "-0001 ", "%-7.4d",
-__LINE__, -0x0000001L, "-1", "%ld",
-__LINE__, 0x000002c4L, "708", "%d",
-__LINE__, 0x04946f45L, "4946F45", "%-2.X",
-__LINE__, 0x000000ffL, "00ff", "% 2.4x",
-__LINE__, 0x00073307L, "471815", "%3ld",
-__LINE__, 0x0085b7b6L, "+8763318", "%+ld",
-__LINE__, -0x0000002L, "-2", "%1ld",
-__LINE__, -0x0000001L, "-1", "%-2d",
-__LINE__, -0x00000b5L, " -181", "%7ld",
-__LINE__, -0x0412486L, "-4269190", "%+2.1ld",
-__LINE__, 0xffffffffL, "ffffffff", "%0x",
-__LINE__, 0x0000006dL, "6d", "%x",
-__LINE__, 0x000000daL, "218", "%-.3ld",
-__LINE__, 0xfffffcfeL, "fffffcfe", "%x",
-__LINE__, 0x652e60c7L, "652E60C7", "%7.7X",
-__LINE__, 0x00000035L, " 53", "% #2d",
-__LINE__, 0x000000fcL, "FC", "%-X",
-__LINE__, 0x00000019L, " 25", "% ld",
-__LINE__, 0xfffffcf4L, "fffffcf4", "%6x",
-__LINE__, 0xffffff41L, "ffffff41", "%x",
-__LINE__, 0x00000034L, " 52", "%3.ld",
-__LINE__, 0xffffffb2L, "ffffffb2", "%-x",
-__LINE__, -0x6dc43e7cL, "-1841577596", "% .2ld",
-__LINE__, 0x00000004L, "4", "%d",
-__LINE__, -0x000023bL, "-571", "%ld",
-__LINE__, -0x000004dL, "-77", "%ld",
-__LINE__, 0x0000e3baL, "58298", "%.0ld",
-__LINE__, 0xfffffff2L, "fffffff2", "%0.0x",
-__LINE__, -0x0000020L, "-32", "%ld",
-__LINE__, 0xffffb33eL, "0XFFFFB33E", "%-#X",
-__LINE__, 0x00000000L, " ", "% 4.x",
-__LINE__, 0xffd96f92L, "FFD96F92", "%X",
-__LINE__, 0x0000002eL, " 46", "% 0ld",
-__LINE__, 0xffffffffL, "ffffffff", "%x",
-__LINE__, -0x5008ba3L, "-83921827", "%+d",
-__LINE__, 0xfdc1df3dL, "FDC1DF3D", "%0X",
-__LINE__, 0xfc7410e5L, "fc7410e5", "%7x",
-__LINE__, 0xfffffffaL, "FFFFFFFA", "% 6.X",
-__LINE__, 0x00000000L, "0", "%X",
-__LINE__, -0x040fd4eL, "-4259150", "% 05.d",
-__LINE__, 0x0000003bL, " 59", "%3.2d",
-__LINE__, 0xff776dd8L, "ff776dd8", "%x",
-__LINE__, 0x0000055bL, "+1371", "%+#2d",
-__LINE__, 0x00004841L, "4841", "%.1x",
-__LINE__, 0x0229d710L, "36296464", "%-.2ld",
-__LINE__, 0x00000000L, "0", "%x",
-__LINE__, 0xfffe8376L, "fffe8376", "%0x",
-__LINE__, 0x000a7b83L, "a7b83", "%x",
-__LINE__, 0x0000000dL, " 013", "%#7.3d",
-__LINE__, 0xffffffffL, "FFFFFFFF", "%5.0X",
-__LINE__, 0x00000704L, " 0x704", "%#7.0x",
-__LINE__, 0xfff970b9L, "FFF970B9", "%.1X",
-__LINE__, -0x000b60aL, "-46602", "%+d",
-__LINE__, 0x00000000L, " 00000", "%6.5x",
-__LINE__, 0x00000003L, "3", "%X",
-__LINE__, 0x0000c14bL, "c14b", "%0x",
-__LINE__, 0x066d7860L, "107837536", "%-d",
-__LINE__, 0x00000013L, " 13", "%4.x",
-__LINE__, 0xfff96f18L, "FFF96F18", "%4X",
-__LINE__, 0xffffff30L, "FFFFFF30", "%X",
-__LINE__, 0xffffffffL, "FFFFFFFF", "% .7X",
-__LINE__, -0x72a9e985L, "-1923737989", "%2.d",
-__LINE__, 0x00000002L, "0x2", "%#x",
-__LINE__, 0x0000050eL, "50e", "%2.3x",
-__LINE__, 0x0000605cL, "24668", "%4.1d",
-__LINE__, 0xffffff3eL, "ffffff3e", "%x",
-__LINE__, -0x0000010L, "-16", "%-2d",
-__LINE__, 0x000061aaL, "61AA", "%X",
-__LINE__, 0x000c2ec3L, "C2EC3", "%0X",
-__LINE__, -0x0000001L, "-1", "%-0d",
-__LINE__, 0x00130e17L, "+1248791", "%+.6ld",
-__LINE__, 0x000000efL, "EF", "%-X",
-__LINE__, -0x0000001L, " -1", "%+5ld",
-__LINE__, 0x0000989dL, "39069", "%d",
-__LINE__, 0x00000000L, "0", "%-x",
-__LINE__, 0x00000417L, "417", "%X",
-__LINE__, 0x00005e86L, "5E86", "%+X",
-__LINE__, -0x0007c08L, "-31752", "%ld",
-__LINE__, 0x00da8e0fL, "DA8E0F", "%2.2X",
-__LINE__, -0x3ee095ecL, "-1054905836", "% 0d",
-__LINE__, 0xfffdb5a3L, "fffdb5a3", "%x",
-__LINE__, 0xffffff83L, "FFFFFF83", "%X",
-__LINE__, 0xfff8efd7L, "0xfff8efd7", "%#x",
-__LINE__, 0x00000020L, " 32", "% d",
-__LINE__, 0xfff7c002L, "fff7c002", "%.7x",
-__LINE__, -0x0000001L, "-1", "%ld",
-__LINE__, 0x00000000L, " 000", "%05.3X",
-__LINE__, 0xfff190eeL, "FFF190EE", "%X",
-__LINE__, 0x00000a6cL, " 2668", "%#6.ld",
-__LINE__, 0x00037024L, "37024", "%x",
-__LINE__, 0xfffec37fL, "FFFEC37F", "%X",
-__LINE__, 0x007ee9bbL, "8317371", "%#0.ld",
-__LINE__, 0x00000122L, "290", "%ld",
-__LINE__, -0x0013b5fL, "-80735", "%ld",
-__LINE__, 0xfffffff6L, "FFFFFFF6", "%X",
-__LINE__, -0x0000c16L, "-0003094", "%-00.7d",
-__LINE__, -0x00010edL, "-4333", "%ld",
-__LINE__, 0x00000007L, " 0X007", "%#6.3X",
-__LINE__, 0x0053781eL, " 5470238", "% 2d",
-__LINE__, 0xffff03e9L, "0XFFFF03E9", "%+#7.3X",
-__LINE__, 0xfffffdc2L, "0xfffffdc2", "% #4.x",
-__LINE__, -0x00018e1L, "-6369", "%d",
-__LINE__, 0xf3a4abc6L, "F3A4ABC6", "%-.2X",
-__LINE__, 0xfff64a27L, "FFF64A27", "%7.7X",
-__LINE__, 0x00195ae5L, "195AE5", "%+03.X",
-__LINE__, 0xfff8849aL, "fff8849a", "%.1x",
-__LINE__, -0x001b045L, "-110661", "%+ld",
-__LINE__, 0x01e8a106L, "32022790", "%7.ld",
-__LINE__, 0x0008ee94L, "8EE94", "%X",
-__LINE__, 0xfffcdabcL, "FFFCDABC", "%X",
-__LINE__, 0xfda75cd2L, "fda75cd2", "%x",
-__LINE__, 0x00fd505aL, "fd505a", "%x",
-__LINE__, 0x00003748L, "3748", "%+x",
-__LINE__, 0xffffffe5L, "ffffffe5", "% 3.6x",
-__LINE__, -0x1d1c4045L, "-488390725", "%d",
-__LINE__, 0xfffffff9L, "0xfffffff9", "%#x",
-__LINE__, -0x0000001L, "-1", "%-#ld",
-__LINE__, 0x00000191L, "191", "%X",
-__LINE__, 0xfffffffeL, "FFFFFFFE", "%-X",
-__LINE__, -0x0000006L, "-6", "%ld",
-__LINE__, 0x00000033L, " 33", "% 4x",
-__LINE__, -0x0159a14L, "-1415700", "% ld",
-__LINE__, 0x000001c3L, "00001c3", "%07x",
-__LINE__, 0xffffe9e2L, "ffffe9e2", "%-x",
-__LINE__, 0x5b19abd9L, "0x5b19abd9", "%-#x",
-__LINE__, 0xffff1baeL, "0xffff1bae", "%#x",
-__LINE__, 0x00000001L, "+1", "%+d",
-__LINE__, 0x006a23c7L, "6A23C7", "%2.X",
-__LINE__, 0x000008a4L, " 8a4", "% 4.1x",
-__LINE__, 0xfffffcd9L, "fffffcd9", "%.1x",
-__LINE__, 0x0000121bL, "121B", "%X",
-__LINE__, 0x001231aaL, "1192362", "%7.d",
-__LINE__, -0x008026dL, "-524909", "%4.2d",
-__LINE__, 0x192ea594L, "422487444", "%ld",
-__LINE__, 0x0001a800L, "108544", "%0d",
-__LINE__, 0x000062f1L, "62f1", "%.4x",
-__LINE__, 0xff8b39b0L, "ff8b39b0", "% x",
-__LINE__, 0x00000001L, "0x1", "%+#x",
-__LINE__, 0x0000144aL, "5194", "%ld",
-__LINE__, 0x00002599L, "9625", "%d",
-__LINE__, 0xffa0a2efL, "ffa0a2ef", "%0x",
-__LINE__, 0xff6712e1L, "FF6712E1", "%0X",
-__LINE__, 0x0007ebb3L, "519091", "%1ld",
-__LINE__, 0x0000000fL, "15 ", "%-4.ld",
-__LINE__, -0x0000096L, "-150", "%2.ld",
-__LINE__, 0x0000004fL, "4F", "%.2X",
-__LINE__, 0xfffffc29L, "fffffc29", "%-4.x",
-__LINE__, 0x00000019L, "19", "%x",
-__LINE__, 0x00000c4eL, "c4e", "%x",
-__LINE__, 0x0000006bL, " 0006B", "%6.5X",
-__LINE__, 0x00c8d2c6L, "c8d2c6", "%.0x",
-__LINE__, -0x256fb8deL, "-628078814", "%ld",
-__LINE__, 0x4f51fcf4L, "4F51FCF4", "%+X",
-__LINE__, 0x000f000eL, "983054", "%1.ld",
-__LINE__, 0xfffff03fL, "fffff03f", "%x",
-__LINE__, 0x0000001dL, " 1D", "%05.X",
-__LINE__, 0x0072ea14L, "72ea14", "%x",
-__LINE__, -0xc6098b9L, "-207657145", "%-7d",
-__LINE__, 0x00000a76L, "2678", "%3ld",
-__LINE__, 0xfff84db3L, "FFF84DB3", "%X",
-__LINE__, 0x0fb52870L, "fb52870", "%+x",
-__LINE__, 0x08bc170aL, "0x8bc170a", "%#x",
-__LINE__, 0xfffeeb00L, "fffeeb00", "%0.5x",
-__LINE__, 0x000ece95L, "970389", "%d",
-__LINE__, 0x00000000L, "0", "%0X",
-__LINE__, 0x07f98e8aL, "7f98e8a", "% x",
-__LINE__, 0x000499ebL, " 499eb", "% 6.x",
-__LINE__, 0xffffffffL, "FFFFFFFF", "%-X",
-__LINE__, 0x0aa45e86L, "178544262", "%#.2d",
-__LINE__, 0xff73387dL, "FF73387D", "%03.X",
-__LINE__, 0xfffffb51L, "FFFFFB51", "%.3X",
-__LINE__, 0xffffffdcL, "ffffffdc", "%6.x",
-__LINE__, 0xffffffedL, "FFFFFFED", "%-X",
-__LINE__, 0x0001c4c2L, "1c4c2", "%0.3x",
-__LINE__, -0x0000001L, "-0000001", "%-#.7d",
-__LINE__, 0x00000007L, "7", "%0.x",
-__LINE__, 0x00000001L, "1", "%ld",
-__LINE__, 0xffffd000L, "ffffd000", "%4.3x",
-__LINE__, 0x00000030L, "48", "%2.d",
-__LINE__, -0x6c121ceL, "-113320398", "%.5ld",
-__LINE__, 0x000001edL, "1ED", "% 3.X",
-__LINE__, 0xfffff0f3L, "FFFFF0F3", "%+.6X",
-__LINE__, 0xffffffecL, "ffffffec", "%x",
-__LINE__, 0x002d5ab8L, "0x2d5ab8", "%-#x",
-__LINE__, 0x0026acffL, "2534655", "%0ld",
-__LINE__, 0x01d90cd7L, "+31001815", "%+.2ld",
-__LINE__, -0x1f7abc0L, "-33008576", "%7.6d",
-__LINE__, 0xfc5babccL, "fc5babcc", "%x",
-__LINE__, -0x9b74892L, "-163006610", "% .6d",
-__LINE__, 0x03931d84L, "59972996", "%0.d",
-__LINE__, 0x07d261ceL, "131228110", "%#ld",
-__LINE__, 0x00000000L, "0", "%x",
-__LINE__, 0x00000002L, "2", "%+X",
-__LINE__, -0x0000604L, "-1540", "%+d",
-__LINE__, 0x00000000L, " ", "%7.x",
-__LINE__, 0x00000001L, "1", "%.0X",
-__LINE__, -0x0005a8eL, "-23182", "% d",
-__LINE__, 0x03fb2730L, "3fb2730", "%7.x",
-__LINE__, 0xffffff03L, "ffffff03", "%x",
-__LINE__, 0x00000000L, " ", "%-#3.d",
-__LINE__, 0x04025a4bL, "0X4025A4B", "%+#X",
-__LINE__, -0x0000001L, " -1", "%4.d",
-__LINE__, 0xfffe00a3L, "FFFE00A3", "%+X",
-__LINE__, -0x1b26e3c8L, "-455533512", "% ld",
-__LINE__, 0x000017e5L, "6117", "%d",
-__LINE__, -0x0e4f3b6L, "-15004598", "%0ld",
-__LINE__, 0x00000034L, "52", "%ld",
-__LINE__, 0x0000024cL, " 24C", "%4X",
-__LINE__, 0xfffedf65L, "FFFEDF65", "%-0X",
-__LINE__, -0x000ff1fL, "-65311", "%+#d",
-__LINE__, 0x00000007L, " 7", "%7.x",
-__LINE__, 0x018656aeL, "18656ae", "%3.7x",
-__LINE__, -0x0000004L, "-4", "%d",
-__LINE__, 0x7081292dL, "1887512877", "%d",
-__LINE__, 0x87d3e48cL, "87d3e48c", "%-x",
-__LINE__, 0xf99c516eL, "0xf99c516e", "% #7.4x",
-__LINE__, 0xfffffffaL, "FFFFFFFA", "%-1X",
-__LINE__, -0x000001dL, "-29", "%#ld",
-__LINE__, -0x0000001L, "-1", "%+ld",
-__LINE__, 0x28ab3350L, " 682308432", "% 1d",
-__LINE__, -0x0000006L, "-6", "%ld",
-__LINE__, 0xfffffffbL, "FFFFFFFB", "%.5X",
-__LINE__, -0x0000007L, "-7", "%#d",
-__LINE__, -0x0000328L, " -808", "%6.ld",
-__LINE__, -0x29386f00L, "-691564288", "%.3d",
-__LINE__, -0x059f38aL, "-5895050", "%.4ld",
-__LINE__, 0xfffff888L, "FFFFF888", "%3X",
-__LINE__, 0xffffffdfL, "ffffffdf", "%0.0x",
-__LINE__, -0xb4fc354L, "-189776724", "%2d",
-__LINE__, 0x00058c07L, "363527", "%1.d",
-__LINE__, 0x0a256162L, "a256162", "%x",
-__LINE__, -0x05c87b0L, "-6064048", "%0ld",
-__LINE__, 0xfffffda1L, "fffffda1", "%x",
-__LINE__, 0x000034b7L, "13495", "%d",
-__LINE__, -0x6d1a8918L, "-1830455576", "%.1d",
-__LINE__, 0x00022290L, "139920", "%05ld",
-__LINE__, 0x00000000L, "0", "%-x",
-__LINE__, -0x1f8eafceL, "-529444814", "%4.d",
-__LINE__, -0x7bf32808L, "-2079533064", "% ld",
-__LINE__, 0x0000023cL, "23c", "% x",
-__LINE__, 0x00000039L, "39", "%X",
-__LINE__, -0x000556dL, "-21869", "%ld",
-__LINE__, -0x00000caL, "-202", "%ld",
-__LINE__, 0x00002e28L, "11816", "%-d",
-__LINE__, 0x00000011L, "17", "%-ld",
-__LINE__, 0xfffffffbL, "FFFFFFFB", "%-X",
-__LINE__, 0xfffdd67fL, "0XFFFDD67F", "%#X",
-__LINE__, -0x000003dL, "-61", "%d",
-__LINE__, 0x0000bfceL, "0XBFCE", "%-#5.2X",
-__LINE__, 0xfffffffcL, "fffffffc", "%x",
-__LINE__, -0x00aea17L, "-715287", "%.5d",
-__LINE__, -0x02fce89L, "-3133065", "%0d",
-__LINE__, 0x007f6ed1L, "7F6ED1", "%6X",
-__LINE__, 0xffffffffL, "FFFFFFFF", "%X",
-__LINE__, -0x0002761L, "-10081", "%#6.2d",
-__LINE__, 0x003be8d8L, "3BE8D8", "%-X",
-__LINE__, 0x00000901L, " 2305", "%6.d",
-__LINE__, 0x00049916L, "0301334", "%3.7ld",
-__LINE__, 0x0678ffeaL, "0X678FFEA", "%#4X",
-__LINE__, 0xffffffffL, "ffffffff", "%+.0x",
-__LINE__, -0x31d2ec61L, "-835906657", "%.0d",
-__LINE__, 0xfffffffcL, "FFFFFFFC", "%0X",
-__LINE__, -0x0015588L, "-87432", "%d",
-__LINE__, 0xffffff3eL, "ffffff3e", "%.4x",
-__LINE__, 0x0000000aL, "10", "%d",
-__LINE__, -0x0000003L, "-3", "%2.1ld",
-__LINE__, -0x000d29aL, "-53914", "%ld",
-__LINE__, -0x04ccbe0L, "-5032928", "%2.2ld",
-__LINE__, 0x0357c2a5L, "357c2a5", "% 7.x",
-__LINE__, 0x00000009L, " 9", "% 1.ld",
-__LINE__, -0x005908dL, "-364685", "%0d",
-__LINE__, -0x0000de6L, "-3558", "%0ld",
-__LINE__, 0x2d395e6bL, "+758734443", "%+6d",
-__LINE__, 0x001aba58L, "1ABA58", "% X",
-__LINE__, 0x0ceba5abL, "0XCEBA5AB", "%#.1X",
-__LINE__, -0x01a8575L, "-1738101", "% 2ld",
-__LINE__, 0x0000000dL, "13", "%#ld",
-__LINE__, 0x00000000L, "0", "%d",
-__LINE__, 0x4b856407L, "4b856407", "%5x",
-__LINE__, 0x006f333cL, "6F333C", "%-X",
-__LINE__, 0x000000d0L, "d0", "%x",
-__LINE__, 0x2ecf0d4eL, "2ecf0d4e", "%0x",
-__LINE__, -0x0000188L, "-0000392", "%#1.7ld",
-__LINE__, -0x0000037L, "-55", "%d",
-__LINE__, 0xfffffff1L, "FFFFFFF1", "% .1X",
-__LINE__, 0x00000001L, "0x1", "%#3x",
-__LINE__, 0x000005edL, "5ED", "%3X",
-__LINE__, 0x031183a3L, "31183A3", "%X",
-__LINE__, 0xffffffffL, "ffffffff", "%x",
-__LINE__, -0x0018695L, "-99989", "%-0.5ld",
-__LINE__, -0x0000001L, "-01", "%0.2ld",
-__LINE__, 0x00007822L, "7822", "%+x",
-__LINE__, 0x00000000L, "0", "% x",
-__LINE__, 0xfda2461aL, "FDA2461A", "%X",
-__LINE__, 0x065c50efL, "106713327", "%2.ld",
-__LINE__, 0x00000a81L, "a81", "% 0x",
-__LINE__, -0x000022eL, "-558", "%.0ld",
-__LINE__, 0x00013d2fL, "81199", "%.2ld",
-__LINE__, 0xfffffffeL, "FFFFFFFE", "%+X",
-__LINE__, 0x000015f9L, "5625", "%04.ld",
-__LINE__, 0x0ab575a2L, "179664290", "%0d",
-__LINE__, 0x0024d07fL, "0X24D07F", "%#X",
-__LINE__, 0x07ee35e1L, "7EE35E1", "%+X",
-__LINE__, -0x00c114cL, "-790860", "%#ld",
-__LINE__, 0x00003be3L, " 15331", "%07.d",
-__LINE__, 0xfff87570L, "FFF87570", "%4.0X",
-__LINE__, -0x14eab419L, "-350925849", "%-ld",
-__LINE__, -0x000001bL, "-27", "%ld",
-__LINE__, 0x167ce2eaL, "0x167ce2ea", "%#0.x",
-__LINE__, -0x00009bcL, "-002492", "% 3.6d",
-__LINE__, 0xfffffdb9L, "0XFFFFFDB9", "%#7.X",
-__LINE__, 0x008b2b9dL, "8B2B9D", "% X",
-__LINE__, 0x000cfec3L, "CFEC3", "% 05X",
-__LINE__, 0x05970be6L, "5970be6", "%x",
-__LINE__, 0x00002780L, "010112", "%2.6d",
-__LINE__, 0x00000005L, "+5", "%+d",
-__LINE__, 0xfffffffbL, "0xfffffffb", "%#3.x",
-__LINE__, 0x00000001L, "1 ", "%-#5.ld",
-__LINE__, -0x0000017L, "-23", "%ld",
-__LINE__, -0x023b943L, "-2341187", "%d",
-__LINE__, 0x0000000dL, "13", "%ld",
-__LINE__, 0x00025a03L, "25a03", "% .5x",
-__LINE__, 0x3e1ebe24L, "3e1ebe24", "% x",
-__LINE__, 0x0000013aL, "0x13a", "%#5.0x",
-__LINE__, 0xfff6f5b3L, "FFF6F5B3", "%4.X",
-__LINE__, -0x0000a8aL, "-2698", "%.3d",
-__LINE__, 0x0009dd5fL, "9dd5f", "%x",
-__LINE__, 0x000003c7L, " 3C7", "%04.2X",
-__LINE__, 0x1bcfa2f2L, "1bcfa2f2", "%+1.x",
-__LINE__, 0x0001b4f4L, "1b4f4", "%+1.x",
-__LINE__, 0x1bc19a90L, "465672848", "%#d",
-__LINE__, 0xffffffffL, "ffffffff", "%+06x",
-__LINE__, -0x0000a88L, "-2696", "%3.d",
-__LINE__, 0x00084a19L, "84A19", "%-X",
-__LINE__, 0xffe1fc8fL, "FFE1FC8F", "%0.1X",
-__LINE__, -0x0000a3aL, "-2618", "%5d",
-__LINE__, -0x0000001L, "-1", "%ld",
-__LINE__, -0x5c6183dL, "-96868413", "%+ld",
-__LINE__, -0x0000001L, "-1", "%-d",
-__LINE__, 0x0000faa8L, "64168", "%05.d",
-__LINE__, 0x003913efL, "3740655", "%ld",
-__LINE__, 0x0dde330aL, "232665866", "%#ld",
-__LINE__, 0xfcfb1a7bL, "FCFB1A7B", "%+X",
-__LINE__, 0x07b1a81fL, " 129083423", "% 0d",
-__LINE__, 0x00000001L, "1", "%d",
-__LINE__, 0x00000070L, " 112", "%5ld",
-__LINE__, 0xffff74d9L, "ffff74d9", "%x",
-__LINE__, -0x001ab93L, "-109459", "%03.d",
-__LINE__, 0x0eb6b497L, "EB6B497", "%+X",
-__LINE__, 0x07adbac2L, "128826050", "%#0.4d",
-__LINE__, 0xff747068L, "FF747068", "%6.X",
-__LINE__, -0x190ce98fL, "-420276623", "%06.6ld",
-__LINE__, -0x0000007L, "-7", "%.0d",
-__LINE__, 0x0001240fL, "1240f", "% 3x",
-__LINE__, 0x267ae4a0L, "645588128", "%-#ld",
-__LINE__, -0x0000001L, "-1", "% ld",
-__LINE__, -0x0000066L, "-00102", "%.5ld",
-__LINE__, 0x868fa035L, "868fa035", "%x",
-__LINE__, 0x00000000L, " ", "%-4.ld",
-__LINE__, 0xfffffe72L, "FFFFFE72", "%4.4X",
-__LINE__, 0x00a6b4f4L, "10925300", "%#ld",
-__LINE__, -0x0000002L, "-2", "%00.1d",
-__LINE__, -0x00000a3L, "-163", "%ld",
-__LINE__, 0xfffffffeL, "fffffffe", "% 3.x",
-__LINE__, 0xffe25941L, "ffe25941", "% x",
-__LINE__, 0x0000a20fL, "41487", "%ld",
-__LINE__, -0x000009bL, "-155", "%#.3ld",
-__LINE__, 0x000c5dc1L, "810433", "%4.ld",
-__LINE__, 0x00003ec4L, "16068", "%ld",
-__LINE__, 0x000002f3L, "0755", "%04ld",
-__LINE__, 0xffffff28L, "FFFFFF28", "%.5X",
-__LINE__, -0x08450ffL, "-8671487", "%-3.0ld",
-__LINE__, 0x00000092L, "92", "%x",
-__LINE__, -0x0000317L, "-791", "%d",
-__LINE__, 0x0000000dL, "d", "%x",
-__LINE__, 0x00000036L, "36", "%x",
-__LINE__, -0x112693fL, "-17983807", "%ld",
-__LINE__, 0x00004226L, "16934", "%0.d",
-__LINE__, 0x000001baL, " 442", "% ld",
-__LINE__, 0xfffffffcL, "0XFFFFFFFC", "%#4X",
-__LINE__, 0xffdb3d23L, "0xffdb3d23", "% #x",
-__LINE__, 0x039eb84dL, "39EB84D", "%+.6X",
-__LINE__, 0xffffc7daL, "ffffc7da", "%0x",
-__LINE__, 0xfffffdb6L, "FFFFFDB6", "%6X",
-__LINE__, 0x001b75b0L, "1799600", "%ld",
-__LINE__, 0xfffffca2L, "FFFFFCA2", "%-X",
-__LINE__, 0xffffffbaL, "ffffffba", "%7.4x",
-__LINE__, -0x000124eL, "-4686", "%3.ld",
-__LINE__, -0x000bec0L, "-48832", "% 0d",
-__LINE__, 0xfffffca0L, "fffffca0", "%2.x",
-__LINE__, 0x00b2a462L, "11707490", "%ld",
-__LINE__, 0x0745a647L, "745a647", "%+4.x",
-__LINE__, 0xfffffbacL, "0XFFFFFBAC", "%#3.X",
-__LINE__, -0x0000002L, "-2", "%-0.1d",
-__LINE__, 0x0006cfdbL, "446427", "%#5.d",
-__LINE__, -0x0000001L, "-1", "%d",
-__LINE__, 0x043b134eL, "43B134E", "%X",
-__LINE__, -0x0000015L, "-21", "%ld",
-__LINE__, -0x0000114L, "-276", "%0d",
-__LINE__, -0x0004d4aL, "-19786", "%-d",
-__LINE__, -0x000001cL, "-28", "%ld",
-__LINE__, -0x0cb89fcL, "-13339132", "%ld",
-__LINE__, 0xffffffcfL, "ffffffcf", "%x",
-__LINE__, 0xf6d2387aL, "f6d2387a", "%-x",
-__LINE__, -0x00000cdL, "-205", "%#ld",
-__LINE__, 0x00000000L, "0", "%#x",
-__LINE__, 0xfffffc81L, "fffffc81", "%x",
-__LINE__, 0x00000000L, " 0", "% ld",
-__LINE__, 0x00024fb5L, "24fb5", "%x",
-__LINE__, 0x000012faL, "12FA", "%X",
-__LINE__, 0x0318ce7cL, "51957372", "%0d",
-__LINE__, 0x02280a99L, "2280a99", "%-x",
-__LINE__, 0xffffff5cL, "FFFFFF5C", "%2.X",
-__LINE__, -0x000002eL, " -46", "%7ld",
-__LINE__, -0x04a73e8L, "-4879336", "%4ld",
-__LINE__, 0x000007f3L, "7f3", "% 1.3x",
-__LINE__, 0x00000114L, "0x114", "%#x",
-__LINE__, 0x0000030cL, "30c", "%-x",
-__LINE__, 0x001dd0ddL, "0x1dd0dd", "%+#5.5x",
-__LINE__, 0xfff23de3L, "fff23de3", "%-x",
-__LINE__, -0x0178f9cL, "-1544092", "%d",
-__LINE__, 0x02ded8daL, "2DED8DA", "%X",
-__LINE__, -0x0991672L, "-10032754", "%3.d",
-__LINE__, 0x6943c150L, "6943c150", "%x",
-__LINE__, 0xffffc25dL, "FFFFC25D", "%4X",
-__LINE__, 0x00000c9cL, " 0003228", "% .7d",
-__LINE__, 0xffffffdfL, "FFFFFFDF", "% 6.X",
-__LINE__, 0x0001a145L, " 1a145", "%6.0x",
-__LINE__, 0xffdc832fL, "0xffdc832f", "%#.1x",
-__LINE__, 0x00699f7bL, "699f7b", "%x",
-__LINE__, 0xf9575268L, "F9575268", "%+0X",
-__LINE__, 0x04eb4783L, "82528131", "%-ld",
-__LINE__, -0x0000023L, "-35", "%0ld",
-__LINE__, -0x012b08aL, "-1224842", "%0d",
-__LINE__, 0xffffb587L, "FFFFB587", "%X",
-__LINE__, 0xffffffe9L, "ffffffe9", "%x",
-__LINE__, 0x006b5596L, " 7034262", "% 0d",
-__LINE__, 0x004d0d2aL, "+5049642", "%+ld",
-__LINE__, -0x002a099L, "-172185", "%d",
-__LINE__, 0x00000224L, "548", "%ld",
-__LINE__, 0x03e0cca8L, "65064104", "%d",
-__LINE__, -0x7bb389dL, "-129710237", "%.3ld",
-__LINE__, 0xffc630f5L, "ffc630f5", "%-07.0x",
-__LINE__, 0xfffffff8L, "FFFFFFF8", "%X",
-__LINE__, 0x0030225bL, "3154523", "%#d",
-__LINE__, 0xff7f4e28L, "ff7f4e28", "%+4.x",
-__LINE__, 0x14ee154dL, "+351147341", "%+ld",
-__LINE__, 0x00000003L, "03", "%.2d",
-__LINE__, 0xfe0359d6L, "fe0359d6", "%x",
-__LINE__, 0x002b71c3L, "2847171", "%d",
-__LINE__, 0x055c4d4aL, "55C4D4A", "%-X",
-__LINE__, 0xfffb17d2L, "fffb17d2", "% .0x",
-__LINE__, 0x00000002L, "2", "%x",
-__LINE__, 0x000018e1L, "18E1", "%1.1X",
-__LINE__, 0x00000331L, "817", "%0d",
-__LINE__, -0x0000982L, "-2434 ", "%-06.ld",
-__LINE__, -0x0000168L, "-0000360", "%.7ld",
-__LINE__, 0xffffffe9L, "FFFFFFE9", "%-0.4X",
-__LINE__, 0xe42084efL, "E42084EF", "%X",
-__LINE__, 0x000000aaL, "aa", "%x",
-__LINE__, -0xe8b98b5L, "-244029621", "%+d",
-__LINE__, -0x00000d9L, "-217", "%+2.d",
-__LINE__, 0x0000027bL, "27B", "%+.0X",
-__LINE__, 0x002e52dbL, "3035867", "%-ld",
-__LINE__, -0x00e2ba8L, "-928680", "%0.2ld",
-__LINE__, 0x003b74d8L, "3B74D8", "%X",
-__LINE__, -0x000006fL, "-111", "%+ld",
-__LINE__, 0xf8507e22L, "0XF8507E22", "%-#X",
-__LINE__, 0x0629f4c0L, "103412928", "%-ld",
-__LINE__, -0x000002dL, "-45", "%0d",
-__LINE__, -0x0001db0L, "-7600", "%d",
-__LINE__, -0x00001bbL, " -443", "%5.ld",
-__LINE__, 0xffffd2b9L, "ffffd2b9", "%+x",
-__LINE__, 0xffffe685L, "0XFFFFE685", "%#0.7X",
-__LINE__, 0x0000a4ceL, "A4CE", "% X",
-__LINE__, 0xffffffffL, "FFFFFFFF", "%X",
-__LINE__, 0x0000000cL, "C", "% X",
-__LINE__, 0xfff59369L, "FFF59369", "%7X",
-__LINE__, 0x00000156L, " 156", "%5.X",
-__LINE__, 0x02833aa9L, "+42154665", "%+2d",
-__LINE__, 0x0004a8f3L, "+305395", "%+d",
-__LINE__, 0x01a09267L, "1A09267", "%0.3X",
-__LINE__, 0x000004f1L, "4f1", "%x",
-__LINE__, 0x00000005L, "5", "%x",
-__LINE__, 0x00000119L, " 0281", "% #2.4ld",
-__LINE__, -0x0001a2aL, "-6698", "%ld",
-__LINE__, 0xa3633a57L, "A3633A57", "%7X",
-__LINE__, -0x10bd2970L, "-280832368", "%-d",
-__LINE__, 0xffff9c38L, "ffff9c38", "%x",
-__LINE__, 0xffdbe81eL, "ffdbe81e", "%+6.7x",
-__LINE__, 0xffffffe7L, "FFFFFFE7", "%-3.0X",
-__LINE__, 0x0002f6d6L, "2f6d6", "%5.x",
-__LINE__, 0xffffffffL, "ffffffff", "% x",
-__LINE__, 0xffc2c07aL, "ffc2c07a", "%0.x",
-__LINE__, 0xfcc0e13aL, "FCC0E13A", "%X",
-__LINE__, 0x0000000dL, "d", "% x",
-__LINE__, 0x0016cac8L, "16CAC8", "%-0.3X",
-__LINE__, 0x00945dc1L, "9723329", "%2d",
-__LINE__, 0xf19a1cd1L, "F19A1CD1", "%-X",
-__LINE__, 0x00000003L, "+3", "%+ld",
-__LINE__, 0x00000773L, "1907", "%ld",
-__LINE__, 0x000263e6L, "263e6", "%-x",
-__LINE__, -0x0238b55L, "-2329429", "%d",
-__LINE__, 0x00006c56L, "6C56", "%X",
-__LINE__, 0x0000f34bL, "62283", "%#.0ld",
-__LINE__, -0x1620e21L, "-23203361", "%0ld",
-__LINE__, 0xf9257d6aL, "f9257d6a", "%2x",
-__LINE__, -0x00ed463L, "-971875", "%03.d",
-__LINE__, 0x02bb94c6L, "45847750", "%d",
-__LINE__, 0xffffd20cL, "0XFFFFD20C", "%#X",
-__LINE__, 0x000087d8L, "34776", "%.0d",
-__LINE__, 0xfffffffcL, "FFFFFFFC", "%+7.X",
-__LINE__, -0x0009cd5L, "-40149", "%-ld",
-__LINE__, 0xfffff85eL, "FFFFF85E", "% 0.7X",
-__LINE__, -0x0000006L, " -6", "%+#6.ld",
-__LINE__, 0x007ff453L, "0x7ff453", "%-#1.x",
-__LINE__, 0xffffffe6L, "FFFFFFE6", "%2X",
-__LINE__, 0x0000001fL, "0X1F", "%#4X",
-__LINE__, -0x001c157L, "-115031", "%.3ld",
-__LINE__, 0x00096e06L, "617990", "%3.1ld",
-__LINE__, 0x0f77271dL, "259467037", "%d",
-__LINE__, -0x0001403L, "-5123", "%d",
-__LINE__, 0xffffff8aL, "ffffff8a", "%x",
-__LINE__, -0x000010fL, "-271", "%1.ld",
-__LINE__, 0xe573cc4aL, "E573CC4A", "%0X",
-__LINE__, -0x0000d88L, "-3464", "%-d",
-__LINE__, 0x0000000eL, "14", "%#ld",
-__LINE__, -0x000345bL, "-13403", "%#d",
-__LINE__, 0x00000602L, "602", "%+x",
-__LINE__, 0x00000011L, "17", "%#d",
-__LINE__, -0x0000002L, "-2", "%+d",
-__LINE__, 0x030fe6e6L, "51373798", "%d",
-__LINE__, 0x00000007L, "007", "%.3X",
-__LINE__, 0x0001abe0L, "0X1ABE0", "%+#.4X",
-__LINE__, 0xfffffdb7L, "fffffdb7", "%-6x",
-__LINE__, 0xffffff8dL, "FFFFFF8D", "% 02.2X",
-__LINE__, 0xfff12126L, "FFF12126", "%X",
-__LINE__, 0x0208e32dL, "34136877", "%.2d",
-__LINE__, 0x11c04b55L, "297814869", "%ld",
-__LINE__, 0xff1e5ca3L, "0xff1e5ca3", "%#x",
-__LINE__, 0xf9643f09L, "f9643f09", "%x",
-__LINE__, -0x003c6daL, "-247514", "%4d",
-__LINE__, 0xff69d0e7L, "FF69D0E7", "%-X",
-__LINE__, 0x00006ae9L, "0x6ae9", "%#x",
-__LINE__, -0x005aefeL, "-372478", "%d",
-__LINE__, 0x0000000dL, "00013", "%3.5ld",
-__LINE__, 0x00cc185cL, "CC185C", "%X",
-__LINE__, 0x3dd14d9fL, "3DD14D9F", "%1.4X",
-__LINE__, -0x4cc2ad3L, "-80489171", "%1.d",
-__LINE__, 0xfffff79eL, "fffff79e", "%x",
-__LINE__, 0xfffeeb03L, "fffeeb03", "%-1x",
-__LINE__, -0x0b1b15cL, "-11645276", "%0ld",
-__LINE__, -0x06b558dL, "-7034253", "%ld",
-__LINE__, 0xfffffe61L, "fffffe61", "%x",
-__LINE__, -0x0000002L, "-2", "%d",
-__LINE__, -0x0000162L, "-000354", "%-5.6d",
-__LINE__, 0x01a23780L, "27408256", "%d",
-__LINE__, 0xffff3a9bL, "ffff3a9b", "% x",
-__LINE__, 0xfffffdc7L, "0xfffffdc7", "%#4.5x",
-__LINE__, 0x00000000L, "00", "%.2X",
-__LINE__, -0x0000006L, "-6", "%0ld",
-__LINE__, -0x16072c6L, "-23098054", "%#5ld",
-__LINE__, -0x07152b8L, "-7426744", "%01ld",
-__LINE__, 0x0000d6c6L, "0x0d6c6", "%#1.5x",
-__LINE__, 0x00000f7cL, "000f7c", "%+04.6x",
-__LINE__, 0x00000bd0L, "3024", "%4ld",
-__LINE__, 0x0000295eL, "0x295e", "%#x",
-__LINE__, 0x00002e38L, "11832", "%.5d",
-__LINE__, -0xa2f5de4L, "-170876388", "%#d",
-__LINE__, -0x001aa36L, "-109110", "%-#d",
-__LINE__, 0x03012091L, "3012091", "%+2.5X",
-__LINE__, -0x00009edL, "-002541", "%-0.6ld",
-__LINE__, 0x0000001dL, "1d", "%x",
-__LINE__, 0xffffe315L, "FFFFE315", "%+4X",
-__LINE__, 0x0000716bL, "716B", "%X",
-__LINE__, 0xfffb8315L, "0xfffb8315", "%+#x",
-__LINE__, 0x00000132L, "132 ", "%-7.3x",
-__LINE__, 0x00000000L, "+0000000", "%+1.7d",
-__LINE__, 0xe16d27abL, "E16D27AB", "%X",
-__LINE__, 0xffffffe5L, "ffffffe5", "%+x",
-__LINE__, -0x000ab9dL, "-43933", "%ld",
-__LINE__, 0xffd042d6L, "ffd042d6", "%2x",
-__LINE__, 0xffffff9bL, "ffffff9b", "%x",
-__LINE__, 0x000000fbL, "0xfb", "% #1.x",
-__LINE__, 0x0000000fL, " 15", "%#3ld",
-__LINE__, 0xfffba2d8L, "0XFFFBA2D8", "%-#0.X",
-__LINE__, 0xfffffff8L, "0XFFFFFFF8", "% #X",
-__LINE__, 0x00000000L, " ", "%4.ld",
-__LINE__, 0x00000002L, "2", "%+x",
-__LINE__, 0xfffff314L, "FFFFF314", "%-X",
-__LINE__, 0x00000000L, " 0", "% ld",
-__LINE__, -0x0000007L, "-07", "%3.2ld",
-__LINE__, 0xffffdd80L, "FFFFDD80", "%.6X",
-__LINE__, -0x000001bL, "-27", "%-ld",
-__LINE__, -0x0000258L, "-600", "%-0d",
-__LINE__, 0x00016377L, "16377", "%3X",
-__LINE__, 0x00000001L, "1", "%X",
-__LINE__, -0xac5d314L, "-180736788", "%d",
-__LINE__, -0x000036eL, "-878", "% ld",
-__LINE__, 0xfe346af4L, "fe346af4", "%.5x",
-__LINE__, 0xffffffe1L, "ffffffe1", "%-7.6x",
-__LINE__, -0x0a1df07L, "-10608391", "%#.5d",
-__LINE__, 0x000000c9L, " 0XC9", "%+#5.X",
-__LINE__, 0xfffffffeL, "fffffffe", "%x",
-__LINE__, 0xfffffff8L, "fffffff8", "%+x",
-__LINE__, -0x4517255L, "-72446549", "%.6ld",
-__LINE__, 0xfffa3670L, "FFFA3670", "%-6X",
-__LINE__, 0xffffffe0L, "ffffffe0", "%2.x",
-__LINE__, 0xffffffffL, "ffffffff", "%0x",
-__LINE__, 0x0000230dL, "8973", "%#.1d",
-__LINE__, 0x00000238L, "238", "%0X",
-__LINE__, 0xfffce5abL, "FFFCE5AB", "%-X",
-__LINE__, 0x0000002cL, "2C", "%X",
-__LINE__, 0x00000001L, " 1", "%4.ld",
-__LINE__, 0xffffff8dL, "FFFFFF8D", "%-X",
-__LINE__, 0x00069c69L, "433257", "%06d",
-__LINE__, 0xfffffb8dL, "0xfffffb8d", "%#x",
-__LINE__, 0x000d6a2dL, "879149", "%5.5d",
-__LINE__, -0x0001fcbL, " -8139", "%7.ld",
-__LINE__, 0xfff86937L, "fff86937", "%-0x",
-__LINE__, 0x00059cf9L, "367865", "%#.0ld",
-__LINE__, 0x02c5d87aL, "46520442", "%3.ld",
-__LINE__, 0x00000571L, "1393", "%ld",
-__LINE__, 0x0003c73fL, "+247615", "%+4ld",
-__LINE__, 0x0000004fL, "4f", "% 0x",
-__LINE__, 0x00000000L, "0", "%-ld",
-__LINE__, -0x0e5850fL, "-15041807", "% ld",
-__LINE__, -0x0000002L, " -0002", "%7.4d",
-__LINE__, 0xfffffd1bL, "fffffd1b", "%05x",
-__LINE__, 0x0000041cL, " 1052", "% #0.ld",
-__LINE__, -0x0000030L, "-48", "%d",
-__LINE__, -0x0013593L, "-79251", "% #d",
-__LINE__, 0x00000001L, "1", "%+X",
-__LINE__, 0x0000056bL, " 56b", "%4.x",
-__LINE__, -0x0000004L, "-4 ", "%-3d",
-__LINE__, -0x0000003L, "-3", "% ld",
-__LINE__, 0xffff7c14L, "0XFFFF7C14", "%#X",
-__LINE__, 0x02f63dd8L, "49692120", "%.7ld",
-__LINE__, -0x03c51c9L, "-3953097", "%+d",
-__LINE__, 0x00ded685L, "14603909", "%5.ld",
-__LINE__, 0xffffffbaL, "ffffffba", "%x",
-__LINE__, 0x000370e8L, "225512", "%#ld",
-__LINE__, 0x00000003L, "3", "%X",
-__LINE__, -0x0024a64L, "-150116", "%7.d",
-__LINE__, 0xff486ca1L, "ff486ca1", "%x",
-__LINE__, 0x000001cfL, "1CF", "% X",
-__LINE__, -0x0002d7eL, "-11646", "%-0d",
-__LINE__, 0x0a594c65L, "a594c65", "%.4x",
-__LINE__, -0x0000002L, "-0002", "%-5.4ld",
-__LINE__, 0x00000000L, "", "%00.ld",
-__LINE__, 0x00058bc4L, "58BC4", "%3X",
-__LINE__, 0x0002cf8eL, " 184206", "% 0ld",
-__LINE__, 0x000009c7L, "+2503", "%+4.ld",
-__LINE__, 0xed0c984dL, "ED0C984D", "%X",
-__LINE__, -0x0000058L, "-088", "%#.3ld",
-__LINE__, 0x0076083dL, "0X76083D", "%#6X",
-__LINE__, -0x0000001L, "-1", "%#d",
-__LINE__, -0x6bf1777L, "-113186679", "%#ld",
-__LINE__, -0x000011fL, "-287", "%ld",
-__LINE__, 0x001b0e7dL, "1B0E7D", "%-4X",
-__LINE__, 0x000007acL, " 1964", "%5.ld",
-__LINE__, 0x00000005L, "5", "%0.d",
-__LINE__, -0x00003baL, "-954", "%4.0ld",
-__LINE__, 0xfffffffeL, "FFFFFFFE", "%X",
-__LINE__, 0x00000019L, "19", "%x",
-__LINE__, 0xffffffe0L, "ffffffe0", "%-.6x",
-__LINE__, 0x0000012aL, " 298", "% d",
-__LINE__, 0x00002c74L, "2c74", "% 4.3x",
-__LINE__, 0x000002d5L, "725", "%d",
-__LINE__, 0x0001c9a9L, "1c9a9", "%-02x",
-__LINE__, 0xffc928c8L, "ffc928c8", "%x",
-__LINE__, -0x03ae51fL, "-3859743", "% #ld",
-__LINE__, 0x0000526dL, "526d", "%x",
-__LINE__, -0x00028f0L, "-10480", "%5ld",
-__LINE__, -0x49b4262L, "-77283938", "%+02.0d",
-__LINE__, 0x028d37f0L, "0x28d37f0", "%+#x",
-__LINE__, 0xd66e0af9L, "D66E0AF9", "%03.X",
-__LINE__, -0x00c7707L, "-816903", "%0d",
-__LINE__, -0x00000d0L, "-208", "%-.1ld",
-__LINE__, 0x0000c328L, "49960", "%d",
-__LINE__, 0x34cb86f1L, "34CB86F1", "%X",
-__LINE__, 0x000000f6L, "F6", "%+X",
-__LINE__, 0x0a3407ecL, "0xa3407ec", "%-#x",
-__LINE__, 0x00007ebcL, "32444", "%#3.d",
-__LINE__, 0xfffd3d65L, "fffd3d65", "%x",
-__LINE__, 0x0007bc82L, "0507010", "%0.7d",
-__LINE__, 0x0005bb93L, "375699", "%ld",
-__LINE__, 0x0ec11cc8L, "0XEC11CC8", "%+#6.2X",
-__LINE__, 0xfffff9c6L, "fffff9c6", "%.5x",
-__LINE__, 0xff05ab70L, "0XFF05AB70", "%-#.3X",
-__LINE__, 0x2328b716L, "589870870", "%d",
-__LINE__, 0x00001a79L, "6777", "%.1d",
-__LINE__, 0xfffee573L, "fffee573", "%0.1x",
-__LINE__, -0x0000929L, " -2345", "%7.d",
-__LINE__, 0xffffff9aL, "FFFFFF9A", "%2.X",
-__LINE__, 0xfffffe60L, "fffffe60", "%.5x",
-__LINE__, 0xfffffcd2L, "fffffcd2", "%.7x",
-__LINE__, 0x00000001L, " 001", "%6.3X",
-__LINE__, 0x00011e9cL, "+73372", "%+0ld",
-__LINE__, 0x0000002aL, "2a", "% x",
-__LINE__, 0xffffffffL, "ffffffff", "%.7x",
-__LINE__, -0x0008ee8L, "-36584", "%ld",
-__LINE__, 0x0000001cL, "28", "%-d",
-__LINE__, 0x000abedaL, "704218", "%d",
-__LINE__, 0x001347f7L, "1347f7", "%3.0x",
-__LINE__, 0x0000023eL, "574", "%3.3ld",
-__LINE__, 0x00000000L, "0", "%-ld",
-__LINE__, -0x0016de0L, "-93664", "%0ld",
-__LINE__, 0xffffff45L, "FFFFFF45", "% X",
-__LINE__, 0x02dfb08cL, "48214156", "%#ld",
-__LINE__, 0x003d73a2L, "3d73a2", "%6.x",
-__LINE__, 0x00147da7L, "1342887", "%#d",
-__LINE__, -0x5ff0f1eL, "-100601630", "%-01ld",
-__LINE__, -0x000000bL, "-11", "%ld",
-__LINE__, 0x00000168L, " 168", "%+6.x",
-__LINE__, 0xffffc28eL, "ffffc28e", "%0x",
-__LINE__, -0x00003a2L, "-930", "%ld",
-__LINE__, 0x0002e56fL, " 189807", "% 1.ld",
-__LINE__, 0x51abf44fL, "0x51abf44f", "%#.7x",
-__LINE__, 0x00000000L, "0", "%d",
-__LINE__, 0x9581268fL, "9581268F", "%+X",
-__LINE__, 0xffffff3bL, "FFFFFF3B", "%X",
-__LINE__, 0x000083d4L, " 33748", "% #d",
-__LINE__, 0x00000001L, "1", "%x",
-__LINE__, -0x000e51fL, "-58655", "%.0ld",
-__LINE__, 0x0003eacbL, "256715", "%6ld",
-__LINE__, 0x02be09dbL, " 46008795", "% 0.ld",
-__LINE__, 0xfffffffbL, "FFFFFFFB", "% X",
-__LINE__, 0x000084f5L, " 34037", "%6ld",
-__LINE__, -0x1127f99L, "-17989529", "%#d",
-__LINE__, 0x5f6512deL, "5f6512de", "%.7x",
-__LINE__, 0x00000001L, "1", "%x",
-__LINE__, 0xfff74ab5L, "fff74ab5", "%x",
-__LINE__, 0x0eebeb94L, "250342292", "%4.ld",
-__LINE__, 0x0001b846L, "0x1b846", "%#1x",
-__LINE__, 0x001e8c32L, "1E8C32", "%2X",
-__LINE__, -0x0dae932L, "-14346546", "%5.1d",
-__LINE__, 0x00000001L, "1", "%ld",
-__LINE__, -0x0000042L, "-66", "%ld",
-__LINE__, 0xffffff51L, "FFFFFF51", "%0.1X",
-__LINE__, 0x00000043L, "43", "%x",
-__LINE__, 0x04c21f39L, " 79830841", "% 0ld",
-__LINE__, 0x0000061eL, "1566", "%03.3d",
-__LINE__, -0x0000003L, "-3", "%+d",
-__LINE__, 0x015b32dbL, " 22754011", "% .4d",
-__LINE__, 0xfffff181L, "FFFFF181", "%-X",
-__LINE__, 0x000017ecL, "0X17EC", "%#X",
-__LINE__, 0x000d703eL, "880702", "%#ld",
-__LINE__, -0x6d7533a0L, "-1836397472", "%ld",
-__LINE__, 0x0000008aL, " 138", "% d",
-__LINE__, -0x7368794bL, "-1936226635", "%+#d",
-__LINE__, 0x0000000dL, "0XD", "%#X",
-__LINE__, 0x0000030dL, "30D", "% X",
-__LINE__, 0xfffff9feL, "FFFFF9FE", "%5X",
-__LINE__, 0x00001bb2L, "7090", "%d",
-__LINE__, 0x041d2a0cL, "41D2A0C", "%0X",
-__LINE__, 0x00012aeeL, " 76526", "% d",
-__LINE__, 0x0000055fL, "55f", "%.1x",
-__LINE__, 0xffffffffL, "0XFFFFFFFF", "%#1X",
-__LINE__, 0x07b0a971L, "+129018225", "%+.2ld",
-__LINE__, 0xfffffff8L, "FFFFFFF8", "%4X",
-__LINE__, 0x00000001L, "1", "%d",
-__LINE__, 0x00000038L, "+56", "%+2ld",
-__LINE__, 0xfffffc2fL, "fffffc2f", "%+7.x",
-__LINE__, 0x00004477L, "0x4477", "% #x",
-__LINE__, 0x0000000dL, "0XD", "%+#3X",
-__LINE__, 0xf5bf37b1L, "F5BF37B1", "%1.X",
-__LINE__, 0x1a96f431L, "446100529", "%d",
-__LINE__, 0x0037edf3L, "+3665395", "%+#4.5ld",
-__LINE__, 0x0007f2aaL, "520874", "%0ld",
-__LINE__, -0x00051a3L, "-20899", "%+#1.ld",
-__LINE__, 0x0000037fL, "37F", "%0X",
-__LINE__, 0xffffffb4L, "ffffffb4", "%x",
-__LINE__, -0xd984c00L, "-228084736", "%+06ld",
-__LINE__, 0xffffe1beL, "FFFFE1BE", "%X",
-__LINE__, 0xfff20d48L, "FFF20D48", "%+6.0X",
-__LINE__, 0x000028b7L, "0x028b7", "%-#7.5x",
-__LINE__, -0x0000001L, "-1", "%ld",
-__LINE__, 0x03f37945L, "66287941", "%d",
-__LINE__, 0xffffffedL, "0XFFFFFFED", "%+#6.4X",
-__LINE__, 0x0000f046L, "f046", "%x",
-__LINE__, 0xe9772b51L, "E9772B51", "%-1.X",
-__LINE__, 0xfffffffeL, "fffffffe", "% x",
-__LINE__, 0xfffffffaL, "0xfffffffa", "%#x",
-__LINE__, 0x00000015L, "15", "%-X",
-__LINE__, 0x0000003cL, "60", "%#ld",
-__LINE__, 0x3103952dL, "822318381", "%0.ld",
-__LINE__, 0x17ba68bbL, "398092475", "%2d",
-__LINE__, 0x000006c4L, "+1732", "%+.2d",
-__LINE__, 0x00000043L, "67", "%#d",
-__LINE__, 0x0043fb55L, "4455253", "%.1ld",
-__LINE__, 0x00004b76L, "4b76", "% 0x",
-__LINE__, 0xfff4c56bL, "FFF4C56B", "%7X",
-__LINE__, 0x00766055L, "766055", "%+5x",
-__LINE__, -0x000009fL, "-159", "%+d",
-__LINE__, 0xffff063fL, "ffff063f", "%-2x",
-__LINE__, 0x00808fc8L, "808fc8", "%x",
-__LINE__, 0xffffffffL, "ffffffff", "%x",
-__LINE__, 0x000000f1L, "00000f1", "%+02.7x",
-__LINE__, 0x00000002L, "2", "%X",
-__LINE__, 0x00000000L, "000", "%03d",
-__LINE__, 0xe63f73b2L, "E63F73B2", "% 1X",
-__LINE__, 0xfffffffeL, "FFFFFFFE", "%5.1X",
-__LINE__, 0x0d3fa38bL, "222274443", "%1d",
-__LINE__, 0x00000000L, "0", "% X",
-__LINE__, 0x00000001L, " 1", "%04.ld",
-__LINE__, 0x00000046L, "46", "%0X",
-__LINE__, 0x0000761fL, " 30239", "% ld",
-__LINE__, -0x0002517L, "-9495", "%+d",
-__LINE__, 0x00000156L, "156", "% 0x",
-__LINE__, 0x1c55eba2L, "1c55eba2", "%.6x",
-__LINE__, 0x005af80dL, "5af80d", "%.6x",
-__LINE__, 0x0000002eL, "46", "%d",
-__LINE__, -0x0007c0fL, "-31759", "%ld",
-__LINE__, 0xffffe924L, "FFFFE924", "%7X",
-__LINE__, 0x00000174L, "372", "%ld",
-__LINE__, 0xffffffc9L, "0xffffffc9", "%-#x",
-__LINE__, 0x00000020L, "+000032", "%+07d",
-__LINE__, 0xffffe5d9L, "FFFFE5D9", "%4.5X",
-__LINE__, 0xffffffa3L, "FFFFFFA3", "%+.3X",
-__LINE__, 0x00000a03L, "+2563", "%+2d",
-__LINE__, 0x001b58caL, "+1792202", "%+4d",
-__LINE__, 0xffffffc9L, "0xffffffc9", "%+#5x",
-__LINE__, -0x0000003L, "-3", "% d",
-__LINE__, 0xfffffffcL, "fffffffc", "%+0x",
-__LINE__, -0x0000002L, "-02", "%.2d",
-__LINE__, 0x000243fbL, "148475", "%-ld",
-__LINE__, 0x00000001L, "1", "%0d",
-__LINE__, -0x0000672L, "-1650", "%ld",
-__LINE__, -0x0005413L, "-0021523", "% 7.7d",
-__LINE__, 0x00000017L, "0X17", "%#X",
-__LINE__, 0x00000e48L, "3656", "%0d",
-__LINE__, 0xffe79b38L, "ffe79b38", "%-x",
-__LINE__, 0xffffff15L, "FFFFFF15", "%+6.1X",
-__LINE__, 0xfff0272cL, "fff0272c", "%-.5x",
-__LINE__, -0x00b706fL, "-749679", "%1.ld",
-__LINE__, 0x0176aeecL, "176AEEC", "%.1X",
-__LINE__, -0x00005a1L, "-1441", "% 0ld",
-__LINE__, -0x0000002L, "-00002", "%.5d",
-__LINE__, -0xd2e6f5dL, "-221146973", "%1ld",
-__LINE__, -0x0000001L, " -001", "%5.3ld",
-__LINE__, 0x00000001L, " 1", "%05.ld",
-__LINE__, 0x0000749eL, "+29854", "%+#d",
-__LINE__, 0x00000005L, "5", "%d",
-__LINE__, 0xfa7128b0L, "fa7128b0", "%1.x",
-__LINE__, 0xffffbbb4L, "0XFFFFBBB4", "%#.1X",
-__LINE__, 0x0006862fL, "427567", "%d",
-__LINE__, 0x00000002L, "2", "%X",
-__LINE__, 0x000005d4L, "5d4", "% x",
-__LINE__, 0x001387e1L, "1279969", "%-05.0ld",
-__LINE__, -0x0035a56L, "-219734", "%ld",
-__LINE__, -0x4064ecc6L, "-1080356038", "%ld",
-__LINE__, 0x0000360dL, "13837", "%0ld",
-__LINE__, -0xea1a85bL, "-245475419", "%-.2ld",
-__LINE__, 0xffffff2dL, "FFFFFF2D", "%X",
-__LINE__, 0x00000004L, " 0004", "%7.4x",
-__LINE__, 0x00f72ffdL, "F72FFD", "%-X",
-__LINE__, 0x00000fa2L, "fa2 ", "%-5x",
-__LINE__, 0x05ae1f9aL, "95297434", "%#ld",
-__LINE__, 0x0000bf2eL, "48942", "%3.d",
-__LINE__, 0x00000000L, " ", "%1.X",
-__LINE__, 0x01bcb097L, "29143191", "%ld",
-__LINE__, 0x0000009cL, "156 ", "%-4.0d",
-__LINE__, 0xfffffffeL, "fffffffe", "% x",
-__LINE__, 0x00000001L, "1 ", "%-6.d",
-__LINE__, 0xffffffefL, "ffffffef", "%7.x",
-__LINE__, 0xfffffec1L, "fffffec1", "%.5x",
-__LINE__, -0x000000fL, "-15", "%-1d",
-__LINE__, -0x0008426L, "-33830", "%0ld",
-__LINE__, 0x005be0aeL, "5BE0AE", "% X",
-__LINE__, 0x00000009L, " 9", "%+7X",
-__LINE__, -0x0007e18L, "-32280", "%+0.d",
-__LINE__, 0x01697ba1L, " 23690145", "% 5.ld",
-__LINE__, -0x0012042L, "-073794", "%7.6d",
-__LINE__, 0x04e9bd0dL, "4e9bd0d", "%-2x",
-__LINE__, 0xffffffd9L, "FFFFFFD9", "%.2X",
-__LINE__, -0x01b9632L, "-1807922", "%.6ld",
-__LINE__, 0x000000cdL, "205", "%1.ld",
-__LINE__, 0x00000000L, " ", "% .0d",
-__LINE__, 0xff17bbb1L, "ff17bbb1", "%x",
-__LINE__, -0x00146d7L, "-83671", "%+1.ld",
-__LINE__, 0xfffff144L, "fffff144", "%x",
-__LINE__, 0x000f8dbeL, "F8DBE", "%3.X",
-__LINE__, -0x000381cL, "-14364", "%d",
-__LINE__, 0x0000001eL, " 30", "%4.1d",
-__LINE__, 0x00000016L, "22", "%-0d",
-__LINE__, 0x00000002L, "+02", "%+1.2ld",
-__LINE__, 0x0000e803L, "59395", "%d",
-__LINE__, 0xb4c2448dL, "b4c2448d", "%-7x",
-__LINE__, 0x000e697dL, "944509", "%ld",
-__LINE__, 0xfffe6e32L, "0XFFFE6E32", "%#X",
-__LINE__, 0x00000190L, " 190", "%+5.X",
-__LINE__, -0x03a2219L, "-3809817", "%#6.ld",
-__LINE__, -0x000003cL, "-60 ", "%-#4.ld",
-__LINE__, 0x00000000L, " ", "% 03.ld",
-__LINE__, -0x074f922L, "-7665954", "%ld",
-__LINE__, -0x00000f0L, "-240", "%-ld",
-__LINE__, 0xfffe42d2L, "0XFFFE42D2", "%#X",
-__LINE__, 0x000000ddL, "DD", "%X",
-__LINE__, 0x00359abeL, "359ABE", "%.1X",
-__LINE__, 0xffec7bdfL, "FFEC7BDF", "%0.1X",
-__LINE__, 0x0ecddcbaL, "248372410", "%-#3.d",
-__LINE__, 0x00ad0dbcL, "11341244", "%ld",
-__LINE__, -0x0000001L, "-1", "%-d",
-__LINE__, 0x00050841L, "50841", "% .5x",
-__LINE__, 0x01d359e7L, "1d359e7", "%1.x",
-__LINE__, 0xff9efaa3L, "FF9EFAA3", "%X",
-__LINE__, 0x0007ea10L, "+518672", "%+ld",
-__LINE__, -0x000671cL, "-26396", "%1d",
-__LINE__, 0xffffff91L, "0xffffff91", "%#4.4x",
-__LINE__, 0x00000000L, "+", "%+0.0ld",
-__LINE__, -0x002c53eL, "-181566", "%3.d",
-__LINE__, 0xffffff56L, "ffffff56", "%x",
-__LINE__, 0xfffff589L, "FFFFF589", "%+X",
-__LINE__, 0x00024d13L, "24D13", "%-5.2X",
-__LINE__, 0x00000000L, " 0", "%6.1d",
-__LINE__, 0x00a64f33L, "A64F33", "%4.4X",
-__LINE__, 0xffebb57aL, "FFEBB57A", "%5.4X",
-__LINE__, 0xfff3b4a0L, "fff3b4a0", "%2.x",
-__LINE__, 0xffffffd9L, "FFFFFFD9", "%.2X",
-__LINE__, 0x00d37b84L, "13859716", "%d",
-__LINE__, 0x00001e85L, "0001E85", "%0.7X",
-__LINE__, -0x756148fL, "-123081871", "% 7.d",
-__LINE__, -0x0319339L, "-3248953", "%+#.4d",
-__LINE__, -0x00798b8L, "-497848", "%#5ld",
-__LINE__, -0x0000039L, "-57", "%0d",
-__LINE__, -0x000b1d7L, "-45527", "%+0.ld",
-__LINE__, 0xff811fbaL, "FF811FBA", "%+X",
-__LINE__, 0x00000042L, " 66", "% ld",
-__LINE__, 0xfffffe31L, "0XFFFFFE31", "%#X",
-__LINE__, 0x00000073L, "115", "%ld",
-__LINE__, 0x45091a39L, "0x45091a39", "%+#3.x",
-__LINE__, 0x001270f5L, "1270f5", "%-5.6x",
-__LINE__, 0xfffd91fdL, "fffd91fd", "%x",
-__LINE__, -0x0817badL, "-8485805", "%#ld",
-__LINE__, -0x32ad55fL, "-53138783", "%0d",
-__LINE__, 0x00003e57L, "15959", "%0ld",
-__LINE__, -0x0048756L, "-296790", "%2.6d",
-__LINE__, 0xff90f45fL, "FF90F45F", "% X",
-__LINE__, 0x0000e454L, "0e454", "% .5x",
-__LINE__, 0xfffffffcL, "fffffffc", "%x",
-__LINE__, 0xfffffff7L, "FFFFFFF7", "%-2X",
-__LINE__, 0xffdabf0eL, "FFDABF0E", "%+X",
-__LINE__, 0xffffffffL, "0XFFFFFFFF", "%#1X",
-__LINE__, 0x01516650L, "1516650", "% x",
-__LINE__, 0xffffff51L, "FFFFFF51", "%X",
-__LINE__, 0x000000eaL, "234", "%00.d",
-__LINE__, 0x06db60caL, "115040458", "%5.d",
-__LINE__, 0x00000f01L, " 3841", "% d",
-__LINE__, 0x00000009L, "9", "%x",
-__LINE__, 0x299b3ba0L, "299b3ba0", "%6.7x",
-__LINE__, 0x0067f298L, "67f298", "%-2.6x",
-__LINE__, 0xfffffff5L, "FFFFFFF5", "% 2X",
-__LINE__, 0x00102ff9L, "102FF9", "%-.0X",
-__LINE__, 0xffc22393L, "0xffc22393", "% #6x",
-__LINE__, 0x00007db5L, "32181", "%-2ld",
-__LINE__, 0x0000b0a3L, "0xb0a3", "%#0x",
-__LINE__, 0x001ceebbL, "1CEEBB", "%-3.4X",
-__LINE__, 0x00025101L, "0x25101", "%#x",
-__LINE__, -0x0000001L, "-1", "%0ld",
-__LINE__, 0xffffd846L, "FFFFD846", "%+2.3X",
-__LINE__, 0x00001d79L, " 7545", "% 0.1ld",
-__LINE__, -0x0000002L, " -2", "%5d",
-__LINE__, 0xf93b9fdcL, "f93b9fdc", "%5x",
-__LINE__, 0xffff0021L, "FFFF0021", "%6X",
-__LINE__, 0x00007cf9L, "7cf9", "%3.1x",
-__LINE__, -0x0000002L, "-2", "%d",
-__LINE__, 0x00001d84L, "1d84", "%0x",
-__LINE__, -0x033201eL, "-3350558", "%-2.0d",
-__LINE__, 0xfff8a6fbL, "FFF8A6FB", "%+.7X",
-__LINE__, 0x00006fffL, " 28671", "% ld",
-__LINE__, -0x02a274aL, "-2762570", "%d",
-__LINE__, -0x0006628L, "-26152", "%00ld",
-__LINE__, 0x00000011L, "11", "%-x",
-__LINE__, -0x0000ed9L, "-3801", "%0.ld",
-__LINE__, 0xfc5b725dL, "FC5B725D", "%X",
-__LINE__, 0x3530bd4eL, "892386638", "%7.d",
-__LINE__, 0x03bb4ff7L, "62607351", "%#4.7ld",
-__LINE__, 0x00009f86L, "9f86", "%x",
-__LINE__, 0x0000e727L, "59175", "%1d",
-__LINE__, 0xfffffdf2L, "0XFFFFFDF2", "%#X",
-__LINE__, 0x00e60dbfL, "0XE60DBF", "% #1.X",
-__LINE__, 0xffffffffL, "FFFFFFFF", "%+X",
-__LINE__, 0x0a16f44eL, "0XA16F44E", "%#.0X",
-__LINE__, 0x0001f97cL, "1f97c", "% x",
-__LINE__, 0x0000000dL, "13", "%#0ld",
-__LINE__, 0x0000002aL, "42", "%0ld",
-__LINE__, 0x00000007L, " +7", "%+5ld",
-__LINE__, 0xffffff7fL, "FFFFFF7F", "%-X",
-__LINE__, 0x000006a6L, "1702", "%ld",
-__LINE__, 0xfaff2fb1L, "faff2fb1", "% x",
-__LINE__, 0xffff94abL, "ffff94ab", "%x",
-__LINE__, 0x011d611bL, "0X11D611B", "%#2.3X",
-__LINE__, 0x00000000L, " +000", "%+#5.3ld",
-__LINE__, -0x87fcc37L, "-142593079", "%+d",
-__LINE__, -0x0417424L, "-4289572", "%+d",
-__LINE__, 0x03fabc0cL, "3fabc0c", "%x",
-__LINE__, 0xfffff880L, "fffff880", "%-x",
-__LINE__, 0x000002d7L, "2d7", "%-02.x",
-__LINE__, 0x00003e82L, "16002", "%#d",
-__LINE__, -0x0003713L, "-14099", "% 5d",
-__LINE__, -0x0000027L, "-39", "%ld",
-__LINE__, 0x00013098L, "0077976", "%01.7d",
-__LINE__, -0x000000cL, "-12", "%ld",
-__LINE__, -0x00000c0L, "-192", "% ld",
-__LINE__, 0xffbe9285L, "FFBE9285", "%3.X",
-__LINE__, 0x00000046L, "46", "%x",
-__LINE__, 0x00000000L, " ", "%+4.x",
-__LINE__, 0x00011e72L, "73330", "%2.3d",
-__LINE__, -0x5276dd7L, "-86470103", "%d",
-__LINE__, 0x00000013L, "19", "%-02.ld",
-__LINE__, 0x384118a7L, "0X384118A7", "%-#X",
-__LINE__, 0x00000000L, "0", "% #X",
-__LINE__, 0x00000009L, "9", "%#ld",
-__LINE__, 0x00021145L, "135493", "%-ld",
-__LINE__, 0xff188a0cL, "FF188A0C", "%1.X",
-__LINE__, 0xffffffd5L, "ffffffd5", "%0x",
-__LINE__, 0xfffffffeL, "FFFFFFFE", "% 0X",
-__LINE__, 0xffff74a3L, "ffff74a3", "%x",
-__LINE__, 0x01d5a2f8L, "1d5a2f8", "%-0.x",
-__LINE__, 0xfffffef6L, "fffffef6", "%+06.x",
-__LINE__, 0x00000001L, "1", "%ld",
-__LINE__, 0x00000000L, "+0", "%+ld",
-__LINE__, 0xfffffffcL, "fffffffc", "%4.x",
-__LINE__, -0x0000344L, "-0836", "% .4d",
-__LINE__, 0xfffffffdL, "FFFFFFFD", "%0X",
-__LINE__, 0x000a3121L, "667937", "%#4.4ld",
-__LINE__, 0x0001e211L, "0X1E211", "%#X",
-__LINE__, 0x00000c8bL, "00C8B", "%05X",
-__LINE__, 0xfffffffeL, "fffffffe", "%+0x",
-__LINE__, 0x001a53ceL, "1725390", "%d",
-__LINE__, 0x0000057fL, "57f ", "%-7.x",
-__LINE__, -0x0073e4dL, "-474701", "%#ld",
-__LINE__, -0x0000002L, " -2", "% 3.d",
-__LINE__, 0x482dc404L, "482DC404", "%X",
-__LINE__, 0x0000011cL, "11c", "%-.1x",
-__LINE__, 0x00000c12L, " 3090", "%5.3ld",
-__LINE__, 0xfffe1068L, "FFFE1068", "%-.4X",
-__LINE__, -0x0055e88L, "-351880", "%ld",
-__LINE__, 0x000c9cefL, "+826607", "%+d",
-__LINE__, 0xffffffe3L, "ffffffe3", "%0x",
-__LINE__, -0x0000ee9L, "-3817", "%#ld",
-__LINE__, 0xff1f6daaL, "FF1F6DAA", "%X",
-__LINE__, 0xfffffc4eL, "FFFFFC4E", "%5.2X",
-__LINE__, -0x000040aL, "-1034", "%d",
-__LINE__, -0x0000085L, "-00133", "% 01.5d",
-__LINE__, -0x126c797cL, "-309098876", "%5.ld",
-__LINE__, 0x00000039L, " 57", "% d",
-__LINE__, 0xfffffff6L, "0xfffffff6", "%#5.x",
-__LINE__, 0xfffffff4L, "fffffff4", "%7.6x",
-__LINE__, 0x00000003L, "3", "%ld",
-__LINE__, 0x0000f8aeL, "f8ae", "%.0x",
-__LINE__, 0x003ca1cfL, "3973583", "%#3.7d",
-__LINE__, 0x14687009L, "0x14687009", "%+#3x",
-__LINE__, 0xfffff1f7L, "0xfffff1f7", "%#4.5x",
-__LINE__, 0xfffff17aL, "fffff17a", "%3.x",
-__LINE__, 0x0011ea18L, "1174040", "%ld",
-__LINE__, -0x0000019L, "-25", "%03.d",
-__LINE__, 0x00015d72L, "0X15D72", "%-#X",
-__LINE__, 0xffde4a41L, "ffde4a41", "%x",
-__LINE__, 0x00006f1fL, "28447", "%d",
-__LINE__, 0xffffffbdL, "0xffffffbd", "%#.1x",
-__LINE__, 0x000013b9L, "13B9", "%0X",
-__LINE__, -0x00001b9L, "-00441", "%1.5d",
-__LINE__, 0x00000001L, "000001", "%-.6d",
-__LINE__, 0x7b602d8fL, "+2069900687", "%+0ld",
-__LINE__, 0x0005e323L, "+385827", "%+ld",
-__LINE__, 0x00002fceL, "2FCE", "%+0X",
-__LINE__, 0x0000000eL, "0014", "%.4d",
-__LINE__, 0xffffffd6L, "0XFFFFFFD6", "%#4.X",
-__LINE__, 0x037bf361L, "58454881", "%5.ld",
-__LINE__, 0xffffffffL, "FFFFFFFF", "%-7.5X",
-__LINE__, -0x016d4dcL, "-1496284", "%6ld",
-__LINE__, 0x0005be9aL, "0x5be9a", "%-#.5x",
-__LINE__, 0xffffffffL, "ffffffff", "%1x",
-__LINE__, 0x00000055L, " 85", "% 7.d",
-__LINE__, 0xffffffffL, "ffffffff", "%x",
-__LINE__, -0x0135392L, "-1266578", "% ld",
-__LINE__, 0x00850f26L, "8720166", "%d",
-__LINE__, 0xffffee39L, "ffffee39", "%0x",
-__LINE__, 0x000000ddL, "221", "%ld",
-__LINE__, 0x00000000L, " ", "%6.d",
-__LINE__, 0x000000d8L, "d8", "%x",
-__LINE__, 0x000007ecL, "002028", "%4.6ld",
-__LINE__, 0x0dab4e67L, "0XDAB4E67", "%#X",
-__LINE__, 0xfffd7c95L, "FFFD7C95", "% 4X",
-__LINE__, 0x0009302dL, "9302D", "%3.1X",
-__LINE__, 0x00000003L, " 3", "% d",
-__LINE__, 0x0000082fL, "82f", "%-x",
-__LINE__, 0x0652517fL, "652517F", "%-.2X",
-__LINE__, -0x1fd8f4e3L, "-534312163", "%d",
-__LINE__, 0x00000176L, "176", "%-x",
-__LINE__, 0x00000001L, "1", "%ld",
-__LINE__, 0x0000001aL, "1A", "%X",
-__LINE__, -0x0005740L, "-22336", "% 0ld",
-__LINE__, 0xffffffffL, "ffffffff", "%6x",
-__LINE__, 0x1b273b80L, "0x1b273b80", "%#x",
-__LINE__, 0x00000065L, "65", "%X",
-__LINE__, 0x6a62138aL, "1784812426", "%2ld",
-__LINE__, 0x000001a2L, "1A2", "%X",
-__LINE__, -0x002aafdL, "-174845", "%02.ld",
-__LINE__, 0x00000014L, "20", "%d",
-__LINE__, -0x00000c7L, " -199", "%7.0ld",
-__LINE__, 0xff545bfdL, "ff545bfd", "%-x",
-__LINE__, -0x002beb9L, "-179897", "%02.2ld",
-__LINE__, -0x00000dfL, "-223", "% 02.d",
-__LINE__, -0x000d569L, "-54633", "%1.ld",
-__LINE__, 0x0000000eL, "14", "%d",
-__LINE__, -0x0077407L, "-488455", "% ld",
-__LINE__, 0x0001be09L, "114185", "%ld",
-__LINE__, -0x0000514L, "-01300", "%+05.5d",
-__LINE__, 0xf1fb397fL, "f1fb397f", "%+x",
-__LINE__, 0xfdb6707cL, "FDB6707C", "%X",
-__LINE__, 0x03cad111L, "3cad111", "%5.x",
-__LINE__, -0x022e72fL, "-2287407", "%d",
-__LINE__, -0xda35f48L, "-228810568", "%d",
-__LINE__, -0x02d1fd4L, "-2957268", "%1.3d",
-__LINE__, 0x0000005fL, "+95", "%+2d",
-__LINE__, 0xfffbf8a1L, "FFFBF8A1", "%4.2X",
-__LINE__, 0x0000071eL, " 71e", "%6.x",
-__LINE__, 0x000cc8a5L, "+837797", "%+03ld",
-__LINE__, 0x000eebe9L, " EEBE9", "%6.X",
-__LINE__, -0x2896b204L, "-680964612", "%d",
-__LINE__, -0x09553f8L, "-9786360", "%d",
-__LINE__, 0x000015d3L, "5587", "%0d",
-__LINE__, 0x0000056dL, " 56d", "%+4.x",
-__LINE__, -0x00624adL, "-402605", "% ld",
-__LINE__, 0xfea64ba5L, "0xfea64ba5", "%#1x",
-__LINE__, 0x004f35c6L, "5191110", "%-ld",
-__LINE__, -0x1441fe4L, "-21241828", "%d",
-__LINE__, 0xffffff95L, "FFFFFF95", "%X",
-__LINE__, 0xfffecf81L, "FFFECF81", "%-2.X",
-__LINE__, -0x00002bbL, "-699", "%-d",
-__LINE__, -0x0000c29L, "-3113", "% 02ld",
-__LINE__, 0x000026a3L, " 9891", "% .4d",
-__LINE__, 0x00000003L, "3", "%-x",
-__LINE__, 0x000007dbL, "+02011", "%+.5ld",
-__LINE__, 0xfff99558L, "FFF99558", "%.1X",
-__LINE__, 0x0000fce6L, "64742", "%4.0d",
-__LINE__, 0x000b7ea2L, "753314", "%ld",
-__LINE__, 0x13e5df30L, "0X13E5DF30", "%#2.X",
-__LINE__, 0x006761c4L, "06761C4", "%6.7X",
-__LINE__, 0xffffff78L, "FFFFFF78", "%0.X",
-__LINE__, 0xfffff1c0L, "0xfffff1c0", "% #x",
-__LINE__, -0x034af1cL, "-3452700", "% 06.1d",
-__LINE__, 0x000000deL, "0000222", "%2.7ld",
-__LINE__, 0x000003d8L, "0x3d8", "%#4.x",
-__LINE__, -0x001a1d1L, "-106961", "%3.1d",
-__LINE__, -0x0000002L, "-2", "% d",
-__LINE__, 0x00001de6L, "+7654", "%+0ld",
-__LINE__, 0x00000001L, "001", "%#.3d",
-__LINE__, -0x53dacf9fL, "-1406848927", "%ld",
-__LINE__, 0xfffffffcL, "fffffffc", "%3.3x",
-__LINE__, -0x00950e8L, "-610536", "%3.6ld",
-__LINE__, 0xff14ade9L, "FF14ADE9", "%6X",
-__LINE__, 0x012f5284L, "0X12F5284", "% #5X",
-__LINE__, 0x00005a21L, " 5a21", "%5x",
-__LINE__, 0x00000638L, "1592", "%2.4ld",
-__LINE__, -0x063017bL, "-6488443", "%ld",
-__LINE__, 0x00000000L, "0", "% X",
-__LINE__, 0xfffe8ef2L, "FFFE8EF2", "%+0X",
-__LINE__, -0x0001c96L, "-7318", "%.3d",
-__LINE__, 0x0000ca7dL, "51837", "%ld",
-__LINE__, 0x00000001L, "1", "%+1x",
-__LINE__, 0xfffff7bcL, "FFFFF7BC", "%X",
-__LINE__, -0x03d15e2L, "-4003298", "%ld",
-__LINE__, 0xfffffffeL, "fffffffe", "% x",
-__LINE__, 0x00066183L, "+418179", "%+7.1ld",
-__LINE__, 0xffffef2eL, "ffffef2e", "%-2.x",
-__LINE__, 0x00000000L, " 000", "%04.3x",
-__LINE__, -0x000000fL, "-15", "% d",
-__LINE__, -0x00001f5L, "-501", "%d",
-__LINE__, 0x0c67f159L, "c67f159", "%6.2x",
-__LINE__, -0x0000006L, "-6", "%.1d",
-__LINE__, 0x00000005L, "0X5", "%+#1X",
-__LINE__, -0x0000002L, " -2", "%6.ld",
-__LINE__, 0xeb2183ecL, "eb2183ec", "% x",
-__LINE__, -0x5e12a322L, "-1578279714", "%d",
-__LINE__, 0x00000001L, "0x1", "%#x",
-__LINE__, -0x0001ea4L, "-7844", "%0d",
-__LINE__, -0x19955a3L, "-26826147", "%d",
-__LINE__, 0x000002a6L, "2A6", "%2.X",
-__LINE__, 0x00000002L, "2", "%X",
-__LINE__, 0xfffffeecL, "fffffeec", "%0.4x",
-__LINE__, 0xfffffffcL, "fffffffc", "%0x",
-__LINE__, 0xffdfe740L, "FFDFE740", "% X",
-__LINE__, -0x0b0b3e7L, "-11580391", "%.1d",
-__LINE__, 0x8e01077cL, "8E01077C", "%5.7X",
-__LINE__, 0x3b6b6d55L, "996896085", "%1.1d",
-__LINE__, 0x000016afL, "5807", "%ld",
-__LINE__, -0x0004900L, "-18688", "%d",
-__LINE__, 0xfffd77bcL, "FFFD77BC", "%X",
-__LINE__, 0x004cbd74L, "5029236", "%0d",
-__LINE__, 0x00000003L, " 00003", "%6.5d",
-__LINE__, 0x0004720fL, "4720f", "% x",
-__LINE__, 0x0e44535dL, "e44535d", "%4x",
-__LINE__, 0xfffffff9L, "FFFFFFF9", "%3.3X",
-__LINE__, -0x0000005L, "-5", "%-d",
-__LINE__, 0x000001a6L, "00001A6", "%1.7X",
-__LINE__, 0x0000004aL, "4A", "%-2.X",
-__LINE__, 0xfffff249L, "FFFFF249", "%X",
-__LINE__, 0x00004345L, "4345", "%x",
-__LINE__, 0x0197041dL, "197041d", "%+0x",
-__LINE__, 0x0000019aL, " 19a", "% 6.x",
-__LINE__, 0xfff98376L, "FFF98376", "%X",
-__LINE__, 0xfc536c41L, "FC536C41", "%X",
-__LINE__, -0x0008d91L, "-36241", "% d",
-__LINE__, 0xf058d69dL, "f058d69d", "%4.x",
-__LINE__, -0x00013efL, "-5103", "%d",
-__LINE__, -0x0000003L, "-3", "%00ld",
-__LINE__, -0x09e80f0L, "-10387696", "%+07ld",
-__LINE__, -0x0222c15L, "-2239509", "%#0.4ld",
-__LINE__, 0x00000004L, "4", "%0ld",
-__LINE__, -0x02c6b0dL, "-2910989", "% 0ld",
-__LINE__, 0xfffffffeL, "FFFFFFFE", "%-4X",
-__LINE__, 0xffffff3dL, "FFFFFF3D", "%-.0X",
-__LINE__, -0x0000015L, "-21", "%0d",
-__LINE__, 0x131dfc90L, "+320732304", "%+d",
-__LINE__, 0xffffffffL, "ffffffff", "%+x",
-__LINE__, 0x000035c8L, "13768", "%0ld",
-__LINE__, 0x00000033L, "0x0033", "%#.4x",
-__LINE__, 0x0ce7e8c1L, "0xce7e8c1", "%#.7x",
-__LINE__, 0xfc18b5d2L, "FC18B5D2", "%+.3X",
-__LINE__, 0x00000015L, "21", "%d",
-__LINE__, 0x001a5e7cL, "1a5e7c", "%05x",
-__LINE__, -0x000fbf0L, "-64496", "%ld",
-__LINE__, -0x000a4f7L, "-042231", "%+2.6d",
-__LINE__, -0x0000002L, "-002", "%3.3ld",
-__LINE__, 0x00728878L, "728878", "%0X",
-__LINE__, -0x0000002L, "-2", "%#.1ld",
-__LINE__, -0x00002efL, "-751", "%-0ld",
-__LINE__, 0xfffffff7L, "fffffff7", "%.3x",
-__LINE__, 0x00491867L, "0491867", "%.7X",
-__LINE__, 0x00000d4dL, "3405", "%-ld",
-__LINE__, 0x00234e86L, "234E86", "%0X",
-__LINE__, -0x000001bL, "-27", "%ld",
-__LINE__, 0x00275255L, "2576981", "%.5ld",
-__LINE__, 0xfeacc214L, "0XFEACC214", "%-#3.X",
-__LINE__, -0x0001ce5L, "-7397", "%+#2.2ld",
-__LINE__, 0x089ddb6aL, "144563050", "%d",
-__LINE__, 0x003d5a95L, "3D5A95", "%1X",
-__LINE__, 0x002f0b6dL, "3083117", "%d",
-__LINE__, 0x1e79e228L, "511304232", "%ld",
-__LINE__, 0xfffffe6bL, "FFFFFE6B", "%+0X",
-__LINE__, -0x5104ff3L, "-84955123", "%.4ld",
-__LINE__, 0xfffff1deL, "FFFFF1DE", "%X",
-__LINE__, 0x000000cfL, "+207", "%+.1ld",
-__LINE__, -0x16ad0164L, "-380436836", "%+5.d",
-__LINE__, 0x001fefa6L, "2092966", "%ld",
-__LINE__, 0x00000000L, "00", "%-.2d",
-__LINE__, 0x00195f45L, "195f45", "%+0x",
-__LINE__, 0x00000001L, " 1", "%3.ld",
-__LINE__, -0x00001c9L, "-457", "% ld",
-__LINE__, 0x0002479eL, "149406", "%#ld",
-__LINE__, 0x001ab18bL, "1749387", "%04d",
-__LINE__, 0x00000045L, "69", "%ld",
-__LINE__, 0xfbb13f7dL, "fbb13f7d", "%.2x",
-__LINE__, 0x03ddc208L, "3ddc208", "%x",
-__LINE__, 0x00000007L, "000007", "%#.6d",
-__LINE__, 0x00000000L, "0", "%01X",
-__LINE__, -0x0023110L, "-143632", "%+0.3d",
-__LINE__, 0x00000006L, "06", "%#.2d",
-__LINE__, 0xffff9ec9L, "ffff9ec9", "%7x",
-__LINE__, -0x08afb12L, "-9108242", "% #0.ld",
-__LINE__, 0x00000004L, "4", "%X",
-__LINE__, 0x00059684L, "59684", "%x",
-__LINE__, 0xfff8d8f5L, "FFF8D8F5", "%X",
-__LINE__, 0x00b7027dL, "+11993725", "%+0.7ld",
-__LINE__, 0x0000d814L, "55316", "%0ld",
-__LINE__, 0x03c95a08L, "3c95a08", "%3x",
-__LINE__, -0x0b65f9aL, "-11952026", "%d",
-__LINE__, 0xfd956021L, "fd956021", "%0x",
-__LINE__, 0x000000edL, "ed", "%0x",
-__LINE__, -0x006a80cL, "-436236", "%.6ld",
-__LINE__, 0xfedb109dL, "fedb109d", "%x",
-__LINE__, 0x00000001L, "1", "%X",
-__LINE__, 0x00b3eb71L, " 11791217", "% d",
-__LINE__, 0x00000016L, "16", "%0X",
-__LINE__, 0x000001dbL, " 475", "% ld",
-__LINE__, 0x00465eafL, "4611759", "%0d",
-__LINE__, 0x0001b423L, "1B423", "%0X",
-__LINE__, 0x05df95eaL, "5df95ea", "%+.5x",
-__LINE__, 0x0000000eL, " 14", "%7ld",
-__LINE__, 0xffffb89eL, "ffffb89e", "%+x",
-__LINE__, 0x01259918L, " 19241240", "% d",
-__LINE__, -0x0000f8dL, "-003981", "%+#.6d",
-__LINE__, 0x00054ae0L, "54AE0", "%X",
-__LINE__, -0x4589ed4L, "-72916692", "% ld",
-__LINE__, 0x01017516L, "1017516", "%6X",
-__LINE__, 0xfffb9f15L, "FFFB9F15", "%.2X",
-__LINE__, 0x005f8394L, "5F8394", "%.2X",
-__LINE__, 0xffffffffL, "ffffffff", "%x",
-__LINE__, -0x0000001L, " -1", "%7.1ld",
-__LINE__, 0x004367afL, "4417455", "%4.ld",
-__LINE__, 0xffffff86L, "ffffff86", "%4.5x",
-__LINE__, -0x0000d17L, "-3351", "%2.0ld",
-__LINE__, 0xffffff31L, "ffffff31", "%.6x",
-__LINE__, -0x0000001L, "-1", "%ld",
-__LINE__, -0x3d785fabL, "-1031298987", "%d",
-__LINE__, -0x0000002L, "-2", "%-0ld",
-__LINE__, 0x0000019cL, "412", "%d",
-__LINE__, -0x0006f54L, "-28500", "%d",
-__LINE__, 0xfffe3524L, "FFFE3524", "% 6.2X",
-__LINE__, -0x128d3c00L, "-311245824", "%2d",
-__LINE__, -0x3be71293L, "-1004999315", "%d",
-__LINE__, 0x0000659dL, "26013", "%d",
-__LINE__, 0x2d947538L, "+764704056", "%+5d",
-__LINE__, 0xffa2a420L, "FFA2A420", "%0X",
-__LINE__, 0x00000001L, "1", "%d",
-__LINE__, 0x04477c14L, "4477c14", "%.6x",
-__LINE__, -0x06e145bL, "-7214171", "%d",
-__LINE__, 0x00009c01L, "39937", "%-.1d",
-__LINE__, 0xffde174bL, "ffde174b", "% 0x",
-__LINE__, 0x0001fbaeL, "1FBAE", "%01.X",
-__LINE__, -0x06b8406L, "-7046150", "%d",
-__LINE__, 0x000005b8L, "005b8", "%05x",
-__LINE__, -0x02d780bL, "-2979851", "%1d",
-__LINE__, 0x00209e26L, "2137638", "%2d",
-__LINE__, 0x0000041aL, "41A", "%0X",
-__LINE__, 0x2a77f42cL, "2A77F42C", "%02X",
-__LINE__, 0x13b6ee14L, "+330755604", "%+0d",
-__LINE__, -0x0000002L, "-2 ", "%-6.d",
-__LINE__, -0x0001eeeL, "-7918", "% #2.ld",
-__LINE__, 0xffffffffL, "FFFFFFFF", "% .5X",
-__LINE__, 0x20d11927L, "20d11927", "% 0.x",
-__LINE__, -0x0018690L, "-99984", "% ld",
-__LINE__, 0x000002a0L, "2A0", "%-0X",
-__LINE__, -0x0000511L, "-1297", "%+d",
-__LINE__, 0x0e782f31L, "242757425", "%-0.ld",
-__LINE__, 0x2ce06da0L, "752905632", "%#0ld",
-__LINE__, 0x00000062L, "62 ", "%-07x",
-__LINE__, -0x015d9d8L, "-1432024", "% 7d",
-__LINE__, 0xc9125ea8L, "c9125ea8", "%x",
-__LINE__, 0x00000006L, "6", "%.0ld",
-__LINE__, 0x0000019cL, "19c", "%x",
-__LINE__, 0x00000000L, " ", "%6.d",
-__LINE__, 0x00043e89L, "278153", "%0ld",
-__LINE__, 0x3e422abdL, "1044523709", "%ld",
-__LINE__, 0x0220a75dL, "35694429", "%#7.6d",
-__LINE__, 0x0000c21cL, "C21C", "% X",
-__LINE__, 0x000074abL, "29867", "%d",
-__LINE__, 0x056b22aaL, "56B22AA", "%+0.X",
-__LINE__, 0xfffffff9L, "FFFFFFF9", "%X",
-__LINE__, 0x00000000L, "0", "%X",
-__LINE__, 0xf094a4f4L, "f094a4f4", "%+4.x",
-__LINE__, -0x1dad0244L, "-497877572", "%d",
-__LINE__, 0xffffffffL, "FFFFFFFF", "%.1X",
-__LINE__, 0xfffffe2dL, "fffffe2d", "%7.x",
-__LINE__, 0x0000042bL, "0x42b", "%#x",
-__LINE__, -0x0000001L, "-1", "% d",
-__LINE__, 0x00e77ef5L, " 15171317", "% 7.ld",
-__LINE__, 0x00006210L, " 25104", "% 06d",
-__LINE__, 0x0011187aL, "1120378", "%-ld",
-__LINE__, -0x000000bL, "-11", "% #ld",
-__LINE__, 0x14cfaff0L, "14cfaff0", "%-2.3x",
-__LINE__, 0xffff74eaL, "FFFF74EA", "%3.X",
-__LINE__, 0x000bfb9dL, "bfb9d", "%x",
-__LINE__, 0xfffffffeL, "FFFFFFFE", "%X",
-__LINE__, 0x00014500L, "0X14500", "%#4.X",
-__LINE__, -0x0000001L, "-1", "%#1d",
-__LINE__, -0x0000024L, "-36", "%-0d",
-__LINE__, -0x6528828L, "-106072104", "%d",
-__LINE__, 0x00000075L, " 117", "% #d",
-__LINE__, 0xff027d67L, "ff027d67", "%0x",
-__LINE__, 0x0012b8b3L, "12b8b3", "%0.1x",
-__LINE__, 0x1070147bL, "275780731", "%.6ld",
-__LINE__, 0xffffe88eL, "FFFFE88E", "%1.3X",
-__LINE__, 0xfffffc0dL, "fffffc0d", "%00.6x",
-__LINE__, 0xffd889f5L, "ffd889f5", "%x",
-__LINE__, 0x00000470L, "1136", "%0ld",
-__LINE__, 0x000297f8L, "169976", "%ld",
-__LINE__, 0xfffffffeL, "fffffffe", "%+1x",
-__LINE__, 0x0000064aL, "64a", "%x",
-__LINE__, -0x3d71e43bL, "-1030874171", "%1.d",
-__LINE__, -0x0000004L, "-4 ", "%-3.d",
-__LINE__, 0xfffff132L, "FFFFF132", "%0.0X",
-__LINE__, 0x37b6356fL, "37b6356f", "%-x",
-__LINE__, 0xffffff7aL, "FFFFFF7A", "%.0X",
-__LINE__, 0x00023553L, "23553", "%x",
-__LINE__, 0x39a4c29fL, "39a4c29f", "%+5.x",
-__LINE__, 0xffffffccL, "ffffffcc", "%x",
-__LINE__, 0x0003a83bL, "239675", "%#6ld",
-__LINE__, 0x00000002L, "2", "%0x",
-__LINE__, -0x09b4e8cL, "-10178188", "%+03.ld",
-__LINE__, 0x00000002L, "0000002", "%-#.7ld",
-__LINE__, 0x00000b5eL, "2910", "%-04ld",
-__LINE__, -0x0000254L, "-596", "%+0d",
-__LINE__, 0x00000001L, "1", "%+1.x",
-__LINE__, 0xf8290d3eL, "0XF8290D3E", "% #X",
-__LINE__, 0x00000035L, "035", "%3.3X",
-__LINE__, 0x00131d7dL, "131D7D ", "%-7.6X",
-__LINE__, 0xffdbb36aL, "0xffdbb36a", "%#.6x",
-__LINE__, 0xc7275816L, "c7275816", "%04.x",
-__LINE__, 0x00bae994L, "12249492", "%0ld",
-__LINE__, 0x00000002L, "+2", "%+0.0ld",
-__LINE__, 0xffffffffL, "ffffffff", "%0x",
-__LINE__, 0xffffffe0L, "ffffffe0", "%x",
-__LINE__, 0x00000036L, "36", "%.0X",
-__LINE__, 0xfffffffdL, "FFFFFFFD", "%1X",
-__LINE__, 0xffffffc8L, "ffffffc8", "%+x",
-__LINE__, 0xe71c3689L, "e71c3689", "%x",
-__LINE__, 0x00000007L, "7 ", "%-3.ld",
-__LINE__, 0xffffffffL, "ffffffff", "%x",
-__LINE__, 0x00030400L, "030400", "%-4.6x",
-__LINE__, 0xbd8c6fa7L, "BD8C6FA7", "%-6X",
-__LINE__, 0x00000233L, "0000563", "%.7ld",
-__LINE__, 0xfef92e35L, "fef92e35", "%x",
-__LINE__, 0xffff2172L, "ffff2172", "%3x",
-__LINE__, 0x00001233L, "1233", "% X",
-__LINE__, -0x000d2e1L, "-53985", "%-0d",
-__LINE__, -0x3ba8cb5bL, "-1000917851", "%0d",
-__LINE__, -0x4fefb9aL, "-83819418", "%5.ld",
-__LINE__, 0xffffe9ebL, "FFFFE9EB", "%X",
-__LINE__, 0x1e472dc3L, "507981251", "%ld",
-__LINE__, -0x0077046L, "-487494", "%0d",
-__LINE__, 0x0002c4c9L, "+181449", "%+7.d",
-__LINE__, 0xfffffe63L, "fffffe63", "%x",
-__LINE__, 0xfff5a6dbL, "FFF5A6DB", "%X",
-__LINE__, 0x00174442L, "174442", "%-5.0X",
-__LINE__, 0x017891d9L, "17891D9", "%+5.X",
-__LINE__, 0x0261966bL, "261966B", "%-X",
-__LINE__, -0x3e58614dL, "-1045979469", "%ld",
-__LINE__, 0x002c4c41L, "+2903105", "%+01ld",
-__LINE__, 0x0000000cL, "012", "%#.3d",
-__LINE__, 0x0380f73aL, "58783546", "%ld",
-__LINE__, 0x000002c7L, "0000711", "%2.7ld",
-__LINE__, 0x00000002L, " 002", "% 04ld",
-__LINE__, 0x00687ca0L, "687CA0", "%X",
-__LINE__, 0x0000058aL, "1418", "%0ld",
-__LINE__, -0x0000642L, "-1602", "% ld",
-__LINE__, 0x0001f4f1L, "1F4F1", "%X",
-__LINE__, 0x0026d6fcL, "+2545404", "%+4.ld",
-__LINE__, 0x05dd423cL, "+98386492", "%+#ld",
-__LINE__, 0x0000782cL, "0782C", "%3.5X",
-__LINE__, 0xf67d91f8L, "f67d91f8", "%-x",
-__LINE__, 0xffffcf2dL, "ffffcf2d", "%+0x",
-__LINE__, -0x00af8a6L, "-719014", "%0ld",
-__LINE__, -0xe606ef9L, "-241200889", "%ld",
-__LINE__, 0xfe9d87f7L, "fe9d87f7", "%+x",
-__LINE__, 0x00000d44L, "d44", "% 1.x",
-__LINE__, 0x008716f5L, "8716f5", "%2x",
-__LINE__, 0x000027d4L, "27D4", "% X",
-__LINE__, 0xfdfd92eaL, "FDFD92EA", "%-.4X",
-__LINE__, 0xfffe764fL, "FFFE764F", "%X",
-__LINE__, 0xff699032L, "ff699032", "%3.x",
-__LINE__, 0xffffffffL, "FFFFFFFF", "%-3X",
-__LINE__, -0x368ba995L, "-915122581", "%+#.6ld",
-__LINE__, 0xffffffffL, "ffffffff", "%0x",
-__LINE__, 0x0000035eL, " 862", "% 1d",
-__LINE__, 0xfe703e67L, "fe703e67", "%07.0x",
-__LINE__, 0xfffffffeL, "fffffffe", "%4.x",
-__LINE__, 0x000e20cfL, "e20cf", "%0x",
-__LINE__, 0x000063b5L, "0X63B5", "%-#X",
-__LINE__, 0xfffffffaL, "fffffffa", "%+2.x",
-__LINE__, 0xffffffffL, "FFFFFFFF", "%2.X",
-__LINE__, 0xfdfd69daL, "FDFD69DA", "%.0X",
-__LINE__, 0x00002f61L, "0x2f61", "%#3.x",
-__LINE__, 0x00000009L, "9", "%x",
-__LINE__, 0xffffff86L, "ffffff86", "%6x",
-__LINE__, 0xffffffe4L, "ffffffe4", "%0x",
-__LINE__, 0x0062e73bL, "+6481723", "%+0ld",
-__LINE__, -0x2b059130L, "-721785136", "%+d",
-__LINE__, -0x0000073L, "-115", "%d",
-__LINE__, 0xf596efcfL, "f596efcf", "%x",
-__LINE__, 0x0002f1cbL, "2F1CB", "%0X",
-__LINE__, -0x0000635L, "-01589", "%.5ld",
-__LINE__, 0xfffa011aL, "FFFA011A", "%0X",
-__LINE__, 0x00000047L, " 47", "%4X",
-__LINE__, 0xfffffbc0L, "FFFFFBC0", "%5.2X",
-__LINE__, 0x00000015L, "15", "% X",
-__LINE__, 0x002a87a6L, "2a87a6", "%.1x",
-__LINE__, -0x000069cL, "-1692", "%+ld",
-__LINE__, 0xfffffffdL, "fffffffd", "%+x",
-__LINE__, 0xfeda51f5L, "FEDA51F5", "%0X",
-__LINE__, 0x001781a4L, "1781a4", "%-0x",
-__LINE__, 0xe77358d4L, "e77358d4", "%+0x",
-__LINE__, 0x00000084L, " 84", "%3.x",
-__LINE__, 0xffff0cb2L, "FFFF0CB2", "%+5.X",
-__LINE__, 0x0009fa17L, "653847", "%0.0ld",
-__LINE__, -0x0000c92L, "-3218", "%d",
-__LINE__, 0x0004ebbbL, "4ebbb", "%x",
-__LINE__, 0x2e72568cL, "+779245196", "%+#ld",
-__LINE__, 0xffae86a7L, "ffae86a7", "%.7x",
-__LINE__, 0xffdf3f04L, "ffdf3f04", "%x",
-__LINE__, 0x000000c7L, "199", "%2.d",
-__LINE__, -0x0004a55L, "-19029", "%ld",
-__LINE__, 0x00564ef9L, "5656313", "%.6ld",
-__LINE__, 0xffffc205L, "ffffc205", "%+.0x",
-__LINE__, -0x135085d0L, "-324044240", "%#.5d",
-__LINE__, 0xfffffffeL, "fffffffe", "%-7x",
-__LINE__, -0x0000003L, "-3", "%.1ld",
-__LINE__, 0xffda9e0bL, "ffda9e0b", "%+0x",
-__LINE__, 0x00000001L, "1", "%d",
-__LINE__, 0xffffffdaL, "ffffffda", "%.6x",
-__LINE__, 0x5efdb3d1L, "+1593684945", "%+0d",
-__LINE__, -0x00000caL, "-202", "% 4.d",
-__LINE__, -0x0014433L, "-82995", "%.3d",
-__LINE__, -0x0000002L, "-000002", "% .6ld",
-__LINE__, 0x24aac879L, "615172217", "%.7d",
-__LINE__, -0x1db3c1dL, "-31144989", "%+#4ld",
-__LINE__, 0x000945adL, "0x945ad", "%#1x",
-__LINE__, 0x0000000aL, "10", "%#.1ld",
-__LINE__, -0x002a2e5L, "-172773", "%d",
-__LINE__, 0xfffffff3L, "FFFFFFF3", "%5X",
-__LINE__, 0x0000000eL, "e", "%+x",
-__LINE__, 0x335333dcL, "861090780", "%6.d",
-__LINE__, 0xfffa16f4L, "FFFA16F4", "%6X",
-__LINE__, 0xffffc727L, "ffffc727", "%+2.x",
-__LINE__, 0x00000273L, "273", "%x",
-__LINE__, -0x000000fL, "-15", "%-0d",
-__LINE__, 0x00065fbdL, "417725", "%5.1d",
-__LINE__, 0x00000ed5L, "3797", "%d",
-__LINE__, 0x30a40024L, "30A40024", "%3.7X",
-__LINE__, 0x00000054L, "84", "%ld",
-__LINE__, 0x00000515L, "01301", "%.5ld",
-__LINE__, 0x00000897L, "+02199", "%+.5d",
-__LINE__, -0x0001bccL, "-7116", "% ld",
-__LINE__, 0xfffffffeL, "FFFFFFFE", "%7X",
-__LINE__, 0x00000013L, "0X13", "%#X",
-__LINE__, 0xffffffffL, "0xffffffff", "% #x",
-__LINE__, 0x00000006L, "6", "%ld",
-__LINE__, -0x00000c3L, "-195", "%1.ld",
-__LINE__, -0x005291eL, "-338206", "%+d",
-__LINE__, 0xffb437a7L, "FFB437A7", "%-0X",
-__LINE__, 0xff8335cbL, "ff8335cb", "%x",
-__LINE__, 0x0000006aL, "6A", "%2X",
-__LINE__, -0x004f629L, "-325161", "% .4d",
-__LINE__, 0x003698efL, "3578095", "%0ld",
-__LINE__, 0x6b5cdf3aL, "6b5cdf3a", "%-x",
-__LINE__, 0xe9bc5c21L, "e9bc5c21", "%+x",
-__LINE__, -0x0000001L, " -1", "%+6.ld",
-__LINE__, 0xfffeffc8L, "FFFEFFC8", "%6.X",
-__LINE__, 0xff070a73L, "ff070a73", "%+.7x",
-__LINE__, 0x0023f8aeL, "2357422", "%07.4ld",
-__LINE__, 0x00000000L, "0", "%X",
-__LINE__, 0x00000016L, "16", "%0X",
-__LINE__, -0x000005aL, " -90", "%4d",
-__LINE__, 0x00000116L, "116", "% .3x",
-__LINE__, 0xfffed024L, "fffed024", "%-x",
-__LINE__, 0xfb907950L, "fb907950", "%.0x",
-__LINE__, 0x0101a1e5L, "101a1e5", "%x",
-__LINE__, -0x09e7684L, "-10385028", "%-#ld",
-__LINE__, 0xffffffffL, "ffffffff", "%1x",
-__LINE__, 0xfffffff6L, "fffffff6", "%x",
-__LINE__, 0x00000078L, "78", "%x",
-__LINE__, 0xe6bca9c9L, "0XE6BCA9C9", "%#.5X",
-__LINE__, -0x0000010L, "-16", "%d",
-__LINE__, -0x1348f685L, "-323548805", "%d",
-__LINE__, 0x4dd85797L, "1306023831", "%ld",
-__LINE__, -0x0000080L, "-128", "%.2d",
-__LINE__, -0xaed13a7L, "-183309223", "%+ld",
-__LINE__, -0x000002fL, "-47", "% d",
-__LINE__, -0x679911fL, "-108630303", "%ld",
-__LINE__, 0xfffff221L, "FFFFF221", "% .7X",
-__LINE__, 0x0007476cL, "7476c", "%x",
-__LINE__, 0xffffe02aL, "0xffffe02a", "%#7x",
-__LINE__, 0x00000ebbL, "0XEBB", "%#X",
-__LINE__, 0xffffffffL, "0XFFFFFFFF", "%-#X",
-__LINE__, 0x00281896L, "281896", "%+1.x",
-__LINE__, 0x0000085dL, " 0X85D", "%#6.3X",
-__LINE__, 0x000112bfL, "112BF", "%X",
-__LINE__, 0xf5518fbfL, "F5518FBF", "% X",
-__LINE__, -0x00c945bL, "-824411", "%ld",
-__LINE__, 0x00001b43L, "0x1b43", "%-#x",
-__LINE__, -0x5872a246L, "-1483907654", "%#7.7ld",
-__LINE__, 0x00001f96L, "8086", "%#d",
-__LINE__, 0xfffffff9L, "FFFFFFF9", "%X",
-__LINE__, -0x006e244L, "-451140", "% .3d",
-__LINE__, -0x0382188L, "-3678600", "%0.2ld",
-__LINE__, 0x00000006L, "6", "%-x",
-__LINE__, 0x00000036L, "54 ", "%-5.d",
-__LINE__, -0x0000439L, " -1081", "%#6.3ld",
-__LINE__, 0xfff911c6L, "FFF911C6", "%X",
-__LINE__, -0x03454dcL, "-3429596", "%d",
-__LINE__, -0x0363e8dL, "-3554957", "%-.2ld",
-__LINE__, 0x00000000L, "000", "%.3X",
-__LINE__, -0x59bb030fL, "-1505428239", "%0ld",
-__LINE__, 0x073c94d8L, "121410776", "%-d",
-__LINE__, -0x001ef94L, "-126868", "%5.1ld",
-__LINE__, 0xfff65fc5L, "FFF65FC5", "%0X",
-__LINE__, 0xfffffff4L, "fffffff4", "%-x",
-__LINE__, 0x00001d83L, "07555", "%5.5d",
-__LINE__, 0x0012b40aL, "1225738", "%ld",
-__LINE__, -0x0000006L, "-6", "%0ld",
-__LINE__, 0xfffffffcL, "fffffffc", "%06.0x",
-__LINE__, -0x0000002L, "-00002", "%#.5ld",
-__LINE__, 0xf9932c1dL, "f9932c1d", "%-x",
-__LINE__, -0x46a31d9L, "-74068441", "%.3ld",
-__LINE__, 0x000987e9L, "987E9", "%1X",
-__LINE__, 0x0000000fL, "15", "%-ld",
-__LINE__, -0x0001c4dL, "-7245", "%ld",
-__LINE__, -0x007deeeL, "-515822", "%2.6d",
-__LINE__, 0xffffffa2L, "FFFFFFA2", "%.6X",
-__LINE__, 0x00000001L, "1", "%-ld",
-__LINE__, 0xfc106bdeL, "fc106bde", "%.4x",
-__LINE__, 0x0002f1f8L, "0x2f1f8", "%#7.x",
-__LINE__, -0x06a290bL, "-6957323", "%-ld",
-__LINE__, -0x0000037L, " -55", "%4ld",
-__LINE__, 0x0000152eL, "5422", "%2.d",
-__LINE__, 0xfffffcb2L, "0XFFFFFCB2", "%#3.X",
-__LINE__, 0x1b7ca086L, "1b7ca086", "%+x",
-__LINE__, 0x00000001L, "1", "%ld",
-__LINE__, 0x006775fcL, "6775fc", "%3.2x",
-__LINE__, 0x0000000eL, "0XE", "%#3.X",
-__LINE__, 0xffffffffL, "0xffffffff", "%+#4.x",
-__LINE__, 0x00001246L, "1246", "%X",
-__LINE__, 0xffffaed6L, "ffffaed6", "%2x",
-__LINE__, -0x3a2dec78L, "-976088184", "% 0ld",
-__LINE__, 0x0001423bL, "1423b", "%01x",
-__LINE__, 0x00000007L, " 0X7", "%#4.X",
-__LINE__, 0x01a7ff5aL, "27787098", "%.4ld",
-__LINE__, -0x0020d05L, "-134405", "%-d",
-__LINE__, 0xffffff9aL, "ffffff9a", "%-.1x",
-__LINE__, 0xffff3557L, "ffff3557", "%x",
-__LINE__, 0x08828e35L, "8828e35", "%+.1x",
-__LINE__, 0x000006b2L, "001714", "%04.6ld",
-__LINE__, 0x00000013L, "19", "%.0ld",
-__LINE__, -0x00341a5L, "-213413", "%#d",
-__LINE__, -0x0000043L, "-67", "%d",
-__LINE__, -0x074dce3L, "-7658723", "%.1d",
-__LINE__, -0x16de2df3L, "-383659507", "% ld",
-__LINE__, 0x00000000L, "0", "%x",
-__LINE__, 0x00000ce7L, "ce7", "% 2.1x",
-__LINE__, 0xffecd377L, "ffecd377", "% 0x",
-__LINE__, 0xa4e8465cL, "a4e8465c", "% x",
-__LINE__, 0x000005e8L, "1512", "%d",
-__LINE__, 0x00000513L, "1299", "%d",
-__LINE__, 0xffffffb8L, "FFFFFFB8", "%X",
-__LINE__, 0x00000003L, "00003", "%3.5x",
-__LINE__, -0x0000003L, "-3 ", "%-3.ld",
-__LINE__, 0xad53f01dL, "ad53f01d", "%0x",
-__LINE__, 0x0f1c1daeL, "253500846", "%-#.0d",
-__LINE__, 0xff1753c0L, "0xff1753c0", "%#3.x",
-__LINE__, -0x00389c5L, "-231877", "%d",
-__LINE__, 0x0000016eL, "00016E", "%.6X",
-__LINE__, -0x54d3310fL, "-1423126799", "%-d",
-__LINE__, 0x00000005L, "0X5", "%#.1X",
-__LINE__, 0xfffffffdL, "0XFFFFFFFD", "%#5.3X",
-__LINE__, 0xfffffe0eL, "fffffe0e", "%-x",
-__LINE__, 0xa3c02157L, "a3c02157", "%.5x",
-__LINE__, 0x00005765L, "22373", "%d",
-__LINE__, -0x12668cdL, "-19294413", "%+ld",
-__LINE__, -0x66544daL, "-107300058", "%2d",
-__LINE__, 0x8646c605L, "0X8646C605", "% #X",
-__LINE__, 0x000001f5L, "1F5", "%X",
-__LINE__, 0x01b33ae4L, "28523236", "%5ld",
-__LINE__, 0x000007ceL, "7ce", "%3.x",
-__LINE__, 0x00000355L, "355", "%X",
-__LINE__, 0x000001ceL, "1CE", "% X",
-__LINE__, 0xfffffccdL, "fffffccd", "%7.0x",
-__LINE__, -0x0000001L, "-1", "%0ld",
-__LINE__, 0x000640b6L, "640b6", "%5.x",
-__LINE__, 0x0038c4ecL, "3720428", "%5.4d",
-__LINE__, -0x0f10b5eL, "-15797086", "%2ld",
-__LINE__, 0x256c815fL, "256c815f", "%4.x",
-__LINE__, 0x00000682L, " 1666", "%6ld",
-__LINE__, -0x00000abL, "-171", "%2ld",
-__LINE__, 0x00000003L, "3", "%0d",
-__LINE__, 0x063f5075L, "63F5075", "%X",
-__LINE__, 0xff83b5d0L, "FF83B5D0", "%7.X",
-__LINE__, 0xffffffecL, "ffffffec", "%x",
-__LINE__, 0xffb551c4L, "0XFFB551C4", "% #4.X",
-__LINE__, -0x071f057L, "-7467095", "%3.7d",
-__LINE__, 0x00634879L, "6506617", "%#ld",
-__LINE__, 0x000001d7L, "471", "%d",
-__LINE__, 0x00a7da92L, "A7DA92", "% .4X",
-__LINE__, 0x00000003L, "3 ", "%-2.ld",
-__LINE__, -0x0000004L, "-0004", "%.4d",
-__LINE__, -0x01dea32L, "-1960498", "% #7.d",
-__LINE__, 0x53c4159fL, "53C4159F", "%1.7X",
-__LINE__, -0x1ad7904L, "-28145924", "%#d",
-__LINE__, -0x0000a85L, "-2693", "%ld",
-__LINE__, -0x0000c7dL, "-3197", "%d",
-__LINE__, 0xfffffffcL, "FFFFFFFC", "%+0X",
-__LINE__, 0x00000004L, "00004", "%1.5d",
-__LINE__, 0x0000b761L, "46945", "%5ld",
-__LINE__, -0x0ee3b2cL, "-15612716", "%.6d",
-__LINE__, 0x0677a73dL, "677a73d", "% x",
-__LINE__, -0x5f96020L, "-100229152", "% d",
-__LINE__, 0x00000000L, " 0", "%#7X",
-__LINE__, -0x5d1cb5bL, "-97635163", "% ld",
-__LINE__, -0x00a8d8bL, "-691595", "%-0ld",
-__LINE__, 0xffffffa2L, "FFFFFFA2", "%X",
-__LINE__, 0xffffffc9L, "FFFFFFC9", "%X",
-__LINE__, 0x0b180d35L, "B180D35", "%X",
-__LINE__, 0xfc0b94ceL, "fc0b94ce", "%.1x",
-__LINE__, 0x0012cd7bL, "12CD7B", "% X",
-__LINE__, -0x02f1da8L, "-3087784", "%ld",
-__LINE__, -0x000a6f9L, "-42745", "%-ld",
-__LINE__, -0x000006dL, "-109 ", "%-6d",
-__LINE__, 0x00000001L, "+1", "%+0d",
-__LINE__, 0x00000001L, "1", "%1d",
-__LINE__, 0xfffffff8L, "fffffff8", "%5.x",
-__LINE__, -0x00fc4d7L, "-1033431", "%+0.5ld",
-__LINE__, 0xffff41b4L, "0xffff41b4", "%#x",
-__LINE__, -0x0000d37L, "-3383", "%ld",
-__LINE__, 0xffc4e405L, "ffc4e405", "%7x",
-__LINE__, 0xffffffb0L, "FFFFFFB0", "%04X",
-__LINE__, -0x0054477L, "-345207", "%01.ld",
-__LINE__, 0x00512778L, "0x512778", "%#3.0x",
-__LINE__, 0x00000007L, " 7", "%7.d",
-__LINE__, 0x00000008L, " 00008", "% .5ld",
-__LINE__, 0x000053fdL, "21501", "%.4ld",
-__LINE__, 0x0000370cL, "370c", "%2x",
-__LINE__, -0x44670a7L, "-71725223", "%3d",
-__LINE__, 0x00000064L, " 64", "%+5x",
-__LINE__, 0xfffffffcL, "FFFFFFFC", "%X",
-__LINE__, 0xf7bbf094L, "f7bbf094", "%3x",
-__LINE__, 0xfffeb268L, "FFFEB268", "%X",
-__LINE__, 0x00001ef0L, "1ef0", "%4.x",
-__LINE__, 0x05ad9aa4L, " 95263396", "% 0.ld",
-__LINE__, 0xf294dca7L, "F294DCA7", "% 4.X",
-__LINE__, -0x0000003L, "-000003", "%.6d",
-__LINE__, 0xfff57471L, "fff57471", "% x",
-__LINE__, 0x0a848cfdL, "176459005", "%d",
-__LINE__, -0x000002eL, "-46", "%.0d",
-__LINE__, 0x00000051L, " +81", "%+5d",
-__LINE__, -0x000072bL, "-0001835", "%06.7d",
-__LINE__, -0x0000002L, " -2", "%+#6ld",
-__LINE__, 0x00000003L, "3", "%x",
-__LINE__, 0xfffd1799L, "FFFD1799", "%6.X",
-__LINE__, 0x00000005L, "5", "%ld",
-__LINE__, 0x0052138bL, "5378955", "%#7.7ld",
-__LINE__, 0x000000c0L, " 192", "% 7ld",
-__LINE__, 0x005b26cdL, "5B26CD", "%X",
-__LINE__, -0x008df17L, "-581399", "%.4ld",
-__LINE__, 0xfffffad8L, "fffffad8", "%-x",
-__LINE__, 0x000006a9L, "6a9", "%.0x",
-__LINE__, -0x003b7f9L, "-243705", "%+0ld",
-__LINE__, 0x005d7ea4L, "6127268", "%ld",
-__LINE__, -0x003cceaL, "-249066", "%+.0ld",
-__LINE__, 0x0000846fL, "846F", "%X",
-__LINE__, 0x00004f79L, "4F79", "%4.X",
-__LINE__, 0xe3e1409cL, "E3E1409C", "%-X",
-__LINE__, 0x07cce2f4L, "7CCE2F4", "%2.X",
-__LINE__, 0x004bcc8bL, "4967563", "%-.5ld",
-__LINE__, 0x7d49665eL, "2101962334", "%ld",
-__LINE__, 0xfffffffcL, "FFFFFFFC", "%.5X",
-__LINE__, 0x0000019eL, "+000414", "%+.6d",
-__LINE__, 0x000027efL, "10223", "%d",
-__LINE__, -0x0000261L, "-609", "%3ld",
-__LINE__, -0x000000eL, "-14", "% 2.ld",
-__LINE__, 0xff3ba3c7L, "ff3ba3c7", "%+5.7x",
-__LINE__, 0xffffffc4L, "FFFFFFC4", "%-1.X",
-__LINE__, 0xfffc5a70L, "0xfffc5a70", "%#4.4x",
-__LINE__, 0x0000d156L, " 53590", "% d",
-__LINE__, -0x0486258L, "-4743768", "%0ld",
-__LINE__, 0x00000000L, " ", "% 2.d",
-__LINE__, 0x04a0ef9fL, "77655967", "%0.6ld",
-__LINE__, 0xffffffffL, "FFFFFFFF", "%X",
-__LINE__, 0x00000019L, "0000019", "%.7x",
-__LINE__, -0x0058d3aL, "-363834", "%ld",
-__LINE__, 0xfffff6b3L, "fffff6b3", "%x",
-__LINE__, 0xfffffff5L, "FFFFFFF5", "%.0X",
-__LINE__, 0x005e1fcbL, "5E1FCB", "%+6X",
-__LINE__, 0xffc3c866L, "0xffc3c866", "%-#.4x",
-__LINE__, 0x00000003L, "3", "%X",
-__LINE__, 0xffa2e961L, "FFA2E961", "%7.4X",
-__LINE__, 0x00000029L, "41", "%d",
-__LINE__, -0x0000035L, "-53", "%d",
-__LINE__, 0x0001b033L, "110643", "%ld",
-__LINE__, 0x004dd51bL, "5100827", "%-2ld",
-__LINE__, -0x000252dL, "-9517", "% d",
-__LINE__, 0xffffdeb2L, "ffffdeb2", "%4.x",
-__LINE__, 0xffe94eabL, "0xffe94eab", "%#x",
-__LINE__, 0xf921edf6L, "f921edf6", "%4.2x",
-__LINE__, 0x0007df97L, "515991", "%4.ld",
-__LINE__, 0x00709bc5L, "709BC5", "%0X",
-__LINE__, -0x0000001L, "-1", "%d",
-__LINE__, 0xfffffffbL, "FFFFFFFB", "%7.3X",
-__LINE__, -0x0063f74L, "-409460", "%+05.0d",
-__LINE__, 0xfffffe9aL, "FFFFFE9A", "%.2X",
-__LINE__, -0x0001ce2L, "-7394", "%.4d",
-__LINE__, 0x000038c5L, "14533", "%ld",
-__LINE__, 0x000000adL, "000ad", "% 5.5x",
-__LINE__, 0xffffbcc4L, "ffffbcc4", "%-5x",
-__LINE__, 0x00000000L, "0", "% X",
-__LINE__, 0x00372877L, "372877", "%.6X",
-__LINE__, 0xffffffd7L, "FFFFFFD7", "%1.X",
-__LINE__, 0xfa58b14bL, "fa58b14b", "%x",
-__LINE__, 0xfffffd9fL, "FFFFFD9F", "%0.7X",
-__LINE__, 0x00000710L, "+1808", "%+#.2ld",
-__LINE__, 0x00000006L, " 6", "%5.0ld",
-__LINE__, 0x0fba9706L, "263886598", "%-6.3d",
-__LINE__, 0xffff420aL, "ffff420a", "%-2x",
-__LINE__, 0x14b9a825L, "14b9a825", "%x",
-__LINE__, 0x0077ffe4L, "77FFE4", "%+.2X",
-__LINE__, 0x00067108L, "422152 ", "%-7.ld",
-__LINE__, 0x00000001L, " 00001", "%6.5X",
-__LINE__, 0x00000000L, "0", "%ld",
-__LINE__, -0x0000001L, " -1", "% 7ld",
-__LINE__, 0x01ddc7a3L, "31311779", "%d",
-__LINE__, -0x2a92f9bL, "-44642203", "% 3ld",
-__LINE__, 0xfffffff9L, "fffffff9", "%4.6x",
-__LINE__, 0x0279a274L, "279a274", "%x",
-__LINE__, 0x2e37ed8eL, "775417230", "%d",
-__LINE__, 0x5ba59f58L, "1537580888", "%-ld",
-__LINE__, 0xffffffe0L, "ffffffe0", "%x",
-__LINE__, 0x3110ae47L, "0X3110AE47", "%+#X",
-__LINE__, 0x000e00b9L, "917689", "%d",
-__LINE__, 0x0000002eL, " 0046", "% 7.4d",
-__LINE__, 0x00000363L, " 867", "%7.d",
-__LINE__, -0x000000bL, "-0011", "% 0.4d",
-__LINE__, 0x000349c8L, " 349C8", "% 7.X",
-__LINE__, -0x01358f1L, "-1267953", "%d",
-__LINE__, -0x0039d3cL, "-236860", "%-.3d",
-__LINE__, 0xffd6de19L, "ffd6de19", "%04.0x",
-__LINE__, -0x0003c54L, "-0015444", "%1.7d",
-__LINE__, -0x0000e17L, "-3607", "%d",
-__LINE__, 0xff0fa3a9L, "ff0fa3a9", "%+3x",
-__LINE__, 0x00000009L, "0000009", "%1.7x",
-__LINE__, 0xfffffc81L, "FFFFFC81", "% X",
-__LINE__, -0x4ef2df5L, "-82783733", "%ld",
-__LINE__, 0x00000013L, "19", "%-ld",
-__LINE__, 0x00000000L, " 0", "%#7x",
-__LINE__, -0x3b9485fdL, "-999589373", "%1.d",
-__LINE__, -0x0000006L, "-00006", "%6.5d",
-__LINE__, 0x0000003fL, "+63", "%+ld",
-__LINE__, 0x000004c5L, "1221", "%1.d",
-__LINE__, 0x003f8a8cL, "4164236", "%d",
-__LINE__, -0x000001eL, "-30", "%-#3d",
-__LINE__, 0xfff9d230L, "FFF9D230", "%+07.3X",
-__LINE__, 0x0147cf17L, "147cf17", "% x",
-__LINE__, 0xffffffebL, "ffffffeb", "%x",
-__LINE__, 0x0000007dL, "00125", "%.5ld",
-__LINE__, 0x000fff56L, "1048406", "%#3d",
-__LINE__, 0x064307a0L, " 105056160", "% 0.3ld",
-__LINE__, 0x007d2860L, "8202336", "%-.2d",
-__LINE__, 0x00a05711L, "a05711", "%x",
-__LINE__, 0x179a7f9eL, "0x179a7f9e", "%+#.3x",
-__LINE__, 0x00000003L, "3", "%X",
-__LINE__, -0x0001d7dL, "-7549", "%#5d",
-__LINE__, 0x0025d3f2L, "+2479090", "%+2.d",
-__LINE__, -0x0000001L, "-1", "%#ld",
-__LINE__, 0xfffffdd5L, "fffffdd5", "%.7x",
-__LINE__, 0x003462b9L, "3433145", "%d",
-__LINE__, 0x00005a81L, "23169", "%d",
-__LINE__, 0xfffffcdbL, "fffffcdb", "%-x",
-__LINE__, 0x00000000L, "0", "%d",
-__LINE__, 0xfff22085L, "fff22085", "%x",
-__LINE__, 0x00016d72L, " 93554", "% d",
-__LINE__, -0x0000002L, "-2", "%0ld",
-__LINE__, 0xfffffd21L, "fffffd21", "% 0x",
-__LINE__, 0x00000931L, "2353", "%ld",
-__LINE__, 0x00010021L, "10021", "%5.1X",
-__LINE__, -0x000007eL, "-126", "%1.0ld",
-__LINE__, 0xfffffff8L, "fffffff8", "%01.x",
-__LINE__, -0x001d148L, "-119112", "%d",
-__LINE__, -0x0000008L, "-8", "%ld",
-__LINE__, -0x000038eL, "-910", "% ld",
-__LINE__, 0x0039e3e5L, "3793893", "%0.1d",
-__LINE__, 0x0038fb8eL, "38FB8E", "%.2X",
-__LINE__, -0x002dafaL, "-187130", "%ld",
-__LINE__, -0xbec275bL, "-200025947", "%ld",
-__LINE__, 0x1a32f999L, "1A32F999", "%05.4X",
-__LINE__, 0x0000002fL, "2f", "%x",
-__LINE__, -0x0001a5bL, "-6747", "%+3.ld",
-__LINE__, 0x00000762L, " 1890", "%7.ld",
-__LINE__, 0x000000c2L, "000194", "%0.6ld",
-__LINE__, 0xffff002bL, "FFFF002B", "%.4X",
-__LINE__, -0x0019daeL, "-105902", "% .2d",
-__LINE__, 0x0000125fL, "125f", "%+1x",
-__LINE__, -0x000b688L, " -46728", "%#7.d",
-__LINE__, 0x000401caL, "401ca", "%0x",
-__LINE__, 0x00000192L, "402", "%#ld",
-__LINE__, 0xffffffffL, "ffffffff", "%x",
-__LINE__, 0x1e505a0cL, "0X1E505A0C", "%#1.3X",
-__LINE__, 0x000f8f6cL, "1019756", "%d",
-__LINE__, 0x0004a296L, "4a296", "%5.2x",
-__LINE__, 0x00000003L, "3", "% x",
-__LINE__, -0x000d44cL, "-54348", "%#ld",
-__LINE__, 0x00009ae2L, "39650", "%-d",
-__LINE__, 0xffffff3aL, "FFFFFF3A", "% .7X",
-__LINE__, 0x0042350bL, "4338955", "%d",
-__LINE__, 0x000071afL, "71af", "%+.4x",
-__LINE__, 0x00000001L, "0x1", "%#0x",
-__LINE__, 0x00000033L, "00051", "%3.5d",
-__LINE__, 0x00000001L, "1", "%X",
-__LINE__, -0xebfb0e7L, "-247443687", "%+3ld",
-__LINE__, 0x00000027L, "27 ", "%-07.X",
-__LINE__, -0x0004837L, "-18487", "%01d",
-__LINE__, 0x1a8c53daL, "1A8C53DA", "%X",
-__LINE__, -0x0bdb8a9L, "-12433577", "%d",
-__LINE__, -0x0000098L, "-152", "%#ld",
-__LINE__, -0x003b554L, "-243028", "%d",
-__LINE__, 0x000000cbL, "00000CB", "%+.7X",
-__LINE__, 0xfffffedaL, "FFFFFEDA", "%X",
-__LINE__, -0x0000010L, "-16", "%-#d",
-__LINE__, 0x00000006L, "+6", "%+d",
-__LINE__, 0x003c294aL, "+3942730", "%+4.ld",
-__LINE__, 0x00000009L, "9", "%ld",
-__LINE__, 0xfbbdd2bcL, "FBBDD2BC", "% X",
-__LINE__, 0x71c86678L, "+1908958840", "%+0.6ld",
-__LINE__, -0x0b49bffL, "-11836415", "% 6.ld",
-__LINE__, 0xfff416beL, "fff416be", "%3.x",
-__LINE__, 0x00000077L, "+119", "%+d",
-__LINE__, 0xfff1cfaaL, "FFF1CFAA", "% 0.2X",
-__LINE__, 0xfffffffbL, "fffffffb", "% x",
-__LINE__, 0x0000127eL, "4734", "%d",
-__LINE__, 0x00107ad2L, "107ad2", "%+2.6x",
-__LINE__, 0x0006b8e9L, "440553", "%-#d",
-__LINE__, 0x0000eb6fL, "eb6f", "% x",
-__LINE__, 0x00001f18L, "7960", "%0d",
-__LINE__, 0xfffff225L, "fffff225", "%1.5x",
-__LINE__, 0xfffffff9L, "fffffff9", "%+6.x",
-__LINE__, 0x000005b9L, "01465", "%.5ld",
-__LINE__, 0xfffc26b8L, "FFFC26B8", "% X",
-__LINE__, 0x540d580dL, "0X540D580D", "%+#X",
-__LINE__, 0x05ad7094L, "5AD7094", "% 4.7X",
-__LINE__, -0x000019bL, "-411", "% d",
-__LINE__, 0x00000006L, "000006", "%6.6ld",
-__LINE__, 0x0000026aL, "+618", "%+ld",
-__LINE__, 0x0000000bL, "11", "%ld",
-__LINE__, -0x26985d5L, "-40469973", "%#.0ld",
-__LINE__, 0x0000007dL, "7D", "%+02.0X",
-__LINE__, -0x0079ddfL, "-0499167", "%+.7ld",
-__LINE__, 0x0000375fL, "14175", "%0d",
-__LINE__, -0x18de7f99L, "-417234841", "%ld",
-__LINE__, -0x00507ccL, "-329676", "%.0d",
-__LINE__, 0x000029d5L, "29D5", "%-2.1X",
-__LINE__, 0x0000328cL, "328C", "%-3.X",
-__LINE__, 0x016f6234L, "24076852", "%3.ld",
-__LINE__, 0xfffffffcL, "0XFFFFFFFC", "%#.5X",
-__LINE__, 0xfe6163caL, "FE6163CA", "%5.X",
-__LINE__, 0xffffffc2L, "FFFFFFC2", "%X",
-__LINE__, 0x00000087L, "+135", "%+ld",
-__LINE__, 0x00310166L, "310166", "% x",
-__LINE__, 0x00e8c871L, "15255665", "%d",
-__LINE__, 0x000005eeL, "1518", "%ld",
-__LINE__, 0xfcb24306L, "FCB24306", "%X",
-__LINE__, 0x0000000bL, " 11", "%5ld",
-__LINE__, 0x006d11d0L, "0x6d11d0", "%#.0x",
-__LINE__, 0x0010d416L, "1102870", "%#6.5d",
-__LINE__, -0x0047cb3L, "-294067", "%.3d",
-__LINE__, 0x000000c0L, "c0", "%x",
-__LINE__, 0xffffffffL, "FFFFFFFF", "%+X",
-__LINE__, -0x000000aL, "-10", "%d",
-__LINE__, -0x0000007L, "-7", "% ld",
-__LINE__, 0xfffffffeL, "FFFFFFFE", "%-X",
-__LINE__, 0x00000014L, "0x14", "%-#3.1x",
-__LINE__, 0x00003319L, "3319", "% x",
-__LINE__, 0x00000000L, "00", "%+#.2X",
-__LINE__, -0x0000009L, "-9", "% ld",
-__LINE__, -0x0000001L, "-1 ", "%-3ld",
-__LINE__, 0x00262909L, "2500873", "%.5ld",
-__LINE__, 0x33e76560L, "33e76560", "%7.0x",
-__LINE__, -0x0000002L, "-2", "%ld",
-__LINE__, 0x00035ee9L, "35EE9", "%-3.X",
-__LINE__, -0x0000235L, "-565", "%+4.ld",
-__LINE__, -0x3ea63c5L, "-65692613", "%d",
-__LINE__, 0x00000003L, "3", "%ld",
-__LINE__, -0x003362fL, "-210479", "% d",
-__LINE__, -0x1a819f8aL, "-444702602", "%.7d",
-__LINE__, 0x027a4668L, "41567848", "%d",
-__LINE__, 0x0002b025L, "2b025", "%x",
-__LINE__, -0x0000001L, "-001", "%.3ld",
-__LINE__, 0xfffffff0L, "fffffff0", "%-0x",
-__LINE__, -0x0000d4fL, "-3407", "%-ld",
-__LINE__, 0x00000146L, " 326", "% 1.d",
-__LINE__, -0x0000006L, "-6", "%d",
-__LINE__, 0xffffffffL, "FFFFFFFF", "%06.4X",
-__LINE__, 0x376fddaeL, "+930078126", "%+#0ld",
-__LINE__, 0x006d9da3L, "6d9da3", "%1.x",
-__LINE__, -0x0000f28L, "-3880", "%3.2ld",
-__LINE__, 0x0006962cL, " 431660", "% 5d",
-__LINE__, 0x000011dbL, " 4571", "%6.ld",
-__LINE__, 0xffffffa8L, "ffffffa8", "%+x",
-__LINE__, 0x0d886db3L, "D886DB3", "%.7X",
-__LINE__, 0x00000000L, "000000", "%2.6ld",
-__LINE__, 0xfffff6b6L, "FFFFF6B6", "% X",
-__LINE__, -0x0739068L, "-7573608", "%+6.ld",
-__LINE__, 0xfba62553L, "0XFBA62553", "%#X",
-__LINE__, -0x4474bc5L, "-71781317", "%-2ld",
-__LINE__, 0xffffff95L, "FFFFFF95", "% 2.X",
-__LINE__, -0x1d0e1caL, "-30466506", "%+.0d",
-__LINE__, -0x000f3aaL, "-62378", "%ld",
-__LINE__, 0x00000026L, "26", "%1x",
-__LINE__, 0x001c5400L, "1856512", "%-#d",
-__LINE__, 0x03808442L, "3808442", "%X",
-__LINE__, -0x0000081L, "-129", "%+#ld",
-__LINE__, 0x000004aeL, " 1198", "% 3.4d",
-__LINE__, -0x7f4ed54L, "-133492052", "%d",
-__LINE__, 0x00000000L, "+0", "%+ld",
-__LINE__, 0x00000000L, "0", "%+x",
-__LINE__, 0x004c7e46L, "5013062", "%.0d",
-__LINE__, -0x647d7a65L, "-1685944933", "%0.2d",
-__LINE__, 0x00003b59L, "15193", "%-#1d",
-__LINE__, 0xfff3e64dL, "FFF3E64D", "%-X",
-__LINE__, 0x00007022L, "28706", "%-d",
-__LINE__, 0xc28d0ad8L, "c28d0ad8", "%+x",
-__LINE__, -0x005c208L, "-377352", "% ld",
-__LINE__, 0x00cfbadcL, "13613788", "%d",
-__LINE__, 0x000016eaL, "5866", "%0d",
-__LINE__, 0x00000029L, "29", "%X",
-__LINE__, 0xffe16813L, "0XFFE16813", "%+#X",
-__LINE__, 0x00000004L, "4", "%0X",
-__LINE__, -0x0000096L, " -150", "%5d",
-__LINE__, 0x00027ac7L, "162503", "%ld",
-__LINE__, -0x0075de0L, "-482784", "%d",
-__LINE__, 0x005fcff6L, "6279158", "%d",
-__LINE__, 0xffffffefL, "FFFFFFEF", "%3X",
-__LINE__, 0x267b05ecL, "645596652", "%4ld",
-__LINE__, 0xa487b724L, "a487b724", "%x",
-__LINE__, 0x01da2a11L, "31074833", "%-.0ld",
-__LINE__, 0xffffffffL, "FFFFFFFF", "%X",
-__LINE__, 0x0000037aL, "37a", "%x",
-__LINE__, 0x003d0314L, "+3998484", "%+#1d",
-__LINE__, 0x0000011bL, " 283", "%5.2d",
-__LINE__, 0x094f6066L, "94f6066", "%x",
-__LINE__, 0x00000004L, "4", "%X",
-__LINE__, -0x102e14bdL, "-271455421", "% 7.ld",
-__LINE__, 0x000048daL, "0018650", "%07ld",
-__LINE__, -0x24ae0390L, "-615383952", "%0.6d",
-__LINE__, 0xffff5159L, "0XFFFF5159", "%#0X",
-__LINE__, 0xfffd38c3L, "fffd38c3", "%x",
-__LINE__, 0xfffff9eaL, "FFFFF9EA", "%-X",
-__LINE__, -0x000fd28L, "-64808", "% ld",
-__LINE__, 0x002c1bf4L, "2890740", "%-.1d",
-__LINE__, 0x00d00ee7L, "D00EE7", "%0.4X",
-__LINE__, 0x00000cf9L, "3321", "%0d",
-__LINE__, -0x0000001L, "-1", "%-#ld",
-__LINE__, 0xfffffd75L, "FFFFFD75", "%.2X",
-__LINE__, 0x00000012L, "18", "%-d",
-__LINE__, 0xfd44b4b2L, "fd44b4b2", "%+5.x",
-__LINE__, -0x001c53fL, "-116031", "%-#6.d",
-__LINE__, 0x000ff6fdL, "ff6fd", "%2x",
-__LINE__, 0x00000001L, "1", "%0d",
-__LINE__, 0x0120b478L, "120B478", "%.7X",
-__LINE__, 0x0145591eL, "145591E", "%1.4X",
-__LINE__, 0x001f99b9L, "1F99B9", "%.1X",
-__LINE__, 0xffffd078L, "ffffd078", "%-1.5x",
-__LINE__, 0xffffff1aL, "FFFFFF1A", "%-4.6X",
-__LINE__, 0xfffffffaL, "fffffffa", "%x",
-__LINE__, -0x00000b9L, "-185", "%3ld",
-__LINE__, 0x00001cf0L, "7408", "%-ld",
-__LINE__, 0xffffffffL, "FFFFFFFF", "%X",
-__LINE__, 0x00151f30L, "151F30", "%X",
-__LINE__, -0x0000103L, "-259", "%d",
-__LINE__, -0x000303fL, "-12351", "%d",
-__LINE__, 0x000002caL, "714", "%ld",
-__LINE__, -0x0000c55L, "-3157", "%1d",
-__LINE__, 0x00000691L, "01681", "%#.5ld",
-__LINE__, 0x00230537L, "2295095", "%#d",
-__LINE__, 0x032a1faaL, "53092266", "%.4d",
-__LINE__, 0x000050d7L, "20695", "%d",
-__LINE__, -0x0c7ad4cL, "-13086028", "%#.4ld",
-__LINE__, -0x00009d9L, "-2521", "%+d",
-__LINE__, 0xfffffffeL, "fffffffe", "%0x",
-__LINE__, 0xffdec2d9L, "FFDEC2D9", "%5.1X",
-__LINE__, -0x000563cL, "-22076", "%-.2ld",
-__LINE__, 0x0073b36aL, "0x73b36a", "%-#x",
-__LINE__, 0xfffffffdL, "fffffffd", "%x",
-__LINE__, 0x0193ba5aL, "193ba5a", "%1.x",
-__LINE__, 0x00d147b5L, "13715381", "%2.d",
-__LINE__, 0xffffff10L, "ffffff10", "%4x",
-__LINE__, 0x000648d5L, "648d5", "%1.3x",
-__LINE__, 0x00000011L, "11", "%X",
-__LINE__, 0xff259f5bL, "0xff259f5b", "% #.1x",
-__LINE__, 0x00000175L, "175", "%x",
-__LINE__, 0x00000000L, "0", "%ld",
-__LINE__, 0x00000015L, "21", "%#ld",
-__LINE__, 0xfffffffeL, "fffffffe", "%-x",
-__LINE__, 0x00000013L, " 19", "% 0ld",
-__LINE__, -0x0000001L, "-0000001", "% 5.7ld",
-__LINE__, 0x0000139dL, "139D", "%X",
-__LINE__, 0x0041ad18L, "41ad18", "%-.6x",
-__LINE__, -0x00000f9L, "-249", "% 3.d",
-__LINE__, 0x00000076L, "118", "%ld",
-__LINE__, 0x000006f8L, "1784", "%d",
-__LINE__, -0x0000005L, "-5", "%ld",
-__LINE__, -0x00008e7L, "-2279", "%+ld",
-__LINE__, 0x00003f77L, "3F77", "%+0X",
-__LINE__, 0x000ca3f8L, "0XCA3F8", "%+#X",
-__LINE__, -0x00004bfL, "-001215", "%#5.6ld",
-__LINE__, 0x319129abL, "0x319129ab", "%+#x",
-__LINE__, -0x0000002L, "-2", "%ld",
-__LINE__, -0x0f6686eL, "-16148590", "%.6ld",
-__LINE__, 0x0329576bL, "53041003", "%2.d",
-__LINE__, -0x000179eL, "-6046", "%d",
-__LINE__, 0x000002ccL, "+716", "%+1.3ld",
-__LINE__, 0xfffffff7L, "0xfffffff7", "% #x",
-__LINE__, 0x0016eb40L, "1502016", "%ld",
-__LINE__, 0x00000003L, "3", "%-0ld",
-__LINE__, 0x0023e0d6L, "23E0D6", "%-05.X",
-__LINE__, 0xffffa6a4L, "0XFFFFA6A4", "%#X",
-__LINE__, 0x00087664L, "87664", "% .2x",
-__LINE__, -0x0000002L, " -2", "%3.ld",
-__LINE__, 0x003ad85dL, "3AD85D", "%X",
-__LINE__, 0x00002f20L, "12064", "%ld",
-__LINE__, 0x02030bfcL, "2030BFC", "%02.3X",
-__LINE__, 0xfffff36aL, "FFFFF36A", "%X",
-__LINE__, 0xfe0729ffL, "0xfe0729ff", "% #.0x",
-__LINE__, 0xfec15164L, "FEC15164", "%0.2X",
-__LINE__, -0x00169ecL, "-92652", "%+d",
-__LINE__, 0x006d7990L, "0x6d7990", "%#x",
-__LINE__, 0xffcc89e6L, "ffcc89e6", "%x",
-__LINE__, 0x002d7ccaL, "2981066", "%7.7ld",
-__LINE__, -0x1649692bL, "-373909803", "%#ld",
-__LINE__, 0x00664f47L, "664f47", "%+6.x",
-__LINE__, 0x00000000L, "0", "% X",
-__LINE__, 0x00000047L, "000047", "%.6X",
-__LINE__, 0x00000007L, "0000007", "%.7ld",
-__LINE__, 0x00000030L, "30", "%-x",
-__LINE__, -0x25bcbabbL, "-633125563", "% ld",
-__LINE__, 0xfe11c031L, "FE11C031", "%4.6X",
-__LINE__, -0x0000001L, "-0000001", "%.7d",
-__LINE__, 0x00b56d84L, "11890052", "%ld",
-__LINE__, -0x0000b01L, "-0002817", "%+07.7ld",
-__LINE__, 0xffffe4adL, "ffffe4ad", "% 0.0x",
-__LINE__, 0x007760fcL, "7760fc", "%+x",
-__LINE__, 0xffef44d8L, "FFEF44D8", "%X",
-__LINE__, 0xfcb6862eL, "fcb6862e", "%+x",
-__LINE__, -0x0000001L, "-1", "%0d",
-__LINE__, 0xffffffe6L, "FFFFFFE6", "%3.1X",
-__LINE__, 0xff816e27L, "FF816E27", "% 6.X",
-__LINE__, 0x00006415L, "25621", "%ld",
-__LINE__, -0xfae5449L, "-263083081", "%0ld",
-__LINE__, 0x00000001L, " 1", "% 0d",
-__LINE__, 0x00000009L, " 9", "%2.X",
-__LINE__, 0x002d7e18L, "2981400", "%7d",
-__LINE__, -0x00000fcL, "-0000252", "%-#.7d",
-__LINE__, 0x00000003L, "3", "%0x",
-__LINE__, 0x0d46e47fL, "222749823", "%ld",
-__LINE__, 0xfffcbc52L, "FFFCBC52", "%+X",
-__LINE__, 0x00000000L, "0", "%-X",
-__LINE__, 0xfffff0e5L, "fffff0e5", "%x",
-__LINE__, 0xffffffd9L, "FFFFFFD9", "%07X",
-__LINE__, 0x000004eeL, "4ee", "%0x",
-__LINE__, 0xffffffffL, "ffffffff", "%0x",
-__LINE__, -0x0008cb4L, "-036020", "%+3.6ld",
-__LINE__, 0x0000dadaL, "0xdada", "%#0.x",
-__LINE__, 0x0000001aL, "26 ", "%-4d",
-__LINE__, -0x000000cL, " -12", "%04.d",
-__LINE__, 0x0000025cL, " 25c", "%7.x",
-__LINE__, 0xfe9b091eL, "FE9B091E", "%X",
-__LINE__, 0x00000002L, " 2", "%07.ld",
-__LINE__, -0x0004930L, "-18736", "% 6.d",
-__LINE__, 0xffffffe9L, "FFFFFFE9", "%X",
-__LINE__, 0x00000003L, " 3", "%2.ld",
-__LINE__, 0x00000e00L, "3584", "%.4d",
-__LINE__, 0xffff38c2L, "ffff38c2", "%0.x",
-__LINE__, 0xffffffffL, "FFFFFFFF", "% .3X",
-__LINE__, 0xff7c1b2fL, "FF7C1B2F", "%-3.2X",
-__LINE__, -0x0000005L, "-5", "%2d",
-__LINE__, 0x00098775L, "98775", "%x",
-__LINE__, 0x000015ffL, " 15FF", "%6.X",
-__LINE__, 0xfffbe3efL, "FFFBE3EF", "%0.3X",
-__LINE__, -0x0000048L, "-72", "%ld",
-__LINE__, 0x0001488aL, "84106", "%d",
-__LINE__, 0x00000001L, "1", "%x",
-__LINE__, -0x0000002L, "-2", "%-0.0ld",
-__LINE__, -0x0000001L, "-1", "%-d",
-__LINE__, 0x0006616fL, "6616f", "%x",
-__LINE__, 0x3657856dL, "911705453", "%6.d",
-__LINE__, -0x0007222L, "-0029218", "%.7d",
-__LINE__, 0x00041606L, "267782", "%04.5d",
-__LINE__, 0x00000001L, " 1", "%2.ld",
-__LINE__, 0x00000219L, "219", "%0x",
-__LINE__, 0x0ae0184cL, "ae0184c", "%x",
-__LINE__, 0x00003a7dL, " 14973", "%7.ld",
-__LINE__, 0xffffffffL, "0XFFFFFFFF", "%#X",
-__LINE__, -0x0000002L, "-2", "%0ld",
-__LINE__, 0x00002cdfL, "11487", "%0ld",
-__LINE__, -0x000000cL, "-12", "%d",
-__LINE__, -0x000000eL, "-14", "%-#2d",
-__LINE__, 0x00000371L, "881", "%#ld",
-__LINE__, 0x000015beL, " 5566", "%5.ld",
-__LINE__, 0x01525b91L, "22174609", "%#0.0ld",
-__LINE__, 0xff8fc22fL, "FF8FC22F", "% X",
-__LINE__, -0x0007f7bL, "-32635", "%4.ld",
-__LINE__, 0x00007bcaL, "7bca", "%x",
-__LINE__, -0x0000582L, "-1410", "%ld",
-__LINE__, 0x00000047L, " +71", "%+04.2d",
-__LINE__, 0xf8a8dce2L, "f8a8dce2", "%+.6x",
-__LINE__, -0x000de2eL, "-56878", "%.0d",
-__LINE__, 0x019c03c1L, "0X19C03C1", "%#X",
-__LINE__, -0x0f3a43eL, "-15967294", "%ld",
-__LINE__, 0x00009e87L, "40583", "%#5.1d",
-__LINE__, 0x000000b8L, "184", "%0ld",
-__LINE__, -0x000befeL, "-48894", "%2ld",
-__LINE__, -0x002ee1aL, "-192026", "%.2d",
-__LINE__, 0x00004fd8L, "4fd8", "%x",
-__LINE__, 0x0006d57bL, "447867", "%2d",
-__LINE__, 0xfffffa9cL, "FFFFFA9C", "%-X",
-__LINE__, 0x0000000fL, "15", "%ld",
-__LINE__, 0x0005deb2L, "5DEB2", "% X",
-__LINE__, 0x00000007L, "7", "%X",
-__LINE__, 0xffffffc8L, "0XFFFFFFC8", "% #.1X",
-__LINE__, 0xfffff62fL, "FFFFF62F", "%X",
-__LINE__, -0x1a935bbaL, "-445864890", "% 3.5d",
-__LINE__, 0x000b34b4L, "0x0b34b4", "%-#3.6x",
-__LINE__, 0xfffff430L, "FFFFF430", "%X",
-__LINE__, 0x00000b5fL, "+0002911", "%+#.7d",
-__LINE__, 0x00000007L, " 7", "%3ld",
-__LINE__, 0xffffffd8L, "FFFFFFD8", "% .7X",
-__LINE__, 0xfffff544L, "FFFFF544", "%0X",
-__LINE__, -0x353667b9L, "-892757945", "%d",
-__LINE__, 0x00000058L, "0x00058", "%+#.5x",
-__LINE__, 0x39dbcc4aL, "+970705994", "%+0.6ld",
-__LINE__, 0xfffffffdL, "fffffffd", "% 01x",
-__LINE__, 0x00b1c28eL, "+11649678", "%+0ld",
-__LINE__, 0x000066c2L, "0X66C2", "%-#4X",
-__LINE__, 0x007171a2L, "+7434658", "%+07.ld",
-__LINE__, -0x0000001L, "-1", "%-d",
-__LINE__, 0x00000ae0L, "+2784", "%+0d",
-__LINE__, 0x13786a57L, "326658647", "%#5d",
-__LINE__, -0x0000001L, "-1", "%2.ld",
-__LINE__, -0x0168a16L, "-1477142", "%d",
-__LINE__, 0x12df7dd6L, "316636630", "%ld",
-__LINE__, 0x00000000L, "000000", "%1.6d",
-__LINE__, 0x266da2a9L, "644719273", "%ld",
-__LINE__, 0x0000004aL, "74", "%d",
-__LINE__, 0x000102ffL, "00102FF", "%+06.7X",
-__LINE__, 0x17916237L, "0x17916237", "%#5x",
-__LINE__, -0x0003cbbL, "-0015547", "%-.7d",
-__LINE__, 0xe7da2010L, "e7da2010", "%2.4x",
-__LINE__, 0xfffffff3L, "fffffff3", "% .7x",
-__LINE__, 0xfc9b64f8L, "FC9B64F8", "% 7.X",
-__LINE__, 0x000001afL, "431", "%0d",
-__LINE__, 0xffc81796L, "0xffc81796", "%#.5x",
-__LINE__, 0x057a1fbcL, "+91889596", "%+04d",
-__LINE__, 0x00001ae1L, "6881", "%ld",
-__LINE__, 0xfffffff6L, "fffffff6", "%3.0x",
-__LINE__, -0x6b7d5dbL, "-112711131", "%-06.1d",
-__LINE__, 0x008e8a5cL, " 8e8a5c", "%7.0x",
-__LINE__, 0xfe07a9bdL, "fe07a9bd", "%.1x",
-__LINE__, -0x00278e6L, "-162022", "%0ld",
-__LINE__, 0xf98709f5L, "F98709F5", "%X",
-__LINE__, -0x00000c9L, "-201", "% 1.d",
-__LINE__, -0x000001dL, "-00029", "%+2.5ld",
-__LINE__, 0x00000030L, " 48", "% d",
-__LINE__, 0xffd753f4L, "FFD753F4", "%0X",
-__LINE__, 0xfffffffdL, "FFFFFFFD", "%X",
-__LINE__, 0x0000a765L, "a765", "%x",
-__LINE__, 0x0026e2c8L, "26E2C8", "%-0X",
-__LINE__, -0x00003ebL, "-1003", "%3.1ld",
-__LINE__, 0x015d53caL, "22893514", "%0ld",
-__LINE__, -0x0000020L, "-32", "%ld",
-__LINE__, -0x03558ddL, "-3496157", "%1.0ld",
-__LINE__, -0x000007fL, "-127", "%1.d",
-__LINE__, 0xffffc737L, "0xffffc737", "%+#x",
-__LINE__, 0x0000a70dL, " a70d", "%6.x",
-__LINE__, 0x01ea0e31L, "0X1EA0E31", "% #1.X",
-__LINE__, 0x00b5f406L, "0X0B5F406", "%-#.7X",
-__LINE__, 0x0e58fa9aL, "240712346", "%.2d",
-__LINE__, 0xf43ff8a9L, "f43ff8a9", "%+0.6x",
-__LINE__, -0x5d0d3d3L, "-97571795", "%.3ld",
-__LINE__, -0x000027aL, "-634", "%0d",
-__LINE__, 0xffcef248L, "FFCEF248", "%07.X",
-__LINE__, 0x000002dcL, "2dc", "%0x",
-__LINE__, -0x31fa6c1L, "-52405953", "%.2d",
-__LINE__, 0x00000014L, "14", "%X",
-__LINE__, -0x0282f98L, "-2633624", "%ld",
-__LINE__, 0x00005f55L, "24405", "%#d",
-__LINE__, -0x0000004L, "-4", "%d",
-__LINE__, 0x00000001L, "1", "%+x",
-__LINE__, 0x013f47ceL, "13f47ce", "%0.x",
-__LINE__, 0x00143fceL, "1327054", "%.3d",
-__LINE__, 0x00000000L, "0", "%d",
-__LINE__, 0x00001f9aL, "1F9A", "% X",
-__LINE__, 0x00000cf5L, "cf5", "%x",
-__LINE__, 0xffea9c24L, "ffea9c24", "%x",
-__LINE__, 0xf09f85a7L, "F09F85A7", "%X",
-__LINE__, 0x00001e04L, "7684", "%ld",
-__LINE__, 0xffffc82aL, "ffffc82a", "%7x",
-__LINE__, -0x0000a77L, "-2679", "% d",
-__LINE__, 0x0019a859L, "+1681497", "%+2.6ld",
-__LINE__, -0x00002d7L, "-727", "%ld",
-__LINE__, 0x00011b82L, "72578", "%-#ld",
-__LINE__, 0x00000c32L, "3122", "%ld",
-__LINE__, -0x0000337L, "-823", "%1.d",
-__LINE__, 0x00000004L, "4", "%1ld",
-__LINE__, 0x0000062cL, "1580", "%.1ld",
-__LINE__, 0xffffffd3L, "FFFFFFD3", "% X",
-__LINE__, -0x07b1bf8L, "-8068088", "%#d",
-__LINE__, 0xfffffff9L, "fffffff9", "%x",
-__LINE__, 0x159e6cfbL, "159e6cfb", "%0.x",
-__LINE__, 0x0001148dL, "1148d", "%-.1x",
-__LINE__, 0x003373b7L, "3371959", "%#.0d",
-__LINE__, 0x00001af2L, "1af2", "%.4x",
-__LINE__, -0x0000001L, "-000001", "%+.6ld",
-__LINE__, -0x00001a3L, "-419", "%d",
-__LINE__, 0xfdb232e7L, "fdb232e7", "%5.4x",
-__LINE__, -0x000000dL, "-13", "%d",
-__LINE__, 0x98ec1c74L, "98ec1c74", "% 3x",
-__LINE__, 0xfffffff8L, "fffffff8", "%+1.4x",
-__LINE__, -0x0000d58L, "-3416", "%+#0ld",
-__LINE__, -0x65d1973L, "-106764659", "%.6d",
-__LINE__, -0x0737641L, "-7566913", "%-d",
-__LINE__, 0x0000037cL, "37c", "%+0x",
-__LINE__, 0x0000012cL, "0000300", "%#3.7d",
-__LINE__, 0x00c12d9bL, "12660123", "%1.5ld",
-__LINE__, 0xe7e5e77dL, "e7e5e77d", "%6x",
-__LINE__, 0x1fe0e820L, "1FE0E820", "%-4X",
-__LINE__, 0xc85a793aL, "C85A793A", "%X",
-__LINE__, 0x05f9fe2cL, "100269612", "%#ld",
-__LINE__, 0x00000032L, "0X32", "%+#4.1X",
-__LINE__, 0xfab4ce81L, "fab4ce81", "%3.x",
-__LINE__, -0x0000009L, "-9", "%2.d",
-__LINE__, 0xffff8d2eL, "ffff8d2e", "% 6x",
-__LINE__, 0xfffffffeL, "0xfffffffe", "%#x",
-__LINE__, 0x02960f60L, "2960f60", "%1.x",
-__LINE__, 0x34cf3cbcL, " 885996732", "% 5ld",
-__LINE__, -0x000006eL, "-110", "% d",
-__LINE__, -0x0000001L, "-1", "%-.0d",
-__LINE__, 0x000000b1L, " B1", "%+7X",
-__LINE__, 0xfffff5b4L, "FFFFF5B4", "%01.7X",
-__LINE__, 0x00000086L, "86", "%0X",
-__LINE__, 0x00074367L, " 74367", "% 6x",
-__LINE__, 0x001000d7L, "+1048791", "%+ld",
-__LINE__, 0x00000f35L, " 3893", "% d",
-__LINE__, -0x00000e1L, "-225", "%d",
-__LINE__, 0xffff6694L, "FFFF6694", "%6.X",
-__LINE__, 0x00019cf7L, "19cf7", "%0.x",
-__LINE__, 0x00000046L, "0046", "%+.4X",
-__LINE__, -0x000001fL, "-31", "%ld",
-__LINE__, 0xfff25859L, "fff25859", "%6x",
-__LINE__, 0x21884061L, "562577505", "%#ld",
-__LINE__, 0x01448b7aL, "1448B7A", "%0.1X",
-__LINE__, 0xffffffc0L, "ffffffc0", "%x",
-__LINE__, 0xfffffed5L, "fffffed5", "% 1.0x",
-__LINE__, 0x0e349767L, "E349767", "%.5X",
-__LINE__, 0x00000330L, "816", "%0d",
-__LINE__, -0x0000016L, "-22", "%d",
-__LINE__, 0xffff9babL, "FFFF9BAB", "%X",
-__LINE__, 0xffffee4eL, "ffffee4e", "%x",
-__LINE__, 0x0026beebL, "2539243", "%6.d",
-__LINE__, 0x00002c6cL, "11372", "%.2d",
-__LINE__, -0x000002cL, "-44", "%ld",
-__LINE__, -0x001dcfaL, "-122106", "% d",
-__LINE__, 0x0001683cL, "92220", "%#4.ld",
-__LINE__, 0x09b51fc9L, "9b51fc9", "%+.7x",
-__LINE__, 0x0000001dL, "29", "%0ld",
-__LINE__, -0x83f17e5L, "-138352613", "%ld",
-__LINE__, 0xfa4e2c1bL, "fa4e2c1b", "%x",
-__LINE__, 0x000001f3L, "499", "%0ld",
-__LINE__, 0xffff03e4L, "ffff03e4", "%x",
-__LINE__, 0x000000acL, "+0172", "%+.4ld",
-__LINE__, 0x03c3903bL, "63148091", "%00d",
-__LINE__, 0x0000000dL, "13", "%#d",
-__LINE__, 0x0000002eL, "0X2E", "%#X",
-__LINE__, 0x00006b2dL, "6B2D", "%X",
-__LINE__, 0x0000010bL, " 0010b", "%7.5x",
-__LINE__, 0x0000017aL, " 17a", "%4x",
-__LINE__, 0xfffffffbL, "fffffffb", "%+x",
-__LINE__, 0xffffac6aL, "ffffac6a", "%-.3x",
-__LINE__, -0x0005870L, "-22640", "%0d",
-__LINE__, 0x189c17bcL, "189c17bc", "%x",
-__LINE__, -0x01bbc38L, "-1817656", "%#6.ld",
-__LINE__, -0x3382b55L, "-54012757", "%d",
-__LINE__, -0x0000007L, "-7", "%-ld",
-__LINE__, -0x000c74bL, "-51019", "%ld",
-__LINE__, 0x0001a6f2L, "+108274", "%+#1.ld",
-__LINE__, 0x00077448L, "77448", "%x",
-__LINE__, 0x00000000L, "0", "%x",
-__LINE__, 0xfffff056L, "FFFFF056", "%.3X",
-__LINE__, -0x6f3f9451L, "-1866437713", "%-#3.0ld",
-__LINE__, 0x000000acL, "AC", "%X",
-__LINE__, 0xffc8752fL, "ffc8752f", "%-x",
-__LINE__, 0xfffffe6dL, "FFFFFE6D", "%2.X",
-__LINE__, -0x377f1a5L, "-58192293", "% .2d",
-__LINE__, -0x0000294L, "-660", "%d",
-__LINE__, 0xfffffffeL, "fffffffe", "%-x",
-__LINE__, 0xfffcbbe8L, "0xfffcbbe8", "%-#4.x",
-__LINE__, 0x0022e510L, "+2286864", "%+ld",
-__LINE__, 0xfffffe2aL, "FFFFFE2A", "%0.3X",
-__LINE__, 0xfe29f7c0L, "fe29f7c0", "%x",
-__LINE__, 0xfffe957eL, "FFFE957E", "%X",
-__LINE__, 0x000080f8L, "33016", "%ld",
-__LINE__, 0x0003ee2cL, " 257580", "%7d",
-__LINE__, 0x000003a1L, "929", "%d",
-__LINE__, 0x0000021fL, "21f", "%+x",
-__LINE__, 0xffffffffL, "ffffffff", "%.5x",
-__LINE__, -0x040a988L, "-4237704", "%-d",
-__LINE__, 0x027c8b69L, "41716585", "%ld",
-__LINE__, 0x00000003L, "3", "%-X",
-__LINE__, -0x0000368L, " -872", "%7.d",
-__LINE__, 0x00000d3cL, "3388", "%0.2d",
-__LINE__, -0x33734ccL, "-53949644", "%2ld",
-__LINE__, 0x000003dbL, "3DB", "%X",
-__LINE__, -0x00f154dL, "-988493", "%5d",
-__LINE__, 0x0000000bL, " 11", "%4.ld",
-__LINE__, 0x00000067L, "103", "%-ld",
-__LINE__, -0x0199fceL, "-1679310", "%4d",
-__LINE__, 0x02b6266bL, "2b6266b", "% x",
-__LINE__, -0x006b39dL, "-439197", "%+d",
-__LINE__, 0x00000007L, "7", "%ld",
-__LINE__, 0x0141fc98L, "21101720", "%0ld",
-__LINE__, -0x0008420L, "-33824", "%d",
-__LINE__, 0x0011622bL, "1139243", "%6ld",
-__LINE__, 0x0000001bL, "27", "%-d",
-__LINE__, -0x0030935L, "-198965", "%3d",
-__LINE__, 0x0000001fL, " 1f", "%4.x",
-__LINE__, -0x10782a19L, "-276310553", "%#ld",
-__LINE__, -0x007eac4L, "-518852", "%06.ld",
-__LINE__, 0x0bc4c681L, "197445249", "%6ld",
-__LINE__, 0x000000f5L, "245", "%.3ld",
-__LINE__, 0x00000197L, "197", "%X",
-__LINE__, 0xfffffeabL, "FFFFFEAB", "% X",
-__LINE__, 0x00000f05L, "F05", "%+X",
-__LINE__, 0xffe1b785L, "0xffe1b785", "%#x",
-__LINE__, -0x02d3581L, "-2962817", "%05d",
-__LINE__, 0xffffb994L, "FFFFB994", "%X",
-__LINE__, 0x03d139a3L, "64043427", "%ld",
-__LINE__, -0x0000002L, " -2", "%+4.d",
-__LINE__, -0x043da83L, "-4446851", "%#ld",
-__LINE__, -0x6aad891L, "-111859857", "%7.ld",
-__LINE__, 0x00003e68L, "15976", "%-4.5ld",
-__LINE__, 0xffe4d3eeL, "FFE4D3EE", "%X",
-__LINE__, 0x00000002L, "000002", "%4.6ld",
-__LINE__, 0xffffee32L, "ffffee32", "%4x",
-__LINE__, 0x0cb7dd25L, "cb7dd25", "%3x",
-__LINE__, 0xf773d422L, "F773D422", "%X",
-__LINE__, -0x0b590f7L, "-11899127", "%#d",
-__LINE__, -0x0002c45L, "-11333", "%-#5ld",
-__LINE__, -0x1efc9e4L, "-32492004", "%ld",
-__LINE__, -0x0003b9cL, "-15260", "%d",
-__LINE__, 0x000001b6L, "0X1B6", "%#4X",
-__LINE__, 0x3ce93ec3L, "1021918915", "%.6d",
-__LINE__, 0xffffffffL, "ffffffff", "%-x",
-__LINE__, 0xfffaf0e4L, "fffaf0e4", "%2.x",
-__LINE__, 0x00000002L, "0x2", "%#x",
-__LINE__, 0x0000e806L, "e806", "%4x",
-__LINE__, 0xfffffff0L, "fffffff0", "% 2.x",
-__LINE__, 0xfffffc0eL, "fffffc0e", "%+.4x",
-__LINE__, 0xfd45716eL, "FD45716E", "%.4X",
-__LINE__, 0xfff96fdaL, "FFF96FDA", "%-X",
-__LINE__, 0xff99d08aL, "FF99D08A", "%.5X",
-__LINE__, 0x00000002L, "2", "%-00.d",
-__LINE__, -0x000000fL, " -15", "%6.ld",
-__LINE__, -0x00d321cL, "-864796", "%#1ld",
-__LINE__, 0xff19ff8dL, "ff19ff8d", "%1.5x",
-__LINE__, 0x00000000L, "0000000", "%-.7x",
-__LINE__, 0x0000f50dL, " F50D", "%5X",
-__LINE__, 0x00001688L, " 5768", "%7.ld",
-__LINE__, 0x00000157L, "343", "%2ld",
-__LINE__, 0xfffffffdL, "0xfffffffd", "%+#3x",
-__LINE__, 0x00000d52L, "3410", "%ld",
-__LINE__, 0x00000003L, "3", "%d",
-__LINE__, 0x0001c6d2L, "01c6d2", "%.6x",
-__LINE__, 0x242d65d2L, "606954962", "%#7.ld",
-__LINE__, 0x00000e9fL, "0000E9F", "%5.7X",
-__LINE__, 0x0002d785L, "2D785", "%0X",
-__LINE__, 0x00000167L, "167", "%0X",
-__LINE__, 0xfffff5e5L, "fffff5e5", "% x",
-__LINE__, 0xffb69a04L, "0xffb69a04", "%#0.x",
-__LINE__, 0xfffa012eL, "FFFA012E", "%X",
-__LINE__, 0x0000001aL, "0x1a", "% #x",
-__LINE__, 0xfffb26d3L, "fffb26d3", "%+x",
-__LINE__, -0x00003e6L, " -998", "%7ld",
-__LINE__, 0x00000004L, "4", "%-d",
-__LINE__, 0xfffffd76L, "0XFFFFFD76", "%#7X",
-__LINE__, 0x00000035L, "53", "%ld",
-__LINE__, 0xffc6c190L, "0XFFC6C190", "%#X",
-__LINE__, 0xffffffe2L, "ffffffe2", "%7.0x",
-__LINE__, 0x03ff1b87L, "67050375", "%2.d",
-__LINE__, 0x00020c47L, "0X20C47", "%#X",
-__LINE__, 0x00000000L, "0", "%d",
-__LINE__, 0x0000000eL, "0X000E", "% #.4X",
-__LINE__, -0x00035cdL, "-13773", "%+2.d",
-__LINE__, 0x00005eecL, "5eec", "%1x",
-__LINE__, 0x001da0ffL, "1941759", "%0d",
-__LINE__, 0xf8a9e96aL, "f8a9e96a", "%+x",
-__LINE__, -0x0000120L, "-288 ", "%-#6.d",
-__LINE__, 0x00000000L, "0", "%-X",
-__LINE__, 0x0000152eL, "152E", "%+X",
-__LINE__, -0x0001077L, "-4215", "% 0d",
-__LINE__, 0xffffffd7L, "FFFFFFD7", "%0X",
-__LINE__, 0xfffe097dL, "FFFE097D", "%2X",
-__LINE__, 0xcb982712L, "cb982712", "%x",
-__LINE__, 0xfff39f2eL, "FFF39F2E", "%.5X",
-__LINE__, -0x0058caeL, "-363694", "%+.1d",
-__LINE__, -0x000002bL, "-043", "%#1.3d",
-__LINE__, -0x001e989L, "-125321", "%1d",
-__LINE__, 0x00959ecdL, "9805517", "%d",
-__LINE__, 0xf49df846L, "F49DF846", "%+3X",
-__LINE__, 0xfffffffdL, "fffffffd", "%+.5x",
-__LINE__, -0x000ac76L, "-44150", "%3.ld",
-__LINE__, 0x00000028L, " 0028", "%06.4x",
-__LINE__, 0x000003e8L, "3E8", "%-02X",
-__LINE__, 0x00000012L, "012", "%.3X",
-__LINE__, 0x00000006L, "0X6", "%#X",
-__LINE__, 0x00ef8479L, "+15697017", "%+0.6d",
-__LINE__, 0xffffffe8L, "FFFFFFE8", "%-X",
-__LINE__, 0x773a90f7L, "773a90f7", "%3.5x",
-__LINE__, 0x00096d44L, "96D44", "%-X",
-__LINE__, -0x08a3d96L, "-9059734", "%ld",
-__LINE__, -0x000001aL, "-26", "%00.ld",
-__LINE__, 0x32f57585L, "32f57585", "% x",
-__LINE__, 0x2825f175L, "2825F175", "%X",
-__LINE__, 0x000054ffL, "21759", "%-2d",
-__LINE__, -0x0266cdcL, "-2518236", "%ld",
-__LINE__, 0x0000031dL, "0X31D", "%+#4X",
-__LINE__, 0x0003fc99L, "3fc99", "%x",
-__LINE__, -0x0064624L, "-411172", "%-#d",
-__LINE__, 0x0001b2d9L, "111321", "%-ld",
-__LINE__, -0x000007cL, "-124", "%#d",
-__LINE__, 0xfffffffaL, "FFFFFFFA", "%+X",
-__LINE__, -0x007a5b8L, "-501176", "%+ld",
-__LINE__, 0x0213b583L, "213B583", "%2.X",
-__LINE__, 0xfff12e51L, "FFF12E51", "%+X",
-__LINE__, 0x00052403L, "0336899", "%-0.7d",
-__LINE__, 0xffffffffL, "ffffffff", "%-04.4x",
-__LINE__, 0x00000010L, "0010", "%0.4X",
-__LINE__, 0xffffffb5L, "FFFFFFB5", "%-1.3X",
-__LINE__, -0x0000001L, "-1", "%d",
-__LINE__, 0x0003a2d1L, "3a2d1", "% x",
-__LINE__, 0x00000424L, "1060", "%0ld",
-__LINE__, -0x0000078L, "-120", "%1d",
-__LINE__, 0x00000000L, "0", "%ld",
-__LINE__, 0x00000414L, "1044", "%ld",
-__LINE__, 0x00000072L, "0x072", "%#5.3x",
-__LINE__, 0x0000007aL, "7A", "% X",
-__LINE__, 0x081542a3L, "135611043", "%0d",
-__LINE__, 0xfffb4ce6L, "fffb4ce6", "%4.6x",
-__LINE__, 0x00002ab2L, "2ab2", "%-1x",
-__LINE__, 0x00000000L, " 0", "% 2x",
-__LINE__, 0xfffffa59L, "FFFFFA59", "%2.X",
-__LINE__, 0xffffe22bL, "ffffe22b", "%-x",
-__LINE__, 0xfffffd52L, "FFFFFD52", "%+.2X",
-__LINE__, 0x0000039fL, "927", "%-d",
-__LINE__, 0x0002dea6L, "2dea6", "%0x",
-__LINE__, 0x000216dbL, "136923", "%ld",
-__LINE__, 0x00000013L, "19", "%0d",
-__LINE__, 0x000047ccL, "18380", "%2.2ld",
-__LINE__, -0x0007d10L, "-32016", "%d",
-__LINE__, 0xff9af906L, "FF9AF906", "%0X",
-__LINE__, 0x02cfa224L, "+47161892", "%+0.7d",
-__LINE__, -0x0000022L, "-34", "%1.d",
-__LINE__, 0xfffffff0L, "FFFFFFF0", "%-4X",
-__LINE__, 0x00000029L, " 41", "%6.ld",
-__LINE__, 0xffffff76L, "ffffff76", "%x",
-__LINE__, 0x00000000L, "0", "%+X",
-__LINE__, 0x00000001L, "1", "%d",
-__LINE__, 0xfff6de5aL, "FFF6DE5A", "%X",
-__LINE__, 0x00000002L, "2", "%ld",
-__LINE__, 0x00000025L, "25", "%+x",
-__LINE__, 0xfffffffbL, "FFFFFFFB", "%5.0X",
-__LINE__, 0x0011bbb5L, "1162165", "%0.0ld",
-__LINE__, 0xfffcdc96L, "0XFFFCDC96", "%#X",
-__LINE__, 0x00008f5fL, "8f5f", "%3.1x",
-__LINE__, 0xffa0fa5dL, "0XFFA0FA5D", "%#X",
-__LINE__, 0x00004534L, "4534", "% 0X",
-__LINE__, 0xfffffff9L, "fffffff9", "%.2x",
-__LINE__, 0xffeeae50L, "ffeeae50", "%-x",
-__LINE__, 0x00002964L, " 0010596", "% 0.7d",
-__LINE__, 0x000021c9L, " 21c9", "%6x",
-__LINE__, 0x00000001L, " 1", "% d",
-__LINE__, 0x0002abd8L, "+175064", "%+d",
-__LINE__, 0xffffffadL, "FFFFFFAD", "%+0X",
-__LINE__, 0x00000003L, "3", "%ld",
-__LINE__, 0x0c036da3L, " 201551267", "% .3d",
-__LINE__, -0x004343cL, "-275516", "%+ld",
-__LINE__, 0x00000003L, "003", "% .3x",
-__LINE__, 0xffffe34eL, "ffffe34e", "%x",
-__LINE__, 0x0000e118L, "e118", "%x",
-__LINE__, -0x007d945L, "-514373", "%+#0ld",
-__LINE__, 0x277f1cc5L, "277f1cc5", "% x",
-__LINE__, 0x00003befL, "03bef", "% 0.5x",
-__LINE__, 0xfffffcb9L, "fffffcb9", "%x",
-__LINE__, 0x0003311aL, "209178", "%ld",
-__LINE__, 0x00000000L, " ", "%3.ld",
-__LINE__, 0x05942225L, "5942225", "%x",
-__LINE__, 0xfffceb4cL, "FFFCEB4C", "%-X",
-__LINE__, 0xffd08633L, "ffd08633", "%2.x",
-__LINE__, -0x0000001L, " -1", "%6d",
-__LINE__, 0x000fdb12L, "1039122", "%d",
-__LINE__, 0x00000003L, "3", "% 0X",
-__LINE__, -0x2fd5bf1L, "-50158577", "% 5.ld",
-__LINE__, -0x0089a03L, "-563715", "%-d",
-__LINE__, 0xfffffffeL, "FFFFFFFE", "% X",
-__LINE__, 0x29fdb2baL, "29fdb2ba", "% 0x",
-__LINE__, 0x0000008fL, "8F", "% X",
-__LINE__, 0x00000003L, "3", "%ld",
-__LINE__, 0xffc58445L, "FFC58445", "%.2X",
-__LINE__, -0x00023f6L, "-9206", "%+d",
-__LINE__, 0x00000011L, "11", "%X",
-__LINE__, -0x0000003L, "-0000003", "%-.7d",
-__LINE__, -0x0000003L, "-3", "%#ld",
-__LINE__, 0x001242d9L, "1242D9", "%X",
-__LINE__, -0x48d0c81L, "-76352641", "%7.d",
-__LINE__, -0x001b675L, "-112245", "%#ld",
-__LINE__, 0x00000003L, "3", "%-d",
-__LINE__, 0xfff93fdfL, "0XFFF93FDF", "% #X",
-__LINE__, 0x001a9414L, "1741844", "%#ld",
-__LINE__, 0x0001fd86L, "130438", "%ld",
-__LINE__, 0x010f37a8L, "17774504", "%4.7d",
-__LINE__, 0x00382838L, "0382838", "%3.7X",
-__LINE__, -0x47fd56c2L, "-1207785154", "%ld",
-__LINE__, 0x001981ddL, "1981dd", "%x",
-__LINE__, 0xffffefbaL, "ffffefba", "% 06.x",
-__LINE__, -0x3f402b29L, "-1061169961", "%+#ld",
-__LINE__, -0x395aae44L, "-962244164", "%-1d",
-__LINE__, 0x1fa39f42L, "530816834", "%#d",
-__LINE__, -0x000358dL, "-13709", "%d",
-__LINE__, -0xdc17b8fL, "-230783887", "%ld",
-__LINE__, -0x23c41583L, "-600053123", "%+3.d",
-__LINE__, 0xfffffc16L, "fffffc16", "%x",
-__LINE__, 0x003f1364L, "4133732", "%7.ld",
-__LINE__, 0xffffe691L, "FFFFE691", "%07X",
-__LINE__, 0x07b31d71L, "129178993", "%.7d",
-__LINE__, -0x0019732L, "-104242", "% ld",
-__LINE__, 0x02428167L, "0x2428167", "%#x",
-__LINE__, -0x06c1ecdL, "-7085773", "%.7ld",
-__LINE__, 0xfb01cb4eL, "fb01cb4e", "%x",
-__LINE__, 0x00005a41L, "+23105", "%+ld",
-__LINE__, 0xfffffff4L, "FFFFFFF4", "%-5.X",
-__LINE__, 0x00000005L, " 5", "%4.ld",
-__LINE__, 0xf4ab4b2dL, "F4AB4B2D", "%0.X",
-__LINE__, -0x000fce3L, "-64739", "%+#3.ld",
-__LINE__, 0x000076eaL, " 30442", "%6.2ld",
-__LINE__, 0x00000cb9L, " cb9", "%4.x",
-__LINE__, 0x002f43efL, "3097583", "%1.1ld",
-__LINE__, 0xf5bd0105L, "F5BD0105", "%+X",
-__LINE__, 0x0037954aL, "3642698", "%d",
-__LINE__, 0xfffffff7L, "0XFFFFFFF7", "%-#X",
-__LINE__, 0xffffcedfL, "0xffffcedf", "%#6.7x",
-__LINE__, 0xfffffde4L, "FFFFFDE4", "%2.4X",
-__LINE__, 0x01a6f103L, "1a6f103", "%5.x",
-__LINE__, 0x00000191L, " 191", "%7.0X",
-__LINE__, 0x00000003L, "03", "% .2X",
-__LINE__, -0xd4e3219L, "-223228441", "%6.ld",
-__LINE__, 0x00b0efbdL, "11595709", "%d",
-__LINE__, -0x00000eaL, "-234", "%#3d",
-__LINE__, 0x00000be8L, "BE8 ", "%-5X",
-__LINE__, 0xffffffffL, "ffffffff", "%5.3x",
-__LINE__, -0x267f8c6L, "-40368326", "%d",
-__LINE__, 0x000006edL, "6ED", "%X",
-__LINE__, 0xfdd6c9b6L, "FDD6C9B6", "%X",
-__LINE__, 0x0007ac29L, "7ac29", "%-x",
-__LINE__, 0x00000014L, "14", "%2x",
-__LINE__, 0x123ca563L, "+305964387", "%+ld",
-__LINE__, 0x00000004L, " 4", "%5.d",
-__LINE__, 0xffff877aL, "ffff877a", "%x",
-__LINE__, -0x00003e7L, "-999", "%+0.3d",
-__LINE__, 0x0a68ba6eL, "a68ba6e", "%3.1x",
-__LINE__, 0xfe29c810L, "FE29C810", "%+X",
-#endif
-
-__LINE__, 0x00000000L, "0", "%o",
-__LINE__, 0000000123L, "123", "%o",
-__LINE__, 0000123456L, "0123456", "%#o",
-__LINE__, 0000123456L, "00123456", "%#.8o",
-__LINE__, 0000123456L, " 00123456", "%#10.8o",
-__LINE__, 0x00000123L, "0x00123", "%#07x",
-
-0,
-};
-
-int main()
-{
- int errcount = 0;
- int testcount = 0;
-#define BSIZE 1024
- char buffer[BSIZE];
- sprint_int_type *iptr;
-#if defined(__cplusplus) && !defined(TEST_LIBIO)
-
- ostrstream sstr(buffer, BSIZE);
-
- for (iptr = sprint_ints; iptr->line; iptr++) {
- sstr.seekp(0);
- sstr.form(iptr->format_string, iptr->value);
- sstr << ends;
- if (strcmp(buffer, iptr->result) != 0) {
- errcount++;
- cerr << "Error in line " << iptr->line;
- cerr << " using \"" << iptr->format_string;
- cerr << "\". Result is \"" << buffer << "\"; should be: \"";
- cerr << iptr->result << "\".\n";
- }
- testcount++;
- }
-
-
- if (errcount == 0) {
- cerr << "Encountered no errors in " << testcount << " tests.\n";
- return 0;
- }
- else {
- cerr << "Encountered " << errcount << " errors in "
- << testcount << " tests.\n";
- return 1;
- }
-#else
- for (iptr = sprint_ints; iptr->line; iptr++)
- {
- if (sizeof(int)==2)
- {
- /* Cheezy, but effective. */
- char buf[30];
- int len = strlen(iptr->format_string);
-
- strcpy(buf, iptr->format_string);
- if(buf[len-2] != 'l') {
- buf[len] = buf[len-1];
- buf[len-1] = 'l';
- buf[len+1] = 0;
- }
- sprintf(buffer, buf, iptr->value);
- }
- else
- {
- sprintf(buffer, iptr->format_string, iptr->value);
- }
- if (strcmp(buffer, iptr->result) != 0) {
- errcount++;
- fprintf(stderr,
- "Error in line %d using \"%s\". Result is \"%s\"; should be: \"%s\".\n",
- iptr->line, iptr->format_string, buffer, iptr->result);
- fprintf(stderr,"%ld\n",iptr->value);
- }
- testcount++;
- }
-
- if (errcount == 0) {
- fprintf(stderr, "Encountered no errors in %d tests.\n", testcount);
- return 0;
- }
- else {
- fprintf(stderr, "Encountered %d errors in %d tests.\n",
- errcount, testcount);
- return 1;
- }
-#endif
-}
diff --git a/contrib/libio/tests/tiomanip.cc b/contrib/libio/tests/tiomanip.cc
deleted file mode 100644
index b7dd08a4618e..000000000000
--- a/contrib/libio/tests/tiomanip.cc
+++ /dev/null
@@ -1,35 +0,0 @@
-// test the parametrized manipulators
-
-#include <stdlib.h>
-#include <iomanip.h>
-
-main()
-{
-#ifdef _G_NO_TEMPLATES
- cerr << "(IO manipulators are not supported with this compiler)\n");
- exit(-1);
-#else
-
- cout << dec << 1234 << ' '
- << hex << 1234 << ' '
- << oct << 1234 << endl;
-
- //SMANIP<int> x = setw(4);
- //operator<<(cout, x);
-
- cout
- << "("
- << dec << setw(4) << setfill('*')
- << 12 << ")\n";
-
- cout << "(" << 12 << ")\n";
-
- cout << setiosflags(ios::internal);
- cout << "(" << setw(6) << -12 << ")\n";
-
- exit(0);
-#endif
-}
-
-
-
diff --git a/contrib/libio/tests/tiomanip.exp b/contrib/libio/tests/tiomanip.exp
deleted file mode 100644
index 7a0a7ea5cb21..000000000000
--- a/contrib/libio/tests/tiomanip.exp
+++ /dev/null
@@ -1,4 +0,0 @@
-1234 4d2 2322
-(**12)
-(12)
-(-***12)
diff --git a/contrib/libio/tests/tiomisc.cc b/contrib/libio/tests/tiomisc.cc
deleted file mode 100644
index 207a3f16e2b4..000000000000
--- a/contrib/libio/tests/tiomisc.cc
+++ /dev/null
@@ -1,236 +0,0 @@
-/* Random regression tests etc. */
-
-#include <fstream.h>
-#include <stdio.h>
-#include <strstream.h>
-#include <string.h>
-#include <fcntl.h>
-#include <stdlib.h>
-#include <assert.h>
-
-#define BUF_SIZE 4096
-
-void
-test1 ()
-{
- fstream f;
- char buf[BUF_SIZE];
-
- f.setbuf( buf, BUF_SIZE );
-}
-
-void
-test2 ( )
-{
- char string[BUF_SIZE];
- ostrstream s( string, BUF_SIZE );
-
- s << "Bla bla bla " << 55 << ' ' << 3.23 << '\0' << endl;
- cout << "Test2: " << string << endl;
-}
-
-
-/* Test case from Joe Buck <jbuck@Synopsys.COM>. */
-
-class special_ofstream : public ofstream {
-public:
- special_ofstream() : ofstream() {}
- special_ofstream(int fd) : ofstream(fd) {}
- special_ofstream(const char *name, int mode=ios::out, int prot=0664) {
- open(name,mode,prot);
- }
- void open(const char *name, int mode=ios::out, int prot=0664);
-};
-
-void special_ofstream::open(const char* name, int mode, int prot) {
- if (strcmp(name, "<cout>") == 0) {
- rdbuf()->attach(1);
- }
- else if (strcmp(name, "<cerr>") == 0) {
- rdbuf()->attach(2);
- setf(unitbuf);
- }
- else ofstream::open(name,mode,prot);
-}
-
-void
-test3 ()
-{
- {
- special_ofstream o("<cout>");
- o << "Hello\n";
- // o is destructed now. This should not close cout
- }
- {
- special_ofstream o("<cout>");
- o << "Line 2\n";
- }
-}
-
-void
-getline_test1 ()
-{
- char buf[1000];
- char data[] = "#include <iostream.h>\n#include <fstream.h>\n";
- istrstream infile(data, strlen(data));
- infile.getline(buf,1000);
- infile.getline(buf,1000);
-
- cout << buf << '\n';
-}
-
-// test istream::getline on readng overlong lines.
-void
-getline_test2 ()
-{
- char data[] = "Line one.\nline 2.\n";
- char line[100];
- istrstream strin(data, strlen(data));
- strin.getline(line, 10);
- cout << "line: " << line << ", count: " << strin.gcount () << "\n";
-}
-
-void
-getline_test3 ()
-{
- char data[] = "123456789\nabcdefghijkl.\n";
- char line[10];
- istrstream strin(data, strlen(data));
- strin.getline(line, 10);
- cout << "line: " << line << ", count: " << strin.gcount () << "\n";
- strin.getline(line, 10);
- cout << "line: " << line << ", count: " << strin.gcount () << "\n";
- assert (!strin.good());
- strin.clear ();
- strin.getline(line, 10);
- cout << "line: " << line << ", count: " << strin.gcount () << "\n";
-}
-
-class A : private ostream
-{
-public:
- A(streambuf* s);
- ostream::flush;
-};
-A::A(streambuf* s)
-: ostream(s)
-{
-}
-
-void
-flush1_test()
-{
- A os(cout.rdbuf());
- os.flush();
-}
-
-void
-reread_test ()
-{ // This is PR 5486.
- int tag_char;
- char *fname = "Makefile";
- int mode = O_RDONLY;
- filebuf file_p;
-
- int fd = ::open(fname, mode, 0666);
- file_p.attach(fd);
-
- istream d_istream(&file_p);
-
- // Read a character from the stream, save it and put it back.
- tag_char = d_istream.get();
- int save_char = tag_char;
- d_istream.putback((char) tag_char);
-
- // Uncomment then next statement and the next get will be EOF.
- streampos pos = d_istream.tellg();
-
- // Re-read the first character
- tag_char = d_istream.get();
-
- cout << "reread_test: " << (char)save_char << " " << (char)tag_char << "\n";
- cout.flush();
-
-}
-
-void *danger_pointer;
-void operator delete (void *p) throw()
-{
- if (p)
- {
- if (p == danger_pointer)
- fprintf (stderr, "maybe deleted\n");
-
- free (p);
- }
-}
-
-struct my_ostream: virtual public ios, public ostream
-{
- my_ostream (ostream &s): ios (s.rdbuf()) { }
-};
-
-void
-test_destroy ()
-{
- ofstream fstr ("foo.dat");
- my_ostream wa (fstr);
-
- /* Check that sure wa.rdbuf() is only freed once. */
- danger_pointer = wa.rdbuf ();
-
- wa << "Hi there" << endl;
-#ifdef _IO_NEW_STREAMS
- fprintf (stderr, "maybe deleted\n");
-#endif
-}
-
-/* Submitted by Luke Blanshard <luke@cs.wisc.edu>.
-
- In certain circumstances, the library will write past the end of the
- buffer it has allocated for a file: You must read from the file,
- exactly enough bytes that the read pointer is at the end of the
- buffer. Then you must write to the file, at the same place you just
- finished reading from.
-
- "Your patch looks great, and you're welcome to use the test code for any
- purpose whatever. I hereby renounce my implicit copyright on it." */
-
-void
-test_read_write_flush ()
-{
- fstream f;
- char buf[8192];
-
- for ( int index=0; index < sizeof buf; ++index )
- buf[index] = (index+1)&63? 'x' : '\n';
-
- f.open( "foo.dat", ios::in|ios::out|ios::trunc );
- f.write( buf, sizeof buf );
-
- f.seekg( 0, ios::beg );
- f.read( buf, sizeof buf );
-
-// f.seekp( sizeof buf, ios::beg ); // Present or absent, bug still happens.
- f.write( "a", 1 );
-
- if ( f.rdbuf()->_IO_write_ptr > f.rdbuf()->_IO_buf_end )
- cerr << "test_read_write_flush: it's broken.\n";
- else
- cout << "test_read_write_flush: the problem isn't showing itself.\n";
-}
-
-int main( )
-{
- test1 ();
- test2 ();
- test3 ();
- getline_test1 ();
- getline_test2 ();
- getline_test3 ();
- flush1_test ();
- reread_test ();
- test_destroy ();
- test_read_write_flush ();
- return 0;
-}
diff --git a/contrib/libio/tests/tiomisc.exp b/contrib/libio/tests/tiomisc.exp
deleted file mode 100644
index 26a3acd33fb1..000000000000
--- a/contrib/libio/tests/tiomisc.exp
+++ /dev/null
@@ -1,11 +0,0 @@
-Test2: Bla bla bla 55 3.23
-Hello
-Line 2
-#include <fstream.h>
-line: Line one., count: 10
-line: 123456789, count: 10
-line: abcdefghi, count: 9
-line: jkl., count: 5
-reread_test: # #
-maybe deleted
-test_read_write_flush: the problem isn't showing itself.
diff --git a/contrib/libio/tests/tstdiomisc.c b/contrib/libio/tests/tstdiomisc.c
deleted file mode 100644
index cd8e88fd6cec..000000000000
--- a/contrib/libio/tests/tstdiomisc.c
+++ /dev/null
@@ -1,43 +0,0 @@
-#ifndef STDIO_H
-#define STDIO_H <iostdio.h>
-#endif
-#include STDIO_H
-
-void
-t1 ()
-{
- int n = -1;
- sscanf ("abc ", "abc %n", &n);
- printf ("t1: count=%d\n", n);
-}
-
-void
-t2 ()
-{
- int n;
- long N;
- int retval;
-#define SCAN(INPUT, FORMAT, VAR) \
- VAR = -1; \
- retval = sscanf (INPUT, FORMAT, &VAR); \
- printf ("sscanf (\"%s\", \"%s\", &x) => %d, x = %ld\n", \
- INPUT, FORMAT, retval, (long)VAR);
-
- SCAN ("12345", "%ld", N);
- SCAN ("12345", "%llllld", N);
- SCAN ("12345", "%LLLLLd", N);
- SCAN ("test ", "%*s%n", n);
- SCAN ("test ", "%2*s%n", n);
- SCAN ("12 ", "%l2d", n);
- SCAN ("12 ", "%2ld", N);
-}
-
-int
-main ()
-{
- t1 ();
- t2 ();
-
- fflush (stdout);
- return 0;
-}
diff --git a/contrib/libio/tests/tstdiomisc.exp b/contrib/libio/tests/tstdiomisc.exp
deleted file mode 100644
index b8ee02dcd6a3..000000000000
--- a/contrib/libio/tests/tstdiomisc.exp
+++ /dev/null
@@ -1,8 +0,0 @@
-t1: count=5
-sscanf ("12345", "%ld", &x) => 1, x = 12345
-sscanf ("12345", "%llllld", &x) => 0, x = -1
-sscanf ("12345", "%LLLLLd", &x) => 0, x = -1
-sscanf ("test ", "%*s%n", &x) => 0, x = 4
-sscanf ("test ", "%2*s%n", &x) => 0, x = -1
-sscanf ("12 ", "%l2d", &x) => 0, x = -1
-sscanf ("12 ", "%2ld", &x) => 1, x = 12
diff --git a/contrib/libio/testsuite/ChangeLog b/contrib/libio/testsuite/ChangeLog
deleted file mode 100644
index ead33b2e1b72..000000000000
--- a/contrib/libio/testsuite/ChangeLog
+++ /dev/null
@@ -1,99 +0,0 @@
-Fri Mar 16 12:46:19 GMT 2001 Bernd Schmidt (bernds@redhat.com)
-
- * gcc-2.95.3 Released.
-
-Sun Oct 24 23:54:10 PDT 1999 Jeff Law (law@cygnus.com)
-
- * gcc-2.95.2 Released.
-
-Mon Aug 16 01:29:24 PDT 1999 Jeff Law (law@cygnus.com)
-
- * gcc-2.95.1 Released.
-
-Wed Jul 28 21:39:31 PDT 1999 Jeff Law (law@cygnus.com)
-
- * gcc-2.95 Released.
-
-Sun Jul 25 23:40:51 PDT 1999 Jeff Law (law@cygnus.com)
-
- * gcc-2.95 Released.
-
-Wed Nov 25 01:00:07 1998 Marc Espie <espie@quatramaran.ens.fr>
-
- * Makefile.in (just-check): Ignore errors.
-
-Sat Jun 27 23:59:35 1998 Carlo Wood <carlo@runaway.xs4all.nl>
-
- * lib/libio.exp (test_libio): Reset ld_library_path before appending
- the same path(s) again.
-
-Tue Jun 9 11:23:42 1998 Gavin Koch <gavin@cygnus.com>
-
- * Makefile.in (EXPECT) : Look for "expect" in the correct
- place.
-
-Sat Sep 6 00:49:31 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * lib/libio.exp (test_libio): Lose -L.. before -lio, may as well
- require things be fully usable. Not ideal, but...also no longer
- have the -liostream approach.
-
-Fri Sep 5 15:38:37 1997 Jeffrey A Law (law@cygnus.com)
-
- * lib/libio.exp (test_libio): Use libstdc++_{include,link}_flags
- instead of g++_{include,link}_flags.
-
-Thu Sep 4 15:22:46 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * lib/libio.exp (test_libio): Add `-L..' before -lio.
- Use `-L.. -liostream' for now.
-
-Fri Jun 27 18:19:21 1997 Bob Manson <manson@charmed.cygnus.com>
-
- * lib/libio.exp(libio_init): New procedure.
- (test_libio): Link with a status wrapper if necessary. Strip
- leading newlines before comparing output. Look for a multilib
- libiberty directory.
-
-Tue Jun 3 15:17:31 1997 Bob Manson <manson@charmed.cygnus.com>
-
- * lib/libio.exp: Don't use global exec_output variable; the output
- is returned from remote_load instead.
-
-Tue May 20 17:59:31 1997 Jeffrey A Law (law@cygnus.com)
-
- * lib/libio.exp: If "slow_simulator" is set, then add
- -DSLOW_SIMULATOR to the compiler's arguments.
-
-Fri May 16 19:33:39 1997 Bob Manson <manson@charmed.cygnus.com>
-
- * lib/libio.exp: Name the executables after the testcases.
-
- * libio.tests/tiomisc.exp: Turn off warnings when conpiling.
-
-Thu May 1 17:01:47 1997 Bob Manson <manson@charmed.cygnus.com>
-
- * lib/libio.exp: Link in libiberty.a.
-
-Tue Apr 29 16:34:37 1997 Mike Stump <mrs@cygnus.com>
-
- * testsuite/lib/libio.exp: Fixup so that we always have the same
- number of testcases, and so that we have meaningful testcase
- names.
-
-Tue Apr 29 13:08:41 1997 Bob Manson <manson@charmed.cygnus.com>
-
- * lib/libio.exp: Add support for --tool_opts.
-
-Mon Apr 28 11:26:06 1997 Bob Manson <manson@charmed.cygnus.com>
-
- * Makefile.in: Removed clean rule, as it is added by configure.
- Remove a lot of unused rules.
-
-Sun Apr 27 15:02:48 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * Makefile.in (clean): Add empty rule for now.
-
-Sat Apr 26 13:41:44 1997 Bob Manson <manson@charmed.cygnus.com>
-
- * New DejaGnu-style testsuite.
diff --git a/contrib/libio/testsuite/Makefile.in b/contrib/libio/testsuite/Makefile.in
deleted file mode 100644
index d1795d00df60..000000000000
--- a/contrib/libio/testsuite/Makefile.in
+++ /dev/null
@@ -1,90 +0,0 @@
-# Copyright (C) 1997 Free Software Foundation
-#
-# 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 GNU CC; see the file COPYING. If not, write to
-# the Free Software Foundation, 59 Temple Place - Suite 330,
-# Boston, MA 02111-1307, USA. */
-
-srcdir = libio.tests
-
-CFLAGS = -g
-C_FLAGS = $(CFLAGS) -I. -I.. -I$(srcdir) -I$(srcdir)/..
-CXXFLAGS = -g
-CC = gcc
-CXX = gcc
-
-EXPECT = `if [ -f $${rootme}/../../../expect/expect ] ; then \
- echo $${rootme}/../../../expect/expect ; \
- else echo expect ; fi`
-
-RUNTEST = $(RUNTEST_FOR_TARGET)
-
-RUNTESTFLAGS =
-
-RUNTEST_FOR_TARGET = `\
- if [ -f $${srcdir}/../../dejagnu/runtest ]; then \
- echo $${srcdir}/../../dejagnu/runtest; \
- else \
- if [ "$(host_canonical)" = "$(target_canonical)" ]; then \
- echo runtest; \
- else \
- t='$(program_transform_name)'; echo runtest | sed -e '' $$t; \
- fi; \
- fi`
-
-#### package, host, target, and site dependent Makefile fragments come in here.
-##
-
-# See ${MOSTLYCLEAN} in configure.in
-JUNK_TO_CLEAN = tFile tiomisc hounddog putbackdog tiomanip \
- t?format *.out streamfile ftmp* tstdiomisc foo.dat
-
-.PHONY: info
-info:
-.PHONY: clean-info
-clean-info:
-.PHONY: install-info
-install-info:
-
-check: all just-check
-
-site.exp: ./config.status Makefile
- @echo "Making a new config file..."
- -@rm -f ./tmp?
- @touch site.exp
- -@mv site.exp site.bak
- @echo "## these variables are automatically generated by make ##" > ./tmp0
- @echo "# Do not edit here. If you wish to override these values" >> ./tmp0
- @echo "# add them to the last section" >> ./tmp0
- @echo "set host_alias $(host_alias)" >> ./tmp0
- @echo "set host_triplet ${host_canonical}" >> ./tmp0
- @echo "set target_alias $(target_alias)" >> ./tmp0
- @echo "set target_triplet ${target_canonical}" >> ./tmp0
- @echo "set build_triplet ${build_canonical}" >> ./tmp0
- @echo "set srcdir ${srcdir}" >> ./tmp0
- @echo "set tool libio" >> ./tmp0
- @echo "## All variables above are generated by configure. Do Not Edit ##" >> ./tmp0
- @cat ./tmp0 > site.exp
- @cat site.bak | sed \
- -e '1,/^## All variables above are.*##/ d' >> site.exp
- -@rm -f ./tmp?
-
-just-check: site.exp
- -rootme=`pwd`; export rootme; \
- srcdir=${srcdir} ; export srcdir ; \
- EXPECT=${EXPECT} ; export EXPECT ; \
- if [ -f $${rootme}/../../../expect/expect ] ; then \
- TCL_LIBRARY=$${srcdir}/../../tcl/library ; \
- export TCL_LIBRARY ; fi ; \
- $(RUNTEST) $(RUNTESTFLAGS)
diff --git a/contrib/libio/testsuite/config/default.exp b/contrib/libio/testsuite/config/default.exp
deleted file mode 100644
index 90967cccc18a..000000000000
--- a/contrib/libio/testsuite/config/default.exp
+++ /dev/null
@@ -1 +0,0 @@
-load_lib "standard.exp"
diff --git a/contrib/libio/testsuite/configure.in b/contrib/libio/testsuite/configure.in
deleted file mode 100644
index cd400c84ba2c..000000000000
--- a/contrib/libio/testsuite/configure.in
+++ /dev/null
@@ -1,22 +0,0 @@
-# This file is a shell script fragment that supplies the information
-# necessary for a configure script to process the program in
-# this directory. For more information, look at ../../configure.
-
-configdirs=
-srctrigger=libio.tests/hounddog.exp
-srcname="test C++ input/output library, dejagnu style"
-package_makefile_frag=Make.pack
-package_makefile_rules_frag=Make.pack.r
-
-# per-host:
-
-# per-target:
-
-TO_TOPDIR=../../
-ALL=' '
-XCINCLUDES='-I. -I.. -I$(srcdir) -I$(srcdir)/..'
-XCXXINCLUDES='-I. -I.. -I$(srcdir) -I$(srcdir)/..'
-MOSTLYCLEAN='*.o core $(JUNK_TO_CLEAN)'
-(. ${srcdir}/../config.shared) >${package_makefile_frag} 2>${package_makefile_rules_frag}
-
-# post-target:
diff --git a/contrib/libio/testsuite/lib/libio.exp b/contrib/libio/testsuite/lib/libio.exp
deleted file mode 100644
index d9f01b449fc9..000000000000
--- a/contrib/libio/testsuite/lib/libio.exp
+++ /dev/null
@@ -1,167 +0,0 @@
-# Copyright (C) 1997 Free Software Foundation, Inc.
-
-# This program 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 of the License, or
-# (at your option) any later version.
-#
-# This program 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 program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-# Please email any bugs, comments, and/or additions to this file to:
-# bug-lib-g++@prep.ai.mit.edu
-
-# This file was written by Bob Manson. (manson@cygnus.com)
-
-load_lib "libgloss.exp"
-
-global base_dir
-
-proc libio_init { args } {
- global wrapper_file;
- global wrap_compile_flags;
- set wrapper_file "";
- set wrap_compile_flags "";
- if [target_info exists needs_status_wrapper] {
- set result [build_wrapper "testglue.o"];
- if { $result != "" } {
- set wrapper_file [lindex $result 0];
- set wrap_compile_flags [lindex $result 1];
- } else {
- warning "Status wrapper failed to build."
- }
- }
-}
-#
-# Run the test specified by srcfile and resultfile. compile_args and
-# exec_args are additional arguments to be passed in when compiling and
-# running the testcase, respectively.
-#
-
-proc test_libio { srcfile compile_args inpfile resultfile exec_args } {
- global LIBIO
- global srcdir subdir objdir
- global TOOL_OPTIONS
- global wrapper_file wrap_compile_flags
- global ld_library_path
-
- if { $inpfile != "" } {
- set inpfile "$srcdir/../tests/$inpfile"
- }
-
- set args ""
- set ld_library_path ""
- lappend args "additional_flags=-O3";
- lappend args "additional_flags=-I.. -I$srcdir/.."
- lappend args "additional_flags=$wrap_compile_flags";
- lappend args "libs=$wrapper_file";
- if { $compile_args != "" } {
- lappend args "additional_flags=$compile_args"
- }
-
- if [regexp "\.cc$" $srcfile] {
- lappend args "additional_flags=-nostdinc++"
- lappend args "additional_flags=[libstdc++_include_flags]";
- lappend args "additional_flags=[libstdc++_link_flags]";
- lappend args "libs=-lstdc++"
- } else {
- if [info exists LIBIO] {
- lappend args "libdir=$LIBIO"
- } else {
- lappend args "additional_flags=[libio_link_flags]";
- }
- lappend args "additional_flags=[libio_link_flags]";
- lappend args "libs=-lio"
- }
-
- if [target_info exists slow_simulator] then {
- lappend args "additional_flags=-DSLOW_SIMULATOR"
- }
-
- if [info exists TOOL_OPTIONS] {
- lappend args "additional_options=$TOOL_OPTIONS"
- }
-
- set gp [get_multilibs];
- if { $gp != "" } {
- if [file exists $gp/libiberty/libiberty.a] {
- lappend args "libdir=$gp/libiberty";
- set found_libiberty 1;
- }
- }
- if ![info exists found_libiberty] {
- set lib [lookfor_file "$objdir" "libiberty/libiberty.a"];
- if { $lib != "" } {
- lappend args "libdir=[file dirname $lib]";
- }
- }
- lappend args "libs=-liberty"
- lappend args "debug";
-
- set errname "$srcfile"
- set srcfile "$srcdir/../tests/$srcfile"
- regsub "\\..*$" "[file tail $srcfile]" "" executable
- set executable "$objdir/$executable"
-
- if { [target_compile $srcfile $executable executable $args] != "" } {
- fail "$errname compilation $exec_args";
- setup_xfail "*-*-*"
- fail "$errname execution $exec_args"
- if { $resultfile != "" } {
- setup_xfail "*-*-*"
- fail "$errname output $exec_args"
- }
- return;
- }
- pass "$errname compilation $exec_args"
-
- set result [libio_load $executable $exec_args $inpfile];
- set status [lindex $result 0];
- set output [lindex $result 1];
- if { $status == "unsupported" } {
- unsupported "target does not support loading $srcfile"
- return;
- }
- if { $status != "pass" } {
- $status "$errname execution $exec_args"
- setup_xfail "*-*-*"
- fail "$errname output $exec_args"
- return;
- }
- pass "$errname execution $exec_args"
-
- if { $resultfile != "" } {
- set id [open $srcdir/../tests/$resultfile r];
- set expected ""
- append expected [read $id];
- verbose "expected is $expected"
- verbose "actual is $output"
- regsub -all "\r" $output "" output
- regsub "\n+$" $expected "" expected
- regsub "\n+$" $output "" output
- regsub "^\n+" $expected "" expected
- regsub "^\n+" $output "" output
- if { $expected == $output } {
- pass "$errname output $exec_args"
- } else {
- fail "$errname output $exec_args"
- }
- close $id;
- }
-}
-
-#
-# libio_version -- extract and print the version number of libio
-#
-proc default_libio_version {} {
- global LIBIO
-}
-
-proc default_libio_start { } {
-}
diff --git a/contrib/libio/testsuite/libio.tests/hounddog.exp b/contrib/libio/testsuite/libio.tests/hounddog.exp
deleted file mode 100644
index b51f9f0a4d39..000000000000
--- a/contrib/libio/testsuite/libio.tests/hounddog.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-test_libio hounddog.cc "" hounddog.inp hounddog.exp ""
-test_libio hounddog.cc "" hounddog.inp hounddog.exp "-b0"
-test_libio hounddog.cc "" hounddog.inp hounddog.exp "-b2"
diff --git a/contrib/libio/testsuite/libio.tests/putbackdog.exp b/contrib/libio/testsuite/libio.tests/putbackdog.exp
deleted file mode 100644
index 30d91a8a5b8d..000000000000
--- a/contrib/libio/testsuite/libio.tests/putbackdog.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-test_libio putbackdog.cc "" hounddog.inp hounddog.exp ""
-test_libio putbackdog.cc "" hounddog.inp hounddog.exp "-b0"
-test_libio putbackdog.cc "" hounddog.inp hounddog.exp "-b2"
diff --git a/contrib/libio/testsuite/libio.tests/tFile.exp b/contrib/libio/testsuite/libio.tests/tFile.exp
deleted file mode 100644
index f190916d8636..000000000000
--- a/contrib/libio/testsuite/libio.tests/tFile.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-test_libio tFile.cc "" tFile.inp tFile.exp ""
-test_libio tFile.cc "" tFile.inp tFile.exp "-b0"
-test_libio tFile.cc "" tFile.inp tFile.exp "-b3"
diff --git a/contrib/libio/testsuite/libio.tests/tfformat.exp b/contrib/libio/testsuite/libio.tests/tfformat.exp
deleted file mode 100644
index f0f7113c3199..000000000000
--- a/contrib/libio/testsuite/libio.tests/tfformat.exp
+++ /dev/null
@@ -1 +0,0 @@
-test_libio tfformat.c "-DTEST_LIBIO -DTEST_EXACTNESS" "" "" ""
diff --git a/contrib/libio/testsuite/libio.tests/tiformat.exp b/contrib/libio/testsuite/libio.tests/tiformat.exp
deleted file mode 100644
index f2d14db5236e..000000000000
--- a/contrib/libio/testsuite/libio.tests/tiformat.exp
+++ /dev/null
@@ -1 +0,0 @@
-test_libio tiformat.c "-DTEST_LIBIO" "" "" ""
diff --git a/contrib/libio/testsuite/libio.tests/tiomanip.exp b/contrib/libio/testsuite/libio.tests/tiomanip.exp
deleted file mode 100644
index 856cefc3cd05..000000000000
--- a/contrib/libio/testsuite/libio.tests/tiomanip.exp
+++ /dev/null
@@ -1 +0,0 @@
-test_libio tiomanip.cc "" "" tiomanip.exp ""
diff --git a/contrib/libio/testsuite/libio.tests/tiomisc.exp b/contrib/libio/testsuite/libio.tests/tiomisc.exp
deleted file mode 100644
index 71309951bb07..000000000000
--- a/contrib/libio/testsuite/libio.tests/tiomisc.exp
+++ /dev/null
@@ -1 +0,0 @@
-test_libio tiomisc.cc "-w" "" tiomisc.exp ""
diff --git a/contrib/libio/testsuite/libio.tests/tstdiomisc.exp b/contrib/libio/testsuite/libio.tests/tstdiomisc.exp
deleted file mode 100644
index 01dae9ffe1a6..000000000000
--- a/contrib/libio/testsuite/libio.tests/tstdiomisc.exp
+++ /dev/null
@@ -1 +0,0 @@
-test_libio tstdiomisc.c "" "" tstdiomisc.exp ""
diff --git a/contrib/libobjc/ChangeLog b/contrib/libobjc/ChangeLog
deleted file mode 100644
index 7b7e7da7830c..000000000000
--- a/contrib/libobjc/ChangeLog
+++ /dev/null
@@ -1,174 +0,0 @@
-Fri Mar 16 12:46:19 GMT 2001 Bernd Schmidt (bernds@redhat.com)
-
- * gcc-2.95.3 Released.
-
-2001-01-11 Joseph S. Myers <jsm28@cam.ac.uk>
-
- * sendmsg.c (__objc_print_dtable_stats): Don't use #ifdef inside
- printf.
-
-2000-03-29 Zack Weinberg <zack@wolery.cumb.org>
-
- * objc/Protocol.h, objc/objc-list.h: Change #endif labels to
- comments.
-
-Sun Oct 24 23:54:10 PDT 1999 Jeff Law (law@cygnus.com)
-
- * gcc-2.95.2 Released.
-
-Mon Aug 16 01:29:24 PDT 1999 Jeff Law (law@cygnus.com)
-
- * gcc-2.95.1 Released.
-
-Fri Aug 6 23:32:29 1999 Daniel Jacobowitz <drow@drow.them.org>
-
- * Makefile.in (FLAGS_TO_PASS): Include prefix, exec_prefix,
- libdir, libsubdir and tooldir.
-
-Wed Jul 28 21:39:31 PDT 1999 Jeff Law (law@cygnus.com)
-
- * gcc-2.95 Released.
-
-Sun Jul 25 23:40:51 PDT 1999 Jeff Law (law@cygnus.com)
-
- * gcc-2.95 Released.
-
-Mon Jun 21 05:40:15 1999 John David Anglin <dave@hiauly1>
-
- * init.c (__objc_force_linking): Make global.
-
-Thu May 20 03:20:59 1999 Jeffrey A Law (law@cygnus.com)
-
- * configure.in (AC_EXEEXT): Remove call.
- (compiler_name): Explicitly check with no extension and .exe
- extension.
- * configure: Regenerate.
-
-Sun Apr 25 01:15:34 1999 Mumit Khan <khan@xraylith.wisc.edu>
-
- * Makefile.in (CC1OBJ): Define in terms of CC.
- (runtime-info.h): Use.
-
-Fri April 8 08:21:07 1999 Ovidiu Predescu <ovidiu@cup.hp.com>
-
- * objc-features.texi: Updated the URL to Boehm's GC page.
-
-Fri Mar 26 23:41:07 1999 Ovidiu Predescu <ovidiu@cup.hp.com>
-
- * archive.c (__objc_code_char, __objc_write_char): Explicitly specify
- the char as being signed (patch from Daniel Jacobowitz
- <drow@false.org>).
-
-Wed Mar 24 22:41:28 1999 Mumit Khan <khan@xraylith.wisc.edu>
-
- * configure.in (AC_PREREQ): Update to 2.13.
- (AC_EXEEXT): Call to find possible file extension.
- (compiler_name): Use.
- * configure: Regenerate.
-
-Wed Jan 27 02:31:01 1999 Jeffrey A Law (law@cygnus.com)
-
- * Makefile.in (ALL_CFLAGS): Add -DIN_GCC.
-
-Tue Jan 5 01:38:53 1999 Jeffrey A Law (law@cygnus.com)
-
- * configure.in (thread_file): Correct and simplify code to find
- the thread file.
- * configure: Rebuilt.
-
-1998-11-26 Manfred Hollstein <manfred@s-direktnet.de>
-
- * configure.in (compiler_name): Add check to detect if this
- language's compiler has been built.
- * configure: Regenerate.
-
-Mon Nov 23 16:50:28 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * configure.in: Use AC_PREREQ(2.12.1).
-
-Thu Nov 19 20:33:37 1998 Jeffrey A Law (law@cygnus.com)
-
- * Makefile.in (runtime-info.h): Avoid GNU make extensions.
-
-Sun Nov 8 17:46:14 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * Makefile.in (INCLUDES): Add -I$(srcdir)/$(MULTISRCTOP)../include.
-
-Thu Oct 22 14:34:06 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * configure.in: Use AC_CONFIG_AUX_DIR($topsrcdir).
-
-Sat Oct 17 05:21:31 1998 Ovidiu Predescu <ovidiu@slip.net>
-
- * objc-features.texi (Top): Changed the email address.
- * objc-features.texi (Garbage Collection): Use @uref instead of @url.
-
-Mon Oct 11 21:25:27 1998 Ovidiu Predescu <ovidiu@slip.net>
-
- * encoding.c: Redefine get_inner_array_type to get the first entry
- in the structure.
-
-Thu Oct 8 12:21:14 1998 Richard Frith-Macdonald <richard@brainstorm.co.uk>
-
- * encoding.c (objc_skip_type_qualifiers): Handle _C_BYREF.
- (objc_get_type_qualifiers): Similarly.
- * objc/encoding.h (_C_BYREF): Define.
- (_F_BYREF): Define.
-
-1998-10-07 David S. Miller <davem@pierdol.cobaltmicro.com>
-
- * objc/sarray.h: Make boffset be an unsigned long when sparc so it
- works out on 64-bit systems.
-
-Tue Oct 6 20:32:06 1998 Alexandre Oliva <oliva@dcc.unicamp.br>
-
- * Makefile.in (INCLUDES): Make it multilib-friendly.
-
-Fri Oct 2 07:12:14 1998 H.J. Lu (hjl@gnu.org)
-
- * Makefile.in (INCLUDES): Add -I$(srcdir)/../gcc.
-
-Thu Oct 1 22:33:03 1998 Robert Lipe <robertl@dgii.com>
- Jeffrey A Law (law@cygnus.com)
-
- * Makefile.in (INCLUDES): Reference gcc via $MULTIBUILDTOP.
- (FLAGS_TO_PASS): Added.
- (runtime-info.h): Reference cc1ibj via $MULTIBUILDTOP.
-
- * archive.c: Change config.h to tconfig.h.
-
- * configure.in: Find gcc's object directory even for multilibs.
-
-Wed Sep 30 18:17:17 1998 Robert Lipe <robertl@dgii.com>
-
- * configure.in: Escape ^ in grep string.
- * configure: Rebuilt.
-
-Wed Sep 30 09:14:52 1998 Jeffrey A Law (law@cygnus.com)
-
- * All .h files pushed down into the objc/ subdirectory.
- * Makefile.in (copy_headers): Corresponding changes.
- * configure.in (AC_INIT): Corresponding changes.
- * configure: Rebuilt.
-
-1998-09-30 Ben Elliston <bje@cygnus.com>
- Jeff Law <law@cygnus.com>
-
- * Makefile.in: Rewrite.
-
- * configure.in: Likewise.
-
- * configure: Regenerate.
-
- * All .c files. Remove "objc" prefix when including objc header
- files. Include tconfig.h, not ../tconfig.h.
-
-Mon Sep 21 23:27:10 1998 Ovidiu Predescu <ovidiu@slip.net>
-
- * encoding.c (TREE_TYPE, ARRAY_TYPE): Define.
- (get_inner_array_type): Define.
-
-1998-09-21 Ben Elliston <bje@cygnus.com>
-
- * New directory. Moved files from ../gcc/objc.
-
diff --git a/contrib/libobjc/Makefile.in b/contrib/libobjc/Makefile.in
deleted file mode 100644
index e1de9aeee8ae..000000000000
--- a/contrib/libobjc/Makefile.in
+++ /dev/null
@@ -1,322 +0,0 @@
-#Makefile for GNU Objective C runtime library.
-#Copyright (C) 1993, 95-97, 1998 Free Software Foundation, Inc.
-
-#This file is part of GNU CC.
-
-#GNU CC 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.
-
-#GNU CC is distributed in the hope that it will be useful,
-#but WITHOUT ANY WARRANTY; without even the implied warranty of
-#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-#GNU General Public License for more details.
-
-#You should have received a copy of the GNU General Public License
-#along with GNU CC; see the file COPYING. If not, write to
-#the Free Software Foundation, 59 Temple Place - Suite 330,
-#Boston, MA 02111-1307, USA. */
-
-#This was cribbed from the libchill, libiberty and libstdc++
-#Makefile.in files. Some of this stuff may be unnecessary and
-#worthless.
-
-SHELL = /bin/sh
-
-#### Start of system configuration section. ####
-
-srcdir = @srcdir@
-VPATH = @srcdir@
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-target_alias = @target_alias@
-gcc_version = @gcc_version@
-gcc_version_trigger = @gcc_version_trigger@
-
-libdir = $(exec_prefix)/lib
-libsubdir = $(libdir)/gcc-lib/$(target_alias)/$(gcc_version)
-incinstalldir = $(libsubdir)/include
-
-# Multilib support variables.
-MULTISRCTOP =
-MULTIBUILDTOP =
-MULTIDIRS =
-MULTISUBDIR =
-MULTIDO = true
-MULTICLEAN = true
-
-# Not configured per top-level version, since that doesn't get passed
-# down at configure time, but overrridden by the top-level install
-# target.
-INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_DATA = @INSTALL_DATA@
-
-AR = @AR@
-AR_FLAGS = rc
-
-RANLIB = @RANLIB@
-
-CC = @CC@
-CFLAGS = @CFLAGS@
-ALL_CFLAGS = -I. -I$(srcdir) $(CPPFLAGS) $(DEFS) $(CFLAGS) -DIN_GCC
-
-#
-# Define the cc1obj in terms of the CC that is passed on from higher
-# level make. This is needed to make sure we can create runtime-info.h
-# when doing canadian cross builds where running ../../gcc/cc1obj
-# does not make any sense.
-#
-CC1OBJ = `$(CC) -print-prog-name=cc1obj`
-
-INCLUDES = -I$(srcdir)/objc -I$(srcdir)/$(MULTISRCTOP)../gcc \
- -I$(srcdir)/$(MULTISRCTOP)../gcc/config -I$(MULTIBUILDTOP)../../gcc \
- -I$(srcdir)/$(MULTISRCTOP)../include
-
-OBJC_GCFLAGS=-DOBJC_WITH_GC=1
-OBJC_THREAD_FILE=thr-@OBJC_THREAD_FILE@
-
-.SUFFIXES:
-.SUFFIXES: .c .m .o
-
-.c.o:
- $(CC) -c $(ALL_CFLAGS) $(INCLUDES) $<
-
-.m.o:
- $(CC) -c $(ALL_CFLAGS) $(INCLUDES) $<
-
-# Flags to pass to a recursive make.
-FLAGS_TO_PASS = \
- "AR=$(AR)" \
- "AR_FLAGS=$(AR_FLAGS)" \
- "CC=$(CC)" \
- "CFLAGS=$(CFLAGS)" \
- "LIBCFLAGS=$(LIBCFLAGS)" \
- "EXTRA_OFILES=$(EXTRA_OFILES)" \
- "HDEFINES=$(HDEFINES)" \
- "INSTALL=$(INSTALL)" \
- "INSTALL_DATA=$(INSTALL_DATA)" \
- "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
- "LDFLAGS=$(LDFLAGS)" \
- "LOADLIBES=$(LOADLIBES)" \
- "PICFLAG=$(PICFLAG)" \
- "RANLIB=$(RANLIB)" \
- "SHELL=$(SHELL)" \
- "prefix=$(prefix)" \
- "exec_prefix=$(exec_prefix)" \
- "libdir=$(libdir)" \
- "libsubdir=$(libsubdir)" \
- "tooldir=$(tooldir)"
-
-all: libobjc.a @OBJC_BOEHM_GC@
- $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=all
-
-# User-visible header files.
-
-OBJC_H = hash.h objc-list.h sarray.h objc.h objc-api.h \
- NXConstStr.h Object.h Protocol.h encoding.h typedstream.h \
- thr.h
-
-# Modules that comprise the runtime library.
-
-OBJS = archive.o class.o encoding.o gc.o hash.o init.o linking.o \
- misc.o nil_method.o NXConstStr.o Object.o objects.o \
- Protocol.o sarray.o selector.o sendmsg.o thr.o \
- $(OBJC_THREAD_FILE).o
-
-OBJS_GC = archive_gc.o class_gc.o encoding_gc.o gc_gc.o hash_gc.o \
- init_gc.o linking_gc.o misc_gc.o nil_method_gc.o \
- NXConstStr_gc.o Object_gc.o objects_gc.o Protocol_gc.o \
- sarray_gc.o selector_gc.o sendmsg_gc.o thr_gc.o \
- $(OBJC_THREAD_FILE)_gc.o
-
-runtime-info.h:
- echo "" > tmp-runtime
- echo "/* This file is automatically generated */" > $@
- $(CC1OBJ) -print-objc-runtime-info tmp-runtime >> $@
- rm -f tmp-runtime
-
-archive_gc.o: archive.c
- $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) $(INCLUDES) $<
-
-class_gc.o: class.c
- $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) $(INCLUDES) $<
-
-encoding_gc.o: encoding.c
- $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) $(INCLUDES) $<
-
-gc.o: gc.c
- $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) $(INCLUDES) $<
-
-gc_gc.o: gc.c
- $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
- $(INCLUDES) $<
-
-hash_gc.o: hash.c
- $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) $(INCLUDES) $<
-
-init_gc.o: init.c
- $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) $(INCLUDES) $<
-
-linking.o: linking.m
- $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) $(INCLUDES) $<
-
-linking_gc.o: linking.m
- $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
- $(INCLUDES) $<
-
-misc_gc.o: misc.c
- $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) $(INCLUDES) $<
-
-nil_method_gc.o: nil_method.c
- $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) $(INCLUDES) $<
-
-NXConstStr.o: NXConstStr.m
- $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) $(INCLUDES) $<
-
-NXConstStr_gc.o: NXConstStr.m
- $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
- $(INCLUDES) $<
-
-Object.o: Object.m
- $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) $(INCLUDES) $<
-
-Object_gc.o: Object.m
- $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
- $(INCLUDES) $<
-
-objects_gc.o: objects.c
- $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) $(INCLUDES) $<
-
-Protocol.o: Protocol.m
- $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) $(INCLUDES) $<
-
-Protocol_gc.o: Protocol.m
- $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
- $(INCLUDES) $<
-
-sarray_gc.o: sarray.c
- $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) $(INCLUDES) $<
-
-selector_gc.o: selector.c
- $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) $(INCLUDES) $<
-
-sendmsg.o: sendmsg.c runtime-info.h
- $(CC) -c -o $@ $(ALL_CFLAGS) $(INCLUDES) $<
-
-sendmsg_gc.o: sendmsg.c runtime-info.h
- $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) $(INCLUDES) $<
-
-thr_gc.o: thr.c
- $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) $(INCLUDES) $<
-
-$(OBJC_THREAD_FILE)_gc.o: $(OBJC_THREAD_FILE).c
- $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) $(INCLUDES) $<
-
-doc: info dvi html
-
-libobjc.a: $(OBJS)
- $(AR) $(AR_FLAGS) $@ $(OBJS)
- $(RANLIB) $@
-
-libobjc_gc.a: $(OBJS_GC)
- $(AR) $(AR_FLAGS) $@ $(OBJS_GC)
- $(RANLIB) $@
-
-libobjc_s.a: libobjc.a
- mv libobjc.a libobjc_s.a
-
-# Create a relocatable DLL
-libobjc.dll: libobjc_s.a libobjc_entry.o
- $(CC) -mdll -Wl,--base-file -Wl,libobjc.base \
- -o libobjc.dll libobjc_s.a libobjc_entry.o -lkernel32
- $(DLLTOOL) --dllname libobjc.dll --def $(srcdir)/libobjc.def \
- --base-file libobjc.base --output-exp libobjc.exp
- $(GCC_FOR_TARGET) -mdll -Wl,--base-file libobjc.base libobjc.exp \
- -o libobjc.dll libobjc_s.a libobjc_entry.o -lkernel32
- $(DLLTOOL) --dllname libobjc.dll --def $(srcdir)/libobjc.def \
- --base-file libobjc.base --output-exp libobjc.exp
- $(GCC_FOR_TARGET) libobjc.exp -mdll \
- -o libobjc.dll libobjc_s.a libobjc_entry.o -lkernel32
- $(DLLTOOL) --dllname libobjc.dll --def $(srcdir)/libobjc.def \
- --output-lib libobjc.a
-
-info: objc-features.info
-dvi: objc-features.dvi
-html: objc-features_toc.html
-
-objc-features.info: $(srcdir)/objc-features.texi
- makeinfo $(srcdir)/objc-features.texi
-
-objc-features.dvi: $(srcdir)/objc-features.texi
- texi2dvi $(srcdir)/objc-features.texi
-
-objc-features_toc.html: objc-features.texi
- texi2html -split_node $(srcdir)/objc-features.texi
-
-Makefile: Makefile.in config.status
- $(SHELL) config.status
-
-config.status: configure
- rm -f config.cache
- CONFIG_SITE=no-such-file CC='$(CC)' AR='$(AR)' CFLAGS='$(CFLAGS)' \
- CPPFLAGS='$(CPPFLAGS)' $(SHELL) config.status --recheck
-
-${srcdir}/configure: configure.in
- rm -f config.cache
- cd ${srcdir} && autoconf
-
-install: install-libs copy-headers
-
-install-libs: installdirs
- -if test -f libobjc.a ; then \
- rm -f $(libsubdir)/libobjc.a; \
- $(INSTALL_DATA) libobjc.a $(libsubdir)/libobjc.a; \
- chmod a-x $(libsubdir)/libobjc.a; \
- else true; fi
- -if test -f libobjc_gc.a ; then \
- rm -f $(libsubdir)/libobjc_gc.a; \
- $(INSTALL_DATA) libobjc_gc.a $(libsubdir)/libobjc_gc.a; \
- chmod a-x $(libsubdir)/libobjc_gc.a; \
- else true; fi
- -if test -f libobjc_s.a ; then \
- rm -f $(libsubdir)/libobjc_s.a; \
- $(INSTALL_DATA) libobjc_s.a $(libsubdir)/libobjc_s.a; \
- chmod a-x $(libsubdir)/libobjc_s.a; \
- else true; fi
- -if test -f libobjc.dll ; then \
- rm -f $(bindir)/libobjc.dll; \
- $(INSTALL_DATA) libobjc.dll $(bindir)/libobjc.dll; \
- else true; fi
-
-# Copy Objective C headers to installation include directory.
-copy-headers:
- -rm -rf $(incinstalldir)/objc
- -mkdir $(incinstalldir)/objc
- for file in $(OBJC_H); do \
- realfile=$(srcdir)/objc/$${file}; \
- cp $${realfile} $(incinstalldir)/objc; \
- chmod a+r $(incinstalldir)/objc/$${file}; \
- done
-
-check uninstall install-strip dist installcheck installdirs:
-
-mostlyclean:
- -rm -f runtime-info.h tmp-runtime.s *.o libobjc* xforward \
- fflags *.aux *.cp *.dvi *.fn *.info *.ky *.log *.pg \
- *.toc *.tp *.vr *.html libobj.exp
- @$(MULTICLEAN) multi-clean DO=mostlyclean
-
-clean: mostlyclean
- rm -f config.log
- @$(MULTICLEAN) multi-clean DO=clean
-
-distclean: clean
- @$(MULTICLEAN) multi-clean DO=distclean
- rm -f config.cache config.status Makefile configure
-
-maintainer-clean realclean: distclean
-
-.PHONY: mostlyclean clean distclean maintainer-clean all check uninstall \
- install-strip dist installcheck installdirs
diff --git a/contrib/libobjc/NXConstStr.m b/contrib/libobjc/NXConstStr.m
deleted file mode 100644
index 4d2f3e1d7fc0..000000000000
--- a/contrib/libobjc/NXConstStr.m
+++ /dev/null
@@ -1,42 +0,0 @@
-/* Implementation of the NXConstantString class for Objective-C.
- Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by Pieter J. Schoenmakers <tiggr@es.ele.tue.nl>
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
-License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with files
- compiled with GCC 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 "objc/NXConstStr.h"
-
-@implementation NXConstantString
-
--(const char *) cString
-{
- return (c_string);
-} /* -cString */
-
--(unsigned int) length
-{
- return (len);
-} /* -length */
-
-@end
diff --git a/contrib/libobjc/Object.m b/contrib/libobjc/Object.m
deleted file mode 100644
index 64b52f483687..000000000000
--- a/contrib/libobjc/Object.m
+++ /dev/null
@@ -1,387 +0,0 @@
-/* The implementation of class Object for Objective-C.
- Copyright (C) 1993, 1994, 1995, 1997 Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
-License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with files compiled
- with GCC 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 <stdarg.h>
-#include "objc/Object.h"
-#include "objc/Protocol.h"
-#include "objc/objc-api.h"
-
-extern int errno;
-
-#define MAX_CLASS_NAME_LEN 256
-
-@implementation Object
-
-+ initialize
-{
- return self;
-}
-
-- init
-{
- return self;
-}
-
-+ new
-{
- return [[self alloc] init];
-}
-
-+ alloc
-{
- return class_create_instance(self);
-}
-
-- free
-{
- return object_dispose(self);
-}
-
-- copy
-{
- return [[self shallowCopy] deepen];
-}
-
-- shallowCopy
-{
- return object_copy(self);
-}
-
-- deepen
-{
- return self;
-}
-
-- deepCopy
-{
- return [self copy];
-}
-
-- (Class)class
-{
- return object_get_class(self);
-}
-
-- (Class)superClass
-{
- return object_get_super_class(self);
-}
-
-- (MetaClass)metaClass
-{
- return object_get_meta_class(self);
-}
-
-- (const char *)name
-{
- return object_get_class_name(self);
-}
-
-- self
-{
- return self;
-}
-
-- (unsigned int)hash
-{
- return (size_t)self;
-}
-
-- (BOOL)isEqual:anObject
-{
- return self==anObject;
-}
-
-- (int)compare:anotherObject;
-{
- if ([self isEqual:anotherObject])
- return 0;
- // Ordering objects by their address is pretty useless,
- // so subclasses should override this is some useful way.
- else if (self > anotherObject)
- return 1;
- else
- return -1;
-}
-
-- (BOOL)isMetaClass
-{
- return NO;
-}
-
-- (BOOL)isClass
-{
- return object_is_class(self);
-}
-
-- (BOOL)isInstance
-{
- return object_is_instance(self);
-}
-
-- (BOOL)isKindOf:(Class)aClassObject
-{
- Class class;
-
- for (class = self->isa; class!=Nil; class = class_get_super_class(class))
- if (class==aClassObject)
- return YES;
- return NO;
-}
-
-- (BOOL)isMemberOf:(Class)aClassObject
-{
- return self->isa==aClassObject;
-}
-
-- (BOOL)isKindOfClassNamed:(const char *)aClassName
-{
- Class class;
-
- if (aClassName!=NULL)
- for (class = self->isa; class!=Nil; class = class_get_super_class(class))
- if (!strcmp(class_get_class_name(class), aClassName))
- return YES;
- return NO;
-}
-
-- (BOOL)isMemberOfClassNamed:(const char *)aClassName
-{
- return ((aClassName!=NULL)
- &&!strcmp(class_get_class_name(self->isa), aClassName));
-}
-
-+ (BOOL)instancesRespondTo:(SEL)aSel
-{
- return class_get_instance_method(self, aSel)!=METHOD_NULL;
-}
-
-- (BOOL)respondsTo:(SEL)aSel
-{
- return ((object_is_instance(self)
- ?class_get_instance_method(self->isa, aSel)
- :class_get_class_method(self->isa, aSel))!=METHOD_NULL);
-}
-
-+ (IMP)instanceMethodFor:(SEL)aSel
-{
- return method_get_imp(class_get_instance_method(self, aSel));
-}
-
-// Indicates if the receiving class or instance conforms to the given protocol
-// not usually overridden by subclasses
-//
-// Modified 9/5/94 to always search the class object's protocol list, rather
-// than the meta class.
-
-+ (BOOL) conformsTo: (Protocol*)aProtocol
-{
- int i;
- struct objc_protocol_list* proto_list;
- id parent;
-
- for (proto_list = ((Class)self)->protocols;
- proto_list; proto_list = proto_list->next)
- {
- for (i=0; i < proto_list->count; i++)
- {
- if ([proto_list->list[i] conformsTo: aProtocol])
- return YES;
- }
- }
-
- if ((parent = [self superClass]))
- return [parent conformsTo: aProtocol];
- else
- return NO;
-}
-
-- (BOOL) conformsTo: (Protocol*)aProtocol
-{
- return [[self class] conformsTo:aProtocol];
-}
-
-- (IMP)methodFor:(SEL)aSel
-{
- return (method_get_imp(object_is_instance(self)
- ?class_get_instance_method(self->isa, aSel)
- :class_get_class_method(self->isa, aSel)));
-}
-
-+ (struct objc_method_description *)descriptionForInstanceMethod:(SEL)aSel
-{
- return ((struct objc_method_description *)
- class_get_instance_method(self, aSel));
-}
-
-- (struct objc_method_description *)descriptionForMethod:(SEL)aSel
-{
- return ((struct objc_method_description *)
- (object_is_instance(self)
- ?class_get_instance_method(self->isa, aSel)
- :class_get_class_method(self->isa, aSel)));
-}
-
-- perform:(SEL)aSel
-{
- IMP msg = objc_msg_lookup(self, aSel);
- if (!msg)
- return [self error:"invalid selector passed to %s", sel_get_name(_cmd)];
- return (*msg)(self, aSel);
-}
-
-- perform:(SEL)aSel with:anObject
-{
- IMP msg = objc_msg_lookup(self, aSel);
- if (!msg)
- return [self error:"invalid selector passed to %s", sel_get_name(_cmd)];
- return (*msg)(self, aSel, anObject);
-}
-
-- perform:(SEL)aSel with:anObject1 with:anObject2
-{
- IMP msg = objc_msg_lookup(self, aSel);
- if (!msg)
- return [self error:"invalid selector passed to %s", sel_get_name(_cmd)];
- return (*msg)(self, aSel, anObject1, anObject2);
-}
-
-- (retval_t)forward:(SEL)aSel :(arglist_t)argFrame
-{
- return (retval_t)[self doesNotRecognize: aSel];
-}
-
-- (retval_t)performv:(SEL)aSel :(arglist_t)argFrame
-{
- return objc_msg_sendv(self, aSel, argFrame);
-}
-
-+ poseAs:(Class)aClassObject
-{
- return class_pose_as(self, aClassObject);
-}
-
-- (Class)transmuteClassTo:(Class)aClassObject
-{
- if (object_is_instance(self))
- if (class_is_class(aClassObject))
- if (class_get_instance_size(aClassObject)==class_get_instance_size(isa))
- if ([self isKindOf:aClassObject])
- {
- Class old_isa = isa;
- isa = aClassObject;
- return old_isa;
- }
- return nil;
-}
-
-- subclassResponsibility:(SEL)aSel
-{
- return [self error:"subclass should override %s", sel_get_name(aSel)];
-}
-
-- notImplemented:(SEL)aSel
-{
- return [self error:"method %s not implemented", sel_get_name(aSel)];
-}
-
-- shouldNotImplement:(SEL)aSel
-{
- return [self error:"%s should not implement %s",
- object_get_class_name(self), sel_get_name(aSel)];
-}
-
-- doesNotRecognize:(SEL)aSel
-{
- return [self error:"%s does not recognize %s",
- object_get_class_name(self), sel_get_name(aSel)];
-}
-
-#ifdef __alpha__
-extern size_t strlen(const char*);
-#endif
-
-- error:(const char *)aString, ...
-{
-#define FMT "error: %s (%s)\n%s\n"
- char fmt[(strlen((char*)FMT)+strlen((char*)object_get_class_name(self))
- +((aString!=NULL)?strlen((char*)aString):0)+8)];
- va_list ap;
-
- sprintf(fmt, FMT, object_get_class_name(self),
- object_is_instance(self)?"instance":"class",
- (aString!=NULL)?aString:"");
- va_start(ap, aString);
- objc_verror(self, OBJC_ERR_UNKNOWN, fmt, ap);
- va_end(ap);
- return nil;
-#undef FMT
-}
-
-+ (int)version
-{
- return class_get_version(self);
-}
-
-+ setVersion:(int)aVersion
-{
- class_set_version(self, aVersion);
- return self;
-}
-
-+ (int)streamVersion: (TypedStream*)aStream
-{
- if (aStream->mode == OBJC_READONLY)
- return objc_get_stream_class_version (aStream, self);
- else
- return class_get_version (self);
-}
-
-// These are used to write or read the instance variables
-// declared in this particular part of the object. Subclasses
-// should extend these, by calling [super read/write: aStream]
-// before doing their own archiving. These methods are private, in
-// the sense that they should only be called from subclasses.
-
-- read: (TypedStream*)aStream
-{
- // [super read: aStream];
- return self;
-}
-
-- write: (TypedStream*)aStream
-{
- // [super write: aStream];
- return self;
-}
-
-- awake
-{
- // [super awake];
- return self;
-}
-
-@end
diff --git a/contrib/libobjc/Protocol.m b/contrib/libobjc/Protocol.m
deleted file mode 100644
index 43ba44eaf4f7..000000000000
--- a/contrib/libobjc/Protocol.m
+++ /dev/null
@@ -1,128 +0,0 @@
-/* This file contains the implementation of class Protocol.
- Copyright (C) 1993 Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with files
- compiled with GCC 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 "objc/Protocol.h"
-#include "objc/objc-api.h"
-
-/* Method description list */
-struct objc_method_description_list {
- int count;
- struct objc_method_description list[1];
-};
-
-
-@implementation Protocol
-{
-@private
- char *protocol_name;
- struct objc_protocol_list *protocol_list;
- struct objc_method_description_list *instance_methods, *class_methods;
-}
-
-/* Obtaining attributes intrinsic to the protocol */
-
-- (const char *)name
-{
- return protocol_name;
-}
-
-/* Testing protocol conformance */
-
-- (BOOL) conformsTo: (Protocol *)aProtocolObject
-{
- int i;
- struct objc_protocol_list* proto_list;
-
- if (!strcmp(aProtocolObject->protocol_name, self->protocol_name))
- return YES;
-
- for (proto_list = protocol_list; proto_list; proto_list = proto_list->next)
- {
- for (i=0; i < proto_list->count; i++)
- {
- if ([proto_list->list[i] conformsTo: aProtocolObject])
- return YES;
- }
- }
-
- return NO;
-}
-
-/* Looking up information specific to a protocol */
-
-- (struct objc_method_description *) descriptionForInstanceMethod:(SEL)aSel
-{
- int i;
- struct objc_protocol_list* proto_list;
- const char* name = sel_get_name (aSel);
- struct objc_method_description *result;
-
- for (i = 0; i < instance_methods->count; i++)
- {
- if (!strcmp ((char*)instance_methods->list[i].name, name))
- return &(instance_methods->list[i]);
- }
-
- for (proto_list = protocol_list; proto_list; proto_list = proto_list->next)
- {
- for (i=0; i < proto_list->count; i++)
- {
- if ((result = [proto_list->list[i]
- descriptionForInstanceMethod: aSel]))
- return result;
- }
- }
-
- return NULL;
-}
-
-- (struct objc_method_description *) descriptionForClassMethod:(SEL)aSel;
-{
- int i;
- struct objc_protocol_list* proto_list;
- const char* name = sel_get_name (aSel);
- struct objc_method_description *result;
-
- for (i = 0; i < class_methods->count; i++)
- {
- if (!strcmp ((char*)class_methods->list[i].name, name))
- return &(class_methods->list[i]);
- }
-
- for (proto_list = protocol_list; proto_list; proto_list = proto_list->next)
- {
- for (i=0; i < proto_list->count; i++)
- {
- if ((result = [proto_list->list[i]
- descriptionForClassMethod: aSel]))
- return result;
- }
- }
-
- return NULL;
-}
-
-@end
diff --git a/contrib/libobjc/README b/contrib/libobjc/README
deleted file mode 100644
index f478d67dec8f..000000000000
--- a/contrib/libobjc/README
+++ /dev/null
@@ -1,97 +0,0 @@
-
-GNU Objective C notes
-*********************
-
-This document is to explain what has been done, and a little about how
-specific features differ from other implementations. The runtime has
-been completely rewritten in gcc 2.4. The earlier runtime had several
-severe bugs and was rather incomplete. The compiler has had several
-new features added as well.
-
-This is not documentation for Objective C, it is usable to someone
-who knows Objective C from somewhere else.
-
-
-Runtime API functions
-=====================
-
-The runtime is modeled after the NeXT Objective C runtime. That is,
-most functions have semantics as it is known from the NeXT. The
-names, however, have changed. All runtime API functions have names
-of lowercase letters and underscores as opposed to the
-`traditional' mixed case names.
- The runtime api functions are not documented as of now.
-Someone offered to write it, and did it, but we were not allowed to
-use it by his university (Very sad story). We have started writing
-the documentation over again. This will be announced in appropriate
-places when it becomes available.
-
-
-Protocols
-=========
-
-Protocols are now fully supported. The semantics is exactly as on the
-NeXT. There is a flag to specify how protocols should be typechecked
-when adopted to classes. The normal typechecker requires that all
-methods in a given protocol must be implemented in the class that
-adopts it -- it is not enough to inherit them. The flag
-`-Wno-protocol' causes it to allow inherited methods, while
-`-Wprotocols' is the default which requires them defined.
-
-
-+initialize
-===========
-
-This method, if defined, is called before any other instance or class
-methods of that particular class. This method is not inherited, and
-is thus not called as initializer for a subclass that doesn't define
-it itself. Thus, each +initialize method is called exactly once (or
-never if no methods of that particular class is never called).
-Besides this, it is allowed to have several +initialize methods, one
-for each category. The order in which these (multiple methods) are
-called is not well defined. I am not completely certain what the
-semantics of this method is for other implementations, but this is
-how it works for GNU Objective C.
-
-
-Passivation/Activation/Typedstreams
-===================================
-
-This is supported in the style of NeXT TypedStream's. Consult the
-headerfile Typedstreams.h for api functions. I (Kresten) have
-rewritten it in Objective C, but this implementation is not part of
-2.4, it is available from the GNU Objective C prerelease archive.
- There is one difference worth noting concerning objects stored with
-objc_write_object_reference (aka NXWriteObjectReference). When these
-are read back in, their object is not guaranteed to be available until
-the `-awake' method is called in the object that requests that object.
-To objc_read_object you must pass a pointer to an id, which is valid
-after exit from the function calling it (like e.g. an instance
-variable). In general, you should not use objects read in until the
--awake method is called.
-
-
-Acknowledgements
-================
-
-The GNU Objective C team: Geoffrey Knauth <gsk@marble.com> (manager),
-Tom Wood <wood@next.com> (compiler) and Kresten Krab Thorup
-<krab@iesd.auc.dk> (runtime) would like to thank a some people for
-participating in the development of the present GNU Objective C.
-
-Paul Burchard <burchard@geom.umn.edu> and Andrew McCallum
-<mccallum@cs.rochester.edu> has been very helpful debugging the
-runtime. Eric Herring <herring@iesd.auc.dk> has been very helpful
-cleaning up after the documentation-copyright disaster and is now
-helping with the new documentation.
-
-Steve Naroff <snaroff@next.com> and Richard Stallman
-<rms@gnu.ai.mit.edu> has been very helpful with implementation details
-in the compiler.
-
-
-Bug Reports
-===========
-
-Please read the section `Submitting Bugreports' of the gcc manual
-before you submit any bugs.
diff --git a/contrib/libobjc/README.threads b/contrib/libobjc/README.threads
deleted file mode 100644
index 5f15bd9cb45c..000000000000
--- a/contrib/libobjc/README.threads
+++ /dev/null
@@ -1,50 +0,0 @@
-==============================================================================
-README.threads - Wed Nov 29 15:16:24 EST 1995
-------------------------------------------------------------------------------
-
-Limited documentation is available in the THREADS file.
-
-This version has been tested on Sun Solaris, SGI Irix, and Windows NT.
-It should also work on any single threaded system.
-
-Thanks go to the following people for help test and debug the library:
-
- Scott Christley, scottc@ocbi.com
- Andrew McCallum, mccallum@cs.rochester.edu
-
-galen
-gchunt@cs.rochester.edu
-
-Any questions, bug reports, etc should be directed to:
-
-Scott Christley, scottc@ocbi.com
-
-Please do not bug Galen with email as he no longer supports the code.
-
-==============================================================================
-Changes from prior releases (in revered chronological order):
-------------------------------------------------------------------------------
-
-* Fixed bug in copy part of sarray_realloc. I had an < which should
- have been <=. (Bug report from Scott).
-
-------------------------------------------------------------------------------
-
-* Support for DEC OSF/1 is definitely broken. My programs always
- seg-fault when I link with libpthreads.a.
-
-* Thread id's are no longer int's, but are instead of type
- _objc_thread_t which is typedef'ed from a void *. An invalid thread
- id is denoted by NULL and not -1 as before.
-
-------------------------------------------------------------------------------
-
-* Renamed thread-winnt.c to thread-win32.c to better reflect support
- for the API on both Windows NT and Windows 95 platforms.
- (Who knows, maybe even Win32s :-).
-
-* Fixed bugs in Win32 support as per report from Scott Christley.
-
-* Fixed bug in sarray_get as per report from Scott Christley.
-
-
diff --git a/contrib/libobjc/THREADS b/contrib/libobjc/THREADS
deleted file mode 100644
index 9dfbbed97af2..000000000000
--- a/contrib/libobjc/THREADS
+++ /dev/null
@@ -1,374 +0,0 @@
-This file describes in little detail the modifications to the
-Objective-C runtime needed to make it thread safe.
-
-First off, kudos to Galen Hunt who is the author of this great work.
-
-If you have an comments or just want to know where to
-send me money to express your undying gratitude for threading the
-Objective-C runtime you can reach Galen at:
-
- gchunt@cs.rochester.edu
-
-Any questions, comments, bug reports, etc. should send email either to the
-GCC bug account or to:
-
- Scott Christley <scottc@net-community.com>
-
-* Sarray Threading:
-
-The most critical component of the Objective-C runtime is the sparse array
-structure (sarray). Sarrays store object selectors and implementations.
-Following in the tradition of the Objective-C runtime, my threading
-support assumes that fast message dispatching is far more important
-than *ANY* and *ALL* other operations. The message dispatching thus
-uses *NO* locks on any kind. In fact, if you look in sarray.h, you
-will notice that the message dispatching has not been modified.
-Instead, I have modified the sarray management functions so that all
-updates to the sarray data structure can be made in parallel will
-message dispatching.
-
-To support concurrent message dispatching, no dynamically allocated
-sarray data structures are freed while more than one thread is
-operational. Sarray data structures that are no longer in use are
-kept in a linked list of garbage and are released whenever the program
-is operating with a single thread. The programmer can also flush the
-garbage list by calling sarray_remove_garbage when the programmer can
-ensure that no message dispatching is taking place concurrently. The
-amount of un-reclaimed sarray garbage should normally be extremely
-small in a real program as sarray structures are freed only when using
-the "poseAs" functionality and early in program initialization, which
-normally occurs while the program is single threaded.
-
-******************************************************************************
-* Static Variables:
-
-The following variables are either statically or globally defined. This list
-does not include variables which are internal to implementation dependent
-versions of thread-*.c.
-
-The following threading designations are used:
- SAFE : Implicitly thread safe.
- SINGLE : Must only be used in single thread mode.
- MUTEX : Protected by single global mutex objc_runtime_mutex.
- UNUSED : Not used in the runtime.
-
-Variable Name: Usage: Defined: Also used in:
-=========================== ====== ============ =====================
-__objc_class_hash MUTEX class.c
-__objc_class_links_resolved UNUSED class.c runtime.h
-__objc_class_number MUTEX class.c
-__objc_dangling_categories UNUSED init.c
-__objc_module_list MUTEX init.c
-__objc_selector_array MUTEX selector.c
-__objc_selector_hash MUTEX selector.c
-__objc_selector_max_index MUTEX selector.c sendmsg.c runtime.h
-__objc_selector_names MUTEX selector.c
-__objc_thread_exit_status SAFE thread.c
-__objc_uninstalled_dtable MUTEX sendmsg.c selector.c
-_objc_load_callback SAFE init.c objc-api.h
-_objc_lookup_class SAFE class.c objc-api.h
-_objc_object_alloc SINGLE objects.c objc-api.h
-_objc_object_copy SINGLE objects.c objc-api.h
-_objc_object_dispose SINGLE objects.c objc-api.h
-frwd_sel SAFE2 sendmsg.c
-idxsize MUTEX sarray.c sendmsg.c sarray.h
-initialize_sel SAFE2 sendmsg.c
-narrays MUTEX sarray.c sendmsg.c sarray.h
-nbuckets MUTEX sarray.c sendmsg.c sarray.h
-nindices MUTEX sarray.c sarray.h
-previous_constructors SAFE1 init.c
-proto_class SAFE1 init.c
-unclaimed_categories MUTEX init.c
-unclaimed_proto_list MUTEX init.c
-uninitialized_statics MUTEX init.c
-
-Notes:
-1) Initialized once in unithread mode.
-2) Initialized value will always be same, guaranteed by lock on selector
- hash table.
-
-
-******************************************************************************
-* Frontend/Backend design:
-
-The design of the Objective-C runtime thread and mutex functions utilizes a
-frontend/backend implementation.
-
-The frontend, as characterized by the files thr.h and thr.c, is a set
-of platform independent structures and functions which represent the
-user interface. Objective-C programs should use these structures and
-functions for their thread and mutex work if they wish to maintain a
-high degree of portability across platforms.
-
-The backend is composed of a file with the necessary code to map the ObjC
-thread and mutex to a platform specific implementation. For example, the
-file thr-solaris.c contains the implementation for Solaris. When you
-configure GCC, it attempts to pick an appropriate backend file for the
-target platform; however, you can override this choice by assign the
-OBJC_THREAD_FILE make variable to the basename of the backend file. This
-is especially useful on platforms which have multiple thread libraries.
-For example:
-
- make OBJC_THREAD_FILE=thr-posix
-
-would indicate that the generic posix backend file, thr-posix.c, should be
-compiled with the ObjC runtime library. If your platform does not support
-threads then you should specify the OBJC_THREAD_FILE=thr-single backend file
-to compile the ObjC runtime library without thread or mutex support; note
-that programs which rely upon the ObjC thread and mutex functions will
-compile and link correctly but attempting to create a thread or mutex will
-result in an error.
-
-It is questionable whether it is really necessary to have both a
-frontend and backend function for all available functionality. On the
-one hand, it provides a clear, consistent differentiation between what
-is public and what is private with the downside of having the overhead
-of multiple functions calls. For example, the function to have a thread
-yield the processor is objc_thread_yield; in the current implementation
-this produces a function call set:
-
-objc_thread_yield() -> __objc_thread_yield() -> system yield function
-
-This has two extra function calls over calling the platform specific function
-explicitly, but the issue is whether only the overhead of a single function
-is necessary.
-
-objc_thread_yield() -> system yield function
-
-This breaks the public/private dichotomy between the frontend/backend
-for the sake of efficiency. It is possible to just use a preprocessor
-define so as to eliminate the extra function call:
-
-#define objc_thread_yield() __objc_thread_yield()
-
-This has the undesirable effect that if objc_thread_yield is actually
-turned into a function based upon future need; then ObjC programs which
-access the thread functions would need to be recompiled versus just
-being relinked.
-
-******************************************************************************
-* Threads:
-
-The thread system attempts to create multiple threads using whatever
-operating system or library thread support is available. It does
-assume that all system functions are thread safe. Notably this means
-that the system implementation of malloc and free must be thread safe.
-If a system has multiple processors, the threads are configured for
-full parallel processing.
-
-* Backend initialization functions
-
-__objc_init_thread_system(void), int
- Initialize the thread subsystem. Called once by __objc_exec_class.
- Return -1 if error otherwise return 0.
-
-__objc_close_thread_system(void), int
- Closes the thread subsystem, not currently guaranteed to be called.
- Return -1 if error otherwise return 0.
-
-*****
-* Frontend thread functions
-* User programs should use these functions.
-
-objc_thread_detach(SEL selector, id object, id argument), objc_thread_t
- Creates and detaches a new thread. The new thread starts by
- sending the given selector with a single argument to the
- given object.
-
-objc_thread_set_priority(int priority), int
- Sets a thread's relative priority within the program. Valid
- options are:
-
- OBJC_THREAD_INTERACTIVE_PRIORITY
- OBJC_THREAD_BACKGROUND_PRIORITY
- OBJC_THREAD_LOW_PRIORITY
-
-objc_thread_get_priority(void), int
- Query a thread's priority.
-
-objc_thread_yield(void), void
- Yields processor to another thread with equal or higher
- priority. It is up to the system scheduler to determine if
- the processor is taken or not.
-
-objc_thread_exit(void), int
- Terminates a thread. If this is the last thread executing
- then the program will terminate.
-
-objc_thread_id(void), int
- Returns the current thread's id.
-
-objc_thread_set_data(void *value), int
- Set a pointer to the thread's local storage. Local storage is
- thread specific.
-
-objc_thread_get_data(void), void *
- Returns the pointer to the thread's local storage.
-
-*****
-* Backend thread functions
-* User programs should *NOT* directly call these functions.
-
-__objc_thread_detach(void (*func)(void *arg), void *arg), objc_thread_t
- Spawns a new thread executing func, called by objc_thread_detach.
- Return NULL if error otherwise return thread id.
-
-__objc_thread_set_priority(int priority), int
- Set the thread's priority, called by objc_thread_set_priority.
- Return -1 if error otherwise return 0.
-
-__objc_thread_get_priority(void), int
- Query a thread's priority, called by objc_thread_get_priority.
- Return -1 if error otherwise return the priority.
-
-__objc_thread_yield(void), void
- Yields the processor, called by objc_thread_yield.
-
-__objc_thread_exit(void), int
- Terminates the thread, called by objc_thread_exit.
- Return -1 if error otherwise function does not return.
-
-__objc_thread_id(void), objc_thread_t
- Returns the current thread's id, called by objc_thread_id.
- Return -1 if error otherwise return thread id.
-
-__objc_thread_set_data(void *value), int
- Set pointer for thread local storage, called by objc_thread_set_data.
- Returns -1 if error otherwise return 0.
-
-__objc_thread_get_data(void), void *
- Returns the pointer to the thread's local storage.
- Returns NULL if error, called by objc_thread_get_data.
-
-
-******************************************************************************
-* Mutexes:
-
-Mutexes can be locked recursively. Each locked mutex remembers
-its owner (by thread id) and how many times it has been locked. The
-last unlock on a mutex removes the system lock and allows other
-threads to access the mutex.
-
-*****
-* Frontend mutex functions
-* User programs should use these functions.
-
-objc_mutex_allocate(void), objc_mutex_t
- Allocates a new mutex. Mutex is initially unlocked.
- Return NULL if error otherwise return mutex pointer.
-
-objc_mutex_deallocate(objc_mutex_t mutex), int
- Free a mutex. Before freeing the mutex, makes sure that no
- one else is using it.
- Return -1 if error otherwise return 0.
-
-objc_mutex_lock(objc_mutex_t mutex), int
- Locks a mutex. As mentioned earlier, the same thread may call
- this routine repeatedly.
- Return -1 if error otherwise return 0.
-
-objc_mutex_trylock(objc_mutex_t mutex), int
- Attempts to lock a mutex. If lock on mutex can be acquired
- then function operates exactly as objc_mutex_lock.
- Return -1 if failed to acquire lock otherwise return 0.
-
-objc_mutex_unlock(objc_mutex_t mutex), int
- Unlocks the mutex by one level. Other threads may not acquire
- the mutex until this thread has released all locks on it.
- Return -1 if error otherwise return 0.
-
-*****
-* Backend mutex functions
-* User programs should *NOT* directly call these functions.
-
-__objc_mutex_allocate(objc_mutex_t mutex), int
- Allocates a new mutex, called by objc_mutex_allocate.
- Return -1 if error otherwise return 0.
-
-__objc_mutex_deallocate(objc_mutex_t mutex), int
- Free a mutex, called by objc_mutex_deallocate.
- Return -1 if error otherwise return 0.
-
-__objc_mutex_lock(objc_mutex_t mutex), int
- Locks a mutex, called by objc_mutex_lock.
- Return -1 if error otherwise return 0.
-
-__objc_mutex_trylock(objc_mutex_t mutex), int
- Attempts to lock a mutex, called by objc_mutex_trylock.
- Return -1 if failed to acquire lock or error otherwise return 0.
-
-__objc_mutex_unlock(objc_mutex_t mutex), int
- Unlocks the mutex, called by objc_mutex_unlock.
- Return -1 if error otherwise return 0.
-
-******************************************************************************
-* Condition Mutexes:
-
-Mutexes can be locked recursively. Each locked mutex remembers
-its owner (by thread id) and how many times it has been locked. The
-last unlock on a mutex removes the system lock and allows other
-threads to access the mutex.
-
-*
-* Frontend condition mutex functions
-* User programs should use these functions.
-*
-
-objc_condition_allocate(void), objc_condition_t
- Allocate a condition mutex.
- Return NULL if error otherwise return condition pointer.
-
-objc_condition_deallocate(objc_condition_t condition), int
- Deallocate a condition. Note that this includes an implicit
- condition_broadcast to insure that waiting threads have the
- opportunity to wake. It is legal to dealloc a condition only
- if no other thread is/will be using it. Does NOT check for
- other threads waiting but just wakes them up.
- Return -1 if error otherwise return 0.
-
-objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex), int
- Wait on the condition unlocking the mutex until objc_condition_signal()
- or objc_condition_broadcast() are called for the same condition. The
- given mutex *must* have the depth 1 so that it can be unlocked
- here, for someone else can lock it and signal/broadcast the condition.
- The mutex is used to lock access to the shared data that make up the
- "condition" predicate.
- Return -1 if error otherwise return 0.
-
-objc_condition_broadcast(objc_condition_t condition), int
- Wake up all threads waiting on this condition. It is recommended that
- the called would lock the same mutex as the threads in
- objc_condition_wait before changing the "condition predicate"
- and make this call and unlock it right away after this call.
- Return -1 if error otherwise return 0.
-
-objc_condition_signal(objc_condition_t condition), int
- Wake up one thread waiting on this condition.
- Return -1 if error otherwise return 0.
-
-*
-* Backend condition mutex functions
-* User programs should *NOT* directly call these functions.
-*
-
-__objc_condition_allocate(objc_condition_t condition), int
- Allocate a condition mutex, called by objc_condition_allocate.
- Return -1 if error otherwise return 0.
-
-__objc_condition_deallocate(objc_condition_t condition), int
- Deallocate a condition, called by objc_condition_deallocate.
- Return -1 if error otherwise return 0.
-
-__objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex), int
- Wait on the condition, called by objc_condition_wait.
- Return -1 if error otherwise return 0 when condition is met.
-
-__objc_condition_broadcast(objc_condition_t condition), int
- Wake up all threads waiting on this condition.
- Called by objc_condition_broadcast.
- Return -1 if error otherwise return 0.
-
-__objc_condition_signal(objc_condition_t condition), int
- Wake up one thread waiting on this condition.
- Called by objc_condition_signal.
- Return -1 if error otherwise return 0.
diff --git a/contrib/libobjc/THREADS.MACH b/contrib/libobjc/THREADS.MACH
deleted file mode 100644
index 55de66378669..000000000000
--- a/contrib/libobjc/THREADS.MACH
+++ /dev/null
@@ -1,23 +0,0 @@
-This readme refers to the file thr-mach.c.
-
-Under mach, thread priorities are kinda strange-- any given thread has
-a MAXIMUM priority and a BASE priority. The BASE priority is the
-current priority of the thread and the MAXIMUM is the maximum possible
-priority the thread can assume. The developer can lower, but never
-raise the maximum priority.
-
-The gcc concept of thread priorities is that they run at one of three
-levels; interactive, background, and low.
-
-Under mach, this is translated to:
-
-interactive -- set priority to maximum
-background -- set priority to 2/3 of maximum
-low -- set priority to 1/3 of maximum
-
-This means that it is possible for a thread with the priority of
-interactive to actually run at a lower priority than another thread
-with a background, or even low, priority if the developer has modified
-the maximum priority.
-
-
diff --git a/contrib/libobjc/archive.c b/contrib/libobjc/archive.c
deleted file mode 100644
index 10106c1145e7..000000000000
--- a/contrib/libobjc/archive.c
+++ /dev/null
@@ -1,1651 +0,0 @@
-/* GNU Objective C Runtime archiving
- Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
- Contributed by Kresten Krab Thorup
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
-details.
-
-You should have received a copy of the GNU General Public License along with
-GNU CC; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with files compiled with
- GCC 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 "tconfig.h"
-#include "runtime.h"
-#include "typedstream.h"
-#include "encoding.h"
-
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-
-extern int fflush(FILE*);
-
-#define ROUND(V, A) \
- ({ typeof(V) __v=(V); typeof(A) __a=(A); \
- __a*((__v+__a-1)/__a); })
-
-#define PTR2LONG(P) (((char*)(P))-(char*)0)
-#define LONG2PTR(L) (((char*)0)+(L))
-
-/* Declare some functions... */
-
-static int
-objc_read_class (struct objc_typed_stream* stream, Class* class);
-
-int objc_sizeof_type(const char* type);
-
-static int
-objc_write_use_common (struct objc_typed_stream* stream, unsigned long key);
-
-static int
-objc_write_register_common (struct objc_typed_stream* stream,
- unsigned long key);
-
-static int
-objc_write_class (struct objc_typed_stream* stream,
- struct objc_class* class);
-
-const char* objc_skip_type (const char* type);
-
-static void __objc_finish_write_root_object(struct objc_typed_stream*);
-static void __objc_finish_read_root_object(struct objc_typed_stream*);
-
-static __inline__ int
-__objc_code_unsigned_char (unsigned char* buf, unsigned char val)
-{
- if ((val&_B_VALUE) == val)
- {
- buf[0] = val|_B_SINT;
- return 1;
- }
- else
- {
- buf[0] = _B_NINT|0x01;
- buf[1] = val;
- return 2;
- }
-}
-
-int
-objc_write_unsigned_char (struct objc_typed_stream* stream,
- unsigned char value)
-{
- unsigned char buf[sizeof (unsigned char)+1];
- int len = __objc_code_unsigned_char (buf, value);
- return (*stream->write)(stream->physical, buf, len);
-}
-
-static __inline__ int
-__objc_code_char (unsigned char* buf, signed char val)
-{
- if (val >= 0)
- return __objc_code_unsigned_char (buf, val);
- else
- {
- buf[0] = _B_NINT|_B_SIGN|0x01;
- buf[1] = -val;
- return 2;
- }
-}
-
-int
-objc_write_char (struct objc_typed_stream* stream, signed char value)
-{
- unsigned char buf[sizeof (char)+1];
- int len = __objc_code_char (buf, value);
- return (*stream->write)(stream->physical, buf, len);
-}
-
-static __inline__ int
-__objc_code_unsigned_short (unsigned char* buf, unsigned short val)
-{
- if ((val&_B_VALUE) == val)
- {
- buf[0] = val|_B_SINT;
- return 1;
- }
- else
- {
- int c, b;
-
- buf[0] = _B_NINT;
-
- for (c= sizeof(short); c != 0; c -= 1)
- if (((val>>(8*(c-1)))%0x100) != 0)
- break;
-
- buf[0] |= c;
-
- for (b = 1; c != 0; c--, b++)
- {
- buf[b] = (val >> (8*(c-1)))%0x100;
- }
-
- return b;
- }
-}
-
-int
-objc_write_unsigned_short (struct objc_typed_stream* stream,
- unsigned short value)
-{
- unsigned char buf[sizeof (unsigned short)+1];
- int len = __objc_code_unsigned_short (buf, value);
- return (*stream->write)(stream->physical, buf, len);
-}
-
-static __inline__ int
-__objc_code_short (unsigned char* buf, short val)
-{
- int sign = (val < 0);
- int size = __objc_code_unsigned_short (buf, sign ? -val : val);
- if (sign)
- buf[0] |= _B_SIGN;
- return size;
-}
-
-int
-objc_write_short (struct objc_typed_stream* stream, short value)
-{
- unsigned char buf[sizeof (short)+1];
- int len = __objc_code_short (buf, value);
- return (*stream->write)(stream->physical, buf, len);
-}
-
-
-static __inline__ int
-__objc_code_unsigned_int (unsigned char* buf, unsigned int val)
-{
- if ((val&_B_VALUE) == val)
- {
- buf[0] = val|_B_SINT;
- return 1;
- }
- else
- {
- int c, b;
-
- buf[0] = _B_NINT;
-
- for (c= sizeof(int); c != 0; c -= 1)
- if (((val>>(8*(c-1)))%0x100) != 0)
- break;
-
- buf[0] |= c;
-
- for (b = 1; c != 0; c--, b++)
- {
- buf[b] = (val >> (8*(c-1)))%0x100;
- }
-
- return b;
- }
-}
-
-int
-objc_write_unsigned_int (struct objc_typed_stream* stream, unsigned int value)
-{
- unsigned char buf[sizeof(unsigned int)+1];
- int len = __objc_code_unsigned_int (buf, value);
- return (*stream->write)(stream->physical, buf, len);
-}
-
-static __inline__ int
-__objc_code_int (unsigned char* buf, int val)
-{
- int sign = (val < 0);
- int size = __objc_code_unsigned_int (buf, sign ? -val : val);
- if (sign)
- buf[0] |= _B_SIGN;
- return size;
-}
-
-int
-objc_write_int (struct objc_typed_stream* stream, int value)
-{
- unsigned char buf[sizeof(int)+1];
- int len = __objc_code_int (buf, value);
- return (*stream->write)(stream->physical, buf, len);
-}
-
-static __inline__ int
-__objc_code_unsigned_long (unsigned char* buf, unsigned long val)
-{
- if ((val&_B_VALUE) == val)
- {
- buf[0] = val|_B_SINT;
- return 1;
- }
- else
- {
- int c, b;
-
- buf[0] = _B_NINT;
-
- for (c= sizeof(long); c != 0; c -= 1)
- if (((val>>(8*(c-1)))%0x100) != 0)
- break;
-
- buf[0] |= c;
-
- for (b = 1; c != 0; c--, b++)
- {
- buf[b] = (val >> (8*(c-1)))%0x100;
- }
-
- return b;
- }
-}
-
-int
-objc_write_unsigned_long (struct objc_typed_stream* stream,
- unsigned long value)
-{
- unsigned char buf[sizeof(unsigned long)+1];
- int len = __objc_code_unsigned_long (buf, value);
- return (*stream->write)(stream->physical, buf, len);
-}
-
-static __inline__ int
-__objc_code_long (unsigned char* buf, long val)
-{
- int sign = (val < 0);
- int size = __objc_code_unsigned_long (buf, sign ? -val : val);
- if (sign)
- buf[0] |= _B_SIGN;
- return size;
-}
-
-int
-objc_write_long (struct objc_typed_stream* stream, long value)
-{
- unsigned char buf[sizeof(long)+1];
- int len = __objc_code_long (buf, value);
- return (*stream->write)(stream->physical, buf, len);
-}
-
-
-int
-objc_write_string (struct objc_typed_stream* stream,
- const unsigned char* string, unsigned int nbytes)
-{
- unsigned char buf[sizeof(unsigned int)+1];
- int len = __objc_code_unsigned_int (buf, nbytes);
-
- if ((buf[0]&_B_CODE) == _B_SINT)
- buf[0] = (buf[0]&_B_VALUE)|_B_SSTR;
-
- else /* _B_NINT */
- buf[0] = (buf[0]&_B_VALUE)|_B_NSTR;
-
- if ((*stream->write)(stream->physical, buf, len) != 0)
- return (*stream->write)(stream->physical, string, nbytes);
- else
- return 0;
-}
-
-int
-objc_write_string_atomic (struct objc_typed_stream* stream,
- unsigned char* string, unsigned int nbytes)
-{
- unsigned long key;
- if ((key = PTR2LONG(hash_value_for_key (stream->stream_table, string))))
- return objc_write_use_common (stream, key);
- else
- {
- int length;
- hash_add (&stream->stream_table, LONG2PTR(key=PTR2LONG(string)), string);
- if ((length = objc_write_register_common (stream, key)))
- return objc_write_string (stream, string, nbytes);
- return length;
- }
-}
-
-static int
-objc_write_register_common (struct objc_typed_stream* stream,
- unsigned long key)
-{
- unsigned char buf[sizeof (unsigned long)+2];
- int len = __objc_code_unsigned_long (buf+1, key);
- if (len == 1)
- {
- buf[0] = _B_RCOMM|0x01;
- buf[1] &= _B_VALUE;
- return (*stream->write)(stream->physical, buf, len+1);
- }
- else
- {
- buf[1] = (buf[1]&_B_VALUE)|_B_RCOMM;
- return (*stream->write)(stream->physical, buf+1, len);
- }
-}
-
-static int
-objc_write_use_common (struct objc_typed_stream* stream, unsigned long key)
-{
- unsigned char buf[sizeof (unsigned long)+2];
- int len = __objc_code_unsigned_long (buf+1, key);
- if (len == 1)
- {
- buf[0] = _B_UCOMM|0x01;
- buf[1] &= _B_VALUE;
- return (*stream->write)(stream->physical, buf, 2);
- }
- else
- {
- buf[1] = (buf[1]&_B_VALUE)|_B_UCOMM;
- return (*stream->write)(stream->physical, buf+1, len);
- }
-}
-
-static __inline__ int
-__objc_write_extension (struct objc_typed_stream* stream, unsigned char code)
-{
- if (code <= _B_VALUE)
- {
- unsigned char buf = code|_B_EXT;
- return (*stream->write)(stream->physical, &buf, 1);
- }
- else
- {
- objc_error(nil, OBJC_ERR_BAD_OPCODE,
- "__objc_write_extension: bad opcode %c\n", code);
- return -1;
- }
-}
-
-__inline__ int
-__objc_write_object (struct objc_typed_stream* stream, id object)
-{
- unsigned char buf = '\0';
- SEL write_sel = sel_get_any_uid ("write:");
- if (object)
- {
- __objc_write_extension (stream, _BX_OBJECT);
- objc_write_class (stream, object->class_pointer);
- (*objc_msg_lookup(object, write_sel))(object, write_sel, stream);
- return (*stream->write)(stream->physical, &buf, 1);
- }
- else
- return objc_write_use_common(stream, 0);
-}
-
-int
-objc_write_object_reference (struct objc_typed_stream* stream, id object)
-{
- unsigned long key;
- if ((key = PTR2LONG(hash_value_for_key (stream->object_table, object))))
- return objc_write_use_common (stream, key);
-
- __objc_write_extension (stream, _BX_OBJREF);
- return objc_write_unsigned_long (stream, PTR2LONG (object));
-}
-
-int
-objc_write_root_object (struct objc_typed_stream* stream, id object)
-{
- int len = 0;
- if (stream->writing_root_p)
- objc_error (nil, OBJC_ERR_RECURSE_ROOT,
- "objc_write_root_object called recursively");
- else
- {
- stream->writing_root_p = 1;
- __objc_write_extension (stream, _BX_OBJROOT);
- if((len = objc_write_object (stream, object)))
- __objc_finish_write_root_object(stream);
- stream->writing_root_p = 0;
- }
- return len;
-}
-
-int
-objc_write_object (struct objc_typed_stream* stream, id object)
-{
- unsigned long key;
- if ((key = PTR2LONG(hash_value_for_key (stream->object_table, object))))
- return objc_write_use_common (stream, key);
-
- else if (object == nil)
- return objc_write_use_common(stream, 0);
-
- else
- {
- int length;
- hash_add (&stream->object_table, LONG2PTR(key=PTR2LONG(object)), object);
- if ((length = objc_write_register_common (stream, key)))
- return __objc_write_object (stream, object);
- return length;
- }
-}
-
-__inline__ int
-__objc_write_class (struct objc_typed_stream* stream, struct objc_class* class)
-{
- __objc_write_extension (stream, _BX_CLASS);
- objc_write_string_atomic(stream, (char*)class->name,
- strlen((char*)class->name));
- return objc_write_unsigned_long (stream, class->version);
-}
-
-
-static int
-objc_write_class (struct objc_typed_stream* stream,
- struct objc_class* class)
-{
- unsigned long key;
- if ((key = PTR2LONG(hash_value_for_key (stream->stream_table, class))))
- return objc_write_use_common (stream, key);
- else
- {
- int length;
- hash_add (&stream->stream_table, LONG2PTR(key=PTR2LONG(class)), class);
- if ((length = objc_write_register_common (stream, key)))
- return __objc_write_class (stream, class);
- return length;
- }
-}
-
-
-__inline__ int
-__objc_write_selector (struct objc_typed_stream* stream, SEL selector)
-{
- const char* sel_name;
- __objc_write_extension (stream, _BX_SEL);
- /* to handle NULL selectors */
- if ((SEL)0 == selector)
- return objc_write_string (stream, "", 0);
- sel_name = sel_get_name (selector);
- return objc_write_string (stream, sel_name, strlen ((char*)sel_name));
-}
-
-int
-objc_write_selector (struct objc_typed_stream* stream, SEL selector)
-{
- const char* sel_name;
- unsigned long key;
-
- /* to handle NULL selectors */
- if ((SEL)0 == selector)
- return __objc_write_selector (stream, selector);
-
- sel_name = sel_get_name (selector);
- if ((key = PTR2LONG(hash_value_for_key (stream->stream_table, sel_name))))
- return objc_write_use_common (stream, key);
- else
- {
- int length;
- hash_add (&stream->stream_table,
- LONG2PTR(key=PTR2LONG(sel_name)), (char*)sel_name);
- if ((length = objc_write_register_common (stream, key)))
- return __objc_write_selector (stream, selector);
- return length;
- }
-}
-
-
-
-/*
-** Read operations
-*/
-
-__inline__ int
-objc_read_char (struct objc_typed_stream* stream, char* val)
-{
- unsigned char buf;
- int len;
- len = (*stream->read)(stream->physical, &buf, 1);
- if (len != 0)
- {
- if ((buf & _B_CODE) == _B_SINT)
- (*val) = (buf & _B_VALUE);
-
- else if ((buf & _B_NUMBER) == 1)
- {
- len = (*stream->read)(stream->physical, val, 1);
- if (buf&_B_SIGN)
- (*val) = -1*(*val);
- }
-
- else
- objc_error(nil, OBJC_ERR_BAD_DATA,
- "expected 8bit signed int, got %dbit int",
- (int)(buf&_B_NUMBER)*8);
- }
- return len;
-}
-
-
-__inline__ int
-objc_read_unsigned_char (struct objc_typed_stream* stream, unsigned char* val)
-{
- unsigned char buf;
- int len;
- if ((len = (*stream->read)(stream->physical, &buf, 1)))
- {
- if ((buf & _B_CODE) == _B_SINT)
- (*val) = (buf & _B_VALUE);
-
- else if ((buf & _B_NUMBER) == 1)
- len = (*stream->read)(stream->physical, val, 1);
-
- else
- objc_error(nil, OBJC_ERR_BAD_DATA,
- "expected 8bit unsigned int, got %dbit int",
- (int)(buf&_B_NUMBER)*8);
- }
- return len;
-}
-
-__inline__ int
-objc_read_short (struct objc_typed_stream* stream, short* value)
-{
- unsigned char buf[sizeof(short)+1];
- int len;
- if ((len = (*stream->read)(stream->physical, buf, 1)))
- {
- if ((buf[0] & _B_CODE) == _B_SINT)
- (*value) = (buf[0] & _B_VALUE);
-
- else
- {
- int pos = 1;
- int nbytes = buf[0] & _B_NUMBER;
- if (nbytes > sizeof (short))
- objc_error(nil, OBJC_ERR_BAD_DATA,
- "expected short, got bigger (%dbits)", nbytes*8);
- len = (*stream->read)(stream->physical, buf+1, nbytes);
- (*value) = 0;
- while (pos <= nbytes)
- (*value) = ((*value)*0x100) + buf[pos++];
- if (buf[0] & _B_SIGN)
- (*value) = -(*value);
- }
- }
- return len;
-}
-
-__inline__ int
-objc_read_unsigned_short (struct objc_typed_stream* stream,
- unsigned short* value)
-{
- unsigned char buf[sizeof(unsigned short)+1];
- int len;
- if ((len = (*stream->read)(stream->physical, buf, 1)))
- {
- if ((buf[0] & _B_CODE) == _B_SINT)
- (*value) = (buf[0] & _B_VALUE);
-
- else
- {
- int pos = 1;
- int nbytes = buf[0] & _B_NUMBER;
- if (nbytes > sizeof (short))
- objc_error(nil, OBJC_ERR_BAD_DATA,
- "expected short, got int or bigger");
- len = (*stream->read)(stream->physical, buf+1, nbytes);
- (*value) = 0;
- while (pos <= nbytes)
- (*value) = ((*value)*0x100) + buf[pos++];
- }
- }
- return len;
-}
-
-
-__inline__ int
-objc_read_int (struct objc_typed_stream* stream, int* value)
-{
- unsigned char buf[sizeof(int)+1];
- int len;
- if ((len = (*stream->read)(stream->physical, buf, 1)))
- {
- if ((buf[0] & _B_CODE) == _B_SINT)
- (*value) = (buf[0] & _B_VALUE);
-
- else
- {
- int pos = 1;
- int nbytes = buf[0] & _B_NUMBER;
- if (nbytes > sizeof (int))
- objc_error(nil, OBJC_ERR_BAD_DATA, "expected int, got bigger");
- len = (*stream->read)(stream->physical, buf+1, nbytes);
- (*value) = 0;
- while (pos <= nbytes)
- (*value) = ((*value)*0x100) + buf[pos++];
- if (buf[0] & _B_SIGN)
- (*value) = -(*value);
- }
- }
- return len;
-}
-
-__inline__ int
-objc_read_long (struct objc_typed_stream* stream, long* value)
-{
- unsigned char buf[sizeof(long)+1];
- int len;
- if ((len = (*stream->read)(stream->physical, buf, 1)))
- {
- if ((buf[0] & _B_CODE) == _B_SINT)
- (*value) = (buf[0] & _B_VALUE);
-
- else
- {
- int pos = 1;
- int nbytes = buf[0] & _B_NUMBER;
- if (nbytes > sizeof (long))
- objc_error(nil, OBJC_ERR_BAD_DATA, "expected long, got bigger");
- len = (*stream->read)(stream->physical, buf+1, nbytes);
- (*value) = 0;
- while (pos <= nbytes)
- (*value) = ((*value)*0x100) + buf[pos++];
- if (buf[0] & _B_SIGN)
- (*value) = -(*value);
- }
- }
- return len;
-}
-
-__inline__ int
-__objc_read_nbyte_uint (struct objc_typed_stream* stream,
- unsigned int nbytes, unsigned int* val)
-{
- int len, pos = 0;
- unsigned char buf[sizeof(unsigned int)+1];
-
- if (nbytes > sizeof (int))
- objc_error(nil, OBJC_ERR_BAD_DATA, "expected int, got bigger");
-
- len = (*stream->read)(stream->physical, buf, nbytes);
- (*val) = 0;
- while (pos < nbytes)
- (*val) = ((*val)*0x100) + buf[pos++];
- return len;
-}
-
-
-__inline__ int
-objc_read_unsigned_int (struct objc_typed_stream* stream,
- unsigned int* value)
-{
- unsigned char buf[sizeof(unsigned int)+1];
- int len;
- if ((len = (*stream->read)(stream->physical, buf, 1)))
- {
- if ((buf[0] & _B_CODE) == _B_SINT)
- (*value) = (buf[0] & _B_VALUE);
-
- else
- len = __objc_read_nbyte_uint (stream, (buf[0] & _B_VALUE), value);
-
- }
- return len;
-}
-
-int
-__objc_read_nbyte_ulong (struct objc_typed_stream* stream,
- unsigned int nbytes, unsigned long* val)
-{
- int len, pos = 0;
- unsigned char buf[sizeof(unsigned long)+1];
-
- if (nbytes > sizeof (long))
- objc_error(nil, OBJC_ERR_BAD_DATA, "expected long, got bigger");
-
- len = (*stream->read)(stream->physical, buf, nbytes);
- (*val) = 0;
- while (pos < nbytes)
- (*val) = ((*val)*0x100) + buf[pos++];
- return len;
-}
-
-
-__inline__ int
-objc_read_unsigned_long (struct objc_typed_stream* stream,
- unsigned long* value)
-{
- unsigned char buf[sizeof(unsigned long)+1];
- int len;
- if ((len = (*stream->read)(stream->physical, buf, 1)))
- {
- if ((buf[0] & _B_CODE) == _B_SINT)
- (*value) = (buf[0] & _B_VALUE);
-
- else
- len = __objc_read_nbyte_ulong (stream, (buf[0] & _B_VALUE), value);
-
- }
- return len;
-}
-
-__inline__ int
-objc_read_string (struct objc_typed_stream* stream,
- char** string)
-{
- unsigned char buf[sizeof(unsigned int)+1];
- int len;
- if ((len = (*stream->read)(stream->physical, buf, 1)))
- {
- unsigned long key = 0;
-
- if ((buf[0]&_B_CODE) == _B_RCOMM) /* register following */
- {
- len = __objc_read_nbyte_ulong(stream, (buf[0] & _B_VALUE), &key);
- len = (*stream->read)(stream->physical, buf, 1);
- }
-
- switch (buf[0]&_B_CODE) {
- case _B_SSTR:
- {
- int length = buf[0]&_B_VALUE;
- (*string) = (char*)objc_malloc(length+1);
- if (key)
- hash_add (&stream->stream_table, LONG2PTR(key), *string);
- len = (*stream->read)(stream->physical, *string, length);
- (*string)[length] = '\0';
- }
- break;
-
- case _B_UCOMM:
- {
- char *tmp;
- len = __objc_read_nbyte_ulong(stream, (buf[0] & _B_VALUE), &key);
- tmp = hash_value_for_key (stream->stream_table, LONG2PTR (key));
- *string = objc_malloc (strlen(tmp) + 1);
- strcpy (*string, tmp);
- }
- break;
-
- case _B_NSTR:
- {
- unsigned int nbytes = buf[0]&_B_VALUE;
- len = __objc_read_nbyte_uint(stream, nbytes, &nbytes);
- if (len) {
- (*string) = (char*)objc_malloc(nbytes+1);
- if (key)
- hash_add (&stream->stream_table, LONG2PTR(key), *string);
- len = (*stream->read)(stream->physical, *string, nbytes);
- (*string)[nbytes] = '\0';
- }
- }
- break;
-
- default:
- objc_error(nil, OBJC_ERR_BAD_DATA,
- "expected string, got opcode %c\n", (buf[0]&_B_CODE));
- }
- }
-
- return len;
-}
-
-
-int
-objc_read_object (struct objc_typed_stream* stream, id* object)
-{
- unsigned char buf[sizeof (unsigned int)];
- int len;
- if ((len = (*stream->read)(stream->physical, buf, 1)))
- {
- SEL read_sel = sel_get_any_uid ("read:");
- unsigned long key = 0;
-
- if ((buf[0]&_B_CODE) == _B_RCOMM) /* register common */
- {
- len = __objc_read_nbyte_ulong(stream, (buf[0] & _B_VALUE), &key);
- len = (*stream->read)(stream->physical, buf, 1);
- }
-
- if (buf[0] == (_B_EXT | _BX_OBJECT))
- {
- Class class;
-
- /* get class */
- len = objc_read_class (stream, &class);
-
- /* create instance */
- (*object) = class_create_instance(class);
-
- /* register? */
- if (key)
- hash_add (&stream->object_table, LONG2PTR(key), *object);
-
- /* send -read: */
- if (__objc_responds_to (*object, read_sel))
- (*get_imp(class, read_sel))(*object, read_sel, stream);
-
- /* check null-byte */
- len = (*stream->read)(stream->physical, buf, 1);
- if (buf[0] != '\0')
- objc_error(nil, OBJC_ERR_BAD_DATA,
- "expected null-byte, got opcode %c", buf[0]);
- }
-
- else if ((buf[0]&_B_CODE) == _B_UCOMM)
- {
- if (key)
- objc_error(nil, OBJC_ERR_BAD_KEY, "cannot register use upcode...");
- len = __objc_read_nbyte_ulong(stream, (buf[0] & _B_VALUE), &key);
- (*object) = hash_value_for_key (stream->object_table, LONG2PTR(key));
- }
-
- else if (buf[0] == (_B_EXT | _BX_OBJREF)) /* a forward reference */
- {
- struct objc_list* other;
- len = objc_read_unsigned_long (stream, &key);
- other = (struct objc_list*)hash_value_for_key (stream->object_refs,
- LONG2PTR(key));
- hash_add (&stream->object_refs, LONG2PTR(key),
- (void*)list_cons(object, other));
- }
-
- else if (buf[0] == (_B_EXT | _BX_OBJROOT)) /* a root object */
- {
- if (key)
- objc_error(nil, OBJC_ERR_BAD_KEY,
- "cannot register root object...");
- len = objc_read_object (stream, object);
- __objc_finish_read_root_object (stream);
- }
-
- else
- objc_error(nil, OBJC_ERR_BAD_DATA,
- "expected object, got opcode %c", buf[0]);
- }
- return len;
-}
-
-static int
-objc_read_class (struct objc_typed_stream* stream, Class* class)
-{
- unsigned char buf[sizeof (unsigned int)];
- int len;
- if ((len = (*stream->read)(stream->physical, buf, 1)))
- {
- unsigned long key = 0;
-
- if ((buf[0]&_B_CODE) == _B_RCOMM) /* register following */
- {
- len = __objc_read_nbyte_ulong(stream, (buf[0] & _B_VALUE), &key);
- len = (*stream->read)(stream->physical, buf, 1);
- }
-
- if (buf[0] == (_B_EXT | _BX_CLASS))
- {
- char* class_name;
- unsigned long version;
-
- /* get class */
- len = objc_read_string (stream, &class_name);
- (*class) = objc_get_class(class_name);
- objc_free(class_name);
-
- /* register */
- if (key)
- hash_add (&stream->stream_table, LONG2PTR(key), *class);
-
- objc_read_unsigned_long(stream, &version);
- hash_add (&stream->class_table, (*class)->name, (void*)version);
- }
-
- else if ((buf[0]&_B_CODE) == _B_UCOMM)
- {
- if (key)
- objc_error(nil, OBJC_ERR_BAD_KEY, "cannot register use upcode...");
- len = __objc_read_nbyte_ulong(stream, (buf[0] & _B_VALUE), &key);
- (*class) = hash_value_for_key (stream->stream_table, LONG2PTR(key));
- if (!*class)
- objc_error(nil, OBJC_ERR_BAD_CLASS,
- "cannot find class for key %lu", key);
- }
-
- else
- objc_error(nil, OBJC_ERR_BAD_DATA,
- "expected class, got opcode %c", buf[0]);
- }
- return len;
-}
-
-int
-objc_read_selector (struct objc_typed_stream* stream, SEL* selector)
-{
- unsigned char buf[sizeof (unsigned int)];
- int len;
- if ((len = (*stream->read)(stream->physical, buf, 1)))
- {
- unsigned long key = 0;
-
- if ((buf[0]&_B_CODE) == _B_RCOMM) /* register following */
- {
- len = __objc_read_nbyte_ulong(stream, (buf[0] & _B_VALUE), &key);
- len = (*stream->read)(stream->physical, buf, 1);
- }
-
- if (buf[0] == (_B_EXT|_BX_SEL)) /* selector! */
- {
- char* selector_name;
-
- /* get selector */
- len = objc_read_string (stream, &selector_name);
- /* To handle NULL selectors */
- if (0 == strlen(selector_name))
- {
- (*selector) = (SEL)0;
- return 0;
- }
- else
- (*selector) = sel_get_any_uid(selector_name);
- objc_free(selector_name);
-
- /* register */
- if (key)
- hash_add (&stream->stream_table, LONG2PTR(key), (void*)*selector);
- }
-
- else if ((buf[0]&_B_CODE) == _B_UCOMM)
- {
- if (key)
- objc_error(nil, OBJC_ERR_BAD_KEY, "cannot register use upcode...");
- len = __objc_read_nbyte_ulong(stream, (buf[0] & _B_VALUE), &key);
- (*selector) = hash_value_for_key (stream->stream_table,
- LONG2PTR(key));
- }
-
- else
- objc_error(nil, OBJC_ERR_BAD_DATA,
- "expected selector, got opcode %c", buf[0]);
- }
- return len;
-}
-
-/*
-** USER LEVEL FUNCTIONS
-*/
-
-/*
-** Write one object, encoded in TYPE and pointed to by DATA to the
-** typed stream STREAM.
-*/
-
-int
-objc_write_type(TypedStream* stream, const char* type, const void* data)
-{
- switch(*type) {
- case _C_ID:
- return objc_write_object (stream, *(id*)data);
- break;
-
- case _C_CLASS:
- return objc_write_class (stream, *(Class*)data);
- break;
-
- case _C_SEL:
- return objc_write_selector (stream, *(SEL*)data);
- break;
-
- case _C_CHR:
- return objc_write_char(stream, *(signed char*)data);
- break;
-
- case _C_UCHR:
- return objc_write_unsigned_char(stream, *(unsigned char*)data);
- break;
-
- case _C_SHT:
- return objc_write_short(stream, *(short*)data);
- break;
-
- case _C_USHT:
- return objc_write_unsigned_short(stream, *(unsigned short*)data);
- break;
-
- case _C_INT:
- return objc_write_int(stream, *(int*)data);
- break;
-
- case _C_UINT:
- return objc_write_unsigned_int(stream, *(unsigned int*)data);
- break;
-
- case _C_LNG:
- return objc_write_long(stream, *(long*)data);
- break;
-
- case _C_ULNG:
- return objc_write_unsigned_long(stream, *(unsigned long*)data);
- break;
-
- case _C_CHARPTR:
- return objc_write_string (stream, *(char**)data, strlen(*(char**)data));
- break;
-
- case _C_ATOM:
- return objc_write_string_atomic (stream, *(char**)data,
- strlen(*(char**)data));
- break;
-
- case _C_ARY_B:
- {
- int len = atoi(type+1);
- while (isdigit(*++type))
- ;
- return objc_write_array (stream, type, len, data);
- }
- break;
-
- case _C_STRUCT_B:
- {
- int acc_size = 0;
- int align;
- while (*type != _C_STRUCT_E && *type++ != '=')
- ; /* skip "<name>=" */
- while (*type != _C_STRUCT_E)
- {
- align = objc_alignof_type (type); /* padd to alignment */
- acc_size += ROUND (acc_size, align);
- objc_write_type (stream, type, ((char*)data)+acc_size);
- acc_size += objc_sizeof_type (type); /* add component size */
- type = objc_skip_typespec (type); /* skip component */
- }
- return 1;
- }
-
- default:
- {
- objc_error(nil, OBJC_ERR_BAD_TYPE,
- "objc_write_type: cannot parse typespec: %s\n", type);
- return 0;
- }
- }
-}
-
-/*
-** Read one object, encoded in TYPE and pointed to by DATA to the
-** typed stream STREAM. DATA specifies the address of the types to
-** read. Expected type is checked against the type actually present
-** on the stream.
-*/
-
-int
-objc_read_type(TypedStream* stream, const char* type, void* data)
-{
- char c;
- switch(c = *type) {
- case _C_ID:
- return objc_read_object (stream, (id*)data);
- break;
-
- case _C_CLASS:
- return objc_read_class (stream, (Class*)data);
- break;
-
- case _C_SEL:
- return objc_read_selector (stream, (SEL*)data);
- break;
-
- case _C_CHR:
- return objc_read_char (stream, (char*)data);
- break;
-
- case _C_UCHR:
- return objc_read_unsigned_char (stream, (unsigned char*)data);
- break;
-
- case _C_SHT:
- return objc_read_short (stream, (short*)data);
- break;
-
- case _C_USHT:
- return objc_read_unsigned_short (stream, (unsigned short*)data);
- break;
-
- case _C_INT:
- return objc_read_int (stream, (int*)data);
- break;
-
- case _C_UINT:
- return objc_read_unsigned_int (stream, (unsigned int*)data);
- break;
-
- case _C_LNG:
- return objc_read_long (stream, (long*)data);
- break;
-
- case _C_ULNG:
- return objc_read_unsigned_long (stream, (unsigned long*)data);
- break;
-
- case _C_CHARPTR:
- case _C_ATOM:
- return objc_read_string (stream, (char**)data);
- break;
-
- case _C_ARY_B:
- {
- int len = atoi(type+1);
- while (isdigit(*++type))
- ;
- return objc_read_array (stream, type, len, data);
- }
- break;
-
- case _C_STRUCT_B:
- {
- int acc_size = 0;
- int align;
- while (*type != _C_STRUCT_E && *type++ != '=')
- ; /* skip "<name>=" */
- while (*type != _C_STRUCT_E)
- {
- align = objc_alignof_type (type); /* padd to alignment */
- acc_size += ROUND (acc_size, align);
- objc_read_type (stream, type, ((char*)data)+acc_size);
- acc_size += objc_sizeof_type (type); /* add component size */
- type = objc_skip_typespec (type); /* skip component */
- }
- return 1;
- }
-
- default:
- {
- objc_error(nil, OBJC_ERR_BAD_TYPE,
- "objc_read_type: cannot parse typespec: %s\n", type);
- return 0;
- }
- }
-}
-
-/*
-** Write the object specified by the template TYPE to STREAM. Last
-** arguments specify addresses of values to be written. It might
-** seem surprising to specify values by address, but this is extremely
-** convenient for copy-paste with objc_read_types calls. A more
-** down-to-the-earth cause for this passing of addresses is that values
-** of arbitrary size is not well supported in ANSI C for functions with
-** variable number of arguments.
-*/
-
-int
-objc_write_types (TypedStream* stream, const char* type, ...)
-{
- va_list args;
- const char *c;
- int res = 0;
-
- va_start(args, type);
-
- for (c = type; *c; c = objc_skip_typespec (c))
- {
- switch(*c) {
- case _C_ID:
- res = objc_write_object (stream, *va_arg (args, id*));
- break;
-
- case _C_CLASS:
- res = objc_write_class (stream, *va_arg(args, Class*));
- break;
-
- case _C_SEL:
- res = objc_write_selector (stream, *va_arg(args, SEL*));
- break;
-
- case _C_CHR:
- res = objc_write_char (stream, *va_arg (args, char*));
- break;
-
- case _C_UCHR:
- res = objc_write_unsigned_char (stream,
- *va_arg (args, unsigned char*));
- break;
-
- case _C_SHT:
- res = objc_write_short (stream, *va_arg(args, short*));
- break;
-
- case _C_USHT:
- res = objc_write_unsigned_short (stream,
- *va_arg(args, unsigned short*));
- break;
-
- case _C_INT:
- res = objc_write_int(stream, *va_arg(args, int*));
- break;
-
- case _C_UINT:
- res = objc_write_unsigned_int(stream, *va_arg(args, unsigned int*));
- break;
-
- case _C_LNG:
- res = objc_write_long(stream, *va_arg(args, long*));
- break;
-
- case _C_ULNG:
- res = objc_write_unsigned_long(stream, *va_arg(args, unsigned long*));
- break;
-
- case _C_CHARPTR:
- {
- char** str = va_arg(args, char**);
- res = objc_write_string (stream, *str, strlen(*str));
- }
- break;
-
- case _C_ATOM:
- {
- char** str = va_arg(args, char**);
- res = objc_write_string_atomic (stream, *str, strlen(*str));
- }
- break;
-
- case _C_ARY_B:
- {
- int len = atoi(c+1);
- const char* t = c;
- while (isdigit(*++t))
- ;
- res = objc_write_array (stream, t, len, va_arg(args, void*));
- t = objc_skip_typespec (t);
- if (*t != _C_ARY_E)
- objc_error(nil, OBJC_ERR_BAD_TYPE, "expected `]', got: %s", t);
- }
- break;
-
- default:
- objc_error(nil, OBJC_ERR_BAD_TYPE,
- "objc_write_types: cannot parse typespec: %s\n", type);
- }
- }
- va_end(args);
- return res;
-}
-
-
-/*
-** Last arguments specify addresses of values to be read. Expected
-** type is checked against the type actually present on the stream.
-*/
-
-int
-objc_read_types(TypedStream* stream, const char* type, ...)
-{
- va_list args;
- const char *c;
- int res = 0;
-
- va_start(args, type);
-
- for (c = type; *c; c = objc_skip_typespec(c))
- {
- switch(*c) {
- case _C_ID:
- res = objc_read_object(stream, va_arg(args, id*));
- break;
-
- case _C_CLASS:
- res = objc_read_class(stream, va_arg(args, Class*));
- break;
-
- case _C_SEL:
- res = objc_read_selector(stream, va_arg(args, SEL*));
- break;
-
- case _C_CHR:
- res = objc_read_char(stream, va_arg(args, char*));
- break;
-
- case _C_UCHR:
- res = objc_read_unsigned_char(stream, va_arg(args, unsigned char*));
- break;
-
- case _C_SHT:
- res = objc_read_short(stream, va_arg(args, short*));
- break;
-
- case _C_USHT:
- res = objc_read_unsigned_short(stream, va_arg(args, unsigned short*));
- break;
-
- case _C_INT:
- res = objc_read_int(stream, va_arg(args, int*));
- break;
-
- case _C_UINT:
- res = objc_read_unsigned_int(stream, va_arg(args, unsigned int*));
- break;
-
- case _C_LNG:
- res = objc_read_long(stream, va_arg(args, long*));
- break;
-
- case _C_ULNG:
- res = objc_read_unsigned_long(stream, va_arg(args, unsigned long*));
- break;
-
- case _C_CHARPTR:
- case _C_ATOM:
- {
- char** str = va_arg(args, char**);
- res = objc_read_string (stream, str);
- }
- break;
-
- case _C_ARY_B:
- {
- int len = atoi(c+1);
- const char* t = c;
- while (isdigit(*++t))
- ;
- res = objc_read_array (stream, t, len, va_arg(args, void*));
- t = objc_skip_typespec (t);
- if (*t != _C_ARY_E)
- objc_error(nil, OBJC_ERR_BAD_TYPE, "expected `]', got: %s", t);
- }
- break;
-
- default:
- objc_error(nil, OBJC_ERR_BAD_TYPE,
- "objc_read_types: cannot parse typespec: %s\n", type);
- }
- }
- va_end(args);
- return res;
-}
-
-/*
-** Write an array of COUNT elements of TYPE from the memory address DATA.
-** This is equivalent of objc_write_type (stream, "[N<type>]", data)
-*/
-
-int
-objc_write_array (TypedStream* stream, const char* type,
- int count, const void* data)
-{
- int off = objc_sizeof_type(type);
- const char* where = data;
-
- while (count-- > 0)
- {
- objc_write_type(stream, type, where);
- where += off;
- }
- return 1;
-}
-
-/*
-** Read an array of COUNT elements of TYPE into the memory address
-** DATA. The memory pointed to by data is supposed to be allocated
-** by the callee. This is equivalent of
-** objc_read_type (stream, "[N<type>]", data)
-*/
-
-int
-objc_read_array (TypedStream* stream, const char* type,
- int count, void* data)
-{
- int off = objc_sizeof_type(type);
- char* where = (char*)data;
-
- while (count-- > 0)
- {
- objc_read_type(stream, type, where);
- where += off;
- }
- return 1;
-}
-
-static int
-__objc_fread(FILE* file, char* data, int len)
-{
- return fread(data, len, 1, file);
-}
-
-static int
-__objc_fwrite(FILE* file, char* data, int len)
-{
- return fwrite(data, len, 1, file);
-}
-
-static int
-__objc_feof(FILE* file)
-{
- return feof(file);
-}
-
-static int
-__objc_no_write(FILE* file, char* data, int len)
-{
- objc_error (nil, OBJC_ERR_NO_WRITE, "TypedStream not open for writing");
- return 0;
-}
-
-static int
-__objc_no_read(FILE* file, char* data, int len)
-{
- objc_error (nil, OBJC_ERR_NO_READ, "TypedStream not open for reading");
- return 0;
-}
-
-static int
-__objc_read_typed_stream_signature (TypedStream* stream)
-{
- char buffer[80];
- int pos = 0;
- do
- (*stream->read)(stream->physical, buffer+pos, 1);
- while (buffer[pos++] != '\0')
- ;
- sscanf (buffer, "GNU TypedStream %d", &stream->version);
- if (stream->version != OBJC_TYPED_STREAM_VERSION)
- objc_error (nil, OBJC_ERR_STREAM_VERSION,
- "cannot handle TypedStream version %d", stream->version);
- return 1;
-}
-
-static int
-__objc_write_typed_stream_signature (TypedStream* stream)
-{
- char buffer[80];
- sprintf(buffer, "GNU TypedStream %d", OBJC_TYPED_STREAM_VERSION);
- stream->version = OBJC_TYPED_STREAM_VERSION;
- (*stream->write)(stream->physical, buffer, strlen(buffer)+1);
- return 1;
-}
-
-static void __objc_finish_write_root_object(struct objc_typed_stream* stream)
-{
- hash_delete (stream->object_table);
- stream->object_table = hash_new(64,
- (hash_func_type)hash_ptr,
- (compare_func_type)compare_ptrs);
-}
-
-static void __objc_finish_read_root_object(struct objc_typed_stream* stream)
-{
- node_ptr node;
- SEL awake_sel = sel_get_any_uid ("awake");
- cache_ptr free_list = hash_new (64,
- (hash_func_type) hash_ptr,
- (compare_func_type) compare_ptrs);
-
- /* resolve object forward references */
- for (node = hash_next (stream->object_refs, NULL); node;
- node = hash_next (stream->object_refs, node))
- {
- struct objc_list* reflist = node->value;
- const void* key = node->key;
- id object = hash_value_for_key (stream->object_table, key);
- while(reflist)
- {
- *((id*)reflist->head) = object;
- if (hash_value_for_key (free_list,reflist) == NULL)
- hash_add (&free_list,reflist,reflist);
-
- reflist = reflist->tail;
- }
- }
-
- /* apply __objc_free to all objects stored in free_list */
- for (node = hash_next (free_list, NULL); node;
- node = hash_next (free_list, node))
- objc_free ((void *) node->key);
-
- hash_delete (free_list);
-
- /* empty object reference table */
- hash_delete (stream->object_refs);
- stream->object_refs = hash_new(8, (hash_func_type)hash_ptr,
- (compare_func_type)compare_ptrs);
-
- /* call -awake for all objects read */
- if (awake_sel)
- {
- for (node = hash_next (stream->object_table, NULL); node;
- node = hash_next (stream->object_table, node))
- {
- id object = node->value;
- if (__objc_responds_to (object, awake_sel))
- (*objc_msg_lookup(object, awake_sel))(object, awake_sel);
- }
- }
-
- /* empty object table */
- hash_delete (stream->object_table);
- stream->object_table = hash_new(64,
- (hash_func_type)hash_ptr,
- (compare_func_type)compare_ptrs);
-}
-
-/*
-** Open the stream PHYSICAL in MODE
-*/
-
-TypedStream*
-objc_open_typed_stream (FILE* physical, int mode)
-{
- TypedStream* s = (TypedStream*)objc_malloc(sizeof(TypedStream));
-
- s->mode = mode;
- s->physical = physical;
- s->stream_table = hash_new(64,
- (hash_func_type)hash_ptr,
- (compare_func_type)compare_ptrs);
- s->object_table = hash_new(64,
- (hash_func_type)hash_ptr,
- (compare_func_type)compare_ptrs);
- s->eof = (objc_typed_eof_func)__objc_feof;
- s->flush = (objc_typed_flush_func)fflush;
- s->writing_root_p = 0;
- if (mode == OBJC_READONLY)
- {
- s->class_table = hash_new(8, (hash_func_type)hash_string,
- (compare_func_type)compare_strings);
- s->object_refs = hash_new(8, (hash_func_type)hash_ptr,
- (compare_func_type)compare_ptrs);
- s->read = (objc_typed_read_func)__objc_fread;
- s->write = (objc_typed_write_func)__objc_no_write;
- __objc_read_typed_stream_signature (s);
- }
- else if (mode == OBJC_WRITEONLY)
- {
- s->class_table = 0;
- s->object_refs = 0;
- s->read = (objc_typed_read_func)__objc_no_read;
- s->write = (objc_typed_write_func)__objc_fwrite;
- __objc_write_typed_stream_signature (s);
- }
- else
- {
- objc_close_typed_stream (s);
- return NULL;
- }
- s->type = OBJC_FILE_STREAM;
- return s;
-}
-
-/*
-** Open the file named by FILE_NAME in MODE
-*/
-
-TypedStream*
-objc_open_typed_stream_for_file (const char* file_name, int mode)
-{
- FILE* file = NULL;
- TypedStream* s;
-
- if (mode == OBJC_READONLY)
- file = fopen (file_name, "r");
- else
- file = fopen (file_name, "w");
-
- if (file)
- {
- s = objc_open_typed_stream (file, mode);
- if (s)
- s->type |= OBJC_MANAGED_STREAM;
- return s;
- }
- else
- return NULL;
-}
-
-/*
-** Close STREAM freeing the structure it self. If it was opened with
-** objc_open_typed_stream_for_file, the file will also be closed.
-*/
-
-void
-objc_close_typed_stream (TypedStream* stream)
-{
- if (stream->mode == OBJC_READONLY)
- {
- __objc_finish_read_root_object (stream); /* Just in case... */
- hash_delete (stream->class_table);
- hash_delete (stream->object_refs);
- }
-
- hash_delete (stream->stream_table);
- hash_delete (stream->object_table);
-
- if (stream->type == (OBJC_MANAGED_STREAM | OBJC_FILE_STREAM))
- fclose ((FILE*)stream->physical);
-
- objc_free(stream);
-}
-
-BOOL
-objc_end_of_typed_stream (TypedStream* stream)
-{
- return (*stream->eof)(stream->physical);
-}
-
-void
-objc_flush_typed_stream (TypedStream* stream)
-{
- (*stream->flush)(stream->physical);
-}
-
-long
-objc_get_stream_class_version (TypedStream* stream, Class class)
-{
- if (stream->class_table)
- return PTR2LONG(hash_value_for_key (stream->class_table, class->name));
- else
- return class_get_version (class);
-}
-
diff --git a/contrib/libobjc/class.c b/contrib/libobjc/class.c
deleted file mode 100644
index 44aa1b9f98eb..000000000000
--- a/contrib/libobjc/class.c
+++ /dev/null
@@ -1,358 +0,0 @@
-/* GNU Objective C Runtime class related functions
- Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
- Contributed by Kresten Krab Thorup and Dennis Glatting.
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
-details.
-
-You should have received a copy of the GNU General Public License along with
-GNU CC; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with files compiled with
- GCC 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 "runtime.h" /* the kitchen sink */
-#include "sarray.h"
-
-/* The table of classname->class. Used for objc_lookup_class and friends */
-static cache_ptr __objc_class_hash = 0; /* !T:MUTEX */
-
-/* This is a hook which is called by objc_get_class and
- objc_lookup_class if the runtime is not able to find the class.
- This may e.g. try to load in the class using dynamic loading */
-Class (*_objc_lookup_class)(const char* name) = 0; /* !T:SAFE */
-
-
-/* True when class links has been resolved */
-BOOL __objc_class_links_resolved = NO; /* !T:UNUSED */
-
-
-/* Initial number of buckets size of class hash table. */
-#define CLASS_HASH_SIZE 32
-
-void __objc_init_class_tables()
-{
- /* Allocate the class hash table */
-
- if(__objc_class_hash)
- return;
-
- objc_mutex_lock(__objc_runtime_mutex);
-
- __objc_class_hash
- = hash_new (CLASS_HASH_SIZE,
- (hash_func_type) hash_string,
- (compare_func_type) compare_strings);
-
- objc_mutex_unlock(__objc_runtime_mutex);
-}
-
-/* This function adds a class to the class hash table, and assigns the
- class a number, unless it's already known */
-void
-__objc_add_class_to_hash(Class class)
-{
- Class h_class;
-
- objc_mutex_lock(__objc_runtime_mutex);
-
- /* make sure the table is there */
- assert(__objc_class_hash);
-
- /* make sure it's not a meta class */
- assert(CLS_ISCLASS(class));
-
- /* Check to see if the class is already in the hash table. */
- h_class = hash_value_for_key (__objc_class_hash, class->name);
- if (!h_class)
- {
- /* The class isn't in the hash table. Add the class and assign a class
- number. */
- static unsigned int class_number = 1;
-
- CLS_SETNUMBER(class, class_number);
- CLS_SETNUMBER(class->class_pointer, class_number);
-
- ++class_number;
- hash_add (&__objc_class_hash, class->name, class);
- }
-
- objc_mutex_unlock(__objc_runtime_mutex);
-}
-
-/* Get the class object for the class named NAME. If NAME does not
- identify a known class, the hook _objc_lookup_class is called. If
- this fails, nil is returned */
-Class objc_lookup_class (const char* name)
-{
- Class class;
-
- objc_mutex_lock(__objc_runtime_mutex);
-
- /* Make sure the class hash table exists. */
- assert (__objc_class_hash);
-
- class = hash_value_for_key (__objc_class_hash, name);
-
- objc_mutex_unlock(__objc_runtime_mutex);
-
- if (class)
- return class;
-
- if (_objc_lookup_class)
- return (*_objc_lookup_class)(name);
- else
- return 0;
-}
-
-/* Get the class object for the class named NAME. If NAME does not
- identify a known class, the hook _objc_lookup_class is called. If
- this fails, an error message is issued and the system aborts */
-Class
-objc_get_class (const char *name)
-{
- Class class;
-
- objc_mutex_lock(__objc_runtime_mutex);
-
- /* Make sure the class hash table exists. */
- assert (__objc_class_hash);
-
- class = hash_value_for_key (__objc_class_hash, name);
-
- objc_mutex_unlock(__objc_runtime_mutex);
-
- if (class)
- return class;
-
- if (_objc_lookup_class)
- class = (*_objc_lookup_class)(name);
-
- if(class)
- return class;
-
- objc_error(nil, OBJC_ERR_BAD_CLASS,
- "objc runtime: cannot find class %s\n", name);
- return 0;
-}
-
-MetaClass
-objc_get_meta_class(const char *name)
-{
- return objc_get_class(name)->class_pointer;
-}
-
-/* This function provides a way to enumerate all the classes in the
- executable. Pass *ENUM_STATE == NULL to start the enumeration. The
- function will return 0 when there are no more classes.
- For example:
- id class;
- void *es = NULL;
- while ((class = objc_next_class(&es)))
- ... do something with class;
-*/
-Class
-objc_next_class(void **enum_state)
-{
- objc_mutex_lock(__objc_runtime_mutex);
-
- /* make sure the table is there */
- assert(__objc_class_hash);
-
- *(node_ptr*)enum_state =
- hash_next(__objc_class_hash, *(node_ptr*)enum_state);
-
- objc_mutex_unlock(__objc_runtime_mutex);
-
- if (*(node_ptr*)enum_state)
- return (*(node_ptr*)enum_state)->value;
- return (Class)0;
-}
-
-/* Resolve super/subclass links for all classes. The only thing we
- can be sure of is that the class_pointer for class objects point
- to the right meta class objects */
-void __objc_resolve_class_links()
-{
- node_ptr node;
- Class object_class = objc_get_class ("Object");
-
- assert(object_class);
-
- objc_mutex_lock(__objc_runtime_mutex);
-
- /* Assign subclass links */
- for (node = hash_next (__objc_class_hash, NULL); node;
- node = hash_next (__objc_class_hash, node))
- {
- Class class1 = node->value;
-
- /* Make sure we have what we think we have. */
- assert (CLS_ISCLASS(class1));
- assert (CLS_ISMETA(class1->class_pointer));
-
- /* The class_pointer of all meta classes point to Object's meta class. */
- class1->class_pointer->class_pointer = object_class->class_pointer;
-
- if (!(CLS_ISRESOLV(class1)))
- {
- CLS_SETRESOLV(class1);
- CLS_SETRESOLV(class1->class_pointer);
-
- if(class1->super_class)
- {
- Class a_super_class
- = objc_get_class ((char *) class1->super_class);
-
- assert (a_super_class);
-
- DEBUG_PRINTF ("making class connections for: %s\n",
- class1->name);
-
- /* assign subclass links for superclass */
- class1->sibling_class = a_super_class->subclass_list;
- a_super_class->subclass_list = class1;
-
- /* Assign subclass links for meta class of superclass */
- if (a_super_class->class_pointer)
- {
- class1->class_pointer->sibling_class
- = a_super_class->class_pointer->subclass_list;
- a_super_class->class_pointer->subclass_list
- = class1->class_pointer;
- }
- }
- else /* a root class, make its meta object */
- /* be a subclass of Object */
- {
- class1->class_pointer->sibling_class
- = object_class->subclass_list;
- object_class->subclass_list = class1->class_pointer;
- }
- }
- }
-
- /* Assign superclass links */
- for (node = hash_next (__objc_class_hash, NULL); node;
- node = hash_next (__objc_class_hash, node))
- {
- Class class1 = node->value;
- Class sub_class;
- for (sub_class = class1->subclass_list; sub_class;
- sub_class = sub_class->sibling_class)
- {
- sub_class->super_class = class1;
- if(CLS_ISCLASS(sub_class))
- sub_class->class_pointer->super_class = class1->class_pointer;
- }
- }
-
- objc_mutex_unlock(__objc_runtime_mutex);
-}
-
-
-
-#define CLASSOF(c) ((c)->class_pointer)
-
-Class
-class_pose_as (Class impostor, Class super_class)
-{
- node_ptr node;
- Class class1;
-
- if (!CLS_ISRESOLV (impostor))
- __objc_resolve_class_links ();
-
- /* preconditions */
- assert (impostor);
- assert (super_class);
- assert (impostor->super_class == super_class);
- assert (CLS_ISCLASS (impostor));
- assert (CLS_ISCLASS (super_class));
- assert (impostor->instance_size == super_class->instance_size);
-
- {
- Class *subclass = &(super_class->subclass_list);
-
- /* move subclasses of super_class to impostor */
- while (*subclass)
- {
- Class nextSub = (*subclass)->sibling_class;
-
- if (*subclass != impostor)
- {
- Class sub = *subclass;
-
- /* classes */
- sub->sibling_class = impostor->subclass_list;
- sub->super_class = impostor;
- impostor->subclass_list = sub;
-
- /* It will happen that SUB is not a class object if it is
- the top of the meta class hierarchy chain. (root
- meta-class objects inherit their class object) If that is
- the case... don't mess with the meta-meta class. */
- if (CLS_ISCLASS (sub))
- {
- /* meta classes */
- CLASSOF (sub)->sibling_class =
- CLASSOF (impostor)->subclass_list;
- CLASSOF (sub)->super_class = CLASSOF (impostor);
- CLASSOF (impostor)->subclass_list = CLASSOF (sub);
- }
- }
-
- *subclass = nextSub;
- }
-
- /* set subclasses of superclass to be impostor only */
- super_class->subclass_list = impostor;
- CLASSOF (super_class)->subclass_list = CLASSOF (impostor);
-
- /* set impostor to have no sibling classes */
- impostor->sibling_class = 0;
- CLASSOF (impostor)->sibling_class = 0;
- }
-
- /* check relationship of impostor and super_class is kept. */
- assert (impostor->super_class == super_class);
- assert (CLASSOF (impostor)->super_class == CLASSOF (super_class));
-
- /* This is how to update the lookup table. Regardless of
- what the keys of the hashtable is, change all values that are
- superclass into impostor. */
-
- objc_mutex_lock(__objc_runtime_mutex);
-
- for (node = hash_next (__objc_class_hash, NULL); node;
- node = hash_next (__objc_class_hash, node))
- {
- class1 = (Class)node->value;
- if (class1 == super_class)
- {
- node->value = impostor; /* change hash table value */
- }
- }
-
- objc_mutex_unlock(__objc_runtime_mutex);
-
- /* next, we update the dispatch tables... */
- __objc_update_dispatch_table_for_class (CLASSOF (impostor));
- __objc_update_dispatch_table_for_class (impostor);
-
- return impostor;
-}
-
-
diff --git a/contrib/libobjc/configure b/contrib/libobjc/configure
deleted file mode 100755
index 0469252015a2..000000000000
--- a/contrib/libobjc/configure
+++ /dev/null
@@ -1,1459 +0,0 @@
-#! /bin/sh
-
-# Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 2.13
-# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
-#
-# This configure script is free software; the Free Software Foundation
-# gives unlimited permission to copy, distribute and modify it.
-
-# Defaults:
-ac_help=
-ac_default_prefix=/usr/local
-# Any additions from configure.in:
-ac_help="$ac_help
- --enable-objc-gc enable the use of Boehm's garbage collector with
- the GNU Objective-C runtime."
-
-# Initialize some variables set by options.
-# The variables have the same names as the options, with
-# dashes changed to underlines.
-build=NONE
-cache_file=./config.cache
-exec_prefix=NONE
-host=NONE
-no_create=
-nonopt=NONE
-no_recursion=
-prefix=NONE
-program_prefix=NONE
-program_suffix=NONE
-program_transform_name=s,x,x,
-silent=
-site=
-srcdir=
-target=NONE
-verbose=
-x_includes=NONE
-x_libraries=NONE
-bindir='${exec_prefix}/bin'
-sbindir='${exec_prefix}/sbin'
-libexecdir='${exec_prefix}/libexec'
-datadir='${prefix}/share'
-sysconfdir='${prefix}/etc'
-sharedstatedir='${prefix}/com'
-localstatedir='${prefix}/var'
-libdir='${exec_prefix}/lib'
-includedir='${prefix}/include'
-oldincludedir='/usr/include'
-infodir='${prefix}/info'
-mandir='${prefix}/man'
-
-# Initialize some other variables.
-subdirs=
-MFLAGS= MAKEFLAGS=
-SHELL=${CONFIG_SHELL-/bin/sh}
-# Maximum number of lines to put in a shell here document.
-ac_max_here_lines=12
-
-ac_prev=
-for ac_option
-do
-
- # If the previous option needs an argument, assign it.
- if test -n "$ac_prev"; then
- eval "$ac_prev=\$ac_option"
- ac_prev=
- continue
- fi
-
- case "$ac_option" in
- -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
- *) ac_optarg= ;;
- esac
-
- # Accept the important Cygnus configure options, so we can diagnose typos.
-
- case "$ac_option" in
-
- -bindir | --bindir | --bindi | --bind | --bin | --bi)
- ac_prev=bindir ;;
- -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
- bindir="$ac_optarg" ;;
-
- -build | --build | --buil | --bui | --bu)
- ac_prev=build ;;
- -build=* | --build=* | --buil=* | --bui=* | --bu=*)
- build="$ac_optarg" ;;
-
- -cache-file | --cache-file | --cache-fil | --cache-fi \
- | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
- ac_prev=cache_file ;;
- -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
- | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
- cache_file="$ac_optarg" ;;
-
- -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
- ac_prev=datadir ;;
- -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
- | --da=*)
- datadir="$ac_optarg" ;;
-
- -disable-* | --disable-*)
- ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
- # Reject names that are not valid shell variable names.
- if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
- { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
- fi
- ac_feature=`echo $ac_feature| sed 's/-/_/g'`
- eval "enable_${ac_feature}=no" ;;
-
- -enable-* | --enable-*)
- ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
- # Reject names that are not valid shell variable names.
- if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
- { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
- fi
- ac_feature=`echo $ac_feature| sed 's/-/_/g'`
- case "$ac_option" in
- *=*) ;;
- *) ac_optarg=yes ;;
- esac
- eval "enable_${ac_feature}='$ac_optarg'" ;;
-
- -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
- | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
- | --exec | --exe | --ex)
- ac_prev=exec_prefix ;;
- -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
- | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
- | --exec=* | --exe=* | --ex=*)
- exec_prefix="$ac_optarg" ;;
-
- -gas | --gas | --ga | --g)
- # Obsolete; use --with-gas.
- with_gas=yes ;;
-
- -help | --help | --hel | --he)
- # Omit some internal or obsolete options to make the list less imposing.
- # This message is too long to be a string in the A/UX 3.1 sh.
- cat << EOF
-Usage: configure [options] [host]
-Options: [defaults in brackets after descriptions]
-Configuration:
- --cache-file=FILE cache test results in FILE
- --help print this message
- --no-create do not create output files
- --quiet, --silent do not print \`checking...' messages
- --version print the version of autoconf that created configure
-Directory and file names:
- --prefix=PREFIX install architecture-independent files in PREFIX
- [$ac_default_prefix]
- --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
- [same as prefix]
- --bindir=DIR user executables in DIR [EPREFIX/bin]
- --sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
- --libexecdir=DIR program executables in DIR [EPREFIX/libexec]
- --datadir=DIR read-only architecture-independent data in DIR
- [PREFIX/share]
- --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
- --sharedstatedir=DIR modifiable architecture-independent data in DIR
- [PREFIX/com]
- --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
- --libdir=DIR object code libraries in DIR [EPREFIX/lib]
- --includedir=DIR C header files in DIR [PREFIX/include]
- --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
- --infodir=DIR info documentation in DIR [PREFIX/info]
- --mandir=DIR man documentation in DIR [PREFIX/man]
- --srcdir=DIR find the sources in DIR [configure dir or ..]
- --program-prefix=PREFIX prepend PREFIX to installed program names
- --program-suffix=SUFFIX append SUFFIX to installed program names
- --program-transform-name=PROGRAM
- run sed PROGRAM on installed program names
-EOF
- cat << EOF
-Host type:
- --build=BUILD configure for building on BUILD [BUILD=HOST]
- --host=HOST configure for HOST [guessed]
- --target=TARGET configure for TARGET [TARGET=HOST]
-Features and packages:
- --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
- --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
- --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
- --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
- --x-includes=DIR X include files are in DIR
- --x-libraries=DIR X library files are in DIR
-EOF
- if test -n "$ac_help"; then
- echo "--enable and --with options recognized:$ac_help"
- fi
- exit 0 ;;
-
- -host | --host | --hos | --ho)
- ac_prev=host ;;
- -host=* | --host=* | --hos=* | --ho=*)
- host="$ac_optarg" ;;
-
- -includedir | --includedir | --includedi | --included | --include \
- | --includ | --inclu | --incl | --inc)
- ac_prev=includedir ;;
- -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
- | --includ=* | --inclu=* | --incl=* | --inc=*)
- includedir="$ac_optarg" ;;
-
- -infodir | --infodir | --infodi | --infod | --info | --inf)
- ac_prev=infodir ;;
- -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
- infodir="$ac_optarg" ;;
-
- -libdir | --libdir | --libdi | --libd)
- ac_prev=libdir ;;
- -libdir=* | --libdir=* | --libdi=* | --libd=*)
- libdir="$ac_optarg" ;;
-
- -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
- | --libexe | --libex | --libe)
- ac_prev=libexecdir ;;
- -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
- | --libexe=* | --libex=* | --libe=*)
- libexecdir="$ac_optarg" ;;
-
- -localstatedir | --localstatedir | --localstatedi | --localstated \
- | --localstate | --localstat | --localsta | --localst \
- | --locals | --local | --loca | --loc | --lo)
- ac_prev=localstatedir ;;
- -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
- | --localstate=* | --localstat=* | --localsta=* | --localst=* \
- | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
- localstatedir="$ac_optarg" ;;
-
- -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
- ac_prev=mandir ;;
- -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
- mandir="$ac_optarg" ;;
-
- -nfp | --nfp | --nf)
- # Obsolete; use --without-fp.
- with_fp=no ;;
-
- -no-create | --no-create | --no-creat | --no-crea | --no-cre \
- | --no-cr | --no-c)
- no_create=yes ;;
-
- -no-recursion | --no-recursion | --no-recursio | --no-recursi \
- | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
- no_recursion=yes ;;
-
- -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
- | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
- | --oldin | --oldi | --old | --ol | --o)
- ac_prev=oldincludedir ;;
- -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
- | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
- | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
- oldincludedir="$ac_optarg" ;;
-
- -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
- ac_prev=prefix ;;
- -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
- prefix="$ac_optarg" ;;
-
- -program-prefix | --program-prefix | --program-prefi | --program-pref \
- | --program-pre | --program-pr | --program-p)
- ac_prev=program_prefix ;;
- -program-prefix=* | --program-prefix=* | --program-prefi=* \
- | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
- program_prefix="$ac_optarg" ;;
-
- -program-suffix | --program-suffix | --program-suffi | --program-suff \
- | --program-suf | --program-su | --program-s)
- ac_prev=program_suffix ;;
- -program-suffix=* | --program-suffix=* | --program-suffi=* \
- | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
- program_suffix="$ac_optarg" ;;
-
- -program-transform-name | --program-transform-name \
- | --program-transform-nam | --program-transform-na \
- | --program-transform-n | --program-transform- \
- | --program-transform | --program-transfor \
- | --program-transfo | --program-transf \
- | --program-trans | --program-tran \
- | --progr-tra | --program-tr | --program-t)
- ac_prev=program_transform_name ;;
- -program-transform-name=* | --program-transform-name=* \
- | --program-transform-nam=* | --program-transform-na=* \
- | --program-transform-n=* | --program-transform-=* \
- | --program-transform=* | --program-transfor=* \
- | --program-transfo=* | --program-transf=* \
- | --program-trans=* | --program-tran=* \
- | --progr-tra=* | --program-tr=* | --program-t=*)
- program_transform_name="$ac_optarg" ;;
-
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil)
- silent=yes ;;
-
- -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
- ac_prev=sbindir ;;
- -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
- | --sbi=* | --sb=*)
- sbindir="$ac_optarg" ;;
-
- -sharedstatedir | --sharedstatedir | --sharedstatedi \
- | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
- | --sharedst | --shareds | --shared | --share | --shar \
- | --sha | --sh)
- ac_prev=sharedstatedir ;;
- -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
- | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
- | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
- | --sha=* | --sh=*)
- sharedstatedir="$ac_optarg" ;;
-
- -site | --site | --sit)
- ac_prev=site ;;
- -site=* | --site=* | --sit=*)
- site="$ac_optarg" ;;
-
- -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
- ac_prev=srcdir ;;
- -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
- srcdir="$ac_optarg" ;;
-
- -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
- | --syscon | --sysco | --sysc | --sys | --sy)
- ac_prev=sysconfdir ;;
- -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
- | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
- sysconfdir="$ac_optarg" ;;
-
- -target | --target | --targe | --targ | --tar | --ta | --t)
- ac_prev=target ;;
- -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
- target="$ac_optarg" ;;
-
- -v | -verbose | --verbose | --verbos | --verbo | --verb)
- verbose=yes ;;
-
- -version | --version | --versio | --versi | --vers)
- echo "configure generated by autoconf version 2.13"
- exit 0 ;;
-
- -with-* | --with-*)
- ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
- # Reject names that are not valid shell variable names.
- if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
- { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
- fi
- ac_package=`echo $ac_package| sed 's/-/_/g'`
- case "$ac_option" in
- *=*) ;;
- *) ac_optarg=yes ;;
- esac
- eval "with_${ac_package}='$ac_optarg'" ;;
-
- -without-* | --without-*)
- ac_package=`echo $ac_option|sed -e 's/-*without-//'`
- # Reject names that are not valid shell variable names.
- if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
- { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
- fi
- ac_package=`echo $ac_package| sed 's/-/_/g'`
- eval "with_${ac_package}=no" ;;
-
- --x)
- # Obsolete; use --with-x.
- with_x=yes ;;
-
- -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
- | --x-incl | --x-inc | --x-in | --x-i)
- ac_prev=x_includes ;;
- -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
- | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
- x_includes="$ac_optarg" ;;
-
- -x-libraries | --x-libraries | --x-librarie | --x-librari \
- | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
- ac_prev=x_libraries ;;
- -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
- | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
- x_libraries="$ac_optarg" ;;
-
- -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
- ;;
-
- *)
- if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
- echo "configure: warning: $ac_option: invalid host type" 1>&2
- fi
- if test "x$nonopt" != xNONE; then
- { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
- fi
- nonopt="$ac_option"
- ;;
-
- esac
-done
-
-if test -n "$ac_prev"; then
- { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
-fi
-
-trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
-
-# File descriptor usage:
-# 0 standard input
-# 1 file creation
-# 2 errors and warnings
-# 3 some systems may open it to /dev/tty
-# 4 used on the Kubota Titan
-# 6 checking for... messages and results
-# 5 compiler messages saved in config.log
-if test "$silent" = yes; then
- exec 6>/dev/null
-else
- exec 6>&1
-fi
-exec 5>./config.log
-
-echo "\
-This file contains any messages produced by compilers while
-running configure, to aid debugging if configure makes a mistake.
-" 1>&5
-
-# Strip out --no-create and --no-recursion so they do not pile up.
-# Also quote any args containing shell metacharacters.
-ac_configure_args=
-for ac_arg
-do
- case "$ac_arg" in
- -no-create | --no-create | --no-creat | --no-crea | --no-cre \
- | --no-cr | --no-c) ;;
- -no-recursion | --no-recursion | --no-recursio | --no-recursi \
- | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
- *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
- ac_configure_args="$ac_configure_args '$ac_arg'" ;;
- *) ac_configure_args="$ac_configure_args $ac_arg" ;;
- esac
-done
-
-# NLS nuisances.
-# Only set these to C if already set. These must not be set unconditionally
-# because not all systems understand e.g. LANG=C (notably SCO).
-# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
-# Non-C LC_CTYPE values break the ctype check.
-if test "${LANG+set}" = set; then LANG=C; export LANG; fi
-if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
-if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
-if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
-
-# confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -rf conftest* confdefs.h
-# AIX cpp loses on an empty file, so make sure it contains at least a newline.
-echo > confdefs.h
-
-# A filename unique to this package, relative to the directory that
-# configure is in, which we can look for to find out if srcdir is correct.
-ac_unique_file=objc/objc.h
-
-# Find the source files, if location was not specified.
-if test -z "$srcdir"; then
- ac_srcdir_defaulted=yes
- # Try the directory containing this script, then its parent.
- ac_prog=$0
- ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
- test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
- srcdir=$ac_confdir
- if test ! -r $srcdir/$ac_unique_file; then
- srcdir=..
- fi
-else
- ac_srcdir_defaulted=no
-fi
-if test ! -r $srcdir/$ac_unique_file; then
- if test "$ac_srcdir_defaulted" = yes; then
- { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
- else
- { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
- fi
-fi
-srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
-
-# Prefer explicitly selected file to automatically selected ones.
-if test -z "$CONFIG_SITE"; then
- if test "x$prefix" != xNONE; then
- CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
- else
- CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
- fi
-fi
-for ac_site_file in $CONFIG_SITE; do
- if test -r "$ac_site_file"; then
- echo "loading site script $ac_site_file"
- . "$ac_site_file"
- fi
-done
-
-if test -r "$cache_file"; then
- echo "loading cache $cache_file"
- . $cache_file
-else
- echo "creating cache $cache_file"
- > $cache_file
-fi
-
-ac_ext=c
-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
-
-ac_exeext=
-ac_objext=o
-if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
- # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
- if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
- ac_n= ac_c='
-' ac_t=' '
- else
- ac_n=-n ac_c= ac_t=
- fi
-else
- ac_n= ac_c='\c' ac_t=
-fi
-
-
-#AC_CONFIG_HEADER(config.h)
-
-if test "${srcdir}" = "." ; then
- if test "${with_target_subdir}" != "." ; then
- topsrcdir=${with_multisrctop}../..
- else
- topsrcdir=${with_multisrctop}..
- fi
-else
- topsrcdir=${srcdir}/..
-fi
-ac_aux_dir=
-for ac_dir in $topsrcdir $srcdir/$topsrcdir; do
- if test -f $ac_dir/install-sh; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install-sh -c"
- break
- elif test -f $ac_dir/install.sh; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install.sh -c"
- break
- fi
-done
-if test -z "$ac_aux_dir"; then
- { echo "configure: error: can not find install-sh or install.sh in $topsrcdir $srcdir/$topsrcdir" 1>&2; exit 1; }
-fi
-ac_config_guess=$ac_aux_dir/config.guess
-ac_config_sub=$ac_aux_dir/config.sub
-ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
-
-
-# If the language specific compiler does not exist, but the "gcc" directory
-# does, we do not build anything. Note, $r is set by the top-level Makefile.
-# Note that when we look for the compiler, we search both with and without
-# extension to handle cross and canadian cross builds.
-compiler_name=cc1obj
-rm -f skip-this-dir
-echo $ac_n "checking if compiler $compiler_name has been built""... $ac_c" 1>&6
-echo "configure:566: checking if compiler $compiler_name has been built" >&5
-if eval "test \"`echo '$''{'objc_cv_compiler_exists'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- objc_cv_compiler_exists=yes
-if test -n "$r"; then
- if test -d "$r"/gcc; then
- if test -f "$r"/gcc/$compiler_name \
- || test -f "$r"/gcc/$compiler_name.exe; then
- true
- else
- objc_cv_compiler_exists=no
- echo "rm -f config.cache config.log multilib.out" > skip-this-dir
- fi
- fi
-fi
-
-fi
-
-echo "$ac_t""$objc_cv_compiler_exists" 1>&6
-if test x$objc_cv_compiler_exists = xno
-then
- rm -f Makefile conftest* confdefs* core
- exit 0
-fi
-
-# For ObjC we'll set CC to point at the built gcc, but this will get it into
-# the makefiles
-# Extract the first word of "gcc", so it can be a program name with args.
-set dummy gcc; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:597: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_prog_CC="gcc"
- break
- fi
- done
- IFS="$ac_save_ifs"
-fi
-fi
-CC="$ac_cv_prog_CC"
-if test -n "$CC"; then
- echo "$ac_t""$CC" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-if test -z "$CC"; then
- # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:627: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_prog_rejected=no
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
- ac_prog_rejected=yes
- continue
- fi
- ac_cv_prog_CC="cc"
- break
- fi
- done
- IFS="$ac_save_ifs"
-if test $ac_prog_rejected = yes; then
- # We found a bogon in the path, so make sure we never use it.
- set dummy $ac_cv_prog_CC
- shift
- if test $# -gt 0; then
- # We chose a different compiler from the bogus one.
- # However, it has the same basename, so the bogon will be chosen
- # first if we set CC to just the basename; use the full file name.
- shift
- set dummy "$ac_dir/$ac_word" "$@"
- shift
- ac_cv_prog_CC="$@"
- fi
-fi
-fi
-fi
-CC="$ac_cv_prog_CC"
-if test -n "$CC"; then
- echo "$ac_t""$CC" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
- if test -z "$CC"; then
- case "`uname -s`" in
- *win32* | *WIN32*)
- # Extract the first word of "cl", so it can be a program name with args.
-set dummy cl; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:678: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_prog_CC="cl"
- break
- fi
- done
- IFS="$ac_save_ifs"
-fi
-fi
-CC="$ac_cv_prog_CC"
-if test -n "$CC"; then
- echo "$ac_t""$CC" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
- ;;
- esac
- fi
- test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
-fi
-
-echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:710: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
-
-ac_ext=c
-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
-
-cat > conftest.$ac_ext << EOF
-
-#line 721 "configure"
-#include "confdefs.h"
-
-main(){return(0);}
-EOF
-if { (eval echo configure:726: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- ac_cv_prog_cc_works=yes
- # If we can't run a trivial program, we are probably using a cross compiler.
- if (./conftest; exit) 2>/dev/null; then
- ac_cv_prog_cc_cross=no
- else
- ac_cv_prog_cc_cross=yes
- fi
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- ac_cv_prog_cc_works=no
-fi
-rm -fr conftest*
-ac_ext=c
-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
-
-echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
-if test $ac_cv_prog_cc_works = no; then
- { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
-fi
-echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:752: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
-echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
-cross_compiling=$ac_cv_prog_cc_cross
-
-echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:757: checking whether we are using GNU C" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.c <<EOF
-#ifdef __GNUC__
- yes;
-#endif
-EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:766: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
- ac_cv_prog_gcc=yes
-else
- ac_cv_prog_gcc=no
-fi
-fi
-
-echo "$ac_t""$ac_cv_prog_gcc" 1>&6
-
-if test $ac_cv_prog_gcc = yes; then
- GCC=yes
-else
- GCC=
-fi
-
-ac_test_CFLAGS="${CFLAGS+set}"
-ac_save_CFLAGS="$CFLAGS"
-CFLAGS=
-echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:785: checking whether ${CC-cc} accepts -g" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- echo 'void f(){}' > conftest.c
-if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
- ac_cv_prog_cc_g=yes
-else
- ac_cv_prog_cc_g=no
-fi
-rm -f conftest*
-
-fi
-
-echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
-if test "$ac_test_CFLAGS" = set; then
- CFLAGS="$ac_save_CFLAGS"
-elif test $ac_cv_prog_cc_g = yes; then
- if test "$GCC" = yes; then
- CFLAGS="-g -O2"
- else
- CFLAGS="-g"
- fi
-else
- if test "$GCC" = yes; then
- CFLAGS="-O2"
- else
- CFLAGS=
- fi
-fi
-
-
-test "$AR" || AR=ar
-
-if test "$RANLIB"; then :
-
-else
- # Extract the first word of "ranlib", so it can be a program name with args.
-set dummy ranlib; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:825: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- if test -n "$RANLIB"; then
- ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
-else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_prog_RANLIB="ranlib"
- break
- fi
- done
- IFS="$ac_save_ifs"
- test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
-fi
-fi
-RANLIB="$ac_cv_prog_RANLIB"
-if test -n "$RANLIB"; then
- echo "$ac_t""$RANLIB" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-fi
-# Find a good install program. We prefer a C program (faster),
-# so one script is as good as another. But avoid the broken or
-# incompatible versions:
-# SysV /etc/install, /usr/sbin/install
-# SunOS /usr/etc/install
-# IRIX /sbin/install
-# AIX /bin/install
-# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
-# AFS /usr/afsws/bin/install, which mishandles nonexistent args
-# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
-# ./install, which can be erroneously created by make from ./install.sh.
-echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:865: checking for a BSD compatible install" >&5
-if test -z "$INSTALL"; then
-if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":"
- for ac_dir in $PATH; do
- # Account for people who put trailing slashes in PATH elements.
- case "$ac_dir/" in
- /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
- *)
- # OSF1 and SCO ODT 3.0 have their own names for install.
- # Don't use installbsd from OSF since it installs stuff as root
- # by default.
- for ac_prog in ginstall scoinst install; do
- if test -f $ac_dir/$ac_prog; then
- if test $ac_prog = install &&
- grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
- # AIX install. It has an incompatible calling convention.
- :
- else
- ac_cv_path_install="$ac_dir/$ac_prog -c"
- break 2
- fi
- fi
- done
- ;;
- esac
- done
- IFS="$ac_save_IFS"
-
-fi
- if test "${ac_cv_path_install+set}" = set; then
- INSTALL="$ac_cv_path_install"
- else
- # As a last resort, use the slow shell script. We don't cache a
- # path for INSTALL within a source directory, because that will
- # break other packages using the cache if that directory is
- # removed, or if the path is relative.
- INSTALL="$ac_install_sh"
- fi
-fi
-echo "$ac_t""$INSTALL" 1>&6
-
-# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
-# It thinks the first close brace ends the variable substitution.
-test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
-
-test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
-
-test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-
-
-
-# Sanity check for the cross-compilation case:
-echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:921: checking how to run the C preprocessor" >&5
-# On Suns, sometimes $CPP names a directory.
-if test -n "$CPP" && test -d "$CPP"; then
- CPP=
-fi
-if test -z "$CPP"; then
-if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- # This must be in double quotes, not single quotes, because CPP may get
- # substituted into the Makefile and "${CC-cc}" will confuse make.
- CPP="${CC-cc} -E"
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp.
- cat > conftest.$ac_ext <<EOF
-#line 936 "configure"
-#include "confdefs.h"
-#include <assert.h>
-Syntax Error
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:942: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- :
-else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- CPP="${CC-cc} -E -traditional-cpp"
- cat > conftest.$ac_ext <<EOF
-#line 953 "configure"
-#include "confdefs.h"
-#include <assert.h>
-Syntax Error
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:959: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- :
-else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- CPP="${CC-cc} -nologo -E"
- cat > conftest.$ac_ext <<EOF
-#line 970 "configure"
-#include "confdefs.h"
-#include <assert.h>
-Syntax Error
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:976: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- :
-else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- CPP=/lib/cpp
-fi
-rm -f conftest*
-fi
-rm -f conftest*
-fi
-rm -f conftest*
- ac_cv_prog_CPP="$CPP"
-fi
- CPP="$ac_cv_prog_CPP"
-else
- ac_cv_prog_CPP="$CPP"
-fi
-echo "$ac_t""$CPP" 1>&6
-
-ac_safe=`echo "stdio.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for stdio.h""... $ac_c" 1>&6
-echo "configure:1002: checking for stdio.h" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1007 "configure"
-#include "confdefs.h"
-#include <stdio.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1012: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=yes"
-else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- :
-else
- echo "$ac_t""no" 1>&6
-{ echo "configure: error: Can't find stdio.h.
-You must have a usable C system for the target already installed, at least
-including headers and, preferably, the library, before you can configure
-the Objective C runtime system. If necessary, install gcc now with
-\`LANGUAGES=c', then the target library, then build with \`LANGUAGES=objc'." 1>&2; exit 1; }
-fi
-
-
-echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:1040: checking for ANSI C header files" >&5
-if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1045 "configure"
-#include "confdefs.h"
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1053: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- rm -rf conftest*
- ac_cv_header_stdc=yes
-else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-if test $ac_cv_header_stdc = yes; then
- # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
-cat > conftest.$ac_ext <<EOF
-#line 1070 "configure"
-#include "confdefs.h"
-#include <string.h>
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "memchr" >/dev/null 2>&1; then
- :
-else
- rm -rf conftest*
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
-cat > conftest.$ac_ext <<EOF
-#line 1088 "configure"
-#include "confdefs.h"
-#include <stdlib.h>
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "free" >/dev/null 2>&1; then
- :
-else
- rm -rf conftest*
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
-if test "$cross_compiling" = yes; then
- :
-else
- cat > conftest.$ac_ext <<EOF
-#line 1109 "configure"
-#include "confdefs.h"
-#include <ctype.h>
-#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int main () { int i; for (i = 0; i < 256; i++)
-if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
-exit (0); }
-
-EOF
-if { (eval echo configure:1120: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
- :
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -fr conftest*
- ac_cv_header_stdc=no
-fi
-rm -fr conftest*
-fi
-
-fi
-fi
-
-echo "$ac_t""$ac_cv_header_stdc" 1>&6
-if test $ac_cv_header_stdc = yes; then
- cat >> confdefs.h <<\EOF
-#define STDC_HEADERS 1
-EOF
-
-fi
-
-
-# Determine the name of the GCC thread file.
-
-echo $ac_n "checking for thread file""... $ac_c" 1>&6
-echo "configure:1147: checking for thread file" >&5
-if eval "test \"`echo '$''{'objc_cv_thread_file'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- if test -f "$r"/gcc/Makefile
-then
- objc_cv_thread_file=`grep \^GCC_THREAD_FILE "$r"/gcc/Makefile | awk -F= '{ print $2 }'`
-else
- { echo "configure: error: not found" 1>&2; exit 1; }
-fi
-fi
-
-echo "$ac_t""$objc_cv_thread_file" 1>&6
-OBJC_THREAD_FILE=$objc_cv_thread_file
-
-
-# Check whether --enable-objc-gc or --disable-objc-gc was given.
-if test "${enable_objc_gc+set}" = set; then
- enableval="$enable_objc_gc"
- if [ x$enable_objc_gc = xno ]; then
- OBJC_BOEHM_GC=''
-else
- OBJC_BOEHM_GC=libobjc_gc.a
-fi
-else
- OBJC_BOEHM_GC=''
-fi
-
-
-
-
-# We need multilib support, but only if configuring for the target.
-trap '' 1 2 15
-cat > confcache <<\EOF
-# This file is a shell script that caches the results of configure
-# tests run on this system so they can be shared between configure
-# scripts and configure runs. It is not useful on other systems.
-# If it contains results you don't want to keep, you may remove or edit it.
-#
-# By default, configure uses ./config.cache as the cache file,
-# creating it if it does not exist already. You can give configure
-# the --cache-file=FILE option to use a different cache file; that is
-# what configure does when it calls configure scripts in
-# subdirectories, so they share the cache.
-# Giving --cache-file=/dev/null disables caching, for debugging configure.
-# config.status only pays attention to the cache file if you give it the
-# --recheck option to rerun configure.
-#
-EOF
-# The following way of writing the cache mishandles newlines in values,
-# but we know of no workaround that is simple, portable, and efficient.
-# So, don't put newlines in cache variables' values.
-# Ultrix sh set writes to stderr and can't be redirected directly,
-# and sets the high bit in the cache file unless we assign to the vars.
-(set) 2>&1 |
- case `(ac_space=' '; set | grep ac_space) 2>&1` in
- *ac_space=\ *)
- # `set' does not quote correctly, so add quotes (double-quote substitution
- # turns \\\\ into \\, and sed turns \\ into \).
- sed -n \
- -e "s/'/'\\\\''/g" \
- -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
- ;;
- *)
- # `set' quotes correctly as required by POSIX, so do not add quotes.
- sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
- ;;
- esac >> confcache
-if cmp -s $cache_file confcache; then
- :
-else
- if test -w $cache_file; then
- echo "updating cache $cache_file"
- cat confcache > $cache_file
- else
- echo "not updating unwritable cache $cache_file"
- fi
-fi
-rm -f confcache
-
-trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
-
-test "x$prefix" = xNONE && prefix=$ac_default_prefix
-# Let make expand exec_prefix.
-test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-
-# Any assignment to VPATH causes Sun make to only execute
-# the first set of double-colon rules, so remove it if not needed.
-# If there is a colon in the path, we need to keep it.
-if test "x$srcdir" = x.; then
- ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
-fi
-
-trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
-
-# Transform confdefs.h into DEFS.
-# Protect against shell expansion while executing Makefile rules.
-# Protect against Makefile macro expansion.
-cat > conftest.defs <<\EOF
-s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g
-s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g
-s%\[%\\&%g
-s%\]%\\&%g
-s%\$%$$%g
-EOF
-DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
-rm -f conftest.defs
-
-
-# Without the "./", some shells look in PATH for config.status.
-: ${CONFIG_STATUS=./config.status}
-
-echo creating $CONFIG_STATUS
-rm -f $CONFIG_STATUS
-cat > $CONFIG_STATUS <<EOF
-#! /bin/sh
-# Generated automatically by configure.
-# Run this file to recreate the current configuration.
-# This directory was configured as follows,
-# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-#
-# $0 $ac_configure_args
-#
-# Compiler output produced by configure, useful for debugging
-# configure, is in ./config.log if it exists.
-
-ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
-for ac_option
-do
- case "\$ac_option" in
- -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
- echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
- exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
- -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
- echo "$CONFIG_STATUS generated by autoconf version 2.13"
- exit 0 ;;
- -help | --help | --hel | --he | --h)
- echo "\$ac_cs_usage"; exit 0 ;;
- *) echo "\$ac_cs_usage"; exit 1 ;;
- esac
-done
-
-ac_given_srcdir=$srcdir
-ac_given_INSTALL="$INSTALL"
-
-trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
-EOF
-cat >> $CONFIG_STATUS <<EOF
-
-# Protect against being on the right side of a sed subst in config.status.
-sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
- s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
-$ac_vpsub
-$extrasub
-s%@SHELL@%$SHELL%g
-s%@CFLAGS@%$CFLAGS%g
-s%@CPPFLAGS@%$CPPFLAGS%g
-s%@CXXFLAGS@%$CXXFLAGS%g
-s%@FFLAGS@%$FFLAGS%g
-s%@DEFS@%$DEFS%g
-s%@LDFLAGS@%$LDFLAGS%g
-s%@LIBS@%$LIBS%g
-s%@exec_prefix@%$exec_prefix%g
-s%@prefix@%$prefix%g
-s%@program_transform_name@%$program_transform_name%g
-s%@bindir@%$bindir%g
-s%@sbindir@%$sbindir%g
-s%@libexecdir@%$libexecdir%g
-s%@datadir@%$datadir%g
-s%@sysconfdir@%$sysconfdir%g
-s%@sharedstatedir@%$sharedstatedir%g
-s%@localstatedir@%$localstatedir%g
-s%@libdir@%$libdir%g
-s%@includedir@%$includedir%g
-s%@oldincludedir@%$oldincludedir%g
-s%@infodir@%$infodir%g
-s%@mandir@%$mandir%g
-s%@CC@%$CC%g
-s%@AR@%$AR%g
-s%@RANLIB@%$RANLIB%g
-s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
-s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
-s%@INSTALL_DATA@%$INSTALL_DATA%g
-s%@CPP@%$CPP%g
-s%@OBJC_THREAD_FILE@%$OBJC_THREAD_FILE%g
-s%@OBJC_BOEHM_GC@%$OBJC_BOEHM_GC%g
-
-CEOF
-EOF
-
-cat >> $CONFIG_STATUS <<\EOF
-
-# Split the substitutions into bite-sized pieces for seds with
-# small command number limits, like on Digital OSF/1 and HP-UX.
-ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
-ac_file=1 # Number of current file.
-ac_beg=1 # First line for current file.
-ac_end=$ac_max_sed_cmds # Line after last line for current file.
-ac_more_lines=:
-ac_sed_cmds=""
-while $ac_more_lines; do
- if test $ac_beg -gt 1; then
- sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
- else
- sed "${ac_end}q" conftest.subs > conftest.s$ac_file
- fi
- if test ! -s conftest.s$ac_file; then
- ac_more_lines=false
- rm -f conftest.s$ac_file
- else
- if test -z "$ac_sed_cmds"; then
- ac_sed_cmds="sed -f conftest.s$ac_file"
- else
- ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
- fi
- ac_file=`expr $ac_file + 1`
- ac_beg=$ac_end
- ac_end=`expr $ac_end + $ac_max_sed_cmds`
- fi
-done
-if test -z "$ac_sed_cmds"; then
- ac_sed_cmds=cat
-fi
-EOF
-
-cat >> $CONFIG_STATUS <<EOF
-
-CONFIG_FILES=\${CONFIG_FILES-"Makefile"}
-EOF
-cat >> $CONFIG_STATUS <<\EOF
-for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
- # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
- case "$ac_file" in
- *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
- ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
- *) ac_file_in="${ac_file}.in" ;;
- esac
-
- # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
-
- # Remove last slash and all that follows it. Not all systems have dirname.
- ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
- if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
- # The file is in a subdirectory.
- test ! -d "$ac_dir" && mkdir "$ac_dir"
- ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
- # A "../" for each directory in $ac_dir_suffix.
- ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
- else
- ac_dir_suffix= ac_dots=
- fi
-
- case "$ac_given_srcdir" in
- .) srcdir=.
- if test -z "$ac_dots"; then top_srcdir=.
- else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
- /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
- *) # Relative path.
- srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
- top_srcdir="$ac_dots$ac_given_srcdir" ;;
- esac
-
- case "$ac_given_INSTALL" in
- [/$]*) INSTALL="$ac_given_INSTALL" ;;
- *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
- esac
-
- echo creating "$ac_file"
- rm -f "$ac_file"
- configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
- case "$ac_file" in
- *Makefile*) ac_comsub="1i\\
-# $configure_input" ;;
- *) ac_comsub= ;;
- esac
-
- ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
- sed -e "$ac_comsub
-s%@configure_input@%$configure_input%g
-s%@srcdir@%$srcdir%g
-s%@top_srcdir@%$top_srcdir%g
-s%@INSTALL@%$INSTALL%g
-" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
-fi; done
-rm -f conftest.s*
-
-EOF
-cat >> $CONFIG_STATUS <<EOF
-srcdir=${srcdir}
-host=${host}
-target=${target}
-with_target_subdir=${with_target_subdir}
-with_multisubdir=${with_multisubdir}
-ac_configure_args="--enable-multilib ${ac_configure_args}"
-CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-topsrcdir=${topsrcdir}
-
-EOF
-cat >> $CONFIG_STATUS <<\EOF
-test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h
-if test -n "$CONFIG_FILES"; then
- if test -n "${with_target_subdir}"; then
- # FIXME: We shouldn't need to set ac_file
- ac_file=Makefile
- . ${topsrcdir}/config-ml.in
- fi
-fi
-exit 0
-EOF
-chmod +x $CONFIG_STATUS
-rm -fr confdefs* $ac_clean_files
-test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
-
-
diff --git a/contrib/libobjc/configure.in b/contrib/libobjc/configure.in
deleted file mode 100644
index 821dcd2a9dec..000000000000
--- a/contrib/libobjc/configure.in
+++ /dev/null
@@ -1,142 +0,0 @@
-# Process this file with autoconf to produce a configure script.
-# Copyright (C) 1995, 1997, 1998, 1999 Free Software Foundation, Inc.
-# Contributed by Dave Love (d.love@dl.ac.uk).
-#
-#This file is part of GNU Objective C.
-#
-#GNU Objective C 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.
-#
-#GNU Objective C is distributed in the hope that it will be useful,
-#but WITHOUT ANY WARRANTY; without even the implied warranty of
-#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-#GNU General Public License for more details.
-#
-#You should have received a copy of the GNU General Public License
-#along with GNU Objective C; see the file COPYING. If not, write to
-#the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-#02111-1307, USA.
-
-AC_PREREQ(2.13)
-AC_INIT(objc/objc.h)
-#AC_CONFIG_HEADER(config.h)
-
-if test "${srcdir}" = "." ; then
- if test "${with_target_subdir}" != "." ; then
- topsrcdir=${with_multisrctop}../..
- else
- topsrcdir=${with_multisrctop}..
- fi
-else
- topsrcdir=${srcdir}/..
-fi
-dnl This is needed for a multilibbed build in the source tree so
-dnl that install-sh and config.sub get found.
-AC_CONFIG_AUX_DIR($topsrcdir)
-
-# If the language specific compiler does not exist, but the "gcc" directory
-# does, we do not build anything. Note, $r is set by the top-level Makefile.
-# Note that when we look for the compiler, we search both with and without
-# extension to handle cross and canadian cross builds.
-compiler_name=cc1obj
-rm -f skip-this-dir
-AC_MSG_CHECKING(if compiler $compiler_name has been built)
-AC_CACHE_VAL(objc_cv_compiler_exists,
-[objc_cv_compiler_exists=yes
-if test -n "$r"; then
- if test -d "$r"/gcc; then
- if test -f "$r"/gcc/$compiler_name \
- || test -f "$r"/gcc/$compiler_name.exe; then
- true
- else
- objc_cv_compiler_exists=no
- echo "rm -f config.cache config.log multilib.out" > skip-this-dir
- fi
- fi
-fi
-])
-AC_MSG_RESULT($objc_cv_compiler_exists)
-if test x$objc_cv_compiler_exists = xno
-then
- rm -f Makefile conftest* confdefs* core
- exit 0
-fi
-
-dnl Checks for programs.
-# For ObjC we'll set CC to point at the built gcc, but this will get it into
-# the makefiles
-AC_PROG_CC
-
-test "$AR" || AR=ar
-AC_SUBST(AR)
-if test "$RANLIB"; then :
- AC_SUBST(RANLIB)
-else
- AC_PROG_RANLIB
-fi
-AC_PROG_INSTALL
-
-dnl Checks for libraries.
-
-dnl Checks for header files.
-# Sanity check for the cross-compilation case:
-AC_CHECK_HEADER(stdio.h,:,
- [AC_MSG_ERROR([Can't find stdio.h.
-You must have a usable C system for the target already installed, at least
-including headers and, preferably, the library, before you can configure
-the Objective C runtime system. If necessary, install gcc now with
-\`LANGUAGES=c', then the target library, then build with \`LANGUAGES=objc'.])])
-
-AC_HEADER_STDC
-
-# Determine the name of the GCC thread file.
-
-AC_CACHE_CHECK([for thread file],objc_cv_thread_file,
-[if test -f "$r"/gcc/Makefile
-then
- objc_cv_thread_file=`grep \^GCC_THREAD_FILE "$r"/gcc/Makefile | awk -F= '{ print $2 }'`
-else
- AC_MSG_ERROR([not found])
-fi])
-OBJC_THREAD_FILE=$objc_cv_thread_file
-AC_SUBST(OBJC_THREAD_FILE)
-
-AC_ARG_ENABLE(objc-gc,
-[ --enable-objc-gc enable the use of Boehm's garbage collector with
- the GNU Objective-C runtime.],
-if [[[ x$enable_objc_gc = xno ]]]; then
- OBJC_BOEHM_GC=''
-else
- OBJC_BOEHM_GC=libobjc_gc.a
-fi,
-OBJC_BOEHM_GC='')
-AC_SUBST(OBJC_BOEHM_GC)
-
-
-# We need multilib support, but only if configuring for the target.
-AC_OUTPUT(Makefile,
-[test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h
-if test -n "$CONFIG_FILES"; then
- if test -n "${with_target_subdir}"; then
- # FIXME: We shouldn't need to set ac_file
- ac_file=Makefile
- . ${topsrcdir}/config-ml.in
- fi
-fi],
-srcdir=${srcdir}
-host=${host}
-target=${target}
-with_target_subdir=${with_target_subdir}
-with_multisubdir=${with_multisubdir}
-ac_configure_args="--enable-multilib ${ac_configure_args}"
-CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-topsrcdir=${topsrcdir}
-)
-
-dnl Local Variables:
-dnl comment-start: "dnl "
-dnl comment-end: ""
-dnl comment-start-skip: "\\bdnl\\b\\s *"
-dnl End:
diff --git a/contrib/libobjc/encoding.c b/contrib/libobjc/encoding.c
deleted file mode 100644
index 4749ba026e97..000000000000
--- a/contrib/libobjc/encoding.c
+++ /dev/null
@@ -1,918 +0,0 @@
-/* Encoding of types for Objective C.
- Copyright (C) 1993, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
- Contributed by Kresten Krab Thorup
- Bitfield support by Ovidiu Predescu
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with files
- compiled with GCC 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 "tconfig.h"
-#include "objc-api.h"
-#include "encoding.h"
-
-#define MAX(X, Y) \
- ({ typeof(X) __x = (X), __y = (Y); \
- (__x > __y ? __x : __y); })
-
-#define MIN(X, Y) \
- ({ typeof(X) __x = (X), __y = (Y); \
- (__x < __y ? __x : __y); })
-
-#define ROUND(V, A) \
- ({ typeof(V) __v=(V); typeof(A) __a=(A); \
- __a*((__v+__a-1)/__a); })
-
-
-/* Various hacks for objc_layout_record. These are used by the target
- macros. */
-
-#define TREE_CODE(TYPE) *TYPE
-#define TREE_TYPE(TREE) TREE
-
-#define RECORD_TYPE _C_STRUCT_B
-#define UNION_TYPE _C_UNION_B
-#define QUAL_UNION_TYPE _C_UNION_B
-#define ARRAY_TYPE _C_ARY_B
-
-#define TYPE_FIELDS(TYPE) objc_skip_typespec (TYPE)
-
-#define DECL_MODE(TYPE) *(TYPE)
-
-#define DFmode _C_DBL
-
-#define get_inner_array_type(TYPE) ((TYPE) + 1)
-
-
-static inline int
-atoi (const char* str)
-{
- int res = 0;
-
- while (isdigit (*str))
- res *= 10, res += (*str++ - '0');
-
- return res;
-}
-
-/*
- return the size of an object specified by type
-*/
-
-int
-objc_sizeof_type (const char* type)
-{
- /* Skip the variable name if any */
- if (*type == '"')
- {
- for (type++; *type++ != '"';)
- /* do nothing */;
- }
-
- switch(*type) {
- case _C_ID:
- return sizeof(id);
- break;
-
- case _C_CLASS:
- return sizeof(Class);
- break;
-
- case _C_SEL:
- return sizeof(SEL);
- break;
-
- case _C_CHR:
- return sizeof(char);
- break;
-
- case _C_UCHR:
- return sizeof(unsigned char);
- break;
-
- case _C_SHT:
- return sizeof(short);
- break;
-
- case _C_USHT:
- return sizeof(unsigned short);
- break;
-
- case _C_INT:
- return sizeof(int);
- break;
-
- case _C_UINT:
- return sizeof(unsigned int);
- break;
-
- case _C_LNG:
- return sizeof(long);
- break;
-
- case _C_ULNG:
- return sizeof(unsigned long);
- break;
-
- case _C_LNG_LNG:
- return sizeof(long long);
- break;
-
- case _C_ULNG_LNG:
- return sizeof(unsigned long long);
- break;
-
- case _C_FLT:
- return sizeof(float);
- break;
-
- case _C_DBL:
- return sizeof(double);
- break;
-
- case _C_VOID:
- return sizeof(void);
- break;
- case _C_PTR:
- case _C_ATOM:
- case _C_CHARPTR:
- return sizeof(char*);
- break;
-
- case _C_ARY_B:
- {
- int len = atoi(type+1);
- while (isdigit(*++type));
- return len*objc_aligned_size (type);
- }
- break;
-
- case _C_BFLD:
- {
- /* The new encoding of bitfields is: b 'position' 'type' 'size' */
- int position, size;
- int startByte, endByte;
-
- position = atoi (type + 1);
- while (isdigit (*++type));
- size = atoi (type + 1);
-
- startByte = position / BITS_PER_UNIT;
- endByte = (position + size) / BITS_PER_UNIT;
- return endByte - startByte;
- }
-
- case _C_STRUCT_B:
- {
- struct objc_struct_layout layout;
- unsigned int size;
-
- objc_layout_structure (type, &layout);
- while (objc_layout_structure_next_member (&layout))
- /* do nothing */ ;
- objc_layout_finish_structure (&layout, &size, NULL);
-
- return size;
- }
-
- case _C_UNION_B:
- {
- int max_size = 0;
- while (*type != _C_UNION_E && *type++ != '=') /* do nothing */;
- while (*type != _C_UNION_E)
- {
- /* Skip the variable name if any */
- if (*type == '"')
- {
- for (type++; *type++ != '"';)
- /* do nothing */;
- }
- max_size = MAX (max_size, objc_sizeof_type (type));
- type = objc_skip_typespec (type);
- }
- return max_size;
- }
-
- default:
- {
- objc_error(nil, OBJC_ERR_BAD_TYPE, "unknown type %s\n", type);
- return 0;
- }
- }
-}
-
-
-/*
- Return the alignment of an object specified by type
-*/
-
-int
-objc_alignof_type(const char* type)
-{
- /* Skip the variable name if any */
- if (*type == '"')
- {
- for (type++; *type++ != '"';)
- /* do nothing */;
- }
- switch(*type) {
- case _C_ID:
- return __alignof__(id);
- break;
-
- case _C_CLASS:
- return __alignof__(Class);
- break;
-
- case _C_SEL:
- return __alignof__(SEL);
- break;
-
- case _C_CHR:
- return __alignof__(char);
- break;
-
- case _C_UCHR:
- return __alignof__(unsigned char);
- break;
-
- case _C_SHT:
- return __alignof__(short);
- break;
-
- case _C_USHT:
- return __alignof__(unsigned short);
- break;
-
- case _C_INT:
- return __alignof__(int);
- break;
-
- case _C_UINT:
- return __alignof__(unsigned int);
- break;
-
- case _C_LNG:
- return __alignof__(long);
- break;
-
- case _C_ULNG:
- return __alignof__(unsigned long);
- break;
-
- case _C_LNG_LNG:
- return __alignof__(long long);
- break;
-
- case _C_ULNG_LNG:
- return __alignof__(unsigned long long);
- break;
-
- case _C_FLT:
- return __alignof__(float);
- break;
-
- case _C_DBL:
- return __alignof__(double);
- break;
-
- case _C_PTR:
- case _C_ATOM:
- case _C_CHARPTR:
- return __alignof__(char*);
- break;
-
- case _C_ARY_B:
- while (isdigit(*++type)) /* do nothing */;
- return objc_alignof_type (type);
-
- case _C_STRUCT_B:
- {
- struct objc_struct_layout layout;
- unsigned int align;
-
- objc_layout_structure (type, &layout);
- while (objc_layout_structure_next_member (&layout))
- /* do nothing */;
- objc_layout_finish_structure (&layout, NULL, &align);
-
- return align;
- }
-
- case _C_UNION_B:
- {
- int maxalign = 0;
- while (*type != _C_UNION_E && *type++ != '=') /* do nothing */;
- while (*type != _C_UNION_E)
- {
- /* Skip the variable name if any */
- if (*type == '"')
- {
- for (type++; *type++ != '"';)
- /* do nothing */;
- }
- maxalign = MAX (maxalign, objc_alignof_type (type));
- type = objc_skip_typespec (type);
- }
- return maxalign;
- }
-
- default:
- {
- objc_error(nil, OBJC_ERR_BAD_TYPE, "unknown type %s\n", type);
- return 0;
- }
- }
-}
-
-/*
- The aligned size if the size rounded up to the nearest alignment.
-*/
-
-int
-objc_aligned_size (const char* type)
-{
- int size, align;
-
- /* Skip the variable name */
- if (*type == '"')
- {
- for (type++; *type++ != '"';)
- /* do nothing */;
- }
-
- size = objc_sizeof_type (type);
- align = objc_alignof_type (type);
-
- return ROUND (size, align);
-}
-
-/*
- The size rounded up to the nearest integral of the wordsize, taken
- to be the size of a void*.
-*/
-
-int
-objc_promoted_size (const char* type)
-{
- int size, wordsize;
-
- /* Skip the variable name */
- if (*type == '"')
- {
- for (type++; *type++ != '"';)
- /* do nothing */;
- }
-
- size = objc_sizeof_type (type);
- wordsize = sizeof (void*);
-
- return ROUND (size, wordsize);
-}
-
-/*
- Skip type qualifiers. These may eventually precede typespecs
- occurring in method prototype encodings.
-*/
-
-inline const char*
-objc_skip_type_qualifiers (const char* type)
-{
- while (*type == _C_CONST
- || *type == _C_IN
- || *type == _C_INOUT
- || *type == _C_OUT
- || *type == _C_BYCOPY
- || *type == _C_BYREF
- || *type == _C_ONEWAY
- || *type == _C_GCINVISIBLE)
- {
- type += 1;
- }
- return type;
-}
-
-
-/*
- Skip one typespec element. If the typespec is prepended by type
- qualifiers, these are skipped as well.
-*/
-
-const char*
-objc_skip_typespec (const char* type)
-{
- /* Skip the variable name if any */
- if (*type == '"')
- {
- for (type++; *type++ != '"';)
- /* do nothing */;
- }
-
- type = objc_skip_type_qualifiers (type);
-
- switch (*type) {
-
- case _C_ID:
- /* An id may be annotated by the actual type if it is known
- with the @"ClassName" syntax */
-
- if (*++type != '"')
- return type;
- else
- {
- while (*++type != '"') /* do nothing */;
- return type + 1;
- }
-
- /* The following are one character type codes */
- case _C_CLASS:
- case _C_SEL:
- case _C_CHR:
- case _C_UCHR:
- case _C_CHARPTR:
- case _C_ATOM:
- case _C_SHT:
- case _C_USHT:
- case _C_INT:
- case _C_UINT:
- case _C_LNG:
- case _C_ULNG:
- case _C_LNG_LNG:
- case _C_ULNG_LNG:
- case _C_FLT:
- case _C_DBL:
- case _C_VOID:
- case _C_UNDEF:
- return ++type;
- break;
-
- case _C_ARY_B:
- /* skip digits, typespec and closing ']' */
-
- while(isdigit(*++type));
- type = objc_skip_typespec(type);
- if (*type == _C_ARY_E)
- return ++type;
- else
- {
- objc_error(nil, OBJC_ERR_BAD_TYPE, "bad array type %s\n", type);
- return 0;
- }
-
- case _C_BFLD:
- /* The new encoding of bitfields is: b 'position' 'type' 'size' */
- while (isdigit (*++type)); /* skip position */
- while (isdigit (*++type)); /* skip type and size */
- return type;
-
- case _C_STRUCT_B:
- /* skip name, and elements until closing '}' */
-
- while (*type != _C_STRUCT_E && *type++ != '=');
- while (*type != _C_STRUCT_E) { type = objc_skip_typespec (type); }
- return ++type;
-
- case _C_UNION_B:
- /* skip name, and elements until closing ')' */
-
- while (*type != _C_UNION_E && *type++ != '=');
- while (*type != _C_UNION_E) { type = objc_skip_typespec (type); }
- return ++type;
-
- case _C_PTR:
- /* Just skip the following typespec */
-
- return objc_skip_typespec (++type);
-
- default:
- {
- objc_error(nil, OBJC_ERR_BAD_TYPE, "unknown type %s\n", type);
- return 0;
- }
- }
-}
-
-/*
- Skip an offset as part of a method encoding. This is prepended by a
- '+' if the argument is passed in registers.
-*/
-inline const char*
-objc_skip_offset (const char* type)
-{
- if (*type == '+') type++;
- while(isdigit(*++type));
- return type;
-}
-
-/*
- Skip an argument specification of a method encoding.
-*/
-const char*
-objc_skip_argspec (const char* type)
-{
- type = objc_skip_typespec (type);
- type = objc_skip_offset (type);
- return type;
-}
-
-/*
- Return the number of arguments that the method MTH expects.
- Note that all methods need two implicit arguments `self' and
- `_cmd'.
-*/
-int
-method_get_number_of_arguments (struct objc_method* mth)
-{
- int i = 0;
- const char* type = mth->method_types;
- while (*type)
- {
- type = objc_skip_argspec (type);
- i += 1;
- }
- return i - 1;
-}
-
-/*
- Return the size of the argument block needed on the stack to invoke
- the method MTH. This may be zero, if all arguments are passed in
- registers.
-*/
-
-int
-method_get_sizeof_arguments (struct objc_method* mth)
-{
- const char* type = objc_skip_typespec (mth->method_types);
- return atoi (type);
-}
-
-/*
- Return a pointer to the next argument of ARGFRAME. type points to
- the last argument. Typical use of this look like:
-
- {
- char *datum, *type;
- for (datum = method_get_first_argument (method, argframe, &type);
- datum; datum = method_get_next_argument (argframe, &type))
- {
- unsigned flags = objc_get_type_qualifiers (type);
- type = objc_skip_type_qualifiers (type);
- if (*type != _C_PTR)
- [portal encodeData: datum ofType: type];
- else
- {
- if ((flags & _F_IN) == _F_IN)
- [portal encodeData: *(char**)datum ofType: ++type];
- }
- }
- }
-*/
-
-char*
-method_get_next_argument (arglist_t argframe,
- const char **type)
-{
- const char *t = objc_skip_argspec (*type);
-
- if (*t == '\0')
- return 0;
-
- *type = t;
- t = objc_skip_typespec (t);
-
- if (*t == '+')
- return argframe->arg_regs + atoi (++t);
- else
- return argframe->arg_ptr + atoi (t);
-}
-
-/*
- Return a pointer to the value of the first argument of the method
- described in M with the given argumentframe ARGFRAME. The type
- is returned in TYPE. type must be passed to successive calls of
- method_get_next_argument.
-*/
-char*
-method_get_first_argument (struct objc_method* m,
- arglist_t argframe,
- const char** type)
-{
- *type = m->method_types;
- return method_get_next_argument (argframe, type);
-}
-
-/*
- Return a pointer to the ARGth argument of the method
- M from the frame ARGFRAME. The type of the argument
- is returned in the value-result argument TYPE
-*/
-
-char*
-method_get_nth_argument (struct objc_method* m,
- arglist_t argframe, int arg,
- const char **type)
-{
- const char* t = objc_skip_argspec (m->method_types);
-
- if (arg > method_get_number_of_arguments (m))
- return 0;
-
- while (arg--)
- t = objc_skip_argspec (t);
-
- *type = t;
- t = objc_skip_typespec (t);
-
- if (*t == '+')
- return argframe->arg_regs + atoi (++t);
- else
- return argframe->arg_ptr + atoi (t);
-}
-
-unsigned
-objc_get_type_qualifiers (const char* type)
-{
- unsigned res = 0;
- BOOL flag = YES;
-
- while (flag)
- switch (*type++)
- {
- case _C_CONST: res |= _F_CONST; break;
- case _C_IN: res |= _F_IN; break;
- case _C_INOUT: res |= _F_INOUT; break;
- case _C_OUT: res |= _F_OUT; break;
- case _C_BYCOPY: res |= _F_BYCOPY; break;
- case _C_BYREF: res |= _F_BYREF; break;
- case _C_ONEWAY: res |= _F_ONEWAY; break;
- case _C_GCINVISIBLE: res |= _F_GCINVISIBLE; break;
- default: flag = NO;
- }
-
- return res;
-}
-
-
-/* The following three functions can be used to determine how a
- structure is laid out by the compiler. For example:
-
- struct objc_struct_layout layout;
- int i;
-
- objc_layout_structure (type, &layout);
- while (objc_layout_structure_next_member (&layout))
- {
- int position, align;
- const char *type;
-
- objc_layout_structure_get_info (&layout, &position, &align, &type);
- printf ("element %d has offset %d, alignment %d\n",
- i++, position, align);
- }
-
- These functions are used by objc_sizeof_type and objc_alignof_type
- functions to compute the size and alignment of structures. The
- previous method of computing the size and alignment of a structure
- was not working on some architectures, particulary on AIX, and in
- the presence of bitfields inside the structure. */
-void
-objc_layout_structure (const char *type,
- struct objc_struct_layout *layout)
-{
- const char *ntype;
-
- if (*type++ != _C_STRUCT_B)
- {
- objc_error(nil, OBJC_ERR_BAD_TYPE,
- "record type expected in objc_layout_structure, got %s\n",
- type);
- }
-
- layout->original_type = type;
-
- /* Skip "<name>=" if any. Avoid embedded structures and unions. */
- ntype = type;
- while (*ntype != _C_STRUCT_E && *ntype != _C_STRUCT_B && *ntype != _C_UNION_B
- && *ntype++ != '=')
- /* do nothing */;
-
- /* If there's a "<name>=", ntype - 1 points to '='; skip the the name */
- if (*(ntype - 1) == '=')
- type = ntype;
-
- layout->type = type;
- layout->prev_type = NULL;
- layout->record_size = 0;
- layout->record_align = BITS_PER_UNIT;
-
-#ifdef STRUCTURE_SIZE_BOUNDARY
- layout->record_align = MAX (layout->record_align, STRUCTURE_SIZE_BOUNDARY);
-#endif
-}
-
-
-BOOL
-objc_layout_structure_next_member (struct objc_struct_layout *layout)
-{
- register int known_align = layout->record_size;
- register int desired_align = 0;
-
- /* The following are used only if the field is a bitfield */
- register const char *bfld_type;
- register int bfld_type_size, bfld_type_align, bfld_field_size;
-
- /* The current type without the type qualifiers */
- const char *type;
-
-#if 1
- if (layout->prev_type == NULL)
- {
- layout->prev_type = layout->type;
- layout->type = objc_skip_typespec (layout->prev_type);
- return YES;
- }
-#endif
-
- /* Add the size of the previous field to the size of the record. */
- if (layout->prev_type)
- {
- type = objc_skip_type_qualifiers (layout->prev_type);
-
- if (*type != _C_BFLD)
- layout->record_size += objc_sizeof_type (type) * BITS_PER_UNIT;
- else {
- desired_align = 1;
- /* Get the bitfield's type */
- for (bfld_type = type + 1;
- isdigit(*bfld_type);
- bfld_type++)
- /* do nothing */;
-
- bfld_type_size = objc_sizeof_type (bfld_type) * BITS_PER_UNIT;
- bfld_type_align = objc_alignof_type (bfld_type) * BITS_PER_UNIT;
- bfld_field_size = atoi (objc_skip_typespec (bfld_type));
- layout->record_size += bfld_field_size;
- }
- }
-
- if (*layout->type == _C_STRUCT_E)
- return NO;
-
- /* Skip the variable name if any */
- if (*layout->type == '"')
- {
- for (layout->type++; *layout->type++ != '"';)
- /* do nothing */;
- }
-
- type = objc_skip_type_qualifiers (layout->type);
-
- if (*type != _C_BFLD)
- desired_align = objc_alignof_type(type) * BITS_PER_UNIT;
- else
- {
- desired_align = 1;
- /* Skip the bitfield's offset */
- for (bfld_type = type + 1; isdigit(*bfld_type); bfld_type++)
- /* do nothing */;
-
- bfld_type_size = objc_sizeof_type (bfld_type) * BITS_PER_UNIT;
- bfld_type_align = objc_alignof_type (bfld_type) * BITS_PER_UNIT;
- bfld_field_size = atoi (objc_skip_typespec (bfld_type));
- }
-
-#ifdef BIGGEST_FIELD_ALIGNMENT
- desired_align = MIN (desired_align, BIGGEST_FIELD_ALIGNMENT);
-#endif
-#ifdef ADJUST_FIELD_ALIGN
- desired_align = ADJUST_FIELD_ALIGN (type, desired_align);
-#endif
-
- /* Record must have at least as much alignment as any field.
- Otherwise, the alignment of the field within the record
- is meaningless. */
-#ifndef PCC_BITFIELD_TYPE_MATTERS
- layout->record_align = MAX (layout->record_align, desired_align);
-#else
- if (*type == _C_BFLD)
- {
- /* For these machines, a zero-length field does not
- affect the alignment of the structure as a whole.
- It does, however, affect the alignment of the next field
- within the structure. */
- if (bfld_field_size)
- layout->record_align = MAX (layout->record_align, desired_align);
- else
- desired_align = objc_alignof_type (bfld_type) * BITS_PER_UNIT;
-
- /* A named bit field of declared type `int'
- forces the entire structure to have `int' alignment.
- Q1: How is encoded this thing and how to check for it?
- Q2: How to determine maximum_field_alignment at runtime? */
-
-/* if (DECL_NAME (field) != 0) */
- {
- int type_align = bfld_type_align;
-#if 0
- if (maximum_field_alignment != 0)
- type_align = MIN (type_align, maximum_field_alignment);
- else if (DECL_PACKED (field))
- type_align = MIN (type_align, BITS_PER_UNIT);
-#endif
-
- layout->record_align = MAX (layout->record_align, type_align);
- }
- }
- else
- layout->record_align = MAX (layout->record_align, desired_align);
-#endif
-
- /* Does this field automatically have alignment it needs
- by virtue of the fields that precede it and the record's
- own alignment? */
-
- if (*type == _C_BFLD)
- layout->record_size = atoi (type + 1);
- else if (layout->record_size % desired_align != 0)
- {
- /* No, we need to skip space before this field.
- Bump the cumulative size to multiple of field alignment. */
- layout->record_size = ROUND (layout->record_size, desired_align);
- }
-
- /* Jump to the next field in record. */
-
- layout->prev_type = layout->type;
- layout->type = objc_skip_typespec (layout->type); /* skip component */
-
- return YES;
-}
-
-
-void objc_layout_finish_structure (struct objc_struct_layout *layout,
- unsigned int *size,
- unsigned int *align)
-{
- if (layout->type && *layout->type == _C_STRUCT_E)
- {
- /* Work out the alignment of the record as one expression and store
- in the record type. Round it up to a multiple of the record's
- alignment. */
-
-#ifdef ROUND_TYPE_ALIGN
- layout->record_align = ROUND_TYPE_ALIGN (layout->original_type,
- 1,
- layout->record_align);
-#else
- layout->record_align = MAX (1, layout->record_align);
-#endif
-
-#ifdef ROUND_TYPE_SIZE
- layout->record_size = ROUND_TYPE_SIZE (layout->original_type,
- layout->record_size,
- layout->record_align);
-#else
- /* Round the size up to be a multiple of the required alignment */
- layout->record_size = ROUND (layout->record_size, layout->record_align);
-#endif
-
- layout->type = NULL;
- }
- if (size)
- *size = layout->record_size / BITS_PER_UNIT;
- if (align)
- *align = layout->record_align / BITS_PER_UNIT;
-}
-
-
-void objc_layout_structure_get_info (struct objc_struct_layout *layout,
- unsigned int *offset,
- unsigned int *align,
- const char **type)
-{
- if (offset)
- *offset = layout->record_size / BITS_PER_UNIT;
- if (align)
- *align = layout->record_align / BITS_PER_UNIT;
- if (type)
- *type = layout->prev_type;
-}
diff --git a/contrib/libobjc/gc.c b/contrib/libobjc/gc.c
deleted file mode 100644
index 8ca6de8e946c..000000000000
--- a/contrib/libobjc/gc.c
+++ /dev/null
@@ -1,458 +0,0 @@
-/* Basic data types for Objective C.
- Copyright (C) 1998 Free Software Foundation, Inc.
- Contributed by Ovidiu Predescu.
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with files
- compiled with GCC 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 "tconfig.h"
-#include "objc.h"
-#include "encoding.h"
-
-#include <assert.h>
-#include <string.h>
-
-#if OBJC_WITH_GC
-
-#include <gc.h>
-
-/* gc_typed.h uses the following but doesn't declare them */
-typedef GC_word word;
-typedef GC_signed_word signed_word;
-
-#if BITS_PER_WORD == 32
-# define LOGWL 5
-# define modWORDSZ(n) ((n) & 0x1f) /* n mod size of word */
-#endif
-
-#if BITS_PER_WORD == 64
-# define LOGWL 6
-# define modWORDSZ(n) ((n) & 0x3f) /* n mod size of word */
-#endif
-
-#define divWORDSZ(n) ((n) >> LOGWL) /* divide n by size of word */
-
-#include <gc_typed.h>
-
-/* The following functions set up in `mask` the corresponding pointers.
- The offset is incremented with the size of the type. */
-
-#define ROUND(V, A) \
- ({ typeof(V) __v=(V); typeof(A) __a=(A); \
- __a*((__v+__a-1)/__a); })
-
-#define SET_BIT_FOR_OFFSET(mask, offset) \
- GC_set_bit(mask, offset / sizeof (void*))
-
-/* Some prototypes */
-static void
-__objc_gc_setup_struct (GC_bitmap mask, const char *type, int offset);
-static void
-__objc_gc_setup_union (GC_bitmap mask, const char *type, int offset);
-
-
-static void
-__objc_gc_setup_array (GC_bitmap mask, const char *type, int offset)
-{
- int i, len = atoi(type + 1);
-
- while (isdigit(*++type))
- /* do nothing */; /* skip the size of the array */
-
- switch (*type) {
- case _C_ARY_B:
- for (i = 0; i < len; i++)
- __objc_gc_setup_array (mask, type, offset);
- break;
-
- case _C_STRUCT_B:
- for (i = 0; i < len; i++)
- __objc_gc_setup_struct (mask, type, offset);
- break;
-
- case _C_UNION_B:
- for (i = 0; i < len; i++)
- __objc_gc_setup_union (mask, type, offset);
- break;
-
- default:
- break;
- }
-}
-
-static void
-__objc_gc_setup_struct (GC_bitmap mask, const char *type, int offset)
-{
- struct objc_struct_layout layout;
- unsigned int position;
- const char *mtype;
-
- objc_layout_structure (type, &layout);
-
- while (objc_layout_structure_next_member (&layout))
- {
- BOOL gc_invisible = NO;
-
- objc_layout_structure_get_info (&layout, &position, NULL, &mtype);
-
- /* Skip the variable name */
- if (*mtype == '"')
- {
- for (mtype++; *mtype++ != '"';)
- /* do nothing */;
- }
-
- if (*mtype == _C_GCINVISIBLE)
- {
- gc_invisible = YES;
- mtype++;
- }
-
- /* Add to position the offset of this structure */
- position += offset;
-
- switch (*mtype) {
- case _C_ID:
- case _C_CLASS:
- case _C_SEL:
- case _C_PTR:
- case _C_CHARPTR:
- case _C_ATOM:
- if (!gc_invisible)
- SET_BIT_FOR_OFFSET(mask, position);
- break;
-
- case _C_ARY_B:
- __objc_gc_setup_array (mask, mtype, position);
- break;
-
- case _C_STRUCT_B:
- __objc_gc_setup_struct (mask, mtype, position);
- break;
-
- case _C_UNION_B:
- __objc_gc_setup_union (mask, mtype, position);
- break;
-
- default:
- break;
- }
- }
-}
-
-static void
-__objc_gc_setup_union (GC_bitmap mask, const char *type, int offset)
-{
- /* Sub-optimal, quick implementation: assume the union is made of
- pointers, set up the mask accordingly. */
-
- int i, size, align;
-
- /* Skip the variable name */
- if (*type == '"')
- {
- for (type++; *type++ != '"';)
- /* do nothing */;
- }
-
- size = objc_sizeof_type (type);
- align = objc_alignof_type (type);
-
- offset = ROUND(offset, align);
- for (i = 0; i < size; i += sizeof (void*))
- {
- SET_BIT_FOR_OFFSET(mask, offset);
- offset += sizeof (void*);
- }
-}
-
-
-/* Iterates over the types in the structure that represents the class
- encoding and sets the bits in mask according to each ivar type. */
-static void
-__objc_gc_type_description_from_type (GC_bitmap mask, const char *type)
-{
- struct objc_struct_layout layout;
- unsigned int offset, align;
- const char *ivar_type;
-
- objc_layout_structure (type, &layout);
-
- while (objc_layout_structure_next_member (&layout))
- {
- BOOL gc_invisible = NO;
-
- objc_layout_structure_get_info (&layout, &offset, &align, &ivar_type);
-
- /* Skip the variable name */
- if (*ivar_type == '"')
- {
- for (ivar_type++; *ivar_type++ != '"';)
- /* do nothing */;
- }
-
- if (*ivar_type == _C_GCINVISIBLE)
- {
- gc_invisible = YES;
- ivar_type++;
- }
-
- switch (*ivar_type) {
- case _C_ID:
- case _C_CLASS:
- case _C_SEL:
- case _C_PTR:
- case _C_CHARPTR:
- if (!gc_invisible)
- SET_BIT_FOR_OFFSET(mask, offset);
- break;
-
- case _C_ARY_B:
- __objc_gc_setup_array (mask, ivar_type, offset);
- break;
-
- case _C_STRUCT_B:
- __objc_gc_setup_struct (mask, ivar_type, offset);
- break;
-
- case _C_UNION_B:
- __objc_gc_setup_union (mask, ivar_type, offset);
- break;
-
- default:
- break;
- }
- }
-}
-
-/* Computes in *type the full type encoding of this class including
- its super classes. '*size' gives the total number of bytes allocated
- into *type, '*current' the number of bytes used so far by the
- encoding. */
-static void
-__objc_class_structure_encoding (Class class, char **type, int *size,
- int *current)
-{
- int i, ivar_count;
- struct objc_ivar_list* ivars;
-
- if (!class)
- {
- strcat (*type, "{");
- *current++;
- return;
- }
-
- /* Add the type encodings of the super classes */
- __objc_class_structure_encoding (class->super_class, type, size, current);
-
- ivars = class->ivars;
- if (!ivars)
- return;
-
- ivar_count = ivars->ivar_count;
-
- for (i = 0; i < ivar_count; i++)
- {
- struct objc_ivar *ivar = &(ivars->ivar_list[i]);
- const char *ivar_type = ivar->ivar_type;
- int len = strlen (ivar_type);
-
- if (*current + len + 1 >= *size)
- {
- /* Increase the size of the encoding string so that it
- contains this ivar's type. */
- *size = ROUND(*current + len + 1, 10);
- *type = objc_realloc (*type, *size);
- }
- strcat (*type + *current, ivar_type);
- *current += len;
- }
-}
-
-
-/* Allocates the memory that will hold the type description for class
- and calls the __objc_class_structure_encoding that generates this
- value. */
-void
-__objc_generate_gc_type_description (Class class)
-{
- GC_bitmap mask;
- int bits_no, size;
- int type_size = 10, current;
- char *class_structure_type;
-
- if (!CLS_ISCLASS(class))
- return;
-
- /* We have to create a mask in which each bit counts for a pointer member.
- We take into consideration all the non-pointer instance variables and we
- round them up to the alignment. */
-
- /* The number of bits in the mask is the size of an instance in bytes divided
- by the size of a pointer. */
- bits_no = (ROUND(class_get_instance_size (class), sizeof(void*))
- / sizeof (void*));
- size = ROUND(bits_no, BITS_PER_WORD) / BITS_PER_WORD;
- mask = objc_atomic_malloc (size * sizeof (int));
- memset (mask, 0, size * sizeof (int));
-
- class_structure_type = objc_atomic_malloc (type_size);
- *class_structure_type = current = 0;
- __objc_class_structure_encoding (class, &class_structure_type,
- &type_size, &current);
- if (current + 1 == type_size)
- class_structure_type = objc_realloc (class_structure_type, ++type_size);
- strcat (class_structure_type + current, "}");
-// printf ("type description for '%s' is %s\n", class->name, class_structure_type);
-
- __objc_gc_type_description_from_type (mask, class_structure_type);
- objc_free (class_structure_type);
-
-#define DEBUG 1
-#ifdef DEBUG
- printf (" mask for '%s', type '%s' (bits %d, mask size %d) is:",
- class_structure_type, class->name, bits_no, size);
- {
- int i;
- for (i = 0; i < size; i++)
- printf (" %lx", mask[i]);
- }
- puts ("");
-#endif
-
- class->gc_object_type = (void*)GC_make_descriptor (mask, bits_no);
-}
-
-
-/* Returns YES if type denotes a pointer type, NO otherwise */
-static inline BOOL
-__objc_ivar_pointer (const char *type)
-{
- type = objc_skip_type_qualifiers (type);
-
- return (*type == _C_ID
- || *type == _C_CLASS
- || *type == _C_SEL
- || *type == _C_PTR
- || *type == _C_CHARPTR
- || *type == _C_ATOM);
-}
-
-
-/* Mark the instance variable whose name is given by ivarname as a
- weak pointer (a pointer hidden to the garbage collector) if
- gc_invisible is true. If gc_invisible is false it unmarks the
- instance variable and makes it a normal pointer, visible to the
- garbage collector.
-
- This operation only makes sense on instance variables that are
- pointers. */
-void
-class_ivar_set_gcinvisible (Class class, const char* ivarname,
- BOOL gc_invisible)
-{
- int i, ivar_count;
- struct objc_ivar_list* ivars;
-
- if (!class || !ivarname)
- return;
-
- ivars = class->ivars;
- if (!ivars)
- return;
-
- ivar_count = ivars->ivar_count;
-
- for (i = 0; i < ivar_count; i++)
- {
- struct objc_ivar *ivar = &(ivars->ivar_list[i]);
- const char *type;
-
- if (!ivar->ivar_name || strcmp (ivar->ivar_name, ivarname))
- continue;
-
- assert (ivar->ivar_type);
- type = ivar->ivar_type;
-
- /* Skip the variable name */
- if (*type == '"')
- {
- for (type++; *type++ != '"';)
- /* do nothing */;
- }
-
- if (*type == _C_GCINVISIBLE)
- {
- char *new_type;
-
- if (gc_invisible || !__objc_ivar_pointer (type))
- return; /* The type of the variable already matches the
- requested gc_invisible type */
-
- /* The variable is gc_invisible and we have to reverse it */
- new_type = objc_atomic_malloc (strlen (ivar->ivar_type));
- strncpy (new_type, ivar->ivar_type,
- (size_t)(type - ivar->ivar_type));
- strcat (new_type, type + 1);
- ivar->ivar_type = new_type;
- }
- else
- {
- char *new_type;
-
- if (!gc_invisible || !__objc_ivar_pointer (type))
- return; /* The type of the variable already matches the
- requested gc_invisible type */
-
- /* The variable is gc visible and we have to make it gc_invisible */
- new_type = objc_malloc (strlen (ivar->ivar_type) + 2);
- strncpy (new_type, ivar->ivar_type,
- (size_t)(type - ivar->ivar_type));
- strcat (new_type, "!");
- strcat (new_type, type);
- ivar->ivar_type = new_type;
- }
-
- __objc_generate_gc_type_description (class);
- return;
- }
-
- /* Search the instance variable in the superclasses */
- class_ivar_set_gcinvisible (class->super_class, ivarname, gc_invisible);
-}
-
-#else /* !OBJC_WITH_GC */
-
-void
-__objc_generate_gc_type_description (Class class)
-{
-}
-
-void class_ivar_set_gcinvisible (Class class,
- const char* ivarname,
- BOOL gc_invisible)
-{
-}
-
-#endif /* OBJC_WITH_GC */
diff --git a/contrib/libobjc/hash.c b/contrib/libobjc/hash.c
deleted file mode 100644
index 223991f97f3e..000000000000
--- a/contrib/libobjc/hash.c
+++ /dev/null
@@ -1,283 +0,0 @@
-/* Hash tables for Objective C internal structures
- Copyright (C) 1993, 1996, 1997 Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with files
- compiled with GCC 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 "assert.h"
-
-#include "hash.h"
-
-#include "runtime.h" /* for DEBUG_PRINTF */
-
-/* These two macros determine when a hash table is full and
- by how much it should be expanded respectively.
-
- These equations are percentages. */
-#define FULLNESS(cache) \
- ((((cache)->size * 75) / 100) <= (cache)->used)
-#define EXPANSION(cache) \
- ((cache)->size * 2)
-
-cache_ptr
-hash_new (unsigned int size, hash_func_type hash_func,
- compare_func_type compare_func)
-{
- cache_ptr cache;
-
- /* Pass me a value greater than 0 and a power of 2. */
- assert (size);
- assert (!(size & (size - 1)));
-
- /* Allocate the cache structure. calloc insures
- its initialization for default values. */
- cache = (cache_ptr) objc_calloc (1, sizeof (struct cache));
- assert (cache);
-
- /* Allocate the array of buckets for the cache.
- calloc initializes all of the pointers to NULL. */
- cache->node_table
- = (node_ptr *) objc_calloc (size, sizeof (node_ptr));
- assert (cache->node_table);
-
- cache->size = size;
-
- /* This should work for all processor architectures? */
- cache->mask = (size - 1);
-
- /* Store the hashing function so that codes can be computed. */
- cache->hash_func = hash_func;
-
- /* Store the function that compares hash keys to
- determine if they are equal. */
- cache->compare_func = compare_func;
-
- return cache;
-}
-
-
-void
-hash_delete (cache_ptr cache)
-{
- node_ptr node;
- node_ptr next_node;
- unsigned int i;
-
- /* Purge all key/value pairs from the table. */
- /* Step through the nodes one by one and remove every node WITHOUT
- using hash_next. this makes hash_delete much more efficient. */
- for (i = 0;i < cache->size;i++) {
- if ((node = cache->node_table[i])) {
- /* an entry in the hash table has been found, now step through the
- nodes next in the list and free them. */
- while ((next_node = node->next)) {
- hash_remove (cache,node->key);
- node = next_node;
- }
-
- hash_remove (cache,node->key);
- }
- }
-
- /* Release the array of nodes and the cache itself. */
- objc_free(cache->node_table);
- objc_free(cache);
-}
-
-
-void
-hash_add (cache_ptr *cachep, const void *key, void *value)
-{
- size_t indx = (*(*cachep)->hash_func)(*cachep, key);
- node_ptr node = (node_ptr) objc_calloc (1, sizeof (struct cache_node));
-
-
- assert (node);
-
- /* Initialize the new node. */
- node->key = key;
- node->value = value;
- node->next = (*cachep)->node_table[indx];
-
- /* Debugging.
- Check the list for another key. */
-#ifdef DEBUG
- { node_ptr node1 = (*cachep)->node_table[indx];
-
- while (node1) {
-
- assert (node1->key != key);
- node1 = node1->next;
- }
- }
-#endif
-
- /* Install the node as the first element on the list. */
- (*cachep)->node_table[indx] = node;
-
- /* Bump the number of entries in the cache. */
- ++(*cachep)->used;
-
- /* Check the hash table's fullness. We're going
- to expand if it is above the fullness level. */
- if (FULLNESS (*cachep)) {
-
- /* The hash table has reached its fullness level. Time to
- expand it.
-
- I'm using a slow method here but is built on other
- primitive functions thereby increasing its
- correctness. */
- node_ptr node1 = NULL;
- cache_ptr new = hash_new (EXPANSION (*cachep),
- (*cachep)->hash_func,
- (*cachep)->compare_func);
-
- DEBUG_PRINTF ("Expanding cache %#x from %d to %d\n",
- *cachep, (*cachep)->size, new->size);
-
- /* Copy the nodes from the first hash table to the new one. */
- while ((node1 = hash_next (*cachep, node1)))
- hash_add (&new, node1->key, node1->value);
-
- /* Trash the old cache. */
- hash_delete (*cachep);
-
- /* Return a pointer to the new hash table. */
- *cachep = new;
- }
-}
-
-
-void
-hash_remove (cache_ptr cache, const void *key)
-{
- size_t indx = (*cache->hash_func)(cache, key);
- node_ptr node = cache->node_table[indx];
-
-
- /* We assume there is an entry in the table. Error if it is not. */
- assert (node);
-
- /* Special case. First element is the key/value pair to be removed. */
- if ((*cache->compare_func)(node->key, key)) {
- cache->node_table[indx] = node->next;
- objc_free(node);
- } else {
-
- /* Otherwise, find the hash entry. */
- node_ptr prev = node;
- BOOL removed = NO;
-
- do {
-
- if ((*cache->compare_func)(node->key, key)) {
- prev->next = node->next, removed = YES;
- objc_free(node);
- } else
- prev = node, node = node->next;
- } while (!removed && node);
- assert (removed);
- }
-
- /* Decrement the number of entries in the hash table. */
- --cache->used;
-}
-
-
-node_ptr
-hash_next (cache_ptr cache, node_ptr node)
-{
- /* If the scan is being started then reset the last node
- visitied pointer and bucket index. */
- if (!node)
- cache->last_bucket = 0;
-
- /* If there is a node visited last then check for another
- entry in the same bucket; Otherwise step to the next bucket. */
- if (node) {
- if (node->next)
- /* There is a node which follows the last node
- returned. Step to that node and retun it. */
- return node->next;
- else
- ++cache->last_bucket;
- }
-
- /* If the list isn't exhausted then search the buckets for
- other nodes. */
- if (cache->last_bucket < cache->size) {
- /* Scan the remainder of the buckets looking for an entry
- at the head of the list. Return the first item found. */
- while (cache->last_bucket < cache->size)
- if (cache->node_table[cache->last_bucket])
- return cache->node_table[cache->last_bucket];
- else
- ++cache->last_bucket;
-
- /* No further nodes were found in the hash table. */
- return NULL;
- } else
- return NULL;
-}
-
-
-/* Given KEY, return corresponding value for it in CACHE.
- Return NULL if the KEY is not recorded. */
-
-void *
-hash_value_for_key (cache_ptr cache, const void *key)
-{
- node_ptr node = cache->node_table[(*cache->hash_func)(cache, key)];
- void *retval = NULL;
-
- if (node)
- do {
- if ((*cache->compare_func)(node->key, key)) {
- retval = node->value;
- break;
- } else
- node = node->next;
- } while (!retval && node);
-
- return retval;
-}
-
-/* Given KEY, return YES if it exists in the CACHE.
- Return NO if it does not */
-
-BOOL
-hash_is_key_in_hash (cache_ptr cache, const void *key)
-{
- node_ptr node = cache->node_table[(*cache->hash_func)(cache, key)];
-
- if (node)
- do {
- if ((*cache->compare_func)(node->key, key))
- return YES;
- else
- node = node->next;
- } while (node);
-
- return NO;
-}
diff --git a/contrib/libobjc/init.c b/contrib/libobjc/init.c
deleted file mode 100644
index 954fc9240ae7..000000000000
--- a/contrib/libobjc/init.c
+++ /dev/null
@@ -1,834 +0,0 @@
-/* GNU Objective C Runtime initialization
- Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
- Contributed by Kresten Krab Thorup
- +load support contributed by Ovidiu Predescu <ovidiu@net-community.com>
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
-details.
-
-You should have received a copy of the GNU General Public License along with
-GNU CC; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with files compiled with
- GCC 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 "runtime.h"
-
-/* The version number of this runtime. This must match the number
- defined in gcc (objc-act.c) */
-#define OBJC_VERSION 8
-#define PROTOCOL_VERSION 2
-
-/* This list contains all modules currently loaded into the runtime */
-static struct objc_list* __objc_module_list = 0; /* !T:MUTEX */
-
-/* This list contains all proto_list's not yet assigned class links */
-static struct objc_list* unclaimed_proto_list = 0; /* !T:MUTEX */
-
-/* List of unresolved static instances. */
-static struct objc_list *uninitialized_statics = 0; /* !T:MUTEX */
-
-/* Global runtime "write" mutex. */
-objc_mutex_t __objc_runtime_mutex = 0;
-
-/* Number of threads that are alive. */
-int __objc_runtime_threads_alive = 1; /* !T:MUTEX */
-
-/* Check compiler vs runtime version */
-static void init_check_module_version (Module_t);
-
-/* Assign isa links to protos */
-static void __objc_init_protocols (struct objc_protocol_list* protos);
-
-/* Add protocol to class */
-static void __objc_class_add_protocols (Class, struct objc_protocol_list*);
-
-/* This is a hook which is called by __objc_exec_class every time a class
- or a category is loaded into the runtime. This may e.g. help a
- dynamic loader determine the classes that have been loaded when
- an object file is dynamically linked in */
-void (*_objc_load_callback)(Class class, Category* category); /* !T:SAFE */
-
-/* Is all categories/classes resolved? */
-BOOL __objc_dangling_categories = NO; /* !T:UNUSED */
-
-extern SEL
-__sel_register_typed_name (const char *name, const char *types,
- struct objc_selector *orig, BOOL is_const);
-
-/* Sends +load to all classes and categories in certain situations. */
-static void objc_send_load (void);
-
-/* Inserts all the classes defined in module in a tree of classes that
- resembles the class hierarchy. This tree is traversed in preorder and the
- classes in its nodes receive the +load message if these methods were not
- executed before. The algorithm ensures that when the +load method of a class
- is executed all the superclasses have been already received the +load
- message. */
-static void __objc_create_classes_tree (Module_t module);
-
-static void __objc_call_callback (Module_t module);
-
-/* A special version that works only before the classes are completely
- installed in the runtime. */
-static BOOL class_is_subclass_of_class (Class class, Class superclass);
-
-typedef struct objc_class_tree {
- Class class;
- struct objc_list *subclasses; /* `head' is pointer to an objc_class_tree */
-} objc_class_tree;
-
-/* This is a linked list of objc_class_tree trees. The head of these trees
- are root classes (their super class is Nil). These different trees
- represent different class hierarchies. */
-static struct objc_list *__objc_class_tree_list = NULL;
-
-/* Keeps the +load methods who have been already executed. This hash should
- not be destroyed during the execution of the program. */
-static cache_ptr __objc_load_methods = NULL;
-
-/* Creates a tree of classes whose topmost class is directly inherited from
- `upper' and the bottom class in this tree is `bottom_class'. The classes
- in this tree are super classes of `bottom_class'. `subclasses' member
- of each tree node point to the next subclass tree node. */
-static objc_class_tree *
-create_tree_of_subclasses_inherited_from (Class bottom_class, Class upper)
-{
- Class superclass = bottom_class->super_class ?
- objc_lookup_class ((char*)bottom_class->super_class)
- : Nil;
-
- objc_class_tree *tree, *prev;
-
- DEBUG_PRINTF ("create_tree_of_subclasses_inherited_from:");
- DEBUG_PRINTF ("bottom_class = %s, upper = %s\n",
- (bottom_class ? bottom_class->name : NULL),
- (upper ? upper->name : NULL));
-
- tree = prev = objc_calloc (1, sizeof (objc_class_tree));
- prev->class = bottom_class;
-
- while (superclass != upper)
- {
- tree = objc_calloc (1, sizeof (objc_class_tree));
- tree->class = superclass;
- tree->subclasses = list_cons (prev, tree->subclasses);
- superclass = (superclass->super_class ?
- objc_lookup_class ((char*)superclass->super_class)
- : Nil);
- prev = tree;
- }
-
- return tree;
-}
-
-/* Insert the `class' into the proper place in the `tree' class hierarchy. This
- function returns a new tree if the class has been successfully inserted into
- the tree or NULL if the class is not part of the classes hierarchy described
- by `tree'. This function is private to objc_tree_insert_class(), you should
- not call it directly. */
-static objc_class_tree *
-__objc_tree_insert_class (objc_class_tree *tree, Class class)
-{
- DEBUG_PRINTF ("__objc_tree_insert_class: tree = %x, class = %s\n",
- tree, class->name);
-
- if (tree == NULL)
- return create_tree_of_subclasses_inherited_from (class, NULL);
- else if (class == tree->class)
- {
- /* `class' has been already inserted */
- DEBUG_PRINTF ("1. class %s was previously inserted\n", class->name);
- return tree;
- }
- else if ((class->super_class ?
- objc_lookup_class ((char*)class->super_class)
- : Nil)
- == tree->class)
- {
- /* If class is a direct subclass of tree->class then add class to the
- list of subclasses. First check to see if it wasn't already
- inserted. */
- struct objc_list *list = tree->subclasses;
- objc_class_tree *node;
-
- while (list)
- {
- /* Class has been already inserted; do nothing just return
- the tree. */
- if (((objc_class_tree*)list->head)->class == class)
- {
- DEBUG_PRINTF ("2. class %s was previously inserted\n",
- class->name);
- return tree;
- }
- list = list->tail;
- }
-
- /* Create a new node class and insert it into the list of subclasses */
- node = objc_calloc (1, sizeof (objc_class_tree));
- node->class = class;
- tree->subclasses = list_cons (node, tree->subclasses);
- DEBUG_PRINTF ("3. class %s inserted\n", class->name);
- return tree;
- }
- else
- {
- /* The class is not a direct subclass of tree->class. Search for class's
- superclasses in the list of subclasses. */
- struct objc_list *subclasses = tree->subclasses;
-
- /* Precondition: the class must be a subclass of tree->class; otherwise
- return NULL to indicate our caller that it must take the next tree. */
- if (!class_is_subclass_of_class (class, tree->class))
- return NULL;
-
- for (; subclasses != NULL; subclasses = subclasses->tail)
- {
- Class aClass = ((objc_class_tree*)(subclasses->head))->class;
-
- if (class_is_subclass_of_class (class, aClass))
- {
- /* If we found one of class's superclasses we insert the class
- into its subtree and return the original tree since nothing
- has been changed. */
- subclasses->head
- = __objc_tree_insert_class (subclasses->head, class);
- DEBUG_PRINTF ("4. class %s inserted\n", class->name);
- return tree;
- }
- }
-
- /* We haven't found a subclass of `class' in the `subclasses' list.
- Create a new tree of classes whose topmost class is a direct subclass
- of tree->class. */
- {
- objc_class_tree *new_tree
- = create_tree_of_subclasses_inherited_from (class, tree->class);
- tree->subclasses = list_cons (new_tree, tree->subclasses);
- DEBUG_PRINTF ("5. class %s inserted\n", class->name);
- return tree;
- }
- }
-}
-
-/* This function inserts `class' in the right tree hierarchy classes. */
-static void
-objc_tree_insert_class (Class class)
-{
- struct objc_list *list_node;
- objc_class_tree *tree;
-
- list_node = __objc_class_tree_list;
- while (list_node)
- {
- tree = __objc_tree_insert_class (list_node->head, class);
- if (tree)
- {
- list_node->head = tree;
- break;
- }
- else
- list_node = list_node->tail;
- }
-
- /* If the list was finished but the class hasn't been inserted, insert it
- here. */
- if (!list_node)
- {
- __objc_class_tree_list = list_cons (NULL, __objc_class_tree_list);
- __objc_class_tree_list->head = __objc_tree_insert_class (NULL, class);
- }
-}
-
-/* Traverse tree in preorder. Used to send +load. */
-static void
-objc_preorder_traverse (objc_class_tree *tree,
- int level,
- void (*function)(objc_class_tree*, int))
-{
- struct objc_list *node;
-
- (*function) (tree, level);
- for (node = tree->subclasses; node; node = node->tail)
- objc_preorder_traverse (node->head, level + 1, function);
-}
-
-/* Traverse tree in postorder. Used to destroy a tree. */
-static void
-objc_postorder_traverse (objc_class_tree *tree,
- int level,
- void (*function)(objc_class_tree*, int))
-{
- struct objc_list *node;
-
- for (node = tree->subclasses; node; node = node->tail)
- objc_postorder_traverse (node->head, level + 1, function);
- (*function) (tree, level);
-}
-
-/* Used to print a tree class hierarchy. */
-#ifdef DEBUG
-static void
-__objc_tree_print (objc_class_tree *tree, int level)
-{
- int i;
-
- for (i = 0; i < level; i++)
- printf (" ");
- printf ("%s\n", tree->class->name);
-}
-#endif
-
-/* Walks on a linked list of methods in the reverse order and executes all
- the methods corresponding to `op' selector. Walking in the reverse order
- assures the +load of class is executed first and then +load of categories
- because of the way in which categories are added to the class methods. */
-static void
-__objc_send_message_in_list (MethodList_t method_list, Class class, SEL op)
-{
- int i;
-
- if (!method_list)
- return;
-
- /* First execute the `op' message in the following method lists */
- __objc_send_message_in_list (method_list->method_next, class, op);
-
- /* Search the method list. */
- for (i = 0; i < method_list->method_count; i++)
- {
- Method_t mth = &method_list->method_list[i];
-
- if (mth->method_name && sel_eq (mth->method_name, op)
- && !hash_is_key_in_hash (__objc_load_methods, mth->method_name))
- {
- /* The method was found and wasn't previously executed. */
- (*mth->method_imp) ((id)class, mth->method_name);
-
- /* Add this method into the +load hash table */
- hash_add (&__objc_load_methods, mth->method_imp, mth->method_imp);
-
- DEBUG_PRINTF ("sending +load in class: %s\n", class->name);
-
- break;
- }
- }
-}
-
-static void
-__objc_send_load (objc_class_tree *tree, int level)
-{
- static SEL load_sel = 0;
- Class class = tree->class;
- MethodList_t method_list = class->class_pointer->methods;
-
- if (!load_sel)
- load_sel = sel_register_name ("load");
-
- __objc_send_message_in_list (method_list, class, load_sel);
-}
-
-static void
-__objc_destroy_class_tree_node (objc_class_tree *tree, int level)
-{
- objc_free (tree);
-}
-
-/* This is used to check if the relationship between two classes before the
- runtime completely installs the classes. */
-static BOOL
-class_is_subclass_of_class (Class class, Class superclass)
-{
- for (; class != Nil;)
- {
- if (class == superclass)
- return YES;
- class = (class->super_class ?
- objc_lookup_class ((char*)class->super_class)
- : Nil);
- }
-
- return NO;
-}
-
-/* This list contains all the classes in the runtime system for whom their
- superclasses are not yet know to the runtime. */
-static struct objc_list* unresolved_classes = 0;
-
-/* Extern function used to reference the Object and NXConstantString classes.
- */
-
-extern void __objc_force_linking (void);
-
-void
-__objc_force_linking (void)
-{
- extern void __objc_linking (void);
- __objc_linking ();
-}
-
-/* Run through the statics list, removing modules as soon as all its statics
- have been initialized. */
-static void
-objc_init_statics (void)
-{
- struct objc_list **cell = &uninitialized_statics;
- struct objc_static_instances **statics_in_module;
-
- objc_mutex_lock(__objc_runtime_mutex);
-
- while (*cell)
- {
- int module_initialized = 1;
-
- for (statics_in_module = (*cell)->head;
- *statics_in_module; statics_in_module++)
- {
- struct objc_static_instances *statics = *statics_in_module;
- Class class = objc_lookup_class (statics->class_name);
-
- if (!class)
- module_initialized = 0;
- /* Actually, the static's class_pointer will be NULL when we
- haven't been here before. However, the comparison is to be
- reminded of taking into account class posing and to think about
- possible semantics... */
- else if (class != statics->instances[0]->class_pointer)
- {
- id *inst;
-
- for (inst = &statics->instances[0]; *inst; inst++)
- {
- (*inst)->class_pointer = class;
-
- /* ??? Make sure the object will not be freed. With
- refcounting, invoke `-retain'. Without refcounting, do
- nothing and hope that `-free' will never be invoked. */
-
- /* ??? Send the object an `-initStatic' or something to
- that effect now or later on? What are the semantics of
- statically allocated instances, besides the trivial
- NXConstantString, anyway? */
- }
- }
- }
- if (module_initialized)
- {
- /* Remove this module from the uninitialized list. */
- struct objc_list *this = *cell;
- *cell = this->tail;
- objc_free(this);
- }
- else
- cell = &(*cell)->tail;
- }
-
- objc_mutex_unlock(__objc_runtime_mutex);
-} /* objc_init_statics */
-
-/* This function is called by constructor functions generated for each
- module compiled. (_GLOBAL_$I$...) The purpose of this function is to
- gather the module pointers so that they may be processed by the
- initialization routines as soon as possible */
-
-void
-__objc_exec_class (Module_t module)
-{
- /* Have we processed any constructors previously? This flag is used to
- indicate that some global data structures need to be built. */
- static BOOL previous_constructors = 0;
-
- static struct objc_list* unclaimed_categories = 0;
-
- /* The symbol table (defined in objc-api.h) generated by gcc */
- Symtab_t symtab = module->symtab;
-
- /* The statics in this module */
- struct objc_static_instances **statics
- = symtab->defs[symtab->cls_def_cnt + symtab->cat_def_cnt];
-
- /* Entry used to traverse hash lists */
- struct objc_list** cell;
-
- /* The table of selector references for this module */
- SEL selectors = symtab->refs;
-
- /* dummy counter */
- int i;
-
- DEBUG_PRINTF ("received module: %s\n", module->name);
-
- /* check gcc version */
- init_check_module_version(module);
-
- /* On the first call of this routine, initialize some data structures. */
- if (!previous_constructors)
- {
- /* Initialize thread-safe system */
- __objc_init_thread_system();
- __objc_runtime_threads_alive = 1;
- __objc_runtime_mutex = objc_mutex_allocate();
-
- __objc_init_selector_tables();
- __objc_init_class_tables();
- __objc_init_dispatch_tables();
- __objc_class_tree_list = list_cons (NULL, __objc_class_tree_list);
- __objc_load_methods
- = hash_new (128, (hash_func_type)hash_ptr, compare_ptrs);
- previous_constructors = 1;
- }
-
- /* Save the module pointer for later processing. (not currently used) */
- objc_mutex_lock(__objc_runtime_mutex);
- __objc_module_list = list_cons(module, __objc_module_list);
-
- /* Replace referenced selectors from names to SEL's. */
- if (selectors)
- {
- for (i = 0; selectors[i].sel_id; ++i)
- {
- const char *name, *type;
- name = (char*)selectors[i].sel_id;
- type = (char*)selectors[i].sel_types;
- /* Constructors are constant static data so we can safely store
- pointers to them in the runtime structures. is_const == YES */
- __sel_register_typed_name (name, type,
- (struct objc_selector*)&(selectors[i]),
- YES);
- }
- }
-
- /* Parse the classes in the load module and gather selector information. */
- DEBUG_PRINTF ("gathering selectors from module: %s\n", module->name);
- for (i = 0; i < symtab->cls_def_cnt; ++i)
- {
- Class class = (Class) symtab->defs[i];
- const char* superclass = (char*)class->super_class;
-
- /* Make sure we have what we think. */
- assert (CLS_ISCLASS(class));
- assert (CLS_ISMETA(class->class_pointer));
- DEBUG_PRINTF ("phase 1, processing class: %s\n", class->name);
-
- /* Initialize the subclass list to be NULL.
- In some cases it isn't and this crashes the program. */
- class->subclass_list = NULL;
-
- /* Store the class in the class table and assign class numbers. */
- __objc_add_class_to_hash (class);
-
- /* Register all of the selectors in the class and meta class. */
- __objc_register_selectors_from_class (class);
- __objc_register_selectors_from_class ((Class) class->class_pointer);
-
- /* Install the fake dispatch tables */
- __objc_install_premature_dtable(class);
- __objc_install_premature_dtable(class->class_pointer);
-
- /* Register the instance methods as class methods, this is
- only done for root classes. */
- __objc_register_instance_methods_to_class(class);
-
- if (class->protocols)
- __objc_init_protocols (class->protocols);
-
- /* Check to see if the superclass is known in this point. If it's not
- add the class to the unresolved_classes list. */
- if (superclass && !objc_lookup_class (superclass))
- unresolved_classes = list_cons (class, unresolved_classes);
- }
-
- /* Process category information from the module. */
- for (i = 0; i < symtab->cat_def_cnt; ++i)
- {
- Category_t category = symtab->defs[i + symtab->cls_def_cnt];
- Class class = objc_lookup_class (category->class_name);
-
- /* If the class for the category exists then append its methods. */
- if (class)
- {
-
- DEBUG_PRINTF ("processing categories from (module,object): %s, %s\n",
- module->name,
- class->name);
-
- /* Do instance methods. */
- if (category->instance_methods)
- class_add_method_list (class, category->instance_methods);
-
- /* Do class methods. */
- if (category->class_methods)
- class_add_method_list ((Class) class->class_pointer,
- category->class_methods);
-
- if (category->protocols)
- {
- __objc_init_protocols (category->protocols);
- __objc_class_add_protocols (class, category->protocols);
- }
-
- /* Register the instance methods as class methods, this is
- only done for root classes. */
- __objc_register_instance_methods_to_class(class);
- }
- else
- {
- /* The object to which the category methods belong can't be found.
- Save the information. */
- unclaimed_categories = list_cons(category, unclaimed_categories);
- }
- }
-
- if (statics)
- uninitialized_statics = list_cons (statics, uninitialized_statics);
- if (uninitialized_statics)
- objc_init_statics ();
-
- /* Scan the unclaimed category hash. Attempt to attach any unclaimed
- categories to objects. */
- for (cell = &unclaimed_categories;
- *cell;
- ({ if (*cell) cell = &(*cell)->tail; }))
- {
- Category_t category = (*cell)->head;
- Class class = objc_lookup_class (category->class_name);
-
- if (class)
- {
- DEBUG_PRINTF ("attaching stored categories to object: %s\n",
- class->name);
-
- list_remove_head (cell);
-
- if (category->instance_methods)
- class_add_method_list (class, category->instance_methods);
-
- if (category->class_methods)
- class_add_method_list ((Class) class->class_pointer,
- category->class_methods);
-
- if (category->protocols)
- {
- __objc_init_protocols (category->protocols);
- __objc_class_add_protocols (class, category->protocols);
- }
-
- /* Register the instance methods as class methods, this is
- only done for root classes. */
- __objc_register_instance_methods_to_class(class);
- }
- }
-
- if (unclaimed_proto_list && objc_lookup_class ("Protocol"))
- {
- list_mapcar (unclaimed_proto_list,(void(*)(void*))__objc_init_protocols);
- list_free (unclaimed_proto_list);
- unclaimed_proto_list = 0;
- }
-
- objc_send_load ();
-
- objc_mutex_unlock(__objc_runtime_mutex);
-}
-
-static void objc_send_load (void)
-{
- if (!__objc_module_list)
- return;
-
- /* Try to find out if all the classes loaded so far also have their
- superclasses known to the runtime. We suppose that the objects that are
- allocated in the +load method are in general of a class declared in the
- same module. */
- if (unresolved_classes)
- {
- Class class = unresolved_classes->head;
-
- while (objc_lookup_class ((char*)class->super_class))
- {
- list_remove_head (&unresolved_classes);
- if (unresolved_classes)
- class = unresolved_classes->head;
- else
- break;
- }
-
- /*
- * If we still have classes for whom we don't have yet their super
- * classes known to the runtime we don't send the +load messages.
- */
- if (unresolved_classes)
- return;
- }
-
- /* Special check to allow creating and sending messages to constant strings
- in +load methods. If these classes are not yet known, even if all the
- other classes are known, delay sending of +load. */
- if (!objc_lookup_class ("NXConstantString") ||
- !objc_lookup_class ("Object"))
- return;
-
- /* Iterate over all modules in the __objc_module_list and call on them the
- __objc_create_classes_tree function. This function creates a tree of
- classes that resembles the class hierarchy. */
- list_mapcar (__objc_module_list, (void(*)(void*))__objc_create_classes_tree);
-
- while (__objc_class_tree_list)
- {
-#ifdef DEBUG
- objc_preorder_traverse (__objc_class_tree_list->head,
- 0, __objc_tree_print);
-#endif
- objc_preorder_traverse (__objc_class_tree_list->head,
- 0, __objc_send_load);
- objc_postorder_traverse (__objc_class_tree_list->head,
- 0, __objc_destroy_class_tree_node);
- list_remove_head (&__objc_class_tree_list);
- }
-
- list_mapcar (__objc_module_list, (void(*)(void*))__objc_call_callback);
- list_free (__objc_module_list);
- __objc_module_list = NULL;
-}
-
-static void
-__objc_create_classes_tree (Module_t module)
-{
- /* The runtime mutex is locked in this point */
-
- Symtab_t symtab = module->symtab;
- int i;
-
- /* Iterate thru classes defined in this module and insert them in the classes
- tree hierarchy. */
- for (i = 0; i < symtab->cls_def_cnt; i++)
- {
- Class class = (Class) symtab->defs[i];
-
- objc_tree_insert_class (class);
- }
-}
-
-static void
-__objc_call_callback (Module_t module)
-{
- /* The runtime mutex is locked in this point */
-
- Symtab_t symtab = module->symtab;
- int i;
-
- /* Iterate thru classes defined in this module and call the callback for
- each one. */
- for (i = 0; i < symtab->cls_def_cnt; i++)
- {
- Class class = (Class) symtab->defs[i];
-
- /* Call the _objc_load_callback for this class. */
- if (_objc_load_callback)
- _objc_load_callback(class, 0);
- }
-
- /* Call the _objc_load_callback for categories. Don't register the instance
- methods as class methods for categories to root classes since they were
- already added in the class. */
- for (i = 0; i < symtab->cat_def_cnt; i++)
- {
- Category_t category = symtab->defs[i + symtab->cls_def_cnt];
- Class class = objc_lookup_class (category->class_name);
-
- if (_objc_load_callback)
- _objc_load_callback(class, category);
- }
-}
-
-/* Sanity check the version of gcc used to compile `module'*/
-static void init_check_module_version(Module_t module)
-{
- if ((module->version != OBJC_VERSION) || (module->size != sizeof (Module)))
- {
- int code;
-
- if(module->version > OBJC_VERSION)
- code = OBJC_ERR_OBJC_VERSION;
- else if (module->version < OBJC_VERSION)
- code = OBJC_ERR_GCC_VERSION;
- else
- code = OBJC_ERR_MODULE_SIZE;
-
- objc_error(nil, code, "Module %s version %d doesn't match runtime %d\n",
- module->name, (int)module->version, OBJC_VERSION);
- }
-}
-
-static void
-__objc_init_protocols (struct objc_protocol_list* protos)
-{
- int i;
- static Class proto_class = 0;
-
- if (! protos)
- return;
-
- objc_mutex_lock(__objc_runtime_mutex);
-
- if (!proto_class)
- proto_class = objc_lookup_class("Protocol");
-
- if (!proto_class)
- {
- unclaimed_proto_list = list_cons (protos, unclaimed_proto_list);
- objc_mutex_unlock(__objc_runtime_mutex);
- return;
- }
-
-#if 0
- assert (protos->next == 0); /* only single ones allowed */
-#endif
-
- for(i = 0; i < protos->count; i++)
- {
- struct objc_protocol* aProto = protos->list[i];
- if (((size_t)aProto->class_pointer) == PROTOCOL_VERSION)
- {
- /* assign class pointer */
- aProto->class_pointer = proto_class;
-
- /* init super protocols */
- __objc_init_protocols (aProto->protocol_list);
- }
- else if (protos->list[i]->class_pointer != proto_class)
- {
- objc_error(nil, OBJC_ERR_PROTOCOL_VERSION,
- "Version %d doesn't match runtime protocol version %d\n",
- (int)((char*)protos->list[i]->class_pointer-(char*)0),
- PROTOCOL_VERSION);
- }
- }
-
- objc_mutex_unlock(__objc_runtime_mutex);
-}
-
-static void __objc_class_add_protocols (Class class,
- struct objc_protocol_list* protos)
-{
- /* Well... */
- if (! protos)
- return;
-
- /* Add it... */
- protos->next = class->protocols;
- class->protocols = protos;
-}
diff --git a/contrib/libobjc/libobjc.def b/contrib/libobjc/libobjc.def
deleted file mode 100644
index a4a6049e816f..000000000000
--- a/contrib/libobjc/libobjc.def
+++ /dev/null
@@ -1,161 +0,0 @@
-; GNU Objective C Runtime DLL Export Definitions
-; Copyright (C) 1997 Free Software Foundation, Inc.
-; Contributed by Scott Christley <scottc@net-community.com>
-;
-; This file is part of GNU CC.
-;
-; GNU CC 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.
-;
-; GNU CC is distributed in the hope that it will be useful, but WITHOUT ANY
-; WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-; FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
-; details.
-;
-; You should have received a copy of the GNU General Public License along with
-; GNU CC; see the file COPYING. If not, write to the Free Software
-; Foundation, 59 Temple Place - Suite 330,
-; Boston, MA 02111-1307, USA.
-
-LIBRARY libobjc
-EXPORTS
-search_for_method_in_list
-objc_get_uninstalled_dtable
-hash_is_key_in_hash
-objc_verror
-_objc_load_callback
-objc_malloc
-objc_atomic_malloc
-objc_valloc
-objc_realloc
-objc_calloc
-objc_free
-__objc_init_thread_system
-objc_mutex_allocate
-objc_mutex_deallocate
-objc_mutex_lock
-objc_mutex_trylock
-objc_mutex_unlock
-objc_thread_detach
-objc_thread_exit
-objc_thread_get_data
-objc_thread_get_priority
-objc_thread_id
-objc_thread_set_data
-objc_thread_set_priority
-objc_thread_yield
-__objc_class_name_Object
-__objc_class_name_Protocol
-__objc_class_name_NXConstantString
-objc_error
-__objc_object_alloc
-__objc_object_copy
-__objc_object_dispose
-class_create_instance
-object_copy
-object_dispose
-__objc_init_selector_tables
-__objc_register_selectors_from_class
-__sel_register_typed_name
-sel_get_any_typed_uid
-sel_get_any_uid
-sel_get_name
-sel_get_type
-sel_get_typed_uid
-sel_get_uid
-sel_is_mapped
-sel_register_name
-sel_register_typed_name
-sel_types_match
-method_get_first_argument
-method_get_next_argument
-method_get_nth_argument
-method_get_number_of_arguments
-method_get_sizeof_arguments
-objc_aligned_size
-objc_alignof_type
-objc_get_type_qualifiers
-objc_promoted_size
-objc_sizeof_type
-objc_skip_argspec
-objc_skip_offset
-objc_skip_type_qualifiers
-objc_skip_typespec
-__objc_read_nbyte_uint
-__objc_read_nbyte_ulong
-__objc_write_class
-__objc_write_object
-__objc_write_selector
-objc_close_typed_stream
-objc_end_of_typed_stream
-objc_flush_typed_stream
-objc_get_stream_class_version
-objc_open_typed_stream
-objc_open_typed_stream_for_file
-objc_read_array
-objc_read_char
-objc_read_int
-objc_read_long
-objc_read_object
-objc_read_selector
-objc_read_short
-objc_read_string
-objc_read_type
-objc_read_types
-objc_read_unsigned_char
-objc_read_unsigned_int
-objc_read_unsigned_long
-objc_read_unsigned_short
-objc_write_array
-objc_write_char
-objc_write_int
-objc_write_long
-objc_write_object
-objc_write_object_reference
-objc_write_root_object
-objc_write_selector
-objc_write_short
-objc_write_string
-objc_write_string_atomic
-objc_write_type
-objc_write_types
-objc_write_unsigned_char
-objc_write_unsigned_int
-objc_write_unsigned_long
-objc_write_unsigned_short
-__objc_exec_class
-__objc_init_dispatch_tables
-__objc_install_premature_dtable
-__objc_print_dtable_stats
-__objc_responds_to
-__objc_update_dispatch_table_for_class
-class_add_method_list
-class_get_class_method
-class_get_instance_method
-get_imp
-nil_method
-objc_msg_lookup
-objc_msg_lookup_super
-objc_msg_sendv
-__objc_add_class_to_hash
-__objc_init_class_tables
-__objc_resolve_class_links
-class_pose_as
-objc_get_class
-objc_get_meta_class
-objc_lookup_class
-objc_next_class
-sarray_at_put
-sarray_at_put_safe
-sarray_free
-sarray_lazy_copy
-sarray_new
-sarray_realloc
-sarray_remove_garbage
-hash_add
-hash_delete
-hash_new
-hash_next
-hash_remove
-hash_value_for_key
diff --git a/contrib/libobjc/libobjc_entry.c b/contrib/libobjc/libobjc_entry.c
deleted file mode 100644
index 2d584ab3c1ef..000000000000
--- a/contrib/libobjc/libobjc_entry.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/* GNU Objective C Runtime DLL Entry
- Copyright (C) 1997 Free Software Foundation, Inc.
- Contributed by Scott Christley <scottc@net-community.com>
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to the Free
-Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with files compiled with
- GCC 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 <windows.h>
-
-/*
- DLL entry function for Objective-C Runtime library
- This function gets called everytime a process/thread attaches to DLL
- */
-WINBOOL WINAPI DllMain(HANDLE hInst, ULONG ul_reason_for_call,
- LPVOID lpReserved)
-{
- switch(ul_reason_for_call)
- {
- case DLL_PROCESS_ATTACH:
- break;
- case DLL_PROCESS_DETACH:
- break;
- case DLL_THREAD_ATTACH:
- break;
- case DLL_THREAD_DETACH:
- break;
- }
- return TRUE;
-}
-
-/*
- This section terminates the list of imports under GCC. If you do not
- include this then you will have problems when linking with DLLs.
- */
-asm (".section .idata$3\n" ".long 0,0,0,0,0,0,0,0");
diff --git a/contrib/libobjc/linking.m b/contrib/libobjc/linking.m
deleted file mode 100644
index 8ecca0281106..000000000000
--- a/contrib/libobjc/linking.m
+++ /dev/null
@@ -1,40 +0,0 @@
-/* Force linking of classes required by Objective C runtime.
- Copyright (C) 1997 Free Software Foundation, Inc.
- Contributed by Ovidiu Predescu (ovidiu@net-community.com).
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with files compiled with
- GCC 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 <objc/Object.h>
-#include <objc/NXConstStr.h>
-
-/* Generate references to Object and NXConstanstString classes since they are
- needed by the runtime system to run correctly. */
-
-
-void __objc_linking (void)
-{
- [Object name];
- [NXConstantString name];
-}
-
diff --git a/contrib/libobjc/makefile.dos b/contrib/libobjc/makefile.dos
deleted file mode 100644
index 3e1b1871e40e..000000000000
--- a/contrib/libobjc/makefile.dos
+++ /dev/null
@@ -1,56 +0,0 @@
-# GNU Objective C Runtime Makefile for compiling with djgpp
-# Copyright (C) 1993, 1994, 1996 Free Software Foundation, Inc.
-#
-# This file is part of GNU CC.
-#
-# GNU CC 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.
-#
-# GNU CC is distributed in the hope that it will be useful, but WITHOUT ANY
-# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
-# details.
-#
-# You should have received a copy of the GNU General Public License along with
-# GNU CC; see the file COPYING. If not, write to the Free Software
-# Foundation, 59 Temple Place - Suite 330,
-# Boston, MA 02111-1307, USA.
-
-# This Makefile is configured for GnuMAKE
-
-GCC_FOR_TARGET=gcc
-
-.SUFFIXES: .o .m
-
-OPTIMIZE = -O2
-
-# Always search these dirs when compiling.
-SUBDIR_INCLUDES = -I. -I.. -I../config
-
-.c.o:
- $(GCC_FOR_TARGET) $(OPTIMIZE) \
- -c $(GCC_CFLAGS) $(SUBDIR_INCLUDES) $<
-
-.m.o:
- $(GCC_FOR_TARGET) $(OPTIMIZE) -fgnu-runtime \
- -c $(GCC_CFLAGS) $(SUBDIR_INCLUDES) $<
-
-OBJC_O = hash.o sarray.o class.o sendmsg.o init.o archive.o \
- selector.o objects.o misc.o object.o protocol.o encoding.o thread.o
-
-libobjc.a: $(OBJC_O)
- -rm -f libobjc.a
- ar rc libobjc.a $(OBJC_O)
- ranlib libobjc.a
-
-OBJC_H = hash.h objc-list.h sarray.h objc.h \
- objc-api.h \
- object.h protocol.h mutex.h \
- typedstream.h thread.h
-
-mostlyclean:
- -rm -f *.o libobjc.a xforward fflags
-clean: mostlyclean
-distclean: mostlyclean
-extraclean: mostlyclean
diff --git a/contrib/libobjc/misc.c b/contrib/libobjc/misc.c
deleted file mode 100644
index 7339888dc280..000000000000
--- a/contrib/libobjc/misc.c
+++ /dev/null
@@ -1,180 +0,0 @@
-/* GNU Objective C Runtime Miscellaneous
- Copyright (C) 1993, 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
- Contributed by Kresten Krab Thorup
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to the Free
-Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with files compiled with
- GCC 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. */
-
-#define __USE_FIXED_PROTOTYPES__
-#include <stdlib.h>
-#include "runtime.h"
-
-/*
-** Error handler function
-** NULL so that default is to just print to stderr
-*/
-static objc_error_handler _objc_error_handler = NULL;
-
-/* Trigger an objc error */
-void
-objc_error(id object, int code, const char* fmt, ...)
-{
- va_list ap;
-
- va_start(ap, fmt);
- objc_verror(object, code, fmt, ap);
- va_end(ap);
-}
-
-/* Trigger an objc error */
-void
-objc_verror(id object, int code, const char* fmt, va_list ap)
-{
- BOOL result = NO;
-
- /* Call the error handler if its there
- Otherwise print to stderr */
- if (_objc_error_handler)
- result = (*_objc_error_handler)(object, code, fmt, ap);
- else
- vfprintf (stderr, fmt, ap);
-
- /* Continue if the error handler says its ok
- Otherwise abort the program */
- if (result)
- return;
- else
- abort();
-}
-
-/* Set the error handler */
-objc_error_handler
-objc_set_error_handler(objc_error_handler func)
-{
- objc_error_handler temp = _objc_error_handler;
- _objc_error_handler = func;
- return temp;
-}
-
-/*
-** Standard functions for memory allocation and disposal.
-** Users should use these functions in their ObjC programs so
-** that they work properly with garbage collectors as well as
-** can take advantage of the exception/error handling available.
-*/
-
-void *
-objc_malloc(size_t size)
-{
- void* res = (void*) (*_objc_malloc)(size);
- if(!res)
- objc_error(nil, OBJC_ERR_MEMORY, "Virtual memory exhausted\n");
- return res;
-}
-
-void *
-objc_atomic_malloc(size_t size)
-{
- void* res = (void*) (*_objc_atomic_malloc)(size);
- if(!res)
- objc_error(nil, OBJC_ERR_MEMORY, "Virtual memory exhausted\n");
- return res;
-}
-
-void *
-objc_valloc(size_t size)
-{
- void* res = (void*) (*_objc_valloc)(size);
- if(!res)
- objc_error(nil, OBJC_ERR_MEMORY, "Virtual memory exhausted\n");
- return res;
-}
-
-void *
-objc_realloc(void *mem, size_t size)
-{
- void* res = (void*) (*_objc_realloc)(mem, size);
- if(!res)
- objc_error(nil, OBJC_ERR_MEMORY, "Virtual memory exhausted\n");
- return res;
-}
-
-void *
-objc_calloc(size_t nelem, size_t size)
-{
- void* res = (void*) (*_objc_calloc)(nelem, size);
- if(!res)
- objc_error(nil, OBJC_ERR_MEMORY, "Virtual memory exhausted\n");
- return res;
-}
-
-void
-objc_free(void *mem)
-{
- (*_objc_free)(mem);
-}
-
-/*
-** Hook functions for memory allocation and disposal.
-** This makes it easy to substitute garbage collection systems
-** such as Boehm's GC by assigning these function pointers
-** to the GC's allocation routines. By default these point
-** to the ANSI standard malloc, realloc, free, etc.
-**
-** Users should call the normal objc routines above for
-** memory allocation and disposal within their programs.
-*/
-
-#if OBJC_WITH_GC
-#include <gc.h>
-
-static void *GC_calloc (size_t nelem, size_t size)
-{
- void* p = GC_malloc (nelem * size);
- if (!p)
- objc_error (nil, OBJC_ERR_MEMORY, "Virtual memory exhausted!\n");
-
- memset (p, 0, nelem * size);
- return p;
-}
-
-static void noFree (void* p) {}
-
-void *(*_objc_malloc)(size_t) = GC_malloc;
-void *(*_objc_atomic_malloc)(size_t) = GC_malloc_atomic;
-void *(*_objc_valloc)(size_t) = GC_malloc;
-void *(*_objc_realloc)(void *, size_t) = GC_realloc;
-void *(*_objc_calloc)(size_t, size_t) = GC_calloc;
-void (*_objc_free)(void *) = noFree;
-
-#else
-
-void *(*_objc_malloc)(size_t) = malloc;
-void *(*_objc_atomic_malloc)(size_t) = malloc;
-void *(*_objc_valloc)(size_t) = malloc;
-void *(*_objc_realloc)(void *, size_t) = realloc;
-void *(*_objc_calloc)(size_t, size_t) = calloc;
-void (*_objc_free)(void *) = free;
-
-
-#endif
diff --git a/contrib/libobjc/nil_method.c b/contrib/libobjc/nil_method.c
deleted file mode 100644
index 1b6212826bda..000000000000
--- a/contrib/libobjc/nil_method.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/* GNU Objective C Runtime nil receiver function
- Copyright (C) 1993, 1995, 1996 Free Software Foundation, Inc.
- Contributed by Kresten Krab Thorup
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
-details.
-
-You should have received a copy of the GNU General Public License along with
-GNU CC; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with files compiled with
- GCC to produce an executable, this does not cause the resulting executable
- to be covered by the GNU General Public License. This exception does not
- however invalidate any other reasons why the executable file might be
- covered by the GNU General Public License. */
-
-/* This is the nil method, the function that is called when the receiver
- of a method is nil */
-
-#include "runtime.h"
-
-id
-nil_method(id receiver, SEL op, ...)
-{
- return receiver;
-}
-
-
-
-
diff --git a/contrib/libobjc/objc-features.texi b/contrib/libobjc/objc-features.texi
deleted file mode 100644
index 819caf6cff0b..000000000000
--- a/contrib/libobjc/objc-features.texi
+++ /dev/null
@@ -1,392 +0,0 @@
-\input texinfo @c -*-texinfo-*-
-@c %**start of header
-@setfilename objc-features.info
-@settitle GNU Objective-C runtime features
-@setchapternewpage odd
-@c %**end of header
-
-@node Top, Executing code before main, , (dir), (dir)
-@comment node-name, next, previous, up
-
-@chapter GNU Objective-C runtime features
-
-This document is meant to describe some of the GNU Objective-C runtime
-features. It is not intended to teach you Objective-C, there are several
-resources on the Internet that present the language. Questions and
-comments about this document to Ovidiu Predescu
-@code{<ovidiu@@cup.hp.com>}.
-
-@menu
-* Executing code before main::
-* Type encoding::
-* Garbage Collection::
-@end menu
-
-
-@node Executing code before main, What you can and what you cannot do in +load, Top, Top
-@section @code{+load}: Executing code before main
-
-
-The GNU Objective-C runtime provides a way that allows you to execute
-code before the execution of the program enters the @code{main}
-function. The code is executed on a per-class and a per-category basis,
-through a special class method @code{+load}.
-
-This facility is very useful if you want to initialize global variables
-which can be accessed by the program directly, without sending a message
-to the class first. The usual way to initialize global variables, in the
-@code{+initialize} method, might not be useful because
-@code{+initialize} is only called when the first message is sent to a
-class object, which in some cases could be too late.
-
-Suppose for example you have a @code{FileStream} class that declares
-@code{Stdin}, @code{Stdout} and @code{Stderr} as global variables, like
-below:
-
-@example
-
-FileStream *Stdin = nil;
-FileStream *Stdout = nil;
-FileStream *Stderr = nil;
-
-@@implementation FileStream
-
-+ (void)initialize
-@{
- Stdin = [[FileStream new] initWithFd:0];
- Stdout = [[FileStream new] initWithFd:1];
- Stderr = [[FileStream new] initWithFd:2];
-@}
-
-/* Other methods here */
-@@end
-
-@end example
-
-In this example, the initialization of @code{Stdin}, @code{Stdout} and
-@code{Stderr} in @code{+initialize} occurs too late. The programmer can
-send a message to one of these objects before the variables are actually
-initialized, thus sending messages to the @code{nil} object. The
-@code{+initialize} method which actually initializes the global
-variables is not invoked until the first message is sent to the class
-object. The solution would require these variables to be initialized
-just before entering @code{main}.
-
-The correct solution of the above problem is to use the @code{+load}
-method instead of @code{+initialize}:
-
-@example
-
-@@implementation FileStream
-
-+ (void)load
-@{
- Stdin = [[FileStream new] initWithFd:0];
- Stdout = [[FileStream new] initWithFd:1];
- Stderr = [[FileStream new] initWithFd:2];
-@}
-
-/* Other methods here */
-@@end
-
-@end example
-
-The @code{+load} is a method that is not overridden by categories. If a
-class and a category of it both implement @code{+load}, both methods are
-invoked. This allows some additional initializations to be performed in
-a category.
-
-This mechanism is not intended to be a replacement for @code{+initialize}.
-You should be aware of its limitations when you decide to use it
-instead of @code{+initialize}.
-
-@menu
-* What you can and what you cannot do in +load::
-@end menu
-
-
-@node What you can and what you cannot do in +load, Type encoding, Executing code before main, Executing code before main
-@subsection What you can and what you cannot do in @code{+load}
-
-The +load implementation in the GNU runtime guarantees you the following
-things:
-
-@itemize @bullet
-
-@item
-you can write whatever C code you like;
-
-@item
-you can send messages to Objective-C constant strings (@@"this is a
-constant string");
-
-@item
-you can allocate and send messages to objects whose class is implemented
-in the same file;
-
-@item
-the @code{+load} implementation of all super classes of a class are executed before the @code{+load} of that class is executed;
-
-@item
-the @code{+load} implementation of a class is executed before the
-@code{+load} implementation of any category.
-
-@end itemize
-
-In particular, the following things, even if they can work in a
-particular case, are not guaranteed:
-
-@itemize @bullet
-
-@item
-allocation of or sending messages to arbitrary objects;
-
-@item
-allocation of or sending messages to objects whose classes have a
-category implemented in the same file;
-
-@end itemize
-
-You should make no assumptions about receiving @code{+load} in sibling
-classes when you write @code{+load} of a class. The order in which
-sibling classes receive @code{+load} is not guaranteed.
-
-The order in which @code{+load} and @code{+initialize} are called could
-be problematic if this matters. If you don't allocate objects inside
-@code{+load}, it is guaranteed that @code{+load} is called before
-@code{+initialize}. If you create an object inside @code{+load} the
-@code{+initialize} method of object's class is invoked even if
-@code{+load} was not invoked. Note if you explicitly call @code{+load}
-on a class, @code{+initialize} will be called first. To avoid possible
-problems try to implement only one of these methods.
-
-The @code{+load} method is also invoked when a bundle is dynamically
-loaded into your running program. This happens automatically without any
-intervening operation from you. When you write bundles and you need to
-write @code{+load} you can safely create and send messages to objects whose
-classes already exist in the running program. The same restrictions as
-above apply to classes defined in bundle.
-
-
-
-@node Type encoding, Garbage Collection, What you can and what you cannot do in +load, Top
-@section Type encoding
-
-The Objective-C compiler generates type encodings for all the
-types. These type encodings are used at runtime to find out information
-about selectors and methods and about objects and classes.
-
-The types are encoded in the following way:
-
-@c @sp 1
-
-@multitable @columnfractions .25 .75
-@item @code{char}
-@tab @code{c}
-@item @code{unsigned char}
-@tab @code{C}
-@item @code{short}
-@tab @code{s}
-@item @code{unsigned short}
-@tab @code{S}
-@item @code{int}
-@tab @code{i}
-@item @code{unsigned int}
-@tab @code{I}
-@item @code{long}
-@tab @code{l}
-@item @code{unsigned long}
-@tab @code{L}
-@item @code{long long}
-@tab @code{q}
-@item @code{unsigned long long}
-@tab @code{Q}
-@item @code{float}
-@tab @code{f}
-@item @code{double}
-@tab @code{d}
-@item @code{void}
-@tab @code{v}
-@item @code{id}
-@tab @code{@@}
-@item @code{Class}
-@tab @code{#}
-@item @code{SEL}
-@tab @code{:}
-@item @code{char*}
-@tab @code{*}
-@item unknown type
-@tab @code{?}
-@item bitfields
-@tab @code{b} followed by the starting position of the bitfield, the type of the bitfield and the size of the bitfield (the bitfields encoding was changed from the NeXT's compiler encoding, see below)
-@end multitable
-
-@c @sp 1
-
-The encoding of bitfields has changed to allow bitfields to be properly
-handled by the runtime functions that compute sizes and alignments of
-types that contain bitfields. The previous encoding contained only the
-size of the bitfield. Using only this information it is not possible to
-reliably compute the size occupied by the bitfield. This is very
-important in the presence of the Boehm's garbage collector because the
-objects are allocated using the typed memory facility available in this
-collector. The typed memory allocation requires information about where
-the pointers are located inside the object.
-
-The position in the bitfield is the position, counting in bits, of the
-bit closest to the beginning of the structure.
-
-The non-atomic types are encoded as follows:
-
-@c @sp 1
-
-@multitable @columnfractions .2 .8
-@item pointers
-@tab @code{'^'} followed by the pointed type.
-@item arrays
-@tab @code{'['} followed by the number of elements in the array followed by the type of the elements followed by @code{']'}
-@item structures
-@tab @code{'@{'} followed by the name of the structure (or '?' if the structure is unnamed), the '=' sign, the type of the members and by @code{'@}'}
-@item unions
-@tab @code{'('} followed by the name of the structure (or '?' if the union is unnamed), the '=' sign, the type of the members followed by @code{')'}
-@end multitable
-
-Here are some types and their encodings, as they are generated by the
-compiler on a i386 machine:
-
-@sp 1
-
-@multitable @columnfractions .25 .75
-@item Objective-C type
-@tab Compiler encoding
-@item
-@example
-int a[10];
-@end example
-@tab @code{[10i]}
-@item
-@example
-struct @{
- int i;
- float f[3];
- int a:3;
- int b:2;
- char c;
-@}
-@end example
-@tab @code{@{?=i[3f]b128i3b131i2c@}}
-@end multitable
-
-@sp 1
-
-In addition to the types the compiler also encodes the type
-specifiers. The table below describes the encoding of the current
-Objective-C type specifiers:
-
-@sp 1
-
-@multitable @columnfractions .25 .75
-@item Specifier
-@tab Encoding
-@item @code{const}
-@tab @code{r}
-@item @code{in}
-@tab @code{n}
-@item @code{inout}
-@tab @code{N}
-@item @code{out}
-@tab @code{o}
-@item @code{bycopy}
-@tab @code{O}
-@item @code{oneway}
-@tab @code{V}
-@end multitable
-
-@sp 1
-
-The type specifiers are encoded just before the type. Unlike types
-however, the type specifiers are only encoded when they appear in method
-argument types.
-
-
-@node Garbage Collection, , Type encoding, Top
-
-@page
-@section Garbage Collection
-
-Support for a new memory management policy has been added by using a
-powerful conservative garbage collector, known as the
-Boehm-Demers-Weiser conservative garbage collector. It is available from
-@w{@uref{http://reality.sgi.com/boehm_mti/gc.html}}.
-
-To enable the support for it you have to configure the compiler using an
-additional argument, @w{@kbd{--enable-objc-gc}}. You need to have
-garbage collector installed before building the compiler. This will
-build an additional runtime library which has several enhancements to
-support the garbage collector. The new library has a new name,
-@kbd{libobjc_gc.a} to not conflict with the non-garbage-collected
-library.
-
-When the garbage collector is used, the objects are allocated using the
-so-called typed memory allocation mechanism available in the
-Boehm-Demers-Weiser collector. This mode requires precise information on
-where pointers are located inside objects. This information is computed
-once per class, immediately after the class has been initialized.
-
-There is a new runtime function @code{class_ivar_set_gcinvisible()}
-which can be used to declare a so-called @strong{weak pointer}
-reference. Such a pointer is basically hidden for the garbage collector;
-this can be useful in certain situations, especially when you want to
-keep track of the allocated objects, yet allow them to be
-collected. This kind of pointers can only be members of objects, you
-cannot declare a global pointer as a weak reference. Every type which is
-a pointer type can be declared a weak pointer, including @code{id},
-@code{Class} and @code{SEL}.
-
-Here is an example of how to use this feature. Suppose you want to
-implement a class whose instances hold a weak pointer reference; the
-following class does this:
-
-@example
-
-@@interface WeakPointer : Object
-@{
- const void* weakPointer;
-@}
-
-- initWithPointer:(const void*)p;
-- (const void*)weakPointer;
-@@end
-
-
-@@implementation WeakPointer
-
-+ (void)initialize
-@{
- class_ivar_set_gcinvisible (self, "weakPointer", YES);
-@}
-
-- initWithPointer:(const void*)p
-@{
- weakPointer = p;
- return self;
-@}
-
-- (const void*)weakPointer
-@{
- return weakPointer;
-@}
-
-@@end
-
-@end example
-
-Weak pointers are supported through a new type character specifier
-represented by the @code{'!'} character. The
-@code{class_ivar_set_gcinvisible()} function adds or removes this
-specifier to the string type description of the instance variable named
-as argument.
-
-
-@bye
-
diff --git a/contrib/libobjc/objc/NXConstStr.h b/contrib/libobjc/objc/NXConstStr.h
deleted file mode 100644
index c9799544a029..000000000000
--- a/contrib/libobjc/objc/NXConstStr.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Interface for the NXConstantString class for Objective-C.
- Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by Pieter J. Schoenmakers <tiggr@es.ele.tue.nl>
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
-License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with files
- compiled with GCC to produce an executable, this does not cause
- the resulting executable to be covered by the GNU General Public License.
- This exception does not however invalidate any other reasons why
- the executable file might be covered by the GNU General Public License. */
-
-#ifndef __nxconstantstring_INCLUDE_GNU
-#define __nxconstantstring_INCLUDE_GNU
-
-#include "objc/Object.h"
-
-@interface NXConstantString: Object
-{
- char *c_string;
- unsigned int len;
-}
-
--(const char *) cString;
--(unsigned int) length;
-
-@end
-
-#endif
diff --git a/contrib/libobjc/objc/Object.h b/contrib/libobjc/objc/Object.h
deleted file mode 100644
index a762acc3f7db..000000000000
--- a/contrib/libobjc/objc/Object.h
+++ /dev/null
@@ -1,124 +0,0 @@
-/* Interface for the Object class for Objective-C.
- Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
-License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with files compiled
- with GCC to produce an executable, this does not cause the resulting
- executable to be covered by the GNU General Public License. This
- exception does not however invalidate any other reasons why the
- executable file might be covered by the GNU General Public License. */
-
-#ifndef __object_INCLUDE_GNU
-#define __object_INCLUDE_GNU
-
-#include <objc/objc.h>
-#include <objc/typedstream.h>
-
-/*
- * All classes are derived from Object. As such,
- * this is the overhead tacked onto those objects.
- */
-@interface Object
-{
- Class isa; /* A pointer to the instance's class structure */
-}
-
- /* Initializing classes and instances */
-+ initialize;
-- init;
-
- /* Creating, freeing, and copying instances */
-+ new;
-+ alloc;
-- free;
-- copy;
-- shallowCopy;
-- deepen;
-- deepCopy;
-
- /* Identifying classes */
-- (Class)class;
-- (Class)superClass;
-- (MetaClass)metaClass;
-- (const char *)name;
-
- /* Identifying and comparing objects */
-- self;
-- (unsigned int)hash;
-- (BOOL)isEqual:anObject;
-- (int)compare:anotherObject;
-
- /* Testing object type */
-- (BOOL)isMetaClass;
-- (BOOL)isClass;
-- (BOOL)isInstance;
-
- /* Testing inheritance relationships */
-- (BOOL)isKindOf:(Class)aClassObject;
-- (BOOL)isMemberOf:(Class)aClassObject;
-- (BOOL)isKindOfClassNamed:(const char *)aClassName;
-- (BOOL)isMemberOfClassNamed:(const char *)aClassName;
-
- /* Testing class functionality */
-+ (BOOL)instancesRespondTo:(SEL)aSel;
-- (BOOL)respondsTo:(SEL)aSel;
-
- /* Testing protocol conformance */
-- (BOOL)conformsTo:(Protocol*)aProtocol;
-
- /* Introspection */
-+ (IMP)instanceMethodFor:(SEL)aSel;
-- (IMP)methodFor:(SEL)aSel;
-+ (struct objc_method_description *)descriptionForInstanceMethod:(SEL)aSel;
-- (struct objc_method_description *)descriptionForMethod:(SEL)aSel;
-
- /* Sending messages determined at run time */
-- perform:(SEL)aSel;
-- perform:(SEL)aSel with:anObject;
-- perform:(SEL)aSel with:anObject1 with:anObject2;
-
- /* Forwarding */
-- (retval_t)forward:(SEL)aSel :(arglist_t)argFrame;
-- (retval_t)performv:(SEL)aSel :(arglist_t)argFrame;
-
- /* Posing */
-+ poseAs:(Class)aClassObject;
-- (Class)transmuteClassTo:(Class)aClassObject;
-
- /* Enforcing intentions */
-- subclassResponsibility:(SEL)aSel;
-- notImplemented:(SEL)aSel;
-- shouldNotImplement:(SEL)aSel;
-
- /* Error handling */
-- doesNotRecognize:(SEL)aSel;
-- error:(const char *)aString, ...;
-
- /* Archiving */
-+ (int)version;
-+ setVersion:(int)aVersion;
-+ (int)streamVersion: (TypedStream*)aStream;
-
-- read: (TypedStream*)aStream;
-- write: (TypedStream*)aStream;
-- awake;
-
-@end
-
-#endif
diff --git a/contrib/libobjc/objc/Protocol.h b/contrib/libobjc/objc/Protocol.h
deleted file mode 100644
index f54b7cd2393a..000000000000
--- a/contrib/libobjc/objc/Protocol.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/* Declare the class Protocol for Objective C programs.
- Copyright (C) 1993 Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with files
- compiled with GCC to produce an executable, this does not cause
- the resulting executable to be covered by the GNU General Public License.
- This exception does not however invalidate any other reasons why
- the executable file might be covered by the GNU General Public License. */
-
-#ifndef __Protocol_INCLUDE_GNU
-#define __Protocol_INCLUDE_GNU
-
-#include "objc/Object.h"
-
-@interface Protocol : Object
-{
-@private
- char *protocol_name;
- struct objc_protocol_list *protocol_list;
- struct objc_method_description_list *instance_methods, *class_methods;
-}
-
-/* Obtaining attributes intrinsic to the protocol */
-
-- (const char *)name;
-
-/* Testing protocol conformance */
-
-- (BOOL) conformsTo: (Protocol *)aProtocolObject;
-
-/* Looking up information specific to a protocol */
-
-- (struct objc_method_description *) descriptionForInstanceMethod:(SEL)aSel;
-- (struct objc_method_description *) descriptionForClassMethod:(SEL)aSel;
-
-@end
-
-
-
-
-#endif /* not __Protocol_INCLUDE_GNU */
diff --git a/contrib/libobjc/objc/encoding.h b/contrib/libobjc/objc/encoding.h
deleted file mode 100644
index b4def4302b53..000000000000
--- a/contrib/libobjc/objc/encoding.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/* Encoding of types for Objective C.
- Copyright (C) 1993, 1997 Free Software Foundation, Inc.
-
-Author: Kresten Krab Thorup
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with files
- compiled with GCC to produce an executable, this does not cause
- the resulting executable to be covered by the GNU General Public License.
- This exception does not however invalidate any other reasons why
- the executable file might be covered by the GNU General Public License. */
-
-#ifndef __encoding_INCLUDE_GNU
-#define __encoding_INCLUDE_GNU
-
-#include <ctype.h>
-#include "objc/objc-api.h"
-
-#define _C_CONST 'r'
-#define _C_IN 'n'
-#define _C_INOUT 'N'
-#define _C_OUT 'o'
-#define _C_BYCOPY 'O'
-#define _C_BYREF 'R'
-#define _C_ONEWAY 'V'
-#define _C_GCINVISIBLE '!'
-
-#define _F_CONST 0x01
-#define _F_IN 0x01
-#define _F_OUT 0x02
-#define _F_INOUT 0x03
-#define _F_BYCOPY 0x04
-#define _F_BYREF 0x08
-#define _F_ONEWAY 0x10
-#define _F_GCINVISIBLE 0x20
-
-int objc_aligned_size (const char* type);
-int objc_sizeof_type (const char* type);
-int objc_alignof_type (const char* type);
-int objc_aligned_size (const char* type);
-int objc_promoted_size (const char* type);
-
-const char* objc_skip_type_qualifiers (const char* type);
-const char* objc_skip_typespec (const char* type);
-const char* objc_skip_offset (const char* type);
-const char* objc_skip_argspec (const char* type);
-int method_get_number_of_arguments (struct objc_method*);
-int method_get_sizeof_arguments (struct objc_method*);
-
-char* method_get_first_argument (struct objc_method*,
- arglist_t argframe,
- const char** type);
-char* method_get_next_argument (arglist_t argframe,
- const char **type);
-char* method_get_nth_argument (struct objc_method* m,
- arglist_t argframe,
- int arg,
- const char **type);
-
-unsigned objc_get_type_qualifiers (const char* type);
-
-
-struct objc_struct_layout
-{
- const char *original_type;
- const char *type;
- const char *prev_type;
- unsigned int record_size;
- unsigned int record_align;
-};
-
-void objc_layout_structure (const char *type,
- struct objc_struct_layout *layout);
-BOOL objc_layout_structure_next_member (struct objc_struct_layout *layout);
-void objc_layout_finish_structure (struct objc_struct_layout *layout,
- unsigned int *size,
- unsigned int *align);
-void objc_layout_structure_get_info (struct objc_struct_layout *layout,
- unsigned int *offset,
- unsigned int *align,
- const char **type);
-
-#endif /* __encoding_INCLUDE_GNU */
diff --git a/contrib/libobjc/objc/hash.h b/contrib/libobjc/objc/hash.h
deleted file mode 100644
index bddb791c820c..000000000000
--- a/contrib/libobjc/objc/hash.h
+++ /dev/null
@@ -1,206 +0,0 @@
-/* Hash tables for Objective C method dispatch.
- Copyright (C) 1993, 1995, 1996 Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with files
- compiled with GCC to produce an executable, this does not cause
- the resulting executable to be covered by the GNU General Public License.
- This exception does not however invalidate any other reasons why
- the executable file might be covered by the GNU General Public License. */
-
-
-#ifndef __hash_INCLUDE_GNU
-#define __hash_INCLUDE_GNU
-
-#include <stddef.h>
-#include <objc/objc.h>
-
-/*
- * This data structure is used to hold items
- * stored in a hash table. Each node holds
- * a key/value pair.
- *
- * Items in the cache are really of type void *.
- */
-typedef struct cache_node
-{
- struct cache_node *next; /* Pointer to next entry on the list.
- NULL indicates end of list. */
- const void *key; /* Key used to locate the value. Used
- to locate value when more than one
- key computes the same hash
- value. */
- void *value; /* Value stored for the key. */
-} *node_ptr;
-
-
-/*
- * This data type is the function that computes a hash code given a key.
- * Therefore, the key can be a pointer to anything and the function specific
- * to the key type.
- *
- * Unfortunately there is a mutual data structure reference problem with this
- * typedef. Therefore, to remove compiler warnings the functions passed to
- * hash_new will have to be casted to this type.
- */
-typedef unsigned int (*hash_func_type)(void *, const void *);
-
-/*
- * This data type is the function that compares two hash keys and returns an
- * integer greater than, equal to, or less than 0, according as the first
- * parameter is lexicographically greater than, equal to, or less than the
- * second.
- */
-
-typedef int (*compare_func_type)(const void *, const void *);
-
-
-/*
- * This data structure is the cache.
- *
- * It must be passed to all of the hashing routines
- * (except for new).
- */
-typedef struct cache
-{
- /* Variables used to implement the hash itself. */
- node_ptr *node_table; /* Pointer to an array of hash nodes. */
- /* Variables used to track the size of the hash table so to determine
- when to resize it. */
- unsigned int size; /* Number of buckets allocated for the hash table
- (number of array entries allocated for
- "node_table"). Must be a power of two. */
- unsigned int used; /* Current number of entries in the hash table. */
- unsigned int mask; /* Precomputed mask. */
-
- /* Variables used to implement indexing through the hash table. */
-
- unsigned int last_bucket; /* Tracks which entry in the array where
- the last value was returned. */
- /* Function used to compute a hash code given a key.
- This function is specified when the hash table is created. */
- hash_func_type hash_func;
- /* Function used to compare two hash keys to see if they are equal. */
- compare_func_type compare_func;
-} *cache_ptr;
-
-
-/* Two important hash tables. */
-extern cache_ptr module_hash_table, class_hash_table;
-
-/* Allocate and initialize a hash table. */
-
-cache_ptr hash_new (unsigned int size,
- hash_func_type hash_func,
- compare_func_type compare_func);
-
-/* Deallocate all of the hash nodes and the cache itself. */
-
-void hash_delete (cache_ptr cache);
-
-/* Add the key/value pair to the hash table. If the
- hash table reaches a level of fullness then it will be resized.
-
- assert if the key is already in the hash. */
-
-void hash_add (cache_ptr *cachep, const void *key, void *value);
-
-/* Remove the key/value pair from the hash table.
- assert if the key isn't in the table. */
-
-void hash_remove (cache_ptr cache, const void *key);
-
-/* Used to index through the hash table. Start with NULL
- to get the first entry.
-
- Successive calls pass the value returned previously.
- ** Don't modify the hash during this operation ***
-
- Cache nodes are returned such that key or value can
- be extracted. */
-
-node_ptr hash_next (cache_ptr cache, node_ptr node);
-
-/* Used to return a value from a hash table using a given key. */
-
-void *hash_value_for_key (cache_ptr cache, const void *key);
-
-/* Used to determine if the given key exists in the hash table */
-
-BOOL hash_is_key_in_hash (cache_ptr cache, const void *key);
-
-/************************************************
-
- Useful hashing functions.
-
- Declared inline for your pleasure.
-
-************************************************/
-
-/* Calculate a hash code by performing some
- manipulation of the key pointer. (Use the lowest bits
- except for those likely to be 0 due to alignment.) */
-
-static inline unsigned int
-hash_ptr (cache_ptr cache, const void *key)
-{
- return ((size_t)key / sizeof (void *)) & cache->mask;
-}
-
-
-/* Calculate a hash code by iterating over a NULL
- terminate string. */
-static inline unsigned int
-hash_string (cache_ptr cache, const void *key)
-{
- unsigned int ret = 0;
- unsigned int ctr = 0;
-
-
- while (*(char*)key) {
- ret ^= *(char*)key++ << ctr;
- ctr = (ctr + 1) % sizeof (void *);
- }
-
- return ret & cache->mask;
-}
-
-
-/* Compare two pointers for equality. */
-static inline int
-compare_ptrs (const void *k1, const void *k2)
-{
- return !(k1 - k2);
-}
-
-
-/* Compare two strings. */
-static inline int
-compare_strings (const void *k1, const void *k2)
-{
- if (k1 == k2)
- return 1;
- else if (k1 == 0 || k2 == 0)
- return 0;
- else
- return !strcmp (k1, k2);
-}
-
-
-#endif /* not __hash_INCLUDE_GNU */
diff --git a/contrib/libobjc/objc/objc-api.h b/contrib/libobjc/objc/objc-api.h
deleted file mode 100644
index fe34dafb8956..000000000000
--- a/contrib/libobjc/objc/objc-api.h
+++ /dev/null
@@ -1,597 +0,0 @@
-/* GNU Objective-C Runtime API.
- Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
-License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with files compiled
- with GCC to produce an executable, this does not cause the resulting
- executable to be covered by the GNU General Public License. This
- exception does not however invalidate any other reasons why the
- executable file might be covered by the GNU General Public License. */
-
-#ifndef __objc_api_INCLUDE_GNU
-#define __objc_api_INCLUDE_GNU
-
-#include "objc/objc.h"
-#include "objc/hash.h"
-#include "objc/thr.h"
-#include <stdio.h>
-#include <stdarg.h>
-
-/* For functions which return Method_t */
-#define METHOD_NULL (Method_t)0
- /* Boolean typedefs */
-/*
-** Method descriptor returned by introspective Object methods.
-** This is really just the first part of the more complete objc_method
-** structure defined below and used internally by the runtime.
-*/
-struct objc_method_description
-{
- SEL name; /* this is a selector, not a string */
- char *types; /* type encoding */
-};
-
-/* Filer types used to describe Ivars and Methods. */
-#define _C_ID '@'
-#define _C_CLASS '#'
-#define _C_SEL ':'
-#define _C_CHR 'c'
-#define _C_UCHR 'C'
-#define _C_SHT 's'
-#define _C_USHT 'S'
-#define _C_INT 'i'
-#define _C_UINT 'I'
-#define _C_LNG 'l'
-#define _C_ULNG 'L'
-#define _C_LNG_LNG 'q'
-#define _C_ULNG_LNG 'Q'
-#define _C_FLT 'f'
-#define _C_DBL 'd'
-#define _C_BFLD 'b'
-#define _C_VOID 'v'
-#define _C_UNDEF '?'
-#define _C_PTR '^'
-#define _C_CHARPTR '*'
-#define _C_ATOM '%'
-#define _C_ARY_B '['
-#define _C_ARY_E ']'
-#define _C_UNION_B '('
-#define _C_UNION_E ')'
-#define _C_STRUCT_B '{'
-#define _C_STRUCT_E '}'
-
-
-/*
-** Error handling
-**
-** Call objc_error() or objc_verror() to record an error; this error
-** routine will generally exit the program but not necessarily if the
-** user has installed his own error handler.
-**
-** Call objc_set_error_handler to assign your own function for
-** handling errors. The function should return YES if it is ok
-** to continue execution, or return NO or just abort if the
-** program should be stopped. The default error handler is just to
-** print a message on stderr.
-**
-** The error handler function should be of type objc_error_handler
-** The first parameter is an object instance of relevance.
-** The second parameter is an error code.
-** The third parameter is a format string in the printf style.
-** The fourth parameter is a variable list of arguments.
-*/
-extern void objc_error(id object, int code, const char* fmt, ...);
-extern void objc_verror(id object, int code, const char* fmt, va_list ap);
-typedef BOOL (*objc_error_handler)(id, int code, const char *fmt, va_list ap);
-objc_error_handler objc_set_error_handler(objc_error_handler func);
-
-/*
-** Error codes
-** These are used by the runtime library, and your
-** error handling may use them to determine if the error is
-** hard or soft thus whether execution can continue or abort.
-*/
-#define OBJC_ERR_UNKNOWN 0 /* Generic error */
-
-#define OBJC_ERR_OBJC_VERSION 1 /* Incorrect runtime version */
-#define OBJC_ERR_GCC_VERSION 2 /* Incorrect compiler version */
-#define OBJC_ERR_MODULE_SIZE 3 /* Bad module size */
-#define OBJC_ERR_PROTOCOL_VERSION 4 /* Incorrect protocol version */
-
-#define OBJC_ERR_MEMORY 10 /* Out of memory */
-
-#define OBJC_ERR_RECURSE_ROOT 20 /* Attempt to archive the root
- object more than once. */
-#define OBJC_ERR_BAD_DATA 21 /* Didn't read expected data */
-#define OBJC_ERR_BAD_KEY 22 /* Bad key for object */
-#define OBJC_ERR_BAD_CLASS 23 /* Unknown class */
-#define OBJC_ERR_BAD_TYPE 24 /* Bad type specification */
-#define OBJC_ERR_NO_READ 25 /* Cannot read stream */
-#define OBJC_ERR_NO_WRITE 26 /* Cannot write stream */
-#define OBJC_ERR_STREAM_VERSION 27 /* Incorrect stream version */
-#define OBJC_ERR_BAD_OPCODE 28 /* Bad opcode */
-
-#define OBJC_ERR_UNIMPLEMENTED 30 /* Method is not implemented */
-
-#define OBJC_ERR_BAD_STATE 40 /* Bad thread state */
-
-/*
-** Set this variable nonzero to print a line describing each
-** message that is sent. (this is currently disabled)
-*/
-extern BOOL objc_trace;
-
-
-/* For every class which happens to have statically allocated instances in
- this module, one OBJC_STATIC_INSTANCES is allocated by the compiler.
- INSTANCES is NULL terminated and points to all statically allocated
- instances of this class. */
-struct objc_static_instances
-{
- char *class_name;
- id instances[0];
-};
-
-/*
-** Whereas a Module (defined further down) is the root (typically) of a file,
-** a Symtab is the root of the class and category definitions within the
-** module.
-**
-** A Symtab contains a variable length array of pointers to classes and
-** categories defined in the module.
-*/
-typedef struct objc_symtab {
- unsigned long sel_ref_cnt; /* Unknown. */
- SEL refs; /* Unknown. */
- unsigned short cls_def_cnt; /* Number of classes compiled
- (defined) in the module. */
- unsigned short cat_def_cnt; /* Number of categories
- compiled (defined) in the
- module. */
-
- void *defs[1]; /* Variable array of pointers.
- cls_def_cnt of type Class
- followed by cat_def_cnt of
- type Category_t, followed
- by a NULL terminated array
- of objc_static_instances. */
-} Symtab, *Symtab_t;
-
-
-/*
-** The compiler generates one of these structures for each module that
-** composes the executable (eg main.m).
-**
-** This data structure is the root of the definition tree for the module.
-**
-** A collect program runs between ld stages and creates a ObjC ctor array.
-** That array holds a pointer to each module structure of the executable.
-*/
-typedef struct objc_module {
- unsigned long version; /* Compiler revision. */
- unsigned long size; /* sizeof(Module). */
- const char* name; /* Name of the file where the
- module was generated. The
- name includes the path. */
-
- Symtab_t symtab; /* Pointer to the Symtab of
- the module. The Symtab
- holds an array of
- pointers to
- the classes and categories
- defined in the module. */
-} Module, *Module_t;
-
-
-/*
-** The compiler generates one of these structures for a class that has
-** instance variables defined in its specification.
-*/
-typedef struct objc_ivar* Ivar_t;
-typedef struct objc_ivar_list {
- int ivar_count; /* Number of structures (Ivar)
- contained in the list. One
- structure per instance
- variable defined in the
- class. */
- struct objc_ivar {
- const char* ivar_name; /* Name of the instance
- variable as entered in the
- class definition. */
- const char* ivar_type; /* Description of the Ivar's
- type. Useful for
- debuggers. */
- int ivar_offset; /* Byte offset from the base
- address of the instance
- structure to the variable. */
-
- } ivar_list[1]; /* Variable length
- structure. */
-} IvarList, *IvarList_t;
-
-
-/*
-** The compiler generates one (or more) of these structures for a class that
-** has methods defined in its specification.
-**
-** The implementation of a class can be broken into separate pieces in a file
-** and categories can break them across modules. To handle this problem is a
-** singly linked list of methods.
-*/
-typedef struct objc_method Method;
-typedef Method* Method_t;
-typedef struct objc_method_list {
- struct objc_method_list* method_next; /* This variable is used to link
- a method list to another. It
- is a singly linked list. */
- int method_count; /* Number of methods defined in
- this structure. */
- struct objc_method {
- SEL method_name; /* This variable is the method's
- name. It is a char*.
- The unique integer passed to
- objc_msg_send is a char* too.
- It is compared against
- method_name using strcmp. */
- const char* method_types; /* Description of the method's
- parameter list. Useful for
- debuggers. */
- IMP method_imp; /* Address of the method in the
- executable. */
- } method_list[1]; /* Variable length
- structure. */
-} MethodList, *MethodList_t;
-
-struct objc_protocol_list {
- struct objc_protocol_list *next;
- int count;
- Protocol *list[1];
-};
-
-/*
-** This is used to assure consistent access to the info field of
-** classes
-*/
-#ifndef HOST_BITS_PER_LONG
-#define HOST_BITS_PER_LONG (sizeof(long)*8)
-#endif
-
-#define __CLS_INFO(cls) ((cls)->info)
-#define __CLS_ISINFO(cls, mask) ((__CLS_INFO(cls)&mask)==mask)
-#define __CLS_SETINFO(cls, mask) (__CLS_INFO(cls) |= mask)
-
-/* The structure is of type MetaClass */
-#define _CLS_META 0x2L
-#define CLS_ISMETA(cls) ((cls)&&__CLS_ISINFO(cls, _CLS_META))
-
-
-/* The structure is of type Class */
-#define _CLS_CLASS 0x1L
-#define CLS_ISCLASS(cls) ((cls)&&__CLS_ISINFO(cls, _CLS_CLASS))
-
-/*
-** The class is initialized within the runtime. This means that
-** it has had correct super and sublinks assigned
-*/
-#define _CLS_RESOLV 0x8L
-#define CLS_ISRESOLV(cls) __CLS_ISINFO(cls, _CLS_RESOLV)
-#define CLS_SETRESOLV(cls) __CLS_SETINFO(cls, _CLS_RESOLV)
-
-/*
-** The class has been send a +initialize message or a such is not
-** defined for this class
-*/
-#define _CLS_INITIALIZED 0x04L
-#define CLS_ISINITIALIZED(cls) __CLS_ISINFO(cls, _CLS_INITIALIZED)
-#define CLS_SETINITIALIZED(cls) __CLS_SETINFO(cls, _CLS_INITIALIZED)
-
-/*
-** The class number of this class. This must be the same for both the
-** class and its meta class object
-*/
-#define CLS_GETNUMBER(cls) (__CLS_INFO(cls) >> (HOST_BITS_PER_LONG/2))
-#define CLS_SETNUMBER(cls, num) \
- ({ (cls)->info <<= (HOST_BITS_PER_LONG/2); \
- (cls)->info >>= (HOST_BITS_PER_LONG/2); \
- __CLS_SETINFO(cls, (((unsigned long)num) << (HOST_BITS_PER_LONG/2))); })
-
-/*
-** The compiler generates one of these structures for each category. A class
-** may have many categories and contain both instance and factory methods.
-*/
-typedef struct objc_category {
- const char* category_name; /* Name of the category. Name
- contained in the () of the
- category definition. */
- const char* class_name; /* Name of the class to which
- the category belongs. */
- MethodList_t instance_methods; /* Linked list of instance
- methods defined in the
- category. NULL indicates no
- instance methods defined. */
- MethodList_t class_methods; /* Linked list of factory
- methods defined in the
- category. NULL indicates no
- class methods defined. */
- struct objc_protocol_list *protocols; /* List of Protocols
- conformed to */
-} Category, *Category_t;
-
-/*
-** Structure used when a message is send to a class's super class. The
-** compiler generates one of these structures and passes it to
-** objc_msg_super.
-*/
-typedef struct objc_super {
- id self; /* Id of the object sending
- the message. */
- Class class; /* Object's super class. */
-} Super, *Super_t;
-
-IMP objc_msg_lookup_super(Super_t super, SEL sel);
-
-retval_t objc_msg_sendv(id, SEL, arglist_t);
-
-
-
-/*
-** This is a hook which is called by objc_lookup_class and
-** objc_get_class if the runtime is not able to find the class.
-** This may e.g. try to load in the class using dynamic loading.
-** The function is guaranteed to be passed a non-NULL name string.
-*/
-extern Class (*_objc_lookup_class)(const char *name);
-
-/*
-** This is a hook which is called by __objc_exec_class every time a class
-** or a category is loaded into the runtime. This may e.g. help a
-** dynamic loader determine the classes that have been loaded when
-** an object file is dynamically linked in.
-*/
-extern void (*_objc_load_callback)(Class class, Category* category);
-
-/*
-** Hook functions for allocating, copying and disposing of instances
-*/
-extern id (*_objc_object_alloc)(Class class);
-extern id (*_objc_object_copy)(id object);
-extern id (*_objc_object_dispose)(id object);
-
-/*
-** Standard functions for memory allocation and disposal.
-** Users should use these functions in their ObjC programs so
-** that they work properly with garbage collectors as well as
-** can take advantage of the exception/error handling available.
-*/
-void *
-objc_malloc(size_t size);
-
-void *
-objc_atomic_malloc(size_t size);
-
-void *
-objc_valloc(size_t size);
-
-void *
-objc_realloc(void *mem, size_t size);
-
-void *
-objc_calloc(size_t nelem, size_t size);
-
-void
-objc_free(void *mem);
-
-/*
-** Hook functions for memory allocation and disposal.
-** This makes it easy to substitute garbage collection systems
-** such as Boehm's GC by assigning these function pointers
-** to the GC's allocation routines. By default these point
-** to the ANSI standard malloc, realloc, free, etc.
-**
-** Users should call the normal objc routines above for
-** memory allocation and disposal within their programs.
-*/
-extern void *(*_objc_malloc)(size_t);
-extern void *(*_objc_atomic_malloc)(size_t);
-extern void *(*_objc_valloc)(size_t);
-extern void *(*_objc_realloc)(void *, size_t);
-extern void *(*_objc_calloc)(size_t, size_t);
-extern void (*_objc_free)(void *);
-
-Method_t class_get_class_method(MetaClass class, SEL aSel);
-
-Method_t class_get_instance_method(Class class, SEL aSel);
-
-Class class_pose_as(Class impostor, Class superclass);
-
-Class objc_get_class(const char *name);
-
-Class objc_lookup_class(const char *name);
-
-Class objc_next_class(void **enum_state);
-
-const char *sel_get_name(SEL selector);
-
-const char *sel_get_type(SEL selector);
-
-SEL sel_get_uid(const char *name);
-
-SEL sel_get_any_uid(const char *name);
-
-SEL sel_get_any_typed_uid(const char *name);
-
-SEL sel_get_typed_uid(const char *name, const char*);
-
-SEL sel_register_name(const char *name);
-
-SEL sel_register_typed_name(const char *name, const char*type);
-
-
-BOOL sel_is_mapped (SEL aSel);
-
-extern id class_create_instance(Class class);
-
-static inline const char *
-class_get_class_name(Class class)
-{
- return CLS_ISCLASS(class)?class->name:((class==Nil)?"Nil":0);
-}
-
-static inline long
-class_get_instance_size(Class class)
-{
- return CLS_ISCLASS(class)?class->instance_size:0;
-}
-
-static inline MetaClass
-class_get_meta_class(Class class)
-{
- return CLS_ISCLASS(class)?class->class_pointer:Nil;
-}
-
-static inline Class
-class_get_super_class(Class class)
-{
- return CLS_ISCLASS(class)?class->super_class:Nil;
-}
-
-static inline int
-class_get_version(Class class)
-{
- return CLS_ISCLASS(class)?class->version:-1;
-}
-
-static inline BOOL
-class_is_class(Class class)
-{
- return CLS_ISCLASS(class);
-}
-
-static inline BOOL
-class_is_meta_class(Class class)
-{
- return CLS_ISMETA(class);
-}
-
-
-static inline void
-class_set_version(Class class, long version)
-{
- if (CLS_ISCLASS(class))
- class->version = version;
-}
-
-static inline void *
-class_get_gc_object_type (Class class)
-{
- return CLS_ISCLASS(class) ? class->gc_object_type : NULL;
-}
-
-/* Mark the instance variable as innaccessible to the garbage collector */
-extern void class_ivar_set_gcinvisible (Class class,
- const char* ivarname,
- BOOL gcInvisible);
-
-static inline IMP
-method_get_imp(Method_t method)
-{
- return (method!=METHOD_NULL)?method->method_imp:(IMP)0;
-}
-
-IMP get_imp (Class class, SEL sel);
-
-/* Redefine on NeXTSTEP so as not to conflict with system function */
-#ifdef __NeXT__
-#define object_copy gnu_object_copy
-#define object_dispose gnu_object_dispose
-#endif
-
-id object_copy(id object);
-
-id object_dispose(id object);
-
-static inline Class
-object_get_class(id object)
-{
- return ((object!=nil)
- ? (CLS_ISCLASS(object->class_pointer)
- ? object->class_pointer
- : (CLS_ISMETA(object->class_pointer)
- ? (Class)object
- : Nil))
- : Nil);
-}
-
-static inline const char *
-object_get_class_name(id object)
-{
- return ((object!=nil)?(CLS_ISCLASS(object->class_pointer)
- ?object->class_pointer->name
- :((Class)object)->name)
- :"Nil");
-}
-
-static inline MetaClass
-object_get_meta_class(id object)
-{
- return ((object!=nil)?(CLS_ISCLASS(object->class_pointer)
- ?object->class_pointer->class_pointer
- :(CLS_ISMETA(object->class_pointer)
- ?object->class_pointer
- :Nil))
- :Nil);
-}
-
-static inline Class
-object_get_super_class
-(id object)
-{
- return ((object!=nil)?(CLS_ISCLASS(object->class_pointer)
- ?object->class_pointer->super_class
- :(CLS_ISMETA(object->class_pointer)
- ?((Class)object)->super_class
- :Nil))
- :Nil);
-}
-
-static inline BOOL
-object_is_class(id object)
-{
- return CLS_ISCLASS((Class)object);
-}
-
-static inline BOOL
-object_is_instance(id object)
-{
- return (object!=nil)&&CLS_ISCLASS(object->class_pointer);
-}
-
-static inline BOOL
-object_is_meta_class(id object)
-{
- return CLS_ISMETA((Class)object);
-}
-
-struct sarray*
-objc_get_uninstalled_dtable(void);
-
-#endif /* not __objc_api_INCLUDE_GNU */
-
-
-
diff --git a/contrib/libobjc/objc/objc-list.h b/contrib/libobjc/objc/objc-list.h
deleted file mode 100644
index de083a5861e5..000000000000
--- a/contrib/libobjc/objc/objc-list.h
+++ /dev/null
@@ -1,147 +0,0 @@
-/* Generic single linked list to keep various information
- Copyright (C) 1993, 1994, 1996 Free Software Foundation, Inc.
- Contributed by Kresten Krab Thorup.
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with files compiled with
- GCC to produce an executable, this does not cause the resulting executable
- to be covered by the GNU General Public License. This exception does not
- however invalidate any other reasons why the executable file might be
- covered by the GNU General Public License. */
-
-#ifndef __GNU_OBJC_LIST_H
-#define __GNU_OBJC_LIST_H
-
-struct objc_list {
- void *head;
- struct objc_list *tail;
-};
-
-/* Return a cons cell produced from (head . tail) */
-
-static inline struct objc_list*
-list_cons(void* head, struct objc_list* tail)
-{
- struct objc_list* cell;
-
- cell = (struct objc_list*)objc_malloc(sizeof(struct objc_list));
- cell->head = head;
- cell->tail = tail;
- return cell;
-}
-
-/* Return the length of a list, list_length(NULL) returns zero */
-
-static inline int
-list_length(struct objc_list* list)
-{
- int i = 0;
- while(list)
- {
- i += 1;
- list = list->tail;
- }
- return i;
-}
-
-/* Return the Nth element of LIST, where N count from zero. If N
- larger than the list length, NULL is returned */
-
-static inline void*
-list_nth(int index, struct objc_list* list)
-{
- while(index-- != 0)
- {
- if(list->tail)
- list = list->tail;
- else
- return 0;
- }
- return list->head;
-}
-
-/* Remove the element at the head by replacing it by its successor */
-
-static inline void
-list_remove_head(struct objc_list** list)
-{
- if ((*list)->tail)
- {
- struct objc_list* tail = (*list)->tail; /* fetch next */
- *(*list) = *tail; /* copy next to list head */
- objc_free(tail); /* free next */
- }
- else /* only one element in list */
- {
- objc_free(*list);
- (*list) = 0;
- }
-}
-
-
-/* Remove the element with `car' set to ELEMENT */
-
-static inline void
-list_remove_elem(struct objc_list** list, void* elem)
-{
- while (*list) {
- if ((*list)->head == elem)
- list_remove_head(list);
- list = &((*list)->tail);
- }
-}
-
-/* Map FUNCTION over all elements in LIST */
-
-static inline void
-list_mapcar(struct objc_list* list, void(*function)(void*))
-{
- while(list)
- {
- (*function)(list->head);
- list = list->tail;
- }
-}
-
-/* Return element that has ELEM as car */
-
-static inline struct objc_list**
-list_find(struct objc_list** list, void* elem)
-{
- while(*list)
- {
- if ((*list)->head == elem)
- return list;
- list = &((*list)->tail);
- }
- return NULL;
-}
-
-/* Free list (backwards recursive) */
-
-static void
-list_free(struct objc_list* list)
-{
- if(list)
- {
- list_free(list->tail);
- objc_free(list);
- }
-}
-#endif /* not __GNU_OBJC_LIST_H */
diff --git a/contrib/libobjc/objc/objc.h b/contrib/libobjc/objc/objc.h
deleted file mode 100644
index 79b2519e5765..000000000000
--- a/contrib/libobjc/objc/objc.h
+++ /dev/null
@@ -1,158 +0,0 @@
-/* Basic data types for Objective C.
- Copyright (C) 1993, 1995, 1996 Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with files
- compiled with GCC to produce an executable, this does not cause
- the resulting executable to be covered by the GNU General Public License.
- This exception does not however invalidate any other reasons why
- the executable file might be covered by the GNU General Public License. */
-
-#ifndef __objc_INCLUDE_GNU
-#define __objc_INCLUDE_GNU
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <stddef.h>
-
-/*
-** Definition of the boolean type.
-*/
-#ifdef __vxworks
-typedef int BOOL;
-#else
-typedef unsigned char BOOL;
-#endif
-#define YES (BOOL)1
-#define NO (BOOL)0
-
-/*
-** Definition of a selector. Selectors themselves are not unique, but
-** the sel_id is a unique identifier.
-*/
-typedef const struct objc_selector
-{
- void *sel_id;
- const char *sel_types;
-} *SEL;
-
-inline static BOOL
-sel_eq (SEL s1, SEL s2)
-{
- if (s1 == 0 || s2 == 0)
- return s1 == s2;
- else
- return s1->sel_id == s2->sel_id;
-}
-
-
-/*
-** ObjC uses this typedef for untyped instances.
-*/
-typedef struct objc_object {
- struct objc_class* class_pointer;
-} *id;
-
-/*
-** Definition of method type. When retrieving the implementation of a
-** method, this is type of the pointer returned
-*/
-typedef id (*IMP)(id, SEL, ...);
-
-/*
-** More simple types...
-*/
-#define nil (id)0 /* id of Nil instance */
-#define Nil (Class)0 /* id of Nil class */
-typedef char *STR; /* String alias */
-
-/*
-** The compiler generates one of these structures for each class.
-**
-** This structure is the definition for classes.
-**
-** This structure is generated by the compiler in the executable and used by
-** the run-time during normal messaging operations. Therefore some members
-** change type. The compiler generates "char* const" and places a string in
-** the following member variables: super_class.
-*/
-typedef struct objc_class *MetaClass;
-typedef struct objc_class *Class;
-struct objc_class {
- MetaClass class_pointer; /* Pointer to the class's
- meta class. */
- struct objc_class* super_class; /* Pointer to the super
- class. NULL for class
- Object. */
- const char* name; /* Name of the class. */
- long version; /* Unknown. */
- unsigned long info; /* Bit mask. See class masks
- defined above. */
- long instance_size; /* Size in bytes of the class.
- The sum of the class
- definition and all super
- class definitions. */
- struct objc_ivar_list* ivars; /* Pointer to a structure that
- describes the instance
- variables in the class
- definition. NULL indicates
- no instance variables. Does
- not include super class
- variables. */
- struct objc_method_list* methods; /* Linked list of instance
- methods defined for the
- class. */
- struct sarray * dtable; /* Pointer to instance
- method dispatch table. */
- struct objc_class* subclass_list; /* Subclasses */
- struct objc_class* sibling_class;
-
- struct objc_protocol_list *protocols; /* Protocols conformed to */
- void* gc_object_type;
-};
-
-#ifndef __OBJC__
-typedef struct objc_protocol {
- struct objc_class* class_pointer;
- char *protocol_name;
- struct objc_protocol_list *protocol_list;
- struct objc_method_description_list *instance_methods, *class_methods;
-} Protocol;
-
-#else /* __OBJC__ */
-@class Protocol;
-#endif
-
-typedef void* retval_t; /* return value */
-typedef void(*apply_t)(void); /* function pointer */
-typedef union {
- char *arg_ptr;
- char arg_regs[sizeof (char*)];
-} *arglist_t; /* argument frame */
-
-
-IMP objc_msg_lookup(id receiver, SEL op);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* not __objc_INCLUDE_GNU */
diff --git a/contrib/libobjc/objc/runtime.h b/contrib/libobjc/objc/runtime.h
deleted file mode 100644
index b0eae4a222d3..000000000000
--- a/contrib/libobjc/objc/runtime.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/* GNU Objective C Runtime internal declarations
- Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
- Contributed by Kresten Krab Thorup
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
-details.
-
-You should have received a copy of the GNU General Public License along with
-GNU CC; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with files compiled with
- GCC to produce an executable, this does not cause the resulting executable
- to be covered by the GNU General Public License. This exception does not
- however invalidate any other reasons why the executable file might be
- covered by the GNU General Public License. */
-
-#ifndef __objc_runtime_INCLUDE_GNU
-#define __objc_runtime_INCLUDE_GNU
-
-#include <stdarg.h> /* for varargs and va_list's */
-
-#include <stdio.h>
-#include <ctype.h>
-
-#include <stddef.h> /* so noone else will get system versions */
-#include "assert.h"
-
-#include "objc/objc.h" /* core data types */
-#include "objc/objc-api.h" /* runtime api functions */
-
-#include "objc/thr.h" /* thread and mutex support */
-
-#include "objc/hash.h" /* hash structures */
-#include "objc/objc-list.h" /* linear lists */
-
-extern void __objc_add_class_to_hash(Class); /* (objc-class.c) */
-extern void __objc_init_selector_tables(void); /* (objc-sel.c) */
-extern void __objc_init_class_tables(void); /* (objc-class.c) */
-extern void __objc_init_dispatch_tables(void); /* (objc-dispatch.c) */
-extern void __objc_install_premature_dtable(Class); /* (objc-dispatch.c) */
-extern void __objc_resolve_class_links(void); /* (objc-class.c) */
-extern void __objc_register_selectors_from_class(Class); /* (objc-sel.c) */
-extern void __objc_update_dispatch_table_for_class (Class);/* (objc-msg.c) */
-
-extern int __objc_init_thread_system(void); /* thread.c */
-extern int __objc_fini_thread_system(void); /* thread.c */
-extern void __objc_print_dtable_stats(void); /* sendmsg.c */
-
-extern void class_add_method_list(Class, MethodList_t);
-
-/* Registering instance methods as class methods for root classes */
-extern void __objc_register_instance_methods_to_class(Class);
-extern Method_t search_for_method_in_list(MethodList_t list, SEL op);
-
-/* True when class links has been resolved */
-extern BOOL __objc_class_links_resolved;
-
-/* Number of selectors stored in each of the selector tables */
-extern int __objc_selector_max_index;
-
-/* Mutex locking __objc_selector_max_index and its arrays. */
-extern objc_mutex_t __objc_runtime_mutex;
-
-/* Number of threads which are alive. */
-extern int __objc_runtime_threads_alive;
-
-#ifdef DEBUG
-#define DEBUG_PRINTF(format, args...) printf (format, ## args)
-#else
-#define DEBUG_PRINTF(format, args...)
-#endif
-
-BOOL __objc_responds_to (id object, SEL sel); /* for internal use only! */
-SEL __sel_register_typed_name (const char*, const char*,
- struct objc_selector*, BOOL is_const);
-
-#endif /* not __objc_runtime_INCLUDE_GNU */
-
-
diff --git a/contrib/libobjc/objc/sarray.h b/contrib/libobjc/objc/sarray.h
deleted file mode 100644
index 17da27203641..000000000000
--- a/contrib/libobjc/objc/sarray.h
+++ /dev/null
@@ -1,237 +0,0 @@
-/* Sparse Arrays for Objective C dispatch tables
- Copyright (C) 1993, 1995, 1996 Free Software Foundation, Inc.
- Contributed by Kresten Krab Thorup.
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with files
- compiled with GCC to produce an executable, this does not cause
- the resulting executable to be covered by the GNU General Public License.
- This exception does not however invalidate any other reasons why
- the executable file might be covered by the GNU General Public License. */
-
-#ifndef __sarray_INCLUDE_GNU
-#define __sarray_INCLUDE_GNU
-
-#define OBJC_SPARSE2 /* 2-level sparse array */
-/* #define OBJC_SPARSE3 */ /* 3-level sparse array */
-
-#ifdef OBJC_SPARSE2
-extern const char* __objc_sparse2_id;
-#endif
-
-#ifdef OBJC_SPARSE3
-extern const char* __objc_sparse3_id;
-#endif
-
-#include <stddef.h>
-
-#include "objc/thr.h"
-
-extern int nbuckets; /* for stats */
-extern int nindices;
-extern int narrays;
-extern int idxsize;
-
-#include <assert.h>
-
-/* An unsigned integer of same size as a pointer */
-#define SIZET_BITS (sizeof(size_t)*8)
-
-#if defined(__sparc__) || defined(OBJC_SPARSE2)
-#define PRECOMPUTE_SELECTORS
-#endif
-
-#ifdef OBJC_SPARSE3
-
-/* Buckets are 8 words each */
-#define BUCKET_BITS 3
-#define BUCKET_SIZE (1<<BUCKET_BITS)
-#define BUCKET_MASK (BUCKET_SIZE-1)
-
-/* Indices are 16 words each */
-#define INDEX_BITS 4
-#define INDEX_SIZE (1<<INDEX_BITS)
-#define INDEX_MASK (INDEX_SIZE-1)
-
-#define INDEX_CAPACITY (BUCKET_SIZE*INDEX_SIZE)
-
-#else /* OBJC_SPARSE2 */
-
-/* Buckets are 32 words each */
-#define BUCKET_BITS 5
-#define BUCKET_SIZE (1<<BUCKET_BITS)
-#define BUCKET_MASK (BUCKET_SIZE-1)
-
-#endif /* OBJC_SPARSE2 */
-
-typedef size_t sidx;
-
-#ifdef PRECOMPUTE_SELECTORS
-
-struct soffset {
-#ifdef OBJC_SPARSE3
- unsigned int unused : SIZET_BITS/4;
- unsigned int eoffset : SIZET_BITS/4;
- unsigned int boffset : SIZET_BITS/4;
- unsigned int ioffset : SIZET_BITS/4;
-#else /* OBJC_SPARSE2 */
-#ifdef __sparc__
- unsigned long boffset : (SIZET_BITS - 2) - BUCKET_BITS;
- unsigned int eoffset : BUCKET_BITS;
- unsigned int unused : 2;
-#else
- unsigned int boffset : SIZET_BITS/2;
- unsigned int eoffset : SIZET_BITS/2;
-#endif
-#endif /* OBJC_SPARSE2 */
-};
-
-union sofftype {
- struct soffset off;
- sidx idx;
-};
-
-#endif /* not PRECOMPUTE_SELECTORS */
-
-union sversion {
- int version;
- void *next_free;
-};
-
-struct sbucket {
- void* elems[BUCKET_SIZE]; /* elements stored in array */
- union sversion version; /* used for copy-on-write */
-};
-
-#ifdef OBJC_SPARSE3
-
-struct sindex {
- struct sbucket* buckets[INDEX_SIZE];
- union sversion version; /* used for copy-on-write */
-};
-
-#endif /* OBJC_SPARSE3 */
-
-struct sarray {
-#ifdef OBJC_SPARSE3
- struct sindex** indices;
- struct sindex* empty_index;
-#else /* OBJC_SPARSE2 */
- struct sbucket** buckets;
-#endif /* OBJC_SPARSE2 */
- struct sbucket* empty_bucket;
- union sversion version; /* used for copy-on-write */
- short ref_count;
- struct sarray* is_copy_of;
- size_t capacity;
-};
-
-struct sarray* sarray_new(int, void* default_element);
-void sarray_free(struct sarray*);
-struct sarray* sarray_lazy_copy(struct sarray*);
-void sarray_realloc(struct sarray*, int new_size);
-void sarray_at_put(struct sarray*, sidx index, void* elem);
-void sarray_at_put_safe(struct sarray*, sidx index, void* elem);
-
-struct sarray* sarray_hard_copy(struct sarray*); /* ... like the name? */
-void sarray_remove_garbage(void);
-
-
-#ifdef PRECOMPUTE_SELECTORS
-/* Transform soffset values to ints and vica verca */
-static inline unsigned int
-soffset_decode(sidx index)
-{
- union sofftype x;
- x.idx = index;
-#ifdef OBJC_SPARSE3
- return x.off.eoffset
- + (x.off.boffset*BUCKET_SIZE)
- + (x.off.ioffset*INDEX_CAPACITY);
-#else /* OBJC_SPARSE2 */
- return x.off.eoffset + (x.off.boffset*BUCKET_SIZE);
-#endif /* OBJC_SPARSE2 */
-}
-
-static inline sidx
-soffset_encode(size_t offset)
-{
- union sofftype x;
- x.off.eoffset = offset%BUCKET_SIZE;
-#ifdef OBJC_SPARSE3
- x.off.boffset = (offset/BUCKET_SIZE)%INDEX_SIZE;
- x.off.ioffset = offset/INDEX_CAPACITY;
-#else /* OBJC_SPARSE2 */
- x.off.boffset = offset/BUCKET_SIZE;
-#endif
- return (sidx)x.idx;
-}
-
-#else /* not PRECOMPUTE_SELECTORS */
-
-static inline size_t
-soffset_decode(sidx index)
-{
- return index;
-}
-
-static inline sidx
-soffset_encode(size_t offset)
-{
- return offset;
-}
-#endif /* not PRECOMPUTE_SELECTORS */
-
-/* Get element from the Sparse array `array' at offset `index' */
-
-static inline void* sarray_get(struct sarray* array, sidx index)
-{
-#ifdef PRECOMPUTE_SELECTORS
- union sofftype x;
- x.idx = index;
-#ifdef OBJC_SPARSE3
- return
- array->
- indices[x.off.ioffset]->
- buckets[x.off.boffset]->
- elems[x.off.eoffset];
-#else /* OBJC_SPARSE2 */
- return array->buckets[x.off.boffset]->elems[x.off.eoffset];
-#endif /* OBJC_SPARSE2 */
-#else /* not PRECOMPUTE_SELECTORS */
-#ifdef OBJC_SPARSE3
- return array->
- indices[index/INDEX_CAPACITY]->
- buckets[(index/BUCKET_SIZE)%INDEX_SIZE]->
- elems[index%BUCKET_SIZE];
-#else /* OBJC_SPARSE2 */
- return array->buckets[index/BUCKET_SIZE]->elems[index%BUCKET_SIZE];
-#endif /* not OBJC_SPARSE3 */
-#endif /* not PRECOMPUTE_SELECTORS */
-}
-
-static inline void* sarray_get_safe(struct sarray* array, sidx index)
-{
- if(soffset_decode(index) < array->capacity)
- return sarray_get(array, index);
- else
- return (array->empty_bucket->elems[0]);
-}
-
-#endif /* __sarray_INCLUDE_GNU */
diff --git a/contrib/libobjc/objc/thr.h b/contrib/libobjc/objc/thr.h
deleted file mode 100644
index f904733695a8..000000000000
--- a/contrib/libobjc/objc/thr.h
+++ /dev/null
@@ -1,143 +0,0 @@
-/* Thread and mutex controls for Objective C.
- Copyright (C) 1996, 1997 Free Software Foundation, Inc.
- Contributed by Galen C. Hunt (gchunt@cs.rochester.edu)
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC 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.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
-details.
-
-You should have received a copy of the GNU General Public License along with
-GNU CC; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with files
- compiled with GCC to produce an executable, this does not cause
- the resulting executable to be covered by the GNU General Public License.
- This exception does not however invalidate any other reasons why
- the executable file might be covered by the GNU General Public License. */
-
-
-#ifndef __thread_INCLUDE_GNU
-#define __thread_INCLUDE_GNU
-
-#include "objc/objc.h"
-
-/*************************************************************************
- * Universal static variables:
- */
-extern int __objc_thread_exit_status; /* Global exit status. */
-
-/********
- * Thread safe implementation types and functions.
- */
-
-/* Thread priorities */
-#define OBJC_THREAD_INTERACTIVE_PRIORITY 2
-#define OBJC_THREAD_BACKGROUND_PRIORITY 1
-#define OBJC_THREAD_LOW_PRIORITY 0
-
-/* A thread */
-typedef void * objc_thread_t;
-
-/* This structure represents a single mutual exclusion lock. */
-struct objc_mutex
-{
- volatile objc_thread_t owner; /* Id of thread that owns. */
- volatile int depth; /* # of acquires. */
- void * backend; /* Specific to backend */
-};
-typedef struct objc_mutex *objc_mutex_t;
-
-/* This structure represents a single condition mutex */
-struct objc_condition
-{
- void * backend; /* Specific to backend */
-};
-typedef struct objc_condition *objc_condition_t;
-
-/* Frontend mutex functions */
-objc_mutex_t objc_mutex_allocate(void);
-int objc_mutex_deallocate(objc_mutex_t mutex);
-int objc_mutex_lock(objc_mutex_t mutex);
-int objc_mutex_unlock(objc_mutex_t mutex);
-int objc_mutex_trylock(objc_mutex_t mutex);
-
-/* Frontend condition mutex functions */
-objc_condition_t objc_condition_allocate(void);
-int objc_condition_deallocate(objc_condition_t condition);
-int objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex);
-int objc_condition_signal(objc_condition_t condition);
-int objc_condition_broadcast(objc_condition_t condition);
-
-/* Frontend thread functions */
-objc_thread_t objc_thread_detach(SEL selector, id object, id argument);
-void objc_thread_yield(void);
-int objc_thread_exit(void);
-int objc_thread_set_priority(int priority);
-int objc_thread_get_priority(void);
-void * objc_thread_get_data(void);
-int objc_thread_set_data(void *value);
-objc_thread_t objc_thread_id(void);
-
-/*
- Use this to set the hook function that will be called when the
- runtime initially becomes multi threaded.
- The hook function is only called once, meaning only when the
- 2nd thread is spawned, not for each and every thread.
-
- It returns the previous hook function or NULL if there is none.
-
- A program outside of the runtime could set this to some function so
- it can be informed; for example, the GNUstep Base Library sets it
- so it can implement the NSBecomingMultiThreaded notification.
- */
-typedef void (*objc_thread_callback)();
-objc_thread_callback objc_set_thread_callback(objc_thread_callback func);
-
-/* Backend initialization functions */
-int __objc_init_thread_system(void);
-int __objc_fini_thread_system(void);
-
-/* Backend mutex functions */
-int __objc_mutex_allocate(objc_mutex_t mutex);
-int __objc_mutex_deallocate(objc_mutex_t mutex);
-int __objc_mutex_lock(objc_mutex_t mutex);
-int __objc_mutex_trylock(objc_mutex_t mutex);
-int __objc_mutex_unlock(objc_mutex_t mutex);
-
-/* Backend condition mutex functions */
-int __objc_condition_allocate(objc_condition_t condition);
-int __objc_condition_deallocate(objc_condition_t condition);
-int __objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex);
-int __objc_condition_broadcast(objc_condition_t condition);
-int __objc_condition_signal(objc_condition_t condition);
-
-/* Backend thread functions */
-objc_thread_t __objc_thread_detach(void (*func)(void *arg), void *arg);
-int __objc_thread_set_priority(int priority);
-int __objc_thread_get_priority(void);
-void __objc_thread_yield(void);
-int __objc_thread_exit(void);
-objc_thread_t __objc_thread_id(void);
-int __objc_thread_set_data(void *value);
-void * __objc_thread_get_data(void);
-
-#endif /* not __thread_INCLUDE_GNU */
diff --git a/contrib/libobjc/objc/typedstream.h b/contrib/libobjc/objc/typedstream.h
deleted file mode 100644
index eb4642f344be..000000000000
--- a/contrib/libobjc/objc/typedstream.h
+++ /dev/null
@@ -1,132 +0,0 @@
-/* GNU Objective-C Typed Streams interface.
- Copyright (C) 1993, 1995 Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
-License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with files compiled
- with GCC to produce an executable, this does not cause the resulting
- executable to be covered by the GNU General Public License. This
- exception does not however invalidate any other reasons why the
- executable file might be covered by the GNU General Public License. */
-
-#ifndef __typedstream_INCLUDE_GNU
-#define __typedstream_INCLUDE_GNU
-
-#include "objc/objc.h"
-#include "objc/hash.h"
-#include <stdio.h>
-
-typedef int (*objc_typed_read_func)(void*, char*, int);
-typedef int (*objc_typed_write_func)(void*, const char*, int);
-typedef int (*objc_typed_flush_func)(void*);
-typedef int (*objc_typed_eof_func)(void*);
-
-#define OBJC_READONLY 0x01
-#define OBJC_WRITEONLY 0x02
-
-#define OBJC_MANAGED_STREAM 0x01
-#define OBJC_FILE_STREAM 0x02
-#define OBJC_MEMORY_STREAM 0x04
-
-#define OBJC_TYPED_STREAM_VERSION 0x01
-
-typedef struct objc_typed_stream {
- void* physical;
- cache_ptr object_table; /* read/written objects */
- cache_ptr stream_table; /* other read/written but shared things.. */
- cache_ptr class_table; /* class version mapping */
- cache_ptr object_refs; /* forward references */
- int mode; /* OBJC_READONLY or OBJC_WRITEONLY */
- int type; /* MANAGED, FILE, MEMORY etc bit string */
- int version; /* version used when writing */
- int writing_root_p;
- objc_typed_read_func read;
- objc_typed_write_func write;
- objc_typed_eof_func eof;
- objc_typed_flush_func flush;
-} TypedStream;
-
-/* opcode masks */
-#define _B_VALUE 0x1fU
-#define _B_CODE 0xe0U
-#define _B_SIGN 0x10U
-#define _B_NUMBER 0x0fU
-
-/* standard opcodes */
-#define _B_INVALID 0x00U
-#define _B_SINT 0x20U
-#define _B_NINT 0x40U
-#define _B_SSTR 0x60U
-#define _B_NSTR 0x80U
-#define _B_RCOMM 0xa0U
-#define _B_UCOMM 0xc0U
-#define _B_EXT 0xe0U
-
-/* eXtension opcodes */
-#define _BX_OBJECT 0x00U
-#define _BX_CLASS 0x01U
-#define _BX_SEL 0x02U
-#define _BX_OBJREF 0x03U
-#define _BX_OBJROOT 0x04U
-#define _BX_EXT 0x1fU
-
-/*
-** Read and write objects as specified by TYPE. All the `last'
-** arguments are pointers to the objects to read/write.
-*/
-
-int objc_write_type (TypedStream* stream, const char* type, const void* data);
-int objc_read_type (TypedStream* stream, const char* type, void* data);
-
-int objc_write_types (TypedStream* stream, const char* type, ...);
-int objc_read_types (TypedStream* stream, const char* type, ...);
-
-int objc_write_object_reference (TypedStream* stream, id object);
-int objc_write_root_object (TypedStream* stream, id object);
-
-long objc_get_stream_class_version (TypedStream* stream, Class class);
-
-
-/*
-** Convenience functions
-*/
-
-int objc_write_array (TypedStream* stream, const char* type,
- int count, const void* data);
-int objc_read_array (TypedStream* stream, const char* type,
- int count, void* data);
-
-int objc_write_object (TypedStream* stream, id object);
-int objc_read_object (TypedStream* stream, id* object);
-
-
-
-/*
-** Open a typed stream for reading or writing. MODE may be either of
-** OBJC_READONLY or OBJC_WRITEONLY.
-*/
-
-TypedStream* objc_open_typed_stream (FILE* physical, int mode);
-TypedStream* objc_open_typed_stream_for_file (const char* file_name, int mode);
-
-void objc_close_typed_stream (TypedStream* stream);
-
-BOOL objc_end_of_typed_stream (TypedStream* stream);
-void objc_flush_typed_stream (TypedStream* stream);
-
-#endif /* not __typedstream_INCLUDE_GNU */
diff --git a/contrib/libobjc/objects.c b/contrib/libobjc/objects.c
deleted file mode 100644
index df74b85de872..000000000000
--- a/contrib/libobjc/objects.c
+++ /dev/null
@@ -1,105 +0,0 @@
-/* GNU Objective C Runtime class related functions
- Copyright (C) 1993, 1995, 1996 Free Software Foundation, Inc.
- Contributed by Kresten Krab Thorup
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
-details.
-
-You should have received a copy of the GNU General Public License along with
-GNU CC; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with files compiled with
- GCC 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 "tconfig.h" /* include defs of bzero for target */
-#include "objc.h"
-#include "runtime.h" /* the kitchen sink */
-
-#if OBJC_WITH_GC
-# include <gc.h>
-#endif
-
-id __objc_object_alloc(Class);
-id __objc_object_dispose(id);
-id __objc_object_copy(id);
-
-id (*_objc_object_alloc)(Class) = __objc_object_alloc; /* !T:SINGLE */
-id (*_objc_object_dispose)(id) = __objc_object_dispose; /* !T:SINGLE */
-id (*_objc_object_copy)(id) = __objc_object_copy; /* !T:SINGLE */
-
-id
-class_create_instance(Class class)
-{
- id new = nil;
-
-#if OBJC_WITH_GC
- if (CLS_ISCLASS(class))
- new = (id)GC_malloc_explicitly_typed (class->instance_size,
- class->gc_object_type);
-#else
- if (CLS_ISCLASS(class))
- new = (*_objc_object_alloc)(class);
-#endif
-
- if (new!=nil)
- {
- memset (new, 0, class->instance_size);
- new->class_pointer = class;
- }
- return new;
-}
-
-id
-object_copy(id object)
-{
- if ((object!=nil)&&CLS_ISCLASS(object->class_pointer))
- return (*_objc_object_copy)(object);
- else
- return nil;
-}
-
-id
-object_dispose(id object)
-{
- if ((object!=nil)&&CLS_ISCLASS(object->class_pointer))
- {
- if (_objc_object_dispose)
- (*_objc_object_dispose)(object);
- else
- objc_free(object);
- }
- return nil;
-}
-
-id __objc_object_alloc(Class class)
-{
- return (id)objc_malloc(class->instance_size);
-}
-
-id __objc_object_dispose(id object)
-{
- objc_free(object);
- return 0;
-}
-
-id __objc_object_copy(id object)
-{
- id copy = class_create_instance(object->class_pointer);
- memcpy(copy, object, object->class_pointer->instance_size);
- return copy;
-}
-
-
diff --git a/contrib/libobjc/sarray.c b/contrib/libobjc/sarray.c
deleted file mode 100644
index f5ace10bf092..000000000000
--- a/contrib/libobjc/sarray.c
+++ /dev/null
@@ -1,522 +0,0 @@
-/* Sparse Arrays for Objective C dispatch tables
- Copyright (C) 1993, 1995, 1996 Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with files
- compiled with GCC 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 "sarray.h"
-#include "runtime.h"
-#include <stdio.h>
-#include "assert.h"
-
-int nbuckets = 0; /* !T:MUTEX */
-int nindices = 0; /* !T:MUTEX */
-int narrays = 0; /* !T:MUTEX */
-int idxsize = 0; /* !T:MUTEX */
-
-static void * first_free_data = NULL; /* !T:MUTEX */
-
-#ifdef OBJC_SPARSE2
-const char* __objc_sparse2_id = "2 level sparse indices";
-#endif
-
-#ifdef OBJC_SPARSE3
-const char* __objc_sparse3_id = "3 level sparse indices";
-#endif
-
-#ifdef __alpha__
-const void *memcpy (void*, const void*, size_t);
-#endif
-
-/* This function removes any structures left over from free operations
- that were not safe in a multi-threaded environment. */
-void
-sarray_remove_garbage(void)
-{
- void **vp;
- void *np;
-
- objc_mutex_lock(__objc_runtime_mutex);
-
- vp = first_free_data;
- first_free_data = NULL;
-
- while (vp) {
- np = *vp;
- objc_free(vp);
- vp = np;
- }
-
- objc_mutex_unlock(__objc_runtime_mutex);
-}
-
-/* Free a block of dynamically allocated memory. If we are in multi-threaded
- mode, it is ok to free it. If not, we add it to the garbage heap to be
- freed later. */
-
-static void
-sarray_free_garbage(void *vp)
-{
- objc_mutex_lock(__objc_runtime_mutex);
-
- if (__objc_runtime_threads_alive == 1) {
- objc_free(vp);
- if (first_free_data)
- sarray_remove_garbage();
- }
- else {
- *(void **)vp = first_free_data;
- first_free_data = vp;
- }
-
- objc_mutex_unlock(__objc_runtime_mutex);
-}
-
-/* sarray_at_put : copies data in such a way as to be thread reader safe. */
-void
-sarray_at_put(struct sarray* array, sidx index, void* element)
-{
-#ifdef OBJC_SPARSE3
- struct sindex** the_index;
- struct sindex* new_index;
-#endif
- struct sbucket** the_bucket;
- struct sbucket* new_bucket;
-#ifdef OBJC_SPARSE3
- size_t ioffset;
-#endif
- size_t boffset;
- size_t eoffset;
-#ifdef PRECOMPUTE_SELECTORS
- union sofftype xx;
- xx.idx = index;
-#ifdef OBJC_SPARSE3
- ioffset = xx.off.ioffset;
-#endif
- boffset = xx.off.boffset;
- eoffset = xx.off.eoffset;
-#else /* not PRECOMPUTE_SELECTORS */
-#ifdef OBJC_SPARSE3
- ioffset = index/INDEX_CAPACITY;
- boffset = (index/BUCKET_SIZE)%INDEX_SIZE;
- eoffset = index%BUCKET_SIZE;
-#else
- boffset = index/BUCKET_SIZE;
- eoffset = index%BUCKET_SIZE;
-#endif
-#endif /* not PRECOMPUTE_SELECTORS */
-
- assert(soffset_decode(index) < array->capacity); /* Range check */
-
-#ifdef OBJC_SPARSE3
- the_index = &(array->indices[ioffset]);
- the_bucket = &((*the_index)->buckets[boffset]);
-#else
- the_bucket = &(array->buckets[boffset]);
-#endif
-
- if ((*the_bucket)->elems[eoffset] == element)
- return; /* great! we just avoided a lazy copy */
-
-#ifdef OBJC_SPARSE3
-
- /* First, perform lazy copy/allocation of index if needed */
-
- if ((*the_index) == array->empty_index) {
-
- /* The index was previously empty, allocate a new */
- new_index = (struct sindex*)objc_malloc(sizeof(struct sindex));
- memcpy(new_index, array->empty_index, sizeof(struct sindex));
- new_index->version.version = array->version.version;
- *the_index = new_index; /* Prepared for install. */
- the_bucket = &((*the_index)->buckets[boffset]);
-
- nindices += 1;
- } else if ((*the_index)->version.version != array->version.version) {
-
- /* This index must be lazy copied */
- struct sindex* old_index = *the_index;
- new_index = (struct sindex*)objc_malloc(sizeof(struct sindex));
- memcpy( new_index, old_index, sizeof(struct sindex));
- new_index->version.version = array->version.version;
- *the_index = new_index; /* Prepared for install. */
- the_bucket = &((*the_index)->buckets[boffset]);
-
- nindices += 1;
- }
-
-#endif /* OBJC_SPARSE3 */
-
- /* next, perform lazy allocation/copy of the bucket if needed */
-
- if ((*the_bucket) == array->empty_bucket) {
-
- /* The bucket was previously empty (or something like that), */
- /* allocate a new. This is the effect of `lazy' allocation */
- new_bucket = (struct sbucket*)objc_malloc(sizeof(struct sbucket));
- memcpy((void *) new_bucket, (const void*)array->empty_bucket,
- sizeof(struct sbucket));
- new_bucket->version.version = array->version.version;
- *the_bucket = new_bucket; /* Prepared for install. */
-
- nbuckets += 1;
-
- } else if ((*the_bucket)->version.version != array->version.version) {
-
- /* Perform lazy copy. */
- struct sbucket* old_bucket = *the_bucket;
- new_bucket = (struct sbucket*)objc_malloc(sizeof(struct sbucket));
- memcpy( new_bucket, old_bucket, sizeof(struct sbucket));
- new_bucket->version.version = array->version.version;
- *the_bucket = new_bucket; /* Prepared for install. */
-
- nbuckets += 1;
-
- }
- (*the_bucket)->elems[eoffset] = element;
-}
-
-void
-sarray_at_put_safe(struct sarray* array, sidx index, void* element)
-{
- if(soffset_decode(index) >= array->capacity)
- sarray_realloc(array, soffset_decode(index)+1);
- sarray_at_put(array, index, element);
-}
-
-struct sarray*
-sarray_new (int size, void* default_element)
-{
- struct sarray* arr;
-#ifdef OBJC_SPARSE3
- size_t num_indices = ((size-1)/(INDEX_CAPACITY))+1;
- struct sindex ** new_indices;
-#else /* OBJC_SPARSE2 */
- size_t num_indices = ((size-1)/BUCKET_SIZE)+1;
- struct sbucket ** new_buckets;
-#endif
- int counter;
-
- assert(size > 0);
-
- /* Allocate core array */
- arr = (struct sarray*) objc_malloc(sizeof(struct sarray));
- arr->version.version = 0;
-
- /* Initialize members */
-#ifdef OBJC_SPARSE3
- arr->capacity = num_indices*INDEX_CAPACITY;
- new_indices = (struct sindex**)
- objc_malloc(sizeof(struct sindex*)*num_indices);
-
- arr->empty_index = (struct sindex*) objc_malloc(sizeof(struct sindex));
- arr->empty_index->version.version = 0;
-
- narrays += 1;
- idxsize += num_indices;
- nindices += 1;
-
-#else /* OBJC_SPARSE2 */
- arr->capacity = num_indices*BUCKET_SIZE;
- new_buckets = (struct sbucket**)
- objc_malloc(sizeof(struct sbucket*)*num_indices);
-
- narrays += 1;
- idxsize += num_indices;
-
-#endif
-
- arr->empty_bucket = (struct sbucket*) objc_malloc(sizeof(struct sbucket));
- arr->empty_bucket->version.version = 0;
-
- nbuckets += 1;
-
- arr->ref_count = 1;
- arr->is_copy_of = (struct sarray*)0;
-
- for (counter=0; counter<BUCKET_SIZE; counter++)
- arr->empty_bucket->elems[counter] = default_element;
-
-#ifdef OBJC_SPARSE3
- for (counter=0; counter<INDEX_SIZE; counter++)
- arr->empty_index->buckets[counter] = arr->empty_bucket;
-
- for (counter=0; counter<num_indices; counter++)
- new_indices[counter] = arr->empty_index;
-
-#else /* OBJC_SPARSE2 */
-
- for (counter=0; counter<num_indices; counter++)
- new_buckets[counter] = arr->empty_bucket;
-
-#endif
-
-#ifdef OBJC_SPARSE3
- arr->indices = new_indices;
-#else /* OBJC_SPARSE2 */
- arr->buckets = new_buckets;
-#endif
-
- return arr;
-}
-
-
-/* Reallocate the sparse array to hold `newsize' entries
- Note: We really allocate and then free. We have to do this to ensure that
- any concurrent readers notice the update. */
-
-void
-sarray_realloc(struct sarray* array, int newsize)
-{
-#ifdef OBJC_SPARSE3
- size_t old_max_index = (array->capacity-1)/INDEX_CAPACITY;
- size_t new_max_index = ((newsize-1)/INDEX_CAPACITY);
- size_t rounded_size = (new_max_index+1)*INDEX_CAPACITY;
-
- struct sindex ** new_indices;
- struct sindex ** old_indices;
-
-#else /* OBJC_SPARSE2 */
- size_t old_max_index = (array->capacity-1)/BUCKET_SIZE;
- size_t new_max_index = ((newsize-1)/BUCKET_SIZE);
- size_t rounded_size = (new_max_index+1)*BUCKET_SIZE;
-
- struct sbucket ** new_buckets;
- struct sbucket ** old_buckets;
-
-#endif
-
- int counter;
-
- assert(newsize > 0);
-
- /* The size is the same, just ignore the request */
- if(rounded_size <= array->capacity)
- return;
-
- assert(array->ref_count == 1); /* stop if lazy copied... */
-
- /* We are asked to extend the array -- allocate new bucket table, */
- /* and insert empty_bucket in newly allocated places. */
- if(rounded_size > array->capacity)
- {
-
-#ifdef OBJC_SPARSE3
- new_max_index += 4;
- rounded_size = (new_max_index+1)*INDEX_CAPACITY;
-
-#else /* OBJC_SPARSE2 */
- new_max_index += 4;
- rounded_size = (new_max_index+1)*BUCKET_SIZE;
-#endif
-
- /* update capacity */
- array->capacity = rounded_size;
-
-#ifdef OBJC_SPARSE3
- /* alloc to force re-read by any concurrent readers. */
- old_indices = array->indices;
- new_indices = (struct sindex**)
- objc_malloc((new_max_index+1)*sizeof(struct sindex*));
-#else /* OBJC_SPARSE2 */
- old_buckets = array->buckets;
- new_buckets = (struct sbucket**)
- objc_malloc((new_max_index+1)*sizeof(struct sbucket*));
-#endif
-
- /* copy buckets below old_max_index (they are still valid) */
- for(counter = 0; counter <= old_max_index; counter++ ) {
-#ifdef OBJC_SPARSE3
- new_indices[counter] = old_indices[counter];
-#else /* OBJC_SPARSE2 */
- new_buckets[counter] = old_buckets[counter];
-#endif
- }
-
-#ifdef OBJC_SPARSE3
- /* reset entries above old_max_index to empty_bucket */
- for(counter = old_max_index+1; counter <= new_max_index; counter++)
- new_indices[counter] = array->empty_index;
-#else /* OBJC_SPARSE2 */
- /* reset entries above old_max_index to empty_bucket */
- for(counter = old_max_index+1; counter <= new_max_index; counter++)
- new_buckets[counter] = array->empty_bucket;
-#endif
-
-#ifdef OBJC_SPARSE3
- /* install the new indices */
- array->indices = new_indices;
-#else /* OBJC_SPARSE2 */
- array->buckets = new_buckets;
-#endif
-
-#ifdef OBJC_SPARSE3
- /* free the old indices */
- sarray_free_garbage(old_indices);
-#else /* OBJC_SPARSE2 */
- sarray_free_garbage(old_buckets);
-#endif
-
- idxsize += (new_max_index-old_max_index);
- return;
- }
-}
-
-
-/* Free a sparse array allocated with sarray_new */
-
-void
-sarray_free(struct sarray* array) {
-
-#ifdef OBJC_SPARSE3
- size_t old_max_index = (array->capacity-1)/INDEX_CAPACITY;
- struct sindex ** old_indices;
-#else
- size_t old_max_index = (array->capacity-1)/BUCKET_SIZE;
- struct sbucket ** old_buckets;
-#endif
- int counter = 0;
-
- assert(array->ref_count != 0); /* Freed multiple times!!! */
-
- if(--(array->ref_count) != 0) /* There exists copies of me */
- return;
-
-#ifdef OBJC_SPARSE3
- old_indices = array->indices;
-#else
- old_buckets = array->buckets;
-#endif
-
- if((array->is_copy_of) && ((array->is_copy_of->ref_count - 1) == 0))
- sarray_free(array->is_copy_of);
-
- /* Free all entries that do not point to empty_bucket */
- for(counter = 0; counter <= old_max_index; counter++ ) {
-#ifdef OBJC_SPARSE3
- struct sindex* idx = old_indices[counter];
- if((idx != array->empty_index) &&
- (idx->version.version == array->version.version)) {
- int c2;
- for(c2=0; c2<INDEX_SIZE; c2++) {
- struct sbucket* bkt = idx->buckets[c2];
- if((bkt != array->empty_bucket) &&
- (bkt->version.version == array->version.version))
- {
- sarray_free_garbage(bkt);
- nbuckets -= 1;
- }
- }
- sarray_free_garbage(idx);
- nindices -= 1;
- }
-#else /* OBJC_SPARSE2 */
- struct sbucket* bkt = array->buckets[counter];
- if ((bkt != array->empty_bucket) &&
- (bkt->version.version == array->version.version))
- {
- sarray_free_garbage(bkt);
- nbuckets -= 1;
- }
-#endif
- }
-
-#ifdef OBJC_SPARSE3
- /* free empty_index */
- if(array->empty_index->version.version == array->version.version) {
- sarray_free_garbage(array->empty_index);
- nindices -= 1;
- }
-#endif
-
- /* free empty_bucket */
- if(array->empty_bucket->version.version == array->version.version) {
- sarray_free_garbage(array->empty_bucket);
- nbuckets -= 1;
- }
- idxsize -= (old_max_index+1);
- narrays -= 1;
-
-#ifdef OBJC_SPARSE3
- /* free bucket table */
- sarray_free_garbage(array->indices);
-
-#else
- /* free bucket table */
- sarray_free_garbage(array->buckets);
-
-#endif
-
- /* free array */
- sarray_free_garbage(array);
-}
-
-/* This is a lazy copy. Only the core of the structure is actually */
-/* copied. */
-
-struct sarray*
-sarray_lazy_copy(struct sarray* oarr)
-{
- struct sarray* arr;
-
-#ifdef OBJC_SPARSE3
- size_t num_indices = ((oarr->capacity-1)/INDEX_CAPACITY)+1;
- struct sindex ** new_indices;
-#else /* OBJC_SPARSE2 */
- size_t num_indices = ((oarr->capacity-1)/BUCKET_SIZE)+1;
- struct sbucket ** new_buckets;
-#endif
-
- /* Allocate core array */
- arr = (struct sarray*) objc_malloc(sizeof(struct sarray)); /* !!! */
- arr->version.version = oarr->version.version + 1;
-#ifdef OBJC_SPARSE3
- arr->empty_index = oarr->empty_index;
-#endif
- arr->empty_bucket = oarr->empty_bucket;
- arr->ref_count = 1;
- oarr->ref_count += 1;
- arr->is_copy_of = oarr;
- arr->capacity = oarr->capacity;
-
-#ifdef OBJC_SPARSE3
- /* Copy bucket table */
- new_indices = (struct sindex**)
- objc_malloc(sizeof(struct sindex*)*num_indices);
- memcpy( new_indices,oarr->indices,
- sizeof(struct sindex*)*num_indices);
- arr->indices = new_indices;
-#else
- /* Copy bucket table */
- new_buckets = (struct sbucket**)
- objc_malloc(sizeof(struct sbucket*)*num_indices);
- memcpy( new_buckets,oarr->buckets,
- sizeof(struct sbucket*)*num_indices);
- arr->buckets = new_buckets;
-#endif
-
- idxsize += num_indices;
- narrays += 1;
-
- return arr;
-}
diff --git a/contrib/libobjc/selector.c b/contrib/libobjc/selector.c
deleted file mode 100644
index 470a2c48cdd3..000000000000
--- a/contrib/libobjc/selector.c
+++ /dev/null
@@ -1,458 +0,0 @@
-/* GNU Objective C Runtime selector related functions
- Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
- Contributed by Kresten Krab Thorup
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
-details.
-
-You should have received a copy of the GNU General Public License along with
-GNU CC; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with files compiled with
- GCC 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 "runtime.h"
-#include "sarray.h"
-#include "encoding.h"
-
-/* Initial selector hash table size. Value doesn't matter much */
-#define SELECTOR_HASH_SIZE 128
-
-/* Tables mapping selector names to uid and opposite */
-static struct sarray* __objc_selector_array = 0; /* uid -> sel !T:MUTEX */
-static struct sarray* __objc_selector_names = 0; /* uid -> name !T:MUTEX */
-static cache_ptr __objc_selector_hash = 0; /* name -> uid !T:MUTEX */
-
-static void register_selectors_from_list(MethodList_t);
-
-/* Number of selectors stored in each of the above tables */
-int __objc_selector_max_index = 0; /* !T:MUTEX */
-
-void __objc_init_selector_tables()
-{
- __objc_selector_array = sarray_new (SELECTOR_HASH_SIZE, 0);
- __objc_selector_names = sarray_new (SELECTOR_HASH_SIZE, 0);
- __objc_selector_hash
- = hash_new (SELECTOR_HASH_SIZE,
- (hash_func_type) hash_string,
- (compare_func_type) compare_strings);
-}
-
-/* This routine is given a class and records all of the methods in its class
- structure in the record table. */
-void
-__objc_register_selectors_from_class (Class class)
-{
- MethodList_t method_list;
-
- method_list = class->methods;
- while (method_list)
- {
- register_selectors_from_list (method_list);
- method_list = method_list->method_next;
- }
-}
-
-
-/* This routine is given a list of methods and records each of the methods in
- the record table. This is the routine that does the actual recording
- work.
-
- This one is only called for Class objects. For categories,
- class_add_method_list is called.
- */
-static void
-register_selectors_from_list (MethodList_t method_list)
-{
- int i = 0;
- while (i < method_list->method_count)
- {
- Method_t method = &method_list->method_list[i];
- method->method_name
- = sel_register_typed_name ((const char*)method->method_name,
- method->method_types);
- i += 1;
- }
-}
-
-
-/* Register instance methods as class methods for root classes */
-void __objc_register_instance_methods_to_class(Class class)
-{
- MethodList_t method_list;
- MethodList_t class_method_list;
- int max_methods_no = 16;
- MethodList_t new_list;
- Method_t curr_method;
-
- /* Only if a root class. */
- if(class->super_class)
- return;
-
- /* Allocate a method list to hold the new class methods */
- new_list = objc_calloc(sizeof(struct objc_method_list)
- + sizeof(struct objc_method[max_methods_no]), 1);
- method_list = class->methods;
- class_method_list = class->class_pointer->methods;
- curr_method = &new_list->method_list[0];
-
- /* Iterate through the method lists for the class */
- while (method_list)
- {
- int i;
-
- /* Iterate through the methods from this method list */
- for (i = 0; i < method_list->method_count; i++)
- {
- Method_t mth = &method_list->method_list[i];
- if (mth->method_name
- && !search_for_method_in_list (class_method_list,
- mth->method_name))
- {
- /* This instance method isn't a class method.
- Add it into the new_list. */
- *curr_method = *mth;
-
- /* Reallocate the method list if necessary */
- if(++new_list->method_count == max_methods_no)
- new_list =
- objc_realloc(new_list, sizeof(struct objc_method_list)
- + sizeof(struct
- objc_method[max_methods_no += 16]));
- curr_method = &new_list->method_list[new_list->method_count];
- }
- }
-
- method_list = method_list->method_next;
- }
-
- /* If we created any new class methods
- then attach the method list to the class */
- if (new_list->method_count)
- {
- new_list =
- objc_realloc(new_list, sizeof(struct objc_method_list)
- + sizeof(struct objc_method[new_list->method_count]));
- new_list->method_next = class->class_pointer->methods;
- class->class_pointer->methods = new_list;
- }
-
- __objc_update_dispatch_table_for_class (class->class_pointer);
-}
-
-
-/* Returns YES iff t1 and t2 have same method types, but we ignore
- the argframe layout */
-BOOL
-sel_types_match (const char* t1, const char* t2)
-{
- if (!t1 || !t2)
- return NO;
- while (*t1 && *t2)
- {
- if (*t1 == '+') t1++;
- if (*t2 == '+') t2++;
- while (isdigit(*t1)) t1++;
- while (isdigit(*t2)) t2++;
- /* xxx Remove these next two lines when qualifiers are put in
- all selectors, not just Protocol selectors. */
- t1 = objc_skip_type_qualifiers(t1);
- t2 = objc_skip_type_qualifiers(t2);
- if (!*t1 && !*t2)
- return YES;
- if (*t1 != *t2)
- return NO;
- t1++;
- t2++;
- }
- return NO;
-}
-
-/* return selector representing name */
-SEL
-sel_get_typed_uid (const char *name, const char *types)
-{
- struct objc_list *l;
- sidx i;
-
- objc_mutex_lock(__objc_runtime_mutex);
-
- i = (sidx) hash_value_for_key (__objc_selector_hash, name);
- if (i == 0)
- {
- objc_mutex_unlock(__objc_runtime_mutex);
- return 0;
- }
-
- for (l = (struct objc_list*)sarray_get_safe (__objc_selector_array, i);
- l; l = l->tail)
- {
- SEL s = (SEL)l->head;
- if (types == 0 || s->sel_types == 0)
- {
- if (s->sel_types == types)
- {
- objc_mutex_unlock(__objc_runtime_mutex);
- return s;
- }
- }
- else if (sel_types_match (s->sel_types, types))
- {
- objc_mutex_unlock(__objc_runtime_mutex);
- return s;
- }
- }
-
- objc_mutex_unlock(__objc_runtime_mutex);
- return 0;
-}
-
-/* Return selector representing name; prefer a selector with non-NULL type */
-SEL
-sel_get_any_typed_uid (const char *name)
-{
- struct objc_list *l;
- sidx i;
- SEL s = NULL;
-
- objc_mutex_lock(__objc_runtime_mutex);
-
- i = (sidx) hash_value_for_key (__objc_selector_hash, name);
- if (i == 0)
- {
- objc_mutex_unlock(__objc_runtime_mutex);
- return 0;
- }
-
- for (l = (struct objc_list*)sarray_get_safe (__objc_selector_array, i);
- l; l = l->tail)
- {
- s = (SEL) l->head;
- if (s->sel_types)
- {
- objc_mutex_unlock(__objc_runtime_mutex);
- return s;
- }
- }
-
- objc_mutex_unlock(__objc_runtime_mutex);
- return s;
-}
-
-/* return selector representing name */
-SEL
-sel_get_any_uid (const char *name)
-{
- struct objc_list *l;
- sidx i;
-
- objc_mutex_lock(__objc_runtime_mutex);
-
- i = (sidx) hash_value_for_key (__objc_selector_hash, name);
- if (soffset_decode (i) == 0)
- {
- objc_mutex_unlock(__objc_runtime_mutex);
- return 0;
- }
-
- l = (struct objc_list*)sarray_get_safe (__objc_selector_array, i);
- objc_mutex_unlock(__objc_runtime_mutex);
-
- if (l == 0)
- return 0;
-
- return (SEL)l->head;
-}
-
-/* return selector representing name */
-SEL
-sel_get_uid (const char *name)
-{
- return sel_register_typed_name (name, 0);
-}
-
-/* Get name of selector. If selector is unknown, the empty string ""
- is returned */
-const char*
-sel_get_name (SEL selector)
-{
- const char *ret;
-
- objc_mutex_lock(__objc_runtime_mutex);
- if ((soffset_decode((sidx)selector->sel_id) > 0)
- && (soffset_decode((sidx)selector->sel_id) <= __objc_selector_max_index))
- ret = sarray_get_safe (__objc_selector_names, (sidx) selector->sel_id);
- else
- ret = 0;
- objc_mutex_unlock(__objc_runtime_mutex);
- return ret;
-}
-
-BOOL
-sel_is_mapped (SEL selector)
-{
- unsigned int idx = soffset_decode ((sidx)selector->sel_id);
- return ((idx > 0) && (idx <= __objc_selector_max_index));
-}
-
-
-const char*
-sel_get_type (SEL selector)
-{
- if (selector)
- return selector->sel_types;
- else
- return 0;
-}
-
-/* The uninstalled dispatch table */
-extern struct sarray* __objc_uninstalled_dtable;
-
-/* Store the passed selector name in the selector record and return its
- selector value (value returned by sel_get_uid).
- Assumes that the calling function has locked down __objc_runtime_mutex. */
-/* is_const parameter tells us if the name and types parameters
- are really constant or not. If YES then they are constant and
- we can just store the pointers. If NO then we need to copy
- name and types because the pointers may disappear later on. */
-SEL
-__sel_register_typed_name (const char *name, const char *types,
- struct objc_selector *orig, BOOL is_const)
-{
- struct objc_selector* j;
- sidx i;
- struct objc_list *l;
-
- i = (sidx) hash_value_for_key (__objc_selector_hash, name);
- if (soffset_decode (i) != 0)
- {
- for (l = (struct objc_list*)sarray_get_safe (__objc_selector_array, i);
- l; l = l->tail)
- {
- SEL s = (SEL)l->head;
- if (types == 0 || s->sel_types == 0)
- {
- if (s->sel_types == types)
- {
- if (orig)
- {
- orig->sel_id = (void*)i;
- return orig;
- }
- else
- return s;
- }
- }
- else if (!strcmp (s->sel_types, types))
- {
- if (orig)
- {
- orig->sel_id = (void*)i;
- return orig;
- }
- else
- return s;
- }
- }
- if (orig)
- j = orig;
- else
- j = objc_malloc (sizeof (struct objc_selector));
-
- j->sel_id = (void*)i;
- /* Can we use the pointer or must copy types? Don't copy if NULL */
- if ((is_const) || (types == 0))
- j->sel_types = (const char*)types;
- else {
- j->sel_types = (char *) objc_malloc(strlen(types)+1);
- strcpy((char *)j->sel_types, types);
- }
- l = (struct objc_list*)sarray_get_safe (__objc_selector_array, i);
- }
- else
- {
- __objc_selector_max_index += 1;
- i = soffset_encode(__objc_selector_max_index);
- if (orig)
- j = orig;
- else
- j = objc_malloc (sizeof (struct objc_selector));
-
- j->sel_id = (void*)i;
- /* Can we use the pointer or must copy types? Don't copy if NULL */
- if ((is_const) || (types == 0))
- j->sel_types = (const char*)types;
- else {
- j->sel_types = (char *) objc_malloc(strlen(types)+1);
- strcpy((char *)j->sel_types, types);
- }
- l = 0;
- }
-
- DEBUG_PRINTF ("Record selector %s[%s] as: %ld\n", name, types,
- soffset_decode (i));
-
- {
- int is_new = (l == 0);
- const char *new_name;
-
- /* Can we use the pointer or must copy name? Don't copy if NULL */
- if ((is_const) || (name == 0))
- new_name = name;
- else {
- new_name = (char *) objc_malloc(strlen(name)+1);
- strcpy((char *)new_name, name);
- }
-
- l = list_cons ((void*)j, l);
- sarray_at_put_safe (__objc_selector_names, i, (void *) new_name);
- sarray_at_put_safe (__objc_selector_array, i, (void *) l);
- if (is_new)
- hash_add (&__objc_selector_hash, (void *) new_name, (void *) i);
- }
-
- sarray_realloc(__objc_uninstalled_dtable, __objc_selector_max_index+1);
-
- return (SEL) j;
-}
-
-SEL
-sel_register_name (const char *name)
-{
- SEL ret;
-
- objc_mutex_lock(__objc_runtime_mutex);
- /* Assume that name is not constant static memory and needs to be
- copied before put into a runtime structure. is_const == NO */
- ret = __sel_register_typed_name (name, 0, 0, NO);
- objc_mutex_unlock(__objc_runtime_mutex);
-
- return ret;
-}
-
-SEL
-sel_register_typed_name (const char *name, const char *type)
-{
- SEL ret;
-
- objc_mutex_lock(__objc_runtime_mutex);
- /* Assume that name and type are not constant static memory and need to
- be copied before put into a runtime structure. is_const == NO */
- ret = __sel_register_typed_name (name, type, 0, NO);
- objc_mutex_unlock(__objc_runtime_mutex);
-
- return ret;
-}
-
diff --git a/contrib/libobjc/sendmsg.c b/contrib/libobjc/sendmsg.c
deleted file mode 100644
index a4aa4709c7c1..000000000000
--- a/contrib/libobjc/sendmsg.c
+++ /dev/null
@@ -1,646 +0,0 @@
-/* GNU Objective C Runtime message lookup
- Copyright (C) 1993, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
- Contributed by Kresten Krab Thorup
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
-details.
-
-You should have received a copy of the GNU General Public License along with
-GNU CC; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with files compiled with
- GCC 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 "tconfig.h"
-#include "runtime.h"
-#include "sarray.h"
-#include "encoding.h"
-#include "runtime-info.h"
-
-/* this is how we hack STRUCT_VALUE to be 1 or 0 */
-#define gen_rtx(args...) 1
-#define gen_rtx_MEM(args...) 1
-#define rtx int
-
-#if !defined(STRUCT_VALUE) || STRUCT_VALUE == 0
-#define INVISIBLE_STRUCT_RETURN 1
-#else
-#define INVISIBLE_STRUCT_RETURN 0
-#endif
-
-/* The uninstalled dispatch table */
-struct sarray* __objc_uninstalled_dtable = 0; /* !T:MUTEX */
-
-/* Send +initialize to class */
-static void __objc_send_initialize(Class);
-
-static void __objc_install_dispatch_table_for_class (Class);
-
-/* Forward declare some functions */
-static void __objc_init_install_dtable(id, SEL);
-
-/* Various forwarding functions that are used based upon the
- return type for the selector.
- __objc_block_forward for structures.
- __objc_double_forward for floats/doubles.
- __objc_word_forward for pointers or types that fit in registers.
- */
-static double __objc_double_forward(id, SEL, ...);
-static id __objc_word_forward(id, SEL, ...);
-typedef struct { id many[8]; } __big;
-#if INVISIBLE_STRUCT_RETURN
-static __big
-#else
-static id
-#endif
-__objc_block_forward(id, SEL, ...);
-static Method_t search_for_method_in_hierarchy (Class class, SEL sel);
-Method_t search_for_method_in_list(MethodList_t list, SEL op);
-id nil_method(id, SEL, ...);
-
-/* Given a selector, return the proper forwarding implementation. */
-__inline__
-IMP
-__objc_get_forward_imp (SEL sel)
-{
- const char *t = sel->sel_types;
-
- if (t && (*t == '[' || *t == '(' || *t == '{')
-#ifdef OBJC_MAX_STRUCT_BY_VALUE
- && objc_sizeof_type(t) > OBJC_MAX_STRUCT_BY_VALUE
-#endif
- )
- return (IMP)__objc_block_forward;
- else if (t && (*t == 'f' || *t == 'd'))
- return (IMP)__objc_double_forward;
- else
- return (IMP)__objc_word_forward;
-}
-
-/* Given a class and selector, return the selector's implementation. */
-__inline__
-IMP
-get_imp (Class class, SEL sel)
-{
- void* res = sarray_get_safe (class->dtable, (size_t) sel->sel_id);
- if (res == 0)
- {
- /* Not a valid method */
- if(class->dtable == __objc_uninstalled_dtable)
- {
- /* The dispatch table needs to be installed. */
- objc_mutex_lock(__objc_runtime_mutex);
- __objc_install_dispatch_table_for_class (class);
- objc_mutex_unlock(__objc_runtime_mutex);
- /* Call ourselves with the installed dispatch table
- and get the real method */
- res = get_imp(class, sel);
- }
- else
- {
- /* The dispatch table has been installed so the
- method just doesn't exist for the class.
- Return the forwarding implementation. */
- res = __objc_get_forward_imp(sel);
- }
- }
- return res;
-}
-
-/* Query if an object can respond to a selector, returns YES if the
-object implements the selector otherwise NO. Does not check if the
-method can be forwarded. */
-__inline__
-BOOL
-__objc_responds_to (id object, SEL sel)
-{
- void* res;
-
- /* Install dispatch table if need be */
- if (object->class_pointer->dtable == __objc_uninstalled_dtable)
- {
- objc_mutex_lock(__objc_runtime_mutex);
- __objc_install_dispatch_table_for_class (object->class_pointer);
- objc_mutex_unlock(__objc_runtime_mutex);
- }
-
- /* Get the method from the dispatch table */
- res = sarray_get_safe (object->class_pointer->dtable, (size_t) sel->sel_id);
- return (res != 0);
-}
-
-/* This is the lookup function. All entries in the table are either a
- valid method *or* zero. If zero then either the dispatch table
- needs to be installed or it doesn't exist and forwarding is attempted. */
-__inline__
-IMP
-objc_msg_lookup(id receiver, SEL op)
-{
- IMP result;
- if(receiver)
- {
- result = sarray_get_safe (receiver->class_pointer->dtable,
- (sidx)op->sel_id);
- if (result == 0)
- {
- /* Not a valid method */
- if(receiver->class_pointer->dtable == __objc_uninstalled_dtable)
- {
- /* The dispatch table needs to be installed.
- This happens on the very first method call to the class. */
- __objc_init_install_dtable(receiver, op);
-
- /* Get real method for this in newly installed dtable */
- result = get_imp(receiver->class_pointer, op);
- }
- else
- {
- /* The dispatch table has been installed so the
- method just doesn't exist for the class.
- Attempt to forward the method. */
- result = __objc_get_forward_imp(op);
- }
- }
- return result;
- }
- else
- return nil_method;
-}
-
-IMP
-objc_msg_lookup_super (Super_t super, SEL sel)
-{
- if (super->self)
- return get_imp (super->class, sel);
- else
- return nil_method;
-}
-
-int method_get_sizeof_arguments (Method*);
-
-retval_t
-objc_msg_sendv(id object, SEL op, arglist_t arg_frame)
-{
- Method* m = class_get_instance_method(object->class_pointer, op);
- const char *type;
- *((id*)method_get_first_argument (m, arg_frame, &type)) = object;
- *((SEL*)method_get_next_argument (arg_frame, &type)) = op;
- return __builtin_apply((apply_t)m->method_imp,
- arg_frame,
- method_get_sizeof_arguments (m));
-}
-
-void
-__objc_init_dispatch_tables()
-{
- __objc_uninstalled_dtable
- = sarray_new(200, 0);
-}
-
-/* This function is called by objc_msg_lookup when the
- dispatch table needs to be installed; thus it is called once
- for each class, namely when the very first message is sent to it. */
-static void
-__objc_init_install_dtable(id receiver, SEL op)
-{
- /* This may happen, if the programmer has taken the address of a
- method before the dtable was initialized... too bad for him! */
- if(receiver->class_pointer->dtable != __objc_uninstalled_dtable)
- return;
-
- objc_mutex_lock(__objc_runtime_mutex);
-
- if(CLS_ISCLASS(receiver->class_pointer))
- {
- /* receiver is an ordinary object */
- assert(CLS_ISCLASS(receiver->class_pointer));
-
- /* install instance methods table */
- __objc_install_dispatch_table_for_class (receiver->class_pointer);
-
- /* call +initialize -- this will in turn install the factory
- dispatch table if not already done :-) */
- __objc_send_initialize(receiver->class_pointer);
- }
- else
- {
- /* receiver is a class object */
- assert(CLS_ISCLASS((Class)receiver));
- assert(CLS_ISMETA(receiver->class_pointer));
-
- /* Install real dtable for factory methods */
- __objc_install_dispatch_table_for_class (receiver->class_pointer);
-
- __objc_send_initialize((Class)receiver);
- }
- objc_mutex_unlock(__objc_runtime_mutex);
-}
-
-/* Install dummy table for class which causes the first message to
- that class (or instances hereof) to be initialized properly */
-void
-__objc_install_premature_dtable(Class class)
-{
- assert(__objc_uninstalled_dtable);
- class->dtable = __objc_uninstalled_dtable;
-}
-
-/* Send +initialize to class if not already done */
-static void
-__objc_send_initialize(Class class)
-{
- /* This *must* be a class object */
- assert(CLS_ISCLASS(class));
- assert(!CLS_ISMETA(class));
-
- if (!CLS_ISINITIALIZED(class))
- {
- CLS_SETINITIALIZED(class);
- CLS_SETINITIALIZED(class->class_pointer);
-
- /* Create the garbage collector type memory description */
- __objc_generate_gc_type_description (class);
-
- if(class->super_class)
- __objc_send_initialize(class->super_class);
-
- {
- SEL op = sel_register_name ("initialize");
- IMP imp = 0;
- MethodList_t method_list = class->class_pointer->methods;
-
- while (method_list) {
- int i;
- Method_t method;
-
- for (i = 0; i< method_list->method_count; i++) {
- method = &(method_list->method_list[i]);
- if (method->method_name
- && method->method_name->sel_id == op->sel_id) {
- imp = method->method_imp;
- break;
- }
- }
-
- if (imp)
- break;
-
- method_list = method_list->method_next;
-
- }
- if (imp)
- (*imp)((id)class, op);
-
- }
- }
-}
-
-/* Walk on the methods list of class and install the methods in the reverse
- order of the lists. Since methods added by categories are before the methods
- of class in the methods list, this allows categories to substitute methods
- declared in class. However if more than one category replaces the same
- method nothing is guaranteed about what method will be used.
- Assumes that __objc_runtime_mutex is locked down. */
-static void
-__objc_install_methods_in_dtable (Class class, MethodList_t method_list)
-{
- int i;
-
- if (!method_list)
- return;
-
- if (method_list->method_next)
- __objc_install_methods_in_dtable (class, method_list->method_next);
-
- for (i = 0; i < method_list->method_count; i++)
- {
- Method_t method = &(method_list->method_list[i]);
- sarray_at_put_safe (class->dtable,
- (sidx) method->method_name->sel_id,
- method->method_imp);
- }
-}
-
-/* Assumes that __objc_runtime_mutex is locked down. */
-static void
-__objc_install_dispatch_table_for_class (Class class)
-{
- Class super;
-
- /* If the class has not yet had its class links resolved, we must
- re-compute all class links */
- if(!CLS_ISRESOLV(class))
- __objc_resolve_class_links();
-
- super = class->super_class;
-
- if (super != 0 && (super->dtable == __objc_uninstalled_dtable))
- __objc_install_dispatch_table_for_class (super);
-
- /* Allocate dtable if necessary */
- if (super == 0)
- {
- objc_mutex_lock(__objc_runtime_mutex);
- class->dtable = sarray_new (__objc_selector_max_index, 0);
- objc_mutex_unlock(__objc_runtime_mutex);
- }
- else
- class->dtable = sarray_lazy_copy (super->dtable);
-
- __objc_install_methods_in_dtable (class, class->methods);
-}
-
-void
-__objc_update_dispatch_table_for_class (Class class)
-{
- Class next;
- struct sarray *arr;
-
- /* not yet installed -- skip it */
- if (class->dtable == __objc_uninstalled_dtable)
- return;
-
- objc_mutex_lock(__objc_runtime_mutex);
-
- arr = class->dtable;
- __objc_install_premature_dtable (class); /* someone might require it... */
- sarray_free (arr); /* release memory */
-
- /* could have been lazy... */
- __objc_install_dispatch_table_for_class (class);
-
- if (class->subclass_list) /* Traverse subclasses */
- for (next = class->subclass_list; next; next = next->sibling_class)
- __objc_update_dispatch_table_for_class (next);
-
- objc_mutex_unlock(__objc_runtime_mutex);
-}
-
-
-/* This function adds a method list to a class. This function is
- typically called by another function specific to the run-time. As
- such this function does not worry about thread safe issues.
-
- This one is only called for categories. Class objects have their
- methods installed right away, and their selectors are made into
- SEL's by the function __objc_register_selectors_from_class. */
-void
-class_add_method_list (Class class, MethodList_t list)
-{
- int i;
-
- /* Passing of a linked list is not allowed. Do multiple calls. */
- assert (!list->method_next);
-
- /* Check for duplicates. */
- for (i = 0; i < list->method_count; ++i)
- {
- Method_t method = &list->method_list[i];
-
- if (method->method_name) /* Sometimes these are NULL */
- {
- /* This is where selector names are transmogrified to SEL's */
- method->method_name =
- sel_register_typed_name ((const char*)method->method_name,
- method->method_types);
- }
- }
-
- /* Add the methods to the class's method list. */
- list->method_next = class->methods;
- class->methods = list;
-
- /* Update the dispatch table of class */
- __objc_update_dispatch_table_for_class (class);
-}
-
-Method_t
-class_get_instance_method(Class class, SEL op)
-{
- return search_for_method_in_hierarchy(class, op);
-}
-
-Method_t
-class_get_class_method(MetaClass class, SEL op)
-{
- return search_for_method_in_hierarchy(class, op);
-}
-
-
-/* Search for a method starting from the current class up its hierarchy.
- Return a pointer to the method's method structure if found. NULL
- otherwise. */
-
-static Method_t
-search_for_method_in_hierarchy (Class cls, SEL sel)
-{
- Method_t method = NULL;
- Class class;
-
- if (! sel_is_mapped (sel))
- return NULL;
-
- /* Scan the method list of the class. If the method isn't found in the
- list then step to its super class. */
- for (class = cls; ((! method) && class); class = class->super_class)
- method = search_for_method_in_list (class->methods, sel);
-
- return method;
-}
-
-
-
-/* Given a linked list of method and a method's name. Search for the named
- method's method structure. Return a pointer to the method's method
- structure if found. NULL otherwise. */
-Method_t
-search_for_method_in_list (MethodList_t list, SEL op)
-{
- MethodList_t method_list = list;
-
- if (! sel_is_mapped (op))
- return NULL;
-
- /* If not found then we'll search the list. */
- while (method_list)
- {
- int i;
-
- /* Search the method list. */
- for (i = 0; i < method_list->method_count; ++i)
- {
- Method_t method = &method_list->method_list[i];
-
- if (method->method_name)
- if (method->method_name->sel_id == op->sel_id)
- return method;
- }
-
- /* The method wasn't found. Follow the link to the next list of
- methods. */
- method_list = method_list->method_next;
- }
-
- return NULL;
-}
-
-static retval_t __objc_forward (id object, SEL sel, arglist_t args);
-
-/* Forwarding pointers/integers through the normal registers */
-static id
-__objc_word_forward (id rcv, SEL op, ...)
-{
- void *args, *res;
-
- args = __builtin_apply_args ();
- res = __objc_forward (rcv, op, args);
- if (res)
- __builtin_return (res);
- else
- return res;
-}
-
-/* Specific routine for forwarding floats/double because of
- architectural differences on some processors. i386s for
- example which uses a floating point stack versus general
- registers for floating point numbers. This forward routine
- makes sure that GCC restores the proper return values */
-static double
-__objc_double_forward (id rcv, SEL op, ...)
-{
- void *args, *res;
-
- args = __builtin_apply_args ();
- res = __objc_forward (rcv, op, args);
- __builtin_return (res);
-}
-
-#if INVISIBLE_STRUCT_RETURN
-static __big
-#else
-static id
-#endif
-__objc_block_forward (id rcv, SEL op, ...)
-{
- void *args, *res;
-
- args = __builtin_apply_args ();
- res = __objc_forward (rcv, op, args);
- if (res)
- __builtin_return (res);
- else
-#if INVISIBLE_STRUCT_RETURN
- return (__big) {{0, 0, 0, 0, 0, 0, 0, 0}};
-#else
- return nil;
-#endif
-}
-
-
-/* This function is installed in the dispatch table for all methods which are
- not implemented. Thus, it is called when a selector is not recognized. */
-static retval_t
-__objc_forward (id object, SEL sel, arglist_t args)
-{
- IMP imp;
- static SEL frwd_sel = 0; /* !T:SAFE2 */
- SEL err_sel;
-
- /* first try if the object understands forward:: */
- if (!frwd_sel)
- frwd_sel = sel_get_any_uid("forward::");
-
- if (__objc_responds_to (object, frwd_sel))
- {
- imp = get_imp(object->class_pointer, frwd_sel);
- return (*imp)(object, frwd_sel, sel, args);
- }
-
- /* If the object recognizes the doesNotRecognize: method then we're going
- to send it. */
- err_sel = sel_get_any_uid ("doesNotRecognize:");
- if (__objc_responds_to (object, err_sel))
- {
- imp = get_imp (object->class_pointer, err_sel);
- return (*imp) (object, err_sel, sel);
- }
-
- /* The object doesn't recognize the method. Check for responding to
- error:. If it does then sent it. */
- {
- size_t strlen (const char*);
- char msg[256 + strlen ((const char*)sel_get_name (sel))
- + strlen ((const char*)object->class_pointer->name)];
-
- sprintf (msg, "(%s) %s does not recognize %s",
- (CLS_ISMETA(object->class_pointer)
- ? "class"
- : "instance" ),
- object->class_pointer->name, sel_get_name (sel));
-
- err_sel = sel_get_any_uid ("error:");
- if (__objc_responds_to (object, err_sel))
- {
- imp = get_imp (object->class_pointer, err_sel);
- return (*imp) (object, sel_get_any_uid ("error:"), msg);
- }
-
- /* The object doesn't respond to doesNotRecognize: or error:; Therefore,
- a default action is taken. */
- objc_error (object, OBJC_ERR_UNIMPLEMENTED, "%s\n", msg);
-
- return 0;
- }
-}
-
-void
-__objc_print_dtable_stats()
-{
- int total = 0;
-
- objc_mutex_lock(__objc_runtime_mutex);
-
-#ifdef OBJC_SPARSE2
- printf("memory usage: (%s)\n", "2-level sparse arrays");
-#else
- printf("memory usage: (%s)\n", "3-level sparse arrays");
-#endif
-
- printf("arrays: %d = %ld bytes\n", narrays,
- (long)narrays*sizeof(struct sarray));
- total += narrays*sizeof(struct sarray);
- printf("buckets: %d = %ld bytes\n", nbuckets,
- (long)nbuckets*sizeof(struct sbucket));
- total += nbuckets*sizeof(struct sbucket);
-
- printf("idxtables: %d = %ld bytes\n", idxsize, (long)idxsize*sizeof(void*));
- total += idxsize*sizeof(void*);
- printf("-----------------------------------\n");
- printf("total: %d bytes\n", total);
- printf("===================================\n");
-
- objc_mutex_unlock(__objc_runtime_mutex);
-}
-
-/* Returns the uninstalled dispatch table indicator.
- If a class' dispatch table points to __objc_uninstalled_dtable
- then that means it needs its dispatch table to be installed. */
-__inline__
-struct sarray*
-objc_get_uninstalled_dtable()
-{
- return __objc_uninstalled_dtable;
-}
diff --git a/contrib/libobjc/thr-dce.c b/contrib/libobjc/thr-dce.c
deleted file mode 100644
index 3fa5b9b1b3ed..000000000000
--- a/contrib/libobjc/thr-dce.c
+++ /dev/null
@@ -1,281 +0,0 @@
-/* GNU Objective C Runtime Thread Interface
- Copyright (C) 1996, 1997 Free Software Foundation, Inc.
- Contributed by Galen C. Hunt (gchunt@cs.rochester.edu)
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
-details.
-
-You should have received a copy of the GNU General Public License along with
-GNU CC; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with files compiled with
- GCC 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 <pthread.h>
-#include <thr.h>
-#include "runtime.h"
-
-/* Key structure for maintaining thread specific storage */
-static pthread_key_t _objc_thread_storage;
-
-/* Backend initialization functions */
-
-/* Initialize the threads subsystem. */
-int
-__objc_init_thread_system(void)
-{
- /* Initialize the thread storage key */
- return pthread_keycreate(&_objc_thread_storage, NULL);
-}
-
-/* Close the threads subsystem. */
-int
-__objc_close_thread_system(void)
-{
- /* Destroy the thread storage key */
- /* Not implemented yet */
- /* return pthread_key_delete(&_objc_thread_storage); */
- return 0;
-}
-
-/* Backend thread functions */
-
-/* Create a new thread of execution. */
-objc_thread_t
-__objc_thread_detach(void (*func)(void *arg), void *arg)
-{
- objc_thread_t thread_id;
- pthread_t new_thread_handle;
-
- if (pthread_create(&new_thread_handle, pthread_attr_default,
- (void *)func, arg) == 0)
- {
- /* ??? May not work! (64bit) */
- thread_id = *(objc_thread_t *)&new_thread_handle;
- pthread_detach(&new_thread_handle); /* Fully detach thread. */
- }
- else
- thread_id = NULL;
-
- return thread_id;
-}
-
-/* Set the current thread's priority. */
-int
-__objc_thread_set_priority(int priority)
-{
- int sys_priority = 0;
-
- switch (priority)
- {
- case OBJC_THREAD_INTERACTIVE_PRIORITY:
- sys_priority = (PRI_FG_MIN_NP + PRI_FG_MAX_NP) / 2;
- break;
- default:
- case OBJC_THREAD_BACKGROUND_PRIORITY:
- sys_priority = (PRI_BG_MIN_NP + PRI_BG_MAX_NP) / 2;
- break;
- case OBJC_THREAD_LOW_PRIORITY:
- sys_priority = (PRI_BG_MIN_NP + PRI_BG_MAX_NP) / 2;
- break;
- }
-
- /* Change the priority. */
- if (pthread_setprio(pthread_self(), sys_priority) >= 0)
- return 0;
- else
- /* Failed */
- return -1;
-}
-
-/* Return the current thread's priority. */
-int
-__objc_thread_get_priority(void)
-{
- int sys_priority;
-
- if ((sys_priority = pthread_getprio(pthread_self())) >= 0) {
- if (sys_priority >= PRI_FG_MIN_NP && sys_priority <= PRI_FG_MAX_NP)
- return OBJC_THREAD_INTERACTIVE_PRIORITY;
- if (sys_priority >= PRI_BG_MIN_NP && sys_priority <= PRI_BG_MAX_NP)
- return OBJC_THREAD_BACKGROUND_PRIORITY;
- return OBJC_THREAD_LOW_PRIORITY;
- }
-
- /* Failed */
- return -1;
-}
-
-/* Yield our process time to another thread. */
-void
-__objc_thread_yield(void)
-{
- pthread_yield();
-}
-
-/* Terminate the current thread. */
-int
-__objc_thread_exit(void)
-{
- /* exit the thread */
- pthread_exit(&__objc_thread_exit_status);
-
- /* Failed if we reached here */
- return -1;
-}
-
-/* Returns an integer value which uniquely describes a thread. */
-objc_thread_t
-__objc_thread_id(void)
-{
- pthread_t self = pthread_self();
-
- return (objc_thread_t) pthread_getunique_np (&self);
-}
-
-/* Sets the thread's local storage pointer. */
-int
-__objc_thread_set_data(void *value)
-{
- return pthread_setspecific(_objc_thread_storage, value);
-}
-
-/* Returns the thread's local storage pointer. */
-void *
-__objc_thread_get_data(void)
-{
- void *value = NULL;
-
- if ( !(pthread_getspecific(_objc_thread_storage, &value)) )
- return value;
-
- return NULL;
-}
-
-/* Backend mutex functions */
-
-/* Allocate a mutex. */
-int
-__objc_mutex_allocate(objc_mutex_t mutex)
-{
- if (pthread_mutex_init((pthread_mutex_t *)(&(mutex->backend)),
- pthread_mutexattr_default))
- return -1;
- else
- return 0;
-}
-
-/* Deallocate a mutex. */
-int
-__objc_mutex_deallocate(objc_mutex_t mutex)
-{
- if (pthread_mutex_destroy((pthread_mutex_t *)(&(mutex->backend))))
- return -1;
- else
- return 0;
-}
-
-/* Grab a lock on a mutex. */
-int
-__objc_mutex_lock(objc_mutex_t mutex)
-{
- return pthread_mutex_lock((pthread_mutex_t *)(&(mutex->backend)));
-}
-
-/* Try to grab a lock on a mutex. */
-int
-__objc_mutex_trylock(objc_mutex_t mutex)
-{
- if (pthread_mutex_trylock((pthread_mutex_t *)(&(mutex->backend))) != 1)
- return -1;
- else
- return 0;
-}
-
-/* Unlock the mutex */
-int
-__objc_mutex_unlock(objc_mutex_t mutex)
-{
- return pthread_mutex_unlock((pthread_mutex_t *)(&(mutex->backend)));
-}
-
-/* Backend condition mutex functions */
-
-/* Allocate a condition. */
-int
-__objc_condition_allocate(objc_condition_t condition)
-{
- /* Unimplemented. */
- return -1;
-
- /*
- if (pthread_cond_init((pthread_cond_t *)(&(condition->backend)), NULL))
- return -1;
- else
- return 0;
- */
-}
-
-/* Deallocate a condition. */
-int
-__objc_condition_deallocate(objc_condition_t condition)
-{
- /* Unimplemented. */
- return -1;
-
- /*
- return pthread_cond_destroy((pthread_cond_t *)(&(condition->backend)));
- */
-}
-
-/* Wait on the condition */
-int
-__objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex)
-{
- /* Unimplemented. */
- return -1;
-
- /*
- return pthread_cond_wait((pthread_cond_t *)(&(condition->backend)),
- (pthread_mutex_t *)(&(mutex->backend)));
- */
-}
-
-/* Wake up all threads waiting on this condition. */
-int
-__objc_condition_broadcast(objc_condition_t condition)
-{
- /* Unimplemented. */
- return -1;
-
- /*
- return pthread_cond_broadcast((pthread_cond_t *)(&(condition->backend)));
- */
-}
-
-/* Wake up one thread waiting on this condition. */
-int
-__objc_condition_signal(objc_condition_t condition)
-{
- /* Unimplemented. */
- return -1;
-
- /*
- return pthread_cond_signal((pthread_cond_t *)(&(condition->backend)));
- */
-}
-
-/* End of File */
diff --git a/contrib/libobjc/thr-decosf1.c b/contrib/libobjc/thr-decosf1.c
deleted file mode 100644
index 0f7063b7e836..000000000000
--- a/contrib/libobjc/thr-decosf1.c
+++ /dev/null
@@ -1,281 +0,0 @@
-/* GNU Objective C Runtime Thread Interface
- Copyright (C) 1996, 1997 Free Software Foundation, Inc.
- Contributed by Galen C. Hunt (gchunt@cs.rochester.edu)
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
-details.
-
-You should have received a copy of the GNU General Public License along with
-GNU CC; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with files compiled with
- GCC 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 <pthread.h>
-#include <objc/thr.h>
-#include "runtime.h"
-
-/* Key structure for maintaining thread specific storage */
-static pthread_key_t _objc_thread_storage;
-
-/* Backend initialization functions */
-
-/* Initialize the threads subsystem. */
-int
-__objc_init_thread_system(void)
-{
- /* Initialize the thread storage key */
- return pthread_keycreate(&_objc_thread_storage, NULL);
-}
-
-/* Close the threads subsystem. */
-int
-__objc_close_thread_system(void)
-{
- /* Destroy the thread storage key */
- /* Not implemented yet */
- /* return pthread_key_delete(&_objc_thread_storage); */
- return 0;
-}
-
-/* Backend thread functions */
-
-/* Create a new thread of execution. */
-objc_thread_t
-__objc_thread_detach(void (*func)(void *arg), void *arg)
-{
- objc_thread_t thread_id;
- pthread_t new_thread_handle;
-
- if (pthread_create(&new_thread_handle, pthread_attr_default,
- (void *)func, arg) == 0)
- {
- /* ??? May not work! (64bit) */
- thread_id = *(objc_thread_t *)&new_thread_handle;
- pthread_detach(&new_thread_handle); /* Fully detach thread. */
- }
- else
- thread_id = NULL;
-
- return thread_id;
-}
-
-/* Set the current thread's priority. */
-int
-__objc_thread_set_priority(int priority)
-{
- int sys_priority = 0;
-
- switch (priority)
- {
- case OBJC_THREAD_INTERACTIVE_PRIORITY:
- sys_priority = (PRI_FG_MIN_NP + PRI_FG_MAX_NP) / 2;
- break;
- default:
- case OBJC_THREAD_BACKGROUND_PRIORITY:
- sys_priority = (PRI_BG_MIN_NP + PRI_BG_MAX_NP) / 2;
- break;
- case OBJC_THREAD_LOW_PRIORITY:
- sys_priority = (PRI_BG_MIN_NP + PRI_BG_MAX_NP) / 2;
- break;
- }
-
- /* Change the priority. */
- if (pthread_setprio(pthread_self(), sys_priority) >= 0)
- return 0;
- else
- /* Failed */
- return -1;
-}
-
-/* Return the current thread's priority. */
-int
-__objc_thread_get_priority(void)
-{
- int sys_priority;
-
- if ((sys_priority = pthread_getprio(pthread_self())) >= 0) {
- if (sys_priority >= PRI_FG_MIN_NP && sys_priority <= PRI_FG_MAX_NP)
- return OBJC_THREAD_INTERACTIVE_PRIORITY;
- if (sys_priority >= PRI_BG_MIN_NP && sys_priority <= PRI_BG_MAX_NP)
- return OBJC_THREAD_BACKGROUND_PRIORITY;
- return OBJC_THREAD_LOW_PRIORITY;
- }
-
- /* Failed */
- return -1;
-}
-
-/* Yield our process time to another thread. */
-void
-__objc_thread_yield(void)
-{
- pthread_yield();
-}
-
-/* Terminate the current thread. */
-int
-__objc_thread_exit(void)
-{
- /* exit the thread */
- pthread_exit(&__objc_thread_exit_status);
-
- /* Failed if we reached here */
- return -1;
-}
-
-/* Returns an integer value which uniquely describes a thread. */
-objc_thread_t
-__objc_thread_id(void)
-{
- pthread_t self = pthread_self();
-
- return (objc_thread_t) pthread_getunique_np (&self);
-}
-
-/* Sets the thread's local storage pointer. */
-int
-__objc_thread_set_data(void *value)
-{
- return pthread_setspecific(_objc_thread_storage, value);
-}
-
-/* Returns the thread's local storage pointer. */
-void *
-__objc_thread_get_data(void)
-{
- void *value = NULL;
-
- if ( !(pthread_getspecific(_objc_thread_storage, &value)) )
- return value;
-
- return NULL;
-}
-
-/* Backend mutex functions */
-
-/* Allocate a mutex. */
-int
-__objc_mutex_allocate(objc_mutex_t mutex)
-{
- if (pthread_mutex_init((pthread_mutex_t *)(&(mutex->backend)),
- pthread_mutexattr_default))
- return -1;
- else
- return 0;
-}
-
-/* Deallocate a mutex. */
-int
-__objc_mutex_deallocate(objc_mutex_t mutex)
-{
- if (pthread_mutex_destroy((pthread_mutex_t *)(&(mutex->backend))))
- return -1;
- else
- return 0;
-}
-
-/* Grab a lock on a mutex. */
-int
-__objc_mutex_lock(objc_mutex_t mutex)
-{
- return pthread_mutex_lock((pthread_mutex_t *)(&(mutex->backend)));
-}
-
-/* Try to grab a lock on a mutex. */
-int
-__objc_mutex_trylock(objc_mutex_t mutex)
-{
- if (pthread_mutex_trylock((pthread_mutex_t *)(&(mutex->backend))) != 1)
- return -1;
- else
- return 0;
-}
-
-/* Unlock the mutex */
-int
-__objc_mutex_unlock(objc_mutex_t mutex)
-{
- return pthread_mutex_unlock((pthread_mutex_t *)(&(mutex->backend)));
-}
-
-/* Backend condition mutex functions */
-
-/* Allocate a condition. */
-int
-__objc_condition_allocate(objc_condition_t condition)
-{
- /* Unimplemented. */
- return -1;
-
- /*
- if (pthread_cond_init((pthread_cond_t *)(&(condition->backend)), NULL))
- return -1;
- else
- return 0;
- */
-}
-
-/* Deallocate a condition. */
-int
-__objc_condition_deallocate(objc_condition_t condition)
-{
- /* Unimplemented. */
- return -1;
-
- /*
- return pthread_cond_destroy((pthread_cond_t *)(&(condition->backend)));
- */
-}
-
-/* Wait on the condition */
-int
-__objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex)
-{
- /* Unimplemented. */
- return -1;
-
- /*
- return pthread_cond_wait((pthread_cond_t *)(&(condition->backend)),
- (pthread_mutex_t *)(&(mutex->backend)));
- */
-}
-
-/* Wake up all threads waiting on this condition. */
-int
-__objc_condition_broadcast(objc_condition_t condition)
-{
- /* Unimplemented. */
- return -1;
-
- /*
- return pthread_cond_broadcast((pthread_cond_t *)(&(condition->backend)));
- */
-}
-
-/* Wake up one thread waiting on this condition. */
-int
-__objc_condition_signal(objc_condition_t condition)
-{
- /* Unimplemented. */
- return -1;
-
- /*
- return pthread_cond_signal((pthread_cond_t *)(&(condition->backend)));
- */
-}
-
-/* End of File */
diff --git a/contrib/libobjc/thr-irix.c b/contrib/libobjc/thr-irix.c
deleted file mode 100644
index 528a3e3a434d..000000000000
--- a/contrib/libobjc/thr-irix.c
+++ /dev/null
@@ -1,235 +0,0 @@
-/* GNU Objective C Runtime Thread Interface - SGI IRIX Implementation
- Copyright (C) 1996, 1997 Free Software Foundation, Inc.
- Contributed by Galen C. Hunt (gchunt@cs.rochester.edu)
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
-details.
-
-You should have received a copy of the GNU General Public License along with
-GNU CC; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with files compiled with
- GCC 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 <stdlib.h>
-#include <sys/types.h>
-#include <sys/sysmp.h>
-#include <sys/prctl.h>
-#include <ulocks.h>
-#include <objc/thr.h>
-#include "runtime.h"
-
-/* Key structure for maintaining thread specific storage */
-static void * __objc_shared_arena_handle = NULL;
-
-/* Backend initialization functions */
-
-/* Initialize the threads subsystem. */
-int
-__objc_init_thread_system(void)
-{
- /* Name of IRIX arena. */
- char arena_name[64];
-
- DEBUG_PRINTF("__objc_init_thread_system\n");
-
- /* Construct a temporary name for arena. */
- sprintf(arena_name, "/usr/tmp/objc_%05u", (unsigned)getpid());
-
- /* Up to 256 threads. Arena only for threads. */
- usconfig(CONF_INITUSERS, 256);
- usconfig(CONF_ARENATYPE, US_SHAREDONLY);
-
- /* Initialize the arena */
- if (!(__objc_shared_arena_handle = usinit(arena_name)))
- /* Failed */
- return -1;
-
- return 0;
-}
-
-/* Close the threads subsystem. */
-int
-__objc_close_thread_system(void)
-{
- return 0;
-}
-
-/* Backend thread functions */
-
-/* Create a new thread of execution. */
-objc_thread_t
-__objc_thread_detach(void (*func)(void *arg), void *arg)
-{
- objc_thread_t thread_id;
- int sys_id;
-
- if ((sys_id = sproc((void *)func, PR_SALL, arg)) >= 0)
- thread_id = (objc_thread_t)sys_id;
- else
- thread_id = NULL;
-
- return thread_id;
-}
-
-/* Set the current thread's priority. */
-int
-__objc_thread_set_priority(int priority)
-{
- /* Not implemented yet */
- return -1;
-}
-
-/* Return the current thread's priority. */
-int
-__objc_thread_get_priority(void)
-{
- /* Not implemented yet */
- return OBJC_THREAD_INTERACTIVE_PRIORITY;
-}
-
-/* Yield our process time to another thread. */
-void
-__objc_thread_yield(void)
-{
- sginap(0);
-}
-
-/* Terminate the current thread. */
-int
-__objc_thread_exit(void)
-{
- /* IRIX only has exit. */
- exit(__objc_thread_exit_status);
-
- /* Failed if we reached here */
- return -1;
-}
-
-/* Returns an integer value which uniquely describes a thread. */
-objc_thread_t
-__objc_thread_id(void)
-{
- /* Threads are processes. */
- return (objc_thread_t)get_pid();
-}
-
-/* Sets the thread's local storage pointer. */
-int
-__objc_thread_set_data(void *value)
-{
- *((void **)&PRDA->usr_prda) = value;
- return 0;
-}
-
-/* Returns the thread's local storage pointer. */
-void *
-__objc_thread_get_data(void)
-{
- return *((void **)&PRDA->usr_prda);
-}
-
-/* Backend mutex functions */
-
-/* Allocate a mutex. */
-int
-__objc_mutex_allocate(objc_mutex_t mutex)
-{
- if (!( (ulock_t)(mutex->backend) = usnewlock(__objc_shared_arena_handle) ))
- return -1;
- else
- return 0;
-}
-
-/* Deallocate a mutex. */
-int
-__objc_mutex_deallocate(objc_mutex_t mutex)
-{
- usfreelock((ulock_t)(mutex->backend), __objc_shared_arena_handle);
- return 0;
-}
-
-/* Grab a lock on a mutex. */
-int
-__objc_mutex_lock(objc_mutex_t mutex)
-{
- if (ussetlock((ulock_t)(mutex->backend)) == 0)
- return -1;
- else
- return 0;
-}
-
-/* Try to grab a lock on a mutex. */
-int
-__objc_mutex_trylock(objc_mutex_t mutex)
-{
- if (ustestlock((ulock_t)(mutex->backend)) == 0)
- return -1;
- else
- return 0;
-}
-
-/* Unlock the mutex */
-int
-__objc_mutex_unlock(objc_mutex_t mutex)
-{
- usunsetlock((ulock_t)(mutex->backend));
- return 0;
-}
-
-/* Backend condition mutex functions */
-
-/* Allocate a condition. */
-int
-__objc_condition_allocate(objc_condition_t condition)
-{
- /* Unimplemented. */
- return -1;
-}
-
-/* Deallocate a condition. */
-int
-__objc_condition_deallocate(objc_condition_t condition)
-{
- /* Unimplemented. */
- return -1;
-}
-
-/* Wait on the condition */
-int
-__objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex)
-{
- /* Unimplemented. */
- return -1;
-}
-
-/* Wake up all threads waiting on this condition. */
-int
-__objc_condition_broadcast(objc_condition_t condition)
-{
- /* Unimplemented. */
- return -1;
-}
-
-/* Wake up one thread waiting on this condition. */
-int
-__objc_condition_signal(objc_condition_t condition)
-{
- /* Unimplemented. */
- return -1;
-}
-
-/* End of File */
diff --git a/contrib/libobjc/thr-mach.c b/contrib/libobjc/thr-mach.c
deleted file mode 100644
index 44af0c1e2869..000000000000
--- a/contrib/libobjc/thr-mach.c
+++ /dev/null
@@ -1,312 +0,0 @@
-/* GNU Objective C Runtime Thread Implementation
- Copyright (C) 1996, 1997 Free Software Foundation, Inc.
- Contributed by Galen C. Hunt (gchunt@cs.rochester.edu)
- Modified for Mach threads by Bill Bumgarner <bbum@friday.com>
- Condition functions added by Mircea Oancea <mircea@first.elcom.pub.ro>
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
-details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with files compiled with
- GCC 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 <mach/mach.h>
-#include <mach/cthreads.h>
-#include <objc/thr.h>
-#include "runtime.h"
-
-/*
- Obtain the maximum thread priority that can set for t. Under the
- mach threading model, it is possible for the developer to adjust the
- maximum priority downward only-- cannot be raised without superuser
- privileges. Once lowered, it cannot be raised.
- */
-static int __mach_get_max_thread_priority(cthread_t t, int *base)
-{
- thread_t threadP;
- kern_return_t error;
- struct thread_sched_info info;
- unsigned int info_count=THREAD_SCHED_INFO_COUNT;
-
- if (t == NULL)
- return -1;
-
- threadP = cthread_thread(t); /* get thread underlying */
-
- error=thread_info(threadP, THREAD_SCHED_INFO,
- (thread_info_t)&info, &info_count);
-
- if (error != KERN_SUCCESS)
- return -1;
-
- if (base != NULL)
- *base = info.base_priority;
-
- return info.max_priority;
-}
-
-/* Backend initialization functions */
-
-/* Initialize the threads subsystem. */
-int
-__objc_init_thread_system(void)
-{
- return 0;
-}
-
-/* Close the threads subsystem. */
-int
-__objc_close_thread_system(void)
-{
- return 0;
-}
-
-/* Backend thread functions */
-
-/* Create a new thread of execution. */
-objc_thread_t
-__objc_thread_detach(void (*func)(void *arg), void *arg)
-{
- objc_thread_t thread_id;
- cthread_t new_thread_handle;
-
- /* create thread */
- new_thread_handle = cthread_fork((cthread_fn_t)func, arg);
-
- if(new_thread_handle)
- {
- /* this is not terribly portable */
- thread_id = *(objc_thread_t *)&new_thread_handle;
- cthread_detach(new_thread_handle);
- }
- else
- thread_id = NULL;
-
- return thread_id;
-}
-
-/* Set the current thread's priority. */
-int
-__objc_thread_set_priority(int priority)
-{
- objc_thread_t *t = objc_thread_id();
- cthread_t cT = (cthread_t) t;
- int maxPriority = __mach_get_max_thread_priority(cT, NULL);
- int sys_priority = 0;
-
- if (maxPriority == -1)
- return -1;
-
- switch (priority)
- {
- case OBJC_THREAD_INTERACTIVE_PRIORITY:
- sys_priority = maxPriority;
- break;
- case OBJC_THREAD_BACKGROUND_PRIORITY:
- sys_priority = (maxPriority * 2) / 3;
- break;
- case OBJC_THREAD_LOW_PRIORITY:
- sys_priority = maxPriority / 3;
- break;
- default:
- return -1;
- }
-
- if (sys_priority == 0)
- return -1;
-
- /* Change the priority */
- if (cthread_priority(cT, sys_priority, 0) == KERN_SUCCESS)
- return 0;
- else
- return -1;
-}
-
-/* Return the current thread's priority. */
-int
-__objc_thread_get_priority(void)
-{
- objc_thread_t *t = objc_thread_id();
- cthread_t cT = (cthread_t) t; /* see objc_thread_id() */
- int basePriority;
- int maxPriority;
- int sys_priority = 0;
-
- int interactiveT, backgroundT, lowT; /* thresholds */
-
- maxPriority = __mach_get_max_thread_priority(cT, &basePriority);
-
- if(maxPriority == -1)
- return -1;
-
- if (basePriority > ( (maxPriority * 2) / 3))
- return OBJC_THREAD_INTERACTIVE_PRIORITY;
-
- if (basePriority > ( maxPriority / 3))
- return OBJC_THREAD_BACKGROUND_PRIORITY;
-
- return OBJC_THREAD_LOW_PRIORITY;
-}
-
-/* Yield our process time to another thread. */
-void
-__objc_thread_yield(void)
-{
- cthread_yield();
-}
-
-/* Terminate the current thread. */
-int
-__objc_thread_exit(void)
-{
- /* exit the thread */
- cthread_exit(&__objc_thread_exit_status);
-
- /* Failed if we reached here */
- return -1;
-}
-
-/* Returns an integer value which uniquely describes a thread. */
-objc_thread_t
-__objc_thread_id(void)
-{
- cthread_t self = cthread_self();
-
- return *(objc_thread_t *)&self;
-}
-
-/* Sets the thread's local storage pointer. */
-int
-__objc_thread_set_data(void *value)
-{
- cthread_set_data(cthread_self(), (any_t) value);
- return 0;
-}
-
-/* Returns the thread's local storage pointer. */
-void *
-__objc_thread_get_data(void)
-{
- return (void *) cthread_data(cthread_self());
-}
-
-/* Backend mutex functions */
-
-/* Allocate a mutex. */
-int
-__objc_mutex_allocate(objc_mutex_t mutex)
-{
- int err = 0;
- mutex->backend = objc_malloc(sizeof(struct mutex));
-
- err = mutex_init((mutex_t)(mutex->backend));
-
- if (err != 0)
- {
- objc_free(mutex->backend);
- return -1;
- }
- else
- return 0;
-}
-
-/* Deallocate a mutex. */
-int
-__objc_mutex_deallocate(objc_mutex_t mutex)
-{
- mutex_clear((mutex_t)(mutex->backend));
-
- objc_free(mutex->backend);
- mutex->backend = NULL;
- return 0;
-}
-
-/* Grab a lock on a mutex. */
-int
-__objc_mutex_lock(objc_mutex_t mutex)
-{
- mutex_lock((mutex_t)(mutex->backend));
- return 0;
-}
-
-/* Try to grab a lock on a mutex. */
-int
-__objc_mutex_trylock(objc_mutex_t mutex)
-{
- if (mutex_try_lock((mutex_t)(mutex->backend)) == 0)
- return -1;
- else
- return 0;
-}
-
-/* Unlock the mutex */
-int
-__objc_mutex_unlock(objc_mutex_t mutex)
-{
- mutex_unlock((mutex_t)(mutex->backend));
- return 0;
-}
-
-/* Backend condition mutex functions */
-
-/* Allocate a condition. */
-int
-__objc_condition_allocate(objc_condition_t condition)
-{
- condition->backend = objc_malloc(sizeof(struct condition));
- condition_init((condition_t)(condition->backend));
- return 0;
-}
-
-/* Deallocate a condition. */
-int
-__objc_condition_deallocate(objc_condition_t condition)
-{
- condition_clear((condition_t)(condition->backend));
- objc_free(condition->backend);
- condition->backend = NULL;
- return 0;
-}
-
-/* Wait on the condition */
-int
-__objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex)
-{
- condition_wait((condition_t)(condition->backend),
- (mutex_t)(mutex->backend));
- return 0;
-}
-
-/* Wake up all threads waiting on this condition. */
-int
-__objc_condition_broadcast(objc_condition_t condition)
-{
- condition_broadcast((condition_t)(condition->backend));
- return 0;
-}
-
-/* Wake up one thread waiting on this condition. */
-int
-__objc_condition_signal(objc_condition_t condition)
-{
- condition_signal((condition_t)(condition->backend));
- return 0;
-}
-
-/* End of File */
diff --git a/contrib/libobjc/thr-os2.c b/contrib/libobjc/thr-os2.c
deleted file mode 100644
index a0d7d436613e..000000000000
--- a/contrib/libobjc/thr-os2.c
+++ /dev/null
@@ -1,267 +0,0 @@
-/* GNU Objective C Runtime Thread Interface - OS/2 emx Implementation
- Copyright (C) 1996, 1997 Free Software Foundation, Inc.
- Contributed by Thomas Baier (baier@ci.tuwien.ac.at)
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
-details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with files compiled with
- GCC 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 <objc/thr.h>
-#include "runtime.h"
-
-#define INCL_DOSSEMAPHORES
-#define INCL_DOSPROCESS
-
-/*
- * conflicts with objc.h: SEL, BOOL, id
- * solution: prefixing those with _OS2_ before including <os2.h>
- */
-#define SEL _OS2_SEL
-#define BOOL _OS2_BOOL
-#define id _OS2_id
-#include <os2.h>
-#undef id
-#undef SEL
-#undef BOOL
-
-#include <stdlib.h>
-
-/* Backend initialization functions */
-
-/* Initialize the threads subsystem. */
-int
-__objc_init_thread_system(void)
-{
- return 0;
-}
-
-/* Close the threads subsystem. */
-int
-__objc_close_thread_system(void)
-{
- return 0;
-}
-
-/* Backend thread functions */
-
-/* Create a new thread of execution. */
-objc_thread_t
-__objc_thread_detach(void (*func)(void *arg), void *arg)
-{
- int thread_id = 0;
-
- if ((thread_id = _beginthread (func,NULL,32768,arg)) < 0)
- thread_id = 0;
-
- return (objc_thread_t)thread_id;
-}
-
-/* Set the current thread's priority. */
-int
-__objc_thread_set_priority(int priority)
-{
- ULONG sys_class = 0;
- ULONG sys_priority = 0;
-
- /* OBJC_THREAD_INTERACTIVE_PRIORITY -> PRTYC_FOREGROUNDSERVER
- * OBJC_THREAD_BACKGROUND_PRIORITY -> PRTYC_REGULAR
- * OBJC_THREAD_LOW_PRIORITY -> PRTYC_IDLETIME */
-
- switch (priority) {
- case OBJC_THREAD_INTERACTIVE_PRIORITY:
- sys_class = PRTYC_REGULAR;
- sys_priority = 10;
- break;
- default:
- case OBJC_THREAD_BACKGROUND_PRIORITY:
- sys_class = PRTYC_IDLETIME;
- sys_priority = 25;
- break;
- case OBJC_THREAD_LOW_PRIORITY:
- sys_class = PRTYC_IDLETIME;
- sys_priority = 0;
- break;
- }
-
- /* Change priority */
- if (!DosSetPriority (PRTYS_THREAD,sys_class,sys_priority,*_threadid))
- return 0;
- else
- return -1;
-}
-
-/* Return the current thread's priority. */
-int
-__objc_thread_get_priority(void)
-{
- PTIB ptib;
- PPIB ppib;
-
- /* get information about current thread */
- DosGetInfoBlocks (&ptib,&ppib);
-
- switch (ptib->tib_ptib2->tib2_ulpri)
- {
- case PRTYC_IDLETIME:
- case PRTYC_REGULAR:
- case PRTYC_TIMECRITICAL:
- case PRTYC_FOREGROUNDSERVER:
- default:
- return OBJC_THREAD_INTERACTIVE_PRIORITY;
- }
-
- return -1;
-}
-
-/* Yield our process time to another thread. */
-void
-__objc_thread_yield(void)
-{
- DosSleep (0);
-}
-
-/* Terminate the current thread. */
-int
-__objc_thread_exit(void)
-{
- /* terminate the thread, NEVER use DosExit () */
- _endthread ();
-
- /* Failed if we reached here */
- return -1;
-}
-
-/* Returns an integer value which uniquely describes a thread. */
-objc_thread_t
-__objc_thread_id(void)
-{
- return (objc_thread_t) *_threadid;
-}
-
-/* Sets the thread's local storage pointer. */
-int
-__objc_thread_set_data(void *value)
-{
- *_threadstore () = value;
-
- return 0;
-}
-
-/* Returns the thread's local storage pointer. */
-void *
-__objc_thread_get_data(void)
-{
- return *_threadstore ();
-}
-
-/* Backend mutex functions */
-
-/* Allocate a mutex. */
-int
-__objc_mutex_allocate(objc_mutex_t mutex)
-{
- if (DosCreateMutexSem (NULL, (HMTX)(&(mutex->backend)),0L,0) > 0)
- return -1;
- else
- return 0;
-}
-
-/* Deallocate a mutex. */
-int
-__objc_mutex_deallocate(objc_mutex_t mutex)
-{
- DosCloseMutexSem ((HMTX)(mutex->backend));
- return 0;
-}
-
-/* Grab a lock on a mutex. */
-int
-__objc_mutex_lock(objc_mutex_t mutex)
-{
- if (DosRequestMutexSem ((HMTX)(mutex->backend),-1L) != 0)
- return -1;
- else
- return 0;
-}
-
-/* Try to grab a lock on a mutex. */
-int
-__objc_mutex_trylock(objc_mutex_t mutex)
-{
- if (DosRequestMutexSem ((HMTX)(mutex->backend),0L) != 0)
- return -1;
- else
- return 0;
-}
-
-/* Unlock the mutex */
-int
-__objc_mutex_unlock(objc_mutex_t mutex)
-{
- if (DosReleaseMutexSem((HMTX)(mutex->backend)) != 0)
- return -1;
- else
- return 0;
-}
-
-/* Backend condition mutex functions */
-
-/* Allocate a condition. */
-int
-__objc_condition_allocate(objc_condition_t condition)
-{
- /* Unimplemented. */
- return -1;
-}
-
-/* Deallocate a condition. */
-int
-__objc_condition_deallocate(objc_condition_t condition)
-{
- /* Unimplemented. */
- return -1;
-}
-
-/* Wait on the condition */
-int
-__objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex)
-{
- /* Unimplemented. */
- return -1;
-}
-
-/* Wake up all threads waiting on this condition. */
-int
-__objc_condition_broadcast(objc_condition_t condition)
-{
- /* Unimplemented. */
- return -1;
-}
-
-/* Wake up one thread waiting on this condition. */
-int
-__objc_condition_signal(objc_condition_t condition)
-{
- /* Unimplemented. */
- return -1;
-}
-
-/* End of File */
diff --git a/contrib/libobjc/thr-posix.c b/contrib/libobjc/thr-posix.c
deleted file mode 100644
index 5b40f711be80..000000000000
--- a/contrib/libobjc/thr-posix.c
+++ /dev/null
@@ -1,229 +0,0 @@
-/* GNU Objective C Runtime Thread Interface for POSIX compliant threads
- Copyright (C) 1996, 1997 Free Software Foundation, Inc.
- Contributed by Galen C. Hunt (gchunt@cs.rochester.edu)
- Modified for Linux/Pthreads by Kai-Uwe Sattler (kus@iti.cs.uni-magdeburg.de)
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
-details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with files compiled with
- GCC 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 <objc/thr.h>
-#include "runtime.h"
-#include <pthread.h>
-
-/* Key structure for maintaining thread specific storage */
-static pthread_key_t _objc_thread_storage;
-
-/* Backend initialization functions */
-
-/* Initialize the threads subsystem. */
-int
-__objc_init_thread_system(void)
-{
- /* Initialize the thread storage key */
- return pthread_key_create(&_objc_thread_storage, NULL);
-}
-
-/* Close the threads subsystem. */
-int
-__objc_close_thread_system(void)
-{
- return 0;
-}
-
-/* Backend thread functions */
-
-/* Create a new thread of execution. */
-objc_thread_t
-__objc_thread_detach(void (*func)(void *arg), void *arg)
-{
- objc_thread_t thread_id;
- pthread_t new_thread_handle;
-
- if ( !(pthread_create(&new_thread_handle, NULL, (void *)func, arg)) )
- thread_id = *(objc_thread_t *)&new_thread_handle;
- else
- thread_id = NULL;
-
- return thread_id;
-}
-
-/* Set the current thread's priority. */
-int
-__objc_thread_set_priority(int priority)
-{
- /* Not implemented yet */
- return -1;
-}
-
-/* Return the current thread's priority. */
-int
-__objc_thread_get_priority(void)
-{
- /* Not implemented yet */
- return -1;
-}
-
-/* Yield our process time to another thread. */
-void
-__objc_thread_yield(void)
-{
- sched_yield();
-}
-
-/* Terminate the current thread. */
-int
-__objc_thread_exit(void)
-{
- /* exit the thread */
- pthread_exit(&__objc_thread_exit_status);
-
- /* Failed if we reached here */
- return -1;
-}
-
-/* Returns an integer value which uniquely describes a thread. */
-objc_thread_t
-__objc_thread_id(void)
-{
- pthread_t self = pthread_self();
-
- return *(objc_thread_t *)&self;
-}
-
-/* Sets the thread's local storage pointer. */
-int
-__objc_thread_set_data(void *value)
-{
- return pthread_setspecific(_objc_thread_storage, value);
-}
-
-/* Returns the thread's local storage pointer. */
-void *
-__objc_thread_get_data(void)
-{
- return pthread_getspecific(_objc_thread_storage);
-}
-
-/* Backend mutex functions */
-
-/* Allocate a mutex. */
-int
-__objc_mutex_allocate(objc_mutex_t mutex)
-{
- mutex->backend = objc_malloc(sizeof(pthread_mutex_t));
-
- if (pthread_mutex_init((pthread_mutex_t *)mutex->backend, NULL))
- {
- objc_free(mutex->backend);
- mutex->backend = NULL;
- return -1;
- }
-
- return 0;
-}
-
-/* Deallocate a mutex. */
-int
-__objc_mutex_deallocate(objc_mutex_t mutex)
-{
- if (pthread_mutex_destroy((pthread_mutex_t *)mutex->backend))
- return -1;
-
- objc_free(mutex->backend);
- mutex->backend = NULL;
- return 0;
-}
-
-/* Grab a lock on a mutex. */
-int
-__objc_mutex_lock(objc_mutex_t mutex)
-{
- return pthread_mutex_lock((pthread_mutex_t *)mutex->backend);
-}
-
-/* Try to grab a lock on a mutex. */
-int
-__objc_mutex_trylock(objc_mutex_t mutex)
-{
- return pthread_mutex_trylock((pthread_mutex_t *)mutex->backend);
-}
-
-/* Unlock the mutex */
-int
-__objc_mutex_unlock(objc_mutex_t mutex)
-{
- return pthread_mutex_unlock((pthread_mutex_t *)mutex->backend);
-}
-
-/* Backend condition mutex functions */
-
-/* Allocate a condition. */
-int
-__objc_condition_allocate(objc_condition_t condition)
-{
- condition->backend = objc_malloc(sizeof(pthread_cond_t));
-
- if (pthread_cond_init((pthread_cond_t *)condition->backend, NULL))
- {
- objc_free(condition->backend);
- condition->backend = NULL;
- return -1;
- }
-
- return 0;
-}
-
-/* Deallocate a condition. */
-int
-__objc_condition_deallocate(objc_condition_t condition)
-{
- if (pthread_cond_destroy((pthread_cond_t *)condition->backend))
- return -1;
-
- objc_free(condition->backend);
- condition->backend = NULL;
- return 0;
-}
-
-/* Wait on the condition */
-int
-__objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex)
-{
- return pthread_cond_wait((pthread_cond_t *)condition->backend,
- (pthread_mutex_t *)mutex->backend);
-}
-
-/* Wake up all threads waiting on this condition. */
-int
-__objc_condition_broadcast(objc_condition_t condition)
-{
- return pthread_cond_broadcast((pthread_cond_t *)condition->backend);
-}
-
-/* Wake up one thread waiting on this condition. */
-int
-__objc_condition_signal(objc_condition_t condition)
-{
- return pthread_cond_signal((pthread_cond_t *)condition->backend);
-}
-
-/* End of File */
diff --git a/contrib/libobjc/thr-pthreads.c b/contrib/libobjc/thr-pthreads.c
deleted file mode 100644
index 2efdd15bc541..000000000000
--- a/contrib/libobjc/thr-pthreads.c
+++ /dev/null
@@ -1,218 +0,0 @@
-/* GNU Objective C Runtime Thread Implementation for PCThreads under GNU/Linux.
- Copyright (C) 1996, 1997 Free Software Foundation, Inc.
- Contributed by Scott Christley <scottc@net-community.com>
- Condition functions added by: Mircea Oancea <mircea@first.elcom.pub.ro>
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
-details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with files compiled with
- GCC 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 <pcthread.h>
-#include <objc/thr.h>
-#include "runtime.h"
-
-/* Key structure for maintaining thread specific storage */
-static pthread_key_t _objc_thread_storage;
-
-/* Backend initialization functions */
-
-/* Initialize the threads subsystem. */
-int
-__objc_init_thread_system(void)
-{
- /* Initialize the thread storage key */
- return pthread_key_create(&_objc_thread_storage, NULL);
-}
-
-/* Close the threads subsystem. */
-int
-__objc_close_thread_system(void)
-{
- /* Destroy the thread storage key */
- /* Not implemented yet */
- /* return pthread_key_delete(&_objc_thread_storage); */
- return 0;
-}
-
-/* Backend thread functions */
-
-/* Create a new thread of execution. */
-objc_thread_t
-__objc_thread_detach(void (*func)(void *arg), void *arg)
-{
- objc_thread_t thread_id;
- pthread_t new_thread_handle;
-
- if ( !(pthread_create(&new_thread_handle, NULL, (void *)func, arg)) )
- thread_id = *(objc_thread_t *)&new_thread_handle;
- else
- thread_id = NULL;
-
- return thread_id;
-}
-
-/* Set the current thread's priority. */
-int
-__objc_thread_set_priority(int priority)
-{
- /* Not implemented yet */
- return -1;
-}
-
-/* Return the current thread's priority. */
-int
-__objc_thread_get_priority(void)
-{
- /* Not implemented yet */
- return OBJC_THREAD_INTERACTIVE_PRIORITY;
-}
-
-/* Yield our process time to another thread. */
-void
-__objc_thread_yield(void)
-{
- pthread_yield(NULL);
-}
-
-/* Terminate the current thread. */
-int
-__objc_thread_exit(void)
-{
- /* exit the thread */
- pthread_exit(&__objc_thread_exit_status);
-
- /* Failed if we reached here */
- return -1;
-}
-
-/* Returns an integer value which uniquely describes a thread. */
-objc_thread_t
-__objc_thread_id(void)
-{
- pthread_t self = pthread_self();
-
- return *(objc_thread_t *)&self;
-}
-
-/* Sets the thread's local storage pointer. */
-int
-__objc_thread_set_data(void *value)
-{
- return pthread_setspecific(_objc_thread_storage, value);
-}
-
-/* Returns the thread's local storage pointer. */
-void *
-__objc_thread_get_data(void)
-{
- void *value = NULL;
-
- if ( !(pthread_getspecific(_objc_thread_storage, &value)) )
- return value;
-
- return NULL;
-}
-
-/* Backend mutex functions */
-
-/* Allocate a mutex. */
-int
-__objc_mutex_allocate(objc_mutex_t mutex)
-{
- if (pthread_mutex_init((pthread_mutex_t *)(&(mutex->backend)), NULL))
- return -1;
- else
- return 0;
-}
-
-/* Deallocate a mutex. */
-int
-__objc_mutex_deallocate(objc_mutex_t mutex)
-{
- if (pthread_mutex_destroy((pthread_mutex_t *)(&(mutex->backend))))
- return -1;
- else
- return 0;
-}
-
-/* Grab a lock on a mutex. */
-int
-__objc_mutex_lock(objc_mutex_t mutex)
-{
- return pthread_mutex_lock((pthread_mutex_t *)(&(mutex->backend)));
-}
-
-/* Try to grab a lock on a mutex. */
-int
-__objc_mutex_trylock(objc_mutex_t mutex)
-{
- return pthread_mutex_trylock((pthread_mutex_t *)(&(mutex->backend)));
-}
-
-/* Unlock the mutex */
-int
-__objc_mutex_unlock(objc_mutex_t mutex)
-{
- return pthread_mutex_unlock((pthread_mutex_t *)(&(mutex->backend)));
-}
-
-/* Backend condition mutex functions */
-
-/* Allocate a condition. */
-int
-__objc_condition_allocate(objc_condition_t condition)
-{
- if (pthread_cond_init((pthread_cond_t *)(&(condition->backend)), NULL))
- return -1;
- else
- return 0;
-}
-
-/* Deallocate a condition. */
-int
-__objc_condition_deallocate(objc_condition_t condition)
-{
- return pthread_cond_destroy((pthread_cond_t *)(&(condition->backend)));
-}
-
-/* Wait on the condition */
-int
-__objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex)
-{
- return pthread_cond_wait((pthread_cond_t *)(&(condition->backend)),
- (pthread_mutex_t *)(&(mutex->backend)));
-}
-
-/* Wake up all threads waiting on this condition. */
-int
-__objc_condition_broadcast(objc_condition_t condition)
-{
- return pthread_cond_broadcast((pthread_cond_t *)(&(condition->backend)));
-}
-
-/* Wake up one thread waiting on this condition. */
-int
-__objc_condition_signal(objc_condition_t condition)
-{
- return pthread_cond_signal((pthread_cond_t *)(&(condition->backend)));
-}
-
-/* End of File */
diff --git a/contrib/libobjc/thr-single.c b/contrib/libobjc/thr-single.c
deleted file mode 100644
index b196677c6b69..000000000000
--- a/contrib/libobjc/thr-single.c
+++ /dev/null
@@ -1,192 +0,0 @@
-/* GNU Objective C Runtime Thread Implementation
- Copyright (C) 1996, 1997 Free Software Foundation, Inc.
- Contributed by Galen C. Hunt (gchunt@cs.rochester.edu)
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
-details.
-
-You should have received a copy of the GNU General Public License along with
-GNU CC; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with files compiled with
- GCC 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 <objc/thr.h>
-#include "runtime.h"
-
-/* Thread local storage for a single thread */
-static void *thread_local_storage = NULL;
-
-/* Backend initialization functions */
-
-/* Initialize the threads subsystem. */
-int
-__objc_init_thread_system(void)
-{
- /* No thread support available */
- return -1;
-}
-
-/* Close the threads subsystem. */
-int
-__objc_close_thread_system(void)
-{
- /* No thread support available */
- return -1;
-}
-
-/* Backend thread functions */
-
-/* Create a new thread of execution. */
-objc_thread_t
-__objc_thread_detach(void (*func)(void *arg), void *arg)
-{
- /* No thread support available */
- return NULL;
-}
-
-/* Set the current thread's priority. */
-int
-__objc_thread_set_priority(int priority)
-{
- /* No thread support available */
- return -1;
-}
-
-/* Return the current thread's priority. */
-int
-__objc_thread_get_priority(void)
-{
- return OBJC_THREAD_INTERACTIVE_PRIORITY;
-}
-
-/* Yield our process time to another thread. */
-void
-__objc_thread_yield(void)
-{
- return;
-}
-
-/* Terminate the current thread. */
-int
-__objc_thread_exit(void)
-{
- /* No thread support available */
- /* Should we really exit the program */
- /* exit(&__objc_thread_exit_status); */
- return -1;
-}
-
-/* Returns an integer value which uniquely describes a thread. */
-objc_thread_t
-__objc_thread_id(void)
-{
- /* No thread support, use 1. */
- return (objc_thread_t)1;
-}
-
-/* Sets the thread's local storage pointer. */
-int
-__objc_thread_set_data(void *value)
-{
- thread_local_storage = value;
- return 0;
-}
-
-/* Returns the thread's local storage pointer. */
-void *
-__objc_thread_get_data(void)
-{
- return thread_local_storage;
-}
-
-/* Backend mutex functions */
-
-/* Allocate a mutex. */
-int
-__objc_mutex_allocate(objc_mutex_t mutex)
-{
- return 0;
-}
-
-/* Deallocate a mutex. */
-int
-__objc_mutex_deallocate(objc_mutex_t mutex)
-{
- return 0;
-}
-
-/* Grab a lock on a mutex. */
-int
-__objc_mutex_lock(objc_mutex_t mutex)
-{
- /* There can only be one thread, so we always get the lock */
- return 0;
-}
-
-/* Try to grab a lock on a mutex. */
-int
-__objc_mutex_trylock(objc_mutex_t mutex)
-{
- /* There can only be one thread, so we always get the lock */
- return 0;
-}
-
-/* Unlock the mutex */
-int
-__objc_mutex_unlock(objc_mutex_t mutex)
-{
- return 0;
-}
-
-/* Backend condition mutex functions */
-
-/* Allocate a condition. */
-int
-__objc_condition_allocate(objc_condition_t condition)
-{
- return 0;
-}
-
-/* Deallocate a condition. */
-int
-__objc_condition_deallocate(objc_condition_t condition)
-{
- return 0;
-}
-
-/* Wait on the condition */
-int
-__objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex)
-{
- return 0;
-}
-
-/* Wake up all threads waiting on this condition. */
-int
-__objc_condition_broadcast(objc_condition_t condition)
-{
- return 0;
-}
-
-/* Wake up one thread waiting on this condition. */
-int
-__objc_condition_signal(objc_condition_t condition)
-{
- return 0;
-}
-
-/* End of File */
diff --git a/contrib/libobjc/thr-solaris.c b/contrib/libobjc/thr-solaris.c
deleted file mode 100644
index 90351b43cf6c..000000000000
--- a/contrib/libobjc/thr-solaris.c
+++ /dev/null
@@ -1,259 +0,0 @@
-/* GNU Objective C Runtime Thread Interface
- Copyright (C) 1996, 1997 Free Software Foundation, Inc.
- Contributed by Galen C. Hunt (gchunt@cs.rochester.edu)
- Conditions added by Mircea Oancea (mircea@first.elcom.pub.ro)
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
-details.
-
-You should have received a copy of the GNU General Public License along with
-GNU CC; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with files compiled with
- GCC 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 <objc/thr.h>
-#include "runtime.h"
-
-#include <thread.h>
-#include <synch.h>
-#include <errno.h>
-
-/* Key structure for maintaining thread specific storage */
-static thread_key_t __objc_thread_data_key;
-
-/* Backend initialization functions */
-
-/* Initialize the threads subsystem. */
-int
-__objc_init_thread_system(void)
-{
- /* Initialize the thread storage key */
- if (thr_keycreate(&__objc_thread_data_key, NULL) == 0)
- return 0;
- else
- return -1;
-}
-
-/* Close the threads subsystem. */
-int
-__objc_close_thread_system(void)
-{
- return 0;
-}
-
-/* Backend thread functions */
-
-/* Create a new thread of execution. */
-objc_thread_t
-__objc_thread_detach(void (*func)(void *arg), void *arg)
-{
- objc_thread_t thread_id;
- thread_t new_thread_id = 0;
-
- if (thr_create(NULL, 0, (void *)func, arg,
- THR_DETACHED | THR_NEW_LWP,
- &new_thread_id) == 0)
- thread_id = *(objc_thread_t *)&new_thread_id;
- else
- thread_id = NULL;
-
- return thread_id;
-}
-
-/* Set the current thread's priority. */
-int
-__objc_thread_set_priority(int priority)
-{
- int sys_priority = 0;
-
- switch (priority)
- {
- case OBJC_THREAD_INTERACTIVE_PRIORITY:
- sys_priority = 300;
- break;
- default:
- case OBJC_THREAD_BACKGROUND_PRIORITY:
- sys_priority = 200;
- break;
- case OBJC_THREAD_LOW_PRIORITY:
- sys_priority = 1000;
- break;
- }
-
- /* Change priority */
- if (thr_setprio(thr_self(), sys_priority) == 0)
- return 0;
- else
- return -1;
-}
-
-/* Return the current thread's priority. */
-int
-__objc_thread_get_priority(void)
-{
- int sys_priority;
-
- if (thr_getprio(thr_self(), &sys_priority) == 0)
- {
- if (sys_priority >= 250)
- return OBJC_THREAD_INTERACTIVE_PRIORITY;
- else if (sys_priority >= 150)
- return OBJC_THREAD_BACKGROUND_PRIORITY;
- return OBJC_THREAD_LOW_PRIORITY;
- }
-
- /* Couldn't get priority. */
- return -1;
-}
-
-/* Yield our process time to another thread. */
-void
-__objc_thread_yield(void)
-{
- thr_yield();
-}
-
-/* Terminate the current thread. */
-int
-__objc_thread_exit(void)
-{
- /* exit the thread */
- thr_exit(&__objc_thread_exit_status);
-
- /* Failed if we reached here */
- return -1;
-}
-
-/* Returns an integer value which uniquely describes a thread. */
-objc_thread_t
-__objc_thread_id(void)
-{
- return (objc_thread_t)thr_self();
-}
-
-/* Sets the thread's local storage pointer. */
-int
-__objc_thread_set_data(void *value)
-{
- if (thr_setspecific(__objc_thread_data_key, value) == 0)
- return 0;
- else
- return -1;
-}
-
-/* Returns the thread's local storage pointer. */
-void *
-__objc_thread_get_data(void)
-{
- void *value = NULL;
-
- if (thr_getspecific(__objc_thread_data_key, &value) == 0)
- return value;
-
- return NULL;
-}
-
-/* Backend mutex functions */
-
-/* Allocate a mutex. */
-int
-__objc_mutex_allocate(objc_mutex_t mutex)
-{
- if (mutex_init( (mutex_t *)(&(mutex->backend)), USYNC_THREAD, 0))
- return -1;
- else
- return 0;
-}
-
-
-/* Deallocate a mutex. */
-int
-__objc_mutex_deallocate(objc_mutex_t mutex)
-{
- mutex_destroy((mutex_t *)(&(mutex->backend)));
- return 0;
-}
-
-/* Grab a lock on a mutex. */
-int
-__objc_mutex_lock(objc_mutex_t mutex)
-{
- if (mutex_lock((mutex_t *)(&(mutex->backend))) != 0)
- return -1;
- else
- return 0;
-}
-
-/* Try to grab a lock on a mutex. */
-int
-__objc_mutex_trylock(objc_mutex_t mutex)
-{
- if (mutex_trylock((mutex_t *)(&(mutex->backend))) != 0)
- return -1;
- else
- return 0;
-}
-
-/* Unlock the mutex */
-int
-__objc_mutex_unlock(objc_mutex_t mutex)
-{
- if (mutex_unlock((mutex_t *)(&(mutex->backend))) != 0)
- return -1;
- else
- return 0;
-}
-
-/* Backend condition mutex functions */
-
-/* Allocate a condition. */
-int
-__objc_condition_allocate(objc_condition_t condition)
-{
- return cond_init((cond_t *)(&(condition->backend)), USYNC_THREAD, NULL);
-}
-
-/* Deallocate a condition. */
-int
-__objc_condition_deallocate(objc_condition_t condition)
-{
- return cond_destroy((cond_t *)(&(condition->backend)));
-}
-
-/* Wait on the condition */
-int
-__objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex)
-{
- return cond_wait((cond_t *)(&(condition->backend)),
- (mutex_t *)(&(mutex->backend)));
-}
-
-/* Wake up all threads waiting on this condition. */
-int
-__objc_condition_broadcast(objc_condition_t condition)
-{
- return cond_broadcast((cond_t *)(&(condition->backend)));
-}
-
-/* Wake up one thread waiting on this condition. */
-int
-__objc_condition_signal(objc_condition_t condition)
-{
- return cond_signal((cond_t *)(&(condition->backend)));
-}
-
-/* End of File */
diff --git a/contrib/libobjc/thr-vxworks.c b/contrib/libobjc/thr-vxworks.c
deleted file mode 100644
index b196677c6b69..000000000000
--- a/contrib/libobjc/thr-vxworks.c
+++ /dev/null
@@ -1,192 +0,0 @@
-/* GNU Objective C Runtime Thread Implementation
- Copyright (C) 1996, 1997 Free Software Foundation, Inc.
- Contributed by Galen C. Hunt (gchunt@cs.rochester.edu)
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
-details.
-
-You should have received a copy of the GNU General Public License along with
-GNU CC; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with files compiled with
- GCC 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 <objc/thr.h>
-#include "runtime.h"
-
-/* Thread local storage for a single thread */
-static void *thread_local_storage = NULL;
-
-/* Backend initialization functions */
-
-/* Initialize the threads subsystem. */
-int
-__objc_init_thread_system(void)
-{
- /* No thread support available */
- return -1;
-}
-
-/* Close the threads subsystem. */
-int
-__objc_close_thread_system(void)
-{
- /* No thread support available */
- return -1;
-}
-
-/* Backend thread functions */
-
-/* Create a new thread of execution. */
-objc_thread_t
-__objc_thread_detach(void (*func)(void *arg), void *arg)
-{
- /* No thread support available */
- return NULL;
-}
-
-/* Set the current thread's priority. */
-int
-__objc_thread_set_priority(int priority)
-{
- /* No thread support available */
- return -1;
-}
-
-/* Return the current thread's priority. */
-int
-__objc_thread_get_priority(void)
-{
- return OBJC_THREAD_INTERACTIVE_PRIORITY;
-}
-
-/* Yield our process time to another thread. */
-void
-__objc_thread_yield(void)
-{
- return;
-}
-
-/* Terminate the current thread. */
-int
-__objc_thread_exit(void)
-{
- /* No thread support available */
- /* Should we really exit the program */
- /* exit(&__objc_thread_exit_status); */
- return -1;
-}
-
-/* Returns an integer value which uniquely describes a thread. */
-objc_thread_t
-__objc_thread_id(void)
-{
- /* No thread support, use 1. */
- return (objc_thread_t)1;
-}
-
-/* Sets the thread's local storage pointer. */
-int
-__objc_thread_set_data(void *value)
-{
- thread_local_storage = value;
- return 0;
-}
-
-/* Returns the thread's local storage pointer. */
-void *
-__objc_thread_get_data(void)
-{
- return thread_local_storage;
-}
-
-/* Backend mutex functions */
-
-/* Allocate a mutex. */
-int
-__objc_mutex_allocate(objc_mutex_t mutex)
-{
- return 0;
-}
-
-/* Deallocate a mutex. */
-int
-__objc_mutex_deallocate(objc_mutex_t mutex)
-{
- return 0;
-}
-
-/* Grab a lock on a mutex. */
-int
-__objc_mutex_lock(objc_mutex_t mutex)
-{
- /* There can only be one thread, so we always get the lock */
- return 0;
-}
-
-/* Try to grab a lock on a mutex. */
-int
-__objc_mutex_trylock(objc_mutex_t mutex)
-{
- /* There can only be one thread, so we always get the lock */
- return 0;
-}
-
-/* Unlock the mutex */
-int
-__objc_mutex_unlock(objc_mutex_t mutex)
-{
- return 0;
-}
-
-/* Backend condition mutex functions */
-
-/* Allocate a condition. */
-int
-__objc_condition_allocate(objc_condition_t condition)
-{
- return 0;
-}
-
-/* Deallocate a condition. */
-int
-__objc_condition_deallocate(objc_condition_t condition)
-{
- return 0;
-}
-
-/* Wait on the condition */
-int
-__objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex)
-{
- return 0;
-}
-
-/* Wake up all threads waiting on this condition. */
-int
-__objc_condition_broadcast(objc_condition_t condition)
-{
- return 0;
-}
-
-/* Wake up one thread waiting on this condition. */
-int
-__objc_condition_signal(objc_condition_t condition)
-{
- return 0;
-}
-
-/* End of File */
diff --git a/contrib/libobjc/thr-win32.c b/contrib/libobjc/thr-win32.c
deleted file mode 100644
index 8570ffd997ef..000000000000
--- a/contrib/libobjc/thr-win32.c
+++ /dev/null
@@ -1,272 +0,0 @@
-/* GNU Objective C Runtime Thread Interface - Win32 Implementation
- Copyright (C) 1996, 1997 Free Software Foundation, Inc.
- Contributed by Galen C. Hunt (gchunt@cs.rochester.edu)
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
-details.
-
-You should have received a copy of the GNU General Public License along with
-GNU CC; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with files compiled with
- GCC 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 <objc/thr.h>
-#include "runtime.h"
-
-#ifndef __OBJC__
-#define __OBJC__
-#endif
-#include <windows.h>
-
-/* Key structure for maintaining thread specific storage */
-static DWORD __objc_data_tls = (DWORD)-1;
-
-/* Backend initialization functions */
-
-/* Initialize the threads subsystem. */
-int
-__objc_init_thread_system(void)
-{
- /* Initialize the thread storage key */
- if ((__objc_data_tls = TlsAlloc()) != (DWORD)-1)
- return 0;
- else
- return -1;
-}
-
-/* Close the threads subsystem. */
-int
-__objc_close_thread_system(void)
-{
- if (__objc_data_tls != (DWORD)-1)
- TlsFree(__objc_data_tls);
- return 0;
-}
-
-/* Backend thread functions */
-
-/* Create a new thread of execution. */
-objc_thread_t
-__objc_thread_detach(void (*func)(void *arg), void *arg)
-{
- DWORD thread_id = 0;
- HANDLE win32_handle;
-
- if (!(win32_handle = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)func,
- arg, 0, &thread_id)))
- thread_id = 0;
-
- return (objc_thread_t)thread_id;
-}
-
-/* Set the current thread's priority. */
-int
-__objc_thread_set_priority(int priority)
-{
- int sys_priority = 0;
-
- switch (priority)
- {
- case OBJC_THREAD_INTERACTIVE_PRIORITY:
- sys_priority = THREAD_PRIORITY_NORMAL;
- break;
- default:
- case OBJC_THREAD_BACKGROUND_PRIORITY:
- sys_priority = THREAD_PRIORITY_BELOW_NORMAL;
- break;
- case OBJC_THREAD_LOW_PRIORITY:
- sys_priority = THREAD_PRIORITY_LOWEST;
- break;
- }
-
- /* Change priority */
- if (SetThreadPriority(GetCurrentThread(), sys_priority))
- return 0;
- else
- return -1;
-}
-
-/* Return the current thread's priority. */
-int
-__objc_thread_get_priority(void)
-{
- int sys_priority;
-
- sys_priority = GetThreadPriority(GetCurrentThread());
-
- switch (sys_priority)
- {
- case THREAD_PRIORITY_HIGHEST:
- case THREAD_PRIORITY_TIME_CRITICAL:
- case THREAD_PRIORITY_ABOVE_NORMAL:
- case THREAD_PRIORITY_NORMAL:
- return OBJC_THREAD_INTERACTIVE_PRIORITY;
-
- default:
- case THREAD_PRIORITY_BELOW_NORMAL:
- return OBJC_THREAD_BACKGROUND_PRIORITY;
-
- case THREAD_PRIORITY_IDLE:
- case THREAD_PRIORITY_LOWEST:
- return OBJC_THREAD_LOW_PRIORITY;
- }
-
- /* Couldn't get priority. */
- return -1;
-}
-
-/* Yield our process time to another thread. */
-void
-__objc_thread_yield(void)
-{
- Sleep(0);
-}
-
-/* Terminate the current thread. */
-int
-__objc_thread_exit(void)
-{
- /* exit the thread */
- ExitThread(__objc_thread_exit_status);
-
- /* Failed if we reached here */
- return -1;
-}
-
-/* Returns an integer value which uniquely describes a thread. */
-objc_thread_t
-__objc_thread_id(void)
-{
- return (objc_thread_t)GetCurrentThreadId();
-}
-
-/* Sets the thread's local storage pointer. */
-int
-__objc_thread_set_data(void *value)
-{
- if (TlsSetValue(__objc_data_tls, value))
- return 0;
- else
- return -1;
-}
-
-/* Returns the thread's local storage pointer. */
-void *
-__objc_thread_get_data(void)
-{
- return TlsGetValue(__objc_data_tls); /* Return thread data. */
-}
-
-/* Backend mutex functions */
-
-/* Allocate a mutex. */
-int
-__objc_mutex_allocate(objc_mutex_t mutex)
-{
- if ((mutex->backend = (void *)CreateMutex(NULL, 0, NULL)) == NULL)
- return -1;
- else
- return 0;
-}
-
-/* Deallocate a mutex. */
-int
-__objc_mutex_deallocate(objc_mutex_t mutex)
-{
- CloseHandle((HANDLE)(mutex->backend));
- return 0;
-}
-
-/* Grab a lock on a mutex. */
-int
-__objc_mutex_lock(objc_mutex_t mutex)
-{
- int status;
-
- status = WaitForSingleObject((HANDLE)(mutex->backend), INFINITE);
- if (status != WAIT_OBJECT_0 && status != WAIT_ABANDONED)
- return -1;
- else
- return 0;
-}
-
-/* Try to grab a lock on a mutex. */
-int
-__objc_mutex_trylock(objc_mutex_t mutex)
-{
- int status;
-
- status = WaitForSingleObject((HANDLE)(mutex->backend), 0);
- if (status != WAIT_OBJECT_0 && status != WAIT_ABANDONED)
- return -1;
- else
- return 0;
-}
-
-/* Unlock the mutex */
-int
-__objc_mutex_unlock(objc_mutex_t mutex)
-{
- if (ReleaseMutex((HANDLE)(mutex->backend)) == 0)
- return -1;
- else
- return 0;
-}
-
-/* Backend condition mutex functions */
-
-/* Allocate a condition. */
-int
-__objc_condition_allocate(objc_condition_t condition)
-{
- /* Unimplemented. */
- return -1;
-}
-
-/* Deallocate a condition. */
-int
-__objc_condition_deallocate(objc_condition_t condition)
-{
- /* Unimplemented. */
- return -1;
-}
-
-/* Wait on the condition */
-int
-__objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex)
-{
- /* Unimplemented. */
- return -1;
-}
-
-/* Wake up all threads waiting on this condition. */
-int
-__objc_condition_broadcast(objc_condition_t condition)
-{
- /* Unimplemented. */
- return -1;
-}
-
-/* Wake up one thread waiting on this condition. */
-int
-__objc_condition_signal(objc_condition_t condition)
-{
- /* Unimplemented. */
- return -1;
-}
-
-/* End of File */
diff --git a/contrib/libobjc/thr.c b/contrib/libobjc/thr.c
deleted file mode 100644
index f1c957aaa15c..000000000000
--- a/contrib/libobjc/thr.c
+++ /dev/null
@@ -1,534 +0,0 @@
-/* GNU Objective C Runtime Thread Interface
- Copyright (C) 1996, 1997 Free Software Foundation, Inc.
- Contributed by Galen C. Hunt (gchunt@cs.rochester.edu)
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
-details.
-
-You should have received a copy of the GNU General Public License along with
-GNU CC; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with files compiled with
- GCC 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 <stdlib.h>
-#include "runtime.h"
-
-/* Global exit status. */
-int __objc_thread_exit_status = 0;
-
-/* Flag which lets us know if we ever became multi threaded */
-int __objc_is_multi_threaded = 0;
-
-/* The hook function called when the runtime becomes multi threaded */
-objc_thread_callback _objc_became_multi_threaded = NULL;
-
-/*
- Use this to set the hook function that will be called when the
- runtime initially becomes multi threaded.
- The hook function is only called once, meaning only when the
- 2nd thread is spawned, not for each and every thread.
-
- It returns the previous hook function or NULL if there is none.
-
- A program outside of the runtime could set this to some function so
- it can be informed; for example, the GNUstep Base Library sets it
- so it can implement the NSBecomingMultiThreaded notification.
- */
-objc_thread_callback objc_set_thread_callback(objc_thread_callback func)
-{
- objc_thread_callback temp = _objc_became_multi_threaded;
- _objc_became_multi_threaded = func;
- return temp;
-}
-
-/*
- Private functions
-
- These functions are utilized by the frontend, but they are not
- considered part of the public interface.
- */
-
-/*
- First function called in a thread, starts everything else.
-
- This function is passed to the backend by objc_thread_detach
- as the starting function for a new thread.
- */
-struct __objc_thread_start_state
-{
- SEL selector;
- id object;
- id argument;
-};
-
-static volatile void
-__objc_thread_detach_function(struct __objc_thread_start_state *istate)
-{
- /* Valid state? */
- if (istate) {
- id (*imp)(id,SEL,id);
- SEL selector = istate->selector;
- id object = istate->object;
- id argument = istate->argument;
-
- /* Don't need anymore so free it */
- objc_free(istate);
-
- /* Clear out the thread local storage */
- objc_thread_set_data(NULL);
-
- /* Check to see if we just became multi threaded */
- if (!__objc_is_multi_threaded)
- {
- __objc_is_multi_threaded = 1;
-
- /* Call the hook function */
- if (_objc_became_multi_threaded != NULL)
- (*_objc_became_multi_threaded)();
- }
-
- /* Call the method */
- if ((imp = (id(*)(id, SEL, id))objc_msg_lookup(object, selector)))
- (*imp)(object, selector, argument);
- else
- objc_error(object, OBJC_ERR_UNIMPLEMENTED,
- "objc_thread_detach called with bad selector.\n");
- }
- else
- objc_error(nil, OBJC_ERR_BAD_STATE,
- "objc_thread_detach called with NULL state.\n");
-
- /* Exit the thread */
- objc_thread_exit();
-}
-
-/*
- Frontend functions
-
- These functions constitute the public interface to the Objective-C thread
- and mutex functionality.
- */
-
-/* Frontend thread functions */
-
-/*
- Detach a new thread of execution and return its id. Returns NULL if fails.
- Thread is started by sending message with selector to object. Message
- takes a single argument.
- */
-objc_thread_t
-objc_thread_detach(SEL selector, id object, id argument)
-{
- struct __objc_thread_start_state *istate;
- objc_thread_t thread_id = NULL;
-
- /* Allocate the state structure */
- if (!(istate = (struct __objc_thread_start_state *)
- objc_malloc(sizeof(*istate))))
- return NULL;
-
- /* Initialize the state structure */
- istate->selector = selector;
- istate->object = object;
- istate->argument = argument;
-
- /* lock access */
- objc_mutex_lock(__objc_runtime_mutex);
-
- /* Call the backend to spawn the thread */
- if ((thread_id = __objc_thread_detach((void *)__objc_thread_detach_function,
- istate)) == NULL)
- {
- /* failed! */
- objc_mutex_unlock(__objc_runtime_mutex);
- objc_free(istate);
- return NULL;
- }
-
- /* Increment our thread counter */
- __objc_runtime_threads_alive++;
- objc_mutex_unlock(__objc_runtime_mutex);
-
- return thread_id;
-}
-
-/* Set the current thread's priority. */
-int
-objc_thread_set_priority(int priority)
-{
- /* Call the backend */
- return __objc_thread_set_priority(priority);
-}
-
-/* Return the current thread's priority. */
-int
-objc_thread_get_priority(void)
-{
- /* Call the backend */
- return __objc_thread_get_priority();
-}
-
-/*
- Yield our process time to another thread. Any BUSY waiting that is done
- by a thread should use this function to make sure that other threads can
- make progress even on a lazy uniprocessor system.
- */
-void
-objc_thread_yield(void)
-{
- /* Call the backend */
- __objc_thread_yield();
-}
-
-/*
- Terminate the current tread. Doesn't return.
- Actually, if it failed returns -1.
- */
-int
-objc_thread_exit(void)
-{
- /* Decrement our counter of the number of threads alive */
- objc_mutex_lock(__objc_runtime_mutex);
- __objc_runtime_threads_alive--;
- objc_mutex_unlock(__objc_runtime_mutex);
-
- /* Call the backend to terminate the thread */
- return __objc_thread_exit();
-}
-
-/*
- Returns an integer value which uniquely describes a thread. Must not be
- NULL which is reserved as a marker for "no thread".
- */
-objc_thread_t
-objc_thread_id(void)
-{
- /* Call the backend */
- return __objc_thread_id();
-}
-
-/*
- Sets the thread's local storage pointer.
- Returns 0 if successful or -1 if failed.
- */
-int
-objc_thread_set_data(void *value)
-{
- /* Call the backend */
- return __objc_thread_set_data(value);
-}
-
-/*
- Returns the thread's local storage pointer. Returns NULL on failure.
- */
-void *
-objc_thread_get_data(void)
-{
- /* Call the backend */
- return __objc_thread_get_data();
-}
-
-/* Frontend mutex functions */
-
-/*
- Allocate a mutex. Return the mutex pointer if successful or NULL if the
- allocation failed for any reason.
- */
-objc_mutex_t
-objc_mutex_allocate(void)
-{
- objc_mutex_t mutex;
-
- /* Allocate the mutex structure */
- if (!(mutex = (objc_mutex_t)objc_malloc(sizeof(struct objc_mutex))))
- return NULL;
-
- /* Call backend to create the mutex */
- if (__objc_mutex_allocate(mutex))
- {
- /* failed! */
- objc_free(mutex);
- return NULL;
- }
-
- /* Initialize mutex */
- mutex->owner = NULL;
- mutex->depth = 0;
- return mutex;
-}
-
-/*
- Deallocate a mutex. Note that this includes an implicit mutex_lock to
- insure that no one else is using the lock. It is legal to deallocate
- a lock if we have a lock on it, but illegal to deallocate a lock held
- by anyone else.
- Returns the number of locks on the thread. (1 for deallocate).
- */
-int
-objc_mutex_deallocate(objc_mutex_t mutex)
-{
- int depth;
-
- /* Valid mutex? */
- if (!mutex)
- return -1;
-
- /* Acquire lock on mutex */
- depth = objc_mutex_lock(mutex);
-
- /* Call backend to destroy mutex */
- if (__objc_mutex_deallocate(mutex))
- return -1;
-
- /* Free the mutex structure */
- objc_free(mutex);
-
- /* Return last depth */
- return depth;
-}
-
-/*
- Grab a lock on a mutex. If this thread already has a lock on this mutex
- then we increment the lock count. If another thread has a lock on the
- mutex we block and wait for the thread to release the lock.
- Returns the lock count on the mutex held by this thread.
- */
-int
-objc_mutex_lock(objc_mutex_t mutex)
-{
- objc_thread_t thread_id;
- int status;
-
- /* Valid mutex? */
- if (!mutex)
- return -1;
-
- /* If we already own the lock then increment depth */
- thread_id = objc_thread_id();
- if (mutex->owner == thread_id)
- return ++mutex->depth;
-
- /* Call the backend to lock the mutex */
- status = __objc_mutex_lock(mutex);
-
- /* Failed? */
- if (status)
- return status;
-
- /* Successfully locked the thread */
- mutex->owner = thread_id;
- return mutex->depth = 1;
-}
-
-/*
- Try to grab a lock on a mutex. If this thread already has a lock on
- this mutex then we increment the lock count and return it. If another
- thread has a lock on the mutex returns -1.
- */
-int
-objc_mutex_trylock(objc_mutex_t mutex)
-{
- objc_thread_t thread_id;
- int status;
-
- /* Valid mutex? */
- if (!mutex)
- return -1;
-
- /* If we already own the lock then increment depth */
- thread_id = objc_thread_id();
- if (mutex->owner == thread_id)
- return ++mutex->depth;
-
- /* Call the backend to try to lock the mutex */
- status = __objc_mutex_trylock(mutex);
-
- /* Failed? */
- if (status)
- return status;
-
- /* Successfully locked the thread */
- mutex->owner = thread_id;
- return mutex->depth = 1;
-}
-
-/*
- Unlocks the mutex by one level.
- Decrements the lock count on this mutex by one.
- If the lock count reaches zero, release the lock on the mutex.
- Returns the lock count on the mutex.
- It is an error to attempt to unlock a mutex which this thread
- doesn't hold in which case return -1 and the mutex is unaffected.
- */
-int
-objc_mutex_unlock(objc_mutex_t mutex)
-{
- objc_thread_t thread_id;
- int status;
-
- /* Valid mutex? */
- if (!mutex)
- return -1;
-
- /* If another thread owns the lock then abort */
- thread_id = objc_thread_id();
- if (mutex->owner != thread_id)
- return -1;
-
- /* Decrement depth and return */
- if (mutex->depth > 1)
- return --mutex->depth;
-
- /* Depth down to zero so we are no longer the owner */
- mutex->depth = 0;
- mutex->owner = NULL;
-
- /* Have the backend unlock the mutex */
- status = __objc_mutex_unlock(mutex);
-
- /* Failed? */
- if (status)
- return status;
-
- return 0;
-}
-
-/* Frontend condition mutex functions */
-
-/*
- Allocate a condition. Return the condition pointer if successful or NULL
- if the allocation failed for any reason.
- */
-objc_condition_t
-objc_condition_allocate(void)
-{
- objc_condition_t condition;
-
- /* Allocate the condition mutex structure */
- if (!(condition =
- (objc_condition_t)objc_malloc(sizeof(struct objc_condition))))
- return NULL;
-
- /* Call the backend to create the condition mutex */
- if (__objc_condition_allocate(condition))
- {
- /* failed! */
- objc_free(condition);
- return NULL;
- }
-
- /* Success! */
- return condition;
-}
-
-/*
- Deallocate a condition. Note that this includes an implicit
- condition_broadcast to insure that waiting threads have the opportunity
- to wake. It is legal to dealloc a condition only if no other
- thread is/will be using it. Here we do NOT check for other threads
- waiting but just wake them up.
- */
-int
-objc_condition_deallocate(objc_condition_t condition)
-{
- /* Broadcast the condition */
- if (objc_condition_broadcast(condition))
- return -1;
-
- /* Call the backend to destroy */
- if (__objc_condition_deallocate(condition))
- return -1;
-
- /* Free the condition mutex structure */
- objc_free(condition);
-
- return 0;
-}
-
-/*
- Wait on the condition unlocking the mutex until objc_condition_signal()
- or objc_condition_broadcast() are called for the same condition. The
- given mutex *must* have the depth set to 1 so that it can be unlocked
- here, so that someone else can lock it and signal/broadcast the condition.
- The mutex is used to lock access to the shared data that make up the
- "condition" predicate.
- */
-int
-objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex)
-{
- objc_thread_t thread_id;
-
- /* Valid arguments? */
- if (!mutex || !condition)
- return -1;
-
- /* Make sure we are owner of mutex */
- thread_id = objc_thread_id();
- if (mutex->owner != thread_id)
- return -1;
-
- /* Cannot be locked more than once */
- if (mutex->depth > 1)
- return -1;
-
- /* Virtually unlock the mutex */
- mutex->depth = 0;
- mutex->owner = (objc_thread_t)NULL;
-
- /* Call the backend to wait */
- __objc_condition_wait(condition, mutex);
-
- /* Make ourselves owner of the mutex */
- mutex->owner = thread_id;
- mutex->depth = 1;
-
- return 0;
-}
-
-/*
- Wake up all threads waiting on this condition. It is recommended that
- the called would lock the same mutex as the threads in objc_condition_wait
- before changing the "condition predicate" and make this call and unlock it
- right away after this call.
- */
-int
-objc_condition_broadcast(objc_condition_t condition)
-{
- /* Valid condition mutex? */
- if (!condition)
- return -1;
-
- return __objc_condition_broadcast(condition);
-}
-
-/*
- Wake up one thread waiting on this condition. It is recommended that
- the called would lock the same mutex as the threads in objc_condition_wait
- before changing the "condition predicate" and make this call and unlock it
- right away after this call.
- */
-int
-objc_condition_signal(objc_condition_t condition)
-{
- /* Valid condition mutex? */
- if (!condition)
- return -1;
-
- return __objc_condition_signal(condition);
-}
-
-/* End of File */
diff --git a/contrib/libstdc++/ChangeLog b/contrib/libstdc++/ChangeLog
deleted file mode 100644
index 02b950c48ff2..000000000000
--- a/contrib/libstdc++/ChangeLog
+++ /dev/null
@@ -1,1421 +0,0 @@
-Fri Mar 16 12:46:19 GMT 2001 Bernd Schmidt (bernds@redhat.com)
-
- * gcc-2.95.3 Released.
-
-2001-01-01 Bernd Schmidt <bernds@redhat.co.uk>
-
- 1999-12-07 Martin v. Löwis <loewis@informatik.hu-berlin.de>
- * stl_deque.h (_Deque_base::const_iterator): Change third
- template argument to pointer type.
- Reported by Carlo Wood <carlo@node1500a.a2000.nl>
-
- 1999-11-10 Benjamin Kosnik <bkoz@haight.constant.com>
- Matthias Klose <doko@cs.tu-berlin.de>
- * stl_rope.h: Fix initialization order.
- * stl_deque.h: Use static_casts<size_type>(signed_type).
-
-2000-11-24 Magnus Fromreide <magfr@lysator.liu.se>
-
- * sstream: Backport libstdc++-V3 sstream to V2.
-
-2000-04-24 Magnus Fromreide <magfr@lysator.liu.se>
-
- * sstream: New file.
- * Makefile.in (HEADERS): Add it.
-
-2000-03-12 Gabriel Dos Reis <dosreis@cmla.ens-cachan.fr>
-
- * std/bastring.h (basic_string<>::push_back): Define.
-
-Tue Mar 7 21:37:56 2000 Jeffrey A Law (law@cygnus.com)
-
- 1999-11-19 Gabriel Dos Reis <dosreis@cmla.ens-cachan.fr>
- * std/valarray_meta.h (_DEFINE_EXPR_UNARY_FUNCTION): Don't forget
- to define tanh.
-
- 1999-11-05 Gabriel Dos Reis <dosreis@cmla.ens-cachan.fr>
- * std/valarray_meta.h (_DEFINE_EXPR_UNARY_FUNCTION): When
- building meta-expressions don't forget to take the contained
- closures.
-
- 1999-10-19 Gabriel Dos Reis <dosreis@cmla.ens-cachan.fr>
- * std/valarray_meta.h: (_BinClos::_BinClos): Fix typo.
-
- 1999-09-17 Gabriel Dos Reis <dosreis@cmla.ens-cachan.fr>
- * std/complext.cc (pow): Don't expect floating point promotion
- in presence of template argument deduction. There is no such
- thing.
-
-2000-02-06 Gabriel Dos Reis <dosreis@cmla.ens-cachan.fr>
- * std/valarray_array.h (__valarray_copy): Fix typo.
-
-1999-12-14 Martin v. Löwis <loewis@informatik.hu-berlin.de>
- * std/bastring.h (basic_string::basic_string): Rename parameters
- to avoid shadow warnings.
- * std/bastring.cc (alloc): Likewise.
-
-Sun Oct 24 23:54:10 PDT 1999 Jeff Law (law@cygnus.com)
-
- * gcc-2.95.2 Released.
-
-Mon Aug 16 01:29:24 PDT 1999 Jeff Law (law@cygnus.com)
-
- * gcc-2.95.1 Released.
-
-Thu Aug 5 02:00:13 1999 Loren Rittle <ljrittle@acm.org>
-
- * Makefile.in (MARLINK, MSHLINK): Handle library version
- number components with more than one numeric digit.
-
-Mon Aug 2 00:40:10 1999 Jeffrey A Law (law@cygnus.com)
-
- 1999-07-16 Markus Gyger (mgyger@gmu.edu)
- * stdexcepti.cc (__out_of_range): Use std:: qualifier for names
- in std.
- (__length_error): Likewise.
-
-Wed Jul 28 21:39:31 PDT 1999 Jeff Law (law@cygnus.com)
-
- * gcc-2.95 Released.
-
-Sun Jul 25 23:40:51 PDT 1999 Jeff Law (law@cygnus.com)
-
- * gcc-2.95 Released.
-
-Sat Jul 17 23:49:59 1999 Jeffrey A Law (law@cygnus.com)
-
- * Makefile.in (INTERFACE): Bump to 3.
-
-Fri Jul 9 01:20:23 1999 Jeffrey A Law (law@cygnus.com)
-
- * Makefile.in (VERSION): Bump to 2.10.0.
-
-Tue Jun 8 00:21:11 1999 Jeffrey A Law (law@cygnus.com)
-
- * configure.in (*-*-freebsd2*): Add missing '*' at end of configure
- string.
-
-1999-06-05 Gabriel Dos Reis <dosreis@cmla.ens-cachan.fr>
-
- * std/std_valarray.h: Don't #include unconditionally <alloca.h>
-
-1999-06-05 Gabriel Dos Reis <dosreis@cmla.ens-cachan.fr>
-
- * std/std_valarray.h: New file.
- * std/slice.h: New file.
- * std/slice_array.h: New file.
- * std/gslice.h: New file.
- * std/gslice_array.h: New file.
- * std/mask_array.h: New file.
- * std/indirect_array.h: New file.
- * std/valarray_array.h: New file.
- * std/valarray_array.tcc: New file.
- * std/valarray_meta.h: New file.
- * valarray.cc: New file.
- * valarray: New file
-
- * Makefile.in (OBJS): add valarray.o
- (HEADERS): add valarray
- (valarray.o): define dependency on valarray.cc
- (install): make it possible to install valarray file.
-
-Wed Jun 2 00:21:54 1999 Robert Lipe <robertlipe@usa.net>
-
- * std/bastring.h (class basic_string:Rep): Encode xlock opcode
- as .bytes instead of mnemonics.
-
-1999-05-20 Angela Marie Thomas <angela@cygnus.com>
-
- * configure.in: Test for ${compiler_name}.exe as well.
-
-1999-05-15 Mark Kettenis <kettenis@gnu.org>
-
- * configure.in: Add shared library support for the Hurd
- (*-*-gnu*).
- * config/gnu.ml: New file.
-
-1999-05-12 Jason Merrill <jason@yorick.cygnus.com>
-
- * configure.in (compiler_name): Don't do the skip-this-dir thing
- if we're reconfiguring.
-
-1999-05-07 Ulrich Drepper <drepper@cygnus.com>
-
- * std/bastring.h (class basic_string::Rep): Make release member
- function thread-safe for ix86 (x>=4) and UltraSPARC.
-
- * stlinst.cc: Make it possible to compile with __USE_MALLOC.
-
-Mon Apr 26 02:24:47 1999 "Loren J. Rittle" <rittle@supra.rsch.comm.mot.com>
-
- * config/freebsd.ml (LIBS): Add ARLINK.
- * config/openbsd.ml (LIBS): Add ARLINK.
-
-Fri Apr 2 15:12:14 1999 H.J. Lu (hjl@gnu.org)
-
- * libstdc++/configure.in (gxx_include_dir): Handle it.
- * libstdc++/Makefile.in: Likewise.
-
-Wed Mar 24 22:36:45 1999 Mumit Khan <khan@xraylith.wisc.edu>
-
- * configure.in (EXEEXT): Define.
- (compiler_name): Use.
-
-Thu Mar 11 01:07:55 1999 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
-
- * configure.in: Add mh-*pic handling for alpha, arm, powerpc
-
-Fri Mar 5 02:16:39 1999 Doug Rabson <dfr@freebsd.org>
-
- * configure.in: Support shared libs on FreeBSD 3.x and 4.x
- * config/freebsd.ml: A copy of config/linux.ml since they are both
- ELF and both have a shared libm.
-
-1999-02-24 Jason Merrill <jason@yorick.cygnus.com>
-
- * configure.in: Fix INSTALLDIR sed pattern for Solaris sed.
-
-Sat Feb 20 13:17:17 1999 Jeffrey A Law (law@cygnus.com)
-
- * string, std/straits.h, std/bastring.h: Revert recent change. Needs
- some libiberty support before it can be re-enabled.
-
-Thu Feb 18 19:53:17 1999 Marc Espie <espie@cvs.openbsd.org>
-
- * configure.in: Handle OpenBSD with and without threads.
- * config/openbsd.ml: New file.
- * config/openbsd.mt: New file.
-
-1999-02-04 Ulrich Drepper <drepper@cygnus.com>
-
- * configure.in: Recognize --enable-threads=posix for all
- platforms.
- * config/posix.mt: New file.
-
- * configure.in: Add fragments for Solaris defining macro specifying
- thread library to be used.
- * config/sol2pth.mt: New file
- * config/sol2solth.mt: New file.
- * stl/stl_alloc.h: Add support for Solaris thread library.
- * stl/stl_config.h: Recognize _SOLTHREADS and define internal macros
- appropriately.
-
-1999-01-28 Baron Roberts <baron@sgi.com>
-
- * string: Uncomment wstring declaration.
-
- * std/straits.h: Remove #if 0/#endif from around
- struct string_char_traits <wchar_t>.
- #include <cwchar>.
- Add missing definition for wchar_t move method.
- Add empty() method for trait-based empty string return.
-
- * std/bastring.h (c_str): Change return of "" to return of
- traits::empty() call so that proper empty string is returned
- based on the character type (i.e. "" or L"").
-
-1999-02-07 Jason Merrill <jason@yorick.cygnus.com>
-
- * Makefile.in (stuff2): Tweak.
-
-1999-02-04 Ulrich Drepper <drepper@cygnus.com>
-
- * configure.in: Recognize --enable-threads=posix for all
- platforms.
- * config/posix.mt: New file.
-
- * configure.in: Add fragments for Solaris defining macro specifying
- thread library to be used.
- * config/sol2pth.mt: New file
- * config/sol2solth.mt: New file.
- * stl/stl_alloc.h: Add support for Solaris thread library.
- * stl/stl_config.h: Recognize _SOLTHREADS and define internal macros
- appropriately.
-
-Sat Jan 30 08:05:46 1999 Mumit Khan <khan@xraylith.wisc.edu>
-
- * config/x86-interix.ml: New file.
- * configure.in (i[3456]86-*-interix*): Add shared library support.
-
-1999-01-13 Ulrich Drepper <drepper@cygnus.com>
-
- * configure.in: Test for "ln -s" and set LN_S in generated Makefile.
- * Makefile.in: Use $(LN_S) instead of explicitly ln -s.
-
-Sun Jan 03 03:16:02 1999 Robert Lipe <robertlipe@usa.net>
-
- * configure.in: (*-*-sysv5, *-*-*udk*): Treat like sysv4.
-
-Tue Dec 8 00:59:09 1998 Marc Espie <Marc.Espie@liafa.jussieu.fr>
-
- * Makefile.in: Be more selective about what files to install.
-
-1998-11-30 Ulrich Drepper <drepper@cygnus.com>
-
- * std/bastring.cc (operator>>): Correct cast in last patch.
- (getline): Likewise.
-
-1998-11-27 Alexandre Oliva <oliva@dcc.unicamp.br>
-
- * Makefile.in (HEADERS): Install bitset.
-
-1998-11-26 Manfred Hollstein <manfred@s-direktnet.de>
-
- * configure.in (compiler_name): Add check to detect if this
- language's compiler has been built.
-
-1998-11-23 Ulrich Drepper <drepper@cygnus.com>
-
- * std/bastring.cc (operator>>): Cast new character to char before
- adding to string.
- (getline): Likewise.
-
-Thu Sep 17 01:29:46 1998 H.J. Lu (hjl@gnu.org)
-
- * Makefile.in ($(ARLINK), $(SHLINK)): Don't rely on 'ln -f'.
-
- * Makefile.in (install): Don't rely on 'ln -f'.
-
-1998-09-09 Manfred Hollstein <manfred@s-direktnet.de>
-
- * Makefile.in (install): Initialize RELINSTALLDIR correctly
- even for multilib and cross configurations.
-
- * configure.in (INSTALLDIR): Don't change INSTALLDIR's init
- value if --enable-version-specific-runtime-libs has been specified.
-
-Wed Sep 2 21:11:15 1998 H.J. Lu (hjl@gnu.org)
-
- * Makefile.in (RELINSTALLDIR): New. Use it to make symlinks.
-
- * configure.in: Fix INSTALLDIR replacement for cross-compile.
-
-Sun Aug 30 22:17:41 1998 H.J. Lu (hjl@gnu.org)
-
- * Makefile.in (INTERFACE): New, set to 2.
- (ARLIB): Set to libstdc++.a.$(VERSION)
- (ARLINK, MARLINK): New macros.
- (LIBS): Add $(ARLINK).
- ($(ARLINK), marlink): New targets.
- (install): Don't check $(libsubdir). Handle versioned libraries.
-
- * config/linux.ml (ARLIB, MARLINK, SHLIB, MSHLINK): New macros.
- (LIBS): Add marlink $(ARLINK).
-
- * config/aix.ml (ARLIB): Set to libstdc++-ar.a.$(VERSION)
- (ARLINK): New macros.
- (BUILD_LIBS): Add $(ARLINK).
-
- * config/dec-osf.ml (LIBS): Add $(ARLINK).
- * config/elf.ml (LIBS): Likewise.
- * config/elfshlibm.ml (LIBS): Likewise.
- * config/hpux.ml (LIBS): Likewise.
- * config/iris5.ml (LIBS): Likewise.
- * config/sol2shm.ml (LIBS): Likewise.
- * config/sunos4.ml (LIBS): Likewise.
-
- * configure.in: Use ${topsrcdir}/config.if to put
- LIBSTDCXX_INTERFACE, CXX_INTERFACE, LIBC_INTERFACE in
- ${package_makefile_frag}.
-
-1998-08-25 Martin von Löwis <loewis@informatik.hu-berlin.de>
-
- * stdexcept: Remove __HONOR_STD.
-
-1998-08-23 Mark Mitchell <mark@markmitchell.com>
-
- * sinst.cc: Don't explicitly instantiation string_char_traits<char>.
- * cinst.cc: Likewiwse, for complex<float>, complex<double>,
- complex<long double>.
-
-1998-08-17 Mark Mitchell <mark@markmitchell.com>
-
- * stdexcept: Put things in the std namespace, if appropriate.
-
-1998-07-12 Jason Merrill <jason@yorick.cygnus.com>
-
- * Makefile.in (VERSION): Bump to 2.9.0.
-
-1998-07-12 Lars Albertsson <lalle@sics.se>
-
- * std/bastring.cc (find_last_of): Fix.
- (find_last_not_of): Likewise.
-
-1998-07-06 Manfred Hollstein <manfred@s-direktnet.de>
-
- * configure.in (INSTALLDIR): Make sed pattern failsafe.
-
-1998-07-06 Ulrich Drepper <drepper@cygnus.com>
-
- * std/bastring.h (class basic_string): Correct iterator return
- values in insert member functions.
-
-1998-07-02 Ulrich Drepper <drepper@cygnus.com>
-
- * std/bastring.h (class basic_string): Return correct iterators in
- erase member functions.
-
-1998-06-24 Manfred Hollstein <manfred@s-direktnet.de>
-
- * Makefile.in (INSTALLDIR): Add comment to document the fact,
- this macro will be properly initialized at make's runtime.
- (install): Add initialization of INSTALLDIR depending on $(libsubdir)
- and ${enable_version_specific_runtime_libs}; use $${INSTALLDIR} shell
- variable instead of the $(INSTALLDIR) make macro.
-
-Tue Mar 24 10:13:07 1998 Jason Merrill <jason@yorick.cygnus.com>
-
- * std/bastring.cc (basic_string::copy): Mark const here, too.
-
-1998-03-23 15:59 Ulrich Drepper <drepper@cygnus.com>
-
- * std/bastring.h (basic_string::copy): Mark copy function as const.
- Reported by Scott Schurr <scotts@ims.com>.
-
-Thu Mar 5 09:23:28 1998 Manfred Hollstein <manfred@s-direktnet.de>
-
- * configure.in: Make locating frag files failsafe even for the
- special case if configuring and building in srcdir.
-
-1998-03-04 12:37 Ulrich Drepper <drepper@cygnus.com>
-
- * cinst.cc [INSERT] (operator<<): Correct type of numeric argument.
-
-Fri Feb 6 01:36:21 1998 Manfred Hollstein <manfred@s-direktnet.de>
-
- * Makefile.in (piclist): Check value of enable_shared, not PICFLAG.
- (stmp-string, ...): Dito.
- (bigstmp-string, ...): Dito.
-
-Sun Feb 1 13:38:07 1998 H.J. Lu (hjl@gnu.org)
-
- * config/linux.mt: Don't define _PTHREADS, but define
- _IO_MTSAFE_IO.
-
-Wed Jan 28 10:27:11 1998 Manfred Hollstein <manfred@s-direktnet.de>
-
- * tests/configure.in, testsuite/configure.in: Update with yesterday's
- toplevel configure.in changes.
-
-Tue Jan 27 23:27:32 1998 Manfred Hollstein <manfred@s-direktnet.de>
-
- * configure.in (package_makefile_rules_frag): New variable
- which is used in the call to config.shared; redirect file descriptor 2
- to ${package_makefile_rules_frag}.
-
-Tue Jan 27 10:11:27 1998 Jason Merrill <jason@yorick.cygnus.com>
-
- * Makefile.in (install): Remove the shared library symlink even if
- we aren't installing it.
-
-Tue Jan 27 10:29:44 1998 H.J. Lu (hjl@gnu.org)
-
- * configure.in (topsrcdir): New.
- (configdirs): Check ${topsrcdir}/gcc instead.
- (config-ml.in): Use ${topsrcdir}/config-ml.in.
-
- * tests/configure.in (topsrcdir): New.
- (check): Check ${topsrcdir}/gcc instead.
-
-Sun Jan 25 14:01:50 1998 Jason Merrill <jason@yorick.cygnus.com>
-
- * std/bastring.h (unique): We only need length bytes.
- (c_str): Avoid writing over random memory.
- #include <std/bastring.cc>.
- Lose _G_ALLOC_CONTROL.
- * std/bastring.cc: Likewise.
- (nilRep): Add initializer for selfish.
- * sinst.cc: Just #include <string>.
-
-Tue Jan 13 21:23:05 1998 H.J. Lu (hjl@gnu.org)
-
- * configure.in (configdirs): Include testsuite only if
- ${srcdir}/../gcc exists.
-
- * tests/configure.in (check): Set to ${CHECK} if
- ${srcdir}/../../gcc doesn't exists.
-
-1998-01-05 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * std/bastring.cc (basic_string::Rep::operator delete): Don't claim
- to return from deallocate, since this is a void method.
-
-Sat Jan 3 12:15:41 1998 Franz Sirl <franz.sirl-kernel@lauterbach.com>
-
- * configure.in: Finalize support for {alpha|powerpc}*-*-linux-gnulibc1
-
-Sun Dec 7 02:34:40 1997 Jody Goldberg <jodyg@idt.net>
-
- * libstdc++/std/bastring.h : Move closer to the draft standard
- implementation of basic_string by adding 3 paramter 'Allocator'.
- NOTE: this still differs from the standard in not offering per
- instance allocators.
- * libstdc++/std/bastring.cc : Likewise.
- * libstdc++/stlinst.cc : Handle thread safe allocators if they are the
- default.
-
-Sun Dec 7 02:32:20 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * iosfwd: New header.
- * Makefile.in (HEADERS): Add it.
-
-Sun Dec 7 02:32:20 1997 Gregory L. Galloway (gregg@eoeml.gtri.gatech.edu)
-
- * Makefile.in (HEADERS): Modified list of headers to
- install to include all of SGI STL headers especially hash_set and
- hash_map, and added ANSI C++ style wrappers for fstream, iomanip,
- iostream, and strstream.
-
- * fstream, iomanip, iostream, strstream: New forwarding headers
- added.
-
-Thu Nov 27 01:33:55 1997 Jeffrey A Law (law@cygnus.com)
-
- * Makefile.in (install): Change gxx_includedir to gxx_include_dir.
-
-Tue Nov 25 23:16:44 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- London changes to string:
- * std/bastring.cc (check_realloc): Don't be selfish anymore.
- * std/bastring.h (non-const operator[]): Be selfish.
- (iterator forms of insert and erase): Stay selfish.
-
-Tue Nov 25 14:03:43 1997 H.J. Lu (hjl@gnu.org)
-
- * Makefile.in (stmp-complex, bigstmp-complex): Changed to
- xxxx-complx.
-
-Mon Nov 24 14:41:33 1997 Jeffrey A Law (law@cygnus.com)
-
- * Makefile.in: Use ln -f -s, not ln -s -f.
-
-Fri Nov 21 12:56:24 1997 Manfred Hollstein <manfred@s-direktnet.de>
-
- * Makefile.in (bigstmp-complex): Name changed to bigstmp-complx to
- cope with filesystem not capable to handle names longer than
- 14 characters.
-
-Sun Nov 16 22:41:55 1997 Jeffrey A Law (law@cygnus.com)
-
- * Makefile.in (SHLIB): Build with CC instead of CXX.
-
-Sun Nov 2 23:34:09 1997 Manfred Hollstein <manfred@s-direktnet.de>
-
- * configure.in: Use delta.mt for m68k-motorola-sysv.
- * config/delta.mt: New makefile fragment.
-
-Sun Nov 2 12:14:37 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * Makefile.in (install): Some of HEADERS come from the stl dir now.
- * algorithm, deque, functional, iterator, list, map, memory, numeric,
- queue, set, stack, utility, vector: Now in stl dir.
-
-Fri Oct 10 00:40:00 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * std/bastring.h: Use ibegin internally. Return passed iterator
- instead of recalculating it where appropriate.
- * std/bastring.cc: Adjust for erase.
-
- From Yotam Medini:
- * std/bastring.h: Replace remove with erase.
-
-Thu Oct 9 23:24:36 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * stdexcepti.cc (__out_of_range): New fn.
- (__length_error): New fn.
-
- * std/bastring.h (OUTOFRANGE): Fix logic. Use throwing functions.
- (LENGTHERROR): Likewise.
- Revert Oct 2 changes.
- * string: Revert Oct 2 changes.
-
-Tue Oct 7 00:51:51 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * std/{f,d,ld}complex.h: Replace guiding fns if not -ansi.
-
-Thu Oct 2 00:08:18 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * std/bastring.h: Move exception stuff after definition of string.
- Move typedef of string here.
- * string: From here.
-
-Sat Sep 27 16:48:00 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * std/complext.h: Lose injection decls.
- * std/fcomplex.h: Likewise.
- * std/dcomplex.h: Likewise.
- * std/ldcomplex.h: Likewise.
-
-Sat Sep 27 16:47:35 1997 Mark Mitchell <mmitchell@usa.net>
-
- * std/complext.h: Declare templates before making them
- friends. Use new friend <> syntax.
- * std/complext.cc: Don't rely on guiding declarations.
- * std/fcomplex.h: Use new friend <> syntax.
- * std/dcomplex.h: Likewise.
- * std/ldcomplex.h: Likewise.
-
-Thu Sep 25 19:55:56 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * std/bastring.h: Enable exceptions.
- (assign, append, insert, replace): Implement member template versions.
-
-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>
-
- * std/bastring.h (class basic_string): Add global scope to
- use of reverse_iterator.
-
-Tue Sep 9 19:47:07 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * std/bastring.h: Adjust use of reverse_iterator template.
-
-Wed Aug 27 00:04:33 1997 Alexandre Oliva (oliva@dcc.unicamp.br)
-
- * Makefile.in: Create correct multiple links to
- shared libstdc++.
-
-Tue Aug 26 12:24:01 1997 H.J. Lu (hjl@gnu.ai.mit.edu)
-
- * testsuite/Makefile.in (check): Don't depend on site.exp.
- (just-check): Depend on site.exp.
-
-Mon Aug 25 14:26:45 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * Makefile.in (CXXFLAGS): Add -Weffc++.
-
-Sat Aug 23 21:25:37 1997 Mark Mitchell <mmitchell@usa.net>
-
- * bastring.h: Enable reverse_iterator and its ilk.
-
- * bastring.h: Provide specializations of member function templates
- for const_iterator.
-
-Wed Jul 30 10:59:00 1997 Benjamin Kosnik <bkoz@rhino.cygnus.com>
-
- * stlinst.cc: Add instantiation file for
- __default_alloc_template<fale, 0> and
- __malloc_alloc_template<0>
-
-Sun Jun 1 17:03:40 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * std/bastring.cc (find_last_of): Correct handling of POS.
- (find_last_not_of): Likewise.
-
-Thu May 1 17:37:10 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * Makefile.in ($(SHLIB)): Add $(LIBCXXFLAGS).
-
-Wed Apr 30 12:06:23 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * Makefile.in (IO_DIR): Remove $(MULTIBUILDTOP).
- (LIBIBERTY_DIR): Likewise.
- * configure.in: Don't turn on multilib here.
-
-Fri Apr 25 16:09:15 1997 Bob Manson <manson@charmed.cygnus.com>
-
- * testsuite/libstdc++.tests/test.exp, testsuite/lib/libstdc++.exp,
- testsuite/configure.in, testsuite/Makefile.in,
- testsuite/config/default.exp, testsuite/ChangeLog: New files.
-
- * configure.in: Add new testsuite directory to be configured.
-
-Tue Apr 22 19:03:39 1997 Alexandre Oliva <oliva@dcc.unicamp.br>
-
- * Makefile.in (install): Fix handling of mshlink.
-
-Fri Apr 4 03:25:13 1997 Ulrich Drepper <drepper@cygnus.com>
-
- * Makefile.in (IO_DIR): Prepend $(MULTIBUILDTOP) to
- support multilib build.
- (LIBIBERTY_DIR): Likewise.
-
- * configure.in: Enable multilibing by default.
- Update multilib template to read config-ml.in.
-
-Wed Mar 12 16:09:34 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * configure.in (XCXXINCLUDES): Add the STL directory.
-
-Thu Jan 23 08:08:43 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * stdexcept: Delete dtors for all of the error classes, to match
- their removal in the Apr 1995 WP.
- (class overflow_error): Define missing class, added in May 1996 WP.
-
-Mon Nov 18 16:57:25 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * Makefile.in (stuff[12]): More rules for my own evil purposes.
- (CXXFLAGS, CFLAGS): Use -O instead of -O3 so debugging works.
-
-Wed Oct 16 13:47:45 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * config/irix5.ml: Do link against the math library.
- * configure.in: Support shared libs on Irix 6.
-
-Fri Oct 11 18:06:09 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * config/linux.ml: Lose version overrides.
-
- * Makefile.in (MSHLINK): Defaults to .so.2.x
- (mshlink): Indirect rule for making it.
-
-Tue Sep 24 17:58:31 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * Remove new, typeinfo, exception, stddef*.
- * Move public headers from std/*.h to *.
-
-Sun Sep 22 05:35:55 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * Makefile.in: Remove new, exception, typeinfo handling.
- * exceptioni.cc, newi.cc, typeinfoi.cc, std/exception.h, std/new.h,
- std/typeinfo.h, new.h: Remove.
- * typeinfo, new, exception: Refer to the files with .h in gcc.
-
-Fri Sep 20 14:39:19 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * Makefile.in: Remove references to stl.list.
- * configure.in (configdirs): Remove stl.
-
-Sat Sep 14 09:42:08 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * Makefile.in (stuff): Convenience for me.
-
- * std/bastring.h: Remove kludge obsoleted by new overloading code.
-
-Fri Sep 6 16:43:21 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * typeinfoi.cc (__dynamic_cast): Fix static_cast.
- (__rtti_si): Likewise.
- (dcast): Likewise.
-
-Thu Aug 29 17:06:23 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * configure.in (i[345]86-*-*): Recognize i686 for pentium pro.
-
-Tue Jul 23 14:27:44 1996 Mike Stump <mrs@cygnus.com>
-
- * Makefile.in (exceptioni.o): Use -fexceptions now.
-
-Mon Jun 17 13:57:24 1996 Per Bothner <bothner@deneb.cygnus.com>
-
- * std/bastring.h (class basic_string::remove): Add casts.
-
- * configure.in: Use EXTRA_DISTCLEAN rather than DISTCLEAN.
-
-Fri Jun 7 14:09:20 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * typeinfoi.cc (BUILTIN): Align typeinfo object like a pointer.
-
-Wed May 29 16:48:35 1996 Mike Stump <mrs@cygnus.com>
-
- * exceptioni.cc (__throw_bad_exception): Add.
- * std/exception.h (bad_exception): Add.
- * std/typeinfo.h: Remove leftovers of bad_cast_object.
-
-Mon May 6 14:04:42 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * std/complext.h: s/FLOAT/_FLT/g.
-
-Thu May 2 17:26:24 1996 Mike Stump <mrs@cygnus.com>
-
- * exceptioni.cc (uncaught_exception): New routine.
- * std/exception.h: Declare it.
-
-Thu Apr 25 13:20:57 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * Makefile.in (typeinfoi.o, stdexcepti.o): Use default rule.
-
-Wed Apr 24 18:38:24 1996 Mike Stump <mrs@cygnus.com>
-
- * exceptioni.cc: Add #pragma implementation.
- * std/exception.h: Add #pragma interface. Moved exception from
- stdexcept.
- * std/stdexcept.h: Moved exception to exception. Fix all constructor
- arguments to take strings to match ANSI. Moved bad_cast and bad_typeid
- to typeinfo.
- * std/typeinfo.h: Moved bad_cast and bad_typeid from stdexcept.
-
-Wed Apr 24 10:43:07 1996 Doug Evans <dje@blues.cygnus.com>
-
- * Makefile.in (newi.o,cstringi.o,stddefi.o,cstdlibi.o,cmathi.o): Add
- rules for SunOS VPATH.
-
-Fri Apr 19 17:24:51 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * Version 2.8.0b3.
-
-Wed Apr 10 14:38:05 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * typeinfoi.cc (base_info): Pack the latter three fields into 32 bits.
-
-Tue Apr 9 15:49:38 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * typeinfoi.cc: Add 'const'.
- (__class_type_info): Now just one pointer to an array of structs,
- rather than four pointers to arrays.
-
- * typeinfoi.cc (__throw_type_match_rtti): Check for conversion to
- void* before conversion to base*.
- (dcast): Handle downcasting to X* given other X subobjects in
- the most derived type. Ack.
-
-Mon Apr 8 15:20:32 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * configure.in: Permit --enable-shared to specify a list of
- directories.
-
-Sun Apr 7 22:50:53 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * typeinfoi.cc (__rtti_array): New entry point.
-
-Sat Apr 6 14:41:18 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * exceptioni.cc (__throw_bad_cast): New entry point for compiler.
- * typeinfoi.cc: Remove __bad_cast_object.
-
- * typeinfoi.cc: Add nodes for unsigned builtins.
-
-Fri Apr 5 18:16:22 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * typeinfoi.cc, std/typeinfo.h: Total overhaul. Move most
- everything out of the header, move name field into type_info, add
- single-inheritance case, rewrite pointer handling, add new
- compiler interface. Compare addresses to check for equality.
-
-Wed Mar 27 11:54:08 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * Version 2.8.0b2.
-
-Fri Mar 8 13:56:18 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * std/[cs]inst.h: Remove.
-
-Thu Mar 7 07:29:00 1996 Lee Iverson <leei@Canada.AI.SRI.COM>
-
- * Makefile.in (install): Restore deleted chdir to stl subdir.
-
-Thu Mar 7 15:02:58 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * std/complext.h: Fix __attribute__ usage.
-
-Wed Feb 28 10:00:24 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * Version 2.8.0b1.
-
-Mon Feb 26 17:26:26 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * std/cstring.h: New approach to changing signatures of string
- manipulation functions. Still disabled.
-
-Tue Feb 20 18:29:30 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * std/complext.h (__doapl, __doami, __doaml, __doadv): Helper
- templates to implement +=, -=, *= and /=, respectively, since
- member function templates do not apply to class specializations.
- * std/{f,d,ld}complex.h, std/complext.cc, cinst.cc: Adjust.
-
- * std/bastring.h: The representation class is now a nested class.
- * std/bastring.cc: Add templates for static data members.
- * sinst.cc: Don't provide specializations for static data members.
- * std/string.h: Use default template parameters.
-
- * Makefile.in (CXXFLAGS): Remove -pedantic -ansi.
- (CFLAGS): Ditto.
-
-Wed Feb 14 14:39:07 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * std/bastring.cc (check_realloc): Fix for sizeof (charT) > 1.
- From John Hickin <hickin@bnr.ca>.
-
-Wed Jan 10 11:05:04 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * std/bastring.h (insert): Fix iterator handling.
- From Joe Buck <jbuck@synopsys.com>.
-
-Mon Jan 8 11:48:03 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * std/bastring.h (max_size): Fix for sizeof (charT) > 1.
- * std/bastring.cc (replace): Use it.
-
- * std/bastring.cc (rfind): Fix for n > length ().
-
-Tue Dec 19 15:13:08 1995 Jason Merrill <jason@yorick.cygnus.com>
-
- * config/aix.ml (SHFLAGS): Add -Wl,-unix.
-
-Mon Dec 18 12:48:25 1995 Mike Stump <mrs@cygnus.com>
-
- * Makefile.in (exceptioni.o): Compile with -fhandle-exceptions, so
- we can unwind through unexpected on machines that don't have a
- working __unwind_function.
-
-Sun Dec 17 00:28:31 1995 Jeffrey A Law (law@cygnus.com)
-
- * Makefile.in (install): Make sure shared libraries
- are installed with mode 555.
-
-Mon Nov 27 15:01:56 1995 Jason Merrill <jason@yorick.cygnus.com>
-
- * Makefile.in (install): Make shared library links relative.
- (install): Break up -sf into -s -f.
- ({M,}SHLINK): Ditto.
-
-Sun Nov 26 22:48:06 1995 Jason Merrill <jason@yorick.cygnus.com>
-
- * queue: Include <stack.h> instead of <queue.h>.
-
-Sat Nov 25 11:33:13 1995 Doug Evans <dje@canuck.cygnus.com>
-
- * Makefile.in (install): Fix setting of rootme.
-
-Tue Nov 21 14:20:34 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * configure.in: Check ${with_cross_host} rather than comparing
- ${host} and ${target}.
-
-Tue Nov 14 01:50:52 1995 Doug Evans <dje@canuck.cygnus.com>
-
- * Makefile.in (IO_DIR): Delete MULTITOP, MULTISUBDIR.
- (LIBIBERTY_DIR): Likewise.
- (INSTALLDIR): Delete MULTISUBDIR.
- * configure.in: Delete call to cfg-ml-com.in. Call config-ml.in
- instead of cfg-ml-pos.in.
- (XCXXINCLUDES): Delete MULTITOP.
- * stl/configure.in (XCXXINCLUDES): Delete MULTITOP.
- (config-ml.in): Call instead of cfg-ml-pos.in.
-
-Sun Nov 12 16:44:25 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * Makefile.in (VERSION): Set to 2.7.1.
-
-Thu Nov 9 17:39:28 1995 Jason Merrill <jason@yorick.cygnus.com>
-
- * config/{aix,dec-osf,irix5,linux,sol2shm}.ml: Remove LDLIBS defn;
- no longer needed now that make check sets LD_LIBRARY_PATH.
-
-Wed Nov 8 19:46:35 1995 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * std/bastring.h: Wrap with #ifndef/#define/#endif.
- * std/cassert.h: Likewise.
- * std/cinst.h: Likewise.
- * std/complext.h: Likewise.
- * std/dcomplex.h: Likewise.
- * std/fcomplex.h: Likewise.
- * std/ldcomplex.h: Likewise.
- * std/sinst.h: Likewise.
-
-Wed Nov 8 16:15:48 1995 Jason Merrill <jason@yorick.cygnus.com>
-
- * std/bastring.cc (getline): Update to September 95 WP. Now we
- don't set failbit when reading an empty line.
-
-Tue Nov 7 16:09:04 1995 Jason Merrill <jason@yorick.cygnus.com>
-
- * std/bastring.cc (new): Fix for sizeof (charT) != 1.
-
-Sat Nov 4 17:37:16 1995 Jason Merrill <jason@yorick.cygnus.com>
-
- * std/complext.cc (operator / (FLOAT, const complex<FLOAT>&)):
- Reimplement along the lines of the other operator / templates.
- From John Eaton <jwe@bevo.che.wisc.edu>.
-
-Sat Nov 4 13:33:50 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * configure.in (DISTCLEAN): New, to add target-mkfrag.
-
-Tue Oct 31 13:59:32 1995 Jason Merrill <jason@yorick.cygnus.com>
-
- * std/bastring.h: Use size_t for the reference count.
- * std/bastring.cc (create): Set selfish.
- From Joe Buck (jbuck@synopsys.com).
-
-Mon Oct 30 23:09:48 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * configure.in: Don't bother changing LIBIBERTY for cross,
- now that we are using target-libiberty instead.
- * Makefile.in (LIBIBERTY_DIR): Simplify.
- (LIBIBERTY): Remove.
-
-Wed Oct 11 14:56:49 1995 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * config/sol2shm.ml: New files with -rpath.
- * configure (*-*-solaris*): Use sol2shm.ml.
-
-Thu Sep 28 09:26:52 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * std/straits.h (compare, copy, move, set): Fix for non-char charT's.
- * std/bastring.h (basic_string::remove): Fix for non-char charT's.
-
-Tue Sep 26 15:22:56 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * config/irix5.ml: Pass -rpath to links.
-
-Fri Sep 15 00:17:47 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * config/linux.ml: Conform to Linux shared library numbering
- scheme.
- * Makefile.in: Ditto.
-
-Tue Sep 12 00:28:56 1995 Mike Stump <mrs@cygnus.com>
-
- * typeinfoi.cc: (__pointer_type_info::__rtti_match): Moved from
- the headerfile, include all sorts of pointer conversions from 15.3
- para 2.
- * std/typeinfo.h (__pointer_type_info::__rtti_match): Moved from here.
-
-Mon Sep 11 23:27:59 1995 Mike Stump <mrs@cygnus.com>
-
- * std/typeinfo.h (__pointer_type_info::__rtti_match): We no longer
- have to dereference the object pointer, as the pointer is always
- passed directly.
-
-Mon Sep 11 19:29:51 1995 Mike Stump <mrs@cygnus.com>
-
- * std/typeinfo.h (__pointer_type_info::__rtti_match): Define so
- that pointer conversions can happen on catch type matching.
- * typeinfoi.cc (__throw_type_match_rtti): Arrange for __rtti_match
- to be used on pointers.
-
-Tue Sep 5 14:49:19 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * string.h: Remove for now.
-
-Thu Aug 31 14:14:01 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * std/bastring.cc (operator>>): Simplify and fix.
- (resize): Fix order of arguments to append.
- (getline): Simplify and fix.
-
-Thu Aug 24 17:44:09 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * std/cstdlib.h (abs): Provide default implementation for peons
- without labs.
-
-Tue Aug 22 08:43:07 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * std/cstdlib.h: Comment out definition of div(long,long) for now,
- since not all targets have ldiv.
-
-Mon Aug 21 11:46:03 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * std/cmath.h: Wrap abs(double) with #if ! _G_MATH_H_INLINES.
-
- * stl.h: Add, for compatibility with ObjectSpace STL.
-
- * std/complext.cc (operator /): Use abs instead of fabs.
-
- * std/bastring.h (replace): Update single-character replace method
- as per my proposal.
-
- * std/cmath.h: Add abs(float), abs(double) and abs(long double).
- Add commented-out declarations for other float and long double
- math functions.
-
- * std/cstdlib.h: Add abs(long) and div(long,long).
-
- * Makefile.in (install): Make shared library executable and
- non-writable. Tidy.
- (OBJS): Add cstdlibi.o and cmathi.o.
-
- * Rename implementation files to have different basenames.
-
-Mon Aug 21 00:57:03 1995 Jeffrey A. Law <law@rtl.cygnus.com>
-
- * Makefile.in (install): Use "cd stl"; no need for $(srcdir)
- prefix because we're already in $(srcdir).
-
-Tue Jul 25 18:41:29 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * std/stddef.h: Remove obsolete definition of enum capacity.
-
-Sat Jul 22 13:37:01 1995 Doug Evans <dje@canuck.cygnus.com>
-
- * Makefile.in (IO_DIR): Add multilib support.
- (LIBIBERTY, LIBIBERTY_OBJS, INSTALLDIR, stdlist): Likewise.
- (libiberty.a, install): Likewise.
- * configure.in: Likewise.
- (XCXXINCLUDES): Likewise.
- * stl/configure.in: Likewise.
- (XCXXINCLUDES): Likewise.
-
-Mon Jul 17 09:29:31 1995 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * Makefile.in (typeinfo.o, stdexcept.o): Put an else for the if
- stmt checking PICFLAG.
- (stmp-string, bigstmp-string, stmp-complex, bigstmp-complex): Likewise.
-
-Wed Jun 28 17:05:29 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * std/*.h: Wrap with extern "C++".
-
- * std/ciso646.h: Don't worry about #undefing the keywords.
-
-Mon Jun 26 19:05:38 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * std/bastring.h (operator!=): If they've included the STL
- function.h, don't overload the operator templates that it defines.
-
-Fri Jun 23 16:54:17 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * Makefile.in (SHLINK): Force link.
- (install): Ditto.
-
- * std/bastring.h (terminate): Never reallocate.
- (alloc): No longer const.
-
- * std/bastring.cc (create): Always allocate an extra byte.
- (check_realloc): Always leave room for an extra byte.
- (*find*): Add missing 'const'.
-
- * Makefile.in (SHARLIB): Provide a default value.
-
-Tue Jun 20 16:29:52 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * std/cstring.h: Don't bother tweaking prototypes for now. When
- we do, we will use new-style casts.
-
-Fri Jun 16 13:57:53 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * Makefile.in (VERSION): Update to 2.7.0.
-
- * config/aix.ml: Build both shared and archive libraries.
-
-Wed Jun 14 21:44:21 1995 Jason Merrill <jason@python.cygnus.com>
-
- * configure.in (frags): Use linux.ml for Linux/ELF.
- * config/linux.ml: New file.
-
-Wed Jun 14 17:56:23 1995 Niclas Andersson <nican@ida.liu.se>
-
- * configure.in: Use xiberty when building cross-compiler.
-
-Wed Jun 14 12:57:47 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * std/*complex*, std/cinst.h, cinst.cc: Pass by reference to const
- rather than by value.
- * std/*complex*: Add member functions real() and imag().
-
-Sat Jun 10 12:14:38 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * Makefile.in (bigstmp-string): Call main string object cstrmain.o
- instead of cstring.o.
-
-Wed Jun 7 11:15:15 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * std/cstring.h: Use #include_next to pick up <string.h>.
-
- * string.h: New file.
-
- * Makefile.in (MOSTLYCLEAN_JUNK): Remove piclist.
-
- * configure.in (MOSTLYCLEAN): Remove stamp-picdir.
-
-Mon Jun 5 18:36:39 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * config/*.ml: Build both shared and archive libraries.
-
- * configure.in (MOSTLYCLEAN): Remove pic.
- (frags): Use toplevel pic frags.
-
- * Makefile.in (piclist): New rule.
- (SHLIB): Use it.
- (stl.list): Removed.
- (typeinfo.o): Also build pic version.
- (stdexcept.o): Ditto.
- (*stmp-*): Ditto.
-
-Tue May 30 12:01:14 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * std/{complext,{f,d,ld}complex}.h: To declare specializations,
- use friend declarations in the class body...
- * std/cinst.h: ...rather than macro hackery.
-
- * Makefile.in (stdlist): Renamed from list.
-
- * cstdarg: Don't define __CSTDARG__.
- * complex.h: Similarly.
-
-Tue May 9 19:31:20 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * std/bastring.cc (operator>>): Use an int to store the return value
- of streambuf::sbumpc.
- (getline): Ditto.
- * std/bastring.* (replace): Reverse size_t and charT arguments.
-
- * configure.in (enable_shared): Support enable_shared under AIX.
-
- * Makefile.in (SHARLIB): New variable and rule for building an
- archive library containing a single shared object (for AIX).
-
-Mon May 8 01:43:19 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * std/bastring.h (remove): Forgot one.
- (empty): And this.
- Disable copy-on-write if someone takes an iterator.
-
- * std/bastring.cc (getline): Avoid resizing down if unnecessary.
- (operator>>): Don't use private methods.
-
-Sun May 7 02:39:56 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * std/bastring.h (insert, replace): Fix.
- * std/bastring.cc (find_*_of): Fix.
-
-Fri May 5 01:45:10 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * std/bastring.h: Add iterator remove fn. Remove evil default
- arguments.
-
- * std/*complex*, std/cinst.h, cinst.cc: s/__complex/complex/g.
- complex<float> is now specialized. Lose _*_complex in favor of
- 'explicit' constructors.
- * std/complex.h: Lose typedef of complex.
- * std/fcomplex.h: New file.
- * std/complext.cc (operator<<): Accept more input forms.
-
- * std/bastring.h: Add iterator insert fns.
-
-Thu May 4 02:30:04 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * std/bastring.*: Update to current draft.
-
- * std/bastring.*: Reorganize so that the pointer in a string
- object points to the data rather than the bsrep object, for
- debugging.
-
-Tue Apr 25 17:15:09 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * configure.in: Update to stay in sync with config.shared.
-
-Mon Apr 24 13:08:46 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * std/complext.h: Declare hypot. Declare appropriate functions const.
-
-Wed Apr 12 15:26:25 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * Makefile.in (typeinfo.o): Don't use $<.
- (stdexcept.o): Ditto.
-
-Sat Apr 8 15:35:00 1995 Mike Stump <mrs@cygnus.com>
-
- * std/typeinfo.h: Move bad_cast, bad_typeid and __bad_cast_object
- from here to stdexcept.
- * std/stdexcept.h: Ditto.
- * Makefile.in (stdexcept.o): Added rule to build typeinfo.o with
- -frtti to support matching of thrown objects with rtti info for
- bad_cast.
-
-Mon Apr 3 18:13:14 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * typeinfo: New file.
-
- * Makefile.in (HEADERS): Add typeinfo.
-
-Mon Apr 3 15:06:58 1995 Mike Stump <mrs@cygnus.com>
-
- * Makefile.in (typeinfo.o): Added rule to build typeinfo.o with
- -frtti to support matching of thrown objects with rtti info for
- bad_cast.
-
-Wed Mar 29 15:56:06 1995 Mike Stump <mrs@cygnus.com>
-
- * typeinfo.cc: (__throw_type_match_rtti): Added to support
- matching of thrown objects with rtti info.
-
-Thu Mar 23 18:42:30 1995 Jason Merrill <jason@deneb.cygnus.com>
-
- * Makefile.in (HEADERS): Add stdexcept.
-
-Sun Mar 12 01:25:27 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * std/typeinfo.h: Add return statements to dummy methods.
-
-Wed Mar 8 16:09:50 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * config/dec-osf.ml: Use -rpath flag.
-
-Fri Feb 17 18:16:46 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * std/typeinfo.h: Add copyright header.
-
- * Makefile.in (CXXFLAGS): Add a bunch of warning options to keep
- me honest.
-
-Thu Feb 16 00:04:49 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * Makefile.in, config/*.ml: Generate shared library on most hosts
- as libstdc++.so.$(VERSION), with a symlink to libstdc++.so, so that
- multiple versions can coexist.
-
-Fri Feb 10 02:59:39 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * std/exception.h: {set_,}{terminate,unexpected} have C++ linkage.
-
- * Makefile.in: Allow string and complex to be split up either by
- individual function or into I/O and non-I/O. Default to the
- latter.
-
-Wed Feb 8 02:39:47 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * std/bastring.h: Start thinking about throwing exceptions.
-
- * typeinfo.cc: Remove private functions; defining them to call
- abort () just delays errors until runtime. Define
- __bad_cast_object.
-
- * std/exception.h: Standard exceptions are now defined in
- stdexcept.h. This header now contains declarations of terminate()
- et al.
- * exception.cc: Move code from libg++/src/except.c here.
- * std/typeinfo.h: Define RTTI-related exceptions here.
- * stdexcept{,.cc},std/stdexcept.h: New files.
-
-Mon Feb 6 18:51:31 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * Makefile.in (HEADERS): Resurrect, add new STL header names.
- (install): Install extensionless headers again.
- * extensionless headers: Resurrect, add new STL headers.
- Currently only forward to std/whatever or stl/whatever.
-
-Mon Jan 30 13:53:22 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * std/bastring.h (basic_string (charT, size_t)): Mark explicit.
-
- * Makefile.in (install): Set rootme when installing stl headers.
- Only install *.* from std.
-
-Wed Jan 25 02:29:30 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * std/bastring.h (operator=): grab before releasing.
-
-Mon Jan 23 19:54:02 1995 Ronald F. Guilmette <rfg@segfault.us.com>
-
- * Makefile.in (install): Also install STL headers.
-
-Mon Jan 23 04:09:35 1995 Jason Merrill <jason@python.cygnus.com>
-
- * Makefile.in (list): Set $rootme before calling make.
-
-Wed Jan 11 19:24:47 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * typeinfo.cc (__rtti_match): Don't try to do pointer arithmetic
- with a void *.
-
- * move all headers into std subdirectory and update files accordingly.
-
-Thu Jan 5 01:51:49 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * bastring.ccI (basic_string (size_t, capacity)): s/reserve/::reserve/.
-
-Wed Jan 4 17:27:32 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * exception: s/string/__string/g.
-
- * configure.in (MOSTLYCLEAN): Add so_locations.
-
- * bastring.ccI (basic_string (size_t, capacity)): Fix thinko.
- (various find functions): Ditto.
-
-Fri Dec 30 18:04:00 1994 Mike Stump <mrs@cygnus.com>
-
- * typeinfo.h: Add support for the built-in type bool.
-
-Fri Dec 30 14:57:02 1994 Mike Stump <mrs@cygnus.com>
-
- * typeinfo.{cc, h}: Guard against multiple inclusions, and add #p i/i.
-
-Fri Dec 2 17:56:05 1994 Mike Stump <mrs@cygnus.com>
-
- * libg++ 2.6.2 released.
-
- * typeinfo.{cc, h} (__rtti_match): Change interface to compiler
- for dynamic_casting to gear up for exception handling's use of
- rtti for argument matching.
-
-Tue Nov 29 16:49:32 1994 Per Bothner <bothner@kalessin.cygnus.com>
-
- * configure.in (configdirs): Add stl.
- * Makefile.in: Build stl, and merge .o files from it.
-
-Thu Nov 17 15:30:57 1994 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * bastring.hI: Add iterator, const_iterator, begin() and end() to
- basic_string.
-
-Mon Nov 7 16:50:33 1994 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * Makefile.in, configure.in, config/*.ml, tests/Makefile.in,
- tests/configure.in: Various changes to handle --enable-shared.
-
-Fri Nov 4 19:13:33 1994 Mike Stump <mrs@cygnus.com>
-
- * exception{,.cc}: Added to support catching bad_cast's.
-
-Thu Nov 3 17:42:13 1994 Mike Stump <mrs@cygnus.com>
-
- * typeinfo.h (type_info::{name, before}): Add to match draft.
-
-Thu Nov 3 00:56:34 1994 Jason Merrill (jason@phydeaux.cygnus.com)
-
- * Makefile.in (LIBIBERTY_OBJS): Add strerror.o.
-
-Mon Oct 31 15:33:06 1994 Kung Hsu (kung@mexican.cygnus.com)
-
- * typeinfo.cc: Fix a bug in the final return.
- * typeinfo.cc: Fix the ANSI header version number.
- * typeinfo.h: ditto.
-
-Fri Oct 28 14:23:12 1994 Mike Stump <mrs@cygnus.com>
-
- * type_info.{cc,h}: Rename to typeinfo to better match current draft.
-
-Wed Oct 26 11:13:53 1994 Kung Hsu (kung@mexican.cygnus.com)
-
- * type_info.h: new header file for rtti.
- * type_info.cc: new code file for rtti.
- * Makefile.in: change to include type_info.o in libstdc++ for rtti.
-
-Sat Oct 15 16:09:51 1994 Jason Merrill (jason@phydeaux.cygnus.com)
-
- * libg++ 2.6.1 released.
-
- * cinst.hI: Also declare instantiations of out-of-line functions.
-
-Fri Oct 14 15:00:09 1994 Jason Merrill (jason@phydeaux.cygnus.com)
-
- * configure.in (CXXINCLUDES): Use {} to wrap variable name.
- * tests/configure.in (CXXINCLUDES): Ditto.
-
- * cinst.hI: Declare instantiations of two-argument functions so
- overload resolution will work.
- * complext.hI: Always include cinst.hI.
-
- * bastring.ccI (operator>>): Tweak.
-
-Tue Oct 11 17:07:49 1994 Jason Merrill (jason@phydeaux.cygnus.com)
-
- * stddef*: Do the #pragma i/i thang.
-
- * bastring.hI (basic_string::put_at): Use operator[].
- (basic_string::terminate): Don't necessarily copy the rep.
-
- * bastring.ccI (operator>>): Avoid shrinking and then re-expanding
- the string.
-
- * bastring.*I, sinst.cc: Only allow allocation policy control if
- _G_ALLOC_CONTROL is defined.
-
- * Makefile.in (libstdc++.a): Depend on iostream.list and libiberty.a.
- (../libio/iostream.list): New rule.
- (../libiberty/libiberty.a): New rule.
- (OBJS): Add stddef.o.
-
-Sat Oct 8 23:59:45 1994 Jason Merrill (jason@phydeaux.cygnus.com)
-
- * *: First checkin.
diff --git a/contrib/libstdc++/Makefile.in b/contrib/libstdc++/Makefile.in
deleted file mode 100644
index f13eddcf2945..000000000000
--- a/contrib/libstdc++/Makefile.in
+++ /dev/null
@@ -1,385 +0,0 @@
-# Copyright (C) 1994, 1995 Free Software Foundation
-
-# This file is part of the GNU ANSI C++ 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.
-
-VERSION = 2.10.0
-INTERFACE = 3
-
-gxx_include_dir=${includedir}/g++
-
-OBJS = cstringi.o stdexcepti.o cstdlibi.o cmathi.o stlinst.o valarray.o
-SUBLIBS = $(STAMP)-string $(STAMP)-complx
-
-# C++ headers with no extension
-HEADERS= cassert cctype cerrno cfloat ciso646 climits clocale cmath complex \
- csetjmp csignal cstdarg cstddef cstdio cstdlib cstring ctime \
- cwchar cwctype string stdexcept \
- algorithm deque functional hash_map hash_set iterator list map \
- memory numeric pthread_alloc queue rope set slist stack utility \
- vector fstream iomanip iostream strstream iosfwd bitset valarray \
- sstream
-
-ARLIB = libstdc++.a.$(VERSION)
-ARLINK = libstdc++.a
-MARLINK = libstdc++.a.`echo $(VERSION) | sed 's/\([0-9]*[.][0-9]*\).*/\1/'`
-SHLIB = libstdc++.so.$(VERSION)
-SHARLIB = libstdc++-sh.a
-SHLINK = libstdc++.so
-MSHLINK = libstdc++.so.`echo $(VERSION) | sed 's/\([0-9]*[.][0-9]*\).*/\1/'`
-SHFLAGS =
-SHDEPS =
-
-STAMP = bigstmp
-
-LIBS = $(ARLIB) $(ARLINK)
-
-#### package, host, target, and site dependent Makefile fragments come in here.
-##
-
-IO_DIR = ../libio
-LIBIBERTY_DIR = ../libiberty
-
-LIBIBERTY_OBJS = `cat $(LIBIBERTY_DIR)/needed-list` strerror.o
-
-tooldir = $(exec_prefix)/$(target)
-# This is where the libraries will be installed; note, it will be set
-# at make runtime now. See below at target install.
-INSTALLDIR = $(libdir)
-
-MOSTLYCLEAN_JUNK = *stmp-* tlib*.a *.s *.ii stdlist piclist
-CLEAN_JUNK = $(LIBS)
-
-.PHONY: libs
-libs: $(LIBS)
-
-stdlist: $(IO_DIR)/iostream.list $(OBJS) $(SUBLIBS) $(LIBIBERTY_DIR)/libiberty.a
- -rm -f tlist
- touch tlist
- echo *.o >> tlist
- for f in `cat $(IO_DIR)/iostream.list` ; do \
- echo "$(IO_DIR)/$$f" >> tlist ; \
- done
- for f in $(LIBIBERTY_OBJS) ; do \
- echo "$(LIBIBERTY_DIR)/$$f" >> tlist ; \
- done
- mv tlist stdlist
-
-piclist: stdlist
- -rm -f tlist
- cp stdlist tlist
- if [ x"$(enable_shared)" = xyes ]; then \
- sed 's,\([A-Za-z_]*\.o\),pic/\1,g' tlist > tlist2 ; \
- mv tlist2 tlist ; \
- else true ; fi
- mv tlist piclist
-
-$(ARLIB): stdlist
- -rm -f t$(ARLIB)
- $(AR) $(AR_FLAGS) t$(ARLIB) `cat stdlist`
- mv t$(ARLIB) $(ARLIB)
- $(RANLIB) $(ARLIB)
-
-$(ARLINK):
- -rm -f $(ARLINK)
- $(LN_S) $(ARLIB) $(ARLINK) || cp $(ARLIB) $(ARLINK)
-
-marlink:
- @$(MAKE) $(MARLINK) "ARLINK=$(MARLINK)"
-
-$(SHLIB): piclist
- $(CC) $(LIBCXXFLAGS) $(SHFLAGS) -shared -o $(SHLIB) `cat piclist` $(SHDEPS)
-
-$(SHARLIB): $(SHLIB)
- -rm -f t$(SHARLIB)
- $(AR) $(AR_FLAGS) t$(SHARLIB) $(SHLIB)
- mv t$(SHARLIB) $(SHARLIB)
- $(RANLIB) $(SHARLIB)
-
-$(SHLINK):
- -rm -f $(SHLINK)
- $(LN_S) $(SHLIB) $(SHLINK) || cp $(ARLIB) $(ARLINK)
-
-mshlink:
- @$(MAKE) $(MSHLINK) "SHLINK=$(MSHLINK)"
-
-$(IO_DIR)/iostream.list: force
- cd $(IO_DIR) ; $(MAKE) $(FLAGS_TO_PASS) iostream.list
-
-$(LIBIBERTY_DIR)/libiberty.a:
- cd $(LIBIBERTY_DIR) ; $(MAKE) $(FLAGS_TO_PASS)
-
-STRFUNCS = REP MAIN TRAITS ADDSS ADDPS ADDCS ADDSP ADDSC \
- EQSS EQPS EQSP NESS NEPS NESP LTSS LTPS LTSP GTSS GTPS GTSP \
- LESS LEPS LESP GESS GEPS GESP
-STRIO = EXTRACT INSERT GETLINE
-
-# These are here for SunOS VPATH.
-cstringi.o: cstringi.cc
-cstdlibi.o: cstdlibi.cc
-cmathi.o: cmathi.cc
-stdexcepti.o: stdexcepti.cc
-stlinst.o: stlinst.cc
-valarray.o: valarray.cc
-
-# Later do wide strings, too.
-stmp-string: ${srcdir}/sinst.cc ${srcdir}/std/bastring.h \
- ${srcdir}/std/bastring.cc ${srcdir}/std/straits.h
- for name in $(STRFUNCS) $(STRIO); do \
- echo c$${name}; \
- if [ x"$(enable_shared)" = xyes ]; then \
- $(COMPILE.cc) $(PICFLAG) -DC -D$${name} ${srcdir}/sinst.cc \
- -o pic/c$${name}.o; \
- else true ; fi; \
- if [ $$? -eq 0 ]; then true; else exit 1; fi; \
- $(COMPILE.cc) -DC -D$${name} ${srcdir}/sinst.cc -o c$${name}.o; \
- if [ $$? -eq 0 ]; then true; else exit 1; fi; \
- done
- touch stmp-string
-
-bigstmp-string: ${srcdir}/sinst.cc ${srcdir}/std/bastring.h \
- ${srcdir}/std/bastring.cc ${srcdir}/std/straits.h
- echo cstring
- if [ x"$(enable_shared)" = xyes ]; then \
- $(COMPILE.cc) $(PICFLAG) -DC \
- `for N in $(STRFUNCS); do echo " -D$${N}"; done` \
- $(srcdir)/sinst.cc -o pic/cstrmain.o; \
- else true ; fi
- $(COMPILE.cc) -DC `for N in $(STRFUNCS); do echo " -D$${N}"; done` \
- $(srcdir)/sinst.cc -o cstrmain.o
- echo cstrio
- if [ x"$(enable_shared)" = xyes ]; then \
- $(COMPILE.cc) $(PICFLAG) -DC \
- `for N in $(STRIO); do echo " -D$${N}"; done` \
- $(srcdir)/sinst.cc -o pic/cstrio.o; \
- else true ; fi
- $(COMPILE.cc) -DC `for N in $(STRIO); do echo " -D$${N}"; done` \
- $(srcdir)/sinst.cc -o cstrio.o
- touch bigstmp-string
-
-COMFUNCS = MAIN ADDCC ADDCF ADDFC SUBCC SUBCF SUBFC MULCC MULCF MULFC DIVCC \
- DIVCF DIVFC PLUS MINUS EQCC EQCF EQFC NECC NECF NEFC ABS ARG POLAR \
- CONJ NORM COS COSH EXP LOG POWCC POWCF POWCI POWFC SIN SINH SQRT
-COMIO = EXTRACT INSERT
-
-stmp-complx: ${srcdir}/cinst.cc ${srcdir}/std/complext.h \
- ${srcdir}/std/complext.cc ${srcdir}/std/dcomplex.h \
- ${srcdir}/std/ldcomplex.h
- for N in $(COMFUNCS) $(COMIO); do \
- echo f$${N}; \
- if [ x"$(enable_shared)" = xyes ]; then \
- $(COMPILE.cc) $(PICFLAG) -DF -D$${N} $(srcdir)/cinst.cc \
- -o pic/f$${N}.o; \
- else true ; fi; \
- if [ $$? -eq 0 ]; then true; else exit 1; fi; \
- $(COMPILE.cc) -DF -D$${N} ${srcdir}/cinst.cc -o f$${N}.o; \
- if [ $$? -eq 0 ]; then true; else exit 1; fi; \
- echo d$${N}; \
- if [ x"$(enable_shared)" = xyes ]; then \
- $(COMPILE.cc) $(PICFLAG) -DD -D$${N} $(srcdir)/cinst.cc \
- -o pic/d$${N}.o; \
- else true ; fi; \
- if [ $$? -eq 0 ]; then true; else exit 1; fi; \
- $(COMPILE.cc) -DD -D$${N} ${srcdir}/cinst.cc -o d$${N}.o; \
- if [ $$? -eq 0 ]; then true; else exit 1; fi; \
- echo ld$${N}; \
- if [ x"$(enable_shared)" = xyes ]; then \
- $(COMPILE.cc) $(PICFLAG) -DLD -D$${N} $(srcdir)/cinst.cc \
- -o pic/ld$${N}.o; \
- else true ; fi; \
- if [ $$? -eq 0 ]; then true; else exit 1; fi; \
- $(COMPILE.cc) -DLD -D$${N} ${srcdir}/cinst.cc -o ld$${N}.o; \
- if [ $$? -eq 0 ]; then true; else exit 1; fi; \
- done
- touch stmp-complx
-
-bigstmp-complx: ${srcdir}/cinst.cc ${srcdir}/std/complext.h \
- ${srcdir}/std/complext.cc ${srcdir}/std/dcomplex.h \
- ${srcdir}/std/ldcomplex.h
- echo fcomplex
- if [ x"$(enable_shared)" = xyes ]; then \
- $(COMPILE.cc) $(PICFLAG) -DF \
- `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
- $(srcdir)/cinst.cc -o pic/fcomplex.o; \
- else true ; fi
- $(COMPILE.cc) -DF `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
- $(srcdir)/cinst.cc -o fcomplex.o
- echo fcomio
- if [ x"$(enable_shared)" = xyes ]; then \
- $(COMPILE.cc) $(PICFLAG) -DF \
- `for N in $(COMIO); do echo " -D$${N}"; done` \
- $(srcdir)/cinst.cc -o pic/fcomio.o; \
- else true ; fi
- $(COMPILE.cc) -DF `for N in $(COMIO); do echo " -D$${N}"; done` \
- $(srcdir)/cinst.cc -o fcomio.o
- echo dcomplex
- if [ x"$(enable_shared)" = xyes ]; then \
- $(COMPILE.cc) $(PICFLAG) -DD \
- `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
- $(srcdir)/cinst.cc -o pic/dcomplex.o; \
- else true ; fi
- $(COMPILE.cc) -DD `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
- $(srcdir)/cinst.cc -o dcomplex.o
- echo dcomio
- if [ x"$(enable_shared)" = xyes ]; then \
- $(COMPILE.cc) $(PICFLAG) -DD \
- `for N in $(COMIO); do echo " -D$${N}"; done` \
- $(srcdir)/cinst.cc -o pic/dcomio.o; \
- else true ; fi
- $(COMPILE.cc) -DD `for N in $(COMIO); do echo " -D$${N}"; done` \
- $(srcdir)/cinst.cc -o dcomio.o
- echo ldcomplex
- if [ x"$(enable_shared)" = xyes ]; then \
- $(COMPILE.cc) $(PICFLAG) -DLD \
- `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
- $(srcdir)/cinst.cc -o pic/ldcomplex.o; \
- else true ; fi
- $(COMPILE.cc) -DLD `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
- $(srcdir)/cinst.cc -o ldcomplex.o
- echo ldcomio
- if [ x"$(enable_shared)" = xyes ]; then \
- $(COMPILE.cc) $(PICFLAG) -DLD \
- `for N in $(COMIO); do echo " -D$${N}"; done` \
- $(srcdir)/cinst.cc -o pic/ldcomio.o; \
- else true ; fi
- $(COMPILE.cc) -DLD `for N in $(COMIO); do echo " -D$${N}"; done` \
- $(srcdir)/cinst.cc -o ldcomio.o
- touch bigstmp-complx
-
-.PHONY: install
-install:
- rootme=`pwd`/ ; export rootme ; \
- if [ -z "$(MULTISUBDIR)" ]; then \
- cd $(srcdir); \
- for FILE in $(HEADERS); do \
- rm -f $(gxx_include_dir)/$$FILE ; \
- if [ -f stl/$$FILE ]; then \
- $(INSTALL_DATA) stl/$$FILE $(gxx_include_dir)/$$FILE ; \
- else \
- $(INSTALL_DATA) $$FILE $(gxx_include_dir)/$$FILE ; \
- fi ; \
- chmod a-x $(gxx_include_dir)/$$FILE ; \
- done ; \
- for FILE in *.h std/*.h std/*.cc std/*.tcc; do \
- rm -f $(gxx_include_dir)/$$FILE ; \
- $(INSTALL_DATA) $$FILE $(gxx_include_dir)/$$FILE ; \
- chmod a-x $(gxx_include_dir)/$$FILE ; \
- done ; \
- cd stl; \
- for FILE in *.h; do \
- rm -f $(gxx_include_dir)/$$FILE ; \
- $(INSTALL_DATA) $$FILE $(gxx_include_dir)/$$FILE ; \
- chmod a-x $(gxx_include_dir)/$$FILE ; \
- done ; \
- else true ; \
- fi
- rootme=`pwd`/ ; export rootme ; \
- if [ x$(enable_version_specific_runtime_libs) != xyes ]; then \
- INSTALLDIR=$(libdir); \
- else \
- INSTALLDIR=$(libsubdir); \
- fi; \
- INSTALLLINKDIR=$(libsubdir); \
- if [ $${INSTALLLINKDIR}$(MULTISUBDIR) = $${INSTALLDIR}$(MULTISUBDIR) ]; then \
- RELINSTALLDIR=; \
- elif [ x$(MULTISUBDIR) = x ]; then \
- if [ $(build_alias) = $(target_alias) ]; then \
- RELINSTALLDIR=../../../; \
- else \
- RELINSTALLDIR=../../../../$(target_alias)/lib/; \
- fi; \
- else \
- if [ $(build_alias) = $(target_alias) ]; then \
- RELINSTALLDIR=../../..`echo $(MULTISUBDIR) | sed -e 's,/[^/]*,/..,g'`$(MULTISUBDIR)/; \
- else \
- RELINSTALLDIR=../../../..`echo $(MULTISUBDIR) | sed -e 's,/[^/]*,/..,g'`/$(target_alias)/lib$(MULTISUBDIR)/; \
- fi; \
- fi; \
- if [ $(build_alias) != $(target_alias) ]; then \
- case $$RELINSTALLDIR in \
- ../../../|../../../../) \
- RELINSTALLDIR=../$${RELINSTALLDIR}$(target_alias)/lib/;; \
- esac; \
- fi; \
- rm -f $${INSTALLLINKDIR}$(MULTISUBDIR)/$(SHLINK) ; \
- rm -f $${INSTALLLINKDIR}$(MULTISUBDIR)/$(ARLINK) ; \
- for FILE in $(LIBS) ; do \
- rm -f $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
- if [ $$FILE = $(SHLINK) ] ; then \
- if [ -f $${INSTALLDIR}/$(MSHLINK) ]; then \
- rm -f $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE ; \
- $(LN_S) $${RELINSTALLDIR}$(MSHLINK) $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE \
- || cp $${RELINSTALLDIR}$(MSHLINK) $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE ; \
- else \
- rm -f $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE ; \
- $(LN_S) $${RELINSTALLDIR}$(SHLIB) $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE \
- || cp $${RELINSTALLDIR}$(SHLIB) $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE ; \
- fi; \
- elif [ $$FILE = $(ARLINK) ] ; then \
- if [ -f $${INSTALLDIR}/$(MARLINK) ]; then \
- rm -f $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE ; \
- $(LN_S) $${RELINSTALLDIR}$(MARLINK) $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE \
- || cp $${RELINSTALLDIR}$(MARLINK) $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE ; \
- else \
- rm -f $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE ; \
- $(LN_S) $${RELINSTALLDIR}$(ARLIB) $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE \
- || cp $${RELINSTALLDIR}$(ARLIB) $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE ; \
- fi; \
- elif [ $$FILE = mshlink ]; then \
- for FILE in $(MSHLINK) ; do \
- rm -f $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
- $(LN_S) $(SHLIB) $${INSTALLDIR}$(MULTISUBDIR)/$$FILE \
- || cp $(SHLIB) $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
- done; \
- elif [ $$FILE = marlink ]; then \
- for FILE in $(MARLINK) ; do \
- rm -f $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
- $(LN_S) $(ARLIB) $${INSTALLDIR}$(MULTISUBDIR)/$$FILE \
- || cp $(ARLIB) $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
- done; \
- elif [ $$FILE = $(SHLIB) ]; then \
- $(INSTALL_PROGRAM) $$FILE $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
- : On the HP, shared libraries must be mode 555. ;\
- chmod 555 $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
- else \
- $(INSTALL_DATA) $$FILE $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
- $(RANLIB) $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
- chmod a-x $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
- fi ; \
- done
- @rootme=`pwd`/ ; export rootme ; \
- $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=install
-
-.PHONY: force
-force:
-
-MYCXXFLAGS = -g -O2 -Wpointer-arith -Wnested-externs -Woverloaded-virtual -Wbad-function-cast -Winline -Wwrite-strings -pedantic -Wno-long-long
-MYCFLAGS = -g -O2 -Wpointer-arith -Wnested-externs
-
-.PHONY: stuff
-stuff:
- $(MAKE) stuff1
- $(MAKE) stuff2
-
-stuff1:
- $(MAKE) clean
- $(MAKE) -C ../libio c++clean
- touch ../../gcc/libgcc2.ready
-
-stuff2:
- $(MAKE) -C ../../gcc/ libgcc.a
- $(MAKE) CXXFLAGS="$(MYCXXFLAGS)" CFLAGS="$(MYCFLAGS)"
- -$(MAKE) check
- -$(MAKE) -C ../libio check
- -$(MAKE) -C ../../gcc check-g++
diff --git a/contrib/libstdc++/NEWS b/contrib/libstdc++/NEWS
deleted file mode 100644
index 89e866e7d3f8..000000000000
--- a/contrib/libstdc++/NEWS
+++ /dev/null
@@ -1,9 +0,0 @@
-SUMMARY OF RECENT MAJOR CHANGES to LIBSTDC++.
-(Also check ../libio/NEWS.)
-
-*** Noteworthy changes in libstdc++ for EGCS
-
-* EGCS includes the SGI STL implementation without changes.
-
-* As a result of these and other changes, libstc++ for EGCS is not binary
- compatible with previous releases of libstdc++.
diff --git a/contrib/libstdc++/cassert b/contrib/libstdc++/cassert
deleted file mode 100644
index b4165bfae7fe..000000000000
--- a/contrib/libstdc++/cassert
+++ /dev/null
@@ -1,7 +0,0 @@
-// -*- C++ -*- forwarding header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __CASSERT__
-#define __CASSERT__
-#include <assert.h>
-#endif
diff --git a/contrib/libstdc++/cctype b/contrib/libstdc++/cctype
deleted file mode 100644
index e2765aed50a6..000000000000
--- a/contrib/libstdc++/cctype
+++ /dev/null
@@ -1,7 +0,0 @@
-// The -*- C++ -*- character type header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __CCTYPE__
-#define __CCTYPE__
-#include <ctype.h>
-#endif
diff --git a/contrib/libstdc++/cerrno b/contrib/libstdc++/cerrno
deleted file mode 100644
index ce493469597e..000000000000
--- a/contrib/libstdc++/cerrno
+++ /dev/null
@@ -1,7 +0,0 @@
-// The -*- C++ -*- error number header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __CERRNO__
-#define __CERRNO__
-#include <errno.h>
-#endif
diff --git a/contrib/libstdc++/cfloat b/contrib/libstdc++/cfloat
deleted file mode 100644
index cf59eadfb793..000000000000
--- a/contrib/libstdc++/cfloat
+++ /dev/null
@@ -1,7 +0,0 @@
-// -*- C++ -*- forwarding header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __CFLOAT__
-#define __CFLOAT__
-#include <float.h>
-#endif
diff --git a/contrib/libstdc++/cinst.cc b/contrib/libstdc++/cinst.cc
deleted file mode 100644
index 983e8a9caa76..000000000000
--- a/contrib/libstdc++/cinst.cc
+++ /dev/null
@@ -1,154 +0,0 @@
-// Instantiation file for the -*- C++ -*- complex number classes.
-// Copyright (C) 1994 Free Software Foundation
-
-#ifdef F
-typedef float f;
-#endif
-#ifdef D
-typedef double f;
-#endif
-#ifdef LD
-typedef long double f;
-#endif
-
-#if defined (MAIN) && defined (__GNUG__)
-#ifdef F
-#pragma implementation "fcomplex"
-#endif
-#ifdef D
-#pragma implementation "dcomplex"
-#endif
-#ifdef LD
-#pragma implementation "ldcomplex"
-#endif
-#endif
-
-#if 0
-#define _G_NO_EXTERN_TEMPLATES
-#endif
-#include <std/complext.cc>
-
-typedef complex<f> c;
-typedef const c& ccr;
-
-#ifdef MAIN
-template c& __doapl (c*, ccr);
-template c& __doaml (c*, ccr);
-template c& __doami (c*, ccr);
-template c& __doadv (c*, ccr);
-#endif
-
-#ifdef ADDCC
-template c operator+ (ccr, ccr);
-#endif
-#ifdef ADDCF
-template c operator+ (ccr, f);
-#endif
-#ifdef ADDFC
-template c operator+ (f, ccr);
-#endif
-#ifdef SUBCC
-template c operator- (ccr, ccr);
-#endif
-#ifdef SUBCF
-template c operator- (ccr, f);
-#endif
-#ifdef SUBFC
-template c operator- (f, ccr);
-#endif
-#ifdef MULCC
-template c operator* (ccr, ccr);
-#endif
-#ifdef MULCF
-template c operator* (ccr, f);
-#endif
-#ifdef MULFC
-template c operator* (f, ccr);
-#endif
-#ifdef DIVCC
-template c operator/ (ccr, ccr);
-#endif
-#ifdef DIVCF
-template c operator/ (ccr, f);
-#endif
-#ifdef DIVFC
-template c operator/ (f, ccr);
-#endif
-#ifdef PLUS
-template c operator+ (ccr);
-#endif
-#ifdef MINUS
-template c operator- (ccr);
-#endif
-#ifdef EQCC
-template bool operator== (ccr, ccr);
-#endif
-#ifdef EQCF
-template bool operator== (ccr, f);
-#endif
-#ifdef EQFC
-template bool operator== (f, ccr);
-#endif
-#ifdef NECC
-template bool operator!= (ccr, ccr);
-#endif
-#ifdef NECF
-template bool operator!= (ccr, f);
-#endif
-#ifdef NEFC
-template bool operator!= (f, ccr);
-#endif
-#ifdef ABS
-template f abs (ccr);
-#endif
-#ifdef ARG
-template f arg (ccr);
-#endif
-#ifdef POLAR
-template c polar (f, f);
-#endif
-#ifdef CONJ
-template c conj (ccr);
-#endif
-#ifdef NORM
-template f norm (ccr);
-#endif
-#ifdef COS
-template c cos (ccr);
-#endif
-#ifdef COSH
-template c cosh (ccr);
-#endif
-#ifdef EXP
-template c exp (ccr);
-#endif
-#ifdef LOG
-template c log (ccr);
-#endif
-#ifdef POWCC
-template c pow (ccr, ccr);
-#endif
-#ifdef POWCF
-template c pow (ccr, f);
-#endif
-#ifdef POWCI
-template c pow (ccr, int);
-#endif
-#ifdef POWFC
-template c pow (f, ccr);
-#endif
-#ifdef SIN
-template c sin (ccr);
-#endif
-#ifdef SINH
-template c sinh (ccr);
-#endif
-#ifdef SQRT
-template c sqrt (ccr);
-#endif
-#ifdef EXTRACT
-template istream& operator>> (istream&, complex<f>&);
-#endif
-#ifdef INSERT
-template ostream& operator<< (ostream&, const complex<f>&);
-#endif
diff --git a/contrib/libstdc++/ciso646 b/contrib/libstdc++/ciso646
deleted file mode 100644
index 4d8200d73dc6..000000000000
--- a/contrib/libstdc++/ciso646
+++ /dev/null
@@ -1,7 +0,0 @@
-// -*- C++ -*- forwarding header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __CISO646__
-#define __CISO646__
-#include <iso646.h>
-#endif
diff --git a/contrib/libstdc++/climits b/contrib/libstdc++/climits
deleted file mode 100644
index 1b29b3af01ec..000000000000
--- a/contrib/libstdc++/climits
+++ /dev/null
@@ -1,7 +0,0 @@
-// -*- C++ -*- forwarding header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __CLIMITS__
-#define __CLIMITS__
-#include <limits.h>
-#endif
diff --git a/contrib/libstdc++/clocale b/contrib/libstdc++/clocale
deleted file mode 100644
index b67cf31c9d2e..000000000000
--- a/contrib/libstdc++/clocale
+++ /dev/null
@@ -1,7 +0,0 @@
-// The -*- C++ -*- locale support header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __CLOCALE__
-#define __CLOCALE__
-#include <locale.h>
-#endif
diff --git a/contrib/libstdc++/cmath b/contrib/libstdc++/cmath
deleted file mode 100644
index b18ea0b428c6..000000000000
--- a/contrib/libstdc++/cmath
+++ /dev/null
@@ -1,76 +0,0 @@
-// The -*- C++ -*- math functions header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __CMATH__
-#define __CMATH__
-#include <_G_config.h>
-#include <math.h>
-
-#ifdef __GNUG__
-#pragma interface "cmath"
-#endif
-
-extern "C++" {
-#if 0
-float acos (float);
-float asin (float);
-float atan (float);
-float atan2(float, float);
-float ceil (float);
-float cos (float);
-float cosh (float);
-float exp (float);
-float fabs (float);
-float floor(float);
-float fmod (float, float);
-float frexp(float, int*);
-float modf (float, float*);
-float ldexp(float, int);
-float log (float);
-float log10(float);
-float pow (float, float);
-float pow (float, int);
-float sin (float);
-float sinh (float);
-float sqrt (float);
-float tan (float);
-float tanh (float);
-#endif
-
-inline float abs (float x) { return fabs (x); }
-#if ! _G_MATH_H_INLINES /* hpux and SCO define this in math.h */
-inline double abs (double x) { return fabs (x); }
-#endif
-
-#if 0
-double pow(double, int);
-
-long double acos (long double);
-long double asin (long double);
-long double atan (long double);
-long double atan2(long double, long double);
-long double ceil (long double);
-long double cos (long double);
-long double cosh (long double);
-long double exp (long double);
-long double fabs (long double);
-long double floor(long double);
-long double frexp(long double, int*);
-long double fmod (long double, long double);
-long double frexp(long double, int*);
-long double log (long double);
-long double log10(long double);
-long double modf (long double, long double*);
-long double pow (long double, long double);
-long double pow (long double, int);
-long double sin (long double);
-long double sinh (long double);
-long double sqrt (long double);
-long double tan (long double);
-long double tanh (long double);
-#endif
-inline long double abs (long double x) { return fabs (x); }
-
-} // extern "C++"
-
-#endif
diff --git a/contrib/libstdc++/cmathi.cc b/contrib/libstdc++/cmathi.cc
deleted file mode 100644
index afd740f013e9..000000000000
--- a/contrib/libstdc++/cmathi.cc
+++ /dev/null
@@ -1,7 +0,0 @@
-// Implementation file for the -*- C++ -*- math functions header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifdef __GNUG__
-#pragma implementation "cmath"
-#endif
-#include <cmath>
diff --git a/contrib/libstdc++/complex b/contrib/libstdc++/complex
deleted file mode 100644
index bfdd352b4623..000000000000
--- a/contrib/libstdc++/complex
+++ /dev/null
@@ -1,18 +0,0 @@
-// Main header for the -*- C++ -*- complex number classes.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __COMPLEX__
-#define __COMPLEX__
-
-#include <std/complext.h>
-
-extern "C++" {
-#define __STD_COMPLEX
-
-// ANSI complex types
-typedef complex<float> float_complex;
-typedef complex<double> double_complex;
-typedef complex<long double> long_double_complex;
-}
-
-#endif
diff --git a/contrib/libstdc++/complex.h b/contrib/libstdc++/complex.h
deleted file mode 100644
index 2e88de854a68..000000000000
--- a/contrib/libstdc++/complex.h
+++ /dev/null
@@ -1,6 +0,0 @@
-// -*- C++ -*- backward compatiblity header.
-// Copyright (C) 1994 Free Software Foundation
-
-#ifndef __COMPLEX_H__
-#include <complex>
-#endif
diff --git a/contrib/libstdc++/config/aix.ml b/contrib/libstdc++/config/aix.ml
deleted file mode 100644
index dec7a905a343..000000000000
--- a/contrib/libstdc++/config/aix.ml
+++ /dev/null
@@ -1,9 +0,0 @@
-# AIX has wierd shared/non-shared libraries.
-
-ARLIB = libstdc++-ar.a.$(VERSION)
-ARLINK = libstdc++-ar.a
-SHLINK = libstdc++.a
-LIBS = $(ARLIB) $(ARLINK) $(SHLIB) $(SHLINK)
-DEPLIBS = ../$(SHLIB)
-SHDEPS = -lm
-SHFLAGS = -Wl,-unix
diff --git a/contrib/libstdc++/config/dec-osf.ml b/contrib/libstdc++/config/dec-osf.ml
deleted file mode 100644
index a11f373d84c1..000000000000
--- a/contrib/libstdc++/config/dec-osf.ml
+++ /dev/null
@@ -1,6 +0,0 @@
-# We don't need -fpic on the alpha, so let's install both the shared and
-# non-shared versions.
-
-LIBS = $(ARLIB) $(ARLINK) $(SHLIB) $(SHLINK)
-DEPLIBS = ../$(SHLIB)
-SHDEPS = -lm
diff --git a/contrib/libstdc++/config/delta.mt b/contrib/libstdc++/config/delta.mt
deleted file mode 100644
index b0b36db1062c..000000000000
--- a/contrib/libstdc++/config/delta.mt
+++ /dev/null
@@ -1,2 +0,0 @@
-# If FPU instructions are generated by default, we have to use a special libm.a
-MLDLIBS = $(LDLIBS) `case "$(CXXFLAGS)" in *-m68000* | *-mc68000* | *-msoft-float* ) echo -lm ;; * ) echo -lm881 ;; esac`
diff --git a/contrib/libstdc++/config/elf.ml b/contrib/libstdc++/config/elf.ml
deleted file mode 100644
index bd711debf836..000000000000
--- a/contrib/libstdc++/config/elf.ml
+++ /dev/null
@@ -1,8 +0,0 @@
-# Elf without shared libm -- we have to link with the archive library, even
-# for programs that don't use complex.
-
-LIBS = $(ARLIB) $(ARLINK) $(SHLIB) $(SHLINK)
-SHFLAGS = -h $(SHLIB)
-DEPLIBS = ../$(SHLIB)
-LDLIBS = -L.. -lstdc++ -lm
-MLDLIBS = -L.. -lstdc++ -lm
diff --git a/contrib/libstdc++/config/elfshlibm.ml b/contrib/libstdc++/config/elfshlibm.ml
deleted file mode 100644
index 826f0bc0917e..000000000000
--- a/contrib/libstdc++/config/elfshlibm.ml
+++ /dev/null
@@ -1,6 +0,0 @@
-# Elf with shared libm, so we can link it into the shared libstdc++.
-
-LIBS = $(ARLIB) $(ARLINK) $(SHLIB) $(SHLINK)
-SHFLAGS = -h $(SHLIB)
-SHDEPS = -lm
-DEPLIBS = ../$(SHLIB)
diff --git a/contrib/libstdc++/config/freebsd.ml b/contrib/libstdc++/config/freebsd.ml
deleted file mode 100644
index 3ee682690ad5..000000000000
--- a/contrib/libstdc++/config/freebsd.ml
+++ /dev/null
@@ -1,6 +0,0 @@
-# Elf with shared libm, so we can link it into the shared libstdc++.
-
-LIBS = $(ARLIB) $(ARLINK) $(SHLIB) $(SHLINK) mshlink
-SHFLAGS = -Wl,-soname,$(MSHLINK)
-SHDEPS = -lm
-DEPLIBS = ../$(SHLIB)
diff --git a/contrib/libstdc++/config/gnu.ml b/contrib/libstdc++/config/gnu.ml
deleted file mode 100644
index 2a0380327f7c..000000000000
--- a/contrib/libstdc++/config/gnu.ml
+++ /dev/null
@@ -1,6 +0,0 @@
-# Elf with shared libm, so we can link it into the shared libstdc++.
-
-LIBS = $(ARLIB) $(ARLINK) $(SHLIB) $(SHLINK)
-SHFLAGS = -Wl,-soname,$(SHLIB)
-SHDEPS = -lm
-DEPLIBS = ../$(SHLIB)
diff --git a/contrib/libstdc++/config/hpux.ml b/contrib/libstdc++/config/hpux.ml
deleted file mode 100644
index a39602a64032..000000000000
--- a/contrib/libstdc++/config/hpux.ml
+++ /dev/null
@@ -1,6 +0,0 @@
-# HPUX uses the .sl suffix for shared libraries.
-
-SHLIB = libstdc++.sl
-LIBS = $(ARLIB) $(ARLINK) $(SHLIB)
-DEPLIBS = ../$(SHLIB)
-SHFLAGS = $(PICFLAG)
diff --git a/contrib/libstdc++/config/irix5.ml b/contrib/libstdc++/config/irix5.ml
deleted file mode 100644
index 055c832c26e6..000000000000
--- a/contrib/libstdc++/config/irix5.ml
+++ /dev/null
@@ -1,6 +0,0 @@
-# We don't need -fpic on IRIX, so let's install both the shared and
-# non-shared versions.
-
-LIBS = $(ARLIB) $(ARLINK) $(SHLIB) $(SHLINK)
-DEPLIBS = ../$(SHLIB)
-SHDEPS = -lm
diff --git a/contrib/libstdc++/config/linux.ml b/contrib/libstdc++/config/linux.ml
deleted file mode 100644
index 14dcb45b79df..000000000000
--- a/contrib/libstdc++/config/linux.ml
+++ /dev/null
@@ -1,11 +0,0 @@
-# Elf with shared libm, so we can link it into the shared libstdc++.
-
-ARLIB = libstdc++-$(LIBSTDCXX_INTERFACE)$(LIBC_INTERFACE)$(CXX_INTERFACE)-$(VERSION).a
-MARLINK = libstdc++$(LIBC_INTERFACE)$(CXX_INTERFACE).a.$(LIBSTDCXX_INTERFACE)
-SHLIB = libstdc++-$(LIBSTDCXX_INTERFACE)$(LIBC_INTERFACE)$(CXX_INTERFACE)-$(VERSION).so
-MSHLINK = libstdc++$(LIBC_INTERFACE)$(CXX_INTERFACE).so.$(LIBSTDCXX_INTERFACE)
-
-LIBS = $(ARLIB) marlink $(ARLINK) $(SHLIB) mshlink $(SHLINK)
-SHFLAGS = -Wl,-soname,$(MSHLINK)
-SHDEPS = -lm
-DEPLIBS = ../$(SHLIB)
diff --git a/contrib/libstdc++/config/linux.mt b/contrib/libstdc++/config/linux.mt
deleted file mode 100644
index 5848851be8ac..000000000000
--- a/contrib/libstdc++/config/linux.mt
+++ /dev/null
@@ -1,2 +0,0 @@
-# tell we want the mt-safe version
-MT_CFLAGS = -D_IO_MTSAFE_IO
diff --git a/contrib/libstdc++/config/openbsd.ml b/contrib/libstdc++/config/openbsd.ml
deleted file mode 100644
index 09c40235adf6..000000000000
--- a/contrib/libstdc++/config/openbsd.ml
+++ /dev/null
@@ -1,7 +0,0 @@
-# Base shared lib for OpenBSD i386
-
-LIBS = $(ARLIB) $(ARLINK) $(SHLIB) $(SHLINK) mshlink
-SHFLAGS = -nostdlib -Wl,-Bshareable,-Bforcearchive
-SHDEPS = -lm
-DEPLIBS = ../$(SHLIB)
-
diff --git a/contrib/libstdc++/config/openbsd.mt b/contrib/libstdc++/config/openbsd.mt
deleted file mode 100644
index 29da11cf454e..000000000000
--- a/contrib/libstdc++/config/openbsd.mt
+++ /dev/null
@@ -1,3 +0,0 @@
-# tell we want the mt-safe version
-MT_CFLAGS = -D_IO_MTSAFE_IO -D_PTHREADS
-
diff --git a/contrib/libstdc++/config/posix.mt b/contrib/libstdc++/config/posix.mt
deleted file mode 100644
index 6afe1e514d93..000000000000
--- a/contrib/libstdc++/config/posix.mt
+++ /dev/null
@@ -1 +0,0 @@
-MT_CFLAGS = -D_PTHREADS
diff --git a/contrib/libstdc++/config/sol2pth.mt b/contrib/libstdc++/config/sol2pth.mt
deleted file mode 100644
index 6afe1e514d93..000000000000
--- a/contrib/libstdc++/config/sol2pth.mt
+++ /dev/null
@@ -1 +0,0 @@
-MT_CFLAGS = -D_PTHREADS
diff --git a/contrib/libstdc++/config/sol2shm.ml b/contrib/libstdc++/config/sol2shm.ml
deleted file mode 100644
index e87f079e46cb..000000000000
--- a/contrib/libstdc++/config/sol2shm.ml
+++ /dev/null
@@ -1,6 +0,0 @@
-# Solaris2 with shared libm, so we can link it into the shared libstdc++.
-
-LIBS = $(ARLIB) $(ARLINK) $(SHLIB) $(SHLINK)
-SHFLAGS = -h $(SHLIB)
-SHDEPS = -lm
-DEPLIBS = ../$(SHLIB)
diff --git a/contrib/libstdc++/config/sol2solth.mt b/contrib/libstdc++/config/sol2solth.mt
deleted file mode 100644
index f809d0ace861..000000000000
--- a/contrib/libstdc++/config/sol2solth.mt
+++ /dev/null
@@ -1 +0,0 @@
-MT_CFLAGS = -D_SOLTHREADS
diff --git a/contrib/libstdc++/config/sunos4.ml b/contrib/libstdc++/config/sunos4.ml
deleted file mode 100644
index 3c5de27ab508..000000000000
--- a/contrib/libstdc++/config/sunos4.ml
+++ /dev/null
@@ -1,9 +0,0 @@
-# SunOS doesn't provide a shared libm, so we have to link with the archive
-# library, even for programs that don't use complex.
-# SunOS requires a version number in shared library filenames.
-
-LIBS = $(ARLIB) $(ARLINK) $(SHLIB)
-SHFLAGS = $(PICFLAG)
-DEPLIBS = ../$(SHLIB)
-LDLIBS = -L.. -lstdc++ -lm
-MLDLIBS = -L.. -lstdc++ -lm
diff --git a/contrib/libstdc++/config/x86-interix.ml b/contrib/libstdc++/config/x86-interix.ml
deleted file mode 100644
index 8b8774e3a7a3..000000000000
--- a/contrib/libstdc++/config/x86-interix.ml
+++ /dev/null
@@ -1,9 +0,0 @@
-# x86 Interix. SHLINK is defined to be .dummy to avoid running into
-# the lack of symbolic links.
-
-SHLINK = .dummy
-SHLIB = libstdc++.so
-LIBS = $(ARLIB) $(SHLIB)
-DEPLIBS = ../$(SHLIB)
-SHFLAGS = $(PICFLAG)
-
diff --git a/contrib/libstdc++/configure.in b/contrib/libstdc++/configure.in
deleted file mode 100644
index bd2c9c71e439..000000000000
--- a/contrib/libstdc++/configure.in
+++ /dev/null
@@ -1,203 +0,0 @@
-# This file is a shell script fragment that supplies the information
-# necessary for a configure script to process the program in
-# this directory. For more information, look at ../configure.
-
-# If the language specific compiler does not exist, but the "gcc" directory
-# does, we do not build anything. Note, $r is set by the top-level Makefile.
-# Note that when we look for the compiler, we search both with and without
-# extension to handle cross and canadian cross builds.
-# Note that if $norecursion is set we're being called from config.status,
-# so don't check for the compiler; we might be doing a make clean.
-compiler_name=cc1plus
-rm -f skip-this-dir
-if test -n "$r" && [ -z "$norecursion" ] ; then
- if test -d "$r"/gcc; then
- if test -f "$r"/gcc/$compiler_name \
- || test -f "$r"/gcc/$compiler_name.exe; then
- true
- else
- echo "rm -f multilib.out" > skip-this-dir
- fi
- fi
-fi
-
-if [ "${srcdir}" = "." ] ; then
- if [ "${with_target_subdir}" != "." ] ; then
- topsrcdir=${with_multisrctop}../..
- else
- topsrcdir=${with_multisrctop}..
- fi
-else
- topsrcdir=${srcdir}/..
-fi
-
-if [ -d ${topsrcdir}/gcc ] ; then
- configdirs="tests testsuite"
-else
- configdirs="tests"
-fi
-srctrigger=sinst.cc
-srcname="ANSI C++ library"
-package_makefile_frag=Make.pack
-package_makefile_rules_frag=Make.pack.r
-
-# per-host:
-
-# per-target:
-
-echo "# Warning: this fragment is automatically generated" > temp.mt
-frags=
-
-# If they didn't specify --enable-shared, don't generate shared libs.
-case "${enable_shared}" in
- yes) shared=yes ;;
- no) shared=no ;;
- *libstdc++*) shared=yes ;;
- *) shared=no ;;
-esac
-
-if [ "${shared}" = "yes" ]; then
- case "${target}" in
- alpha*-*-linux*) frags=../../config/mh-elfalphapic ;;
- arm*-*-*) frags=../../config/mh-armpic ;;
- hppa*-*-*) frags=../../config/mh-papic ;;
- i[3456]86-*-*) frags=../../config/mh-x86pic ;;
- powerpc*-*-aix*) ;;
- powerpc*-*-*) frags=../../config/mh-ppcpic ;;
- *-*-*) frags=../../config/mh-${target_cpu}pic ;;
- esac
- case "${target}" in
- *-dec-osf*) frags="${frags} dec-osf.ml";;
- *-*-hpux*) frags="${frags} hpux.ml" ;;
- *-*-irix[56]*) frags="${frags} irix5.ml" ;;
- *-*-linux*aout*) ;;
- *-*-freebsd2*) ;;
- *-*-freebsd*) frags="${frags} freebsd.ml" ;;
- *-*-linux*) frags="${frags} linux.ml" ;;
- *-*-openbsd*) frags="${frags} openbsd.ml" ;;
- *-*-sysv[45]*|*-*-udk*) frags="${frags} elf.ml" ;;
- *-*-solaris*) frags="${frags} sol2shm.ml" ;;
- *-*-sunos4*) frags="${frags} sunos4.ml" ;;
- *-*-aix*) frags="${frags} aix.ml" ;;
- i[3456]86-*-interix*) frags="${frags} x86-interix.ml" ;;
- *-*-gnu*) frags="${frags} gnu.ml" ;;
- esac
-fi
-
-# Make sure the right flags are defined for multi-threading.
-case "${target}" in
- alpha*-*-linux-gnulibc1) frags="${frags} linux.mt" ;;
- powerpc*-*-linux-gnulibc1) frags="${frags} linux.mt" ;;
- *-*-linux-gnu) frags="${frags} linux.mt" ;;
- *-*-openbsd*)
- case "x${enable_threads}" in
- xyes|xposix) frags="${frags} openbsd.mt" ;;
- esac;;
- m68k-motorola-sysv) frags="${frags} delta.mt" ;;
- *-*-solaris*)
- case "x${enable_threads}" in
- xposix) frags="${frags} sol2pth.mt" ;;
- xsolaris) frags="${frags} sol2solth.mt" ;;
- esac ;;
- *)
- case "x${enable_threads}" in
- xposix) frags="${frags} posix.mt" ;;
- esac ;;
-esac
-
-for frag in ${frags}; do
- case ${frag} in
- ../* )
- if [ ${srcdir} = . ]; then
- [ -n "${with_target_subdir}" ] && frag=../${frag}
- [ -n "${with_multisrctop}" ] && frag=${with_multisrctop}${frag}
- fi
- ;;
- esac
- frag=${srcdir}/config/$frag
- if [ -f ${frag} ]; then
- echo "Appending ${frag} to target-mkfrag"
- echo "# Following fragment copied from ${frag}" >> temp.mt
- cat ${frag} >> temp.mt
- fi
-done
-
-target_makefile_frag=target-mkfrag
-${moveifchange} temp.mt target-mkfrag
-
-LIBDIR=yes
-TO_TOPDIR=../
-ALL='libs'
-XCXXINCLUDES="-I${srcdir} -I${srcdir}/stl -I${TO_TOPDIR}libio -I${srcdir}/${TO_TOPDIR}libio"
-MOSTLYCLEAN='*.o pic stamp-picdir core so_locations $(MOSTLYCLEAN_JUNK)'
-CLEAN='$(CLEAN_JUNK)'
-EXTRA_DISTCLEAN='target-mkfrag'
-
-(. ${srcdir}/${TO_TOPDIR}libio/config.shared) >${package_makefile_frag} 2>${package_makefile_rules_frag}
-
-. ${topsrcdir}/config.if
-echo "
-LIBSTDCXX_INTERFACE=${libstdcxx_interface}
-CXX_INTERFACE=${cxx_interface}
-LIBC_INTERFACE=${libc_interface}
-" >> ${package_makefile_frag}
-
-# This duplicated the AC_PROG_LN_S macro in GNU autoconf.
-rm -f conttestdata
-if ln -s X conftestdata 2>/dev/null
-then
- rm -f conftestdata
- LN_S="ln -s"
-else
- LN_S=ln
-fi
-echo "
-LN_S=$LN_S
-" >> ${package_makefile_frag}
-
-# post-target:
-
-# If cross-compiling, we install in $(tooldir)/lib or in $(libsubdir)
-# depending on --enable-version-specific-runtime-libs.
-if [ -n "${with_cross_host}" ] ; then
- rm -f Makefile.tem
- sed \
- -e 's|^\([ ]*INSTALLDIR[ ]*=[ ]*\)\$(libdir)|\1$(tooldir)/lib|' \
- Makefile >Makefile.tem
- mv -f Makefile.tem Makefile
-fi
-
-# enable multilib-ing by default.
-if [ -z "${enable_multilib}" ]; then
- enable_multilib=yes
-fi
-
-. ${topsrcdir}/config-ml.in
-
-gxx_include_dir=
-# Specify the g++ header file directory
-# Check whether --with-gxx-include-dir or --without-gxx-include-dir was given.
-if test "${with_gxx_include_dir+set}" = set; then
- withval="$with_gxx_include_dir"
- case "${withval}" in
- yes)
- echo "configure.in: error: bad value ${withval} given for g++ include directory" 1>&2
- exit 1
- ;;
- no) ;;
- *) gxx_include_dir=$with_gxx_include_dir ;;
- esac
-fi
-
-if test x${gxx_include_dir} = x; then
- if test x${enable_version_specific_runtime_libs} = xyes; then
- gxx_include_dir='${libsubdir}/include/g++'
- else
- gxx_include_dir='${prefix}/include/g++'-${libstdcxx_interface}
- fi
-fi
-
-rm -f Makefile.tem
-sed -e "s%^gxx_include_dir[ ]*=.*$%gxx_include_dir=${gxx_include_dir}%" \
- Makefile >Makefile.tem
-mv -f Makefile.tem Makefile
diff --git a/contrib/libstdc++/csetjmp b/contrib/libstdc++/csetjmp
deleted file mode 100644
index 4bba048dcb5e..000000000000
--- a/contrib/libstdc++/csetjmp
+++ /dev/null
@@ -1,8 +0,0 @@
-// The -*- C++ -*- setjmp/longjmp header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __CSETJMP__
-#define __CSETJMP__
-#include <setjmp.h>
-#endif
-
diff --git a/contrib/libstdc++/csignal b/contrib/libstdc++/csignal
deleted file mode 100644
index 6febfb7b2ed5..000000000000
--- a/contrib/libstdc++/csignal
+++ /dev/null
@@ -1,7 +0,0 @@
-// The -*- C++ -*- signal handling header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __CSIGNAL__
-#define __CSIGNAL__
-#include <signal.h>
-#endif
diff --git a/contrib/libstdc++/cstdarg b/contrib/libstdc++/cstdarg
deleted file mode 100644
index 324f5a1c19b1..000000000000
--- a/contrib/libstdc++/cstdarg
+++ /dev/null
@@ -1,7 +0,0 @@
-// -*- C++ -*- forwarding header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __CSTDARG__
-#define __CSTDARG__
-#include <stdarg.h>
-#endif
diff --git a/contrib/libstdc++/cstddef b/contrib/libstdc++/cstddef
deleted file mode 100644
index db5cbe400374..000000000000
--- a/contrib/libstdc++/cstddef
+++ /dev/null
@@ -1,7 +0,0 @@
-// -*- C++ -*- forwarding header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __CSTDDEF__
-#define __CSTDDEF__
-#include <stddef.h>
-#endif
diff --git a/contrib/libstdc++/cstdio b/contrib/libstdc++/cstdio
deleted file mode 100644
index 1fe1456b5bdf..000000000000
--- a/contrib/libstdc++/cstdio
+++ /dev/null
@@ -1,7 +0,0 @@
-// The -*- C++ -*- standard I/O header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __CSTDIO__
-#define __CSTDIO__
-#include <stdio.h>
-#endif
diff --git a/contrib/libstdc++/cstdlib b/contrib/libstdc++/cstdlib
deleted file mode 100644
index e7c1a5160a56..000000000000
--- a/contrib/libstdc++/cstdlib
+++ /dev/null
@@ -1,23 +0,0 @@
-// The -*- C++ -*- standard library header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __CSTDLIB__
-#define __CSTDLIB__
-#include <stdlib.h>
-
-#ifdef __GNUG__
-#pragma interface "cstdlib"
-#endif
-
-extern "C++" {
-
-#if _G_HAS_LABS
-inline long abs(long x) { return labs (x); }
-#else
-inline long abs(long x) { return x >= 0 ? x : -x; }
-#endif
-//inline ldiv_t div(long x, long y) { return ldiv (x, y); }
-
-} // extern "C++"
-
-#endif
diff --git a/contrib/libstdc++/cstdlibi.cc b/contrib/libstdc++/cstdlibi.cc
deleted file mode 100644
index abbfa03464a5..000000000000
--- a/contrib/libstdc++/cstdlibi.cc
+++ /dev/null
@@ -1,7 +0,0 @@
-// Implementation file for the -*- C++ -*- standard library header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifdef __GNUG__
-#pragma implementation "cstdlib"
-#endif
-#include <cstdlib>
diff --git a/contrib/libstdc++/cstring b/contrib/libstdc++/cstring
deleted file mode 100644
index d8d03a765b65..000000000000
--- a/contrib/libstdc++/cstring
+++ /dev/null
@@ -1,96 +0,0 @@
-// The -*- C++ -*- null-terminated string header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __CSTRING__
-#define __CSTRING__
-
-#include <string.h>
-
-#if 0 // Let's not bother with this just yet.
-#include <cstddef>
-
-#ifdef __GNUG__
-#pragma interface "cstring"
-#endif
-
-// The ANSI C prototypes for these functions have a const argument type and
-// non-const return type, so we can't use them.
-
-extern "C++" {
-extern inline const char *
-_G_strchr (const char *s, int c)
-{
- return strchr (s, c);
-}
-
-extern inline char *
-_G_strchr (char *s, int c)
-{
- return const_cast<char *> (strchr (s, c));
-}
-
-extern inline const char *
-_G_strpbrk (const char *s1, const char *s2)
-{
- return strpbrk (s1, s2);
-}
-
-extern inline char *
-_G_strpbrk (char *s1, const char *s2)
-{
- return const_cast<char *> (strpbrk (s1, s2));
-}
-
-extern inline const char *
-_G_strrchr (const char *s, int c)
-{
- return strrchr (s, c);
-}
-
-extern inline char *
-_G_strrchr (char *s, int c)
-{
- return const_cast<char *> (strrchr (s, c));
-}
-
-extern inline const char *
-_G_strstr (const char *s1, const char *s2)
-{
- return strstr (s1, s2);
-}
-
-extern inline char *
-_G_strstr (char *s1, const char *s2)
-{
- return const_cast<char *> (strstr (s1, s2));
-}
-
-extern inline const void *
-_G_memchr (const void *s, int c, size_t n)
-{
- return memchr (s, c, n);
-}
-
-extern inline void *
-_G_memchr (void *s, int c, size_t n)
-{
- return const_cast<void *> (memchr (s, c, n));
-}
-} // extern "C++"
-
-// Lose any vendor macros for these functions.
-#undef strchr
-#undef strpbrk
-#undef strrchr
-#undef strstr
-#undef memchr
-
-// Ewww, namespace pollution. Anyone have a better idea?
-#define strchr _G_strchr
-#define strpbrk _G_strpbrk
-#define strrchr _G_strrchr
-#define strstr _G_strstr
-#define memchr _G_memchr
-#endif // 0
-
-#endif // !defined (__CSTRING__)
diff --git a/contrib/libstdc++/cstringi.cc b/contrib/libstdc++/cstringi.cc
deleted file mode 100644
index 2676febc9b0f..000000000000
--- a/contrib/libstdc++/cstringi.cc
+++ /dev/null
@@ -1,7 +0,0 @@
-// Implementation file for the -*- C++ -*- null-terminated string header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifdef __GNUG__
-#pragma implementation "cstring"
-#endif
-#include <cstring>
diff --git a/contrib/libstdc++/ctime b/contrib/libstdc++/ctime
deleted file mode 100644
index 0184da5929f3..000000000000
--- a/contrib/libstdc++/ctime
+++ /dev/null
@@ -1,7 +0,0 @@
-// The -*- C++ -*- time header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __CTIME__
-#define __CTIME__
-#include <time.h>
-#endif
diff --git a/contrib/libstdc++/cwchar b/contrib/libstdc++/cwchar
deleted file mode 100644
index 1674c12b61f0..000000000000
--- a/contrib/libstdc++/cwchar
+++ /dev/null
@@ -1,7 +0,0 @@
-// The -*- C++ -*- wide character header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __CWCHAR__
-#define __CWCHAR__
-#include <wchar.h>
-#endif
diff --git a/contrib/libstdc++/cwctype b/contrib/libstdc++/cwctype
deleted file mode 100644
index 81122012bd04..000000000000
--- a/contrib/libstdc++/cwctype
+++ /dev/null
@@ -1,7 +0,0 @@
-// The -*- C++ -*- wide character type header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __CWCTYPE__
-#define __CWCTYPE__
-#include <wctype.h>
-#endif
diff --git a/contrib/libstdc++/fstream b/contrib/libstdc++/fstream
deleted file mode 100644
index 2c35ca92b039..000000000000
--- a/contrib/libstdc++/fstream
+++ /dev/null
@@ -1,7 +0,0 @@
-// -*- C++ -*- forwarding header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __FSTREAM__
-#define __FSTREAM__
-#include <fstream.h>
-#endif
diff --git a/contrib/libstdc++/iomanip b/contrib/libstdc++/iomanip
deleted file mode 100644
index 817948579ce7..000000000000
--- a/contrib/libstdc++/iomanip
+++ /dev/null
@@ -1,7 +0,0 @@
-// -*- C++ -*- forwarding header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __IOMANIP__
-#define __IOMANIP__
-#include <iomanip.h>
-#endif
diff --git a/contrib/libstdc++/iosfwd b/contrib/libstdc++/iosfwd
deleted file mode 100644
index 8314cf7b73f6..000000000000
--- a/contrib/libstdc++/iosfwd
+++ /dev/null
@@ -1,15 +0,0 @@
-// -*- C++ -*- I/O forward declaration header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __IOSFWD__
-#define __IOSFWD__
-class ios;
-class streambuf;
-class istream;
-class ostream;
-class iostream;
-class filebuf;
-class ifstream;
-class ofstream;
-class fstream;
-#endif
diff --git a/contrib/libstdc++/iostream b/contrib/libstdc++/iostream
deleted file mode 100644
index 7ecba6e8dafc..000000000000
--- a/contrib/libstdc++/iostream
+++ /dev/null
@@ -1,7 +0,0 @@
-// -*- C++ -*- forwarding header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __IOSTREAM__
-#define __IOSTREAM__
-#include <iostream.h>
-#endif
diff --git a/contrib/libstdc++/sinst.cc b/contrib/libstdc++/sinst.cc
deleted file mode 100644
index 0b3617ece620..000000000000
--- a/contrib/libstdc++/sinst.cc
+++ /dev/null
@@ -1,135 +0,0 @@
-// Instantiation file for the -*- C++ -*- string classes.
-// Copyright (C) 1994 Free Software Foundation
-
-// This file is part of the GNU ANSI C++ 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.
-
-// Written by Jason Merrill based upon the specification by Takanori Adachi
-// in ANSI X3J16/94-0013R2.
-
-#ifdef __GNUG__
-#ifdef TRAITS
-#ifdef C
-#pragma implementation "std/straits.h"
-#endif
-#endif
-#endif
-
-#include <string>
-
-#ifdef C
-typedef char c;
-#endif
-#ifdef W
-typedef wchar_t c;
-#endif
-
-#if defined(TRAITS) && !defined(C)
-template class string_char_traits <c>;
-#else
-/* string_char_traits<char> is already explicitly specialized in
- std/straits.h. */
-#endif
-
-typedef basic_string <c> s;
-
-#ifdef MAIN
-template class basic_string <c>;
-#endif
-
-#ifdef ADDSS
-template s operator+ (const s&, const s&);
-#endif
-#ifdef ADDPS
-template s operator+ (const c*, const s&);
-#endif
-#ifdef ADDCS
-template s operator+ (c, const s&);
-#endif
-#ifdef ADDSP
-template s operator+ (const s&, const c*);
-#endif
-#ifdef ADDSC
-template s operator+ (const s&, c);
-#endif
-#ifdef EQSS
-template bool operator== (const s&, const s&);
-#endif
-#ifdef EQPS
-template bool operator== (const c*, const s&);
-#endif
-#ifdef EQSP
-template bool operator== (const s&, const c*);
-#endif
-#ifdef NESS
-template bool operator!= (const s&, const s&);
-#endif
-#ifdef NEPS
-template bool operator!= (const c*, const s&);
-#endif
-#ifdef NESP
-template bool operator!= (const s&, const c*);
-#endif
-#ifdef LTSS
-template bool operator< (const s&, const s&);
-#endif
-#ifdef LTPS
-template bool operator< (const c*, const s&);
-#endif
-#ifdef LTSP
-template bool operator< (const s&, const c*);
-#endif
-#ifdef GTSS
-template bool operator> (const s&, const s&);
-#endif
-#ifdef GTPS
-template bool operator> (const c*, const s&);
-#endif
-#ifdef GTSP
-template bool operator> (const s&, const c*);
-#endif
-#ifdef LESS
-template bool operator<= (const s&, const s&);
-#endif
-#ifdef LEPS
-template bool operator<= (const c*, const s&);
-#endif
-#ifdef LESP
-template bool operator<= (const s&, const c*);
-#endif
-#ifdef GESS
-template bool operator>= (const s&, const s&);
-#endif
-#ifdef GEPS
-template bool operator>= (const c*, const s&);
-#endif
-#ifdef GESP
-template bool operator>= (const s&, const c*);
-#endif
-#ifdef EXTRACT
-template istream& operator>> (istream&, s&);
-#endif // EXTRACT
-#ifdef INSERT
-template ostream& operator<< (ostream&, const s&);
-#endif // INSERT
-#ifdef GETLINE
-template istream& getline (istream&, s&, c);
-#endif
diff --git a/contrib/libstdc++/sstream b/contrib/libstdc++/sstream
deleted file mode 100644
index 45393b14761e..000000000000
--- a/contrib/libstdc++/sstream
+++ /dev/null
@@ -1,343 +0,0 @@
-/* This is part of libio/iostream, providing -*- C++ -*- input/output.
-Copyright (C) 2000 Free Software Foundation
-
-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. */
-
-/* Written by Magnus Fromreide (magfr@lysator.liu.se). */
-/* seekoff and ideas for overflow is largely borrowed from libstdc++-v3 */
-
-#ifndef __SSTREAM__
-#define __SSTREAM__
-
-#include <iostream.h>
-#include <streambuf.h>
-#include <string>
-
-namespace std
-{
- class stringbuf : public streambuf
- {
- public:
- typedef char char_type;
- typedef int int_type;
- typedef streampos pos_type;
- typedef streamoff off_type;
-
- explicit
- stringbuf(int which=ios::in|ios::out)
- : streambuf(), mode(static_cast<ios::open_mode>(which)),
- stream(NULL), stream_len(0)
- {
- stringbuf_init();
- }
-
- explicit
- stringbuf(const string &str, int which=ios::in|ios::out)
- : streambuf(), mode(static_cast<ios::open_mode>(which)),
- stream(NULL), stream_len(0)
- {
- if (mode & (ios::in|ios::out))
- {
- stream_len = str.size();
- stream = new char_type[stream_len];
- str.copy(stream, stream_len);
- }
- stringbuf_init();
- }
-
- virtual
- ~stringbuf()
- {
- delete[] stream;
- }
-
- string
- str() const
- {
- if (pbase() != 0)
- return string(stream, pptr()-pbase());
- else
- return string();
- }
-
- void
- str(const string& str)
- {
- delete[] stream;
- stream_len = str.size();
- stream = new char_type[stream_len];
- str.copy(stream, stream_len);
- stringbuf_init();
- }
-
- protected:
- // The buffer is already in gptr, so if it ends then it is out of data.
- virtual int
- underflow()
- {
- return EOF;
- }
-
- virtual int
- overflow(int c = EOF)
- {
- int res;
- if (mode & ios::out)
- {
- if (c != EOF)
- {
- streamsize old_stream_len = stream_len;
- stream_len += 1;
- char_type* new_stream = new char_type[stream_len];
- memcpy(new_stream, stream, old_stream_len);
- delete[] stream;
- stream = new_stream;
- stringbuf_sync(gptr()-eback(), pptr()-pbase());
- sputc(c);
- res = c;
- }
- else
- res = EOF;
- }
- else
- res = 0;
- return res;
- }
-
- virtual streambuf*
- setbuf(char_type* s, streamsize n)
- {
- if (n != 0)
- {
- delete[] stream;
- stream = new char_type[n];
- memcpy(stream, s, n);
- stream_len = n;
- stringbuf_sync(0, 0);
- }
- return this;
- }
-
- virtual pos_type
- seekoff(off_type off, ios::seek_dir way, int which = ios::in | ios::out)
- {
- pos_type ret = pos_type(off_type(-1));
- bool testin = which & ios::in && mode & ios::in;
- bool testout = which & ios::out && mode & ios::out;
- bool testboth = testin && testout && way != ios::cur;
-
- if (stream_len && ((testin != testout) || testboth))
- {
- char_type* beg = stream;
- char_type* curi = NULL;
- char_type* curo = NULL;
- char_type* endi = NULL;
- char_type* endo = NULL;
-
- if (testin)
- {
- curi = gptr();
- endi = egptr();
- }
- if (testout)
- {
- curo = pptr();
- endo = epptr();
- }
-
- off_type newoffi = 0;
- off_type newoffo = 0;
- if (way == ios::beg)
- {
- newoffi = beg - curi;
- newoffo = beg - curo;
- }
- else if (way == ios::end)
- {
- newoffi = endi - curi;
- newoffo = endo - curo;
- }
-
- if (testin && newoffi + off + curi - beg >= 0 &&
- endi - beg >= newoffi + off + curi - beg)
- {
- gbump(newoffi + off);
- ret = pos_type(newoffi + off + curi);
- }
- if (testout && newoffo + off + curo - beg >= 0 &&
- endo - beg >= newoffo + off + curo - beg)
- {
- pbump(newoffo + off);
- ret = pos_type(newoffo + off + curo);
- }
- }
- return ret;
- }
-
- virtual pos_type
- seekpos(pos_type sp, int which = ios::in | ios::out)
- {
- pos_type ret = seekoff(sp, ios::beg, which);
- return ret;
- }
-
- private:
- void
- stringbuf_sync(streamsize i, streamsize o)
- {
- if (mode & ios::in)
- setg(stream, stream + i, stream + stream_len);
- if (mode & ios::out)
- {
- setp(stream, stream + stream_len);
- pbump(o);
- }
- }
- void
- stringbuf_init()
- {
- if (mode & ios::ate)
- stringbuf_sync(0, stream_len);
- else
- stringbuf_sync(0, 0);
- }
-
- private:
- ios::open_mode mode;
- char_type* stream;
- streamsize stream_len;
- };
-
- class istringstream : public istream {
- public:
- typedef char char_type;
- typedef int int_type;
- typedef streampos pos_type;
- typedef streamoff off_type;
-
- explicit
- istringstream(int which=ios::in)
- : istream(&sb), sb(which | ios::in)
- { }
-
- explicit
- istringstream(const string& str, int which=ios::in)
- : istream(&sb), sb(str, which | ios::in)
- { }
-
- stringbuf*
- rdbuf() const
- {
- return const_cast<stringbuf*>(&sb);
- }
-
- string
- str() const
- {
- return rdbuf()->str();
- }
- void
- str(const string& s)
- {
- rdbuf()->str(s);
- }
- private:
- stringbuf sb;
- };
-
- class ostringstream : public ostream {
- public:
- typedef char char_type;
- typedef int int_type;
- typedef streampos pos_type;
- typedef streamoff off_type;
-
- explicit
- ostringstream(int which=ios::out)
- : ostream(&sb), sb(which | ios::out)
- { }
-
- explicit
- ostringstream(const string& str, int which=ios::out)
- : ostream(&sb), sb(str, which | ios::out)
- { }
-
- stringbuf*
- rdbuf() const
- {
- return const_cast<stringbuf*>(&sb);
- }
-
- string
- str() const
- {
- return rdbuf()->str();
- }
-
- void str(const string& s)
- {
- rdbuf()->str(s);
- }
- private:
- stringbuf sb;
- };
-
- class stringstream : public iostream {
- public:
- typedef char char_type;
- typedef int int_type;
- typedef streampos pos_type;
- typedef streamoff off_type;
-
- explicit
- stringstream(int which=ios::out|ios::in)
- : iostream(&sb), sb(which)
- { }
-
- explicit
- stringstream(const string& str, int which=ios::out|ios::in)
- : iostream(&sb), sb(str, which)
- { }
-
- stringbuf*
- rdbuf() const
- {
- return const_cast<stringbuf*>(&sb);
- }
-
- string
- str() const
- {
- return rdbuf()->str();
- }
-
- void
- str(const string& s)
- {
- rdbuf()->str(s);
- }
- private:
- stringbuf sb;
- };
-};
-
-#endif /* not __STRSTREAM__ */
diff --git a/contrib/libstdc++/std/bastring.cc b/contrib/libstdc++/std/bastring.cc
deleted file mode 100644
index f86f6d30157c..000000000000
--- a/contrib/libstdc++/std/bastring.cc
+++ /dev/null
@@ -1,524 +0,0 @@
-// Member templates for the -*- C++ -*- string classes.
-// Copyright (C) 1994, 1999 Free Software Foundation
-
-// This file is part of the GNU ANSI C++ 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.
-
-// Written by Jason Merrill based upon the specification by Takanori Adachi
-// in ANSI X3J16/94-0013R2.
-
-extern "C++" {
-template <class charT, class traits, class Allocator>
-inline void * basic_string <charT, traits, Allocator>::Rep::
-operator new (size_t s, size_t extra)
-{
- return Allocator::allocate(s + extra * sizeof (charT));
-}
-
-template <class charT, class traits, class Allocator>
-inline void basic_string <charT, traits, Allocator>::Rep::
-operator delete (void * ptr)
-{
- Allocator::deallocate(ptr, sizeof(Rep) +
- reinterpret_cast<Rep *>(ptr)->res *
- sizeof (charT));
-}
-
-template <class charT, class traits, class Allocator>
-inline size_t basic_string <charT, traits, Allocator>::Rep::
-frob_size (size_t s)
-{
- size_t i = 16;
- while (i < s) i *= 2;
- return i;
-}
-
-template <class charT, class traits, class Allocator>
-inline basic_string <charT, traits, Allocator>::Rep *
-basic_string <charT, traits, Allocator>::Rep::
-create (size_t extra)
-{
- extra = frob_size (extra + 1);
- Rep *p = new (extra) Rep;
- p->res = extra;
- p->ref = 1;
- p->selfish = false;
- return p;
-}
-
-template <class charT, class traits, class Allocator>
-charT * basic_string <charT, traits, Allocator>::Rep::
-clone ()
-{
- Rep *p = Rep::create (len);
- p->copy (0, data (), len);
- p->len = len;
- return p->data ();
-}
-
-template <class charT, class traits, class Allocator>
-inline bool basic_string <charT, traits, Allocator>::Rep::
-excess_slop (size_t s, size_t r)
-{
- return 2 * (s <= 16 ? 16 : s) < r;
-}
-
-template <class charT, class traits, class Allocator>
-inline bool basic_string <charT, traits, Allocator>::
-check_realloc (basic_string::size_type s) const
-{
- s += sizeof (charT);
- rep ()->selfish = false;
- return (rep ()->ref > 1
- || s > capacity ()
- || Rep::excess_slop (s, capacity ()));
-}
-
-template <class charT, class traits, class Allocator>
-void basic_string <charT, traits, Allocator>::
-alloc (basic_string::size_type __size, bool __save)
-{
- if (! check_realloc (__size))
- return;
-
- Rep *p = Rep::create (__size);
-
- if (__save)
- {
- p->copy (0, data (), length ());
- p->len = length ();
- }
- else
- p->len = 0;
-
- repup (p);
-}
-
-template <class charT, class traits, class Allocator>
-basic_string <charT, traits, Allocator>&
-basic_string <charT, traits, Allocator>::
-replace (size_type pos1, size_type n1,
- const basic_string& str, size_type pos2, size_type n2)
-{
- const size_t len2 = str.length ();
-
- if (pos1 == 0 && n1 >= length () && pos2 == 0 && n2 >= len2)
- return operator= (str);
-
- OUTOFRANGE (pos2 > len2);
-
- if (n2 > len2 - pos2)
- n2 = len2 - pos2;
-
- return replace (pos1, n1, str.data () + pos2, n2);
-}
-
-template <class charT, class traits, class Allocator>
-inline void basic_string <charT, traits, Allocator>::Rep::
-copy (size_t pos, const charT *s, size_t n)
-{
- if (n)
- traits::copy (data () + pos, s, n);
-}
-
-template <class charT, class traits, class Allocator>
-inline void basic_string <charT, traits, Allocator>::Rep::
-move (size_t pos, const charT *s, size_t n)
-{
- if (n)
- traits::move (data () + pos, s, n);
-}
-
-template <class charT, class traits, class Allocator>
-basic_string <charT, traits, Allocator>&
-basic_string <charT, traits, Allocator>::
-replace (size_type pos, size_type n1, const charT* s, size_type n2)
-{
- const size_type len = length ();
- OUTOFRANGE (pos > len);
- if (n1 > len - pos)
- n1 = len - pos;
- LENGTHERROR (len - n1 > max_size () - n2);
- size_t newlen = len - n1 + n2;
-
- if (check_realloc (newlen))
- {
- Rep *p = Rep::create (newlen);
- p->copy (0, data (), pos);
- p->copy (pos + n2, data () + pos + n1, len - (pos + n1));
- p->copy (pos, s, n2);
- repup (p);
- }
- else
- {
- rep ()->move (pos + n2, data () + pos + n1, len - (pos + n1));
- rep ()->copy (pos, s, n2);
- }
- rep ()->len = newlen;
-
- return *this;
-}
-
-template <class charT, class traits, class Allocator>
-inline void basic_string <charT, traits, Allocator>::Rep::
-set (size_t pos, const charT c, size_t n)
-{
- traits::set (data () + pos, c, n);
-}
-
-template <class charT, class traits, class Allocator>
-basic_string <charT, traits, Allocator>& basic_string <charT, traits, Allocator>::
-replace (size_type pos, size_type n1, size_type n2, charT c)
-{
- const size_t len = length ();
- OUTOFRANGE (pos > len);
- if (n1 > len - pos)
- n1 = len - pos;
- LENGTHERROR (len - n1 > max_size () - n2);
- size_t newlen = len - n1 + n2;
-
- if (check_realloc (newlen))
- {
- Rep *p = Rep::create (newlen);
- p->copy (0, data (), pos);
- p->copy (pos + n2, data () + pos + n1, len - (pos + n1));
- p->set (pos, c, n2);
- repup (p);
- }
- else
- {
- rep ()->move (pos + n2, data () + pos + n1, len - (pos + n1));
- rep ()->set (pos, c, n2);
- }
- rep ()->len = newlen;
-
- return *this;
-}
-
-template <class charT, class traits, class Allocator>
-void basic_string <charT, traits, Allocator>::
-resize (size_type n, charT c)
-{
- LENGTHERROR (n > max_size ());
-
- if (n > length ())
- append (n - length (), c);
- else
- erase (n);
-}
-
-template <class charT, class traits, class Allocator>
-basic_string <charT, traits, Allocator>::size_type
-basic_string <charT, traits, Allocator>::
-copy (charT* s, size_type n, size_type pos) const
-{
- OUTOFRANGE (pos > length ());
-
- if (n > length () - pos)
- n = length () - pos;
-
- traits::copy (s, data () + pos, n);
- return n;
-}
-
-template <class charT, class traits, class Allocator>
-basic_string <charT, traits, Allocator>::size_type
-basic_string <charT, traits, Allocator>::
-find (const charT* s, size_type pos, size_type n) const
-{
- size_t xpos = pos;
- for (; xpos + n <= length (); ++xpos)
- if (traits::eq (data () [xpos], *s)
- && traits::compare (data () + xpos, s, n) == 0)
- return xpos;
- return npos;
-}
-
-template <class charT, class traits, class Allocator>
-inline basic_string <charT, traits, Allocator>::size_type
-basic_string <charT, traits, Allocator>::
-_find (const charT* ptr, charT c, size_type xpos, size_type len)
-{
- for (; xpos < len; ++xpos)
- if (traits::eq (ptr [xpos], c))
- return xpos;
- return npos;
-}
-
-template <class charT, class traits, class Allocator>
-basic_string <charT, traits, Allocator>::size_type
-basic_string <charT, traits, Allocator>::
-find (charT c, size_type pos) const
-{
- return _find (data (), c, pos, length ());
-}
-
-template <class charT, class traits, class Allocator>
-basic_string <charT, traits, Allocator>::size_type
-basic_string <charT, traits, Allocator>::
-rfind (const charT* s, size_type pos, size_type n) const
-{
- if (n > length ())
- return npos;
-
- size_t xpos = length () - n;
- if (xpos > pos)
- xpos = pos;
-
- for (++xpos; xpos-- > 0; )
- if (traits::eq (data () [xpos], *s)
- && traits::compare (data () + xpos, s, n) == 0)
- return xpos;
- return npos;
-}
-
-template <class charT, class traits, class Allocator>
-basic_string <charT, traits, Allocator>::size_type
-basic_string <charT, traits, Allocator>::
-rfind (charT c, size_type pos) const
-{
- if (1 > length ())
- return npos;
-
- size_t xpos = length () - 1;
- if (xpos > pos)
- xpos = pos;
-
- for (++xpos; xpos-- > 0; )
- if (traits::eq (data () [xpos], c))
- return xpos;
- return npos;
-}
-
-template <class charT, class traits, class Allocator>
-basic_string <charT, traits, Allocator>::size_type
-basic_string <charT, traits, Allocator>::
-find_first_of (const charT* s, size_type pos, size_type n) const
-{
- size_t xpos = pos;
- for (; xpos < length (); ++xpos)
- if (_find (s, data () [xpos], 0, n) != npos)
- return xpos;
- return npos;
-}
-
-template <class charT, class traits, class Allocator>
-basic_string <charT, traits, Allocator>::size_type
-basic_string <charT, traits, Allocator>::
-find_last_of (const charT* s, size_type pos, size_type n) const
-{
- if (length() == 0)
- return npos;
- size_t xpos = length () - 1;
- if (xpos > pos)
- xpos = pos;
- for (++xpos; xpos-- > 0;)
- if (_find (s, data () [xpos], 0, n) != npos)
- return xpos;
- return npos;
-}
-
-template <class charT, class traits, class Allocator>
-basic_string <charT, traits, Allocator>::size_type
-basic_string <charT, traits, Allocator>::
-find_first_not_of (const charT* s, size_type pos, size_type n) const
-{
- size_t xpos = pos;
- for (; xpos < length (); ++xpos)
- if (_find (s, data () [xpos], 0, n) == npos)
- return xpos;
- return npos;
-}
-
-template <class charT, class traits, class Allocator>
-basic_string <charT, traits, Allocator>::size_type
-basic_string <charT, traits, Allocator>::
-find_first_not_of (charT c, size_type pos) const
-{
- size_t xpos = pos;
- for (; xpos < length (); ++xpos)
- if (traits::ne (data () [xpos], c))
- return xpos;
- return npos;
-}
-
-template <class charT, class traits, class Allocator>
-basic_string <charT, traits, Allocator>::size_type
-basic_string <charT, traits, Allocator>::
-find_last_not_of (const charT* s, size_type pos, size_type n) const
-{
- if (length() == 0)
- return npos;
- size_t xpos = length () - 1;
- if (xpos > pos)
- xpos = pos;
- for (++xpos; xpos-- > 0;)
- if (_find (s, data () [xpos], 0, n) == npos)
- return xpos;
- return npos;
-}
-
-template <class charT, class traits, class Allocator>
-basic_string <charT, traits, Allocator>::size_type
-basic_string <charT, traits, Allocator>::
-find_last_not_of (charT c, size_type pos) const
-{
- if (length() == 0)
- return npos;
- size_t xpos = length () - 1;
- if (xpos > pos)
- xpos = pos;
- for (++xpos; xpos-- > 0;)
- if (traits::ne (data () [xpos], c))
- return xpos;
- return npos;
-}
-
-template <class charT, class traits, class Allocator>
-int basic_string <charT, traits, Allocator>::
-compare (const basic_string& str, size_type pos, size_type n) const
-{
- OUTOFRANGE (pos > length ());
-
- size_t rlen = length () - pos;
- if (rlen > n)
- rlen = n;
- if (rlen > str.length ())
- rlen = str.length ();
- int r = traits::compare (data () + pos, str.data (), rlen);
- if (r != 0)
- return r;
- if (rlen == n)
- return 0;
- return (length () - pos) - str.length ();
-}
-
-template <class charT, class traits, class Allocator>
-int basic_string <charT, traits, Allocator>::
-compare (const charT* s, size_type pos, size_type n) const
-{
- OUTOFRANGE (pos > length ());
-
- size_t rlen = length () - pos;
- if (rlen > n)
- rlen = n;
- int r = traits::compare (data () + pos, s, rlen);
- if (r != 0)
- return r;
- return (length () - pos) - n;
-}
-
-#include <iostream.h>
-
-template <class charT, class traits, class Allocator>
-istream &
-operator>> (istream &is, basic_string <charT, traits, Allocator> &s)
-{
- int w = is.width (0);
- if (is.ipfx0 ())
- {
- register streambuf *sb = is.rdbuf ();
- s.resize (0);
- while (1)
- {
- int ch = sb->sbumpc ();
- if (ch == EOF)
- {
- is.setstate (ios::eofbit);
- break;
- }
- else if (traits::is_del (ch))
- {
- sb->sungetc ();
- break;
- }
- s += static_cast<charT> (ch);
- if (--w == 1)
- break;
- }
- }
-
- is.isfx ();
- if (s.length () == 0)
- is.setstate (ios::failbit);
-
- return is;
-}
-
-template <class charT, class traits, class Allocator>
-ostream &
-operator<< (ostream &o, const basic_string <charT, traits, Allocator>& s)
-{
- return o.write (s.data (), s.length ());
-}
-
-template <class charT, class traits, class Allocator>
-istream&
-getline (istream &is, basic_string <charT, traits, Allocator>& s, charT delim)
-{
- if (is.ipfx1 ())
- {
- _IO_size_t count = 0;
- streambuf *sb = is.rdbuf ();
- s.resize (0);
-
- while (1)
- {
- int ch = sb->sbumpc ();
- if (ch == EOF)
- {
- is.setstate (count == 0
- ? (ios::failbit|ios::eofbit)
- : ios::eofbit);
- break;
- }
-
- ++count;
-
- if (ch == delim)
- break;
-
- s += static_cast<charT> (ch);
-
- if (s.length () == s.npos - 1)
- {
- is.setstate (ios::failbit);
- break;
- }
- }
- }
-
- // We need to be friends with istream to do this.
- // is._gcount = count;
- is.isfx ();
-
- return is;
-}
-
-template <class charT, class traits, class Allocator>
-basic_string <charT, traits, Allocator>::Rep
-basic_string<charT, traits, Allocator>::nilRep = { 0, 0, 1, false };
-
-template <class charT, class traits, class Allocator>
-const basic_string <charT, traits, Allocator>::size_type
-basic_string <charT, traits, Allocator>::npos;
-
-} // extern "C++"
diff --git a/contrib/libstdc++/std/bastring.h b/contrib/libstdc++/std/bastring.h
deleted file mode 100644
index bbe873085eaa..000000000000
--- a/contrib/libstdc++/std/bastring.h
+++ /dev/null
@@ -1,657 +0,0 @@
-// Main templates for the -*- C++ -*- string classes.
-// Copyright (C) 1994, 1995, 1999 Free Software Foundation
-
-// This file is part of the GNU ANSI C++ 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.
-
-// Written by Jason Merrill based upon the specification by Takanori Adachi
-// in ANSI X3J16/94-0013R2.
-
-#ifndef __BASTRING__
-#define __BASTRING__
-
-#ifdef __GNUG__
-#pragma interface
-#endif
-
-#include <cstddef>
-#include <std/straits.h>
-
-// NOTE : This does NOT conform to the draft standard and is likely to change
-#include <alloc.h>
-
-extern "C++" {
-class istream; class ostream;
-
-#include <iterator>
-
-#ifdef __STL_USE_EXCEPTIONS
-
-extern void __out_of_range (const char *);
-extern void __length_error (const char *);
-
-#define OUTOFRANGE(cond) \
- do { if (cond) __out_of_range (#cond); } while (0)
-#define LENGTHERROR(cond) \
- do { if (cond) __length_error (#cond); } while (0)
-
-#else
-
-#include <cassert>
-#define OUTOFRANGE(cond) assert (!(cond))
-#define LENGTHERROR(cond) assert (!(cond))
-
-#endif
-
-template <class charT, class traits = string_char_traits<charT>,
- class Allocator = alloc >
-class basic_string
-{
-private:
- struct Rep {
- size_t len, res, ref;
- bool selfish;
-
- charT* data () { return reinterpret_cast<charT *>(this + 1); }
- charT& operator[] (size_t s) { return data () [s]; }
- charT* grab () { if (selfish) return clone (); ++ref; return data (); }
-#if defined __i486__ || defined __i586__ || defined __i686__
- void release ()
- {
- size_t __val;
- // This opcode exists as a .byte instead of as a mnemonic for the
- // benefit of SCO OpenServer 5. The system assembler (which is
- // essentially required on this target) can't assemble xaddl in
- //COFF mode.
- asm (".byte 0xf0, 0x0f, 0xc1, 0x02" // lock; xaddl %eax, (%edx)
- : "=a" (__val)
- : "0" (-1), "m" (ref), "d" (&ref)
- : "memory");
-
- if (__val == 1)
- delete this;
- }
-#elif defined __sparcv9__
- void release ()
- {
- size_t __newval, __oldval = ref;
- do
- {
- __newval = __oldval - 1;
- __asm__ ("cas [%4], %2, %0"
- : "=r" (__oldval), "=m" (ref)
- : "r" (__oldval), "m" (ref), "r"(&(ref)), "0" (__newval));
- }
- while (__newval != __oldval);
-
- if (__oldval == 0)
- delete this;
- }
-#else
- void release () { if (--ref == 0) delete this; }
-#endif
-
- inline static void * operator new (size_t, size_t);
- inline static void operator delete (void *);
- inline static Rep* create (size_t);
- charT* clone ();
-
- inline void copy (size_t, const charT *, size_t);
- inline void move (size_t, const charT *, size_t);
- inline void set (size_t, const charT, size_t);
-
- inline static bool excess_slop (size_t, size_t);
- inline static size_t frob_size (size_t);
-
- private:
- Rep &operator= (const Rep &);
- };
-
-public:
-// types:
- typedef traits traits_type;
- typedef typename traits::char_type value_type;
- typedef Allocator allocator_type;
-
- typedef size_t size_type;
- typedef ptrdiff_t difference_type;
- typedef charT& reference;
- typedef const charT& const_reference;
- typedef charT* pointer;
- typedef const charT* const_pointer;
- typedef pointer iterator;
- typedef const_pointer const_iterator;
- typedef ::reverse_iterator<iterator> reverse_iterator;
- typedef ::reverse_iterator<const_iterator> const_reverse_iterator;
- static const size_type npos = static_cast<size_type>(-1);
-
-private:
- Rep *rep () const { return reinterpret_cast<Rep *>(dat) - 1; }
- void repup (Rep *p) { rep ()->release (); dat = p->data (); }
-
-public:
- const charT* data () const
- { return rep ()->data(); }
- size_type length () const
- { return rep ()->len; }
- size_type size () const
- { return rep ()->len; }
- size_type capacity () const
- { return rep ()->res; }
- size_type max_size () const
- { return (npos - 1)/sizeof (charT); } // XXX
- bool empty () const
- { return size () == 0; }
-
-// _lib.string.cons_ construct/copy/destroy:
- basic_string& operator= (const basic_string& str)
- {
- if (&str != this) { rep ()->release (); dat = str.rep ()->grab (); }
- return *this;
- }
-
- explicit basic_string (): dat (nilRep.grab ()) { }
- basic_string (const basic_string& str): dat (str.rep ()->grab ()) { }
- basic_string (const basic_string& str, size_type pos, size_type n = npos)
- : dat (nilRep.grab ()) { assign (str, pos, n); }
- basic_string (const charT* s, size_type n)
- : dat (nilRep.grab ()) { assign (s, n); }
- basic_string (const charT* s)
- : dat (nilRep.grab ()) { assign (s); }
- basic_string (size_type n, charT c)
- : dat (nilRep.grab ()) { assign (n, c); }
-#ifdef __STL_MEMBER_TEMPLATES
- template<class InputIterator>
- basic_string(InputIterator __begin, InputIterator __end)
-#else
- basic_string(const_iterator __begin, const_iterator __end)
-#endif
- : dat (nilRep.grab ()) { assign (__begin, __end); }
-
- ~basic_string ()
- { rep ()->release (); }
-
- void swap (basic_string &s) { charT *d = dat; dat = s.dat; s.dat = d; }
-
- basic_string& append (const basic_string& str, size_type pos = 0,
- size_type n = npos)
- { return replace (length (), 0, str, pos, n); }
- basic_string& append (const charT* s, size_type n)
- { return replace (length (), 0, s, n); }
- basic_string& append (const charT* s)
- { return append (s, traits::length (s)); }
- basic_string& append (size_type n, charT c)
- { return replace (length (), 0, n, c); }
-#ifdef __STL_MEMBER_TEMPLATES
- template<class InputIterator>
- basic_string& append(InputIterator first, InputIterator last)
-#else
- basic_string& append(const_iterator first, const_iterator last)
-#endif
- { return replace (iend (), iend (), first, last); }
-
- void push_back(charT __c)
- { append(1, __c); }
-
- basic_string& assign (const basic_string& str, size_type pos = 0,
- size_type n = npos)
- { return replace (0, npos, str, pos, n); }
- basic_string& assign (const charT* s, size_type n)
- { return replace (0, npos, s, n); }
- basic_string& assign (const charT* s)
- { return assign (s, traits::length (s)); }
- basic_string& assign (size_type n, charT c)
- { return replace (0, npos, n, c); }
-#ifdef __STL_MEMBER_TEMPLATES
- template<class InputIterator>
- basic_string& assign(InputIterator first, InputIterator last)
-#else
- basic_string& assign(const_iterator first, const_iterator last)
-#endif
- { return replace (ibegin (), iend (), first, last); }
-
- basic_string& operator= (const charT* s)
- { return assign (s); }
- basic_string& operator= (charT c)
- { return assign (1, c); }
-
- basic_string& operator+= (const basic_string& rhs)
- { return append (rhs); }
- basic_string& operator+= (const charT* s)
- { return append (s); }
- basic_string& operator+= (charT c)
- { return append (1, c); }
-
- basic_string& insert (size_type pos1, const basic_string& str,
- size_type pos2 = 0, size_type n = npos)
- { return replace (pos1, 0, str, pos2, n); }
- basic_string& insert (size_type pos, const charT* s, size_type n)
- { return replace (pos, 0, s, n); }
- basic_string& insert (size_type pos, const charT* s)
- { return insert (pos, s, traits::length (s)); }
- basic_string& insert (size_type pos, size_type n, charT c)
- { return replace (pos, 0, n, c); }
- iterator insert(iterator p, charT c)
- { size_type __o = p - ibegin ();
- insert (p - ibegin (), 1, c); selfish ();
- return ibegin () + __o; }
- iterator insert(iterator p, size_type n, charT c)
- { size_type __o = p - ibegin ();
- insert (p - ibegin (), n, c); selfish ();
- return ibegin () + __o; }
-#ifdef __STL_MEMBER_TEMPLATES
- template<class InputIterator>
- void insert(iterator p, InputIterator first, InputIterator last)
-#else
- void insert(iterator p, const_iterator first, const_iterator last)
-#endif
- { replace (p, p, first, last); }
-
- basic_string& erase (size_type pos = 0, size_type n = npos)
- { return replace (pos, n, (size_type)0, (charT)0); }
- iterator erase(iterator p)
- { size_type __o = p - begin();
- replace (__o, 1, (size_type)0, (charT)0); selfish ();
- return ibegin() + __o; }
- iterator erase(iterator f, iterator l)
- { size_type __o = f - ibegin();
- replace (__o, l-f, (size_type)0, (charT)0);selfish ();
- return ibegin() + __o; }
-
- basic_string& replace (size_type pos1, size_type n1, const basic_string& str,
- size_type pos2 = 0, size_type n2 = npos);
- basic_string& replace (size_type pos, size_type n1, const charT* s,
- size_type n2);
- basic_string& replace (size_type pos, size_type n1, const charT* s)
- { return replace (pos, n1, s, traits::length (s)); }
- basic_string& replace (size_type pos, size_type n1, size_type n2, charT c);
- basic_string& replace (size_type pos, size_type n, charT c)
- { return replace (pos, n, 1, c); }
- basic_string& replace (iterator i1, iterator i2, const basic_string& str)
- { return replace (i1 - ibegin (), i2 - i1, str); }
- basic_string& replace (iterator i1, iterator i2, const charT* s, size_type n)
- { return replace (i1 - ibegin (), i2 - i1, s, n); }
- basic_string& replace (iterator i1, iterator i2, const charT* s)
- { return replace (i1 - ibegin (), i2 - i1, s); }
- basic_string& replace (iterator i1, iterator i2, size_type n, charT c)
- { return replace (i1 - ibegin (), i2 - i1, n, c); }
-#ifdef __STL_MEMBER_TEMPLATES
- template<class InputIterator>
- basic_string& replace(iterator i1, iterator i2,
- InputIterator j1, InputIterator j2);
-#else
- basic_string& replace(iterator i1, iterator i2,
- const_iterator j1, const_iterator j2);
-#endif
-
-private:
- static charT eos () { return traits::eos (); }
- void unique () { if (rep ()->ref > 1) alloc (length (), true); }
- void selfish () { unique (); rep ()->selfish = true; }
-
-public:
- charT operator[] (size_type pos) const
- {
- if (pos == length ())
- return eos ();
- return data ()[pos];
- }
-
- reference operator[] (size_type pos)
- { selfish (); return (*rep ())[pos]; }
-
- reference at (size_type pos)
- {
- OUTOFRANGE (pos >= length ());
- return (*this)[pos];
- }
- const_reference at (size_type pos) const
- {
- OUTOFRANGE (pos >= length ());
- return data ()[pos];
- }
-
-private:
- void terminate () const
- { traits::assign ((*rep ())[length ()], eos ()); }
-
-public:
- const charT* c_str () const
- { if (length () == 0) return ""; terminate (); return data (); }
- void resize (size_type n, charT c);
- void resize (size_type n)
- { resize (n, eos ()); }
- void reserve (size_type) { }
-
- size_type copy (charT* s, size_type n, size_type pos = 0) const;
-
- size_type find (const basic_string& str, size_type pos = 0) const
- { return find (str.data(), pos, str.length()); }
- size_type find (const charT* s, size_type pos, size_type n) const;
- size_type find (const charT* s, size_type pos = 0) const
- { return find (s, pos, traits::length (s)); }
- size_type find (charT c, size_type pos = 0) const;
-
- size_type rfind (const basic_string& str, size_type pos = npos) const
- { return rfind (str.data(), pos, str.length()); }
- size_type rfind (const charT* s, size_type pos, size_type n) const;
- size_type rfind (const charT* s, size_type pos = npos) const
- { return rfind (s, pos, traits::length (s)); }
- size_type rfind (charT c, size_type pos = npos) const;
-
- size_type find_first_of (const basic_string& str, size_type pos = 0) const
- { return find_first_of (str.data(), pos, str.length()); }
- size_type find_first_of (const charT* s, size_type pos, size_type n) const;
- size_type find_first_of (const charT* s, size_type pos = 0) const
- { return find_first_of (s, pos, traits::length (s)); }
- size_type find_first_of (charT c, size_type pos = 0) const
- { return find (c, pos); }
-
- size_type find_last_of (const basic_string& str, size_type pos = npos) const
- { return find_last_of (str.data(), pos, str.length()); }
- size_type find_last_of (const charT* s, size_type pos, size_type n) const;
- size_type find_last_of (const charT* s, size_type pos = npos) const
- { return find_last_of (s, pos, traits::length (s)); }
- size_type find_last_of (charT c, size_type pos = npos) const
- { return rfind (c, pos); }
-
- size_type find_first_not_of (const basic_string& str, size_type pos = 0) const
- { return find_first_not_of (str.data(), pos, str.length()); }
- size_type find_first_not_of (const charT* s, size_type pos, size_type n) const;
- size_type find_first_not_of (const charT* s, size_type pos = 0) const
- { return find_first_not_of (s, pos, traits::length (s)); }
- size_type find_first_not_of (charT c, size_type pos = 0) const;
-
- size_type find_last_not_of (const basic_string& str, size_type pos = npos) const
- { return find_last_not_of (str.data(), pos, str.length()); }
- size_type find_last_not_of (const charT* s, size_type pos, size_type n) const;
- size_type find_last_not_of (const charT* s, size_type pos = npos) const
- { return find_last_not_of (s, pos, traits::length (s)); }
- size_type find_last_not_of (charT c, size_type pos = npos) const;
-
- basic_string substr (size_type pos = 0, size_type n = npos) const
- { return basic_string (*this, pos, n); }
-
- int compare (const basic_string& str, size_type pos = 0, size_type n = npos) const;
- // There is no 'strncmp' equivalent for charT pointers.
- int compare (const charT* s, size_type pos, size_type n) const;
- int compare (const charT* s, size_type pos = 0) const
- { return compare (s, pos, traits::length (s)); }
-
- iterator begin () { selfish (); return &(*this)[0]; }
- iterator end () { selfish (); return &(*this)[length ()]; }
-
-private:
- iterator ibegin () const { return &(*rep ())[0]; }
- iterator iend () const { return &(*rep ())[length ()]; }
-
-public:
- const_iterator begin () const { return ibegin (); }
- const_iterator end () const { return iend (); }
-
- reverse_iterator rbegin() { return reverse_iterator (end ()); }
- const_reverse_iterator rbegin() const
- { return const_reverse_iterator (end ()); }
- reverse_iterator rend() { return reverse_iterator (begin ()); }
- const_reverse_iterator rend() const
- { return const_reverse_iterator (begin ()); }
-
-private:
- void alloc (size_type size, bool save);
- static size_type _find (const charT* ptr, charT c, size_type xpos, size_type len);
- inline bool check_realloc (size_type s) const;
-
- static Rep nilRep;
- charT *dat;
-};
-
-#ifdef __STL_MEMBER_TEMPLATES
-template <class charT, class traits, class Allocator> template <class InputIterator>
-basic_string <charT, traits, Allocator>& basic_string <charT, traits, Allocator>::
-replace (iterator i1, iterator i2, InputIterator j1, InputIterator j2)
-#else
-template <class charT, class traits, class Allocator>
-basic_string <charT, traits, Allocator>& basic_string <charT, traits, Allocator>::
-replace (iterator i1, iterator i2, const_iterator j1, const_iterator j2)
-#endif
-{
- const size_type len = length ();
- size_type pos = i1 - ibegin ();
- size_type n1 = i2 - i1;
- size_type n2 = j2 - j1;
-
- OUTOFRANGE (pos > len);
- if (n1 > len - pos)
- n1 = len - pos;
- LENGTHERROR (len - n1 > max_size () - n2);
- size_t newlen = len - n1 + n2;
-
- if (check_realloc (newlen))
- {
- Rep *p = Rep::create (newlen);
- p->copy (0, data (), pos);
- p->copy (pos + n2, data () + pos + n1, len - (pos + n1));
- for (; j1 != j2; ++j1, ++pos)
- traits::assign ((*p)[pos], *j1);
- repup (p);
- }
- else
- {
- rep ()->move (pos + n2, data () + pos + n1, len - (pos + n1));
- for (; j1 != j2; ++j1, ++pos)
- traits::assign ((*rep ())[pos], *j1);
- }
- rep ()->len = newlen;
-
- return *this;
-}
-
-template <class charT, class traits, class Allocator>
-inline basic_string <charT, traits, Allocator>
-operator+ (const basic_string <charT, traits, Allocator>& lhs,
- const basic_string <charT, traits, Allocator>& rhs)
-{
- basic_string <charT, traits, Allocator> str (lhs);
- str.append (rhs);
- return str;
-}
-
-template <class charT, class traits, class Allocator>
-inline basic_string <charT, traits, Allocator>
-operator+ (const charT* lhs, const basic_string <charT, traits, Allocator>& rhs)
-{
- basic_string <charT, traits, Allocator> str (lhs);
- str.append (rhs);
- return str;
-}
-
-template <class charT, class traits, class Allocator>
-inline basic_string <charT, traits, Allocator>
-operator+ (charT lhs, const basic_string <charT, traits, Allocator>& rhs)
-{
- basic_string <charT, traits, Allocator> str (1, lhs);
- str.append (rhs);
- return str;
-}
-
-template <class charT, class traits, class Allocator>
-inline basic_string <charT, traits, Allocator>
-operator+ (const basic_string <charT, traits, Allocator>& lhs, const charT* rhs)
-{
- basic_string <charT, traits, Allocator> str (lhs);
- str.append (rhs);
- return str;
-}
-
-template <class charT, class traits, class Allocator>
-inline basic_string <charT, traits, Allocator>
-operator+ (const basic_string <charT, traits, Allocator>& lhs, charT rhs)
-{
- basic_string <charT, traits, Allocator> str (lhs);
- str.append (1, rhs);
- return str;
-}
-
-template <class charT, class traits, class Allocator>
-inline bool
-operator== (const basic_string <charT, traits, Allocator>& lhs,
- const basic_string <charT, traits, Allocator>& rhs)
-{
- return (lhs.compare (rhs) == 0);
-}
-
-template <class charT, class traits, class Allocator>
-inline bool
-operator== (const charT* lhs, const basic_string <charT, traits, Allocator>& rhs)
-{
- return (rhs.compare (lhs) == 0);
-}
-
-template <class charT, class traits, class Allocator>
-inline bool
-operator== (const basic_string <charT, traits, Allocator>& lhs, const charT* rhs)
-{
- return (lhs.compare (rhs) == 0);
-}
-
-template <class charT, class traits, class Allocator>
-inline bool
-operator!= (const charT* lhs, const basic_string <charT, traits, Allocator>& rhs)
-{
- return (rhs.compare (lhs) != 0);
-}
-
-template <class charT, class traits, class Allocator>
-inline bool
-operator!= (const basic_string <charT, traits, Allocator>& lhs, const charT* rhs)
-{
- return (lhs.compare (rhs) != 0);
-}
-
-template <class charT, class traits, class Allocator>
-inline bool
-operator< (const basic_string <charT, traits, Allocator>& lhs,
- const basic_string <charT, traits, Allocator>& rhs)
-{
- return (lhs.compare (rhs) < 0);
-}
-
-template <class charT, class traits, class Allocator>
-inline bool
-operator< (const charT* lhs, const basic_string <charT, traits, Allocator>& rhs)
-{
- return (rhs.compare (lhs) > 0);
-}
-
-template <class charT, class traits, class Allocator>
-inline bool
-operator< (const basic_string <charT, traits, Allocator>& lhs, const charT* rhs)
-{
- return (lhs.compare (rhs) < 0);
-}
-
-template <class charT, class traits, class Allocator>
-inline bool
-operator> (const charT* lhs, const basic_string <charT, traits, Allocator>& rhs)
-{
- return (rhs.compare (lhs) < 0);
-}
-
-template <class charT, class traits, class Allocator>
-inline bool
-operator> (const basic_string <charT, traits, Allocator>& lhs, const charT* rhs)
-{
- return (lhs.compare (rhs) > 0);
-}
-
-template <class charT, class traits, class Allocator>
-inline bool
-operator<= (const charT* lhs, const basic_string <charT, traits, Allocator>& rhs)
-{
- return (rhs.compare (lhs) >= 0);
-}
-
-template <class charT, class traits, class Allocator>
-inline bool
-operator<= (const basic_string <charT, traits, Allocator>& lhs, const charT* rhs)
-{
- return (lhs.compare (rhs) <= 0);
-}
-
-template <class charT, class traits, class Allocator>
-inline bool
-operator>= (const charT* lhs, const basic_string <charT, traits, Allocator>& rhs)
-{
- return (rhs.compare (lhs) <= 0);
-}
-
-template <class charT, class traits, class Allocator>
-inline bool
-operator>= (const basic_string <charT, traits, Allocator>& lhs, const charT* rhs)
-{
- return (lhs.compare (rhs) >= 0);
-}
-
-template <class charT, class traits, class Allocator>
-inline bool
-operator!= (const basic_string <charT, traits, Allocator>& lhs,
- const basic_string <charT, traits, Allocator>& rhs)
-{
- return (lhs.compare (rhs) != 0);
-}
-
-template <class charT, class traits, class Allocator>
-inline bool
-operator> (const basic_string <charT, traits, Allocator>& lhs,
- const basic_string <charT, traits, Allocator>& rhs)
-{
- return (lhs.compare (rhs) > 0);
-}
-
-template <class charT, class traits, class Allocator>
-inline bool
-operator<= (const basic_string <charT, traits, Allocator>& lhs,
- const basic_string <charT, traits, Allocator>& rhs)
-{
- return (lhs.compare (rhs) <= 0);
-}
-
-template <class charT, class traits, class Allocator>
-inline bool
-operator>= (const basic_string <charT, traits, Allocator>& lhs,
- const basic_string <charT, traits, Allocator>& rhs)
-{
- return (lhs.compare (rhs) >= 0);
-}
-
-class istream; class ostream;
-template <class charT, class traits, class Allocator> istream&
-operator>> (istream&, basic_string <charT, traits, Allocator>&);
-template <class charT, class traits, class Allocator> ostream&
-operator<< (ostream&, const basic_string <charT, traits, Allocator>&);
-template <class charT, class traits, class Allocator> istream&
-getline (istream&, basic_string <charT, traits, Allocator>&, charT delim = '\n');
-
-} // extern "C++"
-
-#include <std/bastring.cc>
-
-#endif
diff --git a/contrib/libstdc++/std/complext.cc b/contrib/libstdc++/std/complext.cc
deleted file mode 100644
index 60227f213299..000000000000
--- a/contrib/libstdc++/std/complext.cc
+++ /dev/null
@@ -1,273 +0,0 @@
-// Member templates for the -*- C++ -*- complex number classes.
-// Copyright (C) 1994 Free Software Foundation
-
-// This file is part of the GNU ANSI C++ 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.
-
-// Written by Jason Merrill based upon the specification in the 27 May 1994
-// C++ working paper, ANSI document X3J16/94-0098.
-
-#include <complex>
-
-extern "C++" {
-template <class FLOAT> complex<FLOAT>
-cos (const complex<FLOAT>& x)
-{
- return complex<FLOAT> (cos (real (x)) * cosh (imag (x)),
- - sin (real (x)) * sinh (imag (x)));
-}
-
-template <class FLOAT> complex<FLOAT>
-cosh (const complex<FLOAT>& x)
-{
- return complex<FLOAT> (cosh (real (x)) * cos (imag (x)),
- sinh (real (x)) * sin (imag (x)));
-}
-
-template <class FLOAT> complex<FLOAT>
-exp (const complex<FLOAT>& x)
-{
- return polar (FLOAT (exp (real (x))), imag (x));
-}
-
-template <class FLOAT> complex<FLOAT>
-log (const complex<FLOAT>& x)
-{
- return complex<FLOAT> (log (abs (x)), arg (x));
-}
-
-template <class FLOAT> complex<FLOAT>
-pow (const complex<FLOAT>& x, const complex<FLOAT>& y)
-{
- FLOAT logr = log (abs (x));
- FLOAT t = arg (x);
-
- return polar (FLOAT (exp (logr * real (y) - imag (y) * t)),
- FLOAT (imag (y) * logr + real (y) * t));
-}
-
-template <class FLOAT> complex<FLOAT>
-pow (const complex<FLOAT>& x, FLOAT y)
-{
- return exp (FLOAT (y) * log (x));
-}
-
-template <class FLOAT> complex<FLOAT>
-pow (FLOAT x, const complex<FLOAT>& y)
-{
- return exp (y * FLOAT (log (x)));
-}
-
-template <class FLOAT> complex<FLOAT>
-sin (const complex<FLOAT>& x)
-{
- return complex<FLOAT> (sin (real (x)) * cosh (imag (x)),
- cos (real (x)) * sinh (imag (x)));
-}
-
-template <class FLOAT> complex<FLOAT>
-sinh (const complex<FLOAT>& x)
-{
- return complex<FLOAT> (sinh (real (x)) * cos (imag (x)),
- cosh (real (x)) * sin (imag (x)));
-}
-
-#include <iostream.h>
-
-template <class FLOAT> istream&
-operator >> (istream& is, complex<FLOAT>& x)
-{
- FLOAT re, im = 0;
- char ch = 0;
-
- if (is.ipfx0 ())
- {
- if (is.peek () == '(')
- is >> ch;
- is >> re;
- if (ch == '(')
- {
- is >> ch;
- if (ch == ',')
- is >> im >> ch;
- }
- }
- is.isfx ();
-
- if (ch != 0 && ch != ')')
- is.setstate (ios::failbit);
- else if (is.good ())
- x = complex<FLOAT> (re, im);
-
- return is;
-}
-
-template <class FLOAT> ostream&
-operator << (ostream& os, const complex<FLOAT>& x)
-{
- return os << '(' << real (x) << ',' << imag (x) << ')';
-}
-
-// The code below is adapted from f2c's libF77, and is subject to this
-// copyright:
-
-/****************************************************************
-Copyright 1990, 1991, 1992, 1993 by AT&T Bell Laboratories and Bellcore.
-
-Permission to use, copy, modify, and distribute this software
-and its documentation for any purpose and without fee is hereby
-granted, provided that the above copyright notice appear in all
-copies and that both that the copyright notice and this
-permission notice and warranty disclaimer appear in supporting
-documentation, and that the names of AT&T Bell Laboratories or
-Bellcore or any of their entities not be used in advertising or
-publicity pertaining to distribution of the software without
-specific, written prior permission.
-
-AT&T and Bellcore disclaim all warranties with regard to this
-software, including all implied warranties of merchantability
-and fitness. In no event shall AT&T or Bellcore be liable for
-any special, indirect or consequential damages or any damages
-whatsoever resulting from loss of use, data or profits, whether
-in an action of contract, negligence or other tortious action,
-arising out of or in connection with the use or performance of
-this software.
-****************************************************************/
-
-template <class FLOAT> complex<FLOAT>&
-__doadv (complex<FLOAT>* ths, const complex<FLOAT>& y)
-{
- FLOAT ar = abs (y.re);
- FLOAT ai = abs (y.im);
- FLOAT nr, ni;
- FLOAT t, d;
- if (ar <= ai)
- {
- t = y.re / y.im;
- d = y.im * (1 + t*t);
- nr = (ths->re * t + ths->im) / d;
- ni = (ths->im * t - ths->re) / d;
- }
- else
- {
- t = y.im / y.re;
- d = y.re * (1 + t*t);
- nr = (ths->re + ths->im * t) / d;
- ni = (ths->im - ths->re * t) / d;
- }
- ths->re = nr;
- ths->im = ni;
- return *ths;
-}
-
-template <class FLOAT> complex<FLOAT>
-operator / (const complex<FLOAT>& x, const complex<FLOAT>& y)
-{
- FLOAT ar = abs (real (y));
- FLOAT ai = abs (imag (y));
- FLOAT nr, ni;
- FLOAT t, d;
- if (ar <= ai)
- {
- t = real (y) / imag (y);
- d = imag (y) * (1 + t*t);
- nr = (real (x) * t + imag (x)) / d;
- ni = (imag (x) * t - real (x)) / d;
- }
- else
- {
- t = imag (y) / real (y);
- d = real (y) * (1 + t*t);
- nr = (real (x) + imag (x) * t) / d;
- ni = (imag (x) - real (x) * t) / d;
- }
- return complex<FLOAT> (nr, ni);
-}
-
-template <class FLOAT> complex<FLOAT>
-operator / (FLOAT x, const complex<FLOAT>& y)
-{
- FLOAT ar = abs (real (y));
- FLOAT ai = abs (imag (y));
- FLOAT nr, ni;
- FLOAT t, d;
- if (ar <= ai)
- {
- t = real (y) / imag (y);
- d = imag (y) * (1 + t*t);
- nr = x * t / d;
- ni = -x / d;
- }
- else
- {
- t = imag (y) / real (y);
- d = real (y) * (1 + t*t);
- nr = x / d;
- ni = -x * t / d;
- }
- return complex<FLOAT> (nr, ni);
-}
-
-template <class FLOAT> complex<FLOAT>
-pow (const complex<FLOAT>& xin, int y)
-{
- if (y == 0)
- return complex<FLOAT> (1.0);
- complex<FLOAT> r (1.0);
- complex<FLOAT> x (xin);
- if (y < 0)
- {
- y = -y;
- x = FLOAT(1)/x;
- }
- for (;;)
- {
- if (y & 1)
- r *= x;
- if (y >>= 1)
- x *= x;
- else
- return r;
- }
-}
-
-template <class FLOAT> complex<FLOAT>
-sqrt (const complex<FLOAT>& x)
-{
- FLOAT r = abs (x);
- FLOAT nr, ni;
- if (r == 0.0)
- nr = ni = r;
- else if (real (x) > 0)
- {
- nr = sqrt (0.5 * (r + real (x)));
- ni = imag (x) / nr / 2;
- }
- else
- {
- ni = sqrt (0.5 * (r - real (x)));
- if (imag (x) < 0)
- ni = - ni;
- nr = imag (x) / ni / 2;
- }
- return complex<FLOAT> (nr, ni);
-}
-} // extern "C++"
diff --git a/contrib/libstdc++/std/complext.h b/contrib/libstdc++/std/complext.h
deleted file mode 100644
index 6c55037bf94b..000000000000
--- a/contrib/libstdc++/std/complext.h
+++ /dev/null
@@ -1,400 +0,0 @@
-// The template and inlines for the -*- C++ -*- complex number classes.
-// Copyright (C) 1994 Free Software Foundation
-
-// This file is part of the GNU ANSI C++ 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.
-
-// Written by Jason Merrill based upon the specification in the 27 May 1994
-// C++ working paper, ANSI document X3J16/94-0098.
-
-#ifndef __COMPLEXT__
-#define __COMPLEXT__
-
-#ifdef __GNUG__
-#pragma interface
-#endif
-
-#include <cmath>
-
-#if ! defined (__GNUG__) && ! defined (__attribute__)
-#define __attribute__(foo) /* Ignore. */
-#endif
-
-class istream;
-class ostream;
-
-extern "C++" {
-template <class _FLT> class complex;
-template <class _FLT> complex<_FLT>&
- __doapl (complex<_FLT>* ths, const complex<_FLT>& r);
-template <class _FLT> complex<_FLT>&
- __doami (complex<_FLT>* ths, const complex<_FLT>& r);
-template <class _FLT> complex<_FLT>&
- __doaml (complex<_FLT>* ths, const complex<_FLT>& r);
-template <class _FLT> complex<_FLT>&
- __doadv (complex<_FLT>* ths, const complex<_FLT>& r);
-
-template <class _FLT>
-class complex
-{
-public:
- complex (_FLT r = 0, _FLT i = 0): re (r), im (i) { }
- complex& operator += (const complex&);
- complex& operator -= (const complex&);
- complex& operator *= (const complex&);
- complex& operator /= (const complex&);
- _FLT real () const { return re; }
- _FLT imag () const { return im; }
-private:
- _FLT re, im;
-
- friend complex& __doapl<> (complex *, const complex&);
- friend complex& __doami<> (complex *, const complex&);
- friend complex& __doaml<> (complex *, const complex&);
- friend complex& __doadv<> (complex *, const complex&);
-};
-
-// Declare specializations.
-class complex<float>;
-class complex<double>;
-class complex<long double>;
-
-template <class _FLT>
-inline complex<_FLT>&
-__doapl (complex<_FLT>* ths, const complex<_FLT>& r)
-{
- ths->re += r.re;
- ths->im += r.im;
- return *ths;
-}
-template <class _FLT>
-inline complex<_FLT>&
-complex<_FLT>::operator += (const complex<_FLT>& r)
-{
- return __doapl (this, r);
-}
-
-template <class _FLT>
-inline complex<_FLT>&
-__doami (complex<_FLT>* ths, const complex<_FLT>& r)
-{
- ths->re -= r.re;
- ths->im -= r.im;
- return *ths;
-}
-template <class _FLT>
-inline complex<_FLT>&
-complex<_FLT>::operator -= (const complex<_FLT>& r)
-{
- return __doami (this, r);
-}
-
-template <class _FLT>
-inline complex<_FLT>&
-__doaml (complex<_FLT>* ths, const complex<_FLT>& r)
-{
- _FLT f = ths->re * r.re - ths->im * r.im;
- ths->im = ths->re * r.im + ths->im * r.re;
- ths->re = f;
- return *ths;
-}
-template <class _FLT>
-inline complex<_FLT>&
-complex<_FLT>::operator *= (const complex<_FLT>& r)
-{
- return __doaml (this, r);
-}
-
-template <class _FLT>
-inline complex<_FLT>&
-complex<_FLT>::operator /= (const complex<_FLT>& r)
-{
- return __doadv (this, r);
-}
-
-template <class _FLT> inline _FLT
-imag (const complex<_FLT>& x) __attribute__ ((const));
-
-template <class _FLT> inline _FLT
-imag (const complex<_FLT>& x)
-{
- return x.imag ();
-}
-
-template <class _FLT> inline _FLT
-real (const complex<_FLT>& x) __attribute__ ((const));
-
-template <class _FLT> inline _FLT
-real (const complex<_FLT>& x)
-{
- return x.real ();
-}
-
-template <class _FLT> inline complex<_FLT>
-operator + (const complex<_FLT>& x, const complex<_FLT>& y) __attribute__ ((const));
-
-template <class _FLT> inline complex<_FLT>
-operator + (const complex<_FLT>& x, const complex<_FLT>& y)
-{
- return complex<_FLT> (real (x) + real (y), imag (x) + imag (y));
-}
-
-template <class _FLT> inline complex<_FLT>
-operator + (const complex<_FLT>& x, _FLT y) __attribute__ ((const));
-
-template <class _FLT> inline complex<_FLT>
-operator + (const complex<_FLT>& x, _FLT y)
-{
- return complex<_FLT> (real (x) + y, imag (x));
-}
-
-template <class _FLT> inline complex<_FLT>
-operator + (_FLT x, const complex<_FLT>& y) __attribute__ ((const));
-
-template <class _FLT> inline complex<_FLT>
-operator + (_FLT x, const complex<_FLT>& y)
-{
- return complex<_FLT> (x + real (y), imag (y));
-}
-
-template <class _FLT> inline complex<_FLT>
-operator - (const complex<_FLT>& x, const complex<_FLT>& y) __attribute__ ((const));
-
-template <class _FLT> inline complex<_FLT>
-operator - (const complex<_FLT>& x, const complex<_FLT>& y)
-{
- return complex<_FLT> (real (x) - real (y), imag (x) - imag (y));
-}
-
-template <class _FLT> inline complex<_FLT>
-operator - (const complex<_FLT>& x, _FLT y) __attribute__ ((const));
-
-template <class _FLT> inline complex<_FLT>
-operator - (const complex<_FLT>& x, _FLT y)
-{
- return complex<_FLT> (real (x) - y, imag (x));
-}
-
-template <class _FLT> inline complex<_FLT>
-operator - (_FLT x, const complex<_FLT>& y) __attribute__ ((const));
-
-template <class _FLT> inline complex<_FLT>
-operator - (_FLT x, const complex<_FLT>& y)
-{
- return complex<_FLT> (x - real (y), - imag (y));
-}
-
-template <class _FLT> inline complex<_FLT>
-operator * (const complex<_FLT>& x, const complex<_FLT>& y) __attribute__ ((const));
-
-template <class _FLT> inline complex<_FLT>
-operator * (const complex<_FLT>& x, const complex<_FLT>& y)
-{
- return complex<_FLT> (real (x) * real (y) - imag (x) * imag (y),
- real (x) * imag (y) + imag (x) * real (y));
-}
-
-template <class _FLT> inline complex<_FLT>
-operator * (const complex<_FLT>& x, _FLT y) __attribute__ ((const));
-
-template <class _FLT> inline complex<_FLT>
-operator * (const complex<_FLT>& x, _FLT y)
-{
- return complex<_FLT> (real (x) * y, imag (x) * y);
-}
-
-template <class _FLT> inline complex<_FLT>
-operator * (_FLT x, const complex<_FLT>& y) __attribute__ ((const));
-
-template <class _FLT> inline complex<_FLT>
-operator * (_FLT x, const complex<_FLT>& y)
-{
- return complex<_FLT> (x * real (y), x * imag (y));
-}
-
-template <class _FLT> complex<_FLT>
-operator / (const complex<_FLT>& x, _FLT y) __attribute__ ((const));
-
-template <class _FLT> complex<_FLT>
-operator / (const complex<_FLT>& x, _FLT y)
-{
- return complex<_FLT> (real (x) / y, imag (x) / y);
-}
-
-template <class _FLT> inline complex<_FLT>
-operator + (const complex<_FLT>& x) __attribute__ ((const));
-
-template <class _FLT> inline complex<_FLT>
-operator + (const complex<_FLT>& x)
-{
- return x;
-}
-
-template <class _FLT> inline complex<_FLT>
-operator - (const complex<_FLT>& x) __attribute__ ((const));
-
-template <class _FLT> inline complex<_FLT>
-operator - (const complex<_FLT>& x)
-{
- return complex<_FLT> (-real (x), -imag (x));
-}
-
-template <class _FLT> inline bool
-operator == (const complex<_FLT>& x, const complex<_FLT>& y) __attribute__ ((const));
-
-template <class _FLT> inline bool
-operator == (const complex<_FLT>& x, const complex<_FLT>& y)
-{
- return real (x) == real (y) && imag (x) == imag (y);
-}
-
-template <class _FLT> inline bool
-operator == (const complex<_FLT>& x, _FLT y) __attribute__ ((const));
-
-template <class _FLT> inline bool
-operator == (const complex<_FLT>& x, _FLT y)
-{
- return real (x) == y && imag (x) == 0;
-}
-
-template <class _FLT> inline bool
-operator == (_FLT x, const complex<_FLT>& y) __attribute__ ((const));
-
-template <class _FLT> inline bool
-operator == (_FLT x, const complex<_FLT>& y)
-{
- return x == real (y) && imag (y) == 0;
-}
-
-template <class _FLT> inline bool
-operator != (const complex<_FLT>& x, const complex<_FLT>& y) __attribute__ ((const));
-
-template <class _FLT> inline bool
-operator != (const complex<_FLT>& x, const complex<_FLT>& y)
-{
- return real (x) != real (y) || imag (x) != imag (y);
-}
-
-template <class _FLT> inline bool
-operator != (const complex<_FLT>& x, _FLT y) __attribute__ ((const));
-
-template <class _FLT> inline bool
-operator != (const complex<_FLT>& x, _FLT y)
-{
- return real (x) != y || imag (x) != 0;
-}
-
-template <class _FLT> inline bool
-operator != (_FLT x, const complex<_FLT>& y) __attribute__ ((const));
-
-template <class _FLT> inline bool
-operator != (_FLT x, const complex<_FLT>& y)
-{
- return x != real (y) || imag (y) != 0;
-}
-
-// Some targets don't provide a prototype for hypot when -ansi.
-extern "C" double hypot (double, double) __attribute__ ((const));
-
-template <class _FLT> inline _FLT
-abs (const complex<_FLT>& x) __attribute__ ((const));
-
-template <class _FLT> inline _FLT
-abs (const complex<_FLT>& x)
-{
- return hypot (real (x), imag (x));
-}
-
-template <class _FLT> inline _FLT
-arg (const complex<_FLT>& x) __attribute__ ((const));
-
-template <class _FLT> inline _FLT
-arg (const complex<_FLT>& x)
-{
- return atan2 (imag (x), real (x));
-}
-
-template <class _FLT> inline complex<_FLT>
-polar (_FLT r, _FLT t) __attribute__ ((const));
-
-template <class _FLT> inline complex<_FLT>
-polar (_FLT r, _FLT t)
-{
- return complex<_FLT> (r * cos (t), r * sin (t));
-}
-
-template <class _FLT> inline complex<_FLT>
-conj (const complex<_FLT>& x) __attribute__ ((const));
-
-template <class _FLT> inline complex<_FLT>
-conj (const complex<_FLT>& x)
-{
- return complex<_FLT> (real (x), -imag (x));
-}
-
-template <class _FLT> inline _FLT
-norm (const complex<_FLT>& x) __attribute__ ((const));
-
-template <class _FLT> inline _FLT
-norm (const complex<_FLT>& x)
-{
- return real (x) * real (x) + imag (x) * imag (x);
-}
-
-// Declarations of templates in complext.ccI
-
-template <class _FLT> complex<_FLT>
- operator / (const complex<_FLT>&, const complex<_FLT>&) __attribute__ ((const));
-template <class _FLT> complex<_FLT>
- operator / (_FLT, const complex<_FLT>&) __attribute__ ((const));
-template <class _FLT> complex<_FLT>
- cos (const complex<_FLT>&) __attribute__ ((const));
-template <class _FLT> complex<_FLT>
- cosh (const complex<_FLT>&) __attribute__ ((const));
-template <class _FLT> complex<_FLT>
- exp (const complex<_FLT>&) __attribute__ ((const));
-template <class _FLT> complex<_FLT>
- log (const complex<_FLT>&) __attribute__ ((const));
-template <class _FLT> complex<_FLT>
- pow (const complex<_FLT>&, const complex<_FLT>&) __attribute__ ((const));
-template <class _FLT> complex<_FLT>
- pow (const complex<_FLT>&, _FLT) __attribute__ ((const));
-template <class _FLT> complex<_FLT>
- pow (const complex<_FLT>&, int) __attribute__ ((const));
-template <class _FLT> complex<_FLT>
- pow (_FLT, const complex<_FLT>&) __attribute__ ((const));
-template <class _FLT> complex<_FLT>
- sin (const complex<_FLT>&) __attribute__ ((const));
-template <class _FLT> complex<_FLT>
- sinh (const complex<_FLT>&) __attribute__ ((const));
-template <class _FLT> complex<_FLT>
- sqrt (const complex<_FLT>&) __attribute__ ((const));
-
-template <class _FLT> istream& operator >> (istream&, complex<_FLT>&);
-template <class _FLT> ostream& operator << (ostream&, const complex<_FLT>&);
-} // extern "C++"
-
-// Specializations and such
-
-#include <std/fcomplex.h>
-#include <std/dcomplex.h>
-#include <std/ldcomplex.h>
-
-#endif
diff --git a/contrib/libstdc++/std/dcomplex.h b/contrib/libstdc++/std/dcomplex.h
deleted file mode 100644
index 5812d9fa7dfd..000000000000
--- a/contrib/libstdc++/std/dcomplex.h
+++ /dev/null
@@ -1,91 +0,0 @@
-// The -*- C++ -*- double_complex class.
-// Copyright (C) 1994 Free Software Foundation
-
-// This file is part of the GNU ANSI C++ 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.
-
-// Written by Jason Merrill based upon the specification in the 27 May 1994
-// C++ working paper, ANSI document X3J16/94-0098.
-
-#ifndef __DCOMPLEX__
-#define __DCOMPLEX__
-
-#ifdef __GNUG__
-#pragma interface "dcomplex"
-#endif
-
-extern "C++" {
-class complex<double>
-{
-public:
- complex (double r = 0, double i = 0): re (r), im (i) { }
- complex (const complex<float>& r): re (r.real ()), im (r.imag ()) { }
- explicit complex (const complex<long double>& r);
-
- complex& operator+= (const complex& r) { return __doapl (this, r); }
- complex& operator-= (const complex& r) { return __doami (this, r); }
- complex& operator*= (const complex& r) { return __doaml (this, r); }
- complex& operator/= (const complex& r) { return __doadv (this, r); }
-
- double real () const { return re; }
- double imag () const { return im; }
-private:
- double re, im;
-
- friend complex& __doapl<> (complex *, const complex&);
- friend complex& __doami<> (complex *, const complex&);
- friend complex& __doaml<> (complex *, const complex&);
- friend complex& __doadv<> (complex *, const complex&);
-
-#ifndef __STRICT_ANSI__
- friend inline complex operator + (const complex& x, double y)
- { return operator+<> (x, y); }
- friend inline complex operator + (double x, const complex& y)
- { return operator+<> (x, y); }
- friend inline complex operator - (const complex& x, double y)
- { return operator-<> (x, y); }
- friend inline complex operator - (double x, const complex& y)
- { return operator-<> (x, y); }
- friend inline complex operator * (const complex& x, double y)
- { return operator*<> (x, y); }
- friend inline complex operator * (double x, const complex& y)
- { return operator*<> (x, y); }
- friend inline complex operator / (const complex& x, double y)
- { return operator/<> (x, y); }
- friend inline complex operator / (double x, const complex& y)
- { return operator/<> (x, y); }
- friend inline bool operator == (const complex& x, double y)
- { return operator==<> (x, y); }
- friend inline bool operator == (double x, const complex& y)
- { return operator==<> (x, y); }
- friend inline bool operator != (const complex& x, double y)
- { return operator!=<> (x, y); }
- friend inline bool operator != (double x, const complex& y)
- { return operator!=<> (x, y); }
-#endif /* __STRICT_ANSI__ */
-};
-
-inline complex<float>::complex (const complex<double>& r)
-: re (r.real ()), im (r.imag ())
-{ }
-} // extern "C++"
-
-#endif
diff --git a/contrib/libstdc++/std/fcomplex.h b/contrib/libstdc++/std/fcomplex.h
deleted file mode 100644
index cd9af1a2e0ce..000000000000
--- a/contrib/libstdc++/std/fcomplex.h
+++ /dev/null
@@ -1,87 +0,0 @@
-// The -*- C++ -*- float_complex class.
-// Copyright (C) 1994 Free Software Foundation
-
-// This file is part of the GNU ANSI C++ 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.
-
-// Written by Jason Merrill based upon the specification in the 27 May 1994
-// C++ working paper, ANSI document X3J16/94-0098.
-
-#ifndef __FCOMPLEX__
-#define __FCOMPLEX__
-
-#ifdef __GNUG__
-#pragma interface "fcomplex"
-#endif
-
-extern "C++" {
-class complex<float>
-{
-public:
- complex (float r = 0, float i = 0): re (r), im (i) { }
- explicit complex (const complex<double>& r);
- explicit complex (const complex<long double>& r);
-
- complex& operator+= (const complex& r) { return __doapl (this, r); }
- complex& operator-= (const complex& r) { return __doami (this, r); }
- complex& operator*= (const complex& r) { return __doaml (this, r); }
- complex& operator/= (const complex& r) { return __doadv (this, r); }
-
- float real () const { return re; }
- float imag () const { return im; }
-private:
- float re, im;
-
- friend complex& __doapl<> (complex *, const complex&);
- friend complex& __doami<> (complex *, const complex&);
- friend complex& __doaml<> (complex *, const complex&);
- friend complex& __doadv<> (complex *, const complex&);
-
-#ifndef __STRICT_ANSI__
- friend inline complex operator + (const complex& x, float y)
- { return operator+<> (x, y); }
- friend inline complex operator + (float x, const complex& y)
- { return operator+<> (x, y); }
- friend inline complex operator - (const complex& x, float y)
- { return operator-<> (x, y); }
- friend inline complex operator - (float x, const complex& y)
- { return operator-<> (x, y); }
- friend inline complex operator * (const complex& x, float y)
- { return operator*<> (x, y); }
- friend inline complex operator * (float x, const complex& y)
- { return operator*<> (x, y); }
- friend inline complex operator / (const complex& x, float y)
- { return operator/<> (x, y); }
- friend inline complex operator / (float x, const complex& y)
- { return operator/<> (x, y); }
- friend inline bool operator == (const complex& x, float y)
- { return operator==<> (x, y); }
- friend inline bool operator == (float x, const complex& y)
- { return operator==<> (x, y); }
- friend inline bool operator != (const complex& x, float y)
- { return operator!=<> (x, y); }
- friend inline bool operator != (float x, const complex& y)
- { return operator!=<> (x, y); }
-#endif /* __STRICT_ANSI__ */
-};
-} // extern "C++"
-
-#endif
diff --git a/contrib/libstdc++/std/gslice.h b/contrib/libstdc++/std/gslice.h
deleted file mode 100644
index 4f6e854a14c0..000000000000
--- a/contrib/libstdc++/std/gslice.h
+++ /dev/null
@@ -1,111 +0,0 @@
-// The template and inlines for the -*- C++ -*- gslice class.
-
-// Copyright (C) 1997-1999 Cygnus Solutions
-//
-// This file is part of the GNU ISO C++ 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, you may use this file as part of a free software
-// library without restriction. Specifically, if other files instantiate
-// templates or use macros or inline functions from this file, or you compile
-// this file and link it with other files to produce an executable, this
-// file does not by itself cause the resulting executable to be covered by
-// the GNU General Public License. This exception does not however
-// invalidate any other reasons why the executable file might be covered by
-// the GNU General Public License.
-
-// Written by Gabriel Dos Reis <Gabriel.Dos-Reis@DPTMaths.ENS-Cachan.Fr>
-
-#ifndef __GSLICE__
-#define __GSLICE__
-
-extern "C++" {
-
-struct _Indexer {
- size_t _M_count;
- size_t _M_start;
- valarray<size_t> _M_size;
- valarray<size_t> _M_stride;
- valarray<size_t> _M_index;
- _Indexer(size_t, const valarray<size_t>&, const valarray<size_t>&);
- void _M_increment_use() { ++_M_count; }
- size_t _M_decrement_use() { return --_M_count; }
-};
-
-
-class gslice
-{
-public:
- gslice ();
- gslice (size_t, const valarray<size_t>&, const valarray<size_t>&);
- gslice(const gslice&);
- ~gslice();
-
- gslice& operator= (const gslice&);
- size_t start () const;
- valarray<size_t> size () const;
- valarray<size_t> stride () const;
-
-private:
- _Indexer* _M_index;
-
- template<typename _Tp> friend class valarray;
-};
-
-inline size_t
-gslice::start () const
-{ return _M_index ? _M_index->_M_start : 0; }
-
-inline valarray<size_t>
-gslice::size () const
-{ return _M_index ? _M_index->_M_size : valarray<size_t>(); }
-
-inline valarray<size_t>
-gslice::stride () const
-{ return _M_index ? _M_index->_M_stride : valarray<size_t>(); }
-
-inline gslice::gslice () : _M_index(0) {}
-
-inline
-gslice::gslice(size_t __o, const valarray<size_t>& __l,
- const valarray<size_t>& __s)
- : _M_index(new _Indexer(__o, __l, __s)) {}
-
-inline
-gslice::gslice(const gslice& __g) : _M_index(__g._M_index)
-{ if (_M_index) _M_index->_M_increment_use(); }
-
-inline
-gslice::~gslice()
-{ if (_M_index && _M_index->_M_decrement_use() == 0) delete _M_index; }
-
-inline gslice&
-gslice::operator= (const gslice& __g)
-{
- if (__g._M_index) __g._M_index->_M_increment_use();
- if (_M_index && _M_index->_M_decrement_use() == 0) delete _M_index;
- _M_index = __g._M_index;
- return *this;
-}
-
-
-} // extern "C++"
-
-#endif // __GSLICE__
-
-// Local Variables:
-// mode:c++
-// End:
diff --git a/contrib/libstdc++/std/gslice_array.h b/contrib/libstdc++/std/gslice_array.h
deleted file mode 100644
index 8a67cac90502..000000000000
--- a/contrib/libstdc++/std/gslice_array.h
+++ /dev/null
@@ -1,170 +0,0 @@
-// The template and inlines for the -*- C++ -*- gslice_array class.
-
-// Copyright (C) 1997-1999 Cygnus Solutions
-//
-// This file is part of the GNU ISO C++ 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, you may use this file as part of a free software
-// library without restriction. Specifically, if other files instantiate
-// templates or use macros or inline functions from this file, or you compile
-// this file and link it with other files to produce an executable, this
-// file does not by itself cause the resulting executable to be covered by
-// the GNU General Public License. This exception does not however
-// invalidate any other reasons why the executable file might be covered by
-// the GNU General Public License.
-
-// Written by Gabriel Dos Reis <Gabriel.Dos-Reis@DPTMaths.ENS-Cachan.Fr>
-
-#ifndef __GSLICE_ARRAY__
-#define __GSLICE_ARRAY__
-
-extern "C++" {
-
-template<typename _Tp> class gslice_array
-{
-public:
- typedef _Tp value_type;
-
- void operator= (const valarray<_Tp>&) const;
- void operator*= (const valarray<_Tp>&) const;
- void operator/= (const valarray<_Tp>&) const;
- void operator%= (const valarray<_Tp>&) const;
- void operator+= (const valarray<_Tp>&) const;
- void operator-= (const valarray<_Tp>&) const;
- void operator^= (const valarray<_Tp>&) const;
- void operator&= (const valarray<_Tp>&) const;
- void operator|= (const valarray<_Tp>&) const;
- void operator<<=(const valarray<_Tp>&) const;
- void operator>>=(const valarray<_Tp>&) const;
- void operator=(const _Tp&);
-
- template<class _Dom>
- void operator= (const _Expr<_Dom,_Tp>&) const;
- template<class _Dom>
- void operator*= (const _Expr<_Dom,_Tp>&) const;
- template<class _Dom>
- void operator/= (const _Expr<_Dom,_Tp>&) const;
- template<class _Dom>
- void operator%= (const _Expr<_Dom,_Tp>&) const;
- template<class _Dom>
- void operator+= (const _Expr<_Dom,_Tp>&) const;
- template<class _Dom>
- void operator-= (const _Expr<_Dom,_Tp>&) const;
- template<class _Dom>
- void operator^= (const _Expr<_Dom,_Tp>&) const;
- template<class _Dom>
- void operator&= (const _Expr<_Dom,_Tp>&) const;
- template<class _Dom>
- void operator|= (const _Expr<_Dom,_Tp>&) const;
- template<class _Dom>
- void operator<<= (const _Expr<_Dom,_Tp>&) const;
- template<class _Dom>
- void operator>>= (const _Expr<_Dom,_Tp>&) const;
-
-private:
- _Array<_Tp> _M_array;
- const valarray<size_t>& _M_index;
-
- friend class valarray<_Tp>;
-
- gslice_array (_Array<_Tp>, const valarray<size_t>&);
-
- // this constructor needs to be implemented.
- gslice_array (const gslice_array&);
-
- // not implemented
- gslice_array();
- gslice_array& operator= (const gslice_array&);
-};
-
-template<typename _Tp>
-inline
-gslice_array<_Tp>::gslice_array (_Array<_Tp> __a,
- const valarray<size_t>& __i)
- : _M_array (__a), _M_index (__i) {}
-
-
-template<typename _Tp>
-inline
-gslice_array<_Tp>::gslice_array (const gslice_array<_Tp>& __a)
- : _M_array (__a._M_array), _M_index (__a._M_index) {}
-
-
-template<typename _Tp>
-inline void
-gslice_array<_Tp>::operator= (const _Tp& __t)
-{
- __valarray_fill (_M_array, _Array<size_t>(_M_index),
- _M_index.size(), __t);
-}
-
-template<typename _Tp>
-inline void
-gslice_array<_Tp>::operator= (const valarray<_Tp>& __v) const
-{
- __valarray_copy (_Array<_Tp> (__v), __v.size (),
- _M_array, _Array<size_t>(_M_index));
-}
-
-template<typename _Tp>
-template<class E>
-inline void
-gslice_array<_Tp>::operator= (const _Expr<E, _Tp>& __e) const
-{
- __valarray_copy (__e, _M_index.size(), _M_array,
- _Array<size_t>(_M_index));
-}
-
-#undef _DEFINE_VALARRAY_OPERATOR
-#define _DEFINE_VALARRAY_OPERATOR(op, name) \
-template<typename _Tp> \
-inline void \
-gslice_array<_Tp>::operator##op##= (const valarray<_Tp>& __v) const \
-{ \
- _Array_augmented_##name (_M_array, _Array<size_t>(_M_index), \
- _Array<_Tp> (__v), __v.size ()); \
-} \
- \
-template<typename _Tp> template<class E> \
-inline void \
-gslice_array<_Tp>::operator##op##= (const _Expr<E, _Tp>& __e) const \
-{ \
- _Array_augmented_##name (_M_array, _Array<size_t>(_M_index), __e, \
- _M_index.size()); \
-}
-
-_DEFINE_VALARRAY_OPERATOR(*, multiplies)
-_DEFINE_VALARRAY_OPERATOR(/, divides)
-_DEFINE_VALARRAY_OPERATOR(%, modulus)
-_DEFINE_VALARRAY_OPERATOR(+, plus)
-_DEFINE_VALARRAY_OPERATOR(-, minus)
-_DEFINE_VALARRAY_OPERATOR(^, xor)
-_DEFINE_VALARRAY_OPERATOR(&, and)
-_DEFINE_VALARRAY_OPERATOR(|, or)
-_DEFINE_VALARRAY_OPERATOR(<<, shift_left)
-_DEFINE_VALARRAY_OPERATOR(>>, shift_right)
-
-#undef _DEFINE_VALARRAY_OPERATOR
-
-} // extern "C++"
-
-
-#endif // __GSLICE_ARRAY__
-
-// Local Variables:
-// mode:c++
-// End:
diff --git a/contrib/libstdc++/std/indirect_array.h b/contrib/libstdc++/std/indirect_array.h
deleted file mode 100644
index bb5b79fb834d..000000000000
--- a/contrib/libstdc++/std/indirect_array.h
+++ /dev/null
@@ -1,157 +0,0 @@
-// The template and inlines for the -*- C++ -*- indirect_array class.
-
-// Copyright (C) 1997-1999 Cygnus Solutions
-//
-// This file is part of the GNU ISO C++ 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, you may use this file as part of a free software
-// library without restriction. Specifically, if other files instantiate
-// templates or use macros or inline functions from this file, or you compile
-// this file and link it with other files to produce an executable, this
-// file does not by itself cause the resulting executable to be covered by
-// the GNU General Public License. This exception does not however
-// invalidate any other reasons why the executable file might be covered by
-// the GNU General Public License.
-
-// Written by Gabriel Dos Reis <Gabriel.Dos-Reis@DPTMaths.ENS-Cachan.Fr>
-
-#ifndef __INDIRECT_ARRAY__
-#define __INDIRECT_ARRAY__
-
-extern "C++" {
-
-template <class _Tp> class indirect_array
-{
-public:
- typedef _Tp value_type;
-
- void operator= (const valarray<_Tp>&) const;
- void operator*= (const valarray<_Tp>&) const;
- void operator/= (const valarray<_Tp>&) const;
- void operator%= (const valarray<_Tp>&) const;
- void operator+= (const valarray<_Tp>&) const;
- void operator-= (const valarray<_Tp>&) const;
- void operator^= (const valarray<_Tp>&) const;
- void operator&= (const valarray<_Tp>&) const;
- void operator|= (const valarray<_Tp>&) const;
- void operator<<= (const valarray<_Tp>&) const;
- void operator>>= (const valarray<_Tp>&) const;
- void operator= (const _Tp&);
-
- template<class _Dom>
- void operator= (const _Expr<_Dom, _Tp>&) const;
- template<class _Dom>
- void operator*= (const _Expr<_Dom, _Tp>&) const;
- template<class _Dom>
- void operator/= (const _Expr<_Dom, _Tp>&) const;
- template<class _Dom>
- void operator%= (const _Expr<_Dom, _Tp>&) const;
- template<class _Dom>
- void operator+= (const _Expr<_Dom, _Tp>&) const;
- template<class _Dom>
- void operator-= (const _Expr<_Dom, _Tp>&) const;
- template<class _Dom>
- void operator^= (const _Expr<_Dom, _Tp>&) const;
- template<class _Dom>
- void operator&= (const _Expr<_Dom, _Tp>&) const;
- template<class _Dom>
- void operator|= (const _Expr<_Dom, _Tp>&) const;
- template<class _Dom>
- void operator<<= (const _Expr<_Dom, _Tp>&) const;
- template<class _Dom>
- void operator>>= (const _Expr<_Dom, _Tp>&) const;
-
-private:
- indirect_array (const indirect_array&);
- indirect_array (_Array<_Tp>, size_t, _Array<size_t>);
-
- friend class valarray<_Tp>;
- friend class gslice_array<_Tp>;
-
- const size_t _M_sz;
- const _Array<size_t> _M_index;
- const _Array<_Tp> _M_array;
-
- // not implemented
- indirect_array ();
- indirect_array& operator= (const indirect_array&);
-};
-
-template<typename _Tp>
-inline indirect_array<_Tp>::indirect_array(const indirect_array<_Tp>& __a)
- : _M_sz (__a._M_sz), _M_index (__a._M_index),
- _M_array (__a._M_array) {}
-
-template<typename _Tp>
-inline
-indirect_array<_Tp>::indirect_array (_Array<_Tp> __a, size_t __s,
- _Array<size_t> __i)
- : _M_sz (__s), _M_index (__i), _M_array (__a) {}
-
-
-template<typename _Tp>
-inline void
-indirect_array<_Tp>::operator= (const _Tp& __t)
-{ __valarray_fill(_M_array, _M_index, _M_sz, __t); }
-
-template<typename _Tp>
-inline void
-indirect_array<_Tp>::operator= (const valarray<_Tp>& __v) const
-{ __valarray_copy (_Array<_Tp> (__v), _M_sz, _M_array, _M_index); }
-
-template<typename _Tp>
-template<class _Dom>
-inline void
-indirect_array<_Tp>::operator= (const _Expr<_Dom,_Tp>& __e) const
-{ __valarray_copy (__e, _M_sz, _M_array, _M_index); }
-
-#undef _DEFINE_VALARRAY_OPERATOR
-#define _DEFINE_VALARRAY_OPERATOR(op, name) \
-template<typename _Tp> \
-inline void \
-indirect_array<_Tp>::operator##op##= (const valarray<_Tp>& __v) const \
-{ \
- _Array_augmented_##name (_M_array, _M_index, _Array<_Tp> (__v), _M_sz); \
-} \
- \
-template<typename _Tp> template<class _Dom> \
-inline void \
-indirect_array<_Tp>::operator##op##= (const _Expr<_Dom,_Tp>& __e) const \
-{ \
- _Array_augmented_##name (_M_array, _M_index, __e, _M_sz); \
-}
-
-_DEFINE_VALARRAY_OPERATOR(*, multiplies)
-_DEFINE_VALARRAY_OPERATOR(/, divides)
-_DEFINE_VALARRAY_OPERATOR(%, modulus)
-_DEFINE_VALARRAY_OPERATOR(+, plus)
-_DEFINE_VALARRAY_OPERATOR(-, minus)
-_DEFINE_VALARRAY_OPERATOR(^, xor)
-_DEFINE_VALARRAY_OPERATOR(&, and)
-_DEFINE_VALARRAY_OPERATOR(|, or)
-_DEFINE_VALARRAY_OPERATOR(<<, shift_left)
-_DEFINE_VALARRAY_OPERATOR(>>, shift_right)
-
-#undef _DEFINE_VALARRAY_OPERATOR
-
-} // extern "C++"
-
-#endif // __INDIRECT_ARRAY__
-
-// Local Variables:
-// mode:c++
-// End:
diff --git a/contrib/libstdc++/std/ldcomplex.h b/contrib/libstdc++/std/ldcomplex.h
deleted file mode 100644
index bc91fa422bf7..000000000000
--- a/contrib/libstdc++/std/ldcomplex.h
+++ /dev/null
@@ -1,95 +0,0 @@
-// The -*- C++ -*- long_double_complex class.
-// Copyright (C) 1994 Free Software Foundation
-
-// This file is part of the GNU ANSI C++ 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.
-
-// Written by Jason Merrill based upon the specification in the 27 May 1994
-// C++ working paper, ANSI document X3J16/94-0098.
-
-#ifndef __LDCOMPLEX__
-#define __LDCOMPLEX__
-
-#ifdef __GNUG__
-#pragma interface "ldcomplex"
-#endif
-
-extern "C++" {
-class complex<long double>
-{
-public:
- complex (long double r = 0, long double i = 0): re (r), im (i) { }
- complex (const complex<float>& r): re (r.real ()), im (r.imag ()) { }
- complex (const complex<double>& r): re (r.real ()), im (r.imag ()) { }
-
- complex& operator+= (const complex& r) { return __doapl (this, r); }
- complex& operator-= (const complex& r) { return __doami (this, r); }
- complex& operator*= (const complex& r) { return __doaml (this, r); }
- complex& operator/= (const complex& r) { return __doadv (this, r); }
-
- long double real () const { return re; }
- long double imag () const { return im; }
-private:
- long double re, im;
-
- friend complex& __doapl<> (complex *, const complex&);
- friend complex& __doami<> (complex *, const complex&);
- friend complex& __doaml<> (complex *, const complex&);
- friend complex& __doadv<> (complex *, const complex&);
-
-#ifndef __STRICT_ANSI__
- friend inline complex operator + (const complex& x, long double y)
- { return operator+<> (x, y); }
- friend inline complex operator + (long double x, const complex& y)
- { return operator+<> (x, y); }
- friend inline complex operator - (const complex& x, long double y)
- { return operator-<> (x, y); }
- friend inline complex operator - (long double x, const complex& y)
- { return operator-<> (x, y); }
- friend inline complex operator * (const complex& x, long double y)
- { return operator*<> (x, y); }
- friend inline complex operator * (long double x, const complex& y)
- { return operator*<> (x, y); }
- friend inline complex operator / (const complex& x, long double y)
- { return operator/<> (x, y); }
- friend inline complex operator / (long double x, const complex& y)
- { return operator/<> (x, y); }
- friend inline bool operator == (const complex& x, long double y)
- { return operator==<> (x, y); }
- friend inline bool operator == (long double x, const complex& y)
- { return operator==<> (x, y); }
- friend inline bool operator != (const complex& x, long double y)
- { return operator!=<> (x, y); }
- friend inline bool operator != (long double x, const complex& y)
- { return operator!=<> (x, y); }
-#endif /* __STRICT_ANSI__ */
-};
-
-inline complex<float>::complex (const complex<long double>& r)
-: re (r.real ()), im (r.imag ())
-{ }
-
-inline complex<double>::complex (const complex<long double>& r)
-: re (r.real ()), im (r.imag ())
-{ }
-} // extern "C++"
-
-#endif
diff --git a/contrib/libstdc++/std/mask_array.h b/contrib/libstdc++/std/mask_array.h
deleted file mode 100644
index d431be4e97fd..000000000000
--- a/contrib/libstdc++/std/mask_array.h
+++ /dev/null
@@ -1,154 +0,0 @@
-// The template and inlines for the -*- C++ -*- mask_array class.
-
-// Copyright (C) 1997-1999 Cygnus Solutions
-//
-// This file is part of the GNU ISO C++ 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, you may use this file as part of a free software
-// library without restriction. Specifically, if other files instantiate
-// templates or use macros or inline functions from this file, or you compile
-// this file and link it with other files to produce an executable, this
-// file does not by itself cause the resulting executable to be covered by
-// the GNU General Public License. This exception does not however
-// invalidate any other reasons why the executable file might be covered by
-// the GNU General Public License.
-
-// Written by Gabriel Dos Reis <Gabriel.Dos-Reis@DPTMaths.ENS-Cachan.Fr>
-
-#ifndef __MASK_ARRAY__
-#define __MASK_ARRAY__
-
-extern "C++" {
-
-template <class _T> class mask_array
-{
-public:
- typedef _T value_type;
-
- void operator= (const valarray<_T>&) const;
- void operator*= (const valarray<_T>&) const;
- void operator/= (const valarray<_T>&) const;
- void operator%= (const valarray<_T>&) const;
- void operator+= (const valarray<_T>&) const;
- void operator-= (const valarray<_T>&) const;
- void operator^= (const valarray<_T>&) const;
- void operator&= (const valarray<_T>&) const;
- void operator|= (const valarray<_T>&) const;
- void operator<<=(const valarray<_T>&) const;
- void operator>>=(const valarray<_T>&) const;
- void operator= (const _T&);
-
- template<class _Dom>
- void operator= (const _Expr<_Dom,_T>&) const;
- template<class _Dom>
- void operator*= (const _Expr<_Dom,_T>&) const;
- template<class _Dom>
- void operator/= (const _Expr<_Dom,_T>&) const;
- template<class _Dom>
- void operator%= (const _Expr<_Dom,_T>&) const;
- template<class _Dom>
- void operator+= (const _Expr<_Dom,_T>&) const;
- template<class _Dom>
- void operator-= (const _Expr<_Dom,_T>&) const;
- template<class _Dom>
- void operator^= (const _Expr<_Dom,_T>&) const;
- template<class _Dom>
- void operator&= (const _Expr<_Dom,_T>&) const;
- template<class _Dom>
- void operator|= (const _Expr<_Dom,_T>&) const;
- template<class _Dom>
- void operator<<=(const _Expr<_Dom,_T>&) const;
- template<class _Dom>
- void operator>>=(const _Expr<_Dom,_T>&) const;
-
-private:
- mask_array (_Array<_T>, size_t, _Array<bool>);
- friend class valarray<_T>;
-
- const size_t _M_sz;
- const _Array<bool> _M_mask;
- const _Array<_T> _M_array;
-
- mask_array (const mask_array&);
-
- // not implemented
- mask_array ();
- mask_array& operator= (const mask_array&);
-};
-
-template<typename _Tp>
-inline mask_array<_Tp>::mask_array (const mask_array<_Tp>& a)
- : _M_sz (a._M_sz), _M_mask (a._M_mask), _M_array (a._M_array) {}
-
-template<typename _T>
-inline
-mask_array<_T>::mask_array (_Array<_T> __a, size_t __s, _Array<bool> __m)
- : _M_sz (__s), _M_mask (__m), _M_array (__a) {}
-
-template<typename _T>
-inline void
-mask_array<_T>::operator= (const _T& __t)
-{ __valarray_fill (_M_array, _M_sz, _M_mask, __t); }
-
-template<typename _T>
-inline void
-mask_array<_T>::operator= (const valarray<_T>& __v) const
-{ __valarray_copy (_Array<_T> (__v), __v.size (), _M_array, _M_mask); }
-
-template<typename _T>
-template<class E>
-inline void
-mask_array<_T>::operator= (const _Expr<E, _T>& __e) const
-{ __valarray_copy (__e, __e.size (), _M_array, _M_mask); }
-
-#undef _DEFINE_VALARRAY_OPERATOR
-#define _DEFINE_VALARRAY_OPERATOR(op, name) \
-template<typename _T> \
-inline void \
-mask_array<_T>::operator##op##= (const valarray<_T>& __v) const \
-{ \
- _Array_augmented_##name (_M_array, _M_mask, \
- _Array<_T> (__v), __v.size ()); \
-} \
- \
-template<typename _T> template<class E> \
-inline void \
-mask_array<_T>::operator##op##= (const _Expr<E, _T>& __e) const \
-{ \
- _Array_augmented_##name (_M_array, _M_mask, __e, __e.size ()); \
-}
-
-_DEFINE_VALARRAY_OPERATOR(*, multiplies)
-_DEFINE_VALARRAY_OPERATOR(/, divides)
-_DEFINE_VALARRAY_OPERATOR(%, modulus)
-_DEFINE_VALARRAY_OPERATOR(+, plus)
-_DEFINE_VALARRAY_OPERATOR(-, minus)
-_DEFINE_VALARRAY_OPERATOR(^, xor)
-_DEFINE_VALARRAY_OPERATOR(&, and)
-_DEFINE_VALARRAY_OPERATOR(|, or)
-_DEFINE_VALARRAY_OPERATOR(<<, shift_left)
-_DEFINE_VALARRAY_OPERATOR(>>, shift_right)
-
-#undef _DEFINE_VALARRAY_OPERATOR
-
-} // extern "C++"
-
-#endif // __MASK_ARRAY__
-
-// Local Variables:
-// mode:c++
-// End:
diff --git a/contrib/libstdc++/std/slice.h b/contrib/libstdc++/std/slice.h
deleted file mode 100644
index cf2fb283de95..000000000000
--- a/contrib/libstdc++/std/slice.h
+++ /dev/null
@@ -1,76 +0,0 @@
-// The template and inlines for the -*- C++ -*- slice class.
-
-// Copyright (C) 1997-1999 Cygnus Solutions
-//
-// This file is part of the GNU ISO C++ 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, you may use this file as part of a free software
-// library without restriction. Specifically, if other files instantiate
-// templates or use macros or inline functions from this file, or you compile
-// this file and link it with other files to produce an executable, this
-// file does not by itself cause the resulting executable to be covered by
-// the GNU General Public License. This exception does not however
-// invalidate any other reasons why the executable file might be covered by
-// the GNU General Public License.
-
-// Written by Gabriel Dos Reis <Gabriel.Dos-Reis@DPTMaths.ENS-Cachan.Fr>
-
-#ifndef __SLICE__
-#define __SLICE__
-
-extern "C++" {
-
-class slice
-{
-public:
- slice ();
- slice (size_t, size_t, size_t);
-
- size_t start () const;
- size_t size () const;
- size_t stride () const;
-
-private:
- size_t _M_off; // offset
- size_t _M_sz; // size
- size_t _M_st; // stride unit
-};
-
-inline slice::slice () {}
-
-inline slice::slice (size_t __o, size_t __d, size_t __s)
- : _M_off (__o), _M_sz (__d), _M_st (__s) {}
-
-inline size_t
-slice::start () const
- { return _M_off; }
-
-inline size_t
-slice::size () const
- { return _M_sz; }
-
-inline size_t
-slice::stride () const
- { return _M_st; }
-
-} // extern "C++"
-
-#endif // __SLICE__
-
-// Local Variables:
-// mode:c++
-// End:
diff --git a/contrib/libstdc++/std/slice_array.h b/contrib/libstdc++/std/slice_array.h
deleted file mode 100644
index dc1aa34d3556..000000000000
--- a/contrib/libstdc++/std/slice_array.h
+++ /dev/null
@@ -1,156 +0,0 @@
-// The template and inlines for the -*- C++ -*- slice_array class.
-
-// Copyright (C) 1997-1999 Cygnus Solutions
-//
-// This file is part of the GNU ISO C++ 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, you may use this file as part of a free software
-// library without restriction. Specifically, if other files instantiate
-// templates or use macros or inline functions from this file, or you compile
-// this file and link it with other files to produce an executable, this
-// file does not by itself cause the resulting executable to be covered by
-// the GNU General Public License. This exception does not however
-// invalidate any other reasons why the executable file might be covered by
-// the GNU General Public License.
-
-// Written by Gabriel Dos Reis <Gabriel.Dos-Reis@DPTMaths.ENS-Cachan.Fr>
-
-#ifndef __SLICE_ARRAY__
-#define __SLICE_ARRAY__
-
-extern "C++" {
-
-template<typename _T>
-class slice_array
-{
-public:
- typedef _T value_type;
-
- void operator= (const valarray<_T>&) const;
- void operator*= (const valarray<_T>&) const;
- void operator/= (const valarray<_T>&) const;
- void operator%= (const valarray<_T>&) const;
- void operator+= (const valarray<_T>&) const;
- void operator-= (const valarray<_T>&) const;
- void operator^= (const valarray<_T>&) const;
- void operator&= (const valarray<_T>&) const;
- void operator|= (const valarray<_T>&) const;
- void operator<<= (const valarray<_T>&) const;
- void operator>>= (const valarray<_T>&) const;
- void operator= (const _T &);
-
- template<class _Dom>
- void operator= (const _Expr<_Dom,_T>&) const;
- template<class _Dom>
- void operator*= (const _Expr<_Dom,_T>&) const;
- template<class _Dom>
- void operator/= (const _Expr<_Dom,_T>&) const;
- template<class _Dom>
- void operator%= (const _Expr<_Dom,_T>&) const;
- template<class _Dom>
- void operator+= (const _Expr<_Dom,_T>&) const;
- template<class _Dom>
- void operator-= (const _Expr<_Dom,_T>&) const;
- template<class _Dom>
- void operator^= (const _Expr<_Dom,_T>&) const;
- template<class _Dom>
- void operator&= (const _Expr<_Dom,_T>&) const;
- template<class _Dom>
- void operator|= (const _Expr<_Dom,_T>&) const;
- template<class _Dom>
- void operator<<= (const _Expr<_Dom,_T>&) const;
- template<class _Dom>
- void operator>>= (const _Expr<_Dom,_T>&) const;
-
-private:
- friend class valarray<_T>;
- slice_array(_Array<_T>, const slice&);
-
- const size_t _M_sz;
- const size_t _M_stride;
- const _Array<_T> _M_array;
-
- // this constructor is implemented since we need to return a value.
- slice_array (const slice_array&);
-
- // not implemented
- slice_array ();
- slice_array& operator= (const slice_array&);
-};
-
-template<typename _T>
-inline slice_array<_T>::slice_array (_Array<_T> __a, const slice& __s)
- : _M_sz (__s.size ()), _M_stride (__s.stride ()),
- _M_array (__a.begin () + __s.start ()) {}
-
-template<typename _Tp>
-inline slice_array<_Tp>::slice_array(const slice_array<_Tp>& a)
- : _M_sz(a._M_sz), _M_stride(a._M_stride), _M_array(a._M_array) {}
-
-template<typename _T>
-inline void
-slice_array<_T>::operator= (const _T& __t)
-{ __valarray_fill (_M_array, _M_sz, _M_stride, __t); }
-
-template<typename _T>
-inline void
-slice_array<_T>::operator= (const valarray<_T>& __v) const
-{ __valarray_copy (_Array<_T> (__v), _M_array, _M_sz, _M_stride); }
-
-template<typename _T>
-template<class _Dom>
-inline void
-slice_array<_T>::operator= (const _Expr<_Dom,_T>& __e) const
-{ __valarray_copy (__e, _M_sz, _M_array, _M_stride); }
-
-#undef _DEFINE_VALARRAY_OPERATOR
-#define _DEFINE_VALARRAY_OPERATOR(op, name) \
-template<typename _T> \
-inline void \
-slice_array<_T>::operator##op##= (const valarray<_T>& __v) const \
-{ \
- _Array_augmented_##name (_M_array, _M_sz, _M_stride, _Array<_T> (__v));\
-} \
- \
-template<typename _T> template<class _Dom> \
-inline void \
-slice_array<_T>::operator##op##= (const _Expr<_Dom,_T>& __e) const \
-{ \
- _Array_augmented_##name (_M_array, _M_stride, __e, _M_sz); \
-}
-
-
-_DEFINE_VALARRAY_OPERATOR(*, multiplies)
-_DEFINE_VALARRAY_OPERATOR(/, divides)
-_DEFINE_VALARRAY_OPERATOR(%, modulus)
-_DEFINE_VALARRAY_OPERATOR(+, plus)
-_DEFINE_VALARRAY_OPERATOR(-, minus)
-_DEFINE_VALARRAY_OPERATOR(^, xor)
-_DEFINE_VALARRAY_OPERATOR(&, and)
-_DEFINE_VALARRAY_OPERATOR(|, or)
-_DEFINE_VALARRAY_OPERATOR(<<, shift_left)
-_DEFINE_VALARRAY_OPERATOR(>>, shift_right)
-
-#undef _DEFINE_VALARRAY_OPERATOR
-
-} // extern "C++"
-
-#endif // __SLICE_ARRAY__
-
-// Local Variables:
-// mode:c++
-// End:
diff --git a/contrib/libstdc++/std/std_valarray.h b/contrib/libstdc++/std/std_valarray.h
deleted file mode 100644
index b3006555547d..000000000000
--- a/contrib/libstdc++/std/std_valarray.h
+++ /dev/null
@@ -1,728 +0,0 @@
-// The template and inlines for the -*- C++ -*- valarray class.
-
-// Copyright (C) 1997-1999 Cygnus Solutions
-//
-// This file is part of the GNU ISO C++ 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, you may use this file as part of a free software
-// library without restriction. Specifically, if other files instantiate
-// templates or use macros or inline functions from this file, or you compile
-// this file and link it with other files to produce an executable, this
-// file does not by itself cause the resulting executable to be covered by
-// the GNU General Public License. This exception does not however
-// invalidate any other reasons why the executable file might be covered by
-// the GNU General Public License.
-
-// Written by Gabriel Dos Reis <Gabriel.Dos-Reis@DPTMaths.ENS-Cachan.Fr>
-
-#ifndef __STD_VALARRAY__
-#define __STD_VALARRAY__
-#define _G_NO_VALARRAY_TEMPLATE_EXPORT 1
-
-#include <cstddef>
-#include <cmath>
-#include <cstdlib>
-#include <numeric>
-#include <functional>
-#include <algorithm>
-
-#ifndef alloca
-#ifdef __GNUC__
-#define alloca __builtin_alloca
-#else /* not GNU C. */
-#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi)
-#include <alloca.h>
-#else /* not sparc */
-#if defined (MSDOS) && !defined (__TURBOC__)
-#include <malloc.h>
-#else /* not MSDOS, or __TURBOC__ */
-#if defined(_AIX)
-#include <malloc.h>
- #pragma alloca
-#else /* not MSDOS, __TURBOC__, or _AIX */
-#ifdef __hpux
-#endif /* __hpux */
-#endif /* not _AIX */
-#endif /* not MSDOS, or __TURBOC__ */
-#endif /* not sparc. */
-#endif /* not GNU C. */
-#endif /* alloca not defined. */
-
-extern "C" {
- void* alloca(size_t);
-}
-
-
-extern "C++" {
-
-template<class _Clos, typename _Tp> class _Expr;
-
-template<typename _Tp1, typename _Tp2> class _ValArray;
-
-template<template<class> class _Oper,
- template<class, class> class _Meta, class _Dom> struct _UnClos;
-
-template<template<class> class _Oper,
- template<class, class> class _Meta1,
- template<class, class> class _Meta2,
- class _Dom1, class _Dom2> class _BinClos;
-
-template<template<class, class> class _Meta, class _Dom> class _SClos;
-
-template<template<class, class> class _Meta, class _Dom> class _GClos;
-
-template<template<class, class> class _Meta, class _Dom> class _IClos;
-
-template<template<class, class> class _Meta, class _Dom> class _ValFunClos;
-
-template<template<class, class> class _Meta, class _Dom> class _RefFunClos;
-
-template<class _Tp> struct _Unary_plus;
-template<class _Tp> struct _Bitwise_and;
-template<class _Tp> struct _Bitwise_or;
-template<class _Tp> struct _Bitwise_xor;
-template<class _Tp> struct _Bitwise_not;
-template<class _Tp> struct _Shift_left;
-template<class _Tp> struct _Shift_right;
-
-template<class _Tp> class valarray; // An array of type _Tp
-class slice; // BLAS-like slice out of an array
-template<class _Tp> class slice_array;
-class gslice; // generalized slice out of an array
-template<class _Tp> class gslice_array;
-template<class _Tp> class mask_array; // masked array
-template<class _Tp> class indirect_array; // indirected array
-
-} // extern "C++"
-
-#include <std/valarray_array.h>
-#include <std/valarray_meta.h>
-
-extern "C++" {
-
-template<class _Tp> class valarray
-{
-public:
- typedef _Tp value_type;
-
- // _lib.valarray.cons_ construct/destroy:
- valarray();
- explicit valarray(size_t);
- valarray(const _Tp&, size_t);
- valarray(const _Tp* __restrict__, size_t);
- valarray(const valarray&);
- valarray(const slice_array<_Tp>&);
- valarray(const gslice_array<_Tp>&);
- valarray(const mask_array<_Tp>&);
- valarray(const indirect_array<_Tp>&);
- template<class _Dom>
- valarray(const _Expr<_Dom,_Tp>& __e);
- ~valarray();
-
- // _lib.valarray.assign_ assignment:
- valarray<_Tp>& operator=(const valarray<_Tp>&);
- valarray<_Tp>& operator=(const _Tp&);
- valarray<_Tp>& operator=(const slice_array<_Tp>&);
- valarray<_Tp>& operator=(const gslice_array<_Tp>&);
- valarray<_Tp>& operator=(const mask_array<_Tp>&);
- valarray<_Tp>& operator=(const indirect_array<_Tp>&);
-
- template<class _Dom> valarray<_Tp>&
- operator= (const _Expr<_Dom,_Tp>&);
-
- // _lib.valarray.access_ element access:
- _Tp operator[](size_t) const;
- _Tp& operator[](size_t);
- // _lib.valarray.sub_ subset operations:
- _Expr<_SClos<_ValArray,_Tp>, _Tp> operator[](slice) const;
- slice_array<_Tp> operator[](slice);
- _Expr<_GClos<_ValArray,_Tp>, _Tp> operator[](const gslice&) const;
- gslice_array<_Tp> operator[](const gslice&);
- valarray<_Tp> operator[](const valarray<bool>&) const;
- mask_array<_Tp> operator[](const valarray<bool>&);
- _Expr<_IClos<_ValArray, _Tp>, _Tp>
- operator[](const valarray<size_t>&) const;
- indirect_array<_Tp> operator[](const valarray<size_t>&);
-
- // _lib.valarray.unary_ unary operators:
- _Expr<_UnClos<_Unary_plus,_ValArray,_Tp>,_Tp> operator+ () const;
- _Expr<_UnClos<negate,_ValArray,_Tp>,_Tp> operator- () const;
- _Expr<_UnClos<_Bitwise_not,_ValArray,_Tp>,_Tp> operator~ () const;
- _Expr<_UnClos<logical_not,_ValArray,_Tp>,bool> operator! () const;
-
- // _lib.valarray.cassign_ computed assignment:
- valarray<_Tp>& operator*= (const _Tp&);
- valarray<_Tp>& operator/= (const _Tp&);
- valarray<_Tp>& operator%= (const _Tp&);
- valarray<_Tp>& operator+= (const _Tp&);
- valarray<_Tp>& operator-= (const _Tp&);
- valarray<_Tp>& operator^= (const _Tp&);
- valarray<_Tp>& operator&= (const _Tp&);
- valarray<_Tp>& operator|= (const _Tp&);
- valarray<_Tp>& operator<<=(const _Tp&);
- valarray<_Tp>& operator>>=(const _Tp&);
- valarray<_Tp>& operator*= (const valarray<_Tp>&);
- valarray<_Tp>& operator/= (const valarray<_Tp>&);
- valarray<_Tp>& operator%= (const valarray<_Tp>&);
- valarray<_Tp>& operator+= (const valarray<_Tp>&);
- valarray<_Tp>& operator-= (const valarray<_Tp>&);
- valarray<_Tp>& operator^= (const valarray<_Tp>&);
- valarray<_Tp>& operator|= (const valarray<_Tp>&);
- valarray<_Tp>& operator&= (const valarray<_Tp>&);
- valarray<_Tp>& operator<<=(const valarray<_Tp>&);
- valarray<_Tp>& operator>>=(const valarray<_Tp>&);
-
- template<class _Dom>
- valarray<_Tp>& operator*= (const _Expr<_Dom,_Tp>&);
- template<class _Dom>
- valarray<_Tp>& operator/= (const _Expr<_Dom,_Tp>&);
- template<class _Dom>
- valarray<_Tp>& operator%= (const _Expr<_Dom,_Tp>&);
- template<class _Dom>
- valarray<_Tp>& operator+= (const _Expr<_Dom,_Tp>&);
- template<class _Dom>
- valarray<_Tp>& operator-= (const _Expr<_Dom,_Tp>&);
- template<class _Dom>
- valarray<_Tp>& operator^= (const _Expr<_Dom,_Tp>&);
- template<class _Dom>
- valarray<_Tp>& operator|= (const _Expr<_Dom,_Tp>&);
- template<class _Dom>
- valarray<_Tp>& operator&= (const _Expr<_Dom,_Tp>&);
- template<class _Dom>
- valarray<_Tp>& operator<<=(const _Expr<_Dom,_Tp>&);
- template<class _Dom>
- valarray<_Tp>& operator>>=(const _Expr<_Dom,_Tp>&);
-
-
- // _lib.valarray.members_ member functions:
- size_t size() const;
- _Tp sum() const;
- _Tp min() const;
- _Tp max() const;
-
- // FIXME: Extension
- _Tp product () const;
-
- valarray<_Tp> shift (int) const;
- valarray<_Tp> cshift(int) const;
- _Expr<_ValFunClos<_ValArray,_Tp>,_Tp> apply(_Tp func(_Tp)) const;
- _Expr<_RefFunClos<_ValArray,_Tp>,_Tp> apply(_Tp func(const _Tp&)) const;
- void resize(size_t __size, _Tp __c = _Tp());
-
-private:
- size_t _M_size;
- _Tp* __restrict__ _M_data;
-
- friend class _Array<_Tp>;
-};
-
-
-template<typename _Tp> struct _Unary_plus : unary_function<_Tp,_Tp> {
- _Tp operator() (const _Tp& __t) const { return __t; }
-};
-
-template<typename _Tp> struct _Bitwise_and : binary_function<_Tp,_Tp,_Tp> {
- _Tp operator() (_Tp __x, _Tp __y) const { return __x & __y; }
-};
-
-template<typename _Tp> struct _Bitwise_or : binary_function<_Tp,_Tp,_Tp> {
- _Tp operator() (_Tp __x, _Tp __y) const { return __x | __y; }
-};
-
-template<typename _Tp> struct _Bitwise_xor : binary_function<_Tp,_Tp,_Tp> {
- _Tp operator() (_Tp __x, _Tp __y) const { return __x ^ __y; }
-};
-
-template<typename _Tp> struct _Bitwise_not : unary_function<_Tp,_Tp> {
- _Tp operator() (_Tp __t) const { return ~__t; }
-};
-
-template<typename _Tp> struct _Shift_left : unary_function<_Tp,_Tp> {
- _Tp operator() (_Tp __x, _Tp __y) const { return __x << __y; }
-};
-
-template<typename _Tp> struct _Shift_right : unary_function<_Tp,_Tp> {
- _Tp operator() (_Tp __x, _Tp __y) const { return __x >> __y; }
-};
-
-
-template<typename _Tp>
-inline _Tp
-valarray<_Tp>::operator[] (size_t __i) const
-{ return _M_data[__i]; }
-
-template<typename _Tp>
-inline _Tp&
-valarray<_Tp>::operator[] (size_t __i)
-{ return _M_data[__i]; }
-
-} // extern "C++"
-
-#include <std/slice.h>
-#include <std/slice_array.h>
-#include <std/gslice.h>
-#include <std/gslice_array.h>
-#include <std/mask_array.h>
-#include <std/indirect_array.h>
-
-extern "C++" {
-
-template<typename _Tp>
-inline valarray<_Tp>::valarray () : _M_size (0), _M_data (0) {}
-
-template<typename _Tp>
-inline valarray<_Tp>::valarray (size_t __n)
- : _M_size (__n), _M_data (new _Tp[__n]) {}
-
-template<typename _Tp>
-inline valarray<_Tp>::valarray (const _Tp& __t, size_t __n)
- : _M_size (__n), _M_data (new _Tp[__n])
-{ __valarray_fill (_M_data, _M_size, __t); }
-
-template<typename _Tp>
-inline valarray<_Tp>::valarray (const _Tp* __restrict__ __pT, size_t __n)
- : _M_size (__n), _M_data (new _Tp[__n])
-{ __valarray_copy (__pT, __n, _M_data); }
-
-template<typename _Tp>
-inline valarray<_Tp>::valarray (const valarray<_Tp>& __v)
- : _M_size (__v._M_size), _M_data (new _Tp[__v._M_size])
-{ __valarray_copy (__v._M_data, _M_size, _M_data); }
-
-template<typename _Tp>
-inline valarray<_Tp>::valarray (const slice_array<_Tp>& __sa)
- : _M_size (__sa._M_sz), _M_data (new _Tp[__sa._M_sz])
-{ __valarray_copy (__sa._M_array, __sa._M_sz, __sa._M_stride,
- _Array<_Tp>(_M_data)); }
-
-template<typename _Tp>
-inline valarray<_Tp>::valarray (const gslice_array<_Tp>& __ga)
- : _M_size (__ga._M_index.size()), _M_data (new _Tp[_M_size])
-{ __valarray_copy (__ga._M_array, _Array<size_t>(__ga._M_index),
- _Array<_Tp>(_M_data), _M_size); }
-
-template<typename _Tp>
-inline valarray<_Tp>::valarray (const mask_array<_Tp>& __ma)
- : _M_size (__ma._M_sz), _M_data (new _Tp[__ma._M_sz])
-{ __valarray_copy (__ma._M_array, __ma._M_mask,
- _Array<_Tp>(_M_data), _M_size); }
-
-template<typename _Tp>
-inline valarray<_Tp>::valarray (const indirect_array<_Tp>& __ia)
- : _M_size (__ia._M_sz), _M_data (new _Tp[__ia._M_sz])
-{ __valarray_copy (__ia._M_array, __ia._M_index,
- _Array<_Tp>(_M_data), _M_size); }
-
-template<typename _Tp> template<class _Dom>
-inline valarray<_Tp>::valarray (const _Expr<_Dom, _Tp>& __e)
- : _M_size (__e.size ()), _M_data (new _Tp[_M_size])
-{ __valarray_copy (__e, _M_size, _Array<_Tp>(_M_data)); }
-
-template<typename _Tp>
-inline valarray<_Tp>::~valarray () { delete[] _M_data; }
-
-template<typename _Tp>
-inline valarray<_Tp>&
-valarray<_Tp>::operator= (const valarray<_Tp>& __v)
-{
- __valarray_copy(__v._M_data, _M_size, _M_data);
- return *this;
-}
-
-template<typename _Tp>
-inline valarray<_Tp>&
-valarray<_Tp>::operator= (const _Tp& __t)
-{
- __valarray_fill (_M_data, _M_size, __t);
- return *this;
-}
-
-template<typename _Tp>
-inline valarray<_Tp>&
-valarray<_Tp>::operator= (const slice_array<_Tp>& __sa)
-{
- __valarray_copy (__sa._M_array, __sa._M_sz,
- __sa._M_stride, _Array<_Tp>(_M_data));
- return *this;
-}
-
-template<typename _Tp>
-inline valarray<_Tp>&
-valarray<_Tp>::operator= (const gslice_array<_Tp>& __ga)
-{
- __valarray_copy (__ga._M_array, _Array<size_t>(__ga._M_index),
- _Array<_Tp>(_M_data), _M_size);
- return *this;
-}
-
-template<typename _Tp>
-inline valarray<_Tp>&
-valarray<_Tp>::operator= (const mask_array<_Tp>& __ma)
-{
- __valarray_copy (__ma._M_array, __ma._M_mask,
- _Array<_Tp>(_M_data), _M_size);
- return *this;
-}
-
-template<typename _Tp>
-inline valarray<_Tp>&
-valarray<_Tp>::operator= (const indirect_array<_Tp>& __ia)
-{
- __valarray_copy (__ia._M_array, __ia._M_index,
- _Array<_Tp>(_M_data), _M_size);
- return *this;
-}
-
-template<typename _Tp> template<class _Dom>
-inline valarray<_Tp>&
-valarray<_Tp>::operator= (const _Expr<_Dom, _Tp>& __e)
-{
- __valarray_copy (__e, _M_size, _Array<_Tp>(_M_data));
- return *this;
-}
-
-template<typename _Tp>
-inline _Expr<_SClos<_ValArray,_Tp>, _Tp>
-valarray<_Tp>::operator[] (slice __s) const
-{
- typedef _SClos<_ValArray,_Tp> _Closure;
- return _Expr<_Closure, _Tp> (_Closure (_Array<_Tp>(_M_data), __s));
-}
-
-template<typename _Tp>
-inline slice_array<_Tp>
-valarray<_Tp>::operator[] (slice __s)
-{
- return slice_array<_Tp> (_Array<_Tp>(_M_data), __s);
-}
-
-template<typename _Tp>
-inline _Expr<_GClos<_ValArray,_Tp>, _Tp>
-valarray<_Tp>::operator[] (const gslice& __gs) const
-{
- typedef _GClos<_ValArray,_Tp> _Closure;
- return _Expr<_Closure, _Tp>
- (_Closure (_Array<_Tp>(_M_data), __gs._M_index->_M_index));
-}
-
-template<typename _Tp>
-inline gslice_array<_Tp>
-valarray<_Tp>::operator[] (const gslice& __gs)
-{
- return gslice_array<_Tp>
- (_Array<_Tp>(_M_data), __gs._M_index->_M_index);
-}
-
-template<typename _Tp>
-inline valarray<_Tp>
-valarray<_Tp>::operator[] (const valarray<bool>& __m) const
-{
- size_t __s (0);
- size_t __e (__m.size ());
- for (size_t __i=0; __i<__e; ++__i)
- if (__m[__i]) ++__s;
- return valarray<_Tp> (mask_array<_Tp> (_Array<_Tp>(_M_data), __s,
- _Array<bool> (__m)));
-}
-
-template<typename _Tp>
-inline mask_array<_Tp>
-valarray<_Tp>::operator[] (const valarray<bool>& __m)
-{
- size_t __s (0);
- size_t __e (__m.size ());
- for (size_t __i=0; __i<__e; ++__i)
- if (__m[__i]) ++__s;
- return mask_array<_Tp> (_Array<_Tp>(_M_data), __s, _Array<bool> (__m));
-}
-
-template<typename _Tp>
-inline _Expr<_IClos<_ValArray,_Tp>, _Tp>
-valarray<_Tp>::operator[] (const valarray<size_t>& __i) const
-{
- typedef _IClos<_ValArray,_Tp> _Closure;
- return _Expr<_Closure, _Tp> (_Closure (*this, __i));
-}
-
-template<typename _Tp>
-inline indirect_array<_Tp>
-valarray<_Tp>::operator[] (const valarray<size_t>& __i)
-{
- return indirect_array<_Tp> (_Array<_Tp>(_M_data), __i.size(),
- _Array<size_t> (__i));
-}
-
-template<class _Tp>
-inline size_t valarray<_Tp>::size () const { return _M_size; }
-
-template<class _Tp>
-inline _Tp
-valarray<_Tp>::sum () const
-{
- return accumulate (_M_data, _M_data + _M_size, _Tp ());
-}
-
-template<typename _Tp>
-inline _Tp
-valarray<_Tp>::product () const
-{
- return accumulate (_M_data, _M_data+_M_size, _Tp(1), multiplies<_Tp> ());
-}
-
-template <class _Tp>
-inline valarray<_Tp>
-valarray<_Tp>::shift (int __n) const
-{
- _Tp* const __a = static_cast<_Tp*> (alloca (sizeof(_Tp) * _M_size));
- if (! __n) // __n == 0: no shift
- __valarray_copy (_M_data, _M_size, __a);
- else if (__n > 0) { // __n > 0: shift left
- if (__n > _M_size)
- __valarray_fill(__a, __n, _Tp());
- else {
- __valarray_copy (_M_data+__n, _M_size-__n, __a);
- __valarray_fill (__a+_M_size-__n, __n, _Tp());
- }
- }
- else { // __n < 0: shift right
- __valarray_copy (_M_data, _M_size+__n, __a-__n);
- __valarray_fill(__a, -__n, _Tp());
- }
- return valarray<_Tp> (__a, _M_size);
-}
-
-template <class _Tp>
-inline valarray<_Tp>
-valarray<_Tp>::cshift (int __n) const
-{
- _Tp* const __a = static_cast<_Tp*> (alloca (sizeof(_Tp) * _M_size));
- if (! __n) // __n == 0: no cshift
- __valarray_copy(_M_data, _M_size, __a);
- else if (__n > 0) { // __n > 0: cshift left
- __valarray_copy (_M_data, __n, __a + _M_size-__n);
- __valarray_copy (_M_data + __n, _M_size-__n, __a);
- }
- else { // __n < 0: cshift right
- __valarray_copy (_M_data + _M_size + __n, -__n, __a);
- __valarray_copy (_M_data, _M_size + __n, __a - __n);
- }
- return valarray<_Tp> (__a, _M_size);
-}
-
-template <class _Tp>
-inline void
-valarray<_Tp>::resize (size_t __n, _Tp __c)
-{
- if (_M_size != __n) {
- delete[] _M_data;
- _M_size = __n;
- _M_data = new _Tp[_M_size];
- }
- __valarray_fill (_M_data, _M_size, __c);
-}
-
-template<typename _Tp>
-inline _Tp
-valarray<_Tp>::min() const
-{
- return *min_element (_M_data, _M_data+_M_size);
-}
-
-template<typename _Tp>
-inline _Tp
-valarray<_Tp>::max() const
-{
- return *max_element (_M_data, _M_data+_M_size);
-}
-
-template<class _Tp>
-inline _Expr<_ValFunClos<_ValArray,_Tp>,_Tp>
-valarray<_Tp>::apply (_Tp func (_Tp)) const
-{
- typedef _ValFunClos<_ValArray,_Tp> _Closure;
- return _Expr<_Closure,_Tp> (_Closure (*this, func));
-}
-
-template<class _Tp>
-inline _Expr<_RefFunClos<_ValArray,_Tp>,_Tp>
-valarray<_Tp>::apply (_Tp func (const _Tp &)) const
-{
- typedef _RefFunClos<_ValArray,_Tp> _Closure;
- return _Expr<_Closure,_Tp> (_Closure (*this, func));
-}
-
-#define _DEFINE_VALARRAY_UNARY_OPERATOR(_Op, _Name) \
- template<typename _Tp> \
- inline _Expr<_UnClos<_Name,_ValArray,_Tp>, _Tp> \
- valarray<_Tp>::operator##_Op() const \
- { \
- typedef _UnClos<_Name,_ValArray,_Tp> _Closure; \
- return _Expr<_Closure, _Tp> (_Closure (*this)); \
- }
-
- _DEFINE_VALARRAY_UNARY_OPERATOR(+, _Unary_plus)
- _DEFINE_VALARRAY_UNARY_OPERATOR(-, negate)
- _DEFINE_VALARRAY_UNARY_OPERATOR(~, _Bitwise_not)
-
-#undef _DEFINE_VALARRAY_UNARY_OPERATOR
-
- template<typename _Tp>
- inline _Expr<_UnClos<logical_not,_ValArray,_Tp>, bool>
- valarray<_Tp>::operator!() const
- {
- typedef _UnClos<logical_not,_ValArray,_Tp> _Closure;
- return _Expr<_Closure, bool> (_Closure (*this));
- }
-
-#define _DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(_Op, _Name) \
- template<class _Tp> \
- inline valarray<_Tp> & \
- valarray<_Tp>::operator##_Op##= (const _Tp &__t) \
- { \
- _Array_augmented_##_Name (_Array<_Tp>(_M_data), _M_size, __t); \
- return *this; \
- } \
- \
- template<class _Tp> \
- inline valarray<_Tp> & \
- valarray<_Tp>::operator##_Op##= (const valarray<_Tp> &__v) \
- { \
- _Array_augmented_##_Name (_Array<_Tp>(_M_data), _M_size, \
- _Array<_Tp>(__v._M_data)); \
- return *this; \
- }
-
-_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(+, plus)
-_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(-, minus)
-_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(*, multiplies)
-_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(/, divides)
-_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(%, modulus)
-_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(^, xor)
-_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(&, and)
-_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(|, or)
-_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(<<, shift_left)
-_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(>>, shift_right)
-
-#undef _DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT
-
-
-#define _DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(_Op, _Name) \
- template<class _Tp> template<class _Dom> \
- inline valarray<_Tp> & \
- valarray<_Tp>::operator##_Op##= (const _Expr<_Dom,_Tp> &__e) \
- { \
- _Array_augmented_##_Name (_Array<_Tp>(_M_data), __e, _M_size); \
- return *this; \
- }
-
-_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(+, plus)
-_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(-, minus)
-_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(*, multiplies)
-_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(/, divides)
-_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(%, modulus)
-_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(^, xor)
-_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(&, and)
-_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(|, or)
-_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(<<, shift_left)
-_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(>>, shift_right)
-
-#undef _DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT
-
-
-#define _DEFINE_BINARY_OPERATOR(_Op, _Name) \
- template<typename _Tp> \
- inline _Expr<_BinClos<_Name,_ValArray,_ValArray,_Tp,_Tp>, _Tp> \
- operator##_Op (const valarray<_Tp> &__v, const valarray<_Tp> &__w) \
- { \
- typedef _BinClos<_Name,_ValArray,_ValArray,_Tp,_Tp> _Closure; \
- return _Expr<_Closure, _Tp> (_Closure (__v, __w)); \
- } \
- \
- template<typename _Tp> \
- inline _Expr<_BinClos<_Name,_ValArray,_Constant,_Tp,_Tp>,_Tp> \
- operator##_Op (const valarray<_Tp> &__v, const _Tp &__t) \
- { \
- typedef _BinClos<_Name,_ValArray,_Constant,_Tp,_Tp> _Closure; \
- return _Expr<_Closure, _Tp> (_Closure (__v, __t)); \
- } \
- \
- template<typename _Tp> \
- inline _Expr<_BinClos<_Name,_Constant,_ValArray,_Tp,_Tp>,_Tp> \
- operator##_Op (const _Tp &__t, const valarray<_Tp> &__v) \
- { \
- typedef _BinClos<_Name,_Constant,_ValArray,_Tp,_Tp> _Closure; \
- return _Expr<_Closure, _Tp> (_Closure (__t, __v)); \
- }
-
-_DEFINE_BINARY_OPERATOR(+, plus)
-_DEFINE_BINARY_OPERATOR(-, minus)
-_DEFINE_BINARY_OPERATOR(*, multiplies)
-_DEFINE_BINARY_OPERATOR(/, divides)
-_DEFINE_BINARY_OPERATOR(%, modulus)
-_DEFINE_BINARY_OPERATOR(^, _Bitwise_xor)
-_DEFINE_BINARY_OPERATOR(&, _Bitwise_and)
-_DEFINE_BINARY_OPERATOR(|, _Bitwise_or)
-_DEFINE_BINARY_OPERATOR(<<, _Shift_left)
-_DEFINE_BINARY_OPERATOR(>>, _Shift_right)
-
-#undef _DEFINE_BINARY_OPERATOR
-
-#define _DEFINE_LOGICAL_OPERATOR(_Op, _Name) \
- template<typename _Tp> \
- inline _Expr<_BinClos<_Name,_ValArray,_ValArray,_Tp,_Tp>,bool> \
- operator##_Op (const valarray<_Tp> &__v, const valarray<_Tp> &__w) \
- { \
- typedef _BinClos<_Name,_ValArray,_ValArray,_Tp,_Tp> _Closure; \
- return _Expr<_Closure, bool> (_Closure (__v, __w)); \
- } \
- \
- template<class _Tp> \
- inline _Expr<_BinClos<_Name,_ValArray,_Constant,_Tp,_Tp>,bool> \
- operator##_Op (const valarray<_Tp> &__v, const _Tp &__t) \
- { \
- typedef _BinClos<_Name,_ValArray,_Constant,_Tp,_Tp> _Closure; \
- return _Expr<_Closure, bool> (_Closure (__v, __t)); \
- } \
- \
- template<class _Tp> \
- inline _Expr<_BinClos<_Name,_Constant,_ValArray,_Tp,_Tp>,bool> \
- operator##_Op (const _Tp &__t, const valarray<_Tp> &__v) \
- { \
- typedef _BinClos<_Name,_Constant,_ValArray,_Tp,_Tp> _Closure; \
- return _Expr<_Closure, bool> (_Closure (__t, __v)); \
- }
-
-_DEFINE_LOGICAL_OPERATOR(&&, logical_and)
-_DEFINE_LOGICAL_OPERATOR(||, logical_or)
-_DEFINE_LOGICAL_OPERATOR(==, equal_to)
-_DEFINE_LOGICAL_OPERATOR(!=, not_equal_to)
-_DEFINE_LOGICAL_OPERATOR(<, less)
-_DEFINE_LOGICAL_OPERATOR(>, greater)
-_DEFINE_LOGICAL_OPERATOR(<=, less_equal)
-_DEFINE_LOGICAL_OPERATOR(>=, greater_equal)
-
-#undef _DEFINE_VALARRAY_OPERATOR
-
-#undef _G_NO_VALARRAY_TEMPLATE_EXPORT
-
-} // extern "C++"
-
-#endif // __STD_VALARRAY__
-
-// Local Variables:
-// mode:c++
-// End:
diff --git a/contrib/libstdc++/std/straits.h b/contrib/libstdc++/std/straits.h
deleted file mode 100644
index c80e7ab7a681..000000000000
--- a/contrib/libstdc++/std/straits.h
+++ /dev/null
@@ -1,161 +0,0 @@
-// Character traits template for the -*- C++ -*- string classes.
-// Copyright (C) 1994 Free Software Foundation
-
-// This file is part of the GNU ANSI C++ 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.
-
-// Written by Jason Merrill based upon the specification by Takanori Adachi
-// in ANSI X3J16/94-0013R2.
-
-#ifndef __STRING_CHAR_TRAITS__
-#define __STRING_CHAR_TRAITS__
-
-#ifdef __GNUG__
-// For string_char_traits <char>
-#pragma interface "std/straits.h"
-#endif
-
-#include <cstddef>
-
-extern "C++" {
-template <class charT>
-struct string_char_traits {
- typedef charT char_type; // for users to acquire the basic character type
-
- // constraints
-
- static void assign (char_type& c1, const char_type& c2)
- { c1 = c2; }
- static bool eq (const char_type& c1, const char_type& c2)
- { return (c1 == c2); }
- static bool ne (const char_type& c1, const char_type& c2)
- { return !(c1 == c2); }
- static bool lt (const char_type& c1, const char_type& c2)
- { return (c1 < c2); }
- static char_type eos () { return char_type(); } // the null character
- static bool is_del(char_type a) { return 0; }
- // characteristic function for delimiters of charT
-
- // speed-up functions
-
- static int compare (const char_type* s1, const char_type* s2, size_t n)
- {
- size_t i;
- for (i = 0; i < n; ++i)
- if (ne (s1[i], s2[i]))
- return lt (s1[i], s2[i]) ? -1 : 1;
-
- return 0;
- }
-
- static size_t length (const char_type* s)
- {
- size_t l = 0;
- while (ne (*s++, eos ()))
- ++l;
- return l;
- }
-
- static char_type* copy (char_type* s1, const char_type* s2, size_t n)
- {
- for (; n--; )
- assign (s1[n], s2[n]);
- return s1;
- }
-
- static char_type* move (char_type* s1, const char_type* s2, size_t n)
- {
- char_type a[n];
- size_t i;
- for (i = 0; i < n; ++i)
- assign (a[i], s2[i]);
- for (i = 0; i < n; ++i)
- assign (s1[i], a[i]);
- return s1;
- }
-
- static char_type* set (char_type* s1, const char_type& c, size_t n)
- {
- for (; n--; )
- assign (s1[n], c);
- return s1;
- }
-};
-
-class istream;
-class ostream;
-#include <cctype>
-#include <cstring>
-
-struct string_char_traits <char> {
- typedef char char_type;
-
- static void assign (char_type& c1, const char_type& c2)
- { c1 = c2; }
- static bool eq (const char_type & c1, const char_type& c2)
- { return (c1 == c2); }
- static bool ne (const char_type& c1, const char_type& c2)
- { return (c1 != c2); }
- static bool lt (const char_type& c1, const char_type& c2)
- { return (c1 < c2); }
- static char_type eos () { return 0; }
- static bool is_del(char_type a) { return isspace(a); }
-
- static int compare (const char_type* s1, const char_type* s2, size_t n)
- { return memcmp (s1, s2, n); }
- static size_t length (const char_type* s)
- { return strlen (s); }
- static char_type* copy (char_type* s1, const char_type* s2, size_t n)
- { return (char_type*) memcpy (s1, s2, n); }
- static char_type* move (char_type* s1, const char_type* s2, size_t n)
- { return (char_type*) memmove (s1, s2, n); }
- static char_type* set (char_type* s1, const char_type& c, size_t n)
- { return (char_type*) memset (s1, c, n); }
-};
-
-#if 0
-#include <cwctype>
-struct string_char_traits <wchar_t> {
- typedef wchar_t char_type;
-
- static void assign (char_type& c1, const char_type& c2)
- { c1 = c2; }
- static bool eq (const char_type & c1, const char_type& c2)
- { return (c1 == c2); }
- static bool ne (const char_type& c1, const char_type& c2)
- { return (c1 != c2); }
- static bool lt (const char_type& c1, const char_type& c2)
- { return (c1 < c2); }
- static char_type eos () { return 0; }
- static bool is_del(char_type a) { return iswspace(a); }
-
- static int compare (const char_type* s1, const char_type* s2, size_t n)
- { return wmemcmp (s1, s2, n); }
- static size_t length (const char_type* s)
- { return wcslen (s); }
- static char_type* copy (char_type* s1, const char_type* s2, size_t n)
- { return wmemcpy (s1, s2, n); }
- static char_type* set (char_type* s1, const char_type& c, size_t n)
- { return wmemset (s1, c, n); }
-};
-#endif
-} // extern "C++"
-#endif
diff --git a/contrib/libstdc++/std/valarray_array.h b/contrib/libstdc++/std/valarray_array.h
deleted file mode 100644
index a0b5818fd8b0..000000000000
--- a/contrib/libstdc++/std/valarray_array.h
+++ /dev/null
@@ -1,346 +0,0 @@
-// The template and inlines for the -*- C++ -*- internal _Array helper class.
-
-// Copyright (C) 1997-1999 Cygnus Solutions
-//
-// This file is part of the GNU ISO C++ 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, you may use this file as part of a free software
-// library without restriction. Specifically, if other files instantiate
-// templates or use macros or inline functions from this file, or you compile
-// this file and link it with other files to produce an executable, this
-// file does not by itself cause the resulting executable to be covered by
-// the GNU General Public License. This exception does not however
-// invalidate any other reasons why the executable file might be covered by
-// the GNU General Public License.
-
-// Written by Gabriel Dos Reis <Gabriel.Dos-Reis@DPTMaths.ENS-Cachan.Fr>
-
-#ifndef __VALARRAY_ARRAY__
-#define __VALARRAY_ARRAY__
-
-#include <cstdlib>
-#include <cstring>
-
-extern "C++" {
-
-//
-// Helper functions on raw pointers
-//
-
-// fill plain array __a[<__n>] with __t
-template<typename _Tp>
-inline void
-__valarray_fill (_Tp* __restrict__ __a, size_t __n, const _Tp& __t)
-{ while (__n--) *__a++ = __t; }
-
-// fill strided array __a[<__n-1 : __s>] with __t
-template<typename _Tp>
-inline void
-__valarray_fill (_Tp* __restrict__ __a, size_t __n,
- size_t __s, const _Tp& __t)
-{ for (size_t __i=0; __i<__n; ++__i, __a+=__s) *__a = __t; }
-
-// fill indirect array __a[__i[<__n>]] with __i
-template<typename _Tp>
-inline void
-__valarray_fill(_Tp* __restrict__ __a, const size_t* __restrict__ __i,
- size_t __n, const _Tp& __t)
-{ for (size_t __j=0; __j<__n; ++__j, ++__i) __a[*__i] = __t; }
-
-// copy plain array __a[<__n>] in __b[<__n>]
-template<typename _Tp>
-inline void
-__valarray_copy (const _Tp* __restrict__ __a, size_t __n,
- _Tp* __restrict__ __b)
-{ memcpy (__b, __a, __n * sizeof(_Tp)); }
-
-// copy strided array __a[<__n : __s>] in plain __b[<__n>]
-template<typename _Tp>
-inline void
-__valarray_copy (const _Tp* __restrict__ __a, size_t __n, size_t __s,
- _Tp* __restrict__ __b)
-{ for (size_t __i=0; __i<__n; ++__i, ++__b, __a += __s) *__b = *__a; }
-
-// copy plain __a[<__n>] in strided __b[<__n : __s>]
-template<typename _Tp>
-inline void
-__valarray_copy (const _Tp* __restrict__ __a, _Tp* __restrict__ __b,
- size_t __n, size_t __s)
-{ for (size_t __i=0; __i<__n; ++__i, ++__a, __b+=__s) *__b = *__a; }
-
-// copy indexed __a[__i[<__n>]] in plain __b[<__n>]
-template<typename _Tp>
-inline void
-__valarray_copy (const _Tp* __restrict__ __a,
- const size_t* __restrict__ __i,
- _Tp* __restrict__ __b, size_t __n)
-{ for (size_t __j=0; __j<__n; ++__j, ++__b, ++__i) *__b = __a[*__i]; }
-
-// copy plain __a[<__n>] in indexed __b[__i[<__n>]]
-template<typename _Tp>
-inline void
-__valarray_copy (const _Tp* __restrict__ __a, size_t __n,
- _Tp* __restrict__ __b, const size_t* __restrict__ __i)
-{ for (size_t __j=0; __j<__n; ++__j, ++__a, ++__i) __b[*__i] = *__a; }
-
-//
-// Helper class _Array, first layer of valarray abstraction.
-// All operations on valarray should be forwarded to this class
-// whenever possible. -- gdr
-//
-
-template<typename _Tp> struct _Array {
-
- explicit _Array (size_t);
- explicit _Array (_Tp* const __restrict__);
- explicit _Array (const valarray<_Tp>&);
- _Array (const _Tp* __restrict__, size_t);
-
- void free_data() const;
- _Tp* begin () const;
-
- _Tp* const __restrict__ _M_data;
-};
-
-template<typename _Tp>
-inline void
-__valarray_fill (_Array<_Tp> __a, size_t __n, const _Tp& __t)
-{ __valarray_fill (__a._M_data, __n, __t); }
-
-template<typename _Tp>
-inline void
-__valarray_fill (_Array<_Tp> __a, size_t __n, size_t __s, const _Tp& __t)
-{ __valarray_fill (__a._M_data, __n, __s, __t); }
-
-template<typename _Tp>
-inline void
-__valarray_fill (_Array<_Tp> __a, _Array<size_t> __i,
- size_t __n, const _Tp& __t)
-{ __valarray_fill (__a._M_data, __i._M_data, __n, __t); }
-
-template<typename _Tp>
-inline void
-__valarray_copy (_Array<_Tp> __a, size_t __n, _Array<_Tp> __b)
-{ __valarray_copy (__a._M_data, __n, __b._M_data); }
-
-template<typename _Tp>
-inline void
-__valarray_copy (_Array<_Tp> __a, size_t __n, size_t __s, _Array<_Tp> __b)
-{ __valarray_copy(__a._M_data, __n, __s, __b._M_data); }
-
-template<typename _Tp>
-inline void
-__valarray_copy (_Array<_Tp> __a, _Array<_Tp> __b, size_t __n, size_t __s)
-{ __valarray_copy (__a._M_data, __b._M_data, __n, __s); }
-
-template<typename _Tp>
-inline void
-__valarray_copy (_Array<_Tp> __a, _Array<size_t> __i,
- _Array<_Tp> __b, size_t __n)
-{ __valarray_copy (__a._M_data, __i._M_data, __b._M_data, __n); }
-
-template<typename _Tp>
-inline void
-__valarray_copy (_Array<_Tp> __a, size_t __n, _Array<_Tp> __b,
- _Array<size_t> __i)
-{ __valarray_copy (__a._M_data, __n, __b._M_data, __i._M_data); }
-
-template<typename _Tp>
-inline
-_Array<_Tp>::_Array (size_t __n) : _M_data (new _Tp[__n]) {}
-
-template<typename _Tp>
-inline
-_Array<_Tp>::_Array (_Tp* const __restrict__ __p) : _M_data (__p) {}
-
-template<typename _Tp>
-inline _Array<_Tp>::_Array (const valarray<_Tp>& __v)
- : _M_data (__v._M_data) {}
-
-template<typename _Tp>
-inline
-_Array<_Tp>::_Array (const _Tp* __restrict__ __b, size_t __s)
- : _M_data (new _Tp[__s]) { __valarray_copy (__b, __s, _M_data); }
-
-template<typename _Tp>
-inline void
-_Array<_Tp>::free_data() const { delete[] _M_data; }
-
-template<typename _Tp>
-inline _Tp*
-_Array<_Tp>::begin () const
-{ return _M_data; }
-
-#define _DEFINE_ARRAY_FUNCTION(_Op, _Name) \
-template<typename _Tp> \
-inline void \
-_Array_augmented_##_Name (_Array<_Tp> __a, size_t __n, const _Tp& __t) \
-{ \
- for (_Tp* __p=__a._M_data; __p<__a._M_data+__n; ++__p) \
- *__p _Op##= __t; \
-} \
- \
-template<typename _Tp> \
-inline void \
-_Array_augmented_##_Name (_Array<_Tp> __a, size_t __n, _Array<_Tp> __b) \
-{ \
- _Tp* __p (__a._M_data); \
- for (_Tp* __q=__b._M_data; __q<__b._M_data+__n; ++__p, ++__q) \
- *__p _Op##= *__q; \
-} \
- \
-template<typename _Tp, class _Dom> \
-void \
-_Array_augmented_##_Name (_Array<_Tp> __a, \
- const _Expr<_Dom,_Tp>& __e, size_t __n) \
-{ \
- _Tp* __p (__a._M_data); \
- for (size_t __i=0; __i<__n; ++__i, ++__p) *__p _Op##= __e[__i]; \
-} \
- \
-template<typename _Tp> \
-inline void \
-_Array_augmented_##_Name (_Array<_Tp> __a, size_t __n, size_t __s, \
- _Array<_Tp> __b) \
-{ \
- _Tp* __q (__b._M_data); \
- for (_Tp* __p=__a._M_data; __p<__a._M_data+__s*__n; __p+=__s, ++__q) \
- *__p _Op##= *__q; \
-} \
- \
-template<typename _Tp> \
-inline void \
-_Array_augmented_##_Name (_Array<_Tp> __a, _Array<_Tp> __b, \
- size_t __n, size_t __s) \
-{ \
- _Tp* __q (__b._M_data); \
- for (_Tp* __p=__a._M_data; __p<__a._M_data+__n; ++__p, __q+=__s) \
- *__p _Op##= *__q; \
-} \
- \
-template<typename _Tp, class _Dom> \
-void \
-_Array_augmented_##_Name (_Array<_Tp> __a, size_t __s, \
- const _Expr<_Dom,_Tp>& __e, size_t __n) \
-{ \
- _Tp* __p (__a._M_data); \
- for (size_t __i=0; __i<__n; ++__i, __p+=__s) *__p _Op##= __e[__i]; \
-} \
- \
-template<typename _Tp> \
-inline void \
-_Array_augmented_##_Name (_Array<_Tp> __a, _Array<size_t> __i, \
- _Array<_Tp> __b, size_t __n) \
-{ \
- _Tp* __q (__b._M_data); \
- for (size_t* __j=__i._M_data; __j<__i._M_data+__n; ++__j, ++__q) \
- __a._M_data[*__j] _Op##= *__q; \
-} \
- \
-template<typename _Tp> \
-inline void \
-_Array_augmented_##_Name (_Array<_Tp> __a, size_t __n, \
- _Array<_Tp> __b, _Array<size_t> __i) \
-{ \
- _Tp* __p (__a._M_data); \
- for (size_t* __j=__i._M_data; __j<__i._M_data+__n; ++__j, ++__p) \
- *__p _Op##= __b._M_data[*__j]; \
-} \
- \
-template<typename _Tp, class _Dom> \
-void \
-_Array_augmented_##_Name (_Array<_Tp> __a, _Array<size_t> __i, \
- const _Expr<_Dom, _Tp>& __e, size_t __n) \
-{ \
- size_t* __j (__i._M_data); \
- for (size_t __k=0; __k<__n; ++__k, ++__j) \
- __a._M_data[*__j] _Op##= __e[__k]; \
-} \
- \
-template<typename _Tp> \
-void \
-_Array_augmented_##_Name (_Array<_Tp> __a, _Array<bool> __m, \
- _Array<_Tp> __b, size_t __n) \
-{ \
- bool* ok (__m._M_data); \
- _Tp* __p (__a._M_data); \
- for (_Tp* __q=__b._M_data; __q<__b._M_data+__n; ++__q, ++ok, ++__p) { \
- while (! *ok) { \
- ++ok; \
- ++__p; \
- } \
- *__p _Op##= *__q; \
- } \
-} \
- \
-template<typename _Tp> \
-void \
-_Array_augmented_##_Name (_Array<_Tp> __a, size_t __n, \
- _Array<_Tp> __b, _Array<bool> __m) \
-{ \
- bool* ok (__m._M_data); \
- _Tp* __q (__b._M_data); \
- for (_Tp* __p=__a._M_data; __p<__a._M_data+__n; ++__p, ++ok, ++__q) { \
- while (! *ok) { \
- ++ok; \
- ++__q; \
- } \
- *__p _Op##= *__q; \
- } \
-} \
- \
-template<typename _Tp, class _Dom> \
-void \
-_Array_augmented_##_Name (_Array<_Tp> __a, _Array<bool> __m, \
- const _Expr<_Dom, _Tp>& __e, size_t __n) \
-{ \
- bool* ok(__m._M_data); \
- _Tp* __p (__a._M_data); \
- for (size_t __i=0; __i<__n; ++__i, ++ok, ++__p) { \
- while (! *ok) { \
- ++ok; \
- ++__p; \
- } \
- *__p _Op##= __e[__i]; \
- } \
-}
-
-_DEFINE_ARRAY_FUNCTION(+, plus)
-_DEFINE_ARRAY_FUNCTION(-, minus)
-_DEFINE_ARRAY_FUNCTION(*, multiplies)
-_DEFINE_ARRAY_FUNCTION(/, divides)
-_DEFINE_ARRAY_FUNCTION(%, modulus)
-_DEFINE_ARRAY_FUNCTION(^, xor)
-_DEFINE_ARRAY_FUNCTION(|, or)
-_DEFINE_ARRAY_FUNCTION(&, and)
-_DEFINE_ARRAY_FUNCTION(<<, shift_left)
-_DEFINE_ARRAY_FUNCTION(>>, shift_right)
-
-#undef _DEFINE_ARRAY_FUNCTION
-
-} // extern "C++"
-
-#ifdef _G_NO_VALARRAY_TEMPLATE_EXPORT
-# define export
-# include <std/valarray_array.tcc>
-#endif
-
-#endif // __VALARRAY_ARRAY__
-
-// Local Variables:
-// mode:c++
-// End:
diff --git a/contrib/libstdc++/std/valarray_array.tcc b/contrib/libstdc++/std/valarray_array.tcc
deleted file mode 100644
index bd6692571fdd..000000000000
--- a/contrib/libstdc++/std/valarray_array.tcc
+++ /dev/null
@@ -1,130 +0,0 @@
-// The template and inlines for the -*- C++ -*- internal _Array helper class.
-
-// Copyright (C) 1997-1999 Cygnus Solutions
-//
-// This file is part of the GNU ISO C++ 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, you may use this file as part of a free software
-// library without restriction. Specifically, if other files instantiate
-// templates or use macros or inline functions from this file, or you compile
-// this file and link it with other files to produce an executable, this
-// file does not by itself cause the resulting executable to be covered by
-// the GNU General Public License. This exception does not however
-// invalidate any other reasons why the executable file might be covered by
-// the GNU General Public License.
-
-// Written by Gabriel Dos Reis <Gabriel.Dos-Reis@DPTMaths.ENS-Cachan.Fr>
-
-#ifndef __VALARRAY_ARRAY_TCC__
-#define __VALARRAY_ARRAY_TCC__
-
-extern "C++" {
-
-export template<typename _Tp>
-void
-__valarray_fill (_Array<_Tp> __a, size_t __n, _Array<bool> __m, const _Tp& __t)
-{
- _Tp* __p = __a._M_data;
- bool* __ok (__m._M_data);
- for (size_t __i=0; __i<__n; ++__i, ++__ok, ++__p) {
- while (! *__ok) {
- ++__ok;
- ++__p;
- }
- *__p = __t;
- }
-}
-
-export template<typename _Tp>
-void
-__valarray_copy (_Array<_Tp> __a, _Array<bool> __m, _Array<_Tp> __b, size_t __n)
-{
- _Tp* __p (__a._M_data);
- bool* __ok (__m._M_data);
- for (_Tp* __q=__b._M_data; __q<__b._M_data+__n; ++__q, ++__ok, ++__p) {
- while (! *__ok) {
- ++__ok;
- ++__p;
- }
- *__q = *__p;
- }
-}
-
-export template<typename _Tp>
-void
-__valarray_copy (_Array<_Tp> __a, size_t __n, _Array<_Tp> __b, _Array<bool> __m)
-{
- _Tp* __q (__b._M_data);
- bool* __ok (__m._M_data);
- for (_Tp* __p=__a._M_data; __p<__a._M_data+__n; ++__p, ++__ok, ++__q) {
- while (! *__ok) {
- ++__ok;
- ++__q;
- }
- *__q = *__p;
- }
-}
-
-export template<typename _Tp, class _Dom>
-void
-__valarray_copy (const _Expr<_Dom, _Tp>& __e, size_t __n, _Array<_Tp> __a)
-{
- _Tp* __p (__a._M_data);
- for (size_t __i=0; __i<__n; ++__i, ++__p) *__p = __e[__i];
-}
-
-export template<typename _Tp, class _Dom>
-void
-__valarray_copy (const _Expr<_Dom, _Tp>& __e, size_t __n,
- _Array<_Tp> __a, size_t __s)
-{
- _Tp* __p (__a._M_data);
- for (size_t __i=0; __i<__n; ++__i, __p+=__s) *__p = __e[__i];
-}
-
-export template<typename _Tp, class _Dom>
-void
-__valarray_copy (const _Expr<_Dom, _Tp>& __e, size_t __n,
- _Array<_Tp> __a, _Array<size_t> __i)
-{
- size_t* __j (__i._M_data);
- for (size_t __k=0; __k<__n; ++__k, ++__j) __a._M_data[*__j] = __e[__k];
-}
-
-export template<typename _Tp, class _Dom>
-void
-__valarray_copy (const _Expr<_Dom, _Tp>& __e, size_t __n,
- _Array<_Tp> __a, _Array<bool> __m)
-{
- bool* __ok (__m._M_data);
- _Tp* __p (__a._M_data);
- for (size_t __i=0; __i<__n; ++__i, ++__ok, ++__p) {
- while (! *__ok) {
- ++__ok;
- ++__p;
- }
- *__p = __e[__i];
- }
-}
-
-} // extern "C++"
-
-#endif // __VALARRAY_ARRAY_TCC__
-
-// Local Variables:
-// mode:c++
-// End:
diff --git a/contrib/libstdc++/std/valarray_meta.h b/contrib/libstdc++/std/valarray_meta.h
deleted file mode 100644
index 48fb21371f77..000000000000
--- a/contrib/libstdc++/std/valarray_meta.h
+++ /dev/null
@@ -1,1046 +0,0 @@
-// The template and inlines for the -*- C++ -*- internal _Meta class.
-
-// Copyright (C) 1997-1999 Cygnus Solutions
-//
-// This file is part of the GNU ISO C++ 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, you may use this file as part of a free software
-// library without restriction. Specifically, if other files instantiate
-// templates or use macros or inline functions from this file, or you compile
-// this file and link it with other files to produce an executable, this
-// file does not by itself cause the resulting executable to be covered by
-// the GNU General Public License. This exception does not however
-// invalidate any other reasons why the executable file might be covered by
-// the GNU General Public License.
-
-// Written by Gabriel Dos Reis <Gabriel.Dos-Reis@cmla.ens-cachan.fr>
-
-#ifndef _CPP_VALARRAY_META_H
-#define _CPP_VALARRAY_META_H 1
-
-//
-// Implementing a loosened valarray return value is tricky.
-// First we need to meet 26.3.1/3: we should not add more than
-// two levels of template nesting. Therefore we resort to template
-// template to "flatten" loosened return value types.
-// At some point we use partial specialization to remove one level
-// template nesting due to _Expr<>
-//
-
-
-// This class is NOT defined. It doesn't need to.
-template<typename _Tp1, typename _Tp2> class _Constant;
-
-//
-// Unary function application closure.
-//
-template<class _Dom> class _UnFunBase {
-public:
- typedef typename _Dom::value_type value_type;
- typedef value_type _Vt;
-
- _UnFunBase (const _Dom& __e, _Vt __f(_Vt))
- : _M_expr(__e), _M_func(__f) {}
-
- _Vt operator[] (size_t __i) const { return _M_func(_M_expr[__i]); }
- size_t size () const { return _M_expr.size(); }
-
-private:
- const _Dom& _M_expr;
- _Vt (*_M_func)(_Vt);
-};
-
-template<template<class, class> class _Meta, class _Dom> class _UnFunClos;
-
-template<class _Dom>
-struct _UnFunClos<_Expr,_Dom> : _UnFunBase<_Dom> {
- typedef _UnFunBase<_Dom> _Base;
- typedef typename _Base::value_type value_type;
-
- _UnFunClos (const _Dom& __e, value_type __f(value_type))
- : _Base (__e, __f) {}
-};
-
-template<typename _Tp>
-struct _UnFunClos<_ValArray,_Tp> : _UnFunBase<valarray<_Tp> > {
- typedef _UnFunBase<valarray<_Tp> > _Base;
- typedef typename _Base::value_type value_type;
-
- _UnFunClos (const valarray<_Tp>& __v, _Tp __f(_Tp))
- : _Base (__v, __f) {}
-};
-
-//
-// Binary function application closure.
-//
-template<template<class, class> class _Meta1,
- template<class, class> class Meta2,
- class _Dom1, class _Dom2> class _BinFunClos;
-
-template<class _Dom1, class _Dom2> class _BinFunBase {
-public:
- typedef typename _Dom1::value_type value_type;
- typedef value_type _Vt;
-
- _BinFunBase (const _Dom1& __e1, const _Dom2& __e2,
- _Vt __f (_Vt, _Vt))
- : _M_expr1 (__e1), _M_expr2 (__e2), _M_func (__f) {}
-
- value_type operator[] (size_t __i) const
- { return _M_func (_M_expr1[__i], _M_expr2[__i]); }
- size_t size () const { return _M_expr1.size (); }
-
-private:
- const _Dom1& _M_expr1;
- const _Dom2& _M_expr2;
- _Vt (*_M_func)(_Vt, _Vt);
-};
-
-template<class _Dom> class _BinFunBase1 {
-public:
- typedef typename _Dom::value_type value_type ;
- typedef value_type _Vt;
-
- _BinFunBase1 (const _Vt& __c, const _Dom& __e, _Vt __f(_Vt, _Vt))
- : _M_expr1 (__c), _M_expr2 (__e), _M_func (__f) {}
-
- value_type operator[] (size_t __i) const
- { return _M_func (_M_expr1, _M_expr2[__i]); }
- size_t size () const { return _M_expr2.size (); }
-
-private:
- const _Vt& _M_expr1;
- const _Dom& _M_expr2;
- _Vt (*_M_func)(_Vt, _Vt);
-};
-
-template<class _Dom> class _BinFunBase2 {
-public:
- typedef typename _Dom::value_type value_type;
- typedef value_type _Vt;
-
- _BinFunBase2 (const _Dom& __e, const _Vt& __c, _Vt __f(_Vt, _Vt))
- : _M_expr1 (__e), _M_expr2 (__c), _M_func (__f) {}
-
- value_type operator[] (size_t __i) const
- { return _M_func (_M_expr1[__i], _M_expr2); }
- size_t size () const { return _M_expr1.size (); }
-
-private:
- const _Dom& _M_expr1;
- const _Vt& _M_expr2;
- _Vt (*_M_func)(_Vt, _Vt);
-};
-
-template<class _Dom1, class _Dom2>
-struct _BinFunClos<_Expr,_Expr,_Dom1,_Dom2> : _BinFunBase<_Dom1,_Dom2> {
- typedef _BinFunBase<_Dom1,_Dom2> _Base;
- typedef typename _Base::value_type value_type;
- typedef value_type _Tp;
-
- _BinFunClos (const _Dom1& __e1, const _Dom2& __e2,
- _Tp __f(_Tp, _Tp))
- : _Base (__e1, __e2, __f) {}
-};
-
-template<typename _Tp>
-struct _BinFunClos<_ValArray,_ValArray,_Tp,_Tp>
- : _BinFunBase<valarray<_Tp>, valarray<_Tp> > {
- typedef _BinFunBase<valarray<_Tp>, valarray<_Tp> > _Base;
- typedef _Tp value_type;
-
- _BinFunClos (const valarray<_Tp>& __v, const valarray<_Tp>& __w,
- _Tp __f(_Tp, _Tp))
- : _Base (__v, __w, __f) {}
-};
-
-template<class _Dom>
-struct _BinFunClos<_Expr,_ValArray,_Dom,typename _Dom::value_type>
- : _BinFunBase<_Dom,valarray<typename _Dom::value_type> > {
- typedef typename _Dom::value_type _Tp;
- typedef _BinFunBase<_Dom,valarray<_Tp> > _Base;
- typedef _Tp value_type;
-
- _BinFunClos (const _Dom& __e, const valarray<_Tp>& __v,
- _Tp __f(_Tp, _Tp))
- : _Base (__e, __v, __f) {}
-};
-
-template<class _Dom>
-struct _BinFunClos<_ValArray,_Expr,typename _Dom::value_type,_Dom>
- : _BinFunBase<valarray<typename _Dom::value_type>,_Dom> {
- typedef typename _Dom::value_type _Tp;
- typedef _BinFunBase<_Dom,valarray<_Tp> > _Base;
- typedef _Tp value_type;
-
- _BinFunClos (const valarray<_Tp>& __v, const _Dom& __e,
- _Tp __f(_Tp, _Tp))
- : _Base (__v, __e, __f) {}
-};
-
-template<class _Dom>
-struct _BinFunClos<_Expr,_Constant,_Dom,typename _Dom::value_type>
- : _BinFunBase2<_Dom> {
- typedef typename _Dom::value_type _Tp;
- typedef _Tp value_type;
- typedef _BinFunBase2<_Dom> _Base;
-
- _BinFunClos (const _Dom& __e, const _Tp& __t, _Tp __f (_Tp, _Tp))
- : _Base (__e, __t, __f) {}
-};
-
-template<class _Dom>
-struct _BinFunClos<_Constant,_Expr,_Dom,typename _Dom::value_type>
- : _BinFunBase1<_Dom> {
- typedef typename _Dom::value_type _Tp;
- typedef _Tp value_type;
- typedef _BinFunBase1<_Dom> _Base;
-
- _BinFunClos (const _Tp& __t, const _Dom& __e, _Tp __f (_Tp, _Tp))
- : _Base (__t, __e, __f) {}
-};
-
-template<typename _Tp>
-struct _BinFunClos<_ValArray,_Constant,_Tp,_Tp>
- : _BinFunBase2<valarray<_Tp> > {
- typedef _BinFunBase2<valarray<_Tp> > _Base;
- typedef _Tp value_type;
-
- _BinFunClos (const valarray<_Tp>& __v, const _Tp& __t,
- _Tp __f(_Tp, _Tp))
- : _Base (__v, __t, __f) {}
-};
-
-template<typename _Tp>
-struct _BinFunClos<_Constant,_ValArray,_Tp,_Tp>
- : _BinFunBase1<valarray<_Tp> > {
- typedef _BinFunBase1<valarray<_Tp> > _Base;
- typedef _Tp value_type;
-
- _BinFunClos (const _Tp& __t, const valarray<_Tp>& __v,
- _Tp __f (_Tp, _Tp))
- : _Base (__t, __v, __f) {}
-};
-
-//
-// Apply function taking a value/const reference closure
-//
-
-template<typename _Dom, typename _Arg> class _FunBase {
-public:
- typedef typename _Dom::value_type value_type;
-
- _FunBase (const _Dom& __e, value_type __f(_Arg))
- : _M_expr (__e), _M_func (__f) {}
-
- value_type operator[] (size_t __i) const
- { return _M_func (_M_expr[__i]); }
- size_t size() const { return _M_expr.size ();}
-
-private:
- const _Dom& _M_expr;
- value_type (*_M_func)(_Arg);
-};
-
-template<class _Dom>
-struct _ValFunClos<_Expr,_Dom>
- : _FunBase<_Dom, typename _Dom::value_type> {
- typedef _FunBase<_Dom, typename _Dom::value_type> _Base;
- typedef typename _Base::value_type value_type;
- typedef value_type _Tp;
-
- _ValFunClos (const _Dom& __e, _Tp __f (_Tp)) : _Base (__e, __f) {}
-};
-
-template<typename _Tp>
-struct _ValFunClos<_ValArray,_Tp>
- : _FunBase<valarray<_Tp>, _Tp> {
- typedef _FunBase<valarray<_Tp>, _Tp> _Base;
- typedef _Tp value_type;
-
- _ValFunClos (const valarray<_Tp>& __v, _Tp __f(_Tp))
- : _Base (__v, __f) {}
-};
-
-template<class _Dom>
-struct _RefFunClos<_Expr,_Dom> :
- _FunBase<_Dom, const typename _Dom::value_type&> {
- typedef _FunBase<_Dom, const typename _Dom::value_type&> _Base;
- typedef typename _Base::value_type value_type;
- typedef value_type _Tp;
-
- _RefFunClos (const _Dom& __e, _Tp __f (const _Tp&))
- : _Base (__e, __f) {}
-};
-
-template<typename _Tp>
-struct _RefFunClos<_ValArray,_Tp>
- : _FunBase<valarray<_Tp>, const _Tp&> {
- typedef _FunBase<valarray<_Tp>, const _Tp&> _Base;
- typedef _Tp value_type;
-
- _RefFunClos (const valarray<_Tp>& __v, _Tp __f(const _Tp&))
- : _Base (__v, __f) {}
-};
-
-//
-// Unary expression closure.
-//
-
-template<template<class> class _Oper, typename _Arg>
-class _UnBase {
-public:
- typedef _Oper<typename _Arg::value_type> _Op;
- typedef typename _Op::result_type value_type;
-
- _UnBase (const _Arg& __e) : _M_expr(__e) {}
- value_type operator[] (size_t) const;
- size_t size () const { return _M_expr.size (); }
-
-private:
- const _Arg& _M_expr;
-};
-
-template<template<class> class _Oper, typename _Arg>
-inline typename _UnBase<_Oper, _Arg>::value_type
-_UnBase<_Oper, _Arg>::operator[] (size_t __i) const
-{ return _Op() (_M_expr[__i]); }
-
-template<template<class> class _Oper, class _Dom>
-struct _UnClos<_Oper, _Expr, _Dom> : _UnBase<_Oper, _Dom> {
- typedef _Dom _Arg;
- typedef _UnBase<_Oper, _Dom> _Base;
- typedef typename _Base::value_type value_type;
-
- _UnClos (const _Arg& __e) : _Base(__e) {}
-};
-
-template<template<class> class _Oper, typename _Tp>
-struct _UnClos<_Oper, _ValArray, _Tp> : _UnBase<_Oper, valarray<_Tp> > {
- typedef valarray<_Tp> _Arg;
- typedef _UnBase<_Oper, valarray<_Tp> > _Base;
- typedef typename _Base::value_type value_type;
-
- _UnClos (const _Arg& __e) : _Base(__e) {}
-};
-
-
-//
-// Binary expression closure.
-//
-
-template<template<class> class _Oper, typename _FirstArg, typename _SecondArg>
-class _BinBase {
-public:
- typedef _Oper<typename _FirstArg::value_type> _Op;
- typedef typename _Op::result_type value_type;
-
- _BinBase (const _FirstArg& __e1, const _SecondArg& __e2)
- : _M_expr1 (__e1), _M_expr2 (__e2) {}
- value_type operator[] (size_t) const;
- size_t size () const { return _M_expr1.size (); }
-
-private:
- const _FirstArg& _M_expr1;
- const _SecondArg& _M_expr2;
-};
-
-template<template<class> class _Oper, typename _FirstArg, typename _SecondArg>
-inline typename _BinBase<_Oper,_FirstArg,_SecondArg>::value_type
-_BinBase<_Oper,_FirstArg,_SecondArg>::operator[] (size_t __i) const
-{ return _Op() (_M_expr1[__i], _M_expr2[__i]); }
-
-
-template<template<class> class _Oper, class _Clos>
-class _BinBase2 {
-public:
- typedef typename _Clos::value_type _Vt;
- typedef _Oper<_Vt> _Op;
- typedef typename _Op::result_type value_type;
-
- _BinBase2 (const _Clos& __e, const _Vt& __t)
- : _M_expr1 (__e), _M_expr2 (__t) {}
- value_type operator[] (size_t) const;
- size_t size () const { return _M_expr1.size (); }
-
-private:
- const _Clos& _M_expr1;
- const _Vt& _M_expr2;
-};
-
-template<template<class> class _Oper, class _Clos>
-inline typename _BinBase2<_Oper,_Clos>::value_type
-_BinBase2<_Oper,_Clos>::operator[] (size_t __i) const
-{ return _Op() (_M_expr1[__i], _M_expr2); }
-
-
-template<template<class> class _Oper, class _Clos>
-class _BinBase1 {
-public:
- typedef typename _Clos::value_type _Vt;
- typedef _Oper<_Vt> _Op;
- typedef typename _Op::result_type value_type;
-
- _BinBase1 (const _Vt& __t, const _Clos& __e)
- : _M_expr1 (__t), _M_expr2 (__e) {}
- value_type operator[] (size_t) const;
- size_t size () const { return _M_expr2.size (); }
-
-private:
- const _Vt& _M_expr1;
- const _Clos& _M_expr2;
-};
-
-template<template<class> class _Oper, class _Clos>
-inline typename
-_BinBase1<_Oper,_Clos>::value_type
-_BinBase1<_Oper,_Clos>:: operator[] (size_t __i) const
-{ return _Op() (_M_expr1, _M_expr2[__i]); }
-
-
-template<template<class> class _Oper, class _Dom1, class _Dom2>
-struct _BinClos<_Oper, _Expr, _Expr, _Dom1, _Dom2>
- : _BinBase<_Oper,_Dom1,_Dom2> {
- typedef _BinBase<_Oper,_Dom1,_Dom2> _Base;
- typedef typename _Base::value_type value_type;
-
- _BinClos(const _Dom1& __e1, const _Dom2& __e2) : _Base(__e1, __e2) {}
-};
-
-template<template<class> class _Oper, typename _Tp>
-struct _BinClos<_Oper,_ValArray,_ValArray,_Tp,_Tp>
- : _BinBase<_Oper,valarray<_Tp>,valarray<_Tp> > {
- typedef _BinBase<_Oper,valarray<_Tp>,valarray<_Tp> > _Base;
- typedef _Tp value_type;
-
- _BinClos (const valarray<_Tp>& __v, const valarray<_Tp>& __w)
- : _Base (__v, __w) {}
-};
-
-template<template<class> class _Oper, class _Dom>
-struct _BinClos<_Oper,_Expr,_ValArray,_Dom,typename _Dom::value_type>
- : _BinBase<_Oper,_Dom,valarray<typename _Dom::value_type> > {
- typedef typename _Dom::value_type _Tp;
- typedef _BinBase<_Oper,_Dom,valarray<_Tp> > _Base;
- typedef typename _Base::value_type value_type;
-
- _BinClos(const _Dom& __e1, const valarray<_Tp>& __e2)
- : _Base (__e1, __e2) {}
-};
-
-template<template<class> class _Oper, class _Dom>
-struct _BinClos<_Oper,_ValArray,_Expr,typename _Dom::value_type,_Dom>
- : _BinBase<_Oper,valarray<typename _Dom::value_type>,_Dom> {
- typedef typename _Dom::value_type _Tp;
- typedef _BinBase<_Oper,valarray<_Tp>,_Dom> _Base;
- typedef typename _Base::value_type value_type;
-
- _BinClos (const valarray<_Tp>& __e1, const _Dom& __e2)
- : _Base (__e1, __e2) {}
-};
-
-template<template<class> class _Oper, class _Dom>
-struct _BinClos<_Oper,_Expr,_Constant,_Dom,typename _Dom::value_type>
- : _BinBase2<_Oper,_Dom> {
- typedef typename _Dom::value_type _Tp;
- typedef _BinBase2<_Oper,_Dom> _Base;
- typedef typename _Base::value_type value_type;
-
- _BinClos (const _Dom& __e1, const _Tp& __e2) : _Base (__e1, __e2) {}
-};
-
-template<template<class> class _Oper, class _Dom>
-struct _BinClos<_Oper,_Constant,_Expr,typename _Dom::value_type,_Dom>
- : _BinBase1<_Oper,_Dom> {
- typedef typename _Dom::value_type _Tp;
- typedef _BinBase1<_Oper,_Dom> _Base;
- typedef typename _Base::value_type value_type;
-
- _BinClos (const _Tp& __e1, const _Dom& __e2) : _Base (__e1, __e2) {}
-};
-
-template<template<class> class _Oper, typename _Tp>
-struct _BinClos<_Oper,_ValArray,_Constant,_Tp,_Tp>
- : _BinBase2<_Oper,valarray<_Tp> > {
- typedef _BinBase2<_Oper,valarray<_Tp> > _Base;
- typedef typename _Base::value_type value_type;
-
- _BinClos (const valarray<_Tp>& __v, const _Tp& __t)
- : _Base (__v, __t) {}
-};
-
-template<template<class> class _Oper, typename _Tp>
-struct _BinClos<_Oper,_Constant,_ValArray,_Tp,_Tp>
- : _BinBase1<_Oper,valarray<_Tp> > {
- typedef _BinBase1<_Oper,valarray<_Tp> > _Base;
- typedef typename _Base::value_type value_type;
-
- _BinClos (const _Tp& __t, const valarray<_Tp>& __v)
- : _Base (__t, __v) {}
-};
-
-
-//
-// slice_array closure.
-//
-template<typename _Dom> class _SBase {
-public:
- typedef typename _Dom::value_type value_type;
-
- _SBase (const _Dom& __e, const slice& __s)
- : _M_expr (__e), _M_slice (__s) {}
- value_type operator[] (size_t __i) const
- { return _M_expr[_M_slice.start () + __i * _M_slice.stride ()]; }
- size_t size() const { return _M_slice.size (); }
-
-private:
- const _Dom& _M_expr;
- const slice& _M_slice;
-};
-
-template<typename _Tp> class _SBase<_Array<_Tp> > {
-public:
- typedef _Tp value_type;
-
- _SBase (_Array<_Tp> __a, const slice& __s)
- : _M_array (__a._M_data+__s.start()), _M_size (__s.size()),
- _M_stride (__s.stride()) {}
- value_type operator[] (size_t __i) const
- { return _M_array._M_data[__i * _M_stride]; }
- size_t size() const { return _M_size; }
-
-private:
- const _Array<_Tp> _M_array;
- const size_t _M_size;
- const size_t _M_stride;
-};
-
-template<class _Dom> struct _SClos<_Expr,_Dom> : _SBase<_Dom> {
- typedef _SBase<_Dom> _Base;
- typedef typename _Base::value_type value_type;
-
- _SClos (const _Dom& __e, const slice& __s) : _Base (__e, __s) {}
-};
-
-template<typename _Tp>
-struct _SClos<_ValArray,_Tp> : _SBase<_Array<_Tp> > {
- typedef _SBase<_Array<_Tp> > _Base;
- typedef _Tp value_type;
-
- _SClos (_Array<_Tp> __a, const slice& __s) : _Base (__a, __s) {}
-};
-
-//
-// gslice_array closure.
-//
-template<class _Dom> class _GBase {
-public:
- typedef typename _Dom::value_type value_type;
-
- _GBase (const _Dom& __e, const valarray<size_t>& __i)
- : _M_expr (__e), _M_index(__i) {}
- value_type operator[] (size_t __i) const
- { return _M_expr[_M_index[__i]]; }
- size_t size () const { return _M_index.size(); }
-
-private:
- const _Dom& _M_expr;
- const valarray<size_t>& _M_index;
-};
-
-template<typename _Tp> class _GBase<_Array<_Tp> > {
-public:
- typedef _Tp value_type;
-
- _GBase (_Array<_Tp> __a, const valarray<size_t>& __i)
- : _M_array (__a), _M_index(__i) {}
- value_type operator[] (size_t __i) const
- { return _M_array._M_data[_M_index[__i]]; }
- size_t size () const { return _M_index.size(); }
-
-private:
- const _Array<_Tp> _M_array;
- const valarray<size_t>& _M_index;
-};
-
-template<class _Dom> struct _GClos<_Expr,_Dom> : _GBase<_Dom> {
- typedef _GBase<_Dom> _Base;
- typedef typename _Base::value_type value_type;
-
- _GClos (const _Dom& __e, const valarray<size_t>& __i)
- : _Base (__e, __i) {}
-};
-
-template<typename _Tp>
-struct _GClos<_ValArray,_Tp> : _GBase<_Array<_Tp> > {
- typedef _GBase<_Array<_Tp> > _Base;
- typedef typename _Base::value_type value_type;
-
- _GClos (_Array<_Tp> __a, const valarray<size_t>& __i)
- : _Base (__a, __i) {}
-};
-
-//
-// indirect_array closure
-//
-
-template<class _Dom> class _IBase {
-public:
- typedef typename _Dom::value_type value_type;
-
- _IBase (const _Dom& __e, const valarray<size_t>& __i)
- : _M_expr (__e), _M_index (__i) {}
- value_type operator[] (size_t __i) const
- { return _M_expr[_M_index[__i]]; }
- size_t size() const { return _M_index.size(); }
-
-private:
- const _Dom& _M_expr;
- const valarray<size_t>& _M_index;
-};
-
-template<class _Dom> struct _IClos<_Expr,_Dom> : _IBase<_Dom> {
- typedef _IBase<_Dom> _Base;
- typedef typename _Base::value_type value_type;
-
- _IClos (const _Dom& __e, const valarray<size_t>& __i)
- : _Base (__e, __i) {}
-};
-
-template<typename _Tp>
-struct _IClos<_ValArray,_Tp> : _IBase<valarray<_Tp> > {
- typedef _IBase<valarray<_Tp> > _Base;
- typedef _Tp value_type;
-
- _IClos (const valarray<_Tp>& __a, const valarray<size_t>& __i)
- : _Base (__a, __i) {}
-};
-
-//
-// class _Expr
-//
-template<class _Clos, typename _Tp> class _Expr {
-public:
- typedef _Tp value_type;
-
- _Expr (const _Clos&);
-
- const _Clos& operator() () const;
-
- value_type operator[] (size_t) const;
- valarray<value_type> operator[] (slice) const;
- valarray<value_type> operator[] (const gslice&) const;
- valarray<value_type> operator[] (const valarray<bool>&) const;
- valarray<value_type> operator[] (const valarray<size_t>&) const;
-
- _Expr<_UnClos<_Unary_plus,_Expr,_Clos>, value_type>
- operator+ () const;
-
- _Expr<_UnClos<negate,_Expr,_Clos>, value_type>
- operator- () const;
-
- _Expr<_UnClos<_Bitwise_not,_Expr,_Clos>, value_type>
- operator~ () const;
-
- _Expr<_UnClos<logical_not,_Expr,_Clos>, bool>
- operator! () const;
-
- size_t size () const;
- value_type sum () const;
-
- valarray<value_type> shift (int) const;
- valarray<value_type> cshift (int) const;
-// _Meta<_ApplyFunctionWithValue<_Expr>, value_type>
-// apply (value_type _M_func (value_type)) const;
-// _Meta<_ApplyFunctionWithConstRef<_Expr>, value_type>
-// apply (value_type _M_func (const value_type&)) const;
-
-private:
- const _Clos _M_closure;
-};
-
-template<class _Clos, typename _Tp>
-inline
-_Expr<_Clos,_Tp>::_Expr (const _Clos& __c) : _M_closure(__c) {}
-
-template<class _Clos, typename _Tp>
-inline const _Clos&
-_Expr<_Clos,_Tp>::operator() () const
-{ return _M_closure; }
-
-template<class _Clos, typename _Tp>
-inline _Tp
-_Expr<_Clos,_Tp>::operator[] (size_t __i) const
-{ return _M_closure[__i]; }
-
-template<class _Clos, typename _Tp>
-inline valarray<_Tp>
-_Expr<_Clos,_Tp>::operator[] (slice __s) const
-{ return _M_closure[__s]; }
-
-template<class _Clos, typename _Tp>
-inline valarray<_Tp>
-_Expr<_Clos,_Tp>::operator[] (const gslice& __gs) const
-{ return _M_closure[__gs]; }
-
-template<class _Clos, typename _Tp>
-inline valarray<_Tp>
-_Expr<_Clos,_Tp>::operator[] (const valarray<bool>& __m) const
-{ return _M_closure[__m]; }
-
-template<class _Clos, typename _Tp>
-inline valarray<_Tp>
-_Expr<_Clos,_Tp>::operator[] (const valarray<size_t>& __i) const
-{ return _M_closure[__i]; }
-
-template<class _Clos, typename _Tp>
-inline size_t
-_Expr<_Clos,_Tp>::size () const { return _M_closure.size (); }
-
-// XXX: replace this with a more robust summation algorithm.
-template<class _Clos, typename _Tp>
-inline _Tp
-_Expr<_Clos,_Tp>::sum () const
-{
- _Tp __s(_Tp());
- size_t __n (_M_closure.size ());
- for (size_t __i=0; __i<__n; ++__i) __s += _M_closure[__i];
- return __s;
-}
-
-template<class _Dom, typename _Tp>
-inline _Tp
-min (const _Expr<_Dom,_Tp>& __e)
-{
- size_t __s (__e.size ());
- _Tp __m (__e[0]);
- for (size_t __i=1; __i<__s; ++__i)
- if (__m > __e[__i]) __m = __e[__i];
- return __m;
-}
-
-template<class _Dom, typename _Tp>
-inline _Tp
-max (const _Expr<_Dom,_Tp>& __e)
-{
- size_t __s (__e.size());
- _Tp __m (__e[0]);
- for (size_t __i=1; __i<__s; ++__i)
- if (__m < __e[__i]) __m = __e[__i];
- return __m;
-}
-
-template<class _Dom, typename _Tp>
-inline _Expr<_UnClos<logical_not,_Expr,_Dom>, bool>
-_Expr<_Dom,_Tp>::operator! () const
-{
- typedef _UnClos<logical_not,_Expr,_Dom> _Closure;
- return _Expr<_Closure,_Tp> (_Closure(this->_M_closure));
-}
-
-#define _DEFINE_EXPR_UNARY_OPERATOR(_Op, _Name) \
-template<class _Dom, typename _Tp> \
-inline _Expr<_UnClos<_Name,_Expr,_Dom>,_Tp> \
-_Expr<_Dom,_Tp>::operator##_Op () const \
-{ \
- typedef _UnClos<_Name,_Expr,_Dom> _Closure; \
- return _Expr<_Closure,_Tp> (_Closure (this->_M_closure)); \
-}
-
- _DEFINE_EXPR_UNARY_OPERATOR(+, _Unary_plus)
- _DEFINE_EXPR_UNARY_OPERATOR(-, negate)
- _DEFINE_EXPR_UNARY_OPERATOR(~, _Bitwise_not)
-
-#undef _DEFINE_EXPR_UNARY_OPERATOR
-
-
-#define _DEFINE_EXPR_BINARY_OPERATOR(_Op, _Name) \
-template<class _Dom1, class _Dom2> \
-inline _Expr<_BinClos<_Name,_Expr,_Expr,_Dom1,_Dom2>, \
- typename _Name<typename _Dom1::value_type>::result_type> \
-operator##_Op (const _Expr<_Dom1,typename _Dom1::value_type>& __v, \
- const _Expr<_Dom2,typename _Dom2::value_type>& __w) \
-{ \
- typedef typename _Dom1::value_type _Arg; \
- typedef typename _Name<_Arg>::result_type _Value; \
- typedef _BinClos<_Name,_Expr,_Expr,_Dom1,_Dom2> _Closure; \
- return _Expr<_Closure,_Value> (_Closure (__v (), __w ())); \
-} \
- \
-template<class _Dom> \
-inline _Expr<_BinClos<_Name,_Expr,_Constant,_Dom,typename _Dom::value_type>, \
- typename _Name<typename _Dom::value_type>::result_type> \
-operator##_Op (const _Expr<_Dom,typename _Dom::value_type>& __v, \
- const typename _Dom::value_type& __t) \
-{ \
- typedef typename _Dom::value_type _Arg; \
- typedef typename _Name<_Arg>::result_type _Value; \
- typedef _BinClos<_Name,_Expr,_Constant,_Dom,_Arg> _Closure; \
- return _Expr<_Closure,_Value> (_Closure (__v (), __t)); \
-} \
- \
-template<class _Dom> \
-inline _Expr<_BinClos<_Name,_Constant,_Expr,typename _Dom::value_type,_Dom>, \
- typename _Name<typename _Dom::value_type>::result_type> \
-operator##_Op (const typename _Dom::value_type& __t, \
- const _Expr<_Dom,typename _Dom::value_type>& __v) \
-{ \
- typedef typename _Dom::value_type _Arg; \
- typedef typename _Name<_Arg>::result_type _Value; \
- typedef _BinClos<_Name,_Constant,_Expr,_Arg,_Dom> _Closure; \
- return _Expr<_Closure,_Value> (_Closure (__t, __v ())); \
-} \
- \
-template<class _Dom> \
-inline _Expr<_BinClos<_Name,_Expr,_ValArray,_Dom,typename _Dom::value_type>, \
- typename _Name<typename _Dom::value_type>::result_type> \
-operator##_Op (const _Expr<_Dom,typename _Dom::value_type>& __e, \
- const valarray<typename _Dom::value_type>& __v) \
-{ \
- typedef typename _Dom::value_type _Arg; \
- typedef typename _Name<_Arg>::result_type _Value; \
- typedef _BinClos<_Name,_Expr,_ValArray,_Dom,_Arg> _Closure; \
- return _Expr<_Closure,_Value> (_Closure (__e (), __v)); \
-} \
- \
-template<class _Dom> \
-inline _Expr<_BinClos<_Name,_ValArray,_Expr,typename _Dom::value_type,_Dom>, \
- typename _Name<typename _Dom::value_type>::result_type> \
-operator##_Op (const valarray<typename _Dom::value_type>& __v, \
- const _Expr<_Dom,typename _Dom::value_type>& __e) \
-{ \
- typedef typename _Dom::value_type _Tp; \
- typedef typename _Name<_Tp>::result_type _Value; \
- typedef _BinClos<_Name,_ValArray,_Expr,_Tp,_Dom> _Closure; \
- return _Expr<_Closure,_Value> (_Closure (__v, __e ())); \
-}
-
- _DEFINE_EXPR_BINARY_OPERATOR(+, plus)
- _DEFINE_EXPR_BINARY_OPERATOR(-, minus)
- _DEFINE_EXPR_BINARY_OPERATOR(*, multiplies)
- _DEFINE_EXPR_BINARY_OPERATOR(/, divides)
- _DEFINE_EXPR_BINARY_OPERATOR(%, modulus)
- _DEFINE_EXPR_BINARY_OPERATOR(^, _Bitwise_xor)
- _DEFINE_EXPR_BINARY_OPERATOR(&, _Bitwise_and)
- _DEFINE_EXPR_BINARY_OPERATOR(|, _Bitwise_or)
- _DEFINE_EXPR_BINARY_OPERATOR(<<, _Shift_left)
- _DEFINE_EXPR_BINARY_OPERATOR(>>, _Shift_right)
-
-#undef _DEFINE_EXPR_BINARY_OPERATOR
-
-#define _DEFINE_EXPR_RELATIONAL_OPERATOR(_Op, _Name) \
-template<class _Dom1, class _Dom2> \
-inline _Expr<_BinClos<_Name,_Expr,_Expr,_Dom1,_Dom2>, bool> \
-operator##_Op (const _Expr<_Dom1,typename _Dom1::value_type>& __v, \
- const _Expr<_Dom2,typename _Dom2::value_type>& __w) \
-{ \
- typedef typename _Dom1::value_type _Arg; \
- typedef _BinClos<_Name,_Expr,_Expr,_Dom1,_Dom2> _Closure; \
- return _Expr<_Closure,bool> (_Closure (__v (), __w ())); \
-} \
- \
-template<class _Dom> \
-inline _Expr<_BinClos<_Name,_Expr,_Constant,_Dom,typename _Dom::value_type>, \
- bool> \
-operator##_Op (const _Expr<_Dom,typename _Dom::value_type>& __v, \
- const typename _Dom::value_type& __t) \
-{ \
- typedef typename _Dom::value_type _Arg; \
- typedef _BinClos<_Name,_Expr,_Constant,_Dom,_Arg> _Closure; \
- return _Expr<_Closure,bool> (_Closure (__v (), __t)); \
-} \
- \
-template<class _Dom> \
-inline _Expr<_BinClos<_Name,_Constant,_Expr,typename _Dom::value_type,_Dom>, \
- bool> \
-operator##_Op (const typename _Dom::value_type& __t, \
- const _Expr<_Dom,typename _Dom::value_type>& __v) \
-{ \
- typedef typename _Dom::value_type _Arg; \
- typedef _BinClos<_Name,_Constant,_Expr,_Arg,_Dom> _Closure; \
- return _Expr<_Closure,bool> (_Closure (__t, __v ())); \
-} \
- \
-template<class _Dom> \
-inline _Expr<_BinClos<_Name,_Expr,_ValArray,_Dom,typename _Dom::value_type>, \
- bool> \
-operator##_Op (const _Expr<_Dom,typename _Dom::value_type>& __e, \
- const valarray<typename _Dom::value_type>& __v) \
-{ \
- typedef typename _Dom::value_type _Tp; \
- typedef _BinClos<_Name,_Expr,_ValArray,_Dom,_Tp> _Closure; \
- return _Expr<_Closure,bool> (_Closure (__e (), __v)); \
-} \
- \
-template<class _Dom> \
-inline _Expr<_BinClos<_Name,_ValArray,_Expr,typename _Dom::value_type,_Dom>, \
- bool> \
-operator##_Op (const valarray<typename _Dom::value_type>& __v, \
- const _Expr<_Dom,typename _Dom::value_type>& __e) \
-{ \
- typedef typename _Dom::value_type _Tp; \
- typedef _BinClos<_Name,_ValArray,_Expr,_Tp,_Dom> _Closure; \
- return _Expr<_Closure,bool> (_Closure (__v, __e ())); \
-}
-
- _DEFINE_EXPR_RELATIONAL_OPERATOR(&&, logical_and)
- _DEFINE_EXPR_RELATIONAL_OPERATOR(||, logical_or)
- _DEFINE_EXPR_RELATIONAL_OPERATOR(==, equal_to)
- _DEFINE_EXPR_RELATIONAL_OPERATOR(!=, not_equal_to)
- _DEFINE_EXPR_RELATIONAL_OPERATOR(<, less)
- _DEFINE_EXPR_RELATIONAL_OPERATOR(>, greater)
- _DEFINE_EXPR_RELATIONAL_OPERATOR(<=, less_equal)
- _DEFINE_EXPR_RELATIONAL_OPERATOR(>=, greater_equal)
-
-#undef _DEFINE_EXPR_RELATIONAL_OPERATOR
-
-
-
-#define _DEFINE_EXPR_UNARY_FUNCTION(_Name) \
-template<class _Dom> \
-inline _Expr<_UnFunClos<_Expr,_Dom>,typename _Dom::value_type> \
-_Name(const _Expr<_Dom,typename _Dom::value_type>& __e) \
-{ \
- typedef typename _Dom::value_type _Tp; \
- typedef _UnFunClos<_Expr,_Dom> _Closure; \
- return _Expr<_Closure,_Tp>(_Closure(__e(), (_Tp(*)(_Tp))(&_Name))); \
-} \
- \
-template<typename _Tp> \
-inline _Expr<_UnFunClos<_ValArray,_Tp>,_Tp> \
-_Name(const valarray<_Tp>& __v) \
-{ \
- typedef _UnFunClos<_ValArray,_Tp> _Closure; \
- return _Expr<_Closure,_Tp> (_Closure (__v, (_Tp(*)(_Tp))(&_Name))); \
-}
-
-
- _DEFINE_EXPR_UNARY_FUNCTION(abs)
- _DEFINE_EXPR_UNARY_FUNCTION(cos)
- _DEFINE_EXPR_UNARY_FUNCTION(acos)
- _DEFINE_EXPR_UNARY_FUNCTION(cosh)
- _DEFINE_EXPR_UNARY_FUNCTION(sin)
- _DEFINE_EXPR_UNARY_FUNCTION(asin)
- _DEFINE_EXPR_UNARY_FUNCTION(sinh)
- _DEFINE_EXPR_UNARY_FUNCTION(tan)
- _DEFINE_EXPR_UNARY_FUNCTION(tanh)
- _DEFINE_EXPR_UNARY_FUNCTION(atan)
- _DEFINE_EXPR_UNARY_FUNCTION(exp)
- _DEFINE_EXPR_UNARY_FUNCTION(log)
- _DEFINE_EXPR_UNARY_FUNCTION(log10)
- _DEFINE_EXPR_UNARY_FUNCTION(sqrt)
-
-#undef _DEFINE_EXPR_UNARY_FUNCTION
-
-
-#define _DEFINE_EXPR_BINARY_FUNCTION(_Name) \
-template<class _Dom1, class _Dom2> \
-inline _Expr<_BinFunClos<_Expr,_Expr,_Dom1,_Dom2>,typename _Dom1::value_type>\
-_Name (const _Expr<_Dom1,typename _Dom1::value_type>& __e1, \
- const _Expr<_Dom2,typename _Dom2::value_type>& __e2) \
-{ \
- typedef typename _Dom1::value_type _Tp; \
- typedef _BinFunClos<_Expr,_Expr,_Dom1,_Dom2> _Closure; \
- return _Expr<_Closure,_Tp> \
- (_Closure (__e1 (), __e2 (), (_Tp(*)(_Tp, _Tp))(&_Name))); \
-} \
- \
-template<class _Dom> \
-inline _Expr<_BinFunClos<_Expr,_ValArray,_Dom,typename _Dom::value_type>, \
- typename _Dom::value_type> \
-_Name (const _Expr<_Dom,typename _Dom::value_type>& __e, \
- const valarray<typename _Dom::value_type>& __v) \
-{ \
- typedef typename _Dom::value_type _Tp; \
- typedef _BinFunClos<_Expr,_ValArray,_Dom,_Tp> _Closure; \
- return _Expr<_Closure,_Tp> \
- (_Closure (__e (), __v, (_Tp(*)(_Tp, _Tp))(&_Name))); \
-} \
- \
-template<class _Dom> \
-inline _Expr<_BinFunClos<_ValArray,_Expr,typename _Dom::value_type,_Dom>, \
- typename _Dom::value_type> \
-_Name (const valarray<typename _Dom::valarray>& __v, \
- const _Expr<_Dom,typename _Dom::value_type>& __e) \
-{ \
- typedef typename _Dom::value_type _Tp; \
- typedef _BinFunClos<_ValArray,_Expr,_Tp,_Dom> _Closure; \
- return _Expr<_Closure,_Tp> \
- (_Closure (__v, __e (), (_Tp(*)(_Tp, _Tp))(&_Name))); \
-} \
- \
-template<class _Dom> \
-inline _Expr<_BinFunClos<_Expr,_Constant,_Dom,typename _Dom::value_type>, \
- typename _Dom::value_type> \
-_Name (const _Expr<_Dom, typename _Dom::value_type>& __e, \
- const typename _Dom::value_type& __t) \
-{ \
- typedef typename _Dom::value_type _Tp; \
- typedef _BinFunClos<_Expr,_Constant,_Dom,_Tp> _Closure; \
- return _Expr<_Closure,_Tp> \
- (_Closure (__e (), __t, (_Tp(*)(_Tp, _Tp))(&_Name))); \
-} \
- \
-template<class _Dom> \
-inline _Expr<_BinFunClos<_Constant,_Expr,typename _Dom::value_type,_Dom>, \
- typename _Dom::value_type> \
-_Name (const typename _Dom::value_type& __t, \
- const _Expr<_Dom,typename _Dom::value_type>& __e) \
-{ \
- typedef typename _Dom::value_type _Tp; \
- typedef _BinFunClos<_Constant,_Expr,_Tp,_Dom> _Closure; \
- return _Expr<_Closure,_Tp> \
- (_Closure (__t, __e (), (_Tp(*)(_Tp, _Tp))(&_Name))); \
-} \
- \
-template<typename _Tp> \
-inline _Expr<_BinFunClos<_ValArray,_ValArray,_Tp,_Tp>, _Tp> \
-_Name (const valarray<_Tp>& __v, const valarray<_Tp>& __w) \
-{ \
- typedef _BinFunClos<_ValArray,_ValArray,_Tp,_Tp> _Closure; \
- return _Expr<_Closure,_Tp> \
- (_Closure (__v, __w, (_Tp(*)(_Tp,_Tp))(&_Name))); \
-} \
- \
-template<typename _Tp> \
-inline _Expr<_BinFunClos<_ValArray,_Constant,_Tp,_Tp>,_Tp> \
-_Name (const valarray<_Tp>& __v, const _Tp& __t) \
-{ \
- typedef _BinFunClos<_ValArray,_Constant,_Tp,_Tp> _Closure; \
- return _Expr<_Closure,_Tp> \
- (_Closure (__v, __t, (_Tp(*)(_Tp,_Tp))(&_Name))); \
-} \
- \
-template<typename _Tp> \
-inline _Expr<_BinFunClos<_Constant,_ValArray,_Tp,_Tp>,_Tp> \
-_Name (const _Tp& __t, const valarray<_Tp>& __v) \
-{ \
- typedef _BinFunClos<_Constant,_ValArray,_Tp,_Tp> _Closure; \
- return _Expr<_Closure,_Tp> \
- (_Closure (__t, __v, (_Tp(*)(_Tp,_Tp))(&_Name))); \
-}
-
-_DEFINE_EXPR_BINARY_FUNCTION(atan2)
-_DEFINE_EXPR_BINARY_FUNCTION(pow)
-
-#undef _DEFINE_EXPR_BINARY_FUNCTION
-
-#endif // _CPP_VALARRAY_META_H
-
-// Local Variables:
-// mode:c++
-// End:
diff --git a/contrib/libstdc++/stdexcept b/contrib/libstdc++/stdexcept
deleted file mode 100644
index 69e9627d5778..000000000000
--- a/contrib/libstdc++/stdexcept
+++ /dev/null
@@ -1,97 +0,0 @@
-// Methods for Exception Support for -*- C++ -*-
-// Copyright (C) 1994, 1995, 1997 Free Software Foundation
-
-// This file is part of the GNU ANSI C++ 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.
-
-// Written by Mike Stump based upon the specification in the 20 September 1994
-// C++ working paper, ANSI document X3J16/94-0158.
-
-#ifndef __STDEXCEPT__
-#define __STDEXCEPT__
-
-#ifdef __GNUG__
-#pragma interface "stdexcept"
-#endif
-
-#include <exception>
-#include <string>
-
-extern "C++" {
-
-namespace std {
-
-class logic_error : public exception {
- string _what;
-public:
- logic_error(const string& what_arg): _what (what_arg) { }
- virtual const char* what () const { return _what.c_str (); }
-};
-
-class domain_error : public logic_error {
-public:
- domain_error (const string& what_arg): logic_error (what_arg) { }
-};
-
-class invalid_argument : public logic_error {
-public:
- invalid_argument (const string& what_arg): logic_error (what_arg) { }
-};
-
-class length_error : public logic_error {
-public:
- length_error (const string& what_arg): logic_error (what_arg) { }
-};
-
-class out_of_range : public logic_error {
-public:
- out_of_range (const string& what_arg): logic_error (what_arg) { }
-};
-
-class runtime_error : public exception {
- string _what;
-public:
- runtime_error(const string& what_arg): _what (what_arg) { }
- virtual const char* what () const { return _what.c_str (); }
-protected:
- runtime_error(): exception () { }
-};
-
-class range_error : public runtime_error {
-public:
- range_error (const string& what_arg): runtime_error (what_arg) { }
-};
-
-class overflow_error : public runtime_error {
-public:
- overflow_error (const string& what_arg): runtime_error (what_arg) { }
-};
-
-class underflow_error : public runtime_error {
-public:
- underflow_error (const string& what_arg): runtime_error (what_arg) { }
-};
-
-} // namespace std
-
-} // extern "C++"
-
-#endif
diff --git a/contrib/libstdc++/stdexcepti.cc b/contrib/libstdc++/stdexcepti.cc
deleted file mode 100644
index 9c02c71f4976..000000000000
--- a/contrib/libstdc++/stdexcepti.cc
+++ /dev/null
@@ -1,21 +0,0 @@
-// Implementation file for Exception Support for -*- C++ -*-
-// This file is part of the GNU ANSI C++ Library.
-
-#ifdef __GNUG__
-#pragma implementation "stdexcept"
-#endif
-
-#include <stdexcept>
-
-// Entry points for string.
-
-void
-__out_of_range (const char *s)
-{
- throw std::out_of_range (s);
-}
-
-void __length_error (const char *s)
-{
- throw std::length_error (s);
-}
diff --git a/contrib/libstdc++/stl.h b/contrib/libstdc++/stl.h
deleted file mode 100644
index 4b270742c9cf..000000000000
--- a/contrib/libstdc++/stl.h
+++ /dev/null
@@ -1,15 +0,0 @@
-// -*- C++ -*- compatibility header.
-// This file is part of the GNU ANSI C++ Library.
-
-#include <algorithm>
-#include <deque>
-#include <functional>
-#include <iterator>
-#include <list>
-#include <map>
-#include <memory>
-#include <numeric>
-#include <set>
-#include <stack>
-#include <utility>
-#include <vector>
diff --git a/contrib/libstdc++/stl/ChangeLog b/contrib/libstdc++/stl/ChangeLog
deleted file mode 100644
index 14d56ac3e625..000000000000
--- a/contrib/libstdc++/stl/ChangeLog
+++ /dev/null
@@ -1,381 +0,0 @@
-Fri Mar 16 12:46:19 GMT 2001 Bernd Schmidt (bernds@redhat.com)
-
- * gcc-2.95.3 Released.
-
-1999-11-06 Martin v. Löwis <loewis@informatik.hu-berlin.de>
-
- * bitset (class bitset): Declare reference as our friend.
- * bitset: Include limits.h.
-
-Sun Oct 24 23:54:10 PDT 1999 Jeff Law (law@cygnus.com)
-
- * gcc-2.95.2 Released.
-
-Mon Aug 16 01:29:24 PDT 1999 Jeff Law (law@cygnus.com)
-
- * gcc-2.95.1 Released.
-
-Sun Aug 8 21:06:16 1999 Alexandre Oliva <oliva@dcc.unicamp.br>
-
- * pthread_alloc: Solaris' ctype.h defines _U to 01; use _Up as
- template parameter instead.
-
-Wed Jul 28 21:39:31 PDT 1999 Jeff Law (law@cygnus.com)
-
- * gcc-2.95 Released.
-
-Sun Jul 25 23:40:51 PDT 1999 Jeff Law (law@cygnus.com)
-
- * gcc-2.95 Released.
-
-1999-07-11 Martin v. Löwis (loewis@informatik.hu-berlin.de)
-
- * stl_function.h (bind1st, bind2nd): Rename __opr to __oper,
- as __opr is used internally by egcs.
- * stl_numeric.h (__power, power): Likewise.
-
-1999-06-18 Martin von Löwis <loewis@informatik.hu-berlin.de>
-
- * stl_queue.h: Rename _M_c to c, and _M_comp to comp.
-
-1999-06-17 Alexandre Oliva <oliva@dcc.unicamp.br>
-
- * stl_algo.h (transform): Rename __opr to __oper, as __opr is used
- internally by egcs.
- Reported by Harri Porten <porten@tu-harburg.de>
-
-1999-05-17 Mark Kettenis <kettenis@gnu.org>
-
- * stl_config.h: Only define __STL_PTHREADS with GLIBC >= 2 for
- Linux.
-
-Mon May 17 03:33:47 1999 Mumit Khan <khan@xraylith.wisc.edu>
-
- * stl_config.h (__CYGWIN__): Cygwin newlib RTL lacks drand48.
-
-1999-05-07 Ulrich Drepper <drepper@cygnus.com>
-
- * stl_alloc.h: Make it possible to compile with __USE_MALLOC.
-
-Tue Apr 13 00:32:57 1999 Mumit Khan <khan@xraylith.wisc.edu>
-
- * stl_config.h (__MINGW32__): Mingw32 RTL lacks drand48.
-
-Sun Apr 11 23:48:30 1999 Jeffrey A Law (law@cygnus.com)
-
- * bitset: Re-install Alexandre's lost patch from 1998-11-27.
-
-1999-01-20 Ulrich Drepper <drepper@cygnus.com>
-
- * stl_construct.h (__destroy_aux): Use != instead of < for
- ForwardIterator comparison.
- Patch by jmaurer@menuett.rhein-main.de (Jens Maurer).
-
-1999-01-20 Mark Mitchell <mark@markmitchell.com>
-
- * stl_config.h (__STL_USE_NAMESPACES): Define.
-
-1998-11-27 Alexandre Oliva <oliva@dcc.unicamp.br>
-
- * bitset: Explicitly convert basic_string<...>::npos to size_t in
- default argument to constructor, to avoid parse error at `>'.
- (__STL_EXPLICIT_FUNCTION_TMPL_ARGS): Replace #if with #ifdef.
-
-1998-11-01 Mark Mitchell <mark@markmitchell.com>
-
- * stl_alloc.h (default_alloc_template::_S_free_list): Don't
- qualify _NFREELISTS.
-
-1998-10-11 Mark Mitchell <mark@markmitchell.com>
-
- * stl_config.h (__SGI_STL_USE_AUTO_PTR_CONVERSIONS): Define.
- * memory (auto_ptr::operator auto_ptr_ref<_Tp1>): Fix typo.
- (auto_ptr::operator auto_ptr<_Tp1>): Add missing
- semicolon.
-
-1998-09-03 Jason Merrill <jason@yorick.cygnus.com>
-
- * stl_config.h: Define __STL_HAS_WCHAR_T,
- __STL_MEMBER_TEMPLATE_CLASSES, __STL_HAS_NAMESPACES,
- __STL_NO_NAMESPACES and __STL_LONG_LONG.
-
-1998-09-02 Jason Merrill <jason@yorick.cygnus.com>
-
- * algorithm alloc.h defalloc.h hash_map.h hash_set.h iterator
- memory pthread_alloc pthread_alloc.h rope ropeimpl.h stl_algo.h
- stl_algobase.h stl_alloc.h stl_bvector.h stl_config.h
- stl_construct.h stl_deque.h stl_function.h stl_hash_fun.h
- stl_hash_map.h stl_hash_set.h stl_hashtable.h stl_heap.h
- stl_iterator.h stl_list.h stl_map.h stl_multimap.h stl_multiset.h
- stl_numeric.h stl_pair.h stl_queue.h stl_raw_storage_iter.h
- stl_relops.h stl_rope.h stl_set.h stl_slist.h stl_stack.h
- stl_tempbuf.h stl_tree.h stl_uninitialized.h stl_vector.h
- tempbuf.h type_traits.h: Update to SGI STL 3.11.
-
-Fri Jul 10 15:20:09 1998 Klaus-Georg Adams <Klaus-Georg.Adams@chemie.uni-karlsruhe.de>
-
- * stl_tempbuf.h (temporary_buffer): Add missing typename.
- * type_traits.h: update comments.
-
-Sun Jun 28 00:49:42 1998 Jeffrey A Law (law@cygnus.com)
-
- * stl_config.h (__STL_PTHREADS): Don't define for glibc 2 if
- _G_USING_THUNKS is not defined.
-
-1998-04-07 18:32 Ulrich Drepper <drepper@cygnus.com>
-
- * stl_hashtable.h (__stl_prime_list): Mark last two numbers as
- unsigned long since they are otherwise too large for long int on
- 32bit machines.
-
-Fri Feb 20 16:15:05 1998 H.J. Lu (hjl@gnu.org)
- Jason Merrill <jason@yorick.cygnus.com>
-
- * ropeimpl.h: Check __STL_PTHREADS instead of _PTHREADS.
- * stl_alloc.h: Ditto.
- * stl_config.h: Ditto.
- * stl_rope.h: Ditto.
-
- * stl_config.h: include <_G_config.h> if __GNUG__ is defined.
- (__STL_PTHREADS): Defined if _PTHREADS is defined or
- __GLIBC__ >= 2.
-
-Tue Jan 27 12:01:25 1998 Jason Merrill <jason@yorick.cygnus.com>
-
- * stl_algo.h (__lg): Fix for n == 0.
-
-Sat Nov 8 00:45:17 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * stl_hash_set.h (swap): Fix typo.
-
-Fri Nov 7 10:27:40 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * stl_hashtable.h: Fix typo.
-
-Thu Nov 6 11:19:09 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * stl_algo.h, stl_algobase.h, stl_bvector.h,
- stl_deque.h: Update to October 28 SGI release.
-
-Sun Nov 2 12:14:56 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * algo.h, algobase.h, alloc.h, bvector.h, defalloc.h, deque.h,
- function.h, hash_map.h, hash_set.h, hashtable.h, heap.h, iterator.h,
- list.h, map.h, multimap.h, multiset.h, pair.h, pthread_alloc.h,
- rope.h, ropeimpl.h, set.h, slist.h, stack.h, stl_config.h, tempbuf.h,
- tree.h, type_traits.h, vector.h: Update to October 27 SGI snapshot.
- * algorithm, deque, functional, hash_map, hash_set, iterator, list,
- map, memory, numeric, pthread_alloc, queue, rope, set, slist, stack,
- stl_algo.h, stl_algobase.h, stl_alloc.h, stl_bvector.h,
- stl_construct.h, stl_deque.h, stl_function.h, stl_hash_fun.h,
- stl_hash_map.h, stl_hash_set.h, stl_hashtable.h, stl_heap.h,
- stl_iterator.h, stl_list.h, stl_map.h, stl_multimap.h, stl_multiset.h,
- stl_numeric.h, stl_pair.h, stl_queue.h, stl_raw_storage_iter.h,
- stl_relops.h, stl_rope.h, stl_set.h, stl_slist.h, stl_stack.h,
- stl_tempbuf.h, stl_tree.h, stl_uninitialized.h, stl_vector.h,
- utility, vector: New files in October 27 SGI snapshot.
-
-Fri Oct 17 19:07:42 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * tree.h, vector.h: Fix accidental divergence from SGI release.
-
-Tue Sep 9 19:47:28 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * algo.h, algobase.h, alloc.h, bvector.h, deque.h, hashtable.h,
- iterator.h, list.h, rope.h, ropeimpl.h, slist.h, stl_config.h,
- tree.h, vector.h: Update To September 8 SGI release.
-
-Tue Sep 9 17:38:47 1997 Mark Mitchell <mmitchell@usa.net>
-
- * stl_config.h (__STL_MEMBER_TEMPLATES): Enable.
-
-Tue Aug 5 17:06:01 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * deque.h, function.h, hashtable.h, list.h, rope.h, ropeimpl.h,
- tree.h: Update to July 31 SGI release.
-
-Fri Jul 18 10:06:56 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * algo.h, defalloc.h, hashtable.h, rope.h, ropeimpl.h, slist.h:
- Update to June 30 SGI release.
-
-Fri Jul 04 02:17:15 1997 Ulrich Drepper <drepper@cygnus.com>
-
- * tree.h (rb_tree): Reverse order of member initializations
- to prevent warnings.
-
-Sun Jun 15 18:17:21 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * *.h: Update to 6/13 SGI release.
-
-Fri May 23 10:56:18 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * stl_config.h: Add support for exceptions with g++.
-
- * *.h: Update to 5/8 SGI release.
-
-Thu Apr 24 19:00:23 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * *.h: Update to 3/24 SGI release.
-
-Wed Feb 19 18:19:18 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * *.h: Update to 2/18 SGI release.
-
- * bool.h: Lose.
-
-Mon Feb 10 16:33:23 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * alloc.h: Don't define __USE_MALLOC for g++.
- * bool.h: Lose g++ case.
-
- * *.h: Update to 2/4 SGI release.
-
-Mon Jan 13 14:39:16 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * *.h: Update to 1/8 SGI release.
-
-Mon Sep 30 17:56:43 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * alloc.h (__unlock): Never use __lock_release.
-
-Fri Sep 27 19:03:06 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * alloc.h (__default_alloc_template): lock is a friend.
-
-Thu Sep 19 20:10:37 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- Propagate these changes to new STL code:
- * tree.h: Rearrange member initializers in rb_tree constructors.
- * vector.h (insert): Cast iterator difference to size_type to
- avoid warning.
-
- * *.h: Update to SGI snapshot (fixed).
- * *.c, Makefile.in, configure.in: Removed.
-
-Sat Sep 14 09:43:06 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * deque.h, list.h, tree.h: Remove kludge obsoleted by new
- overloading code.
-
-Sat Aug 10 14:59:50 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * tempbuf.cc (__stl_temp_buffer): Align like a pointer.
-
-Wed Jun 26 13:00:44 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * iterator.h: Add default template parameters.
-
-Wed Apr 24 10:45:22 1996 Doug Evans <dje@blues.cygnus.com>
-
- * Makefile.in (tempbuf.o,random.o): Add rules for SunOS VPATH.
-
-Fri Apr 5 17:52:31 1996 Per Bothner <bothner@kalessin.cygnus.com>
-
- * configure.in (EXTRA_MOSTLYCLEAN): New, to remove stl.list.
-
-Fri Mar 22 14:58:30 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- Propagate these changes to new STL code:
- * tree.h: Rearrange member initializers in rb_tree constructors.
- * vector.h (insert): Cast iterator difference to size_type to
- avoid warning.
-
-Sun Mar 10 07:49:03 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * deque.h (distance_type): Add overload for g++.
- From Joe Buck.
-
-Thu Feb 22 14:07:12 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * bool.h: Revert.
- * algo.h bvector.h deque.h function.h iterator.h list.h
- pair.h stack.h tree.h vector.h: Wrap #include <bool.h> with
- #ifndef __GNUG__.
- * defalloc.h list.h deque.h tree.h: Use __GNUG__ to control
- workarounds.
-
-Wed Feb 21 17:13:02 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * bool.h (TRUE, FALSE): Define for people expecting the bool.h
- from libg++. Is this a good idea?
-
-Tue Feb 20 18:40:02 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * algo.h bool.h bvector.h defalloc.h deque.h function.h heap.h
- iterator.h list.h map.h pair.h random.cc stack.h tree.c tree.h
- vector.h: Revert to HP release with workarounds for missing
- overloading functionality.
- * Makefile.in (STL_OBJECTS): Remove tree.o.
-
-Thu Nov 9 17:05:23 1995 Jason Merrill <jason@yorick.cygnus.com>
-
- * algo.h algobase.h bvector.h defalloc.h deque.h function.h heap.h
- iterator.h list.h map.h multimap.h multiset.h pair.h projectn.h
- set.h stack.h tempbuf.h tree.h vector.h: Wrap #include <bool.h>
- with #ifndef __GNUG__.
-
-Thu Nov 2 17:05:44 1995 Jason Merrill <jason@yorick.cygnus.com>
-
- * deque.h (deque<T>::insert): Fix merge typo.
- * vector.h (value_type): Lose.
-
-Thu Nov 2 14:33:47 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * algo.h, algobase.h, deque.h, function.h, list.h, pair.h, random.cc:
- Merge in Oct 31 1995 release from HP.
-
-Fri Aug 11 17:11:12 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * list.h: Avoid duplicate construction and destruction of list_nodes.
- Patch from Klamer Schutte <klamer@ph.tn.tudelft.nl>.
-
-Fri Aug 11 16:45:18 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * algo.h, algobase.h, deque.h: Merged in Jul 12 1995 release from HP.
-
-Mon Jun 5 18:38:56 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * Makefile.in (stl.list): Depend on stamp-picdir.
-
-Wed May 17 02:30:47 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * tree.h: Rearrange member initializers in rb_tree constructors.
-
- * Update to HP's February 7, 1995 release.
-
-Fri May 5 10:45:31 1995 Mike Stump <mrs@cygnus.com>
-
- * random.cc (seed): Move `for' decl out of `for' statement.
-
-Wed Apr 26 13:09:16 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * configure.in (XCXXINCLUDES): Rename.
-
-Wed Mar 29 19:24:56 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * tree.h (insert): Return a value.
-
- * vector.h (insert): Cast iterator difference to size_type to
- avoid warning.
-
-Sun Feb 12 09:12:17 1995 Mike Stump <mrs@cygnus.com>
-
- * tree.h (rb_tree::max_size): Add definition when using GNU
- workaround.
-
-Thu Jan 12 01:37:42 1995 deanm@medulla.LABS.TEK.COM (Dean Messing)
-
- * configure.in (LIBDIR): Set to yes.
-
-Fri Dec 30 18:26:20 1994 Mike Stump <mrs@cygnus.com>
-
- * iterator.h: Add default template parameters where possible.
-
-Fri Dec 30 16:29:39 1994 Mike Stump <mrs@cygnus.com>
-
- * algo.h: Change rand to __rand to fix make check on linux systems.
-
-Tue Nov 29 15:30:30 1994 Per Bothner <bothner@kalessin.cygnus.com>
-
- * Initial check-in, based on HP's October 21, 1994.
diff --git a/contrib/libstdc++/stl/README b/contrib/libstdc++/stl/README
deleted file mode 100644
index c319c08c7a45..000000000000
--- a/contrib/libstdc++/stl/README
+++ /dev/null
@@ -1,13 +0,0 @@
-This directory contains an SGI release of the C++ Standard Template
-Library, slightly modified to work with g++.
-
-Note that this is based on a pre-Draft Standard for C++.
-Things are likely to change. For example, the header file names
-are very likely to change. The Allocator interface will change. Etc, etc.
-CYGNUS MAKES NO COMMITTMENT (yet) TO SUPPORT BACKWARD COMPATIBILITY FOR STL.
-
-For examples of things that should work, look in the ../tests directory.
-
-DOCUMENTATION:
-See http://www.sgi.com/Technology/STL/ or http://www.dinkumware.com/
-on the World-Wide Web.
diff --git a/contrib/libstdc++/stl/algo.h b/contrib/libstdc++/stl/algo.h
deleted file mode 100644
index 1707868c7c43..000000000000
--- a/contrib/libstdc++/stl/algo.h
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- *
- * Copyright (c) 1996,1997
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- */
-
-#ifndef __SGI_STL_ALGO_H
-#define __SGI_STL_ALGO_H
-
-#include <algobase.h>
-#include <tempbuf.h>
-#include <stl_algo.h>
-#include <stl_numeric.h>
-
-#ifdef __STL_USE_NAMESPACES
-
-// Names from <stl_algo.h>
-using __STD::for_each;
-using __STD::find;
-using __STD::find_if;
-using __STD::adjacent_find;
-using __STD::count;
-using __STD::count_if;
-using __STD::search;
-using __STD::search_n;
-using __STD::swap_ranges;
-using __STD::transform;
-using __STD::replace;
-using __STD::replace_if;
-using __STD::replace_copy;
-using __STD::replace_copy_if;
-using __STD::generate;
-using __STD::generate_n;
-using __STD::remove;
-using __STD::remove_if;
-using __STD::remove_copy;
-using __STD::remove_copy_if;
-using __STD::unique;
-using __STD::unique_copy;
-using __STD::reverse;
-using __STD::reverse_copy;
-using __STD::rotate;
-using __STD::rotate_copy;
-using __STD::random_shuffle;
-using __STD::random_sample;
-using __STD::random_sample_n;
-using __STD::partition;
-using __STD::stable_partition;
-using __STD::sort;
-using __STD::stable_sort;
-using __STD::partial_sort;
-using __STD::partial_sort_copy;
-using __STD::nth_element;
-using __STD::lower_bound;
-using __STD::upper_bound;
-using __STD::equal_range;
-using __STD::binary_search;
-using __STD::merge;
-using __STD::inplace_merge;
-using __STD::includes;
-using __STD::set_union;
-using __STD::set_intersection;
-using __STD::set_difference;
-using __STD::set_symmetric_difference;
-using __STD::min_element;
-using __STD::max_element;
-using __STD::next_permutation;
-using __STD::prev_permutation;
-using __STD::find_first_of;
-using __STD::find_end;
-using __STD::is_sorted;
-using __STD::is_heap;
-
-// Names from stl_heap.h
-using __STD::push_heap;
-using __STD::pop_heap;
-using __STD::make_heap;
-using __STD::sort_heap;
-
-// Names from <stl_numeric.h>
-using __STD::accumulate;
-using __STD::inner_product;
-using __STD::partial_sum;
-using __STD::adjacent_difference;
-using __STD::power;
-using __STD::iota;
-
-#endif /* __STL_USE_NAMESPACES */
-
-#endif /* __SGI_STL_ALGO_H */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/contrib/libstdc++/stl/algobase.h b/contrib/libstdc++/stl/algobase.h
deleted file mode 100644
index f35e7af4a976..000000000000
--- a/contrib/libstdc++/stl/algobase.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- * Copyright (c) 1996,1997
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- */
-
-#ifndef __SGI_STL_ALGOBASE_H
-#define __SGI_STL_ALGOBASE_H
-
-#ifndef __SGI_STL_PAIR_H
-#include <pair.h>
-#endif
-#ifndef __SGI_STL_ITERATOR_H
-#include <iterator.h>
-#endif
-#ifndef __SGI_STL_INTERNAL_ALGOBASE_H
-#include <stl_algobase.h>
-#endif
-#ifndef __SGI_STL_INTERNAL_UNINITIALIZED_H
-#include <stl_uninitialized.h>
-#endif
-
-#ifdef __STL_USE_NAMESPACES
-
-// Names from stl_algobase.h
-using __STD::iter_swap;
-using __STD::swap;
-using __STD::min;
-using __STD::max;
-using __STD::copy;
-using __STD::copy_backward;
-using __STD::copy_n;
-using __STD::fill;
-using __STD::fill_n;
-using __STD::mismatch;
-using __STD::equal;
-using __STD::lexicographical_compare;
-using __STD::lexicographical_compare_3way;
-
-// Names from stl_uninitialized.h
-using __STD::uninitialized_copy;
-using __STD::uninitialized_copy_n;
-using __STD::uninitialized_fill;
-using __STD::uninitialized_fill_n;
-
-#endif /* __STL_USE_NAMESPACES */
-
-#endif /* __SGI_STL_ALGOBASE_H */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/contrib/libstdc++/stl/algorithm b/contrib/libstdc++/stl/algorithm
deleted file mode 100644
index 1ba584f06d4a..000000000000
--- a/contrib/libstdc++/stl/algorithm
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- *
- * Copyright (c) 1996,1997
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- */
-
-#ifndef __SGI_STL_ALGORITHM
-#define __SGI_STL_ALGORITHM
-
-#include <stl_algobase.h>
-#include <stl_construct.h>
-#include <stl_uninitialized.h>
-#include <stl_tempbuf.h>
-#include <stl_algo.h>
-
-#endif /* __SGI_STL_ALGORITHM */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/contrib/libstdc++/stl/alloc.h b/contrib/libstdc++/stl/alloc.h
deleted file mode 100644
index f99a862316ee..000000000000
--- a/contrib/libstdc++/stl/alloc.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 1996-1997
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- */
-
-#ifndef __SGI_STL_ALLOC_H
-#define __SGI_STL_ALLOC_H
-
-#ifndef __STL_CONFIG_H
-#include <stl_config.h>
-#endif
-#ifndef __SGI_STL_INTERNAL_ALLOC_H
-#include <stl_alloc.h>
-#endif
-
-#ifdef __STL_USE_NAMESPACES
-
-using __STD::__malloc_alloc_template;
-using __STD::malloc_alloc;
-using __STD::simple_alloc;
-using __STD::debug_alloc;
-using __STD::__default_alloc_template;
-using __STD::alloc;
-using __STD::single_client_alloc;
-#ifdef __STL_STATIC_TEMPLATE_MEMBER_BUG
-using __STD::__malloc_alloc_oom_handler;
-#endif /* __STL_STATIC_TEMPLATE_MEMBER_BUG */
-#ifdef __STL_USE_STD_ALLOCATORS
-using __STD::allocator;
-#endif /* __STL_USE_STD_ALLOCATORS */
-
-#endif /* __STL_USE_NAMESPACES */
-
-#endif /* __SGI_STL_ALLOC_H */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/contrib/libstdc++/stl/bitset b/contrib/libstdc++/stl/bitset
deleted file mode 100644
index 8b4f8b1a0f80..000000000000
--- a/contrib/libstdc++/stl/bitset
+++ /dev/null
@@ -1,1066 +0,0 @@
-/*
- * Copyright (c) 1998
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- */
-
-#ifndef __SGI_STL_BITSET
-#define __SGI_STL_BITSET
-
-// This implementation of bitset<> has a second template parameter,
-// _WordT, which defaults to unsigned long. *YOU SHOULD NOT USE
-// THIS FEATURE*. It is experimental, and it may be removed in
-// future releases.
-
-// A bitset of size N, using words of type _WordT, will have
-// N % (sizeof(_WordT) * CHAR_BIT) unused bits. (They are the high-
-// order bits in the highest word.) It is a class invariant
-// of class bitset<> that those unused bits are always zero.
-
-// Most of the actual code isn't contained in bitset<> itself, but in the
-// base class _Base_bitset. The base class works with whole words, not with
-// individual bits. This allows us to specialize _Base_bitset for the
-// important special case where the bitset is only a single word.
-
-// The C++ standard does not define the precise semantics of operator[].
-// In this implementation the const version of operator[] is equivalent
-// to test(), except that it does no range checking. The non-const version
-// returns a reference to a bit, again without doing any range checking.
-
-
-#include <stddef.h> // for size_t
-#include <limits.h> // for CHAR_BIT
-#include <string>
-#include <stdexcept> // for invalid_argument, out_of_range, overflow_error
-#include <iostream.h> // for istream, ostream
-
-#define __BITS_PER_WORDT(__wt) (CHAR_BIT*sizeof(__wt))
-#define __BITSET_WORDS(__n,__wt) \
- ((__n) < 1 ? 1 : ((__n) + __BITS_PER_WORDT(__wt) - 1)/__BITS_PER_WORDT(__wt))
-
-__STL_BEGIN_NAMESPACE
-
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma set woff 1209
-#endif
-
-// structure to aid in counting bits
-template<bool __dummy>
-struct _Bit_count {
- static unsigned char _S_bit_count[256];
-};
-
-// Mapping from 8 bit unsigned integers to the index of the first one
-// bit:
-template<bool __dummy>
-struct _First_one {
- static unsigned char _S_first_one[256];
-};
-
-//
-// Base class: general case.
-//
-
-template<size_t _Nw, class _WordT>
-struct _Base_bitset {
- _WordT _M_w[_Nw]; // 0 is the least significant word.
-
- _Base_bitset( void ) { _M_do_reset(); }
-
- _Base_bitset(unsigned long __val);
-
- static size_t _S_whichword( size_t __pos ) {
- return __pos / __BITS_PER_WORDT(_WordT);
- }
- static size_t _S_whichbyte( size_t __pos ) {
- return (__pos % __BITS_PER_WORDT(_WordT)) / CHAR_BIT;
- }
- static size_t _S_whichbit( size_t __pos ) {
- return __pos % __BITS_PER_WORDT(_WordT);
- }
- static _WordT _S_maskbit( size_t __pos ) {
- return (static_cast<_WordT>(1)) << _S_whichbit(__pos);
- }
-
- _WordT& _M_getword(size_t __pos) { return _M_w[_S_whichword(__pos)]; }
- _WordT _M_getword(size_t __pos) const { return _M_w[_S_whichword(__pos)]; }
-
- _WordT& _M_hiword() { return _M_w[_Nw - 1]; }
- _WordT _M_hiword() const { return _M_w[_Nw - 1]; }
-
- void _M_do_and(const _Base_bitset<_Nw,_WordT>& __x) {
- for ( size_t __i = 0; __i < _Nw; __i++ ) {
- _M_w[__i] &= __x._M_w[__i];
- }
- }
-
- void _M_do_or(const _Base_bitset<_Nw,_WordT>& __x) {
- for ( size_t __i = 0; __i < _Nw; __i++ ) {
- _M_w[__i] |= __x._M_w[__i];
- }
- }
-
- void _M_do_xor(const _Base_bitset<_Nw,_WordT>& __x) {
- for ( size_t __i = 0; __i < _Nw; __i++ ) {
- _M_w[__i] ^= __x._M_w[__i];
- }
- }
-
- void _M_do_left_shift(size_t __shift);
-
- void _M_do_right_shift(size_t __shift);
-
- void _M_do_flip() {
- for ( size_t __i = 0; __i < _Nw; __i++ ) {
- _M_w[__i] = ~_M_w[__i];
- }
- }
-
- void _M_do_set() {
- for ( size_t __i = 0; __i < _Nw; __i++ ) {
- _M_w[__i] = ~static_cast<_WordT>(0);
- }
- }
-
- void _M_do_reset() {
- for ( size_t __i = 0; __i < _Nw; __i++ ) {
- _M_w[__i] = 0;
- }
- }
-
- bool _M_is_equal(const _Base_bitset<_Nw,_WordT>& __x) const {
- for (size_t __i = 0; __i < _Nw; ++__i) {
- if (_M_w[__i] != __x._M_w[__i])
- return false;
- }
- return true;
- }
-
- bool _M_is_any() const {
- for ( size_t __i = 0; __i < __BITSET_WORDS(_Nw,_WordT); __i++ ) {
- if ( _M_w[__i] != static_cast<_WordT>(0) )
- return true;
- }
- return false;
- }
-
- size_t _M_do_count() const {
- size_t __result = 0;
- const unsigned char* __byte_ptr = (const unsigned char*)_M_w;
- const unsigned char* __end_ptr = (const unsigned char*)(_M_w+_Nw);
-
- while ( __byte_ptr < __end_ptr ) {
- __result += _Bit_count<true>::_S_bit_count[*__byte_ptr];
- __byte_ptr++;
- }
- return __result;
- }
-
- unsigned long _M_do_to_ulong() const;
-
- // find first "on" bit
- size_t _M_do_find_first(size_t __not_found) const;
-
- // find the next "on" bit that follows "prev"
- size_t _M_do_find_next(size_t __prev, size_t __not_found) const;
-};
-
-//
-// Definitions of non-inline functions from _Base_bitset.
-//
-
-template<size_t _Nw, class _WordT>
-_Base_bitset<_Nw, _WordT>::_Base_bitset(unsigned long __val)
-{
- _M_do_reset();
- const size_t __n = min(sizeof(unsigned long)*CHAR_BIT,
- __BITS_PER_WORDT(_WordT)*_Nw);
- for(size_t __i = 0; __i < __n; ++__i, __val >>= 1)
- if ( __val & 0x1 )
- _M_getword(__i) |= _S_maskbit(__i);
-}
-
-template<size_t _Nw, class _WordT>
-void _Base_bitset<_Nw, _WordT>::_M_do_left_shift(size_t __shift)
-{
- if (__shift != 0) {
- const size_t __wshift = __shift / __BITS_PER_WORDT(_WordT);
- const size_t __offset = __shift % __BITS_PER_WORDT(_WordT);
- const size_t __sub_offset = __BITS_PER_WORDT(_WordT) - __offset;
- size_t __n = _Nw - 1;
- for ( ; __n > __wshift; --__n)
- _M_w[__n] = (_M_w[__n - __wshift] << __offset) |
- (_M_w[__n - __wshift - 1] >> __sub_offset);
- if (__n == __wshift)
- _M_w[__n] = _M_w[0] << __offset;
- for (size_t __n1 = 0; __n1 < __n; ++__n1)
- _M_w[__n1] = static_cast<_WordT>(0);
- }
-}
-
-template<size_t _Nw, class _WordT>
-void _Base_bitset<_Nw, _WordT>::_M_do_right_shift(size_t __shift)
-{
- if (__shift != 0) {
- const size_t __wshift = __shift / __BITS_PER_WORDT(_WordT);
- const size_t __offset = __shift % __BITS_PER_WORDT(_WordT);
- const size_t __sub_offset = __BITS_PER_WORDT(_WordT) - __offset;
- const size_t __limit = _Nw - __wshift - 1;
- size_t __n = 0;
- for ( ; __n < __limit; ++__n)
- _M_w[__n] = (_M_w[__n + __wshift] >> __offset) |
- (_M_w[__n + __wshift + 1] << __sub_offset);
- _M_w[__limit] = _M_w[_Nw-1] >> __offset;
- for (size_t __n1 = __limit + 1; __n1 < _Nw; ++__n1)
- _M_w[__n1] = static_cast<_WordT>(0);
- }
-}
-
-template<size_t _Nw, class _WordT>
-unsigned long _Base_bitset<_Nw, _WordT>::_M_do_to_ulong() const
-{
- const overflow_error __overflow("bitset");
-
- if (sizeof(_WordT) >= sizeof(unsigned long)) {
- for (size_t __i = 1; __i < _Nw; ++__i)
- if (_M_w[__i])
- __STL_THROW(__overflow);
-
- const _WordT __mask = static_cast<_WordT>(static_cast<unsigned long>(-1));
- if (_M_w[0] & ~__mask)
- __STL_THROW(__overflow);
-
- return static_cast<unsigned long>(_M_w[0] & __mask);
- }
- else { // sizeof(_WordT) < sizeof(unsigned long).
- const size_t __nwords =
- (sizeof(unsigned long) + sizeof(_WordT) - 1) / sizeof(_WordT);
-
- size_t __min_nwords = __nwords;
- if (_Nw > __nwords) {
- for (size_t __i = __nwords; __i < _Nw; ++__i)
- if (_M_w[__i])
- __STL_THROW(__overflow);
- }
- else
- __min_nwords = _Nw;
-
- // If unsigned long is 8 bytes and _WordT is 6 bytes, then an unsigned
- // long consists of all of one word plus 2 bytes from another word.
- const size_t __part = sizeof(unsigned long) % sizeof(_WordT);
-
- if (__part != 0 && __nwords <= _Nw &&
- (_M_w[__min_nwords - 1] >> ((sizeof(_WordT) - __part) * CHAR_BIT)) != 0)
- __STL_THROW(__overflow);
-
- unsigned long __result = 0;
- for (size_t __i = 0; __i < __min_nwords; ++__i) {
- __result |= static_cast<unsigned long>(
- _M_w[__i]) << (__i * sizeof(_WordT) * CHAR_BIT);
- }
- return __result;
- }
-} // End _M_do_to_ulong
-
-template<size_t _Nw, class _WordT>
-size_t _Base_bitset<_Nw, _WordT>::_M_do_find_first(size_t __not_found) const
-{
- for ( size_t __i = 0; __i < _Nw; __i++ ) {
- _WordT __thisword = _M_w[__i];
- if ( __thisword != static_cast<_WordT>(0) ) {
- // find byte within word
- for ( size_t __j = 0; __j < sizeof(_WordT); __j++ ) {
- unsigned char __this_byte
- = static_cast<unsigned char>(__thisword & (~(unsigned char)0));
- if ( __this_byte )
- return __i*__BITS_PER_WORDT(_WordT) + __j*CHAR_BIT +
- _First_one<true>::_S_first_one[__this_byte];
-
- __thisword >>= CHAR_BIT;
- }
- }
- }
- // not found, so return an indication of failure.
- return __not_found;
-}
-
-template<size_t _Nw, class _WordT>
-size_t
-_Base_bitset<_Nw, _WordT>::_M_do_find_next(size_t __prev,
- size_t __not_found) const
-{
- // make bound inclusive
- ++__prev;
-
- // check out of bounds
- if ( __prev >= _Nw * __BITS_PER_WORDT(_WordT) )
- return __not_found;
-
- // search first word
- size_t __i = _S_whichword(__prev);
- _WordT __thisword = _M_w[__i];
-
- // mask off bits below bound
- __thisword &= (~static_cast<_WordT>(0)) << _S_whichbit(__prev);
-
- if ( __thisword != static_cast<_WordT>(0) ) {
- // find byte within word
- // get first byte into place
- __thisword >>= _S_whichbyte(__prev) * CHAR_BIT;
- for ( size_t __j = _S_whichbyte(__prev); __j < sizeof(_WordT); __j++ ) {
- unsigned char __this_byte
- = static_cast<unsigned char>(__thisword & (~(unsigned char)0));
- if ( __this_byte )
- return __i*__BITS_PER_WORDT(_WordT) + __j*CHAR_BIT +
- _First_one<true>::_S_first_one[__this_byte];
-
- __thisword >>= CHAR_BIT;
- }
- }
-
- // check subsequent words
- __i++;
- for ( ; __i < _Nw; __i++ ) {
- _WordT __thisword = _M_w[__i];
- if ( __thisword != static_cast<_WordT>(0) ) {
- // find byte within word
- for ( size_t __j = 0; __j < sizeof(_WordT); __j++ ) {
- unsigned char __this_byte
- = static_cast<unsigned char>(__thisword & (~(unsigned char)0));
- if ( __this_byte )
- return __i*__BITS_PER_WORDT(_WordT) + __j*CHAR_BIT +
- _First_one<true>::_S_first_one[__this_byte];
-
- __thisword >>= CHAR_BIT;
- }
- }
- }
-
- // not found, so return an indication of failure.
- return __not_found;
-} // end _M_do_find_next
-
-
-// ------------------------------------------------------------
-
-//
-// Base class: specialization for a single word.
-//
-
-template<class _WordT>
-struct _Base_bitset<1, _WordT> {
- _WordT _M_w;
-
- _Base_bitset( void ) { _M_do_reset(); }
-
- _Base_bitset(unsigned long __val);
-
- static size_t _S_whichword( size_t __pos ) {
- return __pos / __BITS_PER_WORDT(_WordT);
- }
- static size_t _S_whichbyte( size_t __pos ) {
- return (__pos % __BITS_PER_WORDT(_WordT)) / CHAR_BIT;
- }
- static size_t _S_whichbit( size_t __pos ) {
- return __pos % __BITS_PER_WORDT(_WordT);
- }
- static _WordT _S_maskbit( size_t __pos ) {
- return (static_cast<_WordT>(1)) << _S_whichbit(__pos);
- }
-
- _WordT& _M_getword(size_t) { return _M_w; }
- _WordT _M_getword(size_t) const { return _M_w; }
-
- _WordT& _M_hiword() { return _M_w; }
- _WordT _M_hiword() const { return _M_w; }
-
- void _M_do_and(const _Base_bitset<1,_WordT>& __x) { _M_w &= __x._M_w; }
- void _M_do_or(const _Base_bitset<1,_WordT>& __x) { _M_w |= __x._M_w; }
- void _M_do_xor(const _Base_bitset<1,_WordT>& __x) { _M_w ^= __x._M_w; }
- void _M_do_left_shift(size_t __shift) { _M_w <<= __shift; }
- void _M_do_right_shift(size_t __shift) { _M_w >>= __shift; }
- void _M_do_flip() { _M_w = ~_M_w; }
- void _M_do_set() { _M_w = ~static_cast<_WordT>(0); }
- void _M_do_reset() { _M_w = 0; }
-
- bool _M_is_equal(const _Base_bitset<1,_WordT>& __x) const {
- return _M_w == __x._M_w;
- }
- bool _M_is_any() const {
- return _M_w != 0;
- }
-
- size_t _M_do_count() const {
- size_t __result = 0;
- const unsigned char* __byte_ptr = (const unsigned char*)&_M_w;
- const unsigned char* __end_ptr = ((const unsigned char*)&_M_w)+sizeof(_M_w);
- while ( __byte_ptr < __end_ptr ) {
- __result += _Bit_count<true>::_S_bit_count[*__byte_ptr];
- __byte_ptr++;
- }
- return __result;
- }
-
- unsigned long _M_do_to_ulong() const {
- if (sizeof(_WordT) <= sizeof(unsigned long))
- return static_cast<unsigned long>(_M_w);
- else {
- const _WordT __mask = static_cast<_WordT>(static_cast<unsigned long>(-1));
- if (_M_w & ~__mask)
- __STL_THROW(overflow_error("bitset"));
- return static_cast<unsigned long>(_M_w);
- }
- }
-
- size_t _M_do_find_first(size_t __not_found) const;
-
- // find the next "on" bit that follows "prev"
- size_t _M_do_find_next(size_t __prev, size_t __not_found) const;
-
-};
-
-//
-// Definitions of non-inline functions from the single-word version of
-// _Base_bitset.
-//
-
-template <class _WordT>
-_Base_bitset<1, _WordT>::_Base_bitset(unsigned long __val)
-{
- _M_do_reset();
- const size_t __n = min(sizeof(unsigned long)*CHAR_BIT,
- __BITS_PER_WORDT(_WordT)*_Nw);
- for(size_t __i = 0; __i < __n; ++__i, __val >>= 1)
- if ( __val & 0x1 )
- _M_w |= _S_maskbit(__i);
-}
-
-template <class _WordT>
-size_t _Base_bitset<1, _WordT>::_M_do_find_first(size_t __not_found) const
-{
- _WordT __thisword = _M_w;
-
- if ( __thisword != static_cast<_WordT>(0) ) {
- // find byte within word
- for ( size_t __j = 0; __j < sizeof(_WordT); __j++ ) {
- unsigned char __this_byte
- = static_cast<unsigned char>(__thisword & (~(unsigned char)0));
- if ( __this_byte )
- return __j*CHAR_BIT + _First_one<true>::_S_first_one[__this_byte];
-
- __thisword >>= CHAR_BIT;
- }
- }
- // not found, so return a value that indicates failure.
- return __not_found;
-}
-
-template <class _WordT>
-size_t
-_Base_bitset<1, _WordT>::_M_do_find_next(size_t __prev,
- size_t __not_found ) const
-{
- // make bound inclusive
- ++__prev;
-
- // check out of bounds
- if ( __prev >= __BITS_PER_WORDT(_WordT) )
- return __not_found;
-
- // search first (and only) word
- _WordT __thisword = _M_w;
-
- // mask off bits below bound
- __thisword &= (~static_cast<_WordT>(0)) << _S_whichbit(__prev);
-
- if ( __thisword != static_cast<_WordT>(0) ) {
- // find byte within word
- // get first byte into place
- __thisword >>= _S_whichbyte(__prev) * CHAR_BIT;
- for ( size_t __j = _S_whichbyte(__prev); __j < sizeof(_WordT); __j++ ) {
- unsigned char __this_byte
- = static_cast<unsigned char>(__thisword & (~(unsigned char)0));
- if ( __this_byte )
- return __j*CHAR_BIT + _First_one<true>::_S_first_one[__this_byte];
-
- __thisword >>= CHAR_BIT;
- }
- }
-
- // not found, so return a value that indicates failure.
- return __not_found;
-} // end _M_do_find_next
-
-//
-// One last specialization: _M_do_to_ulong() and the constructor from
-// unsigned long are very simple if the bitset consists of a single
-// word of type unsigned long.
-//
-
-template<>
-inline unsigned long
-_Base_bitset<1, unsigned long>::_M_do_to_ulong() const { return _M_w; }
-
-template<>
-inline _Base_bitset<1, unsigned long>::_Base_bitset(unsigned long __val) {
- _M_w = __val;
-}
-
-
-// ------------------------------------------------------------
-// Helper class to zero out the unused high-order bits in the highest word.
-
-template <class _WordT, size_t _Extrabits> struct _Sanitize {
- static void _M_do_sanitize(_WordT& __val)
- { __val &= ~((~static_cast<_WordT>(0)) << _Extrabits); }
-};
-
-template <class _WordT> struct _Sanitize<_WordT, 0> {
- static void _M_do_sanitize(_WordT) {}
-};
-
-// ------------------------------------------------------------
-// Class bitset.
-// _Nb may be any nonzero number of type size_t.
-// Type _WordT may be any unsigned integral type.
-
-template<size_t _Nb, class _WordT = unsigned long>
-class bitset : private _Base_bitset<__BITSET_WORDS(_Nb,_WordT), _WordT>
-{
-private:
- typedef _Base_bitset<__BITSET_WORDS(_Nb,_WordT), _WordT> _Base;
-
- // Import base's protected interface. Necessary because of new template
- // name resolution rules.
- using _Base::_S_whichword;
- using _Base::_S_whichbyte;
- using _Base::_S_whichbit;
- using _Base::_S_maskbit;
- using _Base::_M_getword;
- using _Base::_M_hiword;
- using _Base::_M_do_and;
- using _Base::_M_do_or;
- using _Base::_M_do_xor;
- using _Base::_M_do_left_shift;
- using _Base::_M_do_right_shift;
- using _Base::_M_do_flip;
- using _Base::_M_do_set;
- using _Base::_M_do_reset;
- using _Base::_M_is_equal;
- using _Base::_M_is_any;
- using _Base::_M_do_count;
- using _Base::_M_do_to_ulong;
- using _Base::_M_do_find_first;
- using _Base::_M_do_find_next;
-
-private:
- void _M_do_sanitize() {
- _Sanitize<_WordT,_Nb%__BITS_PER_WORDT(_WordT) >
- ::_M_do_sanitize(_M_hiword());
- }
-
-public:
-
- // bit reference:
- class reference;
- friend class reference;
- class reference {
- friend class bitset;
-
- _WordT *_M_wp;
- size_t _M_bpos;
-
- // left undefined
- reference();
-
- reference( bitset& __b, size_t __pos ) {
- _M_wp = &__b._M_getword(__pos);
- _M_bpos = _S_whichbit(__pos);
- }
-
- public:
- ~reference() {}
-
- // for b[i] = __x;
- reference& operator=(bool __x) {
- if ( __x )
- *_M_wp |= _S_maskbit(_M_bpos);
- else
- *_M_wp &= ~_S_maskbit(_M_bpos);
-
- return *this;
- }
-
- // for b[i] = b[__j];
- reference& operator=(const reference& __j) {
- if ( (*(__j._M_wp) & _S_maskbit(__j._M_bpos)) )
- *_M_wp |= _S_maskbit(_M_bpos);
- else
- *_M_wp &= ~_S_maskbit(_M_bpos);
-
- return *this;
- }
-
- // flips the bit
- bool operator~() const { return (*(_M_wp) & _S_maskbit(_M_bpos)) == 0; }
-
- // for __x = b[i];
- operator bool() const { return (*(_M_wp) & _S_maskbit(_M_bpos)) != 0; }
-
- // for b[i].flip();
- reference& flip() {
- *_M_wp ^= _S_maskbit(_M_bpos);
- return *this;
- }
- };
-
- // 23.3.5.1 constructors:
- bitset() {}
- bitset(unsigned long __val) :
- _Base_bitset<__BITSET_WORDS(_Nb,_WordT), _WordT>(__val) {}
-
- template<class _CharT, class _Traits, class _Alloc>
- explicit bitset(const basic_string<_CharT,_Traits,_Alloc>& __s,
- size_t __pos = 0,
- size_t __n = size_t(basic_string<_CharT,_Traits,_Alloc>::npos))
- : _Base()
- {
- if (__pos > __s.size())
- __STL_THROW(out_of_range("bitset"));
- _M_copy_from_string(__s, __pos, __n);
- }
-
- // 23.3.5.2 bitset operations:
- bitset<_Nb,_WordT>& operator&=(const bitset<_Nb,_WordT>& __rhs) {
- _M_do_and(__rhs);
- return *this;
- }
-
- bitset<_Nb,_WordT>& operator|=(const bitset<_Nb,_WordT>& __rhs) {
- _M_do_or(__rhs);
- return *this;
- }
-
- bitset<_Nb,_WordT>& operator^=(const bitset<_Nb,_WordT>& __rhs) {
- _M_do_xor(__rhs);
- return *this;
- }
-
- bitset<_Nb,_WordT>& operator<<=(size_t __pos) {
- _M_do_left_shift(__pos);
- _M_do_sanitize();
- return *this;
- }
-
- bitset<_Nb,_WordT>& operator>>=(size_t __pos) {
- _M_do_right_shift(__pos);
- _M_do_sanitize();
- return *this;
- }
-
- //
- // Extension:
- // Versions of single-bit set, reset, flip, test with no range checking.
- //
-
- bitset<_Nb,_WordT>& _Unchecked_set(size_t __pos) {
- _M_getword(__pos) |= _S_maskbit(__pos);
- return *this;
- }
-
- bitset<_Nb,_WordT>& _Unchecked_set(size_t __pos, int __val) {
- if (__val)
- _M_getword(__pos) |= _S_maskbit(__pos);
- else
- _M_getword(__pos) &= ~_S_maskbit(__pos);
-
- return *this;
- }
-
- bitset<_Nb,_WordT>& _Unchecked_reset(size_t __pos) {
- _M_getword(__pos) &= ~_S_maskbit(__pos);
- return *this;
- }
-
- bitset<_Nb,_WordT>& _Unchecked_flip(size_t __pos) {
- _M_getword(__pos) ^= _S_maskbit(__pos);
- return *this;
- }
-
- bool _Unchecked_test(size_t __pos) const {
- return (_M_getword(__pos) & _S_maskbit(__pos)) != static_cast<_WordT>(0);
- }
-
- // Set, reset, and flip.
-
- bitset<_Nb,_WordT>& set() {
- _M_do_set();
- _M_do_sanitize();
- return *this;
- }
-
- bitset<_Nb,_WordT>& set(size_t __pos) {
- if (__pos >= _Nb)
- __STL_THROW(out_of_range("bitset"));
-
- return _Unchecked_set(__pos);
- }
-
- bitset<_Nb,_WordT>& set(size_t __pos, int __val) {
- if (__pos >= _Nb)
- __STL_THROW(out_of_range("bitset"));
-
- return _Unchecked_set(__pos, __val);
- }
-
- bitset<_Nb,_WordT>& reset() {
- _M_do_reset();
- return *this;
- }
-
- bitset<_Nb,_WordT>& reset(size_t __pos) {
- if (__pos >= _Nb)
- __STL_THROW(out_of_range("bitset"));
-
- return _Unchecked_reset(__pos);
- }
-
- bitset<_Nb,_WordT>& flip() {
- _M_do_flip();
- _M_do_sanitize();
- return *this;
- }
-
- bitset<_Nb,_WordT>& flip(size_t __pos) {
- if (__pos >= _Nb)
- __STL_THROW(out_of_range("bitset"));
-
- return _Unchecked_flip(__pos);
- }
-
- bitset<_Nb,_WordT> operator~() const {
- return bitset<_Nb,_WordT>(*this).flip();
- }
-
- // element access:
- //for b[i];
- reference operator[](size_t __pos) { return reference(*this,__pos); }
- bool operator[](size_t __pos) const { return _Unchecked_test(__pos); }
-
- unsigned long to_ulong() const { return _M_do_to_ulong(); }
-
-#ifdef __STL_EXPLICIT_FUNCTION_TMPL_ARGS
- template <class _CharT, class _Traits, class _Alloc>
- basic_string<_CharT, _Traits, _Alloc> to_string() const {
- basic_string<_CharT, _Traits, _Alloc> __result;
- _M_copy_to_string(__result);
- return __result;
- }
-#endif /* __STL_EXPLICIT_FUNCTION_TMPL_ARGS */
-
- // Helper functions for string operations.
- template<class _CharT, class _Traits, class _Alloc>
- void _M_copy_from_string(const basic_string<_CharT,_Traits,_Alloc>& __s,
- size_t,
- size_t);
-
- // Helper functions for string operations.
- template<class _CharT, class _Traits, class _Alloc>
- void _M_copy_to_string(basic_string<_CharT,_Traits,_Alloc>&) const;
-
- size_t count() const { return _M_do_count(); }
-
- size_t size() const { return _Nb; }
-
- bool operator==(const bitset<_Nb,_WordT>& __rhs) const {
- return _M_is_equal(__rhs);
- }
- bool operator!=(const bitset<_Nb,_WordT>& __rhs) const {
- return !_M_is_equal(__rhs);
- }
-
- bool test(size_t __pos) const {
- if (__pos > _Nb)
- __STL_THROW(out_of_range("bitset"));
-
- return _Unchecked_test(__pos);
- }
-
- bool any() const { return _M_is_any(); }
- bool none() const { return !_M_is_any(); }
-
- bitset<_Nb,_WordT> operator<<(size_t __pos) const
- { return bitset<_Nb,_WordT>(*this) <<= __pos; }
- bitset<_Nb,_WordT> operator>>(size_t __pos) const
- { return bitset<_Nb,_WordT>(*this) >>= __pos; }
-
- //
- // EXTENSIONS: bit-find operations. These operations are
- // experimental, and are subject to change or removal in future
- // versions.
- //
-
- // find the index of the first "on" bit
- size_t _Find_first() const
- { return _M_do_find_first(_Nb); }
-
- // find the index of the next "on" bit after prev
- size_t _Find_next( size_t __prev ) const
- { return _M_do_find_next(__prev, _Nb); }
-
-};
-
-//
-// Definitions of non-inline member functions.
-//
-
-template <size_t _Nb, class _WordT>
-template<class _CharT, class _Traits, class _Alloc>
-void bitset<_Nb, _WordT>
- ::_M_copy_from_string(const basic_string<_CharT,_Traits,_Alloc>& __s,
- size_t __pos,
- size_t __n)
-{
- reset();
- const size_t __nbits = min(_Nb, min(__n, __s.size() - __pos));
- for (size_t __i = 0; __i < __nbits; ++__i) {
- switch(__s[__pos + __nbits - __i - 1]) {
- case '0':
- break;
- case '1':
- set(__i);
- break;
- default:
- __STL_THROW(invalid_argument("bitset"));
- }
- }
-}
-
-template <size_t _Nb, class _WordT>
-template <class _CharT, class _Traits, class _Alloc>
-void bitset<_Nb, _WordT>
- ::_M_copy_to_string(basic_string<_CharT, _Traits, _Alloc>& __s) const
-{
- __s.assign(_Nb, '0');
-
- for (size_t __i = 0; __i < _Nb; ++__i)
- if (_Unchecked_test(__i))
- __s[_Nb - 1 - __i] = '1';
-}
-
-// ------------------------------------------------------------
-
-//
-// 23.3.5.3 bitset operations:
-//
-
-template <size_t _Nb, class _WordT>
-inline bitset<_Nb,_WordT> operator&(const bitset<_Nb,_WordT>& __x,
- const bitset<_Nb,_WordT>& __y) {
- bitset<_Nb,_WordT> __result(__x);
- __result &= __y;
- return __result;
-}
-
-
-template <size_t _Nb, class _WordT>
-inline bitset<_Nb,_WordT> operator|(const bitset<_Nb,_WordT>& __x,
- const bitset<_Nb,_WordT>& __y) {
- bitset<_Nb,_WordT> __result(__x);
- __result |= __y;
- return __result;
-}
-
-template <size_t _Nb, class _WordT>
-inline bitset<_Nb,_WordT> operator^(const bitset<_Nb,_WordT>& __x,
- const bitset<_Nb,_WordT>& __y) {
- bitset<_Nb,_WordT> __result(__x);
- __result ^= __y;
- return __result;
-}
-
-// NOTE: these must be rewritten once we have templatized iostreams.
-
-template <size_t _Nb, class _WordT>
-istream&
-operator>>(istream& __is, bitset<_Nb,_WordT>& __x) {
- string __tmp;
- __tmp.reserve(_Nb);
-
- // In new templatized iostreams, use istream::sentry
- if (__is.flags() & ios::skipws) {
- char __c;
- do
- __is.get(__c);
- while (__is && isspace(__c));
- if (__is)
- __is.putback(__c);
- }
-
- for (size_t __i = 0; __i < _Nb; ++__i) {
- char __c;
- __is.get(__c);
-
- if (!__is)
- break;
- else if (__c != '0' && __c != '1') {
- __is.putback(__c);
- break;
- }
- else
- __tmp.push_back(__c);
- }
-
- if (__tmp.empty())
- __is.clear(__is.rdstate() | ios::failbit);
- else
- __x._M_copy_from_string(__tmp, static_cast<size_t>(0), _Nb);
-
- return __is;
-}
-
-template <size_t _Nb, class _WordT>
-ostream& operator<<(ostream& __os, const bitset<_Nb,_WordT>& __x) {
- string __tmp;
- __x._M_copy_to_string(__tmp);
- return __os << __tmp;
-}
-
-// ------------------------------------------------------------
-// Lookup tables for find and count operations.
-
-template<bool __dummy>
-unsigned char _Bit_count<__dummy>::_S_bit_count[] = {
- 0, /* 0 */ 1, /* 1 */ 1, /* 2 */ 2, /* 3 */ 1, /* 4 */
- 2, /* 5 */ 2, /* 6 */ 3, /* 7 */ 1, /* 8 */ 2, /* 9 */
- 2, /* 10 */ 3, /* 11 */ 2, /* 12 */ 3, /* 13 */ 3, /* 14 */
- 4, /* 15 */ 1, /* 16 */ 2, /* 17 */ 2, /* 18 */ 3, /* 19 */
- 2, /* 20 */ 3, /* 21 */ 3, /* 22 */ 4, /* 23 */ 2, /* 24 */
- 3, /* 25 */ 3, /* 26 */ 4, /* 27 */ 3, /* 28 */ 4, /* 29 */
- 4, /* 30 */ 5, /* 31 */ 1, /* 32 */ 2, /* 33 */ 2, /* 34 */
- 3, /* 35 */ 2, /* 36 */ 3, /* 37 */ 3, /* 38 */ 4, /* 39 */
- 2, /* 40 */ 3, /* 41 */ 3, /* 42 */ 4, /* 43 */ 3, /* 44 */
- 4, /* 45 */ 4, /* 46 */ 5, /* 47 */ 2, /* 48 */ 3, /* 49 */
- 3, /* 50 */ 4, /* 51 */ 3, /* 52 */ 4, /* 53 */ 4, /* 54 */
- 5, /* 55 */ 3, /* 56 */ 4, /* 57 */ 4, /* 58 */ 5, /* 59 */
- 4, /* 60 */ 5, /* 61 */ 5, /* 62 */ 6, /* 63 */ 1, /* 64 */
- 2, /* 65 */ 2, /* 66 */ 3, /* 67 */ 2, /* 68 */ 3, /* 69 */
- 3, /* 70 */ 4, /* 71 */ 2, /* 72 */ 3, /* 73 */ 3, /* 74 */
- 4, /* 75 */ 3, /* 76 */ 4, /* 77 */ 4, /* 78 */ 5, /* 79 */
- 2, /* 80 */ 3, /* 81 */ 3, /* 82 */ 4, /* 83 */ 3, /* 84 */
- 4, /* 85 */ 4, /* 86 */ 5, /* 87 */ 3, /* 88 */ 4, /* 89 */
- 4, /* 90 */ 5, /* 91 */ 4, /* 92 */ 5, /* 93 */ 5, /* 94 */
- 6, /* 95 */ 2, /* 96 */ 3, /* 97 */ 3, /* 98 */ 4, /* 99 */
- 3, /* 100 */ 4, /* 101 */ 4, /* 102 */ 5, /* 103 */ 3, /* 104 */
- 4, /* 105 */ 4, /* 106 */ 5, /* 107 */ 4, /* 108 */ 5, /* 109 */
- 5, /* 110 */ 6, /* 111 */ 3, /* 112 */ 4, /* 113 */ 4, /* 114 */
- 5, /* 115 */ 4, /* 116 */ 5, /* 117 */ 5, /* 118 */ 6, /* 119 */
- 4, /* 120 */ 5, /* 121 */ 5, /* 122 */ 6, /* 123 */ 5, /* 124 */
- 6, /* 125 */ 6, /* 126 */ 7, /* 127 */ 1, /* 128 */ 2, /* 129 */
- 2, /* 130 */ 3, /* 131 */ 2, /* 132 */ 3, /* 133 */ 3, /* 134 */
- 4, /* 135 */ 2, /* 136 */ 3, /* 137 */ 3, /* 138 */ 4, /* 139 */
- 3, /* 140 */ 4, /* 141 */ 4, /* 142 */ 5, /* 143 */ 2, /* 144 */
- 3, /* 145 */ 3, /* 146 */ 4, /* 147 */ 3, /* 148 */ 4, /* 149 */
- 4, /* 150 */ 5, /* 151 */ 3, /* 152 */ 4, /* 153 */ 4, /* 154 */
- 5, /* 155 */ 4, /* 156 */ 5, /* 157 */ 5, /* 158 */ 6, /* 159 */
- 2, /* 160 */ 3, /* 161 */ 3, /* 162 */ 4, /* 163 */ 3, /* 164 */
- 4, /* 165 */ 4, /* 166 */ 5, /* 167 */ 3, /* 168 */ 4, /* 169 */
- 4, /* 170 */ 5, /* 171 */ 4, /* 172 */ 5, /* 173 */ 5, /* 174 */
- 6, /* 175 */ 3, /* 176 */ 4, /* 177 */ 4, /* 178 */ 5, /* 179 */
- 4, /* 180 */ 5, /* 181 */ 5, /* 182 */ 6, /* 183 */ 4, /* 184 */
- 5, /* 185 */ 5, /* 186 */ 6, /* 187 */ 5, /* 188 */ 6, /* 189 */
- 6, /* 190 */ 7, /* 191 */ 2, /* 192 */ 3, /* 193 */ 3, /* 194 */
- 4, /* 195 */ 3, /* 196 */ 4, /* 197 */ 4, /* 198 */ 5, /* 199 */
- 3, /* 200 */ 4, /* 201 */ 4, /* 202 */ 5, /* 203 */ 4, /* 204 */
- 5, /* 205 */ 5, /* 206 */ 6, /* 207 */ 3, /* 208 */ 4, /* 209 */
- 4, /* 210 */ 5, /* 211 */ 4, /* 212 */ 5, /* 213 */ 5, /* 214 */
- 6, /* 215 */ 4, /* 216 */ 5, /* 217 */ 5, /* 218 */ 6, /* 219 */
- 5, /* 220 */ 6, /* 221 */ 6, /* 222 */ 7, /* 223 */ 3, /* 224 */
- 4, /* 225 */ 4, /* 226 */ 5, /* 227 */ 4, /* 228 */ 5, /* 229 */
- 5, /* 230 */ 6, /* 231 */ 4, /* 232 */ 5, /* 233 */ 5, /* 234 */
- 6, /* 235 */ 5, /* 236 */ 6, /* 237 */ 6, /* 238 */ 7, /* 239 */
- 4, /* 240 */ 5, /* 241 */ 5, /* 242 */ 6, /* 243 */ 5, /* 244 */
- 6, /* 245 */ 6, /* 246 */ 7, /* 247 */ 5, /* 248 */ 6, /* 249 */
- 6, /* 250 */ 7, /* 251 */ 6, /* 252 */ 7, /* 253 */ 7, /* 254 */
- 8 /* 255 */
-}; // end _Bit_count
-
-template<bool __dummy>
-unsigned char _First_one<__dummy>::_S_first_one[] = {
- 0, /* 0 */ 0, /* 1 */ 1, /* 2 */ 0, /* 3 */ 2, /* 4 */
- 0, /* 5 */ 1, /* 6 */ 0, /* 7 */ 3, /* 8 */ 0, /* 9 */
- 1, /* 10 */ 0, /* 11 */ 2, /* 12 */ 0, /* 13 */ 1, /* 14 */
- 0, /* 15 */ 4, /* 16 */ 0, /* 17 */ 1, /* 18 */ 0, /* 19 */
- 2, /* 20 */ 0, /* 21 */ 1, /* 22 */ 0, /* 23 */ 3, /* 24 */
- 0, /* 25 */ 1, /* 26 */ 0, /* 27 */ 2, /* 28 */ 0, /* 29 */
- 1, /* 30 */ 0, /* 31 */ 5, /* 32 */ 0, /* 33 */ 1, /* 34 */
- 0, /* 35 */ 2, /* 36 */ 0, /* 37 */ 1, /* 38 */ 0, /* 39 */
- 3, /* 40 */ 0, /* 41 */ 1, /* 42 */ 0, /* 43 */ 2, /* 44 */
- 0, /* 45 */ 1, /* 46 */ 0, /* 47 */ 4, /* 48 */ 0, /* 49 */
- 1, /* 50 */ 0, /* 51 */ 2, /* 52 */ 0, /* 53 */ 1, /* 54 */
- 0, /* 55 */ 3, /* 56 */ 0, /* 57 */ 1, /* 58 */ 0, /* 59 */
- 2, /* 60 */ 0, /* 61 */ 1, /* 62 */ 0, /* 63 */ 6, /* 64 */
- 0, /* 65 */ 1, /* 66 */ 0, /* 67 */ 2, /* 68 */ 0, /* 69 */
- 1, /* 70 */ 0, /* 71 */ 3, /* 72 */ 0, /* 73 */ 1, /* 74 */
- 0, /* 75 */ 2, /* 76 */ 0, /* 77 */ 1, /* 78 */ 0, /* 79 */
- 4, /* 80 */ 0, /* 81 */ 1, /* 82 */ 0, /* 83 */ 2, /* 84 */
- 0, /* 85 */ 1, /* 86 */ 0, /* 87 */ 3, /* 88 */ 0, /* 89 */
- 1, /* 90 */ 0, /* 91 */ 2, /* 92 */ 0, /* 93 */ 1, /* 94 */
- 0, /* 95 */ 5, /* 96 */ 0, /* 97 */ 1, /* 98 */ 0, /* 99 */
- 2, /* 100 */ 0, /* 101 */ 1, /* 102 */ 0, /* 103 */ 3, /* 104 */
- 0, /* 105 */ 1, /* 106 */ 0, /* 107 */ 2, /* 108 */ 0, /* 109 */
- 1, /* 110 */ 0, /* 111 */ 4, /* 112 */ 0, /* 113 */ 1, /* 114 */
- 0, /* 115 */ 2, /* 116 */ 0, /* 117 */ 1, /* 118 */ 0, /* 119 */
- 3, /* 120 */ 0, /* 121 */ 1, /* 122 */ 0, /* 123 */ 2, /* 124 */
- 0, /* 125 */ 1, /* 126 */ 0, /* 127 */ 7, /* 128 */ 0, /* 129 */
- 1, /* 130 */ 0, /* 131 */ 2, /* 132 */ 0, /* 133 */ 1, /* 134 */
- 0, /* 135 */ 3, /* 136 */ 0, /* 137 */ 1, /* 138 */ 0, /* 139 */
- 2, /* 140 */ 0, /* 141 */ 1, /* 142 */ 0, /* 143 */ 4, /* 144 */
- 0, /* 145 */ 1, /* 146 */ 0, /* 147 */ 2, /* 148 */ 0, /* 149 */
- 1, /* 150 */ 0, /* 151 */ 3, /* 152 */ 0, /* 153 */ 1, /* 154 */
- 0, /* 155 */ 2, /* 156 */ 0, /* 157 */ 1, /* 158 */ 0, /* 159 */
- 5, /* 160 */ 0, /* 161 */ 1, /* 162 */ 0, /* 163 */ 2, /* 164 */
- 0, /* 165 */ 1, /* 166 */ 0, /* 167 */ 3, /* 168 */ 0, /* 169 */
- 1, /* 170 */ 0, /* 171 */ 2, /* 172 */ 0, /* 173 */ 1, /* 174 */
- 0, /* 175 */ 4, /* 176 */ 0, /* 177 */ 1, /* 178 */ 0, /* 179 */
- 2, /* 180 */ 0, /* 181 */ 1, /* 182 */ 0, /* 183 */ 3, /* 184 */
- 0, /* 185 */ 1, /* 186 */ 0, /* 187 */ 2, /* 188 */ 0, /* 189 */
- 1, /* 190 */ 0, /* 191 */ 6, /* 192 */ 0, /* 193 */ 1, /* 194 */
- 0, /* 195 */ 2, /* 196 */ 0, /* 197 */ 1, /* 198 */ 0, /* 199 */
- 3, /* 200 */ 0, /* 201 */ 1, /* 202 */ 0, /* 203 */ 2, /* 204 */
- 0, /* 205 */ 1, /* 206 */ 0, /* 207 */ 4, /* 208 */ 0, /* 209 */
- 1, /* 210 */ 0, /* 211 */ 2, /* 212 */ 0, /* 213 */ 1, /* 214 */
- 0, /* 215 */ 3, /* 216 */ 0, /* 217 */ 1, /* 218 */ 0, /* 219 */
- 2, /* 220 */ 0, /* 221 */ 1, /* 222 */ 0, /* 223 */ 5, /* 224 */
- 0, /* 225 */ 1, /* 226 */ 0, /* 227 */ 2, /* 228 */ 0, /* 229 */
- 1, /* 230 */ 0, /* 231 */ 3, /* 232 */ 0, /* 233 */ 1, /* 234 */
- 0, /* 235 */ 2, /* 236 */ 0, /* 237 */ 1, /* 238 */ 0, /* 239 */
- 4, /* 240 */ 0, /* 241 */ 1, /* 242 */ 0, /* 243 */ 2, /* 244 */
- 0, /* 245 */ 1, /* 246 */ 0, /* 247 */ 3, /* 248 */ 0, /* 249 */
- 1, /* 250 */ 0, /* 251 */ 2, /* 252 */ 0, /* 253 */ 1, /* 254 */
- 0, /* 255 */
-}; // end _First_one
-
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma reset woff 1209
-#endif
-
-__STL_END_NAMESPACE
-
-
-#undef __BITS_PER_WORDT
-#undef __BITSET_WORDS
-
-#endif /* __SGI_STL_BITSET */
-
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/contrib/libstdc++/stl/bvector.h b/contrib/libstdc++/stl/bvector.h
deleted file mode 100644
index 03a3fb1c7f23..000000000000
--- a/contrib/libstdc++/stl/bvector.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- *
- * Copyright (c) 1996
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- */
-
-#ifndef __SGI_STL_BVECTOR_H
-#define __SGI_STL_BVECTOR_H
-
-#ifdef __STL_CLASS_PARTIAL_SPECIALIZATION
-#include <vector.h>
-#else
-#include <algobase.h>
-#include <alloc.h>
-#endif
-
-#include <stl_bvector.h>
-
-#ifdef __STL_USE_NAMESPACES
-
-using __STD::bit_vector;
-
-#endif /* __STL_USE_NAMESPACES */
-
-#endif /* __SGI_STL_BVECTOR_H */
-
-// Local Variables:
-// mode:C++
-// End:
-
-
diff --git a/contrib/libstdc++/stl/defalloc.h b/contrib/libstdc++/stl/defalloc.h
deleted file mode 100644
index 0bfcc2c20a51..000000000000
--- a/contrib/libstdc++/stl/defalloc.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- */
-
-// Inclusion of this file is DEPRECATED. This is the original HP
-// default allocator. It is provided only for backward compatibility.
-// This file WILL BE REMOVED in a future release.
-//
-// DO NOT USE THIS FILE unless you have an old container implementation
-// that requires an allocator with the HP-style interface.
-//
-// Standard-conforming allocators have a very different interface. The
-// standard default allocator is declared in the header <memory>.
-
-#ifndef DEFALLOC_H
-#define DEFALLOC_H
-
-#include <new.h>
-#include <stddef.h>
-#include <stdlib.h>
-#include <limits.h>
-#include <iostream.h>
-#include <algobase.h>
-
-
-template <class T>
-inline T* allocate(ptrdiff_t size, T*) {
- set_new_handler(0);
- T* tmp = (T*)(::operator new((size_t)(size * sizeof(T))));
- if (tmp == 0) {
- cerr << "out of memory" << endl;
- exit(1);
- }
- return tmp;
-}
-
-
-template <class T>
-inline void deallocate(T* buffer) {
- ::operator delete(buffer);
-}
-
-template <class T>
-class allocator {
-public:
- typedef T value_type;
- typedef T* pointer;
- typedef const T* const_pointer;
- typedef T& reference;
- typedef const T& const_reference;
- typedef size_t size_type;
- typedef ptrdiff_t difference_type;
- pointer allocate(size_type n) {
- return ::allocate((difference_type)n, (pointer)0);
- }
- void deallocate(pointer p) { ::deallocate(p); }
- pointer address(reference x) { return (pointer)&x; }
- const_pointer const_address(const_reference x) {
- return (const_pointer)&x;
- }
- size_type init_page_size() {
- return max(size_type(1), size_type(4096/sizeof(T)));
- }
- size_type max_size() const {
- return max(size_type(1), size_type(UINT_MAX/sizeof(T)));
- }
-};
-
-class allocator<void> {
-public:
- typedef void* pointer;
-};
-
-
-
-#endif
diff --git a/contrib/libstdc++/stl/deque b/contrib/libstdc++/stl/deque
deleted file mode 100644
index 61654acad5bb..000000000000
--- a/contrib/libstdc++/stl/deque
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- *
- * Copyright (c) 1997
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- */
-
-#ifndef __SGI_STL_DEQUE
-#define __SGI_STL_DEQUE
-
-#include <stl_algobase.h>
-#include <stl_alloc.h>
-#include <stl_construct.h>
-#include <stl_uninitialized.h>
-#include <stl_deque.h>
-
-#endif /* __SGI_STL_DEQUE */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/contrib/libstdc++/stl/deque.h b/contrib/libstdc++/stl/deque.h
deleted file mode 100644
index ede38b1ceba8..000000000000
--- a/contrib/libstdc++/stl/deque.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- *
- * Copyright (c) 1997
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- */
-
-#ifndef __SGI_STL_DEQUE_H
-#define __SGI_STL_DEQUE_H
-
-#include <algobase.h>
-#include <alloc.h>
-#include <stl_deque.h>
-
-#ifdef __STL_USE_NAMESPACES
-using __STD::deque;
-#endif /* __STL_USE_NAMESPACES */
-
-#endif /* __SGI_STL_DEQUE_H */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/contrib/libstdc++/stl/function.h b/contrib/libstdc++/stl/function.h
deleted file mode 100644
index 6474dd99fa2e..000000000000
--- a/contrib/libstdc++/stl/function.h
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- *
- * Copyright (c) 1996,1997
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- */
-
-#ifndef __SGI_STL_FUNCTION_H
-#define __SGI_STL_FUNCTION_H
-
-#ifndef __STL_CONFIG_H
-#include <stl_config.h>
-#endif
-#ifndef __SGI_STL_INTERNAL_RELOPS
-#include <stl_relops.h>
-#endif
-#include <stddef.h>
-#ifndef __SGI_STL_INTERNAL_FUNCTION_H
-#include <stl_function.h>
-#endif
-
-#ifdef __STL_USE_NAMESPACE_FOR_RELOPS
-
-// Names from stl_relops.h
-using __STD_RELOPS::operator!=;
-using __STD_RELOPS::operator>;
-using __STD_RELOPS::operator<=;
-using __STD_RELOPS::operator>=;
-
-#endif /* __STL_USE_NAMESPACE_FOR_RELOPS */
-
-#ifdef __STL_USE_NAMESPACES
-
-// Names from stl_function.h
-using __STD::unary_function;
-using __STD::binary_function;
-using __STD::plus;
-using __STD::minus;
-using __STD::multiplies;
-using __STD::divides;
-using __STD::identity_element;
-using __STD::modulus;
-using __STD::negate;
-using __STD::equal_to;
-using __STD::not_equal_to;
-using __STD::greater;
-using __STD::less;
-using __STD::greater_equal;
-using __STD::less_equal;
-using __STD::logical_and;
-using __STD::logical_or;
-using __STD::logical_not;
-using __STD::unary_negate;
-using __STD::binary_negate;
-using __STD::not1;
-using __STD::not2;
-using __STD::binder1st;
-using __STD::binder2nd;
-using __STD::bind1st;
-using __STD::bind2nd;
-using __STD::unary_compose;
-using __STD::binary_compose;
-using __STD::compose1;
-using __STD::compose2;
-using __STD::pointer_to_unary_function;
-using __STD::pointer_to_binary_function;
-using __STD::ptr_fun;
-using __STD::identity;
-using __STD::select1st;
-using __STD::select2nd;
-using __STD::project1st;
-using __STD::project2nd;
-using __STD::constant_void_fun;
-using __STD::constant_unary_fun;
-using __STD::constant_binary_fun;
-using __STD::constant0;
-using __STD::constant1;
-using __STD::constant2;
-using __STD::subtractive_rng;
-using __STD::mem_fun_t;
-using __STD::const_mem_fun_t;
-using __STD::mem_fun_ref_t;
-using __STD::const_mem_fun_ref_t;
-using __STD::mem_fun1_t;
-using __STD::const_mem_fun1_t;
-using __STD::mem_fun1_ref_t;
-using __STD::const_mem_fun1_ref_t;
-using __STD::mem_fun;
-using __STD::mem_fun_ref;
-using __STD::mem_fun1;
-using __STD::mem_fun1_ref;
-
-#endif /* __STL_USE_NAMESPACES */
-
-#endif /* __SGI_STL_FUNCTION_H */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/contrib/libstdc++/stl/functional b/contrib/libstdc++/stl/functional
deleted file mode 100644
index d046dbb036d6..000000000000
--- a/contrib/libstdc++/stl/functional
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright (c) 1997
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef __SGI_STL_FUNCTIONAL
-#define __SGI_STL_FUNCTIONAL
-
-#include <stl_config.h>
-#include <stddef.h>
-#include <stl_function.h>
-
-#endif /* __SGI_STL_FUNCTIONAL */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/contrib/libstdc++/stl/hash_map b/contrib/libstdc++/stl/hash_map
deleted file mode 100644
index f7421e026fab..000000000000
--- a/contrib/libstdc++/stl/hash_map
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 1996
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef __SGI_STL_HASH_MAP
-#define __SGI_STL_HASH_MAP
-
-#ifndef __SGI_STL_INTERNAL_HASHTABLE_H
-#include <stl_hashtable.h>
-#endif
-
-#include <stl_hash_map.h>
-
-#endif /* __SGI_STL_HASH_MAP */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/contrib/libstdc++/stl/hash_map.h b/contrib/libstdc++/stl/hash_map.h
deleted file mode 100644
index f3471627044c..000000000000
--- a/contrib/libstdc++/stl/hash_map.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 1996
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef __SGI_STL_HASH_MAP_H
-#define __SGI_STL_HASH_MAP_H
-
-#ifndef __SGI_STL_INTERNAL_HASHTABLE_H
-#include <stl_hashtable.h>
-#endif
-
-#include <algobase.h>
-#include <stl_hash_map.h>
-
-#ifdef __STL_USE_NAMESPACES
-using __STD::hash;
-using __STD::hashtable;
-using __STD::hash_map;
-using __STD::hash_multimap;
-#endif /* __STL_USE_NAMESPACES */
-
-
-#endif /* __SGI_STL_HASH_MAP_H */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/contrib/libstdc++/stl/hash_set b/contrib/libstdc++/stl/hash_set
deleted file mode 100644
index 2244f47cfa01..000000000000
--- a/contrib/libstdc++/stl/hash_set
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 1996
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef __SGI_STL_HASH_SET
-#define __SGI_STL_HASH_SET
-
-#ifndef __SGI_STL_INTERNAL_HASHTABLE_H
-#include <stl_hashtable.h>
-#endif
-
-#include <stl_hash_set.h>
-
-#endif /* __SGI_STL_HASH_SET */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/contrib/libstdc++/stl/hash_set.h b/contrib/libstdc++/stl/hash_set.h
deleted file mode 100644
index d3e93c0c26be..000000000000
--- a/contrib/libstdc++/stl/hash_set.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 1996
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef __SGI_STL_HASH_SET_H
-#define __SGI_STL_HASH_SET_H
-
-#ifndef __SGI_STL_INTERNAL_HASHTABLE_H
-#include <stl_hashtable.h>
-#endif
-
-#include <algobase.h>
-#include <stl_hash_set.h>
-
-#ifdef __STL_USE_NAMESPACES
-using __STD::hash;
-using __STD::hashtable;
-using __STD::hash_set;
-using __STD::hash_multiset;
-#endif /* __STL_USE_NAMESPACES */
-
-#endif /* __SGI_STL_HASH_SET_H */
diff --git a/contrib/libstdc++/stl/hashtable.h b/contrib/libstdc++/stl/hashtable.h
deleted file mode 100644
index 15dbfc916441..000000000000
--- a/contrib/libstdc++/stl/hashtable.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1996,1997
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- */
-
-/* NOTE: This is an internal header file, included by other STL headers.
- * You should not attempt to use it directly.
- */
-
-#ifndef __SGI_STL_HASHTABLE_H
-#define __SGI_STL_HASHTABLE_H
-
-#include <stl_hashtable.h>
-#include <algo.h>
-#include <alloc.h>
-#include <vector.h>
-
-#ifdef __STL_USE_NAMESPACES
-using __STD::hash;
-using __STD::hashtable;
-#endif /* __STL_USE_NAMESPACES */
-
-#endif /* __SGI_STL_HASHTABLE_H */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/contrib/libstdc++/stl/heap.h b/contrib/libstdc++/stl/heap.h
deleted file mode 100644
index 2ec93c07b765..000000000000
--- a/contrib/libstdc++/stl/heap.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- * Copyright (c) 1997
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- */
-
-#ifndef __SGI_STL_HEAP_H
-#define __SGI_STL_HEAP_H
-
-#include <stl_config.h>
-#include <stl_heap.h>
-
-#ifdef __STL_USE_NAMESPACES
-
-using __STD::push_heap;
-using __STD::pop_heap;
-using __STD::make_heap;
-using __STD::sort_heap;
-
-#endif /* __STL_USE_NAMESPACES */
-
-
-#endif /* __SGI_STL_HEAP_H */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/contrib/libstdc++/stl/iterator b/contrib/libstdc++/stl/iterator
deleted file mode 100644
index 4ddd208f2755..000000000000
--- a/contrib/libstdc++/stl/iterator
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- *
- * Copyright (c) 1996,1997
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- */
-
-#ifndef __SGI_STL_ITERATOR
-#define __SGI_STL_ITERATOR
-
-#include <stl_config.h>
-#include <stl_relops.h>
-#include <stddef.h> /* XXX should use <cstddef> */
-#if 0 /* XXX define a flag for this */
-#include <iostream>
-#else
-#include <iostream.h>
-#endif
-#include <stl_iterator.h>
-
-#endif /* __SGI_STL_ITERATOR */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/contrib/libstdc++/stl/iterator.h b/contrib/libstdc++/stl/iterator.h
deleted file mode 100644
index f8a023774228..000000000000
--- a/contrib/libstdc++/stl/iterator.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- *
- * Copyright (c) 1996
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- */
-
-#ifndef __SGI_STL_ITERATOR_H
-#define __SGI_STL_ITERATOR_H
-
-#ifndef __SGI_STL_FUNCTION_H
-#include <function.h>
-#endif
-#include <stddef.h>
-#include <iostream.h>
-#ifndef __SGI_STL_INTERNAL_ITERATOR_H
-#include <stl_iterator.h>
-#endif
-#ifndef __TYPE_TRAITS_H
-#include <type_traits.h>
-#endif
-#ifndef __SGI_STL_INTERNAL_CONSTRUCT_H
-#include <stl_construct.h>
-#endif
-#ifndef __SGI_STL_INTERNAL_RAW_STORAGE_ITERATOR_H
-#include <stl_raw_storage_iter.h>
-#endif
-
-#ifdef __STL_USE_NAMESPACES
-
-// Names from stl_iterator.h
-
-using __STD::input_iterator_tag;
-using __STD::output_iterator_tag;
-using __STD::forward_iterator_tag;
-using __STD::bidirectional_iterator_tag;
-using __STD::random_access_iterator_tag;
-
-#if 0
-using __STD::iterator;
-#endif
-using __STD::input_iterator;
-using __STD::output_iterator;
-using __STD::forward_iterator;
-using __STD::bidirectional_iterator;
-using __STD::random_access_iterator;
-
-#ifdef __STL_CLASS_PARTIAL_SPECIALIZATION
-using __STD::iterator_traits;
-#endif
-
-using __STD::iterator_category;
-using __STD::distance_type;
-using __STD::value_type;
-
-using __STD::distance;
-using __STD::advance;
-
-using __STD::insert_iterator;
-using __STD::front_insert_iterator;
-using __STD::back_insert_iterator;
-using __STD::inserter;
-using __STD::front_inserter;
-using __STD::back_inserter;
-
-using __STD::reverse_iterator;
-using __STD::reverse_bidirectional_iterator;
-
-using __STD::istream_iterator;
-using __STD::ostream_iterator;
-
-// Names from stl_construct.h
-using __STD::construct;
-using __STD::destroy;
-
-// Names from stl_raw_storage_iter.h
-using __STD::raw_storage_iterator;
-
-#endif /* __STL_USE_NAMESPACES */
-
-#endif /* __SGI_STL_ITERATOR_H */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/contrib/libstdc++/stl/list b/contrib/libstdc++/stl/list
deleted file mode 100644
index 5294f39fea69..000000000000
--- a/contrib/libstdc++/stl/list
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- *
- * Copyright (c) 1996,1997
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- */
-
-#ifndef __SGI_STL_LIST
-#define __SGI_STL_LIST
-
-#include <stl_algobase.h>
-#include <stl_alloc.h>
-#include <stl_construct.h>
-#include <stl_uninitialized.h>
-#include <stl_list.h>
-
-#endif /* __SGI_STL_LIST */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/contrib/libstdc++/stl/list.h b/contrib/libstdc++/stl/list.h
deleted file mode 100644
index 4e6ee0b4113b..000000000000
--- a/contrib/libstdc++/stl/list.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- *
- * Copyright (c) 1996,1997
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- */
-
-#ifndef __SGI_STL_LIST_H
-#define __SGI_STL_LIST_H
-
-#include <algobase.h>
-#include <alloc.h>
-#include <stl_list.h>
-
-#ifdef __STL_USE_NAMESPACES
-using __STD::list;
-#endif /* __STL_USE_NAMESPACES */
-
-#endif /* __SGI_STL_LIST_H */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/contrib/libstdc++/stl/map b/contrib/libstdc++/stl/map
deleted file mode 100644
index 4cfb7652c545..000000000000
--- a/contrib/libstdc++/stl/map
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- *
- * Copyright (c) 1996,1997
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- */
-
-#ifndef __SGI_STL_MAP
-#define __SGI_STL_MAP
-
-#ifndef __SGI_STL_INTERNAL_TREE_H
-#include <stl_tree.h>
-#endif
-#include <stl_map.h>
-#include <stl_multimap.h>
-
-#endif /* __SGI_STL_MAP */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/contrib/libstdc++/stl/map.h b/contrib/libstdc++/stl/map.h
deleted file mode 100644
index a89bd31e81cd..000000000000
--- a/contrib/libstdc++/stl/map.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- *
- * Copyright (c) 1996,1997
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- */
-
-#ifndef __SGI_STL_MAP_H
-#define __SGI_STL_MAP_H
-
-#include <tree.h>
-#include <stl_map.h>
-
-#ifdef __STL_USE_NAMESPACES
-using __STD::map;
-#endif /* __STL_USE_NAMESPACES */
-
-#endif /* __SGI_STL_MAP_H */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/contrib/libstdc++/stl/memory b/contrib/libstdc++/stl/memory
deleted file mode 100644
index 64338dd313a6..000000000000
--- a/contrib/libstdc++/stl/memory
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Copyright (c) 1997
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef __SGI_STL_MEMORY
-#define __SGI_STL_MEMORY
-
-#include <stl_algobase.h>
-#include <stl_alloc.h>
-#include <stl_construct.h>
-#include <stl_tempbuf.h>
-#include <stl_uninitialized.h>
-#include <stl_raw_storage_iter.h>
-
-
-#if defined(__STL_MEMBER_TEMPLATES)
-
-__STL_BEGIN_NAMESPACE
-
-template <class _Tp> class auto_ptr {
-private:
- _Tp* _M_ptr;
-
-public:
- typedef _Tp element_type;
- explicit auto_ptr(_Tp* __p = 0) __STL_NOTHROW : _M_ptr(__p) {}
- auto_ptr(auto_ptr& __a) __STL_NOTHROW : _M_ptr(__a.release()) {}
- template <class _Tp1> auto_ptr(auto_ptr<_Tp1>& __a) __STL_NOTHROW
- : _M_ptr(__a.release()) {}
- auto_ptr& operator=(auto_ptr& __a) __STL_NOTHROW {
- if (&__a != this) {
- delete _M_ptr;
- _M_ptr = __a.release();
- }
- return *this;
- }
- template <class _Tp1>
- auto_ptr& operator=(auto_ptr<_Tp1>& __a) __STL_NOTHROW {
- if (__a.get() != this->get()) {
- delete _M_ptr;
- _M_ptr = __a.release();
- }
- return *this;
- }
- ~auto_ptr() __STL_NOTHROW { delete _M_ptr; }
-
- _Tp& operator*() const __STL_NOTHROW {
- return *_M_ptr;
- }
- _Tp* operator->() const __STL_NOTHROW {
- return _M_ptr;
- }
- _Tp* get() const __STL_NOTHROW {
- return _M_ptr;
- }
- _Tp* release() __STL_NOTHROW {
- _Tp* __tmp = _M_ptr;
- _M_ptr = 0;
- return __tmp;
- }
- void reset(_Tp* __p = 0) __STL_NOTHROW {
- delete _M_ptr;
- _M_ptr = __p;
- }
-
- // According to the C++ standard, these conversions are required. Most
- // present-day compilers, however, do not enforce that requirement---and,
- // in fact, most present-day compilers do not support the language
- // features that these conversions rely on.
-
-#ifdef __SGI_STL_USE_AUTO_PTR_CONVERSIONS
-
-private:
- template<class _Tp1> struct auto_ptr_ref {
- _Tp1* _M_ptr;
- auto_ptr_ref(_Tp1* __p) : _M_ptr(__p) {}
- };
-
-public:
- auto_ptr(auto_ptr_ref<_Tp> __ref) __STL_NOTHROW
- : _M_ptr(__ref._M_ptr) {}
- template <class _Tp1> operator auto_ptr_ref<_Tp1>() __STL_NOTHROW
- { return auto_ptr_ref<_Tp>(this->release()); }
- template <class _Tp1> operator auto_ptr<_Tp1>() __STL_NOTHROW
- { return auto_ptr<_Tp1>(this->release()); }
-
-#endif /* __SGI_STL_USE_AUTO_PTR_CONVERSIONS */
-};
-
-__STL_END_NAMESPACE
-#endif /* member templates */
-
-#endif /* __SGI_STL_MEMORY */
-
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/contrib/libstdc++/stl/multimap.h b/contrib/libstdc++/stl/multimap.h
deleted file mode 100644
index 1a8ec4af4f94..000000000000
--- a/contrib/libstdc++/stl/multimap.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- *
- * Copyright (c) 1996,1997
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- */
-
-#ifndef __SGI_STL_MULTIMAP_H
-#define __SGI_STL_MULTIMAP_H
-
-#include <tree.h>
-#include <stl_multimap.h>
-
-#ifdef __STL_USE_NAMESPACES
-using __STD::multimap;
-#endif /* __STL_USE_NAMESPACES */
-
-#endif /* __SGI_STL_MULTIMAP_H */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/contrib/libstdc++/stl/multiset.h b/contrib/libstdc++/stl/multiset.h
deleted file mode 100644
index 3024fd74c03d..000000000000
--- a/contrib/libstdc++/stl/multiset.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- *
- * Copyright (c) 1996,1997
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- */
-
-#ifndef __SGI_STL_MULTISET_H
-#define __SGI_STL_MULTISET_H
-
-#include <tree.h>
-#include <stl_multiset.h>
-
-#ifdef __STL_USE_NAMESPACES
-using __STD::multiset;
-#endif /* __STL_USE_NAMESPACES */
-
-#endif /* __SGI_STL_MULTISET_H */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/contrib/libstdc++/stl/numeric b/contrib/libstdc++/stl/numeric
deleted file mode 100644
index 7f048e11b568..000000000000
--- a/contrib/libstdc++/stl/numeric
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- *
- * Copyright (c) 1996,1997
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- */
-
-#ifndef __SGI_STL_NUMERIC
-#define __SGI_STL_NUMERIC
-
-#include <stl_config.h>
-#include <stl_relops.h>
-#include <stddef.h>
-#include <iostream.h>
-#include <stl_iterator.h>
-#include <stl_function.h>
-#include <stl_numeric.h>
-
-#endif /* __SGI_STL_NUMERIC */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/contrib/libstdc++/stl/pair.h b/contrib/libstdc++/stl/pair.h
deleted file mode 100644
index 00f5caddb614..000000000000
--- a/contrib/libstdc++/stl/pair.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- *
- * Copyright (c) 1996,1997
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- */
-
-#ifndef __SGI_STL_PAIR_H
-#define __SGI_STL_PAIR_H
-
-#ifndef __STL_CONFIG_H
-#include <stl_config.h>
-#endif
-#ifndef __SGI_STL_INTERNAL_RELOPS
-#include <stl_relops.h>
-#endif
-#ifndef __SGI_STL_INTERNAL_PAIR_H
-#include <stl_pair.h>
-#endif
-
-#ifdef __STL_USE_NAMESPACES
-
-using __STD::pair;
-using __STD::make_pair;
-
-#endif /* __STL_USE_NAMESPACES */
-
-#endif /* __SGI_STL_PAIR_H */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/contrib/libstdc++/stl/pthread_alloc b/contrib/libstdc++/stl/pthread_alloc
deleted file mode 100644
index 1852908095b0..000000000000
--- a/contrib/libstdc++/stl/pthread_alloc
+++ /dev/null
@@ -1,479 +0,0 @@
-/*
- * Copyright (c) 1996
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- */
-
-#ifndef __SGI_STL_PTHREAD_ALLOC
-#define __SGI_STL_PTHREAD_ALLOC
-
-// Pthread-specific node allocator.
-// This is similar to the default allocator, except that free-list
-// information is kept separately for each thread, avoiding locking.
-// This should be reasonably fast even in the presence of threads.
-// The down side is that storage may not be well-utilized.
-// It is not an error to allocate memory in thread A and deallocate
-// it in thread B. But this effectively transfers ownership of the memory,
-// so that it can only be reallocated by thread B. Thus this can effectively
-// result in a storage leak if it's done on a regular basis.
-// It can also result in frequent sharing of
-// cache lines among processors, with potentially serious performance
-// consequences.
-
-#include <stl_config.h>
-#include <stl_alloc.h>
-#ifndef __RESTRICT
-# define __RESTRICT
-#endif
-
-__STL_BEGIN_NAMESPACE
-
-#define __STL_DATA_ALIGNMENT 8
-
-union _Pthread_alloc_obj {
- union _Pthread_alloc_obj * __free_list_link;
- char __client_data[__STL_DATA_ALIGNMENT]; /* The client sees this. */
-};
-
-// Pthread allocators don't appear to the client to have meaningful
-// instances. We do in fact need to associate some state with each
-// thread. That state is represented by
-// _Pthread_alloc_per_thread_state<_Max_size>.
-
-template<size_t _Max_size>
-struct _Pthread_alloc_per_thread_state {
- typedef _Pthread_alloc_obj __obj;
- enum { _S_NFREELISTS = _Max_size/__STL_DATA_ALIGNMENT };
- _Pthread_alloc_obj* volatile __free_list[_S_NFREELISTS];
- _Pthread_alloc_per_thread_state<_Max_size> * __next;
- // Free list link for list of available per thread structures.
- // When one of these becomes available for reuse due to thread
- // termination, any objects in its free list remain associated
- // with it. The whole structure may then be used by a newly
- // created thread.
- _Pthread_alloc_per_thread_state() : __next(0)
- {
- memset((void *)__free_list, 0, _S_NFREELISTS * sizeof(__obj *));
- }
- // Returns an object of size __n, and possibly adds to size n free list.
- void *_M_refill(size_t __n);
-};
-
-// Pthread-specific allocator.
-// The argument specifies the largest object size allocated from per-thread
-// free lists. Larger objects are allocated using malloc_alloc.
-// Max_size must be a power of 2.
-template <size_t _Max_size = 128>
-class _Pthread_alloc_template {
-
-public: // but only for internal use:
-
- typedef _Pthread_alloc_obj __obj;
-
- // Allocates a chunk for nobjs of size "size". nobjs may be reduced
- // if it is inconvenient to allocate the requested number.
- static char *_S_chunk_alloc(size_t __size, int &__nobjs);
-
- enum {_S_ALIGN = __STL_DATA_ALIGNMENT};
-
- static size_t _S_round_up(size_t __bytes) {
- return (((__bytes) + _S_ALIGN-1) & ~(_S_ALIGN - 1));
- }
- static size_t _S_freelist_index(size_t __bytes) {
- return (((__bytes) + _S_ALIGN-1)/_S_ALIGN - 1);
- }
-
-private:
- // Chunk allocation state. And other shared state.
- // Protected by _S_chunk_allocator_lock.
- static pthread_mutex_t _S_chunk_allocator_lock;
- static char *_S_start_free;
- static char *_S_end_free;
- static size_t _S_heap_size;
- static _Pthread_alloc_per_thread_state<_Max_size>* _S_free_per_thread_states;
- static pthread_key_t _S_key;
- static bool _S_key_initialized;
- // Pthread key under which per thread state is stored.
- // Allocator instances that are currently unclaimed by any thread.
- static void _S_destructor(void *instance);
- // Function to be called on thread exit to reclaim per thread
- // state.
- static _Pthread_alloc_per_thread_state<_Max_size> *_S_new_per_thread_state();
- // Return a recycled or new per thread state.
- static _Pthread_alloc_per_thread_state<_Max_size> *_S_get_per_thread_state();
- // ensure that the current thread has an associated
- // per thread state.
- friend class _M_lock;
- class _M_lock {
- public:
- _M_lock () { pthread_mutex_lock(&_S_chunk_allocator_lock); }
- ~_M_lock () { pthread_mutex_unlock(&_S_chunk_allocator_lock); }
- };
-
-public:
-
- /* n must be > 0 */
- static void * allocate(size_t __n)
- {
- __obj * volatile * __my_free_list;
- __obj * __RESTRICT __result;
- _Pthread_alloc_per_thread_state<_Max_size>* __a;
-
- if (__n > _Max_size) {
- return(malloc_alloc::allocate(__n));
- }
- if (!_S_key_initialized ||
- !(__a = (_Pthread_alloc_per_thread_state<_Max_size>*)
- pthread_getspecific(_S_key))) {
- __a = _S_get_per_thread_state();
- }
- __my_free_list = __a -> __free_list + _S_freelist_index(__n);
- __result = *__my_free_list;
- if (__result == 0) {
- void *__r = __a -> _M_refill(_S_round_up(__n));
- return __r;
- }
- *__my_free_list = __result -> __free_list_link;
- return (__result);
- };
-
- /* p may not be 0 */
- static void deallocate(void *__p, size_t __n)
- {
- __obj *__q = (__obj *)__p;
- __obj * volatile * __my_free_list;
- _Pthread_alloc_per_thread_state<_Max_size>* __a;
-
- if (__n > _Max_size) {
- malloc_alloc::deallocate(__p, __n);
- return;
- }
- if (!_S_key_initialized ||
- !(__a = (_Pthread_alloc_per_thread_state<_Max_size> *)
- pthread_getspecific(_S_key))) {
- __a = _S_get_per_thread_state();
- }
- __my_free_list = __a->__free_list + _S_freelist_index(__n);
- __q -> __free_list_link = *__my_free_list;
- *__my_free_list = __q;
- }
-
- static void * reallocate(void *__p, size_t __old_sz, size_t __new_sz);
-
-} ;
-
-typedef _Pthread_alloc_template<> pthread_alloc;
-
-
-template <size_t _Max_size>
-void _Pthread_alloc_template<_Max_size>::_S_destructor(void * __instance)
-{
- _M_lock __lock_instance; // Need to acquire lock here.
- _Pthread_alloc_per_thread_state<_Max_size>* __s =
- (_Pthread_alloc_per_thread_state<_Max_size> *)__instance;
- __s -> __next = _S_free_per_thread_states;
- _S_free_per_thread_states = __s;
-}
-
-template <size_t _Max_size>
-_Pthread_alloc_per_thread_state<_Max_size> *
-_Pthread_alloc_template<_Max_size>::_S_new_per_thread_state()
-{
- /* lock already held here. */
- if (0 != _S_free_per_thread_states) {
- _Pthread_alloc_per_thread_state<_Max_size> *__result =
- _S_free_per_thread_states;
- _S_free_per_thread_states = _S_free_per_thread_states -> __next;
- return __result;
- } else {
- return new _Pthread_alloc_per_thread_state<_Max_size>;
- }
-}
-
-template <size_t _Max_size>
-_Pthread_alloc_per_thread_state<_Max_size> *
-_Pthread_alloc_template<_Max_size>::_S_get_per_thread_state()
-{
- /*REFERENCED*/
- _M_lock __lock_instance; // Need to acquire lock here.
- _Pthread_alloc_per_thread_state<_Max_size> * __result;
- if (!_S_key_initialized) {
- if (pthread_key_create(&_S_key, _S_destructor)) {
- abort(); // failed
- }
- _S_key_initialized = true;
- }
- __result = _S_new_per_thread_state();
- if (pthread_setspecific(_S_key, __result)) abort();
- return __result;
-}
-
-/* We allocate memory in large chunks in order to avoid fragmenting */
-/* the malloc heap too much. */
-/* We assume that size is properly aligned. */
-template <size_t _Max_size>
-char *_Pthread_alloc_template<_Max_size>
-::_S_chunk_alloc(size_t __size, int &__nobjs)
-{
- {
- char * __result;
- size_t __total_bytes;
- size_t __bytes_left;
- /*REFERENCED*/
- _M_lock __lock_instance; // Acquire lock for this routine
-
- __total_bytes = __size * __nobjs;
- __bytes_left = _S_end_free - _S_start_free;
- if (__bytes_left >= __total_bytes) {
- __result = _S_start_free;
- _S_start_free += __total_bytes;
- return(__result);
- } else if (__bytes_left >= __size) {
- __nobjs = __bytes_left/__size;
- __total_bytes = __size * __nobjs;
- __result = _S_start_free;
- _S_start_free += __total_bytes;
- return(__result);
- } else {
- size_t __bytes_to_get =
- 2 * __total_bytes + _S_round_up(_S_heap_size >> 4);
- // Try to make use of the left-over piece.
- if (__bytes_left > 0) {
- _Pthread_alloc_per_thread_state<_Max_size>* __a =
- (_Pthread_alloc_per_thread_state<_Max_size>*)
- pthread_getspecific(_S_key);
- __obj * volatile * __my_free_list =
- __a->__free_list + _S_freelist_index(__bytes_left);
-
- ((__obj *)_S_start_free) -> __free_list_link = *__my_free_list;
- *__my_free_list = (__obj *)_S_start_free;
- }
-# ifdef _SGI_SOURCE
- // Try to get memory that's aligned on something like a
- // cache line boundary, so as to avoid parceling out
- // parts of the same line to different threads and thus
- // possibly different processors.
- {
- const int __cache_line_size = 128; // probable upper bound
- __bytes_to_get &= ~(__cache_line_size-1);
- _S_start_free = (char *)memalign(__cache_line_size, __bytes_to_get);
- if (0 == _S_start_free) {
- _S_start_free = (char *)malloc_alloc::allocate(__bytes_to_get);
- }
- }
-# else /* !SGI_SOURCE */
- _S_start_free = (char *)malloc_alloc::allocate(__bytes_to_get);
-# endif
- _S_heap_size += __bytes_to_get;
- _S_end_free = _S_start_free + __bytes_to_get;
- }
- }
- // lock is released here
- return(_S_chunk_alloc(__size, __nobjs));
-}
-
-
-/* Returns an object of size n, and optionally adds to size n free list.*/
-/* We assume that n is properly aligned. */
-/* We hold the allocation lock. */
-template <size_t _Max_size>
-void *_Pthread_alloc_per_thread_state<_Max_size>
-::_M_refill(size_t __n)
-{
- int __nobjs = 128;
- char * __chunk =
- _Pthread_alloc_template<_Max_size>::_S_chunk_alloc(__n, __nobjs);
- __obj * volatile * __my_free_list;
- __obj * __result;
- __obj * __current_obj, * __next_obj;
- int __i;
-
- if (1 == __nobjs) {
- return(__chunk);
- }
- __my_free_list = __free_list
- + _Pthread_alloc_template<_Max_size>::_S_freelist_index(__n);
-
- /* Build free list in chunk */
- __result = (__obj *)__chunk;
- *__my_free_list = __next_obj = (__obj *)(__chunk + __n);
- for (__i = 1; ; __i++) {
- __current_obj = __next_obj;
- __next_obj = (__obj *)((char *)__next_obj + __n);
- if (__nobjs - 1 == __i) {
- __current_obj -> __free_list_link = 0;
- break;
- } else {
- __current_obj -> __free_list_link = __next_obj;
- }
- }
- return(__result);
-}
-
-template <size_t _Max_size>
-void *_Pthread_alloc_template<_Max_size>
-::reallocate(void *__p, size_t __old_sz, size_t __new_sz)
-{
- void * __result;
- size_t __copy_sz;
-
- if (__old_sz > _Max_size
- && __new_sz > _Max_size) {
- return(realloc(__p, __new_sz));
- }
- if (_S_round_up(__old_sz) == _S_round_up(__new_sz)) return(__p);
- __result = allocate(__new_sz);
- __copy_sz = __new_sz > __old_sz? __old_sz : __new_sz;
- memcpy(__result, __p, __copy_sz);
- deallocate(__p, __old_sz);
- return(__result);
-}
-
-template <size_t _Max_size>
-_Pthread_alloc_per_thread_state<_Max_size> *
-_Pthread_alloc_template<_Max_size>::_S_free_per_thread_states = 0;
-
-template <size_t _Max_size>
-pthread_key_t _Pthread_alloc_template<_Max_size>::_S_key;
-
-template <size_t _Max_size>
-bool _Pthread_alloc_template<_Max_size>::_S_key_initialized = false;
-
-template <size_t _Max_size>
-pthread_mutex_t _Pthread_alloc_template<_Max_size>::_S_chunk_allocator_lock
-= PTHREAD_MUTEX_INITIALIZER;
-
-template <size_t _Max_size>
-char *_Pthread_alloc_template<_Max_size>
-::_S_start_free = 0;
-
-template <size_t _Max_size>
-char *_Pthread_alloc_template<_Max_size>
-::_S_end_free = 0;
-
-template <size_t _Max_size>
-size_t _Pthread_alloc_template<_Max_size>
-::_S_heap_size = 0;
-
-#ifdef __STL_USE_STD_ALLOCATORS
-
-template <class _Tp>
-class pthread_allocator {
- typedef pthread_alloc _S_Alloc; // The underlying allocator.
-public:
- typedef size_t size_type;
- typedef ptrdiff_t difference_type;
- typedef _Tp* pointer;
- typedef const _Tp* const_pointer;
- typedef _Tp& reference;
- typedef const _Tp& const_reference;
- typedef _Tp value_type;
-
- template <class _Up> struct rebind {
- typedef pthread_allocator<_Up> other;
- };
-
- pthread_allocator() __STL_NOTHROW {}
- pthread_allocator(const pthread_allocator& a) __STL_NOTHROW {}
- template <class _Up> pthread_allocator(const pthread_allocator<_Up>&)
- __STL_NOTHROW {}
- ~pthread_allocator() __STL_NOTHROW {}
-
- pointer address(reference __x) const { return &__x; }
- const_pointer address(const_reference __x) const { return &__x; }
-
- // __n is permitted to be 0. The C++ standard says nothing about what
- // the return value is when __n == 0.
- _Tp* allocate(size_type __n, const void* = 0) {
- return __n != 0 ? static_cast<_Tp*>(_S_Alloc::allocate(__n * sizeof(_Tp)))
- : 0;
- }
-
- // p is not permitted to be a null pointer.
- void deallocate(pointer __p, size_type __n)
- { _S_Alloc::deallocate(__p, __n * sizeof(_Tp)); }
-
- size_type max_size() const __STL_NOTHROW
- { return size_t(-1) / sizeof(_Tp); }
-
- void construct(pointer __p, const _Tp& __val) { new(__p) _Tp(__val); }
- void destroy(pointer _p) { _p->~_Tp(); }
-};
-
-template<>
-class pthread_allocator<void> {
-public:
- typedef size_t size_type;
- typedef ptrdiff_t difference_type;
- typedef void* pointer;
- typedef const void* const_pointer;
- typedef void value_type;
-
- template <class _Up> struct rebind {
- typedef pthread_allocator<_Up> other;
- };
-};
-
-template <size_t _Max_size>
-inline bool operator==(const _Pthread_alloc_template<_Max_size>&,
- const _Pthread_alloc_template<_Max_size>&)
-{
- return true;
-}
-
-template <class _T1, class _T2>
-inline bool operator==(const pthread_allocator<_T1>&,
- const pthread_allocator<_T2>& a2)
-{
- return true;
-}
-
-template <class _T1, class _T2>
-inline bool operator!=(const pthread_allocator<_T1>&,
- const pthread_allocator<_T2>&)
-{
- return false;
-}
-
-template <class _Tp, size_t _Max_size>
-struct _Alloc_traits<_Tp, _Pthread_alloc_template<_Max_size> >
-{
- static const bool _S_instanceless = true;
- typedef simple_alloc<_Tp, _Pthread_alloc_template<_Max_size> > _Alloc_type;
- typedef __allocator<_Tp, _Pthread_alloc_template<_Max_size> >
- allocator_type;
-};
-
-template <class _Tp, class _Up, size_t _Max>
-struct _Alloc_traits<_Tp, __allocator<_Up, _Pthread_alloc_template<_Max> > >
-{
- static const bool _S_instanceless = true;
- typedef simple_alloc<_Tp, _Pthread_alloc_template<_Max> > _Alloc_type;
- typedef __allocator<_Tp, _Pthread_alloc_template<_Max> > allocator_type;
-};
-
-template <class _Tp, class _Up>
-struct _Alloc_traits<_Tp, pthread_allocator<_Up> >
-{
- static const bool _S_instanceless = true;
- typedef simple_alloc<_Tp, _Pthread_alloc_template<> > _Alloc_type;
- typedef pthread_allocator<_Tp> allocator_type;
-};
-
-
-#endif /* __STL_USE_STD_ALLOCATORS */
-
-__STL_END_NAMESPACE
-
-#endif /* __SGI_STL_PTHREAD_ALLOC */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/contrib/libstdc++/stl/pthread_alloc.h b/contrib/libstdc++/stl/pthread_alloc.h
deleted file mode 100644
index 774ef04edc82..000000000000
--- a/contrib/libstdc++/stl/pthread_alloc.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (c) 1996-1997
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- */
-
-#ifndef __SGI_STL_PTHREAD_ALLOC_H
-#define __SGI_STL_PTHREAD_ALLOC_H
-
-#include <pthread_alloc>
-
-#ifdef __STL_USE_NAMESPACES
-
-using __STD::_Pthread_alloc_template;
-using __STD::pthread_alloc;
-
-#endif /* __STL_USE_NAMESPACES */
-
-
-#endif /* __SGI_STL_PTHREAD_ALLOC_H */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/contrib/libstdc++/stl/queue b/contrib/libstdc++/stl/queue
deleted file mode 100644
index f9417fb1fbb6..000000000000
--- a/contrib/libstdc++/stl/queue
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- *
- * Copyright (c) 1996,1997
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- */
-
-#ifndef __SGI_STL_QUEUE
-#define __SGI_STL_QUEUE
-
-#include <stl_algobase.h>
-#include <stl_alloc.h>
-#include <stl_construct.h>
-#include <stl_uninitialized.h>
-#include <stl_vector.h>
-#include <stl_bvector.h>
-#include <stl_heap.h>
-#include <stl_deque.h>
-#include <stl_function.h>
-#include <stl_queue.h>
-
-#endif /* __SGI_STL_QUEUE */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/contrib/libstdc++/stl/rope b/contrib/libstdc++/stl/rope
deleted file mode 100644
index f861500000b5..000000000000
--- a/contrib/libstdc++/stl/rope
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright (c) 1997
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- */
-
-#ifndef __SGI_STL_ROPE
-#define __SGI_STL_ROPE
-
-#include <stl_algobase.h>
-#include <stl_tempbuf.h>
-#include <stl_algo.h>
-#include <stl_function.h>
-#include <stl_numeric.h>
-#include <stl_alloc.h>
-#include <stl_construct.h>
-#include <stl_uninitialized.h>
-#include <stl_hash_fun.h>
-#include <stl_rope.h>
-
-#endif /* __SGI_STL_ROPE */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/contrib/libstdc++/stl/rope.h b/contrib/libstdc++/stl/rope.h
deleted file mode 100644
index d767fa32e7a2..000000000000
--- a/contrib/libstdc++/stl/rope.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (c) 1997
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- */
-
-#ifndef __SGI_STL_ROPE_H
-#define __SGI_STL_ROPE_H
-
-#include <hashtable.h>
-#include <stl_rope.h>
-
-#ifdef __STL_USE_NAMESPACES
-
-using __STD::char_producer;
-using __STD::sequence_buffer;
-using __STD::rope;
-using __STD::crope;
-using __STD::wrope;
-
-#endif /* __STL_USE_NAMESPACES */
-
-#endif /* __SGI_STL_ROPE_H */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/contrib/libstdc++/stl/ropeimpl.h b/contrib/libstdc++/stl/ropeimpl.h
deleted file mode 100644
index 18bb2c9ec9d1..000000000000
--- a/contrib/libstdc++/stl/ropeimpl.h
+++ /dev/null
@@ -1,1550 +0,0 @@
-/*
- * Copyright (c) 1997
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- */
-
-/* NOTE: This is an internal header file, included by other STL headers.
- * You should not attempt to use it directly.
- */
-
-# include <stdio.h> /* XXX should use <cstdio> */
-# include <iostream.h> /* XXX should use <iostream> */
-
-__STL_BEGIN_NAMESPACE
-
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma set woff 1174
-#endif
-
-// Set buf_start, buf_end, and buf_ptr appropriately, filling tmp_buf
-// if necessary. Assumes _M_path_end[leaf_index] and leaf_pos are correct.
-// Results in a valid buf_ptr if the iterator can be legitimately
-// dereferenced.
-template <class _CharT, class _Alloc>
-void _Rope_iterator_base<_CharT,_Alloc>::_S_setbuf(
- _Rope_iterator_base<_CharT,_Alloc>& __x)
-{
- const _RopeRep* __leaf = __x._M_path_end[__x._M_leaf_index];
- size_t __leaf_pos = __x._M_leaf_pos;
- size_t __pos = __x._M_current_pos;
-
- switch(__leaf->_M_tag) {
- case _RopeRep::_S_leaf:
- __x._M_buf_start =
- ((_Rope_RopeLeaf<_CharT,_Alloc>*)__leaf)->_M_data;
- __x._M_buf_ptr = __x._M_buf_start + (__pos - __leaf_pos);
- __x._M_buf_end = __x._M_buf_start + __leaf->_M_size;
- break;
- case _RopeRep::_S_function:
- case _RopeRep::_S_substringfn:
- {
- size_t __len = _S_iterator_buf_len;
- size_t __buf_start_pos = __leaf_pos;
- size_t __leaf_end = __leaf_pos + __leaf->_M_size;
- char_producer<_CharT>* __fn =
- ((_Rope_RopeFunction<_CharT,_Alloc>*)__leaf)->_M_fn;
-
- if (__buf_start_pos + __len <= __pos) {
- __buf_start_pos = __pos - __len/4;
- if (__buf_start_pos + __len > __leaf_end) {
- __buf_start_pos = __leaf_end - __len;
- }
- }
- if (__buf_start_pos + __len > __leaf_end) {
- __len = __leaf_end - __buf_start_pos;
- }
- (*__fn)(__buf_start_pos - __leaf_pos, __len, __x._M_tmp_buf);
- __x._M_buf_ptr = __x._M_tmp_buf + (__pos - __buf_start_pos);
- __x._M_buf_start = __x._M_tmp_buf;
- __x._M_buf_end = __x._M_tmp_buf + __len;
- }
- break;
- default:
- __stl_assert(0);
- }
-}
-
-// Set path and buffer inside a rope iterator. We assume that
-// pos and root are already set.
-template <class _CharT, class _Alloc>
-void _Rope_iterator_base<_CharT,_Alloc>::_S_setcache
-(_Rope_iterator_base<_CharT,_Alloc>& __x)
-{
- const _RopeRep* __path[_RopeRep::_S_max_rope_depth+1];
- const _RopeRep* __curr_rope;
- int __curr_depth = -1; /* index into path */
- size_t __curr_start_pos = 0;
- size_t __pos = __x._M_current_pos;
- unsigned char __dirns = 0; // Bit vector marking right turns in the path
-
- __stl_assert(__pos <= __x._M_root->_M_size);
- if (__pos >= __x._M_root->_M_size) {
- __x._M_buf_ptr = 0;
- return;
- }
- __curr_rope = __x._M_root;
- if (0 != __curr_rope->_M_c_string) {
- /* Treat the root as a leaf. */
- __x._M_buf_start = __curr_rope->_M_c_string;
- __x._M_buf_end = __curr_rope->_M_c_string + __curr_rope->_M_size;
- __x._M_buf_ptr = __curr_rope->_M_c_string + __pos;
- __x._M_path_end[0] = __curr_rope;
- __x._M_leaf_index = 0;
- __x._M_leaf_pos = 0;
- return;
- }
- for(;;) {
- ++__curr_depth;
- __stl_assert(__curr_depth <= _RopeRep::_S_max_rope_depth);
- __path[__curr_depth] = __curr_rope;
- switch(__curr_rope->_M_tag) {
- case _RopeRep::_S_leaf:
- case _RopeRep::_S_function:
- case _RopeRep::_S_substringfn:
- __x._M_leaf_pos = __curr_start_pos;
- goto done;
- case _RopeRep::_S_concat:
- {
- _Rope_RopeConcatenation<_CharT,_Alloc>* __c =
- (_Rope_RopeConcatenation<_CharT,_Alloc>*)__curr_rope;
- _RopeRep* __left = __c->_M_left;
- size_t __left_len = __left->_M_size;
-
- __dirns <<= 1;
- if (__pos >= __curr_start_pos + __left_len) {
- __dirns |= 1;
- __curr_rope = __c->_M_right;
- __curr_start_pos += __left_len;
- } else {
- __curr_rope = __left;
- }
- }
- break;
- }
- }
- done:
- // Copy last section of path into _M_path_end.
- {
- int __i = -1;
- int __j = __curr_depth + 1 - _S_path_cache_len;
-
- if (__j < 0) __j = 0;
- while (__j <= __curr_depth) {
- __x._M_path_end[++__i] = __path[__j++];
- }
- __x._M_leaf_index = __i;
- }
- __x._M_path_directions = __dirns;
- _S_setbuf(__x);
-}
-
-// Specialized version of the above. Assumes that
-// the path cache is valid for the previous position.
-template <class _CharT, class _Alloc>
-void _Rope_iterator_base<_CharT,_Alloc>::_S_setcache_for_incr
-(_Rope_iterator_base<_CharT,_Alloc>& __x)
-{
- int __current_index = __x._M_leaf_index;
- const _RopeRep* __current_node = __x._M_path_end[__current_index];
- size_t __len = __current_node->_M_size;
- size_t __node_start_pos = __x._M_leaf_pos;
- unsigned char __dirns = __x._M_path_directions;
- _Rope_RopeConcatenation<_CharT,_Alloc>* __c;
-
- __stl_assert(__x._M_current_pos <= __x._M_root->_M_size);
- if (__x._M_current_pos - __node_start_pos < __len) {
- /* More stuff in this leaf, we just didn't cache it. */
- _S_setbuf(__x);
- return;
- }
- __stl_assert(__node_start_pos + __len == __x._M_current_pos);
- // node_start_pos is starting position of last_node.
- while (--__current_index >= 0) {
- if (!(__dirns & 1) /* Path turned left */)
- break;
- __current_node = __x._M_path_end[__current_index];
- __c = (_Rope_RopeConcatenation<_CharT,_Alloc>*)__current_node;
- // Otherwise we were in the right child. Thus we should pop
- // the concatenation node.
- __node_start_pos -= __c->_M_left->_M_size;
- __dirns >>= 1;
- }
- if (__current_index < 0) {
- // We underflowed the cache. Punt.
- _S_setcache(__x);
- return;
- }
- __current_node = __x._M_path_end[__current_index];
- __c = (_Rope_RopeConcatenation<_CharT,_Alloc>*)__current_node;
- // current_node is a concatenation node. We are positioned on the first
- // character in its right child.
- // node_start_pos is starting position of current_node.
- __node_start_pos += __c->_M_left->_M_size;
- __current_node = __c->_M_right;
- __x._M_path_end[++__current_index] = __current_node;
- __dirns |= 1;
- while (_RopeRep::_S_concat == __current_node->_M_tag) {
- ++__current_index;
- if (_S_path_cache_len == __current_index) {
- int __i;
- for (__i = 0; __i < _S_path_cache_len-1; __i++) {
- __x._M_path_end[__i] = __x._M_path_end[__i+1];
- }
- --__current_index;
- }
- __current_node =
- ((_Rope_RopeConcatenation<_CharT,_Alloc>*)__current_node)->_M_left;
- __x._M_path_end[__current_index] = __current_node;
- __dirns <<= 1;
- // node_start_pos is unchanged.
- }
- __x._M_leaf_index = __current_index;
- __x._M_leaf_pos = __node_start_pos;
- __x._M_path_directions = __dirns;
- _S_setbuf(__x);
-}
-
-template <class _CharT, class _Alloc>
-void _Rope_iterator_base<_CharT,_Alloc>::_M_incr(size_t __n) {
- _M_current_pos += __n;
- if (0 != _M_buf_ptr) {
- size_t __chars_left = _M_buf_end - _M_buf_ptr;
- if (__chars_left > __n) {
- _M_buf_ptr += __n;
- } else if (__chars_left == __n) {
- _M_buf_ptr += __n;
- _S_setcache_for_incr(*this);
- } else {
- _M_buf_ptr = 0;
- }
- }
-}
-
-template <class _CharT, class _Alloc>
-void _Rope_iterator_base<_CharT,_Alloc>::_M_decr(size_t __n) {
- if (0 != _M_buf_ptr) {
- size_t __chars_left = _M_buf_ptr - _M_buf_start;
- if (__chars_left >= __n) {
- _M_buf_ptr -= __n;
- } else {
- _M_buf_ptr = 0;
- }
- }
- _M_current_pos -= __n;
-}
-
-template <class _CharT, class _Alloc>
-void _Rope_iterator<_CharT,_Alloc>::_M_check() {
- if (_M_root_rope->_M_tree_ptr != _M_root) {
- // _Rope was modified. Get things fixed up.
- _RopeRep::_S_unref(_M_root);
- _M_root = _M_root_rope->_M_tree_ptr;
- _RopeRep::_S_ref(_M_root);
- _M_buf_ptr = 0;
- }
-}
-
-template <class _CharT, class _Alloc>
-inline
-_Rope_const_iterator<_CharT, _Alloc>::_Rope_const_iterator(
- const _Rope_iterator<_CharT,_Alloc>& __x)
-: _Rope_iterator_base<_CharT,_Alloc>(__x)
-{ }
-
-template <class _CharT, class _Alloc>
-inline _Rope_iterator<_CharT,_Alloc>::_Rope_iterator(
- rope<_CharT,_Alloc>& __r, size_t __pos)
-: _Rope_iterator_base<_CharT,_Alloc>(__r._M_tree_ptr, __pos),
- _M_root_rope(&__r)
-{
- _RopeRep::_S_ref(_M_root);
-}
-
-template <class _CharT, class _Alloc>
-inline size_t
-rope<_CharT,_Alloc>::_S_char_ptr_len(const _CharT* __s)
-{
- const _CharT* __p = __s;
-
- while (!_S_is0(*__p)) { ++__p; }
- return (__p - __s);
-}
-
-
-#ifndef __GC
-
-template <class _CharT, class _Alloc>
-inline void _Rope_RopeRep<_CharT,_Alloc>::_M_free_c_string()
-{
- _CharT* __cstr = _M_c_string;
- if (0 != __cstr) {
- size_t __size = _M_size + 1;
- destroy(__cstr, __cstr + __size);
- _Data_deallocate(__cstr, __size);
- }
-}
-
-
-template <class _CharT, class _Alloc>
-#ifdef __STL_USE_STD_ALLOCATORS
- inline void _Rope_RopeRep<_CharT,_Alloc>::_S_free_string(_CharT* __s,
- size_t __n,
- allocator_type __a)
-#else
- inline void _Rope_RopeRep<_CharT,_Alloc>::_S_free_string(_CharT* __s,
- size_t __n)
-#endif
-{
- if (!_S_is_basic_char_type((_CharT*)0)) {
- destroy(__s, __s + __n);
- }
-// This has to be a static member, so this gets a bit messy
-# ifdef __STL_USE_STD_ALLOCATORS
- __a.deallocate(
- __s, _Rope_RopeLeaf<_CharT,_Alloc>::_S_rounded_up_size(__n));
-# else
- _Data_deallocate(
- __s, _Rope_RopeLeaf<_CharT,_Alloc>::_S_rounded_up_size(__n));
-# endif
-}
-
-
-// There are several reasons for not doing this with virtual destructors
-// and a class specific delete operator:
-// - A class specific delete operator can't easily get access to
-// allocator instances if we need them.
-// - Any virtual function would need a 4 or byte vtable pointer;
-// this only requires a one byte tag per object.
-template <class _CharT, class _Alloc>
-void _Rope_RopeRep<_CharT,_Alloc>::_M_free_tree()
-{
- switch(_M_tag) {
- case _S_leaf:
- {
- _Rope_RopeLeaf<_CharT,_Alloc>* __l
- = (_Rope_RopeLeaf<_CharT,_Alloc>*)this;
- __l->_Rope_RopeLeaf<_CharT,_Alloc>::~_Rope_RopeLeaf();
- _L_deallocate(__l, 1);
- break;
- }
- case _S_concat:
- {
- _Rope_RopeConcatenation<_CharT,_Alloc>* __c
- = (_Rope_RopeConcatenation<_CharT,_Alloc>*)this;
- __c->_Rope_RopeConcatenation<_CharT,_Alloc>::
- ~_Rope_RopeConcatenation();
- _C_deallocate(__c, 1);
- break;
- }
- case _S_function:
- {
- _Rope_RopeFunction<_CharT,_Alloc>* __f
- = (_Rope_RopeFunction<_CharT,_Alloc>*)this;
- __f->_Rope_RopeFunction<_CharT,_Alloc>::~_Rope_RopeFunction();
- _F_deallocate(__f, 1);
- break;
- }
- case _S_substringfn:
- {
- _Rope_RopeSubstring<_CharT,_Alloc>* __ss =
- (_Rope_RopeSubstring<_CharT,_Alloc>*)this;
- __ss->_Rope_RopeSubstring<_CharT,_Alloc>::
- ~_Rope_RopeSubstring();
- _S_deallocate(__ss, 1);
- break;
- }
- }
-}
-#else
-
-template <class _CharT, class _Alloc>
-#ifdef __STL_USE_STD_ALLOCATORS
- inline void _Rope_RopeRep<_CharT,_Alloc>::_S_free_string
- (const _CharT*, size_t, allocator_type)
-#else
- inline void _Rope_RopeRep<_CharT,_Alloc>::_S_free_string
- (const _CharT*, size_t)
-#endif
-{}
-
-#endif
-
-
-// Concatenate a C string onto a leaf rope by copying the rope data.
-// Used for short ropes.
-template <class _CharT, class _Alloc>
-rope<_CharT,_Alloc>::_RopeLeaf*
-rope<_CharT,_Alloc>::_S_leaf_concat_char_iter
- (_RopeLeaf* __r, const _CharT* __iter, size_t __len)
-{
- size_t __old_len = __r->_M_size;
- _CharT* __new_data = (_CharT*)
- _Data_allocate(_S_rounded_up_size(__old_len + __len));
- _RopeLeaf* __result;
-
- uninitialized_copy_n(__r->_M_data, __old_len, __new_data);
- uninitialized_copy_n(__iter, __len, __new_data + __old_len);
- _S_cond_store_eos(__new_data[__old_len + __len]);
- __STL_TRY {
- __result = _S_new_RopeLeaf(__new_data, __old_len + __len,
- __r->get_allocator());
- }
- __STL_UNWIND(_RopeRep::__STL_FREE_STRING(__new_data, __old_len + __len,
- __r->get_allocator()));
- return __result;
-}
-
-#ifndef __GC
-// As above, but it's OK to clobber original if refcount is 1
-template <class _CharT, class _Alloc>
-rope<_CharT,_Alloc>::_RopeLeaf*
-rope<_CharT,_Alloc>::_S_destr_leaf_concat_char_iter
- (_RopeLeaf* __r, const _CharT* __iter, size_t __len)
-{
- __stl_assert(__r->_M_refcount >= 1);
- if (__r->_M_refcount > 1)
- return _S_leaf_concat_char_iter(__r, __iter, __len);
- size_t __old_len = __r->_M_size;
- if (_S_allocated_capacity(__old_len) >= __old_len + __len) {
- // The space has been partially initialized for the standard
- // character types. But that doesn't matter for those types.
- uninitialized_copy_n(__iter, __len, __r->_M_data + __old_len);
- if (_S_is_basic_char_type((_CharT*)0)) {
- _S_cond_store_eos(__r->_M_data[__old_len + __len]);
- __stl_assert(__r->_M_c_string == __r->_M_data);
- } else if (__r->_M_c_string != __r->_M_data && 0 != __r->_M_c_string) {
- __r->_M_free_c_string();
- __r->_M_c_string = 0;
- }
- __r->_M_size = __old_len + __len;
- __stl_assert(__r->_M_refcount == 1);
- __r->_M_refcount = 2;
- return __r;
- } else {
- _RopeLeaf* __result = _S_leaf_concat_char_iter(__r, __iter, __len);
- __stl_assert(__result->_M_refcount == 1);
- return __result;
- }
-}
-#endif
-
-// Assumes left and right are not 0.
-// Does not increment (nor decrement on exception) child reference counts.
-// Result has ref count 1.
-template <class _CharT, class _Alloc>
-rope<_CharT,_Alloc>::_RopeRep*
-rope<_CharT,_Alloc>::_S_tree_concat (_RopeRep* __left, _RopeRep* __right)
-{
- _RopeConcatenation* __result =
- _S_new_RopeConcatenation(__left, __right, __left->get_allocator());
- size_t __depth = __result->_M_depth;
-
-# ifdef __STL_USE_STD_ALLOCATORS
- __stl_assert(__left->get_allocator() == __right->get_allocator());
-# endif
- if (__depth > 20 && (__result->_M_size < 1000 ||
- __depth > _RopeRep::_S_max_rope_depth)) {
- _RopeRep* __balanced;
-
- __STL_TRY {
- __balanced = _S_balance(__result);
-# ifndef __GC
- if (__result != __balanced) {
- __stl_assert(1 == __result->_M_refcount
- && 1 == __balanced->_M_refcount);
- }
-# endif
- __result->_M_unref_nonnil();
- }
- __STL_UNWIND((_C_deallocate(__result,1)));
- // In case of exception, we need to deallocate
- // otherwise dangling result node. But caller
- // still owns its children. Thus unref is
- // inappropriate.
- return __balanced;
- } else {
- return __result;
- }
-}
-
-template <class _CharT, class _Alloc>
-rope<_CharT,_Alloc>::_RopeRep* rope<_CharT,_Alloc>::_S_concat_char_iter
- (_RopeRep* __r, const _CharT*__s, size_t __slen)
-{
- _RopeRep* __result;
- if (0 == __slen) {
- _S_ref(__r);
- return __r;
- }
- if (0 == __r)
- return __STL_ROPE_FROM_UNOWNED_CHAR_PTR(__s, __slen,
- __r->get_allocator());
- if (_RopeRep::_S_leaf == __r->_M_tag &&
- __r->_M_size + __slen <= _S_copy_max) {
- __result = _S_leaf_concat_char_iter((_RopeLeaf*)__r, __s, __slen);
-# ifndef __GC
- __stl_assert(1 == __result->_M_refcount);
-# endif
- return __result;
- }
- if (_RopeRep::_S_concat == __r->_M_tag
- && _RopeRep::_S_leaf == ((_RopeConcatenation*)__r)->_M_right->_M_tag) {
- _RopeLeaf* __right =
- (_RopeLeaf* )(((_RopeConcatenation* )__r)->_M_right);
- if (__right->_M_size + __slen <= _S_copy_max) {
- _RopeRep* __left = ((_RopeConcatenation*)__r)->_M_left;
- _RopeRep* __nright =
- _S_leaf_concat_char_iter((_RopeLeaf*)__right, __s, __slen);
- __left->_M_ref_nonnil();
- __STL_TRY {
- __result = _S_tree_concat(__left, __nright);
- }
- __STL_UNWIND(_S_unref(__left); _S_unref(__nright));
-# ifndef __GC
- __stl_assert(1 == __result->_M_refcount);
-# endif
- return __result;
- }
- }
- _RopeRep* __nright =
- __STL_ROPE_FROM_UNOWNED_CHAR_PTR(__s, __slen, __r->get_allocator());
- __STL_TRY {
- __r->_M_ref_nonnil();
- __result = _S_tree_concat(__r, __nright);
- }
- __STL_UNWIND(_S_unref(__r); _S_unref(__nright));
-# ifndef __GC
- __stl_assert(1 == __result->_M_refcount);
-# endif
- return __result;
-}
-
-#ifndef __GC
-template <class _CharT, class _Alloc>
-rope<_CharT,_Alloc>::_RopeRep*
-rope<_CharT,_Alloc>::_S_destr_concat_char_iter(
- _RopeRep* __r, const _CharT* __s, size_t __slen)
-{
- _RopeRep* __result;
- if (0 == __r)
- return __STL_ROPE_FROM_UNOWNED_CHAR_PTR(__s, __slen,
- __r->get_allocator());
- size_t __count = __r->_M_refcount;
- size_t __orig_size = __r->_M_size;
- __stl_assert(__count >= 1);
- if (__count > 1) return _S_concat_char_iter(__r, __s, __slen);
- if (0 == __slen) {
- __r->_M_refcount = 2; // One more than before
- return __r;
- }
- if (__orig_size + __slen <= _S_copy_max &&
- _RopeRep::_S_leaf == __r->_M_tag) {
- __result = _S_destr_leaf_concat_char_iter((_RopeLeaf*)__r, __s, __slen);
- return __result;
- }
- if (_RopeRep::_S_concat == __r->_M_tag) {
- _RopeLeaf* __right = (_RopeLeaf*)(((_RopeConcatenation*)__r)->_M_right);
- if (_RopeRep::_S_leaf == __right->_M_tag
- && __right->_M_size + __slen <= _S_copy_max) {
- _RopeRep* __new_right =
- _S_destr_leaf_concat_char_iter(__right, __s, __slen);
- if (__right == __new_right) {
- __stl_assert(__new_right->_M_refcount == 2);
- __new_right->_M_refcount = 1;
- } else {
- __stl_assert(__new_right->_M_refcount >= 1);
- __right->_M_unref_nonnil();
- }
- __stl_assert(__r->_M_refcount == 1);
- __r->_M_refcount = 2; // One more than before.
- ((_RopeConcatenation*)__r)->_M_right = __new_right;
- __r->_M_size = __orig_size + __slen;
- if (0 != __r->_M_c_string) {
- __r->_M_free_c_string();
- __r->_M_c_string = 0;
- }
- return __r;
- }
- }
- _RopeRep* __right =
- __STL_ROPE_FROM_UNOWNED_CHAR_PTR(__s, __slen, __r->get_allocator());
- __r->_M_ref_nonnil();
- __STL_TRY {
- __result = _S_tree_concat(__r, __right);
- }
- __STL_UNWIND(_S_unref(__r); _S_unref(__right))
- __stl_assert(1 == __result->_M_refcount);
- return __result;
-}
-#endif /* !__GC */
-
-template <class _CharT, class _Alloc>
-rope<_CharT,_Alloc>::_RopeRep*
-rope<_CharT,_Alloc>::_S_concat(_RopeRep* __left, _RopeRep* __right)
-{
- if (0 == __left) {
- _S_ref(__right);
- return __right;
- }
- if (0 == __right) {
- __left->_M_ref_nonnil();
- return __left;
- }
- if (_RopeRep::_S_leaf == __right->_M_tag) {
- if (_RopeRep::_S_leaf == __left->_M_tag) {
- if (__right->_M_size + __left->_M_size <= _S_copy_max) {
- return _S_leaf_concat_char_iter((_RopeLeaf*)__left,
- ((_RopeLeaf*)__right)->_M_data,
- __right->_M_size);
- }
- } else if (_RopeRep::_S_concat == __left->_M_tag
- && _RopeRep::_S_leaf ==
- ((_RopeConcatenation*)__left)->_M_right->_M_tag) {
- _RopeLeaf* __leftright =
- (_RopeLeaf*)(((_RopeConcatenation*)__left)->_M_right);
- if (__leftright->_M_size + __right->_M_size <= _S_copy_max) {
- _RopeRep* __leftleft = ((_RopeConcatenation*)__left)->_M_left;
- _RopeRep* __rest = _S_leaf_concat_char_iter(__leftright,
- ((_RopeLeaf*)__right)->_M_data,
- __right->_M_size);
- __leftleft->_M_ref_nonnil();
- __STL_TRY {
- return(_S_tree_concat(__leftleft, __rest));
- }
- __STL_UNWIND(_S_unref(__leftleft); _S_unref(__rest))
- }
- }
- }
- __left->_M_ref_nonnil();
- __right->_M_ref_nonnil();
- __STL_TRY {
- return(_S_tree_concat(__left, __right));
- }
- __STL_UNWIND(_S_unref(__left); _S_unref(__right));
-}
-
-template <class _CharT, class _Alloc>
-rope<_CharT,_Alloc>::_RopeRep*
-rope<_CharT,_Alloc>::_S_substring(_RopeRep* __base,
- size_t __start, size_t __endp1)
-{
- if (0 == __base) return 0;
- size_t __len = __base->_M_size;
- size_t __adj_endp1;
- const size_t __lazy_threshold = 128;
-
- if (__endp1 >= __len) {
- if (0 == __start) {
- __base->_M_ref_nonnil();
- return __base;
- } else {
- __adj_endp1 = __len;
- }
- } else {
- __adj_endp1 = __endp1;
- }
- switch(__base->_M_tag) {
- case _RopeRep::_S_concat:
- {
- _RopeConcatenation* __c = (_RopeConcatenation*)__base;
- _RopeRep* __left = __c->_M_left;
- _RopeRep* __right = __c->_M_right;
- size_t __left_len = __left->_M_size;
- _RopeRep* __result;
-
- if (__adj_endp1 <= __left_len) {
- return _S_substring(__left, __start, __endp1);
- } else if (__start >= __left_len) {
- return _S_substring(__right, __start - __left_len,
- __adj_endp1 - __left_len);
- }
- _Self_destruct_ptr __left_result(
- _S_substring(__left, __start, __left_len));
- _Self_destruct_ptr __right_result(
- _S_substring(__right, 0, __endp1 - __left_len));
- __result = _S_concat(__left_result, __right_result);
-# ifndef __GC
- __stl_assert(1 == __result->_M_refcount);
-# endif
- return __result;
- }
- case _RopeRep::_S_leaf:
- {
- _RopeLeaf* __l = (_RopeLeaf*)__base;
- _RopeLeaf* __result;
- size_t __result_len;
- if (__start >= __adj_endp1) return 0;
- __result_len = __adj_endp1 - __start;
- if (__result_len > __lazy_threshold) goto lazy;
-# ifdef __GC
- const _CharT* __section = __l->_M_data + __start;
- __result = _S_new_RopeLeaf(__section, __result_len,
- __base->get_allocator());
- __result->_M_c_string = 0; // Not eos terminated.
-# else
- // We should sometimes create substring node instead.
- __result = __STL_ROPE_FROM_UNOWNED_CHAR_PTR(
- __l->_M_data + __start, __result_len,
- __base->get_allocator());
-# endif
- return __result;
- }
- case _RopeRep::_S_substringfn:
- // Avoid introducing multiple layers of substring nodes.
- {
- _RopeSubstring* __old = (_RopeSubstring*)__base;
- size_t __result_len;
- if (__start >= __adj_endp1) return 0;
- __result_len = __adj_endp1 - __start;
- if (__result_len > __lazy_threshold) {
- _RopeSubstring* __result =
- _S_new_RopeSubstring(__old->_M_base,
- __start + __old->_M_start,
- __adj_endp1 - __start,
- __base->get_allocator());
- return __result;
-
- } // *** else fall through: ***
- }
- case _RopeRep::_S_function:
- {
- _RopeFunction* __f = (_RopeFunction*)__base;
- _CharT* __section;
- size_t __result_len;
- if (__start >= __adj_endp1) return 0;
- __result_len = __adj_endp1 - __start;
-
- if (__result_len > __lazy_threshold) goto lazy;
- __section = (_CharT*)
- _Data_allocate(_S_rounded_up_size(__result_len));
- __STL_TRY {
- (*(__f->_M_fn))(__start, __result_len, __section);
- }
- __STL_UNWIND(_RopeRep::__STL_FREE_STRING(
- __section, __result_len, __base->get_allocator()));
- _S_cond_store_eos(__section[__result_len]);
- return _S_new_RopeLeaf(__section, __result_len,
- __base->get_allocator());
- }
- }
- /*NOTREACHED*/
- __stl_assert(false);
- lazy:
- {
- // Create substring node.
- return _S_new_RopeSubstring(__base, __start, __adj_endp1 - __start,
- __base->get_allocator());
- }
-}
-
-template<class _CharT>
-class _Rope_flatten_char_consumer : public _Rope_char_consumer<_CharT> {
- private:
- _CharT* _M_buf_ptr;
- public:
- // _CharT* _M_buffer; // XXX not used
-
- _Rope_flatten_char_consumer(_CharT* __buffer) {
- _M_buf_ptr = __buffer;
- };
- ~_Rope_flatten_char_consumer() {}
- bool operator() (const _CharT* __leaf, size_t __n) {
- uninitialized_copy_n(__leaf, __n, _M_buf_ptr);
- _M_buf_ptr += __n;
- return true;
- }
-};
-
-template<class _CharT>
-class _Rope_find_char_char_consumer : public _Rope_char_consumer<_CharT> {
- private:
- _CharT _M_pattern;
- public:
- size_t _M_count; // Number of nonmatching characters
- _Rope_find_char_char_consumer(_CharT __p)
- : _M_pattern(__p), _M_count(0) {}
- ~_Rope_find_char_char_consumer() {}
- bool operator() (const _CharT* __leaf, size_t __n) {
- size_t __i;
- for (__i = 0; __i < __n; __i++) {
- if (__leaf[__i] == _M_pattern) {
- _M_count += __i; return false;
- }
- }
- _M_count += __n; return true;
- }
-};
-
-template<class _CharT>
-class _Rope_insert_char_consumer : public _Rope_char_consumer<_CharT> {
- private:
- typedef ostream _Insert_ostream;
- _Insert_ostream& _M_o;
- public:
- // _CharT* buffer; // XXX not used
- _Rope_insert_char_consumer(_Insert_ostream& __writer)
- : _M_o(__writer) {};
- ~_Rope_insert_char_consumer() { };
- // Caller is presumed to own the ostream
- bool operator() (const _CharT* __leaf, size_t __n);
- // Returns true to continue traversal.
-};
-
-template<class _CharT>
-bool _Rope_insert_char_consumer<_CharT>::operator()
- (const _CharT* __leaf, size_t __n)
-{
- size_t __i;
- // We assume that formatting is set up correctly for each element.
- for (__i = 0; __i < __n; __i++) _M_o << __leaf[__i];
- return true;
-}
-
-inline bool _Rope_insert_char_consumer<char>::operator()
- (const char* __leaf, size_t __n)
-{
- size_t __i;
- for (__i = 0; __i < __n; __i++) _M_o.put(__leaf[__i]);
- return true;
-}
-
-#if 0
-// I couldn't get this to work work with the VC++ version of basic_ostream.
-// It also doesn't really do the right thing unless o is a wide stream.
-// Given that wchar_t is often 4 bytes, its not clear to me how useful
-// this stuff is anyway.
-inline bool _Rope_insert_char_consumer<wchar_t>::operator()
- (const wchar_t* __leaf, size_t __n)
-{
- size_t __i;
- for (__i = 0; __i < __n; __i++) _M_o.put(__leaf[__i]);
- return true;
-}
-#endif /* !_MSC_VER && !BORLAND */
-
-template <class _CharT, class _Alloc>
-bool rope<_CharT, _Alloc>::_S_apply_to_pieces(
- _Rope_char_consumer<_CharT>& __c,
- const _RopeRep* __r,
- size_t __begin, size_t __end)
-{
- if (0 == __r) return true;
- switch(__r->_M_tag) {
- case _RopeRep::_S_concat:
- {
- _RopeConcatenation* __conc = (_RopeConcatenation*)__r;
- _RopeRep* __left = __conc->_M_left;
- size_t __left_len = __left->_M_size;
- if (__begin < __left_len) {
- size_t __left_end = min(__left_len, __end);
- if (!_S_apply_to_pieces(__c, __left, __begin, __left_end))
- return false;
- }
- if (__end > __left_len) {
- _RopeRep* __right = __conc->_M_right;
- size_t __right_start = max(__left_len, __begin);
- if (!_S_apply_to_pieces(__c, __right,
- __right_start - __left_len,
- __end - __left_len)) {
- return false;
- }
- }
- }
- return true;
- case _RopeRep::_S_leaf:
- {
- _RopeLeaf* __l = (_RopeLeaf*)__r;
- return __c(__l->_M_data + __begin, __end - __begin);
- }
- case _RopeRep::_S_function:
- case _RopeRep::_S_substringfn:
- {
- _RopeFunction* __f = (_RopeFunction*)__r;
- size_t __len = __end - __begin;
- bool __result;
- _CharT* __buffer =
- (_CharT*)alloc::allocate(__len * sizeof(_CharT));
- __STL_TRY {
- (*(__f->_M_fn))(__begin, __end, __buffer);
- __result = __c(__buffer, __len);
- alloc::deallocate(__buffer, __len * sizeof(_CharT));
- }
- __STL_UNWIND((alloc::deallocate(__buffer,
- __len * sizeof(_CharT))))
- return __result;
- }
- default:
- __stl_assert(false);
- /*NOTREACHED*/
- return false;
- }
-}
-
-inline void _Rope_fill(ostream& __o, size_t __n)
-{
- char __f = __o.fill();
- size_t __i;
-
- for (__i = 0; __i < __n; __i++) __o.put(__f);
-}
-
-
-template <class _CharT> inline bool _Rope_is_simple(_CharT*) { return false; }
-inline bool _Rope_is_simple(char*) { return true; }
-inline bool _Rope_is_simple(wchar_t*) { return true; }
-
-
-template<class _CharT, class _Alloc>
-ostream& operator<< (ostream& __o, const rope<_CharT, _Alloc>& __r)
-{
- size_t __w = __o.width();
- bool __left = bool(__o.flags() & ios::left);
- size_t __pad_len;
- size_t __rope_len = __r.size();
- _Rope_insert_char_consumer<_CharT> __c(__o);
- bool __is_simple = _Rope_is_simple((_CharT*)0);
-
- if (__rope_len < __w) {
- __pad_len = __w - __rope_len;
- } else {
- __pad_len = 0;
- }
- if (!__is_simple) __o.width(__w/__rope_len);
- __STL_TRY {
- if (__is_simple && !__left && __pad_len > 0) {
- _Rope_fill(__o, __pad_len);
- }
- __r.apply_to_pieces(0, __r.size(), __c);
- if (__is_simple && __left && __pad_len > 0) {
- _Rope_fill(__o, __pad_len);
- }
- if (!__is_simple)
- __o.width(__w);
- }
- __STL_UNWIND(if (!__is_simple) __o.width(__w))
- return __o;
-}
-
-template <class _CharT, class _Alloc>
-_CharT*
-rope<_CharT,_Alloc>::_S_flatten(_RopeRep* __r,
- size_t __start, size_t __len,
- _CharT* __buffer)
-{
- _Rope_flatten_char_consumer<_CharT> __c(__buffer);
- _S_apply_to_pieces(__c, __r, __start, __start + __len);
- return(__buffer + __len);
-}
-
-template <class _CharT, class _Alloc>
-size_t
-rope<_CharT,_Alloc>::find(_CharT __pattern, size_t __start) const
-{
- _Rope_find_char_char_consumer<_CharT> __c(__pattern);
- _S_apply_to_pieces(__c, _M_tree_ptr, __start, size());
- size_type __result_pos = __start + __c._M_count;
-# ifndef __STL_OLD_ROPE_SEMANTICS
- if (__result_pos == size()) __result_pos = npos;
-# endif
- return __result_pos;
-}
-
-template <class _CharT, class _Alloc>
-_CharT*
-rope<_CharT,_Alloc>::_S_flatten(_RopeRep* __r, _CharT* __buffer)
-{
- if (0 == __r) return __buffer;
- switch(__r->_M_tag) {
- case _RopeRep::_S_concat:
- {
- _RopeConcatenation* __c = (_RopeConcatenation*)__r;
- _RopeRep* __left = __c->_M_left;
- _RopeRep* __right = __c->_M_right;
- _CharT* __rest = _S_flatten(__left, __buffer);
- return _S_flatten(__right, __rest);
- }
- case _RopeRep::_S_leaf:
- {
- _RopeLeaf* __l = (_RopeLeaf*)__r;
- return copy_n(__l->_M_data, __l->_M_size, __buffer).second;
- }
- case _RopeRep::_S_function:
- case _RopeRep::_S_substringfn:
- // We dont yet do anything with substring nodes.
- // This needs to be fixed before ropefiles will work well.
- {
- _RopeFunction* __f = (_RopeFunction*)__r;
- (*(__f->_M_fn))(0, __f->_M_size, __buffer);
- return __buffer + __f->_M_size;
- }
- default:
- __stl_assert(false);
- /*NOTREACHED*/
- return 0;
- }
-}
-
-
-// This needs work for _CharT != char
-template <class _CharT, class _Alloc>
-void
-rope<_CharT,_Alloc>::_S_dump(_RopeRep* __r, int __indent)
-{
- for (int __i = 0; __i < __indent; __i++) putchar(' ');
- if (0 == __r) {
- printf("NULL\n"); return;
- }
- if (_RopeRep::_S_concat == __r->_M_tag) {
- _RopeConcatenation* __c = (_RopeConcatenation*)__r;
- _RopeRep* __left = __c->_M_left;
- _RopeRep* __right = __c->_M_right;
-
-# ifdef __GC
- printf("Concatenation %p (depth = %d, len = %ld, %s balanced)\n",
- __r, __r->_M_depth, __r->_M_size, __r->_M_is_balanced? "" : "not");
-# else
- printf("Concatenation %p (rc = %ld, depth = %d, "
- "len = %ld, %s balanced)\n",
- __r, __r->_M_refcount, __r->_M_depth, __r->_M_size,
- __r->_M_is_balanced? "" : "not");
-# endif
- _S_dump(__left, __indent + 2);
- _S_dump(__right, __indent + 2);
- return;
- } else {
- char* __kind;
-
- switch (__r->_M_tag) {
- case _RopeRep::_S_leaf:
- __kind = "Leaf";
- break;
- case _RopeRep::_S_function:
- __kind = "Function";
- break;
- case _RopeRep::_S_substringfn:
- __kind = "Function representing substring";
- break;
- default:
- __kind = "(corrupted kind field!)";
- }
-# ifdef __GC
- printf("%s %p (depth = %d, len = %ld) ",
- __kind, __r, __r->_M_depth, __r->_M_size);
-# else
- printf("%s %p (rc = %ld, depth = %d, len = %ld) ",
- __kind, __r, __r->_M_refcount, __r->_M_depth, __r->_M_size);
-# endif
- if (_S_is_one_byte_char_type((_CharT*)0)) {
- const int __max_len = 40;
- _Self_destruct_ptr __prefix(_S_substring(__r, 0, __max_len));
- _CharT __buffer[__max_len + 1];
- bool __too_big = __r->_M_size > __prefix->_M_size;
-
- _S_flatten(__prefix, __buffer);
- __buffer[__prefix->_M_size] = _S_eos((_CharT*)0);
- printf("%s%s\n",
- (char*)__buffer, __too_big? "...\n" : "\n");
- } else {
- printf("\n");
- }
- }
-}
-
-template <class _CharT, class _Alloc>
-const unsigned long
-rope<_CharT,_Alloc>::_S_min_len[
- _Rope_RopeRep<_CharT,_Alloc>::_S_max_rope_depth + 1] = {
-/* 0 */1, /* 1 */2, /* 2 */3, /* 3 */5, /* 4 */8, /* 5 */13, /* 6 */21,
-/* 7 */34, /* 8 */55, /* 9 */89, /* 10 */144, /* 11 */233, /* 12 */377,
-/* 13 */610, /* 14 */987, /* 15 */1597, /* 16 */2584, /* 17 */4181,
-/* 18 */6765, /* 19 */10946, /* 20 */17711, /* 21 */28657, /* 22 */46368,
-/* 23 */75025, /* 24 */121393, /* 25 */196418, /* 26 */317811,
-/* 27 */514229, /* 28 */832040, /* 29 */1346269, /* 30 */2178309,
-/* 31 */3524578, /* 32 */5702887, /* 33 */9227465, /* 34 */14930352,
-/* 35 */24157817, /* 36 */39088169, /* 37 */63245986, /* 38 */102334155,
-/* 39 */165580141, /* 40 */267914296, /* 41 */433494437,
-/* 42 */701408733, /* 43 */1134903170, /* 44 */1836311903,
-/* 45 */2971215073u };
-// These are Fibonacci numbers < 2**32.
-
-template <class _CharT, class _Alloc>
-rope<_CharT,_Alloc>::_RopeRep*
-rope<_CharT,_Alloc>::_S_balance(_RopeRep* __r)
-{
- _RopeRep* __forest[_RopeRep::_S_max_rope_depth + 1];
- _RopeRep* __result = 0;
- int __i;
- // Invariant:
- // The concatenation of forest in descending order is equal to __r.
- // __forest[__i]._M_size >= _S_min_len[__i]
- // __forest[__i]._M_depth = __i
- // References from forest are included in refcount.
-
- for (__i = 0; __i <= _RopeRep::_S_max_rope_depth; ++__i)
- __forest[__i] = 0;
- __STL_TRY {
- _S_add_to_forest(__r, __forest);
- for (__i = 0; __i <= _RopeRep::_S_max_rope_depth; ++__i)
- if (0 != __forest[__i]) {
-# ifndef __GC
- _Self_destruct_ptr __old(__result);
-# endif
- __result = _S_concat(__forest[__i], __result);
- __forest[__i]->_M_unref_nonnil();
-# if !defined(__GC) && defined(__STL_USE_EXCEPTIONS)
- __forest[__i] = 0;
-# endif
- }
- }
- __STL_UNWIND(for(__i = 0; __i <= _RopeRep::_S_max_rope_depth; __i++)
- _S_unref(__forest[__i]))
- if (__result->_M_depth > _RopeRep::_S_max_rope_depth) abort();
- return(__result);
-}
-
-
-template <class _CharT, class _Alloc>
-void
-rope<_CharT,_Alloc>::_S_add_to_forest(_RopeRep* __r, _RopeRep** __forest)
-{
- if (__r->_M_is_balanced) {
- _S_add_leaf_to_forest(__r, __forest);
- return;
- }
- __stl_assert(__r->_M_tag == _RopeRep::_S_concat);
- {
- _RopeConcatenation* __c = (_RopeConcatenation*)__r;
-
- _S_add_to_forest(__c->_M_left, __forest);
- _S_add_to_forest(__c->_M_right, __forest);
- }
-}
-
-
-template <class _CharT, class _Alloc>
-void
-rope<_CharT,_Alloc>::_S_add_leaf_to_forest(_RopeRep* __r, _RopeRep** __forest)
-{
- _RopeRep* __insertee; // included in refcount
- _RopeRep* __too_tiny = 0; // included in refcount
- int __i; // forest[0..__i-1] is empty
- size_t __s = __r->_M_size;
-
- for (__i = 0; __s >= _S_min_len[__i+1]/* not this bucket */; ++__i) {
- if (0 != __forest[__i]) {
-# ifndef __GC
- _Self_destruct_ptr __old(__too_tiny);
-# endif
- __too_tiny = _S_concat_and_set_balanced(__forest[__i], __too_tiny);
- __forest[__i]->_M_unref_nonnil();
- __forest[__i] = 0;
- }
- }
- {
-# ifndef __GC
- _Self_destruct_ptr __old(__too_tiny);
-# endif
- __insertee = _S_concat_and_set_balanced(__too_tiny, __r);
- }
- // Too_tiny dead, and no longer included in refcount.
- // Insertee is live and included.
- __stl_assert(_S_is_almost_balanced(__insertee));
- __stl_assert(__insertee->_M_depth <= __r->_M_depth + 1);
- for (;; ++__i) {
- if (0 != __forest[__i]) {
-# ifndef __GC
- _Self_destruct_ptr __old(__insertee);
-# endif
- __insertee = _S_concat_and_set_balanced(__forest[__i], __insertee);
- __forest[__i]->_M_unref_nonnil();
- __forest[__i] = 0;
- __stl_assert(_S_is_almost_balanced(__insertee));
- }
- __stl_assert(_S_min_len[__i] <= __insertee->_M_size);
- __stl_assert(__forest[__i] == 0);
- if (__i == _RopeRep::_S_max_rope_depth ||
- __insertee->_M_size < _S_min_len[__i+1]) {
- __forest[__i] = __insertee;
- // refcount is OK since __insertee is now dead.
- return;
- }
- }
-}
-
-template <class _CharT, class _Alloc>
-_CharT
-rope<_CharT,_Alloc>::_S_fetch(_RopeRep* __r, size_type __i)
-{
- __GC_CONST _CharT* __cstr = __r->_M_c_string;
-
- __stl_assert(__i < __r->_M_size);
- if (0 != __cstr) return __cstr[__i];
- for(;;) {
- switch(__r->_M_tag) {
- case _RopeRep::_S_concat:
- {
- _RopeConcatenation* __c = (_RopeConcatenation*)__r;
- _RopeRep* __left = __c->_M_left;
- size_t __left_len = __left->_M_size;
-
- if (__i >= __left_len) {
- __i -= __left_len;
- __r = __c->_M_right;
- } else {
- __r = __left;
- }
- }
- break;
- case _RopeRep::_S_leaf:
- {
- _RopeLeaf* __l = (_RopeLeaf*)__r;
- return __l->_M_data[__i];
- }
- case _RopeRep::_S_function:
- case _RopeRep::_S_substringfn:
- {
- _RopeFunction* __f = (_RopeFunction*)__r;
- _CharT __result;
-
- (*(__f->_M_fn))(__i, 1, &__result);
- return __result;
- }
- }
- }
-}
-
-# ifndef __GC
-// Return a uniquely referenced character slot for the given
-// position, or 0 if that's not possible.
-template <class _CharT, class _Alloc>
-_CharT*
-rope<_CharT,_Alloc>::_S_fetch_ptr(_RopeRep* __r, size_type __i)
-{
- _RopeRep* __clrstack[_RopeRep::_S_max_rope_depth];
- size_t __csptr = 0;
-
- for(;;) {
- if (__r->_M_refcount > 1) return 0;
- switch(__r->_M_tag) {
- case _RopeRep::_S_concat:
- {
- _RopeConcatenation* __c = (_RopeConcatenation*)__r;
- _RopeRep* __left = __c->_M_left;
- size_t __left_len = __left->_M_size;
-
- if (__c->_M_c_string != 0) __clrstack[__csptr++] = __c;
- if (__i >= __left_len) {
- __i -= __left_len;
- __r = __c->_M_right;
- } else {
- __r = __left;
- }
- }
- break;
- case _RopeRep::_S_leaf:
- {
- _RopeLeaf* __l = (_RopeLeaf*)__r;
- if (__l->_M_c_string != __l->_M_data && __l->_M_c_string != 0)
- __clrstack[__csptr++] = __l;
- while (__csptr > 0) {
- -- __csptr;
- _RopeRep* __d = __clrstack[__csptr];
- __d->_M_free_c_string();
- __d->_M_c_string = 0;
- }
- return __l->_M_data + __i;
- }
- case _RopeRep::_S_function:
- case _RopeRep::_S_substringfn:
- return 0;
- }
- }
-}
-# endif /* __GC */
-
-// The following could be implemented trivially using
-// lexicographical_compare_3way.
-// We do a little more work to avoid dealing with rope iterators for
-// flat strings.
-template <class _CharT, class _Alloc>
-int
-rope<_CharT,_Alloc>::_S_compare (const _RopeRep* __left,
- const _RopeRep* __right)
-{
- size_t __left_len;
- size_t __right_len;
-
- if (0 == __right) return 0 != __left;
- if (0 == __left) return -1;
- __left_len = __left->_M_size;
- __right_len = __right->_M_size;
- if (_RopeRep::_S_leaf == __left->_M_tag) {
- _RopeLeaf* __l = (_RopeLeaf*) __left;
- if (_RopeRep::_S_leaf == __right->_M_tag) {
- _RopeLeaf* __r = (_RopeLeaf*) __right;
- return lexicographical_compare_3way(
- __l->_M_data, __l->_M_data + __left_len,
- __r->_M_data, __r->_M_data + __right_len);
- } else {
- const_iterator __rstart(__right, 0);
- const_iterator __rend(__right, __right_len);
- return lexicographical_compare_3way(
- __l->_M_data, __l->_M_data + __left_len,
- __rstart, __rend);
- }
- } else {
- const_iterator __lstart(__left, 0);
- const_iterator __lend(__left, __left_len);
- if (_RopeRep::_S_leaf == __right->_M_tag) {
- _RopeLeaf* __r = (_RopeLeaf*) __right;
- return lexicographical_compare_3way(
- __lstart, __lend,
- __r->_M_data, __r->_M_data + __right_len);
- } else {
- const_iterator __rstart(__right, 0);
- const_iterator __rend(__right, __right_len);
- return lexicographical_compare_3way(
- __lstart, __lend,
- __rstart, __rend);
- }
- }
-}
-
-// Assignment to reference proxies.
-template <class _CharT, class _Alloc>
-_Rope_char_ref_proxy<_CharT, _Alloc>&
-_Rope_char_ref_proxy<_CharT, _Alloc>::operator= (_CharT __c) {
- _RopeRep* __old = _M_root->_M_tree_ptr;
-# ifndef __GC
- // First check for the case in which everything is uniquely
- // referenced. In that case we can do this destructively.
- _CharT* __ptr = _My_rope::_S_fetch_ptr(__old, _M_pos);
- if (0 != __ptr) {
- *__ptr = __c;
- return *this;
- }
-# endif
- _Self_destruct_ptr __left(
- _My_rope::_S_substring(__old, 0, _M_pos));
- _Self_destruct_ptr __right(
- _My_rope::_S_substring(__old, _M_pos+1, __old->_M_size));
- _Self_destruct_ptr __result_left(
- _My_rope::_S_destr_concat_char_iter(__left, &__c, 1));
-
-# ifndef __GC
- __stl_assert(__left == __result_left || 1 == __result_left->_M_refcount);
-# endif
- _RopeRep* __result =
- _My_rope::_S_concat(__result_left, __right);
-# ifndef __GC
- __stl_assert(1 <= __result->_M_refcount);
- _RopeRep::_S_unref(__old);
-# endif
- _M_root->_M_tree_ptr = __result;
- return *this;
-}
-
-template <class _CharT, class _Alloc>
-inline _Rope_char_ref_proxy<_CharT, _Alloc>::operator _CharT () const
-{
- if (_M_current_valid) {
- return _M_current;
- } else {
- return _My_rope::_S_fetch(_M_root->_M_tree_ptr, _M_pos);
- }
-}
-template <class _CharT, class _Alloc>
-_Rope_char_ptr_proxy<_CharT, _Alloc>
-_Rope_char_ref_proxy<_CharT, _Alloc>::operator& () const {
- return _Rope_char_ptr_proxy<_CharT, _Alloc>(*this);
-}
-
-template <class _CharT, class _Alloc>
-rope<_CharT, _Alloc>::rope(size_t __n, _CharT __c,
- const allocator_type& __a)
-: _Base(__a)
-{
- rope<_CharT,_Alloc> __result;
- const size_t __exponentiate_threshold = 32;
- size_t __exponent;
- size_t __rest;
- _CharT* __rest_buffer;
- _RopeRep* __remainder;
- rope<_CharT,_Alloc> __remainder_rope;
-
- if (0 == __n)
- return;
-
- __exponent = __n / __exponentiate_threshold;
- __rest = __n % __exponentiate_threshold;
- if (0 == __rest) {
- __remainder = 0;
- } else {
- __rest_buffer = _Data_allocate(_S_rounded_up_size(__rest));
- uninitialized_fill_n(__rest_buffer, __rest, __c);
- _S_cond_store_eos(__rest_buffer[__rest]);
- __STL_TRY {
- __remainder = _S_new_RopeLeaf(__rest_buffer, __rest, __a);
- }
- __STL_UNWIND(_RopeRep::__STL_FREE_STRING(__rest_buffer, __rest, __a))
- }
- __remainder_rope._M_tree_ptr = __remainder;
- if (__exponent != 0) {
- _CharT* __base_buffer =
- _Data_allocate(_S_rounded_up_size(__exponentiate_threshold));
- _RopeLeaf* __base_leaf;
- rope __base_rope;
- uninitialized_fill_n(__base_buffer, __exponentiate_threshold, __c);
- _S_cond_store_eos(__base_buffer[__exponentiate_threshold]);
- __STL_TRY {
- __base_leaf = _S_new_RopeLeaf(__base_buffer,
- __exponentiate_threshold, __a);
- }
- __STL_UNWIND(_RopeRep::__STL_FREE_STRING(__base_buffer,
- __exponentiate_threshold, __a))
- __base_rope._M_tree_ptr = __base_leaf;
- if (1 == __exponent) {
- __result = __base_rope;
-# ifndef __GC
- __stl_assert(2 == __result._M_tree_ptr->_M_refcount);
- // One each for base_rope and __result
-# endif
- } else {
- // XXX what is power()?
- __result = power(__base_rope, __exponent, _Concat_fn());
- }
- if (0 != __remainder) {
- __result += __remainder_rope;
- }
- } else {
- __result = __remainder_rope;
- }
- _M_tree_ptr = __result._M_tree_ptr;
- _M_tree_ptr->_M_ref_nonnil();
-}
-
-template<class _CharT, class _Alloc>
- _CharT rope<_CharT,_Alloc>::_S_empty_c_str[1];
-
-# ifdef __STL_PTHREADS
- template<class _CharT, class _Alloc>
- pthread_mutex_t
- rope<_CharT,_Alloc>::_S_swap_lock = PTHREAD_MUTEX_INITIALIZER;
-# endif
-
-template<class _CharT, class _Alloc>
-const _CharT* rope<_CharT,_Alloc>::c_str() const {
- if (0 == _M_tree_ptr) {
- _S_empty_c_str[0] = _S_eos((_CharT*)0); // Possibly redundant,
- // but probably fast.
- return _S_empty_c_str;
- }
- __GC_CONST _CharT* __old_c_string = _M_tree_ptr->_M_c_string;
- if (0 != __old_c_string) return(__old_c_string);
- size_t __s = size();
- _CharT* __result = _Data_allocate(__s + 1);
- _S_flatten(_M_tree_ptr, __result);
- __result[__s] = _S_eos((_CharT*)0);
-# ifdef __GC
- _M_tree_ptr->_M_c_string = __result;
-# else
- if ((__old_c_string =
- _S_atomic_swap(&(_M_tree_ptr->_M_c_string), __result)) != 0) {
- // It must have been added in the interim. Hence it had to have been
- // separately allocated. Deallocate the old copy, since we just
- // replaced it.
- destroy(__old_c_string, __old_c_string + __s + 1);
- _Data_deallocate(__old_c_string, __s + 1);
- }
-# endif
- return(__result);
-}
-
-template<class _CharT, class _Alloc>
-const _CharT* rope<_CharT,_Alloc>::replace_with_c_str() {
- if (0 == _M_tree_ptr) {
- _S_empty_c_str[0] = _S_eos((_CharT*)0);
- return _S_empty_c_str;
- }
- __GC_CONST _CharT* __old_c_string = _M_tree_ptr->_M_c_string;
- if (_RopeRep::_S_leaf == _M_tree_ptr->_M_tag && 0 != __old_c_string) {
- return(__old_c_string);
- }
- size_t __s = size();
- _CharT* __result = _Data_allocate(_S_rounded_up_size(__s));
- _S_flatten(_M_tree_ptr, __result);
- __result[__s] = _S_eos((_CharT*)0);
- _M_tree_ptr->_M_unref_nonnil();
- _M_tree_ptr = _S_new_RopeLeaf(__result, __s, get_allocator());
- return(__result);
-}
-
-// Algorithm specializations. More should be added.
-
-#ifndef _MSC_VER
-// I couldn't get this to work with VC++
-template<class _CharT,class _Alloc>
-void
-_Rope_rotate(_Rope_iterator<_CharT,_Alloc> __first,
- _Rope_iterator<_CharT,_Alloc> __middle,
- _Rope_iterator<_CharT,_Alloc> __last)
-{
- __stl_assert(__first.container() == __middle.container()
- && __middle.container() == __last.container());
- rope<_CharT,_Alloc>& __r(__first.container());
- rope<_CharT,_Alloc> __prefix = __r.substr(0, __first.index());
- rope<_CharT,_Alloc> __suffix =
- __r.substr(__last.index(), __r.size() - __last.index());
- rope<_CharT,_Alloc> __part1 =
- __r.substr(__middle.index(), __last.index() - __middle.index());
- rope<_CharT,_Alloc> __part2 =
- __r.substr(__first.index(), __middle.index() - __first.index());
- __r = __prefix;
- __r += __part1;
- __r += __part2;
- __r += __suffix;
-}
-
-#if !defined(__GNUC__)
-// Appears to confuse g++
-inline void rotate(_Rope_iterator<char,__STL_DEFAULT_ALLOCATOR(char)> __first,
- _Rope_iterator<char,__STL_DEFAULT_ALLOCATOR(char)> __middle,
- _Rope_iterator<char,__STL_DEFAULT_ALLOCATOR(char)> __last) {
- _Rope_rotate(__first, __middle, __last);
-}
-#endif
-
-# if 0
-// Probably not useful for several reasons:
-// - for SGIs 7.1 compiler and probably some others,
-// this forces lots of rope<wchar_t, ...> instantiations, creating a
-// code bloat and compile time problem. (Fixed in 7.2.)
-// - wchar_t is 4 bytes wide on most UNIX platforms, making it unattractive
-// for unicode strings. Unsigned short may be a better character
-// type.
-inline void rotate(
- _Rope_iterator<wchar_t,__STL_DEFAULT_ALLOCATOR(char)> __first,
- _Rope_iterator<wchar_t,__STL_DEFAULT_ALLOCATOR(char)> __middle,
- _Rope_iterator<wchar_t,__STL_DEFAULT_ALLOCATOR(char)> __last) {
- _Rope_rotate(__first, __middle, __last);
-}
-# endif
-#endif /* _MSC_VER */
-
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma reset woff 1174
-#endif
-
-__STL_END_NAMESPACE
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/contrib/libstdc++/stl/set b/contrib/libstdc++/stl/set
deleted file mode 100644
index c836c4596d28..000000000000
--- a/contrib/libstdc++/stl/set
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- *
- * Copyright (c) 1996,1997
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- */
-
-#ifndef __SGI_STL_SET
-#define __SGI_STL_SET
-
-#ifndef __SGI_STL_INTERNAL_TREE_H
-#include <stl_tree.h>
-#endif
-#include <stl_set.h>
-#include <stl_multiset.h>
-
-#endif /* __SGI_STL_SET */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/contrib/libstdc++/stl/set.h b/contrib/libstdc++/stl/set.h
deleted file mode 100644
index 9004d2e04770..000000000000
--- a/contrib/libstdc++/stl/set.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- *
- * Copyright (c) 1996,1997
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- */
-
-#ifndef __SGI_STL_SET_H
-#define __SGI_STL_SET_H
-
-#include <tree.h>
-#include <stl_set.h>
-
-#ifdef __STL_USE_NAMESPACES
-using __STD::set;
-#endif /* __STL_USE_NAMESPACES */
-
-#endif /* __SGI_STL_SET_H */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/contrib/libstdc++/stl/slist b/contrib/libstdc++/stl/slist
deleted file mode 100644
index c3ec74204c55..000000000000
--- a/contrib/libstdc++/stl/slist
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright (c) 1997
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef __SGI_STL_SLIST
-#define __SGI_STL_SLIST
-
-#include <stl_algobase.h>
-#include <stl_alloc.h>
-#include <stl_construct.h>
-#include <stl_uninitialized.h>
-#include <stl_slist.h>
-
-#endif /* __SGI_STL_SLIST */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/contrib/libstdc++/stl/slist.h b/contrib/libstdc++/stl/slist.h
deleted file mode 100644
index d2377b0cf5ae..000000000000
--- a/contrib/libstdc++/stl/slist.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (c) 1997
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef __SGI_STL_SLIST_H
-#define __SGI_STL_SLIST_H
-
-#include <algobase.h>
-#include <alloc.h>
-#include <stl_slist.h>
-
-#ifdef __STL_USE_NAMESPACES
-using __STD::slist;
-#endif /* __STL_USE_NAMESPACES */
-
-#endif /* __SGI_STL_SLIST_H */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/contrib/libstdc++/stl/stack b/contrib/libstdc++/stl/stack
deleted file mode 100644
index 36461d95b8c4..000000000000
--- a/contrib/libstdc++/stl/stack
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- *
- * Copyright (c) 1996,1997
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- */
-
-#ifndef __SGI_STL_STACK
-#define __SGI_STL_STACK
-
-#include <stl_algobase.h>
-#include <stl_alloc.h>
-#include <stl_construct.h>
-#include <stl_uninitialized.h>
-#include <stl_deque.h>
-#include <stl_stack.h>
-
-#endif /* __SGI_STL_STACK */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/contrib/libstdc++/stl/stack.h b/contrib/libstdc++/stl/stack.h
deleted file mode 100644
index 89beca82f128..000000000000
--- a/contrib/libstdc++/stl/stack.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- *
- * Copyright (c) 1996,1997
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- */
-
-#ifndef __SGI_STL_STACK_H
-#define __SGI_STL_STACK_H
-
-#include <vector.h>
-#include <deque.h>
-#include <heap.h>
-#include <stl_stack.h>
-#include <stl_queue.h>
-
-#ifdef __STL_USE_NAMESPACES
-using __STD::stack;
-using __STD::queue;
-using __STD::priority_queue;
-#endif /* __STL_USE_NAMESPACES */
-
-#endif /* __SGI_STL_STACK_H */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/contrib/libstdc++/stl/stl_algo.h b/contrib/libstdc++/stl/stl_algo.h
deleted file mode 100644
index e9beaee15f11..000000000000
--- a/contrib/libstdc++/stl/stl_algo.h
+++ /dev/null
@@ -1,2894 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- *
- * Copyright (c) 1996
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- */
-
-/* NOTE: This is an internal header file, included by other STL headers.
- * You should not attempt to use it directly.
- */
-
-#ifndef __SGI_STL_INTERNAL_ALGO_H
-#define __SGI_STL_INTERNAL_ALGO_H
-
-#include <stl_heap.h>
-
-__STL_BEGIN_NAMESPACE
-
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma set woff 1209
-#endif
-
-// __median (an extension, not present in the C++ standard).
-
-template <class _Tp>
-inline const _Tp& __median(const _Tp& __a, const _Tp& __b, const _Tp& __c) {
- if (__a < __b)
- if (__b < __c)
- return __b;
- else if (__a < __c)
- return __c;
- else
- return __a;
- else if (__a < __c)
- return __a;
- else if (__b < __c)
- return __c;
- else
- return __b;
-}
-
-template <class _Tp, class _Compare>
-inline const _Tp&
-__median(const _Tp& __a, const _Tp& __b, const _Tp& __c, _Compare __comp) {
- if (__comp(__a, __b))
- if (__comp(__b, __c))
- return __b;
- else if (__comp(__a, __c))
- return __c;
- else
- return __a;
- else if (__comp(__a, __c))
- return __a;
- else if (__comp(__b, __c))
- return __c;
- else
- return __b;
-}
-
-// for_each. Apply a function to every element of a range.
-template <class _InputIter, class _Function>
-_Function for_each(_InputIter __first, _InputIter __last, _Function __f) {
- for ( ; __first != __last; ++__first)
- __f(*__first);
- return __f;
-}
-
-// find and find_if.
-
-template <class _InputIter, class _Tp>
-inline _InputIter find(_InputIter __first, _InputIter __last,
- const _Tp& __val,
- input_iterator_tag)
-{
- while (__first != __last && *__first != __val)
- ++__first;
- return __first;
-}
-
-template <class _InputIter, class _Predicate>
-inline _InputIter find_if(_InputIter __first, _InputIter __last,
- _Predicate __pred,
- input_iterator_tag)
-{
- while (__first != __last && !__pred(*__first))
- ++__first;
- return __first;
-}
-
-#ifdef __STL_CLASS_PARTIAL_SPECIALIZATION
-
-template <class _RandomAccessIter, class _Tp>
-_RandomAccessIter find(_RandomAccessIter __first, _RandomAccessIter __last,
- const _Tp& __val,
- random_access_iterator_tag)
-{
- typename iterator_traits<_RandomAccessIter>::difference_type __trip_count
- = (__last - __first) >> 2;
-
- for ( ; __trip_count > 0 ; --__trip_count) {
- if (*__first == __val) return __first;
- ++__first;
-
- if (*__first == __val) return __first;
- ++__first;
-
- if (*__first == __val) return __first;
- ++__first;
-
- if (*__first == __val) return __first;
- ++__first;
- }
-
- switch(__last - __first) {
- case 3:
- if (*__first == __val) return __first;
- ++__first;
- case 2:
- if (*__first == __val) return __first;
- ++__first;
- case 1:
- if (*__first == __val) return __first;
- ++__first;
- case 0:
- default:
- return __last;
- }
-}
-
-template <class _RandomAccessIter, class _Predicate>
-_RandomAccessIter find_if(_RandomAccessIter __first, _RandomAccessIter __last,
- _Predicate __pred,
- random_access_iterator_tag)
-{
- typename iterator_traits<_RandomAccessIter>::difference_type __trip_count
- = (__last - __first) >> 2;
-
- for ( ; __trip_count > 0 ; --__trip_count) {
- if (__pred(*__first)) return __first;
- ++__first;
-
- if (__pred(*__first)) return __first;
- ++__first;
-
- if (__pred(*__first)) return __first;
- ++__first;
-
- if (__pred(*__first)) return __first;
- ++__first;
- }
-
- switch(__last - __first) {
- case 3:
- if (__pred(*__first)) return __first;
- ++__first;
- case 2:
- if (__pred(*__first)) return __first;
- ++__first;
- case 1:
- if (__pred(*__first)) return __first;
- ++__first;
- case 0:
- default:
- return __last;
- }
-}
-
-#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
-
-template <class _InputIter, class _Tp>
-inline _InputIter find(_InputIter __first, _InputIter __last,
- const _Tp& __val)
-{
- return find(__first, __last, __val, __ITERATOR_CATEGORY(__first));
-}
-
-template <class _InputIter, class _Predicate>
-inline _InputIter find_if(_InputIter __first, _InputIter __last,
- _Predicate __pred) {
- return find_if(__first, __last, __pred, __ITERATOR_CATEGORY(__first));
-}
-
-// adjacent_find.
-
-template <class _ForwardIter>
-_ForwardIter adjacent_find(_ForwardIter __first, _ForwardIter __last) {
- if (__first == __last)
- return __last;
- _ForwardIter __next = __first;
- while(++__next != __last) {
- if (*__first == *__next)
- return __first;
- __first = __next;
- }
- return __last;
-}
-
-template <class _ForwardIter, class _BinaryPredicate>
-_ForwardIter adjacent_find(_ForwardIter __first, _ForwardIter __last,
- _BinaryPredicate __binary_pred) {
- if (__first == __last)
- return __last;
- _ForwardIter __next = __first;
- while(++__next != __last) {
- if (__binary_pred(*__first, *__next))
- return __first;
- __first = __next;
- }
- return __last;
-}
-
-// count and count_if. There are two version of each, one whose return type
-// type is void and one (present only if we have partial specialization)
-// whose return type is iterator_traits<_InputIter>::difference_type. The
-// C++ standard only has the latter version, but the former, which was present
-// in the HP STL, is retained for backward compatibility.
-
-template <class _InputIter, class _Tp, class _Size>
-void count(_InputIter __first, _InputIter __last, const _Tp& __value,
- _Size& __n) {
- for ( ; __first != __last; ++__first)
- if (*__first == __value)
- ++__n;
-}
-
-template <class _InputIter, class _Predicate, class _Size>
-void count_if(_InputIter __first, _InputIter __last, _Predicate __pred,
- _Size& __n) {
- for ( ; __first != __last; ++__first)
- if (__pred(*__first))
- ++__n;
-}
-
-#ifdef __STL_CLASS_PARTIAL_SPECIALIZATION
-
-template <class _InputIter, class _Tp>
-typename iterator_traits<_InputIter>::difference_type
-count(_InputIter __first, _InputIter __last, const _Tp& __value) {
- typename iterator_traits<_InputIter>::difference_type __n = 0;
- for ( ; __first != __last; ++__first)
- if (*__first == __value)
- ++__n;
- return __n;
-}
-
-template <class _InputIter, class _Predicate>
-typename iterator_traits<_InputIter>::difference_type
-count_if(_InputIter __first, _InputIter __last, _Predicate __pred) {
- typename iterator_traits<_InputIter>::difference_type __n = 0;
- for ( ; __first != __last; ++__first)
- if (__pred(*__first))
- ++__n;
- return __n;
-}
-
-
-#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
-
-// search.
-
-template <class _ForwardIter1, class _ForwardIter2>
-_ForwardIter1 search(_ForwardIter1 __first1, _ForwardIter1 __last1,
- _ForwardIter2 __first2, _ForwardIter2 __last2)
-{
- // Test for empty ranges
- if (__first1 == __last1 || __first2 == __last2)
- return __first1;
-
- // Test for a pattern of length 1.
- _ForwardIter2 __tmp(__first2);
- ++__tmp;
- if (__tmp == __last2)
- return find(__first1, __last1, *__first2);
-
- // General case.
-
- _ForwardIter2 __p1, __p;
-
- __p1 = __first2; ++__p1;
-
- _ForwardIter1 __current = __first1;
-
- while (__first1 != __last1) {
- __first1 = find(__first1, __last1, *__first2);
- if (__first1 == __last1)
- return __last1;
-
- __p = __p1;
- __current = __first1;
- if (++__current == __last1)
- return __last1;
-
- while (*__current == *__p) {
- if (++__p == __last2)
- return __first1;
- if (++__current == __last1)
- return __last1;
- }
-
- ++__first1;
- }
- return __first1;
-}
-
-template <class _ForwardIter1, class _ForwardIter2, class _BinaryPred>
-_ForwardIter1 search(_ForwardIter1 __first1, _ForwardIter1 __last1,
- _ForwardIter2 __first2, _ForwardIter2 __last2,
- _BinaryPred __predicate)
-{
- // Test for empty ranges
- if (__first1 == __last1 || __first2 == __last2)
- return __first1;
-
- // Test for a pattern of length 1.
- _ForwardIter2 __tmp(__first2);
- ++__tmp;
- if (__tmp == __last2)
- return find(__first1, __last1, *__first2);
-
- // General case.
-
- _ForwardIter2 __p1, __p;
-
- __p1 = __first2; ++__p1;
-
- _ForwardIter1 __current = __first1;
-
- while (__first1 != __last1) {
- while (__first1 != __last1) {
- if (__predicate(*__first1, *__first2))
- break;
- ++__first1;
- }
- while (__first1 != __last1 && !__predicate(*__first1, *__first2))
- ++__first1;
- if (__first1 == __last1)
- return __last1;
-
- __p = __p1;
- __current = __first1;
- if (++__current == __last1) return __last1;
-
- while (__predicate(*__current, *__p)) {
- if (++__p == __last2)
- return __first1;
- if (++__current == __last1)
- return __last1;
- }
-
- ++__first1;
- }
- return __first1;
-}
-
-// search_n. Search for __count consecutive copies of __val.
-
-template <class _ForwardIter, class _Integer, class _Tp>
-_ForwardIter search_n(_ForwardIter __first, _ForwardIter __last,
- _Integer __count, const _Tp& __val) {
- if (__count <= 0)
- return __first;
- else {
- __first = find(__first, __last, __val);
- while (__first != __last) {
- _Integer __n = __count - 1;
- _ForwardIter __i = __first;
- ++__i;
- while (__i != __last && __n != 0 && *__i == __val) {
- ++__i;
- --__n;
- }
- if (__n == 0)
- return __first;
- else
- __first = find(__i, __last, __val);
- }
- return __last;
- }
-}
-
-template <class _ForwardIter, class _Integer, class _Tp, class _BinaryPred>
-_ForwardIter search_n(_ForwardIter __first, _ForwardIter __last,
- _Integer __count, const _Tp& __val,
- _BinaryPred __binary_pred) {
- if (__count <= 0)
- return __first;
- else {
- while (__first != __last) {
- if (__binary_pred(*__first, __val))
- break;
- ++__first;
- }
- while (__first != __last) {
- _Integer __n = __count - 1;
- _ForwardIter __i = __first;
- ++__i;
- while (__i != __last && __n != 0 && __binary_pred(*__i, __val)) {
- ++__i;
- --__n;
- }
- if (__n == 0)
- return __first;
- else {
- while (__i != __last) {
- if (__binary_pred(*__i, __val))
- break;
- ++__i;
- }
- __first = __i;
- }
- }
- return __last;
- }
-}
-
-// swap_ranges
-
-template <class _ForwardIter1, class _ForwardIter2>
-_ForwardIter2 swap_ranges(_ForwardIter1 __first1, _ForwardIter1 __last1,
- _ForwardIter2 __first2) {
- for ( ; __first1 != __last1; ++__first1, ++__first2)
- iter_swap(__first1, __first2);
- return __first2;
-}
-
-// transform
-
-template <class _InputIter, class _OutputIter, class _UnaryOperation>
-_OutputIter transform(_InputIter __first, _InputIter __last,
- _OutputIter __result, _UnaryOperation __oper) {
- for ( ; __first != __last; ++__first, ++__result)
- *__result = __oper(*__first);
- return __result;
-}
-
-template <class _InputIter1, class _InputIter2, class _OutputIter,
- class _BinaryOperation>
-_OutputIter transform(_InputIter1 __first1, _InputIter1 __last1,
- _InputIter2 __first2, _OutputIter __result,
- _BinaryOperation __binary_op) {
- for ( ; __first1 != __last1; ++__first1, ++__first2, ++__result)
- *__result = __binary_op(*__first1, *__first2);
- return __result;
-}
-
-// replace, replace_if, replace_copy, replace_copy_if
-
-template <class _ForwardIter, class _Tp>
-void replace(_ForwardIter __first, _ForwardIter __last,
- const _Tp& __old_value, const _Tp& __new_value) {
- for ( ; __first != __last; ++__first)
- if (*__first == __old_value)
- *__first = __new_value;
-}
-
-template <class _ForwardIter, class _Predicate, class _Tp>
-void replace_if(_ForwardIter __first, _ForwardIter __last,
- _Predicate __pred, const _Tp& __new_value) {
- for ( ; __first != __last; ++__first)
- if (__pred(*__first))
- *__first = __new_value;
-}
-
-template <class _InputIter, class _OutputIter, class _Tp>
-_OutputIter replace_copy(_InputIter __first, _InputIter __last,
- _OutputIter __result,
- const _Tp& __old_value, const _Tp& __new_value) {
- for ( ; __first != __last; ++__first, ++__result)
- *__result = *__first == __old_value ? __new_value : *__first;
- return __result;
-}
-
-template <class Iterator, class _OutputIter, class _Predicate, class _Tp>
-_OutputIter replace_copy_if(Iterator __first, Iterator __last,
- _OutputIter __result,
- _Predicate __pred, const _Tp& __new_value) {
- for ( ; __first != __last; ++__first, ++__result)
- *__result = __pred(*__first) ? __new_value : *__first;
- return __result;
-}
-
-// generate and generate_n
-
-template <class _ForwardIter, class _Generator>
-void generate(_ForwardIter __first, _ForwardIter __last, _Generator __gen) {
- for ( ; __first != __last; ++__first)
- *__first = __gen();
-}
-
-template <class _OutputIter, class _Size, class _Generator>
-_OutputIter generate_n(_OutputIter __first, _Size __n, _Generator __gen) {
- for ( ; __n > 0; --__n, ++__first)
- *__first = __gen();
- return __first;
-}
-
-// remove, remove_if, remove_copy, remove_copy_if
-
-template <class _InputIter, class _OutputIter, class _Tp>
-_OutputIter remove_copy(_InputIter __first, _InputIter __last,
- _OutputIter __result, const _Tp& __value) {
- for ( ; __first != __last; ++__first)
- if (*__first != __value) {
- *__result = *__first;
- ++__result;
- }
- return __result;
-}
-
-template <class _InputIter, class _OutputIter, class _Predicate>
-_OutputIter remove_copy_if(_InputIter __first, _InputIter __last,
- _OutputIter __result, _Predicate __pred) {
- for ( ; __first != __last; ++__first)
- if (!__pred(*__first)) {
- *__result = *__first;
- ++__result;
- }
- return __result;
-}
-
-template <class _ForwardIter, class _Tp>
-_ForwardIter remove(_ForwardIter __first, _ForwardIter __last,
- const _Tp& __value) {
- __first = find(__first, __last, __value);
- _ForwardIter __i = __first;
- return __first == __last ? __first
- : remove_copy(++__i, __last, __first, __value);
-}
-
-template <class _ForwardIter, class _Predicate>
-_ForwardIter remove_if(_ForwardIter __first, _ForwardIter __last,
- _Predicate __pred) {
- __first = find_if(__first, __last, __pred);
- _ForwardIter __i = __first;
- return __first == __last ? __first
- : remove_copy_if(++__i, __last, __first, __pred);
-}
-
-// unique and unique_copy
-
-template <class _InputIter, class _OutputIter, class _Tp>
-_OutputIter __unique_copy(_InputIter __first, _InputIter __last,
- _OutputIter __result, _Tp*) {
- _Tp __value = *__first;
- *__result = __value;
- while (++__first != __last)
- if (__value != *__first) {
- __value = *__first;
- *++__result = __value;
- }
- return ++__result;
-}
-
-template <class _InputIter, class _OutputIter>
-inline _OutputIter __unique_copy(_InputIter __first, _InputIter __last,
- _OutputIter __result,
- output_iterator_tag) {
- return __unique_copy(__first, __last, __result, __VALUE_TYPE(__first));
-}
-
-template <class _InputIter, class _ForwardIter>
-_ForwardIter __unique_copy(_InputIter __first, _InputIter __last,
- _ForwardIter __result, forward_iterator_tag) {
- *__result = *__first;
- while (++__first != __last)
- if (*__result != *__first) *++__result = *__first;
- return ++__result;
-}
-
-template <class _InputIter, class _OutputIter>
-inline _OutputIter unique_copy(_InputIter __first, _InputIter __last,
- _OutputIter __result) {
- if (__first == __last) return __result;
- return __unique_copy(__first, __last, __result,
- __ITERATOR_CATEGORY(__result));
-}
-
-template <class _InputIter, class _OutputIter, class _BinaryPredicate,
- class _Tp>
-_OutputIter __unique_copy(_InputIter __first, _InputIter __last,
- _OutputIter __result,
- _BinaryPredicate __binary_pred, _Tp*) {
- _Tp __value = *__first;
- *__result = __value;
- while (++__first != __last)
- if (!__binary_pred(__value, *__first)) {
- __value = *__first;
- *++__result = __value;
- }
- return ++__result;
-}
-
-template <class _InputIter, class _OutputIter, class _BinaryPredicate>
-inline _OutputIter __unique_copy(_InputIter __first, _InputIter __last,
- _OutputIter __result,
- _BinaryPredicate __binary_pred,
- output_iterator_tag) {
- return __unique_copy(__first, __last, __result, __binary_pred,
- __VALUE_TYPE(__first));
-}
-
-template <class _InputIter, class _ForwardIter, class _BinaryPredicate>
-_ForwardIter __unique_copy(_InputIter __first, _InputIter __last,
- _ForwardIter __result,
- _BinaryPredicate __binary_pred,
- forward_iterator_tag) {
- *__result = *__first;
- while (++__first != __last)
- if (!__binary_pred(*__result, *__first)) *++__result = *__first;
- return ++__result;
-}
-
-template <class _InputIter, class _OutputIter, class _BinaryPredicate>
-inline _OutputIter unique_copy(_InputIter __first, _InputIter __last,
- _OutputIter __result,
- _BinaryPredicate __binary_pred) {
- if (__first == __last) return __result;
- return __unique_copy(__first, __last, __result, __binary_pred,
- __ITERATOR_CATEGORY(__result));
-}
-
-template <class _ForwardIter>
-_ForwardIter unique(_ForwardIter __first, _ForwardIter __last) {
- __first = adjacent_find(__first, __last);
- return unique_copy(__first, __last, __first);
-}
-
-template <class _ForwardIter, class _BinaryPredicate>
-_ForwardIter unique(_ForwardIter __first, _ForwardIter __last,
- _BinaryPredicate __binary_pred) {
- __first = adjacent_find(__first, __last, __binary_pred);
- return unique_copy(__first, __last, __first, __binary_pred);
-}
-
-// reverse and reverse_copy, and their auxiliary functions
-
-template <class _BidirectionalIter>
-void __reverse(_BidirectionalIter __first, _BidirectionalIter __last,
- bidirectional_iterator_tag) {
- while (true)
- if (__first == __last || __first == --__last)
- return;
- else
- iter_swap(__first++, __last);
-}
-
-template <class _RandomAccessIter>
-void __reverse(_RandomAccessIter __first, _RandomAccessIter __last,
- random_access_iterator_tag) {
- while (__first < __last)
- iter_swap(__first++, --__last);
-}
-
-template <class _BidirectionalIter>
-inline void reverse(_BidirectionalIter __first, _BidirectionalIter __last) {
- __reverse(__first, __last, __ITERATOR_CATEGORY(__first));
-}
-
-template <class _BidirectionalIter, class _OutputIter>
-_OutputIter reverse_copy(_BidirectionalIter __first,
- _BidirectionalIter __last,
- _OutputIter __result) {
- while (__first != __last) {
- --__last;
- *__result = *__last;
- ++__result;
- }
- return __result;
-}
-
-// rotate and rotate_copy, and their auxiliary functions
-
-template <class _EuclideanRingElement>
-_EuclideanRingElement __gcd(_EuclideanRingElement __m,
- _EuclideanRingElement __n)
-{
- while (__n != 0) {
- _EuclideanRingElement __t = __m % __n;
- __m = __n;
- __n = __t;
- }
- return __m;
-}
-
-template <class _ForwardIter, class _Distance>
-_ForwardIter __rotate(_ForwardIter __first,
- _ForwardIter __middle,
- _ForwardIter __last,
- _Distance*,
- forward_iterator_tag) {
- if (__first == __middle)
- return __last;
- if (__last == __middle)
- return __first;
-
- _ForwardIter __first2 = __middle;
- do {
- swap(*__first++, *__first2++);
- if (__first == __middle)
- __middle = __first2;
- } while (__first2 != __last);
-
- _ForwardIter __new_middle = __first;
-
- __first2 = __middle;
-
- while (__first2 != __last) {
- swap (*__first++, *__first2++);
- if (__first == __middle)
- __middle = __first2;
- else if (__first2 == __last)
- __first2 = __middle;
- }
-
- return __new_middle;
-}
-
-
-template <class _BidirectionalIter, class _Distance>
-_BidirectionalIter __rotate(_BidirectionalIter __first,
- _BidirectionalIter __middle,
- _BidirectionalIter __last,
- _Distance*,
- bidirectional_iterator_tag) {
- if (__first == __middle)
- return __last;
- if (__last == __middle)
- return __first;
-
- __reverse(__first, __middle, bidirectional_iterator_tag());
- __reverse(__middle, __last, bidirectional_iterator_tag());
-
- while (__first != __middle && __middle != __last)
- swap (*__first++, *--__last);
-
- if (__first == __middle) {
- __reverse(__middle, __last, bidirectional_iterator_tag());
- return __last;
- }
- else {
- __reverse(__first, __middle, bidirectional_iterator_tag());
- return __first;
- }
-}
-
-template <class _RandomAccessIter, class _Distance, class _Tp>
-_RandomAccessIter __rotate(_RandomAccessIter __first,
- _RandomAccessIter __middle,
- _RandomAccessIter __last,
- _Distance *, _Tp *) {
-
- _Distance __n = __last - __first;
- _Distance __k = __middle - __first;
- _Distance __l = __n - __k;
- _RandomAccessIter __result = __first + (__last - __middle);
-
- if (__k == __l) {
- swap_ranges(__first, __middle, __middle);
- return __result;
- }
-
- _Distance __d = __gcd(__n, __k);
-
- for (_Distance __i = 0; __i < __d; __i++) {
- _Tp __tmp = *__first;
- _RandomAccessIter __p = __first;
-
- if (__k < __l) {
- for (_Distance __j = 0; __j < __l/__d; __j++) {
- if (__p > __first + __l) {
- *__p = *(__p - __l);
- __p -= __l;
- }
-
- *__p = *(__p + __k);
- __p += __k;
- }
- }
-
- else {
- for (_Distance __j = 0; __j < __k/__d - 1; __j ++) {
- if (__p < __last - __k) {
- *__p = *(__p + __k);
- __p += __k;
- }
-
- *__p = * (__p - __l);
- __p -= __l;
- }
- }
-
- *__p = __tmp;
- ++__first;
- }
-
- return __result;
-}
-
-template <class _ForwardIter>
-inline _ForwardIter rotate(_ForwardIter __first, _ForwardIter __middle,
- _ForwardIter __last) {
- return __rotate(__first, __middle, __last,
- __DISTANCE_TYPE(__first),
- __ITERATOR_CATEGORY(__first));
-}
-
-template <class _ForwardIter, class _OutputIter>
-_OutputIter rotate_copy(_ForwardIter __first, _ForwardIter __middle,
- _ForwardIter __last, _OutputIter __result) {
- return copy(__first, __middle, copy(__middle, __last, __result));
-}
-
-// Return a random number in the range [0, __n). This function encapsulates
-// whether we're using rand (part of the standard C library) or lrand48
-// (not standard, but a much better choice whenever it's available).
-
-template <class _Distance>
-inline _Distance __random_number(_Distance __n) {
-#ifdef __STL_NO_DRAND48
- return rand() % __n;
-#else
- return lrand48() % __n;
-#endif
-}
-
-// random_shuffle
-
-template <class _RandomAccessIter>
-inline void random_shuffle(_RandomAccessIter __first,
- _RandomAccessIter __last) {
- if (__first == __last) return;
- for (_RandomAccessIter __i = __first + 1; __i != __last; ++__i)
- iter_swap(__i, __first + __random_number((__i - __first) + 1));
-}
-
-template <class _RandomAccessIter, class _RandomNumberGenerator>
-void random_shuffle(_RandomAccessIter __first, _RandomAccessIter __last,
- _RandomNumberGenerator& __rand) {
- if (__first == __last) return;
- for (_RandomAccessIter __i = __first + 1; __i != __last; ++__i)
- iter_swap(__i, __first + __rand((__i - __first) + 1));
-}
-
-// random_sample and random_sample_n (extensions, not part of the standard).
-
-template <class _ForwardIter, class _OutputIter, class _Distance>
-_OutputIter random_sample_n(_ForwardIter __first, _ForwardIter __last,
- _OutputIter __out, const _Distance __n)
-{
- _Distance __remaining = 0;
- distance(__first, __last, __remaining);
- _Distance __m = min(__n, __remaining);
-
- while (__m > 0) {
- if (__random_number(__remaining) < __m) {
- *__out = *__first;
- ++__out;
- --__m;
- }
-
- --__remaining;
- ++__first;
- }
- return __out;
-}
-
-template <class _ForwardIter, class _OutputIter, class _Distance,
- class _RandomNumberGenerator>
-_OutputIter random_sample_n(_ForwardIter __first, _ForwardIter __last,
- _OutputIter __out, const _Distance __n,
- _RandomNumberGenerator& __rand)
-{
- _Distance __remaining = 0;
- distance(__first, __last, __remaining);
- _Distance __m = min(__n, __remaining);
-
- while (__m > 0) {
- if (__rand(__remaining) < __m) {
- *__out = *__first;
- ++__out;
- --__m;
- }
-
- --__remaining;
- ++__first;
- }
- return __out;
-}
-
-template <class _InputIter, class _RandomAccessIter, class _Distance>
-_RandomAccessIter __random_sample(_InputIter __first, _InputIter __last,
- _RandomAccessIter __out,
- const _Distance __n)
-{
- _Distance __m = 0;
- _Distance __t = __n;
- for ( ; __first != __last && __m < __n; ++__m, ++__first)
- __out[__m] = *__first;
-
- while (__first != __last) {
- ++__t;
- _Distance __M = __random_number(__t);
- if (__M < __n)
- __out[__M] = *__first;
- ++__first;
- }
-
- return __out + __m;
-}
-
-template <class _InputIter, class _RandomAccessIter,
- class _RandomNumberGenerator, class _Distance>
-_RandomAccessIter __random_sample(_InputIter __first, _InputIter __last,
- _RandomAccessIter __out,
- _RandomNumberGenerator& __rand,
- const _Distance __n)
-{
- _Distance __m = 0;
- _Distance __t = __n;
- for ( ; __first != __last && __m < __n; ++__m, ++__first)
- __out[__m] = *__first;
-
- while (__first != __last) {
- ++__t;
- _Distance __M = __rand(__t);
- if (__M < __n)
- __out[__M] = *__first;
- ++__first;
- }
-
- return __out + __m;
-}
-
-template <class _InputIter, class _RandomAccessIter>
-inline _RandomAccessIter
-random_sample(_InputIter __first, _InputIter __last,
- _RandomAccessIter __out_first, _RandomAccessIter __out_last)
-{
- return __random_sample(__first, __last,
- __out_first, __out_last - __out_first);
-}
-
-
-template <class _InputIter, class _RandomAccessIter,
- class _RandomNumberGenerator>
-inline _RandomAccessIter
-random_sample(_InputIter __first, _InputIter __last,
- _RandomAccessIter __out_first, _RandomAccessIter __out_last,
- _RandomNumberGenerator& __rand)
-{
- return __random_sample(__first, __last,
- __out_first, __rand,
- __out_last - __out_first);
-}
-
-// partition, stable_partition, and their auxiliary functions
-
-template <class _ForwardIter, class _Predicate>
-_ForwardIter __partition(_ForwardIter __first,
- _ForwardIter __last,
- _Predicate __pred,
- forward_iterator_tag) {
- if (__first == __last) return __first;
-
- while (__pred(*__first))
- if (++__first == __last) return __first;
-
- _ForwardIter __next = __first;
-
- while (++__next != __last)
- if (__pred(*__next)) {
- swap(*__first, *__next);
- ++__first;
- }
-
- return __first;
-}
-
-template <class _BidirectionalIter, class _Predicate>
-_BidirectionalIter __partition(_BidirectionalIter __first,
- _BidirectionalIter __last,
- _Predicate __pred,
- bidirectional_iterator_tag) {
- while (true) {
- while (true)
- if (__first == __last)
- return __first;
- else if (__pred(*__first))
- ++__first;
- else
- break;
- --__last;
- while (true)
- if (__first == __last)
- return __first;
- else if (!__pred(*__last))
- --__last;
- else
- break;
- iter_swap(__first, __last);
- ++__first;
- }
-}
-
-template <class _ForwardIter, class _Predicate>
-inline _ForwardIter partition(_ForwardIter __first,
- _ForwardIter __last,
- _Predicate __pred) {
- return __partition(__first, __last, __pred, __ITERATOR_CATEGORY(__first));
-}
-
-
-template <class _ForwardIter, class _Predicate, class _Distance>
-_ForwardIter __inplace_stable_partition(_ForwardIter __first,
- _ForwardIter __last,
- _Predicate __pred, _Distance __len) {
- if (__len == 1)
- return __pred(*__first) ? __last : __first;
- _ForwardIter __middle = __first;
- advance(__middle, __len / 2);
- return rotate(__inplace_stable_partition(__first, __middle, __pred,
- __len / 2),
- __middle,
- __inplace_stable_partition(__middle, __last, __pred,
- __len - __len / 2));
-}
-
-template <class _ForwardIter, class _Pointer, class _Predicate,
- class _Distance>
-_ForwardIter __stable_partition_adaptive(_ForwardIter __first,
- _ForwardIter __last,
- _Predicate __pred, _Distance __len,
- _Pointer __buffer,
- _Distance __buffer_size)
-{
- if (__len <= __buffer_size) {
- _ForwardIter __result1 = __first;
- _Pointer __result2 = __buffer;
- for ( ; __first != __last ; ++__first)
- if (__pred(*__first)) {
- *__result1 = *__first;
- ++__result1;
- }
- else {
- *__result2 = *__first;
- ++__result2;
- }
- copy(__buffer, __result2, __result1);
- return __result1;
- }
- else {
- _ForwardIter __middle = __first;
- advance(__middle, __len / 2);
- return rotate(__stable_partition_adaptive(
- __first, __middle, __pred,
- __len / 2, __buffer, __buffer_size),
- __middle,
- __stable_partition_adaptive(
- __middle, __last, __pred,
- __len - __len / 2, __buffer, __buffer_size));
- }
-}
-
-template <class _ForwardIter, class _Predicate, class _Tp, class _Distance>
-inline _ForwardIter
-__stable_partition_aux(_ForwardIter __first, _ForwardIter __last,
- _Predicate __pred, _Tp*, _Distance*)
-{
- _Temporary_buffer<_ForwardIter, _Tp> __buf(__first, __last);
- if (__buf.size() > 0)
- return __stable_partition_adaptive(__first, __last, __pred,
- _Distance(__buf.requested_size()),
- __buf.begin(), __buf.size());
- else
- return __inplace_stable_partition(__first, __last, __pred,
- _Distance(__buf.requested_size()));
-}
-
-template <class _ForwardIter, class _Predicate>
-inline _ForwardIter stable_partition(_ForwardIter __first,
- _ForwardIter __last,
- _Predicate __pred) {
- if (__first == __last)
- return __first;
- else
- return __stable_partition_aux(__first, __last, __pred,
- __VALUE_TYPE(__first),
- __DISTANCE_TYPE(__first));
-}
-
-template <class _RandomAccessIter, class _Tp>
-_RandomAccessIter __unguarded_partition(_RandomAccessIter __first,
- _RandomAccessIter __last,
- _Tp __pivot)
-{
- while (true) {
- while (*__first < __pivot)
- ++__first;
- --__last;
- while (__pivot < *__last)
- --__last;
- if (!(__first < __last))
- return __first;
- iter_swap(__first, __last);
- ++__first;
- }
-}
-
-template <class _RandomAccessIter, class _Tp, class _Compare>
-_RandomAccessIter __unguarded_partition(_RandomAccessIter __first,
- _RandomAccessIter __last,
- _Tp __pivot, _Compare __comp)
-{
- while (true) {
- while (__comp(*__first, __pivot))
- ++__first;
- --__last;
- while (__comp(__pivot, *__last))
- --__last;
- if (!(__first < __last))
- return __first;
- iter_swap(__first, __last);
- ++__first;
- }
-}
-
-const int __stl_threshold = 16;
-
-// sort() and its auxiliary functions.
-
-template <class _RandomAccessIter, class _Tp>
-void __unguarded_linear_insert(_RandomAccessIter __last, _Tp __val) {
- _RandomAccessIter __next = __last;
- --__next;
- while (__val < *__next) {
- *__last = *__next;
- __last = __next;
- --__next;
- }
- *__last = __val;
-}
-
-template <class _RandomAccessIter, class _Tp, class _Compare>
-void __unguarded_linear_insert(_RandomAccessIter __last, _Tp __val,
- _Compare __comp) {
- _RandomAccessIter __next = __last;
- --__next;
- while (__comp(__val, *__next)) {
- *__last = *__next;
- __last = __next;
- --__next;
- }
- *__last = __val;
-}
-
-template <class _RandomAccessIter, class _Tp>
-inline void __linear_insert(_RandomAccessIter __first,
- _RandomAccessIter __last, _Tp*) {
- _Tp __val = *__last;
- if (__val < *__first) {
- copy_backward(__first, __last, __last + 1);
- *__first = __val;
- }
- else
- __unguarded_linear_insert(__last, __val);
-}
-
-template <class _RandomAccessIter, class _Tp, class _Compare>
-inline void __linear_insert(_RandomAccessIter __first,
- _RandomAccessIter __last, _Tp*, _Compare __comp) {
- _Tp __val = *__last;
- if (__comp(__val, *__first)) {
- copy_backward(__first, __last, __last + 1);
- *__first = __val;
- }
- else
- __unguarded_linear_insert(__last, __val, __comp);
-}
-
-template <class _RandomAccessIter>
-void __insertion_sort(_RandomAccessIter __first, _RandomAccessIter __last) {
- if (__first == __last) return;
- for (_RandomAccessIter __i = __first + 1; __i != __last; ++__i)
- __linear_insert(__first, __i, __VALUE_TYPE(__first));
-}
-
-template <class _RandomAccessIter, class _Compare>
-void __insertion_sort(_RandomAccessIter __first,
- _RandomAccessIter __last, _Compare __comp) {
- if (__first == __last) return;
- for (_RandomAccessIter __i = __first + 1; __i != __last; ++__i)
- __linear_insert(__first, __i, __VALUE_TYPE(__first), __comp);
-}
-
-template <class _RandomAccessIter, class _Tp>
-void __unguarded_insertion_sort_aux(_RandomAccessIter __first,
- _RandomAccessIter __last, _Tp*) {
- for (_RandomAccessIter __i = __first; __i != __last; ++__i)
- __unguarded_linear_insert(__i, _Tp(*__i));
-}
-
-template <class _RandomAccessIter>
-inline void __unguarded_insertion_sort(_RandomAccessIter __first,
- _RandomAccessIter __last) {
- __unguarded_insertion_sort_aux(__first, __last, __VALUE_TYPE(__first));
-}
-
-template <class _RandomAccessIter, class _Tp, class _Compare>
-void __unguarded_insertion_sort_aux(_RandomAccessIter __first,
- _RandomAccessIter __last,
- _Tp*, _Compare __comp) {
- for (_RandomAccessIter __i = __first; __i != __last; ++__i)
- __unguarded_linear_insert(__i, _Tp(*__i), __comp);
-}
-
-template <class _RandomAccessIter, class _Compare>
-inline void __unguarded_insertion_sort(_RandomAccessIter __first,
- _RandomAccessIter __last,
- _Compare __comp) {
- __unguarded_insertion_sort_aux(__first, __last, __VALUE_TYPE(__first),
- __comp);
-}
-
-template <class _RandomAccessIter>
-void __final_insertion_sort(_RandomAccessIter __first,
- _RandomAccessIter __last) {
- if (__last - __first > __stl_threshold) {
- __insertion_sort(__first, __first + __stl_threshold);
- __unguarded_insertion_sort(__first + __stl_threshold, __last);
- }
- else
- __insertion_sort(__first, __last);
-}
-
-template <class _RandomAccessIter, class _Compare>
-void __final_insertion_sort(_RandomAccessIter __first,
- _RandomAccessIter __last, _Compare __comp) {
- if (__last - __first > __stl_threshold) {
- __insertion_sort(__first, __first + __stl_threshold, __comp);
- __unguarded_insertion_sort(__first + __stl_threshold, __last, __comp);
- }
- else
- __insertion_sort(__first, __last, __comp);
-}
-
-template <class _Size>
-inline _Size __lg(_Size __n) {
- _Size __k;
- for (__k = 0; __n != 1; __n >>= 1) ++__k;
- return __k;
-}
-
-template <class _RandomAccessIter, class _Tp, class _Size>
-void __introsort_loop(_RandomAccessIter __first,
- _RandomAccessIter __last, _Tp*,
- _Size __depth_limit)
-{
- while (__last - __first > __stl_threshold) {
- if (__depth_limit == 0) {
- partial_sort(__first, __last, __last);
- return;
- }
- --__depth_limit;
- _RandomAccessIter __cut =
- __unguarded_partition(__first, __last,
- _Tp(__median(*__first,
- *(__first + (__last - __first)/2),
- *(__last - 1))));
- __introsort_loop(__cut, __last, (_Tp*) 0, __depth_limit);
- __last = __cut;
- }
-}
-
-template <class _RandomAccessIter, class _Tp, class _Size, class _Compare>
-void __introsort_loop(_RandomAccessIter __first,
- _RandomAccessIter __last, _Tp*,
- _Size __depth_limit, _Compare __comp)
-{
- while (__last - __first > __stl_threshold) {
- if (__depth_limit == 0) {
- partial_sort(__first, __last, __last, __comp);
- return;
- }
- --__depth_limit;
- _RandomAccessIter __cut =
- __unguarded_partition(__first, __last,
- _Tp(__median(*__first,
- *(__first + (__last - __first)/2),
- *(__last - 1), __comp)),
- __comp);
- __introsort_loop(__cut, __last, (_Tp*) 0, __depth_limit, __comp);
- __last = __cut;
- }
-}
-
-template <class _RandomAccessIter>
-inline void sort(_RandomAccessIter __first, _RandomAccessIter __last) {
- if (__first != __last) {
- __introsort_loop(__first, __last,
- __VALUE_TYPE(__first),
- __lg(__last - __first) * 2);
- __final_insertion_sort(__first, __last);
- }
-}
-
-template <class _RandomAccessIter, class _Compare>
-inline void sort(_RandomAccessIter __first, _RandomAccessIter __last,
- _Compare __comp) {
- if (__first != __last) {
- __introsort_loop(__first, __last,
- __VALUE_TYPE(__first),
- __lg(__last - __first) * 2,
- __comp);
- __final_insertion_sort(__first, __last, __comp);
- }
-}
-
-// stable_sort() and its auxiliary functions.
-
-template <class _RandomAccessIter>
-void __inplace_stable_sort(_RandomAccessIter __first,
- _RandomAccessIter __last) {
- if (__last - __first < 15) {
- __insertion_sort(__first, __last);
- return;
- }
- _RandomAccessIter __middle = __first + (__last - __first) / 2;
- __inplace_stable_sort(__first, __middle);
- __inplace_stable_sort(__middle, __last);
- __merge_without_buffer(__first, __middle, __last,
- __middle - __first,
- __last - __middle);
-}
-
-template <class _RandomAccessIter, class _Compare>
-void __inplace_stable_sort(_RandomAccessIter __first,
- _RandomAccessIter __last, _Compare __comp) {
- if (__last - __first < 15) {
- __insertion_sort(__first, __last, __comp);
- return;
- }
- _RandomAccessIter __middle = __first + (__last - __first) / 2;
- __inplace_stable_sort(__first, __middle, __comp);
- __inplace_stable_sort(__middle, __last, __comp);
- __merge_without_buffer(__first, __middle, __last,
- __middle - __first,
- __last - __middle,
- __comp);
-}
-
-template <class _RandomAccessIter1, class _RandomAccessIter2,
- class _Distance>
-void __merge_sort_loop(_RandomAccessIter1 __first,
- _RandomAccessIter1 __last,
- _RandomAccessIter2 __result, _Distance __step_size) {
- _Distance __two_step = 2 * __step_size;
-
- while (__last - __first >= __two_step) {
- __result = merge(__first, __first + __step_size,
- __first + __step_size, __first + __two_step,
- __result);
- __first += __two_step;
- }
-
- __step_size = min(_Distance(__last - __first), __step_size);
- merge(__first, __first + __step_size, __first + __step_size, __last,
- __result);
-}
-
-template <class _RandomAccessIter1, class _RandomAccessIter2,
- class _Distance, class _Compare>
-void __merge_sort_loop(_RandomAccessIter1 __first,
- _RandomAccessIter1 __last,
- _RandomAccessIter2 __result, _Distance __step_size,
- _Compare __comp) {
- _Distance __two_step = 2 * __step_size;
-
- while (__last - __first >= __two_step) {
- __result = merge(__first, __first + __step_size,
- __first + __step_size, __first + __two_step,
- __result,
- __comp);
- __first += __two_step;
- }
- __step_size = min(_Distance(__last - __first), __step_size);
-
- merge(__first, __first + __step_size,
- __first + __step_size, __last,
- __result,
- __comp);
-}
-
-const int __stl_chunk_size = 7;
-
-template <class _RandomAccessIter, class _Distance>
-void __chunk_insertion_sort(_RandomAccessIter __first,
- _RandomAccessIter __last, _Distance __chunk_size)
-{
- while (__last - __first >= __chunk_size) {
- __insertion_sort(__first, __first + __chunk_size);
- __first += __chunk_size;
- }
- __insertion_sort(__first, __last);
-}
-
-template <class _RandomAccessIter, class _Distance, class _Compare>
-void __chunk_insertion_sort(_RandomAccessIter __first,
- _RandomAccessIter __last,
- _Distance __chunk_size, _Compare __comp)
-{
- while (__last - __first >= __chunk_size) {
- __insertion_sort(__first, __first + __chunk_size, __comp);
- __first += __chunk_size;
- }
- __insertion_sort(__first, __last, __comp);
-}
-
-template <class _RandomAccessIter, class _Pointer, class _Distance>
-void __merge_sort_with_buffer(_RandomAccessIter __first,
- _RandomAccessIter __last,
- _Pointer __buffer, _Distance*) {
- _Distance __len = __last - __first;
- _Pointer __buffer_last = __buffer + __len;
-
- _Distance __step_size = __stl_chunk_size;
- __chunk_insertion_sort(__first, __last, __step_size);
-
- while (__step_size < __len) {
- __merge_sort_loop(__first, __last, __buffer, __step_size);
- __step_size *= 2;
- __merge_sort_loop(__buffer, __buffer_last, __first, __step_size);
- __step_size *= 2;
- }
-}
-
-template <class _RandomAccessIter, class _Pointer, class _Distance,
- class _Compare>
-void __merge_sort_with_buffer(_RandomAccessIter __first,
- _RandomAccessIter __last, _Pointer __buffer,
- _Distance*, _Compare __comp) {
- _Distance __len = __last - __first;
- _Pointer __buffer_last = __buffer + __len;
-
- _Distance __step_size = __stl_chunk_size;
- __chunk_insertion_sort(__first, __last, __step_size, __comp);
-
- while (__step_size < __len) {
- __merge_sort_loop(__first, __last, __buffer, __step_size, __comp);
- __step_size *= 2;
- __merge_sort_loop(__buffer, __buffer_last, __first, __step_size, __comp);
- __step_size *= 2;
- }
-}
-
-template <class _RandomAccessIter, class _Pointer, class _Distance>
-void __stable_sort_adaptive(_RandomAccessIter __first,
- _RandomAccessIter __last, _Pointer __buffer,
- _Distance __buffer_size) {
- _Distance __len = (__last - __first + 1) / 2;
- _RandomAccessIter __middle = __first + __len;
- if (__len > __buffer_size) {
- __stable_sort_adaptive(__first, __middle, __buffer, __buffer_size);
- __stable_sort_adaptive(__middle, __last, __buffer, __buffer_size);
- }
- else {
- __merge_sort_with_buffer(__first, __middle, __buffer, (_Distance*)0);
- __merge_sort_with_buffer(__middle, __last, __buffer, (_Distance*)0);
- }
- __merge_adaptive(__first, __middle, __last, _Distance(__middle - __first),
- _Distance(__last - __middle), __buffer, __buffer_size);
-}
-
-template <class _RandomAccessIter, class _Pointer, class _Distance,
- class _Compare>
-void __stable_sort_adaptive(_RandomAccessIter __first,
- _RandomAccessIter __last, _Pointer __buffer,
- _Distance __buffer_size, _Compare __comp) {
- _Distance __len = (__last - __first + 1) / 2;
- _RandomAccessIter __middle = __first + __len;
- if (__len > __buffer_size) {
- __stable_sort_adaptive(__first, __middle, __buffer, __buffer_size,
- __comp);
- __stable_sort_adaptive(__middle, __last, __buffer, __buffer_size,
- __comp);
- }
- else {
- __merge_sort_with_buffer(__first, __middle, __buffer, (_Distance*)0,
- __comp);
- __merge_sort_with_buffer(__middle, __last, __buffer, (_Distance*)0,
- __comp);
- }
- __merge_adaptive(__first, __middle, __last, _Distance(__middle - __first),
- _Distance(__last - __middle), __buffer, __buffer_size,
- __comp);
-}
-
-template <class _RandomAccessIter, class _Tp, class _Distance>
-inline void __stable_sort_aux(_RandomAccessIter __first,
- _RandomAccessIter __last, _Tp*, _Distance*) {
- _Temporary_buffer<_RandomAccessIter, _Tp> buf(__first, __last);
- if (buf.begin() == 0)
- __inplace_stable_sort(__first, __last);
- else
- __stable_sort_adaptive(__first, __last, buf.begin(),
- _Distance(buf.size()));
-}
-
-template <class _RandomAccessIter, class _Tp, class _Distance, class _Compare>
-inline void __stable_sort_aux(_RandomAccessIter __first,
- _RandomAccessIter __last, _Tp*, _Distance*,
- _Compare __comp) {
- _Temporary_buffer<_RandomAccessIter, _Tp> buf(__first, __last);
- if (buf.begin() == 0)
- __inplace_stable_sort(__first, __last, __comp);
- else
- __stable_sort_adaptive(__first, __last, buf.begin(),
- _Distance(buf.size()),
- __comp);
-}
-
-template <class _RandomAccessIter>
-inline void stable_sort(_RandomAccessIter __first,
- _RandomAccessIter __last) {
- __stable_sort_aux(__first, __last,
- __VALUE_TYPE(__first),
- __DISTANCE_TYPE(__first));
-}
-
-template <class _RandomAccessIter, class _Compare>
-inline void stable_sort(_RandomAccessIter __first,
- _RandomAccessIter __last, _Compare __comp) {
- __stable_sort_aux(__first, __last,
- __VALUE_TYPE(__first),
- __DISTANCE_TYPE(__first),
- __comp);
-}
-
-// partial_sort, partial_sort_copy, and auxiliary functions.
-
-template <class _RandomAccessIter, class _Tp>
-void __partial_sort(_RandomAccessIter __first, _RandomAccessIter __middle,
- _RandomAccessIter __last, _Tp*) {
- make_heap(__first, __middle);
- for (_RandomAccessIter __i = __middle; __i < __last; ++__i)
- if (*__i < *__first)
- __pop_heap(__first, __middle, __i, _Tp(*__i),
- __DISTANCE_TYPE(__first));
- sort_heap(__first, __middle);
-}
-
-template <class _RandomAccessIter>
-inline void partial_sort(_RandomAccessIter __first,
- _RandomAccessIter __middle,
- _RandomAccessIter __last) {
- __partial_sort(__first, __middle, __last, __VALUE_TYPE(__first));
-}
-
-template <class _RandomAccessIter, class _Tp, class _Compare>
-void __partial_sort(_RandomAccessIter __first, _RandomAccessIter __middle,
- _RandomAccessIter __last, _Tp*, _Compare __comp) {
- make_heap(__first, __middle, __comp);
- for (_RandomAccessIter __i = __middle; __i < __last; ++__i)
- if (__comp(*__i, *__first))
- __pop_heap(__first, __middle, __i, _Tp(*__i), __comp,
- __DISTANCE_TYPE(__first));
- sort_heap(__first, __middle, __comp);
-}
-
-template <class _RandomAccessIter, class _Compare>
-inline void partial_sort(_RandomAccessIter __first,
- _RandomAccessIter __middle,
- _RandomAccessIter __last, _Compare __comp) {
- __partial_sort(__first, __middle, __last, __VALUE_TYPE(__first), __comp);
-}
-
-template <class _InputIter, class _RandomAccessIter, class _Distance,
- class _Tp>
-_RandomAccessIter __partial_sort_copy(_InputIter __first,
- _InputIter __last,
- _RandomAccessIter __result_first,
- _RandomAccessIter __result_last,
- _Distance*, _Tp*) {
- if (__result_first == __result_last) return __result_last;
- _RandomAccessIter __result_real_last = __result_first;
- while(__first != __last && __result_real_last != __result_last) {
- *__result_real_last = *__first;
- ++__result_real_last;
- ++__first;
- }
- make_heap(__result_first, __result_real_last);
- while (__first != __last) {
- if (*__first < *__result_first)
- __adjust_heap(__result_first, _Distance(0),
- _Distance(__result_real_last - __result_first),
- _Tp(*__first));
- ++__first;
- }
- sort_heap(__result_first, __result_real_last);
- return __result_real_last;
-}
-
-template <class _InputIter, class _RandomAccessIter>
-inline _RandomAccessIter
-partial_sort_copy(_InputIter __first, _InputIter __last,
- _RandomAccessIter __result_first,
- _RandomAccessIter __result_last) {
- return __partial_sort_copy(__first, __last, __result_first, __result_last,
- __DISTANCE_TYPE(__result_first),
- __VALUE_TYPE(__first));
-}
-
-template <class _InputIter, class _RandomAccessIter, class _Compare,
- class _Distance, class _Tp>
-_RandomAccessIter __partial_sort_copy(_InputIter __first,
- _InputIter __last,
- _RandomAccessIter __result_first,
- _RandomAccessIter __result_last,
- _Compare __comp, _Distance*, _Tp*) {
- if (__result_first == __result_last) return __result_last;
- _RandomAccessIter __result_real_last = __result_first;
- while(__first != __last && __result_real_last != __result_last) {
- *__result_real_last = *__first;
- ++__result_real_last;
- ++__first;
- }
- make_heap(__result_first, __result_real_last, __comp);
- while (__first != __last) {
- if (__comp(*__first, *__result_first))
- __adjust_heap(__result_first, _Distance(0),
- _Distance(__result_real_last - __result_first),
- _Tp(*__first),
- __comp);
- ++__first;
- }
- sort_heap(__result_first, __result_real_last, __comp);
- return __result_real_last;
-}
-
-template <class _InputIter, class _RandomAccessIter, class _Compare>
-inline _RandomAccessIter
-partial_sort_copy(_InputIter __first, _InputIter __last,
- _RandomAccessIter __result_first,
- _RandomAccessIter __result_last, _Compare __comp) {
- return __partial_sort_copy(__first, __last, __result_first, __result_last,
- __comp,
- __DISTANCE_TYPE(__result_first),
- __VALUE_TYPE(__first));
-}
-
-// nth_element() and its auxiliary functions.
-
-template <class _RandomAccessIter, class _Tp>
-void __nth_element(_RandomAccessIter __first, _RandomAccessIter __nth,
- _RandomAccessIter __last, _Tp*) {
- while (__last - __first > 3) {
- _RandomAccessIter __cut =
- __unguarded_partition(__first, __last,
- _Tp(__median(*__first,
- *(__first + (__last - __first)/2),
- *(__last - 1))));
- if (__cut <= __nth)
- __first = __cut;
- else
- __last = __cut;
- }
- __insertion_sort(__first, __last);
-}
-
-template <class _RandomAccessIter>
-inline void nth_element(_RandomAccessIter __first, _RandomAccessIter __nth,
- _RandomAccessIter __last) {
- __nth_element(__first, __nth, __last, __VALUE_TYPE(__first));
-}
-
-template <class _RandomAccessIter, class _Tp, class _Compare>
-void __nth_element(_RandomAccessIter __first, _RandomAccessIter __nth,
- _RandomAccessIter __last, _Tp*, _Compare __comp) {
- while (__last - __first > 3) {
- _RandomAccessIter __cut =
- __unguarded_partition(__first, __last,
- _Tp(__median(*__first,
- *(__first + (__last - __first)/2),
- *(__last - 1),
- __comp)),
- __comp);
- if (__cut <= __nth)
- __first = __cut;
- else
- __last = __cut;
- }
- __insertion_sort(__first, __last, __comp);
-}
-
-template <class _RandomAccessIter, class _Compare>
-inline void nth_element(_RandomAccessIter __first, _RandomAccessIter __nth,
- _RandomAccessIter __last, _Compare __comp) {
- __nth_element(__first, __nth, __last, __VALUE_TYPE(__first), __comp);
-}
-
-
-// Binary search (lower_bound, upper_bound, equal_range, binary_search).
-
-template <class _ForwardIter, class _Tp, class _Distance>
-_ForwardIter __lower_bound(_ForwardIter __first, _ForwardIter __last,
- const _Tp& __val, _Distance*)
-{
- _Distance __len = 0;
- distance(__first, __last, __len);
- _Distance __half;
- _ForwardIter __middle;
-
- while (__len > 0) {
- __half = __len >> 1;
- __middle = __first;
- advance(__middle, __half);
- if (*__middle < __val) {
- __first = __middle;
- ++__first;
- __len = __len - __half - 1;
- }
- else
- __len = __half;
- }
- return __first;
-}
-
-template <class _ForwardIter, class _Tp>
-inline _ForwardIter lower_bound(_ForwardIter __first, _ForwardIter __last,
- const _Tp& __val) {
- return __lower_bound(__first, __last, __val,
- __DISTANCE_TYPE(__first));
-}
-
-template <class _ForwardIter, class _Tp, class _Compare, class _Distance>
-_ForwardIter __lower_bound(_ForwardIter __first, _ForwardIter __last,
- const _Tp& __val, _Compare __comp, _Distance*)
-{
- _Distance __len = 0;
- distance(__first, __last, __len);
- _Distance __half;
- _ForwardIter __middle;
-
- while (__len > 0) {
- __half = __len >> 1;
- __middle = __first;
- advance(__middle, __half);
- if (__comp(*__middle, __val)) {
- __first = __middle;
- ++__first;
- __len = __len - __half - 1;
- }
- else
- __len = __half;
- }
- return __first;
-}
-
-template <class _ForwardIter, class _Tp, class _Compare>
-inline _ForwardIter lower_bound(_ForwardIter __first, _ForwardIter __last,
- const _Tp& __val, _Compare __comp) {
- return __lower_bound(__first, __last, __val, __comp,
- __DISTANCE_TYPE(__first));
-}
-
-template <class _ForwardIter, class _Tp, class _Distance>
-_ForwardIter __upper_bound(_ForwardIter __first, _ForwardIter __last,
- const _Tp& __val, _Distance*)
-{
- _Distance __len = 0;
- distance(__first, __last, __len);
- _Distance __half;
- _ForwardIter __middle;
-
- while (__len > 0) {
- __half = __len >> 1;
- __middle = __first;
- advance(__middle, __half);
- if (__val < *__middle)
- __len = __half;
- else {
- __first = __middle;
- ++__first;
- __len = __len - __half - 1;
- }
- }
- return __first;
-}
-
-template <class _ForwardIter, class _Tp>
-inline _ForwardIter upper_bound(_ForwardIter __first, _ForwardIter __last,
- const _Tp& __val) {
- return __upper_bound(__first, __last, __val,
- __DISTANCE_TYPE(__first));
-}
-
-template <class _ForwardIter, class _Tp, class _Compare, class _Distance>
-_ForwardIter __upper_bound(_ForwardIter __first, _ForwardIter __last,
- const _Tp& __val, _Compare __comp, _Distance*)
-{
- _Distance __len = 0;
- distance(__first, __last, __len);
- _Distance __half;
- _ForwardIter __middle;
-
- while (__len > 0) {
- __half = __len >> 1;
- __middle = __first;
- advance(__middle, __half);
- if (__comp(__val, *__middle))
- __len = __half;
- else {
- __first = __middle;
- ++__first;
- __len = __len - __half - 1;
- }
- }
- return __first;
-}
-
-template <class _ForwardIter, class _Tp, class _Compare>
-inline _ForwardIter upper_bound(_ForwardIter __first, _ForwardIter __last,
- const _Tp& __val, _Compare __comp) {
- return __upper_bound(__first, __last, __val, __comp,
- __DISTANCE_TYPE(__first));
-}
-
-template <class _ForwardIter, class _Tp, class _Distance>
-pair<_ForwardIter, _ForwardIter>
-__equal_range(_ForwardIter __first, _ForwardIter __last, const _Tp& __val,
- _Distance*)
-{
- _Distance __len = 0;
- distance(__first, __last, __len);
- _Distance __half;
- _ForwardIter __middle, __left, __right;
-
- while (__len > 0) {
- __half = __len >> 1;
- __middle = __first;
- advance(__middle, __half);
- if (*__middle < __val) {
- __first = __middle;
- ++__first;
- __len = __len - __half - 1;
- }
- else if (__val < *__middle)
- __len = __half;
- else {
- __left = lower_bound(__first, __middle, __val);
- advance(__first, __len);
- __right = upper_bound(++__middle, __first, __val);
- return pair<_ForwardIter, _ForwardIter>(__left, __right);
- }
- }
- return pair<_ForwardIter, _ForwardIter>(__first, __first);
-}
-
-template <class _ForwardIter, class _Tp>
-inline pair<_ForwardIter, _ForwardIter>
-equal_range(_ForwardIter __first, _ForwardIter __last, const _Tp& __val) {
- return __equal_range(__first, __last, __val,
- __DISTANCE_TYPE(__first));
-}
-
-template <class _ForwardIter, class _Tp, class _Compare, class _Distance>
-pair<_ForwardIter, _ForwardIter>
-__equal_range(_ForwardIter __first, _ForwardIter __last, const _Tp& __val,
- _Compare __comp, _Distance*)
-{
- _Distance __len = 0;
- distance(__first, __last, __len);
- _Distance __half;
- _ForwardIter __middle, __left, __right;
-
- while (__len > 0) {
- __half = __len >> 1;
- __middle = __first;
- advance(__middle, __half);
- if (__comp(*__middle, __val)) {
- __first = __middle;
- ++__first;
- __len = __len - __half - 1;
- }
- else if (__comp(__val, *__middle))
- __len = __half;
- else {
- __left = lower_bound(__first, __middle, __val, __comp);
- advance(__first, __len);
- __right = upper_bound(++__middle, __first, __val, __comp);
- return pair<_ForwardIter, _ForwardIter>(__left, __right);
- }
- }
- return pair<_ForwardIter, _ForwardIter>(__first, __first);
-}
-
-template <class _ForwardIter, class _Tp, class _Compare>
-inline pair<_ForwardIter, _ForwardIter>
-equal_range(_ForwardIter __first, _ForwardIter __last, const _Tp& __val,
- _Compare __comp) {
- return __equal_range(__first, __last, __val, __comp,
- __DISTANCE_TYPE(__first));
-}
-
-template <class _ForwardIter, class _Tp>
-bool binary_search(_ForwardIter __first, _ForwardIter __last,
- const _Tp& __val) {
- _ForwardIter __i = lower_bound(__first, __last, __val);
- return __i != __last && !(__val < *__i);
-}
-
-template <class _ForwardIter, class _Tp, class _Compare>
-bool binary_search(_ForwardIter __first, _ForwardIter __last,
- const _Tp& __val,
- _Compare __comp) {
- _ForwardIter __i = lower_bound(__first, __last, __val, __comp);
- return __i != __last && !__comp(__val, *__i);
-}
-
-// merge, with and without an explicitly supplied comparison function.
-
-template <class _InputIter1, class _InputIter2, class _OutputIter>
-_OutputIter merge(_InputIter1 __first1, _InputIter1 __last1,
- _InputIter2 __first2, _InputIter2 __last2,
- _OutputIter __result) {
- while (__first1 != __last1 && __first2 != __last2) {
- if (*__first2 < *__first1) {
- *__result = *__first2;
- ++__first2;
- }
- else {
- *__result = *__first1;
- ++__first1;
- }
- ++__result;
- }
- return copy(__first2, __last2, copy(__first1, __last1, __result));
-}
-
-template <class _InputIter1, class _InputIter2, class _OutputIter,
- class _Compare>
-_OutputIter merge(_InputIter1 __first1, _InputIter1 __last1,
- _InputIter2 __first2, _InputIter2 __last2,
- _OutputIter __result, _Compare __comp) {
- while (__first1 != __last1 && __first2 != __last2) {
- if (__comp(*__first2, *__first1)) {
- *__result = *__first2;
- ++__first2;
- }
- else {
- *__result = *__first1;
- ++__first1;
- }
- ++__result;
- }
- return copy(__first2, __last2, copy(__first1, __last1, __result));
-}
-
-// inplace_merge and its auxiliary functions.
-
-template <class _BidirectionalIter, class _Distance>
-void __merge_without_buffer(_BidirectionalIter __first,
- _BidirectionalIter __middle,
- _BidirectionalIter __last,
- _Distance __len1, _Distance __len2) {
- if (__len1 == 0 || __len2 == 0)
- return;
- if (__len1 + __len2 == 2) {
- if (*__middle < *__first)
- iter_swap(__first, __middle);
- return;
- }
- _BidirectionalIter __first_cut = __first;
- _BidirectionalIter __second_cut = __middle;
- _Distance __len11 = 0;
- _Distance __len22 = 0;
- if (__len1 > __len2) {
- __len11 = __len1 / 2;
- advance(__first_cut, __len11);
- __second_cut = lower_bound(__middle, __last, *__first_cut);
- distance(__middle, __second_cut, __len22);
- }
- else {
- __len22 = __len2 / 2;
- advance(__second_cut, __len22);
- __first_cut = upper_bound(__first, __middle, *__second_cut);
- distance(__first, __first_cut, __len11);
- }
- _BidirectionalIter __new_middle
- = rotate(__first_cut, __middle, __second_cut);
- __merge_without_buffer(__first, __first_cut, __new_middle,
- __len11, __len22);
- __merge_without_buffer(__new_middle, __second_cut, __last, __len1 - __len11,
- __len2 - __len22);
-}
-
-template <class _BidirectionalIter, class _Distance, class _Compare>
-void __merge_without_buffer(_BidirectionalIter __first,
- _BidirectionalIter __middle,
- _BidirectionalIter __last,
- _Distance __len1, _Distance __len2,
- _Compare __comp) {
- if (__len1 == 0 || __len2 == 0)
- return;
- if (__len1 + __len2 == 2) {
- if (__comp(*__middle, *__first))
- iter_swap(__first, __middle);
- return;
- }
- _BidirectionalIter __first_cut = __first;
- _BidirectionalIter __second_cut = __middle;
- _Distance __len11 = 0;
- _Distance __len22 = 0;
- if (__len1 > __len2) {
- __len11 = __len1 / 2;
- advance(__first_cut, __len11);
- __second_cut = lower_bound(__middle, __last, *__first_cut, __comp);
- distance(__middle, __second_cut, __len22);
- }
- else {
- __len22 = __len2 / 2;
- advance(__second_cut, __len22);
- __first_cut = upper_bound(__first, __middle, *__second_cut, __comp);
- distance(__first, __first_cut, __len11);
- }
- _BidirectionalIter __new_middle
- = rotate(__first_cut, __middle, __second_cut);
- __merge_without_buffer(__first, __first_cut, __new_middle, __len11, __len22,
- __comp);
- __merge_without_buffer(__new_middle, __second_cut, __last, __len1 - __len11,
- __len2 - __len22, __comp);
-}
-
-template <class _BidirectionalIter1, class _BidirectionalIter2,
- class _Distance>
-_BidirectionalIter1 __rotate_adaptive(_BidirectionalIter1 __first,
- _BidirectionalIter1 __middle,
- _BidirectionalIter1 __last,
- _Distance __len1, _Distance __len2,
- _BidirectionalIter2 __buffer,
- _Distance __buffer_size) {
- _BidirectionalIter2 __buffer_end;
- if (__len1 > __len2 && __len2 <= __buffer_size) {
- __buffer_end = copy(__middle, __last, __buffer);
- copy_backward(__first, __middle, __last);
- return copy(__buffer, __buffer_end, __first);
- }
- else if (__len1 <= __buffer_size) {
- __buffer_end = copy(__first, __middle, __buffer);
- copy(__middle, __last, __first);
- return copy_backward(__buffer, __buffer_end, __last);
- }
- else
- return rotate(__first, __middle, __last);
-}
-
-template <class _BidirectionalIter1, class _BidirectionalIter2,
- class _BidirectionalIter3>
-_BidirectionalIter3 __merge_backward(_BidirectionalIter1 __first1,
- _BidirectionalIter1 __last1,
- _BidirectionalIter2 __first2,
- _BidirectionalIter2 __last2,
- _BidirectionalIter3 __result) {
- if (__first1 == __last1)
- return copy_backward(__first2, __last2, __result);
- if (__first2 == __last2)
- return copy_backward(__first1, __last1, __result);
- --__last1;
- --__last2;
- while (true) {
- if (*__last2 < *__last1) {
- *--__result = *__last1;
- if (__first1 == __last1)
- return copy_backward(__first2, ++__last2, __result);
- --__last1;
- }
- else {
- *--__result = *__last2;
- if (__first2 == __last2)
- return copy_backward(__first1, ++__last1, __result);
- --__last2;
- }
- }
-}
-
-template <class _BidirectionalIter1, class _BidirectionalIter2,
- class _BidirectionalIter3, class _Compare>
-_BidirectionalIter3 __merge_backward(_BidirectionalIter1 __first1,
- _BidirectionalIter1 __last1,
- _BidirectionalIter2 __first2,
- _BidirectionalIter2 __last2,
- _BidirectionalIter3 __result,
- _Compare __comp) {
- if (__first1 == __last1)
- return copy_backward(__first2, __last2, __result);
- if (__first2 == __last2)
- return copy_backward(__first1, __last1, __result);
- --__last1;
- --__last2;
- while (true) {
- if (__comp(*__last2, *__last1)) {
- *--__result = *__last1;
- if (__first1 == __last1)
- return copy_backward(__first2, ++__last2, __result);
- --__last1;
- }
- else {
- *--__result = *__last2;
- if (__first2 == __last2)
- return copy_backward(__first1, ++__last1, __result);
- --__last2;
- }
- }
-}
-
-template <class _BidirectionalIter, class _Distance, class _Pointer>
-void __merge_adaptive(_BidirectionalIter __first,
- _BidirectionalIter __middle,
- _BidirectionalIter __last,
- _Distance __len1, _Distance __len2,
- _Pointer __buffer, _Distance __buffer_size) {
- if (__len1 <= __len2 && __len1 <= __buffer_size) {
- _Pointer __buffer_end = copy(__first, __middle, __buffer);
- merge(__buffer, __buffer_end, __middle, __last, __first);
- }
- else if (__len2 <= __buffer_size) {
- _Pointer __buffer_end = copy(__middle, __last, __buffer);
- __merge_backward(__first, __middle, __buffer, __buffer_end, __last);
- }
- else {
- _BidirectionalIter __first_cut = __first;
- _BidirectionalIter __second_cut = __middle;
- _Distance __len11 = 0;
- _Distance __len22 = 0;
- if (__len1 > __len2) {
- __len11 = __len1 / 2;
- advance(__first_cut, __len11);
- __second_cut = lower_bound(__middle, __last, *__first_cut);
- distance(__middle, __second_cut, __len22);
- }
- else {
- __len22 = __len2 / 2;
- advance(__second_cut, __len22);
- __first_cut = upper_bound(__first, __middle, *__second_cut);
- distance(__first, __first_cut, __len11);
- }
- _BidirectionalIter __new_middle =
- __rotate_adaptive(__first_cut, __middle, __second_cut, __len1 - __len11,
- __len22, __buffer, __buffer_size);
- __merge_adaptive(__first, __first_cut, __new_middle, __len11,
- __len22, __buffer, __buffer_size);
- __merge_adaptive(__new_middle, __second_cut, __last, __len1 - __len11,
- __len2 - __len22, __buffer, __buffer_size);
- }
-}
-
-template <class _BidirectionalIter, class _Distance, class _Pointer,
- class _Compare>
-void __merge_adaptive(_BidirectionalIter __first,
- _BidirectionalIter __middle,
- _BidirectionalIter __last,
- _Distance __len1, _Distance __len2,
- _Pointer __buffer, _Distance __buffer_size,
- _Compare __comp) {
- if (__len1 <= __len2 && __len1 <= __buffer_size) {
- _Pointer __buffer_end = copy(__first, __middle, __buffer);
- merge(__buffer, __buffer_end, __middle, __last, __first, __comp);
- }
- else if (__len2 <= __buffer_size) {
- _Pointer __buffer_end = copy(__middle, __last, __buffer);
- __merge_backward(__first, __middle, __buffer, __buffer_end, __last,
- __comp);
- }
- else {
- _BidirectionalIter __first_cut = __first;
- _BidirectionalIter __second_cut = __middle;
- _Distance __len11 = 0;
- _Distance __len22 = 0;
- if (__len1 > __len2) {
- __len11 = __len1 / 2;
- advance(__first_cut, __len11);
- __second_cut = lower_bound(__middle, __last, *__first_cut, __comp);
- distance(__middle, __second_cut, __len22);
- }
- else {
- __len22 = __len2 / 2;
- advance(__second_cut, __len22);
- __first_cut = upper_bound(__first, __middle, *__second_cut, __comp);
- distance(__first, __first_cut, __len11);
- }
- _BidirectionalIter __new_middle =
- __rotate_adaptive(__first_cut, __middle, __second_cut, __len1 - __len11,
- __len22, __buffer, __buffer_size);
- __merge_adaptive(__first, __first_cut, __new_middle, __len11,
- __len22, __buffer, __buffer_size, __comp);
- __merge_adaptive(__new_middle, __second_cut, __last, __len1 - __len11,
- __len2 - __len22, __buffer, __buffer_size, __comp);
- }
-}
-
-template <class _BidirectionalIter, class _Tp, class _Distance>
-inline void __inplace_merge_aux(_BidirectionalIter __first,
- _BidirectionalIter __middle,
- _BidirectionalIter __last, _Tp*, _Distance*) {
- _Distance __len1 = 0;
- distance(__first, __middle, __len1);
- _Distance __len2 = 0;
- distance(__middle, __last, __len2);
-
- _Temporary_buffer<_BidirectionalIter, _Tp> __buf(__first, __last);
- if (__buf.begin() == 0)
- __merge_without_buffer(__first, __middle, __last, __len1, __len2);
- else
- __merge_adaptive(__first, __middle, __last, __len1, __len2,
- __buf.begin(), _Distance(__buf.size()));
-}
-
-template <class _BidirectionalIter, class _Tp,
- class _Distance, class _Compare>
-inline void __inplace_merge_aux(_BidirectionalIter __first,
- _BidirectionalIter __middle,
- _BidirectionalIter __last, _Tp*, _Distance*,
- _Compare __comp) {
- _Distance __len1 = 0;
- distance(__first, __middle, __len1);
- _Distance __len2 = 0;
- distance(__middle, __last, __len2);
-
- _Temporary_buffer<_BidirectionalIter, _Tp> __buf(__first, __last);
- if (__buf.begin() == 0)
- __merge_without_buffer(__first, __middle, __last, __len1, __len2, __comp);
- else
- __merge_adaptive(__first, __middle, __last, __len1, __len2,
- __buf.begin(), _Distance(__buf.size()),
- __comp);
-}
-
-template <class _BidirectionalIter>
-inline void inplace_merge(_BidirectionalIter __first,
- _BidirectionalIter __middle,
- _BidirectionalIter __last) {
- if (__first == __middle || __middle == __last)
- return;
- __inplace_merge_aux(__first, __middle, __last,
- __VALUE_TYPE(__first), __DISTANCE_TYPE(__first));
-}
-
-template <class _BidirectionalIter, class _Compare>
-inline void inplace_merge(_BidirectionalIter __first,
- _BidirectionalIter __middle,
- _BidirectionalIter __last, _Compare __comp) {
- if (__first == __middle || __middle == __last)
- return;
- __inplace_merge_aux(__first, __middle, __last,
- __VALUE_TYPE(__first), __DISTANCE_TYPE(__first),
- __comp);
-}
-
-// Set algorithms: includes, set_union, set_intersection, set_difference,
-// set_symmetric_difference. All of these algorithms have the precondition
-// that their input ranges are sorted and the postcondition that their output
-// ranges are sorted.
-
-template <class _InputIter1, class _InputIter2>
-bool includes(_InputIter1 __first1, _InputIter1 __last1,
- _InputIter2 __first2, _InputIter2 __last2) {
- while (__first1 != __last1 && __first2 != __last2)
- if (*__first2 < *__first1)
- return false;
- else if(*__first1 < *__first2)
- ++__first1;
- else
- ++__first1, ++__first2;
-
- return __first2 == __last2;
-}
-
-template <class _InputIter1, class _InputIter2, class _Compare>
-bool includes(_InputIter1 __first1, _InputIter1 __last1,
- _InputIter2 __first2, _InputIter2 __last2, _Compare __comp) {
- while (__first1 != __last1 && __first2 != __last2)
- if (__comp(*__first2, *__first1))
- return false;
- else if(__comp(*__first1, *__first2))
- ++__first1;
- else
- ++__first1, ++__first2;
-
- return __first2 == __last2;
-}
-
-template <class _InputIter1, class _InputIter2, class _OutputIter>
-_OutputIter set_union(_InputIter1 __first1, _InputIter1 __last1,
- _InputIter2 __first2, _InputIter2 __last2,
- _OutputIter __result) {
- while (__first1 != __last1 && __first2 != __last2) {
- if (*__first1 < *__first2) {
- *__result = *__first1;
- ++__first1;
- }
- else if (*__first2 < *__first1) {
- *__result = *__first2;
- ++__first2;
- }
- else {
- *__result = *__first1;
- ++__first1;
- ++__first2;
- }
- ++__result;
- }
- return copy(__first2, __last2, copy(__first1, __last1, __result));
-}
-
-template <class _InputIter1, class _InputIter2, class _OutputIter,
- class _Compare>
-_OutputIter set_union(_InputIter1 __first1, _InputIter1 __last1,
- _InputIter2 __first2, _InputIter2 __last2,
- _OutputIter __result, _Compare __comp) {
- while (__first1 != __last1 && __first2 != __last2) {
- if (__comp(*__first1, *__first2)) {
- *__result = *__first1;
- ++__first1;
- }
- else if (__comp(*__first2, *__first1)) {
- *__result = *__first2;
- ++__first2;
- }
- else {
- *__result = *__first1;
- ++__first1;
- ++__first2;
- }
- ++__result;
- }
- return copy(__first2, __last2, copy(__first1, __last1, __result));
-}
-
-template <class _InputIter1, class _InputIter2, class _OutputIter>
-_OutputIter set_intersection(_InputIter1 __first1, _InputIter1 __last1,
- _InputIter2 __first2, _InputIter2 __last2,
- _OutputIter __result) {
- while (__first1 != __last1 && __first2 != __last2)
- if (*__first1 < *__first2)
- ++__first1;
- else if (*__first2 < *__first1)
- ++__first2;
- else {
- *__result = *__first1;
- ++__first1;
- ++__first2;
- ++__result;
- }
- return __result;
-}
-
-template <class _InputIter1, class _InputIter2, class _OutputIter,
- class _Compare>
-_OutputIter set_intersection(_InputIter1 __first1, _InputIter1 __last1,
- _InputIter2 __first2, _InputIter2 __last2,
- _OutputIter __result, _Compare __comp) {
- while (__first1 != __last1 && __first2 != __last2)
- if (__comp(*__first1, *__first2))
- ++__first1;
- else if (__comp(*__first2, *__first1))
- ++__first2;
- else {
- *__result = *__first1;
- ++__first1;
- ++__first2;
- ++__result;
- }
- return __result;
-}
-
-template <class _InputIter1, class _InputIter2, class _OutputIter>
-_OutputIter set_difference(_InputIter1 __first1, _InputIter1 __last1,
- _InputIter2 __first2, _InputIter2 __last2,
- _OutputIter __result) {
- while (__first1 != __last1 && __first2 != __last2)
- if (*__first1 < *__first2) {
- *__result = *__first1;
- ++__first1;
- ++__result;
- }
- else if (*__first2 < *__first1)
- ++__first2;
- else {
- ++__first1;
- ++__first2;
- }
- return copy(__first1, __last1, __result);
-}
-
-template <class _InputIter1, class _InputIter2, class _OutputIter,
- class _Compare>
-_OutputIter set_difference(_InputIter1 __first1, _InputIter1 __last1,
- _InputIter2 __first2, _InputIter2 __last2,
- _OutputIter __result, _Compare __comp) {
- while (__first1 != __last1 && __first2 != __last2)
- if (__comp(*__first1, *__first2)) {
- *__result = *__first1;
- ++__first1;
- ++__result;
- }
- else if (__comp(*__first2, *__first1))
- ++__first2;
- else {
- ++__first1;
- ++__first2;
- }
- return copy(__first1, __last1, __result);
-}
-
-template <class _InputIter1, class _InputIter2, class _OutputIter>
-_OutputIter
-set_symmetric_difference(_InputIter1 __first1, _InputIter1 __last1,
- _InputIter2 __first2, _InputIter2 __last2,
- _OutputIter __result) {
- while (__first1 != __last1 && __first2 != __last2)
- if (*__first1 < *__first2) {
- *__result = *__first1;
- ++__first1;
- ++__result;
- }
- else if (*__first2 < *__first1) {
- *__result = *__first2;
- ++__first2;
- ++__result;
- }
- else {
- ++__first1;
- ++__first2;
- }
- return copy(__first2, __last2, copy(__first1, __last1, __result));
-}
-
-template <class _InputIter1, class _InputIter2, class _OutputIter,
- class _Compare>
-_OutputIter
-set_symmetric_difference(_InputIter1 __first1, _InputIter1 __last1,
- _InputIter2 __first2, _InputIter2 __last2,
- _OutputIter __result,
- _Compare __comp) {
- while (__first1 != __last1 && __first2 != __last2)
- if (__comp(*__first1, *__first2)) {
- *__result = *__first1;
- ++__first1;
- ++__result;
- }
- else if (__comp(*__first2, *__first1)) {
- *__result = *__first2;
- ++__first2;
- ++__result;
- }
- else {
- ++__first1;
- ++__first2;
- }
- return copy(__first2, __last2, copy(__first1, __last1, __result));
-}
-
-// min_element and max_element, with and without an explicitly supplied
-// comparison function.
-
-template <class _ForwardIter>
-_ForwardIter max_element(_ForwardIter __first, _ForwardIter __last) {
- if (__first == __last) return __first;
- _ForwardIter __result = __first;
- while (++__first != __last)
- if (*__result < *__first)
- __result = __first;
- return __result;
-}
-
-template <class _ForwardIter, class _Compare>
-_ForwardIter max_element(_ForwardIter __first, _ForwardIter __last,
- _Compare __comp) {
- if (__first == __last) return __first;
- _ForwardIter __result = __first;
- while (++__first != __last)
- if (__comp(*__result, *__first)) __result = __first;
- return __result;
-}
-
-template <class _ForwardIter>
-_ForwardIter min_element(_ForwardIter __first, _ForwardIter __last) {
- if (__first == __last) return __first;
- _ForwardIter __result = __first;
- while (++__first != __last)
- if (*__first < *__result)
- __result = __first;
- return __result;
-}
-
-template <class _ForwardIter, class _Compare>
-_ForwardIter min_element(_ForwardIter __first, _ForwardIter __last,
- _Compare __comp) {
- if (__first == __last) return __first;
- _ForwardIter __result = __first;
- while (++__first != __last)
- if (__comp(*__first, *__result))
- __result = __first;
- return __result;
-}
-
-// next_permutation and prev_permutation, with and without an explicitly
-// supplied comparison function.
-
-template <class _BidirectionalIter>
-bool next_permutation(_BidirectionalIter __first, _BidirectionalIter __last) {
- if (__first == __last)
- return false;
- _BidirectionalIter __i = __first;
- ++__i;
- if (__i == __last)
- return false;
- __i = __last;
- --__i;
-
- for(;;) {
- _BidirectionalIter __ii = __i;
- --__i;
- if (*__i < *__ii) {
- _BidirectionalIter __j = __last;
- while (!(*__i < *--__j))
- {}
- iter_swap(__i, __j);
- reverse(__ii, __last);
- return true;
- }
- if (__i == __first) {
- reverse(__first, __last);
- return false;
- }
- }
-}
-
-template <class _BidirectionalIter, class _Compare>
-bool next_permutation(_BidirectionalIter __first, _BidirectionalIter __last,
- _Compare __comp) {
- if (__first == __last)
- return false;
- _BidirectionalIter __i = __first;
- ++__i;
- if (__i == __last)
- return false;
- __i = __last;
- --__i;
-
- for(;;) {
- _BidirectionalIter __ii = __i;
- --__i;
- if (__comp(*__i, *__ii)) {
- _BidirectionalIter __j = __last;
- while (!__comp(*__i, *--__j))
- {}
- iter_swap(__i, __j);
- reverse(__ii, __last);
- return true;
- }
- if (__i == __first) {
- reverse(__first, __last);
- return false;
- }
- }
-}
-
-template <class _BidirectionalIter>
-bool prev_permutation(_BidirectionalIter __first, _BidirectionalIter __last) {
- if (__first == __last)
- return false;
- _BidirectionalIter __i = __first;
- ++__i;
- if (__i == __last)
- return false;
- __i = __last;
- --__i;
-
- for(;;) {
- _BidirectionalIter __ii = __i;
- --__i;
- if (*__ii < *__i) {
- _BidirectionalIter __j = __last;
- while (!(*--__j < *__i))
- {}
- iter_swap(__i, __j);
- reverse(__ii, __last);
- return true;
- }
- if (__i == __first) {
- reverse(__first, __last);
- return false;
- }
- }
-}
-
-template <class _BidirectionalIter, class _Compare>
-bool prev_permutation(_BidirectionalIter __first, _BidirectionalIter __last,
- _Compare __comp) {
- if (__first == __last)
- return false;
- _BidirectionalIter __i = __first;
- ++__i;
- if (__i == __last)
- return false;
- __i = __last;
- --__i;
-
- for(;;) {
- _BidirectionalIter __ii = __i;
- --__i;
- if (__comp(*__ii, *__i)) {
- _BidirectionalIter __j = __last;
- while (!__comp(*--__j, *__i))
- {}
- iter_swap(__i, __j);
- reverse(__ii, __last);
- return true;
- }
- if (__i == __first) {
- reverse(__first, __last);
- return false;
- }
- }
-}
-
-// find_first_of, with and without an explicitly supplied comparison function.
-
-template <class _InputIter, class _ForwardIter>
-_InputIter find_first_of(_InputIter __first1, _InputIter __last1,
- _ForwardIter __first2, _ForwardIter __last2)
-{
- for ( ; __first1 != __last1; ++__first1)
- for (_ForwardIter __iter = __first2; __iter != __last2; ++__iter)
- if (*__first1 == *__iter)
- return __first1;
- return __last1;
-}
-
-template <class _InputIter, class _ForwardIter, class _BinaryPredicate>
-_InputIter find_first_of(_InputIter __first1, _InputIter __last1,
- _ForwardIter __first2, _ForwardIter __last2,
- _BinaryPredicate __comp)
-{
- for ( ; __first1 != __last1; ++__first1)
- for (_ForwardIter __iter = __first2; __iter != __last2; ++__iter)
- if (__comp(*__first1, *__iter))
- return __first1;
- return __last1;
-}
-
-
-// find_end, with and without an explicitly supplied comparison function.
-// Search [first2, last2) as a subsequence in [first1, last1), and return
-// the *last* possible match. Note that find_end for bidirectional iterators
-// is much faster than for forward iterators.
-
-// find_end for forward iterators.
-template <class _ForwardIter1, class _ForwardIter2>
-_ForwardIter1 __find_end(_ForwardIter1 __first1, _ForwardIter1 __last1,
- _ForwardIter2 __first2, _ForwardIter2 __last2,
- forward_iterator_tag, forward_iterator_tag)
-{
- if (__first2 == __last2)
- return __last1;
- else {
- _ForwardIter1 __result = __last1;
- while (1) {
- _ForwardIter1 __new_result
- = search(__first1, __last1, __first2, __last2);
- if (__new_result == __last1)
- return __result;
- else {
- __result = __new_result;
- __first1 = __new_result;
- ++__first1;
- }
- }
- }
-}
-
-template <class _ForwardIter1, class _ForwardIter2,
- class _BinaryPredicate>
-_ForwardIter1 __find_end(_ForwardIter1 __first1, _ForwardIter1 __last1,
- _ForwardIter2 __first2, _ForwardIter2 __last2,
- forward_iterator_tag, forward_iterator_tag,
- _BinaryPredicate __comp)
-{
- if (__first2 == __last2)
- return __last1;
- else {
- _ForwardIter1 __result = __last1;
- while (1) {
- _ForwardIter1 __new_result
- = search(__first1, __last1, __first2, __last2, __comp);
- if (__new_result == __last1)
- return __result;
- else {
- __result = __new_result;
- __first1 = __new_result;
- ++__first1;
- }
- }
- }
-}
-
-// find_end for bidirectional iterators. Requires partial specialization.
-#ifdef __STL_CLASS_PARTIAL_SPECIALIZATION
-
-template <class _BidirectionalIter1, class _BidirectionalIter2>
-_BidirectionalIter1
-__find_end(_BidirectionalIter1 __first1, _BidirectionalIter1 __last1,
- _BidirectionalIter2 __first2, _BidirectionalIter2 __last2,
- bidirectional_iterator_tag, bidirectional_iterator_tag)
-{
- typedef reverse_iterator<_BidirectionalIter1> _RevIter1;
- typedef reverse_iterator<_BidirectionalIter2> _RevIter2;
-
- _RevIter1 __rlast1(__first1);
- _RevIter2 __rlast2(__first2);
- _RevIter1 __rresult = search(_RevIter1(__last1), __rlast1,
- _RevIter2(__last2), __rlast2);
-
- if (__rresult == __rlast1)
- return __last1;
- else {
- _BidirectionalIter1 __result = __rresult.base();
- advance(__result, -distance(__first2, __last2));
- return __result;
- }
-}
-
-template <class _BidirectionalIter1, class _BidirectionalIter2,
- class _BinaryPredicate>
-_BidirectionalIter1
-__find_end(_BidirectionalIter1 __first1, _BidirectionalIter1 __last1,
- _BidirectionalIter2 __first2, _BidirectionalIter2 __last2,
- bidirectional_iterator_tag, bidirectional_iterator_tag,
- _BinaryPredicate __comp)
-{
- typedef reverse_iterator<_BidirectionalIter1> _RevIter1;
- typedef reverse_iterator<_BidirectionalIter2> _RevIter2;
-
- _RevIter1 __rlast1(__first1);
- _RevIter2 __rlast2(__first2);
- _RevIter1 __rresult = search(_RevIter1(__last1), __rlast1,
- _RevIter2(__last2), __rlast2,
- __comp);
-
- if (__rresult == __rlast1)
- return __last1;
- else {
- _BidirectionalIter1 __result = __rresult.base();
- advance(__result, -distance(__first2, __last2));
- return __result;
- }
-}
-#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
-
-// Dispatching functions for find_end.
-
-template <class _ForwardIter1, class _ForwardIter2>
-inline _ForwardIter1
-find_end(_ForwardIter1 __first1, _ForwardIter1 __last1,
- _ForwardIter2 __first2, _ForwardIter2 __last2)
-{
- return __find_end(__first1, __last1, __first2, __last2,
- __ITERATOR_CATEGORY(__first1),
- __ITERATOR_CATEGORY(__first2));
-}
-
-template <class _ForwardIter1, class _ForwardIter2,
- class _BinaryPredicate>
-inline _ForwardIter1
-find_end(_ForwardIter1 __first1, _ForwardIter1 __last1,
- _ForwardIter2 __first2, _ForwardIter2 __last2,
- _BinaryPredicate __comp)
-{
- return __find_end(__first1, __last1, __first2, __last2,
- __ITERATOR_CATEGORY(__first1),
- __ITERATOR_CATEGORY(__first2),
- __comp);
-}
-
-// is_heap, a predicate testing whether or not a range is
-// a heap. This function is an extension, not part of the C++
-// standard.
-
-template <class _RandomAccessIter, class _Distance>
-bool __is_heap(_RandomAccessIter __first, _Distance __n)
-{
- _Distance __parent = 0;
- for (_Distance __child = 1; __child < __n; ++__child) {
- if (__first[__parent] < __first[__child])
- return false;
- if ((__child & 1) == 0)
- ++__parent;
- }
- return true;
-}
-
-template <class _RandomAccessIter, class _Distance, class _StrictWeakOrdering>
-bool __is_heap(_RandomAccessIter __first, _StrictWeakOrdering __comp,
- _Distance __n)
-{
- _Distance __parent = 0;
- for (_Distance __child = 1; __child < __n; ++__child) {
- if (__comp(__first[__parent], __first[__child]))
- return false;
- if ((__child & 1) == 0)
- ++__parent;
- }
- return true;
-}
-
-template <class _RandomAccessIter>
-inline bool is_heap(_RandomAccessIter __first, _RandomAccessIter __last)
-{
- return __is_heap(__first, __last - __first);
-}
-
-
-template <class _RandomAccessIter, class _StrictWeakOrdering>
-inline bool is_heap(_RandomAccessIter __first, _RandomAccessIter __last,
- _StrictWeakOrdering __comp)
-{
- return __is_heap(__first, __comp, __last - __first);
-}
-
-// is_sorted, a predicated testing whether a range is sorted in
-// nondescending order. This is an extension, not part of the C++
-// standard.
-
-template <class _ForwardIter>
-bool is_sorted(_ForwardIter __first, _ForwardIter __last)
-{
- if (__first == __last)
- return true;
-
- _ForwardIter __next = __first;
- for (++__next; __next != __last; __first = __next, ++__next) {
- if (*__next < *__first)
- return false;
- }
-
- return true;
-}
-
-template <class _ForwardIter, class _StrictWeakOrdering>
-bool is_sorted(_ForwardIter __first, _ForwardIter __last,
- _StrictWeakOrdering __comp)
-{
- if (__first == __last)
- return true;
-
- _ForwardIter __next = __first;
- for (++__next; __next != __last; __first = __next, ++__next) {
- if (__comp(*__next, *__first))
- return false;
- }
-
- return true;
-}
-
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma reset woff 1209
-#endif
-
-__STL_END_NAMESPACE
-
-#endif /* __SGI_STL_INTERNAL_ALGO_H */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/contrib/libstdc++/stl/stl_algobase.h b/contrib/libstdc++/stl/stl_algobase.h
deleted file mode 100644
index 15e535f483d2..000000000000
--- a/contrib/libstdc++/stl/stl_algobase.h
+++ /dev/null
@@ -1,526 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- *
- * Copyright (c) 1996-1998
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- */
-
-/* NOTE: This is an internal header file, included by other STL headers.
- * You should not attempt to use it directly.
- */
-
-
-#ifndef __SGI_STL_INTERNAL_ALGOBASE_H
-#define __SGI_STL_INTERNAL_ALGOBASE_H
-
-#ifndef __STL_CONFIG_H
-#include <stl_config.h>
-#endif
-#ifndef __SGI_STL_INTERNAL_RELOPS
-#include <stl_relops.h>
-#endif
-#ifndef __SGI_STL_INTERNAL_PAIR_H
-#include <stl_pair.h>
-#endif
-#ifndef __TYPE_TRAITS_H_
-#include <type_traits.h>
-#endif
-
-#include <string.h>
-#include <limits.h>
-#include <stdlib.h>
-#include <stddef.h>
-#include <new.h>
-#include <iostream.h>
-
-#ifndef __SGI_STL_INTERNAL_ITERATOR_H
-#include <stl_iterator.h>
-#endif
-
-__STL_BEGIN_NAMESPACE
-
-// swap and iter_swap
-
-template <class _ForwardIter1, class _ForwardIter2, class _Tp>
-inline void __iter_swap(_ForwardIter1 __a, _ForwardIter2 __b, _Tp*) {
- _Tp __tmp = *__a;
- *__a = *__b;
- *__b = __tmp;
-}
-
-template <class _ForwardIter1, class _ForwardIter2>
-inline void iter_swap(_ForwardIter1 __a, _ForwardIter2 __b) {
- __iter_swap(__a, __b, __VALUE_TYPE(__a));
-}
-
-template <class _Tp>
-inline void swap(_Tp& __a, _Tp& __b) {
- _Tp __tmp = __a;
- __a = __b;
- __b = __tmp;
-}
-
-//--------------------------------------------------
-// min and max
-
-#ifndef __BORLANDC__
-
-#undef min
-#undef max
-
-template <class _Tp>
-inline const _Tp& min(const _Tp& __a, const _Tp& __b) {
- return __b < __a ? __b : __a;
-}
-
-template <class _Tp>
-inline const _Tp& max(const _Tp& __a, const _Tp& __b) {
- return __a < __b ? __b : __a;
-}
-
-#endif /* __BORLANDC__ */
-
-template <class _Tp, class _Compare>
-inline const _Tp& min(const _Tp& __a, const _Tp& __b, _Compare __comp) {
- return __comp(__b, __a) ? __b : __a;
-}
-
-template <class _Tp, class _Compare>
-inline const _Tp& max(const _Tp& __a, const _Tp& __b, _Compare __comp) {
- return __comp(__a, __b) ? __b : __a;
-}
-
-//--------------------------------------------------
-// copy
-
-// All of these auxiliary functions serve two purposes. (1) Replace
-// calls to copy with memmove whenever possible. (Memmove, not memcpy,
-// because the input and output ranges are permitted to overlap.)
-// (2) If we're using random access iterators, then write the loop as
-// a for loop with an explicit count. The auxiliary class __copy_dispatch
-// is a workaround for compilers that don't support partial ordering of
-// function templates.
-
-template <class _InputIter, class _OutputIter, class _Distance>
-inline _OutputIter __copy(_InputIter __first, _InputIter __last,
- _OutputIter __result,
- input_iterator_tag, _Distance*)
-{
- for ( ; __first != __last; ++__result, ++__first)
- *__result = *__first;
- return __result;
-}
-
-template <class _RandomAccessIter, class _OutputIter, class _Distance>
-inline _OutputIter
-__copy(_RandomAccessIter __first, _RandomAccessIter __last,
- _OutputIter __result, random_access_iterator_tag, _Distance*)
-{
- for (_Distance __n = __last - __first; __n > 0; --__n) {
- *__result = *__first;
- ++__first;
- ++__result;
- }
- return __result;
-}
-
-template <class _Tp>
-inline _Tp*
-__copy_trivial(const _Tp* __first, const _Tp* __last, _Tp* __result) {
- memmove(__result, __first, sizeof(_Tp) * (__last - __first));
- return __result + (__last - __first);
-}
-
-#ifdef __STL_CLASS_PARTIAL_SPECIALIZATION
-
-template <class _InputIter, class _OutputIter, class _BoolType>
-struct __copy_dispatch {
- static _OutputIter copy(_InputIter __first, _InputIter __last,
- _OutputIter __result) {
- typedef typename iterator_traits<_InputIter>::iterator_category _Category;
- typedef typename iterator_traits<_InputIter>::difference_type _Distance;
- return __copy(__first, __last, __result, _Category(), (_Distance*) 0);
- }
-};
-
-template <class _Tp>
-struct __copy_dispatch<_Tp*, _Tp*, __true_type>
-{
- static _Tp* copy(const _Tp* __first, const _Tp* __last, _Tp* __result) {
- return __copy_trivial(__first, __last, __result);
- }
-};
-
-template <class _Tp>
-struct __copy_dispatch<const _Tp*, _Tp*, __true_type>
-{
- static _Tp* copy(const _Tp* __first, const _Tp* __last, _Tp* __result) {
- return __copy_trivial(__first, __last, __result);
- }
-};
-
-template <class _InputIter, class _OutputIter>
-inline _OutputIter copy(_InputIter __first, _InputIter __last,
- _OutputIter __result) {
- typedef typename iterator_traits<_InputIter>::value_type _Tp;
- typedef typename __type_traits<_Tp>::has_trivial_assignment_operator
- _Trivial;
- return __copy_dispatch<_InputIter, _OutputIter, _Trivial>
- ::copy(__first, __last, __result);
-}
-
-#else /* __STL_CLASS_PARTIAL_SPECIALIZATION */
-
-template <class _InputIter, class _OutputIter>
-inline _OutputIter copy(_InputIter __first, _InputIter __last,
- _OutputIter __result)
-{
- return __copy(__first, __last, __result,
- __ITERATOR_CATEGORY(__first),
- __DISTANCE_TYPE(__first));
-}
-
-inline char* copy(const char* __first, const char* __last, char* __result) {
- memmove(__result, __first, __last - __first);
- return __result + (__last - __first);
-}
-
-inline wchar_t* copy(const wchar_t* __first, const wchar_t* __last,
- wchar_t* __result) {
- memmove(__result, __first, sizeof(wchar_t) * (__last - __first));
- return __result + (__last - __first);
-}
-
-#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
-
-//--------------------------------------------------
-// copy_backward
-
-template <class _BidirectionalIter1, class _BidirectionalIter2,
- class _Distance>
-inline _BidirectionalIter2 __copy_backward(_BidirectionalIter1 __first,
- _BidirectionalIter1 __last,
- _BidirectionalIter2 __result,
- bidirectional_iterator_tag,
- _Distance*)
-{
- while (__first != __last)
- *--__result = *--__last;
- return __result;
-}
-
-template <class _RandomAccessIter, class _BidirectionalIter, class _Distance>
-inline _BidirectionalIter __copy_backward(_RandomAccessIter __first,
- _RandomAccessIter __last,
- _BidirectionalIter __result,
- random_access_iterator_tag,
- _Distance*)
-{
- for (_Distance __n = __last - __first; __n > 0; --__n)
- *--__result = *--__last;
- return __result;
-}
-
-#ifdef __STL_CLASS_PARTIAL_SPECIALIZATION
-
-// This dispatch class is a workaround for compilers that do not
-// have partial ordering of function templates. All we're doing is
-// creating a specialization so that we can turn a call to copy_backward
-// into a memmove whenever possible.
-
-template <class _BidirectionalIter1, class _BidirectionalIter2,
- class _BoolType>
-struct __copy_backward_dispatch
-{
- typedef typename iterator_traits<_BidirectionalIter1>::iterator_category
- _Cat;
- typedef typename iterator_traits<_BidirectionalIter1>::difference_type
- _Distance;
-
- static _BidirectionalIter2 copy(_BidirectionalIter1 __first,
- _BidirectionalIter1 __last,
- _BidirectionalIter2 __result) {
- return __copy_backward(__first, __last, __result, _Cat(), (_Distance*) 0);
- }
-};
-
-template <class _Tp>
-struct __copy_backward_dispatch<_Tp*, _Tp*, __true_type>
-{
- static _Tp* copy(const _Tp* __first, const _Tp* __last, _Tp* __result) {
- const ptrdiff_t _Num = __last - __first;
- memmove(__result - _Num, __first, sizeof(_Tp) * _Num);
- return __result - _Num;
- }
-};
-
-template <class _Tp>
-struct __copy_backward_dispatch<const _Tp*, _Tp*, __true_type>
-{
- static _Tp* copy(const _Tp* __first, const _Tp* __last, _Tp* __result) {
- return __copy_backward_dispatch<_Tp*, _Tp*, __true_type>
- ::copy(__first, __last, __result);
- }
-};
-
-template <class _BI1, class _BI2>
-inline _BI2 copy_backward(_BI1 __first, _BI1 __last, _BI2 __result) {
- typedef typename __type_traits<typename iterator_traits<_BI2>::value_type>
- ::has_trivial_assignment_operator
- _Trivial;
- return __copy_backward_dispatch<_BI1, _BI2, _Trivial>
- ::copy(__first, __last, __result);
-}
-
-#else /* __STL_CLASS_PARTIAL_SPECIALIZATION */
-
-template <class _BI1, class _BI2>
-inline _BI2 copy_backward(_BI1 __first, _BI1 __last, _BI2 __result) {
- return __copy_backward(__first, __last, __result,
- __ITERATOR_CATEGORY(__first),
- __DISTANCE_TYPE(__first));
-}
-
-#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
-
-//--------------------------------------------------
-// copy_n (not part of the C++ standard)
-
-template <class _InputIter, class _Size, class _OutputIter>
-pair<_InputIter, _OutputIter> __copy_n(_InputIter __first, _Size __count,
- _OutputIter __result,
- input_iterator_tag) {
- for ( ; __count > 0; --__count) {
- *__result = *__first;
- ++__first;
- ++__result;
- }
- return pair<_InputIter, _OutputIter>(__first, __result);
-}
-
-template <class _RAIter, class _Size, class _OutputIter>
-inline pair<_RAIter, _OutputIter>
-__copy_n(_RAIter __first, _Size __count,
- _OutputIter __result,
- random_access_iterator_tag) {
- _RAIter __last = __first + __count;
- return pair<_RAIter, _OutputIter>(__last, copy(__first, __last, __result));
-}
-
-template <class _InputIter, class _Size, class _OutputIter>
-inline pair<_InputIter, _OutputIter>
-__copy_n(_InputIter __first, _Size __count, _OutputIter __result) {
- return __copy_n(__first, __count, __result,
- __ITERATOR_CATEGORY(__first));
-}
-
-template <class _InputIter, class _Size, class _OutputIter>
-inline pair<_InputIter, _OutputIter>
-copy_n(_InputIter __first, _Size __count, _OutputIter __result) {
- return __copy_n(__first, __count, __result);
-}
-
-//--------------------------------------------------
-// fill and fill_n
-
-
-template <class _ForwardIter, class _Tp>
-void fill(_ForwardIter __first, _ForwardIter __last, const _Tp& __value) {
- for ( ; __first != __last; ++__first)
- *__first = __value;
-}
-
-template <class _OutputIter, class _Size, class _Tp>
-_OutputIter fill_n(_OutputIter __first, _Size __n, const _Tp& __value) {
- for ( ; __n > 0; --__n, ++__first)
- *__first = __value;
- return __first;
-}
-
-//--------------------------------------------------
-// equal and mismatch
-
-template <class _InputIter1, class _InputIter2>
-pair<_InputIter1, _InputIter2> mismatch(_InputIter1 __first1,
- _InputIter1 __last1,
- _InputIter2 __first2) {
- while (__first1 != __last1 && *__first1 == *__first2) {
- ++__first1;
- ++__first2;
- }
- return pair<_InputIter1, _InputIter2>(__first1, __first2);
-}
-
-template <class _InputIter1, class _InputIter2, class _BinaryPredicate>
-pair<_InputIter1, _InputIter2> mismatch(_InputIter1 __first1,
- _InputIter1 __last1,
- _InputIter2 __first2,
- _BinaryPredicate __binary_pred) {
- while (__first1 != __last1 && __binary_pred(*__first1, *__first2)) {
- ++__first1;
- ++__first2;
- }
- return pair<_InputIter1, _InputIter2>(__first1, __first2);
-}
-
-template <class _InputIter1, class _InputIter2>
-inline bool equal(_InputIter1 __first1, _InputIter1 __last1,
- _InputIter2 __first2) {
- for ( ; __first1 != __last1; ++__first1, ++__first2)
- if (*__first1 != *__first2)
- return false;
- return true;
-}
-
-template <class _InputIter1, class _InputIter2, class _BinaryPredicate>
-inline bool equal(_InputIter1 __first1, _InputIter1 __last1,
- _InputIter2 __first2, _BinaryPredicate __binary_pred) {
- for ( ; __first1 != __last1; ++__first1, ++__first2)
- if (!__binary_pred(*__first1, *__first2))
- return false;
- return true;
-}
-
-//--------------------------------------------------
-// lexicographical_compare and lexicographical_compare_3way.
-// (the latter is not part of the C++ standard.)
-
-template <class _InputIter1, class _InputIter2>
-bool lexicographical_compare(_InputIter1 __first1, _InputIter1 __last1,
- _InputIter2 __first2, _InputIter2 __last2) {
- for ( ; __first1 != __last1 && __first2 != __last2
- ; ++__first1, ++__first2) {
- if (*__first1 < *__first2)
- return true;
- if (*__first2 < *__first1)
- return false;
- }
- return __first1 == __last1 && __first2 != __last2;
-}
-
-template <class _InputIter1, class _InputIter2, class _Compare>
-bool lexicographical_compare(_InputIter1 __first1, _InputIter1 __last1,
- _InputIter2 __first2, _InputIter2 __last2,
- _Compare __comp) {
- for ( ; __first1 != __last1 && __first2 != __last2
- ; ++__first1, ++__first2) {
- if (__comp(*__first1, *__first2))
- return true;
- if (__comp(*__first2, *__first1))
- return false;
- }
- return __first1 == __last1 && __first2 != __last2;
-}
-
-inline bool
-lexicographical_compare(const unsigned char* __first1,
- const unsigned char* __last1,
- const unsigned char* __first2,
- const unsigned char* __last2)
-{
- const size_t __len1 = __last1 - __first1;
- const size_t __len2 = __last2 - __first2;
- const int __result = memcmp(__first1, __first2, min(__len1, __len2));
- return __result != 0 ? __result < 0 : __len1 < __len2;
-}
-
-inline bool lexicographical_compare(const char* __first1, const char* __last1,
- const char* __first2, const char* __last2)
-{
-#if CHAR_MAX == SCHAR_MAX
- return lexicographical_compare((const signed char*) __first1,
- (const signed char*) __last1,
- (const signed char*) __first2,
- (const signed char*) __last2);
-#else /* CHAR_MAX == SCHAR_MAX */
- return lexicographical_compare((const unsigned char*) __first1,
- (const unsigned char*) __last1,
- (const unsigned char*) __first2,
- (const unsigned char*) __last2);
-#endif /* CHAR_MAX == SCHAR_MAX */
-}
-
-template <class _InputIter1, class _InputIter2>
-int __lexicographical_compare_3way(_InputIter1 __first1, _InputIter1 __last1,
- _InputIter2 __first2, _InputIter2 __last2)
-{
- while (__first1 != __last1 && __first2 != __last2) {
- if (*__first1 < *__first2)
- return -1;
- if (*__first2 < *__first1)
- return 1;
- ++__first1;
- ++__first2;
- }
- if (__first2 == __last2) {
- return !(__first1 == __last1);
- }
- else {
- return -1;
- }
-}
-
-inline int
-__lexicographical_compare_3way(const unsigned char* __first1,
- const unsigned char* __last1,
- const unsigned char* __first2,
- const unsigned char* __last2)
-{
- const ptrdiff_t __len1 = __last1 - __first1;
- const ptrdiff_t __len2 = __last2 - __first2;
- const int __result = memcmp(__first1, __first2, min(__len1, __len2));
- return __result != 0 ? __result
- : (__len1 == __len2 ? 0 : (__len1 < __len2 ? -1 : 1));
-}
-
-inline int
-__lexicographical_compare_3way(const char* __first1, const char* __last1,
- const char* __first2, const char* __last2)
-{
-#if CHAR_MAX == SCHAR_MAX
- return __lexicographical_compare_3way(
- (const signed char*) __first1,
- (const signed char*) __last1,
- (const signed char*) __first2,
- (const signed char*) __last2);
-#else
- return __lexicographical_compare_3way((const unsigned char*) __first1,
- (const unsigned char*) __last1,
- (const unsigned char*) __first2,
- (const unsigned char*) __last2);
-#endif
-}
-
-template <class _InputIter1, class _InputIter2>
-int lexicographical_compare_3way(_InputIter1 __first1, _InputIter1 __last1,
- _InputIter2 __first2, _InputIter2 __last2)
-{
- return __lexicographical_compare_3way(__first1, __last1, __first2, __last2);
-}
-
-__STL_END_NAMESPACE
-
-#endif /* __SGI_STL_INTERNAL_ALGOBASE_H */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/contrib/libstdc++/stl/stl_alloc.h b/contrib/libstdc++/stl/stl_alloc.h
deleted file mode 100644
index 208309a389b5..000000000000
--- a/contrib/libstdc++/stl/stl_alloc.h
+++ /dev/null
@@ -1,1057 +0,0 @@
-/*
- * Copyright (c) 1996-1997
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- */
-
-/* NOTE: This is an internal header file, included by other STL headers.
- * You should not attempt to use it directly.
- */
-
-#ifndef __SGI_STL_INTERNAL_ALLOC_H
-#define __SGI_STL_INTERNAL_ALLOC_H
-
-#ifdef __SUNPRO_CC
-# define __PRIVATE public
- // Extra access restrictions prevent us from really making some things
- // private.
-#else
-# define __PRIVATE private
-#endif
-
-#ifdef __STL_STATIC_TEMPLATE_MEMBER_BUG
-# define __USE_MALLOC
-#endif
-
-
-// This implements some standard node allocators. These are
-// NOT the same as the allocators in the C++ draft standard or in
-// in the original STL. They do not encapsulate different pointer
-// types; indeed we assume that there is only one pointer type.
-// The allocation primitives are intended to allocate individual objects,
-// not larger arenas as with the original STL allocators.
-
-#if 0
-# include <new>
-# define __THROW_BAD_ALLOC throw bad_alloc()
-#elif !defined(__THROW_BAD_ALLOC)
-# include <iostream.h>
-# define __THROW_BAD_ALLOC cerr << "out of memory" << endl; exit(1)
-#endif
-
-#ifdef __STL_WIN32THREADS
-# include <windows.h>
-#endif
-
-#include <stddef.h>
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-#ifndef __RESTRICT
-# define __RESTRICT
-#endif
-
-#if !defined(__STL_PTHREADS) && !defined(__STL_SOLTHREADS) \
- && !defined(_NOTHREADS) \
- && !defined(__STL_SGI_THREADS) && !defined(__STL_WIN32THREADS)
-# define _NOTHREADS
-#endif
-
-# ifdef __STL_PTHREADS
- // POSIX Threads
- // This is dubious, since this is likely to be a high contention
- // lock. Performance may not be adequate.
-# include <pthread.h>
-# define __NODE_ALLOCATOR_LOCK \
- if (threads) pthread_mutex_lock(&_S_node_allocator_lock)
-# define __NODE_ALLOCATOR_UNLOCK \
- if (threads) pthread_mutex_unlock(&_S_node_allocator_lock)
-# define __NODE_ALLOCATOR_THREADS true
-# define __VOLATILE volatile // Needed at -O3 on SGI
-# endif
-# ifdef __STL_SOLTHREADS
-# include <thread.h>
-# define __NODE_ALLOCATOR_LOCK \
- if (threads) mutex_lock(&_S_node_allocator_lock)
-# define __NODE_ALLOCATOR_UNLOCK \
- if (threads) mutex_unlock(&_S_node_allocator_lock)
-# define __NODE_ALLOCATOR_THREADS true
-# define __VOLATILE
-# endif
-# ifdef __STL_WIN32THREADS
- // The lock needs to be initialized by constructing an allocator
- // objects of the right type. We do that here explicitly for alloc.
-# define __NODE_ALLOCATOR_LOCK \
- EnterCriticalSection(&_S_node_allocator_lock)
-# define __NODE_ALLOCATOR_UNLOCK \
- LeaveCriticalSection(&_S_node_allocator_lock)
-# define __NODE_ALLOCATOR_THREADS true
-# define __VOLATILE volatile // may not be needed
-# endif /* WIN32THREADS */
-# ifdef __STL_SGI_THREADS
- // This should work without threads, with sproc threads, or with
- // pthreads. It is suboptimal in all cases.
- // It is unlikely to even compile on nonSGI machines.
-
- extern "C" {
- extern int __us_rsthread_malloc;
- }
- // The above is copied from malloc.h. Including <malloc.h>
- // would be cleaner but fails with certain levels of standard
- // conformance.
-# define __NODE_ALLOCATOR_LOCK if (threads && __us_rsthread_malloc) \
- { _S_lock(&_S_node_allocator_lock); }
-# define __NODE_ALLOCATOR_UNLOCK if (threads && __us_rsthread_malloc) \
- { _S_unlock(&_S_node_allocator_lock); }
-# define __NODE_ALLOCATOR_THREADS true
-# define __VOLATILE volatile // Needed at -O3 on SGI
-# endif
-# ifdef _NOTHREADS
-// Thread-unsafe
-# define __NODE_ALLOCATOR_LOCK
-# define __NODE_ALLOCATOR_UNLOCK
-# define __NODE_ALLOCATOR_THREADS false
-# define __VOLATILE
-# endif
-
-__STL_BEGIN_NAMESPACE
-
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma set woff 1174
-#endif
-
-// Malloc-based allocator. Typically slower than default alloc below.
-// Typically thread-safe and more storage efficient.
-#ifdef __STL_STATIC_TEMPLATE_MEMBER_BUG
-# ifdef __DECLARE_GLOBALS_HERE
- void (* __malloc_alloc_oom_handler)() = 0;
- // g++ 2.7.2 does not handle static template data members.
-# else
- extern void (* __malloc_alloc_oom_handler)();
-# endif
-#endif
-
-template <int __inst>
-class __malloc_alloc_template {
-
-private:
-
- static void* _S_oom_malloc(size_t);
- static void* _S_oom_realloc(void*, size_t);
-
-#ifndef __STL_STATIC_TEMPLATE_MEMBER_BUG
- static void (* __malloc_alloc_oom_handler)();
-#endif
-
-public:
-
- static void* allocate(size_t __n)
- {
- void* __result = malloc(__n);
- if (0 == __result) __result = _S_oom_malloc(__n);
- return __result;
- }
-
- static void deallocate(void* __p, size_t /* __n */)
- {
- free(__p);
- }
-
- static void* reallocate(void* __p, size_t /* old_sz */, size_t __new_sz)
- {
- void* __result = realloc(__p, __new_sz);
- if (0 == __result) __result = _S_oom_realloc(__p, __new_sz);
- return __result;
- }
-
- static void (* __set_malloc_handler(void (*__f)()))()
- {
- void (* __old)() = __malloc_alloc_oom_handler;
- __malloc_alloc_oom_handler = __f;
- return(__old);
- }
-
-};
-
-// malloc_alloc out-of-memory handling
-
-#ifndef __STL_STATIC_TEMPLATE_MEMBER_BUG
-template <int __inst>
-void (* __malloc_alloc_template<__inst>::__malloc_alloc_oom_handler)() = 0;
-#endif
-
-template <int __inst>
-void*
-__malloc_alloc_template<__inst>::_S_oom_malloc(size_t __n)
-{
- void (* __my_malloc_handler)();
- void* __result;
-
- for (;;) {
- __my_malloc_handler = __malloc_alloc_oom_handler;
- if (0 == __my_malloc_handler) { __THROW_BAD_ALLOC; }
- (*__my_malloc_handler)();
- __result = malloc(__n);
- if (__result) return(__result);
- }
-}
-
-template <int __inst>
-void* __malloc_alloc_template<__inst>::_S_oom_realloc(void* __p, size_t __n)
-{
- void (* __my_malloc_handler)();
- void* __result;
-
- for (;;) {
- __my_malloc_handler = __malloc_alloc_oom_handler;
- if (0 == __my_malloc_handler) { __THROW_BAD_ALLOC; }
- (*__my_malloc_handler)();
- __result = realloc(__p, __n);
- if (__result) return(__result);
- }
-}
-
-typedef __malloc_alloc_template<0> malloc_alloc;
-
-template<class _Tp, class _Alloc>
-class simple_alloc {
-
-public:
- static _Tp* allocate(size_t __n)
- { return 0 == __n ? 0 : (_Tp*) _Alloc::allocate(__n * sizeof (_Tp)); }
- static _Tp* allocate(void)
- { return (_Tp*) _Alloc::allocate(sizeof (_Tp)); }
- static void deallocate(_Tp* __p, size_t __n)
- { if (0 != __n) _Alloc::deallocate(__p, __n * sizeof (_Tp)); }
- static void deallocate(_Tp* __p)
- { _Alloc::deallocate(__p, sizeof (_Tp)); }
-};
-
-// Allocator adaptor to check size arguments for debugging.
-// Reports errors using assert. Checking can be disabled with
-// NDEBUG, but it's far better to just use the underlying allocator
-// instead when no checking is desired.
-// There is some evidence that this can confuse Purify.
-template <class _Alloc>
-class debug_alloc {
-
-private:
-
- enum {_S_extra = 8}; // Size of space used to store size. Note
- // that this must be large enough to preserve
- // alignment.
-
-public:
-
- static void* allocate(size_t __n)
- {
- char* __result = (char*)_Alloc::allocate(__n + _S_extra);
- *(size_t*)__result = __n;
- return __result + _S_extra;
- }
-
- static void deallocate(void* __p, size_t __n)
- {
- char* __real_p = (char*)__p - _S_extra;
- assert(*(size_t*)__real_p == __n);
- _Alloc::deallocate(__real_p, __n + _S_extra);
- }
-
- static void* reallocate(void* __p, size_t __old_sz, size_t __new_sz)
- {
- char* __real_p = (char*)__p - _S_extra;
- assert(*(size_t*)__real_p == __old_sz);
- char* __result = (char*)
- _Alloc::reallocate(__real_p, __old_sz + _S_extra, __new_sz + _S_extra);
- *(size_t*)__result = __new_sz;
- return __result + _S_extra;
- }
-
-};
-
-
-# ifdef __USE_MALLOC
-
-typedef malloc_alloc alloc;
-typedef malloc_alloc single_client_alloc;
-
-# else
-
-
-// Default node allocator.
-// With a reasonable compiler, this should be roughly as fast as the
-// original STL class-specific allocators, but with less fragmentation.
-// Default_alloc_template parameters are experimental and MAY
-// DISAPPEAR in the future. Clients should just use alloc for now.
-//
-// Important implementation properties:
-// 1. If the client request an object of size > _MAX_BYTES, the resulting
-// object will be obtained directly from malloc.
-// 2. In all other cases, we allocate an object of size exactly
-// _S_round_up(requested_size). Thus the client has enough size
-// information that we can return the object to the proper free list
-// without permanently losing part of the object.
-//
-
-// The first template parameter specifies whether more than one thread
-// may use this allocator. It is safe to allocate an object from
-// one instance of a default_alloc and deallocate it with another
-// one. This effectively transfers its ownership to the second one.
-// This may have undesirable effects on reference locality.
-// The second parameter is unreferenced and serves only to allow the
-// creation of multiple default_alloc instances.
-// Node that containers built on different allocator instances have
-// different types, limiting the utility of this approach.
-#ifdef __SUNPRO_CC
-// breaks if we make these template class members:
- enum {_ALIGN = 8};
- enum {_MAX_BYTES = 128};
- enum {_NFREELISTS = _MAX_BYTES/_ALIGN};
-#endif
-
-template <bool threads, int inst>
-class __default_alloc_template {
-
-private:
- // Really we should use static const int x = N
- // instead of enum { x = N }, but few compilers accept the former.
-# ifndef __SUNPRO_CC
- enum {_ALIGN = 8};
- enum {_MAX_BYTES = 128};
- enum {_NFREELISTS = _MAX_BYTES/_ALIGN};
-# endif
- static size_t
- _S_round_up(size_t __bytes)
- { return (((__bytes) + _ALIGN-1) & ~(_ALIGN - 1)); }
-
-__PRIVATE:
- union _Obj {
- union _Obj* _M_free_list_link;
- char _M_client_data[1]; /* The client sees this. */
- };
-private:
-# ifdef __SUNPRO_CC
- static _Obj* __VOLATILE _S_free_list[];
- // Specifying a size results in duplicate def for 4.1
-# else
- static _Obj* __VOLATILE _S_free_list[_NFREELISTS];
-# endif
- static size_t _S_freelist_index(size_t __bytes) {
- return (((__bytes) + _ALIGN-1)/_ALIGN - 1);
- }
-
- // Returns an object of size __n, and optionally adds to size __n free list.
- static void* _S_refill(size_t __n);
- // Allocates a chunk for nobjs of size "size". nobjs may be reduced
- // if it is inconvenient to allocate the requested number.
- static char* _S_chunk_alloc(size_t __size, int& __nobjs);
-
- // Chunk allocation state.
- static char* _S_start_free;
- static char* _S_end_free;
- static size_t _S_heap_size;
-
-# ifdef __STL_SGI_THREADS
- static volatile unsigned long _S_node_allocator_lock;
- static void _S_lock(volatile unsigned long*);
- static inline void _S_unlock(volatile unsigned long*);
-# endif
-
-# ifdef __STL_PTHREADS
- static pthread_mutex_t _S_node_allocator_lock;
-# endif
-
-# ifdef __STL_SOLTHREADS
- static mutex_t _S_node_allocator_lock;
-# endif
-
-# ifdef __STL_WIN32THREADS
- static CRITICAL_SECTION _S_node_allocator_lock;
- static bool _S_node_allocator_lock_initialized;
-
- public:
- __default_alloc_template() {
- // This assumes the first constructor is called before threads
- // are started.
- if (!_S_node_allocator_lock_initialized) {
- InitializeCriticalSection(&_S_node_allocator_lock);
- _S_node_allocator_lock_initialized = true;
- }
- }
- private:
-# endif
-
- class _Lock {
- public:
- _Lock() { __NODE_ALLOCATOR_LOCK; }
- ~_Lock() { __NODE_ALLOCATOR_UNLOCK; }
- };
- friend class _Lock;
-
-public:
-
- /* __n must be > 0 */
- static void* allocate(size_t __n)
- {
- _Obj* __VOLATILE* __my_free_list;
- _Obj* __RESTRICT __result;
-
- if (__n > (size_t) _MAX_BYTES) {
- return(malloc_alloc::allocate(__n));
- }
- __my_free_list = _S_free_list + _S_freelist_index(__n);
- // Acquire the lock here with a constructor call.
- // This ensures that it is released in exit or during stack
- // unwinding.
-# ifndef _NOTHREADS
- /*REFERENCED*/
- _Lock __lock_instance;
-# endif
- __result = *__my_free_list;
- if (__result == 0) {
- void* __r = _S_refill(_S_round_up(__n));
- return __r;
- }
- *__my_free_list = __result -> _M_free_list_link;
- return (__result);
- };
-
- /* __p may not be 0 */
- static void deallocate(void* __p, size_t __n)
- {
- _Obj* __q = (_Obj*)__p;
- _Obj* __VOLATILE* __my_free_list;
-
- if (__n > (size_t) _MAX_BYTES) {
- malloc_alloc::deallocate(__p, __n);
- return;
- }
- __my_free_list = _S_free_list + _S_freelist_index(__n);
- // acquire lock
-# ifndef _NOTHREADS
- /*REFERENCED*/
- _Lock __lock_instance;
-# endif /* _NOTHREADS */
- __q -> _M_free_list_link = *__my_free_list;
- *__my_free_list = __q;
- // lock is released here
- }
-
- static void* reallocate(void* __p, size_t __old_sz, size_t __new_sz);
-
-} ;
-
-typedef __default_alloc_template<__NODE_ALLOCATOR_THREADS, 0> alloc;
-typedef __default_alloc_template<false, 0> single_client_alloc;
-
-
-
-/* We allocate memory in large chunks in order to avoid fragmenting */
-/* the malloc heap too much. */
-/* We assume that size is properly aligned. */
-/* We hold the allocation lock. */
-template <bool __threads, int __inst>
-char*
-__default_alloc_template<__threads, __inst>::_S_chunk_alloc(size_t __size,
- int& __nobjs)
-{
- char* __result;
- size_t __total_bytes = __size * __nobjs;
- size_t __bytes_left = _S_end_free - _S_start_free;
-
- if (__bytes_left >= __total_bytes) {
- __result = _S_start_free;
- _S_start_free += __total_bytes;
- return(__result);
- } else if (__bytes_left >= __size) {
- __nobjs = (int)(__bytes_left/__size);
- __total_bytes = __size * __nobjs;
- __result = _S_start_free;
- _S_start_free += __total_bytes;
- return(__result);
- } else {
- size_t __bytes_to_get =
- 2 * __total_bytes + _S_round_up(_S_heap_size >> 4);
- // Try to make use of the left-over piece.
- if (__bytes_left > 0) {
- _Obj* __VOLATILE* __my_free_list =
- _S_free_list + _S_freelist_index(__bytes_left);
-
- ((_Obj*)_S_start_free) -> _M_free_list_link = *__my_free_list;
- *__my_free_list = (_Obj*)_S_start_free;
- }
- _S_start_free = (char*)malloc(__bytes_to_get);
- if (0 == _S_start_free) {
- size_t __i;
- _Obj* __VOLATILE* __my_free_list;
- _Obj* __p;
- // Try to make do with what we have. That can't
- // hurt. We do not try smaller requests, since that tends
- // to result in disaster on multi-process machines.
- for (__i = __size; __i <= _MAX_BYTES; __i += _ALIGN) {
- __my_free_list = _S_free_list + _S_freelist_index(__i);
- __p = *__my_free_list;
- if (0 != __p) {
- *__my_free_list = __p -> _M_free_list_link;
- _S_start_free = (char*)__p;
- _S_end_free = _S_start_free + __i;
- return(_S_chunk_alloc(__size, __nobjs));
- // Any leftover piece will eventually make it to the
- // right free list.
- }
- }
- _S_end_free = 0; // In case of exception.
- _S_start_free = (char*)malloc_alloc::allocate(__bytes_to_get);
- // This should either throw an
- // exception or remedy the situation. Thus we assume it
- // succeeded.
- }
- _S_heap_size += __bytes_to_get;
- _S_end_free = _S_start_free + __bytes_to_get;
- return(_S_chunk_alloc(__size, __nobjs));
- }
-}
-
-
-/* Returns an object of size __n, and optionally adds to size __n free list.*/
-/* We assume that __n is properly aligned. */
-/* We hold the allocation lock. */
-template <bool __threads, int __inst>
-void*
-__default_alloc_template<__threads, __inst>::_S_refill(size_t __n)
-{
- int __nobjs = 20;
- char* __chunk = _S_chunk_alloc(__n, __nobjs);
- _Obj* __VOLATILE* __my_free_list;
- _Obj* __result;
- _Obj* __current_obj;
- _Obj* __next_obj;
- int __i;
-
- if (1 == __nobjs) return(__chunk);
- __my_free_list = _S_free_list + _S_freelist_index(__n);
-
- /* Build free list in chunk */
- __result = (_Obj*)__chunk;
- *__my_free_list = __next_obj = (_Obj*)(__chunk + __n);
- for (__i = 1; ; __i++) {
- __current_obj = __next_obj;
- __next_obj = (_Obj*)((char*)__next_obj + __n);
- if (__nobjs - 1 == __i) {
- __current_obj -> _M_free_list_link = 0;
- break;
- } else {
- __current_obj -> _M_free_list_link = __next_obj;
- }
- }
- return(__result);
-}
-
-template <bool threads, int inst>
-void*
-__default_alloc_template<threads, inst>::reallocate(void* __p,
- size_t __old_sz,
- size_t __new_sz)
-{
- void* __result;
- size_t __copy_sz;
-
- if (__old_sz > (size_t) _MAX_BYTES && __new_sz > (size_t) _MAX_BYTES) {
- return(realloc(__p, __new_sz));
- }
- if (_S_round_up(__old_sz) == _S_round_up(__new_sz)) return(__p);
- __result = allocate(__new_sz);
- __copy_sz = __new_sz > __old_sz? __old_sz : __new_sz;
- memcpy(__result, __p, __copy_sz);
- deallocate(__p, __old_sz);
- return(__result);
-}
-
-#ifdef __STL_PTHREADS
- template <bool __threads, int __inst>
- pthread_mutex_t
- __default_alloc_template<__threads, __inst>::_S_node_allocator_lock
- = PTHREAD_MUTEX_INITIALIZER;
-#endif
-
-#ifdef __STL_SOLTHREADS
- template <bool __threads, int __inst>
- mutex_t
- __default_alloc_template<__threads, __inst>::_S_node_allocator_lock
- = DEFAULTMUTEX;
-#endif
-
-#ifdef __STL_WIN32THREADS
- template <bool __threads, int __inst>
- CRITICAL_SECTION
- __default_alloc_template<__threads, __inst>::
- _S_node_allocator_lock;
-
- template <bool __threads, int __inst>
- bool
- __default_alloc_template<__threads, __inst>::
- _S_node_allocator_lock_initialized
- = false;
-#endif
-
-#ifdef __STL_SGI_THREADS
-__STL_END_NAMESPACE
-#include <mutex.h>
-#include <time.h> /* XXX should use <ctime> */
-__STL_BEGIN_NAMESPACE
-// Somewhat generic lock implementations. We need only test-and-set
-// and some way to sleep. These should work with both SGI pthreads
-// and sproc threads. They may be useful on other systems.
-template <bool __threads, int __inst>
-volatile unsigned long
-__default_alloc_template<__threads, __inst>::_S_node_allocator_lock = 0;
-
-#if __mips < 3 || !(defined (_ABIN32) || defined(_ABI64)) || defined(__GNUC__)
-# define __test_and_set(l,v) test_and_set(l,v)
-#endif
-
-template <bool __threads, int __inst>
-void
-__default_alloc_template<__threads, __inst>::
- _S_lock(volatile unsigned long* __lock)
-{
- const unsigned __low_spin_max = 30; // spins if we suspect uniprocessor
- const unsigned __high_spin_max = 1000; // spins for multiprocessor
- static unsigned __spin_max = __low_spin_max;
- unsigned __my_spin_max;
- static unsigned __last_spins = 0;
- unsigned __my_last_spins;
- unsigned __junk;
-# define __ALLOC_PAUSE \
- __junk *= __junk; __junk *= __junk; __junk *= __junk; __junk *= __junk
- int __i;
-
- if (!__test_and_set((unsigned long*)__lock, 1)) {
- return;
- }
- __my_spin_max = __spin_max;
- __my_last_spins = __last_spins;
- for (__i = 0; __i < __my_spin_max; __i++) {
- if (__i < __my_last_spins/2 || *__lock) {
- __ALLOC_PAUSE;
- continue;
- }
- if (!__test_and_set((unsigned long*)__lock, 1)) {
- // got it!
- // Spinning worked. Thus we're probably not being scheduled
- // against the other process with which we were contending.
- // Thus it makes sense to spin longer the next time.
- __last_spins = __i;
- __spin_max = __high_spin_max;
- return;
- }
- }
- // We are probably being scheduled against the other process. Sleep.
- __spin_max = __low_spin_max;
- for (__i = 0 ;; ++__i) {
- struct timespec __ts;
- int __log_nsec = __i + 6;
-
- if (!__test_and_set((unsigned long *)__lock, 1)) {
- return;
- }
- if (__log_nsec > 27) __log_nsec = 27;
- /* Max sleep is 2**27nsec ~ 60msec */
- __ts.tv_sec = 0;
- __ts.tv_nsec = 1 << __log_nsec;
- nanosleep(&__ts, 0);
- }
-}
-
-template <bool __threads, int __inst>
-inline void
-__default_alloc_template<__threads, __inst>::_S_unlock(
- volatile unsigned long* __lock)
-{
-# if defined(__GNUC__) && __mips >= 3
- asm("sync");
- *__lock = 0;
-# elif __mips >= 3 && (defined (_ABIN32) || defined(_ABI64))
- __lock_release(__lock);
-# else
- *__lock = 0;
- // This is not sufficient on many multiprocessors, since
- // writes to protected variables and the lock may be reordered.
-# endif
-}
-#endif
-
-template <bool __threads, int __inst>
-char* __default_alloc_template<__threads, __inst>::_S_start_free = 0;
-
-template <bool __threads, int __inst>
-char* __default_alloc_template<__threads, __inst>::_S_end_free = 0;
-
-template <bool __threads, int __inst>
-size_t __default_alloc_template<__threads, __inst>::_S_heap_size = 0;
-
-template <bool __threads, int __inst>
-__default_alloc_template<__threads, __inst>::_Obj* __VOLATILE
-__default_alloc_template<__threads, __inst> ::_S_free_list[
- _NFREELISTS
-] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, };
-// The 16 zeros are necessary to make version 4.1 of the SunPro
-// compiler happy. Otherwise it appears to allocate too little
-// space for the array.
-
-# ifdef __STL_WIN32THREADS
- // Create one to get critical section initialized.
- // We do this onece per file, but only the first constructor
- // does anything.
- static alloc __node_allocator_dummy_instance;
-# endif
-
-#endif /* ! __USE_MALLOC */
-
-// This implements allocators as specified in the C++ standard.
-//
-// Note that standard-conforming allocators use many language features
-// that are not yet widely implemented. In particular, they rely on
-// member templates, partial specialization, partial ordering of function
-// templates, the typename keyword, and the use of the template keyword
-// to refer to a template member of a dependent type.
-
-#ifdef __STL_USE_STD_ALLOCATORS
-
-template <class _Tp>
-class allocator {
- typedef alloc _Alloc; // The underlying allocator.
-public:
- typedef size_t size_type;
- typedef ptrdiff_t difference_type;
- typedef _Tp* pointer;
- typedef const _Tp* const_pointer;
- typedef _Tp& reference;
- typedef const _Tp& const_reference;
- typedef _Tp value_type;
-
- template <class _Tp1> struct rebind {
- typedef allocator<_Tp1> other;
- };
-
- allocator() __STL_NOTHROW {}
- allocator(const allocator&) __STL_NOTHROW {}
- template <class _Tp1> allocator(const allocator<_Tp1>&) __STL_NOTHROW {}
- ~allocator() __STL_NOTHROW {}
-
- pointer address(reference __x) const { return &__x; }
- const_pointer address(const_reference __x) const { return &__x; }
-
- // __n is permitted to be 0. The C++ standard says nothing about what
- // the return value is when __n == 0.
- _Tp* allocate(size_type __n, const void* = 0) {
- return __n != 0 ? static_cast<_Tp*>(_Alloc::allocate(__n * sizeof(_Tp)))
- : 0;
- }
-
- // __p is not permitted to be a null pointer.
- void deallocate(pointer __p, size_type __n)
- { _Alloc::deallocate(__p, __n * sizeof(_Tp)); }
-
- size_type max_size() const __STL_NOTHROW
- { return size_t(-1) / sizeof(_Tp); }
-
- void construct(pointer __p, const _Tp& __val) { new(__p) _Tp(__val); }
- void destroy(pointer __p) { __p->~_Tp(); }
-};
-
-template<>
-class allocator<void> {
- typedef size_t size_type;
- typedef ptrdiff_t difference_type;
- typedef void* pointer;
- typedef const void* const_pointer;
- typedef void value_type;
-
- template <class _Tp1> struct rebind {
- typedef allocator<_Tp1> other;
- };
-};
-
-
-template <class _T1, class _T2>
-inline bool operator==(const allocator<_T1>&, const allocator<_T2>&)
-{
- return true;
-}
-
-template <class _T1, class _T2>
-inline bool operator!=(const allocator<_T1>&, const allocator<_T2>&)
-{
- return false;
-}
-
-// Allocator adaptor to turn an SGI-style allocator (e.g. alloc, malloc_alloc)
-// into a standard-conforming allocator. Note that this adaptor does
-// *not* assume that all objects of the underlying alloc class are
-// identical, nor does it assume that all of the underlying alloc's
-// member functions are static member functions. Note, also, that
-// __allocator<_Tp, alloc> is essentially the same thing as allocator<_Tp>.
-
-template <class _Tp, class _Alloc>
-struct __allocator {
- _Alloc __underlying_alloc;
-
- typedef size_t size_type;
- typedef ptrdiff_t difference_type;
- typedef _Tp* pointer;
- typedef const _Tp* const_pointer;
- typedef _Tp& reference;
- typedef const _Tp& const_reference;
- typedef _Tp value_type;
-
- template <class _Tp1> struct rebind {
- typedef __allocator<_Tp1, _Alloc> other;
- };
-
- __allocator() __STL_NOTHROW {}
- __allocator(const __allocator& __a) __STL_NOTHROW
- : __underlying_alloc(__a.__underlying_alloc) {}
- template <class _Tp1>
- __allocator(const __allocator<_Tp1, _Alloc>& __a) __STL_NOTHROW
- : __underlying_alloc(__a.__underlying_alloc) {}
- ~__allocator() __STL_NOTHROW {}
-
- pointer address(reference __x) const { return &__x; }
- const_pointer address(const_reference __x) const { return &__x; }
-
- // __n is permitted to be 0.
- _Tp* allocate(size_type __n, const void* = 0) {
- return __n != 0
- ? static_cast<_Tp*>(__underlying_alloc.allocate(__n * sizeof(_Tp)))
- : 0;
- }
-
- // __p is not permitted to be a null pointer.
- void deallocate(pointer __p, size_type __n)
- { __underlying_alloc.deallocate(__p, __n * sizeof(_Tp)); }
-
- size_type max_size() const __STL_NOTHROW
- { return size_t(-1) / sizeof(_Tp); }
-
- void construct(pointer __p, const _Tp& __val) { new(__p) _Tp(__val); }
- void destroy(pointer __p) { __p->~_Tp(); }
-};
-
-template <class _Alloc>
-class __allocator<void, _Alloc> {
- typedef size_t size_type;
- typedef ptrdiff_t difference_type;
- typedef void* pointer;
- typedef const void* const_pointer;
- typedef void value_type;
-
- template <class _Tp1> struct rebind {
- typedef __allocator<_Tp1, _Alloc> other;
- };
-};
-
-template <class _Tp, class _Alloc>
-inline bool operator==(const __allocator<_Tp, _Alloc>& __a1,
- const __allocator<_Tp, _Alloc>& __a2)
-{
- return __a1.__underlying_alloc == __a2.__underlying_alloc;
-}
-
-#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER
-template <class _Tp, class _Alloc>
-inline bool operator!=(const __allocator<_Tp, _Alloc>& __a1,
- const __allocator<_Tp, _Alloc>& __a2)
-{
- return __a1.__underlying_alloc != __a2.__underlying_alloc;
-}
-#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */
-
-// Comparison operators for all of the predifined SGI-style allocators.
-// This ensures that __allocator<malloc_alloc> (for example) will
-// work correctly.
-
-template <int inst>
-inline bool operator==(const __malloc_alloc_template<inst>&,
- const __malloc_alloc_template<inst>&)
-{
- return true;
-}
-
-#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER
-template <int __inst>
-inline bool operator!=(const __malloc_alloc_template<__inst>&,
- const __malloc_alloc_template<__inst>&)
-{
- return false;
-}
-#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */
-
-#ifndef __USE_MALLOC
-template <bool __threads, int __inst>
-inline bool operator==(const __default_alloc_template<__threads, __inst>&,
- const __default_alloc_template<__threads, __inst>&)
-{
- return true;
-}
-
-# ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER
-template <bool __threads, int __inst>
-inline bool operator!=(const __default_alloc_template<__threads, __inst>&,
- const __default_alloc_template<__threads, __inst>&)
-{
- return false;
-}
-# endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */
-#endif
-
-template <class _Alloc>
-inline bool operator==(const debug_alloc<_Alloc>&,
- const debug_alloc<_Alloc>&) {
- return true;
-}
-
-#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER
-template <class _Alloc>
-inline bool operator!=(const debug_alloc<_Alloc>&,
- const debug_alloc<_Alloc>&) {
- return false;
-}
-#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */
-
-// Another allocator adaptor: _Alloc_traits. This serves two
-// purposes. First, make it possible to write containers that can use
-// either SGI-style allocators or standard-conforming allocator.
-// Second, provide a mechanism so that containers can query whether or
-// not the allocator has distinct instances. If not, the container
-// can avoid wasting a word of memory to store an empty object.
-
-// This adaptor uses partial specialization. The general case of
-// _Alloc_traits<_Tp, _Alloc> assumes that _Alloc is a
-// standard-conforming allocator, possibly with non-equal instances
-// and non-static members. (It still behaves correctly even if _Alloc
-// has static member and if all instances are equal. Refinements
-// affect performance, not correctness.)
-
-// There are always two members: allocator_type, which is a standard-
-// conforming allocator type for allocating objects of type _Tp, and
-// _S_instanceless, a static const member of type bool. If
-// _S_instanceless is true, this means that there is no difference
-// between any two instances of type allocator_type. Furthermore, if
-// _S_instanceless is true, then _Alloc_traits has one additional
-// member: _Alloc_type. This type encapsulates allocation and
-// deallocation of objects of type _Tp through a static interface; it
-// has two member functions, whose signatures are
-// static _Tp* allocate(size_t)
-// static void deallocate(_Tp*, size_t)
-
-// The fully general version.
-
-template <class _Tp, class _Allocator>
-struct _Alloc_traits
-{
- static const bool _S_instanceless = false;
- typedef typename _Allocator::__STL_TEMPLATE rebind<_Tp>::other
- allocator_type;
-};
-
-template <class _Tp, class _Allocator>
-const bool _Alloc_traits<_Tp, _Allocator>::_S_instanceless;
-
-// The version for the default allocator.
-
-template <class _Tp, class _Tp1>
-struct _Alloc_traits<_Tp, allocator<_Tp1> >
-{
- static const bool _S_instanceless = true;
- typedef simple_alloc<_Tp, alloc> _Alloc_type;
- typedef allocator<_Tp> allocator_type;
-};
-
-// Versions for the predefined SGI-style allocators.
-
-template <class _Tp, int __inst>
-struct _Alloc_traits<_Tp, __malloc_alloc_template<__inst> >
-{
- static const bool _S_instanceless = true;
- typedef simple_alloc<_Tp, __malloc_alloc_template<__inst> > _Alloc_type;
- typedef __allocator<_Tp, __malloc_alloc_template<__inst> > allocator_type;
-};
-
-#ifndef __USE_MALLOC
-template <class _Tp, bool __threads, int __inst>
-struct _Alloc_traits<_Tp, __default_alloc_template<__threads, __inst> >
-{
- static const bool _S_instanceless = true;
- typedef simple_alloc<_Tp, __default_alloc_template<__threads, __inst> >
- _Alloc_type;
- typedef __allocator<_Tp, __default_alloc_template<__threads, __inst> >
- allocator_type;
-};
-#endif
-
-template <class _Tp, class _Alloc>
-struct _Alloc_traits<_Tp, debug_alloc<_Alloc> >
-{
- static const bool _S_instanceless = true;
- typedef simple_alloc<_Tp, debug_alloc<_Alloc> > _Alloc_type;
- typedef __allocator<_Tp, debug_alloc<_Alloc> > allocator_type;
-};
-
-// Versions for the __allocator adaptor used with the predefined
-// SGI-style allocators.
-
-template <class _Tp, class _Tp1, int __inst>
-struct _Alloc_traits<_Tp,
- __allocator<_Tp1, __malloc_alloc_template<__inst> > >
-{
- static const bool _S_instanceless = true;
- typedef simple_alloc<_Tp, __malloc_alloc_template<__inst> > _Alloc_type;
- typedef __allocator<_Tp, __malloc_alloc_template<__inst> > allocator_type;
-};
-
-#ifndef __USE_MALLOC
-template <class _Tp, class _Tp1, bool __thr, int __inst>
-struct _Alloc_traits<_Tp,
- __allocator<_Tp1,
- __default_alloc_template<__thr, __inst> > >
-{
- static const bool _S_instanceless = true;
- typedef simple_alloc<_Tp, __default_alloc_template<__thr,__inst> >
- _Alloc_type;
- typedef __allocator<_Tp, __default_alloc_template<__thr,__inst> >
- allocator_type;
-};
-#endif
-
-template <class _Tp, class _Tp1, class _Alloc>
-struct _Alloc_traits<_Tp, __allocator<_Tp1, debug_alloc<_Alloc> > >
-{
- static const bool _S_instanceless = true;
- typedef simple_alloc<_Tp, debug_alloc<_Alloc> > _Alloc_type;
- typedef __allocator<_Tp, debug_alloc<_Alloc> > allocator_type;
-};
-
-
-#endif /* __STL_USE_STD_ALLOCATORS */
-
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma reset woff 1174
-#endif
-
-__STL_END_NAMESPACE
-
-#undef __PRIVATE
-
-#endif /* __SGI_STL_INTERNAL_ALLOC_H */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/contrib/libstdc++/stl/stl_bvector.h b/contrib/libstdc++/stl/stl_bvector.h
deleted file mode 100644
index 0d0cdb6c828f..000000000000
--- a/contrib/libstdc++/stl/stl_bvector.h
+++ /dev/null
@@ -1,838 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- *
- * Copyright (c) 1996,1997
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- */
-
-/* NOTE: This is an internal header file, included by other STL headers.
- * You should not attempt to use it directly.
- */
-
-#ifndef __SGI_STL_INTERNAL_BVECTOR_H
-#define __SGI_STL_INTERNAL_BVECTOR_H
-
-__STL_BEGIN_NAMESPACE
-
-static const int __WORD_BIT = int(CHAR_BIT*sizeof(unsigned int));
-
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma set woff 1174
-#pragma set woff 1375
-#endif
-
-struct _Bit_reference {
- unsigned int* _M_p;
- unsigned int _M_mask;
- _Bit_reference(unsigned int* __x, unsigned int __y)
- : _M_p(__x), _M_mask(__y) {}
-
-public:
- _Bit_reference() : _M_p(0), _M_mask(0) {}
- operator bool() const { return !(!(*_M_p & _M_mask)); }
- _Bit_reference& operator=(bool __x)
- {
- if (__x) *_M_p |= _M_mask;
- else *_M_p &= ~_M_mask;
- return *this;
- }
- _Bit_reference& operator=(const _Bit_reference& __x)
- { return *this = bool(__x); }
- bool operator==(const _Bit_reference& __x) const
- { return bool(*this) == bool(__x); }
- bool operator<(const _Bit_reference& __x) const {
- return !bool(*this) && bool(__x);
- }
- void flip() { *_M_p ^= _M_mask; }
-};
-
-inline void swap(_Bit_reference __x, _Bit_reference __y)
-{
- bool __tmp = __x;
- __x = __y;
- __y = __tmp;
-}
-
-struct _Bit_iterator : public random_access_iterator<bool, ptrdiff_t> {
- typedef _Bit_reference reference;
- typedef _Bit_reference* pointer;
- typedef _Bit_iterator iterator;
-
- unsigned int* _M_p;
- unsigned int _M_offset;
- void bump_up() {
- if (_M_offset++ == __WORD_BIT - 1) {
- _M_offset = 0;
- ++_M_p;
- }
- }
- void bump_down() {
- if (_M_offset-- == 0) {
- _M_offset = __WORD_BIT - 1;
- --_M_p;
- }
- }
-
- _Bit_iterator() : _M_p(0), _M_offset(0) {}
- _Bit_iterator(unsigned int* __x, unsigned int __y)
- : _M_p(__x), _M_offset(__y) {}
- reference operator*() const { return reference(_M_p, 1U << _M_offset); }
- iterator& operator++() {
- bump_up();
- return *this;
- }
- iterator operator++(int) {
- iterator __tmp = *this;
- bump_up();
- return __tmp;
- }
- iterator& operator--() {
- bump_down();
- return *this;
- }
- iterator operator--(int) {
- iterator __tmp = *this;
- bump_down();
- return __tmp;
- }
- iterator& operator+=(difference_type __i) {
- difference_type __n = __i + _M_offset;
- _M_p += __n / __WORD_BIT;
- __n = __n % __WORD_BIT;
- if (__n < 0) {
- _M_offset = (unsigned int) __n + __WORD_BIT;
- --_M_p;
- } else
- _M_offset = (unsigned int) __n;
- return *this;
- }
- iterator& operator-=(difference_type __i) {
- *this += -__i;
- return *this;
- }
- iterator operator+(difference_type __i) const {
- iterator __tmp = *this;
- return __tmp += __i;
- }
- iterator operator-(difference_type __i) const {
- iterator __tmp = *this;
- return __tmp -= __i;
- }
- difference_type operator-(iterator __x) const {
- return __WORD_BIT * (_M_p - __x._M_p) + _M_offset - __x._M_offset;
- }
- reference operator[](difference_type __i) { return *(*this + __i); }
- bool operator==(const iterator& __x) const {
- return _M_p == __x._M_p && _M_offset == __x._M_offset;
- }
- bool operator!=(const iterator& __x) const {
- return _M_p != __x._M_p || _M_offset != __x._M_offset;
- }
- bool operator<(iterator __x) const {
- return _M_p < __x._M_p || (_M_p == __x._M_p && _M_offset < __x._M_offset);
- }
-};
-
-struct _Bit_const_iterator
- : public random_access_iterator<bool, ptrdiff_t>
-{
- typedef bool reference;
- typedef bool const_reference;
- typedef const bool* pointer;
- typedef _Bit_const_iterator const_iterator;
-
- unsigned int* _M_p;
- unsigned int _M_offset;
- void bump_up() {
- if (_M_offset++ == __WORD_BIT - 1) {
- _M_offset = 0;
- ++_M_p;
- }
- }
- void bump_down() {
- if (_M_offset-- == 0) {
- _M_offset = __WORD_BIT - 1;
- --_M_p;
- }
- }
-
- _Bit_const_iterator() : _M_p(0), _M_offset(0) {}
- _Bit_const_iterator(unsigned int* __x, unsigned int __y)
- : _M_p(__x), _M_offset(__y) {}
- _Bit_const_iterator(const _Bit_iterator& __x)
- : _M_p(__x._M_p), _M_offset(__x._M_offset) {}
- const_reference operator*() const {
- return _Bit_reference(_M_p, 1U << _M_offset);
- }
- const_iterator& operator++() {
- bump_up();
- return *this;
- }
- const_iterator operator++(int) {
- const_iterator __tmp = *this;
- bump_up();
- return __tmp;
- }
- const_iterator& operator--() {
- bump_down();
- return *this;
- }
- const_iterator operator--(int) {
- const_iterator __tmp = *this;
- bump_down();
- return __tmp;
- }
- const_iterator& operator+=(difference_type __i) {
- difference_type __n = __i + _M_offset;
- _M_p += __n / __WORD_BIT;
- __n = __n % __WORD_BIT;
- if (__n < 0) {
- _M_offset = (unsigned int) __n + __WORD_BIT;
- --_M_p;
- } else
- _M_offset = (unsigned int) __n;
- return *this;
- }
- const_iterator& operator-=(difference_type __i) {
- *this += -__i;
- return *this;
- }
- const_iterator operator+(difference_type __i) const {
- const_iterator __tmp = *this;
- return __tmp += __i;
- }
- const_iterator operator-(difference_type __i) const {
- const_iterator __tmp = *this;
- return __tmp -= __i;
- }
- difference_type operator-(const_iterator __x) const {
- return __WORD_BIT * (_M_p - __x._M_p) + _M_offset - __x._M_offset;
- }
- const_reference operator[](difference_type __i) {
- return *(*this + __i);
- }
- bool operator==(const const_iterator& __x) const {
- return _M_p == __x._M_p && _M_offset == __x._M_offset;
- }
- bool operator!=(const const_iterator& __x) const {
- return _M_p != __x._M_p || _M_offset != __x._M_offset;
- }
- bool operator<(const_iterator __x) const {
- return _M_p < __x._M_p || (_M_p == __x._M_p && _M_offset < __x._M_offset);
- }
-};
-
-// Bit-vector base class, which encapsulates the difference between
-// old SGI-style allocators and standard-conforming allocators.
-
-#ifdef __STL_USE_STD_ALLOCATORS
-
-// Base class for ordinary allocators.
-template <class _Allocator, bool __is_static>
-class _Bvector_alloc_base {
-public:
- typedef typename _Alloc_traits<bool, _Allocator>::allocator_type
- allocator_type;
- allocator_type get_allocator() const { return _M_data_allocator; }
-
- _Bvector_alloc_base(const allocator_type& __a)
- : _M_data_allocator(__a), _M_start(), _M_finish(), _M_end_of_storage(0) {}
-
-protected:
- unsigned int* _M_bit_alloc(size_t __n)
- { return _M_data_allocator.allocate((__n + __WORD_BIT - 1)/__WORD_BIT); }
- void _M_deallocate() {
- if (_M_start._M_p)
- _M_data_allocator.deallocate(_M_start._M_p,
- _M_end_of_storage - _M_start._M_p);
- }
-
- typename _Alloc_traits<unsigned int, _Allocator>::allocator_type
- _M_data_allocator;
- _Bit_iterator _M_start;
- _Bit_iterator _M_finish;
- unsigned int* _M_end_of_storage;
-};
-
-// Specialization for instanceless allocators.
-template <class _Allocator>
-class _Bvector_alloc_base<_Allocator, true> {
-public:
- typedef typename _Alloc_traits<bool, _Allocator>::allocator_type
- allocator_type;
- allocator_type get_allocator() const { return allocator_type(); }
-
- _Bvector_alloc_base(const allocator_type&)
- : _M_start(), _M_finish(), _M_end_of_storage(0) {}
-
-protected:
- typedef typename _Alloc_traits<unsigned int, _Allocator>::_Alloc_type
- _Alloc_type;
-
- unsigned int* _M_bit_alloc(size_t __n)
- { return _Alloc_type::allocate((__n + __WORD_BIT - 1)/__WORD_BIT); }
- void _M_deallocate() {
- if (_M_start._M_p)
- _Alloc_type::deallocate(_M_start._M_p,
- _M_end_of_storage - _M_start._M_p);
- }
-
- _Bit_iterator _M_start;
- _Bit_iterator _M_finish;
- unsigned int* _M_end_of_storage;
-};
-
-template <class _Alloc>
-class _Bvector_base
- : public _Bvector_alloc_base<_Alloc,
- _Alloc_traits<bool, _Alloc>::_S_instanceless>
-{
- typedef _Bvector_alloc_base<_Alloc,
- _Alloc_traits<bool, _Alloc>::_S_instanceless>
- _Base;
-public:
- typedef typename _Base::allocator_type allocator_type;
-
- _Bvector_base(const allocator_type& __a) : _Base(__a) {}
- ~_Bvector_base() { _Base::_M_deallocate(); }
-};
-
-#else /* __STL_USE_STD_ALLOCATORS */
-
-template <class _Alloc>
-class _Bvector_base
-{
-public:
- typedef _Alloc allocator_type;
- allocator_type get_allocator() const { return allocator_type(); }
-
- _Bvector_base(const allocator_type&)
- : _M_start(), _M_finish(), _M_end_of_storage(0) {}
- ~_Bvector_base() { _M_deallocate(); }
-
-protected:
- typedef simple_alloc<unsigned int, _Alloc> _Alloc_type;
-
- unsigned int* _M_bit_alloc(size_t __n)
- { return _Alloc_type::allocate((__n + __WORD_BIT - 1)/__WORD_BIT); }
- void _M_deallocate() {
- if (_M_start._M_p)
- _Alloc_type::deallocate(_M_start._M_p,
- _M_end_of_storage - _M_start._M_p);
- }
-
- _Bit_iterator _M_start;
- _Bit_iterator _M_finish;
- unsigned int* _M_end_of_storage;
-};
-
-#endif /* __STL_USE_STD_ALLOCATORS */
-
-// The next few lines are confusing. What we're doing is declaring a
-// partial specialization of vector<T, Alloc> if we have the necessary
-// compiler support. Otherwise, we define a class bit_vector which uses
-// the default allocator.
-
-#if defined(__STL_CLASS_PARTIAL_SPECIALIZATION) && !defined(__STL_NO_BOOL)
-#define __SGI_STL_VECBOOL_TEMPLATE
-#define __BVECTOR vector
-#else
-#undef __SGI_STL_VECBOOL_TEMPLATE
-#define __BVECTOR bit_vector
-#endif
-
-# ifdef __SGI_STL_VECBOOL_TEMPLATE
- __STL_END_NAMESPACE
-# include <stl_vector.h>
- __STL_BEGIN_NAMESPACE
-template<class _Alloc> class vector<bool,_Alloc>
- : public _Bvector_base<_Alloc>
-# else /* __SGI_STL_VECBOOL_TEMPLATE */
-class bit_vector
- : public _Bvector_base<__STL_DEFAULT_ALLOCATOR(bool) >
-# endif /* __SGI_STL_VECBOOL_TEMPLATE */
-{
-# ifdef __SGI_STL_VECBOOL_TEMPLATE
- typedef _Bvector_base<_Alloc> _Base;
-# else /* __SGI_STL_VECBOOL_TEMPLATE */
- typedef _Bvector_base<__STL_DEFAULT_ALLOCATOR(bool) > _Base;
-# endif /* __SGI_STL_VECBOOL_TEMPLATE */
-public:
- typedef bool value_type;
- typedef size_t size_type;
- typedef ptrdiff_t difference_type;
- typedef _Bit_reference reference;
- typedef bool const_reference;
- typedef _Bit_reference* pointer;
- typedef const bool* const_pointer;
-
- typedef _Bit_iterator iterator;
- typedef _Bit_const_iterator const_iterator;
-
-#ifdef __STL_CLASS_PARTIAL_SPECIALIZATION
- typedef reverse_iterator<const_iterator> const_reverse_iterator;
- typedef reverse_iterator<iterator> reverse_iterator;
-#else /* __STL_CLASS_PARTIAL_SPECIALIZATION */
- typedef reverse_iterator<const_iterator, value_type, const_reference,
- difference_type> const_reverse_iterator;
- typedef reverse_iterator<iterator, value_type, reference, difference_type>
- reverse_iterator;
-#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
-
- typedef typename _Base::allocator_type allocator_type;
- allocator_type get_allocator() const { return _Base::get_allocator(); }
-
-protected:
-#ifdef __STL_USE_NAMESPACES
- using _Base::_M_bit_alloc;
- using _Base::_M_deallocate;
- using _Base::_M_start;
- using _Base::_M_finish;
- using _Base::_M_end_of_storage;
-#endif /* __STL_USE_NAMESPACES */
-
-protected:
- void _M_initialize(size_type __n) {
- unsigned int* __q = _M_bit_alloc(__n);
- _M_end_of_storage = __q + (__n + __WORD_BIT - 1)/__WORD_BIT;
- _M_start = iterator(__q, 0);
- _M_finish = _M_start + difference_type(__n);
- }
- void _M_insert_aux(iterator __position, bool __x) {
- if (_M_finish._M_p != _M_end_of_storage) {
- copy_backward(__position, _M_finish, _M_finish + 1);
- *__position = __x;
- ++_M_finish;
- }
- else {
- size_type __len = size() ? 2 * size() : __WORD_BIT;
- unsigned int* __q = _M_bit_alloc(__len);
- iterator __i = copy(begin(), __position, iterator(__q, 0));
- *__i++ = __x;
- _M_finish = copy(__position, end(), __i);
- _M_deallocate();
- _M_end_of_storage = __q + (__len + __WORD_BIT - 1)/__WORD_BIT;
- _M_start = iterator(__q, 0);
- }
- }
-
-#ifdef __STL_MEMBER_TEMPLATES
- template <class _InputIterator>
- void _M_initialize_range(_InputIterator __first, _InputIterator __last,
- input_iterator_tag) {
- _M_start = iterator();
- _M_finish = iterator();
- _M_end_of_storage = 0;
- for ( ; __first != __last; ++__first)
- push_back(*__first);
- }
-
- template <class _ForwardIterator>
- void _M_initialize_range(_ForwardIterator __first, _ForwardIterator __last,
- forward_iterator_tag) {
- size_type __n = 0;
- distance(__first, __last, __n);
- _M_initialize(__n);
- copy(__first, __last, _M_start);
- }
-
- template <class _InputIterator>
- void _M_insert_range(iterator __pos,
- _InputIterator __first, _InputIterator __last,
- input_iterator_tag) {
- for ( ; __first != __last; ++__first) {
- __pos = insert(__pos, *__first);
- ++__pos;
- }
- }
-
- template <class _ForwardIterator>
- void _M_insert_range(iterator __position,
- _ForwardIterator __first, _ForwardIterator __last,
- forward_iterator_tag) {
- if (__first != __last) {
- size_type __n = 0;
- distance(__first, __last, __n);
- if (capacity() - size() >= __n) {
- copy_backward(__position, end(), _M_finish + difference_type(__n));
- copy(__first, __last, __position);
- _M_finish += difference_type(__n);
- }
- else {
- size_type __len = size() + max(size(), __n);
- unsigned int* __q = _M_bit_alloc(__len);
- iterator __i = copy(begin(), __position, iterator(__q, 0));
- __i = copy(__first, __last, __i);
- _M_finish = copy(__position, end(), __i);
- _M_deallocate();
- _M_end_of_storage = __q + (__len + __WORD_BIT - 1)/__WORD_BIT;
- _M_start = iterator(__q, 0);
- }
- }
- }
-
-#endif /* __STL_MEMBER_TEMPLATES */
-
-public:
- iterator begin() { return _M_start; }
- const_iterator begin() const { return _M_start; }
- iterator end() { return _M_finish; }
- const_iterator end() const { return _M_finish; }
-
- reverse_iterator rbegin() { return reverse_iterator(end()); }
- const_reverse_iterator rbegin() const {
- return const_reverse_iterator(end());
- }
- reverse_iterator rend() { return reverse_iterator(begin()); }
- const_reverse_iterator rend() const {
- return const_reverse_iterator(begin());
- }
-
- size_type size() const { return size_type(end() - begin()); }
- size_type max_size() const { return size_type(-1); }
- size_type capacity() const {
- return size_type(const_iterator(_M_end_of_storage, 0) - begin());
- }
- bool empty() const { return begin() == end(); }
- reference operator[](size_type __n) {
- return *(begin() + difference_type(__n));
- }
- const_reference operator[](size_type __n) const {
- return *(begin() + difference_type(__n));
- }
-
- explicit __BVECTOR(const allocator_type& __a = allocator_type())
- : _Base(__a) {}
-
- __BVECTOR(size_type __n, bool __value,
- const allocator_type& __a = allocator_type())
- : _Base(__a)
- {
- _M_initialize(__n);
- fill(_M_start._M_p, _M_end_of_storage, __value ? ~0 : 0);
- }
-
- explicit __BVECTOR(size_type __n)
- : _Base(allocator_type())
- {
- _M_initialize(__n);
- fill(_M_start._M_p, _M_end_of_storage, 0);
- }
-
- __BVECTOR(const __BVECTOR& __x) : _Base(__x.get_allocator()) {
- _M_initialize(__x.size());
- copy(__x.begin(), __x.end(), _M_start);
- }
-
-#ifdef __STL_MEMBER_TEMPLATES
- // Check whether it's an integral type. If so, it's not an iterator.
- template <class _InputIterator>
- __BVECTOR(_InputIterator __first, _InputIterator __last,
- const allocator_type& __a = allocator_type())
- : _Base(__a)
- {
- typedef typename _Is_integer<_InputIterator>::_Integral _Integral;
- _M_initialize_dispatch(__first, __last, _Integral());
- }
-
- template <class _Integer>
- void _M_initialize_dispatch(_Integer __n, _Integer __x, __true_type) {
- _M_initialize(__n);
- fill(_M_start._M_p, _M_end_of_storage, __x ? ~0 : 0);
- }
-
- template <class _InputIterator>
- void _M_initialize_dispatch(_InputIterator __first, _InputIterator __last,
- __false_type) {
- _M_initialize_range(__first, __last, __ITERATOR_CATEGORY(__first));
- }
-#else /* __STL_MEMBER_TEMPLATES */
- __BVECTOR(const_iterator __first, const_iterator __last,
- const allocator_type& __a = allocator_type())
- : _Base(__a)
- {
- size_type __n = 0;
- distance(__first, __last, __n);
- _M_initialize(__n);
- copy(__first, __last, _M_start);
- }
- __BVECTOR(const bool* __first, const bool* __last,
- const allocator_type& __a = allocator_type())
- : _Base(__a)
- {
- size_type __n = 0;
- distance(__first, __last, __n);
- _M_initialize(__n);
- copy(__first, __last, _M_start);
- }
-#endif /* __STL_MEMBER_TEMPLATES */
-
- ~__BVECTOR() { }
-
- __BVECTOR& operator=(const __BVECTOR& __x) {
- if (&__x == this) return *this;
- if (__x.size() > capacity()) {
- _M_deallocate();
- _M_initialize(__x.size());
- }
- copy(__x.begin(), __x.end(), begin());
- _M_finish = begin() + difference_type(__x.size());
- return *this;
- }
-
- // assign(), a generalized assignment member function. Two
- // versions: one that takes a count, and one that takes a range.
- // The range version is a member template, so we dispatch on whether
- // or not the type is an integer.
-
- void assign(size_t __n, bool __x) {
- if (__n > size()) {
- fill(_M_start._M_p, _M_end_of_storage, __x ? ~0 : 0);
- insert(end(), __n - size(), __x);
- }
- else {
- erase(begin() + __n, end());
- fill(_M_start._M_p, _M_end_of_storage, __x ? ~0 : 0);
- }
- }
-
-#ifdef __STL_MEMBER_TEMPLATES
-
- template <class _InputIterator>
- void assign(_InputIterator __first, _InputIterator __last) {
- typedef typename _Is_integer<_InputIterator>::_Integral _Integral;
- _M_assign_dispatch(__first, __last, _Integral());
- }
-
- template <class _Integer>
- void _M_assign_dispatch(_Integer __n, _Integer __val, __true_type)
- { assign((size_t) __n, (bool) __val); }
-
- template <class _InputIter>
- void _M_assign_dispatch(_InputIter __first, _InputIter __last, __false_type)
- { _M_assign_aux(__first, __last, __ITERATOR_CATEGORY(__first)); }
-
- template <class _InputIterator>
- void _M_assign_aux(_InputIterator __first, _InputIterator __last,
- input_iterator_tag) {
- iterator __cur = begin();
- for ( ; __first != __last && __cur != end(); ++__cur, ++__first)
- *__cur = *__first;
- if (__first == __last)
- erase(__cur, end());
- else
- insert(end(), __first, __last);
- }
-
- template <class _ForwardIterator>
- void _M_assign_aux(_ForwardIterator __first, _ForwardIterator __last,
- forward_iterator_tag) {
- size_type __len = 0;
- distance(__first, __last, __len);
- if (__len < size())
- erase(copy(__first, __last, begin()), end());
- else {
- _ForwardIterator __mid = __first;
- advance(__mid, size());
- copy(__first, __mid, begin());
- insert(end(), __mid, __last);
- }
- }
-
-#endif /* __STL_MEMBER_TEMPLATES */
-
- void reserve(size_type __n) {
- if (capacity() < __n) {
- unsigned int* __q = _M_bit_alloc(__n);
- _M_finish = copy(begin(), end(), iterator(__q, 0));
- _M_deallocate();
- _M_start = iterator(__q, 0);
- _M_end_of_storage = __q + (__n + __WORD_BIT - 1)/__WORD_BIT;
- }
- }
-
- reference front() { return *begin(); }
- const_reference front() const { return *begin(); }
- reference back() { return *(end() - 1); }
- const_reference back() const { return *(end() - 1); }
- void push_back(bool __x) {
- if (_M_finish._M_p != _M_end_of_storage)
- *_M_finish++ = __x;
- else
- _M_insert_aux(end(), __x);
- }
- void swap(__BVECTOR& __x) {
- __STD::swap(_M_start, __x._M_start);
- __STD::swap(_M_finish, __x._M_finish);
- __STD::swap(_M_end_of_storage, __x._M_end_of_storage);
- }
- iterator insert(iterator __position, bool __x = bool()) {
- difference_type __n = __position - begin();
- if (_M_finish._M_p != _M_end_of_storage && __position == end())
- *_M_finish++ = __x;
- else
- _M_insert_aux(__position, __x);
- return begin() + __n;
- }
-
-#ifdef __STL_MEMBER_TEMPLATES
- // Check whether it's an integral type. If so, it's not an iterator.
- template <class _InputIterator>
- void insert(iterator __position,
- _InputIterator __first, _InputIterator __last) {
- typedef typename _Is_integer<_InputIterator>::_Integral _Integral;
- _M_insert_dispatch(__position, __first, __last, _Integral());
- }
-
- template <class _Integer>
- void _M_insert_dispatch(iterator __pos, _Integer __n, _Integer __x,
- __true_type) {
- insert(__pos, (size_type) __n, (bool) __x);
- }
-
- template <class _InputIterator>
- void _M_insert_dispatch(iterator __pos,
- _InputIterator __first, _InputIterator __last,
- __false_type) {
- _M_insert_range(__pos, __first, __last, __ITERATOR_CATEGORY(__first));
- }
-#else /* __STL_MEMBER_TEMPLATES */
- void insert(iterator __position,
- const_iterator __first, const_iterator __last) {
- if (__first == __last) return;
- size_type __n = 0;
- distance(__first, __last, __n);
- if (capacity() - size() >= __n) {
- copy_backward(__position, end(), _M_finish + __n);
- copy(__first, __last, __position);
- _M_finish += __n;
- }
- else {
- size_type __len = size() + max(size(), __n);
- unsigned int* __q = _M_bit_alloc(__len);
- iterator __i = copy(begin(), __position, iterator(__q, 0));
- __i = copy(__first, __last, __i);
- _M_finish = copy(__position, end(), __i);
- _M_deallocate();
- _M_end_of_storage = __q + (__len + __WORD_BIT - 1)/__WORD_BIT;
- _M_start = iterator(__q, 0);
- }
- }
-
- void insert(iterator __position, const bool* __first, const bool* __last) {
- if (__first == __last) return;
- size_type __n = 0;
- distance(__first, __last, __n);
- if (capacity() - size() >= __n) {
- copy_backward(__position, end(), _M_finish + __n);
- copy(__first, __last, __position);
- _M_finish += __n;
- }
- else {
- size_type __len = size() + max(size(), __n);
- unsigned int* __q = _M_bit_alloc(__len);
- iterator __i = copy(begin(), __position, iterator(__q, 0));
- __i = copy(__first, __last, __i);
- _M_finish = copy(__position, end(), __i);
- _M_deallocate();
- _M_end_of_storage = __q + (__len + __WORD_BIT - 1)/__WORD_BIT;
- _M_start = iterator(__q, 0);
- }
- }
-#endif /* __STL_MEMBER_TEMPLATES */
-
- void insert(iterator __position, size_type __n, bool __x) {
- if (__n == 0) return;
- if (capacity() - size() >= __n) {
- copy_backward(__position, end(), _M_finish + difference_type(__n));
- fill(__position, __position + difference_type(__n), __x);
- _M_finish += difference_type(__n);
- }
- else {
- size_type __len = size() + max(size(), __n);
- unsigned int* __q = _M_bit_alloc(__len);
- iterator __i = copy(begin(), __position, iterator(__q, 0));
- fill_n(__i, __n, __x);
- _M_finish = copy(__position, end(), __i + difference_type(__n));
- _M_deallocate();
- _M_end_of_storage = __q + (__len + __WORD_BIT - 1)/__WORD_BIT;
- _M_start = iterator(__q, 0);
- }
- }
-
- void pop_back() { --_M_finish; }
- iterator erase(iterator __position) {
- if (__position + 1 != end())
- copy(__position + 1, end(), __position);
- --_M_finish;
- return __position;
- }
- iterator erase(iterator __first, iterator __last) {
- _M_finish = copy(__last, end(), __first);
- return __first;
- }
- void resize(size_type __new_size, bool __x = bool()) {
- if (__new_size < size())
- erase(begin() + difference_type(__new_size), end());
- else
- insert(end(), __new_size - size(), __x);
- }
- void clear() { erase(begin(), end()); }
-};
-
-#ifdef __SGI_STL_VECBOOL_TEMPLATE
-
-typedef vector<bool, alloc> bit_vector;
-
-#else /* __SGI_STL_VECBOOL_TEMPLATE */
-
-inline bool
-operator==(const bit_vector& __x, const bit_vector& __y)
-{
- return (__x.size() == __y.size() &&
- equal(__x.begin(), __x.end(), __y.begin()));
-}
-
-inline bool
-operator<(const bit_vector& __x, const bit_vector& __y)
-{
- return lexicographical_compare(__x.begin(), __x.end(),
- __y.begin(), __y.end());
-}
-
-#endif /* __SGI_STL_VECBOOL_TEMPLATE */
-
-#undef __SGI_STL_VECBOOL_TEMPLATE
-#undef __BVECTOR
-
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma reset woff 1174
-#pragma reset woff 1375
-#endif
-
-__STL_END_NAMESPACE
-
-#endif /* __SGI_STL_INTERNAL_BVECTOR_H */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/contrib/libstdc++/stl/stl_config.h b/contrib/libstdc++/stl/stl_config.h
deleted file mode 100644
index d72f9e1c7466..000000000000
--- a/contrib/libstdc++/stl/stl_config.h
+++ /dev/null
@@ -1,356 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- * Copyright (c) 1997
- * Silicon Graphics
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef __STL_CONFIG_H
-# define __STL_CONFIG_H
-
-// Flags:
-// * __STL_NO_BOOL: defined if the compiler doesn't have bool as a builtin
-// type.
-// * __STL_HAS_WCHAR_T: defined if the compier has wchar_t as a builtin type.
-// * __STL_NO_DRAND48: defined if the compiler doesn't have the drand48
-// function.
-// * __STL_STATIC_TEMPLATE_MEMBER_BUG: defined if the compiler can't handle
-// static members of template classes.
-// * __STL_CLASS_PARTIAL_SPECIALIZATION: defined if the compiler supports
-// partial specialization of template classes.
-// * __STL_PARTIAL_SPECIALIZATION_SYNTAX: defined if the compiler
-// supports partial specialization syntax for full specialization of
-// class templates. (Even if it doesn't actually support partial
-// specialization itself.)
-// * __STL_FUNCTION_TMPL_PARTIAL_ORDER: defined if the compiler supports
-// partial ordering of function templates. (a.k.a partial specialization
-// of function templates.)
-// * __STL_MEMBER_TEMPLATES: defined if the compiler supports template
-// member functions of classes.
-// * __STL_MEMBER_TEMPLATE_CLASSES: defined if the compiler supports
-// nested classes that are member templates of other classes.
-// * __STL_EXPLICIT_FUNCTION_TMPL_ARGS: defined if the compiler
-// supports calling a function template by providing its template
-// arguments explicitly.
-// * __STL_LIMITED_DEFAULT_TEMPLATES: defined if the compiler is unable
-// to handle default template parameters that depend on previous template
-// parameters.
-// * __STL_NON_TYPE_TMPL_PARAM_BUG: defined if the compiler has trouble with
-// function template argument deduction for non-type template parameters.
-// * __SGI_STL_NO_ARROW_OPERATOR: defined if the compiler is unable
-// to support the -> operator for iterators.
-// * __STL_USE_EXCEPTIONS: defined if the compiler (in the current compilation
-// mode) supports exceptions.
-// * __STL_USE_NAMESPACES: defined if the compiler has the necessary
-// support for namespaces.
-// * __STL_NO_EXCEPTION_HEADER: defined if the compiler does not have a
-// standard-conforming header <exception>.
-// * __STL_SGI_THREADS: defined if this is being compiled for an SGI IRIX
-// system in multithreaded mode, using native SGI threads instead of
-// pthreads.
-// * __STL_WIN32THREADS: defined if this is being compiled on a WIN32
-// compiler in multithreaded mode.
-// * __STL_LONG_LONG if the compiler has long long and unsigned long long
-// types. (They're not in the C++ standard, but they are expected to be
-// included in the forthcoming C9X standard.)
-
-
-// User-settable macros that control compilation:
-// * __STL_USE_SGI_ALLOCATORS: if defined, then the STL will use older
-// SGI-style allocators, instead of standard-conforming allocators,
-// even if the compiler supports all of the language features needed
-// for standard-conforming allocators.
-// * __STL_NO_NAMESPACES: if defined, don't put the library in namespace
-// std, even if the compiler supports namespaces.
-// * __STL_ASSERTIONS: if defined, then enable runtime checking through the
-// __stl_assert macro.
-// * _PTHREADS: if defined, use Posix threads for multithreading support.
-// * _NOTHREADS: if defined, don't use any multithreading support.
-
-
-// Other macros defined by this file:
-
-// * bool, true, and false, if __STL_NO_BOOL is defined.
-// * typename, as a null macro if it's not already a keyword.
-// * explicit, as a null macro if it's not already a keyword.
-// * namespace-related macros (__STD, __STL_BEGIN_NAMESPACE, etc.)
-// * exception-related macros (__STL_TRY, __STL_UNWIND, etc.)
-// * __stl_assert, either as a test or as a null macro, depending on
-// whether or not __STL_ASSERTIONS is defined.
-
-#ifdef _PTHREADS
-# define __STL_PTHREADS
-#endif
-#ifdef _SOLTHREADS
-# define __STL_SOLTHREADS
-#endif
-
-# if defined(__sgi) && !defined(__GNUC__)
-# if !defined(_BOOL)
-# define __STL_NO_BOOL
-# endif
-# if defined(_WCHAR_T_IS_KEYWORD)
-# define __STL_HAS_WCHAR_T
-# endif
-# if !defined(_TYPENAME_IS_KEYWORD)
-# define __STL_NEED_TYPENAME
-# endif
-# ifdef _PARTIAL_SPECIALIZATION_OF_CLASS_TEMPLATES
-# define __STL_CLASS_PARTIAL_SPECIALIZATION
-# endif
-# ifdef _MEMBER_TEMPLATES
-# define __STL_MEMBER_TEMPLATES
-# define __STL_MEMBER_TEMPLATE_CLASSES
-# endif
-# if defined(_MEMBER_TEMPLATE_KEYWORD)
-# define __STL_MEMBER_TEMPLATE_KEYWORD
-# endif
-# if (_COMPILER_VERSION >= 730) && defined(_MIPS_SIM) && _MIPS_SIM != _ABIO32
-# define __STL_MEMBER_TEMPLATE_KEYWORD
-# endif
-# if !defined(_EXPLICIT_IS_KEYWORD)
-# define __STL_NEED_EXPLICIT
-# endif
-# ifdef __EXCEPTIONS
-# define __STL_USE_EXCEPTIONS
-# endif
-# if (_COMPILER_VERSION >= 721) && defined(_NAMESPACES)
-# define __STL_HAS_NAMESPACES
-# endif
-# if (_COMPILER_VERSION < 721)
-# define __STL_NO_EXCEPTION_HEADER
-# endif
-# if !defined(_NOTHREADS) && !defined(__STL_PTHREADS)
-# define __STL_SGI_THREADS
-# endif
-# if defined(_LONGLONG) && defined(_SGIAPI) && _SGIAPI
-# define __STL_LONG_LONG
-# endif
-# endif
-
-# ifdef __GNUC__
-# include <_G_config.h>
-# define __STL_HAS_WCHAR_T
-# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8)
-# define __STL_STATIC_TEMPLATE_MEMBER_BUG
-# define __STL_NEED_TYPENAME
-# define __STL_NEED_EXPLICIT
-# else
-# define __STL_CLASS_PARTIAL_SPECIALIZATION
-# define __STL_FUNCTION_TMPL_PARTIAL_ORDER
-# define __STL_MEMBER_TEMPLATES
-# define __STL_MEMBER_TEMPLATE_CLASSES
-# define __STL_EXPLICIT_FUNCTION_TMPL_ARGS
-# define __STL_HAS_NAMESPACES
-# define __STL_NO_NAMESPACES
-# define __SGI_STL_USE_AUTO_PTR_CONVERSIONS
-# define __STL_USE_NAMESPACES
-# endif
-# if defined(__linux__)
- /* glibc pre 2.0 is very buggy. We have to disable thread for it.
- It should be upgraded to glibc 2.0 or later. */
-# if !defined(_NOTHREADS) && __GLIBC__ >= 2 && defined(_G_USING_THUNKS)
-# define __STL_PTHREADS
-# ifdef __STRICT_ANSI__
- /* Work around a bug in the glibc 2.0.x pthread.h. */
-# define sigset_t __sigset_t
-# endif
-# endif
-# endif
-# ifdef __EXCEPTIONS
-# define __STL_USE_EXCEPTIONS
-# endif
-# ifndef __STRICT_ANSI__
-# define __STL_LONG_LONG
-# endif
-# endif
-
-# if defined(__SUNPRO_CC)
-# define __STL_NO_BOOL
-# define __STL_NEED_TYPENAME
-# define __STL_NEED_EXPLICIT
-# define __STL_USE_EXCEPTIONS
-# endif
-
-# if defined(__COMO__)
-# define __STL_MEMBER_TEMPLATES
-# define __STL_MEMBER_TEMPLATE_CLASSES
-# define __STL_CLASS_PARTIAL_SPECIALIZATION
-# define __STL_USE_EXCEPTIONS
-# define __STL_HAS_NAMESPACES
-# endif
-
-# if defined(__MINGW32__)
-# define __STL_NO_DRAND48
-# endif
-
-# if defined(__CYGWIN__)
-# define __STL_NO_DRAND48
-# endif
-
-# if defined(_MSC_VER)
-# define __STL_NO_DRAND48
-# define __STL_NEED_TYPENAME
-# if _MSC_VER < 1100 /* 1000 is version 4.0, 1100 is 5.0, 1200 is 6.0. */
-# define __STL_NEED_EXPLICIT
-# define __STL_NO_BOOL
-# if _MSC_VER > 1000
-# include <yvals.h>
-# define __STL_DONT_USE_BOOL_TYPEDEF
-# endif
-# endif
-# define __STL_NON_TYPE_TMPL_PARAM_BUG
-# define __SGI_STL_NO_ARROW_OPERATOR
-# ifdef _CPPUNWIND
-# define __STL_USE_EXCEPTIONS
-# endif
-# ifdef _MT
-# define __STL_WIN32THREADS
-# endif
-# if _MSC_VER >= 1200
-# define __STL_PARTIAL_SPECIALIZATION_SYNTAX
-# define __STL_HAS_NAMESPACES
-# define __STL_NO_NAMESPACES
-# endif
-# endif
-
-# if defined(__BORLANDC__)
-# define __STL_NO_DRAND48
-# define __STL_NEED_TYPENAME
-# define __STL_LIMITED_DEFAULT_TEMPLATES
-# define __SGI_STL_NO_ARROW_OPERATOR
-# define __STL_NON_TYPE_TMPL_PARAM_BUG
-# ifdef _CPPUNWIND
-# define __STL_USE_EXCEPTIONS
-# endif
-# ifdef __MT__
-# define __STL_WIN32THREADS
-# endif
-# endif
-
-# if defined(__STL_NO_BOOL) && !defined(__STL_DONT_USE_BOOL_TYPEDEF)
- typedef int bool;
-# define true 1
-# define false 0
-# endif
-
-# ifdef __STL_NEED_TYPENAME
-# define typename
-# endif
-
-# ifdef __STL_MEMBER_TEMPLATE_KEYWORD
-# define __STL_TEMPLATE template
-# else
-# define __STL_TEMPLATE
-# endif
-
-# ifdef __STL_NEED_EXPLICIT
-# define explicit
-# endif
-
-# ifdef __STL_EXPLICIT_FUNCTION_TMPL_ARGS
-# define __STL_NULL_TMPL_ARGS <>
-# else
-# define __STL_NULL_TMPL_ARGS
-# endif
-
-# if defined(__STL_CLASS_PARTIAL_SPECIALIZATION) \
- || defined (__STL_PARTIAL_SPECIALIZATION_SYNTAX)
-# define __STL_TEMPLATE_NULL template<>
-# else
-# define __STL_TEMPLATE_NULL
-# endif
-
-// Use standard-conforming allocators if we have the necessary language
-// features. __STL_USE_SGI_ALLOCATORS is a hook so that users can
-// disable new-style allocators, and continue to use the same kind of
-// allocators as before, without having to edit library headers.
-# if defined(__STL_CLASS_PARTIAL_SPECIALIZATION) && \
- defined(__STL_MEMBER_TEMPLATES) && \
- defined(__STL_MEMBER_TEMPLATE_CLASSES) && \
- !defined(__STL_NO_BOOL) && \
- !defined(__STL_NON_TYPE_TMPL_PARAM_BUG) && \
- !defined(__STL_LIMITED_DEFAULT_TEMPLATES) && \
- !defined(__STL_USE_SGI_ALLOCATORS)
-# define __STL_USE_STD_ALLOCATORS
-# endif
-
-# ifndef __STL_DEFAULT_ALLOCATOR
-# ifdef __STL_USE_STD_ALLOCATORS
-# define __STL_DEFAULT_ALLOCATOR(T) allocator<T>
-# else
-# define __STL_DEFAULT_ALLOCATOR(T) alloc
-# endif
-# endif
-
-// __STL_NO_NAMESPACES is a hook so that users can disable namespaces
-// without having to edit library headers.
-# if defined(__STL_HAS_NAMESPACES) && !defined(__STL_NO_NAMESPACES)
-# define __STD std
-# define __STL_BEGIN_NAMESPACE namespace std {
-# define __STL_END_NAMESPACE }
-# define __STL_USE_NAMESPACE_FOR_RELOPS
-# define __STL_BEGIN_RELOPS_NAMESPACE namespace std {
-# define __STL_END_RELOPS_NAMESPACE }
-# define __STD_RELOPS std
-# define __STL_USE_NAMESPACES
-# else
-# define __STD
-# define __STL_BEGIN_NAMESPACE
-# define __STL_END_NAMESPACE
-# undef __STL_USE_NAMESPACE_FOR_RELOPS
-# define __STL_BEGIN_RELOPS_NAMESPACE
-# define __STL_END_RELOPS_NAMESPACE
-# define __STD_RELOPS
-# undef __STL_USE_NAMESPACES
-# endif
-
-# ifdef __STL_USE_EXCEPTIONS
-# define __STL_TRY try
-# define __STL_CATCH_ALL catch(...)
-# define __STL_THROW(x) throw x
-# define __STL_RETHROW throw
-# define __STL_NOTHROW throw()
-# define __STL_UNWIND(action) catch(...) { action; throw; }
-# else
-# define __STL_TRY
-# define __STL_CATCH_ALL if (false)
-# define __STL_THROW(x)
-# define __STL_RETHROW
-# define __STL_NOTHROW
-# define __STL_UNWIND(action)
-# endif
-
-#ifdef __STL_ASSERTIONS
-# include <stdio.h>
-# define __stl_assert(expr) \
- if (!(expr)) { fprintf(stderr, "%s:%d STL assertion failure: %s\n", \
- __FILE__, __LINE__, # expr); abort(); }
-#else
-# define __stl_assert(expr)
-#endif
-
-#endif /* __STL_CONFIG_H */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/contrib/libstdc++/stl/stl_construct.h b/contrib/libstdc++/stl/stl_construct.h
deleted file mode 100644
index 761784d57da0..000000000000
--- a/contrib/libstdc++/stl/stl_construct.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- *
- * Copyright (c) 1996,1997
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- */
-
-/* NOTE: This is an internal header file, included by other STL headers.
- * You should not attempt to use it directly.
- */
-
-#ifndef __SGI_STL_INTERNAL_CONSTRUCT_H
-#define __SGI_STL_INTERNAL_CONSTRUCT_H
-
-#include <new.h>
-
-__STL_BEGIN_NAMESPACE
-
-// construct and destroy. These functions are not part of the C++ standard,
-// and are provided for backward compatibility with the HP STL.
-
-template <class _Tp>
-inline void destroy(_Tp* __pointer) {
- __pointer->~_Tp();
-}
-
-template <class _T1, class _T2>
-inline void construct(_T1* __p, const _T2& __value) {
- new (__p) _T1(__value);
-}
-
-template <class _T1>
-inline void construct(_T1* __p) {
- new (__p) _T1();
-}
-
-template <class _ForwardIterator>
-inline void
-__destroy_aux(_ForwardIterator __first, _ForwardIterator __last, __false_type)
-{
- for ( ; __first != __last; ++__first)
- destroy(&*__first);
-}
-
-template <class _ForwardIterator>
-inline void __destroy_aux(_ForwardIterator, _ForwardIterator, __true_type) {}
-
-template <class _ForwardIterator, class _Tp>
-inline void
-__destroy(_ForwardIterator __first, _ForwardIterator __last, _Tp*)
-{
- typedef typename __type_traits<_Tp>::has_trivial_destructor
- _Trivial_destructor;
- __destroy_aux(__first, __last, _Trivial_destructor());
-}
-
-template <class _ForwardIterator>
-inline void destroy(_ForwardIterator __first, _ForwardIterator __last) {
- __destroy(__first, __last, __VALUE_TYPE(__first));
-}
-
-inline void destroy(char*, char*) {}
-inline void destroy(wchar_t*, wchar_t*) {}
-
-__STL_END_NAMESPACE
-
-#endif /* __SGI_STL_INTERNAL_CONSTRUCT_H */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/contrib/libstdc++/stl/stl_deque.h b/contrib/libstdc++/stl/stl_deque.h
deleted file mode 100644
index 24a8bfb1bc8f..000000000000
--- a/contrib/libstdc++/stl/stl_deque.h
+++ /dev/null
@@ -1,1698 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- *
- * Copyright (c) 1997
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- */
-
-/* NOTE: This is an internal header file, included by other STL headers.
- * You should not attempt to use it directly.
- */
-
-#ifndef __SGI_STL_INTERNAL_DEQUE_H
-#define __SGI_STL_INTERNAL_DEQUE_H
-
-/* Class invariants:
- * For any nonsingular iterator i:
- * i.node is the address of an element in the map array. The
- * contents of i.node is a pointer to the beginning of a node.
- * i.first == *(i.node)
- * i.last == i.first + node_size
- * i.cur is a pointer in the range [i.first, i.last). NOTE:
- * the implication of this is that i.cur is always a dereferenceable
- * pointer, even if i is a past-the-end iterator.
- * Start and Finish are always nonsingular iterators. NOTE: this means
- * that an empty deque must have one node, and that a deque
- * with N elements, where N is the buffer size, must have two nodes.
- * For every node other than start.node and finish.node, every element
- * in the node is an initialized object. If start.node == finish.node,
- * then [start.cur, finish.cur) are initialized objects, and
- * the elements outside that range are uninitialized storage. Otherwise,
- * [start.cur, start.last) and [finish.first, finish.cur) are initialized
- * objects, and [start.first, start.cur) and [finish.cur, finish.last)
- * are uninitialized storage.
- * [map, map + map_size) is a valid, non-empty range.
- * [start.node, finish.node] is a valid range contained within
- * [map, map + map_size).
- * A pointer in the range [map, map + map_size) points to an allocated node
- * if and only if the pointer is in the range [start.node, finish.node].
- */
-
-
-/*
- * In previous versions of deque, node_size was fixed by the
- * implementation. In this version, however, users can select
- * the node size. Deque has three template parameters; the third,
- * a number of type size_t, is the number of elements per node.
- * If the third template parameter is 0 (which is the default),
- * then deque will use a default node size.
- *
- * The only reason for using an alternate node size is if your application
- * requires a different performance tradeoff than the default. If,
- * for example, your program contains many deques each of which contains
- * only a few elements, then you might want to save memory (possibly
- * by sacrificing some speed) by using smaller nodes.
- *
- * Unfortunately, some compilers have trouble with non-type template
- * parameters; stl_config.h defines __STL_NON_TYPE_TMPL_PARAM_BUG if
- * that is the case. If your compiler is one of them, then you will
- * not be able to use alternate node sizes; you will have to use the
- * default value.
- */
-
-__STL_BEGIN_NAMESPACE
-
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma set woff 1174
-#pragma set woff 1375
-#endif
-
-// Note: this function is simply a kludge to work around several compilers'
-// bugs in handling constant expressions.
-inline size_t
-__deque_buf_size(size_t __n, size_t __size)
-{
- return __n != 0 ? __n : (__size < 512 ? size_t(512 / __size) : size_t(1));
-}
-
-#ifndef __STL_NON_TYPE_TMPL_PARAM_BUG
-template <class _Tp, class _Ref, class _Ptr, size_t __bufsiz>
-struct _Deque_iterator {
- typedef _Deque_iterator<_Tp,_Tp&,_Tp*,__bufsiz> iterator;
- typedef _Deque_iterator<_Tp,const _Tp&,const _Tp*,__bufsiz> const_iterator;
- static size_t
- _S_buffer_size() { return __deque_buf_size(__bufsiz, sizeof(_Tp)); }
-#else /* __STL_NON_TYPE_TMPL_PARAM_BUG */
-template <class _Tp, class _Ref, class _Ptr>
-struct _Deque_iterator {
- typedef _Deque_iterator<_Tp, _Tp&, _Tp*> iterator;
- typedef _Deque_iterator<_Tp, const _Tp&, const _Tp*> const_iterator;
- static size_t
- _S_buffer_size() { return __deque_buf_size(0, sizeof(_Tp)); }
-#endif
-
- typedef random_access_iterator_tag iterator_category;
- typedef _Tp value_type;
- typedef _Ptr pointer;
- typedef _Ref reference;
- typedef size_t size_type;
- typedef ptrdiff_t difference_type;
- typedef _Tp** _Map_pointer;
-
- typedef _Deque_iterator _Self;
-
- _Tp* _M_cur;
- _Tp* _M_first;
- _Tp* _M_last;
- _Map_pointer _M_node;
-
- _Deque_iterator(_Tp* __x, _Map_pointer __y)
- : _M_cur(__x), _M_first(*__y),
- _M_last(*__y + _S_buffer_size()), _M_node(__y) {}
- _Deque_iterator() : _M_cur(0), _M_first(0), _M_last(0), _M_node(0) {}
- _Deque_iterator(const iterator& __x)
- : _M_cur(__x._M_cur), _M_first(__x._M_first),
- _M_last(__x._M_last), _M_node(__x._M_node) {}
-
- reference operator*() const { return *_M_cur; }
-#ifndef __SGI_STL_NO_ARROW_OPERATOR
- pointer operator->() const { return _M_cur; }
-#endif /* __SGI_STL_NO_ARROW_OPERATOR */
-
- difference_type operator-(const _Self& __x) const {
- return difference_type(_S_buffer_size()) * (_M_node - __x._M_node - 1) +
- (_M_cur - _M_first) + (__x._M_last - __x._M_cur);
- }
-
- _Self& operator++() {
- ++_M_cur;
- if (_M_cur == _M_last) {
- _M_set_node(_M_node + 1);
- _M_cur = _M_first;
- }
- return *this;
- }
- _Self operator++(int) {
- _Self __tmp = *this;
- ++*this;
- return __tmp;
- }
-
- _Self& operator--() {
- if (_M_cur == _M_first) {
- _M_set_node(_M_node - 1);
- _M_cur = _M_last;
- }
- --_M_cur;
- return *this;
- }
- _Self operator--(int) {
- _Self __tmp = *this;
- --*this;
- return __tmp;
- }
-
- _Self& operator+=(difference_type __n)
- {
- difference_type __offset = __n + (_M_cur - _M_first);
- if (__offset >= 0 && __offset < difference_type(_S_buffer_size()))
- _M_cur += __n;
- else {
- difference_type __node_offset =
- __offset > 0 ? __offset / difference_type(_S_buffer_size())
- : -difference_type((-__offset - 1) / _S_buffer_size()) - 1;
- _M_set_node(_M_node + __node_offset);
- _M_cur = _M_first +
- (__offset - __node_offset * difference_type(_S_buffer_size()));
- }
- return *this;
- }
-
- _Self operator+(difference_type __n) const
- {
- _Self __tmp = *this;
- return __tmp += __n;
- }
-
- _Self& operator-=(difference_type __n) { return *this += -__n; }
-
- _Self operator-(difference_type __n) const {
- _Self __tmp = *this;
- return __tmp -= __n;
- }
-
- reference operator[](difference_type __n) const { return *(*this + __n); }
-
- bool operator==(const _Self& __x) const { return _M_cur == __x._M_cur; }
- bool operator!=(const _Self& __x) const { return !(*this == __x); }
- bool operator<(const _Self& __x) const {
- return (_M_node == __x._M_node) ?
- (_M_cur < __x._M_cur) : (_M_node < __x._M_node);
- }
-
- void _M_set_node(_Map_pointer __new_node) {
- _M_node = __new_node;
- _M_first = *__new_node;
- _M_last = _M_first + difference_type(_S_buffer_size());
- }
-};
-
-#ifndef __STL_CLASS_PARTIAL_SPECIALIZATION
-
-#ifndef __STL_NON_TYPE_TMPL_PARAM_BUG
-
-template <class _Tp, class _Ref, class _Ptr, size_t __bufsiz>
-inline random_access_iterator_tag
-iterator_category(const _Deque_iterator<_Tp,_Ref,_Ptr,__bufsiz>&) {
- return random_access_iterator_tag();
-}
-
-template <class _Tp, class _Ref, class _Ptr, size_t __bufsiz>
-inline _Tp*
-value_type(const _Deque_iterator<_Tp,_Ref,_Ptr,__bufsiz>&) {
- return 0;
-}
-
-template <class _Tp, class _Ref, class _Ptr, size_t __bufsiz>
-inline ptrdiff_t*
-distance_type(const _Deque_iterator<_Tp,_Ref,_Ptr,__bufsiz>&) {
- return 0;
-}
-
-#else /* __STL_NON_TYPE_TMPL_PARAM_BUG */
-
-template <class _Tp, class _Ref, class _Ptr>
-inline random_access_iterator_tag
-iterator_category(const _Deque_iterator<_Tp,_Ref,_Ptr>&)
-{
- return random_access_iterator_tag();
-}
-
-template <class _Tp, class _Ref, class _Ptr>
-inline _Tp*
-value_type(const _Deque_iterator<_Tp,_Ref,_Ptr>&) { return 0; }
-
-template <class _Tp, class _Ref, class _Ptr>
-inline ptrdiff_t*
-distance_type(const _Deque_iterator<_Tp,_Ref,_Ptr>&) {
- return 0;
-}
-
-#endif /* __STL_NON_TYPE_TMPL_PARAM_BUG */
-
-#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
-
-// Deque base class. It has two purposes. First, its constructor
-// and destructor allocate (but don't initialize) storage. This makes
-// exception safety easier. Second, the base class encapsulates all of
-// the differences between SGI-style allocators and standard-conforming
-// allocators.
-
-#ifdef __STL_USE_STD_ALLOCATORS
-
-// Base class for ordinary allocators.
-template <class _Tp, class _Alloc, size_t __bufsiz, bool __is_static>
-class _Deque_alloc_base {
-public:
- typedef typename _Alloc_traits<_Tp,_Alloc>::allocator_type allocator_type;
- allocator_type get_allocator() const { return node_allocator; }
-
- _Deque_alloc_base(const allocator_type& __a)
- : node_allocator(__a), map_allocator(__a), _M_map(0), _M_map_size(0)
- {}
-
-protected:
- typedef typename _Alloc_traits<_Tp*, _Alloc>::allocator_type
- map_allocator_type;
-
- allocator_type node_allocator;
- map_allocator_type map_allocator;
-
- _Tp* _M_allocate_node() {
- return node_allocator.allocate(__deque_buf_size(__bufsiz,sizeof(_Tp)));
- }
- void _M_deallocate_node(_Tp* __p) {
- node_allocator.deallocate(__p, __deque_buf_size(__bufsiz,sizeof(_Tp)));
- }
- _Tp** _M_allocate_map(size_t __n)
- { return map_allocator.allocate(__n); }
- void _M_deallocate_map(_Tp** __p, size_t __n)
- { map_allocator.deallocate(__p, __n); }
-
- _Tp** _M_map;
- size_t _M_map_size;
-};
-
-// Specialization for instanceless allocators.
-template <class _Tp, class _Alloc, size_t __bufsiz>
-class _Deque_alloc_base<_Tp, _Alloc, __bufsiz, true>
-{
-public:
- typedef typename _Alloc_traits<_Tp,_Alloc>::allocator_type allocator_type;
- allocator_type get_allocator() const { return allocator_type(); }
-
- _Deque_alloc_base(const allocator_type&) : _M_map(0), _M_map_size(0) {}
-
-protected:
- typedef typename _Alloc_traits<_Tp, _Alloc>::_Alloc_type _Node_alloc_type;
- typedef typename _Alloc_traits<_Tp*, _Alloc>::_Alloc_type _Map_alloc_type;
-
- _Tp* _M_allocate_node()
- { return _Node_alloc_type::allocate(__deque_buf_size(__bufsiz,
- sizeof(_Tp))); }
- void _M_deallocate_node(_Tp* __p)
- { _Node_alloc_type::deallocate(__p, __deque_buf_size(__bufsiz,
- sizeof(_Tp))); }
- _Tp** _M_allocate_map(size_t __n)
- { return _Map_alloc_type::allocate(__n); }
- void _M_deallocate_map(_Tp** __p, size_t __n)
- { _Map_alloc_type::deallocate(__p, __n); }
-
- _Tp** _M_map;
- size_t _M_map_size;
-};
-
-template <class _Tp, class _Alloc, size_t __bufsiz>
-class _Deque_base
- : public _Deque_alloc_base<_Tp,_Alloc,__bufsiz,
- _Alloc_traits<_Tp, _Alloc>::_S_instanceless>
-{
-public:
- typedef _Deque_alloc_base<_Tp,_Alloc,__bufsiz,
- _Alloc_traits<_Tp, _Alloc>::_S_instanceless>
- _Base;
- typedef typename _Base::allocator_type allocator_type;
- typedef _Deque_iterator<_Tp,_Tp&,_Tp*,__bufsiz> iterator;
- typedef _Deque_iterator<_Tp,const _Tp&,const _Tp*, __bufsiz> const_iterator;
-
- _Deque_base(const allocator_type& __a, size_t __num_elements)
- : _Base(__a), _M_start(), _M_finish()
- { _M_initialize_map(__num_elements); }
- _Deque_base(const allocator_type& __a)
- : _Base(__a), _M_start(), _M_finish() {}
- ~_Deque_base();
-
-protected:
- void _M_initialize_map(size_t);
- void _M_create_nodes(_Tp** __nstart, _Tp** __nfinish);
- void _M_destroy_nodes(_Tp** __nstart, _Tp** __nfinish);
- enum { _S_initial_map_size = 8 };
-
-protected:
- iterator _M_start;
- iterator _M_finish;
-};
-
-#else /* __STL_USE_STD_ALLOCATORS */
-
-template <class _Tp, class _Alloc, size_t __bufsiz>
-class _Deque_base {
-public:
-#ifndef __STL_NON_TYPE_TMPL_PARAM_BUG
- typedef _Deque_iterator<_Tp,_Tp&,_Tp*,__bufsiz> iterator;
- typedef _Deque_iterator<_Tp,const _Tp&,const _Tp*, __bufsiz> const_iterator;
-#else /* __STL_NON_TYPE_TMPL_PARAM_BUG */
- typedef _Deque_iterator<_Tp,_Tp&,_Tp*> iterator;
- typedef _Deque_iterator<_Tp,const _Tp&,const _Tp*> const_iterator;
-#endif /* __STL_NON_TYPE_TMPL_PARAM_BUG */
-
- typedef _Alloc allocator_type;
- allocator_type get_allocator() const { return allocator_type(); }
-
- _Deque_base(const allocator_type&, size_t __num_elements)
- : _M_map(0), _M_map_size(0), _M_start(), _M_finish() {
- _M_initialize_map(__num_elements);
- }
- _Deque_base(const allocator_type&)
- : _M_map(0), _M_map_size(0), _M_start(), _M_finish() {}
- ~_Deque_base();
-
-protected:
- void _M_initialize_map(size_t);
- void _M_create_nodes(_Tp** __nstart, _Tp** __nfinish);
- void _M_destroy_nodes(_Tp** __nstart, _Tp** __nfinish);
- enum { _S_initial_map_size = 8 };
-
-protected:
- _Tp** _M_map;
- size_t _M_map_size;
- iterator _M_start;
- iterator _M_finish;
-
- typedef simple_alloc<_Tp, _Alloc> _Node_alloc_type;
- typedef simple_alloc<_Tp*, _Alloc> _Map_alloc_type;
-
- _Tp* _M_allocate_node()
- { return _Node_alloc_type::allocate(__deque_buf_size(__bufsiz,
- sizeof(_Tp))); }
- void _M_deallocate_node(_Tp* __p)
- { _Node_alloc_type::deallocate(__p, __deque_buf_size(__bufsiz,
- sizeof(_Tp))); }
- _Tp** _M_allocate_map(size_t __n)
- { return _Map_alloc_type::allocate(__n); }
- void _M_deallocate_map(_Tp** __p, size_t __n)
- { _Map_alloc_type::deallocate(__p, __n); }
-};
-
-#endif /* __STL_USE_STD_ALLOCATORS */
-
-// Non-inline member functions from _Deque_base.
-
-template <class _Tp, class _Alloc, size_t __bufsiz>
-_Deque_base<_Tp,_Alloc,__bufsiz>::~_Deque_base() {
- if (_M_map) {
- _M_destroy_nodes(_M_start._M_node, _M_finish._M_node + 1);
- _M_deallocate_map(_M_map, _M_map_size);
- }
-}
-
-template <class _Tp, class _Alloc, size_t __bufsiz>
-void
-_Deque_base<_Tp,_Alloc,__bufsiz>::_M_initialize_map(size_t __num_elements)
-{
- size_t __num_nodes =
- __num_elements / __deque_buf_size(__bufsiz, sizeof(_Tp)) + 1;
-
- _M_map_size = max((size_t) _S_initial_map_size, __num_nodes + 2);
- _M_map = _M_allocate_map(_M_map_size);
-
- _Tp** __nstart = _M_map + (_M_map_size - __num_nodes) / 2;
- _Tp** __nfinish = __nstart + __num_nodes;
-
- __STL_TRY {
- _M_create_nodes(__nstart, __nfinish);
- }
- __STL_UNWIND((_M_deallocate_map(_M_map, _M_map_size),
- _M_map = 0, _M_map_size = 0));
- _M_start._M_set_node(__nstart);
- _M_finish._M_set_node(__nfinish - 1);
- _M_start._M_cur = _M_start._M_first;
- _M_finish._M_cur = _M_finish._M_first +
- __num_elements % __deque_buf_size(__bufsiz, sizeof(_Tp));
-}
-
-template <class _Tp, class _Alloc, size_t __bufsiz>
-void
-_Deque_base<_Tp,_Alloc,__bufsiz>::_M_create_nodes(_Tp** __nstart,
- _Tp** __nfinish)
-{
- _Tp** __cur;
- __STL_TRY {
- for (__cur = __nstart; __cur < __nfinish; ++__cur)
- *__cur = _M_allocate_node();
- }
- __STL_UNWIND(_M_destroy_nodes(__nstart, __cur));
-}
-
-template <class _Tp, class _Alloc, size_t __bufsiz>
-void
-_Deque_base<_Tp,_Alloc,__bufsiz>::_M_destroy_nodes(_Tp** __nstart,
- _Tp** __nfinish)
-{
- for (_Tp** __n = __nstart; __n < __nfinish; ++__n)
- _M_deallocate_node(*__n);
-}
-
-// See __deque_buf_size(). The only reason that the default value is 0
-// is as a workaround for bugs in the way that some compilers handle
-// constant expressions.
-template <class _Tp, class _Alloc = __STL_DEFAULT_ALLOCATOR(_Tp),
- size_t __bufsiz = 0>
-class deque : protected _Deque_base<_Tp, _Alloc, __bufsiz> {
- typedef _Deque_base<_Tp, _Alloc, __bufsiz> _Base;
-public: // Basic types
- typedef _Tp value_type;
- typedef value_type* pointer;
- typedef const value_type* const_pointer;
- typedef value_type& reference;
- typedef const value_type& const_reference;
- typedef size_t size_type;
- typedef ptrdiff_t difference_type;
-
- typedef typename _Base::allocator_type allocator_type;
- allocator_type get_allocator() const { return _Base::get_allocator(); }
-
-public: // Iterators
- typedef typename _Base::iterator iterator;
- typedef typename _Base::const_iterator const_iterator;
-
-#ifdef __STL_CLASS_PARTIAL_SPECIALIZATION
- typedef reverse_iterator<const_iterator> const_reverse_iterator;
- typedef reverse_iterator<iterator> reverse_iterator;
-#else /* __STL_CLASS_PARTIAL_SPECIALIZATION */
- typedef reverse_iterator<const_iterator, value_type, const_reference,
- difference_type>
- const_reverse_iterator;
- typedef reverse_iterator<iterator, value_type, reference, difference_type>
- reverse_iterator;
-#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
-
-protected: // Internal typedefs
- typedef pointer* _Map_pointer;
- static size_t _S_buffer_size()
- { return __deque_buf_size(__bufsiz, sizeof(_Tp)); }
-
-protected:
-#ifdef __STL_USE_NAMESPACES
- using _Base::_M_initialize_map;
- using _Base::_M_create_nodes;
- using _Base::_M_destroy_nodes;
- using _Base::_M_allocate_node;
- using _Base::_M_deallocate_node;
- using _Base::_M_allocate_map;
- using _Base::_M_deallocate_map;
-
- using _Base::_M_map;
- using _Base::_M_map_size;
- using _Base::_M_start;
- using _Base::_M_finish;
-#endif /* __STL_USE_NAMESPACES */
-
-public: // Basic accessors
- iterator begin() { return _M_start; }
- iterator end() { return _M_finish; }
- const_iterator begin() const { return _M_start; }
- const_iterator end() const { return _M_finish; }
-
- reverse_iterator rbegin() { return reverse_iterator(_M_finish); }
- reverse_iterator rend() { return reverse_iterator(_M_start); }
- const_reverse_iterator rbegin() const
- { return const_reverse_iterator(_M_finish); }
- const_reverse_iterator rend() const
- { return const_reverse_iterator(_M_start); }
-
- reference operator[](size_type __n)
- { return _M_start[difference_type(__n)]; }
- const_reference operator[](size_type __n) const
- { return _M_start[difference_type(__n)]; }
-
- reference front() { return *_M_start; }
- reference back() {
- iterator __tmp = _M_finish;
- --__tmp;
- return *__tmp;
- }
- const_reference front() const { return *_M_start; }
- const_reference back() const {
- const_iterator __tmp = _M_finish;
- --__tmp;
- return *__tmp;
- }
-
- size_type size() const { return _M_finish - _M_start;; }
- size_type max_size() const { return size_type(-1); }
- bool empty() const { return _M_finish == _M_start; }
-
-public: // Constructor, destructor.
- explicit deque(const allocator_type& __a = allocator_type())
- : _Base(__a, 0) {}
- deque(const deque& __x) : _Base(__x.get_allocator(), __x.size())
- { uninitialized_copy(__x.begin(), __x.end(), _M_start); }
- deque(size_type __n, const value_type& __value,
- const allocator_type& __a = allocator_type()) : _Base(__a, __n)
- { _M_fill_initialize(__value); }
- explicit deque(size_type __n) : _Base(allocator_type(), __n)
- { _M_fill_initialize(value_type()); }
-
-#ifdef __STL_MEMBER_TEMPLATES
-
- // Check whether it's an integral type. If so, it's not an iterator.
- template <class _InputIterator>
- deque(_InputIterator __first, _InputIterator __last,
- const allocator_type& __a = allocator_type()) : _Base(__a) {
- typedef typename _Is_integer<_InputIterator>::_Integral _Integral;
- _M_initialize_dispatch(__first, __last, _Integral());
- }
-
- template <class _Integer>
- void _M_initialize_dispatch(_Integer __n, _Integer __x, __true_type) {
- _M_initialize_map(__n);
- _M_fill_initialize(__x);
- }
-
- template <class _InputIter>
- void _M_initialize_dispatch(_InputIter __first, _InputIter __last,
- __false_type) {
- _M_range_initialize(__first, __last, __ITERATOR_CATEGORY(__first));
- }
-
-#else /* __STL_MEMBER_TEMPLATES */
-
- deque(const value_type* __first, const value_type* __last,
- const allocator_type& __a = allocator_type())
- : _Base(__a, __last - __first)
- { uninitialized_copy(__first, __last, _M_start); }
- deque(const_iterator __first, const_iterator __last,
- const allocator_type& __a = allocator_type())
- : _Base(__a, __last - __first)
- { uninitialized_copy(__first, __last, _M_start); }
-
-#endif /* __STL_MEMBER_TEMPLATES */
-
- ~deque() { destroy(_M_start, _M_finish); }
-
- deque& operator= (const deque& __x) {
- const size_type __len = size();
- if (&__x != this) {
- if (__len >= __x.size())
- erase(copy(__x.begin(), __x.end(), _M_start), _M_finish);
- else {
- const_iterator __mid = __x.begin() + difference_type(__len);
- copy(__x.begin(), __mid, _M_start);
- insert(_M_finish, __mid, __x.end());
- }
- }
- return *this;
- }
-
- void swap(deque& __x) {
- __STD::swap(_M_start, __x._M_start);
- __STD::swap(_M_finish, __x._M_finish);
- __STD::swap(_M_map, __x._M_map);
- __STD::swap(_M_map_size, __x._M_map_size);
- }
-
-public:
- // assign(), a generalized assignment member function. Two
- // versions: one that takes a count, and one that takes a range.
- // The range version is a member template, so we dispatch on whether
- // or not the type is an integer.
-
- void assign(size_type __n, const _Tp& __val) {
- if (__n > size()) {
- fill(begin(), end(), __val);
- insert(end(), __n - size(), __val);
- }
- else {
- erase(begin() + __n, end());
- fill(begin(), end(), __val);
- }
- }
-
-#ifdef __STL_MEMBER_TEMPLATES
-
- template <class _InputIterator>
- void assign(_InputIterator __first, _InputIterator __last) {
- typedef typename _Is_integer<_InputIterator>::_Integral _Integral;
- _M_assign_dispatch(__first, __last, _Integral());
- }
-
-private: // helper functions for assign()
-
- template <class _Integer>
- void _M_assign_dispatch(_Integer __n, _Integer __val, __true_type)
- { assign((size_type) __n, (_Tp) __val); }
-
- template <class _InputIterator>
- void _M_assign_dispatch(_InputIterator __first, _InputIterator __last,
- __false_type) {
- _M_assign_aux(__first, __last, __ITERATOR_CATEGORY(__first));
- }
-
- template <class _InputIterator>
- void _M_assign_aux(_InputIterator __first, _InputIterator __last,
- input_iterator_tag);
-
- template <class _ForwardIterator>
- void _M_assign_aux(_ForwardIterator __first, _ForwardIterator __last,
- forward_iterator_tag) {
- size_type __len = 0;
- distance(__first, __last, __len);
- if (__len > size()) {
- _ForwardIterator __mid = __first;
- advance(__mid, size());
- copy(__first, __mid, begin());
- insert(end(), __mid, __last);
- }
- else
- erase(copy(__first, __last, begin()), end());
- }
-
-#endif /* __STL_MEMBER_TEMPLATES */
-
-public: // push_* and pop_*
-
- void push_back(const value_type& __t) {
- if (_M_finish._M_cur != _M_finish._M_last - 1) {
- construct(_M_finish._M_cur, __t);
- ++_M_finish._M_cur;
- }
- else
- _M_push_back_aux(__t);
- }
-
- void push_back() {
- if (_M_finish._M_cur != _M_finish._M_last - 1) {
- construct(_M_finish._M_cur);
- ++_M_finish._M_cur;
- }
- else
- _M_push_back_aux();
- }
-
- void push_front(const value_type& __t) {
- if (_M_start._M_cur != _M_start._M_first) {
- construct(_M_start._M_cur - 1, __t);
- --_M_start._M_cur;
- }
- else
- _M_push_front_aux(__t);
- }
-
- void push_front() {
- if (_M_start._M_cur != _M_start._M_first) {
- construct(_M_start._M_cur - 1);
- --_M_start._M_cur;
- }
- else
- _M_push_front_aux();
- }
-
-
- void pop_back() {
- if (_M_finish._M_cur != _M_finish._M_first) {
- --_M_finish._M_cur;
- destroy(_M_finish._M_cur);
- }
- else
- _M_pop_back_aux();
- }
-
- void pop_front() {
- if (_M_start._M_cur != _M_start._M_last - 1) {
- destroy(_M_start._M_cur);
- ++_M_start._M_cur;
- }
- else
- _M_pop_front_aux();
- }
-
-public: // Insert
-
- iterator insert(iterator position, const value_type& __x) {
- if (position._M_cur == _M_start._M_cur) {
- push_front(__x);
- return _M_start;
- }
- else if (position._M_cur == _M_finish._M_cur) {
- push_back(__x);
- iterator __tmp = _M_finish;
- --__tmp;
- return __tmp;
- }
- else {
- return _M_insert_aux(position, __x);
- }
- }
-
- iterator insert(iterator __position)
- { return insert(__position, value_type()); }
-
- void insert(iterator __pos, size_type __n, const value_type& __x);
-
-#ifdef __STL_MEMBER_TEMPLATES
-
- // Check whether it's an integral type. If so, it's not an iterator.
- template <class _InputIterator>
- void insert(iterator __pos, _InputIterator __first, _InputIterator __last) {
- typedef typename _Is_integer<_InputIterator>::_Integral _Integral;
- _M_insert_dispatch(__pos, __first, __last, _Integral());
- }
-
- template <class _Integer>
- void _M_insert_dispatch(iterator __pos, _Integer __n, _Integer __x,
- __true_type) {
- insert(__pos, (size_type) __n, (value_type) __x);
- }
-
- template <class _InputIterator>
- void _M_insert_dispatch(iterator __pos,
- _InputIterator __first, _InputIterator __last,
- __false_type) {
- insert(__pos, __first, __last, __ITERATOR_CATEGORY(__first));
- }
-
-#else /* __STL_MEMBER_TEMPLATES */
-
- void insert(iterator __pos,
- const value_type* __first, const value_type* __last);
- void insert(iterator __pos,
- const_iterator __first, const_iterator __last);
-
-#endif /* __STL_MEMBER_TEMPLATES */
-
- void resize(size_type __new_size, const value_type& __x) {
- const size_type __len = size();
- if (__new_size < __len)
- erase(_M_start + __new_size, _M_finish);
- else
- insert(_M_finish, __new_size - __len, __x);
- }
-
- void resize(size_type new_size) { resize(new_size, value_type()); }
-
-public: // Erase
- iterator erase(iterator __pos) {
- iterator __next = __pos;
- ++__next;
- difference_type __index = __pos - _M_start;
- if (static_cast<size_type>(__index) < (size() >> 1)) {
- copy_backward(_M_start, __pos, __next);
- pop_front();
- }
- else {
- copy(__next, _M_finish, __pos);
- pop_back();
- }
- return _M_start + __index;
- }
-
- iterator erase(iterator __first, iterator __last);
- void clear();
-
-protected: // Internal construction/destruction
-
- void _M_fill_initialize(const value_type& __value);
-
-#ifdef __STL_MEMBER_TEMPLATES
-
- template <class _InputIterator>
- void _M_range_initialize(_InputIterator __first, _InputIterator __last,
- input_iterator_tag);
-
- template <class _ForwardIterator>
- void _M_range_initialize(_ForwardIterator __first, _ForwardIterator __last,
- forward_iterator_tag);
-
-#endif /* __STL_MEMBER_TEMPLATES */
-
-protected: // Internal push_* and pop_*
-
- void _M_push_back_aux(const value_type&);
- void _M_push_back_aux();
- void _M_push_front_aux(const value_type&);
- void _M_push_front_aux();
- void _M_pop_back_aux();
- void _M_pop_front_aux();
-
-protected: // Internal insert functions
-
-#ifdef __STL_MEMBER_TEMPLATES
-
- template <class _InputIterator>
- void insert(iterator __pos, _InputIterator __first, _InputIterator __last,
- input_iterator_tag);
-
- template <class _ForwardIterator>
- void insert(iterator __pos,
- _ForwardIterator __first, _ForwardIterator __last,
- forward_iterator_tag);
-
-#endif /* __STL_MEMBER_TEMPLATES */
-
- iterator _M_insert_aux(iterator __pos, const value_type& __x);
- iterator _M_insert_aux(iterator __pos);
- void _M_insert_aux(iterator __pos, size_type __n, const value_type& __x);
-
-#ifdef __STL_MEMBER_TEMPLATES
-
- template <class _ForwardIterator>
- void _M_insert_aux(iterator __pos,
- _ForwardIterator __first, _ForwardIterator __last,
- size_type __n);
-
-#else /* __STL_MEMBER_TEMPLATES */
-
- void _M_insert_aux(iterator __pos,
- const value_type* __first, const value_type* __last,
- size_type __n);
-
- void _M_insert_aux(iterator __pos,
- const_iterator __first, const_iterator __last,
- size_type __n);
-
-#endif /* __STL_MEMBER_TEMPLATES */
-
- iterator _M_reserve_elements_at_front(size_type __n) {
- size_type __vacancies = _M_start._M_cur - _M_start._M_first;
- if (__n > __vacancies)
- _M_new_elements_at_front(__n - __vacancies);
- return _M_start - difference_type(__n);
- }
-
- iterator _M_reserve_elements_at_back(size_type __n) {
- size_type __vacancies = (_M_finish._M_last - _M_finish._M_cur) - 1;
- if (__n > __vacancies)
- _M_new_elements_at_back(__n - __vacancies);
- return _M_finish + difference_type(__n);
- }
-
- void _M_new_elements_at_front(size_type __new_elements);
- void _M_new_elements_at_back(size_type __new_elements);
-
-protected: // Allocation of _M_map and nodes
-
- // Makes sure the _M_map has space for new nodes. Does not actually
- // add the nodes. Can invalidate _M_map pointers. (And consequently,
- // deque iterators.)
-
- void _M_reserve_map_at_back (size_type __nodes_to_add = 1) {
- if (__nodes_to_add + 1 > _M_map_size - (_M_finish._M_node - _M_map))
- _M_reallocate_map(__nodes_to_add, false);
- }
-
- void _M_reserve_map_at_front (size_type __nodes_to_add = 1) {
- if (__nodes_to_add > size_type(_M_start._M_node - _M_map))
- _M_reallocate_map(__nodes_to_add, true);
- }
-
- void _M_reallocate_map(size_type __nodes_to_add, bool __add_at_front);
-
-#ifdef __STL_NON_TYPE_TMPL_PARAM_BUG
-public:
- bool operator==(const deque<_Tp,_Alloc,0>& __x) const {
- return size() == __x.size() && equal(begin(), end(), __x.begin());
- }
- bool operator!=(const deque<_Tp,_Alloc,0>& __x) const {
- return size() != __x.size() || !equal(begin(), end(), __x.begin());
- }
- bool operator<(const deque<_Tp,_Alloc,0>& __x) const {
- return lexicographical_compare(begin(), end(), __x.begin(), __x.end());
- }
-#endif /* __STL_NON_TYPE_TMPL_PARAM_BUG */
-};
-
-// Non-inline member functions
-
-#ifdef __STL_MEMBER_TEMPLATES
-
-template <class _Tp, class _Alloc, size_t __bufsize>
-template <class _InputIter>
-void deque<_Tp, _Alloc, __bufsize>
- ::_M_assign_aux(_InputIter __first, _InputIter __last, input_iterator_tag)
-{
- iterator __cur = begin();
- for ( ; __first != __last && __cur != end(); ++__cur, ++__first)
- *__cur = *__first;
- if (__first == __last)
- erase(__cur, end());
- else
- insert(end(), __first, __last);
-}
-
-#endif /* __STL_MEMBER_TEMPLATES */
-
-template <class _Tp, class _Alloc, size_t __bufsize>
-void
-deque<_Tp, _Alloc, __bufsize>::insert(iterator __pos,
- size_type __n, const value_type& __x)
-{
- if (__pos._M_cur == _M_start._M_cur) {
- iterator __new_start = _M_reserve_elements_at_front(__n);
- uninitialized_fill(__new_start, _M_start, __x);
- _M_start = __new_start;
- }
- else if (__pos._M_cur == _M_finish._M_cur) {
- iterator __new_finish = _M_reserve_elements_at_back(__n);
- uninitialized_fill(_M_finish, __new_finish, __x);
- _M_finish = __new_finish;
- }
- else
- _M_insert_aux(__pos, __n, __x);
-}
-
-#ifndef __STL_MEMBER_TEMPLATES
-
-template <class _Tp, class _Alloc, size_t __bufsize>
-void deque<_Tp, _Alloc, __bufsize>::insert(iterator __pos,
- const value_type* __first,
- const value_type* __last) {
- size_type __n = __last - __first;
- if (__pos._M_cur == _M_start._M_cur) {
- iterator __new_start = _M_reserve_elements_at_front(__n);
- __STL_TRY {
- uninitialized_copy(__first, __last, __new_start);
- _M_start = __new_start;
- }
- __STL_UNWIND(_M_destroy_nodes(__new_start._M_node, _M_start._M_node));
- }
- else if (__pos._M_cur == _M_finish._M_cur) {
- iterator __new_finish = _M_reserve_elements_at_back(__n);
- __STL_TRY {
- uninitialized_copy(__first, __last, _M_finish);
- _M_finish = __new_finish;
- }
- __STL_UNWIND(_M_destroy_nodes(_M_finish._M_node + 1,
- __new_finish._M_node + 1));
- }
- else
- _M_insert_aux(__pos, __first, __last, __n);
-}
-
-template <class _Tp, class _Alloc, size_t __bufsize>
-void deque<_Tp,_Alloc,__bufsize>::insert(iterator __pos,
- const_iterator __first,
- const_iterator __last)
-{
- size_type __n = __last - __first;
- if (__pos._M_cur == _M_start._M_cur) {
- iterator __new_start = _M_reserve_elements_at_front(__n);
- __STL_TRY {
- uninitialized_copy(__first, __last, __new_start);
- _M_start = __new_start;
- }
- __STL_UNWIND(_M_destroy_nodes(__new_start._M_node, _M_start._M_node));
- }
- else if (__pos._M_cur == _M_finish._M_cur) {
- iterator __new_finish = _M_reserve_elements_at_back(__n);
- __STL_TRY {
- uninitialized_copy(__first, __last, _M_finish);
- _M_finish = __new_finish;
- }
- __STL_UNWIND(_M_destroy_nodes(_M_finish._M_node + 1,
- __new_finish._M_node + 1));
- }
- else
- _M_insert_aux(__pos, __first, __last, __n);
-}
-
-#endif /* __STL_MEMBER_TEMPLATES */
-
-template <class _Tp, class _Alloc, size_t __bufsize>
-deque<_Tp,_Alloc,__bufsize>::iterator
-deque<_Tp,_Alloc,__bufsize>::erase(iterator __first, iterator __last)
-{
- if (__first == _M_start && __last == _M_finish) {
- clear();
- return _M_finish;
- }
- else {
- difference_type __n = __last - __first;
- difference_type __elems_before = __first - _M_start;
- if (static_cast<size_type>(__elems_before) < (size() - __n) / 2) {
- copy_backward(_M_start, __first, __last);
- iterator __new_start = _M_start + __n;
- destroy(_M_start, __new_start);
- _M_destroy_nodes(__new_start._M_node, _M_start._M_node);
- _M_start = __new_start;
- }
- else {
- copy(__last, _M_finish, __first);
- iterator __new_finish = _M_finish - __n;
- destroy(__new_finish, _M_finish);
- _M_destroy_nodes(__new_finish._M_node + 1, _M_finish._M_node + 1);
- _M_finish = __new_finish;
- }
- return _M_start + __elems_before;
- }
-}
-
-template <class _Tp, class _Alloc, size_t __bufsize>
-void deque<_Tp,_Alloc,__bufsize>::clear()
-{
- for (_Map_pointer __node = _M_start._M_node + 1;
- __node < _M_finish._M_node;
- ++__node) {
- destroy(*__node, *__node + _S_buffer_size());
- _M_deallocate_node(*__node);
- }
-
- if (_M_start._M_node != _M_finish._M_node) {
- destroy(_M_start._M_cur, _M_start._M_last);
- destroy(_M_finish._M_first, _M_finish._M_cur);
- _M_deallocate_node(_M_finish._M_first);
- }
- else
- destroy(_M_start._M_cur, _M_finish._M_cur);
-
- _M_finish = _M_start;
-}
-
-// Precondition: _M_start and _M_finish have already been initialized,
-// but none of the deque's elements have yet been constructed.
-template <class _Tp, class _Alloc, size_t __bufsize>
-void
-deque<_Tp,_Alloc,__bufsize>::_M_fill_initialize(const value_type& __value) {
- _Map_pointer __cur;
- __STL_TRY {
- for (__cur = _M_start._M_node; __cur < _M_finish._M_node; ++__cur)
- uninitialized_fill(*__cur, *__cur + _S_buffer_size(), __value);
- uninitialized_fill(_M_finish._M_first, _M_finish._M_cur, __value);
- }
- __STL_UNWIND(destroy(_M_start, iterator(*__cur, __cur)));
-}
-
-#ifdef __STL_MEMBER_TEMPLATES
-
-template <class _Tp, class _Alloc, size_t __bufsize>
-template <class _InputIterator>
-void
-deque<_Tp,_Alloc,__bufsize>::_M_range_initialize(_InputIterator __first,
- _InputIterator __last,
- input_iterator_tag)
-{
- _M_initialize_map(0);
- for ( ; __first != __last; ++__first)
- push_back(*__first);
-}
-
-template <class _Tp, class _Alloc, size_t __bufsize>
-template <class _ForwardIterator>
-void
-deque<_Tp,_Alloc,__bufsize>::_M_range_initialize(_ForwardIterator __first,
- _ForwardIterator __last,
- forward_iterator_tag)
-{
- size_type __n = 0;
- distance(__first, __last, __n);
- _M_initialize_map(__n);
-
- _Map_pointer __cur_node;
- __STL_TRY {
- for (__cur_node = _M_start._M_node;
- __cur_node < _M_finish._M_node;
- ++__cur_node) {
- _ForwardIterator __mid = __first;
- advance(__mid, _S_buffer_size());
- uninitialized_copy(__first, __mid, *__cur_node);
- __first = __mid;
- }
- uninitialized_copy(__first, __last, _M_finish._M_first);
- }
- __STL_UNWIND(destroy(_M_start, iterator(*__cur_node, __cur_node)));
-}
-
-#endif /* __STL_MEMBER_TEMPLATES */
-
-// Called only if _M_finish._M_cur == _M_finish._M_last - 1.
-template <class _Tp, class _Alloc, size_t __bufsize>
-void
-deque<_Tp,_Alloc,__bufsize>::_M_push_back_aux(const value_type& __t)
-{
- value_type __t_copy = __t;
- _M_reserve_map_at_back();
- *(_M_finish._M_node + 1) = _M_allocate_node();
- __STL_TRY {
- construct(_M_finish._M_cur, __t_copy);
- _M_finish._M_set_node(_M_finish._M_node + 1);
- _M_finish._M_cur = _M_finish._M_first;
- }
- __STL_UNWIND(_M_deallocate_node(*(_M_finish._M_node + 1)));
-}
-
-// Called only if _M_finish._M_cur == _M_finish._M_last - 1.
-template <class _Tp, class _Alloc, size_t __bufsize>
-void
-deque<_Tp,_Alloc,__bufsize>::_M_push_back_aux()
-{
- _M_reserve_map_at_back();
- *(_M_finish._M_node + 1) = _M_allocate_node();
- __STL_TRY {
- construct(_M_finish._M_cur);
- _M_finish._M_set_node(_M_finish._M_node + 1);
- _M_finish._M_cur = _M_finish._M_first;
- }
- __STL_UNWIND(_M_deallocate_node(*(_M_finish._M_node + 1)));
-}
-
-// Called only if _M_start._M_cur == _M_start._M_first.
-template <class _Tp, class _Alloc, size_t __bufsize>
-void
-deque<_Tp,_Alloc,__bufsize>::_M_push_front_aux(const value_type& __t)
-{
- value_type __t_copy = __t;
- _M_reserve_map_at_front();
- *(_M_start._M_node - 1) = _M_allocate_node();
- __STL_TRY {
- _M_start._M_set_node(_M_start._M_node - 1);
- _M_start._M_cur = _M_start._M_last - 1;
- construct(_M_start._M_cur, __t_copy);
- }
- __STL_UNWIND((++_M_start, _M_deallocate_node(*(_M_start._M_node - 1))));
-}
-
-// Called only if _M_start._M_cur == _M_start._M_first.
-template <class _Tp, class _Alloc, size_t __bufsize>
-void
-deque<_Tp,_Alloc,__bufsize>::_M_push_front_aux()
-{
- _M_reserve_map_at_front();
- *(_M_start._M_node - 1) = _M_allocate_node();
- __STL_TRY {
- _M_start._M_set_node(_M_start._M_node - 1);
- _M_start._M_cur = _M_start._M_last - 1;
- construct(_M_start._M_cur);
- }
- __STL_UNWIND((++_M_start, _M_deallocate_node(*(_M_start._M_node - 1))));
-}
-
-// Called only if _M_finish._M_cur == _M_finish._M_first.
-template <class _Tp, class _Alloc, size_t __bufsize>
-void
-deque<_Tp,_Alloc,__bufsize>::_M_pop_back_aux()
-{
- _M_deallocate_node(_M_finish._M_first);
- _M_finish._M_set_node(_M_finish._M_node - 1);
- _M_finish._M_cur = _M_finish._M_last - 1;
- destroy(_M_finish._M_cur);
-}
-
-// Called only if _M_start._M_cur == _M_start._M_last - 1. Note that
-// if the deque has at least one element (a precondition for this member
-// function), and if _M_start._M_cur == _M_start._M_last, then the deque
-// must have at least two nodes.
-template <class _Tp, class _Alloc, size_t __bufsize>
-void
-deque<_Tp,_Alloc,__bufsize>::_M_pop_front_aux()
-{
- destroy(_M_start._M_cur);
- _M_deallocate_node(_M_start._M_first);
- _M_start._M_set_node(_M_start._M_node + 1);
- _M_start._M_cur = _M_start._M_first;
-}
-
-#ifdef __STL_MEMBER_TEMPLATES
-
-template <class _Tp, class _Alloc, size_t __bufsize>
-template <class _InputIterator>
-void
-deque<_Tp,_Alloc,__bufsize>::insert(iterator __pos,
- _InputIterator __first,
- _InputIterator __last,
- input_iterator_tag)
-{
- copy(__first, __last, inserter(*this, __pos));
-}
-
-template <class _Tp, class _Alloc, size_t __bufsize>
-template <class _ForwardIterator>
-void
-deque<_Tp,_Alloc,__bufsize>::insert(iterator __pos,
- _ForwardIterator __first,
- _ForwardIterator __last,
- forward_iterator_tag) {
- size_type __n = 0;
- distance(__first, __last, __n);
- if (__pos._M_cur == _M_start._M_cur) {
- iterator __new_start = _M_reserve_elements_at_front(__n);
- __STL_TRY {
- uninitialized_copy(__first, __last, __new_start);
- _M_start = __new_start;
- }
- __STL_UNWIND(_M_destroy_nodes(__new_start._M_node, _M_start._M_node));
- }
- else if (__pos._M_cur == _M_finish._M_cur) {
- iterator __new_finish = _M_reserve_elements_at_back(__n);
- __STL_TRY {
- uninitialized_copy(__first, __last, _M_finish);
- _M_finish = __new_finish;
- }
- __STL_UNWIND(_M_destroy_nodes(_M_finish._M_node + 1,
- __new_finish._M_node + 1));
- }
- else
- _M_insert_aux(__pos, __first, __last, __n);
-}
-
-#endif /* __STL_MEMBER_TEMPLATES */
-
-template <class _Tp, class _Alloc, size_t __bufsize>
-typename deque<_Tp, _Alloc, __bufsize>::iterator
-deque<_Tp,_Alloc,__bufsize>::_M_insert_aux(iterator __pos,
- const value_type& __x)
-{
- difference_type __index = __pos - _M_start;
- value_type __x_copy = __x;
- if (static_cast<size_type>(__index) < size() / 2) {
- push_front(front());
- iterator __front1 = _M_start;
- ++__front1;
- iterator __front2 = __front1;
- ++__front2;
- __pos = _M_start + __index;
- iterator __pos1 = __pos;
- ++__pos1;
- copy(__front2, __pos1, __front1);
- }
- else {
- push_back(back());
- iterator __back1 = _M_finish;
- --__back1;
- iterator __back2 = __back1;
- --__back2;
- __pos = _M_start + __index;
- copy_backward(__pos, __back2, __back1);
- }
- *__pos = __x_copy;
- return __pos;
-}
-
-template <class _Tp, class _Alloc, size_t __bufsize>
-typename deque<_Tp,_Alloc,__bufsize>::iterator
-deque<_Tp,_Alloc,__bufsize>::_M_insert_aux(iterator __pos)
-{
- difference_type __index = __pos - _M_start;
- if (static_cast<size_type>(__index) < size() / 2) {
- push_front(front());
- iterator __front1 = _M_start;
- ++__front1;
- iterator __front2 = __front1;
- ++__front2;
- __pos = _M_start + __index;
- iterator __pos1 = __pos;
- ++__pos1;
- copy(__front2, __pos1, __front1);
- }
- else {
- push_back(back());
- iterator __back1 = _M_finish;
- --__back1;
- iterator __back2 = __back1;
- --__back2;
- __pos = _M_start + __index;
- copy_backward(__pos, __back2, __back1);
- }
- *__pos = value_type();
- return __pos;
-}
-
-template <class _Tp, class _Alloc, size_t __bufsize>
-void
-deque<_Tp,_Alloc,__bufsize>::_M_insert_aux(iterator __pos,
- size_type __n,
- const value_type& __x)
-{
- const difference_type __elems_before = __pos - _M_start;
- size_type __length = size();
- value_type __x_copy = __x;
- if (static_cast<size_type>(__elems_before) < __length / 2) {
- iterator __new_start = _M_reserve_elements_at_front(__n);
- iterator __old_start = _M_start;
- __pos = _M_start + __elems_before;
- __STL_TRY {
- if (__elems_before >= difference_type(__n)) {
- iterator __start_n = _M_start + difference_type(__n);
- uninitialized_copy(_M_start, __start_n, __new_start);
- _M_start = __new_start;
- copy(__start_n, __pos, __old_start);
- fill(__pos - difference_type(__n), __pos, __x_copy);
- }
- else {
- __uninitialized_copy_fill(_M_start, __pos, __new_start,
- _M_start, __x_copy);
- _M_start = __new_start;
- fill(__old_start, __pos, __x_copy);
- }
- }
- __STL_UNWIND(_M_destroy_nodes(__new_start._M_node, _M_start._M_node));
- }
- else {
- iterator __new_finish = _M_reserve_elements_at_back(__n);
- iterator __old_finish = _M_finish;
- const difference_type __elems_after =
- difference_type(__length) - __elems_before;
- __pos = _M_finish - __elems_after;
- __STL_TRY {
- if (__elems_after > difference_type(__n)) {
- iterator __finish_n = _M_finish - difference_type(__n);
- uninitialized_copy(__finish_n, _M_finish, _M_finish);
- _M_finish = __new_finish;
- copy_backward(__pos, __finish_n, __old_finish);
- fill(__pos, __pos + difference_type(__n), __x_copy);
- }
- else {
- __uninitialized_fill_copy(_M_finish, __pos + difference_type(__n),
- __x_copy, __pos, _M_finish);
- _M_finish = __new_finish;
- fill(__pos, __old_finish, __x_copy);
- }
- }
- __STL_UNWIND(_M_destroy_nodes(_M_finish._M_node + 1,
- __new_finish._M_node + 1));
- }
-}
-
-#ifdef __STL_MEMBER_TEMPLATES
-
-template <class _Tp, class _Alloc, size_t __bufsize>
-template <class _ForwardIterator>
-void
-deque<_Tp,_Alloc,__bufsize>::_M_insert_aux(iterator __pos,
- _ForwardIterator __first,
- _ForwardIterator __last,
- size_type __n)
-{
- const difference_type __elemsbefore = __pos - _M_start;
- size_type __length = size();
- if (static_cast<size_type>(__elemsbefore) < __length / 2) {
- iterator __new_start = _M_reserve_elements_at_front(__n);
- iterator __old_start = _M_start;
- __pos = _M_start + __elemsbefore;
- __STL_TRY {
- if (__elemsbefore >= difference_type(__n)) {
- iterator __start_n = _M_start + difference_type(__n);
- uninitialized_copy(_M_start, __start_n, __new_start);
- _M_start = __new_start;
- copy(__start_n, __pos, __old_start);
- copy(__first, __last, __pos - difference_type(__n));
- }
- else {
- _ForwardIterator __mid = __first;
- advance(__mid, difference_type(__n) - __elemsbefore);
- __uninitialized_copy_copy(_M_start, __pos, __first, __mid,
- __new_start);
- _M_start = __new_start;
- copy(__mid, __last, __old_start);
- }
- }
- __STL_UNWIND(_M_destroy_nodes(__new_start._M_node, _M_start._M_node));
- }
- else {
- iterator __new_finish = _M_reserve_elements_at_back(__n);
- iterator __old_finish = _M_finish;
- const difference_type __elemsafter =
- difference_type(__length) - __elemsbefore;
- __pos = _M_finish - __elemsafter;
- __STL_TRY {
- if (__elemsafter > difference_type(__n)) {
- iterator __finish_n = _M_finish - difference_type(__n);
- uninitialized_copy(__finish_n, _M_finish, _M_finish);
- _M_finish = __new_finish;
- copy_backward(__pos, __finish_n, __old_finish);
- copy(__first, __last, __pos);
- }
- else {
- _ForwardIterator __mid = __first;
- advance(__mid, __elemsafter);
- __uninitialized_copy_copy(__mid, __last, __pos, _M_finish, _M_finish);
- _M_finish = __new_finish;
- copy(__first, __mid, __pos);
- }
- }
- __STL_UNWIND(_M_destroy_nodes(_M_finish._M_node + 1,
- __new_finish._M_node + 1));
- }
-}
-
-#else /* __STL_MEMBER_TEMPLATES */
-
-template <class _Tp, class _Alloc, size_t __bufsize>
-void
-deque<_Tp,_Alloc,__bufsize>::_M_insert_aux(iterator __pos,
- const value_type* __first,
- const value_type* __last,
- size_type __n)
-{
- const difference_type __elemsbefore = __pos - _M_start;
- size_type __length = size();
- if (__elemsbefore < __length / 2) {
- iterator __new_start = _M_reserve_elements_at_front(__n);
- iterator __old_start = _M_start;
- __pos = _M_start + __elemsbefore;
- __STL_TRY {
- if (__elemsbefore >= difference_type(__n)) {
- iterator __start_n = _M_start + difference_type(__n);
- uninitialized_copy(_M_start, __start_n, __new_start);
- _M_start = __new_start;
- copy(__start_n, __pos, __old_start);
- copy(__first, __last, __pos - difference_type(__n));
- }
- else {
- const value_type* __mid =
- __first + (difference_type(__n) - __elemsbefore);
- __uninitialized_copy_copy(_M_start, __pos, __first, __mid,
- __new_start);
- _M_start = __new_start;
- copy(__mid, __last, __old_start);
- }
- }
- __STL_UNWIND(_M_destroy_nodes(__new_start._M_node, _M_start._M_node));
- }
- else {
- iterator __new_finish = _M_reserve_elements_at_back(__n);
- iterator __old_finish = _M_finish;
- const difference_type __elemsafter =
- difference_type(__length) - __elemsbefore;
- __pos = _M_finish - __elemsafter;
- __STL_TRY {
- if (__elemsafter > difference_type(__n)) {
- iterator __finish_n = _M_finish - difference_type(__n);
- uninitialized_copy(__finish_n, _M_finish, _M_finish);
- _M_finish = __new_finish;
- copy_backward(__pos, __finish_n, __old_finish);
- copy(__first, __last, __pos);
- }
- else {
- const value_type* __mid = __first + __elemsafter;
- __uninitialized_copy_copy(__mid, __last, __pos, _M_finish, _M_finish);
- _M_finish = __new_finish;
- copy(__first, __mid, __pos);
- }
- }
- __STL_UNWIND(_M_destroy_nodes(_M_finish._M_node + 1,
- __new_finish._M_node + 1));
- }
-}
-
-template <class _Tp, class _Alloc, size_t __bufsize>
-void
-deque<_Tp,_Alloc,__bufsize>::_M_insert_aux(iterator __pos,
- const_iterator __first,
- const_iterator __last,
- size_type __n)
-{
- const difference_type __elemsbefore = __pos - _M_start;
- size_type __length = size();
- if (__elemsbefore < __length / 2) {
- iterator __new_start = _M_reserve_elements_at_front(__n);
- iterator __old_start = _M_start;
- __pos = _M_start + __elemsbefore;
- __STL_TRY {
- if (__elemsbefore >= __n) {
- iterator __start_n = _M_start + __n;
- uninitialized_copy(_M_start, __start_n, __new_start);
- _M_start = __new_start;
- copy(__start_n, __pos, __old_start);
- copy(__first, __last, __pos - difference_type(__n));
- }
- else {
- const_iterator __mid = __first + (__n - __elemsbefore);
- __uninitialized_copy_copy(_M_start, __pos, __first, __mid,
- __new_start);
- _M_start = __new_start;
- copy(__mid, __last, __old_start);
- }
- }
- __STL_UNWIND(_M_destroy_nodes(__new_start._M_node, _M_start._M_node));
- }
- else {
- iterator __new_finish = _M_reserve_elements_at_back(__n);
- iterator __old_finish = _M_finish;
- const difference_type __elemsafter = __length - __elemsbefore;
- __pos = _M_finish - __elemsafter;
- __STL_TRY {
- if (__elemsafter > __n) {
- iterator __finish_n = _M_finish - difference_type(__n);
- uninitialized_copy(__finish_n, _M_finish, _M_finish);
- _M_finish = __new_finish;
- copy_backward(__pos, __finish_n, __old_finish);
- copy(__first, __last, __pos);
- }
- else {
- const_iterator __mid = __first + __elemsafter;
- __uninitialized_copy_copy(__mid, __last, __pos, _M_finish, _M_finish);
- _M_finish = __new_finish;
- copy(__first, __mid, __pos);
- }
- }
- __STL_UNWIND(_M_destroy_nodes(_M_finish._M_node + 1,
- __new_finish._M_node + 1));
- }
-}
-
-#endif /* __STL_MEMBER_TEMPLATES */
-
-template <class _Tp, class _Alloc, size_t __bufsize>
-void
-deque<_Tp,_Alloc,__bufsize>::_M_new_elements_at_front(size_type __new_elems)
-{
- size_type __new_nodes
- = (__new_elems + _S_buffer_size() - 1) / _S_buffer_size();
- _M_reserve_map_at_front(__new_nodes);
- size_type __i;
- __STL_TRY {
- for (__i = 1; __i <= __new_nodes; ++__i)
- *(_M_start._M_node - __i) = _M_allocate_node();
- }
-# ifdef __STL_USE_EXCEPTIONS
- catch(...) {
- for (size_type __j = 1; __j < __i; ++__j)
- _M_deallocate_node(*(_M_start._M_node - __j));
- throw;
- }
-# endif /* __STL_USE_EXCEPTIONS */
-}
-
-template <class _Tp, class _Alloc, size_t __bufsize>
-void
-deque<_Tp,_Alloc,__bufsize>::_M_new_elements_at_back(size_type __new_elems)
-{
- size_type __new_nodes
- = (__new_elems + _S_buffer_size() - 1) / _S_buffer_size();
- _M_reserve_map_at_back(__new_nodes);
- size_type __i;
- __STL_TRY {
- for (__i = 1; __i <= __new_nodes; ++__i)
- *(_M_finish._M_node + __i) = _M_allocate_node();
- }
-# ifdef __STL_USE_EXCEPTIONS
- catch(...) {
- for (size_type __j = 1; __j < __i; ++__j)
- _M_deallocate_node(*(_M_finish._M_node + __j));
- throw;
- }
-# endif /* __STL_USE_EXCEPTIONS */
-}
-
-template <class _Tp, class _Alloc, size_t __bufsize>
-void
-deque<_Tp,_Alloc,__bufsize>::_M_reallocate_map(size_type __nodes_to_add,
- bool __add_at_front)
-{
- size_type __old_num_nodes = _M_finish._M_node - _M_start._M_node + 1;
- size_type __new_num_nodes = __old_num_nodes + __nodes_to_add;
-
- _Map_pointer __new_nstart;
- if (_M_map_size > 2 * __new_num_nodes) {
- __new_nstart = _M_map + (_M_map_size - __new_num_nodes) / 2
- + (__add_at_front ? __nodes_to_add : 0);
- if (__new_nstart < _M_start._M_node)
- copy(_M_start._M_node, _M_finish._M_node + 1, __new_nstart);
- else
- copy_backward(_M_start._M_node, _M_finish._M_node + 1,
- __new_nstart + __old_num_nodes);
- }
- else {
- size_type __new_map_size =
- _M_map_size + max(_M_map_size, __nodes_to_add) + 2;
-
- _Map_pointer __new_map = _M_allocate_map(__new_map_size);
- __new_nstart = __new_map + (__new_map_size - __new_num_nodes) / 2
- + (__add_at_front ? __nodes_to_add : 0);
- copy(_M_start._M_node, _M_finish._M_node + 1, __new_nstart);
- _M_deallocate_map(_M_map, _M_map_size);
-
- _M_map = __new_map;
- _M_map_size = __new_map_size;
- }
-
- _M_start._M_set_node(__new_nstart);
- _M_finish._M_set_node(__new_nstart + __old_num_nodes - 1);
-}
-
-
-// Nonmember functions.
-
-#ifndef __STL_NON_TYPE_TMPL_PARAM_BUG
-
-template <class _Tp, class _Alloc, size_t __bufsiz>
-bool operator==(const deque<_Tp, _Alloc, __bufsiz>& __x,
- const deque<_Tp, _Alloc, __bufsiz>& __y)
-{
- return __x.size() == __y.size() &&
- equal(__x.begin(), __x.end(), __y.begin());
-}
-
-template <class _Tp, class _Alloc, size_t __bufsiz>
-bool operator<(const deque<_Tp, _Alloc, __bufsiz>& __x,
- const deque<_Tp, _Alloc, __bufsiz>& __y)
-{
- return lexicographical_compare(__x.begin(), __x.end(),
- __y.begin(), __y.end());
-}
-
-#endif /* __STL_NON_TYPE_TMPL_PARAM_BUG */
-
-#if defined(__STL_FUNCTION_TMPL_PARTIAL_ORDER) && \
- !defined(__STL_NON_TYPE_TMPL_PARAM_BUG)
-
-template <class _Tp, class _Alloc, size_t __bufsiz>
-inline void
-swap(deque<_Tp,_Alloc,__bufsiz>& __x, deque<_Tp,_Alloc,__bufsiz>& __y)
-{
- __x.swap(__y);
-}
-
-#endif
-
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma reset woff 1174
-#pragma reset woff 1375
-#endif
-
-__STL_END_NAMESPACE
-
-#endif /* __SGI_STL_INTERNAL_DEQUE_H */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/contrib/libstdc++/stl/stl_function.h b/contrib/libstdc++/stl/stl_function.h
deleted file mode 100644
index a5a8486576e9..000000000000
--- a/contrib/libstdc++/stl/stl_function.h
+++ /dev/null
@@ -1,700 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- *
- * Copyright (c) 1996-1998
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- */
-
-/* NOTE: This is an internal header file, included by other STL headers.
- * You should not attempt to use it directly.
- */
-
-#ifndef __SGI_STL_INTERNAL_FUNCTION_H
-#define __SGI_STL_INTERNAL_FUNCTION_H
-
-__STL_BEGIN_NAMESPACE
-
-template <class _Arg, class _Result>
-struct unary_function {
- typedef _Arg argument_type;
- typedef _Result result_type;
-};
-
-template <class _Arg1, class _Arg2, class _Result>
-struct binary_function {
- typedef _Arg1 first_argument_type;
- typedef _Arg2 second_argument_type;
- typedef _Result result_type;
-};
-
-template <class _Tp>
-struct plus : public binary_function<_Tp,_Tp,_Tp> {
- _Tp operator()(const _Tp& __x, const _Tp& __y) const { return __x + __y; }
-};
-
-template <class _Tp>
-struct minus : public binary_function<_Tp,_Tp,_Tp> {
- _Tp operator()(const _Tp& __x, const _Tp& __y) const { return __x - __y; }
-};
-
-template <class _Tp>
-struct multiplies : public binary_function<_Tp,_Tp,_Tp> {
- _Tp operator()(const _Tp& __x, const _Tp& __y) const { return __x * __y; }
-};
-
-template <class _Tp>
-struct divides : public binary_function<_Tp,_Tp,_Tp> {
- _Tp operator()(const _Tp& __x, const _Tp& __y) const { return __x / __y; }
-};
-
-// identity_element (not part of the C++ standard).
-
-template <class _Tp> inline _Tp identity_element(plus<_Tp>) {
- return _Tp(0);
-}
-template <class _Tp> inline _Tp identity_element(multiplies<_Tp>) {
- return _Tp(1);
-}
-
-template <class _Tp>
-struct modulus : public binary_function<_Tp,_Tp,_Tp>
-{
- _Tp operator()(const _Tp& __x, const _Tp& __y) const { return __x % __y; }
-};
-
-template <class _Tp>
-struct negate : public unary_function<_Tp,_Tp>
-{
- _Tp operator()(const _Tp& __x) const { return -__x; }
-};
-
-template <class _Tp>
-struct equal_to : public binary_function<_Tp,_Tp,bool>
-{
- bool operator()(const _Tp& __x, const _Tp& __y) const { return __x == __y; }
-};
-
-template <class _Tp>
-struct not_equal_to : public binary_function<_Tp,_Tp,bool>
-{
- bool operator()(const _Tp& __x, const _Tp& __y) const { return __x != __y; }
-};
-
-template <class _Tp>
-struct greater : public binary_function<_Tp,_Tp,bool>
-{
- bool operator()(const _Tp& __x, const _Tp& __y) const { return __x > __y; }
-};
-
-template <class _Tp>
-struct less : public binary_function<_Tp,_Tp,bool>
-{
- bool operator()(const _Tp& __x, const _Tp& __y) const { return __x < __y; }
-};
-
-template <class _Tp>
-struct greater_equal : public binary_function<_Tp,_Tp,bool>
-{
- bool operator()(const _Tp& __x, const _Tp& __y) const { return __x >= __y; }
-};
-
-template <class _Tp>
-struct less_equal : public binary_function<_Tp,_Tp,bool>
-{
- bool operator()(const _Tp& __x, const _Tp& __y) const { return __x <= __y; }
-};
-
-template <class _Tp>
-struct logical_and : public binary_function<_Tp,_Tp,bool>
-{
- bool operator()(const _Tp& __x, const _Tp& __y) const { return __x && __y; }
-};
-
-template <class _Tp>
-struct logical_or : public binary_function<_Tp,_Tp,bool>
-{
- bool operator()(const _Tp& __x, const _Tp& __y) const { return __x || __y; }
-};
-
-template <class _Tp>
-struct logical_not : public unary_function<_Tp,bool>
-{
- bool operator()(const _Tp& __x) const { return !__x; }
-};
-
-template <class _Predicate>
-class unary_negate
- : public unary_function<typename _Predicate::argument_type, bool> {
-protected:
- _Predicate _M_pred;
-public:
- explicit unary_negate(const _Predicate& __x) : _M_pred(__x) {}
- bool operator()(const typename _Predicate::argument_type& __x) const {
- return !_M_pred(__x);
- }
-};
-
-template <class _Predicate>
-inline unary_negate<_Predicate>
-not1(const _Predicate& __pred)
-{
- return unary_negate<_Predicate>(__pred);
-}
-
-template <class _Predicate>
-class binary_negate
- : public binary_function<typename _Predicate::first_argument_type,
- typename _Predicate::second_argument_type,
- bool> {
-protected:
- _Predicate _M_pred;
-public:
- explicit binary_negate(const _Predicate& __x) : _M_pred(__x) {}
- bool operator()(const typename _Predicate::first_argument_type& __x,
- const typename _Predicate::second_argument_type& __y) const
- {
- return !_M_pred(__x, __y);
- }
-};
-
-template <class _Predicate>
-inline binary_negate<_Predicate>
-not2(const _Predicate& __pred)
-{
- return binary_negate<_Predicate>(__pred);
-}
-
-template <class _Operation>
-class binder1st
- : public unary_function<typename _Operation::second_argument_type,
- typename _Operation::result_type> {
-protected:
- _Operation op;
- typename _Operation::first_argument_type value;
-public:
- binder1st(const _Operation& __x,
- const typename _Operation::first_argument_type& __y)
- : op(__x), value(__y) {}
- typename _Operation::result_type
- operator()(const typename _Operation::second_argument_type& __x) const {
- return op(value, __x);
- }
-};
-
-template <class _Operation, class _Tp>
-inline binder1st<_Operation>
-bind1st(const _Operation& __oper, const _Tp& __x)
-{
- typedef typename _Operation::first_argument_type _Arg1_type;
- return binder1st<_Operation>(__oper, _Arg1_type(__x));
-}
-
-template <class _Operation>
-class binder2nd
- : public unary_function<typename _Operation::first_argument_type,
- typename _Operation::result_type> {
-protected:
- _Operation op;
- typename _Operation::second_argument_type value;
-public:
- binder2nd(const _Operation& __x,
- const typename _Operation::second_argument_type& __y)
- : op(__x), value(__y) {}
- typename _Operation::result_type
- operator()(const typename _Operation::first_argument_type& __x) const {
- return op(__x, value);
- }
-};
-
-template <class _Operation, class _Tp>
-inline binder2nd<_Operation>
-bind2nd(const _Operation& __oper, const _Tp& __x)
-{
- typedef typename _Operation::second_argument_type _Arg2_type;
- return binder2nd<_Operation>(__oper, _Arg2_type(__x));
-}
-
-// unary_compose and binary_compose (extensions, not part of the standard).
-
-template <class _Operation1, class _Operation2>
-class unary_compose
- : public unary_function<typename _Operation2::argument_type,
- typename _Operation1::result_type>
-{
-protected:
- _Operation1 __op1;
- _Operation2 __op2;
-public:
- unary_compose(const _Operation1& __x, const _Operation2& __y)
- : __op1(__x), __op2(__y) {}
- typename _Operation1::result_type
- operator()(const typename _Operation2::argument_type& __x) const {
- return __op1(__op2(__x));
- }
-};
-
-template <class _Operation1, class _Operation2>
-inline unary_compose<_Operation1,_Operation2>
-compose1(const _Operation1& __op1, const _Operation2& __op2)
-{
- return unary_compose<_Operation1,_Operation2>(__op1, __op2);
-}
-
-template <class _Operation1, class _Operation2, class _Operation3>
-class binary_compose
- : public unary_function<typename _Operation2::argument_type,
- typename _Operation1::result_type> {
-protected:
- _Operation1 _M_op1;
- _Operation2 _M_op2;
- _Operation3 _M_op3;
-public:
- binary_compose(const _Operation1& __x, const _Operation2& __y,
- const _Operation3& __z)
- : _M_op1(__x), _M_op2(__y), _M_op3(__z) { }
- typename _Operation1::result_type
- operator()(const typename _Operation2::argument_type& __x) const {
- return _M_op1(_M_op2(__x), _M_op3(__x));
- }
-};
-
-template <class _Operation1, class _Operation2, class _Operation3>
-inline binary_compose<_Operation1, _Operation2, _Operation3>
-compose2(const _Operation1& __op1, const _Operation2& __op2,
- const _Operation3& __op3)
-{
- return binary_compose<_Operation1,_Operation2,_Operation3>
- (__op1, __op2, __op3);
-}
-
-template <class _Arg, class _Result>
-class pointer_to_unary_function : public unary_function<_Arg, _Result> {
-protected:
- _Result (*_M_ptr)(_Arg);
-public:
- pointer_to_unary_function() {}
- explicit pointer_to_unary_function(_Result (*__x)(_Arg)) : _M_ptr(__x) {}
- _Result operator()(_Arg __x) const { return _M_ptr(__x); }
-};
-
-template <class _Arg, class _Result>
-inline pointer_to_unary_function<_Arg, _Result> ptr_fun(_Result (*__x)(_Arg))
-{
- return pointer_to_unary_function<_Arg, _Result>(__x);
-}
-
-template <class _Arg1, class _Arg2, class _Result>
-class pointer_to_binary_function :
- public binary_function<_Arg1,_Arg2,_Result> {
-protected:
- _Result (*_M_ptr)(_Arg1, _Arg2);
-public:
- pointer_to_binary_function() {}
- explicit pointer_to_binary_function(_Result (*__x)(_Arg1, _Arg2))
- : _M_ptr(__x) {}
- _Result operator()(_Arg1 __x, _Arg2 __y) const {
- return _M_ptr(__x, __y);
- }
-};
-
-template <class _Arg1, class _Arg2, class _Result>
-inline pointer_to_binary_function<_Arg1,_Arg2,_Result>
-ptr_fun(_Result (*__x)(_Arg1, _Arg2)) {
- return pointer_to_binary_function<_Arg1,_Arg2,_Result>(__x);
-}
-
-// identity is an extensions: it is not part of the standard.
-template <class _Tp>
-struct _Identity : public unary_function<_Tp,_Tp> {
- const _Tp& operator()(const _Tp& __x) const { return __x; }
-};
-
-template <class _Tp> struct identity : public _Identity<_Tp> {};
-
-// select1st and select2nd are extensions: they are not part of the standard.
-template <class _Pair>
-struct _Select1st : public unary_function<_Pair, typename _Pair::first_type> {
- const typename _Pair::first_type& operator()(const _Pair& __x) const {
- return __x.first;
- }
-};
-
-template <class _Pair>
-struct _Select2nd : public unary_function<_Pair, typename _Pair::second_type>
-{
- const typename _Pair::second_type& operator()(const _Pair& __x) const {
- return __x.second;
- }
-};
-
-template <class _Pair> struct select1st : public _Select1st<_Pair> {};
-template <class _Pair> struct select2nd : public _Select2nd<_Pair> {};
-
-// project1st and project2nd are extensions: they are not part of the standard
-template <class _Arg1, class _Arg2>
-struct _Project1st : public binary_function<_Arg1, _Arg2, _Arg1> {
- _Arg1 operator()(const _Arg1& __x, const _Arg2&) const { return __x; }
-};
-
-template <class _Arg1, class _Arg2>
-struct _Project2nd : public binary_function<_Arg1, _Arg2, _Arg2> {
- _Arg2 operator()(const _Arg1&, const _Arg2& __y) const { return __y; }
-};
-
-template <class _Arg1, class _Arg2>
-struct project1st : public _Project1st<_Arg1, _Arg2> {};
-
-template <class _Arg1, class _Arg2>
-struct project2nd : public _Project2nd<_Arg1, _Arg2> {};
-
-// constant_void_fun, constant_unary_fun, and constant_binary_fun are
-// extensions: they are not part of the standard. (The same, of course,
-// is true of the helper functions constant0, constant1, and constant2.)
-template <class _Result>
-struct constant_void_fun
-{
- typedef _Result result_type;
- result_type __val;
- constant_void_fun(const result_type& __v) : __val(__v) {}
- const result_type& operator()() const { return __val; }
-};
-
-#ifndef __STL_LIMITED_DEFAULT_TEMPLATES
-template <class _Result, class _Argument = _Result>
-#else
-template <class _Result, class _Argument>
-#endif
-struct constant_unary_fun : public unary_function<_Argument, _Result> {
- _Result _M_val;
- constant_unary_fun(const _Result& __v) : _M_val(__v) {}
- const _Result& operator()(const _Argument&) const { return _M_val; }
-};
-
-#ifndef __STL_LIMITED_DEFAULT_TEMPLATES
-template <class _Result, class _Arg1 = _Result, class _Arg2 = _Arg1>
-#else
-template <class _Result, class _Arg1, class _Arg2>
-#endif
-struct constant_binary_fun : public binary_function<_Arg1, _Arg2, _Result> {
- _Result _M_val;
- constant_binary_fun(const _Result& __v) : _M_val(__v) {}
- const _Result& operator()(const _Arg1&, const _Arg2&) const {
- return _M_val;
- }
-};
-
-template <class _Result>
-inline constant_void_fun<_Result> constant0(const _Result& __val)
-{
- return constant_void_fun<_Result>(__val);
-}
-
-template <class _Result>
-inline constant_unary_fun<_Result,_Result> constant1(const _Result& __val)
-{
- return constant_unary_fun<_Result,_Result>(__val);
-}
-
-template <class _Result>
-inline constant_binary_fun<_Result,_Result,_Result>
-constant2(const _Result& __val)
-{
- return constant_binary_fun<_Result,_Result,_Result>(__val);
-}
-
-// subtractive_rng is an extension: it is not part of the standard.
-// Note: this code assumes that int is 32 bits.
-class subtractive_rng : public unary_function<unsigned int, unsigned int> {
-private:
- unsigned int _M_table[55];
- size_t _M_index1;
- size_t _M_index2;
-public:
- unsigned int operator()(unsigned int __limit) {
- _M_index1 = (_M_index1 + 1) % 55;
- _M_index2 = (_M_index2 + 1) % 55;
- _M_table[_M_index1] = _M_table[_M_index1] - _M_table[_M_index2];
- return _M_table[_M_index1] % __limit;
- }
-
- void _M_initialize(unsigned int __seed)
- {
- unsigned int __k = 1;
- _M_table[54] = __seed;
- size_t __i;
- for (__i = 0; __i < 54; __i++) {
- size_t __ii = (21 * (__i + 1) % 55) - 1;
- _M_table[__ii] = __k;
- __k = __seed - __k;
- __seed = _M_table[__ii];
- }
- for (int __loop = 0; __loop < 4; __loop++) {
- for (__i = 0; __i < 55; __i++)
- _M_table[__i] = _M_table[__i] - _M_table[(1 + __i + 30) % 55];
- }
- _M_index1 = 0;
- _M_index2 = 31;
- }
-
- subtractive_rng(unsigned int __seed) { _M_initialize(__seed); }
- subtractive_rng() { _M_initialize(161803398u); }
-};
-
-
-// Adaptor function objects: pointers to member functions.
-
-// There are a total of 16 = 2^4 function objects in this family.
-// (1) Member functions taking no arguments vs member functions taking
-// one argument.
-// (2) Call through pointer vs call through reference.
-// (3) Member function with void return type vs member function with
-// non-void return type.
-// (4) Const vs non-const member function.
-
-// Note that choice (3) is nothing more than a workaround: according
-// to the draft, compilers should handle void and non-void the same way.
-// This feature is not yet widely implemented, though. You can only use
-// member functions returning void if your compiler supports partial
-// specialization.
-
-// All of this complexity is in the function objects themselves. You can
-// ignore it by using the helper function mem_fun and mem_fun_ref,
-// which create whichever type of adaptor is appropriate.
-// (mem_fun1 and mem_fun1_ref are no longer part of the C++ standard,
-// but they are provided for backward compatibility.)
-
-
-template <class _Ret, class _Tp>
-class mem_fun_t : public unary_function<_Tp*,_Ret> {
-public:
- explicit mem_fun_t(_Ret (_Tp::*__pf)()) : _M_f(__pf) {}
- _Ret operator()(_Tp* __p) const { return (__p->*_M_f)(); }
-private:
- _Ret (_Tp::*_M_f)();
-};
-
-template <class _Ret, class _Tp>
-class const_mem_fun_t : public unary_function<const _Tp*,_Ret> {
-public:
- explicit const_mem_fun_t(_Ret (_Tp::*__pf)() const) : _M_f(__pf) {}
- _Ret operator()(const _Tp* __p) const { return (__p->*_M_f)(); }
-private:
- _Ret (_Tp::*_M_f)() const;
-};
-
-
-template <class _Ret, class _Tp>
-class mem_fun_ref_t : public unary_function<_Tp,_Ret> {
-public:
- explicit mem_fun_ref_t(_Ret (_Tp::*__pf)()) : _M_f(__pf) {}
- _Ret operator()(_Tp& __r) const { return (__r.*_M_f)(); }
-private:
- _Ret (_Tp::*_M_f)();
-};
-
-template <class _Ret, class _Tp>
-class const_mem_fun_ref_t : public unary_function<_Tp,_Ret> {
-public:
- explicit const_mem_fun_ref_t(_Ret (_Tp::*__pf)() const) : _M_f(__pf) {}
- _Ret operator()(const _Tp& __r) const { return (__r.*_M_f)(); }
-private:
- _Ret (_Tp::*_M_f)() const;
-};
-
-template <class _Ret, class _Tp, class _Arg>
-class mem_fun1_t : public binary_function<_Tp*,_Arg,_Ret> {
-public:
- explicit mem_fun1_t(_Ret (_Tp::*__pf)(_Arg)) : _M_f(__pf) {}
- _Ret operator()(_Tp* __p, _Arg __x) const { return (__p->*_M_f)(__x); }
-private:
- _Ret (_Tp::*_M_f)(_Arg);
-};
-
-template <class _Ret, class _Tp, class _Arg>
-class const_mem_fun1_t : public binary_function<const _Tp*,_Arg,_Ret> {
-public:
- explicit const_mem_fun1_t(_Ret (_Tp::*__pf)(_Arg) const) : _M_f(__pf) {}
- _Ret operator()(const _Tp* __p, _Arg __x) const
- { return (__p->*_M_f)(__x); }
-private:
- _Ret (_Tp::*_M_f)(_Arg) const;
-};
-
-template <class _Ret, class _Tp, class _Arg>
-class mem_fun1_ref_t : public binary_function<_Tp,_Arg,_Ret> {
-public:
- explicit mem_fun1_ref_t(_Ret (_Tp::*__pf)(_Arg)) : _M_f(__pf) {}
- _Ret operator()(_Tp& __r, _Arg __x) const { return (__r.*_M_f)(__x); }
-private:
- _Ret (_Tp::*_M_f)(_Arg);
-};
-
-template <class _Ret, class _Tp, class _Arg>
-class const_mem_fun1_ref_t : public binary_function<_Tp,_Arg,_Ret> {
-public:
- explicit const_mem_fun1_ref_t(_Ret (_Tp::*__pf)(_Arg) const) : _M_f(__pf) {}
- _Ret operator()(const _Tp& __r, _Arg __x) const { return (__r.*_M_f)(__x); }
-private:
- _Ret (_Tp::*_M_f)(_Arg) const;
-};
-
-#ifdef __STL_CLASS_PARTIAL_SPECIALIZATION
-
-template <class _Tp>
-class mem_fun_t<void, _Tp> : public unary_function<_Tp*,void> {
-public:
- explicit mem_fun_t(void (_Tp::*__pf)()) : _M_f(__pf) {}
- void operator()(_Tp* __p) const { (__p->*_M_f)(); }
-private:
- void (_Tp::*_M_f)();
-};
-
-template <class _Tp>
-class const_mem_fun_t<void, _Tp> : public unary_function<const _Tp*,void> {
-public:
- explicit const_mem_fun_t(void (_Tp::*__pf)() const) : _M_f(__pf) {}
- void operator()(const _Tp* __p) const { (__p->*_M_f)(); }
-private:
- void (_Tp::*_M_f)() const;
-};
-
-template <class _Tp>
-class mem_fun_ref_t<void, _Tp> : public unary_function<_Tp,void> {
-public:
- explicit mem_fun_ref_t(void (_Tp::*__pf)()) : _M_f(__pf) {}
- void operator()(_Tp& __r) const { (__r.*_M_f)(); }
-private:
- void (_Tp::*_M_f)();
-};
-
-template <class _Tp>
-class const_mem_fun_ref_t<void, _Tp> : public unary_function<_Tp,void> {
-public:
- explicit const_mem_fun_ref_t(void (_Tp::*__pf)() const) : _M_f(__pf) {}
- void operator()(const _Tp& __r) const { (__r.*_M_f)(); }
-private:
- void (_Tp::*_M_f)() const;
-};
-
-template <class _Tp, class _Arg>
-class mem_fun1_t<void, _Tp, _Arg> : public binary_function<_Tp*,_Arg,void> {
-public:
- explicit mem_fun1_t(void (_Tp::*__pf)(_Arg)) : _M_f(__pf) {}
- void operator()(_Tp* __p, _Arg __x) const { (__p->*_M_f)(__x); }
-private:
- void (_Tp::*_M_f)(_Arg);
-};
-
-template <class _Tp, class _Arg>
-class const_mem_fun1_t<void, _Tp, _Arg>
- : public binary_function<const _Tp*,_Arg,void> {
-public:
- explicit const_mem_fun1_t(void (_Tp::*__pf)(_Arg) const) : _M_f(__pf) {}
- void operator()(const _Tp* __p, _Arg __x) const { (__p->*_M_f)(__x); }
-private:
- void (_Tp::*_M_f)(_Arg) const;
-};
-
-template <class _Tp, class _Arg>
-class mem_fun1_ref_t<void, _Tp, _Arg>
- : public binary_function<_Tp,_Arg,void> {
-public:
- explicit mem_fun1_ref_t(void (_Tp::*__pf)(_Arg)) : _M_f(__pf) {}
- void operator()(_Tp& __r, _Arg __x) const { (__r.*_M_f)(__x); }
-private:
- void (_Tp::*_M_f)(_Arg);
-};
-
-template <class _Tp, class _Arg>
-class const_mem_fun1_ref_t<void, _Tp, _Arg>
- : public binary_function<_Tp,_Arg,void> {
-public:
- explicit const_mem_fun1_ref_t(void (_Tp::*__pf)(_Arg) const) : _M_f(__pf) {}
- void operator()(const _Tp& __r, _Arg __x) const { (__r.*_M_f)(__x); }
-private:
- void (_Tp::*_M_f)(_Arg) const;
-};
-
-#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
-
-// Mem_fun adaptor helper functions. There are only two:
-// mem_fun and mem_fun_ref. (mem_fun1 and mem_fun1_ref
-// are provided for backward compatibility, but they are no longer
-// part of the C++ standard.)
-
-template <class _Ret, class _Tp>
-inline mem_fun_t<_Ret,_Tp> mem_fun(_Ret (_Tp::*__f)())
- { return mem_fun_t<_Ret,_Tp>(__f); }
-
-template <class _Ret, class _Tp>
-inline const_mem_fun_t<_Ret,_Tp> mem_fun(_Ret (_Tp::*__f)() const)
- { return const_mem_fun_t<_Ret,_Tp>(__f); }
-
-template <class _Ret, class _Tp>
-inline mem_fun_ref_t<_Ret,_Tp> mem_fun_ref(_Ret (_Tp::*__f)())
- { return mem_fun_ref_t<_Ret,_Tp>(__f); }
-
-template <class _Ret, class _Tp>
-inline const_mem_fun_ref_t<_Ret,_Tp> mem_fun_ref(_Ret (_Tp::*__f)() const)
- { return const_mem_fun_ref_t<_Ret,_Tp>(__f); }
-
-template <class _Ret, class _Tp, class _Arg>
-inline mem_fun1_t<_Ret,_Tp,_Arg> mem_fun(_Ret (_Tp::*__f)(_Arg))
- { return mem_fun1_t<_Ret,_Tp,_Arg>(__f); }
-
-template <class _Ret, class _Tp, class _Arg>
-inline const_mem_fun1_t<_Ret,_Tp,_Arg> mem_fun(_Ret (_Tp::*__f)(_Arg) const)
- { return const_mem_fun1_t<_Ret,_Tp,_Arg>(__f); }
-
-template <class _Ret, class _Tp, class _Arg>
-inline mem_fun1_ref_t<_Ret,_Tp,_Arg> mem_fun_ref(_Ret (_Tp::*__f)(_Arg))
- { return mem_fun1_ref_t<_Ret,_Tp,_Arg>(__f); }
-
-template <class _Ret, class _Tp, class _Arg>
-inline const_mem_fun1_ref_t<_Ret,_Tp,_Arg>
-mem_fun_ref(_Ret (_Tp::*__f)(_Arg) const)
- { return const_mem_fun1_ref_t<_Ret,_Tp,_Arg>(__f); }
-
-template <class _Ret, class _Tp, class _Arg>
-inline mem_fun1_t<_Ret,_Tp,_Arg> mem_fun1(_Ret (_Tp::*__f)(_Arg))
- { return mem_fun1_t<_Ret,_Tp,_Arg>(__f); }
-
-template <class _Ret, class _Tp, class _Arg>
-inline const_mem_fun1_t<_Ret,_Tp,_Arg> mem_fun1(_Ret (_Tp::*__f)(_Arg) const)
- { return const_mem_fun1_t<_Ret,_Tp,_Arg>(__f); }
-
-template <class _Ret, class _Tp, class _Arg>
-inline mem_fun1_ref_t<_Ret,_Tp,_Arg> mem_fun1_ref(_Ret (_Tp::*__f)(_Arg))
- { return mem_fun1_ref_t<_Ret,_Tp,_Arg>(__f); }
-
-template <class _Ret, class _Tp, class _Arg>
-inline const_mem_fun1_ref_t<_Ret,_Tp,_Arg>
-mem_fun1_ref(_Ret (_Tp::*__f)(_Arg) const)
- { return const_mem_fun1_ref_t<_Ret,_Tp,_Arg>(__f); }
-
-__STL_END_NAMESPACE
-
-#endif /* __SGI_STL_INTERNAL_FUNCTION_H */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/contrib/libstdc++/stl/stl_hash_fun.h b/contrib/libstdc++/stl/stl_hash_fun.h
deleted file mode 100644
index 44ab9bb56793..000000000000
--- a/contrib/libstdc++/stl/stl_hash_fun.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Copyright (c) 1996-1998
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- */
-
-/* NOTE: This is an internal header file, included by other STL headers.
- * You should not attempt to use it directly.
- */
-
-#ifndef __SGI_STL_HASH_FUN_H
-#define __SGI_STL_HASH_FUN_H
-
-#include <stddef.h>
-
-__STL_BEGIN_NAMESPACE
-
-template <class _Key> struct hash { };
-
-inline size_t __stl_hash_string(const char* __s)
-{
- unsigned long __h = 0;
- for ( ; *__s; ++__s)
- __h = 5*__h + *__s;
-
- return size_t(__h);
-}
-
-__STL_TEMPLATE_NULL struct hash<char*>
-{
- size_t operator()(const char* __s) const { return __stl_hash_string(__s); }
-};
-
-__STL_TEMPLATE_NULL struct hash<const char*>
-{
- size_t operator()(const char* __s) const { return __stl_hash_string(__s); }
-};
-
-__STL_TEMPLATE_NULL struct hash<char> {
- size_t operator()(char __x) const { return __x; }
-};
-__STL_TEMPLATE_NULL struct hash<unsigned char> {
- size_t operator()(unsigned char __x) const { return __x; }
-};
-__STL_TEMPLATE_NULL struct hash<signed char> {
- size_t operator()(unsigned char __x) const { return __x; }
-};
-__STL_TEMPLATE_NULL struct hash<short> {
- size_t operator()(short __x) const { return __x; }
-};
-__STL_TEMPLATE_NULL struct hash<unsigned short> {
- size_t operator()(unsigned short __x) const { return __x; }
-};
-__STL_TEMPLATE_NULL struct hash<int> {
- size_t operator()(int __x) const { return __x; }
-};
-__STL_TEMPLATE_NULL struct hash<unsigned int> {
- size_t operator()(unsigned int __x) const { return __x; }
-};
-__STL_TEMPLATE_NULL struct hash<long> {
- size_t operator()(long __x) const { return __x; }
-};
-__STL_TEMPLATE_NULL struct hash<unsigned long> {
- size_t operator()(unsigned long __x) const { return __x; }
-};
-
-__STL_END_NAMESPACE
-
-#endif /* __SGI_STL_HASH_FUN_H */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/contrib/libstdc++/stl/stl_hash_map.h b/contrib/libstdc++/stl/stl_hash_map.h
deleted file mode 100644
index bf16f60ecad7..000000000000
--- a/contrib/libstdc++/stl/stl_hash_map.h
+++ /dev/null
@@ -1,416 +0,0 @@
-/*
- * Copyright (c) 1996
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- */
-
-/* NOTE: This is an internal header file, included by other STL headers.
- * You should not attempt to use it directly.
- */
-
-#ifndef __SGI_STL_INTERNAL_HASH_MAP_H
-#define __SGI_STL_INTERNAL_HASH_MAP_H
-
-
-__STL_BEGIN_NAMESPACE
-
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma set woff 1174
-#pragma set woff 1375
-#endif
-
-#ifndef __STL_LIMITED_DEFAULT_TEMPLATES
-template <class _Key, class _Tp, class _HashFcn = hash<_Key>,
- class _EqualKey = equal_to<_Key>,
- class _Alloc = __STL_DEFAULT_ALLOCATOR(_Tp) >
-#else
-template <class _Key, class _Tp, class _HashFcn, class _EqualKey,
- class _Alloc = __STL_DEFAULT_ALLOCATOR(_Tp) >
-#endif
-class hash_map
-{
-private:
- typedef hashtable<pair<const _Key,_Tp>,_Key,_HashFcn,
- _Select1st<pair<const _Key,_Tp> >,_EqualKey,_Alloc> _Ht;
- _Ht _M_ht;
-
-public:
- typedef typename _Ht::key_type key_type;
- typedef _Tp data_type;
- typedef _Tp mapped_type;
- typedef typename _Ht::value_type value_type;
- typedef typename _Ht::hasher hasher;
- typedef typename _Ht::key_equal key_equal;
-
- typedef typename _Ht::size_type size_type;
- typedef typename _Ht::difference_type difference_type;
- typedef typename _Ht::pointer pointer;
- typedef typename _Ht::const_pointer const_pointer;
- typedef typename _Ht::reference reference;
- typedef typename _Ht::const_reference const_reference;
-
- typedef typename _Ht::iterator iterator;
- typedef typename _Ht::const_iterator const_iterator;
-
- typedef typename _Ht::allocator_type allocator_type;
-
- hasher hash_funct() const { return _M_ht.hash_funct(); }
- key_equal key_eq() const { return _M_ht.key_eq(); }
- allocator_type get_allocator() const { return _M_ht.get_allocator(); }
-
-public:
- hash_map() : _M_ht(100, hasher(), key_equal(), allocator_type()) {}
- explicit hash_map(size_type __n)
- : _M_ht(__n, hasher(), key_equal(), allocator_type()) {}
- hash_map(size_type __n, const hasher& __hf)
- : _M_ht(__n, __hf, key_equal(), allocator_type()) {}
- hash_map(size_type __n, const hasher& __hf, const key_equal& __eql,
- const allocator_type& __a = allocator_type())
- : _M_ht(__n, __hf, __eql, __a) {}
-
-#ifdef __STL_MEMBER_TEMPLATES
- template <class _InputIterator>
- hash_map(_InputIterator __f, _InputIterator __l)
- : _M_ht(100, hasher(), key_equal(), allocator_type())
- { _M_ht.insert_unique(__f, __l); }
- template <class _InputIterator>
- hash_map(_InputIterator __f, _InputIterator __l, size_type __n)
- : _M_ht(__n, hasher(), key_equal(), allocator_type())
- { _M_ht.insert_unique(__f, __l); }
- template <class _InputIterator>
- hash_map(_InputIterator __f, _InputIterator __l, size_type __n,
- const hasher& __hf)
- : _M_ht(__n, __hf, key_equal(), allocator_type())
- { _M_ht.insert_unique(__f, __l); }
- template <class _InputIterator>
- hash_map(_InputIterator __f, _InputIterator __l, size_type __n,
- const hasher& __hf, const key_equal& __eql,
- const allocator_type& __a = allocator_type())
- : _M_ht(__n, __hf, __eql, __a)
- { _M_ht.insert_unique(__f, __l); }
-
-#else
- hash_map(const value_type* __f, const value_type* __l)
- : _M_ht(100, hasher(), key_equal(), allocator_type())
- { _M_ht.insert_unique(__f, __l); }
- hash_map(const value_type* __f, const value_type* __l, size_type __n)
- : _M_ht(__n, hasher(), key_equal(), allocator_type())
- { _M_ht.insert_unique(__f, __l); }
- hash_map(const value_type* __f, const value_type* __l, size_type __n,
- const hasher& __hf)
- : _M_ht(__n, __hf, key_equal(), allocator_type())
- { _M_ht.insert_unique(__f, __l); }
- hash_map(const value_type* __f, const value_type* __l, size_type __n,
- const hasher& __hf, const key_equal& __eql,
- const allocator_type& __a = allocator_type())
- : _M_ht(__n, __hf, __eql, __a)
- { _M_ht.insert_unique(__f, __l); }
-
- hash_map(const_iterator __f, const_iterator __l)
- : _M_ht(100, hasher(), key_equal(), allocator_type())
- { _M_ht.insert_unique(__f, __l); }
- hash_map(const_iterator __f, const_iterator __l, size_type __n)
- : _M_ht(__n, hasher(), key_equal(), allocator_type())
- { _M_ht.insert_unique(__f, __l); }
- hash_map(const_iterator __f, const_iterator __l, size_type __n,
- const hasher& __hf)
- : _M_ht(__n, __hf, key_equal(), allocator_type())
- { _M_ht.insert_unique(__f, __l); }
- hash_map(const_iterator __f, const_iterator __l, size_type __n,
- const hasher& __hf, const key_equal& __eql,
- const allocator_type& __a = allocator_type())
- : _M_ht(__n, __hf, __eql, __a)
- { _M_ht.insert_unique(__f, __l); }
-#endif /*__STL_MEMBER_TEMPLATES */
-
-public:
- size_type size() const { return _M_ht.size(); }
- size_type max_size() const { return _M_ht.max_size(); }
- bool empty() const { return _M_ht.empty(); }
- void swap(hash_map& __hs) { _M_ht.swap(__hs._M_ht); }
- friend bool
- operator== __STL_NULL_TMPL_ARGS (const hash_map&, const hash_map&);
-
- iterator begin() { return _M_ht.begin(); }
- iterator end() { return _M_ht.end(); }
- const_iterator begin() const { return _M_ht.begin(); }
- const_iterator end() const { return _M_ht.end(); }
-
-public:
- pair<iterator,bool> insert(const value_type& __obj)
- { return _M_ht.insert_unique(__obj); }
-#ifdef __STL_MEMBER_TEMPLATES
- template <class _InputIterator>
- void insert(_InputIterator __f, _InputIterator __l)
- { _M_ht.insert_unique(__f,__l); }
-#else
- void insert(const value_type* __f, const value_type* __l) {
- _M_ht.insert_unique(__f,__l);
- }
- void insert(const_iterator __f, const_iterator __l)
- { _M_ht.insert_unique(__f, __l); }
-#endif /*__STL_MEMBER_TEMPLATES */
- pair<iterator,bool> insert_noresize(const value_type& __obj)
- { return _M_ht.insert_unique_noresize(__obj); }
-
- iterator find(const key_type& __key) { return _M_ht.find(__key); }
- const_iterator find(const key_type& __key) const
- { return _M_ht.find(__key); }
-
- _Tp& operator[](const key_type& __key) {
- return _M_ht.find_or_insert(value_type(__key, _Tp())).second;
- }
-
- size_type count(const key_type& __key) const { return _M_ht.count(__key); }
-
- pair<iterator, iterator> equal_range(const key_type& __key)
- { return _M_ht.equal_range(__key); }
- pair<const_iterator, const_iterator>
- equal_range(const key_type& __key) const
- { return _M_ht.equal_range(__key); }
-
- size_type erase(const key_type& __key) {return _M_ht.erase(__key); }
- void erase(iterator __it) { _M_ht.erase(__it); }
- void erase(iterator __f, iterator __l) { _M_ht.erase(__f, __l); }
- void clear() { _M_ht.clear(); }
-
- void resize(size_type __hint) { _M_ht.resize(__hint); }
- size_type bucket_count() const { return _M_ht.bucket_count(); }
- size_type max_bucket_count() const { return _M_ht.max_bucket_count(); }
- size_type elems_in_bucket(size_type __n) const
- { return _M_ht.elems_in_bucket(__n); }
-};
-
-template <class _Key, class _Tp, class _HashFcn, class _EqlKey, class _Alloc>
-inline bool
-operator==(const hash_map<_Key,_Tp,_HashFcn,_EqlKey,_Alloc>& __hm1,
- const hash_map<_Key,_Tp,_HashFcn,_EqlKey,_Alloc>& __hm2)
-{
- return __hm1._M_ht == __hm2._M_ht;
-}
-
-#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER
-
-template <class _Key, class _Tp, class _HashFcn, class _EqlKey, class _Alloc>
-inline void
-swap(hash_map<_Key,_Tp,_HashFcn,_EqlKey,_Alloc>& __hm1,
- hash_map<_Key,_Tp,_HashFcn,_EqlKey,_Alloc>& __hm2)
-{
- __hm1.swap(__hm2);
-}
-
-#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */
-
-#ifndef __STL_LIMITED_DEFAULT_TEMPLATES
-template <class _Key, class _Tp, class _HashFcn = hash<_Key>,
- class _EqualKey = equal_to<_Key>,
- class _Alloc = __STL_DEFAULT_ALLOCATOR(_Tp) >
-#else
-template <class _Key, class _Tp, class _HashFcn, class _EqualKey,
- class _Alloc = __STL_DEFAULT_ALLOCATOR(_Tp) >
-#endif
-class hash_multimap
-{
-private:
- typedef hashtable<pair<const _Key, _Tp>, _Key, _HashFcn,
- _Select1st<pair<const _Key, _Tp> >, _EqualKey, _Alloc>
- _Ht;
- _Ht _M_ht;
-
-public:
- typedef typename _Ht::key_type key_type;
- typedef _Tp data_type;
- typedef _Tp mapped_type;
- typedef typename _Ht::value_type value_type;
- typedef typename _Ht::hasher hasher;
- typedef typename _Ht::key_equal key_equal;
-
- typedef typename _Ht::size_type size_type;
- typedef typename _Ht::difference_type difference_type;
- typedef typename _Ht::pointer pointer;
- typedef typename _Ht::const_pointer const_pointer;
- typedef typename _Ht::reference reference;
- typedef typename _Ht::const_reference const_reference;
-
- typedef typename _Ht::iterator iterator;
- typedef typename _Ht::const_iterator const_iterator;
-
- typedef typename _Ht::allocator_type allocator_type;
-
- hasher hash_funct() const { return _M_ht.hash_funct(); }
- key_equal key_eq() const { return _M_ht.key_eq(); }
- allocator_type get_allocator() const { return _M_ht.get_allocator(); }
-
-public:
- hash_multimap() : _M_ht(100, hasher(), key_equal(), allocator_type()) {}
- explicit hash_multimap(size_type __n)
- : _M_ht(__n, hasher(), key_equal(), allocator_type()) {}
- hash_multimap(size_type __n, const hasher& __hf)
- : _M_ht(__n, __hf, key_equal(), allocator_type()) {}
- hash_multimap(size_type __n, const hasher& __hf, const key_equal& __eql,
- const allocator_type& __a = allocator_type())
- : _M_ht(__n, __hf, __eql, __a) {}
-
-#ifdef __STL_MEMBER_TEMPLATES
- template <class _InputIterator>
- hash_multimap(_InputIterator __f, _InputIterator __l)
- : _M_ht(100, hasher(), key_equal(), allocator_type())
- { _M_ht.insert_equal(__f, __l); }
- template <class _InputIterator>
- hash_multimap(_InputIterator __f, _InputIterator __l, size_type __n)
- : _M_ht(__n, hasher(), key_equal(), allocator_type())
- { _M_ht.insert_equal(__f, __l); }
- template <class _InputIterator>
- hash_multimap(_InputIterator __f, _InputIterator __l, size_type __n,
- const hasher& __hf)
- : _M_ht(__n, __hf, key_equal(), allocator_type())
- { _M_ht.insert_equal(__f, __l); }
- template <class _InputIterator>
- hash_multimap(_InputIterator __f, _InputIterator __l, size_type __n,
- const hasher& __hf, const key_equal& __eql,
- const allocator_type& __a = allocator_type())
- : _M_ht(__n, __hf, __eql, __a)
- { _M_ht.insert_equal(__f, __l); }
-
-#else
- hash_multimap(const value_type* __f, const value_type* __l)
- : _M_ht(100, hasher(), key_equal(), allocator_type())
- { _M_ht.insert_equal(__f, __l); }
- hash_multimap(const value_type* __f, const value_type* __l, size_type __n)
- : _M_ht(__n, hasher(), key_equal(), allocator_type())
- { _M_ht.insert_equal(__f, __l); }
- hash_multimap(const value_type* __f, const value_type* __l, size_type __n,
- const hasher& __hf)
- : _M_ht(__n, __hf, key_equal(), allocator_type())
- { _M_ht.insert_equal(__f, __l); }
- hash_multimap(const value_type* __f, const value_type* __l, size_type __n,
- const hasher& __hf, const key_equal& __eql,
- const allocator_type& __a = allocator_type())
- : _M_ht(__n, __hf, __eql, __a)
- { _M_ht.insert_equal(__f, __l); }
-
- hash_multimap(const_iterator __f, const_iterator __l)
- : _M_ht(100, hasher(), key_equal(), allocator_type())
- { _M_ht.insert_equal(__f, __l); }
- hash_multimap(const_iterator __f, const_iterator __l, size_type __n)
- : _M_ht(__n, hasher(), key_equal(), allocator_type())
- { _M_ht.insert_equal(__f, __l); }
- hash_multimap(const_iterator __f, const_iterator __l, size_type __n,
- const hasher& __hf)
- : _M_ht(__n, __hf, key_equal(), allocator_type())
- { _M_ht.insert_equal(__f, __l); }
- hash_multimap(const_iterator __f, const_iterator __l, size_type __n,
- const hasher& __hf, const key_equal& __eql,
- const allocator_type& __a = allocator_type())
- : _M_ht(__n, __hf, __eql, __a)
- { _M_ht.insert_equal(__f, __l); }
-#endif /*__STL_MEMBER_TEMPLATES */
-
-public:
- size_type size() const { return _M_ht.size(); }
- size_type max_size() const { return _M_ht.max_size(); }
- bool empty() const { return _M_ht.empty(); }
- void swap(hash_multimap& __hs) { _M_ht.swap(__hs._M_ht); }
- friend bool
- operator== __STL_NULL_TMPL_ARGS (const hash_multimap&,
- const hash_multimap&);
-
- iterator begin() { return _M_ht.begin(); }
- iterator end() { return _M_ht.end(); }
- const_iterator begin() const { return _M_ht.begin(); }
- const_iterator end() const { return _M_ht.end(); }
-
-public:
- iterator insert(const value_type& __obj)
- { return _M_ht.insert_equal(__obj); }
-#ifdef __STL_MEMBER_TEMPLATES
- template <class _InputIterator>
- void insert(_InputIterator __f, _InputIterator __l)
- { _M_ht.insert_equal(__f,__l); }
-#else
- void insert(const value_type* __f, const value_type* __l) {
- _M_ht.insert_equal(__f,__l);
- }
- void insert(const_iterator __f, const_iterator __l)
- { _M_ht.insert_equal(__f, __l); }
-#endif /*__STL_MEMBER_TEMPLATES */
- iterator insert_noresize(const value_type& __obj)
- { return _M_ht.insert_equal_noresize(__obj); }
-
- iterator find(const key_type& __key) { return _M_ht.find(__key); }
- const_iterator find(const key_type& __key) const
- { return _M_ht.find(__key); }
-
- size_type count(const key_type& __key) const { return _M_ht.count(__key); }
-
- pair<iterator, iterator> equal_range(const key_type& __key)
- { return _M_ht.equal_range(__key); }
- pair<const_iterator, const_iterator>
- equal_range(const key_type& __key) const
- { return _M_ht.equal_range(__key); }
-
- size_type erase(const key_type& __key) {return _M_ht.erase(__key); }
- void erase(iterator __it) { _M_ht.erase(__it); }
- void erase(iterator __f, iterator __l) { _M_ht.erase(__f, __l); }
- void clear() { _M_ht.clear(); }
-
-public:
- void resize(size_type __hint) { _M_ht.resize(__hint); }
- size_type bucket_count() const { return _M_ht.bucket_count(); }
- size_type max_bucket_count() const { return _M_ht.max_bucket_count(); }
- size_type elems_in_bucket(size_type __n) const
- { return _M_ht.elems_in_bucket(__n); }
-};
-
-template <class _Key, class _Tp, class _HF, class _EqKey, class _Alloc>
-inline bool
-operator==(const hash_multimap<_Key,_Tp,_HF,_EqKey,_Alloc>& __hm1,
- const hash_multimap<_Key,_Tp,_HF,_EqKey,_Alloc>& __hm2)
-{
- return __hm1._M_ht == __hm2._M_ht;
-}
-
-#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER
-
-template <class _Key, class _Tp, class _HashFcn, class _EqlKey, class _Alloc>
-inline void
-swap(hash_multimap<_Key,_Tp,_HashFcn,_EqlKey,_Alloc>& __hm1,
- hash_multimap<_Key,_Tp,_HashFcn,_EqlKey,_Alloc>& __hm2)
-{
- __hm1.swap(__hm2);
-}
-
-#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */
-
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma reset woff 1174
-#pragma reset woff 1375
-#endif
-
-__STL_END_NAMESPACE
-
-#endif /* __SGI_STL_INTERNAL_HASH_MAP_H */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/contrib/libstdc++/stl/stl_hash_set.h b/contrib/libstdc++/stl/stl_hash_set.h
deleted file mode 100644
index b623a642cfc0..000000000000
--- a/contrib/libstdc++/stl/stl_hash_set.h
+++ /dev/null
@@ -1,401 +0,0 @@
-/*
- * Copyright (c) 1996
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- */
-
-/* NOTE: This is an internal header file, included by other STL headers.
- * You should not attempt to use it directly.
- */
-
-#ifndef __SGI_STL_INTERNAL_HASH_SET_H
-#define __SGI_STL_INTERNAL_HASH_SET_H
-
-__STL_BEGIN_NAMESPACE
-
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma set woff 1174
-#pragma set woff 1375
-#endif
-
-#ifndef __STL_LIMITED_DEFAULT_TEMPLATES
-template <class _Value, class _HashFcn = hash<_Value>,
- class _EqualKey = equal_to<_Value>,
- class _Alloc = __STL_DEFAULT_ALLOCATOR(_Value) >
-#else
-template <class _Value, class _HashFcn, class _EqualKey,
- class _Alloc = __STL_DEFAULT_ALLOCATOR(_Value) >
-#endif
-class hash_set
-{
-private:
- typedef hashtable<_Value, _Value, _HashFcn, _Identity<_Value>,
- _EqualKey, _Alloc> _Ht;
- _Ht _M_ht;
-
-public:
- typedef typename _Ht::key_type key_type;
- typedef typename _Ht::value_type value_type;
- typedef typename _Ht::hasher hasher;
- typedef typename _Ht::key_equal key_equal;
-
- typedef typename _Ht::size_type size_type;
- typedef typename _Ht::difference_type difference_type;
- typedef typename _Ht::const_pointer pointer;
- typedef typename _Ht::const_pointer const_pointer;
- typedef typename _Ht::const_reference reference;
- typedef typename _Ht::const_reference const_reference;
-
- typedef typename _Ht::const_iterator iterator;
- typedef typename _Ht::const_iterator const_iterator;
-
- typedef typename _Ht::allocator_type allocator_type;
-
- hasher hash_funct() const { return _M_ht.hash_funct(); }
- key_equal key_eq() const { return _M_ht.key_eq(); }
- allocator_type get_allocator() const { return _M_ht.get_allocator(); }
-
-public:
- hash_set()
- : _M_ht(100, hasher(), key_equal(), allocator_type()) {}
- explicit hash_set(size_type __n)
- : _M_ht(__n, hasher(), key_equal(), allocator_type()) {}
- hash_set(size_type __n, const hasher& __hf)
- : _M_ht(__n, __hf, key_equal(), allocator_type()) {}
- hash_set(size_type __n, const hasher& __hf, const key_equal& __eql,
- const allocator_type& __a = allocator_type())
- : _M_ht(__n, __hf, __eql, __a) {}
-
-#ifdef __STL_MEMBER_TEMPLATES
- template <class _InputIterator>
- hash_set(_InputIterator __f, _InputIterator __l)
- : _M_ht(100, hasher(), key_equal(), allocator_type())
- { _M_ht.insert_unique(__f, __l); }
- template <class _InputIterator>
- hash_set(_InputIterator __f, _InputIterator __l, size_type __n)
- : _M_ht(__n, hasher(), key_equal(), allocator_type())
- { _M_ht.insert_unique(__f, __l); }
- template <class _InputIterator>
- hash_set(_InputIterator __f, _InputIterator __l, size_type __n,
- const hasher& __hf)
- : _M_ht(__n, __hf, key_equal(), allocator_type())
- { _M_ht.insert_unique(__f, __l); }
- template <class _InputIterator>
- hash_set(_InputIterator __f, _InputIterator __l, size_type __n,
- const hasher& __hf, const key_equal& __eql,
- const allocator_type& __a = allocator_type())
- : _M_ht(__n, __hf, __eql, __a)
- { _M_ht.insert_unique(__f, __l); }
-#else
-
- hash_set(const value_type* __f, const value_type* __l)
- : _M_ht(100, hasher(), key_equal(), allocator_type())
- { _M_ht.insert_unique(__f, __l); }
- hash_set(const value_type* __f, const value_type* __l, size_type __n)
- : _M_ht(__n, hasher(), key_equal(), allocator_type())
- { _M_ht.insert_unique(__f, __l); }
- hash_set(const value_type* __f, const value_type* __l, size_type __n,
- const hasher& __hf)
- : _M_ht(__n, __hf, key_equal(), allocator_type())
- { _M_ht.insert_unique(__f, __l); }
- hash_set(const value_type* __f, const value_type* __l, size_type __n,
- const hasher& __hf, const key_equal& __eql,
- const allocator_type& __a = allocator_type())
- : _M_ht(__n, __hf, __eql, __a)
- { _M_ht.insert_unique(__f, __l); }
-
- hash_set(const_iterator __f, const_iterator __l)
- : _M_ht(100, hasher(), key_equal(), allocator_type())
- { _M_ht.insert_unique(__f, __l); }
- hash_set(const_iterator __f, const_iterator __l, size_type __n)
- : _M_ht(__n, hasher(), key_equal(), allocator_type())
- { _M_ht.insert_unique(__f, __l); }
- hash_set(const_iterator __f, const_iterator __l, size_type __n,
- const hasher& __hf)
- : _M_ht(__n, __hf, key_equal(), allocator_type())
- { _M_ht.insert_unique(__f, __l); }
- hash_set(const_iterator __f, const_iterator __l, size_type __n,
- const hasher& __hf, const key_equal& __eql,
- const allocator_type& __a = allocator_type())
- : _M_ht(__n, __hf, __eql, __a)
- { _M_ht.insert_unique(__f, __l); }
-#endif /*__STL_MEMBER_TEMPLATES */
-
-public:
- size_type size() const { return _M_ht.size(); }
- size_type max_size() const { return _M_ht.max_size(); }
- bool empty() const { return _M_ht.empty(); }
- void swap(hash_set& __hs) { _M_ht.swap(__hs._M_ht); }
- friend bool operator== __STL_NULL_TMPL_ARGS (const hash_set&,
- const hash_set&);
-
- iterator begin() const { return _M_ht.begin(); }
- iterator end() const { return _M_ht.end(); }
-
-public:
- pair<iterator, bool> insert(const value_type& __obj)
- {
- pair<typename _Ht::iterator, bool> __p = _M_ht.insert_unique(__obj);
- return pair<iterator,bool>(__p.first, __p.second);
- }
-#ifdef __STL_MEMBER_TEMPLATES
- template <class _InputIterator>
- void insert(_InputIterator __f, _InputIterator __l)
- { _M_ht.insert_unique(__f,__l); }
-#else
- void insert(const value_type* __f, const value_type* __l) {
- _M_ht.insert_unique(__f,__l);
- }
- void insert(const_iterator __f, const_iterator __l)
- {_M_ht.insert_unique(__f, __l); }
-#endif /*__STL_MEMBER_TEMPLATES */
- pair<iterator, bool> insert_noresize(const value_type& __obj)
- {
- pair<typename _Ht::iterator, bool> __p =
- _M_ht.insert_unique_noresize(__obj);
- return pair<iterator, bool>(__p.first, __p.second);
- }
-
- iterator find(const key_type& __key) const { return _M_ht.find(__key); }
-
- size_type count(const key_type& __key) const { return _M_ht.count(__key); }
-
- pair<iterator, iterator> equal_range(const key_type& __key) const
- { return _M_ht.equal_range(__key); }
-
- size_type erase(const key_type& __key) {return _M_ht.erase(__key); }
- void erase(iterator __it) { _M_ht.erase(__it); }
- void erase(iterator __f, iterator __l) { _M_ht.erase(__f, __l); }
- void clear() { _M_ht.clear(); }
-
-public:
- void resize(size_type __hint) { _M_ht.resize(__hint); }
- size_type bucket_count() const { return _M_ht.bucket_count(); }
- size_type max_bucket_count() const { return _M_ht.max_bucket_count(); }
- size_type elems_in_bucket(size_type __n) const
- { return _M_ht.elems_in_bucket(__n); }
-};
-
-template <class _Value, class _HashFcn, class _EqualKey, class _Alloc>
-inline bool
-operator==(const hash_set<_Value,_HashFcn,_EqualKey,_Alloc>& __hs1,
- const hash_set<_Value,_HashFcn,_EqualKey,_Alloc>& __hs2)
-{
- return __hs1._M_ht == __hs2._M_ht;
-}
-
-#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER
-
-template <class _Val, class _HashFcn, class _EqualKey, class _Alloc>
-inline void
-swap(hash_set<_Val,_HashFcn,_EqualKey,_Alloc>& __hs1,
- hash_set<_Val,_HashFcn,_EqualKey,_Alloc>& __hs2)
-{
- __hs1.swap(__hs2);
-}
-
-#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */
-
-
-#ifndef __STL_LIMITED_DEFAULT_TEMPLATES
-template <class _Value, class _HashFcn = hash<_Value>,
- class _EqualKey = equal_to<_Value>,
- class _Alloc = __STL_DEFAULT_ALLOCATOR(_Value) >
-#else
-template <class _Value, class _HashFcn, class _EqualKey,
- class _Alloc = __STL_DEFAULT_ALLOCATOR(_Value) >
-#endif
-class hash_multiset
-{
-private:
- typedef hashtable<_Value, _Value, _HashFcn, _Identity<_Value>,
- _EqualKey, _Alloc> _Ht;
- _Ht _M_ht;
-
-public:
- typedef typename _Ht::key_type key_type;
- typedef typename _Ht::value_type value_type;
- typedef typename _Ht::hasher hasher;
- typedef typename _Ht::key_equal key_equal;
-
- typedef typename _Ht::size_type size_type;
- typedef typename _Ht::difference_type difference_type;
- typedef typename _Ht::const_pointer pointer;
- typedef typename _Ht::const_pointer const_pointer;
- typedef typename _Ht::const_reference reference;
- typedef typename _Ht::const_reference const_reference;
-
- typedef typename _Ht::const_iterator iterator;
- typedef typename _Ht::const_iterator const_iterator;
-
- typedef typename _Ht::allocator_type allocator_type;
-
- hasher hash_funct() const { return _M_ht.hash_funct(); }
- key_equal key_eq() const { return _M_ht.key_eq(); }
- allocator_type get_allocator() const { return _M_ht.get_allocator(); }
-
-public:
- hash_multiset()
- : _M_ht(100, hasher(), key_equal(), allocator_type()) {}
- explicit hash_multiset(size_type __n)
- : _M_ht(__n, hasher(), key_equal(), allocator_type()) {}
- hash_multiset(size_type __n, const hasher& __hf)
- : _M_ht(__n, __hf, key_equal(), allocator_type()) {}
- hash_multiset(size_type __n, const hasher& __hf, const key_equal& __eql,
- const allocator_type& __a = allocator_type())
- : _M_ht(__n, __hf, __eql, __a) {}
-
-#ifdef __STL_MEMBER_TEMPLATES
- template <class _InputIterator>
- hash_multiset(_InputIterator __f, _InputIterator __l)
- : _M_ht(100, hasher(), key_equal(), allocator_type())
- { _M_ht.insert_equal(__f, __l); }
- template <class _InputIterator>
- hash_multiset(_InputIterator __f, _InputIterator __l, size_type __n)
- : _M_ht(__n, hasher(), key_equal(), allocator_type())
- { _M_ht.insert_equal(__f, __l); }
- template <class _InputIterator>
- hash_multiset(_InputIterator __f, _InputIterator __l, size_type __n,
- const hasher& __hf)
- : _M_ht(__n, __hf, key_equal(), allocator_type())
- { _M_ht.insert_equal(__f, __l); }
- template <class _InputIterator>
- hash_multiset(_InputIterator __f, _InputIterator __l, size_type __n,
- const hasher& __hf, const key_equal& __eql,
- const allocator_type& __a = allocator_type())
- : _M_ht(__n, __hf, __eql, __a)
- { _M_ht.insert_equal(__f, __l); }
-#else
-
- hash_multiset(const value_type* __f, const value_type* __l)
- : _M_ht(100, hasher(), key_equal(), allocator_type())
- { _M_ht.insert_equal(__f, __l); }
- hash_multiset(const value_type* __f, const value_type* __l, size_type __n)
- : _M_ht(__n, hasher(), key_equal(), allocator_type())
- { _M_ht.insert_equal(__f, __l); }
- hash_multiset(const value_type* __f, const value_type* __l, size_type __n,
- const hasher& __hf)
- : _M_ht(__n, __hf, key_equal(), allocator_type())
- { _M_ht.insert_equal(__f, __l); }
- hash_multiset(const value_type* __f, const value_type* __l, size_type __n,
- const hasher& __hf, const key_equal& __eql,
- const allocator_type& __a = allocator_type())
- : _M_ht(__n, __hf, __eql, __a)
- { _M_ht.insert_equal(__f, __l); }
-
- hash_multiset(const_iterator __f, const_iterator __l)
- : _M_ht(100, hasher(), key_equal(), allocator_type())
- { _M_ht.insert_equal(__f, __l); }
- hash_multiset(const_iterator __f, const_iterator __l, size_type __n)
- : _M_ht(__n, hasher(), key_equal(), allocator_type())
- { _M_ht.insert_equal(__f, __l); }
- hash_multiset(const_iterator __f, const_iterator __l, size_type __n,
- const hasher& __hf)
- : _M_ht(__n, __hf, key_equal(), allocator_type())
- { _M_ht.insert_equal(__f, __l); }
- hash_multiset(const_iterator __f, const_iterator __l, size_type __n,
- const hasher& __hf, const key_equal& __eql,
- const allocator_type& __a = allocator_type())
- : _M_ht(__n, __hf, __eql, __a)
- { _M_ht.insert_equal(__f, __l); }
-#endif /*__STL_MEMBER_TEMPLATES */
-
-public:
- size_type size() const { return _M_ht.size(); }
- size_type max_size() const { return _M_ht.max_size(); }
- bool empty() const { return _M_ht.empty(); }
- void swap(hash_multiset& hs) { _M_ht.swap(hs._M_ht); }
- friend bool operator== __STL_NULL_TMPL_ARGS (const hash_multiset&,
- const hash_multiset&);
-
- iterator begin() const { return _M_ht.begin(); }
- iterator end() const { return _M_ht.end(); }
-
-public:
- iterator insert(const value_type& __obj)
- { return _M_ht.insert_equal(__obj); }
-#ifdef __STL_MEMBER_TEMPLATES
- template <class _InputIterator>
- void insert(_InputIterator __f, _InputIterator __l)
- { _M_ht.insert_equal(__f,__l); }
-#else
- void insert(const value_type* __f, const value_type* __l) {
- _M_ht.insert_equal(__f,__l);
- }
- void insert(const_iterator __f, const_iterator __l)
- { _M_ht.insert_equal(__f, __l); }
-#endif /*__STL_MEMBER_TEMPLATES */
- iterator insert_noresize(const value_type& __obj)
- { return _M_ht.insert_equal_noresize(__obj); }
-
- iterator find(const key_type& __key) const { return _M_ht.find(__key); }
-
- size_type count(const key_type& __key) const { return _M_ht.count(__key); }
-
- pair<iterator, iterator> equal_range(const key_type& __key) const
- { return _M_ht.equal_range(__key); }
-
- size_type erase(const key_type& __key) {return _M_ht.erase(__key); }
- void erase(iterator __it) { _M_ht.erase(__it); }
- void erase(iterator __f, iterator __l) { _M_ht.erase(__f, __l); }
- void clear() { _M_ht.clear(); }
-
-public:
- void resize(size_type __hint) { _M_ht.resize(__hint); }
- size_type bucket_count() const { return _M_ht.bucket_count(); }
- size_type max_bucket_count() const { return _M_ht.max_bucket_count(); }
- size_type elems_in_bucket(size_type __n) const
- { return _M_ht.elems_in_bucket(__n); }
-};
-
-template <class _Val, class _HashFcn, class _EqualKey, class _Alloc>
-inline bool
-operator==(const hash_multiset<_Val,_HashFcn,_EqualKey,_Alloc>& __hs1,
- const hash_multiset<_Val,_HashFcn,_EqualKey,_Alloc>& __hs2)
-{
- return __hs1._M_ht == __hs2._M_ht;
-}
-
-#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER
-
-template <class _Val, class _HashFcn, class _EqualKey, class _Alloc>
-inline void
-swap(hash_multiset<_Val,_HashFcn,_EqualKey,_Alloc>& __hs1,
- hash_multiset<_Val,_HashFcn,_EqualKey,_Alloc>& __hs2) {
- __hs1.swap(__hs2);
-}
-
-#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */
-
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma reset woff 1174
-#pragma reset woff 1375
-#endif
-
-__STL_END_NAMESPACE
-
-#endif /* __SGI_STL_INTERNAL_HASH_SET_H */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/contrib/libstdc++/stl/stl_hashtable.h b/contrib/libstdc++/stl/stl_hashtable.h
deleted file mode 100644
index 78b36c1d5a04..000000000000
--- a/contrib/libstdc++/stl/stl_hashtable.h
+++ /dev/null
@@ -1,1039 +0,0 @@
-/*
- * Copyright (c) 1996,1997
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- */
-
-/* NOTE: This is an internal header file, included by other STL headers.
- * You should not attempt to use it directly.
- */
-
-#ifndef __SGI_STL_INTERNAL_HASHTABLE_H
-#define __SGI_STL_INTERNAL_HASHTABLE_H
-
-// Hashtable class, used to implement the hashed associative containers
-// hash_set, hash_map, hash_multiset, and hash_multimap.
-
-#include <stl_algobase.h>
-#include <stl_alloc.h>
-#include <stl_construct.h>
-#include <stl_tempbuf.h>
-#include <stl_algo.h>
-#include <stl_uninitialized.h>
-#include <stl_function.h>
-#include <stl_vector.h>
-#include <stl_hash_fun.h>
-
-__STL_BEGIN_NAMESPACE
-
-template <class _Val>
-struct _Hashtable_node
-{
- _Hashtable_node* _M_next;
- _Val _M_val;
-};
-
-template <class _Val, class _Key, class _HashFcn,
- class _ExtractKey, class _EqualKey, class _Alloc = alloc>
-class hashtable;
-
-template <class _Val, class _Key, class _HashFcn,
- class _ExtractKey, class _EqualKey, class _Alloc>
-struct _Hashtable_iterator;
-
-template <class _Val, class _Key, class _HashFcn,
- class _ExtractKey, class _EqualKey, class _Alloc>
-struct _Hashtable_const_iterator;
-
-template <class _Val, class _Key, class _HashFcn,
- class _ExtractKey, class _EqualKey, class _Alloc>
-struct _Hashtable_iterator {
- typedef hashtable<_Val,_Key,_HashFcn,_ExtractKey,_EqualKey,_Alloc>
- _Hashtable;
- typedef _Hashtable_iterator<_Val, _Key, _HashFcn,
- _ExtractKey, _EqualKey, _Alloc>
- iterator;
- typedef _Hashtable_const_iterator<_Val, _Key, _HashFcn,
- _ExtractKey, _EqualKey, _Alloc>
- const_iterator;
- typedef _Hashtable_node<_Val> _Node;
-
- typedef forward_iterator_tag iterator_category;
- typedef _Val value_type;
- typedef ptrdiff_t difference_type;
- typedef size_t size_type;
- typedef _Val& reference;
- typedef _Val* pointer;
-
- _Node* _M_cur;
- _Hashtable* _M_ht;
-
- _Hashtable_iterator(_Node* __n, _Hashtable* __tab)
- : _M_cur(__n), _M_ht(__tab) {}
- _Hashtable_iterator() {}
- reference operator*() const { return _M_cur->_M_val; }
-#ifndef __SGI_STL_NO_ARROW_OPERATOR
- pointer operator->() const { return &(operator*()); }
-#endif /* __SGI_STL_NO_ARROW_OPERATOR */
- iterator& operator++();
- iterator operator++(int);
- bool operator==(const iterator& __it) const
- { return _M_cur == __it._M_cur; }
- bool operator!=(const iterator& __it) const
- { return _M_cur != __it._M_cur; }
-};
-
-
-template <class _Val, class _Key, class _HashFcn,
- class _ExtractKey, class _EqualKey, class _Alloc>
-struct _Hashtable_const_iterator {
- typedef hashtable<_Val,_Key,_HashFcn,_ExtractKey,_EqualKey,_Alloc>
- _Hashtable;
- typedef _Hashtable_iterator<_Val,_Key,_HashFcn,
- _ExtractKey,_EqualKey,_Alloc>
- iterator;
- typedef _Hashtable_const_iterator<_Val, _Key, _HashFcn,
- _ExtractKey, _EqualKey, _Alloc>
- const_iterator;
- typedef _Hashtable_node<_Val> _Node;
-
- typedef forward_iterator_tag iterator_category;
- typedef _Val value_type;
- typedef ptrdiff_t difference_type;
- typedef size_t size_type;
- typedef const _Val& reference;
- typedef const _Val* pointer;
-
- const _Node* _M_cur;
- const _Hashtable* _M_ht;
-
- _Hashtable_const_iterator(const _Node* __n, const _Hashtable* __tab)
- : _M_cur(__n), _M_ht(__tab) {}
- _Hashtable_const_iterator() {}
- _Hashtable_const_iterator(const iterator& __it)
- : _M_cur(__it._M_cur), _M_ht(__it._M_ht) {}
- reference operator*() const { return _M_cur->_M_val; }
-#ifndef __SGI_STL_NO_ARROW_OPERATOR
- pointer operator->() const { return &(operator*()); }
-#endif /* __SGI_STL_NO_ARROW_OPERATOR */
- const_iterator& operator++();
- const_iterator operator++(int);
- bool operator==(const const_iterator& __it) const
- { return _M_cur == __it._M_cur; }
- bool operator!=(const const_iterator& __it) const
- { return _M_cur != __it._M_cur; }
-};
-
-// Note: assumes long is at least 32 bits.
-static const int __stl_num_primes = 28;
-static const unsigned long __stl_prime_list[__stl_num_primes] =
-{
- 53ul, 97ul, 193ul, 389ul, 769ul,
- 1543ul, 3079ul, 6151ul, 12289ul, 24593ul,
- 49157ul, 98317ul, 196613ul, 393241ul, 786433ul,
- 1572869ul, 3145739ul, 6291469ul, 12582917ul, 25165843ul,
- 50331653ul, 100663319ul, 201326611ul, 402653189ul, 805306457ul,
- 1610612741ul, 3221225473ul, 4294967291ul
-};
-
-inline unsigned long __stl_next_prime(unsigned long __n)
-{
- const unsigned long* __first = __stl_prime_list;
- const unsigned long* __last = __stl_prime_list + __stl_num_primes;
- const unsigned long* pos = lower_bound(__first, __last, __n);
- return pos == __last ? *(__last - 1) : *pos;
-}
-
-// Forward declaration of operator==.
-
-template <class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
-class hashtable;
-
-template <class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
-bool operator==(const hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>& __ht1,
- const hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>& __ht2);
-
-
-// Hashtables handle allocators a bit differently than other containers
-// do. If we're using standard-conforming allocators, then a hashtable
-// unconditionally has a member variable to hold its allocator, even if
-// it so happens that all instances of the allocator type are identical.
-// This is because, for hashtables, this extra storage is negligible.
-// Additionally, a base class wouldn't serve any other purposes; it
-// wouldn't, for example, simplify the exception-handling code.
-
-template <class _Val, class _Key, class _HashFcn,
- class _ExtractKey, class _EqualKey, class _Alloc>
-class hashtable {
-public:
- typedef _Key key_type;
- typedef _Val value_type;
- typedef _HashFcn hasher;
- typedef _EqualKey key_equal;
-
- typedef size_t size_type;
- typedef ptrdiff_t difference_type;
- typedef value_type* pointer;
- typedef const value_type* const_pointer;
- typedef value_type& reference;
- typedef const value_type& const_reference;
-
- hasher hash_funct() const { return _M_hash; }
- key_equal key_eq() const { return _M_equals; }
-
-private:
- typedef _Hashtable_node<_Val> _Node;
-
-#ifdef __STL_USE_STD_ALLOCATORS
-public:
- typedef typename _Alloc_traits<_Val,_Alloc>::allocator_type allocator_type;
- allocator_type get_allocator() const { return _M_node_allocator; }
-private:
- typename _Alloc_traits<_Node, _Alloc>::allocator_type _M_node_allocator;
- _Node* _M_get_node() { return _M_node_allocator.allocate(1); }
- void _M_put_node(_Node* __p) { _M_node_allocator.deallocate(__p, 1); }
-# define __HASH_ALLOC_INIT(__a) _M_node_allocator(__a),
-#else /* __STL_USE_STD_ALLOCATORS */
-public:
- typedef _Alloc allocator_type;
- allocator_type get_allocator() const { return allocator_type(); }
-private:
- typedef simple_alloc<_Node, _Alloc> _M_node_allocator_type;
- _Node* _M_get_node() { return _M_node_allocator_type::allocate(1); }
- void _M_put_node(_Node* __p) { _M_node_allocator_type::deallocate(__p, 1); }
-# define __HASH_ALLOC_INIT(__a)
-#endif /* __STL_USE_STD_ALLOCATORS */
-
-private:
- hasher _M_hash;
- key_equal _M_equals;
- _ExtractKey _M_get_key;
- vector<_Node*,_Alloc> _M_buckets;
- size_type _M_num_elements;
-
-public:
- typedef _Hashtable_iterator<_Val,_Key,_HashFcn,_ExtractKey,_EqualKey,_Alloc>
- iterator;
- typedef _Hashtable_const_iterator<_Val,_Key,_HashFcn,_ExtractKey,_EqualKey,
- _Alloc>
- const_iterator;
-
- friend struct
- _Hashtable_iterator<_Val,_Key,_HashFcn,_ExtractKey,_EqualKey,_Alloc>;
- friend struct
- _Hashtable_const_iterator<_Val,_Key,_HashFcn,_ExtractKey,_EqualKey,_Alloc>;
-
-public:
- hashtable(size_type __n,
- const _HashFcn& __hf,
- const _EqualKey& __eql,
- const _ExtractKey& __ext,
- const allocator_type& __a = allocator_type())
- : __HASH_ALLOC_INIT(__a)
- _M_hash(__hf),
- _M_equals(__eql),
- _M_get_key(__ext),
- _M_buckets(__a),
- _M_num_elements(0)
- {
- _M_initialize_buckets(__n);
- }
-
- hashtable(size_type __n,
- const _HashFcn& __hf,
- const _EqualKey& __eql,
- const allocator_type& __a = allocator_type())
- : __HASH_ALLOC_INIT(__a)
- _M_hash(__hf),
- _M_equals(__eql),
- _M_get_key(_ExtractKey()),
- _M_buckets(__a),
- _M_num_elements(0)
- {
- _M_initialize_buckets(__n);
- }
-
- hashtable(const hashtable& __ht)
- : __HASH_ALLOC_INIT(__ht.get_allocator())
- _M_hash(__ht._M_hash),
- _M_equals(__ht._M_equals),
- _M_get_key(__ht._M_get_key),
- _M_buckets(__ht.get_allocator()),
- _M_num_elements(0)
- {
- _M_copy_from(__ht);
- }
-
-#undef __HASH_ALLOC_INIT
-
- hashtable& operator= (const hashtable& __ht)
- {
- if (&__ht != this) {
- clear();
- _M_hash = __ht._M_hash;
- _M_equals = __ht._M_equals;
- _M_get_key = __ht._M_get_key;
- _M_copy_from(__ht);
- }
- return *this;
- }
-
- ~hashtable() { clear(); }
-
- size_type size() const { return _M_num_elements; }
- size_type max_size() const { return size_type(-1); }
- bool empty() const { return size() == 0; }
-
- void swap(hashtable& __ht)
- {
- __STD::swap(_M_hash, __ht._M_hash);
- __STD::swap(_M_equals, __ht._M_equals);
- __STD::swap(_M_get_key, __ht._M_get_key);
- _M_buckets.swap(__ht._M_buckets);
- __STD::swap(_M_num_elements, __ht._M_num_elements);
- }
-
- iterator begin()
- {
- for (size_type __n = 0; __n < _M_buckets.size(); ++__n)
- if (_M_buckets[__n])
- return iterator(_M_buckets[__n], this);
- return end();
- }
-
- iterator end() { return iterator(0, this); }
-
- const_iterator begin() const
- {
- for (size_type __n = 0; __n < _M_buckets.size(); ++__n)
- if (_M_buckets[__n])
- return const_iterator(_M_buckets[__n], this);
- return end();
- }
-
- const_iterator end() const { return const_iterator(0, this); }
-
- friend bool
- operator== __STL_NULL_TMPL_ARGS (const hashtable&, const hashtable&);
-
-public:
-
- size_type bucket_count() const { return _M_buckets.size(); }
-
- size_type max_bucket_count() const
- { return __stl_prime_list[__stl_num_primes - 1]; }
-
- size_type elems_in_bucket(size_type __bucket) const
- {
- size_type __result = 0;
- for (_Node* __cur = _M_buckets[__bucket]; __cur; __cur = __cur->_M_next)
- __result += 1;
- return __result;
- }
-
- pair<iterator, bool> insert_unique(const value_type& __obj)
- {
- resize(_M_num_elements + 1);
- return insert_unique_noresize(__obj);
- }
-
- iterator insert_equal(const value_type& __obj)
- {
- resize(_M_num_elements + 1);
- return insert_equal_noresize(__obj);
- }
-
- pair<iterator, bool> insert_unique_noresize(const value_type& __obj);
- iterator insert_equal_noresize(const value_type& __obj);
-
-#ifdef __STL_MEMBER_TEMPLATES
- template <class _InputIterator>
- void insert_unique(_InputIterator __f, _InputIterator __l)
- {
- insert_unique(__f, __l, __ITERATOR_CATEGORY(__f));
- }
-
- template <class _InputIterator>
- void insert_equal(_InputIterator __f, _InputIterator __l)
- {
- insert_equal(__f, __l, __ITERATOR_CATEGORY(__f));
- }
-
- template <class _InputIterator>
- void insert_unique(_InputIterator __f, _InputIterator __l,
- input_iterator_tag)
- {
- for ( ; __f != __l; ++__f)
- insert_unique(*__f);
- }
-
- template <class _InputIterator>
- void insert_equal(_InputIterator __f, _InputIterator __l,
- input_iterator_tag)
- {
- for ( ; __f != __l; ++__f)
- insert_equal(*__f);
- }
-
- template <class _ForwardIterator>
- void insert_unique(_ForwardIterator __f, _ForwardIterator __l,
- forward_iterator_tag)
- {
- size_type __n = 0;
- distance(__f, __l, __n);
- resize(_M_num_elements + __n);
- for ( ; __n > 0; --__n, ++__f)
- insert_unique_noresize(*__f);
- }
-
- template <class _ForwardIterator>
- void insert_equal(_ForwardIterator __f, _ForwardIterator __l,
- forward_iterator_tag)
- {
- size_type __n = 0;
- distance(__f, __l, __n);
- resize(_M_num_elements + __n);
- for ( ; __n > 0; --__n, ++__f)
- insert_equal_noresize(*__f);
- }
-
-#else /* __STL_MEMBER_TEMPLATES */
- void insert_unique(const value_type* __f, const value_type* __l)
- {
- size_type __n = __l - __f;
- resize(_M_num_elements + __n);
- for ( ; __n > 0; --__n, ++__f)
- insert_unique_noresize(*__f);
- }
-
- void insert_equal(const value_type* __f, const value_type* __l)
- {
- size_type __n = __l - __f;
- resize(_M_num_elements + __n);
- for ( ; __n > 0; --__n, ++__f)
- insert_equal_noresize(*__f);
- }
-
- void insert_unique(const_iterator __f, const_iterator __l)
- {
- size_type __n = 0;
- distance(__f, __l, __n);
- resize(_M_num_elements + __n);
- for ( ; __n > 0; --__n, ++__f)
- insert_unique_noresize(*__f);
- }
-
- void insert_equal(const_iterator __f, const_iterator __l)
- {
- size_type __n = 0;
- distance(__f, __l, __n);
- resize(_M_num_elements + __n);
- for ( ; __n > 0; --__n, ++__f)
- insert_equal_noresize(*__f);
- }
-#endif /*__STL_MEMBER_TEMPLATES */
-
- reference find_or_insert(const value_type& __obj);
-
- iterator find(const key_type& __key)
- {
- size_type __n = _M_bkt_num_key(__key);
- _Node* __first;
- for ( __first = _M_buckets[__n];
- __first && !_M_equals(_M_get_key(__first->_M_val), __key);
- __first = __first->_M_next)
- {}
- return iterator(__first, this);
- }
-
- const_iterator find(const key_type& __key) const
- {
- size_type __n = _M_bkt_num_key(__key);
- const _Node* __first;
- for ( __first = _M_buckets[__n];
- __first && !_M_equals(_M_get_key(__first->_M_val), __key);
- __first = __first->_M_next)
- {}
- return const_iterator(__first, this);
- }
-
- size_type count(const key_type& __key) const
- {
- const size_type __n = _M_bkt_num_key(__key);
- size_type __result = 0;
-
- for (const _Node* __cur = _M_buckets[__n]; __cur; __cur = __cur->_M_next)
- if (_M_equals(_M_get_key(__cur->_M_val), __key))
- ++__result;
- return __result;
- }
-
- pair<iterator, iterator>
- equal_range(const key_type& __key);
-
- pair<const_iterator, const_iterator>
- equal_range(const key_type& __key) const;
-
- size_type erase(const key_type& __key);
- void erase(const iterator& __it);
- void erase(iterator __first, iterator __last);
-
- void erase(const const_iterator& __it);
- void erase(const_iterator __first, const_iterator __last);
-
- void resize(size_type __num_elements_hint);
- void clear();
-
-private:
- size_type _M_next_size(size_type __n) const
- { return __stl_next_prime(__n); }
-
- void _M_initialize_buckets(size_type __n)
- {
- const size_type __n_buckets = _M_next_size(__n);
- _M_buckets.reserve(__n_buckets);
- _M_buckets.insert(_M_buckets.end(), __n_buckets, (_Node*) 0);
- _M_num_elements = 0;
- }
-
- size_type _M_bkt_num_key(const key_type& __key) const
- {
- return _M_bkt_num_key(__key, _M_buckets.size());
- }
-
- size_type _M_bkt_num(const value_type& __obj) const
- {
- return _M_bkt_num_key(_M_get_key(__obj));
- }
-
- size_type _M_bkt_num_key(const key_type& __key, size_t __n) const
- {
- return _M_hash(__key) % __n;
- }
-
- size_type _M_bkt_num(const value_type& __obj, size_t __n) const
- {
- return _M_bkt_num_key(_M_get_key(__obj), __n);
- }
-
- _Node* _M_new_node(const value_type& __obj)
- {
- _Node* __n = _M_get_node();
- __n->_M_next = 0;
- __STL_TRY {
- construct(&__n->_M_val, __obj);
- return __n;
- }
- __STL_UNWIND(_M_put_node(__n));
- }
-
- void _M_delete_node(_Node* __n)
- {
- destroy(&__n->_M_val);
- _M_put_node(__n);
- }
-
- void _M_erase_bucket(const size_type __n, _Node* __first, _Node* __last);
- void _M_erase_bucket(const size_type __n, _Node* __last);
-
- void _M_copy_from(const hashtable& __ht);
-
-};
-
-template <class _Val, class _Key, class _HF, class _ExK, class _EqK,
- class _All>
-_Hashtable_iterator<_Val,_Key,_HF,_ExK,_EqK,_All>&
-_Hashtable_iterator<_Val,_Key,_HF,_ExK,_EqK,_All>::operator++()
-{
- const _Node* __old = _M_cur;
- _M_cur = _M_cur->_M_next;
- if (!_M_cur) {
- size_type __bucket = _M_ht->_M_bkt_num(__old->_M_val);
- while (!_M_cur && ++__bucket < _M_ht->_M_buckets.size())
- _M_cur = _M_ht->_M_buckets[__bucket];
- }
- return *this;
-}
-
-template <class _Val, class _Key, class _HF, class _ExK, class _EqK,
- class _All>
-inline _Hashtable_iterator<_Val,_Key,_HF,_ExK,_EqK,_All>
-_Hashtable_iterator<_Val,_Key,_HF,_ExK,_EqK,_All>::operator++(int)
-{
- iterator __tmp = *this;
- ++*this;
- return __tmp;
-}
-
-template <class _Val, class _Key, class _HF, class _ExK, class _EqK,
- class _All>
-_Hashtable_const_iterator<_Val,_Key,_HF,_ExK,_EqK,_All>&
-_Hashtable_const_iterator<_Val,_Key,_HF,_ExK,_EqK,_All>::operator++()
-{
- const _Node* __old = _M_cur;
- _M_cur = _M_cur->_M_next;
- if (!_M_cur) {
- size_type __bucket = _M_ht->_M_bkt_num(__old->_M_val);
- while (!_M_cur && ++__bucket < _M_ht->_M_buckets.size())
- _M_cur = _M_ht->_M_buckets[__bucket];
- }
- return *this;
-}
-
-template <class _Val, class _Key, class _HF, class _ExK, class _EqK,
- class _All>
-inline _Hashtable_const_iterator<_Val,_Key,_HF,_ExK,_EqK,_All>
-_Hashtable_const_iterator<_Val,_Key,_HF,_ExK,_EqK,_All>::operator++(int)
-{
- const_iterator __tmp = *this;
- ++*this;
- return __tmp;
-}
-
-#ifndef __STL_CLASS_PARTIAL_SPECIALIZATION
-
-template <class _Val, class _Key, class _HF, class _ExK, class _EqK,
- class _All>
-inline forward_iterator_tag
-iterator_category(const _Hashtable_iterator<_Val,_Key,_HF,_ExK,_EqK,_All>&)
-{
- return forward_iterator_tag();
-}
-
-template <class _Val, class _Key, class _HF, class _ExK, class _EqK,
- class _All>
-inline _Val*
-value_type(const _Hashtable_iterator<_Val,_Key,_HF,_ExK,_EqK,_All>&)
-{
- return (_Val*) 0;
-}
-
-template <class _Val, class _Key, class _HF, class _ExK, class _EqK,
- class _All>
-inline hashtable<_Val,_Key,_HF,_ExK,_EqK,_All>::difference_type*
-distance_type(const _Hashtable_iterator<_Val,_Key,_HF,_ExK,_EqK,_All>&)
-{
- return (hashtable<_Val,_Key,_HF,_ExK,_EqK,_All>::difference_type*) 0;
-}
-
-template <class _Val, class _Key, class _HF, class _ExK, class _EqK,
- class _All>
-inline forward_iterator_tag
-iterator_category(const _Hashtable_const_iterator<_Val,_Key,_HF,
- _ExK,_EqK,_All>&)
-{
- return forward_iterator_tag();
-}
-
-template <class _Val, class _Key, class _HF, class _ExK, class _EqK,
- class _All>
-inline _Val*
-value_type(const _Hashtable_const_iterator<_Val,_Key,_HF,_ExK,_EqK,_All>&)
-{
- return (_Val*) 0;
-}
-
-template <class _Val, class _Key, class _HF, class _ExK, class _EqK,
- class _All>
-inline hashtable<_Val,_Key,_HF,_ExK,_EqK,_All>::difference_type*
-distance_type(const _Hashtable_const_iterator<_Val,_Key,_HF,_ExK,_EqK,_All>&)
-{
- return (hashtable<_Val,_Key,_HF,_ExK,_EqK,_All>::difference_type*) 0;
-}
-
-#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
-
-template <class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
-inline bool operator==(const hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>& __ht1,
- const hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>& __ht2)
-{
- typedef typename hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::_Node _Node;
- if (__ht1._M_buckets.size() != __ht2._M_buckets.size())
- return false;
- for (int __n = 0; __n < __ht1._M_buckets.size(); ++__n) {
- _Node* __cur1 = __ht1._M_buckets[__n];
- _Node* __cur2 = __ht2._M_buckets[__n];
- for ( ; __cur1 && __cur2 && __cur1->_M_val == __cur2->_M_val;
- __cur1 = __cur1->_M_next, __cur2 = __cur2->_M_next)
- {}
- if (__cur1 || __cur2)
- return false;
- }
- return true;
-}
-
-#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER
-
-template <class _Val, class _Key, class _HF, class _Extract, class _EqKey,
- class _All>
-inline void swap(hashtable<_Val, _Key, _HF, _Extract, _EqKey, _All>& __ht1,
- hashtable<_Val, _Key, _HF, _Extract, _EqKey, _All>& __ht2) {
- __ht1.swap(__ht2);
-}
-
-#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */
-
-
-template <class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
-pair<typename hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::iterator, bool>
-hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>
- ::insert_unique_noresize(const value_type& __obj)
-{
- const size_type __n = _M_bkt_num(__obj);
- _Node* __first = _M_buckets[__n];
-
- for (_Node* __cur = __first; __cur; __cur = __cur->_M_next)
- if (_M_equals(_M_get_key(__cur->_M_val), _M_get_key(__obj)))
- return pair<iterator, bool>(iterator(__cur, this), false);
-
- _Node* __tmp = _M_new_node(__obj);
- __tmp->_M_next = __first;
- _M_buckets[__n] = __tmp;
- ++_M_num_elements;
- return pair<iterator, bool>(iterator(__tmp, this), true);
-}
-
-template <class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
-typename hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::iterator
-hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>
- ::insert_equal_noresize(const value_type& __obj)
-{
- const size_type __n = _M_bkt_num(__obj);
- _Node* __first = _M_buckets[__n];
-
- for (_Node* __cur = __first; __cur; __cur = __cur->_M_next)
- if (_M_equals(_M_get_key(__cur->_M_val), _M_get_key(__obj))) {
- _Node* __tmp = _M_new_node(__obj);
- __tmp->_M_next = __cur->_M_next;
- __cur->_M_next = __tmp;
- ++_M_num_elements;
- return iterator(__tmp, this);
- }
-
- _Node* __tmp = _M_new_node(__obj);
- __tmp->_M_next = __first;
- _M_buckets[__n] = __tmp;
- ++_M_num_elements;
- return iterator(__tmp, this);
-}
-
-template <class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
-typename hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::reference
-hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::find_or_insert(const value_type& __obj)
-{
- resize(_M_num_elements + 1);
-
- size_type __n = _M_bkt_num(__obj);
- _Node* __first = _M_buckets[__n];
-
- for (_Node* __cur = __first; __cur; __cur = __cur->_M_next)
- if (_M_equals(_M_get_key(__cur->_M_val), _M_get_key(__obj)))
- return __cur->_M_val;
-
- _Node* __tmp = _M_new_node(__obj);
- __tmp->_M_next = __first;
- _M_buckets[__n] = __tmp;
- ++_M_num_elements;
- return __tmp->_M_val;
-}
-
-template <class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
-pair<typename hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::iterator,
- typename hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::iterator>
-hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::equal_range(const key_type& __key)
-{
- typedef pair<iterator, iterator> _Pii;
- const size_type __n = _M_bkt_num_key(__key);
-
- for (_Node* __first = _M_buckets[__n]; __first; __first = __first->_M_next)
- if (_M_equals(_M_get_key(__first->_M_val), __key)) {
- for (_Node* __cur = __first->_M_next; __cur; __cur = __cur->_M_next)
- if (!_M_equals(_M_get_key(__cur->_M_val), __key))
- return _Pii(iterator(__first, this), iterator(__cur, this));
- for (size_type __m = __n + 1; __m < _M_buckets.size(); ++__m)
- if (_M_buckets[__m])
- return _Pii(iterator(__first, this),
- iterator(_M_buckets[__m], this));
- return _Pii(iterator(__first, this), end());
- }
- return _Pii(end(), end());
-}
-
-template <class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
-pair<typename hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::const_iterator,
- typename hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::const_iterator>
-hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>
- ::equal_range(const key_type& __key) const
-{
- typedef pair<const_iterator, const_iterator> _Pii;
- const size_type __n = _M_bkt_num_key(__key);
-
- for (const _Node* __first = _M_buckets[__n] ;
- __first;
- __first = __first->_M_next) {
- if (_M_equals(_M_get_key(__first->_M_val), __key)) {
- for (const _Node* __cur = __first->_M_next;
- __cur;
- __cur = __cur->_M_next)
- if (!_M_equals(_M_get_key(__cur->_M_val), __key))
- return _Pii(const_iterator(__first, this),
- const_iterator(__cur, this));
- for (size_type __m = __n + 1; __m < _M_buckets.size(); ++__m)
- if (_M_buckets[__m])
- return _Pii(const_iterator(__first, this),
- const_iterator(_M_buckets[__m], this));
- return _Pii(const_iterator(__first, this), end());
- }
- }
- return _Pii(end(), end());
-}
-
-template <class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
-typename hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::size_type
-hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::erase(const key_type& __key)
-{
- const size_type __n = _M_bkt_num_key(__key);
- _Node* __first = _M_buckets[__n];
- size_type __erased = 0;
-
- if (__first) {
- _Node* __cur = __first;
- _Node* __next = __cur->_M_next;
- while (__next) {
- if (_M_equals(_M_get_key(__next->_M_val), __key)) {
- __cur->_M_next = __next->_M_next;
- _M_delete_node(__next);
- __next = __cur->_M_next;
- ++__erased;
- --_M_num_elements;
- }
- else {
- __cur = __next;
- __next = __cur->_M_next;
- }
- }
- if (_M_equals(_M_get_key(__first->_M_val), __key)) {
- _M_buckets[__n] = __first->_M_next;
- _M_delete_node(__first);
- ++__erased;
- --_M_num_elements;
- }
- }
- return __erased;
-}
-
-template <class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
-void hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::erase(const iterator& __it)
-{
- if (_Node* const __p = __it._M_cur) {
- const size_type __n = _M_bkt_num(__p->_M_val);
- _Node* __cur = _M_buckets[__n];
-
- if (__cur == __p) {
- _M_buckets[__n] = __cur->_M_next;
- _M_delete_node(__cur);
- --_M_num_elements;
- }
- else {
- _Node* __next = __cur->_M_next;
- while (__next) {
- if (__next == __p) {
- __cur->_M_next = __next->_M_next;
- _M_delete_node(__next);
- --_M_num_elements;
- break;
- }
- else {
- __cur = __next;
- __next = __cur->_M_next;
- }
- }
- }
- }
-}
-
-template <class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
-void hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>
- ::erase(iterator __first, iterator __last)
-{
- size_type __f_bucket = __first._M_cur ?
- _M_bkt_num(__first._M_cur->_M_val) : _M_buckets.size();
- size_type __l_bucket = __last._M_cur ?
- _M_bkt_num(__last._M_cur->_M_val) : _M_buckets.size();
-
- if (__first._M_cur == __last._M_cur)
- return;
- else if (__f_bucket == __l_bucket)
- _M_erase_bucket(__f_bucket, __first._M_cur, __last._M_cur);
- else {
- _M_erase_bucket(__f_bucket, __first._M_cur, 0);
- for (size_type __n = __f_bucket + 1; __n < __l_bucket; ++__n)
- _M_erase_bucket(__n, 0);
- if (__l_bucket != _M_buckets.size())
- _M_erase_bucket(__l_bucket, __last._M_cur);
- }
-}
-
-template <class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
-inline void
-hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::erase(const_iterator __first,
- const_iterator __last)
-{
- erase(iterator(const_cast<_Node*>(__first._M_cur),
- const_cast<hashtable*>(__first._M_ht)),
- iterator(const_cast<_Node*>(__last._M_cur),
- const_cast<hashtable*>(__last._M_ht)));
-}
-
-template <class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
-inline void
-hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::erase(const const_iterator& __it)
-{
- erase(iterator(const_cast<_Node*>(__it._M_cur),
- const_cast<hashtable*>(__it._M_ht)));
-}
-
-template <class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
-void hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>
- ::resize(size_type __num_elements_hint)
-{
- const size_type __old_n = _M_buckets.size();
- if (__num_elements_hint > __old_n) {
- const size_type __n = _M_next_size(__num_elements_hint);
- if (__n > __old_n) {
- vector<_Node*, _All> __tmp(__n, (_Node*)(0),
- _M_buckets.get_allocator());
- __STL_TRY {
- for (size_type __bucket = 0; __bucket < __old_n; ++__bucket) {
- _Node* __first = _M_buckets[__bucket];
- while (__first) {
- size_type __new_bucket = _M_bkt_num(__first->_M_val, __n);
- _M_buckets[__bucket] = __first->_M_next;
- __first->_M_next = __tmp[__new_bucket];
- __tmp[__new_bucket] = __first;
- __first = _M_buckets[__bucket];
- }
- }
- _M_buckets.swap(__tmp);
- }
-# ifdef __STL_USE_EXCEPTIONS
- catch(...) {
- for (size_type __bucket = 0; __bucket < __tmp.size(); ++__bucket) {
- while (__tmp[__bucket]) {
- _Node* __next = __tmp[__bucket]->_M_next;
- _M_delete_node(__tmp[__bucket]);
- __tmp[__bucket] = __next;
- }
- }
- throw;
- }
-# endif /* __STL_USE_EXCEPTIONS */
- }
- }
-}
-
-template <class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
-void hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>
- ::_M_erase_bucket(const size_type __n, _Node* __first, _Node* __last)
-{
- _Node* __cur = _M_buckets[__n];
- if (__cur == __first)
- _M_erase_bucket(__n, __last);
- else {
- _Node* __next;
- for (__next = __cur->_M_next;
- __next != __first;
- __cur = __next, __next = __cur->_M_next)
- ;
- while (__next) {
- __cur->_M_next = __next->_M_next;
- _M_delete_node(__next);
- __next = __cur->_M_next;
- --_M_num_elements;
- }
- }
-}
-
-template <class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
-void hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>
- ::_M_erase_bucket(const size_type __n, _Node* __last)
-{
- _Node* __cur = _M_buckets[__n];
- while (__cur != __last) {
- _Node* __next = __cur->_M_next;
- _M_delete_node(__cur);
- __cur = __next;
- _M_buckets[__n] = __cur;
- --_M_num_elements;
- }
-}
-
-template <class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
-void hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::clear()
-{
- for (size_type __i = 0; __i < _M_buckets.size(); ++__i) {
- _Node* __cur = _M_buckets[__i];
- while (__cur != 0) {
- _Node* __next = __cur->_M_next;
- _M_delete_node(__cur);
- __cur = __next;
- }
- _M_buckets[__i] = 0;
- }
- _M_num_elements = 0;
-}
-
-
-template <class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
-void hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>
- ::_M_copy_from(const hashtable& __ht)
-{
- _M_buckets.clear();
- _M_buckets.reserve(__ht._M_buckets.size());
- _M_buckets.insert(_M_buckets.end(), __ht._M_buckets.size(), (_Node*) 0);
- __STL_TRY {
- for (size_type __i = 0; __i < __ht._M_buckets.size(); ++__i) {
- if (const _Node* __cur = __ht._M_buckets[__i]) {
- _Node* __copy = _M_new_node(__cur->_M_val);
- _M_buckets[__i] = __copy;
-
- for (_Node* __next = __cur->_M_next;
- __next;
- __cur = __next, __next = __cur->_M_next) {
- __copy->_M_next = _M_new_node(__next->_M_val);
- __copy = __copy->_M_next;
- }
- }
- }
- _M_num_elements = __ht._M_num_elements;
- }
- __STL_UNWIND(clear());
-}
-
-__STL_END_NAMESPACE
-
-#endif /* __SGI_STL_INTERNAL_HASHTABLE_H */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/contrib/libstdc++/stl/stl_heap.h b/contrib/libstdc++/stl/stl_heap.h
deleted file mode 100644
index 62f142ec9706..000000000000
--- a/contrib/libstdc++/stl/stl_heap.h
+++ /dev/null
@@ -1,281 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- * Copyright (c) 1997
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- */
-
-/* NOTE: This is an internal header file, included by other STL headers.
- * You should not attempt to use it directly.
- */
-
-#ifndef __SGI_STL_INTERNAL_HEAP_H
-#define __SGI_STL_INTERNAL_HEAP_H
-
-__STL_BEGIN_NAMESPACE
-
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma set woff 1209
-#endif
-
-// Heap-manipulation functions: push_heap, pop_heap, make_heap, sort_heap.
-
-template <class _RandomAccessIterator, class _Distance, class _Tp>
-void
-__push_heap(_RandomAccessIterator __first,
- _Distance __holeIndex, _Distance __topIndex, _Tp __value)
-{
- _Distance __parent = (__holeIndex - 1) / 2;
- while (__holeIndex > __topIndex && *(__first + __parent) < __value) {
- *(__first + __holeIndex) = *(__first + __parent);
- __holeIndex = __parent;
- __parent = (__holeIndex - 1) / 2;
- }
- *(__first + __holeIndex) = __value;
-}
-
-template <class _RandomAccessIterator, class _Distance, class _Tp>
-inline void
-__push_heap_aux(_RandomAccessIterator __first,
- _RandomAccessIterator __last, _Distance*, _Tp*)
-{
- __push_heap(__first, _Distance((__last - __first) - 1), _Distance(0),
- _Tp(*(__last - 1)));
-}
-
-template <class _RandomAccessIterator>
-inline void
-push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
-{
- __push_heap_aux(__first, __last,
- __DISTANCE_TYPE(__first), __VALUE_TYPE(__first));
-}
-
-template <class _RandomAccessIterator, class _Distance, class _Tp,
- class _Compare>
-void
-__push_heap(_RandomAccessIterator __first, _Distance __holeIndex,
- _Distance __topIndex, _Tp __value, _Compare __comp)
-{
- _Distance __parent = (__holeIndex - 1) / 2;
- while (__holeIndex > __topIndex && __comp(*(__first + __parent), __value)) {
- *(__first + __holeIndex) = *(__first + __parent);
- __holeIndex = __parent;
- __parent = (__holeIndex - 1) / 2;
- }
- *(__first + __holeIndex) = __value;
-}
-
-template <class _RandomAccessIterator, class _Compare,
- class _Distance, class _Tp>
-inline void
-__push_heap_aux(_RandomAccessIterator __first,
- _RandomAccessIterator __last, _Compare __comp,
- _Distance*, _Tp*)
-{
- __push_heap(__first, _Distance((__last - __first) - 1), _Distance(0),
- _Tp(*(__last - 1)), __comp);
-}
-
-template <class _RandomAccessIterator, class _Compare>
-inline void
-push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
- _Compare __comp)
-{
- __push_heap_aux(__first, __last, __comp,
- __DISTANCE_TYPE(__first), __VALUE_TYPE(__first));
-}
-
-template <class _RandomAccessIterator, class _Distance, class _Tp>
-void
-__adjust_heap(_RandomAccessIterator __first, _Distance __holeIndex,
- _Distance __len, _Tp __value)
-{
- _Distance __topIndex = __holeIndex;
- _Distance __secondChild = 2 * __holeIndex + 2;
- while (__secondChild < __len) {
- if (*(__first + __secondChild) < *(__first + (__secondChild - 1)))
- __secondChild--;
- *(__first + __holeIndex) = *(__first + __secondChild);
- __holeIndex = __secondChild;
- __secondChild = 2 * (__secondChild + 1);
- }
- if (__secondChild == __len) {
- *(__first + __holeIndex) = *(__first + (__secondChild - 1));
- __holeIndex = __secondChild - 1;
- }
- __push_heap(__first, __holeIndex, __topIndex, __value);
-}
-
-template <class _RandomAccessIterator, class _Tp, class _Distance>
-inline void
-__pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
- _RandomAccessIterator __result, _Tp __value, _Distance*)
-{
- *__result = *__first;
- __adjust_heap(__first, _Distance(0), _Distance(__last - __first), __value);
-}
-
-template <class _RandomAccessIterator, class _Tp>
-inline void
-__pop_heap_aux(_RandomAccessIterator __first, _RandomAccessIterator __last,
- _Tp*)
-{
- __pop_heap(__first, __last - 1, __last - 1,
- _Tp(*(__last - 1)), __DISTANCE_TYPE(__first));
-}
-
-template <class _RandomAccessIterator>
-inline void pop_heap(_RandomAccessIterator __first,
- _RandomAccessIterator __last)
-{
- __pop_heap_aux(__first, __last, __VALUE_TYPE(__first));
-}
-
-template <class _RandomAccessIterator, class _Distance,
- class _Tp, class _Compare>
-void
-__adjust_heap(_RandomAccessIterator __first, _Distance __holeIndex,
- _Distance __len, _Tp __value, _Compare __comp)
-{
- _Distance __topIndex = __holeIndex;
- _Distance __secondChild = 2 * __holeIndex + 2;
- while (__secondChild < __len) {
- if (__comp(*(__first + __secondChild), *(__first + (__secondChild - 1))))
- __secondChild--;
- *(__first + __holeIndex) = *(__first + __secondChild);
- __holeIndex = __secondChild;
- __secondChild = 2 * (__secondChild + 1);
- }
- if (__secondChild == __len) {
- *(__first + __holeIndex) = *(__first + (__secondChild - 1));
- __holeIndex = __secondChild - 1;
- }
- __push_heap(__first, __holeIndex, __topIndex, __value, __comp);
-}
-
-template <class _RandomAccessIterator, class _Tp, class _Compare,
- class _Distance>
-inline void
-__pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
- _RandomAccessIterator __result, _Tp __value, _Compare __comp,
- _Distance*)
-{
- *__result = *__first;
- __adjust_heap(__first, _Distance(0), _Distance(__last - __first),
- __value, __comp);
-}
-
-template <class _RandomAccessIterator, class _Tp, class _Compare>
-inline void
-__pop_heap_aux(_RandomAccessIterator __first,
- _RandomAccessIterator __last, _Tp*, _Compare __comp)
-{
- __pop_heap(__first, __last - 1, __last - 1, _Tp(*(__last - 1)), __comp,
- __DISTANCE_TYPE(__first));
-}
-
-template <class _RandomAccessIterator, class _Compare>
-inline void
-pop_heap(_RandomAccessIterator __first,
- _RandomAccessIterator __last, _Compare __comp)
-{
- __pop_heap_aux(__first, __last, __VALUE_TYPE(__first), __comp);
-}
-
-template <class _RandomAccessIterator, class _Tp, class _Distance>
-void
-__make_heap(_RandomAccessIterator __first,
- _RandomAccessIterator __last, _Tp*, _Distance*)
-{
- if (__last - __first < 2) return;
- _Distance __len = __last - __first;
- _Distance __parent = (__len - 2)/2;
-
- while (true) {
- __adjust_heap(__first, __parent, __len, _Tp(*(__first + __parent)));
- if (__parent == 0) return;
- __parent--;
- }
-}
-
-template <class _RandomAccessIterator>
-inline void
-make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
-{
- __make_heap(__first, __last,
- __VALUE_TYPE(__first), __DISTANCE_TYPE(__first));
-}
-
-template <class _RandomAccessIterator, class _Compare,
- class _Tp, class _Distance>
-void
-__make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
- _Compare __comp, _Tp*, _Distance*)
-{
- if (__last - __first < 2) return;
- _Distance __len = __last - __first;
- _Distance __parent = (__len - 2)/2;
-
- while (true) {
- __adjust_heap(__first, __parent, __len, _Tp(*(__first + __parent)),
- __comp);
- if (__parent == 0) return;
- __parent--;
- }
-}
-
-template <class _RandomAccessIterator, class _Compare>
-inline void
-make_heap(_RandomAccessIterator __first,
- _RandomAccessIterator __last, _Compare __comp)
-{
- __make_heap(__first, __last, __comp,
- __VALUE_TYPE(__first), __DISTANCE_TYPE(__first));
-}
-
-template <class _RandomAccessIterator>
-void sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
-{
- while (__last - __first > 1)
- pop_heap(__first, __last--);
-}
-
-template <class _RandomAccessIterator, class _Compare>
-void
-sort_heap(_RandomAccessIterator __first,
- _RandomAccessIterator __last, _Compare __comp)
-{
- while (__last - __first > 1)
- pop_heap(__first, __last--, __comp);
-}
-
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma reset woff 1209
-#endif
-
-__STL_END_NAMESPACE
-
-#endif /* __SGI_STL_INTERNAL_HEAP_H */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/contrib/libstdc++/stl/stl_iterator.h b/contrib/libstdc++/stl/stl_iterator.h
deleted file mode 100644
index e2bd7149692c..000000000000
--- a/contrib/libstdc++/stl/stl_iterator.h
+++ /dev/null
@@ -1,915 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- *
- * Copyright (c) 1996-1998
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- */
-
-/* NOTE: This is an internal header file, included by other STL headers.
- * You should not attempt to use it directly.
- */
-
-#ifndef __SGI_STL_INTERNAL_ITERATOR_H
-#define __SGI_STL_INTERNAL_ITERATOR_H
-
-__STL_BEGIN_NAMESPACE
-
-struct input_iterator_tag {};
-struct output_iterator_tag {};
-struct forward_iterator_tag : public input_iterator_tag {};
-struct bidirectional_iterator_tag : public forward_iterator_tag {};
-struct random_access_iterator_tag : public bidirectional_iterator_tag {};
-
-// The base classes input_iterator, output_iterator, forward_iterator,
-// bidirectional_iterator, and random_access_iterator are not part of
-// the C++ standard. (they have been replaced by struct iterator.)
-// They are included for backward compatibility with the HP STL.
-
-template <class _Tp, class _Distance> struct input_iterator {
- typedef input_iterator_tag iterator_category;
- typedef _Tp value_type;
- typedef _Distance difference_type;
- typedef _Tp* pointer;
- typedef _Tp& reference;
-};
-
-struct output_iterator {
- typedef output_iterator_tag iterator_category;
- typedef void value_type;
- typedef void difference_type;
- typedef void pointer;
- typedef void reference;
-};
-
-template <class _Tp, class _Distance> struct forward_iterator {
- typedef forward_iterator_tag iterator_category;
- typedef _Tp value_type;
- typedef _Distance difference_type;
- typedef _Tp* pointer;
- typedef _Tp& reference;
-};
-
-
-template <class _Tp, class _Distance> struct bidirectional_iterator {
- typedef bidirectional_iterator_tag iterator_category;
- typedef _Tp value_type;
- typedef _Distance difference_type;
- typedef _Tp* pointer;
- typedef _Tp& reference;
-};
-
-template <class _Tp, class _Distance> struct random_access_iterator {
- typedef random_access_iterator_tag iterator_category;
- typedef _Tp value_type;
- typedef _Distance difference_type;
- typedef _Tp* pointer;
- typedef _Tp& reference;
-};
-
-#ifdef __STL_USE_NAMESPACES
-template <class _Category, class _Tp, class _Distance = ptrdiff_t,
- class _Pointer = _Tp*, class _Reference = _Tp&>
-struct iterator {
- typedef _Category iterator_category;
- typedef _Tp value_type;
- typedef _Distance difference_type;
- typedef _Pointer pointer;
- typedef _Reference reference;
-};
-#endif /* __STL_USE_NAMESPACES */
-
-#ifdef __STL_CLASS_PARTIAL_SPECIALIZATION
-
-template <class _Iterator>
-struct iterator_traits {
- typedef typename _Iterator::iterator_category iterator_category;
- typedef typename _Iterator::value_type value_type;
- typedef typename _Iterator::difference_type difference_type;
- typedef typename _Iterator::pointer pointer;
- typedef typename _Iterator::reference reference;
-};
-
-template <class _Tp>
-struct iterator_traits<_Tp*> {
- typedef random_access_iterator_tag iterator_category;
- typedef _Tp value_type;
- typedef ptrdiff_t difference_type;
- typedef _Tp* pointer;
- typedef _Tp& reference;
-};
-
-template <class _Tp>
-struct iterator_traits<const _Tp*> {
- typedef random_access_iterator_tag iterator_category;
- typedef _Tp value_type;
- typedef ptrdiff_t difference_type;
- typedef const _Tp* pointer;
- typedef const _Tp& reference;
-};
-
-// The overloaded functions iterator_category, distance_type, and
-// value_type are not part of the C++ standard. (They have been
-// replaced by struct iterator_traits.) They are included for
-// backward compatibility with the HP STL.
-
-// We introduce internal names for these functions.
-
-template <class _Iter>
-inline typename iterator_traits<_Iter>::iterator_category
-__iterator_category(const _Iter&)
-{
- typedef typename iterator_traits<_Iter>::iterator_category _Category;
- return _Category();
-}
-
-template <class _Iter>
-inline typename iterator_traits<_Iter>::difference_type*
-__distance_type(const _Iter&)
-{
- return static_cast<typename iterator_traits<_Iter>::difference_type*>(0);
-}
-
-template <class _Iter>
-inline typename iterator_traits<_Iter>::value_type*
-__value_type(const _Iter&)
-{
- return static_cast<typename iterator_traits<_Iter>::value_type*>(0);
-}
-
-template <class _Iter>
-inline typename iterator_traits<_Iter>::iterator_category
-iterator_category(const _Iter& __i) { return __iterator_category(__i); }
-
-
-template <class _Iter>
-inline typename iterator_traits<_Iter>::difference_type*
-distance_type(const _Iter& __i) { return __distance_type(__i); }
-
-template <class _Iter>
-inline typename iterator_traits<_Iter>::value_type*
-value_type(const _Iter& __i) { return __value_type(__i); }
-
-#define __ITERATOR_CATEGORY(__i) __iterator_category(__i)
-#define __DISTANCE_TYPE(__i) __distance_type(__i)
-#define __VALUE_TYPE(__i) __value_type(__i)
-
-#else /* __STL_CLASS_PARTIAL_SPECIALIZATION */
-
-template <class _Tp, class _Distance>
-inline input_iterator_tag
-iterator_category(const input_iterator<_Tp, _Distance>&)
- { return input_iterator_tag(); }
-
-inline output_iterator_tag iterator_category(const output_iterator&)
- { return output_iterator_tag(); }
-
-template <class _Tp, class _Distance>
-inline forward_iterator_tag
-iterator_category(const forward_iterator<_Tp, _Distance>&)
- { return forward_iterator_tag(); }
-
-template <class _Tp, class _Distance>
-inline bidirectional_iterator_tag
-iterator_category(const bidirectional_iterator<_Tp, _Distance>&)
- { return bidirectional_iterator_tag(); }
-
-template <class _Tp, class _Distance>
-inline random_access_iterator_tag
-iterator_category(const random_access_iterator<_Tp, _Distance>&)
- { return random_access_iterator_tag(); }
-
-template <class _Tp>
-inline random_access_iterator_tag iterator_category(const _Tp*)
- { return random_access_iterator_tag(); }
-
-template <class _Tp, class _Distance>
-inline _Tp* value_type(const input_iterator<_Tp, _Distance>&)
- { return (_Tp*)(0); }
-
-template <class _Tp, class _Distance>
-inline _Tp* value_type(const forward_iterator<_Tp, _Distance>&)
- { return (_Tp*)(0); }
-
-template <class _Tp, class _Distance>
-inline _Tp* value_type(const bidirectional_iterator<_Tp, _Distance>&)
- { return (_Tp*)(0); }
-
-template <class _Tp, class _Distance>
-inline _Tp* value_type(const random_access_iterator<_Tp, _Distance>&)
- { return (_Tp*)(0); }
-
-template <class _Tp>
-inline _Tp* value_type(const _Tp*) { return (_Tp*)(0); }
-
-template <class _Tp, class _Distance>
-inline _Distance* distance_type(const input_iterator<_Tp, _Distance>&)
-{
- return (_Distance*)(0);
-}
-
-template <class _Tp, class _Distance>
-inline _Distance* distance_type(const forward_iterator<_Tp, _Distance>&)
-{
- return (_Distance*)(0);
-}
-
-template <class _Tp, class _Distance>
-inline _Distance*
-distance_type(const bidirectional_iterator<_Tp, _Distance>&)
-{
- return (_Distance*)(0);
-}
-
-template <class _Tp, class _Distance>
-inline _Distance*
-distance_type(const random_access_iterator<_Tp, _Distance>&)
-{
- return (_Distance*)(0);
-}
-
-template <class _Tp>
-inline ptrdiff_t* distance_type(const _Tp*) { return (ptrdiff_t*)(0); }
-
-// Without partial specialization we can't use iterator_traits, so
-// we must keep the old iterator query functions around.
-
-#define __ITERATOR_CATEGORY(__i) iterator_category(__i)
-#define __DISTANCE_TYPE(__i) distance_type(__i)
-#define __VALUE_TYPE(__i) value_type(__i)
-
-#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
-
-template <class _InputIterator, class _Distance>
-inline void __distance(_InputIterator __first, _InputIterator __last,
- _Distance& __n, input_iterator_tag)
-{
- while (__first != __last) { ++__first; ++__n; }
-}
-
-template <class _RandomAccessIterator, class _Distance>
-inline void __distance(_RandomAccessIterator __first,
- _RandomAccessIterator __last,
- _Distance& __n, random_access_iterator_tag)
-{
- __n += __last - __first;
-}
-
-template <class _InputIterator, class _Distance>
-inline void distance(_InputIterator __first,
- _InputIterator __last, _Distance& __n)
-{
- __distance(__first, __last, __n, iterator_category(__first));
-}
-
-#ifdef __STL_CLASS_PARTIAL_SPECIALIZATION
-
-template <class _InputIterator>
-inline typename iterator_traits<_InputIterator>::difference_type
-__distance(_InputIterator __first, _InputIterator __last, input_iterator_tag)
-{
- typename iterator_traits<_InputIterator>::difference_type __n = 0;
- while (__first != __last) {
- ++__first; ++__n;
- }
- return __n;
-}
-
-template <class _RandomAccessIterator>
-inline typename iterator_traits<_RandomAccessIterator>::difference_type
-__distance(_RandomAccessIterator __first, _RandomAccessIterator __last,
- random_access_iterator_tag) {
- return __last - __first;
-}
-
-template <class _InputIterator>
-inline typename iterator_traits<_InputIterator>::difference_type
-distance(_InputIterator __first, _InputIterator __last) {
- typedef typename iterator_traits<_InputIterator>::iterator_category
- _Category;
- return __distance(__first, __last, _Category());
-}
-
-#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
-
-template <class _InputIter, class _Distance>
-inline void __advance(_InputIter& __i, _Distance __n, input_iterator_tag) {
- while (__n--) ++__i;
-}
-
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma set woff 1183
-#endif
-
-template <class _BidirectionalIterator, class _Distance>
-inline void __advance(_BidirectionalIterator& __i, _Distance __n,
- bidirectional_iterator_tag) {
- if (__n >= 0)
- while (__n--) ++__i;
- else
- while (__n++) --__i;
-}
-
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma reset woff 1183
-#endif
-
-template <class _RandomAccessIterator, class _Distance>
-inline void __advance(_RandomAccessIterator& __i, _Distance __n,
- random_access_iterator_tag) {
- __i += __n;
-}
-
-template <class _InputIterator, class _Distance>
-inline void advance(_InputIterator& __i, _Distance __n) {
- __advance(__i, __n, iterator_category(__i));
-}
-
-template <class _Container>
-class back_insert_iterator {
-protected:
- _Container* container;
-public:
- typedef _Container container_type;
- typedef output_iterator_tag iterator_category;
- typedef void value_type;
- typedef void difference_type;
- typedef void pointer;
- typedef void reference;
-
- explicit back_insert_iterator(_Container& __x) : container(&__x) {}
- back_insert_iterator<_Container>&
- operator=(const typename _Container::value_type& __value) {
- container->push_back(__value);
- return *this;
- }
- back_insert_iterator<_Container>& operator*() { return *this; }
- back_insert_iterator<_Container>& operator++() { return *this; }
- back_insert_iterator<_Container>& operator++(int) { return *this; }
-};
-
-#ifndef __STL_CLASS_PARTIAL_SPECIALIZATION
-
-template <class _Container>
-inline output_iterator_tag
-iterator_category(const back_insert_iterator<_Container>&)
-{
- return output_iterator_tag();
-}
-
-#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
-
-template <class _Container>
-inline back_insert_iterator<_Container> back_inserter(_Container& __x) {
- return back_insert_iterator<_Container>(__x);
-}
-
-template <class _Container>
-class front_insert_iterator {
-protected:
- _Container* container;
-public:
- typedef _Container container_type;
- typedef output_iterator_tag iterator_category;
- typedef void value_type;
- typedef void difference_type;
- typedef void pointer;
- typedef void reference;
-
- explicit front_insert_iterator(_Container& __x) : container(&__x) {}
- front_insert_iterator<_Container>&
- operator=(const typename _Container::value_type& __value) {
- container->push_front(__value);
- return *this;
- }
- front_insert_iterator<_Container>& operator*() { return *this; }
- front_insert_iterator<_Container>& operator++() { return *this; }
- front_insert_iterator<_Container>& operator++(int) { return *this; }
-};
-
-#ifndef __STL_CLASS_PARTIAL_SPECIALIZATION
-
-template <class _Container>
-inline output_iterator_tag
-iterator_category(const front_insert_iterator<_Container>&)
-{
- return output_iterator_tag();
-}
-
-#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
-
-template <class _Container>
-inline front_insert_iterator<_Container> front_inserter(_Container& __x) {
- return front_insert_iterator<_Container>(__x);
-}
-
-template <class _Container>
-class insert_iterator {
-protected:
- _Container* container;
- typename _Container::iterator iter;
-public:
- typedef _Container container_type;
- typedef output_iterator_tag iterator_category;
- typedef void value_type;
- typedef void difference_type;
- typedef void pointer;
- typedef void reference;
-
- insert_iterator(_Container& __x, typename _Container::iterator __i)
- : container(&__x), iter(__i) {}
- insert_iterator<_Container>&
- operator=(const typename _Container::value_type& __value) {
- iter = container->insert(iter, __value);
- ++iter;
- return *this;
- }
- insert_iterator<_Container>& operator*() { return *this; }
- insert_iterator<_Container>& operator++() { return *this; }
- insert_iterator<_Container>& operator++(int) { return *this; }
-};
-
-#ifndef __STL_CLASS_PARTIAL_SPECIALIZATION
-
-template <class _Container>
-inline output_iterator_tag
-iterator_category(const insert_iterator<_Container>&)
-{
- return output_iterator_tag();
-}
-
-#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
-
-template <class _Container, class _Iterator>
-inline
-insert_iterator<_Container> inserter(_Container& __x, _Iterator __i)
-{
- typedef typename _Container::iterator __iter;
- return insert_iterator<_Container>(__x, __iter(__i));
-}
-
-#ifndef __STL_LIMITED_DEFAULT_TEMPLATES
-template <class _BidirectionalIterator, class _Tp, class _Reference = _Tp&,
- class _Distance = ptrdiff_t>
-#else
-template <class _BidirectionalIterator, class _Tp, class _Reference,
- class _Distance>
-#endif
-class reverse_bidirectional_iterator {
- typedef reverse_bidirectional_iterator<_BidirectionalIterator, _Tp,
- _Reference, _Distance> _Self;
-protected:
- _BidirectionalIterator current;
-public:
- typedef bidirectional_iterator_tag iterator_category;
- typedef _Tp value_type;
- typedef _Distance difference_type;
- typedef _Tp* pointer;
- typedef _Reference reference;
-
- reverse_bidirectional_iterator() {}
- explicit reverse_bidirectional_iterator(_BidirectionalIterator __x)
- : current(__x) {}
- _BidirectionalIterator base() const { return current; }
- _Reference operator*() const {
- _BidirectionalIterator __tmp = current;
- return *--__tmp;
- }
-#ifndef __SGI_STL_NO_ARROW_OPERATOR
- pointer operator->() const { return &(operator*()); }
-#endif /* __SGI_STL_NO_ARROW_OPERATOR */
- _Self& operator++() {
- --current;
- return *this;
- }
- _Self operator++(int) {
- _Self __tmp = *this;
- --current;
- return __tmp;
- }
- _Self& operator--() {
- ++current;
- return *this;
- }
- _Self operator--(int) {
- _Self __tmp = *this;
- ++current;
- return __tmp;
- }
-};
-
-#ifndef __STL_CLASS_PARTIAL_SPECIALIZATION
-
-template <class _BidirectionalIterator, class _Tp, class _Reference,
- class _Distance>
-inline bidirectional_iterator_tag
-iterator_category(const reverse_bidirectional_iterator<_BidirectionalIterator,
- _Tp, _Reference,
- _Distance>&)
-{
- return bidirectional_iterator_tag();
-}
-
-template <class _BidirectionalIterator, class _Tp, class _Reference,
- class _Distance>
-inline _Tp*
-value_type(const reverse_bidirectional_iterator<_BidirectionalIterator, _Tp,
- _Reference, _Distance>&)
-{
- return (_Tp*) 0;
-}
-
-template <class _BidirectionalIterator, class _Tp, class _Reference,
- class _Distance>
-inline _Distance*
-distance_type(const reverse_bidirectional_iterator<_BidirectionalIterator,
- _Tp,
- _Reference, _Distance>&)
-{
- return (_Distance*) 0;
-}
-
-#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
-
-template <class _BiIter, class _Tp, class _Ref,
- class _Distance>
-inline bool operator==(
- const reverse_bidirectional_iterator<_BiIter, _Tp, _Ref, _Distance>& __x,
- const reverse_bidirectional_iterator<_BiIter, _Tp, _Ref, _Distance>& __y)
-{
- return __x.base() == __y.base();
-}
-
-#ifdef __STL_CLASS_PARTIAL_SPECIALIZATION
-
-// This is the new version of reverse_iterator, as defined in the
-// draft C++ standard. It relies on the iterator_traits template,
-// which in turn relies on partial specialization. The class
-// reverse_bidirectional_iterator is no longer part of the draft
-// standard, but it is retained for backward compatibility.
-
-template <class _Iterator>
-class reverse_iterator
-{
-protected:
- _Iterator current;
-public:
- typedef typename iterator_traits<_Iterator>::iterator_category
- iterator_category;
- typedef typename iterator_traits<_Iterator>::value_type
- value_type;
- typedef typename iterator_traits<_Iterator>::difference_type
- difference_type;
- typedef typename iterator_traits<_Iterator>::pointer
- pointer;
- typedef typename iterator_traits<_Iterator>::reference
- reference;
-
- typedef _Iterator iterator_type;
- typedef reverse_iterator<_Iterator> _Self;
-
-public:
- reverse_iterator() {}
- explicit reverse_iterator(iterator_type __x) : current(__x) {}
-
- reverse_iterator(const _Self& __x) : current(__x.current) {}
-#ifdef __STL_MEMBER_TEMPLATES
- template <class _Iter>
- reverse_iterator(const reverse_iterator<_Iter>& __x)
- : current(__x.base()) {}
-#endif /* __STL_MEMBER_TEMPLATES */
-
- iterator_type base() const { return current; }
- reference operator*() const {
- _Iterator __tmp = current;
- return *--__tmp;
- }
-#ifndef __SGI_STL_NO_ARROW_OPERATOR
- pointer operator->() const { return &(operator*()); }
-#endif /* __SGI_STL_NO_ARROW_OPERATOR */
-
- _Self& operator++() {
- --current;
- return *this;
- }
- _Self operator++(int) {
- _Self __tmp = *this;
- --current;
- return __tmp;
- }
- _Self& operator--() {
- ++current;
- return *this;
- }
- _Self operator--(int) {
- _Self __tmp = *this;
- ++current;
- return __tmp;
- }
-
- _Self operator+(difference_type __n) const {
- return _Self(current - __n);
- }
- _Self& operator+=(difference_type __n) {
- current -= __n;
- return *this;
- }
- _Self operator-(difference_type __n) const {
- return _Self(current + __n);
- }
- _Self& operator-=(difference_type __n) {
- current += __n;
- return *this;
- }
- reference operator[](difference_type __n) const { return *(*this + __n); }
-};
-
-template <class _Iterator>
-inline bool operator==(const reverse_iterator<_Iterator>& __x,
- const reverse_iterator<_Iterator>& __y) {
- return __x.base() == __y.base();
-}
-
-template <class _Iterator>
-inline bool operator<(const reverse_iterator<_Iterator>& __x,
- const reverse_iterator<_Iterator>& __y) {
- return __y.base() < __x.base();
-}
-
-template <class _Iterator>
-inline typename reverse_iterator<_Iterator>::difference_type
-operator-(const reverse_iterator<_Iterator>& __x,
- const reverse_iterator<_Iterator>& __y) {
- return __y.base() - __x.base();
-}
-
-template <class _Iterator>
-inline reverse_iterator<_Iterator>
-operator+(typename reverse_iterator<_Iterator>::difference_type __n,
- const reverse_iterator<_Iterator>& __x) {
- return reverse_iterator<_Iterator>(__x.base() - __n);
-}
-
-#else /* __STL_CLASS_PARTIAL_SPECIALIZATION */
-
-// This is the old version of reverse_iterator, as found in the original
-// HP STL. It does not use partial specialization.
-
-#ifndef __STL_LIMITED_DEFAULT_TEMPLATES
-template <class _RandomAccessIterator, class _Tp, class _Reference = _Tp&,
- class _Distance = ptrdiff_t>
-#else
-template <class _RandomAccessIterator, class _Tp, class _Reference,
- class _Distance>
-#endif
-class reverse_iterator {
- typedef reverse_iterator<_RandomAccessIterator, _Tp, _Reference, _Distance>
- _Self;
-protected:
- _RandomAccessIterator current;
-public:
- typedef random_access_iterator_tag iterator_category;
- typedef _Tp value_type;
- typedef _Distance difference_type;
- typedef _Tp* pointer;
- typedef _Reference reference;
-
- reverse_iterator() {}
- explicit reverse_iterator(_RandomAccessIterator __x) : current(__x) {}
- _RandomAccessIterator base() const { return current; }
- _Reference operator*() const { return *(current - 1); }
-#ifndef __SGI_STL_NO_ARROW_OPERATOR
- pointer operator->() const { return &(operator*()); }
-#endif /* __SGI_STL_NO_ARROW_OPERATOR */
- _Self& operator++() {
- --current;
- return *this;
- }
- _Self operator++(int) {
- _Self __tmp = *this;
- --current;
- return __tmp;
- }
- _Self& operator--() {
- ++current;
- return *this;
- }
- _Self operator--(int) {
- _Self __tmp = *this;
- ++current;
- return __tmp;
- }
- _Self operator+(_Distance __n) const {
- return _Self(current - __n);
- }
- _Self& operator+=(_Distance __n) {
- current -= __n;
- return *this;
- }
- _Self operator-(_Distance __n) const {
- return _Self(current + __n);
- }
- _Self& operator-=(_Distance __n) {
- current += __n;
- return *this;
- }
- _Reference operator[](_Distance __n) const { return *(*this + __n); }
-};
-
-template <class _RandomAccessIterator, class _Tp,
- class _Reference, class _Distance>
-inline random_access_iterator_tag
-iterator_category(const reverse_iterator<_RandomAccessIterator, _Tp,
- _Reference, _Distance>&)
-{
- return random_access_iterator_tag();
-}
-
-template <class _RandomAccessIterator, class _Tp,
- class _Reference, class _Distance>
-inline _Tp* value_type(const reverse_iterator<_RandomAccessIterator, _Tp,
- _Reference, _Distance>&)
-{
- return (_Tp*) 0;
-}
-
-template <class _RandomAccessIterator, class _Tp,
- class _Reference, class _Distance>
-inline _Distance*
-distance_type(const reverse_iterator<_RandomAccessIterator,
- _Tp, _Reference, _Distance>&)
-{
- return (_Distance*) 0;
-}
-
-
-template <class _RandomAccessIterator, class _Tp,
- class _Reference, class _Distance>
-inline bool
-operator==(const reverse_iterator<_RandomAccessIterator, _Tp,
- _Reference, _Distance>& __x,
- const reverse_iterator<_RandomAccessIterator, _Tp,
- _Reference, _Distance>& __y)
-{
- return __x.base() == __y.base();
-}
-
-template <class _RandomAccessIterator, class _Tp,
- class _Reference, class _Distance>
-inline bool
-operator<(const reverse_iterator<_RandomAccessIterator, _Tp,
- _Reference, _Distance>& __x,
- const reverse_iterator<_RandomAccessIterator, _Tp,
- _Reference, _Distance>& __y)
-{
- return __y.base() < __x.base();
-}
-
-template <class _RandomAccessIterator, class _Tp,
- class _Reference, class _Distance>
-inline _Distance
-operator-(const reverse_iterator<_RandomAccessIterator, _Tp,
- _Reference, _Distance>& __x,
- const reverse_iterator<_RandomAccessIterator, _Tp,
- _Reference, _Distance>& __y)
-{
- return __y.base() - __x.base();
-}
-
-template <class _RandAccIter, class _Tp, class _Ref, class _Dist>
-inline reverse_iterator<_RandAccIter, _Tp, _Ref, _Dist>
-operator+(_Dist __n,
- const reverse_iterator<_RandAccIter, _Tp, _Ref, _Dist>& __x)
-{
- return reverse_iterator<_RandAccIter, _Tp, _Ref, _Dist>(__x.base() - __n);
-}
-
-#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
-
-// When we have templatized iostreams, istream_iterator and ostream_iterator
-// must be rewritten.
-
-template <class _Tp, class _Dist = ptrdiff_t>
-class istream_iterator {
- friend bool operator== __STL_NULL_TMPL_ARGS (const istream_iterator&,
- const istream_iterator&);
-protected:
- istream* _M_stream;
- _Tp _M_value;
- bool _M_end_marker;
- void _M_read() {
- _M_end_marker = (*_M_stream) ? true : false;
- if (_M_end_marker) *_M_stream >> _M_value;
- _M_end_marker = (*_M_stream) ? true : false;
- }
-public:
- typedef input_iterator_tag iterator_category;
- typedef _Tp value_type;
- typedef _Dist difference_type;
- typedef const _Tp* pointer;
- typedef const _Tp& reference;
-
- istream_iterator() : _M_stream(&cin), _M_end_marker(false) {}
- istream_iterator(istream& __s) : _M_stream(&__s) { _M_read(); }
- reference operator*() const { return _M_value; }
-#ifndef __SGI_STL_NO_ARROW_OPERATOR
- pointer operator->() const { return &(operator*()); }
-#endif /* __SGI_STL_NO_ARROW_OPERATOR */
- istream_iterator<_Tp, _Dist>& operator++() {
- _M_read();
- return *this;
- }
- istream_iterator<_Tp, _Dist> operator++(int) {
- istream_iterator<_Tp, _Dist> __tmp = *this;
- _M_read();
- return __tmp;
- }
-};
-
-#ifndef __STL_CLASS_PARTIAL_SPECIALIZATION
-
-template <class _Tp, class _Dist>
-inline input_iterator_tag
-iterator_category(const istream_iterator<_Tp, _Dist>&)
-{
- return input_iterator_tag();
-}
-
-template <class _Tp, class _Dist>
-inline _Tp*
-value_type(const istream_iterator<_Tp, _Dist>&) { return (_Tp*) 0; }
-
-template <class _Tp, class _Dist>
-inline _Dist*
-distance_type(const istream_iterator<_Tp, _Dist>&) { return (_Dist*)0; }
-
-#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
-
-template <class _Tp, class _Distance>
-inline bool operator==(const istream_iterator<_Tp, _Distance>& __x,
- const istream_iterator<_Tp, _Distance>& __y) {
- return (__x._M_stream == __y._M_stream &&
- __x._M_end_marker == __y._M_end_marker) ||
- __x._M_end_marker == false && __y._M_end_marker == false;
-}
-
-template <class _Tp>
-class ostream_iterator {
-protected:
- ostream* _M_stream;
- const char* _M_string;
-public:
- typedef output_iterator_tag iterator_category;
- typedef void value_type;
- typedef void difference_type;
- typedef void pointer;
- typedef void reference;
-
- ostream_iterator(ostream& __s) : _M_stream(&__s), _M_string(0) {}
- ostream_iterator(ostream& __s, const char* __c)
- : _M_stream(&__s), _M_string(__c) {}
- ostream_iterator<_Tp>& operator=(const _Tp& __value) {
- *_M_stream << __value;
- if (_M_string) *_M_stream << _M_string;
- return *this;
- }
- ostream_iterator<_Tp>& operator*() { return *this; }
- ostream_iterator<_Tp>& operator++() { return *this; }
- ostream_iterator<_Tp>& operator++(int) { return *this; }
-};
-
-#ifndef __STL_CLASS_PARTIAL_SPECIALIZATION
-
-template <class _Tp>
-inline output_iterator_tag
-iterator_category(const ostream_iterator<_Tp>&) {
- return output_iterator_tag();
-}
-
-#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
-
-__STL_END_NAMESPACE
-
-#endif /* __SGI_STL_INTERNAL_ITERATOR_H */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/contrib/libstdc++/stl/stl_list.h b/contrib/libstdc++/stl/stl_list.h
deleted file mode 100644
index 5d95d641e52d..000000000000
--- a/contrib/libstdc++/stl/stl_list.h
+++ /dev/null
@@ -1,840 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- *
- * Copyright (c) 1996,1997
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- */
-
-/* NOTE: This is an internal header file, included by other STL headers.
- * You should not attempt to use it directly.
- */
-
-#ifndef __SGI_STL_INTERNAL_LIST_H
-#define __SGI_STL_INTERNAL_LIST_H
-
-__STL_BEGIN_NAMESPACE
-
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma set woff 1174
-#pragma set woff 1375
-#endif
-
-template <class _Tp>
-struct _List_node {
- typedef void* _Void_pointer;
- _Void_pointer _M_next;
- _Void_pointer _M_prev;
- _Tp _M_data;
-};
-
-template<class _Tp, class _Ref, class _Ptr>
-struct _List_iterator {
- typedef _List_iterator<_Tp,_Tp&,_Tp*> iterator;
- typedef _List_iterator<_Tp,const _Tp&,const _Tp*> const_iterator;
- typedef _List_iterator<_Tp,_Ref,_Ptr> _Self;
-
- typedef bidirectional_iterator_tag iterator_category;
- typedef _Tp value_type;
- typedef _Ptr pointer;
- typedef _Ref reference;
- typedef _List_node<_Tp> _Node;
- typedef size_t size_type;
- typedef ptrdiff_t difference_type;
-
- _Node* _M_node;
-
- _List_iterator(_Node* __x) : _M_node(__x) {}
- _List_iterator() {}
- _List_iterator(const iterator& __x) : _M_node(__x._M_node) {}
-
- bool operator==(const _Self& __x) const { return _M_node == __x._M_node; }
- bool operator!=(const _Self& __x) const { return _M_node != __x._M_node; }
- reference operator*() const { return (*_M_node)._M_data; }
-
-#ifndef __SGI_STL_NO_ARROW_OPERATOR
- pointer operator->() const { return &(operator*()); }
-#endif /* __SGI_STL_NO_ARROW_OPERATOR */
-
- _Self& operator++() {
- _M_node = (_Node*)(_M_node->_M_next);
- return *this;
- }
- _Self operator++(int) {
- _Self __tmp = *this;
- ++*this;
- return __tmp;
- }
- _Self& operator--() {
- _M_node = (_Node*)(_M_node->_M_prev);
- return *this;
- }
- _Self operator--(int) {
- _Self __tmp = *this;
- --*this;
- return __tmp;
- }
-};
-
-#ifndef __STL_CLASS_PARTIAL_SPECIALIZATION
-
-template <class _Tp, class _Ref, class _Ptr>
-inline bidirectional_iterator_tag
-iterator_category(const _List_iterator<_Tp, _Ref, _Ptr>&)
-{
- return bidirectional_iterator_tag();
-}
-
-template <class _Tp, class _Ref, class _Ptr>
-inline _Tp*
-value_type(const _List_iterator<_Tp, _Ref, _Ptr>&)
-{
- return 0;
-}
-
-template <class _Tp, class _Ref, class _Ptr>
-inline ptrdiff_t*
-distance_type(const _List_iterator<_Tp, _Ref, _Ptr>&)
-{
- return 0;
-}
-
-#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
-
-
-// Base class that encapsulates details of allocators. Three cases:
-// an ordinary standard-conforming allocator, a standard-conforming
-// allocator with no non-static data, and an SGI-style allocator.
-// This complexity is necessary only because we're worrying about backward
-// compatibility and because we want to avoid wasting storage on an
-// allocator instance if it isn't necessary.
-
-#ifdef __STL_USE_STD_ALLOCATORS
-
-// Base for general standard-conforming allocators.
-template <class _Tp, class _Allocator, bool _IsStatic>
-class _List_alloc_base {
-public:
- typedef typename _Alloc_traits<_Tp, _Allocator>::allocator_type
- allocator_type;
- allocator_type get_allocator() const { return _Node_allocator; }
-
- _List_alloc_base(const allocator_type& __a) : _Node_allocator(__a) {}
-
-protected:
- _List_node<_Tp>* _M_get_node()
- { return _Node_allocator.allocate(1); }
- void _M_put_node(_List_node<_Tp>* __p)
- { _Node_allocator.deallocate(__p, 1); }
-
-protected:
- typename _Alloc_traits<_List_node<_Tp>, _Allocator>::allocator_type
- _Node_allocator;
- _List_node<_Tp>* _M_node;
-};
-
-// Specialization for instanceless allocators.
-
-template <class _Tp, class _Allocator>
-class _List_alloc_base<_Tp, _Allocator, true> {
-public:
- typedef typename _Alloc_traits<_Tp, _Allocator>::allocator_type
- allocator_type;
- allocator_type get_allocator() const { return allocator_type(); }
-
- _List_alloc_base(const allocator_type&) {}
-
-protected:
- typedef typename _Alloc_traits<_List_node<_Tp>, _Allocator>::_Alloc_type
- _Alloc_type;
- _List_node<_Tp>* _M_get_node() { return _Alloc_type::allocate(1); }
- void _M_put_node(_List_node<_Tp>* __p) { _Alloc_type::deallocate(__p, 1); }
-
-protected:
- _List_node<_Tp>* _M_node;
-};
-
-template <class _Tp, class _Alloc>
-class _List_base
- : public _List_alloc_base<_Tp, _Alloc,
- _Alloc_traits<_Tp, _Alloc>::_S_instanceless>
-{
-public:
- typedef _List_alloc_base<_Tp, _Alloc,
- _Alloc_traits<_Tp, _Alloc>::_S_instanceless>
- _Base;
- typedef typename _Base::allocator_type allocator_type;
-
- _List_base(const allocator_type& __a) : _Base(__a) {
- _M_node = _M_get_node();
- _M_node->_M_next = _M_node;
- _M_node->_M_prev = _M_node;
- }
- ~_List_base() {
- clear();
- _M_put_node(_M_node);
- }
-
- void clear();
-};
-
-#else /* __STL_USE_STD_ALLOCATORS */
-
-template <class _Tp, class _Alloc>
-class _List_base
-{
-public:
- typedef _Alloc allocator_type;
- allocator_type get_allocator() const { return allocator_type(); }
-
- _List_base(const allocator_type&) {
- _M_node = _M_get_node();
- _M_node->_M_next = _M_node;
- _M_node->_M_prev = _M_node;
- }
- ~_List_base() {
- clear();
- _M_put_node(_M_node);
- }
-
- void clear();
-
-protected:
- typedef simple_alloc<_List_node<_Tp>, _Alloc> _Alloc_type;
- _List_node<_Tp>* _M_get_node() { return _Alloc_type::allocate(1); }
- void _M_put_node(_List_node<_Tp>* __p) { _Alloc_type::deallocate(__p, 1); }
-
-protected:
- _List_node<_Tp>* _M_node;
-};
-
-#endif /* __STL_USE_STD_ALLOCATORS */
-
-template <class _Tp, class _Alloc>
-void
-_List_base<_Tp,_Alloc>::clear()
-{
- _List_node<_Tp>* __cur = (_List_node<_Tp>*) _M_node->_M_next;
- while (__cur != _M_node) {
- _List_node<_Tp>* __tmp = __cur;
- __cur = (_List_node<_Tp>*) __cur->_M_next;
- destroy(&__tmp->_M_data);
- _M_put_node(__tmp);
- }
- _M_node->_M_next = _M_node;
- _M_node->_M_prev = _M_node;
-}
-
-template <class _Tp, class _Alloc = __STL_DEFAULT_ALLOCATOR(_Tp) >
-class list : protected _List_base<_Tp, _Alloc> {
- typedef _List_base<_Tp, _Alloc> _Base;
-protected:
- typedef void* _Void_pointer;
-
-public:
- typedef _Tp value_type;
- typedef value_type* pointer;
- typedef const value_type* const_pointer;
- typedef value_type& reference;
- typedef const value_type& const_reference;
- typedef _List_node<_Tp> _Node;
- typedef size_t size_type;
- typedef ptrdiff_t difference_type;
-
- typedef typename _Base::allocator_type allocator_type;
- allocator_type get_allocator() const { return _Base::get_allocator(); }
-
-public:
- typedef _List_iterator<_Tp,_Tp&,_Tp*> iterator;
- typedef _List_iterator<_Tp,const _Tp&,const _Tp*> const_iterator;
-
-#ifdef __STL_CLASS_PARTIAL_SPECIALIZATION
- typedef reverse_iterator<const_iterator> const_reverse_iterator;
- typedef reverse_iterator<iterator> reverse_iterator;
-#else /* __STL_CLASS_PARTIAL_SPECIALIZATION */
- typedef reverse_bidirectional_iterator<const_iterator,value_type,
- const_reference,difference_type>
- const_reverse_iterator;
- typedef reverse_bidirectional_iterator<iterator,value_type,reference,
- difference_type>
- reverse_iterator;
-#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
-
-protected:
-#ifdef __STL_HAS_NAMESPACES
- using _Base::_M_node;
- using _Base::_M_put_node;
- using _Base::_M_get_node;
-#endif /* __STL_HAS_NAMESPACES */
-
-protected:
- _Node* _M_create_node(const _Tp& __x)
- {
- _Node* __p = _M_get_node();
- __STL_TRY {
- construct(&__p->_M_data, __x);
- }
- __STL_UNWIND(_M_put_node(__p));
- return __p;
- }
-
- _Node* _M_create_node()
- {
- _Node* __p = _M_get_node();
- __STL_TRY {
- construct(&__p->_M_data);
- }
- __STL_UNWIND(_M_put_node(__p));
- return __p;
- }
-
-public:
- explicit list(const allocator_type& __a = allocator_type()) : _Base(__a) {}
-
- iterator begin() { return (_Node*)(_M_node->_M_next); }
- const_iterator begin() const { return (_Node*)(_M_node->_M_next); }
-
- iterator end() { return _M_node; }
- const_iterator end() const { return _M_node; }
-
- reverse_iterator rbegin()
- { return reverse_iterator(end()); }
- const_reverse_iterator rbegin() const
- { return const_reverse_iterator(end()); }
-
- reverse_iterator rend()
- { return reverse_iterator(begin()); }
- const_reverse_iterator rend() const
- { return const_reverse_iterator(begin()); }
-
- bool empty() const { return _M_node->_M_next == _M_node; }
- size_type size() const {
- size_type __result = 0;
- distance(begin(), end(), __result);
- return __result;
- }
- size_type max_size() const { return size_type(-1); }
-
- reference front() { return *begin(); }
- const_reference front() const { return *begin(); }
- reference back() { return *(--end()); }
- const_reference back() const { return *(--end()); }
-
- void swap(list<_Tp, _Alloc>& __x) { __STD::swap(_M_node, __x._M_node); }
-
- iterator insert(iterator __position, const _Tp& __x) {
- _Node* __tmp = _M_create_node(__x);
- __tmp->_M_next = __position._M_node;
- __tmp->_M_prev = __position._M_node->_M_prev;
- ((_Node*) (__position._M_node->_M_prev))->_M_next = __tmp;
- __position._M_node->_M_prev = __tmp;
- return __tmp;
- }
- iterator insert(iterator __position) { return insert(__position, _Tp()); }
-#ifdef __STL_MEMBER_TEMPLATES
- // Check whether it's an integral type. If so, it's not an iterator.
-
- template<class _Integer>
- void _M_insert_dispatch(iterator __pos, _Integer __n, _Integer __x,
- __true_type) {
- insert(__pos, (size_type) __n, (_Tp) __x);
- }
-
- template <class _InputIterator>
- void _M_insert_dispatch(iterator __pos,
- _InputIterator __first, _InputIterator __last,
- __false_type);
-
- template <class _InputIterator>
- void insert(iterator __pos, _InputIterator __first, _InputIterator __last) {
- typedef typename _Is_integer<_InputIterator>::_Integral _Integral;
- _M_insert_dispatch(__pos, __first, __last, _Integral());
- }
-
-#else /* __STL_MEMBER_TEMPLATES */
- void insert(iterator __position, const _Tp* __first, const _Tp* __last);
- void insert(iterator __position,
- const_iterator __first, const_iterator __last);
-#endif /* __STL_MEMBER_TEMPLATES */
- void insert(iterator __pos, size_type __n, const _Tp& __x);
-
- void push_front(const _Tp& __x) { insert(begin(), __x); }
- void push_front() {insert(begin());}
- void push_back(const _Tp& __x) { insert(end(), __x); }
- void push_back() {insert(end());}
-
- iterator erase(iterator __position) {
- _Node* __next_node = (_Node*) (__position._M_node->_M_next);
- _Node* __prev_node = (_Node*) (__position._M_node->_M_prev);
- __prev_node->_M_next = __next_node;
- __next_node->_M_prev = __prev_node;
- destroy(&__position._M_node->_M_data);
- _M_put_node(__position._M_node);
- return iterator(__next_node);
- }
- iterator erase(iterator __first, iterator __last);
- void clear() { _Base::clear(); }
-
- void resize(size_type __new_size, const _Tp& __x);
- void resize(size_type __new_size) { resize(__new_size, _Tp()); }
-
- void pop_front() { erase(begin()); }
- void pop_back() {
- iterator __tmp = end();
- erase(--__tmp);
- }
- list(size_type __n, const _Tp& __value,
- const allocator_type& __a = allocator_type())
- : _Base(__a)
- { insert(begin(), __n, __value); }
- explicit list(size_type __n)
- : _Base(allocator_type())
- { insert(begin(), __n, _Tp()); }
-
-#ifdef __STL_MEMBER_TEMPLATES
-
- // We don't need any dispatching tricks here, because insert does all of
- // that anyway.
- template <class _InputIterator>
- list(_InputIterator __first, _InputIterator __last,
- const allocator_type& __a = allocator_type())
- : _Base(__a)
- { insert(begin(), __first, __last); }
-
-#else /* __STL_MEMBER_TEMPLATES */
-
- list(const _Tp* __first, const _Tp* __last,
- const allocator_type& __a = allocator_type())
- : _Base(__a)
- { insert(begin(), __first, __last); }
- list(const_iterator __first, const_iterator __last,
- const allocator_type& __a = allocator_type())
- : _Base(__a)
- { insert(begin(), __first, __last); }
-
-#endif /* __STL_MEMBER_TEMPLATES */
- list(const list<_Tp, _Alloc>& __x) : _Base(__x.get_allocator())
- { insert(begin(), __x.begin(), __x.end()); }
-
- ~list() { }
-
- list<_Tp, _Alloc>& operator=(const list<_Tp, _Alloc>& __x);
-
-public:
- // assign(), a generalized assignment member function. Two
- // versions: one that takes a count, and one that takes a range.
- // The range version is a member template, so we dispatch on whether
- // or not the type is an integer.
-
- void assign(size_type __n, const _Tp& __val);
-
-#ifdef __STL_MEMBER_TEMPLATES
-
- template <class _InputIterator>
- void assign(_InputIterator __first, _InputIterator __last) {
- typedef typename _Is_integer<_InputIterator>::_Integral _Integral;
- _M_assign_dispatch(__first, __last, _Integral());
- }
-
- template <class _Integer>
- void _M_assign_dispatch(_Integer __n, _Integer __val, __true_type)
- { assign((size_type) __n, (_Tp) __val); }
-
- template <class _InputIterator>
- void _M_assign_dispatch(_InputIterator __first, _InputIterator __last,
- __false_type);
-
-#endif /* __STL_MEMBER_TEMPLATES */
-
-protected:
- void transfer(iterator __position, iterator __first, iterator __last) {
- if (__position != __last) {
- // Remove [first, last) from its old position.
- ((_Node*) (__last._M_node->_M_prev))->_M_next = __position._M_node;
- ((_Node*) (__first._M_node->_M_prev))->_M_next = __last._M_node;
- ((_Node*) (__position._M_node->_M_prev))->_M_next = __first._M_node;
-
- // Splice [first, last) into its new position.
- _Node* __tmp = (_Node*) (__position._M_node->_M_prev);
- __position._M_node->_M_prev = __last._M_node->_M_prev;
- __last._M_node->_M_prev = __first._M_node->_M_prev;
- __first._M_node->_M_prev = __tmp;
- }
- }
-
-public:
- void splice(iterator __position, list& __x) {
- if (!__x.empty())
- transfer(__position, __x.begin(), __x.end());
- }
- void splice(iterator __position, list&, iterator __i) {
- iterator __j = __i;
- ++__j;
- if (__position == __i || __position == __j) return;
- transfer(__position, __i, __j);
- }
- void splice(iterator __position, list&, iterator __first, iterator __last) {
- if (__first != __last)
- transfer(__position, __first, __last);
- }
- void remove(const _Tp& __value);
- void unique();
- void merge(list& __x);
- void reverse();
- void sort();
-
-#ifdef __STL_MEMBER_TEMPLATES
- template <class _Predicate> void remove_if(_Predicate);
- template <class _BinaryPredicate> void unique(_BinaryPredicate);
- template <class _StrictWeakOrdering> void merge(list&, _StrictWeakOrdering);
- template <class _StrictWeakOrdering> void sort(_StrictWeakOrdering);
-#endif /* __STL_MEMBER_TEMPLATES */
-
- friend bool operator== __STL_NULL_TMPL_ARGS (
- const list& __x, const list& __y);
-};
-
-template <class _Tp, class _Alloc>
-inline bool operator==(const list<_Tp,_Alloc>& __x,
- const list<_Tp,_Alloc>& __y)
-{
- typedef typename list<_Tp,_Alloc>::_Node _Node;
- _Node* __e1 = __x._M_node;
- _Node* __e2 = __y._M_node;
- _Node* __n1 = (_Node*) __e1->_M_next;
- _Node* __n2 = (_Node*) __e2->_M_next;
- for ( ; __n1 != __e1 && __n2 != __e2 ;
- __n1 = (_Node*) __n1->_M_next, __n2 = (_Node*) __n2->_M_next)
- if (__n1->_M_data != __n2->_M_data)
- return false;
- return __n1 == __e1 && __n2 == __e2;
-}
-
-template <class _Tp, class _Alloc>
-inline bool operator<(const list<_Tp,_Alloc>& __x,
- const list<_Tp,_Alloc>& __y)
-{
- return lexicographical_compare(__x.begin(), __x.end(),
- __y.begin(), __y.end());
-}
-
-#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER
-
-template <class _Tp, class _Alloc>
-inline void
-swap(list<_Tp, _Alloc>& __x, list<_Tp, _Alloc>& __y)
-{
- __x.swap(__y);
-}
-
-#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */
-
-#ifdef __STL_MEMBER_TEMPLATES
-
-template <class _Tp, class _Alloc> template <class _InputIter>
-void
-list<_Tp, _Alloc>::_M_insert_dispatch(iterator __position,
- _InputIter __first, _InputIter __last,
- __false_type)
-{
- for ( ; __first != __last; ++__first)
- insert(__position, *__first);
-}
-
-#else /* __STL_MEMBER_TEMPLATES */
-
-template <class _Tp, class _Alloc>
-void
-list<_Tp, _Alloc>::insert(iterator __position,
- const _Tp* __first, const _Tp* __last)
-{
- for ( ; __first != __last; ++__first)
- insert(__position, *__first);
-}
-
-template <class _Tp, class _Alloc>
-void
-list<_Tp, _Alloc>::insert(iterator __position,
- const_iterator __first, const_iterator __last)
-{
- for ( ; __first != __last; ++__first)
- insert(__position, *__first);
-}
-
-#endif /* __STL_MEMBER_TEMPLATES */
-
-template <class _Tp, class _Alloc>
-void
-list<_Tp, _Alloc>::insert(iterator __position, size_type __n, const _Tp& __x)
-{
- for ( ; __n > 0; --__n)
- insert(__position, __x);
-}
-
-template <class _Tp, class _Alloc>
-list<_Tp,_Alloc>::iterator list<_Tp, _Alloc>::erase(iterator __first,
- iterator __last)
-{
- while (__first != __last)
- erase(__first++);
- return __last;
-}
-
-template <class _Tp, class _Alloc>
-void list<_Tp, _Alloc>::resize(size_type __new_size, const _Tp& __x)
-{
- iterator __i = begin();
- size_type __len = 0;
- for ( ; __i != end() && __len < __new_size; ++__i, ++__len)
- ;
- if (__len == __new_size)
- erase(__i, end());
- else // __i == end()
- insert(end(), __new_size - __len, __x);
-}
-
-template <class _Tp, class _Alloc>
-list<_Tp, _Alloc>& list<_Tp, _Alloc>::operator=(const list<_Tp, _Alloc>& __x)
-{
- if (this != &__x) {
- iterator __first1 = begin();
- iterator __last1 = end();
- const_iterator __first2 = __x.begin();
- const_iterator __last2 = __x.end();
- while (__first1 != __last1 && __first2 != __last2)
- *__first1++ = *__first2++;
- if (__first2 == __last2)
- erase(__first1, __last1);
- else
- insert(__last1, __first2, __last2);
- }
- return *this;
-}
-
-template <class _Tp, class _Alloc>
-void list<_Tp, _Alloc>::assign(size_type __n, const _Tp& __val) {
- iterator __i = begin();
- for ( ; __i != end() && __n > 0; ++__i, --__n)
- *__i = __val;
- if (__n > 0)
- insert(end(), __n, __val);
- else
- erase(__i, end());
-}
-
-#ifdef __STL_MEMBER_TEMPLATES
-
-template <class _Tp, class _Alloc> template <class _InputIter>
-void
-list<_Tp, _Alloc>::_M_assign_dispatch(_InputIter __first2, _InputIter __last2,
- __false_type)
-{
- iterator __first1 = begin();
- iterator __last1 = end();
- for ( ; __first1 != __last1 && __first2 != __last2; ++__first1, ++__first2)
- *__first1 = *__first2;
- if (__first2 == __last2)
- erase(__first1, __last1);
- else
- insert(__last1, __first2, __last2);
-}
-
-#endif /* __STL_MEMBER_TEMPLATES */
-
-template <class _Tp, class _Alloc>
-void list<_Tp, _Alloc>::remove(const _Tp& __value)
-{
- iterator __first = begin();
- iterator __last = end();
- while (__first != __last) {
- iterator __next = __first;
- ++__next;
- if (*__first == __value) erase(__first);
- __first = __next;
- }
-}
-
-template <class _Tp, class _Alloc>
-void list<_Tp, _Alloc>::unique()
-{
- iterator __first = begin();
- iterator __last = end();
- if (__first == __last) return;
- iterator __next = __first;
- while (++__next != __last) {
- if (*__first == *__next)
- erase(__next);
- else
- __first = __next;
- __next = __first;
- }
-}
-
-template <class _Tp, class _Alloc>
-void list<_Tp, _Alloc>::merge(list<_Tp, _Alloc>& __x)
-{
- iterator __first1 = begin();
- iterator __last1 = end();
- iterator __first2 = __x.begin();
- iterator __last2 = __x.end();
- while (__first1 != __last1 && __first2 != __last2)
- if (*__first2 < *__first1) {
- iterator __next = __first2;
- transfer(__first1, __first2, ++__next);
- __first2 = __next;
- }
- else
- ++__first1;
- if (__first2 != __last2) transfer(__last1, __first2, __last2);
-}
-
-template <class _Tp, class _Alloc>
-void list<_Tp, _Alloc>::reverse()
-{
- // Do nothing if the list has length 0 or 1.
- if (_M_node->_M_next != _M_node &&
- ((_Node*) (_M_node->_M_next))->_M_next != _M_node) {
- iterator __first = begin();
- ++__first;
- while (__first != end()) {
- iterator __old = __first;
- ++__first;
- transfer(begin(), __old, __first);
- }
- }
-}
-
-template <class _Tp, class _Alloc>
-void list<_Tp, _Alloc>::sort()
-{
- // Do nothing if the list has length 0 or 1.
- if (_M_node->_M_next != _M_node &&
- ((_Node*) (_M_node->_M_next))->_M_next != _M_node) {
- list<_Tp, _Alloc> __carry;
- list<_Tp, _Alloc> __counter[64];
- int __fill = 0;
- while (!empty()) {
- __carry.splice(__carry.begin(), *this, begin());
- int __i = 0;
- while(__i < __fill && !__counter[__i].empty()) {
- __counter[__i].merge(__carry);
- __carry.swap(__counter[__i++]);
- }
- __carry.swap(__counter[__i]);
- if (__i == __fill) ++__fill;
- }
-
- for (int __i = 1; __i < __fill; ++__i)
- __counter[__i].merge(__counter[__i-1]);
- swap(__counter[__fill-1]);
- }
-}
-
-#ifdef __STL_MEMBER_TEMPLATES
-
-template <class _Tp, class _Alloc> template <class _Predicate>
-void list<_Tp, _Alloc>::remove_if(_Predicate __pred)
-{
- iterator __first = begin();
- iterator __last = end();
- while (__first != __last) {
- iterator __next = __first;
- ++__next;
- if (__pred(*__first)) erase(__first);
- __first = __next;
- }
-}
-
-template <class _Tp, class _Alloc> template <class _BinaryPredicate>
-void list<_Tp, _Alloc>::unique(_BinaryPredicate __binary_pred)
-{
- iterator __first = begin();
- iterator __last = end();
- if (__first == __last) return;
- iterator __next = __first;
- while (++__next != __last) {
- if (__binary_pred(*__first, *__next))
- erase(__next);
- else
- __first = __next;
- __next = __first;
- }
-}
-
-template <class _Tp, class _Alloc> template <class _StrictWeakOrdering>
-void list<_Tp, _Alloc>::merge(list<_Tp, _Alloc>& __x,
- _StrictWeakOrdering __comp)
-{
- iterator __first1 = begin();
- iterator __last1 = end();
- iterator __first2 = __x.begin();
- iterator __last2 = __x.end();
- while (__first1 != __last1 && __first2 != __last2)
- if (__comp(*__first2, *__first1)) {
- iterator __next = __first2;
- transfer(__first1, __first2, ++__next);
- __first2 = __next;
- }
- else
- ++__first1;
- if (__first2 != __last2) transfer(__last1, __first2, __last2);
-}
-
-template <class _Tp, class _Alloc> template <class _StrictWeakOrdering>
-void list<_Tp, _Alloc>::sort(_StrictWeakOrdering __comp)
-{
- // Do nothing if the list has length 0 or 1.
- if (_M_node->_M_next != _M_node &&
- ((_Node*) (_M_node->_M_next))->_M_next != _M_node) {
- list<_Tp, _Alloc> __carry;
- list<_Tp, _Alloc> __counter[64];
- int __fill = 0;
- while (!empty()) {
- __carry.splice(__carry.begin(), *this, begin());
- int __i = 0;
- while(__i < __fill && !__counter[__i].empty()) {
- __counter[__i].merge(__carry, __comp);
- __carry.swap(__counter[__i++]);
- }
- __carry.swap(__counter[__i]);
- if (__i == __fill) ++__fill;
- }
-
- for (int __i = 1; __i < __fill; ++__i)
- __counter[__i].merge(__counter[__i-1], __comp);
- swap(__counter[__fill-1]);
- }
-}
-
-#endif /* __STL_MEMBER_TEMPLATES */
-
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma reset woff 1174
-#pragma reset woff 1375
-#endif
-
-__STL_END_NAMESPACE
-
-#endif /* __SGI_STL_INTERNAL_LIST_H */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/contrib/libstdc++/stl/stl_map.h b/contrib/libstdc++/stl/stl_map.h
deleted file mode 100644
index a702e8023efa..000000000000
--- a/contrib/libstdc++/stl/stl_map.h
+++ /dev/null
@@ -1,242 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- *
- * Copyright (c) 1996,1997
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- */
-
-/* NOTE: This is an internal header file, included by other STL headers.
- * You should not attempt to use it directly.
- */
-
-#ifndef __SGI_STL_INTERNAL_MAP_H
-#define __SGI_STL_INTERNAL_MAP_H
-
-__STL_BEGIN_NAMESPACE
-
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma set woff 1174
-#pragma set woff 1375
-#endif
-
-#ifndef __STL_LIMITED_DEFAULT_TEMPLATES
-template <class _Key, class _Tp, class _Compare = less<_Key>,
- class _Alloc = __STL_DEFAULT_ALLOCATOR(_Tp) >
-#else
-template <class _Key, class _Tp, class _Compare,
- class _Alloc = __STL_DEFAULT_ALLOCATOR(_Tp) >
-#endif
-class map {
-public:
-
-// typedefs:
-
- typedef _Key key_type;
- typedef _Tp data_type;
- typedef _Tp mapped_type;
- typedef pair<const _Key, _Tp> value_type;
- typedef _Compare key_compare;
-
- class value_compare
- : public binary_function<value_type, value_type, bool> {
- friend class map<_Key,_Tp,_Compare,_Alloc>;
- protected :
- _Compare _M_comp;
- value_compare(_Compare __c) : _M_comp(__c) {}
- public:
- bool operator()(const value_type& __x, const value_type& __y) const {
- return _M_comp(__x.first, __y.first);
- }
- };
-
-private:
- typedef _Rb_tree<key_type, value_type,
- _Select1st<value_type>, key_compare, _Alloc> _Rep_type;
- _Rep_type _M_t; // red-black tree representing map
-public:
- typedef typename _Rep_type::pointer pointer;
- typedef typename _Rep_type::const_pointer const_pointer;
- typedef typename _Rep_type::reference reference;
- typedef typename _Rep_type::const_reference const_reference;
- typedef typename _Rep_type::iterator iterator;
- typedef typename _Rep_type::const_iterator const_iterator;
- typedef typename _Rep_type::reverse_iterator reverse_iterator;
- typedef typename _Rep_type::const_reverse_iterator const_reverse_iterator;
- typedef typename _Rep_type::size_type size_type;
- typedef typename _Rep_type::difference_type difference_type;
- typedef typename _Rep_type::allocator_type allocator_type;
-
- // allocation/deallocation
-
- map() : _M_t(_Compare(), allocator_type()) {}
- explicit map(const _Compare& __comp,
- const allocator_type& __a = allocator_type())
- : _M_t(__comp, __a) {}
-
-#ifdef __STL_MEMBER_TEMPLATES
- template <class _InputIterator>
- map(_InputIterator __first, _InputIterator __last)
- : _M_t(_Compare(), allocator_type())
- { _M_t.insert_unique(__first, __last); }
-
- template <class _InputIterator>
- map(_InputIterator __first, _InputIterator __last, const _Compare& __comp,
- const allocator_type& __a = allocator_type())
- : _M_t(__comp, __a) { _M_t.insert_unique(__first, __last); }
-#else
- map(const value_type* __first, const value_type* __last)
- : _M_t(_Compare(), allocator_type())
- { _M_t.insert_unique(__first, __last); }
-
- map(const value_type* __first,
- const value_type* __last, const _Compare& __comp,
- const allocator_type& __a = allocator_type())
- : _M_t(__comp, __a) { _M_t.insert_unique(__first, __last); }
-
- map(const_iterator __first, const_iterator __last)
- : _M_t(_Compare(), allocator_type())
- { _M_t.insert_unique(__first, __last); }
-
- map(const_iterator __first, const_iterator __last, const _Compare& __comp,
- const allocator_type& __a = allocator_type())
- : _M_t(__comp, __a) { _M_t.insert_unique(__first, __last); }
-
-#endif /* __STL_MEMBER_TEMPLATES */
-
- map(const map<_Key,_Tp,_Compare,_Alloc>& __x) : _M_t(__x._M_t) {}
- map<_Key,_Tp,_Compare,_Alloc>&
- operator=(const map<_Key, _Tp, _Compare, _Alloc>& __x)
- {
- _M_t = __x._M_t;
- return *this;
- }
-
- // accessors:
-
- key_compare key_comp() const { return _M_t.key_comp(); }
- value_compare value_comp() const { return value_compare(_M_t.key_comp()); }
- allocator_type get_allocator() const { return _M_t.get_allocator(); }
-
- iterator begin() { return _M_t.begin(); }
- const_iterator begin() const { return _M_t.begin(); }
- iterator end() { return _M_t.end(); }
- const_iterator end() const { return _M_t.end(); }
- reverse_iterator rbegin() { return _M_t.rbegin(); }
- const_reverse_iterator rbegin() const { return _M_t.rbegin(); }
- reverse_iterator rend() { return _M_t.rend(); }
- const_reverse_iterator rend() const { return _M_t.rend(); }
- bool empty() const { return _M_t.empty(); }
- size_type size() const { return _M_t.size(); }
- size_type max_size() const { return _M_t.max_size(); }
- _Tp& operator[](const key_type& __k) {
- iterator __i = lower_bound(__k);
- // __i->first is greater than or equivalent to __k.
- if (__i == end() || key_comp()(__k, (*__i).first))
- __i = insert(__i, value_type(__k, _Tp()));
- return (*__i).second;
- }
- void swap(map<_Key,_Tp,_Compare,_Alloc>& __x) { _M_t.swap(__x._M_t); }
-
- // insert/erase
-
- pair<iterator,bool> insert(const value_type& __x)
- { return _M_t.insert_unique(__x); }
- iterator insert(iterator position, const value_type& __x)
- { return _M_t.insert_unique(position, __x); }
-#ifdef __STL_MEMBER_TEMPLATES
- template <class _InputIterator>
- void insert(_InputIterator __first, _InputIterator __last) {
- _M_t.insert_unique(__first, __last);
- }
-#else
- void insert(const value_type* __first, const value_type* __last) {
- _M_t.insert_unique(__first, __last);
- }
- void insert(const_iterator __first, const_iterator __last) {
- _M_t.insert_unique(__first, __last);
- }
-#endif /* __STL_MEMBER_TEMPLATES */
-
- void erase(iterator __position) { _M_t.erase(__position); }
- size_type erase(const key_type& __x) { return _M_t.erase(__x); }
- void erase(iterator __first, iterator __last)
- { _M_t.erase(__first, __last); }
- void clear() { _M_t.clear(); }
-
- // map operations:
-
- iterator find(const key_type& __x) { return _M_t.find(__x); }
- const_iterator find(const key_type& __x) const { return _M_t.find(__x); }
- size_type count(const key_type& __x) const { return _M_t.count(__x); }
- iterator lower_bound(const key_type& __x) {return _M_t.lower_bound(__x); }
- const_iterator lower_bound(const key_type& __x) const {
- return _M_t.lower_bound(__x);
- }
- iterator upper_bound(const key_type& __x) {return _M_t.upper_bound(__x); }
- const_iterator upper_bound(const key_type& __x) const {
- return _M_t.upper_bound(__x);
- }
-
- pair<iterator,iterator> equal_range(const key_type& __x) {
- return _M_t.equal_range(__x);
- }
- pair<const_iterator,const_iterator> equal_range(const key_type& __x) const {
- return _M_t.equal_range(__x);
- }
- friend bool operator== __STL_NULL_TMPL_ARGS (const map&, const map&);
- friend bool operator< __STL_NULL_TMPL_ARGS (const map&, const map&);
-};
-
-template <class _Key, class _Tp, class _Compare, class _Alloc>
-inline bool operator==(const map<_Key,_Tp,_Compare,_Alloc>& __x,
- const map<_Key,_Tp,_Compare,_Alloc>& __y) {
- return __x._M_t == __y._M_t;
-}
-
-template <class _Key, class _Tp, class _Compare, class _Alloc>
-inline bool operator<(const map<_Key,_Tp,_Compare,_Alloc>& __x,
- const map<_Key,_Tp,_Compare,_Alloc>& __y) {
- return __x._M_t < __y._M_t;
-}
-
-#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER
-
-template <class _Key, class _Tp, class _Compare, class _Alloc>
-inline void swap(map<_Key,_Tp,_Compare,_Alloc>& __x,
- map<_Key,_Tp,_Compare,_Alloc>& __y) {
- __x.swap(__y);
-}
-
-#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */
-
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma reset woff 1174
-#pragma reset woff 1375
-#endif
-
-__STL_END_NAMESPACE
-
-#endif /* __SGI_STL_INTERNAL_MAP_H */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/contrib/libstdc++/stl/stl_multimap.h b/contrib/libstdc++/stl/stl_multimap.h
deleted file mode 100644
index b7d3b87e52d1..000000000000
--- a/contrib/libstdc++/stl/stl_multimap.h
+++ /dev/null
@@ -1,232 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- *
- * Copyright (c) 1996,1997
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- */
-
-/* NOTE: This is an internal header file, included by other STL headers.
- * You should not attempt to use it directly.
- */
-
-#ifndef __SGI_STL_INTERNAL_MULTIMAP_H
-#define __SGI_STL_INTERNAL_MULTIMAP_H
-
-__STL_BEGIN_NAMESPACE
-
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma set woff 1174
-#pragma set woff 1375
-#endif
-
-#ifndef __STL_LIMITED_DEFAULT_TEMPLATES
-template <class _Key, class _Tp, class _Compare = less<_Key>,
- class _Alloc = __STL_DEFAULT_ALLOCATOR(_Tp) >
-#else
-template <class _Key, class _Tp, class _Compare,
- class _Alloc = __STL_DEFAULT_ALLOCATOR(_Tp) >
-#endif
-class multimap {
-public:
-
-// typedefs:
-
- typedef _Key key_type;
- typedef _Tp data_type;
- typedef _Tp mapped_type;
- typedef pair<const _Key, _Tp> value_type;
- typedef _Compare key_compare;
-
- class value_compare : public binary_function<value_type, value_type, bool> {
- friend class multimap<_Key,_Tp,_Compare,_Alloc>;
- protected:
- _Compare _M_comp;
- value_compare(_Compare __c) : _M_comp(__c) {}
- public:
- bool operator()(const value_type& __x, const value_type& __y) const {
- return _M_comp(__x.first, __y.first);
- }
- };
-
-private:
- typedef _Rb_tree<key_type, value_type,
- _Select1st<value_type>, key_compare, _Alloc> _Rep_type;
- _Rep_type _M_t; // red-black tree representing multimap
-public:
- typedef typename _Rep_type::pointer pointer;
- typedef typename _Rep_type::const_pointer const_pointer;
- typedef typename _Rep_type::reference reference;
- typedef typename _Rep_type::const_reference const_reference;
- typedef typename _Rep_type::iterator iterator;
- typedef typename _Rep_type::const_iterator const_iterator;
- typedef typename _Rep_type::reverse_iterator reverse_iterator;
- typedef typename _Rep_type::const_reverse_iterator const_reverse_iterator;
- typedef typename _Rep_type::size_type size_type;
- typedef typename _Rep_type::difference_type difference_type;
- typedef typename _Rep_type::allocator_type allocator_type;
-
-// allocation/deallocation
-
- multimap() : _M_t(_Compare(), allocator_type()) { }
- explicit multimap(const _Compare& __comp,
- const allocator_type& __a = allocator_type())
- : _M_t(__comp, __a) { }
-
-#ifdef __STL_MEMBER_TEMPLATES
- template <class _InputIterator>
- multimap(_InputIterator __first, _InputIterator __last)
- : _M_t(_Compare(), allocator_type())
- { _M_t.insert_equal(__first, __last); }
-
- template <class _InputIterator>
- multimap(_InputIterator __first, _InputIterator __last,
- const _Compare& __comp,
- const allocator_type& __a = allocator_type())
- : _M_t(__comp, __a) { _M_t.insert_equal(__first, __last); }
-#else
- multimap(const value_type* __first, const value_type* __last)
- : _M_t(_Compare(), allocator_type())
- { _M_t.insert_equal(__first, __last); }
- multimap(const value_type* __first, const value_type* __last,
- const _Compare& __comp,
- const allocator_type& __a = allocator_type())
- : _M_t(__comp, __a) { _M_t.insert_equal(__first, __last); }
-
- multimap(const_iterator __first, const_iterator __last)
- : _M_t(_Compare(), allocator_type())
- { _M_t.insert_equal(__first, __last); }
- multimap(const_iterator __first, const_iterator __last,
- const _Compare& __comp,
- const allocator_type& __a = allocator_type())
- : _M_t(__comp, __a) { _M_t.insert_equal(__first, __last); }
-#endif /* __STL_MEMBER_TEMPLATES */
-
- multimap(const multimap<_Key,_Tp,_Compare,_Alloc>& __x) : _M_t(__x._M_t) { }
- multimap<_Key,_Tp,_Compare,_Alloc>&
- operator=(const multimap<_Key,_Tp,_Compare,_Alloc>& __x) {
- _M_t = __x._M_t;
- return *this;
- }
-
- // accessors:
-
- key_compare key_comp() const { return _M_t.key_comp(); }
- value_compare value_comp() const { return value_compare(_M_t.key_comp()); }
- allocator_type get_allocator() const { return _M_t.get_allocator(); }
-
- iterator begin() { return _M_t.begin(); }
- const_iterator begin() const { return _M_t.begin(); }
- iterator end() { return _M_t.end(); }
- const_iterator end() const { return _M_t.end(); }
- reverse_iterator rbegin() { return _M_t.rbegin(); }
- const_reverse_iterator rbegin() const { return _M_t.rbegin(); }
- reverse_iterator rend() { return _M_t.rend(); }
- const_reverse_iterator rend() const { return _M_t.rend(); }
- bool empty() const { return _M_t.empty(); }
- size_type size() const { return _M_t.size(); }
- size_type max_size() const { return _M_t.max_size(); }
- void swap(multimap<_Key,_Tp,_Compare,_Alloc>& __x) { _M_t.swap(__x._M_t); }
-
- // insert/erase
-
- iterator insert(const value_type& __x) { return _M_t.insert_equal(__x); }
- iterator insert(iterator __position, const value_type& __x) {
- return _M_t.insert_equal(__position, __x);
- }
-#ifdef __STL_MEMBER_TEMPLATES
- template <class _InputIterator>
- void insert(_InputIterator __first, _InputIterator __last) {
- _M_t.insert_equal(__first, __last);
- }
-#else
- void insert(const value_type* __first, const value_type* __last) {
- _M_t.insert_equal(__first, __last);
- }
- void insert(const_iterator __first, const_iterator __last) {
- _M_t.insert_equal(__first, __last);
- }
-#endif /* __STL_MEMBER_TEMPLATES */
- void erase(iterator __position) { _M_t.erase(__position); }
- size_type erase(const key_type& __x) { return _M_t.erase(__x); }
- void erase(iterator __first, iterator __last)
- { _M_t.erase(__first, __last); }
- void clear() { _M_t.clear(); }
-
- // multimap operations:
-
- iterator find(const key_type& __x) { return _M_t.find(__x); }
- const_iterator find(const key_type& __x) const { return _M_t.find(__x); }
- size_type count(const key_type& __x) const { return _M_t.count(__x); }
- iterator lower_bound(const key_type& __x) {return _M_t.lower_bound(__x); }
- const_iterator lower_bound(const key_type& __x) const {
- return _M_t.lower_bound(__x);
- }
- iterator upper_bound(const key_type& __x) {return _M_t.upper_bound(__x); }
- const_iterator upper_bound(const key_type& __x) const {
- return _M_t.upper_bound(__x);
- }
- pair<iterator,iterator> equal_range(const key_type& __x) {
- return _M_t.equal_range(__x);
- }
- pair<const_iterator,const_iterator> equal_range(const key_type& __x) const {
- return _M_t.equal_range(__x);
- }
- friend bool operator== __STL_NULL_TMPL_ARGS (const multimap&,
- const multimap&);
- friend bool operator< __STL_NULL_TMPL_ARGS (const multimap&,
- const multimap&);
-};
-
-template <class _Key, class _Tp, class _Compare, class _Alloc>
-inline bool operator==(const multimap<_Key,_Tp,_Compare,_Alloc>& __x,
- const multimap<_Key,_Tp,_Compare,_Alloc>& __y) {
- return __x._M_t == __y._M_t;
-}
-
-template <class _Key, class _Tp, class _Compare, class _Alloc>
-inline bool operator<(const multimap<_Key,_Tp,_Compare,_Alloc>& __x,
- const multimap<_Key,_Tp,_Compare,_Alloc>& __y) {
- return __x._M_t < __y._M_t;
-}
-
-#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER
-
-template <class _Key, class _Tp, class _Compare, class _Alloc>
-inline void swap(multimap<_Key,_Tp,_Compare,_Alloc>& __x,
- multimap<_Key,_Tp,_Compare,_Alloc>& __y) {
- __x.swap(__y);
-}
-
-#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */
-
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma reset woff 1174
-#pragma reset woff 1375
-#endif
-
-__STL_END_NAMESPACE
-
-#endif /* __SGI_STL_INTERNAL_MULTIMAP_H */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/contrib/libstdc++/stl/stl_multiset.h b/contrib/libstdc++/stl/stl_multiset.h
deleted file mode 100644
index 7378e43f8b36..000000000000
--- a/contrib/libstdc++/stl/stl_multiset.h
+++ /dev/null
@@ -1,224 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- *
- * Copyright (c) 1996
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- */
-
-/* NOTE: This is an internal header file, included by other STL headers.
- * You should not attempt to use it directly.
- */
-
-#ifndef __SGI_STL_INTERNAL_MULTISET_H
-#define __SGI_STL_INTERNAL_MULTISET_H
-
-__STL_BEGIN_NAMESPACE
-
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma set woff 1174
-#pragma set woff 1375
-#endif
-
-#ifndef __STL_LIMITED_DEFAULT_TEMPLATES
-template <class _Key, class _Compare = less<_Key>,
- class _Alloc = __STL_DEFAULT_ALLOCATOR(_Key) >
-#else
-template <class _Key, class _Compare,
- class _Alloc = __STL_DEFAULT_ALLOCATOR(_Key) >
-#endif
-class multiset {
-public:
- // typedefs:
-
- typedef _Key key_type;
- typedef _Key value_type;
- typedef _Compare key_compare;
- typedef _Compare value_compare;
-private:
- typedef _Rb_tree<key_type, value_type,
- _Identity<value_type>, key_compare, _Alloc> _Rep_type;
- _Rep_type _M_t; // red-black tree representing multiset
-public:
- typedef typename _Rep_type::const_pointer pointer;
- typedef typename _Rep_type::const_pointer const_pointer;
- typedef typename _Rep_type::const_reference reference;
- typedef typename _Rep_type::const_reference const_reference;
- typedef typename _Rep_type::const_iterator iterator;
- typedef typename _Rep_type::const_iterator const_iterator;
- typedef typename _Rep_type::const_reverse_iterator reverse_iterator;
- typedef typename _Rep_type::const_reverse_iterator const_reverse_iterator;
- typedef typename _Rep_type::size_type size_type;
- typedef typename _Rep_type::difference_type difference_type;
- typedef typename _Rep_type::allocator_type allocator_type;
-
- // allocation/deallocation
-
- multiset() : _M_t(_Compare(), allocator_type()) {}
- explicit multiset(const _Compare& __comp,
- const allocator_type& __a = allocator_type())
- : _M_t(__comp, __a) {}
-
-#ifdef __STL_MEMBER_TEMPLATES
-
- template <class _InputIterator>
- multiset(_InputIterator __first, _InputIterator __last)
- : _M_t(_Compare(), allocator_type())
- { _M_t.insert_equal(__first, __last); }
-
- template <class _InputIterator>
- multiset(_InputIterator __first, _InputIterator __last,
- const _Compare& __comp,
- const allocator_type& __a = allocator_type())
- : _M_t(__comp, __a) { _M_t.insert_equal(__first, __last); }
-
-#else
-
- multiset(const value_type* __first, const value_type* __last)
- : _M_t(_Compare(), allocator_type())
- { _M_t.insert_equal(__first, __last); }
-
- multiset(const value_type* __first, const value_type* __last,
- const _Compare& __comp,
- const allocator_type& __a = allocator_type())
- : _M_t(__comp, __a) { _M_t.insert_equal(__first, __last); }
-
- multiset(const_iterator __first, const_iterator __last)
- : _M_t(_Compare(), allocator_type())
- { _M_t.insert_equal(__first, __last); }
-
- multiset(const_iterator __first, const_iterator __last,
- const _Compare& __comp,
- const allocator_type& __a = allocator_type())
- : _M_t(__comp, __a) { _M_t.insert_equal(__first, __last); }
-
-#endif /* __STL_MEMBER_TEMPLATES */
-
- multiset(const multiset<_Key,_Compare,_Alloc>& __x) : _M_t(__x._M_t) {}
- multiset<_Key,_Compare,_Alloc>&
- operator=(const multiset<_Key,_Compare,_Alloc>& __x) {
- _M_t = __x._M_t;
- return *this;
- }
-
- // accessors:
-
- key_compare key_comp() const { return _M_t.key_comp(); }
- value_compare value_comp() const { return _M_t.key_comp(); }
- allocator_type get_allocator() const { return _M_t.get_allocator(); }
-
- iterator begin() const { return _M_t.begin(); }
- iterator end() const { return _M_t.end(); }
- reverse_iterator rbegin() const { return _M_t.rbegin(); }
- reverse_iterator rend() const { return _M_t.rend(); }
- bool empty() const { return _M_t.empty(); }
- size_type size() const { return _M_t.size(); }
- size_type max_size() const { return _M_t.max_size(); }
- void swap(multiset<_Key,_Compare,_Alloc>& __x) { _M_t.swap(__x._M_t); }
-
- // insert/erase
- iterator insert(const value_type& __x) {
- return _M_t.insert_equal(__x);
- }
- iterator insert(iterator __position, const value_type& __x) {
- typedef typename _Rep_type::iterator _Rep_iterator;
- return _M_t.insert_equal((_Rep_iterator&)__position, __x);
- }
-
-#ifdef __STL_MEMBER_TEMPLATES
- template <class _InputIterator>
- void insert(_InputIterator __first, _InputIterator __last) {
- _M_t.insert_equal(__first, __last);
- }
-#else
- void insert(const value_type* __first, const value_type* __last) {
- _M_t.insert_equal(__first, __last);
- }
- void insert(const_iterator __first, const_iterator __last) {
- _M_t.insert_equal(__first, __last);
- }
-#endif /* __STL_MEMBER_TEMPLATES */
- void erase(iterator __position) {
- typedef typename _Rep_type::iterator _Rep_iterator;
- _M_t.erase((_Rep_iterator&)__position);
- }
- size_type erase(const key_type& __x) {
- return _M_t.erase(__x);
- }
- void erase(iterator __first, iterator __last) {
- typedef typename _Rep_type::iterator _Rep_iterator;
- _M_t.erase((_Rep_iterator&)__first, (_Rep_iterator&)__last);
- }
- void clear() { _M_t.clear(); }
-
- // multiset operations:
-
- iterator find(const key_type& __x) const { return _M_t.find(__x); }
- size_type count(const key_type& __x) const { return _M_t.count(__x); }
- iterator lower_bound(const key_type& __x) const {
- return _M_t.lower_bound(__x);
- }
- iterator upper_bound(const key_type& __x) const {
- return _M_t.upper_bound(__x);
- }
- pair<iterator,iterator> equal_range(const key_type& __x) const {
- return _M_t.equal_range(__x);
- }
- friend bool operator== __STL_NULL_TMPL_ARGS (const multiset&,
- const multiset&);
- friend bool operator< __STL_NULL_TMPL_ARGS (const multiset&,
- const multiset&);
-};
-
-template <class _Key, class _Compare, class _Alloc>
-inline bool operator==(const multiset<_Key,_Compare,_Alloc>& __x,
- const multiset<_Key,_Compare,_Alloc>& __y) {
- return __x._M_t == __y._M_t;
-}
-
-template <class _Key, class _Compare, class _Alloc>
-inline bool operator<(const multiset<_Key,_Compare,_Alloc>& __x,
- const multiset<_Key,_Compare,_Alloc>& __y) {
- return __x._M_t < __y._M_t;
-}
-
-#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER
-
-template <class _Key, class _Compare, class _Alloc>
-inline void swap(multiset<_Key,_Compare,_Alloc>& __x,
- multiset<_Key,_Compare,_Alloc>& __y) {
- __x.swap(__y);
-}
-
-#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */
-
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma reset woff 1174
-#pragma reset woff 1375
-#endif
-
-__STL_END_NAMESPACE
-
-#endif /* __SGI_STL_INTERNAL_MULTISET_H */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/contrib/libstdc++/stl/stl_numeric.h b/contrib/libstdc++/stl/stl_numeric.h
deleted file mode 100644
index 392515a3d87d..000000000000
--- a/contrib/libstdc++/stl/stl_numeric.h
+++ /dev/null
@@ -1,239 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- *
- * Copyright (c) 1996,1997
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- */
-
-/* NOTE: This is an internal header file, included by other STL headers.
- * You should not attempt to use it directly.
- */
-
-
-#ifndef __SGI_STL_INTERNAL_NUMERIC_H
-#define __SGI_STL_INTERNAL_NUMERIC_H
-
-__STL_BEGIN_NAMESPACE
-
-template <class _InputIterator, class _Tp>
-_Tp accumulate(_InputIterator __first, _InputIterator __last, _Tp __init)
-{
- for ( ; __first != __last; ++__first)
- __init = __init + *__first;
- return __init;
-}
-
-template <class _InputIterator, class _Tp, class _BinaryOperation>
-_Tp accumulate(_InputIterator __first, _InputIterator __last, _Tp __init,
- _BinaryOperation __binary_op)
-{
- for ( ; __first != __last; ++__first)
- __init = __binary_op(__init, *__first);
- return __init;
-}
-
-template <class _InputIterator1, class _InputIterator2, class _Tp>
-_Tp inner_product(_InputIterator1 __first1, _InputIterator1 __last1,
- _InputIterator2 __first2, _Tp __init)
-{
- for ( ; __first1 != __last1; ++__first1, ++__first2)
- __init = __init + (*__first1 * *__first2);
- return __init;
-}
-
-template <class _InputIterator1, class _InputIterator2, class _Tp,
- class _BinaryOperation1, class _BinaryOperation2>
-_Tp inner_product(_InputIterator1 __first1, _InputIterator1 __last1,
- _InputIterator2 __first2, _Tp __init,
- _BinaryOperation1 __binary_op1,
- _BinaryOperation2 __binary_op2)
-{
- for ( ; __first1 != __last1; ++__first1, ++__first2)
- __init = __binary_op1(__init, __binary_op2(*__first1, *__first2));
- return __init;
-}
-
-template <class _InputIterator, class _OutputIterator, class _Tp>
-_OutputIterator
-__partial_sum(_InputIterator __first, _InputIterator __last,
- _OutputIterator __result, _Tp*)
-{
- _Tp __value = *__first;
- while (++__first != __last) {
- __value = __value + *__first;
- *++__result = __value;
- }
- return ++__result;
-}
-
-template <class _InputIterator, class _OutputIterator>
-_OutputIterator
-partial_sum(_InputIterator __first, _InputIterator __last,
- _OutputIterator __result)
-{
- if (__first == __last) return __result;
- *__result = *__first;
- return __partial_sum(__first, __last, __result, __VALUE_TYPE(__first));
-}
-
-template <class _InputIterator, class _OutputIterator, class _Tp,
- class _BinaryOperation>
-_OutputIterator
-__partial_sum(_InputIterator __first, _InputIterator __last,
- _OutputIterator __result, _Tp*, _BinaryOperation __binary_op)
-{
- _Tp __value = *__first;
- while (++__first != __last) {
- __value = __binary_op(__value, *__first);
- *++__result = __value;
- }
- return ++__result;
-}
-
-template <class _InputIterator, class _OutputIterator, class _BinaryOperation>
-_OutputIterator
-partial_sum(_InputIterator __first, _InputIterator __last,
- _OutputIterator __result, _BinaryOperation __binary_op)
-{
- if (__first == __last) return __result;
- *__result = *__first;
- return __partial_sum(__first, __last, __result, __VALUE_TYPE(__first),
- __binary_op);
-}
-
-template <class _InputIterator, class _OutputIterator, class _Tp>
-_OutputIterator
-__adjacent_difference(_InputIterator __first, _InputIterator __last,
- _OutputIterator __result, _Tp*)
-{
- _Tp __value = *__first;
- while (++__first != __last) {
- _Tp __tmp = *__first;
- *++__result = __tmp - __value;
- __value = __tmp;
- }
- return ++__result;
-}
-
-template <class _InputIterator, class _OutputIterator>
-_OutputIterator
-adjacent_difference(_InputIterator __first,
- _InputIterator __last, _OutputIterator __result)
-{
- if (__first == __last) return __result;
- *__result = *__first;
- return __adjacent_difference(__first, __last, __result,
- __VALUE_TYPE(__first));
-}
-
-template <class _InputIterator, class _OutputIterator, class _Tp,
- class _BinaryOperation>
-_OutputIterator
-__adjacent_difference(_InputIterator __first, _InputIterator __last,
- _OutputIterator __result, _Tp*,
- _BinaryOperation __binary_op) {
- _Tp __value = *__first;
- while (++__first != __last) {
- _Tp __tmp = *__first;
- *++__result = __binary_op(__tmp, __value);
- __value = __tmp;
- }
- return ++__result;
-}
-
-template <class _InputIterator, class _OutputIterator, class _BinaryOperation>
-_OutputIterator
-adjacent_difference(_InputIterator __first, _InputIterator __last,
- _OutputIterator __result, _BinaryOperation __binary_op)
-{
- if (__first == __last) return __result;
- *__result = *__first;
- return __adjacent_difference(__first, __last, __result,
- __VALUE_TYPE(__first),
- __binary_op);
-}
-
-// Returns __x ** __n, where __n >= 0. _Note that "multiplication"
-// is required to be associative, but not necessarily commutative.
-
-
-template <class _Tp, class _Integer, class _MonoidOperation>
-_Tp __power(_Tp __x, _Integer __n, _MonoidOperation __oper)
-{
- if (__n == 0)
- return identity_element(__oper);
- else {
- while ((__n & 1) == 0) {
- __n >>= 1;
- __x = __oper(__x, __x);
- }
-
- _Tp __result = __x;
- __n >>= 1;
- while (__n != 0) {
- __x = __oper(__x, __x);
- if ((__n & 1) != 0)
- __result = __oper(__result, __x);
- __n >>= 1;
- }
- return __result;
- }
-}
-
-template <class _Tp, class _Integer>
-inline _Tp __power(_Tp __x, _Integer __n)
-{
- return __power(__x, __n, multiplies<_Tp>());
-}
-
-// Alias for the internal name __power. Note that power is an extension,
-// not part of the C++ standard.
-
-template <class _Tp, class _Integer, class _MonoidOperation>
-inline _Tp power(_Tp __x, _Integer __n, _MonoidOperation __oper)
-{
- return __power(__x, __n, __oper);
-}
-
-template <class _Tp, class _Integer>
-inline _Tp power(_Tp __x, _Integer __n)
-{
- return __power(__x, __n);
-}
-
-// iota is not part of the C++ standard. It is an extension.
-
-template <class _ForwardIterator, class _Tp>
-void
-iota(_ForwardIterator __first, _ForwardIterator __last, _Tp __value)
-{
- while (__first != __last)
- *__first++ = __value++;
-}
-
-__STL_END_NAMESPACE
-
-#endif /* __SGI_STL_INTERNAL_NUMERIC_H */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/contrib/libstdc++/stl/stl_pair.h b/contrib/libstdc++/stl/stl_pair.h
deleted file mode 100644
index 3aa290b59edb..000000000000
--- a/contrib/libstdc++/stl/stl_pair.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- *
- * Copyright (c) 1996,1997
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- */
-
-/* NOTE: This is an internal header file, included by other STL headers.
- * You should not attempt to use it directly.
- */
-
-#ifndef __SGI_STL_INTERNAL_PAIR_H
-#define __SGI_STL_INTERNAL_PAIR_H
-
-__STL_BEGIN_NAMESPACE
-
-template <class _T1, class _T2>
-struct pair {
- typedef _T1 first_type;
- typedef _T2 second_type;
-
- _T1 first;
- _T2 second;
- pair() : first(_T1()), second(_T2()) {}
- pair(const _T1& __a, const _T2& __b) : first(__a), second(__b) {}
-
-#ifdef __STL_MEMBER_TEMPLATES
- template <class _U1, class _U2>
- pair(const pair<_U1, _U2>& __p) : first(__p.first), second(__p.second) {}
-#endif
-};
-
-template <class _T1, class _T2>
-inline bool operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
-{
- return __x.first == __y.first && __x.second == __y.second;
-}
-
-template <class _T1, class _T2>
-inline bool operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
-{
- return __x.first < __y.first ||
- (!(__y.first < __x.first) && __x.second < __y.second);
-}
-
-template <class _T1, class _T2>
-inline pair<_T1, _T2> make_pair(const _T1& __x, const _T2& __y)
-{
- return pair<_T1, _T2>(__x, __y);
-}
-
-__STL_END_NAMESPACE
-
-#endif /* __SGI_STL_INTERNAL_PAIR_H */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/contrib/libstdc++/stl/stl_queue.h b/contrib/libstdc++/stl/stl_queue.h
deleted file mode 100644
index c1e2b6984403..000000000000
--- a/contrib/libstdc++/stl/stl_queue.h
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- *
- * Copyright (c) 1996,1997
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- */
-
-/* NOTE: This is an internal header file, included by other STL headers.
- * You should not attempt to use it directly.
- */
-
-#ifndef __SGI_STL_INTERNAL_QUEUE_H
-#define __SGI_STL_INTERNAL_QUEUE_H
-
-__STL_BEGIN_NAMESPACE
-
-#ifndef __STL_LIMITED_DEFAULT_TEMPLATES
-template <class _Tp, class _Sequence = deque<_Tp> >
-#else
-template <class _Tp, class _Sequence>
-#endif
-class queue {
- friend bool operator== __STL_NULL_TMPL_ARGS (const queue&, const queue&);
- friend bool operator< __STL_NULL_TMPL_ARGS (const queue&, const queue&);
-public:
- typedef typename _Sequence::value_type value_type;
- typedef typename _Sequence::size_type size_type;
- typedef _Sequence container_type;
-
- typedef typename _Sequence::reference reference;
- typedef typename _Sequence::const_reference const_reference;
-protected:
- _Sequence c;
-public:
- queue() : c() {}
- explicit queue(const _Sequence& __c) : c(__c) {}
-
- bool empty() const { return c.empty(); }
- size_type size() const { return c.size(); }
- reference front() { return c.front(); }
- const_reference front() const { return c.front(); }
- reference back() { return c.back(); }
- const_reference back() const { return c.back(); }
- void push(const value_type& __x) { c.push_back(__x); }
- void pop() { c.pop_front(); }
-};
-
-template <class _Tp, class _Sequence>
-bool
-operator==(const queue<_Tp, _Sequence>& __x, const queue<_Tp, _Sequence>& __y)
-{
- return __x.c == __y.c;
-}
-
-template <class _Tp, class _Sequence>
-bool
-operator<(const queue<_Tp, _Sequence>& __x, const queue<_Tp, _Sequence>& __y)
-{
- return __x.c < __y.c;
-}
-
-#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER
-
-template <class _Tp, class _Sequence>
-bool
-operator!=(const queue<_Tp, _Sequence>& __x, const queue<_Tp, _Sequence>& __y)
-{
- return !(__x == __y);
-}
-
-template <class _Tp, class _Sequence>
-bool
-operator>(const queue<_Tp, _Sequence>& __x, const queue<_Tp, _Sequence>& __y)
-{
- return __y < __x;
-}
-
-template <class _Tp, class _Sequence>
-bool
-operator<=(const queue<_Tp, _Sequence>& __x, const queue<_Tp, _Sequence>& __y)
-{
- return !(__y < __x);
-}
-
-template <class _Tp, class _Sequence>
-bool
-operator>=(const queue<_Tp, _Sequence>& __x, const queue<_Tp, _Sequence>& __y)
-{
- return !(__x < __y);
-}
-
-#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */
-
-#ifndef __STL_LIMITED_DEFAULT_TEMPLATES
-template <class _Tp, class _Sequence = vector<_Tp>,
- class _Compare = less<typename _Sequence::value_type> >
-#else
-template <class _Tp, class _Sequence, class _Compare>
-#endif
-class priority_queue {
-public:
- typedef typename _Sequence::value_type value_type;
- typedef typename _Sequence::size_type size_type;
- typedef _Sequence container_type;
-
- typedef typename _Sequence::reference reference;
- typedef typename _Sequence::const_reference const_reference;
-protected:
- _Sequence c;
- _Compare comp;
-public:
- priority_queue() : c() {}
- explicit priority_queue(const _Compare& __x) : c(), comp(__x) {}
- priority_queue(const _Compare& __x, const _Sequence& __s)
- : c(__s), comp(__x)
- { make_heap(c.begin(), c.end(), comp); }
-
-#ifdef __STL_MEMBER_TEMPLATES
- template <class _InputIterator>
- priority_queue(_InputIterator __first, _InputIterator __last)
- : c(__first, __last) { make_heap(c.begin(), c.end(), comp); }
-
- template <class _InputIterator>
- priority_queue(_InputIterator __first,
- _InputIterator __last, const _Compare& __x)
- : c(__first, __last), comp(__x)
- { make_heap(c.begin(), c.end(), comp); }
-
- template <class _InputIterator>
- priority_queue(_InputIterator __first, _InputIterator __last,
- const _Compare& __x, const _Sequence& __s)
- : c(__s), comp(__x)
- {
- c.insert(c.end(), __first, __last);
- make_heap(c.begin(), c.end(), comp);
- }
-
-#else /* __STL_MEMBER_TEMPLATES */
- priority_queue(const value_type* __first, const value_type* __last)
- : c(__first, __last) { make_heap(c.begin(), c.end(), comp); }
-
- priority_queue(const value_type* __first, const value_type* __last,
- const _Compare& __x)
- : c(__first, __last), comp(__x)
- { make_heap(c.begin(), c.end(), comp); }
-
- priority_queue(const value_type* __first, const value_type* __last,
- const _Compare& __x, const _Sequence& __c)
- : c(__c), comp(__x)
- {
- c.insert(c.end(), __first, __last);
- make_heap(c.begin(), c.end(), comp);
- }
-#endif /* __STL_MEMBER_TEMPLATES */
-
- bool empty() const { return c.empty(); }
- size_type size() const { return c.size(); }
- const_reference top() const { return c.front(); }
- void push(const value_type& __x) {
- __STL_TRY {
- c.push_back(__x);
- push_heap(c.begin(), c.end(), comp);
- }
- __STL_UNWIND(c.clear());
- }
- void pop() {
- __STL_TRY {
- pop_heap(c.begin(), c.end(), comp);
- c.pop_back();
- }
- __STL_UNWIND(c.clear());
- }
-};
-
-// no equality is provided
-
-__STL_END_NAMESPACE
-
-#endif /* __SGI_STL_INTERNAL_QUEUE_H */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/contrib/libstdc++/stl/stl_raw_storage_iter.h b/contrib/libstdc++/stl/stl_raw_storage_iter.h
deleted file mode 100644
index 6f3951cb8af8..000000000000
--- a/contrib/libstdc++/stl/stl_raw_storage_iter.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- *
- * Copyright (c) 1996
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- */
-
-/* NOTE: This is an internal header file, included by other STL headers.
- * You should not attempt to use it directly.
- */
-
-#ifndef __SGI_STL_INTERNAL_RAW_STORAGE_ITERATOR_H
-#define __SGI_STL_INTERNAL_RAW_STORAGE_ITERATOR_H
-
-__STL_BEGIN_NAMESPACE
-
-template <class _ForwardIterator, class _Tp>
-class raw_storage_iterator {
-protected:
- _ForwardIterator _M_iter;
-public:
- typedef output_iterator_tag iterator_category;
- typedef void value_type;
- typedef void difference_type;
- typedef void pointer;
- typedef void reference;
-
- explicit raw_storage_iterator(_ForwardIterator __x) : _M_iter(__x) {}
- raw_storage_iterator& operator*() { return *this; }
- raw_storage_iterator& operator=(const _Tp& __element) {
- construct(&*_M_iter, __element);
- return *this;
- }
- raw_storage_iterator<_ForwardIterator, _Tp>& operator++() {
- ++_M_iter;
- return *this;
- }
- raw_storage_iterator<_ForwardIterator, _Tp> operator++(int) {
- raw_storage_iterator<_ForwardIterator, _Tp> __tmp = *this;
- ++_M_iter;
- return __tmp;
- }
-};
-
-#ifndef __STL_CLASS_PARTIAL_SPECIALIZATION
-
-template <class _ForwardIterator, class _Tp>
-inline output_iterator_tag
-iterator_category(const raw_storage_iterator<_ForwardIterator, _Tp>&)
-{
- return output_iterator_tag();
-}
-
-#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
-
-__STL_END_NAMESPACE
-
-#endif /* __SGI_STL_INTERNAL_RAW_STORAGE_ITERATOR_H */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/contrib/libstdc++/stl/stl_relops.h b/contrib/libstdc++/stl/stl_relops.h
deleted file mode 100644
index 16cad1b84e20..000000000000
--- a/contrib/libstdc++/stl/stl_relops.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- * Copyright (c) 1996,1997
- * Silicon Graphics
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- */
-
-/* NOTE: This is an internal header file, included by other STL headers.
- * You should not attempt to use it directly.
- */
-
-#ifndef __SGI_STL_INTERNAL_RELOPS
-#define __SGI_STL_INTERNAL_RELOPS
-
-__STL_BEGIN_RELOPS_NAMESPACE
-
-template <class _Tp>
-inline bool operator!=(const _Tp& __x, const _Tp& __y) {
- return !(__x == __y);
-}
-
-template <class _Tp>
-inline bool operator>(const _Tp& __x, const _Tp& __y) {
- return __y < __x;
-}
-
-template <class _Tp>
-inline bool operator<=(const _Tp& __x, const _Tp& __y) {
- return !(__y < __x);
-}
-
-template <class _Tp>
-inline bool operator>=(const _Tp& __x, const _Tp& __y) {
- return !(__x < __y);
-}
-
-__STL_END_RELOPS_NAMESPACE
-
-#endif /* __SGI_STL_INTERNAL_RELOPS */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/contrib/libstdc++/stl/stl_rope.h b/contrib/libstdc++/stl/stl_rope.h
deleted file mode 100644
index fa1e848c0652..000000000000
--- a/contrib/libstdc++/stl/stl_rope.h
+++ /dev/null
@@ -1,2541 +0,0 @@
-/*
- * Copyright (c) 1997
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- */
-
-/* NOTE: This is an internal header file, included by other STL headers.
- * You should not attempt to use it directly.
- */
-
-// rope<_CharT,_Alloc> is a sequence of _CharT.
-// Ropes appear to be mutable, but update operations
-// really copy enough of the data structure to leave the original
-// valid. Thus ropes can be logically copied by just copying
-// a pointer value.
-
-#ifndef __SGI_STL_INTERNAL_ROPE_H
-# define __SGI_STL_INTERNAL_ROPE_H
-
-# ifdef __GC
-# define __GC_CONST const
-# else
-# define __GC_CONST // constant except for deallocation
-# endif
-# ifdef __STL_SGI_THREADS
-# include <mutex.h>
-# endif
-
-__STL_BEGIN_NAMESPACE
-
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma set woff 1174
-#endif
-
-// The _S_eos function is used for those functions that
-// convert to/from C-like strings to detect the end of the string.
-
-// The end-of-C-string character.
-// This is what the draft standard says it should be.
-template <class _CharT>
-inline _CharT _S_eos(_CharT*) { return _CharT(); }
-
-// Test for basic character types.
-// For basic character types leaves having a trailing eos.
-template <class _CharT>
-inline bool _S_is_basic_char_type(_CharT*) { return false; }
-template <class _CharT>
-inline bool _S_is_one_byte_char_type(_CharT*) { return false; }
-
-inline bool _S_is_basic_char_type(char*) { return true; }
-inline bool _S_is_one_byte_char_type(char*) { return true; }
-inline bool _S_is_basic_char_type(wchar_t*) { return true; }
-
-// Store an eos iff _CharT is a basic character type.
-// Do not reference _S_eos if it isn't.
-template <class _CharT>
-inline void _S_cond_store_eos(_CharT&) {}
-
-inline void _S_cond_store_eos(char& __c) { __c = 0; }
-inline void _S_cond_store_eos(wchar_t& __c) { __c = 0; }
-
-// char_producers are logically functions that generate a section of
-// a string. These can be convereted to ropes. The resulting rope
-// invokes the char_producer on demand. This allows, for example,
-// files to be viewed as ropes without reading the entire file.
-template <class _CharT>
-class char_producer {
- public:
- virtual ~char_producer() {};
- virtual void operator()(size_t __start_pos, size_t __len,
- _CharT* __buffer) = 0;
- // Buffer should really be an arbitrary output iterator.
- // That way we could flatten directly into an ostream, etc.
- // This is thoroughly impossible, since iterator types don't
- // have runtime descriptions.
-};
-
-// Sequence buffers:
-//
-// Sequence must provide an append operation that appends an
-// array to the sequence. Sequence buffers are useful only if
-// appending an entire array is cheaper than appending element by element.
-// This is true for many string representations.
-// This should perhaps inherit from ostream<sequence::value_type>
-// and be implemented correspondingly, so that they can be used
-// for formatted. For the sake of portability, we don't do this yet.
-//
-// For now, sequence buffers behave as output iterators. But they also
-// behave a little like basic_ostringstream<sequence::value_type> and a
-// little like containers.
-
-template<class _Sequence, size_t _Buf_sz = 100
-# if defined(__sgi) && !defined(__GNUC__)
-# define __TYPEDEF_WORKAROUND
- ,class _V = typename _Sequence::value_type
-# endif
- >
-// The 3rd parameter works around a common compiler bug.
-class sequence_buffer : public output_iterator {
- public:
-# ifndef __TYPEDEF_WORKAROUND
- typedef typename _Sequence::value_type value_type;
-# else
- typedef _V value_type;
-# endif
- protected:
- _Sequence* _M_prefix;
- value_type _M_buffer[_Buf_sz];
- size_t _M_buf_count;
- public:
- void flush() {
- _M_prefix->append(_M_buffer, _M_buffer + _M_buf_count);
- _M_buf_count = 0;
- }
- ~sequence_buffer() { flush(); }
- sequence_buffer() : _M_prefix(0), _M_buf_count(0) {}
- sequence_buffer(const sequence_buffer& __x) {
- _M_prefix = __x._M_prefix;
- _M_buf_count = __x._M_buf_count;
- copy(__x._M_buffer, __x._M_buffer + __x._M_buf_count, _M_buffer);
- }
- sequence_buffer(sequence_buffer& __x) {
- __x.flush();
- _M_prefix = __x._M_prefix;
- _M_buf_count = 0;
- }
- sequence_buffer(_Sequence& __s) : _M_prefix(&__s), _M_buf_count(0) {}
- sequence_buffer& operator= (sequence_buffer& __x) {
- __x.flush();
- _M_prefix = __x._M_prefix;
- _M_buf_count = 0;
- return *this;
- }
- sequence_buffer& operator= (const sequence_buffer& __x) {
- _M_prefix = __x._M_prefix;
- _M_buf_count = __x._M_buf_count;
- copy(__x._M_buffer, __x._M_buffer + __x._M_buf_count, _M_buffer);
- return *this;
- }
- void push_back(value_type __x)
- {
- if (_M_buf_count < _Buf_sz) {
- _M_buffer[_M_buf_count] = __x;
- ++_M_buf_count;
- } else {
- flush();
- _M_buffer[0] = __x;
- _M_buf_count = 1;
- }
- }
- void append(value_type* __s, size_t __len)
- {
- if (__len + _M_buf_count <= _Buf_sz) {
- size_t __i = _M_buf_count;
- size_t __j = 0;
- for (; __j < __len; __i++, __j++) {
- _M_buffer[__i] = __s[__j];
- }
- _M_buf_count += __len;
- } else if (0 == _M_buf_count) {
- _M_prefix->append(__s, __s + __len);
- } else {
- flush();
- append(__s, __len);
- }
- }
- sequence_buffer& write(value_type* __s, size_t __len)
- {
- append(__s, __len);
- return *this;
- }
- sequence_buffer& put(value_type __x)
- {
- push_back(__x);
- return *this;
- }
- sequence_buffer& operator=(const value_type& __rhs)
- {
- push_back(__rhs);
- return *this;
- }
- sequence_buffer& operator*() { return *this; }
- sequence_buffer& operator++() { return *this; }
- sequence_buffer& operator++(int) { return *this; }
-};
-
-// The following should be treated as private, at least for now.
-template<class _CharT>
-class _Rope_char_consumer {
- public:
- // If we had member templates, these should not be virtual.
- // For now we need to use run-time parametrization where
- // compile-time would do. _Hence this should all be private
- // for now.
- // The symmetry with char_producer is accidental and temporary.
- virtual ~_Rope_char_consumer() {};
- virtual bool operator()(const _CharT* __buffer, size_t __len) = 0;
-};
-
-//
-// What follows should really be local to rope. Unfortunately,
-// that doesn't work, since it makes it impossible to define generic
-// equality on rope iterators. According to the draft standard, the
-// template parameters for such an equality operator cannot be inferred
-// from the occurence of a member class as a parameter.
-// (SGI compilers in fact allow this, but the __result wouldn't be
-// portable.)
-// Similarly, some of the static member functions are member functions
-// only to avoid polluting the global namespace, and to circumvent
-// restrictions on type inference for template functions.
-//
-
-template<class _CharT, class _Alloc=__STL_DEFAULT_ALLOCATOR(_CharT)> class rope;
-template<class _CharT, class _Alloc> struct _Rope_RopeConcatenation;
-template<class _CharT, class _Alloc> struct _Rope_RopeLeaf;
-template<class _CharT, class _Alloc> struct _Rope_RopeFunction;
-template<class _CharT, class _Alloc> struct _Rope_RopeSubstring;
-template<class _CharT, class _Alloc> class _Rope_iterator;
-template<class _CharT, class _Alloc> class _Rope_const_iterator;
-template<class _CharT, class _Alloc> class _Rope_char_ref_proxy;
-template<class _CharT, class _Alloc> class _Rope_char_ptr_proxy;
-
-//
-// The internal data structure for representing a rope. This is
-// private to the implementation. A rope is really just a pointer
-// to one of these.
-//
-// A few basic functions for manipulating this data structure
-// are members of _RopeRep. Most of the more complex algorithms
-// are implemented as rope members.
-//
-// Some of the static member functions of _RopeRep have identically
-// named functions in rope that simply invoke the _RopeRep versions.
-//
-// A macro to introduce various allocation and deallocation functions
-// These need to be defined differently depending on whether or not
-// we are using standard conforming allocators, and whether the allocator
-// instances have real state. Thus this macro is invoked repeatedly
-// with different definitions of __ROPE_DEFINE_ALLOC.
-// __ROPE_DEFINE_ALLOC(type,name) defines
-// type * name_allocate(size_t) and
-// void name_deallocate(tipe *, size_t)
-// Both functions may or may not be static.
-
-#define __ROPE_DEFINE_ALLOCS(__a) \
- __ROPE_DEFINE_ALLOC(_CharT,_Data) /* character data */ \
- typedef _Rope_RopeConcatenation<_CharT,__a> __C; \
- __ROPE_DEFINE_ALLOC(__C,_C) \
- typedef _Rope_RopeLeaf<_CharT,__a> __L; \
- __ROPE_DEFINE_ALLOC(__L,_L) \
- typedef _Rope_RopeFunction<_CharT,__a> __F; \
- __ROPE_DEFINE_ALLOC(__F,_F) \
- typedef _Rope_RopeSubstring<_CharT,__a> __S; \
- __ROPE_DEFINE_ALLOC(__S,_S)
-
-// Internal rope nodes potentially store a copy of the allocator
-// instance used to allocate them. This is mostly redundant.
-// But the alternative would be to pass allocator instances around
-// in some form to nearly all internal functions, since any pointer
-// assignment may result in a zero reference count and thus require
-// deallocation.
-// The _Rope_rep_base class encapsulates
-// the differences between SGI-style allocators and standard-conforming
-// allocators.
-
-#ifdef __STL_USE_STD_ALLOCATORS
-
-#define __STATIC_IF_SGI_ALLOC /* not static */
-
-// Base class for ordinary allocators.
-template <class _CharT, class _Allocator, bool _IsStatic>
-class _Rope_rep_alloc_base {
-public:
- typedef typename _Alloc_traits<_CharT,_Allocator>::allocator_type
- allocator_type;
- allocator_type get_allocator() const { return _M_data_allocator; }
- _Rope_rep_alloc_base(size_t __size, const allocator_type& __a)
- : _M_size(__size), _M_data_allocator(__a) {}
- size_t _M_size; // This is here only to avoid wasting space
- // for an otherwise empty base class.
-
-
-protected:
- allocator_type _M_data_allocator;
-
-# define __ROPE_DEFINE_ALLOC(_Tp, __name) \
- typedef typename \
- _Alloc_traits<_Tp,_Allocator>::allocator_type __name##Allocator; \
- /*static*/ _Tp * __name##_allocate(size_t __n) \
- { return __name##Allocator(_M_data_allocator).allocate(__n); } \
- void __name##_deallocate(_Tp* __p, size_t __n) \
- { __name##Allocator(_M_data_allocator).deallocate(__p, __n); }
- __ROPE_DEFINE_ALLOCS(_Allocator);
-# undef __ROPE_DEFINE_ALLOC
-};
-
-// Specialization for allocators that have the property that we don't
-// actually have to store an allocator object.
-template <class _CharT, class _Allocator>
-class _Rope_rep_alloc_base<_CharT,_Allocator,true> {
-public:
- typedef typename _Alloc_traits<_CharT,_Allocator>::allocator_type
- allocator_type;
- allocator_type get_allocator() const { return allocator_type(); }
- _Rope_rep_alloc_base(size_t __size, const allocator_type&)
- : _M_size(__size) {}
- size_t _M_size;
-
-protected:
-
-# define __ROPE_DEFINE_ALLOC(_Tp, __name) \
- typedef typename \
- _Alloc_traits<_Tp,_Allocator>::_Alloc_type __name##Alloc; \
- typedef typename \
- _Alloc_traits<_Tp,_Allocator>::allocator_type __name##Allocator; \
- static _Tp* __name##_allocate(size_t __n) \
- { return __name##Alloc::allocate(__n); } \
- void __name##_deallocate(_Tp *__p, size_t __n) \
- { __name##Alloc::deallocate(__p, __n); }
- __ROPE_DEFINE_ALLOCS(_Allocator);
-# undef __ROPE_DEFINE_ALLOC
-};
-
-template <class _CharT, class _Alloc>
-struct _Rope_rep_base
- : public _Rope_rep_alloc_base<_CharT,_Alloc,
- _Alloc_traits<_CharT,_Alloc>::_S_instanceless>
-{
- typedef _Rope_rep_alloc_base<_CharT,_Alloc,
- _Alloc_traits<_CharT,_Alloc>::_S_instanceless>
- _Base;
- typedef typename _Base::allocator_type allocator_type;
- _Rope_rep_base(size_t __size, const allocator_type& __a)
- : _Base(__size, __a) {}
-};
-
-#else /* !__STL_USE_STD_ALLOCATORS */
-
-#define __STATIC_IF_SGI_ALLOC static
-
-template <class _CharT, class _Alloc>
-class _Rope_rep_base {
-public:
- typedef _Alloc allocator_type;
- static allocator_type get_allocator() { return allocator_type(); }
- _Rope_rep_base(size_t __size, const allocator_type&) : _M_size(__size) {}
- size_t _M_size;
-
-protected:
-
-# define __ROPE_DEFINE_ALLOC(_Tp, __name) \
- typedef simple_alloc<_Tp, _Alloc> __name##Alloc; \
- static _Tp* __name##_allocate(size_t __n) \
- { return __name##Alloc::allocate(__n); } \
- static void __name##_deallocate(_Tp* __p, size_t __n) \
- { __name##Alloc::deallocate(__p, __n); }
- __ROPE_DEFINE_ALLOCS(_Alloc);
-# undef __ROPE_DEFINE_ALLOC
-};
-
-#endif /* __STL_USE_STD_ALLOCATORS */
-
-
-template<class _CharT, class _Alloc>
-struct _Rope_RopeRep : public _Rope_rep_base<_CharT,_Alloc> {
- public:
- enum { _S_max_rope_depth = 45 };
- enum _Tag {_S_leaf, _S_concat, _S_substringfn, _S_function};
- _Tag _M_tag:8;
- bool _M_is_balanced:8;
- unsigned char _M_depth;
- __GC_CONST _CharT* _M_c_string;
- /* Flattened version of string, if needed. */
- /* typically 0. */
- /* If it's not 0, then the memory is owned */
- /* by this node. */
- /* In the case of a leaf, this may point to */
- /* the same memory as the data field. */
- typedef _Rope_rep_base<_CharT,_Alloc>::allocator_type allocator_type;
- _Rope_RopeRep(_Tag __t, int __d, bool __b, size_t __size,
- allocator_type __a)
- : _Rope_rep_base<_CharT,_Alloc>(__size, __a),
- _M_tag(__t), _M_depth(__d), _M_is_balanced(__b), _M_c_string(0)
- {
-# ifndef __GC
- _M_refcount = 1;
- _M_init_refcount_lock();
-# endif
- }
-# ifndef __GC
-# if defined(__STL_WIN32THREADS)
- long _M_refcount; // InterlockedIncrement wants a long *
-# else
- size_t _M_refcount;
-# endif
- // We count references from rope instances
- // and references from other rope nodes. We
- // do not count const_iterator references.
- // Iterator references are counted so that rope modifications
- // can be detected after the fact.
- // Generally function results are counted, i.__e.
- // a pointer returned by a function is included at the
- // point at which the pointer is returned.
- // The recipient should decrement the count if the
- // __result is not needed.
- // Generally function arguments are not reflected
- // in the reference count. The callee should increment
- // the count before saving the argument someplace that
- // will outlive the call.
-# endif
-# ifndef __GC
-# ifdef __STL_SGI_THREADS
- // Reference counting with multiple threads and no
- // hardware or thread package support is pretty awful.
- // Mutexes are normally too expensive.
- // We'll assume a COMPARE_AND_SWAP(destp, __old, new)
- // operation, which might be cheaper.
-# if __mips < 3 || !(defined (_ABIN32) || defined(_ABI64))
-# define __add_and_fetch(l,v) add_then_test((unsigned long*)l,v)
-# endif
- void _M_init_refcount_lock() {}
- void _M_incr_refcount ()
- {
- __add_and_fetch(&_M_refcount, 1);
- }
- size_t _M_decr_refcount ()
- {
- return __add_and_fetch(&_M_refcount, (size_t)(-1));
- }
-# elif defined(__STL_WIN32THREADS)
- void _M_init_refcount_lock() {}
- void _M_incr_refcount ()
- {
- InterlockedIncrement(&_M_refcount);
- }
- size_t _M_decr_refcount ()
- {
- return InterlockedDecrement(&_M_refcount);
- }
-# elif defined(__STL_PTHREADS)
- // This should be portable, but performance is expected
- // to be quite awful. This really needs platform specific
- // code.
- pthread_mutex_t _M_refcount_lock;
- void _M_init_refcount_lock() {
- pthread_mutex_init(&_M_refcount_lock, 0);
- }
- void _M_incr_refcount ()
- {
- pthread_mutex_lock(&_M_refcount_lock);
- ++_M_refcount;
- pthread_mutex_unlock(&_M_refcount_lock);
- }
- size_t _M_decr_refcount ()
- {
- size_t __result;
- pthread_mutex_lock(&_M_refcount_lock);
- __result = --_M_refcount;
- pthread_mutex_unlock(&_M_refcount_lock);
- return __result;
- }
-# else
- void _M_init_refcount_lock() {}
- void _M_incr_refcount ()
- {
- ++_M_refcount;
- }
- size_t _M_decr_refcount ()
- {
- --_M_refcount;
- return _M_refcount;
- }
-# endif
-# else
- void _M_incr_refcount () {}
-# endif
-# ifdef __STL_USE_STD_ALLOCATORS
- static void _S_free_string(__GC_CONST _CharT*, size_t __len,
- allocator_type __a);
-# define __STL_FREE_STRING(__s, __l, __a) _S_free_string(__s, __l, __a);
-# else
- static void _S_free_string(__GC_CONST _CharT*, size_t __len);
-# define __STL_FREE_STRING(__s, __l, __a) _S_free_string(__s, __l);
-# endif
- // Deallocate data section of a leaf.
- // This shouldn't be a member function.
- // But its hard to do anything else at the
- // moment, because it's templatized w.r.t.
- // an allocator.
- // Does nothing if __GC is defined.
-# ifndef __GC
- void _M_free_c_string();
- void _M_free_tree();
- // Deallocate t. Assumes t is not 0.
- void _M_unref_nonnil()
- {
- if (0 == _M_decr_refcount()) _M_free_tree();
- }
- void _M_ref_nonnil()
- {
- _M_incr_refcount();
- }
- static void _S_unref(_Rope_RopeRep* __t)
- {
- if (0 != __t) {
- __t->_M_unref_nonnil();
- }
- }
- static void _S_ref(_Rope_RopeRep* __t)
- {
- if (0 != __t) __t->_M_incr_refcount();
- }
- static void _S_free_if_unref(_Rope_RopeRep* __t)
- {
- if (0 != __t && 0 == __t->_M_refcount) __t->_M_free_tree();
- }
-# else /* __GC */
- void _M_unref_nonnil() {}
- void _M_ref_nonnil() {}
- static void _S_unref(_Rope_RopeRep*) {}
- static void _S_ref(_Rope_RopeRep*) {}
- static void _S_free_if_unref(_Rope_RopeRep*) {}
-# endif
-
-};
-
-template<class _CharT, class _Alloc>
-struct _Rope_RopeLeaf : public _Rope_RopeRep<_CharT,_Alloc> {
- public:
- // Apparently needed by VC++
- // The data fields of leaves are allocated with some
- // extra space, to accomodate future growth and for basic
- // character types, to hold a trailing eos character.
- enum { _S_alloc_granularity = 8 };
- static size_t _S_rounded_up_size(size_t __n) {
- size_t __size_with_eos;
-
- if (_S_is_basic_char_type((_CharT*)0)) {
- __size_with_eos = __n + 1;
- } else {
- __size_with_eos = __n;
- }
-# ifdef __GC
- return __size_with_eos;
-# else
- // Allow slop for in-place expansion.
- return (__size_with_eos + _S_alloc_granularity-1)
- &~ (_S_alloc_granularity-1);
-# endif
- }
- __GC_CONST _CharT* _M_data; /* Not necessarily 0 terminated. */
- /* The allocated size is */
- /* _S_rounded_up_size(size), except */
- /* in the GC case, in which it */
- /* doesn't matter. */
- typedef _Rope_rep_base<_CharT,_Alloc>::allocator_type allocator_type;
- _Rope_RopeLeaf(__GC_CONST _CharT* __d, size_t __size, allocator_type __a)
- : _Rope_RopeRep<_CharT,_Alloc>(_S_leaf, 0, true, __size, __a),
- _M_data(__d)
- {
- __stl_assert(__size > 0);
- if (_S_is_basic_char_type((_CharT *)0)) {
- // already eos terminated.
- _M_c_string = __d;
- }
- }
- // The constructor assumes that d has been allocated with
- // the proper allocator and the properly padded size.
- // In contrast, the destructor deallocates the data:
-# ifndef __GC
- ~_Rope_RopeLeaf() {
- if (_M_data != _M_c_string) {
- _M_free_c_string();
- }
- __STL_FREE_STRING(_M_data, _M_size, get_allocator());
- }
-# endif
-};
-
-template<class _CharT, class _Alloc>
-struct _Rope_RopeConcatenation : public _Rope_RopeRep<_CharT,_Alloc> {
- public:
- _Rope_RopeRep<_CharT,_Alloc>* _M_left;
- _Rope_RopeRep<_CharT,_Alloc>* _M_right;
- typedef _Rope_rep_base<_CharT,_Alloc>::allocator_type allocator_type;
- _Rope_RopeConcatenation(_Rope_RopeRep<_CharT,_Alloc>* __l,
- _Rope_RopeRep<_CharT,_Alloc>* __r,
- allocator_type __a)
- : _Rope_RopeRep<_CharT,_Alloc>(
- _S_concat, max(__l->_M_depth, __r->_M_depth) + 1, false,
- __l->_M_size + __r->_M_size, __a),
- _M_left(__l), _M_right(__r)
- {}
-# ifndef __GC
- ~_Rope_RopeConcatenation() {
- _M_free_c_string();
- _M_left->_M_unref_nonnil();
- _M_right->_M_unref_nonnil();
- }
-# endif
-};
-
-template<class _CharT, class _Alloc>
-struct _Rope_RopeFunction : public _Rope_RopeRep<_CharT,_Alloc> {
- public:
- char_producer<_CharT>* _M_fn;
-# ifndef __GC
- bool _M_delete_when_done; // Char_producer is owned by the
- // rope and should be explicitly
- // deleted when the rope becomes
- // inaccessible.
-# else
- // In the GC case, we either register the rope for
- // finalization, or not. Thus the field is unnecessary;
- // the information is stored in the collector data structures.
- // We do need a finalization procedure to be invoked by the
- // collector.
- static void _S_fn_finalization_proc(void * __tree, void *) {
- delete ((_Rope_RopeFunction *)__tree) -> _M_fn;
- }
-# endif
- typedef _Rope_rep_base<_CharT,_Alloc>::allocator_type allocator_type;
- _Rope_RopeFunction(char_producer<_CharT>* __f, size_t __size,
- bool __d, allocator_type __a)
- :_Rope_RopeRep<_CharT,_Alloc>(_S_function, 0, true, __size, __a),
- _M_fn(__f)
-# ifndef __GC
- , _M_delete_when_done(__d)
-# endif
- {
- __stl_assert(__size > 0);
-# ifdef __GC
- if (__d) {
- GC_REGISTER_FINALIZER(
- this, _Rope_RopeFunction::_S_fn_finalization_proc, 0, 0, 0);
- }
-# endif
- }
-# ifndef __GC
- ~_Rope_RopeFunction() {
- _M_free_c_string();
- if (_M_delete_when_done) {
- delete _M_fn;
- }
- }
-# endif
-};
-// Substring results are usually represented using just
-// concatenation nodes. But in the case of very long flat ropes
-// or ropes with a functional representation that isn't practical.
-// In that case, we represent the __result as a special case of
-// RopeFunction, whose char_producer points back to the rope itself.
-// In all cases except repeated substring operations and
-// deallocation, we treat the __result as a RopeFunction.
-template<class _CharT, class _Alloc>
-struct _Rope_RopeSubstring : public _Rope_RopeFunction<_CharT,_Alloc>,
- public char_producer<_CharT> {
- public:
- // XXX this whole class should be rewritten.
- _Rope_RopeRep<_CharT,_Alloc>* _M_base; // not 0
- size_t _M_start;
- virtual void operator()(size_t __start_pos, size_t __req_len,
- _CharT* __buffer) {
- switch(_M_base->_M_tag) {
- case _S_function:
- case _S_substringfn:
- {
- char_producer<_CharT>* __fn =
- ((_Rope_RopeFunction<_CharT,_Alloc>*)_M_base)->_M_fn;
- __stl_assert(__start_pos + __req_len <= _M_size);
- __stl_assert(_M_start + _M_size <= _M_base->_M_size);
- (*__fn)(__start_pos + _M_start, __req_len, __buffer);
- }
- break;
- case _S_leaf:
- {
- __GC_CONST _CharT* __s =
- ((_Rope_RopeLeaf<_CharT,_Alloc>*)_M_base)->_M_data;
- uninitialized_copy_n(__s + __start_pos + _M_start, __req_len,
- __buffer);
- }
- break;
- default:
- __stl_assert(false);
- }
- }
- typedef _Rope_rep_base<_CharT,_Alloc>::allocator_type allocator_type;
- _Rope_RopeSubstring(_Rope_RopeRep<_CharT,_Alloc>* __b, size_t __s,
- size_t __l, allocator_type __a)
- : _Rope_RopeFunction<_CharT,_Alloc>(this, __l, false, __a), _M_base(__b)
- , _M_start(__s)
- {
- __stl_assert(__l > 0);
- __stl_assert(__s + __l <= __b->_M_size);
-# ifndef __GC
- _M_base->_M_ref_nonnil();
-# endif
- _M_tag = _S_substringfn;
- }
- virtual ~_Rope_RopeSubstring()
- {
-# ifndef __GC
- _M_base->_M_unref_nonnil();
- // _M_free_c_string(); -- done by parent class
-# endif
- }
-};
-
-
-// Self-destructing pointers to Rope_rep.
-// These are not conventional smart pointers. Their
-// only purpose in life is to ensure that unref is called
-// on the pointer either at normal exit or if an exception
-// is raised. It is the caller's responsibility to
-// adjust reference counts when these pointers are initialized
-// or assigned to. (This convention significantly reduces
-// the number of potentially expensive reference count
-// updates.)
-#ifndef __GC
- template<class _CharT, class _Alloc>
- struct _Rope_self_destruct_ptr {
- _Rope_RopeRep<_CharT,_Alloc>* _M_ptr;
- ~_Rope_self_destruct_ptr()
- { _Rope_RopeRep<_CharT,_Alloc>::_S_unref(_M_ptr); }
-# ifdef __STL_USE_EXCEPTIONS
- _Rope_self_destruct_ptr() : _M_ptr(0) {};
-# else
- _Rope_self_destruct_ptr() {};
-# endif
- _Rope_self_destruct_ptr(_Rope_RopeRep<_CharT,_Alloc>* __p) : _M_ptr(__p) {}
- _Rope_RopeRep<_CharT,_Alloc>& operator*() { return *_M_ptr; }
- _Rope_RopeRep<_CharT,_Alloc>* operator->() { return _M_ptr; }
- operator _Rope_RopeRep<_CharT,_Alloc>*() { return _M_ptr; }
- _Rope_self_destruct_ptr& operator= (_Rope_RopeRep<_CharT,_Alloc>* __x)
- { _M_ptr = __x; return *this; }
- };
-#endif
-
-// Dereferencing a nonconst iterator has to return something
-// that behaves almost like a reference. It's not possible to
-// return an actual reference since assignment requires extra
-// work. And we would get into the same problems as with the
-// CD2 version of basic_string.
-template<class _CharT, class _Alloc>
-class _Rope_char_ref_proxy {
- friend class rope<_CharT,_Alloc>;
- friend class _Rope_iterator<_CharT,_Alloc>;
- friend class _Rope_char_ptr_proxy<_CharT,_Alloc>;
-# ifdef __GC
- typedef _Rope_RopeRep<_CharT,_Alloc>* _Self_destruct_ptr;
-# else
- typedef _Rope_self_destruct_ptr<_CharT,_Alloc> _Self_destruct_ptr;
-# endif
- typedef _Rope_RopeRep<_CharT,_Alloc> _RopeRep;
- typedef rope<_CharT,_Alloc> _My_rope;
- size_t _M_pos;
- _CharT _M_current;
- bool _M_current_valid;
- _My_rope* _M_root; // The whole rope.
- public:
- _Rope_char_ref_proxy(_My_rope* __r, size_t __p) :
- _M_pos(__p), _M_current_valid(false), _M_root(__r) {}
- _Rope_char_ref_proxy(const _Rope_char_ref_proxy& __x) :
- _M_pos(__x._M_pos), _M_current_valid(false), _M_root(__x._M_root) {}
- // Don't preserve cache if the reference can outlive the
- // expression. We claim that's not possible without calling
- // a copy constructor or generating reference to a proxy
- // reference. We declare the latter to have undefined semantics.
- _Rope_char_ref_proxy(_My_rope* __r, size_t __p,
- _CharT __c) :
- _M_pos(__p), _M_current(__c), _M_current_valid(true), _M_root(__r) {}
- inline operator _CharT () const;
- _Rope_char_ref_proxy& operator= (_CharT __c);
- _Rope_char_ptr_proxy<_CharT,_Alloc> operator& () const;
- _Rope_char_ref_proxy& operator= (const _Rope_char_ref_proxy& __c) {
- return operator=((_CharT)__c);
- }
-};
-
-#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER
- template<class _CharT, class __Alloc>
- inline void swap(_Rope_char_ref_proxy <_CharT, __Alloc > __a,
- _Rope_char_ref_proxy <_CharT, __Alloc > __b) {
- _CharT __tmp = __a;
- __a = __b;
- __b = __tmp;
- }
-#else
-// There is no really acceptable way to handle this. The default
-// definition of swap doesn't work for proxy references.
-// It can't really be made to work, even with ugly hacks, since
-// the only unusual operation it uses is the copy constructor, which
-// is needed for other purposes. We provide a macro for
-// full specializations, and instantiate the most common case.
-# define _ROPE_SWAP_SPECIALIZATION(_CharT, __Alloc) \
- inline void swap(_Rope_char_ref_proxy <_CharT, __Alloc > __a, \
- _Rope_char_ref_proxy <_CharT, __Alloc > __b) { \
- _CharT __tmp = __a; \
- __a = __b; \
- __b = __tmp; \
- }
-
-_ROPE_SWAP_SPECIALIZATION(char,__STL_DEFAULT_ALLOCATOR(char))
-
-#endif /* !__STL_FUNCTION_TMPL_PARTIAL_ORDER */
-
-template<class _CharT, class _Alloc>
-class _Rope_char_ptr_proxy {
- // XXX this class should be rewritten.
- friend class _Rope_char_ref_proxy<_CharT,_Alloc>;
- size_t _M_pos;
- rope<_CharT,_Alloc>* _M_root; // The whole rope.
- public:
- _Rope_char_ptr_proxy(const _Rope_char_ref_proxy<_CharT,_Alloc>& __x)
- : _M_pos(__x._M_pos), _M_root(__x._M_root) {}
- _Rope_char_ptr_proxy(const _Rope_char_ptr_proxy& __x)
- : _M_pos(__x._M_pos), _M_root(__x._M_root) {}
- _Rope_char_ptr_proxy() {}
- _Rope_char_ptr_proxy(_CharT* __x) : _M_root(0), _M_pos(0) {
- __stl_assert(0 == __x);
- }
- _Rope_char_ptr_proxy&
- operator= (const _Rope_char_ptr_proxy& __x) {
- _M_pos = __x._M_pos;
- _M_root = __x._M_root;
- return *this;
- }
- friend bool operator== __STL_NULL_TMPL_ARGS
- (const _Rope_char_ptr_proxy<_CharT,_Alloc>& __x,
- const _Rope_char_ptr_proxy<_CharT,_Alloc>& __y);
-
- _Rope_char_ref_proxy<_CharT,_Alloc> operator*() const {
- return _Rope_char_ref_proxy<_CharT,_Alloc>(_M_root, _M_pos);
- }
-};
-
-
-// Rope iterators:
-// Unlike in the C version, we cache only part of the stack
-// for rope iterators, since they must be efficiently copyable.
-// When we run out of cache, we have to reconstruct the iterator
-// value.
-// Pointers from iterators are not included in reference counts.
-// Iterators are assumed to be thread private. Ropes can
-// be shared.
-
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma set woff 1375
-#endif
-
-template<class _CharT, class _Alloc>
-class _Rope_iterator_base
- : public random_access_iterator<_CharT, ptrdiff_t> {
- friend class rope<_CharT,_Alloc>;
- public:
- typedef _Rope_RopeRep<_CharT,_Alloc> _RopeRep;
- // Borland doesnt want this to be protected.
- protected:
- enum { _S_path_cache_len = 4 }; // Must be <= 9.
- enum { _S_iterator_buf_len = 15 };
- size_t _M_current_pos;
- _RopeRep* _M_root; // The whole rope.
- size_t _M_leaf_pos; // Starting position for current leaf
- __GC_CONST _CharT* _M_buf_start;
- // Buffer possibly
- // containing current char.
- __GC_CONST _CharT* _M_buf_ptr;
- // Pointer to current char in buffer.
- // != 0 ==> buffer valid.
- __GC_CONST _CharT* _M_buf_end;
- // One past __last valid char in buffer.
- // What follows is the path cache. We go out of our
- // way to make this compact.
- // Path_end contains the bottom section of the path from
- // the root to the current leaf.
- const _RopeRep* _M_path_end[_S_path_cache_len];
- int _M_leaf_index; // Last valid __pos in path_end;
- // _M_path_end[0] ... _M_path_end[leaf_index-1]
- // point to concatenation nodes.
- unsigned char _M_path_directions;
- // (path_directions >> __i) & 1 is 1
- // iff we got from _M_path_end[leaf_index - __i - 1]
- // to _M_path_end[leaf_index - __i] by going to the
- // __right. Assumes path_cache_len <= 9.
- _CharT _M_tmp_buf[_S_iterator_buf_len];
- // Short buffer for surrounding chars.
- // This is useful primarily for
- // RopeFunctions. We put the buffer
- // here to avoid locking in the
- // multithreaded case.
- // The cached path is generally assumed to be valid
- // only if the buffer is valid.
- static void _S_setbuf(_Rope_iterator_base& __x);
- // Set buffer contents given
- // path cache.
- static void _S_setcache(_Rope_iterator_base& __x);
- // Set buffer contents and
- // path cache.
- static void _S_setcache_for_incr(_Rope_iterator_base& __x);
- // As above, but assumes path
- // cache is valid for previous posn.
- _Rope_iterator_base() {}
- _Rope_iterator_base(_RopeRep* __root, size_t __pos)
- : _M_root(__root), _M_current_pos(__pos), _M_buf_ptr(0) {}
- void _M_incr(size_t __n);
- void _M_decr(size_t __n);
- public:
- size_t index() const { return _M_current_pos; }
- _Rope_iterator_base(const _Rope_iterator_base& __x) {
- if (0 != __x._M_buf_ptr) {
- *this = __x;
- } else {
- _M_current_pos = __x._M_current_pos;
- _M_root = __x._M_root;
- _M_buf_ptr = 0;
- }
- }
-};
-
-template<class _CharT, class _Alloc> class _Rope_iterator;
-
-template<class _CharT, class _Alloc>
-class _Rope_const_iterator : public _Rope_iterator_base<_CharT,_Alloc> {
- friend class rope<_CharT,_Alloc>;
- protected:
- _Rope_const_iterator(const _RopeRep* __root, size_t __pos):
- _Rope_iterator_base<_CharT,_Alloc>(
- const_cast<_RopeRep*>(__root), __pos)
- // Only nonconst iterators modify root ref count
- {}
- public:
- typedef _CharT reference; // Really a value. Returning a reference
- // Would be a mess, since it would have
- // to be included in refcount.
- typedef const _CharT* pointer;
-
- public:
- _Rope_const_iterator() {};
- _Rope_const_iterator(const _Rope_const_iterator& __x) :
- _Rope_iterator_base<_CharT,_Alloc>(__x) { }
- _Rope_const_iterator(const _Rope_iterator<_CharT,_Alloc>& __x);
- _Rope_const_iterator(const rope<_CharT,_Alloc>& __r, size_t __pos) :
- _Rope_iterator_base<_CharT,_Alloc>(__r._M_tree_ptr, __pos) {}
- _Rope_const_iterator& operator= (const _Rope_const_iterator& __x) {
- if (0 != __x._M_buf_ptr) {
- *(static_cast<_Rope_iterator_base<_CharT,_Alloc>*>(this)) = __x;
- } else {
- _M_current_pos = __x._M_current_pos;
- _M_root = __x._M_root;
- _M_buf_ptr = 0;
- }
- return(*this);
- }
- reference operator*() {
- if (0 == _M_buf_ptr) _S_setcache(*this);
- return *_M_buf_ptr;
- }
- _Rope_const_iterator& operator++() {
- __GC_CONST _CharT* __next;
- if (0 != _M_buf_ptr && (__next = _M_buf_ptr + 1) < _M_buf_end) {
- _M_buf_ptr = __next;
- ++_M_current_pos;
- } else {
- _M_incr(1);
- }
- return *this;
- }
- _Rope_const_iterator& operator+=(ptrdiff_t __n) {
- if (__n >= 0) {
- _M_incr(__n);
- } else {
- _M_decr(-__n);
- }
- return *this;
- }
- _Rope_const_iterator& operator--() {
- _M_decr(1);
- return *this;
- }
- _Rope_const_iterator& operator-=(ptrdiff_t __n) {
- if (__n >= 0) {
- _M_decr(__n);
- } else {
- _M_incr(-__n);
- }
- return *this;
- }
- _Rope_const_iterator operator++(int) {
- size_t __old_pos = _M_current_pos;
- _M_incr(1);
- return _Rope_const_iterator<_CharT,_Alloc>(_M_root, __old_pos);
- // This makes a subsequent dereference expensive.
- // Perhaps we should instead copy the iterator
- // if it has a valid cache?
- }
- _Rope_const_iterator operator--(int) {
- size_t __old_pos = _M_current_pos;
- _M_decr(1);
- return _Rope_const_iterator<_CharT,_Alloc>(_M_root, __old_pos);
- }
- friend _Rope_const_iterator<_CharT,_Alloc> operator- __STL_NULL_TMPL_ARGS
- (const _Rope_const_iterator<_CharT,_Alloc>& __x,
- ptrdiff_t __n);
- friend _Rope_const_iterator<_CharT,_Alloc> operator+ __STL_NULL_TMPL_ARGS
- (const _Rope_const_iterator<_CharT,_Alloc>& __x,
- ptrdiff_t __n);
- friend _Rope_const_iterator<_CharT,_Alloc> operator+ __STL_NULL_TMPL_ARGS
- (ptrdiff_t __n,
- const _Rope_const_iterator<_CharT,_Alloc>& __x);
- reference operator[](size_t __n) {
- return rope<_CharT,_Alloc>::_S_fetch(_M_root, _M_current_pos + __n);
- }
- friend bool operator== __STL_NULL_TMPL_ARGS
- (const _Rope_const_iterator<_CharT,_Alloc>& __x,
- const _Rope_const_iterator<_CharT,_Alloc>& __y);
- friend bool operator< __STL_NULL_TMPL_ARGS
- (const _Rope_const_iterator<_CharT,_Alloc>& __x,
- const _Rope_const_iterator<_CharT,_Alloc>& __y);
- friend ptrdiff_t operator- __STL_NULL_TMPL_ARGS
- (const _Rope_const_iterator<_CharT,_Alloc>& __x,
- const _Rope_const_iterator<_CharT,_Alloc>& __y);
-};
-
-template<class _CharT, class _Alloc>
-class _Rope_iterator : public _Rope_iterator_base<_CharT,_Alloc> {
- friend class rope<_CharT,_Alloc>;
- protected:
- rope<_CharT,_Alloc>* _M_root_rope;
- // root is treated as a cached version of this,
- // and is used to detect changes to the underlying
- // rope.
- // Root is included in the reference count.
- // This is necessary so that we can detect changes reliably.
- // Unfortunately, it requires careful bookkeeping for the
- // nonGC case.
- _Rope_iterator(rope<_CharT,_Alloc>* __r, size_t __pos)
- : _Rope_iterator_base<_CharT,_Alloc>(__r->_M_tree_ptr, __pos),
- _M_root_rope(__r)
- { _RopeRep::_S_ref(_M_root); }
-
- void _M_check();
- public:
- typedef _Rope_char_ref_proxy<_CharT,_Alloc> reference;
- typedef _Rope_char_ref_proxy<_CharT,_Alloc>* pointer;
-
- public:
- rope<_CharT,_Alloc>& container() { return *_M_root_rope; }
- _Rope_iterator() {
- _M_root = 0; // Needed for reference counting.
- };
- _Rope_iterator(const _Rope_iterator& __x) :
- _Rope_iterator_base<_CharT,_Alloc>(__x) {
- _M_root_rope = __x._M_root_rope;
- _RopeRep::_S_ref(_M_root);
- }
- _Rope_iterator(rope<_CharT,_Alloc>& __r, size_t __pos);
- ~_Rope_iterator() {
- _RopeRep::_S_unref(_M_root);
- }
- _Rope_iterator& operator= (const _Rope_iterator& __x) {
- _RopeRep* __old = _M_root;
-
- _RopeRep::_S_ref(__x._M_root);
- if (0 != __x._M_buf_ptr) {
- _M_root_rope = __x._M_root_rope;
- *(static_cast<_Rope_iterator_base<_CharT,_Alloc>*>(this)) = __x;
- } else {
- _M_current_pos = __x._M_current_pos;
- _M_root = __x._M_root;
- _M_root_rope = __x._M_root_rope;
- _M_buf_ptr = 0;
- }
- _RopeRep::_S_unref(__old);
- return(*this);
- }
- reference operator*() {
- _M_check();
- if (0 == _M_buf_ptr) {
- return _Rope_char_ref_proxy<_CharT,_Alloc>(
- _M_root_rope, _M_current_pos);
- } else {
- return _Rope_char_ref_proxy<_CharT,_Alloc>(
- _M_root_rope, _M_current_pos, *_M_buf_ptr);
- }
- }
- _Rope_iterator& operator++() {
- _M_incr(1);
- return *this;
- }
- _Rope_iterator& operator+=(difference_type __n) {
- if (__n >= 0) {
- _M_incr(__n);
- } else {
- _M_decr(-__n);
- }
- return *this;
- }
- _Rope_iterator& operator--() {
- _M_decr(1);
- return *this;
- }
- _Rope_iterator& operator-=(difference_type __n) {
- if (__n >= 0) {
- _M_decr(__n);
- } else {
- _M_incr(-__n);
- }
- return *this;
- }
- _Rope_iterator operator++(int) {
- size_t __old_pos = _M_current_pos;
- _M_incr(1);
- return _Rope_iterator<_CharT,_Alloc>(_M_root_rope, __old_pos);
- }
- _Rope_iterator operator--(int) {
- size_t __old_pos = _M_current_pos;
- _M_decr(1);
- return _Rope_iterator<_CharT,_Alloc>(_M_root_rope, __old_pos);
- }
- reference operator[](ptrdiff_t __n) {
- return _Rope_char_ref_proxy<_CharT,_Alloc>(
- _M_root_rope, _M_current_pos + __n);
- }
- friend bool operator== __STL_NULL_TMPL_ARGS
- (const _Rope_iterator<_CharT,_Alloc>& __x,
- const _Rope_iterator<_CharT,_Alloc>& __y);
- friend bool operator< __STL_NULL_TMPL_ARGS
- (const _Rope_iterator<_CharT,_Alloc>& __x,
- const _Rope_iterator<_CharT,_Alloc>& __y);
- friend ptrdiff_t operator- __STL_NULL_TMPL_ARGS
- (const _Rope_iterator<_CharT,_Alloc>& __x,
- const _Rope_iterator<_CharT,_Alloc>& __y);
- friend _Rope_iterator<_CharT,_Alloc> operator- __STL_NULL_TMPL_ARGS
- (const _Rope_iterator<_CharT,_Alloc>& __x,
- ptrdiff_t __n);
- friend _Rope_iterator<_CharT,_Alloc> operator+ __STL_NULL_TMPL_ARGS
- (const _Rope_iterator<_CharT,_Alloc>& __x,
- ptrdiff_t __n);
- friend _Rope_iterator<_CharT,_Alloc> operator+ __STL_NULL_TMPL_ARGS
- (ptrdiff_t __n,
- const _Rope_iterator<_CharT,_Alloc>& __x);
-
-};
-
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma reset woff 1375
-#endif
-
-// The rope base class encapsulates
-// the differences between SGI-style allocators and standard-conforming
-// allocators.
-
-#ifdef __STL_USE_STD_ALLOCATORS
-
-// Base class for ordinary allocators.
-template <class _CharT, class _Allocator, bool _IsStatic>
-class _Rope_alloc_base {
-public:
- typedef _Rope_RopeRep<_CharT,_Allocator> _RopeRep;
- typedef typename _Alloc_traits<_CharT,_Allocator>::allocator_type
- allocator_type;
- allocator_type get_allocator() const { return _M_data_allocator; }
- _Rope_alloc_base(_RopeRep *__t, const allocator_type& __a)
- : _M_tree_ptr(__t), _M_data_allocator(__a) {}
- _Rope_alloc_base(const allocator_type& __a)
- : _M_data_allocator(__a) {}
-
-protected:
- // The only data members of a rope:
- allocator_type _M_data_allocator;
- _RopeRep* _M_tree_ptr;
-
-# define __ROPE_DEFINE_ALLOC(_Tp, __name) \
- typedef typename \
- _Alloc_traits<_Tp,_Allocator>::allocator_type __name##Allocator; \
- _Tp* __name##_allocate(size_t __n) const \
- { return __name##Allocator(_M_data_allocator).allocate(__n); } \
- void __name##_deallocate(_Tp *__p, size_t __n) const \
- { __name##Allocator(_M_data_allocator).deallocate(__p, __n); }
- __ROPE_DEFINE_ALLOCS(_Allocator)
-# undef __ROPE_DEFINE_ALLOC
-};
-
-// Specialization for allocators that have the property that we don't
-// actually have to store an allocator object.
-template <class _CharT, class _Allocator>
-class _Rope_alloc_base<_CharT,_Allocator,true> {
-public:
- typedef _Rope_RopeRep<_CharT,_Allocator> _RopeRep;
- typedef typename _Alloc_traits<_CharT,_Allocator>::allocator_type
- allocator_type;
- allocator_type get_allocator() const { return allocator_type(); }
- _Rope_alloc_base(_RopeRep *__t, const allocator_type&)
- : _M_tree_ptr(__t) {}
- _Rope_alloc_base(const allocator_type&) {}
-
-protected:
- // The only data member of a rope:
- _RopeRep *_M_tree_ptr;
-
-# define __ROPE_DEFINE_ALLOC(_Tp, __name) \
- typedef typename \
- _Alloc_traits<_Tp,_Allocator>::_Alloc_type __name##Alloc; \
- typedef typename \
- _Alloc_traits<_Tp,_Allocator>::allocator_type __name##Allocator; \
- static _Tp* __name##_allocate(size_t __n) \
- { return __name##Alloc::allocate(__n); } \
- static void __name##_deallocate(_Tp *__p, size_t __n) \
- { __name##Alloc::deallocate(__p, __n); }
- __ROPE_DEFINE_ALLOCS(_Allocator)
-# undef __ROPE_DEFINE_ALLOC
-};
-
-template <class _CharT, class _Alloc>
-struct _Rope_base
- : public _Rope_alloc_base<_CharT,_Alloc,
- _Alloc_traits<_CharT,_Alloc>::_S_instanceless>
-{
- typedef _Rope_alloc_base<_CharT,_Alloc,
- _Alloc_traits<_CharT,_Alloc>::_S_instanceless>
- _Base;
- typedef typename _Base::allocator_type allocator_type;
- _Rope_base(_RopeRep* __t, const allocator_type& __a) : _Base(__t, __a) {}
- _Rope_base(const allocator_type& __a) : _Base(__a) {}
-};
-
-#else /* !__STL_USE_STD_ALLOCATORS */
-
-template <class _CharT, class _Alloc>
-class _Rope_base {
-public:
- typedef _Rope_RopeRep<_CharT, _Alloc> _RopeRep;
- typedef _Alloc allocator_type;
- static allocator_type get_allocator() { return allocator_type(); }
- _Rope_base(_RopeRep * __t, const allocator_type&) : _M_tree_ptr(__t) {}
- _Rope_base(const allocator_type&) {}
-
-protected:
- // The only data member of a rope:
- _RopeRep* _M_tree_ptr;
-
-# define __ROPE_DEFINE_ALLOC(_Tp, __name) \
- typedef simple_alloc<_Tp, _Alloc> __name##Alloc; \
- static _Tp* __name##_allocate(size_t __n) \
- { return __name##Alloc::allocate(__n); } \
- static void __name##_deallocate(_Tp *__p, size_t __n) \
- { __name##Alloc::deallocate(__p, __n); }
- __ROPE_DEFINE_ALLOCS(_Alloc)
-# undef __ROPE_DEFINE_ALLOC
-};
-
-#endif /* __STL_USE_STD_ALLOCATORS */
-
-
-template <class _CharT, class _Alloc>
-class rope : public _Rope_base<_CharT,_Alloc> {
- public:
- typedef _CharT value_type;
- typedef ptrdiff_t difference_type;
- typedef size_t size_type;
- typedef _CharT const_reference;
- typedef const _CharT* const_pointer;
- typedef _Rope_iterator<_CharT,_Alloc> iterator;
- typedef _Rope_const_iterator<_CharT,_Alloc> const_iterator;
- typedef _Rope_char_ref_proxy<_CharT,_Alloc> reference;
- typedef _Rope_char_ptr_proxy<_CharT,_Alloc> pointer;
-
- friend class _Rope_iterator<_CharT,_Alloc>;
- friend class _Rope_const_iterator<_CharT,_Alloc>;
- friend struct _Rope_RopeRep<_CharT,_Alloc>;
- friend class _Rope_iterator_base<_CharT,_Alloc>;
- friend class _Rope_char_ptr_proxy<_CharT,_Alloc>;
- friend class _Rope_char_ref_proxy<_CharT,_Alloc>;
- friend struct _Rope_RopeSubstring<_CharT,_Alloc>;
-
- protected:
- typedef _Rope_base<_CharT,_Alloc> _Base;
- typedef typename _Base::allocator_type allocator_type;
-# ifdef __STL_USE_NAMESPACES
- using _Base::_M_tree_ptr;
-# endif
- typedef __GC_CONST _CharT* _Cstrptr;
-# ifdef __STL_SGI_THREADS
- static _Cstrptr _S_atomic_swap(_Cstrptr* __p, _Cstrptr __q) {
-# if __mips < 3 || !(defined (_ABIN32) || defined(_ABI64))
- return (_Cstrptr) test_and_set((unsigned long*)__p,
- (unsigned long)__q);
-# else
- return (_Cstrptr) __test_and_set((unsigned long*)__p,
- (unsigned long)__q);
-# endif
- }
-# elif defined(__STL_WIN32THREADS)
- static _Cstrptr _S_atomic_swap(_Cstrptr* __p, _Cstrptr __q) {
- return (_Cstrptr) InterlockedExchange(
- (LPLONG)__p, (LONG)__q);
- }
-# elif defined(__STL_PTHREADS)
- // This should be portable, but performance is expected
- // to be quite awful. This really needs platform specific
- // code.
- static pthread_mutex_t _S_swap_lock;
- static _Cstrptr _S_atomic_swap(_Cstrptr* __p, _Cstrptr __q) {
- pthread_mutex_lock(&_S_swap_lock);
- _Cstrptr __result = *__p;
- *__p = __q;
- pthread_mutex_unlock(&_S_swap_lock);
- return __result;
- }
-# else
- static _Cstrptr _S_atomic_swap(_Cstrptr* __p, _Cstrptr __q) {
- _Cstrptr __result = *__p;
- *__p = __q;
- return __result;
- }
-# endif
-
- static _CharT _S_empty_c_str[1];
-
- static bool _S_is0(_CharT __c) { return __c == _S_eos((_CharT*)0); }
- enum { _S_copy_max = 23 };
- // For strings shorter than _S_copy_max, we copy to
- // concatenate.
-
- typedef _Rope_RopeRep<_CharT,_Alloc> _RopeRep;
- typedef _Rope_RopeConcatenation<_CharT,_Alloc> _RopeConcatenation;
- typedef _Rope_RopeLeaf<_CharT,_Alloc> _RopeLeaf;
- typedef _Rope_RopeFunction<_CharT,_Alloc> _RopeFunction;
- typedef _Rope_RopeSubstring<_CharT,_Alloc> _RopeSubstring;
-
- // Retrieve a character at the indicated position.
- static _CharT _S_fetch(_RopeRep* __r, size_type __pos);
-
-# ifndef __GC
- // Obtain a pointer to the character at the indicated position.
- // The pointer can be used to change the character.
- // If such a pointer cannot be produced, as is frequently the
- // case, 0 is returned instead.
- // (Returns nonzero only if all nodes in the path have a refcount
- // of 1.)
- static _CharT* _S_fetch_ptr(_RopeRep* __r, size_type __pos);
-# endif
-
- static bool _S_apply_to_pieces(
- // should be template parameter
- _Rope_char_consumer<_CharT>& __c,
- const _RopeRep* __r,
- size_t __begin, size_t __end);
- // begin and end are assumed to be in range.
-
-# ifndef __GC
- static void _S_unref(_RopeRep* __t)
- {
- _RopeRep::_S_unref(__t);
- }
- static void _S_ref(_RopeRep* __t)
- {
- _RopeRep::_S_ref(__t);
- }
-# else /* __GC */
- static void _S_unref(_RopeRep*) {}
- static void _S_ref(_RopeRep*) {}
-# endif
-
-
-# ifdef __GC
- typedef _Rope_RopeRep<_CharT,_Alloc>* _Self_destruct_ptr;
-# else
- typedef _Rope_self_destruct_ptr<_CharT,_Alloc> _Self_destruct_ptr;
-# endif
-
- // _Result is counted in refcount.
- static _RopeRep* _S_substring(_RopeRep* __base,
- size_t __start, size_t __endp1);
-
- static _RopeRep* _S_concat_char_iter(_RopeRep* __r,
- const _CharT* __iter, size_t __slen);
- // Concatenate rope and char ptr, copying __s.
- // Should really take an arbitrary iterator.
- // Result is counted in refcount.
- static _RopeRep* _S_destr_concat_char_iter(_RopeRep* __r,
- const _CharT* __iter, size_t __slen)
- // As above, but one reference to __r is about to be
- // destroyed. Thus the pieces may be recycled if all
- // relevent reference counts are 1.
-# ifdef __GC
- // We can't really do anything since refcounts are unavailable.
- { return _S_concat_char_iter(__r, __iter, __slen); }
-# else
- ;
-# endif
-
- static _RopeRep* _S_concat(_RopeRep* __left, _RopeRep* __right);
- // General concatenation on _RopeRep. _Result
- // has refcount of 1. Adjusts argument refcounts.
-
- public:
- void apply_to_pieces( size_t __begin, size_t __end,
- _Rope_char_consumer<_CharT>& __c) const {
- _S_apply_to_pieces(__c, _M_tree_ptr, __begin, __end);
- }
-
-
- protected:
-
- static size_t _S_rounded_up_size(size_t __n) {
- return _RopeLeaf::_S_rounded_up_size(__n);
- }
-
- static size_t _S_allocated_capacity(size_t __n) {
- if (_S_is_basic_char_type((_CharT*)0)) {
- return _S_rounded_up_size(__n) - 1;
- } else {
- return _S_rounded_up_size(__n);
- }
- }
-
- // Allocate and construct a RopeLeaf using the supplied allocator
- // Takes ownership of s instead of copying.
- static _RopeLeaf* _S_new_RopeLeaf(__GC_CONST _CharT *__s,
- size_t __size, allocator_type __a)
- {
-# ifdef __STL_USE_STD_ALLOCATORS
- _RopeLeaf* __space = _LAllocator(__a).allocate(1);
-# else
- _RopeLeaf* __space = _L_allocate(1);
-# endif
- return new(__space) _RopeLeaf(__s, __size, __a);
- }
-
- static _RopeConcatenation* _S_new_RopeConcatenation(
- _RopeRep* __left, _RopeRep* __right,
- allocator_type __a)
- {
-# ifdef __STL_USE_STD_ALLOCATORS
- _RopeConcatenation* __space = _CAllocator(__a).allocate(1);
-# else
- _RopeConcatenation* __space = _C_allocate(1);
-# endif
- return new(__space) _RopeConcatenation(__left, __right, __a);
- }
-
- static _RopeFunction* _S_new_RopeFunction(char_producer<_CharT>* __f,
- size_t __size, bool __d, allocator_type __a)
- {
-# ifdef __STL_USE_STD_ALLOCATORS
- _RopeFunction* __space = _FAllocator(__a).allocate(1);
-# else
- _RopeFunction* __space = _F_allocate(1);
-# endif
- return new(__space) _RopeFunction(__f, __size, __d, __a);
- }
-
- static _RopeSubstring* _S_new_RopeSubstring(
- _Rope_RopeRep<_CharT,_Alloc>* __b, size_t __s,
- size_t __l, allocator_type __a)
- {
-# ifdef __STL_USE_STD_ALLOCATORS
- _RopeSubstring* __space = _SAllocator(__a).allocate(1);
-# else
- _RopeSubstring* __space = _S_allocate(1);
-# endif
- return new(__space) _RopeSubstring(__b, __s, __l, __a);
- }
-
-# ifdef __STL_USE_STD_ALLOCATORS
- static
- _RopeLeaf* _S_RopeLeaf_from_unowned_char_ptr(const _CharT *__s,
- size_t __size, allocator_type __a)
-# define __STL_ROPE_FROM_UNOWNED_CHAR_PTR(__s, __size, __a) \
- _S_RopeLeaf_from_unowned_char_ptr(__s, __size, __a)
-# else
- static
- _RopeLeaf* _S_RopeLeaf_from_unowned_char_ptr2(const _CharT* __s,
- size_t __size)
-# define __STL_ROPE_FROM_UNOWNED_CHAR_PTR(__s, __size, __a) \
- _S_RopeLeaf_from_unowned_char_ptr2(__s, __size)
-# endif
- {
- if (0 == __size) return 0;
-# ifdef __STL_USE_STD_ALLOCATORS
- _CharT* __buf = __a.allocate(_S_rounded_up_size(__size));
-# else
- _CharT* __buf = _Data_allocate(_S_rounded_up_size(__size));
- allocator_type __a = allocator_type();
-# endif
-
- uninitialized_copy_n(__s, __size, __buf);
- _S_cond_store_eos(__buf[__size]);
- __STL_TRY {
- return _S_new_RopeLeaf(__buf, __size, __a);
- }
- __STL_UNWIND(_RopeRep::__STL_FREE_STRING(__buf, __size, __a))
- }
-
-
- // Concatenation of nonempty strings.
- // Always builds a concatenation node.
- // Rebalances if the result is too deep.
- // Result has refcount 1.
- // Does not increment left and right ref counts even though
- // they are referenced.
- static _RopeRep*
- _S_tree_concat(_RopeRep* __left, _RopeRep* __right);
-
- // Concatenation helper functions
- static _RopeLeaf*
- _S_leaf_concat_char_iter(_RopeLeaf* __r,
- const _CharT* __iter, size_t __slen);
- // Concatenate by copying leaf.
- // should take an arbitrary iterator
- // result has refcount 1.
-# ifndef __GC
- static _RopeLeaf* _S_destr_leaf_concat_char_iter
- (_RopeLeaf* __r, const _CharT* __iter, size_t __slen);
- // A version that potentially clobbers __r if __r->_M_refcount == 1.
-# endif
-
- // A helper function for exponentiating strings.
- // This uses a nonstandard refcount convention.
- // The result has refcount 0.
- struct _Concat_fn
- : public binary_function<rope<_CharT,_Alloc>,
- rope<_CharT,_Alloc>,
- rope<_CharT,_Alloc> > {
- rope operator() (const rope& __x, const rope& __y) {
- return __x + __y;
- }
- };
-
- // Needed by the call to "power" used to build ropes
- // consisting of n copies of a character.
- friend rope identity_element(_Concat_fn)
- { return rope<_CharT,_Alloc>(); }
-
- static size_t _S_char_ptr_len(const _CharT* __s);
- // slightly generalized strlen
-
- rope(_RopeRep* __t, const allocator_type& __a = allocator_type())
- : _Base(__t,__a) { }
-
-
- // Copy __r to the _CharT buffer.
- // Returns __buffer + __r->_M_size.
- // Assumes that buffer is uninitialized.
- static _CharT* _S_flatten(_RopeRep* __r, _CharT* __buffer);
-
- // Again, with explicit starting position and length.
- // Assumes that buffer is uninitialized.
- static _CharT* _S_flatten(_RopeRep* __r,
- size_t __start, size_t __len,
- _CharT* __buffer);
-
- static const unsigned long
- _S_min_len[_RopeRep::_S_max_rope_depth + 1];
-
- static bool _S_is_balanced(_RopeRep* __r)
- { return (__r->_M_size >= _S_min_len[__r->_M_depth]); }
-
- static bool _S_is_almost_balanced(_RopeRep* __r)
- { return (__r->_M_depth == 0 ||
- __r->_M_size >= _S_min_len[__r->_M_depth - 1]); }
-
- static bool _S_is_roughly_balanced(_RopeRep* __r)
- { return (__r->_M_depth <= 1 ||
- __r->_M_size >= _S_min_len[__r->_M_depth - 2]); }
-
- // Assumes the result is not empty.
- static _RopeRep* _S_concat_and_set_balanced(_RopeRep* __left,
- _RopeRep* __right)
- {
- _RopeRep* __result = _S_concat(__left, __right);
- if (_S_is_balanced(__result)) __result->_M_is_balanced = true;
- return __result;
- }
-
- // The basic rebalancing operation. Logically copies the
- // rope. The result has refcount of 1. The client will
- // usually decrement the reference count of __r.
- // The result is within height 2 of balanced by the above
- // definition.
- static _RopeRep* _S_balance(_RopeRep* __r);
-
- // Add all unbalanced subtrees to the forest of balanceed trees.
- // Used only by balance.
- static void _S_add_to_forest(_RopeRep*__r, _RopeRep** __forest);
-
- // Add __r to forest, assuming __r is already balanced.
- static void _S_add_leaf_to_forest(_RopeRep* __r, _RopeRep** __forest);
-
- // Print to stdout, exposing structure
- static void _S_dump(_RopeRep* __r, int __indent = 0);
-
- // Return -1, 0, or 1 if __x < __y, __x == __y, or __x > __y resp.
- static int _S_compare(const _RopeRep* __x, const _RopeRep* __y);
-
- public:
- bool empty() const { return 0 == _M_tree_ptr; }
-
- // Comparison member function. This is public only for those
- // clients that need a ternary comparison. Others
- // should use the comparison operators below.
- int compare(const rope& __y) const {
- return _S_compare(_M_tree_ptr, __y._M_tree_ptr);
- }
-
- rope(const _CharT* __s, const allocator_type& __a = allocator_type())
- : _Base(__STL_ROPE_FROM_UNOWNED_CHAR_PTR(__s, _S_char_ptr_len(__s),
- __a),__a)
- { }
-
- rope(const _CharT* __s, size_t __len,
- const allocator_type& __a = allocator_type())
- : _Base(__STL_ROPE_FROM_UNOWNED_CHAR_PTR(__s, __len, __a), __a)
- { }
-
- // Should perhaps be templatized with respect to the iterator type
- // and use Sequence_buffer. (It should perhaps use sequence_buffer
- // even now.)
- rope(const _CharT *__s, const _CharT *__e,
- const allocator_type& __a = allocator_type())
- : _Base(__STL_ROPE_FROM_UNOWNED_CHAR_PTR(__s, __e - __s, __a), __a)
- { }
-
- rope(const const_iterator& __s, const const_iterator& __e,
- const allocator_type& __a = allocator_type())
- : _Base(_S_substring(__s._M_root, __s._M_current_pos,
- __e._M_current_pos), __a)
- { }
-
- rope(const iterator& __s, const iterator& __e,
- const allocator_type& __a = allocator_type())
- : _Base(_S_substring(__s._M_root, __s._M_current_pos,
- __e._M_current_pos), __a)
- { }
-
- rope(_CharT __c, const allocator_type& __a = allocator_type())
- : _Base(__a)
- {
- _CharT* __buf = _Data_allocate(_S_rounded_up_size(1));
-
- construct(__buf, __c);
- __STL_TRY {
- _M_tree_ptr = _S_new_RopeLeaf(__buf, 1, __a);
- }
- __STL_UNWIND(_RopeRep::__STL_FREE_STRING(__buf, 1, __a))
- }
-
- rope(size_t __n, _CharT __c,
- const allocator_type& __a = allocator_type());
-
- rope(const allocator_type& __a = allocator_type())
- : _Base(0, __a) {}
-
- // Construct a rope from a function that can compute its members
- rope(char_producer<_CharT> *__fn, size_t __len, bool __delete_fn,
- const allocator_type& __a = allocator_type())
- : _Base(__a)
- {
- _M_tree_ptr = (0 == __len) ?
- 0 : _S_new_RopeFunction(__fn, __len, __delete_fn, __a);
- }
-
- rope(const rope& __x, const allocator_type& __a = allocator_type())
- : _Base(__x._M_tree_ptr, __a)
- {
- _S_ref(_M_tree_ptr);
- }
-
- ~rope()
- {
- _S_unref(_M_tree_ptr);
- }
-
- rope& operator=(const rope& __x)
- {
- _RopeRep* __old = _M_tree_ptr;
-# ifdef __STL_USE_STD_ALLOCATORS
- __stl_assert(get_allocator() == __x.get_allocator());
-# endif
- _M_tree_ptr = __x._M_tree_ptr;
- _S_ref(_M_tree_ptr);
- _S_unref(__old);
- return(*this);
- }
-
- void push_back(_CharT __x)
- {
- _RopeRep* __old = _M_tree_ptr;
- _M_tree_ptr = _S_concat_char_iter(_M_tree_ptr, &__x, 1);
- _S_unref(__old);
- }
-
- void pop_back()
- {
- _RopeRep* __old = _M_tree_ptr;
- _M_tree_ptr =
- _S_substring(_M_tree_ptr, 0, _M_tree_ptr->_M_size - 1);
- _S_unref(__old);
- }
-
- _CharT back() const
- {
- return _S_fetch(_M_tree_ptr, _M_tree_ptr->_M_size - 1);
- }
-
- void push_front(_CharT __x)
- {
- _RopeRep* __old = _M_tree_ptr;
- _RopeRep* __left =
- __STL_ROPE_FROM_UNOWNED_CHAR_PTR(&__x, 1, get_allocator());
- __STL_TRY {
- _M_tree_ptr = _S_concat(__left, _M_tree_ptr);
- _S_unref(__old);
- _S_unref(__left);
- }
- __STL_UNWIND(_S_unref(__left))
- }
-
- void pop_front()
- {
- _RopeRep* __old = _M_tree_ptr;
- _M_tree_ptr = _S_substring(_M_tree_ptr, 1, _M_tree_ptr->_M_size);
- _S_unref(__old);
- }
-
- _CharT front() const
- {
- return _S_fetch(_M_tree_ptr, 0);
- }
-
- void balance()
- {
- _RopeRep* __old = _M_tree_ptr;
- _M_tree_ptr = _S_balance(_M_tree_ptr);
- _S_unref(__old);
- }
-
- void copy(_CharT* __buffer) const {
- destroy(__buffer, __buffer + size());
- _S_flatten(_M_tree_ptr, __buffer);
- }
-
- // This is the copy function from the standard, but
- // with the arguments reordered to make it consistent with the
- // rest of the interface.
- // Note that this guaranteed not to compile if the draft standard
- // order is assumed.
- size_type copy(size_type __pos, size_type __n, _CharT* __buffer) const
- {
- size_t __size = size();
- size_t __len = (__pos + __n > __size? __size - __pos : __n);
-
- destroy(__buffer, __buffer + __len);
- _S_flatten(_M_tree_ptr, __pos, __len, __buffer);
- return __len;
- }
-
- // Print to stdout, exposing structure. May be useful for
- // performance debugging.
- void dump() {
- _S_dump(_M_tree_ptr);
- }
-
- // Convert to 0 terminated string in new allocated memory.
- // Embedded 0s in the input do not terminate the copy.
- const _CharT* c_str() const;
-
- // As above, but lso use the flattened representation as the
- // the new rope representation.
- const _CharT* replace_with_c_str();
-
- // Reclaim memory for the c_str generated flattened string.
- // Intentionally undocumented, since it's hard to say when this
- // is safe for multiple threads.
- void delete_c_str () {
- if (0 == _M_tree_ptr) return;
- if (_RopeRep::_S_leaf == _M_tree_ptr->_M_tag &&
- ((_RopeLeaf*)_M_tree_ptr)->_M_data ==
- _M_tree_ptr->_M_c_string) {
- // Representation shared
- return;
- }
-# ifndef __GC
- _M_tree_ptr->_M_free_c_string();
-# endif
- _M_tree_ptr->_M_c_string = 0;
- }
-
- _CharT operator[] (size_type __pos) const {
- return _S_fetch(_M_tree_ptr, __pos);
- }
-
- _CharT at(size_type __pos) const {
- // if (__pos >= size()) throw out_of_range; // XXX
- return (*this)[__pos];
- }
-
- const_iterator begin() const {
- return(const_iterator(_M_tree_ptr, 0));
- }
-
- // An easy way to get a const iterator from a non-const container.
- const_iterator const_begin() const {
- return(const_iterator(_M_tree_ptr, 0));
- }
-
- const_iterator end() const {
- return(const_iterator(_M_tree_ptr, size()));
- }
-
- const_iterator const_end() const {
- return(const_iterator(_M_tree_ptr, size()));
- }
-
- size_type size() const {
- return(0 == _M_tree_ptr? 0 : _M_tree_ptr->_M_size);
- }
-
- size_type length() const {
- return size();
- }
-
- size_type max_size() const {
- return _S_min_len[_RopeRep::_S_max_rope_depth-1] - 1;
- // Guarantees that the result can be sufficirntly
- // balanced. Longer ropes will probably still work,
- // but it's harder to make guarantees.
- }
-
-# ifdef __STL_CLASS_PARTIAL_SPECIALIZATION
- typedef reverse_iterator<const_iterator> const_reverse_iterator;
-# else /* __STL_CLASS_PARTIAL_SPECIALIZATION */
- typedef reverse_iterator<const_iterator, value_type, const_reference,
- difference_type> const_reverse_iterator;
-# endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
-
- const_reverse_iterator rbegin() const {
- return const_reverse_iterator(end());
- }
-
- const_reverse_iterator const_rbegin() const {
- return const_reverse_iterator(end());
- }
-
- const_reverse_iterator rend() const {
- return const_reverse_iterator(begin());
- }
-
- const_reverse_iterator const_rend() const {
- return const_reverse_iterator(begin());
- }
-
- friend rope<_CharT,_Alloc>
- operator+ __STL_NULL_TMPL_ARGS (const rope<_CharT,_Alloc>& __left,
- const rope<_CharT,_Alloc>& __right);
-
- friend rope<_CharT,_Alloc>
- operator+ __STL_NULL_TMPL_ARGS (const rope<_CharT,_Alloc>& __left,
- const _CharT* __right);
-
- friend rope<_CharT,_Alloc>
- operator+ __STL_NULL_TMPL_ARGS (const rope<_CharT,_Alloc>& __left,
- _CharT __right);
-
- // The symmetric cases are intentionally omitted, since they're presumed
- // to be less common, and we don't handle them as well.
-
- // The following should really be templatized.
- // The first argument should be an input iterator or
- // forward iterator with value_type _CharT.
- rope& append(const _CharT* __iter, size_t __n) {
- _RopeRep* __result =
- _S_destr_concat_char_iter(_M_tree_ptr, __iter, __n);
- _S_unref(_M_tree_ptr);
- _M_tree_ptr = __result;
- return *this;
- }
-
- rope& append(const _CharT* __c_string) {
- size_t __len = _S_char_ptr_len(__c_string);
- append(__c_string, __len);
- return(*this);
- }
-
- rope& append(const _CharT* __s, const _CharT* __e) {
- _RopeRep* __result =
- _S_destr_concat_char_iter(_M_tree_ptr, __s, __e - __s);
- _S_unref(_M_tree_ptr);
- _M_tree_ptr = __result;
- return *this;
- }
-
- rope& append(const_iterator __s, const_iterator __e) {
- __stl_assert(__s._M_root == __e._M_root);
-# ifdef __STL_USE_STD_ALLOCATORS
- __stl_assert(get_allocator() == __s._M_root->get_allocator());
-# endif
- _Self_destruct_ptr __appendee(_S_substring(
- __s._M_root, __s._M_current_pos, __e._M_current_pos));
- _RopeRep* __result =
- _S_concat(_M_tree_ptr, (_RopeRep*)__appendee);
- _S_unref(_M_tree_ptr);
- _M_tree_ptr = __result;
- return *this;
- }
-
- rope& append(_CharT __c) {
- _RopeRep* __result =
- _S_destr_concat_char_iter(_M_tree_ptr, &__c, 1);
- _S_unref(_M_tree_ptr);
- _M_tree_ptr = __result;
- return *this;
- }
-
- rope& append() { return append(_CharT()); } // XXX why?
-
- rope& append(const rope& __y) {
-# ifdef __STL_USE_STD_ALLOCATORS
- __stl_assert(__y.get_allocator() == get_allocator());
-# endif
- _RopeRep* __result = _S_concat(_M_tree_ptr, __y._M_tree_ptr);
- _S_unref(_M_tree_ptr);
- _M_tree_ptr = __result;
- return *this;
- }
-
- rope& append(size_t __n, _CharT __c) {
- rope<_CharT,_Alloc> __last(__n, __c);
- return append(__last);
- }
-
- void swap(rope& __b) {
-# ifdef __STL_USE_STD_ALLOCATORS
- __stl_assert(get_allocator() == __b.get_allocator());
-# endif
- _RopeRep* __tmp = _M_tree_ptr;
- _M_tree_ptr = __b._M_tree_ptr;
- __b._M_tree_ptr = __tmp;
- }
-
-
- protected:
- // Result is included in refcount.
- static _RopeRep* replace(_RopeRep* __old, size_t __pos1,
- size_t __pos2, _RopeRep* __r) {
- if (0 == __old) { _S_ref(__r); return __r; }
- _Self_destruct_ptr __left(
- _S_substring(__old, 0, __pos1));
- _Self_destruct_ptr __right(
- _S_substring(__old, __pos2, __old->_M_size));
- _RopeRep* __result;
-
-# ifdef __STL_USE_STD_ALLOCATORS
- __stl_assert(__old->get_allocator() == __r->get_allocator());
-# endif
- if (0 == __r) {
- __result = _S_concat(__left, __right);
- } else {
- _Self_destruct_ptr __left_result(_S_concat(__left, __r));
- __result = _S_concat(__left_result, __right);
- }
- return __result;
- }
-
- public:
- void insert(size_t __p, const rope& __r) {
- _RopeRep* __result =
- replace(_M_tree_ptr, __p, __p, __r._M_tree_ptr);
-# ifdef __STL_USE_STD_ALLOCATORS
- __stl_assert(get_allocator() == __r.get_allocator());
-# endif
- _S_unref(_M_tree_ptr);
- _M_tree_ptr = __result;
- }
-
- void insert(size_t __p, size_t __n, _CharT __c) {
- rope<_CharT,_Alloc> __r(__n,__c);
- insert(__p, __r);
- }
-
- void insert(size_t __p, const _CharT* __i, size_t __n) {
- _Self_destruct_ptr __left(_S_substring(_M_tree_ptr, 0, __p));
- _Self_destruct_ptr __right(_S_substring(_M_tree_ptr, __p, size()));
- _Self_destruct_ptr __left_result(
- _S_concat_char_iter(__left, __i, __n));
- _RopeRep* __result = _S_concat(__left_result, __right);
- _S_unref(_M_tree_ptr);
- _M_tree_ptr = __result;
- }
-
- void insert(size_t __p, const _CharT* __c_string) {
- insert(__p, __c_string, _S_char_ptr_len(__c_string));
- }
-
- void insert(size_t __p, _CharT __c) {
- insert(__p, &__c, 1);
- }
-
- void insert(size_t __p) {
- _CharT __c = _CharT();
- insert(__p, &__c, 1);
- }
-
- void insert(size_t __p, const _CharT* __i, const _CharT* __j) {
- rope __r(__i, __j);
- insert(__p, __r);
- }
-
- void insert(size_t __p, const const_iterator& __i,
- const const_iterator& __j) {
- rope __r(__i, __j);
- insert(__p, __r);
- }
-
- void insert(size_t __p, const iterator& __i,
- const iterator& __j) {
- rope __r(__i, __j);
- insert(__p, __r);
- }
-
- // (position, length) versions of replace operations:
-
- void replace(size_t __p, size_t __n, const rope& __r) {
- _RopeRep* __result =
- replace(_M_tree_ptr, __p, __p + __n, __r._M_tree_ptr);
- _S_unref(_M_tree_ptr);
- _M_tree_ptr = __result;
- }
-
- void replace(size_t __p, size_t __n,
- const _CharT* __i, size_t __i_len) {
- rope __r(__i, __i_len);
- replace(__p, __n, __r);
- }
-
- void replace(size_t __p, size_t __n, _CharT __c) {
- rope __r(__c);
- replace(__p, __n, __r);
- }
-
- void replace(size_t __p, size_t __n, const _CharT* __c_string) {
- rope __r(__c_string);
- replace(__p, __n, __r);
- }
-
- void replace(size_t __p, size_t __n,
- const _CharT* __i, const _CharT* __j) {
- rope __r(__i, __j);
- replace(__p, __n, __r);
- }
-
- void replace(size_t __p, size_t __n,
- const const_iterator& __i, const const_iterator& __j) {
- rope __r(__i, __j);
- replace(__p, __n, __r);
- }
-
- void replace(size_t __p, size_t __n,
- const iterator& __i, const iterator& __j) {
- rope __r(__i, __j);
- replace(__p, __n, __r);
- }
-
- // Single character variants:
- void replace(size_t __p, _CharT __c) {
- iterator __i(this, __p);
- *__i = __c;
- }
-
- void replace(size_t __p, const rope& __r) {
- replace(__p, 1, __r);
- }
-
- void replace(size_t __p, const _CharT* __i, size_t __i_len) {
- replace(__p, 1, __i, __i_len);
- }
-
- void replace(size_t __p, const _CharT* __c_string) {
- replace(__p, 1, __c_string);
- }
-
- void replace(size_t __p, const _CharT* __i, const _CharT* __j) {
- replace(__p, 1, __i, __j);
- }
-
- void replace(size_t __p, const const_iterator& __i,
- const const_iterator& __j) {
- replace(__p, 1, __i, __j);
- }
-
- void replace(size_t __p, const iterator& __i,
- const iterator& __j) {
- replace(__p, 1, __i, __j);
- }
-
- // Erase, (position, size) variant.
- void erase(size_t __p, size_t __n) {
- _RopeRep* __result = replace(_M_tree_ptr, __p, __p + __n, 0);
- _S_unref(_M_tree_ptr);
- _M_tree_ptr = __result;
- }
-
- // Erase, single character
- void erase(size_t __p) {
- erase(__p, __p + 1);
- }
-
- // Insert, iterator variants.
- iterator insert(const iterator& __p, const rope& __r)
- { insert(__p.index(), __r); return __p; }
- iterator insert(const iterator& __p, size_t __n, _CharT __c)
- { insert(__p.index(), __n, __c); return __p; }
- iterator insert(const iterator& __p, _CharT __c)
- { insert(__p.index(), __c); return __p; }
- iterator insert(const iterator& __p )
- { insert(__p.index()); return __p; }
- iterator insert(const iterator& __p, const _CharT* c_string)
- { insert(__p.index(), c_string); return __p; }
- iterator insert(const iterator& __p, const _CharT* __i, size_t __n)
- { insert(__p.index(), __i, __n); return __p; }
- iterator insert(const iterator& __p, const _CharT* __i,
- const _CharT* __j)
- { insert(__p.index(), __i, __j); return __p; }
- iterator insert(const iterator& __p,
- const const_iterator& __i, const const_iterator& __j)
- { insert(__p.index(), __i, __j); return __p; }
- iterator insert(const iterator& __p,
- const iterator& __i, const iterator& __j)
- { insert(__p.index(), __i, __j); return __p; }
-
- // Replace, range variants.
- void replace(const iterator& __p, const iterator& __q,
- const rope& __r)
- { replace(__p.index(), __q.index() - __p.index(), __r); }
- void replace(const iterator& __p, const iterator& __q, _CharT __c)
- { replace(__p.index(), __q.index() - __p.index(), __c); }
- void replace(const iterator& __p, const iterator& __q,
- const _CharT* __c_string)
- { replace(__p.index(), __q.index() - __p.index(), __c_string); }
- void replace(const iterator& __p, const iterator& __q,
- const _CharT* __i, size_t __n)
- { replace(__p.index(), __q.index() - __p.index(), __i, __n); }
- void replace(const iterator& __p, const iterator& __q,
- const _CharT* __i, const _CharT* __j)
- { replace(__p.index(), __q.index() - __p.index(), __i, __j); }
- void replace(const iterator& __p, const iterator& __q,
- const const_iterator& __i, const const_iterator& __j)
- { replace(__p.index(), __q.index() - __p.index(), __i, __j); }
- void replace(const iterator& __p, const iterator& __q,
- const iterator& __i, const iterator& __j)
- { replace(__p.index(), __q.index() - __p.index(), __i, __j); }
-
- // Replace, iterator variants.
- void replace(const iterator& __p, const rope& __r)
- { replace(__p.index(), __r); }
- void replace(const iterator& __p, _CharT __c)
- { replace(__p.index(), __c); }
- void replace(const iterator& __p, const _CharT* __c_string)
- { replace(__p.index(), __c_string); }
- void replace(const iterator& __p, const _CharT* __i, size_t __n)
- { replace(__p.index(), __i, __n); }
- void replace(const iterator& __p, const _CharT* __i, const _CharT* __j)
- { replace(__p.index(), __i, __j); }
- void replace(const iterator& __p, const_iterator __i,
- const_iterator __j)
- { replace(__p.index(), __i, __j); }
- void replace(const iterator& __p, iterator __i, iterator __j)
- { replace(__p.index(), __i, __j); }
-
- // Iterator and range variants of erase
- iterator erase(const iterator& __p, const iterator& __q) {
- size_t __p_index = __p.index();
- erase(__p_index, __q.index() - __p_index);
- return iterator(this, __p_index);
- }
- iterator erase(const iterator& __p) {
- size_t __p_index = __p.index();
- erase(__p_index, 1);
- return iterator(this, __p_index);
- }
-
- rope substr(size_t __start, size_t __len = 1) const {
- return rope<_CharT,_Alloc>(
- _S_substring(_M_tree_ptr, __start, __start + __len));
- }
-
- rope substr(iterator __start, iterator __end) const {
- return rope<_CharT,_Alloc>(
- _S_substring(_M_tree_ptr, __start.index(), __end.index()));
- }
-
- rope substr(iterator __start) const {
- size_t __pos = __start.index();
- return rope<_CharT,_Alloc>(
- _S_substring(_M_tree_ptr, __pos, __pos + 1));
- }
-
- rope substr(const_iterator __start, const_iterator __end) const {
- // This might eventually take advantage of the cache in the
- // iterator.
- return rope<_CharT,_Alloc>(
- _S_substring(_M_tree_ptr, __start.index(), __end.index()));
- }
-
- rope<_CharT,_Alloc> substr(const_iterator __start) {
- size_t __pos = __start.index();
- return rope<_CharT,_Alloc>(
- _S_substring(_M_tree_ptr, __pos, __pos + 1));
- }
-
- static const size_type npos;
-
- size_type find(_CharT __c, size_type __pos = 0) const;
- size_type find(_CharT* __s, size_type __pos = 0) const {
- size_type __result_pos;
- const_iterator __result = search(const_begin() + __pos, const_end(),
- __s, __s + _S_char_ptr_len(__s));
- __result_pos = __result.index();
-# ifndef __STL_OLD_ROPE_SEMANTICS
- if (__result_pos == size()) __result_pos = npos;
-# endif
- return __result_pos;
- }
-
- iterator mutable_begin() {
- return(iterator(this, 0));
- }
-
- iterator mutable_end() {
- return(iterator(this, size()));
- }
-
-# ifdef __STL_CLASS_PARTIAL_SPECIALIZATION
- typedef reverse_iterator<iterator> reverse_iterator;
-# else /* __STL_CLASS_PARTIAL_SPECIALIZATION */
- typedef reverse_iterator<iterator, value_type, reference,
- difference_type> reverse_iterator;
-# endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
-
- reverse_iterator mutable_rbegin() {
- return reverse_iterator(mutable_end());
- }
-
- reverse_iterator mutable_rend() {
- return reverse_iterator(mutable_begin());
- }
-
- reference mutable_reference_at(size_type __pos) {
- return reference(this, __pos);
- }
-
-# ifdef __STD_STUFF
- reference operator[] (size_type __pos) {
- return _char_ref_proxy(this, __pos);
- }
-
- reference at(size_type __pos) {
- // if (__pos >= size()) throw out_of_range; // XXX
- return (*this)[__pos];
- }
-
- void resize(size_type __n, _CharT __c) {}
- void resize(size_type __n) {}
- void reserve(size_type __res_arg = 0) {}
- size_type capacity() const {
- return max_size();
- }
-
- // Stuff below this line is dangerous because it's error prone.
- // I would really like to get rid of it.
- // copy function with funny arg ordering.
- size_type copy(_CharT* __buffer, size_type __n,
- size_type __pos = 0) const {
- return copy(__pos, __n, __buffer);
- }
-
- iterator end() { return mutable_end(); }
-
- iterator begin() { return mutable_begin(); }
-
- reverse_iterator rend() { return mutable_rend(); }
-
- reverse_iterator rbegin() { return mutable_rbegin(); }
-
-# else
-
- const_iterator end() { return const_end(); }
-
- const_iterator begin() { return const_begin(); }
-
- const_reverse_iterator rend() { return const_rend(); }
-
- const_reverse_iterator rbegin() { return const_rbegin(); }
-
-# endif
-
-};
-
-template <class _CharT, class _Alloc>
-const rope<_CharT, _Alloc>::size_type rope<_CharT, _Alloc>::npos =
- (size_type)(-1);
-
-template <class _CharT, class _Alloc>
-inline bool operator== (const _Rope_const_iterator<_CharT,_Alloc>& __x,
- const _Rope_const_iterator<_CharT,_Alloc>& __y) {
- return (__x._M_current_pos == __y._M_current_pos &&
- __x._M_root == __y._M_root);
-}
-
-template <class _CharT, class _Alloc>
-inline bool operator< (const _Rope_const_iterator<_CharT,_Alloc>& __x,
- const _Rope_const_iterator<_CharT,_Alloc>& __y) {
- return (__x._M_current_pos < __y._M_current_pos);
-}
-
-template <class _CharT, class _Alloc>
-inline ptrdiff_t operator-(const _Rope_const_iterator<_CharT,_Alloc>& __x,
- const _Rope_const_iterator<_CharT,_Alloc>& __y) {
- return (ptrdiff_t)__x._M_current_pos - (ptrdiff_t)__y._M_current_pos;
-}
-
-template <class _CharT, class _Alloc>
-inline _Rope_const_iterator<_CharT,_Alloc>
-operator-(const _Rope_const_iterator<_CharT,_Alloc>& __x, ptrdiff_t __n) {
- return _Rope_const_iterator<_CharT,_Alloc>(
- __x._M_root, __x._M_current_pos - __n);
-}
-
-template <class _CharT, class _Alloc>
-inline _Rope_const_iterator<_CharT,_Alloc>
-operator+(const _Rope_const_iterator<_CharT,_Alloc>& __x, ptrdiff_t __n) {
- return _Rope_const_iterator<_CharT,_Alloc>(
- __x._M_root, __x._M_current_pos + __n);
-}
-
-template <class _CharT, class _Alloc>
-inline _Rope_const_iterator<_CharT,_Alloc>
-operator+(ptrdiff_t __n, const _Rope_const_iterator<_CharT,_Alloc>& __x) {
- return _Rope_const_iterator<_CharT,_Alloc>(
- __x._M_root, __x._M_current_pos + __n);
-}
-
-template <class _CharT, class _Alloc>
-inline bool operator== (const _Rope_iterator<_CharT,_Alloc>& __x,
- const _Rope_iterator<_CharT,_Alloc>& __y) {
- return (__x._M_current_pos == __y._M_current_pos &&
- __x._M_root_rope == __y._M_root_rope);
-}
-
-template <class _CharT, class _Alloc>
-inline bool operator< (const _Rope_iterator<_CharT,_Alloc>& __x,
- const _Rope_iterator<_CharT,_Alloc>& __y) {
- return (__x._M_current_pos < __y._M_current_pos);
-}
-
-template <class _CharT, class _Alloc>
-inline ptrdiff_t operator-(const _Rope_iterator<_CharT,_Alloc>& __x,
- const _Rope_iterator<_CharT,_Alloc>& __y) {
- return (ptrdiff_t)__x._M_current_pos - (ptrdiff_t)__y._M_current_pos;
-}
-
-template <class _CharT, class _Alloc>
-inline _Rope_iterator<_CharT,_Alloc>
-operator-(const _Rope_iterator<_CharT,_Alloc>& __x,
- ptrdiff_t __n) {
- return _Rope_iterator<_CharT,_Alloc>(
- __x._M_root_rope, __x._M_current_pos - __n);
-}
-
-template <class _CharT, class _Alloc>
-inline _Rope_iterator<_CharT,_Alloc>
-operator+(const _Rope_iterator<_CharT,_Alloc>& __x,
- ptrdiff_t __n) {
- return _Rope_iterator<_CharT,_Alloc>(
- __x._M_root_rope, __x._M_current_pos + __n);
-}
-
-template <class _CharT, class _Alloc>
-inline _Rope_iterator<_CharT,_Alloc>
-operator+(ptrdiff_t __n, const _Rope_iterator<_CharT,_Alloc>& __x) {
- return _Rope_iterator<_CharT,_Alloc>(
- __x._M_root_rope, __x._M_current_pos + __n);
-}
-
-template <class _CharT, class _Alloc>
-inline
-rope<_CharT,_Alloc>
-operator+ (const rope<_CharT,_Alloc>& __left,
- const rope<_CharT,_Alloc>& __right)
-{
-# ifdef __STL_USE_STD_ALLOCATORS
- __stl_assert(__left.get_allocator() == __right.get_allocator());
-# endif
- return rope<_CharT,_Alloc>(
- rope<_CharT,_Alloc>::_S_concat(__left._M_tree_ptr, __right._M_tree_ptr));
- // Inlining this should make it possible to keep __left and
- // __right in registers.
-}
-
-template <class _CharT, class _Alloc>
-inline
-rope<_CharT,_Alloc>&
-operator+= (rope<_CharT,_Alloc>& __left,
- const rope<_CharT,_Alloc>& __right)
-{
- __left.append(__right);
- return __left;
-}
-
-template <class _CharT, class _Alloc>
-inline
-rope<_CharT,_Alloc>
-operator+ (const rope<_CharT,_Alloc>& __left,
- const _CharT* __right) {
- size_t __rlen = rope<_CharT,_Alloc>::_S_char_ptr_len(__right);
- return rope<_CharT,_Alloc>(
- rope<_CharT,_Alloc>::_S_concat_char_iter(
- __left._M_tree_ptr, __right, __rlen));
-}
-
-template <class _CharT, class _Alloc>
-inline
-rope<_CharT,_Alloc>&
-operator+= (rope<_CharT,_Alloc>& __left,
- const _CharT* __right) {
- __left.append(__right);
- return __left;
-}
-
-template <class _CharT, class _Alloc>
-inline
-rope<_CharT,_Alloc>
-operator+ (const rope<_CharT,_Alloc>& __left, _CharT __right) {
- return rope<_CharT,_Alloc>(
- rope<_CharT,_Alloc>::_S_concat_char_iter(
- __left._M_tree_ptr, &__right, 1));
-}
-
-template <class _CharT, class _Alloc>
-inline
-rope<_CharT,_Alloc>&
-operator+= (rope<_CharT,_Alloc>& __left, _CharT __right) {
- __left.append(__right);
- return __left;
-}
-
-template <class _CharT, class _Alloc>
-bool
-operator< (const rope<_CharT,_Alloc>& __left,
- const rope<_CharT,_Alloc>& __right) {
- return __left.compare(__right) < 0;
-}
-
-template <class _CharT, class _Alloc>
-bool
-operator== (const rope<_CharT,_Alloc>& __left,
- const rope<_CharT,_Alloc>& __right) {
- return __left.compare(__right) == 0;
-}
-
-template <class _CharT, class _Alloc>
-inline bool operator== (const _Rope_char_ptr_proxy<_CharT,_Alloc>& __x,
- const _Rope_char_ptr_proxy<_CharT,_Alloc>& __y) {
- return (__x._M_pos == __y._M_pos && __x._M_root == __y._M_root);
-}
-
-template<class _CharT, class _Alloc>
-ostream& operator<< (ostream& __o, const rope<_CharT,_Alloc>& __r);
-
-typedef rope<char> crope;
-typedef rope<wchar_t> wrope;
-
-inline crope::reference __mutable_reference_at(crope& __c, size_t __i)
-{
- return __c.mutable_reference_at(__i);
-}
-
-inline wrope::reference __mutable_reference_at(wrope& __c, size_t __i)
-{
- return __c.mutable_reference_at(__i);
-}
-
-#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER
-
-template <class _CharT, class _Alloc>
-inline void swap(rope<_CharT,_Alloc>& __x, rope<_CharT,_Alloc>& __y) {
- __x.swap(__y);
-}
-
-#else
-
-inline void swap(crope __x, crope __y) { __x.swap(__y); }
-inline void swap(wrope __x, wrope __y) { __x.swap(__y); }
-
-#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */
-
-// Hash functions should probably be revisited later:
-__STL_TEMPLATE_NULL struct hash<crope>
-{
- size_t operator()(const crope& __str) const
- {
- size_t __size = __str.size();
-
- if (0 == __size) return 0;
- return 13*__str[0] + 5*__str[__size - 1] + __size;
- }
-};
-
-
-__STL_TEMPLATE_NULL struct hash<wrope>
-{
- size_t operator()(const wrope& __str) const
- {
- size_t __size = __str.size();
-
- if (0 == __size) return 0;
- return 13*__str[0] + 5*__str[__size - 1] + __size;
- }
-};
-
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma reset woff 1174
-#endif
-
-__STL_END_NAMESPACE
-
-# include <ropeimpl.h>
-
-# endif /* __SGI_STL_INTERNAL_ROPE_H */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/contrib/libstdc++/stl/stl_set.h b/contrib/libstdc++/stl/stl_set.h
deleted file mode 100644
index 003069cb074b..000000000000
--- a/contrib/libstdc++/stl/stl_set.h
+++ /dev/null
@@ -1,216 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- *
- * Copyright (c) 1996,1997
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- */
-
-/* NOTE: This is an internal header file, included by other STL headers.
- * You should not attempt to use it directly.
- */
-
-#ifndef __SGI_STL_INTERNAL_SET_H
-#define __SGI_STL_INTERNAL_SET_H
-
-__STL_BEGIN_NAMESPACE
-
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma set woff 1174
-#pragma set woff 1375
-#endif
-
-#ifndef __STL_LIMITED_DEFAULT_TEMPLATES
-template <class _Key, class _Compare = less<_Key>,
- class _Alloc = __STL_DEFAULT_ALLOCATOR(_Key) >
-#else
-template <class _Key, class _Compare,
- class _Alloc = __STL_DEFAULT_ALLOCATOR(_Key) >
-#endif
-class set {
-public:
- // typedefs:
-
- typedef _Key key_type;
- typedef _Key value_type;
- typedef _Compare key_compare;
- typedef _Compare value_compare;
-private:
- typedef _Rb_tree<key_type, value_type,
- _Identity<value_type>, key_compare, _Alloc> _Rep_type;
- _Rep_type _M_t; // red-black tree representing set
-public:
- typedef typename _Rep_type::const_pointer pointer;
- typedef typename _Rep_type::const_pointer const_pointer;
- typedef typename _Rep_type::const_reference reference;
- typedef typename _Rep_type::const_reference const_reference;
- typedef typename _Rep_type::const_iterator iterator;
- typedef typename _Rep_type::const_iterator const_iterator;
- typedef typename _Rep_type::const_reverse_iterator reverse_iterator;
- typedef typename _Rep_type::const_reverse_iterator const_reverse_iterator;
- typedef typename _Rep_type::size_type size_type;
- typedef typename _Rep_type::difference_type difference_type;
- typedef typename _Rep_type::allocator_type allocator_type;
-
- // allocation/deallocation
-
- set() : _M_t(_Compare(), allocator_type()) {}
- explicit set(const _Compare& __comp,
- const allocator_type& __a = allocator_type())
- : _M_t(__comp, __a) {}
-
-#ifdef __STL_MEMBER_TEMPLATES
- template <class _InputIterator>
- set(_InputIterator __first, _InputIterator __last)
- : _M_t(_Compare(), allocator_type())
- { _M_t.insert_unique(__first, __last); }
-
- template <class _InputIterator>
- set(_InputIterator __first, _InputIterator __last, const _Compare& __comp,
- const allocator_type& __a = allocator_type())
- : _M_t(__comp, __a) { _M_t.insert_unique(__first, __last); }
-#else
- set(const value_type* __first, const value_type* __last)
- : _M_t(_Compare(), allocator_type())
- { _M_t.insert_unique(__first, __last); }
-
- set(const value_type* __first,
- const value_type* __last, const _Compare& __comp,
- const allocator_type& __a = allocator_type())
- : _M_t(__comp, __a) { _M_t.insert_unique(__first, __last); }
-
- set(const_iterator __first, const_iterator __last)
- : _M_t(_Compare(), allocator_type())
- { _M_t.insert_unique(__first, __last); }
-
- set(const_iterator __first, const_iterator __last, const _Compare& __comp,
- const allocator_type& __a = allocator_type())
- : _M_t(__comp, __a) { _M_t.insert_unique(__first, __last); }
-#endif /* __STL_MEMBER_TEMPLATES */
-
- set(const set<_Key,_Compare,_Alloc>& __x) : _M_t(__x._M_t) {}
- set<_Key,_Compare,_Alloc>& operator=(const set<_Key, _Compare, _Alloc>& __x)
- {
- _M_t = __x._M_t;
- return *this;
- }
-
- // accessors:
-
- key_compare key_comp() const { return _M_t.key_comp(); }
- value_compare value_comp() const { return _M_t.key_comp(); }
- allocator_type get_allocator() const { return _M_t.get_allocator(); }
-
- iterator begin() const { return _M_t.begin(); }
- iterator end() const { return _M_t.end(); }
- reverse_iterator rbegin() const { return _M_t.rbegin(); }
- reverse_iterator rend() const { return _M_t.rend(); }
- bool empty() const { return _M_t.empty(); }
- size_type size() const { return _M_t.size(); }
- size_type max_size() const { return _M_t.max_size(); }
- void swap(set<_Key,_Compare,_Alloc>& __x) { _M_t.swap(__x._M_t); }
-
- // insert/erase
- pair<iterator,bool> insert(const value_type& __x) {
- pair<typename _Rep_type::iterator, bool> __p = _M_t.insert_unique(__x);
- return pair<iterator, bool>(__p.first, __p.second);
- }
- iterator insert(iterator __position, const value_type& __x) {
- typedef typename _Rep_type::iterator _Rep_iterator;
- return _M_t.insert_unique((_Rep_iterator&)__position, __x);
- }
-#ifdef __STL_MEMBER_TEMPLATES
- template <class _InputIterator>
- void insert(_InputIterator __first, _InputIterator __last) {
- _M_t.insert_unique(__first, __last);
- }
-#else
- void insert(const_iterator __first, const_iterator __last) {
- _M_t.insert_unique(__first, __last);
- }
- void insert(const value_type* __first, const value_type* __last) {
- _M_t.insert_unique(__first, __last);
- }
-#endif /* __STL_MEMBER_TEMPLATES */
- void erase(iterator __position) {
- typedef typename _Rep_type::iterator _Rep_iterator;
- _M_t.erase((_Rep_iterator&)__position);
- }
- size_type erase(const key_type& __x) {
- return _M_t.erase(__x);
- }
- void erase(iterator __first, iterator __last) {
- typedef typename _Rep_type::iterator _Rep_iterator;
- _M_t.erase((_Rep_iterator&)__first, (_Rep_iterator&)__last);
- }
- void clear() { _M_t.clear(); }
-
- // set operations:
-
- iterator find(const key_type& __x) const { return _M_t.find(__x); }
- size_type count(const key_type& __x) const { return _M_t.count(__x); }
- iterator lower_bound(const key_type& __x) const {
- return _M_t.lower_bound(__x);
- }
- iterator upper_bound(const key_type& __x) const {
- return _M_t.upper_bound(__x);
- }
- pair<iterator,iterator> equal_range(const key_type& __x) const {
- return _M_t.equal_range(__x);
- }
- friend bool operator== __STL_NULL_TMPL_ARGS (const set&, const set&);
- friend bool operator< __STL_NULL_TMPL_ARGS (const set&, const set&);
-};
-
-template <class _Key, class _Compare, class _Alloc>
-inline bool operator==(const set<_Key,_Compare,_Alloc>& __x,
- const set<_Key,_Compare,_Alloc>& __y) {
- return __x._M_t == __y._M_t;
-}
-
-template <class _Key, class _Compare, class _Alloc>
-inline bool operator<(const set<_Key,_Compare,_Alloc>& __x,
- const set<_Key,_Compare,_Alloc>& __y) {
- return __x._M_t < __y._M_t;
-}
-
-#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER
-
-template <class _Key, class _Compare, class _Alloc>
-inline void swap(set<_Key,_Compare,_Alloc>& __x,
- set<_Key,_Compare,_Alloc>& __y) {
- __x.swap(__y);
-}
-
-#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */
-
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma reset woff 1174
-#pragma reset woff 1375
-#endif
-
-__STL_END_NAMESPACE
-
-#endif /* __SGI_STL_INTERNAL_SET_H */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/contrib/libstdc++/stl/stl_slist.h b/contrib/libstdc++/stl/stl_slist.h
deleted file mode 100644
index 6da234d92c2c..000000000000
--- a/contrib/libstdc++/stl/stl_slist.h
+++ /dev/null
@@ -1,945 +0,0 @@
-/*
- * Copyright (c) 1997
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- */
-
-/* NOTE: This is an internal header file, included by other STL headers.
- * You should not attempt to use it directly.
- */
-
-#ifndef __SGI_STL_INTERNAL_SLIST_H
-#define __SGI_STL_INTERNAL_SLIST_H
-
-
-__STL_BEGIN_NAMESPACE
-
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma set woff 1174
-#pragma set woff 1375
-#endif
-
-struct _Slist_node_base
-{
- _Slist_node_base* _M_next;
-};
-
-inline _Slist_node_base*
-__slist_make_link(_Slist_node_base* __prev_node,
- _Slist_node_base* __new_node)
-{
- __new_node->_M_next = __prev_node->_M_next;
- __prev_node->_M_next = __new_node;
- return __new_node;
-}
-
-inline _Slist_node_base*
-__slist_previous(_Slist_node_base* __head,
- const _Slist_node_base* __node)
-{
- while (__head && __head->_M_next != __node)
- __head = __head->_M_next;
- return __head;
-}
-
-inline const _Slist_node_base*
-__slist_previous(const _Slist_node_base* __head,
- const _Slist_node_base* __node)
-{
- while (__head && __head->_M_next != __node)
- __head = __head->_M_next;
- return __head;
-}
-
-inline void __slist_splice_after(_Slist_node_base* __pos,
- _Slist_node_base* __before_first,
- _Slist_node_base* __before_last)
-{
- if (__pos != __before_first && __pos != __before_last) {
- _Slist_node_base* __first = __before_first->_M_next;
- _Slist_node_base* __after = __pos->_M_next;
- __before_first->_M_next = __before_last->_M_next;
- __pos->_M_next = __first;
- __before_last->_M_next = __after;
- }
-}
-
-inline _Slist_node_base* __slist_reverse(_Slist_node_base* __node)
-{
- _Slist_node_base* __result = __node;
- __node = __node->_M_next;
- __result->_M_next = 0;
- while(__node) {
- _Slist_node_base* __next = __node->_M_next;
- __node->_M_next = __result;
- __result = __node;
- __node = __next;
- }
- return __result;
-}
-
-inline size_t __slist_size(_Slist_node_base* __node)
-{
- size_t __result = 0;
- for ( ; __node != 0; __node = __node->_M_next)
- ++__result;
- return __result;
-}
-
-template <class _Tp>
-struct _Slist_node : public _Slist_node_base
-{
- _Tp _M_data;
-};
-
-struct _Slist_iterator_base
-{
- typedef size_t size_type;
- typedef ptrdiff_t difference_type;
- typedef forward_iterator_tag iterator_category;
-
- _Slist_node_base* _M_node;
-
- _Slist_iterator_base(_Slist_node_base* __x) : _M_node(__x) {}
- void _M_incr() { _M_node = _M_node->_M_next; }
-
- bool operator==(const _Slist_iterator_base& __x) const {
- return _M_node == __x._M_node;
- }
- bool operator!=(const _Slist_iterator_base& __x) const {
- return _M_node != __x._M_node;
- }
-};
-
-template <class _Tp, class _Ref, class _Ptr>
-struct _Slist_iterator : public _Slist_iterator_base
-{
- typedef _Slist_iterator<_Tp, _Tp&, _Tp*> iterator;
- typedef _Slist_iterator<_Tp, const _Tp&, const _Tp*> const_iterator;
- typedef _Slist_iterator<_Tp, _Ref, _Ptr> _Self;
-
- typedef _Tp value_type;
- typedef _Ptr pointer;
- typedef _Ref reference;
- typedef _Slist_node<_Tp> _Node;
-
- _Slist_iterator(_Node* __x) : _Slist_iterator_base(__x) {}
- _Slist_iterator() : _Slist_iterator_base(0) {}
- _Slist_iterator(const iterator& __x) : _Slist_iterator_base(__x._M_node) {}
-
- reference operator*() const { return ((_Node*) _M_node)->_M_data; }
-#ifndef __SGI_STL_NO_ARROW_OPERATOR
- pointer operator->() const { return &(operator*()); }
-#endif /* __SGI_STL_NO_ARROW_OPERATOR */
-
- _Self& operator++()
- {
- _M_incr();
- return *this;
- }
- _Self operator++(int)
- {
- _Self __tmp = *this;
- _M_incr();
- return __tmp;
- }
-};
-
-#ifndef __STL_CLASS_PARTIAL_SPECIALIZATION
-
-inline ptrdiff_t* distance_type(const _Slist_iterator_base&) {
- return 0;
-}
-
-inline forward_iterator_tag iterator_category(const _Slist_iterator_base&) {
- return forward_iterator_tag();
-}
-
-template <class _Tp, class _Ref, class _Ptr>
-inline _Tp* value_type(const _Slist_iterator<_Tp, _Ref, _Ptr>&) {
- return 0;
-}
-
-#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
-
-// Base class that encapsulates details of allocators. Three cases:
-// an ordinary standard-conforming allocator, a standard-conforming
-// allocator with no non-static data, and an SGI-style allocator.
-// This complexity is necessary only because we're worrying about backward
-// compatibility and because we want to avoid wasting storage on an
-// allocator instance if it isn't necessary.
-
-#ifdef __STL_USE_STD_ALLOCATORS
-
-// Base for general standard-conforming allocators.
-template <class _Tp, class _Allocator, bool _IsStatic>
-class _Slist_alloc_base {
-public:
- typedef typename _Alloc_traits<_Tp,_Allocator>::allocator_type
- allocator_type;
- allocator_type get_allocator() const { return _M_node_allocator; }
-
- _Slist_alloc_base(const allocator_type& __a) : _M_node_allocator(__a) {}
-
-protected:
- _Slist_node<_Tp>* _M_get_node()
- { return _M_node_allocator.allocate(1); }
- void _M_put_node(_Slist_node<_Tp>* __p)
- { _M_node_allocator.deallocate(__p, 1); }
-
-protected:
- typename _Alloc_traits<_Slist_node<_Tp>,_Allocator>::allocator_type
- _M_node_allocator;
- _Slist_node_base _M_head;
-};
-
-// Specialization for instanceless allocators.
-template <class _Tp, class _Allocator>
-class _Slist_alloc_base<_Tp,_Allocator, true> {
-public:
- typedef typename _Alloc_traits<_Tp,_Allocator>::allocator_type
- allocator_type;
- allocator_type get_allocator() const { return allocator_type(); }
-
- _Slist_alloc_base(const allocator_type&) {}
-
-protected:
- typedef typename _Alloc_traits<_Slist_node<_Tp>, _Allocator>::_Alloc_type
- _Alloc_type;
- _Slist_node<_Tp>* _M_get_node() { return _Alloc_type::allocate(1); }
- void _M_put_node(_Slist_node<_Tp>* __p) { _Alloc_type::deallocate(__p, 1); }
-
-protected:
- _Slist_node_base _M_head;
-};
-
-
-template <class _Tp, class _Alloc>
-struct _Slist_base
- : public _Slist_alloc_base<_Tp, _Alloc,
- _Alloc_traits<_Tp, _Alloc>::_S_instanceless>
-{
- typedef _Slist_alloc_base<_Tp, _Alloc,
- _Alloc_traits<_Tp, _Alloc>::_S_instanceless>
- _Base;
- typedef typename _Base::allocator_type allocator_type;
-
- _Slist_base(const allocator_type& __a) : _Base(__a) { _M_head._M_next = 0; }
- ~_Slist_base() { _M_erase_after(&_M_head, 0); }
-
-protected:
-
- _Slist_node_base* _M_erase_after(_Slist_node_base* __pos)
- {
- _Slist_node<_Tp>* __next = (_Slist_node<_Tp>*) (__pos->_M_next);
- _Slist_node_base* __next_next = __next->_M_next;
- __pos->_M_next = __next_next;
- destroy(&__next->_M_data);
- _M_put_node(__next);
- return __next_next;
- }
- _Slist_node_base* _M_erase_after(_Slist_node_base*, _Slist_node_base*);
-};
-
-#else /* __STL_USE_STD_ALLOCATORS */
-
-template <class _Tp, class _Alloc>
-struct _Slist_base {
- typedef _Alloc allocator_type;
- allocator_type get_allocator() const { return allocator_type(); }
-
- _Slist_base(const allocator_type&) { _M_head._M_next = 0; }
- ~_Slist_base() { _M_erase_after(&_M_head, 0); }
-
-protected:
- typedef simple_alloc<_Slist_node<_Tp>, _Alloc> _Alloc_type;
- _Slist_node<_Tp>* _M_get_node() { return _Alloc_type::allocate(1); }
- void _M_put_node(_Slist_node<_Tp>* __p) { _Alloc_type::deallocate(__p, 1); }
-
- _Slist_node_base* _M_erase_after(_Slist_node_base* __pos)
- {
- _Slist_node<_Tp>* __next = (_Slist_node<_Tp>*) (__pos->_M_next);
- _Slist_node_base* __next_next = __next->_M_next;
- __pos->_M_next = __next_next;
- destroy(&__next->_M_data);
- _M_put_node(__next);
- return __next_next;
- }
- _Slist_node_base* _M_erase_after(_Slist_node_base*, _Slist_node_base*);
-
-protected:
- _Slist_node_base _M_head;
-};
-
-#endif /* __STL_USE_STD_ALLOCATORS */
-
-template <class _Tp, class _Alloc>
-_Slist_node_base*
-_Slist_base<_Tp,_Alloc>::_M_erase_after(_Slist_node_base* __before_first,
- _Slist_node_base* __last_node) {
- _Slist_node<_Tp>* __cur = (_Slist_node<_Tp>*) (__before_first->_M_next);
- while (__cur != __last_node) {
- _Slist_node<_Tp>* __tmp = __cur;
- __cur = (_Slist_node<_Tp>*) __cur->_M_next;
- destroy(&__tmp->_M_data);
- _M_put_node(__tmp);
- }
- __before_first->_M_next = __last_node;
- return __last_node;
-}
-
-template <class _Tp, class _Alloc = __STL_DEFAULT_ALLOCATOR(_Tp) >
-class slist : private _Slist_base<_Tp,_Alloc>
-{
-private:
- typedef _Slist_base<_Tp,_Alloc> _Base;
-public:
- typedef _Tp value_type;
- typedef value_type* pointer;
- typedef const value_type* const_pointer;
- typedef value_type& reference;
- typedef const value_type& const_reference;
- typedef size_t size_type;
- typedef ptrdiff_t difference_type;
-
- typedef _Slist_iterator<_Tp, _Tp&, _Tp*> iterator;
- typedef _Slist_iterator<_Tp, const _Tp&, const _Tp*> const_iterator;
-
- typedef typename _Base::allocator_type allocator_type;
- allocator_type get_allocator() const { return _Base::get_allocator(); }
-
-private:
- typedef _Slist_node<_Tp> _Node;
- typedef _Slist_node_base _Node_base;
- typedef _Slist_iterator_base _Iterator_base;
-
- _Node* _M_create_node(const value_type& __x) {
- _Node* __node = _M_get_node();
- __STL_TRY {
- construct(&__node->_M_data, __x);
- __node->_M_next = 0;
- }
- __STL_UNWIND(_M_put_node(__node));
- return __node;
- }
-
- _Node* _M_create_node() {
- _Node* __node = _M_get_node();
- __STL_TRY {
- construct(&__node->_M_data);
- __node->_M_next = 0;
- }
- __STL_UNWIND(_M_put_node(__node));
- return __node;
- }
-
-private:
-#ifdef __STL_USE_NAMESPACES
- using _Base::_M_get_node;
- using _Base::_M_put_node;
- using _Base::_M_erase_after;
- using _Base::_M_head;
-#endif /* __STL_USE_NAMESPACES */
-
-public:
- explicit slist(const allocator_type& __a = allocator_type()) : _Base(__a) {}
-
- slist(size_type __n, const value_type& __x,
- const allocator_type& __a = allocator_type()) : _Base(__a)
- { _M_insert_after_fill(&_M_head, __n, __x); }
-
- explicit slist(size_type __n) : _Base(allocator_type())
- { _M_insert_after_fill(&_M_head, __n, value_type()); }
-
-#ifdef __STL_MEMBER_TEMPLATES
- // We don't need any dispatching tricks here, because _M_insert_after_range
- // already does them.
- template <class _InputIterator>
- slist(_InputIterator __first, _InputIterator __last,
- const allocator_type& __a = allocator_type()) : _Base(__a)
- { _M_insert_after_range(&_M_head, __first, __last); }
-
-#else /* __STL_MEMBER_TEMPLATES */
- slist(const_iterator __first, const_iterator __last,
- const allocator_type& __a = allocator_type()) : _Base(__a)
- { _M_insert_after_range(&_M_head, __first, __last); }
- slist(const value_type* __first, const value_type* __last,
- const allocator_type& __a = allocator_type()) : _Base(__a)
- { _M_insert_after_range(&_M_head, __first, __last); }
-#endif /* __STL_MEMBER_TEMPLATES */
-
- slist(const slist& __x) : _Base(__x.get_allocator())
- { _M_insert_after_range(&_M_head, __x.begin(), __x.end()); }
-
- slist& operator= (const slist& __x);
-
- ~slist() {}
-
-public:
- // assign(), a generalized assignment member function. Two
- // versions: one that takes a count, and one that takes a range.
- // The range version is a member template, so we dispatch on whether
- // or not the type is an integer.
-
- void assign(size_type __n, const _Tp& __val);
-
-#ifdef __STL_MEMBER_TEMPLATES
-
- template <class _InputIterator>
- void assign(_InputIterator __first, _InputIterator __last) {
- typedef typename _Is_integer<_InputIterator>::_Integral _Integral;
- _M_assign_dispatch(__first, __last, _Integral());
- }
-
- template <class _Integer>
- void _M_assign_dispatch(_Integer __n, _Integer __val, __true_type)
- { assign((size_type) __n, (_Tp) __val); }
-
- template <class _InputIterator>
- void _M_assign_dispatch(_InputIterator __first, _InputIterator __last,
- __false_type);
-
-#endif /* __STL_MEMBER_TEMPLATES */
-
-public:
-
- iterator begin() { return iterator((_Node*)_M_head._M_next); }
- const_iterator begin() const
- { return const_iterator((_Node*)_M_head._M_next);}
-
- iterator end() { return iterator(0); }
- const_iterator end() const { return const_iterator(0); }
-
- size_type size() const { return __slist_size(_M_head._M_next); }
-
- size_type max_size() const { return size_type(-1); }
-
- bool empty() const { return _M_head._M_next == 0; }
-
- void swap(slist& __x) { __STD::swap(_M_head._M_next, __x._M_head._M_next); }
-
-public:
- friend bool operator== __STL_NULL_TMPL_ARGS (const slist<_Tp,_Alloc>& _SL1,
- const slist<_Tp,_Alloc>& _SL2);
-
-public:
-
- reference front() { return ((_Node*) _M_head._M_next)->_M_data; }
- const_reference front() const
- { return ((_Node*) _M_head._M_next)->_M_data; }
- void push_front(const value_type& __x) {
- __slist_make_link(&_M_head, _M_create_node(__x));
- }
- void push_front() { __slist_make_link(&_M_head, _M_create_node());}
- void pop_front() {
- _Node* __node = (_Node*) _M_head._M_next;
- _M_head._M_next = __node->_M_next;
- destroy(&__node->_M_data);
- _M_put_node(__node);
- }
-
- iterator previous(const_iterator __pos) {
- return iterator((_Node*) __slist_previous(&_M_head, __pos._M_node));
- }
- const_iterator previous(const_iterator __pos) const {
- return const_iterator((_Node*) __slist_previous(&_M_head, __pos._M_node));
- }
-
-private:
- _Node* _M_insert_after(_Node_base* __pos, const value_type& __x) {
- return (_Node*) (__slist_make_link(__pos, _M_create_node(__x)));
- }
-
- _Node* _M_insert_after(_Node_base* __pos) {
- return (_Node*) (__slist_make_link(__pos, _M_create_node()));
- }
-
- void _M_insert_after_fill(_Node_base* __pos,
- size_type __n, const value_type& __x) {
- for (size_type __i = 0; __i < __n; ++__i)
- __pos = __slist_make_link(__pos, _M_create_node(__x));
- }
-
-#ifdef __STL_MEMBER_TEMPLATES
-
- // Check whether it's an integral type. If so, it's not an iterator.
- template <class _InIter>
- void _M_insert_after_range(_Node_base* __pos,
- _InIter __first, _InIter __last) {
- typedef typename _Is_integer<_InIter>::_Integral _Integral;
- _M_insert_after_range(__pos, __first, __last, _Integral());
- }
-
- template <class _Integer>
- void _M_insert_after_range(_Node_base* __pos, _Integer __n, _Integer __x,
- __true_type) {
- _M_insert_after_fill(__pos, __n, __x);
- }
-
- template <class _InIter>
- void _M_insert_after_range(_Node_base* __pos,
- _InIter __first, _InIter __last,
- __false_type) {
- while (__first != __last) {
- __pos = __slist_make_link(__pos, _M_create_node(*__first));
- ++__first;
- }
- }
-
-#else /* __STL_MEMBER_TEMPLATES */
-
- void _M_insert_after_range(_Node_base* __pos,
- const_iterator __first, const_iterator __last) {
- while (__first != __last) {
- __pos = __slist_make_link(__pos, _M_create_node(*__first));
- ++__first;
- }
- }
- void _M_insert_after_range(_Node_base* __pos,
- const value_type* __first,
- const value_type* __last) {
- while (__first != __last) {
- __pos = __slist_make_link(__pos, _M_create_node(*__first));
- ++__first;
- }
- }
-
-#endif /* __STL_MEMBER_TEMPLATES */
-
-public:
-
- iterator insert_after(iterator __pos, const value_type& __x) {
- return iterator(_M_insert_after(__pos._M_node, __x));
- }
-
- iterator insert_after(iterator __pos) {
- return insert_after(__pos, value_type());
- }
-
- void insert_after(iterator __pos, size_type __n, const value_type& __x) {
- _M_insert_after_fill(__pos._M_node, __n, __x);
- }
-
-#ifdef __STL_MEMBER_TEMPLATES
-
- // We don't need any dispatching tricks here, because _M_insert_after_range
- // already does them.
- template <class _InIter>
- void insert_after(iterator __pos, _InIter __first, _InIter __last) {
- _M_insert_after_range(__pos._M_node, __first, __last);
- }
-
-#else /* __STL_MEMBER_TEMPLATES */
-
- void insert_after(iterator __pos,
- const_iterator __first, const_iterator __last) {
- _M_insert_after_range(__pos._M_node, __first, __last);
- }
- void insert_after(iterator __pos,
- const value_type* __first, const value_type* __last) {
- _M_insert_after_range(__pos._M_node, __first, __last);
- }
-
-#endif /* __STL_MEMBER_TEMPLATES */
-
- iterator insert(iterator __pos, const value_type& __x) {
- return iterator(_M_insert_after(__slist_previous(&_M_head, __pos._M_node),
- __x));
- }
-
- iterator insert(iterator __pos) {
- return iterator(_M_insert_after(__slist_previous(&_M_head, __pos._M_node),
- value_type()));
- }
-
- void insert(iterator __pos, size_type __n, const value_type& __x) {
- _M_insert_after_fill(__slist_previous(&_M_head, __pos._M_node), __n, __x);
- }
-
-#ifdef __STL_MEMBER_TEMPLATES
-
- // We don't need any dispatching tricks here, because _M_insert_after_range
- // already does them.
- template <class _InIter>
- void insert(iterator __pos, _InIter __first, _InIter __last) {
- _M_insert_after_range(__slist_previous(&_M_head, __pos._M_node),
- __first, __last);
- }
-
-#else /* __STL_MEMBER_TEMPLATES */
-
- void insert(iterator __pos, const_iterator __first, const_iterator __last) {
- _M_insert_after_range(__slist_previous(&_M_head, __pos._M_node),
- __first, __last);
- }
- void insert(iterator __pos, const value_type* __first,
- const value_type* __last) {
- _M_insert_after_range(__slist_previous(&_M_head, __pos._M_node),
- __first, __last);
- }
-
-#endif /* __STL_MEMBER_TEMPLATES */
-
-
-public:
- iterator erase_after(iterator __pos) {
- return iterator((_Node*) _M_erase_after(__pos._M_node));
- }
- iterator erase_after(iterator __before_first, iterator __last) {
- return iterator((_Node*) _M_erase_after(__before_first._M_node,
- __last._M_node));
- }
-
- iterator erase(iterator __pos) {
- return (_Node*) _M_erase_after(__slist_previous(&_M_head,
- __pos._M_node));
- }
- iterator erase(iterator __first, iterator __last) {
- return (_Node*) _M_erase_after(
- __slist_previous(&_M_head, __first._M_node), __last._M_node);
- }
-
- void resize(size_type new_size, const _Tp& __x);
- void resize(size_type new_size) { resize(new_size, _Tp()); }
- void clear() { _M_erase_after(&_M_head, 0); }
-
-public:
- // Moves the range [__before_first + 1, __before_last + 1) to *this,
- // inserting it immediately after __pos. This is constant time.
- void splice_after(iterator __pos,
- iterator __before_first, iterator __before_last)
- {
- if (__before_first != __before_last)
- __slist_splice_after(__pos._M_node, __before_first._M_node,
- __before_last._M_node);
- }
-
- // Moves the element that follows __prev to *this, inserting it immediately
- // after __pos. This is constant time.
- void splice_after(iterator __pos, iterator __prev)
- {
- __slist_splice_after(__pos._M_node,
- __prev._M_node, __prev._M_node->_M_next);
- }
-
-
- // Linear in distance(begin(), __pos), and linear in __x.size().
- void splice(iterator __pos, slist& __x) {
- if (__x._M_head._M_next)
- __slist_splice_after(__slist_previous(&_M_head, __pos._M_node),
- &__x._M_head, __slist_previous(&__x._M_head, 0));
- }
-
- // Linear in distance(begin(), __pos), and in distance(__x.begin(), __i).
- void splice(iterator __pos, slist& __x, iterator __i) {
- __slist_splice_after(__slist_previous(&_M_head, __pos._M_node),
- __slist_previous(&__x._M_head, __i._M_node),
- __i._M_node);
- }
-
- // Linear in distance(begin(), __pos), in distance(__x.begin(), __first),
- // and in distance(__first, __last).
- void splice(iterator __pos, slist& __x, iterator __first, iterator __last)
- {
- if (__first != __last)
- __slist_splice_after(__slist_previous(&_M_head, __pos._M_node),
- __slist_previous(&__x._M_head, __first._M_node),
- __slist_previous(__first._M_node, __last._M_node));
- }
-
-public:
- void reverse() {
- if (_M_head._M_next)
- _M_head._M_next = __slist_reverse(_M_head._M_next);
- }
-
- void remove(const _Tp& __val);
- void unique();
- void merge(slist& __x);
- void sort();
-
-#ifdef __STL_MEMBER_TEMPLATES
- template <class _Predicate>
- void remove_if(_Predicate __pred);
-
- template <class _BinaryPredicate>
- void unique(_BinaryPredicate __pred);
-
- template <class _StrictWeakOrdering>
- void merge(slist&, _StrictWeakOrdering);
-
- template <class _StrictWeakOrdering>
- void sort(_StrictWeakOrdering __comp);
-#endif /* __STL_MEMBER_TEMPLATES */
-};
-
-template <class _Tp, class _Alloc>
-slist<_Tp,_Alloc>& slist<_Tp,_Alloc>::operator=(const slist<_Tp,_Alloc>& __x)
-{
- if (&__x != this) {
- _Node_base* __p1 = &_M_head;
- _Node* __n1 = (_Node*) _M_head._M_next;
- const _Node* __n2 = (const _Node*) __x._M_head._M_next;
- while (__n1 && __n2) {
- __n1->_M_data = __n2->_M_data;
- __p1 = __n1;
- __n1 = (_Node*) __n1->_M_next;
- __n2 = (const _Node*) __n2->_M_next;
- }
- if (__n2 == 0)
- _M_erase_after(__p1, 0);
- else
- _M_insert_after_range(__p1, const_iterator((_Node*)__n2),
- const_iterator(0));
- }
- return *this;
-}
-
-template <class _Tp, class _Alloc>
-void slist<_Tp, _Alloc>::assign(size_type __n, const _Tp& __val) {
- _Node_base* __prev = &_M_head;
- _Node* __node = (_Node*) _M_head._M_next;
- for ( ; __node != 0 && __n > 0 ; --__n) {
- __node->_M_data = __val;
- __prev = __node;
- __node = (_Node*) __node->_M_next;
- }
- if (__n > 0)
- _M_insert_after_fill(__prev, __n, __val);
- else
- _M_erase_after(__prev, 0);
-}
-
-#ifdef __STL_MEMBER_TEMPLATES
-
-template <class _Tp, class _Alloc> template <class _InputIter>
-void
-slist<_Tp, _Alloc>::_M_assign_dispatch(_InputIter __first, _InputIter __last,
- __false_type)
-{
- _Node_base* __prev = &_M_head;
- _Node* __node = (_Node*) _M_head._M_next;
- while (__node != 0 && __first != __last) {
- __node->_M_data = *__first;
- __prev = __node;
- __node = (_Node*) __node->_M_next;
- ++__first;
- }
- if (__first != __last)
- _M_insert_after_range(__prev, __first, __last);
- else
- _M_erase_after(__prev, 0);
-}
-
-#endif /* __STL_MEMBER_TEMPLATES */
-
-template <class _Tp, class _Alloc>
-inline bool
-operator==(const slist<_Tp,_Alloc>& _SL1, const slist<_Tp,_Alloc>& _SL2)
-{
- typedef typename slist<_Tp,_Alloc>::_Node _Node;
- _Node* __n1 = (_Node*) _SL1._M_head._M_next;
- _Node* __n2 = (_Node*) _SL2._M_head._M_next;
- while (__n1 && __n2 && __n1->_M_data == __n2->_M_data) {
- __n1 = (_Node*) __n1->_M_next;
- __n2 = (_Node*) __n2->_M_next;
- }
- return __n1 == 0 && __n2 == 0;
-}
-
-template <class _Tp, class _Alloc>
-inline bool operator<(const slist<_Tp,_Alloc>& _SL1,
- const slist<_Tp,_Alloc>& _SL2)
-{
- return lexicographical_compare(_SL1.begin(), _SL1.end(),
- _SL2.begin(), _SL2.end());
-}
-
-#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER
-
-template <class _Tp, class _Alloc>
-inline void swap(slist<_Tp,_Alloc>& __x, slist<_Tp,_Alloc>& __y) {
- __x.swap(__y);
-}
-
-#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */
-
-
-template <class _Tp, class _Alloc>
-void slist<_Tp,_Alloc>::resize(size_type __len, const _Tp& __x)
-{
- _Node_base* __cur = &_M_head;
- while (__cur->_M_next != 0 && __len > 0) {
- --__len;
- __cur = __cur->_M_next;
- }
- if (__cur->_M_next)
- _M_erase_after(__cur, 0);
- else
- _M_insert_after_fill(__cur, __len, __x);
-}
-
-template <class _Tp, class _Alloc>
-void slist<_Tp,_Alloc>::remove(const _Tp& __val)
-{
- _Node_base* __cur = &_M_head;
- while (__cur && __cur->_M_next) {
- if (((_Node*) __cur->_M_next)->_M_data == __val)
- _M_erase_after(__cur);
- else
- __cur = __cur->_M_next;
- }
-}
-
-template <class _Tp, class _Alloc>
-void slist<_Tp,_Alloc>::unique()
-{
- _Node_base* __cur = _M_head._M_next;
- if (__cur) {
- while (__cur->_M_next) {
- if (((_Node*)__cur)->_M_data ==
- ((_Node*)(__cur->_M_next))->_M_data)
- _M_erase_after(__cur);
- else
- __cur = __cur->_M_next;
- }
- }
-}
-
-template <class _Tp, class _Alloc>
-void slist<_Tp,_Alloc>::merge(slist<_Tp,_Alloc>& __x)
-{
- _Node_base* __n1 = &_M_head;
- while (__n1->_M_next && __x._M_head._M_next) {
- if (((_Node*) __x._M_head._M_next)->_M_data <
- ((_Node*) __n1->_M_next)->_M_data)
- __slist_splice_after(__n1, &__x._M_head, __x._M_head._M_next);
- __n1 = __n1->_M_next;
- }
- if (__x._M_head._M_next) {
- __n1->_M_next = __x._M_head._M_next;
- __x._M_head._M_next = 0;
- }
-}
-
-template <class _Tp, class _Alloc>
-void slist<_Tp,_Alloc>::sort()
-{
- if (_M_head._M_next && _M_head._M_next->_M_next) {
- slist __carry;
- slist __counter[64];
- int __fill = 0;
- while (!empty()) {
- __slist_splice_after(&__carry._M_head, &_M_head, _M_head._M_next);
- int __i = 0;
- while (__i < __fill && !__counter[__i].empty()) {
- __counter[__i].merge(__carry);
- __carry.swap(__counter[__i]);
- ++__i;
- }
- __carry.swap(__counter[__i]);
- if (__i == __fill)
- ++__fill;
- }
-
- for (int __i = 1; __i < __fill; ++__i)
- __counter[__i].merge(__counter[__i-1]);
- this->swap(__counter[__fill-1]);
- }
-}
-
-#ifdef __STL_MEMBER_TEMPLATES
-
-template <class _Tp, class _Alloc>
-template <class _Predicate>
-void slist<_Tp,_Alloc>::remove_if(_Predicate __pred)
-{
- _Node_base* __cur = &_M_head;
- while (__cur->_M_next) {
- if (__pred(((_Node*) __cur->_M_next)->_M_data))
- _M_erase_after(__cur);
- else
- __cur = __cur->_M_next;
- }
-}
-
-template <class _Tp, class _Alloc> template <class _BinaryPredicate>
-void slist<_Tp,_Alloc>::unique(_BinaryPredicate __pred)
-{
- _Node* __cur = (_Node*) _M_head._M_next;
- if (__cur) {
- while (__cur->_M_next) {
- if (__pred(((_Node*)__cur)->_M_data,
- ((_Node*)(__cur->_M_next))->_M_data))
- _M_erase_after(__cur);
- else
- __cur = (_Node*) __cur->_M_next;
- }
- }
-}
-
-template <class _Tp, class _Alloc> template <class _StrictWeakOrdering>
-void slist<_Tp,_Alloc>::merge(slist<_Tp,_Alloc>& __x,
- _StrictWeakOrdering __comp)
-{
- _Node_base* __n1 = &_M_head;
- while (__n1->_M_next && __x._M_head._M_next) {
- if (__comp(((_Node*) __x._M_head._M_next)->_M_data,
- ((_Node*) __n1->_M_next)->_M_data))
- __slist_splice_after(__n1, &__x._M_head, __x._M_head._M_next);
- __n1 = __n1->_M_next;
- }
- if (__x._M_head._M_next) {
- __n1->_M_next = __x._M_head._M_next;
- __x._M_head._M_next = 0;
- }
-}
-
-template <class _Tp, class _Alloc> template <class _StrictWeakOrdering>
-void slist<_Tp,_Alloc>::sort(_StrictWeakOrdering __comp)
-{
- if (_M_head._M_next && _M_head._M_next->_M_next) {
- slist __carry;
- slist __counter[64];
- int __fill = 0;
- while (!empty()) {
- __slist_splice_after(&__carry._M_head, &_M_head, _M_head._M_next);
- int __i = 0;
- while (__i < __fill && !__counter[__i].empty()) {
- __counter[__i].merge(__carry, __comp);
- __carry.swap(__counter[__i]);
- ++__i;
- }
- __carry.swap(__counter[__i]);
- if (__i == __fill)
- ++__fill;
- }
-
- for (int __i = 1; __i < __fill; ++__i)
- __counter[__i].merge(__counter[__i-1], __comp);
- this->swap(__counter[__fill-1]);
- }
-}
-
-#endif /* __STL_MEMBER_TEMPLATES */
-
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma reset woff 1174
-#pragma reset woff 1375
-#endif
-
-__STL_END_NAMESPACE
-
-#endif /* __SGI_STL_INTERNAL_SLIST_H */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/contrib/libstdc++/stl/stl_stack.h b/contrib/libstdc++/stl/stl_stack.h
deleted file mode 100644
index 2a04b21e5070..000000000000
--- a/contrib/libstdc++/stl/stl_stack.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- *
- * Copyright (c) 1996,1997
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- */
-
-/* NOTE: This is an internal header file, included by other STL headers.
- * You should not attempt to use it directly.
- */
-
-#ifndef __SGI_STL_INTERNAL_STACK_H
-#define __SGI_STL_INTERNAL_STACK_H
-
-__STL_BEGIN_NAMESPACE
-
-#ifndef __STL_LIMITED_DEFAULT_TEMPLATES
-template <class _Tp, class _Sequence = deque<_Tp> >
-#else
-template <class _Tp, class _Sequence>
-#endif
-class stack {
- friend bool operator== __STL_NULL_TMPL_ARGS (const stack&, const stack&);
- friend bool operator< __STL_NULL_TMPL_ARGS (const stack&, const stack&);
-public:
- typedef typename _Sequence::value_type value_type;
- typedef typename _Sequence::size_type size_type;
- typedef _Sequence container_type;
-
- typedef typename _Sequence::reference reference;
- typedef typename _Sequence::const_reference const_reference;
-protected:
- _Sequence _M_c;
-public:
- stack() : _M_c() {}
- explicit stack(const _Sequence& __s) : _M_c(__s) {}
-
- bool empty() const { return _M_c.empty(); }
- size_type size() const { return _M_c.size(); }
- reference top() { return _M_c.back(); }
- const_reference top() const { return _M_c.back(); }
- void push(const value_type& __x) { _M_c.push_back(__x); }
- void pop() { _M_c.pop_back(); }
-};
-
-template <class _Tp, class _Seq>
-bool operator==(const stack<_Tp,_Seq>& __x, const stack<_Tp,_Seq>& __y)
-{
- return __x._M_c == __y._M_c;
-}
-
-template <class _Tp, class _Seq>
-bool operator<(const stack<_Tp,_Seq>& __x, const stack<_Tp,_Seq>& __y)
-{
- return __x._M_c < __y._M_c;
-}
-
-#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER
-
-template <class _Tp, class _Seq>
-bool operator!=(const stack<_Tp,_Seq>& __x, const stack<_Tp,_Seq>& __y)
-{
- return !(__x == __y);
-}
-
-template <class _Tp, class _Seq>
-bool operator>(const stack<_Tp,_Seq>& __x, const stack<_Tp,_Seq>& __y)
-{
- return __y < __x;
-}
-
-template <class _Tp, class _Seq>
-bool operator<=(const stack<_Tp,_Seq>& __x, const stack<_Tp,_Seq>& __y)
-{
- return !(__y < __x);
-}
-
-template <class _Tp, class _Seq>
-bool operator>=(const stack<_Tp,_Seq>& __x, const stack<_Tp,_Seq>& __y)
-{
- return !(__x < __y);
-}
-
-#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */
-
-__STL_END_NAMESPACE
-
-#endif /* __SGI_STL_INTERNAL_STACK_H */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/contrib/libstdc++/stl/stl_tempbuf.h b/contrib/libstdc++/stl/stl_tempbuf.h
deleted file mode 100644
index e1b2eadafcbf..000000000000
--- a/contrib/libstdc++/stl/stl_tempbuf.h
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- *
- * Copyright (c) 1996,1997
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- */
-
-/* NOTE: This is an internal header file, included by other STL headers.
- * You should not attempt to use it directly.
- */
-
-#ifndef __SGI_STL_INTERNAL_TEMPBUF_H
-#define __SGI_STL_INTERNAL_TEMPBUF_H
-
-
-__STL_BEGIN_NAMESPACE
-
-template <class _Tp>
-pair<_Tp*, ptrdiff_t>
-__get_temporary_buffer(ptrdiff_t __len, _Tp*)
-{
- if (__len > ptrdiff_t(INT_MAX / sizeof(_Tp)))
- __len = INT_MAX / sizeof(_Tp);
-
- while (__len > 0) {
- _Tp* __tmp = (_Tp*) malloc((size_t)__len * sizeof(_Tp));
- if (__tmp != 0)
- return pair<_Tp*, ptrdiff_t>(__tmp, __len);
- __len /= 2;
- }
-
- return pair<_Tp*, ptrdiff_t>((_Tp*)0, 0);
-}
-
-#ifdef __STL_EXPLICIT_FUNCTION_TMPL_ARGS
-
-template <class _Tp>
-inline pair<_Tp*, ptrdiff_t> get_temporary_buffer(ptrdiff_t __len) {
- return __get_temporary_buffer(__len, (_Tp*) 0);
-}
-
-#endif /* __STL_EXPLICIT_FUNCTION_TMPL_ARGS */
-
-// This overload is not required by the standard; it is an extension.
-// It is supported for backward compatibility with the HP STL, and
-// because not all compilers support the language feature (explicit
-// function template arguments) that is required for the standard
-// version of get_temporary_buffer.
-template <class _Tp>
-inline pair<_Tp*, ptrdiff_t> get_temporary_buffer(ptrdiff_t __len, _Tp*) {
- return __get_temporary_buffer(__len, (_Tp*) 0);
-}
-
-template <class _Tp>
-void return_temporary_buffer(_Tp* __p) {
- free(__p);
-}
-
-template <class _ForwardIterator, class _Tp>
-class _Temporary_buffer {
-private:
- ptrdiff_t _M_original_len;
- ptrdiff_t _M_len;
- _Tp* _M_buffer;
-
- void _M_allocate_buffer() {
- _M_original_len = _M_len;
- _M_buffer = 0;
-
- if (_M_len > (ptrdiff_t)(INT_MAX / sizeof(_Tp)))
- _M_len = INT_MAX / sizeof(_Tp);
-
- while (_M_len > 0) {
- _M_buffer = (_Tp*) malloc(_M_len * sizeof(_Tp));
- if (_M_buffer)
- break;
- _M_len /= 2;
- }
- }
-
- void _M_initialize_buffer(const _Tp&, __true_type) {}
- void _M_initialize_buffer(const _Tp& val, __false_type) {
- uninitialized_fill_n(_M_buffer, _M_len, val);
- }
-
-public:
- ptrdiff_t size() const { return _M_len; }
- ptrdiff_t requested_size() const { return _M_original_len; }
- _Tp* begin() { return _M_buffer; }
- _Tp* end() { return _M_buffer + _M_len; }
-
- _Temporary_buffer(_ForwardIterator __first, _ForwardIterator __last) {
- typedef typename __type_traits<_Tp>::has_trivial_default_constructor
- _Trivial;
- __STL_TRY {
- _M_len = 0;
- distance(__first, __last, _M_len);
- _M_allocate_buffer();
- if (_M_len > 0)
- _M_initialize_buffer(*__first, _Trivial());
- }
- __STL_UNWIND(free(_M_buffer); _M_buffer = 0; _M_len = 0);
- }
-
- ~_Temporary_buffer() {
- destroy(_M_buffer, _M_buffer + _M_len);
- free(_M_buffer);
- }
-
-private:
- // Disable copy constructor and assignment operator.
- _Temporary_buffer(const _Temporary_buffer&) {}
- void operator=(const _Temporary_buffer&) {}
-};
-
-// Class temporary_buffer is not part of the standard. It is an extension.
-
-template <class _ForwardIterator,
- class _Tp
-#ifdef __STL_CLASS_PARTIAL_SPECIALIZATION
- = typename iterator_traits<_ForwardIterator>::value_type
-#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
- >
-struct temporary_buffer : public _Temporary_buffer<_ForwardIterator, _Tp>
-{
- temporary_buffer(_ForwardIterator __first, _ForwardIterator __last)
- : _Temporary_buffer<_ForwardIterator, _Tp>(__first, __last) {}
- ~temporary_buffer() {}
-};
-
-__STL_END_NAMESPACE
-
-#endif /* __SGI_STL_INTERNAL_TEMPBUF_H */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/contrib/libstdc++/stl/stl_tree.h b/contrib/libstdc++/stl/stl_tree.h
deleted file mode 100644
index c82943f568ab..000000000000
--- a/contrib/libstdc++/stl/stl_tree.h
+++ /dev/null
@@ -1,1333 +0,0 @@
-/*
- *
- * Copyright (c) 1996,1997
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- *
- */
-
-/* NOTE: This is an internal header file, included by other STL headers.
- * You should not attempt to use it directly.
- */
-
-#ifndef __SGI_STL_INTERNAL_TREE_H
-#define __SGI_STL_INTERNAL_TREE_H
-
-/*
-
-Red-black tree class, designed for use in implementing STL
-associative containers (set, multiset, map, and multimap). The
-insertion and deletion algorithms are based on those in Cormen,
-Leiserson, and Rivest, Introduction to Algorithms (MIT Press, 1990),
-except that
-
-(1) the header cell is maintained with links not only to the root
-but also to the leftmost node of the tree, to enable constant time
-begin(), and to the rightmost node of the tree, to enable linear time
-performance when used with the generic set algorithms (set_union,
-etc.);
-
-(2) when a node being deleted has two children its successor node is
-relinked into its place, rather than copied, so that the only
-iterators invalidated are those referring to the deleted node.
-
-*/
-
-#include <stl_algobase.h>
-#include <stl_alloc.h>
-#include <stl_construct.h>
-#include <stl_function.h>
-
-__STL_BEGIN_NAMESPACE
-
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma set woff 1375
-#endif
-
-typedef bool _Rb_tree_Color_type;
-const _Rb_tree_Color_type _S_rb_tree_red = false;
-const _Rb_tree_Color_type _S_rb_tree_black = true;
-
-struct _Rb_tree_node_base
-{
- typedef _Rb_tree_Color_type _Color_type;
- typedef _Rb_tree_node_base* _Base_ptr;
-
- _Color_type _M_color;
- _Base_ptr _M_parent;
- _Base_ptr _M_left;
- _Base_ptr _M_right;
-
- static _Base_ptr _S_minimum(_Base_ptr __x)
- {
- while (__x->_M_left != 0) __x = __x->_M_left;
- return __x;
- }
-
- static _Base_ptr _S_maximum(_Base_ptr __x)
- {
- while (__x->_M_right != 0) __x = __x->_M_right;
- return __x;
- }
-};
-
-template <class _Value>
-struct _Rb_tree_node : public _Rb_tree_node_base
-{
- typedef _Rb_tree_node<_Value>* _Link_type;
- _Value _M_value_field;
-};
-
-
-struct _Rb_tree_base_iterator
-{
- typedef _Rb_tree_node_base::_Base_ptr _Base_ptr;
- typedef bidirectional_iterator_tag iterator_category;
- typedef ptrdiff_t difference_type;
- _Base_ptr _M_node;
-
- void _M_increment()
- {
- if (_M_node->_M_right != 0) {
- _M_node = _M_node->_M_right;
- while (_M_node->_M_left != 0)
- _M_node = _M_node->_M_left;
- }
- else {
- _Base_ptr __y = _M_node->_M_parent;
- while (_M_node == __y->_M_right) {
- _M_node = __y;
- __y = __y->_M_parent;
- }
- if (_M_node->_M_right != __y)
- _M_node = __y;
- }
- }
-
- void _M_decrement()
- {
- if (_M_node->_M_color == _S_rb_tree_red &&
- _M_node->_M_parent->_M_parent == _M_node)
- _M_node = _M_node->_M_right;
- else if (_M_node->_M_left != 0) {
- _Base_ptr __y = _M_node->_M_left;
- while (__y->_M_right != 0)
- __y = __y->_M_right;
- _M_node = __y;
- }
- else {
- _Base_ptr __y = _M_node->_M_parent;
- while (_M_node == __y->_M_left) {
- _M_node = __y;
- __y = __y->_M_parent;
- }
- _M_node = __y;
- }
- }
-};
-
-template <class _Value, class _Ref, class _Ptr>
-struct _Rb_tree_iterator : public _Rb_tree_base_iterator
-{
- typedef _Value value_type;
- typedef _Ref reference;
- typedef _Ptr pointer;
- typedef _Rb_tree_iterator<_Value, _Value&, _Value*>
- iterator;
- typedef _Rb_tree_iterator<_Value, const _Value&, const _Value*>
- const_iterator;
- typedef _Rb_tree_iterator<_Value, _Ref, _Ptr>
- _Self;
- typedef _Rb_tree_node<_Value>* _Link_type;
-
- _Rb_tree_iterator() {}
- _Rb_tree_iterator(_Link_type __x) { _M_node = __x; }
- _Rb_tree_iterator(const iterator& __it) { _M_node = __it._M_node; }
-
- reference operator*() const { return _Link_type(_M_node)->_M_value_field; }
-#ifndef __SGI_STL_NO_ARROW_OPERATOR
- pointer operator->() const { return &(operator*()); }
-#endif /* __SGI_STL_NO_ARROW_OPERATOR */
-
- _Self& operator++() { _M_increment(); return *this; }
- _Self operator++(int) {
- _Self __tmp = *this;
- _M_increment();
- return __tmp;
- }
-
- _Self& operator--() { _M_decrement(); return *this; }
- _Self operator--(int) {
- _Self __tmp = *this;
- _M_decrement();
- return __tmp;
- }
-};
-
-inline bool operator==(const _Rb_tree_base_iterator& __x,
- const _Rb_tree_base_iterator& __y) {
- return __x._M_node == __y._M_node;
-}
-
-inline bool operator!=(const _Rb_tree_base_iterator& __x,
- const _Rb_tree_base_iterator& __y) {
- return __x._M_node != __y._M_node;
-}
-
-#ifndef __STL_CLASS_PARTIAL_SPECIALIZATION
-
-inline bidirectional_iterator_tag
-iterator_category(const _Rb_tree_base_iterator&) {
- return bidirectional_iterator_tag();
-}
-
-inline _Rb_tree_base_iterator::difference_type*
-distance_type(const _Rb_tree_base_iterator&) {
- return (_Rb_tree_base_iterator::difference_type*) 0;
-}
-
-template <class _Value, class _Ref, class _Ptr>
-inline _Value* value_type(const _Rb_tree_iterator<_Value, _Ref, _Ptr>&) {
- return (_Value*) 0;
-}
-
-#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
-
-inline void
-_Rb_tree_rotate_left(_Rb_tree_node_base* __x, _Rb_tree_node_base*& __root)
-{
- _Rb_tree_node_base* __y = __x->_M_right;
- __x->_M_right = __y->_M_left;
- if (__y->_M_left !=0)
- __y->_M_left->_M_parent = __x;
- __y->_M_parent = __x->_M_parent;
-
- if (__x == __root)
- __root = __y;
- else if (__x == __x->_M_parent->_M_left)
- __x->_M_parent->_M_left = __y;
- else
- __x->_M_parent->_M_right = __y;
- __y->_M_left = __x;
- __x->_M_parent = __y;
-}
-
-inline void
-_Rb_tree_rotate_right(_Rb_tree_node_base* __x, _Rb_tree_node_base*& __root)
-{
- _Rb_tree_node_base* __y = __x->_M_left;
- __x->_M_left = __y->_M_right;
- if (__y->_M_right != 0)
- __y->_M_right->_M_parent = __x;
- __y->_M_parent = __x->_M_parent;
-
- if (__x == __root)
- __root = __y;
- else if (__x == __x->_M_parent->_M_right)
- __x->_M_parent->_M_right = __y;
- else
- __x->_M_parent->_M_left = __y;
- __y->_M_right = __x;
- __x->_M_parent = __y;
-}
-
-inline void
-_Rb_tree_rebalance(_Rb_tree_node_base* __x, _Rb_tree_node_base*& __root)
-{
- __x->_M_color = _S_rb_tree_red;
- while (__x != __root && __x->_M_parent->_M_color == _S_rb_tree_red) {
- if (__x->_M_parent == __x->_M_parent->_M_parent->_M_left) {
- _Rb_tree_node_base* __y = __x->_M_parent->_M_parent->_M_right;
- if (__y && __y->_M_color == _S_rb_tree_red) {
- __x->_M_parent->_M_color = _S_rb_tree_black;
- __y->_M_color = _S_rb_tree_black;
- __x->_M_parent->_M_parent->_M_color = _S_rb_tree_red;
- __x = __x->_M_parent->_M_parent;
- }
- else {
- if (__x == __x->_M_parent->_M_right) {
- __x = __x->_M_parent;
- _Rb_tree_rotate_left(__x, __root);
- }
- __x->_M_parent->_M_color = _S_rb_tree_black;
- __x->_M_parent->_M_parent->_M_color = _S_rb_tree_red;
- _Rb_tree_rotate_right(__x->_M_parent->_M_parent, __root);
- }
- }
- else {
- _Rb_tree_node_base* __y = __x->_M_parent->_M_parent->_M_left;
- if (__y && __y->_M_color == _S_rb_tree_red) {
- __x->_M_parent->_M_color = _S_rb_tree_black;
- __y->_M_color = _S_rb_tree_black;
- __x->_M_parent->_M_parent->_M_color = _S_rb_tree_red;
- __x = __x->_M_parent->_M_parent;
- }
- else {
- if (__x == __x->_M_parent->_M_left) {
- __x = __x->_M_parent;
- _Rb_tree_rotate_right(__x, __root);
- }
- __x->_M_parent->_M_color = _S_rb_tree_black;
- __x->_M_parent->_M_parent->_M_color = _S_rb_tree_red;
- _Rb_tree_rotate_left(__x->_M_parent->_M_parent, __root);
- }
- }
- }
- __root->_M_color = _S_rb_tree_black;
-}
-
-inline _Rb_tree_node_base*
-_Rb_tree_rebalance_for_erase(_Rb_tree_node_base* __z,
- _Rb_tree_node_base*& __root,
- _Rb_tree_node_base*& __leftmost,
- _Rb_tree_node_base*& __rightmost)
-{
- _Rb_tree_node_base* __y = __z;
- _Rb_tree_node_base* __x = 0;
- _Rb_tree_node_base* __x_parent = 0;
- if (__y->_M_left == 0) // __z has at most one non-null child. y == z.
- __x = __y->_M_right; // __x might be null.
- else
- if (__y->_M_right == 0) // __z has exactly one non-null child. y == z.
- __x = __y->_M_left; // __x is not null.
- else { // __z has two non-null children. Set __y to
- __y = __y->_M_right; // __z's successor. __x might be null.
- while (__y->_M_left != 0)
- __y = __y->_M_left;
- __x = __y->_M_right;
- }
- if (__y != __z) { // relink y in place of z. y is z's successor
- __z->_M_left->_M_parent = __y;
- __y->_M_left = __z->_M_left;
- if (__y != __z->_M_right) {
- __x_parent = __y->_M_parent;
- if (__x) __x->_M_parent = __y->_M_parent;
- __y->_M_parent->_M_left = __x; // __y must be a child of _M_left
- __y->_M_right = __z->_M_right;
- __z->_M_right->_M_parent = __y;
- }
- else
- __x_parent = __y;
- if (__root == __z)
- __root = __y;
- else if (__z->_M_parent->_M_left == __z)
- __z->_M_parent->_M_left = __y;
- else
- __z->_M_parent->_M_right = __y;
- __y->_M_parent = __z->_M_parent;
- __STD::swap(__y->_M_color, __z->_M_color);
- __y = __z;
- // __y now points to node to be actually deleted
- }
- else { // __y == __z
- __x_parent = __y->_M_parent;
- if (__x) __x->_M_parent = __y->_M_parent;
- if (__root == __z)
- __root = __x;
- else
- if (__z->_M_parent->_M_left == __z)
- __z->_M_parent->_M_left = __x;
- else
- __z->_M_parent->_M_right = __x;
- if (__leftmost == __z)
- if (__z->_M_right == 0) // __z->_M_left must be null also
- __leftmost = __z->_M_parent;
- // makes __leftmost == _M_header if __z == __root
- else
- __leftmost = _Rb_tree_node_base::_S_minimum(__x);
- if (__rightmost == __z)
- if (__z->_M_left == 0) // __z->_M_right must be null also
- __rightmost = __z->_M_parent;
- // makes __rightmost == _M_header if __z == __root
- else // __x == __z->_M_left
- __rightmost = _Rb_tree_node_base::_S_maximum(__x);
- }
- if (__y->_M_color != _S_rb_tree_red) {
- while (__x != __root && (__x == 0 || __x->_M_color == _S_rb_tree_black))
- if (__x == __x_parent->_M_left) {
- _Rb_tree_node_base* __w = __x_parent->_M_right;
- if (__w->_M_color == _S_rb_tree_red) {
- __w->_M_color = _S_rb_tree_black;
- __x_parent->_M_color = _S_rb_tree_red;
- _Rb_tree_rotate_left(__x_parent, __root);
- __w = __x_parent->_M_right;
- }
- if ((__w->_M_left == 0 ||
- __w->_M_left->_M_color == _S_rb_tree_black) &&
- (__w->_M_right == 0 ||
- __w->_M_right->_M_color == _S_rb_tree_black)) {
- __w->_M_color = _S_rb_tree_red;
- __x = __x_parent;
- __x_parent = __x_parent->_M_parent;
- } else {
- if (__w->_M_right == 0 ||
- __w->_M_right->_M_color == _S_rb_tree_black) {
- if (__w->_M_left) __w->_M_left->_M_color = _S_rb_tree_black;
- __w->_M_color = _S_rb_tree_red;
- _Rb_tree_rotate_right(__w, __root);
- __w = __x_parent->_M_right;
- }
- __w->_M_color = __x_parent->_M_color;
- __x_parent->_M_color = _S_rb_tree_black;
- if (__w->_M_right) __w->_M_right->_M_color = _S_rb_tree_black;
- _Rb_tree_rotate_left(__x_parent, __root);
- break;
- }
- } else { // same as above, with _M_right <-> _M_left.
- _Rb_tree_node_base* __w = __x_parent->_M_left;
- if (__w->_M_color == _S_rb_tree_red) {
- __w->_M_color = _S_rb_tree_black;
- __x_parent->_M_color = _S_rb_tree_red;
- _Rb_tree_rotate_right(__x_parent, __root);
- __w = __x_parent->_M_left;
- }
- if ((__w->_M_right == 0 ||
- __w->_M_right->_M_color == _S_rb_tree_black) &&
- (__w->_M_left == 0 ||
- __w->_M_left->_M_color == _S_rb_tree_black)) {
- __w->_M_color = _S_rb_tree_red;
- __x = __x_parent;
- __x_parent = __x_parent->_M_parent;
- } else {
- if (__w->_M_left == 0 ||
- __w->_M_left->_M_color == _S_rb_tree_black) {
- if (__w->_M_right) __w->_M_right->_M_color = _S_rb_tree_black;
- __w->_M_color = _S_rb_tree_red;
- _Rb_tree_rotate_left(__w, __root);
- __w = __x_parent->_M_left;
- }
- __w->_M_color = __x_parent->_M_color;
- __x_parent->_M_color = _S_rb_tree_black;
- if (__w->_M_left) __w->_M_left->_M_color = _S_rb_tree_black;
- _Rb_tree_rotate_right(__x_parent, __root);
- break;
- }
- }
- if (__x) __x->_M_color = _S_rb_tree_black;
- }
- return __y;
-}
-
-// Base class to encapsulate the differences between old SGI-style
-// allocators and standard-conforming allocators. In order to avoid
-// having an empty base class, we arbitrarily move one of rb_tree's
-// data members into the base class.
-
-#ifdef __STL_USE_STD_ALLOCATORS
-
-// _Base for general standard-conforming allocators.
-template <class _Tp, class _Alloc, bool _S_instanceless>
-class _Rb_tree_alloc_base {
-public:
- typedef typename _Alloc_traits<_Tp, _Alloc>::allocator_type allocator_type;
- allocator_type get_allocator() const { return _M_node_allocator; }
-
- _Rb_tree_alloc_base(const allocator_type& __a)
- : _M_node_allocator(__a), _M_header(0) {}
-
-protected:
- typename _Alloc_traits<_Rb_tree_node<_Tp>, _Alloc>::allocator_type
- _M_node_allocator;
- _Rb_tree_node<_Tp>* _M_header;
-
- _Rb_tree_node<_Tp>* _M_get_node()
- { return _M_node_allocator.allocate(1); }
- void _M_put_node(_Rb_tree_node<_Tp>* __p)
- { _M_node_allocator.deallocate(__p, 1); }
-};
-
-// Specialization for instanceless allocators.
-template <class _Tp, class _Alloc>
-class _Rb_tree_alloc_base<_Tp, _Alloc, true> {
-public:
- typedef typename _Alloc_traits<_Tp, _Alloc>::allocator_type allocator_type;
- allocator_type get_allocator() const { return allocator_type(); }
-
- _Rb_tree_alloc_base(const allocator_type&) : _M_header(0) {}
-
-protected:
- _Rb_tree_node<_Tp>* _M_header;
-
- typedef typename _Alloc_traits<_Rb_tree_node<_Tp>, _Alloc>::_Alloc_type
- _Alloc_type;
-
- _Rb_tree_node<_Tp>* _M_get_node()
- { return _Alloc_type::allocate(1); }
- void _M_put_node(_Rb_tree_node<_Tp>* __p)
- { _Alloc_type::deallocate(__p, 1); }
-};
-
-template <class _Tp, class _Alloc>
-struct _Rb_tree_base
- : public _Rb_tree_alloc_base<_Tp, _Alloc,
- _Alloc_traits<_Tp, _Alloc>::_S_instanceless>
-{
- typedef _Rb_tree_alloc_base<_Tp, _Alloc,
- _Alloc_traits<_Tp, _Alloc>::_S_instanceless>
- _Base;
- typedef typename _Base::allocator_type allocator_type;
-
- _Rb_tree_base(const allocator_type& __a)
- : _Base(__a) { _M_header = _M_get_node(); }
- ~_Rb_tree_base() { _M_put_node(_M_header); }
-
-};
-
-#else /* __STL_USE_STD_ALLOCATORS */
-
-template <class _Tp, class _Alloc>
-struct _Rb_tree_base
-{
- typedef _Alloc allocator_type;
- allocator_type get_allocator() const { return allocator_type(); }
-
- _Rb_tree_base(const allocator_type&)
- : _M_header(0) { _M_header = _M_get_node(); }
- ~_Rb_tree_base() { _M_put_node(_M_header); }
-
-protected:
- _Rb_tree_node<_Tp>* _M_header;
-
- typedef simple_alloc<_Rb_tree_node<_Tp>, _Alloc> _Alloc_type;
-
- _Rb_tree_node<_Tp>* _M_get_node()
- { return _Alloc_type::allocate(1); }
- void _M_put_node(_Rb_tree_node<_Tp>* __p)
- { _Alloc_type::deallocate(__p, 1); }
-};
-
-#endif /* __STL_USE_STD_ALLOCATORS */
-
-template <class _Key, class _Value, class _KeyOfValue, class _Compare,
- class _Alloc = __STL_DEFAULT_ALLOCATOR(_Value) >
-class _Rb_tree : protected _Rb_tree_base<_Value, _Alloc> {
- typedef _Rb_tree_base<_Value, _Alloc> _Base;
-protected:
- typedef _Rb_tree_node_base* _Base_ptr;
- typedef _Rb_tree_node<_Value> _Rb_tree_node;
- typedef _Rb_tree_Color_type _Color_type;
-public:
- typedef _Key key_type;
- typedef _Value value_type;
- typedef value_type* pointer;
- typedef const value_type* const_pointer;
- typedef value_type& reference;
- typedef const value_type& const_reference;
- typedef _Rb_tree_node* _Link_type;
- typedef size_t size_type;
- typedef ptrdiff_t difference_type;
-
- typedef typename _Base::allocator_type allocator_type;
- allocator_type get_allocator() const { return _Base::get_allocator(); }
-
-protected:
-#ifdef __STL_USE_NAMESPACES
- using _Base::_M_get_node;
- using _Base::_M_put_node;
- using _Base::_M_header;
-#endif /* __STL_USE_NAMESPACES */
-
-protected:
-
- _Link_type _M_create_node(const value_type& __x)
- {
- _Link_type __tmp = _M_get_node();
- __STL_TRY {
- construct(&__tmp->_M_value_field, __x);
- }
- __STL_UNWIND(_M_put_node(__tmp));
- return __tmp;
- }
-
- _Link_type _M_clone_node(_Link_type __x)
- {
- _Link_type __tmp = _M_create_node(__x->_M_value_field);
- __tmp->_M_color = __x->_M_color;
- __tmp->_M_left = 0;
- __tmp->_M_right = 0;
- return __tmp;
- }
-
- void destroy_node(_Link_type __p)
- {
- destroy(&__p->_M_value_field);
- _M_put_node(__p);
- }
-
-protected:
- size_type _M_node_count; // keeps track of size of tree
- _Compare _M_key_compare;
-
- _Link_type& _M_root() const
- { return (_Link_type&) _M_header->_M_parent; }
- _Link_type& _M_leftmost() const
- { return (_Link_type&) _M_header->_M_left; }
- _Link_type& _M_rightmost() const
- { return (_Link_type&) _M_header->_M_right; }
-
- static _Link_type& _S_left(_Link_type __x)
- { return (_Link_type&)(__x->_M_left); }
- static _Link_type& _S_right(_Link_type __x)
- { return (_Link_type&)(__x->_M_right); }
- static _Link_type& _S_parent(_Link_type __x)
- { return (_Link_type&)(__x->_M_parent); }
- static reference _S_value(_Link_type __x)
- { return __x->_M_value_field; }
- static const _Key& _S_key(_Link_type __x)
- { return _KeyOfValue()(_S_value(__x)); }
- static _Color_type& _S_color(_Link_type __x)
- { return (_Color_type&)(__x->_M_color); }
-
- static _Link_type& _S_left(_Base_ptr __x)
- { return (_Link_type&)(__x->_M_left); }
- static _Link_type& _S_right(_Base_ptr __x)
- { return (_Link_type&)(__x->_M_right); }
- static _Link_type& _S_parent(_Base_ptr __x)
- { return (_Link_type&)(__x->_M_parent); }
- static reference _S_value(_Base_ptr __x)
- { return ((_Link_type)__x)->_M_value_field; }
- static const _Key& _S_key(_Base_ptr __x)
- { return _KeyOfValue()(_S_value(_Link_type(__x)));}
- static _Color_type& _S_color(_Base_ptr __x)
- { return (_Color_type&)(_Link_type(__x)->_M_color); }
-
- static _Link_type _S_minimum(_Link_type __x)
- { return (_Link_type) _Rb_tree_node_base::_S_minimum(__x); }
-
- static _Link_type _S_maximum(_Link_type __x)
- { return (_Link_type) _Rb_tree_node_base::_S_maximum(__x); }
-
-public:
- typedef _Rb_tree_iterator<value_type, reference, pointer> iterator;
- typedef _Rb_tree_iterator<value_type, const_reference, const_pointer>
- const_iterator;
-
-#ifdef __STL_CLASS_PARTIAL_SPECIALIZATION
- typedef reverse_iterator<const_iterator> const_reverse_iterator;
- typedef reverse_iterator<iterator> reverse_iterator;
-#else /* __STL_CLASS_PARTIAL_SPECIALIZATION */
- typedef reverse_bidirectional_iterator<iterator, value_type, reference,
- difference_type>
- reverse_iterator;
- typedef reverse_bidirectional_iterator<const_iterator, value_type,
- const_reference, difference_type>
- const_reverse_iterator;
-#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
-
-private:
- iterator _M_insert(_Base_ptr __x, _Base_ptr __y, const value_type& __v);
- _Link_type _M_copy(_Link_type __x, _Link_type __p);
- void _M_erase(_Link_type __x);
-
-public:
- // allocation/deallocation
- _Rb_tree()
- : _Base(allocator_type()), _M_node_count(0), _M_key_compare()
- { _M_empty_initialize(); }
-
- _Rb_tree(const _Compare& __comp)
- : _Base(allocator_type()), _M_node_count(0), _M_key_compare(__comp)
- { _M_empty_initialize(); }
-
- _Rb_tree(const _Compare& __comp, const allocator_type& __a)
- : _Base(__a), _M_node_count(0), _M_key_compare(__comp)
- { _M_empty_initialize(); }
-
- _Rb_tree(const _Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>& __x)
- : _Base(__x.get_allocator()),
- _M_node_count(0), _M_key_compare(__x._M_key_compare)
- {
- if (__x._M_root() == 0)
- _M_empty_initialize();
- else {
- _S_color(_M_header) = _S_rb_tree_red;
- _M_root() = _M_copy(__x._M_root(), _M_header);
- _M_leftmost() = _S_minimum(_M_root());
- _M_rightmost() = _S_maximum(_M_root());
- }
- _M_node_count = __x._M_node_count;
- }
- ~_Rb_tree() { clear(); }
- _Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>&
- operator=(const _Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>& __x);
-
-private:
- void _M_empty_initialize() {
- _S_color(_M_header) = _S_rb_tree_red; // used to distinguish header from
- // __root, in iterator.operator++
- _M_root() = 0;
- _M_leftmost() = _M_header;
- _M_rightmost() = _M_header;
- }
-
-public:
- // accessors:
- _Compare key_comp() const { return _M_key_compare; }
- iterator begin() { return _M_leftmost(); }
- const_iterator begin() const { return _M_leftmost(); }
- iterator end() { return _M_header; }
- const_iterator end() const { return _M_header; }
- reverse_iterator rbegin() { return reverse_iterator(end()); }
- const_reverse_iterator rbegin() const {
- return const_reverse_iterator(end());
- }
- reverse_iterator rend() { return reverse_iterator(begin()); }
- const_reverse_iterator rend() const {
- return const_reverse_iterator(begin());
- }
- bool empty() const { return _M_node_count == 0; }
- size_type size() const { return _M_node_count; }
- size_type max_size() const { return size_type(-1); }
-
- void swap(_Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>& __t) {
- __STD::swap(_M_header, __t._M_header);
- __STD::swap(_M_node_count, __t._M_node_count);
- __STD::swap(_M_key_compare, __t._M_key_compare);
- }
-
-public:
- // insert/erase
- pair<iterator,bool> insert_unique(const value_type& __x);
- iterator insert_equal(const value_type& __x);
-
- iterator insert_unique(iterator __position, const value_type& __x);
- iterator insert_equal(iterator __position, const value_type& __x);
-
-#ifdef __STL_MEMBER_TEMPLATES
- template <class _InputIterator>
- void insert_unique(_InputIterator __first, _InputIterator __last);
- template <class _InputIterator>
- void insert_equal(_InputIterator __first, _InputIterator __last);
-#else /* __STL_MEMBER_TEMPLATES */
- void insert_unique(const_iterator __first, const_iterator __last);
- void insert_unique(const value_type* __first, const value_type* __last);
- void insert_equal(const_iterator __first, const_iterator __last);
- void insert_equal(const value_type* __first, const value_type* __last);
-#endif /* __STL_MEMBER_TEMPLATES */
-
- void erase(iterator __position);
- size_type erase(const key_type& __x);
- void erase(iterator __first, iterator __last);
- void erase(const key_type* __first, const key_type* __last);
- void clear() {
- if (_M_node_count != 0) {
- _M_erase(_M_root());
- _M_leftmost() = _M_header;
- _M_root() = 0;
- _M_rightmost() = _M_header;
- _M_node_count = 0;
- }
- }
-
-public:
- // set operations:
- iterator find(const key_type& __x);
- const_iterator find(const key_type& __x) const;
- size_type count(const key_type& __x) const;
- iterator lower_bound(const key_type& __x);
- const_iterator lower_bound(const key_type& __x) const;
- iterator upper_bound(const key_type& __x);
- const_iterator upper_bound(const key_type& __x) const;
- pair<iterator,iterator> equal_range(const key_type& __x);
- pair<const_iterator, const_iterator> equal_range(const key_type& __x) const;
-
-public:
- // Debugging.
- bool __rb_verify() const;
-};
-
-template <class _Key, class _Value, class _KeyOfValue,
- class _Compare, class _Alloc>
-inline bool
-operator==(const _Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>& __x,
- const _Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>& __y)
-{
- return __x.size() == __y.size() &&
- equal(__x.begin(), __x.end(), __y.begin());
-}
-
-template <class _Key, class _Value, class _KeyOfValue,
- class _Compare, class _Alloc>
-inline bool
-operator<(const _Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>& __x,
- const _Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>& __y)
-{
- return lexicographical_compare(__x.begin(), __x.end(),
- __y.begin(), __y.end());
-}
-
-#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER
-
-template <class _Key, class _Value, class _KeyOfValue,
- class _Compare, class _Alloc>
-inline void
-swap(_Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>& __x,
- _Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>& __y)
-{
- __x.swap(__y);
-}
-
-#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */
-
-
-template <class _Key, class _Value, class _KeyOfValue,
- class _Compare, class _Alloc>
-_Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>&
-_Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>
- ::operator=(const _Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>& __x)
-{
- if (this != &__x) {
- // Note that _Key may be a constant type.
- clear();
- _M_node_count = 0;
- _M_key_compare = __x._M_key_compare;
- if (__x._M_root() == 0) {
- _M_root() = 0;
- _M_leftmost() = _M_header;
- _M_rightmost() = _M_header;
- }
- else {
- _M_root() = _M_copy(__x._M_root(), _M_header);
- _M_leftmost() = _S_minimum(_M_root());
- _M_rightmost() = _S_maximum(_M_root());
- _M_node_count = __x._M_node_count;
- }
- }
- return *this;
-}
-
-template <class _Key, class _Value, class _KeyOfValue,
- class _Compare, class _Alloc>
-typename _Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>::iterator
-_Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>
- ::_M_insert(_Base_ptr __x_, _Base_ptr __y_, const _Value& __v)
-{
- _Link_type __x = (_Link_type) __x_;
- _Link_type __y = (_Link_type) __y_;
- _Link_type __z;
-
- if (__y == _M_header || __x != 0 ||
- _M_key_compare(_KeyOfValue()(__v), _S_key(__y))) {
- __z = _M_create_node(__v);
- _S_left(__y) = __z; // also makes _M_leftmost() = __z
- // when __y == _M_header
- if (__y == _M_header) {
- _M_root() = __z;
- _M_rightmost() = __z;
- }
- else if (__y == _M_leftmost())
- _M_leftmost() = __z; // maintain _M_leftmost() pointing to min node
- }
- else {
- __z = _M_create_node(__v);
- _S_right(__y) = __z;
- if (__y == _M_rightmost())
- _M_rightmost() = __z; // maintain _M_rightmost() pointing to max node
- }
- _S_parent(__z) = __y;
- _S_left(__z) = 0;
- _S_right(__z) = 0;
- _Rb_tree_rebalance(__z, _M_header->_M_parent);
- ++_M_node_count;
- return iterator(__z);
-}
-
-template <class _Key, class _Value, class _KeyOfValue,
- class _Compare, class _Alloc>
-typename _Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>::iterator
-_Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>
- ::insert_equal(const _Value& __v)
-{
- _Link_type __y = _M_header;
- _Link_type __x = _M_root();
- while (__x != 0) {
- __y = __x;
- __x = _M_key_compare(_KeyOfValue()(__v), _S_key(__x)) ?
- _S_left(__x) : _S_right(__x);
- }
- return _M_insert(__x, __y, __v);
-}
-
-
-template <class _Key, class _Value, class _KeyOfValue,
- class _Compare, class _Alloc>
-pair<typename _Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>::iterator,
- bool>
-_Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>
- ::insert_unique(const _Value& __v)
-{
- _Link_type __y = _M_header;
- _Link_type __x = _M_root();
- bool __comp = true;
- while (__x != 0) {
- __y = __x;
- __comp = _M_key_compare(_KeyOfValue()(__v), _S_key(__x));
- __x = __comp ? _S_left(__x) : _S_right(__x);
- }
- iterator __j = iterator(__y);
- if (__comp)
- if (__j == begin())
- return pair<iterator,bool>(_M_insert(__x, __y, __v), true);
- else
- --__j;
- if (_M_key_compare(_S_key(__j._M_node), _KeyOfValue()(__v)))
- return pair<iterator,bool>(_M_insert(__x, __y, __v), true);
- return pair<iterator,bool>(__j, false);
-}
-
-
-template <class _Key, class _Val, class _KeyOfValue,
- class _Compare, class _Alloc>
-typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator
-_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>
- ::insert_unique(iterator __position, const _Val& __v)
-{
- if (__position._M_node == _M_header->_M_left) { // begin()
- if (size() > 0 &&
- _M_key_compare(_KeyOfValue()(__v), _S_key(__position._M_node)))
- return _M_insert(__position._M_node, __position._M_node, __v);
- // first argument just needs to be non-null
- else
- return insert_unique(__v).first;
- } else if (__position._M_node == _M_header) { // end()
- if (_M_key_compare(_S_key(_M_rightmost()), _KeyOfValue()(__v)))
- return _M_insert(0, _M_rightmost(), __v);
- else
- return insert_unique(__v).first;
- } else {
- iterator __before = __position;
- --__before;
- if (_M_key_compare(_S_key(__before._M_node), _KeyOfValue()(__v))
- && _M_key_compare(_KeyOfValue()(__v), _S_key(__position._M_node))) {
- if (_S_right(__before._M_node) == 0)
- return _M_insert(0, __before._M_node, __v);
- else
- return _M_insert(__position._M_node, __position._M_node, __v);
- // first argument just needs to be non-null
- } else
- return insert_unique(__v).first;
- }
-}
-
-template <class _Key, class _Val, class _KeyOfValue,
- class _Compare, class _Alloc>
-typename _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::iterator
-_Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>
- ::insert_equal(iterator __position, const _Val& __v)
-{
- if (__position._M_node == _M_header->_M_left) { // begin()
- if (size() > 0 &&
- _M_key_compare(_KeyOfValue()(__v), _S_key(__position._M_node)))
- return _M_insert(__position._M_node, __position._M_node, __v);
- // first argument just needs to be non-null
- else
- return insert_equal(__v);
- } else if (__position._M_node == _M_header) {// end()
- if (!_M_key_compare(_KeyOfValue()(__v), _S_key(_M_rightmost())))
- return _M_insert(0, _M_rightmost(), __v);
- else
- return insert_equal(__v);
- } else {
- iterator __before = __position;
- --__before;
- if (!_M_key_compare(_KeyOfValue()(__v), _S_key(__before._M_node))
- && !_M_key_compare(_S_key(__position._M_node), _KeyOfValue()(__v))) {
- if (_S_right(__before._M_node) == 0)
- return _M_insert(0, __before._M_node, __v);
- else
- return _M_insert(__position._M_node, __position._M_node, __v);
- // first argument just needs to be non-null
- } else
- return insert_equal(__v);
- }
-}
-
-#ifdef __STL_MEMBER_TEMPLATES
-
-template <class _Key, class _Val, class _KoV, class _Cmp, class _Alloc>
- template<class _II>
-void _Rb_tree<_Key,_Val,_KoV,_Cmp,_Alloc>
- ::insert_equal(_II __first, _II __last)
-{
- for ( ; __first != __last; ++__first)
- insert_equal(*__first);
-}
-
-template <class _Key, class _Val, class _KoV, class _Cmp, class _Alloc>
- template<class _II>
-void _Rb_tree<_Key,_Val,_KoV,_Cmp,_Alloc>
- ::insert_unique(_II __first, _II __last) {
- for ( ; __first != __last; ++__first)
- insert_unique(*__first);
-}
-
-#else /* __STL_MEMBER_TEMPLATES */
-
-template <class _Key, class _Val, class _KoV, class _Cmp, class _Alloc>
-void
-_Rb_tree<_Key,_Val,_KoV,_Cmp,_Alloc>
- ::insert_equal(const _Val* __first, const _Val* __last)
-{
- for ( ; __first != __last; ++__first)
- insert_equal(*__first);
-}
-
-template <class _Key, class _Val, class _KoV, class _Cmp, class _Alloc>
-void
-_Rb_tree<_Key,_Val,_KoV,_Cmp,_Alloc>
- ::insert_equal(const_iterator __first, const_iterator __last)
-{
- for ( ; __first != __last; ++__first)
- insert_equal(*__first);
-}
-
-template <class _Key, class _Val, class _KoV, class _Cmp, class _Alloc>
-void
-_Rb_tree<_Key,_Val,_KoV,_Cmp,_Alloc>
- ::insert_unique(const _Val* __first, const _Val* __last)
-{
- for ( ; __first != __last; ++__first)
- insert_unique(*__first);
-}
-
-template <class _Key, class _Val, class _KoV, class _Cmp, class _Alloc>
-void _Rb_tree<_Key,_Val,_KoV,_Cmp,_Alloc>
- ::insert_unique(const_iterator __first, const_iterator __last)
-{
- for ( ; __first != __last; ++__first)
- insert_unique(*__first);
-}
-
-#endif /* __STL_MEMBER_TEMPLATES */
-
-template <class _Key, class _Value, class _KeyOfValue,
- class _Compare, class _Alloc>
-inline void _Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>
- ::erase(iterator __position)
-{
- _Link_type __y =
- (_Link_type) _Rb_tree_rebalance_for_erase(__position._M_node,
- _M_header->_M_parent,
- _M_header->_M_left,
- _M_header->_M_right);
- destroy_node(__y);
- --_M_node_count;
-}
-
-template <class _Key, class _Value, class _KeyOfValue,
- class _Compare, class _Alloc>
-typename _Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>::size_type
-_Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>::erase(const _Key& __x)
-{
- pair<iterator,iterator> __p = equal_range(__x);
- size_type __n = 0;
- distance(__p.first, __p.second, __n);
- erase(__p.first, __p.second);
- return __n;
-}
-
-template <class _Key, class _Val, class _KoV, class _Compare, class _Alloc>
-typename _Rb_tree<_Key, _Val, _KoV, _Compare, _Alloc>::_Link_type
-_Rb_tree<_Key,_Val,_KoV,_Compare,_Alloc>
- ::_M_copy(_Link_type __x, _Link_type __p)
-{
- // structural copy. __x and __p must be non-null.
- _Link_type __top = _M_clone_node(__x);
- __top->_M_parent = __p;
-
- __STL_TRY {
- if (__x->_M_right)
- __top->_M_right = _M_copy(_S_right(__x), __top);
- __p = __top;
- __x = _S_left(__x);
-
- while (__x != 0) {
- _Link_type __y = _M_clone_node(__x);
- __p->_M_left = __y;
- __y->_M_parent = __p;
- if (__x->_M_right)
- __y->_M_right = _M_copy(_S_right(__x), __y);
- __p = __y;
- __x = _S_left(__x);
- }
- }
- __STL_UNWIND(_M_erase(__top));
-
- return __top;
-}
-
-template <class _Key, class _Value, class _KeyOfValue,
- class _Compare, class _Alloc>
-void _Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>
- ::_M_erase(_Link_type __x)
-{
- // erase without rebalancing
- while (__x != 0) {
- _M_erase(_S_right(__x));
- _Link_type __y = _S_left(__x);
- destroy_node(__x);
- __x = __y;
- }
-}
-
-template <class _Key, class _Value, class _KeyOfValue,
- class _Compare, class _Alloc>
-void _Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>
- ::erase(iterator __first, iterator __last)
-{
- if (__first == begin() && __last == end())
- clear();
- else
- while (__first != __last) erase(__first++);
-}
-
-template <class _Key, class _Value, class _KeyOfValue,
- class _Compare, class _Alloc>
-void _Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>
- ::erase(const _Key* __first, const _Key* __last)
-{
- while (__first != __last) erase(*__first++);
-}
-
-template <class _Key, class _Value, class _KeyOfValue,
- class _Compare, class _Alloc>
-typename _Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>::iterator
-_Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>::find(const _Key& __k)
-{
- _Link_type __y = _M_header; // Last node which is not less than __k.
- _Link_type __x = _M_root(); // Current node.
-
- while (__x != 0)
- if (!_M_key_compare(_S_key(__x), __k))
- __y = __x, __x = _S_left(__x);
- else
- __x = _S_right(__x);
-
- iterator __j = iterator(__y);
- return (__j == end() || _M_key_compare(__k, _S_key(__j._M_node))) ?
- end() : __j;
-}
-
-template <class _Key, class _Value, class _KeyOfValue,
- class _Compare, class _Alloc>
-typename _Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>::const_iterator
-_Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>::find(const _Key& __k) const
-{
- _Link_type __y = _M_header; /* Last node which is not less than __k. */
- _Link_type __x = _M_root(); /* Current node. */
-
- while (__x != 0) {
- if (!_M_key_compare(_S_key(__x), __k))
- __y = __x, __x = _S_left(__x);
- else
- __x = _S_right(__x);
- }
- const_iterator __j = const_iterator(__y);
- return (__j == end() || _M_key_compare(__k, _S_key(__j._M_node))) ?
- end() : __j;
-}
-
-template <class _Key, class _Value, class _KeyOfValue,
- class _Compare, class _Alloc>
-typename _Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>::size_type
-_Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>
- ::count(const _Key& __k) const
-{
- pair<const_iterator, const_iterator> __p = equal_range(__k);
- size_type __n = 0;
- distance(__p.first, __p.second, __n);
- return __n;
-}
-
-template <class _Key, class _Value, class _KeyOfValue,
- class _Compare, class _Alloc>
-typename _Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>::iterator
-_Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>
- ::lower_bound(const _Key& __k)
-{
- _Link_type __y = _M_header; /* Last node which is not less than __k. */
- _Link_type __x = _M_root(); /* Current node. */
-
- while (__x != 0)
- if (!_M_key_compare(_S_key(__x), __k))
- __y = __x, __x = _S_left(__x);
- else
- __x = _S_right(__x);
-
- return iterator(__y);
-}
-
-template <class _Key, class _Value, class _KeyOfValue,
- class _Compare, class _Alloc>
-typename _Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>::const_iterator
-_Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>
- ::lower_bound(const _Key& __k) const
-{
- _Link_type __y = _M_header; /* Last node which is not less than __k. */
- _Link_type __x = _M_root(); /* Current node. */
-
- while (__x != 0)
- if (!_M_key_compare(_S_key(__x), __k))
- __y = __x, __x = _S_left(__x);
- else
- __x = _S_right(__x);
-
- return const_iterator(__y);
-}
-
-template <class _Key, class _Value, class _KeyOfValue,
- class _Compare, class _Alloc>
-typename _Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>::iterator
-_Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>
- ::upper_bound(const _Key& __k)
-{
- _Link_type __y = _M_header; /* Last node which is greater than __k. */
- _Link_type __x = _M_root(); /* Current node. */
-
- while (__x != 0)
- if (_M_key_compare(__k, _S_key(__x)))
- __y = __x, __x = _S_left(__x);
- else
- __x = _S_right(__x);
-
- return iterator(__y);
-}
-
-template <class _Key, class _Value, class _KeyOfValue,
- class _Compare, class _Alloc>
-typename _Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>::const_iterator
-_Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>
- ::upper_bound(const _Key& __k) const
-{
- _Link_type __y = _M_header; /* Last node which is greater than __k. */
- _Link_type __x = _M_root(); /* Current node. */
-
- while (__x != 0)
- if (_M_key_compare(__k, _S_key(__x)))
- __y = __x, __x = _S_left(__x);
- else
- __x = _S_right(__x);
-
- return const_iterator(__y);
-}
-
-template <class _Key, class _Value, class _KeyOfValue,
- class _Compare, class _Alloc>
-inline
-pair<typename _Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>::iterator,
- typename _Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>::iterator>
-_Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>
- ::equal_range(const _Key& __k)
-{
- return pair<iterator, iterator>(lower_bound(__k), upper_bound(__k));
-}
-
-template <class _Key, class _Value, class _KoV, class _Compare, class _Alloc>
-inline
-pair<typename _Rb_tree<_Key, _Value, _KoV, _Compare, _Alloc>::const_iterator,
- typename _Rb_tree<_Key, _Value, _KoV, _Compare, _Alloc>::const_iterator>
-_Rb_tree<_Key, _Value, _KoV, _Compare, _Alloc>
- ::equal_range(const _Key& __k) const
-{
- return pair<const_iterator,const_iterator>(lower_bound(__k),
- upper_bound(__k));
-}
-
-inline int
-__black_count(_Rb_tree_node_base* __node, _Rb_tree_node_base* __root)
-{
- if (__node == 0)
- return 0;
- else {
- int __bc = __node->_M_color == _S_rb_tree_black ? 1 : 0;
- if (__node == __root)
- return __bc;
- else
- return __bc + __black_count(__node->_M_parent, __root);
- }
-}
-
-template <class _Key, class _Value, class _KeyOfValue,
- class _Compare, class _Alloc>
-bool _Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>::__rb_verify() const
-{
- if (_M_node_count == 0 || begin() == end())
- return _M_node_count == 0 && begin() == end() &&
- _M_header->_M_left == _M_header && _M_header->_M_right == _M_header;
-
- int __len = __black_count(_M_leftmost(), _M_root());
- for (const_iterator __it = begin(); __it != end(); ++__it) {
- _Link_type __x = (_Link_type) __it._M_node;
- _Link_type __L = _S_left(__x);
- _Link_type __R = _S_right(__x);
-
- if (__x->_M_color == _S_rb_tree_red)
- if ((__L && __L->_M_color == _S_rb_tree_red) ||
- (__R && __R->_M_color == _S_rb_tree_red))
- return false;
-
- if (__L && _M_key_compare(_S_key(__x), _S_key(__L)))
- return false;
- if (__R && _M_key_compare(_S_key(__R), _S_key(__x)))
- return false;
-
- if (!__L && !__R && __black_count(__x, _M_root()) != __len)
- return false;
- }
-
- if (_M_leftmost() != _Rb_tree_node_base::_S_minimum(_M_root()))
- return false;
- if (_M_rightmost() != _Rb_tree_node_base::_S_maximum(_M_root()))
- return false;
-
- return true;
-}
-
-// Class rb_tree is not part of the C++ standard. It is provided for
-// compatibility with the HP STL.
-
-template <class _Key, class _Value, class _KeyOfValue, class _Compare,
- class _Alloc = __STL_DEFAULT_ALLOCATOR(_Value) >
-struct rb_tree : public _Rb_tree<_Key, _Value, _KeyOfValue, _Compare, _Alloc>
-{
- typedef _Rb_tree<_Key, _Value, _KeyOfValue, _Compare, _Alloc> _Base;
- typedef typename _Base::allocator_type allocator_type;
-
- rb_tree(const _Compare& __comp = _Compare(),
- const allocator_type& __a = allocator_type())
- : _Base(__comp, __a) {}
-
- ~rb_tree() {}
-};
-
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma reset woff 1375
-#endif
-
-__STL_END_NAMESPACE
-
-#endif /* __SGI_STL_INTERNAL_TREE_H */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/contrib/libstdc++/stl/stl_uninitialized.h b/contrib/libstdc++/stl/stl_uninitialized.h
deleted file mode 100644
index 3146c82a71c9..000000000000
--- a/contrib/libstdc++/stl/stl_uninitialized.h
+++ /dev/null
@@ -1,279 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- *
- * Copyright (c) 1996,1997
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- */
-
-/* NOTE: This is an internal header file, included by other STL headers.
- * You should not attempt to use it directly.
- */
-
-#ifndef __SGI_STL_INTERNAL_UNINITIALIZED_H
-#define __SGI_STL_INTERNAL_UNINITIALIZED_H
-
-__STL_BEGIN_NAMESPACE
-
-// uninitialized_copy
-
-// Valid if copy construction is equivalent to assignment, and if the
-// destructor is trivial.
-template <class _InputIter, class _ForwardIter>
-inline _ForwardIter
-__uninitialized_copy_aux(_InputIter __first, _InputIter __last,
- _ForwardIter __result,
- __true_type)
-{
- return copy(__first, __last, __result);
-}
-
-template <class _InputIter, class _ForwardIter>
-_ForwardIter
-__uninitialized_copy_aux(_InputIter __first, _InputIter __last,
- _ForwardIter __result,
- __false_type)
-{
- _ForwardIter __cur = __result;
- __STL_TRY {
- for ( ; __first != __last; ++__first, ++__cur)
- construct(&*__cur, *__first);
- return __cur;
- }
- __STL_UNWIND(destroy(__result, __cur));
-}
-
-
-template <class _InputIter, class _ForwardIter, class _Tp>
-inline _ForwardIter
-__uninitialized_copy(_InputIter __first, _InputIter __last,
- _ForwardIter __result, _Tp*)
-{
- typedef typename __type_traits<_Tp>::is_POD_type _Is_POD;
- return __uninitialized_copy_aux(__first, __last, __result, _Is_POD());
-}
-
-template <class _InputIter, class _ForwardIter>
-inline _ForwardIter
- uninitialized_copy(_InputIter __first, _InputIter __last,
- _ForwardIter __result)
-{
- return __uninitialized_copy(__first, __last, __result,
- __VALUE_TYPE(__result));
-}
-
-inline char* uninitialized_copy(const char* __first, const char* __last,
- char* __result) {
- memmove(__result, __first, __last - __first);
- return __result + (__last - __first);
-}
-
-inline wchar_t*
-uninitialized_copy(const wchar_t* __first, const wchar_t* __last,
- wchar_t* __result)
-{
- memmove(__result, __first, sizeof(wchar_t) * (__last - __first));
- return __result + (__last - __first);
-}
-
-// uninitialized_copy_n (not part of the C++ standard)
-
-template <class _InputIter, class _Size, class _ForwardIter>
-pair<_InputIter, _ForwardIter>
-__uninitialized_copy_n(_InputIter __first, _Size __count,
- _ForwardIter __result,
- input_iterator_tag)
-{
- _ForwardIter __cur = __result;
- __STL_TRY {
- for ( ; __count > 0 ; --__count, ++__first, ++__cur)
- construct(&*__cur, *__first);
- return pair<_InputIter, _ForwardIter>(__first, __cur);
- }
- __STL_UNWIND(destroy(__result, __cur));
-}
-
-template <class _RandomAccessIter, class _Size, class _ForwardIter>
-inline pair<_RandomAccessIter, _ForwardIter>
-__uninitialized_copy_n(_RandomAccessIter __first, _Size __count,
- _ForwardIter __result,
- random_access_iterator_tag) {
- _RandomAccessIter __last = __first + __count;
- return pair<_RandomAccessIter, _ForwardIter>(
- __last,
- uninitialized_copy(__first, __last, __result));
-}
-
-template <class _InputIter, class _Size, class _ForwardIter>
-inline pair<_InputIter, _ForwardIter>
-__uninitialized_copy_n(_InputIter __first, _Size __count,
- _ForwardIter __result) {
- return __uninitialized_copy_n(__first, __count, __result,
- __ITERATOR_CATEGORY(__first));
-}
-
-template <class _InputIter, class _Size, class _ForwardIter>
-inline pair<_InputIter, _ForwardIter>
-uninitialized_copy_n(_InputIter __first, _Size __count,
- _ForwardIter __result) {
- return __uninitialized_copy_n(__first, __count, __result,
- __ITERATOR_CATEGORY(__first));
-}
-
-// Valid if copy construction is equivalent to assignment, and if the
-// destructor is trivial.
-template <class _ForwardIter, class _Tp>
-inline void
-__uninitialized_fill_aux(_ForwardIter __first, _ForwardIter __last,
- const _Tp& __x, __true_type)
-{
- fill(__first, __last, __x);
-}
-
-template <class _ForwardIter, class _Tp>
-void
-__uninitialized_fill_aux(_ForwardIter __first, _ForwardIter __last,
- const _Tp& __x, __false_type)
-{
- _ForwardIter __cur = __first;
- __STL_TRY {
- for ( ; __cur != __last; ++__cur)
- construct(&*__cur, __x);
- }
- __STL_UNWIND(destroy(__first, __cur));
-}
-
-template <class _ForwardIter, class _Tp, class _Tp1>
-inline void __uninitialized_fill(_ForwardIter __first,
- _ForwardIter __last, const _Tp& __x, _Tp1*)
-{
- typedef typename __type_traits<_Tp1>::is_POD_type _Is_POD;
- __uninitialized_fill_aux(__first, __last, __x, _Is_POD());
-
-}
-
-template <class _ForwardIter, class _Tp>
-inline void uninitialized_fill(_ForwardIter __first,
- _ForwardIter __last,
- const _Tp& __x)
-{
- __uninitialized_fill(__first, __last, __x, __VALUE_TYPE(__first));
-}
-
-// Valid if copy construction is equivalent to assignment, and if the
-// destructor is trivial.
-template <class _ForwardIter, class _Size, class _Tp>
-inline _ForwardIter
-__uninitialized_fill_n_aux(_ForwardIter __first, _Size __n,
- const _Tp& __x, __true_type)
-{
- return fill_n(__first, __n, __x);
-}
-
-template <class _ForwardIter, class _Size, class _Tp>
-_ForwardIter
-__uninitialized_fill_n_aux(_ForwardIter __first, _Size __n,
- const _Tp& __x, __false_type)
-{
- _ForwardIter __cur = __first;
- __STL_TRY {
- for ( ; __n > 0; --__n, ++__cur)
- construct(&*__cur, __x);
- return __cur;
- }
- __STL_UNWIND(destroy(__first, __cur));
-}
-
-template <class _ForwardIter, class _Size, class _Tp, class _Tp1>
-inline _ForwardIter
-__uninitialized_fill_n(_ForwardIter __first, _Size __n, const _Tp& __x, _Tp1*)
-{
- typedef typename __type_traits<_Tp1>::is_POD_type _Is_POD;
- return __uninitialized_fill_n_aux(__first, __n, __x, _Is_POD());
-}
-
-template <class _ForwardIter, class _Size, class _Tp>
-inline _ForwardIter
-uninitialized_fill_n(_ForwardIter __first, _Size __n, const _Tp& __x)
-{
- return __uninitialized_fill_n(__first, __n, __x, __VALUE_TYPE(__first));
-}
-
-// Extensions: __uninitialized_copy_copy, __uninitialized_copy_fill,
-// __uninitialized_fill_copy.
-
-// __uninitialized_copy_copy
-// Copies [first1, last1) into [result, result + (last1 - first1)), and
-// copies [first2, last2) into
-// [result, result + (last1 - first1) + (last2 - first2)).
-
-template <class _InputIter1, class _InputIter2, class _ForwardIter>
-inline _ForwardIter
-__uninitialized_copy_copy(_InputIter1 __first1, _InputIter1 __last1,
- _InputIter2 __first2, _InputIter2 __last2,
- _ForwardIter __result)
-{
- _ForwardIter __mid = uninitialized_copy(__first1, __last1, __result);
- __STL_TRY {
- return uninitialized_copy(__first2, __last2, __mid);
- }
- __STL_UNWIND(destroy(__result, __mid));
-}
-
-// __uninitialized_fill_copy
-// Fills [result, mid) with x, and copies [first, last) into
-// [mid, mid + (last - first)).
-template <class _ForwardIter, class _Tp, class _InputIter>
-inline _ForwardIter
-__uninitialized_fill_copy(_ForwardIter __result, _ForwardIter __mid,
- const _Tp& __x,
- _InputIter __first, _InputIter __last)
-{
- uninitialized_fill(__result, __mid, __x);
- __STL_TRY {
- return uninitialized_copy(__first, __last, __mid);
- }
- __STL_UNWIND(destroy(__result, __mid));
-}
-
-// __uninitialized_copy_fill
-// Copies [first1, last1) into [first2, first2 + (last1 - first1)), and
-// fills [first2 + (last1 - first1), last2) with x.
-template <class _InputIter, class _ForwardIter, class _Tp>
-inline void
-__uninitialized_copy_fill(_InputIter __first1, _InputIter __last1,
- _ForwardIter __first2, _ForwardIter __last2,
- const _Tp& __x)
-{
- _ForwardIter __mid2 = uninitialized_copy(__first1, __last1, __first2);
- __STL_TRY {
- uninitialized_fill(__mid2, __last2, __x);
- }
- __STL_UNWIND(destroy(__first2, __mid2));
-}
-
-__STL_END_NAMESPACE
-
-#endif /* __SGI_STL_INTERNAL_UNINITIALIZED_H */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/contrib/libstdc++/stl/stl_vector.h b/contrib/libstdc++/stl/stl_vector.h
deleted file mode 100644
index d1149e9af66d..000000000000
--- a/contrib/libstdc++/stl/stl_vector.h
+++ /dev/null
@@ -1,823 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- *
- * Copyright (c) 1996
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- */
-
-/* NOTE: This is an internal header file, included by other STL headers.
- * You should not attempt to use it directly.
- */
-
-#ifndef __SGI_STL_INTERNAL_VECTOR_H
-#define __SGI_STL_INTERNAL_VECTOR_H
-
-__STL_BEGIN_NAMESPACE
-
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma set woff 1174
-#pragma set woff 1375
-#endif
-
-// The vector base class serves two purposes. First, its constructor
-// and destructor allocate (but don't initialize) storage. This makes
-// exception safety easier. Second, the base class encapsulates all of
-// the differences between SGI-style allocators and standard-conforming
-// allocators.
-
-#ifdef __STL_USE_STD_ALLOCATORS
-
-// Base class for ordinary allocators.
-template <class _Tp, class _Allocator, bool _IsStatic>
-class _Vector_alloc_base {
-public:
- typedef typename _Alloc_traits<_Tp, _Allocator>::allocator_type
- allocator_type;
- allocator_type get_allocator() const { return _M_data_allocator; }
-
- _Vector_alloc_base(const allocator_type& __a)
- : _M_data_allocator(__a), _M_start(0), _M_finish(0), _M_end_of_storage(0)
- {}
-
-protected:
- allocator_type _M_data_allocator;
- _Tp* _M_start;
- _Tp* _M_finish;
- _Tp* _M_end_of_storage;
-
- _Tp* _M_allocate(size_t __n)
- { return _M_data_allocator.allocate(__n); }
- void _M_deallocate(_Tp* __p, size_t __n)
- { if (__p) _M_data_allocator.deallocate(__p, __n); }
-};
-
-// Specialization for allocators that have the property that we don't
-// actually have to store an allocator object.
-template <class _Tp, class _Allocator>
-class _Vector_alloc_base<_Tp, _Allocator, true> {
-public:
- typedef typename _Alloc_traits<_Tp, _Allocator>::allocator_type
- allocator_type;
- allocator_type get_allocator() const { return allocator_type(); }
-
- _Vector_alloc_base(const allocator_type&)
- : _M_start(0), _M_finish(0), _M_end_of_storage(0)
- {}
-
-protected:
- _Tp* _M_start;
- _Tp* _M_finish;
- _Tp* _M_end_of_storage;
-
- typedef typename _Alloc_traits<_Tp, _Allocator>::_Alloc_type _Alloc_type;
- _Tp* _M_allocate(size_t __n)
- { return _Alloc_type::allocate(__n); }
- void _M_deallocate(_Tp* __p, size_t __n)
- { _Alloc_type::deallocate(__p, __n);}
-};
-
-template <class _Tp, class _Alloc>
-struct _Vector_base
- : public _Vector_alloc_base<_Tp, _Alloc,
- _Alloc_traits<_Tp, _Alloc>::_S_instanceless>
-{
- typedef _Vector_alloc_base<_Tp, _Alloc,
- _Alloc_traits<_Tp, _Alloc>::_S_instanceless>
- _Base;
- typedef typename _Base::allocator_type allocator_type;
-
- _Vector_base(const allocator_type& __a) : _Base(__a) {}
- _Vector_base(size_t __n, const allocator_type& __a) : _Base(__a) {
- _M_start = _M_allocate(__n);
- _M_finish = _M_start;
- _M_end_of_storage = _M_start + __n;
- }
-
- ~_Vector_base() { _M_deallocate(_M_start, _M_end_of_storage - _M_start); }
-};
-
-#else /* __STL_USE_STD_ALLOCATORS */
-
-template <class _Tp, class _Alloc>
-class _Vector_base {
-public:
- typedef _Alloc allocator_type;
- allocator_type get_allocator() const { return allocator_type(); }
-
- _Vector_base(const _Alloc&)
- : _M_start(0), _M_finish(0), _M_end_of_storage(0) {}
- _Vector_base(size_t __n, const _Alloc&)
- : _M_start(0), _M_finish(0), _M_end_of_storage(0)
- {
- _M_start = _M_allocate(__n);
- _M_finish = _M_start;
- _M_end_of_storage = _M_start + __n;
- }
-
- ~_Vector_base() { _M_deallocate(_M_start, _M_end_of_storage - _M_start); }
-
-protected:
- _Tp* _M_start;
- _Tp* _M_finish;
- _Tp* _M_end_of_storage;
-
- typedef simple_alloc<_Tp, _Alloc> _M_data_allocator;
- _Tp* _M_allocate(size_t __n)
- { return _M_data_allocator::allocate(__n); }
- void _M_deallocate(_Tp* __p, size_t __n)
- { _M_data_allocator::deallocate(__p, __n); }
-};
-
-#endif /* __STL_USE_STD_ALLOCATORS */
-
-template <class _Tp, class _Alloc = __STL_DEFAULT_ALLOCATOR(_Tp) >
-class vector : protected _Vector_base<_Tp, _Alloc>
-{
-private:
- typedef _Vector_base<_Tp, _Alloc> _Base;
-public:
- typedef _Tp value_type;
- typedef value_type* pointer;
- typedef const value_type* const_pointer;
- typedef value_type* iterator;
- typedef const value_type* const_iterator;
- typedef value_type& reference;
- typedef const value_type& const_reference;
- typedef size_t size_type;
- typedef ptrdiff_t difference_type;
-
- typedef typename _Base::allocator_type allocator_type;
- allocator_type get_allocator() const { return _Base::get_allocator(); }
-
-#ifdef __STL_CLASS_PARTIAL_SPECIALIZATION
- typedef reverse_iterator<const_iterator> const_reverse_iterator;
- typedef reverse_iterator<iterator> reverse_iterator;
-#else /* __STL_CLASS_PARTIAL_SPECIALIZATION */
- typedef reverse_iterator<const_iterator, value_type, const_reference,
- difference_type> const_reverse_iterator;
- typedef reverse_iterator<iterator, value_type, reference, difference_type>
- reverse_iterator;
-#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
-
-protected:
-#ifdef __STL_HAS_NAMESPACES
- using _Base::_M_allocate;
- using _Base::_M_deallocate;
- using _Base::_M_start;
- using _Base::_M_finish;
- using _Base::_M_end_of_storage;
-#endif /* __STL_HAS_NAMESPACES */
-
-protected:
- void _M_insert_aux(iterator __position, const _Tp& __x);
- void _M_insert_aux(iterator __position);
-
-public:
- iterator begin() { return _M_start; }
- const_iterator begin() const { return _M_start; }
- iterator end() { return _M_finish; }
- const_iterator end() const { return _M_finish; }
-
- reverse_iterator rbegin()
- { return reverse_iterator(end()); }
- const_reverse_iterator rbegin() const
- { return const_reverse_iterator(end()); }
- reverse_iterator rend()
- { return reverse_iterator(begin()); }
- const_reverse_iterator rend() const
- { return const_reverse_iterator(begin()); }
-
- size_type size() const
- { return size_type(end() - begin()); }
- size_type max_size() const
- { return size_type(-1) / sizeof(_Tp); }
- size_type capacity() const
- { return size_type(_M_end_of_storage - begin()); }
- bool empty() const
- { return begin() == end(); }
-
- reference operator[](size_type __n) { return *(begin() + __n); }
- const_reference operator[](size_type __n) const { return *(begin() + __n); }
-
- explicit vector(const allocator_type& __a = allocator_type())
- : _Base(__a) {}
-
- vector(size_type __n, const _Tp& __value,
- const allocator_type& __a = allocator_type())
- : _Base(__n, __a)
- { _M_finish = uninitialized_fill_n(_M_start, __n, __value); }
-
- explicit vector(size_type __n)
- : _Base(__n, allocator_type())
- { _M_finish = uninitialized_fill_n(_M_start, __n, _Tp()); }
-
- vector(const vector<_Tp, _Alloc>& __x)
- : _Base(__x.size(), __x.get_allocator())
- { _M_finish = uninitialized_copy(__x.begin(), __x.end(), _M_start); }
-
-#ifdef __STL_MEMBER_TEMPLATES
- // Check whether it's an integral type. If so, it's not an iterator.
- template <class _InputIterator>
- vector(_InputIterator __first, _InputIterator __last,
- const allocator_type& __a = allocator_type()) : _Base(__a) {
- typedef typename _Is_integer<_InputIterator>::_Integral _Integral;
- _M_initialize_aux(__first, __last, _Integral());
- }
-
- template <class _Integer>
- void _M_initialize_aux(_Integer __n, _Integer __value, __true_type) {
- _M_start = _M_allocate(__n);
- _M_end_of_storage = _M_start + __n;
- _M_finish = uninitialized_fill_n(_M_start, __n, __value);
- }
-
- template <class _InputIterator>
- void _M_initialize_aux(_InputIterator __first, _InputIterator __last,
- __false_type) {
- _M_range_initialize(__first, __last, __ITERATOR_CATEGORY(__first));
- }
-
-#else
- vector(const _Tp* __first, const _Tp* __last,
- const allocator_type& __a = allocator_type())
- : _Base(__last - __first, __a)
- { _M_finish = uninitialized_copy(__first, __last, _M_start); }
-#endif /* __STL_MEMBER_TEMPLATES */
-
- ~vector() { destroy(_M_start, _M_finish); }
-
- vector<_Tp, _Alloc>& operator=(const vector<_Tp, _Alloc>& __x);
- void reserve(size_type __n) {
- if (capacity() < __n) {
- const size_type __old_size = size();
- iterator __tmp = _M_allocate_and_copy(__n, _M_start, _M_finish);
- destroy(_M_start, _M_finish);
- _M_deallocate(_M_start, _M_end_of_storage - _M_start);
- _M_start = __tmp;
- _M_finish = __tmp + __old_size;
- _M_end_of_storage = _M_start + __n;
- }
- }
-
- // assign(), a generalized assignment member function. Two
- // versions: one that takes a count, and one that takes a range.
- // The range version is a member template, so we dispatch on whether
- // or not the type is an integer.
-
- void assign(size_type __n, const _Tp& __val);
-
-#ifdef __STL_MEMBER_TEMPLATES
-
- template <class _InputIterator>
- void assign(_InputIterator __first, _InputIterator __last) {
- typedef typename _Is_integer<_InputIterator>::_Integral _Integral;
- _M_assign_dispatch(__first, __last, _Integral());
- }
-
- template <class _Integer>
- void _M_assign_dispatch(_Integer __n, _Integer __val, __true_type)
- { assign((size_type) __n, (_Tp) __val); }
-
- template <class _InputIter>
- void _M_assign_dispatch(_InputIter __first, _InputIter __last, __false_type)
- { _M_assign_aux(__first, __last, __ITERATOR_CATEGORY(__first)); }
-
- template <class _InputIterator>
- void _M_assign_aux(_InputIterator __first, _InputIterator __last,
- input_iterator_tag);
-
- template <class _ForwardIterator>
- void _M_assign_aux(_ForwardIterator __first, _ForwardIterator __last,
- forward_iterator_tag);
-
-#endif /* __STL_MEMBER_TEMPLATES */
-
- reference front() { return *begin(); }
- const_reference front() const { return *begin(); }
- reference back() { return *(end() - 1); }
- const_reference back() const { return *(end() - 1); }
-
- void push_back(const _Tp& __x) {
- if (_M_finish != _M_end_of_storage) {
- construct(_M_finish, __x);
- ++_M_finish;
- }
- else
- _M_insert_aux(end(), __x);
- }
- void push_back() {
- if (_M_finish != _M_end_of_storage) {
- construct(_M_finish);
- ++_M_finish;
- }
- else
- _M_insert_aux(end());
- }
- void swap(vector<_Tp, _Alloc>& __x) {
- __STD::swap(_M_start, __x._M_start);
- __STD::swap(_M_finish, __x._M_finish);
- __STD::swap(_M_end_of_storage, __x._M_end_of_storage);
- }
-
- iterator insert(iterator __position, const _Tp& __x) {
- size_type __n = __position - begin();
- if (_M_finish != _M_end_of_storage && __position == end()) {
- construct(_M_finish, __x);
- ++_M_finish;
- }
- else
- _M_insert_aux(__position, __x);
- return begin() + __n;
- }
- iterator insert(iterator __position) {
- size_type __n = __position - begin();
- if (_M_finish != _M_end_of_storage && __position == end()) {
- construct(_M_finish);
- ++_M_finish;
- }
- else
- _M_insert_aux(__position);
- return begin() + __n;
- }
-#ifdef __STL_MEMBER_TEMPLATES
- // Check whether it's an integral type. If so, it's not an iterator.
- template <class _InputIterator>
- void insert(iterator __pos, _InputIterator __first, _InputIterator __last) {
- typedef typename _Is_integer<_InputIterator>::_Integral _Integral;
- _M_insert_dispatch(__pos, __first, __last, _Integral());
- }
-
- template <class _Integer>
- void _M_insert_dispatch(iterator __pos, _Integer __n, _Integer __val,
- __true_type) {
- insert(__pos, (size_type) __n, (_Tp) __val);
- }
-
- template <class _InputIterator>
- void _M_insert_dispatch(iterator __pos,
- _InputIterator __first, _InputIterator __last,
- __false_type) {
- _M_range_insert(__pos, __first, __last, __ITERATOR_CATEGORY(__first));
- }
-#else /* __STL_MEMBER_TEMPLATES */
- void insert(iterator __position,
- const_iterator __first, const_iterator __last);
-#endif /* __STL_MEMBER_TEMPLATES */
-
- void insert (iterator __pos, size_type __n, const _Tp& __x);
-
- void pop_back() {
- --_M_finish;
- destroy(_M_finish);
- }
- iterator erase(iterator __position) {
- if (__position + 1 != end())
- copy(__position + 1, _M_finish, __position);
- --_M_finish;
- destroy(_M_finish);
- return __position;
- }
- iterator erase(iterator __first, iterator __last) {
- iterator __i = copy(__last, _M_finish, __first);
- destroy(__i, _M_finish);
- _M_finish = _M_finish - (__last - __first);
- return __first;
- }
-
- void resize(size_type __new_size, const _Tp& __x) {
- if (__new_size < size())
- erase(begin() + __new_size, end());
- else
- insert(end(), __new_size - size(), __x);
- }
- void resize(size_type __new_size) { resize(__new_size, _Tp()); }
- void clear() { erase(begin(), end()); }
-
-protected:
-
-#ifdef __STL_MEMBER_TEMPLATES
- template <class _ForwardIterator>
- iterator _M_allocate_and_copy(size_type __n, _ForwardIterator __first,
- _ForwardIterator __last)
-{
- iterator __result = _M_allocate(__n);
- __STL_TRY {
- uninitialized_copy(__first, __last, __result);
- return __result;
- }
- __STL_UNWIND(_M_deallocate(__result, __n));
- }
-#else /* __STL_MEMBER_TEMPLATES */
- iterator _M_allocate_and_copy(size_type __n, const_iterator __first,
- const_iterator __last)
- {
- iterator __result = _M_allocate(__n);
- __STL_TRY {
- uninitialized_copy(__first, __last, __result);
- return __result;
- }
- __STL_UNWIND(_M_deallocate(__result, __n));
- }
-#endif /* __STL_MEMBER_TEMPLATES */
-
-
-#ifdef __STL_MEMBER_TEMPLATES
- template <class _InputIterator>
- void _M_range_initialize(_InputIterator __first,
- _InputIterator __last, input_iterator_tag)
- {
- for ( ; __first != __last; ++__first)
- push_back(*__first);
- }
-
- // This function is only called by the constructor.
- template <class _ForwardIterator>
- void _M_range_initialize(_ForwardIterator __first,
- _ForwardIterator __last, forward_iterator_tag)
- {
- size_type __n = 0;
- distance(__first, __last, __n);
- _M_start = _M_allocate(__n);
- _M_end_of_storage = _M_start + __n;
- _M_finish = uninitialized_copy(__first, __last, _M_start);
- }
-
- template <class _InputIterator>
- void _M_range_insert(iterator __pos,
- _InputIterator __first, _InputIterator __last,
- input_iterator_tag);
-
- template <class _ForwardIterator>
- void _M_range_insert(iterator __pos,
- _ForwardIterator __first, _ForwardIterator __last,
- forward_iterator_tag);
-
-#endif /* __STL_MEMBER_TEMPLATES */
-};
-
-template <class _Tp, class _Alloc>
-inline bool
-operator==(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
-{
- return __x.size() == __y.size() &&
- equal(__x.begin(), __x.end(), __y.begin());
-}
-
-template <class _Tp, class _Alloc>
-inline bool
-operator<(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
-{
- return lexicographical_compare(__x.begin(), __x.end(),
- __y.begin(), __y.end());
-}
-
-#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER
-
-template <class _Tp, class _Alloc>
-inline void swap(vector<_Tp, _Alloc>& __x, vector<_Tp, _Alloc>& __y)
-{
- __x.swap(__y);
-}
-
-#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */
-
-template <class _Tp, class _Alloc>
-vector<_Tp,_Alloc>&
-vector<_Tp,_Alloc>::operator=(const vector<_Tp, _Alloc>& __x)
-{
- if (&__x != this) {
- const size_type __xlen = __x.size();
- if (__xlen > capacity()) {
- iterator __tmp = _M_allocate_and_copy(__xlen, __x.begin(), __x.end());
- destroy(_M_start, _M_finish);
- _M_deallocate(_M_start, _M_end_of_storage - _M_start);
- _M_start = __tmp;
- _M_end_of_storage = _M_start + __xlen;
- }
- else if (size() >= __xlen) {
- iterator __i = copy(__x.begin(), __x.end(), begin());
- destroy(__i, _M_finish);
- }
- else {
- copy(__x.begin(), __x.begin() + size(), _M_start);
- uninitialized_copy(__x.begin() + size(), __x.end(), _M_finish);
- }
- _M_finish = _M_start + __xlen;
- }
- return *this;
-}
-
-template <class _Tp, class _Alloc>
-void vector<_Tp, _Alloc>::assign(size_t __n, const value_type& __val) {
- if (__n > capacity()) {
- vector<_Tp, _Alloc> __tmp(__n, __val, get_allocator());
- __tmp.swap(*this);
- }
- else if (__n > size()) {
- fill(begin(), end(), __val);
- _M_finish = uninitialized_fill_n(_M_finish, __n - size(), __val);
- }
- else
- erase(fill_n(begin(), __n, __val), end());
-}
-
-#ifdef __STL_MEMBER_TEMPLATES
-
-template <class _Tp, class _Alloc> template <class _InputIter>
-void vector<_Tp, _Alloc>::_M_assign_aux(_InputIter __first, _InputIter __last,
- input_iterator_tag) {
- iterator __cur = begin();
- for ( ; __first != __last && __cur != end(); ++__cur, ++__first)
- *__cur = *__first;
- if (__first == __last)
- erase(__cur, end());
- else
- insert(end(), __first, __last);
-}
-
-template <class _Tp, class _Alloc> template <class _ForwardIter>
-void
-vector<_Tp, _Alloc>::_M_assign_aux(_ForwardIter __first, _ForwardIter __last,
- forward_iterator_tag) {
- size_type __len = 0;
- distance(__first, __last, __len);
-
- if (__len > capacity()) {
- iterator __tmp = _M_allocate_and_copy(__len, __first, __last);
- destroy(_M_start, _M_finish);
- _M_deallocate(_M_start, _M_end_of_storage - _M_start);
- _M_start = __tmp;
- _M_end_of_storage = _M_finish = _M_start + __len;
- }
- else if (size() >= __len) {
- iterator __new_finish = copy(__first, __last, _M_start);
- destroy(__new_finish, _M_finish);
- _M_finish = __new_finish;
- }
- else {
- _ForwardIter __mid = __first;
- advance(__mid, size());
- copy(__first, __mid, _M_start);
- _M_finish = uninitialized_copy(__mid, __last, _M_finish);
- }
-}
-
-#endif /* __STL_MEMBER_TEMPLATES */
-
-template <class _Tp, class _Alloc>
-void
-vector<_Tp, _Alloc>::_M_insert_aux(iterator __position, const _Tp& __x)
-{
- if (_M_finish != _M_end_of_storage) {
- construct(_M_finish, *(_M_finish - 1));
- ++_M_finish;
- _Tp __x_copy = __x;
- copy_backward(__position, _M_finish - 2, _M_finish - 1);
- *__position = __x_copy;
- }
- else {
- const size_type __old_size = size();
- const size_type __len = __old_size != 0 ? 2 * __old_size : 1;
- iterator __new_start = _M_allocate(__len);
- iterator __new_finish = __new_start;
- __STL_TRY {
- __new_finish = uninitialized_copy(_M_start, __position, __new_start);
- construct(__new_finish, __x);
- ++__new_finish;
- __new_finish = uninitialized_copy(__position, _M_finish, __new_finish);
- }
- __STL_UNWIND((destroy(__new_start,__new_finish),
- _M_deallocate(__new_start,__len)));
- destroy(begin(), end());
- _M_deallocate(_M_start, _M_end_of_storage - _M_start);
- _M_start = __new_start;
- _M_finish = __new_finish;
- _M_end_of_storage = __new_start + __len;
- }
-}
-
-template <class _Tp, class _Alloc>
-void
-vector<_Tp, _Alloc>::_M_insert_aux(iterator __position)
-{
- if (_M_finish != _M_end_of_storage) {
- construct(_M_finish, *(_M_finish - 1));
- ++_M_finish;
- copy_backward(__position, _M_finish - 2, _M_finish - 1);
- *__position = _Tp();
- }
- else {
- const size_type __old_size = size();
- const size_type __len = __old_size != 0 ? 2 * __old_size : 1;
- iterator __new_start = _M_allocate(__len);
- iterator __new_finish = __new_start;
- __STL_TRY {
- __new_finish = uninitialized_copy(_M_start, __position, __new_start);
- construct(__new_finish);
- ++__new_finish;
- __new_finish = uninitialized_copy(__position, _M_finish, __new_finish);
- }
- __STL_UNWIND((destroy(__new_start,__new_finish),
- _M_deallocate(__new_start,__len)));
- destroy(begin(), end());
- _M_deallocate(_M_start, _M_end_of_storage - _M_start);
- _M_start = __new_start;
- _M_finish = __new_finish;
- _M_end_of_storage = __new_start + __len;
- }
-}
-
-template <class _Tp, class _Alloc>
-void vector<_Tp, _Alloc>::insert(iterator __position, size_type __n,
- const _Tp& __x)
-{
- if (__n != 0) {
- if (size_type(_M_end_of_storage - _M_finish) >= __n) {
- _Tp __x_copy = __x;
- const size_type __elems_after = _M_finish - __position;
- iterator __old_finish = _M_finish;
- if (__elems_after > __n) {
- uninitialized_copy(_M_finish - __n, _M_finish, _M_finish);
- _M_finish += __n;
- copy_backward(__position, __old_finish - __n, __old_finish);
- fill(__position, __position + __n, __x_copy);
- }
- else {
- uninitialized_fill_n(_M_finish, __n - __elems_after, __x_copy);
- _M_finish += __n - __elems_after;
- uninitialized_copy(__position, __old_finish, _M_finish);
- _M_finish += __elems_after;
- fill(__position, __old_finish, __x_copy);
- }
- }
- else {
- const size_type __old_size = size();
- const size_type __len = __old_size + max(__old_size, __n);
- iterator __new_start = _M_allocate(__len);
- iterator __new_finish = __new_start;
- __STL_TRY {
- __new_finish = uninitialized_copy(_M_start, __position, __new_start);
- __new_finish = uninitialized_fill_n(__new_finish, __n, __x);
- __new_finish
- = uninitialized_copy(__position, _M_finish, __new_finish);
- }
- __STL_UNWIND((destroy(__new_start,__new_finish),
- _M_deallocate(__new_start,__len)));
- destroy(_M_start, _M_finish);
- _M_deallocate(_M_start, _M_end_of_storage - _M_start);
- _M_start = __new_start;
- _M_finish = __new_finish;
- _M_end_of_storage = __new_start + __len;
- }
- }
-}
-
-#ifdef __STL_MEMBER_TEMPLATES
-
-template <class _Tp, class _Alloc> template <class _InputIterator>
-void
-vector<_Tp, _Alloc>::_M_range_insert(iterator __pos,
- _InputIterator __first,
- _InputIterator __last,
- input_iterator_tag)
-{
- for ( ; __first != __last; ++__first) {
- __pos = insert(__pos, *__first);
- ++__pos;
- }
-}
-
-template <class _Tp, class _Alloc> template <class _ForwardIterator>
-void
-vector<_Tp, _Alloc>::_M_range_insert(iterator __position,
- _ForwardIterator __first,
- _ForwardIterator __last,
- forward_iterator_tag)
-{
- if (__first != __last) {
- size_type __n = 0;
- distance(__first, __last, __n);
- if (size_type(_M_end_of_storage - _M_finish) >= __n) {
- const size_type __elems_after = _M_finish - __position;
- iterator __old_finish = _M_finish;
- if (__elems_after > __n) {
- uninitialized_copy(_M_finish - __n, _M_finish, _M_finish);
- _M_finish += __n;
- copy_backward(__position, __old_finish - __n, __old_finish);
- copy(__first, __last, __position);
- }
- else {
- _ForwardIterator __mid = __first;
- advance(__mid, __elems_after);
- uninitialized_copy(__mid, __last, _M_finish);
- _M_finish += __n - __elems_after;
- uninitialized_copy(__position, __old_finish, _M_finish);
- _M_finish += __elems_after;
- copy(__first, __mid, __position);
- }
- }
- else {
- const size_type __old_size = size();
- const size_type __len = __old_size + max(__old_size, __n);
- iterator __new_start = _M_allocate(__len);
- iterator __new_finish = __new_start;
- __STL_TRY {
- __new_finish = uninitialized_copy(_M_start, __position, __new_start);
- __new_finish = uninitialized_copy(__first, __last, __new_finish);
- __new_finish
- = uninitialized_copy(__position, _M_finish, __new_finish);
- }
- __STL_UNWIND((destroy(__new_start,__new_finish),
- _M_deallocate(__new_start,__len)));
- destroy(_M_start, _M_finish);
- _M_deallocate(_M_start, _M_end_of_storage - _M_start);
- _M_start = __new_start;
- _M_finish = __new_finish;
- _M_end_of_storage = __new_start + __len;
- }
- }
-}
-
-#else /* __STL_MEMBER_TEMPLATES */
-
-template <class _Tp, class _Alloc>
-void
-vector<_Tp, _Alloc>::insert(iterator __position,
- const_iterator __first,
- const_iterator __last)
-{
- if (__first != __last) {
- size_type __n = 0;
- distance(__first, __last, __n);
- if (size_type(_M_end_of_storage - _M_finish) >= __n) {
- const size_type __elems_after = _M_finish - __position;
- iterator __old_finish = _M_finish;
- if (__elems_after > __n) {
- uninitialized_copy(_M_finish - __n, _M_finish, _M_finish);
- _M_finish += __n;
- copy_backward(__position, __old_finish - __n, __old_finish);
- copy(__first, __last, __position);
- }
- else {
- uninitialized_copy(__first + __elems_after, __last, _M_finish);
- _M_finish += __n - __elems_after;
- uninitialized_copy(__position, __old_finish, _M_finish);
- _M_finish += __elems_after;
- copy(__first, __first + __elems_after, __position);
- }
- }
- else {
- const size_type __old_size = size();
- const size_type __len = __old_size + max(__old_size, __n);
- iterator __new_start = _M_allocate(__len);
- iterator __new_finish = __new_start;
- __STL_TRY {
- __new_finish = uninitialized_copy(_M_start, __position, __new_start);
- __new_finish = uninitialized_copy(__first, __last, __new_finish);
- __new_finish
- = uninitialized_copy(__position, _M_finish, __new_finish);
- }
- __STL_UNWIND((destroy(__new_start,__new_finish),
- _M_deallocate(__new_start,__len)));
- destroy(_M_start, _M_finish);
- _M_deallocate(_M_start, _M_end_of_storage - _M_start);
- _M_start = __new_start;
- _M_finish = __new_finish;
- _M_end_of_storage = __new_start + __len;
- }
- }
-}
-
-#endif /* __STL_MEMBER_TEMPLATES */
-
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma reset woff 1174
-#pragma reset woff 1375
-#endif
-
-__STL_END_NAMESPACE
-
-#endif /* __SGI_STL_INTERNAL_VECTOR_H */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/contrib/libstdc++/stl/tempbuf.h b/contrib/libstdc++/stl/tempbuf.h
deleted file mode 100644
index aa4f289c582b..000000000000
--- a/contrib/libstdc++/stl/tempbuf.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- *
- * Copyright (c) 1996
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- */
-
-#ifndef __SGI_STL_TEMPBUF_H
-#define __SGI_STL_TEMPBUF_H
-
-#ifndef __SGI_STL_PAIR_H
-#include <pair.h>
-#endif
-#include <limits.h> /* XXX should use <climits> */
-#include <stddef.h> /* XXX should use <cstddef> */
-#include <stdlib.h> /* XXX should use <cstdlib> */
-#ifndef __TYPE_TRAITS_H
-#include <type_traits.h>
-#endif
-#ifndef __SGI_STL_INTERNAL_CONSTRUCT_H
-#include <stl_construct.h>
-#endif
-#ifndef __SGI_STL_INTERNAL_UNINITIALIZED_H
-#include <stl_uninitialized.h>
-#endif
-#ifndef __SGI_STL_INTERNAL_TEMPBUF_H
-#include <stl_tempbuf.h>
-#endif
-
-#ifdef __STL_USE_NAMESPACES
-
-using __STD::get_temporary_buffer;
-using __STD::return_temporary_buffer;
-using __STD::temporary_buffer;
-
-#endif /* __STL_USE_NAMESPACES */
-
-#endif /* __SGI_STL_TEMPBUF_H */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/contrib/libstdc++/stl/tree.h b/contrib/libstdc++/stl/tree.h
deleted file mode 100644
index 77c57cbbba1f..000000000000
--- a/contrib/libstdc++/stl/tree.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- *
- * Copyright (c) 1996,1997
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- *
- */
-
-#ifndef __SGI_STL_TREE_H
-#define __SGI_STL_TREE_H
-
-#ifndef __SGI_STL_INTERNAL_TREE_H
-#include <stl_tree.h>
-#endif
-#include <algobase.h>
-#include <alloc.h>
-
-#ifdef __STL_USE_NAMESPACES
-using __STD::rb_tree;
-#endif /* __STL_USE_NAMESPACES */
-
-#endif /* __SGI_STL_TREE_H */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/contrib/libstdc++/stl/type_traits.h b/contrib/libstdc++/stl/type_traits.h
deleted file mode 100644
index b6a7dfc6de95..000000000000
--- a/contrib/libstdc++/stl/type_traits.h
+++ /dev/null
@@ -1,373 +0,0 @@
-/*
- *
- * Copyright (c) 1997
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- */
-
-#ifndef __TYPE_TRAITS_H
-#define __TYPE_TRAITS_H
-
-#ifndef __STL_CONFIG_H
-#include <stl_config.h>
-#endif
-
-/*
-This header file provides a framework for allowing compile time dispatch
-based on type attributes. This is useful when writing template code.
-For example, when making a copy of an array of an unknown type, it helps
-to know if the type has a trivial copy constructor or not, to help decide
-if a memcpy can be used.
-
-The class template __type_traits provides a series of typedefs each of
-which is either __true_type or __false_type. The argument to
-__type_traits can be any type. The typedefs within this template will
-attain their correct values by one of these means:
- 1. The general instantiation contain conservative values which work
- for all types.
- 2. Specializations may be declared to make distinctions between types.
- 3. Some compilers (such as the Silicon Graphics N32 and N64 compilers)
- will automatically provide the appropriate specializations for all
- types.
-
-EXAMPLE:
-
-//Copy an array of elements which have non-trivial copy constructors
-template <class T> void copy(T* source, T* destination, int n, __false_type);
-//Copy an array of elements which have trivial copy constructors. Use memcpy.
-template <class T> void copy(T* source, T* destination, int n, __true_type);
-
-//Copy an array of any type by using the most efficient copy mechanism
-template <class T> inline void copy(T* source,T* destination,int n) {
- copy(source, destination, n,
- typename __type_traits<T>::has_trivial_copy_constructor());
-}
-*/
-
-
-struct __true_type {
-};
-
-struct __false_type {
-};
-
-template <class _Tp>
-struct __type_traits {
- typedef __true_type this_dummy_member_must_be_first;
- /* Do not remove this member. It informs a compiler which
- automatically specializes __type_traits that this
- __type_traits template is special. It just makes sure that
- things work if an implementation is using a template
- called __type_traits for something unrelated. */
-
- /* The following restrictions should be observed for the sake of
- compilers which automatically produce type specific specializations
- of this class:
- - You may reorder the members below if you wish
- - You may remove any of the members below if you wish
- - You must not rename members without making the corresponding
- name change in the compiler
- - Members you add will be treated like regular members unless
- you add the appropriate support in the compiler. */
-
-
- typedef __false_type has_trivial_default_constructor;
- typedef __false_type has_trivial_copy_constructor;
- typedef __false_type has_trivial_assignment_operator;
- typedef __false_type has_trivial_destructor;
- typedef __false_type is_POD_type;
-};
-
-
-
-// Provide some specializations. This is harmless for compilers that
-// have built-in __types_traits support, and essential for compilers
-// that don't.
-
-#ifndef __STL_NO_BOOL
-
-__STL_TEMPLATE_NULL struct __type_traits<bool> {
- typedef __true_type has_trivial_default_constructor;
- typedef __true_type has_trivial_copy_constructor;
- typedef __true_type has_trivial_assignment_operator;
- typedef __true_type has_trivial_destructor;
- typedef __true_type is_POD_type;
-};
-
-#endif /* __STL_NO_BOOL */
-
-__STL_TEMPLATE_NULL struct __type_traits<char> {
- typedef __true_type has_trivial_default_constructor;
- typedef __true_type has_trivial_copy_constructor;
- typedef __true_type has_trivial_assignment_operator;
- typedef __true_type has_trivial_destructor;
- typedef __true_type is_POD_type;
-};
-
-__STL_TEMPLATE_NULL struct __type_traits<signed char> {
- typedef __true_type has_trivial_default_constructor;
- typedef __true_type has_trivial_copy_constructor;
- typedef __true_type has_trivial_assignment_operator;
- typedef __true_type has_trivial_destructor;
- typedef __true_type is_POD_type;
-};
-
-__STL_TEMPLATE_NULL struct __type_traits<unsigned char> {
- typedef __true_type has_trivial_default_constructor;
- typedef __true_type has_trivial_copy_constructor;
- typedef __true_type has_trivial_assignment_operator;
- typedef __true_type has_trivial_destructor;
- typedef __true_type is_POD_type;
-};
-
-#ifdef __STL_HAS_WCHAR_T
-
-__STL_TEMPLATE_NULL struct __type_traits<wchar_t> {
- typedef __true_type has_trivial_default_constructor;
- typedef __true_type has_trivial_copy_constructor;
- typedef __true_type has_trivial_assignment_operator;
- typedef __true_type has_trivial_destructor;
- typedef __true_type is_POD_type;
-};
-
-#endif /* __STL_HAS_WCHAR_T */
-
-__STL_TEMPLATE_NULL struct __type_traits<short> {
- typedef __true_type has_trivial_default_constructor;
- typedef __true_type has_trivial_copy_constructor;
- typedef __true_type has_trivial_assignment_operator;
- typedef __true_type has_trivial_destructor;
- typedef __true_type is_POD_type;
-};
-
-__STL_TEMPLATE_NULL struct __type_traits<unsigned short> {
- typedef __true_type has_trivial_default_constructor;
- typedef __true_type has_trivial_copy_constructor;
- typedef __true_type has_trivial_assignment_operator;
- typedef __true_type has_trivial_destructor;
- typedef __true_type is_POD_type;
-};
-
-__STL_TEMPLATE_NULL struct __type_traits<int> {
- typedef __true_type has_trivial_default_constructor;
- typedef __true_type has_trivial_copy_constructor;
- typedef __true_type has_trivial_assignment_operator;
- typedef __true_type has_trivial_destructor;
- typedef __true_type is_POD_type;
-};
-
-__STL_TEMPLATE_NULL struct __type_traits<unsigned int> {
- typedef __true_type has_trivial_default_constructor;
- typedef __true_type has_trivial_copy_constructor;
- typedef __true_type has_trivial_assignment_operator;
- typedef __true_type has_trivial_destructor;
- typedef __true_type is_POD_type;
-};
-
-__STL_TEMPLATE_NULL struct __type_traits<long> {
- typedef __true_type has_trivial_default_constructor;
- typedef __true_type has_trivial_copy_constructor;
- typedef __true_type has_trivial_assignment_operator;
- typedef __true_type has_trivial_destructor;
- typedef __true_type is_POD_type;
-};
-
-__STL_TEMPLATE_NULL struct __type_traits<unsigned long> {
- typedef __true_type has_trivial_default_constructor;
- typedef __true_type has_trivial_copy_constructor;
- typedef __true_type has_trivial_assignment_operator;
- typedef __true_type has_trivial_destructor;
- typedef __true_type is_POD_type;
-};
-
-#ifdef __STL_LONG_LONG
-
-__STL_TEMPLATE_NULL struct __type_traits<long long> {
- typedef __true_type has_trivial_default_constructor;
- typedef __true_type has_trivial_copy_constructor;
- typedef __true_type has_trivial_assignment_operator;
- typedef __true_type has_trivial_destructor;
- typedef __true_type is_POD_type;
-};
-
-__STL_TEMPLATE_NULL struct __type_traits<unsigned long long> {
- typedef __true_type has_trivial_default_constructor;
- typedef __true_type has_trivial_copy_constructor;
- typedef __true_type has_trivial_assignment_operator;
- typedef __true_type has_trivial_destructor;
- typedef __true_type is_POD_type;
-};
-
-#endif /* __STL_LONG_LONG */
-
-__STL_TEMPLATE_NULL struct __type_traits<float> {
- typedef __true_type has_trivial_default_constructor;
- typedef __true_type has_trivial_copy_constructor;
- typedef __true_type has_trivial_assignment_operator;
- typedef __true_type has_trivial_destructor;
- typedef __true_type is_POD_type;
-};
-
-__STL_TEMPLATE_NULL struct __type_traits<double> {
- typedef __true_type has_trivial_default_constructor;
- typedef __true_type has_trivial_copy_constructor;
- typedef __true_type has_trivial_assignment_operator;
- typedef __true_type has_trivial_destructor;
- typedef __true_type is_POD_type;
-};
-
-__STL_TEMPLATE_NULL struct __type_traits<long double> {
- typedef __true_type has_trivial_default_constructor;
- typedef __true_type has_trivial_copy_constructor;
- typedef __true_type has_trivial_assignment_operator;
- typedef __true_type has_trivial_destructor;
- typedef __true_type is_POD_type;
-};
-
-#ifdef __STL_CLASS_PARTIAL_SPECIALIZATION
-
-template <class _Tp>
-struct __type_traits<_Tp*> {
- typedef __true_type has_trivial_default_constructor;
- typedef __true_type has_trivial_copy_constructor;
- typedef __true_type has_trivial_assignment_operator;
- typedef __true_type has_trivial_destructor;
- typedef __true_type is_POD_type;
-};
-
-#else /* __STL_CLASS_PARTIAL_SPECIALIZATION */
-
-__STL_TEMPLATE_NULL struct __type_traits<char*> {
- typedef __true_type has_trivial_default_constructor;
- typedef __true_type has_trivial_copy_constructor;
- typedef __true_type has_trivial_assignment_operator;
- typedef __true_type has_trivial_destructor;
- typedef __true_type is_POD_type;
-};
-
-__STL_TEMPLATE_NULL struct __type_traits<signed char*> {
- typedef __true_type has_trivial_default_constructor;
- typedef __true_type has_trivial_copy_constructor;
- typedef __true_type has_trivial_assignment_operator;
- typedef __true_type has_trivial_destructor;
- typedef __true_type is_POD_type;
-};
-
-__STL_TEMPLATE_NULL struct __type_traits<unsigned char*> {
- typedef __true_type has_trivial_default_constructor;
- typedef __true_type has_trivial_copy_constructor;
- typedef __true_type has_trivial_assignment_operator;
- typedef __true_type has_trivial_destructor;
- typedef __true_type is_POD_type;
-};
-
-__STL_TEMPLATE_NULL struct __type_traits<const char*> {
- typedef __true_type has_trivial_default_constructor;
- typedef __true_type has_trivial_copy_constructor;
- typedef __true_type has_trivial_assignment_operator;
- typedef __true_type has_trivial_destructor;
- typedef __true_type is_POD_type;
-};
-
-__STL_TEMPLATE_NULL struct __type_traits<const signed char*> {
- typedef __true_type has_trivial_default_constructor;
- typedef __true_type has_trivial_copy_constructor;
- typedef __true_type has_trivial_assignment_operator;
- typedef __true_type has_trivial_destructor;
- typedef __true_type is_POD_type;
-};
-
-__STL_TEMPLATE_NULL struct __type_traits<const unsigned char*> {
- typedef __true_type has_trivial_default_constructor;
- typedef __true_type has_trivial_copy_constructor;
- typedef __true_type has_trivial_assignment_operator;
- typedef __true_type has_trivial_destructor;
- typedef __true_type is_POD_type;
-};
-
-#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
-
-
-// The following could be written in terms of numeric_limits.
-// We're doing it separately to reduce the number of dependencies.
-
-template <class _Tp> struct _Is_integer {
- typedef __false_type _Integral;
-};
-
-#ifndef __STL_NO_BOOL
-
-__STL_TEMPLATE_NULL struct _Is_integer<bool> {
- typedef __true_type _Integral;
-};
-
-#endif /* __STL_NO_BOOL */
-
-__STL_TEMPLATE_NULL struct _Is_integer<char> {
- typedef __true_type _Integral;
-};
-
-__STL_TEMPLATE_NULL struct _Is_integer<signed char> {
- typedef __true_type _Integral;
-};
-
-__STL_TEMPLATE_NULL struct _Is_integer<unsigned char> {
- typedef __true_type _Integral;
-};
-
-#ifdef __STL_HAS_WCHAR_T
-
-__STL_TEMPLATE_NULL struct _Is_integer<wchar_t> {
- typedef __true_type _Integral;
-};
-
-#endif /* __STL_HAS_WCHAR_T */
-
-__STL_TEMPLATE_NULL struct _Is_integer<short> {
- typedef __true_type _Integral;
-};
-
-__STL_TEMPLATE_NULL struct _Is_integer<unsigned short> {
- typedef __true_type _Integral;
-};
-
-__STL_TEMPLATE_NULL struct _Is_integer<int> {
- typedef __true_type _Integral;
-};
-
-__STL_TEMPLATE_NULL struct _Is_integer<unsigned int> {
- typedef __true_type _Integral;
-};
-
-__STL_TEMPLATE_NULL struct _Is_integer<long> {
- typedef __true_type _Integral;
-};
-
-__STL_TEMPLATE_NULL struct _Is_integer<unsigned long> {
- typedef __true_type _Integral;
-};
-
-#ifdef __STL_LONG_LONG
-
-__STL_TEMPLATE_NULL struct _Is_integer<long long> {
- typedef __true_type _Integral;
-};
-
-__STL_TEMPLATE_NULL struct _Is_integer<unsigned long long> {
- typedef __true_type _Integral;
-};
-
-#endif /* __STL_LONG_LONG */
-
-#endif /* __TYPE_TRAITS_H */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/contrib/libstdc++/stl/utility b/contrib/libstdc++/stl/utility
deleted file mode 100644
index df8c224388db..000000000000
--- a/contrib/libstdc++/stl/utility
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- *
- * Copyright (c) 1996,1997
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- */
-
-#ifndef __SGI_STL_UTILITY
-#define __SGI_STL_UTILITY
-
-#include <stl_config.h>
-#include <stl_relops.h>
-#include <stl_pair.h>
-
-#endif /* __SGI_STL_UTILITY */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/contrib/libstdc++/stl/vector b/contrib/libstdc++/stl/vector
deleted file mode 100644
index 4bcdebcc1861..000000000000
--- a/contrib/libstdc++/stl/vector
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- *
- * Copyright (c) 1996
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- */
-
-#ifndef __SGI_STL_VECTOR
-#define __SGI_STL_VECTOR
-
-#include <stl_algobase.h>
-#include <stl_alloc.h>
-#include <stl_construct.h>
-#include <stl_uninitialized.h>
-#include <stl_vector.h>
-#include <stl_bvector.h>
-
-#endif /* __SGI_STL_VECTOR */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/contrib/libstdc++/stl/vector.h b/contrib/libstdc++/stl/vector.h
deleted file mode 100644
index 231a227b7e3a..000000000000
--- a/contrib/libstdc++/stl/vector.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- *
- * Copyright (c) 1996
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- */
-
-#ifndef __SGI_STL_VECTOR_H
-#define __SGI_STL_VECTOR_H
-
-#include <algobase.h>
-#include <alloc.h>
-#include <stl_vector.h>
-
-#ifdef __STL_USE_NAMESPACES
-using __STD::vector;
-#endif /* __STL_USE_NAMESPACES */
-
-#endif /* __SGI_STL_VECTOR_H */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/contrib/libstdc++/stlinst.cc b/contrib/libstdc++/stlinst.cc
deleted file mode 100644
index 2a221fbaee98..000000000000
--- a/contrib/libstdc++/stlinst.cc
+++ /dev/null
@@ -1,10 +0,0 @@
-// Instantiation file for the -*- C++ -*- Standard Library allocator templates
-// This file is part of the GNU ANSI C++ Library.
-
-#include <alloc.h>
-
-#ifndef __USE_MALLOC
-template class __default_alloc_template<__NODE_ALLOCATOR_THREADS, 0>;
-#endif
-
-template class __malloc_alloc_template<0>;
diff --git a/contrib/libstdc++/string b/contrib/libstdc++/string
deleted file mode 100644
index fa6f1abaa70c..000000000000
--- a/contrib/libstdc++/string
+++ /dev/null
@@ -1,13 +0,0 @@
-// Main header for the -*- C++ -*- string classes.
-
-#ifndef __STRING__
-#define __STRING__
-
-#include <std/bastring.h>
-
-extern "C++" {
-typedef basic_string <char> string;
-// typedef basic_string <wchar_t> wstring;
-} // extern "C++"
-
-#endif
diff --git a/contrib/libstdc++/strstream b/contrib/libstdc++/strstream
deleted file mode 100644
index ee360e0b7e43..000000000000
--- a/contrib/libstdc++/strstream
+++ /dev/null
@@ -1,7 +0,0 @@
-// -*- C++ -*- forwarding header.
-// This file is part of the GNU ANSI C++ Library.
-
-#ifndef __STRSTREAM__
-#define __STRSTREAM__
-#include <strstream.h>
-#endif
diff --git a/contrib/libstdc++/tests/ChangeLog b/contrib/libstdc++/tests/ChangeLog
deleted file mode 100644
index 3bcb473a621a..000000000000
--- a/contrib/libstdc++/tests/ChangeLog
+++ /dev/null
@@ -1,132 +0,0 @@
-Fri Mar 16 12:46:19 GMT 2001 Bernd Schmidt (bernds@redhat.com)
-
- * gcc-2.95.3 Released.
-
-Sun Oct 24 23:54:10 PDT 1999 Jeff Law (law@cygnus.com)
-
- * gcc-2.95.2 Released.
-
-Mon Aug 16 01:29:24 PDT 1999 Jeff Law (law@cygnus.com)
-
- * gcc-2.95.1 Released.
-
-Wed Jul 28 21:39:31 PDT 1999 Jeff Law (law@cygnus.com)
-
- * gcc-2.95 Released.
-
-Sun Jul 25 23:40:51 PDT 1999 Jeff Law (law@cygnus.com)
-
- * gcc-2.95 Released.
-
-1998-07-17 Jason Merrill <jason@yorick.cygnus.com>
-
- * tmap.cc: Use less<int>.
- * tlist.cc (main): Use remove_if.
-
-1998-07-13 Manfred Hollstein <manfred@s-direktnet.de>
-
- * Makefile.in (VERSION): Bump to 2.9.0.
-
-1998-07-12 Bob Sidebotham <rns@fore.com>
-
- * tstring.cc (findtest): New fn.
-
-1998-06-01 Jason Merrill <jason@yorick.cygnus.com>
-
- * tlist.cc, tvector.cc, tmap.cc: Remove explicit instantiations.
-
-Fri Oct 10 00:40:31 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * tstring.cc (identitytest): s/remove/erase/.
-
-Thu Sep 25 19:48:22 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * tstring.cc: Add some tests for the member templates.
-
-Wed Jun 11 11:00:10 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * tmap.cc: Explicitly instantiate allocator classes.
- * tvector.cc, tlist.cc: Likewise.
-
-Fri May 16 18:38:05 1997 Bob Manson <manson@charmed.cygnus.com>
-
- * tcomplex.cc (main): If we're using short doubles, compensate for
- roundoff in result of pow(a,b).
-
-Thu May 1 17:37:53 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * configure.in (CHECK): Add $(CXXFLAGS).
- * Makefile.in (tcomplex): Add $(CXXFLAGS).
-
-Fri Apr 25 16:07:46 1997 Bob Manson <manson@charmed.cygnus.com>
-
- * configure.in: Change "check" to "check-old". Add do-nothing
- check target.
-
-Sun Nov 3 12:44:48 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * tstring.cc: Treat string literals as const.
-
-Tue Sep 24 18:00:20 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * tstring.cc, tcomplex.cc: Remove gratuitous uses of std/.
-
-Mon Jun 17 14:05:50 1996 Per Bothner <bothner@deneb.cygnus.com>
-
- * tlist.cc (test_splice): New test.
-
-Fri Mar 22 16:08:36 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * Makefile.in (VERSION): 2.8.0.
-
- * tlist.cc, tmap.cc, tvector.cc: Remove explicit instantiation
- directive.
-
-Sat Nov 18 19:52:26 1995 Mike Stump <mrs@cygnus.com>
-
- * Makefile.in: Update version to 2.7.1.
-
-Tue May 9 19:36:54 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * tstring.cc (decltest): Adjust single-character test.
-
-Fri May 5 14:35:19 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * tcomplex.*: Update to reflect that operator<< now
- accepts more forms of input.
-
-Thu Apr 27 15:34:58 1995 Brendan Kehoe (brendan@lisa.cygnus.com)
-
- * configure.in: Update to stay in sync with config.shared.
-
-Thu Feb 16 00:08:28 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * Makefile.in (VERSION, SHLIB): Define.
-
-Tue Jan 24 02:36:24 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * Makefile.in (CXXFLAGS): Don't set.
-
-Mon Jan 23 04:12:10 1995 Jason Merrill <jason@python.cygnus.com>
-
- * tlist.cc (plus): Remove.
-
-Thu Jan 19 19:41:07 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * Makefile.in: Don't set LD_LIBRARY_PATH. Users will have to set
- it themselves.
-
-Mon Jan 16 13:57:34 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * Makefile.in: Update to reflect header movement.
-
-Wed Dec 14 19:55:45 1994 Per Bothner <bothner@kalessin.cygnus.com>
-
- * configure.in: Fix quoting problem. Reported nu H.J.Lu.
-
-Tue Nov 29 16:46:56 1994 Per Bothner <bothner@kalessin.cygnus.com>
-
- * Makefile.in, configure.in: Re-write to avoid duplication.
- * {tvector,tmap,tlist}.{cc,exp}, configure.in: New tests for STL.
-
-
diff --git a/contrib/libstdc++/tests/Makefile.in b/contrib/libstdc++/tests/Makefile.in
deleted file mode 100644
index 057482f185eb..000000000000
--- a/contrib/libstdc++/tests/Makefile.in
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (C) 1994 Free Software Foundation
-
-# This file is part of the GNU ANSI C++ 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.
-
-VERSION = 2.9.0
-SHLIB = libstdc++.so.$(VERSION)
-
-DEPLIBS = ../libstdc++.a
-LDLIBS = -L.. -lstdc++
-MDEPLIBS = $(DEPLIBS)
-MLDLIBS = $(LDLIBS) -lm
-
-#### package, host, target, and site dependent Makefile fragments come in here.
-##
-
-tcomplex.o: ${srcdir}/../std/complext.h ${srcdir}/../std/dcomplex.h
-tcomplex: tcomplex.o $(MDEPLIBS)
- $(CXX) $(CXXFLAGS) -o tcomplex tcomplex.o $(MLDLIBS)
-
-tstring.o: ${srcdir}/../std/bastring.h
-
-# NOTE: Rules for following tests are generated by $(srcdir)/configure.in !!!
-
diff --git a/contrib/libstdc++/tests/configure.in b/contrib/libstdc++/tests/configure.in
deleted file mode 100644
index 06c56192beb5..000000000000
--- a/contrib/libstdc++/tests/configure.in
+++ /dev/null
@@ -1,65 +0,0 @@
-# This file is a shell script fragment that supplies the information
-# necessary for a configure script to process the program in
-# this directory. For more information, look at ../../configure.
-
-configdirs=
-srctrigger=tcomplex.cc
-srcname="tests for ANSI C++ library"
-package_makefile_frag=Make.pack
-package_makefile_rules_frag=Make.pack.r
-
-# per-host:
-
-# per-target:
-
-target_makefile_frag=../target-mkfrag
-
-TO_TOPDIR=../../
-ALL=' '
-XCXXINCLUDES="-I${srcdir}/.. -I${srcdir}/../stl -I${TO_TOPDIR}libio -I${srcdir}/${TO_TOPDIR}libio"
-SIMPLE_TESTS='tstring tlist tmap tvector'
-TESTS="tcomplex ${SIMPLE_TESTS}"
-MOSTLYCLEAN="*.o core ${TESTS} *.out"
-(. ${srcdir}/${TO_TOPDIR}libio/config.shared) >${package_makefile_frag} 2>${package_makefile_rules_frag}
-
-# post-target:
-
-CHECK=""
-
-for TEST in ${SIMPLE_TESTS} ; do
- echo "${TEST}: ${TEST}.o" '$(DEPLIBS)
- $(CXX) $(CXXFLAGS) -o' "${TEST} ${TEST}.o" '$(LDLIBS)
-' >> Makefile
-done
-
-for TEST in ${TESTS} ; do
- echo ".PHONY: check-${TEST}" >>Makefile
- if [ -f ${srcdir}/${TEST}.inp ] ; then
- echo "check-${TEST}: ${TEST}" '$(srcdir)'"/${TEST}.inp
- ./${TEST} < "'$(srcdir)'"/${TEST}.inp > ${TEST}.out 2>&1" >>Makefile
- else
- echo "check-${TEST}: ${TEST}
- ./${TEST} > ${TEST}.out 2>&1" >>Makefile
- fi
- echo ' diff -c $(srcdir)/'"${TEST}.exp ${TEST}.out" >>Makefile
- CHECK="${CHECK} check-${TEST}"
-done
-
-if [ "${srcdir}" = "." ] ; then
- if [ "${with_target_subdir}" != "." ] ; then
- topsrcdir=${with_multisrctop}../../..
- else
- topsrcdir=${with_multisrctop}../..
- fi
-else
- topsrcdir=${srcdir}/../..
-fi
-
-if [ -d ${topsrcdir}/gcc ] ; then
- echo "
-check:
-check-old: ${CHECK}" >>Makefile
-else
- echo "
-check: ${CHECK}" >>Makefile
-fi
diff --git a/contrib/libstdc++/tests/tcomplex.cc b/contrib/libstdc++/tests/tcomplex.cc
deleted file mode 100644
index 5311f0d8b7a1..000000000000
--- a/contrib/libstdc++/tests/tcomplex.cc
+++ /dev/null
@@ -1,151 +0,0 @@
-// Tests for the -*- C++ -*- complex number classes.
-// Copyright (C) 1994 Free Software Foundation
-
-// This file is part of the GNU ANSI C++ 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.
-
-#include <assert.h>
-#include <iostream.h>
-#include <complex>
-
-// to test near-equality
-
-const double eps = 0.000001;
-
-static void close_enough(const double_complex& a, const double_complex& b)
-{
- assert(fabs(real(a) - real(b)) < eps &&
- fabs(imag(a) - imag(b)) < eps);
-}
-
-
-void test3(double_complex& a, double_complex& b, double_complex& c)
-{
-
- close_enough(-(-a) , a);
- close_enough((a + b) , (b + a));
- close_enough((a + (-b)) , (a - b));
- close_enough((a * b) , (b * a));
- close_enough((a * (-b)) , -(a * b));
- close_enough((a / (-b)) , -(a / b));
- close_enough((a - b) , -(b - a));
- close_enough((a + (b + c)) , ((a + b) + c));
- close_enough((a * (b * c)) , ((a * b) * c));
- close_enough((a * (b + c)) , ((a * b) + (a * c)));
- close_enough(((a - b) + b) , a);
- close_enough(((a + b) - b) , a);
- close_enough(((a * b) / b) , a);
- close_enough(((a / b) * b) , a);
-
-
- double_complex x = a;
- x *= b;
- close_enough(x , (a * b));
- x += c;
- close_enough(x , ((a * b) + c));
- x -= a;
- close_enough(x , (((a * b) + c) - a));
- x /= b;
- close_enough(x , ((((a * b) + c) - a) / b));
-
-}
-
-main()
-{
- double_complex one = 1.0;
- double_complex i (0.0, 1.0);
- double_complex neg_one = -1.0;
-
- cout << "double_complex one = " << one << "\n";
- cout << "i = " << i << "\n";
- cout << "neg_one = " << neg_one << "\n";
- cout << "sqrt(neg_one) = " << sqrt(neg_one) << "\n";
-
- double_complex a (2.0, 3.0);
- double_complex b (4.0, 5.0);
-
- cout << "a = " << a << "\n";
- cout << "b = " << b << "\n";
-
- cout << "a + one = " << (a + one) << "\n";
- (close_enough((a+one), double_complex(3.0, 3.0)));
- cout << "a - one = " << (a - one) << "\n";
- (close_enough((a-one), double_complex(1.0, 3.0)));
- cout << "a * one = " << (a * one) << "\n";
- (close_enough((a*one), a));
- cout << "a / one = " << (a / one) << "\n";
- (close_enough((a/one), a));
-
- cout << "a + b = " << (a + b) << "\n";
- (close_enough((a+b), double_complex(6.0, 8.0)));
- cout << "a - b = " << (a - b) << "\n";
- (close_enough((a-b), double_complex(-2.0, -2.0)));
- cout << "a * b = " << (a * b) << "\n";
- (close_enough((a*b), double_complex(-7.0, 22.0)));
- cout << "a / b = " << (a / b) << "\n";
- (close_enough((a/b), double_complex(0.5609760976, 0.0487804878)));
-
- double_complex c;
-
- c = a; cout << "c = a; c += b = " << (c += b) << "\n";
- c = a; cout << "c = a; c -= b = " << (c -= b) << "\n";
- c = a; cout << "c = a; c *= b = " << (c *= b) << "\n";
- c = a; cout << "c = a; c /= b = " << (c /= b) << "\n";
-
- cout << "-a = " << (-a) << "\n";
- cout << "real(a) = " << real(a) << "\n";
- assert(real(a) == 2.0);
- cout << "imag(a) = " << imag(a) << "\n";
- assert(imag(a) == 3.0);
- cout << "conj(a) = " << conj(a) << "\n";
- assert(conj(a) == double_complex(2.0, -3.0));
- cout << "norm(a) = " << norm(a) << "\n";
- assert(norm(a) == 13.0);
-
- cout << "abs(a) = " << abs(a) << "\n";
- cout << "arg(a) = " << arg(a) << "\n";
- cout << "cos(a) = " << cos(a) << "\n";
- cout << "sin(a) = " << sin(a) << "\n";
- cout << "cosh(a) = " << cosh(a) << "\n";
- cout << "sinh(a) = " << sinh(a) << "\n";
- cout << "log(a) = " << log(a) << "\n";
- cout << "exp(a) = " << exp(a) << "\n";
- cout << "sqrt(a) = " << sqrt(a) << "\n";
- cout << "pow(a, 2) = " << pow(a, 2) << "\n";
- {
- double_complex p = pow(a, b);
- if(sizeof(float)==sizeof(double)) {
- long w = (long)(p.imag()*100000);
- if (w==-98642)
- p=double_complex(-0.753046,-0.986429);
- }
- cout << "pow(a, b) = " << p << "\n";
- }
-
- double_complex d (10, 20);
- double_complex e = pow(a, 2);
-
- test3(one, one, one);
- test3(a, a, a);
- test3(a, b, d);
- test3(e, i, b);
- test3(d, d, i);
-
- cout << "enter a complex number in form a or (a) or (a, b): ";
- cin >> c;
- cout << "number = " << c << "\n";
-
- cout << "\nEnd of test\n";
- return 0;
-}
diff --git a/contrib/libstdc++/tests/tcomplex.exp b/contrib/libstdc++/tests/tcomplex.exp
deleted file mode 100644
index 5bef15cd3769..000000000000
--- a/contrib/libstdc++/tests/tcomplex.exp
+++ /dev/null
@@ -1,37 +0,0 @@
-double_complex one = (1,0)
-i = (0,1)
-neg_one = (-1,0)
-sqrt(neg_one) = (0,1)
-a = (2,3)
-b = (4,5)
-a + one = (3,3)
-a - one = (1,3)
-a * one = (2,3)
-a / one = (2,3)
-a + b = (6,8)
-a - b = (-2,-2)
-a * b = (-7,22)
-a / b = (0.560976,0.0487805)
-c = a; c += b = (6,8)
-c = a; c -= b = (-2,-2)
-c = a; c *= b = (-7,22)
-c = a; c /= b = (0.560976,0.0487805)
--a = (-2,-3)
-real(a) = 2
-imag(a) = 3
-conj(a) = (2,-3)
-norm(a) = 13
-abs(a) = 3.60555
-arg(a) = 0.982794
-cos(a) = (-4.18963,-9.10923)
-sin(a) = (9.1545,-4.16891)
-cosh(a) = (-3.72455,0.511823)
-sinh(a) = (-3.59056,0.530921)
-log(a) = (1.28247,0.982794)
-exp(a) = (-7.31511,1.04274)
-sqrt(a) = (1.67415,0.895977)
-pow(a, 2) = (-5,12)
-pow(a, b) = (-0.753046,-0.986429)
-enter a complex number in form a or (a) or (a, b): number = (1.2,-34)
-
-End of test
diff --git a/contrib/libstdc++/tests/tcomplex.inp b/contrib/libstdc++/tests/tcomplex.inp
deleted file mode 100644
index c4e1d84660f2..000000000000
--- a/contrib/libstdc++/tests/tcomplex.inp
+++ /dev/null
@@ -1 +0,0 @@
-(1.2, -34)
diff --git a/contrib/libstdc++/tests/tlist.cc b/contrib/libstdc++/tests/tlist.cc
deleted file mode 100644
index a37c999d0b55..000000000000
--- a/contrib/libstdc++/tests/tlist.cc
+++ /dev/null
@@ -1,151 +0,0 @@
-// test/demo of generic lists
-
-#include <assert.h>
-
-#define tassert(ex) {if ((ex)) cerr << #ex << "\n"; \
- else _assert(#ex, __FILE__,__LINE__); }
-
-#include <iostream.h>
-#include <list.h>
-#include <algo.h>
-
-bool int_compare(int a, int b)
-{
- return a < b;
-}
-
-int inc(int x)
-{
- return x + 1;
-}
-
-void print(list<int>& l)
-{
- for (list<int>::iterator it = l.begin(); it != l.end(); it++)
- cout << *it << " ";
- cout << "\n";
-}
-
-int is_odd(int x)
-{
- return x & 1;
-}
-
-int is_even(int x)
-{
- return (x & 1) == 0;
-}
-
-void sequence(list<int>& a, int lo, int hi)
-{
- back_insert_iterator<list<int> > it(a);
- while (lo <= hi)
- *it++ = lo++;
-}
-
-int old_rand = 9999;
-
-int get_rand()
-{
- old_rand = ((long)old_rand * (long)1243) % (long)971;
- return old_rand;
-}
-
-void randseq(list<int>& a, int n)
-{
- back_insert_iterator<list<int> > it(a);
- while (--n >= 0)
- *it++ = get_rand() % 50;
-}
-
-int array1 [] = { 9, 16, 36 };
-int array2 [] = { 1, 4 };
-
-int test_splice ()
-{
- list<int> l1 (array1, array1 + 3);
- list<int> l2 (array2, array2 + 2);
- list<int>::iterator i1 = l1.begin ();
- l1.splice (i1, l2);
- list<int>::iterator i2 = l1.begin ();
- while (i2 != l1.end ())
- cout << *i2++ << endl;
- return 0;
-}
-
-main()
-{
- list<int> a; int i;
- list<int>::iterator it, bit;
- sequence(a, 1, 20);
- cout << "\nlist<int> a = sequence(1, 20);\n"; print(a);
- for (it = a.begin (), i = 0; it != a.end (); it++, i++)
- assert (*it == i + 1);
- list<int> b;
- randseq(b, 20);
- cout << "\nlist<int> b = randseq(20);\n"; print(b);
- list<int> c;
- c.insert (c.end(), a.begin(), a.end());
- c.insert (c.end(), b.begin(), b.end());
- cout << "\nlist<int> c = a and b;\n"; print(c);
-
- list<int> d;
- for (it = a.begin(); it != a.end(); it++)
- d.insert(d.end (), inc(*it));
- cout << "\nlist<int> d = map(inc, a);\n"; print(d);
-
- list<int> e;
- back_insert_iterator<list<int> > e_insertor (e);
- reverse_copy (a.begin(), a.end (), e_insertor);
- cout << "\nlist<int> e = reverse(a);\n"; print(e);
-
- list<int> f;
- for (it = a.begin(); it != a.end(); it++)
- if (is_odd (*it))
- f.insert(f.end (), *it);
- cout << "\nlist<int> f = select(is_odd, a);\n"; print(f);
- list<int> ff;
- for (it = f.begin(); it != f.end(); it++)
- if (is_even (*it))
- ff.insert(ff.end (), *it);
- assert(ff.empty());
-
- int red = 0;
- for (it = a.begin(); it != a.end(); it++)
- red += *it;
- cout << "\nint red = a.reduce(plus, 0);\n"; cout << red;
- it = a.begin(); ++it; ++it;
- int second = *it;
- cout << "\nint second = a[2];\n"; cout << second;
- list<int> g;
- for (it = a.begin(), bit = b.begin(); it != a.end () && bit != b.end (); )
- g.insert (g.end (), *it++ + *bit++);
- cout << "\nlist<int> g = combine(plus, a, b);\n"; print(g);
- g.remove_if (is_odd);
- cout << "\ng.del(is_odd);\n"; print(g);
-
- ff.erase (ff.begin (), ff.end());
- for (it = g.begin(); it != g.end(); it++)
- if (is_odd (*it))
- ff.insert (ff.end (), *it);
- assert(ff.empty());
-
- b.sort();
- for (it = b.begin(); bit = it++, it != b.end (); ) assert (*it >= *bit);
- cout << "\nb.sort(int_compare);\n"; print(b);
-
- list<int> h;
- back_insert_iterator<list<int> > h_insertor (h);
- merge (a.begin (), a.end (), b.begin (), b.end (), h_insertor, int_compare);
- cout << "\nlist<int> h = merge(a, b, int_compare);\n"; print(h);
- for (it = h.begin(); bit = it++, it != h.end (); ) assert (*it >= *bit);
-
- cout << "\nh via iterator:\n";
- for (it = h.begin(); it != h.end (); it++)
- cout << *it << ", ";
- cout << "\n";
-
- test_splice ();
-
- cout << "\ndone\n";
-}
diff --git a/contrib/libstdc++/tests/tlist.exp b/contrib/libstdc++/tests/tlist.exp
deleted file mode 100644
index 65f7806826f6..000000000000
--- a/contrib/libstdc++/tests/tlist.exp
+++ /dev/null
@@ -1,44 +0,0 @@
-
-list<int> a = sequence(1, 20);
-1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
-
-list<int> b = randseq(20);
-28 27 5 17 44 6 9 40 15 26 49 35 15 48 13 27 25 25 9 6
-
-list<int> c = a and b;
-1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 28 27 5 17 44 6 9 40 15 26 49 35 15 48 13 27 25 25 9 6
-
-list<int> d = map(inc, a);
-2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
-
-list<int> e = reverse(a);
-20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1
-
-list<int> f = select(is_odd, a);
-1 3 5 7 9 11 13 15 17 19
-
-int red = a.reduce(plus, 0);
-210
-int second = a[2];
-3
-list<int> g = combine(plus, a, b);
-29 29 8 21 49 12 16 48 24 36 60 47 28 62 28 43 42 43 28 26
-
-g.del(is_odd);
-8 12 16 48 24 36 60 28 62 28 42 28 26
-
-b.sort(int_compare);
-5 6 6 9 9 13 15 15 17 25 25 26 27 27 28 35 40 44 48 49
-
-list<int> h = merge(a, b, int_compare);
-1 2 3 4 5 5 6 6 6 7 8 9 9 9 10 11 12 13 13 14 15 15 15 16 17 17 18 19 20 25 25 26 27 27 28 35 40 44 48 49
-
-h via iterator:
-1, 2, 3, 4, 5, 5, 6, 6, 6, 7, 8, 9, 9, 9, 10, 11, 12, 13, 13, 14, 15, 15, 15, 16, 17, 17, 18, 19, 20, 25, 25, 26, 27, 27, 28, 35, 40, 44, 48, 49,
-1
-4
-9
-16
-36
-
-done
diff --git a/contrib/libstdc++/tests/tmap.cc b/contrib/libstdc++/tests/tmap.cc
deleted file mode 100644
index 900e66f506bd..000000000000
--- a/contrib/libstdc++/tests/tmap.cc
+++ /dev/null
@@ -1,59 +0,0 @@
-#include <map.h>
-#include <algo.h>
-#include <iostream.h>
-#include <function.h>
-
-#define int_less less<int>
-struct str_less {
- bool operator() (char* x, char* y) const { return strcmp(x,y) < 0; }
-};
-
-#if 0
-int SIZE;
-
-void add(int x[], int y[], map<int,int, int_less>& a)
-{
- for (int i = 0; i < SIZE; ++i) a[x[i]] = y[i];
-}
-#endif
-
-int
-main(int argv, char** argc)
-{
-#if 0
- if (argv > 1)
- {
- SIZE = abs(atoi(argc[1]));
- SIZE &= ~1;
- }
- else
- SIZE = 100;
- nums = new int[SIZE];
- odds = new int[SIZE];
- perm = new int[SIZE];
-#endif
-
- map<int, int, int_less> my_map;
-
- map<char*, int, str_less> phones;
-
- my_map[4] = 40;
- my_map[2] = 20;
-
- // The (char*) is needed because g++ doesn't
- // convert char[] to char* in this context.
- phones[(char*)"tom"] = 2345;
- phones[(char*)"dick"] = 5678;
- phones[(char*)"harry"] = 7654;
-
- cout << "2 -> " << my_map[2] << endl;
- cout << "4 -> " << my_map[4] << endl;
-
- map<int, int, int_less>::iterator it = my_map.begin();
- for ( ; it != my_map.end(); it++)
- cout << "my_map[" << (*it).first << "] = " << (*it).second << endl;
-
- map<char*, int, str_less>::iterator pit = phones.begin();
- for ( ; pit != phones.end(); pit++)
- cout << "phones[" << (*pit).first << "] = " << (*pit).second << endl;
-}
diff --git a/contrib/libstdc++/tests/tmap.exp b/contrib/libstdc++/tests/tmap.exp
deleted file mode 100644
index b7b5df249fb0..000000000000
--- a/contrib/libstdc++/tests/tmap.exp
+++ /dev/null
@@ -1,7 +0,0 @@
-2 -> 20
-4 -> 40
-my_map[2] = 20
-my_map[4] = 40
-phones[dick] = 5678
-phones[harry] = 7654
-phones[tom] = 2345
diff --git a/contrib/libstdc++/tests/tstring.cc b/contrib/libstdc++/tests/tstring.cc
deleted file mode 100644
index 833d3d964604..000000000000
--- a/contrib/libstdc++/tests/tstring.cc
+++ /dev/null
@@ -1,249 +0,0 @@
-// Tests for the -*- C++ -*- string classes.
-// Copyright (C) 1994 Free Software Foundation
-
-// This file is part of the GNU ANSI C++ 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.
-
-#include <string>
-#include <algorithm>
-#include <iostream.h>
-#include <stdlib.h>
-#include <assert.h>
-
-string X = "Hello";
-string Y = "world";
-string N = "123";
-string c;
-const char* s = ",";
-
-void decltest()
-{
- string x;
- cout << "an empty string:" << x << "\n";
- assert(x == "");
-
- string y = "Hello";
- cout << "A string initialized to Hello:" << y << "\n";
- assert(y == "Hello");
-
- if (y[y.length()-1] == 'o')
- y = y + '\n';
- assert(y == "Hello\n");
- y = "Hello";
-
- string a = y;
- cout << "A string initialized to previous string:" << a << "\n";
- assert(a == "Hello");
- assert(a == y);
-
- string b (a, 1, 2);
- cout << "A string initialized to (previous string, 1, 2):" << b << "\n";
- assert(b == "el");
-
- char ch = '@';
- string z (1, ch);
- cout << "A string initialized to @:" << z << "\n";
- assert (z == "@");
-
- string n ("20");
- cout << "A string initialized to 20:" << n << "\n";
- assert(n == "20");
-
- int i = atoi(n.c_str ());
- double f = atof(n.c_str ());
- cout << "n = " << n << " atoi(n) = " << i << " atof(n) = " << f << "\n";
- assert(i == 20);
- assert(f == 20);
-
- int ar[] = { 'H', 'e', 'l', 'l', 'o' };
- string is (ar, ar+sizeof(ar)/sizeof(ar[0]));
- cout << "is = " << is << endl;
- assert (is == "Hello");
-}
-
-void cattest()
-{
- string x = X;
- string y = Y;
- string z = x + y;
- cout << "z = x + y = " << z << "\n";
- assert(z == "Helloworld");
-
- x += y;
- cout << "x += y; x = " << x << "\n";
- assert(x == "Helloworld");
-
- y = Y;
- x = X;
- y.insert (0, x);
- cout << "y.insert (0, x); y = " << y << "\n";
- assert(y == "Helloworld");
-
- y = Y;
- x = X;
- x = x + y + x;
- cout << "x = x + y + x; x = " << x << "\n";
- assert(x == "HelloworldHello");
-
- y = Y;
- x = X;
- x = y + x + x;
- cout << "x = y + x + x; x = " << x << "\n";
- assert(x == "worldHelloHello");
-
- x = X;
- y = Y;
- z = x + s + ' ' + y.substr (y.find ('w'), 1) + y.substr (y.find ('w') + 1) + ".";
- cout << "z = x + s + + y.substr (y.find (w), 1) + y.substr (y.find (w) + 1) + . = " << z << "\n";
- assert(z == "Hello, world.");
-}
-
-void
-findtest()
-{
- string x;
- string::size_type pos;
- pos = x.find_last_not_of('X');
- assert(pos == string::npos);
- pos = x.find_last_not_of("XYZ");
- assert(pos == string::npos);
-
- string y("a");
- pos = y.find_last_not_of('X');
- assert(pos == 0);
- pos = y.find_last_not_of('a');
- assert(pos == string::npos);
- pos = y.find_last_not_of("XYZ");
- assert(pos == 0);
- pos = y.find_last_not_of("a");
- assert(pos == string::npos);
-
- string z("ab");
- pos = z.find_last_not_of('X');
- assert(pos == 1);
- pos = z.find_last_not_of("XYZ");
- assert(pos == 1);
- pos = z.find_last_not_of('b');
- assert(pos == 0);
- pos = z.find_last_not_of("Xb");
- assert(pos == 0);
- pos = z.find_last_not_of("Xa");
- assert(pos == 1);
- pos = z.find_last_of("ab");
- assert(pos == 1);
- pos = z.find_last_of("Xa");
- assert(pos == 0);
- pos = z.find_last_of("Xb");
- assert(pos == 1);
- pos = z.find_last_of("XYZ");
- assert(pos == string::npos);
- pos = z.find_last_of('a');
- assert(pos == 0);
- pos = z.find_last_of('b');
- assert(pos == 1);
- pos = z.find_last_of('X');
- assert(pos == string::npos);
-}
-
-void comparetest()
-{
- string x = X;
- string y = Y;
- string n = N;
- string z = x + y;
-
- assert(x != y);
- assert(x == "Hello");
- assert(x != z.substr (0, 4));
- assert(x.compare (y) < 0);
- assert(x.compare (z.substr (0, 6)) < 0);
-
- assert(x.find ("lo") == 3);
- assert(x.find ("l", 2) == 2);
- assert(x.rfind ("l") == 3);
-}
-
-void substrtest()
-{
- string x = X;
-
- char ch = x[0];
- cout << "ch = x[0] = " << ch << "\n";
- assert(ch == 'H');
-
- string z = x.substr (2, 3);
- cout << "z = x.substr (2, 3) = " << z << "\n";
- assert(z == "llo");
-
- x.replace (2, 2, "r");
- cout << "x.replace (2, 2, r); x = " << x << "\n";
- assert(x == "Hero");
-
- x = X;
- x.replace (0, 1, 'j');
- cout << "x.replace (0, 1, 'j'); x = " << x << "\n";
- assert(x == "jello");
-
- int ar[] = { 'H', 'e', 'l', 'l', 'o' };
- x.replace (find (x.begin (), x.end (), 'l'),
- find (x.rbegin (), x.rend (), 'l').base (),
- ar, ar+sizeof(ar)/sizeof(ar[0]));
- cout << "x = " << x << endl;
- assert (x == "jeHelloo");
-}
-
-void iotest()
-{
- string z;
- cout << "enter a word:";
- cin >> z;
- cout << "word =" << z << " ";
- cout << "length = " << z.length() << "\n";
-}
-
-void identitytest(string a, string b)
-{
- string x = a;
- string y = b;
- x += b;
- y.insert (0, a);
- assert((a + b) == x);
- assert((a + b) == y);
- assert(x == y);
-
- assert((a + b + a) == (a + (b + a)));
-
- x.erase (x.rfind (b));
- assert(x == a);
-
- y.replace (0, y.rfind (b), b);
- assert(y == (b + b));
- y.replace (y.find (b), b.length (), a);
- assert(y == (a + b));
-}
-
-int main()
-{
- decltest();
- cattest();
- comparetest();
- findtest();
- substrtest();
- identitytest(X, X);
- identitytest(X, Y);
- identitytest(X+Y+N+X+Y+N, "A string that will be used in identitytest but is otherwise just another useless string.");
- iotest();
- cout << "\nEnd of test\n";
- return 0;
-}
diff --git a/contrib/libstdc++/tests/tstring.exp b/contrib/libstdc++/tests/tstring.exp
deleted file mode 100644
index 4526279b888a..000000000000
--- a/contrib/libstdc++/tests/tstring.exp
+++ /dev/null
@@ -1,22 +0,0 @@
-an empty string:
-A string initialized to Hello:Hello
-A string initialized to previous string:Hello
-A string initialized to (previous string, 1, 2):el
-A string initialized to @:@
-A string initialized to 20:20
-n = 20 atoi(n) = 20 atof(n) = 20
-is = Hello
-z = x + y = Helloworld
-x += y; x = Helloworld
-y.insert (0, x); y = Helloworld
-x = x + y + x; x = HelloworldHello
-x = y + x + x; x = worldHelloHello
-z = x + s + + y.substr (y.find (w), 1) + y.substr (y.find (w) + 1) + . = Hello, world.
-ch = x[0] = H
-z = x.substr (2, 3) = llo
-x.replace (2, 2, r); x = Hero
-x.replace (0, 1, 'j'); x = jello
-x = jeHelloo
-enter a word:word =abcdefghijklmnopqrstuvwxyz length = 26
-
-End of test
diff --git a/contrib/libstdc++/tests/tstring.inp b/contrib/libstdc++/tests/tstring.inp
deleted file mode 100644
index b0883f382e1a..000000000000
--- a/contrib/libstdc++/tests/tstring.inp
+++ /dev/null
@@ -1 +0,0 @@
-abcdefghijklmnopqrstuvwxyz
diff --git a/contrib/libstdc++/tests/tvector.cc b/contrib/libstdc++/tests/tvector.cc
deleted file mode 100644
index ef238ef52da5..000000000000
--- a/contrib/libstdc++/tests/tvector.cc
+++ /dev/null
@@ -1,20 +0,0 @@
-#include <vector.h>
-#include <iostream.h>
-#include <algo.h>
-
-main ()
-{
- cout << "Fill of C array:\n";
- char x[50];
- fill (x, x+50, '/');
- fill (x+1, x+49, '*');
- copy (x, x+50, ostream_iterator<char>(cout));
-
- cout << "\nFill of vector<char>:\n";
-
- vector<char> cvec;
- cvec.insert (cvec.begin(), 50, '/');
- fill (cvec.begin()+1, cvec.end()-1, '-');
- copy (cvec.begin(), cvec.end(), ostream_iterator<char>(cout));
- cout << endl;
-}
diff --git a/contrib/libstdc++/tests/tvector.exp b/contrib/libstdc++/tests/tvector.exp
deleted file mode 100644
index 84a9d1bf3a4d..000000000000
--- a/contrib/libstdc++/tests/tvector.exp
+++ /dev/null
@@ -1,4 +0,0 @@
-Fill of C array:
-/************************************************/
-Fill of vector<char>:
-/------------------------------------------------/
diff --git a/contrib/libstdc++/testsuite/ChangeLog b/contrib/libstdc++/testsuite/ChangeLog
deleted file mode 100644
index 3d7602748ece..000000000000
--- a/contrib/libstdc++/testsuite/ChangeLog
+++ /dev/null
@@ -1,94 +0,0 @@
-Fri Mar 16 12:46:19 GMT 2001 Bernd Schmidt (bernds@redhat.com)
-
- * gcc-2.95.3 Released.
-
-Sun Oct 24 23:54:10 PDT 1999 Jeff Law (law@cygnus.com)
-
- * gcc-2.95.2 Released.
-
-Mon Aug 16 01:29:24 PDT 1999 Jeff Law (law@cygnus.com)
-
- * gcc-2.95.1 Released.
-
-Wed Jul 28 21:39:31 PDT 1999 Jeff Law (law@cygnus.com)
-
- * gcc-2.95 Released.
-
-Sun Jul 25 23:40:51 PDT 1999 Jeff Law (law@cygnus.com)
-
- * gcc-2.95 Released.
-
-Wed Nov 25 01:00:07 1998 Marc Espie <espie@quatramaran.ens.fr>
-
- * Makefile.in (just-check): Ignore errors.
-
-Sun Jun 28 00:00:10 1998 Carlo Wood <carlo@runaway.xs4all.nl>
-
- * lib/libstdc++.exp: Use global variable ld_library_path (not local)
- that is a lot more persistent; dejagnu-980528 needs this.
- * lib/libstdc++.exp (test_stdc++): Use regular expression " -lstdc.."
- to remove -lstdc++ arguments (not " -lstdc.*").
-
-Thu Dec 25 00:34:03 1997 Jeffrey A Law (law@cygnus.com)
-
- * lib/libstdc++.exp (test_libstdc++): Set LD_LIBRARY_PATH
- and SHLIB_PATH appropriately.
-
-Wed Sep 3 09:39:36 1997 Jeffrey A Law (law@cygnus.com)
-
- * lib/libstdc++.exp: Remove libg++_link_flags.
-
-Wed Aug 6 18:43:23 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * lib/libstdc++.exp: Remove libio_link_flags.
-
-Thu Jul 17 14:54:58 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * lib/libstdc++.exp (base_dir): Move from here...
- (test_libstdc++): To here.
- (LIBSTDCPP): Delete unused global decl.
-
-Tue Jun 17 01:46:49 1997 Bob Manson <manson@farmer>
-
- * lib/libstdc++.exp: Strip off leading LFs from both the pattern
- being matched against and the output from the board. Find the
- correct multilib libstdc++ to link with. Use g++_link_flags
- and libio_link_flags. Link in the status wrapper if needed.
- (libstdc++_init): New procedure.
-
-Tue Jun 3 17:16:39 1997 Bob Manson <manson@charmed.cygnus.com>
-
- * lib/libstdc++.exp: Don't use global exec_output variable; the
- output is returned from remote_load instead.
-
-Tue Apr 29 17:20:05 1997 Mike Stump <mrs@cygnus.com>
-
- * lib/libstdc++.exp: Fixup so that $compile_args works better.
- * libstdc++.tests/test.exp: Also run with -O.
-
-Tue Apr 29 16:34:37 1997 Mike Stump <mrs@cygnus.com>
-
- * testsuite/lib/libstdc++.exp: Fixup so that we always have the
- same number of testcases, and so that we have meaningful testcase
- names.
-
-Tue Apr 29 13:05:14 1997 Bob Manson <manson@charmed.cygnus.com>
-
- * lib/libstdc++.exp: Add support for --tool_opts.
-
-Mon Apr 28 11:10:25 1997 Bob Manson <manson@charmed.cygnus.com>
-
- * Makefile.in: Add comment so target Makefile fragments get added.
- Removed clean rule, because it is added by configure.
-
- * configure.in (TESTS): Add.
-
-Sun Apr 27 15:03:10 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * Makefile.in (clean): Add empty rule for now.
-
-Fri Apr 25 18:59:14 1997 Bob Manson <manson@charmed.cygnus.com>
-
- * lib/libstdc++.exp(test_libstdc++): Return on error. Generate a
- FAIL if the compile fails. Remove CRs from the output from the
- testcase.
diff --git a/contrib/libstdc++/testsuite/Makefile.in b/contrib/libstdc++/testsuite/Makefile.in
deleted file mode 100644
index 7c85678e1fe3..000000000000
--- a/contrib/libstdc++/testsuite/Makefile.in
+++ /dev/null
@@ -1,67 +0,0 @@
-# Copyright (C) 1997 Free Software Foundation
-#
-# 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 GNU CC; see the file COPYING. If not, write to
-# the Free Software Foundation, 59 Temple Place - Suite 330,
-# Boston, MA 02111-1307, USA. */
-
-srcdir = libstdc++.tests
-
-EXPECT = `if [ -f $${rootme}/../../expect/expect ] ; then \
- echo $${rootme}/../../expect/expect ; \
- else echo expect ; fi`
-
-RUNTEST = `if [ -f $${srcdir}/../../dejagnu/runtest ] ; then \
- echo $${srcdir}/../../dejagnu/runtest ; \
- else echo runtest; fi`
-RUNTESTFLAGS =
-
-#### package, host, target, and site dependent Makefile fragments come in here.
-##
-
-.PHONY: all
-all:
-
-.PHONY: check
-check: all just-check
-
-site.exp: ./config.status Makefile
- @echo "Making a new config file..."
- -@rm -f ./tmp?
- @touch site.exp
- -@mv site.exp site.bak
- @echo "## these variables are automatically generated by make ##" > ./tmp0
- @echo "# Do not edit here. If you wish to override these values" >> ./tmp0
- @echo "# add them to the last section" >> ./tmp0
- @echo "set host_alias $(host_alias)" >> ./tmp0
- @echo "set host_triplet ${host_canonical}" >> ./tmp0
- @echo "set target_alias $(target_alias)" >> ./tmp0
- @echo "set target_triplet ${target_canonical}" >> ./tmp0
- @echo "set build_triplet ${build_canonical}" >> ./tmp0
- @echo "set srcdir ${srcdir}" >> ./tmp0
- @echo "set tool libstdc++" >> ./tmp0
- @echo "## All variables above are generated by configure. Do Not Edit ##" >> ./tmp0
- @cat ./tmp0 > site.exp
- @cat site.bak | sed \
- -e '1,/^## All variables above are.*##/ d' >> site.exp
- -@rm -f ./tmp?
-
-just-check: site.exp
- -rootme=`pwd`; export rootme; \
- srcdir=${srcdir} ; export srcdir ; \
- EXPECT=${EXPECT} ; export EXPECT ; \
- if [ -f $${rootme}/../../expect/expect ] ; then \
- TCL_LIBRARY=$${srcdir}/../../tcl/library ; \
- export TCL_LIBRARY ; fi ; \
- $(RUNTEST) $(RUNTESTFLAGS)
diff --git a/contrib/libstdc++/testsuite/config/default.exp b/contrib/libstdc++/testsuite/config/default.exp
deleted file mode 100644
index 90967cccc18a..000000000000
--- a/contrib/libstdc++/testsuite/config/default.exp
+++ /dev/null
@@ -1 +0,0 @@
-load_lib "standard.exp"
diff --git a/contrib/libstdc++/testsuite/configure.in b/contrib/libstdc++/testsuite/configure.in
deleted file mode 100644
index ad5f232b0853..000000000000
--- a/contrib/libstdc++/testsuite/configure.in
+++ /dev/null
@@ -1,24 +0,0 @@
-# This file is a shell script fragment that supplies the information
-# necessary for a configure script to process the program in
-# this directory. For more information, look at ../../configure.
-
-configdirs=
-srctrigger=configure.in
-srcname="tests for ANSI C++ library, dejagnu style"
-package_makefile_frag=Make.pack
-package_makefile_rules_frag=Make.pack.r
-
-# per-host:
-
-# per-target:
-
-target_makefile_frag=../target-mkfrag
-
-TO_TOPDIR=../../
-ALL=' '
-XCXXINCLUDES="-I${srcdir}/.. -I${srcdir}/../stl -I${TO_TOPDIR}libio -I${srcdir}/${TO_TOPDIR}libio"
-TESTS="tcomplex tstring tlist tmap tvector"
-MOSTLYCLEAN="*.o core ${TESTS} *.out"
-(. ${srcdir}/${TO_TOPDIR}libio/config.shared) >${package_makefile_frag} 2>${package_makefile_rules_frag}
-
-# post-target:
diff --git a/contrib/libstdc++/testsuite/lib/libstdc++.exp b/contrib/libstdc++/testsuite/lib/libstdc++.exp
deleted file mode 100644
index 3333ddad6c78..000000000000
--- a/contrib/libstdc++/testsuite/lib/libstdc++.exp
+++ /dev/null
@@ -1,179 +0,0 @@
-# Copyright (C) 1997 Free Software Foundation, Inc.
-
-# This program 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 of the License, or
-# (at your option) any later version.
-#
-# This program 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 program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-# Please email any bugs, comments, and/or additions to this file to:
-# bug-lib-g++@prep.ai.mit.edu
-
-# This file was written by Bob Manson. (manson@cygnus.com)
-
-load_lib "libgloss.exp"
-
-global tmpdir
-
-if ![info exists tmpdir] {
- set tmpdir "/tmp"
-}
-
-#
-# Build the status wrapper library as needed.
-#
-proc libstdc++_init { args } {
- global wrapper_file;
- global wrap_compile_flags;
- set wrapper_file "";
- set wrap_compile_flags "";
- if [target_info exists needs_status_wrapper] {
- set result [build_wrapper "testglue.o"];
- if { $result != "" } {
- set wrapper_file [lindex $result 0];
- set wrap_compile_flags [lindex $result 1];
- } else {
- warning "Status wrapper failed to build."
- }
- }
-}
-#
-# Run the test specified by srcfile and resultfile. compile_args and
-# exec_args are additional arguments to be passed in when compiling and
-# running the testcase, respectively.
-#
-
-proc test_libstdc++ { options srcfile compile_args inpfile resultfile exec_args } {
- global base_dir
- global LIBSTDCPP
- global srcdir subdir objdir
- global TOOL_OPTIONS
- global ld_library_path
-
- if [info exists LIBSTDCPP] {
- set libstdcpp $LIBSTDCPP;
- } else {
- set gp [get_multilibs];
- if { $gp != "" } {
- if [file exists "$gp/libstdc++/libstdc++.a"] {
- set libstdcpp "-L$gp/libstdc++ -lstdc++";
- }
- }
- if ![info exists libstdcpp] {
- set libstdcpp [findfile $base_dir/../../libstdc++/libstdc++.a "-L$base_dir/../../libstdc++ -lstdc++" -lstdc++]
- }
- }
-
- verbose "using LIBSTDCPP = $libstdcpp" 2
- set args ""
-
- # Basically we want to build up a colon separated path list from
- # the value of $libstdcpp.
-
- # First strip away any -L arguments.
- regsub -all -- "-L" $libstdcpp "" ld_library_path
-
- # Then remove any -lstdc++ argument.
- regsub -all -- " -lstdc.." $ld_library_path "" ld_library_path
-
- # That's enough to make things work for the normal case.
- # If we wanted to handle an arbitrary value of libstdcpp,
- # then we'd have to do a lot more work.
-
- if { $compile_args != "" } {
- lappend args "additional_flags=$compile_args"
- }
- lappend args "incdir=.."
- lappend args "incdir=$srcdir/.."
- lappend args "incdir=$srcdir/../stl"
- lappend args "incdir=."
- if [info exists TOOL_OPTIONS] {
- lappend args "additional_flags=$TOOL_OPTIONS"
- }
-
- global wrapper_file wrap_compile_flags;
- # We have to include libio, for _G_config.h.
- lappend args "additional_flags=$wrap_compile_flags";
- lappend args "libs=$wrapper_file";
- lappend args "libs=$libstdcpp";
- lappend args "additional_flags=[libio_include_flags]"
- lappend args debug
-
- regsub "^.*/(\[^/.\]+)\[.\]\[^/]*$" "$srcfile" "\\1" out
- set executable "${objdir}/$out"
- set errname "[file tail $srcfile]"
- if { $compile_args != "" } {
- set errname "$errname $compile_args"
- }
-
- if { [target_compile $srcfile "$executable" executable $args] != "" } {
- fail "$errname compilation"
- setup_xfail "*-*-*"
- fail "$errname execution"
- setup_xfail "*-*-*"
- fail "$errname output"
- return;
- }
- pass "$errname compilation"
-
- set result [libstdc++_load $executable "$exec_args" "$inpfile"];
- set status [lindex $result 0];
- set output [lindex $result 1];
- $status "$errname execution"
- if { $status != "pass" } {
- setup_xfail "*-*-*"
- fail "$errname output"
- return;
- }
-
- verbose "resultfile is $resultfile"
- set id [open $resultfile r];
- set expected ""
- append expected [read $id];
- regsub -all "\r" "$output" "" output;
- regsub "\n*$" $expected "" expected
- regsub "\n*$" $output "" output
- regsub "^\n*" $expected "" expected
- regsub "^\n*" $output "" output
- regsub -all "\[ \t\]\[ \t\]*" $expected " " expected
- regsub -all "\[ \t\]*\n\n*" $expected "\n" expected
- regsub -all "\[ \t\]\[ \t\]*" $output " " output
- regsub -all "\[ \t\]*\n\n*" $output "\n" output
- verbose "expected is $expected"
- verbose "actual is $output"
- set passed 0;
- if {$options == "regexp_match"} {
- if [regexp $expected $output] {
- set passed 1;
- }
- } else {
- if { $expected == $output } {
- set passed 1;
- }
- }
- if { $passed == 1 } {
- pass "$errname output"
- } else {
- clone_output "expected was $expected"
- clone_output "output was $output"
- fail "$errname output"
- }
- close $id;
-}
-
-#
-# libstdc++_version -- extract and print the version number of libstdc++p
-#
-proc default_libstdc++_version {} {
-}
-
-proc default_libstdc++_start { } {
-}
diff --git a/contrib/libstdc++/testsuite/libstdc++.tests/test.exp b/contrib/libstdc++/testsuite/libstdc++.tests/test.exp
deleted file mode 100644
index 7368cfb282e8..000000000000
--- a/contrib/libstdc++/testsuite/libstdc++.tests/test.exp
+++ /dev/null
@@ -1,34 +0,0 @@
-global srcdir subdir
-
-catch "glob -nocomplain $srcdir/$subdir/../../tests/*.exp" srcfiles
-verbose "srcfiles are $srcfiles"
-
-set prefix ""
-foreach x $srcfiles {
- regsub "\\.exp$" $x "" prefix
- set bname [file tail $prefix]
- set args ""
- if [file exists $srcdir/$subdir/${bname}.arg] {
- set id [open "$srcdir/$subdir/${bname}.arg" r];
- set args [read -nonewline $id];
- close $id;
- }
- if [file exists $srcdir/$subdir/${bname}.xpo] {
- set resfile "$srcdir/$subdir/${bname}.xpo"
- set options "regexp_match"
- } else {
- set resfile "${prefix}.exp"
- set options ""
- }
-
- if [file exists ${prefix}.inp] {
- set inpfile ${prefix}.inp
- } else {
- set inpfile ""
- }
-
- verbose "inpfile is $inpfile"
-
- test_libstdc++ $options "${prefix}.cc" "" $inpfile $resfile $args
- test_libstdc++ $options "${prefix}.cc" "-O" $inpfile $resfile $args
-}
diff --git a/contrib/libstdc++/valarray b/contrib/libstdc++/valarray
deleted file mode 100644
index a938b6a68639..000000000000
--- a/contrib/libstdc++/valarray
+++ /dev/null
@@ -1,8 +0,0 @@
-// Main header for -*- C++ -*- valarray classes.
-
-#ifndef __VALARRAY__
-#define __VALARRAY__
-
-#include <std/std_valarray.h>
-
-#endif
diff --git a/contrib/libstdc++/valarray.cc b/contrib/libstdc++/valarray.cc
deleted file mode 100644
index 5e7fe0cf05f7..000000000000
--- a/contrib/libstdc++/valarray.cc
+++ /dev/null
@@ -1,50 +0,0 @@
-#include <std/std_valarray.h>
-
-// Some Explicit Instanciations.
-template class multiplies<size_t>;
-template size_t accumulate(size_t*, size_t*, size_t, multiplies<size_t>);
-
-template void
- __valarray_fill(size_t* __restrict__, size_t, const size_t&);
-
-template void
- __valarray_copy(const size_t* __restrict__, size_t, size_t* __restrict__);
-
-template valarray<size_t>::valarray(size_t);
-template valarray<size_t>::~valarray();
-template valarray<size_t>::valarray(const valarray<size_t>&);
-template size_t valarray<size_t>::size() const;
-template size_t& valarray<size_t>::operator[](size_t);
-template size_t valarray<size_t>::product() const;
-
-
-void __gslice_to_index(size_t __o, const valarray<size_t>& __l,
- const valarray<size_t>& __s,
- valarray<size_t>& __i)
-{
- const size_t __n = __l.size();
- size_t* const __t = static_cast<size_t*>(alloca(__n*sizeof(size_t)));
- __valarray_fill(__t, __n, size_t(0));
- const size_t __z = __i.size();
- __valarray_fill(&__i[0], __z, __o);
- for (size_t __j=0; __j<__z; ++__j) {
- for (size_t __k=0; __k<__n; ++__k)
- __i[__j] += __s[__k]*__t[__k];
- ++__t[__n-1];
- for (size_t __k=__n-1; __k; --__k) {
- if (__t[__k] >= __l[__k]) {
- __t[__k] = 0;
- ++__t[__k-1];
- }
- }
- }
-}
-
-_Indexer::_Indexer(size_t __o, const valarray<size_t>& __l,
- const valarray<size_t>& __s)
- : _M_count(1), _M_start(__o), _M_size(__l), _M_stride(__s),
- _M_index(__l.size() ? __l.product() : 0)
-{ __gslice_to_index(__o, __l, __s, _M_index); }
-
-
-